From: Andrea Amorese Date: Thu, 26 Aug 2021 14:33:43 +0000 (+0200) Subject: Built motion from commit e1e3b87e.|2.5.34 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=74f8f734aed23799b025005f30196cd29c390dab;p=motion2.git Built motion from commit e1e3b87e.|2.5.34 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 73a12f3..ddef370 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-26T14:20:30.926Z", + "time": "2021-08-26T14:27:48.862Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 78db974..a1603ac 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-26T14:20:30.926Z", + "time": "2021-08-26T14:27:48.862Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 652760e..fb64c09 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 _0xc8a1=['exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x405e31,_0x5ab85e){var _0x4aada5=function(_0x539f74){while(--_0x539f74){_0x405e31['push'](_0x405e31['shift']());}};_0x4aada5(++_0x5ab85e);}(_0xc8a1,0x197));var _0x1c8a=function(_0x93d9c,_0x2ca30e){_0x93d9c=_0x93d9c-0x0;var _0x5713a8=_0xc8a1[_0x93d9c];return _0x5713a8;};'use strict';var Sequelize=require(_0x1c8a('0x0'));module[_0x1c8a('0x1')]={'name':{'type':Sequelize[_0x1c8a('0x2')],'get':function(_0x4398b9){return this[_0x1c8a('0x3')](_0x1c8a('0x4'));}},'action':{'type':Sequelize[_0x1c8a('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1c8a('0x6'),_0x1c8a('0x7'),_0x1c8a('0x8'),'jscripty',_0x1c8a('0x9'),_0x1c8a('0xa'),_0x1c8a('0xb'),'script']],'msg':_0x1c8a('0xc')}},'comment':_0x1c8a('0xc')},'data1':{'type':Sequelize[_0x1c8a('0x5')](0x1000),'comment':_0x1c8a('0xd')},'data2':{'type':Sequelize[_0x1c8a('0x5')](0x1000),'comment':_0x1c8a('0xe')},'data3':{'type':Sequelize[_0x1c8a('0x5')](0x1000),'comment':_0x1c8a('0xf')},'data4':{'type':Sequelize[_0x1c8a('0x5')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x1c8a('0x5')]},'data7':{'type':Sequelize[_0x1c8a('0x10')]}}; \ No newline at end of file +var _0x9cb2=['contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x58b57c,_0x469955){var _0x5c6322=function(_0x19e898){while(--_0x19e898){_0x58b57c['push'](_0x58b57c['shift']());}};_0x5c6322(++_0x469955);}(_0x9cb2,0x1c6));var _0x29cb=function(_0x37b56c,_0xab948f){_0x37b56c=_0x37b56c-0x0;var _0x56946e=_0x9cb2[_0x37b56c];return _0x56946e;};'use strict';var Sequelize=require(_0x29cb('0x0'));module[_0x29cb('0x1')]={'name':{'type':Sequelize[_0x29cb('0x2')],'get':function(_0x1b21ff){return this[_0x29cb('0x3')]('action');}},'action':{'type':Sequelize[_0x29cb('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x29cb('0x5'),_0x29cb('0x6'),_0x29cb('0x7'),_0x29cb('0x8'),_0x29cb('0x9'),_0x29cb('0xa'),_0x29cb('0xb'),_0x29cb('0xc')]],'msg':_0x29cb('0xd')}},'comment':_0x29cb('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x29cb('0xe')},'data2':{'type':Sequelize[_0x29cb('0x4')](0x1000),'comment':_0x29cb('0xf')},'data3':{'type':Sequelize[_0x29cb('0x4')](0x1000),'comment':_0x29cb('0x10')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x29cb('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c6dc858..f9e9581 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 _0xbb75=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring'];(function(_0x3ae812,_0x104449){var _0x4dd965=function(_0x4c48ac){while(--_0x4c48ac){_0x3ae812['push'](_0x3ae812['shift']());}};_0x4dd965(++_0x104449);}(_0xbb75,0x175));var _0x5bb7=function(_0x2eec69,_0x54be60){_0x2eec69=_0x2eec69-0x0;var _0x553cb1=_0xbb75[_0x2eec69];return _0x553cb1;};'use strict';var emlformat=require(_0x5bb7('0x0'));var rimraf=require(_0x5bb7('0x1'));var zipdir=require(_0x5bb7('0x2'));var jsonpatch=require(_0x5bb7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5bb7('0x4'));var Mustache=require(_0x5bb7('0x5'));var util=require('util');var path=require(_0x5bb7('0x6'));var sox=require(_0x5bb7('0x7'));var csv=require(_0x5bb7('0x8'));var ejs=require(_0x5bb7('0x9'));var fs=require('fs');var fs_extra=require(_0x5bb7('0xa'));var _=require('lodash');var squel=require(_0x5bb7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bb7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5bb7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5bb7('0xe'));var as=require(_0x5bb7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bb7('0x10'))(_0x5bb7('0x11'));var utils=require(_0x5bb7('0x12'));var config=require(_0x5bb7('0x13'));var licenseUtil=require(_0x5bb7('0x14'));var db=require(_0x5bb7('0x15'))['db'];function respondWithStatusCode(_0x5580cd,_0x17495d){_0x17495d=_0x17495d||0xcc;return function(_0x1b7fab){if(_0x1b7fab){return _0x5580cd[_0x5bb7('0x16')](_0x17495d);}return _0x5580cd[_0x5bb7('0x17')](_0x17495d)['end']();};}function respondWithResult(_0x1a3ff4,_0x5c7af7){_0x5c7af7=_0x5c7af7||0xc8;return function(_0x4982dc){if(_0x4982dc){return _0x1a3ff4['status'](_0x5c7af7)[_0x5bb7('0x18')](_0x4982dc);}};}function respondWithFilteredResult(_0x5e48ae,_0x4b60b2){return function(_0x3a86){if(_0x3a86){var _0x3fe091=typeof _0x4b60b2[_0x5bb7('0x19')]==='undefined'&&typeof _0x4b60b2[_0x5bb7('0x1a')]===_0x5bb7('0x1b');var _0x16d423=_0x3a86[_0x5bb7('0x1c')];var _0x4d7df8=_0x3fe091?0x0:_0x4b60b2['offset'];var _0x16cc19=_0x3fe091?_0x3a86[_0x5bb7('0x1c')]:_0x4b60b2['offset']+_0x4b60b2['limit'];var _0x595563;if(_0x16cc19>=_0x16d423){_0x16cc19=_0x16d423;_0x595563=0xc8;}else{_0x595563=0xce;}_0x5e48ae[_0x5bb7('0x17')](_0x595563);return _0x5e48ae[_0x5bb7('0x1d')](_0x5bb7('0x1e'),_0x4d7df8+'-'+_0x16cc19+'/'+_0x16d423)[_0x5bb7('0x18')](_0x3a86);}return null;};}function patchUpdates(_0x327633){return function(_0x522da8){try{jsonpatch['apply'](_0x522da8,_0x327633,!![]);}catch(_0x2ae135){return BPromise[_0x5bb7('0x1f')](_0x2ae135);}return _0x522da8[_0x5bb7('0x20')]();};}function saveUpdates(_0x3e4dd4,_0x50e39a){return function(_0x3e7f8f){if(_0x3e7f8f){return _0x3e7f8f['update'](_0x3e4dd4)[_0x5bb7('0x21')](function(_0x3fe5ca){return _0x3fe5ca;});}return null;};}function removeEntity(_0xfb7496,_0x2498f){return function(_0x168957){if(_0x168957){return _0x168957[_0x5bb7('0x22')]()[_0x5bb7('0x21')](function(){_0xfb7496[_0x5bb7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2953fc,_0x54d3cd){return function(_0x47873b){if(!_0x47873b){_0x2953fc[_0x5bb7('0x16')](0x194);}return _0x47873b;};}function handleError(_0x5082ac,_0x46f91c){_0x46f91c=_0x46f91c||0x1f4;return function(_0x7bd9ee){logger[_0x5bb7('0x23')](_0x7bd9ee['stack']);if(_0x7bd9ee[_0x5bb7('0x24')]){delete _0x7bd9ee[_0x5bb7('0x24')];}_0x5082ac[_0x5bb7('0x17')](_0x46f91c)[_0x5bb7('0x25')](_0x7bd9ee);};}exports['update']=function(_0x39b201,_0x534733){if(_0x39b201['body']['id']){delete _0x39b201[_0x5bb7('0x26')]['id'];}return db[_0x5bb7('0x27')][_0x5bb7('0x28')]({'where':{'id':_0x39b201[_0x5bb7('0x29')]['id']}})[_0x5bb7('0x21')](handleEntityNotFound(_0x534733,null))[_0x5bb7('0x21')](saveUpdates(_0x39b201[_0x5bb7('0x26')],null))[_0x5bb7('0x21')](respondWithResult(_0x534733,null))['catch'](handleError(_0x534733,null));};exports['destroy']=function(_0x1f7c9d,_0x1a01da){return db[_0x5bb7('0x27')][_0x5bb7('0x28')]({'where':{'id':_0x1f7c9d['params']['id']}})[_0x5bb7('0x21')](handleEntityNotFound(_0x1a01da,null))['then'](removeEntity(_0x1a01da,null))[_0x5bb7('0x2a')](handleError(_0x1a01da,null));}; \ No newline at end of file +var _0x171c=['../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','rimraf','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5137db,_0x3ee818){var _0x44a2a9=function(_0x27fb7d){while(--_0x27fb7d){_0x5137db['push'](_0x5137db['shift']());}};_0x44a2a9(++_0x3ee818);}(_0x171c,0x6b));var _0xc171=function(_0x3ce0d2,_0x547d96){_0x3ce0d2=_0x3ce0d2-0x0;var _0xca2c8=_0x171c[_0x3ce0d2];return _0xca2c8;};'use strict';var emlformat=require(_0xc171('0x0'));var rimraf=require(_0xc171('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc171('0x2'));var moment=require(_0xc171('0x3'));var BPromise=require(_0xc171('0x4'));var Mustache=require('mustache');var util=require(_0xc171('0x5'));var path=require(_0xc171('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc171('0x7'));var _=require(_0xc171('0x8'));var squel=require(_0xc171('0x9'));var crypto=require('crypto');var jsforce=require(_0xc171('0xa'));var deskjs=require(_0xc171('0xb'));var toCsv=require(_0xc171('0xc'));var querystring=require(_0xc171('0xd'));var Papa=require(_0xc171('0xe'));var Redis=require('ioredis');var authService=require(_0xc171('0xf'));var qs=require(_0xc171('0x10'));var as=require(_0xc171('0x11'));var hardwareService=require(_0xc171('0x12'));var logger=require(_0xc171('0x13'))(_0xc171('0x14'));var utils=require(_0xc171('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc171('0x16'))['db'];function respondWithStatusCode(_0xe27d3c,_0xeb0d8e){_0xeb0d8e=_0xeb0d8e||0xcc;return function(_0xb8f18d){if(_0xb8f18d){return _0xe27d3c['sendStatus'](_0xeb0d8e);}return _0xe27d3c[_0xc171('0x17')](_0xeb0d8e)[_0xc171('0x18')]();};}function respondWithResult(_0x2bd312,_0x5d71ca){_0x5d71ca=_0x5d71ca||0xc8;return function(_0x166a45){if(_0x166a45){return _0x2bd312[_0xc171('0x17')](_0x5d71ca)[_0xc171('0x19')](_0x166a45);}};}function respondWithFilteredResult(_0x47507d,_0x32f1a1){return function(_0x3b4438){if(_0x3b4438){var _0x1d01bc=typeof _0x32f1a1[_0xc171('0x1a')]===_0xc171('0x1b')&&typeof _0x32f1a1['limit']==='undefined';var _0x542869=_0x3b4438['count'];var _0x21c330=_0x1d01bc?0x0:_0x32f1a1[_0xc171('0x1a')];var _0x457d17=_0x1d01bc?_0x3b4438[_0xc171('0x1c')]:_0x32f1a1[_0xc171('0x1a')]+_0x32f1a1[_0xc171('0x1d')];var _0x8b90f1;if(_0x457d17>=_0x542869){_0x457d17=_0x542869;_0x8b90f1=0xc8;}else{_0x8b90f1=0xce;}_0x47507d[_0xc171('0x17')](_0x8b90f1);return _0x47507d['set']('Content-Range',_0x21c330+'-'+_0x457d17+'/'+_0x542869)[_0xc171('0x19')](_0x3b4438);}return null;};}function patchUpdates(_0x4dce58){return function(_0x5d0a93){try{jsonpatch['apply'](_0x5d0a93,_0x4dce58,!![]);}catch(_0x34408f){return BPromise['reject'](_0x34408f);}return _0x5d0a93['save']();};}function saveUpdates(_0x52d9bf,_0x3e74ce){return function(_0x1c8a7a){if(_0x1c8a7a){return _0x1c8a7a[_0xc171('0x1e')](_0x52d9bf)['then'](function(_0x3b517e){return _0x3b517e;});}return null;};}function removeEntity(_0x294b53,_0x13462f){return function(_0x1e8987){if(_0x1e8987){return _0x1e8987[_0xc171('0x1f')]()[_0xc171('0x20')](function(){_0x294b53['status'](0xcc)[_0xc171('0x18')]();});}};}function handleEntityNotFound(_0x554f62,_0x4214a3){return function(_0x289105){if(!_0x289105){_0x554f62['sendStatus'](0x194);}return _0x289105;};}function handleError(_0x427b3e,_0x3d4559){_0x3d4559=_0x3d4559||0x1f4;return function(_0x4d4beb){logger[_0xc171('0x21')](_0x4d4beb[_0xc171('0x22')]);if(_0x4d4beb[_0xc171('0x23')]){delete _0x4d4beb[_0xc171('0x23')];}_0x427b3e[_0xc171('0x17')](_0x3d4559)[_0xc171('0x24')](_0x4d4beb);};}exports[_0xc171('0x1e')]=function(_0x5997ad,_0x558d36){if(_0x5997ad[_0xc171('0x25')]['id']){delete _0x5997ad[_0xc171('0x25')]['id'];}return db['Action'][_0xc171('0x26')]({'where':{'id':_0x5997ad[_0xc171('0x27')]['id']}})[_0xc171('0x20')](handleEntityNotFound(_0x558d36,null))[_0xc171('0x20')](saveUpdates(_0x5997ad[_0xc171('0x25')],null))[_0xc171('0x20')](respondWithResult(_0x558d36,null))[_0xc171('0x28')](handleError(_0x558d36,null));};exports[_0xc171('0x1f')]=function(_0x294d8c,_0x778647){return db[_0xc171('0x29')][_0xc171('0x26')]({'where':{'id':_0x294d8c[_0xc171('0x27')]['id']}})['then'](handleEntityNotFound(_0x778647,null))[_0xc171('0x20')](removeEntity(_0x778647,null))[_0xc171('0x28')](handleError(_0x778647,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 300aaae..f4f6f7d 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 _0x7497=['util','../../config/logger','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x15fd53,_0x216ac8){var _0x816374=function(_0x3aaf5d){while(--_0x3aaf5d){_0x15fd53['push'](_0x15fd53['shift']());}};_0x816374(++_0x216ac8);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7749('0x3'));var fs=require('fs');var path=require(_0x7749('0x4'));var rimraf=require('rimraf');var config=require(_0x7749('0x5'));var attributes=require(_0x7749('0x6'));module[_0x7749('0x7')]=function(_0x455d05,_0x289268){return _0x455d05[_0x7749('0x8')](_0x7749('0x9'),attributes,{'tableName':_0x7749('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b59=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','util'];(function(_0x172a03,_0x126c26){var _0x40cd5c=function(_0x263dcc){while(--_0x263dcc){_0x172a03['push'](_0x172a03['shift']());}};_0x40cd5c(++_0x126c26);}(_0x8b59,0x1d7));var _0x98b5=function(_0x55a695,_0xfb612d){_0x55a695=_0x55a695-0x0;var _0x2cc6b0=_0x8b59[_0x55a695];return _0x2cc6b0;};'use strict';var _=require(_0x98b5('0x0'));var util=require(_0x98b5('0x1'));var logger=require('../../config/logger')(_0x98b5('0x2'));var moment=require(_0x98b5('0x3'));var BPromise=require(_0x98b5('0x4'));var rp=require(_0x98b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98b5('0x6'));var config=require(_0x98b5('0x7'));var attributes=require(_0x98b5('0x8'));module['exports']=function(_0x112c39,_0x295f07){return _0x112c39['define'](_0x98b5('0x9'),attributes,{'tableName':_0x98b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 698854a..1f759bc 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4c536f,_0x15c9c0){var _0x5b53ae=function(_0x207cc3){while(--_0x207cc3){_0x4c536f['push'](_0x4c536f['shift']());}};_0x5b53ae(++_0x15c9c0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x14807f,_0x1a2924){var _0x1522e5=function(_0x649bb7){while(--_0x649bb7){_0x14807f['push'](_0x14807f['shift']());}};_0x1522e5(++_0x1a2924);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d48059d..947685a 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 _0xf022=['express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','util','path'];(function(_0x307ac0,_0x264b20){var _0x136fa3=function(_0x4f30d1){while(--_0x4f30d1){_0x307ac0['push'](_0x307ac0['shift']());}};_0x136fa3(++_0x264b20);}(_0xf022,0x66));var _0x2f02=function(_0x13d0fc,_0x391eba){_0x13d0fc=_0x13d0fc-0x0;var _0x124453=_0xf022[_0x13d0fc];return _0x124453;};'use strict';var multer=require('multer');var util=require(_0x2f02('0x0'));var path=require(_0x2f02('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f02('0x2'));var router=express['Router']();var fs_extra=require(_0x2f02('0x3'));var auth=require(_0x2f02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2f02('0x5'));var controller=require(_0x2f02('0x6'));router[_0x2f02('0x7')](_0x2f02('0x8'),auth[_0x2f02('0x9')](),controller['update']);router[_0x2f02('0xa')](_0x2f02('0x8'),auth['isAuthenticated'](),controller[_0x2f02('0xb')]);module[_0x2f02('0xc')]=router; \ No newline at end of file +var _0x2021=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x89afd3,_0x308087){var _0x232930=function(_0x3a7011){while(--_0x3a7011){_0x89afd3['push'](_0x89afd3['shift']());}};_0x232930(++_0x308087);}(_0x2021,0x89));var _0x1202=function(_0x2f6f9f,_0x45e1ec){_0x2f6f9f=_0x2f6f9f-0x0;var _0x5d7c48=_0x2021[_0x2f6f9f];return _0x5d7c48;};'use strict';var multer=require('multer');var util=require(_0x1202('0x0'));var path=require('path');var timeout=require(_0x1202('0x1'));var express=require(_0x1202('0x2'));var router=express[_0x1202('0x3')]();var fs_extra=require(_0x1202('0x4'));var auth=require(_0x1202('0x5'));var interaction=require(_0x1202('0x6'));var config=require(_0x1202('0x7'));var controller=require(_0x1202('0x8'));router[_0x1202('0x9')](_0x1202('0xa'),auth['isAuthenticated'](),controller[_0x1202('0xb')]);router[_0x1202('0xc')](_0x1202('0xa'),auth[_0x1202('0xd')](),controller[_0x1202('0xe')]);module[_0x1202('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 94a8225..902adb6 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 _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x1bf45b,_0x1eee87){var _0x3a2d5d=function(_0x423951){while(--_0x423951){_0x1bf45b['push'](_0x1bf45b['shift']());}};_0x3a2d5d(++_0x1eee87);}(_0x2bd8,0x130));var _0x82bd=function(_0x52c59d,_0x1e39ab){_0x52c59d=_0x52c59d-0x0;var _0x457e7f=_0x2bd8[_0x52c59d];return _0x457e7f;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}}; \ No newline at end of file +var _0x038b=['exports','STRING','TEXT'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x038b,0x114));var _0xb038=function(_0x1b9478,_0x1fcf5b){_0x1b9478=_0x1b9478-0x0;var _0x3f9364=_0x038b[_0x1b9478];return _0x3f9364;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 0894d0c..44a887a 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 _0x6b3d=['right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','condition','value','AnalyticMetric','from','foreignKey','output','web','fullPath','%s-%s.%s','generate','csv','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','QueryTypes','SELECT','runReport','IS\x20NULL','debug','Limited\x20Query:','eml-format','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','toString','sequelize'];(function(_0x14fd80,_0x5290d5){var _0x26134d=function(_0x1799cc){while(--_0x1799cc){_0x14fd80['push'](_0x14fd80['shift']());}};_0x26134d(++_0x5290d5);}(_0x6b3d,0x14f));var _0xd6b3=function(_0x2f40c6,_0x486ac6){_0x2f40c6=_0x2f40c6-0x0;var _0x2a7077=_0x6b3d[_0x2f40c6];return _0x2a7077;};'use strict';var emlformat=require(_0xd6b3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6b3('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd6b3('0x2'));var path=require('path');var sox=require(_0xd6b3('0x3'));var csv=require(_0xd6b3('0x4'));var ejs=require(_0xd6b3('0x5'));var fs=require('fs');var fs_extra=require(_0xd6b3('0x6'));var _=require(_0xd6b3('0x7'));var squel=require('squel');var crypto=require(_0xd6b3('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd6b3('0x9'));var toCsv=require(_0xd6b3('0x4'));var querystring=require(_0xd6b3('0xa'));var Papa=require(_0xd6b3('0xb'));var Redis=require(_0xd6b3('0xc'));var authService=require(_0xd6b3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd6b3('0xe'));var hardwareService=require(_0xd6b3('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd6b3('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xd6b3('0x11'))['db'];var dbH=require(_0xd6b3('0x11'))[_0xd6b3('0x12')];function respondWithStatusCode(_0x44ed3b,_0x315d2e){_0x315d2e=_0x315d2e||0xcc;return function(_0x457bc9){if(_0x457bc9){return _0x44ed3b[_0xd6b3('0x13')](_0x315d2e);}return _0x44ed3b['status'](_0x315d2e)['end']();};}function respondWithResult(_0x53da47,_0x4db5da){_0x4db5da=_0x4db5da||0xc8;return function(_0x557a10){if(_0x557a10){return _0x53da47[_0xd6b3('0x14')](_0x4db5da)['json'](_0x557a10);}};}function respondWithFilteredResult(_0x5a4e7a,_0x5230e9){return function(_0x9545e0){if(_0x9545e0){var _0x2773a6=typeof _0x5230e9[_0xd6b3('0x15')]==='undefined'&&typeof _0x5230e9[_0xd6b3('0x16')]===_0xd6b3('0x17');var _0x1b3b86=_0x9545e0['count'];var _0x31fee9=_0x2773a6?0x0:_0x5230e9['offset'];var _0x26d86f=_0x2773a6?_0x9545e0[_0xd6b3('0x18')]:_0x5230e9[_0xd6b3('0x15')]+_0x5230e9[_0xd6b3('0x16')];var _0x38a725;if(_0x26d86f>=_0x1b3b86){_0x26d86f=_0x1b3b86;_0x38a725=0xc8;}else{_0x38a725=0xce;}_0x5a4e7a[_0xd6b3('0x14')](_0x38a725);return _0x5a4e7a[_0xd6b3('0x19')](_0xd6b3('0x1a'),_0x31fee9+'-'+_0x26d86f+'/'+_0x1b3b86)['json'](_0x9545e0);}return null;};}function patchUpdates(_0x5106cd){return function(_0x4fecf8){try{jsonpatch[_0xd6b3('0x1b')](_0x4fecf8,_0x5106cd,!![]);}catch(_0x5ca747){return BPromise[_0xd6b3('0x1c')](_0x5ca747);}return _0x4fecf8[_0xd6b3('0x1d')]();};}function saveUpdates(_0x377910,_0x393b75){return function(_0xce4165){if(_0xce4165){return _0xce4165[_0xd6b3('0x1e')](_0x377910)[_0xd6b3('0x1f')](function(_0x49dcb2){return _0x49dcb2;});}return null;};}function removeEntity(_0x1b676a,_0x17ac45){return function(_0x15694a){if(_0x15694a){return _0x15694a['destroy']()[_0xd6b3('0x1f')](function(){var _0x142802=_0x15694a[_0xd6b3('0x20')]({'plain':!![]});var _0x6b3bd='CustomReports';return db[_0xd6b3('0x21')][_0xd6b3('0x22')]({'where':{'type':_0x6b3bd,'resourceId':_0x142802['id']}})[_0xd6b3('0x1f')](function(){return _0x15694a;});})['then'](function(){_0x1b676a[_0xd6b3('0x14')](0xcc)[_0xd6b3('0x23')]();});}};}function handleEntityNotFound(_0x44cbe9,_0x39aab5){return function(_0x227788){if(!_0x227788){_0x44cbe9[_0xd6b3('0x13')](0x194);}return _0x227788;};}function handleError(_0x59906b,_0x23b959){_0x23b959=_0x23b959||0x1f4;return function(_0x155f54){logger[_0xd6b3('0x24')](_0x155f54[_0xd6b3('0x25')]);if(_0x155f54['name']){delete _0x155f54[_0xd6b3('0x26')];}_0x59906b['status'](_0x23b959)[_0xd6b3('0x27')](_0x155f54);};}exports[_0xd6b3('0x28')]=function(_0x58feab,_0x3ec1db){var _0x4bec80={},_0x19796f={},_0x35faf3={'count':0x0,'rows':[]};var _0x17b8fe=_[_0xd6b3('0x29')](db[_0xd6b3('0x2a')][_0xd6b3('0x2b')],function(_0x4fc843){return{'name':_0x4fc843['fieldName'],'type':_0x4fc843[_0xd6b3('0x2c')][_0xd6b3('0x2d')]};});_0x19796f[_0xd6b3('0x2e')]=_[_0xd6b3('0x29')](_0x17b8fe,'name');_0x19796f[_0xd6b3('0x2f')]=_[_0xd6b3('0x30')](_0x58feab[_0xd6b3('0x2f')]);_0x19796f[_0xd6b3('0x31')]=_['intersection'](_0x19796f['model'],_0x19796f[_0xd6b3('0x2f')]);_0x4bec80[_0xd6b3('0x32')]=_[_0xd6b3('0x33')](_0x19796f[_0xd6b3('0x2e')],qs[_0xd6b3('0x34')](_0x58feab[_0xd6b3('0x2f')]['fields']));_0x4bec80[_0xd6b3('0x32')]=_0x4bec80[_0xd6b3('0x32')][_0xd6b3('0x35')]?_0x4bec80[_0xd6b3('0x32')]:_0x19796f['model'];if(!_0x58feab['query'][_0xd6b3('0x36')](_0xd6b3('0x37'))){_0x4bec80[_0xd6b3('0x16')]=qs[_0xd6b3('0x16')](_0x58feab['query'][_0xd6b3('0x16')]);_0x4bec80[_0xd6b3('0x15')]=qs[_0xd6b3('0x15')](_0x58feab[_0xd6b3('0x2f')][_0xd6b3('0x15')]);}_0x4bec80[_0xd6b3('0x38')]=qs['sort'](_0x58feab['query']['sort']);_0x4bec80['where']=qs['filters'](_[_0xd6b3('0x39')](_0x58feab[_0xd6b3('0x2f')],_0x19796f[_0xd6b3('0x31')]),_0x17b8fe);if(_0x58feab[_0xd6b3('0x2f')]['filter']){_0x4bec80[_0xd6b3('0x3a')]=_['merge'](_0x4bec80['where'],{'$or':_[_0xd6b3('0x29')](_0x17b8fe,function(_0x4dacda){if(_0x4dacda[_0xd6b3('0x2c')]!==_0xd6b3('0x3b')){var _0x3ef91e={};_0x3ef91e[_0x4dacda[_0xd6b3('0x26')]]={'$like':'%'+_0x58feab[_0xd6b3('0x2f')][_0xd6b3('0x3c')]+'%'};return _0x3ef91e;}})});}_0x4bec80=_['merge']({},_0x4bec80,_0x58feab[_0xd6b3('0x3d')]);var _0x28fcdd={'where':_0x4bec80[_0xd6b3('0x3a')]};return db[_0xd6b3('0x2a')][_0xd6b3('0x18')](_0x28fcdd)[_0xd6b3('0x1f')](function(_0x25bbf3){_0x35faf3[_0xd6b3('0x18')]=_0x25bbf3;if(_0x58feab[_0xd6b3('0x2f')][_0xd6b3('0x3e')]){_0x4bec80[_0xd6b3('0x3f')]=[{'all':!![]}];}return db[_0xd6b3('0x2a')][_0xd6b3('0x40')](_0x4bec80);})[_0xd6b3('0x1f')](function(_0x23df7a){_0x35faf3['rows']=_0x23df7a;return _0x35faf3;})[_0xd6b3('0x1f')](respondWithFilteredResult(_0x3ec1db,_0x4bec80))['catch'](handleError(_0x3ec1db,null));};exports[_0xd6b3('0x41')]=function(_0x4eed13,_0x312f06){var _0x5414fd={'raw':![],'where':{'id':_0x4eed13[_0xd6b3('0x42')]['id']}},_0x382509={};_0x382509[_0xd6b3('0x2e')]=_[_0xd6b3('0x30')](db[_0xd6b3('0x2a')][_0xd6b3('0x2b')]);_0x382509[_0xd6b3('0x2f')]=_[_0xd6b3('0x30')](_0x4eed13[_0xd6b3('0x2f')]);_0x382509[_0xd6b3('0x31')]=_[_0xd6b3('0x33')](_0x382509[_0xd6b3('0x2e')],_0x382509[_0xd6b3('0x2f')]);_0x5414fd[_0xd6b3('0x32')]=_[_0xd6b3('0x33')](_0x382509[_0xd6b3('0x2e')],qs[_0xd6b3('0x34')](_0x4eed13[_0xd6b3('0x2f')]['fields']));_0x5414fd[_0xd6b3('0x32')]=_0x5414fd['attributes'][_0xd6b3('0x35')]?_0x5414fd[_0xd6b3('0x32')]:_0x382509[_0xd6b3('0x2e')];if(_0x4eed13[_0xd6b3('0x2f')][_0xd6b3('0x3e')]){_0x5414fd[_0xd6b3('0x3f')]=[{'all':!![]}];}_0x5414fd=_[_0xd6b3('0x43')]({},_0x5414fd,_0x4eed13['options']);return db[_0xd6b3('0x2a')][_0xd6b3('0x44')](_0x5414fd)[_0xd6b3('0x1f')](handleEntityNotFound(_0x312f06,null))[_0xd6b3('0x1f')](respondWithResult(_0x312f06,null))[_0xd6b3('0x45')](handleError(_0x312f06,null));};exports[_0xd6b3('0x46')]=function(_0x4df801,_0x258890){return db[_0xd6b3('0x2a')][_0xd6b3('0x46')](_0x4df801[_0xd6b3('0x47')],{})[_0xd6b3('0x1f')](function(_0x28b445){var _0x5f1a40=_0x4df801['user'][_0xd6b3('0x20')]({'plain':!![]});if(!_0x5f1a40)throw new Error(_0xd6b3('0x48'));if(_0x5f1a40['role']===_0xd6b3('0x49')){var _0x4c01c7=_0x28b445['get']({'plain':!![]});var _0x1a6730=_0xd6b3('0x4a');return db[_0xd6b3('0x4b')][_0xd6b3('0x44')]({'where':{'name':_0x1a6730,'userProfileId':_0x5f1a40[_0xd6b3('0x4c')]},'raw':!![]})[_0xd6b3('0x1f')](function(_0x22678c){if(_0x22678c&&_0x22678c['autoAssociation']===0x0){return db['UserProfileResource'][_0xd6b3('0x46')]({'name':_0x4c01c7[_0xd6b3('0x26')],'resourceId':_0x4c01c7['id'],'type':'CustomReports','sectionId':_0x22678c['id']},{})[_0xd6b3('0x1f')](function(){return _0x28b445;});}else{return _0x28b445;}})[_0xd6b3('0x45')](function(_0x2eb62f){logger[_0xd6b3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eb62f);throw _0x2eb62f;});}return _0x28b445;})[_0xd6b3('0x1f')](respondWithResult(_0x258890,0xc9))[_0xd6b3('0x45')](handleError(_0x258890,null));};exports['update']=function(_0x121925,_0x21c50a){if(_0x121925[_0xd6b3('0x47')]['id']){delete _0x121925[_0xd6b3('0x47')]['id'];}return db[_0xd6b3('0x2a')]['find']({'where':{'id':_0x121925[_0xd6b3('0x42')]['id']}})[_0xd6b3('0x1f')](handleEntityNotFound(_0x21c50a,null))['then'](saveUpdates(_0x121925[_0xd6b3('0x47')],null))[_0xd6b3('0x1f')](respondWithResult(_0x21c50a,null))[_0xd6b3('0x45')](handleError(_0x21c50a,null));};exports[_0xd6b3('0x22')]=function(_0x53553a,_0x1d7a7d){return db['AnalyticCustomReport'][_0xd6b3('0x44')]({'where':{'id':_0x53553a[_0xd6b3('0x42')]['id']}})[_0xd6b3('0x1f')](handleEntityNotFound(_0x1d7a7d,null))[_0xd6b3('0x1f')](removeEntity(_0x1d7a7d,null))['catch'](handleError(_0x1d7a7d,null));};exports['preview']=function(_0x5051b8,_0x57c789){var _0x3f352c=0xa;var _0x4eee32=[_0xd6b3('0x4d'),_0xd6b3('0x4e'),'right_join',_0xd6b3('0x4f')];var _0x256e41={'SUM':_0xd6b3('0x50'),'COUNT':_0xd6b3('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xd6b3('0x52'),'AVG':_0xd6b3('0x53'),'GROUP_CONCAT':_0xd6b3('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd6b3('0x55')};var _0x20b05d={'SEC_TO_TIME':_0xd6b3('0x56'),'DATE':_0xd6b3('0x57'),'HOUR':'HOUR(%s)','ROUND':_0xd6b3('0x58'),'UNIX_TIMESTAMP':_0xd6b3('0x59')};var _0x1d3732=function(_0x2d942c){return!_[_0xd6b3('0x5a')](['IS\x20NULL',_0xd6b3('0x5b'),_0xd6b3('0x5c'),_0xd6b3('0x5d')],_0x2d942c);};var _0xdf524a=function(_0x45864f){if(!_0x45864f||!_0x45864f[_0xd6b3('0x5e')][_0xd6b3('0x35')]){return'';}for(var _0x31a439='(',_0x146db2=0x0;_0x146db2<_0x45864f['rules'][_0xd6b3('0x35')];_0x146db2+=0x1){_0x146db2>0x0&&(_0x31a439+='\x20'+_0x45864f[_0xd6b3('0x5f')]+'\x20');_0x31a439+=_0x45864f['rules'][_0x146db2]['group']?_0xdf524a(_0x45864f[_0xd6b3('0x5e')][_0x146db2][_0xd6b3('0x60')]):_0x45864f[_0xd6b3('0x5e')][_0x146db2][_0xd6b3('0x61')]+'\x20'+_0x45864f[_0xd6b3('0x5e')][_0x146db2]['condition']+(_0x1d3732(_0x45864f['rules'][_0x146db2]['condition'])?'\x20'+_0x45864f[_0xd6b3('0x5e')][_0x146db2]['value']:'');}return _0x31a439+')';};var _0xf08da2={'where':{'id':_0x5051b8[_0xd6b3('0x42')]['id']}},_0x462ca7,_0xccabdb,_0x87922e,_0x3574cf,_0x470586;_0xf08da2=_[_0xd6b3('0x43')]({},_0xf08da2,_0x5051b8[_0xd6b3('0x3d')]);return db[_0xd6b3('0x2a')]['find'](_0xf08da2)[_0xd6b3('0x1f')](function(_0x413527){if(_0x413527){_0x462ca7=_0x413527;return _0x413527['getFields']();}return null;})[_0xd6b3('0x1f')](function(_0x3b0447){if(_0x3b0447){if(!_0x3b0447[_0xd6b3('0x35')]){throw new db[(_0xd6b3('0x62'))][(_0xd6b3('0x63'))](_0xd6b3('0x64'),0x193);}_0xccabdb=_0x3b0447;return db['AnalyticMetric'][_0xd6b3('0x40')]({'raw':!![]});}return null;})['then'](function(_0x41222f){if(_0x41222f){_0x87922e=_[_0xd6b3('0x65')](_0x41222f,'id');var _0x3bbdc5;var _0x5bbb06=squel[_0xd6b3('0x66')]();_0x5bbb06['from'](_0x462ca7[_0xd6b3('0x67')]);for(var _0x50682e=0x0;_0x50682e<_0xccabdb[_0xd6b3('0x35')];_0x50682e+=0x1){_0x3bbdc5=_0xccabdb[_0x50682e][_0xd6b3('0x68')]?_0x87922e[_0xccabdb[_0x50682e][_0xd6b3('0x68')]][_0xd6b3('0x69')]:_0xccabdb[_0x50682e]['field'];_0x3bbdc5=_0xccabdb[_0x50682e][_0xd6b3('0x6a')]?_[_0xd6b3('0x6b')](_0x256e41[_0xccabdb[_0x50682e]['function']],'%s',_0x3bbdc5):_0x3bbdc5;_0x3bbdc5=_0xccabdb[_0x50682e][_0xd6b3('0x6c')]?_['replace'](_0x20b05d[_0xccabdb[_0x50682e][_0xd6b3('0x6c')]],'%s',_0x3bbdc5):_0x3bbdc5;if(_0xccabdb[_0x50682e][_0xd6b3('0x6d')]){_0x5bbb06['group'](_0x3bbdc5);}_0xccabdb[_0x50682e][_0xd6b3('0x6e')]&&_0x5bbb06[_0xd6b3('0x38')](_0x3bbdc5,_0xccabdb[_0x50682e][_0xd6b3('0x6e')]===_0xd6b3('0x6f')?![]:!![]);_0x5bbb06[_0xd6b3('0x61')](_0x3bbdc5,_0xccabdb[_0x50682e][_0xd6b3('0x70')]||_0x3bbdc5);}if(_0x462ca7[_0xd6b3('0x71')]){_0x462ca7[_0xd6b3('0x71')]=JSON[_0xd6b3('0x72')](_0x462ca7['joins']);for(var _0x43e8c5=0x0;_0x43e8c5<_0x462ca7[_0xd6b3('0x71')][_0xd6b3('0x35')];_0x43e8c5+=0x1){if(_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x2c')]&&_[_0xd6b3('0x5a')](_0x4eee32,_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x2c')])&&_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x73')]&&_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x74')]&&_0x462ca7[_0xd6b3('0x71')][_0x43e8c5]['foreignKey']){_0x5bbb06[_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x2c')]](_0x462ca7[_0xd6b3('0x71')][_0x43e8c5]['foreignTable'],null,util[_0xd6b3('0x6c')](_0xd6b3('0x75'),_0x462ca7['table'],_0x462ca7['joins'][_0x43e8c5][_0xd6b3('0x73')],_0x462ca7[_0xd6b3('0x71')][_0x43e8c5][_0xd6b3('0x74')],_0x462ca7[_0xd6b3('0x71')][_0x43e8c5]['foreignKey']));}}}if(_0x462ca7[_0xd6b3('0x76')]){_0x462ca7[_0xd6b3('0x76')]=JSON[_0xd6b3('0x72')](_0x462ca7[_0xd6b3('0x76')]);_0x5bbb06[_0xd6b3('0x3a')](_0xdf524a(_0x462ca7[_0xd6b3('0x76')][_0xd6b3('0x60')]));}_0x470586=_0x5bbb06['clone']();_0x5bbb06['limit'](_0x3f352c);_0x5bbb06[_0xd6b3('0x15')](0x0);logger['debug']('Limited\x20Query:',_0x5bbb06[_0xd6b3('0x77')]());return dbH[_0xd6b3('0x78')][_0xd6b3('0x2f')](_0x5bbb06['toString'](),{'type':dbH[_0xd6b3('0x78')]['QueryTypes']['SELECT']});}})[_0xd6b3('0x1f')](respondWithResult(_0x57c789,null))[_0xd6b3('0x45')](handleError(_0x57c789,null));};function runReport(_0x2ed5dc,_0x57ce23,_0x277597){var _0x25f1eb=_0x57ce23[_0xd6b3('0x26')];var _0x58afb2=0xa;var _0x244f69=['join','left_join',_0xd6b3('0x79'),'cross_join'];var _0x1da42e={'SUM':_0xd6b3('0x50'),'COUNT':_0xd6b3('0x51'),'COUNT DISTINCT':_0xd6b3('0x7a'),'MAX':_0xd6b3('0x7b'),'MIN':_0xd6b3('0x52'),'AVG':_0xd6b3('0x53'),'GROUP_CONCAT':_0xd6b3('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd6b3('0x55')};var _0x11f891={'SEC_TO_TIME':_0xd6b3('0x56'),'DATE':_0xd6b3('0x57'),'HOUR':_0xd6b3('0x7c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x55a145=function(_0x1501ec){return!_[_0xd6b3('0x5a')](['IS\x20NULL',_0xd6b3('0x5b'),_0xd6b3('0x5c'),'IS\x20NOT\x20EMPTY'],_0x1501ec);};var _0x5194a6=function(_0x1a19c5){if(!_0x1a19c5||!_0x1a19c5[_0xd6b3('0x5e')][_0xd6b3('0x35')]){return'';}for(var _0x19195e='(',_0xbc56ad=0x0;_0xbc56ad<_0x1a19c5[_0xd6b3('0x5e')]['length'];_0xbc56ad+=0x1){_0xbc56ad>0x0&&(_0x19195e+='\x20'+_0x1a19c5[_0xd6b3('0x5f')]+'\x20');_0x19195e+=_0x1a19c5[_0xd6b3('0x5e')][_0xbc56ad][_0xd6b3('0x60')]?_0x5194a6(_0x1a19c5['rules'][_0xbc56ad][_0xd6b3('0x60')]):_0x1a19c5[_0xd6b3('0x5e')][_0xbc56ad][_0xd6b3('0x61')]+'\x20'+_0x1a19c5[_0xd6b3('0x5e')][_0xbc56ad]['condition']+(_0x55a145(_0x1a19c5[_0xd6b3('0x5e')][_0xbc56ad][_0xd6b3('0x7d')])?'\x20'+_0x1a19c5['rules'][_0xbc56ad][_0xd6b3('0x7e')]:'');}return _0x19195e+')';};var _0x10fcf1={'where':{'id':_0x2ed5dc['id']}},_0x511e75,_0x2bbd0b,_0x38c50,_0x357688,_0x12a9b9;_0x10fcf1=_[_0xd6b3('0x43')]({},_0x10fcf1,_0x277597);return db[_0xd6b3('0x2a')][_0xd6b3('0x44')](_0x10fcf1)['then'](function(_0x1c9b31){if(_0x1c9b31){_0x511e75=_0x1c9b31;return _0x1c9b31['getFields']();}return null;})['then'](function(_0x511ca3){if(_0x511ca3){if(!_0x511ca3[_0xd6b3('0x35')]){throw new db[(_0xd6b3('0x62'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bbd0b=_0x511ca3;return db[_0xd6b3('0x7f')][_0xd6b3('0x40')]({'raw':!![]});}return null;})['then'](function(_0x3f3014){if(_0x3f3014){_0x38c50=_['keyBy'](_0x3f3014,'id');var _0x589341;var _0x292331=squel[_0xd6b3('0x66')]();_0x292331[_0xd6b3('0x80')](_0x511e75['table']);for(var _0x16dfcd=0x0;_0x16dfcd<_0x2bbd0b[_0xd6b3('0x35')];_0x16dfcd+=0x1){_0x589341=_0x2bbd0b[_0x16dfcd]['MetricId']?_0x38c50[_0x2bbd0b[_0x16dfcd][_0xd6b3('0x68')]][_0xd6b3('0x69')]:_0x2bbd0b[_0x16dfcd][_0xd6b3('0x61')];_0x589341=_0x2bbd0b[_0x16dfcd][_0xd6b3('0x6a')]?_['replace'](_0x1da42e[_0x2bbd0b[_0x16dfcd][_0xd6b3('0x6a')]],'%s',_0x589341):_0x589341;_0x589341=_0x2bbd0b[_0x16dfcd][_0xd6b3('0x6c')]?_[_0xd6b3('0x6b')](_0x11f891[_0x2bbd0b[_0x16dfcd][_0xd6b3('0x6c')]],'%s',_0x589341):_0x589341;if(_0x2bbd0b[_0x16dfcd][_0xd6b3('0x6d')]){_0x292331[_0xd6b3('0x60')](_0x589341);}_0x2bbd0b[_0x16dfcd]['orderBy']&&_0x292331[_0xd6b3('0x38')](_0x589341,_0x2bbd0b[_0x16dfcd]['orderBy']===_0xd6b3('0x6f')?![]:!![]);_0x292331[_0xd6b3('0x61')](_0x589341,_0x2bbd0b[_0x16dfcd][_0xd6b3('0x70')]||_0x589341);}if(_0x511e75[_0xd6b3('0x71')]){_0x511e75[_0xd6b3('0x71')]=JSON[_0xd6b3('0x72')](_0x511e75['joins']);for(var _0x1b0faa=0x0;_0x1b0faa<_0x511e75['joins'][_0xd6b3('0x35')];_0x1b0faa+=0x1){if(_0x511e75[_0xd6b3('0x71')][_0x1b0faa][_0xd6b3('0x2c')]&&_[_0xd6b3('0x5a')](_0x244f69,_0x511e75['joins'][_0x1b0faa][_0xd6b3('0x2c')])&&_0x511e75['joins'][_0x1b0faa]['parentKey']&&_0x511e75[_0xd6b3('0x71')][_0x1b0faa][_0xd6b3('0x74')]&&_0x511e75[_0xd6b3('0x71')][_0x1b0faa]['foreignKey']){_0x292331[_0x511e75[_0xd6b3('0x71')][_0x1b0faa][_0xd6b3('0x2c')]](_0x511e75[_0xd6b3('0x71')][_0x1b0faa]['foreignTable'],null,util['format'](_0xd6b3('0x75'),_0x511e75[_0xd6b3('0x67')],_0x511e75[_0xd6b3('0x71')][_0x1b0faa]['parentKey'],_0x511e75[_0xd6b3('0x71')][_0x1b0faa][_0xd6b3('0x74')],_0x511e75[_0xd6b3('0x71')][_0x1b0faa][_0xd6b3('0x81')]));}}}if(_0x511e75[_0xd6b3('0x76')]){_0x511e75[_0xd6b3('0x76')]=JSON[_0xd6b3('0x72')](_0x511e75[_0xd6b3('0x76')]);_0x292331[_0xd6b3('0x3a')](_0x5194a6(_0x511e75[_0xd6b3('0x76')][_0xd6b3('0x60')]));}_0x12a9b9=_0x292331['clone']();_0x292331[_0xd6b3('0x16')](_0x58afb2);_0x292331['offset'](0x0);return;}})[_0xd6b3('0x1f')](function(){if(_0x57ce23[_0xd6b3('0x82')]===_0xd6b3('0x83')){return null;}var _0x3df3e0=_[_0xd6b3('0x43')](_0x57ce23,{'name':_0x57ce23[_0xd6b3('0x84')]||_0x57ce23[_0xd6b3('0x26')]||_0x511e75['name'],'basename':_0x25f1eb,'savename':util['format'](_0xd6b3('0x85'),_0x57ce23[_0xd6b3('0x26')]||_0x511e75[_0xd6b3('0x26')],require('randomstring')[_0xd6b3('0x86')](0x4),_0x57ce23[_0xd6b3('0x82')]||_0xd6b3('0x87')),'reportId':_0x511e75['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd6b3('0x46')](_0x3df3e0,{'raw':!![]});})[_0xd6b3('0x1f')](function(_0x5d4693){if(_0x511e75[_0xd6b3('0x67')]===_0xd6b3('0x88')){_0x12a9b9['where'](_0x511e75[_0xd6b3('0x67')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x57ce23[_0xd6b3('0x89')],_0x57ce23[_0xd6b3('0x8a')]);}else{_0x12a9b9['where'](_0x511e75['table']+_0xd6b3('0x8b'),_0x57ce23['startDate'],_0x57ce23[_0xd6b3('0x8a')]);}if(_0x5d4693){logger['info'](_0xd6b3('0x8c'),_0x12a9b9['toString']());require(_0xd6b3('0x8d'))['fork'](path[_0xd6b3('0x4d')](__dirname,_0xd6b3('0x8e'),_0x5d4693[_0xd6b3('0x82')]),[_0x5d4693['id'],_0x12a9b9[_0xd6b3('0x77')](),path[_0xd6b3('0x4d')](__dirname,_0xd6b3('0x8f'),_0x5d4693[_0xd6b3('0x90')]),_0x25f1eb]);return _0x5d4693;}else{var _0xe4aaa0=squel[_0xd6b3('0x66')]();_0xe4aaa0['from']('('+_0x12a9b9[_0xd6b3('0x77')]()+')','countTable');_0xe4aaa0[_0xd6b3('0x61')](_0xd6b3('0x91'),'count');_0x12a9b9[_0xd6b3('0x16')](_0x57ce23[_0xd6b3('0x16')]||_0x58afb2);_0x12a9b9[_0xd6b3('0x15')](_0x57ce23[_0xd6b3('0x15')]||0x0);return dbH['sequelize'][_0xd6b3('0x2f')](_0xe4aaa0['toString'](),{'type':dbH[_0xd6b3('0x78')][_0xd6b3('0x92')][_0xd6b3('0x93')]})['then'](function(_0x59b4b8){if(!_0x59b4b8[_0xd6b3('0x35')]){_0x357688=0x0;}else{_0x357688=_0x59b4b8[0x0][_0xd6b3('0x18')]||0x0;}return dbH[_0xd6b3('0x78')][_0xd6b3('0x2f')](_0x12a9b9[_0xd6b3('0x77')](),{'type':dbH[_0xd6b3('0x78')][_0xd6b3('0x92')]['SELECT']});})[_0xd6b3('0x1f')](function(_0xcadbf1){return{'rows':_0xcadbf1||[],'count':_0x357688};});}});}exports['run']=function(_0x2a7a22,_0x22b110){return runReport(_0x2a7a22[_0xd6b3('0x42')],_0x2a7a22[_0xd6b3('0x2f')],_0x2a7a22[_0xd6b3('0x3d')])['then'](respondWithResult(_0x22b110,null))[_0xd6b3('0x45')](handleError(_0x22b110,null));};exports[_0xd6b3('0x94')]=runReport;exports[_0xd6b3('0x2f')]=function(_0xdeaf1,_0x3ec03f){var _0x51a5cd=0xa;var _0x4e4a83=[_0xd6b3('0x4d'),_0xd6b3('0x4e'),_0xd6b3('0x79'),_0xd6b3('0x4f')];var _0x4dc38d={'SUM':_0xd6b3('0x50'),'COUNT':_0xd6b3('0x51'),'COUNT DISTINCT':_0xd6b3('0x7a'),'MAX':'MAX(%s)','MIN':_0xd6b3('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd6b3('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd6b3('0x55')};var _0x16e32d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd6b3('0x58'),'UNIX_TIMESTAMP':_0xd6b3('0x59')};var _0x17fe7d=function(_0x4cfa81){return!_['includes']([_0xd6b3('0x95'),_0xd6b3('0x5b'),_0xd6b3('0x5c'),'IS\x20NOT\x20EMPTY'],_0x4cfa81);};var _0x692e08=function(_0x405486){if(!_0x405486||!_0x405486[_0xd6b3('0x5e')]['length']){return'';}for(var _0x3c134f='(',_0x541320=0x0;_0x541320<_0x405486['rules'][_0xd6b3('0x35')];_0x541320+=0x1){_0x541320>0x0&&(_0x3c134f+='\x20'+_0x405486[_0xd6b3('0x5f')]+'\x20');_0x3c134f+=_0x405486['rules'][_0x541320][_0xd6b3('0x60')]?_0x692e08(_0x405486[_0xd6b3('0x5e')][_0x541320]['group']):_0x405486[_0xd6b3('0x5e')][_0x541320][_0xd6b3('0x61')]+'\x20'+_0x405486[_0xd6b3('0x5e')][_0x541320][_0xd6b3('0x7d')]+(_0x17fe7d(_0x405486['rules'][_0x541320][_0xd6b3('0x7d')])?'\x20'+_0x405486[_0xd6b3('0x5e')][_0x541320][_0xd6b3('0x7e')]:'');}return _0x3c134f+')';};var _0x46d63a={'where':{'id':_0xdeaf1['params']['id']}},_0x2d4952,_0x2c2778,_0x22f09f,_0x4a0f35,_0x2e4515;_0x46d63a=_[_0xd6b3('0x43')]({},_0x46d63a,_0xdeaf1[_0xd6b3('0x3d')]);return db['AnalyticCustomReport'][_0xd6b3('0x44')](_0x46d63a)[_0xd6b3('0x1f')](function(_0x1a475c){if(_0x1a475c){_0x2d4952=_0x1a475c;return _0x1a475c['getFields']();}return null;})[_0xd6b3('0x1f')](function(_0x130e1d){if(_0x130e1d){if(!_0x130e1d[_0xd6b3('0x35')]){throw new db[(_0xd6b3('0x62'))]['ValidationErrorItem'](_0xd6b3('0x64'),0x193);}_0x2c2778=_0x130e1d;return db['AnalyticMetric'][_0xd6b3('0x40')]({'raw':!![]});}return null;})[_0xd6b3('0x1f')](function(_0x5a875e){if(_0x5a875e){_0x22f09f=_[_0xd6b3('0x65')](_0x5a875e,'id');var _0x592251;var _0x371b49=squel[_0xd6b3('0x66')]();_0x371b49['from'](_0x2d4952['table']);for(var _0x1e79f9=0x0;_0x1e79f9<_0x2c2778[_0xd6b3('0x35')];_0x1e79f9+=0x1){_0x592251=_0x2c2778[_0x1e79f9][_0xd6b3('0x68')]?_0x22f09f[_0x2c2778[_0x1e79f9]['MetricId']]['metric']:_0x2c2778[_0x1e79f9]['field'];_0x592251=_0x2c2778[_0x1e79f9][_0xd6b3('0x6a')]?_[_0xd6b3('0x6b')](_0x4dc38d[_0x2c2778[_0x1e79f9]['function']],'%s',_0x592251):_0x592251;_0x592251=_0x2c2778[_0x1e79f9]['format']?_[_0xd6b3('0x6b')](_0x16e32d[_0x2c2778[_0x1e79f9][_0xd6b3('0x6c')]],'%s',_0x592251):_0x592251;if(_0x2c2778[_0x1e79f9][_0xd6b3('0x6d')]){_0x371b49[_0xd6b3('0x60')](_0x592251);}_0x2c2778[_0x1e79f9][_0xd6b3('0x6e')]&&_0x371b49['order'](_0x592251,_0x2c2778[_0x1e79f9][_0xd6b3('0x6e')]===_0xd6b3('0x6f')?![]:!![]);_0x371b49[_0xd6b3('0x61')](_0x592251,_0x2c2778[_0x1e79f9][_0xd6b3('0x70')]||_0x592251);}if(_0x2d4952['joins']){_0x2d4952['joins']=JSON[_0xd6b3('0x72')](_0x2d4952[_0xd6b3('0x71')]);for(var _0x147c9c=0x0;_0x147c9c<_0x2d4952[_0xd6b3('0x71')]['length'];_0x147c9c+=0x1){if(_0x2d4952[_0xd6b3('0x71')][_0x147c9c]['type']&&_[_0xd6b3('0x5a')](_0x4e4a83,_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x2c')])&&_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x73')]&&_0x2d4952[_0xd6b3('0x71')][_0x147c9c]['foreignTable']&&_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x81')]){_0x371b49[_0x2d4952[_0xd6b3('0x71')][_0x147c9c]['type']](_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x74')],null,util['format'](_0xd6b3('0x75'),_0x2d4952[_0xd6b3('0x67')],_0x2d4952['joins'][_0x147c9c][_0xd6b3('0x73')],_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x74')],_0x2d4952[_0xd6b3('0x71')][_0x147c9c][_0xd6b3('0x81')]));}}}if(_0x2d4952[_0xd6b3('0x76')]){_0x2d4952['conditions']=JSON[_0xd6b3('0x72')](_0x2d4952[_0xd6b3('0x76')]);_0x371b49[_0xd6b3('0x3a')](_0x692e08(_0x2d4952['conditions'][_0xd6b3('0x60')]));}_0x2e4515=_0x371b49['clone']();_0x371b49[_0xd6b3('0x16')](_0x51a5cd);_0x371b49[_0xd6b3('0x15')](0x0);logger[_0xd6b3('0x96')](_0xd6b3('0x97'),_0x371b49[_0xd6b3('0x77')]());return dbH['sequelize']['query'](_0x371b49[_0xd6b3('0x77')](),{'type':dbH[_0xd6b3('0x78')][_0xd6b3('0x92')]['SELECT']});}})[_0xd6b3('0x1f')](function(){return{'sql':_0x2e4515[_0xd6b3('0x77')]()};})[_0xd6b3('0x1f')](respondWithResult(_0x3ec03f,null))[_0xd6b3('0x45')](handleError(_0x3ec03f,null));}; \ No newline at end of file +var _0x1a12=['set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','type','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','includes','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','SUM(%s)','AVG(%s)','keyBy','from','parse','%s.%s\x20=\x20%s.%s','fullPath','%s-%s.%s','randomstring','generate','output','custom','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','limit','undefined','count','offset'];(function(_0x7080a4,_0x3c2c16){var _0x1530f4=function(_0x378623){while(--_0x378623){_0x7080a4['push'](_0x7080a4['shift']());}};_0x1530f4(++_0x3c2c16);}(_0x1a12,0x80));var _0x21a1=function(_0x247a74,_0x31dc7b){_0x247a74=_0x247a74-0x0;var _0xca17c9=_0x1a12[_0x247a74];return _0xca17c9;};'use strict';var emlformat=require(_0x21a1('0x0'));var rimraf=require(_0x21a1('0x1'));var zipdir=require(_0x21a1('0x2'));var jsonpatch=require(_0x21a1('0x3'));var rp=require(_0x21a1('0x4'));var moment=require(_0x21a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x21a1('0x6'));var util=require('util');var path=require(_0x21a1('0x7'));var sox=require(_0x21a1('0x8'));var csv=require(_0x21a1('0x9'));var ejs=require(_0x21a1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21a1('0xb'));var squel=require(_0x21a1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x21a1('0xd'));var toCsv=require(_0x21a1('0x9'));var querystring=require(_0x21a1('0xe'));var Papa=require(_0x21a1('0xf'));var Redis=require(_0x21a1('0x10'));var authService=require(_0x21a1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21a1('0x12'));var logger=require(_0x21a1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x21a1('0x14'));var licenseUtil=require(_0x21a1('0x15'));var db=require(_0x21a1('0x16'))['db'];var dbH=require(_0x21a1('0x16'))[_0x21a1('0x17')];function respondWithStatusCode(_0x146443,_0xe00318){_0xe00318=_0xe00318||0xcc;return function(_0x489b23){if(_0x489b23){return _0x146443[_0x21a1('0x18')](_0xe00318);}return _0x146443['status'](_0xe00318)[_0x21a1('0x19')]();};}function respondWithResult(_0x16bc9b,_0x449dda){_0x449dda=_0x449dda||0xc8;return function(_0x50192d){if(_0x50192d){return _0x16bc9b[_0x21a1('0x1a')](_0x449dda)[_0x21a1('0x1b')](_0x50192d);}};}function respondWithFilteredResult(_0x1ee1f7,_0x1c4945){return function(_0x1ec3c3){if(_0x1ec3c3){var _0x38a394=typeof _0x1c4945['offset']==='undefined'&&typeof _0x1c4945[_0x21a1('0x1c')]===_0x21a1('0x1d');var _0xb805c4=_0x1ec3c3[_0x21a1('0x1e')];var _0x185e95=_0x38a394?0x0:_0x1c4945[_0x21a1('0x1f')];var _0xd7a3c8=_0x38a394?_0x1ec3c3[_0x21a1('0x1e')]:_0x1c4945[_0x21a1('0x1f')]+_0x1c4945['limit'];var _0x157aed;if(_0xd7a3c8>=_0xb805c4){_0xd7a3c8=_0xb805c4;_0x157aed=0xc8;}else{_0x157aed=0xce;}_0x1ee1f7[_0x21a1('0x1a')](_0x157aed);return _0x1ee1f7[_0x21a1('0x20')](_0x21a1('0x21'),_0x185e95+'-'+_0xd7a3c8+'/'+_0xb805c4)['json'](_0x1ec3c3);}return null;};}function patchUpdates(_0x29ce17){return function(_0x18f3db){try{jsonpatch[_0x21a1('0x22')](_0x18f3db,_0x29ce17,!![]);}catch(_0x34c621){return BPromise['reject'](_0x34c621);}return _0x18f3db[_0x21a1('0x23')]();};}function saveUpdates(_0x2aee60,_0x47468a){return function(_0x29a2ca){if(_0x29a2ca){return _0x29a2ca[_0x21a1('0x24')](_0x2aee60)[_0x21a1('0x25')](function(_0x39b924){return _0x39b924;});}return null;};}function removeEntity(_0x2a73ad,_0x478f68){return function(_0x4998e9){if(_0x4998e9){return _0x4998e9['destroy']()['then'](function(){var _0x2d4dd4=_0x4998e9[_0x21a1('0x26')]({'plain':!![]});var _0x464c29='CustomReports';return db[_0x21a1('0x27')][_0x21a1('0x28')]({'where':{'type':_0x464c29,'resourceId':_0x2d4dd4['id']}})[_0x21a1('0x25')](function(){return _0x4998e9;});})['then'](function(){_0x2a73ad[_0x21a1('0x1a')](0xcc)[_0x21a1('0x19')]();});}};}function handleEntityNotFound(_0x22fbc3,_0x28cee1){return function(_0x49a326){if(!_0x49a326){_0x22fbc3[_0x21a1('0x18')](0x194);}return _0x49a326;};}function handleError(_0x4f5c17,_0x35d7ca){_0x35d7ca=_0x35d7ca||0x1f4;return function(_0x20380c){logger[_0x21a1('0x29')](_0x20380c[_0x21a1('0x2a')]);if(_0x20380c[_0x21a1('0x2b')]){delete _0x20380c[_0x21a1('0x2b')];}_0x4f5c17[_0x21a1('0x1a')](_0x35d7ca)[_0x21a1('0x2c')](_0x20380c);};}exports['index']=function(_0x1bda66,_0x40fd03){var _0x26347c={},_0x13d66f={},_0x40fefc={'count':0x0,'rows':[]};var _0x4fb79b=_[_0x21a1('0x2d')](db[_0x21a1('0x2e')][_0x21a1('0x2f')],function(_0x50cc98){return{'name':_0x50cc98['fieldName'],'type':_0x50cc98[_0x21a1('0x30')]['key']};});_0x13d66f[_0x21a1('0x31')]=_['map'](_0x4fb79b,'name');_0x13d66f['query']=_[_0x21a1('0x32')](_0x1bda66['query']);_0x13d66f[_0x21a1('0x33')]=_[_0x21a1('0x34')](_0x13d66f[_0x21a1('0x31')],_0x13d66f[_0x21a1('0x35')]);_0x26347c[_0x21a1('0x36')]=_[_0x21a1('0x34')](_0x13d66f[_0x21a1('0x31')],qs['fields'](_0x1bda66['query']['fields']));_0x26347c[_0x21a1('0x36')]=_0x26347c[_0x21a1('0x36')][_0x21a1('0x37')]?_0x26347c[_0x21a1('0x36')]:_0x13d66f[_0x21a1('0x31')];if(!_0x1bda66[_0x21a1('0x35')][_0x21a1('0x38')](_0x21a1('0x39'))){_0x26347c['limit']=qs['limit'](_0x1bda66[_0x21a1('0x35')][_0x21a1('0x1c')]);_0x26347c[_0x21a1('0x1f')]=qs[_0x21a1('0x1f')](_0x1bda66[_0x21a1('0x35')][_0x21a1('0x1f')]);}_0x26347c[_0x21a1('0x3a')]=qs[_0x21a1('0x3b')](_0x1bda66[_0x21a1('0x35')][_0x21a1('0x3b')]);_0x26347c[_0x21a1('0x3c')]=qs[_0x21a1('0x33')](_[_0x21a1('0x3d')](_0x1bda66['query'],_0x13d66f[_0x21a1('0x33')]),_0x4fb79b);if(_0x1bda66['query'][_0x21a1('0x3e')]){_0x26347c[_0x21a1('0x3c')]=_[_0x21a1('0x3f')](_0x26347c[_0x21a1('0x3c')],{'$or':_['map'](_0x4fb79b,function(_0x161e2c){if(_0x161e2c[_0x21a1('0x30')]!=='VIRTUAL'){var _0x11b876={};_0x11b876[_0x161e2c[_0x21a1('0x2b')]]={'$like':'%'+_0x1bda66[_0x21a1('0x35')][_0x21a1('0x3e')]+'%'};return _0x11b876;}})});}_0x26347c=_[_0x21a1('0x3f')]({},_0x26347c,_0x1bda66[_0x21a1('0x40')]);var _0x4be236={'where':_0x26347c[_0x21a1('0x3c')]};return db['AnalyticCustomReport'][_0x21a1('0x1e')](_0x4be236)[_0x21a1('0x25')](function(_0x3feb72){_0x40fefc[_0x21a1('0x1e')]=_0x3feb72;if(_0x1bda66['query'][_0x21a1('0x41')]){_0x26347c['include']=[{'all':!![]}];}return db[_0x21a1('0x2e')][_0x21a1('0x42')](_0x26347c);})[_0x21a1('0x25')](function(_0x34d6d8){_0x40fefc[_0x21a1('0x43')]=_0x34d6d8;return _0x40fefc;})[_0x21a1('0x25')](respondWithFilteredResult(_0x40fd03,_0x26347c))['catch'](handleError(_0x40fd03,null));};exports[_0x21a1('0x44')]=function(_0x17f802,_0x13cd2b){var _0x50c393={'raw':![],'where':{'id':_0x17f802[_0x21a1('0x45')]['id']}},_0x579038={};_0x579038['model']=_[_0x21a1('0x32')](db[_0x21a1('0x2e')]['rawAttributes']);_0x579038[_0x21a1('0x35')]=_[_0x21a1('0x32')](_0x17f802[_0x21a1('0x35')]);_0x579038['filters']=_[_0x21a1('0x34')](_0x579038[_0x21a1('0x31')],_0x579038['query']);_0x50c393['attributes']=_[_0x21a1('0x34')](_0x579038[_0x21a1('0x31')],qs[_0x21a1('0x46')](_0x17f802[_0x21a1('0x35')]['fields']));_0x50c393[_0x21a1('0x36')]=_0x50c393[_0x21a1('0x36')][_0x21a1('0x37')]?_0x50c393['attributes']:_0x579038[_0x21a1('0x31')];if(_0x17f802[_0x21a1('0x35')][_0x21a1('0x41')]){_0x50c393[_0x21a1('0x47')]=[{'all':!![]}];}_0x50c393=_[_0x21a1('0x3f')]({},_0x50c393,_0x17f802[_0x21a1('0x40')]);return db[_0x21a1('0x2e')][_0x21a1('0x48')](_0x50c393)[_0x21a1('0x25')](handleEntityNotFound(_0x13cd2b,null))[_0x21a1('0x25')](respondWithResult(_0x13cd2b,null))['catch'](handleError(_0x13cd2b,null));};exports[_0x21a1('0x49')]=function(_0x486825,_0x37a5fb){return db[_0x21a1('0x2e')][_0x21a1('0x49')](_0x486825[_0x21a1('0x4a')],{})[_0x21a1('0x25')](function(_0x15ac4){var _0x5d2154=_0x486825['user']['get']({'plain':!![]});if(!_0x5d2154)throw new Error(_0x21a1('0x4b'));if(_0x5d2154[_0x21a1('0x4c')]===_0x21a1('0x4d')){var _0x172a21=_0x15ac4[_0x21a1('0x26')]({'plain':!![]});var _0xf2ae7b='Reports';return db[_0x21a1('0x4e')][_0x21a1('0x48')]({'where':{'name':_0xf2ae7b,'userProfileId':_0x5d2154[_0x21a1('0x4f')]},'raw':!![]})[_0x21a1('0x25')](function(_0x473983){if(_0x473983&&_0x473983[_0x21a1('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x172a21['name'],'resourceId':_0x172a21['id'],'type':'CustomReports','sectionId':_0x473983['id']},{})[_0x21a1('0x25')](function(){return _0x15ac4;});}else{return _0x15ac4;}})[_0x21a1('0x51')](function(_0x3b73e8){logger[_0x21a1('0x29')](_0x21a1('0x52'),_0x3b73e8);throw _0x3b73e8;});}return _0x15ac4;})[_0x21a1('0x25')](respondWithResult(_0x37a5fb,0xc9))[_0x21a1('0x51')](handleError(_0x37a5fb,null));};exports['update']=function(_0xfa8ee,_0x536a87){if(_0xfa8ee[_0x21a1('0x4a')]['id']){delete _0xfa8ee[_0x21a1('0x4a')]['id'];}return db[_0x21a1('0x2e')]['find']({'where':{'id':_0xfa8ee[_0x21a1('0x45')]['id']}})[_0x21a1('0x25')](handleEntityNotFound(_0x536a87,null))[_0x21a1('0x25')](saveUpdates(_0xfa8ee['body'],null))[_0x21a1('0x25')](respondWithResult(_0x536a87,null))[_0x21a1('0x51')](handleError(_0x536a87,null));};exports[_0x21a1('0x28')]=function(_0x8568c8,_0xe0cbe0){return db['AnalyticCustomReport'][_0x21a1('0x48')]({'where':{'id':_0x8568c8[_0x21a1('0x45')]['id']}})[_0x21a1('0x25')](handleEntityNotFound(_0xe0cbe0,null))[_0x21a1('0x25')](removeEntity(_0xe0cbe0,null))[_0x21a1('0x51')](handleError(_0xe0cbe0,null));};exports['preview']=function(_0x33fccb,_0x428e8e){var _0x52f064=0xa;var _0xd0ba0b=['join','left_join',_0x21a1('0x53'),_0x21a1('0x54')];var _0x51a309={'SUM':'SUM(%s)','COUNT':_0x21a1('0x55'),'COUNT DISTINCT':_0x21a1('0x56'),'MAX':_0x21a1('0x57'),'MIN':_0x21a1('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x21a1('0x59'),'GROUP_CONCAT ASC':_0x21a1('0x5a'),'GROUP_CONCAT DESC':_0x21a1('0x5b')};var _0x57f939={'SEC_TO_TIME':_0x21a1('0x5c'),'DATE':_0x21a1('0x5d'),'HOUR':_0x21a1('0x5e'),'ROUND':_0x21a1('0x5f'),'UNIX_TIMESTAMP':_0x21a1('0x60')};var _0x11deb5=function(_0x5780f4){return!_['includes']([_0x21a1('0x61'),_0x21a1('0x62'),'IS\x20EMPTY',_0x21a1('0x63')],_0x5780f4);};var _0x2eeaac=function(_0x4594ae){if(!_0x4594ae||!_0x4594ae['rules']['length']){return'';}for(var _0x548591='(',_0x1b858e=0x0;_0x1b858e<_0x4594ae[_0x21a1('0x64')][_0x21a1('0x37')];_0x1b858e+=0x1){_0x1b858e>0x0&&(_0x548591+='\x20'+_0x4594ae[_0x21a1('0x65')]+'\x20');_0x548591+=_0x4594ae['rules'][_0x1b858e]['group']?_0x2eeaac(_0x4594ae[_0x21a1('0x64')][_0x1b858e][_0x21a1('0x66')]):_0x4594ae[_0x21a1('0x64')][_0x1b858e][_0x21a1('0x67')]+'\x20'+_0x4594ae[_0x21a1('0x64')][_0x1b858e]['condition']+(_0x11deb5(_0x4594ae[_0x21a1('0x64')][_0x1b858e][_0x21a1('0x68')])?'\x20'+_0x4594ae['rules'][_0x1b858e][_0x21a1('0x69')]:'');}return _0x548591+')';};var _0x6461a0={'where':{'id':_0x33fccb[_0x21a1('0x45')]['id']}},_0x338b0,_0x561625,_0x51891e,_0x1637cb,_0x38a26d;_0x6461a0=_[_0x21a1('0x3f')]({},_0x6461a0,_0x33fccb[_0x21a1('0x40')]);return db[_0x21a1('0x2e')][_0x21a1('0x48')](_0x6461a0)[_0x21a1('0x25')](function(_0x463184){if(_0x463184){_0x338b0=_0x463184;return _0x463184[_0x21a1('0x6a')]();}return null;})[_0x21a1('0x25')](function(_0x1bf442){if(_0x1bf442){if(!_0x1bf442[_0x21a1('0x37')]){throw new db[(_0x21a1('0x6b'))][(_0x21a1('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x561625=_0x1bf442;return db[_0x21a1('0x6d')][_0x21a1('0x42')]({'raw':!![]});}return null;})[_0x21a1('0x25')](function(_0x1e6e6c){if(_0x1e6e6c){_0x51891e=_['keyBy'](_0x1e6e6c,'id');var _0xdc5907;var _0x356b16=squel[_0x21a1('0x6e')]();_0x356b16['from'](_0x338b0[_0x21a1('0x6f')]);for(var _0x3a0cad=0x0;_0x3a0cad<_0x561625[_0x21a1('0x37')];_0x3a0cad+=0x1){_0xdc5907=_0x561625[_0x3a0cad][_0x21a1('0x70')]?_0x51891e[_0x561625[_0x3a0cad][_0x21a1('0x70')]][_0x21a1('0x71')]:_0x561625[_0x3a0cad][_0x21a1('0x67')];_0xdc5907=_0x561625[_0x3a0cad][_0x21a1('0x72')]?_['replace'](_0x51a309[_0x561625[_0x3a0cad]['function']],'%s',_0xdc5907):_0xdc5907;_0xdc5907=_0x561625[_0x3a0cad][_0x21a1('0x73')]?_[_0x21a1('0x74')](_0x57f939[_0x561625[_0x3a0cad][_0x21a1('0x73')]],'%s',_0xdc5907):_0xdc5907;if(_0x561625[_0x3a0cad][_0x21a1('0x75')]){_0x356b16[_0x21a1('0x66')](_0xdc5907);}_0x561625[_0x3a0cad][_0x21a1('0x76')]&&_0x356b16['order'](_0xdc5907,_0x561625[_0x3a0cad][_0x21a1('0x76')]===_0x21a1('0x77')?![]:!![]);_0x356b16['field'](_0xdc5907,_0x561625[_0x3a0cad][_0x21a1('0x78')]||_0xdc5907);}if(_0x338b0[_0x21a1('0x79')]){_0x338b0[_0x21a1('0x79')]=JSON['parse'](_0x338b0[_0x21a1('0x79')]);for(var _0x500abb=0x0;_0x500abb<_0x338b0[_0x21a1('0x79')]['length'];_0x500abb+=0x1){if(_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x30')]&&_[_0x21a1('0x7a')](_0xd0ba0b,_0x338b0['joins'][_0x500abb]['type'])&&_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x7b')]&&_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x7c')]&&_0x338b0['joins'][_0x500abb][_0x21a1('0x7d')]){_0x356b16[_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x30')]](_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x7c')],null,util[_0x21a1('0x73')]('%s.%s\x20=\x20%s.%s',_0x338b0[_0x21a1('0x6f')],_0x338b0['joins'][_0x500abb][_0x21a1('0x7b')],_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x7c')],_0x338b0[_0x21a1('0x79')][_0x500abb][_0x21a1('0x7d')]));}}}if(_0x338b0['conditions']){_0x338b0['conditions']=JSON['parse'](_0x338b0[_0x21a1('0x7e')]);_0x356b16[_0x21a1('0x3c')](_0x2eeaac(_0x338b0['conditions'][_0x21a1('0x66')]));}_0x38a26d=_0x356b16[_0x21a1('0x7f')]();_0x356b16[_0x21a1('0x1c')](_0x52f064);_0x356b16[_0x21a1('0x1f')](0x0);logger['debug'](_0x21a1('0x80'),_0x356b16[_0x21a1('0x81')]());return dbH[_0x21a1('0x82')][_0x21a1('0x35')](_0x356b16['toString'](),{'type':dbH[_0x21a1('0x82')][_0x21a1('0x83')][_0x21a1('0x84')]});}})[_0x21a1('0x25')](respondWithResult(_0x428e8e,null))[_0x21a1('0x51')](handleError(_0x428e8e,null));};function runReport(_0x7839,_0x1d7f91,_0x2bc793){var _0xdef927=_0x1d7f91['name'];var _0x10a66b=0xa;var _0x20e00a=[_0x21a1('0x85'),_0x21a1('0x86'),'right_join',_0x21a1('0x54')];var _0x37cbbd={'SUM':_0x21a1('0x87'),'COUNT':_0x21a1('0x55'),'COUNT DISTINCT':_0x21a1('0x56'),'MAX':_0x21a1('0x57'),'MIN':_0x21a1('0x58'),'AVG':_0x21a1('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x21a1('0x5a'),'GROUP_CONCAT DESC':_0x21a1('0x5b')};var _0x463286={'SEC_TO_TIME':_0x21a1('0x5c'),'DATE':'DATE(%s)','HOUR':_0x21a1('0x5e'),'ROUND':_0x21a1('0x5f'),'UNIX_TIMESTAMP':_0x21a1('0x60')};var _0x9f882e=function(_0x3965fd){return!_[_0x21a1('0x7a')]([_0x21a1('0x61'),_0x21a1('0x62'),'IS\x20EMPTY',_0x21a1('0x63')],_0x3965fd);};var _0x34261a=function(_0x139513){if(!_0x139513||!_0x139513[_0x21a1('0x64')][_0x21a1('0x37')]){return'';}for(var _0x2792bd='(',_0x29628a=0x0;_0x29628a<_0x139513[_0x21a1('0x64')][_0x21a1('0x37')];_0x29628a+=0x1){_0x29628a>0x0&&(_0x2792bd+='\x20'+_0x139513[_0x21a1('0x65')]+'\x20');_0x2792bd+=_0x139513[_0x21a1('0x64')][_0x29628a][_0x21a1('0x66')]?_0x34261a(_0x139513[_0x21a1('0x64')][_0x29628a]['group']):_0x139513[_0x21a1('0x64')][_0x29628a][_0x21a1('0x67')]+'\x20'+_0x139513[_0x21a1('0x64')][_0x29628a][_0x21a1('0x68')]+(_0x9f882e(_0x139513['rules'][_0x29628a][_0x21a1('0x68')])?'\x20'+_0x139513[_0x21a1('0x64')][_0x29628a][_0x21a1('0x69')]:'');}return _0x2792bd+')';};var _0x4a6ede={'where':{'id':_0x7839['id']}},_0x24ae70,_0x19f915,_0x980532,_0x14c0e7,_0x3bda3e;_0x4a6ede=_['merge']({},_0x4a6ede,_0x2bc793);return db[_0x21a1('0x2e')][_0x21a1('0x48')](_0x4a6ede)[_0x21a1('0x25')](function(_0x1a0d87){if(_0x1a0d87){_0x24ae70=_0x1a0d87;return _0x1a0d87[_0x21a1('0x6a')]();}return null;})[_0x21a1('0x25')](function(_0x5c0a92){if(_0x5c0a92){if(!_0x5c0a92['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x19f915=_0x5c0a92;return db[_0x21a1('0x6d')][_0x21a1('0x42')]({'raw':!![]});}return null;})[_0x21a1('0x25')](function(_0x5bb48b){if(_0x5bb48b){_0x980532=_[_0x21a1('0x89')](_0x5bb48b,'id');var _0x3baf25;var _0x5d81bf=squel[_0x21a1('0x6e')]();_0x5d81bf[_0x21a1('0x8a')](_0x24ae70[_0x21a1('0x6f')]);for(var _0x14060d=0x0;_0x14060d<_0x19f915['length'];_0x14060d+=0x1){_0x3baf25=_0x19f915[_0x14060d][_0x21a1('0x70')]?_0x980532[_0x19f915[_0x14060d]['MetricId']][_0x21a1('0x71')]:_0x19f915[_0x14060d][_0x21a1('0x67')];_0x3baf25=_0x19f915[_0x14060d]['function']?_[_0x21a1('0x74')](_0x37cbbd[_0x19f915[_0x14060d][_0x21a1('0x72')]],'%s',_0x3baf25):_0x3baf25;_0x3baf25=_0x19f915[_0x14060d][_0x21a1('0x73')]?_['replace'](_0x463286[_0x19f915[_0x14060d][_0x21a1('0x73')]],'%s',_0x3baf25):_0x3baf25;if(_0x19f915[_0x14060d][_0x21a1('0x75')]){_0x5d81bf[_0x21a1('0x66')](_0x3baf25);}_0x19f915[_0x14060d][_0x21a1('0x76')]&&_0x5d81bf[_0x21a1('0x3a')](_0x3baf25,_0x19f915[_0x14060d][_0x21a1('0x76')]===_0x21a1('0x77')?![]:!![]);_0x5d81bf[_0x21a1('0x67')](_0x3baf25,_0x19f915[_0x14060d][_0x21a1('0x78')]||_0x3baf25);}if(_0x24ae70['joins']){_0x24ae70['joins']=JSON[_0x21a1('0x8b')](_0x24ae70[_0x21a1('0x79')]);for(var _0x1785bf=0x0;_0x1785bf<_0x24ae70[_0x21a1('0x79')][_0x21a1('0x37')];_0x1785bf+=0x1){if(_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x30')]&&_[_0x21a1('0x7a')](_0x20e00a,_0x24ae70[_0x21a1('0x79')][_0x1785bf]['type'])&&_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x7b')]&&_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x7c')]&&_0x24ae70['joins'][_0x1785bf][_0x21a1('0x7d')]){_0x5d81bf[_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x30')]](_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x7c')],null,util[_0x21a1('0x73')](_0x21a1('0x8c'),_0x24ae70[_0x21a1('0x6f')],_0x24ae70[_0x21a1('0x79')][_0x1785bf]['parentKey'],_0x24ae70[_0x21a1('0x79')][_0x1785bf][_0x21a1('0x7c')],_0x24ae70[_0x21a1('0x79')][_0x1785bf]['foreignKey']));}}}if(_0x24ae70['conditions']){_0x24ae70[_0x21a1('0x7e')]=JSON[_0x21a1('0x8b')](_0x24ae70[_0x21a1('0x7e')]);_0x5d81bf[_0x21a1('0x3c')](_0x34261a(_0x24ae70[_0x21a1('0x7e')][_0x21a1('0x66')]));}_0x3bda3e=_0x5d81bf[_0x21a1('0x7f')]();_0x5d81bf['limit'](_0x10a66b);_0x5d81bf[_0x21a1('0x1f')](0x0);return;}})[_0x21a1('0x25')](function(){if(_0x1d7f91['output']==='web'){return null;}var _0x1ffdc0=_[_0x21a1('0x3f')](_0x1d7f91,{'name':_0x1d7f91[_0x21a1('0x8d')]||_0x1d7f91['name']||_0x24ae70['name'],'basename':_0xdef927,'savename':util[_0x21a1('0x73')](_0x21a1('0x8e'),_0x1d7f91[_0x21a1('0x2b')]||_0x24ae70['name'],require(_0x21a1('0x8f'))[_0x21a1('0x90')](0x4),_0x1d7f91[_0x21a1('0x91')]||'csv'),'reportId':_0x24ae70['id'],'reportType':_0x21a1('0x92')});return db['AnalyticExtractedReport'][_0x21a1('0x49')](_0x1ffdc0,{'raw':!![]});})[_0x21a1('0x25')](function(_0x48849d){if(_0x24ae70[_0x21a1('0x6f')]==='cdr'){_0x3bda3e['where'](_0x24ae70[_0x21a1('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1d7f91['startDate'],_0x1d7f91[_0x21a1('0x93')]);}else{_0x3bda3e[_0x21a1('0x3c')](_0x24ae70[_0x21a1('0x6f')]+_0x21a1('0x94'),_0x1d7f91['startDate'],_0x1d7f91[_0x21a1('0x93')]);}if(_0x48849d){logger[_0x21a1('0x95')](_0x21a1('0x96'),_0x3bda3e[_0x21a1('0x81')]());require(_0x21a1('0x97'))['fork'](path['join'](__dirname,_0x21a1('0x98'),_0x48849d[_0x21a1('0x91')]),[_0x48849d['id'],_0x3bda3e[_0x21a1('0x81')](),path[_0x21a1('0x85')](__dirname,_0x21a1('0x99'),_0x48849d[_0x21a1('0x9a')]),_0xdef927]);return _0x48849d;}else{var _0x5c6986=squel['select']();_0x5c6986['from']('('+_0x3bda3e['toString']()+')',_0x21a1('0x9b'));_0x5c6986[_0x21a1('0x67')](_0x21a1('0x9c'),_0x21a1('0x1e'));_0x3bda3e['limit'](_0x1d7f91[_0x21a1('0x1c')]||_0x10a66b);_0x3bda3e[_0x21a1('0x1f')](_0x1d7f91['offset']||0x0);return dbH[_0x21a1('0x82')]['query'](_0x5c6986[_0x21a1('0x81')](),{'type':dbH[_0x21a1('0x82')][_0x21a1('0x83')]['SELECT']})[_0x21a1('0x25')](function(_0x2369bd){if(!_0x2369bd[_0x21a1('0x37')]){_0x14c0e7=0x0;}else{_0x14c0e7=_0x2369bd[0x0][_0x21a1('0x1e')]||0x0;}return dbH['sequelize'][_0x21a1('0x35')](_0x3bda3e[_0x21a1('0x81')](),{'type':dbH[_0x21a1('0x82')][_0x21a1('0x83')][_0x21a1('0x84')]});})[_0x21a1('0x25')](function(_0x247e48){return{'rows':_0x247e48||[],'count':_0x14c0e7};});}});}exports['run']=function(_0x5c20d7,_0x28334b){return runReport(_0x5c20d7[_0x21a1('0x45')],_0x5c20d7[_0x21a1('0x35')],_0x5c20d7['options'])[_0x21a1('0x25')](respondWithResult(_0x28334b,null))[_0x21a1('0x51')](handleError(_0x28334b,null));};exports[_0x21a1('0x9d')]=runReport;exports[_0x21a1('0x35')]=function(_0x1bc1e9,_0x492d3a){var _0xe58c11=0xa;var _0xd01477=['join',_0x21a1('0x86'),_0x21a1('0x53'),_0x21a1('0x54')];var _0x3abfed={'SUM':_0x21a1('0x87'),'COUNT':_0x21a1('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x21a1('0x57'),'MIN':_0x21a1('0x58'),'AVG':_0x21a1('0x88'),'GROUP_CONCAT':_0x21a1('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x21a1('0x5b')};var _0x4224af={'SEC_TO_TIME':_0x21a1('0x5c'),'DATE':_0x21a1('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x21a1('0x5f'),'UNIX_TIMESTAMP':_0x21a1('0x60')};var _0x296b20=function(_0x30af0a){return!_[_0x21a1('0x7a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x21a1('0x9e'),_0x21a1('0x63')],_0x30af0a);};var _0x33b5d3=function(_0x7f131){if(!_0x7f131||!_0x7f131['rules'][_0x21a1('0x37')]){return'';}for(var _0x585d47='(',_0x2f7b11=0x0;_0x2f7b11<_0x7f131[_0x21a1('0x64')]['length'];_0x2f7b11+=0x1){_0x2f7b11>0x0&&(_0x585d47+='\x20'+_0x7f131[_0x21a1('0x65')]+'\x20');_0x585d47+=_0x7f131[_0x21a1('0x64')][_0x2f7b11]['group']?_0x33b5d3(_0x7f131[_0x21a1('0x64')][_0x2f7b11]['group']):_0x7f131[_0x21a1('0x64')][_0x2f7b11][_0x21a1('0x67')]+'\x20'+_0x7f131[_0x21a1('0x64')][_0x2f7b11][_0x21a1('0x68')]+(_0x296b20(_0x7f131['rules'][_0x2f7b11]['condition'])?'\x20'+_0x7f131[_0x21a1('0x64')][_0x2f7b11][_0x21a1('0x69')]:'');}return _0x585d47+')';};var _0x5e09a3={'where':{'id':_0x1bc1e9[_0x21a1('0x45')]['id']}},_0x1c87ed,_0x3ca69c,_0x51b5b0,_0x98d30e,_0x3a9820;_0x5e09a3=_['merge']({},_0x5e09a3,_0x1bc1e9[_0x21a1('0x40')]);return db[_0x21a1('0x2e')][_0x21a1('0x48')](_0x5e09a3)[_0x21a1('0x25')](function(_0xc2055e){if(_0xc2055e){_0x1c87ed=_0xc2055e;return _0xc2055e[_0x21a1('0x6a')]();}return null;})[_0x21a1('0x25')](function(_0x5e2b99){if(_0x5e2b99){if(!_0x5e2b99[_0x21a1('0x37')]){throw new db[(_0x21a1('0x6b'))][(_0x21a1('0x6c'))](_0x21a1('0x9f'),0x193);}_0x3ca69c=_0x5e2b99;return db[_0x21a1('0x6d')][_0x21a1('0x42')]({'raw':!![]});}return null;})[_0x21a1('0x25')](function(_0x45167d){if(_0x45167d){_0x51b5b0=_[_0x21a1('0x89')](_0x45167d,'id');var _0x58ea4d;var _0x193f5e=squel[_0x21a1('0x6e')]();_0x193f5e[_0x21a1('0x8a')](_0x1c87ed[_0x21a1('0x6f')]);for(var _0x140f7d=0x0;_0x140f7d<_0x3ca69c[_0x21a1('0x37')];_0x140f7d+=0x1){_0x58ea4d=_0x3ca69c[_0x140f7d][_0x21a1('0x70')]?_0x51b5b0[_0x3ca69c[_0x140f7d][_0x21a1('0x70')]][_0x21a1('0x71')]:_0x3ca69c[_0x140f7d][_0x21a1('0x67')];_0x58ea4d=_0x3ca69c[_0x140f7d][_0x21a1('0x72')]?_['replace'](_0x3abfed[_0x3ca69c[_0x140f7d][_0x21a1('0x72')]],'%s',_0x58ea4d):_0x58ea4d;_0x58ea4d=_0x3ca69c[_0x140f7d][_0x21a1('0x73')]?_[_0x21a1('0x74')](_0x4224af[_0x3ca69c[_0x140f7d][_0x21a1('0x73')]],'%s',_0x58ea4d):_0x58ea4d;if(_0x3ca69c[_0x140f7d]['groupBy']){_0x193f5e['group'](_0x58ea4d);}_0x3ca69c[_0x140f7d][_0x21a1('0x76')]&&_0x193f5e[_0x21a1('0x3a')](_0x58ea4d,_0x3ca69c[_0x140f7d][_0x21a1('0x76')]==='DESC'?![]:!![]);_0x193f5e[_0x21a1('0x67')](_0x58ea4d,_0x3ca69c[_0x140f7d][_0x21a1('0x78')]||_0x58ea4d);}if(_0x1c87ed['joins']){_0x1c87ed[_0x21a1('0x79')]=JSON[_0x21a1('0x8b')](_0x1c87ed[_0x21a1('0x79')]);for(var _0x4ec0b1=0x0;_0x4ec0b1<_0x1c87ed[_0x21a1('0x79')][_0x21a1('0x37')];_0x4ec0b1+=0x1){if(_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x30')]&&_[_0x21a1('0x7a')](_0xd01477,_0x1c87ed['joins'][_0x4ec0b1]['type'])&&_0x1c87ed['joins'][_0x4ec0b1]['parentKey']&&_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x7c')]&&_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x7d')]){_0x193f5e[_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x30')]](_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1]['foreignTable'],null,util['format'](_0x21a1('0x8c'),_0x1c87ed[_0x21a1('0x6f')],_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x7b')],_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x7c')],_0x1c87ed[_0x21a1('0x79')][_0x4ec0b1][_0x21a1('0x7d')]));}}}if(_0x1c87ed[_0x21a1('0x7e')]){_0x1c87ed[_0x21a1('0x7e')]=JSON[_0x21a1('0x8b')](_0x1c87ed[_0x21a1('0x7e')]);_0x193f5e['where'](_0x33b5d3(_0x1c87ed['conditions'][_0x21a1('0x66')]));}_0x3a9820=_0x193f5e[_0x21a1('0x7f')]();_0x193f5e[_0x21a1('0x1c')](_0xe58c11);_0x193f5e['offset'](0x0);logger['debug'](_0x21a1('0x80'),_0x193f5e[_0x21a1('0x81')]());return dbH[_0x21a1('0x82')][_0x21a1('0x35')](_0x193f5e[_0x21a1('0x81')](),{'type':dbH[_0x21a1('0x82')]['QueryTypes'][_0x21a1('0x84')]});}})['then'](function(){return{'sql':_0x3a9820[_0x21a1('0x81')]()};})[_0x21a1('0x25')](respondWithResult(_0x492d3a,null))[_0x21a1('0x51')](handleError(_0x492d3a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 1104062..0e89faf 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 _0xfd26=['exports','define','analytics_custom_reports','lodash','../../config/logger','api','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x556d9b,_0x306294){var _0x4cfbec=function(_0x4f3338){while(--_0x4f3338){_0x556d9b['push'](_0x556d9b['shift']());}};_0x4cfbec(++_0x306294);}(_0xfd26,0x1bc));var _0x6fd2=function(_0x3a6c58,_0xf360e2){_0x3a6c58=_0x3a6c58-0x0;var _0x3c9853=_0xfd26[_0x3a6c58];return _0x3c9853;};'use strict';var _=require(_0x6fd2('0x0'));var util=require('util');var logger=require(_0x6fd2('0x1'))(_0x6fd2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fd2('0x3'));var rimraf=require('rimraf');var config=require(_0x6fd2('0x4'));var attributes=require(_0x6fd2('0x5'));module[_0x6fd2('0x6')]=function(_0x46378c,_0x1f0567){return _0x46378c[_0x6fd2('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0x6fd2('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe262=['define','AnalyticCustomReport','lodash','util','../../config/logger','request-promise','path','./analyticCustomReport.attributes'];(function(_0x761288,_0x3cb27e){var _0x27aa04=function(_0x4ab219){while(--_0x4ab219){_0x761288['push'](_0x761288['shift']());}};_0x27aa04(++_0x3cb27e);}(_0xe262,0x112));var _0x2e26=function(_0x3f13e3,_0x23897f){_0x3f13e3=_0x3f13e3-0x0;var _0x432eda=_0xe262[_0x3f13e3];return _0x432eda;};'use strict';var _=require(_0x2e26('0x0'));var util=require(_0x2e26('0x1'));var logger=require(_0x2e26('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e26('0x3'));var fs=require('fs');var path=require(_0x2e26('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e26('0x5'));module['exports']=function(_0x3d6d8a,_0x13db8a){return _0x3d6d8a[_0x2e26('0x6')](_0x2e26('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index ffe0b8b..fdc7199 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 _0x96f3=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x12fe32,_0x1d5358){var _0x1701f5=function(_0x236080){while(--_0x236080){_0x12fe32['push'](_0x12fe32['shift']());}};_0x1701f5(++_0x1d5358);}(_0x96f3,0x1ce));var _0x396f=function(_0x1f8eba,_0x1c8737){_0x1f8eba=_0x1f8eba-0x0;var _0x566842=_0x96f3[_0x1f8eba];return _0x566842;};'use strict';var _=require(_0x396f('0x0'));var util=require(_0x396f('0x1'));var moment=require(_0x396f('0x2'));var BPromise=require('bluebird');var rs=require(_0x396f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x396f('0x4'))['db'];var utils=require(_0x396f('0x5'));var logger=require('../../config/logger')(_0x396f('0x6'));var config=require(_0x396f('0x7'));var jayson=require(_0x396f('0x8'));var client=jayson[_0x396f('0x9')][_0x396f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d6e13,_0x2636f3,_0x468972){return new BPromise(function(_0x2a6a6e,_0x280f91){return client[_0x396f('0xb')](_0x3d6e13,_0x468972)[_0x396f('0xc')](function(_0x2bae57){logger[_0x396f('0xd')](_0x396f('0xe'),_0x2636f3,_0x396f('0xf'));logger[_0x396f('0x10')](_0x396f('0x11'),_0x2636f3,_0x396f('0xf'),JSON[_0x396f('0x12')](_0x2bae57));if(_0x2bae57[_0x396f('0x13')]){if(_0x2bae57[_0x396f('0x13')][_0x396f('0x14')]===0x1f4){logger[_0x396f('0x13')](_0x396f('0xe'),_0x2636f3,_0x2bae57[_0x396f('0x13')][_0x396f('0x15')]);return _0x280f91(_0x2bae57[_0x396f('0x13')][_0x396f('0x15')]);}logger['error'](_0x396f('0xe'),_0x2636f3,_0x2bae57[_0x396f('0x13')]['message']);return _0x2a6a6e(_0x2bae57['error'][_0x396f('0x15')]);}else{logger['info'](_0x396f('0xe'),_0x2636f3,_0x396f('0xf'));_0x2a6a6e(_0x2bae57['result'][_0x396f('0x15')]);}})[_0x396f('0x16')](function(_0x2e633b){logger[_0x396f('0x13')](_0x396f('0xe'),_0x2636f3,_0x2e633b);_0x280f91(_0x2e633b);});});} \ No newline at end of file +var _0xe828=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2d6ec7,_0x4d1e38){var _0x221fa6=function(_0x3ce12a){while(--_0x3ce12a){_0x2d6ec7['push'](_0x2d6ec7['shift']());}};_0x221fa6(++_0x4d1e38);}(_0xe828,0xb7));var _0x8e82=function(_0x149cf0,_0x3746f2){_0x149cf0=_0x149cf0-0x0;var _0x2ee2c8=_0xe828[_0x149cf0];return _0x2ee2c8;};'use strict';var _=require(_0x8e82('0x0'));var util=require('util');var moment=require(_0x8e82('0x1'));var BPromise=require(_0x8e82('0x2'));var rs=require(_0x8e82('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e82('0x4'))['db'];var utils=require(_0x8e82('0x5'));var logger=require(_0x8e82('0x6'))('rpc');var config=require(_0x8e82('0x7'));var jayson=require(_0x8e82('0x8'));var client=jayson[_0x8e82('0x9')][_0x8e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199bc6,_0x33702f,_0x38fe27){return new BPromise(function(_0xeaa750,_0xf7cfe4){return client[_0x8e82('0xb')](_0x199bc6,_0x38fe27)['then'](function(_0x4560f7){logger[_0x8e82('0xc')](_0x8e82('0xd'),_0x33702f,_0x8e82('0xe'));logger['debug'](_0x8e82('0xf'),_0x33702f,_0x8e82('0xe'),JSON['stringify'](_0x4560f7));if(_0x4560f7['error']){if(_0x4560f7[_0x8e82('0x10')][_0x8e82('0x11')]===0x1f4){logger['error'](_0x8e82('0xd'),_0x33702f,_0x4560f7[_0x8e82('0x10')][_0x8e82('0x12')]);return _0xf7cfe4(_0x4560f7[_0x8e82('0x10')][_0x8e82('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x33702f,_0x4560f7[_0x8e82('0x10')][_0x8e82('0x12')]);return _0xeaa750(_0x4560f7[_0x8e82('0x10')][_0x8e82('0x12')]);}else{logger[_0x8e82('0xc')](_0x8e82('0xd'),_0x33702f,_0x8e82('0xe'));_0xeaa750(_0x4560f7[_0x8e82('0x13')]['message']);}})[_0x8e82('0x14')](function(_0x37b9da){logger[_0x8e82('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x33702f,_0x37b9da);_0xf7cfe4(_0x37b9da);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f2e62c7..34c7a01 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 _0x13f9=['/:id/query','create','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run'];(function(_0x6c70fa,_0x30af1e){var _0x1ae862=function(_0x557d32){while(--_0x557d32){_0x6c70fa['push'](_0x6c70fa['shift']());}};_0x1ae862(++_0x30af1e);}(_0x13f9,0x10e));var _0x913f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x13f9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x913f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x913f('0x1')]();var fs_extra=require(_0x913f('0x2'));var auth=require(_0x913f('0x3'));var interaction=require(_0x913f('0x4'));var config=require(_0x913f('0x5'));var controller=require(_0x913f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x913f('0x7')]);router[_0x913f('0x8')](_0x913f('0x9'),auth[_0x913f('0xa')](),controller[_0x913f('0xb')]);router['get'](_0x913f('0xc'),auth[_0x913f('0xa')](),controller[_0x913f('0xd')]);router[_0x913f('0x8')](_0x913f('0xe'),auth[_0x913f('0xa')](),controller[_0x913f('0xf')]);router[_0x913f('0x8')](_0x913f('0x10'),auth[_0x913f('0xa')](),controller['query']);router['post']('/',auth[_0x913f('0xa')](),controller[_0x913f('0x11')]);router[_0x913f('0x12')](_0x913f('0x9'),auth[_0x913f('0xa')](),controller[_0x913f('0x13')]);router[_0x913f('0x14')](_0x913f('0x9'),auth[_0x913f('0xa')](),controller[_0x913f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5868=['./analyticCustomReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x5868,0x79));var _0x8586=function(_0x4a3b02,_0x3f5b31){_0x4a3b02=_0x4a3b02-0x0;var _0x40d53c=_0x5868[_0x4a3b02];return _0x40d53c;};'use strict';var multer=require('multer');var util=require(_0x8586('0x0'));var path=require(_0x8586('0x1'));var timeout=require(_0x8586('0x2'));var express=require(_0x8586('0x3'));var router=express[_0x8586('0x4')]();var fs_extra=require(_0x8586('0x5'));var auth=require(_0x8586('0x6'));var interaction=require(_0x8586('0x7'));var config=require(_0x8586('0x8'));var controller=require(_0x8586('0x9'));router[_0x8586('0xa')]('/',auth['isAuthenticated'](),controller[_0x8586('0xb')]);router['get'](_0x8586('0xc'),auth['isAuthenticated'](),controller[_0x8586('0xd')]);router['get'](_0x8586('0xe'),auth[_0x8586('0xf')](),controller[_0x8586('0x10')]);router['get'](_0x8586('0x11'),auth[_0x8586('0xf')](),controller[_0x8586('0x12')]);router[_0x8586('0xa')](_0x8586('0x13'),auth['isAuthenticated'](),controller[_0x8586('0x14')]);router[_0x8586('0x15')]('/',auth[_0x8586('0xf')](),controller[_0x8586('0x16')]);router['put']('/:id',auth[_0x8586('0xf')](),controller[_0x8586('0x17')]);router[_0x8586('0x18')]('/:id',auth[_0x8586('0xf')](),controller['destroy']);module[_0x8586('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7ae6291..a67a074 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0x2eb2,0x19f));var _0x22eb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2eb2[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x326f=['STRING','TEXT','sequelize'];(function(_0x26fde2,_0x312af3){var _0x384c75=function(_0x568b33){while(--_0x568b33){_0x26fde2['push'](_0x26fde2['shift']());}};_0x384c75(++_0x312af3);}(_0x326f,0xd1));var _0xf326=function(_0x53e5d9,_0x2aa097){_0x53e5d9=_0x53e5d9-0x0;var _0x1ec4e8=_0x326f[_0x53e5d9];return _0x1ec4e8;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2bbd071..27212dc 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2ef3,0xba));var _0x32ef=function(_0x44188e,_0x555dcc){_0x44188e=_0x44188e-0x0;var _0x341e68=_0x2ef3[_0x44188e];return _0x341e68;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file +var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x453986,_0x544d40){var _0x3a43fc=function(_0x3a46d9){while(--_0x3a46d9){_0x453986['push'](_0x453986['shift']());}};_0x3a43fc(++_0x544d40);}(_0x1967,0x173));var _0x7196=function(_0x4cd4a6,_0x25354c){_0x4cd4a6=_0x4cd4a6-0x0;var _0x19f2ca=_0x1967[_0x4cd4a6];return _0x19f2ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6bb437e..57b676e 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 _0x9884=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports','define','analytics_default_reports'];(function(_0x242c2e,_0x25621d){var _0x382b40=function(_0x5b6984){while(--_0x5b6984){_0x242c2e['push'](_0x242c2e['shift']());}};_0x382b40(++_0x25621d);}(_0x9884,0x118));var _0x4988=function(_0x4f8a18,_0x431b82){_0x4f8a18=_0x4f8a18-0x0;var _0x5a3a1a=_0x9884[_0x4f8a18];return _0x5a3a1a;};'use strict';var _=require(_0x4988('0x0'));var util=require(_0x4988('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4988('0x2'));var BPromise=require(_0x4988('0x3'));var rp=require(_0x4988('0x4'));var fs=require('fs');var path=require(_0x4988('0x5'));var rimraf=require('rimraf');var config=require(_0x4988('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x4988('0x7')]=function(_0x2e4cc9,_0x1ae21b){return _0x2e4cc9[_0x4988('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x4988('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd685=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1f9862,_0x1047d7){var _0x5c41b0=function(_0x4790a3){while(--_0x4790a3){_0x1f9862['push'](_0x1f9862['shift']());}};_0x5c41b0(++_0x1047d7);}(_0xd685,0x181));var _0x5d68=function(_0x575a98,_0x3ab642){_0x575a98=_0x575a98-0x0;var _0x526348=_0xd685[_0x575a98];return _0x526348;};'use strict';var _=require(_0x5d68('0x0'));var util=require(_0x5d68('0x1'));var logger=require(_0x5d68('0x2'))(_0x5d68('0x3'));var moment=require(_0x5d68('0x4'));var BPromise=require('bluebird');var rp=require(_0x5d68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d68('0x6'));var config=require(_0x5d68('0x7'));var attributes=require(_0x5d68('0x8'));module[_0x5d68('0x9')]=function(_0x4376f1,_0x189757){return _0x4376f1[_0x5d68('0xa')](_0x5d68('0xb'),attributes,{'tableName':_0x5d68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index fe2cd68..54fc0fc 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 _0xf03e=['../../config/environment','jayson/promise','then','info','debug','request\x20sent','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x889272,_0x3dffa6){var _0x2474d3=function(_0x503b97){while(--_0x503b97){_0x889272['push'](_0x889272['shift']());}};_0x2474d3(++_0x3dffa6);}(_0xf03e,0x13c));var _0xef03=function(_0x14f3e9,_0x38c551){_0x14f3e9=_0x14f3e9-0x0;var _0x234449=_0xf03e[_0x14f3e9];return _0x234449;};'use strict';var _=require(_0xef03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xef03('0x1'));var rs=require(_0xef03('0x2'));var fs=require('fs');var Redis=require(_0xef03('0x3'));var db=require(_0xef03('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef03('0x5'))(_0xef03('0x6'));var config=require(_0xef03('0x7'));var jayson=require(_0xef03('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd371,_0x2472fa,_0x58c989){return new BPromise(function(_0x1cea72,_0x1d00e6){return client['request'](_0x2dd371,_0x58c989)[_0xef03('0x9')](function(_0xc6ccec){logger[_0xef03('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2472fa,'request\x20sent');logger[_0xef03('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2472fa,_0xef03('0xc'),JSON['stringify'](_0xc6ccec));if(_0xc6ccec[_0xef03('0xd')]){if(_0xc6ccec[_0xef03('0xd')][_0xef03('0xe')]===0x1f4){logger[_0xef03('0xd')](_0xef03('0xf'),_0x2472fa,_0xc6ccec[_0xef03('0xd')][_0xef03('0x10')]);return _0x1d00e6(_0xc6ccec[_0xef03('0xd')][_0xef03('0x10')]);}logger[_0xef03('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2472fa,_0xc6ccec['error'][_0xef03('0x10')]);return _0x1cea72(_0xc6ccec[_0xef03('0xd')]['message']);}else{logger[_0xef03('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2472fa,_0xef03('0xc'));_0x1cea72(_0xc6ccec[_0xef03('0x11')][_0xef03('0x10')]);}})[_0xef03('0x12')](function(_0x6c6663){logger[_0xef03('0xd')](_0xef03('0xf'),_0x2472fa,_0x6c6663);_0x1d00e6(_0x6c6663);});});} \ No newline at end of file +var _0x7958=['request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x134974,_0x1b156c){var _0x5845c9=function(_0x329027){while(--_0x329027){_0x134974['push'](_0x134974['shift']());}};_0x5845c9(++_0x1b156c);}(_0x7958,0x91));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8795('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8795('0x1'));var fs=require('fs');var Redis=require(_0x8795('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8795('0x3'));var logger=require(_0x8795('0x4'))(_0x8795('0x5'));var config=require(_0x8795('0x6'));var jayson=require(_0x8795('0x7'));var client=jayson[_0x8795('0x8')][_0x8795('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e61d0,_0x1dc3ff,_0x36dfeb){return new BPromise(function(_0xee27c0,_0x38403c){return client[_0x8795('0xa')](_0x4e61d0,_0x36dfeb)[_0x8795('0xb')](function(_0x4a6566){logger[_0x8795('0xc')](_0x8795('0xd'),_0x1dc3ff,'request\x20sent');logger[_0x8795('0xe')](_0x8795('0xf'),_0x1dc3ff,_0x8795('0x10'),JSON[_0x8795('0x11')](_0x4a6566));if(_0x4a6566[_0x8795('0x12')]){if(_0x4a6566[_0x8795('0x12')][_0x8795('0x13')]===0x1f4){logger[_0x8795('0x12')](_0x8795('0xd'),_0x1dc3ff,_0x4a6566[_0x8795('0x12')][_0x8795('0x14')]);return _0x38403c(_0x4a6566[_0x8795('0x12')][_0x8795('0x14')]);}logger[_0x8795('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1dc3ff,_0x4a6566[_0x8795('0x12')][_0x8795('0x14')]);return _0xee27c0(_0x4a6566['error'][_0x8795('0x14')]);}else{logger[_0x8795('0xc')](_0x8795('0xd'),_0x1dc3ff,'request\x20sent');_0xee27c0(_0x4a6566[_0x8795('0x15')][_0x8795('0x14')]);}})[_0x8795('0x16')](function(_0x8b9f04){logger['error'](_0x8795('0xd'),_0x1dc3ff,_0x8b9f04);_0x38403c(_0x8b9f04);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 384a9e0..406341a 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 _0x77cb=['/:id/query','query','post','create','put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','run'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x77cb,0x194));var _0xb77c=function(_0x3d6eb1,_0x1f99b1){_0x3d6eb1=_0x3d6eb1-0x0;var _0x4e5356=_0x77cb[_0x3d6eb1];return _0x4e5356;};'use strict';var multer=require('multer');var util=require(_0xb77c('0x0'));var path=require(_0xb77c('0x1'));var timeout=require(_0xb77c('0x2'));var express=require(_0xb77c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb77c('0x4'));var interaction=require(_0xb77c('0x5'));var config=require(_0xb77c('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xb77c('0x7')]('/',auth[_0xb77c('0x8')](),controller['index']);router['get'](_0xb77c('0x9'),auth['isAuthenticated'](),controller[_0xb77c('0xa')]);router[_0xb77c('0x7')](_0xb77c('0xb'),auth[_0xb77c('0x8')](),controller[_0xb77c('0xc')]);router[_0xb77c('0x7')]('/:id/run',auth[_0xb77c('0x8')](),controller[_0xb77c('0xd')]);router[_0xb77c('0x7')](_0xb77c('0xe'),auth[_0xb77c('0x8')](),controller[_0xb77c('0xf')]);router[_0xb77c('0x10')]('/',auth[_0xb77c('0x8')](),controller[_0xb77c('0x11')]);router[_0xb77c('0x12')](_0xb77c('0x9'),auth['isAuthenticated'](),controller[_0xb77c('0x13')]);router[_0xb77c('0x14')](_0xb77c('0x9'),auth[_0xb77c('0x8')](),controller['destroy']);module[_0xb77c('0x15')]=router; \ No newline at end of file +var _0xee55=['express','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','query','post','update','destroy','exports','multer','path'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0xee55,0x1a0));var _0x5ee5=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xee55[_0x54b283];return _0x2462b3;};'use strict';var multer=require(_0x5ee5('0x0'));var util=require('util');var path=require(_0x5ee5('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ee5('0x2'));var router=express['Router']();var fs_extra=require(_0x5ee5('0x3'));var auth=require(_0x5ee5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ee5('0x5'));var controller=require(_0x5ee5('0x6'));router[_0x5ee5('0x7')]('/',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0x9')]);router[_0x5ee5('0x7')](_0x5ee5('0xa'),auth['isAuthenticated'](),controller[_0x5ee5('0xb')]);router['get']('/:id/preview',auth[_0x5ee5('0x8')](),controller['preview']);router['get'](_0x5ee5('0xc'),auth[_0x5ee5('0x8')](),controller[_0x5ee5('0xd')]);router[_0x5ee5('0x7')]('/:id/query',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0xe')]);router[_0x5ee5('0xf')]('/',auth[_0x5ee5('0x8')](),controller['create']);router['put'](_0x5ee5('0xa'),auth[_0x5ee5('0x8')](),controller[_0x5ee5('0x10')]);router['delete'](_0x5ee5('0xa'),auth[_0x5ee5('0x8')](),controller[_0x5ee5('0x11')]);module[_0x5ee5('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index c2b8b4e..b6437e0 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 _0xf518=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled'];(function(_0x4acb85,_0xba6588){var _0x28a3dc=function(_0x54e186){while(--_0x54e186){_0x4acb85['push'](_0x4acb85['shift']());}};_0x28a3dc(++_0xba6588);}(_0xf518,0xe2));var _0x8f51=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xf518[_0x2650e9];return _0x3511c8;};'use strict';var Sequelize=require(_0x8f51('0x0'));var moment=require(_0x8f51('0x1'));module[_0x8f51('0x2')]={'name':{'type':Sequelize[_0x8f51('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x8f51('0x4')](_0x8f51('0x5'),_0x8f51('0x6'),_0x8f51('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x8f51('0x8')]},'endDate':{'type':Sequelize[_0x8f51('0x8')]},'status':{'type':Sequelize[_0x8f51('0x3')],'defaultValue':_0x8f51('0x9')},'type':{'type':Sequelize['ENUM'](_0x8f51('0xa'),_0x8f51('0xb')),'allowNull':![],'defaultValue':_0x8f51('0xa')},'reportId':{'type':Sequelize[_0x8f51('0xc')](0xb)[_0x8f51('0xd')]},'reportType':{'type':Sequelize[_0x8f51('0x3')]}}; \ No newline at end of file +var _0x1a55=['UNSIGNED','sequelize','exports','ENUM','csv','pdf','STRING','DATE','manual','scheduled','INTEGER'];(function(_0x5300af,_0x4bf937){var _0x4fe1e1=function(_0x2895d7){while(--_0x2895d7){_0x5300af['push'](_0x5300af['shift']());}};_0x4fe1e1(++_0x4bf937);}(_0x1a55,0x1b9));var _0x51a5=function(_0x43d0a8,_0xba5d64){_0x43d0a8=_0x43d0a8-0x0;var _0x5b0d5f=_0x1a55[_0x43d0a8];return _0x5b0d5f;};'use strict';var Sequelize=require(_0x51a5('0x0'));var moment=require('moment');module[_0x51a5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x51a5('0x2')](_0x51a5('0x3'),_0x51a5('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x51a5('0x3')},'savename':{'type':Sequelize[_0x51a5('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x51a5('0x6')]},'endDate':{'type':Sequelize[_0x51a5('0x6')]},'status':{'type':Sequelize[_0x51a5('0x5')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x51a5('0x2')](_0x51a5('0x7'),_0x51a5('0x8')),'allowNull':![],'defaultValue':_0x51a5('0x7')},'reportId':{'type':Sequelize[_0x51a5('0x9')](0xb)[_0x51a5('0xa')]},'reportType':{'type':Sequelize[_0x51a5('0x5')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7feeeec..357823d 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 _0x1b76=['save','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','where','filter','merge','VIRTUAL','options','findAll','rows','catch','AnalyticExtractedReport','filters','fields','includeAll','include','find','create','user','role','userProfileId','update','body','params','savename','existsSync','join','root','Sequelize','ValidationError','exists','download','server/files/reports','format','%s.%s','basename','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2a60cc,_0x3f47a3){var _0x5ebb88=function(_0x3538d0){while(--_0x3538d0){_0x2a60cc['push'](_0x2a60cc['shift']());}};_0x5ebb88(++_0x3f47a3);}(_0x1b76,0xef));var _0x61b7=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x1b76[_0x369151];return _0x4292d5;};'use strict';var emlformat=require(_0x61b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x61b7('0x1'));var jsonpatch=require(_0x61b7('0x2'));var rp=require(_0x61b7('0x3'));var moment=require(_0x61b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x61b7('0x5'));var path=require(_0x61b7('0x6'));var sox=require(_0x61b7('0x7'));var csv=require(_0x61b7('0x8'));var ejs=require(_0x61b7('0x9'));var fs=require('fs');var fs_extra=require(_0x61b7('0xa'));var _=require(_0x61b7('0xb'));var squel=require(_0x61b7('0xc'));var crypto=require(_0x61b7('0xd'));var jsforce=require(_0x61b7('0xe'));var deskjs=require(_0x61b7('0xf'));var toCsv=require(_0x61b7('0x8'));var querystring=require(_0x61b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x61b7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61b7('0x12'))(_0x61b7('0x13'));var utils=require(_0x61b7('0x14'));var config=require(_0x61b7('0x15'));var licenseUtil=require(_0x61b7('0x16'));var db=require(_0x61b7('0x17'))['db'];function respondWithStatusCode(_0x1b5613,_0x1a169e){_0x1a169e=_0x1a169e||0xcc;return function(_0x222582){if(_0x222582){return _0x1b5613['sendStatus'](_0x1a169e);}return _0x1b5613[_0x61b7('0x18')](_0x1a169e)[_0x61b7('0x19')]();};}function respondWithResult(_0x4c12e5,_0x34946d){_0x34946d=_0x34946d||0xc8;return function(_0x47bd31){if(_0x47bd31){return _0x4c12e5[_0x61b7('0x18')](_0x34946d)[_0x61b7('0x1a')](_0x47bd31);}};}function respondWithFilteredResult(_0x1db345,_0x75c47e){return function(_0xa74ceb){if(_0xa74ceb){var _0x53cd87=typeof _0x75c47e[_0x61b7('0x1b')]===_0x61b7('0x1c')&&typeof _0x75c47e[_0x61b7('0x1d')]==='undefined';var _0x1c5a91=_0xa74ceb[_0x61b7('0x1e')];var _0x125b8e=_0x53cd87?0x0:_0x75c47e[_0x61b7('0x1b')];var _0x470e69=_0x53cd87?_0xa74ceb[_0x61b7('0x1e')]:_0x75c47e[_0x61b7('0x1b')]+_0x75c47e[_0x61b7('0x1d')];var _0x165f56;if(_0x470e69>=_0x1c5a91){_0x470e69=_0x1c5a91;_0x165f56=0xc8;}else{_0x165f56=0xce;}_0x1db345[_0x61b7('0x18')](_0x165f56);return _0x1db345[_0x61b7('0x1f')](_0x61b7('0x20'),_0x125b8e+'-'+_0x470e69+'/'+_0x1c5a91)['json'](_0xa74ceb);}return null;};}function patchUpdates(_0x3cecec){return function(_0x2207e2){try{jsonpatch[_0x61b7('0x21')](_0x2207e2,_0x3cecec,!![]);}catch(_0x4faada){return BPromise['reject'](_0x4faada);}return _0x2207e2[_0x61b7('0x22')]();};}function saveUpdates(_0x103905,_0x1bf1f4){return function(_0x43854f){if(_0x43854f){return _0x43854f['update'](_0x103905)['then'](function(_0x16661a){return _0x16661a;});}return null;};}function removeEntity(_0xdf852f,_0x17e091){return function(_0x1c208c){if(_0x1c208c){return _0x1c208c['destroy']()[_0x61b7('0x23')](function(){var _0x1eb15b=_0x1c208c[_0x61b7('0x24')]({'plain':!![]});var _0x2d1d5b='ExtractedReports';return db[_0x61b7('0x25')][_0x61b7('0x26')]({'where':{'type':_0x2d1d5b,'resourceId':_0x1eb15b['id']}})[_0x61b7('0x23')](function(){return _0x1c208c;});})[_0x61b7('0x23')](function(){_0xdf852f[_0x61b7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbf0fd2,_0x11d8f3){return function(_0x6c63d){if(!_0x6c63d){_0xbf0fd2[_0x61b7('0x27')](0x194);}return _0x6c63d;};}function handleError(_0x2b94fb,_0x4034ba){_0x4034ba=_0x4034ba||0x1f4;return function(_0xa4525a){logger[_0x61b7('0x28')](_0xa4525a[_0x61b7('0x29')]);if(_0xa4525a['name']){delete _0xa4525a[_0x61b7('0x2a')];}_0x2b94fb[_0x61b7('0x18')](_0x4034ba)['send'](_0xa4525a);};}exports[_0x61b7('0x2b')]=function(_0x4fde49,_0x57b531){var _0x5034b2={},_0x55a9f8={},_0x40cb11={'count':0x0,'rows':[]};var _0x3c62e7=_[_0x61b7('0x2c')](db['AnalyticExtractedReport'][_0x61b7('0x2d')],function(_0x5b88b3){return{'name':_0x5b88b3[_0x61b7('0x2e')],'type':_0x5b88b3[_0x61b7('0x2f')][_0x61b7('0x30')]};});_0x55a9f8[_0x61b7('0x31')]=_['map'](_0x3c62e7,_0x61b7('0x2a'));_0x55a9f8[_0x61b7('0x32')]=_[_0x61b7('0x33')](_0x4fde49[_0x61b7('0x32')]);_0x55a9f8['filters']=_[_0x61b7('0x34')](_0x55a9f8['model'],_0x55a9f8[_0x61b7('0x32')]);_0x5034b2[_0x61b7('0x35')]=_[_0x61b7('0x34')](_0x55a9f8['model'],qs['fields'](_0x4fde49['query']['fields']));_0x5034b2[_0x61b7('0x35')]=_0x5034b2[_0x61b7('0x35')][_0x61b7('0x36')]?_0x5034b2[_0x61b7('0x35')]:_0x55a9f8[_0x61b7('0x31')];if(!_0x4fde49[_0x61b7('0x32')][_0x61b7('0x37')]('nolimit')){_0x5034b2['limit']=qs[_0x61b7('0x1d')](_0x4fde49['query'][_0x61b7('0x1d')]);_0x5034b2[_0x61b7('0x1b')]=qs[_0x61b7('0x1b')](_0x4fde49[_0x61b7('0x32')][_0x61b7('0x1b')]);}_0x5034b2['order']=qs['sort'](_0x4fde49[_0x61b7('0x32')]['sort']);_0x5034b2[_0x61b7('0x38')]=qs['filters'](_['pick'](_0x4fde49[_0x61b7('0x32')],_0x55a9f8['filters']),_0x3c62e7);if(_0x4fde49[_0x61b7('0x32')][_0x61b7('0x39')]){_0x5034b2[_0x61b7('0x38')]=_[_0x61b7('0x3a')](_0x5034b2[_0x61b7('0x38')],{'$or':_['map'](_0x3c62e7,function(_0x19efaf){if(_0x19efaf[_0x61b7('0x2f')]!==_0x61b7('0x3b')){var _0xbce1b={};_0xbce1b[_0x19efaf['name']]={'$like':'%'+_0x4fde49[_0x61b7('0x32')][_0x61b7('0x39')]+'%'};return _0xbce1b;}})});}_0x5034b2=_['merge']({},_0x5034b2,_0x4fde49[_0x61b7('0x3c')]);var _0x188d18={'where':_0x5034b2[_0x61b7('0x38')]};return db['AnalyticExtractedReport'][_0x61b7('0x1e')](_0x188d18)[_0x61b7('0x23')](function(_0xaf11b3){_0x40cb11['count']=_0xaf11b3;if(_0x4fde49[_0x61b7('0x32')]['includeAll']){_0x5034b2['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x61b7('0x3d')](_0x5034b2);})[_0x61b7('0x23')](function(_0x4accf4){_0x40cb11[_0x61b7('0x3e')]=_0x4accf4;return _0x40cb11;})[_0x61b7('0x23')](respondWithFilteredResult(_0x57b531,_0x5034b2))[_0x61b7('0x3f')](handleError(_0x57b531,null));};exports['show']=function(_0x235401,_0x35404d){var _0x404c2f={'raw':!![],'where':{'id':_0x235401['params']['id']}},_0x552582={};_0x552582[_0x61b7('0x31')]=_[_0x61b7('0x33')](db[_0x61b7('0x40')][_0x61b7('0x2d')]);_0x552582[_0x61b7('0x32')]=_[_0x61b7('0x33')](_0x235401['query']);_0x552582[_0x61b7('0x41')]=_[_0x61b7('0x34')](_0x552582[_0x61b7('0x31')],_0x552582[_0x61b7('0x32')]);_0x404c2f[_0x61b7('0x35')]=_[_0x61b7('0x34')](_0x552582[_0x61b7('0x31')],qs[_0x61b7('0x42')](_0x235401['query'][_0x61b7('0x42')]));_0x404c2f[_0x61b7('0x35')]=_0x404c2f['attributes'][_0x61b7('0x36')]?_0x404c2f[_0x61b7('0x35')]:_0x552582['model'];if(_0x235401['query'][_0x61b7('0x43')]){_0x404c2f[_0x61b7('0x44')]=[{'all':!![]}];}_0x404c2f=_[_0x61b7('0x3a')]({},_0x404c2f,_0x235401['options']);return db[_0x61b7('0x40')][_0x61b7('0x45')](_0x404c2f)[_0x61b7('0x23')](handleEntityNotFound(_0x35404d,null))[_0x61b7('0x23')](respondWithResult(_0x35404d,null))[_0x61b7('0x3f')](handleError(_0x35404d,null));};exports['create']=function(_0x4b70c4,_0x4bd302){return db[_0x61b7('0x40')][_0x61b7('0x46')](_0x4b70c4['body'],{})[_0x61b7('0x23')](function(_0x56648b){var _0x53fd4e=_0x4b70c4[_0x61b7('0x47')]['get']({'plain':!![]});if(!_0x53fd4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53fd4e[_0x61b7('0x48')]===_0x61b7('0x47')){var _0x3139e4=_0x56648b[_0x61b7('0x24')]({'plain':!![]});var _0x428f09='ExtractedReports';return db['UserProfileSection'][_0x61b7('0x45')]({'where':{'name':_0x428f09,'userProfileId':_0x53fd4e[_0x61b7('0x49')]},'raw':!![]})[_0x61b7('0x23')](function(_0x12b224){if(_0x12b224&&_0x12b224['autoAssociation']===0x0){return db[_0x61b7('0x25')][_0x61b7('0x46')]({'name':_0x3139e4[_0x61b7('0x2a')],'resourceId':_0x3139e4['id'],'type':_0x12b224[_0x61b7('0x2a')],'sectionId':_0x12b224['id']},{})[_0x61b7('0x23')](function(){return _0x56648b;});}else{return _0x56648b;}})['catch'](function(_0x4d8d1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d8d1e);throw _0x4d8d1e;});}return _0x56648b;})[_0x61b7('0x23')](respondWithResult(_0x4bd302,0xc9))[_0x61b7('0x3f')](handleError(_0x4bd302,null));};exports[_0x61b7('0x4a')]=function(_0x516d74,_0x9f60de){if(_0x516d74[_0x61b7('0x4b')]['id']){delete _0x516d74[_0x61b7('0x4b')]['id'];}return db[_0x61b7('0x40')][_0x61b7('0x45')]({'where':{'id':_0x516d74[_0x61b7('0x4c')]['id']}})[_0x61b7('0x23')](handleEntityNotFound(_0x9f60de,null))[_0x61b7('0x23')](saveUpdates(_0x516d74[_0x61b7('0x4b')],null))[_0x61b7('0x23')](respondWithResult(_0x9f60de,null))[_0x61b7('0x3f')](handleError(_0x9f60de,null));};exports['destroy']=function(_0x1d670b,_0x304aea){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1d670b[_0x61b7('0x4c')]['id']}})[_0x61b7('0x23')](handleEntityNotFound(_0x304aea,null))[_0x61b7('0x23')](removeEntity(_0x304aea,null))[_0x61b7('0x3f')](handleError(_0x304aea,null));};exports['download']=function(_0x847b6f,_0x1d9795,_0x173c44){return db[_0x61b7('0x40')][_0x61b7('0x45')]({'where':{'id':_0x847b6f[_0x61b7('0x4c')]['id']},'attributes':[_0x61b7('0x2a'),'basename',_0x61b7('0x4d'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1d9795,null))[_0x61b7('0x23')](function(_0x59364d){if(_0x59364d){if(!fs[_0x61b7('0x4e')](path[_0x61b7('0x4f')](config[_0x61b7('0x50')],'server/files/reports',_0x59364d[_0x61b7('0x4d')]))){throw new db[(_0x61b7('0x51'))][(_0x61b7('0x52'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x847b6f[_0x61b7('0x32')][_0x61b7('0x53')]){return _0x1d9795[_0x61b7('0x27')](0xc8);}return _0x1d9795[_0x61b7('0x54')](path[_0x61b7('0x4f')](config[_0x61b7('0x50')],_0x61b7('0x55'),_0x59364d[_0x61b7('0x4d')]),util[_0x61b7('0x56')](_0x61b7('0x57'),_0x59364d[_0x61b7('0x58')]||_0x59364d[_0x61b7('0x2a')],_0x59364d[_0x61b7('0x59')][_0x61b7('0x5a')]()));}})[_0x61b7('0x3f')](handleError(_0x1d9795,null));}; \ No newline at end of file +var _0x5e05=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','destroy','then','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','findAll','rows','params','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','output','existsSync','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs'];(function(_0x40a62c,_0xe876f4){var _0x23970e=function(_0x29d52c){while(--_0x29d52c){_0x40a62c['push'](_0x40a62c['shift']());}};_0x23970e(++_0xe876f4);}(_0x5e05,0x1e5));var _0x55e0=function(_0x5b34a5,_0x431636){_0x5b34a5=_0x5b34a5-0x0;var _0x38beb7=_0x5e05[_0x5b34a5];return _0x38beb7;};'use strict';var emlformat=require(_0x55e0('0x0'));var rimraf=require(_0x55e0('0x1'));var zipdir=require(_0x55e0('0x2'));var jsonpatch=require(_0x55e0('0x3'));var rp=require('request-promise');var moment=require(_0x55e0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x55e0('0x5'));var path=require(_0x55e0('0x6'));var sox=require(_0x55e0('0x7'));var csv=require(_0x55e0('0x8'));var ejs=require(_0x55e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55e0('0xa'));var squel=require(_0x55e0('0xb'));var crypto=require('crypto');var jsforce=require(_0x55e0('0xc'));var deskjs=require(_0x55e0('0xd'));var toCsv=require(_0x55e0('0x8'));var querystring=require(_0x55e0('0xe'));var Papa=require(_0x55e0('0xf'));var Redis=require(_0x55e0('0x10'));var authService=require(_0x55e0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x55e0('0x12'));var hardwareService=require(_0x55e0('0x13'));var logger=require(_0x55e0('0x14'))(_0x55e0('0x15'));var utils=require(_0x55e0('0x16'));var config=require(_0x55e0('0x17'));var licenseUtil=require(_0x55e0('0x18'));var db=require(_0x55e0('0x19'))['db'];function respondWithStatusCode(_0x3d694d,_0x262015){_0x262015=_0x262015||0xcc;return function(_0x373564){if(_0x373564){return _0x3d694d[_0x55e0('0x1a')](_0x262015);}return _0x3d694d[_0x55e0('0x1b')](_0x262015)[_0x55e0('0x1c')]();};}function respondWithResult(_0x56e5b2,_0x2018cb){_0x2018cb=_0x2018cb||0xc8;return function(_0x4c57f2){if(_0x4c57f2){return _0x56e5b2[_0x55e0('0x1b')](_0x2018cb)['json'](_0x4c57f2);}};}function respondWithFilteredResult(_0x2e710b,_0x53c872){return function(_0x1a7640){if(_0x1a7640){var _0x47417e=typeof _0x53c872[_0x55e0('0x1d')]===_0x55e0('0x1e')&&typeof _0x53c872['limit']==='undefined';var _0x277016=_0x1a7640[_0x55e0('0x1f')];var _0x2962a3=_0x47417e?0x0:_0x53c872[_0x55e0('0x1d')];var _0x20e2ed=_0x47417e?_0x1a7640[_0x55e0('0x1f')]:_0x53c872[_0x55e0('0x1d')]+_0x53c872[_0x55e0('0x20')];var _0x18d8ea;if(_0x20e2ed>=_0x277016){_0x20e2ed=_0x277016;_0x18d8ea=0xc8;}else{_0x18d8ea=0xce;}_0x2e710b[_0x55e0('0x1b')](_0x18d8ea);return _0x2e710b[_0x55e0('0x21')](_0x55e0('0x22'),_0x2962a3+'-'+_0x20e2ed+'/'+_0x277016)[_0x55e0('0x23')](_0x1a7640);}return null;};}function patchUpdates(_0x34eaf9){return function(_0x2d05b3){try{jsonpatch['apply'](_0x2d05b3,_0x34eaf9,!![]);}catch(_0x2896b9){return BPromise[_0x55e0('0x24')](_0x2896b9);}return _0x2d05b3[_0x55e0('0x25')]();};}function saveUpdates(_0x24f177,_0x35cf6a){return function(_0x5dcc04){if(_0x5dcc04){return _0x5dcc04['update'](_0x24f177)['then'](function(_0x5c3fad){return _0x5c3fad;});}return null;};}function removeEntity(_0x224e35,_0x180c18){return function(_0x329d06){if(_0x329d06){return _0x329d06[_0x55e0('0x26')]()[_0x55e0('0x27')](function(){var _0x1c7f54=_0x329d06[_0x55e0('0x28')]({'plain':!![]});var _0x47e14c=_0x55e0('0x29');return db['UserProfileResource'][_0x55e0('0x26')]({'where':{'type':_0x47e14c,'resourceId':_0x1c7f54['id']}})[_0x55e0('0x27')](function(){return _0x329d06;});})[_0x55e0('0x27')](function(){_0x224e35[_0x55e0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e136,_0x4f376c){return function(_0x5eff8b){if(!_0x5eff8b){_0x32e136[_0x55e0('0x1a')](0x194);}return _0x5eff8b;};}function handleError(_0x213e62,_0x3286a3){_0x3286a3=_0x3286a3||0x1f4;return function(_0x55b07d){logger[_0x55e0('0x2a')](_0x55b07d[_0x55e0('0x2b')]);if(_0x55b07d[_0x55e0('0x2c')]){delete _0x55b07d[_0x55e0('0x2c')];}_0x213e62[_0x55e0('0x1b')](_0x3286a3)[_0x55e0('0x2d')](_0x55b07d);};}exports[_0x55e0('0x2e')]=function(_0x166403,_0x3a3e7f){var _0x5907c4={},_0x5c2e2b={},_0x234307={'count':0x0,'rows':[]};var _0x2e4128=_[_0x55e0('0x2f')](db[_0x55e0('0x30')][_0x55e0('0x31')],function(_0x475287){return{'name':_0x475287[_0x55e0('0x32')],'type':_0x475287['type'][_0x55e0('0x33')]};});_0x5c2e2b[_0x55e0('0x34')]=_[_0x55e0('0x2f')](_0x2e4128,_0x55e0('0x2c'));_0x5c2e2b[_0x55e0('0x35')]=_[_0x55e0('0x36')](_0x166403[_0x55e0('0x35')]);_0x5c2e2b[_0x55e0('0x37')]=_[_0x55e0('0x38')](_0x5c2e2b[_0x55e0('0x34')],_0x5c2e2b['query']);_0x5907c4['attributes']=_[_0x55e0('0x38')](_0x5c2e2b['model'],qs['fields'](_0x166403['query'][_0x55e0('0x39')]));_0x5907c4[_0x55e0('0x3a')]=_0x5907c4['attributes'][_0x55e0('0x3b')]?_0x5907c4['attributes']:_0x5c2e2b[_0x55e0('0x34')];if(!_0x166403[_0x55e0('0x35')][_0x55e0('0x3c')](_0x55e0('0x3d'))){_0x5907c4['limit']=qs['limit'](_0x166403[_0x55e0('0x35')][_0x55e0('0x20')]);_0x5907c4[_0x55e0('0x1d')]=qs[_0x55e0('0x1d')](_0x166403[_0x55e0('0x35')][_0x55e0('0x1d')]);}_0x5907c4[_0x55e0('0x3e')]=qs['sort'](_0x166403[_0x55e0('0x35')][_0x55e0('0x3f')]);_0x5907c4[_0x55e0('0x40')]=qs[_0x55e0('0x37')](_[_0x55e0('0x41')](_0x166403[_0x55e0('0x35')],_0x5c2e2b['filters']),_0x2e4128);if(_0x166403[_0x55e0('0x35')]['filter']){_0x5907c4['where']=_[_0x55e0('0x42')](_0x5907c4[_0x55e0('0x40')],{'$or':_[_0x55e0('0x2f')](_0x2e4128,function(_0x752d87){if(_0x752d87[_0x55e0('0x43')]!==_0x55e0('0x44')){var _0x425692={};_0x425692[_0x752d87['name']]={'$like':'%'+_0x166403['query']['filter']+'%'};return _0x425692;}})});}_0x5907c4=_['merge']({},_0x5907c4,_0x166403[_0x55e0('0x45')]);var _0xfff065={'where':_0x5907c4[_0x55e0('0x40')]};return db['AnalyticExtractedReport']['count'](_0xfff065)['then'](function(_0x35aa76){_0x234307['count']=_0x35aa76;if(_0x166403['query']['includeAll']){_0x5907c4['include']=[{'all':!![]}];}return db[_0x55e0('0x30')][_0x55e0('0x46')](_0x5907c4);})[_0x55e0('0x27')](function(_0x3408c2){_0x234307[_0x55e0('0x47')]=_0x3408c2;return _0x234307;})[_0x55e0('0x27')](respondWithFilteredResult(_0x3a3e7f,_0x5907c4))['catch'](handleError(_0x3a3e7f,null));};exports['show']=function(_0x128f48,_0x28019b){var _0x36aec8={'raw':!![],'where':{'id':_0x128f48[_0x55e0('0x48')]['id']}},_0x4099cf={};_0x4099cf[_0x55e0('0x34')]=_[_0x55e0('0x36')](db[_0x55e0('0x30')][_0x55e0('0x31')]);_0x4099cf[_0x55e0('0x35')]=_[_0x55e0('0x36')](_0x128f48['query']);_0x4099cf['filters']=_[_0x55e0('0x38')](_0x4099cf['model'],_0x4099cf[_0x55e0('0x35')]);_0x36aec8[_0x55e0('0x3a')]=_[_0x55e0('0x38')](_0x4099cf[_0x55e0('0x34')],qs[_0x55e0('0x39')](_0x128f48['query'][_0x55e0('0x39')]));_0x36aec8[_0x55e0('0x3a')]=_0x36aec8[_0x55e0('0x3a')]['length']?_0x36aec8[_0x55e0('0x3a')]:_0x4099cf[_0x55e0('0x34')];if(_0x128f48[_0x55e0('0x35')][_0x55e0('0x49')]){_0x36aec8[_0x55e0('0x4a')]=[{'all':!![]}];}_0x36aec8=_[_0x55e0('0x42')]({},_0x36aec8,_0x128f48[_0x55e0('0x45')]);return db[_0x55e0('0x30')]['find'](_0x36aec8)['then'](handleEntityNotFound(_0x28019b,null))[_0x55e0('0x27')](respondWithResult(_0x28019b,null))[_0x55e0('0x4b')](handleError(_0x28019b,null));};exports['create']=function(_0x1288cf,_0x1cefcb){return db[_0x55e0('0x30')][_0x55e0('0x4c')](_0x1288cf[_0x55e0('0x4d')],{})[_0x55e0('0x27')](function(_0x56b65b){var _0x4b9bfb=_0x1288cf[_0x55e0('0x4e')][_0x55e0('0x28')]({'plain':!![]});if(!_0x4b9bfb)throw new Error(_0x55e0('0x4f'));if(_0x4b9bfb[_0x55e0('0x50')]===_0x55e0('0x4e')){var _0x2bd706=_0x56b65b['get']({'plain':!![]});var _0x2032f0=_0x55e0('0x29');return db[_0x55e0('0x51')][_0x55e0('0x52')]({'where':{'name':_0x2032f0,'userProfileId':_0x4b9bfb[_0x55e0('0x53')]},'raw':!![]})[_0x55e0('0x27')](function(_0x18b2b7){if(_0x18b2b7&&_0x18b2b7[_0x55e0('0x54')]===0x0){return db['UserProfileResource'][_0x55e0('0x4c')]({'name':_0x2bd706[_0x55e0('0x2c')],'resourceId':_0x2bd706['id'],'type':_0x18b2b7[_0x55e0('0x2c')],'sectionId':_0x18b2b7['id']},{})[_0x55e0('0x27')](function(){return _0x56b65b;});}else{return _0x56b65b;}})['catch'](function(_0x4ce391){logger[_0x55e0('0x2a')](_0x55e0('0x55'),_0x4ce391);throw _0x4ce391;});}return _0x56b65b;})[_0x55e0('0x27')](respondWithResult(_0x1cefcb,0xc9))[_0x55e0('0x4b')](handleError(_0x1cefcb,null));};exports[_0x55e0('0x56')]=function(_0x40dd71,_0x39cd71){if(_0x40dd71[_0x55e0('0x4d')]['id']){delete _0x40dd71[_0x55e0('0x4d')]['id'];}return db['AnalyticExtractedReport'][_0x55e0('0x52')]({'where':{'id':_0x40dd71['params']['id']}})['then'](handleEntityNotFound(_0x39cd71,null))[_0x55e0('0x27')](saveUpdates(_0x40dd71[_0x55e0('0x4d')],null))[_0x55e0('0x27')](respondWithResult(_0x39cd71,null))[_0x55e0('0x4b')](handleError(_0x39cd71,null));};exports[_0x55e0('0x26')]=function(_0x462d93,_0x33628d){return db[_0x55e0('0x30')][_0x55e0('0x52')]({'where':{'id':_0x462d93['params']['id']}})[_0x55e0('0x27')](handleEntityNotFound(_0x33628d,null))[_0x55e0('0x27')](removeEntity(_0x33628d,null))[_0x55e0('0x4b')](handleError(_0x33628d,null));};exports['download']=function(_0x5d61c4,_0x46786c,_0x585536){return db[_0x55e0('0x30')][_0x55e0('0x52')]({'where':{'id':_0x5d61c4['params']['id']},'attributes':[_0x55e0('0x2c'),'basename','savename',_0x55e0('0x57')],'raw':!![]})[_0x55e0('0x27')](handleEntityNotFound(_0x46786c,null))['then'](function(_0x2e9a66){if(_0x2e9a66){if(!fs[_0x55e0('0x58')](path['join'](config[_0x55e0('0x59')],_0x55e0('0x5a'),_0x2e9a66[_0x55e0('0x5b')]))){throw new db['Sequelize'][(_0x55e0('0x5c'))](_0x55e0('0x5d'));}if(_0x5d61c4[_0x55e0('0x35')][_0x55e0('0x5e')]){return _0x46786c[_0x55e0('0x1a')](0xc8);}return _0x46786c['download'](path[_0x55e0('0x5f')](config[_0x55e0('0x59')],_0x55e0('0x5a'),_0x2e9a66[_0x55e0('0x5b')]),util[_0x55e0('0x60')]('%s.%s',_0x2e9a66[_0x55e0('0x61')]||_0x2e9a66[_0x55e0('0x2c')],_0x2e9a66[_0x55e0('0x57')][_0x55e0('0x62')]()));}})[_0x55e0('0x4b')](handleError(_0x46786c,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7a4c288..9cb4c17 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 _0xd667=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x388623,_0x434999){var _0x561016=function(_0x2c251d){while(--_0x2c251d){_0x388623['push'](_0x388623['shift']());}};_0x561016(++_0x434999);}(_0xd667,0xad));var _0x7d66=function(_0x16e335,_0x22c37a){_0x16e335=_0x16e335-0x0;var _0x175f71=_0xd667[_0x16e335];return _0x175f71;};'use strict';var _=require(_0x7d66('0x0'));var util=require(_0x7d66('0x1'));var logger=require(_0x7d66('0x2'))(_0x7d66('0x3'));var moment=require(_0x7d66('0x4'));var BPromise=require(_0x7d66('0x5'));var rp=require(_0x7d66('0x6'));var fs=require('fs');var path=require(_0x7d66('0x7'));var rimraf=require(_0x7d66('0x8'));var config=require(_0x7d66('0x9'));var attributes=require(_0x7d66('0xa'));module[_0x7d66('0xb')]=function(_0x4cba31,_0x434591){return _0x4cba31[_0x7d66('0xc')](_0x7d66('0xd'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e59=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','../../config/logger','api','request-promise'];(function(_0x1a14de,_0x1d0ecc){var _0x35950b=function(_0x149a49){while(--_0x149a49){_0x1a14de['push'](_0x1a14de['shift']());}};_0x35950b(++_0x1d0ecc);}(_0x1e59,0x138));var _0x91e5=function(_0x396a16,_0x533ac8){_0x396a16=_0x396a16-0x0;var _0x186651=_0x1e59[_0x396a16];return _0x186651;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x91e5('0x0'))(_0x91e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x91e5('0x2'));var fs=require('fs');var path=require(_0x91e5('0x3'));var rimraf=require(_0x91e5('0x4'));var config=require(_0x91e5('0x5'));var attributes=require(_0x91e5('0x6'));module[_0x91e5('0x7')]=function(_0x5e58e3,_0x45e9cb){return _0x5e58e3[_0x91e5('0x8')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 40d8015..4ad5426 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 _0x5dc7=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x126af7,_0x25fa06){var _0x25b500=function(_0x10ffe7){while(--_0x10ffe7){_0x126af7['push'](_0x126af7['shift']());}};_0x25b500(++_0x25fa06);}(_0x5dc7,0x148));var _0x75dc=function(_0x1d37f5,_0x4e4ba4){_0x1d37f5=_0x1d37f5-0x0;var _0x43e3bf=_0x5dc7[_0x1d37f5];return _0x43e3bf;};'use strict';var _=require(_0x75dc('0x0'));var util=require(_0x75dc('0x1'));var moment=require('moment');var BPromise=require(_0x75dc('0x2'));var rs=require(_0x75dc('0x3'));var fs=require('fs');var Redis=require(_0x75dc('0x4'));var db=require(_0x75dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x75dc('0x6'));var config=require(_0x75dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x75dc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8196a0,_0x335263,_0x24f85d){return new BPromise(function(_0x2d951e,_0x1d17ee){return client[_0x75dc('0x9')](_0x8196a0,_0x24f85d)['then'](function(_0x5ef7c8){logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,'request\x20sent');logger[_0x75dc('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x335263,_0x75dc('0xd'),JSON[_0x75dc('0xe')](_0x5ef7c8));if(_0x5ef7c8[_0x75dc('0xf')]){if(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x10')]===0x1f4){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x1d17ee(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}logger[_0x75dc('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x335263,_0x5ef7c8[_0x75dc('0xf')]['message']);return _0x2d951e(_0x5ef7c8[_0x75dc('0xf')][_0x75dc('0x11')]);}else{logger[_0x75dc('0xa')](_0x75dc('0xb'),_0x335263,_0x75dc('0xd'));_0x2d951e(_0x5ef7c8[_0x75dc('0x12')][_0x75dc('0x11')]);}})[_0x75dc('0x13')](function(_0xd68462){logger[_0x75dc('0xf')](_0x75dc('0xb'),_0x335263,_0xd68462);_0x1d17ee(_0xd68462);});});} \ No newline at end of file +var _0x5e63=['jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2649cc,_0x4ade0c){var _0x568f3c=function(_0x1de73e){while(--_0x1de73e){_0x2649cc['push'](_0x2649cc['shift']());}};_0x568f3c(++_0x4ade0c);}(_0x5e63,0xb4));var _0x35e6=function(_0x13834a,_0x4b6d38){_0x13834a=_0x13834a-0x0;var _0x20050c=_0x5e63[_0x13834a];return _0x20050c;};'use strict';var _=require(_0x35e6('0x0'));var util=require(_0x35e6('0x1'));var moment=require(_0x35e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x35e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35e6('0x4'))['db'];var utils=require(_0x35e6('0x5'));var logger=require(_0x35e6('0x6'))(_0x35e6('0x7'));var config=require(_0x35e6('0x8'));var jayson=require(_0x35e6('0x9'));var client=jayson[_0x35e6('0xa')][_0x35e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x513285,_0x2eb859,_0x398fb2){return new BPromise(function(_0x4bc395,_0x523c2a){return client[_0x35e6('0xc')](_0x513285,_0x398fb2)['then'](function(_0xf0cd43){logger['info'](_0x35e6('0xd'),_0x2eb859,'request\x20sent');logger[_0x35e6('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2eb859,_0x35e6('0xf'),JSON['stringify'](_0xf0cd43));if(_0xf0cd43[_0x35e6('0x10')]){if(_0xf0cd43['error']['code']===0x1f4){logger[_0x35e6('0x10')](_0x35e6('0xd'),_0x2eb859,_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);return _0x523c2a(_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);}logger['error'](_0x35e6('0xd'),_0x2eb859,_0xf0cd43['error'][_0x35e6('0x11')]);return _0x4bc395(_0xf0cd43[_0x35e6('0x10')][_0x35e6('0x11')]);}else{logger[_0x35e6('0x12')](_0x35e6('0xd'),_0x2eb859,_0x35e6('0xf'));_0x4bc395(_0xf0cd43[_0x35e6('0x13')]['message']);}})[_0x35e6('0x14')](function(_0xea9e94){logger[_0x35e6('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2eb859,_0xea9e94);_0x523c2a(_0xea9e94);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 93de872..c2979a4 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 _0x599f=['delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','put','update'];(function(_0x232641,_0x302efe){var _0x163463=function(_0x9b5e5a){while(--_0x9b5e5a){_0x232641['push'](_0x232641['shift']());}};_0x163463(++_0x302efe);}(_0x599f,0x18d));var _0xf599=function(_0x3482d1,_0x44ddc4){_0x3482d1=_0x3482d1-0x0;var _0xc69fce=_0x599f[_0x3482d1];return _0xc69fce;};'use strict';var multer=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var path=require(_0xf599('0x2'));var timeout=require(_0xf599('0x3'));var express=require(_0xf599('0x4'));var router=express['Router']();var fs_extra=require(_0xf599('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf599('0x6'));var config=require('../../config/environment');var controller=require(_0xf599('0x7'));router[_0xf599('0x8')]('/',auth[_0xf599('0x9')](),controller[_0xf599('0xa')]);router[_0xf599('0x8')](_0xf599('0xb'),auth[_0xf599('0x9')](),controller[_0xf599('0xc')]);router['get']('/:id/download',auth[_0xf599('0x9')](),controller[_0xf599('0xd')]);router[_0xf599('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf599('0xf')](_0xf599('0xb'),auth[_0xf599('0x9')](),controller[_0xf599('0x10')]);router[_0xf599('0x11')](_0xf599('0xb'),auth[_0xf599('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb72f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id/download','download','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x19258b,_0x22e850){var _0x5be66a=function(_0x24e321){while(--_0x24e321){_0x19258b['push'](_0x19258b['shift']());}};_0x5be66a(++_0x22e850);}(_0xb72f,0xf7));var _0xfb72=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xb72f[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0xfb72('0x0'));var util=require(_0xfb72('0x1'));var path=require('path');var timeout=require(_0xfb72('0x2'));var express=require(_0xfb72('0x3'));var router=express[_0xfb72('0x4')]();var fs_extra=require(_0xfb72('0x5'));var auth=require(_0xfb72('0x6'));var interaction=require(_0xfb72('0x7'));var config=require(_0xfb72('0x8'));var controller=require(_0xfb72('0x9'));router[_0xfb72('0xa')]('/',auth[_0xfb72('0xb')](),controller[_0xfb72('0xc')]);router[_0xfb72('0xa')]('/:id',auth[_0xfb72('0xb')](),controller['show']);router[_0xfb72('0xa')](_0xfb72('0xd'),auth[_0xfb72('0xb')](),controller[_0xfb72('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfb72('0xf')]);router['put']('/:id',auth[_0xfb72('0xb')](),controller[_0xfb72('0x10')]);router[_0xfb72('0x11')](_0xfb72('0x12'),auth[_0xfb72('0xb')](),controller[_0xfb72('0x13')]);module[_0xfb72('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9b2507f..a24ff88 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 _0xce59=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x5d6a50,_0x25f46c){var _0x16dd94=function(_0x192d82){while(--_0x192d82){_0x5d6a50['push'](_0x5d6a50['shift']());}};_0x16dd94(++_0x25f46c);}(_0xce59,0xbd));var _0x9ce5=function(_0x470a31,_0x5d9949){_0x470a31=_0x470a31-0x0;var _0x4d9380=_0xce59[_0x470a31];return _0x4d9380;};'use strict';var Sequelize=require(_0x9ce5('0x0'));module[_0x9ce5('0x1')]={'field':{'type':Sequelize[_0x9ce5('0x2')]},'alias':{'type':Sequelize[_0x9ce5('0x3')]},'function':{'type':Sequelize[_0x9ce5('0x3')]},'format':{'type':Sequelize[_0x9ce5('0x3')]},'groupBy':{'type':Sequelize[_0x9ce5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9ce5('0x3')]},'custom':{'type':Sequelize[_0x9ce5('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8750=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3997e3,_0x2a80df){var _0xaee5f1=function(_0x4f895f){while(--_0x4f895f){_0x3997e3['push'](_0x3997e3['shift']());}};_0xaee5f1(++_0x2a80df);}(_0x8750,0x80));var _0x0875=function(_0x26724c,_0x52eeec){_0x26724c=_0x26724c-0x0;var _0x1fb895=_0x8750[_0x26724c];return _0x1fb895;};'use strict';var Sequelize=require(_0x0875('0x0'));module[_0x0875('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0875('0x2')]},'function':{'type':Sequelize[_0x0875('0x2')]},'format':{'type':Sequelize[_0x0875('0x2')]},'groupBy':{'type':Sequelize[_0x0875('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0875('0x2')]},'custom':{'type':Sequelize[_0x0875('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 56a5538..cfacef1 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 _0xbabe=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','body','find','destroy','bulkDestroy','ids','addFields','findOne','sequelize','transaction','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x22a668,_0x5241fb){var _0x52e0a3=function(_0x35b604){while(--_0x35b604){_0x22a668['push'](_0x22a668['shift']());}};_0x52e0a3(++_0x5241fb);}(_0xbabe,0x186));var _0xebab=function(_0x5a204f,_0x1952af){_0x5a204f=_0x5a204f-0x0;var _0x95b441=_0xbabe[_0x5a204f];return _0x95b441;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebab('0x0'));var jsonpatch=require(_0xebab('0x1'));var rp=require(_0xebab('0x2'));var moment=require(_0xebab('0x3'));var BPromise=require(_0xebab('0x4'));var Mustache=require(_0xebab('0x5'));var util=require(_0xebab('0x6'));var path=require(_0xebab('0x7'));var sox=require(_0xebab('0x8'));var csv=require('to-csv');var ejs=require(_0xebab('0x9'));var fs=require('fs');var fs_extra=require(_0xebab('0xa'));var _=require(_0xebab('0xb'));var squel=require(_0xebab('0xc'));var crypto=require('crypto');var jsforce=require(_0xebab('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xebab('0xe'));var querystring=require(_0xebab('0xf'));var Papa=require('papaparse');var Redis=require(_0xebab('0x10'));var authService=require(_0xebab('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xebab('0x12'));var logger=require('../../config/logger')(_0xebab('0x13'));var utils=require(_0xebab('0x14'));var config=require(_0xebab('0x15'));var licenseUtil=require(_0xebab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59eadb,_0x3cad78){_0x3cad78=_0x3cad78||0xcc;return function(_0x3cdf92){if(_0x3cdf92){return _0x59eadb[_0xebab('0x17')](_0x3cad78);}return _0x59eadb[_0xebab('0x18')](_0x3cad78)[_0xebab('0x19')]();};}function respondWithResult(_0x4d9bcf,_0xce5333){_0xce5333=_0xce5333||0xc8;return function(_0x35b9e4){if(_0x35b9e4){return _0x4d9bcf[_0xebab('0x18')](_0xce5333)['json'](_0x35b9e4);}};}function respondWithFilteredResult(_0x2533ae,_0xbfc726){return function(_0x1d6b28){if(_0x1d6b28){var _0xa331a4=typeof _0xbfc726[_0xebab('0x1a')]===_0xebab('0x1b')&&typeof _0xbfc726['limit']===_0xebab('0x1b');var _0x37eb9c=_0x1d6b28['count'];var _0x4268f2=_0xa331a4?0x0:_0xbfc726[_0xebab('0x1a')];var _0x3e03e5=_0xa331a4?_0x1d6b28[_0xebab('0x1c')]:_0xbfc726[_0xebab('0x1a')]+_0xbfc726[_0xebab('0x1d')];var _0x937ae9;if(_0x3e03e5>=_0x37eb9c){_0x3e03e5=_0x37eb9c;_0x937ae9=0xc8;}else{_0x937ae9=0xce;}_0x2533ae['status'](_0x937ae9);return _0x2533ae['set'](_0xebab('0x1e'),_0x4268f2+'-'+_0x3e03e5+'/'+_0x37eb9c)[_0xebab('0x1f')](_0x1d6b28);}return null;};}function patchUpdates(_0x126edf){return function(_0x34f511){try{jsonpatch[_0xebab('0x20')](_0x34f511,_0x126edf,!![]);}catch(_0x59212c){return BPromise[_0xebab('0x21')](_0x59212c);}return _0x34f511[_0xebab('0x22')]();};}function saveUpdates(_0x1771cd,_0x24d86e){return function(_0x2091ce){if(_0x2091ce){return _0x2091ce[_0xebab('0x23')](_0x1771cd)[_0xebab('0x24')](function(_0xa0b200){return _0xa0b200;});}return null;};}function removeEntity(_0x492147,_0xb6c709){return function(_0x531c63){if(_0x531c63){return _0x531c63['destroy']()[_0xebab('0x24')](function(){_0x492147['status'](0xcc)[_0xebab('0x19')]();});}};}function handleEntityNotFound(_0x1eed1a,_0x45f010){return function(_0x51df87){if(!_0x51df87){_0x1eed1a[_0xebab('0x17')](0x194);}return _0x51df87;};}function handleError(_0x3559a6,_0x1e1bc2){_0x1e1bc2=_0x1e1bc2||0x1f4;return function(_0xbcbe32){logger[_0xebab('0x25')](_0xbcbe32[_0xebab('0x26')]);if(_0xbcbe32[_0xebab('0x27')]){delete _0xbcbe32[_0xebab('0x27')];}_0x3559a6[_0xebab('0x18')](_0x1e1bc2)['send'](_0xbcbe32);};}exports[_0xebab('0x28')]=function(_0x144b70,_0x482324){var _0x3e3388={},_0x152a29={},_0x224c5b={'count':0x0,'rows':[]};var _0x1a9b3c=_['map'](db[_0xebab('0x29')][_0xebab('0x2a')],function(_0x1684f4){return{'name':_0x1684f4[_0xebab('0x2b')],'type':_0x1684f4[_0xebab('0x2c')]['key']};});_0x152a29[_0xebab('0x2d')]=_['map'](_0x1a9b3c,_0xebab('0x27'));_0x152a29[_0xebab('0x2e')]=_['keys'](_0x144b70[_0xebab('0x2e')]);_0x152a29[_0xebab('0x2f')]=_[_0xebab('0x30')](_0x152a29[_0xebab('0x2d')],_0x152a29[_0xebab('0x2e')]);_0x3e3388[_0xebab('0x31')]=_[_0xebab('0x30')](_0x152a29['model'],qs['fields'](_0x144b70[_0xebab('0x2e')]['fields']));_0x3e3388[_0xebab('0x31')]=_0x3e3388[_0xebab('0x31')][_0xebab('0x32')]?_0x3e3388[_0xebab('0x31')]:_0x152a29[_0xebab('0x2d')];if(!_0x144b70[_0xebab('0x2e')][_0xebab('0x33')](_0xebab('0x34'))){_0x3e3388[_0xebab('0x1d')]=qs[_0xebab('0x1d')](_0x144b70[_0xebab('0x2e')][_0xebab('0x1d')]);_0x3e3388[_0xebab('0x1a')]=qs[_0xebab('0x1a')](_0x144b70[_0xebab('0x2e')]['offset']);}_0x3e3388[_0xebab('0x35')]=qs[_0xebab('0x36')](_0x144b70[_0xebab('0x2e')][_0xebab('0x36')]);_0x3e3388['where']=qs['filters'](_[_0xebab('0x37')](_0x144b70['query'],_0x152a29['filters']),_0x1a9b3c);if(_0x144b70[_0xebab('0x2e')][_0xebab('0x38')]){_0x3e3388[_0xebab('0x39')]=_[_0xebab('0x3a')](_0x3e3388['where'],{'$or':_[_0xebab('0x3b')](_0x1a9b3c,function(_0x25a505){if(_0x25a505[_0xebab('0x2c')]!==_0xebab('0x3c')){var _0x28e798={};_0x28e798[_0x25a505['name']]={'$like':'%'+_0x144b70[_0xebab('0x2e')][_0xebab('0x38')]+'%'};return _0x28e798;}})});}_0x3e3388=_['merge']({},_0x3e3388,_0x144b70['options']);var _0x1ce96a={'where':_0x3e3388[_0xebab('0x39')]};return db[_0xebab('0x29')][_0xebab('0x1c')](_0x1ce96a)[_0xebab('0x24')](function(_0x22e6b1){_0x224c5b['count']=_0x22e6b1;if(_0x144b70[_0xebab('0x2e')][_0xebab('0x3d')]){_0x3e3388[_0xebab('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xebab('0x3f')](_0x3e3388);})[_0xebab('0x24')](function(_0x17f7d0){_0x224c5b[_0xebab('0x40')]=_0x17f7d0;return _0x224c5b;})[_0xebab('0x24')](respondWithFilteredResult(_0x482324,_0x3e3388))[_0xebab('0x41')](handleError(_0x482324,null));};exports[_0xebab('0x42')]=function(_0x27af7e,_0x4a075f){var _0x378109={'raw':![],'where':{'id':_0x27af7e[_0xebab('0x43')]['id']}},_0x4543a1={};_0x4543a1[_0xebab('0x2d')]=_[_0xebab('0x44')](db[_0xebab('0x29')][_0xebab('0x2a')]);_0x4543a1['query']=_[_0xebab('0x44')](_0x27af7e[_0xebab('0x2e')]);_0x4543a1[_0xebab('0x2f')]=_[_0xebab('0x30')](_0x4543a1['model'],_0x4543a1[_0xebab('0x2e')]);_0x378109[_0xebab('0x31')]=_['intersection'](_0x4543a1['model'],qs[_0xebab('0x45')](_0x27af7e[_0xebab('0x2e')][_0xebab('0x45')]));_0x378109[_0xebab('0x31')]=_0x378109[_0xebab('0x31')]['length']?_0x378109[_0xebab('0x31')]:_0x4543a1['model'];if(_0x27af7e['query'][_0xebab('0x3d')]){_0x378109[_0xebab('0x3e')]=[{'all':!![]}];}_0x378109=_['merge']({},_0x378109,_0x27af7e['options']);return db[_0xebab('0x29')]['find'](_0x378109)[_0xebab('0x24')](handleEntityNotFound(_0x4a075f,null))['then'](respondWithResult(_0x4a075f,null))['catch'](handleError(_0x4a075f,null));};exports['create']=function(_0x3c6b0a,_0x5ee330){return db['AnalyticFieldReport']['create'](_0x3c6b0a['body'],{})[_0xebab('0x24')](respondWithResult(_0x5ee330,0xc9))[_0xebab('0x41')](handleError(_0x5ee330,null));};exports['bulkCreate']=function(_0x25dd27,_0xdbd335){return db[_0xebab('0x29')]['bulkCreate'](_0x25dd27['body'],{'raw':![],'individualHooks':!![]})[_0xebab('0x24')](respondWithResult(_0xdbd335,0xc9))[_0xebab('0x41')](handleError(_0xdbd335,null));};exports[_0xebab('0x23')]=function(_0x524f68,_0x75805e){if(_0x524f68['body']['id']){delete _0x524f68[_0xebab('0x46')]['id'];}return db['AnalyticFieldReport'][_0xebab('0x47')]({'where':{'id':_0x524f68[_0xebab('0x43')]['id']}})['then'](handleEntityNotFound(_0x75805e,null))[_0xebab('0x24')](saveUpdates(_0x524f68[_0xebab('0x46')],null))[_0xebab('0x24')](respondWithResult(_0x75805e,null))[_0xebab('0x41')](handleError(_0x75805e,null));};exports[_0xebab('0x48')]=function(_0x42915e,_0x4668c6){return db['AnalyticFieldReport'][_0xebab('0x47')]({'where':{'id':_0x42915e[_0xebab('0x43')]['id']}})[_0xebab('0x24')](handleEntityNotFound(_0x4668c6,null))[_0xebab('0x24')](removeEntity(_0x4668c6,null))['catch'](handleError(_0x4668c6,null));};exports[_0xebab('0x49')]=function(_0x2c5c9c,_0x3389d9){return db[_0xebab('0x29')][_0xebab('0x48')]({'where':{'id':_0x2c5c9c['query'][_0xebab('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xebab('0x24')](respondWithResult(_0x3389d9,0xcc))[_0xebab('0x41')](handleError(_0x3389d9,null));};exports[_0xebab('0x4b')]=function(_0x4febf6,_0x22dd55,_0x2b5f96){return db['AnalyticCustomReport'][_0xebab('0x4c')]({'where':{'id':_0x4febf6[_0xebab('0x43')]['id']}})['then'](handleEntityNotFound(_0x22dd55,null))['then'](function(_0x5e8c97){if(_0x5e8c97){return db[_0xebab('0x4d')][_0xebab('0x4e')](function(_0x51022b){return db[_0xebab('0x29')][_0xebab('0x48')]({'where':{'CustomReportId':_0x4febf6['params']['id']},'transaction':_0x51022b})['then'](function(_0xc8104){var _0x2aea81=_[_0xebab('0x3b')](_0x4febf6[_0xebab('0x46')],function(_0x298283){delete _0x298283['id'];_0x298283['CustomReportId']=_0x4febf6[_0xebab('0x43')]['id'];return _0x298283;});return db[_0xebab('0x29')]['bulkCreate'](_0x2aea81,{'transaction':_0x51022b});});})['then'](function(){return db[_0xebab('0x29')][_0xebab('0x3f')]({'where':{'CustomReportId':_0x4febf6[_0xebab('0x43')]['id']}});});}})[_0xebab('0x24')](respondWithResult(_0x22dd55,null))[_0xebab('0x41')](handleError(_0x22dd55,null));}; \ No newline at end of file +var _0x8498=['type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','bulkCreate','body','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8498,0x70));var _0x8849=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x8498[_0x45346d];return _0x5ce7ca;};'use strict';var emlformat=require(_0x8849('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8849('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8849('0x2'));var moment=require(_0x8849('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8849('0x4'));var path=require(_0x8849('0x5'));var sox=require(_0x8849('0x6'));var csv=require(_0x8849('0x7'));var ejs=require(_0x8849('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8849('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8849('0xa'));var toCsv=require(_0x8849('0x7'));var querystring=require(_0x8849('0xb'));var Papa=require('papaparse');var Redis=require(_0x8849('0xc'));var authService=require(_0x8849('0xd'));var qs=require(_0x8849('0xe'));var as=require(_0x8849('0xf'));var hardwareService=require(_0x8849('0x10'));var logger=require('../../config/logger')(_0x8849('0x11'));var utils=require(_0x8849('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8849('0x13'))['db'];function respondWithStatusCode(_0x112225,_0x323c73){_0x323c73=_0x323c73||0xcc;return function(_0x56aa30){if(_0x56aa30){return _0x112225['sendStatus'](_0x323c73);}return _0x112225[_0x8849('0x14')](_0x323c73)['end']();};}function respondWithResult(_0x4e297a,_0x4e16c7){_0x4e16c7=_0x4e16c7||0xc8;return function(_0x1e3428){if(_0x1e3428){return _0x4e297a[_0x8849('0x14')](_0x4e16c7)[_0x8849('0x15')](_0x1e3428);}};}function respondWithFilteredResult(_0x15e79b,_0x4bfe95){return function(_0x58a136){if(_0x58a136){var _0x1334b=typeof _0x4bfe95['offset']===_0x8849('0x16')&&typeof _0x4bfe95[_0x8849('0x17')]===_0x8849('0x16');var _0x1dfd7c=_0x58a136[_0x8849('0x18')];var _0x43125a=_0x1334b?0x0:_0x4bfe95[_0x8849('0x19')];var _0x2b140a=_0x1334b?_0x58a136[_0x8849('0x18')]:_0x4bfe95[_0x8849('0x19')]+_0x4bfe95[_0x8849('0x17')];var _0xed6d13;if(_0x2b140a>=_0x1dfd7c){_0x2b140a=_0x1dfd7c;_0xed6d13=0xc8;}else{_0xed6d13=0xce;}_0x15e79b[_0x8849('0x14')](_0xed6d13);return _0x15e79b[_0x8849('0x1a')](_0x8849('0x1b'),_0x43125a+'-'+_0x2b140a+'/'+_0x1dfd7c)[_0x8849('0x15')](_0x58a136);}return null;};}function patchUpdates(_0x4e79f2){return function(_0x593c68){try{jsonpatch[_0x8849('0x1c')](_0x593c68,_0x4e79f2,!![]);}catch(_0xe6bfd9){return BPromise[_0x8849('0x1d')](_0xe6bfd9);}return _0x593c68[_0x8849('0x1e')]();};}function saveUpdates(_0x51d5e3,_0x738b05){return function(_0xbb345e){if(_0xbb345e){return _0xbb345e[_0x8849('0x1f')](_0x51d5e3)[_0x8849('0x20')](function(_0x778b3a){return _0x778b3a;});}return null;};}function removeEntity(_0x2fed2c,_0x440b2b){return function(_0x53df74){if(_0x53df74){return _0x53df74[_0x8849('0x21')]()[_0x8849('0x20')](function(){_0x2fed2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e135,_0x2dd324){return function(_0x458490){if(!_0x458490){_0x10e135[_0x8849('0x22')](0x194);}return _0x458490;};}function handleError(_0x2b4f73,_0x556374){_0x556374=_0x556374||0x1f4;return function(_0x529fdc){logger[_0x8849('0x23')](_0x529fdc[_0x8849('0x24')]);if(_0x529fdc[_0x8849('0x25')]){delete _0x529fdc[_0x8849('0x25')];}_0x2b4f73[_0x8849('0x14')](_0x556374)[_0x8849('0x26')](_0x529fdc);};}exports[_0x8849('0x27')]=function(_0x38867c,_0x51733c){var _0xe87f17={},_0x109fc8={},_0x12a940={'count':0x0,'rows':[]};var _0x2a6584=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x5b6256){return{'name':_0x5b6256['fieldName'],'type':_0x5b6256[_0x8849('0x28')]['key']};});_0x109fc8[_0x8849('0x29')]=_[_0x8849('0x2a')](_0x2a6584,_0x8849('0x25'));_0x109fc8['query']=_['keys'](_0x38867c[_0x8849('0x2b')]);_0x109fc8[_0x8849('0x2c')]=_[_0x8849('0x2d')](_0x109fc8[_0x8849('0x29')],_0x109fc8[_0x8849('0x2b')]);_0xe87f17[_0x8849('0x2e')]=_[_0x8849('0x2d')](_0x109fc8[_0x8849('0x29')],qs['fields'](_0x38867c['query'][_0x8849('0x2f')]));_0xe87f17[_0x8849('0x2e')]=_0xe87f17['attributes'][_0x8849('0x30')]?_0xe87f17[_0x8849('0x2e')]:_0x109fc8[_0x8849('0x29')];if(!_0x38867c[_0x8849('0x2b')][_0x8849('0x31')](_0x8849('0x32'))){_0xe87f17[_0x8849('0x17')]=qs[_0x8849('0x17')](_0x38867c['query']['limit']);_0xe87f17[_0x8849('0x19')]=qs[_0x8849('0x19')](_0x38867c[_0x8849('0x2b')]['offset']);}_0xe87f17[_0x8849('0x33')]=qs[_0x8849('0x34')](_0x38867c[_0x8849('0x2b')][_0x8849('0x34')]);_0xe87f17[_0x8849('0x35')]=qs[_0x8849('0x2c')](_[_0x8849('0x36')](_0x38867c[_0x8849('0x2b')],_0x109fc8[_0x8849('0x2c')]),_0x2a6584);if(_0x38867c['query'][_0x8849('0x37')]){_0xe87f17['where']=_[_0x8849('0x38')](_0xe87f17[_0x8849('0x35')],{'$or':_[_0x8849('0x2a')](_0x2a6584,function(_0x235ade){if(_0x235ade[_0x8849('0x28')]!=='VIRTUAL'){var _0x4e97e8={};_0x4e97e8[_0x235ade[_0x8849('0x25')]]={'$like':'%'+_0x38867c[_0x8849('0x2b')][_0x8849('0x37')]+'%'};return _0x4e97e8;}})});}_0xe87f17=_[_0x8849('0x38')]({},_0xe87f17,_0x38867c[_0x8849('0x39')]);var _0x35bcc5={'where':_0xe87f17[_0x8849('0x35')]};return db[_0x8849('0x3a')][_0x8849('0x18')](_0x35bcc5)[_0x8849('0x20')](function(_0x4e2306){_0x12a940['count']=_0x4e2306;if(_0x38867c[_0x8849('0x2b')][_0x8849('0x3b')]){_0xe87f17['include']=[{'all':!![]}];}return db[_0x8849('0x3a')][_0x8849('0x3c')](_0xe87f17);})[_0x8849('0x20')](function(_0x57bcfa){_0x12a940[_0x8849('0x3d')]=_0x57bcfa;return _0x12a940;})[_0x8849('0x20')](respondWithFilteredResult(_0x51733c,_0xe87f17))[_0x8849('0x3e')](handleError(_0x51733c,null));};exports[_0x8849('0x3f')]=function(_0x1aa397,_0x42d742){var _0x448e82={'raw':![],'where':{'id':_0x1aa397[_0x8849('0x40')]['id']}},_0x558927={};_0x558927[_0x8849('0x29')]=_[_0x8849('0x41')](db[_0x8849('0x3a')]['rawAttributes']);_0x558927[_0x8849('0x2b')]=_[_0x8849('0x41')](_0x1aa397[_0x8849('0x2b')]);_0x558927[_0x8849('0x2c')]=_[_0x8849('0x2d')](_0x558927['model'],_0x558927['query']);_0x448e82[_0x8849('0x2e')]=_[_0x8849('0x2d')](_0x558927[_0x8849('0x29')],qs[_0x8849('0x2f')](_0x1aa397[_0x8849('0x2b')][_0x8849('0x2f')]));_0x448e82[_0x8849('0x2e')]=_0x448e82['attributes'][_0x8849('0x30')]?_0x448e82[_0x8849('0x2e')]:_0x558927[_0x8849('0x29')];if(_0x1aa397[_0x8849('0x2b')][_0x8849('0x3b')]){_0x448e82[_0x8849('0x42')]=[{'all':!![]}];}_0x448e82=_[_0x8849('0x38')]({},_0x448e82,_0x1aa397['options']);return db[_0x8849('0x3a')][_0x8849('0x43')](_0x448e82)[_0x8849('0x20')](handleEntityNotFound(_0x42d742,null))[_0x8849('0x20')](respondWithResult(_0x42d742,null))[_0x8849('0x3e')](handleError(_0x42d742,null));};exports[_0x8849('0x44')]=function(_0x19bf96,_0x5ef796){return db[_0x8849('0x3a')][_0x8849('0x44')](_0x19bf96['body'],{})[_0x8849('0x20')](respondWithResult(_0x5ef796,0xc9))[_0x8849('0x3e')](handleError(_0x5ef796,null));};exports['bulkCreate']=function(_0x1e1650,_0x50df08){return db[_0x8849('0x3a')][_0x8849('0x45')](_0x1e1650[_0x8849('0x46')],{'raw':![],'individualHooks':!![]})[_0x8849('0x20')](respondWithResult(_0x50df08,0xc9))[_0x8849('0x3e')](handleError(_0x50df08,null));};exports[_0x8849('0x1f')]=function(_0x1de4a3,_0x45ec8e){if(_0x1de4a3[_0x8849('0x46')]['id']){delete _0x1de4a3[_0x8849('0x46')]['id'];}return db[_0x8849('0x3a')][_0x8849('0x43')]({'where':{'id':_0x1de4a3[_0x8849('0x40')]['id']}})[_0x8849('0x20')](handleEntityNotFound(_0x45ec8e,null))[_0x8849('0x20')](saveUpdates(_0x1de4a3[_0x8849('0x46')],null))[_0x8849('0x20')](respondWithResult(_0x45ec8e,null))['catch'](handleError(_0x45ec8e,null));};exports[_0x8849('0x21')]=function(_0xe6e46b,_0x1b9426){return db['AnalyticFieldReport'][_0x8849('0x43')]({'where':{'id':_0xe6e46b[_0x8849('0x40')]['id']}})[_0x8849('0x20')](handleEntityNotFound(_0x1b9426,null))[_0x8849('0x20')](removeEntity(_0x1b9426,null))[_0x8849('0x3e')](handleError(_0x1b9426,null));};exports['bulkDestroy']=function(_0x209d6c,_0x9b8c38){return db[_0x8849('0x3a')]['destroy']({'where':{'id':_0x209d6c[_0x8849('0x2b')][_0x8849('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x9b8c38,0xcc))[_0x8849('0x3e')](handleError(_0x9b8c38,null));};exports[_0x8849('0x48')]=function(_0x2f81af,_0x100167,_0x1dee5b){return db[_0x8849('0x49')][_0x8849('0x4a')]({'where':{'id':_0x2f81af[_0x8849('0x40')]['id']}})[_0x8849('0x20')](handleEntityNotFound(_0x100167,null))[_0x8849('0x20')](function(_0x2503c5){if(_0x2503c5){return db['sequelize']['transaction'](function(_0x226895){return db[_0x8849('0x3a')][_0x8849('0x21')]({'where':{'CustomReportId':_0x2f81af['params']['id']},'transaction':_0x226895})[_0x8849('0x20')](function(_0x35a4db){var _0x5a9f11=_[_0x8849('0x2a')](_0x2f81af['body'],function(_0x44bf53){delete _0x44bf53['id'];_0x44bf53[_0x8849('0x4b')]=_0x2f81af[_0x8849('0x40')]['id'];return _0x44bf53;});return db['AnalyticFieldReport']['bulkCreate'](_0x5a9f11,{'transaction':_0x226895});});})['then'](function(){return db['AnalyticFieldReport'][_0x8849('0x3c')]({'where':{'CustomReportId':_0x2f81af[_0x8849('0x40')]['id']}});});}})['then'](respondWithResult(_0x100167,null))['catch'](handleError(_0x100167,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index e1832ec..bd72685 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 _0xaa7a=['bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment'];(function(_0x302f83,_0x36ccfb){var _0x5ed9f2=function(_0x2eb409){while(--_0x2eb409){_0x302f83['push'](_0x302f83['shift']());}};_0x5ed9f2(++_0x36ccfb);}(_0xaa7a,0x129));var _0xaaa7=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xaa7a[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0xaaa7('0x0'));var logger=require(_0xaaa7('0x1'))('api');var moment=require(_0xaaa7('0x2'));var BPromise=require(_0xaaa7('0x3'));var rp=require(_0xaaa7('0x4'));var fs=require('fs');var path=require(_0xaaa7('0x5'));var rimraf=require('rimraf');var config=require(_0xaaa7('0x6'));var attributes=require(_0xaaa7('0x7'));module[_0xaaa7('0x8')]=function(_0x3f3c83,_0x2f7976){return _0x3f3c83[_0xaaa7('0x9')](_0xaaa7('0xa'),attributes,{'tableName':_0xaaa7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46e6=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x46e6,0x13a));var _0x646e=function(_0x5a9d90,_0x4cde08){_0x5a9d90=_0x5a9d90-0x0;var _0x1996b0=_0x46e6[_0x5a9d90];return _0x1996b0;};'use strict';var _=require(_0x646e('0x0'));var util=require(_0x646e('0x1'));var logger=require(_0x646e('0x2'))(_0x646e('0x3'));var moment=require('moment');var BPromise=require(_0x646e('0x4'));var rp=require(_0x646e('0x5'));var fs=require('fs');var path=require(_0x646e('0x6'));var rimraf=require('rimraf');var config=require(_0x646e('0x7'));var attributes=require(_0x646e('0x8'));module[_0x646e('0x9')]=function(_0x50cfa0,_0x580551){return _0x50cfa0[_0x646e('0xa')](_0x646e('0xb'),attributes,{'tableName':_0x646e('0xc'),'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 d1e99d0..afe006f 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 _0x81a8=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x81a8,0xd0));var _0x881a=function(_0xe36749,_0x2a45c8){_0xe36749=_0xe36749-0x0;var _0x5d86b7=_0x81a8[_0xe36749];return _0x5d86b7;};'use strict';var _=require(_0x881a('0x0'));var util=require('util');var moment=require(_0x881a('0x1'));var BPromise=require(_0x881a('0x2'));var rs=require(_0x881a('0x3'));var fs=require('fs');var Redis=require(_0x881a('0x4'));var db=require(_0x881a('0x5'))['db'];var utils=require(_0x881a('0x6'));var logger=require(_0x881a('0x7'))(_0x881a('0x8'));var config=require(_0x881a('0x9'));var jayson=require(_0x881a('0xa'));var client=jayson['client'][_0x881a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x126406,_0x47597b,_0x3c5b73){return new BPromise(function(_0x410420,_0x45d290){return client[_0x881a('0xc')](_0x126406,_0x3c5b73)['then'](function(_0x42b5ab){logger[_0x881a('0xd')](_0x881a('0xe'),_0x47597b,_0x881a('0xf'));logger[_0x881a('0x10')](_0x881a('0x11'),_0x47597b,_0x881a('0xf'),JSON[_0x881a('0x12')](_0x42b5ab));if(_0x42b5ab[_0x881a('0x13')]){if(_0x42b5ab[_0x881a('0x13')][_0x881a('0x14')]===0x1f4){logger[_0x881a('0x13')](_0x881a('0xe'),_0x47597b,_0x42b5ab['error'][_0x881a('0x15')]);return _0x45d290(_0x42b5ab['error'][_0x881a('0x15')]);}logger['error'](_0x881a('0xe'),_0x47597b,_0x42b5ab[_0x881a('0x13')][_0x881a('0x15')]);return _0x410420(_0x42b5ab['error'][_0x881a('0x15')]);}else{logger[_0x881a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x47597b,'request\x20sent');_0x410420(_0x42b5ab['result'][_0x881a('0x15')]);}})[_0x881a('0x16')](function(_0x408ecd){logger['error'](_0x881a('0xe'),_0x47597b,_0x408ecd);_0x45d290(_0x408ecd);});});} \ No newline at end of file +var _0x054c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x1a59ce,_0x32c23e){var _0x1cec28=function(_0x4f66a4){while(--_0x4f66a4){_0x1a59ce['push'](_0x1a59ce['shift']());}};_0x1cec28(++_0x32c23e);}(_0x054c,0x11c));var _0xc054=function(_0x511d4b,_0x66823b){_0x511d4b=_0x511d4b-0x0;var _0x2c2daa=_0x054c[_0x511d4b];return _0x2c2daa;};'use strict';var _=require(_0xc054('0x0'));var util=require(_0xc054('0x1'));var moment=require(_0xc054('0x2'));var BPromise=require(_0xc054('0x3'));var rs=require(_0xc054('0x4'));var fs=require('fs');var Redis=require(_0xc054('0x5'));var db=require(_0xc054('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc054('0x7'));var jayson=require(_0xc054('0x8'));var client=jayson[_0xc054('0x9')][_0xc054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a0e04,_0x262c02,_0x2e8688){return new BPromise(function(_0x15004c,_0x3e9fd6){return client[_0xc054('0xb')](_0x1a0e04,_0x2e8688)['then'](function(_0xf6fb4){logger[_0xc054('0xc')](_0xc054('0xd'),_0x262c02,_0xc054('0xe'));logger[_0xc054('0xf')](_0xc054('0x10'),_0x262c02,_0xc054('0xe'),JSON[_0xc054('0x11')](_0xf6fb4));if(_0xf6fb4[_0xc054('0x12')]){if(_0xf6fb4['error']['code']===0x1f4){logger[_0xc054('0x12')](_0xc054('0xd'),_0x262c02,_0xf6fb4['error'][_0xc054('0x13')]);return _0x3e9fd6(_0xf6fb4[_0xc054('0x12')][_0xc054('0x13')]);}logger[_0xc054('0x12')](_0xc054('0xd'),_0x262c02,_0xf6fb4[_0xc054('0x12')]['message']);return _0x15004c(_0xf6fb4[_0xc054('0x12')][_0xc054('0x13')]);}else{logger[_0xc054('0xc')](_0xc054('0xd'),_0x262c02,_0xc054('0xe'));_0x15004c(_0xf6fb4[_0xc054('0x14')][_0xc054('0x13')]);}})[_0xc054('0x15')](function(_0x578f65){logger[_0xc054('0x12')](_0xc054('0xd'),_0x262c02,_0x578f65);_0x3e9fd6(_0x578f65);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b396e58..49a6635 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xd5d215,_0x57a4fc){var _0x395055=function(_0x91b66e){while(--_0x91b66e){_0xd5d215['push'](_0xd5d215['shift']());}};_0x395055(++_0x57a4fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0xe6cb27,_0x560da6){var _0x542ae5=function(_0x5c457e){while(--_0x5c457e){_0xe6cb27['push'](_0xe6cb27['shift']());}};_0x542ae5(++_0x560da6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 0cef962..d7af096 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 _0x0427=['name','TEXT','STRING'];(function(_0x352d7a,_0x285bf4){var _0xf276b8=function(_0x405078){while(--_0x405078){_0x352d7a['push'](_0x352d7a['shift']());}};_0xf276b8(++_0x285bf4);}(_0x0427,0x137));var _0x7042=function(_0x4fdeaa,_0x102ab6){_0x4fdeaa=_0x4fdeaa-0x0;var _0x3072ee=_0x0427[_0x4fdeaa];return _0x3072ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7042('0x0')],'allowNull':![],'unique':_0x7042('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7042('0x2')]},'description':{'type':Sequelize[_0x7042('0x0')]}}; \ No newline at end of file +var _0xdc25=['TEXT','sequelize','exports','STRING','name'];(function(_0x53c2e3,_0x4e8f26){var _0x5c13d9=function(_0x5af0e8){while(--_0x5af0e8){_0x53c2e3['push'](_0x53c2e3['shift']());}};_0x5c13d9(++_0x4e8f26);}(_0xdc25,0x128));var _0x5dc2=function(_0x3d6e82,_0x5bee13){_0x3d6e82=_0x3d6e82-0x0;var _0x57185d=_0xdc25[_0x3d6e82];return _0x57185d;};'use strict';var Sequelize=require(_0x5dc2('0x0'));module[_0x5dc2('0x1')]={'name':{'type':Sequelize[_0x5dc2('0x2')],'allowNull':![],'unique':_0x5dc2('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x5dc2('0x4')]},'description':{'type':Sequelize[_0x5dc2('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 151d365..071fa38 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0xaaa4fd,_0x9c5f4b){var _0xd428ce=function(_0x1b930c){while(--_0x1b930c){_0xaaa4fd['push'](_0xaaa4fd['shift']());}};_0xd428ce(++_0x9c5f4b);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2e746c,_0x456264){_0x2e746c=_0x2e746c-0x0;var _0x2d1f56=_0x8d0e[_0x2e746c];return _0x2d1f56;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3bb9e3,_0x1fb1c4){var _0x381aa0=function(_0xb56b49){while(--_0xb56b49){_0x3bb9e3['push'](_0x3bb9e3['shift']());}};_0x381aa0(++_0x1fb1c4);}(_0x008c,0x188));var _0xc008=function(_0x4266b4,_0x4859ad){_0x4266b4=_0x4266b4-0x0;var _0x1442aa=_0x008c[_0x4266b4];return _0x1442aa;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));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 licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 881c76b..b2084be 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 _0xbeea=['analytics_metrics','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric'];(function(_0x47829a,_0x3b8064){var _0x5d624c=function(_0x4f9e41){while(--_0x4f9e41){_0x47829a['push'](_0x47829a['shift']());}};_0x5d624c(++_0x3b8064);}(_0xbeea,0xb1));var _0xabee=function(_0x582689,_0x256d34){_0x582689=_0x582689-0x0;var _0x5dc6d6=_0xbeea[_0x582689];return _0x5dc6d6;};'use strict';var _=require(_0xabee('0x0'));var util=require('util');var logger=require(_0xabee('0x1'))(_0xabee('0x2'));var moment=require(_0xabee('0x3'));var BPromise=require('bluebird');var rp=require(_0xabee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabee('0x5'));var config=require(_0xabee('0x6'));var attributes=require(_0xabee('0x7'));module[_0xabee('0x8')]=function(_0x1ea258,_0x58c9ef){return _0x1ea258['define'](_0xabee('0x9'),attributes,{'tableName':_0xabee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b69=['../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x5bf6dc,_0x2f39be){var _0x427b0d=function(_0xf5a12a){while(--_0xf5a12a){_0x5bf6dc['push'](_0x5bf6dc['shift']());}};_0x427b0d(++_0x2f39be);}(_0x9b69,0xa3));var _0x99b6=function(_0x3f4e15,_0x334c07){_0x3f4e15=_0x3f4e15-0x0;var _0x43a9d0=_0x9b69[_0x3f4e15];return _0x43a9d0;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var logger=require(_0x99b6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x99b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b6('0x4'));var rimraf=require(_0x99b6('0x5'));var config=require(_0x99b6('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x99b6('0x7')]=function(_0x5c4062,_0xbcd357){return _0x5c4062[_0x99b6('0x8')](_0x99b6('0x9'),attributes,{'tableName':_0x99b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 35d060c..18d7712 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 _0x44f1=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x44f1,0x16b));var _0x144f=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x44f1[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x144f('0x0'));var util=require(_0x144f('0x1'));var moment=require(_0x144f('0x2'));var BPromise=require(_0x144f('0x3'));var rs=require(_0x144f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x144f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x144f('0x6'))(_0x144f('0x7'));var config=require(_0x144f('0x8'));var jayson=require(_0x144f('0x9'));var client=jayson[_0x144f('0xa')][_0x144f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c87e5,_0x4ccb8c,_0x48326f){return new BPromise(function(_0x4c4eb3,_0x356ea7){return client['request'](_0x3c87e5,_0x48326f)[_0x144f('0xc')](function(_0xc1248d){logger[_0x144f('0xd')](_0x144f('0xe'),_0x4ccb8c,_0x144f('0xf'));logger[_0x144f('0x10')](_0x144f('0x11'),_0x4ccb8c,_0x144f('0xf'),JSON[_0x144f('0x12')](_0xc1248d));if(_0xc1248d['error']){if(_0xc1248d[_0x144f('0x13')][_0x144f('0x14')]===0x1f4){logger[_0x144f('0x13')](_0x144f('0xe'),_0x4ccb8c,_0xc1248d['error'][_0x144f('0x15')]);return _0x356ea7(_0xc1248d[_0x144f('0x13')]['message']);}logger[_0x144f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4ccb8c,_0xc1248d['error'][_0x144f('0x15')]);return _0x4c4eb3(_0xc1248d[_0x144f('0x13')][_0x144f('0x15')]);}else{logger[_0x144f('0xd')](_0x144f('0xe'),_0x4ccb8c,'request\x20sent');_0x4c4eb3(_0xc1248d[_0x144f('0x16')]['message']);}})[_0x144f('0x17')](function(_0x3421b0){logger[_0x144f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4ccb8c,_0x3421b0);_0x356ea7(_0x3421b0);});});} \ No newline at end of file +var _0xcdf7=['request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','result','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x330e77,_0x2dd3c0){var _0xdbadea=function(_0x2453e9){while(--_0x2453e9){_0x330e77['push'](_0x330e77['shift']());}};_0xdbadea(++_0x2dd3c0);}(_0xcdf7,0x145));var _0x7cdf=function(_0x2c65e0,_0xf0f2b8){_0x2c65e0=_0x2c65e0-0x0;var _0x7101ac=_0xcdf7[_0x2c65e0];return _0x7101ac;};'use strict';var _=require(_0x7cdf('0x0'));var util=require('util');var moment=require(_0x7cdf('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cdf('0x2'));var fs=require('fs');var Redis=require(_0x7cdf('0x3'));var db=require(_0x7cdf('0x4'))['db'];var utils=require(_0x7cdf('0x5'));var logger=require(_0x7cdf('0x6'))(_0x7cdf('0x7'));var config=require(_0x7cdf('0x8'));var jayson=require(_0x7cdf('0x9'));var client=jayson[_0x7cdf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5102,_0x538106,_0x50f4f5){return new BPromise(function(_0x4ba10f,_0x4e6862){return client[_0x7cdf('0xb')](_0x1e5102,_0x50f4f5)[_0x7cdf('0xc')](function(_0x242d0b){logger[_0x7cdf('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x538106,'request\x20sent');logger[_0x7cdf('0xe')](_0x7cdf('0xf'),_0x538106,_0x7cdf('0x10'),JSON[_0x7cdf('0x11')](_0x242d0b));if(_0x242d0b[_0x7cdf('0x12')]){if(_0x242d0b['error'][_0x7cdf('0x13')]===0x1f4){logger[_0x7cdf('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x538106,_0x242d0b[_0x7cdf('0x12')]['message']);return _0x4e6862(_0x242d0b[_0x7cdf('0x12')]['message']);}logger[_0x7cdf('0x12')](_0x7cdf('0x14'),_0x538106,_0x242d0b[_0x7cdf('0x12')]['message']);return _0x4ba10f(_0x242d0b[_0x7cdf('0x12')]['message']);}else{logger[_0x7cdf('0xd')](_0x7cdf('0x14'),_0x538106,'request\x20sent');_0x4ba10f(_0x242d0b[_0x7cdf('0x15')][_0x7cdf('0x16')]);}})[_0x7cdf('0x17')](function(_0x259b03){logger[_0x7cdf('0x12')](_0x7cdf('0x14'),_0x538106,_0x259b03);_0x4e6862(_0x259b03);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ad6226e..17b33a0 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 _0x8375=['/:id','post','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x390ee8,_0x4f0c97){var _0xef99a=function(_0x4034dd){while(--_0x4034dd){_0x390ee8['push'](_0x390ee8['shift']());}};_0xef99a(++_0x4f0c97);}(_0x8375,0xa8));var _0x5837=function(_0x47078a,_0x223df2){_0x47078a=_0x47078a-0x0;var _0x5f57e4=_0x8375[_0x47078a];return _0x5f57e4;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require(_0x5837('0x6'));var interaction=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var controller=require('./analyticMetric.controller');router[_0x5837('0x9')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0xb')]);router[_0x5837('0x9')](_0x5837('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5837('0xd')]('/',auth[_0x5837('0xa')](),controller['create']);router[_0x5837('0xe')]('/:id',auth[_0x5837('0xa')](),controller[_0x5837('0xf')]);router[_0x5837('0x10')](_0x5837('0xc'),auth[_0x5837('0xa')](),controller[_0x5837('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdbd0=['index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x116d6e,_0x1069ba){var _0x138a1b=function(_0x2e0935){while(--_0x2e0935){_0x116d6e['push'](_0x116d6e['shift']());}};_0x138a1b(++_0x1069ba);}(_0xdbd0,0x88));var _0x0dbd=function(_0x40d7fa,_0x2b1307){_0x40d7fa=_0x40d7fa-0x0;var _0x39c523=_0xdbd0[_0x40d7fa];return _0x39c523;};'use strict';var multer=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var path=require(_0x0dbd('0x2'));var timeout=require(_0x0dbd('0x3'));var express=require(_0x0dbd('0x4'));var router=express['Router']();var fs_extra=require(_0x0dbd('0x5'));var auth=require(_0x0dbd('0x6'));var interaction=require(_0x0dbd('0x7'));var config=require('../../config/environment');var controller=require(_0x0dbd('0x8'));router[_0x0dbd('0x9')]('/',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xb')]);router['get']('/:id',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xc')]);router[_0x0dbd('0xd')]('/',auth[_0x0dbd('0xa')](),controller[_0x0dbd('0xe')]);router[_0x0dbd('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0dbd('0x10')]);router[_0x0dbd('0x11')](_0x0dbd('0x12'),auth[_0x0dbd('0xa')](),controller[_0x0dbd('0x13')]);module[_0x0dbd('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5de0cba..05355d9 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 _0x56fb=['exports','TEXT','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x56fb,0x1d9));var _0xb56f=function(_0x37dbe8,_0x10e968){_0x37dbe8=_0x37dbe8-0x0;var _0x2416b6=_0x56fb[_0x37dbe8];return _0x2416b6;};'use strict';var Sequelize=require(_0xb56f('0x0'));module[_0xb56f('0x1')]={'tree':{'type':Sequelize[_0xb56f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa38d=['sequelize'];(function(_0x5750fa,_0x42d2bf){var _0x3e4738=function(_0x25e8d5){while(--_0x25e8d5){_0x5750fa['push'](_0x5750fa['shift']());}};_0x3e4738(++_0x42d2bf);}(_0xa38d,0x122));var _0xda38=function(_0x3c4138,_0x448f31){_0x3c4138=_0x3c4138-0x0;var _0x3854b9=_0xa38d[_0x3c4138];return _0x3854b9;};'use strict';var Sequelize=require(_0xda38('0x0'));module['exports']={'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 0c497ee..5f9507b 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 _0x356f=['moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','destroy','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','eml-format','rimraf','fast-json-patch'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0x356f,0x1bf));var _0xf356=function(_0x561048,_0xc008aa){_0x561048=_0x561048-0x0;var _0x4874af=_0x356f[_0x561048];return _0x4874af;};'use strict';var emlformat=require(_0xf356('0x0'));var rimraf=require(_0xf356('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf356('0x2'));var rp=require('request-promise');var moment=require(_0xf356('0x3'));var BPromise=require(_0xf356('0x4'));var Mustache=require(_0xf356('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf356('0x6'));var ejs=require(_0xf356('0x7'));var fs=require('fs');var fs_extra=require(_0xf356('0x8'));var _=require(_0xf356('0x9'));var squel=require(_0xf356('0xa'));var crypto=require(_0xf356('0xb'));var jsforce=require(_0xf356('0xc'));var deskjs=require(_0xf356('0xd'));var toCsv=require(_0xf356('0x6'));var querystring=require('querystring');var Papa=require(_0xf356('0xe'));var Redis=require(_0xf356('0xf'));var authService=require(_0xf356('0x10'));var qs=require(_0xf356('0x11'));var as=require(_0xf356('0x12'));var hardwareService=require(_0xf356('0x13'));var logger=require(_0xf356('0x14'))(_0xf356('0x15'));var utils=require(_0xf356('0x16'));var config=require(_0xf356('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf356('0x18'))['db'];function respondWithStatusCode(_0x1818da,_0x2ed24c){_0x2ed24c=_0x2ed24c||0xcc;return function(_0xad4134){if(_0xad4134){return _0x1818da[_0xf356('0x19')](_0x2ed24c);}return _0x1818da[_0xf356('0x1a')](_0x2ed24c)[_0xf356('0x1b')]();};}function respondWithResult(_0x392cdf,_0x373a77){_0x373a77=_0x373a77||0xc8;return function(_0x1d36f7){if(_0x1d36f7){return _0x392cdf[_0xf356('0x1a')](_0x373a77)[_0xf356('0x1c')](_0x1d36f7);}};}function respondWithFilteredResult(_0x1601f4,_0xd07c62){return function(_0x1d3bf1){if(_0x1d3bf1){var _0x1ea6d0=typeof _0xd07c62[_0xf356('0x1d')]===_0xf356('0x1e')&&typeof _0xd07c62[_0xf356('0x1f')]===_0xf356('0x1e');var _0x53e939=_0x1d3bf1['count'];var _0x5283f6=_0x1ea6d0?0x0:_0xd07c62[_0xf356('0x1d')];var _0x316945=_0x1ea6d0?_0x1d3bf1['count']:_0xd07c62[_0xf356('0x1d')]+_0xd07c62['limit'];var _0x2d1f77;if(_0x316945>=_0x53e939){_0x316945=_0x53e939;_0x2d1f77=0xc8;}else{_0x2d1f77=0xce;}_0x1601f4[_0xf356('0x1a')](_0x2d1f77);return _0x1601f4[_0xf356('0x20')](_0xf356('0x21'),_0x5283f6+'-'+_0x316945+'/'+_0x53e939)[_0xf356('0x1c')](_0x1d3bf1);}return null;};}function patchUpdates(_0x528c4d){return function(_0x2196ab){try{jsonpatch['apply'](_0x2196ab,_0x528c4d,!![]);}catch(_0x478795){return BPromise[_0xf356('0x22')](_0x478795);}return _0x2196ab['save']();};}function saveUpdates(_0x12b5e7,_0x212e76){return function(_0x4c6266){if(_0x4c6266){return _0x4c6266['update'](_0x12b5e7)['then'](function(_0x44848b){return _0x44848b;});}return null;};}function removeEntity(_0x459782,_0x17dec9){return function(_0x5c8059){if(_0x5c8059){return _0x5c8059[_0xf356('0x23')]()[_0xf356('0x24')](function(){_0x459782['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x293c40,_0x1d77d2){return function(_0x17e291){if(!_0x17e291){_0x293c40['sendStatus'](0x194);}return _0x17e291;};}function handleError(_0x4b46d8,_0x4f1545){_0x4f1545=_0x4f1545||0x1f4;return function(_0x399584){logger[_0xf356('0x25')](_0x399584[_0xf356('0x26')]);if(_0x399584[_0xf356('0x27')]){delete _0x399584[_0xf356('0x27')];}_0x4b46d8[_0xf356('0x1a')](_0x4f1545)[_0xf356('0x28')](_0x399584);};}exports[_0xf356('0x29')]=function(_0x42ccc4,_0x1a0229){var _0x5dc428={},_0x315af5={},_0x2f7345={'count':0x0,'rows':[]};var _0x2f5fc2=_['map'](db[_0xf356('0x2a')][_0xf356('0x2b')],function(_0x24eb99){return{'name':_0x24eb99[_0xf356('0x2c')],'type':_0x24eb99[_0xf356('0x2d')][_0xf356('0x2e')]};});_0x315af5[_0xf356('0x2f')]=_[_0xf356('0x30')](_0x2f5fc2,_0xf356('0x27'));_0x315af5[_0xf356('0x31')]=_[_0xf356('0x32')](_0x42ccc4[_0xf356('0x31')]);_0x315af5[_0xf356('0x33')]=_[_0xf356('0x34')](_0x315af5['model'],_0x315af5[_0xf356('0x31')]);_0x5dc428[_0xf356('0x35')]=_[_0xf356('0x34')](_0x315af5[_0xf356('0x2f')],qs[_0xf356('0x36')](_0x42ccc4['query']['fields']));_0x5dc428[_0xf356('0x35')]=_0x5dc428['attributes'][_0xf356('0x37')]?_0x5dc428[_0xf356('0x35')]:_0x315af5['model'];if(!_0x42ccc4[_0xf356('0x31')]['hasOwnProperty'](_0xf356('0x38'))){_0x5dc428[_0xf356('0x1f')]=qs[_0xf356('0x1f')](_0x42ccc4[_0xf356('0x31')]['limit']);_0x5dc428[_0xf356('0x1d')]=qs[_0xf356('0x1d')](_0x42ccc4[_0xf356('0x31')][_0xf356('0x1d')]);}_0x5dc428['order']=qs[_0xf356('0x39')](_0x42ccc4['query'][_0xf356('0x39')]);_0x5dc428[_0xf356('0x3a')]=qs[_0xf356('0x33')](_[_0xf356('0x3b')](_0x42ccc4[_0xf356('0x31')],_0x315af5[_0xf356('0x33')]),_0x2f5fc2);if(_0x42ccc4[_0xf356('0x31')][_0xf356('0x3c')]){_0x5dc428[_0xf356('0x3a')]=_[_0xf356('0x3d')](_0x5dc428[_0xf356('0x3a')],{'$or':_[_0xf356('0x30')](_0x2f5fc2,function(_0x2b1704){if(_0x2b1704[_0xf356('0x2d')]!==_0xf356('0x3e')){var _0x4179c5={};_0x4179c5[_0x2b1704['name']]={'$like':'%'+_0x42ccc4[_0xf356('0x31')]['filter']+'%'};return _0x4179c5;}})});}_0x5dc428=_[_0xf356('0x3d')]({},_0x5dc428,_0x42ccc4['options']);var _0x2417bf={'where':_0x5dc428[_0xf356('0x3a')]};return db[_0xf356('0x2a')]['count'](_0x2417bf)[_0xf356('0x24')](function(_0x26c73b){_0x2f7345[_0xf356('0x3f')]=_0x26c73b;if(_0x42ccc4[_0xf356('0x31')][_0xf356('0x40')]){_0x5dc428[_0xf356('0x41')]=[{'all':!![]}];}return db[_0xf356('0x2a')][_0xf356('0x42')](_0x5dc428);})[_0xf356('0x24')](function(_0x197742){_0x2f7345[_0xf356('0x43')]=_0x197742;return _0x2f7345;})['then'](respondWithFilteredResult(_0x1a0229,_0x5dc428))[_0xf356('0x44')](handleError(_0x1a0229,null));};exports[_0xf356('0x45')]=function(_0x51e544,_0x59bcde){var _0x2b010c={'raw':!![],'where':{'id':_0x51e544[_0xf356('0x46')]['id']}},_0x4dc8f1={};_0x4dc8f1[_0xf356('0x2f')]=_['keys'](db['AnalyticTreeReport'][_0xf356('0x2b')]);_0x4dc8f1['query']=_['keys'](_0x51e544['query']);_0x4dc8f1['filters']=_[_0xf356('0x34')](_0x4dc8f1['model'],_0x4dc8f1[_0xf356('0x31')]);_0x2b010c[_0xf356('0x35')]=_['intersection'](_0x4dc8f1['model'],qs[_0xf356('0x36')](_0x51e544[_0xf356('0x31')][_0xf356('0x36')]));_0x2b010c[_0xf356('0x35')]=_0x2b010c['attributes'][_0xf356('0x37')]?_0x2b010c[_0xf356('0x35')]:_0x4dc8f1[_0xf356('0x2f')];if(_0x51e544[_0xf356('0x31')][_0xf356('0x40')]){_0x2b010c['include']=[{'all':!![]}];}_0x2b010c=_['merge']({},_0x2b010c,_0x51e544['options']);return db['AnalyticTreeReport']['find'](_0x2b010c)[_0xf356('0x24')](handleEntityNotFound(_0x59bcde,null))[_0xf356('0x24')](respondWithResult(_0x59bcde,null))['catch'](handleError(_0x59bcde,null));};exports[_0xf356('0x47')]=function(_0x1465d5,_0x2fb60d){return db[_0xf356('0x2a')]['create'](_0x1465d5[_0xf356('0x48')],{})[_0xf356('0x24')](respondWithResult(_0x2fb60d,0xc9))[_0xf356('0x44')](handleError(_0x2fb60d,null));};exports[_0xf356('0x49')]=function(_0x4b7ca8,_0x1e7c96){if(_0x4b7ca8[_0xf356('0x48')]['id']){delete _0x4b7ca8[_0xf356('0x48')]['id'];}return db[_0xf356('0x2a')][_0xf356('0x4a')]({'where':{'id':_0x4b7ca8[_0xf356('0x46')]['id']}})[_0xf356('0x24')](handleEntityNotFound(_0x1e7c96,null))[_0xf356('0x24')](saveUpdates(_0x4b7ca8[_0xf356('0x48')],null))['then'](respondWithResult(_0x1e7c96,null))[_0xf356('0x44')](handleError(_0x1e7c96,null));};exports[_0xf356('0x23')]=function(_0x5c4688,_0xc01871){return db[_0xf356('0x2a')][_0xf356('0x4a')]({'where':{'id':_0x5c4688[_0xf356('0x46')]['id']}})['then'](handleEntityNotFound(_0xc01871,null))[_0xf356('0x24')](removeEntity(_0xc01871,null))[_0xf356('0x44')](handleError(_0xc01871,null));}; \ No newline at end of file +var _0x4a7b=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4a7b,0x128));var _0xb4a7=function(_0x5ea204,_0x5e0bf8){_0x5ea204=_0x5ea204-0x0;var _0x448dd1=_0x4a7b[_0x5ea204];return _0x448dd1;};'use strict';var emlformat=require(_0xb4a7('0x0'));var rimraf=require(_0xb4a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4a7('0x2'));var rp=require(_0xb4a7('0x3'));var moment=require(_0xb4a7('0x4'));var BPromise=require(_0xb4a7('0x5'));var Mustache=require(_0xb4a7('0x6'));var util=require(_0xb4a7('0x7'));var path=require(_0xb4a7('0x8'));var sox=require(_0xb4a7('0x9'));var csv=require(_0xb4a7('0xa'));var ejs=require(_0xb4a7('0xb'));var fs=require('fs');var fs_extra=require(_0xb4a7('0xc'));var _=require('lodash');var squel=require(_0xb4a7('0xd'));var crypto=require('crypto');var jsforce=require(_0xb4a7('0xe'));var deskjs=require(_0xb4a7('0xf'));var toCsv=require(_0xb4a7('0xa'));var querystring=require(_0xb4a7('0x10'));var Papa=require(_0xb4a7('0x11'));var Redis=require(_0xb4a7('0x12'));var authService=require(_0xb4a7('0x13'));var qs=require(_0xb4a7('0x14'));var as=require(_0xb4a7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4a7('0x16'))(_0xb4a7('0x17'));var utils=require(_0xb4a7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb4a7('0x19'));var db=require(_0xb4a7('0x1a'))['db'];function respondWithStatusCode(_0x1e02ab,_0x4c1ae5){_0x4c1ae5=_0x4c1ae5||0xcc;return function(_0x58f155){if(_0x58f155){return _0x1e02ab[_0xb4a7('0x1b')](_0x4c1ae5);}return _0x1e02ab[_0xb4a7('0x1c')](_0x4c1ae5)[_0xb4a7('0x1d')]();};}function respondWithResult(_0x234cb6,_0x5f572c){_0x5f572c=_0x5f572c||0xc8;return function(_0x5e7375){if(_0x5e7375){return _0x234cb6[_0xb4a7('0x1c')](_0x5f572c)[_0xb4a7('0x1e')](_0x5e7375);}};}function respondWithFilteredResult(_0x1dc0a3,_0xe7800d){return function(_0x3e8deb){if(_0x3e8deb){var _0x2481a0=typeof _0xe7800d[_0xb4a7('0x1f')]==='undefined'&&typeof _0xe7800d[_0xb4a7('0x20')]==='undefined';var _0x89d320=_0x3e8deb['count'];var _0x58837f=_0x2481a0?0x0:_0xe7800d[_0xb4a7('0x1f')];var _0xb03d14=_0x2481a0?_0x3e8deb[_0xb4a7('0x21')]:_0xe7800d[_0xb4a7('0x1f')]+_0xe7800d[_0xb4a7('0x20')];var _0x391331;if(_0xb03d14>=_0x89d320){_0xb03d14=_0x89d320;_0x391331=0xc8;}else{_0x391331=0xce;}_0x1dc0a3[_0xb4a7('0x1c')](_0x391331);return _0x1dc0a3[_0xb4a7('0x22')](_0xb4a7('0x23'),_0x58837f+'-'+_0xb03d14+'/'+_0x89d320)[_0xb4a7('0x1e')](_0x3e8deb);}return null;};}function patchUpdates(_0x124df0){return function(_0x3188ed){try{jsonpatch[_0xb4a7('0x24')](_0x3188ed,_0x124df0,!![]);}catch(_0x46254f){return BPromise[_0xb4a7('0x25')](_0x46254f);}return _0x3188ed[_0xb4a7('0x26')]();};}function saveUpdates(_0x458900,_0x480c6b){return function(_0x13728c){if(_0x13728c){return _0x13728c[_0xb4a7('0x27')](_0x458900)[_0xb4a7('0x28')](function(_0x266f97){return _0x266f97;});}return null;};}function removeEntity(_0x52b17f,_0x455073){return function(_0x4dbd4e){if(_0x4dbd4e){return _0x4dbd4e['destroy']()[_0xb4a7('0x28')](function(){_0x52b17f[_0xb4a7('0x1c')](0xcc)[_0xb4a7('0x1d')]();});}};}function handleEntityNotFound(_0x478aab,_0x14c988){return function(_0xb1f90c){if(!_0xb1f90c){_0x478aab[_0xb4a7('0x1b')](0x194);}return _0xb1f90c;};}function handleError(_0x22e7a3,_0x555044){_0x555044=_0x555044||0x1f4;return function(_0xcdff13){logger['error'](_0xcdff13[_0xb4a7('0x29')]);if(_0xcdff13[_0xb4a7('0x2a')]){delete _0xcdff13[_0xb4a7('0x2a')];}_0x22e7a3[_0xb4a7('0x1c')](_0x555044)['send'](_0xcdff13);};}exports[_0xb4a7('0x2b')]=function(_0x5e4b8a,_0x150074){var _0x5a6586={},_0x4f9c92={},_0x52f095={'count':0x0,'rows':[]};var _0x10d94d=_[_0xb4a7('0x2c')](db[_0xb4a7('0x2d')][_0xb4a7('0x2e')],function(_0x384761){return{'name':_0x384761[_0xb4a7('0x2f')],'type':_0x384761['type']['key']};});_0x4f9c92[_0xb4a7('0x30')]=_[_0xb4a7('0x2c')](_0x10d94d,_0xb4a7('0x2a'));_0x4f9c92[_0xb4a7('0x31')]=_[_0xb4a7('0x32')](_0x5e4b8a[_0xb4a7('0x31')]);_0x4f9c92[_0xb4a7('0x33')]=_[_0xb4a7('0x34')](_0x4f9c92[_0xb4a7('0x30')],_0x4f9c92[_0xb4a7('0x31')]);_0x5a6586[_0xb4a7('0x35')]=_['intersection'](_0x4f9c92[_0xb4a7('0x30')],qs[_0xb4a7('0x36')](_0x5e4b8a['query'][_0xb4a7('0x36')]));_0x5a6586[_0xb4a7('0x35')]=_0x5a6586['attributes'][_0xb4a7('0x37')]?_0x5a6586[_0xb4a7('0x35')]:_0x4f9c92['model'];if(!_0x5e4b8a[_0xb4a7('0x31')][_0xb4a7('0x38')](_0xb4a7('0x39'))){_0x5a6586[_0xb4a7('0x20')]=qs[_0xb4a7('0x20')](_0x5e4b8a[_0xb4a7('0x31')]['limit']);_0x5a6586[_0xb4a7('0x1f')]=qs[_0xb4a7('0x1f')](_0x5e4b8a[_0xb4a7('0x31')][_0xb4a7('0x1f')]);}_0x5a6586[_0xb4a7('0x3a')]=qs[_0xb4a7('0x3b')](_0x5e4b8a[_0xb4a7('0x31')][_0xb4a7('0x3b')]);_0x5a6586[_0xb4a7('0x3c')]=qs[_0xb4a7('0x33')](_['pick'](_0x5e4b8a['query'],_0x4f9c92['filters']),_0x10d94d);if(_0x5e4b8a['query'][_0xb4a7('0x3d')]){_0x5a6586['where']=_[_0xb4a7('0x3e')](_0x5a6586[_0xb4a7('0x3c')],{'$or':_[_0xb4a7('0x2c')](_0x10d94d,function(_0x17a2de){if(_0x17a2de[_0xb4a7('0x3f')]!=='VIRTUAL'){var _0x16bf60={};_0x16bf60[_0x17a2de['name']]={'$like':'%'+_0x5e4b8a[_0xb4a7('0x31')][_0xb4a7('0x3d')]+'%'};return _0x16bf60;}})});}_0x5a6586=_[_0xb4a7('0x3e')]({},_0x5a6586,_0x5e4b8a[_0xb4a7('0x40')]);var _0x126e63={'where':_0x5a6586[_0xb4a7('0x3c')]};return db[_0xb4a7('0x2d')][_0xb4a7('0x21')](_0x126e63)[_0xb4a7('0x28')](function(_0x20474d){_0x52f095[_0xb4a7('0x21')]=_0x20474d;if(_0x5e4b8a[_0xb4a7('0x31')][_0xb4a7('0x41')]){_0x5a6586[_0xb4a7('0x42')]=[{'all':!![]}];}return db[_0xb4a7('0x2d')]['findAll'](_0x5a6586);})[_0xb4a7('0x28')](function(_0x7983eb){_0x52f095[_0xb4a7('0x43')]=_0x7983eb;return _0x52f095;})[_0xb4a7('0x28')](respondWithFilteredResult(_0x150074,_0x5a6586))[_0xb4a7('0x44')](handleError(_0x150074,null));};exports[_0xb4a7('0x45')]=function(_0x6c84ae,_0x2a626f){var _0x143397={'raw':!![],'where':{'id':_0x6c84ae['params']['id']}},_0x9637f1={};_0x9637f1['model']=_['keys'](db[_0xb4a7('0x2d')]['rawAttributes']);_0x9637f1[_0xb4a7('0x31')]=_[_0xb4a7('0x32')](_0x6c84ae[_0xb4a7('0x31')]);_0x9637f1['filters']=_['intersection'](_0x9637f1['model'],_0x9637f1[_0xb4a7('0x31')]);_0x143397[_0xb4a7('0x35')]=_[_0xb4a7('0x34')](_0x9637f1[_0xb4a7('0x30')],qs['fields'](_0x6c84ae[_0xb4a7('0x31')][_0xb4a7('0x36')]));_0x143397['attributes']=_0x143397[_0xb4a7('0x35')]['length']?_0x143397[_0xb4a7('0x35')]:_0x9637f1['model'];if(_0x6c84ae['query'][_0xb4a7('0x41')]){_0x143397[_0xb4a7('0x42')]=[{'all':!![]}];}_0x143397=_['merge']({},_0x143397,_0x6c84ae['options']);return db[_0xb4a7('0x2d')][_0xb4a7('0x46')](_0x143397)[_0xb4a7('0x28')](handleEntityNotFound(_0x2a626f,null))[_0xb4a7('0x28')](respondWithResult(_0x2a626f,null))[_0xb4a7('0x44')](handleError(_0x2a626f,null));};exports[_0xb4a7('0x47')]=function(_0x54972c,_0x27728c){return db['AnalyticTreeReport'][_0xb4a7('0x47')](_0x54972c[_0xb4a7('0x48')],{})[_0xb4a7('0x28')](respondWithResult(_0x27728c,0xc9))[_0xb4a7('0x44')](handleError(_0x27728c,null));};exports[_0xb4a7('0x27')]=function(_0x982ef7,_0xbb3200){if(_0x982ef7['body']['id']){delete _0x982ef7['body']['id'];}return db['AnalyticTreeReport'][_0xb4a7('0x46')]({'where':{'id':_0x982ef7[_0xb4a7('0x49')]['id']}})['then'](handleEntityNotFound(_0xbb3200,null))[_0xb4a7('0x28')](saveUpdates(_0x982ef7[_0xb4a7('0x48')],null))[_0xb4a7('0x28')](respondWithResult(_0xbb3200,null))[_0xb4a7('0x44')](handleError(_0xbb3200,null));};exports[_0xb4a7('0x4a')]=function(_0x118636,_0x45edf3){return db[_0xb4a7('0x2d')]['find']({'where':{'id':_0x118636[_0xb4a7('0x49')]['id']}})['then'](handleEntityNotFound(_0x45edf3,null))['then'](removeEntity(_0x45edf3,null))[_0xb4a7('0x44')](handleError(_0x45edf3,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 680ece7..f6b207b 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 _0x8ef6=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x56f597,_0x165ee7){var _0x4c6a2e=function(_0x5c9ae8){while(--_0x5c9ae8){_0x56f597['push'](_0x56f597['shift']());}};_0x4c6a2e(++_0x165ee7);}(_0x8ef6,0xb8));var _0x68ef=function(_0x29170a,_0x3fa390){_0x29170a=_0x29170a-0x0;var _0xb6dd97=_0x8ef6[_0x29170a];return _0xb6dd97;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x68ef('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x68ef('0x8')]=function(_0x336e52,_0x3cefad){return _0x336e52[_0x68ef('0x9')](_0x68ef('0xa'),attributes,{'tableName':_0x68ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb240=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x295771,_0x11e035){var _0x5130ee=function(_0x4f0ab4){while(--_0x4f0ab4){_0x295771['push'](_0x295771['shift']());}};_0x5130ee(++_0x11e035);}(_0xb240,0x1cc));var _0x0b24=function(_0x37ab87,_0x3c45d0){_0x37ab87=_0x37ab87-0x0;var _0x5162ed=_0xb240[_0x37ab87];return _0x5162ed;};'use strict';var _=require(_0x0b24('0x0'));var util=require(_0x0b24('0x1'));var logger=require(_0x0b24('0x2'))(_0x0b24('0x3'));var moment=require(_0x0b24('0x4'));var BPromise=require(_0x0b24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b24('0x6'));var rimraf=require(_0x0b24('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x0b24('0x8')]=function(_0x4613ed,_0x168264){return _0x4613ed[_0x0b24('0x9')](_0x0b24('0xa'),attributes,{'tableName':_0x0b24('0xb'),'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 9786084..c1874d0 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4971ca,_0x2ae39a){var _0x10c18e=function(_0x469242){while(--_0x469242){_0x4971ca['push'](_0x4971ca['shift']());}};_0x10c18e(++_0x2ae39a);}(_0xadb5,0xad));var _0x5adb=function(_0x3edb03,_0x59ee93){_0x3edb03=_0x3edb03-0x0;var _0x2353cb=_0xadb5[_0x3edb03];return _0x2353cb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xadb5,0xad));var _0x5adb=function(_0x28cfc7,_0x2632cb){_0x28cfc7=_0x28cfc7-0x0;var _0x17d7a4=_0xadb5[_0x28cfc7];return _0x17d7a4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 6765bc7..e22f0b2 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 _0xde59=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x26fed9,_0x3cf104){var _0x4741c4=function(_0x1d810e){while(--_0x1d810e){_0x26fed9['push'](_0x26fed9['shift']());}};_0x4741c4(++_0x3cf104);}(_0xde59,0x1ce));var _0x9de5=function(_0x3cbe2e,_0x4647bd){_0x3cbe2e=_0x3cbe2e-0x0;var _0x52e951=_0xde59[_0x3cbe2e];return _0x52e951;};'use strict';var multer=require(_0x9de5('0x0'));var util=require(_0x9de5('0x1'));var path=require(_0x9de5('0x2'));var timeout=require(_0x9de5('0x3'));var express=require(_0x9de5('0x4'));var router=express[_0x9de5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9de5('0x6'));var interaction=require(_0x9de5('0x7'));var config=require(_0x9de5('0x8'));var controller=require(_0x9de5('0x9'));router[_0x9de5('0xa')]('/',auth[_0x9de5('0xb')](),controller['index']);router[_0x9de5('0xa')](_0x9de5('0xc'),auth[_0x9de5('0xb')](),controller[_0x9de5('0xd')]);router[_0x9de5('0xe')]('/',auth[_0x9de5('0xb')](),controller[_0x9de5('0xf')]);router[_0x9de5('0x10')](_0x9de5('0xc'),auth[_0x9de5('0xb')](),controller[_0x9de5('0x11')]);router[_0x9de5('0x12')](_0x9de5('0xc'),auth[_0x9de5('0xb')](),controller[_0x9de5('0x13')]);module[_0x9de5('0x14')]=router; \ No newline at end of file +var _0x9103=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','update','destroy','exports','util','express','Router','fs-extra'];(function(_0x3ae99e,_0x161052){var _0x2af2cd=function(_0x37004a){while(--_0x37004a){_0x3ae99e['push'](_0x3ae99e['shift']());}};_0x2af2cd(++_0x161052);}(_0x9103,0xec));var _0x3910=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x9103[_0x3d13bb];return _0x4b5a1b;};'use strict';var multer=require('multer');var util=require(_0x3910('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3910('0x1'));var router=express[_0x3910('0x2')]();var fs_extra=require(_0x3910('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3910('0x4'));var controller=require(_0x3910('0x5'));router[_0x3910('0x6')]('/',auth[_0x3910('0x7')](),controller[_0x3910('0x8')]);router[_0x3910('0x6')]('/:id',auth[_0x3910('0x7')](),controller[_0x3910('0x9')]);router[_0x3910('0xa')]('/',auth[_0x3910('0x7')](),controller[_0x3910('0xb')]);router['put']('/:id',auth[_0x3910('0x7')](),controller[_0x3910('0xc')]);router['delete']('/:id',auth[_0x3910('0x7')](),controller[_0x3910('0xd')]);module[_0x3910('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 540a8df..62b73c6 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 _0x385b=['STRING','exports'];(function(_0xb1bc,_0x1d3718){var _0x47ced2=function(_0x34264f){while(--_0x34264f){_0xb1bc['push'](_0xb1bc['shift']());}};_0x47ced2(++_0x1d3718);}(_0x385b,0x1a7));var _0xb385=function(_0x64b6e,_0x391478){_0x64b6e=_0x64b6e-0x0;var _0x5d4448=_0x385b[_0x64b6e];return _0x5d4448;};'use strict';var Sequelize=require('sequelize');module[_0xb385('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb385('0x1')]},'type':{'type':Sequelize[_0xb385('0x1')]}}; \ No newline at end of file +var _0x59ce=['exports','STRING','sequelize'];(function(_0x14d016,_0x3341dc){var _0x32295b=function(_0x281233){while(--_0x281233){_0x14d016['push'](_0x14d016['shift']());}};_0x32295b(++_0x3341dc);}(_0x59ce,0x92));var _0xe59c=function(_0x480230,_0x47c081){_0x480230=_0x480230-0x0;var _0x66536b=_0x59ce[_0x480230];return _0x66536b;};'use strict';var Sequelize=require(_0xe59c('0x0'));module[_0xe59c('0x1')]={'name':{'type':Sequelize[_0xe59c('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe59c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 4bb2065..a5ac922 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 _0x4613=['map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','find','get','omit','createdAt','updatedAt','body','create','file','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4613,0x132));var _0x3461=function(_0x3d2d63,_0x46f54a){_0x3d2d63=_0x3d2d63-0x0;var _0x174c1b=_0x4613[_0x3d2d63];return _0x174c1b;};'use strict';var emlformat=require(_0x3461('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3461('0x1'));var jsonpatch=require(_0x3461('0x2'));var rp=require(_0x3461('0x3'));var moment=require(_0x3461('0x4'));var BPromise=require(_0x3461('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3461('0x6'));var sox=require(_0x3461('0x7'));var csv=require(_0x3461('0x8'));var ejs=require(_0x3461('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3461('0xa'));var crypto=require('crypto');var jsforce=require(_0x3461('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3461('0x8'));var querystring=require('querystring');var Papa=require(_0x3461('0xc'));var Redis=require(_0x3461('0xd'));var authService=require(_0x3461('0xe'));var qs=require(_0x3461('0xf'));var as=require(_0x3461('0x10'));var hardwareService=require(_0x3461('0x11'));var logger=require(_0x3461('0x12'))(_0x3461('0x13'));var utils=require(_0x3461('0x14'));var config=require(_0x3461('0x15'));var licenseUtil=require(_0x3461('0x16'));var db=require(_0x3461('0x17'))['db'];function respondWithStatusCode(_0x151793,_0x15e91f){_0x15e91f=_0x15e91f||0xcc;return function(_0x4d6a03){if(_0x4d6a03){return _0x151793[_0x3461('0x18')](_0x15e91f);}return _0x151793[_0x3461('0x19')](_0x15e91f)['end']();};}function respondWithResult(_0x5abc9d,_0x25a0fb){_0x25a0fb=_0x25a0fb||0xc8;return function(_0x108596){if(_0x108596){return _0x5abc9d[_0x3461('0x19')](_0x25a0fb)['json'](_0x108596);}};}function respondWithFilteredResult(_0x2bd875,_0x59a761){return function(_0x1eaf8e){if(_0x1eaf8e){var _0x33ed1d=typeof _0x59a761['offset']===_0x3461('0x1a')&&typeof _0x59a761[_0x3461('0x1b')]===_0x3461('0x1a');var _0x29212e=_0x1eaf8e[_0x3461('0x1c')];var _0x612a50=_0x33ed1d?0x0:_0x59a761[_0x3461('0x1d')];var _0x5c70d2=_0x33ed1d?_0x1eaf8e['count']:_0x59a761[_0x3461('0x1d')]+_0x59a761[_0x3461('0x1b')];var _0x5602d2;if(_0x5c70d2>=_0x29212e){_0x5c70d2=_0x29212e;_0x5602d2=0xc8;}else{_0x5602d2=0xce;}_0x2bd875[_0x3461('0x19')](_0x5602d2);return _0x2bd875[_0x3461('0x1e')](_0x3461('0x1f'),_0x612a50+'-'+_0x5c70d2+'/'+_0x29212e)[_0x3461('0x20')](_0x1eaf8e);}return null;};}function patchUpdates(_0x1566ce){return function(_0x4d65db){try{jsonpatch['apply'](_0x4d65db,_0x1566ce,!![]);}catch(_0x6f160c){return BPromise[_0x3461('0x21')](_0x6f160c);}return _0x4d65db[_0x3461('0x22')]();};}function saveUpdates(_0x46cfde,_0x105877){return function(_0x7f63b2){if(_0x7f63b2){return _0x7f63b2[_0x3461('0x23')](_0x46cfde)[_0x3461('0x24')](function(_0x1754ff){return _0x1754ff;});}return null;};}function removeEntity(_0x4810ab,_0xde44d2){return function(_0xeffed2){if(_0xeffed2){return _0xeffed2[_0x3461('0x25')]()[_0x3461('0x24')](function(){_0x4810ab[_0x3461('0x19')](0xcc)[_0x3461('0x26')]();});}};}function handleEntityNotFound(_0x415acc,_0x56ba88){return function(_0x108790){if(!_0x108790){_0x415acc[_0x3461('0x18')](0x194);}return _0x108790;};}function handleError(_0x2e8542,_0x244441){_0x244441=_0x244441||0x1f4;return function(_0x91e82e){logger['error'](_0x91e82e[_0x3461('0x27')]);if(_0x91e82e[_0x3461('0x28')]){delete _0x91e82e['name'];}_0x2e8542[_0x3461('0x19')](_0x244441)['send'](_0x91e82e);};}exports[_0x3461('0x29')]=function(_0x19aff0,_0x1babaf){var _0x118e82={},_0x20fd46={},_0x498d8f={'count':0x0,'rows':[]};var _0x535d51=_[_0x3461('0x2a')](db[_0x3461('0x2b')][_0x3461('0x2c')],function(_0xb5a71){return{'name':_0xb5a71[_0x3461('0x2d')],'type':_0xb5a71[_0x3461('0x2e')][_0x3461('0x2f')]};});_0x20fd46[_0x3461('0x30')]=_[_0x3461('0x2a')](_0x535d51,_0x3461('0x28'));_0x20fd46['query']=_[_0x3461('0x31')](_0x19aff0[_0x3461('0x32')]);_0x20fd46[_0x3461('0x33')]=_[_0x3461('0x34')](_0x20fd46['model'],_0x20fd46[_0x3461('0x32')]);_0x118e82[_0x3461('0x35')]=_['intersection'](_0x20fd46[_0x3461('0x30')],qs['fields'](_0x19aff0['query'][_0x3461('0x36')]));_0x118e82[_0x3461('0x35')]=_0x118e82[_0x3461('0x35')]['length']?_0x118e82[_0x3461('0x35')]:_0x20fd46['model'];if(!_0x19aff0[_0x3461('0x32')][_0x3461('0x37')]('nolimit')){_0x118e82[_0x3461('0x1b')]=qs[_0x3461('0x1b')](_0x19aff0[_0x3461('0x32')][_0x3461('0x1b')]);_0x118e82[_0x3461('0x1d')]=qs['offset'](_0x19aff0[_0x3461('0x32')][_0x3461('0x1d')]);}_0x118e82['order']=qs[_0x3461('0x38')](_0x19aff0['query'][_0x3461('0x38')]);_0x118e82[_0x3461('0x39')]=qs[_0x3461('0x33')](_['pick'](_0x19aff0[_0x3461('0x32')],_0x20fd46['filters']),_0x535d51);if(_0x19aff0[_0x3461('0x32')][_0x3461('0x3a')]){_0x118e82[_0x3461('0x39')]=_[_0x3461('0x3b')](_0x118e82['where'],{'$or':_[_0x3461('0x2a')](_0x535d51,function(_0x3c785d){if(_0x3c785d[_0x3461('0x2e')]!==_0x3461('0x3c')){var _0x528496={};_0x528496[_0x3c785d[_0x3461('0x28')]]={'$like':'%'+_0x19aff0[_0x3461('0x32')][_0x3461('0x3a')]+'%'};return _0x528496;}})});}_0x118e82=_[_0x3461('0x3b')]({},_0x118e82,_0x19aff0['options']);var _0xc5d3fc={'where':_0x118e82[_0x3461('0x39')]};return db[_0x3461('0x2b')][_0x3461('0x1c')](_0xc5d3fc)[_0x3461('0x24')](function(_0x72f028){_0x498d8f[_0x3461('0x1c')]=_0x72f028;if(_0x19aff0[_0x3461('0x32')]['includeAll']){_0x118e82[_0x3461('0x3d')]=[{'all':!![]}];}return db[_0x3461('0x2b')][_0x3461('0x3e')](_0x118e82);})[_0x3461('0x24')](function(_0x49ee94){_0x498d8f[_0x3461('0x3f')]=_0x49ee94;return _0x498d8f;})[_0x3461('0x24')](respondWithFilteredResult(_0x1babaf,_0x118e82))[_0x3461('0x40')](handleError(_0x1babaf,null));};exports[_0x3461('0x41')]=function(_0x1b9ef8,_0x367799){var _0x28ca5c={'raw':!![],'where':{'id':_0x1b9ef8[_0x3461('0x42')]['id']}},_0x56fe9c={};_0x56fe9c[_0x3461('0x30')]=_[_0x3461('0x31')](db['Attachment']['rawAttributes']);_0x56fe9c[_0x3461('0x32')]=_[_0x3461('0x31')](_0x1b9ef8[_0x3461('0x32')]);_0x56fe9c['filters']=_[_0x3461('0x34')](_0x56fe9c['model'],_0x56fe9c[_0x3461('0x32')]);_0x28ca5c[_0x3461('0x35')]=_[_0x3461('0x34')](_0x56fe9c[_0x3461('0x30')],qs[_0x3461('0x36')](_0x1b9ef8['query'][_0x3461('0x36')]));_0x28ca5c['attributes']=_0x28ca5c[_0x3461('0x35')][_0x3461('0x43')]?_0x28ca5c[_0x3461('0x35')]:_0x56fe9c['model'];if(_0x1b9ef8[_0x3461('0x32')][_0x3461('0x44')]){_0x28ca5c['include']=[{'all':!![]}];}_0x28ca5c=_[_0x3461('0x3b')]({},_0x28ca5c,_0x1b9ef8[_0x3461('0x45')]);return db[_0x3461('0x2b')][_0x3461('0x46')](_0x28ca5c)[_0x3461('0x24')](handleEntityNotFound(_0x367799,null))[_0x3461('0x24')](respondWithResult(_0x367799,null))[_0x3461('0x40')](handleError(_0x367799,null));};exports['clone']=function(_0x47919e,_0x21a73b){var _0x225fb1={'where':{'id':_0x47919e[_0x3461('0x42')]['id']}},_0x2a9495={};_0x2a9495[_0x3461('0x30')]=_[_0x3461('0x31')](db[_0x3461('0x2b')][_0x3461('0x2c')]);_0x225fb1['attributes']=_['intersection'](_0x2a9495[_0x3461('0x30')],qs['fields'](_0x47919e['query'][_0x3461('0x36')]));_0x225fb1[_0x3461('0x35')]=_0x225fb1['attributes'][_0x3461('0x43')]?_0x225fb1[_0x3461('0x35')]:_0x2a9495[_0x3461('0x30')];if(_0x47919e['query']['includeAll']){_0x225fb1[_0x3461('0x3d')]=[{'all':!![]}];}_0x225fb1=_['merge']({},_0x225fb1,_0x47919e[_0x3461('0x45')]);return db['Attachment']['find'](_0x225fb1)[_0x3461('0x24')](handleEntityNotFound(_0x21a73b,null))[_0x3461('0x24')](function(_0x5d4a60){if(_0x5d4a60){var _0x5df507=_0x5d4a60[_0x3461('0x47')]({'plain':!![]});_0x5df507=qs[_0x3461('0x48')](_0x5df507,['id',_0x3461('0x49'),_0x3461('0x4a')]);_0x47919e[_0x3461('0x4b')]=_['omit'](_0x47919e['body'],['id',_0x3461('0x49'),_0x3461('0x4a')]);return db[_0x3461('0x2b')][_0x3461('0x4c')](_[_0x3461('0x3b')](_0x5df507,_0x47919e[_0x3461('0x4b')]),{'include':_0x47919e[_0x3461('0x32')][_0x3461('0x44')]?[{'all':!![]}]:undefined});}})[_0x3461('0x24')](respondWithResult(_0x21a73b,0xc9))[_0x3461('0x40')](handleError(_0x21a73b,null));};exports[_0x3461('0x23')]=function(_0x13a14c,_0x181b72){if(_0x13a14c[_0x3461('0x4b')]['id']){delete _0x13a14c['body']['id'];}return db[_0x3461('0x2b')][_0x3461('0x46')]({'where':{'id':_0x13a14c[_0x3461('0x42')]['id']}})[_0x3461('0x24')](handleEntityNotFound(_0x181b72,null))['then'](saveUpdates(_0x13a14c['body'],null))[_0x3461('0x24')](respondWithResult(_0x181b72,null))[_0x3461('0x40')](handleError(_0x181b72,null));};exports[_0x3461('0x25')]=function(_0xde33ab,_0x4772c8){return db[_0x3461('0x2b')][_0x3461('0x46')]({'where':{'id':_0xde33ab[_0x3461('0x42')]['id']}})[_0x3461('0x24')](handleEntityNotFound(_0x4772c8,null))['then'](removeEntity(_0x4772c8,null))[_0x3461('0x40')](handleError(_0x4772c8,null));};exports[_0x3461('0x4c')]=function(_0x2ea01f,_0x4ad5e2,_0x247b1c){_0x2ea01f[_0x3461('0x4b')][_0x3461('0x28')]=_0x2ea01f[_0x3461('0x4d')]['originalname'];_0x2ea01f[_0x3461('0x4b')]['basename']=_0x2ea01f[_0x3461('0x4d')][_0x3461('0x4e')];_0x2ea01f['body']['type']=_0x2ea01f['file']['mimetype'];return db['Attachment'][_0x3461('0x4c')](_0x2ea01f[_0x3461('0x4b')])['then'](respondWithResult(_0x4ad5e2,0xc9))[_0x3461('0x40')](handleError(_0x4ad5e2,null));};exports[_0x3461('0x4f')]=function(_0x36123f,_0x264d68,_0x457a6f){return db[_0x3461('0x2b')][_0x3461('0x50')]({'where':{'id':_0x36123f['params']['id']},'raw':!![]})[_0x3461('0x24')](handleEntityNotFound(_0x264d68,null))[_0x3461('0x24')](function(_0x1b742d){if(_0x1b742d){var _0x3f8602=_0x1b742d[_0x3461('0x51')]!==null;var _0x31d9dc=path[_0x3461('0x52')](config[_0x3461('0x53')],_0x3461('0x54'));if(_0x3f8602){_0x31d9dc=path['join'](_0x31d9dc,_0x3461('0x55'));}var _0x2bc3b1=path[_0x3461('0x52')](_0x31d9dc,_0x1b742d[_0x3461('0x56')]);return _0x264d68[_0x3461('0x4f')](_0x2bc3b1);}})[_0x3461('0x40')](handleError(_0x264d68,null));}; \ No newline at end of file +var _0x44ec=['catch','show','params','length','clone','get','createdAt','updatedAt','body','find','create','basename','file','filename','download','findOne','root','join','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','update','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows'];(function(_0x2a347c,_0x51773c){var _0x8513df=function(_0x145725){while(--_0x145725){_0x2a347c['push'](_0x2a347c['shift']());}};_0x8513df(++_0x51773c);}(_0x44ec,0xbe));var _0xc44e=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x44ec[_0x4a3ee3];return _0x56d16d;};'use strict';var emlformat=require(_0xc44e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc44e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc44e('0x2'));var moment=require(_0xc44e('0x3'));var BPromise=require(_0xc44e('0x4'));var Mustache=require(_0xc44e('0x5'));var util=require('util');var path=require(_0xc44e('0x6'));var sox=require(_0xc44e('0x7'));var csv=require(_0xc44e('0x8'));var ejs=require(_0xc44e('0x9'));var fs=require('fs');var fs_extra=require(_0xc44e('0xa'));var _=require(_0xc44e('0xb'));var squel=require(_0xc44e('0xc'));var crypto=require(_0xc44e('0xd'));var jsforce=require(_0xc44e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc44e('0x8'));var querystring=require(_0xc44e('0xf'));var Papa=require(_0xc44e('0x10'));var Redis=require('ioredis');var authService=require(_0xc44e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc44e('0x12'));var hardwareService=require(_0xc44e('0x13'));var logger=require(_0xc44e('0x14'))(_0xc44e('0x15'));var utils=require(_0xc44e('0x16'));var config=require(_0xc44e('0x17'));var licenseUtil=require(_0xc44e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196db8,_0x218f47){_0x218f47=_0x218f47||0xcc;return function(_0x3f0783){if(_0x3f0783){return _0x196db8[_0xc44e('0x19')](_0x218f47);}return _0x196db8[_0xc44e('0x1a')](_0x218f47)[_0xc44e('0x1b')]();};}function respondWithResult(_0x351e0d,_0x4f79e2){_0x4f79e2=_0x4f79e2||0xc8;return function(_0x21ac2c){if(_0x21ac2c){return _0x351e0d['status'](_0x4f79e2)['json'](_0x21ac2c);}};}function respondWithFilteredResult(_0x357adc,_0x3aa140){return function(_0x3ca032){if(_0x3ca032){var _0x403c7a=typeof _0x3aa140[_0xc44e('0x1c')]===_0xc44e('0x1d')&&typeof _0x3aa140['limit']==='undefined';var _0x4225e2=_0x3ca032[_0xc44e('0x1e')];var _0x61baca=_0x403c7a?0x0:_0x3aa140[_0xc44e('0x1c')];var _0x233319=_0x403c7a?_0x3ca032[_0xc44e('0x1e')]:_0x3aa140['offset']+_0x3aa140['limit'];var _0x57ae1f;if(_0x233319>=_0x4225e2){_0x233319=_0x4225e2;_0x57ae1f=0xc8;}else{_0x57ae1f=0xce;}_0x357adc[_0xc44e('0x1a')](_0x57ae1f);return _0x357adc[_0xc44e('0x1f')](_0xc44e('0x20'),_0x61baca+'-'+_0x233319+'/'+_0x4225e2)[_0xc44e('0x21')](_0x3ca032);}return null;};}function patchUpdates(_0x5f2346){return function(_0x58fcb2){try{jsonpatch[_0xc44e('0x22')](_0x58fcb2,_0x5f2346,!![]);}catch(_0x5ca810){return BPromise['reject'](_0x5ca810);}return _0x58fcb2['save']();};}function saveUpdates(_0x3744dc,_0x25f8ef){return function(_0x5ed0c2){if(_0x5ed0c2){return _0x5ed0c2[_0xc44e('0x23')](_0x3744dc)['then'](function(_0x3d6b13){return _0x3d6b13;});}return null;};}function removeEntity(_0x4b9c9e,_0x5dfa8a){return function(_0x4a4856){if(_0x4a4856){return _0x4a4856[_0xc44e('0x24')]()['then'](function(){_0x4b9c9e[_0xc44e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d478,_0x1393b7){return function(_0x29a84f){if(!_0x29a84f){_0x30d478[_0xc44e('0x19')](0x194);}return _0x29a84f;};}function handleError(_0x369b02,_0xf43631){_0xf43631=_0xf43631||0x1f4;return function(_0x52b75a){logger[_0xc44e('0x25')](_0x52b75a[_0xc44e('0x26')]);if(_0x52b75a['name']){delete _0x52b75a[_0xc44e('0x27')];}_0x369b02[_0xc44e('0x1a')](_0xf43631)[_0xc44e('0x28')](_0x52b75a);};}exports[_0xc44e('0x29')]=function(_0x530700,_0x330799){var _0x50bf8e={},_0x3fcd2c={},_0x493047={'count':0x0,'rows':[]};var _0xdf5dfe=_[_0xc44e('0x2a')](db[_0xc44e('0x2b')][_0xc44e('0x2c')],function(_0x195614){return{'name':_0x195614[_0xc44e('0x2d')],'type':_0x195614[_0xc44e('0x2e')]['key']};});_0x3fcd2c[_0xc44e('0x2f')]=_[_0xc44e('0x2a')](_0xdf5dfe,_0xc44e('0x27'));_0x3fcd2c[_0xc44e('0x30')]=_[_0xc44e('0x31')](_0x530700[_0xc44e('0x30')]);_0x3fcd2c['filters']=_[_0xc44e('0x32')](_0x3fcd2c[_0xc44e('0x2f')],_0x3fcd2c[_0xc44e('0x30')]);_0x50bf8e[_0xc44e('0x33')]=_['intersection'](_0x3fcd2c[_0xc44e('0x2f')],qs[_0xc44e('0x34')](_0x530700[_0xc44e('0x30')]['fields']));_0x50bf8e[_0xc44e('0x33')]=_0x50bf8e['attributes']['length']?_0x50bf8e[_0xc44e('0x33')]:_0x3fcd2c['model'];if(!_0x530700[_0xc44e('0x30')][_0xc44e('0x35')]('nolimit')){_0x50bf8e['limit']=qs['limit'](_0x530700['query'][_0xc44e('0x36')]);_0x50bf8e[_0xc44e('0x1c')]=qs[_0xc44e('0x1c')](_0x530700['query'][_0xc44e('0x1c')]);}_0x50bf8e[_0xc44e('0x37')]=qs['sort'](_0x530700['query'][_0xc44e('0x38')]);_0x50bf8e[_0xc44e('0x39')]=qs[_0xc44e('0x3a')](_['pick'](_0x530700['query'],_0x3fcd2c[_0xc44e('0x3a')]),_0xdf5dfe);if(_0x530700[_0xc44e('0x30')]['filter']){_0x50bf8e[_0xc44e('0x39')]=_[_0xc44e('0x3b')](_0x50bf8e[_0xc44e('0x39')],{'$or':_[_0xc44e('0x2a')](_0xdf5dfe,function(_0x52205f){if(_0x52205f[_0xc44e('0x2e')]!==_0xc44e('0x3c')){var _0x637cb0={};_0x637cb0[_0x52205f[_0xc44e('0x27')]]={'$like':'%'+_0x530700[_0xc44e('0x30')][_0xc44e('0x3d')]+'%'};return _0x637cb0;}})});}_0x50bf8e=_['merge']({},_0x50bf8e,_0x530700[_0xc44e('0x3e')]);var _0x3236a5={'where':_0x50bf8e[_0xc44e('0x39')]};return db[_0xc44e('0x2b')][_0xc44e('0x1e')](_0x3236a5)[_0xc44e('0x3f')](function(_0x3f92c2){_0x493047[_0xc44e('0x1e')]=_0x3f92c2;if(_0x530700[_0xc44e('0x30')][_0xc44e('0x40')]){_0x50bf8e[_0xc44e('0x41')]=[{'all':!![]}];}return db[_0xc44e('0x2b')][_0xc44e('0x42')](_0x50bf8e);})[_0xc44e('0x3f')](function(_0x49768c){_0x493047[_0xc44e('0x43')]=_0x49768c;return _0x493047;})[_0xc44e('0x3f')](respondWithFilteredResult(_0x330799,_0x50bf8e))[_0xc44e('0x44')](handleError(_0x330799,null));};exports[_0xc44e('0x45')]=function(_0x469ccf,_0x5086ae){var _0x32e127={'raw':!![],'where':{'id':_0x469ccf[_0xc44e('0x46')]['id']}},_0x490e08={};_0x490e08[_0xc44e('0x2f')]=_[_0xc44e('0x31')](db[_0xc44e('0x2b')][_0xc44e('0x2c')]);_0x490e08['query']=_['keys'](_0x469ccf[_0xc44e('0x30')]);_0x490e08[_0xc44e('0x3a')]=_['intersection'](_0x490e08[_0xc44e('0x2f')],_0x490e08['query']);_0x32e127[_0xc44e('0x33')]=_[_0xc44e('0x32')](_0x490e08[_0xc44e('0x2f')],qs['fields'](_0x469ccf[_0xc44e('0x30')][_0xc44e('0x34')]));_0x32e127[_0xc44e('0x33')]=_0x32e127[_0xc44e('0x33')][_0xc44e('0x47')]?_0x32e127[_0xc44e('0x33')]:_0x490e08[_0xc44e('0x2f')];if(_0x469ccf[_0xc44e('0x30')][_0xc44e('0x40')]){_0x32e127[_0xc44e('0x41')]=[{'all':!![]}];}_0x32e127=_[_0xc44e('0x3b')]({},_0x32e127,_0x469ccf[_0xc44e('0x3e')]);return db[_0xc44e('0x2b')]['find'](_0x32e127)[_0xc44e('0x3f')](handleEntityNotFound(_0x5086ae,null))[_0xc44e('0x3f')](respondWithResult(_0x5086ae,null))[_0xc44e('0x44')](handleError(_0x5086ae,null));};exports[_0xc44e('0x48')]=function(_0xe7d2f4,_0x6b7df5){var _0x537906={'where':{'id':_0xe7d2f4[_0xc44e('0x46')]['id']}},_0x1c359e={};_0x1c359e[_0xc44e('0x2f')]=_['keys'](db[_0xc44e('0x2b')][_0xc44e('0x2c')]);_0x537906[_0xc44e('0x33')]=_[_0xc44e('0x32')](_0x1c359e['model'],qs[_0xc44e('0x34')](_0xe7d2f4[_0xc44e('0x30')][_0xc44e('0x34')]));_0x537906[_0xc44e('0x33')]=_0x537906[_0xc44e('0x33')][_0xc44e('0x47')]?_0x537906[_0xc44e('0x33')]:_0x1c359e['model'];if(_0xe7d2f4[_0xc44e('0x30')][_0xc44e('0x40')]){_0x537906[_0xc44e('0x41')]=[{'all':!![]}];}_0x537906=_[_0xc44e('0x3b')]({},_0x537906,_0xe7d2f4['options']);return db[_0xc44e('0x2b')]['find'](_0x537906)[_0xc44e('0x3f')](handleEntityNotFound(_0x6b7df5,null))['then'](function(_0x1bd2af){if(_0x1bd2af){var _0x37c442=_0x1bd2af[_0xc44e('0x49')]({'plain':!![]});_0x37c442=qs['omit'](_0x37c442,['id',_0xc44e('0x4a'),_0xc44e('0x4b')]);_0xe7d2f4[_0xc44e('0x4c')]=_['omit'](_0xe7d2f4[_0xc44e('0x4c')],['id',_0xc44e('0x4a'),_0xc44e('0x4b')]);return db[_0xc44e('0x2b')]['create'](_[_0xc44e('0x3b')](_0x37c442,_0xe7d2f4[_0xc44e('0x4c')]),{'include':_0xe7d2f4['query'][_0xc44e('0x40')]?[{'all':!![]}]:undefined});}})[_0xc44e('0x3f')](respondWithResult(_0x6b7df5,0xc9))[_0xc44e('0x44')](handleError(_0x6b7df5,null));};exports[_0xc44e('0x23')]=function(_0x3a30e1,_0x18e35a){if(_0x3a30e1[_0xc44e('0x4c')]['id']){delete _0x3a30e1[_0xc44e('0x4c')]['id'];}return db[_0xc44e('0x2b')][_0xc44e('0x4d')]({'where':{'id':_0x3a30e1[_0xc44e('0x46')]['id']}})[_0xc44e('0x3f')](handleEntityNotFound(_0x18e35a,null))[_0xc44e('0x3f')](saveUpdates(_0x3a30e1[_0xc44e('0x4c')],null))['then'](respondWithResult(_0x18e35a,null))[_0xc44e('0x44')](handleError(_0x18e35a,null));};exports[_0xc44e('0x24')]=function(_0x156230,_0x4f1f74){return db[_0xc44e('0x2b')][_0xc44e('0x4d')]({'where':{'id':_0x156230[_0xc44e('0x46')]['id']}})[_0xc44e('0x3f')](handleEntityNotFound(_0x4f1f74,null))[_0xc44e('0x3f')](removeEntity(_0x4f1f74,null))[_0xc44e('0x44')](handleError(_0x4f1f74,null));};exports[_0xc44e('0x4e')]=function(_0x4ed7b3,_0x48f95c,_0x829d7c){_0x4ed7b3[_0xc44e('0x4c')][_0xc44e('0x27')]=_0x4ed7b3['file']['originalname'];_0x4ed7b3[_0xc44e('0x4c')][_0xc44e('0x4f')]=_0x4ed7b3[_0xc44e('0x50')][_0xc44e('0x51')];_0x4ed7b3[_0xc44e('0x4c')][_0xc44e('0x2e')]=_0x4ed7b3[_0xc44e('0x50')]['mimetype'];return db['Attachment'][_0xc44e('0x4e')](_0x4ed7b3[_0xc44e('0x4c')])[_0xc44e('0x3f')](respondWithResult(_0x48f95c,0xc9))[_0xc44e('0x44')](handleError(_0x48f95c,null));};exports[_0xc44e('0x52')]=function(_0x1a16c4,_0x4a368a,_0x5eac88){return db[_0xc44e('0x2b')][_0xc44e('0x53')]({'where':{'id':_0x1a16c4[_0xc44e('0x46')]['id']},'raw':!![]})[_0xc44e('0x3f')](handleEntityNotFound(_0x4a368a,null))['then'](function(_0x19198a){if(_0x19198a){var _0x4622d2=_0x19198a['ChatOfflineMessageId']!==null;var _0x256b7d=path['join'](config[_0xc44e('0x54')],'server/files/attachments/');if(_0x4622d2){_0x256b7d=path[_0xc44e('0x55')](_0x256b7d,'offline-chat/');}var _0x4535d6=path[_0xc44e('0x55')](_0x256b7d,_0x19198a[_0xc44e('0x4f')]);return _0x4a368a[_0xc44e('0x52')](_0x4535d6);}})[_0xc44e('0x44')](handleError(_0x4a368a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e7eadc2..676f420 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 _0x10f9=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x559e0f,_0x52c967){var _0x419d5e=function(_0x32e8f4){while(--_0x32e8f4){_0x559e0f['push'](_0x559e0f['shift']());}};_0x419d5e(++_0x52c967);}(_0x10f9,0xb6));var _0x910f=function(_0x292c26,_0x509fd9){_0x292c26=_0x292c26-0x0;var _0x50bbf2=_0x10f9[_0x292c26];return _0x50bbf2;};'use strict';var _=require(_0x910f('0x0'));var util=require(_0x910f('0x1'));var logger=require(_0x910f('0x2'))('api');var moment=require(_0x910f('0x3'));var BPromise=require(_0x910f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x910f('0x5'));var rimraf=require(_0x910f('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module['exports']=function(_0x154242,_0x271326){return _0x154242['define'](_0x910f('0x7'),attributes,{'tableName':_0x910f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc840=['path','../../config/environment','exports','attachments','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d9827,_0x38088e){var _0x5b1cfc=function(_0x379e48){while(--_0x379e48){_0x3d9827['push'](_0x3d9827['shift']());}};_0x5b1cfc(++_0x38088e);}(_0xc840,0x16c));var _0x0c84=function(_0x530edf,_0x383e86){_0x530edf=_0x530edf-0x0;var _0x3863d0=_0xc840[_0x530edf];return _0x3863d0;};'use strict';var _=require('lodash');var util=require(_0x0c84('0x0'));var logger=require(_0x0c84('0x1'))(_0x0c84('0x2'));var moment=require(_0x0c84('0x3'));var BPromise=require(_0x0c84('0x4'));var rp=require(_0x0c84('0x5'));var fs=require('fs');var path=require(_0x0c84('0x6'));var rimraf=require('rimraf');var config=require(_0x0c84('0x7'));var attributes=require('./attachment.attributes');module[_0x0c84('0x8')]=function(_0x28d366,_0xdaf743){return _0x28d366['define']('Attachment',attributes,{'tableName':_0x0c84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index d1f6464..f602a82 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 _0x9f3e=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x26b5eb,_0x4883bd){_0x26b5eb=_0x26b5eb-0x0;var _0xa29cbc=_0x9f3e[_0x26b5eb];return _0xa29cbc;};'use strict';var _=require(_0xe9f3('0x0'));var util=require(_0xe9f3('0x1'));var moment=require(_0xe9f3('0x2'));var BPromise=require(_0xe9f3('0x3'));var rs=require(_0xe9f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9f3('0x5'))('rpc');var config=require(_0xe9f3('0x6'));var jayson=require(_0xe9f3('0x7'));var client=jayson[_0xe9f3('0x8')][_0xe9f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e25d,_0x1611eb,_0x407123){return new BPromise(function(_0x4014b1,_0x1fe4af){return client[_0xe9f3('0xa')](_0x46e25d,_0x407123)[_0xe9f3('0xb')](function(_0x30e00e){logger[_0xe9f3('0xc')]('Attachment,\x20%s,\x20%s',_0x1611eb,_0xe9f3('0xd'));logger[_0xe9f3('0xe')](_0xe9f3('0xf'),_0x1611eb,_0xe9f3('0xd'),JSON[_0xe9f3('0x10')](_0x30e00e));if(_0x30e00e['error']){if(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x12')]===0x1f4){logger['error'](_0xe9f3('0x13'),_0x1611eb,_0x30e00e['error'][_0xe9f3('0x14')]);return _0x1fe4af(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x1611eb,_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);return _0x4014b1(_0x30e00e['error'][_0xe9f3('0x14')]);}else{logger[_0xe9f3('0xc')](_0xe9f3('0x13'),_0x1611eb,_0xe9f3('0xd'));_0x4014b1(_0x30e00e[_0xe9f3('0x15')]['message']);}})['catch'](function(_0x32e9ae){logger[_0xe9f3('0x11')](_0xe9f3('0x13'),_0x1611eb,_0x32e9ae);_0x1fe4af(_0x32e9ae);});});}exports[_0xe9f3('0x16')]=function(_0x16b788){var _0x58825e=this;return new Promise(function(_0x1496f,_0x3df9a5){return db['Attachment'][_0xe9f3('0x17')](_0x16b788[_0xe9f3('0x18')],{'raw':_0x16b788[_0xe9f3('0x19')]?_0x16b788[_0xe9f3('0x19')][_0xe9f3('0x1a')]===undefined?!![]:![]:!![]})[_0xe9f3('0xb')](function(_0x3866cc){logger[_0xe9f3('0xc')]('CreateAttachment',_0x16b788);logger[_0xe9f3('0xe')](_0xe9f3('0x16'),_0x16b788,JSON[_0xe9f3('0x10')](_0x3866cc));_0x1496f(_0x3866cc);})['catch'](function(_0x138e5d){logger[_0xe9f3('0x11')](_0xe9f3('0x16'),_0x138e5d['message'],_0x16b788);_0x3df9a5(_0x58825e['error'](0x1f4,_0x138e5d[_0xe9f3('0x14')]));});});}; \ No newline at end of file +var _0x8e0d=['CreateAttachment','Attachment','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Attachment,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x8e0d,0x82));var _0xd8e0=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x8e0d[_0x35fabd];return _0x61a8ee;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8e0('0x1'));var rs=require(_0xd8e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))(_0xd8e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8e0('0x7')][_0xd8e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d42b,_0x1e4616,_0x5e9735){return new BPromise(function(_0xd0c45c,_0x144a8a){return client[_0xd8e0('0x9')](_0x42d42b,_0x5e9735)[_0xd8e0('0xa')](function(_0x127a32){logger['info'](_0xd8e0('0xb'),_0x1e4616,'request\x20sent');logger[_0xd8e0('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1e4616,'request\x20sent',JSON[_0xd8e0('0xd')](_0x127a32));if(_0x127a32[_0xd8e0('0xe')]){if(_0x127a32[_0xd8e0('0xe')]['code']===0x1f4){logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0x144a8a(_0x127a32['error']['message']);}logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0xd0c45c(_0x127a32[_0xd8e0('0xe')][_0xd8e0('0xf')]);}else{logger[_0xd8e0('0x10')](_0xd8e0('0xb'),_0x1e4616,_0xd8e0('0x11'));_0xd0c45c(_0x127a32[_0xd8e0('0x12')][_0xd8e0('0xf')]);}})[_0xd8e0('0x13')](function(_0x488ed9){logger[_0xd8e0('0xe')](_0xd8e0('0xb'),_0x1e4616,_0x488ed9);_0x144a8a(_0x488ed9);});});}exports[_0xd8e0('0x14')]=function(_0x42586f){var _0x3b28bc=this;return new Promise(function(_0x2bf195,_0x2c4eaf){return db[_0xd8e0('0x15')]['create'](_0x42586f[_0xd8e0('0x16')],{'raw':_0x42586f[_0xd8e0('0x17')]?_0x42586f['options'][_0xd8e0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55ce9b){logger['info'](_0xd8e0('0x14'),_0x42586f);logger[_0xd8e0('0xc')]('CreateAttachment',_0x42586f,JSON[_0xd8e0('0xd')](_0x55ce9b));_0x2bf195(_0x55ce9b);})[_0xd8e0('0x13')](function(_0x1d31de){logger[_0xd8e0('0xe')](_0xd8e0('0x14'),_0x1d31de[_0xd8e0('0xf')],_0x42586f);_0x2c4eaf(_0x3b28bc['error'](0x1f4,_0x1d31de[_0xd8e0('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d7f662c..a6d1e8d 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'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 fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1cdbd5,_0x1a6eb6){_0x1cdbd5=_0x1cdbd5-0x0;var _0x37358c=_0xdb28[_0x1cdbd5];return _0x37358c;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1a45265..bf879ce 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 _0x4131=['../../config/utils','login','authenticate','google','profile','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','find','map','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../components/auth/service'];(function(_0x525e62,_0x2b87bc){var _0x12b73c=function(_0x48c95d){while(--_0x48c95d){_0x525e62['push'](_0x525e62['shift']());}};_0x12b73c(++_0x2b87bc);}(_0x4131,0x159));var _0x1413=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0x4131[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require(_0x1413('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x1413('0x1'))[_0x1413('0x2')];var moment=require(_0x1413('0x3'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x1413('0x4'))['signToken'];var utils=require(_0x1413('0x5'));exports[_0x1413('0x6')]=passport[_0x1413('0x7')](_0x1413('0x8'),{'failureRedirect':'/login','scope':[_0x1413('0x9'),_0x1413('0xa')],'session':![]});exports[_0x1413('0xb')]=passport[_0x1413('0x7')]('google',{'failureRedirect':'/login','session':![]});passport[_0x1413('0xc')](new GoogleStrategy({'clientID':config[_0x1413('0x8')]?config[_0x1413('0x8')][_0x1413('0xd')]:'id','clientSecret':config[_0x1413('0x8')]?config[_0x1413('0x8')][_0x1413('0xe')]:_0x1413('0xf'),'callbackURL':config['google']?config[_0x1413('0x8')][_0x1413('0x10')]:''},function(_0x151790,_0x101d1c,_0x45e116,_0x5aac14){var _0x112f44,_0xdde88c;return db[_0x1413('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x1413('0x12'),_0x1413('0x13')],'raw':!![]})[_0x1413('0x14')](function(_0x571d11){_0x112f44=_0x571d11;return db['User'][_0x1413('0x15')]({'where':{'email':_[_0x1413('0x16')](_0x45e116[_0x1413('0x17')],_0x1413('0x18')),'role':{'$or':['admin',_0x1413('0x19'),_0x1413('0x1a')]}}});})[_0x1413('0x14')](function(_0x11521c){_0xdde88c=_0x11521c;if(_0xdde88c){if(_0xdde88c[_0x1413('0x1b')]){return _0x5aac14(_0x1413('0x1c'));}else if(_0x112f44[_0x1413('0x13')]>0x0){if(_0xdde88c[_0x1413('0x1d')]){if(moment(_0xdde88c[_0x1413('0x1e')])['add'](_0x112f44['blockDuration'],_0x1413('0x1f'))>moment()){return _0x5aac14('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x1413('0x20')](_0xdde88c,0x0,![],null)[_0x1413('0x14')](function(){return utils[_0x1413('0x21')](_0xdde88c);})[_0x1413('0x14')](function(){return _0x5aac14(null,_0xdde88c);});}}else{return utils[_0x1413('0x21')](_0xdde88c)[_0x1413('0x14')](function(){return _0x5aac14(null,_0xdde88c);});}}else{return utils[_0x1413('0x21')](_0xdde88c)[_0x1413('0x14')](function(){return _0x5aac14(null,_0xdde88c);});}}return _0x5aac14(_0x1413('0x1c'));})[_0x1413('0x22')](function(_0x50652d){_0x5aac14(_0x50652d);});})); \ No newline at end of file +var _0xcc99=['login','authenticate','profile','email','callback','google','/login','use','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils'];(function(_0x4f3056,_0x50626d){var _0x3f701f=function(_0x12a4ed){while(--_0x12a4ed){_0x4f3056['push'](_0x4f3056['shift']());}};_0x3f701f(++_0x50626d);}(_0xcc99,0x147));var _0x9cc9=function(_0x184a8f,_0x488d39){_0x184a8f=_0x184a8f-0x0;var _0x558ca3=_0xcc99[_0x184a8f];return _0x558ca3;};'use strict';var _=require(_0x9cc9('0x0'));var passport=require(_0x9cc9('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require('moment');var db=require(_0x9cc9('0x2'))['db'];var config=require(_0x9cc9('0x3'));var signToken=require(_0x9cc9('0x4'))['signToken'];var utils=require(_0x9cc9('0x5'));exports[_0x9cc9('0x6')]=passport[_0x9cc9('0x7')]('google',{'failureRedirect':'/login','scope':[_0x9cc9('0x8'),_0x9cc9('0x9')],'session':![]});exports[_0x9cc9('0xa')]=passport['authenticate'](_0x9cc9('0xb'),{'failureRedirect':_0x9cc9('0xc'),'session':![]});passport[_0x9cc9('0xd')](new GoogleStrategy({'clientID':config[_0x9cc9('0xb')]?config[_0x9cc9('0xb')][_0x9cc9('0xe')]:'id','clientSecret':config[_0x9cc9('0xb')]?config[_0x9cc9('0xb')][_0x9cc9('0xf')]:_0x9cc9('0x10'),'callbackURL':config[_0x9cc9('0xb')]?config[_0x9cc9('0xb')][_0x9cc9('0x11')]:''},function(_0x27eb00,_0x2ba838,_0x8ab2cc,_0x45954f){var _0x4968de,_0xfbe518;return db[_0x9cc9('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x9cc9('0x13'),_0x9cc9('0x14')],'raw':!![]})[_0x9cc9('0x15')](function(_0x23251a){_0x4968de=_0x23251a;return db[_0x9cc9('0x16')][_0x9cc9('0x17')]({'where':{'email':_[_0x9cc9('0x18')](_0x8ab2cc[_0x9cc9('0x19')],_0x9cc9('0x1a')),'role':{'$or':[_0x9cc9('0x1b'),'user',_0x9cc9('0x1c')]}}});})[_0x9cc9('0x15')](function(_0x416ff6){_0xfbe518=_0x416ff6;if(_0xfbe518){if(_0xfbe518[_0x9cc9('0x1d')]){return _0x45954f(_0x9cc9('0x1e'));}else if(_0x4968de[_0x9cc9('0x14')]>0x0){if(_0xfbe518['blocked']){if(moment(_0xfbe518[_0x9cc9('0x1f')])[_0x9cc9('0x20')](_0x4968de[_0x9cc9('0x14')],_0x9cc9('0x21'))>moment()){return _0x45954f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x9cc9('0x22')](_0xfbe518,0x0,![],null)[_0x9cc9('0x15')](function(){return utils['getLicense'](_0xfbe518);})['then'](function(){return _0x45954f(null,_0xfbe518);});}}else{return utils['getLicense'](_0xfbe518)[_0x9cc9('0x15')](function(){return _0x45954f(null,_0xfbe518);});}}else{return utils[_0x9cc9('0x23')](_0xfbe518)['then'](function(){return _0x45954f(null,_0xfbe518);});}}return _0x45954f(_0x9cc9('0x1e'));})[_0x9cc9('0x24')](function(_0x33037a){_0x45954f(_0x33037a);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 15fe284..4adf3de 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 _0x2c1a=['./authGoogle.controller','login','/callback','callback','setTokenCookie','exports','express','passport'];(function(_0x1bc4d3,_0x9bb12f){var _0x506aa1=function(_0x55d3ca){while(--_0x55d3ca){_0x1bc4d3['push'](_0x1bc4d3['shift']());}};_0x506aa1(++_0x9bb12f);}(_0x2c1a,0x96));var _0xa2c1=function(_0x19fb9f,_0x2e105c){_0x19fb9f=_0x19fb9f-0x0;var _0x16ce95=_0x2c1a[_0x19fb9f];return _0x16ce95;};'use strict';var express=require(_0xa2c1('0x0'));var passport=require(_0xa2c1('0x1'));var router=express['Router']();var controller=require(_0xa2c1('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0xa2c1('0x3')]);router['get'](_0xa2c1('0x4'),controller[_0xa2c1('0x5')],authService['isMiddleware'],userController['login'],authService[_0xa2c1('0x6')]);module[_0xa2c1('0x7')]=router; \ No newline at end of file +var _0xe6c1=['Router','./authGoogle.controller','get','login','setTokenCookie','exports','passport'];(function(_0xd46674,_0x1b70b6){var _0x4fa486=function(_0x2bba2d){while(--_0x2bba2d){_0xd46674['push'](_0xd46674['shift']());}};_0x4fa486(++_0x1b70b6);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var passport=require(_0x1e6c('0x0'));var router=express[_0x1e6c('0x1')]();var controller=require(_0x1e6c('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x1e6c('0x3')]('/',controller[_0x1e6c('0x4')]);router[_0x1e6c('0x3')]('/callback',controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x1e6c('0x5')]);module[_0x1e6c('0x6')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3344d41..d8b6106 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 _0xbe31=['clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','error','message','stringify','status','send','login','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','then','authenticate','loginAttempts','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x9faac0,_0x2b4236){var _0x629a26=function(_0xe6e791){while(--_0xe6e791){_0x9faac0['push'](_0x9faac0['shift']());}};_0x629a26(++_0x2b4236);}(_0xbe31,0x83));var _0x1be3=function(_0x4de934,_0x460088){_0x4de934=_0x4de934-0x0;var _0x28110b=_0xbe31[_0x4de934];return _0x28110b;};'use strict';var util=require('util');var passport=require(_0x1be3('0x0'));var LocalStrategy=require(_0x1be3('0x1'))[_0x1be3('0x2')];var jayson=require(_0x1be3('0x3'));var _=require(_0x1be3('0x4'));var rs=require(_0x1be3('0x5'));var moment=require(_0x1be3('0x6'));var db=require(_0x1be3('0x7'))['db'];var authService=require(_0x1be3('0x8'));var utils=require('../../config/utils');var client=jayson[_0x1be3('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x1f09ec,_0xa757b9,_0x3c925a,_0x2c3965){var _0x2bb749,_0x2e4488;return db[_0x1be3('0xa')][_0x1be3('0xb')]({'where':{'id':0x1},'attributes':[_0x1be3('0xc'),_0x1be3('0xd')],'raw':!![]})['then'](function(_0x1fc80e){_0x2bb749=_0x1fc80e;return _0x1f09ec[_0x1be3('0xb')]({'attributes':['id',_0x1be3('0xe'),_0x1be3('0xf'),_0x1be3('0x10'),_0x1be3('0x11'),_0x1be3('0x12'),_0x1be3('0x13'),_0x1be3('0x14'),'loginAttempts'],'where':{'name':_0xa757b9,'role':{'$or':[_0x1be3('0x15'),'user',_0x1be3('0x16')]}}});})[_0x1be3('0x17')](function(_0x4bea94){if(!_0x4bea94||_0x4bea94&&_0x4bea94[_0x1be3('0xe')]!==_0xa757b9){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2e4488=_0x4bea94;return _0x2e4488;}})[_0x1be3('0x17')](function(){_0x2e4488[_0x1be3('0x18')](_0x3c925a,function(_0x3658ce,_0xd30cd){var _0x1156bc=_0x2e4488[_0x1be3('0x19')]+0x1;if(_0x3658ce){return _0x2c3965(_0x3658ce);}else if(!_0xd30cd){if(_0x2e4488['disabled']){return _0x2c3965(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2bb749['allowedLoginAttempts']>0x0){if(_0x2e4488['blocked']){if(_0x2bb749[_0x1be3('0xd')]>0x0){if(moment(_0x2e4488['blockedAt'])[_0x1be3('0x1a')](_0x2bb749[_0x1be3('0xd')],_0x1be3('0x1b'))>moment()){return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});}else{return utils[_0x1be3('0x1d')](_0x2e4488,_0x1156bc,![],null)[_0x1be3('0x17')](function(){return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});});}}else{return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});}}else{if(_0x1156bc>=_0x2bb749[_0x1be3('0xc')]){return utils[_0x1be3('0x1d')](_0x2e4488,0x0,!![],moment())[_0x1be3('0x17')](function(){return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});});}else{return utils['clearBlockUser'](_0x2e4488,_0x1156bc,![],null)['then'](function(){return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});});}}}else{return _0x2c3965(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e4488[_0x1be3('0x12')]){return _0x2c3965(null,![],{'message':_0x1be3('0x1c')});}else if(_0x2bb749[_0x1be3('0xc')]>0x0){if(_0x2e4488[_0x1be3('0x13')]){if(_0x2bb749[_0x1be3('0xd')]>0x0){if(moment(_0x2e4488[_0x1be3('0x14')])[_0x1be3('0x1a')](_0x2bb749['blockDuration'],_0x1be3('0x1b'))>moment()){return _0x2c3965(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1be3('0x1d')](_0x2e4488,0x0,![],null)[_0x1be3('0x17')](function(){return utils['getLicense'](_0x2e4488);})[_0x1be3('0x17')](function(){return _0x2c3965(null,_0x2e4488);});}}else{return _0x2c3965(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x1be3('0x1d')](_0x2e4488,0x0,![],null)[_0x1be3('0x17')](function(){return utils[_0x1be3('0x1e')](_0x2e4488);})[_0x1be3('0x17')](function(){return _0x2c3965(null,_0x2e4488);})['catch'](function(_0x1e2943){return _0x2c3965(null,![],_0x1e2943);});}}else{if(_0x2e4488[_0x1be3('0x13')]){return _0x2c3965(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1be3('0x1e')](_0x2e4488)[_0x1be3('0x17')](function(){return _0x2c3965(null,_0x2e4488);});}}}});})[_0x1be3('0x1f')](function(_0x200c53){return _0x2c3965(null,![],_0x200c53);});}function sendServiceMail(_0x2ddac8){return db[_0x1be3('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x1be3('0xe'),'email'],'include':[{'model':db[_0x1be3('0x21')],'as':'Smtp'}]})[_0x1be3('0x17')](function(_0x11a193){if(!_0x11a193){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5426aa={'tls':{'rejectUnauthorized':![]}};if(_0x11a193[_0x1be3('0x22')][_0x1be3('0x23')]){_0x5426aa[_0x1be3('0x23')]=_0x11a193[_0x1be3('0x22')][_0x1be3('0x23')];}else{_0x5426aa[_0x1be3('0x24')]=_0x11a193['Smtp']['host'];_0x5426aa['port']=_0x11a193['Smtp'][_0x1be3('0x25')];_0x5426aa[_0x1be3('0x26')]=_0x11a193[_0x1be3('0x22')][_0x1be3('0x26')];}if(_0x11a193[_0x1be3('0x22')][_0x1be3('0x27')]){_0x5426aa[_0x1be3('0x28')]={'user':_0x11a193['Smtp'][_0x1be3('0x29')],'pass':_0x11a193[_0x1be3('0x22')][_0x1be3('0x2a')]};}var _0x42e24c={'account':_0x5426aa,'message':_[_0x1be3('0x2b')]({'from':util[_0x1be3('0x2c')](_0x1be3('0x2d'),_0x11a193['name'],_0x11a193[_0x1be3('0x2e')]||_0x11a193[_0x1be3('0x22')][_0x1be3('0x29')])},_0x2ddac8)};return client['request']('SendMail',_0x42e24c);})[_0x1be3('0x17')](function(_0x1a437d){if(_0x1a437d[_0x1be3('0x2f')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1a437d['error'][_0x1be3('0x30')]||JSON[_0x1be3('0x31')](_0x1a437d[_0x1be3('0x2f')])));}return!![];});}function handleError(_0x4b12d0,_0x3de36a,_0x519902){return _0x4b12d0[_0x1be3('0x32')](_0x3de36a||0x1f4)[_0x1be3('0x33')]({'message':_0x519902?_0x519902['message']||_0x519902:''});}exports[_0x1be3('0x34')]=function(_0x16528e,_0x41725b,_0x17c56e){passport[_0x1be3('0x18')]('local',function(_0x3caa96,_0x173ef1,_0x39b8d9){var _0x5bf0fc=_0x3caa96||_0x39b8d9;if(_0x5bf0fc){return handleError(_0x41725b,0x191,_0x5bf0fc);}if(!_0x173ef1){return handleError(_0x41725b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x474d2a={'payload':{'id':_0x173ef1['id'],'role':_0x173ef1[_0x1be3('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x474d2a)[_0x1be3('0x17')](function(_0x5f2c9d){_0x41725b[_0x1be3('0x35')]({'id':_0x173ef1['id'],'token':_0x5f2c9d,'statusCall':'','isAlreadyLogged':_0x173ef1[_0x1be3('0x36')]});});}})(_0x16528e,_0x41725b,_0x17c56e);};exports['forgot']=function(_0x55948b,_0x484601,_0x1166b8){if(!_0x55948b[_0x1be3('0x37')][_0x1be3('0x2e')]){return handleError(_0x484601,0x1f4,{'message':_0x1be3('0x38')});}var _0x1cebbd=rs['generate']();_0x55948b[_0x1be3('0x37')]['email']=_0x55948b[_0x1be3('0x37')][_0x1be3('0x2e')][_0x1be3('0x39')]()[_0x1be3('0x3a')]();var _0x371659;return db['Setting'][_0x1be3('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1be3('0xd')],'raw':!![]})[_0x1be3('0x17')](function(_0x1c231c){_0x371659=_0x1c231c;return db['User'][_0x1be3('0x3b')]({'where':{'email':_0x55948b[_0x1be3('0x37')][_0x1be3('0x2e')]}});})[_0x1be3('0x17')](function(_0x5c94a5){if(!_0x5c94a5){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5c94a5[_0x1be3('0x12')]){throw new Error(_0x1be3('0x3c'));}if(_0x5c94a5[_0x1be3('0x13')]){if(moment(_0x5c94a5[_0x1be3('0x14')])[_0x1be3('0x1a')](_0x371659['blockDuration'],_0x1be3('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x5c94a5[_0x1be3('0x13')]=![];_0x5c94a5[_0x1be3('0x14')]=null;}}_0x5c94a5['resetPasswordToken']=_0x1cebbd;_0x5c94a5['resetPasswordExpires']=Date[_0x1be3('0x3d')]()+0x36ee80;return _0x5c94a5['save']();})['then'](function(){return sendServiceMail({'to':_0x55948b[_0x1be3('0x37')][_0x1be3('0x2e')],'subject':_0x1be3('0x3e'),'text':_0x1be3('0x3f')+_0x1be3('0x40')+'https://'+_0x55948b[_0x1be3('0x41')][_0x1be3('0x24')]+_0x1be3('0x42')+_0x1cebbd+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x1be3('0x17')](function(){_0x484601[_0x1be3('0x32')](0xc8)[_0x1be3('0x33')]({'message':'Reset\x20Email\x20sent!'});})[_0x1be3('0x1f')](function(_0x1fccbb){return handleError(_0x484601,0x1f4,_0x1fccbb);});};exports['reset']=function(_0x495d2b,_0x54fd0d,_0x4fdc29){return db[_0x1be3('0x43')][_0x1be3('0x3b')]({'where':{'resetPasswordToken':_0x495d2b[_0x1be3('0x44')][_0x1be3('0x45')],'resetPasswordExpires':{'$gt':Date[_0x1be3('0x3d')]()}}})[_0x1be3('0x17')](function(_0x3db821){if(!_0x3db821){throw new Error(_0x1be3('0x46'));}return db[_0x1be3('0xa')][_0x1be3('0xb')]({'attributes':['id','securePassword',_0x1be3('0x47'),_0x1be3('0x48')]})[_0x1be3('0x17')](function(_0x3f5794){if(_0x3f5794[_0x1be3('0x49')])authService[_0x1be3('0x4a')](_0x495d2b['body'][_0x1be3('0xf')]);if(!_0x3f5794['enforcePasswordHistory']||!_0x3db821[_0x1be3('0x4b')])return _0x3db821;authService[_0x1be3('0x4c')](_0x495d2b[_0x1be3('0x37')][_0x1be3('0xf')],_0x3db821['previousPasswords'],_0x3f5794['passwordHistoryLimit']);return _0x3db821;})[_0x1be3('0x17')](function(){_0x3db821[_0x1be3('0xf')]=_0x495d2b[_0x1be3('0x37')][_0x1be3('0xf')];_0x3db821[_0x1be3('0x4d')]=null;_0x3db821['resetPasswordExpires']=null;return _0x3db821[_0x1be3('0x4e')]();});})[_0x1be3('0x17')](function(){_0x54fd0d[_0x1be3('0x32')](0xc8)[_0x1be3('0x33')]({'message':_0x1be3('0x4f')});})['catch'](function(_0x2be60a){return handleError(_0x54fd0d,0x1f4,_0x2be60a);});};passport['use'](new LocalStrategy({'usernameField':_0x1be3('0xe'),'passwordField':_0x1be3('0xf')},function(_0x42f89e,_0x5e44a1,_0x48b2db){return localAuthenticate(db[_0x1be3('0x43')],_0x42f89e,_0x5e44a1,_0x48b2db);})); \ No newline at end of file +var _0x5129=['save','status','Password\x20reset!','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5129,0xb5));var _0x9512=function(_0x4ff2ef,_0x24e9ac){_0x4ff2ef=_0x4ff2ef-0x0;var _0x5aab3e=_0x5129[_0x4ff2ef];return _0x5aab3e;};'use strict';var util=require('util');var passport=require(_0x9512('0x0'));var LocalStrategy=require('passport-local')[_0x9512('0x1')];var jayson=require(_0x9512('0x2'));var _=require(_0x9512('0x3'));var rs=require(_0x9512('0x4'));var moment=require(_0x9512('0x5'));var db=require(_0x9512('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson['client'][_0x9512('0x7')]({'port':0x232b});function localAuthenticate(_0x2b8c58,_0x5778f7,_0x474a4d,_0x26a7a5){var _0x3e34c0,_0x48e210;return db['Setting'][_0x9512('0x8')]({'where':{'id':0x1},'attributes':[_0x9512('0x9'),_0x9512('0xa')],'raw':!![]})[_0x9512('0xb')](function(_0xf9412b){_0x3e34c0=_0xf9412b;return _0x2b8c58['findOne']({'attributes':['id',_0x9512('0xc'),_0x9512('0xd'),_0x9512('0xe'),_0x9512('0xf'),'disabled','blocked',_0x9512('0x10'),_0x9512('0x11')],'where':{'name':_0x5778f7,'role':{'$or':[_0x9512('0x12'),_0x9512('0x13'),_0x9512('0x14')]}}});})[_0x9512('0xb')](function(_0x45372e){if(!_0x45372e||_0x45372e&&_0x45372e[_0x9512('0xc')]!==_0x5778f7){throw new Error(_0x9512('0x15'));}else{_0x48e210=_0x45372e;return _0x48e210;}})[_0x9512('0xb')](function(){_0x48e210[_0x9512('0x16')](_0x474a4d,function(_0x1696a8,_0x27f343){var _0x3f4468=_0x48e210[_0x9512('0x11')]+0x1;if(_0x1696a8){return _0x26a7a5(_0x1696a8);}else if(!_0x27f343){if(_0x48e210[_0x9512('0x17')]){return _0x26a7a5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3e34c0['allowedLoginAttempts']>0x0){if(_0x48e210[_0x9512('0x18')]){if(_0x3e34c0[_0x9512('0xa')]>0x0){if(moment(_0x48e210[_0x9512('0x10')])['add'](_0x3e34c0[_0x9512('0xa')],_0x9512('0x19'))>moment()){return _0x26a7a5(null,![],{'message':_0x9512('0x15')});}else{return utils[_0x9512('0x1a')](_0x48e210,_0x3f4468,![],null)[_0x9512('0xb')](function(){return _0x26a7a5(null,![],{'message':_0x9512('0x15')});});}}else{return _0x26a7a5(null,![],{'message':_0x9512('0x15')});}}else{if(_0x3f4468>=_0x3e34c0[_0x9512('0x9')]){return utils[_0x9512('0x1a')](_0x48e210,0x0,!![],moment())[_0x9512('0xb')](function(){return _0x26a7a5(null,![],{'message':_0x9512('0x15')});});}else{return utils[_0x9512('0x1a')](_0x48e210,_0x3f4468,![],null)[_0x9512('0xb')](function(){return _0x26a7a5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x26a7a5(null,![],{'message':_0x9512('0x15')});}}else{if(_0x48e210[_0x9512('0x17')]){return _0x26a7a5(null,![],{'message':_0x9512('0x15')});}else if(_0x3e34c0[_0x9512('0x9')]>0x0){if(_0x48e210[_0x9512('0x18')]){if(_0x3e34c0[_0x9512('0xa')]>0x0){if(moment(_0x48e210[_0x9512('0x10')])[_0x9512('0x1b')](_0x3e34c0[_0x9512('0xa')],_0x9512('0x19'))>moment()){return _0x26a7a5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9512('0x1a')](_0x48e210,0x0,![],null)[_0x9512('0xb')](function(){return utils[_0x9512('0x1c')](_0x48e210);})[_0x9512('0xb')](function(){return _0x26a7a5(null,_0x48e210);});}}else{return _0x26a7a5(null,![],{'message':_0x9512('0x15')});}}else{return utils[_0x9512('0x1a')](_0x48e210,0x0,![],null)[_0x9512('0xb')](function(){return utils[_0x9512('0x1c')](_0x48e210);})[_0x9512('0xb')](function(){return _0x26a7a5(null,_0x48e210);})[_0x9512('0x1d')](function(_0x4ed749){return _0x26a7a5(null,![],_0x4ed749);});}}else{if(_0x48e210[_0x9512('0x18')]){return _0x26a7a5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9512('0x1c')](_0x48e210)[_0x9512('0xb')](function(){return _0x26a7a5(null,_0x48e210);});}}}});})[_0x9512('0x1d')](function(_0x2cd4b8){return _0x26a7a5(null,![],_0x2cd4b8);});}function sendServiceMail(_0x3d983d){return db[_0x9512('0x1e')][_0x9512('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x9512('0xc'),_0x9512('0x20')],'include':[{'model':db[_0x9512('0x21')],'as':_0x9512('0x22')}]})[_0x9512('0xb')](function(_0x3328b0){if(!_0x3328b0){throw new Error(_0x9512('0x23'));}var _0x5a89a6={'tls':{'rejectUnauthorized':![]}};if(_0x3328b0[_0x9512('0x22')][_0x9512('0x24')]){_0x5a89a6['service']=_0x3328b0['Smtp']['service'];}else{_0x5a89a6[_0x9512('0x25')]=_0x3328b0[_0x9512('0x22')][_0x9512('0x25')];_0x5a89a6[_0x9512('0x26')]=_0x3328b0[_0x9512('0x22')]['port'];_0x5a89a6[_0x9512('0x27')]=_0x3328b0['Smtp'][_0x9512('0x27')];}if(_0x3328b0[_0x9512('0x22')][_0x9512('0x28')]){_0x5a89a6[_0x9512('0x29')]={'user':_0x3328b0[_0x9512('0x22')][_0x9512('0x13')],'pass':_0x3328b0['Smtp'][_0x9512('0x2a')]};}var _0x61313e={'account':_0x5a89a6,'message':_[_0x9512('0x2b')]({'from':util['format'](_0x9512('0x2c'),_0x3328b0[_0x9512('0xc')],_0x3328b0[_0x9512('0x20')]||_0x3328b0[_0x9512('0x22')][_0x9512('0x13')])},_0x3d983d)};return client[_0x9512('0x2d')](_0x9512('0x2e'),_0x61313e);})[_0x9512('0xb')](function(_0x415376){if(_0x415376['error']){throw new Error(util[_0x9512('0x2f')](_0x9512('0x30'),_0x415376[_0x9512('0x31')][_0x9512('0x32')]||JSON[_0x9512('0x33')](_0x415376[_0x9512('0x31')])));}return!![];});}function handleError(_0x4c6e8d,_0x3002e9,_0x2fdc38){return _0x4c6e8d['status'](_0x3002e9||0x1f4)[_0x9512('0x34')]({'message':_0x2fdc38?_0x2fdc38[_0x9512('0x32')]||_0x2fdc38:''});}exports['login']=function(_0x380e57,_0x884dd2,_0x3da0e6){passport[_0x9512('0x16')](_0x9512('0x35'),function(_0xe4fca,_0xd536c4,_0x320347){var _0x1b6a36=_0xe4fca||_0x320347;if(_0x1b6a36){return handleError(_0x884dd2,0x191,_0x1b6a36);}if(!_0xd536c4){return handleError(_0x884dd2,0x194,{'message':_0x9512('0x36')});}else{var _0x2b2a7f={'payload':{'id':_0xd536c4['id'],'role':_0xd536c4[_0x9512('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x9512('0x37')](_0x2b2a7f)['then'](function(_0x48f5b6){_0x884dd2[_0x9512('0x38')]({'id':_0xd536c4['id'],'token':_0x48f5b6,'statusCall':'','isAlreadyLogged':_0xd536c4[_0x9512('0x39')]});});}})(_0x380e57,_0x884dd2,_0x3da0e6);};exports[_0x9512('0x3a')]=function(_0x41a3c7,_0x28971a,_0x307b86){if(!_0x41a3c7['body'][_0x9512('0x20')]){return handleError(_0x28971a,0x1f4,{'message':_0x9512('0x3b')});}var _0x2bd4e3=rs['generate']();_0x41a3c7['body'][_0x9512('0x20')]=_0x41a3c7[_0x9512('0x3c')][_0x9512('0x20')][_0x9512('0x3d')]()[_0x9512('0x3e')]();var _0x2d59e4;return db[_0x9512('0x3f')]['findOne']({'where':{'id':0x1},'attributes':[_0x9512('0x9'),'blockDuration'],'raw':!![]})[_0x9512('0xb')](function(_0x17915e){_0x2d59e4=_0x17915e;return db[_0x9512('0x40')][_0x9512('0x1f')]({'where':{'email':_0x41a3c7[_0x9512('0x3c')][_0x9512('0x20')]}});})[_0x9512('0xb')](function(_0x489c17){if(!_0x489c17){throw new Error(_0x9512('0x41'));}if(_0x489c17[_0x9512('0x17')]){throw new Error(_0x9512('0x42'));}if(_0x489c17[_0x9512('0x18')]){if(moment(_0x489c17['blockedAt'])[_0x9512('0x1b')](_0x2d59e4[_0x9512('0xa')],_0x9512('0x19'))>moment()){throw new Error(_0x9512('0x43'));}else{_0x489c17[_0x9512('0x18')]=![];_0x489c17[_0x9512('0x10')]=null;}}_0x489c17[_0x9512('0x44')]=_0x2bd4e3;_0x489c17[_0x9512('0x45')]=Date[_0x9512('0x46')]()+0x36ee80;return _0x489c17['save']();})['then'](function(){return sendServiceMail({'to':_0x41a3c7[_0x9512('0x3c')][_0x9512('0x20')],'subject':_0x9512('0x47'),'text':_0x9512('0x48')+_0x9512('0x49')+'https://'+_0x41a3c7[_0x9512('0x4a')][_0x9512('0x25')]+'/reset/'+_0x2bd4e3+'\x0a\x0a'+_0x9512('0x4b')});})[_0x9512('0xb')](function(){_0x28971a['status'](0xc8)[_0x9512('0x34')]({'message':_0x9512('0x4c')});})[_0x9512('0x1d')](function(_0x411001){return handleError(_0x28971a,0x1f4,_0x411001);});};exports[_0x9512('0x4d')]=function(_0x220ac0,_0x4fe5cc,_0x8181b1){return db['User'][_0x9512('0x1f')]({'where':{'resetPasswordToken':_0x220ac0[_0x9512('0x4e')][_0x9512('0x4f')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x9512('0xb')](function(_0x45d257){if(!_0x45d257){throw new Error(_0x9512('0x50'));}return db[_0x9512('0x3f')][_0x9512('0x8')]({'attributes':['id','securePassword',_0x9512('0x51'),_0x9512('0x52')]})[_0x9512('0xb')](function(_0x4fbaf5){if(_0x4fbaf5[_0x9512('0x53')])authService[_0x9512('0x54')](_0x220ac0[_0x9512('0x3c')][_0x9512('0xd')]);if(!_0x4fbaf5[_0x9512('0x51')]||!_0x45d257[_0x9512('0x55')])return _0x45d257;authService['validatePasswordHistory'](_0x220ac0[_0x9512('0x3c')][_0x9512('0xd')],_0x45d257[_0x9512('0x55')],_0x4fbaf5['passwordHistoryLimit']);return _0x45d257;})[_0x9512('0xb')](function(){_0x45d257['password']=_0x220ac0['body'][_0x9512('0xd')];_0x45d257['resetPasswordToken']=null;_0x45d257[_0x9512('0x45')]=null;return _0x45d257[_0x9512('0x56')]();});})[_0x9512('0xb')](function(){_0x4fe5cc[_0x9512('0x57')](0xc8)[_0x9512('0x34')]({'message':_0x9512('0x58')});})[_0x9512('0x1d')](function(_0x1918ef){return handleError(_0x4fe5cc,0x1f4,_0x1918ef);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x9512('0xd')},function(_0x49881a,_0x30a5d6,_0x50d2f1){return localAuthenticate(db[_0x9512('0x40')],_0x49881a,_0x30a5d6,_0x50d2f1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4db07d3..d15fa60 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 _0x1381=['exports','express','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x1381,0x101));var _0x1138=function(_0x15fff5,_0x10dcdc){_0x15fff5=_0x15fff5-0x0;var _0x47840d=_0x1381[_0x15fff5];return _0x47840d;};'use strict';var express=require(_0x1138('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x1138('0x1')]);router[_0x1138('0x2')](_0x1138('0x3'),controller[_0x1138('0x4')]);router[_0x1138('0x2')](_0x1138('0x5'),controller[_0x1138('0x6')]);module[_0x1138('0x7')]=router; \ No newline at end of file +var _0x5339=['exports','express','./authLocal.controller','post','/forgot','/reset/:token','reset'];(function(_0x3bd105,_0xc1dc8e){var _0x5b689d=function(_0x494910){while(--_0x494910){_0x3bd105['push'](_0x3bd105['shift']());}};_0x5b689d(++_0xc1dc8e);}(_0x5339,0xda));var _0x9533=function(_0x3d6751,_0xf5f68c){_0x3d6751=_0x3d6751-0x0;var _0xc4021b=_0x5339[_0x3d6751];return _0xc4021b;};'use strict';var express=require(_0x9533('0x0'));var router=express['Router']();var controller=require(_0x9533('0x1'));router[_0x9533('0x2')]('/',controller['login']);router[_0x9533('0x2')](_0x9533('0x3'),controller['forgot']);router['post'](_0x9533('0x4'),controller[_0x9533('0x5')]);module[_0x9533('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 04984cd..4299c31 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 _0xe302=['INTEGER','sequelize','exports'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xe302,0x10f));var _0x2e30=function(_0x137a5b,_0x3ee5b6){_0x137a5b=_0x137a5b-0x0;var _0x36c8d2=_0xe302[_0x137a5b];return _0x36c8d2;};'use strict';var Sequelize=require(_0x2e30('0x0'));module[_0x2e30('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2e30('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xfedb=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfedb,0x107));var _0xbfed=function(_0x36db21,_0x21f425){_0x36db21=_0x36db21-0x0;var _0x3b4808=_0xfedb[_0x36db21];return _0x3b4808;};'use strict';var Sequelize=require(_0xbfed('0x0'));module[_0xbfed('0x1')]={'name':{'type':Sequelize[_0xbfed('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbfed('0x2')]},'status':{'type':Sequelize[_0xbfed('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbfed('0x4')],'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 4ffdbac..f8abd69 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 _0x9e0e=['end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','map','Automation','rawAttributes','key','model','name','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status'];(function(_0x5da39f,_0x4be406){var _0x4be401=function(_0x5a87b0){while(--_0x5a87b0){_0x5da39f['push'](_0x5da39f['shift']());}};_0x4be401(++_0x4be406);}(_0x9e0e,0xd7));var _0xe9e0=function(_0x517ba2,_0xa6b13){_0x517ba2=_0x517ba2-0x0;var _0x222ed7=_0x9e0e[_0x517ba2];return _0x222ed7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9e0('0x0'));var zipdir=require(_0xe9e0('0x1'));var jsonpatch=require(_0xe9e0('0x2'));var rp=require(_0xe9e0('0x3'));var moment=require(_0xe9e0('0x4'));var BPromise=require(_0xe9e0('0x5'));var Mustache=require(_0xe9e0('0x6'));var util=require(_0xe9e0('0x7'));var path=require(_0xe9e0('0x8'));var sox=require(_0xe9e0('0x9'));var csv=require(_0xe9e0('0xa'));var ejs=require(_0xe9e0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9e0('0xc'));var squel=require(_0xe9e0('0xd'));var crypto=require(_0xe9e0('0xe'));var jsforce=require(_0xe9e0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe9e0('0xa'));var querystring=require(_0xe9e0('0x10'));var Papa=require('papaparse');var Redis=require(_0xe9e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9e0('0x12'));var as=require(_0xe9e0('0x13'));var hardwareService=require(_0xe9e0('0x14'));var logger=require(_0xe9e0('0x15'))('api');var utils=require(_0xe9e0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x105d2b,_0x5ee0e4){_0x5ee0e4=_0x5ee0e4||0xcc;return function(_0x399d5b){if(_0x399d5b){return _0x105d2b[_0xe9e0('0x17')](_0x5ee0e4);}return _0x105d2b[_0xe9e0('0x18')](_0x5ee0e4)[_0xe9e0('0x19')]();};}function respondWithResult(_0x48066c,_0x5c9f43){_0x5c9f43=_0x5c9f43||0xc8;return function(_0x5d5fe0){if(_0x5d5fe0){return _0x48066c[_0xe9e0('0x18')](_0x5c9f43)[_0xe9e0('0x1a')](_0x5d5fe0);}};}function respondWithFilteredResult(_0x1f40bc,_0x23813f){return function(_0x447a53){if(_0x447a53){var _0x47617f=typeof _0x23813f['offset']===_0xe9e0('0x1b')&&typeof _0x23813f[_0xe9e0('0x1c')]===_0xe9e0('0x1b');var _0x542dc6=_0x447a53[_0xe9e0('0x1d')];var _0x39348d=_0x47617f?0x0:_0x23813f[_0xe9e0('0x1e')];var _0x554b2c=_0x47617f?_0x447a53[_0xe9e0('0x1d')]:_0x23813f['offset']+_0x23813f[_0xe9e0('0x1c')];var _0x2c9228;if(_0x554b2c>=_0x542dc6){_0x554b2c=_0x542dc6;_0x2c9228=0xc8;}else{_0x2c9228=0xce;}_0x1f40bc[_0xe9e0('0x18')](_0x2c9228);return _0x1f40bc[_0xe9e0('0x1f')]('Content-Range',_0x39348d+'-'+_0x554b2c+'/'+_0x542dc6)[_0xe9e0('0x1a')](_0x447a53);}return null;};}function patchUpdates(_0x40abf6){return function(_0x5de624){try{jsonpatch[_0xe9e0('0x20')](_0x5de624,_0x40abf6,!![]);}catch(_0x4ee1e3){return BPromise['reject'](_0x4ee1e3);}return _0x5de624[_0xe9e0('0x21')]();};}function saveUpdates(_0x218d2b,_0x3e3227){return function(_0xc22adf){if(_0xc22adf){return _0xc22adf[_0xe9e0('0x22')](_0x218d2b)[_0xe9e0('0x23')](function(_0x4761cc){return _0x4761cc;});}return null;};}function removeEntity(_0x51ef44,_0x20839b){return function(_0x2113e3){if(_0x2113e3){return _0x2113e3[_0xe9e0('0x24')]()['then'](function(){_0x51ef44[_0xe9e0('0x18')](0xcc)[_0xe9e0('0x19')]();});}};}function handleEntityNotFound(_0xd89886,_0x5a22ee){return function(_0x45f474){if(!_0x45f474){_0xd89886[_0xe9e0('0x17')](0x194);}return _0x45f474;};}function handleError(_0x6e5f4c,_0x67da1f){_0x67da1f=_0x67da1f||0x1f4;return function(_0x4dfb4d){logger[_0xe9e0('0x25')](_0x4dfb4d[_0xe9e0('0x26')]);if(_0x4dfb4d['name']){delete _0x4dfb4d['name'];}_0x6e5f4c[_0xe9e0('0x18')](_0x67da1f)['send'](_0x4dfb4d);};}exports['index']=function(_0x38c008,_0x5e11e7){var _0x430fca={},_0x5297f1={},_0x3fa39a={'count':0x0,'rows':[]};var _0x1effb9=_[_0xe9e0('0x27')](db[_0xe9e0('0x28')][_0xe9e0('0x29')],function(_0x5ea469){return{'name':_0x5ea469['fieldName'],'type':_0x5ea469['type'][_0xe9e0('0x2a')]};});_0x5297f1[_0xe9e0('0x2b')]=_[_0xe9e0('0x27')](_0x1effb9,_0xe9e0('0x2c'));_0x5297f1[_0xe9e0('0x2d')]=_[_0xe9e0('0x2e')](_0x38c008[_0xe9e0('0x2d')]);_0x5297f1['filters']=_[_0xe9e0('0x2f')](_0x5297f1['model'],_0x5297f1[_0xe9e0('0x2d')]);_0x430fca['attributes']=_[_0xe9e0('0x2f')](_0x5297f1[_0xe9e0('0x2b')],qs[_0xe9e0('0x30')](_0x38c008[_0xe9e0('0x2d')][_0xe9e0('0x30')]));_0x430fca['attributes']=_0x430fca['attributes'][_0xe9e0('0x31')]?_0x430fca[_0xe9e0('0x32')]:_0x5297f1['model'];if(!_0x38c008[_0xe9e0('0x2d')][_0xe9e0('0x33')](_0xe9e0('0x34'))){_0x430fca[_0xe9e0('0x1c')]=qs['limit'](_0x38c008[_0xe9e0('0x2d')][_0xe9e0('0x1c')]);_0x430fca[_0xe9e0('0x1e')]=qs['offset'](_0x38c008['query'][_0xe9e0('0x1e')]);}_0x430fca[_0xe9e0('0x35')]=qs[_0xe9e0('0x36')](_0x38c008[_0xe9e0('0x2d')]['sort']);_0x430fca[_0xe9e0('0x37')]=qs[_0xe9e0('0x38')](_[_0xe9e0('0x39')](_0x38c008['query'],_0x5297f1[_0xe9e0('0x38')]),_0x1effb9);if(_0x38c008[_0xe9e0('0x2d')]['filter']){_0x430fca[_0xe9e0('0x37')]=_['merge'](_0x430fca[_0xe9e0('0x37')],{'$or':_['map'](_0x1effb9,function(_0x46a929){if(_0x46a929['type']!==_0xe9e0('0x3a')){var _0xcedbff={};_0xcedbff[_0x46a929[_0xe9e0('0x2c')]]={'$like':'%'+_0x38c008[_0xe9e0('0x2d')][_0xe9e0('0x3b')]+'%'};return _0xcedbff;}})});}_0x430fca=_[_0xe9e0('0x3c')]({},_0x430fca,_0x38c008[_0xe9e0('0x3d')]);var _0x53daaa={'where':_0x430fca[_0xe9e0('0x37')]};return db['Automation'][_0xe9e0('0x1d')](_0x53daaa)[_0xe9e0('0x23')](function(_0x1a3a5c){_0x3fa39a[_0xe9e0('0x1d')]=_0x1a3a5c;if(_0x38c008[_0xe9e0('0x2d')][_0xe9e0('0x3e')]){_0x430fca[_0xe9e0('0x3f')]=[{'all':!![]}];}return db[_0xe9e0('0x28')][_0xe9e0('0x40')](_0x430fca);})[_0xe9e0('0x23')](function(_0xe854ab){_0x3fa39a[_0xe9e0('0x41')]=_0xe854ab;return _0x3fa39a;})['then'](respondWithFilteredResult(_0x5e11e7,_0x430fca))[_0xe9e0('0x42')](handleError(_0x5e11e7,null));};exports[_0xe9e0('0x43')]=function(_0x33d16e,_0x56697a){var _0x6213af={'raw':![],'where':{'id':_0x33d16e[_0xe9e0('0x44')]['id']}},_0x1c7a3d={};_0x1c7a3d[_0xe9e0('0x2b')]=_[_0xe9e0('0x2e')](db[_0xe9e0('0x28')]['rawAttributes']);_0x1c7a3d[_0xe9e0('0x2d')]=_['keys'](_0x33d16e[_0xe9e0('0x2d')]);_0x1c7a3d[_0xe9e0('0x38')]=_[_0xe9e0('0x2f')](_0x1c7a3d['model'],_0x1c7a3d[_0xe9e0('0x2d')]);_0x6213af[_0xe9e0('0x32')]=_['intersection'](_0x1c7a3d[_0xe9e0('0x2b')],qs[_0xe9e0('0x30')](_0x33d16e['query']['fields']));_0x6213af[_0xe9e0('0x32')]=_0x6213af[_0xe9e0('0x32')][_0xe9e0('0x31')]?_0x6213af[_0xe9e0('0x32')]:_0x1c7a3d['model'];if(_0x33d16e[_0xe9e0('0x2d')][_0xe9e0('0x3e')]){_0x6213af[_0xe9e0('0x3f')]=[{'all':!![]}];}_0x6213af=_['merge']({},_0x6213af,_0x33d16e[_0xe9e0('0x3d')]);return db[_0xe9e0('0x28')][_0xe9e0('0x45')](_0x6213af)['then'](handleEntityNotFound(_0x56697a,null))[_0xe9e0('0x23')](respondWithResult(_0x56697a,null))[_0xe9e0('0x42')](handleError(_0x56697a,null));};exports[_0xe9e0('0x46')]=function(_0x2afc03,_0x496f15){return db[_0xe9e0('0x28')][_0xe9e0('0x46')](_0x2afc03[_0xe9e0('0x47')],{})[_0xe9e0('0x23')](respondWithResult(_0x496f15,0xc9))[_0xe9e0('0x42')](handleError(_0x496f15,null));};exports[_0xe9e0('0x22')]=function(_0x458215,_0x3b3c4d){if(_0x458215[_0xe9e0('0x47')]['id']){delete _0x458215[_0xe9e0('0x47')]['id'];}return db[_0xe9e0('0x28')][_0xe9e0('0x45')]({'where':{'id':_0x458215['params']['id']}})[_0xe9e0('0x23')](handleEntityNotFound(_0x3b3c4d,null))[_0xe9e0('0x23')](saveUpdates(_0x458215[_0xe9e0('0x47')],null))['then'](respondWithResult(_0x3b3c4d,null))['catch'](handleError(_0x3b3c4d,null));};exports[_0xe9e0('0x24')]=function(_0x257301,_0x35f757){return db[_0xe9e0('0x28')][_0xe9e0('0x45')]({'where':{'id':_0x257301[_0xe9e0('0x44')]['id']}})[_0xe9e0('0x23')](handleEntityNotFound(_0x35f757,null))[_0xe9e0('0x23')](removeEntity(_0x35f757,null))[_0xe9e0('0x42')](handleError(_0x35f757,null));};exports[_0xe9e0('0x48')]=function(_0x45392c,_0x599378,_0x53d936){return db[_0xe9e0('0x49')]['find']({'where':{'id':_0x45392c[_0xe9e0('0x44')]['id']}})[_0xe9e0('0x23')](handleEntityNotFound(_0x599378,null))[_0xe9e0('0x23')](function(_0x1c4541){if(_0x1c4541){return _0x1c4541['addConditions'](_0x45392c[_0xe9e0('0x47')][_0xe9e0('0x4a')],_[_0xe9e0('0x4b')](_0x45392c[_0xe9e0('0x47')],[_0xe9e0('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x599378,null))[_0xe9e0('0x42')](handleError(_0x599378,null));};exports[_0xe9e0('0x4c')]=function(_0x1d387e,_0x3d8dfc,_0x5a8903){var _0x265c91={};var _0xfb3325={};var _0x4e1765;var _0x1781f4;return db['Automation']['findOne']({'where':{'id':_0x1d387e[_0xe9e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d8dfc,null))[_0xe9e0('0x23')](function(_0x2c1c22){if(_0x2c1c22){_0x4e1765=_0x2c1c22;_0xfb3325[_0xe9e0('0x2b')]=_[_0xe9e0('0x2e')](db['Condition'][_0xe9e0('0x29')]);_0xfb3325[_0xe9e0('0x2d')]=_[_0xe9e0('0x2e')](_0x1d387e[_0xe9e0('0x2d')]);_0xfb3325[_0xe9e0('0x38')]=_[_0xe9e0('0x2f')](_0xfb3325[_0xe9e0('0x2b')],_0xfb3325[_0xe9e0('0x2d')]);_0x265c91['attributes']=_[_0xe9e0('0x2f')](_0xfb3325[_0xe9e0('0x2b')],qs[_0xe9e0('0x30')](_0x1d387e[_0xe9e0('0x2d')]['fields']));_0x265c91[_0xe9e0('0x32')]=_0x265c91[_0xe9e0('0x32')][_0xe9e0('0x31')]?_0x265c91[_0xe9e0('0x32')]:_0xfb3325[_0xe9e0('0x2b')];_0x265c91[_0xe9e0('0x35')]=qs[_0xe9e0('0x36')](_0x1d387e[_0xe9e0('0x2d')][_0xe9e0('0x36')]);_0x265c91[_0xe9e0('0x37')]=qs['filters'](_['pick'](_0x1d387e[_0xe9e0('0x2d')],_0xfb3325[_0xe9e0('0x38')]));if(_0x1d387e[_0xe9e0('0x2d')][_0xe9e0('0x3b')]){_0x265c91[_0xe9e0('0x37')]=_[_0xe9e0('0x3c')](_0x265c91[_0xe9e0('0x37')],{'$or':_['map'](_0x265c91[_0xe9e0('0x32')],function(_0x2fe5b0){var _0x3f69f9={};_0x3f69f9[_0x2fe5b0]={'$like':'%'+_0x1d387e[_0xe9e0('0x2d')][_0xe9e0('0x3b')]+'%'};return _0x3f69f9;})});}_0x265c91=_[_0xe9e0('0x3c')]({},_0x265c91,_0x1d387e[_0xe9e0('0x3d')]);return _0x4e1765[_0xe9e0('0x4c')](_0x265c91);}})[_0xe9e0('0x23')](function(_0xb23605){if(_0xb23605){_0x1781f4=_0xb23605[_0xe9e0('0x31')];if(!_0x1d387e[_0xe9e0('0x2d')][_0xe9e0('0x33')]('nolimit')){_0x265c91[_0xe9e0('0x1c')]=qs['limit'](_0x1d387e[_0xe9e0('0x2d')]['limit']);_0x265c91[_0xe9e0('0x1e')]=qs[_0xe9e0('0x1e')](_0x1d387e['query']['offset']);}return _0x4e1765[_0xe9e0('0x4c')](_0x265c91);}})[_0xe9e0('0x23')](function(_0x438629){if(_0x438629){return _0x438629?{'count':_0x1781f4,'rows':_0x438629}:null;}})[_0xe9e0('0x23')](respondWithResult(_0x3d8dfc,null))['catch'](handleError(_0x3d8dfc,null));};exports[_0xe9e0('0x4d')]=function(_0x4330e2,_0x11b9a8,_0x4d220a){return db[_0xe9e0('0x4e')]['find']({'where':{'id':_0x4330e2[_0xe9e0('0x44')]['id']}})[_0xe9e0('0x23')](handleEntityNotFound(_0x11b9a8,null))[_0xe9e0('0x23')](function(_0x370e71){if(_0x370e71){return _0x370e71[_0xe9e0('0x4d')](_0x4330e2['body'][_0xe9e0('0x4a')],_[_0xe9e0('0x4b')](_0x4330e2['body'],['ids','id'])||{});}})[_0xe9e0('0x23')](respondWithResult(_0x11b9a8,null))[_0xe9e0('0x42')](handleError(_0x11b9a8,null));};exports[_0xe9e0('0x4f')]=function(_0x51c216,_0x309e72,_0xd77614){var _0x41523d={};var _0x1a6d47={};var _0x587393;var _0x4e1f2;return db[_0xe9e0('0x28')]['findOne']({'where':{'id':_0x51c216[_0xe9e0('0x44')]['id']}})[_0xe9e0('0x23')](handleEntityNotFound(_0x309e72,null))[_0xe9e0('0x23')](function(_0x45ae14){if(_0x45ae14){_0x587393=_0x45ae14;_0x1a6d47[_0xe9e0('0x2b')]=_[_0xe9e0('0x2e')](db[_0xe9e0('0x4e')][_0xe9e0('0x29')]);_0x1a6d47[_0xe9e0('0x2d')]=_[_0xe9e0('0x2e')](_0x51c216[_0xe9e0('0x2d')]);_0x1a6d47[_0xe9e0('0x38')]=_['intersection'](_0x1a6d47['model'],_0x1a6d47[_0xe9e0('0x2d')]);_0x41523d['attributes']=_['intersection'](_0x1a6d47['model'],qs[_0xe9e0('0x30')](_0x51c216[_0xe9e0('0x2d')][_0xe9e0('0x30')]));_0x41523d['attributes']=_0x41523d[_0xe9e0('0x32')][_0xe9e0('0x31')]?_0x41523d[_0xe9e0('0x32')]:_0x1a6d47[_0xe9e0('0x2b')];_0x41523d[_0xe9e0('0x35')]=qs['sort'](_0x51c216[_0xe9e0('0x2d')][_0xe9e0('0x36')]);_0x41523d[_0xe9e0('0x37')]=qs['filters'](_['pick'](_0x51c216['query'],_0x1a6d47[_0xe9e0('0x38')]));if(_0x51c216['query'][_0xe9e0('0x3b')]){_0x41523d['where']=_[_0xe9e0('0x3c')](_0x41523d[_0xe9e0('0x37')],{'$or':_['map'](_0x41523d['attributes'],function(_0x1e520f){var _0x31d476={};_0x31d476[_0x1e520f]={'$like':'%'+_0x51c216['query'][_0xe9e0('0x3b')]+'%'};return _0x31d476;})});}_0x41523d=_[_0xe9e0('0x3c')]({},_0x41523d,_0x51c216[_0xe9e0('0x3d')]);return _0x587393[_0xe9e0('0x4f')](_0x41523d);}})[_0xe9e0('0x23')](function(_0x55ede9){if(_0x55ede9){_0x4e1f2=_0x55ede9[_0xe9e0('0x31')];if(!_0x51c216['query']['hasOwnProperty'](_0xe9e0('0x34'))){_0x41523d[_0xe9e0('0x1c')]=qs['limit'](_0x51c216[_0xe9e0('0x2d')][_0xe9e0('0x1c')]);_0x41523d['offset']=qs[_0xe9e0('0x1e')](_0x51c216[_0xe9e0('0x2d')][_0xe9e0('0x1e')]);}return _0x587393['getActions'](_0x41523d);}})[_0xe9e0('0x23')](function(_0x353e0f){if(_0x353e0f){return _0x353e0f?{'count':_0x4e1f2,'rows':_0x353e0f}:null;}})[_0xe9e0('0x23')](respondWithResult(_0x309e72,null))['catch'](handleError(_0x309e72,null));}; \ No newline at end of file +var _0x7c7e=['getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','Automation','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','Action','addActions'];(function(_0x5c12ba,_0x229eee){var _0x4ed0fa=function(_0x410943){while(--_0x410943){_0x5c12ba['push'](_0x5c12ba['shift']());}};_0x4ed0fa(++_0x229eee);}(_0x7c7e,0xab));var _0xe7c7=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x7c7e[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require(_0xe7c7('0x0'));var rimraf=require(_0xe7c7('0x1'));var zipdir=require(_0xe7c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7c7('0x3'));var moment=require(_0xe7c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe7c7('0x5'));var util=require(_0xe7c7('0x6'));var path=require(_0xe7c7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7c7('0x8'));var fs=require('fs');var fs_extra=require(_0xe7c7('0x9'));var _=require(_0xe7c7('0xa'));var squel=require(_0xe7c7('0xb'));var crypto=require('crypto');var jsforce=require(_0xe7c7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe7c7('0xd'));var querystring=require(_0xe7c7('0xe'));var Papa=require(_0xe7c7('0xf'));var Redis=require('ioredis');var authService=require(_0xe7c7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe7c7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7c7('0x12'))('api');var utils=require(_0xe7c7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe7c7('0x14'));var db=require(_0xe7c7('0x15'))['db'];function respondWithStatusCode(_0x3f1e46,_0x1d9075){_0x1d9075=_0x1d9075||0xcc;return function(_0x349c9f){if(_0x349c9f){return _0x3f1e46[_0xe7c7('0x16')](_0x1d9075);}return _0x3f1e46[_0xe7c7('0x17')](_0x1d9075)['end']();};}function respondWithResult(_0x1fd052,_0x530033){_0x530033=_0x530033||0xc8;return function(_0x3d094d){if(_0x3d094d){return _0x1fd052['status'](_0x530033)[_0xe7c7('0x18')](_0x3d094d);}};}function respondWithFilteredResult(_0x1edba4,_0x116676){return function(_0x14ef03){if(_0x14ef03){var _0x110809=typeof _0x116676[_0xe7c7('0x19')]===_0xe7c7('0x1a')&&typeof _0x116676['limit']==='undefined';var _0x21b03e=_0x14ef03['count'];var _0x288cb7=_0x110809?0x0:_0x116676[_0xe7c7('0x19')];var _0x22d6b3=_0x110809?_0x14ef03[_0xe7c7('0x1b')]:_0x116676['offset']+_0x116676[_0xe7c7('0x1c')];var _0x1d0633;if(_0x22d6b3>=_0x21b03e){_0x22d6b3=_0x21b03e;_0x1d0633=0xc8;}else{_0x1d0633=0xce;}_0x1edba4[_0xe7c7('0x17')](_0x1d0633);return _0x1edba4[_0xe7c7('0x1d')](_0xe7c7('0x1e'),_0x288cb7+'-'+_0x22d6b3+'/'+_0x21b03e)[_0xe7c7('0x18')](_0x14ef03);}return null;};}function patchUpdates(_0x66d7a5){return function(_0x46108e){try{jsonpatch[_0xe7c7('0x1f')](_0x46108e,_0x66d7a5,!![]);}catch(_0x2a6fa6){return BPromise[_0xe7c7('0x20')](_0x2a6fa6);}return _0x46108e[_0xe7c7('0x21')]();};}function saveUpdates(_0x29cf84,_0x4a2dc1){return function(_0x3735b7){if(_0x3735b7){return _0x3735b7[_0xe7c7('0x22')](_0x29cf84)[_0xe7c7('0x23')](function(_0xfaa852){return _0xfaa852;});}return null;};}function removeEntity(_0x92f605,_0x469ee1){return function(_0x4d490d){if(_0x4d490d){return _0x4d490d[_0xe7c7('0x24')]()['then'](function(){_0x92f605[_0xe7c7('0x17')](0xcc)[_0xe7c7('0x25')]();});}};}function handleEntityNotFound(_0x527057,_0x5248ac){return function(_0x397947){if(!_0x397947){_0x527057['sendStatus'](0x194);}return _0x397947;};}function handleError(_0x380df5,_0x2d99d3){_0x2d99d3=_0x2d99d3||0x1f4;return function(_0x494f32){logger[_0xe7c7('0x26')](_0x494f32[_0xe7c7('0x27')]);if(_0x494f32['name']){delete _0x494f32['name'];}_0x380df5[_0xe7c7('0x17')](_0x2d99d3)[_0xe7c7('0x28')](_0x494f32);};}exports[_0xe7c7('0x29')]=function(_0x59f754,_0x57e8fa){var _0x358b08={},_0x311046={},_0x29c077={'count':0x0,'rows':[]};var _0x4aa76b=_[_0xe7c7('0x2a')](db[_0xe7c7('0x2b')]['rawAttributes'],function(_0x54e3c4){return{'name':_0x54e3c4[_0xe7c7('0x2c')],'type':_0x54e3c4[_0xe7c7('0x2d')][_0xe7c7('0x2e')]};});_0x311046[_0xe7c7('0x2f')]=_['map'](_0x4aa76b,_0xe7c7('0x30'));_0x311046['query']=_[_0xe7c7('0x31')](_0x59f754[_0xe7c7('0x32')]);_0x311046[_0xe7c7('0x33')]=_[_0xe7c7('0x34')](_0x311046[_0xe7c7('0x2f')],_0x311046[_0xe7c7('0x32')]);_0x358b08[_0xe7c7('0x35')]=_[_0xe7c7('0x34')](_0x311046[_0xe7c7('0x2f')],qs[_0xe7c7('0x36')](_0x59f754['query'][_0xe7c7('0x36')]));_0x358b08['attributes']=_0x358b08[_0xe7c7('0x35')][_0xe7c7('0x37')]?_0x358b08[_0xe7c7('0x35')]:_0x311046[_0xe7c7('0x2f')];if(!_0x59f754[_0xe7c7('0x32')][_0xe7c7('0x38')](_0xe7c7('0x39'))){_0x358b08['limit']=qs['limit'](_0x59f754[_0xe7c7('0x32')][_0xe7c7('0x1c')]);_0x358b08[_0xe7c7('0x19')]=qs['offset'](_0x59f754['query'][_0xe7c7('0x19')]);}_0x358b08[_0xe7c7('0x3a')]=qs[_0xe7c7('0x3b')](_0x59f754[_0xe7c7('0x32')][_0xe7c7('0x3b')]);_0x358b08[_0xe7c7('0x3c')]=qs[_0xe7c7('0x33')](_[_0xe7c7('0x3d')](_0x59f754[_0xe7c7('0x32')],_0x311046[_0xe7c7('0x33')]),_0x4aa76b);if(_0x59f754[_0xe7c7('0x32')][_0xe7c7('0x3e')]){_0x358b08['where']=_[_0xe7c7('0x3f')](_0x358b08[_0xe7c7('0x3c')],{'$or':_[_0xe7c7('0x2a')](_0x4aa76b,function(_0x16bde0){if(_0x16bde0[_0xe7c7('0x2d')]!=='VIRTUAL'){var _0x3a804f={};_0x3a804f[_0x16bde0[_0xe7c7('0x30')]]={'$like':'%'+_0x59f754[_0xe7c7('0x32')]['filter']+'%'};return _0x3a804f;}})});}_0x358b08=_[_0xe7c7('0x3f')]({},_0x358b08,_0x59f754[_0xe7c7('0x40')]);var _0x80f0c8={'where':_0x358b08[_0xe7c7('0x3c')]};return db[_0xe7c7('0x2b')][_0xe7c7('0x1b')](_0x80f0c8)[_0xe7c7('0x23')](function(_0x4222c5){_0x29c077[_0xe7c7('0x1b')]=_0x4222c5;if(_0x59f754[_0xe7c7('0x32')]['includeAll']){_0x358b08[_0xe7c7('0x41')]=[{'all':!![]}];}return db[_0xe7c7('0x2b')][_0xe7c7('0x42')](_0x358b08);})['then'](function(_0x377370){_0x29c077[_0xe7c7('0x43')]=_0x377370;return _0x29c077;})[_0xe7c7('0x23')](respondWithFilteredResult(_0x57e8fa,_0x358b08))[_0xe7c7('0x44')](handleError(_0x57e8fa,null));};exports[_0xe7c7('0x45')]=function(_0x59b074,_0x580357){var _0x532ba1={'raw':![],'where':{'id':_0x59b074[_0xe7c7('0x46')]['id']}},_0x2dd1ab={};_0x2dd1ab[_0xe7c7('0x2f')]=_[_0xe7c7('0x31')](db[_0xe7c7('0x2b')][_0xe7c7('0x47')]);_0x2dd1ab[_0xe7c7('0x32')]=_[_0xe7c7('0x31')](_0x59b074[_0xe7c7('0x32')]);_0x2dd1ab[_0xe7c7('0x33')]=_[_0xe7c7('0x34')](_0x2dd1ab[_0xe7c7('0x2f')],_0x2dd1ab[_0xe7c7('0x32')]);_0x532ba1[_0xe7c7('0x35')]=_[_0xe7c7('0x34')](_0x2dd1ab[_0xe7c7('0x2f')],qs[_0xe7c7('0x36')](_0x59b074['query'][_0xe7c7('0x36')]));_0x532ba1[_0xe7c7('0x35')]=_0x532ba1[_0xe7c7('0x35')][_0xe7c7('0x37')]?_0x532ba1[_0xe7c7('0x35')]:_0x2dd1ab[_0xe7c7('0x2f')];if(_0x59b074[_0xe7c7('0x32')][_0xe7c7('0x48')]){_0x532ba1['include']=[{'all':!![]}];}_0x532ba1=_[_0xe7c7('0x3f')]({},_0x532ba1,_0x59b074[_0xe7c7('0x40')]);return db['Automation'][_0xe7c7('0x49')](_0x532ba1)[_0xe7c7('0x23')](handleEntityNotFound(_0x580357,null))[_0xe7c7('0x23')](respondWithResult(_0x580357,null))[_0xe7c7('0x44')](handleError(_0x580357,null));};exports[_0xe7c7('0x4a')]=function(_0x98dcd5,_0x23c144){return db[_0xe7c7('0x2b')][_0xe7c7('0x4a')](_0x98dcd5['body'],{})[_0xe7c7('0x23')](respondWithResult(_0x23c144,0xc9))[_0xe7c7('0x44')](handleError(_0x23c144,null));};exports['update']=function(_0x570be7,_0x587869){if(_0x570be7[_0xe7c7('0x4b')]['id']){delete _0x570be7[_0xe7c7('0x4b')]['id'];}return db[_0xe7c7('0x2b')]['find']({'where':{'id':_0x570be7[_0xe7c7('0x46')]['id']}})[_0xe7c7('0x23')](handleEntityNotFound(_0x587869,null))[_0xe7c7('0x23')](saveUpdates(_0x570be7[_0xe7c7('0x4b')],null))[_0xe7c7('0x23')](respondWithResult(_0x587869,null))[_0xe7c7('0x44')](handleError(_0x587869,null));};exports[_0xe7c7('0x24')]=function(_0x1bb4a7,_0x4ccd1e){return db[_0xe7c7('0x2b')][_0xe7c7('0x49')]({'where':{'id':_0x1bb4a7['params']['id']}})[_0xe7c7('0x23')](handleEntityNotFound(_0x4ccd1e,null))['then'](removeEntity(_0x4ccd1e,null))['catch'](handleError(_0x4ccd1e,null));};exports[_0xe7c7('0x4c')]=function(_0x5b3880,_0x341854,_0x282944){return db[_0xe7c7('0x4d')][_0xe7c7('0x49')]({'where':{'id':_0x5b3880['params']['id']}})[_0xe7c7('0x23')](handleEntityNotFound(_0x341854,null))[_0xe7c7('0x23')](function(_0x13a692){if(_0x13a692){return _0x13a692[_0xe7c7('0x4c')](_0x5b3880['body'][_0xe7c7('0x4e')],_[_0xe7c7('0x4f')](_0x5b3880[_0xe7c7('0x4b')],[_0xe7c7('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x341854,null))[_0xe7c7('0x44')](handleError(_0x341854,null));};exports[_0xe7c7('0x50')]=function(_0x50cc60,_0x558a56,_0x1b898e){var _0x21d85a={};var _0x20c704={};var _0x13a6e2;var _0x5a3e18;return db[_0xe7c7('0x2b')][_0xe7c7('0x51')]({'where':{'id':_0x50cc60[_0xe7c7('0x46')]['id']}})[_0xe7c7('0x23')](handleEntityNotFound(_0x558a56,null))[_0xe7c7('0x23')](function(_0x3773c4){if(_0x3773c4){_0x13a6e2=_0x3773c4;_0x20c704[_0xe7c7('0x2f')]=_[_0xe7c7('0x31')](db[_0xe7c7('0x4d')][_0xe7c7('0x47')]);_0x20c704['query']=_['keys'](_0x50cc60[_0xe7c7('0x32')]);_0x20c704['filters']=_['intersection'](_0x20c704[_0xe7c7('0x2f')],_0x20c704[_0xe7c7('0x32')]);_0x21d85a['attributes']=_[_0xe7c7('0x34')](_0x20c704[_0xe7c7('0x2f')],qs[_0xe7c7('0x36')](_0x50cc60['query'][_0xe7c7('0x36')]));_0x21d85a['attributes']=_0x21d85a[_0xe7c7('0x35')][_0xe7c7('0x37')]?_0x21d85a[_0xe7c7('0x35')]:_0x20c704[_0xe7c7('0x2f')];_0x21d85a[_0xe7c7('0x3a')]=qs[_0xe7c7('0x3b')](_0x50cc60[_0xe7c7('0x32')]['sort']);_0x21d85a[_0xe7c7('0x3c')]=qs[_0xe7c7('0x33')](_['pick'](_0x50cc60['query'],_0x20c704[_0xe7c7('0x33')]));if(_0x50cc60[_0xe7c7('0x32')][_0xe7c7('0x3e')]){_0x21d85a[_0xe7c7('0x3c')]=_[_0xe7c7('0x3f')](_0x21d85a[_0xe7c7('0x3c')],{'$or':_[_0xe7c7('0x2a')](_0x21d85a['attributes'],function(_0x41d7f9){var _0x34ba79={};_0x34ba79[_0x41d7f9]={'$like':'%'+_0x50cc60[_0xe7c7('0x32')][_0xe7c7('0x3e')]+'%'};return _0x34ba79;})});}_0x21d85a=_[_0xe7c7('0x3f')]({},_0x21d85a,_0x50cc60['options']);return _0x13a6e2[_0xe7c7('0x50')](_0x21d85a);}})['then'](function(_0x5dfc4d){if(_0x5dfc4d){_0x5a3e18=_0x5dfc4d[_0xe7c7('0x37')];if(!_0x50cc60[_0xe7c7('0x32')][_0xe7c7('0x38')]('nolimit')){_0x21d85a[_0xe7c7('0x1c')]=qs[_0xe7c7('0x1c')](_0x50cc60[_0xe7c7('0x32')]['limit']);_0x21d85a[_0xe7c7('0x19')]=qs[_0xe7c7('0x19')](_0x50cc60[_0xe7c7('0x32')][_0xe7c7('0x19')]);}return _0x13a6e2[_0xe7c7('0x50')](_0x21d85a);}})[_0xe7c7('0x23')](function(_0x3f0749){if(_0x3f0749){return _0x3f0749?{'count':_0x5a3e18,'rows':_0x3f0749}:null;}})[_0xe7c7('0x23')](respondWithResult(_0x558a56,null))['catch'](handleError(_0x558a56,null));};exports['addActions']=function(_0x2d7179,_0x3bcd69,_0x391424){return db[_0xe7c7('0x52')][_0xe7c7('0x49')]({'where':{'id':_0x2d7179[_0xe7c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bcd69,null))[_0xe7c7('0x23')](function(_0x267975){if(_0x267975){return _0x267975[_0xe7c7('0x53')](_0x2d7179[_0xe7c7('0x4b')][_0xe7c7('0x4e')],_[_0xe7c7('0x4f')](_0x2d7179[_0xe7c7('0x4b')],['ids','id'])||{});}})[_0xe7c7('0x23')](respondWithResult(_0x3bcd69,null))[_0xe7c7('0x44')](handleError(_0x3bcd69,null));};exports[_0xe7c7('0x54')]=function(_0x53547b,_0x3b6a21,_0x5e1491){var _0x44842c={};var _0x55fe92={};var _0x1df989;var _0x56bc29;return db[_0xe7c7('0x2b')][_0xe7c7('0x51')]({'where':{'id':_0x53547b[_0xe7c7('0x46')]['id']}})[_0xe7c7('0x23')](handleEntityNotFound(_0x3b6a21,null))[_0xe7c7('0x23')](function(_0x4a8cd3){if(_0x4a8cd3){_0x1df989=_0x4a8cd3;_0x55fe92[_0xe7c7('0x2f')]=_[_0xe7c7('0x31')](db[_0xe7c7('0x52')][_0xe7c7('0x47')]);_0x55fe92['query']=_[_0xe7c7('0x31')](_0x53547b[_0xe7c7('0x32')]);_0x55fe92[_0xe7c7('0x33')]=_['intersection'](_0x55fe92['model'],_0x55fe92[_0xe7c7('0x32')]);_0x44842c[_0xe7c7('0x35')]=_[_0xe7c7('0x34')](_0x55fe92[_0xe7c7('0x2f')],qs[_0xe7c7('0x36')](_0x53547b[_0xe7c7('0x32')][_0xe7c7('0x36')]));_0x44842c[_0xe7c7('0x35')]=_0x44842c[_0xe7c7('0x35')][_0xe7c7('0x37')]?_0x44842c[_0xe7c7('0x35')]:_0x55fe92['model'];_0x44842c[_0xe7c7('0x3a')]=qs['sort'](_0x53547b[_0xe7c7('0x32')][_0xe7c7('0x3b')]);_0x44842c[_0xe7c7('0x3c')]=qs[_0xe7c7('0x33')](_['pick'](_0x53547b[_0xe7c7('0x32')],_0x55fe92['filters']));if(_0x53547b[_0xe7c7('0x32')]['filter']){_0x44842c[_0xe7c7('0x3c')]=_[_0xe7c7('0x3f')](_0x44842c[_0xe7c7('0x3c')],{'$or':_[_0xe7c7('0x2a')](_0x44842c['attributes'],function(_0xf94c90){var _0x1cd832={};_0x1cd832[_0xf94c90]={'$like':'%'+_0x53547b[_0xe7c7('0x32')][_0xe7c7('0x3e')]+'%'};return _0x1cd832;})});}_0x44842c=_[_0xe7c7('0x3f')]({},_0x44842c,_0x53547b['options']);return _0x1df989['getActions'](_0x44842c);}})[_0xe7c7('0x23')](function(_0x42ec1a){if(_0x42ec1a){_0x56bc29=_0x42ec1a[_0xe7c7('0x37')];if(!_0x53547b[_0xe7c7('0x32')]['hasOwnProperty']('nolimit')){_0x44842c[_0xe7c7('0x1c')]=qs['limit'](_0x53547b[_0xe7c7('0x32')][_0xe7c7('0x1c')]);_0x44842c[_0xe7c7('0x19')]=qs['offset'](_0x53547b['query']['offset']);}return _0x1df989[_0xe7c7('0x54')](_0x44842c);}})[_0xe7c7('0x23')](function(_0x5e4534){if(_0x5e4534){return _0x5e4534?{'count':_0x56bc29,'rows':_0x5e4534}:null;}})[_0xe7c7('0x23')](respondWithResult(_0x3b6a21,null))[_0xe7c7('0x44')](handleError(_0x3b6a21,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 2fa4868..6e7e1be 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 _0xecbf=['request-promise','path','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','api','bluebird'];(function(_0x482853,_0x2e3ef1){var _0x387d7d=function(_0x246c16){while(--_0x246c16){_0x482853['push'](_0x482853['shift']());}};_0x387d7d(++_0x2e3ef1);}(_0xecbf,0x150));var _0xfecb=function(_0x53bc22,_0x1b339f){_0x53bc22=_0x53bc22-0x0;var _0x26ef8c=_0xecbf[_0x53bc22];return _0x26ef8c;};'use strict';var _=require(_0xfecb('0x0'));var util=require(_0xfecb('0x1'));var logger=require('../../config/logger')(_0xfecb('0x2'));var moment=require('moment');var BPromise=require(_0xfecb('0x3'));var rp=require(_0xfecb('0x4'));var fs=require('fs');var path=require(_0xfecb('0x5'));var rimraf=require('rimraf');var config=require(_0xfecb('0x6'));var attributes=require(_0xfecb('0x7'));module['exports']=function(_0x5206c7,_0x22803d){return _0x5206c7['define'](_0xfecb('0x8'),attributes,{'tableName':_0xfecb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b37=['define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x45a46b,_0x280a10){var _0x3a727b=function(_0xcf4ca9){while(--_0xcf4ca9){_0x45a46b['push'](_0x45a46b['shift']());}};_0x3a727b(++_0x280a10);}(_0x8b37,0x1bc));var _0x78b3=function(_0x2330b2,_0x5d8d6a){_0x2330b2=_0x2330b2-0x0;var _0x3fc3fd=_0x8b37[_0x2330b2];return _0x3fc3fd;};'use strict';var _=require(_0x78b3('0x0'));var util=require(_0x78b3('0x1'));var logger=require(_0x78b3('0x2'))(_0x78b3('0x3'));var moment=require(_0x78b3('0x4'));var BPromise=require(_0x78b3('0x5'));var rp=require(_0x78b3('0x6'));var fs=require('fs');var path=require(_0x78b3('0x7'));var rimraf=require(_0x78b3('0x8'));var config=require(_0x78b3('0x9'));var attributes=require('./automation.attributes');module[_0x78b3('0xa')]=function(_0x5716bb,_0xc99231){return _0x5716bb[_0x78b3('0xb')]('Automation',attributes,{'tableName':_0x78b3('0xc'),'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 a802de3..6cd140d 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 _0x3da6=['error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x3da6,0xc1));var _0x63da=function(_0x5ad0c0,_0x444dfe){_0x5ad0c0=_0x5ad0c0-0x0;var _0x21bfb0=_0x3da6[_0x5ad0c0];return _0x21bfb0;};'use strict';var _=require(_0x63da('0x0'));var util=require(_0x63da('0x1'));var moment=require(_0x63da('0x2'));var BPromise=require(_0x63da('0x3'));var rs=require(_0x63da('0x4'));var fs=require('fs');var Redis=require(_0x63da('0x5'));var db=require(_0x63da('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x63da('0x7'))(_0x63da('0x8'));var config=require('../../config/environment');var jayson=require(_0x63da('0x9'));var client=jayson['client'][_0x63da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519714,_0x1e6160,_0x7a48ee){return new BPromise(function(_0xbf0f63,_0x39a442){return client['request'](_0x519714,_0x7a48ee)[_0x63da('0xb')](function(_0xdc10c4){logger['info'](_0x63da('0xc'),_0x1e6160,'request\x20sent');logger[_0x63da('0xd')](_0x63da('0xe'),_0x1e6160,_0x63da('0xf'),JSON[_0x63da('0x10')](_0xdc10c4));if(_0xdc10c4[_0x63da('0x11')]){if(_0xdc10c4['error'][_0x63da('0x12')]===0x1f4){logger['error'](_0x63da('0xc'),_0x1e6160,_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);return _0x39a442(_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);}logger[_0x63da('0x11')](_0x63da('0xc'),_0x1e6160,_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);return _0xbf0f63(_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);}else{logger[_0x63da('0x14')](_0x63da('0xc'),_0x1e6160,'request\x20sent');_0xbf0f63(_0xdc10c4['result'][_0x63da('0x13')]);}})['catch'](function(_0x1f2f88){logger[_0x63da('0x11')](_0x63da('0xc'),_0x1e6160,_0x1f2f88);_0x39a442(_0x1f2f88);});});} \ No newline at end of file +var _0x7e27=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x163640,_0x4229a8){var _0x71b140=function(_0x4ffc66){while(--_0x4ffc66){_0x163640['push'](_0x163640['shift']());}};_0x71b140(++_0x4229a8);}(_0x7e27,0xdd));var _0x77e2=function(_0xbdf151,_0x37c46b){_0xbdf151=_0xbdf151-0x0;var _0x35bc75=_0x7e27[_0xbdf151];return _0x35bc75;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101e56,_0x137a61,_0x502153){return new BPromise(function(_0x3c2b3f,_0x2cdfa3){return client[_0x77e2('0xa')](_0x101e56,_0x502153)[_0x77e2('0xb')](function(_0x3802ce){logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');logger['debug'](_0x77e2('0xe'),_0x137a61,'request\x20sent',JSON[_0x77e2('0xf')](_0x3802ce));if(_0x3802ce[_0x77e2('0x10')]){if(_0x3802ce['error']['code']===0x1f4){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce['error'][_0x77e2('0x11')]);return _0x2cdfa3(_0x3802ce['error']['message']);}logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce[_0x77e2('0x10')][_0x77e2('0x11')]);return _0x3c2b3f(_0x3802ce[_0x77e2('0x10')]['message']);}else{logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');_0x3c2b3f(_0x3802ce[_0x77e2('0x12')][_0x77e2('0x11')]);}})[_0x77e2('0x13')](function(_0x1352c1){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x1352c1);_0x2cdfa3(_0x1352c1);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index ac0643c..74e682a 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 _0xd58c=['/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd58c,0xb6));var _0xcd58=function(_0x553090,_0x1c078c){_0x553090=_0x553090-0x0;var _0x2a0eb0=_0xd58c[_0x553090];return _0x2a0eb0;};'use strict';var multer=require(_0xcd58('0x0'));var util=require(_0xcd58('0x1'));var path=require(_0xcd58('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd58('0x3'));var router=express['Router']();var fs_extra=require(_0xcd58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd58('0x5'));var config=require(_0xcd58('0x6'));var controller=require(_0xcd58('0x7'));router[_0xcd58('0x8')]('/',auth[_0xcd58('0x9')](),controller['index']);router['get'](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0xb')]);router[_0xcd58('0x8')](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0xd')]);router[_0xcd58('0x8')]('/:id/actions',auth[_0xcd58('0x9')](),controller['getActions']);router[_0xcd58('0xe')]('/',auth[_0xcd58('0x9')](),controller[_0xcd58('0xf')]);router['post'](_0xcd58('0xc'),auth['isAuthenticated'](),controller[_0xcd58('0x10')]);router['post'](_0xcd58('0x11'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x12')]);router[_0xcd58('0x13')](_0xcd58('0xa'),auth[_0xcd58('0x9')](),controller[_0xcd58('0x14')]);router[_0xcd58('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcd58('0x16')]);module[_0xcd58('0x17')]=router; \ No newline at end of file +var _0xecd5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0xecd5,0x110));var _0x5ecd=function(_0x719c0a,_0x1cf4ff){_0x719c0a=_0x719c0a-0x0;var _0x2ba0aa=_0xecd5[_0x719c0a];return _0x2ba0aa;};'use strict';var multer=require('multer');var util=require(_0x5ecd('0x0'));var path=require(_0x5ecd('0x1'));var timeout=require(_0x5ecd('0x2'));var express=require('express');var router=express[_0x5ecd('0x3')]();var fs_extra=require(_0x5ecd('0x4'));var auth=require(_0x5ecd('0x5'));var interaction=require(_0x5ecd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ecd('0x7'));router['get']('/',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x9')]);router['get'](_0x5ecd('0xa'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xb')]);router[_0x5ecd('0xc')](_0x5ecd('0xd'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0xe')]);router[_0x5ecd('0xc')](_0x5ecd('0xf'),auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x10')]);router[_0x5ecd('0x11')]('/',auth['isAuthenticated'](),controller[_0x5ecd('0x12')]);router['post']('/:id/conditions',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x13')]);router['post']('/:id/actions',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x14')]);router[_0x5ecd('0x15')](_0x5ecd('0xa'),auth['isAuthenticated'](),controller[_0x5ecd('0x16')]);router[_0x5ecd('0x17')]('/:id',auth[_0x5ecd('0x8')](),controller[_0x5ecd('0x18')]);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 2e22ec0..06816c8 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 _0x9d00=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x9d00,0x183));var _0x09d0=function(_0x20ff02,_0x1940c3){_0x20ff02=_0x20ff02-0x0;var _0x307923=_0x9d00[_0x20ff02];return _0x307923;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x09d0('0x0')],'unique':_0x09d0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x09d0('0x2')](_0x09d0('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x09d0('0x0')]},'active':{'type':Sequelize[_0x09d0('0x4')],'defaultValue':0x0,'comment':_0x09d0('0x5')},'limitCalls':{'type':Sequelize[_0x09d0('0x6')](0x4)[_0x09d0('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x09d0('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x09d0('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09d0('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x09d0('0x6')](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x09d0('0x6')](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09d0('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09d0('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x09d0('0xc')},'dialTimezone':{'type':Sequelize[_0x09d0('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x09d0('0x2')]('always',_0x09d0('0xd'),_0x09d0('0xe')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x09d0('0x4')],'defaultValue':0x0,'comment':_0x09d0('0xf')},'dialAMDInitialSilence':{'type':Sequelize[_0x09d0('0x6')](0x9)[_0x09d0('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x09d0('0x10')},'dialAMDGreeting':{'type':Sequelize[_0x09d0('0x6')](0x9)[_0x09d0('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x09d0('0x6')](0x9)[_0x09d0('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x09d0('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x09d0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x09d0('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0x09d0('0x6')](0x9)[_0x09d0('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x09d0('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x09d0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x09d0('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x09d0('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x09d0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x09d0('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x09d0('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x09d0('0x2')](_0x09d0('0x16'),_0x09d0('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x09d0('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x09d0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09d0('0x18')},'dialCutDigit':{'type':Sequelize[_0x09d0('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x09d0('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09d0('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09d0('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x09d0('0x6')](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09d0('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09d0('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09d0('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x09d0('0x6')](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x09d0('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x09d0('0x6')](0x5)[_0x09d0('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x09d0('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x09d0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x09d0('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x59ac=['ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x13fca7,_0x49638c){var _0x2313d9=function(_0x5e8698){while(--_0x5e8698){_0x13fca7['push'](_0x13fca7['shift']());}};_0x2313d9(++_0x49638c);}(_0x59ac,0x73));var _0xc59a=function(_0x16c54f,_0x4bfe19){_0x16c54f=_0x16c54f-0x0;var _0x3663a2=_0x59ac[_0x16c54f];return _0x3663a2;};'use strict';var Sequelize=require(_0xc59a('0x0'));module[_0xc59a('0x1')]={'name':{'type':Sequelize[_0xc59a('0x2')],'unique':_0xc59a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc59a('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xc59a('0x5')},'description':{'type':Sequelize[_0xc59a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc59a('0x6')},'limitCalls':{'type':Sequelize[_0xc59a('0x7')](0x4)[_0xc59a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc59a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc59a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc59a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc59a('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'comment':_0xc59a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc59a('0xf')},'dialTimezone':{'type':Sequelize[_0xc59a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc59a('0x2')],'defaultValue':_0xc59a('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xc59a('0x4')](_0xc59a('0x11'),_0xc59a('0x12'),_0xc59a('0x13')),'defaultValue':_0xc59a('0x11')},'dialAMDActive':{'type':Sequelize[_0xc59a('0x14')],'defaultValue':0x0,'comment':_0xc59a('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xc59a('0x7')](0x9)[_0xc59a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc59a('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xc59a('0x7')](0x9)[_0xc59a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc59a('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc59a('0x7')](0x9)[_0xc59a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc59a('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc59a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc59a('0x19')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc59a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc59a('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc59a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc59a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc59a('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc59a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc59a('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc59a('0x7')](0x9)[_0xc59a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc59a('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc59a('0x4')]('DESC',_0xc59a('0x1e')),'defaultValue':_0xc59a('0x1f')},'dialPrefix':{'type':Sequelize[_0xc59a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc59a('0x7')](0x3)[_0xc59a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc59a('0x20')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc59a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc59a('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc59a('0x7')](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc59a('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0xc59a('0x7')](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc59a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xc59a('0x7')](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc59a('0x7')](0x3)[_0xc59a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc59a('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc59a('0x7')](0x5)[_0xc59a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc59a('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1b51c4c..559bd28 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 _0xd9b2=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','all','CmList','getBlackLists','addBlackLists','push','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','map','Campaign','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','findAll','pick','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert'];(function(_0x89245c,_0x5bb296){var _0x4e9ac2=function(_0x355556){while(--_0x355556){_0x89245c['push'](_0x89245c['shift']());}};_0x4e9ac2(++_0x5bb296);}(_0xd9b2,0x1a3));var _0x2d9b=function(_0x5b7257,_0x3e79ac){_0x5b7257=_0x5b7257-0x0;var _0x32bc7a=_0xd9b2[_0x5b7257];return _0x32bc7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d9b('0x0'));var zipdir=require(_0x2d9b('0x1'));var jsonpatch=require(_0x2d9b('0x2'));var rp=require(_0x2d9b('0x3'));var moment=require(_0x2d9b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d9b('0x5'));var util=require(_0x2d9b('0x6'));var path=require('path');var sox=require(_0x2d9b('0x7'));var csv=require(_0x2d9b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d9b('0x9'));var squel=require('squel');var crypto=require(_0x2d9b('0xa'));var jsforce=require(_0x2d9b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2d9b('0x8'));var querystring=require('querystring');var Papa=require(_0x2d9b('0xc'));var Redis=require(_0x2d9b('0xd'));var authService=require(_0x2d9b('0xe'));var qs=require(_0x2d9b('0xf'));var as=require(_0x2d9b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2d9b('0x11'));var config=require(_0x2d9b('0x12'));var licenseUtil=require(_0x2d9b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35aefa,_0xf4041){_0xf4041=_0xf4041||0xcc;return function(_0x49c3cb){if(_0x49c3cb){return _0x35aefa['sendStatus'](_0xf4041);}return _0x35aefa[_0x2d9b('0x14')](_0xf4041)[_0x2d9b('0x15')]();};}function respondWithResult(_0x39d7b0,_0x218002){_0x218002=_0x218002||0xc8;return function(_0x2a5382){if(_0x2a5382){return _0x39d7b0[_0x2d9b('0x14')](_0x218002)[_0x2d9b('0x16')](_0x2a5382);}};}function respondWithFilteredResult(_0x55ab5e,_0x2c6fa5){return function(_0x576ad8){if(_0x576ad8){var _0x255aa0=typeof _0x2c6fa5[_0x2d9b('0x17')]===_0x2d9b('0x18')&&typeof _0x2c6fa5[_0x2d9b('0x19')]===_0x2d9b('0x18');var _0x5d8807=_0x576ad8['count'];var _0x2a2f53=_0x255aa0?0x0:_0x2c6fa5[_0x2d9b('0x17')];var _0x147eff=_0x255aa0?_0x576ad8[_0x2d9b('0x1a')]:_0x2c6fa5[_0x2d9b('0x17')]+_0x2c6fa5[_0x2d9b('0x19')];var _0x3af466;if(_0x147eff>=_0x5d8807){_0x147eff=_0x5d8807;_0x3af466=0xc8;}else{_0x3af466=0xce;}_0x55ab5e[_0x2d9b('0x14')](_0x3af466);return _0x55ab5e['set'](_0x2d9b('0x1b'),_0x2a2f53+'-'+_0x147eff+'/'+_0x5d8807)[_0x2d9b('0x16')](_0x576ad8);}return null;};}function patchUpdates(_0x250cc7){return function(_0x4c0b1f){try{jsonpatch[_0x2d9b('0x1c')](_0x4c0b1f,_0x250cc7,!![]);}catch(_0xb031da){return BPromise[_0x2d9b('0x1d')](_0xb031da);}return _0x4c0b1f[_0x2d9b('0x1e')]();};}function saveUpdates(_0x42eb23,_0x5e416e){return function(_0x3f3049){if(_0x3f3049){return _0x3f3049[_0x2d9b('0x1f')](_0x42eb23)[_0x2d9b('0x20')](function(_0x1220da){return _0x1220da;});}return null;};}function removeEntity(_0x429115,_0xf92796){return function(_0x4d2e69){if(_0x4d2e69){return _0x4d2e69['destroy']()[_0x2d9b('0x20')](function(){var _0x59726d=_0x4d2e69[_0x2d9b('0x21')]({'plain':!![]});var _0x3250f8=_0x2d9b('0x22');return db[_0x2d9b('0x23')][_0x2d9b('0x24')]({'where':{'type':_0x3250f8,'resourceId':_0x59726d['id']}})[_0x2d9b('0x20')](function(){return _0x4d2e69;});})[_0x2d9b('0x20')](function(){_0x429115[_0x2d9b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f074b,_0x41701c){return function(_0x279cab){if(!_0x279cab){_0x2f074b['sendStatus'](0x194);}return _0x279cab;};}function handleError(_0x175e80,_0x2035f5){_0x2035f5=_0x2035f5||0x1f4;return function(_0x599464){logger[_0x2d9b('0x25')](_0x599464[_0x2d9b('0x26')]);if(_0x599464[_0x2d9b('0x27')]){delete _0x599464[_0x2d9b('0x27')];}_0x175e80['status'](_0x2035f5)[_0x2d9b('0x28')](_0x599464);};}exports['index']=function(_0x1e21a8,_0xf947ed){var _0x5b1c17={},_0x2d6f21={},_0x1abf9b={'count':0x0,'rows':[]};var _0x2db76f=_[_0x2d9b('0x29')](db[_0x2d9b('0x2a')][_0x2d9b('0x2b')],function(_0x3488e2){return{'name':_0x3488e2['fieldName'],'type':_0x3488e2[_0x2d9b('0x2c')][_0x2d9b('0x2d')]};});_0x2d6f21['model']=_[_0x2d9b('0x29')](_0x2db76f,_0x2d9b('0x27'));_0x2d6f21[_0x2d9b('0x2e')]=_[_0x2d9b('0x2f')](_0x1e21a8[_0x2d9b('0x2e')]);_0x2d6f21['filters']=_[_0x2d9b('0x30')](_0x2d6f21[_0x2d9b('0x31')],_0x2d6f21[_0x2d9b('0x2e')]);_0x5b1c17[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x2d6f21[_0x2d9b('0x31')],qs['fields'](_0x1e21a8[_0x2d9b('0x2e')]['fields']));_0x5b1c17['attributes']=_0x5b1c17[_0x2d9b('0x32')][_0x2d9b('0x33')]?_0x5b1c17[_0x2d9b('0x32')]:_0x2d6f21[_0x2d9b('0x31')];if(!_0x1e21a8[_0x2d9b('0x2e')][_0x2d9b('0x34')](_0x2d9b('0x35'))){_0x5b1c17[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x1e21a8[_0x2d9b('0x2e')]['limit']);_0x5b1c17[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x1e21a8[_0x2d9b('0x2e')][_0x2d9b('0x17')]);}_0x5b1c17[_0x2d9b('0x36')]=qs['sort'](_0x1e21a8[_0x2d9b('0x2e')][_0x2d9b('0x37')]);_0x5b1c17[_0x2d9b('0x38')]=qs[_0x2d9b('0x39')](_['pick'](_0x1e21a8['query'],_0x2d6f21['filters']),_0x2db76f);if(_0x1e21a8['query'][_0x2d9b('0x3a')]){_0x5b1c17[_0x2d9b('0x38')]=_[_0x2d9b('0x3b')](_0x5b1c17[_0x2d9b('0x38')],{'$or':_[_0x2d9b('0x29')](_0x2db76f,function(_0x7836e){if(_0x7836e['type']!==_0x2d9b('0x3c')){var _0x19e5e3={};_0x19e5e3[_0x7836e['name']]={'$like':'%'+_0x1e21a8['query'][_0x2d9b('0x3a')]+'%'};return _0x19e5e3;}})});}_0x5b1c17=_[_0x2d9b('0x3b')]({},_0x5b1c17,_0x1e21a8[_0x2d9b('0x3d')]);var _0x5c5089={'where':_0x5b1c17[_0x2d9b('0x38')]};return db[_0x2d9b('0x2a')][_0x2d9b('0x1a')](_0x5c5089)[_0x2d9b('0x20')](function(_0x107190){_0x1abf9b[_0x2d9b('0x1a')]=_0x107190;if(_0x1e21a8[_0x2d9b('0x2e')][_0x2d9b('0x3e')]){_0x5b1c17[_0x2d9b('0x3f')]=[{'all':!![]}];}return db[_0x2d9b('0x2a')]['findAll'](_0x5b1c17);})[_0x2d9b('0x20')](function(_0x9402ef){_0x1abf9b[_0x2d9b('0x40')]=_0x9402ef;return _0x1abf9b;})['then'](respondWithFilteredResult(_0xf947ed,_0x5b1c17))[_0x2d9b('0x41')](handleError(_0xf947ed,null));};exports[_0x2d9b('0x42')]=function(_0x5a3137,_0x238efd){var _0x22bd65={'raw':![],'where':{'id':_0x5a3137[_0x2d9b('0x43')]['id']}},_0x44ab92={};_0x44ab92['model']=_[_0x2d9b('0x2f')](db[_0x2d9b('0x2a')][_0x2d9b('0x2b')]);_0x44ab92[_0x2d9b('0x2e')]=_[_0x2d9b('0x2f')](_0x5a3137[_0x2d9b('0x2e')]);_0x44ab92[_0x2d9b('0x39')]=_[_0x2d9b('0x30')](_0x44ab92[_0x2d9b('0x31')],_0x44ab92[_0x2d9b('0x2e')]);_0x22bd65[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x44ab92[_0x2d9b('0x31')],qs[_0x2d9b('0x44')](_0x5a3137[_0x2d9b('0x2e')][_0x2d9b('0x44')]));_0x22bd65[_0x2d9b('0x32')]=_0x22bd65[_0x2d9b('0x32')][_0x2d9b('0x33')]?_0x22bd65['attributes']:_0x44ab92['model'];if(_0x5a3137['query'][_0x2d9b('0x3e')]){_0x22bd65[_0x2d9b('0x3f')]=[{'all':!![]}];}_0x22bd65=_[_0x2d9b('0x3b')]({},_0x22bd65,_0x5a3137[_0x2d9b('0x3d')]);return db[_0x2d9b('0x2a')]['find'](_0x22bd65)[_0x2d9b('0x20')](handleEntityNotFound(_0x238efd,null))[_0x2d9b('0x20')](respondWithResult(_0x238efd,null))[_0x2d9b('0x41')](handleError(_0x238efd,null));};exports[_0x2d9b('0x45')]=function(_0x12f5ec,_0x44387e){return db[_0x2d9b('0x2a')][_0x2d9b('0x45')](_0x12f5ec['body'],{})[_0x2d9b('0x20')](function(_0xfcb29a){var _0x1ae866=_0x12f5ec[_0x2d9b('0x46')][_0x2d9b('0x21')]({'plain':!![]});if(!_0x1ae866)throw new Error(_0x2d9b('0x47'));if(_0x1ae866[_0x2d9b('0x48')]===_0x2d9b('0x46')){var _0x11e569=_0xfcb29a['get']({'plain':!![]});var _0x4079f1=_0x2d9b('0x22');return db[_0x2d9b('0x49')]['find']({'where':{'name':_0x4079f1,'userProfileId':_0x1ae866['userProfileId']},'raw':!![]})[_0x2d9b('0x20')](function(_0x4eef5e){if(_0x4eef5e&&_0x4eef5e[_0x2d9b('0x4a')]===0x0){return db[_0x2d9b('0x23')]['create']({'name':_0x11e569[_0x2d9b('0x27')],'resourceId':_0x11e569['id'],'type':_0x4eef5e[_0x2d9b('0x27')],'sectionId':_0x4eef5e['id']},{})[_0x2d9b('0x20')](function(){return _0xfcb29a;});}else{return _0xfcb29a;}})[_0x2d9b('0x41')](function(_0x7058ca){logger[_0x2d9b('0x25')](_0x2d9b('0x4b'),_0x7058ca);throw _0x7058ca;});}return _0xfcb29a;})[_0x2d9b('0x20')](respondWithResult(_0x44387e,0xc9))[_0x2d9b('0x41')](handleError(_0x44387e,null));};exports[_0x2d9b('0x4c')]=function(_0x4fa33a,_0x3086b7){var _0x454118={'where':{'id':_0x4fa33a[_0x2d9b('0x43')]['id']}},_0x5049de={};_0x5049de['model']=_['keys'](db[_0x2d9b('0x2a')][_0x2d9b('0x2b')]);_0x454118[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x5049de[_0x2d9b('0x31')],qs[_0x2d9b('0x44')](_0x4fa33a['query'][_0x2d9b('0x44')]));_0x454118[_0x2d9b('0x32')]=_0x454118[_0x2d9b('0x32')]['length']?_0x454118[_0x2d9b('0x32')]:_0x5049de['model'];if(_0x4fa33a[_0x2d9b('0x2e')][_0x2d9b('0x3e')]){_0x454118[_0x2d9b('0x3f')]=[{'all':!![]}];}_0x454118=_[_0x2d9b('0x3b')]({},_0x454118,_0x4fa33a[_0x2d9b('0x3d')]);return db[_0x2d9b('0x2a')][_0x2d9b('0x4d')](_0x454118)[_0x2d9b('0x20')](handleEntityNotFound(_0x3086b7,null))[_0x2d9b('0x20')](function(_0x19b46b){if(_0x19b46b){var _0x5343d3=_0x19b46b[_0x2d9b('0x21')]({'plain':!![]});_0x5343d3=qs['omit'](_0x5343d3,['id',_0x2d9b('0x4e'),'updatedAt']);_0x4fa33a[_0x2d9b('0x4f')]=_['omit'](_0x4fa33a[_0x2d9b('0x4f')],['id',_0x2d9b('0x4e'),_0x2d9b('0x50')]);return db['Campaign'][_0x2d9b('0x45')](_[_0x2d9b('0x3b')](_0x5343d3,_0x4fa33a['body']),{'include':_0x4fa33a[_0x2d9b('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x2d9b('0x20')](function(_0xaa1240){var _0x4ef9d4=_0x4fa33a[_0x2d9b('0x46')][_0x2d9b('0x21')]({'plain':!![]});if(!_0x4ef9d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ef9d4[_0x2d9b('0x48')]==='user'){var _0x32d80f=_0xaa1240[_0x2d9b('0x21')]({'plain':!![]});var _0x3a2316=_0x2d9b('0x22');return db[_0x2d9b('0x49')][_0x2d9b('0x4d')]({'where':{'name':_0x3a2316,'userProfileId':_0x4ef9d4[_0x2d9b('0x51')]},'raw':!![]})['then'](function(_0x51f5dc){if(_0x51f5dc&&_0x51f5dc['autoAssociation']===0x0){return db['UserProfileResource'][_0x2d9b('0x45')]({'name':_0x32d80f['name'],'resourceId':_0x32d80f['id'],'type':_0x51f5dc[_0x2d9b('0x27')],'sectionId':_0x51f5dc['id']},{})[_0x2d9b('0x20')](function(){return _0xaa1240;});}else{return _0xaa1240;}})[_0x2d9b('0x41')](function(_0x10107b){logger[_0x2d9b('0x25')](_0x2d9b('0x4b'),_0x10107b);throw _0x10107b;});}return _0xaa1240;});}})['then'](respondWithResult(_0x3086b7,0xc9))['catch'](handleError(_0x3086b7,null));};exports[_0x2d9b('0x1f')]=function(_0x3ac493,_0x3a7cb5){if(_0x3ac493[_0x2d9b('0x4f')]['id']){delete _0x3ac493[_0x2d9b('0x4f')]['id'];}return db[_0x2d9b('0x2a')][_0x2d9b('0x4d')]({'where':{'id':_0x3ac493[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x3a7cb5,null))['then'](saveUpdates(_0x3ac493[_0x2d9b('0x4f')],null))[_0x2d9b('0x20')](respondWithResult(_0x3a7cb5,null))[_0x2d9b('0x41')](handleError(_0x3a7cb5,null));};exports[_0x2d9b('0x24')]=function(_0x5cf2ae,_0x4c1b41){return db[_0x2d9b('0x2a')][_0x2d9b('0x4d')]({'where':{'id':_0x5cf2ae[_0x2d9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c1b41,null))[_0x2d9b('0x20')](removeEntity(_0x4c1b41,null))[_0x2d9b('0x41')](handleError(_0x4c1b41,null));};exports[_0x2d9b('0x52')]=function(_0x420592,_0x327c5e,_0x49267e){var _0x5b2bf9={'raw':!![],'where':{}};var _0xeb0c57={};var _0x3c433d={'count':0x0,'rows':[]};return db[_0x2d9b('0x2a')][_0x2d9b('0x53')]({'where':{'id':_0x420592[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x327c5e,null))[_0x2d9b('0x20')](function(_0x27f46f){if(_0x27f46f){_0xeb0c57[_0x2d9b('0x31')]=_['keys'](db[_0x2d9b('0x54')][_0x2d9b('0x2b')]);_0xeb0c57['query']=_[_0x2d9b('0x2f')](_0x420592['query']);_0xeb0c57[_0x2d9b('0x39')]=_[_0x2d9b('0x30')](_0xeb0c57[_0x2d9b('0x31')],_0xeb0c57[_0x2d9b('0x2e')]);_0x5b2bf9['attributes']=_[_0x2d9b('0x30')](_0xeb0c57[_0x2d9b('0x31')],qs[_0x2d9b('0x44')](_0x420592['query'][_0x2d9b('0x44')]));_0x5b2bf9[_0x2d9b('0x32')]=_0x5b2bf9[_0x2d9b('0x32')]['length']?_0x5b2bf9[_0x2d9b('0x32')]:_0xeb0c57[_0x2d9b('0x31')];if(!_0x420592['query']['hasOwnProperty'](_0x2d9b('0x35'))){_0x5b2bf9[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x420592[_0x2d9b('0x2e')][_0x2d9b('0x19')]);_0x5b2bf9['offset']=qs['offset'](_0x420592[_0x2d9b('0x2e')][_0x2d9b('0x17')]);}_0x5b2bf9[_0x2d9b('0x36')]=qs[_0x2d9b('0x37')](_0x420592['query'][_0x2d9b('0x37')]);_0x5b2bf9[_0x2d9b('0x38')]=qs[_0x2d9b('0x39')](_['pick'](_0x420592[_0x2d9b('0x2e')],_0xeb0c57[_0x2d9b('0x39')]));_0x5b2bf9['where']['CampaignId']=_0x27f46f['id'];if(_0x420592[_0x2d9b('0x2e')]['filter']){_0x5b2bf9['where']=_[_0x2d9b('0x3b')](_0x5b2bf9[_0x2d9b('0x38')],{'$or':_[_0x2d9b('0x29')](_0x5b2bf9['attributes'],function(_0x231375){var _0x4b4ba={};_0x4b4ba[_0x231375]={'$like':'%'+_0x420592[_0x2d9b('0x2e')][_0x2d9b('0x3a')]+'%'};return _0x4b4ba;})});}_0x5b2bf9=_['merge']({},_0x5b2bf9,_0x420592[_0x2d9b('0x3d')]);return db[_0x2d9b('0x54')]['count']({'where':_0x5b2bf9[_0x2d9b('0x38')]})[_0x2d9b('0x20')](function(_0x2f1028){_0x3c433d[_0x2d9b('0x1a')]=_0x2f1028;if(_0x420592['query'][_0x2d9b('0x3e')]){_0x5b2bf9[_0x2d9b('0x3f')]=[{'all':!![]}];}return db[_0x2d9b('0x54')][_0x2d9b('0x55')](_0x5b2bf9);})[_0x2d9b('0x20')](function(_0x30ece9){_0x3c433d[_0x2d9b('0x40')]=_0x30ece9;return _0x3c433d;});}})[_0x2d9b('0x20')](respondWithFilteredResult(_0x327c5e,_0x5b2bf9))['catch'](handleError(_0x327c5e,null));};exports['getHopperHistories']=function(_0x559dd8,_0x112039,_0x2a6157){var _0x3b1896={'raw':!![],'where':{}};var _0x46a199={};var _0x495f93={'count':0x0,'rows':[]};return db[_0x2d9b('0x2a')]['findOne']({'where':{'id':_0x559dd8[_0x2d9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x112039,null))[_0x2d9b('0x20')](function(_0x198c11){if(_0x198c11){_0x46a199['model']=_[_0x2d9b('0x2f')](db['CmHopperHistory'][_0x2d9b('0x2b')]);_0x46a199[_0x2d9b('0x2e')]=_[_0x2d9b('0x2f')](_0x559dd8[_0x2d9b('0x2e')]);_0x46a199['filters']=_[_0x2d9b('0x30')](_0x46a199[_0x2d9b('0x31')],_0x46a199['query']);_0x3b1896[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x46a199['model'],qs[_0x2d9b('0x44')](_0x559dd8[_0x2d9b('0x2e')][_0x2d9b('0x44')]));_0x3b1896[_0x2d9b('0x32')]=_0x3b1896[_0x2d9b('0x32')][_0x2d9b('0x33')]?_0x3b1896['attributes']:_0x46a199[_0x2d9b('0x31')];if(!_0x559dd8['query'][_0x2d9b('0x34')]('nolimit')){_0x3b1896[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x559dd8[_0x2d9b('0x2e')]['limit']);_0x3b1896[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x559dd8[_0x2d9b('0x2e')][_0x2d9b('0x17')]);}_0x3b1896[_0x2d9b('0x36')]=qs[_0x2d9b('0x37')](_0x559dd8[_0x2d9b('0x2e')]['sort']);_0x3b1896['where']=qs[_0x2d9b('0x39')](_[_0x2d9b('0x56')](_0x559dd8[_0x2d9b('0x2e')],_0x46a199[_0x2d9b('0x39')]));_0x3b1896[_0x2d9b('0x38')][_0x2d9b('0x57')]=_0x198c11['id'];if(_0x559dd8[_0x2d9b('0x2e')][_0x2d9b('0x3a')]){_0x3b1896['where']=_['merge'](_0x3b1896['where'],{'$or':_[_0x2d9b('0x29')](_0x3b1896[_0x2d9b('0x32')],function(_0x2d5f65){var _0x33f1c1={};_0x33f1c1[_0x2d5f65]={'$like':'%'+_0x559dd8[_0x2d9b('0x2e')][_0x2d9b('0x3a')]+'%'};return _0x33f1c1;})});}_0x3b1896=_['merge']({},_0x3b1896,_0x559dd8[_0x2d9b('0x3d')]);return db['CmHopperHistory'][_0x2d9b('0x1a')]({'where':_0x3b1896[_0x2d9b('0x38')]})[_0x2d9b('0x20')](function(_0x38f082){_0x495f93[_0x2d9b('0x1a')]=_0x38f082;if(_0x559dd8[_0x2d9b('0x2e')][_0x2d9b('0x3e')]){_0x3b1896[_0x2d9b('0x3f')]=[{'all':!![]}];}return db[_0x2d9b('0x58')]['findAll'](_0x3b1896);})[_0x2d9b('0x20')](function(_0x28fa32){_0x495f93[_0x2d9b('0x40')]=_0x28fa32;return _0x495f93;});}})[_0x2d9b('0x20')](respondWithFilteredResult(_0x112039,_0x3b1896))[_0x2d9b('0x41')](handleError(_0x112039,null));};exports[_0x2d9b('0x59')]=function(_0x21aa65,_0x3fabbe,_0x2aa88b){var _0x4315f2={'raw':!![],'where':{}};var _0x23eac8={};var _0x4912bf={'count':0x0,'rows':[]};return db[_0x2d9b('0x2a')]['findOne']({'where':{'id':_0x21aa65['params']['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x3fabbe,null))[_0x2d9b('0x20')](function(_0x336e78){if(_0x336e78){_0x23eac8[_0x2d9b('0x31')]=_[_0x2d9b('0x2f')](db[_0x2d9b('0x5a')][_0x2d9b('0x2b')]);_0x23eac8['query']=_[_0x2d9b('0x2f')](_0x21aa65[_0x2d9b('0x2e')]);_0x23eac8['filters']=_[_0x2d9b('0x30')](_0x23eac8['model'],_0x23eac8[_0x2d9b('0x2e')]);_0x4315f2[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x23eac8[_0x2d9b('0x31')],qs['fields'](_0x21aa65['query']['fields']));_0x4315f2[_0x2d9b('0x32')]=_0x4315f2[_0x2d9b('0x32')]['length']?_0x4315f2[_0x2d9b('0x32')]:_0x23eac8[_0x2d9b('0x31')];if(!_0x21aa65[_0x2d9b('0x2e')]['hasOwnProperty'](_0x2d9b('0x35'))){_0x4315f2[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x21aa65[_0x2d9b('0x2e')][_0x2d9b('0x19')]);_0x4315f2[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x21aa65[_0x2d9b('0x2e')][_0x2d9b('0x17')]);}_0x4315f2['order']=qs[_0x2d9b('0x37')](_0x21aa65['query']['sort']);_0x4315f2[_0x2d9b('0x38')]=qs[_0x2d9b('0x39')](_[_0x2d9b('0x56')](_0x21aa65['query'],_0x23eac8['filters']));_0x4315f2[_0x2d9b('0x38')]['CampaignId']=_0x336e78['id'];if(_0x21aa65[_0x2d9b('0x2e')][_0x2d9b('0x3a')]){_0x4315f2[_0x2d9b('0x38')]=_['merge'](_0x4315f2[_0x2d9b('0x38')],{'$or':_[_0x2d9b('0x29')](_0x4315f2[_0x2d9b('0x32')],function(_0x23e64a){var _0x1a4393={};_0x1a4393[_0x23e64a]={'$like':'%'+_0x21aa65[_0x2d9b('0x2e')][_0x2d9b('0x3a')]+'%'};return _0x1a4393;})});}_0x4315f2=_[_0x2d9b('0x3b')]({},_0x4315f2,_0x21aa65[_0x2d9b('0x3d')]);return db[_0x2d9b('0x5a')][_0x2d9b('0x1a')]({'where':_0x4315f2[_0x2d9b('0x38')]})['then'](function(_0x6ad1){_0x4912bf['count']=_0x6ad1;if(_0x21aa65[_0x2d9b('0x2e')][_0x2d9b('0x3e')]){_0x4315f2[_0x2d9b('0x3f')]=[{'all':!![]}];}return db[_0x2d9b('0x5a')][_0x2d9b('0x55')](_0x4315f2);})[_0x2d9b('0x20')](function(_0x2d7b0c){_0x4912bf[_0x2d9b('0x40')]=_0x2d7b0c;return _0x4912bf;});}})['then'](respondWithFilteredResult(_0x3fabbe,_0x4315f2))[_0x2d9b('0x41')](handleError(_0x3fabbe,null));};exports[_0x2d9b('0x5b')]=function(_0x40cd51,_0x83e790,_0x28371a){var _0x1cee6e={'raw':!![],'where':{}};var _0x3e1688={};var _0x1515b0={'count':0x0,'rows':[]};return db['Campaign'][_0x2d9b('0x53')]({'where':{'id':_0x40cd51[_0x2d9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x83e790,null))[_0x2d9b('0x20')](function(_0x103f21){if(_0x103f21){_0x3e1688[_0x2d9b('0x31')]=_[_0x2d9b('0x2f')](db[_0x2d9b('0x5c')]['rawAttributes']);_0x3e1688[_0x2d9b('0x2e')]=_[_0x2d9b('0x2f')](_0x40cd51['query']);_0x3e1688[_0x2d9b('0x39')]=_[_0x2d9b('0x30')](_0x3e1688[_0x2d9b('0x31')],_0x3e1688['query']);_0x1cee6e[_0x2d9b('0x32')]=_['intersection'](_0x3e1688['model'],qs[_0x2d9b('0x44')](_0x40cd51[_0x2d9b('0x2e')]['fields']));_0x1cee6e[_0x2d9b('0x32')]=_0x1cee6e[_0x2d9b('0x32')][_0x2d9b('0x33')]?_0x1cee6e[_0x2d9b('0x32')]:_0x3e1688[_0x2d9b('0x31')];if(!_0x40cd51[_0x2d9b('0x2e')]['hasOwnProperty'](_0x2d9b('0x35'))){_0x1cee6e[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x40cd51['query']['limit']);_0x1cee6e[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x40cd51['query'][_0x2d9b('0x17')]);}_0x1cee6e[_0x2d9b('0x36')]=qs[_0x2d9b('0x37')](_0x40cd51[_0x2d9b('0x2e')][_0x2d9b('0x37')]);_0x1cee6e[_0x2d9b('0x38')]=qs[_0x2d9b('0x39')](_[_0x2d9b('0x56')](_0x40cd51[_0x2d9b('0x2e')],_0x3e1688[_0x2d9b('0x39')]));_0x1cee6e['where'][_0x2d9b('0x57')]=_0x103f21['id'];if(_0x40cd51['query'][_0x2d9b('0x3a')]){_0x1cee6e[_0x2d9b('0x38')]=_[_0x2d9b('0x3b')](_0x1cee6e['where'],{'$or':_[_0x2d9b('0x29')](_0x1cee6e['attributes'],function(_0x598078){var _0x5aa7f3={};_0x5aa7f3[_0x598078]={'$like':'%'+_0x40cd51['query'][_0x2d9b('0x3a')]+'%'};return _0x5aa7f3;})});}_0x1cee6e=_[_0x2d9b('0x3b')]({},_0x1cee6e,_0x40cd51[_0x2d9b('0x3d')]);return db[_0x2d9b('0x5c')][_0x2d9b('0x1a')]({'where':_0x1cee6e[_0x2d9b('0x38')]})[_0x2d9b('0x20')](function(_0x53e5e7){_0x1515b0[_0x2d9b('0x1a')]=_0x53e5e7;if(_0x40cd51[_0x2d9b('0x2e')][_0x2d9b('0x3e')]){_0x1cee6e['include']=[{'all':!![]}];}return db[_0x2d9b('0x5c')]['findAll'](_0x1cee6e);})[_0x2d9b('0x20')](function(_0x163e0f){_0x1515b0[_0x2d9b('0x40')]=_0x163e0f;return _0x1515b0;});}})[_0x2d9b('0x20')](respondWithFilteredResult(_0x83e790,_0x1cee6e))[_0x2d9b('0x41')](handleError(_0x83e790,null));};exports[_0x2d9b('0x5d')]=function(_0x503e8b,_0x21c8e8,_0x8660a2){var _0x6e5b4={};var _0xc939c={};var _0x3f6914;var _0x12c67e;return db['Campaign'][_0x2d9b('0x53')]({'where':{'id':_0x503e8b[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x21c8e8,null))[_0x2d9b('0x20')](function(_0x148476){if(_0x148476){_0x3f6914=_0x148476;_0xc939c[_0x2d9b('0x31')]=_[_0x2d9b('0x2f')](db['CmList'][_0x2d9b('0x2b')]);_0xc939c['query']=_['keys'](_0x503e8b[_0x2d9b('0x2e')]);_0xc939c[_0x2d9b('0x39')]=_[_0x2d9b('0x30')](_0xc939c['model'],_0xc939c[_0x2d9b('0x2e')]);_0x6e5b4[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0xc939c[_0x2d9b('0x31')],qs[_0x2d9b('0x44')](_0x503e8b[_0x2d9b('0x2e')][_0x2d9b('0x44')]));_0x6e5b4['attributes']=_0x6e5b4[_0x2d9b('0x32')][_0x2d9b('0x33')]?_0x6e5b4['attributes']:_0xc939c['model'];_0x6e5b4['order']=qs[_0x2d9b('0x37')](_0x503e8b[_0x2d9b('0x2e')][_0x2d9b('0x37')]);_0x6e5b4['where']=qs['filters'](_[_0x2d9b('0x56')](_0x503e8b['query'],_0xc939c['filters']));if(_0x503e8b[_0x2d9b('0x2e')]['filter']){_0x6e5b4['where']=_[_0x2d9b('0x3b')](_0x6e5b4[_0x2d9b('0x38')],{'$or':_[_0x2d9b('0x29')](_0x6e5b4['attributes'],function(_0x56f3df){var _0x7f148e={};_0x7f148e[_0x56f3df]={'$like':'%'+_0x503e8b[_0x2d9b('0x2e')][_0x2d9b('0x3a')]+'%'};return _0x7f148e;})});}_0x6e5b4=_[_0x2d9b('0x3b')]({},_0x6e5b4,_0x503e8b[_0x2d9b('0x3d')]);return _0x3f6914[_0x2d9b('0x5d')](_0x6e5b4);}})[_0x2d9b('0x20')](function(_0x49fad7){if(_0x49fad7){_0x12c67e=_0x49fad7[_0x2d9b('0x33')];if(!_0x503e8b['query'][_0x2d9b('0x34')](_0x2d9b('0x35'))){_0x6e5b4['limit']=qs[_0x2d9b('0x19')](_0x503e8b[_0x2d9b('0x2e')][_0x2d9b('0x19')]);_0x6e5b4[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x503e8b[_0x2d9b('0x2e')]['offset']);}return _0x3f6914[_0x2d9b('0x5d')](_0x6e5b4);}})[_0x2d9b('0x20')](function(_0x54f485){if(_0x54f485){return _0x54f485?{'count':_0x12c67e,'rows':_0x54f485}:null;}})[_0x2d9b('0x20')](respondWithResult(_0x21c8e8,null))[_0x2d9b('0x41')](handleError(_0x21c8e8,null));};exports[_0x2d9b('0x5e')]=function(_0x1df14e,_0x463de2,_0x31d998){var _0x3eb76d,_0x3210c2;return db[_0x2d9b('0x2a')][_0x2d9b('0x4d')]({'where':{'id':_0x1df14e[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x463de2,null))[_0x2d9b('0x20')](function(_0x531154){if(_0x531154){_0x3210c2=_0x531154;return _0x531154[_0x2d9b('0x5e')](_0x1df14e[_0x2d9b('0x4f')][_0x2d9b('0x5f')],_[_0x2d9b('0x60')](_0x1df14e[_0x2d9b('0x4f')],['ids','id'])||{});}return null;})[_0x2d9b('0x61')](function(_0x3f9e83){var _0x5517c0;_0x3eb76d=_0x3f9e83||[];var _0x40a087=[];if(_0x3f9e83){for(var _0x1ff5a0=0x0;_0x1ff5a0<_0x3f9e83['length'];_0x1ff5a0+=0x1){var _0x3b04d2=_0x3f9e83[_0x1ff5a0][_0x2d9b('0x21')]({'plain':!![]});_0x3210c2[_0x2d9b('0x62')]=_0x1df14e[_0x2d9b('0x4f')][_0x2d9b('0x62')]?_0x1df14e[_0x2d9b('0x4f')][_0x2d9b('0x62')]:_0x3210c2[_0x2d9b('0x62')];switch(_0x3210c2['dialCheckDuplicateType']){case _0x2d9b('0x63'):_0x5517c0=squel[_0x2d9b('0x64')]()[_0x2d9b('0x65')](_0x2d9b('0x66'))[_0x2d9b('0x67')]([_0x2d9b('0x68'),_0x2d9b('0x69'),_0x2d9b('0x6a'),_0x2d9b('0x6b'),_0x2d9b('0x57'),_0x2d9b('0x4e'),_0x2d9b('0x50')],squel['select']()[_0x2d9b('0x6c')]('phone',_0x2d9b('0x68'))[_0x2d9b('0x6c')](_0x2d9b('0x6d'),_0x2d9b('0x69'))['field']('id',_0x2d9b('0x6a'))['field'](_0x3b04d2[_0x2d9b('0x6e')][_0x2d9b('0x6f')](),_0x2d9b('0x6b'))[_0x2d9b('0x6c')](_0x1df14e['params']['id'][_0x2d9b('0x6f')](),'CampaignId')[_0x2d9b('0x6c')](_0x2d9b('0x6d'),'createdAt')[_0x2d9b('0x6c')](_0x2d9b('0x6d'),'updatedAt')[_0x2d9b('0x70')](_0x2d9b('0x71'))[_0x2d9b('0x38')](_0x2d9b('0x72'))[_0x2d9b('0x38')](_0x2d9b('0x73'),_0x3b04d2['CmListId'][_0x2d9b('0x6f')]())[_0x2d9b('0x38')](_0x2d9b('0x74'))[_0x2d9b('0x38')](_0x2d9b('0x75'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0x2d9b('0x70')](_0x2d9b('0x76'))[_0x2d9b('0x38')](_0x2d9b('0x77'),_0x1df14e[_0x2d9b('0x43')]['id'][_0x2d9b('0x6f')]()))[_0x2d9b('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2d9b('0x78')]()[_0x2d9b('0x6c')](_0x2d9b('0x79'))[_0x2d9b('0x70')](_0x2d9b('0x66'))[_0x2d9b('0x38')]('CampaignId\x20=\x20?',_0x1df14e['params']['id'][_0x2d9b('0x6f')]())))[_0x2d9b('0x6f')]();break;case _0x2d9b('0x7a'):_0x5517c0=squel[_0x2d9b('0x64')]()[_0x2d9b('0x65')](_0x2d9b('0x66'))['fromQuery']([_0x2d9b('0x68'),'scheduledAt',_0x2d9b('0x6a'),'ListId',_0x2d9b('0x57'),_0x2d9b('0x4e'),_0x2d9b('0x50')],squel[_0x2d9b('0x78')]()[_0x2d9b('0x6c')](_0x2d9b('0x68'),_0x2d9b('0x68'))[_0x2d9b('0x6c')]('NOW()',_0x2d9b('0x69'))[_0x2d9b('0x6c')]('id',_0x2d9b('0x6a'))[_0x2d9b('0x6c')](_0x3b04d2[_0x2d9b('0x6e')]['toString'](),'ListId')[_0x2d9b('0x6c')](_0x1df14e[_0x2d9b('0x43')]['id'][_0x2d9b('0x6f')](),_0x2d9b('0x57'))[_0x2d9b('0x6c')](_0x2d9b('0x6d'),_0x2d9b('0x4e'))[_0x2d9b('0x6c')](_0x2d9b('0x6d'),_0x2d9b('0x50'))['from'](_0x2d9b('0x71'))[_0x2d9b('0x38')](_0x2d9b('0x72'))[_0x2d9b('0x38')](_0x2d9b('0x73'),_0x3b04d2['CmListId'][_0x2d9b('0x6f')]())['where'](_0x2d9b('0x74'))[_0x2d9b('0x38')](_0x2d9b('0x75'),squel['select']()[_0x2d9b('0x6c')](_0x2d9b('0x79'))[_0x2d9b('0x70')](_0x2d9b('0x66'))[_0x2d9b('0x38')]('CampaignId\x20=\x20?',_0x1df14e[_0x2d9b('0x43')]['id']['toString']())))['toString']();break;default:_0x5517c0=squel[_0x2d9b('0x64')]()['into'](_0x2d9b('0x66'))[_0x2d9b('0x67')]([_0x2d9b('0x68'),_0x2d9b('0x69'),_0x2d9b('0x6a'),_0x2d9b('0x6b'),_0x2d9b('0x57'),_0x2d9b('0x4e'),_0x2d9b('0x50')],squel['select']()['field']('phone','phone')[_0x2d9b('0x6c')](_0x2d9b('0x6d'),_0x2d9b('0x69'))['field']('id',_0x2d9b('0x6a'))[_0x2d9b('0x6c')](_0x3b04d2['CmListId'][_0x2d9b('0x6f')](),_0x2d9b('0x6b'))[_0x2d9b('0x6c')](_0x1df14e[_0x2d9b('0x43')]['id']['toString'](),_0x2d9b('0x57'))[_0x2d9b('0x6c')](_0x2d9b('0x6d'),_0x2d9b('0x4e'))['field'](_0x2d9b('0x6d'),_0x2d9b('0x50'))[_0x2d9b('0x70')]('cm_contacts')['where'](_0x2d9b('0x72'))['where'](_0x2d9b('0x73'),_0x3b04d2[_0x2d9b('0x6e')]['toString']())[_0x2d9b('0x38')](_0x2d9b('0x74')))['toString']();}_0x40a087['push'](db['sequelize'][_0x2d9b('0x2e')](_0x5517c0));}return BPromise[_0x2d9b('0x7b')](_0x40a087);}})[_0x2d9b('0x20')](function(){return _0x3eb76d;})['then'](respondWithResult(_0x463de2,null))['catch'](handleError(_0x463de2,null));};exports['removeLists']=function(_0x50ae2a,_0x58ef52,_0x3356d9){return db['Campaign'][_0x2d9b('0x4d')]({'where':{'id':_0x50ae2a[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x58ef52,null))['then'](function(_0x1eaf3c){if(_0x1eaf3c){return _0x1eaf3c['removeLists'](_0x50ae2a[_0x2d9b('0x2e')][_0x2d9b('0x5f')]);}})[_0x2d9b('0x20')](function(_0xd9731c){if(_0xd9731c){return db[_0x2d9b('0x54')]['destroy']({'where':{'ListId':_0x50ae2a[_0x2d9b('0x2e')]['ids'],'CampaignId':_0x50ae2a[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](function(){return _0xd9731c;});}})[_0x2d9b('0x20')](respondWithStatusCode(_0x58ef52,null))[_0x2d9b('0x41')](handleError(_0x58ef52,null));};exports['getBlackLists']=function(_0x488ff4,_0x2437d4,_0x3df444){var _0x677498={};var _0x5b889b={};var _0x569b76;var _0x1ed5de;return db[_0x2d9b('0x2a')][_0x2d9b('0x53')]({'where':{'id':_0x488ff4[_0x2d9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2437d4,null))['then'](function(_0x50c399){if(_0x50c399){_0x569b76=_0x50c399;_0x5b889b[_0x2d9b('0x31')]=_[_0x2d9b('0x2f')](db[_0x2d9b('0x7c')]['rawAttributes']);_0x5b889b[_0x2d9b('0x2e')]=_['keys'](_0x488ff4[_0x2d9b('0x2e')]);_0x5b889b['filters']=_[_0x2d9b('0x30')](_0x5b889b[_0x2d9b('0x31')],_0x5b889b[_0x2d9b('0x2e')]);_0x677498[_0x2d9b('0x32')]=_[_0x2d9b('0x30')](_0x5b889b[_0x2d9b('0x31')],qs[_0x2d9b('0x44')](_0x488ff4['query'][_0x2d9b('0x44')]));_0x677498['attributes']=_0x677498[_0x2d9b('0x32')]['length']?_0x677498[_0x2d9b('0x32')]:_0x5b889b[_0x2d9b('0x31')];_0x677498[_0x2d9b('0x36')]=qs[_0x2d9b('0x37')](_0x488ff4[_0x2d9b('0x2e')][_0x2d9b('0x37')]);_0x677498[_0x2d9b('0x38')]=qs[_0x2d9b('0x39')](_[_0x2d9b('0x56')](_0x488ff4[_0x2d9b('0x2e')],_0x5b889b[_0x2d9b('0x39')]));if(_0x488ff4[_0x2d9b('0x2e')][_0x2d9b('0x3a')]){_0x677498[_0x2d9b('0x38')]=_[_0x2d9b('0x3b')](_0x677498[_0x2d9b('0x38')],{'$or':_[_0x2d9b('0x29')](_0x677498[_0x2d9b('0x32')],function(_0x4000e6){var _0x10ab30={};_0x10ab30[_0x4000e6]={'$like':'%'+_0x488ff4[_0x2d9b('0x2e')][_0x2d9b('0x3a')]+'%'};return _0x10ab30;})});}_0x677498=_[_0x2d9b('0x3b')]({},_0x677498,_0x488ff4['options']);return _0x569b76[_0x2d9b('0x7d')](_0x677498);}})[_0x2d9b('0x20')](function(_0x26bad6){if(_0x26bad6){_0x1ed5de=_0x26bad6[_0x2d9b('0x33')];if(!_0x488ff4[_0x2d9b('0x2e')]['hasOwnProperty'](_0x2d9b('0x35'))){_0x677498[_0x2d9b('0x19')]=qs[_0x2d9b('0x19')](_0x488ff4[_0x2d9b('0x2e')][_0x2d9b('0x19')]);_0x677498[_0x2d9b('0x17')]=qs[_0x2d9b('0x17')](_0x488ff4['query'][_0x2d9b('0x17')]);}return _0x569b76[_0x2d9b('0x7d')](_0x677498);}})[_0x2d9b('0x20')](function(_0x3e9104){if(_0x3e9104){return _0x3e9104?{'count':_0x1ed5de,'rows':_0x3e9104}:null;}})[_0x2d9b('0x20')](respondWithResult(_0x2437d4,null))['catch'](handleError(_0x2437d4,null));};exports[_0x2d9b('0x7e')]=function(_0xb12942,_0x3ba1e9,_0xe13cf6){var _0x2e88ce,_0x5db325;return db[_0x2d9b('0x2a')]['find']({'where':{'id':_0xb12942[_0x2d9b('0x43')]['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x3ba1e9,null))[_0x2d9b('0x20')](function(_0x5e8228){if(_0x5e8228){_0x5db325=_0x5e8228;return _0x5e8228[_0x2d9b('0x7e')](_0xb12942[_0x2d9b('0x4f')][_0x2d9b('0x5f')],_[_0x2d9b('0x60')](_0xb12942['body'],[_0x2d9b('0x5f'),'id'])||{});}return null;})[_0x2d9b('0x61')](function(_0x40ebb4){var _0x1b0c5e;_0x2e88ce=_0x40ebb4||[];var _0x1562b5=[];if(_0x40ebb4){for(var _0x4ae48f=0x0;_0x4ae48f<_0x40ebb4[_0x2d9b('0x33')];_0x4ae48f+=0x1){var _0x47477d=_0x40ebb4[_0x4ae48f][_0x2d9b('0x21')]({'plain':!![]});_0x1b0c5e=squel[_0x2d9b('0x64')]()[_0x2d9b('0x65')]('cm_hopper_black')[_0x2d9b('0x67')]([_0x2d9b('0x68'),_0x2d9b('0x6a'),'ListId','CampaignId',_0x2d9b('0x4e'),_0x2d9b('0x50')],squel[_0x2d9b('0x78')]()[_0x2d9b('0x6c')](_0x2d9b('0x68'),_0x2d9b('0x68'))[_0x2d9b('0x6c')]('id',_0x2d9b('0x6a'))[_0x2d9b('0x6c')](_0x47477d[_0x2d9b('0x6e')][_0x2d9b('0x6f')](),_0x2d9b('0x6b'))[_0x2d9b('0x6c')](_0xb12942[_0x2d9b('0x43')]['id'][_0x2d9b('0x6f')](),_0x2d9b('0x57'))['field'](_0x2d9b('0x6d'),'createdAt')[_0x2d9b('0x6c')](_0x2d9b('0x6d'),'updatedAt')['from'](_0x2d9b('0x71'))[_0x2d9b('0x38')](_0x2d9b('0x72'))[_0x2d9b('0x38')](_0x2d9b('0x73'),_0x47477d[_0x2d9b('0x6e')][_0x2d9b('0x6f')]())[_0x2d9b('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x2d9b('0x6f')]();_0x1562b5[_0x2d9b('0x7f')](db[_0x2d9b('0x80')][_0x2d9b('0x2e')](_0x1b0c5e));}return BPromise[_0x2d9b('0x7b')](_0x1562b5);}})[_0x2d9b('0x20')](function(){return _0x2e88ce;})[_0x2d9b('0x20')](respondWithResult(_0x3ba1e9,null))[_0x2d9b('0x41')](handleError(_0x3ba1e9,null));};exports[_0x2d9b('0x81')]=function(_0x1a9c63,_0x3db194,_0x15038d){return db[_0x2d9b('0x2a')][_0x2d9b('0x4d')]({'where':{'id':_0x1a9c63['params']['id']}})[_0x2d9b('0x20')](handleEntityNotFound(_0x3db194,null))['then'](function(_0x37d0ac){if(_0x37d0ac){return _0x37d0ac['removeBlackLists'](_0x1a9c63[_0x2d9b('0x2e')][_0x2d9b('0x5f')]);}})['then'](function(_0x5e9801){if(_0x5e9801){return db[_0x2d9b('0x5c')]['destroy']({'where':{'ListId':_0x1a9c63[_0x2d9b('0x2e')][_0x2d9b('0x5f')],'CampaignId':_0x1a9c63['params']['id']}})['then'](function(){return _0x5e9801;});}})[_0x2d9b('0x20')](respondWithStatusCode(_0x3db194,null))['catch'](handleError(_0x3db194,null));}; \ No newline at end of file +var _0x9254=['CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','ContactId','ListId','field','NOW()','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','sort','CampaignId','getHopperHistories','CmHopperFinal'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9254,0x1c4));var _0x4925=function(_0x3451e6,_0x4c2168){_0x3451e6=_0x3451e6-0x0;var _0x579b63=_0x9254[_0x3451e6];return _0x579b63;};'use strict';var emlformat=require(_0x4925('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4925('0x1'));var jsonpatch=require(_0x4925('0x2'));var rp=require(_0x4925('0x3'));var moment=require(_0x4925('0x4'));var BPromise=require(_0x4925('0x5'));var Mustache=require(_0x4925('0x6'));var util=require(_0x4925('0x7'));var path=require(_0x4925('0x8'));var sox=require(_0x4925('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4925('0xa'));var _=require(_0x4925('0xb'));var squel=require(_0x4925('0xc'));var crypto=require(_0x4925('0xd'));var jsforce=require(_0x4925('0xe'));var deskjs=require(_0x4925('0xf'));var toCsv=require(_0x4925('0x10'));var querystring=require(_0x4925('0x11'));var Papa=require(_0x4925('0x12'));var Redis=require(_0x4925('0x13'));var authService=require(_0x4925('0x14'));var qs=require(_0x4925('0x15'));var as=require(_0x4925('0x16'));var hardwareService=require(_0x4925('0x17'));var logger=require(_0x4925('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x4925('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4925('0x1a'))['db'];function respondWithStatusCode(_0x380950,_0x4db96e){_0x4db96e=_0x4db96e||0xcc;return function(_0x15842f){if(_0x15842f){return _0x380950[_0x4925('0x1b')](_0x4db96e);}return _0x380950['status'](_0x4db96e)[_0x4925('0x1c')]();};}function respondWithResult(_0x11e8d3,_0x2311dc){_0x2311dc=_0x2311dc||0xc8;return function(_0x51b800){if(_0x51b800){return _0x11e8d3[_0x4925('0x1d')](_0x2311dc)[_0x4925('0x1e')](_0x51b800);}};}function respondWithFilteredResult(_0x75e38,_0x34bd53){return function(_0x5d331f){if(_0x5d331f){var _0x2ac2d6=typeof _0x34bd53[_0x4925('0x1f')]===_0x4925('0x20')&&typeof _0x34bd53[_0x4925('0x21')]===_0x4925('0x20');var _0x2a8d3f=_0x5d331f[_0x4925('0x22')];var _0x33c7f7=_0x2ac2d6?0x0:_0x34bd53[_0x4925('0x1f')];var _0x18c960=_0x2ac2d6?_0x5d331f['count']:_0x34bd53['offset']+_0x34bd53[_0x4925('0x21')];var _0x8e5209;if(_0x18c960>=_0x2a8d3f){_0x18c960=_0x2a8d3f;_0x8e5209=0xc8;}else{_0x8e5209=0xce;}_0x75e38[_0x4925('0x1d')](_0x8e5209);return _0x75e38[_0x4925('0x23')](_0x4925('0x24'),_0x33c7f7+'-'+_0x18c960+'/'+_0x2a8d3f)['json'](_0x5d331f);}return null;};}function patchUpdates(_0x93cbea){return function(_0x5b6b55){try{jsonpatch[_0x4925('0x25')](_0x5b6b55,_0x93cbea,!![]);}catch(_0x141caa){return BPromise[_0x4925('0x26')](_0x141caa);}return _0x5b6b55['save']();};}function saveUpdates(_0x11119b,_0x385cef){return function(_0x83d689){if(_0x83d689){return _0x83d689[_0x4925('0x27')](_0x11119b)[_0x4925('0x28')](function(_0x502b8c){return _0x502b8c;});}return null;};}function removeEntity(_0x123154,_0x351a21){return function(_0xd761db){if(_0xd761db){return _0xd761db['destroy']()[_0x4925('0x28')](function(){var _0xcb2df1=_0xd761db[_0x4925('0x29')]({'plain':!![]});var _0x473290='IvrCampaigns';return db[_0x4925('0x2a')][_0x4925('0x2b')]({'where':{'type':_0x473290,'resourceId':_0xcb2df1['id']}})[_0x4925('0x28')](function(){return _0xd761db;});})['then'](function(){_0x123154['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f29d,_0x3f9e17){return function(_0x5931cb){if(!_0x5931cb){_0x55f29d['sendStatus'](0x194);}return _0x5931cb;};}function handleError(_0x49450a,_0x22600e){_0x22600e=_0x22600e||0x1f4;return function(_0x3c967d){logger[_0x4925('0x2c')](_0x3c967d[_0x4925('0x2d')]);if(_0x3c967d[_0x4925('0x2e')]){delete _0x3c967d['name'];}_0x49450a[_0x4925('0x1d')](_0x22600e)[_0x4925('0x2f')](_0x3c967d);};}exports[_0x4925('0x30')]=function(_0x16fddf,_0x2b96dc){var _0xcbed11={},_0x1fb7b4={},_0x512b7e={'count':0x0,'rows':[]};var _0x29c135=_[_0x4925('0x31')](db[_0x4925('0x32')][_0x4925('0x33')],function(_0x3b4682){return{'name':_0x3b4682[_0x4925('0x34')],'type':_0x3b4682['type'][_0x4925('0x35')]};});_0x1fb7b4[_0x4925('0x36')]=_[_0x4925('0x31')](_0x29c135,_0x4925('0x2e'));_0x1fb7b4[_0x4925('0x37')]=_[_0x4925('0x38')](_0x16fddf['query']);_0x1fb7b4[_0x4925('0x39')]=_['intersection'](_0x1fb7b4[_0x4925('0x36')],_0x1fb7b4[_0x4925('0x37')]);_0xcbed11[_0x4925('0x3a')]=_[_0x4925('0x3b')](_0x1fb7b4[_0x4925('0x36')],qs[_0x4925('0x3c')](_0x16fddf[_0x4925('0x37')][_0x4925('0x3c')]));_0xcbed11[_0x4925('0x3a')]=_0xcbed11[_0x4925('0x3a')][_0x4925('0x3d')]?_0xcbed11[_0x4925('0x3a')]:_0x1fb7b4['model'];if(!_0x16fddf['query'][_0x4925('0x3e')](_0x4925('0x3f'))){_0xcbed11[_0x4925('0x21')]=qs[_0x4925('0x21')](_0x16fddf[_0x4925('0x37')][_0x4925('0x21')]);_0xcbed11['offset']=qs[_0x4925('0x1f')](_0x16fddf['query'][_0x4925('0x1f')]);}_0xcbed11[_0x4925('0x40')]=qs['sort'](_0x16fddf[_0x4925('0x37')]['sort']);_0xcbed11[_0x4925('0x41')]=qs['filters'](_[_0x4925('0x42')](_0x16fddf[_0x4925('0x37')],_0x1fb7b4[_0x4925('0x39')]),_0x29c135);if(_0x16fddf[_0x4925('0x37')][_0x4925('0x43')]){_0xcbed11[_0x4925('0x41')]=_[_0x4925('0x44')](_0xcbed11[_0x4925('0x41')],{'$or':_[_0x4925('0x31')](_0x29c135,function(_0x295ce6){if(_0x295ce6['type']!==_0x4925('0x45')){var _0x428301={};_0x428301[_0x295ce6['name']]={'$like':'%'+_0x16fddf[_0x4925('0x37')][_0x4925('0x43')]+'%'};return _0x428301;}})});}_0xcbed11=_['merge']({},_0xcbed11,_0x16fddf['options']);var _0x45853d={'where':_0xcbed11[_0x4925('0x41')]};return db[_0x4925('0x32')][_0x4925('0x22')](_0x45853d)[_0x4925('0x28')](function(_0x4bd49f){_0x512b7e[_0x4925('0x22')]=_0x4bd49f;if(_0x16fddf[_0x4925('0x37')][_0x4925('0x46')]){_0xcbed11[_0x4925('0x47')]=[{'all':!![]}];}return db[_0x4925('0x32')][_0x4925('0x48')](_0xcbed11);})[_0x4925('0x28')](function(_0x18320e){_0x512b7e[_0x4925('0x49')]=_0x18320e;return _0x512b7e;})['then'](respondWithFilteredResult(_0x2b96dc,_0xcbed11))[_0x4925('0x4a')](handleError(_0x2b96dc,null));};exports[_0x4925('0x4b')]=function(_0x214d42,_0x15abb2){var _0x3716f7={'raw':![],'where':{'id':_0x214d42[_0x4925('0x4c')]['id']}},_0x3d3a3f={};_0x3d3a3f[_0x4925('0x36')]=_[_0x4925('0x38')](db[_0x4925('0x32')][_0x4925('0x33')]);_0x3d3a3f[_0x4925('0x37')]=_['keys'](_0x214d42['query']);_0x3d3a3f[_0x4925('0x39')]=_['intersection'](_0x3d3a3f[_0x4925('0x36')],_0x3d3a3f[_0x4925('0x37')]);_0x3716f7[_0x4925('0x3a')]=_[_0x4925('0x3b')](_0x3d3a3f[_0x4925('0x36')],qs[_0x4925('0x3c')](_0x214d42['query'][_0x4925('0x3c')]));_0x3716f7['attributes']=_0x3716f7['attributes']['length']?_0x3716f7[_0x4925('0x3a')]:_0x3d3a3f[_0x4925('0x36')];if(_0x214d42[_0x4925('0x37')][_0x4925('0x46')]){_0x3716f7[_0x4925('0x47')]=[{'all':!![]}];}_0x3716f7=_[_0x4925('0x44')]({},_0x3716f7,_0x214d42[_0x4925('0x4d')]);return db[_0x4925('0x32')][_0x4925('0x4e')](_0x3716f7)[_0x4925('0x28')](handleEntityNotFound(_0x15abb2,null))[_0x4925('0x28')](respondWithResult(_0x15abb2,null))[_0x4925('0x4a')](handleError(_0x15abb2,null));};exports[_0x4925('0x4f')]=function(_0x1ae849,_0x34d193){return db[_0x4925('0x32')][_0x4925('0x4f')](_0x1ae849['body'],{})[_0x4925('0x28')](function(_0x198c70){var _0x25dc80=_0x1ae849[_0x4925('0x50')][_0x4925('0x29')]({'plain':!![]});if(!_0x25dc80)throw new Error(_0x4925('0x51'));if(_0x25dc80[_0x4925('0x52')]===_0x4925('0x50')){var _0x128573=_0x198c70[_0x4925('0x29')]({'plain':!![]});var _0x396408=_0x4925('0x53');return db[_0x4925('0x54')][_0x4925('0x4e')]({'where':{'name':_0x396408,'userProfileId':_0x25dc80['userProfileId']},'raw':!![]})['then'](function(_0x51cc68){if(_0x51cc68&&_0x51cc68[_0x4925('0x55')]===0x0){return db[_0x4925('0x2a')][_0x4925('0x4f')]({'name':_0x128573[_0x4925('0x2e')],'resourceId':_0x128573['id'],'type':_0x51cc68[_0x4925('0x2e')],'sectionId':_0x51cc68['id']},{})[_0x4925('0x28')](function(){return _0x198c70;});}else{return _0x198c70;}})[_0x4925('0x4a')](function(_0x5e728d){logger[_0x4925('0x2c')](_0x4925('0x56'),_0x5e728d);throw _0x5e728d;});}return _0x198c70;})[_0x4925('0x28')](respondWithResult(_0x34d193,0xc9))[_0x4925('0x4a')](handleError(_0x34d193,null));};exports[_0x4925('0x57')]=function(_0x10d76b,_0x8d348f){var _0x5a8a83={'where':{'id':_0x10d76b['params']['id']}},_0x246c28={};_0x246c28['model']=_[_0x4925('0x38')](db['Campaign'][_0x4925('0x33')]);_0x5a8a83['attributes']=_['intersection'](_0x246c28['model'],qs[_0x4925('0x3c')](_0x10d76b[_0x4925('0x37')][_0x4925('0x3c')]));_0x5a8a83['attributes']=_0x5a8a83['attributes'][_0x4925('0x3d')]?_0x5a8a83[_0x4925('0x3a')]:_0x246c28[_0x4925('0x36')];if(_0x10d76b[_0x4925('0x37')][_0x4925('0x46')]){_0x5a8a83[_0x4925('0x47')]=[{'all':!![]}];}_0x5a8a83=_['merge']({},_0x5a8a83,_0x10d76b[_0x4925('0x4d')]);return db[_0x4925('0x32')][_0x4925('0x4e')](_0x5a8a83)[_0x4925('0x28')](handleEntityNotFound(_0x8d348f,null))[_0x4925('0x28')](function(_0x440d49){if(_0x440d49){var _0x2f4fc1=_0x440d49[_0x4925('0x29')]({'plain':!![]});_0x2f4fc1=qs[_0x4925('0x58')](_0x2f4fc1,['id',_0x4925('0x59'),'updatedAt']);_0x10d76b[_0x4925('0x5a')]=_['omit'](_0x10d76b[_0x4925('0x5a')],['id',_0x4925('0x59'),_0x4925('0x5b')]);return db[_0x4925('0x32')][_0x4925('0x4f')](_[_0x4925('0x44')](_0x2f4fc1,_0x10d76b[_0x4925('0x5a')]),{'include':_0x10d76b[_0x4925('0x37')][_0x4925('0x46')]?[{'all':!![]}]:undefined})[_0x4925('0x28')](function(_0x2b4d47){var _0x4a575f=_0x10d76b['user'][_0x4925('0x29')]({'plain':!![]});if(!_0x4a575f)throw new Error(_0x4925('0x51'));if(_0x4a575f['role']==='user'){var _0x4891af=_0x2b4d47[_0x4925('0x29')]({'plain':!![]});var _0x11bf43='IvrCampaigns';return db['UserProfileSection'][_0x4925('0x4e')]({'where':{'name':_0x11bf43,'userProfileId':_0x4a575f[_0x4925('0x5c')]},'raw':!![]})[_0x4925('0x28')](function(_0x2a063e){if(_0x2a063e&&_0x2a063e[_0x4925('0x55')]===0x0){return db[_0x4925('0x2a')][_0x4925('0x4f')]({'name':_0x4891af[_0x4925('0x2e')],'resourceId':_0x4891af['id'],'type':_0x2a063e['name'],'sectionId':_0x2a063e['id']},{})[_0x4925('0x28')](function(){return _0x2b4d47;});}else{return _0x2b4d47;}})[_0x4925('0x4a')](function(_0x46ec15){logger[_0x4925('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46ec15);throw _0x46ec15;});}return _0x2b4d47;});}})['then'](respondWithResult(_0x8d348f,0xc9))[_0x4925('0x4a')](handleError(_0x8d348f,null));};exports['update']=function(_0xf3b71f,_0x48239e){if(_0xf3b71f['body']['id']){delete _0xf3b71f[_0x4925('0x5a')]['id'];}return db[_0x4925('0x32')][_0x4925('0x4e')]({'where':{'id':_0xf3b71f[_0x4925('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48239e,null))[_0x4925('0x28')](saveUpdates(_0xf3b71f[_0x4925('0x5a')],null))[_0x4925('0x28')](respondWithResult(_0x48239e,null))[_0x4925('0x4a')](handleError(_0x48239e,null));};exports[_0x4925('0x2b')]=function(_0x5c4166,_0x1f5dcd){return db['Campaign'][_0x4925('0x4e')]({'where':{'id':_0x5c4166[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x1f5dcd,null))['then'](removeEntity(_0x1f5dcd,null))[_0x4925('0x4a')](handleError(_0x1f5dcd,null));};exports[_0x4925('0x5d')]=function(_0xbd4d3,_0x46a896,_0x300dc7){var _0x5d0e0b={'raw':!![],'where':{}};var _0x1f7b99={};var _0xe72529={'count':0x0,'rows':[]};return db[_0x4925('0x32')][_0x4925('0x5e')]({'where':{'id':_0xbd4d3[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x46a896,null))[_0x4925('0x28')](function(_0x563fb5){if(_0x563fb5){_0x1f7b99[_0x4925('0x36')]=_[_0x4925('0x38')](db[_0x4925('0x5f')][_0x4925('0x33')]);_0x1f7b99[_0x4925('0x37')]=_[_0x4925('0x38')](_0xbd4d3[_0x4925('0x37')]);_0x1f7b99[_0x4925('0x39')]=_[_0x4925('0x3b')](_0x1f7b99[_0x4925('0x36')],_0x1f7b99['query']);_0x5d0e0b[_0x4925('0x3a')]=_['intersection'](_0x1f7b99[_0x4925('0x36')],qs[_0x4925('0x3c')](_0xbd4d3[_0x4925('0x37')][_0x4925('0x3c')]));_0x5d0e0b['attributes']=_0x5d0e0b[_0x4925('0x3a')]['length']?_0x5d0e0b[_0x4925('0x3a')]:_0x1f7b99[_0x4925('0x36')];if(!_0xbd4d3[_0x4925('0x37')][_0x4925('0x3e')](_0x4925('0x3f'))){_0x5d0e0b[_0x4925('0x21')]=qs['limit'](_0xbd4d3[_0x4925('0x37')]['limit']);_0x5d0e0b[_0x4925('0x1f')]=qs[_0x4925('0x1f')](_0xbd4d3[_0x4925('0x37')][_0x4925('0x1f')]);}_0x5d0e0b[_0x4925('0x40')]=qs[_0x4925('0x60')](_0xbd4d3[_0x4925('0x37')]['sort']);_0x5d0e0b['where']=qs['filters'](_[_0x4925('0x42')](_0xbd4d3[_0x4925('0x37')],_0x1f7b99[_0x4925('0x39')]));_0x5d0e0b[_0x4925('0x41')][_0x4925('0x61')]=_0x563fb5['id'];if(_0xbd4d3[_0x4925('0x37')]['filter']){_0x5d0e0b[_0x4925('0x41')]=_[_0x4925('0x44')](_0x5d0e0b[_0x4925('0x41')],{'$or':_['map'](_0x5d0e0b[_0x4925('0x3a')],function(_0x5ba323){var _0x34352b={};_0x34352b[_0x5ba323]={'$like':'%'+_0xbd4d3[_0x4925('0x37')][_0x4925('0x43')]+'%'};return _0x34352b;})});}_0x5d0e0b=_[_0x4925('0x44')]({},_0x5d0e0b,_0xbd4d3[_0x4925('0x4d')]);return db[_0x4925('0x5f')][_0x4925('0x22')]({'where':_0x5d0e0b[_0x4925('0x41')]})[_0x4925('0x28')](function(_0x40f7c9){_0xe72529[_0x4925('0x22')]=_0x40f7c9;if(_0xbd4d3[_0x4925('0x37')][_0x4925('0x46')]){_0x5d0e0b[_0x4925('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x4925('0x48')](_0x5d0e0b);})[_0x4925('0x28')](function(_0x221b7a){_0xe72529[_0x4925('0x49')]=_0x221b7a;return _0xe72529;});}})['then'](respondWithFilteredResult(_0x46a896,_0x5d0e0b))[_0x4925('0x4a')](handleError(_0x46a896,null));};exports[_0x4925('0x62')]=function(_0x983579,_0x2b90d2,_0x3c368d){var _0x3df0d0={'raw':!![],'where':{}};var _0x4e3d9c={};var _0xf4b769={'count':0x0,'rows':[]};return db['Campaign'][_0x4925('0x5e')]({'where':{'id':_0x983579['params']['id']}})['then'](handleEntityNotFound(_0x2b90d2,null))[_0x4925('0x28')](function(_0x32e6e8){if(_0x32e6e8){_0x4e3d9c[_0x4925('0x36')]=_[_0x4925('0x38')](db['CmHopperHistory'][_0x4925('0x33')]);_0x4e3d9c[_0x4925('0x37')]=_['keys'](_0x983579['query']);_0x4e3d9c[_0x4925('0x39')]=_[_0x4925('0x3b')](_0x4e3d9c['model'],_0x4e3d9c[_0x4925('0x37')]);_0x3df0d0[_0x4925('0x3a')]=_[_0x4925('0x3b')](_0x4e3d9c[_0x4925('0x36')],qs[_0x4925('0x3c')](_0x983579[_0x4925('0x37')][_0x4925('0x3c')]));_0x3df0d0[_0x4925('0x3a')]=_0x3df0d0[_0x4925('0x3a')][_0x4925('0x3d')]?_0x3df0d0[_0x4925('0x3a')]:_0x4e3d9c['model'];if(!_0x983579[_0x4925('0x37')][_0x4925('0x3e')](_0x4925('0x3f'))){_0x3df0d0[_0x4925('0x21')]=qs[_0x4925('0x21')](_0x983579[_0x4925('0x37')][_0x4925('0x21')]);_0x3df0d0[_0x4925('0x1f')]=qs[_0x4925('0x1f')](_0x983579[_0x4925('0x37')][_0x4925('0x1f')]);}_0x3df0d0[_0x4925('0x40')]=qs['sort'](_0x983579['query'][_0x4925('0x60')]);_0x3df0d0['where']=qs[_0x4925('0x39')](_[_0x4925('0x42')](_0x983579[_0x4925('0x37')],_0x4e3d9c[_0x4925('0x39')]));_0x3df0d0[_0x4925('0x41')][_0x4925('0x61')]=_0x32e6e8['id'];if(_0x983579[_0x4925('0x37')][_0x4925('0x43')]){_0x3df0d0[_0x4925('0x41')]=_[_0x4925('0x44')](_0x3df0d0[_0x4925('0x41')],{'$or':_[_0x4925('0x31')](_0x3df0d0[_0x4925('0x3a')],function(_0x348d72){var _0x51d7b6={};_0x51d7b6[_0x348d72]={'$like':'%'+_0x983579['query']['filter']+'%'};return _0x51d7b6;})});}_0x3df0d0=_['merge']({},_0x3df0d0,_0x983579[_0x4925('0x4d')]);return db['CmHopperHistory'][_0x4925('0x22')]({'where':_0x3df0d0['where']})[_0x4925('0x28')](function(_0x1b5281){_0xf4b769[_0x4925('0x22')]=_0x1b5281;if(_0x983579['query']['includeAll']){_0x3df0d0[_0x4925('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3df0d0);})[_0x4925('0x28')](function(_0x3ef8f4){_0xf4b769[_0x4925('0x49')]=_0x3ef8f4;return _0xf4b769;});}})[_0x4925('0x28')](respondWithFilteredResult(_0x2b90d2,_0x3df0d0))[_0x4925('0x4a')](handleError(_0x2b90d2,null));};exports['getHopperFinals']=function(_0x47643f,_0x1c4cf7,_0xbe05e2){var _0x57ff77={'raw':!![],'where':{}};var _0x34dfd7={};var _0x3945f6={'count':0x0,'rows':[]};return db[_0x4925('0x32')][_0x4925('0x5e')]({'where':{'id':_0x47643f[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x1c4cf7,null))[_0x4925('0x28')](function(_0x58d046){if(_0x58d046){_0x34dfd7[_0x4925('0x36')]=_[_0x4925('0x38')](db['CmHopperFinal'][_0x4925('0x33')]);_0x34dfd7[_0x4925('0x37')]=_[_0x4925('0x38')](_0x47643f[_0x4925('0x37')]);_0x34dfd7[_0x4925('0x39')]=_['intersection'](_0x34dfd7[_0x4925('0x36')],_0x34dfd7[_0x4925('0x37')]);_0x57ff77[_0x4925('0x3a')]=_['intersection'](_0x34dfd7[_0x4925('0x36')],qs[_0x4925('0x3c')](_0x47643f['query'][_0x4925('0x3c')]));_0x57ff77[_0x4925('0x3a')]=_0x57ff77[_0x4925('0x3a')][_0x4925('0x3d')]?_0x57ff77['attributes']:_0x34dfd7[_0x4925('0x36')];if(!_0x47643f[_0x4925('0x37')][_0x4925('0x3e')]('nolimit')){_0x57ff77['limit']=qs[_0x4925('0x21')](_0x47643f[_0x4925('0x37')][_0x4925('0x21')]);_0x57ff77[_0x4925('0x1f')]=qs[_0x4925('0x1f')](_0x47643f[_0x4925('0x37')][_0x4925('0x1f')]);}_0x57ff77['order']=qs['sort'](_0x47643f['query'][_0x4925('0x60')]);_0x57ff77[_0x4925('0x41')]=qs[_0x4925('0x39')](_[_0x4925('0x42')](_0x47643f[_0x4925('0x37')],_0x34dfd7[_0x4925('0x39')]));_0x57ff77['where'][_0x4925('0x61')]=_0x58d046['id'];if(_0x47643f[_0x4925('0x37')][_0x4925('0x43')]){_0x57ff77['where']=_[_0x4925('0x44')](_0x57ff77[_0x4925('0x41')],{'$or':_[_0x4925('0x31')](_0x57ff77[_0x4925('0x3a')],function(_0x3a36ce){var _0x12d567={};_0x12d567[_0x3a36ce]={'$like':'%'+_0x47643f['query'][_0x4925('0x43')]+'%'};return _0x12d567;})});}_0x57ff77=_[_0x4925('0x44')]({},_0x57ff77,_0x47643f[_0x4925('0x4d')]);return db['CmHopperFinal']['count']({'where':_0x57ff77[_0x4925('0x41')]})[_0x4925('0x28')](function(_0x35ea94){_0x3945f6[_0x4925('0x22')]=_0x35ea94;if(_0x47643f[_0x4925('0x37')][_0x4925('0x46')]){_0x57ff77[_0x4925('0x47')]=[{'all':!![]}];}return db[_0x4925('0x63')]['findAll'](_0x57ff77);})[_0x4925('0x28')](function(_0x7716e){_0x3945f6[_0x4925('0x49')]=_0x7716e;return _0x3945f6;});}})[_0x4925('0x28')](respondWithFilteredResult(_0x1c4cf7,_0x57ff77))[_0x4925('0x4a')](handleError(_0x1c4cf7,null));};exports['getHopperBlacks']=function(_0x3779a2,_0x30d36f,_0x4111be){var _0x4f94bf={'raw':!![],'where':{}};var _0x20a938={};var _0x509fc8={'count':0x0,'rows':[]};return db[_0x4925('0x32')][_0x4925('0x5e')]({'where':{'id':_0x3779a2[_0x4925('0x4c')]['id']}})['then'](handleEntityNotFound(_0x30d36f,null))[_0x4925('0x28')](function(_0x2d681b){if(_0x2d681b){_0x20a938[_0x4925('0x36')]=_[_0x4925('0x38')](db[_0x4925('0x64')][_0x4925('0x33')]);_0x20a938['query']=_['keys'](_0x3779a2[_0x4925('0x37')]);_0x20a938[_0x4925('0x39')]=_['intersection'](_0x20a938['model'],_0x20a938[_0x4925('0x37')]);_0x4f94bf[_0x4925('0x3a')]=_[_0x4925('0x3b')](_0x20a938[_0x4925('0x36')],qs['fields'](_0x3779a2[_0x4925('0x37')][_0x4925('0x3c')]));_0x4f94bf[_0x4925('0x3a')]=_0x4f94bf[_0x4925('0x3a')][_0x4925('0x3d')]?_0x4f94bf[_0x4925('0x3a')]:_0x20a938[_0x4925('0x36')];if(!_0x3779a2[_0x4925('0x37')][_0x4925('0x3e')](_0x4925('0x3f'))){_0x4f94bf[_0x4925('0x21')]=qs[_0x4925('0x21')](_0x3779a2[_0x4925('0x37')][_0x4925('0x21')]);_0x4f94bf[_0x4925('0x1f')]=qs[_0x4925('0x1f')](_0x3779a2[_0x4925('0x37')][_0x4925('0x1f')]);}_0x4f94bf[_0x4925('0x40')]=qs[_0x4925('0x60')](_0x3779a2['query'][_0x4925('0x60')]);_0x4f94bf['where']=qs[_0x4925('0x39')](_[_0x4925('0x42')](_0x3779a2[_0x4925('0x37')],_0x20a938['filters']));_0x4f94bf[_0x4925('0x41')][_0x4925('0x61')]=_0x2d681b['id'];if(_0x3779a2[_0x4925('0x37')][_0x4925('0x43')]){_0x4f94bf['where']=_[_0x4925('0x44')](_0x4f94bf[_0x4925('0x41')],{'$or':_[_0x4925('0x31')](_0x4f94bf[_0x4925('0x3a')],function(_0x35a815){var _0x464cbd={};_0x464cbd[_0x35a815]={'$like':'%'+_0x3779a2['query'][_0x4925('0x43')]+'%'};return _0x464cbd;})});}_0x4f94bf=_[_0x4925('0x44')]({},_0x4f94bf,_0x3779a2[_0x4925('0x4d')]);return db[_0x4925('0x64')][_0x4925('0x22')]({'where':_0x4f94bf[_0x4925('0x41')]})[_0x4925('0x28')](function(_0x26a0ac){_0x509fc8['count']=_0x26a0ac;if(_0x3779a2[_0x4925('0x37')][_0x4925('0x46')]){_0x4f94bf[_0x4925('0x47')]=[{'all':!![]}];}return db[_0x4925('0x64')][_0x4925('0x48')](_0x4f94bf);})['then'](function(_0xc44714){_0x509fc8['rows']=_0xc44714;return _0x509fc8;});}})[_0x4925('0x28')](respondWithFilteredResult(_0x30d36f,_0x4f94bf))[_0x4925('0x4a')](handleError(_0x30d36f,null));};exports[_0x4925('0x65')]=function(_0x554b09,_0x293cd7,_0x416aa6){var _0x58580f={};var _0xe48774={};var _0x41f3b6;var _0x2f4c79;return db['Campaign'][_0x4925('0x5e')]({'where':{'id':_0x554b09[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x293cd7,null))[_0x4925('0x28')](function(_0x2463e6){if(_0x2463e6){_0x41f3b6=_0x2463e6;_0xe48774[_0x4925('0x36')]=_[_0x4925('0x38')](db[_0x4925('0x66')]['rawAttributes']);_0xe48774[_0x4925('0x37')]=_['keys'](_0x554b09[_0x4925('0x37')]);_0xe48774[_0x4925('0x39')]=_[_0x4925('0x3b')](_0xe48774[_0x4925('0x36')],_0xe48774['query']);_0x58580f['attributes']=_[_0x4925('0x3b')](_0xe48774['model'],qs[_0x4925('0x3c')](_0x554b09['query'][_0x4925('0x3c')]));_0x58580f[_0x4925('0x3a')]=_0x58580f['attributes']['length']?_0x58580f[_0x4925('0x3a')]:_0xe48774[_0x4925('0x36')];_0x58580f['order']=qs[_0x4925('0x60')](_0x554b09[_0x4925('0x37')][_0x4925('0x60')]);_0x58580f[_0x4925('0x41')]=qs[_0x4925('0x39')](_[_0x4925('0x42')](_0x554b09[_0x4925('0x37')],_0xe48774[_0x4925('0x39')]));if(_0x554b09['query'][_0x4925('0x43')]){_0x58580f[_0x4925('0x41')]=_['merge'](_0x58580f[_0x4925('0x41')],{'$or':_[_0x4925('0x31')](_0x58580f[_0x4925('0x3a')],function(_0x8d827){var _0x1ddbd4={};_0x1ddbd4[_0x8d827]={'$like':'%'+_0x554b09[_0x4925('0x37')][_0x4925('0x43')]+'%'};return _0x1ddbd4;})});}_0x58580f=_['merge']({},_0x58580f,_0x554b09[_0x4925('0x4d')]);return _0x41f3b6[_0x4925('0x65')](_0x58580f);}})[_0x4925('0x28')](function(_0x1cd00e){if(_0x1cd00e){_0x2f4c79=_0x1cd00e[_0x4925('0x3d')];if(!_0x554b09[_0x4925('0x37')][_0x4925('0x3e')](_0x4925('0x3f'))){_0x58580f['limit']=qs[_0x4925('0x21')](_0x554b09[_0x4925('0x37')]['limit']);_0x58580f['offset']=qs[_0x4925('0x1f')](_0x554b09[_0x4925('0x37')][_0x4925('0x1f')]);}return _0x41f3b6[_0x4925('0x65')](_0x58580f);}})['then'](function(_0x351177){if(_0x351177){return _0x351177?{'count':_0x2f4c79,'rows':_0x351177}:null;}})[_0x4925('0x28')](respondWithResult(_0x293cd7,null))[_0x4925('0x4a')](handleError(_0x293cd7,null));};exports[_0x4925('0x67')]=function(_0x564fc9,_0x1e619d,_0x2be813){var _0x32913c,_0x4950e3;return db[_0x4925('0x32')][_0x4925('0x4e')]({'where':{'id':_0x564fc9['params']['id']}})['then'](handleEntityNotFound(_0x1e619d,null))['then'](function(_0x422169){if(_0x422169){_0x4950e3=_0x422169;return _0x422169[_0x4925('0x67')](_0x564fc9[_0x4925('0x5a')][_0x4925('0x68')],_[_0x4925('0x58')](_0x564fc9[_0x4925('0x5a')],[_0x4925('0x68'),'id'])||{});}return null;})[_0x4925('0x69')](function(_0x48770c){var _0x1f7f42;_0x32913c=_0x48770c||[];var _0x561351=[];if(_0x48770c){for(var _0x421e16=0x0;_0x421e16<_0x48770c['length'];_0x421e16+=0x1){var _0xd07e9=_0x48770c[_0x421e16][_0x4925('0x29')]({'plain':!![]});_0x4950e3['dialCheckDuplicateType']=_0x564fc9['body'][_0x4925('0x6a')]?_0x564fc9['body'][_0x4925('0x6a')]:_0x4950e3[_0x4925('0x6a')];switch(_0x4950e3[_0x4925('0x6a')]){case'always':_0x1f7f42=squel[_0x4925('0x6b')]()[_0x4925('0x6c')](_0x4925('0x6d'))['fromQuery']([_0x4925('0x6e'),'scheduledAt',_0x4925('0x6f'),_0x4925('0x70'),_0x4925('0x61'),_0x4925('0x59'),_0x4925('0x5b')],squel['select']()[_0x4925('0x71')](_0x4925('0x6e'),_0x4925('0x6e'))['field'](_0x4925('0x72'),_0x4925('0x73'))[_0x4925('0x71')]('id',_0x4925('0x6f'))[_0x4925('0x71')](_0xd07e9['CmListId'][_0x4925('0x74')](),_0x4925('0x70'))[_0x4925('0x71')](_0x564fc9[_0x4925('0x4c')]['id']['toString'](),_0x4925('0x61'))[_0x4925('0x71')](_0x4925('0x72'),'createdAt')[_0x4925('0x71')](_0x4925('0x72'),'updatedAt')[_0x4925('0x75')]('cm_contacts')[_0x4925('0x41')](_0x4925('0x76'))[_0x4925('0x41')](_0x4925('0x77'),_0xd07e9[_0x4925('0x78')][_0x4925('0x74')]())[_0x4925('0x41')](_0x4925('0x79'))[_0x4925('0x41')](_0x4925('0x7a'),squel[_0x4925('0x7b')]()[_0x4925('0x71')](_0x4925('0x7c'))[_0x4925('0x75')]('cm_hopper_final')[_0x4925('0x41')]('CampaignId\x20=\x20?',_0x564fc9['params']['id'][_0x4925('0x74')]()))[_0x4925('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4925('0x7b')]()[_0x4925('0x71')](_0x4925('0x7d'))[_0x4925('0x75')](_0x4925('0x6d'))[_0x4925('0x41')](_0x4925('0x7e'),_0x564fc9[_0x4925('0x4c')]['id'][_0x4925('0x74')]())))[_0x4925('0x74')]();break;case _0x4925('0x7f'):_0x1f7f42=squel[_0x4925('0x6b')]()[_0x4925('0x6c')](_0x4925('0x6d'))[_0x4925('0x80')](['phone','scheduledAt',_0x4925('0x6f'),_0x4925('0x70'),_0x4925('0x61'),_0x4925('0x59'),_0x4925('0x5b')],squel[_0x4925('0x7b')]()[_0x4925('0x71')]('phone',_0x4925('0x6e'))[_0x4925('0x71')](_0x4925('0x72'),'scheduledAt')[_0x4925('0x71')]('id',_0x4925('0x6f'))[_0x4925('0x71')](_0xd07e9['CmListId'][_0x4925('0x74')](),_0x4925('0x70'))[_0x4925('0x71')](_0x564fc9[_0x4925('0x4c')]['id'][_0x4925('0x74')](),_0x4925('0x61'))['field']('NOW()',_0x4925('0x59'))[_0x4925('0x71')]('NOW()',_0x4925('0x5b'))['from']('cm_contacts')[_0x4925('0x41')](_0x4925('0x76'))[_0x4925('0x41')](_0x4925('0x77'),_0xd07e9[_0x4925('0x78')][_0x4925('0x74')]())[_0x4925('0x41')](_0x4925('0x79'))['where'](_0x4925('0x7a'),squel[_0x4925('0x7b')]()[_0x4925('0x71')]('COALESCE(phone,\x27\x27)')[_0x4925('0x75')](_0x4925('0x6d'))['where'](_0x4925('0x7e'),_0x564fc9['params']['id'][_0x4925('0x74')]())))[_0x4925('0x74')]();break;default:_0x1f7f42=squel[_0x4925('0x6b')]()[_0x4925('0x6c')](_0x4925('0x6d'))[_0x4925('0x80')]([_0x4925('0x6e'),_0x4925('0x73'),_0x4925('0x6f'),_0x4925('0x70'),_0x4925('0x61'),_0x4925('0x59'),_0x4925('0x5b')],squel[_0x4925('0x7b')]()[_0x4925('0x71')](_0x4925('0x6e'),_0x4925('0x6e'))[_0x4925('0x71')](_0x4925('0x72'),'scheduledAt')[_0x4925('0x71')]('id',_0x4925('0x6f'))[_0x4925('0x71')](_0xd07e9[_0x4925('0x78')][_0x4925('0x74')](),_0x4925('0x70'))[_0x4925('0x71')](_0x564fc9[_0x4925('0x4c')]['id'][_0x4925('0x74')](),_0x4925('0x61'))[_0x4925('0x71')](_0x4925('0x72'),_0x4925('0x59'))['field']('NOW()','updatedAt')['from'](_0x4925('0x81'))[_0x4925('0x41')](_0x4925('0x76'))['where'](_0x4925('0x77'),_0xd07e9[_0x4925('0x78')]['toString']())[_0x4925('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x4925('0x74')]();}_0x561351[_0x4925('0x82')](db[_0x4925('0x83')]['query'](_0x1f7f42));}return BPromise[_0x4925('0x84')](_0x561351);}})['then'](function(){return _0x32913c;})['then'](respondWithResult(_0x1e619d,null))[_0x4925('0x4a')](handleError(_0x1e619d,null));};exports[_0x4925('0x85')]=function(_0x3ca26a,_0x4179a9,_0x5b2132){return db[_0x4925('0x32')][_0x4925('0x4e')]({'where':{'id':_0x3ca26a[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x4179a9,null))[_0x4925('0x28')](function(_0x13ea4a){if(_0x13ea4a){return _0x13ea4a[_0x4925('0x85')](_0x3ca26a[_0x4925('0x37')][_0x4925('0x68')]);}})[_0x4925('0x28')](function(_0x55b913){if(_0x55b913){return db[_0x4925('0x5f')][_0x4925('0x2b')]({'where':{'ListId':_0x3ca26a[_0x4925('0x37')][_0x4925('0x68')],'CampaignId':_0x3ca26a[_0x4925('0x4c')]['id']}})['then'](function(){return _0x55b913;});}})[_0x4925('0x28')](respondWithStatusCode(_0x4179a9,null))['catch'](handleError(_0x4179a9,null));};exports['getBlackLists']=function(_0x49225f,_0x20f93d,_0x4f7824){var _0x58ff2a={};var _0x4aa9db={};var _0x22558a;var _0x483a87;return db[_0x4925('0x32')][_0x4925('0x5e')]({'where':{'id':_0x49225f[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x20f93d,null))[_0x4925('0x28')](function(_0x1c5988){if(_0x1c5988){_0x22558a=_0x1c5988;_0x4aa9db[_0x4925('0x36')]=_['keys'](db['CmList'][_0x4925('0x33')]);_0x4aa9db[_0x4925('0x37')]=_[_0x4925('0x38')](_0x49225f[_0x4925('0x37')]);_0x4aa9db['filters']=_[_0x4925('0x3b')](_0x4aa9db[_0x4925('0x36')],_0x4aa9db['query']);_0x58ff2a[_0x4925('0x3a')]=_[_0x4925('0x3b')](_0x4aa9db[_0x4925('0x36')],qs[_0x4925('0x3c')](_0x49225f['query'][_0x4925('0x3c')]));_0x58ff2a['attributes']=_0x58ff2a[_0x4925('0x3a')]['length']?_0x58ff2a[_0x4925('0x3a')]:_0x4aa9db['model'];_0x58ff2a[_0x4925('0x40')]=qs['sort'](_0x49225f['query'][_0x4925('0x60')]);_0x58ff2a[_0x4925('0x41')]=qs[_0x4925('0x39')](_[_0x4925('0x42')](_0x49225f[_0x4925('0x37')],_0x4aa9db['filters']));if(_0x49225f['query']['filter']){_0x58ff2a[_0x4925('0x41')]=_['merge'](_0x58ff2a['where'],{'$or':_[_0x4925('0x31')](_0x58ff2a[_0x4925('0x3a')],function(_0x5c7365){var _0x40ef50={};_0x40ef50[_0x5c7365]={'$like':'%'+_0x49225f[_0x4925('0x37')]['filter']+'%'};return _0x40ef50;})});}_0x58ff2a=_[_0x4925('0x44')]({},_0x58ff2a,_0x49225f['options']);return _0x22558a[_0x4925('0x86')](_0x58ff2a);}})[_0x4925('0x28')](function(_0x25d966){if(_0x25d966){_0x483a87=_0x25d966['length'];if(!_0x49225f[_0x4925('0x37')][_0x4925('0x3e')](_0x4925('0x3f'))){_0x58ff2a[_0x4925('0x21')]=qs[_0x4925('0x21')](_0x49225f['query'][_0x4925('0x21')]);_0x58ff2a['offset']=qs[_0x4925('0x1f')](_0x49225f[_0x4925('0x37')][_0x4925('0x1f')]);}return _0x22558a[_0x4925('0x86')](_0x58ff2a);}})[_0x4925('0x28')](function(_0x37a825){if(_0x37a825){return _0x37a825?{'count':_0x483a87,'rows':_0x37a825}:null;}})[_0x4925('0x28')](respondWithResult(_0x20f93d,null))[_0x4925('0x4a')](handleError(_0x20f93d,null));};exports[_0x4925('0x87')]=function(_0x23b8f9,_0x20beef,_0x3d9bed){var _0x3d83d2,_0xf8ab1;return db[_0x4925('0x32')][_0x4925('0x4e')]({'where':{'id':_0x23b8f9[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x20beef,null))[_0x4925('0x28')](function(_0x273e58){if(_0x273e58){_0xf8ab1=_0x273e58;return _0x273e58[_0x4925('0x87')](_0x23b8f9['body']['ids'],_[_0x4925('0x58')](_0x23b8f9[_0x4925('0x5a')],['ids','id'])||{});}return null;})[_0x4925('0x69')](function(_0x402fd0){var _0x4fdcf0;_0x3d83d2=_0x402fd0||[];var _0x50acd0=[];if(_0x402fd0){for(var _0x37a4fd=0x0;_0x37a4fd<_0x402fd0['length'];_0x37a4fd+=0x1){var _0x3015ff=_0x402fd0[_0x37a4fd][_0x4925('0x29')]({'plain':!![]});_0x4fdcf0=squel[_0x4925('0x6b')]()[_0x4925('0x6c')](_0x4925('0x88'))[_0x4925('0x80')](['phone',_0x4925('0x6f'),_0x4925('0x70'),_0x4925('0x61'),_0x4925('0x59'),_0x4925('0x5b')],squel[_0x4925('0x7b')]()[_0x4925('0x71')]('phone',_0x4925('0x6e'))['field']('id',_0x4925('0x6f'))['field'](_0x3015ff[_0x4925('0x78')]['toString'](),_0x4925('0x70'))[_0x4925('0x71')](_0x23b8f9[_0x4925('0x4c')]['id'][_0x4925('0x74')](),_0x4925('0x61'))['field']('NOW()',_0x4925('0x59'))[_0x4925('0x71')](_0x4925('0x72'),'updatedAt')['from'](_0x4925('0x81'))['where'](_0x4925('0x76'))['where']('ListId\x20=\x20?',_0x3015ff['CmListId'][_0x4925('0x74')]())['where'](_0x4925('0x79')))[_0x4925('0x74')]();_0x50acd0[_0x4925('0x82')](db['sequelize']['query'](_0x4fdcf0));}return BPromise[_0x4925('0x84')](_0x50acd0);}})['then'](function(){return _0x3d83d2;})[_0x4925('0x28')](respondWithResult(_0x20beef,null))['catch'](handleError(_0x20beef,null));};exports[_0x4925('0x89')]=function(_0x330714,_0x5d5de6,_0x272537){return db[_0x4925('0x32')][_0x4925('0x4e')]({'where':{'id':_0x330714[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](handleEntityNotFound(_0x5d5de6,null))[_0x4925('0x28')](function(_0x1bb2ad){if(_0x1bb2ad){return _0x1bb2ad[_0x4925('0x89')](_0x330714['query'][_0x4925('0x68')]);}})['then'](function(_0x1da163){if(_0x1da163){return db[_0x4925('0x64')]['destroy']({'where':{'ListId':_0x330714[_0x4925('0x37')][_0x4925('0x68')],'CampaignId':_0x330714[_0x4925('0x4c')]['id']}})[_0x4925('0x28')](function(){return _0x1da163;});}})[_0x4925('0x28')](respondWithStatusCode(_0x5d5de6,null))[_0x4925('0x4a')](handleError(_0x5d5de6,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 09daeb3..59be538 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1d8468,_0x524250){var _0x3c7e0a=function(_0x3120ac){while(--_0x3120ac){_0x1d8468['push'](_0x1d8468['shift']());}};_0x3c7e0a(++_0x524250);}(_0x7a54,0x106));var _0x47a5=function(_0x1ff194,_0x55b7cc){_0x1ff194=_0x1ff194-0x0;var _0xab7626=_0x7a54[_0x1ff194];return _0xab7626;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xfe9843,_0x26e709){var _0x7f7af7=function(_0x2588ea){while(--_0x2588ea){_0xfe9843['push'](_0xfe9843['shift']());}};_0x7f7af7(++_0x26e709);}(_0x7a54,0x106));var _0x47a5=function(_0x4b71f9,_0x2a76fb){_0x4b71f9=_0x4b71f9-0x0;var _0x1330af=_0x7a54[_0x4b71f9];return _0x1330af;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5d93090..802f1be 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 _0x54ef=['Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x4ba9a3,_0x238a21){var _0xa8ce9c=function(_0x15f800){while(--_0x15f800){_0x4ba9a3['push'](_0x4ba9a3['shift']());}};_0xa8ce9c(++_0x238a21);}(_0x54ef,0x112));var _0xf54e=function(_0x3ed746,_0x5635e1){_0x3ed746=_0x3ed746-0x0;var _0x4989a4=_0x54ef[_0x3ed746];return _0x4989a4;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('Campaign,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('Campaign,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});}exports[_0xf54e('0x15')]=function(_0x15cc48){var _0x3e7d96=this;return new Promise(function(_0x2e27b6,_0x1ef06e){return db[_0xf54e('0x16')][_0xf54e('0x17')]({'raw':_0x15cc48[_0xf54e('0x18')]?_0x15cc48['options']['raw']===undefined?!![]:![]:!![],'where':_0x15cc48[_0xf54e('0x18')]?_0x15cc48['options'][_0xf54e('0x19')]||null:null,'attributes':_0x15cc48[_0xf54e('0x18')]?_0x15cc48[_0xf54e('0x18')][_0xf54e('0x1a')]||null:null,'limit':_0x15cc48[_0xf54e('0x18')]?_0x15cc48[_0xf54e('0x18')][_0xf54e('0x1b')]||null:null,'include':_0x15cc48[_0xf54e('0x18')]?_0x15cc48[_0xf54e('0x18')][_0xf54e('0x1c')]?_[_0xf54e('0x1d')](_0x15cc48['options'][_0xf54e('0x1c')],function(_0x54f914){return{'model':db[_0x54f914[_0xf54e('0x1e')]],'as':_0x54f914['as'],'attributes':_0x54f914[_0xf54e('0x1a')],'include':_0x54f914[_0xf54e('0x1c')]?_[_0xf54e('0x1d')](_0x54f914[_0xf54e('0x1c')],function(_0x160160){return{'model':db[_0x160160[_0xf54e('0x1e')]],'as':_0x160160['as'],'attributes':_0x160160[_0xf54e('0x1a')],'include':_0x160160[_0xf54e('0x1c')]?_[_0xf54e('0x1d')](_0x160160[_0xf54e('0x1c')],function(_0x39c0ae){return{'model':db[_0x39c0ae[_0xf54e('0x1e')]],'as':_0x39c0ae['as'],'attributes':_0x39c0ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xf54e('0xc')](function(_0x4cbf7c){logger[_0xf54e('0xd')]('GetCampaign',_0x15cc48);logger[_0xf54e('0x10')](_0xf54e('0x15'),_0x15cc48,JSON[_0xf54e('0x11')](_0x4cbf7c));_0x2e27b6(_0x4cbf7c);})[_0xf54e('0x1f')](function(_0x25b643){logger[_0xf54e('0x12')](_0xf54e('0x15'),_0x25b643['message'],_0x15cc48);_0x1ef06e(_0x3e7d96['error'](0x1f4,_0x25b643[_0xf54e('0x13')]));});});}; \ No newline at end of file +var _0xb63f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','info','moment','bluebird'];(function(_0x36d344,_0x5a52ec){var _0x1c16ef=function(_0x4386ef){while(--_0x4386ef){_0x36d344['push'](_0x36d344['shift']());}};_0x1c16ef(++_0x5a52ec);}(_0xb63f,0xa3));var _0xfb63=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xb63f[_0x2390bd];return _0x3a969d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfb63('0x0'));var BPromise=require(_0xfb63('0x1'));var rs=require(_0xfb63('0x2'));var fs=require('fs');var Redis=require(_0xfb63('0x3'));var db=require(_0xfb63('0x4'))['db'];var utils=require(_0xfb63('0x5'));var logger=require(_0xfb63('0x6'))(_0xfb63('0x7'));var config=require(_0xfb63('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb63('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x284c59,_0xcf49af,_0x51bc4f){return new BPromise(function(_0x495392,_0x51bce0){return client[_0xfb63('0xa')](_0x284c59,_0x51bc4f)[_0xfb63('0xb')](function(_0x28904e){logger['info'](_0xfb63('0xc'),_0xcf49af,_0xfb63('0xd'));logger[_0xfb63('0xe')](_0xfb63('0xf'),_0xcf49af,_0xfb63('0xd'),JSON[_0xfb63('0x10')](_0x28904e));if(_0x28904e[_0xfb63('0x11')]){if(_0x28904e[_0xfb63('0x11')]['code']===0x1f4){logger['error'](_0xfb63('0xc'),_0xcf49af,_0x28904e[_0xfb63('0x11')][_0xfb63('0x12')]);return _0x51bce0(_0x28904e['error'][_0xfb63('0x12')]);}logger[_0xfb63('0x11')]('Campaign,\x20%s,\x20%s',_0xcf49af,_0x28904e[_0xfb63('0x11')][_0xfb63('0x12')]);return _0x495392(_0x28904e[_0xfb63('0x11')][_0xfb63('0x12')]);}else{logger['info'](_0xfb63('0xc'),_0xcf49af,'request\x20sent');_0x495392(_0x28904e[_0xfb63('0x13')][_0xfb63('0x12')]);}})[_0xfb63('0x14')](function(_0xd8c767){logger[_0xfb63('0x11')]('Campaign,\x20%s,\x20%s',_0xcf49af,_0xd8c767);_0x51bce0(_0xd8c767);});});}exports[_0xfb63('0x15')]=function(_0x5dfd32){var _0x43a9ad=this;return new Promise(function(_0x4f7508,_0x31f41c){return db[_0xfb63('0x16')][_0xfb63('0x17')]({'raw':_0x5dfd32[_0xfb63('0x18')]?_0x5dfd32['options'][_0xfb63('0x19')]===undefined?!![]:![]:!![],'where':_0x5dfd32['options']?_0x5dfd32[_0xfb63('0x18')][_0xfb63('0x1a')]||null:null,'attributes':_0x5dfd32['options']?_0x5dfd32[_0xfb63('0x18')][_0xfb63('0x1b')]||null:null,'limit':_0x5dfd32['options']?_0x5dfd32[_0xfb63('0x18')][_0xfb63('0x1c')]||null:null,'include':_0x5dfd32[_0xfb63('0x18')]?_0x5dfd32[_0xfb63('0x18')][_0xfb63('0x1d')]?_[_0xfb63('0x1e')](_0x5dfd32[_0xfb63('0x18')][_0xfb63('0x1d')],function(_0x43c245){return{'model':db[_0x43c245[_0xfb63('0x1f')]],'as':_0x43c245['as'],'attributes':_0x43c245[_0xfb63('0x1b')],'include':_0x43c245[_0xfb63('0x1d')]?_[_0xfb63('0x1e')](_0x43c245[_0xfb63('0x1d')],function(_0x26036d){return{'model':db[_0x26036d[_0xfb63('0x1f')]],'as':_0x26036d['as'],'attributes':_0x26036d[_0xfb63('0x1b')],'include':_0x26036d[_0xfb63('0x1d')]?_['map'](_0x26036d[_0xfb63('0x1d')],function(_0x4c80c1){return{'model':db[_0x4c80c1['model']],'as':_0x4c80c1['as'],'attributes':_0x4c80c1[_0xfb63('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb63('0xb')](function(_0xaad3a4){logger[_0xfb63('0x20')](_0xfb63('0x15'),_0x5dfd32);logger[_0xfb63('0xe')]('GetCampaign',_0x5dfd32,JSON[_0xfb63('0x10')](_0xaad3a4));_0x4f7508(_0xaad3a4);})[_0xfb63('0x14')](function(_0x441dd7){logger[_0xfb63('0x11')](_0xfb63('0x15'),_0x441dd7[_0xfb63('0x12')],_0x5dfd32);_0x31f41c(_0x43a9ad[_0xfb63('0x11')](0x1f4,_0x441dd7[_0xfb63('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 8d40d19..ac1f639 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 _0x9795=['getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','addBlackLists','destroy','delete','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/hoppers'];(function(_0x311090,_0xea4621){var _0x2efe7d=function(_0x7582a4){while(--_0x7582a4){_0x311090['push'](_0x311090['shift']());}};_0x2efe7d(++_0xea4621);}(_0x9795,0x1e3));var _0x5979=function(_0x2b4ebf,_0x576adb){_0x2b4ebf=_0x2b4ebf-0x0;var _0x3ec090=_0x9795[_0x2b4ebf];return _0x3ec090;};'use strict';var multer=require(_0x5979('0x0'));var util=require('util');var path=require(_0x5979('0x1'));var timeout=require(_0x5979('0x2'));var express=require(_0x5979('0x3'));var router=express[_0x5979('0x4')]();var fs_extra=require(_0x5979('0x5'));var auth=require(_0x5979('0x6'));var interaction=require(_0x5979('0x7'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x5979('0x8')]('/',auth[_0x5979('0x9')](),controller[_0x5979('0xa')]);router['get'](_0x5979('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5979('0xc'),auth[_0x5979('0x9')](),controller[_0x5979('0xd')]);router[_0x5979('0x8')]('/:id/hopper_histories',auth[_0x5979('0x9')](),controller['getHopperHistories']);router[_0x5979('0x8')](_0x5979('0xe'),auth[_0x5979('0x9')](),controller[_0x5979('0xf')]);router['get'](_0x5979('0x10'),auth[_0x5979('0x9')](),controller[_0x5979('0x11')]);router['get']('/:id/lists',auth[_0x5979('0x9')](),controller[_0x5979('0x12')]);router[_0x5979('0x8')](_0x5979('0x13'),auth['isAuthenticated'](),controller[_0x5979('0x14')]);router[_0x5979('0x15')]('/',auth[_0x5979('0x9')](),controller[_0x5979('0x16')]);router[_0x5979('0x15')]('/:id/clone',auth[_0x5979('0x9')](),controller[_0x5979('0x17')]);router[_0x5979('0x15')](_0x5979('0x18'),auth['isAuthenticated'](),controller[_0x5979('0x19')]);router[_0x5979('0x15')](_0x5979('0x13'),auth[_0x5979('0x9')](),controller[_0x5979('0x1a')]);router['put']('/:id',auth[_0x5979('0x9')](),controller['update']);router['delete'](_0x5979('0xb'),auth[_0x5979('0x9')](),controller[_0x5979('0x1b')]);router[_0x5979('0x1c')]('/:id/lists',auth[_0x5979('0x9')](),controller[_0x5979('0x1d')]);router[_0x5979('0x1c')](_0x5979('0x13'),auth[_0x5979('0x9')](),controller['removeBlackLists']);module[_0x5979('0x1e')]=router; \ No newline at end of file +var _0x2bc9=['removeLists','removeBlackLists','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getLists','/:id/blacklists','post','create','clone','addLists','put','/:id','destroy','delete','/:id/lists'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x2bc9,0x1a7));var _0x92bc=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0x2bc9[_0x222a4b];return _0x2bedb3;};'use strict';var multer=require('multer');var util=require(_0x92bc('0x0'));var path=require('path');var timeout=require(_0x92bc('0x1'));var express=require('express');var router=express[_0x92bc('0x2')]();var fs_extra=require(_0x92bc('0x3'));var auth=require(_0x92bc('0x4'));var interaction=require(_0x92bc('0x5'));var config=require(_0x92bc('0x6'));var controller=require('./campaign.controller');router[_0x92bc('0x7')]('/',auth[_0x92bc('0x8')](),controller[_0x92bc('0x9')]);router[_0x92bc('0x7')]('/:id',auth[_0x92bc('0x8')](),controller[_0x92bc('0xa')]);router[_0x92bc('0x7')](_0x92bc('0xb'),auth[_0x92bc('0x8')](),controller[_0x92bc('0xc')]);router[_0x92bc('0x7')]('/:id/hopper_histories',auth[_0x92bc('0x8')](),controller[_0x92bc('0xd')]);router['get'](_0x92bc('0xe'),auth[_0x92bc('0x8')](),controller[_0x92bc('0xf')]);router['get']('/:id/hopper_black',auth[_0x92bc('0x8')](),controller['getHopperBlacks']);router[_0x92bc('0x7')]('/:id/lists',auth[_0x92bc('0x8')](),controller[_0x92bc('0x10')]);router['get'](_0x92bc('0x11'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x92bc('0x12')]('/',auth[_0x92bc('0x8')](),controller[_0x92bc('0x13')]);router[_0x92bc('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0x92bc('0x14')]);router[_0x92bc('0x12')]('/:id/lists',auth[_0x92bc('0x8')](),controller[_0x92bc('0x15')]);router[_0x92bc('0x12')](_0x92bc('0x11'),auth[_0x92bc('0x8')](),controller['addBlackLists']);router[_0x92bc('0x16')](_0x92bc('0x17'),auth[_0x92bc('0x8')](),controller['update']);router['delete'](_0x92bc('0x17'),auth[_0x92bc('0x8')](),controller[_0x92bc('0x18')]);router[_0x92bc('0x19')](_0x92bc('0x1a'),auth[_0x92bc('0x8')](),controller[_0x92bc('0x1b')]);router[_0x92bc('0x19')](_0x92bc('0x11'),auth[_0x92bc('0x8')](),controller[_0x92bc('0x1c')]);module[_0x92bc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 35bb9db..610bc19 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 _0x8681=['getDataValue','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x13624c,_0xa55c7c){var _0x2a0922=function(_0x232e3b){while(--_0x232e3b){_0x13624c['push'](_0x13624c['shift']());}};_0x2a0922(++_0xa55c7c);}(_0x8681,0x1eb));var _0x1868=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x8681[_0x5a8aa3];return _0x5d0458;};'use strict';var Sequelize=require(_0x1868('0x0'));module['exports']={'key':{'type':Sequelize[_0x1868('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1868('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1868('0x1')]},'name':{'type':Sequelize[_0x1868('0x3')],'get':function(){return this[_0x1868('0x4')]('key');}}}; \ No newline at end of file +var _0x5c2c=['TEXT','STRING','VIRTUAL','getDataValue','key','exports'];(function(_0x2d0ef5,_0x5621a4){var _0x550979=function(_0x23d4c7){while(--_0x23d4c7){_0x2d0ef5['push'](_0x2d0ef5['shift']());}};_0x550979(++_0x5621a4);}(_0x5c2c,0x1c1));var _0xc5c2=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5c2c[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0xc5c2('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc5c2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc5c2('0x2')]},'name':{'type':Sequelize[_0xc5c2('0x3')],'get':function(){return this[_0xc5c2('0x4')](_0xc5c2('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 899186c..b69c1d1 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 _0x967a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x206ea5,_0x1d209e){var _0x15d2ed=function(_0xc5098b){while(--_0xc5098b){_0x206ea5['push'](_0x206ea5['shift']());}};_0x15d2ed(++_0x1d209e);}(_0x967a,0x160));var _0xa967=function(_0xb00e38,_0x225876){_0xb00e38=_0xb00e38-0x0;var _0x3047b2=_0x967a[_0xb00e38];return _0x3047b2;};'use strict';var emlformat=require(_0xa967('0x0'));var rimraf=require(_0xa967('0x1'));var zipdir=require(_0xa967('0x2'));var jsonpatch=require(_0xa967('0x3'));var rp=require(_0xa967('0x4'));var moment=require(_0xa967('0x5'));var BPromise=require(_0xa967('0x6'));var Mustache=require(_0xa967('0x7'));var util=require(_0xa967('0x8'));var path=require('path');var sox=require(_0xa967('0x9'));var csv=require('to-csv');var ejs=require(_0xa967('0xa'));var fs=require('fs');var fs_extra=require(_0xa967('0xb'));var _=require(_0xa967('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa967('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa967('0xe'));var querystring=require('querystring');var Papa=require(_0xa967('0xf'));var Redis=require('ioredis');var authService=require(_0xa967('0x10'));var qs=require(_0xa967('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa967('0x12'));var logger=require(_0xa967('0x13'))(_0xa967('0x14'));var utils=require(_0xa967('0x15'));var config=require(_0xa967('0x16'));var licenseUtil=require(_0xa967('0x17'));var db=require(_0xa967('0x18'))['db'];function respondWithStatusCode(_0x45473f,_0x5575c3){_0x5575c3=_0x5575c3||0xcc;return function(_0x588995){if(_0x588995){return _0x45473f[_0xa967('0x19')](_0x5575c3);}return _0x45473f[_0xa967('0x1a')](_0x5575c3)[_0xa967('0x1b')]();};}function respondWithResult(_0x2596a1,_0x485e0e){_0x485e0e=_0x485e0e||0xc8;return function(_0x25beb9){if(_0x25beb9){return _0x2596a1[_0xa967('0x1a')](_0x485e0e)[_0xa967('0x1c')](_0x25beb9);}};}function respondWithFilteredResult(_0x74b0b,_0x1fd906){return function(_0x4a039a){if(_0x4a039a){var _0x5b13cc=typeof _0x1fd906[_0xa967('0x1d')]===_0xa967('0x1e')&&typeof _0x1fd906['limit']==='undefined';var _0x3b7b4b=_0x4a039a[_0xa967('0x1f')];var _0x48a6f2=_0x5b13cc?0x0:_0x1fd906[_0xa967('0x1d')];var _0x53c52a=_0x5b13cc?_0x4a039a['count']:_0x1fd906[_0xa967('0x1d')]+_0x1fd906[_0xa967('0x20')];var _0x328e30;if(_0x53c52a>=_0x3b7b4b){_0x53c52a=_0x3b7b4b;_0x328e30=0xc8;}else{_0x328e30=0xce;}_0x74b0b['status'](_0x328e30);return _0x74b0b['set'](_0xa967('0x21'),_0x48a6f2+'-'+_0x53c52a+'/'+_0x3b7b4b)[_0xa967('0x1c')](_0x4a039a);}return null;};}function patchUpdates(_0x3c3780){return function(_0x26be92){try{jsonpatch[_0xa967('0x22')](_0x26be92,_0x3c3780,!![]);}catch(_0x308234){return BPromise['reject'](_0x308234);}return _0x26be92[_0xa967('0x23')]();};}function saveUpdates(_0x4067f4,_0x202470){return function(_0x101a2c){if(_0x101a2c){return _0x101a2c[_0xa967('0x24')](_0x4067f4)[_0xa967('0x25')](function(_0x5dc56d){return _0x5dc56d;});}return null;};}function removeEntity(_0x3df6cf,_0x39c1be){return function(_0x35f4d2){if(_0x35f4d2){return _0x35f4d2[_0xa967('0x26')]()[_0xa967('0x25')](function(){var _0x4ad435=_0x35f4d2[_0xa967('0x27')]({'plain':!![]});var _0x253e68=_0xa967('0x28');return db[_0xa967('0x29')]['destroy']({'where':{'type':_0x253e68,'resourceId':_0x4ad435['id']}})[_0xa967('0x25')](function(){return _0x35f4d2;});})[_0xa967('0x25')](function(){_0x3df6cf[_0xa967('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e4b4,_0x2e340a){return function(_0x35e7f0){if(!_0x35e7f0){_0x20e4b4[_0xa967('0x19')](0x194);}return _0x35e7f0;};}function handleError(_0x1f0069,_0x350a3d){_0x350a3d=_0x350a3d||0x1f4;return function(_0x5e773f){logger['error'](_0x5e773f[_0xa967('0x2a')]);if(_0x5e773f[_0xa967('0x2b')]){delete _0x5e773f['name'];}_0x1f0069[_0xa967('0x1a')](_0x350a3d)['send'](_0x5e773f);};}exports['index']=function(_0x3472c4,_0x17170c){var _0x8e0d41={},_0x497c4c={},_0x187390={'count':0x0,'rows':[]};var _0x3be9ed=_[_0xa967('0x2c')](db[_0xa967('0x2d')][_0xa967('0x2e')],function(_0x233d3c){return{'name':_0x233d3c[_0xa967('0x2f')],'type':_0x233d3c[_0xa967('0x30')][_0xa967('0x31')]};});_0x497c4c[_0xa967('0x32')]=_['map'](_0x3be9ed,_0xa967('0x2b'));_0x497c4c['query']=_[_0xa967('0x33')](_0x3472c4[_0xa967('0x34')]);_0x497c4c[_0xa967('0x35')]=_[_0xa967('0x36')](_0x497c4c[_0xa967('0x32')],_0x497c4c[_0xa967('0x34')]);_0x8e0d41[_0xa967('0x37')]=_[_0xa967('0x36')](_0x497c4c['model'],qs[_0xa967('0x38')](_0x3472c4[_0xa967('0x34')]['fields']));_0x8e0d41[_0xa967('0x37')]=_0x8e0d41[_0xa967('0x37')][_0xa967('0x39')]?_0x8e0d41['attributes']:_0x497c4c['model'];if(!_0x3472c4[_0xa967('0x34')][_0xa967('0x3a')](_0xa967('0x3b'))){_0x8e0d41[_0xa967('0x20')]=qs[_0xa967('0x20')](_0x3472c4[_0xa967('0x34')][_0xa967('0x20')]);_0x8e0d41['offset']=qs['offset'](_0x3472c4[_0xa967('0x34')]['offset']);}_0x8e0d41[_0xa967('0x3c')]=qs[_0xa967('0x3d')](_0x3472c4[_0xa967('0x34')]['sort']);_0x8e0d41[_0xa967('0x3e')]=qs[_0xa967('0x35')](_[_0xa967('0x3f')](_0x3472c4[_0xa967('0x34')],_0x497c4c[_0xa967('0x35')]),_0x3be9ed);if(_0x3472c4[_0xa967('0x34')]['filter']){_0x8e0d41['where']=_[_0xa967('0x40')](_0x8e0d41[_0xa967('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3472c4[_0xa967('0x34')][_0xa967('0x41')]+'%'}},{'value':{'$like':'%'+_0x3472c4[_0xa967('0x34')][_0xa967('0x41')]+'%'}}]});}_0x8e0d41=_[_0xa967('0x40')]({},_0x8e0d41,_0x3472c4[_0xa967('0x42')]);var _0x3d8671={'where':_0x8e0d41[_0xa967('0x3e')]};return db[_0xa967('0x2d')][_0xa967('0x1f')](_0x3d8671)[_0xa967('0x25')](function(_0x4c8c99){_0x187390['count']=_0x4c8c99;if(_0x3472c4[_0xa967('0x34')][_0xa967('0x43')]){_0x8e0d41[_0xa967('0x44')]=[{'all':!![]}];}return db[_0xa967('0x2d')][_0xa967('0x45')](_0x8e0d41);})[_0xa967('0x25')](function(_0x2433b0){_0x187390[_0xa967('0x46')]=_0x2433b0;return _0x187390;})[_0xa967('0x25')](respondWithFilteredResult(_0x17170c,_0x8e0d41))[_0xa967('0x47')](handleError(_0x17170c,null));};exports[_0xa967('0x48')]=function(_0x1a433e,_0x56ddd3){var _0x592170={'raw':!![],'where':{'id':_0x1a433e[_0xa967('0x49')]['id']}},_0x293d47={};_0x293d47[_0xa967('0x32')]=_[_0xa967('0x33')](db[_0xa967('0x2d')]['rawAttributes']);_0x293d47[_0xa967('0x34')]=_['keys'](_0x1a433e[_0xa967('0x34')]);_0x293d47[_0xa967('0x35')]=_[_0xa967('0x36')](_0x293d47['model'],_0x293d47['query']);_0x592170[_0xa967('0x37')]=_[_0xa967('0x36')](_0x293d47['model'],qs[_0xa967('0x38')](_0x1a433e['query'][_0xa967('0x38')]));_0x592170[_0xa967('0x37')]=_0x592170[_0xa967('0x37')]['length']?_0x592170[_0xa967('0x37')]:_0x293d47['model'];if(_0x1a433e['query'][_0xa967('0x43')]){_0x592170['include']=[{'all':!![]}];}_0x592170=_['merge']({},_0x592170,_0x1a433e[_0xa967('0x42')]);return db[_0xa967('0x2d')][_0xa967('0x4a')](_0x592170)[_0xa967('0x25')](handleEntityNotFound(_0x56ddd3,null))[_0xa967('0x25')](respondWithResult(_0x56ddd3,null))['catch'](handleError(_0x56ddd3,null));};exports[_0xa967('0x24')]=function(_0x1e38ca,_0xa5dba9){if(_0x1e38ca[_0xa967('0x4b')]['id']){delete _0x1e38ca['body']['id'];}return db[_0xa967('0x2d')]['find']({'where':{'id':_0x1e38ca['params']['id']}})[_0xa967('0x25')](handleEntityNotFound(_0xa5dba9,null))[_0xa967('0x25')](saveUpdates(_0x1e38ca[_0xa967('0x4b')],null))['then'](respondWithResult(_0xa5dba9,null))[_0xa967('0x47')](handleError(_0xa5dba9,null));};exports['destroy']=function(_0x26aafc,_0x113064){return db[_0xa967('0x2d')]['find']({'where':{'id':_0x26aafc[_0xa967('0x49')]['id']}})[_0xa967('0x25')](handleEntityNotFound(_0x113064,null))[_0xa967('0x25')](removeEntity(_0x113064,null))[_0xa967('0x47')](handleError(_0x113064,null));};exports['create']=function(_0x4fec81,_0xb9fc29){var _0x524720={'key':_0x4fec81[_0xa967('0x4b')]['key']};if(_0x4fec81[_0xa967('0x4b')][_0xa967('0x4c')]){_0x524720['MailAccountId']=_0x4fec81[_0xa967('0x4b')][_0xa967('0x4c')];}else if(_0x4fec81[_0xa967('0x4b')][_0xa967('0x4d')]){_0x524720['SmsAccountId']=_0x4fec81['body'][_0xa967('0x4d')];}else if(_0x4fec81[_0xa967('0x4b')][_0xa967('0x4e')]){_0x524720[_0xa967('0x4e')]=_0x4fec81[_0xa967('0x4b')][_0xa967('0x4e')];}else if(_0x4fec81[_0xa967('0x4b')]['ChatWebsiteId']){_0x524720['ChatWebsiteId']=_0x4fec81[_0xa967('0x4b')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x524720})[_0xa967('0x25')](function(_0x3905be){if(_0x3905be){throw new db[(_0xa967('0x4f'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xa967('0x2d')][_0xa967('0x50')](_0x4fec81[_0xa967('0x4b')]);})[_0xa967('0x25')](function(_0x2a7c29){var _0x3657a0=_0x4fec81['user'][_0xa967('0x27')]({'plain':!![]});if(!_0x3657a0)throw new Error(_0xa967('0x51'));if(_0x3657a0[_0xa967('0x52')]===_0xa967('0x53')){var _0x1a5a04=_0x2a7c29[_0xa967('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xa967('0x4a')]({'where':{'name':_0xa967('0x28'),'userProfileId':_0x3657a0[_0xa967('0x54')]},'raw':!![]})[_0xa967('0x25')](function(_0x58ab82){if(_0x58ab82&&_0x58ab82[_0xa967('0x55')]===0x0){return db[_0xa967('0x29')]['create']({'name':_0x1a5a04[_0xa967('0x2b')],'resourceId':_0x1a5a04['id'],'type':_0x58ab82['name'],'sectionId':_0x58ab82['id']},{})[_0xa967('0x25')](function(){return _0x2a7c29;});}else{return _0x2a7c29;}})[_0xa967('0x47')](function(_0xad3399){logger[_0xa967('0x56')](_0xa967('0x57'),_0xad3399);throw _0xad3399;});}return _0x2a7c29;})[_0xa967('0x25')](respondWithResult(_0xb9fc29,0xc9))[_0xa967('0x47')](handleError(_0xb9fc29,null));}; \ No newline at end of file +var _0x2027=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','CannedAnswers','stack','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','keys','includeAll','include','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x19213f,_0x1a0b1b){var _0x174fd8=function(_0x302ebe){while(--_0x302ebe){_0x19213f['push'](_0x19213f['shift']());}};_0x174fd8(++_0x1a0b1b);}(_0x2027,0x19e));var _0x7202=function(_0xd1c129,_0x74d000){_0xd1c129=_0xd1c129-0x0;var _0x506328=_0x2027[_0xd1c129];return _0x506328;};'use strict';var emlformat=require(_0x7202('0x0'));var rimraf=require(_0x7202('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7202('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7202('0x3'));var Mustache=require(_0x7202('0x4'));var util=require(_0x7202('0x5'));var path=require(_0x7202('0x6'));var sox=require(_0x7202('0x7'));var csv=require(_0x7202('0x8'));var ejs=require(_0x7202('0x9'));var fs=require('fs');var fs_extra=require(_0x7202('0xa'));var _=require(_0x7202('0xb'));var squel=require(_0x7202('0xc'));var crypto=require('crypto');var jsforce=require(_0x7202('0xd'));var deskjs=require(_0x7202('0xe'));var toCsv=require(_0x7202('0x8'));var querystring=require('querystring');var Papa=require(_0x7202('0xf'));var Redis=require('ioredis');var authService=require(_0x7202('0x10'));var qs=require(_0x7202('0x11'));var as=require(_0x7202('0x12'));var hardwareService=require(_0x7202('0x13'));var logger=require(_0x7202('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7202('0x15'));var licenseUtil=require(_0x7202('0x16'));var db=require(_0x7202('0x17'))['db'];function respondWithStatusCode(_0x362690,_0x22ea26){_0x22ea26=_0x22ea26||0xcc;return function(_0x1a9861){if(_0x1a9861){return _0x362690[_0x7202('0x18')](_0x22ea26);}return _0x362690[_0x7202('0x19')](_0x22ea26)['end']();};}function respondWithResult(_0x4d5487,_0x33d70a){_0x33d70a=_0x33d70a||0xc8;return function(_0x1b198c){if(_0x1b198c){return _0x4d5487[_0x7202('0x19')](_0x33d70a)[_0x7202('0x1a')](_0x1b198c);}};}function respondWithFilteredResult(_0x46acaf,_0x435aa6){return function(_0x5bfd87){if(_0x5bfd87){var _0x2da3fb=typeof _0x435aa6[_0x7202('0x1b')]==='undefined'&&typeof _0x435aa6['limit']===_0x7202('0x1c');var _0x65c139=_0x5bfd87[_0x7202('0x1d')];var _0x36e229=_0x2da3fb?0x0:_0x435aa6[_0x7202('0x1b')];var _0x3a62b3=_0x2da3fb?_0x5bfd87['count']:_0x435aa6['offset']+_0x435aa6[_0x7202('0x1e')];var _0x333028;if(_0x3a62b3>=_0x65c139){_0x3a62b3=_0x65c139;_0x333028=0xc8;}else{_0x333028=0xce;}_0x46acaf[_0x7202('0x19')](_0x333028);return _0x46acaf[_0x7202('0x1f')](_0x7202('0x20'),_0x36e229+'-'+_0x3a62b3+'/'+_0x65c139)[_0x7202('0x1a')](_0x5bfd87);}return null;};}function patchUpdates(_0x3553c2){return function(_0xf989d5){try{jsonpatch['apply'](_0xf989d5,_0x3553c2,!![]);}catch(_0x3643bc){return BPromise[_0x7202('0x21')](_0x3643bc);}return _0xf989d5[_0x7202('0x22')]();};}function saveUpdates(_0x5a8714,_0x56f8d9){return function(_0x4ad486){if(_0x4ad486){return _0x4ad486['update'](_0x5a8714)['then'](function(_0x1c7a2d){return _0x1c7a2d;});}return null;};}function removeEntity(_0x9a524b,_0x5889f5){return function(_0xaaf87){if(_0xaaf87){return _0xaaf87[_0x7202('0x23')]()[_0x7202('0x24')](function(){var _0x5c926e=_0xaaf87[_0x7202('0x25')]({'plain':!![]});var _0x410add=_0x7202('0x26');return db['UserProfileResource'][_0x7202('0x23')]({'where':{'type':_0x410add,'resourceId':_0x5c926e['id']}})[_0x7202('0x24')](function(){return _0xaaf87;});})[_0x7202('0x24')](function(){_0x9a524b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e778,_0x460a0d){return function(_0x40e0a5){if(!_0x40e0a5){_0x10e778[_0x7202('0x18')](0x194);}return _0x40e0a5;};}function handleError(_0x17a398,_0x14bf0d){_0x14bf0d=_0x14bf0d||0x1f4;return function(_0x35c752){logger['error'](_0x35c752[_0x7202('0x27')]);if(_0x35c752[_0x7202('0x28')]){delete _0x35c752[_0x7202('0x28')];}_0x17a398['status'](_0x14bf0d)[_0x7202('0x29')](_0x35c752);};}exports[_0x7202('0x2a')]=function(_0xa82207,_0x26213d){var _0x45a828={},_0x322179={},_0x1ecfba={'count':0x0,'rows':[]};var _0x8d6896=_[_0x7202('0x2b')](db[_0x7202('0x2c')][_0x7202('0x2d')],function(_0x571409){return{'name':_0x571409['fieldName'],'type':_0x571409['type'][_0x7202('0x2e')]};});_0x322179[_0x7202('0x2f')]=_[_0x7202('0x2b')](_0x8d6896,_0x7202('0x28'));_0x322179[_0x7202('0x30')]=_['keys'](_0xa82207[_0x7202('0x30')]);_0x322179[_0x7202('0x31')]=_[_0x7202('0x32')](_0x322179[_0x7202('0x2f')],_0x322179[_0x7202('0x30')]);_0x45a828[_0x7202('0x33')]=_[_0x7202('0x32')](_0x322179[_0x7202('0x2f')],qs['fields'](_0xa82207[_0x7202('0x30')][_0x7202('0x34')]));_0x45a828[_0x7202('0x33')]=_0x45a828[_0x7202('0x33')][_0x7202('0x35')]?_0x45a828[_0x7202('0x33')]:_0x322179['model'];if(!_0xa82207[_0x7202('0x30')]['hasOwnProperty'](_0x7202('0x36'))){_0x45a828[_0x7202('0x1e')]=qs[_0x7202('0x1e')](_0xa82207[_0x7202('0x30')][_0x7202('0x1e')]);_0x45a828['offset']=qs[_0x7202('0x1b')](_0xa82207[_0x7202('0x30')][_0x7202('0x1b')]);}_0x45a828[_0x7202('0x37')]=qs[_0x7202('0x38')](_0xa82207[_0x7202('0x30')][_0x7202('0x38')]);_0x45a828[_0x7202('0x39')]=qs[_0x7202('0x31')](_[_0x7202('0x3a')](_0xa82207[_0x7202('0x30')],_0x322179[_0x7202('0x31')]),_0x8d6896);if(_0xa82207[_0x7202('0x30')][_0x7202('0x3b')]){_0x45a828[_0x7202('0x39')]=_[_0x7202('0x3c')](_0x45a828[_0x7202('0x39')],{'$or':[{'key':{'$like':'%'+_0xa82207[_0x7202('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0xa82207[_0x7202('0x30')][_0x7202('0x3b')]+'%'}}]});}_0x45a828=_[_0x7202('0x3c')]({},_0x45a828,_0xa82207[_0x7202('0x3d')]);var _0x363a62={'where':_0x45a828[_0x7202('0x39')]};return db[_0x7202('0x2c')]['count'](_0x363a62)['then'](function(_0x10a741){_0x1ecfba[_0x7202('0x1d')]=_0x10a741;if(_0xa82207[_0x7202('0x30')]['includeAll']){_0x45a828['include']=[{'all':!![]}];}return db[_0x7202('0x2c')][_0x7202('0x3e')](_0x45a828);})[_0x7202('0x24')](function(_0x3dc3de){_0x1ecfba['rows']=_0x3dc3de;return _0x1ecfba;})[_0x7202('0x24')](respondWithFilteredResult(_0x26213d,_0x45a828))[_0x7202('0x3f')](handleError(_0x26213d,null));};exports[_0x7202('0x40')]=function(_0x28269c,_0x31c65e){var _0x192a54={'raw':!![],'where':{'id':_0x28269c[_0x7202('0x41')]['id']}},_0xc5d638={};_0xc5d638['model']=_[_0x7202('0x42')](db['CannedAnswer'][_0x7202('0x2d')]);_0xc5d638['query']=_[_0x7202('0x42')](_0x28269c['query']);_0xc5d638[_0x7202('0x31')]=_[_0x7202('0x32')](_0xc5d638[_0x7202('0x2f')],_0xc5d638[_0x7202('0x30')]);_0x192a54['attributes']=_[_0x7202('0x32')](_0xc5d638[_0x7202('0x2f')],qs[_0x7202('0x34')](_0x28269c['query'][_0x7202('0x34')]));_0x192a54[_0x7202('0x33')]=_0x192a54[_0x7202('0x33')][_0x7202('0x35')]?_0x192a54[_0x7202('0x33')]:_0xc5d638['model'];if(_0x28269c[_0x7202('0x30')][_0x7202('0x43')]){_0x192a54[_0x7202('0x44')]=[{'all':!![]}];}_0x192a54=_[_0x7202('0x3c')]({},_0x192a54,_0x28269c[_0x7202('0x3d')]);return db[_0x7202('0x2c')]['find'](_0x192a54)[_0x7202('0x24')](handleEntityNotFound(_0x31c65e,null))[_0x7202('0x24')](respondWithResult(_0x31c65e,null))[_0x7202('0x3f')](handleError(_0x31c65e,null));};exports[_0x7202('0x45')]=function(_0x3d2e4f,_0x1c8852){if(_0x3d2e4f[_0x7202('0x46')]['id']){delete _0x3d2e4f[_0x7202('0x46')]['id'];}return db[_0x7202('0x2c')][_0x7202('0x47')]({'where':{'id':_0x3d2e4f['params']['id']}})[_0x7202('0x24')](handleEntityNotFound(_0x1c8852,null))[_0x7202('0x24')](saveUpdates(_0x3d2e4f[_0x7202('0x46')],null))['then'](respondWithResult(_0x1c8852,null))[_0x7202('0x3f')](handleError(_0x1c8852,null));};exports['destroy']=function(_0x53853b,_0x2b9069){return db[_0x7202('0x2c')][_0x7202('0x47')]({'where':{'id':_0x53853b[_0x7202('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b9069,null))['then'](removeEntity(_0x2b9069,null))[_0x7202('0x3f')](handleError(_0x2b9069,null));};exports[_0x7202('0x48')]=function(_0x543121,_0x28d35b){var _0x41b1e0={'key':_0x543121[_0x7202('0x46')][_0x7202('0x2e')]};if(_0x543121[_0x7202('0x46')]['MailAccountId']){_0x41b1e0['MailAccountId']=_0x543121[_0x7202('0x46')][_0x7202('0x49')];}else if(_0x543121['body'][_0x7202('0x4a')]){_0x41b1e0[_0x7202('0x4a')]=_0x543121[_0x7202('0x46')]['SmsAccountId'];}else if(_0x543121['body']['OpenchannelAccountId']){_0x41b1e0[_0x7202('0x4b')]=_0x543121[_0x7202('0x46')][_0x7202('0x4b')];}else if(_0x543121[_0x7202('0x46')][_0x7202('0x4c')]){_0x41b1e0[_0x7202('0x4c')]=_0x543121['body'][_0x7202('0x4c')];}return db['CannedAnswer'][_0x7202('0x47')]({'where':_0x41b1e0})[_0x7202('0x24')](function(_0x38fc4e){if(_0x38fc4e){throw new db['Sequelize'][(_0x7202('0x4d'))](_0x7202('0x4e'));}return db[_0x7202('0x2c')][_0x7202('0x48')](_0x543121[_0x7202('0x46')]);})[_0x7202('0x24')](function(_0x5e2dc4){var _0x527bc4=_0x543121[_0x7202('0x4f')][_0x7202('0x25')]({'plain':!![]});if(!_0x527bc4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x527bc4[_0x7202('0x50')]===_0x7202('0x4f')){var _0x390213=_0x5e2dc4[_0x7202('0x25')]({'plain':!![]});return db[_0x7202('0x51')]['find']({'where':{'name':_0x7202('0x26'),'userProfileId':_0x527bc4[_0x7202('0x52')]},'raw':!![]})['then'](function(_0x46c500){if(_0x46c500&&_0x46c500[_0x7202('0x53')]===0x0){return db[_0x7202('0x54')][_0x7202('0x48')]({'name':_0x390213[_0x7202('0x28')],'resourceId':_0x390213['id'],'type':_0x46c500[_0x7202('0x28')],'sectionId':_0x46c500['id']},{})[_0x7202('0x24')](function(){return _0x5e2dc4;});}else{return _0x5e2dc4;}})[_0x7202('0x3f')](function(_0x3aeaf1){logger[_0x7202('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3aeaf1);throw _0x3aeaf1;});}return _0x5e2dc4;})[_0x7202('0x24')](respondWithResult(_0x28d35b,0xc9))['catch'](handleError(_0x28d35b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 723eec7..7e1bef2 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 _0xdf8d=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','CannedAnswer'];(function(_0x2565d5,_0xe6c944){var _0x1b546c=function(_0xe00d3a){while(--_0xe00d3a){_0x2565d5['push'](_0x2565d5['shift']());}};_0x1b546c(++_0xe6c944);}(_0xdf8d,0x1bf));var _0xddf8=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xdf8d[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0xddf8('0x0'));var util=require('util');var logger=require(_0xddf8('0x1'))('api');var moment=require(_0xddf8('0x2'));var BPromise=require(_0xddf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddf8('0x4'));var rimraf=require('rimraf');var config=require(_0xddf8('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0xddf8('0x6')]=function(_0x2d369d,_0x48fb95){return _0x2d369d[_0xddf8('0x7')](_0xddf8('0x8'),attributes,{'tableName':_0xddf8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddf8('0xa'),'collate':_0xddf8('0xb')});}; \ No newline at end of file +var _0xbe49=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0xbe49,0x1b7));var _0x9be4=function(_0x436fb7,_0x478f74){_0x436fb7=_0x436fb7-0x0;var _0x217de2=_0xbe49[_0x436fb7];return _0x217de2;};'use strict';var _=require(_0x9be4('0x0'));var util=require(_0x9be4('0x1'));var logger=require(_0x9be4('0x2'))(_0x9be4('0x3'));var moment=require(_0x9be4('0x4'));var BPromise=require('bluebird');var rp=require(_0x9be4('0x5'));var fs=require('fs');var path=require(_0x9be4('0x6'));var rimraf=require(_0x9be4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9be4('0x8'));module[_0x9be4('0x9')]=function(_0x1e536a,_0x8d453c){return _0x1e536a[_0x9be4('0xa')](_0x9be4('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9be4('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d5a99cc..0db4f35 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26c691,_0x29ded3){var _0x19b4ab=function(_0x411f00){while(--_0x411f00){_0x26c691['push'](_0x26c691['shift']());}};_0x19b4ab(++_0x29ded3);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x10bf04,_0x59ec08){var _0x2533f7=function(_0x102101){while(--_0x102101){_0x10bf04['push'](_0x10bf04['shift']());}};_0x2533f7(++_0x59ec08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 412463f..9570974 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 _0xc625=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xc625,0x12f));var _0x5c62=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc625[_0xa148b7];return _0x51efd3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c62('0x0'));var timeout=require(_0x5c62('0x1'));var express=require(_0x5c62('0x2'));var router=express['Router']();var fs_extra=require(_0x5c62('0x3'));var auth=require(_0x5c62('0x4'));var interaction=require(_0x5c62('0x5'));var config=require('../../config/environment');var controller=require(_0x5c62('0x6'));router[_0x5c62('0x7')]('/',auth[_0x5c62('0x8')](),controller[_0x5c62('0x9')]);router[_0x5c62('0x7')](_0x5c62('0xa'),auth[_0x5c62('0x8')](),controller[_0x5c62('0xb')]);router[_0x5c62('0xc')]('/',auth['isAuthenticated'](),controller[_0x5c62('0xd')]);router['put'](_0x5c62('0xa'),auth[_0x5c62('0x8')](),controller[_0x5c62('0xe')]);router[_0x5c62('0xf')](_0x5c62('0xa'),auth[_0x5c62('0x8')](),controller[_0x5c62('0x10')]);module[_0x5c62('0x11')]=router; \ No newline at end of file +var _0xd1fd=['./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x7090bd,_0x167b74){var _0x39f2af=function(_0x35f150){while(--_0x35f150){_0x7090bd['push'](_0x7090bd['shift']());}};_0x39f2af(++_0x167b74);}(_0xd1fd,0xd1));var _0xdd1f=function(_0x5914a3,_0x22e240){_0x5914a3=_0x5914a3-0x0;var _0x25af13=_0xd1fd[_0x5914a3];return _0x25af13;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd1f('0x0'));var express=require(_0xdd1f('0x1'));var router=express[_0xdd1f('0x2')]();var fs_extra=require(_0xdd1f('0x3'));var auth=require(_0xdd1f('0x4'));var interaction=require(_0xdd1f('0x5'));var config=require(_0xdd1f('0x6'));var controller=require(_0xdd1f('0x7'));router[_0xdd1f('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd1f('0x9')]);router['get'](_0xdd1f('0xa'),auth[_0xdd1f('0xb')](),controller[_0xdd1f('0xc')]);router['post']('/',auth[_0xdd1f('0xb')](),controller[_0xdd1f('0xd')]);router['put'](_0xdd1f('0xa'),auth[_0xdd1f('0xb')](),controller[_0xdd1f('0xe')]);router[_0xdd1f('0xf')](_0xdd1f('0xa'),auth[_0xdd1f('0xb')](),controller[_0xdd1f('0x10')]);module[_0xdd1f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4559c3e..d5bf7db 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 _0xecf8=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xecf8,0xd4));var _0x8ecf=function(_0x8ba70f,_0xcbf540){_0x8ba70f=_0x8ba70f-0x0;var _0x8f6056=_0xecf8[_0x8ba70f];return _0x8f6056;};'use strict';var Sequelize=require(_0x8ecf('0x0'));module[_0x8ecf('0x1')]={'calldate':{'type':Sequelize[_0x8ecf('0x2')],'allowNull':![],'defaultValue':_0x8ecf('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8ecf('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x8ecf('0x4')]},'channel':{'type':Sequelize[_0x8ecf('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x8ecf('0x4')]},'lastdata':{'type':Sequelize[_0x8ecf('0x4')]},'duration':{'type':Sequelize[_0x8ecf('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8ecf('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8ecf('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8ecf('0x4')]},'userfield':{'type':Sequelize[_0x8ecf('0x4')]},'uniqueid':{'type':Sequelize[_0x8ecf('0x4')]},'linkedid':{'type':Sequelize[_0x8ecf('0x4')]},'sequence':{'type':Sequelize[_0x8ecf('0x4')]},'peeraccount':{'type':Sequelize[_0x8ecf('0x4')]},'type':{'type':Sequelize[_0x8ecf('0x4')]},'tag':{'type':Sequelize[_0x8ecf('0x4')]}}; \ No newline at end of file +var _0xa9e5=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x33f473,_0x30a32e){_0x33f473=_0x33f473-0x0;var _0xc02c30=_0xa9e5[_0x33f473];return _0xc02c30;};'use strict';var Sequelize=require(_0x5a9e('0x0'));module[_0x5a9e('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5a9e('0x2')},'clid':{'type':Sequelize[_0x5a9e('0x3')]},'src':{'type':Sequelize[_0x5a9e('0x3')]},'dst':{'type':Sequelize[_0x5a9e('0x3')]},'dcontext':{'type':Sequelize[_0x5a9e('0x3')]},'channel':{'type':Sequelize[_0x5a9e('0x3')]},'dstchannel':{'type':Sequelize[_0x5a9e('0x3')]},'lastapp':{'type':Sequelize[_0x5a9e('0x3')]},'lastdata':{'type':Sequelize[_0x5a9e('0x3')]},'duration':{'type':Sequelize[_0x5a9e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5a9e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5a9e('0x3')]},'amaflags':{'type':Sequelize[_0x5a9e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5a9e('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5a9e('0x3')]},'linkedid':{'type':Sequelize[_0x5a9e('0x3')]},'sequence':{'type':Sequelize[_0x5a9e('0x3')]},'peeraccount':{'type':Sequelize[_0x5a9e('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5a9e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 371bc84..80f6e2d 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 _0x56e7=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x2809ad,_0x231101){var _0x3dbdf6=function(_0x2b0345){while(--_0x2b0345){_0x2809ad['push'](_0x2809ad['shift']());}};_0x3dbdf6(++_0x231101);}(_0x56e7,0x7b));var _0x756e=function(_0x4988e7,_0x17214d){_0x4988e7=_0x4988e7-0x0;var _0x30d8ef=_0x56e7[_0x4988e7];return _0x30d8ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x756e('0x0'));var zipdir=require(_0x756e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x756e('0x2'));var moment=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var Mustache=require(_0x756e('0x5'));var util=require(_0x756e('0x6'));var path=require(_0x756e('0x7'));var sox=require(_0x756e('0x8'));var csv=require('to-csv');var ejs=require(_0x756e('0x9'));var fs=require('fs');var fs_extra=require(_0x756e('0xa'));var _=require(_0x756e('0xb'));var squel=require(_0x756e('0xc'));var crypto=require('crypto');var jsforce=require(_0x756e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x756e('0xe'));var querystring=require(_0x756e('0xf'));var Papa=require(_0x756e('0x10'));var Redis=require(_0x756e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x756e('0x12'));var hardwareService=require(_0x756e('0x13'));var logger=require(_0x756e('0x14'))('api');var utils=require(_0x756e('0x15'));var config=require(_0x756e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b68ef,_0x569e8f){_0x569e8f=_0x569e8f||0xcc;return function(_0x459237){if(_0x459237){return _0x1b68ef[_0x756e('0x17')](_0x569e8f);}return _0x1b68ef[_0x756e('0x18')](_0x569e8f)[_0x756e('0x19')]();};}function respondWithResult(_0x252333,_0x4ae32a){_0x4ae32a=_0x4ae32a||0xc8;return function(_0x4b3660){if(_0x4b3660){return _0x252333[_0x756e('0x18')](_0x4ae32a)[_0x756e('0x1a')](_0x4b3660);}};}function respondWithFilteredResult(_0xccccd4,_0x59956f){return function(_0x530e36){if(_0x530e36){var _0x1f7161=typeof _0x59956f[_0x756e('0x1b')]===_0x756e('0x1c')&&typeof _0x59956f[_0x756e('0x1d')]===_0x756e('0x1c');var _0x285290=_0x530e36[_0x756e('0x1e')];var _0x1a8614=_0x1f7161?0x0:_0x59956f[_0x756e('0x1b')];var _0x4da91f=_0x1f7161?_0x530e36[_0x756e('0x1e')]:_0x59956f['offset']+_0x59956f['limit'];var _0x157be3;if(_0x4da91f>=_0x285290){_0x4da91f=_0x285290;_0x157be3=0xc8;}else{_0x157be3=0xce;}_0xccccd4[_0x756e('0x18')](_0x157be3);return _0xccccd4[_0x756e('0x1f')](_0x756e('0x20'),_0x1a8614+'-'+_0x4da91f+'/'+_0x285290)[_0x756e('0x1a')](_0x530e36);}return null;};}function patchUpdates(_0x4e99a2){return function(_0xb00195){try{jsonpatch[_0x756e('0x21')](_0xb00195,_0x4e99a2,!![]);}catch(_0x88787d){return BPromise[_0x756e('0x22')](_0x88787d);}return _0xb00195[_0x756e('0x23')]();};}function saveUpdates(_0x83cdb5,_0x42173f){return function(_0x24d4ad){if(_0x24d4ad){return _0x24d4ad[_0x756e('0x24')](_0x83cdb5)[_0x756e('0x25')](function(_0x4b3230){return _0x4b3230;});}return null;};}function removeEntity(_0x335523,_0x4b38b4){return function(_0x256dc1){if(_0x256dc1){return _0x256dc1[_0x756e('0x26')]()[_0x756e('0x25')](function(){_0x335523[_0x756e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef5ef,_0x4cbd7){return function(_0x2f4db8){if(!_0x2f4db8){_0x3ef5ef['sendStatus'](0x194);}return _0x2f4db8;};}function handleError(_0x32815d,_0x44f8f9){_0x44f8f9=_0x44f8f9||0x1f4;return function(_0x29dffb){logger['error'](_0x29dffb[_0x756e('0x27')]);if(_0x29dffb[_0x756e('0x28')]){delete _0x29dffb['name'];}_0x32815d[_0x756e('0x18')](_0x44f8f9)[_0x756e('0x29')](_0x29dffb);};}exports[_0x756e('0x2a')]=function(_0x5a1cf0,_0x3c332e){var _0x308153={},_0x5c6949={},_0x20543c={'count':0x0,'rows':[]};var _0x2a7fdb=_['map'](db[_0x756e('0x2b')][_0x756e('0x2c')],function(_0x39acd7){return{'name':_0x39acd7[_0x756e('0x2d')],'type':_0x39acd7[_0x756e('0x2e')]['key']};});_0x5c6949[_0x756e('0x2f')]=_['map'](_0x2a7fdb,'name');_0x5c6949[_0x756e('0x30')]=_['keys'](_0x5a1cf0[_0x756e('0x30')]);_0x5c6949[_0x756e('0x31')]=_[_0x756e('0x32')](_0x5c6949[_0x756e('0x2f')],_0x5c6949[_0x756e('0x30')]);_0x308153[_0x756e('0x33')]=_[_0x756e('0x32')](_0x5c6949[_0x756e('0x2f')],qs[_0x756e('0x34')](_0x5a1cf0[_0x756e('0x30')][_0x756e('0x34')]));_0x308153[_0x756e('0x33')]=_0x308153['attributes']['length']?_0x308153[_0x756e('0x33')]:_0x5c6949[_0x756e('0x2f')];if(!_0x5a1cf0[_0x756e('0x30')][_0x756e('0x35')](_0x756e('0x36'))){_0x308153[_0x756e('0x1d')]=qs[_0x756e('0x1d')](_0x5a1cf0['query']['limit']);_0x308153['offset']=qs[_0x756e('0x1b')](_0x5a1cf0[_0x756e('0x30')][_0x756e('0x1b')]);}_0x308153['order']=qs[_0x756e('0x37')](_0x5a1cf0[_0x756e('0x30')]['sort']);_0x308153[_0x756e('0x38')]=qs[_0x756e('0x31')](_[_0x756e('0x39')](_0x5a1cf0[_0x756e('0x30')],_0x5c6949[_0x756e('0x31')]),_0x2a7fdb);if(_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3a')]){_0x308153[_0x756e('0x38')]=_['merge'](_0x308153[_0x756e('0x38')],{'$or':_[_0x756e('0x3b')](_0x2a7fdb,function(_0x20f979){if(_0x20f979[_0x756e('0x2e')]!==_0x756e('0x3c')){var _0x3a66fe={};_0x3a66fe[_0x20f979[_0x756e('0x28')]]={'$like':'%'+_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3a')]+'%'};return _0x3a66fe;}})});}_0x308153=_[_0x756e('0x3d')]({},_0x308153,_0x5a1cf0['options']);var _0x41a100={'where':_0x308153[_0x756e('0x38')]};return db['Cdr'][_0x756e('0x1e')](_0x41a100)[_0x756e('0x25')](function(_0x2b4fc3){_0x20543c['count']=_0x2b4fc3;if(_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3e')]){_0x308153[_0x756e('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0x756e('0x40')](_0x308153);})[_0x756e('0x25')](function(_0x5856f){_0x20543c[_0x756e('0x41')]=_0x5856f;return _0x20543c;})[_0x756e('0x25')](respondWithFilteredResult(_0x3c332e,_0x308153))[_0x756e('0x42')](handleError(_0x3c332e,null));};exports['show']=function(_0x9bedd3,_0x2b593d){var _0x5c471e={'raw':!![],'where':{'id':_0x9bedd3[_0x756e('0x43')]['id']}},_0xa031fb={};_0xa031fb[_0x756e('0x2f')]=_[_0x756e('0x44')](db[_0x756e('0x2b')][_0x756e('0x2c')]);_0xa031fb[_0x756e('0x30')]=_[_0x756e('0x44')](_0x9bedd3[_0x756e('0x30')]);_0xa031fb['filters']=_[_0x756e('0x32')](_0xa031fb['model'],_0xa031fb[_0x756e('0x30')]);_0x5c471e[_0x756e('0x33')]=_[_0x756e('0x32')](_0xa031fb['model'],qs[_0x756e('0x34')](_0x9bedd3[_0x756e('0x30')][_0x756e('0x34')]));_0x5c471e['attributes']=_0x5c471e['attributes'][_0x756e('0x45')]?_0x5c471e[_0x756e('0x33')]:_0xa031fb['model'];if(_0x9bedd3['query'][_0x756e('0x3e')]){_0x5c471e[_0x756e('0x3f')]=[{'all':!![]}];}_0x5c471e=_[_0x756e('0x3d')]({},_0x5c471e,_0x9bedd3['options']);return db[_0x756e('0x2b')]['find'](_0x5c471e)[_0x756e('0x25')](handleEntityNotFound(_0x2b593d,null))[_0x756e('0x25')](respondWithResult(_0x2b593d,null))[_0x756e('0x42')](handleError(_0x2b593d,null));};exports['create']=function(_0x31d076,_0x5224f2){return db['Cdr'][_0x756e('0x46')](_0x31d076['body'],{})[_0x756e('0x25')](respondWithResult(_0x5224f2,0xc9))[_0x756e('0x42')](handleError(_0x5224f2,null));};exports[_0x756e('0x24')]=function(_0x2512d3,_0x95061c){if(_0x2512d3[_0x756e('0x47')]['id']){delete _0x2512d3['body']['id'];}return db[_0x756e('0x2b')]['find']({'where':{'id':_0x2512d3[_0x756e('0x43')]['id']}})['then'](handleEntityNotFound(_0x95061c,null))[_0x756e('0x25')](saveUpdates(_0x2512d3['body'],null))[_0x756e('0x25')](respondWithResult(_0x95061c,null))['catch'](handleError(_0x95061c,null));};exports[_0x756e('0x26')]=function(_0x37ddd0,_0x27a201){return db['Cdr'][_0x756e('0x48')]({'where':{'id':_0x37ddd0[_0x756e('0x43')]['id']}})['then'](handleEntityNotFound(_0x27a201,null))['then'](removeEntity(_0x27a201,null))[_0x756e('0x42')](handleError(_0x27a201,null));};exports[_0x756e('0x49')]=function(_0x34a556,_0x2ef29e){return db[_0x756e('0x2b')][_0x756e('0x49')]()[_0x756e('0x25')](respondWithResult(_0x2ef29e,null))[_0x756e('0x42')](handleError(_0x2ef29e,null));}; \ No newline at end of file +var _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x5b711f,_0x3ec17c){var _0x52885f=function(_0x3db7b5){while(--_0x3db7b5){_0x5b711f['push'](_0x5b711f['shift']());}};_0x52885f(++_0x3ec17c);}(_0xdb94,0xe5));var _0x4db9=function(_0x119698,_0x2d4737){_0x119698=_0x119698-0x0;var _0x3a950e=_0xdb94[_0x119698];return _0x3a950e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 728d694..35c7a59 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x59d1ea,_0x37934a){var _0x4cd062=function(_0x2cf48c){while(--_0x2cf48c){_0x59d1ea['push'](_0x59d1ea['shift']());}};_0x4cd062(++_0x37934a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ce4cb,_0x1ee062){_0x4ce4cb=_0x4ce4cb-0x0;var _0x294206=_0x7a54[_0x4ce4cb];return _0x294206;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x454ac3,_0x51cb44){var _0x30d0f5=function(_0x105a9c){while(--_0x105a9c){_0x454ac3['push'](_0x454ac3['shift']());}};_0x30d0f5(++_0x51cb44);}(_0x7a54,0x106));var _0x47a5=function(_0x56d3e1,_0x58611b){_0x56d3e1=_0x56d3e1-0x0;var _0x3c26e3=_0x7a54[_0x56d3e1];return _0x3c26e3;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3f22fdd..e2db862 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 _0x32d8=['code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x17fa1d,_0x35f5c4){var _0x190fb5=function(_0x57bf0d){while(--_0x57bf0d){_0x17fa1d['push'](_0x17fa1d['shift']());}};_0x190fb5(++_0x35f5c4);}(_0x32d8,0x119));var _0x832d=function(_0x3e834d,_0x57ea65){_0x3e834d=_0x3e834d-0x0;var _0x1ce3cc=_0x32d8[_0x3e834d];return _0x1ce3cc;};'use strict';var _=require(_0x832d('0x0'));var util=require(_0x832d('0x1'));var moment=require(_0x832d('0x2'));var BPromise=require('bluebird');var rs=require(_0x832d('0x3'));var fs=require('fs');var Redis=require(_0x832d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x832d('0x5'));var logger=require(_0x832d('0x6'))(_0x832d('0x7'));var config=require(_0x832d('0x8'));var jayson=require(_0x832d('0x9'));var client=jayson[_0x832d('0xa')][_0x832d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ff1f6,_0x21f6c5,_0xa2c044){return new BPromise(function(_0x16f00e,_0x37d61e){return client[_0x832d('0xc')](_0x1ff1f6,_0xa2c044)['then'](function(_0x459feb){logger[_0x832d('0xd')]('Cdr,\x20%s,\x20%s',_0x21f6c5,'request\x20sent');logger[_0x832d('0xe')](_0x832d('0xf'),_0x21f6c5,'request\x20sent',JSON[_0x832d('0x10')](_0x459feb));if(_0x459feb[_0x832d('0x11')]){if(_0x459feb['error'][_0x832d('0x12')]===0x1f4){logger['error'](_0x832d('0x13'),_0x21f6c5,_0x459feb[_0x832d('0x11')][_0x832d('0x14')]);return _0x37d61e(_0x459feb['error']['message']);}logger[_0x832d('0x11')](_0x832d('0x13'),_0x21f6c5,_0x459feb[_0x832d('0x11')][_0x832d('0x14')]);return _0x16f00e(_0x459feb[_0x832d('0x11')][_0x832d('0x14')]);}else{logger[_0x832d('0xd')](_0x832d('0x13'),_0x21f6c5,'request\x20sent');_0x16f00e(_0x459feb[_0x832d('0x15')]['message']);}})[_0x832d('0x16')](function(_0x1f5c42){logger[_0x832d('0x11')](_0x832d('0x13'),_0x21f6c5,_0x1f5c42);_0x37d61e(_0x1f5c42);});});} \ No newline at end of file +var _0xe829=['request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Cdr,\x20%s,\x20%s'];(function(_0x1e42fb,_0x5845d2){var _0x5ba22f=function(_0x28ea28){while(--_0x28ea28){_0x1e42fb['push'](_0x1e42fb['shift']());}};_0x5ba22f(++_0x5845d2);}(_0xe829,0x152));var _0x9e82=function(_0x2d056d,_0x53f6c3){_0x2d056d=_0x2d056d-0x0;var _0x430fca=_0xe829[_0x2d056d];return _0x430fca;};'use strict';var _=require(_0x9e82('0x0'));var util=require('util');var moment=require(_0x9e82('0x1'));var BPromise=require(_0x9e82('0x2'));var rs=require(_0x9e82('0x3'));var fs=require('fs');var Redis=require(_0x9e82('0x4'));var db=require(_0x9e82('0x5'))['db'];var utils=require(_0x9e82('0x6'));var logger=require(_0x9e82('0x7'))(_0x9e82('0x8'));var config=require(_0x9e82('0x9'));var jayson=require(_0x9e82('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f05db,_0x8666c4,_0x59cf93){return new BPromise(function(_0x394cbd,_0x433a9a){return client[_0x9e82('0xb')](_0x1f05db,_0x59cf93)['then'](function(_0x444bdd){logger[_0x9e82('0xc')](_0x9e82('0xd'),_0x8666c4,_0x9e82('0xe'));logger['debug'](_0x9e82('0xf'),_0x8666c4,_0x9e82('0xe'),JSON[_0x9e82('0x10')](_0x444bdd));if(_0x444bdd[_0x9e82('0x11')]){if(_0x444bdd['error'][_0x9e82('0x12')]===0x1f4){logger[_0x9e82('0x11')]('Cdr,\x20%s,\x20%s',_0x8666c4,_0x444bdd[_0x9e82('0x11')][_0x9e82('0x13')]);return _0x433a9a(_0x444bdd[_0x9e82('0x11')][_0x9e82('0x13')]);}logger[_0x9e82('0x11')](_0x9e82('0xd'),_0x8666c4,_0x444bdd['error'][_0x9e82('0x13')]);return _0x394cbd(_0x444bdd[_0x9e82('0x11')][_0x9e82('0x13')]);}else{logger[_0x9e82('0xc')]('Cdr,\x20%s,\x20%s',_0x8666c4,'request\x20sent');_0x394cbd(_0x444bdd[_0x9e82('0x14')][_0x9e82('0x13')]);}})[_0x9e82('0x15')](function(_0x445a24){logger[_0x9e82('0x11')](_0x9e82('0xd'),_0x8666c4,_0x445a24);_0x433a9a(_0x445a24);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ab2f27d..1dcfbb4 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x292911,_0x279a2e){var _0x18dee9=function(_0x43ccf8){while(--_0x43ccf8){_0x292911['push'](_0x292911['shift']());}};_0x18dee9(++_0x279a2e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 4b3d254..953790d 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 _0xb4de=['INTEGER','STRING','noop','sequelize'];(function(_0x455f7b,_0x5ad6ab){var _0x41fbf2=function(_0x2c1c27){while(--_0x2c1c27){_0x455f7b['push'](_0x455f7b['shift']());}};_0x41fbf2(++_0x5ad6ab);}(_0xb4de,0xd7));var _0xeb4d=function(_0x11a6aa,_0x3d170d){_0x11a6aa=_0x11a6aa-0x0;var _0x37a746=_0xb4de[_0x11a6aa];return _0x37a746;};'use strict';var Sequelize=require(_0xeb4d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xeb4d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xeb4d('0x2')],'allowNull':![],'defaultValue':_0xeb4d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xeb4d('0x2')]},'interval':{'type':Sequelize[_0xeb4d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1323=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x1323,0xef));var _0x3132=function(_0x4cb785,_0x3f90de){_0x4cb785=_0x4cb785-0x0;var _0x543653=_0x1323[_0x4cb785];return _0x543653;};'use strict';var Sequelize=require(_0x3132('0x0'));module[_0x3132('0x1')]={'priority':{'type':Sequelize[_0x3132('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3132('0x3')],'allowNull':![],'defaultValue':_0x3132('0x4')},'appdata':{'type':Sequelize[_0x3132('0x5')]()},'description':{'type':Sequelize[_0x3132('0x3')]},'interval':{'type':Sequelize[_0x3132('0x3')],'defaultValue':_0x3132('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5e207b4..939b39e 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 _0x2f8b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','then','end','stack','name','send','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5ee89d,_0x1a7c29){var _0x3fa4cc=function(_0x397114){while(--_0x397114){_0x5ee89d['push'](_0x5ee89d['shift']());}};_0x3fa4cc(++_0x1a7c29);}(_0x2f8b,0x96));var _0xb2f8=function(_0x5f2593,_0x416c03){_0x5f2593=_0x5f2593-0x0;var _0x4ed8c9=_0x2f8b[_0x5f2593];return _0x4ed8c9;};'use strict';var emlformat=require(_0xb2f8('0x0'));var rimraf=require(_0xb2f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2f8('0x2'));var rp=require(_0xb2f8('0x3'));var moment=require(_0xb2f8('0x4'));var BPromise=require(_0xb2f8('0x5'));var Mustache=require(_0xb2f8('0x6'));var util=require(_0xb2f8('0x7'));var path=require(_0xb2f8('0x8'));var sox=require('sox');var csv=require(_0xb2f8('0x9'));var ejs=require(_0xb2f8('0xa'));var fs=require('fs');var fs_extra=require(_0xb2f8('0xb'));var _=require('lodash');var squel=require(_0xb2f8('0xc'));var crypto=require('crypto');var jsforce=require(_0xb2f8('0xd'));var deskjs=require(_0xb2f8('0xe'));var toCsv=require(_0xb2f8('0x9'));var querystring=require(_0xb2f8('0xf'));var Papa=require(_0xb2f8('0x10'));var Redis=require(_0xb2f8('0x11'));var authService=require(_0xb2f8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2f8('0x13'));var hardwareService=require(_0xb2f8('0x14'));var logger=require(_0xb2f8('0x15'))(_0xb2f8('0x16'));var utils=require(_0xb2f8('0x17'));var config=require(_0xb2f8('0x18'));var licenseUtil=require(_0xb2f8('0x19'));var db=require(_0xb2f8('0x1a'))['db'];function respondWithStatusCode(_0x3aeb83,_0x2f896a){_0x2f896a=_0x2f896a||0xcc;return function(_0x1dae14){if(_0x1dae14){return _0x3aeb83[_0xb2f8('0x1b')](_0x2f896a);}return _0x3aeb83[_0xb2f8('0x1c')](_0x2f896a)['end']();};}function respondWithResult(_0x56b9b7,_0x4100d2){_0x4100d2=_0x4100d2||0xc8;return function(_0x1389a3){if(_0x1389a3){return _0x56b9b7['status'](_0x4100d2)[_0xb2f8('0x1d')](_0x1389a3);}};}function respondWithFilteredResult(_0x6d73fd,_0x3c30a6){return function(_0x2097e7){if(_0x2097e7){var _0x57d3c8=typeof _0x3c30a6['offset']===_0xb2f8('0x1e')&&typeof _0x3c30a6[_0xb2f8('0x1f')]==='undefined';var _0x90ee1f=_0x2097e7[_0xb2f8('0x20')];var _0x56b307=_0x57d3c8?0x0:_0x3c30a6[_0xb2f8('0x21')];var _0x4dae59=_0x57d3c8?_0x2097e7[_0xb2f8('0x20')]:_0x3c30a6[_0xb2f8('0x21')]+_0x3c30a6[_0xb2f8('0x1f')];var _0x3f54c4;if(_0x4dae59>=_0x90ee1f){_0x4dae59=_0x90ee1f;_0x3f54c4=0xc8;}else{_0x3f54c4=0xce;}_0x6d73fd[_0xb2f8('0x1c')](_0x3f54c4);return _0x6d73fd[_0xb2f8('0x22')](_0xb2f8('0x23'),_0x56b307+'-'+_0x4dae59+'/'+_0x90ee1f)[_0xb2f8('0x1d')](_0x2097e7);}return null;};}function patchUpdates(_0x3f1efa){return function(_0x1a27c5){try{jsonpatch['apply'](_0x1a27c5,_0x3f1efa,!![]);}catch(_0x4501eb){return BPromise['reject'](_0x4501eb);}return _0x1a27c5[_0xb2f8('0x24')]();};}function saveUpdates(_0x2b190c,_0x46c11a){return function(_0x22fe8b){if(_0x22fe8b){return _0x22fe8b['update'](_0x2b190c)[_0xb2f8('0x25')](function(_0x32dc7d){return _0x32dc7d;});}return null;};}function removeEntity(_0x43f6ed,_0x5a8466){return function(_0x12d551){if(_0x12d551){return _0x12d551['destroy']()['then'](function(){_0x43f6ed[_0xb2f8('0x1c')](0xcc)[_0xb2f8('0x26')]();});}};}function handleEntityNotFound(_0x4c2dcc,_0x78fa37){return function(_0x3643e4){if(!_0x3643e4){_0x4c2dcc[_0xb2f8('0x1b')](0x194);}return _0x3643e4;};}function handleError(_0x1bdb48,_0x451d71){_0x451d71=_0x451d71||0x1f4;return function(_0x3b92d7){logger['error'](_0x3b92d7[_0xb2f8('0x27')]);if(_0x3b92d7[_0xb2f8('0x28')]){delete _0x3b92d7[_0xb2f8('0x28')];}_0x1bdb48[_0xb2f8('0x1c')](_0x451d71)[_0xb2f8('0x29')](_0x3b92d7);};}exports['show']=function(_0x2a2dcf,_0x190115){var _0x4c6662={'raw':!![],'where':{'id':_0x2a2dcf[_0xb2f8('0x2a')]['id']}},_0x362b40={};_0x362b40[_0xb2f8('0x2b')]=_[_0xb2f8('0x2c')](db['ChatApplication'][_0xb2f8('0x2d')]);_0x362b40[_0xb2f8('0x2e')]=_[_0xb2f8('0x2c')](_0x2a2dcf['query']);_0x362b40[_0xb2f8('0x2f')]=_['intersection'](_0x362b40[_0xb2f8('0x2b')],_0x362b40[_0xb2f8('0x2e')]);_0x4c6662[_0xb2f8('0x30')]=_[_0xb2f8('0x31')](_0x362b40[_0xb2f8('0x2b')],qs[_0xb2f8('0x32')](_0x2a2dcf[_0xb2f8('0x2e')][_0xb2f8('0x32')]));_0x4c6662[_0xb2f8('0x30')]=_0x4c6662[_0xb2f8('0x30')]['length']?_0x4c6662[_0xb2f8('0x30')]:_0x362b40[_0xb2f8('0x2b')];if(_0x2a2dcf[_0xb2f8('0x2e')][_0xb2f8('0x33')]){_0x4c6662['include']=[{'all':!![]}];}_0x4c6662=_[_0xb2f8('0x34')]({},_0x4c6662,_0x2a2dcf[_0xb2f8('0x35')]);return db[_0xb2f8('0x36')][_0xb2f8('0x37')](_0x4c6662)[_0xb2f8('0x25')](handleEntityNotFound(_0x190115,null))['then'](respondWithResult(_0x190115,null))[_0xb2f8('0x38')](handleError(_0x190115,null));};exports['update']=function(_0x5d952f,_0xb2f0bb){if(_0x5d952f[_0xb2f8('0x39')]['id']){delete _0x5d952f[_0xb2f8('0x39')]['id'];}return db[_0xb2f8('0x36')][_0xb2f8('0x37')]({'where':{'id':_0x5d952f[_0xb2f8('0x2a')]['id']}})['then'](handleEntityNotFound(_0xb2f0bb,null))[_0xb2f8('0x25')](saveUpdates(_0x5d952f[_0xb2f8('0x39')],null))[_0xb2f8('0x25')](respondWithResult(_0xb2f0bb,null))['catch'](handleError(_0xb2f0bb,null));};exports['destroy']=function(_0x4d0b98,_0x16f724){return db[_0xb2f8('0x36')][_0xb2f8('0x37')]({'where':{'id':_0x4d0b98['params']['id']}})[_0xb2f8('0x25')](handleEntityNotFound(_0x16f724,null))[_0xb2f8('0x25')](removeEntity(_0x16f724,null))[_0xb2f8('0x38')](handleError(_0x16f724,null));}; \ No newline at end of file +var _0x0fd9=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','catch','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xa9d47e,_0x389a24){var _0x4fba5d=function(_0x3e7483){while(--_0x3e7483){_0xa9d47e['push'](_0xa9d47e['shift']());}};_0x4fba5d(++_0x389a24);}(_0x0fd9,0xa3));var _0x90fd=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x0fd9[_0xda464c];return _0x19e222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={'raw':!![],'where':{'id':_0x170cfb['params']['id']}},_0x397aaf={};_0x397aaf['model']=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x397aaf[_0x90fd('0x2d')]=_['keys'](_0x170cfb['query']);_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](_0x397aaf[_0x90fd('0x30')],_0x397aaf[_0x90fd('0x2d')]);_0x404971['attributes']=_[_0x90fd('0x2f')](_0x397aaf[_0x90fd('0x30')],qs[_0x90fd('0x31')](_0x170cfb[_0x90fd('0x2d')][_0x90fd('0x31')]));_0x404971[_0x90fd('0x32')]=_0x404971[_0x90fd('0x32')][_0x90fd('0x33')]?_0x404971[_0x90fd('0x32')]:_0x397aaf[_0x90fd('0x30')];if(_0x170cfb[_0x90fd('0x2d')][_0x90fd('0x34')]){_0x404971[_0x90fd('0x35')]=[{'all':!![]}];}_0x404971=_[_0x90fd('0x36')]({},_0x404971,_0x170cfb[_0x90fd('0x37')]);return db[_0x90fd('0x2b')]['find'](_0x404971)[_0x90fd('0x25')](handleEntityNotFound(_0x2924e9,null))[_0x90fd('0x25')](respondWithResult(_0x2924e9,null))[_0x90fd('0x38')](handleError(_0x2924e9,null));};exports[_0x90fd('0x24')]=function(_0x14075f,_0x1a7518){if(_0x14075f[_0x90fd('0x39')]['id']){delete _0x14075f[_0x90fd('0x39')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x3a')]({'where':{'id':_0x14075f[_0x90fd('0x3b')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x1a7518,null))[_0x90fd('0x25')](saveUpdates(_0x14075f['body'],null))[_0x90fd('0x25')](respondWithResult(_0x1a7518,null))[_0x90fd('0x38')](handleError(_0x1a7518,null));};exports[_0x90fd('0x3c')]=function(_0x35a4a9,_0x53cac2){return db[_0x90fd('0x2b')][_0x90fd('0x3a')]({'where':{'id':_0x35a4a9[_0x90fd('0x3b')]['id']}})['then'](handleEntityNotFound(_0x53cac2,null))['then'](removeEntity(_0x53cac2,null))[_0x90fd('0x38')](handleError(_0x53cac2,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index dd85500..7ae1e84 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 _0xbb8f=['ChatApplication','chat_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb8f,0x99));var _0xfbb8=function(_0x38f66e,_0x46c879){_0x38f66e=_0x38f66e-0x0;var _0xa6e693=_0xbb8f[_0x38f66e];return _0xa6e693;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var logger=require(_0xfbb8('0x1'))(_0xfbb8('0x2'));var moment=require(_0xfbb8('0x3'));var BPromise=require(_0xfbb8('0x4'));var rp=require(_0xfbb8('0x5'));var fs=require('fs');var path=require(_0xfbb8('0x6'));var rimraf=require(_0xfbb8('0x7'));var config=require(_0xfbb8('0x8'));var attributes=require(_0xfbb8('0x9'));module[_0xfbb8('0xa')]=function(_0x3722cc,_0x11ccce){return _0x3722cc[_0xfbb8('0xb')](_0xfbb8('0xc'),attributes,{'tableName':_0xfbb8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfbb8('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xba33=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x2b943c,_0xa1ae10){var _0x2e548c=function(_0x583288){while(--_0x583288){_0x2b943c['push'](_0x2b943c['shift']());}};_0x2e548c(++_0xa1ae10);}(_0xba33,0xf1));var _0x3ba3=function(_0x427848,_0x56fc4f){_0x427848=_0x427848-0x0;var _0x5dbbb6=_0xba33[_0x427848];return _0x5dbbb6;};'use strict';var _=require(_0x3ba3('0x0'));var util=require(_0x3ba3('0x1'));var logger=require(_0x3ba3('0x2'))(_0x3ba3('0x3'));var moment=require('moment');var BPromise=require(_0x3ba3('0x4'));var rp=require(_0x3ba3('0x5'));var fs=require('fs');var path=require(_0x3ba3('0x6'));var rimraf=require(_0x3ba3('0x7'));var config=require(_0x3ba3('0x8'));var attributes=require(_0x3ba3('0x9'));module[_0x3ba3('0xa')]=function(_0xd24f52,_0xe9e300){return _0xd24f52[_0x3ba3('0xb')](_0x3ba3('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ba3('0xd'),'collate':_0x3ba3('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b0bfb48..29b1134 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 _0xd885=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','moment'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xd885,0x18e));var _0x5d88=function(_0xb29435,_0x8c32f5){_0xb29435=_0xb29435-0x0;var _0x57726e=_0xd885[_0xb29435];return _0x57726e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d88('0x0'));var BPromise=require(_0x5d88('0x1'));var rs=require(_0x5d88('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d88('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d88('0x4'));var config=require(_0x5d88('0x5'));var jayson=require(_0x5d88('0x6'));var client=jayson['client'][_0x5d88('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc69f6a,_0x5ef972,_0x2d4360){return new BPromise(function(_0x2226df,_0x1586bd){return client[_0x5d88('0x8')](_0xc69f6a,_0x2d4360)[_0x5d88('0x9')](function(_0x392ee8){logger['info']('ChatApplication,\x20%s,\x20%s',_0x5ef972,_0x5d88('0xa'));logger['debug'](_0x5d88('0xb'),_0x5ef972,_0x5d88('0xa'),JSON[_0x5d88('0xc')](_0x392ee8));if(_0x392ee8[_0x5d88('0xd')]){if(_0x392ee8[_0x5d88('0xd')][_0x5d88('0xe')]===0x1f4){logger[_0x5d88('0xd')](_0x5d88('0xf'),_0x5ef972,_0x392ee8['error'][_0x5d88('0x10')]);return _0x1586bd(_0x392ee8[_0x5d88('0xd')][_0x5d88('0x10')]);}logger[_0x5d88('0xd')](_0x5d88('0xf'),_0x5ef972,_0x392ee8['error']['message']);return _0x2226df(_0x392ee8[_0x5d88('0xd')]['message']);}else{logger[_0x5d88('0x11')](_0x5d88('0xf'),_0x5ef972,_0x5d88('0xa'));_0x2226df(_0x392ee8[_0x5d88('0x12')][_0x5d88('0x10')]);}})['catch'](function(_0x17b098){logger[_0x5d88('0xd')](_0x5d88('0xf'),_0x5ef972,_0x17b098);_0x1586bd(_0x17b098);});});} \ No newline at end of file +var _0x7098=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x7098,0x1e3));var _0x8709=function(_0xb987e,_0x1f1f1b){_0xb987e=_0xb987e-0x0;var _0x444ce3=_0x7098[_0xb987e];return _0x444ce3;};'use strict';var _=require(_0x8709('0x0'));var util=require('util');var moment=require(_0x8709('0x1'));var BPromise=require('bluebird');var rs=require(_0x8709('0x2'));var fs=require('fs');var Redis=require(_0x8709('0x3'));var db=require(_0x8709('0x4'))['db'];var utils=require(_0x8709('0x5'));var logger=require(_0x8709('0x6'))('rpc');var config=require(_0x8709('0x7'));var jayson=require(_0x8709('0x8'));var client=jayson[_0x8709('0x9')][_0x8709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1308,_0x295aa5,_0x2dceee){return new BPromise(function(_0x4adb70,_0x50168f){return client['request'](_0x5c1308,_0x2dceee)[_0x8709('0xb')](function(_0x346ffe){logger['info'](_0x8709('0xc'),_0x295aa5,_0x8709('0xd'));logger['debug'](_0x8709('0xe'),_0x295aa5,_0x8709('0xd'),JSON[_0x8709('0xf')](_0x346ffe));if(_0x346ffe[_0x8709('0x10')]){if(_0x346ffe[_0x8709('0x10')][_0x8709('0x11')]===0x1f4){logger['error'](_0x8709('0xc'),_0x295aa5,_0x346ffe[_0x8709('0x10')]['message']);return _0x50168f(_0x346ffe['error'][_0x8709('0x12')]);}logger['error'](_0x8709('0xc'),_0x295aa5,_0x346ffe[_0x8709('0x10')][_0x8709('0x12')]);return _0x4adb70(_0x346ffe[_0x8709('0x10')][_0x8709('0x12')]);}else{logger[_0x8709('0x13')](_0x8709('0xc'),_0x295aa5,_0x8709('0xd'));_0x4adb70(_0x346ffe[_0x8709('0x14')]['message']);}})[_0x8709('0x15')](function(_0x432748){logger[_0x8709('0x10')](_0x8709('0xc'),_0x295aa5,_0x432748);_0x50168f(_0x432748);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index a578a32..6e7144f 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 _0x620b=['put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x14802a,_0x3e1dba){var _0x2dcf09=function(_0x32777c){while(--_0x32777c){_0x14802a['push'](_0x14802a['shift']());}};_0x2dcf09(++_0x3e1dba);}(_0x620b,0x16b));var _0xb620=function(_0x131be8,_0x49edae){_0x131be8=_0x131be8-0x0;var _0x38b32d=_0x620b[_0x131be8];return _0x38b32d;};'use strict';var multer=require(_0xb620('0x0'));var util=require(_0xb620('0x1'));var path=require(_0xb620('0x2'));var timeout=require('connect-timeout');var express=require(_0xb620('0x3'));var router=express[_0xb620('0x4')]();var fs_extra=require(_0xb620('0x5'));var auth=require(_0xb620('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb620('0x7'));var controller=require(_0xb620('0x8'));router[_0xb620('0x9')](_0xb620('0xa'),auth[_0xb620('0xb')](),controller['show']);router[_0xb620('0xc')](_0xb620('0xa'),auth[_0xb620('0xb')](),controller['update']);router['delete'](_0xb620('0xa'),auth[_0xb620('0xb')](),controller[_0xb620('0xd')]);module[_0xb620('0xe')]=router; \ No newline at end of file +var _0x3187=['put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show'];(function(_0x1bf7f3,_0x4d1ef4){var _0x36985c=function(_0x1576c1){while(--_0x1576c1){_0x1bf7f3['push'](_0x1bf7f3['shift']());}};_0x36985c(++_0x4d1ef4);}(_0x3187,0x1ad));var _0x7318=function(_0x2e2a22,_0x2d5a61){_0x2e2a22=_0x2e2a22-0x0;var _0x19ae5e=_0x3187[_0x2e2a22];return _0x19ae5e;};'use strict';var multer=require(_0x7318('0x0'));var util=require(_0x7318('0x1'));var path=require('path');var timeout=require(_0x7318('0x2'));var express=require(_0x7318('0x3'));var router=express[_0x7318('0x4')]();var fs_extra=require(_0x7318('0x5'));var auth=require(_0x7318('0x6'));var interaction=require(_0x7318('0x7'));var config=require(_0x7318('0x8'));var controller=require(_0x7318('0x9'));router[_0x7318('0xa')]('/:id',auth[_0x7318('0xb')](),controller[_0x7318('0xc')]);router[_0x7318('0xd')](_0x7318('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x7318('0xf')](_0x7318('0xe'),auth[_0x7318('0xb')](),controller[_0x7318('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 4bebe30..adef5ac 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 _0x7b84=['exports','STRING','sequelize'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0x7b84,0x167));var _0x47b8=function(_0x1c81ca,_0x145a7f){_0x1c81ca=_0x1c81ca-0x0;var _0x3e33b0=_0x7b84[_0x1c81ca];return _0x3e33b0;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9c57=['BOOLEAN','sequelize','exports','STRING'];(function(_0x7bb09b,_0x201d72){var _0x57db1d=function(_0x44ef8f){while(--_0x44ef8f){_0x7bb09b['push'](_0x7bb09b['shift']());}};_0x57db1d(++_0x201d72);}(_0x9c57,0x99));var _0x79c5=function(_0x37add,_0x181552){_0x37add=_0x37add-0x0;var _0x582301=_0x9c57[_0x37add];return _0x582301;};'use strict';var Sequelize=require(_0x79c5('0x0'));module[_0x79c5('0x1')]={'name':{'type':Sequelize[_0x79c5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x79c5('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 732fb40..67a3083 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 _0x97ea=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','VIRTUAL','merge','where','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json'];(function(_0x6d6686,_0x19d52e){var _0x4dd103=function(_0x31f093){while(--_0x31f093){_0x6d6686['push'](_0x6d6686['shift']());}};_0x4dd103(++_0x19d52e);}(_0x97ea,0xa1));var _0xa97e=function(_0x5835b2,_0xdf29e3){_0x5835b2=_0x5835b2-0x0;var _0x1617dd=_0x97ea[_0x5835b2];return _0x1617dd;};'use strict';var emlformat=require(_0xa97e('0x0'));var rimraf=require(_0xa97e('0x1'));var zipdir=require(_0xa97e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa97e('0x3'));var BPromise=require(_0xa97e('0x4'));var Mustache=require('mustache');var util=require(_0xa97e('0x5'));var path=require('path');var sox=require(_0xa97e('0x6'));var csv=require('to-csv');var ejs=require(_0xa97e('0x7'));var fs=require('fs');var fs_extra=require(_0xa97e('0x8'));var _=require('lodash');var squel=require(_0xa97e('0x9'));var crypto=require(_0xa97e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa97e('0xb'));var toCsv=require(_0xa97e('0xc'));var querystring=require('querystring');var Papa=require(_0xa97e('0xd'));var Redis=require(_0xa97e('0xe'));var authService=require(_0xa97e('0xf'));var qs=require(_0xa97e('0x10'));var as=require(_0xa97e('0x11'));var hardwareService=require(_0xa97e('0x12'));var logger=require(_0xa97e('0x13'))(_0xa97e('0x14'));var utils=require('../../config/utils');var config=require(_0xa97e('0x15'));var licenseUtil=require(_0xa97e('0x16'));var db=require(_0xa97e('0x17'))['db'];config[_0xa97e('0x18')]=_[_0xa97e('0x19')](config[_0xa97e('0x18')],{'host':_0xa97e('0x1a'),'port':0x18eb});var socket=require(_0xa97e('0x1b'))(new Redis(config[_0xa97e('0x18')]));require(_0xa97e('0x1c'))['register'](socket);function respondWithStatusCode(_0x38e97d,_0x262bdb){_0x262bdb=_0x262bdb||0xcc;return function(_0x3f882e){if(_0x3f882e){return _0x38e97d[_0xa97e('0x1d')](_0x262bdb);}return _0x38e97d[_0xa97e('0x1e')](_0x262bdb)[_0xa97e('0x1f')]();};}function respondWithResult(_0x22a3f5,_0x515e3f){_0x515e3f=_0x515e3f||0xc8;return function(_0x2cf332){if(_0x2cf332){return _0x22a3f5[_0xa97e('0x1e')](_0x515e3f)[_0xa97e('0x20')](_0x2cf332);}};}function respondWithFilteredResult(_0x74bbc5,_0xdfc6da){return function(_0x2a39a5){if(_0x2a39a5){var _0x48fc35=typeof _0xdfc6da[_0xa97e('0x21')]===_0xa97e('0x22')&&typeof _0xdfc6da[_0xa97e('0x23')]==='undefined';var _0x17bb76=_0x2a39a5[_0xa97e('0x24')];var _0x495829=_0x48fc35?0x0:_0xdfc6da[_0xa97e('0x21')];var _0x4a26c9=_0x48fc35?_0x2a39a5[_0xa97e('0x24')]:_0xdfc6da['offset']+_0xdfc6da[_0xa97e('0x23')];var _0x245157;if(_0x4a26c9>=_0x17bb76){_0x4a26c9=_0x17bb76;_0x245157=0xc8;}else{_0x245157=0xce;}_0x74bbc5[_0xa97e('0x1e')](_0x245157);return _0x74bbc5[_0xa97e('0x25')](_0xa97e('0x26'),_0x495829+'-'+_0x4a26c9+'/'+_0x17bb76)[_0xa97e('0x20')](_0x2a39a5);}return null;};}function patchUpdates(_0x1d5dfb){return function(_0x41774b){try{jsonpatch[_0xa97e('0x27')](_0x41774b,_0x1d5dfb,!![]);}catch(_0x1ed185){return BPromise[_0xa97e('0x28')](_0x1ed185);}return _0x41774b[_0xa97e('0x29')]();};}function saveUpdates(_0x26599d,_0x38e95d){return function(_0x5703fc){if(_0x5703fc){return _0x5703fc['update'](_0x26599d)[_0xa97e('0x2a')](function(_0xd15f58){return _0xd15f58;});}return null;};}function removeEntity(_0x5d174d,_0x46d1e5){return function(_0x5e7cd6){if(_0x5e7cd6){return _0x5e7cd6[_0xa97e('0x2b')]()['then'](function(){_0x5d174d[_0xa97e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1653c6,_0x13061e){return function(_0x3c3c94){if(!_0x3c3c94){_0x1653c6[_0xa97e('0x1d')](0x194);}return _0x3c3c94;};}function handleError(_0x12834c,_0x4d8659){_0x4d8659=_0x4d8659||0x1f4;return function(_0x388599){logger['error'](_0x388599['stack']);if(_0x388599[_0xa97e('0x2c')]){delete _0x388599[_0xa97e('0x2c')];}_0x12834c[_0xa97e('0x1e')](_0x4d8659)[_0xa97e('0x2d')](_0x388599);};}exports[_0xa97e('0x2e')]=function(_0x1af6d4,_0x473b99){var _0x185336={},_0x5edb19={},_0x297768={'count':0x0,'rows':[]};var _0x260ce1=_[_0xa97e('0x2f')](db[_0xa97e('0x30')][_0xa97e('0x31')],function(_0x1189bf){return{'name':_0x1189bf[_0xa97e('0x32')],'type':_0x1189bf[_0xa97e('0x33')][_0xa97e('0x34')]};});_0x5edb19[_0xa97e('0x35')]=_[_0xa97e('0x2f')](_0x260ce1,_0xa97e('0x2c'));_0x5edb19[_0xa97e('0x36')]=_[_0xa97e('0x37')](_0x1af6d4[_0xa97e('0x36')]);_0x5edb19['filters']=_[_0xa97e('0x38')](_0x5edb19[_0xa97e('0x35')],_0x5edb19[_0xa97e('0x36')]);_0x185336[_0xa97e('0x39')]=_['intersection'](_0x5edb19[_0xa97e('0x35')],qs[_0xa97e('0x3a')](_0x1af6d4[_0xa97e('0x36')][_0xa97e('0x3a')]));_0x185336['attributes']=_0x185336[_0xa97e('0x39')][_0xa97e('0x3b')]?_0x185336[_0xa97e('0x39')]:_0x5edb19[_0xa97e('0x35')];if(!_0x1af6d4['query']['hasOwnProperty'](_0xa97e('0x3c'))){_0x185336[_0xa97e('0x23')]=qs[_0xa97e('0x23')](_0x1af6d4['query'][_0xa97e('0x23')]);_0x185336['offset']=qs[_0xa97e('0x21')](_0x1af6d4['query'][_0xa97e('0x21')]);}_0x185336[_0xa97e('0x3d')]=qs[_0xa97e('0x3e')](_0x1af6d4['query'][_0xa97e('0x3e')]);_0x185336['where']=qs['filters'](_[_0xa97e('0x3f')](_0x1af6d4['query'],_0x5edb19[_0xa97e('0x40')]),_0x260ce1);if(_0x1af6d4[_0xa97e('0x36')][_0xa97e('0x41')]){_0x185336['where']=_['merge'](_0x185336['where'],{'$or':_[_0xa97e('0x2f')](_0x260ce1,function(_0xc95807){if(_0xc95807[_0xa97e('0x33')]!==_0xa97e('0x42')){var _0x539f91={};_0x539f91[_0xc95807[_0xa97e('0x2c')]]={'$like':'%'+_0x1af6d4[_0xa97e('0x36')][_0xa97e('0x41')]+'%'};return _0x539f91;}})});}_0x185336=_[_0xa97e('0x43')]({},_0x185336,_0x1af6d4['options']);var _0x1af884={'where':_0x185336[_0xa97e('0x44')]};return db['ChatGroup'][_0xa97e('0x24')](_0x1af884)[_0xa97e('0x2a')](function(_0x50b872){_0x297768['count']=_0x50b872;if(_0x1af6d4['query']['includeAll']){_0x185336[_0xa97e('0x45')]=[{'all':!![]}];}return db[_0xa97e('0x30')][_0xa97e('0x46')](_0x185336);})[_0xa97e('0x2a')](function(_0x38783b){_0x297768[_0xa97e('0x47')]=_0x38783b;return _0x297768;})[_0xa97e('0x2a')](respondWithFilteredResult(_0x473b99,_0x185336))[_0xa97e('0x48')](handleError(_0x473b99,null));};exports[_0xa97e('0x49')]=function(_0x43837a,_0x2f1999){var _0x108a58={'raw':!![],'where':{'id':_0x43837a[_0xa97e('0x4a')]['id']}},_0x359ff8={};_0x359ff8[_0xa97e('0x35')]=_[_0xa97e('0x37')](db['ChatGroup']['rawAttributes']);_0x359ff8[_0xa97e('0x36')]=_[_0xa97e('0x37')](_0x43837a[_0xa97e('0x36')]);_0x359ff8['filters']=_[_0xa97e('0x38')](_0x359ff8[_0xa97e('0x35')],_0x359ff8['query']);_0x108a58[_0xa97e('0x39')]=_[_0xa97e('0x38')](_0x359ff8['model'],qs['fields'](_0x43837a[_0xa97e('0x36')][_0xa97e('0x3a')]));_0x108a58[_0xa97e('0x39')]=_0x108a58[_0xa97e('0x39')][_0xa97e('0x3b')]?_0x108a58[_0xa97e('0x39')]:_0x359ff8[_0xa97e('0x35')];if(_0x43837a['query'][_0xa97e('0x4b')]){_0x108a58[_0xa97e('0x45')]=[{'all':!![]}];}_0x108a58=_[_0xa97e('0x43')]({},_0x108a58,_0x43837a[_0xa97e('0x4c')]);return db[_0xa97e('0x30')][_0xa97e('0x4d')](_0x108a58)[_0xa97e('0x2a')](handleEntityNotFound(_0x2f1999,null))[_0xa97e('0x2a')](respondWithResult(_0x2f1999,null))['catch'](handleError(_0x2f1999,null));};exports['create']=function(_0x1b77ac,_0x32d1e8){return db[_0xa97e('0x30')][_0xa97e('0x4e')](_0x1b77ac[_0xa97e('0x4f')],{})[_0xa97e('0x2a')](respondWithResult(_0x32d1e8,0xc9))[_0xa97e('0x48')](handleError(_0x32d1e8,null));};exports['update']=function(_0x13fa6b,_0x3158b8){if(_0x13fa6b['body']['id']){delete _0x13fa6b[_0xa97e('0x4f')]['id'];}return db[_0xa97e('0x30')][_0xa97e('0x4d')]({'where':{'id':_0x13fa6b[_0xa97e('0x4a')]['id']}})[_0xa97e('0x2a')](handleEntityNotFound(_0x3158b8,null))[_0xa97e('0x2a')](saveUpdates(_0x13fa6b['body'],null))['then'](respondWithResult(_0x3158b8,null))[_0xa97e('0x48')](handleError(_0x3158b8,null));};exports[_0xa97e('0x2b')]=function(_0x1a5f5a,_0x3f8103){return db[_0xa97e('0x30')][_0xa97e('0x4d')]({'where':{'id':_0x1a5f5a['params']['id']}})[_0xa97e('0x2a')](handleEntityNotFound(_0x3f8103,null))[_0xa97e('0x2a')](removeEntity(_0x3f8103,null))[_0xa97e('0x48')](handleError(_0x3f8103,null));};exports[_0xa97e('0x50')]=function(_0x52a2ff,_0x3980ae){return db[_0xa97e('0x30')][_0xa97e('0x50')]()[_0xa97e('0x2a')](respondWithResult(_0x3980ae,null))[_0xa97e('0x48')](handleError(_0x3980ae,null));};exports['getUnread']=function(_0x3a778e,_0x24c9ef,_0x53bf88){return db['ChatInternalMessage'][_0xa97e('0x24')]({'where':{'ChatGroupId':_0x3a778e['params']['id'],'ToId':_0x3a778e[_0xa97e('0x51')]['id'],'read':![]}})[_0xa97e('0x2a')](function(_0x4d66e2){return{'id':_[_0xa97e('0x52')](_0x3a778e[_0xa97e('0x4a')]['id']),'count':_0x4d66e2};})['then'](respondWithResult(_0x24c9ef,null))[_0xa97e('0x48')](handleError(_0x24c9ef,null));};exports[_0xa97e('0x53')]=function(_0x4973e0,_0x55303f,_0x4b4dcd){return db[_0xa97e('0x30')][_0xa97e('0x4d')]({'where':{'id':_0x4973e0[_0xa97e('0x4a')]['id']}})[_0xa97e('0x2a')](handleEntityNotFound(_0x55303f,null))['then'](function(_0x2bacb7){if(_0x2bacb7){return _0x2bacb7[_0xa97e('0x53')](_0x4973e0['body'][_0xa97e('0x54')],_[_0xa97e('0x55')](_0x4973e0[_0xa97e('0x4f')],[_0xa97e('0x54'),'id'])||{});}})[_0xa97e('0x2a')](respondWithResult(_0x55303f,null))[_0xa97e('0x48')](handleError(_0x55303f,null));};exports[_0xa97e('0x56')]=function(_0x4387eb,_0x261790,_0x97ed31){var _0xd561f8={};var _0x49a9be={};var _0x5a391b;var _0x3c9d7d;return db[_0xa97e('0x30')][_0xa97e('0x57')]({'where':{'id':_0x4387eb['params']['id']}})[_0xa97e('0x2a')](handleEntityNotFound(_0x261790,null))['then'](function(_0xf30b7c){if(_0xf30b7c){_0x5a391b=_0xf30b7c;_0x49a9be[_0xa97e('0x35')]=_['keys'](db['User'][_0xa97e('0x31')]);_0x49a9be[_0xa97e('0x36')]=_[_0xa97e('0x37')](_0x4387eb['query']);_0x49a9be['filters']=_[_0xa97e('0x38')](_0x49a9be[_0xa97e('0x35')],_0x49a9be[_0xa97e('0x36')]);_0xd561f8[_0xa97e('0x39')]=_[_0xa97e('0x38')](_0x49a9be[_0xa97e('0x35')],qs[_0xa97e('0x3a')](_0x4387eb['query']['fields']));_0xd561f8[_0xa97e('0x39')]=_0xd561f8[_0xa97e('0x39')][_0xa97e('0x3b')]?_0xd561f8['attributes']:_0x49a9be[_0xa97e('0x35')];_0xd561f8['order']=qs[_0xa97e('0x3e')](_0x4387eb['query'][_0xa97e('0x3e')]);_0xd561f8[_0xa97e('0x44')]=qs['filters'](_[_0xa97e('0x3f')](_0x4387eb[_0xa97e('0x36')],_0x49a9be['filters']));if(_0x4387eb[_0xa97e('0x36')][_0xa97e('0x41')]){_0xd561f8[_0xa97e('0x44')]=_[_0xa97e('0x43')](_0xd561f8[_0xa97e('0x44')],{'$or':_[_0xa97e('0x2f')](_0xd561f8[_0xa97e('0x39')],function(_0x27189e){var _0x4084a1={};_0x4084a1[_0x27189e]={'$like':'%'+_0x4387eb['query'][_0xa97e('0x41')]+'%'};return _0x4084a1;})});}_0xd561f8=_['merge']({},_0xd561f8,_0x4387eb[_0xa97e('0x4c')]);return _0x5a391b[_0xa97e('0x56')](_0xd561f8);}})[_0xa97e('0x2a')](function(_0x459d49){if(_0x459d49){_0x3c9d7d=_0x459d49[_0xa97e('0x3b')];if(!_0x4387eb[_0xa97e('0x36')][_0xa97e('0x58')](_0xa97e('0x3c'))){_0xd561f8[_0xa97e('0x23')]=qs[_0xa97e('0x23')](_0x4387eb[_0xa97e('0x36')][_0xa97e('0x23')]);_0xd561f8['offset']=qs[_0xa97e('0x21')](_0x4387eb['query'][_0xa97e('0x21')]);}return _0x5a391b['getMembers'](_0xd561f8);}})[_0xa97e('0x2a')](function(_0x4a5fea){if(_0x4a5fea){return _0x4a5fea?{'count':_0x3c9d7d,'rows':_0x4a5fea}:null;}})[_0xa97e('0x2a')](respondWithResult(_0x261790,null))['catch'](handleError(_0x261790,null));};exports['removeMembers']=function(_0x59e47a,_0x56a90c,_0x512864){return db['ChatGroup'][_0xa97e('0x4d')]({'where':{'id':_0x59e47a[_0xa97e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56a90c,null))[_0xa97e('0x2a')](function(_0x1cc00f){if(_0x1cc00f){return _0x1cc00f[_0xa97e('0x59')](_0x59e47a[_0xa97e('0x36')]['ids']);}})[_0xa97e('0x2a')](respondWithStatusCode(_0x56a90c,null))[_0xa97e('0x48')](handleError(_0x56a90c,null));};exports[_0xa97e('0x5a')]=function(_0x211c45,_0x14d408,_0x1539b5){if(_0x211c45[_0xa97e('0x4f')]['id']){delete _0x211c45[_0xa97e('0x4f')]['id'];}return db['ChatGroup'][_0xa97e('0x4d')]({'where':{'id':_0x211c45[_0xa97e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14d408,null))[_0xa97e('0x2a')](function(_0x6f8ee){if(_0x6f8ee){_0x211c45[_0xa97e('0x4f')][_0xa97e('0x5b')]=_0x6f8ee['id'];return db[_0xa97e('0x5c')]['create'](_0x211c45['body']);}})[_0xa97e('0x2a')](respondWithResult(_0x14d408,null))[_0xa97e('0x48')](handleError(_0x14d408,null));};exports['getMessages']=function(_0x2de2ce,_0x1d1267,_0x16c554){var _0x58fa04={};var _0x18d70c={};var _0x51ba7a;var _0x5a00d5;return db[_0xa97e('0x30')][_0xa97e('0x57')]({'where':{'id':_0x2de2ce[_0xa97e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1d1267,null))[_0xa97e('0x2a')](function(_0x476052){if(_0x476052){_0x51ba7a=_0x476052;_0x18d70c[_0xa97e('0x35')]=_[_0xa97e('0x37')](db[_0xa97e('0x5c')][_0xa97e('0x31')]);_0x18d70c[_0xa97e('0x36')]=_[_0xa97e('0x37')](_0x2de2ce[_0xa97e('0x36')]);_0x18d70c[_0xa97e('0x40')]=_['intersection'](_0x18d70c['model'],_0x18d70c[_0xa97e('0x36')]);_0x58fa04[_0xa97e('0x39')]=_['intersection'](_0x18d70c[_0xa97e('0x35')],qs[_0xa97e('0x3a')](_0x2de2ce[_0xa97e('0x36')]['fields']));_0x58fa04[_0xa97e('0x39')]=_0x58fa04['attributes'][_0xa97e('0x3b')]?_0x58fa04['attributes']:_0x18d70c[_0xa97e('0x35')];_0x58fa04[_0xa97e('0x3d')]=qs[_0xa97e('0x3e')](_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x3e')]);_0x58fa04[_0xa97e('0x44')]=qs['filters'](_[_0xa97e('0x3f')](_0x2de2ce[_0xa97e('0x36')],_0x18d70c[_0xa97e('0x40')]));if(_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x41')]){_0x58fa04['where']=_['merge'](_0x58fa04[_0xa97e('0x44')],{'$or':_[_0xa97e('0x2f')](_0x58fa04[_0xa97e('0x39')],function(_0x2cb380){var _0x23377f={};_0x23377f[_0x2cb380]={'$like':'%'+_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x41')]+'%'};return _0x23377f;})});}if(_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x5d')]){var _0xe3457d=_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x5d')]['split'](',');var _0x62b429={};_0x62b429[_0xe3457d[0x0]]={'$gte':moment(_0xe3457d[0x1])[_0xa97e('0x5e')](_0xa97e('0x5f'))};_0x58fa04['where']=_[_0xa97e('0x43')](_0x58fa04['where'],_0x62b429);}_0x58fa04=_[_0xa97e('0x43')]({},_0x58fa04,_0x2de2ce[_0xa97e('0x4c')]);return _0x51ba7a[_0xa97e('0x60')](_0x58fa04);}})['then'](function(_0x346101){if(_0x346101){_0x5a00d5=_0x346101[_0xa97e('0x3b')];if(!_0x2de2ce[_0xa97e('0x36')]['hasOwnProperty'](_0xa97e('0x3c'))){_0x58fa04['limit']=qs[_0xa97e('0x23')](_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x23')]);_0x58fa04['offset']=qs[_0xa97e('0x21')](_0x2de2ce[_0xa97e('0x36')][_0xa97e('0x21')]);}return _0x51ba7a[_0xa97e('0x60')](_0x58fa04);}})[_0xa97e('0x2a')](function(_0x21367b){if(_0x21367b){return _0x21367b?{'count':_0x5a00d5,'rows':_0x21367b}:null;}})[_0xa97e('0x2a')](respondWithResult(_0x1d1267,null))[_0xa97e('0x48')](handleError(_0x1d1267,null));}; \ No newline at end of file +var _0x4c34=['./chatGroup.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatGroup','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x4c34,0x160));var _0x44c3=function(_0x58a2cd,_0x16e33f){_0x58a2cd=_0x58a2cd-0x0;var _0x1e729d=_0x4c34[_0x58a2cd];return _0x1e729d;};'use strict';var emlformat=require(_0x44c3('0x0'));var rimraf=require(_0x44c3('0x1'));var zipdir=require(_0x44c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44c3('0x3'));var moment=require('moment');var BPromise=require(_0x44c3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x44c3('0x5'));var csv=require('to-csv');var ejs=require(_0x44c3('0x6'));var fs=require('fs');var fs_extra=require(_0x44c3('0x7'));var _=require(_0x44c3('0x8'));var squel=require(_0x44c3('0x9'));var crypto=require(_0x44c3('0xa'));var jsforce=require(_0x44c3('0xb'));var deskjs=require(_0x44c3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x44c3('0xd'));var Papa=require(_0x44c3('0xe'));var Redis=require('ioredis');var authService=require(_0x44c3('0xf'));var qs=require(_0x44c3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44c3('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x44c3('0x12'));var licenseUtil=require(_0x44c3('0x13'));var db=require(_0x44c3('0x14'))['db'];config[_0x44c3('0x15')]=_[_0x44c3('0x16')](config[_0x44c3('0x15')],{'host':_0x44c3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44c3('0x15')]));require(_0x44c3('0x18'))['register'](socket);function respondWithStatusCode(_0x3c3dbd,_0x44a74b){_0x44a74b=_0x44a74b||0xcc;return function(_0x51da5c){if(_0x51da5c){return _0x3c3dbd[_0x44c3('0x19')](_0x44a74b);}return _0x3c3dbd['status'](_0x44a74b)['end']();};}function respondWithResult(_0xb9dd0a,_0x684801){_0x684801=_0x684801||0xc8;return function(_0x398b70){if(_0x398b70){return _0xb9dd0a[_0x44c3('0x1a')](_0x684801)[_0x44c3('0x1b')](_0x398b70);}};}function respondWithFilteredResult(_0x5454e0,_0x3c2b96){return function(_0x1a9b5d){if(_0x1a9b5d){var _0x5b35e2=typeof _0x3c2b96[_0x44c3('0x1c')]===_0x44c3('0x1d')&&typeof _0x3c2b96[_0x44c3('0x1e')]===_0x44c3('0x1d');var _0x30ae5e=_0x1a9b5d['count'];var _0x3862a4=_0x5b35e2?0x0:_0x3c2b96['offset'];var _0xc9c72c=_0x5b35e2?_0x1a9b5d[_0x44c3('0x1f')]:_0x3c2b96[_0x44c3('0x1c')]+_0x3c2b96[_0x44c3('0x1e')];var _0x5185b8;if(_0xc9c72c>=_0x30ae5e){_0xc9c72c=_0x30ae5e;_0x5185b8=0xc8;}else{_0x5185b8=0xce;}_0x5454e0[_0x44c3('0x1a')](_0x5185b8);return _0x5454e0[_0x44c3('0x20')](_0x44c3('0x21'),_0x3862a4+'-'+_0xc9c72c+'/'+_0x30ae5e)[_0x44c3('0x1b')](_0x1a9b5d);}return null;};}function patchUpdates(_0x2abeaf){return function(_0x45e6fa){try{jsonpatch[_0x44c3('0x22')](_0x45e6fa,_0x2abeaf,!![]);}catch(_0x122479){return BPromise[_0x44c3('0x23')](_0x122479);}return _0x45e6fa[_0x44c3('0x24')]();};}function saveUpdates(_0x3f872f,_0x279bce){return function(_0x2e7cdc){if(_0x2e7cdc){return _0x2e7cdc[_0x44c3('0x25')](_0x3f872f)['then'](function(_0x3e1a7b){return _0x3e1a7b;});}return null;};}function removeEntity(_0x47ae49,_0x1e5853){return function(_0x1748c1){if(_0x1748c1){return _0x1748c1['destroy']()[_0x44c3('0x26')](function(){_0x47ae49[_0x44c3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c368,_0x1db556){return function(_0x566316){if(!_0x566316){_0x36c368[_0x44c3('0x19')](0x194);}return _0x566316;};}function handleError(_0x1ea578,_0x55097b){_0x55097b=_0x55097b||0x1f4;return function(_0x5115aa){logger[_0x44c3('0x27')](_0x5115aa[_0x44c3('0x28')]);if(_0x5115aa[_0x44c3('0x29')]){delete _0x5115aa[_0x44c3('0x29')];}_0x1ea578[_0x44c3('0x1a')](_0x55097b)[_0x44c3('0x2a')](_0x5115aa);};}exports[_0x44c3('0x2b')]=function(_0x549ee4,_0x276852){var _0x443e32={},_0x1785d7={},_0xe7bafb={'count':0x0,'rows':[]};var _0x2e12fe=_[_0x44c3('0x2c')](db['ChatGroup']['rawAttributes'],function(_0x5882af){return{'name':_0x5882af[_0x44c3('0x2d')],'type':_0x5882af[_0x44c3('0x2e')][_0x44c3('0x2f')]};});_0x1785d7[_0x44c3('0x30')]=_['map'](_0x2e12fe,_0x44c3('0x29'));_0x1785d7['query']=_[_0x44c3('0x31')](_0x549ee4[_0x44c3('0x32')]);_0x1785d7[_0x44c3('0x33')]=_['intersection'](_0x1785d7[_0x44c3('0x30')],_0x1785d7[_0x44c3('0x32')]);_0x443e32['attributes']=_[_0x44c3('0x34')](_0x1785d7[_0x44c3('0x30')],qs['fields'](_0x549ee4[_0x44c3('0x32')][_0x44c3('0x35')]));_0x443e32[_0x44c3('0x36')]=_0x443e32[_0x44c3('0x36')][_0x44c3('0x37')]?_0x443e32['attributes']:_0x1785d7[_0x44c3('0x30')];if(!_0x549ee4['query'][_0x44c3('0x38')](_0x44c3('0x39'))){_0x443e32[_0x44c3('0x1e')]=qs[_0x44c3('0x1e')](_0x549ee4[_0x44c3('0x32')][_0x44c3('0x1e')]);_0x443e32[_0x44c3('0x1c')]=qs['offset'](_0x549ee4[_0x44c3('0x32')][_0x44c3('0x1c')]);}_0x443e32[_0x44c3('0x3a')]=qs[_0x44c3('0x3b')](_0x549ee4[_0x44c3('0x32')]['sort']);_0x443e32['where']=qs[_0x44c3('0x33')](_[_0x44c3('0x3c')](_0x549ee4[_0x44c3('0x32')],_0x1785d7[_0x44c3('0x33')]),_0x2e12fe);if(_0x549ee4[_0x44c3('0x32')][_0x44c3('0x3d')]){_0x443e32[_0x44c3('0x3e')]=_[_0x44c3('0x3f')](_0x443e32[_0x44c3('0x3e')],{'$or':_[_0x44c3('0x2c')](_0x2e12fe,function(_0x1bfe8c){if(_0x1bfe8c[_0x44c3('0x2e')]!==_0x44c3('0x40')){var _0x36e2b0={};_0x36e2b0[_0x1bfe8c[_0x44c3('0x29')]]={'$like':'%'+_0x549ee4[_0x44c3('0x32')][_0x44c3('0x3d')]+'%'};return _0x36e2b0;}})});}_0x443e32=_[_0x44c3('0x3f')]({},_0x443e32,_0x549ee4[_0x44c3('0x41')]);var _0x597f48={'where':_0x443e32[_0x44c3('0x3e')]};return db['ChatGroup'][_0x44c3('0x1f')](_0x597f48)[_0x44c3('0x26')](function(_0xf9b966){_0xe7bafb['count']=_0xf9b966;if(_0x549ee4[_0x44c3('0x32')][_0x44c3('0x42')]){_0x443e32[_0x44c3('0x43')]=[{'all':!![]}];}return db[_0x44c3('0x44')][_0x44c3('0x45')](_0x443e32);})[_0x44c3('0x26')](function(_0x7a6025){_0xe7bafb[_0x44c3('0x46')]=_0x7a6025;return _0xe7bafb;})[_0x44c3('0x26')](respondWithFilteredResult(_0x276852,_0x443e32))[_0x44c3('0x47')](handleError(_0x276852,null));};exports[_0x44c3('0x48')]=function(_0x3d869f,_0x36609e){var _0x543d4b={'raw':!![],'where':{'id':_0x3d869f['params']['id']}},_0x3dd7b0={};_0x3dd7b0[_0x44c3('0x30')]=_['keys'](db[_0x44c3('0x44')][_0x44c3('0x49')]);_0x3dd7b0[_0x44c3('0x32')]=_[_0x44c3('0x31')](_0x3d869f['query']);_0x3dd7b0[_0x44c3('0x33')]=_['intersection'](_0x3dd7b0[_0x44c3('0x30')],_0x3dd7b0[_0x44c3('0x32')]);_0x543d4b['attributes']=_['intersection'](_0x3dd7b0[_0x44c3('0x30')],qs['fields'](_0x3d869f[_0x44c3('0x32')]['fields']));_0x543d4b['attributes']=_0x543d4b['attributes']['length']?_0x543d4b[_0x44c3('0x36')]:_0x3dd7b0[_0x44c3('0x30')];if(_0x3d869f[_0x44c3('0x32')]['includeAll']){_0x543d4b[_0x44c3('0x43')]=[{'all':!![]}];}_0x543d4b=_[_0x44c3('0x3f')]({},_0x543d4b,_0x3d869f[_0x44c3('0x41')]);return db[_0x44c3('0x44')][_0x44c3('0x4a')](_0x543d4b)['then'](handleEntityNotFound(_0x36609e,null))[_0x44c3('0x26')](respondWithResult(_0x36609e,null))[_0x44c3('0x47')](handleError(_0x36609e,null));};exports[_0x44c3('0x4b')]=function(_0x1833f6,_0x2c54db){return db[_0x44c3('0x44')][_0x44c3('0x4b')](_0x1833f6['body'],{})[_0x44c3('0x26')](respondWithResult(_0x2c54db,0xc9))[_0x44c3('0x47')](handleError(_0x2c54db,null));};exports[_0x44c3('0x25')]=function(_0x28c1ec,_0x39d119){if(_0x28c1ec[_0x44c3('0x4c')]['id']){delete _0x28c1ec[_0x44c3('0x4c')]['id'];}return db[_0x44c3('0x44')]['find']({'where':{'id':_0x28c1ec[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x39d119,null))[_0x44c3('0x26')](saveUpdates(_0x28c1ec[_0x44c3('0x4c')],null))[_0x44c3('0x26')](respondWithResult(_0x39d119,null))[_0x44c3('0x47')](handleError(_0x39d119,null));};exports[_0x44c3('0x4e')]=function(_0x29ea7b,_0x23d1c3){return db[_0x44c3('0x44')][_0x44c3('0x4a')]({'where':{'id':_0x29ea7b[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x23d1c3,null))[_0x44c3('0x26')](removeEntity(_0x23d1c3,null))[_0x44c3('0x47')](handleError(_0x23d1c3,null));};exports[_0x44c3('0x4f')]=function(_0x3e7d70,_0x131d93){return db[_0x44c3('0x44')][_0x44c3('0x4f')]()[_0x44c3('0x26')](respondWithResult(_0x131d93,null))[_0x44c3('0x47')](handleError(_0x131d93,null));};exports[_0x44c3('0x50')]=function(_0x2819f0,_0x114be0,_0x4f86d4){return db[_0x44c3('0x51')][_0x44c3('0x1f')]({'where':{'ChatGroupId':_0x2819f0[_0x44c3('0x4d')]['id'],'ToId':_0x2819f0[_0x44c3('0x52')]['id'],'read':![]}})[_0x44c3('0x26')](function(_0x2e2de){return{'id':_[_0x44c3('0x53')](_0x2819f0[_0x44c3('0x4d')]['id']),'count':_0x2e2de};})[_0x44c3('0x26')](respondWithResult(_0x114be0,null))[_0x44c3('0x47')](handleError(_0x114be0,null));};exports[_0x44c3('0x54')]=function(_0x4203c2,_0x5aabb8,_0x3553c2){return db[_0x44c3('0x44')]['find']({'where':{'id':_0x4203c2[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x5aabb8,null))[_0x44c3('0x26')](function(_0xa4bb40){if(_0xa4bb40){return _0xa4bb40[_0x44c3('0x54')](_0x4203c2[_0x44c3('0x4c')][_0x44c3('0x55')],_['omit'](_0x4203c2['body'],[_0x44c3('0x55'),'id'])||{});}})[_0x44c3('0x26')](respondWithResult(_0x5aabb8,null))['catch'](handleError(_0x5aabb8,null));};exports['getMembers']=function(_0x132384,_0x233cb4,_0x1b2a0d){var _0x16f435={};var _0x3741ff={};var _0x32cad4;var _0x5010c4;return db[_0x44c3('0x44')][_0x44c3('0x56')]({'where':{'id':_0x132384[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x233cb4,null))[_0x44c3('0x26')](function(_0x4b4f46){if(_0x4b4f46){_0x32cad4=_0x4b4f46;_0x3741ff[_0x44c3('0x30')]=_[_0x44c3('0x31')](db['User'][_0x44c3('0x49')]);_0x3741ff[_0x44c3('0x32')]=_[_0x44c3('0x31')](_0x132384[_0x44c3('0x32')]);_0x3741ff[_0x44c3('0x33')]=_[_0x44c3('0x34')](_0x3741ff[_0x44c3('0x30')],_0x3741ff['query']);_0x16f435[_0x44c3('0x36')]=_[_0x44c3('0x34')](_0x3741ff['model'],qs[_0x44c3('0x35')](_0x132384[_0x44c3('0x32')][_0x44c3('0x35')]));_0x16f435[_0x44c3('0x36')]=_0x16f435[_0x44c3('0x36')][_0x44c3('0x37')]?_0x16f435[_0x44c3('0x36')]:_0x3741ff[_0x44c3('0x30')];_0x16f435[_0x44c3('0x3a')]=qs[_0x44c3('0x3b')](_0x132384['query'][_0x44c3('0x3b')]);_0x16f435['where']=qs[_0x44c3('0x33')](_[_0x44c3('0x3c')](_0x132384[_0x44c3('0x32')],_0x3741ff[_0x44c3('0x33')]));if(_0x132384[_0x44c3('0x32')][_0x44c3('0x3d')]){_0x16f435[_0x44c3('0x3e')]=_[_0x44c3('0x3f')](_0x16f435[_0x44c3('0x3e')],{'$or':_[_0x44c3('0x2c')](_0x16f435[_0x44c3('0x36')],function(_0x2b9652){var _0x2d24d1={};_0x2d24d1[_0x2b9652]={'$like':'%'+_0x132384[_0x44c3('0x32')][_0x44c3('0x3d')]+'%'};return _0x2d24d1;})});}_0x16f435=_[_0x44c3('0x3f')]({},_0x16f435,_0x132384[_0x44c3('0x41')]);return _0x32cad4[_0x44c3('0x57')](_0x16f435);}})['then'](function(_0x43c939){if(_0x43c939){_0x5010c4=_0x43c939['length'];if(!_0x132384['query']['hasOwnProperty'](_0x44c3('0x39'))){_0x16f435['limit']=qs['limit'](_0x132384[_0x44c3('0x32')][_0x44c3('0x1e')]);_0x16f435[_0x44c3('0x1c')]=qs[_0x44c3('0x1c')](_0x132384[_0x44c3('0x32')][_0x44c3('0x1c')]);}return _0x32cad4['getMembers'](_0x16f435);}})['then'](function(_0x492722){if(_0x492722){return _0x492722?{'count':_0x5010c4,'rows':_0x492722}:null;}})['then'](respondWithResult(_0x233cb4,null))[_0x44c3('0x47')](handleError(_0x233cb4,null));};exports[_0x44c3('0x58')]=function(_0x46ac0d,_0x5716b6,_0x10f80d){return db[_0x44c3('0x44')]['find']({'where':{'id':_0x46ac0d[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x5716b6,null))['then'](function(_0x432223){if(_0x432223){return _0x432223[_0x44c3('0x58')](_0x46ac0d[_0x44c3('0x32')][_0x44c3('0x55')]);}})[_0x44c3('0x26')](respondWithStatusCode(_0x5716b6,null))[_0x44c3('0x47')](handleError(_0x5716b6,null));};exports[_0x44c3('0x59')]=function(_0x2a82ca,_0x3cf0f6,_0x4eae3f){if(_0x2a82ca[_0x44c3('0x4c')]['id']){delete _0x2a82ca[_0x44c3('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2a82ca[_0x44c3('0x4d')]['id']}})[_0x44c3('0x26')](handleEntityNotFound(_0x3cf0f6,null))[_0x44c3('0x26')](function(_0x4471b7){if(_0x4471b7){_0x2a82ca[_0x44c3('0x4c')][_0x44c3('0x5a')]=_0x4471b7['id'];return db['ChatInternalMessage'][_0x44c3('0x4b')](_0x2a82ca['body']);}})['then'](respondWithResult(_0x3cf0f6,null))[_0x44c3('0x47')](handleError(_0x3cf0f6,null));};exports[_0x44c3('0x5b')]=function(_0x5c7b1b,_0x313084,_0x406fb5){var _0x2d742f={};var _0x534f33={};var _0xe3392a;var _0x4d0d4a;return db[_0x44c3('0x44')]['findOne']({'where':{'id':_0x5c7b1b[_0x44c3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x313084,null))[_0x44c3('0x26')](function(_0x1ec033){if(_0x1ec033){_0xe3392a=_0x1ec033;_0x534f33[_0x44c3('0x30')]=_[_0x44c3('0x31')](db[_0x44c3('0x51')]['rawAttributes']);_0x534f33[_0x44c3('0x32')]=_[_0x44c3('0x31')](_0x5c7b1b[_0x44c3('0x32')]);_0x534f33[_0x44c3('0x33')]=_[_0x44c3('0x34')](_0x534f33[_0x44c3('0x30')],_0x534f33[_0x44c3('0x32')]);_0x2d742f[_0x44c3('0x36')]=_[_0x44c3('0x34')](_0x534f33[_0x44c3('0x30')],qs[_0x44c3('0x35')](_0x5c7b1b['query']['fields']));_0x2d742f[_0x44c3('0x36')]=_0x2d742f[_0x44c3('0x36')][_0x44c3('0x37')]?_0x2d742f[_0x44c3('0x36')]:_0x534f33[_0x44c3('0x30')];_0x2d742f[_0x44c3('0x3a')]=qs[_0x44c3('0x3b')](_0x5c7b1b[_0x44c3('0x32')]['sort']);_0x2d742f[_0x44c3('0x3e')]=qs['filters'](_[_0x44c3('0x3c')](_0x5c7b1b['query'],_0x534f33[_0x44c3('0x33')]));if(_0x5c7b1b['query']['filter']){_0x2d742f[_0x44c3('0x3e')]=_[_0x44c3('0x3f')](_0x2d742f['where'],{'$or':_['map'](_0x2d742f['attributes'],function(_0x28d977){var _0x1f2047={};_0x1f2047[_0x28d977]={'$like':'%'+_0x5c7b1b[_0x44c3('0x32')][_0x44c3('0x3d')]+'%'};return _0x1f2047;})});}if(_0x5c7b1b['query'][_0x44c3('0x5c')]){var _0x4fa37f=_0x5c7b1b[_0x44c3('0x32')][_0x44c3('0x5c')]['split'](',');var _0x30983b={};_0x30983b[_0x4fa37f[0x0]]={'$gte':moment(_0x4fa37f[0x1])['format'](_0x44c3('0x5d'))};_0x2d742f['where']=_['merge'](_0x2d742f[_0x44c3('0x3e')],_0x30983b);}_0x2d742f=_[_0x44c3('0x3f')]({},_0x2d742f,_0x5c7b1b[_0x44c3('0x41')]);return _0xe3392a[_0x44c3('0x5b')](_0x2d742f);}})[_0x44c3('0x26')](function(_0x4bc72f){if(_0x4bc72f){_0x4d0d4a=_0x4bc72f[_0x44c3('0x37')];if(!_0x5c7b1b[_0x44c3('0x32')][_0x44c3('0x38')](_0x44c3('0x39'))){_0x2d742f[_0x44c3('0x1e')]=qs[_0x44c3('0x1e')](_0x5c7b1b['query']['limit']);_0x2d742f[_0x44c3('0x1c')]=qs['offset'](_0x5c7b1b[_0x44c3('0x32')][_0x44c3('0x1c')]);}return _0xe3392a['getMessages'](_0x2d742f);}})[_0x44c3('0x26')](function(_0x29ed63){if(_0x29ed63){return _0x29ed63?{'count':_0x4d0d4a,'rows':_0x29ed63}:null;}})[_0x44c3('0x26')](respondWithResult(_0x313084,null))[_0x44c3('0x47')](handleError(_0x313084,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 89c58d7..44b0f04 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 _0xfdc6=['remove','emit','exports','ChatGroup','setMaxListeners','update'];(function(_0x5f42c3,_0x3e0328){var _0x52b67f=function(_0x53c83f){while(--_0x53c83f){_0x5f42c3['push'](_0x5f42c3['shift']());}};_0x52b67f(++_0x3e0328);}(_0xfdc6,0xf3));var _0x6fdc=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0xfdc6[_0x382168];return _0x3ecf7e;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x6fdc('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6fdc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fdc('0x2'),'afterDestroy':_0x6fdc('0x3')};function emitEvent(_0x239c81){return function(_0x339bce,_0x2be0db,_0x53235b){ChatGroupEvents[_0x6fdc('0x4')](_0x239c81+':'+_0x339bce['id'],_0x339bce);ChatGroupEvents['emit'](_0x239c81,_0x339bce);_0x53235b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x6fdc('0x5')]=ChatGroupEvents; \ No newline at end of file +var _0x8c6c=['exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x3af450,_0x54e9a7){var _0x893319=function(_0xba8bde){while(--_0xba8bde){_0x3af450['push'](_0x3af450['shift']());}};_0x893319(++_0x54e9a7);}(_0x8c6c,0x133));var _0xc8c6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8c6c[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xc8c6('0x0'));var ChatGroup=require(_0xc8c6('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc8c6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8c6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50ae69){return function(_0x591f6,_0x3a171a,_0x13fc85){ChatGroupEvents['emit'](_0x50ae69+':'+_0x591f6['id'],_0x591f6);ChatGroupEvents[_0xc8c6('0x4')](_0x50ae69,_0x591f6);_0x13fc85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xc8c6('0x5')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e239c01..964428e 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 _0xfcb1=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash'];(function(_0x342057,_0x2dde96){var _0x28c9ea=function(_0x17a369){while(--_0x17a369){_0x342057['push'](_0x342057['shift']());}};_0x28c9ea(++_0x2dde96);}(_0xfcb1,0x77));var _0x1fcb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfcb1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1fcb('0x0'));var util=require('util');var logger=require(_0x1fcb('0x1'))(_0x1fcb('0x2'));var moment=require(_0x1fcb('0x3'));var BPromise=require('bluebird');var rp=require(_0x1fcb('0x4'));var fs=require('fs');var path=require(_0x1fcb('0x5'));var rimraf=require(_0x1fcb('0x6'));var config=require(_0x1fcb('0x7'));var attributes=require(_0x1fcb('0x8'));module[_0x1fcb('0x9')]=function(_0x21ce2a,_0x176562){return _0x21ce2a[_0x1fcb('0xa')]('ChatGroup',attributes,{'tableName':_0x1fcb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3596=['exports','ChatGroup','util','api','moment','request-promise','./chatGroup.attributes'];(function(_0x45a171,_0x26aa8b){var _0x1e094d=function(_0xa2fa1b){while(--_0xa2fa1b){_0x45a171['push'](_0x45a171['shift']());}};_0x1e094d(++_0x26aa8b);}(_0x3596,0x136));var _0x6359=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3596[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x6359('0x0'));var logger=require('../../config/logger')(_0x6359('0x1'));var moment=require(_0x6359('0x2'));var BPromise=require('bluebird');var rp=require(_0x6359('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6359('0x4'));module[_0x6359('0x5')]=function(_0x2df966,_0x52a5bd){return _0x2df966['define'](_0x6359('0x6'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 476e18f..7d43631 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 _0xe81d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe81d,0xc4));var _0xde81=function(_0x4b352f,_0x243f64){_0x4b352f=_0x4b352f-0x0;var _0x299dbe=_0xe81d[_0x4b352f];return _0x299dbe;};'use strict';var _=require(_0xde81('0x0'));var util=require(_0xde81('0x1'));var moment=require(_0xde81('0x2'));var BPromise=require(_0xde81('0x3'));var rs=require(_0xde81('0x4'));var fs=require('fs');var Redis=require(_0xde81('0x5'));var db=require(_0xde81('0x6'))['db'];var utils=require(_0xde81('0x7'));var logger=require(_0xde81('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde81('0x9'));var client=jayson[_0xde81('0xa')]['http']({'port':0x232a});config[_0xde81('0xb')]=_[_0xde81('0xc')](config[_0xde81('0xb')],{'host':_0xde81('0xd'),'port':0x18eb});var socket=require(_0xde81('0xe'))(new Redis(config['redis']));require(_0xde81('0xf'))['register'](socket);function respondWithRpcPromise(_0x4186b9,_0x118eff,_0x20a335){return new BPromise(function(_0x4074ef,_0x56231a){return client['request'](_0x4186b9,_0x20a335)[_0xde81('0x10')](function(_0x17ba97){logger[_0xde81('0x11')](_0xde81('0x12'),_0x118eff,'request\x20sent');logger[_0xde81('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x118eff,'request\x20sent',JSON[_0xde81('0x14')](_0x17ba97));if(_0x17ba97[_0xde81('0x15')]){if(_0x17ba97[_0xde81('0x15')]['code']===0x1f4){logger[_0xde81('0x15')](_0xde81('0x12'),_0x118eff,_0x17ba97[_0xde81('0x15')]['message']);return _0x56231a(_0x17ba97[_0xde81('0x15')][_0xde81('0x16')]);}logger[_0xde81('0x15')](_0xde81('0x12'),_0x118eff,_0x17ba97['error'][_0xde81('0x16')]);return _0x4074ef(_0x17ba97['error'][_0xde81('0x16')]);}else{logger[_0xde81('0x11')](_0xde81('0x12'),_0x118eff,_0xde81('0x17'));_0x4074ef(_0x17ba97[_0xde81('0x18')][_0xde81('0x16')]);}})['catch'](function(_0xc11166){logger['error'](_0xde81('0x12'),_0x118eff,_0xc11166);_0x56231a(_0xc11166);});});} \ No newline at end of file +var _0x8bf5=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x58f124,_0x1aab96){var _0x1d95f7=function(_0x41075c){while(--_0x41075c){_0x58f124['push'](_0x58f124['shift']());}};_0x1d95f7(++_0x1aab96);}(_0x8bf5,0x172));var _0x58bf=function(_0x2bfda4,_0x5e2ef8){_0x2bfda4=_0x2bfda4-0x0;var _0x5bb7d7=_0x8bf5[_0x2bfda4];return _0x5bb7d7;};'use strict';var _=require('lodash');var util=require(_0x58bf('0x0'));var moment=require(_0x58bf('0x1'));var BPromise=require(_0x58bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58bf('0x3'));var db=require(_0x58bf('0x4'))['db'];var utils=require(_0x58bf('0x5'));var logger=require(_0x58bf('0x6'))(_0x58bf('0x7'));var config=require(_0x58bf('0x8'));var jayson=require(_0x58bf('0x9'));var client=jayson[_0x58bf('0xa')]['http']({'port':0x232a});config[_0x58bf('0xb')]=_[_0x58bf('0xc')](config['redis'],{'host':_0x58bf('0xd'),'port':0x18eb});var socket=require(_0x58bf('0xe'))(new Redis(config[_0x58bf('0xb')]));require(_0x58bf('0xf'))['register'](socket);function respondWithRpcPromise(_0x201528,_0xd67bbd,_0x5aba24){return new BPromise(function(_0x5d453e,_0x1cca09){return client[_0x58bf('0x10')](_0x201528,_0x5aba24)[_0x58bf('0x11')](function(_0x5303e9){logger[_0x58bf('0x12')](_0x58bf('0x13'),_0xd67bbd,_0x58bf('0x14'));logger[_0x58bf('0x15')](_0x58bf('0x16'),_0xd67bbd,'request\x20sent',JSON[_0x58bf('0x17')](_0x5303e9));if(_0x5303e9[_0x58bf('0x18')]){if(_0x5303e9['error']['code']===0x1f4){logger['error'](_0x58bf('0x13'),_0xd67bbd,_0x5303e9[_0x58bf('0x18')]['message']);return _0x1cca09(_0x5303e9[_0x58bf('0x18')][_0x58bf('0x19')]);}logger[_0x58bf('0x18')](_0x58bf('0x13'),_0xd67bbd,_0x5303e9[_0x58bf('0x18')][_0x58bf('0x19')]);return _0x5d453e(_0x5303e9[_0x58bf('0x18')][_0x58bf('0x19')]);}else{logger[_0x58bf('0x12')](_0x58bf('0x13'),_0xd67bbd,_0x58bf('0x14'));_0x5d453e(_0x5303e9[_0x58bf('0x1a')]['message']);}})['catch'](function(_0x233e49){logger['error'](_0x58bf('0x13'),_0xd67bbd,_0x233e49);_0x1cca09(_0x233e49);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 333f7b0..bd1e2a0 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 _0x5216=['chatGroup:','./chatGroup.events','remove','update','length'];(function(_0x517105,_0x14568a){var _0x50c1f1=function(_0x204403){while(--_0x204403){_0x517105['push'](_0x517105['shift']());}};_0x50c1f1(++_0x14568a);}(_0x5216,0x1d7));var _0x6521=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5216[_0x397e5f];return _0x5302b8;};'use strict';var ChatGroupEvents=require(_0x6521('0x0'));var events=['save',_0x6521('0x1'),_0x6521('0x2')];function createListener(_0x5bbae3,_0x26d4e5){return function(_0x5106f9){_0x26d4e5['emit'](_0x5bbae3,_0x5106f9);};}function removeListener(_0x550e98,_0x4d2f99){return function(){ChatGroupEvents['removeListener'](_0x550e98,_0x4d2f99);};}exports['register']=function(_0x2ec775){for(var _0x39a6db=0x0,_0x5f0603=events[_0x6521('0x3')];_0x39a6db<_0x5f0603;_0x39a6db++){var _0x2baeb9=events[_0x39a6db];var _0x184cc6=createListener(_0x6521('0x4')+_0x2baeb9,_0x2ec775);ChatGroupEvents['on'](_0x2baeb9,_0x184cc6);}}; \ No newline at end of file +var _0xdaee=['remove','update','emit','register','length','chatGroup:','save'];(function(_0x3333d2,_0x2165e1){var _0x3b2802=function(_0x505c73){while(--_0x505c73){_0x3333d2['push'](_0x3333d2['shift']());}};_0x3b2802(++_0x2165e1);}(_0xdaee,0x1bf));var _0xedae=function(_0x1d183b,_0x4dfd8f){_0x1d183b=_0x1d183b-0x0;var _0x119990=_0xdaee[_0x1d183b];return _0x119990;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xedae('0x0'),_0xedae('0x1'),_0xedae('0x2')];function createListener(_0x4c76e6,_0x5d6b67){return function(_0x3b24c0){_0x5d6b67[_0xedae('0x3')](_0x4c76e6,_0x3b24c0);};}function removeListener(_0x2cbb86,_0x4d3e59){return function(){ChatGroupEvents['removeListener'](_0x2cbb86,_0x4d3e59);};}exports[_0xedae('0x4')]=function(_0x5d36c0){for(var _0x59a6e3=0x0,_0x13b23e=events[_0xedae('0x5')];_0x59a6e3<_0x13b23e;_0x59a6e3++){var _0x2c5eee=events[_0x59a6e3];var _0x46f5a3=createListener(_0xedae('0x6')+_0x2c5eee,_0x5d36c0);ChatGroupEvents['on'](_0x2c5eee,_0x46f5a3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ec3fdcf..71b4097 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 _0x38cf=['delete','destroy','removeMembers','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','update'];(function(_0x292129,_0x51f1a5){var _0xfe7d2a=function(_0x50e378){while(--_0x50e378){_0x292129['push'](_0x292129['shift']());}};_0xfe7d2a(++_0x51f1a5);}(_0x38cf,0x1ac));var _0xf38c=function(_0x565326,_0x88ba96){_0x565326=_0x565326-0x0;var _0x84cbf8=_0x38cf[_0x565326];return _0x84cbf8;};'use strict';var multer=require(_0xf38c('0x0'));var util=require('util');var path=require(_0xf38c('0x1'));var timeout=require(_0xf38c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf38c('0x3'));var auth=require(_0xf38c('0x4'));var interaction=require(_0xf38c('0x5'));var config=require(_0xf38c('0x6'));var controller=require(_0xf38c('0x7'));router['get']('/',auth[_0xf38c('0x8')](),controller[_0xf38c('0x9')]);router[_0xf38c('0xa')](_0xf38c('0xb'),auth[_0xf38c('0x8')](),controller[_0xf38c('0xc')]);router[_0xf38c('0xa')](_0xf38c('0xd'),auth[_0xf38c('0x8')](),controller['show']);router[_0xf38c('0xa')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0xf38c('0xa')](_0xf38c('0xe'),auth[_0xf38c('0x8')](),controller['getMembers']);router[_0xf38c('0xa')](_0xf38c('0xf'),auth['isAuthenticated'](),controller[_0xf38c('0x10')]);router[_0xf38c('0x11')]('/',auth[_0xf38c('0x8')](),controller[_0xf38c('0x12')]);router[_0xf38c('0x11')](_0xf38c('0xe'),auth['isAuthenticated'](),controller[_0xf38c('0x13')]);router[_0xf38c('0x11')](_0xf38c('0xf'),auth[_0xf38c('0x8')](),controller[_0xf38c('0x14')]);router['put'](_0xf38c('0xd'),auth[_0xf38c('0x8')](),controller[_0xf38c('0x15')]);router[_0xf38c('0x16')](_0xf38c('0xd'),auth[_0xf38c('0x8')](),controller[_0xf38c('0x17')]);router[_0xf38c('0x16')](_0xf38c('0xe'),auth[_0xf38c('0x8')](),controller[_0xf38c('0x18')]);module['exports']=router; \ No newline at end of file +var _0x13db=['/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13db,0xe0));var _0xb13d=function(_0x20957f,_0x454be){_0x20957f=_0x20957f-0x0;var _0x19f1c2=_0x13db[_0x20957f];return _0x19f1c2;};'use strict';var multer=require(_0xb13d('0x0'));var util=require(_0xb13d('0x1'));var path=require(_0xb13d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb13d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb13d('0x4'));var interaction=require(_0xb13d('0x5'));var config=require('../../config/environment');var controller=require(_0xb13d('0x6'));router[_0xb13d('0x7')]('/',auth[_0xb13d('0x8')](),controller[_0xb13d('0x9')]);router[_0xb13d('0x7')](_0xb13d('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb13d('0x7')](_0xb13d('0xb'),auth[_0xb13d('0x8')](),controller['show']);router['get'](_0xb13d('0xc'),auth[_0xb13d('0x8')](),controller[_0xb13d('0xd')]);router[_0xb13d('0x7')](_0xb13d('0xe'),auth[_0xb13d('0x8')](),controller[_0xb13d('0xf')]);router[_0xb13d('0x7')](_0xb13d('0x10'),auth['isAuthenticated'](),controller[_0xb13d('0x11')]);router[_0xb13d('0x12')]('/',auth[_0xb13d('0x8')](),controller[_0xb13d('0x13')]);router[_0xb13d('0x12')](_0xb13d('0xe'),auth[_0xb13d('0x8')](),controller['addMembers']);router[_0xb13d('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb13d('0x14')]);router[_0xb13d('0x15')](_0xb13d('0xb'),auth[_0xb13d('0x8')](),controller[_0xb13d('0x16')]);router[_0xb13d('0x17')](_0xb13d('0xb'),auth[_0xb13d('0x8')](),controller[_0xb13d('0x18')]);router[_0xb13d('0x17')](_0xb13d('0xe'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xb13d('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 46c8d03..c2e9c24 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 _0x8164=['exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','out','sequelize'];(function(_0xce8768,_0x458811){var _0x3a3d76=function(_0x45cd5c){while(--_0x45cd5c){_0xce8768['push'](_0xce8768['shift']());}};_0x3a3d76(++_0x458811);}(_0x8164,0x170));var _0x4816=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0x8164[_0x4b3e49];return _0x57e339;};'use strict';var Sequelize=require(_0x4816('0x0'));module[_0x4816('0x1')]={'closed':{'type':Sequelize[_0x4816('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x4816('0x3')](_0x4816('0x4'),'thumb'),'defaultValue':_0x4816('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x4816('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4816('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4816('0x6')]},'browserName':{'type':Sequelize[_0x4816('0x6')]},'browserVersion':{'type':Sequelize[_0x4816('0x6')]},'osName':{'type':Sequelize[_0x4816('0x6')]},'osVersion':{'type':Sequelize[_0x4816('0x6')]},'deviceModel':{'type':Sequelize[_0x4816('0x6')]},'deviceVendor':{'type':Sequelize[_0x4816('0x6')]},'deviceType':{'type':Sequelize[_0x4816('0x6')]},'referer':{'type':Sequelize[_0x4816('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4816('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x4816('0x7')]},'lastMsgAt':{'type':Sequelize[_0x4816('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4816('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4816('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc6fe=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x1ccd0e,_0xc60792){var _0x2ebe72=function(_0xbbf360){while(--_0xbbf360){_0x1ccd0e['push'](_0x1ccd0e['shift']());}};_0x2ebe72(++_0xc60792);}(_0xc6fe,0xbc));var _0xec6f=function(_0x29bd39,_0x14d7f0){_0x29bd39=_0x29bd39-0x0;var _0x23e057=_0xc6fe[_0x29bd39];return _0x23e057;};'use strict';var Sequelize=require(_0xec6f('0x0'));module[_0xec6f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xec6f('0x2')]},'ratingType':{'type':Sequelize[_0xec6f('0x3')](_0xec6f('0x4'),'thumb'),'defaultValue':_0xec6f('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xec6f('0x5')]},'mailTranscript':{'type':Sequelize[_0xec6f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xec6f('0x7')]},'disposition':{'type':Sequelize[_0xec6f('0x6')]},'secondDisposition':{'type':Sequelize[_0xec6f('0x6')]},'thirdDisposition':{'type':Sequelize[_0xec6f('0x6')]},'note':{'type':Sequelize[_0xec6f('0x6')]},'browserName':{'type':Sequelize[_0xec6f('0x6')]},'browserVersion':{'type':Sequelize[_0xec6f('0x6')]},'osName':{'type':Sequelize[_0xec6f('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xec6f('0x6')]},'deviceVendor':{'type':Sequelize[_0xec6f('0x6')]},'deviceType':{'type':Sequelize[_0xec6f('0x6')]},'referer':{'type':Sequelize[_0xec6f('0x5')]},'customerIp':{'type':Sequelize[_0xec6f('0x6')]},'formData':{'type':Sequelize[_0xec6f('0x5')](_0xec6f('0x8'))},'read1stAt':{'type':Sequelize[_0xec6f('0x7')]},'lastMsgAt':{'type':Sequelize[_0xec6f('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xec6f('0x3')]('in',_0xec6f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xec6f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xec6f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xec6f('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 3f93bf9..da51798 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 _0x955f=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','ChatInteractionId','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','attachmentUpload','originalname','file','mimetype','attachmentDownload','findOne','closed','Unauthorized','Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','includeAgent','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','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','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x54a392,_0x28d6e2){var _0x4d9ed2=function(_0x3e0dd5){while(--_0x3e0dd5){_0x54a392['push'](_0x54a392['shift']());}};_0x4d9ed2(++_0x28d6e2);}(_0x955f,0x1eb));var _0xf955=function(_0x5c81d7,_0x58a8c2){_0x5c81d7=_0x5c81d7-0x0;var _0x490fb7=_0x955f[_0x5c81d7];return _0x490fb7;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf955('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf955('0x13'))(_0xf955('0x14'));var utils=require(_0xf955('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf955('0x16'));var db=require('../../mysqldb')['db'];config[_0xf955('0x17')]=_['defaults'](config[_0xf955('0x17')],{'host':_0xf955('0x18'),'port':0x18eb});var socket=require(_0xf955('0x19'))(new Redis(config[_0xf955('0x17')]));require(_0xf955('0x1a'))[_0xf955('0x1b')](socket);var jayson=require(_0xf955('0x1c'));var client=jayson[_0xf955('0x1d')][_0xf955('0x1e')]({'port':0x232b});var client9004=jayson[_0xf955('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc29b35,_0x54e60b,_0x3139d5,_0x3a814f){return new BPromise(function(_0x2f881b,_0x15c07c){var _0x50930d=_0x3a814f||client;return _0x50930d['request'](_0xc29b35,_0x3139d5)[_0xf955('0x1f')](function(_0xe6de5c){logger[_0xf955('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xf955('0x21'));logger[_0xf955('0x22')](_0xf955('0x23'),_0x54e60b,_0xf955('0x21'),JSON[_0xf955('0x24')](_0xe6de5c));if(_0xe6de5c['error']){if(_0xe6de5c[_0xf955('0x25')][_0xf955('0x26')]===0x1f4){logger[_0xf955('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x15c07c(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x2f881b(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}else{logger[_0xf955('0x20')](_0xf955('0x28'),_0x54e60b,_0xf955('0x21'));_0x2f881b(_0xe6de5c[_0xf955('0x29')][_0xf955('0x27')]);}})['catch'](function(_0x18f435){logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0x18f435);_0x15c07c(_0x18f435);});});}function respondWithStatusCode(_0x406632,_0x2dcd55){_0x2dcd55=_0x2dcd55||0xcc;return function(_0x13a86d){if(_0x13a86d){return _0x406632[_0xf955('0x2a')](_0x2dcd55);}return _0x406632['status'](_0x2dcd55)[_0xf955('0x2b')]();};}function respondWithResult(_0x145098,_0x41c9f6){_0x41c9f6=_0x41c9f6||0xc8;return function(_0xbd0b74){if(_0xbd0b74){return _0x145098[_0xf955('0x2c')](_0x41c9f6)[_0xf955('0x2d')](_0xbd0b74);}};}function respondWithFilteredResult(_0x4d4af0,_0x2232a7){return function(_0x1e5d37){if(_0x1e5d37){var _0x4ec3e8=typeof _0x2232a7[_0xf955('0x2e')]===_0xf955('0x2f')&&typeof _0x2232a7[_0xf955('0x30')]===_0xf955('0x2f');var _0x59bfb5=_0x1e5d37[_0xf955('0x31')];var _0x518fb3=_0x4ec3e8?0x0:_0x2232a7[_0xf955('0x2e')];var _0x2c222a=_0x4ec3e8?_0x1e5d37[_0xf955('0x31')]:_0x2232a7[_0xf955('0x2e')]+_0x2232a7[_0xf955('0x30')];var _0x32121b;if(_0x2c222a>=_0x59bfb5){_0x2c222a=_0x59bfb5;_0x32121b=0xc8;}else{_0x32121b=0xce;}_0x4d4af0[_0xf955('0x2c')](_0x32121b);return _0x4d4af0[_0xf955('0x32')]('Content-Range',_0x518fb3+'-'+_0x2c222a+'/'+_0x59bfb5)[_0xf955('0x2d')](_0x1e5d37);}return null;};}function patchUpdates(_0x165cc4){return function(_0x3964d3){try{jsonpatch[_0xf955('0x33')](_0x3964d3,_0x165cc4,!![]);}catch(_0x4fea0c){return BPromise[_0xf955('0x34')](_0x4fea0c);}return _0x3964d3[_0xf955('0x35')]();};}function saveUpdates(_0x3c81bc,_0xe1b436){return function(_0xdbc53e){if(_0xdbc53e){return _0xdbc53e['update'](_0x3c81bc)['then'](function(_0x5480db){return _0x5480db;});}return null;};}function removeEntity(_0x2626cb,_0x3783dc){return function(_0x374e95){if(_0x374e95){return _0x374e95[_0xf955('0x36')]()[_0xf955('0x1f')](function(){_0x2626cb[_0xf955('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acc4b,_0x515dc6){return function(_0x8f842f){if(!_0x8f842f){_0x3acc4b[_0xf955('0x2a')](0x194);}return _0x8f842f;};}function handleError(_0xe33ef2,_0x51762d){_0x51762d=_0x51762d||0x1f4;return function(_0x60a421){logger['error'](_0x60a421[_0xf955('0x37')]);if(_0x60a421[_0xf955('0x38')]){delete _0x60a421[_0xf955('0x38')];}_0xe33ef2[_0xf955('0x2c')](_0x51762d)['send'](_0x60a421);};}function getMustacheRender(_0xf35170,_0x118c92){return Mustache['render'](_0xf35170,_[_0xf955('0x39')](_0x118c92[_0xf955('0x3a')],{'contact':_0x118c92[_0xf955('0x3b')],'message':_0x118c92['message'],'agent':_0x118c92[_0xf955('0x3c')],'interaction':_0x118c92[_0xf955('0x3d')],'account':_0x118c92[_0xf955('0x3e')]}))||'';}function getInteractionUsers(_0x488b6e,_0x97e8ff){return new BPromise(function(_0x195faa,_0x21e4a6){try{if(_0x97e8ff[_0x488b6e['id']]){_0x488b6e[_0xf955('0x3f')]=_[_0xf955('0x40')](_0x97e8ff[_0x488b6e['id']],function(_0x3c4b29){return{'id':_0x3c4b29['id'],'fullname':_0x3c4b29[_0xf955('0x41')]};});}}catch(_0x228dae){_0x21e4a6(_0x228dae);}_0x195faa(_0x488b6e);});}function getInteractionTags(_0x5671c7,_0x8fa41b){return new BPromise(function(_0x7123c1,_0x2aacdf){try{if(_0x5671c7[_0xf955('0x42')]){_0x5671c7[_0xf955('0x43')]=[];_0x5671c7[_0xf955('0x42')][_0xf955('0x44')](',')[_0xf955('0x45')](function(_0x47651b){_0x5671c7[_0xf955('0x43')][_0xf955('0x46')](_0x8fa41b[_0x47651b]);});}delete _0x5671c7[_0xf955('0x42')];}catch(_0x40d7e9){_0x2aacdf(_0x40d7e9);}_0x7123c1(_0x5671c7);});}function updateChatInteraction(_0x159ae3,_0x3557b5,_0x248f60){return new BPromise(function(_0x356ec2,_0x34f0f1){return getInteractionUsers(_0x159ae3,_0x248f60)[_0xf955('0x1f')](function(_0x5dd300){return getInteractionTags(_0x5dd300,_0x3557b5);})[_0xf955('0x1f')](function(_0x25d809){_0x356ec2(_0x25d809);})[_0xf955('0x47')](function(_0x5f0ef9){_0x34f0f1(_0x5f0ef9);});});}exports[_0xf955('0x48')]=function(_0x485e77,_0x398224){var _0x56a4ca={},_0x103ac2={},_0x24cb74={'count':0x0,'rows':[]};var _0x213136=_[_0xf955('0x40')](db['ChatInteraction'][_0xf955('0x49')],function(_0xdb1cc){return{'name':_0xdb1cc[_0xf955('0x4a')],'type':_0xdb1cc['type']['key']};});_0x103ac2[_0xf955('0x4b')]=_[_0xf955('0x40')](_0x213136,_0xf955('0x38'));_0x103ac2[_0xf955('0x4c')]=_['keys'](_0x485e77[_0xf955('0x4c')]);_0x103ac2[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x103ac2['model'],_0x103ac2[_0xf955('0x4c')]);_0x56a4ca['attributes']=_[_0xf955('0x4e')](_0x103ac2[_0xf955('0x4b')],qs[_0xf955('0x4f')](_0x485e77['query'][_0xf955('0x4f')]));_0x56a4ca[_0xf955('0x50')]=_0x56a4ca[_0xf955('0x50')][_0xf955('0x51')]?_0x56a4ca['attributes']:_0x103ac2[_0xf955('0x4b')];if(!_0x485e77[_0xf955('0x4c')][_0xf955('0x52')](_0xf955('0x53'))){_0x56a4ca[_0xf955('0x30')]=qs['limit'](_0x485e77[_0xf955('0x4c')]['limit']);_0x56a4ca[_0xf955('0x2e')]=qs['offset'](_0x485e77[_0xf955('0x4c')]['offset']);}_0x56a4ca['order']=qs[_0xf955('0x54')](_0x485e77[_0xf955('0x4c')]['sort']);_0x56a4ca[_0xf955('0x55')]=qs['filters'](_['pick'](_0x485e77['query'],_0x103ac2['filters']),_0x213136);var _0x3c37e2=[];var _0x1abe1c=squel['select']()['field']('id')[_0xf955('0x56')](_0xf955('0x38'))[_0xf955('0x56')](_0xf955('0x57'))[_0xf955('0x58')](_0xf955('0x59'));var _0x190500=squel[_0xf955('0x5a')]()[_0xf955('0x56')](_0xf955('0x5b'))[_0xf955('0x56')](_0xf955('0x5c'))['field'](_0xf955('0x5d'))[_0xf955('0x58')](_0xf955('0x5e'),'ui')[_0xf955('0x5f')](_0xf955('0x60'),'u','u.id\x20=\x20ui.UserId');var _0xf5d575=squel[_0xf955('0x5a')]()[_0xf955('0x58')](_0xf955('0x61'),'i')[_0xf955('0x5f')](_0xf955('0x62'),'c',_0xf955('0x63'))[_0xf955('0x5f')](_0xf955('0x60'),'o',_0xf955('0x64'))['left_join'](_0xf955('0x65'),'a',_0xf955('0x66'))[_0xf955('0x5f')](_0xf955('0x67'),'me',_0xf955('0x68'))[_0xf955('0x5f')](_0xf955('0x69'),'it',_0xf955('0x6a'))[_0xf955('0x5f')](_0xf955('0x59'),'t',_0xf955('0x6b'));var _0x2b8173=squel['expr']();var _0x1388a0=[];var _0x452de9=squel[_0xf955('0x6c')]();var _0x3eb727;if(_0x485e77[_0xf955('0x4c')][_0xf955('0x6d')]){_0x3eb727=as[_0xf955('0x6e')](_0x485e77['query']['search']);var _0x5e73ff=_0x3eb727[_0xf955('0x6f')];for(var _0x530ec7=0x0;_0x530ec7<_0x3eb727['conditions'][_0xf955('0x51')];_0x530ec7++){var _0x533e0f=_0x3eb727[_0xf955('0x70')][_0x530ec7];var _0x3fa5b5='i';var _0x158469=_[_0xf955('0x71')](_0x213136,['name',_0x533e0f[_0xf955('0x56')]]);if(!_0x158469){switch(_0x533e0f[_0xf955('0x56')]){case _0xf955('0x72'):if(_0x533e0f[_0xf955('0x73')]==0x1){_0xf5d575[_0xf955('0x74')]('`'+_0x533e0f['field']+_0xf955('0x75'));}else{_0xf5d575['having']('`'+_0x533e0f[_0xf955('0x56')]+_0xf955('0x76'));}break;case _0xf955('0x77'):if(_0x533e0f['operator']===_0xf955('0x78')){if(_0x533e0f[_0xf955('0x73')][_0xf955('0x44')]('\x20')[_0xf955('0x51')]>0x1){_0x2b8173[_0x5e73ff](_0xf955('0x79'),qs[_0xf955('0x7a')](_0x533e0f[_0xf955('0x73')]),null);}else{var _0x47e5de='%'+_0x533e0f['value']+'%';_0x2b8173[_0x5e73ff](_0xf955('0x7b'),_0x47e5de,_0x47e5de,_0x47e5de);}}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x7c')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x7c');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}break;case'Tag':var _0x431729=_0x533e0f['value']['split'](',')[_0xf955('0x40')](function(_0x20f11c){return Number(_0x20f11c);});_0x431729['forEach'](function(_0x1e95c3){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x1e95c3+',%');});_0x1388a0=_['union'](_0x1388a0,_0x431729);break;case'User':if(_0x533e0f[_0xf955('0x82')]===_0xf955('0x78')){_0x2b8173[_0x5e73ff](_0xf955('0x83'),'%'+_0x533e0f['value']+'%',null);}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x84')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x84');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2['value'][_0xf955('0x80')],_0x4b85c2[_0xf955('0x73')]['end']);}break;case _0xf955('0x3a'):_0x4b85c2=as[_0xf955('0x7d')]('me',null,_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')]['start'],_0x4b85c2[_0xf955('0x73')][_0xf955('0x2b')]);break;}}else{var _0x4b85c2=as['buildExpression'](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}}}else{var _0x430571=_(_0x485e77[_0xf955('0x4c')])[_0xf955('0x85')]()[_0xf955('0x40')](function(_0x3e9c6e){return _[_0xf955('0x86')](_0x213136,[_0xf955('0x38'),_0x3e9c6e])?_0x3e9c6e:undefined;})[_0xf955('0x87')]()[_0xf955('0x73')]();if(!_[_0xf955('0x88')](_0x430571)){_0x430571[_0xf955('0x45')](function(_0x4254a2){if(_0x4254a2==='ChatWebsiteId'){_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),[][_0xf955('0x8a')](_0x485e77[_0xf955('0x4c')][_0x4254a2]));}else if(_0x4254a2==='createdAt'){var _0xcf6900=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8c')];var _0x2b266d=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8d')];_0xf5d575[_0xf955('0x55')](_0xf955('0x8e'),_0xcf6900,_0x2b266d);}else{if(_0x485e77[_0xf955('0x4c')][_0x4254a2]==='null'){_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x8f'));}else{_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x90'),_0x485e77[_0xf955('0x4c')][_0x4254a2]);}}});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x91')]){if(_0x485e77['query'][_0xf955('0x91')]==0x1){_0xf5d575['having'](_0xf955('0x92'));}else{_0xf5d575['having'](_0xf955('0x93'));}}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]){_0x1388a0=_[_0xf955('0x95')](_0x485e77[_0xf955('0x4c')][_0xf955('0x94')])?_0x485e77['query'][_0xf955('0x94')]:new Array(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]);_0x1388a0['forEach'](function(_0x526346){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x526346+',%');});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x96')]){var _0x595d60=_0x485e77[_0xf955('0x4c')]['filter'][_0xf955('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf955('0x98')](_0x595d60)){_0x2b8173['or'](_0xf955('0x99'),_0x595d60+'%');}else{_0x2b8173['or'](_0xf955('0x9a'),qs['getFullTextValue'](_0x595d60))['or'](_0xf955('0x9b'),_0x595d60+'%');}}}_0xf5d575[_0xf955('0x55')](_0x2b8173);_0xf5d575[_0xf955('0x9c')]('i.id');var _0xba62d0={'type':db[_0xf955('0x9d')][_0xf955('0x9e')][_0xf955('0x9f')],'raw':!![]};var _0x419da5=_0xf5d575[_0xf955('0xa0')]();_0x419da5[_0xf955('0x56')]('i.id');_0x419da5[_0xf955('0x56')](_0xf955('0xa1'),_0xf955('0x72'));if(_0x56a4ca[_0xf955('0xa2')]){_0x56a4ca[_0xf955('0xa2')]['forEach'](function(_0x15c3e1){var _0x23f90c=_0x15c3e1[0x0]==='contactName'?_0x15c3e1[0x0]:'i.'+_0x15c3e1[0x0];_0xf5d575['order'](_0x23f90c,_0x15c3e1[0x1]===_0xf955('0xa3')?![]:!![]);});}if(!_[_0xf955('0x88')](_0x1388a0)){_0xf5d575[_0xf955('0x74')](_0x452de9);_0x419da5[_0xf955('0x55')]('t.id\x20IN\x20?',_0x1388a0);}BPromise[_0xf955('0xa4')]()['then'](function(){if(!_0x3eb727){if(_0x485e77['query'][_0xf955('0xa5')])return;_0x419da5[_0xf955('0x55')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xf5d575['where'](_0xf955('0xa6'));return;}if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]!=='agent')return;return _0x485e77['user'][_0xf955('0xa9')]({'attributes':['id'],'raw':!![]})[_0xf955('0x1f')](function(_0x15fc7e){if(_['isEmpty'](_0x15fc7e)){_0x419da5['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xf5d575['where'](_0xf955('0xaa'));}else{_0x419da5['where'](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));}});})['then'](function(){if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]===_0xf955('0x3c')&&!_0x3eb727&&!_0x485e77[_0xf955('0x4c')]['ChatWebsiteId'])return[];return db[_0xf955('0xab')][_0xf955('0x4c')](_0x419da5['toString'](),_0xba62d0);})[_0xf955('0x1f')](function(_0x1819f6){_0x24cb74[_0xf955('0x31')]=_0x1819f6[_0xf955('0x51')];if(_0x24cb74[_0xf955('0x31')]===0x0)return[];return db[_0xf955('0xab')]['query'](_0x1abe1c['toString'](),_0xba62d0)[_0xf955('0x1f')](function(_0x545275){_0x3c37e2=_[_0xf955('0xac')](_0x545275,'id');_0xba62d0=_[_0xf955('0x39')](_0xba62d0,{'model':db[_0xf955('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x485e77[_0xf955('0x4c')]['fields']){_0x56a4ca['attributes'][_0xf955('0x45')](function(_0x12b9f8){_0xf5d575[_0xf955('0x56')]('i.'+_0x12b9f8);});}else{_0xf5d575[_0xf955('0x56')](_0xf955('0xa1'),'unreadMessages');_0xf5d575[_0xf955('0x56')](_0xf955('0xae'),_0xf955('0xaf'));_0xf5d575[_0xf955('0x56')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xf5d575[_0xf955('0x56')](_0xf955('0xb0'),'contactName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb1'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb2'),'Contact.firstName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb3'),_0xf955('0xb4'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb5'),_0xf955('0xb6'));_0xf5d575[_0xf955('0x56')]('c.phone','Contact.phone');_0xf5d575['field'](_0xf955('0xb7'),_0xf955('0xb8'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb9'),_0xf955('0xba'));_0xf5d575[_0xf955('0x56')](_0xf955('0xbb'),'Owner.fullname');_0xf5d575[_0xf955('0x56')](_0xf955('0xbc'),'Owner.internal');_0xf5d575[_0xf955('0x56')](_0xf955('0xbd'),_0xf955('0x42'));}if(_0x56a4ca[_0xf955('0x30')])_0xf5d575[_0xf955('0x30')](_0x56a4ca[_0xf955('0x30')]);if(_0x56a4ca[_0xf955('0x2e')])_0xf5d575[_0xf955('0x2e')](_0x56a4ca['offset']);return db['sequelize']['query'](_0xf5d575[_0xf955('0xbe')](),_0xba62d0);})[_0xf955('0x1f')](function(_0x210666){if(_0x210666[_0xf955('0x51')]>0x0)_0x190500[_0xf955('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0xf955('0x40')](_0x210666,'id'));return db[_0xf955('0xab')][_0xf955('0x4c')](_0x190500[_0xf955('0xbe')](),_0xba62d0)[_0xf955('0x1f')](function(_0x36731b){var _0x11f6f8=_[_0xf955('0xbf')](_0x36731b,_0xf955('0xc0'));var _0x4a71e5=[];_0x210666[_0xf955('0x45')](function(_0x47daca){_0x4a71e5[_0xf955('0x46')](updateChatInteraction(_0x47daca,_0x3c37e2,_0x11f6f8));});return BPromise[_0xf955('0xc1')](_0x4a71e5);});});})[_0xf955('0x1f')](function(_0x427ab9){_0x24cb74[_0xf955('0xc2')]=_0x427ab9;return _0x24cb74;})[_0xf955('0x1f')](respondWithFilteredResult(_0x398224,_0x56a4ca))[_0xf955('0x47')](handleError(_0x398224,null));};exports['show']=function(_0x1ef189,_0x4bb590){var _0x222df2={'raw':![],'where':{'id':_0x1ef189['params']['id']}},_0x40d7c7={};_0x40d7c7[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xad')][_0xf955('0x49')]);_0x40d7c7[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x1ef189[_0xf955('0x4c')]);_0x40d7c7['filters']=_[_0xf955('0x4e')](_0x40d7c7[_0xf955('0x4b')],_0x40d7c7['query']);_0x222df2[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x40d7c7['model'],qs['fields'](_0x1ef189[_0xf955('0x4c')][_0xf955('0x4f')]));_0x222df2[_0xf955('0x50')]=_0x222df2['attributes'][_0xf955('0x51')]?_0x222df2[_0xf955('0x50')]:_0x40d7c7[_0xf955('0x4b')];if(_0x1ef189[_0xf955('0x4c')][_0xf955('0xc3')]){_0x222df2[_0xf955('0xc4')]=[{'all':!![]}];}_0x222df2=_[_0xf955('0x39')]({},_0x222df2,_0x1ef189[_0xf955('0xc5')]);return db[_0xf955('0xad')][_0xf955('0x71')](_0x222df2)[_0xf955('0x1f')](handleEntityNotFound(_0x4bb590,null))[_0xf955('0x1f')](respondWithResult(_0x4bb590,null))[_0xf955('0x47')](handleError(_0x4bb590,null));};exports[_0xf955('0xc6')]=function(_0x490981,_0x58464d){return db[_0xf955('0xad')][_0xf955('0xc6')](_0x490981[_0xf955('0x3a')],{})[_0xf955('0x1f')](respondWithResult(_0x58464d,0xc9))[_0xf955('0x47')](handleError(_0x58464d,null));};exports['update']=function(_0x161d06,_0x3bab0d){if(_0x161d06['body']['id']){delete _0x161d06[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x161d06[_0xf955('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3bab0d,null))[_0xf955('0x1f')](saveUpdates(_0x161d06['body'],null))[_0xf955('0x1f')](respondWithResult(_0x3bab0d,null))[_0xf955('0x47')](handleError(_0x3bab0d,null));};exports[_0xf955('0x36')]=function(_0xe9f9a8,_0x5aff59){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0xe9f9a8[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x5aff59,null))[_0xf955('0x1f')](removeEntity(_0x5aff59,null))['catch'](handleError(_0x5aff59,null));};exports[_0xf955('0xc8')]=function(_0x1f38db,_0x395013){return db['ChatInteraction'][_0xf955('0xc8')]()[_0xf955('0x1f')](respondWithResult(_0x395013,null))[_0xf955('0x47')](handleError(_0x395013,null));};exports[_0xf955('0xc9')]=function(_0x19665c,_0x437020){var _0x12d158=_0x19665c['params']['id'];var _0x5a6abe;var _0x4e3013;var _0x345a7c;return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x12d158}})[_0xf955('0x1f')](function(_0x42ba43){_0x5a6abe=_0x42ba43;return db[_0xf955('0xca')]['findOne']({'where':{'id':_0x42ba43[_0xf955('0xa5')]},'attributes':['id',_0xf955('0xcb'),'vidaooEscalation','vidaooTopic',_0xf955('0xcc'),_0xf955('0xcd')],'raw':!![]});})[_0xf955('0x1f')](function(_0x30baa1){if(_0x30baa1&&_0x30baa1[_0xf955('0xcb')]&&_0x30baa1['vidaooEscalation']){_0x4e3013=_0x30baa1;var _0xc881d4={'interaction':{'id':_0x12d158},'agent':{'id':_0x19665c[_0xf955('0xa7')]['id'],'name':_0x19665c[_0xf955('0xa7')][_0xf955('0x38')],'fullname':_0x19665c[_0xf955('0xa7')]['fullname'],'email':_0x19665c[_0xf955('0xa7')][_0xf955('0xce')]},'contact':_0x19665c[_0xf955('0x3a')][_0xf955('0x3b')],'account':_0x19665c['body'][_0xf955('0x3e')]};var _0x410d1f={'rejectUnauthorized':![],'method':_0xf955('0xcf'),'url':_0xf955('0xd0'),'headers':{'X-APIKEY':_0x30baa1[_0xf955('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x19665c['user'][_0xf955('0xce')]],'buttons':null,'topic':_0x4e3013[_0xf955('0xd1')],'note':_['isNull'](_0x4e3013[_0xf955('0xcc')])?null:getMustacheRender(_0x4e3013[_0xf955('0xcc')],_0xc881d4),'metadata':null},'redirect':_0xf955('0xd2'),'json':!![]};try{if(!_[_0xf955('0xd3')](_0x4e3013[_0xf955('0xcd')])){var _0x38e031=getMustacheRender(_0x4e3013[_0xf955('0xcd')],_0xc881d4);var _0x4f53ef=JSON[_0xf955('0x8b')](_0x38e031);_0x410d1f[_0xf955('0x3a')]['metadata']=_0x4f53ef;}}catch(_0x5395aa){throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xd5'));}return rp(_0x410d1f);}else{throw new db[(_0xf955('0x9d'))]['ValidationError'](_0xf955('0xd6'));}})[_0xf955('0x1f')](function(_0x57e0d7){_0x345a7c=_0x57e0d7;if(_0x345a7c['id']){var _0x54903a={'body':_0x345a7c[_0xf955('0xd7')],'ChatWebsiteId':_0x4e3013['id'],'ChatInteractionId':_0x5a6abe['id'],'direction':_0xf955('0xd8'),'UserId':_0x19665c[_0xf955('0xa7')]['id']};return db[_0xf955('0xd9')]['create'](_0x54903a,{});}else{throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xda'));}})[_0xf955('0x1f')](function(){return _0x5a6abe[_0xf955('0xdb')]({'vidaooSessionId':_0x345a7c['id']});})[_0xf955('0x1f')](respondWithResult(_0x437020,null))[_0xf955('0x47')](handleError(_0x437020,null));};exports[_0xf955('0xdc')]=function(_0x4c7a54,_0xde084e){if(_0x4c7a54[_0xf955('0x3a')]['id']){delete _0x4c7a54[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x4c7a54[_0xf955('0xc7')]['id']},'include':[{'model':db[_0xf955('0xdd')],'as':_0xf955('0x77')}]})[_0xf955('0x1f')](handleEntityNotFound(_0xde084e,null))[_0xf955('0x1f')](saveUpdates(_0x4c7a54['body'],null))[_0xf955('0x1f')](respondWithResult(_0xde084e,null))[_0xf955('0x47')](handleError(_0xde084e,null));};exports[_0xf955('0xde')]=function(_0x27391f,_0x269ae2,_0x3250df){if(_0x27391f[_0xf955('0x3a')]['id']){delete _0x27391f['body']['id'];}return db[_0xf955('0xad')]['find']({'where':{'id':_0x27391f[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](function(_0x14cde9){if(!_0x14cde9){logger[_0xf955('0x25')](_0xf955('0xdf'),_0xf955('0xde'),0x194,_0xf955('0xe0'));_0x269ae2[_0xf955('0x2a')](0x194);}else{if(_0x14cde9[_0xf955('0x84')]){throw new db['Sequelize'][(_0xf955('0xd4'))](_0xf955('0xe1'));}}return _0x14cde9;})[_0xf955('0x1f')](function(_0x3d5c15){if(_0x3d5c15){return _0x3d5c15[_0xf955('0xe2')]({'closed':_0x27391f[_0xf955('0x3a')]['closed'],'disposition':_0x27391f[_0xf955('0x3a')][_0xf955('0xe3')]})[_0xf955('0x1f')](function(_0x5c8a3f){return _0x5c8a3f;});}})[_0xf955('0x1f')](function(_0x471223){return respondWithRpcPromise(_0xf955('0xe4'),_0xf955('0xde'),_0x27391f[_0xf955('0x3a')],client9004);})[_0xf955('0x1f')](respondWithResult(_0x269ae2,null))['catch'](handleError(_0x269ae2,null));};exports[_0xf955('0xe5')]=function(_0x4775bd,_0x2a862f,_0x42e3eb){_0x4775bd[_0xf955('0x3a')][_0xf955('0x38')]=_0x4775bd['file'][_0xf955('0xe6')];_0x4775bd['body']['basename']=_0x4775bd['file']['filename'];_0x4775bd[_0xf955('0x3a')]['type']=_0x4775bd[_0xf955('0xe7')][_0xf955('0xe8')];return db['Attachment'][_0xf955('0xc6')](_0x4775bd['body'])[_0xf955('0x1f')](respondWithResult(_0x2a862f,0xc9))['catch'](handleError(_0x2a862f,null));};exports[_0xf955('0xe9')]=function(_0x267963,_0x28ce39,_0x43a5c3){return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0x267963['params']['id']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null))[_0xf955('0x1f')](function(_0x30fd01){if(_0x30fd01){if(_0x30fd01[_0xf955('0xeb')]){return _0x28ce39[_0xf955('0x2c')](0x193)[_0xf955('0x2d')]({'status':0x193,'message':_0xf955('0xec')});}return db[_0xf955('0xed')][_0xf955('0xea')]({'where':{'id':_0x267963[_0xf955('0x4c')]['attachId']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null));}})[_0xf955('0x1f')](function(_0x444e24){if(_0x444e24){var _0x2fb11a=_0x444e24[_0xf955('0xee')]!==null;var _0x2ce35c=path[_0xf955('0xef')](config['root'],_0xf955('0xf0'));if(_0x2fb11a){_0x2ce35c=path[_0xf955('0xef')](_0x2ce35c,_0xf955('0xf1'));}var _0x1e35d7=path[_0xf955('0xef')](_0x2ce35c,_0x444e24[_0xf955('0xf2')]);return _0x28ce39[_0xf955('0xf3')](_0x1e35d7);}})[_0xf955('0x47')](handleError(_0x28ce39,null));};exports[_0xf955('0xf4')]=function(_0x38016a,_0x52ad4d){var _0x1620ec=null;var _0x2c8e49=null;var _0x2b3deb=null;var _0x1ae12a=null;if(_0x38016a[_0xf955('0x3a')]['id']){delete _0x38016a[_0xf955('0x3a')]['id'];}if(_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')]){_0x1ae12a=path['join'](config[_0xf955('0xf6')],_0xf955('0xf7'),util[_0xf955('0xf8')](_0xf955('0xf9'),Date[_0xf955('0xfa')]()));_0x38016a[_0xf955('0x3a')][_0xf955('0xfb')]=_0x1ae12a;}return db[_0xf955('0xad')]['find']({'where':{'id':_0x38016a['params']['id']},'include':[{'model':db[_0xf955('0xd9')],'as':_0xf955('0xfc'),'include':[{'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd')}]}]})['then'](handleEntityNotFound(_0x52ad4d,null))['then'](saveUpdates(_0x38016a[_0xf955('0x3a')],null))[_0xf955('0x1f')](function(_0x4860ad){if(_0x4860ad){_0x1620ec=_0x4860ad;return db[_0xf955('0xca')][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0xa5')]}});}})[_0xf955('0x1f')](function(_0x1c0211){if(_0x1c0211){_0x2b3deb=_0x1c0211;return db['CmContact'][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0x7c')]}});}})[_0xf955('0x1f')](function(_0x106640){if(_0x106640){_0x2c8e49=_0x106640;if(_0x1ae12a){var _0x101722=null;for(var _0x479dc0=0x1;_0x479dc0<_0x1620ec[_0xf955('0xfc')]['length'];++_0x479dc0){_0x101722=_0x1620ec[_0xf955('0xfc')][_0x479dc0];var _0x570005=_0x101722[_0xf955('0x84')]?util[_0xf955('0xf8')](_0xf955('0xfe'),_0x2b3deb[_0xf955('0xff')],_0x101722[_0xf955('0x84')]):_0xf955('0x100');var _0x85661f=_0x38016a[_0xf955('0x3a')][_0xf955('0x101')]||util[_0xf955('0xf8')]('%s%d','Visitor',_0x101722[_0xf955('0x7c')]);switch(_0x2b3deb[_0xf955('0x102')]){case _0xf955('0x103'):_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb[_0xf955('0xff')],_0x101722['UserId']):'System';break;case _0xf955('0x104'):_0x570005=_0x101722['UserId']?_0x101722[_0xf955('0xfd')][_0xf955('0x105')]||_0x101722['User']['fullname']:_0xf955('0x100');break;case _0xf955('0x106'):_0x570005=_0x101722[_0xf955('0x84')]?_0x101722[_0xf955('0xfd')][_0xf955('0x41')]:'System';break;default:_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb['agentAlias'],_0x101722[_0xf955('0x84')]):_0xf955('0x100');}var _0x23d382=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x101722[_0xf955('0x107')])['format'](_0xf955('0x108')),_0x101722['direction']==='in'?_0x85661f:_0x570005,_0x101722[_0xf955('0x3a')]);if(!_0x101722[_0xf955('0x109')]){fs['appendFileSync'](_0x1ae12a,_0x23d382);}}return db[_0xf955('0x10a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf955('0x10b')],'as':_0xf955('0x10c'),'raw':!![]}]});}}})[_0xf955('0x1f')](function(_0x1e6165){if(_0x1e6165&&_0x1e6165[_0xf955('0x10c')]&&_0x38016a['body']){var _0x4a6338={'tls':{'rejectUnauthorized':![]}};if(_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')]){_0x4a6338[_0xf955('0x10d')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')];}else{_0x4a6338[_0xf955('0x10e')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10e')];_0x4a6338[_0xf955('0x10f')]=_0x1e6165['Smtp'][_0xf955('0x10f')];_0x4a6338[_0xf955('0x110')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x110')];}if(_0x1e6165[_0xf955('0x10c')]['authentication']){_0x4a6338[_0xf955('0x111')]={'user':_0x1e6165[_0xf955('0x10c')]['user'],'pass':_0x1e6165[_0xf955('0x10c')]['pass']};}return respondWithRpcPromise('SendMail',_0xf955('0x112'),{'account':_0x4a6338,'message':{'from':util[_0xf955('0xf8')](_0xf955('0x113'),_0x1e6165[_0xf955('0x38')],_0x1e6165['email']||_0x1e6165[_0xf955('0x10c')][_0xf955('0xa7')]),'to':_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')],'subject':'Mail\x20Transcript','text':util[_0xf955('0xf8')](_0xf955('0x114'),_0x38016a['body'][_0xf955('0xf5')]),'attachments':[{'path':_0x1ae12a}]}})[_0xf955('0x1f')](function(){return _0x1620ec;})[_0xf955('0x47')](function(_0x50502a){console[_0xf955('0x25')](_0x50502a);});}else{return _0x1620ec;}})[_0xf955('0x1f')](respondWithStatusCode(_0x52ad4d,0xc8))[_0xf955('0x47')](handleError(_0x52ad4d,null));};exports['addMessage']=function(_0x1d2e9c,_0x49718e,_0x5aeba7){return db['ChatMessage'][_0xf955('0x71')]({'where':{'id':_0x1d2e9c[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x49718e,null))[_0xf955('0x1f')](function(_0x10cd8e){if(_0x10cd8e){return _0x10cd8e[_0xf955('0x115')](_0x1d2e9c['body'][_0xf955('0x116')],_[_0xf955('0x117')](_0x1d2e9c[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{});}})[_0xf955('0x1f')](respondWithResult(_0x49718e,null))[_0xf955('0x47')](handleError(_0x49718e,null));};exports[_0xf955('0x118')]=function(_0x287adf,_0x38177d,_0x56a307){var _0x49c6ca={'raw':![],'where':{}};var _0x36f3b3={};var _0x252118={'count':0x0,'rows':[]};return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x287adf['params']['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x38177d,null))['then'](function(_0x1dd4b4){if(_0x1dd4b4){_0x36f3b3[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xd9')]['rawAttributes']);_0x36f3b3[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x287adf[_0xf955('0x4c')]);_0x36f3b3['filters']=_[_0xf955('0x4e')](_0x36f3b3['model'],_0x36f3b3[_0xf955('0x4c')]);_0x49c6ca[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x36f3b3[_0xf955('0x4b')],qs['fields'](_0x287adf[_0xf955('0x4c')][_0xf955('0x4f')]));_0x49c6ca[_0xf955('0x50')]=_0x49c6ca['attributes'][_0xf955('0x51')]?_0x49c6ca['attributes']:_0x36f3b3[_0xf955('0x4b')];if(!_0x287adf['query'][_0xf955('0x52')]('nolimit')){_0x49c6ca[_0xf955('0x30')]=qs['limit'](_0x287adf['query']['limit']);_0x49c6ca[_0xf955('0x2e')]=qs['offset'](_0x287adf['query'][_0xf955('0x2e')]);}_0x49c6ca[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0x287adf[_0xf955('0x4c')][_0xf955('0x54')]);_0x49c6ca[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0x287adf['query'],_0x36f3b3[_0xf955('0x4d')]));_0x49c6ca[_0xf955('0x55')][_0xf955('0xc0')]=_0x1dd4b4['id'];if(_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]){_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca[_0xf955('0x55')],{'$or':_[_0xf955('0x40')](_0x49c6ca['attributes'],function(_0x1d1df4){var _0x1b7a62={};_0x1b7a62[_0x1d1df4]={'$like':'%'+_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x1b7a62;})});}if(_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')]){var _0x547464=_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')][_0xf955('0x44')](',');var _0x280d1c={};_0x280d1c[_0x547464[0x0]]={'$gte':moment(_0x547464[0x1])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca['where'],_0x280d1c);}_0x49c6ca=_['merge']({},_0x49c6ca,_0x287adf['options']);return db[_0xf955('0xd9')][_0xf955('0x31')]({'where':_0x49c6ca[_0xf955('0x55')]})[_0xf955('0x1f')](function(_0x14bed6){_0x252118[_0xf955('0x31')]=_0x14bed6;if(_0x287adf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x49c6ca[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')]['findAll'](_0x49c6ca);})[_0xf955('0x1f')](function(_0x7996b8){_0x252118[_0xf955('0xc2')]=_0x7996b8;return _0x252118;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x38177d,_0x49c6ca))[_0xf955('0x47')](handleError(_0x38177d,null));};exports['getMyMessages']=function(_0xac8cdf,_0x70fa9f,_0x5e650f){var _0x39d911={'where':{}},_0x2fbf0c={},_0x1612e4={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0xac8cdf[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x70fa9f,null))[_0xf955('0x1f')](function(_0x1a7da8){if(_0x1a7da8){_0x2fbf0c[_0xf955('0x4b')]=_[_0xf955('0x85')](db['ChatMessage'][_0xf955('0x49')]);_0x2fbf0c['query']=_['keys'](_0xac8cdf['query']);_0x2fbf0c[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],_0x2fbf0c[_0xf955('0x4c')]);_0x39d911[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],qs['fields'](_0xac8cdf['query'][_0xf955('0x4f')]));_0x39d911[_0xf955('0x50')]=_0x39d911['attributes']['length']?_0x39d911[_0xf955('0x50')]:_0x2fbf0c[_0xf955('0x4b')];if(!_0xac8cdf[_0xf955('0x4c')]['hasOwnProperty']('nolimit')){_0x39d911[_0xf955('0x30')]=qs[_0xf955('0x30')](_0xac8cdf[_0xf955('0x4c')][_0xf955('0x30')]);_0x39d911[_0xf955('0x2e')]=qs['offset'](_0xac8cdf['query'][_0xf955('0x2e')]);}_0x39d911[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0xac8cdf[_0xf955('0x4c')]['sort']);_0x39d911[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0xac8cdf[_0xf955('0x4c')],_0x2fbf0c[_0xf955('0x4d')]));_0x39d911[_0xf955('0x55')]['ChatInteractionId']=_0x1a7da8['id'];if(_0xac8cdf['query'][_0xf955('0x96')]){_0x39d911['where']=_[_0xf955('0x39')](_0x39d911[_0xf955('0x55')],{'$or':_['map'](_0x39d911['attributes'],function(_0x4a3d8c){var _0x170ea7={};_0x170ea7[_0x4a3d8c]={'$like':'%'+_0xac8cdf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x170ea7;})});}_0x39d911[_0xf955('0x55')][_0xf955('0x109')]=![];if(_0xac8cdf[_0xf955('0x4c')]['id']){_0x39d911[_0xf955('0x55')]['id']={'$gt':_0xac8cdf[_0xf955('0x4c')]['id']};}_0x39d911=_[_0xf955('0x39')]({},_0x39d911,_0xac8cdf['options']);return db[_0xf955('0xd9')]['count']({'where':_0x39d911['where']})[_0xf955('0x1f')](function(_0x36327c){_0x1612e4[_0xf955('0x31')]=_0x36327c;_0x39d911[_0xf955('0xc4')]=[];if(_0xac8cdf['query'][_0xf955('0x11a')]){_0x39d911['include'][_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd'),'attributes':['id',_0xf955('0x41'),'alias']});}if(_0xac8cdf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x39d911[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')][_0xf955('0x11b')](_0x39d911);})[_0xf955('0x1f')](function(_0x3e4239){_0x1612e4[_0xf955('0xc2')]=_0x3e4239;return _0x1612e4;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x70fa9f,_0x39d911))['catch'](handleError(_0x70fa9f,null));};exports[_0xf955('0x11c')]=function(_0x11a228,_0x2d37c2,_0x932b98){return db[_0xf955('0xad')]['find']({'where':{'id':_0x11a228[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x2d37c2,null))[_0xf955('0x1f')](function(_0x147f3c){if(_0x147f3c){return _0x147f3c[_0xf955('0x11d')](_0x11a228[_0xf955('0x3a')]['ids'],_[_0xf955('0x117')](_0x11a228[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{})[_0xf955('0x11e')](function(){return db[_0xf955('0x11f')]['findAll']({'attributes':['id',_0xf955('0x38'),_0xf955('0x57')],'where':{'id':_0x11a228[_0xf955('0x3a')]['ids']}});})[_0xf955('0x1f')](function(_0xfcaf21){socket['emit'](_0xf955('0x120'),{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]});return{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]};});}})[_0xf955('0x1f')](respondWithResult(_0x2d37c2,null))[_0xf955('0x47')](handleError(_0x2d37c2,null));};exports['removeTags']=function(_0x572efd,_0x357dbc,_0x2b9880){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x572efd[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x357dbc,null))['then'](function(_0x23968f){if(_0x23968f){return _0x23968f[_0xf955('0x121')](_0x572efd[_0xf955('0x4c')][_0xf955('0x116')]);}})['then'](respondWithStatusCode(_0x357dbc,null))[_0xf955('0x47')](handleError(_0x357dbc,null));};exports[_0xf955('0xf3')]=function(_0x3842e1,_0x204e4e){var _0x47b877=moment()[_0xf955('0x122')]()[_0xf955('0xbe')]();var _0x1624e9=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),'tmp');var _0x3ccc35=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),_0xf955('0x125'));var _0x72b500=path[_0xf955('0xef')](_0x1624e9,_0x47b877);var _0x1d4aa6=util[_0xf955('0xf8')](_0xf955('0x126'),_0x3842e1[_0xf955('0xc7')]['id'],_0x47b877);var _0x4896ae=path[_0xf955('0xef')](_0x1624e9,_0x1d4aa6);var _0x3b67e3=[];_0x3b67e3[_0xf955('0x46')]({'model':db['User'],'as':_0xf955('0xfd'),'attributes':['id','fullname'],'raw':!![]});_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xdd')],'as':_0xf955('0x77'),'attributes':['id',_0xf955('0x127'),'lastName'],'raw':!![]});if(_0x3842e1['query']['attachments']){_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xed')],'as':_0xf955('0xed'),'raw':!![]});}var _0x21b589=[{'model':db[_0xf955('0xd9')],'as':'Messages','attributes':['id',_0xf955('0x3a'),_0xf955('0x107'),_0xf955('0x128'),_0xf955('0x109'),'read'],'include':_0x3b67e3}];_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xca')],'as':_0xf955('0x129'),'attributes':['id',_0xf955('0x38')]});_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':'Owner','attributes':['id',_0xf955('0x41')]});return db['ChatInteraction'][_0xf955('0x71')]({'where':{'id':_0x3842e1['params']['id']},'include':_0x21b589})[_0xf955('0x1f')](handleEntityNotFound(_0x204e4e,null))[_0xf955('0x1f')](function(_0x1ed31c){if(_0x1ed31c){var _0x2e8dc2=_0x1ed31c[_0xf955('0x12a')]({'plain':!![]});fs[_0xf955('0x12b')](_0x72b500);var _0x58b727={'channel':_0xf955('0x12c'),'account':_0x2e8dc2[_0xf955('0x129')][_0xf955('0x38')],'agent':_0x2e8dc2[_0xf955('0x12d')]?_0x2e8dc2[_0xf955('0x12d')][_0xf955('0x41')]:_0xf955('0x12e'),'createdAt':moment(_0x2e8dc2['createdAt'])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')](),'closedAt':_0x2e8dc2['closed']?moment(_0x2e8dc2[_0xf955('0x12f')])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')]():'','disposition':_0x2e8dc2['disposition'],'chatInfo':{'browser':_0x2e8dc2[_0xf955('0x130')],'os':_0x2e8dc2['osName'],'referer':_0x2e8dc2[_0xf955('0x131')],'customerIp':_0x2e8dc2[_0xf955('0x132')],'customerPort':_0x2e8dc2[_0xf955('0x133')]?_0x2e8dc2[_0xf955('0x133')]:'N.A.'},'messages':_(_0x2e8dc2[_0xf955('0xfc')])[_0xf955('0x134')]()[_0xf955('0x96')]({'secret':![]})[_0xf955('0x40')](function(_0x1307a6){if(_0x1307a6[_0xf955('0xed')]){var _0x3328b9=path[_0xf955('0xef')](_0x3ccc35,_0x1307a6['Attachment'][_0xf955('0xf2')]);if(fs[_0xf955('0x135')](_0x3328b9)){fs[_0xf955('0x136')](_0x3328b9)[_0xf955('0x137')](fs['createWriteStream'](path[_0xf955('0xef')](_0x72b500,_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')])));}}return{'date':moment(_0x1307a6[_0xf955('0x107')])[_0xf955('0xf8')](_0xf955('0x138'))['toString'](),'sender':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?_0x1307a6['User']?_0x1307a6[_0xf955('0xfd')][_0xf955('0x41')]:_0xf955('0x100'):_0x1307a6[_0xf955('0x77')][_0xf955('0x127')]+(_0x1307a6[_0xf955('0x77')][_0xf955('0x139')]?'\x20'+_0x1307a6['Contact'][_0xf955('0x139')]:''),'body':_0x1307a6[_0xf955('0xed')]?_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')]:_0x1307a6[_0xf955('0x3a')],'direction':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?'A':'C','secret':_0x1307a6['secret'],'read':_0x1307a6[_0xf955('0x91')],'attachment':_0x1307a6[_0xf955('0xed')]};})[_0xf955('0x73')]()};return ejs[_0xf955('0x13a')](path[_0xf955('0xef')](config[_0xf955('0xf6')],'server',_0xf955('0x13b'),_0xf955('0x13c')),{'interaction':_0x58b727})[_0xf955('0x1f')](function(_0x385676){var _0x5a9193=path['join'](_0x72b500,_0xf955('0x13d')+_0x2e8dc2['id']+'-'+_0x47b877+_0xf955('0x13e'));var _0x157508={'path':_0x5a9193,'channel':'Chat','interactionId':_0x2e8dc2['id']};return pdf[_0xf955('0x13f')](_0x385676,_0x157508);})['then'](function(){return new BPromise(function(_0x37bdd4,_0x4f8fc8){zipdir(_0x72b500,{'saveTo':_0x4896ae},function(_0x5f3e0f,_0x4ad147){if(_0x5f3e0f)return _0x4f8fc8(_0x5f3e0f);return _0x37bdd4(_0x4ad147);});})[_0xf955('0x1f')](function(){return new BPromise(function(_0x2dc607,_0x355871){rimraf(_0x72b500,function(_0x1c5b1d){if(_0x1c5b1d)_0x355871(_0x1c5b1d);return _0x2dc607();});});})[_0xf955('0x1f')](function(){return _0x204e4e[_0xf955('0xf3')](_0x4896ae,_0x1d4aa6,function(_0x5eac2b){if(_0x5eac2b){console[_0xf955('0x140')](_0xf955('0x141'),_0x5eac2b);}else{fs[_0xf955('0x142')](_0x4896ae);}});});});}else{return _0x204e4e[_0xf955('0x2a')](0xc8);}})[_0xf955('0x47')](handleError(_0x204e4e,null));}; \ No newline at end of file +var _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x2935b2,_0x23ac93){var _0x3cc82c=function(_0x24423c){while(--_0x24423c){_0x2935b2['push'](_0x2935b2['shift']());}};_0x3cc82c(++_0x23ac93);}(_0x4fc2,0x111));var _0x24fc=function(_0x4c6f66,_0x22e45a){_0x4c6f66=_0x4c6f66-0x0;var _0x1daea9=_0x4fc2[_0x4c6f66];return _0x1daea9;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6257cd8..e8776ff 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 _0x26e0=['Users','map','findAll','setDataValue','unreadMessages','length','catch','hook','exports','../../mysqldb','ChatInteraction','save','update','remove','getUsers','then'];(function(_0x170b40,_0xc5deb7){var _0x1ab518=function(_0x39fb8a){while(--_0x39fb8a){_0x170b40['push'](_0x170b40['shift']());}};_0x1ab518(++_0xc5deb7);}(_0x26e0,0x159));var _0x026e=function(_0x4e1211,_0x1c0e26){_0x4e1211=_0x4e1211-0x0;var _0x4ae887=_0x26e0[_0x4e1211];return _0x4ae887;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x026e('0x0'))['db'][_0x026e('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x026e('0x2'),'afterUpdate':_0x026e('0x3'),'afterDestroy':_0x026e('0x4')};function emitEvent(_0x17be38){return function(_0x1d75d9,_0x3702ae,_0x1c6dc5){_0x1d75d9[_0x026e('0x5')]({'attributes':['id'],'raw':!![]})[_0x026e('0x6')](function(_0x1f559f){_0x1d75d9['setDataValue'](_0x026e('0x7'),_0x1f559f[_0x026e('0x8')](function(_0x2c45aa){return{'id':_0x2c45aa['id']};}));return ChatMessage[_0x026e('0x9')]({'where':{'ChatInteractionId':_0x1d75d9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x026e('0x6')](function(_0xca32a4){_0x1d75d9[_0x026e('0xa')](_0x026e('0xb'),_0xca32a4[_0x026e('0xc')]);ChatInteractionEvents['emit'](_0x17be38+':'+_0x1d75d9['id'],_0x1d75d9);ChatInteractionEvents['emit'](_0x17be38,_0x1d75d9);_0x1c6dc5(null);})[_0x026e('0xd')](_0x1c6dc5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x026e('0xe')](e,emitEvent(event));}}module[_0x026e('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x77d5=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77d5,0x180));var _0x577d=function(_0x50fc10,_0x2ab6a8){_0x50fc10=_0x50fc10-0x0;var _0x3b802f=_0x77d5[_0x50fc10];return _0x3b802f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x577d('0x0'))['db'][_0x577d('0x1')];var ChatMessage=require(_0x577d('0x0'))['db'][_0x577d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x577d('0x3')](0x0);var events={'afterCreate':_0x577d('0x4'),'afterUpdate':_0x577d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b194a){return function(_0x3c1d34,_0x3dbeed,_0x2fea4f){_0x3c1d34[_0x577d('0x6')]({'attributes':['id'],'raw':!![]})[_0x577d('0x7')](function(_0x2fb1a3){_0x3c1d34[_0x577d('0x8')](_0x577d('0x9'),_0x2fb1a3[_0x577d('0xa')](function(_0x52c421){return{'id':_0x52c421['id']};}));return ChatMessage[_0x577d('0xb')]({'where':{'ChatInteractionId':_0x3c1d34['id'],'direction':'in','read':![]},'raw':!![]});})[_0x577d('0x7')](function(_0x1a3a92){_0x3c1d34['setDataValue'](_0x577d('0xc'),_0x1a3a92[_0x577d('0xd')]);ChatInteractionEvents['emit'](_0x4b194a+':'+_0x3c1d34['id'],_0x3c1d34);ChatInteractionEvents[_0x577d('0xe')](_0x4b194a,_0x3c1d34);_0x2fea4f(null);})['catch'](_0x2fea4f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x577d('0xf')](e,emitEvent(event));}}module[_0x577d('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index dd66de3..3a6ab36 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 _0x8606=['moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x54abae,_0x154d8f){var _0x297e50=function(_0x1acbd6){while(--_0x1acbd6){_0x54abae['push'](_0x54abae['shift']());}};_0x297e50(++_0x154d8f);}(_0x8606,0x183));var _0x6860=function(_0xabe65e,_0x455177){_0xabe65e=_0xabe65e-0x0;var _0x3da843=_0x8606[_0xabe65e];return _0x3da843;};'use strict';var _=require(_0x6860('0x0'));var util=require(_0x6860('0x1'));var logger=require(_0x6860('0x2'))(_0x6860('0x3'));var moment=require(_0x6860('0x4'));var BPromise=require(_0x6860('0x5'));var rp=require(_0x6860('0x6'));var fs=require('fs');var path=require(_0x6860('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6860('0x8'));module[_0x6860('0x9')]=function(_0xa516d7,_0x356b6a){return _0xa516d7['define'](_0x6860('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33eb26,_0xca0873,_0x34f2c2){if(_0x33eb26[_0x6860('0xb')](_0x6860('0xc'))){_0x33eb26[_0x6860('0xd')]=moment()['format'](_0x6860('0xe'));}_0x34f2c2(null,_0x33eb26);}},'charset':_0x6860('0xf'),'collate':_0x6860('0x10')});}; \ No newline at end of file +var _0xca39=['rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path'];(function(_0xced79b,_0x1d38df){var _0x5ee1f8=function(_0x4dfe92){while(--_0x4dfe92){_0xced79b['push'](_0xced79b['shift']());}};_0x5ee1f8(++_0x1d38df);}(_0xca39,0x109));var _0x9ca3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xca39[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x9ca3('0x0'));var util=require('util');var logger=require(_0x9ca3('0x1'))('api');var moment=require(_0x9ca3('0x2'));var BPromise=require(_0x9ca3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca3('0x4'));var rimraf=require(_0x9ca3('0x5'));var config=require(_0x9ca3('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x9ca3('0x7')]=function(_0x59cf5d,_0x5ad808){return _0x59cf5d[_0x9ca3('0x8')](_0x9ca3('0x9'),attributes,{'tableName':_0x9ca3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50c6f8,_0x4f6b79,_0x458148){if(_0x50c6f8[_0x9ca3('0xb')](_0x9ca3('0xc'))){_0x50c6f8['closedAt']=moment()['format'](_0x9ca3('0xd'));}_0x458148(null,_0x50c6f8);}},'charset':'utf8mb4','collate':_0x9ca3('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 45e624b..b70d30c 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 _0x04a6=['raw','where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x7c632e,_0x482e2b){var _0x29f371=function(_0x4a68ee){while(--_0x4a68ee){_0x7c632e['push'](_0x7c632e['shift']());}};_0x29f371(++_0x482e2b);}(_0x04a6,0xb8));var _0x604a=function(_0x19c1e6,_0x473895){_0x19c1e6=_0x19c1e6-0x0;var _0x4f7119=_0x04a6[_0x19c1e6];return _0x4f7119;};'use strict';var _=require(_0x604a('0x0'));var util=require(_0x604a('0x1'));var moment=require(_0x604a('0x2'));var BPromise=require('bluebird');var rs=require(_0x604a('0x3'));var fs=require('fs');var Redis=require(_0x604a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x604a('0x5'));var logger=require(_0x604a('0x6'))(_0x604a('0x7'));var config=require(_0x604a('0x8'));var jayson=require(_0x604a('0x9'));var client=jayson[_0x604a('0xa')][_0x604a('0xb')]({'port':0x232a});config[_0x604a('0xc')]=_[_0x604a('0xd')](config[_0x604a('0xc')],{'host':_0x604a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0x604a('0xf')](socket);function respondWithRpcPromise(_0x44deaa,_0x1403c1,_0x451461){return new BPromise(function(_0x35a34f,_0x22e977){return client[_0x604a('0x10')](_0x44deaa,_0x451461)[_0x604a('0x11')](function(_0x5419d){logger[_0x604a('0x12')](_0x604a('0x13'),_0x1403c1,_0x604a('0x14'));logger['debug'](_0x604a('0x15'),_0x1403c1,_0x604a('0x14'),JSON[_0x604a('0x16')](_0x5419d));if(_0x5419d['error']){if(_0x5419d[_0x604a('0x17')]['code']===0x1f4){logger[_0x604a('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1403c1,_0x5419d[_0x604a('0x17')][_0x604a('0x18')]);return _0x22e977(_0x5419d[_0x604a('0x17')][_0x604a('0x18')]);}logger[_0x604a('0x17')](_0x604a('0x13'),_0x1403c1,_0x5419d[_0x604a('0x17')]['message']);return _0x35a34f(_0x5419d[_0x604a('0x17')]['message']);}else{logger[_0x604a('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1403c1,_0x604a('0x14'));_0x35a34f(_0x5419d['result']['message']);}})[_0x604a('0x19')](function(_0x1e73d6){logger[_0x604a('0x17')](_0x604a('0x13'),_0x1403c1,_0x1e73d6);_0x22e977(_0x1e73d6);});});}exports[_0x604a('0x1a')]=function(_0x1777e6){var _0x19f15d=this;return new Promise(function(_0x416c35,_0x2acbff){return db[_0x604a('0x1b')][_0x604a('0x1c')](_0x1777e6[_0x604a('0x1d')],{'raw':_0x1777e6[_0x604a('0x1e')]?_0x1777e6[_0x604a('0x1e')][_0x604a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1777e6['options']?_0x1777e6[_0x604a('0x1e')][_0x604a('0x20')]||null:null,'attributes':_0x1777e6['options']?_0x1777e6[_0x604a('0x1e')][_0x604a('0x21')]||null:null,'limit':_0x1777e6['options']?_0x1777e6['options'][_0x604a('0x22')]||null:null})[_0x604a('0x11')](function(_0x30466a){logger[_0x604a('0x12')]('UpdateChatInteraction',_0x1777e6);logger[_0x604a('0x23')](_0x604a('0x1a'),_0x1777e6,JSON['stringify'](_0x30466a));_0x416c35(_0x30466a);})[_0x604a('0x19')](function(_0x49ceb4){logger[_0x604a('0x17')]('UpdateChatInteraction',_0x49ceb4['message'],_0x1777e6);_0x2acbff(_0x19f15d[_0x604a('0x17')](0x1f4,_0x49ceb4[_0x604a('0x18')]));});});};exports[_0x604a('0x24')]=function(_0x1dd8f7){return new Promise(function(_0x14eff7,_0x5c8998){return db[_0x604a('0x1b')][_0x604a('0x25')]({'where':_0x1dd8f7[_0x604a('0x1e')]?_0x1dd8f7[_0x604a('0x1e')][_0x604a('0x20')]||null:null})[_0x604a('0x11')](function(_0x586d24){if(_0x586d24){return _0x586d24[_0x604a('0x26')](_0x1dd8f7[_0x604a('0x1d')]['ids'],_[_0x604a('0x27')](_0x1dd8f7[_0x604a('0x1d')],[_0x604a('0x28'),'id'])||{});}})[_0x604a('0x29')](function(_0x3ea10c){logger[_0x604a('0x12')]('AddTags',_0x1dd8f7);logger[_0x604a('0x23')]('AddTags',_0x1dd8f7,JSON[_0x604a('0x16')](_0x3ea10c));_0x14eff7(_0x3ea10c);})[_0x604a('0x19')](function(_0x2d6cfc){logger[_0x604a('0x17')](_0x604a('0x2a'),_0x2d6cfc['message'],_0x1dd8f7);_0x5c8998(_this['error'](0x1f4,_0x2d6cfc[_0x604a('0x18')]));});});}; \ No newline at end of file +var _0x8478=['redis','localhost','socket.io-emitter','./chatInteraction.socket','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','then','debug','catch','find','addTags','body','ids','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x313c16,_0x1b5e73){var _0xf779af=function(_0x2afe7d){while(--_0x2afe7d){_0x313c16['push'](_0x313c16['shift']());}};_0xf779af(++_0x1b5e73);}(_0x8478,0x1a2));var _0x8847=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8478[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x8847('0x0'));var util=require(_0x8847('0x1'));var moment=require(_0x8847('0x2'));var BPromise=require(_0x8847('0x3'));var rs=require(_0x8847('0x4'));var fs=require('fs');var Redis=require(_0x8847('0x5'));var db=require(_0x8847('0x6'))['db'];var utils=require(_0x8847('0x7'));var logger=require('../../config/logger')(_0x8847('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8847('0x9')][_0x8847('0xa')]({'port':0x232a});config[_0x8847('0xb')]=_['defaults'](config[_0x8847('0xb')],{'host':_0x8847('0xc'),'port':0x18eb});var socket=require(_0x8847('0xd'))(new Redis(config[_0x8847('0xb')]));require(_0x8847('0xe'))['register'](socket);function respondWithRpcPromise(_0x3bd043,_0x58a6d7,_0x3024ec){return new BPromise(function(_0x1a224d,_0x1e1db5){return client[_0x8847('0xf')](_0x3bd043,_0x3024ec)['then'](function(_0x22704f){logger[_0x8847('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x58a6d7,_0x8847('0x11'));logger['debug'](_0x8847('0x12'),_0x58a6d7,_0x8847('0x11'),JSON[_0x8847('0x13')](_0x22704f));if(_0x22704f[_0x8847('0x14')]){if(_0x22704f['error'][_0x8847('0x15')]===0x1f4){logger[_0x8847('0x14')](_0x8847('0x16'),_0x58a6d7,_0x22704f[_0x8847('0x14')][_0x8847('0x17')]);return _0x1e1db5(_0x22704f[_0x8847('0x14')]['message']);}logger[_0x8847('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x58a6d7,_0x22704f['error']['message']);return _0x1a224d(_0x22704f[_0x8847('0x14')][_0x8847('0x17')]);}else{logger[_0x8847('0x10')](_0x8847('0x16'),_0x58a6d7,'request\x20sent');_0x1a224d(_0x22704f['result'][_0x8847('0x17')]);}})['catch'](function(_0x18b131){logger[_0x8847('0x14')](_0x8847('0x16'),_0x58a6d7,_0x18b131);_0x1e1db5(_0x18b131);});});}exports[_0x8847('0x18')]=function(_0x596806){var _0x3f29e5=this;return new Promise(function(_0x847f46,_0xb7c23d){return db[_0x8847('0x19')][_0x8847('0x1a')](_0x596806['body'],{'raw':_0x596806[_0x8847('0x1b')]?_0x596806['options'][_0x8847('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596806[_0x8847('0x1b')]?_0x596806[_0x8847('0x1b')][_0x8847('0x1d')]||null:null,'attributes':_0x596806[_0x8847('0x1b')]?_0x596806['options'][_0x8847('0x1e')]||null:null,'limit':_0x596806[_0x8847('0x1b')]?_0x596806['options'][_0x8847('0x1f')]||null:null})[_0x8847('0x20')](function(_0x29ff6f){logger[_0x8847('0x10')](_0x8847('0x18'),_0x596806);logger[_0x8847('0x21')](_0x8847('0x18'),_0x596806,JSON['stringify'](_0x29ff6f));_0x847f46(_0x29ff6f);})[_0x8847('0x22')](function(_0x313617){logger['error']('UpdateChatInteraction',_0x313617[_0x8847('0x17')],_0x596806);_0xb7c23d(_0x3f29e5[_0x8847('0x14')](0x1f4,_0x313617['message']));});});};exports['AddTagsToChatInteraction']=function(_0x12937a){return new Promise(function(_0x62819f,_0x218232){return db[_0x8847('0x19')][_0x8847('0x23')]({'where':_0x12937a[_0x8847('0x1b')]?_0x12937a[_0x8847('0x1b')]['where']||null:null})['then'](function(_0x4c4ea2){if(_0x4c4ea2){return _0x4c4ea2[_0x8847('0x24')](_0x12937a[_0x8847('0x25')][_0x8847('0x26')],_['omit'](_0x12937a['body'],[_0x8847('0x26'),'id'])||{});}})['spread'](function(_0x411bbf){logger[_0x8847('0x10')]('AddTags',_0x12937a);logger['debug']('AddTags',_0x12937a,JSON['stringify'](_0x411bbf));_0x62819f(_0x411bbf);})[_0x8847('0x22')](function(_0x3203d1){logger['error']('AddTags',_0x3203d1[_0x8847('0x17')],_0x12937a);_0x218232(_this[_0x8847('0x14')](0x1f4,_0x3203d1[_0x8847('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 27c34ca..d1b4927 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 _0x5460=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x18dddb,_0x188400){var _0x182d58=function(_0x521a64){while(--_0x521a64){_0x18dddb['push'](_0x18dddb['shift']());}};_0x182d58(++_0x188400);}(_0x5460,0x1e5));var _0x0546=function(_0x47f7ec,_0x369f9d){_0x47f7ec=_0x47f7ec-0x0;var _0x415101=_0x5460[_0x47f7ec];return _0x415101;};'use strict';var ChatInteractionEvents=require(_0x0546('0x0'));var events=[_0x0546('0x1'),_0x0546('0x2'),_0x0546('0x3')];function createListener(_0xd3c6e4,_0x436dd8){return function(_0x549823){_0x436dd8[_0x0546('0x4')](_0xd3c6e4,_0x549823);};}function removeListener(_0x56586b,_0x35bcf0){return function(){ChatInteractionEvents[_0x0546('0x5')](_0x56586b,_0x35bcf0);};}exports['register']=function(_0x4f85c7){for(var _0x1094e7=0x0,_0x37cb77=events[_0x0546('0x6')];_0x1094e7<_0x37cb77;_0x1094e7++){var _0x513b97=events[_0x1094e7];var _0x49b2b9=createListener(_0x0546('0x7')+_0x513b97,_0x4f85c7);ChatInteractionEvents['on'](_0x513b97,_0x49b2b9);}}; \ No newline at end of file +var _0x4bba=['update','emit','removeListener','length','./chatInteraction.events','save','remove'];(function(_0x38fb6a,_0x5c7d2b){var _0x1bd7b2=function(_0x439d71){while(--_0x439d71){_0x38fb6a['push'](_0x38fb6a['shift']());}};_0x1bd7b2(++_0x5c7d2b);}(_0x4bba,0x131));var _0xa4bb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4bba[_0x2dafbe];return _0x58a45a;};'use strict';var ChatInteractionEvents=require(_0xa4bb('0x0'));var events=[_0xa4bb('0x1'),_0xa4bb('0x2'),_0xa4bb('0x3')];function createListener(_0x2a3736,_0x193870){return function(_0x3c3937){_0x193870[_0xa4bb('0x4')](_0x2a3736,_0x3c3937);};}function removeListener(_0x52d431,_0x443c1a){return function(){ChatInteractionEvents[_0xa4bb('0x5')](_0x52d431,_0x443c1a);};}exports['register']=function(_0x3ccaae){for(var _0x32a59b=0x0,_0x2644f6=events[_0xa4bb('0x6')];_0x32a59b<_0x2644f6;_0x32a59b++){var _0x515bce=events[_0x32a59b];var _0x841e0c=createListener('chatInteraction:'+_0x515bce,_0x3ccaae);ChatInteractionEvents['on'](_0x515bce,_0x841e0c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 57687d7..bc04217 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 _0x74e5=['/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','tracked','chatinteraction:destroy','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show'];(function(_0x4d01a9,_0x2d90a6){var _0x2940b2=function(_0x5144ae){while(--_0x5144ae){_0x4d01a9['push'](_0x4d01a9['shift']());}};_0x2940b2(++_0x2d90a6);}(_0x74e5,0x1b2));var _0x574e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x74e5[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x574e('0x0'));var util=require('util');var path=require(_0x574e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x574e('0x2')]();var fs_extra=require(_0x574e('0x3'));var auth=require(_0x574e('0x4'));var interaction=require(_0x574e('0x5'));var config=require(_0x574e('0x6'));var controller=require(_0x574e('0x7'));router['get']('/',auth[_0x574e('0x8')](),controller[_0x574e('0x9')]);router[_0x574e('0xa')](_0x574e('0xb'),auth[_0x574e('0x8')](),controller[_0x574e('0xc')]);router[_0x574e('0xa')](_0x574e('0xd'),auth[_0x574e('0xe')](),controller[_0x574e('0xf')]);router[_0x574e('0xa')](_0x574e('0x10'),auth[_0x574e('0xe')](),controller[_0x574e('0x11')]);router[_0x574e('0xa')](_0x574e('0x12'),auth[_0x574e('0x8')](),controller['getMessages']);router[_0x574e('0xa')](_0x574e('0x13'),auth[_0x574e('0xe')](),controller['getMyMessages']);router[_0x574e('0xa')](_0x574e('0x14'),auth[_0x574e('0x8')](),controller[_0x574e('0x15')]);router[_0x574e('0x16')]('/',auth[_0x574e('0x8')](),controller[_0x574e('0x17')]);router[_0x574e('0x16')]('/:id/vidaoo',auth[_0x574e('0x8')](),controller[_0x574e('0x18')]);var upload=multer({'storage':multer[_0x574e('0x19')]({'destination':function(_0x4a7c57,_0x40bf7f,_0x4e3bb0){_0x4e3bb0(null,path['join'](config[_0x574e('0x1a')],_0x574e('0x1b')));},'filename':function(_0xccdf29,_0x8d7f88,_0x17f957){_0x17f957(null,util[_0x574e('0x1c')]('%s-%s',Date[_0x574e('0x1d')](),_0x8d7f88['originalname'][_0x574e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x574e('0x1f'),upload[_0x574e('0x20')]('file'),controller[_0x574e('0x21')]);router[_0x574e('0x16')](_0x574e('0x12'),auth[_0x574e('0xe')](),controller[_0x574e('0x22')]);router['post'](_0x574e('0x23'),auth['isAuthenticated'](),interaction['tracked'](_0x574e('0x24'),_0x574e('0x25')),controller[_0x574e('0x26')]);router[_0x574e('0x27')](_0x574e('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x574e('0x24'),_0x574e('0x28')),controller[_0x574e('0x29')]);router[_0x574e('0x27')](_0x574e('0x2a'),controller[_0x574e('0x2b')]);router[_0x574e('0x27')]('/:id/abandon',auth[_0x574e('0xe')](),controller['abandon']);router[_0x574e('0x27')](_0x574e('0x2c'),controller[_0x574e('0x2d')]);router['delete'](_0x574e('0xd'),auth['isAuthenticated'](),interaction[_0x574e('0x2e')](_0x574e('0x24'),_0x574e('0x2f')),controller[_0x574e('0x30')]);router['delete'](_0x574e('0x23'),auth[_0x574e('0x8')](),controller['removeTags']);module[_0x574e('0x31')]=router; \ No newline at end of file +var _0x418b=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','/:id','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put'];(function(_0x4af089,_0x44ccc9){var _0x570946=function(_0x147663){while(--_0x147663){_0x4af089['push'](_0x4af089['shift']());}};_0x570946(++_0x44ccc9);}(_0x418b,0x151));var _0xb418=function(_0x251fbd,_0x24f2ea){_0x251fbd=_0x251fbd-0x0;var _0x3904ed=_0x418b[_0x251fbd];return _0x3904ed;};'use strict';var multer=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var path=require('path');var timeout=require(_0xb418('0x2'));var express=require(_0xb418('0x3'));var router=express[_0xb418('0x4')]();var fs_extra=require(_0xb418('0x5'));var auth=require(_0xb418('0x6'));var interaction=require(_0xb418('0x7'));var config=require(_0xb418('0x8'));var controller=require('./chatInteraction.controller');router[_0xb418('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb418('0x9')](_0xb418('0xa'),auth[_0xb418('0xb')](),controller[_0xb418('0xc')]);router[_0xb418('0x9')]('/:id',auth[_0xb418('0xd')](),controller[_0xb418('0xe')]);router[_0xb418('0x9')](_0xb418('0xf'),auth[_0xb418('0xd')](),controller[_0xb418('0x10')]);router[_0xb418('0x9')](_0xb418('0x11'),auth[_0xb418('0xb')](),controller[_0xb418('0x12')]);router[_0xb418('0x9')](_0xb418('0x13'),auth[_0xb418('0xd')](),controller[_0xb418('0x14')]);router[_0xb418('0x9')]('/:id/download',auth[_0xb418('0xb')](),controller[_0xb418('0x15')]);router[_0xb418('0x16')]('/',auth[_0xb418('0xb')](),controller['create']);router[_0xb418('0x16')](_0xb418('0x17'),auth[_0xb418('0xb')](),controller[_0xb418('0x18')]);var upload=multer({'storage':multer[_0xb418('0x19')]({'destination':function(_0x5b8f6e,_0xf827dd,_0x43d216){_0x43d216(null,path['join'](config[_0xb418('0x1a')],_0xb418('0x1b')));},'filename':function(_0x41147d,_0x549556,_0x402fb4){_0x402fb4(null,util['format']('%s-%s',Date[_0xb418('0x1c')](),_0x549556[_0xb418('0x1d')][_0xb418('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb418('0x16')](_0xb418('0x1f'),upload[_0xb418('0x20')](_0xb418('0x21')),controller[_0xb418('0x22')]);router['post'](_0xb418('0x11'),auth[_0xb418('0xd')](),controller[_0xb418('0x23')]);router['post'](_0xb418('0x24'),auth['isAuthenticated'](),interaction[_0xb418('0x25')](_0xb418('0x26'),_0xb418('0x27')),controller['addTags']);router[_0xb418('0x28')]('/:id',auth['isAuthenticated'](),interaction[_0xb418('0x25')]('chat',_0xb418('0x29')),controller[_0xb418('0x2a')]);router[_0xb418('0x28')](_0xb418('0x2b'),controller[_0xb418('0x2c')]);router['put'](_0xb418('0x2d'),auth[_0xb418('0xd')](),controller[_0xb418('0x2e')]);router[_0xb418('0x28')](_0xb418('0x2f'),controller[_0xb418('0x30')]);router['delete'](_0xb418('0x31'),auth[_0xb418('0xb')](),interaction['tracked'](_0xb418('0x26'),'chatinteraction:destroy'),controller[_0xb418('0x32')]);router[_0xb418('0x33')](_0xb418('0x24'),auth[_0xb418('0xb')](),controller[_0xb418('0x34')]);module[_0xb418('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index cda1669..be3e4f4 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 _0x8c90=['medium','BOOLEAN','INTEGER','exports'];(function(_0x1bee7a,_0xacfa2a){var _0x5d69d7=function(_0x3b8891){while(--_0x3b8891){_0x1bee7a['push'](_0x1bee7a['shift']());}};_0x5d69d7(++_0xacfa2a);}(_0x8c90,0x7f));var _0x08c9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8c90[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x08c9('0x0')]={'body':{'type':Sequelize['TEXT'](_0x08c9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x08c9('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x08c9('0x3')]}}; \ No newline at end of file +var _0xd4cf=['sequelize','exports','TEXT','medium'];(function(_0x184b62,_0x235d8f){var _0x3ff708=function(_0x588bf9){while(--_0x588bf9){_0x184b62['push'](_0x184b62['shift']());}};_0x3ff708(++_0x235d8f);}(_0xd4cf,0x80));var _0xfd4c=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xd4cf[_0x996bc8];return _0x20b0ea;};'use strict';var Sequelize=require(_0xfd4c('0x0'));module[_0xfd4c('0x1')]={'body':{'type':Sequelize[_0xfd4c('0x2')](_0xfd4c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 37ab54a..70a00ba 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 _0x8aca=['catch','show','params','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','findAll','agent','admin','user','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','UserProfileSection','Agents','UserProfileResource','filter','role','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','ChatInternalMessage','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','rows'];(function(_0x50862d,_0x3bb132){var _0x1e0e9c=function(_0x343e7a){while(--_0x343e7a){_0x50862d['push'](_0x50862d['shift']());}};_0x1e0e9c(++_0x3bb132);}(_0x8aca,0x8e));var _0xa8ac=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x8aca[_0x2f3ecd];return _0xffdc44;};'use strict';var emlformat=require(_0xa8ac('0x0'));var rimraf=require(_0xa8ac('0x1'));var zipdir=require(_0xa8ac('0x2'));var jsonpatch=require(_0xa8ac('0x3'));var rp=require(_0xa8ac('0x4'));var moment=require(_0xa8ac('0x5'));var BPromise=require(_0xa8ac('0x6'));var Mustache=require('mustache');var util=require(_0xa8ac('0x7'));var path=require(_0xa8ac('0x8'));var sox=require(_0xa8ac('0x9'));var csv=require(_0xa8ac('0xa'));var ejs=require(_0xa8ac('0xb'));var fs=require('fs');var fs_extra=require(_0xa8ac('0xc'));var _=require(_0xa8ac('0xd'));var squel=require(_0xa8ac('0xe'));var crypto=require(_0xa8ac('0xf'));var jsforce=require(_0xa8ac('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa8ac('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa8ac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa8ac('0x12'));var as=require(_0xa8ac('0x13'));var hardwareService=require(_0xa8ac('0x14'));var logger=require('../../config/logger')(_0xa8ac('0x15'));var utils=require(_0xa8ac('0x16'));var config=require(_0xa8ac('0x17'));var licenseUtil=require(_0xa8ac('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa8ac('0x19')](config[_0xa8ac('0x1a')],{'host':_0xa8ac('0x1b'),'port':0x18eb});var socket=require(_0xa8ac('0x1c'))(new Redis(config[_0xa8ac('0x1a')]));require(_0xa8ac('0x1d'))['register'](socket);function respondWithStatusCode(_0x4244ff,_0xc298ee){_0xc298ee=_0xc298ee||0xcc;return function(_0x3a62a1){if(_0x3a62a1){return _0x4244ff['sendStatus'](_0xc298ee);}return _0x4244ff[_0xa8ac('0x1e')](_0xc298ee)[_0xa8ac('0x1f')]();};}function respondWithResult(_0x4ac755,_0x4f9f4b){_0x4f9f4b=_0x4f9f4b||0xc8;return function(_0xf61f77){if(_0xf61f77){return _0x4ac755[_0xa8ac('0x1e')](_0x4f9f4b)['json'](_0xf61f77);}};}function respondWithFilteredResult(_0x3e06ff,_0x398fb2){return function(_0x4128f7){if(_0x4128f7){var _0x569e55=typeof _0x398fb2['offset']===_0xa8ac('0x20')&&typeof _0x398fb2[_0xa8ac('0x21')]===_0xa8ac('0x20');var _0xcf9d96=_0x4128f7[_0xa8ac('0x22')];var _0x409442=_0x569e55?0x0:_0x398fb2[_0xa8ac('0x23')];var _0x8ab461=_0x569e55?_0x4128f7[_0xa8ac('0x22')]:_0x398fb2[_0xa8ac('0x23')]+_0x398fb2[_0xa8ac('0x21')];var _0x3bddf7;if(_0x8ab461>=_0xcf9d96){_0x8ab461=_0xcf9d96;_0x3bddf7=0xc8;}else{_0x3bddf7=0xce;}_0x3e06ff[_0xa8ac('0x1e')](_0x3bddf7);return _0x3e06ff[_0xa8ac('0x24')]('Content-Range',_0x409442+'-'+_0x8ab461+'/'+_0xcf9d96)[_0xa8ac('0x25')](_0x4128f7);}return null;};}function patchUpdates(_0x31476d){return function(_0x894413){try{jsonpatch[_0xa8ac('0x26')](_0x894413,_0x31476d,!![]);}catch(_0x289e15){return BPromise[_0xa8ac('0x27')](_0x289e15);}return _0x894413[_0xa8ac('0x28')]();};}function saveUpdates(_0x54f635,_0x163d6d){return function(_0x57d033){if(_0x57d033){return _0x57d033[_0xa8ac('0x29')](_0x54f635)[_0xa8ac('0x2a')](function(_0x14aa2d){return _0x14aa2d;});}return null;};}function removeEntity(_0x2c0f4b,_0x21f89d){return function(_0x4e8db1){if(_0x4e8db1){return _0x4e8db1[_0xa8ac('0x2b')]()[_0xa8ac('0x2a')](function(){_0x2c0f4b[_0xa8ac('0x1e')](0xcc)[_0xa8ac('0x1f')]();});}};}function handleEntityNotFound(_0x477a27,_0x4bd037){return function(_0x1508ec){if(!_0x1508ec){_0x477a27[_0xa8ac('0x2c')](0x194);}return _0x1508ec;};}function handleError(_0x123477,_0x5168fa){_0x5168fa=_0x5168fa||0x1f4;return function(_0x981d36){logger[_0xa8ac('0x2d')](_0x981d36[_0xa8ac('0x2e')]);if(_0x981d36['name']){delete _0x981d36[_0xa8ac('0x2f')];}_0x123477['status'](_0x5168fa)[_0xa8ac('0x30')](_0x981d36);};}exports['index']=function(_0xff68a0,_0xb1ef53){var _0x51f4d6={},_0x4835b7={},_0x1793e4={'count':0x0,'rows':[]};var _0xfc15c0=_['map'](db[_0xa8ac('0x31')][_0xa8ac('0x32')],function(_0x2b94bc){return{'name':_0x2b94bc['fieldName'],'type':_0x2b94bc[_0xa8ac('0x33')]['key']};});_0x4835b7[_0xa8ac('0x34')]=_['map'](_0xfc15c0,_0xa8ac('0x2f'));_0x4835b7['query']=_[_0xa8ac('0x35')](_0xff68a0[_0xa8ac('0x36')]);_0x4835b7[_0xa8ac('0x37')]=_[_0xa8ac('0x38')](_0x4835b7['model'],_0x4835b7['query']);_0x51f4d6[_0xa8ac('0x39')]=_[_0xa8ac('0x38')](_0x4835b7[_0xa8ac('0x34')],qs[_0xa8ac('0x3a')](_0xff68a0['query'][_0xa8ac('0x3a')]));_0x51f4d6[_0xa8ac('0x39')]=_0x51f4d6['attributes'][_0xa8ac('0x3b')]?_0x51f4d6[_0xa8ac('0x39')]:_0x4835b7[_0xa8ac('0x34')];if(!_0xff68a0[_0xa8ac('0x36')]['hasOwnProperty'](_0xa8ac('0x3c'))){_0x51f4d6['limit']=qs[_0xa8ac('0x21')](_0xff68a0[_0xa8ac('0x36')]['limit']);_0x51f4d6['offset']=qs[_0xa8ac('0x23')](_0xff68a0[_0xa8ac('0x36')][_0xa8ac('0x23')]);}_0x51f4d6['order']=qs[_0xa8ac('0x3d')](_0xff68a0[_0xa8ac('0x36')][_0xa8ac('0x3d')]);_0x51f4d6[_0xa8ac('0x3e')]=qs[_0xa8ac('0x37')](_[_0xa8ac('0x3f')](_0xff68a0['query'],_0x4835b7['filters']),_0xfc15c0);if(_0xff68a0[_0xa8ac('0x36')]['filter']){_0x51f4d6['where']=_[_0xa8ac('0x40')](_0x51f4d6[_0xa8ac('0x3e')],{'$or':_[_0xa8ac('0x41')](_0xfc15c0,function(_0x48792b){if(_0x48792b['type']!==_0xa8ac('0x42')){var _0x4802a2={};_0x4802a2[_0x48792b[_0xa8ac('0x2f')]]={'$like':'%'+_0xff68a0['query']['filter']+'%'};return _0x4802a2;}})});}_0x51f4d6=_['merge']({},_0x51f4d6,_0xff68a0[_0xa8ac('0x43')]);var _0x5018bb={'where':_0x51f4d6['where']};return db[_0xa8ac('0x31')][_0xa8ac('0x22')](_0x5018bb)[_0xa8ac('0x2a')](function(_0x1b6049){_0x1793e4[_0xa8ac('0x22')]=_0x1b6049;if(_0xff68a0[_0xa8ac('0x36')]['includeAll']){_0x51f4d6[_0xa8ac('0x44')]=[{'all':!![]}];}return db[_0xa8ac('0x31')]['findAll'](_0x51f4d6);})[_0xa8ac('0x2a')](function(_0x623e91){_0x1793e4[_0xa8ac('0x45')]=_0x623e91;return _0x1793e4;})[_0xa8ac('0x2a')](respondWithFilteredResult(_0xb1ef53,_0x51f4d6))[_0xa8ac('0x46')](handleError(_0xb1ef53,null));};exports[_0xa8ac('0x47')]=function(_0x23ae3d,_0x3956b9){var _0x1f8672={'raw':!![],'where':{'id':_0x23ae3d[_0xa8ac('0x48')]['id']}},_0x4638ce={};_0x4638ce[_0xa8ac('0x34')]=_[_0xa8ac('0x35')](db[_0xa8ac('0x31')]['rawAttributes']);_0x4638ce[_0xa8ac('0x36')]=_[_0xa8ac('0x35')](_0x23ae3d['query']);_0x4638ce[_0xa8ac('0x37')]=_[_0xa8ac('0x38')](_0x4638ce[_0xa8ac('0x34')],_0x4638ce[_0xa8ac('0x36')]);_0x1f8672[_0xa8ac('0x39')]=_[_0xa8ac('0x38')](_0x4638ce['model'],qs[_0xa8ac('0x3a')](_0x23ae3d['query'][_0xa8ac('0x3a')]));_0x1f8672[_0xa8ac('0x39')]=_0x1f8672[_0xa8ac('0x39')][_0xa8ac('0x3b')]?_0x1f8672['attributes']:_0x4638ce[_0xa8ac('0x34')];if(_0x23ae3d[_0xa8ac('0x36')][_0xa8ac('0x49')]){_0x1f8672[_0xa8ac('0x44')]=[{'all':!![]}];}_0x1f8672=_[_0xa8ac('0x40')]({},_0x1f8672,_0x23ae3d[_0xa8ac('0x43')]);return db['ChatInternalMessage'][_0xa8ac('0x4a')](_0x1f8672)[_0xa8ac('0x2a')](handleEntityNotFound(_0x3956b9,null))[_0xa8ac('0x2a')](respondWithResult(_0x3956b9,null))['catch'](handleError(_0x3956b9,null));};exports[_0xa8ac('0x4b')]=function(_0xb0ad78,_0x18c661){return db[_0xa8ac('0x31')][_0xa8ac('0x4b')](_0xb0ad78[_0xa8ac('0x4c')],{})['then'](respondWithResult(_0x18c661,0xc9))[_0xa8ac('0x46')](handleError(_0x18c661,null));};exports[_0xa8ac('0x29')]=function(_0x1305b3,_0x3b6217){if(_0x1305b3[_0xa8ac('0x4c')]['id']){delete _0x1305b3[_0xa8ac('0x4c')]['id'];}return db[_0xa8ac('0x31')][_0xa8ac('0x4a')]({'where':{'id':_0x1305b3['params']['id']}})[_0xa8ac('0x2a')](handleEntityNotFound(_0x3b6217,null))['then'](saveUpdates(_0x1305b3[_0xa8ac('0x4c')],null))[_0xa8ac('0x2a')](respondWithResult(_0x3b6217,null))[_0xa8ac('0x46')](handleError(_0x3b6217,null));};exports[_0xa8ac('0x2b')]=function(_0x1b99cf,_0x38f3a1){return db[_0xa8ac('0x31')][_0xa8ac('0x4a')]({'where':{'id':_0x1b99cf['params']['id']}})[_0xa8ac('0x2a')](handleEntityNotFound(_0x38f3a1,null))[_0xa8ac('0x2a')](removeEntity(_0x38f3a1,null))['catch'](handleError(_0x38f3a1,null));};exports[_0xa8ac('0x4d')]=function(_0xe8afaa,_0x553adf){return db[_0xa8ac('0x31')][_0xa8ac('0x4d')]()[_0xa8ac('0x2a')](respondWithResult(_0x553adf,null))[_0xa8ac('0x46')](handleError(_0x553adf,null));};function wrapUser(_0x47ec11){return function(_0xb3247d){var _0x5d72db=_0x47ec11[_0xa8ac('0x4e')]({'plain':!![]});_0x5d72db[_0xa8ac('0x4f')]=[];if(_0xb3247d){_0x5d72db[_0xa8ac('0x50')]=_0xb3247d[_0xa8ac('0x51')];_0x5d72db[_0xa8ac('0x52')]=_0xb3247d;}else{_0x5d72db[_0xa8ac('0x50')]=moment(0x0)[_0xa8ac('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d72db[_0xa8ac('0x52')]={};}return _0x5d72db;};}exports['getUsers']=function(_0x507c6f,_0x1fe440,_0xcc9733){var _0x2516da=[];return db[_0xa8ac('0x54')][_0xa8ac('0x55')]({'where':{'role':[_0xa8ac('0x56'),_0xa8ac('0x57'),_0xa8ac('0x58')]},'attributes':['id','fullname',_0xa8ac('0x2f'),'role','userpic',_0xa8ac('0x59'),'online',_0xa8ac('0x5a'),_0xa8ac('0x5b'),_0xa8ac('0x5c')],'order':qs['sort']('-online'),'include':[{'model':db[_0xa8ac('0x5d')],'as':'VoiceQueues','attributes':['id',_0xa8ac('0x2f'),_0xa8ac('0x33')],'through':{'attributes':[]}}]})[_0xa8ac('0x2a')](function(_0x486224){if(_0x486224){var _0x4a429c=_0x507c6f[_0xa8ac('0x58')][_0xa8ac('0x4e')]({'plain':!![]});if(!_0x4a429c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a429c['role']===_0xa8ac('0x58')){return db[_0xa8ac('0x5e')][_0xa8ac('0x4a')]({'where':{'name':_0xa8ac('0x5f'),'userProfileId':_0x4a429c['userProfileId']},'raw':!![]})['then'](function(_0x4cab67){if(_0x4cab67){if(_0x4cab67['autoAssociation']===0x0){return db[_0xa8ac('0x60')][_0xa8ac('0x55')]({'where':{'sectionId':_0x4cab67['id']},'raw':!![]})[_0xa8ac('0x2a')](function(_0x2f1b29){var _0x1fcc14=[];if(_['isEmpty'](_0x2f1b29)){_0x1fcc14=_[_0xa8ac('0x61')](_0x486224,function(_0x45c50d){if(_0x45c50d[_0xa8ac('0x62')]!==_0xa8ac('0x56')){return _0x45c50d;}});return _0x1fcc14;}else{for(var _0x557ce0=0x0;_0x557ce0<_0x486224['length'];_0x557ce0++){var _0x2f5b09=_0x486224[_0x557ce0];if(_0x2f5b09[_0xa8ac('0x62')]==='agent'){var _0x4776e6=_[_0xa8ac('0x4a')](_0x2f1b29,function(_0x58aee9){return _0x58aee9[_0xa8ac('0x63')]===_0x2f5b09['id'];});if(_0x4776e6)_0x1fcc14['push'](_0x2f5b09);}else{_0x1fcc14[_0xa8ac('0x64')](_0x2f5b09);}}return _0x1fcc14;}});}else{return _0x486224;}}else{var _0x31099d=_[_0xa8ac('0x61')](_0x486224,function(_0x41fa88){if(_0x41fa88[_0xa8ac('0x62')]!==_0xa8ac('0x56')){return _0x41fa88;}});return _0x31099d;}});}else{return _0x486224;}}})[_0xa8ac('0x2a')](function(_0x150838){var _0x1f84ac=[];if(_0x150838){_0x2516da=_0x150838;for(var _0xd7be7b=0x0;_0xd7be7b<_0x150838[_0xa8ac('0x3b')];_0xd7be7b+=0x1){_0x2516da[_0xd7be7b][_0xa8ac('0x4f')]=[];_0x1f84ac[_0xa8ac('0x64')](db['ChatInternalMessage'][_0xa8ac('0x4a')]({'where':{'FromId':[_0x507c6f[_0xa8ac('0x58')]['id'],_0x150838[_0xd7be7b]['id']],'ToId':[_0x507c6f[_0xa8ac('0x58')]['id'],_0x150838[_0xd7be7b]['id']],'ChatGroupId':null},'attributes':['id',_0xa8ac('0x51'),_0xa8ac('0x65'),_0xa8ac('0x66'),_0xa8ac('0x67'),_0xa8ac('0x4c')],'order':qs[_0xa8ac('0x3d')](_0xa8ac('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x150838[_0xd7be7b])));}return BPromise[_0xa8ac('0x69')](_0x1f84ac);}return[];})['then'](function(_0x457305){return{'rows':_0x457305,'count':_0x457305[_0xa8ac('0x3b')]};})[_0xa8ac('0x2a')](respondWithResult(_0x1fe440,null))[_0xa8ac('0x46')](handleError(_0x1fe440,null));}; \ No newline at end of file +var _0x49b4=['nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','agent','admin','fullname','internal','online','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','save','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x25ca3d,_0xc0ab65){var _0x3df3bb=function(_0x17087d){while(--_0x17087d){_0x25ca3d['push'](_0x25ca3d['shift']());}};_0x3df3bb(++_0xc0ab65);}(_0x49b4,0xa1));var _0x449b=function(_0x5305f4,_0x279923){_0x5305f4=_0x5305f4-0x0;var _0x5a7d54=_0x49b4[_0x5305f4];return _0x5a7d54;};'use strict';var emlformat=require(_0x449b('0x0'));var rimraf=require(_0x449b('0x1'));var zipdir=require(_0x449b('0x2'));var jsonpatch=require(_0x449b('0x3'));var rp=require(_0x449b('0x4'));var moment=require('moment');var BPromise=require(_0x449b('0x5'));var Mustache=require(_0x449b('0x6'));var util=require(_0x449b('0x7'));var path=require(_0x449b('0x8'));var sox=require(_0x449b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x449b('0xa'));var _=require(_0x449b('0xb'));var squel=require(_0x449b('0xc'));var crypto=require(_0x449b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x449b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x449b('0xf'));var Redis=require(_0x449b('0x10'));var authService=require(_0x449b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x449b('0x12'));var logger=require('../../config/logger')(_0x449b('0x13'));var utils=require(_0x449b('0x14'));var config=require(_0x449b('0x15'));var licenseUtil=require(_0x449b('0x16'));var db=require(_0x449b('0x17'))['db'];config[_0x449b('0x18')]=_[_0x449b('0x19')](config[_0x449b('0x18')],{'host':_0x449b('0x1a'),'port':0x18eb});var socket=require(_0x449b('0x1b'))(new Redis(config[_0x449b('0x18')]));require(_0x449b('0x1c'))['register'](socket);function respondWithStatusCode(_0x8f965,_0x122f7b){_0x122f7b=_0x122f7b||0xcc;return function(_0x55ece0){if(_0x55ece0){return _0x8f965[_0x449b('0x1d')](_0x122f7b);}return _0x8f965['status'](_0x122f7b)[_0x449b('0x1e')]();};}function respondWithResult(_0x4dba93,_0x47a329){_0x47a329=_0x47a329||0xc8;return function(_0x561b32){if(_0x561b32){return _0x4dba93['status'](_0x47a329)[_0x449b('0x1f')](_0x561b32);}};}function respondWithFilteredResult(_0x1ef171,_0x3922c3){return function(_0x4f4090){if(_0x4f4090){var _0x5ba877=typeof _0x3922c3[_0x449b('0x20')]===_0x449b('0x21')&&typeof _0x3922c3[_0x449b('0x22')]===_0x449b('0x21');var _0x3143eb=_0x4f4090[_0x449b('0x23')];var _0x5996b0=_0x5ba877?0x0:_0x3922c3[_0x449b('0x20')];var _0x31dd89=_0x5ba877?_0x4f4090[_0x449b('0x23')]:_0x3922c3['offset']+_0x3922c3['limit'];var _0x4bfb1f;if(_0x31dd89>=_0x3143eb){_0x31dd89=_0x3143eb;_0x4bfb1f=0xc8;}else{_0x4bfb1f=0xce;}_0x1ef171[_0x449b('0x24')](_0x4bfb1f);return _0x1ef171['set'](_0x449b('0x25'),_0x5996b0+'-'+_0x31dd89+'/'+_0x3143eb)['json'](_0x4f4090);}return null;};}function patchUpdates(_0x1a9a2d){return function(_0x45affe){try{jsonpatch['apply'](_0x45affe,_0x1a9a2d,!![]);}catch(_0x4889bc){return BPromise['reject'](_0x4889bc);}return _0x45affe[_0x449b('0x26')]();};}function saveUpdates(_0x5cf6f6,_0x56986b){return function(_0x4109d4){if(_0x4109d4){return _0x4109d4[_0x449b('0x27')](_0x5cf6f6)[_0x449b('0x28')](function(_0x3a197d){return _0x3a197d;});}return null;};}function removeEntity(_0x467e76,_0x573d18){return function(_0x28fd1d){if(_0x28fd1d){return _0x28fd1d[_0x449b('0x29')]()['then'](function(){_0x467e76['status'](0xcc)[_0x449b('0x1e')]();});}};}function handleEntityNotFound(_0x51b388,_0x3f3d24){return function(_0x5b3cba){if(!_0x5b3cba){_0x51b388[_0x449b('0x1d')](0x194);}return _0x5b3cba;};}function handleError(_0x352051,_0x2b47ce){_0x2b47ce=_0x2b47ce||0x1f4;return function(_0x453127){logger[_0x449b('0x2a')](_0x453127[_0x449b('0x2b')]);if(_0x453127[_0x449b('0x2c')]){delete _0x453127[_0x449b('0x2c')];}_0x352051[_0x449b('0x24')](_0x2b47ce)[_0x449b('0x2d')](_0x453127);};}exports['index']=function(_0x2d4cc0,_0x5a973d){var _0x5dfc13={},_0x23f8df={},_0x48e19c={'count':0x0,'rows':[]};var _0x148dde=_[_0x449b('0x2e')](db[_0x449b('0x2f')]['rawAttributes'],function(_0x539c5f){return{'name':_0x539c5f[_0x449b('0x30')],'type':_0x539c5f['type'][_0x449b('0x31')]};});_0x23f8df['model']=_['map'](_0x148dde,_0x449b('0x2c'));_0x23f8df[_0x449b('0x32')]=_['keys'](_0x2d4cc0[_0x449b('0x32')]);_0x23f8df['filters']=_[_0x449b('0x33')](_0x23f8df[_0x449b('0x34')],_0x23f8df['query']);_0x5dfc13[_0x449b('0x35')]=_[_0x449b('0x33')](_0x23f8df[_0x449b('0x34')],qs[_0x449b('0x36')](_0x2d4cc0[_0x449b('0x32')][_0x449b('0x36')]));_0x5dfc13['attributes']=_0x5dfc13[_0x449b('0x35')][_0x449b('0x37')]?_0x5dfc13[_0x449b('0x35')]:_0x23f8df[_0x449b('0x34')];if(!_0x2d4cc0[_0x449b('0x32')][_0x449b('0x38')](_0x449b('0x39'))){_0x5dfc13[_0x449b('0x22')]=qs[_0x449b('0x22')](_0x2d4cc0['query']['limit']);_0x5dfc13['offset']=qs[_0x449b('0x20')](_0x2d4cc0[_0x449b('0x32')][_0x449b('0x20')]);}_0x5dfc13[_0x449b('0x3a')]=qs['sort'](_0x2d4cc0[_0x449b('0x32')][_0x449b('0x3b')]);_0x5dfc13[_0x449b('0x3c')]=qs[_0x449b('0x3d')](_[_0x449b('0x3e')](_0x2d4cc0[_0x449b('0x32')],_0x23f8df[_0x449b('0x3d')]),_0x148dde);if(_0x2d4cc0[_0x449b('0x32')][_0x449b('0x3f')]){_0x5dfc13[_0x449b('0x3c')]=_[_0x449b('0x40')](_0x5dfc13[_0x449b('0x3c')],{'$or':_['map'](_0x148dde,function(_0x12488a){if(_0x12488a[_0x449b('0x41')]!=='VIRTUAL'){var _0x539c44={};_0x539c44[_0x12488a[_0x449b('0x2c')]]={'$like':'%'+_0x2d4cc0[_0x449b('0x32')][_0x449b('0x3f')]+'%'};return _0x539c44;}})});}_0x5dfc13=_[_0x449b('0x40')]({},_0x5dfc13,_0x2d4cc0[_0x449b('0x42')]);var _0x340705={'where':_0x5dfc13[_0x449b('0x3c')]};return db[_0x449b('0x2f')][_0x449b('0x23')](_0x340705)[_0x449b('0x28')](function(_0x448b03){_0x48e19c[_0x449b('0x23')]=_0x448b03;if(_0x2d4cc0[_0x449b('0x32')][_0x449b('0x43')]){_0x5dfc13['include']=[{'all':!![]}];}return db[_0x449b('0x2f')][_0x449b('0x44')](_0x5dfc13);})[_0x449b('0x28')](function(_0x1076a8){_0x48e19c[_0x449b('0x45')]=_0x1076a8;return _0x48e19c;})['then'](respondWithFilteredResult(_0x5a973d,_0x5dfc13))[_0x449b('0x46')](handleError(_0x5a973d,null));};exports[_0x449b('0x47')]=function(_0x9da3df,_0x4ecf93){var _0x2e4551={'raw':!![],'where':{'id':_0x9da3df['params']['id']}},_0xcd5992={};_0xcd5992[_0x449b('0x34')]=_[_0x449b('0x48')](db[_0x449b('0x2f')]['rawAttributes']);_0xcd5992['query']=_[_0x449b('0x48')](_0x9da3df['query']);_0xcd5992[_0x449b('0x3d')]=_[_0x449b('0x33')](_0xcd5992[_0x449b('0x34')],_0xcd5992['query']);_0x2e4551['attributes']=_[_0x449b('0x33')](_0xcd5992[_0x449b('0x34')],qs[_0x449b('0x36')](_0x9da3df[_0x449b('0x32')][_0x449b('0x36')]));_0x2e4551[_0x449b('0x35')]=_0x2e4551['attributes'][_0x449b('0x37')]?_0x2e4551['attributes']:_0xcd5992[_0x449b('0x34')];if(_0x9da3df['query'][_0x449b('0x43')]){_0x2e4551[_0x449b('0x49')]=[{'all':!![]}];}_0x2e4551=_[_0x449b('0x40')]({},_0x2e4551,_0x9da3df[_0x449b('0x42')]);return db['ChatInternalMessage'][_0x449b('0x4a')](_0x2e4551)[_0x449b('0x28')](handleEntityNotFound(_0x4ecf93,null))[_0x449b('0x28')](respondWithResult(_0x4ecf93,null))[_0x449b('0x46')](handleError(_0x4ecf93,null));};exports[_0x449b('0x4b')]=function(_0x3a4cab,_0x3c44ea){return db[_0x449b('0x2f')][_0x449b('0x4b')](_0x3a4cab['body'],{})[_0x449b('0x28')](respondWithResult(_0x3c44ea,0xc9))[_0x449b('0x46')](handleError(_0x3c44ea,null));};exports[_0x449b('0x27')]=function(_0x1cc3a0,_0x3f8029){if(_0x1cc3a0[_0x449b('0x4c')]['id']){delete _0x1cc3a0['body']['id'];}return db[_0x449b('0x2f')][_0x449b('0x4a')]({'where':{'id':_0x1cc3a0['params']['id']}})[_0x449b('0x28')](handleEntityNotFound(_0x3f8029,null))['then'](saveUpdates(_0x1cc3a0[_0x449b('0x4c')],null))[_0x449b('0x28')](respondWithResult(_0x3f8029,null))[_0x449b('0x46')](handleError(_0x3f8029,null));};exports[_0x449b('0x29')]=function(_0x2a36e1,_0x37c125){return db[_0x449b('0x2f')][_0x449b('0x4a')]({'where':{'id':_0x2a36e1[_0x449b('0x4d')]['id']}})[_0x449b('0x28')](handleEntityNotFound(_0x37c125,null))[_0x449b('0x28')](removeEntity(_0x37c125,null))[_0x449b('0x46')](handleError(_0x37c125,null));};exports[_0x449b('0x4e')]=function(_0x11fc4c,_0x7bc81b){return db[_0x449b('0x2f')][_0x449b('0x4e')]()[_0x449b('0x28')](respondWithResult(_0x7bc81b,null))[_0x449b('0x46')](handleError(_0x7bc81b,null));};function wrapUser(_0x1d63e5){return function(_0x168e65){var _0x34a3fa=_0x1d63e5[_0x449b('0x4f')]({'plain':!![]});_0x34a3fa[_0x449b('0x50')]=[];if(_0x168e65){_0x34a3fa[_0x449b('0x51')]=_0x168e65[_0x449b('0x52')];_0x34a3fa[_0x449b('0x53')]=_0x168e65;}else{_0x34a3fa['lastMessageAt']=moment(0x0)[_0x449b('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x34a3fa['lastMessage']={};}return _0x34a3fa;};}exports[_0x449b('0x55')]=function(_0x24c457,_0x40e8f1,_0x43aab1){var _0x4b01ac=[];return db['User']['findAll']({'where':{'role':[_0x449b('0x56'),_0x449b('0x57'),'user']},'attributes':['id',_0x449b('0x58'),_0x449b('0x2c'),'role','userpic',_0x449b('0x59'),_0x449b('0x5a'),'lastLoginAt',_0x449b('0x5b'),'showWebBar'],'order':qs[_0x449b('0x3b')](_0x449b('0x5c')),'include':[{'model':db[_0x449b('0x5d')],'as':_0x449b('0x5e'),'attributes':['id','name',_0x449b('0x41')],'through':{'attributes':[]}}]})[_0x449b('0x28')](function(_0x4c0a1c){if(_0x4c0a1c){var _0x3ebe47=_0x24c457[_0x449b('0x5f')]['get']({'plain':!![]});if(!_0x3ebe47)throw new Error(_0x449b('0x60'));if(_0x3ebe47[_0x449b('0x61')]==='user'){return db[_0x449b('0x62')]['find']({'where':{'name':_0x449b('0x63'),'userProfileId':_0x3ebe47['userProfileId']},'raw':!![]})[_0x449b('0x28')](function(_0x4ba43b){if(_0x4ba43b){if(_0x4ba43b[_0x449b('0x64')]===0x0){return db[_0x449b('0x65')][_0x449b('0x44')]({'where':{'sectionId':_0x4ba43b['id']},'raw':!![]})[_0x449b('0x28')](function(_0x254c17){var _0x2c1aed=[];if(_['isEmpty'](_0x254c17)){_0x2c1aed=_[_0x449b('0x3f')](_0x4c0a1c,function(_0x1c0c95){if(_0x1c0c95['role']!=='agent'){return _0x1c0c95;}});return _0x2c1aed;}else{for(var _0x2a884b=0x0;_0x2a884b<_0x4c0a1c[_0x449b('0x37')];_0x2a884b++){var _0x3c49ee=_0x4c0a1c[_0x2a884b];if(_0x3c49ee[_0x449b('0x61')]===_0x449b('0x56')){var _0x3d5650=_['find'](_0x254c17,function(_0x3a677b){return _0x3a677b[_0x449b('0x66')]===_0x3c49ee['id'];});if(_0x3d5650)_0x2c1aed['push'](_0x3c49ee);}else{_0x2c1aed['push'](_0x3c49ee);}}return _0x2c1aed;}});}else{return _0x4c0a1c;}}else{var _0x46dc0d=_[_0x449b('0x3f')](_0x4c0a1c,function(_0x57ec05){if(_0x57ec05[_0x449b('0x61')]!=='agent'){return _0x57ec05;}});return _0x46dc0d;}});}else{return _0x4c0a1c;}}})['then'](function(_0x5b781a){var _0x22d776=[];if(_0x5b781a){_0x4b01ac=_0x5b781a;for(var _0x4bff2d=0x0;_0x4bff2d<_0x5b781a[_0x449b('0x37')];_0x4bff2d+=0x1){_0x4b01ac[_0x4bff2d][_0x449b('0x50')]=[];_0x22d776[_0x449b('0x67')](db[_0x449b('0x2f')][_0x449b('0x4a')]({'where':{'FromId':[_0x24c457[_0x449b('0x5f')]['id'],_0x5b781a[_0x4bff2d]['id']],'ToId':[_0x24c457['user']['id'],_0x5b781a[_0x4bff2d]['id']],'ChatGroupId':null},'attributes':['id',_0x449b('0x52'),_0x449b('0x68'),_0x449b('0x69'),_0x449b('0x6a'),'body'],'order':qs[_0x449b('0x3b')](_0x449b('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x449b('0x28')](wrapUser(_0x5b781a[_0x4bff2d])));}return BPromise[_0x449b('0x6c')](_0x22d776);}return[];})['then'](function(_0x15b043){return{'rows':_0x15b043,'count':_0x15b043[_0x449b('0x37')]};})[_0x449b('0x28')](respondWithResult(_0x40e8f1,null))[_0x449b('0x46')](handleError(_0x40e8f1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a1f796b..c40923c 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 _0x0641=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','update','remove'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0641,0x15c));var _0x1064=function(_0x4753b7,_0x2660d1){_0x4753b7=_0x4753b7-0x0;var _0x3e6fa9=_0x0641[_0x4753b7];return _0x3e6fa9;};'use strict';var EventEmitter=require(_0x1064('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1064('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1064('0x2'),'afterDestroy':_0x1064('0x3')};function emitEvent(_0x28a705){return function(_0x3ebe26,_0x39221c,_0x3c8578){ChatInternalMessageEvents['emit'](_0x28a705+':'+_0x3ebe26['id'],_0x3ebe26);ChatInternalMessageEvents[_0x1064('0x4')](_0x28a705,_0x3ebe26);_0x3c8578(null);};}for(var e in events){if(events[_0x1064('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1064('0x6')](e,emitEvent(event));}}module[_0x1064('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x3dd3=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x405b8e,_0x30e884){var _0xb60e42=function(_0x1cde4c){while(--_0x1cde4c){_0x405b8e['push'](_0x405b8e['shift']());}};_0xb60e42(++_0x30e884);}(_0x3dd3,0x185));var _0x33dd=function(_0x5621c2,_0x54fca0){_0x5621c2=_0x5621c2-0x0;var _0x2dac84=_0x3dd3[_0x5621c2];return _0x2dac84;};'use strict';var EventEmitter=require(_0x33dd('0x0'));var ChatInternalMessage=require(_0x33dd('0x1'))['db'][_0x33dd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x33dd('0x3')](0x0);var events={'afterCreate':_0x33dd('0x4'),'afterUpdate':_0x33dd('0x5'),'afterDestroy':_0x33dd('0x6')};function emitEvent(_0x2084b4){return function(_0x5818ff,_0x53adc4,_0x124292){ChatInternalMessageEvents[_0x33dd('0x7')](_0x2084b4+':'+_0x5818ff['id'],_0x5818ff);ChatInternalMessageEvents['emit'](_0x2084b4,_0x5818ff);_0x124292(null);};}for(var e in events){if(events[_0x33dd('0x8')](e)){var event=events[e];ChatInternalMessage[_0x33dd('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 2202abb..c275ce5 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 _0x11b2=['util','../../config/logger','api','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x43f611,_0x4e4167){var _0x394b88=function(_0x3c6aac){while(--_0x3c6aac){_0x43f611['push'](_0x43f611['shift']());}};_0x394b88(++_0x4e4167);}(_0x11b2,0x145));var _0x211b=function(_0x2e81bf,_0x28654d){_0x2e81bf=_0x2e81bf-0x0;var _0x35f2ce=_0x11b2[_0x2e81bf];return _0x35f2ce;};'use strict';var _=require('lodash');var util=require(_0x211b('0x0'));var logger=require(_0x211b('0x1'))(_0x211b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x211b('0x3'));var rimraf=require(_0x211b('0x4'));var config=require(_0x211b('0x5'));var attributes=require(_0x211b('0x6'));module[_0x211b('0x7')]=function(_0x5b7827,_0x384d72){return _0x5b7827[_0x211b('0x8')](_0x211b('0x9'),attributes,{'tableName':_0x211b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x211b('0xb'),'collate':_0x211b('0xc')});}; \ No newline at end of file +var _0xc0ff=['exports','chat_internal_messages','utf8mb4','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc0ff,0x1a7));var _0xfc0f=function(_0x4c55c2,_0x5dde7e){_0x4c55c2=_0x4c55c2-0x0;var _0x469bab=_0xc0ff[_0x4c55c2];return _0x469bab;};'use strict';var _=require(_0xfc0f('0x0'));var util=require(_0xfc0f('0x1'));var logger=require('../../config/logger')(_0xfc0f('0x2'));var moment=require('moment');var BPromise=require(_0xfc0f('0x3'));var rp=require(_0xfc0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc0f('0x5'));var config=require(_0xfc0f('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xfc0f('0x7')]=function(_0x58f746,_0x2ba895){return _0x58f746['define']('ChatInternalMessage',attributes,{'tableName':_0xfc0f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc0f('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f85c8e9..819e735 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 _0x2ec0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x2ec0,0x69));var _0x02ec=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x2ec0[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0x02ec('0x0'));var util=require(_0x02ec('0x1'));var moment=require(_0x02ec('0x2'));var BPromise=require(_0x02ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02ec('0x4'));var db=require(_0x02ec('0x5'))['db'];var utils=require(_0x02ec('0x6'));var logger=require(_0x02ec('0x7'))(_0x02ec('0x8'));var config=require(_0x02ec('0x9'));var jayson=require(_0x02ec('0xa'));var client=jayson[_0x02ec('0xb')]['http']({'port':0x232a});config[_0x02ec('0xc')]=_[_0x02ec('0xd')](config['redis'],{'host':_0x02ec('0xe'),'port':0x18eb});var socket=require(_0x02ec('0xf'))(new Redis(config[_0x02ec('0xc')]));require('./chatInternalMessage.socket')[_0x02ec('0x10')](socket);function respondWithRpcPromise(_0x58df9f,_0x3da8f6,_0x1e4c8b){return new BPromise(function(_0x2a4f2a,_0x58aa82){return client[_0x02ec('0x11')](_0x58df9f,_0x1e4c8b)[_0x02ec('0x12')](function(_0x38db66){logger[_0x02ec('0x13')](_0x02ec('0x14'),_0x3da8f6,_0x02ec('0x15'));logger[_0x02ec('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3da8f6,_0x02ec('0x15'),JSON['stringify'](_0x38db66));if(_0x38db66[_0x02ec('0x17')]){if(_0x38db66[_0x02ec('0x17')][_0x02ec('0x18')]===0x1f4){logger['error'](_0x02ec('0x14'),_0x3da8f6,_0x38db66[_0x02ec('0x17')][_0x02ec('0x19')]);return _0x58aa82(_0x38db66[_0x02ec('0x17')]['message']);}logger[_0x02ec('0x17')](_0x02ec('0x14'),_0x3da8f6,_0x38db66[_0x02ec('0x17')][_0x02ec('0x19')]);return _0x2a4f2a(_0x38db66[_0x02ec('0x17')][_0x02ec('0x19')]);}else{logger['info'](_0x02ec('0x14'),_0x3da8f6,'request\x20sent');_0x2a4f2a(_0x38db66[_0x02ec('0x1a')][_0x02ec('0x19')]);}})[_0x02ec('0x1b')](function(_0x5ec58e){logger['error'](_0x02ec('0x14'),_0x3da8f6,_0x5ec58e);_0x58aa82(_0x5ec58e);});});} \ No newline at end of file +var _0x7004=['../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4559bf,_0x2e89ed){var _0x34bbf8=function(_0x2f674c){while(--_0x2f674c){_0x4559bf['push'](_0x4559bf['shift']());}};_0x34bbf8(++_0x2e89ed);}(_0x7004,0x117));var _0x4700=function(_0x304bd5,_0xea943d){_0x304bd5=_0x304bd5-0x0;var _0x2bcd87=_0x7004[_0x304bd5];return _0x2bcd87;};'use strict';var _=require(_0x4700('0x0'));var util=require(_0x4700('0x1'));var moment=require(_0x4700('0x2'));var BPromise=require(_0x4700('0x3'));var rs=require(_0x4700('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4700('0x5'))['db'];var utils=require(_0x4700('0x6'));var logger=require(_0x4700('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4700('0x8'));var client=jayson[_0x4700('0x9')][_0x4700('0xa')]({'port':0x232a});config[_0x4700('0xb')]=_['defaults'](config['redis'],{'host':_0x4700('0xc'),'port':0x18eb});var socket=require(_0x4700('0xd'))(new Redis(config[_0x4700('0xb')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5d1b0a,_0x552a6a,_0x13180f){return new BPromise(function(_0x1b1ebc,_0x2224d9){return client[_0x4700('0xe')](_0x5d1b0a,_0x13180f)['then'](function(_0x5079fa){logger[_0x4700('0xf')](_0x4700('0x10'),_0x552a6a,'request\x20sent');logger['debug'](_0x4700('0x11'),_0x552a6a,'request\x20sent',JSON[_0x4700('0x12')](_0x5079fa));if(_0x5079fa[_0x4700('0x13')]){if(_0x5079fa['error']['code']===0x1f4){logger[_0x4700('0x13')](_0x4700('0x10'),_0x552a6a,_0x5079fa['error'][_0x4700('0x14')]);return _0x2224d9(_0x5079fa['error'][_0x4700('0x14')]);}logger[_0x4700('0x13')](_0x4700('0x10'),_0x552a6a,_0x5079fa[_0x4700('0x13')][_0x4700('0x14')]);return _0x1b1ebc(_0x5079fa[_0x4700('0x13')][_0x4700('0x14')]);}else{logger[_0x4700('0xf')](_0x4700('0x10'),_0x552a6a,_0x4700('0x15'));_0x1b1ebc(_0x5079fa['result'][_0x4700('0x14')]);}})['catch'](function(_0x10c21c){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x552a6a,_0x10c21c);_0x2224d9(_0x10c21c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 53b2b67..332fc78 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 _0xf7b7=['register','chatInternalMessage:','update','emit','removeListener'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0xf7b7,0x110));var _0x7f7b=function(_0x3a3cdc,_0x128594){_0x3a3cdc=_0x3a3cdc-0x0;var _0x33c334=_0xf7b7[_0x3a3cdc];return _0x33c334;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save','remove',_0x7f7b('0x0')];function createListener(_0x3acf6e,_0x502201){return function(_0x23ba87){_0x502201[_0x7f7b('0x1')](_0x3acf6e,_0x23ba87);};}function removeListener(_0x2b6d7a,_0x1eab4c){return function(){ChatInternalMessageEvents[_0x7f7b('0x2')](_0x2b6d7a,_0x1eab4c);};}exports[_0x7f7b('0x3')]=function(_0x5ecc88){for(var _0x1b73c7=0x0,_0x4326da=events['length'];_0x1b73c7<_0x4326da;_0x1b73c7++){var _0x1bf900=events[_0x1b73c7];var _0x1333a3=createListener(_0x7f7b('0x4')+_0x1bf900,_0x5ecc88);ChatInternalMessageEvents['on'](_0x1bf900,_0x1333a3);}}; \ No newline at end of file +var _0xb46e=['update','emit','removeListener','register','length','./chatInternalMessage.events','save','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb46e,0x115));var _0xeb46=function(_0x441e18,_0x2a4780){_0x441e18=_0x441e18-0x0;var _0x4adf21=_0xb46e[_0x441e18];return _0x4adf21;};'use strict';var ChatInternalMessageEvents=require(_0xeb46('0x0'));var events=[_0xeb46('0x1'),_0xeb46('0x2'),_0xeb46('0x3')];function createListener(_0x569f45,_0x2ed441){return function(_0x3ee1c2){_0x2ed441[_0xeb46('0x4')](_0x569f45,_0x3ee1c2);};}function removeListener(_0x3dc2ee,_0x10d19f){return function(){ChatInternalMessageEvents[_0xeb46('0x5')](_0x3dc2ee,_0x10d19f);};}exports[_0xeb46('0x6')]=function(_0xcd134d){for(var _0xa9e7a0=0x0,_0x3e8789=events[_0xeb46('0x7')];_0xa9e7a0<_0x3e8789;_0xa9e7a0++){var _0x3b4c87=events[_0xa9e7a0];var _0x26e16e=createListener('chatInternalMessage:'+_0x3b4c87,_0xcd134d);ChatInternalMessageEvents['on'](_0x3b4c87,_0x26e16e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3efd396..5f3ee42 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 _0x42d7=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','getUsers','/:id','show','post','create','put','update','delete','exports'];(function(_0x2378ef,_0x1b182e){var _0x9dc6fb=function(_0x4ce9e0){while(--_0x4ce9e0){_0x2378ef['push'](_0x2378ef['shift']());}};_0x9dc6fb(++_0x1b182e);}(_0x42d7,0xa8));var _0x742d=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x42d7[_0x6173fc];return _0x965fbe;};'use strict';var multer=require(_0x742d('0x0'));var util=require('util');var path=require(_0x742d('0x1'));var timeout=require(_0x742d('0x2'));var express=require(_0x742d('0x3'));var router=express[_0x742d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x742d('0x5'));var interaction=require(_0x742d('0x6'));var config=require(_0x742d('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x742d('0x8')](),controller[_0x742d('0x9')]);router[_0x742d('0xa')](_0x742d('0xb'),auth[_0x742d('0x8')](),controller['describe']);router[_0x742d('0xa')]('/users',auth[_0x742d('0x8')](),controller[_0x742d('0xc')]);router[_0x742d('0xa')](_0x742d('0xd'),auth[_0x742d('0x8')](),controller[_0x742d('0xe')]);router[_0x742d('0xf')]('/',auth['isAuthenticated'](),controller[_0x742d('0x10')]);router[_0x742d('0x11')](_0x742d('0xd'),controller[_0x742d('0x12')]);router[_0x742d('0x13')](_0x742d('0xd'),auth[_0x742d('0x8')](),controller['destroy']);module[_0x742d('0x14')]=router; \ No newline at end of file +var _0x6f26=['create','put','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','post'];(function(_0x284ddd,_0x498700){var _0x3d6b36=function(_0x559d0c){while(--_0x559d0c){_0x284ddd['push'](_0x284ddd['shift']());}};_0x3d6b36(++_0x498700);}(_0x6f26,0x12b));var _0x66f2=function(_0x41ec5a,_0x4f11dc){_0x41ec5a=_0x41ec5a-0x0;var _0x1d2666=_0x6f26[_0x41ec5a];return _0x1d2666;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x66f2('0x0'));var timeout=require(_0x66f2('0x1'));var express=require('express');var router=express[_0x66f2('0x2')]();var fs_extra=require(_0x66f2('0x3'));var auth=require(_0x66f2('0x4'));var interaction=require(_0x66f2('0x5'));var config=require(_0x66f2('0x6'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x66f2('0x7')](),controller[_0x66f2('0x8')]);router[_0x66f2('0x9')](_0x66f2('0xa'),auth['isAuthenticated'](),controller[_0x66f2('0xb')]);router[_0x66f2('0x9')](_0x66f2('0xc'),auth[_0x66f2('0x7')](),controller[_0x66f2('0xd')]);router['get'](_0x66f2('0xe'),auth[_0x66f2('0x7')](),controller['show']);router[_0x66f2('0xf')]('/',auth[_0x66f2('0x7')](),controller[_0x66f2('0x10')]);router[_0x66f2('0x11')](_0x66f2('0xe'),controller['update']);router[_0x66f2('0x12')](_0x66f2('0xe'),auth[_0x66f2('0x7')](),controller[_0x66f2('0x13')]);module[_0x66f2('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 3c76aee..a6f46c8 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 _0xa866=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa866,0x6a));var _0x6a86=function(_0x4c8a0e,_0x2e96b9){_0x4c8a0e=_0x4c8a0e-0x0;var _0x59c890=_0xa866[_0x4c8a0e];return _0x59c890;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'body':{'type':Sequelize[_0x6a86('0x2')](_0x6a86('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6a86('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6a86('0x5')]('in',_0x6a86('0x6')),'defaultValue':_0x6a86('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6a86('0x7')]},'providerResponse':{'type':Sequelize[_0x6a86('0x2')]}}; \ No newline at end of file +var _0xb7e2=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x4d37b6,_0x435a80){var _0x4da88b=function(_0x5d19b6){while(--_0x5d19b6){_0x4d37b6['push'](_0x4d37b6['shift']());}};_0x4da88b(++_0x435a80);}(_0xb7e2,0x103));var _0x2b7e=function(_0x34c154,_0x4ecb55){_0x34c154=_0x34c154-0x0;var _0x4a4756=_0xb7e2[_0x34c154];return _0x4a4756;};'use strict';var Sequelize=require(_0x2b7e('0x0'));module['exports']={'body':{'type':Sequelize[_0x2b7e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2b7e('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b7e('0x3')]('in','out'),'defaultValue':_0x2b7e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2b7e('0x5')]},'providerName':{'type':Sequelize[_0x2b7e('0x6')]},'providerResponse':{'type':Sequelize[_0x2b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index dad1bc8..ed26599 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x4e23b5,_0x2c0c1){var _0x2cac37=function(_0x41e244){while(--_0x41e244){_0x4e23b5['push'](_0x4e23b5['shift']());}};_0x2cac37(++_0x2c0c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x391ac4,_0x276b6f){var _0x45ce73=function(_0x3a6c4e){while(--_0x3a6c4e){_0x391ac4['push'](_0x391ac4['shift']());}};_0x45ce73(++_0x276b6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index afb883a..2dc1fb2 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 _0x506a=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2b1a6c,_0x107309){var _0x28461e=function(_0x3cbd94){while(--_0x3cbd94){_0x2b1a6c['push'](_0x2b1a6c['shift']());}};_0x28461e(++_0x107309);}(_0x506a,0x7a));var _0xa506=function(_0x7457dc,_0x3a47af){_0x7457dc=_0x7457dc-0x0;var _0x46b1f5=_0x506a[_0x7457dc];return _0x46b1f5;};'use strict';var EventEmitter=require(_0xa506('0x0'));var ChatMessage=require(_0xa506('0x1'))['db'][_0xa506('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa506('0x3')](0x0);var events={'afterCreate':_0xa506('0x4'),'afterUpdate':_0xa506('0x5'),'afterDestroy':_0xa506('0x6')};function emitEvent(_0x3702d9){return function(_0x27a176,_0x57753e,_0x1a5d95){ChatMessageEvents[_0xa506('0x7')](_0x3702d9+':'+_0x27a176['id'],_0x27a176);ChatMessageEvents[_0xa506('0x7')](_0x3702d9,_0x27a176);_0x1a5d95(null);};}for(var e in events){if(events[_0xa506('0x8')](e)){var event=events[e];ChatMessage[_0xa506('0x9')](e,emitEvent(event));}}module[_0xa506('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0xeb3d=['remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update'];(function(_0x87c16a,_0x39b1cc){var _0x369b9e=function(_0x50a7db){while(--_0x50a7db){_0x87c16a['push'](_0x87c16a['shift']());}};_0x369b9e(++_0x39b1cc);}(_0xeb3d,0x11c));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xdeb3('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdeb3('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdeb3('0x2'),'afterDestroy':_0xdeb3('0x3')};function emitEvent(_0xbcda5a){return function(_0x5a1b63,_0x3fd9ee,_0x275817){ChatMessageEvents[_0xdeb3('0x4')](_0xbcda5a+':'+_0x5a1b63['id'],_0x5a1b63);ChatMessageEvents[_0xdeb3('0x4')](_0xbcda5a,_0x5a1b63);_0x275817(null);};}for(var e in events){if(events[_0xdeb3('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xdeb3('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0ea48b0..b6b5b06 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 _0x808e=['define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','path','rimraf','./chatMessage.attributes','exports'];(function(_0x51e79c,_0x51485e){var _0x2467be=function(_0xbf70f0){while(--_0xbf70f0){_0x51e79c['push'](_0x51e79c['shift']());}};_0x2467be(++_0x51485e);}(_0x808e,0x178));var _0xe808=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x808e[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0xe808('0x0'));var logger=require('../../config/logger')(_0xe808('0x1'));var moment=require(_0xe808('0x2'));var BPromise=require('bluebird');var rp=require(_0xe808('0x3'));var fs=require('fs');var path=require(_0xe808('0x4'));var rimraf=require(_0xe808('0x5'));var config=require('../../config/environment');var attributes=require(_0xe808('0x6'));module[_0xe808('0x7')]=function(_0x173771,_0xf0aeed){return _0x173771[_0xe808('0x8')](_0xe808('0x9'),attributes,{'tableName':_0xe808('0xa'),'paranoid':![],'indexes':[{'name':_0xe808('0xb'),'fields':[_0xe808('0xc')],'type':_0xe808('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56d975,_0x1f0464,_0x29f10d){var _0x8df6b5=_0x173771[_0xe808('0xe')];var _0x14f5dd=_0x56d975['get']({'plain':!![]});if(_0x14f5dd[_0xe808('0xf')][_0xe808('0x10')]()==='in'||_0x14f5dd[_0xe808('0xf')]['toLowerCase']()===_0xe808('0x11')&&!_0x14f5dd[_0xe808('0x12')]&&!_['isNil'](_0x14f5dd['UserId'])){_0x8df6b5['ChatInteraction']['findOne']({'where':{'id':_0x14f5dd[_0xe808('0x13')]}})['then'](function(_0x557e38){if(_0x557e38){_0x557e38[_0xe808('0x14')]({'lastMsgAt':_0x14f5dd['createdAt'],'lastMsgDirection':_0x14f5dd[_0xe808('0xf')]['toLowerCase']()});}})['catch'](function(_0x3e5bb0){console[_0xe808('0x15')](_0x3e5bb0);});}_0x29f10d();}},'charset':_0xe808('0x16'),'collate':_0xe808('0x17')});}; \ No newline at end of file +var _0xf96e=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x47c3c2,_0x42ff1b){var _0x1d628f=function(_0x4c6005){while(--_0x4c6005){_0x47c3c2['push'](_0x47c3c2['shift']());}};_0x1d628f(++_0x42ff1b);}(_0xf96e,0x196));var _0xef96=function(_0x313c39,_0x492c8d){_0x313c39=_0x313c39-0x0;var _0x5d9998=_0xf96e[_0x313c39];return _0x5d9998;};'use strict';var _=require(_0xef96('0x0'));var util=require(_0xef96('0x1'));var logger=require(_0xef96('0x2'))(_0xef96('0x3'));var moment=require(_0xef96('0x4'));var BPromise=require(_0xef96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef96('0x6'));var rimraf=require('rimraf');var config=require(_0xef96('0x7'));var attributes=require(_0xef96('0x8'));module[_0xef96('0x9')]=function(_0x4f20d4,_0x173825){return _0x4f20d4[_0xef96('0xa')]('ChatMessage',attributes,{'tableName':_0xef96('0xb'),'paranoid':![],'indexes':[{'name':_0xef96('0xc'),'fields':[_0xef96('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x481bc3,_0x24b246,_0x3527de){var _0x17e93d=_0x4f20d4[_0xef96('0xe')];var _0xd39098=_0x481bc3[_0xef96('0xf')]({'plain':!![]});if(_0xd39098[_0xef96('0x10')][_0xef96('0x11')]()==='in'||_0xd39098['direction'][_0xef96('0x11')]()===_0xef96('0x12')&&!_0xd39098[_0xef96('0x13')]&&!_[_0xef96('0x14')](_0xd39098[_0xef96('0x15')])){_0x17e93d['ChatInteraction'][_0xef96('0x16')]({'where':{'id':_0xd39098[_0xef96('0x17')]}})['then'](function(_0x2a0c53){if(_0x2a0c53){_0x2a0c53[_0xef96('0x18')]({'lastMsgAt':_0xd39098[_0xef96('0x19')],'lastMsgDirection':_0xd39098[_0xef96('0x10')]['toLowerCase']()});}})[_0xef96('0x1a')](function(_0x39bfb3){console['error'](_0x39bfb3);});}_0x3527de();}},'charset':_0xef96('0x1b'),'collate':_0xef96('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index ecf4ee2..260e806 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 _0x388e=['options','raw','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body'];(function(_0xc2d4e7,_0x2930b0){var _0x4a829b=function(_0x4be6ba){while(--_0x4be6ba){_0xc2d4e7['push'](_0xc2d4e7['shift']());}};_0x4a829b(++_0x2930b0);}(_0x388e,0x6d));var _0xe388=function(_0x550c73,_0x417d54){_0x550c73=_0x550c73-0x0;var _0x4481ef=_0x388e[_0x550c73];return _0x4481ef;};'use strict';var _=require('lodash');var util=require(_0xe388('0x0'));var moment=require(_0xe388('0x1'));var BPromise=require(_0xe388('0x2'));var rs=require(_0xe388('0x3'));var fs=require('fs');var Redis=require(_0xe388('0x4'));var db=require(_0xe388('0x5'))['db'];var utils=require(_0xe388('0x6'));var logger=require(_0xe388('0x7'))(_0xe388('0x8'));var config=require(_0xe388('0x9'));var jayson=require(_0xe388('0xa'));var client=jayson[_0xe388('0xb')][_0xe388('0xc')]({'port':0x232a});config['redis']=_[_0xe388('0xd')](config[_0xe388('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe388('0xe')]));require('./chatMessage.socket')[_0xe388('0xf')](socket);function respondWithRpcPromise(_0x9033d5,_0x4e0edc,_0x403f99){return new BPromise(function(_0x17e31b,_0x1320ed){return client[_0xe388('0x10')](_0x9033d5,_0x403f99)[_0xe388('0x11')](function(_0x38c0ed){logger[_0xe388('0x12')](_0xe388('0x13'),_0x4e0edc,_0xe388('0x14'));logger['debug'](_0xe388('0x15'),_0x4e0edc,_0xe388('0x14'),JSON['stringify'](_0x38c0ed));if(_0x38c0ed[_0xe388('0x16')]){if(_0x38c0ed[_0xe388('0x16')][_0xe388('0x17')]===0x1f4){logger['error'](_0xe388('0x13'),_0x4e0edc,_0x38c0ed['error'][_0xe388('0x18')]);return _0x1320ed(_0x38c0ed[_0xe388('0x16')][_0xe388('0x18')]);}logger[_0xe388('0x16')](_0xe388('0x13'),_0x4e0edc,_0x38c0ed[_0xe388('0x16')]['message']);return _0x17e31b(_0x38c0ed[_0xe388('0x16')][_0xe388('0x18')]);}else{logger[_0xe388('0x12')](_0xe388('0x13'),_0x4e0edc,_0xe388('0x14'));_0x17e31b(_0x38c0ed[_0xe388('0x19')][_0xe388('0x18')]);}})[_0xe388('0x1a')](function(_0x5aae52){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4e0edc,_0x5aae52);_0x1320ed(_0x5aae52);});});}exports[_0xe388('0x1b')]=function(_0x10a076){var _0x1d6fcf=this;return new Promise(function(_0x6614be,_0x3e0693){return db[_0xe388('0x1c')][_0xe388('0x1d')](_0x10a076[_0xe388('0x1e')],{'raw':_0x10a076[_0xe388('0x1f')]?_0x10a076[_0xe388('0x1f')][_0xe388('0x20')]===undefined?!![]:![]:!![]})[_0xe388('0x11')](function(_0x207b95){logger[_0xe388('0x12')](_0xe388('0x1b'),_0x10a076);logger[_0xe388('0x21')](_0xe388('0x1b'),_0x10a076,JSON[_0xe388('0x22')](_0x207b95));_0x6614be(_0x207b95);})[_0xe388('0x1a')](function(_0xdea4d2){logger['error'](_0xe388('0x1b'),_0xdea4d2[_0xe388('0x18')],_0x10a076);_0x3e0693(_0x1d6fcf['error'](0x1f4,_0xdea4d2['message']));});});}; \ No newline at end of file +var _0x4855=['message','request\x20sent','catch','CreateChatMessage','create','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','error','code'];(function(_0x5f5c59,_0x169b7c){var _0x5a5f48=function(_0x5c6489){while(--_0x5c6489){_0x5f5c59['push'](_0x5f5c59['shift']());}};_0x5a5f48(++_0x169b7c);}(_0x4855,0xce));var _0x5485=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x4855[_0x1044e5];return _0x5ad0dd;};'use strict';var _=require(_0x5485('0x0'));var util=require(_0x5485('0x1'));var moment=require(_0x5485('0x2'));var BPromise=require(_0x5485('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5485('0x4'));var db=require(_0x5485('0x5'))['db'];var utils=require(_0x5485('0x6'));var logger=require(_0x5485('0x7'))(_0x5485('0x8'));var config=require(_0x5485('0x9'));var jayson=require(_0x5485('0xa'));var client=jayson[_0x5485('0xb')][_0x5485('0xc')]({'port':0x232a});config[_0x5485('0xd')]=_[_0x5485('0xe')](config[_0x5485('0xd')],{'host':_0x5485('0xf'),'port':0x18eb});var socket=require(_0x5485('0x10'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x5485('0x11')](socket);function respondWithRpcPromise(_0x3c3e66,_0x2340e3,_0x173e4c){return new BPromise(function(_0x2c3167,_0xd30f63){return client[_0x5485('0x12')](_0x3c3e66,_0x173e4c)[_0x5485('0x13')](function(_0x4a6108){logger[_0x5485('0x14')](_0x5485('0x15'),_0x2340e3,'request\x20sent');logger[_0x5485('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2340e3,'request\x20sent',JSON['stringify'](_0x4a6108));if(_0x4a6108[_0x5485('0x17')]){if(_0x4a6108[_0x5485('0x17')][_0x5485('0x18')]===0x1f4){logger[_0x5485('0x17')](_0x5485('0x15'),_0x2340e3,_0x4a6108[_0x5485('0x17')][_0x5485('0x19')]);return _0xd30f63(_0x4a6108['error'][_0x5485('0x19')]);}logger[_0x5485('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2340e3,_0x4a6108[_0x5485('0x17')]['message']);return _0x2c3167(_0x4a6108[_0x5485('0x17')][_0x5485('0x19')]);}else{logger[_0x5485('0x14')](_0x5485('0x15'),_0x2340e3,_0x5485('0x1a'));_0x2c3167(_0x4a6108['result']['message']);}})[_0x5485('0x1b')](function(_0x4fac3a){logger[_0x5485('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2340e3,_0x4fac3a);_0xd30f63(_0x4fac3a);});});}exports[_0x5485('0x1c')]=function(_0x46f50f){var _0x5633f9=this;return new Promise(function(_0x38a05b,_0x58e29c){return db['ChatMessage'][_0x5485('0x1d')](_0x46f50f['body'],{'raw':_0x46f50f[_0x5485('0x1e')]?_0x46f50f['options'][_0x5485('0x1f')]===undefined?!![]:![]:!![]})[_0x5485('0x13')](function(_0x55b886){logger[_0x5485('0x14')](_0x5485('0x1c'),_0x46f50f);logger[_0x5485('0x16')]('CreateChatMessage',_0x46f50f,JSON[_0x5485('0x20')](_0x55b886));_0x38a05b(_0x55b886);})[_0x5485('0x1b')](function(_0x44f9f5){logger['error'](_0x5485('0x1c'),_0x44f9f5[_0x5485('0x19')],_0x46f50f);_0x58e29c(_0x5633f9[_0x5485('0x17')](0x1f4,_0x44f9f5[_0x5485('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index c07c128..beca3b3 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 _0xec46=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x3faf45,_0x34bf90){var _0x100ef4=function(_0x26ed71){while(--_0x26ed71){_0x3faf45['push'](_0x3faf45['shift']());}};_0x100ef4(++_0x34bf90);}(_0xec46,0x19c));var _0x6ec4=function(_0x222b3f,_0x133be7){_0x222b3f=_0x222b3f-0x0;var _0x20b57a=_0xec46[_0x222b3f];return _0x20b57a;};'use strict';var ChatMessageEvents=require(_0x6ec4('0x0'));var events=[_0x6ec4('0x1'),_0x6ec4('0x2'),_0x6ec4('0x3')];function createListener(_0x5e854b,_0x5052d2){return function(_0x307c5c){_0x5052d2[_0x6ec4('0x4')](_0x5e854b,_0x307c5c);};}function removeListener(_0x86b9f8,_0x53bbed){return function(){ChatMessageEvents[_0x6ec4('0x5')](_0x86b9f8,_0x53bbed);};}exports[_0x6ec4('0x6')]=function(_0x55b203){for(var _0x533fda=0x0,_0x55d260=events[_0x6ec4('0x7')];_0x533fda<_0x55d260;_0x533fda++){var _0x391ed9=events[_0x533fda];var _0x42b81b=createListener(_0x6ec4('0x8')+_0x391ed9,_0x55b203);ChatMessageEvents['on'](_0x391ed9,_0x42b81b);}}; \ No newline at end of file +var _0x9576=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x5df0d4,_0x5d9613){var _0xc510f7=function(_0x5a8120){while(--_0x5a8120){_0x5df0d4['push'](_0x5df0d4['shift']());}};_0xc510f7(++_0x5d9613);}(_0x9576,0x182));var _0x6957=function(_0x29a479,_0x251eb8){_0x29a479=_0x29a479-0x0;var _0x2493d5=_0x9576[_0x29a479];return _0x2493d5;};'use strict';var ChatMessageEvents=require(_0x6957('0x0'));var events=[_0x6957('0x1'),_0x6957('0x2'),_0x6957('0x3')];function createListener(_0x47fd53,_0x4ee0d8){return function(_0xf9d8fc){_0x4ee0d8[_0x6957('0x4')](_0x47fd53,_0xf9d8fc);};}function removeListener(_0x9e834,_0x10ed80){return function(){ChatMessageEvents[_0x6957('0x5')](_0x9e834,_0x10ed80);};}exports[_0x6957('0x6')]=function(_0x2eb79e){for(var _0x49e08a=0x0,_0x6d8af8=events[_0x6957('0x7')];_0x49e08a<_0x6d8af8;_0x49e08a++){var _0x70b8c4=events[_0x49e08a];var _0x2e5727=createListener(_0x6957('0x8')+_0x70b8c4,_0x2eb79e);ChatMessageEvents['on'](_0x70b8c4,_0x2e5727);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c313b07..4d09834 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 _0xc160=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','create','put','update','accept','/:id/reject','reject'];(function(_0x3a729c,_0x258137){var _0x584a06=function(_0x2d0a71){while(--_0x2d0a71){_0x3a729c['push'](_0x3a729c['shift']());}};_0x584a06(++_0x258137);}(_0xc160,0x115));var _0x0c16=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0xc160[_0x51d71a];return _0xff01f1;};'use strict';var multer=require(_0x0c16('0x0'));var util=require(_0x0c16('0x1'));var path=require(_0x0c16('0x2'));var timeout=require(_0x0c16('0x3'));var express=require('express');var router=express[_0x0c16('0x4')]();var fs_extra=require(_0x0c16('0x5'));var auth=require(_0x0c16('0x6'));var interaction=require(_0x0c16('0x7'));var config=require('../../config/environment');var controller=require(_0x0c16('0x8'));router[_0x0c16('0x9')]('/',auth[_0x0c16('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0c16('0xb')]);router[_0x0c16('0x9')](_0x0c16('0xc'),auth[_0x0c16('0xa')](),controller[_0x0c16('0xd')]);router[_0x0c16('0xe')]('/',auth[_0x0c16('0xa')](),interaction[_0x0c16('0xf')]('chat','chatmessage:create'),controller[_0x0c16('0x10')]);router[_0x0c16('0x11')](_0x0c16('0xc'),controller[_0x0c16('0x12')]);router[_0x0c16('0x11')]('/:id/accept',auth[_0x0c16('0xa')](),controller[_0x0c16('0x13')]);router[_0x0c16('0x11')](_0x0c16('0x14'),auth[_0x0c16('0xa')](),controller[_0x0c16('0x15')]);router['delete'](_0x0c16('0xc'),auth[_0x0c16('0xa')](),controller[_0x0c16('0x16')]);module['exports']=router; \ No newline at end of file +var _0x16be=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','chatmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0x16be,0x14b));var _0xe16b=function(_0x209847,_0x29c9f9){_0x209847=_0x209847-0x0;var _0x157ec1=_0x16be[_0x209847];return _0x157ec1;};'use strict';var multer=require(_0xe16b('0x0'));var util=require(_0xe16b('0x1'));var path=require(_0xe16b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe16b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe16b('0x4'));var interaction=require(_0xe16b('0x5'));var config=require(_0xe16b('0x6'));var controller=require(_0xe16b('0x7'));router[_0xe16b('0x8')]('/',auth[_0xe16b('0x9')](),controller[_0xe16b('0xa')]);router['get']('/describe',auth[_0xe16b('0x9')](),controller[_0xe16b('0xb')]);router[_0xe16b('0x8')](_0xe16b('0xc'),auth[_0xe16b('0x9')](),controller['show']);router[_0xe16b('0xd')]('/',auth[_0xe16b('0x9')](),interaction[_0xe16b('0xe')]('chat',_0xe16b('0xf')),controller[_0xe16b('0x10')]);router['put'](_0xe16b('0xc'),controller['update']);router[_0xe16b('0x11')](_0xe16b('0x12'),auth['isAuthenticated'](),controller[_0xe16b('0x13')]);router['put']('/:id/reject',auth[_0xe16b('0x9')](),controller[_0xe16b('0x14')]);router[_0xe16b('0x15')](_0xe16b('0xc'),auth[_0xe16b('0x9')](),controller[_0xe16b('0x16')]);module[_0xe16b('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 427ccc9..ff62f2f 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 _0xb5b6=['medium','exports','TEXT'];(function(_0x52fdf1,_0x212066){var _0x4d318c=function(_0x5921e5){while(--_0x5921e5){_0x52fdf1['push'](_0x52fdf1['shift']());}};_0x4d318c(++_0x212066);}(_0xb5b6,0xa3));var _0x6b5b=function(_0xc6c7ef,_0x157aa3){_0xc6c7ef=_0xc6c7ef-0x0;var _0x39c6a0=_0xb5b6[_0xc6c7ef];return _0x39c6a0;};'use strict';var Sequelize=require('sequelize');module[_0x6b5b('0x0')]={'body':{'type':Sequelize[_0x6b5b('0x1')](_0x6b5b('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x3373=['exports','medium','sequelize'];(function(_0x43782f,_0x4645ce){var _0x24e77a=function(_0x529444){while(--_0x529444){_0x43782f['push'](_0x43782f['shift']());}};_0x24e77a(++_0x4645ce);}(_0x3373,0xd7));var _0x3337=function(_0x5151ae,_0x1caf6d){_0x5151ae=_0x5151ae-0x0;var _0x1ac1fc=_0x3373[_0x5151ae];return _0x1ac1fc;};'use strict';var Sequelize=require(_0x3337('0x0'));module[_0x3337('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3337('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 fc6eb0a..469efd1 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x7a54,0x106));var _0x47a5=function(_0x4825cb,_0x52837c){_0x4825cb=_0x4825cb-0x0;var _0x462ebc=_0x7a54[_0x4825cb];return _0x462ebc;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x58020a,_0x469b63){_0x58020a=_0x58020a-0x0;var _0x315e5c=_0x7a54[_0x58020a];return _0x315e5c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 815c32f..dff25c3 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 _0xca84=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x897305,_0x35ae63){var _0x24d540=function(_0x4d8d22){while(--_0x4d8d22){_0x897305['push'](_0x897305['shift']());}};_0x24d540(++_0x35ae63);}(_0xca84,0x194));var _0x4ca8=function(_0x180611,_0x3a38c1){_0x180611=_0x180611-0x0;var _0x5b2ba8=_0xca84[_0x180611];return _0x5b2ba8;};'use strict';var _=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var logger=require('../../config/logger')(_0x4ca8('0x2'));var moment=require('moment');var BPromise=require(_0x4ca8('0x3'));var rp=require(_0x4ca8('0x4'));var fs=require('fs');var path=require(_0x4ca8('0x5'));var rimraf=require(_0x4ca8('0x6'));var config=require(_0x4ca8('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0x4ca8('0x8')]=function(_0x5680ea,_0x3f70f7){return _0x5680ea[_0x4ca8('0x9')](_0x4ca8('0xa'),attributes,{'tableName':_0x4ca8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4ca8('0xc')});}; \ No newline at end of file +var _0x342e=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','utf8mb4'];(function(_0x2a7cd3,_0x20367e){var _0x165a19=function(_0x33a09d){while(--_0x33a09d){_0x2a7cd3['push'](_0x2a7cd3['shift']());}};_0x165a19(++_0x20367e);}(_0x342e,0x114));var _0xe342=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x342e[_0x576266];return _0x18234f;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))('api');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var rp=require(_0xe342('0x5'));var fs=require('fs');var path=require(_0xe342('0x6'));var rimraf=require(_0xe342('0x7'));var config=require(_0xe342('0x8'));var attributes=require(_0xe342('0x9'));module['exports']=function(_0x4740f4,_0x251b39){return _0x4740f4['define'](_0xe342('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe342('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3713c6b..dc09597 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 _0x1666=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x48abed,_0x2da522){var _0xbec05f=function(_0x448ae8){while(--_0x448ae8){_0x48abed['push'](_0x48abed['shift']());}};_0xbec05f(++_0x2da522);}(_0x1666,0x75));var _0x6166=function(_0x4a2a7a,_0x4a5e47){_0x4a2a7a=_0x4a2a7a-0x0;var _0x209e4=_0x1666[_0x4a2a7a];return _0x209e4;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var moment=require('moment');var BPromise=require(_0x6166('0x2'));var rs=require(_0x6166('0x3'));var fs=require('fs');var Redis=require(_0x6166('0x4'));var db=require(_0x6166('0x5'))['db'];var utils=require(_0x6166('0x6'));var logger=require(_0x6166('0x7'))(_0x6166('0x8'));var config=require(_0x6166('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6166('0xa')][_0x6166('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x211a92,_0x1a61d0,_0x3a29ca){return new BPromise(function(_0x4873da,_0x51b51f){return client['request'](_0x211a92,_0x3a29ca)[_0x6166('0xc')](function(_0x5ee7b3){logger[_0x6166('0xd')](_0x6166('0xe'),_0x1a61d0,_0x6166('0xf'));logger[_0x6166('0x10')](_0x6166('0x11'),_0x1a61d0,_0x6166('0xf'),JSON[_0x6166('0x12')](_0x5ee7b3));if(_0x5ee7b3['error']){if(_0x5ee7b3[_0x6166('0x13')][_0x6166('0x14')]===0x1f4){logger[_0x6166('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1a61d0,_0x5ee7b3[_0x6166('0x13')][_0x6166('0x15')]);return _0x51b51f(_0x5ee7b3[_0x6166('0x13')][_0x6166('0x15')]);}logger['error'](_0x6166('0xe'),_0x1a61d0,_0x5ee7b3[_0x6166('0x13')][_0x6166('0x15')]);return _0x4873da(_0x5ee7b3[_0x6166('0x13')][_0x6166('0x15')]);}else{logger[_0x6166('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1a61d0,_0x6166('0xf'));_0x4873da(_0x5ee7b3[_0x6166('0x16')][_0x6166('0x15')]);}})[_0x6166('0x17')](function(_0x24bdf3){logger[_0x6166('0x13')](_0x6166('0xe'),_0x1a61d0,_0x24bdf3);_0x51b51f(_0x24bdf3);});});} \ No newline at end of file +var _0xe3a2=['error','code','message','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5562d3,_0x14a5ea){var _0x27496c=function(_0x3fb0d3){while(--_0x3fb0d3){_0x5562d3['push'](_0x5562d3['shift']());}};_0x27496c(++_0x14a5ea);}(_0xe3a2,0x1de));var _0x2e3a=function(_0x24d22f,_0xfa6241){_0x24d22f=_0x24d22f-0x0;var _0x33b153=_0xe3a2[_0x24d22f];return _0x33b153;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2e3a('0x0'));var BPromise=require(_0x2e3a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e3a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e3a('0x3'))(_0x2e3a('0x4'));var config=require(_0x2e3a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2e3a('0x6')][_0x2e3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf1ac6e,_0x23c92c,_0x1dbe02){return new BPromise(function(_0x1c26e8,_0x13d0df){return client[_0x2e3a('0x8')](_0xf1ac6e,_0x1dbe02)[_0x2e3a('0x9')](function(_0x212407){logger[_0x2e3a('0xa')](_0x2e3a('0xb'),_0x23c92c,'request\x20sent');logger[_0x2e3a('0xc')](_0x2e3a('0xd'),_0x23c92c,_0x2e3a('0xe'),JSON[_0x2e3a('0xf')](_0x212407));if(_0x212407['error']){if(_0x212407[_0x2e3a('0x10')][_0x2e3a('0x11')]===0x1f4){logger[_0x2e3a('0x10')](_0x2e3a('0xb'),_0x23c92c,_0x212407[_0x2e3a('0x10')][_0x2e3a('0x12')]);return _0x13d0df(_0x212407['error'][_0x2e3a('0x12')]);}logger[_0x2e3a('0x10')](_0x2e3a('0xb'),_0x23c92c,_0x212407['error'][_0x2e3a('0x12')]);return _0x1c26e8(_0x212407[_0x2e3a('0x10')][_0x2e3a('0x12')]);}else{logger[_0x2e3a('0xa')](_0x2e3a('0xb'),_0x23c92c,_0x2e3a('0xe'));_0x1c26e8(_0x212407['result'][_0x2e3a('0x12')]);}})['catch'](function(_0x52d48d){logger['error'](_0x2e3a('0xb'),_0x23c92c,_0x52d48d);_0x13d0df(_0x52d48d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1a52fd9..7f54c01 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 _0x1f44=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x54fa86,_0x3a1a18){var _0x33a889=function(_0x570045){while(--_0x570045){_0x54fa86['push'](_0x54fa86['shift']());}};_0x33a889(++_0x3a1a18);}(_0x1f44,0x13b));var _0x41f4=function(_0x2d7540,_0xfeeb86){_0x2d7540=_0x2d7540-0x0;var _0x4c0b9e=_0x1f44[_0x2d7540];return _0x4c0b9e;};'use strict';var multer=require(_0x41f4('0x0'));var util=require('util');var path=require(_0x41f4('0x1'));var timeout=require(_0x41f4('0x2'));var express=require(_0x41f4('0x3'));var router=express[_0x41f4('0x4')]();var fs_extra=require(_0x41f4('0x5'));var auth=require(_0x41f4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x41f4('0x7'));var controller=require(_0x41f4('0x8'));router[_0x41f4('0x9')]('/',auth[_0x41f4('0xa')](),controller[_0x41f4('0xb')]);router[_0x41f4('0x9')](_0x41f4('0xc'),auth[_0x41f4('0xa')](),controller[_0x41f4('0xd')]);router[_0x41f4('0x9')]('/:id',auth[_0x41f4('0xa')](),controller[_0x41f4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x41f4('0xf')]);router[_0x41f4('0x10')]('/:id',auth[_0x41f4('0xa')](),controller['update']);router[_0x41f4('0x11')]('/:id',auth[_0x41f4('0xa')](),controller[_0x41f4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5bec=['get','index','isAuthenticated','describe','post','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller'];(function(_0x52a1f3,_0x9e7e60){var _0x56b447=function(_0x185da3){while(--_0x185da3){_0x52a1f3['push'](_0x52a1f3['shift']());}};_0x56b447(++_0x9e7e60);}(_0x5bec,0x118));var _0xc5be=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5bec[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xc5be('0x0'));var util=require(_0xc5be('0x1'));var path=require(_0xc5be('0x2'));var timeout=require('connect-timeout');var express=require(_0xc5be('0x3'));var router=express[_0xc5be('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5be('0x5'));var interaction=require(_0xc5be('0x6'));var config=require('../../config/environment');var controller=require(_0xc5be('0x7'));router[_0xc5be('0x8')]('/',auth['isAuthenticated'](),controller[_0xc5be('0x9')]);router['get']('/describe',auth[_0xc5be('0xa')](),controller[_0xc5be('0xb')]);router[_0xc5be('0x8')]('/:id',auth[_0xc5be('0xa')](),controller['show']);router[_0xc5be('0xc')]('/',auth[_0xc5be('0xa')](),controller['create']);router[_0xc5be('0xd')](_0xc5be('0xe'),auth[_0xc5be('0xa')](),controller[_0xc5be('0xf')]);router[_0xc5be('0x10')](_0xc5be('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xc5be('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ebc38e9..6a9413a 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 _0x2684=['mouseOver','INTEGER','sequelize','STRING','ENUM'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x2684,0xde));var _0x4268=function(_0x5f3916,_0x4ba2f2){_0x5f3916=_0x5f3916-0x0;var _0x5b63b9=_0x2684[_0x5f3916];return _0x5b63b9;};'use strict';var Sequelize=require(_0x4268('0x0'));module['exports']={'name':{'type':Sequelize[_0x4268('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4268('0x2')](_0x4268('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x4268('0x1')]},'timeout':{'type':Sequelize[_0x4268('0x4')]}}; \ No newline at end of file +var _0xce5a=['sequelize','exports','ENUM','mouseOver','timeout','STRING','INTEGER'];(function(_0x3f0dd3,_0xf8bfb){var _0x587b3e=function(_0x5c45d6){while(--_0x5c45d6){_0x3f0dd3['push'](_0x3f0dd3['shift']());}};_0x587b3e(++_0xf8bfb);}(_0xce5a,0x165));var _0xace5=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xce5a[_0x104a84];return _0x4973ff;};'use strict';var Sequelize=require(_0xace5('0x0'));module[_0xace5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xace5('0x2')](_0xace5('0x3'),_0xace5('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xace5('0x5')]},'timeout':{'type':Sequelize[_0xace5('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 073b2e9..2f26620 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 _0x0d6a=['sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','include','merge','find','catch','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x0d6a[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0xa0d6('0x0'));var rimraf=require(_0xa0d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0d6('0x2'));var rp=require(_0xa0d6('0x3'));var moment=require(_0xa0d6('0x4'));var BPromise=require(_0xa0d6('0x5'));var Mustache=require(_0xa0d6('0x6'));var util=require(_0xa0d6('0x7'));var path=require(_0xa0d6('0x8'));var sox=require(_0xa0d6('0x9'));var csv=require(_0xa0d6('0xa'));var ejs=require(_0xa0d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0d6('0xc'));var squel=require(_0xa0d6('0xd'));var crypto=require(_0xa0d6('0xe'));var jsforce=require(_0xa0d6('0xf'));var deskjs=require(_0xa0d6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa0d6('0x11'));var Papa=require('papaparse');var Redis=require(_0xa0d6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa0d6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d6('0x14'));var logger=require(_0xa0d6('0x15'))(_0xa0d6('0x16'));var utils=require(_0xa0d6('0x17'));var config=require(_0xa0d6('0x18'));var licenseUtil=require(_0xa0d6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x304c6a,_0x17da11){_0x17da11=_0x17da11||0xcc;return function(_0x27aa06){if(_0x27aa06){return _0x304c6a['sendStatus'](_0x17da11);}return _0x304c6a[_0xa0d6('0x1a')](_0x17da11)[_0xa0d6('0x1b')]();};}function respondWithResult(_0x212b39,_0x31b97b){_0x31b97b=_0x31b97b||0xc8;return function(_0x3c3c15){if(_0x3c3c15){return _0x212b39[_0xa0d6('0x1a')](_0x31b97b)[_0xa0d6('0x1c')](_0x3c3c15);}};}function respondWithFilteredResult(_0x4a0f3a,_0x5ddf29){return function(_0x39e63f){if(_0x39e63f){var _0x3f8ed3=typeof _0x5ddf29[_0xa0d6('0x1d')]===_0xa0d6('0x1e')&&typeof _0x5ddf29[_0xa0d6('0x1f')]===_0xa0d6('0x1e');var _0x82e7b6=_0x39e63f['count'];var _0x1c8547=_0x3f8ed3?0x0:_0x5ddf29[_0xa0d6('0x1d')];var _0x20c387=_0x3f8ed3?_0x39e63f['count']:_0x5ddf29[_0xa0d6('0x1d')]+_0x5ddf29['limit'];var _0x1dc618;if(_0x20c387>=_0x82e7b6){_0x20c387=_0x82e7b6;_0x1dc618=0xc8;}else{_0x1dc618=0xce;}_0x4a0f3a['status'](_0x1dc618);return _0x4a0f3a[_0xa0d6('0x20')](_0xa0d6('0x21'),_0x1c8547+'-'+_0x20c387+'/'+_0x82e7b6)[_0xa0d6('0x1c')](_0x39e63f);}return null;};}function patchUpdates(_0x3e9968){return function(_0x798c80){try{jsonpatch[_0xa0d6('0x22')](_0x798c80,_0x3e9968,!![]);}catch(_0x5a78ec){return BPromise[_0xa0d6('0x23')](_0x5a78ec);}return _0x798c80[_0xa0d6('0x24')]();};}function saveUpdates(_0x4ded22,_0x1a053e){return function(_0x51c67e){if(_0x51c67e){return _0x51c67e['update'](_0x4ded22)[_0xa0d6('0x25')](function(_0x222152){return _0x222152;});}return null;};}function removeEntity(_0x181606,_0x16cd24){return function(_0x469c42){if(_0x469c42){return _0x469c42[_0xa0d6('0x26')]()[_0xa0d6('0x25')](function(){_0x181606[_0xa0d6('0x1a')](0xcc)[_0xa0d6('0x1b')]();});}};}function handleEntityNotFound(_0x338b17,_0x4c4111){return function(_0x2eedfe){if(!_0x2eedfe){_0x338b17[_0xa0d6('0x27')](0x194);}return _0x2eedfe;};}function handleError(_0x621e42,_0x2656c5){_0x2656c5=_0x2656c5||0x1f4;return function(_0x173838){logger[_0xa0d6('0x28')](_0x173838[_0xa0d6('0x29')]);if(_0x173838[_0xa0d6('0x2a')]){delete _0x173838[_0xa0d6('0x2a')];}_0x621e42[_0xa0d6('0x1a')](_0x2656c5)[_0xa0d6('0x2b')](_0x173838);};}exports[_0xa0d6('0x2c')]=function(_0x414b84,_0x382a37){var _0x11b38c={'raw':!![],'where':{'id':_0x414b84[_0xa0d6('0x2d')]['id']}},_0x19b932={};_0x19b932[_0xa0d6('0x2e')]=_[_0xa0d6('0x2f')](db[_0xa0d6('0x30')][_0xa0d6('0x31')]);_0x19b932[_0xa0d6('0x32')]=_[_0xa0d6('0x2f')](_0x414b84[_0xa0d6('0x32')]);_0x19b932['filters']=_[_0xa0d6('0x33')](_0x19b932['model'],_0x19b932[_0xa0d6('0x32')]);_0x11b38c[_0xa0d6('0x34')]=_[_0xa0d6('0x33')](_0x19b932['model'],qs[_0xa0d6('0x35')](_0x414b84[_0xa0d6('0x32')]['fields']));_0x11b38c[_0xa0d6('0x34')]=_0x11b38c[_0xa0d6('0x34')]['length']?_0x11b38c[_0xa0d6('0x34')]:_0x19b932[_0xa0d6('0x2e')];if(_0x414b84['query']['includeAll']){_0x11b38c[_0xa0d6('0x36')]=[{'all':!![]}];}_0x11b38c=_[_0xa0d6('0x37')]({},_0x11b38c,_0x414b84['options']);return db[_0xa0d6('0x30')][_0xa0d6('0x38')](_0x11b38c)['then'](handleEntityNotFound(_0x382a37,null))[_0xa0d6('0x25')](respondWithResult(_0x382a37,null))[_0xa0d6('0x39')](handleError(_0x382a37,null));};exports['create']=function(_0x4525c5,_0x29651e){return db['ChatProactiveAction']['create'](_0x4525c5[_0xa0d6('0x3a')],{})[_0xa0d6('0x25')](respondWithResult(_0x29651e,0xc9))[_0xa0d6('0x39')](handleError(_0x29651e,null));};exports[_0xa0d6('0x3b')]=function(_0x5aba86,_0x41fbe3){if(_0x5aba86['body']['id']){delete _0x5aba86[_0xa0d6('0x3a')]['id'];}return db[_0xa0d6('0x30')][_0xa0d6('0x38')]({'where':{'id':_0x5aba86[_0xa0d6('0x2d')]['id']}})[_0xa0d6('0x25')](handleEntityNotFound(_0x41fbe3,null))[_0xa0d6('0x25')](saveUpdates(_0x5aba86[_0xa0d6('0x3a')],null))[_0xa0d6('0x25')](respondWithResult(_0x41fbe3,null))['catch'](handleError(_0x41fbe3,null));};exports[_0xa0d6('0x26')]=function(_0x3c0d5f,_0x44c204){return db['ChatProactiveAction']['find']({'where':{'id':_0x3c0d5f[_0xa0d6('0x2d')]['id']}})['then'](handleEntityNotFound(_0x44c204,null))[_0xa0d6('0x25')](removeEntity(_0x44c204,null))[_0xa0d6('0x39')](handleError(_0x44c204,null));}; \ No newline at end of file +var _0x0fc8=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','merge','catch','create','body','find','eml-format','rimraf','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0fc8,0x145));var _0x80fc=function(_0x248b89,_0x29799e){_0x248b89=_0x248b89-0x0;var _0x518f70=_0x0fc8[_0x248b89];return _0x518f70;};'use strict';var emlformat=require(_0x80fc('0x0'));var rimraf=require(_0x80fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x80fc('0x2'));var BPromise=require(_0x80fc('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80fc('0x4'));var sox=require('sox');var csv=require(_0x80fc('0x5'));var ejs=require(_0x80fc('0x6'));var fs=require('fs');var fs_extra=require(_0x80fc('0x7'));var _=require(_0x80fc('0x8'));var squel=require(_0x80fc('0x9'));var crypto=require('crypto');var jsforce=require(_0x80fc('0xa'));var deskjs=require(_0x80fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x80fc('0xc'));var Papa=require(_0x80fc('0xd'));var Redis=require(_0x80fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x80fc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80fc('0x10'))(_0x80fc('0x11'));var utils=require(_0x80fc('0x12'));var config=require(_0x80fc('0x13'));var licenseUtil=require(_0x80fc('0x14'));var db=require(_0x80fc('0x15'))['db'];function respondWithStatusCode(_0x3a55e7,_0x25803a){_0x25803a=_0x25803a||0xcc;return function(_0x376368){if(_0x376368){return _0x3a55e7[_0x80fc('0x16')](_0x25803a);}return _0x3a55e7[_0x80fc('0x17')](_0x25803a)[_0x80fc('0x18')]();};}function respondWithResult(_0x2707c6,_0x316371){_0x316371=_0x316371||0xc8;return function(_0x9f0417){if(_0x9f0417){return _0x2707c6[_0x80fc('0x17')](_0x316371)[_0x80fc('0x19')](_0x9f0417);}};}function respondWithFilteredResult(_0x49620d,_0x307b02){return function(_0x534f29){if(_0x534f29){var _0x455017=typeof _0x307b02[_0x80fc('0x1a')]===_0x80fc('0x1b')&&typeof _0x307b02['limit']===_0x80fc('0x1b');var _0x5ac244=_0x534f29[_0x80fc('0x1c')];var _0x38f340=_0x455017?0x0:_0x307b02[_0x80fc('0x1a')];var _0x5205d5=_0x455017?_0x534f29[_0x80fc('0x1c')]:_0x307b02['offset']+_0x307b02[_0x80fc('0x1d')];var _0x1e46ec;if(_0x5205d5>=_0x5ac244){_0x5205d5=_0x5ac244;_0x1e46ec=0xc8;}else{_0x1e46ec=0xce;}_0x49620d[_0x80fc('0x17')](_0x1e46ec);return _0x49620d[_0x80fc('0x1e')](_0x80fc('0x1f'),_0x38f340+'-'+_0x5205d5+'/'+_0x5ac244)[_0x80fc('0x19')](_0x534f29);}return null;};}function patchUpdates(_0x43b411){return function(_0x53ce11){try{jsonpatch[_0x80fc('0x20')](_0x53ce11,_0x43b411,!![]);}catch(_0x2a0353){return BPromise[_0x80fc('0x21')](_0x2a0353);}return _0x53ce11[_0x80fc('0x22')]();};}function saveUpdates(_0x503506,_0x1e08ac){return function(_0x422a36){if(_0x422a36){return _0x422a36[_0x80fc('0x23')](_0x503506)[_0x80fc('0x24')](function(_0x5791b2){return _0x5791b2;});}return null;};}function removeEntity(_0x167680,_0xee9f08){return function(_0x1364cb){if(_0x1364cb){return _0x1364cb[_0x80fc('0x25')]()[_0x80fc('0x24')](function(){_0x167680[_0x80fc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2719,_0x32cded){return function(_0x429f25){if(!_0x429f25){_0x5d2719[_0x80fc('0x16')](0x194);}return _0x429f25;};}function handleError(_0x1c8b9d,_0x1c470f){_0x1c470f=_0x1c470f||0x1f4;return function(_0x32d839){logger['error'](_0x32d839[_0x80fc('0x26')]);if(_0x32d839[_0x80fc('0x27')]){delete _0x32d839['name'];}_0x1c8b9d[_0x80fc('0x17')](_0x1c470f)['send'](_0x32d839);};}exports[_0x80fc('0x28')]=function(_0x4b52fe,_0x19a89e){var _0x146068={'raw':!![],'where':{'id':_0x4b52fe[_0x80fc('0x29')]['id']}},_0x1f32c9={};_0x1f32c9[_0x80fc('0x2a')]=_[_0x80fc('0x2b')](db[_0x80fc('0x2c')][_0x80fc('0x2d')]);_0x1f32c9[_0x80fc('0x2e')]=_[_0x80fc('0x2b')](_0x4b52fe[_0x80fc('0x2e')]);_0x1f32c9[_0x80fc('0x2f')]=_[_0x80fc('0x30')](_0x1f32c9[_0x80fc('0x2a')],_0x1f32c9[_0x80fc('0x2e')]);_0x146068[_0x80fc('0x31')]=_[_0x80fc('0x30')](_0x1f32c9['model'],qs[_0x80fc('0x32')](_0x4b52fe['query'][_0x80fc('0x32')]));_0x146068['attributes']=_0x146068[_0x80fc('0x31')][_0x80fc('0x33')]?_0x146068[_0x80fc('0x31')]:_0x1f32c9[_0x80fc('0x2a')];if(_0x4b52fe['query']['includeAll']){_0x146068['include']=[{'all':!![]}];}_0x146068=_[_0x80fc('0x34')]({},_0x146068,_0x4b52fe['options']);return db[_0x80fc('0x2c')]['find'](_0x146068)[_0x80fc('0x24')](handleEntityNotFound(_0x19a89e,null))[_0x80fc('0x24')](respondWithResult(_0x19a89e,null))[_0x80fc('0x35')](handleError(_0x19a89e,null));};exports[_0x80fc('0x36')]=function(_0x2adc9b,_0x43b6c4){return db[_0x80fc('0x2c')][_0x80fc('0x36')](_0x2adc9b[_0x80fc('0x37')],{})['then'](respondWithResult(_0x43b6c4,0xc9))[_0x80fc('0x35')](handleError(_0x43b6c4,null));};exports[_0x80fc('0x23')]=function(_0x240166,_0xf0a502){if(_0x240166[_0x80fc('0x37')]['id']){delete _0x240166[_0x80fc('0x37')]['id'];}return db['ChatProactiveAction'][_0x80fc('0x38')]({'where':{'id':_0x240166[_0x80fc('0x29')]['id']}})[_0x80fc('0x24')](handleEntityNotFound(_0xf0a502,null))[_0x80fc('0x24')](saveUpdates(_0x240166[_0x80fc('0x37')],null))['then'](respondWithResult(_0xf0a502,null))[_0x80fc('0x35')](handleError(_0xf0a502,null));};exports[_0x80fc('0x25')]=function(_0x3e1e16,_0xafd89b){return db[_0x80fc('0x2c')][_0x80fc('0x38')]({'where':{'id':_0x3e1e16[_0x80fc('0x29')]['id']}})['then'](handleEntityNotFound(_0xafd89b,null))[_0x80fc('0x24')](removeEntity(_0xafd89b,null))['catch'](handleError(_0xafd89b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5a00ee6..fcb1b73 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 _0x67dd=['../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1168f1,_0x304295){var _0x483bf7=function(_0x1019ff){while(--_0x1019ff){_0x1168f1['push'](_0x1168f1['shift']());}};_0x483bf7(++_0x304295);}(_0x67dd,0x13a));var _0xd67d=function(_0x21559d,_0x1bed6b){_0x21559d=_0x21559d-0x0;var _0x1f868d=_0x67dd[_0x21559d];return _0x1f868d;};'use strict';var _=require(_0xd67d('0x0'));var util=require(_0xd67d('0x1'));var logger=require(_0xd67d('0x2'))('api');var moment=require(_0xd67d('0x3'));var BPromise=require(_0xd67d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd67d('0x5'));var rimraf=require('rimraf');var config=require(_0xd67d('0x6'));var attributes=require(_0xd67d('0x7'));module['exports']=function(_0x306987,_0x315b93){return _0x306987['define'](_0xd67d('0x8'),attributes,{'tableName':_0xd67d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae38=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xae38,0x189));var _0x8ae3=function(_0x21dbbe,_0x3a03c6){_0x21dbbe=_0x21dbbe-0x0;var _0x10c105=_0xae38[_0x21dbbe];return _0x10c105;};'use strict';var _=require(_0x8ae3('0x0'));var util=require(_0x8ae3('0x1'));var logger=require(_0x8ae3('0x2'))(_0x8ae3('0x3'));var moment=require(_0x8ae3('0x4'));var BPromise=require(_0x8ae3('0x5'));var rp=require(_0x8ae3('0x6'));var fs=require('fs');var path=require(_0x8ae3('0x7'));var rimraf=require(_0x8ae3('0x8'));var config=require('../../config/environment');var attributes=require(_0x8ae3('0x9'));module[_0x8ae3('0xa')]=function(_0x21aebb,_0x2101e9){return _0x21aebb[_0x8ae3('0xb')](_0x8ae3('0xc'),attributes,{'tableName':_0x8ae3('0xd'),'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 db2c556..893c12a 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 _0x95fc=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95fc,0x1de));var _0xc95f=function(_0x4bd291,_0x20245c){_0x4bd291=_0x4bd291-0x0;var _0x36fca3=_0x95fc[_0x4bd291];return _0x36fca3;};'use strict';var _=require(_0xc95f('0x0'));var util=require(_0xc95f('0x1'));var moment=require(_0xc95f('0x2'));var BPromise=require(_0xc95f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc95f('0x4'));var db=require(_0xc95f('0x5'))['db'];var utils=require(_0xc95f('0x6'));var logger=require(_0xc95f('0x7'))(_0xc95f('0x8'));var config=require(_0xc95f('0x9'));var jayson=require(_0xc95f('0xa'));var client=jayson[_0xc95f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x269026,_0x2267e5,_0x575843){return new BPromise(function(_0x49d049,_0x54e0c1){return client[_0xc95f('0xc')](_0x269026,_0x575843)[_0xc95f('0xd')](function(_0x4f29b9){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2267e5,_0xc95f('0xe'));logger[_0xc95f('0xf')](_0xc95f('0x10'),_0x2267e5,_0xc95f('0xe'),JSON[_0xc95f('0x11')](_0x4f29b9));if(_0x4f29b9[_0xc95f('0x12')]){if(_0x4f29b9['error'][_0xc95f('0x13')]===0x1f4){logger[_0xc95f('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2267e5,_0x4f29b9[_0xc95f('0x12')][_0xc95f('0x14')]);return _0x54e0c1(_0x4f29b9['error'][_0xc95f('0x14')]);}logger[_0xc95f('0x12')](_0xc95f('0x15'),_0x2267e5,_0x4f29b9['error']['message']);return _0x49d049(_0x4f29b9[_0xc95f('0x12')][_0xc95f('0x14')]);}else{logger['info'](_0xc95f('0x15'),_0x2267e5,'request\x20sent');_0x49d049(_0x4f29b9[_0xc95f('0x16')][_0xc95f('0x14')]);}})[_0xc95f('0x17')](function(_0x42c7e1){logger[_0xc95f('0x12')](_0xc95f('0x15'),_0x2267e5,_0x42c7e1);_0x54e0c1(_0x42c7e1);});});} \ No newline at end of file +var _0xfb48=['request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ed229,_0x56983a){var _0x50fac9=function(_0x2eee48){while(--_0x2eee48){_0x3ed229['push'](_0x3ed229['shift']());}};_0x50fac9(++_0x56983a);}(_0xfb48,0xcd));var _0x8fb4=function(_0x3f4a92,_0x24d67b){_0x3f4a92=_0x3f4a92-0x0;var _0x11ffc3=_0xfb48[_0x3f4a92];return _0x11ffc3;};'use strict';var _=require('lodash');var util=require(_0x8fb4('0x0'));var moment=require(_0x8fb4('0x1'));var BPromise=require(_0x8fb4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8fb4('0x3'));var db=require(_0x8fb4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fb4('0x5'))(_0x8fb4('0x6'));var config=require(_0x8fb4('0x7'));var jayson=require(_0x8fb4('0x8'));var client=jayson[_0x8fb4('0x9')][_0x8fb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fd6ca,_0x45d852,_0x123630){return new BPromise(function(_0x5c8277,_0x3ac760){return client[_0x8fb4('0xb')](_0x3fd6ca,_0x123630)[_0x8fb4('0xc')](function(_0x3059d3){logger[_0x8fb4('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x45d852,_0x8fb4('0xe'));logger[_0x8fb4('0xf')](_0x8fb4('0x10'),_0x45d852,'request\x20sent',JSON[_0x8fb4('0x11')](_0x3059d3));if(_0x3059d3[_0x8fb4('0x12')]){if(_0x3059d3['error'][_0x8fb4('0x13')]===0x1f4){logger[_0x8fb4('0x12')](_0x8fb4('0x14'),_0x45d852,_0x3059d3[_0x8fb4('0x12')][_0x8fb4('0x15')]);return _0x3ac760(_0x3059d3[_0x8fb4('0x12')]['message']);}logger['error'](_0x8fb4('0x14'),_0x45d852,_0x3059d3['error'][_0x8fb4('0x15')]);return _0x5c8277(_0x3059d3['error']['message']);}else{logger['info'](_0x8fb4('0x14'),_0x45d852,_0x8fb4('0xe'));_0x5c8277(_0x3059d3[_0x8fb4('0x16')][_0x8fb4('0x15')]);}})[_0x8fb4('0x17')](function(_0x220855){logger[_0x8fb4('0x12')](_0x8fb4('0x14'),_0x45d852,_0x220855);_0x3ac760(_0x220855);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index dc12e3a..9fc1ae9 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 _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x42f57f,_0x5312ed){var _0x42edc2=function(_0x2b9074){while(--_0x2b9074){_0x42f57f['push'](_0x42f57f['shift']());}};_0x42edc2(++_0x5312ed);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4e1c3c,_0x2a8084){_0x4e1c3c=_0x4e1c3c-0x0;var _0x1c7150=_0x7fbe[_0x4e1c3c];return _0x1c7150;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router; \ No newline at end of file +var _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x430bac,_0x4d0c74){var _0x26bb8e=function(_0x2a024f){while(--_0x2a024f){_0x430bac['push'](_0x430bac['shift']());}};_0x26bb8e(++_0x4d0c74);}(_0x6f47,0xc7));var _0x76f4=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x6f47[_0x47a349];return _0x18ab75;};'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 fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);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 1b92224..cf737e5 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 _0xcf54=['ENUM','sequelize','STRING','INTEGER'];(function(_0x4b4ab4,_0x113696){var _0x182548=function(_0x205d21){while(--_0x205d21){_0x4b4ab4['push'](_0x4b4ab4['shift']());}};_0x182548(++_0x113696);}(_0xcf54,0x1a5));var _0x4cf5=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0xcf54[_0x254076];return _0x21a93e;};'use strict';var Sequelize=require(_0x4cf5('0x0'));module['exports']={'name':{'type':Sequelize[_0x4cf5('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4cf5('0x1')]},'timeout':{'type':Sequelize[_0x4cf5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4cf5('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x6898=['beepall','exports','STRING','name','INTEGER','ENUM'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6898,0x175));var _0x8689=function(_0x3f85fb,_0x53e30d){_0x3f85fb=_0x3f85fb-0x0;var _0x51a8be=_0x6898[_0x3f85fb];return _0x51a8be;};'use strict';var Sequelize=require('sequelize');module[_0x8689('0x0')]={'name':{'type':Sequelize[_0x8689('0x1')],'unique':_0x8689('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8689('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8689('0x4')]('rrmemory',_0x8689('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 7bd0033..60e01fe 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 _0x2539=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','offset','undefined','count','limit','set','json','apply','reject','save','get','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','options','nolimit','addTeams','ids','Team','online','interface','flatMap','Agents','sequelize','transaction','each','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0x2539,0x1d2));var _0x9253=function(_0x2cd57e,_0x36857f){_0x2cd57e=_0x2cd57e-0x0;var _0x1190c6=_0x2539[_0x2cd57e];return _0x1190c6;};'use strict';var emlformat=require(_0x9253('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9253('0x1'));var jsonpatch=require(_0x9253('0x2'));var rp=require(_0x9253('0x3'));var moment=require(_0x9253('0x4'));var BPromise=require(_0x9253('0x5'));var Mustache=require(_0x9253('0x6'));var util=require(_0x9253('0x7'));var path=require('path');var sox=require(_0x9253('0x8'));var csv=require(_0x9253('0x9'));var ejs=require(_0x9253('0xa'));var fs=require('fs');var fs_extra=require(_0x9253('0xb'));var _=require(_0x9253('0xc'));var squel=require(_0x9253('0xd'));var crypto=require(_0x9253('0xe'));var jsforce=require(_0x9253('0xf'));var deskjs=require(_0x9253('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9253('0x11'));var Papa=require(_0x9253('0x12'));var Redis=require(_0x9253('0x13'));var authService=require(_0x9253('0x14'));var qs=require(_0x9253('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9253('0x16'));var logger=require('../../config/logger')(_0x9253('0x17'));var utils=require(_0x9253('0x18'));var config=require(_0x9253('0x19'));var licenseUtil=require(_0x9253('0x1a'));var db=require(_0x9253('0x1b'))['db'];config[_0x9253('0x1c')]=_[_0x9253('0x1d')](config['redis'],{'host':_0x9253('0x1e'),'port':0x18eb});var socket=require(_0x9253('0x1f'))(new Redis(config[_0x9253('0x1c')]));require('./chatQueue.socket')[_0x9253('0x20')](socket);var jayson=require(_0x9253('0x21'));var client=jayson[_0x9253('0x22')][_0x9253('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xb1232b,_0x6419d5,_0x7f16d4,_0x135a15){return new BPromise(function(_0x4fdc36,_0x4d3cc4){var _0x3f9f87=_0x135a15||client;return _0x3f9f87[_0x9253('0x24')](_0xb1232b,_0x7f16d4)[_0x9253('0x25')](function(_0x251b84){logger['info'](_0x9253('0x26'),_0x6419d5,'request\x20sent');logger[_0x9253('0x27')](_0x9253('0x28'),_0x6419d5,'request\x20sent',JSON[_0x9253('0x29')](_0x251b84));if(_0x251b84['error']){if(_0x251b84[_0x9253('0x2a')][_0x9253('0x2b')]===0x1f4){logger[_0x9253('0x2a')](_0x9253('0x26'),_0x6419d5,_0x251b84[_0x9253('0x2a')][_0x9253('0x2c')]);return _0x4d3cc4(_0x251b84[_0x9253('0x2a')]['message']);}logger[_0x9253('0x2a')](_0x9253('0x26'),_0x6419d5,_0x251b84['error'][_0x9253('0x2c')]);return _0x4fdc36(_0x251b84[_0x9253('0x2a')]['message']);}else{logger[_0x9253('0x2d')]('ChatQueue,\x20%s,\x20%s',_0x6419d5,'request\x20sent');_0x4fdc36(_0x251b84[_0x9253('0x2e')][_0x9253('0x2c')]);}})[_0x9253('0x2f')](function(_0x1c206f){logger['error'](_0x9253('0x26'),_0x6419d5,_0x1c206f);_0x4d3cc4(_0x1c206f);});});}function respondWithStatusCode(_0x57a44b,_0x362735){_0x362735=_0x362735||0xcc;return function(_0x3af286){if(_0x3af286){return _0x57a44b['sendStatus'](_0x362735);}return _0x57a44b['status'](_0x362735)[_0x9253('0x30')]();};}function respondWithResult(_0x65c7df,_0x5e4108){_0x5e4108=_0x5e4108||0xc8;return function(_0x52e277){if(_0x52e277){return _0x65c7df[_0x9253('0x31')](_0x5e4108)['json'](_0x52e277);}};}function respondWithFilteredResult(_0x3674c4,_0x5b0348){return function(_0x1da10b){if(_0x1da10b){var _0x1a70e0=typeof _0x5b0348[_0x9253('0x32')]===_0x9253('0x33')&&typeof _0x5b0348['limit']===_0x9253('0x33');var _0x1e255a=_0x1da10b[_0x9253('0x34')];var _0xc06375=_0x1a70e0?0x0:_0x5b0348['offset'];var _0x1da6f6=_0x1a70e0?_0x1da10b[_0x9253('0x34')]:_0x5b0348[_0x9253('0x32')]+_0x5b0348[_0x9253('0x35')];var _0x4f2c6f;if(_0x1da6f6>=_0x1e255a){_0x1da6f6=_0x1e255a;_0x4f2c6f=0xc8;}else{_0x4f2c6f=0xce;}_0x3674c4[_0x9253('0x31')](_0x4f2c6f);return _0x3674c4[_0x9253('0x36')]('Content-Range',_0xc06375+'-'+_0x1da6f6+'/'+_0x1e255a)[_0x9253('0x37')](_0x1da10b);}return null;};}function patchUpdates(_0xc76217){return function(_0x45d5c5){try{jsonpatch[_0x9253('0x38')](_0x45d5c5,_0xc76217,!![]);}catch(_0x55f2ea){return BPromise[_0x9253('0x39')](_0x55f2ea);}return _0x45d5c5[_0x9253('0x3a')]();};}function saveUpdates(_0x3ee510,_0x22c5fb){return function(_0x361d3d){if(_0x361d3d){return _0x361d3d['update'](_0x3ee510)[_0x9253('0x25')](function(_0x1218dc){return _0x1218dc;});}return null;};}function removeEntity(_0x294f34,_0x3c40e3){return function(_0x2a0202){if(_0x2a0202){return _0x2a0202['destroy']()['then'](function(){var _0x2cae8f=_0x2a0202[_0x9253('0x3b')]({'plain':!![]});var _0x37a3ef=_0x9253('0x3c');return db[_0x9253('0x3d')][_0x9253('0x3e')]({'where':{'type':_0x37a3ef,'resourceId':_0x2cae8f['id']}})['then'](function(){return _0x2a0202;});})[_0x9253('0x25')](function(){_0x294f34[_0x9253('0x31')](0xcc)[_0x9253('0x30')]();});}};}function handleEntityNotFound(_0x405f9c,_0x504785){return function(_0x593402){if(!_0x593402){_0x405f9c[_0x9253('0x3f')](0x194);}return _0x593402;};}function handleError(_0x51ccfe,_0x2e9f29){_0x2e9f29=_0x2e9f29||0x1f4;return function(_0x305e1e){logger[_0x9253('0x2a')](_0x305e1e[_0x9253('0x40')]);if(_0x305e1e[_0x9253('0x41')]){delete _0x305e1e[_0x9253('0x41')];}_0x51ccfe[_0x9253('0x31')](_0x2e9f29)[_0x9253('0x42')](_0x305e1e);};}exports[_0x9253('0x43')]=function(_0x3983eb,_0xd0d693){var _0x4afc7f={},_0x46a0ed={},_0xbc4990={'count':0x0,'rows':[]};var _0x36dc33=_[_0x9253('0x44')](db[_0x9253('0x45')][_0x9253('0x46')],function(_0x300a8f){return{'name':_0x300a8f[_0x9253('0x47')],'type':_0x300a8f[_0x9253('0x48')][_0x9253('0x49')]};});_0x46a0ed[_0x9253('0x4a')]=_[_0x9253('0x44')](_0x36dc33,_0x9253('0x41'));_0x46a0ed[_0x9253('0x4b')]=_['keys'](_0x3983eb['query']);_0x46a0ed[_0x9253('0x4c')]=_[_0x9253('0x4d')](_0x46a0ed['model'],_0x46a0ed[_0x9253('0x4b')]);_0x4afc7f[_0x9253('0x4e')]=_[_0x9253('0x4d')](_0x46a0ed[_0x9253('0x4a')],qs[_0x9253('0x4f')](_0x3983eb[_0x9253('0x4b')][_0x9253('0x4f')]));_0x4afc7f[_0x9253('0x4e')]=_0x4afc7f[_0x9253('0x4e')]['length']?_0x4afc7f[_0x9253('0x4e')]:_0x46a0ed['model'];if(!_0x3983eb['query'][_0x9253('0x50')]('nolimit')){_0x4afc7f[_0x9253('0x35')]=qs[_0x9253('0x35')](_0x3983eb[_0x9253('0x4b')]['limit']);_0x4afc7f[_0x9253('0x32')]=qs[_0x9253('0x32')](_0x3983eb[_0x9253('0x4b')][_0x9253('0x32')]);}_0x4afc7f[_0x9253('0x51')]=qs['sort'](_0x3983eb['query'][_0x9253('0x52')]);_0x4afc7f[_0x9253('0x53')]=qs[_0x9253('0x4c')](_[_0x9253('0x54')](_0x3983eb['query'],_0x46a0ed[_0x9253('0x4c')]),_0x36dc33);if(_0x3983eb['query'][_0x9253('0x55')]){_0x4afc7f[_0x9253('0x53')]=_[_0x9253('0x56')](_0x4afc7f[_0x9253('0x53')],{'$or':_[_0x9253('0x44')](_0x36dc33,function(_0x28c80c){if(_0x28c80c[_0x9253('0x48')]!==_0x9253('0x57')){var _0x17f118={};_0x17f118[_0x28c80c['name']]={'$like':'%'+_0x3983eb['query'][_0x9253('0x55')]+'%'};return _0x17f118;}})});}_0x4afc7f=_[_0x9253('0x56')]({},_0x4afc7f,_0x3983eb['options']);var _0x51f733={'where':_0x4afc7f[_0x9253('0x53')]};return db[_0x9253('0x45')][_0x9253('0x34')](_0x51f733)[_0x9253('0x25')](function(_0xe082a0){_0xbc4990['count']=_0xe082a0;if(_0x3983eb[_0x9253('0x4b')][_0x9253('0x58')]){_0x4afc7f[_0x9253('0x59')]=[{'all':!![]}];}return db[_0x9253('0x45')][_0x9253('0x5a')](_0x4afc7f);})['then'](function(_0x516e96){_0xbc4990[_0x9253('0x5b')]=_0x516e96;return _0xbc4990;})[_0x9253('0x25')](respondWithFilteredResult(_0xd0d693,_0x4afc7f))[_0x9253('0x2f')](handleError(_0xd0d693,null));};exports['show']=function(_0x2ce07b,_0x1a4d9c){var _0x249975={'raw':!![],'where':{'id':_0x2ce07b[_0x9253('0x5c')]['id']}},_0x2a514b={};_0x2a514b['model']=_[_0x9253('0x5d')](db['ChatQueue'][_0x9253('0x46')]);_0x2a514b[_0x9253('0x4b')]=_[_0x9253('0x5d')](_0x2ce07b[_0x9253('0x4b')]);_0x2a514b['filters']=_[_0x9253('0x4d')](_0x2a514b[_0x9253('0x4a')],_0x2a514b[_0x9253('0x4b')]);_0x249975['attributes']=_[_0x9253('0x4d')](_0x2a514b['model'],qs[_0x9253('0x4f')](_0x2ce07b[_0x9253('0x4b')]['fields']));_0x249975[_0x9253('0x4e')]=_0x249975['attributes'][_0x9253('0x5e')]?_0x249975['attributes']:_0x2a514b['model'];if(_0x2ce07b[_0x9253('0x4b')][_0x9253('0x58')]){_0x249975['include']=[{'all':!![]}];}_0x249975=_[_0x9253('0x56')]({},_0x249975,_0x2ce07b['options']);return db[_0x9253('0x45')]['find'](_0x249975)[_0x9253('0x25')](handleEntityNotFound(_0x1a4d9c,null))['then'](respondWithResult(_0x1a4d9c,null))[_0x9253('0x2f')](handleError(_0x1a4d9c,null));};exports[_0x9253('0x5f')]=function(_0x54caf8,_0x32c422){return db['ChatQueue']['create'](_0x54caf8[_0x9253('0x60')],{})['then'](function(_0x235803){var _0x38df77=_0x54caf8[_0x9253('0x61')][_0x9253('0x3b')]({'plain':!![]});if(!_0x38df77)throw new Error(_0x9253('0x62'));if(_0x38df77[_0x9253('0x63')]==='user'){var _0x1ac4d4=_0x235803[_0x9253('0x3b')]({'plain':!![]});var _0x38763b=_0x9253('0x3c');return db[_0x9253('0x64')][_0x9253('0x65')]({'where':{'name':_0x38763b,'userProfileId':_0x38df77[_0x9253('0x66')]},'raw':!![]})['then'](function(_0x520af6){if(_0x520af6&&_0x520af6[_0x9253('0x67')]===0x0){return db[_0x9253('0x3d')][_0x9253('0x5f')]({'name':_0x1ac4d4['name'],'resourceId':_0x1ac4d4['id'],'type':_0x520af6[_0x9253('0x41')],'sectionId':_0x520af6['id']},{})[_0x9253('0x25')](function(){return _0x235803;});}else{return _0x235803;}})[_0x9253('0x2f')](function(_0x329910){logger[_0x9253('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x329910);throw _0x329910;});}return _0x235803;})[_0x9253('0x25')](respondWithResult(_0x32c422,0xc9))[_0x9253('0x2f')](handleError(_0x32c422,null));};exports['update']=function(_0x72caad,_0xd692a5){if(_0x72caad['body']['id']){delete _0x72caad[_0x9253('0x60')]['id'];}return db['ChatQueue'][_0x9253('0x65')]({'where':{'id':_0x72caad['params']['id']}})[_0x9253('0x25')](handleEntityNotFound(_0xd692a5,null))[_0x9253('0x25')](saveUpdates(_0x72caad[_0x9253('0x60')],null))[_0x9253('0x25')](respondWithResult(_0xd692a5,null))[_0x9253('0x2f')](handleError(_0xd692a5,null));};exports['destroy']=function(_0x13345a,_0x130dd4){return db[_0x9253('0x45')][_0x9253('0x65')]({'where':{'id':_0x13345a[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](handleEntityNotFound(_0x130dd4,null))[_0x9253('0x25')](removeEntity(_0x130dd4,null))[_0x9253('0x2f')](handleError(_0x130dd4,null));};exports[_0x9253('0x68')]=function(_0x5d42ce,_0x2cd1f2){return db['ChatQueue'][_0x9253('0x68')]()['then'](respondWithResult(_0x2cd1f2,null))['catch'](handleError(_0x2cd1f2,null));};exports['getMembers']=function(_0x576562,_0x2faefc,_0x494804){var _0x3db687={'raw':!![],'where':{}},_0x1d4707={},_0x32168b;return db[_0x9253('0x45')][_0x9253('0x69')]({'where':{'id':_0x576562[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](handleEntityNotFound(_0x2faefc,null))[_0x9253('0x25')](function(_0xe9664d){if(_0xe9664d){_0x32168b=_0xe9664d[_0x9253('0x3b')]({'plain':!![]});_0x1d4707['model']=_[_0x9253('0x5d')](db[_0x9253('0x6a')][_0x9253('0x46')]);_0x1d4707['query']=_[_0x9253('0x5d')](_0x576562['query']);_0x1d4707[_0x9253('0x4c')]=_[_0x9253('0x4d')](_0x1d4707[_0x9253('0x4a')],_0x1d4707['query']);_0x3db687[_0x9253('0x4e')]=_[_0x9253('0x4d')](_0x1d4707[_0x9253('0x4a')],qs[_0x9253('0x4f')](_0x576562[_0x9253('0x4b')][_0x9253('0x4f')]));_0x3db687['attributes']=_0x3db687[_0x9253('0x4e')][_0x9253('0x5e')]?_0x3db687[_0x9253('0x4e')]:_0x1d4707[_0x9253('0x4a')];if(!_0x576562['query'][_0x9253('0x50')]('nolimit')){_0x3db687[_0x9253('0x35')]=qs[_0x9253('0x35')](_0x576562[_0x9253('0x4b')][_0x9253('0x35')]);_0x3db687[_0x9253('0x32')]=qs[_0x9253('0x32')](_0x576562[_0x9253('0x4b')][_0x9253('0x32')]);}_0x3db687['order']=qs[_0x9253('0x52')](_0x576562[_0x9253('0x4b')]['sort']);_0x3db687['where']=qs[_0x9253('0x4c')](_[_0x9253('0x54')](_0x576562['query'],_0x1d4707[_0x9253('0x4c')]));_0x3db687[_0x9253('0x53')][_0x9253('0x6b')]=_0xe9664d['id'];if(_0x576562[_0x9253('0x4b')][_0x9253('0x55')]){_0x3db687[_0x9253('0x53')]=_[_0x9253('0x56')](_0x3db687[_0x9253('0x53')],{'$or':_['map'](_0x3db687[_0x9253('0x4e')],function(_0x11b362){var _0x510b3b={};_0x510b3b[_0x11b362]={'$like':'%'+_0x576562[_0x9253('0x4b')][_0x9253('0x55')]+'%'};return _0x510b3b;})});}_0x3db687=_[_0x9253('0x56')]({},_0x3db687,_0x576562['options']);return db[_0x9253('0x6a')]['findAll'](_0x3db687);}})['then'](function(_0x4ef436){if(_0x4ef436){return db[_0x9253('0x6c')][_0x9253('0x6d')]({'where':{'id':_[_0x9253('0x44')](_0x4ef436,_0x9253('0x6e')),'role':_0x9253('0x6f')},'attributes':['id','name',_0x9253('0x70'),_0x9253('0x71'),_0x9253('0x72')]});}})[_0x9253('0x25')](function(_0x240f6f){if(_0x240f6f){return{'count':_0x240f6f[_0x9253('0x34')],'rows':_[_0x9253('0x44')](_0x240f6f[_0x9253('0x5b')],function(_0x3f99db){return{'membername':_0x3f99db['name'],'UserId':_0x3f99db['id'],'queue_name':_0x32168b[_0x9253('0x41')],'ChatQueueId':_0x32168b['id'],'interface':util[_0x9253('0x73')](_0x9253('0x74'),_0x9253('0x75'),_0x3f99db['name']),'penalty':0x0,'paused':_0x3f99db[_0x9253('0x70')],'createdAt':_0x3f99db[_0x9253('0x72')],'updatedAt':_0x3f99db[_0x9253('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2faefc,_0x3db687))[_0x9253('0x2f')](handleError(_0x2faefc,null));};exports[_0x9253('0x76')]=function(_0x5a2410,_0x8fd1e1,_0x4337f7){var _0x5d7163={};var _0x407e2b={};var _0x532060;var _0x4acff7;return db[_0x9253('0x45')]['findOne']({'where':{'id':_0x5a2410[_0x9253('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8fd1e1,null))[_0x9253('0x25')](function(_0x449d54){if(_0x449d54){_0x532060=_0x449d54;_0x407e2b[_0x9253('0x4a')]=_['keys'](db['Team'][_0x9253('0x46')]);_0x407e2b[_0x9253('0x4b')]=_[_0x9253('0x5d')](_0x5a2410['query']);_0x407e2b[_0x9253('0x4c')]=_[_0x9253('0x4d')](_0x407e2b['model'],_0x407e2b[_0x9253('0x4b')]);_0x5d7163[_0x9253('0x4e')]=_[_0x9253('0x4d')](_0x407e2b[_0x9253('0x4a')],qs[_0x9253('0x4f')](_0x5a2410[_0x9253('0x4b')][_0x9253('0x4f')]));_0x5d7163[_0x9253('0x4e')]=_0x5d7163[_0x9253('0x4e')][_0x9253('0x5e')]?_0x5d7163['attributes']:_0x407e2b[_0x9253('0x4a')];_0x5d7163[_0x9253('0x51')]=qs[_0x9253('0x52')](_0x5a2410['query'][_0x9253('0x52')]);_0x5d7163[_0x9253('0x53')]=qs['filters'](_[_0x9253('0x54')](_0x5a2410[_0x9253('0x4b')],_0x407e2b[_0x9253('0x4c')]));if(_0x5a2410[_0x9253('0x4b')][_0x9253('0x55')]){_0x5d7163['where']=_[_0x9253('0x56')](_0x5d7163[_0x9253('0x53')],{'$or':_['map'](_0x5d7163[_0x9253('0x4e')],function(_0x5d98dc){var _0x4da25a={};_0x4da25a[_0x5d98dc]={'$like':'%'+_0x5a2410[_0x9253('0x4b')]['filter']+'%'};return _0x4da25a;})});}_0x5d7163=_[_0x9253('0x56')]({},_0x5d7163,_0x5a2410[_0x9253('0x77')]);return _0x532060[_0x9253('0x76')](_0x5d7163);}})[_0x9253('0x25')](function(_0x2eac06){if(_0x2eac06){_0x4acff7=_0x2eac06[_0x9253('0x5e')];if(!_0x5a2410[_0x9253('0x4b')][_0x9253('0x50')](_0x9253('0x78'))){_0x5d7163['limit']=qs['limit'](_0x5a2410['query']['limit']);_0x5d7163[_0x9253('0x32')]=qs[_0x9253('0x32')](_0x5a2410[_0x9253('0x4b')]['offset']);}return _0x532060[_0x9253('0x76')](_0x5d7163);}})[_0x9253('0x25')](function(_0x2e6b06){if(_0x2e6b06){return _0x2e6b06?{'count':_0x4acff7,'rows':_0x2e6b06}:null;}})['then'](respondWithResult(_0x8fd1e1,null))[_0x9253('0x2f')](handleError(_0x8fd1e1,null));};exports[_0x9253('0x79')]=function(_0x1adad1,_0x68a9f8,_0x559fc0){var _0x4b5252=_0x1adad1[_0x9253('0x60')][_0x9253('0x7a')];return db[_0x9253('0x7b')][_0x9253('0x5a')]({'where':{'id':_0x4b5252},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9253('0x41'),_0x9253('0x7c'),'voicePause',_0x9253('0x7d')],'raw':!![]}]})[_0x9253('0x25')](function(_0x103102){if(_0x103102){var _0x5a86de=_[_0x9253('0x7e')](_0x103102,function(_0x47260f){var _0x3805ce=_0x47260f[_0x9253('0x3b')]({'plain':!![]});return _0x3805ce[_0x9253('0x7f')];});return db[_0x9253('0x45')][_0x9253('0x65')]({'where':{'id':_0x1adad1[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](function(_0x13e056){return db[_0x9253('0x80')][_0x9253('0x81')](function(_0x49a406){return _0x13e056['addTeams'](_0x4b5252,{'transaction':_0x49a406})[_0x9253('0x25')](function(){return BPromise[_0x9253('0x82')](_0x5a86de,function(_0x17b4cd){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x17b4cd['id'],'ChatQueueId':_0x1adad1['params']['id']},'transaction':_0x49a406});});})[_0x9253('0x25')](function(){_0x5a86de['forEach'](function(_0x487eff){socket[_0x9253('0x83')](_0x9253('0x84'),{'UserId':_0x487eff['id'],'ChatQueueId':_0x13e056['id']});});});});});}})[_0x9253('0x25')](respondWithStatusCode(_0x68a9f8,null))[_0x9253('0x2f')](handleError(_0x68a9f8,null));};exports[_0x9253('0x85')]=function(_0x3b34aa,_0x2efc7d,_0x27529e){return db[_0x9253('0x7b')]['findAll']({'where':{'id':_0x3b34aa[_0x9253('0x4b')][_0x9253('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x9253('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9253('0x25')](handleEntityNotFound(_0x2efc7d,null))[_0x9253('0x25')](function(_0x1d0ae7){var _0x24f96b=_['map'](_0x1d0ae7,'id');var _0x3c3392=[];var _0x30f8b3=[];var _0x3d14c9=squel[_0x9253('0x86')]();_0x3d14c9['field'](_0x9253('0x87'))['from'](_0x9253('0x88'),'tq')[_0x9253('0x89')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9253('0x8a'),_0x3b34aa['params']['id']);for(var _0xf23215=0x0;_0xf23215<_0x1d0ae7[_0x9253('0x5e')];_0xf23215+=0x1){let _0x583587=_0x1d0ae7[_0xf23215];for(var _0x31a7a9=0x0;_0x31a7a9<_0x583587['Agents'][_0x9253('0x5e')];_0x31a7a9+=0x1){let _0x54de43=_0x583587[_0x9253('0x7f')][_0x31a7a9];var _0x19eabd=_0x3d14c9[_0x9253('0x8b')]();_0x19eabd[_0x9253('0x53')](_0x9253('0x8c'),_0x54de43['id']);_0x30f8b3[_0x9253('0x8d')](db[_0x9253('0x80')][_0x9253('0x4b')](_0x19eabd[_0x9253('0x8e')](),{'type':db[_0x9253('0x80')][_0x9253('0x8f')][_0x9253('0x90')]})[_0x9253('0x25')](function(_0x19d8c0){if(_0x19d8c0[_0x9253('0x5e')]===0x1){return _0x54de43['id'];}else{var _0x31bddb=_[_0x9253('0x91')](_[_0x9253('0x44')](_0x19d8c0,_0x9253('0x92')),function(_0x3f651a){return _['includes'](_0x24f96b,_0x3f651a);});if(_0x31bddb){return _0x54de43['id'];}}}));}}return BPromise[_0x9253('0x93')](_0x30f8b3)['then'](function(_0x103ab6){_0x3c3392=_(_0x3c3392)[_0x9253('0x94')](_0x103ab6)[_0x9253('0x95')]()['value']();return db[_0x9253('0x45')]['find']({'where':{'id':_0x3b34aa['params']['id']}})['then'](function(_0x499e63){return db[_0x9253('0x80')][_0x9253('0x81')](function(_0x5dfb86){return _0x499e63['removeTeams'](_0x3b34aa[_0x9253('0x4b')][_0x9253('0x7a')],{'transaction':_0x5dfb86})[_0x9253('0x25')](function(){if(!_[_0x9253('0x96')](_0x3c3392)){return _0x499e63[_0x9253('0x97')](_0x3c3392,{'transaction':_0x5dfb86});}})[_0x9253('0x25')](function(){_0x3c3392[_0x9253('0x98')](function(_0x20e97b){socket[_0x9253('0x83')](_0x9253('0x99'),{'UserId':_0x20e97b,'ChatQueueId':_0x499e63['id']});});});});});});})[_0x9253('0x25')](respondWithStatusCode(_0x2efc7d,null))['catch'](handleError(_0x2efc7d,null));};exports['addAgents']=function(_0x441abc,_0x18993e,_0x794dbf){return db[_0x9253('0x45')][_0x9253('0x65')]({'where':{'id':_0x441abc[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](handleEntityNotFound(_0x18993e,null))[_0x9253('0x25')](function(_0x4f75b8){if(_0x4f75b8){return _0x4f75b8[_0x9253('0x9a')](_0x441abc[_0x9253('0x60')][_0x9253('0x7a')],_[_0x9253('0x9b')](_0x441abc[_0x9253('0x60')],['ids','id'])||{})[_0x9253('0x9c')](function(_0xb20b74){for(var _0x335e27=0x0;_0x335e27<_0x441abc[_0x9253('0x60')][_0x9253('0x7a')][_0x9253('0x5e')];_0x335e27+=0x1){socket[_0x9253('0x83')](_0x9253('0x84'),{'UserId':Number(_0x441abc[_0x9253('0x60')][_0x9253('0x7a')][_0x335e27]),'ChatQueueId':Number(_0x441abc[_0x9253('0x5c')]['id'])});}return _0xb20b74;});}})[_0x9253('0x25')](respondWithResult(_0x18993e,null))[_0x9253('0x2f')](handleError(_0x18993e,null));};exports[_0x9253('0x97')]=function(_0xb31bc5,_0x486c55,_0x4c2e57){return db[_0x9253('0x45')]['find']({'where':{'id':_0xb31bc5[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](handleEntityNotFound(_0x486c55,null))[_0x9253('0x25')](function(_0x3934e1){if(_0x3934e1){return _0x3934e1[_0x9253('0x97')](_0xb31bc5['query'][_0x9253('0x7a')])[_0x9253('0x25')](function(){if(_[_0x9253('0x9d')](_0xb31bc5[_0x9253('0x4b')][_0x9253('0x7a')])){for(var _0x26347a=0x0;_0x26347a<_0xb31bc5[_0x9253('0x4b')]['ids'][_0x9253('0x5e')];_0x26347a+=0x1){socket['emit'](_0x9253('0x99'),{'UserId':Number(_0xb31bc5[_0x9253('0x4b')][_0x9253('0x7a')][_0x26347a]),'ChatQueueId':Number(_0xb31bc5[_0x9253('0x5c')]['id'])});}}else{socket[_0x9253('0x83')]('userChatQueue:remove',{'UserId':Number(_0xb31bc5[_0x9253('0x4b')][_0x9253('0x7a')]),'ChatQueueId':Number(_0xb31bc5[_0x9253('0x5c')]['id'])});}});}})[_0x9253('0x25')](respondWithStatusCode(_0x486c55,null))[_0x9253('0x2f')](handleError(_0x486c55,null));};exports['getAgents']=function(_0x4611e8,_0x182783,_0x19fcf2){var _0x598ade={};var _0x35cc80={};var _0x4acd1b;var _0x418d0e;return db['ChatQueue'][_0x9253('0x69')]({'where':{'id':_0x4611e8[_0x9253('0x5c')]['id']}})[_0x9253('0x25')](handleEntityNotFound(_0x182783,null))[_0x9253('0x25')](function(_0x20e090){if(_0x20e090){_0x4acd1b=_0x20e090;_0x35cc80[_0x9253('0x4a')]=_['keys'](db[_0x9253('0x6c')][_0x9253('0x46')]);_0x35cc80['query']=_[_0x9253('0x5d')](_0x4611e8['query']);_0x35cc80['filters']=_[_0x9253('0x4d')](_0x35cc80[_0x9253('0x4a')],_0x35cc80['query']);_0x598ade[_0x9253('0x4e')]=_['intersection'](_0x35cc80[_0x9253('0x4a')],qs[_0x9253('0x4f')](_0x4611e8[_0x9253('0x4b')]['fields']));_0x598ade['attributes']=_0x598ade[_0x9253('0x4e')]['length']?_0x598ade[_0x9253('0x4e')]:_0x35cc80[_0x9253('0x4a')];_0x598ade[_0x9253('0x51')]=qs[_0x9253('0x52')](_0x4611e8[_0x9253('0x4b')][_0x9253('0x52')]);_0x598ade[_0x9253('0x53')]=qs['filters'](_[_0x9253('0x54')](_0x4611e8['query'],_0x35cc80[_0x9253('0x4c')]));if(_0x4611e8[_0x9253('0x4b')]['filter']){_0x598ade[_0x9253('0x53')]=_[_0x9253('0x56')](_0x598ade[_0x9253('0x53')],{'$or':_[_0x9253('0x44')](_0x598ade[_0x9253('0x4e')],function(_0x6c9a5b){var _0x380162={};_0x380162[_0x6c9a5b]={'$like':'%'+_0x4611e8[_0x9253('0x4b')][_0x9253('0x55')]+'%'};return _0x380162;})});}_0x598ade=_['merge']({},_0x598ade,_0x4611e8[_0x9253('0x77')]);return _0x4acd1b['getAgents'](_0x598ade);}})[_0x9253('0x25')](function(_0x19eaf1){if(_0x19eaf1){_0x418d0e=_0x19eaf1[_0x9253('0x5e')];if(!_0x4611e8[_0x9253('0x4b')][_0x9253('0x50')](_0x9253('0x78'))){_0x598ade[_0x9253('0x35')]=qs['limit'](_0x4611e8[_0x9253('0x4b')][_0x9253('0x35')]);_0x598ade['offset']=qs[_0x9253('0x32')](_0x4611e8[_0x9253('0x4b')][_0x9253('0x32')]);}return _0x4acd1b[_0x9253('0x9e')](_0x598ade);}})[_0x9253('0x25')](function(_0x2f9c7c){if(_0x2f9c7c){return _0x2f9c7c?{'count':_0x418d0e,'rows':_0x2f9c7c}:null;}})['then'](respondWithResult(_0x182783,null))[_0x9253('0x2f')](handleError(_0x182783,null));}; \ No newline at end of file +var _0xb949=['SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','then','info','debug','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','order','sort','where','merge','type','filter','options','includeAll','rows','intersection','include','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','getMembers','hasOwnProperty','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','findOne','pick','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x1da850,_0x58f0ce){var _0x295fbe=function(_0x29ea9d){while(--_0x29ea9d){_0x1da850['push'](_0x1da850['shift']());}};_0x295fbe(++_0x58f0ce);}(_0xb949,0x13d));var _0x9b94=function(_0x3a9f86,_0x24e7c8){_0x3a9f86=_0x3a9f86-0x0;var _0x377de6=_0xb949[_0x3a9f86];return _0x377de6;};'use strict';var emlformat=require(_0x9b94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b94('0x1'));var jsonpatch=require(_0x9b94('0x2'));var rp=require(_0x9b94('0x3'));var moment=require(_0x9b94('0x4'));var BPromise=require(_0x9b94('0x5'));var Mustache=require(_0x9b94('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9b94('0x7'));var csv=require(_0x9b94('0x8'));var ejs=require(_0x9b94('0x9'));var fs=require('fs');var fs_extra=require(_0x9b94('0xa'));var _=require(_0x9b94('0xb'));var squel=require(_0x9b94('0xc'));var crypto=require(_0x9b94('0xd'));var jsforce=require(_0x9b94('0xe'));var deskjs=require(_0x9b94('0xf'));var toCsv=require(_0x9b94('0x8'));var querystring=require(_0x9b94('0x10'));var Papa=require('papaparse');var Redis=require(_0x9b94('0x11'));var authService=require(_0x9b94('0x12'));var qs=require(_0x9b94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b94('0x14'));var logger=require(_0x9b94('0x15'))(_0x9b94('0x16'));var utils=require('../../config/utils');var config=require(_0x9b94('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b94('0x18'))['db'];config[_0x9b94('0x19')]=_[_0x9b94('0x1a')](config[_0x9b94('0x19')],{'host':_0x9b94('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x9b94('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9b94('0x1d')][_0x9b94('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3d00ae,_0x34175b,_0x2b04a2,_0x3c7673){return new BPromise(function(_0x37b463,_0x440ec5){var _0x56fdf3=_0x3c7673||client;return _0x56fdf3['request'](_0x3d00ae,_0x2b04a2)[_0x9b94('0x1f')](function(_0x3c8271){logger[_0x9b94('0x20')]('ChatQueue,\x20%s,\x20%s',_0x34175b,'request\x20sent');logger[_0x9b94('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x34175b,'request\x20sent',JSON[_0x9b94('0x22')](_0x3c8271));if(_0x3c8271[_0x9b94('0x23')]){if(_0x3c8271['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x34175b,_0x3c8271[_0x9b94('0x23')][_0x9b94('0x24')]);return _0x440ec5(_0x3c8271[_0x9b94('0x23')][_0x9b94('0x24')]);}logger[_0x9b94('0x23')](_0x9b94('0x25'),_0x34175b,_0x3c8271[_0x9b94('0x23')]['message']);return _0x37b463(_0x3c8271['error']['message']);}else{logger[_0x9b94('0x20')](_0x9b94('0x25'),_0x34175b,'request\x20sent');_0x37b463(_0x3c8271[_0x9b94('0x26')]['message']);}})[_0x9b94('0x27')](function(_0x1c8980){logger[_0x9b94('0x23')](_0x9b94('0x25'),_0x34175b,_0x1c8980);_0x440ec5(_0x1c8980);});});}function respondWithStatusCode(_0x205e1e,_0x35dbdf){_0x35dbdf=_0x35dbdf||0xcc;return function(_0x3c0b67){if(_0x3c0b67){return _0x205e1e[_0x9b94('0x28')](_0x35dbdf);}return _0x205e1e['status'](_0x35dbdf)[_0x9b94('0x29')]();};}function respondWithResult(_0x2860a0,_0x4eac92){_0x4eac92=_0x4eac92||0xc8;return function(_0x135160){if(_0x135160){return _0x2860a0[_0x9b94('0x2a')](_0x4eac92)[_0x9b94('0x2b')](_0x135160);}};}function respondWithFilteredResult(_0x75d858,_0x49914a){return function(_0x73310e){if(_0x73310e){var _0x5c5569=typeof _0x49914a[_0x9b94('0x2c')]===_0x9b94('0x2d')&&typeof _0x49914a[_0x9b94('0x2e')]===_0x9b94('0x2d');var _0xcf0d40=_0x73310e['count'];var _0x30027a=_0x5c5569?0x0:_0x49914a[_0x9b94('0x2c')];var _0x380b61=_0x5c5569?_0x73310e[_0x9b94('0x2f')]:_0x49914a[_0x9b94('0x2c')]+_0x49914a['limit'];var _0x3dc639;if(_0x380b61>=_0xcf0d40){_0x380b61=_0xcf0d40;_0x3dc639=0xc8;}else{_0x3dc639=0xce;}_0x75d858['status'](_0x3dc639);return _0x75d858[_0x9b94('0x30')](_0x9b94('0x31'),_0x30027a+'-'+_0x380b61+'/'+_0xcf0d40)['json'](_0x73310e);}return null;};}function patchUpdates(_0xa2e214){return function(_0x2f6cb4){try{jsonpatch['apply'](_0x2f6cb4,_0xa2e214,!![]);}catch(_0x525722){return BPromise[_0x9b94('0x32')](_0x525722);}return _0x2f6cb4[_0x9b94('0x33')]();};}function saveUpdates(_0x2a6c1d,_0x1aaa78){return function(_0x4ded75){if(_0x4ded75){return _0x4ded75[_0x9b94('0x34')](_0x2a6c1d)[_0x9b94('0x1f')](function(_0x187ccd){return _0x187ccd;});}return null;};}function removeEntity(_0x3196ff,_0x1084eb){return function(_0x3491db){if(_0x3491db){return _0x3491db['destroy']()[_0x9b94('0x1f')](function(){var _0x4564c4=_0x3491db[_0x9b94('0x35')]({'plain':!![]});var _0x32bc18=_0x9b94('0x36');return db[_0x9b94('0x37')]['destroy']({'where':{'type':_0x32bc18,'resourceId':_0x4564c4['id']}})[_0x9b94('0x1f')](function(){return _0x3491db;});})[_0x9b94('0x1f')](function(){_0x3196ff[_0x9b94('0x2a')](0xcc)[_0x9b94('0x29')]();});}};}function handleEntityNotFound(_0x5c6d92,_0x185b31){return function(_0x4d55c5){if(!_0x4d55c5){_0x5c6d92['sendStatus'](0x194);}return _0x4d55c5;};}function handleError(_0x55b12a,_0x5962aa){_0x5962aa=_0x5962aa||0x1f4;return function(_0xd8d4cb){logger[_0x9b94('0x23')](_0xd8d4cb[_0x9b94('0x38')]);if(_0xd8d4cb[_0x9b94('0x39')]){delete _0xd8d4cb[_0x9b94('0x39')];}_0x55b12a[_0x9b94('0x2a')](_0x5962aa)[_0x9b94('0x3a')](_0xd8d4cb);};}exports[_0x9b94('0x3b')]=function(_0x12d03d,_0x92bb67){var _0x4f37f5={},_0x2321e5={},_0x4fa907={'count':0x0,'rows':[]};var _0x42147c=_[_0x9b94('0x3c')](db[_0x9b94('0x3d')][_0x9b94('0x3e')],function(_0x4c3f13){return{'name':_0x4c3f13[_0x9b94('0x3f')],'type':_0x4c3f13['type'][_0x9b94('0x40')]};});_0x2321e5[_0x9b94('0x41')]=_[_0x9b94('0x3c')](_0x42147c,_0x9b94('0x39'));_0x2321e5[_0x9b94('0x42')]=_[_0x9b94('0x43')](_0x12d03d[_0x9b94('0x42')]);_0x2321e5[_0x9b94('0x44')]=_['intersection'](_0x2321e5['model'],_0x2321e5[_0x9b94('0x42')]);_0x4f37f5[_0x9b94('0x45')]=_['intersection'](_0x2321e5[_0x9b94('0x41')],qs[_0x9b94('0x46')](_0x12d03d[_0x9b94('0x42')]['fields']));_0x4f37f5[_0x9b94('0x45')]=_0x4f37f5['attributes'][_0x9b94('0x47')]?_0x4f37f5['attributes']:_0x2321e5[_0x9b94('0x41')];if(!_0x12d03d[_0x9b94('0x42')]['hasOwnProperty']('nolimit')){_0x4f37f5[_0x9b94('0x2e')]=qs[_0x9b94('0x2e')](_0x12d03d[_0x9b94('0x42')][_0x9b94('0x2e')]);_0x4f37f5[_0x9b94('0x2c')]=qs[_0x9b94('0x2c')](_0x12d03d[_0x9b94('0x42')]['offset']);}_0x4f37f5[_0x9b94('0x48')]=qs['sort'](_0x12d03d[_0x9b94('0x42')][_0x9b94('0x49')]);_0x4f37f5[_0x9b94('0x4a')]=qs[_0x9b94('0x44')](_['pick'](_0x12d03d[_0x9b94('0x42')],_0x2321e5['filters']),_0x42147c);if(_0x12d03d[_0x9b94('0x42')]['filter']){_0x4f37f5[_0x9b94('0x4a')]=_[_0x9b94('0x4b')](_0x4f37f5[_0x9b94('0x4a')],{'$or':_[_0x9b94('0x3c')](_0x42147c,function(_0xa55f51){if(_0xa55f51[_0x9b94('0x4c')]!=='VIRTUAL'){var _0x2ccaac={};_0x2ccaac[_0xa55f51[_0x9b94('0x39')]]={'$like':'%'+_0x12d03d[_0x9b94('0x42')][_0x9b94('0x4d')]+'%'};return _0x2ccaac;}})});}_0x4f37f5=_[_0x9b94('0x4b')]({},_0x4f37f5,_0x12d03d[_0x9b94('0x4e')]);var _0x43bbdd={'where':_0x4f37f5[_0x9b94('0x4a')]};return db[_0x9b94('0x3d')]['count'](_0x43bbdd)['then'](function(_0x891856){_0x4fa907[_0x9b94('0x2f')]=_0x891856;if(_0x12d03d[_0x9b94('0x42')][_0x9b94('0x4f')]){_0x4f37f5['include']=[{'all':!![]}];}return db[_0x9b94('0x3d')]['findAll'](_0x4f37f5);})[_0x9b94('0x1f')](function(_0x4d957f){_0x4fa907[_0x9b94('0x50')]=_0x4d957f;return _0x4fa907;})[_0x9b94('0x1f')](respondWithFilteredResult(_0x92bb67,_0x4f37f5))[_0x9b94('0x27')](handleError(_0x92bb67,null));};exports['show']=function(_0x5b5f59,_0x5da0fc){var _0x5bcefb={'raw':!![],'where':{'id':_0x5b5f59['params']['id']}},_0xc0ba35={};_0xc0ba35['model']=_[_0x9b94('0x43')](db['ChatQueue'][_0x9b94('0x3e')]);_0xc0ba35[_0x9b94('0x42')]=_[_0x9b94('0x43')](_0x5b5f59[_0x9b94('0x42')]);_0xc0ba35[_0x9b94('0x44')]=_[_0x9b94('0x51')](_0xc0ba35[_0x9b94('0x41')],_0xc0ba35[_0x9b94('0x42')]);_0x5bcefb['attributes']=_[_0x9b94('0x51')](_0xc0ba35['model'],qs['fields'](_0x5b5f59[_0x9b94('0x42')][_0x9b94('0x46')]));_0x5bcefb[_0x9b94('0x45')]=_0x5bcefb[_0x9b94('0x45')][_0x9b94('0x47')]?_0x5bcefb[_0x9b94('0x45')]:_0xc0ba35[_0x9b94('0x41')];if(_0x5b5f59[_0x9b94('0x42')][_0x9b94('0x4f')]){_0x5bcefb[_0x9b94('0x52')]=[{'all':!![]}];}_0x5bcefb=_[_0x9b94('0x4b')]({},_0x5bcefb,_0x5b5f59[_0x9b94('0x4e')]);return db[_0x9b94('0x3d')]['find'](_0x5bcefb)['then'](handleEntityNotFound(_0x5da0fc,null))['then'](respondWithResult(_0x5da0fc,null))[_0x9b94('0x27')](handleError(_0x5da0fc,null));};exports['create']=function(_0x17ac32,_0x287247){return db[_0x9b94('0x3d')]['create'](_0x17ac32['body'],{})[_0x9b94('0x1f')](function(_0x4e47c6){var _0x2fd5ba=_0x17ac32[_0x9b94('0x53')]['get']({'plain':!![]});if(!_0x2fd5ba)throw new Error(_0x9b94('0x54'));if(_0x2fd5ba[_0x9b94('0x55')]==='user'){var _0x2524dc=_0x4e47c6[_0x9b94('0x35')]({'plain':!![]});var _0x223cea=_0x9b94('0x36');return db[_0x9b94('0x56')][_0x9b94('0x57')]({'where':{'name':_0x223cea,'userProfileId':_0x2fd5ba['userProfileId']},'raw':!![]})['then'](function(_0x309716){if(_0x309716&&_0x309716[_0x9b94('0x58')]===0x0){return db[_0x9b94('0x37')]['create']({'name':_0x2524dc['name'],'resourceId':_0x2524dc['id'],'type':_0x309716[_0x9b94('0x39')],'sectionId':_0x309716['id']},{})[_0x9b94('0x1f')](function(){return _0x4e47c6;});}else{return _0x4e47c6;}})[_0x9b94('0x27')](function(_0x519f66){logger[_0x9b94('0x23')](_0x9b94('0x59'),_0x519f66);throw _0x519f66;});}return _0x4e47c6;})[_0x9b94('0x1f')](respondWithResult(_0x287247,0xc9))[_0x9b94('0x27')](handleError(_0x287247,null));};exports[_0x9b94('0x34')]=function(_0x4957a0,_0x3e97bc){if(_0x4957a0[_0x9b94('0x5a')]['id']){delete _0x4957a0[_0x9b94('0x5a')]['id'];}return db[_0x9b94('0x3d')][_0x9b94('0x57')]({'where':{'id':_0x4957a0[_0x9b94('0x5b')]['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x3e97bc,null))['then'](saveUpdates(_0x4957a0[_0x9b94('0x5a')],null))['then'](respondWithResult(_0x3e97bc,null))[_0x9b94('0x27')](handleError(_0x3e97bc,null));};exports[_0x9b94('0x5c')]=function(_0x1c3635,_0x5cccc0){return db[_0x9b94('0x3d')]['find']({'where':{'id':_0x1c3635['params']['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x5cccc0,null))[_0x9b94('0x1f')](removeEntity(_0x5cccc0,null))[_0x9b94('0x27')](handleError(_0x5cccc0,null));};exports[_0x9b94('0x5d')]=function(_0xd42d23,_0x1123da){return db[_0x9b94('0x3d')][_0x9b94('0x5d')]()[_0x9b94('0x1f')](respondWithResult(_0x1123da,null))[_0x9b94('0x27')](handleError(_0x1123da,null));};exports[_0x9b94('0x5e')]=function(_0x522824,_0x33b2c3,_0x36fe32){var _0x5b37dd={'raw':!![],'where':{}},_0x929040={},_0x27a7c1;return db[_0x9b94('0x3d')]['findOne']({'where':{'id':_0x522824[_0x9b94('0x5b')]['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x33b2c3,null))['then'](function(_0x42b0bb){if(_0x42b0bb){_0x27a7c1=_0x42b0bb[_0x9b94('0x35')]({'plain':!![]});_0x929040[_0x9b94('0x41')]=_[_0x9b94('0x43')](db['UserChatQueue']['rawAttributes']);_0x929040[_0x9b94('0x42')]=_['keys'](_0x522824[_0x9b94('0x42')]);_0x929040[_0x9b94('0x44')]=_[_0x9b94('0x51')](_0x929040['model'],_0x929040['query']);_0x5b37dd[_0x9b94('0x45')]=_['intersection'](_0x929040[_0x9b94('0x41')],qs['fields'](_0x522824[_0x9b94('0x42')]['fields']));_0x5b37dd['attributes']=_0x5b37dd[_0x9b94('0x45')][_0x9b94('0x47')]?_0x5b37dd[_0x9b94('0x45')]:_0x929040[_0x9b94('0x41')];if(!_0x522824['query'][_0x9b94('0x5f')](_0x9b94('0x60'))){_0x5b37dd[_0x9b94('0x2e')]=qs[_0x9b94('0x2e')](_0x522824[_0x9b94('0x42')][_0x9b94('0x2e')]);_0x5b37dd['offset']=qs['offset'](_0x522824[_0x9b94('0x42')][_0x9b94('0x2c')]);}_0x5b37dd['order']=qs[_0x9b94('0x49')](_0x522824[_0x9b94('0x42')][_0x9b94('0x49')]);_0x5b37dd[_0x9b94('0x4a')]=qs[_0x9b94('0x44')](_['pick'](_0x522824[_0x9b94('0x42')],_0x929040['filters']));_0x5b37dd[_0x9b94('0x4a')][_0x9b94('0x61')]=_0x42b0bb['id'];if(_0x522824['query']['filter']){_0x5b37dd[_0x9b94('0x4a')]=_[_0x9b94('0x4b')](_0x5b37dd[_0x9b94('0x4a')],{'$or':_[_0x9b94('0x3c')](_0x5b37dd[_0x9b94('0x45')],function(_0x1c92a5){var _0x277915={};_0x277915[_0x1c92a5]={'$like':'%'+_0x522824[_0x9b94('0x42')]['filter']+'%'};return _0x277915;})});}_0x5b37dd=_['merge']({},_0x5b37dd,_0x522824[_0x9b94('0x4e')]);return db['UserChatQueue'][_0x9b94('0x62')](_0x5b37dd);}})[_0x9b94('0x1f')](function(_0x26c156){if(_0x26c156){return db[_0x9b94('0x63')][_0x9b94('0x64')]({'where':{'id':_[_0x9b94('0x3c')](_0x26c156,_0x9b94('0x65')),'role':_0x9b94('0x66')},'attributes':['id',_0x9b94('0x39'),_0x9b94('0x67'),_0x9b94('0x68'),_0x9b94('0x69')]});}})[_0x9b94('0x1f')](function(_0x4bde37){if(_0x4bde37){return{'count':_0x4bde37[_0x9b94('0x2f')],'rows':_[_0x9b94('0x3c')](_0x4bde37[_0x9b94('0x50')],function(_0x34a426){return{'membername':_0x34a426[_0x9b94('0x39')],'UserId':_0x34a426['id'],'queue_name':_0x27a7c1[_0x9b94('0x39')],'ChatQueueId':_0x27a7c1['id'],'interface':util['format'](_0x9b94('0x6a'),_0x9b94('0x6b'),_0x34a426[_0x9b94('0x39')]),'penalty':0x0,'paused':_0x34a426['chatPause'],'createdAt':_0x34a426['createdAt'],'updatedAt':_0x34a426['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33b2c3,_0x5b37dd))[_0x9b94('0x27')](handleError(_0x33b2c3,null));};exports['getTeams']=function(_0x5d715b,_0x1e917e,_0x380736){var _0x2320f8={};var _0x2af79f={};var _0x42431a;var _0x1610f6;return db[_0x9b94('0x3d')][_0x9b94('0x6c')]({'where':{'id':_0x5d715b['params']['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x1e917e,null))['then'](function(_0x15976b){if(_0x15976b){_0x42431a=_0x15976b;_0x2af79f[_0x9b94('0x41')]=_['keys'](db['Team'][_0x9b94('0x3e')]);_0x2af79f['query']=_[_0x9b94('0x43')](_0x5d715b[_0x9b94('0x42')]);_0x2af79f[_0x9b94('0x44')]=_[_0x9b94('0x51')](_0x2af79f[_0x9b94('0x41')],_0x2af79f[_0x9b94('0x42')]);_0x2320f8[_0x9b94('0x45')]=_[_0x9b94('0x51')](_0x2af79f[_0x9b94('0x41')],qs[_0x9b94('0x46')](_0x5d715b['query'][_0x9b94('0x46')]));_0x2320f8['attributes']=_0x2320f8['attributes'][_0x9b94('0x47')]?_0x2320f8['attributes']:_0x2af79f[_0x9b94('0x41')];_0x2320f8[_0x9b94('0x48')]=qs[_0x9b94('0x49')](_0x5d715b[_0x9b94('0x42')][_0x9b94('0x49')]);_0x2320f8[_0x9b94('0x4a')]=qs[_0x9b94('0x44')](_[_0x9b94('0x6d')](_0x5d715b[_0x9b94('0x42')],_0x2af79f[_0x9b94('0x44')]));if(_0x5d715b['query'][_0x9b94('0x4d')]){_0x2320f8['where']=_[_0x9b94('0x4b')](_0x2320f8[_0x9b94('0x4a')],{'$or':_['map'](_0x2320f8['attributes'],function(_0x333b64){var _0x5b18b9={};_0x5b18b9[_0x333b64]={'$like':'%'+_0x5d715b['query'][_0x9b94('0x4d')]+'%'};return _0x5b18b9;})});}_0x2320f8=_[_0x9b94('0x4b')]({},_0x2320f8,_0x5d715b[_0x9b94('0x4e')]);return _0x42431a[_0x9b94('0x6e')](_0x2320f8);}})[_0x9b94('0x1f')](function(_0x486d0b){if(_0x486d0b){_0x1610f6=_0x486d0b[_0x9b94('0x47')];if(!_0x5d715b[_0x9b94('0x42')][_0x9b94('0x5f')](_0x9b94('0x60'))){_0x2320f8[_0x9b94('0x2e')]=qs[_0x9b94('0x2e')](_0x5d715b[_0x9b94('0x42')][_0x9b94('0x2e')]);_0x2320f8[_0x9b94('0x2c')]=qs[_0x9b94('0x2c')](_0x5d715b[_0x9b94('0x42')][_0x9b94('0x2c')]);}return _0x42431a['getTeams'](_0x2320f8);}})[_0x9b94('0x1f')](function(_0x4e4e20){if(_0x4e4e20){return _0x4e4e20?{'count':_0x1610f6,'rows':_0x4e4e20}:null;}})['then'](respondWithResult(_0x1e917e,null))[_0x9b94('0x27')](handleError(_0x1e917e,null));};exports[_0x9b94('0x6f')]=function(_0x358374,_0x1d6cbe,_0x3ecfdd){var _0xc386a6=_0x358374[_0x9b94('0x5a')][_0x9b94('0x70')];return db[_0x9b94('0x71')][_0x9b94('0x62')]({'where':{'id':_0xc386a6},'attributes':['id'],'include':[{'model':db[_0x9b94('0x63')],'as':_0x9b94('0x72'),'attributes':['id',_0x9b94('0x39'),_0x9b94('0x73'),'voicePause',_0x9b94('0x74')],'raw':!![]}]})[_0x9b94('0x1f')](function(_0x5eb349){if(_0x5eb349){var _0x5d77dc=_[_0x9b94('0x75')](_0x5eb349,function(_0x297b6c){var _0xcb4fae=_0x297b6c[_0x9b94('0x35')]({'plain':!![]});return _0xcb4fae[_0x9b94('0x72')];});return db[_0x9b94('0x3d')][_0x9b94('0x57')]({'where':{'id':_0x358374[_0x9b94('0x5b')]['id']}})[_0x9b94('0x1f')](function(_0x5c8366){return db[_0x9b94('0x76')][_0x9b94('0x77')](function(_0xaed320){return _0x5c8366[_0x9b94('0x6f')](_0xc386a6,{'transaction':_0xaed320})[_0x9b94('0x1f')](function(){return BPromise['each'](_0x5d77dc,function(_0x123dd2){return db[_0x9b94('0x78')][_0x9b94('0x79')]({'where':{'UserId':_0x123dd2['id'],'ChatQueueId':_0x358374[_0x9b94('0x5b')]['id']},'transaction':_0xaed320});});})[_0x9b94('0x1f')](function(){_0x5d77dc[_0x9b94('0x7a')](function(_0x51664b){socket[_0x9b94('0x7b')](_0x9b94('0x7c'),{'UserId':_0x51664b['id'],'ChatQueueId':_0x5c8366['id']});});});});});}})['then'](respondWithStatusCode(_0x1d6cbe,null))[_0x9b94('0x27')](handleError(_0x1d6cbe,null));};exports['removeTeams']=function(_0x48489b,_0x478038,_0x4b9719){return db[_0x9b94('0x71')]['findAll']({'where':{'id':_0x48489b[_0x9b94('0x42')][_0x9b94('0x70')]},'attributes':['id'],'include':[{'model':db[_0x9b94('0x63')],'as':_0x9b94('0x72'),'attributes':['id'],'raw':!![]}]})[_0x9b94('0x1f')](handleEntityNotFound(_0x478038,null))[_0x9b94('0x1f')](function(_0x5dd2ff){var _0x222409=_['map'](_0x5dd2ff,'id');var _0x298255=[];var _0x445343=[];var _0x5c0d16=squel['select']();_0x5c0d16[_0x9b94('0x7d')]('tq.TeamId')[_0x9b94('0x7e')](_0x9b94('0x7f'),'tq')[_0x9b94('0x80')](_0x9b94('0x81'),'ut',_0x9b94('0x82'))['where'](_0x9b94('0x83'),_0x48489b[_0x9b94('0x5b')]['id']);for(var _0x21751e=0x0;_0x21751e<_0x5dd2ff[_0x9b94('0x47')];_0x21751e+=0x1){let _0x4ef4db=_0x5dd2ff[_0x21751e];for(var _0x5181d6=0x0;_0x5181d6<_0x4ef4db[_0x9b94('0x72')][_0x9b94('0x47')];_0x5181d6+=0x1){let _0x299775=_0x4ef4db[_0x9b94('0x72')][_0x5181d6];var _0x186e07=_0x5c0d16[_0x9b94('0x84')]();_0x186e07[_0x9b94('0x4a')](_0x9b94('0x85'),_0x299775['id']);_0x445343[_0x9b94('0x86')](db[_0x9b94('0x76')][_0x9b94('0x42')](_0x186e07[_0x9b94('0x87')](),{'type':db['sequelize']['QueryTypes'][_0x9b94('0x88')]})[_0x9b94('0x1f')](function(_0xb0cba1){if(_0xb0cba1[_0x9b94('0x47')]===0x1){return _0x299775['id'];}else{var _0x183eeb=_['every'](_['map'](_0xb0cba1,_0x9b94('0x89')),function(_0x58f7d3){return _[_0x9b94('0x8a')](_0x222409,_0x58f7d3);});if(_0x183eeb){return _0x299775['id'];}}}));}}return BPromise['all'](_0x445343)[_0x9b94('0x1f')](function(_0x444922){_0x298255=_(_0x298255)[_0x9b94('0x8b')](_0x444922)[_0x9b94('0x8c')]()[_0x9b94('0x8d')]();return db[_0x9b94('0x3d')][_0x9b94('0x57')]({'where':{'id':_0x48489b['params']['id']}})['then'](function(_0x45173b){return db[_0x9b94('0x76')][_0x9b94('0x77')](function(_0x260fab){return _0x45173b[_0x9b94('0x8e')](_0x48489b[_0x9b94('0x42')][_0x9b94('0x70')],{'transaction':_0x260fab})[_0x9b94('0x1f')](function(){if(!_[_0x9b94('0x8f')](_0x298255)){return _0x45173b['removeAgents'](_0x298255,{'transaction':_0x260fab});}})[_0x9b94('0x1f')](function(){_0x298255[_0x9b94('0x7a')](function(_0x32f015){socket[_0x9b94('0x7b')]('userChatQueue:remove',{'UserId':_0x32f015,'ChatQueueId':_0x45173b['id']});});});});});});})[_0x9b94('0x1f')](respondWithStatusCode(_0x478038,null))[_0x9b94('0x27')](handleError(_0x478038,null));};exports[_0x9b94('0x90')]=function(_0x4faf1a,_0x247a2e,_0x214c1c){return db[_0x9b94('0x3d')][_0x9b94('0x57')]({'where':{'id':_0x4faf1a['params']['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x247a2e,null))['then'](function(_0xd2e970){if(_0xd2e970){return _0xd2e970[_0x9b94('0x90')](_0x4faf1a[_0x9b94('0x5a')]['ids'],_[_0x9b94('0x91')](_0x4faf1a[_0x9b94('0x5a')],[_0x9b94('0x70'),'id'])||{})[_0x9b94('0x92')](function(_0x24654b){for(var _0x302a47=0x0;_0x302a47<_0x4faf1a[_0x9b94('0x5a')][_0x9b94('0x70')]['length'];_0x302a47+=0x1){socket[_0x9b94('0x7b')](_0x9b94('0x7c'),{'UserId':Number(_0x4faf1a[_0x9b94('0x5a')][_0x9b94('0x70')][_0x302a47]),'ChatQueueId':Number(_0x4faf1a[_0x9b94('0x5b')]['id'])});}return _0x24654b;});}})[_0x9b94('0x1f')](respondWithResult(_0x247a2e,null))[_0x9b94('0x27')](handleError(_0x247a2e,null));};exports['removeAgents']=function(_0x1f15b4,_0x125bbb,_0x5d06ad){return db[_0x9b94('0x3d')][_0x9b94('0x57')]({'where':{'id':_0x1f15b4[_0x9b94('0x5b')]['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x125bbb,null))[_0x9b94('0x1f')](function(_0x17fa7c){if(_0x17fa7c){return _0x17fa7c[_0x9b94('0x93')](_0x1f15b4['query'][_0x9b94('0x70')])[_0x9b94('0x1f')](function(){if(_[_0x9b94('0x94')](_0x1f15b4[_0x9b94('0x42')]['ids'])){for(var _0x36c7c1=0x0;_0x36c7c1<_0x1f15b4['query'][_0x9b94('0x70')][_0x9b94('0x47')];_0x36c7c1+=0x1){socket[_0x9b94('0x7b')](_0x9b94('0x95'),{'UserId':Number(_0x1f15b4[_0x9b94('0x42')]['ids'][_0x36c7c1]),'ChatQueueId':Number(_0x1f15b4[_0x9b94('0x5b')]['id'])});}}else{socket['emit'](_0x9b94('0x95'),{'UserId':Number(_0x1f15b4[_0x9b94('0x42')]['ids']),'ChatQueueId':Number(_0x1f15b4[_0x9b94('0x5b')]['id'])});}});}})[_0x9b94('0x1f')](respondWithStatusCode(_0x125bbb,null))[_0x9b94('0x27')](handleError(_0x125bbb,null));};exports[_0x9b94('0x96')]=function(_0x53ce1f,_0x1bf04a,_0x1c0487){var _0x347604={};var _0x1bb745={};var _0x8cb3b4;var _0x304306;return db['ChatQueue'][_0x9b94('0x6c')]({'where':{'id':_0x53ce1f[_0x9b94('0x5b')]['id']}})[_0x9b94('0x1f')](handleEntityNotFound(_0x1bf04a,null))[_0x9b94('0x1f')](function(_0x3ed42d){if(_0x3ed42d){_0x8cb3b4=_0x3ed42d;_0x1bb745['model']=_[_0x9b94('0x43')](db[_0x9b94('0x63')][_0x9b94('0x3e')]);_0x1bb745[_0x9b94('0x42')]=_[_0x9b94('0x43')](_0x53ce1f['query']);_0x1bb745['filters']=_[_0x9b94('0x51')](_0x1bb745['model'],_0x1bb745['query']);_0x347604[_0x9b94('0x45')]=_[_0x9b94('0x51')](_0x1bb745[_0x9b94('0x41')],qs['fields'](_0x53ce1f['query'][_0x9b94('0x46')]));_0x347604[_0x9b94('0x45')]=_0x347604['attributes']['length']?_0x347604[_0x9b94('0x45')]:_0x1bb745[_0x9b94('0x41')];_0x347604[_0x9b94('0x48')]=qs[_0x9b94('0x49')](_0x53ce1f['query']['sort']);_0x347604[_0x9b94('0x4a')]=qs[_0x9b94('0x44')](_['pick'](_0x53ce1f[_0x9b94('0x42')],_0x1bb745[_0x9b94('0x44')]));if(_0x53ce1f[_0x9b94('0x42')]['filter']){_0x347604['where']=_[_0x9b94('0x4b')](_0x347604[_0x9b94('0x4a')],{'$or':_['map'](_0x347604[_0x9b94('0x45')],function(_0x3a46a3){var _0x4ff8af={};_0x4ff8af[_0x3a46a3]={'$like':'%'+_0x53ce1f['query']['filter']+'%'};return _0x4ff8af;})});}_0x347604=_[_0x9b94('0x4b')]({},_0x347604,_0x53ce1f[_0x9b94('0x4e')]);return _0x8cb3b4[_0x9b94('0x96')](_0x347604);}})['then'](function(_0x1488f6){if(_0x1488f6){_0x304306=_0x1488f6[_0x9b94('0x47')];if(!_0x53ce1f[_0x9b94('0x42')][_0x9b94('0x5f')](_0x9b94('0x60'))){_0x347604[_0x9b94('0x2e')]=qs['limit'](_0x53ce1f[_0x9b94('0x42')][_0x9b94('0x2e')]);_0x347604[_0x9b94('0x2c')]=qs[_0x9b94('0x2c')](_0x53ce1f[_0x9b94('0x42')][_0x9b94('0x2c')]);}return _0x8cb3b4['getAgents'](_0x347604);}})[_0x9b94('0x1f')](function(_0x3e58ea){if(_0x3e58ea){return _0x3e58ea?{'count':_0x304306,'rows':_0x3e58ea}:null;}})[_0x9b94('0x1f')](respondWithResult(_0x1bf04a,null))[_0x9b94('0x27')](handleError(_0x1bf04a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index cf3835a..d557e13 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 _0x5882=['emit','hasOwnProperty','exports','../../mysqldb','ChatQueue','save','update','remove'];(function(_0x324491,_0x502f44){var _0x12a2fd=function(_0x40201c){while(--_0x40201c){_0x324491['push'](_0x324491['shift']());}};_0x12a2fd(++_0x502f44);}(_0x5882,0x1db));var _0x2588=function(_0x5d88c9,_0x27c862){_0x5d88c9=_0x5d88c9-0x0;var _0x364c1b=_0x5882[_0x5d88c9];return _0x364c1b;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x2588('0x0'))['db'][_0x2588('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2588('0x2'),'afterUpdate':_0x2588('0x3'),'afterDestroy':_0x2588('0x4')};function emitEvent(_0x43622a){return function(_0x216dc9,_0x2c5ae2,_0x11fca2){ChatQueueEvents['emit'](_0x43622a+':'+_0x216dc9['id'],_0x216dc9);ChatQueueEvents[_0x2588('0x5')](_0x43622a,_0x216dc9);_0x11fca2(null);};}for(var e in events){if(events[_0x2588('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x2588('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xb806=['setMaxListeners','save','emit','hook','exports','events'];(function(_0x345df0,_0x5ee809){var _0x3f497=function(_0x1656b7){while(--_0x1656b7){_0x345df0['push'](_0x345df0['shift']());}};_0x3f497(++_0x5ee809);}(_0xb806,0x95));var _0x6b80=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xb806[_0x119d5a];return _0x15bff4;};'use strict';var EventEmitter=require(_0x6b80('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6b80('0x1')](0x0);var events={'afterCreate':_0x6b80('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x152800){return function(_0x5f313c,_0x5a03c4,_0xf9407b){ChatQueueEvents[_0x6b80('0x3')](_0x152800+':'+_0x5f313c['id'],_0x5f313c);ChatQueueEvents[_0x6b80('0x3')](_0x152800,_0x5f313c);_0xf9407b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6b80('0x4')](e,emitEvent(event));}}module[_0x6b80('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1b3c1e0..50c7c2b 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 _0x416d=['./chatQueue.attributes','exports','define','ChatQueue','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x48ae62,_0x3cfce7){var _0x2634a6=function(_0x17b9c7){while(--_0x17b9c7){_0x48ae62['push'](_0x48ae62['shift']());}};_0x2634a6(++_0x3cfce7);}(_0x416d,0x101));var _0xd416=function(_0x42eef9,_0x465269){_0x42eef9=_0x42eef9-0x0;var _0x157ba3=_0x416d[_0x42eef9];return _0x157ba3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd416('0x0'))(_0xd416('0x1'));var moment=require(_0xd416('0x2'));var BPromise=require(_0xd416('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd416('0x4'));var rimraf=require(_0xd416('0x5'));var config=require(_0xd416('0x6'));var attributes=require(_0xd416('0x7'));module[_0xd416('0x8')]=function(_0x486447,_0x48f7f5){return _0x486447[_0xd416('0x9')](_0xd416('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4b1=['./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x19d4b3,_0x3e4940){var _0x16ae4b=function(_0x344ce3){while(--_0x344ce3){_0x19d4b3['push'](_0x19d4b3['shift']());}};_0x16ae4b(++_0x3e4940);}(_0xb4b1,0x154));var _0x1b4b=function(_0x23238a,_0x43a271){_0x23238a=_0x23238a-0x0;var _0x45a161=_0xb4b1[_0x23238a];return _0x45a161;};'use strict';var _=require(_0x1b4b('0x0'));var util=require(_0x1b4b('0x1'));var logger=require(_0x1b4b('0x2'))(_0x1b4b('0x3'));var moment=require(_0x1b4b('0x4'));var BPromise=require(_0x1b4b('0x5'));var rp=require(_0x1b4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b4b('0x7'));var config=require('../../config/environment');var attributes=require(_0x1b4b('0x8'));module['exports']=function(_0x21a1df,_0x2e3447){return _0x21a1df[_0x1b4b('0x9')](_0x1b4b('0xa'),attributes,{'tableName':_0x1b4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index f705e44..240bba4 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 _0xac35=['model','include','catch','ShowChatQueue','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','map'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xac35,0x141));var _0x5ac3=function(_0x3385bc,_0x89b525){_0x3385bc=_0x3385bc-0x0;var _0x43bfc9=_0xac35[_0x3385bc];return _0x43bfc9;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});config['redis']=_[_0x5ac3('0xe')](config['redis'],{'host':_0x5ac3('0xf'),'port':0x18eb});var socket=require(_0x5ac3('0x10'))(new Redis(config[_0x5ac3('0x11')]));require(_0x5ac3('0x12'))[_0x5ac3('0x13')](socket);function respondWithRpcPromise(_0x26e7fe,_0x4df25f,_0x139f05){return new BPromise(function(_0x5e3a51,_0x1d9420){return client[_0x5ac3('0x14')](_0x26e7fe,_0x139f05)[_0x5ac3('0x15')](function(_0x17c212){logger[_0x5ac3('0x16')](_0x5ac3('0x17'),_0x4df25f,_0x5ac3('0x18'));logger['debug'](_0x5ac3('0x19'),_0x4df25f,_0x5ac3('0x18'),JSON[_0x5ac3('0x1a')](_0x17c212));if(_0x17c212[_0x5ac3('0x1b')]){if(_0x17c212[_0x5ac3('0x1b')][_0x5ac3('0x1c')]===0x1f4){logger[_0x5ac3('0x1b')](_0x5ac3('0x17'),_0x4df25f,_0x17c212['error']['message']);return _0x1d9420(_0x17c212[_0x5ac3('0x1b')][_0x5ac3('0x1d')]);}logger['error'](_0x5ac3('0x17'),_0x4df25f,_0x17c212['error'][_0x5ac3('0x1d')]);return _0x5e3a51(_0x17c212[_0x5ac3('0x1b')][_0x5ac3('0x1d')]);}else{logger['info'](_0x5ac3('0x17'),_0x4df25f,_0x5ac3('0x18'));_0x5e3a51(_0x17c212[_0x5ac3('0x1e')][_0x5ac3('0x1d')]);}})['catch'](function(_0x22907d){logger[_0x5ac3('0x1b')](_0x5ac3('0x17'),_0x4df25f,_0x22907d);_0x1d9420(_0x22907d);});});}exports[_0x5ac3('0x1f')]=function(_0x12748f){var _0xeb7dea=this;return new Promise(function(_0x2039b1,_0x2fcc26){return db[_0x5ac3('0x20')][_0x5ac3('0x21')]({'raw':_0x12748f[_0x5ac3('0x22')]?_0x12748f[_0x5ac3('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x12748f[_0x5ac3('0x22')]?_0x12748f[_0x5ac3('0x22')][_0x5ac3('0x23')]||null:null,'attributes':_0x12748f[_0x5ac3('0x22')]?_0x12748f['options'][_0x5ac3('0x24')]||null:null,'limit':_0x12748f[_0x5ac3('0x22')]?_0x12748f[_0x5ac3('0x22')][_0x5ac3('0x25')]||null:null,'include':_0x12748f['options']?_0x12748f[_0x5ac3('0x22')]['include']?_[_0x5ac3('0x26')](_0x12748f['options']['include'],function(_0x395127){return{'model':db[_0x395127[_0x5ac3('0x27')]],'as':_0x395127['as'],'attributes':_0x395127['attributes'],'include':_0x395127[_0x5ac3('0x28')]?_[_0x5ac3('0x26')](_0x395127[_0x5ac3('0x28')],function(_0x1f563e){return{'model':db[_0x1f563e['model']],'as':_0x1f563e['as'],'attributes':_0x1f563e[_0x5ac3('0x24')],'include':_0x1f563e[_0x5ac3('0x28')]?_[_0x5ac3('0x26')](_0x1f563e[_0x5ac3('0x28')],function(_0x84eeb4){return{'model':db[_0x84eeb4[_0x5ac3('0x27')]],'as':_0x84eeb4['as'],'attributes':_0x84eeb4[_0x5ac3('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2388b8){logger[_0x5ac3('0x16')](_0x5ac3('0x1f'),_0x12748f);logger['debug'](_0x5ac3('0x1f'),_0x12748f,JSON[_0x5ac3('0x1a')](_0x2388b8));_0x2039b1(_0x2388b8);})[_0x5ac3('0x29')](function(_0x5df562){logger[_0x5ac3('0x1b')]('GetChatQueue',_0x5df562[_0x5ac3('0x1d')],_0x12748f);_0x2fcc26(_0xeb7dea['error'](0x1f4,_0x5df562[_0x5ac3('0x1d')]));});});};exports[_0x5ac3('0x2a')]=function(_0x5a4497){var _0x5afa5b=this;return new Promise(function(_0x52b712,_0x535a6a){return db[_0x5ac3('0x20')]['find']({'raw':_0x5a4497[_0x5ac3('0x22')]?_0x5a4497[_0x5ac3('0x22')][_0x5ac3('0x2b')]===undefined?!![]:![]:!![],'where':_0x5a4497[_0x5ac3('0x22')]?_0x5a4497[_0x5ac3('0x22')][_0x5ac3('0x23')]||null:null,'attributes':_0x5a4497['options']?_0x5a4497[_0x5ac3('0x22')][_0x5ac3('0x24')]||null:null,'include':_0x5a4497[_0x5ac3('0x22')]?_0x5a4497[_0x5ac3('0x22')]['include']?_['map'](_0x5a4497[_0x5ac3('0x22')]['include'],function(_0x20a0d7){return{'model':db[_0x20a0d7[_0x5ac3('0x27')]],'as':_0x20a0d7['as'],'attributes':_0x20a0d7['attributes'],'include':_0x20a0d7[_0x5ac3('0x28')]?_['map'](_0x20a0d7[_0x5ac3('0x28')],function(_0x49ed51){return{'model':db[_0x49ed51['model']],'as':_0x49ed51['as'],'attributes':_0x49ed51[_0x5ac3('0x24')],'include':_0x49ed51[_0x5ac3('0x28')]?_[_0x5ac3('0x26')](_0x49ed51[_0x5ac3('0x28')],function(_0x4b46f7){return{'model':db[_0x4b46f7[_0x5ac3('0x27')]],'as':_0x4b46f7['as'],'attributes':_0x4b46f7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ac3('0x15')](function(_0x2c3b53){logger[_0x5ac3('0x16')](_0x5ac3('0x2a'),_0x5a4497);logger[_0x5ac3('0x2c')]('ShowChatQueue',_0x5a4497,JSON[_0x5ac3('0x1a')](_0x2c3b53));_0x52b712(_0x2c3b53);})[_0x5ac3('0x29')](function(_0x5e83a4){logger[_0x5ac3('0x1b')](_0x5ac3('0x2a'),_0x5e83a4[_0x5ac3('0x1d')],_0x5a4497);_0x535a6a(_0x5afa5b[_0x5ac3('0x1b')](0x1f4,_0x5e83a4[_0x5ac3('0x1d')]));});});}; \ No newline at end of file +var _0x1458=['GetChatQueue','debug','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatQueue','findAll','options','raw','where','attributes','include','map','model','then'];(function(_0x423aba,_0x4899e4){var _0x273b21=function(_0x573088){while(--_0x573088){_0x423aba['push'](_0x423aba['shift']());}};_0x273b21(++_0x4899e4);}(_0x1458,0x16c));var _0x8145=function(_0x25f08a,_0x4af05a){_0x25f08a=_0x25f08a-0x0;var _0x8072e=_0x1458[_0x25f08a];return _0x8072e;};'use strict';var _=require(_0x8145('0x0'));var util=require(_0x8145('0x1'));var moment=require(_0x8145('0x2'));var BPromise=require(_0x8145('0x3'));var rs=require(_0x8145('0x4'));var fs=require('fs');var Redis=require(_0x8145('0x5'));var db=require(_0x8145('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8145('0x7'))(_0x8145('0x8'));var config=require(_0x8145('0x9'));var jayson=require(_0x8145('0xa'));var client=jayson[_0x8145('0xb')]['http']({'port':0x232a});config[_0x8145('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8145('0xd'))(new Redis(config['redis']));require(_0x8145('0xe'))[_0x8145('0xf')](socket);function respondWithRpcPromise(_0x49bb88,_0x2b50a9,_0x1e3f4b){return new BPromise(function(_0x2e48c5,_0x14db51){return client[_0x8145('0x10')](_0x49bb88,_0x1e3f4b)['then'](function(_0x309ea2){logger[_0x8145('0x11')](_0x8145('0x12'),_0x2b50a9,'request\x20sent');logger['debug'](_0x8145('0x13'),_0x2b50a9,_0x8145('0x14'),JSON[_0x8145('0x15')](_0x309ea2));if(_0x309ea2[_0x8145('0x16')]){if(_0x309ea2[_0x8145('0x16')][_0x8145('0x17')]===0x1f4){logger[_0x8145('0x16')]('ChatQueue,\x20%s,\x20%s',_0x2b50a9,_0x309ea2[_0x8145('0x16')][_0x8145('0x18')]);return _0x14db51(_0x309ea2[_0x8145('0x16')][_0x8145('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2b50a9,_0x309ea2[_0x8145('0x16')][_0x8145('0x18')]);return _0x2e48c5(_0x309ea2[_0x8145('0x16')][_0x8145('0x18')]);}else{logger['info'](_0x8145('0x12'),_0x2b50a9,_0x8145('0x14'));_0x2e48c5(_0x309ea2['result'][_0x8145('0x18')]);}})[_0x8145('0x19')](function(_0x41acd8){logger[_0x8145('0x16')](_0x8145('0x12'),_0x2b50a9,_0x41acd8);_0x14db51(_0x41acd8);});});}exports['GetChatQueue']=function(_0x2dfb85){var _0x420855=this;return new Promise(function(_0xc88d5c,_0x11707e){return db[_0x8145('0x1a')][_0x8145('0x1b')]({'raw':_0x2dfb85['options']?_0x2dfb85[_0x8145('0x1c')][_0x8145('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dfb85[_0x8145('0x1c')]?_0x2dfb85['options'][_0x8145('0x1e')]||null:null,'attributes':_0x2dfb85['options']?_0x2dfb85['options'][_0x8145('0x1f')]||null:null,'limit':_0x2dfb85[_0x8145('0x1c')]?_0x2dfb85[_0x8145('0x1c')]['limit']||null:null,'include':_0x2dfb85[_0x8145('0x1c')]?_0x2dfb85[_0x8145('0x1c')][_0x8145('0x20')]?_['map'](_0x2dfb85['options'][_0x8145('0x20')],function(_0x5e5e2c){return{'model':db[_0x5e5e2c['model']],'as':_0x5e5e2c['as'],'attributes':_0x5e5e2c['attributes'],'include':_0x5e5e2c['include']?_[_0x8145('0x21')](_0x5e5e2c[_0x8145('0x20')],function(_0x39f128){return{'model':db[_0x39f128[_0x8145('0x22')]],'as':_0x39f128['as'],'attributes':_0x39f128[_0x8145('0x1f')],'include':_0x39f128[_0x8145('0x20')]?_[_0x8145('0x21')](_0x39f128['include'],function(_0x471533){return{'model':db[_0x471533['model']],'as':_0x471533['as'],'attributes':_0x471533['attributes']};}):[]};}):[]};}):[]:[]})[_0x8145('0x23')](function(_0x33828b){logger[_0x8145('0x11')](_0x8145('0x24'),_0x2dfb85);logger[_0x8145('0x25')](_0x8145('0x24'),_0x2dfb85,JSON['stringify'](_0x33828b));_0xc88d5c(_0x33828b);})[_0x8145('0x19')](function(_0x42efc2){logger['error']('GetChatQueue',_0x42efc2['message'],_0x2dfb85);_0x11707e(_0x420855['error'](0x1f4,_0x42efc2[_0x8145('0x18')]));});});};exports[_0x8145('0x26')]=function(_0x40adda){var _0x1459f2=this;return new Promise(function(_0x513485,_0x4527e5){return db[_0x8145('0x1a')][_0x8145('0x27')]({'raw':_0x40adda[_0x8145('0x1c')]?_0x40adda['options'][_0x8145('0x1d')]===undefined?!![]:![]:!![],'where':_0x40adda[_0x8145('0x1c')]?_0x40adda[_0x8145('0x1c')][_0x8145('0x1e')]||null:null,'attributes':_0x40adda[_0x8145('0x1c')]?_0x40adda[_0x8145('0x1c')][_0x8145('0x1f')]||null:null,'include':_0x40adda[_0x8145('0x1c')]?_0x40adda[_0x8145('0x1c')][_0x8145('0x20')]?_[_0x8145('0x21')](_0x40adda[_0x8145('0x1c')][_0x8145('0x20')],function(_0x33ba4c){return{'model':db[_0x33ba4c[_0x8145('0x22')]],'as':_0x33ba4c['as'],'attributes':_0x33ba4c[_0x8145('0x1f')],'include':_0x33ba4c[_0x8145('0x20')]?_['map'](_0x33ba4c['include'],function(_0x2a846c){return{'model':db[_0x2a846c[_0x8145('0x22')]],'as':_0x2a846c['as'],'attributes':_0x2a846c[_0x8145('0x1f')],'include':_0x2a846c['include']?_[_0x8145('0x21')](_0x2a846c[_0x8145('0x20')],function(_0x395ae2){return{'model':db[_0x395ae2[_0x8145('0x22')]],'as':_0x395ae2['as'],'attributes':_0x395ae2[_0x8145('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8145('0x23')](function(_0x42ead1){logger[_0x8145('0x11')](_0x8145('0x26'),_0x40adda);logger[_0x8145('0x25')](_0x8145('0x26'),_0x40adda,JSON[_0x8145('0x15')](_0x42ead1));_0x513485(_0x42ead1);})[_0x8145('0x19')](function(_0x257d5d){logger[_0x8145('0x16')](_0x8145('0x26'),_0x257d5d['message'],_0x40adda);_0x4527e5(_0x1459f2[_0x8145('0x16')](0x1f4,_0x257d5d[_0x8145('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 36f1497..b3264a0 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 _0x4d9e=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x2fda17,_0x6745b6){var _0x2c9317=function(_0x421e04){while(--_0x421e04){_0x2fda17['push'](_0x2fda17['shift']());}};_0x2c9317(++_0x6745b6);}(_0x4d9e,0x18c));var _0xe4d9=function(_0xc7a59d,_0x39ebbc){_0xc7a59d=_0xc7a59d-0x0;var _0xd126ff=_0x4d9e[_0xc7a59d];return _0xd126ff;};'use strict';var ChatQueueEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatQueueEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatQueueEvents['on'](_0x54a63a,_0x36316f);}}; \ No newline at end of file +var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x275537,_0x5c64db){var _0x1b51dd=function(_0x5d4f46){while(--_0x5d4f46){_0x275537['push'](_0x275537['shift']());}};_0x1b51dd(++_0x5c64db);}(_0x5089,0x1bb));var _0x9508=function(_0x1d3019,_0x8dbbd5){_0x1d3019=_0x1d3019-0x0;var _0x36458e=_0x5089[_0x1d3019];return _0x36458e;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 79ac491..33cd4ca 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x31e49c,_0x449c67){var _0x3b6ec1=function(_0x3f5fa9){while(--_0x3f5fa9){_0x31e49c['push'](_0x31e49c['shift']());}};_0x3b6ec1(++_0x449c67);}(_0x008c,0x188));var _0xc008=function(_0x51b665,_0x39ba8e){_0x51b665=_0x51b665-0x0;var _0x5bef86=_0x008c[_0x51b665];return _0x5bef86;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x47acf3,_0xd5fc32){var _0x5d75c4=function(_0x1457fc){while(--_0x1457fc){_0x47acf3['push'](_0x47acf3['shift']());}};_0x5d75c4(++_0xd5fc32);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5eca170..1af5a55 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 _0xa791=['STRING','moment','DATE'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0xa791,0x1a8));var _0x1a79=function(_0x338e74,_0x3b3fcd){_0x338e74=_0x338e74-0x0;var _0x5cd101=_0xa791[_0x338e74];return _0x5cd101;};'use strict';var moment=require(_0x1a79('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1a79('0x1')]},'leaveAt':{'type':Sequelize[_0x1a79('0x1')]},'acceptAt':{'type':Sequelize[_0x1a79('0x1')]},'exitAt':{'type':Sequelize[_0x1a79('0x1')]},'reason':{'type':Sequelize[_0x1a79('0x2')]}}; \ No newline at end of file +var _0x84bb=['moment','sequelize','exports','STRING','DATE'];(function(_0x27e709,_0x1f3554){var _0x2218b2=function(_0x3b793f){while(--_0x3b793f){_0x27e709['push'](_0x27e709['shift']());}};_0x2218b2(++_0x1f3554);}(_0x84bb,0x9b));var _0xb84b=function(_0x385380,_0x1a8069){_0x385380=_0x385380-0x0;var _0x1cfcd3=_0x84bb[_0x385380];return _0x1cfcd3;};'use strict';var moment=require(_0xb84b('0x0'));var Sequelize=require(_0xb84b('0x1'));module[_0xb84b('0x2')]={'uniqueid':{'type':Sequelize[_0xb84b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb84b('0x3')]},'joinAt':{'type':Sequelize[_0xb84b('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb84b('0x4')]},'exitAt':{'type':Sequelize[_0xb84b('0x4')]},'reason':{'type':Sequelize[_0xb84b('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index aac0a5c..7fe2543 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 _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0xacf4,0xe7));var _0x4acf=function(_0x32cf9b,_0x4b0dca){_0x32cf9b=_0x32cf9b-0x0;var _0x3af8c6=_0xacf4[_0x32cf9b];return _0x3af8c6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['ChatQueueReport'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['ChatQueueReport']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file +var _0xd48e=['create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','ChatQueueReport','count','includeAll','include','rows','catch','show','params','keys','find'];(function(_0x55e682,_0x2a0387){var _0x53dabe=function(_0x2ed639){while(--_0x2ed639){_0x55e682['push'](_0x55e682['shift']());}};_0x53dabe(++_0x2a0387);}(_0xd48e,0x93));var _0xed48=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xd48e[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed48('0x0'));var zipdir=require(_0xed48('0x1'));var jsonpatch=require(_0xed48('0x2'));var rp=require(_0xed48('0x3'));var moment=require(_0xed48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed48('0x5'));var util=require(_0xed48('0x6'));var path=require(_0xed48('0x7'));var sox=require('sox');var csv=require(_0xed48('0x8'));var ejs=require(_0xed48('0x9'));var fs=require('fs');var fs_extra=require(_0xed48('0xa'));var _=require('lodash');var squel=require(_0xed48('0xb'));var crypto=require(_0xed48('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed48('0xd'));var Papa=require(_0xed48('0xe'));var Redis=require(_0xed48('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed48('0x10'));var hardwareService=require(_0xed48('0x11'));var logger=require(_0xed48('0x12'))('api');var utils=require(_0xed48('0x13'));var config=require(_0xed48('0x14'));var licenseUtil=require(_0xed48('0x15'));var db=require(_0xed48('0x16'))['db'];function respondWithStatusCode(_0x7ee238,_0xaf4b6d){_0xaf4b6d=_0xaf4b6d||0xcc;return function(_0x30bb80){if(_0x30bb80){return _0x7ee238[_0xed48('0x17')](_0xaf4b6d);}return _0x7ee238[_0xed48('0x18')](_0xaf4b6d)[_0xed48('0x19')]();};}function respondWithResult(_0x408ce8,_0x24e67c){_0x24e67c=_0x24e67c||0xc8;return function(_0x429024){if(_0x429024){return _0x408ce8['status'](_0x24e67c)[_0xed48('0x1a')](_0x429024);}};}function respondWithFilteredResult(_0x4a0296,_0x3bf0b7){return function(_0x4d23d9){if(_0x4d23d9){var _0x4d896f=typeof _0x3bf0b7[_0xed48('0x1b')]===_0xed48('0x1c')&&typeof _0x3bf0b7[_0xed48('0x1d')]===_0xed48('0x1c');var _0x1d0d94=_0x4d23d9['count'];var _0x355224=_0x4d896f?0x0:_0x3bf0b7['offset'];var _0x10c4a8=_0x4d896f?_0x4d23d9['count']:_0x3bf0b7[_0xed48('0x1b')]+_0x3bf0b7[_0xed48('0x1d')];var _0x122bf1;if(_0x10c4a8>=_0x1d0d94){_0x10c4a8=_0x1d0d94;_0x122bf1=0xc8;}else{_0x122bf1=0xce;}_0x4a0296['status'](_0x122bf1);return _0x4a0296['set'](_0xed48('0x1e'),_0x355224+'-'+_0x10c4a8+'/'+_0x1d0d94)[_0xed48('0x1a')](_0x4d23d9);}return null;};}function patchUpdates(_0x225d0f){return function(_0x54288f){try{jsonpatch[_0xed48('0x1f')](_0x54288f,_0x225d0f,!![]);}catch(_0x35f451){return BPromise[_0xed48('0x20')](_0x35f451);}return _0x54288f['save']();};}function saveUpdates(_0x277efb,_0x1bda45){return function(_0x13cb25){if(_0x13cb25){return _0x13cb25[_0xed48('0x21')](_0x277efb)[_0xed48('0x22')](function(_0x17a39b){return _0x17a39b;});}return null;};}function removeEntity(_0x4a6d93,_0x2683e4){return function(_0x4b829b){if(_0x4b829b){return _0x4b829b[_0xed48('0x23')]()[_0xed48('0x22')](function(){_0x4a6d93[_0xed48('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b460f,_0x51f67f){return function(_0x350c3c){if(!_0x350c3c){_0x4b460f[_0xed48('0x17')](0x194);}return _0x350c3c;};}function handleError(_0x277ef8,_0x26bff5){_0x26bff5=_0x26bff5||0x1f4;return function(_0x28dbf6){logger[_0xed48('0x24')](_0x28dbf6['stack']);if(_0x28dbf6[_0xed48('0x25')]){delete _0x28dbf6[_0xed48('0x25')];}_0x277ef8[_0xed48('0x18')](_0x26bff5)['send'](_0x28dbf6);};}exports[_0xed48('0x26')]=function(_0x2352a4,_0x5c66e4){var _0x2baff3={},_0x5ed24d={},_0x52a315={'count':0x0,'rows':[]};var _0x391e46=_['map'](db['ChatQueueReport'][_0xed48('0x27')],function(_0x982fdd){return{'name':_0x982fdd[_0xed48('0x28')],'type':_0x982fdd['type'][_0xed48('0x29')]};});_0x5ed24d[_0xed48('0x2a')]=_[_0xed48('0x2b')](_0x391e46,_0xed48('0x25'));_0x5ed24d['query']=_['keys'](_0x2352a4[_0xed48('0x2c')]);_0x5ed24d['filters']=_[_0xed48('0x2d')](_0x5ed24d[_0xed48('0x2a')],_0x5ed24d[_0xed48('0x2c')]);_0x2baff3[_0xed48('0x2e')]=_['intersection'](_0x5ed24d['model'],qs[_0xed48('0x2f')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x2f')]));_0x2baff3[_0xed48('0x2e')]=_0x2baff3[_0xed48('0x2e')][_0xed48('0x30')]?_0x2baff3[_0xed48('0x2e')]:_0x5ed24d[_0xed48('0x2a')];if(!_0x2352a4[_0xed48('0x2c')][_0xed48('0x31')](_0xed48('0x32'))){_0x2baff3[_0xed48('0x1d')]=qs['limit'](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1d')]);_0x2baff3[_0xed48('0x1b')]=qs[_0xed48('0x1b')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1b')]);}_0x2baff3[_0xed48('0x33')]=qs[_0xed48('0x34')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x34')]);_0x2baff3['where']=qs[_0xed48('0x35')](_[_0xed48('0x36')](_0x2352a4[_0xed48('0x2c')],_0x5ed24d[_0xed48('0x35')]),_0x391e46);if(_0x2352a4['query'][_0xed48('0x37')]){_0x2baff3[_0xed48('0x38')]=_['merge'](_0x2baff3[_0xed48('0x38')],{'$or':_[_0xed48('0x2b')](_0x391e46,function(_0x104f65){if(_0x104f65['type']!=='VIRTUAL'){var _0x3281c2={};_0x3281c2[_0x104f65['name']]={'$like':'%'+_0x2352a4[_0xed48('0x2c')][_0xed48('0x37')]+'%'};return _0x3281c2;}})});}_0x2baff3=_[_0xed48('0x39')]({},_0x2baff3,_0x2352a4[_0xed48('0x3a')]);var _0x2a3bfc={'where':_0x2baff3[_0xed48('0x38')]};return db[_0xed48('0x3b')][_0xed48('0x3c')](_0x2a3bfc)[_0xed48('0x22')](function(_0x5b1b8c){_0x52a315[_0xed48('0x3c')]=_0x5b1b8c;if(_0x2352a4[_0xed48('0x2c')][_0xed48('0x3d')]){_0x2baff3[_0xed48('0x3e')]=[{'all':!![]}];}return db[_0xed48('0x3b')]['findAll'](_0x2baff3);})[_0xed48('0x22')](function(_0x1af81d){_0x52a315[_0xed48('0x3f')]=_0x1af81d;return _0x52a315;})[_0xed48('0x22')](respondWithFilteredResult(_0x5c66e4,_0x2baff3))[_0xed48('0x40')](handleError(_0x5c66e4,null));};exports[_0xed48('0x41')]=function(_0x13d84b,_0x1af430){var _0x1d4d1d={'raw':!![],'where':{'id':_0x13d84b[_0xed48('0x42')]['id']}},_0x28014f={};_0x28014f[_0xed48('0x2a')]=_[_0xed48('0x43')](db[_0xed48('0x3b')][_0xed48('0x27')]);_0x28014f[_0xed48('0x2c')]=_[_0xed48('0x43')](_0x13d84b[_0xed48('0x2c')]);_0x28014f['filters']=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],_0x28014f[_0xed48('0x2c')]);_0x1d4d1d[_0xed48('0x2e')]=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],qs['fields'](_0x13d84b[_0xed48('0x2c')]['fields']));_0x1d4d1d[_0xed48('0x2e')]=_0x1d4d1d[_0xed48('0x2e')]['length']?_0x1d4d1d['attributes']:_0x28014f[_0xed48('0x2a')];if(_0x13d84b['query'][_0xed48('0x3d')]){_0x1d4d1d['include']=[{'all':!![]}];}_0x1d4d1d=_['merge']({},_0x1d4d1d,_0x13d84b['options']);return db[_0xed48('0x3b')][_0xed48('0x44')](_0x1d4d1d)[_0xed48('0x22')](handleEntityNotFound(_0x1af430,null))[_0xed48('0x22')](respondWithResult(_0x1af430,null))[_0xed48('0x40')](handleError(_0x1af430,null));};exports[_0xed48('0x45')]=function(_0x5b02a0,_0x51d9d6){return db[_0xed48('0x3b')][_0xed48('0x45')](_0x5b02a0[_0xed48('0x46')],{})[_0xed48('0x22')](respondWithResult(_0x51d9d6,0xc9))[_0xed48('0x40')](handleError(_0x51d9d6,null));};exports[_0xed48('0x21')]=function(_0x505ef9,_0x25fee5){if(_0x505ef9['body']['id']){delete _0x505ef9['body']['id'];}return db['ChatQueueReport'][_0xed48('0x44')]({'where':{'id':_0x505ef9[_0xed48('0x42')]['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x25fee5,null))[_0xed48('0x22')](saveUpdates(_0x505ef9[_0xed48('0x46')],null))[_0xed48('0x22')](respondWithResult(_0x25fee5,null))[_0xed48('0x40')](handleError(_0x25fee5,null));};exports[_0xed48('0x23')]=function(_0x16b21e,_0x3d62a2){return db[_0xed48('0x3b')][_0xed48('0x44')]({'where':{'id':_0x16b21e['params']['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x3d62a2,null))[_0xed48('0x22')](removeEntity(_0x3d62a2,null))[_0xed48('0x40')](handleError(_0x3d62a2,null));};exports[_0xed48('0x47')]=function(_0x1f30ec,_0x143920){return db[_0xed48('0x3b')][_0xed48('0x47')]()[_0xed48('0x22')](respondWithResult(_0x143920,null))[_0xed48('0x40')](handleError(_0x143920,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5471dfd..11cb56a 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0xd70adc,_0x1f5235){var _0x5e5b57=function(_0x1af649){while(--_0x1af649){_0xd70adc['push'](_0xd70adc['shift']());}};_0x5e5b57(++_0x1f5235);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xcb91[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x128a79,_0x19f331){var _0x2ff426=function(_0x57ffc1){while(--_0x57ffc1){_0x128a79['push'](_0x128a79['shift']());}};_0x2ff426(++_0x19f331);}(_0xb10b,0x12a));var _0xbb10=function(_0x32292b,_0x4e9525){_0x32292b=_0x32292b-0x0;var _0x1845b4=_0xb10b[_0x32292b];return _0x1845b4;};'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')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('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 ee6b3d1..646e7ea 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 _0x8286=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatQueueReport','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','body','attributes','limit'];(function(_0xdc21a3,_0x3f58f5){var _0xd6d5f5=function(_0x40cd6c){while(--_0x40cd6c){_0xdc21a3['push'](_0xdc21a3['shift']());}};_0xd6d5f5(++_0x3f58f5);}(_0x8286,0x66));var _0x6828=function(_0x25ea7b,_0x5b50cf){_0x25ea7b=_0x25ea7b-0x0;var _0x4fcb9f=_0x8286[_0x25ea7b];return _0x4fcb9f;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var moment=require(_0x6828('0x2'));var BPromise=require(_0x6828('0x3'));var rs=require(_0x6828('0x4'));var fs=require('fs');var Redis=require(_0x6828('0x5'));var db=require(_0x6828('0x6'))['db'];var utils=require(_0x6828('0x7'));var logger=require(_0x6828('0x8'))(_0x6828('0x9'));var config=require(_0x6828('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6828('0xb')][_0x6828('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5863bf,_0x28c1f2,_0x361730){return new BPromise(function(_0x2e0e4f,_0x4c2c37){return client[_0x6828('0xd')](_0x5863bf,_0x361730)[_0x6828('0xe')](function(_0x1d9cf3){logger[_0x6828('0xf')](_0x6828('0x10'),_0x28c1f2,_0x6828('0x11'));logger[_0x6828('0x12')](_0x6828('0x13'),_0x28c1f2,_0x6828('0x11'),JSON['stringify'](_0x1d9cf3));if(_0x1d9cf3['error']){if(_0x1d9cf3[_0x6828('0x14')]['code']===0x1f4){logger[_0x6828('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x28c1f2,_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);return _0x4c2c37(_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);}logger[_0x6828('0x14')](_0x6828('0x10'),_0x28c1f2,_0x1d9cf3['error'][_0x6828('0x15')]);return _0x2e0e4f(_0x1d9cf3[_0x6828('0x14')][_0x6828('0x15')]);}else{logger['info'](_0x6828('0x10'),_0x28c1f2,_0x6828('0x11'));_0x2e0e4f(_0x1d9cf3[_0x6828('0x16')]['message']);}})[_0x6828('0x17')](function(_0x114e48){logger['error'](_0x6828('0x10'),_0x28c1f2,_0x114e48);_0x4c2c37(_0x114e48);});});}exports['CreateChatQueueReport']=function(_0x23543c){var _0x4b59c4=this;return new Promise(function(_0x31cab0,_0x254881){return db[_0x6828('0x18')]['create'](_0x23543c['body'],{'raw':_0x23543c[_0x6828('0x19')]?_0x23543c[_0x6828('0x19')][_0x6828('0x1a')]===undefined?!![]:![]:!![]})[_0x6828('0xe')](function(_0x469a9f){logger[_0x6828('0xf')](_0x6828('0x1b'),_0x23543c);logger[_0x6828('0x12')](_0x6828('0x1b'),_0x23543c,JSON[_0x6828('0x1c')](_0x469a9f));_0x31cab0(_0x469a9f);})[_0x6828('0x17')](function(_0x1a02b4){logger[_0x6828('0x14')](_0x6828('0x1b'),_0x1a02b4[_0x6828('0x15')],_0x23543c);_0x254881(_0x4b59c4[_0x6828('0x14')](0x1f4,_0x1a02b4[_0x6828('0x15')]));});});};exports[_0x6828('0x1d')]=function(_0x364b9b){var _0x3001ff=this;return new Promise(function(_0x212505,_0x3d48ce){return db['ChatQueueReport'][_0x6828('0x1e')](_0x364b9b[_0x6828('0x1f')],{'raw':_0x364b9b[_0x6828('0x19')]?_0x364b9b[_0x6828('0x19')][_0x6828('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x364b9b[_0x6828('0x19')]?_0x364b9b['options']['where']||null:null,'attributes':_0x364b9b[_0x6828('0x19')]?_0x364b9b['options'][_0x6828('0x20')]||null:null,'limit':_0x364b9b[_0x6828('0x19')]?_0x364b9b[_0x6828('0x19')][_0x6828('0x21')]||null:null})[_0x6828('0xe')](function(_0x3e083d){logger[_0x6828('0xf')](_0x6828('0x1d'),_0x364b9b);logger[_0x6828('0x12')](_0x6828('0x1d'),_0x364b9b,JSON[_0x6828('0x1c')](_0x3e083d));_0x212505(_0x3e083d);})['catch'](function(_0x5039aa){logger[_0x6828('0x14')](_0x6828('0x1d'),_0x5039aa[_0x6828('0x15')],_0x364b9b);_0x3d48ce(_0x3001ff[_0x6828('0x14')](0x1f4,_0x5039aa[_0x6828('0x15')]));});});}; \ No newline at end of file +var _0x93f1=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','CreateChatQueueReport','ChatQueueReport','body','raw','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x23f0ff,_0x1be771){var _0x3de811=function(_0x2ac426){while(--_0x2ac426){_0x23f0ff['push'](_0x23f0ff['shift']());}};_0x3de811(++_0x1be771);}(_0x93f1,0x1b1));var _0x193f=function(_0x5e7878,_0x4abee7){_0x5e7878=_0x5e7878-0x0;var _0x271fa2=_0x93f1[_0x5e7878];return _0x271fa2;};'use strict';var _=require(_0x193f('0x0'));var util=require(_0x193f('0x1'));var moment=require(_0x193f('0x2'));var BPromise=require(_0x193f('0x3'));var rs=require(_0x193f('0x4'));var fs=require('fs');var Redis=require(_0x193f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x193f('0x6'));var logger=require('../../config/logger')(_0x193f('0x7'));var config=require('../../config/environment');var jayson=require(_0x193f('0x8'));var client=jayson['client'][_0x193f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xddcb90,_0x21c670,_0xf6027d){return new BPromise(function(_0x186e72,_0x56059d){return client[_0x193f('0xa')](_0xddcb90,_0xf6027d)[_0x193f('0xb')](function(_0x2131b4){logger[_0x193f('0xc')](_0x193f('0xd'),_0x21c670,_0x193f('0xe'));logger[_0x193f('0xf')](_0x193f('0x10'),_0x21c670,_0x193f('0xe'),JSON[_0x193f('0x11')](_0x2131b4));if(_0x2131b4[_0x193f('0x12')]){if(_0x2131b4[_0x193f('0x12')][_0x193f('0x13')]===0x1f4){logger[_0x193f('0x12')](_0x193f('0xd'),_0x21c670,_0x2131b4[_0x193f('0x12')][_0x193f('0x14')]);return _0x56059d(_0x2131b4[_0x193f('0x12')][_0x193f('0x14')]);}logger[_0x193f('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x21c670,_0x2131b4[_0x193f('0x12')][_0x193f('0x14')]);return _0x186e72(_0x2131b4['error'][_0x193f('0x14')]);}else{logger[_0x193f('0xc')](_0x193f('0xd'),_0x21c670,_0x193f('0xe'));_0x186e72(_0x2131b4[_0x193f('0x15')][_0x193f('0x14')]);}})[_0x193f('0x16')](function(_0x246e06){logger[_0x193f('0x12')](_0x193f('0xd'),_0x21c670,_0x246e06);_0x56059d(_0x246e06);});});}exports['CreateChatQueueReport']=function(_0x477cfb){var _0x39f103=this;return new Promise(function(_0x302ab3,_0x2f29b7){return db['ChatQueueReport'][_0x193f('0x17')](_0x477cfb['body'],{'raw':_0x477cfb[_0x193f('0x18')]?_0x477cfb[_0x193f('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d6309){logger[_0x193f('0xc')]('CreateChatQueueReport',_0x477cfb);logger['debug'](_0x193f('0x19'),_0x477cfb,JSON[_0x193f('0x11')](_0x4d6309));_0x302ab3(_0x4d6309);})[_0x193f('0x16')](function(_0x4e1e65){logger[_0x193f('0x12')]('CreateChatQueueReport',_0x4e1e65[_0x193f('0x14')],_0x477cfb);_0x2f29b7(_0x39f103[_0x193f('0x12')](0x1f4,_0x4e1e65['message']));});});};exports['UpdateChatQueueReport']=function(_0x34ca1e){var _0x3bf179=this;return new Promise(function(_0x3e9360,_0xd32d83){return db[_0x193f('0x1a')]['update'](_0x34ca1e[_0x193f('0x1b')],{'raw':_0x34ca1e['options']?_0x34ca1e[_0x193f('0x18')][_0x193f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34ca1e[_0x193f('0x18')]?_0x34ca1e['options']['where']||null:null,'attributes':_0x34ca1e[_0x193f('0x18')]?_0x34ca1e['options'][_0x193f('0x1d')]||null:null,'limit':_0x34ca1e['options']?_0x34ca1e[_0x193f('0x18')][_0x193f('0x1e')]||null:null})['then'](function(_0x1e14fb){logger[_0x193f('0xc')](_0x193f('0x1f'),_0x34ca1e);logger[_0x193f('0xf')](_0x193f('0x1f'),_0x34ca1e,JSON[_0x193f('0x11')](_0x1e14fb));_0x3e9360(_0x1e14fb);})[_0x193f('0x16')](function(_0x35ae08){logger[_0x193f('0x12')]('UpdateChatQueueReport',_0x35ae08[_0x193f('0x14')],_0x34ca1e);_0xd32d83(_0x3bf179[_0x193f('0x12')](0x1f4,_0x35ae08[_0x193f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 507d40c..6a5c2a0 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 _0x9ee8=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','destroy','exports','multer'];(function(_0x232211,_0x5bd221){var _0x42923f=function(_0xa33a21){while(--_0xa33a21){_0x232211['push'](_0x232211['shift']());}};_0x42923f(++_0x5bd221);}(_0x9ee8,0xa7));var _0x89ee=function(_0x13e5a1,_0x3fe775){_0x13e5a1=_0x13e5a1-0x0;var _0x54014d=_0x9ee8[_0x13e5a1];return _0x54014d;};'use strict';var multer=require(_0x89ee('0x0'));var util=require(_0x89ee('0x1'));var path=require('path');var timeout=require(_0x89ee('0x2'));var express=require(_0x89ee('0x3'));var router=express[_0x89ee('0x4')]();var fs_extra=require(_0x89ee('0x5'));var auth=require(_0x89ee('0x6'));var interaction=require(_0x89ee('0x7'));var config=require(_0x89ee('0x8'));var controller=require(_0x89ee('0x9'));router[_0x89ee('0xa')]('/',auth[_0x89ee('0xb')](),controller[_0x89ee('0xc')]);router['get'](_0x89ee('0xd'),auth[_0x89ee('0xb')](),controller['describe']);router[_0x89ee('0xa')](_0x89ee('0xe'),auth[_0x89ee('0xb')](),controller[_0x89ee('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x89ee('0x10')]);router[_0x89ee('0x11')](_0x89ee('0xe'),auth['isAuthenticated'](),controller[_0x89ee('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x89ee('0x13')]);module[_0x89ee('0x14')]=router; \ No newline at end of file +var _0x160b=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','show'];(function(_0x39d82b,_0x4147ae){var _0xa2788a=function(_0x118f05){while(--_0x118f05){_0x39d82b['push'](_0x39d82b['shift']());}};_0xa2788a(++_0x4147ae);}(_0x160b,0x16d));var _0xb160=function(_0x53bf35,_0x229988){_0x53bf35=_0x53bf35-0x0;var _0x30f77f=_0x160b[_0x53bf35];return _0x30f77f;};'use strict';var multer=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var path=require(_0xb160('0x2'));var timeout=require(_0xb160('0x3'));var express=require(_0xb160('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb160('0x5'));var interaction=require(_0xb160('0x6'));var config=require(_0xb160('0x7'));var controller=require(_0xb160('0x8'));router[_0xb160('0x9')]('/',auth[_0xb160('0xa')](),controller['index']);router['get']('/describe',auth[_0xb160('0xa')](),controller[_0xb160('0xb')]);router[_0xb160('0x9')]('/:id',auth[_0xb160('0xa')](),controller[_0xb160('0xc')]);router[_0xb160('0xd')]('/',auth['isAuthenticated'](),controller[_0xb160('0xe')]);router[_0xb160('0xf')](_0xb160('0x10'),auth[_0xb160('0xa')](),controller[_0xb160('0x11')]);router[_0xb160('0x12')](_0xb160('0x10'),auth[_0xb160('0xa')](),controller[_0xb160('0x13')]);module[_0xb160('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index df790b9..f017d17 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x565c95,_0x562882){var _0x58ca40=function(_0x56e762){while(--_0x56e762){_0x565c95['push'](_0x565c95['shift']());}};_0x58ca40(++_0x562882);}(_0xedd9,0xfc));var _0x9edd=function(_0x43f585,_0x3f8ba8){_0x43f585=_0x43f585-0x0;var _0x399005=_0xedd9[_0x43f585];return _0x399005;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5537ed,_0xf5d760){var _0x56ba5e=function(_0x5573a6){while(--_0x5573a6){_0x5537ed['push'](_0x5537ed['shift']());}};_0x56ba5e(++_0xf5d760);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0xcb91[_0x4bfade];return _0x272465;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4842c87..7209bf4 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 _0xda9c=['sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x21baf3,_0x113f87){var _0x4e7c99=function(_0x196eec){while(--_0x196eec){_0x21baf3['push'](_0x21baf3['shift']());}};_0x4e7c99(++_0x113f87);}(_0xda9c,0x126));var _0xcda9=function(_0x12edf9,_0x4751e3){_0x12edf9=_0x12edf9-0x0;var _0x591aa4=_0xda9c[_0x12edf9];return _0x591aa4;};'use strict';var emlformat=require(_0xcda9('0x0'));var rimraf=require(_0xcda9('0x1'));var zipdir=require(_0xcda9('0x2'));var jsonpatch=require(_0xcda9('0x3'));var rp=require(_0xcda9('0x4'));var moment=require(_0xcda9('0x5'));var BPromise=require(_0xcda9('0x6'));var Mustache=require(_0xcda9('0x7'));var util=require(_0xcda9('0x8'));var path=require(_0xcda9('0x9'));var sox=require(_0xcda9('0xa'));var csv=require(_0xcda9('0xb'));var ejs=require(_0xcda9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcda9('0xd'));var crypto=require(_0xcda9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcda9('0xf'));var toCsv=require(_0xcda9('0xb'));var querystring=require(_0xcda9('0x10'));var Papa=require(_0xcda9('0x11'));var Redis=require(_0xcda9('0x12'));var authService=require(_0xcda9('0x13'));var qs=require(_0xcda9('0x14'));var as=require(_0xcda9('0x15'));var hardwareService=require(_0xcda9('0x16'));var logger=require(_0xcda9('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xcda9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcda9('0x19'))['db'];function respondWithStatusCode(_0x1c3f13,_0x57ff40){_0x57ff40=_0x57ff40||0xcc;return function(_0x4e50c6){if(_0x4e50c6){return _0x1c3f13[_0xcda9('0x1a')](_0x57ff40);}return _0x1c3f13[_0xcda9('0x1b')](_0x57ff40)[_0xcda9('0x1c')]();};}function respondWithResult(_0x1e1be2,_0x4229b7){_0x4229b7=_0x4229b7||0xc8;return function(_0x1f7ad5){if(_0x1f7ad5){return _0x1e1be2['status'](_0x4229b7)[_0xcda9('0x1d')](_0x1f7ad5);}};}function respondWithFilteredResult(_0x264104,_0xfb0bfe){return function(_0x44e010){if(_0x44e010){var _0x134404=typeof _0xfb0bfe[_0xcda9('0x1e')]==='undefined'&&typeof _0xfb0bfe[_0xcda9('0x1f')]===_0xcda9('0x20');var _0x3ea0bf=_0x44e010[_0xcda9('0x21')];var _0x1ce4a6=_0x134404?0x0:_0xfb0bfe[_0xcda9('0x1e')];var _0x351b48=_0x134404?_0x44e010[_0xcda9('0x21')]:_0xfb0bfe[_0xcda9('0x1e')]+_0xfb0bfe['limit'];var _0x437f7a;if(_0x351b48>=_0x3ea0bf){_0x351b48=_0x3ea0bf;_0x437f7a=0xc8;}else{_0x437f7a=0xce;}_0x264104[_0xcda9('0x1b')](_0x437f7a);return _0x264104[_0xcda9('0x22')](_0xcda9('0x23'),_0x1ce4a6+'-'+_0x351b48+'/'+_0x3ea0bf)[_0xcda9('0x1d')](_0x44e010);}return null;};}function patchUpdates(_0x48866e){return function(_0x20539){try{jsonpatch['apply'](_0x20539,_0x48866e,!![]);}catch(_0x215537){return BPromise[_0xcda9('0x24')](_0x215537);}return _0x20539[_0xcda9('0x25')]();};}function saveUpdates(_0x3264f2,_0x20f8b4){return function(_0x38bfa6){if(_0x38bfa6){return _0x38bfa6[_0xcda9('0x26')](_0x3264f2)[_0xcda9('0x27')](function(_0x77cd01){return _0x77cd01;});}return null;};}function removeEntity(_0xa22772,_0x58ff44){return function(_0x422ef6){if(_0x422ef6){return _0x422ef6[_0xcda9('0x28')]()[_0xcda9('0x27')](function(){_0xa22772['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c9c3c,_0x5b5be5){return function(_0xc1caa0){if(!_0xc1caa0){_0x2c9c3c[_0xcda9('0x1a')](0x194);}return _0xc1caa0;};}function handleError(_0x3aa91c,_0x51a506){_0x51a506=_0x51a506||0x1f4;return function(_0x340fee){logger[_0xcda9('0x29')](_0x340fee[_0xcda9('0x2a')]);if(_0x340fee[_0xcda9('0x2b')]){delete _0x340fee['name'];}_0x3aa91c[_0xcda9('0x1b')](_0x51a506)[_0xcda9('0x2c')](_0x340fee);};}exports[_0xcda9('0x2d')]=function(_0x39f864,_0x10ddc3){var _0x28591c={},_0x43bafe={},_0x47191d={'count':0x0,'rows':[]};var _0x52bd35=_[_0xcda9('0x2e')](db[_0xcda9('0x2f')][_0xcda9('0x30')],function(_0x4086c5){return{'name':_0x4086c5[_0xcda9('0x31')],'type':_0x4086c5[_0xcda9('0x32')][_0xcda9('0x33')]};});_0x43bafe[_0xcda9('0x34')]=_[_0xcda9('0x2e')](_0x52bd35,'name');_0x43bafe[_0xcda9('0x35')]=_[_0xcda9('0x36')](_0x39f864['query']);_0x43bafe[_0xcda9('0x37')]=_[_0xcda9('0x38')](_0x43bafe[_0xcda9('0x34')],_0x43bafe[_0xcda9('0x35')]);_0x28591c[_0xcda9('0x39')]=_[_0xcda9('0x38')](_0x43bafe['model'],qs[_0xcda9('0x3a')](_0x39f864[_0xcda9('0x35')][_0xcda9('0x3a')]));_0x28591c[_0xcda9('0x39')]=_0x28591c['attributes']['length']?_0x28591c['attributes']:_0x43bafe[_0xcda9('0x34')];if(!_0x39f864[_0xcda9('0x35')][_0xcda9('0x3b')](_0xcda9('0x3c'))){_0x28591c['limit']=qs[_0xcda9('0x1f')](_0x39f864[_0xcda9('0x35')]['limit']);_0x28591c[_0xcda9('0x1e')]=qs['offset'](_0x39f864[_0xcda9('0x35')][_0xcda9('0x1e')]);}_0x28591c['order']=qs['sort'](_0x39f864[_0xcda9('0x35')][_0xcda9('0x3d')]);_0x28591c[_0xcda9('0x3e')]=qs[_0xcda9('0x37')](_[_0xcda9('0x3f')](_0x39f864[_0xcda9('0x35')],_0x43bafe['filters']),_0x52bd35);if(_0x39f864[_0xcda9('0x35')][_0xcda9('0x40')]){_0x28591c['where']=_['merge'](_0x28591c['where'],{'$or':_['map'](_0x52bd35,function(_0x5f4d7e){if(_0x5f4d7e[_0xcda9('0x32')]!==_0xcda9('0x41')){var _0x52d342={};_0x52d342[_0x5f4d7e[_0xcda9('0x2b')]]={'$like':'%'+_0x39f864[_0xcda9('0x35')]['filter']+'%'};return _0x52d342;}})});}_0x28591c=_[_0xcda9('0x42')]({},_0x28591c,_0x39f864[_0xcda9('0x43')]);var _0x450b1c={'where':_0x28591c[_0xcda9('0x3e')]};return db[_0xcda9('0x2f')][_0xcda9('0x21')](_0x450b1c)[_0xcda9('0x27')](function(_0x340856){_0x47191d['count']=_0x340856;if(_0x39f864[_0xcda9('0x35')][_0xcda9('0x44')]){_0x28591c['include']=[{'all':!![]}];}return db[_0xcda9('0x2f')][_0xcda9('0x45')](_0x28591c);})['then'](function(_0x55d46c){_0x47191d[_0xcda9('0x46')]=_0x55d46c;return _0x47191d;})['then'](respondWithFilteredResult(_0x10ddc3,_0x28591c))[_0xcda9('0x47')](handleError(_0x10ddc3,null));};exports[_0xcda9('0x48')]=function(_0x12fce7,_0x4e3348){var _0x1a280f={'raw':!![],'where':{'id':_0x12fce7[_0xcda9('0x49')]['id']}},_0x333619={};_0x333619[_0xcda9('0x34')]=_[_0xcda9('0x36')](db[_0xcda9('0x2f')][_0xcda9('0x30')]);_0x333619[_0xcda9('0x35')]=_[_0xcda9('0x36')](_0x12fce7[_0xcda9('0x35')]);_0x333619['filters']=_['intersection'](_0x333619[_0xcda9('0x34')],_0x333619['query']);_0x1a280f[_0xcda9('0x39')]=_[_0xcda9('0x38')](_0x333619['model'],qs['fields'](_0x12fce7[_0xcda9('0x35')][_0xcda9('0x3a')]));_0x1a280f[_0xcda9('0x39')]=_0x1a280f[_0xcda9('0x39')][_0xcda9('0x4a')]?_0x1a280f[_0xcda9('0x39')]:_0x333619[_0xcda9('0x34')];if(_0x12fce7[_0xcda9('0x35')][_0xcda9('0x44')]){_0x1a280f[_0xcda9('0x4b')]=[{'all':!![]}];}_0x1a280f=_[_0xcda9('0x42')]({},_0x1a280f,_0x12fce7[_0xcda9('0x43')]);return db[_0xcda9('0x2f')]['find'](_0x1a280f)[_0xcda9('0x27')](handleEntityNotFound(_0x4e3348,null))[_0xcda9('0x27')](respondWithResult(_0x4e3348,null))[_0xcda9('0x47')](handleError(_0x4e3348,null));};exports['create']=function(_0x30299d,_0x54ef90){return db[_0xcda9('0x2f')][_0xcda9('0x4c')](_0x30299d[_0xcda9('0x4d')],{})[_0xcda9('0x27')](respondWithResult(_0x54ef90,0xc9))['catch'](handleError(_0x54ef90,null));};exports[_0xcda9('0x26')]=function(_0x1fb135,_0x130714){if(_0x1fb135[_0xcda9('0x4d')]['id']){delete _0x1fb135[_0xcda9('0x4d')]['id'];}return db[_0xcda9('0x2f')][_0xcda9('0x4e')]({'where':{'id':_0x1fb135[_0xcda9('0x49')]['id']}})[_0xcda9('0x27')](handleEntityNotFound(_0x130714,null))[_0xcda9('0x27')](saveUpdates(_0x1fb135[_0xcda9('0x4d')],null))[_0xcda9('0x27')](respondWithResult(_0x130714,null))[_0xcda9('0x47')](handleError(_0x130714,null));};exports[_0xcda9('0x28')]=function(_0x34d37a,_0x3a99d9){return db[_0xcda9('0x2f')][_0xcda9('0x4e')]({'where':{'id':_0x34d37a['params']['id']}})[_0xcda9('0x27')](handleEntityNotFound(_0x3a99d9,null))[_0xcda9('0x27')](removeEntity(_0x3a99d9,null))['catch'](handleError(_0x3a99d9,null));};exports[_0xcda9('0x4f')]=function(_0x3ee93a,_0x1930e0){return db[_0xcda9('0x2f')][_0xcda9('0x4f')]()['then'](respondWithResult(_0x1930e0,null))['catch'](handleError(_0x1930e0,null));}; \ No newline at end of file +var _0xc837=['end','json','undefined','limit','offset','Content-Range','reject','save','then','destroy','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','include','findAll','rows','catch','params','length','includeAll','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xc837,0x110));var _0x7c83=function(_0x99d7c6,_0x117eba){_0x99d7c6=_0x99d7c6-0x0;var _0x1f51d5=_0xc837[_0x99d7c6];return _0x1f51d5;};'use strict';var emlformat=require(_0x7c83('0x0'));var rimraf=require(_0x7c83('0x1'));var zipdir=require(_0x7c83('0x2'));var jsonpatch=require(_0x7c83('0x3'));var rp=require(_0x7c83('0x4'));var moment=require(_0x7c83('0x5'));var BPromise=require(_0x7c83('0x6'));var Mustache=require(_0x7c83('0x7'));var util=require(_0x7c83('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c83('0x9'));var squel=require(_0x7c83('0xa'));var crypto=require(_0x7c83('0xb'));var jsforce=require(_0x7c83('0xc'));var deskjs=require(_0x7c83('0xd'));var toCsv=require(_0x7c83('0xe'));var querystring=require(_0x7c83('0xf'));var Papa=require(_0x7c83('0x10'));var Redis=require(_0x7c83('0x11'));var authService=require(_0x7c83('0x12'));var qs=require(_0x7c83('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c83('0x14'));var logger=require(_0x7c83('0x15'))(_0x7c83('0x16'));var utils=require('../../config/utils');var config=require(_0x7c83('0x17'));var licenseUtil=require(_0x7c83('0x18'));var db=require(_0x7c83('0x19'))['db'];function respondWithStatusCode(_0x365003,_0x4dbd7e){_0x4dbd7e=_0x4dbd7e||0xcc;return function(_0x4c2387){if(_0x4c2387){return _0x365003[_0x7c83('0x1a')](_0x4dbd7e);}return _0x365003[_0x7c83('0x1b')](_0x4dbd7e)[_0x7c83('0x1c')]();};}function respondWithResult(_0x4ef4f5,_0x85c51b){_0x85c51b=_0x85c51b||0xc8;return function(_0x55b7b9){if(_0x55b7b9){return _0x4ef4f5['status'](_0x85c51b)[_0x7c83('0x1d')](_0x55b7b9);}};}function respondWithFilteredResult(_0xd8f0f4,_0x19d915){return function(_0x32569c){if(_0x32569c){var _0x48b40f=typeof _0x19d915['offset']===_0x7c83('0x1e')&&typeof _0x19d915[_0x7c83('0x1f')]===_0x7c83('0x1e');var _0x2082ae=_0x32569c['count'];var _0x50eca4=_0x48b40f?0x0:_0x19d915[_0x7c83('0x20')];var _0x37c365=_0x48b40f?_0x32569c['count']:_0x19d915[_0x7c83('0x20')]+_0x19d915[_0x7c83('0x1f')];var _0x539da0;if(_0x37c365>=_0x2082ae){_0x37c365=_0x2082ae;_0x539da0=0xc8;}else{_0x539da0=0xce;}_0xd8f0f4[_0x7c83('0x1b')](_0x539da0);return _0xd8f0f4['set'](_0x7c83('0x21'),_0x50eca4+'-'+_0x37c365+'/'+_0x2082ae)[_0x7c83('0x1d')](_0x32569c);}return null;};}function patchUpdates(_0xb978bd){return function(_0x34bd88){try{jsonpatch['apply'](_0x34bd88,_0xb978bd,!![]);}catch(_0x3266e0){return BPromise[_0x7c83('0x22')](_0x3266e0);}return _0x34bd88[_0x7c83('0x23')]();};}function saveUpdates(_0x556121,_0x9c0fcb){return function(_0x5b2c63){if(_0x5b2c63){return _0x5b2c63['update'](_0x556121)[_0x7c83('0x24')](function(_0x11d9e9){return _0x11d9e9;});}return null;};}function removeEntity(_0x1e01c3,_0x1cdd39){return function(_0x203fb8){if(_0x203fb8){return _0x203fb8[_0x7c83('0x25')]()[_0x7c83('0x24')](function(){_0x1e01c3['status'](0xcc)[_0x7c83('0x1c')]();});}};}function handleEntityNotFound(_0x262482,_0x8bdd2a){return function(_0x5d6233){if(!_0x5d6233){_0x262482['sendStatus'](0x194);}return _0x5d6233;};}function handleError(_0x1f0fa1,_0x29739c){_0x29739c=_0x29739c||0x1f4;return function(_0x6cc08){logger[_0x7c83('0x26')](_0x6cc08['stack']);if(_0x6cc08[_0x7c83('0x27')]){delete _0x6cc08[_0x7c83('0x27')];}_0x1f0fa1[_0x7c83('0x1b')](_0x29739c)[_0x7c83('0x28')](_0x6cc08);};}exports[_0x7c83('0x29')]=function(_0x3d403f,_0x1f011f){var _0x44035a={},_0x5c2fb1={},_0x17e36b={'count':0x0,'rows':[]};var _0x1ecdf4=_['map'](db[_0x7c83('0x2a')][_0x7c83('0x2b')],function(_0x24bfca){return{'name':_0x24bfca[_0x7c83('0x2c')],'type':_0x24bfca[_0x7c83('0x2d')]['key']};});_0x5c2fb1['model']=_[_0x7c83('0x2e')](_0x1ecdf4,_0x7c83('0x27'));_0x5c2fb1[_0x7c83('0x2f')]=_[_0x7c83('0x30')](_0x3d403f['query']);_0x5c2fb1[_0x7c83('0x31')]=_['intersection'](_0x5c2fb1[_0x7c83('0x32')],_0x5c2fb1[_0x7c83('0x2f')]);_0x44035a['attributes']=_[_0x7c83('0x33')](_0x5c2fb1[_0x7c83('0x32')],qs[_0x7c83('0x34')](_0x3d403f[_0x7c83('0x2f')][_0x7c83('0x34')]));_0x44035a[_0x7c83('0x35')]=_0x44035a[_0x7c83('0x35')]['length']?_0x44035a[_0x7c83('0x35')]:_0x5c2fb1[_0x7c83('0x32')];if(!_0x3d403f[_0x7c83('0x2f')][_0x7c83('0x36')](_0x7c83('0x37'))){_0x44035a[_0x7c83('0x1f')]=qs[_0x7c83('0x1f')](_0x3d403f['query'][_0x7c83('0x1f')]);_0x44035a[_0x7c83('0x20')]=qs[_0x7c83('0x20')](_0x3d403f[_0x7c83('0x2f')][_0x7c83('0x20')]);}_0x44035a['order']=qs[_0x7c83('0x38')](_0x3d403f[_0x7c83('0x2f')][_0x7c83('0x38')]);_0x44035a[_0x7c83('0x39')]=qs['filters'](_['pick'](_0x3d403f[_0x7c83('0x2f')],_0x5c2fb1[_0x7c83('0x31')]),_0x1ecdf4);if(_0x3d403f[_0x7c83('0x2f')][_0x7c83('0x3a')]){_0x44035a[_0x7c83('0x39')]=_[_0x7c83('0x3b')](_0x44035a[_0x7c83('0x39')],{'$or':_[_0x7c83('0x2e')](_0x1ecdf4,function(_0xaabcc7){if(_0xaabcc7[_0x7c83('0x2d')]!==_0x7c83('0x3c')){var _0xac793b={};_0xac793b[_0xaabcc7[_0x7c83('0x27')]]={'$like':'%'+_0x3d403f[_0x7c83('0x2f')]['filter']+'%'};return _0xac793b;}})});}_0x44035a=_[_0x7c83('0x3b')]({},_0x44035a,_0x3d403f['options']);var _0x5a865f={'where':_0x44035a[_0x7c83('0x39')]};return db[_0x7c83('0x2a')][_0x7c83('0x3d')](_0x5a865f)[_0x7c83('0x24')](function(_0x1b6348){_0x17e36b[_0x7c83('0x3d')]=_0x1b6348;if(_0x3d403f[_0x7c83('0x2f')]['includeAll']){_0x44035a[_0x7c83('0x3e')]=[{'all':!![]}];}return db[_0x7c83('0x2a')][_0x7c83('0x3f')](_0x44035a);})['then'](function(_0x1d8a38){_0x17e36b[_0x7c83('0x40')]=_0x1d8a38;return _0x17e36b;})[_0x7c83('0x24')](respondWithFilteredResult(_0x1f011f,_0x44035a))[_0x7c83('0x41')](handleError(_0x1f011f,null));};exports['show']=function(_0x1737ba,_0x2d8646){var _0x37afe0={'raw':!![],'where':{'id':_0x1737ba[_0x7c83('0x42')]['id']}},_0x5b4695={};_0x5b4695['model']=_[_0x7c83('0x30')](db[_0x7c83('0x2a')][_0x7c83('0x2b')]);_0x5b4695[_0x7c83('0x2f')]=_[_0x7c83('0x30')](_0x1737ba[_0x7c83('0x2f')]);_0x5b4695[_0x7c83('0x31')]=_[_0x7c83('0x33')](_0x5b4695[_0x7c83('0x32')],_0x5b4695[_0x7c83('0x2f')]);_0x37afe0[_0x7c83('0x35')]=_['intersection'](_0x5b4695[_0x7c83('0x32')],qs[_0x7c83('0x34')](_0x1737ba['query'][_0x7c83('0x34')]));_0x37afe0[_0x7c83('0x35')]=_0x37afe0['attributes'][_0x7c83('0x43')]?_0x37afe0['attributes']:_0x5b4695[_0x7c83('0x32')];if(_0x1737ba['query'][_0x7c83('0x44')]){_0x37afe0[_0x7c83('0x3e')]=[{'all':!![]}];}_0x37afe0=_[_0x7c83('0x3b')]({},_0x37afe0,_0x1737ba[_0x7c83('0x45')]);return db[_0x7c83('0x2a')]['find'](_0x37afe0)[_0x7c83('0x24')](handleEntityNotFound(_0x2d8646,null))[_0x7c83('0x24')](respondWithResult(_0x2d8646,null))['catch'](handleError(_0x2d8646,null));};exports[_0x7c83('0x46')]=function(_0x174c22,_0x4d68c8){return db[_0x7c83('0x2a')][_0x7c83('0x46')](_0x174c22[_0x7c83('0x47')],{})[_0x7c83('0x24')](respondWithResult(_0x4d68c8,0xc9))[_0x7c83('0x41')](handleError(_0x4d68c8,null));};exports[_0x7c83('0x48')]=function(_0xa30e1d,_0x486878){if(_0xa30e1d[_0x7c83('0x47')]['id']){delete _0xa30e1d[_0x7c83('0x47')]['id'];}return db[_0x7c83('0x2a')][_0x7c83('0x49')]({'where':{'id':_0xa30e1d[_0x7c83('0x42')]['id']}})['then'](handleEntityNotFound(_0x486878,null))[_0x7c83('0x24')](saveUpdates(_0xa30e1d[_0x7c83('0x47')],null))['then'](respondWithResult(_0x486878,null))[_0x7c83('0x41')](handleError(_0x486878,null));};exports[_0x7c83('0x25')]=function(_0x4ee0e4,_0x2dfc7c){return db[_0x7c83('0x2a')][_0x7c83('0x49')]({'where':{'id':_0x4ee0e4['params']['id']}})[_0x7c83('0x24')](handleEntityNotFound(_0x2dfc7c,null))['then'](removeEntity(_0x2dfc7c,null))['catch'](handleError(_0x2dfc7c,null));};exports[_0x7c83('0x4a')]=function(_0x2c00ff,_0x21d6e7){return db[_0x7c83('0x2a')][_0x7c83('0x4a')]()[_0x7c83('0x24')](respondWithResult(_0x21d6e7,null))[_0x7c83('0x41')](handleError(_0x21d6e7,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 8243ae6..4fcd347 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 _0x1d32=['moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x4fc5aa,_0x3bce70){var _0x8f1cc3=function(_0x1747a9){while(--_0x1747a9){_0x4fc5aa['push'](_0x4fc5aa['shift']());}};_0x8f1cc3(++_0x3bce70);}(_0x1d32,0x171));var _0x21d3=function(_0x122ec8,_0x4ded3e){_0x122ec8=_0x122ec8-0x0;var _0x497939=_0x1d32[_0x122ec8];return _0x497939;};'use strict';var _=require(_0x21d3('0x0'));var util=require(_0x21d3('0x1'));var logger=require(_0x21d3('0x2'))('api');var moment=require(_0x21d3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x21d3('0x4'));var rimraf=require(_0x21d3('0x5'));var config=require(_0x21d3('0x6'));var attributes=require(_0x21d3('0x7'));module['exports']=function(_0x26e443,_0x2ea486){return _0x26e443[_0x21d3('0x8')](_0x21d3('0x9'),attributes,{'tableName':_0x21d3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x21d3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a8c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x522bca,_0x5526f4){var _0x5cc11d=function(_0x13380c){while(--_0x13380c){_0x522bca['push'](_0x522bca['shift']());}};_0x5cc11d(++_0x5526f4);}(_0x6a8c,0x192));var _0xc6a8=function(_0x22886a,_0x17348a){_0x22886a=_0x22886a-0x0;var _0x1d02f8=_0x6a8c[_0x22886a];return _0x1d02f8;};'use strict';var _=require(_0xc6a8('0x0'));var util=require('util');var logger=require(_0xc6a8('0x1'))('api');var moment=require(_0xc6a8('0x2'));var BPromise=require(_0xc6a8('0x3'));var rp=require(_0xc6a8('0x4'));var fs=require('fs');var path=require(_0xc6a8('0x5'));var rimraf=require(_0xc6a8('0x6'));var config=require(_0xc6a8('0x7'));var attributes=require(_0xc6a8('0x8'));module[_0xc6a8('0x9')]=function(_0xca380d,_0x1cea36){return _0xca380d[_0xc6a8('0xa')](_0xc6a8('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc6a8('0xc'),'fields':[_0xc6a8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1b0c7c4..8eaf9f2 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 _0x456f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x456f,0x1ae));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf456('0x0'));var util=require(_0xf456('0x1'));var moment=require(_0xf456('0x2'));var BPromise=require(_0xf456('0x3'));var rs=require(_0xf456('0x4'));var fs=require('fs');var Redis=require(_0xf456('0x5'));var db=require(_0xf456('0x6'))['db'];var utils=require(_0xf456('0x7'));var logger=require('../../config/logger')(_0xf456('0x8'));var config=require(_0xf456('0x9'));var jayson=require(_0xf456('0xa'));var client=jayson[_0xf456('0xb')][_0xf456('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x186572,_0x33e465,_0x4028ca){return new BPromise(function(_0x55d326,_0x59e1ba){return client[_0xf456('0xd')](_0x186572,_0x4028ca)['then'](function(_0x455d75){logger[_0xf456('0xe')](_0xf456('0xf'),_0x33e465,'request\x20sent');logger[_0xf456('0x10')](_0xf456('0x11'),_0x33e465,_0xf456('0x12'),JSON['stringify'](_0x455d75));if(_0x455d75[_0xf456('0x13')]){if(_0x455d75[_0xf456('0x13')][_0xf456('0x14')]===0x1f4){logger[_0xf456('0x13')](_0xf456('0xf'),_0x33e465,_0x455d75[_0xf456('0x13')]['message']);return _0x59e1ba(_0x455d75[_0xf456('0x13')][_0xf456('0x15')]);}logger[_0xf456('0x13')](_0xf456('0xf'),_0x33e465,_0x455d75[_0xf456('0x13')]['message']);return _0x55d326(_0x455d75[_0xf456('0x13')]['message']);}else{logger[_0xf456('0xe')](_0xf456('0xf'),_0x33e465,_0xf456('0x12'));_0x55d326(_0x455d75[_0xf456('0x16')][_0xf456('0x15')]);}})[_0xf456('0x17')](function(_0x5d08b5){logger[_0xf456('0x13')](_0xf456('0xf'),_0x33e465,_0x5d08b5);_0x59e1ba(_0x5d08b5);});});} \ No newline at end of file +var _0xdbf1=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1a36e4,_0x58ebe2){var _0x3e1c61=function(_0x3f7585){while(--_0x3f7585){_0x1a36e4['push'](_0x1a36e4['shift']());}};_0x3e1c61(++_0x58ebe2);}(_0xdbf1,0x1ee));var _0x1dbf=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xdbf1[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x1dbf('0x0'));var util=require(_0x1dbf('0x1'));var moment=require(_0x1dbf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dbf('0x3'))['db'];var utils=require(_0x1dbf('0x4'));var logger=require(_0x1dbf('0x5'))(_0x1dbf('0x6'));var config=require(_0x1dbf('0x7'));var jayson=require(_0x1dbf('0x8'));var client=jayson['client'][_0x1dbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439c26,_0x4c8050,_0xdc99ec){return new BPromise(function(_0x35c75c,_0x167c5d){return client[_0x1dbf('0xa')](_0x439c26,_0xdc99ec)[_0x1dbf('0xb')](function(_0x43f4e0){logger[_0x1dbf('0xc')](_0x1dbf('0xd'),_0x4c8050,_0x1dbf('0xe'));logger['debug'](_0x1dbf('0xf'),_0x4c8050,'request\x20sent',JSON[_0x1dbf('0x10')](_0x43f4e0));if(_0x43f4e0[_0x1dbf('0x11')]){if(_0x43f4e0[_0x1dbf('0x11')][_0x1dbf('0x12')]===0x1f4){logger[_0x1dbf('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4c8050,_0x43f4e0[_0x1dbf('0x11')]['message']);return _0x167c5d(_0x43f4e0[_0x1dbf('0x11')][_0x1dbf('0x13')]);}logger[_0x1dbf('0x11')](_0x1dbf('0xd'),_0x4c8050,_0x43f4e0[_0x1dbf('0x11')]['message']);return _0x35c75c(_0x43f4e0[_0x1dbf('0x11')][_0x1dbf('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4c8050,'request\x20sent');_0x35c75c(_0x43f4e0[_0x1dbf('0x14')][_0x1dbf('0x13')]);}})[_0x1dbf('0x15')](function(_0x553bae){logger['error'](_0x1dbf('0xd'),_0x4c8050,_0x553bae);_0x167c5d(_0x553bae);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index bba8337..5a3205e 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 _0xa802=['index','/describe','describe','/:id','show','post','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3ce91,_0x12ac8b){var _0x533347=function(_0x1134be){while(--_0x1134be){_0x3ce91['push'](_0x3ce91['shift']());}};_0x533347(++_0x12ac8b);}(_0xa802,0xbd));var _0x2a80=function(_0x529517,_0x558b26){_0x529517=_0x529517-0x0;var _0x2eb5ab=_0xa802[_0x529517];return _0x2eb5ab;};'use strict';var multer=require(_0x2a80('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a80('0x1'));var express=require(_0x2a80('0x2'));var router=express[_0x2a80('0x3')]();var fs_extra=require(_0x2a80('0x4'));var auth=require(_0x2a80('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a80('0x6'));router[_0x2a80('0x7')]('/',auth[_0x2a80('0x8')](),controller[_0x2a80('0x9')]);router[_0x2a80('0x7')](_0x2a80('0xa'),auth['isAuthenticated'](),controller[_0x2a80('0xb')]);router[_0x2a80('0x7')](_0x2a80('0xc'),auth[_0x2a80('0x8')](),controller[_0x2a80('0xd')]);router[_0x2a80('0xe')]('/',auth[_0x2a80('0x8')](),controller['create']);router['put'](_0x2a80('0xc'),auth[_0x2a80('0x8')](),controller[_0x2a80('0xf')]);router[_0x2a80('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2a80('0x11')]=router; \ No newline at end of file +var _0x4196=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','describe','get','/:id','show','post'];(function(_0x3a9707,_0x3d19c8){var _0x2fb6aa=function(_0x51947b){while(--_0x51947b){_0x3a9707['push'](_0x3a9707['shift']());}};_0x2fb6aa(++_0x3d19c8);}(_0x4196,0xb6));var _0x6419=function(_0x2a90a6,_0x4967d4){_0x2a90a6=_0x2a90a6-0x0;var _0x3422cf=_0x4196[_0x2a90a6];return _0x3422cf;};'use strict';var multer=require(_0x6419('0x0'));var util=require(_0x6419('0x1'));var path=require('path');var timeout=require(_0x6419('0x2'));var express=require(_0x6419('0x3'));var router=express[_0x6419('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6419('0x5'));var interaction=require(_0x6419('0x6'));var config=require(_0x6419('0x7'));var controller=require(_0x6419('0x8'));router['get']('/',auth[_0x6419('0x9')](),controller[_0x6419('0xa')]);router['get']('/describe',auth[_0x6419('0x9')](),controller[_0x6419('0xb')]);router[_0x6419('0xc')](_0x6419('0xd'),auth[_0x6419('0x9')](),controller[_0x6419('0xe')]);router[_0x6419('0xf')]('/',auth['isAuthenticated'](),controller[_0x6419('0x10')]);router[_0x6419('0x11')](_0x6419('0xd'),auth[_0x6419('0x9')](),controller[_0x6419('0x12')]);router[_0x6419('0x13')](_0x6419('0xd'),auth['isAuthenticated'](),controller[_0x6419('0x14')]);module[_0x6419('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index db77375..d471d5a 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 _0x558a=['INTEGER','BOOLEAN','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','email','Agent','#ffffff'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0x558a,0xdb));var _0xa558=function(_0x79641f,_0x162891){_0x79641f=_0x79641f-0x0;var _0x2284fd=_0x558a[_0x79641f];return _0x2284fd;};'use strict';var Sequelize=require(_0xa558('0x0'));var rs=require(_0xa558('0x1'));module['exports']={'name':{'type':Sequelize[_0xa558('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x3')},'key':{'type':Sequelize[_0xa558('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x4')},'customerAlias':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa558('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa558('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa558('0x2')]},'animation':{'type':Sequelize[_0xa558('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xa558('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x9')},'start_chat_button':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0xa')},'offline_chat_button':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0xb')},'download_transcript':{'type':Sequelize[_0xa558('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa558('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xa558('0xc')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa558('0xd')]},'closingQuestion':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0xf')},'noteTitle':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x10')},'placeholderMessage':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x11')},'closingMessage':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x12')},'closingMessageButton':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa558('0x13')},'conditionAgreement':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0xa558('0x15'),_0xa558('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa558('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa558('0xd')],'defaultValue':function(){return JSON[_0xa558('0x17')]({'items':[{'type':_0xa558('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xa558('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa558('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa558('0x3'),'type':_0xa558('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa558('0x1a')](_0xa558('0x1b'))?JSON[_0xa558('0x1c')](this[_0xa558('0x1a')](_0xa558('0x1b'))):{};},'set':function(_0x51ad4a){return this[_0xa558('0x1d')](_0xa558('0x1b'),JSON['stringify'](_0x51ad4a));}},'offlineForm':{'type':Sequelize[_0xa558('0xd')],'defaultValue':function(){return JSON[_0xa558('0x17')]({'items':[{'type':_0xa558('0x18'),'props':{'title':_0xa558('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa558('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa558('0x1e')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xa558('0x1a')](_0xa558('0x1f'))?JSON['parse'](this[_0xa558('0x1a')](_0xa558('0x1f'))):{};},'set':function(_0x5d8dba){return this[_0xa558('0x1d')](_0xa558('0x1f'),JSON[_0xa558('0x17')](_0x5d8dba));}},'token':{'type':Sequelize[_0xa558('0x2')],'defaultValue':function(){return rs[_0xa558('0x20')]();}},'autoclose':{'type':Sequelize[_0xa558('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa558('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa558('0x2')]},'waitingTitle':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xa558('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa558('0x23')},'skipUnmanaged':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x13')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa558('0xd')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa558('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa558('0x24');}},'notificationSound':{'type':Sequelize[_0xa558('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa558('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xa558('0x26')},'verticalAlignment':{'type':Sequelize[_0xa558('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa558('0x2')],'defaultValue':_0xa558('0x27')},'defaultTitle':{'type':Sequelize[_0xa558('0x2')]},'customerAvatar':{'type':Sequelize[_0xa558('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa558('0x2')],'allowNull':![],'defaultValue':_0xa558('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa558('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa558('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa558('0x6')],'comment':_0xa558('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![],'comment':_0xa558('0x2a'),'set':function(_0x4af9d4){if(!_0x4af9d4)this[_0xa558('0x1d')](_0xa558('0x2b'),null);this[_0xa558('0x1d')](_0xa558('0x2c'),_0x4af9d4);}},'vidaooEscalation':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa558('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa558('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xa558('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa558('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa558('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa558('0xd')]}}; \ No newline at end of file +var _0xeee8=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','name','input','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0xeee8,0x12c));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8eee('0x0'));var rs=require(_0x8eee('0x1'));module[_0x8eee('0x2')]={'name':{'type':Sequelize[_0x8eee('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8eee('0x4')},'description':{'type':Sequelize[_0x8eee('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x5')},'key':{'type':Sequelize[_0x8eee('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8eee('0x3')],'allowNull':![],'defaultValue':_0x8eee('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eee('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8eee('0x3')],'allowNull':![],'defaultValue':_0x8eee('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8eee('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8eee('0x9'),_0x8eee('0xa')),'defaultValue':_0x8eee('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0xb')},'start_chat_button':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0xc')},'header_offline':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8eee('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8eee('0xf')]},'closingQuestion':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0x12')},'placeholderMessage':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x13')},'closingMessage':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x14')},'closingMessageButton':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x15')},'conditionAgreement':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x16')},'ratingType':{'type':Sequelize[_0x8eee('0x17')](_0x8eee('0x18'),'thumb'),'defaultValue':_0x8eee('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x8eee('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8eee('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x8eee('0x19'),'type':'text','required':!![]},'props':{'title':_0x8eee('0x19'),'helpText':''}},{'type':_0x8eee('0x1a'),'props':{'title':_0x8eee('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8eee('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8eee('0x1b')](_0x8eee('0x1c'))?JSON['parse'](this['getDataValue'](_0x8eee('0x1c'))):{};},'set':function(_0xe0e1c1){return this['setDataValue']('onlineForm',JSON['stringify'](_0xe0e1c1));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8eee('0x1a'),'props':{'title':_0x8eee('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8eee('0x5'),'type':_0x8eee('0x5')},'variable':null},{'type':_0x8eee('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0x8eee('0x1e'),'helpText':_0x8eee('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x8eee('0x1b')]('offlineForm')?JSON['parse'](this[_0x8eee('0x1b')](_0x8eee('0x20'))):{};},'set':function(_0xd6d970){return this[_0x8eee('0x21')](_0x8eee('0x20'),JSON['stringify'](_0xd6d970));}},'token':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':function(){return rs[_0x8eee('0x22')]();}},'autoclose':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8eee('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8eee('0x3')]},'waitingTitle':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x23')},'waitingMessage':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8eee('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8eee('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8eee('0x26');}},'notificationSound':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x8eee('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8eee('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x28')},'verticalAlignment':{'type':Sequelize[_0x8eee('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':_0x8eee('0x29')},'defaultTitle':{'type':Sequelize[_0x8eee('0x3')]},'customerAvatar':{'type':Sequelize[_0x8eee('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8eee('0x3')],'allowNull':![],'defaultValue':_0x8eee('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8eee('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x8eee('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8eee('0x8')],'comment':_0x8eee('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![],'comment':_0x8eee('0x2c'),'set':function(_0x4da154){if(!_0x4da154)this[_0x8eee('0x21')]('mandatoryDispositionPauseId',null);this[_0x8eee('0x21')](_0x8eee('0x2d'),_0x4da154);}},'vidaooEscalation':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8eee('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eee('0x2e')},'vidaooNote':{'type':Sequelize[_0x8eee('0x3')],'defaultValue':function(){return _0x8eee('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x8eee('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8eee('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8eee('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index dc7c314..7304b15 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 _0x339d=['params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','notify','user-agent-parser','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','list','applications','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','ListId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','server','files','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','Owner','internal','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','connection','verticalAlignment','textColor','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','limit','undefined','count','offset','Content-Range','json','apply','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x67edba,_0xbcd3ff){var _0x1948e7=function(_0x44d22a){while(--_0x44d22a){_0x67edba['push'](_0x67edba['shift']());}};_0x1948e7(++_0xbcd3ff);}(_0x339d,0xd2));var _0xd339=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x339d[_0x556927];return _0x5f1235;};'use strict';var emlformat=require(_0xd339('0x0'));var rimraf=require(_0xd339('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd339('0x2'));var rp=require('request-promise');var moment=require(_0xd339('0x3'));var BPromise=require(_0xd339('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd339('0x5'));var csv=require('to-csv');var ejs=require(_0xd339('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd339('0x7'));var squel=require(_0xd339('0x8'));var crypto=require(_0xd339('0x9'));var jsforce=require(_0xd339('0xa'));var deskjs=require(_0xd339('0xb'));var toCsv=require(_0xd339('0xc'));var querystring=require(_0xd339('0xd'));var Papa=require(_0xd339('0xe'));var Redis=require(_0xd339('0xf'));var authService=require(_0xd339('0x10'));var qs=require(_0xd339('0x11'));var as=require(_0xd339('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd339('0x13'));var utils=require(_0xd339('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd339('0x15'));var db=require(_0xd339('0x16'))['db'];config[_0xd339('0x17')]=_[_0xd339('0x18')](config['redis'],{'host':_0xd339('0x19'),'port':0x18eb});var socket=require(_0xd339('0x1a'))(new Redis(config[_0xd339('0x17')]));require(_0xd339('0x1b'))[_0xd339('0x1c')](socket);var jayson=require(_0xd339('0x1d'));var client=jayson['client'][_0xd339('0x1e')]({'port':0x232c});var client9002=jayson[_0xd339('0x1f')][_0xd339('0x1e')]({'port':0x232a});var client9003=jayson['client'][_0xd339('0x1e')]({'port':0x232b});var client9001=jayson[_0xd339('0x1f')][_0xd339('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x568c82,_0x243a54,_0x3818ca,_0x52598a){return new BPromise(function(_0x1d3967,_0x408750){var _0x27cf55=_0x52598a||client;return _0x27cf55['request'](_0x568c82,_0x3818ca)['then'](function(_0x57d27f){logger[_0xd339('0x20')](_0xd339('0x21'),_0x243a54,_0xd339('0x22'));logger[_0xd339('0x23')](_0xd339('0x24'),_0x243a54,_0xd339('0x22'),JSON[_0xd339('0x25')](_0x57d27f));if(_0x57d27f[_0xd339('0x26')]){if(_0x57d27f['error'][_0xd339('0x27')]===0x1f4){logger['error'](_0xd339('0x21'),_0x243a54,_0x57d27f[_0xd339('0x26')][_0xd339('0x28')]);return _0x408750(_0x57d27f[_0xd339('0x26')]['message']);}logger[_0xd339('0x26')](_0xd339('0x21'),_0x243a54,_0x57d27f[_0xd339('0x26')]['message']);return _0x1d3967(_0x57d27f[_0xd339('0x26')]['message']);}else{logger['info'](_0xd339('0x21'),_0x243a54,_0xd339('0x22'));_0x1d3967(_0x57d27f[_0xd339('0x29')]['message']);}})[_0xd339('0x2a')](function(_0x1bfa9a){logger[_0xd339('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x243a54,_0x1bfa9a);_0x408750(_0x1bfa9a);});});}function respondWithStatusCode(_0x5d24f5,_0x4d32db){_0x4d32db=_0x4d32db||0xcc;return function(_0x25e490){if(_0x25e490){return _0x5d24f5['sendStatus'](_0x4d32db);}return _0x5d24f5[_0xd339('0x2b')](_0x4d32db)['end']();};}function respondWithResult(_0x5a85c2,_0x313c20){_0x313c20=_0x313c20||0xc8;return function(_0x43e9e4){if(_0x43e9e4){return _0x5a85c2[_0xd339('0x2b')](_0x313c20)['json'](_0x43e9e4);}};}function respondWithFilteredResult(_0x4fbf5e,_0xac3b99){return function(_0x50b0ea){if(_0x50b0ea){var _0x3bbe20=typeof _0xac3b99['offset']==='undefined'&&typeof _0xac3b99[_0xd339('0x2c')]===_0xd339('0x2d');var _0x421a61=_0x50b0ea[_0xd339('0x2e')];var _0x56a8bb=_0x3bbe20?0x0:_0xac3b99[_0xd339('0x2f')];var _0x21d197=_0x3bbe20?_0x50b0ea[_0xd339('0x2e')]:_0xac3b99['offset']+_0xac3b99[_0xd339('0x2c')];var _0x4d6408;if(_0x21d197>=_0x421a61){_0x21d197=_0x421a61;_0x4d6408=0xc8;}else{_0x4d6408=0xce;}_0x4fbf5e[_0xd339('0x2b')](_0x4d6408);return _0x4fbf5e['set'](_0xd339('0x30'),_0x56a8bb+'-'+_0x21d197+'/'+_0x421a61)[_0xd339('0x31')](_0x50b0ea);}return null;};}function patchUpdates(_0xa1bf48){return function(_0x5b582a){try{jsonpatch[_0xd339('0x32')](_0x5b582a,_0xa1bf48,!![]);}catch(_0x4866f0){return BPromise['reject'](_0x4866f0);}return _0x5b582a[_0xd339('0x33')]();};}function saveUpdates(_0x2ab188,_0x3ff281){return function(_0x4c4964){if(_0x4c4964){return _0x4c4964[_0xd339('0x34')](_0x2ab188)[_0xd339('0x35')](function(_0xffee99){return _0xffee99;});}return null;};}function removeEntity(_0x9d6800,_0x12ff02){return function(_0x3267fa){if(_0x3267fa){return _0x3267fa[_0xd339('0x36')]()['then'](function(){var _0x246273=_0x3267fa[_0xd339('0x37')]({'plain':!![]});var _0x4aec18=_0xd339('0x38');return db[_0xd339('0x39')][_0xd339('0x36')]({'where':{'type':_0x4aec18,'resourceId':_0x246273['id']}})[_0xd339('0x35')](function(){return _0x3267fa;});})['then'](function(){_0x9d6800[_0xd339('0x2b')](0xcc)[_0xd339('0x3a')]();});}};}function handleEntityNotFound(_0x2b555a,_0x2112a8){return function(_0x4dd718){if(!_0x4dd718){_0x2b555a['sendStatus'](0x194);}return _0x4dd718;};}function handleError(_0xc374c9,_0x135b01){_0x135b01=_0x135b01||0x1f4;return function(_0x4500c2){logger[_0xd339('0x26')](_0x4500c2['stack']);if(_0x4500c2[_0xd339('0x3b')]){delete _0x4500c2[_0xd339('0x3b')];}_0xc374c9[_0xd339('0x2b')](_0x135b01)[_0xd339('0x3c')](_0x4500c2);};}exports['index']=function(_0x589af9,_0x50295a){var _0x178148={'include':[{'model':db[_0xd339('0x3d')],'as':_0xd339('0x3e')}]},_0x4e9439={},_0x3bee7e={'count':0x0,'rows':[]};var _0x150752=_[_0xd339('0x3f')](db[_0xd339('0x40')][_0xd339('0x41')],function(_0x1d292b){return{'name':_0x1d292b[_0xd339('0x42')],'type':_0x1d292b[_0xd339('0x43')][_0xd339('0x44')]};});_0x4e9439['model']=_['map'](_0x150752,_0xd339('0x3b'));_0x4e9439[_0xd339('0x45')]=_[_0xd339('0x46')](_0x589af9[_0xd339('0x45')]);_0x4e9439['filters']=_[_0xd339('0x47')](_0x4e9439[_0xd339('0x48')],_0x4e9439[_0xd339('0x45')]);_0x178148[_0xd339('0x49')]=_[_0xd339('0x47')](_0x4e9439[_0xd339('0x48')],qs['fields'](_0x589af9[_0xd339('0x45')]['fields']));_0x178148[_0xd339('0x49')]=_0x178148[_0xd339('0x49')][_0xd339('0x4a')]?_0x178148[_0xd339('0x49')]:_0x4e9439['model'];if(!_0x589af9[_0xd339('0x45')]['hasOwnProperty'](_0xd339('0x4b'))){_0x178148[_0xd339('0x2c')]=qs[_0xd339('0x2c')](_0x589af9[_0xd339('0x45')][_0xd339('0x2c')]);_0x178148[_0xd339('0x2f')]=qs[_0xd339('0x2f')](_0x589af9[_0xd339('0x45')][_0xd339('0x2f')]);}_0x178148[_0xd339('0x4c')]=qs[_0xd339('0x4d')](_0x589af9[_0xd339('0x45')][_0xd339('0x4d')]);_0x178148['where']=qs['filters'](_[_0xd339('0x4e')](_0x589af9[_0xd339('0x45')],_0x4e9439[_0xd339('0x4f')]),_0x150752);if(_0x589af9['query'][_0xd339('0x50')]){_0x178148[_0xd339('0x51')]=_[_0xd339('0x52')](_0x178148[_0xd339('0x51')],{'$or':_[_0xd339('0x3f')](_0x150752,function(_0x131cb6){if(_0x131cb6['type']!==_0xd339('0x53')){var _0x4c9f07={};_0x4c9f07[_0x131cb6[_0xd339('0x3b')]]={'$like':'%'+_0x589af9[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x4c9f07;}})});}_0x178148=_[_0xd339('0x52')]({},_0x178148,_0x589af9[_0xd339('0x54')]);var _0x3e948a={'where':_0x178148['where']};return db[_0xd339('0x40')][_0xd339('0x2e')](_0x3e948a)[_0xd339('0x35')](function(_0x49e828){_0x3bee7e[_0xd339('0x2e')]=_0x49e828;if(_0x589af9[_0xd339('0x45')][_0xd339('0x55')]){_0x178148[_0xd339('0x56')]=[{'all':!![]}];}return db[_0xd339('0x40')][_0xd339('0x57')](_0x178148);})[_0xd339('0x35')](function(_0x2ca1f9){_0x3bee7e[_0xd339('0x58')]=_0x2ca1f9;return _0x3bee7e;})[_0xd339('0x35')](respondWithFilteredResult(_0x50295a,_0x178148))[_0xd339('0x2a')](handleError(_0x50295a,null));};exports[_0xd339('0x59')]=function(_0x28a96c,_0x17aac7){var _0x16d561={'raw':![],'where':{'id':_0x28a96c[_0xd339('0x5a')]['id']},'include':[{'model':db[_0xd339('0x3d')],'as':'mandatoryDispositionPause'}]},_0x12f217={};_0x12f217[_0xd339('0x48')]=_[_0xd339('0x46')](db[_0xd339('0x40')][_0xd339('0x41')]);_0x12f217[_0xd339('0x45')]=_[_0xd339('0x46')](_0x28a96c[_0xd339('0x45')]);_0x12f217[_0xd339('0x4f')]=_[_0xd339('0x47')](_0x12f217['model'],_0x12f217['query']);_0x16d561[_0xd339('0x49')]=_[_0xd339('0x47')](_0x12f217[_0xd339('0x48')],qs[_0xd339('0x5b')](_0x28a96c['query'][_0xd339('0x5b')]));_0x16d561[_0xd339('0x49')]=_0x16d561[_0xd339('0x49')]['length']?_0x16d561[_0xd339('0x49')]:_0x12f217[_0xd339('0x48')];if(_0x28a96c[_0xd339('0x45')]['includeAll']){_0x16d561[_0xd339('0x56')]=[{'all':!![]}];}_0x16d561=_[_0xd339('0x52')]({},_0x16d561,_0x28a96c['options']);return db['ChatWebsite'][_0xd339('0x5c')](_0x16d561)[_0xd339('0x35')](handleEntityNotFound(_0x17aac7,null))[_0xd339('0x35')](respondWithResult(_0x17aac7,null))[_0xd339('0x2a')](handleError(_0x17aac7,null));};exports[_0xd339('0x5d')]=function(_0x1e5d0c,_0x11af53){return db[_0xd339('0x40')][_0xd339('0x5d')](_0x1e5d0c['body'],{})['then'](function(_0x1caf5e){var _0x226cdb=_0x1e5d0c[_0xd339('0x5e')]['get']({'plain':!![]});if(!_0x226cdb)throw new Error(_0xd339('0x5f'));if(_0x226cdb['role']===_0xd339('0x5e')){var _0x4cf795=_0x1caf5e[_0xd339('0x37')]({'plain':!![]});var _0x175874='ChatWebsites';return db[_0xd339('0x60')][_0xd339('0x5c')]({'where':{'name':_0x175874,'userProfileId':_0x226cdb['userProfileId']},'raw':!![]})[_0xd339('0x35')](function(_0xc12008){if(_0xc12008&&_0xc12008[_0xd339('0x61')]===0x0){return db[_0xd339('0x39')]['create']({'name':_0x4cf795[_0xd339('0x3b')],'resourceId':_0x4cf795['id'],'type':_0xc12008[_0xd339('0x3b')],'sectionId':_0xc12008['id']},{})['then'](function(){return _0x1caf5e;});}else{return _0x1caf5e;}})[_0xd339('0x2a')](function(_0xce619d){logger[_0xd339('0x26')](_0xd339('0x62'),_0xce619d);throw _0xce619d;});}return _0x1caf5e;})['then'](respondWithResult(_0x11af53,0xc9))[_0xd339('0x2a')](handleError(_0x11af53,null));};exports[_0xd339('0x34')]=function(_0x3eabd2,_0x33c8dc){if(_0x3eabd2[_0xd339('0x63')]['id']){delete _0x3eabd2[_0xd339('0x63')]['id'];}return db[_0xd339('0x40')]['find']({'where':{'id':_0x3eabd2[_0xd339('0x5a')]['id']},'include':[{'model':db[_0xd339('0x3d')],'as':_0xd339('0x3e')}]})[_0xd339('0x35')](handleEntityNotFound(_0x33c8dc,null))[_0xd339('0x35')](saveUpdates(_0x3eabd2['body'],null))[_0xd339('0x35')](respondWithResult(_0x33c8dc,null))[_0xd339('0x2a')](handleError(_0x33c8dc,null));};exports[_0xd339('0x36')]=function(_0x2a06b5,_0x44e354){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x2a06b5[_0xd339('0x5a')]['id']}})['then'](handleEntityNotFound(_0x44e354,null))[_0xd339('0x35')](removeEntity(_0x44e354,null))[_0xd339('0x2a')](handleError(_0x44e354,null));};exports[_0xd339('0x64')]=function(_0x31010b,_0x4ceafa){return db['ChatWebsite'][_0xd339('0x64')]()[_0xd339('0x35')](respondWithResult(_0x4ceafa,null))[_0xd339('0x2a')](handleError(_0x4ceafa,null));};exports['addDisposition']=function(_0x3d6739,_0x5e1730,_0x3aac77){if(_0x3d6739[_0xd339('0x63')]['id']){delete _0x3d6739[_0xd339('0x63')]['id'];}return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x3d6739[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x5e1730,null))[_0xd339('0x35')](function(_0x5437c2){if(_0x5437c2){_0x3d6739['body'][_0xd339('0x65')]=_0x5437c2['id'];return db['Disposition'][_0xd339('0x5d')](_0x3d6739[_0xd339('0x63')]);}})[_0xd339('0x35')](respondWithResult(_0x5e1730,null))[_0xd339('0x2a')](handleError(_0x5e1730,null));};exports['getDispositions']=function(_0xd29788,_0x2634e2,_0x49908b){var _0x41c60c={'raw':![],'where':{}};var _0x59df41={};var _0x103a7b={'count':0x0,'rows':[]};return db[_0xd339('0x40')]['findOne']({'where':{'id':_0xd29788[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x2634e2,null))['then'](function(_0x212ef3){if(_0x212ef3){_0x59df41['model']=_['keys'](db[_0xd339('0x66')][_0xd339('0x41')]);_0x59df41[_0xd339('0x45')]=_[_0xd339('0x46')](_0xd29788[_0xd339('0x45')]);_0x59df41[_0xd339('0x4f')]=_[_0xd339('0x47')](_0x59df41[_0xd339('0x48')],_0x59df41[_0xd339('0x45')]);_0x41c60c[_0xd339('0x49')]=_[_0xd339('0x47')](_0x59df41[_0xd339('0x48')],qs['fields'](_0xd29788[_0xd339('0x45')]['fields']));_0x41c60c[_0xd339('0x49')]=_0x41c60c['attributes'][_0xd339('0x4a')]?_0x41c60c[_0xd339('0x49')]:_0x59df41['model'];if(!_0xd29788[_0xd339('0x45')][_0xd339('0x67')](_0xd339('0x4b'))){_0x41c60c['limit']=qs[_0xd339('0x2c')](_0xd29788['query']['limit']);_0x41c60c[_0xd339('0x2f')]=qs['offset'](_0xd29788[_0xd339('0x45')][_0xd339('0x2f')]);}_0x41c60c['order']=qs[_0xd339('0x4d')](_0xd29788[_0xd339('0x45')]['sort']);_0x41c60c[_0xd339('0x51')]=qs[_0xd339('0x4f')](_[_0xd339('0x4e')](_0xd29788['query'],_0x59df41[_0xd339('0x4f')]));_0x41c60c[_0xd339('0x51')]['ChatWebsiteId']=_0x212ef3['id'];if(_0xd29788['query'][_0xd339('0x50')]){_0x41c60c[_0xd339('0x51')]=_[_0xd339('0x52')](_0x41c60c[_0xd339('0x51')],{'$or':_[_0xd339('0x3f')](_0x41c60c[_0xd339('0x49')],function(_0x226f38){var _0x5b489f={};_0x5b489f[_0x226f38]={'$like':'%'+_0xd29788[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x5b489f;})});}_0x41c60c=_[_0xd339('0x52')]({},_0x41c60c,_0xd29788['options']);return db[_0xd339('0x66')][_0xd339('0x2e')]({'where':_0x41c60c[_0xd339('0x51')]})['then'](function(_0x1d7c62){_0x103a7b[_0xd339('0x2e')]=_0x1d7c62;if(_0xd29788[_0xd339('0x45')]['includeAll']){_0x41c60c['include']=[{'all':!![]}];}return db['Disposition'][_0xd339('0x57')](_0x41c60c);})[_0xd339('0x35')](function(_0x52eac6){_0x103a7b[_0xd339('0x58')]=_0x52eac6;return _0x103a7b;});}})['then'](respondWithFilteredResult(_0x2634e2,_0x41c60c))['catch'](handleError(_0x2634e2,null));};exports[_0xd339('0x68')]=function(_0xf332b7,_0x3be498,_0x518ddc){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0xf332b7['params']['id']}})['then'](handleEntityNotFound(_0x3be498,null))[_0xd339('0x35')](function(_0xd88cbf){if(_0xd88cbf){return _0xd88cbf[_0xd339('0x68')](_0xf332b7[_0xd339('0x45')][_0xd339('0x69')]);}})['then'](respondWithStatusCode(_0x3be498,null))[_0xd339('0x2a')](handleError(_0x3be498,null));};exports[_0xd339('0x6a')]=function(_0x4a0415,_0xcfea41,_0x50f1fe){if(_0x4a0415[_0xd339('0x63')]['id']){delete _0x4a0415['body']['id'];}return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x4a0415[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0xcfea41,null))[_0xd339('0x35')](function(_0x3350ad){if(_0x3350ad){_0x4a0415[_0xd339('0x63')][_0xd339('0x65')]=_0x3350ad['id'];return db[_0xd339('0x6b')][_0xd339('0x5d')](_0x4a0415[_0xd339('0x63')]);}})[_0xd339('0x35')](respondWithResult(_0xcfea41,null))[_0xd339('0x2a')](handleError(_0xcfea41,null));};exports[_0xd339('0x6c')]=function(_0x59d79c,_0x2ab5b0,_0x37a1f3){var _0x2cfbd5={'raw':![],'where':{}};var _0x3d4cc5={};var _0x1894fc={'count':0x0,'rows':[]};return db[_0xd339('0x40')][_0xd339('0x6d')]({'where':{'id':_0x59d79c[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x2ab5b0,null))['then'](function(_0x32b1af){if(_0x32b1af){_0x3d4cc5[_0xd339('0x48')]=_['keys'](db[_0xd339('0x6b')][_0xd339('0x41')]);_0x3d4cc5[_0xd339('0x45')]=_[_0xd339('0x46')](_0x59d79c[_0xd339('0x45')]);_0x3d4cc5['filters']=_[_0xd339('0x47')](_0x3d4cc5[_0xd339('0x48')],_0x3d4cc5[_0xd339('0x45')]);_0x2cfbd5[_0xd339('0x49')]=_[_0xd339('0x47')](_0x3d4cc5[_0xd339('0x48')],qs[_0xd339('0x5b')](_0x59d79c[_0xd339('0x45')][_0xd339('0x5b')]));_0x2cfbd5[_0xd339('0x49')]=_0x2cfbd5[_0xd339('0x49')][_0xd339('0x4a')]?_0x2cfbd5[_0xd339('0x49')]:_0x3d4cc5[_0xd339('0x48')];if(!_0x59d79c[_0xd339('0x45')][_0xd339('0x67')](_0xd339('0x4b'))){_0x2cfbd5[_0xd339('0x2c')]=qs[_0xd339('0x2c')](_0x59d79c[_0xd339('0x45')]['limit']);_0x2cfbd5[_0xd339('0x2f')]=qs[_0xd339('0x2f')](_0x59d79c[_0xd339('0x45')]['offset']);}_0x2cfbd5[_0xd339('0x4c')]=qs['sort'](_0x59d79c[_0xd339('0x45')][_0xd339('0x4d')]);_0x2cfbd5[_0xd339('0x51')]=qs['filters'](_['pick'](_0x59d79c['query'],_0x3d4cc5[_0xd339('0x4f')]));_0x2cfbd5[_0xd339('0x51')]['ChatWebsiteId']=_0x32b1af['id'];if(_0x59d79c[_0xd339('0x45')]['filter']){_0x2cfbd5[_0xd339('0x51')]=_['merge'](_0x2cfbd5['where'],{'$or':_['map'](_0x2cfbd5[_0xd339('0x49')],function(_0x59371c){var _0x1217af={};_0x1217af[_0x59371c]={'$like':'%'+_0x59d79c[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x1217af;})});}_0x2cfbd5=_['merge']({},_0x2cfbd5,_0x59d79c[_0xd339('0x54')]);return db['CannedAnswer'][_0xd339('0x2e')]({'where':_0x2cfbd5['where']})[_0xd339('0x35')](function(_0x51a06a){_0x1894fc[_0xd339('0x2e')]=_0x51a06a;if(_0x59d79c[_0xd339('0x45')]['includeAll']){_0x2cfbd5[_0xd339('0x56')]=[{'all':!![]}];}return db[_0xd339('0x6b')][_0xd339('0x57')](_0x2cfbd5);})[_0xd339('0x35')](function(_0x100a48){_0x1894fc[_0xd339('0x58')]=_0x100a48;return _0x1894fc;});}})[_0xd339('0x35')](respondWithFilteredResult(_0x2ab5b0,_0x2cfbd5))[_0xd339('0x2a')](handleError(_0x2ab5b0,null));};exports[_0xd339('0x6e')]=function(_0x5b57f1,_0x54edf2,_0x1427f1){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x5b57f1[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x54edf2,null))['then'](function(_0x4408c7){if(_0x4408c7){return _0x4408c7[_0xd339('0x6e')](_0x5b57f1['query'][_0xd339('0x69')]);}})[_0xd339('0x35')](respondWithStatusCode(_0x54edf2,null))['catch'](handleError(_0x54edf2,null));};exports['addLogo']=function(_0x28e59c,_0x375ecf,_0x10f038){_0x28e59c[_0xd339('0x63')][_0xd339('0x6f')]=_0x28e59c[_0xd339('0x70')]['filename'];return db['ChatWebsite'][_0xd339('0x5c')]({'where':{'id':_0x28e59c[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x375ecf,null))['then'](saveUpdates(_0x28e59c[_0xd339('0x63')],null))['then'](respondWithResult(_0x375ecf,null))['catch'](handleError(_0x375ecf,null));};exports[_0xd339('0x71')]=function(_0x5cf642,_0x403466,_0x2617fc){_0x5cf642['body'][_0xd339('0x72')]=_0x5cf642[_0xd339('0x70')][_0xd339('0x73')];return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x5cf642[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x403466,null))[_0xd339('0x35')](saveUpdates(_0x5cf642[_0xd339('0x63')],null))[_0xd339('0x35')](respondWithResult(_0x403466,null))[_0xd339('0x2a')](handleError(_0x403466,null));};exports[_0xd339('0x74')]=function(_0x3f4af3,_0x2324a3,_0x39264a){_0x3f4af3[_0xd339('0x63')]['customerAvatar']=_0x3f4af3['file'][_0xd339('0x73')];return db['ChatWebsite'][_0xd339('0x5c')]({'where':{'id':_0x3f4af3[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x2324a3,null))[_0xd339('0x35')](saveUpdates(_0x3f4af3['body'],null))['then'](respondWithResult(_0x2324a3,null))[_0xd339('0x2a')](handleError(_0x2324a3,null));};exports[_0xd339('0x75')]=function(_0x16fe18,_0x3fd457,_0x40e8c9){_0x16fe18[_0xd339('0x63')][_0xd339('0x76')]=_0x16fe18[_0xd339('0x70')][_0xd339('0x73')];return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x16fe18[_0xd339('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3fd457,null))[_0xd339('0x35')](saveUpdates(_0x16fe18[_0xd339('0x63')],null))[_0xd339('0x35')](respondWithResult(_0x3fd457,null))['catch'](handleError(_0x3fd457,null));};exports[_0xd339('0x77')]=function(_0x49436b,_0x381596,_0x32cfb3){var _0x5f3974=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x7a'));var _0x35f4da={'where':{'id':_0x49436b[_0xd339('0x5a')]['id']},'attributes':['id',_0xd339('0x6f')],'raw':!![]};var _0xf25b2e=![];return require(_0xd339('0x15'))[_0xd339('0x7b')]()[_0xd339('0x35')](function(_0x161edb){if(_0x161edb){_0xf25b2e=_0x161edb['custom'];}})[_0xd339('0x35')](function(){return db[_0xd339('0x40')][_0xd339('0x5c')](_0x35f4da);})['then'](handleEntityNotFound(_0x381596,null))['then'](function(_0xd8a8d7){if(_0xd8a8d7){if(!_[_0xd339('0x7c')](_0xd8a8d7['sitepic'])){if(fs['existsSync'](path['join'](config[_0xd339('0x79')],_0xd339('0x7d'),_0xd8a8d7['sitepic']))&&_0xf25b2e){_0x5f3974=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x7d'),_0xd8a8d7[_0xd339('0x6f')]);}}return _0x381596[_0xd339('0x7e')](_0x5f3974);}})[_0xd339('0x2a')](handleError(_0x381596,null));};exports[_0xd339('0x7f')]=function(_0x1c1c41,_0x48b0b0,_0x34e731){var _0x5583f0=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x80'));var _0x29044f={'where':{'id':_0x1c1c41['params']['id']},'attributes':['id',_0xd339('0x72')],'raw':!![]};return db[_0xd339('0x40')][_0xd339('0x5c')](_0x29044f)[_0xd339('0x35')](handleEntityNotFound(_0x48b0b0,null))[_0xd339('0x35')](function(_0x16bcba){if(_0x16bcba){if(!_[_0xd339('0x7c')](_0x16bcba[_0xd339('0x72')])){if(fs[_0xd339('0x81')](path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x82'),_0x16bcba[_0xd339('0x72')]))){_0x5583f0=path['join'](config[_0xd339('0x79')],'server/files/images/avatars/',_0x16bcba['agentAvatar']);}}return _0x48b0b0['download'](_0x5583f0);}})[_0xd339('0x2a')](handleError(_0x48b0b0,null));};exports[_0xd339('0x83')]=function(_0x216642,_0x334b35,_0x3f6cde){var _0x41269e=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x84'));var _0x59b724={'where':{'id':_0x216642[_0xd339('0x5a')]['id']},'attributes':['id','customerAvatar',_0xd339('0x85')],'raw':!![]};return db['ChatWebsite'][_0xd339('0x5c')](_0x59b724)['then'](handleEntityNotFound(_0x334b35,null))[_0xd339('0x35')](function(_0x454d1a){if(_0x454d1a){if(!_[_0xd339('0x7c')](_0x454d1a[_0xd339('0x86')])){if(fs[_0xd339('0x81')](path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x82'),_0x454d1a[_0xd339('0x86')]))&&_0x454d1a[_0xd339('0x85')]){_0x41269e=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x82'),_0x454d1a['customerAvatar']);}}return _0x334b35[_0xd339('0x7e')](_0x41269e);}})[_0xd339('0x2a')](handleError(_0x334b35,null));};exports['getSystemAvatar']=function(_0x1ac235,_0x212df3,_0x50ca58){var _0x4eb7eb=path[_0xd339('0x78')](config[_0xd339('0x79')],'server/files/images/avatars/system_avatar.png');var _0x25c6e6={'where':{'id':_0x1ac235['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xd339('0x5c')](_0x25c6e6)[_0xd339('0x35')](handleEntityNotFound(_0x212df3,null))[_0xd339('0x35')](function(_0x57b9e2){if(_0x57b9e2){if(!_[_0xd339('0x7c')](_0x57b9e2['systemAvatar'])){if(fs[_0xd339('0x81')](path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x82'),_0x57b9e2[_0xd339('0x76')]))){_0x4eb7eb=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0x82'),_0x57b9e2[_0xd339('0x76')]);}}return _0x212df3[_0xd339('0x7e')](_0x4eb7eb);}})[_0xd339('0x2a')](handleError(_0x212df3,null));};exports[_0xd339('0x87')]=function(_0x54ca95,_0x2bcb41,_0x3285fe){var _0x40f0b2=require(_0xd339('0x88'));var _0x2f777a=new _0x40f0b2();var _0x67cf6e=_0x2f777a['setUA'](_0x54ca95[_0xd339('0x89')][_0xd339('0x8a')])[_0xd339('0x8b')]();var _0x1aaee4={'body':_0x54ca95[_0xd339('0x63')],'channel':'chat'};var _0x420a89=[];var _0x83d155=[];var _0x5bf18f={};var _0x44b6b9=![];return db['CmContact'][_0xd339('0x64')]()[_0xd339('0x35')](function(_0x38bde0){if(!_0x38bde0){throw new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0x8e'));}_0x420a89=_[_0xd339('0x8f')](_[_0xd339('0x46')](_0x38bde0),[_0xd339('0x90'),_0xd339('0x91')]);_0x83d155=_[_0xd339('0x8f')](_[_0xd339('0x46')](_0x38bde0),[_0xd339('0x90'),_0xd339('0x91'),_0xd339('0x92'),'ListId']);if(_0x54ca95[_0xd339('0x63')]['id']){delete _0x54ca95[_0xd339('0x63')]['id'];}if(_['isNil'](_0x54ca95[_0xd339('0x63')]['from'])){throw new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0x93'));}if(_[_0xd339('0x7c')](_0x54ca95[_0xd339('0x63')][_0xd339('0x63')])||_0x54ca95['body'][_0xd339('0x63')]===''){throw new db['Sequelize'][(_0xd339('0x8d'))](_0xd339('0x94'));}if(_[_0xd339('0x7c')](_0x54ca95[_0xd339('0x63')][_0xd339('0x95')])){throw new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0x96')+_0x83d155);}if(!_[_0xd339('0x97')](_0x83d155,_0x54ca95[_0xd339('0x63')][_0xd339('0x95')])){throw new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0x98')+_0x83d155);}_0x5bf18f[_0x54ca95[_0xd339('0x63')][_0xd339('0x95')]]=_0x54ca95[_0xd339('0x63')][_0xd339('0x99')];})[_0xd339('0x35')](function(){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x54ca95[_0xd339('0x5a')]['id']},'include':[{'model':db[_0xd339('0x9a')],'as':_0xd339('0x9b'),'include':[{'model':db[_0xd339('0x9c')],'as':_0xd339('0x9d'),'where':_0x5bf18f,'limit':0x1,'order':[[_0xd339('0x91'),_0xd339('0x9e')]]}]},{'model':db[_0xd339('0x9f')],'as':_0xd339('0xa0')}]});})[_0xd339('0x35')](handleEntityNotFound(_0x2bcb41,null))['then'](function(_0x402c27){if(_0x402c27&&_0x402c27[_0xd339('0x9b')]){_0x1aaee4[_0xd339('0xa1')]=_0x402c27;_0x1aaee4['applications']=_0x402c27['Applications'];_0x1aaee4[_0xd339('0xa2')]=_0x402c27[_0xd339('0x9b')];_0x1aaee4[_0xd339('0xa3')]=_['orderBy'](_0x1aaee4[_0xd339('0xa3')],['priority'],[_0xd339('0xa4')]);if(_0x1aaee4[_0xd339('0xa1')][_0xd339('0xa0')]){delete _0x1aaee4[_0xd339('0xa1')][_0xd339('0xa0')];}if(_0x1aaee4[_0xd339('0xa1')][_0xd339('0x9b')]&&_0x1aaee4[_0xd339('0xa1')][_0xd339('0x9b')][_0xd339('0x9d')][_0xd339('0x4a')]){return _0x1aaee4[_0xd339('0xa1')][_0xd339('0x9b')]['Contacts'][0x0];}var _0x8420bf=_[_0xd339('0x18')](_0x54ca95[_0xd339('0x63')],{'firstName':_0x54ca95[_0xd339('0x63')][_0xd339('0x99')],'ListId':_0x402c27['ListId']});_0x8420bf[_0x54ca95[_0xd339('0x63')][_0xd339('0x95')]]=_0x54ca95[_0xd339('0x63')][_0xd339('0x99')];return db[_0xd339('0x9c')][_0xd339('0x5d')](_0x8420bf,{'fields':_0x420a89,'raw':!![]});}})[_0xd339('0x35')](handleEntityNotFound(_0x2bcb41,null))[_0xd339('0x35')](function(_0x47554c){_0x1aaee4[_0xd339('0xa5')]=_0x47554c;var _0x2df107=_0x54ca95[_0xd339('0x63')][_0xd339('0xa6')];if(_0x54ca95[_0xd339('0x89')][_0xd339('0xa7')]){_0x2df107=_0x54ca95[_0xd339('0x89')][_0xd339('0xa7')];}else if(_0x54ca95[_0xd339('0x89')]['x-forwarded-for']){_0x2df107=_[_0xd339('0xa8')](_0x54ca95[_0xd339('0x89')][_0xd339('0xa9')][_0xd339('0xaa')](','));}if(_0x47554c){var _0x2c915f={'ContactId':_0x47554c['id'],'ChatWebsiteId':_0x54ca95[_0xd339('0x5a')]['id'],'from':(_0x47554c['firstName']||'')+'\x20'+(_0x47554c[_0xd339('0xab')]||''),'customerIp':_0x2df107,'customerPort':_0x54ca95[_0xd339('0x89')][_0xd339('0xac')]?_0x54ca95['headers']['x-real-port']:null,'referer':_0x54ca95[_0xd339('0x63')][_0xd339('0xad')],'browserName':_0x67cf6e['browser']['name']&&_0x67cf6e[_0xd339('0xae')][_0xd339('0xaf')]?util[_0xd339('0xb0')](_0xd339('0xb1'),_0x67cf6e[_0xd339('0xae')][_0xd339('0x3b')],_0x67cf6e[_0xd339('0xae')][_0xd339('0xaf')]):_0xd339('0xb2'),'browserVersion':_0x67cf6e['browser'][_0xd339('0xaf')]||_0xd339('0xb2'),'osName':util[_0xd339('0xb0')](_0xd339('0xb1'),_0x67cf6e['os'][_0xd339('0x3b')],_0x67cf6e['os']['version']),'osVersion':_0x67cf6e['os'][_0xd339('0xaf')],'deviceModel':_0x67cf6e['device'][_0xd339('0x48')]&&_0x67cf6e[_0xd339('0xb3')][_0xd339('0xb4')]?util[_0xd339('0xb0')](_0xd339('0xb5'),_0x67cf6e[_0xd339('0xb3')][_0xd339('0x48')],_0x67cf6e[_0xd339('0xb3')]['vendor'],_0x67cf6e[_0xd339('0xb3')][_0xd339('0x43')]):null,'deviceVendor':_0x67cf6e[_0xd339('0xb3')][_0xd339('0xb4')],'deviceType':_0x67cf6e[_0xd339('0xb3')][_0xd339('0x43')],'formData':JSON[_0xd339('0x25')](_0x54ca95['body'])};var _0x316ba7={'ChatWebsiteId':_0x54ca95['params']['id'],'closed':![]};if(_0x54ca95[_0xd339('0x63')]['threadId']){_0x316ba7[_0xd339('0xb6')]=_0x54ca95[_0xd339('0x63')]['threadId'];return db['ChatInteraction'][_0xd339('0x5c')]({'where':_0x316ba7})[_0xd339('0x35')](function(_0xde3671){if(_0xde3671){return[_0xde3671,![]];}_0x2c915f[_0xd339('0xb6')]=_0x54ca95[_0xd339('0x63')][_0xd339('0xb6')];_0x2c915f[_0xd339('0xb7')]=_0x54ca95[_0xd339('0x63')][_0xd339('0xb7')];return db[_0xd339('0xb8')][_0xd339('0x5d')](_0x2c915f)[_0xd339('0x35')](function(_0x59528d){return[_0x59528d,!![]];});});}_0x316ba7[_0xd339('0xb9')]=_0x47554c['id'];if(_0x54ca95['body'][_0xd339('0xba')]&&_0x54ca95['body'][_0xd339('0xba')]['id']){_0x316ba7['id']=_0x54ca95[_0xd339('0x63')][_0xd339('0xba')]['id'];return db['ChatInteraction'][_0xd339('0x5c')]({'where':_0x316ba7})[_0xd339('0x35')](function(_0xd84274){if(_0xd84274){return[_0xd84274,![]];}return db[_0xd339('0xb8')][_0xd339('0x5d')](_0x2c915f)[_0xd339('0x35')](function(_0x5e2105){return[_0x5e2105,!![]];});});}return db[_0xd339('0xb8')][_0xd339('0x5d')](_0x2c915f)[_0xd339('0x35')](function(_0x48abc4){return[_0x48abc4,!![]];});}})['spread'](function(_0x2637af,_0x6ad47e){if(_0x2637af){_0x44b6b9=_0x6ad47e;if(!_0x6ad47e){var _0x74a377={'from':(_0x1aaee4[_0xd339('0xa5')][_0xd339('0xbb')]||'')+'\x20'+(_0x1aaee4[_0xd339('0xa5')][_0xd339('0xab')]||'')};if(_0x54ca95[_0xd339('0x63')][_0xd339('0xb6')]&&_0x54ca95[_0xd339('0x63')]['messageId']&&_0x54ca95['body'][_0xd339('0xb6')]!=_0x54ca95['body']['messageId']){_0x74a377['threadId']=_0x54ca95['body'][_0xd339('0xbc')];}return _0x2637af['update'](_0x74a377);}else{return _0x2637af;}}})['then'](function(_0x3bafb2){_0x1aaee4[_0xd339('0xba')]=_0x3bafb2['get']({'plain':!![]});_0x1aaee4[_0xd339('0xba')][_0xd339('0xbd')]=_0x44b6b9;if(_0x1aaee4['interaction'][_0xd339('0xbd')]){if(_0x1aaee4[_0xd339('0xa1')][_0xd339('0xbe')]){_0x1aaee4[_0xd339('0xa3')][_0xd339('0xbf')]({'id':0x0,'priority':_0x1aaee4[_0xd339('0xa3')][_0xd339('0x4a')]+0x1,'app':'close','appdata':_0xd339('0xc0'),'interval':_0xd339('0xc1')});}}return db[_0xd339('0xc2')][_0xd339('0x5d')]({'body':_0x54ca95[_0xd339('0x63')][_0xd339('0x63')],'ChatWebsiteId':_0x54ca95[_0xd339('0x5a')]['id'],'ChatInteractionId':_0x3bafb2['id'],'direction':'in','ContactId':_0x1aaee4[_0xd339('0xa5')]['id'],'AttachmentId':_0x54ca95[_0xd339('0x63')][_0xd339('0xc3')]});})['then'](function(_0x45d456){_0x1aaee4[_0xd339('0x28')]=_0x45d456;if(_0x1aaee4[_0xd339('0xba')][_0xd339('0xc4')]){return db[_0xd339('0xc5')]['find']({'attributes':['id',_0xd339('0x3b')],'where':{'id':_0x1aaee4[_0xd339('0xba')][_0xd339('0xc4')]}})['then'](function(_0xb50d0b){if(_0xb50d0b){_0x1aaee4[_0xd339('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xb50d0b['name']+','+(_0x1aaee4['account'][_0xd339('0xc6')]||0xa),'interval':'*,*,*,*'});_0x1aaee4['forcedOwnership']=!![];}return respondWithRpcPromise(_0xd339('0xc7'),_0xd339('0xc8'),_0x1aaee4);});}return respondWithRpcPromise(_0xd339('0xc7'),_0xd339('0xc8'),_0x1aaee4);})['then'](function(_0x3bc0ad){respondWithRpcPromise(_0xd339('0xc9'),_0xd339('0xc9'),{'event':_0xd339('0x87'),'message':_0x3bc0ad},client9002);return _0x3bc0ad;})[_0xd339('0x35')](respondWithResult(_0x2bcb41,null))[_0xd339('0x2a')](handleError(_0x2bcb41,null));};exports[_0xd339('0xca')]=function(_0x39ae4a,_0x546109,_0x5dce97){var _0x2c65c7,_0x4fd3dd,_0x4ee9c5;var _0x3c1856=[];var _0x50ea1a=[];var _0xa79917={};var _0x214ec3=_0x39ae4a['files']||[];var _0x3e2f49=[];var _0x430d9b;return db[_0xd339('0x9c')][_0xd339('0x64')]()[_0xd339('0x35')](function(_0x3b98eb){if(!_0x3b98eb){throw new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0x8e'));}_0x50ea1a=_[_0xd339('0x8f')](_[_0xd339('0x46')](_0x3b98eb),[_0xd339('0x90'),_0xd339('0x91')]);_0x3c1856=_[_0xd339('0x8f')](_[_0xd339('0x46')](_0x3b98eb),[_0xd339('0x90'),_0xd339('0x91'),_0xd339('0x92'),_0xd339('0xcb')]);if(_0x39ae4a[_0xd339('0x63')]['id']){delete _0x39ae4a[_0xd339('0x63')]['id'];}if(_['isNil'](_0x39ae4a['body']['from'])){throw _0x546109[_0xd339('0x2b')](0x1f4)[_0xd339('0x3c')](new db['Sequelize'][(_0xd339('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0xd339('0x7c')](_0x39ae4a[_0xd339('0x63')]['body'])||_0x39ae4a[_0xd339('0x63')][_0xd339('0x63')]===''){throw _0x546109[_0xd339('0x2b')](0x1f4)[_0xd339('0x3c')](new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xd339('0x7c')](_0x39ae4a['body'][_0xd339('0xcc')])){throw _0x546109[_0xd339('0x2b')](0x1f4)[_0xd339('0x3c')](new db[(_0xd339('0x8c'))][(_0xd339('0x8d'))](_0xd339('0xcd')+_0x3c1856));}if(!_[_0xd339('0x97')](_0x3c1856,_0x39ae4a['body'][_0xd339('0xcc')])){throw _0x546109[_0xd339('0x2b')](0x1f4)[_0xd339('0x3c')](new db['Sequelize'][(_0xd339('0x8d'))](_0xd339('0xce')+_0x3c1856));}_0xa79917[_0x39ae4a[_0xd339('0x63')][_0xd339('0xcc')]]=_0x39ae4a[_0xd339('0x63')]['from'];})[_0xd339('0x35')](function(){return db['ChatWebsite'][_0xd339('0x5c')]({'where':{'id':_0x39ae4a[_0xd339('0x5a')]['id']},'include':[{'model':db[_0xd339('0x9a')],'as':_0xd339('0x9b')},{'model':db['MailAccount'],'as':_0xd339('0xcf')}]});})[_0xd339('0x35')](handleEntityNotFound(_0x546109,null))[_0xd339('0x35')](function(_0x350ad3){if(_0x350ad3&&_0x350ad3[_0xd339('0x9b')]){_0x4fd3dd=_0x350ad3;var _0x5a489e=_[_0xd339('0x18')](_0x39ae4a['body'],{'firstName':_0x39ae4a[_0xd339('0x63')][_0xd339('0x99')],'phone':_0x39ae4a[_0xd339('0x63')][_0xd339('0x99')],'ListId':_0x350ad3[_0xd339('0xcb')]});_0x5a489e[_0x39ae4a[_0xd339('0x63')][_0xd339('0xcc')]]=_0x39ae4a['body']['from'];return db[_0xd339('0x9c')][_0xd339('0xd0')]({'where':_0xa79917,'defaults':_0x5a489e});}})['spread'](function(_0x54a934){if(_0x54a934){_0x4ee9c5=_0x54a934;var _0x3fe995=fs[_0xd339('0xd1')](path[_0xd339('0x78')](config[_0xd339('0x79')],'server/files/templates/chatOfflineMessage.ejs'),_0xd339('0xd2'));var _0x175979=ejs[_0xd339('0xd3')](_0x3fe995,{'body':_[_0xd339('0xd4')](_0x39ae4a[_0xd339('0x63')][_0xd339('0x63')]),'bodyTitle':_0x4fd3dd['offlineMessageBody']});return db[_0xd339('0xd5')][_0xd339('0x5d')]({'body':_0x175979,'ContactId':_0x54a934['id'],'ChatWebsiteId':_0x4fd3dd['id']});}})['then'](function(_0x35a681){_0x430d9b=_0x35a681;if(_0x214ec3[_0xd339('0x4a')]){var _0x1629f5=_0x214ec3[_0xd339('0x3f')](function(_0x104128){return{'name':_0x104128['originalname'],'basename':_0x104128[_0xd339('0x73')],'type':_0x104128['mimetype'],'ChatOfflineMessageId':_0x35a681['id']};});_0x3e2f49=_0x1629f5[_0xd339('0x3f')](_0xe6eace=>{var _0x39b021={'filename':_0xe6eace['name'],'path':path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0xd6'),_0xd339('0xd7'),'attachments',_0xd339('0xd8'),_0xe6eace[_0xd339('0xd9')])};return _0x39b021;});if(!_0x4fd3dd['openNewInteraction']){return db[_0xd339('0xda')][_0xd339('0xdb')](function(_0x44e6c9){return db[_0xd339('0xdc')][_0xd339('0xdd')](_0x1629f5,{'transaction':_0x44e6c9});});}}})[_0xd339('0x35')](function(){if(_0x430d9b){_0x2c65c7=_0x430d9b;return db[_0xd339('0xcf')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd339('0xde')],'as':'Smtp','raw':!![]}]});}})[_0xd339('0x35')](function(_0x2a0785){if(_0x2a0785&&_0x2a0785[_0xd339('0xdf')]&&_0x4fd3dd[_0xd339('0xe0')]&&_0x4fd3dd[_0xd339('0xe1')]){var _0x317259={'tls':{'rejectUnauthorized':![]}};if(_0x2a0785[_0xd339('0xdf')][_0xd339('0xe2')]){_0x317259[_0xd339('0xe2')]=_0x2a0785[_0xd339('0xdf')]['service'];}else{_0x317259[_0xd339('0xe3')]=_0x2a0785[_0xd339('0xdf')][_0xd339('0xe3')];_0x317259['port']=_0x2a0785[_0xd339('0xdf')][_0xd339('0xe4')];_0x317259[_0xd339('0xe5')]=_0x2a0785['Smtp'][_0xd339('0xe5')];}if(_0x2a0785[_0xd339('0xdf')][_0xd339('0xe6')]){_0x317259[_0xd339('0xe7')]={'user':_0x2a0785[_0xd339('0xdf')][_0xd339('0x5e')],'pass':_0x2a0785[_0xd339('0xdf')][_0xd339('0xe8')]};}return respondWithRpcPromise(_0xd339('0xe9'),_0xd339('0xea'),{'account':_0x317259,'message':{'from':util[_0xd339('0xb0')](_0xd339('0xeb'),_0x2a0785['name'],_0x2a0785[_0xd339('0xec')]||_0x2a0785[_0xd339('0xdf')][_0xd339('0x5e')]),'to':_0x4fd3dd['forwardOfflineAddress'],'subject':_0x4fd3dd[_0xd339('0xed')],'html':_0x2c65c7[_0xd339('0x63')],'attachments':_0x3e2f49}},client9003)['then'](function(){return _0x2c65c7;})[_0xd339('0x2a')](function(_0xcb322b){console[_0xd339('0x26')](_0xcb322b);});}})[_0xd339('0x35')](function(){if(_0x4fd3dd&&_0x4fd3dd[_0xd339('0xee')]&&_0x4fd3dd[_0xd339('0xef')]){var _0x3763a4=[];if(_0x214ec3[_0xd339('0x4a')]){_0x3763a4=_0x214ec3['map'](function(_0x5167aa){return{'name':_0x5167aa[_0xd339('0xf0')],'basename':_0x5167aa[_0xd339('0x73')],'type':_0x5167aa[_0xd339('0xf1')],'ChatOfflineMessageId':_0x430d9b['id']};});}var _0x3f89fb;if(!_[_0xd339('0x7c')](_0x4fd3dd[_0xd339('0xf2')])){var _0x250eeb=_[_0xd339('0x3f')](_0x39ae4a[_0xd339('0x63')],function(_0xfee624){return _0xfee624;});var _0x101d16=_[_0xd339('0xf3')](_0x250eeb)[0x0];var _0x4d9f72=_[_0xd339('0xf4')](_0x101d16,function(_0x3e3d43){return _0x3e3d43;});_0x3f89fb=_0x4d9f72[0x1][_0x4fd3dd['subjectOffline']];}var _0x12f26e={'from':_0x4ee9c5[_0xd339('0xec')],'firstName':_0x4ee9c5[_0xd339('0xbb')],'lastName':_0x4ee9c5[_0xd339('0xab')],'mapKey':_0xd339('0xec'),'message':{'from':_0x4ee9c5['email'],'to':_0x4fd3dd[_0xd339('0xcf')][_0xd339('0xec')],'cc':'','subject':_[_0xd339('0x7c')](_0x3f89fb)?_0x4fd3dd[_0xd339('0xed')]:_0x3f89fb,'messageId':'','sentAt':new Date(),'attach':_0x3763a4['length'],'attachments':_0x3763a4,'originChannel':_0xd339('0xf5'),'ChatWebsiteId':_0x4fd3dd['id'],'ChatOfflineMessageId':_0x2c65c7['id'],'originTo':_0x4fd3dd[_0xd339('0xcf')]['email']},'body':_0x2c65c7[_0xd339('0x63')]};var _0xf82ed4={'account':{'id':_0x4fd3dd[_0xd339('0xef')]},'body':_0x12f26e,'log':_0xd339('0xf6')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0xf82ed4,client9001)[_0xd339('0x35')](function(){return _0x2c65c7;})[_0xd339('0x2a')](function(_0x3f84ca){console[_0xd339('0x26')](_0x3f84ca);});}return;})[_0xd339('0x35')](function(){if(_0x2c65c7){return _0x2c65c7;}})['then'](respondWithResult(_0x546109,null))['catch'](function(_0x240063){console[_0xd339('0x26')](_0xd339('0x2a'),_0x240063);for(var _0x2b5d4e of _0x214ec3){var _0x30c426=path[_0xd339('0x78')](config[_0xd339('0x79')],_0xd339('0xd6'),_0xd339('0xd7'),'attachments','offline-chat',_0x2b5d4e[_0xd339('0x73')]);fs_extra['remove'](_0x30c426)[_0xd339('0x2a')](function(_0x17fcca){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x30c426,_0x17fcca);});}});};exports[_0xd339('0xf7')]=function(_0x5b49d5,_0x5041bf,_0x2d616e){return db[_0xd339('0xb8')][_0xd339('0x5c')]({'where':{'id':_0x5b49d5[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x5041bf,null))[_0xd339('0x35')](function(_0x367de4){if(_0x367de4){return _0x367de4[_0xd339('0xf7')](_0x5b49d5['body']['ids'],_[_0xd339('0xf8')](_0x5b49d5[_0xd339('0x63')],['ids','id'])||{});}})[_0xd339('0x35')](respondWithResult(_0x5041bf,null))[_0xd339('0x2a')](handleError(_0x5041bf,null));};exports[_0xd339('0xf9')]=function(_0x1e503a,_0x4b2659,_0x5a18ce){var _0x3a1945={'raw':![],'where':{}};var _0x67047f={};var _0x4d5070={'count':0x0,'rows':[]};return db[_0xd339('0x40')][_0xd339('0x6d')]({'where':{'id':_0x1e503a['params']['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x4b2659,null))['then'](function(_0x20c257){if(_0x20c257){_0x67047f[_0xd339('0x48')]=_[_0xd339('0x46')](db[_0xd339('0xb8')]['rawAttributes']);_0x67047f[_0xd339('0x45')]=_['keys'](_0x1e503a[_0xd339('0x45')]);_0x67047f[_0xd339('0x4f')]=_[_0xd339('0x47')](_0x67047f[_0xd339('0x48')],_0x67047f['query']);_0x3a1945['attributes']=_[_0xd339('0x47')](_0x67047f[_0xd339('0x48')],qs[_0xd339('0x5b')](_0x1e503a[_0xd339('0x45')][_0xd339('0x5b')]));_0x3a1945[_0xd339('0x49')]=_0x3a1945[_0xd339('0x49')][_0xd339('0x4a')]?_0x3a1945['attributes']:_0x67047f[_0xd339('0x48')];if(!_0x1e503a[_0xd339('0x45')]['hasOwnProperty']('nolimit')){_0x3a1945[_0xd339('0x2c')]=qs[_0xd339('0x2c')](_0x1e503a[_0xd339('0x45')][_0xd339('0x2c')]);_0x3a1945[_0xd339('0x2f')]=qs['offset'](_0x1e503a[_0xd339('0x45')][_0xd339('0x2f')]);}_0x3a1945[_0xd339('0x4c')]=qs[_0xd339('0x4d')](_0x1e503a[_0xd339('0x45')][_0xd339('0x4d')]);_0x3a1945[_0xd339('0x51')]=qs[_0xd339('0x4f')](_[_0xd339('0x4e')](_0x1e503a[_0xd339('0x45')],_0x67047f['filters']));_0x3a1945['where'][_0xd339('0x65')]=_0x20c257['id'];if(_0x1e503a[_0xd339('0x45')]['filter']){_0x3a1945[_0xd339('0x51')]=_[_0xd339('0x52')](_0x3a1945[_0xd339('0x51')],{'$or':_['map'](_0x3a1945['attributes'],function(_0x4015a1){var _0x389bb9={};_0x389bb9[_0x4015a1]={'$like':'%'+_0x1e503a[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x389bb9;})});}_0x3a1945=_[_0xd339('0x52')]({},_0x3a1945,_0x1e503a[_0xd339('0x54')]);return db[_0xd339('0xb8')][_0xd339('0x2e')]({'where':_0x3a1945[_0xd339('0x51')]})[_0xd339('0x35')](function(_0xe96ec6){_0x4d5070[_0xd339('0x2e')]=_0xe96ec6;if(_0x1e503a['query'][_0xd339('0x55')]){_0x3a1945[_0xd339('0x56')]=[{'model':db[_0xd339('0x9c')],'as':'Contact','required':![]},{'model':db[_0xd339('0xc5')],'as':_0xd339('0xfa'),'attributes':[_0xd339('0x3b'),'fullname',_0xd339('0xfb')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd339('0x3b'),_0xd339('0xfc')],'where':_0x1e503a['query']['tag']?{'id':_0x1e503a[_0xd339('0x45')][_0xd339('0xfd')]}:undefined,'required':_0x1e503a[_0xd339('0x45')][_0xd339('0xfd')]?!![]:![]}];}return db[_0xd339('0xb8')]['findAll'](_0x3a1945);})[_0xd339('0x35')](function(_0xd2f2a0){_0x4d5070[_0xd339('0x58')]=_0xd2f2a0;return _0x4d5070;});}})[_0xd339('0x35')](respondWithFilteredResult(_0x4b2659,_0x3a1945))['catch'](handleError(_0x4b2659,null));};function iftimePromise(_0x23a7c0,_0x4c232d){return respondWithRpcPromise(_0xd339('0xfe'),_0xd339('0xff'),{'command':_0x4c232d[_0xd339('0x100')]?util[_0xd339('0xb0')]('iftime\x20%s,%s',_0x23a7c0[_0xd339('0x101')],_0x4c232d[_0xd339('0x100')]):util[_0xd339('0xb0')](_0xd339('0x102'),_0x23a7c0[_0xd339('0x101')])},client9002)[_0xd339('0x35')](function(_0x4a7fc3){var _0x233730=_0x4a7fc3&&_0x4a7fc3['indexOf'](_0xd339('0x103'))>=0x0?!![]:![];logger[_0xd339('0x20')](_0xd339('0x104'),_0x4c232d['id'],_0x23a7c0['id'],_0x23a7c0[_0xd339('0x101')],_0x233730?_0xd339('0x105'):_0xd339('0x106'),_0x4c232d['timezone']?_0x4c232d[_0xd339('0x100')]:_0xd339('0x107'));return _0x233730;})[_0xd339('0x2a')](function(_0x53e118){logger[_0xd339('0x26')](_0xd339('0x104'),_0x4c232d['id'],_0x23a7c0['id'],_0x23a7c0[_0xd339('0x101')],util[_0xd339('0x108')](_0x53e118,{'showHidden':![],'depth':null}),_0x4c232d[_0xd339('0x100')]?_0x4c232d[_0xd339('0x100')]:_0xd339('0x107'));return![];});}exports[_0xd339('0xff')]=function(_0x2247a4,_0x1f3b1e,_0x123aea){var _0x3a2e50=0x0;var _0x3381f6=0x0;var _0x24ff88=![];var _0x52df01;var _0x183ab2;return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x2247a4['params']['id']},'include':[{'model':db[_0xd339('0x109')],'as':_0xd339('0x109'),'include':[{'model':db[_0xd339('0x109')],'as':_0xd339('0x10a'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xd339('0x35')](handleEntityNotFound(_0x1f3b1e,null))[_0xd339('0x35')](function(_0x550da8){if(_0x550da8){_0x52df01=_0x550da8;return _0x550da8[_0xd339('0x10b')]({'raw':!![]});}})[_0xd339('0x35')](function(_0x33fcb3){if(_0x52df01){if(_0x33fcb3){_0x183ab2=_0x33fcb3;}}return require(_0xd339('0x15'))[_0xd339('0x7b')]();})[_0xd339('0x35')](function(_0xe81255){if(_0xe81255){_0x3381f6=_0xe81255[_0xd339('0x10c')];_0x24ff88=_0xe81255[_0xd339('0x10d')];}})[_0xd339('0x35')](function(){return db[_0xd339('0xb8')][_0xd339('0x2e')]({'where':{'closed':![]}});})[_0xd339('0x35')](function(_0x427f28){_0x3a2e50=_0x427f28;if(_0x3381f6&&_0x427f28>_0x3381f6){return db[_0xd339('0x10e')][_0xd339('0x6d')]({'where':{'id':0x1}})[_0xd339('0x35')](function(_0x2796ec){if(_0x2796ec){_0x2796ec[_0xd339('0x10f')](_0xd339('0x110'));}});}})[_0xd339('0x35')](function(){if(_0x52df01[_0xd339('0x109')]&&_0x52df01['Interval'][_0xd339('0x10a')]){var _0x3f0aee=[];for(var _0x425825=0x0;_0x425825<_0x52df01[_0xd339('0x109')][_0xd339('0x10a')][_0xd339('0x4a')];_0x425825++){var _0x4b4e25=_0x52df01[_0xd339('0x109')][_0xd339('0x10a')][_0x425825]['get']({'plain':!![]});_0x3f0aee['push'](iftimePromise(_0x4b4e25,_0x52df01));}return BPromise[_0xd339('0x111')](_0x3f0aee)[_0xd339('0x35')](function(_0x34d4e5){return _[_0xd339('0x112')](_0x34d4e5);});}else{return!![];}})['then'](function(_0x5ae5c6){var _0x50c294=fs['readFileSync'](path[_0xd339('0x78')](config['root'],_0xd339('0x113')),_0xd339('0xd2'));var _0x20c1bb={'remote':_0x52df01['remote'],'query':querystring[_0xd339('0x25')](_['merge'](_0x52df01['get']({'plain':!![]}),{'customerIp':_0x2247a4[_0xd339('0x89')][_0xd339('0xa9')]||_0x2247a4['headers']['x-real-ip']||_0x2247a4[_0xd339('0x114')]['remoteAddress']||_0x2247a4['ip'],'referer':_0x2247a4[_0xd339('0x89')][_0xd339('0xad')],'openedInteractions':_0x3a2e50,'maxInteractions':_0x3381f6,'virtual':_0x24ff88['virtual'],'online':_0x5ae5c6,'custom':_0x24ff88}))['replace'](/'/g,'\x5c\x27')};_0x1f3b1e[_0xd339('0x3c')](ejs['render'](Mustache['render'](_0x50c294,_0x20c1bb),{'proactiveActions':_0x183ab2,'alignment':_0x52df01['alignment'],'verticalAlignment':_0x52df01[_0xd339('0x115')],'div_color':_0x52df01[_0xd339('0xfc')],'text_color':_0x52df01[_0xd339('0x116')],'button_color':_0x52df01['color_button'],'background_color':_0x52df01[_0xd339('0x117')]}));})[_0xd339('0x2a')](handleError(_0x1f3b1e,null));};exports[_0xd339('0x118')]=function(_0x362735,_0x88cf43,_0x3edcbe){return db['ChatWebsite'][_0xd339('0x6d')]({'where':{'id':_0x362735[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x88cf43,null))[_0xd339('0x35')](function(_0x557801){if(_0x557801){return db['sequelize'][_0xd339('0xdb')](function(_0xcc4b49){return db[_0xd339('0x9f')][_0xd339('0x36')]({'where':{'ChatWebsiteId':_0x362735['params']['id']},'transaction':_0xcc4b49})['then'](function(_0x3f8ec7){var _0x519461=_['map'](_0x362735[_0xd339('0x63')],function(_0x10e89d){_0x10e89d[_0xd339('0x65')]=_0x362735[_0xd339('0x5a')]['id'];return _0x10e89d;});return db['ChatApplication'][_0xd339('0xdd')](_0x519461,{'transaction':_0xcc4b49});});})[_0xd339('0x35')](function(){return db[_0xd339('0x9f')][_0xd339('0x119')]({'where':{'ChatWebsiteId':_0x362735[_0xd339('0x5a')]['id']},'order':'priority'});});}})[_0xd339('0x35')](respondWithResult(_0x88cf43,null))[_0xd339('0x2a')](handleError(_0x88cf43,null));};exports[_0xd339('0x11a')]=function(_0x47ed9c,_0x4a18df,_0x3c832e){var _0x3dd18a={};var _0x3415c8={};var _0x4a47a2;var _0x11d922;return db['ChatWebsite'][_0xd339('0x6d')]({'where':{'id':_0x47ed9c['params']['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x4a18df,null))[_0xd339('0x35')](function(_0x3e847d){if(_0x3e847d){_0x4a47a2=_0x3e847d;_0x3415c8['model']=_[_0xd339('0x46')](db[_0xd339('0x9f')][_0xd339('0x41')]);_0x3415c8[_0xd339('0x45')]=_[_0xd339('0x46')](_0x47ed9c['query']);_0x3415c8[_0xd339('0x4f')]=_[_0xd339('0x47')](_0x3415c8[_0xd339('0x48')],_0x3415c8[_0xd339('0x45')]);_0x3dd18a['attributes']=_[_0xd339('0x47')](_0x3415c8[_0xd339('0x48')],qs['fields'](_0x47ed9c[_0xd339('0x45')][_0xd339('0x5b')]));_0x3dd18a['attributes']=_0x3dd18a[_0xd339('0x49')][_0xd339('0x4a')]?_0x3dd18a[_0xd339('0x49')]:_0x3415c8[_0xd339('0x48')];_0x3dd18a[_0xd339('0x4c')]=qs[_0xd339('0x4d')](_0x47ed9c[_0xd339('0x45')][_0xd339('0x4d')]);_0x3dd18a[_0xd339('0x51')]=qs[_0xd339('0x4f')](_[_0xd339('0x4e')](_0x47ed9c[_0xd339('0x45')],_0x3415c8[_0xd339('0x4f')]));if(_0x47ed9c['query'][_0xd339('0x50')]){_0x3dd18a[_0xd339('0x51')]=_['merge'](_0x3dd18a['where'],{'$or':_[_0xd339('0x3f')](_0x3dd18a['attributes'],function(_0x2fc3c8){var _0x513047={};_0x513047[_0x2fc3c8]={'$like':'%'+_0x47ed9c[_0xd339('0x45')]['filter']+'%'};return _0x513047;})});}_0x3dd18a=_[_0xd339('0x52')]({},_0x3dd18a,_0x47ed9c[_0xd339('0x54')]);return _0x4a47a2[_0xd339('0x11a')](_0x3dd18a);}})[_0xd339('0x35')](function(_0x11f8fe){if(_0x11f8fe){_0x11d922=_0x11f8fe[_0xd339('0x4a')];if(!_0x47ed9c[_0xd339('0x45')]['hasOwnProperty'](_0xd339('0x4b'))){_0x3dd18a['limit']=qs[_0xd339('0x2c')](_0x47ed9c[_0xd339('0x45')][_0xd339('0x2c')]);_0x3dd18a[_0xd339('0x2f')]=qs[_0xd339('0x2f')](_0x47ed9c[_0xd339('0x45')]['offset']);}return _0x4a47a2[_0xd339('0x11a')](_0x3dd18a);}})[_0xd339('0x35')](function(_0x47b5e4){if(_0x47b5e4){return _0x47b5e4?{'count':_0x11d922,'rows':_0x47b5e4}:null;}})[_0xd339('0x35')](respondWithResult(_0x4a18df,null))[_0xd339('0x2a')](handleError(_0x4a18df,null));};exports[_0xd339('0x11b')]=function(_0x18b66f,_0x26d943,_0x1b2c49){return db['chatProactiveAction'][_0xd339('0x5c')]({'where':{'id':_0x18b66f[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x26d943,null))[_0xd339('0x35')](function(_0xb24552){if(_0xb24552){return _0xb24552[_0xd339('0x11b')](_0x18b66f[_0xd339('0x63')][_0xd339('0x69')],_[_0xd339('0xf8')](_0x18b66f[_0xd339('0x63')],[_0xd339('0x69'),'id'])||{});}})['then'](respondWithResult(_0x26d943,null))[_0xd339('0x2a')](handleError(_0x26d943,null));};exports[_0xd339('0x10b')]=function(_0x5d733b,_0x14bf71,_0x3bef25){var _0x575285={};var _0x50447f={};var _0x1fc3e6;var _0x5e2f7d;return db[_0xd339('0x40')][_0xd339('0x6d')]({'where':{'id':_0x5d733b[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x14bf71,null))['then'](function(_0x1d5524){if(_0x1d5524){_0x1fc3e6=_0x1d5524;_0x50447f['model']=_[_0xd339('0x46')](db[_0xd339('0x11c')]['rawAttributes']);_0x50447f[_0xd339('0x45')]=_['keys'](_0x5d733b[_0xd339('0x45')]);_0x50447f[_0xd339('0x4f')]=_['intersection'](_0x50447f[_0xd339('0x48')],_0x50447f[_0xd339('0x45')]);_0x575285['attributes']=_[_0xd339('0x47')](_0x50447f['model'],qs[_0xd339('0x5b')](_0x5d733b['query'][_0xd339('0x5b')]));_0x575285[_0xd339('0x49')]=_0x575285['attributes'][_0xd339('0x4a')]?_0x575285['attributes']:_0x50447f[_0xd339('0x48')];_0x575285[_0xd339('0x4c')]=qs['sort'](_0x5d733b[_0xd339('0x45')]['sort']);_0x575285['where']=qs[_0xd339('0x4f')](_['pick'](_0x5d733b[_0xd339('0x45')],_0x50447f[_0xd339('0x4f')]));if(_0x5d733b[_0xd339('0x45')]['filter']){_0x575285[_0xd339('0x51')]=_[_0xd339('0x52')](_0x575285[_0xd339('0x51')],{'$or':_[_0xd339('0x3f')](_0x575285[_0xd339('0x49')],function(_0x234351){var _0x44173c={};_0x44173c[_0x234351]={'$like':'%'+_0x5d733b[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x44173c;})});}_0x575285=_[_0xd339('0x52')]({},_0x575285,_0x5d733b[_0xd339('0x54')]);return _0x1fc3e6[_0xd339('0x10b')](_0x575285);}})[_0xd339('0x35')](function(_0x1e16dc){if(_0x1e16dc){_0x5e2f7d=_0x1e16dc['length'];if(!_0x5d733b[_0xd339('0x45')][_0xd339('0x67')](_0xd339('0x4b'))){_0x575285[_0xd339('0x2c')]=qs[_0xd339('0x2c')](_0x5d733b[_0xd339('0x45')]['limit']);_0x575285['offset']=qs['offset'](_0x5d733b[_0xd339('0x45')]['offset']);}return _0x1fc3e6[_0xd339('0x10b')](_0x575285);}})['then'](function(_0x4010c8){if(_0x4010c8){return _0x4010c8?{'count':_0x5e2f7d,'rows':_0x4010c8}:null;}})[_0xd339('0x35')](respondWithResult(_0x14bf71,null))[_0xd339('0x2a')](handleError(_0x14bf71,null));};exports[_0xd339('0x11d')]=function(_0x30f37a,_0x100932,_0x32d7a0){var _0x1b4550=_0x30f37a[_0xd339('0x45')]['online']===_0xd339('0x11e')?_0xd339('0x11f'):_0xd339('0x120');return db[_0xd339('0x40')][_0xd339('0x5c')]({'attributes':['id',_0x1b4550],'where':{'id':_0x30f37a[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x100932,null))['then'](function(_0x25e76d){if(_0x25e76d){var _0x20e17c=_0x25e76d[_0x1b4550];var _0x38cac7=_0x20e17c&&_0x20e17c[_0xd339('0x121')]?_0x20e17c[_0xd339('0x121')]:[];_0x100932[_0xd339('0x3c')]({'fromKey':_[_0xd339('0x7c')](_0x20e17c['fromKey'])?undefined:_0x20e17c[_0xd339('0x122')],'count':_0x38cac7['length'],'rows':_0x38cac7});}})[_0xd339('0x2a')](handleError(_0x100932,null));};exports[_0xd339('0x123')]=function(_0x462e8f,_0x33cc94,_0x597355){var _0x2f4f07={'raw':![],'where':{}};var _0x14ba8d={};var _0x28c092={'count':0x0,'rows':[]};return db[_0xd339('0x40')][_0xd339('0x6d')]({'where':{'id':_0x462e8f[_0xd339('0x5a')]['id']}})['then'](handleEntityNotFound(_0x33cc94,null))[_0xd339('0x35')](function(_0x2e401d){if(_0x2e401d){_0x14ba8d[_0xd339('0x48')]=_['keys'](db[_0xd339('0xd5')]['rawAttributes']);_0x14ba8d[_0xd339('0x45')]=_[_0xd339('0x46')](_0x462e8f[_0xd339('0x45')]);_0x14ba8d['filters']=_['intersection'](_0x14ba8d[_0xd339('0x48')],_0x14ba8d['query']);_0x2f4f07[_0xd339('0x49')]=_[_0xd339('0x47')](_0x14ba8d[_0xd339('0x48')],qs[_0xd339('0x5b')](_0x462e8f['query'][_0xd339('0x5b')]));_0x2f4f07[_0xd339('0x49')]=_0x2f4f07[_0xd339('0x49')][_0xd339('0x4a')]?_0x2f4f07[_0xd339('0x49')]:_0x14ba8d[_0xd339('0x48')];if(!_0x462e8f[_0xd339('0x45')][_0xd339('0x67')](_0xd339('0x4b'))){_0x2f4f07['limit']=qs[_0xd339('0x2c')](_0x462e8f[_0xd339('0x45')][_0xd339('0x2c')]);_0x2f4f07[_0xd339('0x2f')]=qs[_0xd339('0x2f')](_0x462e8f[_0xd339('0x45')]['offset']);}_0x2f4f07[_0xd339('0x4c')]=qs[_0xd339('0x4d')](_0x462e8f['query'][_0xd339('0x4d')]);_0x2f4f07[_0xd339('0x51')]=qs['filters'](_[_0xd339('0x4e')](_0x462e8f[_0xd339('0x45')],_0x14ba8d[_0xd339('0x4f')]));_0x2f4f07['where'][_0xd339('0x65')]=_0x2e401d['id'];if(_0x462e8f[_0xd339('0x45')][_0xd339('0x50')]){_0x2f4f07[_0xd339('0x51')]=_[_0xd339('0x52')](_0x2f4f07[_0xd339('0x51')],{'$or':_[_0xd339('0x3f')](_0x2f4f07[_0xd339('0x49')],function(_0x44e4fa){var _0x39748d={};_0x39748d[_0x44e4fa]={'$like':'%'+_0x462e8f[_0xd339('0x45')][_0xd339('0x50')]+'%'};return _0x39748d;})});}_0x2f4f07=_[_0xd339('0x52')]({},_0x2f4f07,_0x462e8f[_0xd339('0x54')]);return db['ChatOfflineMessage']['count']({'where':_0x2f4f07['where']})['then'](function(_0x25eb3c){_0x28c092[_0xd339('0x2e')]=_0x25eb3c;if(_0x462e8f[_0xd339('0x45')][_0xd339('0x55')]){_0x2f4f07[_0xd339('0x56')]=[{'all':!![]}];}else{_0x2f4f07[_0xd339('0x56')]=[{'model':db['CmContact'],'as':_0xd339('0x124'),'required':![]},{'model':db[_0xd339('0xdc')],'as':_0xd339('0x125'),'required':![]}];}return db[_0xd339('0xd5')][_0xd339('0x57')](_0x2f4f07);})[_0xd339('0x35')](function(_0x3b4ca0){_0x28c092[_0xd339('0x58')]=_0x3b4ca0;return _0x28c092;});}})[_0xd339('0x35')](respondWithFilteredResult(_0x33cc94,_0x2f4f07))['catch'](handleError(_0x33cc94,null));};exports[_0xd339('0x126')]=function(_0x1b1fcb,_0x211b9b,_0x3a3ded){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x1b1fcb[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x211b9b,null))[_0xd339('0x35')](function(_0x31fb07){if(_0x31fb07){return _0x31fb07[_0xd339('0x126')](_0x1b1fcb[_0xd339('0x63')][_0xd339('0x69')],_[_0xd339('0xf8')](_0x1b1fcb['body'],['ids','id'])||{})['spread'](function(_0x1f2fa8){for(var _0x40b1eb=0x0;_0x40b1eb<_0x1b1fcb[_0xd339('0x63')]['ids'][_0xd339('0x4a')];_0x40b1eb+=0x1){socket[_0xd339('0x127')]('userChatWebsite:save',{'UserId':Number(_0x1b1fcb[_0xd339('0x63')][_0xd339('0x69')][_0x40b1eb]),'ChatWebsiteId':Number(_0x1b1fcb[_0xd339('0x5a')]['id'])});}return _0x1f2fa8;});}})[_0xd339('0x35')](respondWithResult(_0x211b9b,null))['catch'](handleError(_0x211b9b,null));};exports[_0xd339('0x128')]=function(_0x2fda4f,_0x3e197d,_0x17e1ec){return db[_0xd339('0x40')][_0xd339('0x5c')]({'where':{'id':_0x2fda4f[_0xd339('0x5a')]['id']}})[_0xd339('0x35')](handleEntityNotFound(_0x3e197d,null))['then'](function(_0x541e1f){if(_0x541e1f){return _0x541e1f[_0xd339('0x128')](_0x2fda4f[_0xd339('0x45')][_0xd339('0x69')])[_0xd339('0x35')](function(){if(_[_0xd339('0x129')](_0x2fda4f[_0xd339('0x45')][_0xd339('0x69')])){for(var _0x540e5e=0x0;_0x540e5e<_0x2fda4f[_0xd339('0x45')]['ids'][_0xd339('0x4a')];_0x540e5e+=0x1){socket[_0xd339('0x127')](_0xd339('0x12a'),{'UserId':Number(_0x2fda4f[_0xd339('0x45')][_0xd339('0x69')][_0x540e5e]),'ChatWebsiteId':Number(_0x2fda4f['params']['id'])});}}else{socket[_0xd339('0x127')](_0xd339('0x12a'),{'UserId':Number(_0x2fda4f['query'][_0xd339('0x69')]),'ChatWebsiteId':Number(_0x2fda4f[_0xd339('0x5a')]['id'])});}});}})[_0xd339('0x35')](respondWithStatusCode(_0x3e197d,null))[_0xd339('0x2a')](handleError(_0x3e197d,null));};exports[_0xd339('0x12b')]=function(_0x3e87af,_0x43f4cd,_0x1d31c3){var _0x4fbb3b={};var _0x2f9d0c={};var _0x28ae06;var _0xfc3514;return db[_0xd339('0x40')][_0xd339('0x6d')]({'where':{'id':_0x3e87af[_0xd339('0x5a')]['id']}})['then'](handleEntityNotFound(_0x43f4cd,null))[_0xd339('0x35')](function(_0x5602c3){if(_0x5602c3){_0x28ae06=_0x5602c3;_0x2f9d0c[_0xd339('0x48')]=_[_0xd339('0x46')](db['User'][_0xd339('0x41')]);_0x2f9d0c[_0xd339('0x45')]=_[_0xd339('0x46')](_0x3e87af[_0xd339('0x45')]);_0x2f9d0c['filters']=_[_0xd339('0x47')](_0x2f9d0c[_0xd339('0x48')],_0x2f9d0c[_0xd339('0x45')]);_0x4fbb3b[_0xd339('0x49')]=_[_0xd339('0x47')](_0x2f9d0c['model'],qs[_0xd339('0x5b')](_0x3e87af['query'][_0xd339('0x5b')]));_0x4fbb3b[_0xd339('0x49')]=_0x4fbb3b[_0xd339('0x49')][_0xd339('0x4a')]?_0x4fbb3b[_0xd339('0x49')]:_0x2f9d0c[_0xd339('0x48')];_0x4fbb3b['order']=qs['sort'](_0x3e87af[_0xd339('0x45')]['sort']);_0x4fbb3b['where']=qs['filters'](_[_0xd339('0x4e')](_0x3e87af[_0xd339('0x45')],_0x2f9d0c[_0xd339('0x4f')]));if(_0x3e87af[_0xd339('0x45')][_0xd339('0x50')]){_0x4fbb3b[_0xd339('0x51')]=_['merge'](_0x4fbb3b['where'],{'$or':_[_0xd339('0x3f')](_0x4fbb3b[_0xd339('0x49')],function(_0x34aa44){var _0x59e7ca={};_0x59e7ca[_0x34aa44]={'$like':'%'+_0x3e87af['query'][_0xd339('0x50')]+'%'};return _0x59e7ca;})});}_0x4fbb3b=_[_0xd339('0x52')]({},_0x4fbb3b,_0x3e87af[_0xd339('0x54')]);return _0x28ae06[_0xd339('0x12b')](_0x4fbb3b);}})[_0xd339('0x35')](function(_0x6b9245){if(_0x6b9245){_0xfc3514=_0x6b9245[_0xd339('0x4a')];if(!_0x3e87af[_0xd339('0x45')][_0xd339('0x67')]('nolimit')){_0x4fbb3b[_0xd339('0x2c')]=qs[_0xd339('0x2c')](_0x3e87af['query']['limit']);_0x4fbb3b[_0xd339('0x2f')]=qs['offset'](_0x3e87af[_0xd339('0x45')]['offset']);}return _0x28ae06[_0xd339('0x12b')](_0x4fbb3b);}})[_0xd339('0x35')](function(_0x52bf70){if(_0x52bf70){return _0x52bf70?{'count':_0xfc3514,'rows':_0x52bf70}:null;}})['then'](respondWithResult(_0x43f4cd,null))[_0xd339('0x2a')](handleError(_0x43f4cd,null));}; \ No newline at end of file +var _0xb88d=['notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','findAll','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','textColor','backgroundColor','addApplications','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','map','VIRTUAL','filter','where','includeAll','include','rows','show','options','find','create','body','user','role','userProfileId','params','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','sitepic','custom','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','interaction','ChatInteraction','spread','contact','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','CompanyId','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','MailAccountId','toPairsIn','mapValues','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount'];(function(_0x2e074d,_0x51deb9){var _0x50fdad=function(_0x4f6c9d){while(--_0x4f6c9d){_0x2e074d['push'](_0x2e074d['shift']());}};_0x50fdad(++_0x51deb9);}(_0xb88d,0x177));var _0xdb88=function(_0x2ba022,_0x59cad3){_0x2ba022=_0x2ba022-0x0;var _0x2bc6ca=_0xb88d[_0x2ba022];return _0x2bc6ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdb88('0x0'));var jsonpatch=require(_0xdb88('0x1'));var rp=require(_0xdb88('0x2'));var moment=require(_0xdb88('0x3'));var BPromise=require(_0xdb88('0x4'));var Mustache=require(_0xdb88('0x5'));var util=require(_0xdb88('0x6'));var path=require(_0xdb88('0x7'));var sox=require(_0xdb88('0x8'));var csv=require(_0xdb88('0x9'));var ejs=require(_0xdb88('0xa'));var fs=require('fs');var fs_extra=require(_0xdb88('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb88('0xc'));var jsforce=require(_0xdb88('0xd'));var deskjs=require(_0xdb88('0xe'));var toCsv=require(_0xdb88('0x9'));var querystring=require(_0xdb88('0xf'));var Papa=require(_0xdb88('0x10'));var Redis=require(_0xdb88('0x11'));var authService=require(_0xdb88('0x12'));var qs=require(_0xdb88('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb88('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdb88('0x15'));var licenseUtil=require(_0xdb88('0x16'));var db=require(_0xdb88('0x17'))['db'];config[_0xdb88('0x18')]=_[_0xdb88('0x19')](config['redis'],{'host':_0xdb88('0x1a'),'port':0x18eb});var socket=require(_0xdb88('0x1b'))(new Redis(config[_0xdb88('0x18')]));require(_0xdb88('0x1c'))[_0xdb88('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdb88('0x1e')][_0xdb88('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdb88('0x1f')]({'port':0x232a});var client9003=jayson['client'][_0xdb88('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0xdb88('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x531c74,_0x24f7ba,_0x1f1001,_0x210131){return new BPromise(function(_0x747d75,_0x4fd602){var _0x35b6c5=_0x210131||client;return _0x35b6c5[_0xdb88('0x20')](_0x531c74,_0x1f1001)[_0xdb88('0x21')](function(_0x443e2d){logger[_0xdb88('0x22')](_0xdb88('0x23'),_0x24f7ba,_0xdb88('0x24'));logger[_0xdb88('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x24f7ba,_0xdb88('0x24'),JSON[_0xdb88('0x26')](_0x443e2d));if(_0x443e2d[_0xdb88('0x27')]){if(_0x443e2d[_0xdb88('0x27')]['code']===0x1f4){logger[_0xdb88('0x27')](_0xdb88('0x23'),_0x24f7ba,_0x443e2d['error'][_0xdb88('0x28')]);return _0x4fd602(_0x443e2d[_0xdb88('0x27')][_0xdb88('0x28')]);}logger[_0xdb88('0x27')](_0xdb88('0x23'),_0x24f7ba,_0x443e2d['error'][_0xdb88('0x28')]);return _0x747d75(_0x443e2d[_0xdb88('0x27')]['message']);}else{logger[_0xdb88('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x24f7ba,'request\x20sent');_0x747d75(_0x443e2d[_0xdb88('0x29')][_0xdb88('0x28')]);}})[_0xdb88('0x2a')](function(_0x58be5c){logger['error'](_0xdb88('0x23'),_0x24f7ba,_0x58be5c);_0x4fd602(_0x58be5c);});});}function respondWithStatusCode(_0x47fbcf,_0x124c23){_0x124c23=_0x124c23||0xcc;return function(_0x4f4e69){if(_0x4f4e69){return _0x47fbcf[_0xdb88('0x2b')](_0x124c23);}return _0x47fbcf[_0xdb88('0x2c')](_0x124c23)[_0xdb88('0x2d')]();};}function respondWithResult(_0xa159fd,_0x31f3c2){_0x31f3c2=_0x31f3c2||0xc8;return function(_0x1f0358){if(_0x1f0358){return _0xa159fd[_0xdb88('0x2c')](_0x31f3c2)[_0xdb88('0x2e')](_0x1f0358);}};}function respondWithFilteredResult(_0x2df3b7,_0x21e347){return function(_0x2e455a){if(_0x2e455a){var _0x17144b=typeof _0x21e347[_0xdb88('0x2f')]==='undefined'&&typeof _0x21e347[_0xdb88('0x30')]==='undefined';var _0xac8d13=_0x2e455a[_0xdb88('0x31')];var _0x4bd865=_0x17144b?0x0:_0x21e347[_0xdb88('0x2f')];var _0x32c04c=_0x17144b?_0x2e455a[_0xdb88('0x31')]:_0x21e347['offset']+_0x21e347[_0xdb88('0x30')];var _0x740f0d;if(_0x32c04c>=_0xac8d13){_0x32c04c=_0xac8d13;_0x740f0d=0xc8;}else{_0x740f0d=0xce;}_0x2df3b7['status'](_0x740f0d);return _0x2df3b7['set'](_0xdb88('0x32'),_0x4bd865+'-'+_0x32c04c+'/'+_0xac8d13)['json'](_0x2e455a);}return null;};}function patchUpdates(_0xc80009){return function(_0x39feac){try{jsonpatch[_0xdb88('0x33')](_0x39feac,_0xc80009,!![]);}catch(_0x4306e7){return BPromise[_0xdb88('0x34')](_0x4306e7);}return _0x39feac['save']();};}function saveUpdates(_0x4e538a,_0x341506){return function(_0x27d00a){if(_0x27d00a){return _0x27d00a[_0xdb88('0x35')](_0x4e538a)[_0xdb88('0x21')](function(_0x417ae2){return _0x417ae2;});}return null;};}function removeEntity(_0x4d3b64,_0x5da618){return function(_0x43aec7){if(_0x43aec7){return _0x43aec7[_0xdb88('0x36')]()[_0xdb88('0x21')](function(){var _0x46d2d4=_0x43aec7[_0xdb88('0x37')]({'plain':!![]});var _0x24dfcd=_0xdb88('0x38');return db[_0xdb88('0x39')][_0xdb88('0x36')]({'where':{'type':_0x24dfcd,'resourceId':_0x46d2d4['id']}})[_0xdb88('0x21')](function(){return _0x43aec7;});})['then'](function(){_0x4d3b64[_0xdb88('0x2c')](0xcc)[_0xdb88('0x2d')]();});}};}function handleEntityNotFound(_0x495d2a,_0xba9505){return function(_0x50aa03){if(!_0x50aa03){_0x495d2a['sendStatus'](0x194);}return _0x50aa03;};}function handleError(_0x1d9b56,_0x31acab){_0x31acab=_0x31acab||0x1f4;return function(_0xc5b04d){logger[_0xdb88('0x27')](_0xc5b04d[_0xdb88('0x3a')]);if(_0xc5b04d[_0xdb88('0x3b')]){delete _0xc5b04d[_0xdb88('0x3b')];}_0x1d9b56[_0xdb88('0x2c')](_0x31acab)['send'](_0xc5b04d);};}exports[_0xdb88('0x3c')]=function(_0x164db4,_0x577a1c){var _0x1a39ec={'include':[{'model':db[_0xdb88('0x3d')],'as':_0xdb88('0x3e')}]},_0x80e660={},_0x511eba={'count':0x0,'rows':[]};var _0x59ad0a=_['map'](db[_0xdb88('0x3f')][_0xdb88('0x40')],function(_0x733f60){return{'name':_0x733f60[_0xdb88('0x41')],'type':_0x733f60[_0xdb88('0x42')][_0xdb88('0x43')]};});_0x80e660['model']=_['map'](_0x59ad0a,'name');_0x80e660['query']=_[_0xdb88('0x44')](_0x164db4[_0xdb88('0x45')]);_0x80e660[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x80e660[_0xdb88('0x48')],_0x80e660[_0xdb88('0x45')]);_0x1a39ec[_0xdb88('0x49')]=_[_0xdb88('0x47')](_0x80e660['model'],qs['fields'](_0x164db4[_0xdb88('0x45')][_0xdb88('0x4a')]));_0x1a39ec[_0xdb88('0x49')]=_0x1a39ec[_0xdb88('0x49')][_0xdb88('0x4b')]?_0x1a39ec[_0xdb88('0x49')]:_0x80e660[_0xdb88('0x48')];if(!_0x164db4[_0xdb88('0x45')][_0xdb88('0x4c')]('nolimit')){_0x1a39ec[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x164db4[_0xdb88('0x45')]['limit']);_0x1a39ec[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x164db4['query'][_0xdb88('0x2f')]);}_0x1a39ec[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x164db4[_0xdb88('0x45')][_0xdb88('0x4e')]);_0x1a39ec['where']=qs['filters'](_[_0xdb88('0x4f')](_0x164db4[_0xdb88('0x45')],_0x80e660[_0xdb88('0x46')]),_0x59ad0a);if(_0x164db4[_0xdb88('0x45')]['filter']){_0x1a39ec['where']=_[_0xdb88('0x50')](_0x1a39ec['where'],{'$or':_[_0xdb88('0x51')](_0x59ad0a,function(_0x1f8f18){if(_0x1f8f18[_0xdb88('0x42')]!==_0xdb88('0x52')){var _0xc10dc4={};_0xc10dc4[_0x1f8f18[_0xdb88('0x3b')]]={'$like':'%'+_0x164db4[_0xdb88('0x45')][_0xdb88('0x53')]+'%'};return _0xc10dc4;}})});}_0x1a39ec=_['merge']({},_0x1a39ec,_0x164db4['options']);var _0x56fa1c={'where':_0x1a39ec[_0xdb88('0x54')]};return db[_0xdb88('0x3f')][_0xdb88('0x31')](_0x56fa1c)[_0xdb88('0x21')](function(_0x271709){_0x511eba[_0xdb88('0x31')]=_0x271709;if(_0x164db4[_0xdb88('0x45')][_0xdb88('0x55')]){_0x1a39ec[_0xdb88('0x56')]=[{'all':!![]}];}return db[_0xdb88('0x3f')]['findAll'](_0x1a39ec);})[_0xdb88('0x21')](function(_0x3e3e2e){_0x511eba[_0xdb88('0x57')]=_0x3e3e2e;return _0x511eba;})[_0xdb88('0x21')](respondWithFilteredResult(_0x577a1c,_0x1a39ec))[_0xdb88('0x2a')](handleError(_0x577a1c,null));};exports[_0xdb88('0x58')]=function(_0x1f474e,_0x219dca){var _0x1dc4b2={'raw':![],'where':{'id':_0x1f474e['params']['id']},'include':[{'model':db['Pause'],'as':_0xdb88('0x3e')}]},_0x32f2d7={};_0x32f2d7[_0xdb88('0x48')]=_['keys'](db['ChatWebsite'][_0xdb88('0x40')]);_0x32f2d7['query']=_[_0xdb88('0x44')](_0x1f474e[_0xdb88('0x45')]);_0x32f2d7[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x32f2d7[_0xdb88('0x48')],_0x32f2d7[_0xdb88('0x45')]);_0x1dc4b2['attributes']=_['intersection'](_0x32f2d7['model'],qs[_0xdb88('0x4a')](_0x1f474e['query'][_0xdb88('0x4a')]));_0x1dc4b2[_0xdb88('0x49')]=_0x1dc4b2['attributes'][_0xdb88('0x4b')]?_0x1dc4b2[_0xdb88('0x49')]:_0x32f2d7[_0xdb88('0x48')];if(_0x1f474e['query'][_0xdb88('0x55')]){_0x1dc4b2[_0xdb88('0x56')]=[{'all':!![]}];}_0x1dc4b2=_[_0xdb88('0x50')]({},_0x1dc4b2,_0x1f474e[_0xdb88('0x59')]);return db[_0xdb88('0x3f')][_0xdb88('0x5a')](_0x1dc4b2)[_0xdb88('0x21')](handleEntityNotFound(_0x219dca,null))[_0xdb88('0x21')](respondWithResult(_0x219dca,null))[_0xdb88('0x2a')](handleError(_0x219dca,null));};exports['create']=function(_0x2be431,_0x2f945e){return db[_0xdb88('0x3f')][_0xdb88('0x5b')](_0x2be431[_0xdb88('0x5c')],{})[_0xdb88('0x21')](function(_0x262611){var _0xbc3b99=_0x2be431[_0xdb88('0x5d')][_0xdb88('0x37')]({'plain':!![]});if(!_0xbc3b99)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbc3b99[_0xdb88('0x5e')]===_0xdb88('0x5d')){var _0x2b6e86=_0x262611[_0xdb88('0x37')]({'plain':!![]});var _0x46d2d8=_0xdb88('0x38');return db['UserProfileSection'][_0xdb88('0x5a')]({'where':{'name':_0x46d2d8,'userProfileId':_0xbc3b99[_0xdb88('0x5f')]},'raw':!![]})[_0xdb88('0x21')](function(_0x286075){if(_0x286075&&_0x286075['autoAssociation']===0x0){return db[_0xdb88('0x39')][_0xdb88('0x5b')]({'name':_0x2b6e86[_0xdb88('0x3b')],'resourceId':_0x2b6e86['id'],'type':_0x286075[_0xdb88('0x3b')],'sectionId':_0x286075['id']},{})[_0xdb88('0x21')](function(){return _0x262611;});}else{return _0x262611;}})[_0xdb88('0x2a')](function(_0xb555c4){logger[_0xdb88('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb555c4);throw _0xb555c4;});}return _0x262611;})[_0xdb88('0x21')](respondWithResult(_0x2f945e,0xc9))[_0xdb88('0x2a')](handleError(_0x2f945e,null));};exports[_0xdb88('0x35')]=function(_0x5449a0,_0xd6d56a){if(_0x5449a0[_0xdb88('0x5c')]['id']){delete _0x5449a0[_0xdb88('0x5c')]['id'];}return db['ChatWebsite'][_0xdb88('0x5a')]({'where':{'id':_0x5449a0[_0xdb88('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xdb88('0x3e')}]})[_0xdb88('0x21')](handleEntityNotFound(_0xd6d56a,null))[_0xdb88('0x21')](saveUpdates(_0x5449a0[_0xdb88('0x5c')],null))[_0xdb88('0x21')](respondWithResult(_0xd6d56a,null))[_0xdb88('0x2a')](handleError(_0xd6d56a,null));};exports[_0xdb88('0x36')]=function(_0x3ffeab,_0xc81cb4){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x3ffeab[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0xc81cb4,null))['then'](removeEntity(_0xc81cb4,null))[_0xdb88('0x2a')](handleError(_0xc81cb4,null));};exports[_0xdb88('0x61')]=function(_0x246ac9,_0x12ee9c){return db['ChatWebsite'][_0xdb88('0x61')]()[_0xdb88('0x21')](respondWithResult(_0x12ee9c,null))[_0xdb88('0x2a')](handleError(_0x12ee9c,null));};exports[_0xdb88('0x62')]=function(_0x6102fd,_0xf82b49,_0xba3e26){if(_0x6102fd['body']['id']){delete _0x6102fd[_0xdb88('0x5c')]['id'];}return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x6102fd[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0xf82b49,null))[_0xdb88('0x21')](function(_0x4ba008){if(_0x4ba008){_0x6102fd[_0xdb88('0x5c')]['ChatWebsiteId']=_0x4ba008['id'];return db['Disposition'][_0xdb88('0x5b')](_0x6102fd[_0xdb88('0x5c')]);}})['then'](respondWithResult(_0xf82b49,null))['catch'](handleError(_0xf82b49,null));};exports[_0xdb88('0x63')]=function(_0x4e3c53,_0x3f1372,_0x33bb75){var _0x4fbf02={'raw':![],'where':{}};var _0x3ca670={};var _0x3fac22={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdb88('0x64')]({'where':{'id':_0x4e3c53['params']['id']}})['then'](handleEntityNotFound(_0x3f1372,null))['then'](function(_0x180933){if(_0x180933){_0x3ca670[_0xdb88('0x48')]=_['keys'](db[_0xdb88('0x65')][_0xdb88('0x40')]);_0x3ca670[_0xdb88('0x45')]=_[_0xdb88('0x44')](_0x4e3c53[_0xdb88('0x45')]);_0x3ca670[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x3ca670[_0xdb88('0x48')],_0x3ca670[_0xdb88('0x45')]);_0x4fbf02[_0xdb88('0x49')]=_['intersection'](_0x3ca670[_0xdb88('0x48')],qs[_0xdb88('0x4a')](_0x4e3c53[_0xdb88('0x45')]['fields']));_0x4fbf02['attributes']=_0x4fbf02['attributes'][_0xdb88('0x4b')]?_0x4fbf02['attributes']:_0x3ca670[_0xdb88('0x48')];if(!_0x4e3c53[_0xdb88('0x45')][_0xdb88('0x4c')](_0xdb88('0x66'))){_0x4fbf02[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x4e3c53[_0xdb88('0x45')][_0xdb88('0x30')]);_0x4fbf02[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x4e3c53[_0xdb88('0x45')]['offset']);}_0x4fbf02[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x4e3c53[_0xdb88('0x45')]['sort']);_0x4fbf02['where']=qs[_0xdb88('0x46')](_['pick'](_0x4e3c53[_0xdb88('0x45')],_0x3ca670[_0xdb88('0x46')]));_0x4fbf02[_0xdb88('0x54')]['ChatWebsiteId']=_0x180933['id'];if(_0x4e3c53[_0xdb88('0x45')][_0xdb88('0x53')]){_0x4fbf02[_0xdb88('0x54')]=_[_0xdb88('0x50')](_0x4fbf02[_0xdb88('0x54')],{'$or':_[_0xdb88('0x51')](_0x4fbf02[_0xdb88('0x49')],function(_0x5501b4){var _0x1f8a2d={};_0x1f8a2d[_0x5501b4]={'$like':'%'+_0x4e3c53['query'][_0xdb88('0x53')]+'%'};return _0x1f8a2d;})});}_0x4fbf02=_[_0xdb88('0x50')]({},_0x4fbf02,_0x4e3c53['options']);return db[_0xdb88('0x65')][_0xdb88('0x31')]({'where':_0x4fbf02[_0xdb88('0x54')]})[_0xdb88('0x21')](function(_0x1e5f8e){_0x3fac22[_0xdb88('0x31')]=_0x1e5f8e;if(_0x4e3c53[_0xdb88('0x45')]['includeAll']){_0x4fbf02[_0xdb88('0x56')]=[{'all':!![]}];}return db[_0xdb88('0x65')]['findAll'](_0x4fbf02);})[_0xdb88('0x21')](function(_0x368812){_0x3fac22['rows']=_0x368812;return _0x3fac22;});}})[_0xdb88('0x21')](respondWithFilteredResult(_0x3f1372,_0x4fbf02))['catch'](handleError(_0x3f1372,null));};exports['removeDispositions']=function(_0x3f47fe,_0x2fd412,_0x57a34b){return db[_0xdb88('0x3f')]['find']({'where':{'id':_0x3f47fe[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x2fd412,null))[_0xdb88('0x21')](function(_0x5a7274){if(_0x5a7274){return _0x5a7274['removeDispositions'](_0x3f47fe[_0xdb88('0x45')][_0xdb88('0x67')]);}})[_0xdb88('0x21')](respondWithStatusCode(_0x2fd412,null))[_0xdb88('0x2a')](handleError(_0x2fd412,null));};exports[_0xdb88('0x68')]=function(_0x5bbbd5,_0x5c4585,_0x34471d){if(_0x5bbbd5[_0xdb88('0x5c')]['id']){delete _0x5bbbd5[_0xdb88('0x5c')]['id'];}return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x5bbbd5[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x5c4585,null))[_0xdb88('0x21')](function(_0x2b7330){if(_0x2b7330){_0x5bbbd5['body'][_0xdb88('0x69')]=_0x2b7330['id'];return db[_0xdb88('0x6a')][_0xdb88('0x5b')](_0x5bbbd5[_0xdb88('0x5c')]);}})[_0xdb88('0x21')](respondWithResult(_0x5c4585,null))['catch'](handleError(_0x5c4585,null));};exports[_0xdb88('0x6b')]=function(_0x46a71d,_0x3df330,_0x58c8d6){var _0x185c91={'raw':![],'where':{}};var _0x250253={};var _0x582ae9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x46a71d['params']['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x3df330,null))[_0xdb88('0x21')](function(_0x182f1b){if(_0x182f1b){_0x250253[_0xdb88('0x48')]=_[_0xdb88('0x44')](db[_0xdb88('0x6a')]['rawAttributes']);_0x250253[_0xdb88('0x45')]=_[_0xdb88('0x44')](_0x46a71d[_0xdb88('0x45')]);_0x250253[_0xdb88('0x46')]=_['intersection'](_0x250253['model'],_0x250253[_0xdb88('0x45')]);_0x185c91[_0xdb88('0x49')]=_[_0xdb88('0x47')](_0x250253[_0xdb88('0x48')],qs[_0xdb88('0x4a')](_0x46a71d[_0xdb88('0x45')][_0xdb88('0x4a')]));_0x185c91[_0xdb88('0x49')]=_0x185c91['attributes']['length']?_0x185c91[_0xdb88('0x49')]:_0x250253[_0xdb88('0x48')];if(!_0x46a71d['query'][_0xdb88('0x4c')](_0xdb88('0x66'))){_0x185c91[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x46a71d[_0xdb88('0x45')][_0xdb88('0x30')]);_0x185c91[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x46a71d['query'][_0xdb88('0x2f')]);}_0x185c91[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x46a71d[_0xdb88('0x45')]['sort']);_0x185c91[_0xdb88('0x54')]=qs['filters'](_[_0xdb88('0x4f')](_0x46a71d[_0xdb88('0x45')],_0x250253['filters']));_0x185c91['where'][_0xdb88('0x69')]=_0x182f1b['id'];if(_0x46a71d[_0xdb88('0x45')][_0xdb88('0x53')]){_0x185c91[_0xdb88('0x54')]=_[_0xdb88('0x50')](_0x185c91['where'],{'$or':_[_0xdb88('0x51')](_0x185c91[_0xdb88('0x49')],function(_0x16ce2b){var _0x5ca0c7={};_0x5ca0c7[_0x16ce2b]={'$like':'%'+_0x46a71d[_0xdb88('0x45')][_0xdb88('0x53')]+'%'};return _0x5ca0c7;})});}_0x185c91=_[_0xdb88('0x50')]({},_0x185c91,_0x46a71d[_0xdb88('0x59')]);return db[_0xdb88('0x6a')]['count']({'where':_0x185c91['where']})['then'](function(_0x4800ff){_0x582ae9['count']=_0x4800ff;if(_0x46a71d['query'][_0xdb88('0x55')]){_0x185c91[_0xdb88('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x185c91);})[_0xdb88('0x21')](function(_0x3786c9){_0x582ae9[_0xdb88('0x57')]=_0x3786c9;return _0x582ae9;});}})[_0xdb88('0x21')](respondWithFilteredResult(_0x3df330,_0x185c91))['catch'](handleError(_0x3df330,null));};exports[_0xdb88('0x6c')]=function(_0x13f824,_0x111ce0,_0x431ca0){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x13f824[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x111ce0,null))[_0xdb88('0x21')](function(_0x355cf7){if(_0x355cf7){return _0x355cf7[_0xdb88('0x6c')](_0x13f824[_0xdb88('0x45')][_0xdb88('0x67')]);}})[_0xdb88('0x21')](respondWithStatusCode(_0x111ce0,null))[_0xdb88('0x2a')](handleError(_0x111ce0,null));};exports[_0xdb88('0x6d')]=function(_0x14f511,_0x88e219,_0x4ae380){_0x14f511['body']['sitepic']=_0x14f511[_0xdb88('0x6e')][_0xdb88('0x6f')];return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x14f511[_0xdb88('0x60')]['id']}})['then'](handleEntityNotFound(_0x88e219,null))[_0xdb88('0x21')](saveUpdates(_0x14f511[_0xdb88('0x5c')],null))[_0xdb88('0x21')](respondWithResult(_0x88e219,null))['catch'](handleError(_0x88e219,null));};exports[_0xdb88('0x70')]=function(_0x43e4fd,_0x19cc16,_0x3a205c){_0x43e4fd[_0xdb88('0x5c')][_0xdb88('0x71')]=_0x43e4fd[_0xdb88('0x6e')][_0xdb88('0x6f')];return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x43e4fd[_0xdb88('0x60')]['id']}})['then'](handleEntityNotFound(_0x19cc16,null))[_0xdb88('0x21')](saveUpdates(_0x43e4fd[_0xdb88('0x5c')],null))['then'](respondWithResult(_0x19cc16,null))[_0xdb88('0x2a')](handleError(_0x19cc16,null));};exports['addCustomerAvatar']=function(_0x19d753,_0x3020f4,_0xf5c9e4){_0x19d753['body']['customerAvatar']=_0x19d753[_0xdb88('0x6e')][_0xdb88('0x6f')];return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x19d753[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x3020f4,null))['then'](saveUpdates(_0x19d753['body'],null))['then'](respondWithResult(_0x3020f4,null))[_0xdb88('0x2a')](handleError(_0x3020f4,null));};exports[_0xdb88('0x72')]=function(_0x307a72,_0x5a02af,_0x268e67){_0x307a72[_0xdb88('0x5c')][_0xdb88('0x73')]=_0x307a72[_0xdb88('0x6e')]['filename'];return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x307a72['params']['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x5a02af,null))[_0xdb88('0x21')](saveUpdates(_0x307a72[_0xdb88('0x5c')],null))[_0xdb88('0x21')](respondWithResult(_0x5a02af,null))[_0xdb88('0x2a')](handleError(_0x5a02af,null));};exports[_0xdb88('0x74')]=function(_0x12b9ea,_0x1ea1f8,_0x22e5df){var _0x3b8191=path[_0xdb88('0x75')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2d61d8={'where':{'id':_0x12b9ea[_0xdb88('0x60')]['id']},'attributes':['id',_0xdb88('0x76')],'raw':!![]};var _0x20a65c=![];return require('../../config/license/util')['getLicense']()[_0xdb88('0x21')](function(_0x24b461){if(_0x24b461){_0x20a65c=_0x24b461[_0xdb88('0x77')];}})[_0xdb88('0x21')](function(){return db[_0xdb88('0x3f')][_0xdb88('0x5a')](_0x2d61d8);})['then'](handleEntityNotFound(_0x1ea1f8,null))[_0xdb88('0x21')](function(_0x9d2930){if(_0x9d2930){if(!_['isNil'](_0x9d2930[_0xdb88('0x76')])){if(fs[_0xdb88('0x78')](path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x7a'),_0x9d2930[_0xdb88('0x76')]))&&_0x20a65c){_0x3b8191=path['join'](config[_0xdb88('0x79')],'server/files/images/logos/',_0x9d2930[_0xdb88('0x76')]);}}return _0x1ea1f8[_0xdb88('0x7b')](_0x3b8191);}})['catch'](handleError(_0x1ea1f8,null));};exports[_0xdb88('0x7c')]=function(_0x5d2188,_0x565543,_0x152fe4){var _0x16fff7=path['join'](config[_0xdb88('0x79')],_0xdb88('0x7d'));var _0x4ec16a={'where':{'id':_0x5d2188[_0xdb88('0x60')]['id']},'attributes':['id',_0xdb88('0x71')],'raw':!![]};return db[_0xdb88('0x3f')][_0xdb88('0x5a')](_0x4ec16a)[_0xdb88('0x21')](handleEntityNotFound(_0x565543,null))[_0xdb88('0x21')](function(_0x309710){if(_0x309710){if(!_[_0xdb88('0x7e')](_0x309710['agentAvatar'])){if(fs[_0xdb88('0x78')](path[_0xdb88('0x75')](config[_0xdb88('0x79')],'server/files/images/avatars/',_0x309710[_0xdb88('0x71')]))){_0x16fff7=path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x7f'),_0x309710[_0xdb88('0x71')]);}}return _0x565543[_0xdb88('0x7b')](_0x16fff7);}})[_0xdb88('0x2a')](handleError(_0x565543,null));};exports[_0xdb88('0x80')]=function(_0x197857,_0x2a7ae8,_0x203001){var _0x4e4e64=path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x81'));var _0x233f3f={'where':{'id':_0x197857[_0xdb88('0x60')]['id']},'attributes':['id','customerAvatar',_0xdb88('0x82')],'raw':!![]};return db['ChatWebsite'][_0xdb88('0x5a')](_0x233f3f)['then'](handleEntityNotFound(_0x2a7ae8,null))[_0xdb88('0x21')](function(_0xc60aa3){if(_0xc60aa3){if(!_[_0xdb88('0x7e')](_0xc60aa3[_0xdb88('0x83')])){if(fs[_0xdb88('0x78')](path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x7f'),_0xc60aa3[_0xdb88('0x83')]))&&_0xc60aa3['showCustomerAvatar']){_0x4e4e64=path[_0xdb88('0x75')](config['root'],_0xdb88('0x7f'),_0xc60aa3[_0xdb88('0x83')]);}}return _0x2a7ae8[_0xdb88('0x7b')](_0x4e4e64);}})[_0xdb88('0x2a')](handleError(_0x2a7ae8,null));};exports[_0xdb88('0x84')]=function(_0x33359d,_0x2b7b89,_0x96823f){var _0xd3f601=path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x85'));var _0x4954a6={'where':{'id':_0x33359d[_0xdb88('0x60')]['id']},'attributes':['id',_0xdb88('0x73')],'raw':!![]};return db[_0xdb88('0x3f')][_0xdb88('0x5a')](_0x4954a6)['then'](handleEntityNotFound(_0x2b7b89,null))[_0xdb88('0x21')](function(_0xf6b9d7){if(_0xf6b9d7){if(!_[_0xdb88('0x7e')](_0xf6b9d7['systemAvatar'])){if(fs['existsSync'](path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x7f'),_0xf6b9d7[_0xdb88('0x73')]))){_0xd3f601=path[_0xdb88('0x75')](config[_0xdb88('0x79')],_0xdb88('0x7f'),_0xf6b9d7[_0xdb88('0x73')]);}}return _0x2b7b89['download'](_0xd3f601);}})[_0xdb88('0x2a')](handleError(_0x2b7b89,null));};exports[_0xdb88('0x86')]=function(_0x33f2f2,_0xabc34,_0x2d3f4b){var _0x24e0fc=require(_0xdb88('0x87'));var _0x147aab=new _0x24e0fc();var _0x48aa7a=_0x147aab[_0xdb88('0x88')](_0x33f2f2[_0xdb88('0x89')][_0xdb88('0x8a')])[_0xdb88('0x8b')]();var _0x2f0e3e={'body':_0x33f2f2[_0xdb88('0x5c')],'channel':_0xdb88('0x8c')};var _0x1ae9e4=[];var _0x2028b2=[];var _0x131f13={};var _0x5047fb=![];return db[_0xdb88('0x8d')][_0xdb88('0x61')]()[_0xdb88('0x21')](function(_0x5bc963){if(!_0x5bc963){throw new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0x90'));}_0x1ae9e4=_['difference'](_['keys'](_0x5bc963),[_0xdb88('0x91'),'updatedAt']);_0x2028b2=_['difference'](_[_0xdb88('0x44')](_0x5bc963),['createdAt',_0xdb88('0x92'),'CompanyId','ListId']);if(_0x33f2f2[_0xdb88('0x5c')]['id']){delete _0x33f2f2[_0xdb88('0x5c')]['id'];}if(_[_0xdb88('0x7e')](_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0x93')])){throw new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0x94'));}if(_[_0xdb88('0x7e')](_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0x5c')])||_0x33f2f2[_0xdb88('0x5c')]['body']===''){throw new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0x95'));}if(_['isNil'](_0x33f2f2[_0xdb88('0x5c')]['mapKey'])){throw new db[(_0xdb88('0x8e'))]['ValidationError'](_0xdb88('0x96')+_0x2028b2);}if(!_[_0xdb88('0x97')](_0x2028b2,_0x33f2f2[_0xdb88('0x5c')]['mapKey'])){throw new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0x98')+_0x2028b2);}_0x131f13[_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0x99')]]=_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0x93')];})['then'](function(){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x33f2f2[_0xdb88('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdb88('0x8d')],'as':_0xdb88('0x9a'),'where':_0x131f13,'limit':0x1,'order':[[_0xdb88('0x92'),_0xdb88('0x9b')]]}]},{'model':db[_0xdb88('0x9c')],'as':_0xdb88('0x9d')}]});})[_0xdb88('0x21')](handleEntityNotFound(_0xabc34,null))[_0xdb88('0x21')](function(_0x5c379e){if(_0x5c379e&&_0x5c379e['List']){_0x2f0e3e[_0xdb88('0x9e')]=_0x5c379e;_0x2f0e3e[_0xdb88('0x9f')]=_0x5c379e[_0xdb88('0x9d')];_0x2f0e3e[_0xdb88('0xa0')]=_0x5c379e[_0xdb88('0xa1')];_0x2f0e3e[_0xdb88('0x9f')]=_[_0xdb88('0xa2')](_0x2f0e3e[_0xdb88('0x9f')],[_0xdb88('0xa3')],[_0xdb88('0xa4')]);if(_0x2f0e3e[_0xdb88('0x9e')]['Applications']){delete _0x2f0e3e['account'][_0xdb88('0x9d')];}if(_0x2f0e3e[_0xdb88('0x9e')]['List']&&_0x2f0e3e[_0xdb88('0x9e')][_0xdb88('0xa1')][_0xdb88('0x9a')][_0xdb88('0x4b')]){return _0x2f0e3e[_0xdb88('0x9e')][_0xdb88('0xa1')][_0xdb88('0x9a')][0x0];}var _0x49598a=_['defaults'](_0x33f2f2['body'],{'firstName':_0x33f2f2[_0xdb88('0x5c')]['from'],'ListId':_0x5c379e['ListId']});_0x49598a[_0x33f2f2[_0xdb88('0x5c')]['mapKey']]=_0x33f2f2[_0xdb88('0x5c')]['from'];return db[_0xdb88('0x8d')][_0xdb88('0x5b')](_0x49598a,{'fields':_0x1ae9e4,'raw':!![]});}})[_0xdb88('0x21')](handleEntityNotFound(_0xabc34,null))[_0xdb88('0x21')](function(_0x5746a3){_0x2f0e3e['contact']=_0x5746a3;var _0x436884=_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xa5')];if(_0x33f2f2[_0xdb88('0x89')]['cf-connecting-ip']){_0x436884=_0x33f2f2['headers'][_0xdb88('0xa6')];}else if(_0x33f2f2[_0xdb88('0x89')][_0xdb88('0xa7')]){_0x436884=_[_0xdb88('0xa8')](_0x33f2f2[_0xdb88('0x89')][_0xdb88('0xa7')]['split'](','));}if(_0x5746a3){var _0x4b70f9={'ContactId':_0x5746a3['id'],'ChatWebsiteId':_0x33f2f2[_0xdb88('0x60')]['id'],'from':(_0x5746a3[_0xdb88('0xa9')]||'')+'\x20'+(_0x5746a3['lastName']||''),'customerIp':_0x436884,'customerPort':_0x33f2f2[_0xdb88('0x89')][_0xdb88('0xaa')]?_0x33f2f2[_0xdb88('0x89')][_0xdb88('0xaa')]:null,'referer':_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xab')],'browserName':_0x48aa7a[_0xdb88('0xac')][_0xdb88('0x3b')]&&_0x48aa7a[_0xdb88('0xac')]['version']?util[_0xdb88('0xad')](_0xdb88('0xae'),_0x48aa7a['browser'][_0xdb88('0x3b')],_0x48aa7a['browser'][_0xdb88('0xaf')]):_0xdb88('0xb0'),'browserVersion':_0x48aa7a[_0xdb88('0xac')][_0xdb88('0xaf')]||_0xdb88('0xb0'),'osName':util['format'](_0xdb88('0xae'),_0x48aa7a['os']['name'],_0x48aa7a['os'][_0xdb88('0xaf')]),'osVersion':_0x48aa7a['os'][_0xdb88('0xaf')],'deviceModel':_0x48aa7a[_0xdb88('0xb1')][_0xdb88('0x48')]&&_0x48aa7a['device'][_0xdb88('0xb2')]?util[_0xdb88('0xad')](_0xdb88('0xb3'),_0x48aa7a['device'][_0xdb88('0x48')],_0x48aa7a['device'][_0xdb88('0xb2')],_0x48aa7a[_0xdb88('0xb1')][_0xdb88('0x42')]):null,'deviceVendor':_0x48aa7a['device']['vendor'],'deviceType':_0x48aa7a['device'][_0xdb88('0x42')],'formData':JSON[_0xdb88('0x26')](_0x33f2f2[_0xdb88('0x5c')])};var _0x5a3c5f={'ChatWebsiteId':_0x33f2f2[_0xdb88('0x60')]['id'],'closed':![]};if(_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xb4')]){_0x5a3c5f[_0xdb88('0xb4')]=_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xb4')];return db['ChatInteraction'][_0xdb88('0x5a')]({'where':_0x5a3c5f})[_0xdb88('0x21')](function(_0xbda0f6){if(_0xbda0f6){return[_0xbda0f6,![]];}_0x4b70f9[_0xdb88('0xb4')]=_0x33f2f2['body'][_0xdb88('0xb4')];_0x4b70f9[_0xdb88('0xb5')]=_0x33f2f2['body'][_0xdb88('0xb5')];return db['ChatInteraction'][_0xdb88('0x5b')](_0x4b70f9)[_0xdb88('0x21')](function(_0x1d6b20){return[_0x1d6b20,!![]];});});}_0x5a3c5f['ContactId']=_0x5746a3['id'];if(_0x33f2f2['body'][_0xdb88('0xb6')]&&_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xb6')]['id']){_0x5a3c5f['id']=_0x33f2f2[_0xdb88('0x5c')]['interaction']['id'];return db[_0xdb88('0xb7')][_0xdb88('0x5a')]({'where':_0x5a3c5f})['then'](function(_0x4e7955){if(_0x4e7955){return[_0x4e7955,![]];}return db[_0xdb88('0xb7')][_0xdb88('0x5b')](_0x4b70f9)[_0xdb88('0x21')](function(_0xe3715f){return[_0xe3715f,!![]];});});}return db[_0xdb88('0xb7')][_0xdb88('0x5b')](_0x4b70f9)[_0xdb88('0x21')](function(_0xe35112){return[_0xe35112,!![]];});}})[_0xdb88('0xb8')](function(_0x3cb585,_0x504304){if(_0x3cb585){_0x5047fb=_0x504304;if(!_0x504304){var _0x5ac4d9={'from':(_0x2f0e3e[_0xdb88('0xb9')][_0xdb88('0xa9')]||'')+'\x20'+(_0x2f0e3e[_0xdb88('0xb9')][_0xdb88('0xba')]||'')};if(_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xb4')]&&_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xbb')]&&_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xb4')]!=_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xbb')]){_0x5ac4d9[_0xdb88('0xb4')]=_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xbb')];}return _0x3cb585[_0xdb88('0x35')](_0x5ac4d9);}else{return _0x3cb585;}}})[_0xdb88('0x21')](function(_0x26e628){_0x2f0e3e[_0xdb88('0xb6')]=_0x26e628[_0xdb88('0x37')]({'plain':!![]});_0x2f0e3e[_0xdb88('0xb6')][_0xdb88('0xbc')]=_0x5047fb;if(_0x2f0e3e[_0xdb88('0xb6')][_0xdb88('0xbc')]){if(_0x2f0e3e[_0xdb88('0x9e')][_0xdb88('0xbd')]){_0x2f0e3e['applications'][_0xdb88('0xbe')]({'id':0x0,'priority':_0x2f0e3e[_0xdb88('0x9f')][_0xdb88('0x4b')]+0x1,'app':'close','appdata':_0xdb88('0xbf'),'interval':_0xdb88('0xc0')});}}return db[_0xdb88('0xc1')][_0xdb88('0x5b')]({'body':_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0x5c')],'ChatWebsiteId':_0x33f2f2['params']['id'],'ChatInteractionId':_0x26e628['id'],'direction':'in','ContactId':_0x2f0e3e[_0xdb88('0xb9')]['id'],'AttachmentId':_0x33f2f2[_0xdb88('0x5c')][_0xdb88('0xc2')]});})[_0xdb88('0x21')](function(_0x55934e){_0x2f0e3e['message']=_0x55934e;if(_0x2f0e3e['interaction'][_0xdb88('0xc3')]){return db[_0xdb88('0xc4')]['find']({'attributes':['id',_0xdb88('0x3b')],'where':{'id':_0x2f0e3e['interaction']['UserId']}})[_0xdb88('0x21')](function(_0x3d45c6){if(_0x3d45c6){_0x2f0e3e[_0xdb88('0x9f')][_0xdb88('0xc5')]({'id':0x0,'priority':0x0,'app':_0xdb88('0xc6'),'appdata':_0x3d45c6[_0xdb88('0x3b')]+','+(_0x2f0e3e[_0xdb88('0x9e')][_0xdb88('0xc7')]||0xa),'interval':_0xdb88('0xc0')});_0x2f0e3e[_0xdb88('0xc8')]=!![];}return respondWithRpcPromise(_0xdb88('0xc9'),_0xdb88('0xca'),_0x2f0e3e);});}return respondWithRpcPromise(_0xdb88('0xc9'),_0xdb88('0xca'),_0x2f0e3e);})[_0xdb88('0x21')](function(_0xa7ca95){respondWithRpcPromise(_0xdb88('0xcb'),'EventManager',{'event':_0xdb88('0x86'),'message':_0xa7ca95},client9002);return _0xa7ca95;})['then'](respondWithResult(_0xabc34,null))['catch'](handleError(_0xabc34,null));};exports[_0xdb88('0xcc')]=function(_0x13bf2a,_0x598456,_0x1bd488){var _0x47e5c5,_0x2d0f4b,_0x49a30a;var _0x296b51=[];var _0x361eff=[];var _0x295b00={};var _0x48193d=_0x13bf2a[_0xdb88('0xcd')]||[];var _0x30016c=[];var _0x11a8c5;return db[_0xdb88('0x8d')]['describe']()[_0xdb88('0x21')](function(_0x26c923){if(!_0x26c923){throw new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))]('no\x20available\x20attributes');}_0x361eff=_[_0xdb88('0xce')](_['keys'](_0x26c923),[_0xdb88('0x91'),_0xdb88('0x92')]);_0x296b51=_[_0xdb88('0xce')](_[_0xdb88('0x44')](_0x26c923),[_0xdb88('0x91'),_0xdb88('0x92'),_0xdb88('0xcf'),_0xdb88('0xd0')]);if(_0x13bf2a[_0xdb88('0x5c')]['id']){delete _0x13bf2a[_0xdb88('0x5c')]['id'];}if(_[_0xdb88('0x7e')](_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0x93')])){throw _0x598456[_0xdb88('0x2c')](0x1f4)[_0xdb88('0xd1')](new db[(_0xdb88('0x8e'))]['ValidationError'](_0xdb88('0x94')));}if(_['isNil'](_0x13bf2a[_0xdb88('0x5c')]['body'])||_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0x5c')]===''){throw _0x598456[_0xdb88('0x2c')](0x1f4)[_0xdb88('0xd1')](new db[(_0xdb88('0x8e'))]['ValidationError'](_0xdb88('0x95')));}if(_[_0xdb88('0x7e')](_0x13bf2a['body'][_0xdb88('0xd2')])){throw _0x598456[_0xdb88('0x2c')](0x1f4)[_0xdb88('0xd1')](new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0xd3')+_0x296b51));}if(!_[_0xdb88('0x97')](_0x296b51,_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0xd2')])){throw _0x598456[_0xdb88('0x2c')](0x1f4)['send'](new db[(_0xdb88('0x8e'))][(_0xdb88('0x8f'))](_0xdb88('0xd4')+_0x296b51));}_0x295b00[_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0xd2')]]=_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0x93')];})[_0xdb88('0x21')](function(){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x13bf2a[_0xdb88('0x60')]['id']},'include':[{'model':db[_0xdb88('0xd5')],'as':'List'},{'model':db['MailAccount'],'as':_0xdb88('0xd6')}]});})['then'](handleEntityNotFound(_0x598456,null))[_0xdb88('0x21')](function(_0x515c09){if(_0x515c09&&_0x515c09[_0xdb88('0xa1')]){_0x2d0f4b=_0x515c09;var _0xc43df6=_[_0xdb88('0x19')](_0x13bf2a['body'],{'firstName':_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0x93')],'phone':_0x13bf2a['body'][_0xdb88('0x93')],'ListId':_0x515c09[_0xdb88('0xd0')]});_0xc43df6[_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0xd2')]]=_0x13bf2a['body'][_0xdb88('0x93')];return db[_0xdb88('0x8d')][_0xdb88('0xd7')]({'where':_0x295b00,'defaults':_0xc43df6});}})[_0xdb88('0xb8')](function(_0x53cda0){if(_0x53cda0){_0x49a30a=_0x53cda0;var _0x53e519=fs[_0xdb88('0xd8')](path['join'](config['root'],_0xdb88('0xd9')),_0xdb88('0xda'));var _0x388c4e=ejs[_0xdb88('0xdb')](_0x53e519,{'body':_['toPairs'](_0x13bf2a[_0xdb88('0x5c')][_0xdb88('0x5c')]),'bodyTitle':_0x2d0f4b[_0xdb88('0xdc')]});return db['ChatOfflineMessage'][_0xdb88('0x5b')]({'body':_0x388c4e,'ContactId':_0x53cda0['id'],'ChatWebsiteId':_0x2d0f4b['id']});}})[_0xdb88('0x21')](function(_0x4aa49f){_0x11a8c5=_0x4aa49f;if(_0x48193d[_0xdb88('0x4b')]){var _0x358dc4=_0x48193d['map'](function(_0x169217){return{'name':_0x169217[_0xdb88('0xdd')],'basename':_0x169217['filename'],'type':_0x169217[_0xdb88('0xde')],'ChatOfflineMessageId':_0x4aa49f['id']};});_0x30016c=_0x358dc4[_0xdb88('0x51')](_0x4eaff8=>{var _0x2a23ee={'filename':_0x4eaff8[_0xdb88('0x3b')],'path':path['join'](config[_0xdb88('0x79')],_0xdb88('0xdf'),_0xdb88('0xcd'),'attachments',_0xdb88('0xe0'),_0x4eaff8[_0xdb88('0xe1')])};return _0x2a23ee;});if(!_0x2d0f4b[_0xdb88('0xe2')]){return db[_0xdb88('0xe3')][_0xdb88('0xe4')](function(_0x2bf639){return db[_0xdb88('0xe5')][_0xdb88('0xe6')](_0x358dc4,{'transaction':_0x2bf639});});}}})['then'](function(){if(_0x11a8c5){_0x47e5c5=_0x11a8c5;return db['MailAccount'][_0xdb88('0x64')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xdb88('0xe7'),'raw':!![]}]});}})[_0xdb88('0x21')](function(_0x699616){if(_0x699616&&_0x699616['Smtp']&&_0x2d0f4b[_0xdb88('0xe8')]&&_0x2d0f4b[_0xdb88('0xe9')]){var _0xc04185={'tls':{'rejectUnauthorized':![]}};if(_0x699616['Smtp']['service']){_0xc04185[_0xdb88('0xea')]=_0x699616[_0xdb88('0xe7')][_0xdb88('0xea')];}else{_0xc04185[_0xdb88('0xeb')]=_0x699616[_0xdb88('0xe7')][_0xdb88('0xeb')];_0xc04185['port']=_0x699616[_0xdb88('0xe7')][_0xdb88('0xec')];_0xc04185[_0xdb88('0xed')]=_0x699616[_0xdb88('0xe7')]['secure'];}if(_0x699616[_0xdb88('0xe7')][_0xdb88('0xee')]){_0xc04185[_0xdb88('0xef')]={'user':_0x699616['Smtp'][_0xdb88('0x5d')],'pass':_0x699616['Smtp'][_0xdb88('0xf0')]};}return respondWithRpcPromise(_0xdb88('0xf1'),'sendMail',{'account':_0xc04185,'message':{'from':util['format'](_0xdb88('0xf2'),_0x699616[_0xdb88('0x3b')],_0x699616['email']||_0x699616[_0xdb88('0xe7')]['user']),'to':_0x2d0f4b[_0xdb88('0xe9')],'subject':_0x2d0f4b['offlineMessageSubject'],'html':_0x47e5c5['body'],'attachments':_0x30016c}},client9003)[_0xdb88('0x21')](function(){return _0x47e5c5;})[_0xdb88('0x2a')](function(_0x5b8d68){console[_0xdb88('0x27')](_0x5b8d68);});}})[_0xdb88('0x21')](function(){if(_0x2d0f4b&&_0x2d0f4b[_0xdb88('0xe2')]&&_0x2d0f4b[_0xdb88('0xf3')]){var _0x2d54ca=[];if(_0x48193d[_0xdb88('0x4b')]){_0x2d54ca=_0x48193d[_0xdb88('0x51')](function(_0x1fcfe2){return{'name':_0x1fcfe2[_0xdb88('0xdd')],'basename':_0x1fcfe2[_0xdb88('0x6f')],'type':_0x1fcfe2[_0xdb88('0xde')],'ChatOfflineMessageId':_0x11a8c5['id']};});}var _0x5efded;if(!_[_0xdb88('0x7e')](_0x2d0f4b['subjectOffline'])){var _0x28b240=_[_0xdb88('0x51')](_0x13bf2a[_0xdb88('0x5c')],function(_0x2b74c3){return _0x2b74c3;});var _0xcca54a=_[_0xdb88('0xf4')](_0x28b240)[0x0];var _0x2aadef=_[_0xdb88('0xf5')](_0xcca54a,function(_0x3dc215){return _0x3dc215;});_0x5efded=_0x2aadef[0x1][_0x2d0f4b[_0xdb88('0xf6')]];}var _0x15f6fc={'from':_0x49a30a[_0xdb88('0xf7')],'firstName':_0x49a30a[_0xdb88('0xa9')],'lastName':_0x49a30a[_0xdb88('0xba')],'mapKey':_0xdb88('0xf7'),'message':{'from':_0x49a30a[_0xdb88('0xf7')],'to':_0x2d0f4b[_0xdb88('0xd6')][_0xdb88('0xf7')],'cc':'','subject':_[_0xdb88('0x7e')](_0x5efded)?_0x2d0f4b[_0xdb88('0xf8')]:_0x5efded,'messageId':'','sentAt':new Date(),'attach':_0x2d54ca[_0xdb88('0x4b')],'attachments':_0x2d54ca,'originChannel':_0xdb88('0xf9'),'ChatWebsiteId':_0x2d0f4b['id'],'ChatOfflineMessageId':_0x47e5c5['id'],'originTo':_0x2d0f4b['MailAccount'][_0xdb88('0xf7')]},'body':_0x47e5c5[_0xdb88('0x5c')]};var _0x33724a={'account':{'id':_0x2d0f4b['MailAccountId']},'body':_0x15f6fc,'log':_0xdb88('0xfa')};return respondWithRpcPromise(_0xdb88('0xfa'),_0xdb88('0xfb'),_0x33724a,client9001)[_0xdb88('0x21')](function(){return _0x47e5c5;})[_0xdb88('0x2a')](function(_0x36fa7e){console['error'](_0x36fa7e);});}return;})[_0xdb88('0x21')](function(){if(_0x47e5c5){return _0x47e5c5;}})[_0xdb88('0x21')](respondWithResult(_0x598456,null))['catch'](function(_0x292bb4){console[_0xdb88('0x27')](_0xdb88('0x2a'),_0x292bb4);for(var _0x4d00a7 of _0x48193d){var _0x309477=path[_0xdb88('0x75')](config[_0xdb88('0x79')],'server',_0xdb88('0xcd'),'attachments',_0xdb88('0xe0'),_0x4d00a7['filename']);fs_extra[_0xdb88('0xfc')](_0x309477)[_0xdb88('0x2a')](function(_0xd4e401){console[_0xdb88('0x27')](_0xdb88('0xfd'),_0x309477,_0xd4e401);});}});};exports[_0xdb88('0xfe')]=function(_0x106f03,_0x183d33,_0x76685d){return db['ChatInteraction'][_0xdb88('0x5a')]({'where':{'id':_0x106f03[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x183d33,null))['then'](function(_0x4e522f){if(_0x4e522f){return _0x4e522f[_0xdb88('0xfe')](_0x106f03[_0xdb88('0x5c')]['ids'],_[_0xdb88('0xff')](_0x106f03[_0xdb88('0x5c')],['ids','id'])||{});}})[_0xdb88('0x21')](respondWithResult(_0x183d33,null))[_0xdb88('0x2a')](handleError(_0x183d33,null));};exports[_0xdb88('0x100')]=function(_0x5a6c20,_0x26a653,_0x12cc38){var _0x2e1b81={'raw':![],'where':{}};var _0x46b282={};var _0x583010={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdb88('0x64')]({'where':{'id':_0x5a6c20[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x26a653,null))['then'](function(_0x3c2294){if(_0x3c2294){_0x46b282[_0xdb88('0x48')]=_[_0xdb88('0x44')](db[_0xdb88('0xb7')][_0xdb88('0x40')]);_0x46b282[_0xdb88('0x45')]=_[_0xdb88('0x44')](_0x5a6c20[_0xdb88('0x45')]);_0x46b282[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x46b282[_0xdb88('0x48')],_0x46b282[_0xdb88('0x45')]);_0x2e1b81[_0xdb88('0x49')]=_[_0xdb88('0x47')](_0x46b282[_0xdb88('0x48')],qs[_0xdb88('0x4a')](_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x4a')]));_0x2e1b81[_0xdb88('0x49')]=_0x2e1b81[_0xdb88('0x49')][_0xdb88('0x4b')]?_0x2e1b81[_0xdb88('0x49')]:_0x46b282[_0xdb88('0x48')];if(!_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x4c')](_0xdb88('0x66'))){_0x2e1b81[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x30')]);_0x2e1b81[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x2f')]);}_0x2e1b81[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x4e')]);_0x2e1b81[_0xdb88('0x54')]=qs[_0xdb88('0x46')](_[_0xdb88('0x4f')](_0x5a6c20[_0xdb88('0x45')],_0x46b282['filters']));_0x2e1b81[_0xdb88('0x54')]['ChatWebsiteId']=_0x3c2294['id'];if(_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x53')]){_0x2e1b81[_0xdb88('0x54')]=_[_0xdb88('0x50')](_0x2e1b81[_0xdb88('0x54')],{'$or':_['map'](_0x2e1b81[_0xdb88('0x49')],function(_0x242a1b){var _0x265f85={};_0x265f85[_0x242a1b]={'$like':'%'+_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x53')]+'%'};return _0x265f85;})});}_0x2e1b81=_['merge']({},_0x2e1b81,_0x5a6c20['options']);return db['ChatInteraction'][_0xdb88('0x31')]({'where':_0x2e1b81[_0xdb88('0x54')]})['then'](function(_0x2ca9b4){_0x583010[_0xdb88('0x31')]=_0x2ca9b4;if(_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x55')]){_0x2e1b81[_0xdb88('0x56')]=[{'model':db[_0xdb88('0x8d')],'as':_0xdb88('0x101'),'required':![]},{'model':db[_0xdb88('0xc4')],'as':'Owner','attributes':[_0xdb88('0x3b'),_0xdb88('0x102'),_0xdb88('0x103')],'required':![]},{'model':db[_0xdb88('0x104')],'as':_0xdb88('0x105'),'attributes':['id',_0xdb88('0x3b'),_0xdb88('0x106')],'where':_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x107')]?{'id':_0x5a6c20[_0xdb88('0x45')][_0xdb88('0x107')]}:undefined,'required':_0x5a6c20['query'][_0xdb88('0x107')]?!![]:![]}];}return db[_0xdb88('0xb7')][_0xdb88('0x108')](_0x2e1b81);})[_0xdb88('0x21')](function(_0x1906dd){_0x583010['rows']=_0x1906dd;return _0x583010;});}})[_0xdb88('0x21')](respondWithFilteredResult(_0x26a653,_0x2e1b81))[_0xdb88('0x2a')](handleError(_0x26a653,null));};function iftimePromise(_0x272ff3,_0x31be78){return respondWithRpcPromise('Command',_0xdb88('0x109'),{'command':_0x31be78[_0xdb88('0x10a')]?util[_0xdb88('0xad')]('iftime\x20%s,%s',_0x272ff3[_0xdb88('0x10b')],_0x31be78[_0xdb88('0x10a')]):util[_0xdb88('0xad')](_0xdb88('0x10c'),_0x272ff3[_0xdb88('0x10b')])},client9002)[_0xdb88('0x21')](function(_0x3706ef){var _0x2b5726=_0x3706ef&&_0x3706ef['indexOf'](_0xdb88('0x10d'))>=0x0?!![]:![];logger['info'](_0xdb88('0x10e'),_0x31be78['id'],_0x272ff3['id'],_0x272ff3[_0xdb88('0x10b')],_0x2b5726?_0xdb88('0x10f'):_0xdb88('0x110'),_0x31be78[_0xdb88('0x10a')]?_0x31be78[_0xdb88('0x10a')]:_0xdb88('0x111'));return _0x2b5726;})[_0xdb88('0x2a')](function(_0x2fa4eb){logger[_0xdb88('0x27')](_0xdb88('0x10e'),_0x31be78['id'],_0x272ff3['id'],_0x272ff3[_0xdb88('0x10b')],util['inspect'](_0x2fa4eb,{'showHidden':![],'depth':null}),_0x31be78[_0xdb88('0x10a')]?_0x31be78[_0xdb88('0x10a')]:'No\x20timezone');return![];});}exports[_0xdb88('0x109')]=function(_0x37e4c6,_0x12751c,_0x46b149){var _0x5bf2d2=0x0;var _0x56f9d0=0x0;var _0x2b803a=![];var _0x4bce09;var _0x1f6381;return db[_0xdb88('0x3f')]['find']({'where':{'id':_0x37e4c6['params']['id']},'include':[{'model':db['Interval'],'as':_0xdb88('0x112'),'include':[{'model':db[_0xdb88('0x112')],'as':_0xdb88('0x113'),'attributes':['id',_0xdb88('0x10b')],'raw':!![]}]}]})[_0xdb88('0x21')](handleEntityNotFound(_0x12751c,null))['then'](function(_0x4caa88){if(_0x4caa88){_0x4bce09=_0x4caa88;return _0x4caa88[_0xdb88('0x114')]({'raw':!![]});}})['then'](function(_0x1c1891){if(_0x4bce09){if(_0x1c1891){_0x1f6381=_0x1c1891;}}return require(_0xdb88('0x16'))[_0xdb88('0x115')]();})[_0xdb88('0x21')](function(_0x282f83){if(_0x282f83){_0x56f9d0=_0x282f83[_0xdb88('0x116')];_0x2b803a=_0x282f83['custom'];}})[_0xdb88('0x21')](function(){return db[_0xdb88('0xb7')][_0xdb88('0x31')]({'where':{'closed':![]}});})[_0xdb88('0x21')](function(_0x400e7f){_0x5bf2d2=_0x400e7f;if(_0x56f9d0&&_0x400e7f>_0x56f9d0){return db[_0xdb88('0x117')][_0xdb88('0x64')]({'where':{'id':0x1}})[_0xdb88('0x21')](function(_0x1a3bb1){if(_0x1a3bb1){_0x1a3bb1[_0xdb88('0x118')](_0xdb88('0x119'));}});}})[_0xdb88('0x21')](function(){if(_0x4bce09['Interval']&&_0x4bce09[_0xdb88('0x112')][_0xdb88('0x113')]){var _0x47696f=[];for(var _0x5a3675=0x0;_0x5a3675<_0x4bce09['Interval']['Intervals'][_0xdb88('0x4b')];_0x5a3675++){var _0x3a9cd6=_0x4bce09[_0xdb88('0x112')][_0xdb88('0x113')][_0x5a3675][_0xdb88('0x37')]({'plain':!![]});_0x47696f[_0xdb88('0xbe')](iftimePromise(_0x3a9cd6,_0x4bce09));}return BPromise[_0xdb88('0x11a')](_0x47696f)[_0xdb88('0x21')](function(_0x220dd5){return _[_0xdb88('0x11b')](_0x220dd5);});}else{return!![];}})['then'](function(_0x27a358){var _0x357c11=fs[_0xdb88('0xd8')](path[_0xdb88('0x75')](config['root'],_0xdb88('0x11c')),_0xdb88('0xda'));var _0x3e8bec={'remote':_0x4bce09['remote'],'query':querystring[_0xdb88('0x26')](_[_0xdb88('0x50')](_0x4bce09[_0xdb88('0x37')]({'plain':!![]}),{'customerIp':_0x37e4c6[_0xdb88('0x89')][_0xdb88('0xa7')]||_0x37e4c6[_0xdb88('0x89')][_0xdb88('0x11d')]||_0x37e4c6[_0xdb88('0x11e')][_0xdb88('0x11f')]||_0x37e4c6['ip'],'referer':_0x37e4c6[_0xdb88('0x89')][_0xdb88('0xab')],'openedInteractions':_0x5bf2d2,'maxInteractions':_0x56f9d0,'virtual':_0x2b803a[_0xdb88('0x116')],'online':_0x27a358,'custom':_0x2b803a}))['replace'](/'/g,'\x5c\x27')};_0x12751c[_0xdb88('0xd1')](ejs[_0xdb88('0xdb')](Mustache[_0xdb88('0xdb')](_0x357c11,_0x3e8bec),{'proactiveActions':_0x1f6381,'alignment':_0x4bce09[_0xdb88('0x120')],'verticalAlignment':_0x4bce09[_0xdb88('0x121')],'div_color':_0x4bce09['color'],'text_color':_0x4bce09[_0xdb88('0x122')],'button_color':_0x4bce09['color_button'],'background_color':_0x4bce09[_0xdb88('0x123')]}));})['catch'](handleError(_0x12751c,null));};exports[_0xdb88('0x124')]=function(_0x126124,_0x466525,_0xf9787d){return db['ChatWebsite'][_0xdb88('0x64')]({'where':{'id':_0x126124[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x466525,null))[_0xdb88('0x21')](function(_0x40de00){if(_0x40de00){return db[_0xdb88('0xe3')][_0xdb88('0xe4')](function(_0x668b1f){return db[_0xdb88('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x126124[_0xdb88('0x60')]['id']},'transaction':_0x668b1f})[_0xdb88('0x21')](function(_0x4aaaf7){var _0x59a93b=_[_0xdb88('0x51')](_0x126124[_0xdb88('0x5c')],function(_0x1b2b90){_0x1b2b90[_0xdb88('0x69')]=_0x126124['params']['id'];return _0x1b2b90;});return db[_0xdb88('0x9c')][_0xdb88('0xe6')](_0x59a93b,{'transaction':_0x668b1f});});})[_0xdb88('0x21')](function(){return db[_0xdb88('0x9c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x126124['params']['id']},'order':_0xdb88('0xa3')});});}})['then'](respondWithResult(_0x466525,null))[_0xdb88('0x2a')](handleError(_0x466525,null));};exports[_0xdb88('0x125')]=function(_0x1ca54c,_0x192257,_0x1cd4a1){var _0x50e616={};var _0x5f3087={};var _0x3eaeb1;var _0x2171fb;return db[_0xdb88('0x3f')][_0xdb88('0x64')]({'where':{'id':_0x1ca54c[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x192257,null))[_0xdb88('0x21')](function(_0x19eaac){if(_0x19eaac){_0x3eaeb1=_0x19eaac;_0x5f3087['model']=_[_0xdb88('0x44')](db['ChatApplication'][_0xdb88('0x40')]);_0x5f3087[_0xdb88('0x45')]=_['keys'](_0x1ca54c['query']);_0x5f3087[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x5f3087[_0xdb88('0x48')],_0x5f3087['query']);_0x50e616[_0xdb88('0x49')]=_[_0xdb88('0x47')](_0x5f3087[_0xdb88('0x48')],qs[_0xdb88('0x4a')](_0x1ca54c['query'][_0xdb88('0x4a')]));_0x50e616['attributes']=_0x50e616[_0xdb88('0x49')][_0xdb88('0x4b')]?_0x50e616['attributes']:_0x5f3087[_0xdb88('0x48')];_0x50e616[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x1ca54c[_0xdb88('0x45')][_0xdb88('0x4e')]);_0x50e616[_0xdb88('0x54')]=qs[_0xdb88('0x46')](_['pick'](_0x1ca54c[_0xdb88('0x45')],_0x5f3087[_0xdb88('0x46')]));if(_0x1ca54c[_0xdb88('0x45')]['filter']){_0x50e616[_0xdb88('0x54')]=_[_0xdb88('0x50')](_0x50e616[_0xdb88('0x54')],{'$or':_[_0xdb88('0x51')](_0x50e616[_0xdb88('0x49')],function(_0x4757f8){var _0x12ac1a={};_0x12ac1a[_0x4757f8]={'$like':'%'+_0x1ca54c['query'][_0xdb88('0x53')]+'%'};return _0x12ac1a;})});}_0x50e616=_['merge']({},_0x50e616,_0x1ca54c[_0xdb88('0x59')]);return _0x3eaeb1[_0xdb88('0x125')](_0x50e616);}})[_0xdb88('0x21')](function(_0x25c2c4){if(_0x25c2c4){_0x2171fb=_0x25c2c4[_0xdb88('0x4b')];if(!_0x1ca54c[_0xdb88('0x45')]['hasOwnProperty']('nolimit')){_0x50e616[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x1ca54c['query'][_0xdb88('0x30')]);_0x50e616[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x1ca54c[_0xdb88('0x45')]['offset']);}return _0x3eaeb1['getApplications'](_0x50e616);}})[_0xdb88('0x21')](function(_0x5ead36){if(_0x5ead36){return _0x5ead36?{'count':_0x2171fb,'rows':_0x5ead36}:null;}})[_0xdb88('0x21')](respondWithResult(_0x192257,null))[_0xdb88('0x2a')](handleError(_0x192257,null));};exports[_0xdb88('0x126')]=function(_0x4c8f26,_0x49f16a,_0x24e126){return db[_0xdb88('0x127')][_0xdb88('0x5a')]({'where':{'id':_0x4c8f26[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x49f16a,null))['then'](function(_0x123ef3){if(_0x123ef3){return _0x123ef3[_0xdb88('0x126')](_0x4c8f26[_0xdb88('0x5c')][_0xdb88('0x67')],_[_0xdb88('0xff')](_0x4c8f26[_0xdb88('0x5c')],[_0xdb88('0x67'),'id'])||{});}})[_0xdb88('0x21')](respondWithResult(_0x49f16a,null))['catch'](handleError(_0x49f16a,null));};exports[_0xdb88('0x114')]=function(_0x556148,_0x50587a,_0xa8fe84){var _0x52862d={};var _0x438291={};var _0x5c3180;var _0x53a9f4;return db[_0xdb88('0x3f')][_0xdb88('0x64')]({'where':{'id':_0x556148[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x50587a,null))[_0xdb88('0x21')](function(_0x441ec9){if(_0x441ec9){_0x5c3180=_0x441ec9;_0x438291[_0xdb88('0x48')]=_[_0xdb88('0x44')](db[_0xdb88('0x128')][_0xdb88('0x40')]);_0x438291[_0xdb88('0x45')]=_['keys'](_0x556148[_0xdb88('0x45')]);_0x438291[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x438291[_0xdb88('0x48')],_0x438291[_0xdb88('0x45')]);_0x52862d[_0xdb88('0x49')]=_[_0xdb88('0x47')](_0x438291['model'],qs[_0xdb88('0x4a')](_0x556148['query'][_0xdb88('0x4a')]));_0x52862d[_0xdb88('0x49')]=_0x52862d[_0xdb88('0x49')][_0xdb88('0x4b')]?_0x52862d['attributes']:_0x438291[_0xdb88('0x48')];_0x52862d[_0xdb88('0x4d')]=qs[_0xdb88('0x4e')](_0x556148[_0xdb88('0x45')]['sort']);_0x52862d[_0xdb88('0x54')]=qs['filters'](_[_0xdb88('0x4f')](_0x556148[_0xdb88('0x45')],_0x438291[_0xdb88('0x46')]));if(_0x556148[_0xdb88('0x45')][_0xdb88('0x53')]){_0x52862d[_0xdb88('0x54')]=_[_0xdb88('0x50')](_0x52862d[_0xdb88('0x54')],{'$or':_[_0xdb88('0x51')](_0x52862d[_0xdb88('0x49')],function(_0x1c690b){var _0xde04e3={};_0xde04e3[_0x1c690b]={'$like':'%'+_0x556148[_0xdb88('0x45')][_0xdb88('0x53')]+'%'};return _0xde04e3;})});}_0x52862d=_[_0xdb88('0x50')]({},_0x52862d,_0x556148[_0xdb88('0x59')]);return _0x5c3180[_0xdb88('0x114')](_0x52862d);}})[_0xdb88('0x21')](function(_0x31db6d){if(_0x31db6d){_0x53a9f4=_0x31db6d['length'];if(!_0x556148[_0xdb88('0x45')][_0xdb88('0x4c')](_0xdb88('0x66'))){_0x52862d[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x556148['query'][_0xdb88('0x30')]);_0x52862d[_0xdb88('0x2f')]=qs[_0xdb88('0x2f')](_0x556148[_0xdb88('0x45')][_0xdb88('0x2f')]);}return _0x5c3180[_0xdb88('0x114')](_0x52862d);}})[_0xdb88('0x21')](function(_0x4c4bfa){if(_0x4c4bfa){return _0x4c4bfa?{'count':_0x53a9f4,'rows':_0x4c4bfa}:null;}})[_0xdb88('0x21')](respondWithResult(_0x50587a,null))['catch'](handleError(_0x50587a,null));};exports[_0xdb88('0x129')]=function(_0x1c644d,_0x5c1c14,_0x1f6499){var _0x24ec44=_0x1c644d[_0xdb88('0x45')][_0xdb88('0x12a')]===_0xdb88('0x12b')?_0xdb88('0x12c'):_0xdb88('0x12d');return db['ChatWebsite'][_0xdb88('0x5a')]({'attributes':['id',_0x24ec44],'where':{'id':_0x1c644d['params']['id']}})['then'](handleEntityNotFound(_0x5c1c14,null))[_0xdb88('0x21')](function(_0xbe4988){if(_0xbe4988){var _0x21143b=_0xbe4988[_0x24ec44];var _0x5419c4=_0x21143b&&_0x21143b['items']?_0x21143b[_0xdb88('0x12e')]:[];_0x5c1c14[_0xdb88('0xd1')]({'fromKey':_['isNil'](_0x21143b[_0xdb88('0x12f')])?undefined:_0x21143b[_0xdb88('0x12f')],'count':_0x5419c4[_0xdb88('0x4b')],'rows':_0x5419c4});}})[_0xdb88('0x2a')](handleError(_0x5c1c14,null));};exports[_0xdb88('0x130')]=function(_0x39b32c,_0x1f2b4d,_0x3779b0){var _0x1b83a6={'raw':![],'where':{}};var _0x253f7b={};var _0x6ca824={'count':0x0,'rows':[]};return db[_0xdb88('0x3f')][_0xdb88('0x64')]({'where':{'id':_0x39b32c[_0xdb88('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f2b4d,null))['then'](function(_0x1bce21){if(_0x1bce21){_0x253f7b['model']=_['keys'](db['ChatOfflineMessage'][_0xdb88('0x40')]);_0x253f7b[_0xdb88('0x45')]=_['keys'](_0x39b32c['query']);_0x253f7b['filters']=_[_0xdb88('0x47')](_0x253f7b[_0xdb88('0x48')],_0x253f7b[_0xdb88('0x45')]);_0x1b83a6['attributes']=_[_0xdb88('0x47')](_0x253f7b['model'],qs['fields'](_0x39b32c[_0xdb88('0x45')][_0xdb88('0x4a')]));_0x1b83a6[_0xdb88('0x49')]=_0x1b83a6[_0xdb88('0x49')][_0xdb88('0x4b')]?_0x1b83a6[_0xdb88('0x49')]:_0x253f7b['model'];if(!_0x39b32c['query'][_0xdb88('0x4c')](_0xdb88('0x66'))){_0x1b83a6[_0xdb88('0x30')]=qs[_0xdb88('0x30')](_0x39b32c[_0xdb88('0x45')][_0xdb88('0x30')]);_0x1b83a6['offset']=qs[_0xdb88('0x2f')](_0x39b32c[_0xdb88('0x45')][_0xdb88('0x2f')]);}_0x1b83a6['order']=qs[_0xdb88('0x4e')](_0x39b32c[_0xdb88('0x45')]['sort']);_0x1b83a6['where']=qs[_0xdb88('0x46')](_[_0xdb88('0x4f')](_0x39b32c[_0xdb88('0x45')],_0x253f7b[_0xdb88('0x46')]));_0x1b83a6[_0xdb88('0x54')][_0xdb88('0x69')]=_0x1bce21['id'];if(_0x39b32c[_0xdb88('0x45')][_0xdb88('0x53')]){_0x1b83a6[_0xdb88('0x54')]=_['merge'](_0x1b83a6[_0xdb88('0x54')],{'$or':_[_0xdb88('0x51')](_0x1b83a6[_0xdb88('0x49')],function(_0x425076){var _0x87edeb={};_0x87edeb[_0x425076]={'$like':'%'+_0x39b32c['query']['filter']+'%'};return _0x87edeb;})});}_0x1b83a6=_[_0xdb88('0x50')]({},_0x1b83a6,_0x39b32c[_0xdb88('0x59')]);return db['ChatOfflineMessage'][_0xdb88('0x31')]({'where':_0x1b83a6[_0xdb88('0x54')]})[_0xdb88('0x21')](function(_0x1e97c){_0x6ca824[_0xdb88('0x31')]=_0x1e97c;if(_0x39b32c[_0xdb88('0x45')][_0xdb88('0x55')]){_0x1b83a6['include']=[{'all':!![]}];}else{_0x1b83a6[_0xdb88('0x56')]=[{'model':db['CmContact'],'as':_0xdb88('0x101'),'required':![]},{'model':db[_0xdb88('0xe5')],'as':_0xdb88('0x131'),'required':![]}];}return db[_0xdb88('0x132')][_0xdb88('0x108')](_0x1b83a6);})['then'](function(_0x47058d){_0x6ca824[_0xdb88('0x57')]=_0x47058d;return _0x6ca824;});}})[_0xdb88('0x21')](respondWithFilteredResult(_0x1f2b4d,_0x1b83a6))[_0xdb88('0x2a')](handleError(_0x1f2b4d,null));};exports[_0xdb88('0x133')]=function(_0x4c513f,_0x130b7a,_0xb78fe6){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x4c513f[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x130b7a,null))[_0xdb88('0x21')](function(_0x56181d){if(_0x56181d){return _0x56181d[_0xdb88('0x133')](_0x4c513f[_0xdb88('0x5c')][_0xdb88('0x67')],_['omit'](_0x4c513f[_0xdb88('0x5c')],[_0xdb88('0x67'),'id'])||{})[_0xdb88('0xb8')](function(_0x5bef61){for(var _0x52d4cf=0x0;_0x52d4cf<_0x4c513f[_0xdb88('0x5c')][_0xdb88('0x67')][_0xdb88('0x4b')];_0x52d4cf+=0x1){socket[_0xdb88('0x134')](_0xdb88('0x135'),{'UserId':Number(_0x4c513f[_0xdb88('0x5c')][_0xdb88('0x67')][_0x52d4cf]),'ChatWebsiteId':Number(_0x4c513f[_0xdb88('0x60')]['id'])});}return _0x5bef61;});}})[_0xdb88('0x21')](respondWithResult(_0x130b7a,null))['catch'](handleError(_0x130b7a,null));};exports[_0xdb88('0x136')]=function(_0x45fc7d,_0x21223b,_0x447084){return db[_0xdb88('0x3f')][_0xdb88('0x5a')]({'where':{'id':_0x45fc7d[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x21223b,null))['then'](function(_0x4c0323){if(_0x4c0323){return _0x4c0323[_0xdb88('0x136')](_0x45fc7d['query'][_0xdb88('0x67')])[_0xdb88('0x21')](function(){if(_['isArray'](_0x45fc7d[_0xdb88('0x45')][_0xdb88('0x67')])){for(var _0x4bc907=0x0;_0x4bc907<_0x45fc7d['query'][_0xdb88('0x67')]['length'];_0x4bc907+=0x1){socket[_0xdb88('0x134')]('userChatWebsite:remove',{'UserId':Number(_0x45fc7d[_0xdb88('0x45')]['ids'][_0x4bc907]),'ChatWebsiteId':Number(_0x45fc7d[_0xdb88('0x60')]['id'])});}}else{socket[_0xdb88('0x134')](_0xdb88('0x137'),{'UserId':Number(_0x45fc7d[_0xdb88('0x45')][_0xdb88('0x67')]),'ChatWebsiteId':Number(_0x45fc7d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x21223b,null))[_0xdb88('0x2a')](handleError(_0x21223b,null));};exports[_0xdb88('0x138')]=function(_0x204d26,_0x951102,_0x458e4d){var _0x5c219b={};var _0x171973={};var _0x31b27e;var _0x3e46e9;return db[_0xdb88('0x3f')][_0xdb88('0x64')]({'where':{'id':_0x204d26[_0xdb88('0x60')]['id']}})[_0xdb88('0x21')](handleEntityNotFound(_0x951102,null))[_0xdb88('0x21')](function(_0x388b27){if(_0x388b27){_0x31b27e=_0x388b27;_0x171973['model']=_[_0xdb88('0x44')](db[_0xdb88('0xc4')]['rawAttributes']);_0x171973['query']=_[_0xdb88('0x44')](_0x204d26[_0xdb88('0x45')]);_0x171973[_0xdb88('0x46')]=_[_0xdb88('0x47')](_0x171973['model'],_0x171973[_0xdb88('0x45')]);_0x5c219b[_0xdb88('0x49')]=_['intersection'](_0x171973[_0xdb88('0x48')],qs[_0xdb88('0x4a')](_0x204d26['query']['fields']));_0x5c219b[_0xdb88('0x49')]=_0x5c219b[_0xdb88('0x49')]['length']?_0x5c219b['attributes']:_0x171973[_0xdb88('0x48')];_0x5c219b[_0xdb88('0x4d')]=qs['sort'](_0x204d26[_0xdb88('0x45')][_0xdb88('0x4e')]);_0x5c219b[_0xdb88('0x54')]=qs[_0xdb88('0x46')](_[_0xdb88('0x4f')](_0x204d26[_0xdb88('0x45')],_0x171973[_0xdb88('0x46')]));if(_0x204d26['query']['filter']){_0x5c219b[_0xdb88('0x54')]=_['merge'](_0x5c219b[_0xdb88('0x54')],{'$or':_[_0xdb88('0x51')](_0x5c219b[_0xdb88('0x49')],function(_0x357aae){var _0x2e9641={};_0x2e9641[_0x357aae]={'$like':'%'+_0x204d26[_0xdb88('0x45')][_0xdb88('0x53')]+'%'};return _0x2e9641;})});}_0x5c219b=_[_0xdb88('0x50')]({},_0x5c219b,_0x204d26[_0xdb88('0x59')]);return _0x31b27e[_0xdb88('0x138')](_0x5c219b);}})[_0xdb88('0x21')](function(_0x3e8a9b){if(_0x3e8a9b){_0x3e46e9=_0x3e8a9b[_0xdb88('0x4b')];if(!_0x204d26['query'][_0xdb88('0x4c')]('nolimit')){_0x5c219b['limit']=qs[_0xdb88('0x30')](_0x204d26['query'][_0xdb88('0x30')]);_0x5c219b[_0xdb88('0x2f')]=qs['offset'](_0x204d26[_0xdb88('0x45')][_0xdb88('0x2f')]);}return _0x31b27e[_0xdb88('0x138')](_0x5c219b);}})[_0xdb88('0x21')](function(_0x4a99dd){if(_0x4a99dd){return _0x4a99dd?{'count':_0x3e46e9,'rows':_0x4a99dd}:null;}})[_0xdb88('0x21')](respondWithResult(_0x951102,null))[_0xdb88('0x2a')](handleError(_0x951102,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0fc3646..7652a0d 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 _0x7da7=['remove','emit','hook','events','../../mysqldb','ChatWebsite','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7da7,0x10d));var _0x77da=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x7da7[_0x24392f];return _0x591e33;};'use strict';var EventEmitter=require(_0x77da('0x0'));var ChatWebsite=require(_0x77da('0x1'))['db'][_0x77da('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x77da('0x3'),'afterDestroy':_0x77da('0x4')};function emitEvent(_0x4f60c3){return function(_0x3a9fa6,_0x37b3d9,_0x56458c){ChatWebsiteEvents[_0x77da('0x5')](_0x4f60c3+':'+_0x3a9fa6['id'],_0x3a9fa6);ChatWebsiteEvents[_0x77da('0x5')](_0x4f60c3,_0x3a9fa6);_0x56458c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x77da('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xd13e=['setMaxListeners','update','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x2d17ec,_0x54eb4d){var _0x162002=function(_0x193fa9){while(--_0x193fa9){_0x2d17ec['push'](_0x2d17ec['shift']());}};_0x162002(++_0x54eb4d);}(_0xd13e,0x193));var _0xed13=function(_0x1b541d,_0x2cc9cd){_0x1b541d=_0x1b541d-0x0;var _0x4841f2=_0xd13e[_0x1b541d];return _0x4841f2;};'use strict';var EventEmitter=require(_0xed13('0x0'));var ChatWebsite=require(_0xed13('0x1'))['db'][_0xed13('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xed13('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed13('0x4'),'afterDestroy':'remove'};function emitEvent(_0x282bda){return function(_0x59d4db,_0x46158d,_0xcba1c4){ChatWebsiteEvents['emit'](_0x282bda+':'+_0x59d4db['id'],_0x59d4db);ChatWebsiteEvents['emit'](_0x282bda,_0x59d4db);_0xcba1c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xed13('0x5')](e,emitEvent(event));}}module[_0xed13('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index cc04e13..92a01e8 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 _0xe53f=['exports','define','ChatWebsite','chat_websites','util','moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x54eb12,_0x58d83a){var _0x56209f=function(_0x244d8d){while(--_0x244d8d){_0x54eb12['push'](_0x54eb12['shift']());}};_0x56209f(++_0x58d83a);}(_0xe53f,0x10c));var _0xfe53=function(_0x40e379,_0x56ac01){_0x40e379=_0x40e379-0x0;var _0x49c439=_0xe53f[_0x40e379];return _0x49c439;};'use strict';var _=require('lodash');var util=require(_0xfe53('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xfe53('0x1'));var BPromise=require(_0xfe53('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe53('0x3'));var rimraf=require(_0xfe53('0x4'));var config=require(_0xfe53('0x5'));var attributes=require(_0xfe53('0x6'));module[_0xfe53('0x7')]=function(_0x144f3a,_0x56324f){return _0x144f3a[_0xfe53('0x8')](_0xfe53('0x9'),attributes,{'tableName':_0xfe53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3df=['util','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x2f663f,_0x49dc74){var _0x4eabe4=function(_0x11f8c3){while(--_0x11f8c3){_0x2f663f['push'](_0x2f663f['shift']());}};_0x4eabe4(++_0x49dc74);}(_0xc3df,0xb4));var _0xfc3d=function(_0x4cff32,_0x566db4){_0x4cff32=_0x4cff32-0x0;var _0x2bfb02=_0xc3df[_0x4cff32];return _0x2bfb02;};'use strict';var _=require('lodash');var util=require(_0xfc3d('0x0'));var logger=require('../../config/logger')(_0xfc3d('0x1'));var moment=require(_0xfc3d('0x2'));var BPromise=require(_0xfc3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfc3d('0x4'));var config=require(_0xfc3d('0x5'));var attributes=require(_0xfc3d('0x6'));module['exports']=function(_0x422577,_0x1eecc9){return _0x422577[_0xfc3d('0x7')](_0xfc3d('0x8'),attributes,{'tableName':_0xfc3d('0x9'),'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 5ebad7f..47fba9e 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 _0xf28c=['jayson/promise','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x356c8a,_0x5dac9d){var _0x10f5f1=function(_0x2b96c7){while(--_0x2b96c7){_0x356c8a['push'](_0x356c8a['shift']());}};_0x10f5f1(++_0x5dac9d);}(_0xf28c,0x7c));var _0xcf28=function(_0x4222c0,_0x4f0203){_0x4222c0=_0x4222c0-0x0;var _0x14ea47=_0xf28c[_0x4222c0];return _0x14ea47;};'use strict';var _=require(_0xcf28('0x0'));var util=require('util');var moment=require(_0xcf28('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf28('0x2'));var fs=require('fs');var Redis=require(_0xcf28('0x3'));var db=require(_0xcf28('0x4'))['db'];var utils=require(_0xcf28('0x5'));var logger=require('../../config/logger')(_0xcf28('0x6'));var config=require(_0xcf28('0x7'));var jayson=require(_0xcf28('0x8'));var client=jayson[_0xcf28('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xcf28('0xa')],{'host':_0xcf28('0xb'),'port':0x18eb});var socket=require(_0xcf28('0xc'))(new Redis(config['redis']));require(_0xcf28('0xd'))[_0xcf28('0xe')](socket);function respondWithRpcPromise(_0x571de5,_0x25df7b,_0x1f1d88){return new BPromise(function(_0x13de5d,_0x215599){return client[_0xcf28('0xf')](_0x571de5,_0x1f1d88)['then'](function(_0x1b223d){logger[_0xcf28('0x10')](_0xcf28('0x11'),_0x25df7b,_0xcf28('0x12'));logger[_0xcf28('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x25df7b,'request\x20sent',JSON['stringify'](_0x1b223d));if(_0x1b223d[_0xcf28('0x14')]){if(_0x1b223d[_0xcf28('0x14')]['code']===0x1f4){logger[_0xcf28('0x14')](_0xcf28('0x11'),_0x25df7b,_0x1b223d[_0xcf28('0x14')][_0xcf28('0x15')]);return _0x215599(_0x1b223d[_0xcf28('0x14')][_0xcf28('0x15')]);}logger[_0xcf28('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x25df7b,_0x1b223d['error'][_0xcf28('0x15')]);return _0x13de5d(_0x1b223d[_0xcf28('0x14')][_0xcf28('0x15')]);}else{logger['info'](_0xcf28('0x11'),_0x25df7b,_0xcf28('0x12'));_0x13de5d(_0x1b223d['result'][_0xcf28('0x15')]);}})['catch'](function(_0x3107f8){logger['error'](_0xcf28('0x11'),_0x25df7b,_0x3107f8);_0x215599(_0x3107f8);});});} \ No newline at end of file +var _0x1bf1=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x473b41,_0x1c320f){var _0x4e521d=function(_0x19a745){while(--_0x19a745){_0x473b41['push'](_0x473b41['shift']());}};_0x4e521d(++_0x1c320f);}(_0x1bf1,0x13f));var _0x11bf=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x1bf1[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x11bf('0x0'));var util=require(_0x11bf('0x1'));var moment=require(_0x11bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x11bf('0x3'));var fs=require('fs');var Redis=require(_0x11bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11bf('0x5'));var logger=require(_0x11bf('0x6'))('rpc');var config=require(_0x11bf('0x7'));var jayson=require(_0x11bf('0x8'));var client=jayson['client'][_0x11bf('0x9')]({'port':0x232a});config[_0x11bf('0xa')]=_[_0x11bf('0xb')](config[_0x11bf('0xa')],{'host':_0x11bf('0xc'),'port':0x18eb});var socket=require(_0x11bf('0xd'))(new Redis(config[_0x11bf('0xa')]));require(_0x11bf('0xe'))['register'](socket);function respondWithRpcPromise(_0xf7cb46,_0x1a7af7,_0x1e8a46){return new BPromise(function(_0x2d5f23,_0x1e84a4){return client['request'](_0xf7cb46,_0x1e8a46)[_0x11bf('0xf')](function(_0x36a070){logger['info'](_0x11bf('0x10'),_0x1a7af7,_0x11bf('0x11'));logger[_0x11bf('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a7af7,_0x11bf('0x11'),JSON[_0x11bf('0x13')](_0x36a070));if(_0x36a070[_0x11bf('0x14')]){if(_0x36a070[_0x11bf('0x14')][_0x11bf('0x15')]===0x1f4){logger['error'](_0x11bf('0x10'),_0x1a7af7,_0x36a070['error'][_0x11bf('0x16')]);return _0x1e84a4(_0x36a070[_0x11bf('0x14')][_0x11bf('0x16')]);}logger[_0x11bf('0x14')](_0x11bf('0x10'),_0x1a7af7,_0x36a070['error'][_0x11bf('0x16')]);return _0x2d5f23(_0x36a070[_0x11bf('0x14')][_0x11bf('0x16')]);}else{logger['info'](_0x11bf('0x10'),_0x1a7af7,_0x11bf('0x11'));_0x2d5f23(_0x36a070[_0x11bf('0x17')]['message']);}})[_0x11bf('0x18')](function(_0x5f057d){logger[_0x11bf('0x14')](_0x11bf('0x10'),_0x1a7af7,_0x5f057d);_0x1e84a4(_0x5f057d);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 6547d4c..e3d2cbd 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 _0x6f01=['remove','update','emit','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1c36a8,_0x49c835){var _0xb622c5=function(_0x24f4f3){while(--_0x24f4f3){_0x1c36a8['push'](_0x1c36a8['shift']());}};_0xb622c5(++_0x49c835);}(_0x6f01,0x106));var _0x16f0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6f01[_0x501510];return _0x1e6ee5;};'use strict';var ChatWebsiteEvents=require(_0x16f0('0x0'));var events=[_0x16f0('0x1'),_0x16f0('0x2'),_0x16f0('0x3')];function createListener(_0x957c57,_0x34f311){return function(_0x2530a0){_0x34f311[_0x16f0('0x4')](_0x957c57,_0x2530a0);};}function removeListener(_0x38067b,_0x3d426a){return function(){ChatWebsiteEvents['removeListener'](_0x38067b,_0x3d426a);};}exports[_0x16f0('0x5')]=function(_0x1d2c7e){for(var _0x276733=0x0,_0x3b447d=events[_0x16f0('0x6')];_0x276733<_0x3b447d;_0x276733++){var _0x4b78b6=events[_0x276733];var _0x1048d0=createListener(_0x16f0('0x7')+_0x4b78b6,_0x1d2c7e);ChatWebsiteEvents['on'](_0x4b78b6,_0x1048d0);}}; \ No newline at end of file +var _0x5cc2=['update','emit','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x215797,_0x49d505){var _0x4a3697=function(_0x23a93a){while(--_0x23a93a){_0x215797['push'](_0x215797['shift']());}};_0x4a3697(++_0x49d505);}(_0x5cc2,0x116));var _0x25cc=function(_0x34114a,_0x30a7ae){_0x34114a=_0x34114a-0x0;var _0xd39eba=_0x5cc2[_0x34114a];return _0xd39eba;};'use strict';var ChatWebsiteEvents=require(_0x25cc('0x0'));var events=['save',_0x25cc('0x1'),_0x25cc('0x2')];function createListener(_0x47ce44,_0xf0be7d){return function(_0x942168){_0xf0be7d[_0x25cc('0x3')](_0x47ce44,_0x942168);};}function removeListener(_0x1f0852,_0xf4ac1a){return function(){ChatWebsiteEvents['removeListener'](_0x1f0852,_0xf4ac1a);};}exports[_0x25cc('0x4')]=function(_0x9ad653){for(var _0x201d65=0x0,_0x1e394b=events[_0x25cc('0x5')];_0x201d65<_0x1e394b;_0x201d65++){var _0x37e505=events[_0x201d65];var _0x1bcb20=createListener(_0x25cc('0x6')+_0x37e505,_0x9ad653);ChatWebsiteEvents['on'](_0x37e505,_0x1bcb20);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0a1918a..80419bc 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 _0xf0af=['removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','%s-%s','/:id/avatar','diskStorage','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','replace','extname','/:id/offline','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy'];(function(_0x339399,_0x288091){var _0x29e2c1=function(_0x565c0b){while(--_0x565c0b){_0x339399['push'](_0x339399['shift']());}};_0x29e2c1(++_0x288091);}(_0xf0af,0x130));var _0xff0a=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xf0af[_0x17784a];return _0x41aded;};'use strict';var multer=require(_0xff0a('0x0'));var util=require(_0xff0a('0x1'));var path=require(_0xff0a('0x2'));var timeout=require(_0xff0a('0x3'));var express=require(_0xff0a('0x4'));var router=express['Router']();var fs_extra=require(_0xff0a('0x5'));var auth=require(_0xff0a('0x6'));var interaction=require(_0xff0a('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0xff0a('0x8')]('/',auth[_0xff0a('0x9')](),controller['index']);router[_0xff0a('0x8')](_0xff0a('0xa'),auth[_0xff0a('0x9')](),controller['describe']);router[_0xff0a('0x8')](_0xff0a('0xb'),auth['isAuthenticated'](),controller[_0xff0a('0xc')]);router['get'](_0xff0a('0xd'),auth[_0xff0a('0x9')](),controller[_0xff0a('0xe')]);router[_0xff0a('0x8')](_0xff0a('0xf'),auth['isAuthenticated'](),controller[_0xff0a('0x10')]);router['get'](_0xff0a('0x11'),controller[_0xff0a('0x12')]);router[_0xff0a('0x8')]('/:id/avatar',controller[_0xff0a('0x13')]);router[_0xff0a('0x8')](_0xff0a('0x14'),controller[_0xff0a('0x15')]);router[_0xff0a('0x8')]('/:id/system_avatar',controller[_0xff0a('0x16')]);router[_0xff0a('0x8')](_0xff0a('0x17'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x18')]);router[_0xff0a('0x8')](_0xff0a('0x19'),controller[_0xff0a('0x1a')]);router[_0xff0a('0x8')](_0xff0a('0x1b'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x1c')]);router[_0xff0a('0x8')](_0xff0a('0x1d'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x1e')]);router['get'](_0xff0a('0x1f'),controller[_0xff0a('0x20')]);router['get'](_0xff0a('0x21'),auth[_0xff0a('0x9')](),controller['getOfflineMessages']);router[_0xff0a('0x8')](_0xff0a('0x22'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x23')]);router[_0xff0a('0x24')]('/',auth[_0xff0a('0x9')](),controller[_0xff0a('0x25')]);router[_0xff0a('0x24')]('/:id/dispositions',auth[_0xff0a('0x9')](),controller[_0xff0a('0x26')]);router[_0xff0a('0x24')](_0xff0a('0xf'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f2d6e,_0x3c1ae4,_0x5368a7){_0x5368a7(null,path[_0xff0a('0x28')](config[_0xff0a('0x29')],_0xff0a('0x2a')));},'filename':function(_0xf72cb8,_0x37557d,_0x4c1e65){_0x4c1e65(null,util[_0xff0a('0x2b')]('%s-%s',Date[_0xff0a('0x2c')](),_0x37557d[_0xff0a('0x2d')]));}})});router['post'](_0xff0a('0x11'),upload[_0xff0a('0x2e')](_0xff0a('0x2f')),controller[_0xff0a('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16b271,_0x5da4b9,_0x1acb12){_0x1acb12(null,path[_0xff0a('0x28')](config[_0xff0a('0x29')],'server/files/images/avatars/'));},'filename':function(_0x372d37,_0x50156e,_0xe0a4c8){_0xe0a4c8(null,util[_0xff0a('0x2b')](_0xff0a('0x31'),Date[_0xff0a('0x2c')](),_0x50156e[_0xff0a('0x2d')]));}})});router[_0xff0a('0x24')](_0xff0a('0x32'),upload[_0xff0a('0x2e')](_0xff0a('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0xff0a('0x33')]({'destination':function(_0xabdf46,_0x16b821,_0x38e61d){_0x38e61d(null,path['join'](config[_0xff0a('0x29')],_0xff0a('0x34')));},'filename':function(_0x5218be,_0x1a2dc2,_0x179f66){_0x179f66(null,util['format'](_0xff0a('0x31'),Date['now'](),_0x1a2dc2[_0xff0a('0x2d')]));}})});router['post'](_0xff0a('0x14'),upload[_0xff0a('0x2e')](_0xff0a('0x2f')),controller[_0xff0a('0x35')]);var upload=multer({'storage':multer[_0xff0a('0x33')]({'destination':function(_0x5554bb,_0x42d76c,_0x28777d){_0x28777d(null,path[_0xff0a('0x28')](config[_0xff0a('0x29')],_0xff0a('0x34')));},'filename':function(_0x3c871e,_0x22c43f,_0x4b8c58){_0x4b8c58(null,util[_0xff0a('0x2b')](_0xff0a('0x31'),Date[_0xff0a('0x2c')](),_0x22c43f['originalname']));}})});router['post'](_0xff0a('0x36'),upload[_0xff0a('0x2e')](_0xff0a('0x2f')),controller[_0xff0a('0x37')]);router[_0xff0a('0x24')](_0xff0a('0x38'),controller[_0xff0a('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0xff0a('0x33')]({'destination':function(_0x19cf87,_0x1d01ce,_0x4ac6f4){const _0x5b83e6=path[_0xff0a('0x28')](config['root'],'server/files',_0xff0a('0x3a'),'offline-chat');fs_extra[_0xff0a('0x3b')](_0x5b83e6,function(){_0x4ac6f4(null,_0x5b83e6);});},'filename':function(_0x1a3aff,_0x5760e3,_0x69c8){const _0x3f306f=_0x5760e3['originalname'][_0xff0a('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x22dab9=path[_0xff0a('0x3d')](_0x3f306f);const _0x5e69cc=Date[_0xff0a('0x2c')]()+'-'+_0x3f306f[_0xff0a('0x3c')](_0x22dab9,'')+_0x22dab9;_0x69c8(null,_0x5e69cc);}})});router[_0xff0a('0x24')](_0xff0a('0x3e'),offlineUploadMulter['any'](),controller[_0xff0a('0x3f')]);router[_0xff0a('0x24')]('/:id/interactions',auth[_0xff0a('0x9')](),controller['addInteraction']);router[_0xff0a('0x24')](_0xff0a('0x1b'),auth['isAuthenticated'](),controller[_0xff0a('0x40')]);router[_0xff0a('0x24')]('/:id/proactive_actions',auth[_0xff0a('0x9')](),controller[_0xff0a('0x41')]);router['post'](_0xff0a('0x22'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x42')]);router[_0xff0a('0x43')](_0xff0a('0xb'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x44')]);router[_0xff0a('0x45')](_0xff0a('0xb'),auth[_0xff0a('0x9')](),controller[_0xff0a('0x46')]);router['delete'](_0xff0a('0xd'),auth['isAuthenticated'](),controller[_0xff0a('0x47')]);router[_0xff0a('0x45')]('/:id/canned_answers',auth[_0xff0a('0x9')](),controller[_0xff0a('0x48')]);router[_0xff0a('0x45')](_0xff0a('0x22'),auth['isAuthenticated'](),controller[_0xff0a('0x49')]);module[_0xff0a('0x4a')]=router; \ No newline at end of file +var _0x26b1=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','format','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','offline','addInteraction','/:id/applications','addApplications','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','index','/describe','isAuthenticated'];(function(_0x5dfb58,_0x56268f){var _0x75b667=function(_0x1fb45f){while(--_0x1fb45f){_0x5dfb58['push'](_0x5dfb58['shift']());}};_0x75b667(++_0x56268f);}(_0x26b1,0xc6));var _0x126b=function(_0x44222b,_0x46e9c0){_0x44222b=_0x44222b-0x0;var _0x3d8dee=_0x26b1[_0x44222b];return _0x3d8dee;};'use strict';var multer=require(_0x126b('0x0'));var util=require(_0x126b('0x1'));var path=require(_0x126b('0x2'));var timeout=require('connect-timeout');var express=require(_0x126b('0x3'));var router=express[_0x126b('0x4')]();var fs_extra=require(_0x126b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x126b('0x6'));var config=require('../../config/environment');var controller=require(_0x126b('0x7'));router[_0x126b('0x8')]('/',auth['isAuthenticated'](),controller[_0x126b('0x9')]);router[_0x126b('0x8')](_0x126b('0xa'),auth[_0x126b('0xb')](),controller[_0x126b('0xc')]);router[_0x126b('0x8')](_0x126b('0xd'),auth[_0x126b('0xb')](),controller[_0x126b('0xe')]);router['get'](_0x126b('0xf'),auth['isAuthenticated'](),controller[_0x126b('0x10')]);router['get'](_0x126b('0x11'),auth[_0x126b('0xb')](),controller['getAnswers']);router[_0x126b('0x8')](_0x126b('0x12'),controller[_0x126b('0x13')]);router[_0x126b('0x8')](_0x126b('0x14'),controller[_0x126b('0x15')]);router[_0x126b('0x8')](_0x126b('0x16'),controller[_0x126b('0x17')]);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0x126b('0x18'),auth[_0x126b('0xb')](),controller[_0x126b('0x19')]);router['get'](_0x126b('0x1a'),controller['getSnippet']);router[_0x126b('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x126b('0x8')](_0x126b('0x1b'),auth[_0x126b('0xb')](),controller[_0x126b('0x1c')]);router[_0x126b('0x8')](_0x126b('0x1d'),controller[_0x126b('0x1e')]);router[_0x126b('0x8')](_0x126b('0x1f'),auth[_0x126b('0xb')](),controller[_0x126b('0x20')]);router[_0x126b('0x8')](_0x126b('0x21'),auth[_0x126b('0xb')](),controller[_0x126b('0x22')]);router[_0x126b('0x23')]('/',auth[_0x126b('0xb')](),controller[_0x126b('0x24')]);router[_0x126b('0x23')](_0x126b('0xf'),auth[_0x126b('0xb')](),controller[_0x126b('0x25')]);router['post'](_0x126b('0x11'),auth[_0x126b('0xb')](),controller[_0x126b('0x26')]);var upload=multer({'storage':multer[_0x126b('0x27')]({'destination':function(_0x231fd5,_0x4c392d,_0x5a3ec9){_0x5a3ec9(null,path[_0x126b('0x28')](config[_0x126b('0x29')],'server/files/images/logos/'));},'filename':function(_0x20d83b,_0x52b1af,_0x40f28c){_0x40f28c(null,util['format'](_0x126b('0x2a'),Date[_0x126b('0x2b')](),_0x52b1af[_0x126b('0x2c')]));}})});router[_0x126b('0x23')]('/:id/logo',upload[_0x126b('0x2d')](_0x126b('0x2e')),controller[_0x126b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x568a3c,_0x444c58,_0xe10333){_0xe10333(null,path[_0x126b('0x28')](config[_0x126b('0x29')],_0x126b('0x30')));},'filename':function(_0x5b0cc7,_0x2eeee4,_0x13d45a){_0x13d45a(null,util['format']('%s-%s',Date['now'](),_0x2eeee4[_0x126b('0x2c')]));}})});router['post'](_0x126b('0x14'),upload['single']('file'),controller[_0x126b('0x31')]);var upload=multer({'storage':multer[_0x126b('0x27')]({'destination':function(_0x2b4d98,_0xde4f31,_0xd77497){_0xd77497(null,path[_0x126b('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x42fa41,_0x3c1295,_0x368235){_0x368235(null,util[_0x126b('0x32')](_0x126b('0x2a'),Date[_0x126b('0x2b')](),_0x3c1295['originalname']));}})});router['post'](_0x126b('0x16'),upload['single'](_0x126b('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x126b('0x27')]({'destination':function(_0x4677db,_0x3c0361,_0x254866){_0x254866(null,path[_0x126b('0x28')](config[_0x126b('0x29')],_0x126b('0x30')));},'filename':function(_0x4707ab,_0x312e53,_0x19b662){_0x19b662(null,util[_0x126b('0x32')]('%s-%s',Date['now'](),_0x312e53[_0x126b('0x2c')]));}})});router['post'](_0x126b('0x33'),upload[_0x126b('0x2d')](_0x126b('0x2e')),controller[_0x126b('0x34')]);router[_0x126b('0x23')](_0x126b('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x126b('0x27')]({'destination':function(_0x232137,_0x412ff3,_0x1aaebc){const _0x433c41=path['join'](config['root'],_0x126b('0x36'),'attachments',_0x126b('0x37'));fs_extra[_0x126b('0x38')](_0x433c41,function(){_0x1aaebc(null,_0x433c41);});},'filename':function(_0x188dbd,_0x4262ae,_0xa602a2){const _0x41d562=_0x4262ae[_0x126b('0x2c')][_0x126b('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2478d5=path[_0x126b('0x3a')](_0x41d562);const _0xfd8af6=Date[_0x126b('0x2b')]()+'-'+_0x41d562[_0x126b('0x39')](_0x2478d5,'')+_0x2478d5;_0xa602a2(null,_0xfd8af6);}})});router[_0x126b('0x23')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x126b('0x3b')]);router[_0x126b('0x23')](_0x126b('0x18'),auth['isAuthenticated'](),controller[_0x126b('0x3c')]);router[_0x126b('0x23')](_0x126b('0x3d'),auth['isAuthenticated'](),controller[_0x126b('0x3e')]);router['post']('/:id/proactive_actions',auth[_0x126b('0xb')](),controller['addProactiveActions']);router['post'](_0x126b('0x21'),auth[_0x126b('0xb')](),controller['addAgents']);router[_0x126b('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x126b('0x40')]);router[_0x126b('0x41')](_0x126b('0xd'),auth[_0x126b('0xb')](),controller[_0x126b('0x42')]);router[_0x126b('0x41')](_0x126b('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x126b('0x41')](_0x126b('0x11'),auth['isAuthenticated'](),controller[_0x126b('0x43')]);router[_0x126b('0x41')](_0x126b('0x21'),auth[_0x126b('0xb')](),controller[_0x126b('0x44')]);module[_0x126b('0x45')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1a2660e..c41d139 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2087=['STRING','ENUM','Google','sequelize','exports'];(function(_0x432aef,_0x39048d){var _0x209746=function(_0x3f8172){while(--_0x3f8172){_0x432aef['push'](_0x432aef['shift']());}};_0x209746(++_0x39048d);}(_0x2087,0xf3));var _0x7208=function(_0x2c211b,_0x3ebda0){_0x2c211b=_0x2c211b-0x0;var _0x52e51b=_0x2087[_0x2c211b];return _0x52e51b;};'use strict';var Sequelize=require(_0x7208('0x0'));module[_0x7208('0x1')]={'name':{'type':Sequelize[_0x7208('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7208('0x3')]('AmazonAWS',_0x7208('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x7208('0x2')]},'data2':{'type':Sequelize[_0x7208('0x2')]}}; \ No newline at end of file +var _0xcd59=['Google','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x562c83,_0x153164){var _0x2b91ae=function(_0x439d6a){while(--_0x439d6a){_0x562c83['push'](_0x562c83['shift']());}};_0x2b91ae(++_0x153164);}(_0xcd59,0x14b));var _0x9cd5=function(_0x1551bc,_0x334b59){_0x1551bc=_0x1551bc-0x0;var _0x228deb=_0xcd59[_0x1551bc];return _0x228deb;};'use strict';var Sequelize=require(_0x9cd5('0x0'));module[_0x9cd5('0x1')]={'name':{'type':Sequelize[_0x9cd5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9cd5('0x3')](_0x9cd5('0x4'),_0x9cd5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x9cd5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a5892e4..655ee12 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x16bea6,_0x1a488a){var _0x169899=function(_0x1cd5b3){while(--_0x1cd5b3){_0x16bea6['push'](_0x16bea6['shift']());}};_0x169899(++_0x1a488a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x77d76e,_0x106ed2){_0x77d76e=_0x77d76e-0x0;var _0x5620c8=_0x0b0e[_0x77d76e];return _0x5620c8;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file +var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x55cf49,_0x11f6eb){var _0x327c8f=function(_0x2c6797){while(--_0x2c6797){_0x55cf49['push'](_0x55cf49['shift']());}};_0x327c8f(++_0x11f6eb);}(_0x2032,0xd9));var _0x2203=function(_0x2c4323,_0x20edb8){_0x2c4323=_0x2c4323-0x0;var _0x2fda4c=_0x2032[_0x2c4323];return _0x2fda4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9ef0913..987e803 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebaf=['exports','CloudProvider','cloud_providers','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x8b2704,_0x5b51bd){var _0x41a728=function(_0x51f677){while(--_0x51f677){_0x8b2704['push'](_0x8b2704['shift']());}};_0x41a728(++_0x5b51bd);}(_0xebaf,0x1e9));var _0xfeba=function(_0x100056,_0x56e72f){_0x100056=_0x100056-0x0;var _0x48fca4=_0xebaf[_0x100056];return _0x48fca4;};'use strict';var _=require('lodash');var util=require(_0xfeba('0x0'));var logger=require(_0xfeba('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfeba('0x2'));var fs=require('fs');var path=require(_0xfeba('0x3'));var rimraf=require(_0xfeba('0x4'));var config=require(_0xfeba('0x5'));var attributes=require('./cloudProvider.attributes');module[_0xfeba('0x6')]=function(_0x1b2420,_0x267bb7){return _0x1b2420['define'](_0xfeba('0x7'),attributes,{'tableName':_0xfeba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a13=['moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api'];(function(_0x203a7b,_0x558e00){var _0x42d683=function(_0x281d7a){while(--_0x281d7a){_0x203a7b['push'](_0x203a7b['shift']());}};_0x42d683(++_0x558e00);}(_0x6a13,0xe1));var _0x36a1=function(_0x5e1828,_0x3afd2b){_0x5e1828=_0x5e1828-0x0;var _0x557092=_0x6a13[_0x5e1828];return _0x557092;};'use strict';var _=require('lodash');var util=require(_0x36a1('0x0'));var logger=require(_0x36a1('0x1'))(_0x36a1('0x2'));var moment=require(_0x36a1('0x3'));var BPromise=require('bluebird');var rp=require(_0x36a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36a1('0x5'));var config=require(_0x36a1('0x6'));var attributes=require(_0x36a1('0x7'));module[_0x36a1('0x8')]=function(_0x89c0dc,_0x56c066){return _0x89c0dc[_0x36a1('0x9')](_0x36a1('0xa'),attributes,{'tableName':_0x36a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 592fa2f..e7fa690 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5af=['jayson/promise','client','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x856c17,_0x1a7d3c){var _0x233e69=function(_0x57859f){while(--_0x57859f){_0x856c17['push'](_0x856c17['shift']());}};_0x233e69(++_0x1a7d3c);}(_0xe5af,0x9c));var _0xfe5a=function(_0x7e88d8,_0x30c3cd){_0x7e88d8=_0x7e88d8-0x0;var _0x11de70=_0xe5af[_0x7e88d8];return _0x11de70;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});} \ No newline at end of file +var _0xa49b=['../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa49b,0x126));var _0xba49=function(_0x3beea3,_0x2d4cb1){_0x3beea3=_0x3beea3-0x0;var _0x50d664=_0xa49b[_0x3beea3];return _0x50d664;};'use strict';var _=require('lodash');var util=require(_0xba49('0x0'));var moment=require(_0xba49('0x1'));var BPromise=require(_0xba49('0x2'));var rs=require(_0xba49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba49('0x4'))['db'];var utils=require(_0xba49('0x5'));var logger=require(_0xba49('0x6'))('rpc');var config=require(_0xba49('0x7'));var jayson=require(_0xba49('0x8'));var client=jayson[_0xba49('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd5d20d,_0x4b29c0,_0x1f5909){return new BPromise(function(_0x47340c,_0x2bfae5){return client['request'](_0xd5d20d,_0x1f5909)[_0xba49('0xa')](function(_0x249dd6){logger[_0xba49('0xb')](_0xba49('0xc'),_0x4b29c0,'request\x20sent');logger[_0xba49('0xd')](_0xba49('0xe'),_0x4b29c0,_0xba49('0xf'),JSON['stringify'](_0x249dd6));if(_0x249dd6['error']){if(_0x249dd6[_0xba49('0x10')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x4b29c0,_0x249dd6[_0xba49('0x10')]['message']);return _0x2bfae5(_0x249dd6['error'][_0xba49('0x11')]);}logger[_0xba49('0x10')](_0xba49('0xc'),_0x4b29c0,_0x249dd6[_0xba49('0x10')]['message']);return _0x47340c(_0x249dd6[_0xba49('0x10')][_0xba49('0x11')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x4b29c0,_0xba49('0xf'));_0x47340c(_0x249dd6[_0xba49('0x12')][_0xba49('0x11')]);}})[_0xba49('0x13')](function(_0x56980f){logger[_0xba49('0x10')](_0xba49('0xc'),_0x4b29c0,_0x56980f);_0x2bfae5(_0x56980f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 6f8ff43..1ccab45 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55cf=['multer','util','path','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x134236,_0x245170){var _0x40e2f6=function(_0x451235){while(--_0x451235){_0x134236['push'](_0x134236['shift']());}};_0x40e2f6(++_0x245170);}(_0x55cf,0xab));var _0xf55c=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x55cf[_0x494d1f];return _0x457b6e;};'use strict';var multer=require(_0xf55c('0x0'));var util=require(_0xf55c('0x1'));var path=require(_0xf55c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf55c('0x3')]();var fs_extra=require(_0xf55c('0x4'));var auth=require(_0xf55c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf55c('0x6'));router[_0xf55c('0x7')]('/',auth[_0xf55c('0x8')](),controller[_0xf55c('0x9')]);router[_0xf55c('0x7')](_0xf55c('0xa'),auth[_0xf55c('0x8')](),controller[_0xf55c('0xb')]);router[_0xf55c('0xc')]('/',auth['isAuthenticated'](),controller[_0xf55c('0xd')]);router[_0xf55c('0xe')](_0xf55c('0xa'),auth['isAuthenticated'](),controller[_0xf55c('0xf')]);router[_0xf55c('0x10')](_0xf55c('0xa'),auth['isAuthenticated'](),controller[_0xf55c('0x11')]);module[_0xf55c('0x12')]=router; \ No newline at end of file +var _0x151b=['express','Router','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45b4e1,_0xcfcfec){var _0x118778=function(_0x4e4e1e){while(--_0x4e4e1e){_0x45b4e1['push'](_0x45b4e1['shift']());}};_0x118778(++_0xcfcfec);}(_0x151b,0x152));var _0xb151=function(_0x454049,_0x9fbd3a){_0x454049=_0x454049-0x0;var _0x3e975a=_0x151b[_0x454049];return _0x3e975a;};'use strict';var multer=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var path=require(_0xb151('0x2'));var timeout=require(_0xb151('0x3'));var express=require(_0xb151('0x4'));var router=express[_0xb151('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb151('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb151('0x7'));var controller=require(_0xb151('0x8'));router[_0xb151('0x9')]('/',auth['isAuthenticated'](),controller[_0xb151('0xa')]);router[_0xb151('0x9')]('/:id',auth[_0xb151('0xb')](),controller[_0xb151('0xc')]);router['post']('/',auth[_0xb151('0xb')](),controller[_0xb151('0xd')]);router['put'](_0xb151('0xe'),auth[_0xb151('0xb')](),controller[_0xb151('0xf')]);router[_0xb151('0x10')](_0xb151('0xe'),auth['isAuthenticated'](),controller[_0xb151('0x11')]);module[_0xb151('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 93f9dab..ff79151 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 _0x68c3=['sequelize','name','STRING'];(function(_0x5af042,_0x320ae3){var _0x5a96e5=function(_0x2722a2){while(--_0x2722a2){_0x5af042['push'](_0x5af042['shift']());}};_0x5a96e5(++_0x320ae3);}(_0x68c3,0x66));var _0x368c=function(_0x3fb2d4,_0x44a3a8){_0x3fb2d4=_0x3fb2d4-0x0;var _0x4cfd9a=_0x68c3[_0x3fb2d4];return _0x4cfd9a;};'use strict';var Sequelize=require(_0x368c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x368c('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x368c('0x2')]},'companyId':{'type':Sequelize[_0x368c('0x2')]},'website':{'type':Sequelize[_0x368c('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x368c('0x2')]},'type':{'type':Sequelize[_0x368c('0x2')]},'street':{'type':Sequelize[_0x368c('0x2')]},'postalCode':{'type':Sequelize[_0x368c('0x2')]},'city':{'type':Sequelize[_0x368c('0x2')]},'country':{'type':Sequelize[_0x368c('0x2')]},'email':{'type':Sequelize[_0x368c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x368c('0x2')]},'sStreet':{'type':Sequelize[_0x368c('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x368c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x368c('0x2')]}}; \ No newline at end of file +var _0xa4b7=['name','STRING','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa4b7,0xbf));var _0x7a4b=function(_0x17ae55,_0x134051){_0x17ae55=_0x17ae55-0x0;var _0x2f9738=_0xa4b7[_0x17ae55];return _0x2f9738;};'use strict';var Sequelize=require(_0x7a4b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7a4b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7a4b('0x2')]},'companyId':{'type':Sequelize[_0x7a4b('0x2')]},'website':{'type':Sequelize[_0x7a4b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7a4b('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7a4b('0x2')]},'postalCode':{'type':Sequelize[_0x7a4b('0x2')]},'city':{'type':Sequelize[_0x7a4b('0x2')]},'country':{'type':Sequelize[_0x7a4b('0x2')]},'email':{'type':Sequelize[_0x7a4b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7a4b('0x2')]},'sStreet':{'type':Sequelize[_0x7a4b('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x7a4b('0x2')]},'sCountry':{'type':Sequelize[_0x7a4b('0x2')]},'description':{'type':Sequelize[_0x7a4b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 9129e74..4e39f1a 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 _0x40a1=['offset','undefined','limit','apply','reject','save','then','destroy','Companies','end','sendStatus','error','stack','name','send','index','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','map','CmCompany','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','omit','getContacts','order','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x40a1,0x139));var _0x140a=function(_0x54d72a,_0xfc7b54){_0x54d72a=_0x54d72a-0x0;var _0x468a6a=_0x40a1[_0x54d72a];return _0x468a6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x140a('0x0'));var zipdir=require(_0x140a('0x1'));var jsonpatch=require(_0x140a('0x2'));var rp=require(_0x140a('0x3'));var moment=require(_0x140a('0x4'));var BPromise=require(_0x140a('0x5'));var Mustache=require('mustache');var util=require(_0x140a('0x6'));var path=require(_0x140a('0x7'));var sox=require(_0x140a('0x8'));var csv=require(_0x140a('0x9'));var ejs=require(_0x140a('0xa'));var fs=require('fs');var fs_extra=require(_0x140a('0xb'));var _=require('lodash');var squel=require(_0x140a('0xc'));var crypto=require(_0x140a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x140a('0xe'));var toCsv=require(_0x140a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x140a('0xf'));var authService=require(_0x140a('0x10'));var qs=require(_0x140a('0x11'));var as=require(_0x140a('0x12'));var hardwareService=require(_0x140a('0x13'));var logger=require(_0x140a('0x14'))(_0x140a('0x15'));var utils=require('../../config/utils');var config=require(_0x140a('0x16'));var licenseUtil=require(_0x140a('0x17'));var db=require(_0x140a('0x18'))['db'];function respondWithStatusCode(_0x1282a0,_0x23332d){_0x23332d=_0x23332d||0xcc;return function(_0xeab627){if(_0xeab627){return _0x1282a0['sendStatus'](_0x23332d);}return _0x1282a0[_0x140a('0x19')](_0x23332d)['end']();};}function respondWithResult(_0x149ab1,_0x57cef9){_0x57cef9=_0x57cef9||0xc8;return function(_0x5f59dc){if(_0x5f59dc){return _0x149ab1[_0x140a('0x19')](_0x57cef9)[_0x140a('0x1a')](_0x5f59dc);}};}function respondWithFilteredResult(_0x37d5a8,_0x19b98d){return function(_0x1c2a47){if(_0x1c2a47){var _0x3997d3=typeof _0x19b98d[_0x140a('0x1b')]===_0x140a('0x1c')&&typeof _0x19b98d[_0x140a('0x1d')]===_0x140a('0x1c');var _0x2405b2=_0x1c2a47['count'];var _0xad0b1=_0x3997d3?0x0:_0x19b98d['offset'];var _0x3d7c7c=_0x3997d3?_0x1c2a47['count']:_0x19b98d[_0x140a('0x1b')]+_0x19b98d[_0x140a('0x1d')];var _0x518883;if(_0x3d7c7c>=_0x2405b2){_0x3d7c7c=_0x2405b2;_0x518883=0xc8;}else{_0x518883=0xce;}_0x37d5a8['status'](_0x518883);return _0x37d5a8['set']('Content-Range',_0xad0b1+'-'+_0x3d7c7c+'/'+_0x2405b2)[_0x140a('0x1a')](_0x1c2a47);}return null;};}function patchUpdates(_0x41ba2d){return function(_0x1f9fbd){try{jsonpatch[_0x140a('0x1e')](_0x1f9fbd,_0x41ba2d,!![]);}catch(_0x4518c6){return BPromise[_0x140a('0x1f')](_0x4518c6);}return _0x1f9fbd[_0x140a('0x20')]();};}function saveUpdates(_0x55a8e7,_0x304cba){return function(_0x5f25cc){if(_0x5f25cc){return _0x5f25cc['update'](_0x55a8e7)[_0x140a('0x21')](function(_0x159fc7){return _0x159fc7;});}return null;};}function removeEntity(_0xfcf11,_0x58a230){return function(_0x227a64){if(_0x227a64){return _0x227a64[_0x140a('0x22')]()[_0x140a('0x21')](function(){var _0x3d3220=_0x227a64['get']({'plain':!![]});var _0x1b1775=_0x140a('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b1775,'resourceId':_0x3d3220['id']}})[_0x140a('0x21')](function(){return _0x227a64;});})[_0x140a('0x21')](function(){_0xfcf11[_0x140a('0x19')](0xcc)[_0x140a('0x24')]();});}};}function handleEntityNotFound(_0xceaa6b,_0x216f4d){return function(_0x463ee1){if(!_0x463ee1){_0xceaa6b[_0x140a('0x25')](0x194);}return _0x463ee1;};}function handleError(_0x2bc9ec,_0x4e9ba4){_0x4e9ba4=_0x4e9ba4||0x1f4;return function(_0x3299de){logger[_0x140a('0x26')](_0x3299de[_0x140a('0x27')]);if(_0x3299de[_0x140a('0x28')]){delete _0x3299de['name'];}_0x2bc9ec['status'](_0x4e9ba4)[_0x140a('0x29')](_0x3299de);};}exports[_0x140a('0x2a')]=function(_0x5baf42,_0xdeb736){var _0x16df63={},_0x1317e7={},_0xc482a3={'count':0x0,'rows':[]};return db['CmCompany'][_0x140a('0x2b')]()['then'](function(_0x178579){_0x1317e7[_0x140a('0x2c')]=_[_0x140a('0x2d')](_0x178579);_0x1317e7[_0x140a('0x2e')]=_[_0x140a('0x2d')](_0x5baf42[_0x140a('0x2e')]);_0x1317e7['filters']=_[_0x140a('0x2f')](_0x1317e7[_0x140a('0x2c')],_0x1317e7['query']);_0x16df63[_0x140a('0x30')]=_[_0x140a('0x2f')](_0x1317e7['model'],qs['fields'](_0x5baf42['query'][_0x140a('0x31')]));_0x16df63['attributes']=_0x16df63[_0x140a('0x30')]['length']?_0x16df63[_0x140a('0x30')]:_0x1317e7[_0x140a('0x2c')];if(!_0x5baf42['query'][_0x140a('0x32')](_0x140a('0x33'))){_0x16df63[_0x140a('0x1d')]=qs[_0x140a('0x1d')](_0x5baf42['query'][_0x140a('0x1d')]);_0x16df63[_0x140a('0x1b')]=qs[_0x140a('0x1b')](_0x5baf42[_0x140a('0x2e')][_0x140a('0x1b')]);}_0x16df63['order']=qs[_0x140a('0x34')](_0x5baf42[_0x140a('0x2e')][_0x140a('0x34')]);_0x16df63['where']=qs[_0x140a('0x35')](_['pick'](_0x5baf42[_0x140a('0x2e')],_0x1317e7[_0x140a('0x35')]),_0x178579);if(_0x5baf42[_0x140a('0x2e')][_0x140a('0x36')]){_0x16df63[_0x140a('0x37')]=_[_0x140a('0x38')](_0x16df63[_0x140a('0x37')],{'$or':_[_0x140a('0x39')](_0x16df63[_0x140a('0x30')],function(_0x3fd8c2){var _0x37c783={};_0x37c783[_0x3fd8c2]={'$like':'%'+_0x5baf42[_0x140a('0x2e')][_0x140a('0x36')]+'%'};return _0x37c783;})});}_0x16df63=_[_0x140a('0x38')]({},_0x16df63,_0x5baf42['options']);var _0x29c278={'where':_0x16df63[_0x140a('0x37')]};return db[_0x140a('0x3a')][_0x140a('0x3b')](_0x29c278)[_0x140a('0x21')](function(_0x1cd7cf){_0xc482a3[_0x140a('0x3b')]=_0x1cd7cf;if(_0x5baf42['query']['includeAll']){_0x16df63[_0x140a('0x3c')]=[{'all':!![]}];}return db[_0x140a('0x3a')][_0x140a('0x3d')](_0x16df63);})['then'](function(_0x198275){_0xc482a3[_0x140a('0x3e')]=_0x198275;return _0xc482a3;})[_0x140a('0x21')](respondWithFilteredResult(_0xdeb736,_0x16df63))[_0x140a('0x3f')](handleError(_0xdeb736,null));})[_0x140a('0x3f')](handleError(_0xdeb736,null));};exports[_0x140a('0x40')]=function(_0x5b5ec8,_0xd321b5){var _0x117316={'raw':![],'where':{'id':_0x5b5ec8[_0x140a('0x41')]['id']}},_0x7a8c8d={};_0x7a8c8d[_0x140a('0x2c')]=_[_0x140a('0x2d')](db[_0x140a('0x3a')][_0x140a('0x42')]);_0x7a8c8d['query']=_['keys'](_0x5b5ec8['query']);_0x7a8c8d[_0x140a('0x35')]=_[_0x140a('0x2f')](_0x7a8c8d[_0x140a('0x2c')],_0x7a8c8d[_0x140a('0x2e')]);_0x117316[_0x140a('0x30')]=_['intersection'](_0x7a8c8d[_0x140a('0x2c')],qs['fields'](_0x5b5ec8[_0x140a('0x2e')]['fields']));_0x117316[_0x140a('0x30')]=_0x117316['attributes'][_0x140a('0x43')]?_0x117316['attributes']:_0x7a8c8d[_0x140a('0x2c')];if(_0x5b5ec8[_0x140a('0x2e')][_0x140a('0x44')]){_0x117316['include']=[{'all':!![]}];}_0x117316=_[_0x140a('0x38')]({},_0x117316,_0x5b5ec8['options']);return db[_0x140a('0x3a')][_0x140a('0x45')](_0x117316)[_0x140a('0x21')](handleEntityNotFound(_0xd321b5,null))['then'](respondWithResult(_0xd321b5,null))['catch'](handleError(_0xd321b5,null));};exports[_0x140a('0x46')]=function(_0x28c5ba,_0x5b359b){return db[_0x140a('0x3a')][_0x140a('0x46')](_0x28c5ba[_0x140a('0x47')],{})[_0x140a('0x21')](function(_0x1e4853){var _0x7ef6d3=_0x28c5ba[_0x140a('0x48')]['get']({'plain':!![]});if(!_0x7ef6d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7ef6d3[_0x140a('0x49')]==='user'){var _0x36b595=_0x1e4853['get']({'plain':!![]});var _0x392f85=_0x140a('0x23');return db[_0x140a('0x4a')][_0x140a('0x45')]({'where':{'name':_0x392f85,'userProfileId':_0x7ef6d3[_0x140a('0x4b')]},'raw':!![]})[_0x140a('0x21')](function(_0x41d060){if(_0x41d060&&_0x41d060['autoAssociation']===0x0){return db['UserProfileResource'][_0x140a('0x46')]({'name':_0x36b595[_0x140a('0x28')],'resourceId':_0x36b595['id'],'type':_0x41d060[_0x140a('0x28')],'sectionId':_0x41d060['id']},{})[_0x140a('0x21')](function(){return _0x1e4853;});}else{return _0x1e4853;}})[_0x140a('0x3f')](function(_0x3dcd1a){logger[_0x140a('0x26')](_0x140a('0x4c'),_0x3dcd1a);throw _0x3dcd1a;});}return _0x1e4853;})[_0x140a('0x21')](respondWithResult(_0x5b359b,0xc9))[_0x140a('0x3f')](handleError(_0x5b359b,null));};exports[_0x140a('0x4d')]=function(_0x21dcf2,_0x38d7ab){if(_0x21dcf2[_0x140a('0x47')]['id']){delete _0x21dcf2[_0x140a('0x47')]['id'];}return db[_0x140a('0x3a')][_0x140a('0x45')]({'where':{'id':_0x21dcf2[_0x140a('0x41')]['id']}})[_0x140a('0x21')](handleEntityNotFound(_0x38d7ab,null))[_0x140a('0x21')](saveUpdates(_0x21dcf2['body'],null))['then'](respondWithResult(_0x38d7ab,null))[_0x140a('0x3f')](handleError(_0x38d7ab,null));};exports[_0x140a('0x22')]=function(_0x1a6d6c,_0x674b57){return db[_0x140a('0x3a')][_0x140a('0x45')]({'where':{'id':_0x1a6d6c[_0x140a('0x41')]['id']}})['then'](handleEntityNotFound(_0x674b57,null))['then'](removeEntity(_0x674b57,null))[_0x140a('0x3f')](handleError(_0x674b57,null));};exports[_0x140a('0x2b')]=function(_0x276595,_0x5744b6){return db['CmCompany'][_0x140a('0x2b')]()[_0x140a('0x21')](respondWithResult(_0x5744b6,null))['catch'](handleError(_0x5744b6,null));};exports['addContacts']=function(_0x4f0198,_0x5da0df,_0x4ea5da){return db[_0x140a('0x4e')][_0x140a('0x45')]({'where':{'id':_0x4f0198[_0x140a('0x41')]['id']}})[_0x140a('0x21')](handleEntityNotFound(_0x5da0df,null))[_0x140a('0x21')](function(_0x317646){if(_0x317646){return _0x317646[_0x140a('0x4f')](_0x4f0198[_0x140a('0x47')][_0x140a('0x50')],_[_0x140a('0x51')](_0x4f0198[_0x140a('0x47')],[_0x140a('0x50'),'id'])||{});}})['then'](respondWithResult(_0x5da0df,null))[_0x140a('0x3f')](handleError(_0x5da0df,null));};exports[_0x140a('0x52')]=function(_0xfd659a,_0x263e43,_0x4788ec){var _0x973889={};var _0xf455a4={};var _0x14f457;var _0x435c1c;return db[_0x140a('0x3a')]['findOne']({'where':{'id':_0xfd659a[_0x140a('0x41')]['id']}})[_0x140a('0x21')](handleEntityNotFound(_0x263e43,null))[_0x140a('0x21')](function(_0x11db41){if(_0x11db41){_0x14f457=_0x11db41;_0xf455a4['model']=_['keys'](db[_0x140a('0x4e')][_0x140a('0x42')]);_0xf455a4[_0x140a('0x2e')]=_[_0x140a('0x2d')](_0xfd659a[_0x140a('0x2e')]);_0xf455a4[_0x140a('0x35')]=_[_0x140a('0x2f')](_0xf455a4[_0x140a('0x2c')],_0xf455a4[_0x140a('0x2e')]);_0x973889[_0x140a('0x30')]=_['intersection'](_0xf455a4[_0x140a('0x2c')],qs[_0x140a('0x31')](_0xfd659a['query'][_0x140a('0x31')]));_0x973889[_0x140a('0x30')]=_0x973889[_0x140a('0x30')][_0x140a('0x43')]?_0x973889['attributes']:_0xf455a4['model'];_0x973889[_0x140a('0x53')]=qs[_0x140a('0x34')](_0xfd659a[_0x140a('0x2e')][_0x140a('0x34')]);_0x973889[_0x140a('0x37')]=qs[_0x140a('0x35')](_[_0x140a('0x54')](_0xfd659a[_0x140a('0x2e')],_0xf455a4[_0x140a('0x35')]));if(_0xfd659a[_0x140a('0x2e')][_0x140a('0x36')]){_0x973889['where']=_['merge'](_0x973889[_0x140a('0x37')],{'$or':_[_0x140a('0x39')](_0x973889[_0x140a('0x30')],function(_0x57c2c4){var _0x4eb71e={};_0x4eb71e[_0x57c2c4]={'$like':'%'+_0xfd659a[_0x140a('0x2e')][_0x140a('0x36')]+'%'};return _0x4eb71e;})});}_0x973889=_[_0x140a('0x38')]({},_0x973889,_0xfd659a['options']);return _0x14f457[_0x140a('0x52')](_0x973889);}})['then'](function(_0x382a04){if(_0x382a04){_0x435c1c=_0x382a04[_0x140a('0x43')];if(!_0xfd659a['query'][_0x140a('0x32')]('nolimit')){_0x973889['limit']=qs[_0x140a('0x1d')](_0xfd659a[_0x140a('0x2e')][_0x140a('0x1d')]);_0x973889[_0x140a('0x1b')]=qs[_0x140a('0x1b')](_0xfd659a[_0x140a('0x2e')][_0x140a('0x1b')]);}return _0x14f457[_0x140a('0x52')](_0x973889);}})[_0x140a('0x21')](function(_0x583290){if(_0x583290){return _0x583290?{'count':_0x435c1c,'rows':_0x583290}:null;}})[_0x140a('0x21')](respondWithResult(_0x263e43,null))[_0x140a('0x3f')](handleError(_0x263e43,null));}; \ No newline at end of file +var _0xe6e2=['then','get','Companies','UserProfileResource','destroy','stack','name','send','CmCompany','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','CmContact','ids','omit','findOne','map','getContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','offset','count','limit','status','reject','save'];(function(_0x55cc96,_0x770e50){var _0x3bb2ec=function(_0x157e85){while(--_0x157e85){_0x55cc96['push'](_0x55cc96['shift']());}};_0x3bb2ec(++_0x770e50);}(_0xe6e2,0x195));var _0x2e6e=function(_0x548e62,_0x2338c3){_0x548e62=_0x548e62-0x0;var _0x37c4b8=_0xe6e2[_0x548e62];return _0x37c4b8;};'use strict';var emlformat=require(_0x2e6e('0x0'));var rimraf=require(_0x2e6e('0x1'));var zipdir=require(_0x2e6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e6e('0x3'));var moment=require(_0x2e6e('0x4'));var BPromise=require(_0x2e6e('0x5'));var Mustache=require(_0x2e6e('0x6'));var util=require(_0x2e6e('0x7'));var path=require('path');var sox=require(_0x2e6e('0x8'));var csv=require(_0x2e6e('0x9'));var ejs=require(_0x2e6e('0xa'));var fs=require('fs');var fs_extra=require(_0x2e6e('0xb'));var _=require(_0x2e6e('0xc'));var squel=require(_0x2e6e('0xd'));var crypto=require('crypto');var jsforce=require(_0x2e6e('0xe'));var deskjs=require(_0x2e6e('0xf'));var toCsv=require(_0x2e6e('0x9'));var querystring=require(_0x2e6e('0x10'));var Papa=require(_0x2e6e('0x11'));var Redis=require(_0x2e6e('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2e6e('0x13'));var hardwareService=require(_0x2e6e('0x14'));var logger=require(_0x2e6e('0x15'))(_0x2e6e('0x16'));var utils=require('../../config/utils');var config=require(_0x2e6e('0x17'));var licenseUtil=require(_0x2e6e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e685d,_0x1ddcbc){_0x1ddcbc=_0x1ddcbc||0xcc;return function(_0x5b8279){if(_0x5b8279){return _0x2e685d[_0x2e6e('0x19')](_0x1ddcbc);}return _0x2e685d['status'](_0x1ddcbc)[_0x2e6e('0x1a')]();};}function respondWithResult(_0x33af76,_0x3a654b){_0x3a654b=_0x3a654b||0xc8;return function(_0x38c93c){if(_0x38c93c){return _0x33af76['status'](_0x3a654b)[_0x2e6e('0x1b')](_0x38c93c);}};}function respondWithFilteredResult(_0x34e834,_0xba5147){return function(_0x58c424){if(_0x58c424){var _0x12b5f1=typeof _0xba5147['offset']==='undefined'&&typeof _0xba5147['limit']===_0x2e6e('0x1c');var _0x543f66=_0x58c424['count'];var _0x170d0b=_0x12b5f1?0x0:_0xba5147[_0x2e6e('0x1d')];var _0x1024fd=_0x12b5f1?_0x58c424[_0x2e6e('0x1e')]:_0xba5147[_0x2e6e('0x1d')]+_0xba5147[_0x2e6e('0x1f')];var _0x1ddef6;if(_0x1024fd>=_0x543f66){_0x1024fd=_0x543f66;_0x1ddef6=0xc8;}else{_0x1ddef6=0xce;}_0x34e834[_0x2e6e('0x20')](_0x1ddef6);return _0x34e834['set']('Content-Range',_0x170d0b+'-'+_0x1024fd+'/'+_0x543f66)[_0x2e6e('0x1b')](_0x58c424);}return null;};}function patchUpdates(_0x109244){return function(_0x23881f){try{jsonpatch['apply'](_0x23881f,_0x109244,!![]);}catch(_0x3e9e36){return BPromise[_0x2e6e('0x21')](_0x3e9e36);}return _0x23881f[_0x2e6e('0x22')]();};}function saveUpdates(_0x356491,_0x1854e5){return function(_0xdbe530){if(_0xdbe530){return _0xdbe530['update'](_0x356491)[_0x2e6e('0x23')](function(_0x45178b){return _0x45178b;});}return null;};}function removeEntity(_0x40cc76,_0x38eede){return function(_0x283cc5){if(_0x283cc5){return _0x283cc5['destroy']()[_0x2e6e('0x23')](function(){var _0x1e6788=_0x283cc5[_0x2e6e('0x24')]({'plain':!![]});var _0x16fcb=_0x2e6e('0x25');return db[_0x2e6e('0x26')][_0x2e6e('0x27')]({'where':{'type':_0x16fcb,'resourceId':_0x1e6788['id']}})[_0x2e6e('0x23')](function(){return _0x283cc5;});})[_0x2e6e('0x23')](function(){_0x40cc76[_0x2e6e('0x20')](0xcc)[_0x2e6e('0x1a')]();});}};}function handleEntityNotFound(_0x1b33af,_0x1af1a6){return function(_0x395a21){if(!_0x395a21){_0x1b33af[_0x2e6e('0x19')](0x194);}return _0x395a21;};}function handleError(_0x1bdf74,_0x2b6b5b){_0x2b6b5b=_0x2b6b5b||0x1f4;return function(_0x23bf9c){logger['error'](_0x23bf9c[_0x2e6e('0x28')]);if(_0x23bf9c['name']){delete _0x23bf9c[_0x2e6e('0x29')];}_0x1bdf74[_0x2e6e('0x20')](_0x2b6b5b)[_0x2e6e('0x2a')](_0x23bf9c);};}exports['index']=function(_0x57f94b,_0x38d19b){var _0x102bf7={},_0x559c45={},_0x1744da={'count':0x0,'rows':[]};return db[_0x2e6e('0x2b')]['describe']()[_0x2e6e('0x23')](function(_0x3fafb2){_0x559c45['model']=_[_0x2e6e('0x2c')](_0x3fafb2);_0x559c45[_0x2e6e('0x2d')]=_[_0x2e6e('0x2c')](_0x57f94b['query']);_0x559c45[_0x2e6e('0x2e')]=_['intersection'](_0x559c45[_0x2e6e('0x2f')],_0x559c45['query']);_0x102bf7[_0x2e6e('0x30')]=_[_0x2e6e('0x31')](_0x559c45[_0x2e6e('0x2f')],qs['fields'](_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x32')]));_0x102bf7[_0x2e6e('0x30')]=_0x102bf7[_0x2e6e('0x30')][_0x2e6e('0x33')]?_0x102bf7['attributes']:_0x559c45[_0x2e6e('0x2f')];if(!_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x34')]('nolimit')){_0x102bf7[_0x2e6e('0x1f')]=qs[_0x2e6e('0x1f')](_0x57f94b[_0x2e6e('0x2d')]['limit']);_0x102bf7[_0x2e6e('0x1d')]=qs[_0x2e6e('0x1d')](_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x1d')]);}_0x102bf7[_0x2e6e('0x35')]=qs[_0x2e6e('0x36')](_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x36')]);_0x102bf7[_0x2e6e('0x37')]=qs[_0x2e6e('0x2e')](_[_0x2e6e('0x38')](_0x57f94b[_0x2e6e('0x2d')],_0x559c45[_0x2e6e('0x2e')]),_0x3fafb2);if(_0x57f94b[_0x2e6e('0x2d')]['filter']){_0x102bf7[_0x2e6e('0x37')]=_[_0x2e6e('0x39')](_0x102bf7[_0x2e6e('0x37')],{'$or':_['map'](_0x102bf7[_0x2e6e('0x30')],function(_0x468620){var _0x14002b={};_0x14002b[_0x468620]={'$like':'%'+_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x3a')]+'%'};return _0x14002b;})});}_0x102bf7=_['merge']({},_0x102bf7,_0x57f94b[_0x2e6e('0x3b')]);var _0x5b738f={'where':_0x102bf7[_0x2e6e('0x37')]};return db[_0x2e6e('0x2b')][_0x2e6e('0x1e')](_0x5b738f)['then'](function(_0xac4e35){_0x1744da[_0x2e6e('0x1e')]=_0xac4e35;if(_0x57f94b[_0x2e6e('0x2d')][_0x2e6e('0x3c')]){_0x102bf7[_0x2e6e('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0x2e6e('0x3e')](_0x102bf7);})[_0x2e6e('0x23')](function(_0x465e57){_0x1744da[_0x2e6e('0x3f')]=_0x465e57;return _0x1744da;})[_0x2e6e('0x23')](respondWithFilteredResult(_0x38d19b,_0x102bf7))[_0x2e6e('0x40')](handleError(_0x38d19b,null));})[_0x2e6e('0x40')](handleError(_0x38d19b,null));};exports[_0x2e6e('0x41')]=function(_0x561d61,_0x1c6724){var _0x5a7287={'raw':![],'where':{'id':_0x561d61[_0x2e6e('0x42')]['id']}},_0x3ea691={};_0x3ea691[_0x2e6e('0x2f')]=_['keys'](db[_0x2e6e('0x2b')][_0x2e6e('0x43')]);_0x3ea691['query']=_[_0x2e6e('0x2c')](_0x561d61[_0x2e6e('0x2d')]);_0x3ea691[_0x2e6e('0x2e')]=_['intersection'](_0x3ea691[_0x2e6e('0x2f')],_0x3ea691[_0x2e6e('0x2d')]);_0x5a7287['attributes']=_[_0x2e6e('0x31')](_0x3ea691[_0x2e6e('0x2f')],qs[_0x2e6e('0x32')](_0x561d61['query'][_0x2e6e('0x32')]));_0x5a7287[_0x2e6e('0x30')]=_0x5a7287[_0x2e6e('0x30')]['length']?_0x5a7287[_0x2e6e('0x30')]:_0x3ea691[_0x2e6e('0x2f')];if(_0x561d61[_0x2e6e('0x2d')][_0x2e6e('0x3c')]){_0x5a7287['include']=[{'all':!![]}];}_0x5a7287=_[_0x2e6e('0x39')]({},_0x5a7287,_0x561d61[_0x2e6e('0x3b')]);return db[_0x2e6e('0x2b')][_0x2e6e('0x44')](_0x5a7287)[_0x2e6e('0x23')](handleEntityNotFound(_0x1c6724,null))[_0x2e6e('0x23')](respondWithResult(_0x1c6724,null))[_0x2e6e('0x40')](handleError(_0x1c6724,null));};exports[_0x2e6e('0x45')]=function(_0x9ea45d,_0x1f42c4){return db[_0x2e6e('0x2b')][_0x2e6e('0x45')](_0x9ea45d[_0x2e6e('0x46')],{})[_0x2e6e('0x23')](function(_0x34f230){var _0x4c3d7f=_0x9ea45d[_0x2e6e('0x47')][_0x2e6e('0x24')]({'plain':!![]});if(!_0x4c3d7f)throw new Error(_0x2e6e('0x48'));if(_0x4c3d7f[_0x2e6e('0x49')]===_0x2e6e('0x47')){var _0x1f4376=_0x34f230['get']({'plain':!![]});var _0x55ab14=_0x2e6e('0x25');return db[_0x2e6e('0x4a')][_0x2e6e('0x44')]({'where':{'name':_0x55ab14,'userProfileId':_0x4c3d7f[_0x2e6e('0x4b')]},'raw':!![]})[_0x2e6e('0x23')](function(_0x53b3b8){if(_0x53b3b8&&_0x53b3b8[_0x2e6e('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f4376[_0x2e6e('0x29')],'resourceId':_0x1f4376['id'],'type':_0x53b3b8[_0x2e6e('0x29')],'sectionId':_0x53b3b8['id']},{})[_0x2e6e('0x23')](function(){return _0x34f230;});}else{return _0x34f230;}})[_0x2e6e('0x40')](function(_0x1f7e6a){logger[_0x2e6e('0x4d')](_0x2e6e('0x4e'),_0x1f7e6a);throw _0x1f7e6a;});}return _0x34f230;})[_0x2e6e('0x23')](respondWithResult(_0x1f42c4,0xc9))['catch'](handleError(_0x1f42c4,null));};exports[_0x2e6e('0x4f')]=function(_0x394086,_0x4adf7c){if(_0x394086[_0x2e6e('0x46')]['id']){delete _0x394086['body']['id'];}return db[_0x2e6e('0x2b')][_0x2e6e('0x44')]({'where':{'id':_0x394086[_0x2e6e('0x42')]['id']}})['then'](handleEntityNotFound(_0x4adf7c,null))[_0x2e6e('0x23')](saveUpdates(_0x394086[_0x2e6e('0x46')],null))['then'](respondWithResult(_0x4adf7c,null))[_0x2e6e('0x40')](handleError(_0x4adf7c,null));};exports[_0x2e6e('0x27')]=function(_0x518b30,_0x394aff){return db[_0x2e6e('0x2b')]['find']({'where':{'id':_0x518b30[_0x2e6e('0x42')]['id']}})[_0x2e6e('0x23')](handleEntityNotFound(_0x394aff,null))[_0x2e6e('0x23')](removeEntity(_0x394aff,null))[_0x2e6e('0x40')](handleError(_0x394aff,null));};exports[_0x2e6e('0x50')]=function(_0x16d444,_0x44b425){return db[_0x2e6e('0x2b')]['describe']()['then'](respondWithResult(_0x44b425,null))[_0x2e6e('0x40')](handleError(_0x44b425,null));};exports[_0x2e6e('0x51')]=function(_0x21d2cb,_0x270fde,_0x52959e){return db[_0x2e6e('0x52')]['find']({'where':{'id':_0x21d2cb[_0x2e6e('0x42')]['id']}})[_0x2e6e('0x23')](handleEntityNotFound(_0x270fde,null))[_0x2e6e('0x23')](function(_0x1d749f){if(_0x1d749f){return _0x1d749f[_0x2e6e('0x51')](_0x21d2cb[_0x2e6e('0x46')][_0x2e6e('0x53')],_[_0x2e6e('0x54')](_0x21d2cb[_0x2e6e('0x46')],[_0x2e6e('0x53'),'id'])||{});}})[_0x2e6e('0x23')](respondWithResult(_0x270fde,null))[_0x2e6e('0x40')](handleError(_0x270fde,null));};exports['getContacts']=function(_0x20af69,_0x4cca16,_0x6de988){var _0x12a3b6={};var _0x234f73={};var _0x6cfb98;var _0x303127;return db[_0x2e6e('0x2b')][_0x2e6e('0x55')]({'where':{'id':_0x20af69['params']['id']}})[_0x2e6e('0x23')](handleEntityNotFound(_0x4cca16,null))['then'](function(_0x21a43f){if(_0x21a43f){_0x6cfb98=_0x21a43f;_0x234f73[_0x2e6e('0x2f')]=_[_0x2e6e('0x2c')](db[_0x2e6e('0x52')][_0x2e6e('0x43')]);_0x234f73['query']=_[_0x2e6e('0x2c')](_0x20af69[_0x2e6e('0x2d')]);_0x234f73['filters']=_['intersection'](_0x234f73[_0x2e6e('0x2f')],_0x234f73[_0x2e6e('0x2d')]);_0x12a3b6[_0x2e6e('0x30')]=_[_0x2e6e('0x31')](_0x234f73['model'],qs['fields'](_0x20af69['query'][_0x2e6e('0x32')]));_0x12a3b6[_0x2e6e('0x30')]=_0x12a3b6['attributes'][_0x2e6e('0x33')]?_0x12a3b6[_0x2e6e('0x30')]:_0x234f73[_0x2e6e('0x2f')];_0x12a3b6[_0x2e6e('0x35')]=qs[_0x2e6e('0x36')](_0x20af69[_0x2e6e('0x2d')][_0x2e6e('0x36')]);_0x12a3b6[_0x2e6e('0x37')]=qs[_0x2e6e('0x2e')](_['pick'](_0x20af69[_0x2e6e('0x2d')],_0x234f73[_0x2e6e('0x2e')]));if(_0x20af69[_0x2e6e('0x2d')][_0x2e6e('0x3a')]){_0x12a3b6['where']=_['merge'](_0x12a3b6[_0x2e6e('0x37')],{'$or':_[_0x2e6e('0x56')](_0x12a3b6[_0x2e6e('0x30')],function(_0x19408c){var _0x4ffe66={};_0x4ffe66[_0x19408c]={'$like':'%'+_0x20af69[_0x2e6e('0x2d')][_0x2e6e('0x3a')]+'%'};return _0x4ffe66;})});}_0x12a3b6=_[_0x2e6e('0x39')]({},_0x12a3b6,_0x20af69[_0x2e6e('0x3b')]);return _0x6cfb98[_0x2e6e('0x57')](_0x12a3b6);}})[_0x2e6e('0x23')](function(_0x588f75){if(_0x588f75){_0x303127=_0x588f75[_0x2e6e('0x33')];if(!_0x20af69[_0x2e6e('0x2d')]['hasOwnProperty']('nolimit')){_0x12a3b6[_0x2e6e('0x1f')]=qs[_0x2e6e('0x1f')](_0x20af69[_0x2e6e('0x2d')]['limit']);_0x12a3b6[_0x2e6e('0x1d')]=qs['offset'](_0x20af69[_0x2e6e('0x2d')]['offset']);}return _0x6cfb98[_0x2e6e('0x57')](_0x12a3b6);}})[_0x2e6e('0x23')](function(_0x46de9a){if(_0x46de9a){return _0x46de9a?{'count':_0x303127,'rows':_0x46de9a}:null;}})[_0x2e6e('0x23')](respondWithResult(_0x4cca16,null))[_0x2e6e('0x40')](handleError(_0x4cca16,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 038395a..dba9d6a 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 _0xf136=['exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3f68c8,_0x44724f){var _0x2ab867=function(_0x1ff5a6){while(--_0x1ff5a6){_0x3f68c8['push'](_0x3f68c8['shift']());}};_0x2ab867(++_0x44724f);}(_0xf136,0xb8));var _0x6f13=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xf136[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x6f13('0x0'));var util=require('util');var logger=require(_0x6f13('0x1'))(_0x6f13('0x2'));var moment=require(_0x6f13('0x3'));var BPromise=require(_0x6f13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f13('0x5'));var rimraf=require(_0x6f13('0x6'));var config=require(_0x6f13('0x7'));var attributes=require('./cmCompany.attributes');module[_0x6f13('0x8')]=function(_0x5ac7c8,_0x42107e){return _0x5ac7c8[_0x6f13('0x9')](_0x6f13('0xa'),attributes,{'tableName':_0x6f13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a8c=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany'];(function(_0x427f3f,_0x3f8e69){var _0x208abd=function(_0x50dff0){while(--_0x50dff0){_0x427f3f['push'](_0x427f3f['shift']());}};_0x208abd(++_0x3f8e69);}(_0x2a8c,0x122));var _0xc2a8=function(_0x5581d3,_0x52e088){_0x5581d3=_0x5581d3-0x0;var _0x1958ff=_0x2a8c[_0x5581d3];return _0x1958ff;};'use strict';var _=require(_0xc2a8('0x0'));var util=require(_0xc2a8('0x1'));var logger=require(_0xc2a8('0x2'))(_0xc2a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2a8('0x4'));var rimraf=require(_0xc2a8('0x5'));var config=require(_0xc2a8('0x6'));var attributes=require(_0xc2a8('0x7'));module['exports']=function(_0x5ccb37,_0x209815){return _0x5ccb37[_0xc2a8('0x8')](_0xc2a8('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index ef3a701..1fd7132 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 _0xc2d7=['client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','bluebird','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x4759f1,_0x1607af){var _0x56f0c9=function(_0x23659a){while(--_0x23659a){_0x4759f1['push'](_0x4759f1['shift']());}};_0x56f0c9(++_0x1607af);}(_0xc2d7,0xd7));var _0x7c2d=function(_0x268cd2,_0x43e006){_0x268cd2=_0x268cd2-0x0;var _0x422504=_0xc2d7[_0x268cd2];return _0x422504;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7c2d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c2d('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7c2d('0x2'));var config=require(_0x7c2d('0x3'));var jayson=require(_0x7c2d('0x4'));var client=jayson[_0x7c2d('0x5')][_0x7c2d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a8c48,_0x26edc8,_0x1dc67d){return new BPromise(function(_0x57a868,_0xf0bd0f){return client[_0x7c2d('0x7')](_0x1a8c48,_0x1dc67d)[_0x7c2d('0x8')](function(_0x247e33){logger[_0x7c2d('0x9')]('CmCompany,\x20%s,\x20%s',_0x26edc8,_0x7c2d('0xa'));logger[_0x7c2d('0xb')](_0x7c2d('0xc'),_0x26edc8,_0x7c2d('0xa'),JSON[_0x7c2d('0xd')](_0x247e33));if(_0x247e33['error']){if(_0x247e33[_0x7c2d('0xe')][_0x7c2d('0xf')]===0x1f4){logger[_0x7c2d('0xe')](_0x7c2d('0x10'),_0x26edc8,_0x247e33[_0x7c2d('0xe')][_0x7c2d('0x11')]);return _0xf0bd0f(_0x247e33[_0x7c2d('0xe')][_0x7c2d('0x11')]);}logger[_0x7c2d('0xe')]('CmCompany,\x20%s,\x20%s',_0x26edc8,_0x247e33[_0x7c2d('0xe')][_0x7c2d('0x11')]);return _0x57a868(_0x247e33['error']['message']);}else{logger[_0x7c2d('0x9')]('CmCompany,\x20%s,\x20%s',_0x26edc8,'request\x20sent');_0x57a868(_0x247e33[_0x7c2d('0x12')][_0x7c2d('0x11')]);}})[_0x7c2d('0x13')](function(_0x3c2400){logger['error']('CmCompany,\x20%s,\x20%s',_0x26edc8,_0x3c2400);_0xf0bd0f(_0x3c2400);});});} \ No newline at end of file +var _0x0274=['CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x1e2254,_0x3f771b){var _0x3bf1a1=function(_0xf6bad2){while(--_0xf6bad2){_0x1e2254['push'](_0x1e2254['shift']());}};_0x3bf1a1(++_0x3f771b);}(_0x0274,0x64));var _0x4027=function(_0x1e73a7,_0x1c9d78){_0x1e73a7=_0x1e73a7-0x0;var _0x1af533=_0x0274[_0x1e73a7];return _0x1af533;};'use strict';var _=require(_0x4027('0x0'));var util=require(_0x4027('0x1'));var moment=require(_0x4027('0x2'));var BPromise=require(_0x4027('0x3'));var rs=require(_0x4027('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4027('0x5'));var logger=require(_0x4027('0x6'))(_0x4027('0x7'));var config=require(_0x4027('0x8'));var jayson=require(_0x4027('0x9'));var client=jayson[_0x4027('0xa')][_0x4027('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e37fb,_0x500c51,_0xfd957){return new BPromise(function(_0x148659,_0x4b71da){return client[_0x4027('0xc')](_0x4e37fb,_0xfd957)[_0x4027('0xd')](function(_0x575fc2){logger[_0x4027('0xe')]('CmCompany,\x20%s,\x20%s',_0x500c51,_0x4027('0xf'));logger[_0x4027('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x500c51,_0x4027('0xf'),JSON[_0x4027('0x11')](_0x575fc2));if(_0x575fc2[_0x4027('0x12')]){if(_0x575fc2[_0x4027('0x12')][_0x4027('0x13')]===0x1f4){logger[_0x4027('0x12')](_0x4027('0x14'),_0x500c51,_0x575fc2[_0x4027('0x12')]['message']);return _0x4b71da(_0x575fc2[_0x4027('0x12')][_0x4027('0x15')]);}logger[_0x4027('0x12')](_0x4027('0x14'),_0x500c51,_0x575fc2[_0x4027('0x12')][_0x4027('0x15')]);return _0x148659(_0x575fc2['error'][_0x4027('0x15')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x500c51,_0x4027('0xf'));_0x148659(_0x575fc2[_0x4027('0x16')][_0x4027('0x15')]);}})[_0x4027('0x17')](function(_0x552a08){logger[_0x4027('0x12')](_0x4027('0x14'),_0x500c51,_0x552a08);_0x4b71da(_0x552a08);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 20f9d21..61d01e8 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 _0x17c1=['/:id/contacts','create','post','addContacts','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x17c1,0x1c0));var _0x117c=function(_0x368784,_0x1e0e1a){_0x368784=_0x368784-0x0;var _0x35e3b3=_0x17c1[_0x368784];return _0x35e3b3;};'use strict';var multer=require(_0x117c('0x0'));var util=require(_0x117c('0x1'));var path=require('path');var timeout=require(_0x117c('0x2'));var express=require(_0x117c('0x3'));var router=express[_0x117c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x117c('0x5'));var interaction=require(_0x117c('0x6'));var config=require('../../config/environment');var controller=require(_0x117c('0x7'));router[_0x117c('0x8')]('/',auth[_0x117c('0x9')](),controller[_0x117c('0xa')]);router[_0x117c('0x8')]('/describe',auth[_0x117c('0x9')](),controller[_0x117c('0xb')]);router['get'](_0x117c('0xc'),auth[_0x117c('0x9')](),controller[_0x117c('0xd')]);router[_0x117c('0x8')](_0x117c('0xe'),auth[_0x117c('0x9')](),controller['getContacts']);router['post']('/',auth[_0x117c('0x9')](),controller[_0x117c('0xf')]);router[_0x117c('0x10')]('/:id/contacts',auth[_0x117c('0x9')](),controller[_0x117c('0x11')]);router[_0x117c('0x12')]('/:id',auth[_0x117c('0x9')](),controller[_0x117c('0x13')]);router['delete']('/:id',auth[_0x117c('0x9')](),controller[_0x117c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x991a=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x52a073,_0x225c33){var _0x14c817=function(_0x24c042){while(--_0x24c042){_0x52a073['push'](_0x52a073['shift']());}};_0x14c817(++_0x225c33);}(_0x991a,0x172));var _0xa991=function(_0x414db0,_0x19f3eb){_0x414db0=_0x414db0-0x0;var _0xe5f700=_0x991a[_0x414db0];return _0xe5f700;};'use strict';var multer=require(_0xa991('0x0'));var util=require(_0xa991('0x1'));var path=require(_0xa991('0x2'));var timeout=require(_0xa991('0x3'));var express=require(_0xa991('0x4'));var router=express[_0xa991('0x5')]();var fs_extra=require(_0xa991('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa991('0x7'));var config=require(_0xa991('0x8'));var controller=require(_0xa991('0x9'));router[_0xa991('0xa')]('/',auth[_0xa991('0xb')](),controller[_0xa991('0xc')]);router['get'](_0xa991('0xd'),auth[_0xa991('0xb')](),controller[_0xa991('0xe')]);router[_0xa991('0xa')](_0xa991('0xf'),auth['isAuthenticated'](),controller[_0xa991('0x10')]);router[_0xa991('0xa')](_0xa991('0x11'),auth[_0xa991('0xb')](),controller[_0xa991('0x12')]);router['post']('/',auth[_0xa991('0xb')](),controller[_0xa991('0x13')]);router[_0xa991('0x14')](_0xa991('0x11'),auth[_0xa991('0xb')](),controller[_0xa991('0x15')]);router[_0xa991('0x16')](_0xa991('0xf'),auth[_0xa991('0xb')](),controller[_0xa991('0x17')]);router[_0xa991('0x18')](_0xa991('0xf'),auth['isAuthenticated'](),controller[_0xa991('0x19')]);module[_0xa991('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index fd8a37a..0bdf961 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 _0x5cdb=['UNSIGNED','NOW','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x5e06af,_0x4cfd75){var _0x31c5c0=function(_0x4becd3){while(--_0x4becd3){_0x5e06af['push'](_0x5e06af['shift']());}};_0x31c5c0(++_0x4cfd75);}(_0x5cdb,0xcd));var _0xb5cd=function(_0x95d4d0,_0x3806d8){_0x95d4d0=_0x95d4d0-0x0;var _0x3452cc=_0x5cdb[_0x95d4d0];return _0x3452cc;};'use strict';var _=require('lodash');var Sequelize=require(_0xb5cd('0x0'));module[_0xb5cd('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xb5cd('0x2')]},'street':{'type':Sequelize[_0xb5cd('0x2')]},'postalCode':{'type':Sequelize[_0xb5cd('0x2')]},'city':{'type':Sequelize[_0xb5cd('0x2')]},'country':{'type':Sequelize[_0xb5cd('0x2')]},'dateOfBirth':{'type':Sequelize[_0xb5cd('0x2')]},'description':{'type':Sequelize[_0xb5cd('0x3')]},'phone':{'type':Sequelize[_0xb5cd('0x2')]},'mobile':{'type':Sequelize[_0xb5cd('0x2')]},'fax':{'type':Sequelize[_0xb5cd('0x2')]},'email':{'type':Sequelize[_0xb5cd('0x2')]},'url':{'type':Sequelize[_0xb5cd('0x2')]},'facebook':{'type':Sequelize[_0xb5cd('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xb5cd('0x2')]},'skype':{'type':Sequelize[_0xb5cd('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xb5cd('0x2')]},'wechat':{'type':Sequelize[_0xb5cd('0x2')]},'telegram':{'type':Sequelize[_0xb5cd('0x2')]},'UserId':{'type':Sequelize[_0xb5cd('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb5cd('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb5cd('0x6')]}}; \ No newline at end of file +var _0x1cc6=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x568b12,_0x4a65f5){var _0x12cb30=function(_0x71f87f){while(--_0x71f87f){_0x568b12['push'](_0x568b12['shift']());}};_0x12cb30(++_0x4a65f5);}(_0x1cc6,0xd5));var _0x61cc=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x1cc6[_0x369a98];return _0x29565c;};'use strict';var _=require(_0x61cc('0x0'));var Sequelize=require(_0x61cc('0x1'));module[_0x61cc('0x2')]={'firstName':{'type':Sequelize[_0x61cc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x61cc('0x3')]},'city':{'type':Sequelize[_0x61cc('0x3')]},'country':{'type':Sequelize[_0x61cc('0x3')]},'dateOfBirth':{'type':Sequelize[_0x61cc('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x61cc('0x3')]},'fax':{'type':Sequelize[_0x61cc('0x3')]},'email':{'type':Sequelize[_0x61cc('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x61cc('0x3')]},'fb_data':{'type':Sequelize[_0x61cc('0x3')]},'twitter':{'type':Sequelize[_0x61cc('0x3')]},'skype':{'type':Sequelize[_0x61cc('0x3')]},'teams':{'type':Sequelize[_0x61cc('0x3')]},'viber':{'type':Sequelize[_0x61cc('0x3')]},'line':{'type':Sequelize[_0x61cc('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x61cc('0x3')]},'UserId':{'type':Sequelize[_0x61cc('0x4')]},'priority':{'type':Sequelize[_0x61cc('0x4')](0x2)[_0x61cc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x61cc('0x6')],'defaultValue':Sequelize[_0x61cc('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index d9a9d5a..be8e8e6 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 _0xbd69=['OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tag','$and','omit','format','cf_%d','id\x20=\x20?','phone','getTags','findOne','setTags','rawAttributes','ContactId','options','includeAll','include','getHopperHistories','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','pid','upload','createReadStream','file','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','CmContact','keys','length','startsWith','push','CmCustomField','trimStart','cf_','all','fieldType','type','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','find','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','map','sequelize','toString','fields','c.id','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','describe','columnName','displayName','findAll','alias','custom','values','catch','merge','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport'];(function(_0x508b69,_0xb2d613){var _0x595257=function(_0x3e8ae6){while(--_0x3e8ae6){_0x508b69['push'](_0x508b69['shift']());}};_0x595257(++_0xb2d613);}(_0xbd69,0x71));var _0x9bd6=function(_0x105966,_0x1f9ab2){_0x105966=_0x105966-0x0;var _0x4c22ae=_0xbd69[_0x105966];return _0x4c22ae;};'use strict';var emlformat=require(_0x9bd6('0x0'));var rimraf=require(_0x9bd6('0x1'));var zipdir=require(_0x9bd6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bd6('0x3'));var moment=require('moment');var BPromise=require(_0x9bd6('0x4'));var Mustache=require(_0x9bd6('0x5'));var util=require(_0x9bd6('0x6'));var path=require(_0x9bd6('0x7'));var sox=require('sox');var csv=require(_0x9bd6('0x8'));var ejs=require(_0x9bd6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9bd6('0xa'));var deskjs=require(_0x9bd6('0xb'));var toCsv=require(_0x9bd6('0x8'));var querystring=require(_0x9bd6('0xc'));var Papa=require(_0x9bd6('0xd'));var Redis=require(_0x9bd6('0xe'));var authService=require(_0x9bd6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9bd6('0x10'));var hardwareService=require(_0x9bd6('0x11'));var logger=require(_0x9bd6('0x12'))(_0x9bd6('0x13'));var utils=require(_0x9bd6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9bd6('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9bd6('0x16')](config['redis'],{'host':_0x9bd6('0x17'),'port':0x18eb});var socket=require(_0x9bd6('0x18'))(new Redis(config[_0x9bd6('0x19')]));require('./cmContact.socket')[_0x9bd6('0x1a')](socket);function respondWithStatusCode(_0x21267b,_0x3222a7){_0x3222a7=_0x3222a7||0xcc;return function(_0x539594){if(_0x539594){return _0x21267b[_0x9bd6('0x1b')](_0x3222a7);}return _0x21267b[_0x9bd6('0x1c')](_0x3222a7)[_0x9bd6('0x1d')]();};}function respondWithResult(_0x458d26,_0x294ad3){_0x294ad3=_0x294ad3||0xc8;return function(_0x7e4782){if(_0x7e4782){return _0x458d26[_0x9bd6('0x1c')](_0x294ad3)[_0x9bd6('0x1e')](_0x7e4782);}};}function respondWithFilteredResult(_0x2ac0b6,_0x2cafb7){return function(_0x3ef771){if(_0x3ef771){var _0x242114=typeof _0x2cafb7['offset']==='undefined'&&typeof _0x2cafb7[_0x9bd6('0x1f')]==='undefined';var _0xabfb56=_0x3ef771[_0x9bd6('0x20')];var _0x5ac341=_0x242114?0x0:_0x2cafb7['offset'];var _0x427fbc=_0x242114?_0x3ef771[_0x9bd6('0x20')]:_0x2cafb7['offset']+_0x2cafb7[_0x9bd6('0x1f')];var _0x5d0c0a;if(_0x427fbc>=_0xabfb56){_0x427fbc=_0xabfb56;_0x5d0c0a=0xc8;}else{_0x5d0c0a=0xce;}_0x2ac0b6[_0x9bd6('0x1c')](_0x5d0c0a);return _0x2ac0b6[_0x9bd6('0x21')]('Content-Range',_0x5ac341+'-'+_0x427fbc+'/'+_0xabfb56)[_0x9bd6('0x1e')](_0x3ef771);}return null;};}function patchUpdates(_0x209ef6){return function(_0x4a823d){try{jsonpatch['apply'](_0x4a823d,_0x209ef6,!![]);}catch(_0x272e75){return BPromise[_0x9bd6('0x22')](_0x272e75);}return _0x4a823d[_0x9bd6('0x23')]();};}function saveUpdates(_0x445ef1,_0x52a059){return function(_0x278606){if(_0x278606){return _0x278606['update'](_0x445ef1)[_0x9bd6('0x24')](function(_0x198481){return _0x198481;});}return null;};}function removeEntity(_0x456e44,_0x91cef){return function(_0x4be123){if(_0x4be123){return _0x4be123[_0x9bd6('0x25')]()[_0x9bd6('0x24')](function(){_0x456e44[_0x9bd6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1879de,_0x423fba){return function(_0x113d7d){if(!_0x113d7d){_0x1879de[_0x9bd6('0x1b')](0x194);}return _0x113d7d;};}function handleError(_0x425bee,_0x4488f8){_0x4488f8=_0x4488f8||0x1f4;return function(_0x4fff78){logger[_0x9bd6('0x26')](_0x4fff78[_0x9bd6('0x27')]);if(_0x4fff78[_0x9bd6('0x28')]){delete _0x4fff78[_0x9bd6('0x28')];}_0x425bee[_0x9bd6('0x1c')](_0x4488f8)[_0x9bd6('0x29')](_0x4fff78);};}exports[_0x9bd6('0x2a')]=function(_0x2469bf,_0x2a8c69){var _0x44a422={},_0x2a1263={},_0x46d86f={'count':0x0,'rows':[]};return db[_0x9bd6('0x2b')]['describe']()[_0x9bd6('0x24')](function(_0x4e3770){var _0x3f1d66=[];for(var _0xe67ed4=0x0;_0xe67ed40x1){_0x3c881f['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9bd6('0x6c')](_0x46dd3c),null);}else{if(qs[_0x9bd6('0x6d')](_0x46dd3c)){_0x3c881f['or']('c.id\x20LIKE\x20?',_0x46dd3c+'%');_0x3c881f['or'](_0x9bd6('0x6e'),_0x46dd3c+'%');_0x3c881f['or']('c.mobile\x20LIKE\x20?',_0x46dd3c+'%');_0x3c881f['or'](_0x9bd6('0x6f'),_0x46dd3c+'%');}else if(qs[_0x9bd6('0x70')](_0x46dd3c)){_0x3c881f['or'](_0x9bd6('0x71'),_0x46dd3c+'%');}else{_0x3c881f['or'](_0x9bd6('0x72'),'%'+_0x46dd3c+'%');_0x3c881f['or'](_0x9bd6('0x73'),'%'+_0x46dd3c+'%');_0x3c881f['or'](_0x9bd6('0x71'),'%'+_0x46dd3c+'%');}}}}_0x2333a0[_0x9bd6('0x40')](_0x3c881f);_0x2333a0[_0x9bd6('0x74')]('c.id');var _0x308c69={'type':db[_0x9bd6('0x75')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2b2907=_0x2333a0[_0x9bd6('0x76')]()['field']('c.id');if(_0x44a422[_0x9bd6('0x3e')]){_0x44a422[_0x9bd6('0x3e')][_0x9bd6('0x53')](function(_0xc61413){_0x2333a0['order']('c.'+_0xc61413[0x0],_0xc61413[0x1]===_0x9bd6('0x77')?![]:!![]);});}if(!_[_0x9bd6('0x64')](_0x4768ed)){_0x2333a0[_0x9bd6('0x78')](_0x1ef792);_0x2b2907[_0x9bd6('0x40')](_0x9bd6('0x79'),_0x4768ed);}BPromise[_0x9bd6('0x7a')]()[_0x9bd6('0x24')](function(){if(!_0xff22dd)return;if(_0x2469bf['user'][_0x9bd6('0x7b')]!==_0x9bd6('0x7c'))return;if(!_[_0x9bd6('0x7d')](_0xff22dd[_0x9bd6('0x50')],[_0x9bd6('0x43'),'User'])){return _0x2469bf[_0x9bd6('0x7e')][_0x9bd6('0x7f')]({'attributes':['id'],'raw':!![]})[_0x9bd6('0x24')](function(_0x427420){if(_['isEmpty'](_0x427420)){_0x2b2907[_0x9bd6('0x40')](_0x9bd6('0x80'));_0x2333a0[_0x9bd6('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x2b2907[_0x9bd6('0x40')]('c.ListId\x20IN\x20?',_['map'](_0x427420,'id'));_0x2333a0[_0x9bd6('0x40')](_0x9bd6('0x66'),_[_0x9bd6('0x81')](_0x427420,'id'));}});}})[_0x9bd6('0x24')](function(){if(_0x2469bf[_0x9bd6('0x7e')]['role']===_0x9bd6('0x7c')&&!_0xff22dd&&!_0x2469bf[_0x9bd6('0x36')][_0x9bd6('0x65')])return[];return db[_0x9bd6('0x82')][_0x9bd6('0x36')](_0x2b2907[_0x9bd6('0x83')](),_0x308c69);})[_0x9bd6('0x24')](function(_0x2602e4){_0x46d86f[_0x9bd6('0x20')]=_0x2602e4[_0x9bd6('0x2d')];if(_0x46d86f['count']===0x0)return[];return db[_0x9bd6('0x82')][_0x9bd6('0x36')](_0x19fdd0[_0x9bd6('0x83')](),_0x308c69)[_0x9bd6('0x24')](function(_0x1b6d49){_0x3bf8f0=_['keyBy'](_0x1b6d49,'id');_0x308c69=_['merge'](_0x308c69,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2469bf[_0x9bd6('0x36')][_0x9bd6('0x84')]){_0x44a422[_0x9bd6('0x3a')]['forEach'](function(_0x798b8b){_0x2333a0[_0x9bd6('0x43')]('c.'+_0x798b8b);});}else{_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x85'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x86'));_0x2333a0[_0x9bd6('0x43')]('c.lastName');_0x2333a0['field'](_0x9bd6('0x87'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x88'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x89'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x8a'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x8b'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x8c'));_0x2333a0['field']('c.deletedAt');_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x8d'));_0x2333a0[_0x9bd6('0x43')](_0x9bd6('0x8e'),_0x9bd6('0x8f'));}if(_0x44a422[_0x9bd6('0x1f')])_0x2333a0[_0x9bd6('0x1f')](_0x44a422[_0x9bd6('0x1f')]);if(_0x44a422['offset'])_0x2333a0[_0x9bd6('0x3d')](_0x44a422['offset']);return db[_0x9bd6('0x82')][_0x9bd6('0x36')](_0x2333a0['toString'](),_0x308c69);});})['then'](function(_0x2ff228){_0x2ff228[_0x9bd6('0x53')](function(_0x2f2f23){if(_0x2f2f23[_0x9bd6('0x8f')]){_0x2f2f23[_0x9bd6('0x90')]=[];_0x2f2f23[_0x9bd6('0x8f')][_0x9bd6('0x52')](',')['forEach'](function(_0x8dc459){_0x2f2f23['Tags'][_0x9bd6('0x2f')](_0x3bf8f0[_0x8dc459]);});}delete _0x2f2f23[_0x9bd6('0x8f')];});_0x46d86f[_0x9bd6('0x91')]=_0x2ff228;return _0x46d86f;})[_0x9bd6('0x24')](respondWithFilteredResult(_0x2a8c69,_0x44a422));})['catch'](handleError(_0x2a8c69,null));};exports[_0x9bd6('0x25')]=function(_0x4569f9,_0x13be2f){return db['CmContact']['find']({'where':{'id':_0x4569f9[_0x9bd6('0x92')]['id']}})[_0x9bd6('0x24')](handleEntityNotFound(_0x13be2f,null))[_0x9bd6('0x24')](removeEntity(_0x13be2f,null))['catch'](handleError(_0x13be2f,null));};exports[_0x9bd6('0x93')]=function(_0x34879a,_0x5004ab){return db[_0x9bd6('0x2b')][_0x9bd6('0x93')]()['then'](function(_0x5f2a47){delete _0x5f2a47['tags'];for(var _0x576ba2=0x0;_0x576ba2=_0x3f2576){_0x378020=_0x3f2576;_0x5387c7=0xc8;}else{_0x5387c7=0xce;}_0x32ab28[_0x4782('0x20')](_0x5387c7);return _0x32ab28[_0x4782('0x26')](_0x4782('0x27'),_0x439be0+'-'+_0x378020+'/'+_0x3f2576)['json'](_0x3319f8);}return null;};}function patchUpdates(_0x2ca7b4){return function(_0x258cda){try{jsonpatch[_0x4782('0x28')](_0x258cda,_0x2ca7b4,!![]);}catch(_0x4a5fe7){return BPromise[_0x4782('0x29')](_0x4a5fe7);}return _0x258cda[_0x4782('0x2a')]();};}function saveUpdates(_0x54c483,_0xe256be){return function(_0x178e48){if(_0x178e48){return _0x178e48[_0x4782('0x2b')](_0x54c483)['then'](function(_0x25eb18){return _0x25eb18;});}return null;};}function removeEntity(_0x15b231,_0x3f55c4){return function(_0x47cf4a){if(_0x47cf4a){return _0x47cf4a[_0x4782('0x2c')]()[_0x4782('0x2d')](function(){_0x15b231[_0x4782('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21fac4,_0x276a91){return function(_0xf7155d){if(!_0xf7155d){_0x21fac4['sendStatus'](0x194);}return _0xf7155d;};}function handleError(_0x1e387d,_0x77d30d){_0x77d30d=_0x77d30d||0x1f4;return function(_0x3177a8){logger[_0x4782('0x2e')](_0x3177a8[_0x4782('0x2f')]);if(_0x3177a8['name']){delete _0x3177a8[_0x4782('0x30')];}_0x1e387d['status'](_0x77d30d)['send'](_0x3177a8);};}exports[_0x4782('0x31')]=function(_0x167f0e,_0x5a9556){var _0x36bbe0={},_0x1381ec={},_0x4dfbd2={'count':0x0,'rows':[]};return db[_0x4782('0x32')][_0x4782('0x33')]()[_0x4782('0x2d')](function(_0x339939){var _0x15a69b=[];for(var _0x1b8f1a=0x0;_0x1b8f1a0x1){_0x500416['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4782('0x6e')](_0x45dbc0),null);}else{if(qs[_0x4782('0x6f')](_0x45dbc0)){_0x500416['or'](_0x4782('0x70'),_0x45dbc0+'%');_0x500416['or']('c.phone\x20LIKE\x20?',_0x45dbc0+'%');_0x500416['or'](_0x4782('0x71'),_0x45dbc0+'%');_0x500416['or'](_0x4782('0x72'),_0x45dbc0+'%');}else if(qs[_0x4782('0x73')](_0x45dbc0)){_0x500416['or']('c.email\x20LIKE\x20?',_0x45dbc0+'%');}else{_0x500416['or'](_0x4782('0x74'),'%'+_0x45dbc0+'%');_0x500416['or']('c.lastName\x20LIKE\x20?','%'+_0x45dbc0+'%');_0x500416['or']('c.email\x20LIKE\x20?','%'+_0x45dbc0+'%');}}}}_0x37846a[_0x4782('0x52')](_0x500416);_0x37846a[_0x4782('0x75')]('c.id');var _0xe4de1d={'type':db[_0x4782('0x76')][_0x4782('0x77')][_0x4782('0x78')],'raw':!![]};var _0x317e1b=_0x37846a['clone']()[_0x4782('0x48')]('c.id');if(_0x36bbe0['order']){_0x36bbe0[_0x4782('0x44')]['forEach'](function(_0x54efe0){_0x37846a['order']('c.'+_0x54efe0[0x0],_0x54efe0[0x1]===_0x4782('0x79')?![]:!![]);});}if(!_[_0x4782('0x7a')](_0x60b19)){_0x37846a[_0x4782('0x7b')](_0x453551);_0x317e1b['where']('t.id\x20IN\x20?',_0x60b19);}BPromise[_0x4782('0x7c')]()['then'](function(){if(!_0x221321)return;if(_0x167f0e[_0x4782('0x7d')][_0x4782('0x7e')]!==_0x4782('0x7f'))return;if(!_[_0x4782('0x80')](_0x221321['conditions'],[_0x4782('0x48'),_0x4782('0x5c')])){return _0x167f0e[_0x4782('0x7d')]['getLists']({'attributes':['id'],'raw':!![]})[_0x4782('0x2d')](function(_0x43e992){if(_[_0x4782('0x7a')](_0x43e992)){_0x317e1b[_0x4782('0x52')](_0x4782('0x81'));_0x37846a[_0x4782('0x52')](_0x4782('0x81'));}else{_0x317e1b['where'](_0x4782('0x68'),_[_0x4782('0x5a')](_0x43e992,'id'));_0x37846a[_0x4782('0x52')](_0x4782('0x68'),_[_0x4782('0x5a')](_0x43e992,'id'));}});}})[_0x4782('0x2d')](function(){if(_0x167f0e['user'][_0x4782('0x7e')]===_0x4782('0x7f')&&!_0x221321&&!_0x167f0e[_0x4782('0x3c')]['ListId'])return[];return db[_0x4782('0x82')][_0x4782('0x3c')](_0x317e1b[_0x4782('0x83')](),_0xe4de1d);})[_0x4782('0x2d')](function(_0x2f5af0){_0x4dfbd2[_0x4782('0x25')]=_0x2f5af0[_0x4782('0x41')];if(_0x4dfbd2['count']===0x0)return[];return db[_0x4782('0x82')][_0x4782('0x3c')](_0x37183d[_0x4782('0x83')](),_0xe4de1d)['then'](function(_0x2489a8){_0x23e03a=_[_0x4782('0x84')](_0x2489a8,'id');_0xe4de1d=_[_0x4782('0x85')](_0xe4de1d,{'model':db[_0x4782('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x167f0e[_0x4782('0x3c')][_0x4782('0x40')]){_0x36bbe0[_0x4782('0x3f')][_0x4782('0x66')](function(_0x2c688e){_0x37846a[_0x4782('0x48')]('c.'+_0x2c688e);});}else{_0x37846a[_0x4782('0x48')]('c.id');_0x37846a[_0x4782('0x48')](_0x4782('0x86'));_0x37846a[_0x4782('0x48')](_0x4782('0x87'));_0x37846a['field'](_0x4782('0x88'));_0x37846a[_0x4782('0x48')]('c.mobile');_0x37846a[_0x4782('0x48')](_0x4782('0x89'));_0x37846a[_0x4782('0x48')](_0x4782('0x8a'));_0x37846a[_0x4782('0x48')](_0x4782('0x8b'));_0x37846a[_0x4782('0x48')]('c.createdAt');_0x37846a[_0x4782('0x48')](_0x4782('0x8c'));_0x37846a[_0x4782('0x48')](_0x4782('0x8d'));_0x37846a[_0x4782('0x48')](_0x4782('0x8e'),_0x4782('0x8f'));}if(_0x36bbe0['limit'])_0x37846a[_0x4782('0x24')](_0x36bbe0[_0x4782('0x24')]);if(_0x36bbe0['offset'])_0x37846a['offset'](_0x36bbe0[_0x4782('0x22')]);return db[_0x4782('0x82')]['query'](_0x37846a[_0x4782('0x83')](),_0xe4de1d);});})['then'](function(_0x44699f){_0x44699f[_0x4782('0x66')](function(_0x174c4a){if(_0x174c4a[_0x4782('0x8f')]){_0x174c4a[_0x4782('0x90')]=[];_0x174c4a[_0x4782('0x8f')][_0x4782('0x59')](',')['forEach'](function(_0x384050){_0x174c4a[_0x4782('0x90')][_0x4782('0x65')](_0x23e03a[_0x384050]);});}delete _0x174c4a[_0x4782('0x8f')];});_0x4dfbd2[_0x4782('0x91')]=_0x44699f;return _0x4dfbd2;})[_0x4782('0x2d')](respondWithFilteredResult(_0x5a9556,_0x36bbe0));})[_0x4782('0x92')](handleError(_0x5a9556,null));};exports[_0x4782('0x2c')]=function(_0x3ddb45,_0x49da35){return db[_0x4782('0x32')][_0x4782('0x57')]({'where':{'id':_0x3ddb45[_0x4782('0x93')]['id']}})[_0x4782('0x2d')](handleEntityNotFound(_0x49da35,null))[_0x4782('0x2d')](removeEntity(_0x49da35,null))['catch'](handleError(_0x49da35,null));};exports[_0x4782('0x33')]=function(_0x1b79b7,_0x53b589){return db['CmContact'][_0x4782('0x33')]()['then'](function(_0x3ac79c){delete _0x3ac79c['tags'];for(var _0xc5133f=0x0;_0xc5133f{}\s\\|]/g,'-');_0x58596a(null,util[_0x3dbb('0x21')](_0x3dbb('0x22'),path['basename'](_0x168512['originalname'],path[_0x3dbb('0x23')](_0x168512[_0x3dbb('0x1f')])),Date['now'](),path[_0x3dbb('0x23')](_0x168512[_0x3dbb('0x1f')])));}})});router[_0x3dbb('0x18')](_0x3dbb('0x24'),upload['single'](_0x3dbb('0x25')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x3dbb('0x1d')]({'destination':function(_0x105007,_0x500125,_0x44d6f5){_0x44d6f5(null,path[_0x3dbb('0x26')](config['root'],'server/files/tmp'));},'filename':function(_0x1a707c,_0x476929,_0x18984e){_0x476929[_0x3dbb('0x1f')]=_0x476929[_0x3dbb('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x18984e(null,util[_0x3dbb('0x21')](_0x3dbb('0x22'),path['basename'](_0x476929[_0x3dbb('0x1f')],path[_0x3dbb('0x23')](_0x476929['originalname'])),Date[_0x3dbb('0x27')](),path['extname'](_0x476929[_0x3dbb('0x1f')])));}})});router[_0x3dbb('0x18')](_0x3dbb('0x28'),upload['single'](_0x3dbb('0x25')),controller[_0x3dbb('0x29')]);router[_0x3dbb('0x18')](_0x3dbb('0x2a'),auth['isAuthenticated'](),controller[_0x3dbb('0x2b')]);router['put'](_0x3dbb('0xd'),auth[_0x3dbb('0xa')](),controller[_0x3dbb('0x2c')]);router[_0x3dbb('0x2d')](_0x3dbb('0xd'),auth[_0x3dbb('0xa')](),controller[_0x3dbb('0x2e')]);module[_0x3dbb('0x2f')]=router; \ No newline at end of file +var _0x0ce9=['show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','bulkCreate','diskStorage','join','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','/csv','single','file','root','format','now','/upload','upload','/upload/:id','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/:id'];(function(_0x2133a6,_0x20b99f){var _0x298f61=function(_0x130f33){while(--_0x130f33){_0x2133a6['push'](_0x2133a6['shift']());}};_0x298f61(++_0x20b99f);}(_0x0ce9,0xe5));var _0x90ce=function(_0x43594a,_0x5f3d4d){_0x43594a=_0x43594a-0x0;var _0x201e07=_0x0ce9[_0x43594a];return _0x201e07;};'use strict';var multer=require(_0x90ce('0x0'));var util=require(_0x90ce('0x1'));var path=require('path');var timeout=require(_0x90ce('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x90ce('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x90ce('0x4'));var config=require(_0x90ce('0x5'));var controller=require(_0x90ce('0x6'));router[_0x90ce('0x7')]('/',auth[_0x90ce('0x8')](),controller[_0x90ce('0x9')]);router['get']('/describe',auth[_0x90ce('0x8')](),controller['describe']);router['get'](_0x90ce('0xa'),auth[_0x90ce('0x8')](),controller[_0x90ce('0xb')]);router[_0x90ce('0x7')](_0x90ce('0xc'),auth[_0x90ce('0x8')](),controller[_0x90ce('0xd')]);router[_0x90ce('0x7')](_0x90ce('0xe'),auth[_0x90ce('0x8')](),controller[_0x90ce('0xf')]);router[_0x90ce('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x90ce('0x7')](_0x90ce('0x10'),auth[_0x90ce('0x8')](),controller[_0x90ce('0x11')]);router[_0x90ce('0x7')](_0x90ce('0x12'),auth[_0x90ce('0x8')](),controller[_0x90ce('0x13')]);router[_0x90ce('0x7')](_0x90ce('0x14'),auth[_0x90ce('0x8')](),controller[_0x90ce('0x15')]);router[_0x90ce('0x16')](_0x90ce('0x17'),auth[_0x90ce('0x8')](),controller[_0x90ce('0x18')]);router[_0x90ce('0x16')]('/',auth['isAuthenticated'](),controller[_0x90ce('0x19')]);router[_0x90ce('0x16')]('/create_many',auth[_0x90ce('0x8')](),controller[_0x90ce('0x1a')]);router['post'](_0x90ce('0xc'),auth[_0x90ce('0x8')](),controller['setTags']);var upload=multer({'storage':multer[_0x90ce('0x1b')]({'destination':function(_0x24c7fc,_0x4d3476,_0x228ea2){_0x228ea2(null,path[_0x90ce('0x1c')](config['root'],_0x90ce('0x1d')));},'filename':function(_0x5d6606,_0x4f6798,_0x1e5cc1){_0x4f6798['originalname']=_0x4f6798[_0x90ce('0x1e')][_0x90ce('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e5cc1(null,util['format'](_0x90ce('0x20'),path[_0x90ce('0x21')](_0x4f6798[_0x90ce('0x1e')],path['extname'](_0x4f6798[_0x90ce('0x1e')])),Date['now'](),path[_0x90ce('0x22')](_0x4f6798[_0x90ce('0x1e')])));}})});router[_0x90ce('0x16')](_0x90ce('0x23'),upload[_0x90ce('0x24')](_0x90ce('0x25')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x90ce('0x1b')]({'destination':function(_0x1589c7,_0x5cf7b5,_0x1fc299){_0x1fc299(null,path['join'](config[_0x90ce('0x26')],'server/files/tmp'));},'filename':function(_0x300e5a,_0x316f25,_0x3adacb){_0x316f25['originalname']=_0x316f25['originalname'][_0x90ce('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3adacb(null,util[_0x90ce('0x27')](_0x90ce('0x20'),path[_0x90ce('0x21')](_0x316f25[_0x90ce('0x1e')],path[_0x90ce('0x22')](_0x316f25['originalname'])),Date[_0x90ce('0x28')](),path[_0x90ce('0x22')](_0x316f25[_0x90ce('0x1e')])));}})});router[_0x90ce('0x16')](_0x90ce('0x29'),upload[_0x90ce('0x24')](_0x90ce('0x25')),controller[_0x90ce('0x2a')]);router[_0x90ce('0x16')](_0x90ce('0x2b'),auth[_0x90ce('0x8')](),controller['import']);router[_0x90ce('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x90ce('0x2d')]);router['delete'](_0x90ce('0xa'),auth[_0x90ce('0x8')](),controller[_0x90ce('0x2e')]);module[_0x90ce('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ca3ce7a..b73daf2 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 _0xafa7=['exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','isArray','values','BOOLEAN','voice','sequelize','lodash'];(function(_0x5a1b6b,_0x320036){var _0xca9688=function(_0x315cb0){while(--_0x315cb0){_0x5a1b6b['push'](_0x5a1b6b['shift']());}};_0xca9688(++_0x320036);}(_0xafa7,0x1eb));var _0x7afa=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xafa7[_0x490be3];return _0x3f5140;};'use strict';var Sequelize=require(_0x7afa('0x0'));var _=require(_0x7afa('0x1'));module[_0x7afa('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x21e57d){return this[_0x7afa('0x3')](_0x7afa('0x4'));}},'alias':{'type':Sequelize[_0x7afa('0x5')],'allowNull':![],'set':function(_0x13e14b){this[_0x7afa('0x6')](_0x7afa('0x4'),_0x13e14b?_0x13e14b:this[_0x7afa('0x3')](_0x7afa('0x7')));}},'type':{'type':Sequelize[_0x7afa('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x7afa('0x8')](_0x7afa('0x9')),'get':function(){if(this[_0x7afa('0x3')](_0x7afa('0xa'))===_0x7afa('0xb')){return JSON[_0x7afa('0xc')](this['getDataValue']('values'));}else{return this[_0x7afa('0x3')]('values');}},'set':function(_0x222fba){if(Array[_0x7afa('0xd')](_0x222fba)){this[_0x7afa('0x6')](_0x7afa('0xe'),JSON['stringify'](_0x222fba));}else{this[_0x7afa('0x6')](_0x7afa('0xe'),_0x222fba);}}},'required':{'type':Sequelize[_0x7afa('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7afa('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x7afa('0x10'))}}; \ No newline at end of file +var _0x4543=['STRING','setDataValue','name','TEXT','type','select','parse','getDataValue','values','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','alias'];(function(_0x45919e,_0x3b908f){var _0x311f55=function(_0x4fe5fa){while(--_0x4fe5fa){_0x45919e['push'](_0x45919e['shift']());}};_0x311f55(++_0x3b908f);}(_0x4543,0x18b));var _0x3454=function(_0x2887b2,_0x588e01){_0x2887b2=_0x2887b2-0x0;var _0x18340e=_0x4543[_0x2887b2];return _0x18340e;};'use strict';var Sequelize=require(_0x3454('0x0'));var _=require(_0x3454('0x1'));module[_0x3454('0x2')]={'name':{'type':Sequelize[_0x3454('0x3')],'get':function(_0x33e9d4){return this['getDataValue'](_0x3454('0x4'));}},'alias':{'type':Sequelize[_0x3454('0x5')],'allowNull':![],'set':function(_0x201adf){this[_0x3454('0x6')](_0x3454('0x4'),_0x201adf?_0x201adf:this['getDataValue'](_0x3454('0x7')));}},'type':{'type':Sequelize[_0x3454('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x3454('0x8')]('long'),'get':function(){if(this['getDataValue'](_0x3454('0x9'))===_0x3454('0xa')){return JSON[_0x3454('0xb')](this[_0x3454('0xc')](_0x3454('0xd')));}else{return this['getDataValue']('values');}},'set':function(_0x2ae214){if(Array['isArray'](_0x2ae214)){this[_0x3454('0x6')](_0x3454('0xd'),JSON['stringify'](_0x2ae214));}else{this[_0x3454('0x6')](_0x3454('0xd'),_0x2ae214);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3454('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3454('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 2d4c7a1..6820f95 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 _0xa0b2=['queryInterface','addColumn','format','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','CmCustomField','rawAttributes','type','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','find','catch','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0xa0b2,0x14f));var _0x2a0b=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xa0b2[_0x27c068];return _0xe5a67f;};'use strict';var emlformat=require(_0x2a0b('0x0'));var rimraf=require(_0x2a0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2a0b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2a0b('0x3'));var util=require(_0x2a0b('0x4'));var path=require(_0x2a0b('0x5'));var sox=require(_0x2a0b('0x6'));var csv=require(_0x2a0b('0x7'));var ejs=require(_0x2a0b('0x8'));var fs=require('fs');var fs_extra=require(_0x2a0b('0x9'));var _=require(_0x2a0b('0xa'));var squel=require('squel');var crypto=require(_0x2a0b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2a0b('0xc'));var toCsv=require(_0x2a0b('0x7'));var querystring=require(_0x2a0b('0xd'));var Papa=require(_0x2a0b('0xe'));var Redis=require(_0x2a0b('0xf'));var authService=require(_0x2a0b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a0b('0x11'));var logger=require(_0x2a0b('0x12'))(_0x2a0b('0x13'));var utils=require(_0x2a0b('0x14'));var config=require(_0x2a0b('0x15'));var licenseUtil=require(_0x2a0b('0x16'));var db=require(_0x2a0b('0x17'))['db'];function respondWithStatusCode(_0x1ba742,_0x55532b){_0x55532b=_0x55532b||0xcc;return function(_0x207e80){if(_0x207e80){return _0x1ba742['sendStatus'](_0x55532b);}return _0x1ba742[_0x2a0b('0x18')](_0x55532b)['end']();};}function respondWithResult(_0x37f768,_0x199d14){_0x199d14=_0x199d14||0xc8;return function(_0x42eaba){if(_0x42eaba){return _0x37f768[_0x2a0b('0x18')](_0x199d14)[_0x2a0b('0x19')](_0x42eaba);}};}function respondWithFilteredResult(_0x3f49f0,_0x5f2b92){return function(_0x23f354){if(_0x23f354){var _0x506702=typeof _0x5f2b92[_0x2a0b('0x1a')]==='undefined'&&typeof _0x5f2b92[_0x2a0b('0x1b')]===_0x2a0b('0x1c');var _0x3958b1=_0x23f354[_0x2a0b('0x1d')];var _0x2bea7a=_0x506702?0x0:_0x5f2b92[_0x2a0b('0x1a')];var _0x1ca874=_0x506702?_0x23f354[_0x2a0b('0x1d')]:_0x5f2b92[_0x2a0b('0x1a')]+_0x5f2b92['limit'];var _0x51bd2c;if(_0x1ca874>=_0x3958b1){_0x1ca874=_0x3958b1;_0x51bd2c=0xc8;}else{_0x51bd2c=0xce;}_0x3f49f0[_0x2a0b('0x18')](_0x51bd2c);return _0x3f49f0[_0x2a0b('0x1e')]('Content-Range',_0x2bea7a+'-'+_0x1ca874+'/'+_0x3958b1)[_0x2a0b('0x19')](_0x23f354);}return null;};}function patchUpdates(_0x300829){return function(_0x3ec0ce){try{jsonpatch[_0x2a0b('0x1f')](_0x3ec0ce,_0x300829,!![]);}catch(_0x86712e){return BPromise[_0x2a0b('0x20')](_0x86712e);}return _0x3ec0ce[_0x2a0b('0x21')]();};}function saveUpdates(_0x268a08,_0x20c9ca){return function(_0x4f317e){if(_0x4f317e){return _0x4f317e[_0x2a0b('0x22')](_0x268a08)[_0x2a0b('0x23')](function(_0x2ce9d6){return _0x2ce9d6;});}return null;};}function removeEntity(_0x5e792b,_0x386cba){return function(_0x4eb2c7){if(_0x4eb2c7){return _0x4eb2c7[_0x2a0b('0x24')]()[_0x2a0b('0x23')](function(){_0x5e792b[_0x2a0b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b7ecd,_0x34f456){return function(_0x1f6ed6){if(!_0x1f6ed6){_0x8b7ecd['sendStatus'](0x194);}return _0x1f6ed6;};}function handleError(_0x1c53cb,_0x3be8e6){_0x3be8e6=_0x3be8e6||0x1f4;return function(_0x3e7082){logger['error'](_0x3e7082[_0x2a0b('0x25')]);if(_0x3e7082['name']){delete _0x3e7082[_0x2a0b('0x26')];}_0x1c53cb['status'](_0x3be8e6)[_0x2a0b('0x27')](_0x3e7082);};}exports['index']=function(_0x1e9661,_0x53c46b){var _0x3c03b3={},_0x5621ba={},_0x1b91ab={'count':0x0,'rows':[]};var _0x2aab39=_[_0x2a0b('0x28')](db[_0x2a0b('0x29')][_0x2a0b('0x2a')],function(_0x1401d4){return{'name':_0x1401d4['fieldName'],'type':_0x1401d4[_0x2a0b('0x2b')]['key']};});_0x5621ba[_0x2a0b('0x2c')]=_[_0x2a0b('0x2d')](_[_0x2a0b('0x28')](_0x2aab39,_0x2a0b('0x26')),[_0x2a0b('0x26')]);_0x5621ba[_0x2a0b('0x2e')]=_[_0x2a0b('0x2f')](_0x1e9661[_0x2a0b('0x2e')]);_0x5621ba['filters']=_[_0x2a0b('0x30')](_0x5621ba[_0x2a0b('0x2c')],_0x5621ba[_0x2a0b('0x2e')]);_0x3c03b3[_0x2a0b('0x31')]=_[_0x2a0b('0x30')](_0x5621ba[_0x2a0b('0x2c')],qs[_0x2a0b('0x32')](_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x32')]));_0x3c03b3['attributes']=_0x3c03b3[_0x2a0b('0x31')][_0x2a0b('0x33')]?_0x3c03b3[_0x2a0b('0x31')]:_0x5621ba['model'];if(!_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x34')](_0x2a0b('0x35'))){_0x3c03b3[_0x2a0b('0x1b')]=qs['limit'](_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x1b')]);_0x3c03b3[_0x2a0b('0x1a')]=qs[_0x2a0b('0x1a')](_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x1a')]);}_0x3c03b3[_0x2a0b('0x36')]=qs['sort'](_0x1e9661['query'][_0x2a0b('0x37')]);_0x3c03b3[_0x2a0b('0x38')]=qs[_0x2a0b('0x39')](_[_0x2a0b('0x3a')](_0x1e9661['query'],_0x5621ba[_0x2a0b('0x39')]),_0x2aab39);if(_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x3b')]){_0x3c03b3[_0x2a0b('0x38')]=_['merge'](_0x3c03b3[_0x2a0b('0x38')],{'$or':_['map'](_0x2aab39,function(_0x383793){if(_0x383793[_0x2a0b('0x2b')]!==_0x2a0b('0x3c')){var _0x3e9fb6={};_0x3e9fb6[_0x383793[_0x2a0b('0x26')]]={'$like':'%'+_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x3b')]+'%'};return _0x3e9fb6;}})});}_0x3c03b3=_[_0x2a0b('0x3d')]({},_0x3c03b3,_0x1e9661[_0x2a0b('0x3e')]);var _0x25282f={'where':_0x3c03b3[_0x2a0b('0x38')]};return db[_0x2a0b('0x29')][_0x2a0b('0x1d')](_0x25282f)[_0x2a0b('0x23')](function(_0x4eab6a){_0x1b91ab[_0x2a0b('0x1d')]=_0x4eab6a;if(_0x1e9661[_0x2a0b('0x2e')][_0x2a0b('0x3f')]){_0x3c03b3[_0x2a0b('0x40')]=[{'all':!![]}];}return db[_0x2a0b('0x29')]['findAll'](_0x3c03b3);})['then'](function(_0x363037){_0x1b91ab[_0x2a0b('0x41')]=_0x363037;return _0x1b91ab;})[_0x2a0b('0x23')](respondWithFilteredResult(_0x53c46b,_0x3c03b3))['catch'](handleError(_0x53c46b,null));};exports[_0x2a0b('0x42')]=function(_0x510597,_0x58bc16){var _0x417354={'raw':!![],'where':{'id':_0x510597[_0x2a0b('0x43')]['id']}},_0x4aeec6={};_0x4aeec6[_0x2a0b('0x2c')]=_[_0x2a0b('0x2f')](db[_0x2a0b('0x29')]['rawAttributes']);_0x4aeec6[_0x2a0b('0x2e')]=_[_0x2a0b('0x2f')](_0x510597['query']);_0x4aeec6['filters']=_[_0x2a0b('0x30')](_0x4aeec6[_0x2a0b('0x2c')],_0x4aeec6[_0x2a0b('0x2e')]);_0x417354['attributes']=_[_0x2a0b('0x30')](_0x4aeec6[_0x2a0b('0x2c')],qs[_0x2a0b('0x32')](_0x510597[_0x2a0b('0x2e')][_0x2a0b('0x32')]));_0x417354[_0x2a0b('0x31')]=_0x417354['attributes']['length']?_0x417354['attributes']:_0x4aeec6[_0x2a0b('0x2c')];if(_0x510597[_0x2a0b('0x2e')][_0x2a0b('0x3f')]){_0x417354['include']=[{'all':!![]}];}_0x417354=_[_0x2a0b('0x3d')]({},_0x417354,_0x510597[_0x2a0b('0x3e')]);return db[_0x2a0b('0x29')][_0x2a0b('0x44')](_0x417354)[_0x2a0b('0x23')](handleEntityNotFound(_0x58bc16,null))[_0x2a0b('0x23')](respondWithResult(_0x58bc16,null))[_0x2a0b('0x45')](handleError(_0x58bc16,null));};exports[_0x2a0b('0x22')]=function(_0x192ddc,_0x2c32ac){if(_0x192ddc[_0x2a0b('0x46')]['id']){delete _0x192ddc[_0x2a0b('0x46')]['id'];}return db[_0x2a0b('0x29')][_0x2a0b('0x44')]({'where':{'id':_0x192ddc[_0x2a0b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c32ac,null))[_0x2a0b('0x23')](saveUpdates(_0x192ddc[_0x2a0b('0x46')],null))[_0x2a0b('0x23')](respondWithResult(_0x2c32ac,null))['catch'](handleError(_0x2c32ac,null));};exports[_0x2a0b('0x24')]=function(_0x3470f9,_0xcd1921){return db[_0x2a0b('0x29')]['find']({'where':{'id':_0x3470f9[_0x2a0b('0x43')]['id']}})['then'](handleEntityNotFound(_0xcd1921,null))[_0x2a0b('0x23')](removeEntity(_0xcd1921,null))[_0x2a0b('0x45')](handleError(_0xcd1921,null));};exports[_0x2a0b('0x47')]=function(_0x4f8e06,_0x238740){var _0x5277cc;return db[_0x2a0b('0x48')][_0x2a0b('0x49')](function(_0x2ec042){return db[_0x2a0b('0x29')][_0x2a0b('0x47')](_0x4f8e06[_0x2a0b('0x46')],{'transaction':_0x2ec042})['then'](function(_0x1da636){_0x5277cc=_0x1da636;var _0x441976={'type':db[_0x2a0b('0x4a')][_0x2a0b('0x4b')],'transaction':_0x2ec042};switch(_0x4f8e06[_0x2a0b('0x46')][_0x2a0b('0x2b')]){case _0x2a0b('0x4c'):_0x441976[_0x2a0b('0x2b')]=db['Sequelize'][_0x2a0b('0x4b')];break;case'number':_0x441976[_0x2a0b('0x2b')]=db[_0x2a0b('0x4a')][_0x2a0b('0x4d')];break;case'switch':_0x441976[_0x2a0b('0x2b')]=db['Sequelize'][_0x2a0b('0x4e')];_0x441976[_0x2a0b('0x4f')]=![];break;default:}return db['sequelize'][_0x2a0b('0x50')][_0x2a0b('0x51')]('cm_contacts',util[_0x2a0b('0x52')]('cf_%d',_0x5277cc['id']),_0x441976);})[_0x2a0b('0x23')](function(){return _0x5277cc;});})[_0x2a0b('0x23')](respondWithResult(_0x238740,0xc9))[_0x2a0b('0x45')](handleError(_0x238740,null));}; \ No newline at end of file +var _0x0430=['find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','destroy','end','error','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params'];(function(_0x476a32,_0x3a0b1e){var _0x18974a=function(_0x1e3f35){while(--_0x1e3f35){_0x476a32['push'](_0x476a32['shift']());}};_0x18974a(++_0x3a0b1e);}(_0x0430,0x15c));var _0x0043=function(_0x2c6e25,_0x540c6a){_0x2c6e25=_0x2c6e25-0x0;var _0x5343b6=_0x0430[_0x2c6e25];return _0x5343b6;};'use strict';var emlformat=require(_0x0043('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0043('0x1'));var jsonpatch=require(_0x0043('0x2'));var rp=require(_0x0043('0x3'));var moment=require(_0x0043('0x4'));var BPromise=require(_0x0043('0x5'));var Mustache=require(_0x0043('0x6'));var util=require(_0x0043('0x7'));var path=require('path');var sox=require(_0x0043('0x8'));var csv=require('to-csv');var ejs=require(_0x0043('0x9'));var fs=require('fs');var fs_extra=require(_0x0043('0xa'));var _=require('lodash');var squel=require(_0x0043('0xb'));var crypto=require('crypto');var jsforce=require(_0x0043('0xc'));var deskjs=require(_0x0043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0043('0xe'));var Papa=require(_0x0043('0xf'));var Redis=require(_0x0043('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0043('0x11'));var logger=require('../../config/logger')(_0x0043('0x12'));var utils=require(_0x0043('0x13'));var config=require(_0x0043('0x14'));var licenseUtil=require(_0x0043('0x15'));var db=require(_0x0043('0x16'))['db'];function respondWithStatusCode(_0x1dab68,_0x477492){_0x477492=_0x477492||0xcc;return function(_0x1c06ae){if(_0x1c06ae){return _0x1dab68[_0x0043('0x17')](_0x477492);}return _0x1dab68[_0x0043('0x18')](_0x477492)['end']();};}function respondWithResult(_0x1fbad0,_0x5fad6a){_0x5fad6a=_0x5fad6a||0xc8;return function(_0x4707a1){if(_0x4707a1){return _0x1fbad0[_0x0043('0x18')](_0x5fad6a)[_0x0043('0x19')](_0x4707a1);}};}function respondWithFilteredResult(_0x3d3da6,_0x113561){return function(_0x51f7f5){if(_0x51f7f5){var _0x26cdb9=typeof _0x113561[_0x0043('0x1a')]===_0x0043('0x1b')&&typeof _0x113561[_0x0043('0x1c')]==='undefined';var _0x16c6da=_0x51f7f5[_0x0043('0x1d')];var _0x2b9376=_0x26cdb9?0x0:_0x113561[_0x0043('0x1a')];var _0x5aba93=_0x26cdb9?_0x51f7f5[_0x0043('0x1d')]:_0x113561['offset']+_0x113561[_0x0043('0x1c')];var _0x14e938;if(_0x5aba93>=_0x16c6da){_0x5aba93=_0x16c6da;_0x14e938=0xc8;}else{_0x14e938=0xce;}_0x3d3da6[_0x0043('0x18')](_0x14e938);return _0x3d3da6['set']('Content-Range',_0x2b9376+'-'+_0x5aba93+'/'+_0x16c6da)[_0x0043('0x19')](_0x51f7f5);}return null;};}function patchUpdates(_0x114286){return function(_0x58f8df){try{jsonpatch[_0x0043('0x1e')](_0x58f8df,_0x114286,!![]);}catch(_0x3a2eb2){return BPromise[_0x0043('0x1f')](_0x3a2eb2);}return _0x58f8df['save']();};}function saveUpdates(_0x143c77,_0xca175b){return function(_0xcb0611){if(_0xcb0611){return _0xcb0611['update'](_0x143c77)['then'](function(_0x4407c6){return _0x4407c6;});}return null;};}function removeEntity(_0x51992b,_0x194347){return function(_0x541eee){if(_0x541eee){return _0x541eee[_0x0043('0x20')]()['then'](function(){_0x51992b[_0x0043('0x18')](0xcc)[_0x0043('0x21')]();});}};}function handleEntityNotFound(_0x4c0d35,_0x62e0c2){return function(_0xe7a8cb){if(!_0xe7a8cb){_0x4c0d35[_0x0043('0x17')](0x194);}return _0xe7a8cb;};}function handleError(_0x5cf757,_0x22448e){_0x22448e=_0x22448e||0x1f4;return function(_0x4b5e4d){logger[_0x0043('0x22')](_0x4b5e4d['stack']);if(_0x4b5e4d[_0x0043('0x23')]){delete _0x4b5e4d['name'];}_0x5cf757[_0x0043('0x18')](_0x22448e)['send'](_0x4b5e4d);};}exports[_0x0043('0x24')]=function(_0x54612f,_0x205420){var _0x590777={},_0x94638={},_0x55fe80={'count':0x0,'rows':[]};var _0x34ea8a=_[_0x0043('0x25')](db[_0x0043('0x26')][_0x0043('0x27')],function(_0x3f71fd){return{'name':_0x3f71fd[_0x0043('0x28')],'type':_0x3f71fd[_0x0043('0x29')][_0x0043('0x2a')]};});_0x94638['model']=_['differenceBy'](_['map'](_0x34ea8a,_0x0043('0x23')),['name']);_0x94638[_0x0043('0x2b')]=_[_0x0043('0x2c')](_0x54612f['query']);_0x94638[_0x0043('0x2d')]=_[_0x0043('0x2e')](_0x94638[_0x0043('0x2f')],_0x94638[_0x0043('0x2b')]);_0x590777[_0x0043('0x30')]=_[_0x0043('0x2e')](_0x94638[_0x0043('0x2f')],qs['fields'](_0x54612f['query'][_0x0043('0x31')]));_0x590777[_0x0043('0x30')]=_0x590777[_0x0043('0x30')][_0x0043('0x32')]?_0x590777[_0x0043('0x30')]:_0x94638[_0x0043('0x2f')];if(!_0x54612f[_0x0043('0x2b')][_0x0043('0x33')](_0x0043('0x34'))){_0x590777[_0x0043('0x1c')]=qs[_0x0043('0x1c')](_0x54612f[_0x0043('0x2b')][_0x0043('0x1c')]);_0x590777[_0x0043('0x1a')]=qs[_0x0043('0x1a')](_0x54612f[_0x0043('0x2b')][_0x0043('0x1a')]);}_0x590777[_0x0043('0x35')]=qs[_0x0043('0x36')](_0x54612f[_0x0043('0x2b')][_0x0043('0x36')]);_0x590777[_0x0043('0x37')]=qs['filters'](_['pick'](_0x54612f[_0x0043('0x2b')],_0x94638[_0x0043('0x2d')]),_0x34ea8a);if(_0x54612f[_0x0043('0x2b')][_0x0043('0x38')]){_0x590777[_0x0043('0x37')]=_[_0x0043('0x39')](_0x590777[_0x0043('0x37')],{'$or':_[_0x0043('0x25')](_0x34ea8a,function(_0x40181e){if(_0x40181e[_0x0043('0x29')]!==_0x0043('0x3a')){var _0x4cd28f={};_0x4cd28f[_0x40181e['name']]={'$like':'%'+_0x54612f[_0x0043('0x2b')]['filter']+'%'};return _0x4cd28f;}})});}_0x590777=_[_0x0043('0x39')]({},_0x590777,_0x54612f[_0x0043('0x3b')]);var _0x1af64f={'where':_0x590777[_0x0043('0x37')]};return db[_0x0043('0x26')][_0x0043('0x1d')](_0x1af64f)['then'](function(_0x304e70){_0x55fe80[_0x0043('0x1d')]=_0x304e70;if(_0x54612f[_0x0043('0x2b')][_0x0043('0x3c')]){_0x590777[_0x0043('0x3d')]=[{'all':!![]}];}return db[_0x0043('0x26')][_0x0043('0x3e')](_0x590777);})[_0x0043('0x3f')](function(_0x326a1c){_0x55fe80['rows']=_0x326a1c;return _0x55fe80;})['then'](respondWithFilteredResult(_0x205420,_0x590777))[_0x0043('0x40')](handleError(_0x205420,null));};exports[_0x0043('0x41')]=function(_0x2e6a86,_0x12b4f4){var _0x24d9e8={'raw':!![],'where':{'id':_0x2e6a86[_0x0043('0x42')]['id']}},_0x37fc3d={};_0x37fc3d[_0x0043('0x2f')]=_[_0x0043('0x2c')](db[_0x0043('0x26')][_0x0043('0x27')]);_0x37fc3d[_0x0043('0x2b')]=_['keys'](_0x2e6a86[_0x0043('0x2b')]);_0x37fc3d['filters']=_[_0x0043('0x2e')](_0x37fc3d['model'],_0x37fc3d[_0x0043('0x2b')]);_0x24d9e8[_0x0043('0x30')]=_['intersection'](_0x37fc3d[_0x0043('0x2f')],qs[_0x0043('0x31')](_0x2e6a86['query'][_0x0043('0x31')]));_0x24d9e8[_0x0043('0x30')]=_0x24d9e8[_0x0043('0x30')][_0x0043('0x32')]?_0x24d9e8[_0x0043('0x30')]:_0x37fc3d[_0x0043('0x2f')];if(_0x2e6a86[_0x0043('0x2b')][_0x0043('0x3c')]){_0x24d9e8[_0x0043('0x3d')]=[{'all':!![]}];}_0x24d9e8=_['merge']({},_0x24d9e8,_0x2e6a86[_0x0043('0x3b')]);return db['CmCustomField'][_0x0043('0x43')](_0x24d9e8)[_0x0043('0x3f')](handleEntityNotFound(_0x12b4f4,null))[_0x0043('0x3f')](respondWithResult(_0x12b4f4,null))[_0x0043('0x40')](handleError(_0x12b4f4,null));};exports['update']=function(_0x184096,_0x5b2276){if(_0x184096[_0x0043('0x44')]['id']){delete _0x184096[_0x0043('0x44')]['id'];}return db[_0x0043('0x26')]['find']({'where':{'id':_0x184096[_0x0043('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b2276,null))[_0x0043('0x3f')](saveUpdates(_0x184096['body'],null))['then'](respondWithResult(_0x5b2276,null))[_0x0043('0x40')](handleError(_0x5b2276,null));};exports[_0x0043('0x20')]=function(_0x397cd1,_0x1703be){return db[_0x0043('0x26')]['find']({'where':{'id':_0x397cd1[_0x0043('0x42')]['id']}})[_0x0043('0x3f')](handleEntityNotFound(_0x1703be,null))[_0x0043('0x3f')](removeEntity(_0x1703be,null))['catch'](handleError(_0x1703be,null));};exports[_0x0043('0x45')]=function(_0x568541,_0x19373d){var _0x1e4168;return db[_0x0043('0x46')][_0x0043('0x47')](function(_0xdbd3e8){return db[_0x0043('0x26')][_0x0043('0x45')](_0x568541[_0x0043('0x44')],{'transaction':_0xdbd3e8})[_0x0043('0x3f')](function(_0x4f3a08){_0x1e4168=_0x4f3a08;var _0x50112c={'type':db[_0x0043('0x48')][_0x0043('0x49')],'transaction':_0xdbd3e8};switch(_0x568541[_0x0043('0x44')][_0x0043('0x29')]){case _0x0043('0x4a'):_0x50112c[_0x0043('0x29')]=db['Sequelize'][_0x0043('0x49')];break;case'number':_0x50112c[_0x0043('0x29')]=db['Sequelize'][_0x0043('0x4b')];break;case _0x0043('0x4c'):_0x50112c[_0x0043('0x29')]=db[_0x0043('0x48')][_0x0043('0x4d')];_0x50112c[_0x0043('0x4e')]=![];break;default:}return db[_0x0043('0x46')]['queryInterface'][_0x0043('0x4f')](_0x0043('0x50'),util[_0x0043('0x51')](_0x0043('0x52'),_0x1e4168['id']),_0x50112c);})[_0x0043('0x3f')](function(){return _0x1e4168;});})[_0x0043('0x3f')](respondWithResult(_0x19373d,0xc9))[_0x0043('0x40')](handleError(_0x19373d,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 4b63c20..ce0c14c 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 _0x6c22=['util','../../config/logger','moment','request-promise','path','exports','CmCustomField','cm_custom_fields','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6c22,0x10d));var _0x26c2=function(_0x5ca9b4,_0x2bfd14){_0x5ca9b4=_0x5ca9b4-0x0;var _0x42731a=_0x6c22[_0x5ca9b4];return _0x42731a;};'use strict';var _=require(_0x26c2('0x0'));var util=require(_0x26c2('0x1'));var logger=require(_0x26c2('0x2'))('api');var moment=require(_0x26c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x26c2('0x4'));var fs=require('fs');var path=require(_0x26c2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x26c2('0x6')]=function(_0x11e3b4,_0x363e18){return _0x11e3b4['define'](_0x26c2('0x7'),attributes,{'tableName':_0x26c2('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6578=['rimraf','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','bluebird','path'];(function(_0x3ccaca,_0x2105d7){var _0x469112=function(_0x585388){while(--_0x585388){_0x3ccaca['push'](_0x3ccaca['shift']());}};_0x469112(++_0x2105d7);}(_0x6578,0x1b3));var _0x8657=function(_0x5ebe35,_0xfd22f2){_0x5ebe35=_0x5ebe35-0x0;var _0x464c12=_0x6578[_0x5ebe35];return _0x464c12;};'use strict';var _=require(_0x8657('0x0'));var util=require(_0x8657('0x1'));var logger=require('../../config/logger')(_0x8657('0x2'));var moment=require('moment');var BPromise=require(_0x8657('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8657('0x4'));var rimraf=require(_0x8657('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x8657('0x6')]=function(_0x21c6f5,_0x2ba327){return _0x21c6f5[_0x8657('0x7')](_0x8657('0x8'),attributes,{'tableName':_0x8657('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index d0b489e..2990d99 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 _0x160f=['http','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('CmCustomField,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});} \ No newline at end of file +var _0xbbb6=['jayson/promise','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x152b63,_0x46d648){var _0x2ea629=function(_0x10334f){while(--_0x10334f){_0x152b63['push'](_0x152b63['shift']());}};_0x2ea629(++_0x46d648);}(_0xbbb6,0x13d));var _0x6bbb=function(_0x4f3d4a,_0x39015d){_0x4f3d4a=_0x4f3d4a-0x0;var _0x58bc1b=_0xbbb6[_0x4f3d4a];return _0x58bc1b;};'use strict';var _=require(_0x6bbb('0x0'));var util=require('util');var moment=require(_0x6bbb('0x1'));var BPromise=require(_0x6bbb('0x2'));var rs=require(_0x6bbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6bbb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bbb('0x5'))(_0x6bbb('0x6'));var config=require('../../config/environment');var jayson=require(_0x6bbb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25d60a,_0x3238ec,_0xe7c216){return new BPromise(function(_0x1cae0f,_0x556ebd){return client[_0x6bbb('0x8')](_0x25d60a,_0xe7c216)['then'](function(_0x36c919){logger[_0x6bbb('0x9')](_0x6bbb('0xa'),_0x3238ec,'request\x20sent');logger[_0x6bbb('0xb')](_0x6bbb('0xc'),_0x3238ec,'request\x20sent',JSON[_0x6bbb('0xd')](_0x36c919));if(_0x36c919[_0x6bbb('0xe')]){if(_0x36c919['error']['code']===0x1f4){logger[_0x6bbb('0xe')](_0x6bbb('0xa'),_0x3238ec,_0x36c919['error'][_0x6bbb('0xf')]);return _0x556ebd(_0x36c919[_0x6bbb('0xe')][_0x6bbb('0xf')]);}logger[_0x6bbb('0xe')]('CmCustomField,\x20%s,\x20%s',_0x3238ec,_0x36c919[_0x6bbb('0xe')][_0x6bbb('0xf')]);return _0x1cae0f(_0x36c919[_0x6bbb('0xe')][_0x6bbb('0xf')]);}else{logger[_0x6bbb('0x9')](_0x6bbb('0xa'),_0x3238ec,_0x6bbb('0x10'));_0x1cae0f(_0x36c919[_0x6bbb('0x11')][_0x6bbb('0xf')]);}})['catch'](function(_0x242b8f){logger[_0x6bbb('0xe')]('CmCustomField,\x20%s,\x20%s',_0x3238ec,_0x242b8f);_0x556ebd(_0x242b8f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index bef6028..163996e 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 _0x119a=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x119a,0x69));var _0xa119=function(_0x57bcef,_0x19cd77){_0x57bcef=_0x57bcef-0x0;var _0x5a6034=_0x119a[_0x57bcef];return _0x5a6034;};'use strict';var multer=require(_0xa119('0x0'));var util=require(_0xa119('0x1'));var path=require(_0xa119('0x2'));var timeout=require('connect-timeout');var express=require(_0xa119('0x3'));var router=express[_0xa119('0x4')]();var fs_extra=require(_0xa119('0x5'));var auth=require(_0xa119('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa119('0x7'));var controller=require(_0xa119('0x8'));router[_0xa119('0x9')]('/',auth[_0xa119('0xa')](),controller[_0xa119('0xb')]);router[_0xa119('0x9')](_0xa119('0xc'),auth[_0xa119('0xa')](),controller[_0xa119('0xd')]);router['post']('/',auth[_0xa119('0xa')](),controller['create']);router['put'](_0xa119('0xc'),auth[_0xa119('0xa')](),controller['update']);router[_0xa119('0xe')]('/:id',auth[_0xa119('0xa')](),controller[_0xa119('0xf')]);module[_0xa119('0x10')]=router; \ No newline at end of file +var _0xfe65=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmCustomField.controller','get','index','/:id','show','post','isAuthenticated','create','delete','destroy','exports','multer','util'];(function(_0x12e1fa,_0x44e981){var _0x1e743e=function(_0x56e0c1){while(--_0x56e0c1){_0x12e1fa['push'](_0x12e1fa['shift']());}};_0x1e743e(++_0x44e981);}(_0xfe65,0xc4));var _0x5fe6=function(_0xceeade,_0x2d3604){_0xceeade=_0xceeade-0x0;var _0xe34237=_0xfe65[_0xceeade];return _0xe34237;};'use strict';var multer=require(_0x5fe6('0x0'));var util=require(_0x5fe6('0x1'));var path=require('path');var timeout=require(_0x5fe6('0x2'));var express=require(_0x5fe6('0x3'));var router=express[_0x5fe6('0x4')]();var fs_extra=require(_0x5fe6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5fe6('0x6'));var config=require('../../config/environment');var controller=require(_0x5fe6('0x7'));router[_0x5fe6('0x8')]('/',auth['isAuthenticated'](),controller[_0x5fe6('0x9')]);router[_0x5fe6('0x8')](_0x5fe6('0xa'),auth['isAuthenticated'](),controller[_0x5fe6('0xb')]);router[_0x5fe6('0xc')]('/',auth[_0x5fe6('0xd')](),controller[_0x5fe6('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5fe6('0xf')]('/:id',auth[_0x5fe6('0xd')](),controller[_0x5fe6('0x10')]);module[_0x5fe6('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 85f76fc..a04f0cf 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 _0x7fd5=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','exports','STRING'];(function(_0x5d48e6,_0x4307db){var _0x41aa0a=function(_0x5d16f6){while(--_0x5d16f6){_0x5d48e6['push'](_0x5d48e6['shift']());}};_0x41aa0a(++_0x4307db);}(_0x7fd5,0x136));var _0x57fd=function(_0xc6879,_0x84a966){_0xc6879=_0xc6879-0x0;var _0x54f7a4=_0x7fd5[_0xc6879];return _0x54f7a4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x57fd('0x0')]={'phone':{'type':Sequelize[_0x57fd('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x57fd('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x57fd('0x3')],'defaultValue':moment()[_0x57fd('0x4')](_0x57fd('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x57fd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x57fd('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x57fd('0x3')]},'priority':{'type':Sequelize[_0x57fd('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x57fd('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x57fd('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x57fd('0x7')},'UserId':{'type':Sequelize[_0x57fd('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x57fd('0x6')],'unique':_0x57fd('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x57fd('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x57fd('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x57fd('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4da=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','sequelize','exports','BOOLEAN'];(function(_0x1ef906,_0x97790b){var _0xec7228=function(_0x2a33f8){while(--_0x2a33f8){_0x1ef906['push'](_0x1ef906['shift']());}};_0xec7228(++_0x97790b);}(_0xb4da,0xd9));var _0xab4d=function(_0x691319,_0x1b73bb){_0x691319=_0x691319-0x0;var _0x4054dc=_0xb4da[_0x691319];return _0x4054dc;};'use strict';var moment=require('moment');var Sequelize=require(_0xab4d('0x0'));module[_0xab4d('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xab4d('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xab4d('0x3')],'defaultValue':moment()[_0xab4d('0x4')](_0xab4d('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xab4d('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xab4d('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xab4d('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xab4d('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xab4d('0x6')](0x2)[_0xab4d('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xab4d('0x9')},'ListId':{'type':Sequelize[_0xab4d('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xab4d('0x9')},'CampaignId':{'type':Sequelize[_0xab4d('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xab4d('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xab4d('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 107f3b9..3640b7e 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 _0x8421=['catch','show','params','keys','length','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','campaign','membername','user','UserId','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','getOpenContacts','format','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','$and','$or','$gt','$lt','$eq','$not','$between','$like','$notLike','$iLike','$contained','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','findAll'];(function(_0x5f2a6c,_0x5862a2){var _0x12919c=function(_0x2df667){while(--_0x2df667){_0x5f2a6c['push'](_0x5f2a6c['shift']());}};_0x12919c(++_0x5862a2);}(_0x8421,0x1e0));var _0x1842=function(_0x582d7b,_0x277eda){_0x582d7b=_0x582d7b-0x0;var _0x4a8a8f=_0x8421[_0x582d7b];return _0x4a8a8f;};'use strict';var emlformat=require(_0x1842('0x0'));var rimraf=require(_0x1842('0x1'));var zipdir=require(_0x1842('0x2'));var jsonpatch=require(_0x1842('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1842('0x4'));var sox=require('sox');var csv=require(_0x1842('0x5'));var ejs=require(_0x1842('0x6'));var fs=require('fs');var fs_extra=require(_0x1842('0x7'));var _=require('lodash');var squel=require(_0x1842('0x8'));var crypto=require('crypto');var jsforce=require(_0x1842('0x9'));var deskjs=require(_0x1842('0xa'));var toCsv=require(_0x1842('0x5'));var querystring=require('querystring');var Papa=require(_0x1842('0xb'));var Redis=require(_0x1842('0xc'));var authService=require(_0x1842('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1842('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1842('0xf'))(_0x1842('0x10'));var utils=require(_0x1842('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1842('0x12'));var db=require(_0x1842('0x13'))['db'];function respondWithStatusCode(_0x3fbf32,_0x11e473){_0x11e473=_0x11e473||0xcc;return function(_0x1e8821){if(_0x1e8821){return _0x3fbf32[_0x1842('0x14')](_0x11e473);}return _0x3fbf32[_0x1842('0x15')](_0x11e473)[_0x1842('0x16')]();};}function respondWithResult(_0x1aa23a,_0x573000){_0x573000=_0x573000||0xc8;return function(_0xafb86e){if(_0xafb86e){return _0x1aa23a[_0x1842('0x15')](_0x573000)[_0x1842('0x17')](_0xafb86e);}};}function respondWithFilteredResult(_0x4e67da,_0x25ca49){return function(_0x141dbf){if(_0x141dbf){var _0x3807bb=typeof _0x25ca49['offset']===_0x1842('0x18')&&typeof _0x25ca49[_0x1842('0x19')]===_0x1842('0x18');var _0xc906e0=_0x141dbf[_0x1842('0x1a')];var _0x3ddbd0=_0x3807bb?0x0:_0x25ca49[_0x1842('0x1b')];var _0x2bc9a1=_0x3807bb?_0x141dbf['count']:_0x25ca49[_0x1842('0x1b')]+_0x25ca49['limit'];var _0x1aee45;if(_0x2bc9a1>=_0xc906e0){_0x2bc9a1=_0xc906e0;_0x1aee45=0xc8;}else{_0x1aee45=0xce;}_0x4e67da[_0x1842('0x15')](_0x1aee45);return _0x4e67da[_0x1842('0x1c')]('Content-Range',_0x3ddbd0+'-'+_0x2bc9a1+'/'+_0xc906e0)[_0x1842('0x17')](_0x141dbf);}return null;};}function patchUpdates(_0x4eb17a){return function(_0x3bee3f){try{jsonpatch[_0x1842('0x1d')](_0x3bee3f,_0x4eb17a,!![]);}catch(_0x278904){return BPromise['reject'](_0x278904);}return _0x3bee3f[_0x1842('0x1e')]();};}function saveUpdates(_0x48a627,_0x81944b){return function(_0x507708){if(_0x507708){return _0x507708[_0x1842('0x1f')](_0x48a627)[_0x1842('0x20')](function(_0x407434){return _0x407434;});}return null;};}function removeEntity(_0x4e64f5,_0x5f39e8){return function(_0x5f4402){if(_0x5f4402){return _0x5f4402[_0x1842('0x21')]()[_0x1842('0x20')](function(){_0x4e64f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x481033,_0x441704){return function(_0x257cfa){if(!_0x257cfa){_0x481033[_0x1842('0x14')](0x194);}return _0x257cfa;};}function handleError(_0x208cc8,_0x5010a3){_0x5010a3=_0x5010a3||0x1f4;return function(_0x4bc73c){logger[_0x1842('0x22')](_0x4bc73c[_0x1842('0x23')]);if(_0x4bc73c['name']){delete _0x4bc73c['name'];}_0x208cc8[_0x1842('0x15')](_0x5010a3)[_0x1842('0x24')](_0x4bc73c);};}exports[_0x1842('0x25')]=function(_0xe289db,_0x294650){var _0x33a68e={},_0x12e936={},_0x188f91={'count':0x0,'rows':[]};var _0x106207=_[_0x1842('0x26')](db['CmHopper'][_0x1842('0x27')],function(_0xabac97){return{'name':_0xabac97[_0x1842('0x28')],'type':_0xabac97[_0x1842('0x29')][_0x1842('0x2a')]};});_0x12e936[_0x1842('0x2b')]=_[_0x1842('0x26')](_0x106207,_0x1842('0x2c'));_0x12e936[_0x1842('0x2d')]=_['keys'](_0xe289db[_0x1842('0x2d')]);_0x12e936[_0x1842('0x2e')]=_['intersection'](_0x12e936[_0x1842('0x2b')],_0x12e936[_0x1842('0x2d')]);_0x12e936[_0x1842('0x2e')]=_['concat'](_0x12e936[_0x1842('0x2e')],[_0x1842('0x2f'),_0x1842('0x30'),_0x1842('0x31'),'$gte',_0x1842('0x32'),'$lte','$ne',_0x1842('0x33'),_0x1842('0x34'),_0x1842('0x35'),'$notBetween','$in','$notIn',_0x1842('0x36'),_0x1842('0x37'),_0x1842('0x38'),'$notILike',_0x1842('0x36'),'$overlap','$contains',_0x1842('0x39'),'$any']);_0x33a68e['attributes']=_[_0x1842('0x3a')](_0x12e936[_0x1842('0x2b')],qs[_0x1842('0x3b')](_0xe289db[_0x1842('0x2d')][_0x1842('0x3b')]));_0x33a68e[_0x1842('0x3c')]=_0x33a68e[_0x1842('0x3c')]['length']?_0x33a68e['attributes']:_0x12e936[_0x1842('0x2b')];if(!_0xe289db[_0x1842('0x2d')][_0x1842('0x3d')]('nolimit')){_0x33a68e[_0x1842('0x19')]=qs[_0x1842('0x19')](_0xe289db[_0x1842('0x2d')]['limit']);_0x33a68e[_0x1842('0x1b')]=qs['offset'](_0xe289db[_0x1842('0x2d')][_0x1842('0x1b')]);}_0x33a68e['order']=qs[_0x1842('0x3e')](_0xe289db[_0x1842('0x2d')][_0x1842('0x3e')]);_0x33a68e[_0x1842('0x3f')]=qs[_0x1842('0x2e')](_[_0x1842('0x40')](_0xe289db[_0x1842('0x2d')],_0x12e936[_0x1842('0x2e')]),_0x106207);if(_0xe289db[_0x1842('0x2d')][_0x1842('0x41')]){_0x33a68e['where']=_[_0x1842('0x42')](_0x33a68e[_0x1842('0x3f')],{'$or':_['map'](_0x106207,function(_0x3c1086){if(_0x3c1086[_0x1842('0x29')]!=='VIRTUAL'){var _0xfa4326={};_0xfa4326[_0x3c1086[_0x1842('0x2c')]]={'$like':'%'+_0xe289db[_0x1842('0x2d')][_0x1842('0x41')]+'%'};return _0xfa4326;}})});}_0x33a68e=_['merge']({},_0x33a68e,_0xe289db[_0x1842('0x43')]);var _0x24419b={'where':_0x33a68e['where']};return db[_0x1842('0x44')]['count'](_0x24419b)[_0x1842('0x20')](function(_0x3b6077){_0x188f91[_0x1842('0x1a')]=_0x3b6077;if(_0xe289db[_0x1842('0x2d')][_0x1842('0x45')]){_0x33a68e[_0x1842('0x46')]=[{'all':!![]}];}return db['CmHopper'][_0x1842('0x47')](_0x33a68e);})[_0x1842('0x20')](function(_0x439cb3){_0x188f91['rows']=_0x439cb3;return _0x188f91;})[_0x1842('0x20')](respondWithFilteredResult(_0x294650,_0x33a68e))[_0x1842('0x48')](handleError(_0x294650,null));};exports[_0x1842('0x49')]=function(_0x44e597,_0x2dc792){var _0x378fb5={'raw':!![],'where':{'id':_0x44e597[_0x1842('0x4a')]['id']}},_0x311fe0={};_0x311fe0[_0x1842('0x2b')]=_[_0x1842('0x4b')](db[_0x1842('0x44')]['rawAttributes']);_0x311fe0[_0x1842('0x2d')]=_[_0x1842('0x4b')](_0x44e597['query']);_0x311fe0[_0x1842('0x2e')]=_['intersection'](_0x311fe0[_0x1842('0x2b')],_0x311fe0['query']);_0x378fb5[_0x1842('0x3c')]=_[_0x1842('0x3a')](_0x311fe0[_0x1842('0x2b')],qs[_0x1842('0x3b')](_0x44e597[_0x1842('0x2d')][_0x1842('0x3b')]));_0x378fb5[_0x1842('0x3c')]=_0x378fb5['attributes'][_0x1842('0x4c')]?_0x378fb5[_0x1842('0x3c')]:_0x311fe0[_0x1842('0x2b')];if(_0x44e597[_0x1842('0x2d')][_0x1842('0x45')]){_0x378fb5[_0x1842('0x46')]=[{'all':!![]}];}_0x378fb5=_['merge']({},_0x378fb5,_0x44e597[_0x1842('0x43')]);return db[_0x1842('0x44')][_0x1842('0x4d')](_0x378fb5)['then'](handleEntityNotFound(_0x2dc792,null))[_0x1842('0x20')](respondWithResult(_0x2dc792,null))[_0x1842('0x48')](handleError(_0x2dc792,null));};exports[_0x1842('0x4e')]=function(_0x48c1a5,_0x50cb82){return db[_0x1842('0x44')]['create'](_0x48c1a5[_0x1842('0x4f')],{})[_0x1842('0x20')](respondWithResult(_0x50cb82,0xc9))[_0x1842('0x48')](handleError(_0x50cb82,null));};exports[_0x1842('0x1f')]=function(_0x4c3489,_0x2c23b2){if(_0x4c3489[_0x1842('0x4f')]['id']){delete _0x4c3489[_0x1842('0x4f')]['id'];}return db[_0x1842('0x44')][_0x1842('0x4d')]({'where':{'id':_0x4c3489[_0x1842('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c23b2,null))[_0x1842('0x20')](saveUpdates(_0x4c3489[_0x1842('0x4f')],null))[_0x1842('0x20')](respondWithResult(_0x2c23b2,null))['catch'](handleError(_0x2c23b2,null));};exports[_0x1842('0x50')]=function(_0xd015f8,_0x174467){return db['CmHopper'][_0x1842('0x50')]()[_0x1842('0x20')](respondWithResult(_0x174467,null))[_0x1842('0x48')](handleError(_0x174467,null));};exports['destroy']=function(_0x4dfb10,_0x5ee355){var _0x188858;return db[_0x1842('0x44')][_0x1842('0x4d')]({'where':{'id':_0x4dfb10[_0x1842('0x4a')]['id']}})[_0x1842('0x20')](handleEntityNotFound(_0x5ee355,null))[_0x1842('0x20')](function(_0x438e4a){if(_0x438e4a){return _0x438e4a[_0x1842('0x21')]()[_0x1842('0x20')](function(_0x292651){return _0x292651;});}})['then'](function(_0x586112){_0x188858=_0x586112;if(_0x586112){if(_0x586112[_0x1842('0x51')]||_0x586112[_0x1842('0x52')]){return db[_0x586112['VoiceQueueId']?'VoiceQueue':_0x1842('0x53')]['find']({'where':{'id':_0x586112[_0x1842('0x51')]?_0x586112[_0x1842('0x51')]:_0x586112['CampaignId']},'attributes':['id',_0x1842('0x2c')],'raw':!![]});}}})[_0x1842('0x20')](function(_0x18eb4e){var _0xf5e467={};if(_0x18eb4e){_[_0x1842('0x42')](_0xf5e467,_[_0x1842('0x54')](_0x188858[_0x1842('0x55')],[_0x1842('0x56'),_0x1842('0x57'),'id']));_0xf5e467[_0x1842('0x58')]=0x15;_0xf5e467['statedesc']='deleted';_0xf5e467[_0x1842('0x59')]=_0x18eb4e[_0x1842('0x2c')];_0xf5e467[_0x1842('0x5a')]=_0x4dfb10[_0x1842('0x5b')][_0x1842('0x2c')];_0xf5e467[_0x1842('0x5c')]=_0x4dfb10[_0x1842('0x5b')]['id'];_0xf5e467[_0x1842('0x5d')]=!![];_0xf5e467['deletedat']=moment()['format'](_0x1842('0x5e'));_0xf5e467[_0x1842('0x5f')]=_0x188858[_0x1842('0x60')];_0xf5e467[_0x1842('0x61')]=_0x188858[_0x1842('0x51')]?_0x1842('0x62'):'ivr';return db[_0x1842('0x63')]['find']({'where':{'id':_0xf5e467[_0x1842('0x64')]},'attributes':['firstName',_0x1842('0x65')]})[_0x1842('0x20')](function(_0x32159e){if(!_['isNil'](_0x5ee355)&&!_[_0x1842('0x66')](_0x32159e[_0x1842('0x67')])){_0xf5e467[_0x1842('0x68')]=_0x32159e[_0x1842('0x67')];if(!_[_0x1842('0x66')](_0x32159e[_0x1842('0x65')])){_0xf5e467[_0x1842('0x68')]+='\x20'+_0x32159e[_0x1842('0x65')];}}})[_0x1842('0x69')](function(){return db['CmHopperFinal']['create'](_0xf5e467);});}})['then'](function(){return _0x5ee355[_0x1842('0x15')](0xcc)[_0x1842('0x16')]();})[_0x1842('0x48')](handleError(_0x5ee355,null));};exports[_0x1842('0x6a')]=function(_0x5b9c3a,_0x5dc902,_0x308306){var _0x1a03a2=[];return db[_0x1842('0x63')][_0x1842('0x50')]()[_0x1842('0x20')](function(_0x18621f){_0x1a03a2=_[_0x1842('0x4b')](_0x18621f);return _0x5b9c3a[_0x1842('0x5b')][_0x1842('0x6b')]({'where':{'type':_0x1842('0x6c'),'dialActive':!![],'dialMethod':_0x1842('0x6d')},'attributes':['id',_0x1842('0x6e')],'raw':!![]});})[_0x1842('0x20')](function(_0x1e14d0){if(_0x1e14d0&&_0x1e14d0['length']){return db[_0x1842('0x6f')][_0x1842('0x70')](function(_0x572567){var _0x48138b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x1842('0x5e'))},'VoiceQueueId':{'$in':_['map'](_0x1e14d0,'id')},'$or':[{'UserId':null},{'UserId':_0x5b9c3a['user']['id']}]};var _0x987268=[];if(_0x5b9c3a[_0x1842('0x4f')][_0x1842('0x71')]&&_0x5b9c3a[_0x1842('0x4f')][_0x1842('0x71')]===_0x1842('0x72')){if(!_[_0x1842('0x73')](_0x5b9c3a[_0x1842('0x4f')][_0x1842('0x74')])){_0x48138b['id']={'$in':_0x5b9c3a['body'][_0x1842('0x74')]};}_0x987268=[[_0x1842('0x75'),'ASC'],[_0x1842('0x76'),_0x1e14d0[0x0][_0x1842('0x6e')]===_0x1842('0x77')?'DESC':_0x1842('0x77')],db[_0x1842('0x6f')][_0x1842('0x78')](_0x1842('0x79')),['id','DESC']];}else{if(!_[_0x1842('0x73')](_0x5b9c3a['body']['hopperIds'])){_0x48138b['id']={'$notIn':_0x5b9c3a['body']['hopperIds']};}_0x987268=[[_0x1842('0x75'),_0x1842('0x7a')],['scheduledAt',_0x1e14d0[0x0][_0x1842('0x6e')]],db[_0x1842('0x6f')][_0x1842('0x78')](_0x1842('0x7b')),['id','ASC']];}return db[_0x1842('0x44')][_0x1842('0x7c')]({'attributes':['id','scheduledat'],'where':_0x48138b,'order':_0x987268,'transaction':_0x572567,'lock':_0x572567[_0x1842('0x7d')][_0x1842('0x7e')],'include':[{'model':db['CmContact'],'as':_0x1842('0x7f'),'attributes':_0x1a03a2,'include':[{'model':db[_0x1842('0x80')],'as':_0x1842('0x81'),'attributes':['id',_0x1842('0x2c')]}]},{'model':db[_0x1842('0x82')],'as':_0x1842('0x83'),'attributes':['id',_0x1842('0x2c')]},{'model':db[_0x1842('0x84')],'as':_0x1842('0x85'),'attributes':['id',_0x1842('0x2c'),'dialActive']}]})[_0x1842('0x20')](function(_0x536f3b){if(_0x536f3b){return _0x536f3b[_0x1842('0x1f')]({'UserId':_0x5b9c3a['user']['id']},{'transaction':_0x572567});}});});}})['then'](handleEntityNotFound(_0x5dc902,null))[_0x1842('0x20')](respondWithResult(_0x5dc902,null))[_0x1842('0x48')](handleError(_0x5dc902,null));};exports[_0x1842('0x86')]=function(_0x22fa8b,_0x2f6721,_0x1043e7){return _0x22fa8b['user'][_0x1842('0x6b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1842('0x6d')},'attributes':['id'],'raw':!![]})[_0x1842('0x20')](function(_0x2d57f0){if(_0x2d57f0&&_0x2d57f0[_0x1842('0x4c')]){return db[_0x1842('0x44')][_0x1842('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1842('0x87')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x1842('0x26')](_0x2d57f0,'id')},'$or':[{'UserId':null},{'UserId':_0x22fa8b[_0x1842('0x5b')]['id']}]}});}return 0x0;})['then'](function(_0x15e827){if(!_[_0x1842('0x66')](_0x15e827)&&_['isNumber'](_0x15e827)){return _0x2f6721[_0x1842('0x15')](0xc8)['json']({'contacts':_0x15e827});}else{logger[_0x1842('0x22')](_0x1842('0x88'),_0x1842('0x86'),0x194,_0x1842('0x89'));_0x2f6721[_0x1842('0x14')](0x194);}})[_0x1842('0x48')](handleError(_0x2f6721,null));}; \ No newline at end of file +var _0x9975=['findOne','scheduledat','UPDATE','Contact','CmList','List','dialActive','getOpenContacts','getVoiceQueues','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','intersection','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','update','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','deleted','campaign','user','UserId','deletedat','format','calleridnum','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','preview','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC'];(function(_0x12cdb8,_0x279a6f){var _0x34ff43=function(_0x2f994a){while(--_0x2f994a){_0x12cdb8['push'](_0x12cdb8['shift']());}};_0x34ff43(++_0x279a6f);}(_0x9975,0x133));var _0x5997=function(_0xfc2cbc,_0x41dca7){_0xfc2cbc=_0xfc2cbc-0x0;var _0x1aeb8e=_0x9975[_0xfc2cbc];return _0x1aeb8e;};'use strict';var emlformat=require(_0x5997('0x0'));var rimraf=require(_0x5997('0x1'));var zipdir=require(_0x5997('0x2'));var jsonpatch=require(_0x5997('0x3'));var rp=require('request-promise');var moment=require(_0x5997('0x4'));var BPromise=require(_0x5997('0x5'));var Mustache=require(_0x5997('0x6'));var util=require('util');var path=require(_0x5997('0x7'));var sox=require(_0x5997('0x8'));var csv=require(_0x5997('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5997('0xa'));var squel=require(_0x5997('0xb'));var crypto=require(_0x5997('0xc'));var jsforce=require(_0x5997('0xd'));var deskjs=require(_0x5997('0xe'));var toCsv=require(_0x5997('0x9'));var querystring=require(_0x5997('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5997('0x10'));var qs=require(_0x5997('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5997('0x12'));var logger=require(_0x5997('0x13'))(_0x5997('0x14'));var utils=require(_0x5997('0x15'));var config=require(_0x5997('0x16'));var licenseUtil=require(_0x5997('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47d5e9,_0x2e16ec){_0x2e16ec=_0x2e16ec||0xcc;return function(_0x1c37e3){if(_0x1c37e3){return _0x47d5e9[_0x5997('0x18')](_0x2e16ec);}return _0x47d5e9['status'](_0x2e16ec)[_0x5997('0x19')]();};}function respondWithResult(_0x5e65dc,_0x236ba5){_0x236ba5=_0x236ba5||0xc8;return function(_0x17df4a){if(_0x17df4a){return _0x5e65dc[_0x5997('0x1a')](_0x236ba5)[_0x5997('0x1b')](_0x17df4a);}};}function respondWithFilteredResult(_0x1644a9,_0x1aa508){return function(_0x5aa4ef){if(_0x5aa4ef){var _0x4ca773=typeof _0x1aa508[_0x5997('0x1c')]===_0x5997('0x1d')&&typeof _0x1aa508[_0x5997('0x1e')]===_0x5997('0x1d');var _0x2e98e0=_0x5aa4ef[_0x5997('0x1f')];var _0x34eb4b=_0x4ca773?0x0:_0x1aa508[_0x5997('0x1c')];var _0x272ff4=_0x4ca773?_0x5aa4ef[_0x5997('0x1f')]:_0x1aa508[_0x5997('0x1c')]+_0x1aa508[_0x5997('0x1e')];var _0x357dcc;if(_0x272ff4>=_0x2e98e0){_0x272ff4=_0x2e98e0;_0x357dcc=0xc8;}else{_0x357dcc=0xce;}_0x1644a9[_0x5997('0x1a')](_0x357dcc);return _0x1644a9[_0x5997('0x20')](_0x5997('0x21'),_0x34eb4b+'-'+_0x272ff4+'/'+_0x2e98e0)[_0x5997('0x1b')](_0x5aa4ef);}return null;};}function patchUpdates(_0x34743c){return function(_0x2438ea){try{jsonpatch[_0x5997('0x22')](_0x2438ea,_0x34743c,!![]);}catch(_0xb405fb){return BPromise[_0x5997('0x23')](_0xb405fb);}return _0x2438ea[_0x5997('0x24')]();};}function saveUpdates(_0xa04d4f,_0x28488b){return function(_0x475576){if(_0x475576){return _0x475576['update'](_0xa04d4f)[_0x5997('0x25')](function(_0x2aa912){return _0x2aa912;});}return null;};}function removeEntity(_0x3bfa94,_0x421ff6){return function(_0x44552f){if(_0x44552f){return _0x44552f[_0x5997('0x26')]()['then'](function(){_0x3bfa94[_0x5997('0x1a')](0xcc)[_0x5997('0x19')]();});}};}function handleEntityNotFound(_0x42a9d0,_0x46e23d){return function(_0x35dcbf){if(!_0x35dcbf){_0x42a9d0[_0x5997('0x18')](0x194);}return _0x35dcbf;};}function handleError(_0x19bb3d,_0x176a85){_0x176a85=_0x176a85||0x1f4;return function(_0x316a9d){logger[_0x5997('0x27')](_0x316a9d['stack']);if(_0x316a9d[_0x5997('0x28')]){delete _0x316a9d[_0x5997('0x28')];}_0x19bb3d[_0x5997('0x1a')](_0x176a85)[_0x5997('0x29')](_0x316a9d);};}exports[_0x5997('0x2a')]=function(_0x2c86b6,_0x2f5bd1){var _0x1b7e61={},_0x270a05={},_0x33ba76={'count':0x0,'rows':[]};var _0xaf7d02=_['map'](db[_0x5997('0x2b')][_0x5997('0x2c')],function(_0x4b55c6){return{'name':_0x4b55c6['fieldName'],'type':_0x4b55c6[_0x5997('0x2d')][_0x5997('0x2e')]};});_0x270a05[_0x5997('0x2f')]=_[_0x5997('0x30')](_0xaf7d02,_0x5997('0x28'));_0x270a05[_0x5997('0x31')]=_[_0x5997('0x32')](_0x2c86b6[_0x5997('0x31')]);_0x270a05[_0x5997('0x33')]=_[_0x5997('0x34')](_0x270a05[_0x5997('0x2f')],_0x270a05['query']);_0x270a05[_0x5997('0x33')]=_[_0x5997('0x35')](_0x270a05[_0x5997('0x33')],[_0x5997('0x36'),'$or',_0x5997('0x37'),_0x5997('0x38'),'$lt',_0x5997('0x39'),_0x5997('0x3a'),_0x5997('0x3b'),_0x5997('0x3c'),_0x5997('0x3d'),_0x5997('0x3e'),_0x5997('0x3f'),_0x5997('0x40'),_0x5997('0x41'),'$notLike',_0x5997('0x42'),_0x5997('0x43'),'$like',_0x5997('0x44'),_0x5997('0x45'),_0x5997('0x46'),'$any']);_0x1b7e61[_0x5997('0x47')]=_[_0x5997('0x34')](_0x270a05[_0x5997('0x2f')],qs[_0x5997('0x48')](_0x2c86b6[_0x5997('0x31')][_0x5997('0x48')]));_0x1b7e61[_0x5997('0x47')]=_0x1b7e61[_0x5997('0x47')][_0x5997('0x49')]?_0x1b7e61[_0x5997('0x47')]:_0x270a05[_0x5997('0x2f')];if(!_0x2c86b6[_0x5997('0x31')][_0x5997('0x4a')]('nolimit')){_0x1b7e61[_0x5997('0x1e')]=qs[_0x5997('0x1e')](_0x2c86b6[_0x5997('0x31')][_0x5997('0x1e')]);_0x1b7e61[_0x5997('0x1c')]=qs[_0x5997('0x1c')](_0x2c86b6[_0x5997('0x31')][_0x5997('0x1c')]);}_0x1b7e61[_0x5997('0x4b')]=qs[_0x5997('0x4c')](_0x2c86b6[_0x5997('0x31')][_0x5997('0x4c')]);_0x1b7e61['where']=qs[_0x5997('0x33')](_[_0x5997('0x4d')](_0x2c86b6[_0x5997('0x31')],_0x270a05['filters']),_0xaf7d02);if(_0x2c86b6['query'][_0x5997('0x4e')]){_0x1b7e61[_0x5997('0x4f')]=_[_0x5997('0x50')](_0x1b7e61[_0x5997('0x4f')],{'$or':_[_0x5997('0x30')](_0xaf7d02,function(_0x51194a){if(_0x51194a[_0x5997('0x2d')]!==_0x5997('0x51')){var _0x19ea06={};_0x19ea06[_0x51194a[_0x5997('0x28')]]={'$like':'%'+_0x2c86b6[_0x5997('0x31')][_0x5997('0x4e')]+'%'};return _0x19ea06;}})});}_0x1b7e61=_[_0x5997('0x50')]({},_0x1b7e61,_0x2c86b6['options']);var _0x4c86fa={'where':_0x1b7e61['where']};return db[_0x5997('0x2b')][_0x5997('0x1f')](_0x4c86fa)[_0x5997('0x25')](function(_0xb64539){_0x33ba76[_0x5997('0x1f')]=_0xb64539;if(_0x2c86b6[_0x5997('0x31')][_0x5997('0x52')]){_0x1b7e61[_0x5997('0x53')]=[{'all':!![]}];}return db[_0x5997('0x2b')][_0x5997('0x54')](_0x1b7e61);})[_0x5997('0x25')](function(_0x51585e){_0x33ba76['rows']=_0x51585e;return _0x33ba76;})['then'](respondWithFilteredResult(_0x2f5bd1,_0x1b7e61))['catch'](handleError(_0x2f5bd1,null));};exports[_0x5997('0x55')]=function(_0x2c7dfb,_0x10c864){var _0x227afa={'raw':!![],'where':{'id':_0x2c7dfb[_0x5997('0x56')]['id']}},_0x53c88c={};_0x53c88c[_0x5997('0x2f')]=_[_0x5997('0x32')](db[_0x5997('0x2b')][_0x5997('0x2c')]);_0x53c88c[_0x5997('0x31')]=_['keys'](_0x2c7dfb[_0x5997('0x31')]);_0x53c88c[_0x5997('0x33')]=_[_0x5997('0x34')](_0x53c88c[_0x5997('0x2f')],_0x53c88c['query']);_0x227afa[_0x5997('0x47')]=_['intersection'](_0x53c88c[_0x5997('0x2f')],qs[_0x5997('0x48')](_0x2c7dfb[_0x5997('0x31')][_0x5997('0x48')]));_0x227afa[_0x5997('0x47')]=_0x227afa['attributes'][_0x5997('0x49')]?_0x227afa[_0x5997('0x47')]:_0x53c88c['model'];if(_0x2c7dfb[_0x5997('0x31')][_0x5997('0x52')]){_0x227afa[_0x5997('0x53')]=[{'all':!![]}];}_0x227afa=_[_0x5997('0x50')]({},_0x227afa,_0x2c7dfb[_0x5997('0x57')]);return db[_0x5997('0x2b')]['find'](_0x227afa)[_0x5997('0x25')](handleEntityNotFound(_0x10c864,null))[_0x5997('0x25')](respondWithResult(_0x10c864,null))[_0x5997('0x58')](handleError(_0x10c864,null));};exports[_0x5997('0x59')]=function(_0x2fbf13,_0x254815){return db[_0x5997('0x2b')][_0x5997('0x59')](_0x2fbf13['body'],{})[_0x5997('0x25')](respondWithResult(_0x254815,0xc9))[_0x5997('0x58')](handleError(_0x254815,null));};exports[_0x5997('0x5a')]=function(_0x59e2fd,_0x4279ef){if(_0x59e2fd[_0x5997('0x5b')]['id']){delete _0x59e2fd['body']['id'];}return db[_0x5997('0x2b')][_0x5997('0x5c')]({'where':{'id':_0x59e2fd[_0x5997('0x56')]['id']}})[_0x5997('0x25')](handleEntityNotFound(_0x4279ef,null))['then'](saveUpdates(_0x59e2fd[_0x5997('0x5b')],null))[_0x5997('0x25')](respondWithResult(_0x4279ef,null))[_0x5997('0x58')](handleError(_0x4279ef,null));};exports['describe']=function(_0x29909c,_0x2c1f11){return db[_0x5997('0x2b')][_0x5997('0x5d')]()[_0x5997('0x25')](respondWithResult(_0x2c1f11,null))[_0x5997('0x58')](handleError(_0x2c1f11,null));};exports[_0x5997('0x26')]=function(_0x2b870e,_0x3ba1d9){var _0x5017b7;return db[_0x5997('0x2b')][_0x5997('0x5c')]({'where':{'id':_0x2b870e[_0x5997('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ba1d9,null))['then'](function(_0x5f520e){if(_0x5f520e){return _0x5f520e['destroy']()[_0x5997('0x25')](function(_0x169498){return _0x169498;});}})['then'](function(_0xf609d6){_0x5017b7=_0xf609d6;if(_0xf609d6){if(_0xf609d6[_0x5997('0x5e')]||_0xf609d6[_0x5997('0x5f')]){return db[_0xf609d6[_0x5997('0x5e')]?_0x5997('0x60'):_0x5997('0x61')]['find']({'where':{'id':_0xf609d6[_0x5997('0x5e')]?_0xf609d6[_0x5997('0x5e')]:_0xf609d6[_0x5997('0x5f')]},'attributes':['id',_0x5997('0x28')],'raw':!![]});}}})['then'](function(_0x10a21b){var _0x123ae2={};if(_0x10a21b){_['merge'](_0x123ae2,_[_0x5997('0x62')](_0x5017b7[_0x5997('0x63')],['createdAt',_0x5997('0x64'),'id']));_0x123ae2[_0x5997('0x65')]=0x15;_0x123ae2['statedesc']=_0x5997('0x66');_0x123ae2[_0x5997('0x67')]=_0x10a21b[_0x5997('0x28')];_0x123ae2['membername']=_0x2b870e[_0x5997('0x68')][_0x5997('0x28')];_0x123ae2[_0x5997('0x69')]=_0x2b870e[_0x5997('0x68')]['id'];_0x123ae2['deleted']=!![];_0x123ae2[_0x5997('0x6a')]=moment()[_0x5997('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x123ae2[_0x5997('0x6c')]=_0x5017b7['phone'];_0x123ae2[_0x5997('0x6d')]=_0x5017b7[_0x5997('0x5e')]?_0x5997('0x6e'):'ivr';return db[_0x5997('0x6f')][_0x5997('0x5c')]({'where':{'id':_0x123ae2['ContactId']},'attributes':[_0x5997('0x70'),_0x5997('0x71')]})[_0x5997('0x25')](function(_0x100596){if(!_[_0x5997('0x72')](_0x3ba1d9)&&!_[_0x5997('0x72')](_0x100596[_0x5997('0x70')])){_0x123ae2[_0x5997('0x73')]=_0x100596[_0x5997('0x70')];if(!_[_0x5997('0x72')](_0x100596[_0x5997('0x71')])){_0x123ae2[_0x5997('0x73')]+='\x20'+_0x100596[_0x5997('0x71')];}}})[_0x5997('0x74')](function(){return db[_0x5997('0x75')][_0x5997('0x59')](_0x123ae2);});}})['then'](function(){return _0x3ba1d9[_0x5997('0x1a')](0xcc)[_0x5997('0x19')]();})[_0x5997('0x58')](handleError(_0x3ba1d9,null));};exports['getPreview']=function(_0x3b35e8,_0x1a4b76,_0x23e451){var _0x364191=[];return db[_0x5997('0x6f')][_0x5997('0x5d')]()['then'](function(_0x51841e){_0x364191=_[_0x5997('0x32')](_0x51841e);return _0x3b35e8[_0x5997('0x68')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5997('0x76')},'attributes':['id',_0x5997('0x77')],'raw':!![]});})[_0x5997('0x25')](function(_0x789bc9){if(_0x789bc9&&_0x789bc9[_0x5997('0x49')]){return db['sequelize'][_0x5997('0x78')](function(_0x36d778){var _0x197f11={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5997('0x6b')](_0x5997('0x79'))},'VoiceQueueId':{'$in':_['map'](_0x789bc9,'id')},'$or':[{'UserId':null},{'UserId':_0x3b35e8[_0x5997('0x68')]['id']}]};var _0x3596c8=[];if(_0x3b35e8[_0x5997('0x5b')][_0x5997('0x7a')]&&_0x3b35e8[_0x5997('0x5b')][_0x5997('0x7a')]===_0x5997('0x7b')){if(!_[_0x5997('0x7c')](_0x3b35e8[_0x5997('0x5b')]['hopperIds'])){_0x197f11['id']={'$in':_0x3b35e8['body'][_0x5997('0x7d')]};}_0x3596c8=[[_0x5997('0x7e'),'ASC'],[_0x5997('0x7f'),_0x789bc9[0x0][_0x5997('0x77')]===_0x5997('0x80')?'DESC':_0x5997('0x80')],db[_0x5997('0x81')][_0x5997('0x82')](_0x5997('0x83')),['id',_0x5997('0x84')]];}else{if(!_[_0x5997('0x7c')](_0x3b35e8[_0x5997('0x5b')]['hopperIds'])){_0x197f11['id']={'$notIn':_0x3b35e8['body'][_0x5997('0x7d')]};}_0x3596c8=[[_0x5997('0x7e'),_0x5997('0x84')],[_0x5997('0x7f'),_0x789bc9[0x0][_0x5997('0x77')]],db[_0x5997('0x81')][_0x5997('0x82')](_0x5997('0x85')),['id',_0x5997('0x80')]];}return db[_0x5997('0x2b')][_0x5997('0x86')]({'attributes':['id',_0x5997('0x87')],'where':_0x197f11,'order':_0x3596c8,'transaction':_0x36d778,'lock':_0x36d778['LOCK'][_0x5997('0x88')],'include':[{'model':db[_0x5997('0x6f')],'as':_0x5997('0x89'),'attributes':_0x364191,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x5997('0x8a')],'as':_0x5997('0x8b'),'attributes':['id',_0x5997('0x28')]},{'model':db[_0x5997('0x60')],'as':'Queue','attributes':['id','name',_0x5997('0x8c')]}]})[_0x5997('0x25')](function(_0x3bd7d5){if(_0x3bd7d5){return _0x3bd7d5[_0x5997('0x5a')]({'UserId':_0x3b35e8[_0x5997('0x68')]['id']},{'transaction':_0x36d778});}});});}})['then'](handleEntityNotFound(_0x1a4b76,null))[_0x5997('0x25')](respondWithResult(_0x1a4b76,null))[_0x5997('0x58')](handleError(_0x1a4b76,null));};exports[_0x5997('0x8d')]=function(_0x5ad54f,_0x3c7bf5,_0x334968){return _0x5ad54f[_0x5997('0x68')][_0x5997('0x8e')]({'where':{'type':_0x5997('0x8f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xc4abfa){if(_0xc4abfa&&_0xc4abfa[_0x5997('0x49')]){return db[_0x5997('0x2b')][_0x5997('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5997('0x6b')](_0x5997('0x79'))},'VoiceQueueId':{'$in':_[_0x5997('0x30')](_0xc4abfa,'id')},'$or':[{'UserId':null},{'UserId':_0x5ad54f[_0x5997('0x68')]['id']}]}});}return 0x0;})[_0x5997('0x25')](function(_0x2e3fd8){if(!_[_0x5997('0x72')](_0x2e3fd8)&&_[_0x5997('0x90')](_0x2e3fd8)){return _0x3c7bf5[_0x5997('0x1a')](0xc8)[_0x5997('0x1b')]({'contacts':_0x2e3fd8});}else{logger['error'](_0x5997('0x91'),_0x5997('0x8d'),0x194,_0x5997('0x92'));_0x3c7bf5[_0x5997('0x18')](0x194);}})['catch'](handleError(_0x3c7bf5,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8667937..479200f 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 _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0xa7fbab,_0x35b97f){var _0x11dc64=function(_0x59f54a){while(--_0x59f54a){_0xa7fbab['push'](_0xa7fbab['shift']());}};_0x11dc64(++_0x35b97f);}(_0x31f0,0xb7));var _0x031f=function(_0x28ea7d,_0x5b49e0){_0x28ea7d=_0x28ea7d-0x0;var _0x73f15a=_0x31f0[_0x28ea7d];return _0x73f15a;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0xf5dc4a,_0x5445b0){var _0x556b7c=function(_0x3d2f11){while(--_0x3d2f11){_0xf5dc4a['push'](_0xf5dc4a['shift']());}};_0x556b7c(++_0x5445b0);}(_0x524e,0x15e));var _0xe524=function(_0x32e358,_0x26bba0){_0x32e358=_0x32e358-0x0;var _0x577aae=_0x524e[_0x32e358];return _0x577aae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 114cc6e..91d9e22 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 _0x78c9=['../../config/environment','jayson/promise','http','then','info','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopper,\x20%s,\x20%s','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','User','voicePause','length','update','includes','push','all','create','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','transaction','keys','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29542b,_0x14edfc){var _0x2fcdc3=function(_0x3de252){while(--_0x3de252){_0x29542b['push'](_0x29542b['shift']());}};_0x2fcdc3(++_0x14edfc);}(_0x78c9,0xfc));var _0x978c=function(_0x5a8dcb,_0x3cfbd5){_0x5a8dcb=_0x5a8dcb-0x0;var _0xa338ea=_0x78c9[_0x5a8dcb];return _0xa338ea;};'use strict';var _=require(_0x978c('0x0'));var util=require(_0x978c('0x1'));var moment=require(_0x978c('0x2'));var BPromise=require(_0x978c('0x3'));var rs=require(_0x978c('0x4'));var fs=require('fs');var Redis=require(_0x978c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x978c('0x6'));var logger=require(_0x978c('0x7'))('rpc');var config=require(_0x978c('0x8'));var jayson=require(_0x978c('0x9'));var client=jayson['client'][_0x978c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1206f5,_0x4d3212,_0x4a0f92){return new BPromise(function(_0x2af829,_0x58ef44){return client['request'](_0x1206f5,_0x4a0f92)[_0x978c('0xb')](function(_0x445ffa){logger[_0x978c('0xc')]('CmHopper,\x20%s,\x20%s',_0x4d3212,'request\x20sent');logger[_0x978c('0xd')](_0x978c('0xe'),_0x4d3212,_0x978c('0xf'),JSON[_0x978c('0x10')](_0x445ffa));if(_0x445ffa[_0x978c('0x11')]){if(_0x445ffa[_0x978c('0x11')][_0x978c('0x12')]===0x1f4){logger[_0x978c('0x11')]('CmHopper,\x20%s,\x20%s',_0x4d3212,_0x445ffa[_0x978c('0x11')]['message']);return _0x58ef44(_0x445ffa[_0x978c('0x11')][_0x978c('0x13')]);}logger[_0x978c('0x11')](_0x978c('0x14'),_0x4d3212,_0x445ffa[_0x978c('0x11')][_0x978c('0x13')]);return _0x2af829(_0x445ffa[_0x978c('0x11')][_0x978c('0x13')]);}else{logger[_0x978c('0xc')](_0x978c('0x14'),_0x4d3212,'request\x20sent');_0x2af829(_0x445ffa[_0x978c('0x15')][_0x978c('0x13')]);}})[_0x978c('0x16')](function(_0x3ee8fe){logger['error'](_0x978c('0x14'),_0x4d3212,_0x3ee8fe);_0x58ef44(_0x3ee8fe);});});}exports[_0x978c('0x17')]=function(_0x4b9dbe){var _0xbc4bb2=this;return new Promise(function(_0x48c8c1,_0x4bec80){return db[_0x978c('0x18')]['findAll']({'raw':_0x4b9dbe[_0x978c('0x19')]?_0x4b9dbe[_0x978c('0x19')][_0x978c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b9dbe[_0x978c('0x19')]?_0x4b9dbe[_0x978c('0x19')][_0x978c('0x1b')]||null:null,'attributes':_0x4b9dbe[_0x978c('0x19')]?_0x4b9dbe['options'][_0x978c('0x1c')]||null:null,'limit':_0x4b9dbe[_0x978c('0x19')]?_0x4b9dbe[_0x978c('0x19')][_0x978c('0x1d')]||null:null,'include':_0x4b9dbe[_0x978c('0x19')]?_0x4b9dbe[_0x978c('0x19')]['include']?_['map'](_0x4b9dbe[_0x978c('0x19')][_0x978c('0x1e')],function(_0x21e866){return{'model':db[_0x21e866['model']],'as':_0x21e866['as'],'attributes':_0x21e866['attributes'],'include':_0x21e866['include']?_[_0x978c('0x1f')](_0x21e866['include'],function(_0x4b7b7a){return{'model':db[_0x4b7b7a[_0x978c('0x20')]],'as':_0x4b7b7a['as'],'attributes':_0x4b7b7a[_0x978c('0x1c')],'include':_0x4b7b7a['include']?_[_0x978c('0x1f')](_0x4b7b7a[_0x978c('0x1e')],function(_0xa7f3ad){return{'model':db[_0xa7f3ad[_0x978c('0x20')]],'as':_0xa7f3ad['as'],'attributes':_0xa7f3ad['attributes']};}):[]};}):[]};}):[]:[]})[_0x978c('0xb')](function(_0x13ba2e){logger[_0x978c('0xc')](_0x978c('0x17'),_0x4b9dbe);logger[_0x978c('0xd')]('GetCmHopper',_0x4b9dbe,JSON[_0x978c('0x10')](_0x13ba2e));_0x48c8c1(_0x13ba2e);})[_0x978c('0x16')](function(_0x427efe){logger[_0x978c('0x11')]('GetCmHopper',_0x427efe[_0x978c('0x13')],_0x4b9dbe);_0x4bec80(_0xbc4bb2['error'](0x1f4,_0x427efe[_0x978c('0x13')]));});});};exports[_0x978c('0x21')]=function(_0x5ca7c5){var _0x1ca755=this;return new Promise(function(_0x5ad4ce,_0x34cfab){return db['CmHopper']['find']({'raw':_0x5ca7c5[_0x978c('0x19')]?_0x5ca7c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ca7c5[_0x978c('0x19')]?_0x5ca7c5[_0x978c('0x19')][_0x978c('0x1b')]||null:null,'attributes':_0x5ca7c5[_0x978c('0x19')]?_0x5ca7c5[_0x978c('0x19')][_0x978c('0x1c')]||null:null,'include':_0x5ca7c5[_0x978c('0x19')]?_0x5ca7c5['options'][_0x978c('0x1e')]?_[_0x978c('0x1f')](_0x5ca7c5[_0x978c('0x19')][_0x978c('0x1e')],function(_0x4e4598){return{'model':db[_0x4e4598[_0x978c('0x20')]],'as':_0x4e4598['as'],'attributes':_0x4e4598['attributes'],'include':_0x4e4598['include']?_[_0x978c('0x1f')](_0x4e4598[_0x978c('0x1e')],function(_0x41732a){return{'model':db[_0x41732a[_0x978c('0x20')]],'as':_0x41732a['as'],'attributes':_0x41732a[_0x978c('0x1c')],'include':_0x41732a[_0x978c('0x1e')]?_[_0x978c('0x1f')](_0x41732a['include'],function(_0x3a99f9){return{'model':db[_0x3a99f9[_0x978c('0x20')]],'as':_0x3a99f9['as'],'attributes':_0x3a99f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x978c('0xb')](function(_0x597c0f){logger[_0x978c('0xc')](_0x978c('0x21'),_0x5ca7c5);logger['debug']('ShowCmHopper',_0x5ca7c5,JSON[_0x978c('0x10')](_0x597c0f));_0x5ad4ce(_0x597c0f);})['catch'](function(_0x3e6543){logger['error'](_0x978c('0x21'),_0x3e6543['message'],_0x5ca7c5);_0x34cfab(_0x1ca755[_0x978c('0x11')](0x1f4,_0x3e6543[_0x978c('0x13')]));});});};exports[_0x978c('0x22')]=function(_0x5af205){var _0xdfe2fb=this;return new Promise(function(_0x19017c,_0x312205){return db[_0x978c('0x18')]['create'](_0x5af205[_0x978c('0x23')],{'raw':_0x5af205[_0x978c('0x19')]?_0x5af205[_0x978c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1d8443){logger[_0x978c('0xc')]('CreateCmHopper',_0x5af205);logger[_0x978c('0xd')]('CreateCmHopper',_0x5af205,JSON[_0x978c('0x10')](_0x1d8443));_0x19017c(_0x1d8443);})[_0x978c('0x16')](function(_0x4adbd0){logger[_0x978c('0x11')](_0x978c('0x22'),_0x4adbd0['message'],_0x5af205);_0x312205(_0xdfe2fb[_0x978c('0x11')](0x1f4,_0x4adbd0[_0x978c('0x13')]));});});};exports['UpdateCmHopper']=function(_0x2bf254){var _0x274760=this;return new Promise(function(_0x3813e1,_0x2de713){return db[_0x978c('0x18')]['update'](_0x2bf254[_0x978c('0x23')],{'raw':_0x2bf254[_0x978c('0x19')]?_0x2bf254[_0x978c('0x19')][_0x978c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bf254['options']?_0x2bf254[_0x978c('0x19')][_0x978c('0x1b')]||null:null,'attributes':_0x2bf254[_0x978c('0x19')]?_0x2bf254['options'][_0x978c('0x1c')]||null:null,'limit':_0x2bf254[_0x978c('0x19')]?_0x2bf254['options']['limit']||null:null})[_0x978c('0xb')](function(_0x3b8615){logger[_0x978c('0xc')](_0x978c('0x24'),_0x2bf254);logger[_0x978c('0xd')](_0x978c('0x24'),_0x2bf254,JSON[_0x978c('0x10')](_0x3b8615));_0x3813e1(_0x3b8615);})[_0x978c('0x16')](function(_0x4e3c92){logger['error'](_0x978c('0x24'),_0x4e3c92[_0x978c('0x13')],_0x2bf254);_0x2de713(_0x274760[_0x978c('0x11')](0x1f4,_0x4e3c92['message']));});});};exports['DestroyCmHopper']=function(_0x5bbd33){var _0x4c9904=this;return new Promise(function(_0x16dfd6,_0x16b9b3){return db[_0x978c('0x18')][_0x978c('0x25')]({'where':_0x5bbd33[_0x978c('0x19')]?_0x5bbd33[_0x978c('0x19')][_0x978c('0x1b')]||null:null})[_0x978c('0xb')](function(_0x3872f2){logger[_0x978c('0xc')](_0x978c('0x26'),_0x5bbd33);logger['debug']('DestroyCmHopper',_0x5bbd33,JSON[_0x978c('0x10')](_0x3872f2));_0x16dfd6(_0x3872f2);})[_0x978c('0x16')](function(_0x1e5831){logger['error'](_0x978c('0x26'),_0x1e5831[_0x978c('0x13')],_0x5bbd33);_0x16b9b3(_0x4c9904[_0x978c('0x11')](0x1f4,_0x1e5831['message']));});});};exports[_0x978c('0x27')]=function(_0x2de6e6){var _0x1b6654=this;return new Promise(function(_0x3e0303,_0x54aa78){return db[_0x978c('0x28')][_0x978c('0x29')]()[_0x978c('0xb')](function(_0x5696c8){return db[_0x978c('0x2a')]['transaction'](function(_0xf0ff1e){return db[_0x978c('0x18')][_0x978c('0x2b')]({'where':_0x2de6e6[_0x978c('0x19')]?_0x2de6e6[_0x978c('0x19')][_0x978c('0x1b')]||null:null,'attributes':_0x2de6e6['options']?_0x2de6e6[_0x978c('0x19')]['attributes']||null:null,'limit':_0x2de6e6['options']?_0x2de6e6[_0x978c('0x19')][_0x978c('0x1d')]||null:null,'order':_0x2de6e6[_0x978c('0x19')]?_0x2de6e6['options'][_0x978c('0x2c')]||null:null,'transaction':_0xf0ff1e,'lock':_0xf0ff1e[_0x978c('0x2d')][_0x978c('0x2e')],'include':[{'model':db[_0x978c('0x28')],'as':_0x978c('0x2f'),'attributes':_['keys'](_0x5696c8)},{'model':db[_0x978c('0x30')],'as':'Agent','attributes':['id','name',_0x978c('0x31')]}]})[_0x978c('0xb')](function(_0x20700f){var _0x5cbbd7=[];var _0x2b28f0=[];for(var _0x5cc69c=0x0;_0x5cc69c<_0x20700f[_0x978c('0x32')];_0x5cc69c+=0x1){var _0x4be3b3=_0x20700f[_0x5cc69c]['UserId'];if(_0x4be3b3===null){_0x5cbbd7['push'](_0x20700f[_0x5cc69c][_0x978c('0x33')](_0x2de6e6[_0x978c('0x23')],{'transaction':_0xf0ff1e}));}else if(!_0x2b28f0[_0x978c('0x34')](_0x4be3b3)){_0x2b28f0[_0x978c('0x35')](_0x4be3b3);_0x5cbbd7[_0x978c('0x35')](_0x20700f[_0x5cc69c][_0x978c('0x33')](_0x2de6e6['body'],{'transaction':_0xf0ff1e}));}}return BPromise[_0x978c('0x36')](_0x5cbbd7);});})[_0x978c('0xb')](function(_0x52501e){logger[_0x978c('0xc')](_0x978c('0x27'),_0x2de6e6);logger[_0x978c('0xd')]('GetContactDialer',_0x2de6e6,JSON['stringify'](_0x52501e));_0x3e0303(_0x52501e);})[_0x978c('0x16')](function(_0x4a18bd){logger[_0x978c('0x11')]('GetContactDialer',_0x4a18bd[_0x978c('0x13')],_0x2de6e6);_0x54aa78(_0x1b6654[_0x978c('0x11')](0x1f4,_0x4a18bd[_0x978c('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x3d9aeb){var _0x13aabb=this;return new Promise(function(_0x78c368,_0x50c538){return db[_0x978c('0x2a')]['transaction'](function(_0x1f1bd){return db['CmHopperFinal'][_0x978c('0x37')](_0x3d9aeb[_0x978c('0x23')],{'raw':_0x3d9aeb['options']?_0x3d9aeb[_0x978c('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1f1bd})[_0x978c('0xb')](function(){return db['CmHopper'][_0x978c('0x25')]({'where':_0x3d9aeb[_0x978c('0x19')]?_0x3d9aeb[_0x978c('0x19')]['where']||null:null,'transaction':_0x1f1bd});});})[_0x978c('0xb')](function(_0x298b6f){logger['info']('MoveContactManagedDialer',_0x3d9aeb);logger[_0x978c('0xd')](_0x978c('0x38'),_0x3d9aeb,JSON['stringify'](_0x298b6f));_0x78c368(_0x298b6f);})['catch'](function(_0xc12735){logger[_0x978c('0x11')](_0x978c('0x38'),_0xc12735['message'],_0x3d9aeb);_0x50c538(_0x13aabb['error'](0x1f4,_0xc12735['message']));});});};exports[_0x978c('0x39')]=function(_0x3c8941){var _0x1c105d=this;return new Promise(function(_0x18249a,_0x4bff20){return db[_0x978c('0x18')][_0x978c('0x2b')]({'raw':_0x3c8941[_0x978c('0x19')]?_0x3c8941[_0x978c('0x19')][_0x978c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c8941['options']?_0x3c8941['options']['where']||null:null,'attributes':[[db[_0x978c('0x2a')]['fn'](_0x978c('0x3a'),db[_0x978c('0x2a')]['fn']('IF',db[_0x978c('0x2a')]['literal'](_0x978c('0x3b')+util['format']('\x22%s\x22',moment()[_0x978c('0x3c')](_0x978c('0x3d')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x978c('0xb')](function(_0x682496){logger[_0x978c('0xc')](_0x978c('0x39'),_0x3c8941);logger[_0x978c('0xd')](_0x978c('0x39'),_0x3c8941,JSON['stringify'](_0x682496));_0x18249a(_0x682496);})[_0x978c('0x16')](function(_0x5190c0){logger[_0x978c('0x11')](_0x978c('0x39'),_0x5190c0[_0x978c('0x13')],_0x3c8941);_0x4bff20(_0x1c105d[_0x978c('0x11')](0x1f4,_0x5190c0[_0x978c('0x13')]));});});};exports[_0x978c('0x3e')]=function(_0x42ec4){var _0xe6aef6=this;return new Promise(function(_0x5575a7,_0x2f2c30){return db[_0x978c('0x28')][_0x978c('0x29')]()[_0x978c('0xb')](function(_0x2bdace){return db[_0x978c('0x2a')][_0x978c('0x3f')](function(_0x2e1eae){return db['CmHopper'][_0x978c('0x2b')]({'where':_0x42ec4[_0x978c('0x19')]?_0x42ec4['options'][_0x978c('0x1b')]||null:null,'attributes':_0x42ec4['options']?_0x42ec4[_0x978c('0x19')][_0x978c('0x1c')]||null:null,'limit':0x1,'order':_0x42ec4[_0x978c('0x19')]?_0x42ec4[_0x978c('0x19')][_0x978c('0x2c')]||null:null,'group':db[_0x978c('0x18')]['UserId'],'transaction':_0x2e1eae,'lock':_0x2e1eae['LOCK'][_0x978c('0x2e')],'include':_0x42ec4[_0x978c('0x19')]?_0x42ec4[_0x978c('0x19')][_0x978c('0x1e')]?_[_0x978c('0x1f')](_0x42ec4['options'][_0x978c('0x1e')],function(_0x14df3b){return{'model':db[_0x14df3b['model']],'as':_0x14df3b['as'],'attributes':_0x14df3b['attributes'],'include':_0x14df3b['include']?_['map'](_0x14df3b['include'],function(_0x252c23){return{'model':db[_0x252c23[_0x978c('0x20')]],'as':_0x252c23['as'],'attributes':_0x252c23['attributes'],'include':_0x252c23[_0x978c('0x1e')]?_[_0x978c('0x1f')](_0x252c23[_0x978c('0x1e')],function(_0x5517c3){return{'model':db[_0x5517c3['model']],'as':_0x5517c3['as'],'attributes':_0x5517c3[_0x978c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x978c('0xb')](function(_0xd51067){var _0x1a6f57=[];for(var _0x2cc864=0x0;_0x2cc864<_0xd51067[_0x978c('0x32')];_0x2cc864+=0x1){_0x1a6f57[_0x978c('0x35')](_0xd51067[_0x2cc864]['update'](_0x42ec4[_0x978c('0x23')],{'transaction':_0x2e1eae}));}return BPromise['all'](_0x1a6f57);});})[_0x978c('0xb')](function(_0x34ac01){logger[_0x978c('0xc')](_0x978c('0x3e'),_0x42ec4);logger[_0x978c('0xd')](_0x978c('0x3e'),_0x42ec4,JSON[_0x978c('0x10')](_0x34ac01));_0x5575a7(_0x34ac01);})[_0x978c('0x16')](function(_0x540493){logger[_0x978c('0x11')](_0x978c('0x3e'),_0x540493[_0x978c('0x13')],_0x42ec4);_0x2f2c30(_0xe6aef6['error'](0x1f4,_0x540493[_0x978c('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x388705){var _0x2eabdd=this;return new Promise(function(_0x359cb0,_0x1a8187){db[_0x978c('0x28')][_0x978c('0x29')]()[_0x978c('0xb')](function(_0x1594c6){return db['CmHopper']['findAll']({'raw':_0x388705[_0x978c('0x19')]?_0x388705['options'][_0x978c('0x1a')]===undefined?!![]:![]:!![],'where':_0x388705['options']?_0x388705[_0x978c('0x19')]['where']||null:null,'attributes':_0x388705[_0x978c('0x19')]?_0x388705[_0x978c('0x19')][_0x978c('0x1c')]||null:null,'limit':_0x388705[_0x978c('0x19')]?_0x388705[_0x978c('0x19')][_0x978c('0x1d')]||null:null,'include':_0x388705[_0x978c('0x19')]?_0x388705[_0x978c('0x19')]['include']?_[_0x978c('0x1f')](_0x388705[_0x978c('0x19')][_0x978c('0x1e')],function(_0x1d5e37){return{'model':db[_0x1d5e37[_0x978c('0x20')]],'as':_0x1d5e37['as'],'attributes':_0x1d5e37['as']===_0x978c('0x2f')?_[_0x978c('0x40')](_0x1594c6):_0x1d5e37['attributes'],'include':_0x1d5e37['include']?_['map'](_0x1d5e37['include'],function(_0x3fbc45){return{'model':db[_0x3fbc45[_0x978c('0x20')]],'as':_0x3fbc45['as'],'attributes':_0x3fbc45['attributes'],'include':_0x3fbc45[_0x978c('0x1e')]?_[_0x978c('0x1f')](_0x3fbc45['include'],function(_0x522f51){return{'model':db[_0x522f51[_0x978c('0x20')]],'as':_0x522f51['as'],'attributes':_0x522f51['attributes']};}):[]};}):[]};}):[]:[]})[_0x978c('0xb')](function(_0x3272a8){logger['info'](_0x978c('0x17'),_0x388705);logger[_0x978c('0xd')](_0x978c('0x17'),_0x388705,JSON[_0x978c('0x10')](_0x3272a8));_0x359cb0(_0x3272a8);})['catch'](function(_0x2b616e){logger[_0x978c('0x11')](_0x978c('0x17'),_0x2b616e[_0x978c('0x13')],_0x388705);_0x1a8187(_0x2eabdd[_0x978c('0x11')](0x1f4,_0x2b616e[_0x978c('0x13')]));});});});}; \ No newline at end of file +var _0x0bc3=['findAll','raw','options','where','limit','include','map','attributes','model','debug','catch','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','includes','push','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','all','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','then','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','GetCmHopper','CmHopper'];(function(_0x5e8216,_0x166adb){var _0x25c11c=function(_0x19780e){while(--_0x19780e){_0x5e8216['push'](_0x5e8216['shift']());}};_0x25c11c(++_0x166adb);}(_0x0bc3,0x1e3));var _0x30bc=function(_0x3ae5ef,_0x3afbef){_0x3ae5ef=_0x3ae5ef-0x0;var _0x2e8c3b=_0x0bc3[_0x3ae5ef];return _0x2e8c3b;};'use strict';var _=require(_0x30bc('0x0'));var util=require(_0x30bc('0x1'));var moment=require(_0x30bc('0x2'));var BPromise=require(_0x30bc('0x3'));var rs=require(_0x30bc('0x4'));var fs=require('fs');var Redis=require(_0x30bc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x30bc('0x6'));var config=require(_0x30bc('0x7'));var jayson=require(_0x30bc('0x8'));var client=jayson[_0x30bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293048,_0x3d6380,_0x43ff3e){return new BPromise(function(_0x229f6f,_0x338ea5){return client['request'](_0x293048,_0x43ff3e)[_0x30bc('0xa')](function(_0x2802b6){logger['info'](_0x30bc('0xb'),_0x3d6380,'request\x20sent');logger['debug'](_0x30bc('0xc'),_0x3d6380,'request\x20sent',JSON[_0x30bc('0xd')](_0x2802b6));if(_0x2802b6['error']){if(_0x2802b6[_0x30bc('0xe')][_0x30bc('0xf')]===0x1f4){logger[_0x30bc('0xe')](_0x30bc('0xb'),_0x3d6380,_0x2802b6[_0x30bc('0xe')]['message']);return _0x338ea5(_0x2802b6[_0x30bc('0xe')][_0x30bc('0x10')]);}logger[_0x30bc('0xe')]('CmHopper,\x20%s,\x20%s',_0x3d6380,_0x2802b6['error'][_0x30bc('0x10')]);return _0x229f6f(_0x2802b6[_0x30bc('0xe')][_0x30bc('0x10')]);}else{logger[_0x30bc('0x11')](_0x30bc('0xb'),_0x3d6380,_0x30bc('0x12'));_0x229f6f(_0x2802b6['result']['message']);}})['catch'](function(_0x4344ac){logger[_0x30bc('0xe')]('CmHopper,\x20%s,\x20%s',_0x3d6380,_0x4344ac);_0x338ea5(_0x4344ac);});});}exports[_0x30bc('0x13')]=function(_0x4e4c8a){var _0x2393e6=this;return new Promise(function(_0x24ab59,_0x3add0f){return db[_0x30bc('0x14')][_0x30bc('0x15')]({'raw':_0x4e4c8a['options']?_0x4e4c8a['options'][_0x30bc('0x16')]===undefined?!![]:![]:!![],'where':_0x4e4c8a[_0x30bc('0x17')]?_0x4e4c8a[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'attributes':_0x4e4c8a[_0x30bc('0x17')]?_0x4e4c8a[_0x30bc('0x17')]['attributes']||null:null,'limit':_0x4e4c8a[_0x30bc('0x17')]?_0x4e4c8a[_0x30bc('0x17')][_0x30bc('0x19')]||null:null,'include':_0x4e4c8a[_0x30bc('0x17')]?_0x4e4c8a[_0x30bc('0x17')][_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x4e4c8a['options'][_0x30bc('0x1a')],function(_0x3f31ce){return{'model':db[_0x3f31ce['model']],'as':_0x3f31ce['as'],'attributes':_0x3f31ce[_0x30bc('0x1c')],'include':_0x3f31ce[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x3f31ce[_0x30bc('0x1a')],function(_0x4634a8){return{'model':db[_0x4634a8[_0x30bc('0x1d')]],'as':_0x4634a8['as'],'attributes':_0x4634a8[_0x30bc('0x1c')],'include':_0x4634a8[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x4634a8['include'],function(_0x5856a0){return{'model':db[_0x5856a0[_0x30bc('0x1d')]],'as':_0x5856a0['as'],'attributes':_0x5856a0[_0x30bc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x30bc('0xa')](function(_0x1d4b17){logger[_0x30bc('0x11')]('GetCmHopper',_0x4e4c8a);logger[_0x30bc('0x1e')](_0x30bc('0x13'),_0x4e4c8a,JSON['stringify'](_0x1d4b17));_0x24ab59(_0x1d4b17);})[_0x30bc('0x1f')](function(_0x502384){logger[_0x30bc('0xe')](_0x30bc('0x13'),_0x502384['message'],_0x4e4c8a);_0x3add0f(_0x2393e6[_0x30bc('0xe')](0x1f4,_0x502384[_0x30bc('0x10')]));});});};exports[_0x30bc('0x20')]=function(_0xf9157a){var _0x2d73de=this;return new Promise(function(_0x1e651a,_0x11c2dc){return db['CmHopper'][_0x30bc('0x21')]({'raw':_0xf9157a['options']?_0xf9157a[_0x30bc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xf9157a[_0x30bc('0x17')]?_0xf9157a[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'attributes':_0xf9157a[_0x30bc('0x17')]?_0xf9157a[_0x30bc('0x17')][_0x30bc('0x1c')]||null:null,'include':_0xf9157a[_0x30bc('0x17')]?_0xf9157a[_0x30bc('0x17')]['include']?_['map'](_0xf9157a[_0x30bc('0x17')][_0x30bc('0x1a')],function(_0x1d80ac){return{'model':db[_0x1d80ac[_0x30bc('0x1d')]],'as':_0x1d80ac['as'],'attributes':_0x1d80ac[_0x30bc('0x1c')],'include':_0x1d80ac[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x1d80ac[_0x30bc('0x1a')],function(_0x2d62c9){return{'model':db[_0x2d62c9[_0x30bc('0x1d')]],'as':_0x2d62c9['as'],'attributes':_0x2d62c9[_0x30bc('0x1c')],'include':_0x2d62c9['include']?_[_0x30bc('0x1b')](_0x2d62c9[_0x30bc('0x1a')],function(_0x1c0ca3){return{'model':db[_0x1c0ca3['model']],'as':_0x1c0ca3['as'],'attributes':_0x1c0ca3[_0x30bc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x30bc('0xa')](function(_0x35b244){logger[_0x30bc('0x11')](_0x30bc('0x20'),_0xf9157a);logger[_0x30bc('0x1e')](_0x30bc('0x20'),_0xf9157a,JSON['stringify'](_0x35b244));_0x1e651a(_0x35b244);})[_0x30bc('0x1f')](function(_0x3fc8b1){logger['error']('ShowCmHopper',_0x3fc8b1[_0x30bc('0x10')],_0xf9157a);_0x11c2dc(_0x2d73de[_0x30bc('0xe')](0x1f4,_0x3fc8b1[_0x30bc('0x10')]));});});};exports[_0x30bc('0x22')]=function(_0x4aeb72){var _0x51b597=this;return new Promise(function(_0x567d14,_0xe2e4ed){return db['CmHopper'][_0x30bc('0x23')](_0x4aeb72['body'],{'raw':_0x4aeb72[_0x30bc('0x17')]?_0x4aeb72[_0x30bc('0x17')][_0x30bc('0x16')]===undefined?!![]:![]:!![]})[_0x30bc('0xa')](function(_0x8f125){logger['info'](_0x30bc('0x22'),_0x4aeb72);logger[_0x30bc('0x1e')](_0x30bc('0x22'),_0x4aeb72,JSON[_0x30bc('0xd')](_0x8f125));_0x567d14(_0x8f125);})[_0x30bc('0x1f')](function(_0x486b7a){logger['error'](_0x30bc('0x22'),_0x486b7a[_0x30bc('0x10')],_0x4aeb72);_0xe2e4ed(_0x51b597[_0x30bc('0xe')](0x1f4,_0x486b7a[_0x30bc('0x10')]));});});};exports[_0x30bc('0x24')]=function(_0x4ee5d1){var _0xdf63cf=this;return new Promise(function(_0x484d01,_0x37eb38){return db[_0x30bc('0x14')][_0x30bc('0x25')](_0x4ee5d1[_0x30bc('0x26')],{'raw':_0x4ee5d1[_0x30bc('0x17')]?_0x4ee5d1['options'][_0x30bc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ee5d1[_0x30bc('0x17')]?_0x4ee5d1[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'attributes':_0x4ee5d1['options']?_0x4ee5d1[_0x30bc('0x17')][_0x30bc('0x1c')]||null:null,'limit':_0x4ee5d1[_0x30bc('0x17')]?_0x4ee5d1[_0x30bc('0x17')]['limit']||null:null})[_0x30bc('0xa')](function(_0x3667b6){logger[_0x30bc('0x11')](_0x30bc('0x24'),_0x4ee5d1);logger[_0x30bc('0x1e')](_0x30bc('0x24'),_0x4ee5d1,JSON['stringify'](_0x3667b6));_0x484d01(_0x3667b6);})[_0x30bc('0x1f')](function(_0x4f8c29){logger[_0x30bc('0xe')](_0x30bc('0x24'),_0x4f8c29['message'],_0x4ee5d1);_0x37eb38(_0xdf63cf[_0x30bc('0xe')](0x1f4,_0x4f8c29[_0x30bc('0x10')]));});});};exports[_0x30bc('0x27')]=function(_0x34f746){var _0x311a11=this;return new Promise(function(_0x3ca52e,_0x28b294){return db[_0x30bc('0x14')][_0x30bc('0x28')]({'where':_0x34f746['options']?_0x34f746['options'][_0x30bc('0x18')]||null:null})[_0x30bc('0xa')](function(_0x39231c){logger[_0x30bc('0x11')](_0x30bc('0x27'),_0x34f746);logger[_0x30bc('0x1e')](_0x30bc('0x27'),_0x34f746,JSON[_0x30bc('0xd')](_0x39231c));_0x3ca52e(_0x39231c);})[_0x30bc('0x1f')](function(_0xd18a10){logger[_0x30bc('0xe')](_0x30bc('0x27'),_0xd18a10[_0x30bc('0x10')],_0x34f746);_0x28b294(_0x311a11['error'](0x1f4,_0xd18a10[_0x30bc('0x10')]));});});};exports[_0x30bc('0x29')]=function(_0x39c538){var _0x7a5545=this;return new Promise(function(_0x227c9f,_0x418f6d){return db[_0x30bc('0x2a')][_0x30bc('0x2b')]()['then'](function(_0x47b933){return db[_0x30bc('0x2c')]['transaction'](function(_0x2cd812){return db['CmHopper']['findAll']({'where':_0x39c538[_0x30bc('0x17')]?_0x39c538[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'attributes':_0x39c538['options']?_0x39c538[_0x30bc('0x17')][_0x30bc('0x1c')]||null:null,'limit':_0x39c538[_0x30bc('0x17')]?_0x39c538[_0x30bc('0x17')][_0x30bc('0x19')]||null:null,'order':_0x39c538[_0x30bc('0x17')]?_0x39c538['options'][_0x30bc('0x2d')]||null:null,'transaction':_0x2cd812,'lock':_0x2cd812[_0x30bc('0x2e')][_0x30bc('0x2f')],'include':[{'model':db[_0x30bc('0x2a')],'as':_0x30bc('0x30'),'attributes':_[_0x30bc('0x31')](_0x47b933)},{'model':db[_0x30bc('0x32')],'as':_0x30bc('0x33'),'attributes':['id',_0x30bc('0x34'),_0x30bc('0x35')]}]})[_0x30bc('0xa')](function(_0x2a12b7){var _0x386056=[];var _0x34ed0e=[];for(var _0x5c3812=0x0;_0x5c3812<_0x2a12b7[_0x30bc('0x36')];_0x5c3812+=0x1){var _0xc66aa3=_0x2a12b7[_0x5c3812][_0x30bc('0x37')];if(_0xc66aa3===null){_0x386056['push'](_0x2a12b7[_0x5c3812][_0x30bc('0x25')](_0x39c538[_0x30bc('0x26')],{'transaction':_0x2cd812}));}else if(!_0x34ed0e[_0x30bc('0x38')](_0xc66aa3)){_0x34ed0e['push'](_0xc66aa3);_0x386056[_0x30bc('0x39')](_0x2a12b7[_0x5c3812]['update'](_0x39c538['body'],{'transaction':_0x2cd812}));}}return BPromise['all'](_0x386056);});})[_0x30bc('0xa')](function(_0x26969e){logger['info'](_0x30bc('0x29'),_0x39c538);logger[_0x30bc('0x1e')](_0x30bc('0x29'),_0x39c538,JSON[_0x30bc('0xd')](_0x26969e));_0x227c9f(_0x26969e);})[_0x30bc('0x1f')](function(_0x4ba343){logger['error']('GetContactDialer',_0x4ba343[_0x30bc('0x10')],_0x39c538);_0x418f6d(_0x7a5545[_0x30bc('0xe')](0x1f4,_0x4ba343['message']));});});});};exports[_0x30bc('0x3a')]=function(_0x770736){var _0x4ed422=this;return new Promise(function(_0x1a75fd,_0x54da0b){return db['sequelize'][_0x30bc('0x3b')](function(_0x1a7d1c){return db[_0x30bc('0x3c')][_0x30bc('0x23')](_0x770736[_0x30bc('0x26')],{'raw':_0x770736[_0x30bc('0x17')]?_0x770736[_0x30bc('0x17')][_0x30bc('0x16')]===undefined?!![]:![]:!![],'transaction':_0x1a7d1c})['then'](function(){return db[_0x30bc('0x14')][_0x30bc('0x28')]({'where':_0x770736[_0x30bc('0x17')]?_0x770736[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'transaction':_0x1a7d1c});});})[_0x30bc('0xa')](function(_0xe66d00){logger['info'](_0x30bc('0x3a'),_0x770736);logger[_0x30bc('0x1e')]('MoveContactManagedDialer',_0x770736,JSON[_0x30bc('0xd')](_0xe66d00));_0x1a75fd(_0xe66d00);})[_0x30bc('0x1f')](function(_0x2d599a){logger[_0x30bc('0xe')](_0x30bc('0x3a'),_0x2d599a['message'],_0x770736);_0x54da0b(_0x4ed422[_0x30bc('0xe')](0x1f4,_0x2d599a[_0x30bc('0x10')]));});});};exports[_0x30bc('0x3d')]=function(_0x2e6d92){var _0x38ec79=this;return new Promise(function(_0x5a7971,_0x313e1b){return db['CmHopper']['findAll']({'raw':_0x2e6d92['options']?_0x2e6d92[_0x30bc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e6d92[_0x30bc('0x17')]?_0x2e6d92['options'][_0x30bc('0x18')]||null:null,'attributes':[[db[_0x30bc('0x2c')]['fn'](_0x30bc('0x3e'),db[_0x30bc('0x2c')]['fn']('IF',db[_0x30bc('0x2c')][_0x30bc('0x3f')](_0x30bc('0x40')+util[_0x30bc('0x41')](_0x30bc('0x42'),moment()[_0x30bc('0x41')](_0x30bc('0x43')))+_0x30bc('0x44')))),'contactsRescheduled']]})[_0x30bc('0xa')](function(_0xe71606){logger['info'](_0x30bc('0x3d'),_0x2e6d92);logger['debug'](_0x30bc('0x3d'),_0x2e6d92,JSON[_0x30bc('0xd')](_0xe71606));_0x5a7971(_0xe71606);})['catch'](function(_0x2efc38){logger[_0x30bc('0xe')](_0x30bc('0x3d'),_0x2efc38[_0x30bc('0x10')],_0x2e6d92);_0x313e1b(_0x38ec79[_0x30bc('0xe')](0x1f4,_0x2efc38[_0x30bc('0x10')]));});});};exports[_0x30bc('0x45')]=function(_0x145cee){var _0x33843b=this;return new Promise(function(_0x5d907d,_0x163442){return db[_0x30bc('0x2a')]['describe']()[_0x30bc('0xa')](function(_0x3e0600){return db[_0x30bc('0x2c')][_0x30bc('0x3b')](function(_0xc69c11){return db['CmHopper'][_0x30bc('0x15')]({'where':_0x145cee[_0x30bc('0x17')]?_0x145cee[_0x30bc('0x17')]['where']||null:null,'attributes':_0x145cee[_0x30bc('0x17')]?_0x145cee[_0x30bc('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x145cee[_0x30bc('0x17')]?_0x145cee['options'][_0x30bc('0x2d')]||null:null,'group':db[_0x30bc('0x14')][_0x30bc('0x37')],'transaction':_0xc69c11,'lock':_0xc69c11[_0x30bc('0x2e')][_0x30bc('0x2f')],'include':_0x145cee[_0x30bc('0x17')]?_0x145cee[_0x30bc('0x17')][_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x145cee[_0x30bc('0x17')]['include'],function(_0x2b5ca6){return{'model':db[_0x2b5ca6[_0x30bc('0x1d')]],'as':_0x2b5ca6['as'],'attributes':_0x2b5ca6[_0x30bc('0x1c')],'include':_0x2b5ca6[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x2b5ca6['include'],function(_0x74bec6){return{'model':db[_0x74bec6['model']],'as':_0x74bec6['as'],'attributes':_0x74bec6['attributes'],'include':_0x74bec6[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x74bec6[_0x30bc('0x1a')],function(_0x5b81cf){return{'model':db[_0x5b81cf[_0x30bc('0x1d')]],'as':_0x5b81cf['as'],'attributes':_0x5b81cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x30bc('0xa')](function(_0x48066a){var _0x23f6f4=[];for(var _0x426304=0x0;_0x426304<_0x48066a[_0x30bc('0x36')];_0x426304+=0x1){_0x23f6f4[_0x30bc('0x39')](_0x48066a[_0x426304][_0x30bc('0x25')](_0x145cee[_0x30bc('0x26')],{'transaction':_0xc69c11}));}return BPromise[_0x30bc('0x46')](_0x23f6f4);});})[_0x30bc('0xa')](function(_0x48fc63){logger[_0x30bc('0x11')](_0x30bc('0x45'),_0x145cee);logger[_0x30bc('0x1e')]('GetContactRecallMe',_0x145cee,JSON[_0x30bc('0xd')](_0x48fc63));_0x5d907d(_0x48fc63);})[_0x30bc('0x1f')](function(_0x2e5bd8){logger['error']('GetContactRecallMe',_0x2e5bd8[_0x30bc('0x10')],_0x145cee);_0x163442(_0x33843b[_0x30bc('0xe')](0x1f4,_0x2e5bd8[_0x30bc('0x10')]));});});});};exports[_0x30bc('0x47')]=function(_0x5cf261){var _0x495033=this;return new Promise(function(_0x3d5311,_0x51950b){db[_0x30bc('0x2a')][_0x30bc('0x2b')]()[_0x30bc('0xa')](function(_0x1869b9){return db[_0x30bc('0x14')][_0x30bc('0x15')]({'raw':_0x5cf261[_0x30bc('0x17')]?_0x5cf261[_0x30bc('0x17')][_0x30bc('0x16')]===undefined?!![]:![]:!![],'where':_0x5cf261[_0x30bc('0x17')]?_0x5cf261[_0x30bc('0x17')][_0x30bc('0x18')]||null:null,'attributes':_0x5cf261[_0x30bc('0x17')]?_0x5cf261['options'][_0x30bc('0x1c')]||null:null,'limit':_0x5cf261['options']?_0x5cf261['options'][_0x30bc('0x19')]||null:null,'include':_0x5cf261['options']?_0x5cf261[_0x30bc('0x17')][_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x5cf261[_0x30bc('0x17')][_0x30bc('0x1a')],function(_0x549d78){return{'model':db[_0x549d78['model']],'as':_0x549d78['as'],'attributes':_0x549d78['as']===_0x30bc('0x30')?_[_0x30bc('0x31')](_0x1869b9):_0x549d78['attributes'],'include':_0x549d78[_0x30bc('0x1a')]?_[_0x30bc('0x1b')](_0x549d78[_0x30bc('0x1a')],function(_0x245433){return{'model':db[_0x245433[_0x30bc('0x1d')]],'as':_0x245433['as'],'attributes':_0x245433[_0x30bc('0x1c')],'include':_0x245433[_0x30bc('0x1a')]?_['map'](_0x245433[_0x30bc('0x1a')],function(_0x46bcc0){return{'model':db[_0x46bcc0[_0x30bc('0x1d')]],'as':_0x46bcc0['as'],'attributes':_0x46bcc0['attributes']};}):[]};}):[]};}):[]:[]})[_0x30bc('0xa')](function(_0xa28a10){logger[_0x30bc('0x11')](_0x30bc('0x13'),_0x5cf261);logger[_0x30bc('0x1e')](_0x30bc('0x13'),_0x5cf261,JSON[_0x30bc('0xd')](_0xa28a10));_0x3d5311(_0xa28a10);})[_0x30bc('0x1f')](function(_0x510731){logger[_0x30bc('0xe')](_0x30bc('0x13'),_0x510731[_0x30bc('0x10')],_0x5cf261);_0x51950b(_0x495033[_0x30bc('0xe')](0x1f4,_0x510731[_0x30bc('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index fbe722e..8d731c4 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 _0x315f=['/preview','getPreview','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','post','create'];(function(_0x276566,_0x35b92d){var _0x2c695f=function(_0x765876){while(--_0x765876){_0x276566['push'](_0x276566['shift']());}};_0x2c695f(++_0x35b92d);}(_0x315f,0x1f4));var _0xf315=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x315f[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xf315('0x0'));var util=require(_0xf315('0x1'));var path=require(_0xf315('0x2'));var timeout=require(_0xf315('0x3'));var express=require('express');var router=express[_0xf315('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf315('0x5'));var interaction=require(_0xf315('0x6'));var config=require(_0xf315('0x7'));var controller=require(_0xf315('0x8'));router[_0xf315('0x9')]('/',auth['isAuthenticated'](),controller[_0xf315('0xa')]);router['get'](_0xf315('0xb'),auth[_0xf315('0xc')](),controller[_0xf315('0xd')]);router[_0xf315('0x9')](_0xf315('0xe'),auth[_0xf315('0xc')](),controller[_0xf315('0xf')]);router[_0xf315('0x9')](_0xf315('0x10'),auth[_0xf315('0xc')](),controller[_0xf315('0x11')]);router[_0xf315('0x12')]('/',auth[_0xf315('0xc')](),controller[_0xf315('0x13')]);router[_0xf315('0x12')](_0xf315('0x14'),auth[_0xf315('0xc')](),controller[_0xf315('0x15')]);router[_0xf315('0x16')](_0xf315('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xf315('0x17')](_0xf315('0x10'),auth[_0xf315('0xc')](),controller[_0xf315('0x18')]);module[_0xf315('0x19')]=router; \ No newline at end of file +var _0x5c27=['delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','show','create','post','/preview','getPreview','/:id'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x5c27,0x116));var _0x75c2=function(_0x1f782d,_0x5906b8){_0x1f782d=_0x1f782d-0x0;var _0x228cce=_0x5c27[_0x1f782d];return _0x228cce;};'use strict';var multer=require(_0x75c2('0x0'));var util=require('util');var path=require(_0x75c2('0x1'));var timeout=require(_0x75c2('0x2'));var express=require(_0x75c2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75c2('0x4'));var interaction=require(_0x75c2('0x5'));var config=require(_0x75c2('0x6'));var controller=require(_0x75c2('0x7'));router[_0x75c2('0x8')]('/',auth[_0x75c2('0x9')](),controller[_0x75c2('0xa')]);router['get'](_0x75c2('0xb'),auth['isAuthenticated'](),controller[_0x75c2('0xc')]);router[_0x75c2('0x8')](_0x75c2('0xd'),auth[_0x75c2('0x9')](),controller[_0x75c2('0xe')]);router[_0x75c2('0x8')]('/:id',auth[_0x75c2('0x9')](),controller[_0x75c2('0xf')]);router['post']('/',auth[_0x75c2('0x9')](),controller[_0x75c2('0x10')]);router[_0x75c2('0x11')](_0x75c2('0x12'),auth[_0x75c2('0x9')](),controller[_0x75c2('0x13')]);router['put'](_0x75c2('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x75c2('0x15')](_0x75c2('0x14'),auth[_0x75c2('0x9')](),controller['destroy']);module[_0x75c2('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c6a10bf..b9476dc 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 _0xc27a=['INTEGER','contactListQueue','exports'];(function(_0x2afa12,_0x1e7f0c){var _0x301425=function(_0x8f7450){while(--_0x8f7450){_0x2afa12['push'](_0x2afa12['shift']());}};_0x301425(++_0x1e7f0c);}(_0xc27a,0x1b2));var _0xac27=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0xc27a[_0x2bcddb];return _0x12a9e8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xac27('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xac27('0x1')],'unique':_0xac27('0x2')},'ListId':{'type':Sequelize[_0xac27('0x1')],'unique':_0xac27('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xac27('0x2')}}; \ No newline at end of file +var _0x6340=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x1c64d0,_0x3efbcb){var _0x21c031=function(_0x15ed08){while(--_0x15ed08){_0x1c64d0['push'](_0x1c64d0['shift']());}};_0x21c031(++_0x3efbcb);}(_0x6340,0x71));var _0x0634=function(_0x5b266e,_0x22487a){_0x5b266e=_0x5b266e-0x0;var _0x1c1f1d=_0x6340[_0x5b266e];return _0x1c1f1d;};'use strict';var moment=require(_0x0634('0x0'));var Sequelize=require(_0x0634('0x1'));module[_0x0634('0x2')]={'phone':{'type':Sequelize[_0x0634('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x0634('0x4')},'ListId':{'type':Sequelize[_0x0634('0x5')],'unique':_0x0634('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0634('0x5')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d9f55a2..5151c15 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 _0xae41=['stack','name','send','index','map','CmHopperBlack','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','error'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0xae41,0xaf));var _0x1ae4=function(_0x23cfe5,_0x12d5e1){_0x23cfe5=_0x23cfe5-0x0;var _0x17e777=_0xae41[_0x23cfe5];return _0x17e777;};'use strict';var emlformat=require(_0x1ae4('0x0'));var rimraf=require(_0x1ae4('0x1'));var zipdir=require(_0x1ae4('0x2'));var jsonpatch=require(_0x1ae4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1ae4('0x4'));var util=require('util');var path=require(_0x1ae4('0x5'));var sox=require(_0x1ae4('0x6'));var csv=require('to-csv');var ejs=require(_0x1ae4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ae4('0x8'));var squel=require(_0x1ae4('0x9'));var crypto=require(_0x1ae4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ae4('0xb'));var toCsv=require(_0x1ae4('0xc'));var querystring=require(_0x1ae4('0xd'));var Papa=require(_0x1ae4('0xe'));var Redis=require(_0x1ae4('0xf'));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(_0x1ae4('0x10'))('api');var utils=require(_0x1ae4('0x11'));var config=require(_0x1ae4('0x12'));var licenseUtil=require(_0x1ae4('0x13'));var db=require(_0x1ae4('0x14'))['db'];function respondWithStatusCode(_0x52382b,_0x7d375c){_0x7d375c=_0x7d375c||0xcc;return function(_0x365b77){if(_0x365b77){return _0x52382b[_0x1ae4('0x15')](_0x7d375c);}return _0x52382b[_0x1ae4('0x16')](_0x7d375c)[_0x1ae4('0x17')]();};}function respondWithResult(_0x358b1a,_0x52a29d){_0x52a29d=_0x52a29d||0xc8;return function(_0x4ce84e){if(_0x4ce84e){return _0x358b1a[_0x1ae4('0x16')](_0x52a29d)[_0x1ae4('0x18')](_0x4ce84e);}};}function respondWithFilteredResult(_0x656f08,_0x44a9da){return function(_0x3990c0){if(_0x3990c0){var _0x3507ca=typeof _0x44a9da[_0x1ae4('0x19')]==='undefined'&&typeof _0x44a9da[_0x1ae4('0x1a')]==='undefined';var _0x1bf542=_0x3990c0[_0x1ae4('0x1b')];var _0x2a1335=_0x3507ca?0x0:_0x44a9da[_0x1ae4('0x19')];var _0x581a55=_0x3507ca?_0x3990c0['count']:_0x44a9da[_0x1ae4('0x19')]+_0x44a9da['limit'];var _0x128681;if(_0x581a55>=_0x1bf542){_0x581a55=_0x1bf542;_0x128681=0xc8;}else{_0x128681=0xce;}_0x656f08[_0x1ae4('0x16')](_0x128681);return _0x656f08['set']('Content-Range',_0x2a1335+'-'+_0x581a55+'/'+_0x1bf542)[_0x1ae4('0x18')](_0x3990c0);}return null;};}function patchUpdates(_0x15948d){return function(_0x42e45b){try{jsonpatch[_0x1ae4('0x1c')](_0x42e45b,_0x15948d,!![]);}catch(_0x43d3ad){return BPromise[_0x1ae4('0x1d')](_0x43d3ad);}return _0x42e45b[_0x1ae4('0x1e')]();};}function saveUpdates(_0x56a966,_0x104503){return function(_0x3aeca6){if(_0x3aeca6){return _0x3aeca6[_0x1ae4('0x1f')](_0x56a966)[_0x1ae4('0x20')](function(_0x5cfcb8){return _0x5cfcb8;});}return null;};}function removeEntity(_0x17e6de,_0x2fc731){return function(_0x119a54){if(_0x119a54){return _0x119a54[_0x1ae4('0x21')]()[_0x1ae4('0x20')](function(){_0x17e6de[_0x1ae4('0x16')](0xcc)[_0x1ae4('0x17')]();});}};}function handleEntityNotFound(_0x3f7eb4,_0x25b134){return function(_0x5e192b){if(!_0x5e192b){_0x3f7eb4[_0x1ae4('0x15')](0x194);}return _0x5e192b;};}function handleError(_0x2932ec,_0x30fdd3){_0x30fdd3=_0x30fdd3||0x1f4;return function(_0x39669e){logger[_0x1ae4('0x22')](_0x39669e[_0x1ae4('0x23')]);if(_0x39669e[_0x1ae4('0x24')]){delete _0x39669e['name'];}_0x2932ec[_0x1ae4('0x16')](_0x30fdd3)[_0x1ae4('0x25')](_0x39669e);};}exports[_0x1ae4('0x26')]=function(_0x4d65a7,_0x1bac7d){var _0x3b2e9d={},_0x1e448={},_0x1d22bd={'count':0x0,'rows':[]};var _0x4c7851=_[_0x1ae4('0x27')](db[_0x1ae4('0x28')]['rawAttributes'],function(_0x1b7cac){return{'name':_0x1b7cac['fieldName'],'type':_0x1b7cac[_0x1ae4('0x29')]['key']};});_0x1e448[_0x1ae4('0x2a')]=_[_0x1ae4('0x27')](_0x4c7851,_0x1ae4('0x24'));_0x1e448[_0x1ae4('0x2b')]=_[_0x1ae4('0x2c')](_0x4d65a7[_0x1ae4('0x2b')]);_0x1e448[_0x1ae4('0x2d')]=_[_0x1ae4('0x2e')](_0x1e448[_0x1ae4('0x2a')],_0x1e448[_0x1ae4('0x2b')]);_0x3b2e9d[_0x1ae4('0x2f')]=_[_0x1ae4('0x2e')](_0x1e448[_0x1ae4('0x2a')],qs['fields'](_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x30')]));_0x3b2e9d[_0x1ae4('0x2f')]=_0x3b2e9d[_0x1ae4('0x2f')][_0x1ae4('0x31')]?_0x3b2e9d['attributes']:_0x1e448[_0x1ae4('0x2a')];if(!_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x32')]('nolimit')){_0x3b2e9d[_0x1ae4('0x1a')]=qs[_0x1ae4('0x1a')](_0x4d65a7[_0x1ae4('0x2b')]['limit']);_0x3b2e9d[_0x1ae4('0x19')]=qs[_0x1ae4('0x19')](_0x4d65a7['query'][_0x1ae4('0x19')]);}_0x3b2e9d[_0x1ae4('0x33')]=qs[_0x1ae4('0x34')](_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x34')]);_0x3b2e9d['where']=qs[_0x1ae4('0x2d')](_[_0x1ae4('0x35')](_0x4d65a7['query'],_0x1e448['filters']),_0x4c7851);if(_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x36')]){_0x3b2e9d[_0x1ae4('0x37')]=_[_0x1ae4('0x38')](_0x3b2e9d[_0x1ae4('0x37')],{'$or':_['map'](_0x4c7851,function(_0x2237f2){if(_0x2237f2[_0x1ae4('0x29')]!==_0x1ae4('0x39')){var _0x539623={};_0x539623[_0x2237f2[_0x1ae4('0x24')]]={'$like':'%'+_0x4d65a7['query']['filter']+'%'};return _0x539623;}})});}_0x3b2e9d=_[_0x1ae4('0x38')]({},_0x3b2e9d,_0x4d65a7[_0x1ae4('0x3a')]);var _0x573ce1={'where':_0x3b2e9d[_0x1ae4('0x37')]};return db[_0x1ae4('0x28')]['count'](_0x573ce1)[_0x1ae4('0x20')](function(_0x448b60){_0x1d22bd['count']=_0x448b60;if(_0x4d65a7[_0x1ae4('0x2b')][_0x1ae4('0x3b')]){_0x3b2e9d[_0x1ae4('0x3c')]=[{'all':!![]}];}return db[_0x1ae4('0x28')][_0x1ae4('0x3d')](_0x3b2e9d);})[_0x1ae4('0x20')](function(_0x42d614){_0x1d22bd[_0x1ae4('0x3e')]=_0x42d614;return _0x1d22bd;})[_0x1ae4('0x20')](respondWithFilteredResult(_0x1bac7d,_0x3b2e9d))['catch'](handleError(_0x1bac7d,null));};exports[_0x1ae4('0x3f')]=function(_0x13dffa,_0x283f31){var _0x3ccfc0={'raw':!![],'where':{'id':_0x13dffa[_0x1ae4('0x40')]['id']}},_0x3e9b27={};_0x3e9b27[_0x1ae4('0x2a')]=_[_0x1ae4('0x2c')](db[_0x1ae4('0x28')][_0x1ae4('0x41')]);_0x3e9b27['query']=_[_0x1ae4('0x2c')](_0x13dffa[_0x1ae4('0x2b')]);_0x3e9b27[_0x1ae4('0x2d')]=_[_0x1ae4('0x2e')](_0x3e9b27['model'],_0x3e9b27[_0x1ae4('0x2b')]);_0x3ccfc0[_0x1ae4('0x2f')]=_[_0x1ae4('0x2e')](_0x3e9b27['model'],qs['fields'](_0x13dffa['query']['fields']));_0x3ccfc0['attributes']=_0x3ccfc0[_0x1ae4('0x2f')][_0x1ae4('0x31')]?_0x3ccfc0['attributes']:_0x3e9b27[_0x1ae4('0x2a')];if(_0x13dffa[_0x1ae4('0x2b')]['includeAll']){_0x3ccfc0[_0x1ae4('0x3c')]=[{'all':!![]}];}_0x3ccfc0=_[_0x1ae4('0x38')]({},_0x3ccfc0,_0x13dffa[_0x1ae4('0x3a')]);return db[_0x1ae4('0x28')][_0x1ae4('0x42')](_0x3ccfc0)[_0x1ae4('0x20')](handleEntityNotFound(_0x283f31,null))[_0x1ae4('0x20')](respondWithResult(_0x283f31,null))[_0x1ae4('0x43')](handleError(_0x283f31,null));};exports[_0x1ae4('0x1f')]=function(_0x5399ae,_0x25044d){if(_0x5399ae[_0x1ae4('0x44')]['id']){delete _0x5399ae[_0x1ae4('0x44')]['id'];}return db[_0x1ae4('0x28')][_0x1ae4('0x42')]({'where':{'id':_0x5399ae['params']['id']}})[_0x1ae4('0x20')](handleEntityNotFound(_0x25044d,null))[_0x1ae4('0x20')](saveUpdates(_0x5399ae['body'],null))[_0x1ae4('0x20')](respondWithResult(_0x25044d,null))[_0x1ae4('0x43')](handleError(_0x25044d,null));};exports[_0x1ae4('0x21')]=function(_0x1fa2b6,_0x20ef25){return db['CmHopperBlack'][_0x1ae4('0x42')]({'where':{'id':_0x1fa2b6['params']['id']}})[_0x1ae4('0x20')](handleEntityNotFound(_0x20ef25,null))[_0x1ae4('0x20')](removeEntity(_0x20ef25,null))['catch'](handleError(_0x20ef25,null));};exports[_0x1ae4('0x45')]=function(_0x15a38d,_0x1e069a){return db['CmHopperBlack'][_0x1ae4('0x45')]()[_0x1ae4('0x20')](respondWithResult(_0x1e069a,null))[_0x1ae4('0x43')](handleError(_0x1e069a,null));}; \ No newline at end of file +var _0x289e=['merge','where','VIRTUAL','filter','options','include','show','length','includeAll','find','catch','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x51e2f5,_0x200408){var _0x456dc3=function(_0x320928){while(--_0x320928){_0x51e2f5['push'](_0x51e2f5['shift']());}};_0x456dc3(++_0x200408);}(_0x289e,0xea));var _0xe289=function(_0x1fa04f,_0x5a792f){_0x1fa04f=_0x1fa04f-0x0;var _0x2bd31c=_0x289e[_0x1fa04f];return _0x2bd31c;};'use strict';var emlformat=require(_0xe289('0x0'));var rimraf=require(_0xe289('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe289('0x2'));var rp=require(_0xe289('0x3'));var moment=require('moment');var BPromise=require(_0xe289('0x4'));var Mustache=require(_0xe289('0x5'));var util=require('util');var path=require(_0xe289('0x6'));var sox=require(_0xe289('0x7'));var csv=require(_0xe289('0x8'));var ejs=require(_0xe289('0x9'));var fs=require('fs');var fs_extra=require(_0xe289('0xa'));var _=require(_0xe289('0xb'));var squel=require(_0xe289('0xc'));var crypto=require(_0xe289('0xd'));var jsforce=require(_0xe289('0xe'));var deskjs=require(_0xe289('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe289('0x10'));var Papa=require(_0xe289('0x11'));var Redis=require(_0xe289('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe289('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe289('0x14'));var logger=require(_0xe289('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe289('0x16'));var db=require(_0xe289('0x17'))['db'];function respondWithStatusCode(_0x18a6c0,_0x236b5){_0x236b5=_0x236b5||0xcc;return function(_0x52170c){if(_0x52170c){return _0x18a6c0[_0xe289('0x18')](_0x236b5);}return _0x18a6c0[_0xe289('0x19')](_0x236b5)[_0xe289('0x1a')]();};}function respondWithResult(_0x3d624c,_0x4947ae){_0x4947ae=_0x4947ae||0xc8;return function(_0x162600){if(_0x162600){return _0x3d624c['status'](_0x4947ae)[_0xe289('0x1b')](_0x162600);}};}function respondWithFilteredResult(_0x5d214a,_0x3e283c){return function(_0x4b61b8){if(_0x4b61b8){var _0x253fd6=typeof _0x3e283c[_0xe289('0x1c')]===_0xe289('0x1d')&&typeof _0x3e283c[_0xe289('0x1e')]===_0xe289('0x1d');var _0x41f5c8=_0x4b61b8[_0xe289('0x1f')];var _0x498e7a=_0x253fd6?0x0:_0x3e283c[_0xe289('0x1c')];var _0x4011f2=_0x253fd6?_0x4b61b8[_0xe289('0x1f')]:_0x3e283c[_0xe289('0x1c')]+_0x3e283c[_0xe289('0x1e')];var _0xdd2497;if(_0x4011f2>=_0x41f5c8){_0x4011f2=_0x41f5c8;_0xdd2497=0xc8;}else{_0xdd2497=0xce;}_0x5d214a[_0xe289('0x19')](_0xdd2497);return _0x5d214a[_0xe289('0x20')](_0xe289('0x21'),_0x498e7a+'-'+_0x4011f2+'/'+_0x41f5c8)[_0xe289('0x1b')](_0x4b61b8);}return null;};}function patchUpdates(_0x39baf3){return function(_0x5975e9){try{jsonpatch[_0xe289('0x22')](_0x5975e9,_0x39baf3,!![]);}catch(_0x5162d6){return BPromise['reject'](_0x5162d6);}return _0x5975e9[_0xe289('0x23')]();};}function saveUpdates(_0x379da2,_0x3a2602){return function(_0x976d5c){if(_0x976d5c){return _0x976d5c[_0xe289('0x24')](_0x379da2)[_0xe289('0x25')](function(_0x40b4fd){return _0x40b4fd;});}return null;};}function removeEntity(_0x40bc26,_0x21e2c8){return function(_0x420e32){if(_0x420e32){return _0x420e32['destroy']()[_0xe289('0x25')](function(){_0x40bc26[_0xe289('0x19')](0xcc)[_0xe289('0x1a')]();});}};}function handleEntityNotFound(_0x3cc28f,_0x3b75d5){return function(_0xa8bf79){if(!_0xa8bf79){_0x3cc28f[_0xe289('0x18')](0x194);}return _0xa8bf79;};}function handleError(_0x47c755,_0x5e4ea1){_0x5e4ea1=_0x5e4ea1||0x1f4;return function(_0x826daf){logger[_0xe289('0x26')](_0x826daf[_0xe289('0x27')]);if(_0x826daf['name']){delete _0x826daf[_0xe289('0x28')];}_0x47c755[_0xe289('0x19')](_0x5e4ea1)[_0xe289('0x29')](_0x826daf);};}exports[_0xe289('0x2a')]=function(_0x2d0e14,_0x3f22c7){var _0x56f298={},_0xc4c7c6={},_0x21a564={'count':0x0,'rows':[]};var _0x17c1f6=_[_0xe289('0x2b')](db[_0xe289('0x2c')][_0xe289('0x2d')],function(_0x52adab){return{'name':_0x52adab['fieldName'],'type':_0x52adab[_0xe289('0x2e')][_0xe289('0x2f')]};});_0xc4c7c6[_0xe289('0x30')]=_[_0xe289('0x2b')](_0x17c1f6,_0xe289('0x28'));_0xc4c7c6[_0xe289('0x31')]=_[_0xe289('0x32')](_0x2d0e14['query']);_0xc4c7c6[_0xe289('0x33')]=_[_0xe289('0x34')](_0xc4c7c6['model'],_0xc4c7c6[_0xe289('0x31')]);_0x56f298[_0xe289('0x35')]=_[_0xe289('0x34')](_0xc4c7c6['model'],qs['fields'](_0x2d0e14[_0xe289('0x31')][_0xe289('0x36')]));_0x56f298[_0xe289('0x35')]=_0x56f298[_0xe289('0x35')]['length']?_0x56f298[_0xe289('0x35')]:_0xc4c7c6[_0xe289('0x30')];if(!_0x2d0e14[_0xe289('0x31')][_0xe289('0x37')]('nolimit')){_0x56f298[_0xe289('0x1e')]=qs[_0xe289('0x1e')](_0x2d0e14['query']['limit']);_0x56f298[_0xe289('0x1c')]=qs[_0xe289('0x1c')](_0x2d0e14[_0xe289('0x31')]['offset']);}_0x56f298[_0xe289('0x38')]=qs['sort'](_0x2d0e14[_0xe289('0x31')][_0xe289('0x39')]);_0x56f298['where']=qs[_0xe289('0x33')](_['pick'](_0x2d0e14[_0xe289('0x31')],_0xc4c7c6[_0xe289('0x33')]),_0x17c1f6);if(_0x2d0e14[_0xe289('0x31')]['filter']){_0x56f298['where']=_[_0xe289('0x3a')](_0x56f298[_0xe289('0x3b')],{'$or':_['map'](_0x17c1f6,function(_0x54d87f){if(_0x54d87f['type']!==_0xe289('0x3c')){var _0x557409={};_0x557409[_0x54d87f[_0xe289('0x28')]]={'$like':'%'+_0x2d0e14[_0xe289('0x31')][_0xe289('0x3d')]+'%'};return _0x557409;}})});}_0x56f298=_[_0xe289('0x3a')]({},_0x56f298,_0x2d0e14[_0xe289('0x3e')]);var _0x1f58cf={'where':_0x56f298[_0xe289('0x3b')]};return db[_0xe289('0x2c')]['count'](_0x1f58cf)[_0xe289('0x25')](function(_0x2e569c){_0x21a564[_0xe289('0x1f')]=_0x2e569c;if(_0x2d0e14[_0xe289('0x31')]['includeAll']){_0x56f298[_0xe289('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x56f298);})[_0xe289('0x25')](function(_0x44faee){_0x21a564['rows']=_0x44faee;return _0x21a564;})[_0xe289('0x25')](respondWithFilteredResult(_0x3f22c7,_0x56f298))['catch'](handleError(_0x3f22c7,null));};exports[_0xe289('0x40')]=function(_0x2ebf84,_0x140cd6){var _0x3f9347={'raw':!![],'where':{'id':_0x2ebf84['params']['id']}},_0x3bcccd={};_0x3bcccd['model']=_[_0xe289('0x32')](db[_0xe289('0x2c')][_0xe289('0x2d')]);_0x3bcccd['query']=_[_0xe289('0x32')](_0x2ebf84[_0xe289('0x31')]);_0x3bcccd[_0xe289('0x33')]=_[_0xe289('0x34')](_0x3bcccd[_0xe289('0x30')],_0x3bcccd[_0xe289('0x31')]);_0x3f9347['attributes']=_[_0xe289('0x34')](_0x3bcccd[_0xe289('0x30')],qs[_0xe289('0x36')](_0x2ebf84[_0xe289('0x31')]['fields']));_0x3f9347[_0xe289('0x35')]=_0x3f9347[_0xe289('0x35')][_0xe289('0x41')]?_0x3f9347[_0xe289('0x35')]:_0x3bcccd[_0xe289('0x30')];if(_0x2ebf84[_0xe289('0x31')][_0xe289('0x42')]){_0x3f9347[_0xe289('0x3f')]=[{'all':!![]}];}_0x3f9347=_[_0xe289('0x3a')]({},_0x3f9347,_0x2ebf84[_0xe289('0x3e')]);return db['CmHopperBlack'][_0xe289('0x43')](_0x3f9347)[_0xe289('0x25')](handleEntityNotFound(_0x140cd6,null))[_0xe289('0x25')](respondWithResult(_0x140cd6,null))[_0xe289('0x44')](handleError(_0x140cd6,null));};exports[_0xe289('0x24')]=function(_0x429842,_0x469636){if(_0x429842[_0xe289('0x45')]['id']){delete _0x429842[_0xe289('0x45')]['id'];}return db[_0xe289('0x2c')][_0xe289('0x43')]({'where':{'id':_0x429842[_0xe289('0x46')]['id']}})[_0xe289('0x25')](handleEntityNotFound(_0x469636,null))[_0xe289('0x25')](saveUpdates(_0x429842[_0xe289('0x45')],null))[_0xe289('0x25')](respondWithResult(_0x469636,null))[_0xe289('0x44')](handleError(_0x469636,null));};exports[_0xe289('0x47')]=function(_0x1f46da,_0x2bd3c1){return db[_0xe289('0x2c')][_0xe289('0x43')]({'where':{'id':_0x1f46da['params']['id']}})[_0xe289('0x25')](handleEntityNotFound(_0x2bd3c1,null))[_0xe289('0x25')](removeEntity(_0x2bd3c1,null))[_0xe289('0x44')](handleError(_0x2bd3c1,null));};exports['describe']=function(_0x332a69,_0x510522){return db['CmHopperBlack'][_0xe289('0x48')]()['then'](respondWithResult(_0x510522,null))[_0xe289('0x44')](handleError(_0x510522,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 0f09b2b..7485365 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 _0x8e73=['api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x8e73,0x197));var _0x38e7=function(_0x327484,_0x5b7430){_0x327484=_0x327484-0x0;var _0x1518cf=_0x8e73[_0x327484];return _0x1518cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x38e7('0x0'))(_0x38e7('0x1'));var moment=require(_0x38e7('0x2'));var BPromise=require(_0x38e7('0x3'));var rp=require(_0x38e7('0x4'));var fs=require('fs');var path=require(_0x38e7('0x5'));var rimraf=require('rimraf');var config=require(_0x38e7('0x6'));var attributes=require(_0x38e7('0x7'));module[_0x38e7('0x8')]=function(_0x5454d0,_0x29125d){return _0x5454d0[_0x38e7('0x9')](_0x38e7('0xa'),attributes,{'tableName':_0x38e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e8=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xb7e8,0x6e));var _0x8b7e=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xb7e8[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0x8b7e('0x0'));var util=require(_0x8b7e('0x1'));var logger=require(_0x8b7e('0x2'))(_0x8b7e('0x3'));var moment=require(_0x8b7e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b7e('0x5'));var fs=require('fs');var path=require(_0x8b7e('0x6'));var rimraf=require(_0x8b7e('0x7'));var config=require(_0x8b7e('0x8'));var attributes=require(_0x8b7e('0x9'));module[_0x8b7e('0xa')]=function(_0x37625f,_0x3f5dba){return _0x37625f[_0x8b7e('0xb')](_0x8b7e('0xc'),attributes,{'tableName':_0x8b7e('0xd'),'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 8cd625d..2790757 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 _0xb049=['UpdateCmHopperBlack','update','raw','then','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopperBlack','findAll','options','where','attributes','limit','include','model','GetCmHopperBlack','stringify'];(function(_0x5cd617,_0x347e8b){var _0x3829bb=function(_0x382f3a){while(--_0x382f3a){_0x5cd617['push'](_0x5cd617['shift']());}};_0x3829bb(++_0x347e8b);}(_0xb049,0xc4));var _0x9b04=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb049[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x9b04('0x0'));var util=require('util');var moment=require(_0x9b04('0x1'));var BPromise=require(_0x9b04('0x2'));var rs=require(_0x9b04('0x3'));var fs=require('fs');var Redis=require(_0x9b04('0x4'));var db=require(_0x9b04('0x5'))['db'];var utils=require(_0x9b04('0x6'));var logger=require(_0x9b04('0x7'))(_0x9b04('0x8'));var config=require(_0x9b04('0x9'));var jayson=require(_0x9b04('0xa'));var client=jayson[_0x9b04('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35819a,_0x4b5ecb,_0x5b6f92){return new BPromise(function(_0x4ebd80,_0x1be169){return client[_0x9b04('0xc')](_0x35819a,_0x5b6f92)['then'](function(_0x1615e0){logger[_0x9b04('0xd')](_0x9b04('0xe'),_0x4b5ecb,_0x9b04('0xf'));logger[_0x9b04('0x10')](_0x9b04('0x11'),_0x4b5ecb,'request\x20sent',JSON['stringify'](_0x1615e0));if(_0x1615e0[_0x9b04('0x12')]){if(_0x1615e0['error']['code']===0x1f4){logger[_0x9b04('0x12')](_0x9b04('0xe'),_0x4b5ecb,_0x1615e0[_0x9b04('0x12')]['message']);return _0x1be169(_0x1615e0[_0x9b04('0x12')][_0x9b04('0x13')]);}logger['error'](_0x9b04('0xe'),_0x4b5ecb,_0x1615e0[_0x9b04('0x12')][_0x9b04('0x13')]);return _0x4ebd80(_0x1615e0[_0x9b04('0x12')]['message']);}else{logger[_0x9b04('0xd')](_0x9b04('0xe'),_0x4b5ecb,'request\x20sent');_0x4ebd80(_0x1615e0[_0x9b04('0x14')][_0x9b04('0x13')]);}})[_0x9b04('0x15')](function(_0x53c2af){logger['error'](_0x9b04('0xe'),_0x4b5ecb,_0x53c2af);_0x1be169(_0x53c2af);});});}exports['GetCmHopperBlack']=function(_0x3cd392){var _0x4c560b=this;return new Promise(function(_0x23a15c,_0x59a755){return db[_0x9b04('0x16')][_0x9b04('0x17')]({'raw':_0x3cd392[_0x9b04('0x18')]?_0x3cd392[_0x9b04('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd392[_0x9b04('0x18')]?_0x3cd392[_0x9b04('0x18')][_0x9b04('0x19')]||null:null,'attributes':_0x3cd392['options']?_0x3cd392['options'][_0x9b04('0x1a')]||null:null,'limit':_0x3cd392[_0x9b04('0x18')]?_0x3cd392[_0x9b04('0x18')][_0x9b04('0x1b')]||null:null,'include':_0x3cd392[_0x9b04('0x18')]?_0x3cd392['options'][_0x9b04('0x1c')]?_['map'](_0x3cd392[_0x9b04('0x18')][_0x9b04('0x1c')],function(_0x528d6b){return{'model':db[_0x528d6b[_0x9b04('0x1d')]],'as':_0x528d6b['as'],'attributes':_0x528d6b[_0x9b04('0x1a')],'include':_0x528d6b[_0x9b04('0x1c')]?_['map'](_0x528d6b[_0x9b04('0x1c')],function(_0x30fc1f){return{'model':db[_0x30fc1f[_0x9b04('0x1d')]],'as':_0x30fc1f['as'],'attributes':_0x30fc1f[_0x9b04('0x1a')],'include':_0x30fc1f['include']?_['map'](_0x30fc1f[_0x9b04('0x1c')],function(_0x3db6ca){return{'model':db[_0x3db6ca[_0x9b04('0x1d')]],'as':_0x3db6ca['as'],'attributes':_0x3db6ca[_0x9b04('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5567c9){logger[_0x9b04('0xd')]('GetCmHopperBlack',_0x3cd392);logger[_0x9b04('0x10')](_0x9b04('0x1e'),_0x3cd392,JSON[_0x9b04('0x1f')](_0x5567c9));_0x23a15c(_0x5567c9);})['catch'](function(_0x15abc7){logger['error']('GetCmHopperBlack',_0x15abc7[_0x9b04('0x13')],_0x3cd392);_0x59a755(_0x4c560b[_0x9b04('0x12')](0x1f4,_0x15abc7[_0x9b04('0x13')]));});});};exports[_0x9b04('0x20')]=function(_0x5bab86){var _0x673a9f=this;return new Promise(function(_0x6ae96,_0x3a4224){return db[_0x9b04('0x16')][_0x9b04('0x21')](_0x5bab86['body'],{'raw':_0x5bab86[_0x9b04('0x18')]?_0x5bab86[_0x9b04('0x18')][_0x9b04('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bab86[_0x9b04('0x18')]?_0x5bab86[_0x9b04('0x18')][_0x9b04('0x19')]||null:null,'attributes':_0x5bab86[_0x9b04('0x18')]?_0x5bab86[_0x9b04('0x18')][_0x9b04('0x1a')]||null:null,'limit':_0x5bab86['options']?_0x5bab86['options'][_0x9b04('0x1b')]||null:null})[_0x9b04('0x23')](function(_0x354b00){logger[_0x9b04('0xd')](_0x9b04('0x20'),_0x5bab86);logger[_0x9b04('0x10')]('UpdateCmHopperBlack',_0x5bab86,JSON[_0x9b04('0x1f')](_0x354b00));_0x6ae96(_0x354b00);})[_0x9b04('0x15')](function(_0x5317a5){logger[_0x9b04('0x12')](_0x9b04('0x20'),_0x5317a5[_0x9b04('0x13')],_0x5bab86);_0x3a4224(_0x673a9f[_0x9b04('0x12')](0x1f4,_0x5317a5[_0x9b04('0x13')]));});});};exports[_0x9b04('0x24')]=function(_0x254d5d){var _0x20bef5=this;return new Promise(function(_0x37ecf4,_0x4bd007){return db[_0x9b04('0x16')][_0x9b04('0x25')]({'where':_0x254d5d[_0x9b04('0x18')]?_0x254d5d['options'][_0x9b04('0x19')]||null:null})[_0x9b04('0x23')](function(_0x23c04c){logger[_0x9b04('0xd')](_0x9b04('0x24'),_0x254d5d);logger[_0x9b04('0x10')]('DestroyCmHopperBlack',_0x254d5d,JSON[_0x9b04('0x1f')](_0x23c04c));_0x37ecf4(_0x23c04c);})['catch'](function(_0x2fc359){logger[_0x9b04('0x12')](_0x9b04('0x24'),_0x2fc359[_0x9b04('0x13')],_0x254d5d);_0x4bd007(_0x20bef5['error'](0x1f4,_0x2fc359[_0x9b04('0x13')]));});});}; \ No newline at end of file +var _0x26ec=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','map','include','model','stringify','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','util','randomstring'];(function(_0x4aee99,_0x3f8a53){var _0x5e4080=function(_0x47c58f){while(--_0x47c58f){_0x4aee99['push'](_0x4aee99['shift']());}};_0x5e4080(++_0x3f8a53);}(_0x26ec,0x19f));var _0xc26e=function(_0x2b9e85,_0x57b1c8){_0x2b9e85=_0x2b9e85-0x0;var _0xa219b7=_0x26ec[_0x2b9e85];return _0xa219b7;};'use strict';var _=require(_0xc26e('0x0'));var util=require(_0xc26e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc26e('0x2'));var fs=require('fs');var Redis=require(_0xc26e('0x3'));var db=require(_0xc26e('0x4'))['db'];var utils=require(_0xc26e('0x5'));var logger=require(_0xc26e('0x6'))('rpc');var config=require(_0xc26e('0x7'));var jayson=require(_0xc26e('0x8'));var client=jayson[_0xc26e('0x9')][_0xc26e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d8bd,_0x2d1d45,_0x2960f0){return new BPromise(function(_0x2a14df,_0x3301c6){return client[_0xc26e('0xb')](_0x41d8bd,_0x2960f0)[_0xc26e('0xc')](function(_0x2e0685){logger[_0xc26e('0xd')](_0xc26e('0xe'),_0x2d1d45,_0xc26e('0xf'));logger[_0xc26e('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2d1d45,'request\x20sent',JSON['stringify'](_0x2e0685));if(_0x2e0685['error']){if(_0x2e0685[_0xc26e('0x11')][_0xc26e('0x12')]===0x1f4){logger[_0xc26e('0x11')](_0xc26e('0xe'),_0x2d1d45,_0x2e0685[_0xc26e('0x11')][_0xc26e('0x13')]);return _0x3301c6(_0x2e0685[_0xc26e('0x11')][_0xc26e('0x13')]);}logger[_0xc26e('0x11')](_0xc26e('0xe'),_0x2d1d45,_0x2e0685[_0xc26e('0x11')]['message']);return _0x2a14df(_0x2e0685[_0xc26e('0x11')][_0xc26e('0x13')]);}else{logger['info'](_0xc26e('0xe'),_0x2d1d45,_0xc26e('0xf'));_0x2a14df(_0x2e0685[_0xc26e('0x14')][_0xc26e('0x13')]);}})[_0xc26e('0x15')](function(_0x471065){logger['error'](_0xc26e('0xe'),_0x2d1d45,_0x471065);_0x3301c6(_0x471065);});});}exports[_0xc26e('0x16')]=function(_0x412e44){var _0x4c1c07=this;return new Promise(function(_0x45ce27,_0x45d0a9){return db[_0xc26e('0x17')][_0xc26e('0x18')]({'raw':_0x412e44[_0xc26e('0x19')]?_0x412e44[_0xc26e('0x19')][_0xc26e('0x1a')]===undefined?!![]:![]:!![],'where':_0x412e44[_0xc26e('0x19')]?_0x412e44['options'][_0xc26e('0x1b')]||null:null,'attributes':_0x412e44['options']?_0x412e44[_0xc26e('0x19')][_0xc26e('0x1c')]||null:null,'limit':_0x412e44[_0xc26e('0x19')]?_0x412e44[_0xc26e('0x19')]['limit']||null:null,'include':_0x412e44[_0xc26e('0x19')]?_0x412e44['options']['include']?_[_0xc26e('0x1d')](_0x412e44[_0xc26e('0x19')][_0xc26e('0x1e')],function(_0x4005b8){return{'model':db[_0x4005b8['model']],'as':_0x4005b8['as'],'attributes':_0x4005b8[_0xc26e('0x1c')],'include':_0x4005b8[_0xc26e('0x1e')]?_[_0xc26e('0x1d')](_0x4005b8[_0xc26e('0x1e')],function(_0x354795){return{'model':db[_0x354795[_0xc26e('0x1f')]],'as':_0x354795['as'],'attributes':_0x354795[_0xc26e('0x1c')],'include':_0x354795[_0xc26e('0x1e')]?_[_0xc26e('0x1d')](_0x354795[_0xc26e('0x1e')],function(_0x1e92b9){return{'model':db[_0x1e92b9[_0xc26e('0x1f')]],'as':_0x1e92b9['as'],'attributes':_0x1e92b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xc26e('0xc')](function(_0x1d9d0d){logger[_0xc26e('0xd')](_0xc26e('0x16'),_0x412e44);logger[_0xc26e('0x10')](_0xc26e('0x16'),_0x412e44,JSON[_0xc26e('0x20')](_0x1d9d0d));_0x45ce27(_0x1d9d0d);})['catch'](function(_0x4853a5){logger[_0xc26e('0x11')]('GetCmHopperBlack',_0x4853a5[_0xc26e('0x13')],_0x412e44);_0x45d0a9(_0x4c1c07[_0xc26e('0x11')](0x1f4,_0x4853a5[_0xc26e('0x13')]));});});};exports[_0xc26e('0x21')]=function(_0x1f039e){var _0x2a97ac=this;return new Promise(function(_0x13e307,_0xd317fc){return db['CmHopperBlack'][_0xc26e('0x22')](_0x1f039e['body'],{'raw':_0x1f039e['options']?_0x1f039e[_0xc26e('0x19')][_0xc26e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f039e[_0xc26e('0x19')]?_0x1f039e[_0xc26e('0x19')][_0xc26e('0x1b')]||null:null,'attributes':_0x1f039e['options']?_0x1f039e['options'][_0xc26e('0x1c')]||null:null,'limit':_0x1f039e[_0xc26e('0x19')]?_0x1f039e[_0xc26e('0x19')][_0xc26e('0x23')]||null:null})[_0xc26e('0xc')](function(_0xadf505){logger[_0xc26e('0xd')](_0xc26e('0x21'),_0x1f039e);logger['debug'](_0xc26e('0x21'),_0x1f039e,JSON[_0xc26e('0x20')](_0xadf505));_0x13e307(_0xadf505);})['catch'](function(_0x2263d4){logger[_0xc26e('0x11')]('UpdateCmHopperBlack',_0x2263d4[_0xc26e('0x13')],_0x1f039e);_0xd317fc(_0x2a97ac[_0xc26e('0x11')](0x1f4,_0x2263d4['message']));});});};exports[_0xc26e('0x24')]=function(_0x473cd5){var _0x1b306a=this;return new Promise(function(_0x5d2d86,_0x42a472){return db[_0xc26e('0x17')][_0xc26e('0x25')]({'where':_0x473cd5[_0xc26e('0x19')]?_0x473cd5['options'][_0xc26e('0x1b')]||null:null})['then'](function(_0x51a4b8){logger['info']('DestroyCmHopperBlack',_0x473cd5);logger[_0xc26e('0x10')](_0xc26e('0x24'),_0x473cd5,JSON[_0xc26e('0x20')](_0x51a4b8));_0x5d2d86(_0x51a4b8);})[_0xc26e('0x15')](function(_0x22547a){logger[_0xc26e('0x11')](_0xc26e('0x24'),_0x22547a[_0xc26e('0x13')],_0x473cd5);_0x42a472(_0x1b306a[_0xc26e('0x11')](0x1f4,_0x22547a[_0xc26e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 9227b78..57b0f04 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 _0x8ca9=['express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x216af3,_0x1b2340){var _0x421227=function(_0x1c1220){while(--_0x1c1220){_0x216af3['push'](_0x216af3['shift']());}};_0x421227(++_0x1b2340);}(_0x8ca9,0x9c));var _0x98ca=function(_0x395e05,_0x4ff23e){_0x395e05=_0x395e05-0x0;var _0x1846a7=_0x8ca9[_0x395e05];return _0x1846a7;};'use strict';var multer=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var path=require(_0x98ca('0x2'));var timeout=require(_0x98ca('0x3'));var express=require(_0x98ca('0x4'));var router=express[_0x98ca('0x5')]();var fs_extra=require(_0x98ca('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ca('0x7'));var controller=require('./cmHopperBlack.controller');router[_0x98ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x98ca('0x9')]);router[_0x98ca('0x8')](_0x98ca('0xa'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xc')]);router[_0x98ca('0x8')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0xe')]);router[_0x98ca('0xf')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x10')]);router[_0x98ca('0x11')](_0x98ca('0xd'),auth[_0x98ca('0xb')](),controller[_0x98ca('0x12')]);module[_0x98ca('0x13')]=router; \ No newline at end of file +var _0x53ec=['../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x2e3ebb,_0x5afc59){var _0x8f027f=function(_0x29b2f3){while(--_0x29b2f3){_0x2e3ebb['push'](_0x2e3ebb['shift']());}};_0x8f027f(++_0x5afc59);}(_0x53ec,0x192));var _0xc53e=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0x53ec[_0x13fcaf];return _0x4fa631;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 15ead7e..d606f16 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 _0x3418=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','seconds','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x3418,0xca));var _0x8341=function(_0x5aac16,_0x16b4bc){_0x5aac16=_0x5aac16-0x0;var _0x2eeb9f=_0x3418[_0x5aac16];return _0x2eeb9f;};'use strict';var Sequelize=require(_0x8341('0x0'));var moment=require(_0x8341('0x1'));module[_0x8341('0x2')]={'state':{'type':Sequelize[_0x8341('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8341('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8341('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8341('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8341('0x4')]},'calleridname':{'type':Sequelize[_0x8341('0x4')]},'starttime':{'type':Sequelize[_0x8341('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8341('0x5')]},'droptime':{'type':Sequelize[_0x8341('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8341('0x4')]},'campaign':{'type':Sequelize[_0x8341('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8341('0x4')]},'disposition':{'type':Sequelize[_0x8341('0x4')]},'secondDisposition':{'type':Sequelize[_0x8341('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8341('0x4')]},'dispositionat':{'type':Sequelize[_0x8341('0x5')],'set':function(_0x463cd8){var _0x49fc0e=this[_0x8341('0x6')](_0x8341('0x7'));if(_0x49fc0e&&_0x463cd8){this[_0x8341('0x8')]('followuptime',moment(_0x463cd8)['diff'](moment(_0x49fc0e),_0x8341('0x9')));}return this[_0x8341('0x8')](_0x8341('0xa'),_0x463cd8);}},'amd':{'type':Sequelize[_0x8341('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8341('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8341('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8341('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x8341('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8341('0x5')]},'recallme':{'type':Sequelize[_0x8341('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8341('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8341('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0285=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0x0285,0x14c));var _0x5028=function(_0x1cb574,_0x54ed8a){_0x1cb574=_0x1cb574-0x0;var _0x1c918e=_0x0285[_0x1cb574];return _0x1c918e;};'use strict';var Sequelize=require(_0x5028('0x0'));var moment=require(_0x5028('0x1'));module[_0x5028('0x2')]={'state':{'type':Sequelize[_0x5028('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5028('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x5028('0x5')]},'originatecalleridname':{'type':Sequelize[_0x5028('0x5')]},'calleridnum':{'type':Sequelize[_0x5028('0x5')]},'calleridname':{'type':Sequelize[_0x5028('0x5')]},'starttime':{'type':Sequelize[_0x5028('0x4')]},'responsetime':{'type':Sequelize[_0x5028('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5028('0x4')]},'endtime':{'type':Sequelize[_0x5028('0x4')]},'ringtime':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5028('0x5')]},'campaign':{'type':Sequelize[_0x5028('0x5')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5028('0x5')]},'reason':{'type':Sequelize[_0x5028('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5028('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x5028('0x4')],'set':function(_0x3835e3){var _0x2fb808=this[_0x5028('0x6')](_0x5028('0x7'));if(_0x2fb808&&_0x3835e3){this[_0x5028('0x8')](_0x5028('0x9'),moment(_0x3835e3)[_0x5028('0xa')](moment(_0x2fb808),_0x5028('0xb')));}return this[_0x5028('0x8')]('dispositionat',_0x3835e3);}},'amd':{'type':Sequelize[_0x5028('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5028('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5028('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5028('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5028('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5028('0x4')]},'deleted':{'type':Sequelize[_0x5028('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5028('0x4')]},'recallme':{'type':Sequelize[_0x5028('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5028('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 57da532..02c558a 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 _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x51cb14,_0x3d75fa){var _0x57e137=function(_0x28673b){while(--_0x28673b){_0x51cb14['push'](_0x51cb14['shift']());}};_0x57e137(++_0x3d75fa);}(_0x430c,0x1a1));var _0xc430=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x430c[_0x212a37];return _0x5d0bf9;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));}; \ No newline at end of file +var _0x33af=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(ListId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2c112d,_0x560edf){var _0x29c216=function(_0x1e1904){while(--_0x1e1904){_0x2c112d['push'](_0x2c112d['shift']());}};_0x29c216(++_0x560edf);}(_0x33af,0xec));var _0xf33a=function(_0x2cff4f,_0x21e344){_0x2cff4f=_0x2cff4f-0x0;var _0x3df848=_0x33af[_0x2cff4f];return _0x3df848;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['CmHopperFinal'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':!![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')]()[_0xf33a('0x26')](respondWithResult(_0x1a98f9,null))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x4107b1,_0x190a2b){if(_0x4107b1[_0xf33a('0x48')][_0xf33a('0x49')]){delete _0x4107b1[_0xf33a('0x48')][_0xf33a('0x49')];}return db[_0xf33a('0x2d')][_0xf33a('0x4a')]({'where':{'uniqueid':_0x4107b1[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x190a2b,null))[_0xf33a('0x26')](saveUpdates(_0x4107b1[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x190a2b,null))[_0xf33a('0x42')](handleError(_0x190a2b,null));};exports[_0xf33a('0x4b')]=function(_0x3bab07,_0x1f7d8c,_0x57815c){return db['CmHopperFinal'][_0xf33a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x3bab07[_0xf33a('0x44')]['id']},'attributes':[[db['sequelize']['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal'](_0xf33a('0x4e')))),_0xf33a('0x4f')],[db[_0xf33a('0x4d')]['fn']('COUNT',db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal'](_0xf33a('0x52')))),_0xf33a('0x53')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xf33a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x55')))),'dropContacts'],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x56')))),_0xf33a('0x57')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x58')))),'answeringMachine']]})[_0xf33a('0x26')](handleEntityNotFound(_0x1f7d8c,null))[_0xf33a('0x26')](respondWithResult(_0x1f7d8c,null))[_0xf33a('0x42')](handleError(_0x1f7d8c,null));};exports[_0xf33a('0x59')]=function(_0x2f1fef,_0x129229,_0x473484){return db[_0xf33a('0x2d')][_0xf33a('0x40')]({'raw':![],'where':{'CampaignId':_0x2f1fef[_0xf33a('0x44')]['id']},'attributes':[[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xf33a('0x4f')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x51')))),_0xf33a('0x5a')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x52')))),_0xf33a('0x53')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x5b')))),'congestionContacts'],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x55')))),_0xf33a('0x5c')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db['sequelize']['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x5d')))),_0xf33a('0x5e')],[db[_0xf33a('0x4d')]['fn'](_0xf33a('0x4c'),db[_0xf33a('0x4d')]['fn']('IF',db['sequelize'][_0xf33a('0x50')](_0xf33a('0x56')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0xf33a('0x4d')]['fn']('IF',db[_0xf33a('0x4d')][_0xf33a('0x50')](_0xf33a('0x58')))),_0xf33a('0x5f')]]})[_0xf33a('0x26')](handleEntityNotFound(_0x129229,null))[_0xf33a('0x26')](respondWithResult(_0x129229,null))[_0xf33a('0x42')](handleError(_0x129229,null));};exports[_0xf33a('0x60')]=function(_0x3bebca,_0x40bb02,_0x10a271){return db['VoiceQueue'][_0xf33a('0x4a')]({'where':{'id':_0x3bebca['params']['id']}})['then'](handleEntityNotFound(_0x40bb02,null))[_0xf33a('0x26')](function(_0x25cc49){var _0x132764;if(_0x25cc49){_0x132764=squel['insert']()['into'](_0xf33a('0x61'))['fromQuery']([_0xf33a('0x62'),_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),_0xf33a('0x66'),'createdAt','updatedAt'],squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x69'),_0xf33a('0x62'))['field'](_0xf33a('0x6a'),_0xf33a('0x63'))['field'](_0xf33a('0x6b'),_0xf33a('0x64'))[_0xf33a('0x68')]('ANY_VALUE(ListId)',_0xf33a('0x65'))[_0xf33a('0x68')](_0xf33a('0x6c'),_0xf33a('0x66'))['field'](_0xf33a('0x6a'),_0xf33a('0x6d'))[_0xf33a('0x68')]('NOW()',_0xf33a('0x6e'))[_0xf33a('0x6f')](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id'][_0xf33a('0x72')]())[_0xf33a('0x3b')](_0xf33a('0x73'),_0x3bebca[_0xf33a('0x48')][_0xf33a('0x74')][_0xf33a('0x72')]())[_0xf33a('0x3b')](_0xf33a('0x75'))[_0xf33a('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x62'))[_0xf33a('0x6f')](_0xf33a('0x61'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id'][_0xf33a('0x72')]()))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x77'))['from'](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x71'),_0x3bebca[_0xf33a('0x44')]['id']['toString']())[_0xf33a('0x3b')](_0xf33a('0x78')))[_0xf33a('0x79')](_0xf33a('0x64')))[_0xf33a('0x72')]();return db[_0xf33a('0x4d')][_0xf33a('0x32')](_0x132764);}return[];})[_0xf33a('0x26')](respondWithResult(_0x40bb02,null))['catch'](handleError(_0x40bb02,null));};exports[_0xf33a('0x7a')]=function(_0x1dfb59,_0x9c0b99,_0x17b2fa){return db['Campaign']['find']({'where':{'id':_0x1dfb59[_0xf33a('0x44')]['id']}})['then'](handleEntityNotFound(_0x9c0b99,null))[_0xf33a('0x26')](function(_0x1595b7){var _0x3d8dbe;if(_0x1595b7){_0x3d8dbe=squel[_0xf33a('0x7b')]()['into']('cm_hopper')[_0xf33a('0x7c')](['phone',_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),_0xf33a('0x7d'),_0xf33a('0x6d'),_0xf33a('0x6e')],squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x69'),_0xf33a('0x62'))[_0xf33a('0x68')](_0xf33a('0x6a'),_0xf33a('0x63'))[_0xf33a('0x68')](_0xf33a('0x6b'),_0xf33a('0x64'))['field'](_0xf33a('0x7e'),'ListId')[_0xf33a('0x68')]('ANY_VALUE(CampaignId)','CampaignId')['field'](_0xf33a('0x6a'),_0xf33a('0x6d'))['field'](_0xf33a('0x6a'),_0xf33a('0x6e'))[_0xf33a('0x6f')](_0xf33a('0x70'))[_0xf33a('0x3b')](_0xf33a('0x7f'),_0x1dfb59['params']['id'][_0xf33a('0x72')]())[_0xf33a('0x3b')]('state\x20=\x20?',_0x1dfb59[_0xf33a('0x48')][_0xf33a('0x74')][_0xf33a('0x72')]())['where'](_0xf33a('0x75'))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')]('phone')[_0xf33a('0x6f')](_0xf33a('0x61'))[_0xf33a('0x3b')](_0xf33a('0x7f'),_0x1dfb59[_0xf33a('0x44')]['id']['toString']()))[_0xf33a('0x3b')](_0xf33a('0x76'),squel[_0xf33a('0x67')]()[_0xf33a('0x68')](_0xf33a('0x77'))['from'](_0xf33a('0x70'))['where']('CampaignId\x20=\x20?',_0x1dfb59[_0xf33a('0x44')]['id']['toString']())[_0xf33a('0x3b')](_0xf33a('0x78')))['group'](_0xf33a('0x64')))[_0xf33a('0x72')]();return db[_0xf33a('0x4d')][_0xf33a('0x32')](_0x3d8dbe);}return[];})[_0xf33a('0x26')](respondWithResult(_0x9c0b99,null))[_0xf33a('0x42')](handleError(_0x9c0b99,null));};exports[_0xf33a('0x80')]=function(_0x4abd84,_0x1205d1,_0x1d83a0){return db[_0xf33a('0x81')][_0xf33a('0x82')]({'where':{'VoiceQueueId':_0x4abd84['body'][_0xf33a('0x66')],'CampaignId':_0x4abd84['body'][_0xf33a('0x7d')],'ContactId':_0x4abd84[_0xf33a('0x48')][_0xf33a('0x64')]}})[_0xf33a('0x26')](handleEntityNotFound(_0x1205d1,null))[_0xf33a('0x26')](function(_0x49c40a){if(_0x49c40a){return _0x49c40a;}return null;})[_0xf33a('0x26')](respondWithResult(_0x1205d1,null))[_0xf33a('0x42')](handleError(_0x1205d1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c574b65..714a357 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 _0x776b=['./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x776b,0x185));var _0xb776=function(_0x3bdae5,_0x876bfb){_0x3bdae5=_0x3bdae5-0x0;var _0x53bcbb=_0x776b[_0x3bdae5];return _0x53bcbb;};'use strict';var _=require(_0xb776('0x0'));var util=require(_0xb776('0x1'));var logger=require(_0xb776('0x2'))(_0xb776('0x3'));var moment=require('moment');var BPromise=require(_0xb776('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb776('0x5'));var rimraf=require('rimraf');var config=require(_0xb776('0x6'));var attributes=require(_0xb776('0x7'));module[_0xb776('0x8')]=function(_0x5aabfb,_0x2a7767){return _0x5aabfb['define']('CmHopperFinal',attributes,{'tableName':_0xb776('0x9'),'paranoid':![],'indexes':[{'name':_0xb776('0xa'),'fields':[_0xb776('0xa')]},{'name':_0xb776('0xb'),'fields':[_0xb776('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98f2=['uniqueid','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x535f54,_0x2bb47a){var _0x261b5c=function(_0x439cd7){while(--_0x439cd7){_0x535f54['push'](_0x535f54['shift']());}};_0x261b5c(++_0x2bb47a);}(_0x98f2,0x16d));var _0x298f=function(_0x534f2e,_0x14f09b){_0x534f2e=_0x534f2e-0x0;var _0x5e7ffc=_0x98f2[_0x534f2e];return _0x5e7ffc;};'use strict';var _=require(_0x298f('0x0'));var util=require(_0x298f('0x1'));var logger=require(_0x298f('0x2'))(_0x298f('0x3'));var moment=require('moment');var BPromise=require(_0x298f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x298f('0x5'));var rimraf=require('rimraf');var config=require(_0x298f('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x298f('0x7')]=function(_0x1b37bb,_0x4e690d){return _0x1b37bb[_0x298f('0x8')](_0x298f('0x9'),attributes,{'tableName':_0x298f('0xa'),'paranoid':![],'indexes':[{'name':_0x298f('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x298f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 995ee60..03d5b66 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3e7161,_0x4731c9){var _0x1bd7f3=function(_0x1e412b){while(--_0x1e412b){_0x3e7161['push'](_0x3e7161['shift']());}};_0x1bd7f3(++_0x4731c9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0xb10b[_0x3434d7];return _0x51eebd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xed99bf,_0x26bbce){var _0x174f9a=function(_0x54619b){while(--_0x54619b){_0xed99bf['push'](_0xed99bf['shift']());}};_0x174f9a(++_0x26bbce);}(_0x7a54,0x106));var _0x47a5=function(_0x583052,_0x32b3c8){_0x583052=_0x583052-0x0;var _0x274312=_0x7a54[_0x583052];return _0x274312;};'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')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4a93f44..012bcfc 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 _0x4efb=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','checkContactHopper','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4efb,0xfa));var _0xb4ef=function(_0x4bb521,_0x58b1c1){_0x4bb521=_0x4bb521-0x0;var _0x26923=_0x4efb[_0x4bb521];return _0x26923;};'use strict';var multer=require('multer');var util=require(_0xb4ef('0x0'));var path=require(_0xb4ef('0x1'));var timeout=require(_0xb4ef('0x2'));var express=require('express');var router=express[_0xb4ef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb4ef('0x4'));var interaction=require(_0xb4ef('0x5'));var config=require('../../config/environment');var controller=require(_0xb4ef('0x6'));router['get']('/',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x8')]);router[_0xb4ef('0x9')](_0xb4ef('0xa'),auth[_0xb4ef('0x7')](),controller['describe']);router[_0xb4ef('0x9')](_0xb4ef('0xb'),auth[_0xb4ef('0x7')](),controller[_0xb4ef('0xc')]);router[_0xb4ef('0x9')](_0xb4ef('0xd'),auth['isAuthenticated'](),controller[_0xb4ef('0xe')]);router['get'](_0xb4ef('0xf'),auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x10')]);router['post'](_0xb4ef('0x11'),auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x12')]);router[_0xb4ef('0x13')](_0xb4ef('0x14'),auth[_0xb4ef('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xb4ef('0x13')]('/checkContactHopper',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x15')]);router[_0xb4ef('0x16')](_0xb4ef('0xb'),auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x17')]);module[_0xb4ef('0x18')]=router; \ No newline at end of file +var _0x6054=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','post'];(function(_0x11d740,_0x17257e){var _0x2391f9=function(_0x732e3b){while(--_0x732e3b){_0x11d740['push'](_0x11d740['shift']());}};_0x2391f9(++_0x17257e);}(_0x6054,0x127));var _0x4605=function(_0x1faa64,_0x27380c){_0x1faa64=_0x1faa64-0x0;var _0x3e01e1=_0x6054[_0x1faa64];return _0x3e01e1;};'use strict';var multer=require(_0x4605('0x0'));var util=require('util');var path=require(_0x4605('0x1'));var timeout=require('connect-timeout');var express=require(_0x4605('0x2'));var router=express[_0x4605('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4605('0x4'));var config=require(_0x4605('0x5'));var controller=require(_0x4605('0x6'));router[_0x4605('0x7')]('/',auth['isAuthenticated'](),controller[_0x4605('0x8')]);router[_0x4605('0x7')](_0x4605('0x9'),auth[_0x4605('0xa')](),controller[_0x4605('0xb')]);router['get'](_0x4605('0xc'),auth[_0x4605('0xa')](),controller[_0x4605('0xd')]);router['get'](_0x4605('0xe'),auth[_0x4605('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x4605('0xf'),auth[_0x4605('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x4605('0x10')](_0x4605('0x11'),auth[_0x4605('0xa')](),controller[_0x4605('0x12')]);router[_0x4605('0x10')](_0x4605('0x13'),auth[_0x4605('0xa')](),controller[_0x4605('0x14')]);router[_0x4605('0x10')](_0x4605('0x15'),auth[_0x4605('0xa')](),controller[_0x4605('0x16')]);router[_0x4605('0x17')](_0x4605('0xc'),auth[_0x4605('0xa')](),controller[_0x4605('0x18')]);module[_0x4605('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5f50b35..f3cc191 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 _0x86e6=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x350cfb,_0x3f48f7){var _0x35d6ee=function(_0x2e5b0b){while(--_0x2e5b0b){_0x350cfb['push'](_0x350cfb['shift']());}};_0x35d6ee(++_0x3f48f7);}(_0x86e6,0x1a9));var _0x686e=function(_0x1ecbaf,_0x279355){_0x1ecbaf=_0x1ecbaf-0x0;var _0x41aaca=_0x86e6[_0x1ecbaf];return _0x41aaca;};'use strict';var Sequelize=require(_0x686e('0x0'));module[_0x686e('0x1')]={'state':{'type':Sequelize[_0x686e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x686e('0x3')]},'scheduledat':{'type':Sequelize[_0x686e('0x4')]},'countbusyretry':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x686e('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x686e('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x686e('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x686e('0x4')]},'droptime':{'type':Sequelize[_0x686e('0x4')]},'endtime':{'type':Sequelize[_0x686e('0x4')]},'ringtime':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x686e('0x3')]},'campaign':{'type':Sequelize[_0x686e('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x686e('0x3')]},'amd':{'type':Sequelize[_0x686e('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x686e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x686e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x686e('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x686e('0x4')]},'edited':{'type':Sequelize[_0x686e('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x686e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e2a=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0x1e2a,0x1ab));var _0xa1e2=function(_0x533033,_0x5bd12f){_0x533033=_0x533033-0x0;var _0x236b7b=_0x1e2a[_0x533033];return _0x236b7b;};'use strict';var Sequelize=require(_0xa1e2('0x0'));module['exports']={'state':{'type':Sequelize[_0xa1e2('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa1e2('0x2')]},'scheduledat':{'type':Sequelize[_0xa1e2('0x3')]},'countbusyretry':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa1e2('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa1e2('0x2')]},'calleridname':{'type':Sequelize[_0xa1e2('0x2')]},'starttime':{'type':Sequelize[_0xa1e2('0x3')]},'responsetime':{'type':Sequelize[_0xa1e2('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa1e2('0x3')]},'endtime':{'type':Sequelize[_0xa1e2('0x3')]},'ringtime':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xa1e2('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa1e2('0x3')]},'edited':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 0ff0444..c260387 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 _0x7b32=['map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','show','params','rawAttributes','options','catch','create','body','describe','uniqueid','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperHistory','fieldName','type','key','model'];(function(_0x31fc27,_0x3c70c9){var _0x1a13bb=function(_0x2e64bd){while(--_0x2e64bd){_0x31fc27['push'](_0x31fc27['shift']());}};_0x1a13bb(++_0x3c70c9);}(_0x7b32,0x1df));var _0x27b3=function(_0x15a25a,_0x19c429){_0x15a25a=_0x15a25a-0x0;var _0x1d25f8=_0x7b32[_0x15a25a];return _0x1d25f8;};'use strict';var emlformat=require(_0x27b3('0x0'));var rimraf=require(_0x27b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27b3('0x2'));var rp=require(_0x27b3('0x3'));var moment=require('moment');var BPromise=require(_0x27b3('0x4'));var Mustache=require('mustache');var util=require(_0x27b3('0x5'));var path=require(_0x27b3('0x6'));var sox=require('sox');var csv=require(_0x27b3('0x7'));var ejs=require(_0x27b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27b3('0x9'));var deskjs=require(_0x27b3('0xa'));var toCsv=require(_0x27b3('0x7'));var querystring=require(_0x27b3('0xb'));var Papa=require(_0x27b3('0xc'));var Redis=require('ioredis');var authService=require(_0x27b3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x27b3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27b3('0xf'))(_0x27b3('0x10'));var utils=require(_0x27b3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x27b3('0x12'));var db=require(_0x27b3('0x13'))['db'];function respondWithStatusCode(_0x177cc6,_0x4fcae5){_0x4fcae5=_0x4fcae5||0xcc;return function(_0x40fd96){if(_0x40fd96){return _0x177cc6['sendStatus'](_0x4fcae5);}return _0x177cc6['status'](_0x4fcae5)[_0x27b3('0x14')]();};}function respondWithResult(_0x9d147e,_0x395266){_0x395266=_0x395266||0xc8;return function(_0x11bc91){if(_0x11bc91){return _0x9d147e['status'](_0x395266)['json'](_0x11bc91);}};}function respondWithFilteredResult(_0x3b6ff2,_0xc4d51a){return function(_0x57855f){if(_0x57855f){var _0x50e0df=typeof _0xc4d51a['offset']===_0x27b3('0x15')&&typeof _0xc4d51a[_0x27b3('0x16')]==='undefined';var _0x4cb3a2=_0x57855f[_0x27b3('0x17')];var _0xd6ec38=_0x50e0df?0x0:_0xc4d51a[_0x27b3('0x18')];var _0x1c06ce=_0x50e0df?_0x57855f[_0x27b3('0x17')]:_0xc4d51a['offset']+_0xc4d51a[_0x27b3('0x16')];var _0x4c2635;if(_0x1c06ce>=_0x4cb3a2){_0x1c06ce=_0x4cb3a2;_0x4c2635=0xc8;}else{_0x4c2635=0xce;}_0x3b6ff2[_0x27b3('0x19')](_0x4c2635);return _0x3b6ff2[_0x27b3('0x1a')](_0x27b3('0x1b'),_0xd6ec38+'-'+_0x1c06ce+'/'+_0x4cb3a2)[_0x27b3('0x1c')](_0x57855f);}return null;};}function patchUpdates(_0x10697a){return function(_0x102b1a){try{jsonpatch[_0x27b3('0x1d')](_0x102b1a,_0x10697a,!![]);}catch(_0x3e54bc){return BPromise[_0x27b3('0x1e')](_0x3e54bc);}return _0x102b1a[_0x27b3('0x1f')]();};}function saveUpdates(_0x4083ea,_0x1d7f04){return function(_0x39d129){if(_0x39d129){return _0x39d129[_0x27b3('0x20')](_0x4083ea)[_0x27b3('0x21')](function(_0x353a07){return _0x353a07;});}return null;};}function removeEntity(_0x203e0a,_0x27b996){return function(_0x18c14f){if(_0x18c14f){return _0x18c14f[_0x27b3('0x22')]()['then'](function(){_0x203e0a['status'](0xcc)[_0x27b3('0x14')]();});}};}function handleEntityNotFound(_0x7f586e,_0x45a90c){return function(_0x559cdb){if(!_0x559cdb){_0x7f586e[_0x27b3('0x23')](0x194);}return _0x559cdb;};}function handleError(_0x5bd141,_0x2db0c4){_0x2db0c4=_0x2db0c4||0x1f4;return function(_0x3b0d48){logger[_0x27b3('0x24')](_0x3b0d48[_0x27b3('0x25')]);if(_0x3b0d48['name']){delete _0x3b0d48[_0x27b3('0x26')];}_0x5bd141[_0x27b3('0x19')](_0x2db0c4)[_0x27b3('0x27')](_0x3b0d48);};}exports[_0x27b3('0x28')]=function(_0x12d8ed,_0x1340a9){var _0x9d4aef={},_0x10c3d8={},_0x878cff={'count':0x0,'rows':[]};var _0x277ef6=_['map'](db[_0x27b3('0x29')]['rawAttributes'],function(_0x35b283){return{'name':_0x35b283[_0x27b3('0x2a')],'type':_0x35b283[_0x27b3('0x2b')][_0x27b3('0x2c')]};});_0x10c3d8[_0x27b3('0x2d')]=_[_0x27b3('0x2e')](_0x277ef6,_0x27b3('0x26'));_0x10c3d8['query']=_[_0x27b3('0x2f')](_0x12d8ed[_0x27b3('0x30')]);_0x10c3d8['filters']=_[_0x27b3('0x31')](_0x10c3d8[_0x27b3('0x2d')],_0x10c3d8[_0x27b3('0x30')]);_0x9d4aef[_0x27b3('0x32')]=_[_0x27b3('0x31')](_0x10c3d8[_0x27b3('0x2d')],qs[_0x27b3('0x33')](_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x33')]));_0x9d4aef[_0x27b3('0x32')]=_0x9d4aef[_0x27b3('0x32')][_0x27b3('0x34')]?_0x9d4aef[_0x27b3('0x32')]:_0x10c3d8[_0x27b3('0x2d')];if(!_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x35')](_0x27b3('0x36'))){_0x9d4aef['limit']=qs[_0x27b3('0x16')](_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x16')]);_0x9d4aef[_0x27b3('0x18')]=qs[_0x27b3('0x18')](_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x18')]);}_0x9d4aef[_0x27b3('0x37')]=qs[_0x27b3('0x38')](_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x38')]);_0x9d4aef[_0x27b3('0x39')]=qs[_0x27b3('0x3a')](_[_0x27b3('0x3b')](_0x12d8ed[_0x27b3('0x30')],_0x10c3d8[_0x27b3('0x3a')]),_0x277ef6);if(_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x3c')]){_0x9d4aef[_0x27b3('0x39')]=_[_0x27b3('0x3d')](_0x9d4aef[_0x27b3('0x39')],{'$or':_[_0x27b3('0x2e')](_0x277ef6,function(_0x466ff6){if(_0x466ff6['type']!==_0x27b3('0x3e')){var _0x3a9067={};_0x3a9067[_0x466ff6[_0x27b3('0x26')]]={'$like':'%'+_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x3c')]+'%'};return _0x3a9067;}})});}_0x9d4aef=_[_0x27b3('0x3d')]({},_0x9d4aef,_0x12d8ed['options']);var _0x484da8={'where':_0x9d4aef[_0x27b3('0x39')]};return db['CmHopperHistory'][_0x27b3('0x17')](_0x484da8)[_0x27b3('0x21')](function(_0x341936){_0x878cff[_0x27b3('0x17')]=_0x341936;if(_0x12d8ed[_0x27b3('0x30')][_0x27b3('0x3f')]){_0x9d4aef[_0x27b3('0x40')]=[{'all':!![]}];}return db[_0x27b3('0x29')]['findAll'](_0x9d4aef);})[_0x27b3('0x21')](function(_0x4ebdc9){_0x878cff['rows']=_0x4ebdc9;return _0x878cff;})['then'](respondWithFilteredResult(_0x1340a9,_0x9d4aef))['catch'](handleError(_0x1340a9,null));};exports[_0x27b3('0x41')]=function(_0x4e28e5,_0x6859d8){var _0x14b5ed={'raw':!![],'where':{'id':_0x4e28e5[_0x27b3('0x42')]['id']}},_0x3a7316={};_0x3a7316[_0x27b3('0x2d')]=_['keys'](db[_0x27b3('0x29')][_0x27b3('0x43')]);_0x3a7316['query']=_[_0x27b3('0x2f')](_0x4e28e5[_0x27b3('0x30')]);_0x3a7316[_0x27b3('0x3a')]=_['intersection'](_0x3a7316[_0x27b3('0x2d')],_0x3a7316['query']);_0x14b5ed[_0x27b3('0x32')]=_[_0x27b3('0x31')](_0x3a7316[_0x27b3('0x2d')],qs[_0x27b3('0x33')](_0x4e28e5[_0x27b3('0x30')][_0x27b3('0x33')]));_0x14b5ed[_0x27b3('0x32')]=_0x14b5ed[_0x27b3('0x32')][_0x27b3('0x34')]?_0x14b5ed[_0x27b3('0x32')]:_0x3a7316[_0x27b3('0x2d')];if(_0x4e28e5['query'][_0x27b3('0x3f')]){_0x14b5ed[_0x27b3('0x40')]=[{'all':!![]}];}_0x14b5ed=_['merge']({},_0x14b5ed,_0x4e28e5[_0x27b3('0x44')]);return db[_0x27b3('0x29')]['find'](_0x14b5ed)[_0x27b3('0x21')](handleEntityNotFound(_0x6859d8,null))[_0x27b3('0x21')](respondWithResult(_0x6859d8,null))[_0x27b3('0x45')](handleError(_0x6859d8,null));};exports[_0x27b3('0x46')]=function(_0x20721a,_0xf520c2){return db['CmHopperHistory'][_0x27b3('0x46')](_0x20721a[_0x27b3('0x47')],{})[_0x27b3('0x21')](respondWithResult(_0xf520c2,0xc9))[_0x27b3('0x45')](handleError(_0xf520c2,null));};exports['describe']=function(_0x503bcc,_0x561ef8){return db[_0x27b3('0x29')][_0x27b3('0x48')]()[_0x27b3('0x21')](respondWithResult(_0x561ef8,null))['catch'](handleError(_0x561ef8,null));};exports[_0x27b3('0x20')]=function(_0x1fdfd2,_0x1c7fc9){if(_0x1fdfd2[_0x27b3('0x47')][_0x27b3('0x49')]){delete _0x1fdfd2['body'][_0x27b3('0x49')];}return db['CmHopperHistory'][_0x27b3('0x4a')]({'where':{'uniqueid':_0x1fdfd2[_0x27b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c7fc9,null))[_0x27b3('0x21')](saveUpdates(_0x1fdfd2['body'],null))[_0x27b3('0x21')](respondWithResult(_0x1c7fc9,null))['catch'](handleError(_0x1c7fc9,null));}; \ No newline at end of file +var _0x0288=['stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','length','query','nolimit','sort','filter','merge','type','VIRTUAL','where','includeAll','include','findAll','catch','show','options','find','create','body','describe','uniqueid','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0288,0x101));var _0x8028=function(_0x4c1991,_0x11a24b){_0x4c1991=_0x4c1991-0x0;var _0x4fbd4a=_0x0288[_0x4c1991];return _0x4fbd4a;};'use strict';var emlformat=require(_0x8028('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8028('0x1'));var jsonpatch=require(_0x8028('0x2'));var rp=require('request-promise');var moment=require(_0x8028('0x3'));var BPromise=require(_0x8028('0x4'));var Mustache=require('mustache');var util=require(_0x8028('0x5'));var path=require(_0x8028('0x6'));var sox=require(_0x8028('0x7'));var csv=require('to-csv');var ejs=require(_0x8028('0x8'));var fs=require('fs');var fs_extra=require(_0x8028('0x9'));var _=require(_0x8028('0xa'));var squel=require(_0x8028('0xb'));var crypto=require(_0x8028('0xc'));var jsforce=require(_0x8028('0xd'));var deskjs=require(_0x8028('0xe'));var toCsv=require(_0x8028('0xf'));var querystring=require(_0x8028('0x10'));var Papa=require(_0x8028('0x11'));var Redis=require(_0x8028('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8028('0x13'));var as=require(_0x8028('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8028('0x15'))(_0x8028('0x16'));var utils=require('../../config/utils');var config=require(_0x8028('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8028('0x18'))['db'];function respondWithStatusCode(_0x13a28a,_0x5efedb){_0x5efedb=_0x5efedb||0xcc;return function(_0x4be463){if(_0x4be463){return _0x13a28a[_0x8028('0x19')](_0x5efedb);}return _0x13a28a[_0x8028('0x1a')](_0x5efedb)[_0x8028('0x1b')]();};}function respondWithResult(_0x15ae6e,_0xd2958f){_0xd2958f=_0xd2958f||0xc8;return function(_0x96504a){if(_0x96504a){return _0x15ae6e[_0x8028('0x1a')](_0xd2958f)[_0x8028('0x1c')](_0x96504a);}};}function respondWithFilteredResult(_0x2754f8,_0x26fcf5){return function(_0xbca025){if(_0xbca025){var _0x57aefa=typeof _0x26fcf5['offset']===_0x8028('0x1d')&&typeof _0x26fcf5[_0x8028('0x1e')]===_0x8028('0x1d');var _0x245b50=_0xbca025[_0x8028('0x1f')];var _0x5994c2=_0x57aefa?0x0:_0x26fcf5[_0x8028('0x20')];var _0x2c85f0=_0x57aefa?_0xbca025['count']:_0x26fcf5[_0x8028('0x20')]+_0x26fcf5[_0x8028('0x1e')];var _0x30cc0d;if(_0x2c85f0>=_0x245b50){_0x2c85f0=_0x245b50;_0x30cc0d=0xc8;}else{_0x30cc0d=0xce;}_0x2754f8['status'](_0x30cc0d);return _0x2754f8[_0x8028('0x21')]('Content-Range',_0x5994c2+'-'+_0x2c85f0+'/'+_0x245b50)[_0x8028('0x1c')](_0xbca025);}return null;};}function patchUpdates(_0x1e5ee2){return function(_0x53758e){try{jsonpatch[_0x8028('0x22')](_0x53758e,_0x1e5ee2,!![]);}catch(_0xdefe3e){return BPromise[_0x8028('0x23')](_0xdefe3e);}return _0x53758e['save']();};}function saveUpdates(_0x1be9b4,_0x228447){return function(_0x5cbf42){if(_0x5cbf42){return _0x5cbf42[_0x8028('0x24')](_0x1be9b4)[_0x8028('0x25')](function(_0x178251){return _0x178251;});}return null;};}function removeEntity(_0xce99a5,_0x293dc6){return function(_0x110f2e){if(_0x110f2e){return _0x110f2e[_0x8028('0x26')]()['then'](function(){_0xce99a5[_0x8028('0x1a')](0xcc)[_0x8028('0x1b')]();});}};}function handleEntityNotFound(_0x580887,_0x38f643){return function(_0x41eee4){if(!_0x41eee4){_0x580887[_0x8028('0x19')](0x194);}return _0x41eee4;};}function handleError(_0x3ddddd,_0x15329e){_0x15329e=_0x15329e||0x1f4;return function(_0x500413){logger['error'](_0x500413[_0x8028('0x27')]);if(_0x500413['name']){delete _0x500413[_0x8028('0x28')];}_0x3ddddd['status'](_0x15329e)[_0x8028('0x29')](_0x500413);};}exports['index']=function(_0x2de1f6,_0x26bab2){var _0x146a32={},_0x1f7dcd={},_0x1620e0={'count':0x0,'rows':[]};var _0x2a247a=_[_0x8028('0x2a')](db[_0x8028('0x2b')][_0x8028('0x2c')],function(_0x1573a5){return{'name':_0x1573a5[_0x8028('0x2d')],'type':_0x1573a5['type'][_0x8028('0x2e')]};});_0x1f7dcd[_0x8028('0x2f')]=_[_0x8028('0x2a')](_0x2a247a,'name');_0x1f7dcd['query']=_[_0x8028('0x30')](_0x2de1f6['query']);_0x1f7dcd[_0x8028('0x31')]=_[_0x8028('0x32')](_0x1f7dcd['model'],_0x1f7dcd['query']);_0x146a32[_0x8028('0x33')]=_[_0x8028('0x32')](_0x1f7dcd[_0x8028('0x2f')],qs[_0x8028('0x34')](_0x2de1f6['query'][_0x8028('0x34')]));_0x146a32[_0x8028('0x33')]=_0x146a32[_0x8028('0x33')][_0x8028('0x35')]?_0x146a32['attributes']:_0x1f7dcd['model'];if(!_0x2de1f6[_0x8028('0x36')]['hasOwnProperty'](_0x8028('0x37'))){_0x146a32['limit']=qs[_0x8028('0x1e')](_0x2de1f6['query']['limit']);_0x146a32[_0x8028('0x20')]=qs[_0x8028('0x20')](_0x2de1f6[_0x8028('0x36')][_0x8028('0x20')]);}_0x146a32['order']=qs[_0x8028('0x38')](_0x2de1f6[_0x8028('0x36')]['sort']);_0x146a32['where']=qs['filters'](_['pick'](_0x2de1f6[_0x8028('0x36')],_0x1f7dcd[_0x8028('0x31')]),_0x2a247a);if(_0x2de1f6['query'][_0x8028('0x39')]){_0x146a32['where']=_[_0x8028('0x3a')](_0x146a32['where'],{'$or':_[_0x8028('0x2a')](_0x2a247a,function(_0x59b470){if(_0x59b470[_0x8028('0x3b')]!==_0x8028('0x3c')){var _0x5843a7={};_0x5843a7[_0x59b470[_0x8028('0x28')]]={'$like':'%'+_0x2de1f6[_0x8028('0x36')]['filter']+'%'};return _0x5843a7;}})});}_0x146a32=_[_0x8028('0x3a')]({},_0x146a32,_0x2de1f6['options']);var _0x3f36a5={'where':_0x146a32[_0x8028('0x3d')]};return db[_0x8028('0x2b')]['count'](_0x3f36a5)[_0x8028('0x25')](function(_0x2230b4){_0x1620e0['count']=_0x2230b4;if(_0x2de1f6['query'][_0x8028('0x3e')]){_0x146a32[_0x8028('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8028('0x40')](_0x146a32);})[_0x8028('0x25')](function(_0xdca408){_0x1620e0['rows']=_0xdca408;return _0x1620e0;})[_0x8028('0x25')](respondWithFilteredResult(_0x26bab2,_0x146a32))[_0x8028('0x41')](handleError(_0x26bab2,null));};exports[_0x8028('0x42')]=function(_0x4f0df2,_0x5c6306){var _0x23dc70={'raw':!![],'where':{'id':_0x4f0df2['params']['id']}},_0x398cb6={};_0x398cb6[_0x8028('0x2f')]=_['keys'](db[_0x8028('0x2b')][_0x8028('0x2c')]);_0x398cb6[_0x8028('0x36')]=_[_0x8028('0x30')](_0x4f0df2['query']);_0x398cb6['filters']=_[_0x8028('0x32')](_0x398cb6[_0x8028('0x2f')],_0x398cb6[_0x8028('0x36')]);_0x23dc70[_0x8028('0x33')]=_['intersection'](_0x398cb6['model'],qs[_0x8028('0x34')](_0x4f0df2[_0x8028('0x36')][_0x8028('0x34')]));_0x23dc70[_0x8028('0x33')]=_0x23dc70['attributes'][_0x8028('0x35')]?_0x23dc70[_0x8028('0x33')]:_0x398cb6[_0x8028('0x2f')];if(_0x4f0df2[_0x8028('0x36')]['includeAll']){_0x23dc70[_0x8028('0x3f')]=[{'all':!![]}];}_0x23dc70=_['merge']({},_0x23dc70,_0x4f0df2[_0x8028('0x43')]);return db[_0x8028('0x2b')][_0x8028('0x44')](_0x23dc70)[_0x8028('0x25')](handleEntityNotFound(_0x5c6306,null))[_0x8028('0x25')](respondWithResult(_0x5c6306,null))[_0x8028('0x41')](handleError(_0x5c6306,null));};exports[_0x8028('0x45')]=function(_0x3ee712,_0x3abd7d){return db[_0x8028('0x2b')]['create'](_0x3ee712[_0x8028('0x46')],{})['then'](respondWithResult(_0x3abd7d,0xc9))[_0x8028('0x41')](handleError(_0x3abd7d,null));};exports[_0x8028('0x47')]=function(_0x3fb3a3,_0x2ca04c){return db['CmHopperHistory'][_0x8028('0x47')]()[_0x8028('0x25')](respondWithResult(_0x2ca04c,null))[_0x8028('0x41')](handleError(_0x2ca04c,null));};exports[_0x8028('0x24')]=function(_0x40a25b,_0xc13f80){if(_0x40a25b[_0x8028('0x46')][_0x8028('0x48')]){delete _0x40a25b[_0x8028('0x46')][_0x8028('0x48')];}return db[_0x8028('0x2b')]['find']({'where':{'uniqueid':_0x40a25b[_0x8028('0x49')]['id']}})[_0x8028('0x25')](handleEntityNotFound(_0xc13f80,null))['then'](saveUpdates(_0x40a25b[_0x8028('0x46')],null))[_0x8028('0x25')](respondWithResult(_0xc13f80,null))[_0x8028('0x41')](handleError(_0xc13f80,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 76e5a98..0d73f21 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 _0xcf2f=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3681d8,_0x2e2445){var _0x2db982=function(_0x520650){while(--_0x520650){_0x3681d8['push'](_0x3681d8['shift']());}};_0x2db982(++_0x2e2445);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x325b53,_0x80a2e4){_0x325b53=_0x325b53-0x0;var _0x15dab5=_0xcf2f[_0x325b53];return _0x15dab5;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[{'name':_0xfcf2('0xe'),'fields':[_0xfcf2('0xe')]},{'name':_0xfcf2('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe953=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','endtime','lodash','util','../../config/logger'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0xe953,0xf9));var _0x3e95=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xe953[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var logger=require(_0x3e95('0x2'))('api');var moment=require(_0x3e95('0x3'));var BPromise=require(_0x3e95('0x4'));var rp=require(_0x3e95('0x5'));var fs=require('fs');var path=require(_0x3e95('0x6'));var rimraf=require(_0x3e95('0x7'));var config=require(_0x3e95('0x8'));var attributes=require(_0x3e95('0x9'));module['exports']=function(_0x4ec1b2,_0x2aaa3e){return _0x4ec1b2['define'](_0x3e95('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x3e95('0xb'),'fields':[_0x3e95('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9679376..cf73cc9 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 _0x4e8d=['result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','findAll','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0x4e8d,0x11e));var _0xd4e8=function(_0xd54dff,_0x340886){_0xd54dff=_0xd54dff-0x0;var _0x55a505=_0x4e8d[_0xd54dff];return _0x55a505;};'use strict';var _=require(_0xd4e8('0x0'));var util=require(_0xd4e8('0x1'));var moment=require(_0xd4e8('0x2'));var BPromise=require(_0xd4e8('0x3'));var rs=require(_0xd4e8('0x4'));var fs=require('fs');var Redis=require(_0xd4e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd4e8('0x6'));var logger=require(_0xd4e8('0x7'))(_0xd4e8('0x8'));var config=require(_0xd4e8('0x9'));var jayson=require(_0xd4e8('0xa'));var client=jayson['client'][_0xd4e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c8a29,_0x5a0ba2,_0x22c8ee){return new BPromise(function(_0x16c492,_0x22c9d5){return client[_0xd4e8('0xc')](_0x5c8a29,_0x22c8ee)[_0xd4e8('0xd')](function(_0x53428c){logger[_0xd4e8('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x5a0ba2,_0xd4e8('0xf'));logger[_0xd4e8('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5a0ba2,_0xd4e8('0xf'),JSON[_0xd4e8('0x11')](_0x53428c));if(_0x53428c['error']){if(_0x53428c[_0xd4e8('0x12')][_0xd4e8('0x13')]===0x1f4){logger[_0xd4e8('0x12')](_0xd4e8('0x14'),_0x5a0ba2,_0x53428c[_0xd4e8('0x12')][_0xd4e8('0x15')]);return _0x22c9d5(_0x53428c[_0xd4e8('0x12')][_0xd4e8('0x15')]);}logger[_0xd4e8('0x12')](_0xd4e8('0x14'),_0x5a0ba2,_0x53428c[_0xd4e8('0x12')][_0xd4e8('0x15')]);return _0x16c492(_0x53428c['error']['message']);}else{logger['info'](_0xd4e8('0x14'),_0x5a0ba2,_0xd4e8('0xf'));_0x16c492(_0x53428c[_0xd4e8('0x16')][_0xd4e8('0x15')]);}})[_0xd4e8('0x17')](function(_0x740b1f){logger[_0xd4e8('0x12')](_0xd4e8('0x14'),_0x5a0ba2,_0x740b1f);_0x22c9d5(_0x740b1f);});});}exports[_0xd4e8('0x18')]=function(_0x57de99){var _0x421ea7=this;return new Promise(function(_0x4b49f8,_0x3aa73a){return db[_0xd4e8('0x19')][_0xd4e8('0x1a')](_0x57de99[_0xd4e8('0x1b')],{'raw':_0x57de99[_0xd4e8('0x1c')]?_0x57de99[_0xd4e8('0x1c')][_0xd4e8('0x1d')]===undefined?!![]:![]:!![]})[_0xd4e8('0xd')](function(_0x16b342){logger[_0xd4e8('0xe')](_0xd4e8('0x18'),_0x57de99);logger['debug'](_0xd4e8('0x18'),_0x57de99,JSON[_0xd4e8('0x11')](_0x16b342));_0x4b49f8(_0x16b342);})[_0xd4e8('0x17')](function(_0x1fc7ab){logger[_0xd4e8('0x12')](_0xd4e8('0x18'),_0x1fc7ab['message'],_0x57de99);_0x3aa73a(_0x421ea7['error'](0x1f4,_0x1fc7ab[_0xd4e8('0x15')]));});});};exports[_0xd4e8('0x1e')]=function(_0xe1b6a5){var _0x49eea7=this;return new Promise(function(_0x363305,_0x34ca8f){return db['CmHopperHistory']['findAll']({'raw':_0xe1b6a5[_0xd4e8('0x1c')]?_0xe1b6a5[_0xd4e8('0x1c')][_0xd4e8('0x1d')]===undefined?!![]:![]:!![],'where':_0xe1b6a5['options']?_0xe1b6a5['options'][_0xd4e8('0x1f')]||null:null,'attributes':[[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')][_0xd4e8('0x22')]('id')),_0xd4e8('0x23')],[db['sequelize']['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x25')))),_0xd4e8('0x26')],[db[_0xd4e8('0x20')]['fn']('COUNT',db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x27')))),_0xd4e8('0x28')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x29')))),_0xd4e8('0x2a')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x2b'),db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')]['literal'](_0xd4e8('0x2c')))),_0xd4e8('0x2d')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x2b'),db[_0xd4e8('0x20')]['fn']('IF',db['sequelize'][_0xd4e8('0x24')](_0xd4e8('0x2e')))),_0xd4e8('0x2f')]]})[_0xd4e8('0xd')](function(_0x182bd0){logger[_0xd4e8('0xe')](_0xd4e8('0x1e'),_0xe1b6a5);logger[_0xd4e8('0x10')](_0xd4e8('0x1e'),_0xe1b6a5,JSON[_0xd4e8('0x11')](_0x182bd0));_0x363305(_0x182bd0);})[_0xd4e8('0x17')](function(_0x474e65){logger[_0xd4e8('0x12')](_0xd4e8('0x1e'),_0x474e65[_0xd4e8('0x15')],_0xe1b6a5);_0x34ca8f(_0x49eea7[_0xd4e8('0x12')](0x1f4,_0x474e65[_0xd4e8('0x15')]));});});};exports[_0xd4e8('0x30')]=function(_0xed9cf6){var _0x49e3a6=this;return new Promise(function(_0x647f87,_0x19da42){return db[_0xd4e8('0x19')]['findAll']({'raw':_0xed9cf6[_0xd4e8('0x1c')]?_0xed9cf6[_0xd4e8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xed9cf6[_0xd4e8('0x1c')]?_0xed9cf6[_0xd4e8('0x1c')][_0xd4e8('0x1f')]||null:null,'attributes':[['campaign',_0xd4e8('0x31')],[db[_0xd4e8('0x20')]['fn']('COUNT',db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')]['literal'](_0xd4e8('0x32')))),_0xd4e8('0x33')],[db[_0xd4e8('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x34')))),_0xd4e8('0x35')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd4e8('0x25')))),'outboundAnswerCallsDay'],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xd4e8('0x24')](_0xd4e8('0x36')))),_0xd4e8('0x37')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db['sequelize'][_0xd4e8('0x24')](_0xd4e8('0x38')))),'outboundCongestionCallsDay'],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db['sequelize'][_0xd4e8('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd4e8('0x39')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db[_0xd4e8('0x20')]['literal'](_0xd4e8('0x3a')))),_0xd4e8('0x3b')],[db['sequelize']['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x3c')))),_0xd4e8('0x3d')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db[_0xd4e8('0x20')]['literal'](_0xd4e8('0x3e')))),_0xd4e8('0x3f')],[db['sequelize']['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x40')))),_0xd4e8('0x41')],[db['sequelize']['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db[_0xd4e8('0x20')]['literal'](_0xd4e8('0x42')))),_0xd4e8('0x43')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x44')))),'outboundAnswerAgiCallsDay'],[db[_0xd4e8('0x20')]['fn']('COUNT',db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x45')))),_0xd4e8('0x43')],[db[_0xd4e8('0x20')]['fn']('COUNT',db[_0xd4e8('0x20')]['fn']('IF',db[_0xd4e8('0x20')][_0xd4e8('0x24')](_0xd4e8('0x46')))),_0xd4e8('0x47')]],'group':[_0xd4e8('0x48')]})[_0xd4e8('0xd')](function(_0x426a93){logger['info'](_0xd4e8('0x30'),_0xed9cf6);logger[_0xd4e8('0x10')](_0xd4e8('0x30'),_0xed9cf6,JSON[_0xd4e8('0x11')](_0x426a93));_0x647f87(_0x426a93);})[_0xd4e8('0x17')](function(_0x47d3f5){logger[_0xd4e8('0x12')](_0xd4e8('0x30'),_0x47d3f5['message'],_0xed9cf6);_0x19da42(_0x49e3a6[_0xd4e8('0x12')](0x1f4,_0x47d3f5[_0xd4e8('0x15')]));});});};exports[_0xd4e8('0x49')]=function(_0x100389){var _0x5a8810=this;return new Promise(function(_0x4761c7,_0x1a8512){return db[_0xd4e8('0x19')][_0xd4e8('0x4a')]({'raw':_0x100389[_0xd4e8('0x1c')]?_0x100389[_0xd4e8('0x1c')][_0xd4e8('0x1d')]===undefined?!![]:![]:!![],'where':_0x100389[_0xd4e8('0x1c')]?_0x100389['options'][_0xd4e8('0x1f')]||null:null,'attributes':[[_0xd4e8('0x48'),_0xd4e8('0x31')],[db['sequelize']['fn'](_0xd4e8('0x21'),db[_0xd4e8('0x20')][_0xd4e8('0x22')]('id')),_0xd4e8('0x4b')],[db[_0xd4e8('0x20')]['fn'](_0xd4e8('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xd4e8('0x24')](_0xd4e8('0x25')))),_0xd4e8('0x4c')]],'group':[_0xd4e8('0x48')]})['then'](function(_0x5db4c3){logger[_0xd4e8('0xe')]('GetCampaignHopperHistory',_0x100389);logger['debug'](_0xd4e8('0x49'),_0x100389,JSON[_0xd4e8('0x11')](_0x5db4c3));_0x4761c7(_0x5db4c3);})[_0xd4e8('0x17')](function(_0x2c842a){logger['error']('GetCampaignHopperHistory',_0x2c842a[_0xd4e8('0x15')],_0x100389);_0x1a8512(_0x5a8810[_0xd4e8('0x12')](0x1f4,_0x2c842a['message']));});});}; \ No newline at end of file +var _0xdafe=['debug','GetVoiceQueueHopperHistory','campaign','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','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime'];(function(_0x553f69,_0x42201){var _0x1c9c25=function(_0x93c849){while(--_0x93c849){_0x553f69['push'](_0x553f69['shift']());}};_0x1c9c25(++_0x42201);}(_0xdafe,0x6a));var _0xedaf=function(_0x26e8c5,_0x565092){_0x26e8c5=_0x26e8c5-0x0;var _0xb0d418=_0xdafe[_0x26e8c5];return _0xb0d418;};'use strict';var _=require(_0xedaf('0x0'));var util=require(_0xedaf('0x1'));var moment=require(_0xedaf('0x2'));var BPromise=require(_0xedaf('0x3'));var rs=require(_0xedaf('0x4'));var fs=require('fs');var Redis=require(_0xedaf('0x5'));var db=require(_0xedaf('0x6'))['db'];var utils=require(_0xedaf('0x7'));var logger=require(_0xedaf('0x8'))(_0xedaf('0x9'));var config=require(_0xedaf('0xa'));var jayson=require(_0xedaf('0xb'));var client=jayson['client'][_0xedaf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ed160,_0x15ed9d,_0x3f2380){return new BPromise(function(_0x54129e,_0x4eba67){return client[_0xedaf('0xd')](_0x4ed160,_0x3f2380)[_0xedaf('0xe')](function(_0x4470e6){logger[_0xedaf('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x15ed9d,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x15ed9d,_0xedaf('0x10'),JSON[_0xedaf('0x11')](_0x4470e6));if(_0x4470e6[_0xedaf('0x12')]){if(_0x4470e6['error'][_0xedaf('0x13')]===0x1f4){logger[_0xedaf('0x12')](_0xedaf('0x14'),_0x15ed9d,_0x4470e6[_0xedaf('0x12')]['message']);return _0x4eba67(_0x4470e6[_0xedaf('0x12')][_0xedaf('0x15')]);}logger['error'](_0xedaf('0x14'),_0x15ed9d,_0x4470e6[_0xedaf('0x12')][_0xedaf('0x15')]);return _0x54129e(_0x4470e6[_0xedaf('0x12')][_0xedaf('0x15')]);}else{logger[_0xedaf('0xf')](_0xedaf('0x14'),_0x15ed9d,_0xedaf('0x10'));_0x54129e(_0x4470e6['result'][_0xedaf('0x15')]);}})[_0xedaf('0x16')](function(_0x5b2ed3){logger[_0xedaf('0x12')](_0xedaf('0x14'),_0x15ed9d,_0x5b2ed3);_0x4eba67(_0x5b2ed3);});});}exports['CreateCmHopperHistory']=function(_0x4cbe04){var _0x14b28e=this;return new Promise(function(_0x442426,_0x3bf41c){return db[_0xedaf('0x17')]['create'](_0x4cbe04[_0xedaf('0x18')],{'raw':_0x4cbe04[_0xedaf('0x19')]?_0x4cbe04[_0xedaf('0x19')][_0xedaf('0x1a')]===undefined?!![]:![]:!![]})[_0xedaf('0xe')](function(_0xaa04ef){logger['info'](_0xedaf('0x1b'),_0x4cbe04);logger['debug'](_0xedaf('0x1b'),_0x4cbe04,JSON['stringify'](_0xaa04ef));_0x442426(_0xaa04ef);})[_0xedaf('0x16')](function(_0x4bb879){logger['error'](_0xedaf('0x1b'),_0x4bb879[_0xedaf('0x15')],_0x4cbe04);_0x3bf41c(_0x14b28e[_0xedaf('0x12')](0x1f4,_0x4bb879[_0xedaf('0x15')]));});});};exports['AvgHandleTime']=function(_0x483f6a){var _0x4fde26=this;return new Promise(function(_0x78a27f,_0x201d23){return db[_0xedaf('0x17')][_0xedaf('0x1c')]({'raw':_0x483f6a[_0xedaf('0x19')]?_0x483f6a['options'][_0xedaf('0x1a')]===undefined?!![]:![]:!![],'where':_0x483f6a[_0xedaf('0x19')]?_0x483f6a['options'][_0xedaf('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')][_0xedaf('0x20')]('id')),_0xedaf('0x21')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x23')))),'predictiveIntervalAnsweredCalls'],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x24')))),_0xedaf('0x25')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0xedaf('0x26')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x27'),db['sequelize']['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xedaf('0x28')],[db['sequelize']['fn'](_0xedaf('0x27'),db[_0xedaf('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xedaf('0x29')))),_0xedaf('0x2a')]]})[_0xedaf('0xe')](function(_0xac3684){logger[_0xedaf('0xf')](_0xedaf('0x2b'),_0x483f6a);logger[_0xedaf('0x2c')]('AvgHandleTime',_0x483f6a,JSON[_0xedaf('0x11')](_0xac3684));_0x78a27f(_0xac3684);})[_0xedaf('0x16')](function(_0x45e7dd){logger[_0xedaf('0x12')](_0xedaf('0x2b'),_0x45e7dd[_0xedaf('0x15')],_0x483f6a);_0x201d23(_0x4fde26['error'](0x1f4,_0x45e7dd[_0xedaf('0x15')]));});});};exports[_0xedaf('0x2d')]=function(_0x3be411){var _0x309e6c=this;return new Promise(function(_0x20a731,_0x4804f5){return db[_0xedaf('0x17')][_0xedaf('0x1c')]({'raw':_0x3be411['options']?_0x3be411[_0xedaf('0x19')][_0xedaf('0x1a')]===undefined?!![]:![]:!![],'where':_0x3be411[_0xedaf('0x19')]?_0x3be411[_0xedaf('0x19')]['where']||null:null,'attributes':[[_0xedaf('0x2e'),_0xedaf('0x2f')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x30')))),_0xedaf('0x31')],[db[_0xedaf('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x32')))),_0xedaf('0x33')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x23')))),_0xedaf('0x34')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db['sequelize']['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x35')))),_0xedaf('0x36')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')]['literal'](_0xedaf('0x37')))),_0xedaf('0x38')],[db[_0xedaf('0x1f')]['fn']('COUNT',db[_0xedaf('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xedaf('0x39')))),_0xedaf('0x3a')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')]['literal'](_0xedaf('0x3b')))),_0xedaf('0x3c')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x3d')))),_0xedaf('0x3e')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x3f')))),_0xedaf('0x40')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')]['literal'](_0xedaf('0x41')))),_0xedaf('0x42')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db['sequelize'][_0xedaf('0x22')](_0xedaf('0x43')))),_0xedaf('0x44')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db['sequelize']['fn']('IF',db[_0xedaf('0x1f')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xedaf('0x45')],[db['sequelize']['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xedaf('0x44')],[db['sequelize']['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x46')))),_0xedaf('0x47')]],'group':[_0xedaf('0x2e')]})[_0xedaf('0xe')](function(_0x592620){logger[_0xedaf('0xf')](_0xedaf('0x2d'),_0x3be411);logger['debug'](_0xedaf('0x2d'),_0x3be411,JSON[_0xedaf('0x11')](_0x592620));_0x20a731(_0x592620);})[_0xedaf('0x16')](function(_0x369d3f){logger[_0xedaf('0x12')](_0xedaf('0x2d'),_0x369d3f[_0xedaf('0x15')],_0x3be411);_0x4804f5(_0x309e6c[_0xedaf('0x12')](0x1f4,_0x369d3f['message']));});});};exports[_0xedaf('0x48')]=function(_0x2ee773){var _0x5d1ae7=this;return new Promise(function(_0xf480a5,_0x1505c4){return db[_0xedaf('0x17')][_0xedaf('0x1c')]({'raw':_0x2ee773['options']?_0x2ee773[_0xedaf('0x19')][_0xedaf('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ee773[_0xedaf('0x19')]?_0x2ee773[_0xedaf('0x19')][_0xedaf('0x1d')]||null:null,'attributes':[[_0xedaf('0x2e'),'name'],[db['sequelize']['fn'](_0xedaf('0x1e'),db[_0xedaf('0x1f')]['col']('id')),_0xedaf('0x49')],[db[_0xedaf('0x1f')]['fn'](_0xedaf('0x1e'),db['sequelize']['fn']('IF',db[_0xedaf('0x1f')][_0xedaf('0x22')](_0xedaf('0x23')))),_0xedaf('0x4a')]],'group':[_0xedaf('0x2e')]})[_0xedaf('0xe')](function(_0x2bc743){logger['info'](_0xedaf('0x48'),_0x2ee773);logger[_0xedaf('0x2c')]('GetCampaignHopperHistory',_0x2ee773,JSON[_0xedaf('0x11')](_0x2bc743));_0xf480a5(_0x2bc743);})['catch'](function(_0x1b64a6){logger[_0xedaf('0x12')](_0xedaf('0x48'),_0x1b64a6['message'],_0x2ee773);_0x1505c4(_0x5d1ae7[_0xedaf('0x12')](0x1f4,_0x1b64a6[_0xedaf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c9f3504..3e0498b 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 _0x80e8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports','multer','connect-timeout','fs-extra'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x80e8,0x1c8));var _0x880e=function(_0x44360b,_0x1cf437){_0x44360b=_0x44360b-0x0;var _0x51374a=_0x80e8[_0x44360b];return _0x51374a;};'use strict';var multer=require(_0x880e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x880e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x880e('0x2'));var auth=require(_0x880e('0x3'));var interaction=require(_0x880e('0x4'));var config=require(_0x880e('0x5'));var controller=require(_0x880e('0x6'));router[_0x880e('0x7')]('/',auth[_0x880e('0x8')](),controller[_0x880e('0x9')]);router[_0x880e('0x7')]('/describe',auth[_0x880e('0x8')](),controller['describe']);router[_0x880e('0x7')]('/:id',auth[_0x880e('0x8')](),controller[_0x880e('0xa')]);router[_0x880e('0xb')]('/',auth[_0x880e('0x8')](),controller[_0x880e('0xc')]);router[_0x880e('0xd')](_0x880e('0xe'),auth[_0x880e('0x8')](),controller[_0x880e('0xf')]);module[_0x880e('0x10')]=router; \ No newline at end of file +var _0x8269=['connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports','multer','path'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8269,0x154));var _0x9826=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x8269[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x9826('0x0'));var util=require('util');var path=require(_0x9826('0x1'));var timeout=require(_0x9826('0x2'));var express=require(_0x9826('0x3'));var router=express['Router']();var fs_extra=require(_0x9826('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9826('0x5'));var config=require('../../config/environment');var controller=require(_0x9826('0x6'));router['get']('/',auth[_0x9826('0x7')](),controller[_0x9826('0x8')]);router['get'](_0x9826('0x9'),auth[_0x9826('0x7')](),controller[_0x9826('0xa')]);router['get'](_0x9826('0xb'),auth[_0x9826('0x7')](),controller[_0x9826('0xc')]);router[_0x9826('0xd')]('/',auth[_0x9826('0x7')](),controller[_0x9826('0xe')]);router[_0x9826('0xf')](_0x9826('0xb'),auth[_0x9826('0x7')](),controller[_0x9826('0x10')]);module[_0x9826('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 893f57e..cd3c433 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 _0x27bf=['exports','STRING','name','sequelize'];(function(_0x20713b,_0x4312d4){var _0x98088b=function(_0xb0ce67){while(--_0xb0ce67){_0x20713b['push'](_0x20713b['shift']());}};_0x98088b(++_0x4312d4);}(_0x27bf,0x117));var _0xf27b=function(_0x57a0e3,_0x2bb951){_0x57a0e3=_0x57a0e3-0x0;var _0x14b30f=_0x27bf[_0x57a0e3];return _0x14b30f;};'use strict';var Sequelize=require(_0xf27b('0x0'));module[_0xf27b('0x1')]={'name':{'type':Sequelize[_0xf27b('0x2')],'unique':_0xf27b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf27b('0x2')]},'dialPrefix':{'type':Sequelize[_0xf27b('0x2')]}}; \ No newline at end of file +var _0xbe48=['name','sequelize','exports','STRING'];(function(_0x39c190,_0x237146){var _0x37b9b3=function(_0x178af6){while(--_0x178af6){_0x39c190['push'](_0x39c190['shift']());}};_0x37b9b3(++_0x237146);}(_0xbe48,0x121));var _0x8be4=function(_0x17428d,_0x23e52c){_0x17428d=_0x17428d-0x0;var _0xa66e0c=_0xbe48[_0x17428d];return _0xa66e0c;};'use strict';var Sequelize=require(_0x8be4('0x0'));module[_0x8be4('0x1')]={'name':{'type':Sequelize[_0x8be4('0x2')],'unique':_0x8be4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8be4('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 ab30e05..b72f2d2 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 _0x0a0b=['UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','CmList','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addContacts','CmContact','tags','isArray','join','each','omit','ids','success','push','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','fields','raw','getContactsCsv','now','writeFileSync','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','text','Sequelize','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','get','Lists'];(function(_0x1d3571,_0x3a0f3c){var _0x35ee75=function(_0x3214ab){while(--_0x3214ab){_0x1d3571['push'](_0x1d3571['shift']());}};_0x35ee75(++_0x3a0f3c);}(_0x0a0b,0xfd));var _0xb0a0=function(_0x2178d6,_0x5aa439){_0x2178d6=_0x2178d6-0x0;var _0x2c10ba=_0x0a0b[_0x2178d6];return _0x2c10ba;};'use strict';var emlformat=require(_0xb0a0('0x0'));var rimraf=require(_0xb0a0('0x1'));var zipdir=require(_0xb0a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0a0('0x3'));var moment=require(_0xb0a0('0x4'));var BPromise=require(_0xb0a0('0x5'));var Mustache=require(_0xb0a0('0x6'));var util=require(_0xb0a0('0x7'));var path=require(_0xb0a0('0x8'));var sox=require(_0xb0a0('0x9'));var csv=require(_0xb0a0('0xa'));var ejs=require(_0xb0a0('0xb'));var fs=require('fs');var fs_extra=require(_0xb0a0('0xc'));var _=require(_0xb0a0('0xd'));var squel=require(_0xb0a0('0xe'));var crypto=require(_0xb0a0('0xf'));var jsforce=require(_0xb0a0('0x10'));var deskjs=require(_0xb0a0('0x11'));var toCsv=require(_0xb0a0('0xa'));var querystring=require(_0xb0a0('0x12'));var Papa=require(_0xb0a0('0x13'));var Redis=require(_0xb0a0('0x14'));var authService=require(_0xb0a0('0x15'));var qs=require(_0xb0a0('0x16'));var as=require(_0xb0a0('0x17'));var hardwareService=require(_0xb0a0('0x18'));var logger=require(_0xb0a0('0x19'))(_0xb0a0('0x1a'));var utils=require(_0xb0a0('0x1b'));var config=require(_0xb0a0('0x1c'));var licenseUtil=require(_0xb0a0('0x1d'));var db=require(_0xb0a0('0x1e'))['db'];config[_0xb0a0('0x1f')]=_['defaults'](config[_0xb0a0('0x1f')],{'host':_0xb0a0('0x20'),'port':0x18eb});var socket=require(_0xb0a0('0x21'))(new Redis(config[_0xb0a0('0x1f')]));require(_0xb0a0('0x22'))[_0xb0a0('0x23')](socket);function respondWithStatusCode(_0x30bb90,_0x59a9d8){_0x59a9d8=_0x59a9d8||0xcc;return function(_0xa49396){if(_0xa49396){return _0x30bb90[_0xb0a0('0x24')](_0x59a9d8);}return _0x30bb90[_0xb0a0('0x25')](_0x59a9d8)[_0xb0a0('0x26')]();};}function respondWithResult(_0x1f35fc,_0x4644d5){_0x4644d5=_0x4644d5||0xc8;return function(_0x1bf5b1){if(_0x1bf5b1){return _0x1f35fc[_0xb0a0('0x25')](_0x4644d5)[_0xb0a0('0x27')](_0x1bf5b1);}};}function respondWithFilteredResult(_0x91a966,_0x116ca1){return function(_0x47de71){if(_0x47de71){var _0x87fed1=typeof _0x116ca1['offset']===_0xb0a0('0x28')&&typeof _0x116ca1[_0xb0a0('0x29')]===_0xb0a0('0x28');var _0x8fd591=_0x47de71[_0xb0a0('0x2a')];var _0x3fa9f1=_0x87fed1?0x0:_0x116ca1[_0xb0a0('0x2b')];var _0x5200d2=_0x87fed1?_0x47de71[_0xb0a0('0x2a')]:_0x116ca1['offset']+_0x116ca1[_0xb0a0('0x29')];var _0x5193b1;if(_0x5200d2>=_0x8fd591){_0x5200d2=_0x8fd591;_0x5193b1=0xc8;}else{_0x5193b1=0xce;}_0x91a966['status'](_0x5193b1);return _0x91a966['set'](_0xb0a0('0x2c'),_0x3fa9f1+'-'+_0x5200d2+'/'+_0x8fd591)[_0xb0a0('0x27')](_0x47de71);}return null;};}function patchUpdates(_0x3b162b){return function(_0x2e4a11){try{jsonpatch['apply'](_0x2e4a11,_0x3b162b,!![]);}catch(_0x36a54a){return BPromise[_0xb0a0('0x2d')](_0x36a54a);}return _0x2e4a11[_0xb0a0('0x2e')]();};}function saveUpdates(_0x58e083,_0x196de6){return function(_0x39175d){if(_0x39175d){return _0x39175d[_0xb0a0('0x2f')](_0x58e083)[_0xb0a0('0x30')](function(_0x1e9b24){return _0x1e9b24;});}return null;};}function removeEntity(_0x4431b9,_0x6efd4b){return function(_0x450f64){if(_0x450f64){return _0x450f64['destroy']()[_0xb0a0('0x30')](function(){var _0x1a960c=_0x450f64[_0xb0a0('0x31')]({'plain':!![]});var _0x243a77=_0xb0a0('0x32');return db[_0xb0a0('0x33')]['destroy']({'where':{'type':_0x243a77,'resourceId':_0x1a960c['id']}})[_0xb0a0('0x30')](function(){return _0x450f64;});})[_0xb0a0('0x30')](function(){_0x4431b9[_0xb0a0('0x25')](0xcc)[_0xb0a0('0x26')]();});}};}function handleEntityNotFound(_0x36ef1f,_0x721d3){return function(_0x28b7f4){if(!_0x28b7f4){_0x36ef1f['sendStatus'](0x194);}return _0x28b7f4;};}function handleError(_0x36a8f4,_0x4da8d0){_0x4da8d0=_0x4da8d0||0x1f4;return function(_0x5918c8){logger[_0xb0a0('0x34')](_0x5918c8[_0xb0a0('0x35')]);if(_0x5918c8[_0xb0a0('0x36')]){delete _0x5918c8['name'];}_0x36a8f4[_0xb0a0('0x25')](_0x4da8d0)[_0xb0a0('0x37')](_0x5918c8);};}exports[_0xb0a0('0x38')]=function(_0x53a511,_0x236377){var _0x36fda1={},_0x5c22e3={},_0x268625={'count':0x0,'rows':[]};var _0x431675=_['map'](db['CmList']['rawAttributes'],function(_0x59047d){return{'name':_0x59047d[_0xb0a0('0x39')],'type':_0x59047d[_0xb0a0('0x3a')][_0xb0a0('0x3b')]};});_0x5c22e3[_0xb0a0('0x3c')]=_[_0xb0a0('0x3d')](_0x431675,_0xb0a0('0x36'));_0x5c22e3['query']=_[_0xb0a0('0x3e')](_0x53a511[_0xb0a0('0x3f')]);_0x5c22e3[_0xb0a0('0x40')]=_[_0xb0a0('0x41')](_0x5c22e3[_0xb0a0('0x3c')],_0x5c22e3['query']);_0x36fda1[_0xb0a0('0x42')]=_[_0xb0a0('0x41')](_0x5c22e3['model'],qs['fields'](_0x53a511[_0xb0a0('0x3f')]['fields']));_0x36fda1[_0xb0a0('0x42')]=_0x36fda1[_0xb0a0('0x42')]['length']?_0x36fda1['attributes']:_0x5c22e3[_0xb0a0('0x3c')];if(!_0x53a511['query'][_0xb0a0('0x43')]('nolimit')){_0x36fda1[_0xb0a0('0x29')]=qs[_0xb0a0('0x29')](_0x53a511[_0xb0a0('0x3f')][_0xb0a0('0x29')]);_0x36fda1[_0xb0a0('0x2b')]=qs[_0xb0a0('0x2b')](_0x53a511['query'][_0xb0a0('0x2b')]);}_0x36fda1[_0xb0a0('0x44')]=qs[_0xb0a0('0x45')](_0x53a511[_0xb0a0('0x3f')][_0xb0a0('0x45')]);_0x36fda1[_0xb0a0('0x46')]=qs['filters'](_[_0xb0a0('0x47')](_0x53a511['query'],_0x5c22e3[_0xb0a0('0x40')]),_0x431675);if(_0x53a511[_0xb0a0('0x3f')][_0xb0a0('0x48')]){_0x36fda1[_0xb0a0('0x46')]=_['merge'](_0x36fda1[_0xb0a0('0x46')],{'$or':_[_0xb0a0('0x3d')](_0x431675,function(_0x2d8c9d){if(_0x2d8c9d[_0xb0a0('0x3a')]!==_0xb0a0('0x49')){var _0x502d53={};_0x502d53[_0x2d8c9d[_0xb0a0('0x36')]]={'$like':'%'+_0x53a511[_0xb0a0('0x3f')]['filter']+'%'};return _0x502d53;}})});}_0x36fda1=_[_0xb0a0('0x4a')]({},_0x36fda1,_0x53a511[_0xb0a0('0x4b')]);var _0x50f4c9={'where':_0x36fda1['where']};return db[_0xb0a0('0x4c')][_0xb0a0('0x2a')](_0x50f4c9)[_0xb0a0('0x30')](function(_0x195062){_0x268625[_0xb0a0('0x2a')]=_0x195062;if(_0x53a511[_0xb0a0('0x3f')][_0xb0a0('0x4d')]){_0x36fda1['include']=[{'all':!![]}];}return db[_0xb0a0('0x4c')][_0xb0a0('0x4e')](_0x36fda1);})[_0xb0a0('0x30')](function(_0x741a9d){_0x268625[_0xb0a0('0x4f')]=_0x741a9d;return _0x268625;})['then'](respondWithFilteredResult(_0x236377,_0x36fda1))['catch'](handleError(_0x236377,null));};exports[_0xb0a0('0x50')]=function(_0x5d52df,_0x8fb9f5){var _0xb42d56={'raw':![],'where':{'id':_0x5d52df[_0xb0a0('0x51')]['id']}},_0x362516={};_0x362516[_0xb0a0('0x3c')]=_['keys'](db[_0xb0a0('0x4c')][_0xb0a0('0x52')]);_0x362516[_0xb0a0('0x3f')]=_[_0xb0a0('0x3e')](_0x5d52df['query']);_0x362516[_0xb0a0('0x40')]=_[_0xb0a0('0x41')](_0x362516[_0xb0a0('0x3c')],_0x362516[_0xb0a0('0x3f')]);_0xb42d56[_0xb0a0('0x42')]=_[_0xb0a0('0x41')](_0x362516[_0xb0a0('0x3c')],qs['fields'](_0x5d52df[_0xb0a0('0x3f')]['fields']));_0xb42d56[_0xb0a0('0x42')]=_0xb42d56[_0xb0a0('0x42')][_0xb0a0('0x53')]?_0xb42d56[_0xb0a0('0x42')]:_0x362516[_0xb0a0('0x3c')];if(_0x5d52df[_0xb0a0('0x3f')]['includeAll']){_0xb42d56[_0xb0a0('0x54')]=[{'all':!![]}];}_0xb42d56=_[_0xb0a0('0x4a')]({},_0xb42d56,_0x5d52df[_0xb0a0('0x4b')]);return db['CmList'][_0xb0a0('0x55')](_0xb42d56)['then'](handleEntityNotFound(_0x8fb9f5,null))[_0xb0a0('0x30')](respondWithResult(_0x8fb9f5,null))[_0xb0a0('0x56')](handleError(_0x8fb9f5,null));};exports[_0xb0a0('0x57')]=function(_0x4ec1a0,_0x31373b){return db[_0xb0a0('0x4c')][_0xb0a0('0x57')](_0x4ec1a0['body'],{})[_0xb0a0('0x30')](function(_0x444b23){var _0x131670=_0x4ec1a0[_0xb0a0('0x58')][_0xb0a0('0x31')]({'plain':!![]});if(!_0x131670)throw new Error(_0xb0a0('0x59'));if(_0x131670[_0xb0a0('0x5a')]===_0xb0a0('0x58')){var _0x20e917=_0x444b23['get']({'plain':!![]});var _0x1a5b51='Lists';return db[_0xb0a0('0x5b')][_0xb0a0('0x55')]({'where':{'name':_0x1a5b51,'userProfileId':_0x131670['userProfileId']},'raw':!![]})['then'](function(_0x2a30bc){if(_0x2a30bc&&_0x2a30bc[_0xb0a0('0x5c')]===0x0){return db[_0xb0a0('0x33')][_0xb0a0('0x57')]({'name':_0x20e917[_0xb0a0('0x36')],'resourceId':_0x20e917['id'],'type':_0x2a30bc[_0xb0a0('0x36')],'sectionId':_0x2a30bc['id']},{})[_0xb0a0('0x30')](function(){return _0x444b23;});}else{return _0x444b23;}})[_0xb0a0('0x56')](function(_0x57b2f6){logger[_0xb0a0('0x34')](_0xb0a0('0x5d'),_0x57b2f6);throw _0x57b2f6;});}return _0x444b23;})[_0xb0a0('0x30')](respondWithResult(_0x31373b,0xc9))[_0xb0a0('0x56')](handleError(_0x31373b,null));};exports[_0xb0a0('0x2f')]=function(_0x7b9ff7,_0x84c126){if(_0x7b9ff7[_0xb0a0('0x5e')]['id']){delete _0x7b9ff7[_0xb0a0('0x5e')]['id'];}return db[_0xb0a0('0x4c')]['find']({'where':{'id':_0x7b9ff7['params']['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x84c126,null))[_0xb0a0('0x30')](saveUpdates(_0x7b9ff7[_0xb0a0('0x5e')],null))['then'](respondWithResult(_0x84c126,null))[_0xb0a0('0x56')](handleError(_0x84c126,null));};exports[_0xb0a0('0x5f')]=function(_0x1b2dfa,_0xef002a){return db['CmList'][_0xb0a0('0x55')]({'where':{'id':_0x1b2dfa[_0xb0a0('0x51')]['id']}})['then'](handleEntityNotFound(_0xef002a,null))[_0xb0a0('0x30')](removeEntity(_0xef002a,null))['catch'](handleError(_0xef002a,null));};exports[_0xb0a0('0x60')]=function(_0xb6b35c,_0x4e559f){return db['CmList'][_0xb0a0('0x60')]()[_0xb0a0('0x30')](respondWithResult(_0x4e559f,null))[_0xb0a0('0x56')](handleError(_0x4e559f,null));};exports[_0xb0a0('0x61')]=function(_0x1102ca,_0x4e2fb3,_0x2c624f){if(_0x1102ca[_0xb0a0('0x5e')]['id']){delete _0x1102ca[_0xb0a0('0x5e')]['id'];}return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x1102ca[_0xb0a0('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e2fb3,null))['then'](function(_0x51f0fd){if(_0x51f0fd){_0x1102ca[_0xb0a0('0x5e')][_0xb0a0('0x62')]=_0x51f0fd['id'];return db[_0xb0a0('0x63')][_0xb0a0('0x57')](_0x1102ca[_0xb0a0('0x5e')]);}})[_0xb0a0('0x30')](respondWithResult(_0x4e2fb3,null))[_0xb0a0('0x56')](handleError(_0x4e2fb3,null));};exports[_0xb0a0('0x64')]=function(_0x245d0d,_0x13010a,_0x55b2ba){var _0x1e2975={'raw':![],'where':{}};var _0x533cd0={};var _0xcc4ea1={'count':0x0,'rows':[]};return db[_0xb0a0('0x4c')][_0xb0a0('0x65')]({'where':{'id':_0x245d0d[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x13010a,null))[_0xb0a0('0x30')](function(_0x2d0a5b){if(_0x2d0a5b){_0x533cd0[_0xb0a0('0x3c')]=_[_0xb0a0('0x3e')](db['Disposition'][_0xb0a0('0x52')]);_0x533cd0['query']=_[_0xb0a0('0x3e')](_0x245d0d[_0xb0a0('0x3f')]);_0x533cd0[_0xb0a0('0x40')]=_['intersection'](_0x533cd0[_0xb0a0('0x3c')],_0x533cd0[_0xb0a0('0x3f')]);_0x1e2975['attributes']=_[_0xb0a0('0x41')](_0x533cd0[_0xb0a0('0x3c')],qs['fields'](_0x245d0d[_0xb0a0('0x3f')]['fields']));_0x1e2975[_0xb0a0('0x42')]=_0x1e2975['attributes']['length']?_0x1e2975[_0xb0a0('0x42')]:_0x533cd0[_0xb0a0('0x3c')];if(!_0x245d0d[_0xb0a0('0x3f')][_0xb0a0('0x43')](_0xb0a0('0x66'))){_0x1e2975[_0xb0a0('0x29')]=qs['limit'](_0x245d0d['query']['limit']);_0x1e2975[_0xb0a0('0x2b')]=qs[_0xb0a0('0x2b')](_0x245d0d[_0xb0a0('0x3f')][_0xb0a0('0x2b')]);}_0x1e2975[_0xb0a0('0x44')]=qs[_0xb0a0('0x45')](_0x245d0d[_0xb0a0('0x3f')][_0xb0a0('0x45')]);_0x1e2975[_0xb0a0('0x46')]=qs[_0xb0a0('0x40')](_[_0xb0a0('0x47')](_0x245d0d['query'],_0x533cd0[_0xb0a0('0x40')]));_0x1e2975[_0xb0a0('0x46')][_0xb0a0('0x62')]=_0x2d0a5b['id'];if(_0x245d0d[_0xb0a0('0x3f')][_0xb0a0('0x48')]){_0x1e2975[_0xb0a0('0x46')]=_['merge'](_0x1e2975[_0xb0a0('0x46')],{'$or':_[_0xb0a0('0x3d')](_0x1e2975[_0xb0a0('0x42')],function(_0xb42df3){var _0x4c5c99={};_0x4c5c99[_0xb42df3]={'$like':'%'+_0x245d0d[_0xb0a0('0x3f')][_0xb0a0('0x48')]+'%'};return _0x4c5c99;})});}_0x1e2975=_[_0xb0a0('0x4a')]({},_0x1e2975,_0x245d0d[_0xb0a0('0x4b')]);return db[_0xb0a0('0x63')][_0xb0a0('0x2a')]({'where':_0x1e2975[_0xb0a0('0x46')]})[_0xb0a0('0x30')](function(_0x4b3d66){_0xcc4ea1[_0xb0a0('0x2a')]=_0x4b3d66;if(_0x245d0d[_0xb0a0('0x3f')]['includeAll']){_0x1e2975[_0xb0a0('0x54')]=[{'all':!![]}];}return db[_0xb0a0('0x63')][_0xb0a0('0x4e')](_0x1e2975);})['then'](function(_0x4337e9){_0xcc4ea1[_0xb0a0('0x4f')]=_0x4337e9;return _0xcc4ea1;});}})[_0xb0a0('0x30')](respondWithFilteredResult(_0x13010a,_0x1e2975))['catch'](handleError(_0x13010a,null));};exports[_0xb0a0('0x67')]=function(_0x13583c,_0x573dc6,_0xde0d9){return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x13583c[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x573dc6,null))['then'](function(_0x9bc216){if(_0x9bc216){return _0x9bc216[_0xb0a0('0x67')](_0x13583c[_0xb0a0('0x3f')]['ids']);}})[_0xb0a0('0x30')](respondWithStatusCode(_0x573dc6,null))['catch'](handleError(_0x573dc6,null));};exports[_0xb0a0('0x68')]=function(_0x4eb3c5,_0x3ffaa6,_0x5b126f){return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x4eb3c5['params']['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x3ffaa6,null))['then'](function(_0x5dcd33){if(_0x5dcd33){var _0x54e0e7=[];var _0x18de5f={'success':[],'errors':[]};return db[_0xb0a0('0x69')][_0xb0a0('0x60')]()[_0xb0a0('0x30')](function(_0xbc29e0){if(_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x6a')]&&_[_0xb0a0('0x6b')](_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x6a')])){if(_0x4eb3c5[_0xb0a0('0x5e')]['tags'][_0xb0a0('0x53')]){_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x6a')]=_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x6a')][_0xb0a0('0x6c')](';')+';';}else{_0x4eb3c5['body'][_0xb0a0('0x6a')]=null;}}else{_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x6a')]=null;}if(_0x4eb3c5[_0xb0a0('0x5e')]&&_['isArray'](_0x4eb3c5[_0xb0a0('0x5e')])){for(var _0xc9bef2=0x0;_0xc9bef2<_0x4eb3c5[_0xb0a0('0x5e')][_0xb0a0('0x53')];_0xc9bef2+=0x1){_0x4eb3c5[_0xb0a0('0x5e')][_0xc9bef2][_0xb0a0('0x62')]=_0x4eb3c5[_0xb0a0('0x51')]['id'];_0x54e0e7['push'](_0x4eb3c5[_0xb0a0('0x5e')][_0xc9bef2]);}return BPromise[_0xb0a0('0x6d')](_0x54e0e7,function(_0x4c39d8){return db['CmContact'][_0xb0a0('0x57')](_[_0xb0a0('0x6e')](_0x4c39d8,[_0xb0a0('0x6f'),'id'])||{},{'fields':_[_0xb0a0('0x3e')](_0xbc29e0),'raw':!![]})[_0xb0a0('0x30')](function(_0x562031){_0x18de5f[_0xb0a0('0x70')][_0xb0a0('0x71')](_0x562031[_0xb0a0('0x72')]);})[_0xb0a0('0x56')](function(_0x2db430){_0x18de5f[_0xb0a0('0x73')][_0xb0a0('0x71')]({'data':_0x4c39d8,'error':_0x2db430[_0xb0a0('0x74')]});});})[_0xb0a0('0x30')](function(_0x1eeedf){return _0x18de5f;})[_0xb0a0('0x56')](function(_0x364aa1){return _0x364aa1;});}else{_0x3ffaa6[_0xb0a0('0x25')](0x190)[_0xb0a0('0x27')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xb0a0('0x30')](respondWithResult(_0x3ffaa6,null))['catch'](handleError(_0x3ffaa6,null));};exports[_0xb0a0('0x75')]=function(_0x436c8e,_0x9c99a6,_0x1a46d5){var _0x584d4b;return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x436c8e[_0xb0a0('0x51')]['id']},'include':[{'model':db[_0xb0a0('0x76')],'as':_0xb0a0('0x77')}]})[_0xb0a0('0x30')](handleEntityNotFound(_0x9c99a6,null))[_0xb0a0('0x30')](function(_0x3464d3){if(_0x3464d3){_0x584d4b=_0x3464d3;return db[_0xb0a0('0x69')][_0xb0a0('0x52')];}})[_0xb0a0('0x30')](function(_0xd5ab12){if(_0xd5ab12){var _0x2309c8={};var _0x20e710={};_0x20e710['model']=_[_0xb0a0('0x78')](_[_0xb0a0('0x3e')](_0xd5ab12),_[_0xb0a0('0x3d')](_0x584d4b['CustomFields'],function(_0x34123c){return util[_0xb0a0('0x79')](_0xb0a0('0x7a'),_0x34123c['id']);}));_0x20e710[_0xb0a0('0x3f')]=_[_0xb0a0('0x3e')](_0x436c8e[_0xb0a0('0x3f')]);_0x20e710[_0xb0a0('0x40')]=_['intersection'](_0x20e710[_0xb0a0('0x3c')],_0x20e710['query']);_0x2309c8[_0xb0a0('0x42')]=_[_0xb0a0('0x41')](_0x20e710[_0xb0a0('0x3c')],qs[_0xb0a0('0x7b')](_0x436c8e[_0xb0a0('0x3f')][_0xb0a0('0x7b')]));_0x2309c8[_0xb0a0('0x42')]=_0x2309c8['attributes'][_0xb0a0('0x53')]?_0x2309c8['attributes']:_0x20e710['model'];if(!_0x436c8e[_0xb0a0('0x3f')]['hasOwnProperty']('nolimit')){_0x2309c8['limit']=qs[_0xb0a0('0x29')](_0x436c8e[_0xb0a0('0x3f')][_0xb0a0('0x29')]);_0x2309c8[_0xb0a0('0x2b')]=qs['offset'](_0x436c8e[_0xb0a0('0x3f')][_0xb0a0('0x2b')]);}_0x2309c8['order']=qs[_0xb0a0('0x45')](_0x436c8e['query'][_0xb0a0('0x45')]);_0x2309c8[_0xb0a0('0x46')]=qs['filters'](_[_0xb0a0('0x47')](_0x436c8e[_0xb0a0('0x3f')],_0x20e710[_0xb0a0('0x40')]));_0x2309c8[_0xb0a0('0x7c')]=!![];if(_0x436c8e[_0xb0a0('0x3f')][_0xb0a0('0x48')]){_0x2309c8['where']=_['merge'](_0x2309c8[_0xb0a0('0x46')],{'$or':_[_0xb0a0('0x3d')](_0x2309c8[_0xb0a0('0x42')],function(_0x2e53f6){var _0xbdfead={};_0xbdfead[_0x2e53f6]={'$like':'%'+_0x436c8e[_0xb0a0('0x3f')]['filter']+'%'};return _0xbdfead;})});}_0x2309c8=_[_0xb0a0('0x4a')]({},_0x2309c8,_0x436c8e[_0xb0a0('0x4b')]);return _0x584d4b['getContacts'](_0x2309c8);}})['then'](respondWithResult(_0x9c99a6,null))['catch'](handleError(_0x9c99a6,null));};exports[_0xb0a0('0x7d')]=function(_0x256a29,_0x111d3e,_0x43167a){var _0x48de6a;return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x256a29[_0xb0a0('0x51')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xb0a0('0x77')}]})[_0xb0a0('0x30')](handleEntityNotFound(_0x111d3e,null))['then'](function(_0xc31d75){if(_0xc31d75){_0x48de6a=_0xc31d75;return db[_0xb0a0('0x69')][_0xb0a0('0x52')];}})['then'](function(_0x4af6cf){if(_0x4af6cf){var _0x108d77={};var _0x2350c6={};_0x2350c6['model']=_[_0xb0a0('0x78')](_[_0xb0a0('0x3e')](_0x4af6cf),_[_0xb0a0('0x3d')](_0x48de6a['CustomFields'],function(_0x5f509a){return util['format'](_0xb0a0('0x7a'),_0x5f509a['id']);}));_0x2350c6[_0xb0a0('0x3f')]=_[_0xb0a0('0x3e')](_0x256a29[_0xb0a0('0x3f')]);_0x2350c6[_0xb0a0('0x40')]=_[_0xb0a0('0x41')](_0x2350c6['model'],_0x2350c6[_0xb0a0('0x3f')]);_0x108d77[_0xb0a0('0x42')]=_[_0xb0a0('0x41')](_0x2350c6[_0xb0a0('0x3c')],qs['fields'](_0x256a29['query'][_0xb0a0('0x7b')]));_0x108d77['attributes']=_0x108d77[_0xb0a0('0x42')][_0xb0a0('0x53')]?_0x108d77[_0xb0a0('0x42')]:_0x2350c6[_0xb0a0('0x3c')];if(!_0x256a29['query'][_0xb0a0('0x43')]('nolimit')){_0x108d77[_0xb0a0('0x29')]=qs[_0xb0a0('0x29')](_0x256a29[_0xb0a0('0x3f')]['limit']);_0x108d77['offset']=qs[_0xb0a0('0x2b')](_0x256a29[_0xb0a0('0x3f')][_0xb0a0('0x2b')]);}_0x108d77[_0xb0a0('0x44')]=qs[_0xb0a0('0x45')](_0x256a29[_0xb0a0('0x3f')][_0xb0a0('0x45')]);_0x108d77[_0xb0a0('0x46')]=qs[_0xb0a0('0x40')](_[_0xb0a0('0x47')](_0x256a29[_0xb0a0('0x3f')],_0x2350c6[_0xb0a0('0x40')]));_0x108d77[_0xb0a0('0x7c')]=!![];if(_0x256a29['query'][_0xb0a0('0x48')]){_0x108d77[_0xb0a0('0x46')]=_[_0xb0a0('0x4a')](_0x108d77[_0xb0a0('0x46')],{'$or':_['map'](_0x108d77[_0xb0a0('0x42')],function(_0x29813b){var _0x10e1b5={};_0x10e1b5[_0x29813b]={'$like':'%'+_0x256a29[_0xb0a0('0x3f')][_0xb0a0('0x48')]+'%'};return _0x10e1b5;})});}_0x108d77=_[_0xb0a0('0x4a')]({},_0x108d77,_0x256a29[_0xb0a0('0x4b')]);return _0x48de6a['getContacts'](_0x108d77);}})[_0xb0a0('0x30')](function(_0xab57a4){if(!_['isEmpty'](_0xab57a4)){var _0x53544c=toCsv(_0xab57a4);var _0x2956be=Date[_0xb0a0('0x7e')]();fs[_0xb0a0('0x7f')](util[_0xb0a0('0x79')]('/tmp/list_%d_%s.csv',_0x48de6a['id'],_0x2956be),_0x53544c);_0x111d3e['setHeader'](_0xb0a0('0x80'),_0xb0a0('0x81')+util[_0xb0a0('0x79')]('list_%d_%s.csv',_0x48de6a['id'],_0x2956be));_0x111d3e[_0xb0a0('0x82')](_0xb0a0('0x83'),_0xb0a0('0x84'));return _0x111d3e[_0xb0a0('0x85')](util[_0xb0a0('0x79')]('/tmp/list_%d_%s.csv',_0x48de6a['id'],_0x2956be));}else{return _0x111d3e[_0xb0a0('0x24')](0xcc);}})[_0xb0a0('0x56')](handleError(_0x111d3e,null));};exports['addCustomField']=function(_0x42b8ee,_0x4d4769,_0x429df6){var _0x25a88a;delete _0x42b8ee[_0xb0a0('0x5e')]['id'];return db[_0xb0a0('0x4c')][_0xb0a0('0x65')]({'where':{'id':_0x42b8ee[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x4d4769,null))[_0xb0a0('0x30')](function(_0x1fe26a){if(_0x1fe26a){return db['sequelize']['transaction'](function(_0x4ac798){return db[_0xb0a0('0x76')]['create'](_0x42b8ee[_0xb0a0('0x5e')],{'transaction':_0x4ac798})[_0xb0a0('0x30')](function(_0x2b6335){_0x25a88a=_0x2b6335;return _0x1fe26a['addCustomFields'](_0x2b6335,{'transaction':_0x4ac798});})['then'](function(){var _0x573a9b={'type':db['Sequelize']['TEXT'],'transaction':_0x4ac798};switch(_0x42b8ee[_0xb0a0('0x5e')][_0xb0a0('0x3a')]){case _0xb0a0('0x86'):_0x573a9b[_0xb0a0('0x3a')]=db[_0xb0a0('0x87')]['TEXT'];break;case _0xb0a0('0x88'):_0x573a9b[_0xb0a0('0x3a')]=db[_0xb0a0('0x87')]['INTEGER'];break;case _0xb0a0('0x89'):_0x573a9b[_0xb0a0('0x3a')]=db['Sequelize'][_0xb0a0('0x8a')];_0x573a9b[_0xb0a0('0x8b')]=![];break;default:}return db[_0xb0a0('0x8c')][_0xb0a0('0x8d')][_0xb0a0('0x8e')](_0xb0a0('0x8f'),util['format'](_0xb0a0('0x90'),_0x25a88a['id']),_0x573a9b);})[_0xb0a0('0x30')](function(){return _0x25a88a;});});}})[_0xb0a0('0x30')](respondWithResult(_0x4d4769,null))[_0xb0a0('0x56')](handleError(_0x4d4769,null));};exports[_0xb0a0('0x91')]=function(_0x4cd1ac,_0x40c546,_0x29e7b9){var _0x36389b={};var _0x4493cd={};var _0x3794a1;var _0x45332f;return db[_0xb0a0('0x4c')]['findOne']({'where':{'id':_0x4cd1ac[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x40c546,null))[_0xb0a0('0x30')](function(_0xebe6fe){if(_0xebe6fe){_0x3794a1=_0xebe6fe;_0x4493cd[_0xb0a0('0x3c')]=_['keys'](db[_0xb0a0('0x76')][_0xb0a0('0x52')]);_0x4493cd[_0xb0a0('0x3f')]=_[_0xb0a0('0x3e')](_0x4cd1ac[_0xb0a0('0x3f')]);_0x4493cd[_0xb0a0('0x40')]=_['intersection'](_0x4493cd[_0xb0a0('0x3c')],_0x4493cd[_0xb0a0('0x3f')]);_0x36389b[_0xb0a0('0x42')]=_['intersection'](_0x4493cd[_0xb0a0('0x3c')],qs[_0xb0a0('0x7b')](_0x4cd1ac[_0xb0a0('0x3f')][_0xb0a0('0x7b')]));_0x36389b[_0xb0a0('0x42')]=_0x36389b[_0xb0a0('0x42')][_0xb0a0('0x53')]?_0x36389b['attributes']:_0x4493cd[_0xb0a0('0x3c')];_0x36389b[_0xb0a0('0x44')]=qs[_0xb0a0('0x45')](_0x4cd1ac[_0xb0a0('0x3f')][_0xb0a0('0x45')]);_0x36389b['where']=qs[_0xb0a0('0x40')](_[_0xb0a0('0x47')](_0x4cd1ac[_0xb0a0('0x3f')],_0x4493cd[_0xb0a0('0x40')]));_0x36389b[_0xb0a0('0x46')]=_[_0xb0a0('0x4a')](_0x36389b[_0xb0a0('0x46')],{'$or':[{'ListId':_0xebe6fe['id']},{'ListId':null}]});if(_0x4cd1ac[_0xb0a0('0x3f')][_0xb0a0('0x48')]){_0x36389b['where']=_[_0xb0a0('0x4a')](_0x36389b[_0xb0a0('0x46')],{'$or':_[_0xb0a0('0x3d')](_0x36389b[_0xb0a0('0x42')],function(_0x51a581){var _0x36757b={};_0x36757b[_0x51a581]={'$like':'%'+_0x4cd1ac[_0xb0a0('0x3f')][_0xb0a0('0x48')]+'%'};return _0x36757b;})});}_0x36389b=_['merge']({},_0x36389b,_0x4cd1ac['options']);return db[_0xb0a0('0x76')]['findAndCountAll'](_0x36389b);}})['then'](respondWithResult(_0x40c546,null))['catch'](handleError(_0x40c546,null));};exports['addAgents']=function(_0x3385c,_0x3fb1ed,_0x50f69e){return db['CmList'][_0xb0a0('0x55')]({'where':{'id':_0x3385c['params']['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x3fb1ed,null))[_0xb0a0('0x30')](function(_0x3d29da){if(_0x3d29da){return _0x3d29da['addAgents'](_0x3385c['body'][_0xb0a0('0x6f')],_[_0xb0a0('0x6e')](_0x3385c['body'],[_0xb0a0('0x6f'),'id'])||{})['spread'](function(_0x168d6a){for(var _0x1921b9=0x0;_0x1921b9<_0x3385c[_0xb0a0('0x5e')][_0xb0a0('0x6f')]['length'];_0x1921b9+=0x1){socket[_0xb0a0('0x92')](_0xb0a0('0x93'),{'UserId':Number(_0x3385c[_0xb0a0('0x5e')]['ids'][_0x1921b9]),'CmListId':Number(_0x3385c[_0xb0a0('0x51')]['id'])});}return _0x168d6a;});}})['then'](respondWithResult(_0x3fb1ed,null))[_0xb0a0('0x56')](handleError(_0x3fb1ed,null));};exports[_0xb0a0('0x94')]=function(_0x446390,_0x44599d,_0x2d6bed){return db[_0xb0a0('0x4c')][_0xb0a0('0x55')]({'where':{'id':_0x446390[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x44599d,null))['then'](function(_0xad1f74){if(_0xad1f74){return _0xad1f74[_0xb0a0('0x94')](_0x446390[_0xb0a0('0x3f')][_0xb0a0('0x6f')])['then'](function(){if(_['isArray'](_0x446390[_0xb0a0('0x3f')]['ids'])){for(var _0x3d125e=0x0;_0x3d125e<_0x446390['query']['ids'][_0xb0a0('0x53')];_0x3d125e+=0x1){socket[_0xb0a0('0x92')](_0xb0a0('0x95'),{'UserId':Number(_0x446390[_0xb0a0('0x3f')][_0xb0a0('0x6f')][_0x3d125e]),'CmListId':Number(_0x446390[_0xb0a0('0x51')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x446390[_0xb0a0('0x3f')]['ids']),'CmListId':Number(_0x446390[_0xb0a0('0x51')]['id'])});}});}})[_0xb0a0('0x30')](respondWithStatusCode(_0x44599d,null))[_0xb0a0('0x56')](handleError(_0x44599d,null));};exports[_0xb0a0('0x96')]=function(_0x147c2d,_0x3a382e,_0x54c2b5){var _0x342aa6={};var _0x18c427={};var _0xff8f9d;var _0x435279;return db['CmList'][_0xb0a0('0x65')]({'where':{'id':_0x147c2d[_0xb0a0('0x51')]['id']}})[_0xb0a0('0x30')](handleEntityNotFound(_0x3a382e,null))[_0xb0a0('0x30')](function(_0x293132){if(_0x293132){_0xff8f9d=_0x293132;_0x18c427[_0xb0a0('0x3c')]=_[_0xb0a0('0x3e')](db[_0xb0a0('0x97')][_0xb0a0('0x52')]);_0x18c427['query']=_[_0xb0a0('0x3e')](_0x147c2d[_0xb0a0('0x3f')]);_0x18c427['filters']=_[_0xb0a0('0x41')](_0x18c427[_0xb0a0('0x3c')],_0x18c427[_0xb0a0('0x3f')]);_0x342aa6[_0xb0a0('0x42')]=_['intersection'](_0x18c427[_0xb0a0('0x3c')],qs[_0xb0a0('0x7b')](_0x147c2d[_0xb0a0('0x3f')]['fields']));_0x342aa6[_0xb0a0('0x42')]=_0x342aa6[_0xb0a0('0x42')][_0xb0a0('0x53')]?_0x342aa6[_0xb0a0('0x42')]:_0x18c427[_0xb0a0('0x3c')];_0x342aa6['order']=qs[_0xb0a0('0x45')](_0x147c2d[_0xb0a0('0x3f')][_0xb0a0('0x45')]);_0x342aa6[_0xb0a0('0x46')]=qs[_0xb0a0('0x40')](_['pick'](_0x147c2d[_0xb0a0('0x3f')],_0x18c427[_0xb0a0('0x40')]));if(_0x147c2d[_0xb0a0('0x3f')][_0xb0a0('0x48')]){_0x342aa6['where']=_[_0xb0a0('0x4a')](_0x342aa6[_0xb0a0('0x46')],{'$or':_['map'](_0x342aa6['attributes'],function(_0x3a84f4){var _0xa4f6c7={};_0xa4f6c7[_0x3a84f4]={'$like':'%'+_0x147c2d['query'][_0xb0a0('0x48')]+'%'};return _0xa4f6c7;})});}_0x342aa6=_[_0xb0a0('0x4a')]({},_0x342aa6,_0x147c2d[_0xb0a0('0x4b')]);return _0xff8f9d[_0xb0a0('0x96')](_0x342aa6);}})[_0xb0a0('0x30')](function(_0x2a454c){if(_0x2a454c){_0x435279=_0x2a454c[_0xb0a0('0x53')];if(!_0x147c2d['query'][_0xb0a0('0x43')](_0xb0a0('0x66'))){_0x342aa6[_0xb0a0('0x29')]=qs[_0xb0a0('0x29')](_0x147c2d[_0xb0a0('0x3f')][_0xb0a0('0x29')]);_0x342aa6[_0xb0a0('0x2b')]=qs['offset'](_0x147c2d[_0xb0a0('0x3f')]['offset']);}return _0xff8f9d[_0xb0a0('0x96')](_0x342aa6);}})['then'](function(_0x3ca36b){if(_0x3ca36b){return _0x3ca36b?{'count':_0x435279,'rows':_0x3ca36b}:null;}})[_0xb0a0('0x30')](respondWithResult(_0x3a382e,null))[_0xb0a0('0x56')](handleError(_0x3a382e,null));}; \ No newline at end of file +var _0x7a7f=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','sendStatus','name','send','CmList','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getDispositions','order','ListId','Disposition','removeDispositions','addContacts','CmContact','tags','join','isArray','push','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','raw','getContactsCsv','CmCustomField','concat','now','writeFileSync','Content-disposition','setHeader','Content-type','/tmp/list_%d_%s.csv','findOne','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','defaultValue','sequelize','addColumn','cf_%s','getCustomFields','addAgents','ids','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1ecaf3,_0x14329c){var _0x347ee2=function(_0x2a28dd){while(--_0x2a28dd){_0x1ecaf3['push'](_0x1ecaf3['shift']());}};_0x347ee2(++_0x14329c);}(_0x7a7f,0x10d));var _0xf7a7=function(_0x32ef99,_0x240ba9){_0x32ef99=_0x32ef99-0x0;var _0x57e9ca=_0x7a7f[_0x32ef99];return _0x57e9ca;};'use strict';var emlformat=require(_0xf7a7('0x0'));var rimraf=require(_0xf7a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7a7('0x3'));var Mustache=require('mustache');var util=require(_0xf7a7('0x4'));var path=require(_0xf7a7('0x5'));var sox=require(_0xf7a7('0x6'));var csv=require(_0xf7a7('0x7'));var ejs=require(_0xf7a7('0x8'));var fs=require('fs');var fs_extra=require(_0xf7a7('0x9'));var _=require(_0xf7a7('0xa'));var squel=require('squel');var crypto=require(_0xf7a7('0xb'));var jsforce=require(_0xf7a7('0xc'));var deskjs=require(_0xf7a7('0xd'));var toCsv=require(_0xf7a7('0x7'));var querystring=require(_0xf7a7('0xe'));var Papa=require(_0xf7a7('0xf'));var Redis=require(_0xf7a7('0x10'));var authService=require(_0xf7a7('0x11'));var qs=require(_0xf7a7('0x12'));var as=require(_0xf7a7('0x13'));var hardwareService=require(_0xf7a7('0x14'));var logger=require(_0xf7a7('0x15'))(_0xf7a7('0x16'));var utils=require(_0xf7a7('0x17'));var config=require(_0xf7a7('0x18'));var licenseUtil=require(_0xf7a7('0x19'));var db=require(_0xf7a7('0x1a'))['db'];config[_0xf7a7('0x1b')]=_[_0xf7a7('0x1c')](config[_0xf7a7('0x1b')],{'host':_0xf7a7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7a7('0x1b')]));require(_0xf7a7('0x1e'))[_0xf7a7('0x1f')](socket);function respondWithStatusCode(_0x18dec1,_0x5a278b){_0x5a278b=_0x5a278b||0xcc;return function(_0x2669fb){if(_0x2669fb){return _0x18dec1['sendStatus'](_0x5a278b);}return _0x18dec1['status'](_0x5a278b)[_0xf7a7('0x20')]();};}function respondWithResult(_0x3c67ac,_0x3dd864){_0x3dd864=_0x3dd864||0xc8;return function(_0x207c6e){if(_0x207c6e){return _0x3c67ac[_0xf7a7('0x21')](_0x3dd864)[_0xf7a7('0x22')](_0x207c6e);}};}function respondWithFilteredResult(_0x364860,_0x5ecd68){return function(_0x14b6b1){if(_0x14b6b1){var _0x207d70=typeof _0x5ecd68[_0xf7a7('0x23')]===_0xf7a7('0x24')&&typeof _0x5ecd68[_0xf7a7('0x25')]===_0xf7a7('0x24');var _0x573a21=_0x14b6b1[_0xf7a7('0x26')];var _0x2e5288=_0x207d70?0x0:_0x5ecd68[_0xf7a7('0x23')];var _0x3fe867=_0x207d70?_0x14b6b1[_0xf7a7('0x26')]:_0x5ecd68[_0xf7a7('0x23')]+_0x5ecd68[_0xf7a7('0x25')];var _0x3ef183;if(_0x3fe867>=_0x573a21){_0x3fe867=_0x573a21;_0x3ef183=0xc8;}else{_0x3ef183=0xce;}_0x364860[_0xf7a7('0x21')](_0x3ef183);return _0x364860[_0xf7a7('0x27')](_0xf7a7('0x28'),_0x2e5288+'-'+_0x3fe867+'/'+_0x573a21)[_0xf7a7('0x22')](_0x14b6b1);}return null;};}function patchUpdates(_0x26f63e){return function(_0x1456a2){try{jsonpatch[_0xf7a7('0x29')](_0x1456a2,_0x26f63e,!![]);}catch(_0x2e41fe){return BPromise[_0xf7a7('0x2a')](_0x2e41fe);}return _0x1456a2[_0xf7a7('0x2b')]();};}function saveUpdates(_0x553a3e,_0xc2f963){return function(_0x52a06c){if(_0x52a06c){return _0x52a06c[_0xf7a7('0x2c')](_0x553a3e)[_0xf7a7('0x2d')](function(_0x2f4524){return _0x2f4524;});}return null;};}function removeEntity(_0x1eded6,_0x69eaac){return function(_0x4eae1e){if(_0x4eae1e){return _0x4eae1e['destroy']()[_0xf7a7('0x2d')](function(){var _0x2d6bd8=_0x4eae1e[_0xf7a7('0x2e')]({'plain':!![]});var _0x564469='Lists';return db[_0xf7a7('0x2f')]['destroy']({'where':{'type':_0x564469,'resourceId':_0x2d6bd8['id']}})[_0xf7a7('0x2d')](function(){return _0x4eae1e;});})['then'](function(){_0x1eded6[_0xf7a7('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13bca3,_0x2143b3){return function(_0x5a03d1){if(!_0x5a03d1){_0x13bca3[_0xf7a7('0x30')](0x194);}return _0x5a03d1;};}function handleError(_0x118020,_0x181968){_0x181968=_0x181968||0x1f4;return function(_0x1611f3){logger['error'](_0x1611f3['stack']);if(_0x1611f3[_0xf7a7('0x31')]){delete _0x1611f3[_0xf7a7('0x31')];}_0x118020[_0xf7a7('0x21')](_0x181968)[_0xf7a7('0x32')](_0x1611f3);};}exports['index']=function(_0x303374,_0x41a943){var _0x344389={},_0x5a2fd0={},_0x4162a3={'count':0x0,'rows':[]};var _0x4cba4e=_['map'](db[_0xf7a7('0x33')][_0xf7a7('0x34')],function(_0x187bcb){return{'name':_0x187bcb[_0xf7a7('0x35')],'type':_0x187bcb[_0xf7a7('0x36')]['key']};});_0x5a2fd0[_0xf7a7('0x37')]=_[_0xf7a7('0x38')](_0x4cba4e,_0xf7a7('0x31'));_0x5a2fd0['query']=_['keys'](_0x303374['query']);_0x5a2fd0[_0xf7a7('0x39')]=_[_0xf7a7('0x3a')](_0x5a2fd0[_0xf7a7('0x37')],_0x5a2fd0[_0xf7a7('0x3b')]);_0x344389[_0xf7a7('0x3c')]=_[_0xf7a7('0x3a')](_0x5a2fd0[_0xf7a7('0x37')],qs[_0xf7a7('0x3d')](_0x303374[_0xf7a7('0x3b')][_0xf7a7('0x3d')]));_0x344389[_0xf7a7('0x3c')]=_0x344389[_0xf7a7('0x3c')][_0xf7a7('0x3e')]?_0x344389[_0xf7a7('0x3c')]:_0x5a2fd0[_0xf7a7('0x37')];if(!_0x303374['query'][_0xf7a7('0x3f')](_0xf7a7('0x40'))){_0x344389['limit']=qs[_0xf7a7('0x25')](_0x303374[_0xf7a7('0x3b')][_0xf7a7('0x25')]);_0x344389[_0xf7a7('0x23')]=qs[_0xf7a7('0x23')](_0x303374[_0xf7a7('0x3b')]['offset']);}_0x344389['order']=qs[_0xf7a7('0x41')](_0x303374[_0xf7a7('0x3b')][_0xf7a7('0x41')]);_0x344389[_0xf7a7('0x42')]=qs[_0xf7a7('0x39')](_[_0xf7a7('0x43')](_0x303374[_0xf7a7('0x3b')],_0x5a2fd0['filters']),_0x4cba4e);if(_0x303374[_0xf7a7('0x3b')][_0xf7a7('0x44')]){_0x344389[_0xf7a7('0x42')]=_[_0xf7a7('0x45')](_0x344389[_0xf7a7('0x42')],{'$or':_[_0xf7a7('0x38')](_0x4cba4e,function(_0xb3778f){if(_0xb3778f['type']!==_0xf7a7('0x46')){var _0x41d511={};_0x41d511[_0xb3778f[_0xf7a7('0x31')]]={'$like':'%'+_0x303374[_0xf7a7('0x3b')]['filter']+'%'};return _0x41d511;}})});}_0x344389=_[_0xf7a7('0x45')]({},_0x344389,_0x303374[_0xf7a7('0x47')]);var _0x49238a={'where':_0x344389[_0xf7a7('0x42')]};return db[_0xf7a7('0x33')][_0xf7a7('0x26')](_0x49238a)[_0xf7a7('0x2d')](function(_0x684f44){_0x4162a3['count']=_0x684f44;if(_0x303374[_0xf7a7('0x3b')][_0xf7a7('0x48')]){_0x344389[_0xf7a7('0x49')]=[{'all':!![]}];}return db['CmList'][_0xf7a7('0x4a')](_0x344389);})['then'](function(_0x3d62b0){_0x4162a3[_0xf7a7('0x4b')]=_0x3d62b0;return _0x4162a3;})[_0xf7a7('0x2d')](respondWithFilteredResult(_0x41a943,_0x344389))['catch'](handleError(_0x41a943,null));};exports[_0xf7a7('0x4c')]=function(_0x4783db,_0x1cad41){var _0x560de7={'raw':![],'where':{'id':_0x4783db[_0xf7a7('0x4d')]['id']}},_0x403d2f={};_0x403d2f[_0xf7a7('0x37')]=_[_0xf7a7('0x4e')](db[_0xf7a7('0x33')][_0xf7a7('0x34')]);_0x403d2f[_0xf7a7('0x3b')]=_[_0xf7a7('0x4e')](_0x4783db[_0xf7a7('0x3b')]);_0x403d2f[_0xf7a7('0x39')]=_[_0xf7a7('0x3a')](_0x403d2f['model'],_0x403d2f['query']);_0x560de7[_0xf7a7('0x3c')]=_[_0xf7a7('0x3a')](_0x403d2f[_0xf7a7('0x37')],qs[_0xf7a7('0x3d')](_0x4783db[_0xf7a7('0x3b')]['fields']));_0x560de7[_0xf7a7('0x3c')]=_0x560de7[_0xf7a7('0x3c')]['length']?_0x560de7[_0xf7a7('0x3c')]:_0x403d2f[_0xf7a7('0x37')];if(_0x4783db[_0xf7a7('0x3b')]['includeAll']){_0x560de7[_0xf7a7('0x49')]=[{'all':!![]}];}_0x560de7=_['merge']({},_0x560de7,_0x4783db[_0xf7a7('0x47')]);return db[_0xf7a7('0x33')][_0xf7a7('0x4f')](_0x560de7)[_0xf7a7('0x2d')](handleEntityNotFound(_0x1cad41,null))[_0xf7a7('0x2d')](respondWithResult(_0x1cad41,null))['catch'](handleError(_0x1cad41,null));};exports[_0xf7a7('0x50')]=function(_0x118809,_0x9ea146){return db[_0xf7a7('0x33')][_0xf7a7('0x50')](_0x118809['body'],{})['then'](function(_0x414c57){var _0x194074=_0x118809['user'][_0xf7a7('0x2e')]({'plain':!![]});if(!_0x194074)throw new Error(_0xf7a7('0x51'));if(_0x194074['role']===_0xf7a7('0x52')){var _0x2ac397=_0x414c57['get']({'plain':!![]});var _0x3745fe='Lists';return db['UserProfileSection'][_0xf7a7('0x4f')]({'where':{'name':_0x3745fe,'userProfileId':_0x194074[_0xf7a7('0x53')]},'raw':!![]})[_0xf7a7('0x2d')](function(_0xae2f9e){if(_0xae2f9e&&_0xae2f9e[_0xf7a7('0x54')]===0x0){return db[_0xf7a7('0x2f')][_0xf7a7('0x50')]({'name':_0x2ac397[_0xf7a7('0x31')],'resourceId':_0x2ac397['id'],'type':_0xae2f9e[_0xf7a7('0x31')],'sectionId':_0xae2f9e['id']},{})[_0xf7a7('0x2d')](function(){return _0x414c57;});}else{return _0x414c57;}})[_0xf7a7('0x55')](function(_0x15cc5f){logger[_0xf7a7('0x56')](_0xf7a7('0x57'),_0x15cc5f);throw _0x15cc5f;});}return _0x414c57;})[_0xf7a7('0x2d')](respondWithResult(_0x9ea146,0xc9))[_0xf7a7('0x55')](handleError(_0x9ea146,null));};exports[_0xf7a7('0x2c')]=function(_0x438588,_0x267fb9){if(_0x438588[_0xf7a7('0x58')]['id']){delete _0x438588['body']['id'];}return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x438588[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x267fb9,null))[_0xf7a7('0x2d')](saveUpdates(_0x438588['body'],null))[_0xf7a7('0x2d')](respondWithResult(_0x267fb9,null))['catch'](handleError(_0x267fb9,null));};exports['destroy']=function(_0x13d08a,_0x3c3203){return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x13d08a[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x3c3203,null))['then'](removeEntity(_0x3c3203,null))[_0xf7a7('0x55')](handleError(_0x3c3203,null));};exports['describe']=function(_0x2b306a,_0x3351b7){return db['CmList'][_0xf7a7('0x59')]()['then'](respondWithResult(_0x3351b7,null))[_0xf7a7('0x55')](handleError(_0x3351b7,null));};exports['addDisposition']=function(_0x41cd26,_0x419ce3,_0x5a2850){if(_0x41cd26[_0xf7a7('0x58')]['id']){delete _0x41cd26['body']['id'];}return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x41cd26['params']['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x419ce3,null))[_0xf7a7('0x2d')](function(_0x3c016d){if(_0x3c016d){_0x41cd26[_0xf7a7('0x58')]['ListId']=_0x3c016d['id'];return db['Disposition'][_0xf7a7('0x50')](_0x41cd26['body']);}})[_0xf7a7('0x2d')](respondWithResult(_0x419ce3,null))['catch'](handleError(_0x419ce3,null));};exports[_0xf7a7('0x5a')]=function(_0x40d0e9,_0x13facd,_0x24cb27){var _0xda4dba={'raw':![],'where':{}};var _0x2a8d22={};var _0x1a8f94={'count':0x0,'rows':[]};return db[_0xf7a7('0x33')]['findOne']({'where':{'id':_0x40d0e9[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x13facd,null))[_0xf7a7('0x2d')](function(_0x5cdf48){if(_0x5cdf48){_0x2a8d22['model']=_[_0xf7a7('0x4e')](db['Disposition'][_0xf7a7('0x34')]);_0x2a8d22['query']=_[_0xf7a7('0x4e')](_0x40d0e9['query']);_0x2a8d22[_0xf7a7('0x39')]=_[_0xf7a7('0x3a')](_0x2a8d22['model'],_0x2a8d22[_0xf7a7('0x3b')]);_0xda4dba[_0xf7a7('0x3c')]=_[_0xf7a7('0x3a')](_0x2a8d22[_0xf7a7('0x37')],qs[_0xf7a7('0x3d')](_0x40d0e9[_0xf7a7('0x3b')][_0xf7a7('0x3d')]));_0xda4dba[_0xf7a7('0x3c')]=_0xda4dba[_0xf7a7('0x3c')][_0xf7a7('0x3e')]?_0xda4dba[_0xf7a7('0x3c')]:_0x2a8d22[_0xf7a7('0x37')];if(!_0x40d0e9['query']['hasOwnProperty'](_0xf7a7('0x40'))){_0xda4dba[_0xf7a7('0x25')]=qs[_0xf7a7('0x25')](_0x40d0e9[_0xf7a7('0x3b')][_0xf7a7('0x25')]);_0xda4dba[_0xf7a7('0x23')]=qs[_0xf7a7('0x23')](_0x40d0e9[_0xf7a7('0x3b')]['offset']);}_0xda4dba[_0xf7a7('0x5b')]=qs[_0xf7a7('0x41')](_0x40d0e9[_0xf7a7('0x3b')]['sort']);_0xda4dba['where']=qs[_0xf7a7('0x39')](_[_0xf7a7('0x43')](_0x40d0e9[_0xf7a7('0x3b')],_0x2a8d22[_0xf7a7('0x39')]));_0xda4dba['where'][_0xf7a7('0x5c')]=_0x5cdf48['id'];if(_0x40d0e9[_0xf7a7('0x3b')]['filter']){_0xda4dba[_0xf7a7('0x42')]=_[_0xf7a7('0x45')](_0xda4dba[_0xf7a7('0x42')],{'$or':_[_0xf7a7('0x38')](_0xda4dba[_0xf7a7('0x3c')],function(_0x4d13e2){var _0xd55d1a={};_0xd55d1a[_0x4d13e2]={'$like':'%'+_0x40d0e9[_0xf7a7('0x3b')][_0xf7a7('0x44')]+'%'};return _0xd55d1a;})});}_0xda4dba=_[_0xf7a7('0x45')]({},_0xda4dba,_0x40d0e9['options']);return db[_0xf7a7('0x5d')][_0xf7a7('0x26')]({'where':_0xda4dba['where']})[_0xf7a7('0x2d')](function(_0x46dc54){_0x1a8f94[_0xf7a7('0x26')]=_0x46dc54;if(_0x40d0e9['query'][_0xf7a7('0x48')]){_0xda4dba['include']=[{'all':!![]}];}return db[_0xf7a7('0x5d')][_0xf7a7('0x4a')](_0xda4dba);})[_0xf7a7('0x2d')](function(_0xf83bf0){_0x1a8f94[_0xf7a7('0x4b')]=_0xf83bf0;return _0x1a8f94;});}})[_0xf7a7('0x2d')](respondWithFilteredResult(_0x13facd,_0xda4dba))[_0xf7a7('0x55')](handleError(_0x13facd,null));};exports[_0xf7a7('0x5e')]=function(_0x5c3b79,_0x280137,_0x4bdde2){return db['CmList'][_0xf7a7('0x4f')]({'where':{'id':_0x5c3b79[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x280137,null))[_0xf7a7('0x2d')](function(_0x318af1){if(_0x318af1){return _0x318af1['removeDispositions'](_0x5c3b79[_0xf7a7('0x3b')]['ids']);}})[_0xf7a7('0x2d')](respondWithStatusCode(_0x280137,null))[_0xf7a7('0x55')](handleError(_0x280137,null));};exports[_0xf7a7('0x5f')]=function(_0x156755,_0x11cbd8,_0x432844){return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x156755[_0xf7a7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x11cbd8,null))['then'](function(_0x140d5b){if(_0x140d5b){var _0x22233a=[];var _0x56c567={'success':[],'errors':[]};return db[_0xf7a7('0x60')][_0xf7a7('0x59')]()[_0xf7a7('0x2d')](function(_0x24c2f3){if(_0x156755[_0xf7a7('0x58')][_0xf7a7('0x61')]&&_['isArray'](_0x156755[_0xf7a7('0x58')][_0xf7a7('0x61')])){if(_0x156755[_0xf7a7('0x58')][_0xf7a7('0x61')][_0xf7a7('0x3e')]){_0x156755['body']['tags']=_0x156755['body'][_0xf7a7('0x61')][_0xf7a7('0x62')](';')+';';}else{_0x156755[_0xf7a7('0x58')][_0xf7a7('0x61')]=null;}}else{_0x156755[_0xf7a7('0x58')][_0xf7a7('0x61')]=null;}if(_0x156755['body']&&_[_0xf7a7('0x63')](_0x156755['body'])){for(var _0x33fed0=0x0;_0x33fed0<_0x156755[_0xf7a7('0x58')][_0xf7a7('0x3e')];_0x33fed0+=0x1){_0x156755[_0xf7a7('0x58')][_0x33fed0][_0xf7a7('0x5c')]=_0x156755['params']['id'];_0x22233a[_0xf7a7('0x64')](_0x156755['body'][_0x33fed0]);}return BPromise['each'](_0x22233a,function(_0x742531){return db[_0xf7a7('0x60')][_0xf7a7('0x50')](_[_0xf7a7('0x65')](_0x742531,['ids','id'])||{},{'fields':_['keys'](_0x24c2f3),'raw':!![]})[_0xf7a7('0x2d')](function(_0x2279c5){_0x56c567[_0xf7a7('0x66')][_0xf7a7('0x64')](_0x2279c5[_0xf7a7('0x67')]);})[_0xf7a7('0x55')](function(_0x36764c){_0x56c567[_0xf7a7('0x68')]['push']({'data':_0x742531,'error':_0x36764c['message']});});})[_0xf7a7('0x2d')](function(_0x5a9c68){return _0x56c567;})['catch'](function(_0x3181a4){return _0x3181a4;});}else{_0x11cbd8[_0xf7a7('0x21')](0x190)[_0xf7a7('0x22')]({'message':_0xf7a7('0x69')});}});}})[_0xf7a7('0x2d')](respondWithResult(_0x11cbd8,null))[_0xf7a7('0x55')](handleError(_0x11cbd8,null));};exports[_0xf7a7('0x6a')]=function(_0x3a712a,_0x12b16f,_0xe9d10c){var _0x5d4052;return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x3a712a[_0xf7a7('0x4d')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf7a7('0x6b')}]})[_0xf7a7('0x2d')](handleEntityNotFound(_0x12b16f,null))[_0xf7a7('0x2d')](function(_0x3ad0d8){if(_0x3ad0d8){_0x5d4052=_0x3ad0d8;return db[_0xf7a7('0x60')][_0xf7a7('0x34')];}})['then'](function(_0x565327){if(_0x565327){var _0x382217={};var _0x5b6a8b={};_0x5b6a8b[_0xf7a7('0x37')]=_['concat'](_[_0xf7a7('0x4e')](_0x565327),_['map'](_0x5d4052[_0xf7a7('0x6b')],function(_0x479600){return util[_0xf7a7('0x6c')](_0xf7a7('0x6d'),_0x479600['id']);}));_0x5b6a8b['query']=_['keys'](_0x3a712a[_0xf7a7('0x3b')]);_0x5b6a8b[_0xf7a7('0x39')]=_['intersection'](_0x5b6a8b['model'],_0x5b6a8b[_0xf7a7('0x3b')]);_0x382217['attributes']=_[_0xf7a7('0x3a')](_0x5b6a8b[_0xf7a7('0x37')],qs[_0xf7a7('0x3d')](_0x3a712a['query'][_0xf7a7('0x3d')]));_0x382217[_0xf7a7('0x3c')]=_0x382217[_0xf7a7('0x3c')][_0xf7a7('0x3e')]?_0x382217['attributes']:_0x5b6a8b[_0xf7a7('0x37')];if(!_0x3a712a[_0xf7a7('0x3b')][_0xf7a7('0x3f')](_0xf7a7('0x40'))){_0x382217[_0xf7a7('0x25')]=qs['limit'](_0x3a712a[_0xf7a7('0x3b')]['limit']);_0x382217[_0xf7a7('0x23')]=qs[_0xf7a7('0x23')](_0x3a712a['query'][_0xf7a7('0x23')]);}_0x382217[_0xf7a7('0x5b')]=qs[_0xf7a7('0x41')](_0x3a712a[_0xf7a7('0x3b')][_0xf7a7('0x41')]);_0x382217[_0xf7a7('0x42')]=qs[_0xf7a7('0x39')](_[_0xf7a7('0x43')](_0x3a712a['query'],_0x5b6a8b[_0xf7a7('0x39')]));_0x382217[_0xf7a7('0x6e')]=!![];if(_0x3a712a[_0xf7a7('0x3b')][_0xf7a7('0x44')]){_0x382217[_0xf7a7('0x42')]=_[_0xf7a7('0x45')](_0x382217[_0xf7a7('0x42')],{'$or':_[_0xf7a7('0x38')](_0x382217[_0xf7a7('0x3c')],function(_0x34e85d){var _0x28f08c={};_0x28f08c[_0x34e85d]={'$like':'%'+_0x3a712a[_0xf7a7('0x3b')][_0xf7a7('0x44')]+'%'};return _0x28f08c;})});}_0x382217=_['merge']({},_0x382217,_0x3a712a[_0xf7a7('0x47')]);return _0x5d4052['getContacts'](_0x382217);}})[_0xf7a7('0x2d')](respondWithResult(_0x12b16f,null))[_0xf7a7('0x55')](handleError(_0x12b16f,null));};exports[_0xf7a7('0x6f')]=function(_0x543e91,_0x5d608a,_0x1ed3e2){var _0x1ae134;return db['CmList']['find']({'where':{'id':_0x543e91[_0xf7a7('0x4d')]['id']},'include':[{'model':db[_0xf7a7('0x70')],'as':_0xf7a7('0x6b')}]})['then'](handleEntityNotFound(_0x5d608a,null))['then'](function(_0x34e84f){if(_0x34e84f){_0x1ae134=_0x34e84f;return db[_0xf7a7('0x60')][_0xf7a7('0x34')];}})['then'](function(_0x44b2c2){if(_0x44b2c2){var _0x5c56c3={};var _0x1cee0a={};_0x1cee0a[_0xf7a7('0x37')]=_[_0xf7a7('0x71')](_[_0xf7a7('0x4e')](_0x44b2c2),_[_0xf7a7('0x38')](_0x1ae134['CustomFields'],function(_0x341e5c){return util[_0xf7a7('0x6c')](_0xf7a7('0x6d'),_0x341e5c['id']);}));_0x1cee0a[_0xf7a7('0x3b')]=_['keys'](_0x543e91[_0xf7a7('0x3b')]);_0x1cee0a[_0xf7a7('0x39')]=_['intersection'](_0x1cee0a[_0xf7a7('0x37')],_0x1cee0a[_0xf7a7('0x3b')]);_0x5c56c3[_0xf7a7('0x3c')]=_[_0xf7a7('0x3a')](_0x1cee0a['model'],qs[_0xf7a7('0x3d')](_0x543e91[_0xf7a7('0x3b')][_0xf7a7('0x3d')]));_0x5c56c3[_0xf7a7('0x3c')]=_0x5c56c3[_0xf7a7('0x3c')][_0xf7a7('0x3e')]?_0x5c56c3['attributes']:_0x1cee0a['model'];if(!_0x543e91[_0xf7a7('0x3b')]['hasOwnProperty'](_0xf7a7('0x40'))){_0x5c56c3[_0xf7a7('0x25')]=qs[_0xf7a7('0x25')](_0x543e91[_0xf7a7('0x3b')][_0xf7a7('0x25')]);_0x5c56c3[_0xf7a7('0x23')]=qs[_0xf7a7('0x23')](_0x543e91[_0xf7a7('0x3b')]['offset']);}_0x5c56c3[_0xf7a7('0x5b')]=qs[_0xf7a7('0x41')](_0x543e91[_0xf7a7('0x3b')][_0xf7a7('0x41')]);_0x5c56c3[_0xf7a7('0x42')]=qs['filters'](_['pick'](_0x543e91[_0xf7a7('0x3b')],_0x1cee0a[_0xf7a7('0x39')]));_0x5c56c3[_0xf7a7('0x6e')]=!![];if(_0x543e91[_0xf7a7('0x3b')][_0xf7a7('0x44')]){_0x5c56c3['where']=_['merge'](_0x5c56c3['where'],{'$or':_['map'](_0x5c56c3[_0xf7a7('0x3c')],function(_0x5281ec){var _0x12d28e={};_0x12d28e[_0x5281ec]={'$like':'%'+_0x543e91['query'][_0xf7a7('0x44')]+'%'};return _0x12d28e;})});}_0x5c56c3=_[_0xf7a7('0x45')]({},_0x5c56c3,_0x543e91[_0xf7a7('0x47')]);return _0x1ae134[_0xf7a7('0x6a')](_0x5c56c3);}})['then'](function(_0x3a80dd){if(!_['isEmpty'](_0x3a80dd)){var _0x1ad938=toCsv(_0x3a80dd);var _0x2a5500=Date[_0xf7a7('0x72')]();fs[_0xf7a7('0x73')](util[_0xf7a7('0x6c')]('/tmp/list_%d_%s.csv',_0x1ae134['id'],_0x2a5500),_0x1ad938);_0x5d608a['setHeader'](_0xf7a7('0x74'),'attachment;\x20filename='+util[_0xf7a7('0x6c')]('list_%d_%s.csv',_0x1ae134['id'],_0x2a5500));_0x5d608a[_0xf7a7('0x75')](_0xf7a7('0x76'),'text/csv');return _0x5d608a['download'](util[_0xf7a7('0x6c')](_0xf7a7('0x77'),_0x1ae134['id'],_0x2a5500));}else{return _0x5d608a[_0xf7a7('0x30')](0xcc);}})['catch'](handleError(_0x5d608a,null));};exports['addCustomField']=function(_0x3f3e40,_0x434a15,_0x183693){var _0x3125c2;delete _0x3f3e40[_0xf7a7('0x58')]['id'];return db[_0xf7a7('0x33')][_0xf7a7('0x78')]({'where':{'id':_0x3f3e40['params']['id']}})['then'](handleEntityNotFound(_0x434a15,null))[_0xf7a7('0x2d')](function(_0x2a168b){if(_0x2a168b){return db['sequelize']['transaction'](function(_0x3cba83){return db[_0xf7a7('0x70')][_0xf7a7('0x50')](_0x3f3e40['body'],{'transaction':_0x3cba83})[_0xf7a7('0x2d')](function(_0x10c27d){_0x3125c2=_0x10c27d;return _0x2a168b[_0xf7a7('0x79')](_0x10c27d,{'transaction':_0x3cba83});})[_0xf7a7('0x2d')](function(){var _0x40b55b={'type':db[_0xf7a7('0x7a')][_0xf7a7('0x7b')],'transaction':_0x3cba83};switch(_0x3f3e40[_0xf7a7('0x58')][_0xf7a7('0x36')]){case'text':_0x40b55b[_0xf7a7('0x36')]=db[_0xf7a7('0x7a')][_0xf7a7('0x7b')];break;case _0xf7a7('0x7c'):_0x40b55b['type']=db['Sequelize'][_0xf7a7('0x7d')];break;case _0xf7a7('0x7e'):_0x40b55b[_0xf7a7('0x36')]=db[_0xf7a7('0x7a')]['BOOLEAN'];_0x40b55b[_0xf7a7('0x7f')]=![];break;default:}return db[_0xf7a7('0x80')]['queryInterface'][_0xf7a7('0x81')]('cm_contacts',util[_0xf7a7('0x6c')](_0xf7a7('0x82'),_0x3125c2['id']),_0x40b55b);})[_0xf7a7('0x2d')](function(){return _0x3125c2;});});}})['then'](respondWithResult(_0x434a15,null))[_0xf7a7('0x55')](handleError(_0x434a15,null));};exports[_0xf7a7('0x83')]=function(_0x3572af,_0x414c92,_0x31f02f){var _0x1141dc={};var _0x4b3ce1={};var _0x22e1da;var _0x523d75;return db['CmList']['findOne']({'where':{'id':_0x3572af[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x414c92,null))[_0xf7a7('0x2d')](function(_0x460574){if(_0x460574){_0x22e1da=_0x460574;_0x4b3ce1[_0xf7a7('0x37')]=_[_0xf7a7('0x4e')](db[_0xf7a7('0x70')][_0xf7a7('0x34')]);_0x4b3ce1[_0xf7a7('0x3b')]=_['keys'](_0x3572af[_0xf7a7('0x3b')]);_0x4b3ce1['filters']=_[_0xf7a7('0x3a')](_0x4b3ce1[_0xf7a7('0x37')],_0x4b3ce1['query']);_0x1141dc['attributes']=_[_0xf7a7('0x3a')](_0x4b3ce1[_0xf7a7('0x37')],qs[_0xf7a7('0x3d')](_0x3572af[_0xf7a7('0x3b')][_0xf7a7('0x3d')]));_0x1141dc['attributes']=_0x1141dc['attributes'][_0xf7a7('0x3e')]?_0x1141dc[_0xf7a7('0x3c')]:_0x4b3ce1[_0xf7a7('0x37')];_0x1141dc[_0xf7a7('0x5b')]=qs[_0xf7a7('0x41')](_0x3572af['query'][_0xf7a7('0x41')]);_0x1141dc['where']=qs['filters'](_[_0xf7a7('0x43')](_0x3572af[_0xf7a7('0x3b')],_0x4b3ce1[_0xf7a7('0x39')]));_0x1141dc[_0xf7a7('0x42')]=_[_0xf7a7('0x45')](_0x1141dc[_0xf7a7('0x42')],{'$or':[{'ListId':_0x460574['id']},{'ListId':null}]});if(_0x3572af[_0xf7a7('0x3b')][_0xf7a7('0x44')]){_0x1141dc['where']=_[_0xf7a7('0x45')](_0x1141dc[_0xf7a7('0x42')],{'$or':_[_0xf7a7('0x38')](_0x1141dc[_0xf7a7('0x3c')],function(_0x4d1023){var _0x27e702={};_0x27e702[_0x4d1023]={'$like':'%'+_0x3572af[_0xf7a7('0x3b')]['filter']+'%'};return _0x27e702;})});}_0x1141dc=_[_0xf7a7('0x45')]({},_0x1141dc,_0x3572af[_0xf7a7('0x47')]);return db['CmCustomField']['findAndCountAll'](_0x1141dc);}})['then'](respondWithResult(_0x414c92,null))[_0xf7a7('0x55')](handleError(_0x414c92,null));};exports[_0xf7a7('0x84')]=function(_0x2042cf,_0x214f88,_0x39285a){return db[_0xf7a7('0x33')]['find']({'where':{'id':_0x2042cf[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x214f88,null))['then'](function(_0x3a97df){if(_0x3a97df){return _0x3a97df[_0xf7a7('0x84')](_0x2042cf[_0xf7a7('0x58')]['ids'],_[_0xf7a7('0x65')](_0x2042cf[_0xf7a7('0x58')],[_0xf7a7('0x85'),'id'])||{})[_0xf7a7('0x86')](function(_0x1a9052){for(var _0x4b966c=0x0;_0x4b966c<_0x2042cf['body']['ids']['length'];_0x4b966c+=0x1){socket[_0xf7a7('0x87')](_0xf7a7('0x88'),{'UserId':Number(_0x2042cf[_0xf7a7('0x58')]['ids'][_0x4b966c]),'CmListId':Number(_0x2042cf[_0xf7a7('0x4d')]['id'])});}return _0x1a9052;});}})['then'](respondWithResult(_0x214f88,null))['catch'](handleError(_0x214f88,null));};exports['removeAgents']=function(_0x3db533,_0xdf10a3,_0x53b68f){return db[_0xf7a7('0x33')][_0xf7a7('0x4f')]({'where':{'id':_0x3db533[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0xdf10a3,null))[_0xf7a7('0x2d')](function(_0x5680db){if(_0x5680db){return _0x5680db[_0xf7a7('0x89')](_0x3db533['query'][_0xf7a7('0x85')])[_0xf7a7('0x2d')](function(){if(_[_0xf7a7('0x63')](_0x3db533['query'][_0xf7a7('0x85')])){for(var _0x5814af=0x0;_0x5814af<_0x3db533[_0xf7a7('0x3b')][_0xf7a7('0x85')]['length'];_0x5814af+=0x1){socket[_0xf7a7('0x87')](_0xf7a7('0x8a'),{'UserId':Number(_0x3db533[_0xf7a7('0x3b')][_0xf7a7('0x85')][_0x5814af]),'CmListId':Number(_0x3db533[_0xf7a7('0x4d')]['id'])});}}else{socket[_0xf7a7('0x87')](_0xf7a7('0x8a'),{'UserId':Number(_0x3db533['query'][_0xf7a7('0x85')]),'CmListId':Number(_0x3db533['params']['id'])});}});}})[_0xf7a7('0x2d')](respondWithStatusCode(_0xdf10a3,null))[_0xf7a7('0x55')](handleError(_0xdf10a3,null));};exports[_0xf7a7('0x8b')]=function(_0x315ab8,_0x1c2fd8,_0xa331b4){var _0x35307b={};var _0x8c0d5b={};var _0x2fabe8;var _0x5e3999;return db[_0xf7a7('0x33')][_0xf7a7('0x78')]({'where':{'id':_0x315ab8[_0xf7a7('0x4d')]['id']}})[_0xf7a7('0x2d')](handleEntityNotFound(_0x1c2fd8,null))[_0xf7a7('0x2d')](function(_0x318773){if(_0x318773){_0x2fabe8=_0x318773;_0x8c0d5b[_0xf7a7('0x37')]=_['keys'](db['User']['rawAttributes']);_0x8c0d5b['query']=_[_0xf7a7('0x4e')](_0x315ab8[_0xf7a7('0x3b')]);_0x8c0d5b[_0xf7a7('0x39')]=_[_0xf7a7('0x3a')](_0x8c0d5b['model'],_0x8c0d5b[_0xf7a7('0x3b')]);_0x35307b[_0xf7a7('0x3c')]=_[_0xf7a7('0x3a')](_0x8c0d5b['model'],qs[_0xf7a7('0x3d')](_0x315ab8[_0xf7a7('0x3b')][_0xf7a7('0x3d')]));_0x35307b['attributes']=_0x35307b[_0xf7a7('0x3c')][_0xf7a7('0x3e')]?_0x35307b[_0xf7a7('0x3c')]:_0x8c0d5b[_0xf7a7('0x37')];_0x35307b[_0xf7a7('0x5b')]=qs[_0xf7a7('0x41')](_0x315ab8[_0xf7a7('0x3b')][_0xf7a7('0x41')]);_0x35307b[_0xf7a7('0x42')]=qs[_0xf7a7('0x39')](_['pick'](_0x315ab8[_0xf7a7('0x3b')],_0x8c0d5b[_0xf7a7('0x39')]));if(_0x315ab8[_0xf7a7('0x3b')][_0xf7a7('0x44')]){_0x35307b[_0xf7a7('0x42')]=_['merge'](_0x35307b[_0xf7a7('0x42')],{'$or':_[_0xf7a7('0x38')](_0x35307b[_0xf7a7('0x3c')],function(_0x550715){var _0x2ff371={};_0x2ff371[_0x550715]={'$like':'%'+_0x315ab8['query'][_0xf7a7('0x44')]+'%'};return _0x2ff371;})});}_0x35307b=_[_0xf7a7('0x45')]({},_0x35307b,_0x315ab8[_0xf7a7('0x47')]);return _0x2fabe8[_0xf7a7('0x8b')](_0x35307b);}})[_0xf7a7('0x2d')](function(_0x2cbfd7){if(_0x2cbfd7){_0x5e3999=_0x2cbfd7[_0xf7a7('0x3e')];if(!_0x315ab8[_0xf7a7('0x3b')][_0xf7a7('0x3f')](_0xf7a7('0x40'))){_0x35307b[_0xf7a7('0x25')]=qs[_0xf7a7('0x25')](_0x315ab8[_0xf7a7('0x3b')][_0xf7a7('0x25')]);_0x35307b['offset']=qs[_0xf7a7('0x23')](_0x315ab8['query']['offset']);}return _0x2fabe8[_0xf7a7('0x8b')](_0x35307b);}})[_0xf7a7('0x2d')](function(_0x3a85a7){if(_0x3a85a7){return _0x3a85a7?{'count':_0x5e3999,'rows':_0x3a85a7}:null;}})[_0xf7a7('0x2d')](respondWithResult(_0x1c2fd8,null))['catch'](handleError(_0x1c2fd8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7187cb4..761eca0 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x5fc3,0xa8));var _0x35fc=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x5fc3[_0x59dccc];return _0xc97bcb;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x56dc8c,_0x1b15ca){var _0x166838=function(_0x30257a){while(--_0x30257a){_0x56dc8c['push'](_0x56dc8c['shift']());}};_0x166838(++_0x1b15ca);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ab63eb4..0d18b05 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x59449b,_0x4d31ad){var _0x3eda98=function(_0x30a999){while(--_0x30a999){_0x59449b['push'](_0x59449b['shift']());}};_0x3eda98(++_0x4d31ad);}(_0x2dae,0xc3));var _0xe2da=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x2dae[_0x456032];return _0x1a53cd;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x1675b1,_0xa2af00){var _0x362c6f=function(_0x5fdaa7){while(--_0x5fdaa7){_0x1675b1['push'](_0x1675b1['shift']());}};_0x362c6f(++_0xa2af00);}(_0x6c76,0x184));var _0x66c7=function(_0x4fc524,_0xce599f){_0x4fc524=_0x4fc524-0x0;var _0x5de4c5=_0x6c76[_0x4fc524];return _0x5de4c5;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./cmList.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index cb05cc2..f8bb749 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 _0x7659=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1b0ce3,_0x1bae9b){var _0x16b2c0=function(_0x3daadd){while(--_0x3daadd){_0x1b0ce3['push'](_0x1b0ce3['shift']());}};_0x16b2c0(++_0x1bae9b);}(_0x7659,0x113));var _0x9765=function(_0x4c34a3,_0x15327b){_0x4c34a3=_0x4c34a3-0x0;var _0x3800ae=_0x7659[_0x4c34a3];return _0x3800ae;};'use strict';var _=require(_0x9765('0x0'));var util=require(_0x9765('0x1'));var moment=require('moment');var BPromise=require(_0x9765('0x2'));var rs=require(_0x9765('0x3'));var fs=require('fs');var Redis=require(_0x9765('0x4'));var db=require(_0x9765('0x5'))['db'];var utils=require(_0x9765('0x6'));var logger=require('../../config/logger')(_0x9765('0x7'));var config=require(_0x9765('0x8'));var jayson=require(_0x9765('0x9'));var client=jayson[_0x9765('0xa')][_0x9765('0xb')]({'port':0x232a});config[_0x9765('0xc')]=_[_0x9765('0xd')](config[_0x9765('0xc')],{'host':_0x9765('0xe'),'port':0x18eb});var socket=require(_0x9765('0xf'))(new Redis(config[_0x9765('0xc')]));require(_0x9765('0x10'))[_0x9765('0x11')](socket);function respondWithRpcPromise(_0x13438d,_0x1359fe,_0x37c040){return new BPromise(function(_0x359c60,_0x5c8689){return client[_0x9765('0x12')](_0x13438d,_0x37c040)[_0x9765('0x13')](function(_0x14281c){logger[_0x9765('0x14')](_0x9765('0x15'),_0x1359fe,_0x9765('0x16'));logger[_0x9765('0x17')](_0x9765('0x18'),_0x1359fe,_0x9765('0x16'),JSON[_0x9765('0x19')](_0x14281c));if(_0x14281c[_0x9765('0x1a')]){if(_0x14281c[_0x9765('0x1a')][_0x9765('0x1b')]===0x1f4){logger[_0x9765('0x1a')](_0x9765('0x15'),_0x1359fe,_0x14281c[_0x9765('0x1a')][_0x9765('0x1c')]);return _0x5c8689(_0x14281c[_0x9765('0x1a')][_0x9765('0x1c')]);}logger[_0x9765('0x1a')](_0x9765('0x15'),_0x1359fe,_0x14281c[_0x9765('0x1a')][_0x9765('0x1c')]);return _0x359c60(_0x14281c[_0x9765('0x1a')][_0x9765('0x1c')]);}else{logger['info'](_0x9765('0x15'),_0x1359fe,_0x9765('0x16'));_0x359c60(_0x14281c[_0x9765('0x1d')][_0x9765('0x1c')]);}})[_0x9765('0x1e')](function(_0x444c70){logger[_0x9765('0x1a')]('CmList,\x20%s,\x20%s',_0x1359fe,_0x444c70);_0x5c8689(_0x444c70);});});} \ No newline at end of file +var _0xdbdc=['defaults','redis','socket.io-emitter','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xdbdc,0x1ee));var _0xcdbd=function(_0x26eb9b,_0x9ff8ac){_0x26eb9b=_0x26eb9b-0x0;var _0x3722a3=_0xdbdc[_0x26eb9b];return _0x3722a3;};'use strict';var _=require(_0xcdbd('0x0'));var util=require(_0xcdbd('0x1'));var moment=require(_0xcdbd('0x2'));var BPromise=require(_0xcdbd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdbd('0x4'))['db'];var utils=require(_0xcdbd('0x5'));var logger=require(_0xcdbd('0x6'))('rpc');var config=require(_0xcdbd('0x7'));var jayson=require(_0xcdbd('0x8'));var client=jayson[_0xcdbd('0x9')]['http']({'port':0x232a});config['redis']=_[_0xcdbd('0xa')](config[_0xcdbd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcdbd('0xc'))(new Redis(config[_0xcdbd('0xb')]));require('./cmList.socket')[_0xcdbd('0xd')](socket);function respondWithRpcPromise(_0x17bd54,_0x25bb53,_0x272c07){return new BPromise(function(_0xa3a91,_0x1b6ce6){return client[_0xcdbd('0xe')](_0x17bd54,_0x272c07)['then'](function(_0x2ead8d){logger[_0xcdbd('0xf')](_0xcdbd('0x10'),_0x25bb53,_0xcdbd('0x11'));logger['debug'](_0xcdbd('0x12'),_0x25bb53,_0xcdbd('0x11'),JSON[_0xcdbd('0x13')](_0x2ead8d));if(_0x2ead8d['error']){if(_0x2ead8d['error'][_0xcdbd('0x14')]===0x1f4){logger['error'](_0xcdbd('0x10'),_0x25bb53,_0x2ead8d[_0xcdbd('0x15')][_0xcdbd('0x16')]);return _0x1b6ce6(_0x2ead8d['error'][_0xcdbd('0x16')]);}logger['error']('CmList,\x20%s,\x20%s',_0x25bb53,_0x2ead8d[_0xcdbd('0x15')][_0xcdbd('0x16')]);return _0xa3a91(_0x2ead8d[_0xcdbd('0x15')][_0xcdbd('0x16')]);}else{logger[_0xcdbd('0xf')](_0xcdbd('0x10'),_0x25bb53,_0xcdbd('0x11'));_0xa3a91(_0x2ead8d['result'][_0xcdbd('0x16')]);}})[_0xcdbd('0x17')](function(_0x476c38){logger[_0xcdbd('0x15')]('CmList,\x20%s,\x20%s',_0x25bb53,_0x476c38);_0x1b6ce6(_0x476c38);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3419cb8..ebd0a03 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 _0xf72f=['update','emit','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x2ff38f,_0xefceba){var _0x19a75f=function(_0x22c3b1){while(--_0x22c3b1){_0x2ff38f['push'](_0x2ff38f['shift']());}};_0x19a75f(++_0xefceba);}(_0xf72f,0x177));var _0xff72=function(_0x32458b,_0x15c8f2){_0x32458b=_0x32458b-0x0;var _0xf5eca8=_0xf72f[_0x32458b];return _0xf5eca8;};'use strict';var CmListEvents=require(_0xff72('0x0'));var events=[_0xff72('0x1'),_0xff72('0x2'),_0xff72('0x3')];function createListener(_0x113a24,_0x1d6fc2){return function(_0x17195e){_0x1d6fc2[_0xff72('0x4')](_0x113a24,_0x17195e);};}function removeListener(_0x2e9c68,_0x510a15){return function(){CmListEvents[_0xff72('0x5')](_0x2e9c68,_0x510a15);};}exports[_0xff72('0x6')]=function(_0x39d0a4){for(var _0x2764e1=0x0,_0x35a9e2=events[_0xff72('0x7')];_0x2764e1<_0x35a9e2;_0x2764e1++){var _0x1774d4=events[_0x2764e1];var _0x1a3d49=createListener(_0xff72('0x8')+_0x1774d4,_0x39d0a4);CmListEvents['on'](_0x1774d4,_0x1a3d49);}}; \ No newline at end of file +var _0xbd87=['length','cmList:','update','emit','register'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xbd87,0x133));var _0x7bd8=function(_0x5517ae,_0x23a29f){_0x5517ae=_0x5517ae-0x0;var _0x1fb44a=_0xbd87[_0x5517ae];return _0x1fb44a;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove',_0x7bd8('0x0')];function createListener(_0x402d2d,_0x1069fe){return function(_0x308503){_0x1069fe[_0x7bd8('0x1')](_0x402d2d,_0x308503);};}function removeListener(_0x2f6952,_0xcba678){return function(){CmListEvents['removeListener'](_0x2f6952,_0xcba678);};}exports[_0x7bd8('0x2')]=function(_0x34bb90){for(var _0x481715=0x0,_0x5db84f=events[_0x7bd8('0x3')];_0x481715<_0x5db84f;_0x481715++){var _0x5abd03=events[_0x481715];var _0x3d6d3a=createListener(_0x7bd8('0x4')+_0x5abd03,_0x34bb90);CmListEvents['on'](_0x5abd03,_0x3d6d3a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0b2f4d6..19e7f5f 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 _0xd940=['addContacts','addAgents','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','post','/:id/contacts'];(function(_0x13e7a9,_0x1005f4){var _0xee6c68=function(_0x123f10){while(--_0x123f10){_0x13e7a9['push'](_0x13e7a9['shift']());}};_0xee6c68(++_0x1005f4);}(_0xd940,0xbb));var _0x0d94=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0xd940[_0x246227];return _0x37bd4a;};'use strict';var multer=require(_0x0d94('0x0'));var util=require(_0x0d94('0x1'));var path=require(_0x0d94('0x2'));var timeout=require(_0x0d94('0x3'));var express=require(_0x0d94('0x4'));var router=express[_0x0d94('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0d94('0x6'));var interaction=require(_0x0d94('0x7'));var config=require(_0x0d94('0x8'));var controller=require('./cmList.controller');router[_0x0d94('0x9')]('/',auth[_0x0d94('0xa')](),controller[_0x0d94('0xb')]);router[_0x0d94('0x9')](_0x0d94('0xc'),auth[_0x0d94('0xa')](),controller['describe']);router[_0x0d94('0x9')](_0x0d94('0xd'),auth[_0x0d94('0xa')](),controller[_0x0d94('0xe')]);router[_0x0d94('0x9')](_0x0d94('0xf'),auth['isAuthenticated'](),controller[_0x0d94('0x10')]);router[_0x0d94('0x9')]('/:id/contacts',auth[_0x0d94('0xa')](),controller['getContacts']);router[_0x0d94('0x9')](_0x0d94('0x11'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x12')]);router[_0x0d94('0x9')](_0x0d94('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x0d94('0x9')](_0x0d94('0x14'),auth[_0x0d94('0xa')](),controller['getAgents']);router['post']('/',auth[_0x0d94('0xa')](),controller['create']);router[_0x0d94('0x15')](_0x0d94('0xf'),auth[_0x0d94('0xa')](),controller['addDisposition']);router[_0x0d94('0x15')](_0x0d94('0x16'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x17')]);router[_0x0d94('0x15')](_0x0d94('0x13'),auth[_0x0d94('0xa')](),controller['addCustomField']);router['post'](_0x0d94('0x14'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x18')]);router['put'](_0x0d94('0xd'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x19')]);router[_0x0d94('0x1a')](_0x0d94('0xd'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x1b')]);router[_0x0d94('0x1a')](_0x0d94('0xf'),auth[_0x0d94('0xa')](),controller[_0x0d94('0x1c')]);router[_0x0d94('0x1a')](_0x0d94('0x14'),auth['isAuthenticated'](),controller[_0x0d94('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x9ebb=['Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','connect-timeout','express'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x9ebb,0x13e));var _0xb9eb=function(_0x24d697,_0x5594b0){_0x24d697=_0x24d697-0x0;var _0x2183cb=_0x9ebb[_0x24d697];return _0x2183cb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb9eb('0x0'));var express=require(_0xb9eb('0x1'));var router=express[_0xb9eb('0x2')]();var fs_extra=require(_0xb9eb('0x3'));var auth=require(_0xb9eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb9eb('0x5'));var controller=require(_0xb9eb('0x6'));router[_0xb9eb('0x7')]('/',auth['isAuthenticated'](),controller[_0xb9eb('0x8')]);router[_0xb9eb('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xb9eb('0x9')]);router['get'](_0xb9eb('0xa'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0xc')]);router[_0xb9eb('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xb9eb('0x7')](_0xb9eb('0xd'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0xe')]);router[_0xb9eb('0x7')](_0xb9eb('0xf'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x10')]);router[_0xb9eb('0x7')]('/:id/fields',auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x11')]);router['get'](_0xb9eb('0x12'),auth[_0xb9eb('0xb')](),controller['getAgents']);router[_0xb9eb('0x13')]('/',auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x14')]);router['post'](_0xb9eb('0x15'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x16')]);router[_0xb9eb('0x13')](_0xb9eb('0xd'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x17')]);router['post'](_0xb9eb('0x18'),auth['isAuthenticated'](),controller[_0xb9eb('0x19')]);router['post'](_0xb9eb('0x12'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x1a')]);router['put'](_0xb9eb('0xa'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x1b')]);router[_0xb9eb('0x1c')](_0xb9eb('0xa'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x1d')]);router[_0xb9eb('0x1c')](_0xb9eb('0x15'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x1e')]);router['delete'](_0xb9eb('0x12'),auth[_0xb9eb('0xb')](),controller[_0xb9eb('0x1f')]);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 76d50ea..27c44be 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 _0x4fcf=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x565b4f,_0x5d7607){var _0x5c87da=function(_0x5cfe72){while(--_0x5cfe72){_0x565b4f['push'](_0x565b4f['shift']());}};_0x5c87da(++_0x5d7607);}(_0x4fcf,0x15c));var _0xf4fc=function(_0x490dca,_0x5c745e){_0x490dca=_0x490dca-0x0;var _0x31ee2=_0x4fcf[_0x490dca];return _0x31ee2;};'use strict';var Sequelize=require(_0xf4fc('0x0'));module[_0xf4fc('0x1')]={'name':{'type':Sequelize[_0xf4fc('0x2')],'get':function(_0x2a2407){return this[_0xf4fc('0x3')](_0xf4fc('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf4fc('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x2e26=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x55c55a,_0x5d48e2){var _0x187f89=function(_0x2e0f06){while(--_0x2e0f06){_0x55c55a['push'](_0x55c55a['shift']());}};_0x187f89(++_0x5d48e2);}(_0x2e26,0x1e2));var _0x62e2=function(_0x1b5c34,_0x342f9b){_0x1b5c34=_0x1b5c34-0x0;var _0x4fec11=_0x2e26[_0x1b5c34];return _0x4fec11;};'use strict';var Sequelize=require(_0x62e2('0x0'));module[_0x62e2('0x1')]={'name':{'type':Sequelize[_0x62e2('0x2')],'get':function(_0x5eedff){return this[_0x62e2('0x3')](_0x62e2('0x4'));}},'field':{'type':Sequelize[_0x62e2('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x62e2('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 4315bdb..402e824 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x30e375,_0x2f751c){var _0x57a7f2=function(_0x5adc93){while(--_0x5adc93){_0x30e375['push'](_0x30e375['shift']());}};_0x57a7f2(++_0x2f751c);}(_0x7a54,0x106));var _0x47a5=function(_0x2fc705,_0xfefbf9){_0x2fc705=_0x2fc705-0x0;var _0x44f314=_0x7a54[_0x2fc705];return _0x44f314;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x45886f,_0x2fd6f5){var _0x31addd=function(_0x5a0ed7){while(--_0x5a0ed7){_0x45886f['push'](_0x45886f['shift']());}};_0x31addd(++_0x2fd6f5);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 327aa24..efef00a 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 _0xadee=['../../config/environment','exports','define','Condition','tools_conditions','lodash','api','request-promise','rimraf'];(function(_0x5b6d63,_0x2fe49f){var _0x4e06a5=function(_0x48776d){while(--_0x48776d){_0x5b6d63['push'](_0x5b6d63['shift']());}};_0x4e06a5(++_0x2fe49f);}(_0xadee,0xd4));var _0xeade=function(_0x3c4e10,_0x5a3cf8){_0x3c4e10=_0x3c4e10-0x0;var _0x3d4453=_0xadee[_0x3c4e10];return _0x3d4453;};'use strict';var _=require(_0xeade('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeade('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeade('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeade('0x3'));var config=require(_0xeade('0x4'));var attributes=require('./condition.attributes');module[_0xeade('0x5')]=function(_0x2140ed,_0x4bd449){return _0x2140ed[_0xeade('0x6')](_0xeade('0x7'),attributes,{'tableName':_0xeade('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84c0=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','define','Condition','tools_conditions'];(function(_0x5453ee,_0x11bfe7){var _0x2f38ed=function(_0x5ba05a){while(--_0x5ba05a){_0x5453ee['push'](_0x5453ee['shift']());}};_0x2f38ed(++_0x11bfe7);}(_0x84c0,0x174));var _0x084c=function(_0x2dcf25,_0x3fb595){_0x2dcf25=_0x2dcf25-0x0;var _0xb2437d=_0x84c0[_0x2dcf25];return _0xb2437d;};'use strict';var _=require(_0x084c('0x0'));var util=require('util');var logger=require(_0x084c('0x1'))(_0x084c('0x2'));var moment=require(_0x084c('0x3'));var BPromise=require(_0x084c('0x4'));var rp=require(_0x084c('0x5'));var fs=require('fs');var path=require(_0x084c('0x6'));var rimraf=require('rimraf');var config=require(_0x084c('0x7'));var attributes=require(_0x084c('0x8'));module['exports']=function(_0x3ccdf0,_0x59edf9){return _0x3ccdf0[_0x084c('0x9')](_0x084c('0xa'),attributes,{'tableName':_0x084c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index d364fb7..1b620d7 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 _0x6386=['message','info','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x16e07f,_0x548e42){var _0x1680cf=function(_0x1d02d8){while(--_0x1d02d8){_0x16e07f['push'](_0x16e07f['shift']());}};_0x1680cf(++_0x548e42);}(_0x6386,0x13f));var _0x6638=function(_0x5ccf41,_0x1124b5){_0x5ccf41=_0x5ccf41-0x0;var _0x45dca2=_0x6386[_0x5ccf41];return _0x45dca2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6638('0x0'));var BPromise=require(_0x6638('0x1'));var rs=require(_0x6638('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6638('0x3'));var logger=require(_0x6638('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6638('0x5'));var client=jayson[_0x6638('0x6')][_0x6638('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x481400,_0x34e2cd,_0x104dba){return new BPromise(function(_0x276561,_0x4e5763){return client[_0x6638('0x8')](_0x481400,_0x104dba)[_0x6638('0x9')](function(_0x1d55ac){logger['info'](_0x6638('0xa'),_0x34e2cd,_0x6638('0xb'));logger[_0x6638('0xc')](_0x6638('0xd'),_0x34e2cd,_0x6638('0xb'),JSON[_0x6638('0xe')](_0x1d55ac));if(_0x1d55ac[_0x6638('0xf')]){if(_0x1d55ac[_0x6638('0xf')][_0x6638('0x10')]===0x1f4){logger[_0x6638('0xf')]('Condition,\x20%s,\x20%s',_0x34e2cd,_0x1d55ac['error'][_0x6638('0x11')]);return _0x4e5763(_0x1d55ac[_0x6638('0xf')][_0x6638('0x11')]);}logger[_0x6638('0xf')](_0x6638('0xa'),_0x34e2cd,_0x1d55ac['error'][_0x6638('0x11')]);return _0x276561(_0x1d55ac[_0x6638('0xf')][_0x6638('0x11')]);}else{logger[_0x6638('0x12')](_0x6638('0xa'),_0x34e2cd,_0x6638('0xb'));_0x276561(_0x1d55ac[_0x6638('0x13')][_0x6638('0x11')]);}})[_0x6638('0x14')](function(_0x116264){logger['error'](_0x6638('0xa'),_0x34e2cd,_0x116264);_0x4e5763(_0x116264);});});} \ No newline at end of file +var _0x2607=['request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x2607,0x1ec));var _0x7260=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x2607[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require(_0x7260('0x0'));var util=require(_0x7260('0x1'));var moment=require(_0x7260('0x2'));var BPromise=require(_0x7260('0x3'));var rs=require(_0x7260('0x4'));var fs=require('fs');var Redis=require(_0x7260('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7260('0x6'));var logger=require(_0x7260('0x7'))(_0x7260('0x8'));var config=require(_0x7260('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7260('0xa')][_0x7260('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e1028,_0x4a81e9,_0x5b4ba8){return new BPromise(function(_0x2fea1f,_0x478d68){return client[_0x7260('0xc')](_0x1e1028,_0x5b4ba8)[_0x7260('0xd')](function(_0x38c624){logger[_0x7260('0xe')](_0x7260('0xf'),_0x4a81e9,_0x7260('0x10'));logger[_0x7260('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x4a81e9,_0x7260('0x10'),JSON[_0x7260('0x12')](_0x38c624));if(_0x38c624[_0x7260('0x13')]){if(_0x38c624[_0x7260('0x13')][_0x7260('0x14')]===0x1f4){logger['error'](_0x7260('0xf'),_0x4a81e9,_0x38c624['error'][_0x7260('0x15')]);return _0x478d68(_0x38c624['error'][_0x7260('0x15')]);}logger['error'](_0x7260('0xf'),_0x4a81e9,_0x38c624[_0x7260('0x13')]['message']);return _0x2fea1f(_0x38c624[_0x7260('0x13')]['message']);}else{logger[_0x7260('0xe')](_0x7260('0xf'),_0x4a81e9,_0x7260('0x10'));_0x2fea1f(_0x38c624[_0x7260('0x16')][_0x7260('0x15')]);}})[_0x7260('0x17')](function(_0x35502e){logger[_0x7260('0x13')]('Condition,\x20%s,\x20%s',_0x4a81e9,_0x35502e);_0x478d68(_0x35502e);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ec1be7b..56558d5 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 _0x7fad=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7fad,0x111));var _0xd7fa=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x7fad[_0x4b2b03];return _0x1bf0ed;};'use strict';var multer=require('multer');var util=require(_0xd7fa('0x0'));var path=require('path');var timeout=require(_0xd7fa('0x1'));var express=require(_0xd7fa('0x2'));var router=express[_0xd7fa('0x3')]();var fs_extra=require(_0xd7fa('0x4'));var auth=require(_0xd7fa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7fa('0x6'));var controller=require('./condition.controller');router[_0xd7fa('0x7')](_0xd7fa('0x8'),auth[_0xd7fa('0x9')](),controller[_0xd7fa('0xa')]);router[_0xd7fa('0xb')](_0xd7fa('0x8'),auth['isAuthenticated'](),controller[_0xd7fa('0xc')]);module['exports']=router; \ No newline at end of file +var _0xc7f1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc7f1,0x165));var _0x1c7f=function(_0x49ba85,_0x4f0d94){_0x49ba85=_0x49ba85-0x0;var _0x4c6286=_0xc7f1[_0x49ba85];return _0x4c6286;};'use strict';var multer=require(_0x1c7f('0x0'));var util=require(_0x1c7f('0x1'));var path=require(_0x1c7f('0x2'));var timeout=require(_0x1c7f('0x3'));var express=require(_0x1c7f('0x4'));var router=express[_0x1c7f('0x5')]();var fs_extra=require(_0x1c7f('0x6'));var auth=require(_0x1c7f('0x7'));var interaction=require(_0x1c7f('0x8'));var config=require(_0x1c7f('0x9'));var controller=require(_0x1c7f('0xa'));router[_0x1c7f('0xb')](_0x1c7f('0xc'),auth[_0x1c7f('0xd')](),controller['update']);router[_0x1c7f('0xe')]('/:id',auth[_0x1c7f('0xd')](),controller[_0x1c7f('0xf')]);module[_0x1c7f('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 38cba44..3b4df4b 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 _0xd8b0=['exports','sequelize'];(function(_0x30b787,_0x3e0b6f){var _0x30060d=function(_0x3d53ea){while(--_0x3d53ea){_0x30b787['push'](_0x30b787['shift']());}};_0x30060d(++_0x3e0b6f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0xc1f0cc,_0x2ba33b){var _0x406776=function(_0x4dd327){while(--_0x4dd327){_0xc1f0cc['push'](_0xc1f0cc['shift']());}};_0x406776(++_0x2ba33b);}(_0x2032,0xd9));var _0x2203=function(_0x2f3120,_0x3350bc){_0x2f3120=_0x2f3120-0x0;var _0x10ace8=_0x2032[_0x2f3120];return _0x10ace8;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('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 a255d57..8e89a12 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 _0x6e69=['body','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','UserProfileResource','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','options','includeAll','rows','catch','show','params','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','update'];(function(_0x5c1329,_0x44d752){var _0x282631=function(_0x92755d){while(--_0x92755d){_0x5c1329['push'](_0x5c1329['shift']());}};_0x282631(++_0x44d752);}(_0x6e69,0x9a));var _0x96e6=function(_0x23c3f6,_0x39ba33){_0x23c3f6=_0x23c3f6-0x0;var _0x4230c5=_0x6e69[_0x23c3f6];return _0x4230c5;};'use strict';var emlformat=require(_0x96e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96e6('0x1'));var jsonpatch=require(_0x96e6('0x2'));var rp=require(_0x96e6('0x3'));var moment=require(_0x96e6('0x4'));var BPromise=require(_0x96e6('0x5'));var Mustache=require('mustache');var util=require(_0x96e6('0x6'));var path=require(_0x96e6('0x7'));var sox=require(_0x96e6('0x8'));var csv=require(_0x96e6('0x9'));var ejs=require(_0x96e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96e6('0xb'));var squel=require(_0x96e6('0xc'));var crypto=require(_0x96e6('0xd'));var jsforce=require(_0x96e6('0xe'));var deskjs=require(_0x96e6('0xf'));var toCsv=require(_0x96e6('0x9'));var querystring=require(_0x96e6('0x10'));var Papa=require('papaparse');var Redis=require(_0x96e6('0x11'));var authService=require(_0x96e6('0x12'));var qs=require(_0x96e6('0x13'));var as=require(_0x96e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96e6('0x15'))('api');var utils=require(_0x96e6('0x16'));var config=require(_0x96e6('0x17'));var licenseUtil=require(_0x96e6('0x18'));var db=require(_0x96e6('0x19'))['db'];config[_0x96e6('0x1a')]=_['defaults'](config[_0x96e6('0x1a')],{'host':_0x96e6('0x1b'),'port':0x18eb});var socket=require(_0x96e6('0x1c'))(new Redis(config[_0x96e6('0x1a')]));require(_0x96e6('0x1d'))[_0x96e6('0x1e')](socket);function respondWithStatusCode(_0x24f440,_0x2ab682){_0x2ab682=_0x2ab682||0xcc;return function(_0x1eb28e){if(_0x1eb28e){return _0x24f440[_0x96e6('0x1f')](_0x2ab682);}return _0x24f440[_0x96e6('0x20')](_0x2ab682)['end']();};}function respondWithResult(_0x11f130,_0x1400e3){_0x1400e3=_0x1400e3||0xc8;return function(_0x57a6df){if(_0x57a6df){return _0x11f130['status'](_0x1400e3)[_0x96e6('0x21')](_0x57a6df);}};}function respondWithFilteredResult(_0x483f45,_0x1b75b8){return function(_0x8e9578){if(_0x8e9578){var _0xa4e76c=typeof _0x1b75b8[_0x96e6('0x22')]==='undefined'&&typeof _0x1b75b8[_0x96e6('0x23')]===_0x96e6('0x24');var _0x20da83=_0x8e9578[_0x96e6('0x25')];var _0x3b6ef8=_0xa4e76c?0x0:_0x1b75b8[_0x96e6('0x22')];var _0x26d867=_0xa4e76c?_0x8e9578[_0x96e6('0x25')]:_0x1b75b8[_0x96e6('0x22')]+_0x1b75b8[_0x96e6('0x23')];var _0x2d7c2f;if(_0x26d867>=_0x20da83){_0x26d867=_0x20da83;_0x2d7c2f=0xc8;}else{_0x2d7c2f=0xce;}_0x483f45[_0x96e6('0x20')](_0x2d7c2f);return _0x483f45[_0x96e6('0x26')](_0x96e6('0x27'),_0x3b6ef8+'-'+_0x26d867+'/'+_0x20da83)[_0x96e6('0x21')](_0x8e9578);}return null;};}function patchUpdates(_0x4be907){return function(_0x4c8b51){try{jsonpatch[_0x96e6('0x28')](_0x4c8b51,_0x4be907,!![]);}catch(_0x3c1f74){return BPromise['reject'](_0x3c1f74);}return _0x4c8b51[_0x96e6('0x29')]();};}function saveUpdates(_0x5ae600,_0x371c72){return function(_0x1385c3){if(_0x1385c3){return _0x1385c3['update'](_0x5ae600)[_0x96e6('0x2a')](function(_0x2ce950){return _0x2ce950;});}return null;};}function removeEntity(_0x2fccb1,_0x35c041){return function(_0x1a8585){if(_0x1a8585){return _0x1a8585[_0x96e6('0x2b')]()[_0x96e6('0x2a')](function(){var _0x32228c=_0x1a8585['get']({'plain':!![]});var _0x267247='CustomDashboards';return db[_0x96e6('0x2c')][_0x96e6('0x2b')]({'where':{'type':_0x267247,'resourceId':_0x32228c['id']}})[_0x96e6('0x2a')](function(){return _0x1a8585;});})[_0x96e6('0x2a')](function(){_0x2fccb1['status'](0xcc)[_0x96e6('0x2d')]();});}};}function handleEntityNotFound(_0x21d164,_0x4fce30){return function(_0x2f6dc1){if(!_0x2f6dc1){_0x21d164['sendStatus'](0x194);}return _0x2f6dc1;};}function handleError(_0x3f1ee7,_0x15418b){_0x15418b=_0x15418b||0x1f4;return function(_0xb25251){logger[_0x96e6('0x2e')](_0xb25251[_0x96e6('0x2f')]);if(_0xb25251['name']){delete _0xb25251[_0x96e6('0x30')];}_0x3f1ee7[_0x96e6('0x20')](_0x15418b)['send'](_0xb25251);};}exports[_0x96e6('0x31')]=function(_0x392dcc,_0x3022e0){var _0x4b86dc={},_0x5a53f8={},_0x1c7879={'count':0x0,'rows':[]};var _0x173b74=_[_0x96e6('0x32')](db[_0x96e6('0x33')][_0x96e6('0x34')],function(_0x225deb){return{'name':_0x225deb[_0x96e6('0x35')],'type':_0x225deb[_0x96e6('0x36')][_0x96e6('0x37')]};});_0x5a53f8[_0x96e6('0x38')]=_[_0x96e6('0x32')](_0x173b74,'name');_0x5a53f8['query']=_[_0x96e6('0x39')](_0x392dcc[_0x96e6('0x3a')]);_0x5a53f8[_0x96e6('0x3b')]=_[_0x96e6('0x3c')](_0x5a53f8[_0x96e6('0x38')],_0x5a53f8['query']);_0x4b86dc[_0x96e6('0x3d')]=_[_0x96e6('0x3c')](_0x5a53f8['model'],qs[_0x96e6('0x3e')](_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x3e')]));_0x4b86dc[_0x96e6('0x3d')]=_0x4b86dc[_0x96e6('0x3d')][_0x96e6('0x3f')]?_0x4b86dc[_0x96e6('0x3d')]:_0x5a53f8[_0x96e6('0x38')];if(!_0x392dcc['query']['hasOwnProperty'](_0x96e6('0x40'))){_0x4b86dc[_0x96e6('0x23')]=qs[_0x96e6('0x23')](_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x23')]);_0x4b86dc[_0x96e6('0x22')]=qs[_0x96e6('0x22')](_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x22')]);}_0x4b86dc[_0x96e6('0x41')]=qs[_0x96e6('0x42')](_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x42')]);_0x4b86dc['where']=qs['filters'](_['pick'](_0x392dcc[_0x96e6('0x3a')],_0x5a53f8['filters']),_0x173b74);if(_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x43')]){_0x4b86dc[_0x96e6('0x44')]=_[_0x96e6('0x45')](_0x4b86dc[_0x96e6('0x44')],{'$or':_['map'](_0x173b74,function(_0x472f93){if(_0x472f93[_0x96e6('0x36')]!=='VIRTUAL'){var _0x10615e={};_0x10615e[_0x472f93[_0x96e6('0x30')]]={'$like':'%'+_0x392dcc[_0x96e6('0x3a')][_0x96e6('0x43')]+'%'};return _0x10615e;}})});}_0x4b86dc=_[_0x96e6('0x45')]({},_0x4b86dc,_0x392dcc[_0x96e6('0x46')]);var _0x27cbc8={'where':_0x4b86dc['where']};return db[_0x96e6('0x33')]['count'](_0x27cbc8)['then'](function(_0x498283){_0x1c7879['count']=_0x498283;if(_0x392dcc['query'][_0x96e6('0x47')]){_0x4b86dc['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x4b86dc);})[_0x96e6('0x2a')](function(_0x5a4e3c){_0x1c7879[_0x96e6('0x48')]=_0x5a4e3c;return _0x1c7879;})[_0x96e6('0x2a')](respondWithFilteredResult(_0x3022e0,_0x4b86dc))[_0x96e6('0x49')](handleError(_0x3022e0,null));};exports[_0x96e6('0x4a')]=function(_0x7fde3b,_0x4f851f){var _0x41b6d6={'raw':![],'where':{'id':_0x7fde3b[_0x96e6('0x4b')]['id']}},_0x490430={};_0x490430[_0x96e6('0x38')]=_[_0x96e6('0x39')](db[_0x96e6('0x33')][_0x96e6('0x34')]);_0x490430[_0x96e6('0x3a')]=_[_0x96e6('0x39')](_0x7fde3b[_0x96e6('0x3a')]);_0x490430[_0x96e6('0x3b')]=_[_0x96e6('0x3c')](_0x490430[_0x96e6('0x38')],_0x490430['query']);_0x41b6d6[_0x96e6('0x3d')]=_[_0x96e6('0x3c')](_0x490430[_0x96e6('0x38')],qs[_0x96e6('0x3e')](_0x7fde3b[_0x96e6('0x3a')][_0x96e6('0x3e')]));_0x41b6d6[_0x96e6('0x3d')]=_0x41b6d6[_0x96e6('0x3d')][_0x96e6('0x3f')]?_0x41b6d6['attributes']:_0x490430[_0x96e6('0x38')];if(_0x7fde3b['query'][_0x96e6('0x47')]){_0x41b6d6[_0x96e6('0x4c')]=[{'all':!![]}];}_0x41b6d6=_[_0x96e6('0x45')]({},_0x41b6d6,_0x7fde3b[_0x96e6('0x46')]);return db[_0x96e6('0x33')][_0x96e6('0x4d')](_0x41b6d6)[_0x96e6('0x2a')](handleEntityNotFound(_0x4f851f,null))['then'](respondWithResult(_0x4f851f,null))['catch'](handleError(_0x4f851f,null));};exports[_0x96e6('0x4e')]=function(_0x1e07ff,_0x2fe5fb){return db[_0x96e6('0x33')]['create'](_0x1e07ff['body'],{})['then'](function(_0x2e4acd){var _0x2d2330=_0x1e07ff['user'][_0x96e6('0x4f')]({'plain':!![]});if(!_0x2d2330)throw new Error(_0x96e6('0x50'));if(_0x2d2330[_0x96e6('0x51')]===_0x96e6('0x52')){var _0x2b327c=_0x2e4acd[_0x96e6('0x4f')]({'plain':!![]});var _0x2aca52=_0x96e6('0x53');return db['UserProfileSection'][_0x96e6('0x4d')]({'where':{'name':_0x2aca52,'userProfileId':_0x2d2330[_0x96e6('0x54')]},'raw':!![]})['then'](function(_0xbcd4ef){if(_0xbcd4ef&&_0xbcd4ef['autoAssociation']===0x0){return db[_0x96e6('0x2c')]['create']({'name':_0x2b327c[_0x96e6('0x30')],'resourceId':_0x2b327c['id'],'type':_0xbcd4ef[_0x96e6('0x30')],'sectionId':_0xbcd4ef['id']},{})[_0x96e6('0x2a')](function(){return _0x2e4acd;});}else{return _0x2e4acd;}})[_0x96e6('0x49')](function(_0x1f7893){logger['error'](_0x96e6('0x55'),_0x1f7893);throw _0x1f7893;});}return _0x2e4acd;})[_0x96e6('0x2a')](respondWithResult(_0x2fe5fb,0xc9))[_0x96e6('0x49')](handleError(_0x2fe5fb,null));};exports['clone']=function(_0x52cb18,_0x3f4695){var _0x497186={'where':{'id':_0x52cb18[_0x96e6('0x4b')]['id']}},_0x46d91f={};_0x46d91f[_0x96e6('0x38')]=_[_0x96e6('0x39')](db[_0x96e6('0x33')][_0x96e6('0x34')]);_0x497186[_0x96e6('0x3d')]=_[_0x96e6('0x3c')](_0x46d91f[_0x96e6('0x38')],qs['fields'](_0x52cb18[_0x96e6('0x3a')][_0x96e6('0x3e')]));_0x497186[_0x96e6('0x3d')]=_0x497186[_0x96e6('0x3d')][_0x96e6('0x3f')]?_0x497186[_0x96e6('0x3d')]:_0x46d91f['model'];if(_0x52cb18[_0x96e6('0x3a')][_0x96e6('0x47')]){_0x497186['include']=[{'all':!![]}];}_0x497186=_['merge']({},_0x497186,_0x52cb18[_0x96e6('0x46')]);return db['Dashboard']['find'](_0x497186)[_0x96e6('0x2a')](handleEntityNotFound(_0x3f4695,null))[_0x96e6('0x2a')](function(_0x2e7eb7){if(_0x2e7eb7){var _0x4f896b=_0x2e7eb7[_0x96e6('0x4f')]({'plain':!![]});_0x4f896b=qs[_0x96e6('0x56')](_0x4f896b,['id',_0x96e6('0x57'),_0x96e6('0x58')]);_0x52cb18['body']=_[_0x96e6('0x56')](_0x52cb18['body'],['id','createdAt',_0x96e6('0x58')]);return db['Dashboard'][_0x96e6('0x4e')](_['merge'](_0x4f896b,_0x52cb18['body']),{'include':_0x52cb18[_0x96e6('0x3a')][_0x96e6('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x383fd9){var _0x465cc2=_0x52cb18[_0x96e6('0x52')][_0x96e6('0x4f')]({'plain':!![]});if(!_0x465cc2)throw new Error(_0x96e6('0x50'));if(_0x465cc2[_0x96e6('0x51')]===_0x96e6('0x52')){var _0x1ce69e=_0x383fd9[_0x96e6('0x4f')]({'plain':!![]});var _0x44c04a='CustomDashboards';return db[_0x96e6('0x59')][_0x96e6('0x4d')]({'where':{'name':_0x44c04a,'userProfileId':_0x465cc2['userProfileId']},'raw':!![]})[_0x96e6('0x2a')](function(_0x452b26){if(_0x452b26&&_0x452b26[_0x96e6('0x5a')]===0x0){return db[_0x96e6('0x2c')][_0x96e6('0x4e')]({'name':_0x1ce69e[_0x96e6('0x30')],'resourceId':_0x1ce69e['id'],'type':_0x452b26[_0x96e6('0x30')],'sectionId':_0x452b26['id']},{})[_0x96e6('0x2a')](function(){return _0x383fd9;});}else{return _0x383fd9;}})['catch'](function(_0x52f203){logger[_0x96e6('0x2e')](_0x96e6('0x55'),_0x52f203);throw _0x52f203;});}return _0x383fd9;});}})[_0x96e6('0x2a')](respondWithResult(_0x3f4695,0xc9))['catch'](handleError(_0x3f4695,null));};exports[_0x96e6('0x5b')]=function(_0x49bf6c,_0x155758){if(_0x49bf6c['body']['id']){delete _0x49bf6c[_0x96e6('0x5c')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x49bf6c['params']['id']}})['then'](handleEntityNotFound(_0x155758,null))[_0x96e6('0x2a')](saveUpdates(_0x49bf6c[_0x96e6('0x5c')],null))[_0x96e6('0x2a')](respondWithResult(_0x155758,null))[_0x96e6('0x49')](handleError(_0x155758,null));};exports[_0x96e6('0x2b')]=function(_0x5a75c8,_0x4a487c){return db['Dashboard'][_0x96e6('0x4d')]({'where':{'id':_0x5a75c8[_0x96e6('0x4b')]['id']}})[_0x96e6('0x2a')](handleEntityNotFound(_0x4a487c,null))[_0x96e6('0x2a')](removeEntity(_0x4a487c,null))[_0x96e6('0x49')](handleError(_0x4a487c,null));};function widgetAttributes(_0x38f3ee){try{switch(_0x38f3ee[_0x96e6('0x36')]){case _0x96e6('0x5d'):return[{'name':_0x96e6('0x5e'),'value':_0x38f3ee['attrUrl']||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee[_0x96e6('0x5f')][0x0][_0x96e6('0x60')]:undefined)||_0x96e6('0x61')}];case'custom':return[{'name':'attrPath','value':_0x38f3ee[_0x96e6('0x62')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee['attrs'][0x0][_0x96e6('0x60')]:undefined)||''}];case'clock':return[{'name':_0x96e6('0x63'),'value':_0x38f3ee[_0x96e6('0x63')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee['attrs'][0x0]['value']:undefined)||_0x96e6('0x64')},{'name':'attrTimezone','value':_0x38f3ee['attrTimezone']||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x1]?_0x38f3ee['attrs'][0x1]['value']:undefined)||_0x96e6('0x65')},{'name':_0x96e6('0x66'),'value':_0x38f3ee['attrFontSize']||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee['attrs'][0x2]?_0x38f3ee[_0x96e6('0x5f')][0x2][_0x96e6('0x60')]:undefined)||0xc}];case _0x96e6('0x67'):return[{'name':_0x96e6('0x68'),'value':_0x38f3ee[_0x96e6('0x68')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee['attrs'][0x0]?_0x38f3ee[_0x96e6('0x5f')][0x0][_0x96e6('0x60')]:undefined)||_0x96e6('0x69')},{'name':_0x96e6('0x6a'),'value':_0x38f3ee[_0x96e6('0x6a')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x1]?_0x38f3ee[_0x96e6('0x5f')][0x1][_0x96e6('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x38f3ee[_0x96e6('0x66')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x2]?_0x38f3ee[_0x96e6('0x5f')][0x2][_0x96e6('0x60')]:undefined)||0x14}];case _0x96e6('0x6b'):case _0x96e6('0x6c'):return[{'name':_0x96e6('0x6d'),'value':_0x38f3ee[_0x96e6('0x6d')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee[_0x96e6('0x5f')][0x0]['value']:undefined)||_0x96e6('0x69')},{'name':'attrSerie2','value':_0x38f3ee['attrSerie2']||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x1]?_0x38f3ee['attrs'][0x1][_0x96e6('0x60')]:undefined)||null},{'name':_0x96e6('0x6e'),'value':_0x38f3ee[_0x96e6('0x6e')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x2]?_0x38f3ee[_0x96e6('0x5f')][0x2][_0x96e6('0x60')]:undefined)||null},{'name':_0x96e6('0x6a'),'value':_0x38f3ee['attrVoiceQueues']||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x3]?_0x38f3ee[_0x96e6('0x5f')][0x3][_0x96e6('0x60')]:undefined)||[]}];case _0x96e6('0x6f'):return[{'name':_0x96e6('0x70'),'type':_0x38f3ee[_0x96e6('0x71')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee[_0x96e6('0x5f')][0x0][_0x96e6('0x36')]:undefined)||null,'value':_0x38f3ee[_0x96e6('0x70')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x0]?_0x38f3ee[_0x96e6('0x5f')][0x0][_0x96e6('0x60')]:undefined)||null},{'name':_0x96e6('0x72'),'value':_0x38f3ee[_0x96e6('0x72')]||(_0x38f3ee[_0x96e6('0x5f')]&&_0x38f3ee[_0x96e6('0x5f')][0x1]?_0x38f3ee['attrs'][0x1][_0x96e6('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x5a4cd8){logger['error'](_0x96e6('0x73'),JSON[_0x96e6('0x74')](_0x5a4cd8));return[];}}exports[_0x96e6('0x75')]=function(_0x42e6dd,_0x448d13,_0x3f139c){if(_0x42e6dd[_0x96e6('0x5c')]['id']){delete _0x42e6dd[_0x96e6('0x5c')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x42e6dd[_0x96e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x448d13,null))['then'](function(_0xe2a2d5){if(_0xe2a2d5){_0x42e6dd[_0x96e6('0x5c')][_0x96e6('0x76')]=_0xe2a2d5['id'];_0x42e6dd[_0x96e6('0x5c')][_0x96e6('0x5f')]=widgetAttributes(_0x42e6dd['body']);return db[_0x96e6('0x77')]['create'](_0x42e6dd[_0x96e6('0x5c')]);}})[_0x96e6('0x2a')](respondWithResult(_0x448d13,null))[_0x96e6('0x49')](handleError(_0x448d13,null));};exports[_0x96e6('0x78')]=function(_0x345193,_0x57b46b,_0x46792c){var _0x5797d6={};var _0x3d3544={};var _0x23b17a;var _0x4304e7;return db[_0x96e6('0x33')][_0x96e6('0x79')]({'where':{'id':_0x345193[_0x96e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x57b46b,null))['then'](function(_0x4f5de9){if(_0x4f5de9){_0x23b17a=_0x4f5de9;_0x3d3544['model']=_[_0x96e6('0x39')](db[_0x96e6('0x77')][_0x96e6('0x34')]);_0x3d3544['query']=_[_0x96e6('0x39')](_0x345193[_0x96e6('0x3a')]);_0x3d3544[_0x96e6('0x3b')]=_['intersection'](_0x3d3544[_0x96e6('0x38')],_0x3d3544[_0x96e6('0x3a')]);_0x5797d6['attributes']=_[_0x96e6('0x3c')](_0x3d3544[_0x96e6('0x38')],qs[_0x96e6('0x3e')](_0x345193[_0x96e6('0x3a')][_0x96e6('0x3e')]));_0x5797d6[_0x96e6('0x3d')]=_0x5797d6['attributes'][_0x96e6('0x3f')]?_0x5797d6[_0x96e6('0x3d')]:_0x3d3544[_0x96e6('0x38')];_0x5797d6[_0x96e6('0x41')]=qs[_0x96e6('0x42')](_0x345193['query'][_0x96e6('0x42')]);_0x5797d6['where']=qs[_0x96e6('0x3b')](_[_0x96e6('0x7a')](_0x345193[_0x96e6('0x3a')],_0x3d3544['filters']));if(_0x345193[_0x96e6('0x3a')][_0x96e6('0x43')]){_0x5797d6['where']=_[_0x96e6('0x45')](_0x5797d6[_0x96e6('0x44')],{'$or':_[_0x96e6('0x32')](_0x5797d6[_0x96e6('0x3d')],function(_0x5c0bc1){var _0x42fa3a={};_0x42fa3a[_0x5c0bc1]={'$like':'%'+_0x345193[_0x96e6('0x3a')]['filter']+'%'};return _0x42fa3a;})});}_0x5797d6=_[_0x96e6('0x45')]({},_0x5797d6,_0x345193['options']);return _0x23b17a[_0x96e6('0x78')](_0x5797d6);}})[_0x96e6('0x2a')](function(_0x3d91ca){if(_0x3d91ca){_0x4304e7=_0x3d91ca[_0x96e6('0x3f')];if(!_0x345193[_0x96e6('0x3a')]['hasOwnProperty'](_0x96e6('0x40'))){_0x5797d6['limit']=qs['limit'](_0x345193[_0x96e6('0x3a')][_0x96e6('0x23')]);_0x5797d6[_0x96e6('0x22')]=qs[_0x96e6('0x22')](_0x345193['query'][_0x96e6('0x22')]);}return _0x23b17a[_0x96e6('0x78')](_0x5797d6);}})[_0x96e6('0x2a')](function(_0x5b342a){if(_0x5b342a){return _0x5b342a?{'count':_0x4304e7,'rows':_0x5b342a}:null;}})[_0x96e6('0x2a')](respondWithResult(_0x57b46b,null))[_0x96e6('0x49')](handleError(_0x57b46b,null));}; \ No newline at end of file +var _0x84d3=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','key','map','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','Dashboard','findAll','rows','show','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x160e3a,_0x50df21){var _0x242423=function(_0x1295e0){while(--_0x1295e0){_0x160e3a['push'](_0x160e3a['shift']());}};_0x242423(++_0x50df21);}(_0x84d3,0x1e9));var _0x384d=function(_0x241a7b,_0x30665f){_0x241a7b=_0x241a7b-0x0;var _0x541720=_0x84d3[_0x241a7b];return _0x541720;};'use strict';var emlformat=require(_0x384d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x384d('0x1'));var jsonpatch=require(_0x384d('0x2'));var rp=require(_0x384d('0x3'));var moment=require(_0x384d('0x4'));var BPromise=require(_0x384d('0x5'));var Mustache=require(_0x384d('0x6'));var util=require('util');var path=require(_0x384d('0x7'));var sox=require(_0x384d('0x8'));var csv=require('to-csv');var ejs=require(_0x384d('0x9'));var fs=require('fs');var fs_extra=require(_0x384d('0xa'));var _=require(_0x384d('0xb'));var squel=require(_0x384d('0xc'));var crypto=require(_0x384d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x384d('0xe'));var toCsv=require(_0x384d('0xf'));var querystring=require(_0x384d('0x10'));var Papa=require(_0x384d('0x11'));var Redis=require(_0x384d('0x12'));var authService=require(_0x384d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x384d('0x14'));var hardwareService=require(_0x384d('0x15'));var logger=require(_0x384d('0x16'))(_0x384d('0x17'));var utils=require(_0x384d('0x18'));var config=require(_0x384d('0x19'));var licenseUtil=require(_0x384d('0x1a'));var db=require(_0x384d('0x1b'))['db'];config[_0x384d('0x1c')]=_[_0x384d('0x1d')](config[_0x384d('0x1c')],{'host':_0x384d('0x1e'),'port':0x18eb});var socket=require(_0x384d('0x1f'))(new Redis(config['redis']));require(_0x384d('0x20'))[_0x384d('0x21')](socket);function respondWithStatusCode(_0x2ac155,_0xca601a){_0xca601a=_0xca601a||0xcc;return function(_0x5647f7){if(_0x5647f7){return _0x2ac155[_0x384d('0x22')](_0xca601a);}return _0x2ac155[_0x384d('0x23')](_0xca601a)[_0x384d('0x24')]();};}function respondWithResult(_0x404b5e,_0x3b7c4f){_0x3b7c4f=_0x3b7c4f||0xc8;return function(_0x5d26b1){if(_0x5d26b1){return _0x404b5e['status'](_0x3b7c4f)[_0x384d('0x25')](_0x5d26b1);}};}function respondWithFilteredResult(_0x22d469,_0x33525a){return function(_0x34b248){if(_0x34b248){var _0x1a2253=typeof _0x33525a['offset']===_0x384d('0x26')&&typeof _0x33525a[_0x384d('0x27')]===_0x384d('0x26');var _0x8591da=_0x34b248['count'];var _0x54cf30=_0x1a2253?0x0:_0x33525a['offset'];var _0x45bc75=_0x1a2253?_0x34b248[_0x384d('0x28')]:_0x33525a[_0x384d('0x29')]+_0x33525a[_0x384d('0x27')];var _0x225bc3;if(_0x45bc75>=_0x8591da){_0x45bc75=_0x8591da;_0x225bc3=0xc8;}else{_0x225bc3=0xce;}_0x22d469[_0x384d('0x23')](_0x225bc3);return _0x22d469[_0x384d('0x2a')]('Content-Range',_0x54cf30+'-'+_0x45bc75+'/'+_0x8591da)[_0x384d('0x25')](_0x34b248);}return null;};}function patchUpdates(_0x2fa623){return function(_0x17495f){try{jsonpatch['apply'](_0x17495f,_0x2fa623,!![]);}catch(_0x22edb8){return BPromise[_0x384d('0x2b')](_0x22edb8);}return _0x17495f['save']();};}function saveUpdates(_0x440812,_0x270440){return function(_0x43b450){if(_0x43b450){return _0x43b450[_0x384d('0x2c')](_0x440812)['then'](function(_0x3a39b7){return _0x3a39b7;});}return null;};}function removeEntity(_0x4bac9b,_0x113157){return function(_0x30bfec){if(_0x30bfec){return _0x30bfec[_0x384d('0x2d')]()[_0x384d('0x2e')](function(){var _0x16dcb2=_0x30bfec[_0x384d('0x2f')]({'plain':!![]});var _0x4acafa=_0x384d('0x30');return db[_0x384d('0x31')][_0x384d('0x2d')]({'where':{'type':_0x4acafa,'resourceId':_0x16dcb2['id']}})['then'](function(){return _0x30bfec;});})[_0x384d('0x2e')](function(){_0x4bac9b[_0x384d('0x23')](0xcc)[_0x384d('0x24')]();});}};}function handleEntityNotFound(_0x1a5ff4,_0x24966c){return function(_0x2b75a5){if(!_0x2b75a5){_0x1a5ff4[_0x384d('0x22')](0x194);}return _0x2b75a5;};}function handleError(_0xe2ffc4,_0x154d23){_0x154d23=_0x154d23||0x1f4;return function(_0x2b6416){logger[_0x384d('0x32')](_0x2b6416[_0x384d('0x33')]);if(_0x2b6416[_0x384d('0x34')]){delete _0x2b6416[_0x384d('0x34')];}_0xe2ffc4[_0x384d('0x23')](_0x154d23)[_0x384d('0x35')](_0x2b6416);};}exports['index']=function(_0x4d2092,_0x31496d){var _0x73c939={},_0xb927ad={},_0x4a1c70={'count':0x0,'rows':[]};var _0x2d5d46=_['map'](db['Dashboard'][_0x384d('0x36')],function(_0x2d4972){return{'name':_0x2d4972[_0x384d('0x37')],'type':_0x2d4972['type'][_0x384d('0x38')]};});_0xb927ad['model']=_[_0x384d('0x39')](_0x2d5d46,_0x384d('0x34'));_0xb927ad[_0x384d('0x3a')]=_['keys'](_0x4d2092['query']);_0xb927ad['filters']=_['intersection'](_0xb927ad[_0x384d('0x3b')],_0xb927ad[_0x384d('0x3a')]);_0x73c939['attributes']=_[_0x384d('0x3c')](_0xb927ad[_0x384d('0x3b')],qs[_0x384d('0x3d')](_0x4d2092[_0x384d('0x3a')]['fields']));_0x73c939[_0x384d('0x3e')]=_0x73c939[_0x384d('0x3e')][_0x384d('0x3f')]?_0x73c939[_0x384d('0x3e')]:_0xb927ad['model'];if(!_0x4d2092[_0x384d('0x3a')][_0x384d('0x40')](_0x384d('0x41'))){_0x73c939[_0x384d('0x27')]=qs['limit'](_0x4d2092[_0x384d('0x3a')][_0x384d('0x27')]);_0x73c939['offset']=qs[_0x384d('0x29')](_0x4d2092[_0x384d('0x3a')][_0x384d('0x29')]);}_0x73c939[_0x384d('0x42')]=qs[_0x384d('0x43')](_0x4d2092[_0x384d('0x3a')][_0x384d('0x43')]);_0x73c939[_0x384d('0x44')]=qs[_0x384d('0x45')](_['pick'](_0x4d2092[_0x384d('0x3a')],_0xb927ad[_0x384d('0x45')]),_0x2d5d46);if(_0x4d2092[_0x384d('0x3a')][_0x384d('0x46')]){_0x73c939[_0x384d('0x44')]=_[_0x384d('0x47')](_0x73c939[_0x384d('0x44')],{'$or':_[_0x384d('0x39')](_0x2d5d46,function(_0x46003c){if(_0x46003c[_0x384d('0x48')]!==_0x384d('0x49')){var _0x5bd8dc={};_0x5bd8dc[_0x46003c[_0x384d('0x34')]]={'$like':'%'+_0x4d2092[_0x384d('0x3a')][_0x384d('0x46')]+'%'};return _0x5bd8dc;}})});}_0x73c939=_[_0x384d('0x47')]({},_0x73c939,_0x4d2092[_0x384d('0x4a')]);var _0x4fd5e6={'where':_0x73c939[_0x384d('0x44')]};return db['Dashboard'][_0x384d('0x28')](_0x4fd5e6)['then'](function(_0x171d99){_0x4a1c70[_0x384d('0x28')]=_0x171d99;if(_0x4d2092[_0x384d('0x3a')][_0x384d('0x4b')]){_0x73c939[_0x384d('0x4c')]=[{'all':!![]}];}return db[_0x384d('0x4d')][_0x384d('0x4e')](_0x73c939);})[_0x384d('0x2e')](function(_0x544ff3){_0x4a1c70[_0x384d('0x4f')]=_0x544ff3;return _0x4a1c70;})['then'](respondWithFilteredResult(_0x31496d,_0x73c939))['catch'](handleError(_0x31496d,null));};exports[_0x384d('0x50')]=function(_0x52832c,_0x565528){var _0x55f096={'raw':![],'where':{'id':_0x52832c['params']['id']}},_0x546615={};_0x546615[_0x384d('0x3b')]=_[_0x384d('0x51')](db['Dashboard'][_0x384d('0x36')]);_0x546615[_0x384d('0x3a')]=_[_0x384d('0x51')](_0x52832c['query']);_0x546615[_0x384d('0x45')]=_[_0x384d('0x3c')](_0x546615[_0x384d('0x3b')],_0x546615[_0x384d('0x3a')]);_0x55f096[_0x384d('0x3e')]=_[_0x384d('0x3c')](_0x546615[_0x384d('0x3b')],qs['fields'](_0x52832c['query']['fields']));_0x55f096[_0x384d('0x3e')]=_0x55f096[_0x384d('0x3e')][_0x384d('0x3f')]?_0x55f096[_0x384d('0x3e')]:_0x546615[_0x384d('0x3b')];if(_0x52832c['query']['includeAll']){_0x55f096['include']=[{'all':!![]}];}_0x55f096=_[_0x384d('0x47')]({},_0x55f096,_0x52832c[_0x384d('0x4a')]);return db[_0x384d('0x4d')][_0x384d('0x52')](_0x55f096)['then'](handleEntityNotFound(_0x565528,null))[_0x384d('0x2e')](respondWithResult(_0x565528,null))[_0x384d('0x53')](handleError(_0x565528,null));};exports[_0x384d('0x54')]=function(_0x49e709,_0x1bc25c){return db['Dashboard'][_0x384d('0x54')](_0x49e709[_0x384d('0x55')],{})[_0x384d('0x2e')](function(_0x3d9264){var _0x13b3da=_0x49e709[_0x384d('0x56')][_0x384d('0x2f')]({'plain':!![]});if(!_0x13b3da)throw new Error(_0x384d('0x57'));if(_0x13b3da[_0x384d('0x58')]==='user'){var _0x59ac75=_0x3d9264['get']({'plain':!![]});var _0x96bd48=_0x384d('0x30');return db[_0x384d('0x59')]['find']({'where':{'name':_0x96bd48,'userProfileId':_0x13b3da[_0x384d('0x5a')]},'raw':!![]})[_0x384d('0x2e')](function(_0x1206f3){if(_0x1206f3&&_0x1206f3[_0x384d('0x5b')]===0x0){return db[_0x384d('0x31')][_0x384d('0x54')]({'name':_0x59ac75[_0x384d('0x34')],'resourceId':_0x59ac75['id'],'type':_0x1206f3[_0x384d('0x34')],'sectionId':_0x1206f3['id']},{})[_0x384d('0x2e')](function(){return _0x3d9264;});}else{return _0x3d9264;}})[_0x384d('0x53')](function(_0x283598){logger[_0x384d('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x283598);throw _0x283598;});}return _0x3d9264;})[_0x384d('0x2e')](respondWithResult(_0x1bc25c,0xc9))[_0x384d('0x53')](handleError(_0x1bc25c,null));};exports['clone']=function(_0x1b5033,_0x3a7ea9){var _0x32beac={'where':{'id':_0x1b5033[_0x384d('0x5c')]['id']}},_0xd918e1={};_0xd918e1[_0x384d('0x3b')]=_['keys'](db[_0x384d('0x4d')][_0x384d('0x36')]);_0x32beac[_0x384d('0x3e')]=_[_0x384d('0x3c')](_0xd918e1[_0x384d('0x3b')],qs[_0x384d('0x3d')](_0x1b5033['query'][_0x384d('0x3d')]));_0x32beac[_0x384d('0x3e')]=_0x32beac[_0x384d('0x3e')]['length']?_0x32beac[_0x384d('0x3e')]:_0xd918e1[_0x384d('0x3b')];if(_0x1b5033['query'][_0x384d('0x4b')]){_0x32beac[_0x384d('0x4c')]=[{'all':!![]}];}_0x32beac=_[_0x384d('0x47')]({},_0x32beac,_0x1b5033[_0x384d('0x4a')]);return db['Dashboard']['find'](_0x32beac)[_0x384d('0x2e')](handleEntityNotFound(_0x3a7ea9,null))[_0x384d('0x2e')](function(_0x3a2fdb){if(_0x3a2fdb){var _0x1c8c58=_0x3a2fdb[_0x384d('0x2f')]({'plain':!![]});_0x1c8c58=qs[_0x384d('0x5d')](_0x1c8c58,['id',_0x384d('0x5e'),'updatedAt']);_0x1b5033[_0x384d('0x55')]=_[_0x384d('0x5d')](_0x1b5033[_0x384d('0x55')],['id',_0x384d('0x5e'),_0x384d('0x5f')]);return db['Dashboard'][_0x384d('0x54')](_[_0x384d('0x47')](_0x1c8c58,_0x1b5033[_0x384d('0x55')]),{'include':_0x1b5033[_0x384d('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2b47a1){var _0xe31cf8=_0x1b5033[_0x384d('0x56')]['get']({'plain':!![]});if(!_0xe31cf8)throw new Error(_0x384d('0x57'));if(_0xe31cf8[_0x384d('0x58')]===_0x384d('0x56')){var _0x542fc5=_0x2b47a1['get']({'plain':!![]});var _0x22b876=_0x384d('0x30');return db['UserProfileSection'][_0x384d('0x52')]({'where':{'name':_0x22b876,'userProfileId':_0xe31cf8['userProfileId']},'raw':!![]})[_0x384d('0x2e')](function(_0x3a119e){if(_0x3a119e&&_0x3a119e[_0x384d('0x5b')]===0x0){return db['UserProfileResource'][_0x384d('0x54')]({'name':_0x542fc5[_0x384d('0x34')],'resourceId':_0x542fc5['id'],'type':_0x3a119e['name'],'sectionId':_0x3a119e['id']},{})['then'](function(){return _0x2b47a1;});}else{return _0x2b47a1;}})[_0x384d('0x53')](function(_0xa2c5ae){logger['error'](_0x384d('0x60'),_0xa2c5ae);throw _0xa2c5ae;});}return _0x2b47a1;});}})[_0x384d('0x2e')](respondWithResult(_0x3a7ea9,0xc9))[_0x384d('0x53')](handleError(_0x3a7ea9,null));};exports[_0x384d('0x2c')]=function(_0x2035d9,_0x194f67){if(_0x2035d9[_0x384d('0x55')]['id']){delete _0x2035d9[_0x384d('0x55')]['id'];}return db[_0x384d('0x4d')][_0x384d('0x52')]({'where':{'id':_0x2035d9[_0x384d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x194f67,null))[_0x384d('0x2e')](saveUpdates(_0x2035d9[_0x384d('0x55')],null))[_0x384d('0x2e')](respondWithResult(_0x194f67,null))[_0x384d('0x53')](handleError(_0x194f67,null));};exports[_0x384d('0x2d')]=function(_0x3d8f4b,_0x3b7b3){return db[_0x384d('0x4d')][_0x384d('0x52')]({'where':{'id':_0x3d8f4b['params']['id']}})['then'](handleEntityNotFound(_0x3b7b3,null))['then'](removeEntity(_0x3b7b3,null))[_0x384d('0x53')](handleError(_0x3b7b3,null));};function widgetAttributes(_0x3040d4){try{switch(_0x3040d4[_0x384d('0x48')]){case _0x384d('0x61'):return[{'name':_0x384d('0x62'),'value':_0x3040d4[_0x384d('0x62')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x0]?_0x3040d4[_0x384d('0x63')][0x0][_0x384d('0x64')]:undefined)||_0x384d('0x65')}];case _0x384d('0x66'):return[{'name':_0x384d('0x67'),'value':_0x3040d4[_0x384d('0x67')]||(_0x3040d4['attrs']&&_0x3040d4['attrs'][0x0]?_0x3040d4[_0x384d('0x63')][0x0][_0x384d('0x64')]:undefined)||''}];case'clock':return[{'name':_0x384d('0x68'),'value':_0x3040d4[_0x384d('0x68')]||(_0x3040d4['attrs']&&_0x3040d4[_0x384d('0x63')][0x0]?_0x3040d4[_0x384d('0x63')][0x0][_0x384d('0x64')]:undefined)||_0x384d('0x69')},{'name':_0x384d('0x6a'),'value':_0x3040d4['attrTimezone']||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x1]?_0x3040d4[_0x384d('0x63')][0x1][_0x384d('0x64')]:undefined)||_0x384d('0x6b')},{'name':_0x384d('0x6c'),'value':_0x3040d4['attrFontSize']||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x2]?_0x3040d4[_0x384d('0x63')][0x2][_0x384d('0x64')]:undefined)||0xc}];case _0x384d('0x6d'):return[{'name':_0x384d('0x6e'),'value':_0x3040d4[_0x384d('0x6e')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x0]?_0x3040d4[_0x384d('0x63')][0x0][_0x384d('0x64')]:undefined)||_0x384d('0x6f')},{'name':_0x384d('0x70'),'value':_0x3040d4[_0x384d('0x70')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x1]?_0x3040d4['attrs'][0x1][_0x384d('0x64')]:undefined)||[]},{'name':'attrFontSize','value':_0x3040d4[_0x384d('0x6c')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x2]?_0x3040d4['attrs'][0x2][_0x384d('0x64')]:undefined)||0x14}];case _0x384d('0x71'):case _0x384d('0x72'):return[{'name':'attrSerie1','value':_0x3040d4[_0x384d('0x73')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4['attrs'][0x0]?_0x3040d4[_0x384d('0x63')][0x0]['value']:undefined)||_0x384d('0x6f')},{'name':'attrSerie2','value':_0x3040d4[_0x384d('0x74')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x1]?_0x3040d4[_0x384d('0x63')][0x1]['value']:undefined)||null},{'name':_0x384d('0x75'),'value':_0x3040d4[_0x384d('0x75')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4['attrs'][0x2]?_0x3040d4[_0x384d('0x63')][0x2][_0x384d('0x64')]:undefined)||null},{'name':_0x384d('0x70'),'value':_0x3040d4[_0x384d('0x70')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x3]?_0x3040d4['attrs'][0x3][_0x384d('0x64')]:undefined)||[]}];case _0x384d('0x76'):return[{'name':_0x384d('0x77'),'type':_0x3040d4[_0x384d('0x78')]||(_0x3040d4['attrs']&&_0x3040d4[_0x384d('0x63')][0x0]?_0x3040d4[_0x384d('0x63')][0x0]['type']:undefined)||null,'value':_0x3040d4[_0x384d('0x77')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x0]?_0x3040d4[_0x384d('0x63')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x3040d4[_0x384d('0x79')]||(_0x3040d4[_0x384d('0x63')]&&_0x3040d4[_0x384d('0x63')][0x1]?_0x3040d4[_0x384d('0x63')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x19f6b3){logger[_0x384d('0x32')]('widgetAttributes:\x20%s',JSON[_0x384d('0x7a')](_0x19f6b3));return[];}}exports[_0x384d('0x7b')]=function(_0x39fbaf,_0x22d502,_0x24ce23){if(_0x39fbaf[_0x384d('0x55')]['id']){delete _0x39fbaf[_0x384d('0x55')]['id'];}return db['Dashboard'][_0x384d('0x52')]({'where':{'id':_0x39fbaf[_0x384d('0x5c')]['id']}})[_0x384d('0x2e')](handleEntityNotFound(_0x22d502,null))[_0x384d('0x2e')](function(_0x3ef7ac){if(_0x3ef7ac){_0x39fbaf[_0x384d('0x55')][_0x384d('0x7c')]=_0x3ef7ac['id'];_0x39fbaf[_0x384d('0x55')][_0x384d('0x63')]=widgetAttributes(_0x39fbaf['body']);return db[_0x384d('0x7d')][_0x384d('0x54')](_0x39fbaf[_0x384d('0x55')]);}})[_0x384d('0x2e')](respondWithResult(_0x22d502,null))['catch'](handleError(_0x22d502,null));};exports['getItems']=function(_0x23c31b,_0x26ec1f,_0x4bc35b){var _0x468a0c={};var _0x397dcf={};var _0x44fa26;var _0x12968b;return db[_0x384d('0x4d')][_0x384d('0x7e')]({'where':{'id':_0x23c31b['params']['id']}})[_0x384d('0x2e')](handleEntityNotFound(_0x26ec1f,null))[_0x384d('0x2e')](function(_0x5a61b5){if(_0x5a61b5){_0x44fa26=_0x5a61b5;_0x397dcf[_0x384d('0x3b')]=_[_0x384d('0x51')](db[_0x384d('0x7d')][_0x384d('0x36')]);_0x397dcf[_0x384d('0x3a')]=_[_0x384d('0x51')](_0x23c31b[_0x384d('0x3a')]);_0x397dcf[_0x384d('0x45')]=_[_0x384d('0x3c')](_0x397dcf[_0x384d('0x3b')],_0x397dcf[_0x384d('0x3a')]);_0x468a0c[_0x384d('0x3e')]=_[_0x384d('0x3c')](_0x397dcf['model'],qs[_0x384d('0x3d')](_0x23c31b[_0x384d('0x3a')][_0x384d('0x3d')]));_0x468a0c[_0x384d('0x3e')]=_0x468a0c['attributes'][_0x384d('0x3f')]?_0x468a0c[_0x384d('0x3e')]:_0x397dcf[_0x384d('0x3b')];_0x468a0c[_0x384d('0x42')]=qs[_0x384d('0x43')](_0x23c31b[_0x384d('0x3a')][_0x384d('0x43')]);_0x468a0c[_0x384d('0x44')]=qs[_0x384d('0x45')](_['pick'](_0x23c31b['query'],_0x397dcf[_0x384d('0x45')]));if(_0x23c31b['query']['filter']){_0x468a0c[_0x384d('0x44')]=_[_0x384d('0x47')](_0x468a0c[_0x384d('0x44')],{'$or':_[_0x384d('0x39')](_0x468a0c['attributes'],function(_0x5cdf5f){var _0x1ff213={};_0x1ff213[_0x5cdf5f]={'$like':'%'+_0x23c31b[_0x384d('0x3a')]['filter']+'%'};return _0x1ff213;})});}_0x468a0c=_[_0x384d('0x47')]({},_0x468a0c,_0x23c31b['options']);return _0x44fa26[_0x384d('0x7f')](_0x468a0c);}})[_0x384d('0x2e')](function(_0x11c60e){if(_0x11c60e){_0x12968b=_0x11c60e['length'];if(!_0x23c31b[_0x384d('0x3a')][_0x384d('0x40')]('nolimit')){_0x468a0c[_0x384d('0x27')]=qs[_0x384d('0x27')](_0x23c31b[_0x384d('0x3a')][_0x384d('0x27')]);_0x468a0c['offset']=qs[_0x384d('0x29')](_0x23c31b[_0x384d('0x3a')][_0x384d('0x29')]);}return _0x44fa26['getItems'](_0x468a0c);}})[_0x384d('0x2e')](function(_0x4e6264){if(_0x4e6264){return _0x4e6264?{'count':_0x12968b,'rows':_0x4e6264}:null;}})['then'](respondWithResult(_0x26ec1f,null))[_0x384d('0x53')](handleError(_0x26ec1f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c7ed2b8..c15dcef 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 _0x874d=['../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x20a408,_0x52b275){var _0x53bb85=function(_0xf63fa0){while(--_0xf63fa0){_0x20a408['push'](_0x20a408['shift']());}};_0x53bb85(++_0x52b275);}(_0x874d,0x1e8));var _0xd874=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x874d[_0x3f1710];return _0x528458;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xd874('0x0'))['db'][_0xd874('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd874('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd874('0x3'),'afterDestroy':_0xd874('0x4')};function emitEvent(_0x1ecc89){return function(_0xc1eb3a,_0x5ea5b0,_0x29490f){DashboardEvents[_0xd874('0x5')](_0x1ecc89+':'+_0xc1eb3a['id'],_0xc1eb3a);DashboardEvents[_0xd874('0x5')](_0x1ecc89,_0xc1eb3a);_0x29490f(null);};}for(var e in events){if(events[_0xd874('0x6')](e)){var event=events[e];Dashboard[_0xd874('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x4629=['remove','emit','hasOwnProperty','hook','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0x4629,0x136));var _0x9462=function(_0x45e56c,_0x4235d0){_0x45e56c=_0x45e56c-0x0;var _0x4826ef=_0x4629[_0x45e56c];return _0x4826ef;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x9462('0x0'))['db'][_0x9462('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9462('0x2')](0x0);var events={'afterCreate':_0x9462('0x3'),'afterUpdate':_0x9462('0x4'),'afterDestroy':_0x9462('0x5')};function emitEvent(_0x313ede){return function(_0x21f6c8,_0x7bf915,_0x31fbad){DashboardEvents[_0x9462('0x6')](_0x313ede+':'+_0x21f6c8['id'],_0x21f6c8);DashboardEvents[_0x9462('0x6')](_0x313ede,_0x21f6c8);_0x31fbad(null);};}for(var e in events){if(events[_0x9462('0x7')](e)){var event=events[e];Dashboard[_0x9462('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 7370d6c..f63e99d 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 _0x302f=['./dashboard.attributes','exports','define','Dashboard','util','../../config/logger','api','path','rimraf'];(function(_0x5d72da,_0xb7ce32){var _0x43ebe7=function(_0x503755){while(--_0x503755){_0x5d72da['push'](_0x5d72da['shift']());}};_0x43ebe7(++_0xb7ce32);}(_0x302f,0x148));var _0xf302=function(_0x37c818,_0x16192f){_0x37c818=_0x37c818-0x0;var _0x32b670=_0x302f[_0x37c818];return _0x32b670;};'use strict';var _=require('lodash');var util=require(_0xf302('0x0'));var logger=require(_0xf302('0x1'))(_0xf302('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf302('0x3'));var rimraf=require(_0xf302('0x4'));var config=require('../../config/environment');var attributes=require(_0xf302('0x5'));module[_0xf302('0x6')]=function(_0x23bf92,_0x32cc27){return _0x23bf92[_0xf302('0x7')](_0xf302('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6423=['path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','api','moment','bluebird'];(function(_0x4eb075,_0x42ea7f){var _0x12eac1=function(_0x3ff60e){while(--_0x3ff60e){_0x4eb075['push'](_0x4eb075['shift']());}};_0x12eac1(++_0x42ea7f);}(_0x6423,0x15c));var _0x3642=function(_0xa5801e,_0x35ca25){_0xa5801e=_0xa5801e-0x0;var _0x1039e4=_0x6423[_0xa5801e];return _0x1039e4;};'use strict';var _=require(_0x3642('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3642('0x1'));var moment=require(_0x3642('0x2'));var BPromise=require(_0x3642('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3642('0x4'));var rimraf=require(_0x3642('0x5'));var config=require(_0x3642('0x6'));var attributes=require(_0x3642('0x7'));module[_0x3642('0x8')]=function(_0x2230d8,_0x35e515){return _0x2230d8[_0x3642('0x9')](_0x3642('0xa'),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 3f3da21..1bb6a03 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 _0xbc78=['../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../config/utils'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xbc78,0x1f0));var _0x8bc7=function(_0x48f2e2,_0x4254b7){_0x48f2e2=_0x48f2e2-0x0;var _0x4b98e9=_0xbc78[_0x48f2e2];return _0x4b98e9;};'use strict';var _=require('lodash');var util=require(_0x8bc7('0x0'));var moment=require('moment');var BPromise=require(_0x8bc7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bc7('0x3'));var logger=require(_0x8bc7('0x4'))(_0x8bc7('0x5'));var config=require(_0x8bc7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8bc7('0x7')][_0x8bc7('0x8')]({'port':0x232a});config[_0x8bc7('0x9')]=_['defaults'](config[_0x8bc7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bc7('0xa'))(new Redis(config[_0x8bc7('0x9')]));require(_0x8bc7('0xb'))[_0x8bc7('0xc')](socket);function respondWithRpcPromise(_0xeb62e4,_0x4f82a8,_0x512c7a){return new BPromise(function(_0x29a709,_0x201c8e){return client[_0x8bc7('0xd')](_0xeb62e4,_0x512c7a)[_0x8bc7('0xe')](function(_0x2a4122){logger[_0x8bc7('0xf')](_0x8bc7('0x10'),_0x4f82a8,_0x8bc7('0x11'));logger[_0x8bc7('0x12')](_0x8bc7('0x13'),_0x4f82a8,_0x8bc7('0x11'),JSON[_0x8bc7('0x14')](_0x2a4122));if(_0x2a4122[_0x8bc7('0x15')]){if(_0x2a4122[_0x8bc7('0x15')]['code']===0x1f4){logger['error'](_0x8bc7('0x10'),_0x4f82a8,_0x2a4122[_0x8bc7('0x15')][_0x8bc7('0x16')]);return _0x201c8e(_0x2a4122[_0x8bc7('0x15')][_0x8bc7('0x16')]);}logger[_0x8bc7('0x15')](_0x8bc7('0x10'),_0x4f82a8,_0x2a4122[_0x8bc7('0x15')][_0x8bc7('0x16')]);return _0x29a709(_0x2a4122[_0x8bc7('0x15')]['message']);}else{logger[_0x8bc7('0xf')](_0x8bc7('0x10'),_0x4f82a8,_0x8bc7('0x11'));_0x29a709(_0x2a4122[_0x8bc7('0x17')]['message']);}})[_0x8bc7('0x18')](function(_0x99b091){logger[_0x8bc7('0x15')]('Dashboard,\x20%s,\x20%s',_0x4f82a8,_0x99b091);_0x201c8e(_0x99b091);});});} \ No newline at end of file +var _0x90a6=['code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57b6e8,_0x2f613f){var _0x11cc48=function(_0x31dfcb){while(--_0x31dfcb){_0x57b6e8['push'](_0x57b6e8['shift']());}};_0x11cc48(++_0x2f613f);}(_0x90a6,0x148));var _0x690a=function(_0x25e50e,_0x433eb7){_0x25e50e=_0x25e50e-0x0;var _0x39a1d8=_0x90a6[_0x25e50e];return _0x39a1d8;};'use strict';var _=require(_0x690a('0x0'));var util=require(_0x690a('0x1'));var moment=require('moment');var BPromise=require(_0x690a('0x2'));var rs=require(_0x690a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x690a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x690a('0x5'))('rpc');var config=require(_0x690a('0x6'));var jayson=require(_0x690a('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x690a('0x8')]=_[_0x690a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x690a('0xa'))(new Redis(config[_0x690a('0x8')]));require(_0x690a('0xb'))[_0x690a('0xc')](socket);function respondWithRpcPromise(_0x1302a0,_0x31ca8f,_0x9e7f7c){return new BPromise(function(_0x2cdca8,_0x2202e0){return client[_0x690a('0xd')](_0x1302a0,_0x9e7f7c)[_0x690a('0xe')](function(_0x3f94b6){logger[_0x690a('0xf')](_0x690a('0x10'),_0x31ca8f,_0x690a('0x11'));logger[_0x690a('0x12')](_0x690a('0x13'),_0x31ca8f,_0x690a('0x11'),JSON[_0x690a('0x14')](_0x3f94b6));if(_0x3f94b6[_0x690a('0x15')]){if(_0x3f94b6[_0x690a('0x15')][_0x690a('0x16')]===0x1f4){logger[_0x690a('0x15')](_0x690a('0x10'),_0x31ca8f,_0x3f94b6['error']['message']);return _0x2202e0(_0x3f94b6[_0x690a('0x15')][_0x690a('0x17')]);}logger['error'](_0x690a('0x10'),_0x31ca8f,_0x3f94b6[_0x690a('0x15')][_0x690a('0x17')]);return _0x2cdca8(_0x3f94b6[_0x690a('0x15')][_0x690a('0x17')]);}else{logger[_0x690a('0xf')](_0x690a('0x10'),_0x31ca8f,_0x690a('0x11'));_0x2cdca8(_0x3f94b6['result'][_0x690a('0x17')]);}})[_0x690a('0x18')](function(_0x460ed7){logger['error']('Dashboard,\x20%s,\x20%s',_0x31ca8f,_0x460ed7);_0x2202e0(_0x460ed7);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 432863c..32db4cd 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 _0x8e16=['update','emit','removeListener','length','dashboard:','./dashboard.events','save','remove'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8e16,0x13d));var _0x68e1=function(_0x3af4f1,_0x531998){_0x3af4f1=_0x3af4f1-0x0;var _0x37a1d6=_0x8e16[_0x3af4f1];return _0x37a1d6;};'use strict';var DashboardEvents=require(_0x68e1('0x0'));var events=[_0x68e1('0x1'),_0x68e1('0x2'),_0x68e1('0x3')];function createListener(_0x52e99a,_0x6f7422){return function(_0x469ac6){_0x6f7422[_0x68e1('0x4')](_0x52e99a,_0x469ac6);};}function removeListener(_0x54ffc5,_0x30c78d){return function(){DashboardEvents[_0x68e1('0x5')](_0x54ffc5,_0x30c78d);};}exports['register']=function(_0x439b2b){for(var _0x3fa8d8=0x0,_0xe37d23=events[_0x68e1('0x6')];_0x3fa8d8<_0xe37d23;_0x3fa8d8++){var _0x13abe7=events[_0x3fa8d8];var _0x203546=createListener(_0x68e1('0x7')+_0x13abe7,_0x439b2b);DashboardEvents['on'](_0x13abe7,_0x203546);}}; \ No newline at end of file +var _0xe09f=['./dashboard.events','save','remove','update','emit','removeListener','register','dashboard:'];(function(_0x1fdfc1,_0x23ab8a){var _0x3f2d50=function(_0x4a08a8){while(--_0x4a08a8){_0x1fdfc1['push'](_0x1fdfc1['shift']());}};_0x3f2d50(++_0x23ab8a);}(_0xe09f,0x80));var _0xfe09=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe09f[_0x3947c9];return _0x2e7871;};'use strict';var DashboardEvents=require(_0xfe09('0x0'));var events=[_0xfe09('0x1'),_0xfe09('0x2'),_0xfe09('0x3')];function createListener(_0x25e28b,_0x5c5012){return function(_0x969f47){_0x5c5012[_0xfe09('0x4')](_0x25e28b,_0x969f47);};}function removeListener(_0x1806fc,_0xc1fa22){return function(){DashboardEvents[_0xfe09('0x5')](_0x1806fc,_0xc1fa22);};}exports[_0xfe09('0x6')]=function(_0x4ed6c1){for(var _0x4f9480=0x0,_0x48cada=events['length'];_0x4f9480<_0x48cada;_0x4f9480++){var _0x45ae73=events[_0x4f9480];var _0x456410=createListener(_0xfe09('0x7')+_0x45ae73,_0x4ed6c1);DashboardEvents['on'](_0x45ae73,_0x456410);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 41ae69e..8fcc331 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 _0x9734=['getItems','post','create','/:id/clone','clone','addItem','put','/:id','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/items'];(function(_0x9020cc,_0x30cb4){var _0x92841f=function(_0x4b70e1){while(--_0x4b70e1){_0x9020cc['push'](_0x9020cc['shift']());}};_0x92841f(++_0x30cb4);}(_0x9734,0xe6));var _0x4973=function(_0x46502c,_0x1a4969){_0x46502c=_0x46502c-0x0;var _0x3be3d6=_0x9734[_0x46502c];return _0x3be3d6;};'use strict';var multer=require(_0x4973('0x0'));var util=require(_0x4973('0x1'));var path=require('path');var timeout=require(_0x4973('0x2'));var express=require(_0x4973('0x3'));var router=express['Router']();var fs_extra=require(_0x4973('0x4'));var auth=require(_0x4973('0x5'));var interaction=require(_0x4973('0x6'));var config=require(_0x4973('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x4973('0x8')](),controller['index']);router[_0x4973('0x9')]('/:id',auth[_0x4973('0x8')](),controller[_0x4973('0xa')]);router[_0x4973('0x9')](_0x4973('0xb'),auth[_0x4973('0x8')](),controller[_0x4973('0xc')]);router[_0x4973('0xd')]('/',auth[_0x4973('0x8')](),controller[_0x4973('0xe')]);router[_0x4973('0xd')](_0x4973('0xf'),auth[_0x4973('0x8')](),controller[_0x4973('0x10')]);router[_0x4973('0xd')](_0x4973('0xb'),auth[_0x4973('0x8')](),controller[_0x4973('0x11')]);router[_0x4973('0x12')](_0x4973('0x13'),auth[_0x4973('0x8')](),controller[_0x4973('0x14')]);router['delete'](_0x4973('0x13'),auth[_0x4973('0x8')](),controller['destroy']);module[_0x4973('0x15')]=router; \ No newline at end of file +var _0x3cd3=['/:id','show','/:id/items','post','create','/:id/clone','clone','addItem','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x594310,_0x3eba1f){var _0x7784d2=function(_0x1ac254){while(--_0x1ac254){_0x594310['push'](_0x594310['shift']());}};_0x7784d2(++_0x3eba1f);}(_0x3cd3,0x7f));var _0x33cd=function(_0x2010d8,_0x4c90e6){_0x2010d8=_0x2010d8-0x0;var _0x1b9942=_0x3cd3[_0x2010d8];return _0x1b9942;};'use strict';var multer=require(_0x33cd('0x0'));var util=require(_0x33cd('0x1'));var path=require(_0x33cd('0x2'));var timeout=require(_0x33cd('0x3'));var express=require(_0x33cd('0x4'));var router=express[_0x33cd('0x5')]();var fs_extra=require(_0x33cd('0x6'));var auth=require(_0x33cd('0x7'));var interaction=require(_0x33cd('0x8'));var config=require(_0x33cd('0x9'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x33cd('0xa')](),controller['index']);router['get'](_0x33cd('0xb'),auth[_0x33cd('0xa')](),controller[_0x33cd('0xc')]);router['get'](_0x33cd('0xd'),auth[_0x33cd('0xa')](),controller['getItems']);router[_0x33cd('0xe')]('/',auth[_0x33cd('0xa')](),controller[_0x33cd('0xf')]);router['post'](_0x33cd('0x10'),auth['isAuthenticated'](),controller[_0x33cd('0x11')]);router[_0x33cd('0xe')](_0x33cd('0xd'),auth['isAuthenticated'](),controller[_0x33cd('0x12')]);router[_0x33cd('0x13')](_0x33cd('0xb'),auth[_0x33cd('0xa')](),controller['update']);router[_0x33cd('0x14')](_0x33cd('0xb'),auth['isAuthenticated'](),controller[_0x33cd('0x15')]);module[_0x33cd('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 5afdd0e..1b3e927 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 _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x43dfa5,_0x44d92a){var _0x2d51a3=function(_0x36ed9b){while(--_0x36ed9b){_0x43dfa5['push'](_0x43dfa5['shift']());}};_0x2d51a3(++_0x44d92a);}(_0x5d58,0x187));var _0x85d5=function(_0x2153ab,_0x2631f9){_0x2153ab=_0x2153ab-0x0;var _0x11e351=_0x5d58[_0x2153ab];return _0x11e351;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'defaultValue':0xc}}; \ No newline at end of file +var _0x038b=['long','parse','attrs','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING'];(function(_0x2853ce,_0x23f70e){var _0x266a31=function(_0x3810e3){while(--_0x3810e3){_0x2853ce['push'](_0x2853ce['shift']());}};_0x266a31(++_0x23f70e);}(_0x038b,0x114));var _0xb038=function(_0x1fba25,_0x19c46d){_0x1fba25=_0x1fba25-0x0;var _0x33c763=_0x038b[_0x1fba25];return _0x33c763;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb038('0x0'));var _=require(_0xb038('0x1'));module[_0xb038('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb038('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb038('0x4')),'get':function(){try{return JSON[_0xb038('0x5')](this['getDataValue'](_0xb038('0x6')));}catch(_0x11da3a){return[];}},'set':function(_0x4fe092){try{this['setDataValue'](_0xb038('0x6'),JSON[_0xb038('0x7')](_0x4fe092));}catch(_0x1534a9){this['setDataValue']('attrs',JSON[_0xb038('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0xb038('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xb038('0x8')]},'background':{'type':Sequelize[_0xb038('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb038('0x3')],'allowNull':![],'defaultValue':_0xb038('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb038('0x3')]},'titleFontSize':{'type':Sequelize[_0xb038('0x8')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f5a808d..a49fbb1 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 _0x7e35=['find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','destroy','then','stack','send','params','model','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','includeAll','merge','options'];(function(_0x4d180f,_0x810fcc){var _0x43dabf=function(_0x8819ff){while(--_0x8819ff){_0x4d180f['push'](_0x4d180f['shift']());}};_0x43dabf(++_0x810fcc);}(_0x7e35,0xcc));var _0x57e3=function(_0x3963ce,_0x4916d9){_0x3963ce=_0x3963ce-0x0;var _0x5192ae=_0x7e35[_0x3963ce];return _0x5192ae;};'use strict';var emlformat=require(_0x57e3('0x0'));var rimraf=require(_0x57e3('0x1'));var zipdir=require(_0x57e3('0x2'));var jsonpatch=require(_0x57e3('0x3'));var rp=require(_0x57e3('0x4'));var moment=require(_0x57e3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x57e3('0x6'));var util=require(_0x57e3('0x7'));var path=require(_0x57e3('0x8'));var sox=require('sox');var csv=require(_0x57e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e3('0xa'));var _=require(_0x57e3('0xb'));var squel=require(_0x57e3('0xc'));var crypto=require(_0x57e3('0xd'));var jsforce=require(_0x57e3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x57e3('0x9'));var querystring=require(_0x57e3('0xf'));var Papa=require(_0x57e3('0x10'));var Redis=require('ioredis');var authService=require(_0x57e3('0x11'));var qs=require(_0x57e3('0x12'));var as=require(_0x57e3('0x13'));var hardwareService=require(_0x57e3('0x14'));var logger=require(_0x57e3('0x15'))('api');var utils=require(_0x57e3('0x16'));var config=require(_0x57e3('0x17'));var licenseUtil=require(_0x57e3('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x57e3('0x19')],{'host':_0x57e3('0x1a'),'port':0x18eb});var socket=require(_0x57e3('0x1b'))(new Redis(config[_0x57e3('0x19')]));require(_0x57e3('0x1c'))['register'](socket);function respondWithStatusCode(_0x33a2e3,_0x3f9907){_0x3f9907=_0x3f9907||0xcc;return function(_0x18377c){if(_0x18377c){return _0x33a2e3[_0x57e3('0x1d')](_0x3f9907);}return _0x33a2e3[_0x57e3('0x1e')](_0x3f9907)[_0x57e3('0x1f')]();};}function respondWithResult(_0x210d67,_0x93e68){_0x93e68=_0x93e68||0xc8;return function(_0x1030c1){if(_0x1030c1){return _0x210d67[_0x57e3('0x1e')](_0x93e68)['json'](_0x1030c1);}};}function respondWithFilteredResult(_0x2e73e7,_0x3b9d67){return function(_0x4b64c8){if(_0x4b64c8){var _0x56248f=typeof _0x3b9d67['offset']===_0x57e3('0x20')&&typeof _0x3b9d67[_0x57e3('0x21')]===_0x57e3('0x20');var _0x1a3d7c=_0x4b64c8[_0x57e3('0x22')];var _0x26bbb8=_0x56248f?0x0:_0x3b9d67['offset'];var _0x2d7ba1=_0x56248f?_0x4b64c8['count']:_0x3b9d67[_0x57e3('0x23')]+_0x3b9d67[_0x57e3('0x21')];var _0x5e2703;if(_0x2d7ba1>=_0x1a3d7c){_0x2d7ba1=_0x1a3d7c;_0x5e2703=0xc8;}else{_0x5e2703=0xce;}_0x2e73e7[_0x57e3('0x1e')](_0x5e2703);return _0x2e73e7[_0x57e3('0x24')]('Content-Range',_0x26bbb8+'-'+_0x2d7ba1+'/'+_0x1a3d7c)[_0x57e3('0x25')](_0x4b64c8);}return null;};}function patchUpdates(_0x29f44e){return function(_0xaa346){try{jsonpatch[_0x57e3('0x26')](_0xaa346,_0x29f44e,!![]);}catch(_0x32c3f4){return BPromise[_0x57e3('0x27')](_0x32c3f4);}return _0xaa346['save']();};}function saveUpdates(_0x591eb4,_0x39045a){return function(_0x16ba1e){if(_0x16ba1e){return _0x16ba1e[_0x57e3('0x28')](_0x591eb4)['then'](function(_0x1b9fb4){return _0x1b9fb4;});}return null;};}function removeEntity(_0x29558b,_0x27f5f0){return function(_0x4e4129){if(_0x4e4129){return _0x4e4129[_0x57e3('0x29')]()[_0x57e3('0x2a')](function(){_0x29558b['status'](0xcc)[_0x57e3('0x1f')]();});}};}function handleEntityNotFound(_0x3dd84f,_0x20aa35){return function(_0x1806e0){if(!_0x1806e0){_0x3dd84f[_0x57e3('0x1d')](0x194);}return _0x1806e0;};}function handleError(_0x7932d0,_0xd6b488){_0xd6b488=_0xd6b488||0x1f4;return function(_0x47e372){logger['error'](_0x47e372[_0x57e3('0x2b')]);if(_0x47e372['name']){delete _0x47e372['name'];}_0x7932d0['status'](_0xd6b488)[_0x57e3('0x2c')](_0x47e372);};}exports['show']=function(_0x925fc6,_0x3941b1){var _0xdbea71={'raw':![],'where':{'id':_0x925fc6[_0x57e3('0x2d')]['id']}},_0x213884={};_0x213884[_0x57e3('0x2e')]=_[_0x57e3('0x2f')](db[_0x57e3('0x30')][_0x57e3('0x31')]);_0x213884['query']=_[_0x57e3('0x2f')](_0x925fc6[_0x57e3('0x32')]);_0x213884['filters']=_['intersection'](_0x213884[_0x57e3('0x2e')],_0x213884[_0x57e3('0x32')]);_0xdbea71['attributes']=_[_0x57e3('0x33')](_0x213884['model'],qs[_0x57e3('0x34')](_0x925fc6[_0x57e3('0x32')][_0x57e3('0x34')]));_0xdbea71[_0x57e3('0x35')]=_0xdbea71['attributes']['length']?_0xdbea71[_0x57e3('0x35')]:_0x213884['model'];if(_0x925fc6[_0x57e3('0x32')][_0x57e3('0x36')]){_0xdbea71['include']=[{'all':!![]}];}_0xdbea71=_[_0x57e3('0x37')]({},_0xdbea71,_0x925fc6[_0x57e3('0x38')]);return db[_0x57e3('0x30')][_0x57e3('0x39')](_0xdbea71)[_0x57e3('0x2a')](handleEntityNotFound(_0x3941b1,null))[_0x57e3('0x2a')](respondWithResult(_0x3941b1,null))['catch'](handleError(_0x3941b1,null));};exports['destroy']=function(_0x16bd73,_0x5cc62d){return db[_0x57e3('0x30')][_0x57e3('0x39')]({'where':{'id':_0x16bd73[_0x57e3('0x2d')]['id']}})[_0x57e3('0x2a')](handleEntityNotFound(_0x5cc62d,null))['then'](removeEntity(_0x5cc62d,null))[_0x57e3('0x3a')](handleError(_0x5cc62d,null));};function widgetAttributes(_0x335f31){try{switch(_0x335f31[_0x57e3('0x3b')]){case _0x57e3('0x3c'):return[{'name':_0x57e3('0x3d'),'value':_0x335f31[_0x57e3('0x3d')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x0]?_0x335f31['attrs'][0x0][_0x57e3('0x3f')]:undefined)||'https://'}];case _0x57e3('0x40'):return[{'name':'attrPath','value':_0x335f31[_0x57e3('0x41')]||(_0x335f31['attrs']&&_0x335f31['attrs'][0x0]?_0x335f31['attrs'][0x0][_0x57e3('0x3f')]:undefined)||''}];case _0x57e3('0x42'):return[{'name':_0x57e3('0x43'),'value':_0x335f31[_0x57e3('0x43')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x0]?_0x335f31[_0x57e3('0x3e')][0x0][_0x57e3('0x3f')]:undefined)||_0x57e3('0x44')},{'name':'attrTimezone','value':_0x335f31[_0x57e3('0x45')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x1]?_0x335f31[_0x57e3('0x3e')][0x1][_0x57e3('0x3f')]:undefined)||'0.00'},{'name':_0x57e3('0x46'),'value':_0x335f31['attrFontSize']||(_0x335f31['attrs']&&_0x335f31[_0x57e3('0x3e')][0x2]?_0x335f31[_0x57e3('0x3e')][0x2][_0x57e3('0x3f')]:undefined)||0xc}];case _0x57e3('0x47'):return[{'name':_0x57e3('0x48'),'value':_0x335f31['attrMetric']||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x0]?_0x335f31[_0x57e3('0x3e')][0x0][_0x57e3('0x3f')]:undefined)||'total'},{'name':_0x57e3('0x49'),'value':_0x335f31[_0x57e3('0x49')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31['attrs'][0x1]?_0x335f31[_0x57e3('0x3e')][0x1]['value']:undefined)||[]},{'name':_0x57e3('0x46'),'value':_0x335f31[_0x57e3('0x46')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31['attrs'][0x2]?_0x335f31['attrs'][0x2][_0x57e3('0x3f')]:undefined)||0x14}];case _0x57e3('0x4a'):case _0x57e3('0x4b'):return[{'name':_0x57e3('0x4c'),'value':_0x335f31['attrSerie1']||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31['attrs'][0x0]?_0x335f31[_0x57e3('0x3e')][0x0][_0x57e3('0x3f')]:undefined)||_0x57e3('0x4d')},{'name':'attrSerie2','value':_0x335f31[_0x57e3('0x4e')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31['attrs'][0x1]?_0x335f31[_0x57e3('0x3e')][0x1]['value']:undefined)||null},{'name':_0x57e3('0x4f'),'value':_0x335f31[_0x57e3('0x4f')]||(_0x335f31['attrs']&&_0x335f31[_0x57e3('0x3e')][0x2]?_0x335f31[_0x57e3('0x3e')][0x2][_0x57e3('0x3f')]:undefined)||null},{'name':_0x57e3('0x49'),'value':_0x335f31[_0x57e3('0x49')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x3]?_0x335f31[_0x57e3('0x3e')][0x3][_0x57e3('0x3f')]:undefined)||[]}];case _0x57e3('0x50'):return[{'name':_0x57e3('0x51'),'type':_0x335f31[_0x57e3('0x52')]||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x0]?_0x335f31['attrs'][0x0][_0x57e3('0x3b')]:undefined)||null,'value':_0x335f31[_0x57e3('0x51')]||(_0x335f31['attrs']&&_0x335f31['attrs'][0x0]?_0x335f31['attrs'][0x0][_0x57e3('0x3f')]:undefined)||null},{'name':_0x57e3('0x53'),'value':_0x335f31['attrRefresh']||(_0x335f31[_0x57e3('0x3e')]&&_0x335f31[_0x57e3('0x3e')][0x1]?_0x335f31['attrs'][0x1][_0x57e3('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x4b9a81){logger['error']('widgetAttributes:\x20%s',JSON[_0x57e3('0x54')](_0x4b9a81));return[];}}exports[_0x57e3('0x55')]=function(_0x4bba82,_0x141028){if(_0x4bba82[_0x57e3('0x56')]){_0x4bba82['body'][_0x57e3('0x3e')]=widgetAttributes(_0x4bba82[_0x57e3('0x56')]);}return db[_0x57e3('0x30')][_0x57e3('0x55')](_0x4bba82[_0x57e3('0x56')],{})['then'](respondWithResult(_0x141028,0xc9))[_0x57e3('0x3a')](handleError(_0x141028,null));};exports[_0x57e3('0x28')]=function(_0xa87a50,_0xa92120){if(_0xa87a50[_0x57e3('0x56')]['id']){delete _0xa87a50[_0x57e3('0x56')]['id'];}_0xa87a50['body'][_0x57e3('0x3e')]=widgetAttributes(_0xa87a50[_0x57e3('0x56')]);return db[_0x57e3('0x30')]['find']({'where':{'id':_0xa87a50[_0x57e3('0x2d')]['id']}})['then'](handleEntityNotFound(_0xa92120,null))[_0x57e3('0x2a')](saveUpdates(_0xa87a50['body'],null))[_0x57e3('0x2a')](respondWithResult(_0xa92120,null))[_0x57e3('0x3a')](handleError(_0xa92120,null));}; \ No newline at end of file +var _0x55a9=['catch','update','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','error','stack','name','show','keys','DashboardItem','rawAttributes','query','intersection','model','attributes','fields','includeAll','include','find','destroy','params','iframe','attrUrl','attrs','custom','attrPath','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','stringify','body','create'];(function(_0x1e5a75,_0x41d64d){var _0x4c3800=function(_0xb2ed83){while(--_0xb2ed83){_0x1e5a75['push'](_0x1e5a75['shift']());}};_0x4c3800(++_0x41d64d);}(_0x55a9,0x1bf));var _0x955a=function(_0x463cbd,_0x2dda5a){_0x463cbd=_0x463cbd-0x0;var _0x3fe838=_0x55a9[_0x463cbd];return _0x3fe838;};'use strict';var emlformat=require(_0x955a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x955a('0x1'));var rp=require(_0x955a('0x2'));var moment=require(_0x955a('0x3'));var BPromise=require(_0x955a('0x4'));var Mustache=require('mustache');var util=require(_0x955a('0x5'));var path=require(_0x955a('0x6'));var sox=require(_0x955a('0x7'));var csv=require(_0x955a('0x8'));var ejs=require(_0x955a('0x9'));var fs=require('fs');var fs_extra=require(_0x955a('0xa'));var _=require(_0x955a('0xb'));var squel=require(_0x955a('0xc'));var crypto=require(_0x955a('0xd'));var jsforce=require(_0x955a('0xe'));var deskjs=require(_0x955a('0xf'));var toCsv=require(_0x955a('0x8'));var querystring=require('querystring');var Papa=require(_0x955a('0x10'));var Redis=require(_0x955a('0x11'));var authService=require(_0x955a('0x12'));var qs=require(_0x955a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x955a('0x14'));var logger=require(_0x955a('0x15'))(_0x955a('0x16'));var utils=require(_0x955a('0x17'));var config=require(_0x955a('0x18'));var licenseUtil=require(_0x955a('0x19'));var db=require(_0x955a('0x1a'))['db'];config[_0x955a('0x1b')]=_[_0x955a('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x955a('0x1d'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x955a('0x1e')](socket);function respondWithStatusCode(_0x4020eb,_0x5319e5){_0x5319e5=_0x5319e5||0xcc;return function(_0x32dece){if(_0x32dece){return _0x4020eb[_0x955a('0x1f')](_0x5319e5);}return _0x4020eb[_0x955a('0x20')](_0x5319e5)[_0x955a('0x21')]();};}function respondWithResult(_0x5ad98a,_0x5ca032){_0x5ca032=_0x5ca032||0xc8;return function(_0xefed7){if(_0xefed7){return _0x5ad98a['status'](_0x5ca032)[_0x955a('0x22')](_0xefed7);}};}function respondWithFilteredResult(_0x5ae28f,_0x577ab4){return function(_0x1aa29a){if(_0x1aa29a){var _0x101d86=typeof _0x577ab4[_0x955a('0x23')]==='undefined'&&typeof _0x577ab4[_0x955a('0x24')]===_0x955a('0x25');var _0x11222e=_0x1aa29a[_0x955a('0x26')];var _0x55871c=_0x101d86?0x0:_0x577ab4['offset'];var _0x389644=_0x101d86?_0x1aa29a[_0x955a('0x26')]:_0x577ab4[_0x955a('0x23')]+_0x577ab4[_0x955a('0x24')];var _0x40982b;if(_0x389644>=_0x11222e){_0x389644=_0x11222e;_0x40982b=0xc8;}else{_0x40982b=0xce;}_0x5ae28f['status'](_0x40982b);return _0x5ae28f[_0x955a('0x27')]('Content-Range',_0x55871c+'-'+_0x389644+'/'+_0x11222e)['json'](_0x1aa29a);}return null;};}function patchUpdates(_0x42dfb2){return function(_0x39e39c){try{jsonpatch[_0x955a('0x28')](_0x39e39c,_0x42dfb2,!![]);}catch(_0x39ed9b){return BPromise[_0x955a('0x29')](_0x39ed9b);}return _0x39e39c['save']();};}function saveUpdates(_0x5010fb,_0x64a9d4){return function(_0x329cd7){if(_0x329cd7){return _0x329cd7['update'](_0x5010fb)[_0x955a('0x2a')](function(_0x57345d){return _0x57345d;});}return null;};}function removeEntity(_0x25dc4f,_0x39f25f){return function(_0x48e1d3){if(_0x48e1d3){return _0x48e1d3['destroy']()[_0x955a('0x2a')](function(){_0x25dc4f['status'](0xcc)[_0x955a('0x21')]();});}};}function handleEntityNotFound(_0x2c7d2b,_0x370fd1){return function(_0x238d8e){if(!_0x238d8e){_0x2c7d2b[_0x955a('0x1f')](0x194);}return _0x238d8e;};}function handleError(_0x3e45e6,_0x57154d){_0x57154d=_0x57154d||0x1f4;return function(_0x5c9a50){logger[_0x955a('0x2b')](_0x5c9a50[_0x955a('0x2c')]);if(_0x5c9a50[_0x955a('0x2d')]){delete _0x5c9a50['name'];}_0x3e45e6['status'](_0x57154d)['send'](_0x5c9a50);};}exports[_0x955a('0x2e')]=function(_0x33f58c,_0x50073c){var _0x51139c={'raw':![],'where':{'id':_0x33f58c['params']['id']}},_0x2562db={};_0x2562db['model']=_[_0x955a('0x2f')](db[_0x955a('0x30')][_0x955a('0x31')]);_0x2562db['query']=_[_0x955a('0x2f')](_0x33f58c[_0x955a('0x32')]);_0x2562db['filters']=_[_0x955a('0x33')](_0x2562db[_0x955a('0x34')],_0x2562db[_0x955a('0x32')]);_0x51139c[_0x955a('0x35')]=_[_0x955a('0x33')](_0x2562db[_0x955a('0x34')],qs[_0x955a('0x36')](_0x33f58c[_0x955a('0x32')][_0x955a('0x36')]));_0x51139c[_0x955a('0x35')]=_0x51139c[_0x955a('0x35')]['length']?_0x51139c['attributes']:_0x2562db[_0x955a('0x34')];if(_0x33f58c['query'][_0x955a('0x37')]){_0x51139c[_0x955a('0x38')]=[{'all':!![]}];}_0x51139c=_['merge']({},_0x51139c,_0x33f58c['options']);return db['DashboardItem'][_0x955a('0x39')](_0x51139c)['then'](handleEntityNotFound(_0x50073c,null))[_0x955a('0x2a')](respondWithResult(_0x50073c,null))['catch'](handleError(_0x50073c,null));};exports[_0x955a('0x3a')]=function(_0x320246,_0x5a0b61){return db[_0x955a('0x30')]['find']({'where':{'id':_0x320246[_0x955a('0x3b')]['id']}})[_0x955a('0x2a')](handleEntityNotFound(_0x5a0b61,null))[_0x955a('0x2a')](removeEntity(_0x5a0b61,null))['catch'](handleError(_0x5a0b61,null));};function widgetAttributes(_0x110085){try{switch(_0x110085['type']){case _0x955a('0x3c'):return[{'name':_0x955a('0x3d'),'value':_0x110085[_0x955a('0x3d')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0]['value']:undefined)||'https://'}];case _0x955a('0x3f'):return[{'name':_0x955a('0x40'),'value':_0x110085[_0x955a('0x40')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x955a('0x41'),'value':_0x110085[_0x955a('0x41')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0][_0x955a('0x42')]:undefined)||_0x955a('0x43')},{'name':_0x955a('0x44'),'value':_0x110085[_0x955a('0x44')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x1]?_0x110085[_0x955a('0x3e')][0x1]['value']:undefined)||_0x955a('0x45')},{'name':_0x955a('0x46'),'value':_0x110085[_0x955a('0x46')]||(_0x110085[_0x955a('0x3e')]&&_0x110085['attrs'][0x2]?_0x110085[_0x955a('0x3e')][0x2][_0x955a('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x955a('0x47'),'value':_0x110085[_0x955a('0x47')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0][_0x955a('0x42')]:undefined)||_0x955a('0x48')},{'name':_0x955a('0x49'),'value':_0x110085[_0x955a('0x49')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x1]?_0x110085[_0x955a('0x3e')][0x1][_0x955a('0x42')]:undefined)||[]},{'name':_0x955a('0x46'),'value':_0x110085[_0x955a('0x46')]||(_0x110085[_0x955a('0x3e')]&&_0x110085['attrs'][0x2]?_0x110085[_0x955a('0x3e')][0x2][_0x955a('0x42')]:undefined)||0x14}];case _0x955a('0x4a'):case _0x955a('0x4b'):return[{'name':'attrSerie1','value':_0x110085[_0x955a('0x4c')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085['attrs'][0x0][_0x955a('0x42')]:undefined)||_0x955a('0x48')},{'name':_0x955a('0x4d'),'value':_0x110085['attrSerie2']||(_0x110085['attrs']&&_0x110085[_0x955a('0x3e')][0x1]?_0x110085[_0x955a('0x3e')][0x1][_0x955a('0x42')]:undefined)||null},{'name':_0x955a('0x4e'),'value':_0x110085[_0x955a('0x4e')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x2]?_0x110085['attrs'][0x2][_0x955a('0x42')]:undefined)||null},{'name':_0x955a('0x49'),'value':_0x110085['attrVoiceQueues']||(_0x110085[_0x955a('0x3e')]&&_0x110085['attrs'][0x3]?_0x110085[_0x955a('0x3e')][0x3][_0x955a('0x42')]:undefined)||[]}];case _0x955a('0x4f'):return[{'name':_0x955a('0x50'),'type':_0x110085[_0x955a('0x51')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0][_0x955a('0x52')]:undefined)||null,'value':_0x110085[_0x955a('0x50')]||(_0x110085[_0x955a('0x3e')]&&_0x110085[_0x955a('0x3e')][0x0]?_0x110085[_0x955a('0x3e')][0x0][_0x955a('0x42')]:undefined)||null},{'name':_0x955a('0x53'),'value':_0x110085['attrRefresh']||(_0x110085['attrs']&&_0x110085[_0x955a('0x3e')][0x1]?_0x110085[_0x955a('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x22be7c){logger['error']('widgetAttributes:\x20%s',JSON[_0x955a('0x54')](_0x22be7c));return[];}}exports['create']=function(_0x3dcc40,_0x548e44){if(_0x3dcc40[_0x955a('0x55')]){_0x3dcc40[_0x955a('0x55')][_0x955a('0x3e')]=widgetAttributes(_0x3dcc40['body']);}return db[_0x955a('0x30')][_0x955a('0x56')](_0x3dcc40[_0x955a('0x55')],{})[_0x955a('0x2a')](respondWithResult(_0x548e44,0xc9))[_0x955a('0x57')](handleError(_0x548e44,null));};exports[_0x955a('0x58')]=function(_0x10c9ec,_0x562ab9){if(_0x10c9ec[_0x955a('0x55')]['id']){delete _0x10c9ec[_0x955a('0x55')]['id'];}_0x10c9ec[_0x955a('0x55')][_0x955a('0x3e')]=widgetAttributes(_0x10c9ec['body']);return db[_0x955a('0x30')][_0x955a('0x39')]({'where':{'id':_0x10c9ec['params']['id']}})[_0x955a('0x2a')](handleEntityNotFound(_0x562ab9,null))[_0x955a('0x2a')](saveUpdates(_0x10c9ec[_0x955a('0x55')],null))[_0x955a('0x2a')](respondWithResult(_0x562ab9,null))[_0x955a('0x57')](handleError(_0x562ab9,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f110141..258861d 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 _0xf4b9=['emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','save','update'];(function(_0x57dd90,_0x58ddc4){var _0x34abca=function(_0x166d60){while(--_0x166d60){_0x57dd90['push'](_0x57dd90['shift']());}};_0x34abca(++_0x58ddc4);}(_0xf4b9,0xbc));var _0x9f4b=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xf4b9[_0x11ce46];return _0x368a1e;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x9f4b('0x0'))['db'][_0x9f4b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f4b('0x2'),'afterUpdate':_0x9f4b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x404402){return function(_0x4f7f84,_0x27c35c,_0x137cb2){DashboardItemEvents['emit'](_0x404402+':'+_0x4f7f84['id'],_0x4f7f84);DashboardItemEvents[_0x9f4b('0x4')](_0x404402,_0x4f7f84);_0x137cb2(null);};}for(var e in events){if(events[_0x9f4b('0x5')](e)){var event=events[e];DashboardItem[_0x9f4b('0x6')](e,emitEvent(event));}}module[_0x9f4b('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x6caf=['events','../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty'];(function(_0x4ddc7a,_0x5b6cb8){var _0x4547c1=function(_0x3739e7){while(--_0x3739e7){_0x4ddc7a['push'](_0x4ddc7a['shift']());}};_0x4547c1(++_0x5b6cb8);}(_0x6caf,0x90));var _0xf6ca=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x6caf[_0x178668];return _0x26107d;};'use strict';var EventEmitter=require(_0xf6ca('0x0'));var DashboardItem=require(_0xf6ca('0x1'))['db'][_0xf6ca('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf6ca('0x3'),'afterUpdate':_0xf6ca('0x4'),'afterDestroy':_0xf6ca('0x5')};function emitEvent(_0x2594e0){return function(_0x128e3f,_0x32708e,_0xf368ab){DashboardItemEvents['emit'](_0x2594e0+':'+_0x128e3f['id'],_0x128e3f);DashboardItemEvents[_0xf6ca('0x6')](_0x2594e0,_0x128e3f);_0xf368ab(null);};}for(var e in events){if(events[_0xf6ca('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b9c42fa..7f997f9 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 _0x0233=['define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x0233,0x1b0));var _0x3023=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x0233[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x3023('0x0'));var util=require(_0x3023('0x1'));var logger=require(_0x3023('0x2'))(_0x3023('0x3'));var moment=require(_0x3023('0x4'));var BPromise=require('bluebird');var rp=require(_0x3023('0x5'));var fs=require('fs');var path=require(_0x3023('0x6'));var rimraf=require(_0x3023('0x7'));var config=require(_0x3023('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x3023('0x9')]=function(_0x239eb7,_0x19ec57){return _0x239eb7[_0x3023('0xa')](_0x3023('0xb'),attributes,{'tableName':_0x3023('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40dd=['DashboardItem','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x34081e,_0x5d10da){var _0x3750d9=function(_0x5b8f9a){while(--_0x5b8f9a){_0x34081e['push'](_0x34081e['shift']());}};_0x3750d9(++_0x5d10da);}(_0x40dd,0x18d));var _0xd40d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x40dd[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xd40d('0x0'));var util=require(_0xd40d('0x1'));var logger=require('../../config/logger')(_0xd40d('0x2'));var moment=require(_0xd40d('0x3'));var BPromise=require(_0xd40d('0x4'));var rp=require(_0xd40d('0x5'));var fs=require('fs');var path=require(_0xd40d('0x6'));var rimraf=require(_0xd40d('0x7'));var config=require(_0xd40d('0x8'));var attributes=require(_0xd40d('0x9'));module[_0xd40d('0xa')]=function(_0xa8ee90,_0x510923){return _0xa8ee90['define'](_0xd40d('0xb'),attributes,{'tableName':'dashboard_items','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 6117768..634516a 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 _0xe206=['client','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','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xe206,0x135));var _0x6e20=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xe206[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var util=require(_0x6e20('0x0'));var moment=require(_0x6e20('0x1'));var BPromise=require(_0x6e20('0x2'));var rs=require(_0x6e20('0x3'));var fs=require('fs');var Redis=require(_0x6e20('0x4'));var db=require(_0x6e20('0x5'))['db'];var utils=require(_0x6e20('0x6'));var logger=require(_0x6e20('0x7'))('rpc');var config=require(_0x6e20('0x8'));var jayson=require(_0x6e20('0x9'));var client=jayson[_0x6e20('0xa')]['http']({'port':0x232a});config[_0x6e20('0xb')]=_[_0x6e20('0xc')](config[_0x6e20('0xb')],{'host':_0x6e20('0xd'),'port':0x18eb});var socket=require(_0x6e20('0xe'))(new Redis(config[_0x6e20('0xb')]));require(_0x6e20('0xf'))[_0x6e20('0x10')](socket);function respondWithRpcPromise(_0x3267ea,_0x3cefd6,_0x547f67){return new BPromise(function(_0x2a753f,_0x5505c5){return client[_0x6e20('0x11')](_0x3267ea,_0x547f67)[_0x6e20('0x12')](function(_0x1aa52d){logger['info'](_0x6e20('0x13'),_0x3cefd6,_0x6e20('0x14'));logger[_0x6e20('0x15')](_0x6e20('0x16'),_0x3cefd6,_0x6e20('0x14'),JSON[_0x6e20('0x17')](_0x1aa52d));if(_0x1aa52d[_0x6e20('0x18')]){if(_0x1aa52d[_0x6e20('0x18')][_0x6e20('0x19')]===0x1f4){logger[_0x6e20('0x18')](_0x6e20('0x13'),_0x3cefd6,_0x1aa52d[_0x6e20('0x18')][_0x6e20('0x1a')]);return _0x5505c5(_0x1aa52d[_0x6e20('0x18')][_0x6e20('0x1a')]);}logger[_0x6e20('0x18')](_0x6e20('0x13'),_0x3cefd6,_0x1aa52d[_0x6e20('0x18')][_0x6e20('0x1a')]);return _0x2a753f(_0x1aa52d[_0x6e20('0x18')][_0x6e20('0x1a')]);}else{logger['info'](_0x6e20('0x13'),_0x3cefd6,_0x6e20('0x14'));_0x2a753f(_0x1aa52d[_0x6e20('0x1b')][_0x6e20('0x1a')]);}})[_0x6e20('0x1c')](function(_0x423555){logger[_0x6e20('0x18')](_0x6e20('0x13'),_0x3cefd6,_0x423555);_0x5505c5(_0x423555);});});} \ No newline at end of file +var _0xefb5=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent'];(function(_0x48d007,_0x446953){var _0x412d80=function(_0x20cccd){while(--_0x20cccd){_0x48d007['push'](_0x48d007['shift']());}};_0x412d80(++_0x446953);}(_0xefb5,0x181));var _0x5efb=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0xefb5[_0x2fc113];return _0x5144ce;};'use strict';var _=require(_0x5efb('0x0'));var util=require(_0x5efb('0x1'));var moment=require(_0x5efb('0x2'));var BPromise=require('bluebird');var rs=require(_0x5efb('0x3'));var fs=require('fs');var Redis=require(_0x5efb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5efb('0x5'));var logger=require(_0x5efb('0x6'))(_0x5efb('0x7'));var config=require(_0x5efb('0x8'));var jayson=require(_0x5efb('0x9'));var client=jayson[_0x5efb('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5efb('0xb')](config[_0x5efb('0xc')],{'host':_0x5efb('0xd'),'port':0x18eb});var socket=require(_0x5efb('0xe'))(new Redis(config[_0x5efb('0xc')]));require(_0x5efb('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d1d9f,_0x17012b,_0x303e87){return new BPromise(function(_0xc8a261,_0x3bd11c){return client[_0x5efb('0x10')](_0x3d1d9f,_0x303e87)[_0x5efb('0x11')](function(_0x4d477c){logger[_0x5efb('0x12')](_0x5efb('0x13'),_0x17012b,_0x5efb('0x14'));logger[_0x5efb('0x15')](_0x5efb('0x16'),_0x17012b,_0x5efb('0x14'),JSON[_0x5efb('0x17')](_0x4d477c));if(_0x4d477c['error']){if(_0x4d477c['error'][_0x5efb('0x18')]===0x1f4){logger[_0x5efb('0x19')](_0x5efb('0x13'),_0x17012b,_0x4d477c['error'][_0x5efb('0x1a')]);return _0x3bd11c(_0x4d477c[_0x5efb('0x19')]['message']);}logger[_0x5efb('0x19')](_0x5efb('0x13'),_0x17012b,_0x4d477c[_0x5efb('0x19')]['message']);return _0xc8a261(_0x4d477c[_0x5efb('0x19')][_0x5efb('0x1a')]);}else{logger['info'](_0x5efb('0x13'),_0x17012b,_0x5efb('0x14'));_0xc8a261(_0x4d477c[_0x5efb('0x1b')][_0x5efb('0x1a')]);}})[_0x5efb('0x1c')](function(_0x4a0007){logger['error'](_0x5efb('0x13'),_0x17012b,_0x4a0007);_0x3bd11c(_0x4a0007);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4db233d..f16098b 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 _0x9a2b=['remove','update','register','dashboardItem:','save'];(function(_0x3b21b2,_0xfe030){var _0x4024b6=function(_0x1cb48b){while(--_0x1cb48b){_0x3b21b2['push'](_0x3b21b2['shift']());}};_0x4024b6(++_0xfe030);}(_0x9a2b,0x1cb));var _0xb9a2=function(_0x20352e,_0x1ee2ac){_0x20352e=_0x20352e-0x0;var _0x5a9319=_0x9a2b[_0x20352e];return _0x5a9319;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb9a2('0x0'),_0xb9a2('0x1'),_0xb9a2('0x2')];function createListener(_0x3d189e,_0x16fd4e){return function(_0xb0dd74){_0x16fd4e['emit'](_0x3d189e,_0xb0dd74);};}function removeListener(_0x27cef7,_0x3bc967){return function(){DashboardItemEvents['removeListener'](_0x27cef7,_0x3bc967);};}exports[_0xb9a2('0x3')]=function(_0x51ce6c){for(var _0x324eda=0x0,_0x1ce07c=events['length'];_0x324eda<_0x1ce07c;_0x324eda++){var _0x9ff47=events[_0x324eda];var _0x56c2c5=createListener(_0xb9a2('0x4')+_0x9ff47,_0x51ce6c);DashboardItemEvents['on'](_0x9ff47,_0x56c2c5);}}; \ No newline at end of file +var _0x140d=['dashboardItem:','./dashboardItem.events','remove','update','emit','removeListener'];(function(_0x4ee695,_0x5a579b){var _0x165508=function(_0x29a6e4){while(--_0x29a6e4){_0x4ee695['push'](_0x4ee695['shift']());}};_0x165508(++_0x5a579b);}(_0x140d,0xbb));var _0xd140=function(_0x2b3120,_0x2b94da){_0x2b3120=_0x2b3120-0x0;var _0x1aa771=_0x140d[_0x2b3120];return _0x1aa771;};'use strict';var DashboardItemEvents=require(_0xd140('0x0'));var events=['save',_0xd140('0x1'),_0xd140('0x2')];function createListener(_0x3500b1,_0x4a8209){return function(_0x2f96fa){_0x4a8209[_0xd140('0x3')](_0x3500b1,_0x2f96fa);};}function removeListener(_0x3a3cc3,_0x196a2f){return function(){DashboardItemEvents[_0xd140('0x4')](_0x3a3cc3,_0x196a2f);};}exports['register']=function(_0x4701f2){for(var _0x1dffab=0x0,_0x50b05d=events['length'];_0x1dffab<_0x50b05d;_0x1dffab++){var _0x46b6d9=events[_0x1dffab];var _0x1bbb20=createListener(_0xd140('0x5')+_0x46b6d9,_0x4701f2);DashboardItemEvents['on'](_0x46b6d9,_0x1bbb20);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index f8cf532..a521269 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 _0x2e2d=['fs-extra','../../config/environment','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0xc70b9d,_0x12b259){var _0x193ecf=function(_0x44bf4c){while(--_0x44bf4c){_0xc70b9d['push'](_0xc70b9d['shift']());}};_0x193ecf(++_0x12b259);}(_0x2e2d,0x8c));var _0xd2e2=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x2e2d[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0xd2e2('0x0'));var util=require('util');var path=require(_0xd2e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xd2e2('0x2'));var router=express[_0xd2e2('0x3')]();var fs_extra=require(_0xd2e2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd2e2('0x5'));var controller=require('./dashboardItem.controller');router['get'](_0xd2e2('0x6'),auth[_0xd2e2('0x7')](),controller[_0xd2e2('0x8')]);router[_0xd2e2('0x9')]('/',auth[_0xd2e2('0x7')](),controller[_0xd2e2('0xa')]);router[_0xd2e2('0xb')](_0xd2e2('0x6'),auth[_0xd2e2('0x7')](),controller[_0xd2e2('0xc')]);router[_0xd2e2('0xd')]('/:id',auth[_0xd2e2('0x7')](),controller[_0xd2e2('0xe')]);module[_0xd2e2('0xf')]=router; \ No newline at end of file +var _0xc3f6=['post','create','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xc94d86,_0x437cba){var _0x3e000a=function(_0x301237){while(--_0x301237){_0xc94d86['push'](_0xc94d86['shift']());}};_0x3e000a(++_0x437cba);}(_0xc3f6,0xf7));var _0x6c3f=function(_0x459f25,_0x77579a){_0x459f25=_0x459f25-0x0;var _0x286a4a=_0xc3f6[_0x459f25];return _0x286a4a;};'use strict';var multer=require(_0x6c3f('0x0'));var util=require(_0x6c3f('0x1'));var path=require(_0x6c3f('0x2'));var timeout=require(_0x6c3f('0x3'));var express=require('express');var router=express[_0x6c3f('0x4')]();var fs_extra=require(_0x6c3f('0x5'));var auth=require(_0x6c3f('0x6'));var interaction=require(_0x6c3f('0x7'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x6c3f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6c3f('0x9')]('/',auth['isAuthenticated'](),controller[_0x6c3f('0xa')]);router[_0x6c3f('0xb')](_0x6c3f('0xc'),auth[_0x6c3f('0xd')](),controller[_0x6c3f('0xe')]);router['delete'](_0x6c3f('0xc'),auth[_0x6c3f('0xd')](),controller['destroy']);module[_0x6c3f('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index ac704c0..f0fc621 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 _0xce39=['exports','STRING','ENUM','first','second','third'];(function(_0x414c49,_0x3c4033){var _0x5638f6=function(_0x5069cf){while(--_0x5069cf){_0x414c49['push'](_0x414c49['shift']());}};_0x5638f6(++_0x3c4033);}(_0xce39,0x96));var _0x9ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce39[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9ce3('0x0')]={'name':{'type':Sequelize[_0x9ce3('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x9ce3('0x2')](_0x9ce3('0x3'),_0x9ce3('0x4'),_0x9ce3('0x5')),'allowNull':![],'defaultValue':_0x9ce3('0x3')},'description':{'type':Sequelize[_0x9ce3('0x1')]}}; \ No newline at end of file +var _0x11f6=['exports','first','third','STRING'];(function(_0x2d6215,_0x41787c){var _0x3ace6a=function(_0x1d7dd3){while(--_0x1d7dd3){_0x2d6215['push'](_0x2d6215['shift']());}};_0x3ace6a(++_0x41787c);}(_0x11f6,0x70));var _0x611f=function(_0x4c1ee3,_0x24a22f){_0x4c1ee3=_0x4c1ee3-0x0;var _0x2ac914=_0x11f6[_0x4c1ee3];return _0x2ac914;};'use strict';var Sequelize=require('sequelize');module[_0x611f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x611f('0x1'),'second',_0x611f('0x2')),'allowNull':![],'defaultValue':_0x611f('0x1')},'description':{'type':Sequelize[_0x611f('0x3')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9f44f49..6f8518b 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 _0x46bc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','Dispositions','destroy','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','merge','options','rows','catch','show','params','keys','includeAll','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','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','crypto','querystring'];(function(_0x1b9dbe,_0x1c0fbd){var _0x4f558e=function(_0x5175e0){while(--_0x5175e0){_0x1b9dbe['push'](_0x1b9dbe['shift']());}};_0x4f558e(++_0x1c0fbd);}(_0x46bc,0x1b3));var _0xc46b=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x46bc[_0x2742db];return _0x18659e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc46b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc46b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc46b('0x2'));var Mustache=require(_0xc46b('0x3'));var util=require(_0xc46b('0x4'));var path=require(_0xc46b('0x5'));var sox=require('sox');var csv=require(_0xc46b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc46b('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc46b('0x6'));var querystring=require(_0xc46b('0x8'));var Papa=require('papaparse');var Redis=require(_0xc46b('0x9'));var authService=require(_0xc46b('0xa'));var qs=require(_0xc46b('0xb'));var as=require(_0xc46b('0xc'));var hardwareService=require(_0xc46b('0xd'));var logger=require(_0xc46b('0xe'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc46b('0xf'));var db=require(_0xc46b('0x10'))['db'];function respondWithStatusCode(_0x42c2e2,_0x5911bd){_0x5911bd=_0x5911bd||0xcc;return function(_0x48d2de){if(_0x48d2de){return _0x42c2e2[_0xc46b('0x11')](_0x5911bd);}return _0x42c2e2[_0xc46b('0x12')](_0x5911bd)[_0xc46b('0x13')]();};}function respondWithResult(_0x527890,_0x58cf85){_0x58cf85=_0x58cf85||0xc8;return function(_0x4158f5){if(_0x4158f5){return _0x527890[_0xc46b('0x12')](_0x58cf85)[_0xc46b('0x14')](_0x4158f5);}};}function respondWithFilteredResult(_0x894b8c,_0xa86539){return function(_0x59cad2){if(_0x59cad2){var _0x4849b4=typeof _0xa86539[_0xc46b('0x15')]===_0xc46b('0x16')&&typeof _0xa86539[_0xc46b('0x17')]==='undefined';var _0x14fe59=_0x59cad2[_0xc46b('0x18')];var _0x1cb341=_0x4849b4?0x0:_0xa86539[_0xc46b('0x15')];var _0x329b17=_0x4849b4?_0x59cad2['count']:_0xa86539[_0xc46b('0x15')]+_0xa86539[_0xc46b('0x17')];var _0x35295e;if(_0x329b17>=_0x14fe59){_0x329b17=_0x14fe59;_0x35295e=0xc8;}else{_0x35295e=0xce;}_0x894b8c[_0xc46b('0x12')](_0x35295e);return _0x894b8c[_0xc46b('0x19')](_0xc46b('0x1a'),_0x1cb341+'-'+_0x329b17+'/'+_0x14fe59)[_0xc46b('0x14')](_0x59cad2);}return null;};}function patchUpdates(_0x53682e){return function(_0x34924b){try{jsonpatch['apply'](_0x34924b,_0x53682e,!![]);}catch(_0x33caa8){return BPromise[_0xc46b('0x1b')](_0x33caa8);}return _0x34924b['save']();};}function saveUpdates(_0x126dbd,_0x2610a7){return function(_0x43c3e3){if(_0x43c3e3){return _0x43c3e3['update'](_0x126dbd)['then'](function(_0x408cdf){return _0x408cdf;});}return null;};}function removeEntity(_0x53071d,_0x1fd294){return function(_0x28a450){if(_0x28a450){return _0x28a450['destroy']()[_0xc46b('0x1c')](function(){var _0x4547f0=_0x28a450[_0xc46b('0x1d')]({'plain':!![]});var _0x2bc608=_0xc46b('0x1e');return db['UserProfileResource'][_0xc46b('0x1f')]({'where':{'type':_0x2bc608,'resourceId':_0x4547f0['id']}})[_0xc46b('0x1c')](function(){return _0x28a450;});})['then'](function(){_0x53071d[_0xc46b('0x12')](0xcc)[_0xc46b('0x13')]();});}};}function handleEntityNotFound(_0x4f66d4,_0x5bf355){return function(_0x503e2d){if(!_0x503e2d){_0x4f66d4[_0xc46b('0x11')](0x194);}return _0x503e2d;};}function handleError(_0x52509f,_0x3b79e9){_0x3b79e9=_0x3b79e9||0x1f4;return function(_0x9b947c){logger[_0xc46b('0x20')](_0x9b947c[_0xc46b('0x21')]);if(_0x9b947c[_0xc46b('0x22')]){delete _0x9b947c['name'];}_0x52509f[_0xc46b('0x12')](_0x3b79e9)['send'](_0x9b947c);};}exports[_0xc46b('0x23')]=function(_0x5bbd14,_0x4f99a5){var _0x1bb2bf={},_0x414a61={},_0x1cbd83={'count':0x0,'rows':[]};var _0x1f6d21=_[_0xc46b('0x24')](db[_0xc46b('0x25')][_0xc46b('0x26')],function(_0x5e9d1b){return{'name':_0x5e9d1b[_0xc46b('0x27')],'type':_0x5e9d1b[_0xc46b('0x28')]['key']};});_0x414a61[_0xc46b('0x29')]=_[_0xc46b('0x24')](_0x1f6d21,_0xc46b('0x22'));_0x414a61['query']=_['keys'](_0x5bbd14[_0xc46b('0x2a')]);_0x414a61['filters']=_[_0xc46b('0x2b')](_0x414a61[_0xc46b('0x29')],_0x414a61[_0xc46b('0x2a')]);_0x1bb2bf[_0xc46b('0x2c')]=_[_0xc46b('0x2b')](_0x414a61[_0xc46b('0x29')],qs[_0xc46b('0x2d')](_0x5bbd14['query'][_0xc46b('0x2d')]));_0x1bb2bf[_0xc46b('0x2c')]=_0x1bb2bf[_0xc46b('0x2c')][_0xc46b('0x2e')]?_0x1bb2bf[_0xc46b('0x2c')]:_0x414a61[_0xc46b('0x29')];if(!_0x5bbd14[_0xc46b('0x2a')][_0xc46b('0x2f')](_0xc46b('0x30'))){_0x1bb2bf['limit']=qs[_0xc46b('0x17')](_0x5bbd14[_0xc46b('0x2a')]['limit']);_0x1bb2bf[_0xc46b('0x15')]=qs[_0xc46b('0x15')](_0x5bbd14[_0xc46b('0x2a')][_0xc46b('0x15')]);}_0x1bb2bf[_0xc46b('0x31')]=qs['sort'](_0x5bbd14[_0xc46b('0x2a')][_0xc46b('0x32')]);_0x1bb2bf['where']=qs[_0xc46b('0x33')](_['pick'](_0x5bbd14['query'],_0x414a61[_0xc46b('0x33')]),_0x1f6d21);if(_0x5bbd14[_0xc46b('0x2a')]['filter']){_0x1bb2bf[_0xc46b('0x34')]=_['merge'](_0x1bb2bf[_0xc46b('0x34')],{'$or':_[_0xc46b('0x24')](_0x1f6d21,function(_0x5d290f){if(_0x5d290f['type']!==_0xc46b('0x35')){var _0x2f0e42={};_0x2f0e42[_0x5d290f[_0xc46b('0x22')]]={'$like':'%'+_0x5bbd14[_0xc46b('0x2a')]['filter']+'%'};return _0x2f0e42;}})});}_0x1bb2bf=_[_0xc46b('0x36')]({},_0x1bb2bf,_0x5bbd14[_0xc46b('0x37')]);var _0x2bbf13={'where':_0x1bb2bf[_0xc46b('0x34')]};return db[_0xc46b('0x25')][_0xc46b('0x18')](_0x2bbf13)[_0xc46b('0x1c')](function(_0x27ebad){_0x1cbd83[_0xc46b('0x18')]=_0x27ebad;if(_0x5bbd14[_0xc46b('0x2a')]['includeAll']){_0x1bb2bf['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1bb2bf);})['then'](function(_0x266ecc){_0x1cbd83[_0xc46b('0x38')]=_0x266ecc;return _0x1cbd83;})[_0xc46b('0x1c')](respondWithFilteredResult(_0x4f99a5,_0x1bb2bf))[_0xc46b('0x39')](handleError(_0x4f99a5,null));};exports[_0xc46b('0x3a')]=function(_0x797f25,_0x3aad5f){var _0x4969e3={'raw':!![],'where':{'id':_0x797f25[_0xc46b('0x3b')]['id']}},_0x310a64={};_0x310a64[_0xc46b('0x29')]=_['keys'](db[_0xc46b('0x25')][_0xc46b('0x26')]);_0x310a64[_0xc46b('0x2a')]=_[_0xc46b('0x3c')](_0x797f25[_0xc46b('0x2a')]);_0x310a64[_0xc46b('0x33')]=_[_0xc46b('0x2b')](_0x310a64[_0xc46b('0x29')],_0x310a64[_0xc46b('0x2a')]);_0x4969e3[_0xc46b('0x2c')]=_[_0xc46b('0x2b')](_0x310a64[_0xc46b('0x29')],qs[_0xc46b('0x2d')](_0x797f25[_0xc46b('0x2a')][_0xc46b('0x2d')]));_0x4969e3[_0xc46b('0x2c')]=_0x4969e3[_0xc46b('0x2c')][_0xc46b('0x2e')]?_0x4969e3[_0xc46b('0x2c')]:_0x310a64[_0xc46b('0x29')];if(_0x797f25[_0xc46b('0x2a')][_0xc46b('0x3d')]){_0x4969e3['include']=[{'all':!![]}];}_0x4969e3=_[_0xc46b('0x36')]({},_0x4969e3,_0x797f25[_0xc46b('0x37')]);return db[_0xc46b('0x25')][_0xc46b('0x3e')](_0x4969e3)['then'](handleEntityNotFound(_0x3aad5f,null))['then'](respondWithResult(_0x3aad5f,null))['catch'](handleError(_0x3aad5f,null));};exports[_0xc46b('0x3f')]=function(_0x2ab1bd,_0x411b57){return db[_0xc46b('0x25')][_0xc46b('0x3f')](_0x2ab1bd[_0xc46b('0x40')],{})[_0xc46b('0x1c')](function(_0x28a14a){var _0x5b650e=_0x2ab1bd[_0xc46b('0x41')][_0xc46b('0x1d')]({'plain':!![]});if(!_0x5b650e)throw new Error(_0xc46b('0x42'));if(_0x5b650e[_0xc46b('0x43')]==='user'){var _0x233e56=_0x28a14a[_0xc46b('0x1d')]({'plain':!![]});var _0x2b92fa='Dispositions';return db[_0xc46b('0x44')][_0xc46b('0x3e')]({'where':{'name':_0x2b92fa,'userProfileId':_0x5b650e[_0xc46b('0x45')]},'raw':!![]})[_0xc46b('0x1c')](function(_0x439c90){if(_0x439c90&&_0x439c90[_0xc46b('0x46')]===0x0){return db[_0xc46b('0x47')][_0xc46b('0x3f')]({'name':_0x233e56[_0xc46b('0x22')],'resourceId':_0x233e56['id'],'type':_0x439c90[_0xc46b('0x22')],'sectionId':_0x439c90['id']},{})[_0xc46b('0x1c')](function(){return _0x28a14a;});}else{return _0x28a14a;}})[_0xc46b('0x39')](function(_0x4c3a40){logger[_0xc46b('0x20')](_0xc46b('0x48'),_0x4c3a40);throw _0x4c3a40;});}return _0x28a14a;})['then'](respondWithResult(_0x411b57,0xc9))[_0xc46b('0x39')](handleError(_0x411b57,null));};exports[_0xc46b('0x49')]=function(_0x6339d1,_0x4d8084){if(_0x6339d1[_0xc46b('0x40')]['id']){delete _0x6339d1[_0xc46b('0x40')]['id'];}return db['Disposition'][_0xc46b('0x3e')]({'where':{'id':_0x6339d1[_0xc46b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4d8084,null))['then'](saveUpdates(_0x6339d1[_0xc46b('0x40')],null))[_0xc46b('0x1c')](respondWithResult(_0x4d8084,null))[_0xc46b('0x39')](handleError(_0x4d8084,null));};exports[_0xc46b('0x1f')]=function(_0x5323a2,_0x4f5dd5){return db[_0xc46b('0x25')][_0xc46b('0x3e')]({'where':{'id':_0x5323a2['params']['id']}})[_0xc46b('0x1c')](handleEntityNotFound(_0x4f5dd5,null))[_0xc46b('0x1c')](removeEntity(_0x4f5dd5,null))[_0xc46b('0x39')](handleError(_0x4f5dd5,null));}; \ No newline at end of file +var _0x3595=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x4d0b26,_0x45af10){var _0x1a119e=function(_0x1afc06){while(--_0x1afc06){_0x4d0b26['push'](_0x4d0b26['shift']());}};_0x1a119e(++_0x45af10);}(_0x3595,0x147));var _0x5359=function(_0x3cc386,_0x52dd1b){_0x3cc386=_0x3cc386-0x0;var _0x2e26c2=_0x3595[_0x3cc386];return _0x2e26c2;};'use strict';var emlformat=require(_0x5359('0x0'));var rimraf=require(_0x5359('0x1'));var zipdir=require(_0x5359('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5359('0x3'));var moment=require(_0x5359('0x4'));var BPromise=require(_0x5359('0x5'));var Mustache=require(_0x5359('0x6'));var util=require(_0x5359('0x7'));var path=require(_0x5359('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5359('0x9'));var fs=require('fs');var fs_extra=require(_0x5359('0xa'));var _=require(_0x5359('0xb'));var squel=require(_0x5359('0xc'));var crypto=require(_0x5359('0xd'));var jsforce=require(_0x5359('0xe'));var deskjs=require(_0x5359('0xf'));var toCsv=require(_0x5359('0x10'));var querystring=require(_0x5359('0x11'));var Papa=require(_0x5359('0x12'));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(_0x5359('0x13'));var logger=require(_0x5359('0x14'))(_0x5359('0x15'));var utils=require(_0x5359('0x16'));var config=require(_0x5359('0x17'));var licenseUtil=require(_0x5359('0x18'));var db=require(_0x5359('0x19'))['db'];function respondWithStatusCode(_0x343282,_0xcf081){_0xcf081=_0xcf081||0xcc;return function(_0x2a42b1){if(_0x2a42b1){return _0x343282[_0x5359('0x1a')](_0xcf081);}return _0x343282[_0x5359('0x1b')](_0xcf081)[_0x5359('0x1c')]();};}function respondWithResult(_0xb1a895,_0x48099c){_0x48099c=_0x48099c||0xc8;return function(_0x51b3b7){if(_0x51b3b7){return _0xb1a895[_0x5359('0x1b')](_0x48099c)[_0x5359('0x1d')](_0x51b3b7);}};}function respondWithFilteredResult(_0x11d494,_0xa146f5){return function(_0xcdc03e){if(_0xcdc03e){var _0x44c489=typeof _0xa146f5['offset']==='undefined'&&typeof _0xa146f5[_0x5359('0x1e')]===_0x5359('0x1f');var _0x4de994=_0xcdc03e[_0x5359('0x20')];var _0x21184f=_0x44c489?0x0:_0xa146f5[_0x5359('0x21')];var _0x2d0962=_0x44c489?_0xcdc03e['count']:_0xa146f5['offset']+_0xa146f5['limit'];var _0x3f9d7b;if(_0x2d0962>=_0x4de994){_0x2d0962=_0x4de994;_0x3f9d7b=0xc8;}else{_0x3f9d7b=0xce;}_0x11d494[_0x5359('0x1b')](_0x3f9d7b);return _0x11d494['set'](_0x5359('0x22'),_0x21184f+'-'+_0x2d0962+'/'+_0x4de994)[_0x5359('0x1d')](_0xcdc03e);}return null;};}function patchUpdates(_0x45bf1c){return function(_0x41ab92){try{jsonpatch['apply'](_0x41ab92,_0x45bf1c,!![]);}catch(_0x5ad9fc){return BPromise[_0x5359('0x23')](_0x5ad9fc);}return _0x41ab92['save']();};}function saveUpdates(_0x21abeb,_0x27749e){return function(_0x3d3c0c){if(_0x3d3c0c){return _0x3d3c0c[_0x5359('0x24')](_0x21abeb)[_0x5359('0x25')](function(_0x51fc69){return _0x51fc69;});}return null;};}function removeEntity(_0x4a4667,_0x280392){return function(_0xc2eb10){if(_0xc2eb10){return _0xc2eb10[_0x5359('0x26')]()[_0x5359('0x25')](function(){var _0xe8cc42=_0xc2eb10[_0x5359('0x27')]({'plain':!![]});var _0x3b0d2f=_0x5359('0x28');return db[_0x5359('0x29')]['destroy']({'where':{'type':_0x3b0d2f,'resourceId':_0xe8cc42['id']}})[_0x5359('0x25')](function(){return _0xc2eb10;});})[_0x5359('0x25')](function(){_0x4a4667[_0x5359('0x1b')](0xcc)[_0x5359('0x1c')]();});}};}function handleEntityNotFound(_0x234c96,_0x402bce){return function(_0x574af1){if(!_0x574af1){_0x234c96[_0x5359('0x1a')](0x194);}return _0x574af1;};}function handleError(_0x47cda4,_0x3b0f9c){_0x3b0f9c=_0x3b0f9c||0x1f4;return function(_0x4b130a){logger[_0x5359('0x2a')](_0x4b130a[_0x5359('0x2b')]);if(_0x4b130a['name']){delete _0x4b130a[_0x5359('0x2c')];}_0x47cda4['status'](_0x3b0f9c)[_0x5359('0x2d')](_0x4b130a);};}exports[_0x5359('0x2e')]=function(_0x1ac5ac,_0x10ae78){var _0x19c102={},_0x3a2552={},_0x4ca6ea={'count':0x0,'rows':[]};var _0x6c464f=_[_0x5359('0x2f')](db[_0x5359('0x30')][_0x5359('0x31')],function(_0x385c84){return{'name':_0x385c84[_0x5359('0x32')],'type':_0x385c84[_0x5359('0x33')][_0x5359('0x34')]};});_0x3a2552[_0x5359('0x35')]=_[_0x5359('0x2f')](_0x6c464f,_0x5359('0x2c'));_0x3a2552['query']=_[_0x5359('0x36')](_0x1ac5ac[_0x5359('0x37')]);_0x3a2552['filters']=_['intersection'](_0x3a2552[_0x5359('0x35')],_0x3a2552[_0x5359('0x37')]);_0x19c102[_0x5359('0x38')]=_[_0x5359('0x39')](_0x3a2552['model'],qs[_0x5359('0x3a')](_0x1ac5ac['query'][_0x5359('0x3a')]));_0x19c102[_0x5359('0x38')]=_0x19c102[_0x5359('0x38')][_0x5359('0x3b')]?_0x19c102[_0x5359('0x38')]:_0x3a2552[_0x5359('0x35')];if(!_0x1ac5ac[_0x5359('0x37')][_0x5359('0x3c')](_0x5359('0x3d'))){_0x19c102[_0x5359('0x1e')]=qs[_0x5359('0x1e')](_0x1ac5ac[_0x5359('0x37')]['limit']);_0x19c102['offset']=qs['offset'](_0x1ac5ac[_0x5359('0x37')][_0x5359('0x21')]);}_0x19c102['order']=qs['sort'](_0x1ac5ac[_0x5359('0x37')][_0x5359('0x3e')]);_0x19c102[_0x5359('0x3f')]=qs[_0x5359('0x40')](_[_0x5359('0x41')](_0x1ac5ac[_0x5359('0x37')],_0x3a2552['filters']),_0x6c464f);if(_0x1ac5ac['query'][_0x5359('0x42')]){_0x19c102[_0x5359('0x3f')]=_[_0x5359('0x43')](_0x19c102[_0x5359('0x3f')],{'$or':_[_0x5359('0x2f')](_0x6c464f,function(_0x1a244e){if(_0x1a244e[_0x5359('0x33')]!==_0x5359('0x44')){var _0x55e6f6={};_0x55e6f6[_0x1a244e[_0x5359('0x2c')]]={'$like':'%'+_0x1ac5ac['query']['filter']+'%'};return _0x55e6f6;}})});}_0x19c102=_[_0x5359('0x43')]({},_0x19c102,_0x1ac5ac[_0x5359('0x45')]);var _0xe7a93={'where':_0x19c102[_0x5359('0x3f')]};return db[_0x5359('0x30')][_0x5359('0x20')](_0xe7a93)['then'](function(_0x2fbab1){_0x4ca6ea[_0x5359('0x20')]=_0x2fbab1;if(_0x1ac5ac[_0x5359('0x37')][_0x5359('0x46')]){_0x19c102['include']=[{'all':!![]}];}return db[_0x5359('0x30')]['findAll'](_0x19c102);})[_0x5359('0x25')](function(_0x204cab){_0x4ca6ea[_0x5359('0x47')]=_0x204cab;return _0x4ca6ea;})[_0x5359('0x25')](respondWithFilteredResult(_0x10ae78,_0x19c102))[_0x5359('0x48')](handleError(_0x10ae78,null));};exports[_0x5359('0x49')]=function(_0x175e5b,_0x165262){var _0x3a87a7={'raw':!![],'where':{'id':_0x175e5b[_0x5359('0x4a')]['id']}},_0x1ea5c9={};_0x1ea5c9[_0x5359('0x35')]=_['keys'](db[_0x5359('0x30')][_0x5359('0x31')]);_0x1ea5c9[_0x5359('0x37')]=_[_0x5359('0x36')](_0x175e5b[_0x5359('0x37')]);_0x1ea5c9[_0x5359('0x40')]=_[_0x5359('0x39')](_0x1ea5c9['model'],_0x1ea5c9[_0x5359('0x37')]);_0x3a87a7['attributes']=_[_0x5359('0x39')](_0x1ea5c9[_0x5359('0x35')],qs[_0x5359('0x3a')](_0x175e5b[_0x5359('0x37')][_0x5359('0x3a')]));_0x3a87a7['attributes']=_0x3a87a7[_0x5359('0x38')][_0x5359('0x3b')]?_0x3a87a7['attributes']:_0x1ea5c9[_0x5359('0x35')];if(_0x175e5b[_0x5359('0x37')][_0x5359('0x46')]){_0x3a87a7[_0x5359('0x4b')]=[{'all':!![]}];}_0x3a87a7=_['merge']({},_0x3a87a7,_0x175e5b[_0x5359('0x45')]);return db[_0x5359('0x30')][_0x5359('0x4c')](_0x3a87a7)[_0x5359('0x25')](handleEntityNotFound(_0x165262,null))[_0x5359('0x25')](respondWithResult(_0x165262,null))[_0x5359('0x48')](handleError(_0x165262,null));};exports[_0x5359('0x4d')]=function(_0x2a043e,_0x4a023c){return db[_0x5359('0x30')][_0x5359('0x4d')](_0x2a043e[_0x5359('0x4e')],{})['then'](function(_0x8522a5){var _0xc110cc=_0x2a043e['user'][_0x5359('0x27')]({'plain':!![]});if(!_0xc110cc)throw new Error(_0x5359('0x4f'));if(_0xc110cc[_0x5359('0x50')]===_0x5359('0x51')){var _0x53aa10=_0x8522a5['get']({'plain':!![]});var _0x4470a6='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x4470a6,'userProfileId':_0xc110cc[_0x5359('0x52')]},'raw':!![]})[_0x5359('0x25')](function(_0x23559b){if(_0x23559b&&_0x23559b[_0x5359('0x53')]===0x0){return db[_0x5359('0x29')][_0x5359('0x4d')]({'name':_0x53aa10['name'],'resourceId':_0x53aa10['id'],'type':_0x23559b[_0x5359('0x2c')],'sectionId':_0x23559b['id']},{})['then'](function(){return _0x8522a5;});}else{return _0x8522a5;}})['catch'](function(_0x12e22e){logger[_0x5359('0x2a')](_0x5359('0x54'),_0x12e22e);throw _0x12e22e;});}return _0x8522a5;})['then'](respondWithResult(_0x4a023c,0xc9))[_0x5359('0x48')](handleError(_0x4a023c,null));};exports['update']=function(_0x426808,_0x547a00){if(_0x426808[_0x5359('0x4e')]['id']){delete _0x426808['body']['id'];}return db[_0x5359('0x30')][_0x5359('0x4c')]({'where':{'id':_0x426808[_0x5359('0x4a')]['id']}})[_0x5359('0x25')](handleEntityNotFound(_0x547a00,null))[_0x5359('0x25')](saveUpdates(_0x426808[_0x5359('0x4e')],null))[_0x5359('0x25')](respondWithResult(_0x547a00,null))['catch'](handleError(_0x547a00,null));};exports[_0x5359('0x26')]=function(_0xca8396,_0x4f4535){return db[_0x5359('0x30')][_0x5359('0x4c')]({'where':{'id':_0xca8396['params']['id']}})['then'](handleEntityNotFound(_0x4f4535,null))[_0x5359('0x25')](removeEntity(_0x4f4535,null))[_0x5359('0x48')](handleError(_0x4f4535,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 62a076f..be798dd 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 _0xe4f5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','util','../../config/logger'];(function(_0x1abfc8,_0x3bb63b){var _0x5b4720=function(_0x9b0f4b){while(--_0x9b0f4b){_0x1abfc8['push'](_0x1abfc8['shift']());}};_0x5b4720(++_0x3bb63b);}(_0xe4f5,0x175));var _0x5e4f=function(_0x168a26,_0x28f831){_0x168a26=_0x168a26-0x0;var _0x30326c=_0xe4f5[_0x168a26];return _0x30326c;};'use strict';var _=require('lodash');var util=require(_0x5e4f('0x0'));var logger=require(_0x5e4f('0x1'))(_0x5e4f('0x2'));var moment=require(_0x5e4f('0x3'));var BPromise=require(_0x5e4f('0x4'));var rp=require(_0x5e4f('0x5'));var fs=require('fs');var path=require(_0x5e4f('0x6'));var rimraf=require(_0x5e4f('0x7'));var config=require(_0x5e4f('0x8'));var attributes=require(_0x5e4f('0x9'));module[_0x5e4f('0xa')]=function(_0x1f79ec,_0x534e0c){return _0x1f79ec['define'](_0x5e4f('0xb'),attributes,{'tableName':_0x5e4f('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5e4f('0xd'),'fields':['name',_0x5e4f('0xe')]},{'unique':!![],'name':'name_chat','fields':['name',_0x5e4f('0xf')]},{'unique':!![],'name':_0x5e4f('0x10'),'fields':[_0x5e4f('0x11'),_0x5e4f('0x12')]},{'unique':!![],'name':_0x5e4f('0x13'),'fields':[_0x5e4f('0x11'),_0x5e4f('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0x5e4f('0x11'),_0x5e4f('0x15')]},{'unique':!![],'name':_0x5e4f('0x16'),'fields':[_0x5e4f('0x11'),_0x5e4f('0x17')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x5e4f('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1244=['name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','name_mail','MailAccountId'];(function(_0xb0d47a,_0x8f786d){var _0x47141b=function(_0x231459){while(--_0x231459){_0xb0d47a['push'](_0xb0d47a['shift']());}};_0x47141b(++_0x8f786d);}(_0x1244,0x1ab));var _0x4124=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x1244[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x4124('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4124('0x1'));var BPromise=require(_0x4124('0x2'));var rp=require(_0x4124('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4124('0x4'));var config=require('../../config/environment');var attributes=require(_0x4124('0x5'));module[_0x4124('0x6')]=function(_0x191cac,_0x45f9c9){return _0x191cac['define'](_0x4124('0x7'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x4124('0x8'),'fields':[_0x4124('0x9'),_0x4124('0xa')]},{'unique':!![],'name':_0x4124('0xb'),'fields':[_0x4124('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0x4124('0xc'),'fields':[_0x4124('0x9'),_0x4124('0xd')]},{'unique':!![],'name':_0x4124('0xe'),'fields':[_0x4124('0x9'),_0x4124('0xf')]},{'unique':!![],'name':_0x4124('0x10'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x4124('0x11'),'fields':[_0x4124('0x9'),_0x4124('0x12')]},{'unique':!![],'name':_0x4124('0x13'),'fields':[_0x4124('0x9'),_0x4124('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d78c0a3..5b8bcec 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x23dddd,_0x5ec451){var _0x2071e3=function(_0x2f3d27){while(--_0x2f3d27){_0x23dddd['push'](_0x23dddd['shift']());}};_0x2071e3(++_0x5ec451);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4493fe,_0x3eed3d){var _0x978015=function(_0x1bda90){while(--_0x1bda90){_0x4493fe['push'](_0x4493fe['shift']());}};_0x978015(++_0x3eed3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 366685d..f67a79a 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 _0x34b2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x276824,_0x4a5b95){var _0x2d299f=function(_0x46565e){while(--_0x46565e){_0x276824['push'](_0x276824['shift']());}};_0x2d299f(++_0x4a5b95);}(_0x34b2,0xb0));var _0x234b=function(_0x24a956,_0x1a7a4f){_0x24a956=_0x24a956-0x0;var _0x38aac9=_0x34b2[_0x24a956];return _0x38aac9;};'use strict';var multer=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var path=require(_0x234b('0x2'));var timeout=require(_0x234b('0x3'));var express=require(_0x234b('0x4'));var router=express[_0x234b('0x5')]();var fs_extra=require(_0x234b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x234b('0x7'));var config=require(_0x234b('0x8'));var controller=require(_0x234b('0x9'));router[_0x234b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x234b('0xa')](_0x234b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x234b('0xc')]('/',auth[_0x234b('0xd')](),controller[_0x234b('0xe')]);router[_0x234b('0xf')](_0x234b('0xb'),auth[_0x234b('0xd')](),controller[_0x234b('0x10')]);router[_0x234b('0x11')](_0x234b('0xb'),auth[_0x234b('0xd')](),controller[_0x234b('0x12')]);module[_0x234b('0x13')]=router; \ No newline at end of file +var _0xf555=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./disposition.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports','multer'];(function(_0x52a58c,_0x102224){var _0x3e826a=function(_0x26fc10){while(--_0x26fc10){_0x52a58c['push'](_0x52a58c['shift']());}};_0x3e826a(++_0x102224);}(_0xf555,0x16f));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5f55('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f55('0x1'));var express=require(_0x5f55('0x2'));var router=express[_0x5f55('0x3')]();var fs_extra=require(_0x5f55('0x4'));var auth=require(_0x5f55('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5f55('0x6'));router[_0x5f55('0x7')]('/',auth[_0x5f55('0x8')](),controller[_0x5f55('0x9')]);router['get'](_0x5f55('0xa'),auth[_0x5f55('0x8')](),controller['show']);router[_0x5f55('0xb')]('/',auth[_0x5f55('0x8')](),controller[_0x5f55('0xc')]);router['put'](_0x5f55('0xa'),auth[_0x5f55('0x8')](),controller[_0x5f55('0xd')]);router['delete']('/:id',auth[_0x5f55('0x8')](),controller[_0x5f55('0xe')]);module[_0x5f55('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index fcdf6d0..42dd02a 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 _0x7248=['STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','14400','9600','INTEGER','SIP','DADHI','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','sequelize','exports'];(function(_0x4d763b,_0x4bf344){var _0x5758b7=function(_0x2d0b70){while(--_0x2d0b70){_0x4d763b['push'](_0x4d763b['shift']());}};_0x5758b7(++_0x4bf344);}(_0x7248,0x1b6));var _0x8724=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x7248[_0x1eb82d];return _0x2c9502;};'use strict';var Sequelize=require(_0x8724('0x0'));module[_0x8724('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8724('0x2')]},'ecm':{'type':Sequelize[_0x8724('0x3')](_0x8724('0x4'),'no'),'defaultValue':_0x8724('0x4')},'headerinfo':{'type':Sequelize[_0x8724('0x2')],'defaultValue':_0x8724('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x8724('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x8724('0x7'),_0x8724('0x8'),_0x8724('0x9'),'9600',_0x8724('0xa'),_0x8724('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM']('2400',_0x8724('0x8'),'7200',_0x8724('0xc'),'12000',_0x8724('0xb')),'defaultValue':_0x8724('0xb')},'modem':{'type':Sequelize[_0x8724('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8724('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8724('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8724('0x3')](_0x8724('0xe'),'IAX',_0x8724('0xf'),'KHOMP'),'defaultValue':_0x8724('0xe')},'key':{'type':Sequelize[_0x8724('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8724('0x10')],'defaultValue':function(){return _0x8724('0x11');}},'notificationSound':{'type':Sequelize[_0x8724('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8724('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8724('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8724('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8724('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8724('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8724('0x12')],'defaultValue':![],'comment':_0x8724('0x13'),'set':function(_0x4f860e){if(!_0x4f860e)this[_0x8724('0x14')](_0x8724('0x15'),null);this[_0x8724('0x14')]('mandatoryDisposition',_0x4f860e);}}}; \ No newline at end of file +var _0xc28e=['INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29'];(function(_0x309504,_0x54642d){var _0x56992e=function(_0x37f3c8){while(--_0x37f3c8){_0x309504['push'](_0x309504['shift']());}};_0x56992e(++_0x54642d);}(_0xc28e,0xa1));var _0xec28=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc28e[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xec28('0x0'));module[_0xec28('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xec28('0x2')]},'ecm':{'type':Sequelize[_0xec28('0x3')]('yes','no'),'defaultValue':_0xec28('0x4')},'headerinfo':{'type':Sequelize[_0xec28('0x2')],'defaultValue':_0xec28('0x5')},'localstationid':{'type':Sequelize[_0xec28('0x2')],'unique':_0xec28('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xec28('0x7'),_0xec28('0x8'),_0xec28('0x9'),_0xec28('0xa'),_0xec28('0xb'),_0xec28('0xc')),'defaultValue':_0xec28('0x8')},'maxrate':{'type':Sequelize[_0xec28('0x3')](_0xec28('0x7'),'4800',_0xec28('0x9'),'9600',_0xec28('0xb'),_0xec28('0xc')),'defaultValue':_0xec28('0xc')},'modem':{'type':Sequelize[_0xec28('0x2')],'defaultValue':_0xec28('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xec28('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xec28('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xec28('0xf'),'IAX',_0xec28('0x10'),_0xec28('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xec28('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xec28('0x12')],'defaultValue':function(){return _0xec28('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xec28('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec28('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec28('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec28('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec28('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec28('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xec28('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xec28('0x14')],'defaultValue':![],'comment':_0xec28('0x16'),'set':function(_0x11c290){if(!_0x11c290)this['setDataValue'](_0xec28('0x17'),null);this['setDataValue'](_0xec28('0x18'),_0x11c290);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e325e95..4d062ab 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 _0xffbb=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','filter','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x303986,_0x5c751c){var _0x4c4431=function(_0x161de3){while(--_0x161de3){_0x303986['push'](_0x303986['shift']());}};_0x4c4431(++_0x5c751c);}(_0xffbb,0xbc));var _0xbffb=function(_0x914577,_0x20615d){_0x914577=_0x914577-0x0;var _0x3700ad=_0xffbb[_0x914577];return _0x3700ad;};'use strict';var emlformat=require(_0xbffb('0x0'));var rimraf=require(_0xbffb('0x1'));var zipdir=require(_0xbffb('0x2'));var jsonpatch=require(_0xbffb('0x3'));var rp=require(_0xbffb('0x4'));var moment=require(_0xbffb('0x5'));var BPromise=require(_0xbffb('0x6'));var Mustache=require('mustache');var util=require(_0xbffb('0x7'));var path=require(_0xbffb('0x8'));var sox=require('sox');var csv=require(_0xbffb('0x9'));var ejs=require(_0xbffb('0xa'));var fs=require('fs');var fs_extra=require(_0xbffb('0xb'));var _=require('lodash');var squel=require(_0xbffb('0xc'));var crypto=require(_0xbffb('0xd'));var jsforce=require(_0xbffb('0xe'));var deskjs=require(_0xbffb('0xf'));var toCsv=require(_0xbffb('0x9'));var querystring=require(_0xbffb('0x10'));var Papa=require(_0xbffb('0x11'));var Redis=require(_0xbffb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbffb('0x13'));var as=require(_0xbffb('0x14'));var hardwareService=require(_0xbffb('0x15'));var logger=require('../../config/logger')(_0xbffb('0x16'));var utils=require(_0xbffb('0x17'));var config=require(_0xbffb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbffb('0x19'))['db'];config[_0xbffb('0x1a')]=_[_0xbffb('0x1b')](config['redis'],{'host':_0xbffb('0x1c'),'port':0x18eb});var socket=require(_0xbffb('0x1d'))(new Redis(config[_0xbffb('0x1a')]));require(_0xbffb('0x1e'))[_0xbffb('0x1f')](socket);var jayson=require(_0xbffb('0x20'));var client=jayson['client'][_0xbffb('0x21')]({'port':0x232c});var client9002=jayson[_0xbffb('0x22')][_0xbffb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x56fd03,_0x5efd32,_0x485574,_0xcdd2d3){return new BPromise(function(_0x2113e2,_0x4d8d86){var _0x2d4e7b=_0xcdd2d3||client;return _0x2d4e7b[_0xbffb('0x23')](_0x56fd03,_0x485574)[_0xbffb('0x24')](function(_0xd91b8e){logger[_0xbffb('0x25')](_0xbffb('0x26'),_0x5efd32,_0xbffb('0x27'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5efd32,_0xbffb('0x27'),JSON['stringify'](_0xd91b8e));if(_0xd91b8e[_0xbffb('0x28')]){if(_0xd91b8e[_0xbffb('0x28')][_0xbffb('0x29')]===0x1f4){logger[_0xbffb('0x28')](_0xbffb('0x26'),_0x5efd32,_0xd91b8e[_0xbffb('0x28')]['message']);return _0x4d8d86(_0xd91b8e['error'][_0xbffb('0x2a')]);}logger[_0xbffb('0x28')]('FaxAccount,\x20%s,\x20%s',_0x5efd32,_0xd91b8e[_0xbffb('0x28')][_0xbffb('0x2a')]);return _0x2113e2(_0xd91b8e[_0xbffb('0x28')][_0xbffb('0x2a')]);}else{logger['info'](_0xbffb('0x26'),_0x5efd32,_0xbffb('0x27'));_0x2113e2(_0xd91b8e[_0xbffb('0x2b')]['message']);}})[_0xbffb('0x2c')](function(_0x52a382){logger[_0xbffb('0x28')](_0xbffb('0x26'),_0x5efd32,_0x52a382);_0x4d8d86(_0x52a382);});});}function respondWithStatusCode(_0x38414f,_0x4a95e6){_0x4a95e6=_0x4a95e6||0xcc;return function(_0x11db1a){if(_0x11db1a){return _0x38414f[_0xbffb('0x2d')](_0x4a95e6);}return _0x38414f[_0xbffb('0x2e')](_0x4a95e6)[_0xbffb('0x2f')]();};}function respondWithResult(_0x4dbc51,_0x4e3462){_0x4e3462=_0x4e3462||0xc8;return function(_0x330e74){if(_0x330e74){return _0x4dbc51['status'](_0x4e3462)['json'](_0x330e74);}};}function respondWithFilteredResult(_0x2ae918,_0x16f500){return function(_0x2e2db9){if(_0x2e2db9){var _0x36a9ad=typeof _0x16f500[_0xbffb('0x30')]===_0xbffb('0x31')&&typeof _0x16f500['limit']===_0xbffb('0x31');var _0x50ab4e=_0x2e2db9['count'];var _0x5bdae3=_0x36a9ad?0x0:_0x16f500[_0xbffb('0x30')];var _0x2999b7=_0x36a9ad?_0x2e2db9[_0xbffb('0x32')]:_0x16f500['offset']+_0x16f500[_0xbffb('0x33')];var _0x103b5f;if(_0x2999b7>=_0x50ab4e){_0x2999b7=_0x50ab4e;_0x103b5f=0xc8;}else{_0x103b5f=0xce;}_0x2ae918['status'](_0x103b5f);return _0x2ae918[_0xbffb('0x34')](_0xbffb('0x35'),_0x5bdae3+'-'+_0x2999b7+'/'+_0x50ab4e)['json'](_0x2e2db9);}return null;};}function patchUpdates(_0x496df9){return function(_0x3d36ef){try{jsonpatch[_0xbffb('0x36')](_0x3d36ef,_0x496df9,!![]);}catch(_0x4b3627){return BPromise[_0xbffb('0x37')](_0x4b3627);}return _0x3d36ef[_0xbffb('0x38')]();};}function saveUpdates(_0x1d2093,_0x25c4f7){return function(_0x48f223){if(_0x48f223){return _0x48f223[_0xbffb('0x39')](_0x1d2093)['then'](function(_0x57bd1f){return _0x57bd1f;});}return null;};}function removeEntity(_0x349858,_0x534575){return function(_0x29d9e9){if(_0x29d9e9){return _0x29d9e9[_0xbffb('0x3a')]()[_0xbffb('0x24')](function(){var _0x564237=_0x29d9e9[_0xbffb('0x3b')]({'plain':!![]});var _0x13d737=_0xbffb('0x3c');return db[_0xbffb('0x3d')][_0xbffb('0x3a')]({'where':{'type':_0x13d737,'resourceId':_0x564237['id']}})[_0xbffb('0x24')](function(){return _0x29d9e9;});})[_0xbffb('0x24')](function(){_0x349858[_0xbffb('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376beb,_0x42b7ed){return function(_0x516e66){if(!_0x516e66){_0x376beb[_0xbffb('0x2d')](0x194);}return _0x516e66;};}function handleError(_0x23dada,_0x2e4929){_0x2e4929=_0x2e4929||0x1f4;return function(_0x8c8e55){logger[_0xbffb('0x28')](_0x8c8e55['stack']);if(_0x8c8e55[_0xbffb('0x3e')]){delete _0x8c8e55[_0xbffb('0x3e')];}_0x23dada[_0xbffb('0x2e')](_0x2e4929)[_0xbffb('0x3f')](_0x8c8e55);};}exports[_0xbffb('0x40')]=function(_0x52b846,_0x47efba){var _0x1f85c0={'include':[{'model':db[_0xbffb('0x41')],'as':_0xbffb('0x42')}]},_0x39876e={},_0x383bc3={'count':0x0,'rows':[]};var _0x142899=_[_0xbffb('0x43')](db[_0xbffb('0x44')][_0xbffb('0x45')],function(_0x1dda6f){return{'name':_0x1dda6f[_0xbffb('0x46')],'type':_0x1dda6f[_0xbffb('0x47')][_0xbffb('0x48')]};});_0x39876e[_0xbffb('0x49')]=_[_0xbffb('0x43')](_0x142899,_0xbffb('0x3e'));_0x39876e['query']=_[_0xbffb('0x4a')](_0x52b846['query']);_0x39876e['filters']=_[_0xbffb('0x4b')](_0x39876e['model'],_0x39876e['query']);_0x1f85c0[_0xbffb('0x4c')]=_['intersection'](_0x39876e[_0xbffb('0x49')],qs['fields'](_0x52b846[_0xbffb('0x4d')][_0xbffb('0x4e')]));_0x1f85c0[_0xbffb('0x4c')]=_0x1f85c0[_0xbffb('0x4c')][_0xbffb('0x4f')]?_0x1f85c0['attributes']:_0x39876e[_0xbffb('0x49')];if(!_0x52b846['query'][_0xbffb('0x50')](_0xbffb('0x51'))){_0x1f85c0[_0xbffb('0x33')]=qs['limit'](_0x52b846[_0xbffb('0x4d')][_0xbffb('0x33')]);_0x1f85c0[_0xbffb('0x30')]=qs[_0xbffb('0x30')](_0x52b846[_0xbffb('0x4d')][_0xbffb('0x30')]);}_0x1f85c0[_0xbffb('0x52')]=qs[_0xbffb('0x53')](_0x52b846['query'][_0xbffb('0x53')]);_0x1f85c0[_0xbffb('0x54')]=qs[_0xbffb('0x55')](_[_0xbffb('0x56')](_0x52b846[_0xbffb('0x4d')],_0x39876e['filters']),_0x142899);if(_0x52b846[_0xbffb('0x4d')]['filter']){_0x1f85c0[_0xbffb('0x54')]=_['merge'](_0x1f85c0[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x142899,function(_0xa4e6fc){if(_0xa4e6fc[_0xbffb('0x47')]!=='VIRTUAL'){var _0x331759={};_0x331759[_0xa4e6fc[_0xbffb('0x3e')]]={'$like':'%'+_0x52b846[_0xbffb('0x4d')]['filter']+'%'};return _0x331759;}})});}_0x1f85c0=_[_0xbffb('0x57')]({},_0x1f85c0,_0x52b846[_0xbffb('0x58')]);var _0x157f30={'where':_0x1f85c0[_0xbffb('0x54')]};return db['FaxAccount'][_0xbffb('0x32')](_0x157f30)[_0xbffb('0x24')](function(_0x42f4a9){_0x383bc3[_0xbffb('0x32')]=_0x42f4a9;if(_0x52b846[_0xbffb('0x4d')][_0xbffb('0x59')]){_0x1f85c0[_0xbffb('0x5a')]=[{'all':!![]}];}return db['FaxAccount'][_0xbffb('0x5b')](_0x1f85c0);})[_0xbffb('0x24')](function(_0x1de1cd){_0x383bc3[_0xbffb('0x5c')]=_0x1de1cd;return _0x383bc3;})[_0xbffb('0x24')](respondWithFilteredResult(_0x47efba,_0x1f85c0))[_0xbffb('0x2c')](handleError(_0x47efba,null));};exports[_0xbffb('0x5d')]=function(_0xa00622,_0x388c11){var _0x527ebc={'raw':![],'where':{'id':_0xa00622[_0xbffb('0x5e')]['id']},'include':[{'model':db[_0xbffb('0x41')],'as':'mandatoryDispositionPause'}]},_0x7b893c={};_0x7b893c[_0xbffb('0x49')]=_['keys'](db[_0xbffb('0x44')][_0xbffb('0x45')]);_0x7b893c['query']=_[_0xbffb('0x4a')](_0xa00622[_0xbffb('0x4d')]);_0x7b893c[_0xbffb('0x55')]=_[_0xbffb('0x4b')](_0x7b893c[_0xbffb('0x49')],_0x7b893c[_0xbffb('0x4d')]);_0x527ebc[_0xbffb('0x4c')]=_[_0xbffb('0x4b')](_0x7b893c[_0xbffb('0x49')],qs['fields'](_0xa00622[_0xbffb('0x4d')][_0xbffb('0x4e')]));_0x527ebc[_0xbffb('0x4c')]=_0x527ebc[_0xbffb('0x4c')]['length']?_0x527ebc['attributes']:_0x7b893c[_0xbffb('0x49')];if(_0xa00622[_0xbffb('0x4d')]['includeAll']){_0x527ebc[_0xbffb('0x5a')]=[{'all':!![]}];}_0x527ebc=_[_0xbffb('0x57')]({},_0x527ebc,_0xa00622[_0xbffb('0x58')]);return db[_0xbffb('0x44')][_0xbffb('0x5f')](_0x527ebc)[_0xbffb('0x24')](handleEntityNotFound(_0x388c11,null))[_0xbffb('0x24')](respondWithResult(_0x388c11,null))[_0xbffb('0x2c')](handleError(_0x388c11,null));};exports[_0xbffb('0x60')]=function(_0x4335e6,_0x34dbb3){return db[_0xbffb('0x44')][_0xbffb('0x60')](_0x4335e6[_0xbffb('0x61')],{})[_0xbffb('0x24')](function(_0x5608e4){var _0x4e5152=_0x4335e6[_0xbffb('0x62')]['get']({'plain':!![]});if(!_0x4e5152)throw new Error(_0xbffb('0x63'));if(_0x4e5152[_0xbffb('0x64')]==='user'){var _0x3cb446=_0x5608e4[_0xbffb('0x3b')]({'plain':!![]});var _0x2ec894=_0xbffb('0x3c');return db[_0xbffb('0x65')][_0xbffb('0x5f')]({'where':{'name':_0x2ec894,'userProfileId':_0x4e5152[_0xbffb('0x66')]},'raw':!![]})[_0xbffb('0x24')](function(_0x1f38bf){if(_0x1f38bf&&_0x1f38bf[_0xbffb('0x67')]===0x0){return db[_0xbffb('0x3d')]['create']({'name':_0x3cb446['name'],'resourceId':_0x3cb446['id'],'type':_0x1f38bf[_0xbffb('0x3e')],'sectionId':_0x1f38bf['id']},{})['then'](function(){return _0x5608e4;});}else{return _0x5608e4;}})['catch'](function(_0x3595e0){logger[_0xbffb('0x28')](_0xbffb('0x68'),_0x3595e0);throw _0x3595e0;});}return _0x5608e4;})['then'](respondWithResult(_0x34dbb3,0xc9))[_0xbffb('0x2c')](handleError(_0x34dbb3,null));};exports[_0xbffb('0x39')]=function(_0x1702b7,_0x199f2f){if(_0x1702b7['body']['id']){delete _0x1702b7[_0xbffb('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x1702b7[_0xbffb('0x5e')]['id']},'include':[{'model':db[_0xbffb('0x41')],'as':_0xbffb('0x42')}]})[_0xbffb('0x24')](handleEntityNotFound(_0x199f2f,null))[_0xbffb('0x24')](saveUpdates(_0x1702b7[_0xbffb('0x61')],null))[_0xbffb('0x24')](respondWithResult(_0x199f2f,null))[_0xbffb('0x2c')](handleError(_0x199f2f,null));};exports[_0xbffb('0x3a')]=function(_0x4748bf,_0x39540c){return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x4748bf[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x39540c,null))[_0xbffb('0x24')](removeEntity(_0x39540c,null))[_0xbffb('0x2c')](handleError(_0x39540c,null));};exports[_0xbffb('0x69')]=function(_0x5b9da5,_0x3eb21d){return db[_0xbffb('0x44')][_0xbffb('0x69')]()[_0xbffb('0x24')](respondWithResult(_0x3eb21d,null))['catch'](handleError(_0x3eb21d,null));};exports[_0xbffb('0x6a')]=function(_0x51c2de,_0x519c16,_0x49443c){if(_0x51c2de[_0xbffb('0x61')]['id']){delete _0x51c2de[_0xbffb('0x61')]['id'];}return db['FaxAccount'][_0xbffb('0x5f')]({'where':{'id':_0x51c2de[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x519c16,null))[_0xbffb('0x24')](function(_0x1dafd8){if(_0x1dafd8){_0x51c2de[_0xbffb('0x61')][_0xbffb('0x6b')]=_0x1dafd8['id'];return db[_0xbffb('0x6c')]['create'](_0x51c2de[_0xbffb('0x61')]);}})[_0xbffb('0x24')](respondWithResult(_0x519c16,null))[_0xbffb('0x2c')](handleError(_0x519c16,null));};exports[_0xbffb('0x6d')]=function(_0x26f692,_0x2c5143,_0x18e156){var _0x21e4d6={'raw':![],'where':{}};var _0x288869={};var _0x4a914b={'count':0x0,'rows':[]};return db[_0xbffb('0x44')][_0xbffb('0x6e')]({'where':{'id':_0x26f692[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x2c5143,null))['then'](function(_0x2e3177){if(_0x2e3177){_0x288869[_0xbffb('0x49')]=_[_0xbffb('0x4a')](db[_0xbffb('0x6c')][_0xbffb('0x45')]);_0x288869['query']=_['keys'](_0x26f692['query']);_0x288869['filters']=_[_0xbffb('0x4b')](_0x288869[_0xbffb('0x49')],_0x288869['query']);_0x21e4d6[_0xbffb('0x4c')]=_['intersection'](_0x288869[_0xbffb('0x49')],qs[_0xbffb('0x4e')](_0x26f692['query']['fields']));_0x21e4d6['attributes']=_0x21e4d6['attributes'][_0xbffb('0x4f')]?_0x21e4d6[_0xbffb('0x4c')]:_0x288869[_0xbffb('0x49')];if(!_0x26f692[_0xbffb('0x4d')][_0xbffb('0x50')](_0xbffb('0x51'))){_0x21e4d6['limit']=qs[_0xbffb('0x33')](_0x26f692[_0xbffb('0x4d')][_0xbffb('0x33')]);_0x21e4d6[_0xbffb('0x30')]=qs['offset'](_0x26f692[_0xbffb('0x4d')][_0xbffb('0x30')]);}_0x21e4d6['order']=qs[_0xbffb('0x53')](_0x26f692[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x21e4d6[_0xbffb('0x54')]=qs[_0xbffb('0x55')](_[_0xbffb('0x56')](_0x26f692[_0xbffb('0x4d')],_0x288869[_0xbffb('0x55')]));_0x21e4d6['where'][_0xbffb('0x6b')]=_0x2e3177['id'];if(_0x26f692[_0xbffb('0x4d')][_0xbffb('0x6f')]){_0x21e4d6[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x21e4d6[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x21e4d6[_0xbffb('0x4c')],function(_0xe83ae3){var _0xa38c20={};_0xa38c20[_0xe83ae3]={'$like':'%'+_0x26f692[_0xbffb('0x4d')][_0xbffb('0x6f')]+'%'};return _0xa38c20;})});}_0x21e4d6=_[_0xbffb('0x57')]({},_0x21e4d6,_0x26f692[_0xbffb('0x58')]);return db[_0xbffb('0x6c')][_0xbffb('0x32')]({'where':_0x21e4d6[_0xbffb('0x54')]})[_0xbffb('0x24')](function(_0x5145a2){_0x4a914b[_0xbffb('0x32')]=_0x5145a2;if(_0x26f692[_0xbffb('0x4d')]['includeAll']){_0x21e4d6['include']=[{'all':!![]}];}return db[_0xbffb('0x6c')][_0xbffb('0x5b')](_0x21e4d6);})[_0xbffb('0x24')](function(_0x323d0d){_0x4a914b[_0xbffb('0x5c')]=_0x323d0d;return _0x4a914b;});}})[_0xbffb('0x24')](respondWithFilteredResult(_0x2c5143,_0x21e4d6))[_0xbffb('0x2c')](handleError(_0x2c5143,null));};exports['removeDispositions']=function(_0x586032,_0x19ce12,_0x4384cd){return db['FaxAccount'][_0xbffb('0x5f')]({'where':{'id':_0x586032[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x19ce12,null))[_0xbffb('0x24')](function(_0x5a0be5){if(_0x5a0be5){return _0x5a0be5['removeDispositions'](_0x586032[_0xbffb('0x4d')]['ids']);}})[_0xbffb('0x24')](respondWithStatusCode(_0x19ce12,null))['catch'](handleError(_0x19ce12,null));};exports[_0xbffb('0x70')]=function(_0x16c1a2,_0x212cec,_0x1803d5){if(_0x16c1a2[_0xbffb('0x61')]['id']){delete _0x16c1a2[_0xbffb('0x61')]['id'];}return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x16c1a2['params']['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x212cec,null))[_0xbffb('0x24')](function(_0x587a96){if(_0x587a96){_0x16c1a2[_0xbffb('0x61')]['FaxAccountId']=_0x587a96['id'];return db[_0xbffb('0x71')][_0xbffb('0x60')](_0x16c1a2[_0xbffb('0x61')]);}})['then'](respondWithResult(_0x212cec,null))['catch'](handleError(_0x212cec,null));};exports[_0xbffb('0x72')]=function(_0x35b32b,_0x386669,_0x1310c3){var _0x20d5b0={'raw':![],'where':{}};var _0xba9061={};var _0x50c22e={'count':0x0,'rows':[]};return db[_0xbffb('0x44')][_0xbffb('0x6e')]({'where':{'id':_0x35b32b[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x386669,null))[_0xbffb('0x24')](function(_0x2213eb){if(_0x2213eb){_0xba9061[_0xbffb('0x49')]=_[_0xbffb('0x4a')](db[_0xbffb('0x71')]['rawAttributes']);_0xba9061[_0xbffb('0x4d')]=_[_0xbffb('0x4a')](_0x35b32b['query']);_0xba9061['filters']=_['intersection'](_0xba9061[_0xbffb('0x49')],_0xba9061['query']);_0x20d5b0[_0xbffb('0x4c')]=_[_0xbffb('0x4b')](_0xba9061[_0xbffb('0x49')],qs['fields'](_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x4e')]));_0x20d5b0[_0xbffb('0x4c')]=_0x20d5b0[_0xbffb('0x4c')][_0xbffb('0x4f')]?_0x20d5b0['attributes']:_0xba9061[_0xbffb('0x49')];if(!_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x50')]('nolimit')){_0x20d5b0[_0xbffb('0x33')]=qs[_0xbffb('0x33')](_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x33')]);_0x20d5b0['offset']=qs[_0xbffb('0x30')](_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x30')]);}_0x20d5b0[_0xbffb('0x52')]=qs[_0xbffb('0x53')](_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x20d5b0[_0xbffb('0x54')]=qs[_0xbffb('0x55')](_[_0xbffb('0x56')](_0x35b32b[_0xbffb('0x4d')],_0xba9061[_0xbffb('0x55')]));_0x20d5b0[_0xbffb('0x54')][_0xbffb('0x6b')]=_0x2213eb['id'];if(_0x35b32b['query'][_0xbffb('0x6f')]){_0x20d5b0[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x20d5b0[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x20d5b0['attributes'],function(_0x196a71){var _0x2f2c5d={};_0x2f2c5d[_0x196a71]={'$like':'%'+_0x35b32b[_0xbffb('0x4d')][_0xbffb('0x6f')]+'%'};return _0x2f2c5d;})});}_0x20d5b0=_[_0xbffb('0x57')]({},_0x20d5b0,_0x35b32b[_0xbffb('0x58')]);return db[_0xbffb('0x71')][_0xbffb('0x32')]({'where':_0x20d5b0['where']})[_0xbffb('0x24')](function(_0x314fc4){_0x50c22e[_0xbffb('0x32')]=_0x314fc4;if(_0x35b32b[_0xbffb('0x4d')]['includeAll']){_0x20d5b0[_0xbffb('0x5a')]=[{'all':!![]}];}return db[_0xbffb('0x71')][_0xbffb('0x5b')](_0x20d5b0);})[_0xbffb('0x24')](function(_0x463d59){_0x50c22e[_0xbffb('0x5c')]=_0x463d59;return _0x50c22e;});}})[_0xbffb('0x24')](respondWithFilteredResult(_0x386669,_0x20d5b0))[_0xbffb('0x2c')](handleError(_0x386669,null));};exports[_0xbffb('0x73')]=function(_0x1d3b15,_0xd6eacc,_0x4c9ffc){return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x1d3b15[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0xd6eacc,null))[_0xbffb('0x24')](function(_0x35694e){if(_0x35694e){return _0x35694e['removeAnswers'](_0x1d3b15['query'][_0xbffb('0x74')]);}})[_0xbffb('0x24')](respondWithStatusCode(_0xd6eacc,null))[_0xbffb('0x2c')](handleError(_0xd6eacc,null));};exports[_0xbffb('0x75')]=function(_0x4bdd92,_0x41df2b,_0x2f96c8){return db[_0xbffb('0x76')][_0xbffb('0x5f')]({'where':{'id':_0x4bdd92[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x41df2b,null))[_0xbffb('0x24')](function(_0x2096b9){if(_0x2096b9){return _0x2096b9[_0xbffb('0x75')](_0x4bdd92[_0xbffb('0x61')][_0xbffb('0x74')],_[_0xbffb('0x77')](_0x4bdd92[_0xbffb('0x61')],[_0xbffb('0x74'),'id'])||{});}})[_0xbffb('0x24')](respondWithResult(_0x41df2b,null))[_0xbffb('0x2c')](handleError(_0x41df2b,null));};exports[_0xbffb('0x78')]=function(_0x2fd91f,_0x4a9577,_0x325529){var _0x493dba={'raw':![],'where':{}};var _0x2817dd={};var _0x260b7d={'count':0x0,'rows':[]};return db['FaxAccount'][_0xbffb('0x6e')]({'where':{'id':_0x2fd91f[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x4a9577,null))[_0xbffb('0x24')](function(_0x17dbc2){if(_0x17dbc2){_0x2817dd[_0xbffb('0x49')]=_[_0xbffb('0x4a')](db[_0xbffb('0x76')][_0xbffb('0x45')]);_0x2817dd[_0xbffb('0x4d')]=_[_0xbffb('0x4a')](_0x2fd91f[_0xbffb('0x4d')]);_0x2817dd[_0xbffb('0x55')]=_[_0xbffb('0x4b')](_0x2817dd[_0xbffb('0x49')],_0x2817dd['query']);_0x493dba[_0xbffb('0x4c')]=_[_0xbffb('0x4b')](_0x2817dd[_0xbffb('0x49')],qs[_0xbffb('0x4e')](_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x4e')]));_0x493dba[_0xbffb('0x4c')]=_0x493dba[_0xbffb('0x4c')][_0xbffb('0x4f')]?_0x493dba[_0xbffb('0x4c')]:_0x2817dd[_0xbffb('0x49')];if(!_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x50')](_0xbffb('0x51'))){_0x493dba[_0xbffb('0x33')]=qs[_0xbffb('0x33')](_0x2fd91f['query'][_0xbffb('0x33')]);_0x493dba[_0xbffb('0x30')]=qs[_0xbffb('0x30')](_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x30')]);}_0x493dba[_0xbffb('0x52')]=qs[_0xbffb('0x53')](_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x493dba[_0xbffb('0x54')]=qs[_0xbffb('0x55')](_['pick'](_0x2fd91f[_0xbffb('0x4d')],_0x2817dd[_0xbffb('0x55')]));_0x493dba[_0xbffb('0x54')][_0xbffb('0x6b')]=_0x17dbc2['id'];if(_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x6f')]){_0x493dba[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x493dba[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x493dba[_0xbffb('0x4c')],function(_0x25a936){var _0x34857e={};_0x34857e[_0x25a936]={'$like':'%'+_0x2fd91f[_0xbffb('0x4d')]['filter']+'%'};return _0x34857e;})});}_0x493dba=_[_0xbffb('0x57')]({},_0x493dba,_0x2fd91f[_0xbffb('0x58')]);return db[_0xbffb('0x76')][_0xbffb('0x32')]({'where':_0x493dba['where']})[_0xbffb('0x24')](function(_0x347664){_0x260b7d[_0xbffb('0x32')]=_0x347664;if(_0x2fd91f['query']['includeAll']){_0x493dba[_0xbffb('0x5a')]=[{'model':db[_0xbffb('0x79')],'as':_0xbffb('0x7a'),'required':![]},{'model':db['User'],'as':_0xbffb('0x7b'),'attributes':[_0xbffb('0x3e'),_0xbffb('0x7c'),_0xbffb('0x7d')],'required':![]},{'model':db[_0xbffb('0x7e')],'as':_0xbffb('0x7f'),'attributes':['id',_0xbffb('0x3e'),_0xbffb('0x80')],'where':_0x2fd91f['query']['tag']?{'id':_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x81')]}:undefined,'required':_0x2fd91f[_0xbffb('0x4d')][_0xbffb('0x81')]?!![]:![]}];}return db[_0xbffb('0x76')][_0xbffb('0x5b')](_0x493dba);})[_0xbffb('0x24')](function(_0x3b95c1){_0x260b7d[_0xbffb('0x5c')]=_0x3b95c1;return _0x260b7d;});}})[_0xbffb('0x24')](respondWithFilteredResult(_0x4a9577,_0x493dba))[_0xbffb('0x2c')](handleError(_0x4a9577,null));};exports[_0xbffb('0x82')]=function(_0x18b60d,_0x5176d6,_0x2d0d64){return db['FaxAccount'][_0xbffb('0x6e')]({'where':{'id':_0x18b60d['params']['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x5176d6,null))[_0xbffb('0x24')](function(_0x5e2101){if(_0x5e2101){return db[_0xbffb('0x83')][_0xbffb('0x84')](function(_0x88cb48){return db[_0xbffb('0x85')][_0xbffb('0x3a')]({'where':{'FaxAccountId':_0x18b60d[_0xbffb('0x5e')]['id']},'transaction':_0x88cb48})['then'](function(_0x5720f3){var _0x57ec1f=_['map'](_0x18b60d[_0xbffb('0x61')],function(_0x324356){_0x324356[_0xbffb('0x6b')]=_0x18b60d['params']['id'];return _0x324356;});return db[_0xbffb('0x85')][_0xbffb('0x86')](_0x57ec1f,{'transaction':_0x88cb48});});})[_0xbffb('0x24')](function(){return db[_0xbffb('0x85')][_0xbffb('0x87')]({'where':{'FaxAccountId':_0x18b60d['params']['id']},'order':_0xbffb('0x88')});});}})[_0xbffb('0x24')](respondWithResult(_0x5176d6,null))[_0xbffb('0x2c')](handleError(_0x5176d6,null));};exports[_0xbffb('0x89')]=function(_0x173bf1,_0x352025,_0x37ceb7){var _0x478786={};var _0x33a8a8={};var _0x17e254;var _0x1aa17f;return db[_0xbffb('0x44')]['findOne']({'where':{'id':_0x173bf1[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x352025,null))[_0xbffb('0x24')](function(_0x17d121){if(_0x17d121){_0x17e254=_0x17d121;_0x33a8a8[_0xbffb('0x49')]=_[_0xbffb('0x4a')](db[_0xbffb('0x85')][_0xbffb('0x45')]);_0x33a8a8[_0xbffb('0x4d')]=_[_0xbffb('0x4a')](_0x173bf1[_0xbffb('0x4d')]);_0x33a8a8[_0xbffb('0x55')]=_[_0xbffb('0x4b')](_0x33a8a8['model'],_0x33a8a8[_0xbffb('0x4d')]);_0x478786[_0xbffb('0x4c')]=_[_0xbffb('0x4b')](_0x33a8a8[_0xbffb('0x49')],qs[_0xbffb('0x4e')](_0x173bf1['query'][_0xbffb('0x4e')]));_0x478786[_0xbffb('0x4c')]=_0x478786[_0xbffb('0x4c')][_0xbffb('0x4f')]?_0x478786[_0xbffb('0x4c')]:_0x33a8a8['model'];_0x478786[_0xbffb('0x52')]=qs[_0xbffb('0x53')](_0x173bf1[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x478786[_0xbffb('0x54')]=qs[_0xbffb('0x55')](_[_0xbffb('0x56')](_0x173bf1[_0xbffb('0x4d')],_0x33a8a8[_0xbffb('0x55')]));if(_0x173bf1[_0xbffb('0x4d')][_0xbffb('0x6f')]){_0x478786[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x478786[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x478786[_0xbffb('0x4c')],function(_0x32f1de){var _0x4eb24a={};_0x4eb24a[_0x32f1de]={'$like':'%'+_0x173bf1[_0xbffb('0x4d')]['filter']+'%'};return _0x4eb24a;})});}_0x478786=_[_0xbffb('0x57')]({},_0x478786,_0x173bf1['options']);return _0x17e254[_0xbffb('0x89')](_0x478786);}})[_0xbffb('0x24')](function(_0x2d1f18){if(_0x2d1f18){_0x1aa17f=_0x2d1f18[_0xbffb('0x4f')];if(!_0x173bf1[_0xbffb('0x4d')][_0xbffb('0x50')](_0xbffb('0x51'))){_0x478786[_0xbffb('0x33')]=qs[_0xbffb('0x33')](_0x173bf1[_0xbffb('0x4d')][_0xbffb('0x33')]);_0x478786[_0xbffb('0x30')]=qs[_0xbffb('0x30')](_0x173bf1['query'][_0xbffb('0x30')]);}return _0x17e254['getApplications'](_0x478786);}})[_0xbffb('0x24')](function(_0x1fd238){if(_0x1fd238){return _0x1fd238?{'count':_0x1aa17f,'rows':_0x1fd238}:null;}})['then'](respondWithResult(_0x352025,null))[_0xbffb('0x2c')](handleError(_0x352025,null));};function Extension(_0x3443fa,_0x206483,_0x2d732e,_0x455c65){this[_0xbffb('0x8a')]=_0xbffb('0x8b');this[_0xbffb('0x8c')]=_0x3443fa[_0xbffb('0x8d')];this[_0xbffb('0x8e')]=_0x455c65;this['type']=_0xbffb('0x8f');this['description']='Fax\x20Extension';this[_0xbffb('0x6b')]=_0x3443fa['id'];this[_0xbffb('0x88')]=_0x206483;this[_0xbffb('0x90')]=_0x2d732e;}function createExtensionsReciveFax(_0x22b3e2){var _0x364049=0x1;var _0x286326=[];_0x286326[_0xbffb('0x91')](new Extension(_0x22b3e2,_0x364049,'',_0xbffb('0x92')));_0x364049+=0x1;_0x286326['push'](new Extension(_0x22b3e2,_0x364049,'CDR(type)=inbound-fax',_0xbffb('0x93')));_0x364049+=0x1;for(var _0x1277fa in _0x22b3e2){if(_0x22b3e2[_0xbffb('0x50')](_0x1277fa)&&(_0x1277fa===_0xbffb('0x94')||_0x1277fa===_0xbffb('0x8d')||_0x1277fa===_0xbffb('0x95')||_0x1277fa===_0xbffb('0x96')||_0x1277fa===_0xbffb('0x97')||_0x1277fa===_0xbffb('0x98')||_0x1277fa===_0xbffb('0x99')||_0x1277fa===_0xbffb('0x9a')||_0x1277fa===_0xbffb('0x9b'))){_0x286326[_0xbffb('0x91')](new Extension(_0x22b3e2,_0x364049,_0xbffb('0x9c')+_0x1277fa+')='+_0x22b3e2[_0x1277fa],'Set'));_0x364049+=0x1;}}_0x286326[_0xbffb('0x91')](new Extension(_0x22b3e2,_0x364049,'6',_0xbffb('0x9d')));_0x364049+=0x1;_0x286326[_0xbffb('0x91')](new Extension(_0x22b3e2,_0x364049,'/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',_0xbffb('0x9e')));_0x364049=0x0;return _0x286326;}exports[_0xbffb('0x9f')]=function(_0x3868b7,_0x3142f5,_0x50172a){var _0x1fe889;return db[_0xbffb('0x83')]['transaction'](function(_0x29195e){return db[_0xbffb('0x44')][_0xbffb('0x60')](_0x3868b7[_0xbffb('0x61')],{'transaction':_0x29195e})['then'](function(_0x95ace9){_0x1fe889=_0x95ace9[_0xbffb('0x3b')]({'plain':!![]});return db[_0xbffb('0xa0')][_0xbffb('0x86')](createExtensionsReciveFax(_0x1fe889),{'transaction':_0x29195e});});})[_0xbffb('0x24')](function(){return _0x1fe889;})[_0xbffb('0x24')](respondWithResult(_0x3142f5,null))['catch'](handleError(_0x3142f5,null));};exports[_0xbffb('0xa1')]=function(_0x45ffca,_0x4d2684,_0x5e4350){var _0x56401a;return db[_0xbffb('0x83')][_0xbffb('0x84')](function(_0x5ab783){return db[_0xbffb('0x44')]['update'](_0x45ffca['body'],{'where':{'id':_0x45ffca['body']['id']},'transaction':_0x5ab783})[_0xbffb('0x24')](function(_0x147149){return db[_0xbffb('0xa0')]['destroy']({'where':{'FaxAccountId':_0x45ffca[_0xbffb('0x61')]['id']},'transaction':_0x5ab783})[_0xbffb('0x24')](function(_0x2a8137){return db[_0xbffb('0xa0')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x45ffca[_0xbffb('0x61')],[_0xbffb('0xa2'),'key',_0xbffb('0xa3'),_0xbffb('0xa4'),_0xbffb('0xa5'),_0xbffb('0xa6')])),{'transaction':_0x5ab783});});});})[_0xbffb('0x24')](function(){return db[_0xbffb('0x44')][_0xbffb('0xa7')](_0x45ffca['body']['id']);})[_0xbffb('0x24')](respondWithResult(_0x4d2684,null))[_0xbffb('0x2c')](handleError(_0x4d2684,null));};exports['getMessages']=function(_0x467502,_0x4ebb59,_0x427a72){var _0x280705={'raw':!![],'where':{}};var _0x2bba85={};var _0x2de8a7={'count':0x0,'rows':[]};return db[_0xbffb('0x44')][_0xbffb('0x6e')]({'where':{'id':_0x467502[_0xbffb('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4ebb59,null))['then'](function(_0xcf411d){if(_0xcf411d){_0x2bba85['model']=_[_0xbffb('0x4a')](db[_0xbffb('0xa8')][_0xbffb('0x45')]);_0x2bba85[_0xbffb('0x4d')]=_[_0xbffb('0x4a')](_0x467502[_0xbffb('0x4d')]);_0x2bba85['filters']=_[_0xbffb('0x4b')](_0x2bba85['model'],_0x2bba85[_0xbffb('0x4d')]);_0x280705['attributes']=_[_0xbffb('0x4b')](_0x2bba85[_0xbffb('0x49')],qs[_0xbffb('0x4e')](_0x467502[_0xbffb('0x4d')]['fields']));_0x280705[_0xbffb('0x4c')]=_0x280705[_0xbffb('0x4c')]['length']?_0x280705[_0xbffb('0x4c')]:_0x2bba85[_0xbffb('0x49')];if(!_0x467502[_0xbffb('0x4d')][_0xbffb('0x50')](_0xbffb('0x51'))){_0x280705[_0xbffb('0x33')]=qs[_0xbffb('0x33')](_0x467502[_0xbffb('0x4d')]['limit']);_0x280705[_0xbffb('0x30')]=qs[_0xbffb('0x30')](_0x467502[_0xbffb('0x4d')][_0xbffb('0x30')]);}_0x280705['order']=qs['sort'](_0x467502[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x280705[_0xbffb('0x54')]=qs['filters'](_[_0xbffb('0x56')](_0x467502[_0xbffb('0x4d')],_0x2bba85[_0xbffb('0x55')]));_0x280705[_0xbffb('0x54')][_0xbffb('0x6b')]=_0xcf411d['id'];if(_0x467502[_0xbffb('0x4d')][_0xbffb('0x6f')]){_0x280705[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x280705['where'],{'$or':_[_0xbffb('0x43')](_0x280705['attributes'],function(_0x592104){var _0x4de244={};_0x4de244[_0x592104]={'$like':'%'+_0x467502['query'][_0xbffb('0x6f')]+'%'};return _0x4de244;})});}if(_0x467502['query'][_0xbffb('0xa9')]){var _0x5a7189=_0x467502[_0xbffb('0x4d')][_0xbffb('0xa9')][_0xbffb('0xaa')](',');var _0x2e7068={};_0x2e7068[_0x5a7189[0x0]]={'$gte':moment(_0x5a7189[0x1])[_0xbffb('0xab')]('YYYY-MM-DD\x20HH:mm:ss')};_0x280705[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x280705[_0xbffb('0x54')],_0x2e7068);}_0x280705=_[_0xbffb('0x57')]({},_0x280705,_0x467502[_0xbffb('0x58')]);return db[_0xbffb('0xa8')][_0xbffb('0x32')]({'where':_0x280705[_0xbffb('0x54')]})['then'](function(_0x449e98){_0x2de8a7[_0xbffb('0x32')]=_0x449e98;if(_0x467502[_0xbffb('0x4d')]['includeAll']){_0x280705[_0xbffb('0x5a')]=[{'all':!![]}];}return db[_0xbffb('0xa8')][_0xbffb('0x5b')](_0x280705);})['then'](function(_0x1da29f){_0x2de8a7[_0xbffb('0x5c')]=_0x1da29f;return _0x2de8a7;});}})[_0xbffb('0x24')](respondWithFilteredResult(_0x4ebb59,_0x280705))[_0xbffb('0x2c')](handleError(_0x4ebb59,null));};exports[_0xbffb('0x3f')]=function(_0x44cefe,_0x30ffda,_0x45377e){var _0x4ab402,_0x8469df={},_0x4cadab;if(_0x44cefe[_0xbffb('0x61')]['to']){_0x4cadab=_0x44cefe[_0xbffb('0x61')]['to'][0x0];}return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x44cefe[_0xbffb('0x5e')]['id']},'include':[{'model':db[_0xbffb('0xac')],'as':_0xbffb('0xad'),'include':[{'model':db[_0xbffb('0x79')],'as':_0xbffb('0xae'),'where':{'fax':_0x4cadab},'limit':0x1,'order':[[_0xbffb('0xa4'),_0xbffb('0xaf')]]}]}]})[_0xbffb('0x24')](handleEntityNotFound(_0x30ffda,null))[_0xbffb('0x24')](function(_0x162f44){_0x4ab402=_0x162f44;if(_0x44cefe['body'][_0xbffb('0xb0')]&&_0x44cefe['body'][_0xbffb('0xb0')]['length']){for(var _0x58dbbe=0x0;_0x58dbbe<_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][_0xbffb('0x4f')];_0x58dbbe+=0x1){_0x44cefe['body'][_0xbffb('0xb0')][_0x58dbbe]={'filename':_0x44cefe['body'][_0xbffb('0xb0')][_0x58dbbe]['name'],'id':_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][_0x58dbbe]['id'],'path':path['join'](config[_0xbffb('0xb1')],_0xbffb('0xb2'),_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][_0x58dbbe][_0xbffb('0xb3')])};}}return respondWithRpcPromise('CheckAfterSend',_0xbffb('0xb4'),{'FaxAccountId':_[_0xbffb('0xb5')](_0x44cefe[_0xbffb('0x5e')]['id'])?undefined:_0x44cefe['params']['id'],'path':_[_0xbffb('0xb5')](_0x44cefe[_0xbffb('0x61')]['attachments'][0x0][_0xbffb('0x8')])?undefined:_0x44cefe['body'][_0xbffb('0xb0')][0x0]['path'],'fax':_['isNil'](_0x44cefe[_0xbffb('0x61')]['to'][0x0])?undefined:_0x44cefe[_0xbffb('0x61')]['to'][0x0]},client9002);})[_0xbffb('0x24')](function(){if(_0x4ab402){if(_[_0xbffb('0xb5')](_0x44cefe['body'][_0xbffb('0xb6')])){_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb6')]=util[_0xbffb('0xab')](_0xbffb('0xb7'),_0x4ab402['name'],_0x4ab402[_0xbffb('0xb8')]);}if(_0x4ab402['List']){if(_0x4ab402[_0xbffb('0xad')][_0xbffb('0xae')][_0xbffb('0x4f')]){return _0x4ab402[_0xbffb('0xad')][_0xbffb('0xae')][0x0];}else{return db[_0xbffb('0x79')]['create'](_[_0xbffb('0x1b')](_0x44cefe['body'],{'firstName':_0x44cefe[_0xbffb('0x61')]['to'][0x0],'phone':_0x44cefe[_0xbffb('0x61')]['to'][0x0],'fax':_0x44cefe[_0xbffb('0x61')]['to'][0x0],'ListId':_0x4ab402[_0xbffb('0xa6')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xbffb('0xb9'));}})['then'](function(_0x3d374c){if(_0x3d374c){return db['FaxInteraction']['find']({'where':{'ContactId':_0x3d374c['id'],'closed':![],'FaxAccountId':_0x4ab402['id']}})[_0xbffb('0x24')](function(_0x5ceeba){if(_0x5ceeba){return[_0x5ceeba,![]];}return db['FaxInteraction'][_0xbffb('0x60')]({'UserId':_0x44cefe['user']['id'],'ContactId':_0x3d374c['id'],'FaxAccountId':_0x4ab402['id'],'fax':_0x44cefe[_0xbffb('0x61')]['to'][0x0],'firstMsgDirection':_0xbffb('0xba'),'Messages':[_[_0xbffb('0x57')](_0x44cefe['body'],{'read':![],'body':_0x44cefe['body'][_0xbffb('0xb0')][0x0][_0xbffb('0xbb')],'FaxAccountId':_0x4ab402['id'],'UserId':_0x44cefe[_0xbffb('0x62')]['id'],'ContactId':_0x3d374c['id'],'AttachmentId':_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0xbffb('0xa8')],'as':_0xbffb('0xbc')}]})['then'](function(_0x103087){return[_0x103087,!![]];});});}else{throw new Error(_0xbffb('0xbd'));}})[_0xbffb('0xbe')](function(_0x3319e9,_0xd0d492){if(_0xd0d492){return _0x3319e9;}return db['FaxMessage']['create']({'direction':_0xbffb('0xba'),'read':![],'body':_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0]['filename'],'FaxAccountId':_0x4ab402['id'],'FaxInteractionId':_0x3319e9['id'],'UserId':_0x44cefe['user']['id'],'ContactId':_0x3319e9[_0xbffb('0xbf')],'AttachmentId':_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0]['id']})['then'](function(_0x5124ec){_0x3319e9[_0xbffb('0xc0')][_0xbffb('0xbc')]=[];_0x3319e9[_0xbffb('0xc0')]['Messages'][_0xbffb('0x91')](_0x5124ec['dataValues']);return _0x3319e9;});})[_0xbffb('0x24')](function(_0x5d4c82){respondWithRpcPromise(_0xbffb('0xc1'),_0xbffb('0xc1'),{'FaxAccountId':_[_0xbffb('0xb5')](_0x44cefe['params']['id'])?undefined:_0x44cefe[_0xbffb('0x5e')]['id'],'path':_['isNil'](_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0]['path'])?undefined:_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0][_0xbffb('0x8')],'fax':_[_0xbffb('0xb5')](_0x44cefe[_0xbffb('0x61')]['to'][0x0])?undefined:_0x44cefe[_0xbffb('0x61')]['to'][0x0],'AttachmentId':_0x44cefe[_0xbffb('0x61')][_0xbffb('0xb0')][0x0]['id']},client9002)[_0xbffb('0x24')](function(_0x2a7b2c){logger[_0xbffb('0x25')](_0xbffb('0xc2'),_0x2a7b2c);})[_0xbffb('0x2c')](function(_0x51c87b){logger[_0xbffb('0x25')]('SendFaxRpc,\x20%s',_0x51c87b);});return _0x5d4c82;})[_0xbffb('0x24')](respondWithResult(_0x30ffda,null))[_0xbffb('0x2c')](handleError(_0x30ffda,null));};exports['addAgents']=function(_0x8f37c,_0x2fc3ab,_0x4f4aea){return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x8f37c['params']['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x2fc3ab,null))['then'](function(_0x58ce28){if(_0x58ce28){return _0x58ce28[_0xbffb('0xc3')](_0x8f37c[_0xbffb('0x61')]['ids'],_['omit'](_0x8f37c[_0xbffb('0x61')],[_0xbffb('0x74'),'id'])||{})[_0xbffb('0xbe')](function(_0x569b1f){for(var _0x5c8ce9=0x0;_0x5c8ce9<_0x8f37c['body']['ids']['length'];_0x5c8ce9+=0x1){socket[_0xbffb('0xc4')](_0xbffb('0xc5'),{'UserId':Number(_0x8f37c[_0xbffb('0x61')][_0xbffb('0x74')][_0x5c8ce9]),'FaxAccountId':Number(_0x8f37c['params']['id'])});}return _0x569b1f;});}})[_0xbffb('0x24')](respondWithResult(_0x2fc3ab,null))[_0xbffb('0x2c')](handleError(_0x2fc3ab,null));};exports[_0xbffb('0xc6')]=function(_0x31ae03,_0x2dc22c,_0x1db426){return db[_0xbffb('0x44')][_0xbffb('0x5f')]({'where':{'id':_0x31ae03[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x2dc22c,null))['then'](function(_0xbbcefa){if(_0xbbcefa){return _0xbbcefa[_0xbffb('0xc6')](_0x31ae03[_0xbffb('0x4d')]['ids'])[_0xbffb('0x24')](function(){if(_['isArray'](_0x31ae03['query'][_0xbffb('0x74')])){for(var _0x2fc208=0x0;_0x2fc208<_0x31ae03[_0xbffb('0x4d')][_0xbffb('0x74')][_0xbffb('0x4f')];_0x2fc208+=0x1){socket['emit'](_0xbffb('0xc7'),{'UserId':Number(_0x31ae03[_0xbffb('0x4d')][_0xbffb('0x74')][_0x2fc208]),'FaxAccountId':Number(_0x31ae03[_0xbffb('0x5e')]['id'])});}}else{socket[_0xbffb('0xc4')](_0xbffb('0xc7'),{'UserId':Number(_0x31ae03[_0xbffb('0x4d')]['ids']),'FaxAccountId':Number(_0x31ae03[_0xbffb('0x5e')]['id'])});}});}})[_0xbffb('0x24')](respondWithStatusCode(_0x2dc22c,null))[_0xbffb('0x2c')](handleError(_0x2dc22c,null));};exports[_0xbffb('0xc8')]=function(_0x4cc3cb,_0x2e40ca,_0x36d3de){var _0x2c3662={};var _0x383792={};var _0x888478;var _0x81c28f;return db[_0xbffb('0x44')][_0xbffb('0x6e')]({'where':{'id':_0x4cc3cb[_0xbffb('0x5e')]['id']}})[_0xbffb('0x24')](handleEntityNotFound(_0x2e40ca,null))[_0xbffb('0x24')](function(_0x404730){if(_0x404730){_0x888478=_0x404730;_0x383792['model']=_[_0xbffb('0x4a')](db[_0xbffb('0xc9')][_0xbffb('0x45')]);_0x383792[_0xbffb('0x4d')]=_['keys'](_0x4cc3cb[_0xbffb('0x4d')]);_0x383792[_0xbffb('0x55')]=_[_0xbffb('0x4b')](_0x383792[_0xbffb('0x49')],_0x383792[_0xbffb('0x4d')]);_0x2c3662[_0xbffb('0x4c')]=_['intersection'](_0x383792[_0xbffb('0x49')],qs[_0xbffb('0x4e')](_0x4cc3cb['query']['fields']));_0x2c3662[_0xbffb('0x4c')]=_0x2c3662[_0xbffb('0x4c')][_0xbffb('0x4f')]?_0x2c3662[_0xbffb('0x4c')]:_0x383792['model'];_0x2c3662[_0xbffb('0x52')]=qs[_0xbffb('0x53')](_0x4cc3cb[_0xbffb('0x4d')][_0xbffb('0x53')]);_0x2c3662['where']=qs[_0xbffb('0x55')](_[_0xbffb('0x56')](_0x4cc3cb['query'],_0x383792[_0xbffb('0x55')]));if(_0x4cc3cb[_0xbffb('0x4d')][_0xbffb('0x6f')]){_0x2c3662[_0xbffb('0x54')]=_[_0xbffb('0x57')](_0x2c3662[_0xbffb('0x54')],{'$or':_[_0xbffb('0x43')](_0x2c3662[_0xbffb('0x4c')],function(_0x5296fe){var _0x577cf8={};_0x577cf8[_0x5296fe]={'$like':'%'+_0x4cc3cb['query']['filter']+'%'};return _0x577cf8;})});}_0x2c3662=_[_0xbffb('0x57')]({},_0x2c3662,_0x4cc3cb['options']);return _0x888478[_0xbffb('0xc8')](_0x2c3662);}})[_0xbffb('0x24')](function(_0x31829f){if(_0x31829f){_0x81c28f=_0x31829f['length'];if(!_0x4cc3cb[_0xbffb('0x4d')][_0xbffb('0x50')](_0xbffb('0x51'))){_0x2c3662['limit']=qs['limit'](_0x4cc3cb['query'][_0xbffb('0x33')]);_0x2c3662[_0xbffb('0x30')]=qs[_0xbffb('0x30')](_0x4cc3cb[_0xbffb('0x4d')][_0xbffb('0x30')]);}return _0x888478[_0xbffb('0xc8')](_0x2c3662);}})[_0xbffb('0x24')](function(_0x381a90){if(_0x381a90){return _0x381a90?{'count':_0x81c28f,'rows':_0x381a90}:null;}})[_0xbffb('0x24')](respondWithResult(_0x2e40ca,null))['catch'](handleError(_0x2e40ca,null));}; \ No newline at end of file +var _0x3dfa=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','FaxAccounts','UserProfileResource','then','stack','name','Pause','map','FaxAccount','fieldName','key','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','show','mandatoryDispositionPause','rawAttributes','filters','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','FaxAccountId','Disposition','findOne','keys','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','priority','getApplications','context','exten','localstationid','app','system','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','basename','isNil','from','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x28e042,_0x414a8c){var _0x290fce=function(_0x3d216d){while(--_0x3d216d){_0x28e042['push'](_0x28e042['shift']());}};_0x290fce(++_0x414a8c);}(_0x3dfa,0xb5));var _0xa3df=function(_0x3ab184,_0x1fa593){_0x3ab184=_0x3ab184-0x0;var _0x4765ac=_0x3dfa[_0x3ab184];return _0x4765ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3df('0x0'));var zipdir=require(_0xa3df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3df('0x2'));var moment=require('moment');var BPromise=require(_0xa3df('0x3'));var Mustache=require(_0xa3df('0x4'));var util=require(_0xa3df('0x5'));var path=require(_0xa3df('0x6'));var sox=require(_0xa3df('0x7'));var csv=require(_0xa3df('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3df('0x9'));var _=require('lodash');var squel=require(_0xa3df('0xa'));var crypto=require(_0xa3df('0xb'));var jsforce=require(_0xa3df('0xc'));var deskjs=require(_0xa3df('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa3df('0xe'));var Papa=require(_0xa3df('0xf'));var Redis=require(_0xa3df('0x10'));var authService=require(_0xa3df('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa3df('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3df('0x13'))(_0xa3df('0x14'));var utils=require(_0xa3df('0x15'));var config=require(_0xa3df('0x16'));var licenseUtil=require(_0xa3df('0x17'));var db=require(_0xa3df('0x18'))['db'];config[_0xa3df('0x19')]=_['defaults'](config[_0xa3df('0x19')],{'host':_0xa3df('0x1a'),'port':0x18eb});var socket=require(_0xa3df('0x1b'))(new Redis(config[_0xa3df('0x19')]));require(_0xa3df('0x1c'))[_0xa3df('0x1d')](socket);var jayson=require(_0xa3df('0x1e'));var client=jayson[_0xa3df('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xa3df('0x1f')][_0xa3df('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x153c6f,_0x13d645,_0x1ed3de,_0x4156c7){return new BPromise(function(_0x188445,_0x3f6047){var _0x3110b0=_0x4156c7||client;return _0x3110b0[_0xa3df('0x21')](_0x153c6f,_0x1ed3de)['then'](function(_0x1e3417){logger[_0xa3df('0x22')](_0xa3df('0x23'),_0x13d645,_0xa3df('0x24'));logger['debug'](_0xa3df('0x25'),_0x13d645,_0xa3df('0x24'),JSON['stringify'](_0x1e3417));if(_0x1e3417[_0xa3df('0x26')]){if(_0x1e3417[_0xa3df('0x26')][_0xa3df('0x27')]===0x1f4){logger[_0xa3df('0x26')]('FaxAccount,\x20%s,\x20%s',_0x13d645,_0x1e3417['error'][_0xa3df('0x28')]);return _0x3f6047(_0x1e3417[_0xa3df('0x26')]['message']);}logger[_0xa3df('0x26')](_0xa3df('0x23'),_0x13d645,_0x1e3417[_0xa3df('0x26')][_0xa3df('0x28')]);return _0x188445(_0x1e3417[_0xa3df('0x26')][_0xa3df('0x28')]);}else{logger[_0xa3df('0x22')]('FaxAccount,\x20%s,\x20%s',_0x13d645,_0xa3df('0x24'));_0x188445(_0x1e3417[_0xa3df('0x29')]['message']);}})[_0xa3df('0x2a')](function(_0x45165f){logger[_0xa3df('0x26')](_0xa3df('0x23'),_0x13d645,_0x45165f);_0x3f6047(_0x45165f);});});}function respondWithStatusCode(_0x459081,_0x264fc1){_0x264fc1=_0x264fc1||0xcc;return function(_0x180c7d){if(_0x180c7d){return _0x459081[_0xa3df('0x2b')](_0x264fc1);}return _0x459081[_0xa3df('0x2c')](_0x264fc1)[_0xa3df('0x2d')]();};}function respondWithResult(_0xfc3596,_0x221a65){_0x221a65=_0x221a65||0xc8;return function(_0x349f39){if(_0x349f39){return _0xfc3596[_0xa3df('0x2c')](_0x221a65)[_0xa3df('0x2e')](_0x349f39);}};}function respondWithFilteredResult(_0x29a716,_0xec36e7){return function(_0x566174){if(_0x566174){var _0x212cc3=typeof _0xec36e7[_0xa3df('0x2f')]===_0xa3df('0x30')&&typeof _0xec36e7['limit']==='undefined';var _0x45f89e=_0x566174[_0xa3df('0x31')];var _0x5e6363=_0x212cc3?0x0:_0xec36e7[_0xa3df('0x2f')];var _0x4815d8=_0x212cc3?_0x566174[_0xa3df('0x31')]:_0xec36e7['offset']+_0xec36e7[_0xa3df('0x32')];var _0x326783;if(_0x4815d8>=_0x45f89e){_0x4815d8=_0x45f89e;_0x326783=0xc8;}else{_0x326783=0xce;}_0x29a716[_0xa3df('0x2c')](_0x326783);return _0x29a716['set'](_0xa3df('0x33'),_0x5e6363+'-'+_0x4815d8+'/'+_0x45f89e)[_0xa3df('0x2e')](_0x566174);}return null;};}function patchUpdates(_0x211e46){return function(_0x562278){try{jsonpatch[_0xa3df('0x34')](_0x562278,_0x211e46,!![]);}catch(_0x5dc78d){return BPromise['reject'](_0x5dc78d);}return _0x562278[_0xa3df('0x35')]();};}function saveUpdates(_0x28e5e9,_0x1feda4){return function(_0x363611){if(_0x363611){return _0x363611[_0xa3df('0x36')](_0x28e5e9)['then'](function(_0x554885){return _0x554885;});}return null;};}function removeEntity(_0x3c1140,_0xf8a3fb){return function(_0x177741){if(_0x177741){return _0x177741[_0xa3df('0x37')]()['then'](function(){var _0x221706=_0x177741['get']({'plain':!![]});var _0x40018c=_0xa3df('0x38');return db[_0xa3df('0x39')][_0xa3df('0x37')]({'where':{'type':_0x40018c,'resourceId':_0x221706['id']}})[_0xa3df('0x3a')](function(){return _0x177741;});})[_0xa3df('0x3a')](function(){_0x3c1140['status'](0xcc)[_0xa3df('0x2d')]();});}};}function handleEntityNotFound(_0x1cc397,_0x461aa4){return function(_0x1d85d4){if(!_0x1d85d4){_0x1cc397[_0xa3df('0x2b')](0x194);}return _0x1d85d4;};}function handleError(_0x4fdcd8,_0x1c9315){_0x1c9315=_0x1c9315||0x1f4;return function(_0x38ee2f){logger[_0xa3df('0x26')](_0x38ee2f[_0xa3df('0x3b')]);if(_0x38ee2f[_0xa3df('0x3c')]){delete _0x38ee2f[_0xa3df('0x3c')];}_0x4fdcd8[_0xa3df('0x2c')](_0x1c9315)['send'](_0x38ee2f);};}exports['index']=function(_0x5df1d3,_0x3b7d61){var _0x5ed414={'include':[{'model':db[_0xa3df('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3d8582={},_0x2fb0d6={'count':0x0,'rows':[]};var _0x5b4724=_[_0xa3df('0x3e')](db[_0xa3df('0x3f')]['rawAttributes'],function(_0x42ba6e){return{'name':_0x42ba6e[_0xa3df('0x40')],'type':_0x42ba6e['type'][_0xa3df('0x41')]};});_0x3d8582['model']=_[_0xa3df('0x3e')](_0x5b4724,'name');_0x3d8582['query']=_['keys'](_0x5df1d3[_0xa3df('0x42')]);_0x3d8582['filters']=_[_0xa3df('0x43')](_0x3d8582['model'],_0x3d8582[_0xa3df('0x42')]);_0x5ed414[_0xa3df('0x44')]=_[_0xa3df('0x43')](_0x3d8582['model'],qs[_0xa3df('0x45')](_0x5df1d3['query']['fields']));_0x5ed414[_0xa3df('0x44')]=_0x5ed414['attributes'][_0xa3df('0x46')]?_0x5ed414['attributes']:_0x3d8582[_0xa3df('0x47')];if(!_0x5df1d3[_0xa3df('0x42')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x5ed414[_0xa3df('0x32')]=qs[_0xa3df('0x32')](_0x5df1d3['query'][_0xa3df('0x32')]);_0x5ed414[_0xa3df('0x2f')]=qs['offset'](_0x5df1d3[_0xa3df('0x42')][_0xa3df('0x2f')]);}_0x5ed414[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x5df1d3[_0xa3df('0x42')][_0xa3df('0x4b')]);_0x5ed414['where']=qs['filters'](_[_0xa3df('0x4c')](_0x5df1d3[_0xa3df('0x42')],_0x3d8582['filters']),_0x5b4724);if(_0x5df1d3[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x5ed414[_0xa3df('0x4e')]=_['merge'](_0x5ed414['where'],{'$or':_[_0xa3df('0x3e')](_0x5b4724,function(_0x30293b){if(_0x30293b[_0xa3df('0x4f')]!==_0xa3df('0x50')){var _0x2e2672={};_0x2e2672[_0x30293b[_0xa3df('0x3c')]]={'$like':'%'+_0x5df1d3['query'][_0xa3df('0x4d')]+'%'};return _0x2e2672;}})});}_0x5ed414=_[_0xa3df('0x51')]({},_0x5ed414,_0x5df1d3[_0xa3df('0x52')]);var _0x4d4d6d={'where':_0x5ed414['where']};return db[_0xa3df('0x3f')][_0xa3df('0x31')](_0x4d4d6d)[_0xa3df('0x3a')](function(_0x56fd23){_0x2fb0d6['count']=_0x56fd23;if(_0x5df1d3[_0xa3df('0x42')]['includeAll']){_0x5ed414[_0xa3df('0x53')]=[{'all':!![]}];}return db[_0xa3df('0x3f')][_0xa3df('0x54')](_0x5ed414);})[_0xa3df('0x3a')](function(_0x1a751d){_0x2fb0d6['rows']=_0x1a751d;return _0x2fb0d6;})['then'](respondWithFilteredResult(_0x3b7d61,_0x5ed414))['catch'](handleError(_0x3b7d61,null));};exports[_0xa3df('0x55')]=function(_0x4ec9a8,_0x292e21){var _0x205f10={'raw':![],'where':{'id':_0x4ec9a8['params']['id']},'include':[{'model':db[_0xa3df('0x3d')],'as':_0xa3df('0x56')}]},_0x1cd639={};_0x1cd639[_0xa3df('0x47')]=_['keys'](db[_0xa3df('0x3f')][_0xa3df('0x57')]);_0x1cd639[_0xa3df('0x42')]=_['keys'](_0x4ec9a8[_0xa3df('0x42')]);_0x1cd639[_0xa3df('0x58')]=_[_0xa3df('0x43')](_0x1cd639[_0xa3df('0x47')],_0x1cd639['query']);_0x205f10[_0xa3df('0x44')]=_['intersection'](_0x1cd639[_0xa3df('0x47')],qs[_0xa3df('0x45')](_0x4ec9a8[_0xa3df('0x42')][_0xa3df('0x45')]));_0x205f10[_0xa3df('0x44')]=_0x205f10[_0xa3df('0x44')]['length']?_0x205f10['attributes']:_0x1cd639['model'];if(_0x4ec9a8[_0xa3df('0x42')][_0xa3df('0x59')]){_0x205f10['include']=[{'all':!![]}];}_0x205f10=_[_0xa3df('0x51')]({},_0x205f10,_0x4ec9a8[_0xa3df('0x52')]);return db[_0xa3df('0x3f')][_0xa3df('0x5a')](_0x205f10)[_0xa3df('0x3a')](handleEntityNotFound(_0x292e21,null))[_0xa3df('0x3a')](respondWithResult(_0x292e21,null))[_0xa3df('0x2a')](handleError(_0x292e21,null));};exports[_0xa3df('0x5b')]=function(_0x55b8c6,_0x1ea386){return db[_0xa3df('0x3f')][_0xa3df('0x5b')](_0x55b8c6[_0xa3df('0x5c')],{})[_0xa3df('0x3a')](function(_0x2c6a0d){var _0x2542c1=_0x55b8c6[_0xa3df('0x5d')][_0xa3df('0x5e')]({'plain':!![]});if(!_0x2542c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2542c1[_0xa3df('0x5f')]===_0xa3df('0x5d')){var _0x58c062=_0x2c6a0d[_0xa3df('0x5e')]({'plain':!![]});var _0x5a299f='FaxAccounts';return db[_0xa3df('0x60')]['find']({'where':{'name':_0x5a299f,'userProfileId':_0x2542c1[_0xa3df('0x61')]},'raw':!![]})[_0xa3df('0x3a')](function(_0x1fac56){if(_0x1fac56&&_0x1fac56[_0xa3df('0x62')]===0x0){return db[_0xa3df('0x39')][_0xa3df('0x5b')]({'name':_0x58c062['name'],'resourceId':_0x58c062['id'],'type':_0x1fac56[_0xa3df('0x3c')],'sectionId':_0x1fac56['id']},{})[_0xa3df('0x3a')](function(){return _0x2c6a0d;});}else{return _0x2c6a0d;}})[_0xa3df('0x2a')](function(_0x24f99c){logger[_0xa3df('0x26')](_0xa3df('0x63'),_0x24f99c);throw _0x24f99c;});}return _0x2c6a0d;})[_0xa3df('0x3a')](respondWithResult(_0x1ea386,0xc9))[_0xa3df('0x2a')](handleError(_0x1ea386,null));};exports[_0xa3df('0x36')]=function(_0x10965c,_0x337805){if(_0x10965c[_0xa3df('0x5c')]['id']){delete _0x10965c[_0xa3df('0x5c')]['id'];}return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0x10965c[_0xa3df('0x64')]['id']},'include':[{'model':db[_0xa3df('0x3d')],'as':_0xa3df('0x56')}]})[_0xa3df('0x3a')](handleEntityNotFound(_0x337805,null))['then'](saveUpdates(_0x10965c[_0xa3df('0x5c')],null))[_0xa3df('0x3a')](respondWithResult(_0x337805,null))[_0xa3df('0x2a')](handleError(_0x337805,null));};exports[_0xa3df('0x37')]=function(_0x252a8c,_0x22a508){return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0x252a8c[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x22a508,null))[_0xa3df('0x3a')](removeEntity(_0x22a508,null))[_0xa3df('0x2a')](handleError(_0x22a508,null));};exports['describe']=function(_0xfa6955,_0x4f14c5){return db[_0xa3df('0x3f')]['describe']()[_0xa3df('0x3a')](respondWithResult(_0x4f14c5,null))[_0xa3df('0x2a')](handleError(_0x4f14c5,null));};exports['addDisposition']=function(_0x31a3eb,_0xf0f811,_0x57ed6c){if(_0x31a3eb[_0xa3df('0x5c')]['id']){delete _0x31a3eb['body']['id'];}return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0x31a3eb['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0xf0f811,null))[_0xa3df('0x3a')](function(_0x41bab8){if(_0x41bab8){_0x31a3eb['body'][_0xa3df('0x65')]=_0x41bab8['id'];return db[_0xa3df('0x66')]['create'](_0x31a3eb[_0xa3df('0x5c')]);}})[_0xa3df('0x3a')](respondWithResult(_0xf0f811,null))['catch'](handleError(_0xf0f811,null));};exports['getDispositions']=function(_0x37a04f,_0x46e205,_0x3c1ca4){var _0x161c71={'raw':![],'where':{}};var _0x3f18d3={};var _0xe5a560={'count':0x0,'rows':[]};return db[_0xa3df('0x3f')][_0xa3df('0x67')]({'where':{'id':_0x37a04f['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x46e205,null))[_0xa3df('0x3a')](function(_0x3cc519){if(_0x3cc519){_0x3f18d3[_0xa3df('0x47')]=_[_0xa3df('0x68')](db[_0xa3df('0x66')]['rawAttributes']);_0x3f18d3[_0xa3df('0x42')]=_['keys'](_0x37a04f[_0xa3df('0x42')]);_0x3f18d3[_0xa3df('0x58')]=_[_0xa3df('0x43')](_0x3f18d3[_0xa3df('0x47')],_0x3f18d3['query']);_0x161c71[_0xa3df('0x44')]=_[_0xa3df('0x43')](_0x3f18d3[_0xa3df('0x47')],qs[_0xa3df('0x45')](_0x37a04f[_0xa3df('0x42')]['fields']));_0x161c71[_0xa3df('0x44')]=_0x161c71['attributes'][_0xa3df('0x46')]?_0x161c71[_0xa3df('0x44')]:_0x3f18d3[_0xa3df('0x47')];if(!_0x37a04f[_0xa3df('0x42')]['hasOwnProperty'](_0xa3df('0x49'))){_0x161c71['limit']=qs['limit'](_0x37a04f[_0xa3df('0x42')][_0xa3df('0x32')]);_0x161c71[_0xa3df('0x2f')]=qs['offset'](_0x37a04f[_0xa3df('0x42')][_0xa3df('0x2f')]);}_0x161c71[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x37a04f['query'][_0xa3df('0x4b')]);_0x161c71[_0xa3df('0x4e')]=qs[_0xa3df('0x58')](_[_0xa3df('0x4c')](_0x37a04f['query'],_0x3f18d3[_0xa3df('0x58')]));_0x161c71[_0xa3df('0x4e')][_0xa3df('0x65')]=_0x3cc519['id'];if(_0x37a04f[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x161c71['where']=_['merge'](_0x161c71[_0xa3df('0x4e')],{'$or':_[_0xa3df('0x3e')](_0x161c71[_0xa3df('0x44')],function(_0x6d9e){var _0x337522={};_0x337522[_0x6d9e]={'$like':'%'+_0x37a04f[_0xa3df('0x42')][_0xa3df('0x4d')]+'%'};return _0x337522;})});}_0x161c71=_[_0xa3df('0x51')]({},_0x161c71,_0x37a04f['options']);return db[_0xa3df('0x66')][_0xa3df('0x31')]({'where':_0x161c71[_0xa3df('0x4e')]})[_0xa3df('0x3a')](function(_0x13663b){_0xe5a560[_0xa3df('0x31')]=_0x13663b;if(_0x37a04f[_0xa3df('0x42')][_0xa3df('0x59')]){_0x161c71[_0xa3df('0x53')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x161c71);})[_0xa3df('0x3a')](function(_0x308b5a){_0xe5a560[_0xa3df('0x69')]=_0x308b5a;return _0xe5a560;});}})[_0xa3df('0x3a')](respondWithFilteredResult(_0x46e205,_0x161c71))[_0xa3df('0x2a')](handleError(_0x46e205,null));};exports[_0xa3df('0x6a')]=function(_0xbaf751,_0x22bbf2,_0x2cc536){return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0xbaf751[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x22bbf2,null))[_0xa3df('0x3a')](function(_0x5c1401){if(_0x5c1401){return _0x5c1401[_0xa3df('0x6a')](_0xbaf751[_0xa3df('0x42')][_0xa3df('0x6b')]);}})[_0xa3df('0x3a')](respondWithStatusCode(_0x22bbf2,null))[_0xa3df('0x2a')](handleError(_0x22bbf2,null));};exports[_0xa3df('0x6c')]=function(_0x37c961,_0x4ecdb4,_0xf44952){if(_0x37c961['body']['id']){delete _0x37c961['body']['id'];}return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0x37c961['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x4ecdb4,null))[_0xa3df('0x3a')](function(_0xb0a509){if(_0xb0a509){_0x37c961[_0xa3df('0x5c')][_0xa3df('0x65')]=_0xb0a509['id'];return db[_0xa3df('0x6d')][_0xa3df('0x5b')](_0x37c961[_0xa3df('0x5c')]);}})[_0xa3df('0x3a')](respondWithResult(_0x4ecdb4,null))[_0xa3df('0x2a')](handleError(_0x4ecdb4,null));};exports[_0xa3df('0x6e')]=function(_0x5370f0,_0x1d6dbb,_0x2558ef){var _0x2a6da9={'raw':![],'where':{}};var _0x43cf88={};var _0x778e4a={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5370f0['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x1d6dbb,null))[_0xa3df('0x3a')](function(_0x26ed6d){if(_0x26ed6d){_0x43cf88[_0xa3df('0x47')]=_['keys'](db[_0xa3df('0x6d')]['rawAttributes']);_0x43cf88['query']=_[_0xa3df('0x68')](_0x5370f0[_0xa3df('0x42')]);_0x43cf88['filters']=_[_0xa3df('0x43')](_0x43cf88['model'],_0x43cf88['query']);_0x2a6da9[_0xa3df('0x44')]=_[_0xa3df('0x43')](_0x43cf88['model'],qs[_0xa3df('0x45')](_0x5370f0[_0xa3df('0x42')][_0xa3df('0x45')]));_0x2a6da9[_0xa3df('0x44')]=_0x2a6da9[_0xa3df('0x44')][_0xa3df('0x46')]?_0x2a6da9[_0xa3df('0x44')]:_0x43cf88[_0xa3df('0x47')];if(!_0x5370f0[_0xa3df('0x42')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x2a6da9['limit']=qs['limit'](_0x5370f0[_0xa3df('0x42')]['limit']);_0x2a6da9[_0xa3df('0x2f')]=qs['offset'](_0x5370f0[_0xa3df('0x42')][_0xa3df('0x2f')]);}_0x2a6da9['order']=qs[_0xa3df('0x4b')](_0x5370f0[_0xa3df('0x42')][_0xa3df('0x4b')]);_0x2a6da9[_0xa3df('0x4e')]=qs[_0xa3df('0x58')](_['pick'](_0x5370f0[_0xa3df('0x42')],_0x43cf88[_0xa3df('0x58')]));_0x2a6da9[_0xa3df('0x4e')][_0xa3df('0x65')]=_0x26ed6d['id'];if(_0x5370f0[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x2a6da9['where']=_[_0xa3df('0x51')](_0x2a6da9['where'],{'$or':_[_0xa3df('0x3e')](_0x2a6da9[_0xa3df('0x44')],function(_0x54ee16){var _0x4827a6={};_0x4827a6[_0x54ee16]={'$like':'%'+_0x5370f0[_0xa3df('0x42')][_0xa3df('0x4d')]+'%'};return _0x4827a6;})});}_0x2a6da9=_[_0xa3df('0x51')]({},_0x2a6da9,_0x5370f0[_0xa3df('0x52')]);return db['CannedAnswer'][_0xa3df('0x31')]({'where':_0x2a6da9[_0xa3df('0x4e')]})[_0xa3df('0x3a')](function(_0x539b1e){_0x778e4a['count']=_0x539b1e;if(_0x5370f0[_0xa3df('0x42')][_0xa3df('0x59')]){_0x2a6da9[_0xa3df('0x53')]=[{'all':!![]}];}return db[_0xa3df('0x6d')][_0xa3df('0x54')](_0x2a6da9);})[_0xa3df('0x3a')](function(_0x57678a){_0x778e4a[_0xa3df('0x69')]=_0x57678a;return _0x778e4a;});}})[_0xa3df('0x3a')](respondWithFilteredResult(_0x1d6dbb,_0x2a6da9))[_0xa3df('0x2a')](handleError(_0x1d6dbb,null));};exports[_0xa3df('0x6f')]=function(_0xb99453,_0x42600c,_0xa693c8){return db['FaxAccount'][_0xa3df('0x5a')]({'where':{'id':_0xb99453[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x42600c,null))[_0xa3df('0x3a')](function(_0x3933a4){if(_0x3933a4){return _0x3933a4['removeAnswers'](_0xb99453[_0xa3df('0x42')][_0xa3df('0x6b')]);}})[_0xa3df('0x3a')](respondWithStatusCode(_0x42600c,null))[_0xa3df('0x2a')](handleError(_0x42600c,null));};exports[_0xa3df('0x70')]=function(_0x40cba0,_0x173b69,_0x225c0e){return db[_0xa3df('0x71')]['find']({'where':{'id':_0x40cba0[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x173b69,null))['then'](function(_0x35b1a3){if(_0x35b1a3){return _0x35b1a3[_0xa3df('0x70')](_0x40cba0[_0xa3df('0x5c')][_0xa3df('0x6b')],_[_0xa3df('0x72')](_0x40cba0[_0xa3df('0x5c')],[_0xa3df('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x173b69,null))[_0xa3df('0x2a')](handleError(_0x173b69,null));};exports[_0xa3df('0x73')]=function(_0xd7a43,_0x1af1b5,_0x1c94b1){var _0x5d4fe8={'raw':![],'where':{}};var _0x49b08d={};var _0x3d17db={'count':0x0,'rows':[]};return db[_0xa3df('0x3f')][_0xa3df('0x67')]({'where':{'id':_0xd7a43[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x1af1b5,null))[_0xa3df('0x3a')](function(_0x12896d){if(_0x12896d){_0x49b08d[_0xa3df('0x47')]=_[_0xa3df('0x68')](db['FaxInteraction'][_0xa3df('0x57')]);_0x49b08d['query']=_['keys'](_0xd7a43[_0xa3df('0x42')]);_0x49b08d[_0xa3df('0x58')]=_[_0xa3df('0x43')](_0x49b08d[_0xa3df('0x47')],_0x49b08d['query']);_0x5d4fe8['attributes']=_[_0xa3df('0x43')](_0x49b08d['model'],qs[_0xa3df('0x45')](_0xd7a43[_0xa3df('0x42')][_0xa3df('0x45')]));_0x5d4fe8['attributes']=_0x5d4fe8[_0xa3df('0x44')][_0xa3df('0x46')]?_0x5d4fe8[_0xa3df('0x44')]:_0x49b08d['model'];if(!_0xd7a43[_0xa3df('0x42')][_0xa3df('0x48')]('nolimit')){_0x5d4fe8['limit']=qs[_0xa3df('0x32')](_0xd7a43['query'][_0xa3df('0x32')]);_0x5d4fe8[_0xa3df('0x2f')]=qs[_0xa3df('0x2f')](_0xd7a43['query'][_0xa3df('0x2f')]);}_0x5d4fe8[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0xd7a43['query'][_0xa3df('0x4b')]);_0x5d4fe8[_0xa3df('0x4e')]=qs[_0xa3df('0x58')](_['pick'](_0xd7a43['query'],_0x49b08d[_0xa3df('0x58')]));_0x5d4fe8[_0xa3df('0x4e')][_0xa3df('0x65')]=_0x12896d['id'];if(_0xd7a43[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x5d4fe8[_0xa3df('0x4e')]=_[_0xa3df('0x51')](_0x5d4fe8[_0xa3df('0x4e')],{'$or':_[_0xa3df('0x3e')](_0x5d4fe8[_0xa3df('0x44')],function(_0xc6e9ce){var _0x16bf22={};_0x16bf22[_0xc6e9ce]={'$like':'%'+_0xd7a43[_0xa3df('0x42')][_0xa3df('0x4d')]+'%'};return _0x16bf22;})});}_0x5d4fe8=_['merge']({},_0x5d4fe8,_0xd7a43[_0xa3df('0x52')]);return db[_0xa3df('0x71')][_0xa3df('0x31')]({'where':_0x5d4fe8['where']})[_0xa3df('0x3a')](function(_0x33bc3c){_0x3d17db[_0xa3df('0x31')]=_0x33bc3c;if(_0xd7a43[_0xa3df('0x42')][_0xa3df('0x59')]){_0x5d4fe8[_0xa3df('0x53')]=[{'model':db[_0xa3df('0x74')],'as':'Contact','required':![]},{'model':db[_0xa3df('0x75')],'as':'Owner','attributes':['name',_0xa3df('0x76'),_0xa3df('0x77')],'required':![]},{'model':db[_0xa3df('0x78')],'as':_0xa3df('0x79'),'attributes':['id',_0xa3df('0x3c'),_0xa3df('0x7a')],'where':_0xd7a43[_0xa3df('0x42')][_0xa3df('0x7b')]?{'id':_0xd7a43[_0xa3df('0x42')][_0xa3df('0x7b')]}:undefined,'required':_0xd7a43[_0xa3df('0x42')][_0xa3df('0x7b')]?!![]:![]}];}return db[_0xa3df('0x71')][_0xa3df('0x54')](_0x5d4fe8);})['then'](function(_0x47cb9a){_0x3d17db[_0xa3df('0x69')]=_0x47cb9a;return _0x3d17db;});}})['then'](respondWithFilteredResult(_0x1af1b5,_0x5d4fe8))['catch'](handleError(_0x1af1b5,null));};exports[_0xa3df('0x7c')]=function(_0x33fef1,_0x1f2676,_0x4b11e6){return db[_0xa3df('0x3f')][_0xa3df('0x67')]({'where':{'id':_0x33fef1['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x1f2676,null))[_0xa3df('0x3a')](function(_0x38861a){if(_0x38861a){return db[_0xa3df('0x7d')][_0xa3df('0x7e')](function(_0x3a72eb){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x33fef1[_0xa3df('0x64')]['id']},'transaction':_0x3a72eb})['then'](function(_0x49291a){var _0x20609b=_[_0xa3df('0x3e')](_0x33fef1[_0xa3df('0x5c')],function(_0x218e91){_0x218e91[_0xa3df('0x65')]=_0x33fef1[_0xa3df('0x64')]['id'];return _0x218e91;});return db[_0xa3df('0x7f')]['bulkCreate'](_0x20609b,{'transaction':_0x3a72eb});});})[_0xa3df('0x3a')](function(){return db[_0xa3df('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x33fef1[_0xa3df('0x64')]['id']},'order':_0xa3df('0x80')});});}})[_0xa3df('0x3a')](respondWithResult(_0x1f2676,null))[_0xa3df('0x2a')](handleError(_0x1f2676,null));};exports[_0xa3df('0x81')]=function(_0x35da13,_0x25a1ed,_0x10e76b){var _0x1afdad={};var _0x1eb124={};var _0x4fb0d8;var _0x4c75f1;return db[_0xa3df('0x3f')]['findOne']({'where':{'id':_0x35da13[_0xa3df('0x64')]['id']}})['then'](handleEntityNotFound(_0x25a1ed,null))[_0xa3df('0x3a')](function(_0x2696d4){if(_0x2696d4){_0x4fb0d8=_0x2696d4;_0x1eb124[_0xa3df('0x47')]=_[_0xa3df('0x68')](db['FaxApplication'][_0xa3df('0x57')]);_0x1eb124[_0xa3df('0x42')]=_[_0xa3df('0x68')](_0x35da13['query']);_0x1eb124[_0xa3df('0x58')]=_[_0xa3df('0x43')](_0x1eb124[_0xa3df('0x47')],_0x1eb124[_0xa3df('0x42')]);_0x1afdad['attributes']=_[_0xa3df('0x43')](_0x1eb124[_0xa3df('0x47')],qs['fields'](_0x35da13[_0xa3df('0x42')][_0xa3df('0x45')]));_0x1afdad['attributes']=_0x1afdad[_0xa3df('0x44')][_0xa3df('0x46')]?_0x1afdad[_0xa3df('0x44')]:_0x1eb124[_0xa3df('0x47')];_0x1afdad[_0xa3df('0x4a')]=qs['sort'](_0x35da13['query'][_0xa3df('0x4b')]);_0x1afdad[_0xa3df('0x4e')]=qs[_0xa3df('0x58')](_[_0xa3df('0x4c')](_0x35da13[_0xa3df('0x42')],_0x1eb124[_0xa3df('0x58')]));if(_0x35da13[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x1afdad[_0xa3df('0x4e')]=_['merge'](_0x1afdad['where'],{'$or':_[_0xa3df('0x3e')](_0x1afdad['attributes'],function(_0x1d6d93){var _0x57e966={};_0x57e966[_0x1d6d93]={'$like':'%'+_0x35da13[_0xa3df('0x42')][_0xa3df('0x4d')]+'%'};return _0x57e966;})});}_0x1afdad=_[_0xa3df('0x51')]({},_0x1afdad,_0x35da13[_0xa3df('0x52')]);return _0x4fb0d8[_0xa3df('0x81')](_0x1afdad);}})[_0xa3df('0x3a')](function(_0x491db7){if(_0x491db7){_0x4c75f1=_0x491db7[_0xa3df('0x46')];if(!_0x35da13[_0xa3df('0x42')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x1afdad[_0xa3df('0x32')]=qs[_0xa3df('0x32')](_0x35da13[_0xa3df('0x42')][_0xa3df('0x32')]);_0x1afdad[_0xa3df('0x2f')]=qs['offset'](_0x35da13['query']['offset']);}return _0x4fb0d8[_0xa3df('0x81')](_0x1afdad);}})['then'](function(_0x40b584){if(_0x40b584){return _0x40b584?{'count':_0x4c75f1,'rows':_0x40b584}:null;}})[_0xa3df('0x3a')](respondWithResult(_0x25a1ed,null))[_0xa3df('0x2a')](handleError(_0x25a1ed,null));};function Extension(_0x3b8cc6,_0x34dc70,_0x3ed1ed,_0x2355cd){this[_0xa3df('0x82')]='from-voip-provider';this[_0xa3df('0x83')]=_0x3b8cc6[_0xa3df('0x84')];this[_0xa3df('0x85')]=_0x2355cd;this[_0xa3df('0x4f')]=_0xa3df('0x86');this['description']=_0xa3df('0x87');this[_0xa3df('0x65')]=_0x3b8cc6['id'];this['priority']=_0x34dc70;this[_0xa3df('0x88')]=_0x3ed1ed;}function createExtensionsReciveFax(_0x48666a){var _0x56fada=0x1;var _0xee9f98=[];_0xee9f98['push'](new Extension(_0x48666a,_0x56fada,'',_0xa3df('0x89')));_0x56fada+=0x1;_0xee9f98[_0xa3df('0x8a')](new Extension(_0x48666a,_0x56fada,_0xa3df('0x8b'),_0xa3df('0x8c')));_0x56fada+=0x1;for(var _0x304644 in _0x48666a){if(_0x48666a[_0xa3df('0x48')](_0x304644)&&(_0x304644==='ecm'||_0x304644===_0xa3df('0x84')||_0x304644===_0xa3df('0x8d')||_0x304644===_0xa3df('0x8e')||_0x304644===_0xa3df('0x8f')||_0x304644===_0xa3df('0x90')||_0x304644===_0xa3df('0x91')||_0x304644===_0xa3df('0x92')||_0x304644===_0xa3df('0x93'))){_0xee9f98[_0xa3df('0x8a')](new Extension(_0x48666a,_0x56fada,'FAXOPT('+_0x304644+')='+_0x48666a[_0x304644],_0xa3df('0x8c')));_0x56fada+=0x1;}}_0xee9f98[_0xa3df('0x8a')](new Extension(_0x48666a,_0x56fada,'6','Wait'));_0x56fada+=0x1;_0xee9f98[_0xa3df('0x8a')](new Extension(_0x48666a,_0x56fada,'/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'));_0x56fada=0x0;return _0xee9f98;}exports[_0xa3df('0x94')]=function(_0x245f4f,_0x154c92,_0x3eca5b){var _0x3b3156;return db[_0xa3df('0x7d')]['transaction'](function(_0x530a61){return db[_0xa3df('0x3f')][_0xa3df('0x5b')](_0x245f4f[_0xa3df('0x5c')],{'transaction':_0x530a61})['then'](function(_0x37ce21){_0x3b3156=_0x37ce21[_0xa3df('0x5e')]({'plain':!![]});return db['VoiceExtension'][_0xa3df('0x95')](createExtensionsReciveFax(_0x3b3156),{'transaction':_0x530a61});});})[_0xa3df('0x3a')](function(){return _0x3b3156;})['then'](respondWithResult(_0x154c92,null))[_0xa3df('0x2a')](handleError(_0x154c92,null));};exports[_0xa3df('0x96')]=function(_0x56b1ea,_0x188669,_0x2ab24d){var _0x11e585;return db[_0xa3df('0x7d')][_0xa3df('0x7e')](function(_0x3a0bcb){return db[_0xa3df('0x3f')][_0xa3df('0x36')](_0x56b1ea[_0xa3df('0x5c')],{'where':{'id':_0x56b1ea['body']['id']},'transaction':_0x3a0bcb})[_0xa3df('0x3a')](function(_0x18d111){return db[_0xa3df('0x97')][_0xa3df('0x37')]({'where':{'FaxAccountId':_0x56b1ea['body']['id']},'transaction':_0x3a0bcb})[_0xa3df('0x3a')](function(_0x3486f4){return db['VoiceExtension'][_0xa3df('0x95')](createExtensionsReciveFax(_[_0xa3df('0x72')](_0x56b1ea['body'],[_0xa3df('0x98'),_0xa3df('0x41'),'createdAt','updatedAt',_0xa3df('0x99'),_0xa3df('0x9a')])),{'transaction':_0x3a0bcb});});});})[_0xa3df('0x3a')](function(){return db[_0xa3df('0x3f')][_0xa3df('0x9b')](_0x56b1ea['body']['id']);})['then'](respondWithResult(_0x188669,null))[_0xa3df('0x2a')](handleError(_0x188669,null));};exports[_0xa3df('0x9c')]=function(_0x1eea2f,_0x3212fd,_0x569e81){var _0xfe7fa1={'raw':!![],'where':{}};var _0x5fa229={};var _0x125e12={'count':0x0,'rows':[]};return db[_0xa3df('0x3f')][_0xa3df('0x67')]({'where':{'id':_0x1eea2f[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x3212fd,null))[_0xa3df('0x3a')](function(_0x55fb88){if(_0x55fb88){_0x5fa229['model']=_[_0xa3df('0x68')](db[_0xa3df('0x9d')][_0xa3df('0x57')]);_0x5fa229[_0xa3df('0x42')]=_['keys'](_0x1eea2f[_0xa3df('0x42')]);_0x5fa229['filters']=_[_0xa3df('0x43')](_0x5fa229['model'],_0x5fa229[_0xa3df('0x42')]);_0xfe7fa1['attributes']=_[_0xa3df('0x43')](_0x5fa229[_0xa3df('0x47')],qs['fields'](_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x45')]));_0xfe7fa1[_0xa3df('0x44')]=_0xfe7fa1[_0xa3df('0x44')][_0xa3df('0x46')]?_0xfe7fa1[_0xa3df('0x44')]:_0x5fa229[_0xa3df('0x47')];if(!_0x1eea2f[_0xa3df('0x42')]['hasOwnProperty']('nolimit')){_0xfe7fa1['limit']=qs['limit'](_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x32')]);_0xfe7fa1[_0xa3df('0x2f')]=qs[_0xa3df('0x2f')](_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x2f')]);}_0xfe7fa1['order']=qs[_0xa3df('0x4b')](_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x4b')]);_0xfe7fa1[_0xa3df('0x4e')]=qs['filters'](_[_0xa3df('0x4c')](_0x1eea2f[_0xa3df('0x42')],_0x5fa229[_0xa3df('0x58')]));_0xfe7fa1[_0xa3df('0x4e')]['FaxAccountId']=_0x55fb88['id'];if(_0x1eea2f[_0xa3df('0x42')]['filter']){_0xfe7fa1['where']=_[_0xa3df('0x51')](_0xfe7fa1[_0xa3df('0x4e')],{'$or':_[_0xa3df('0x3e')](_0xfe7fa1[_0xa3df('0x44')],function(_0x17557e){var _0x941e94={};_0x941e94[_0x17557e]={'$like':'%'+_0x1eea2f['query'][_0xa3df('0x4d')]+'%'};return _0x941e94;})});}if(_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x9e')]){var _0x34d4b0=_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x9e')][_0xa3df('0x9f')](',');var _0x5229c1={};_0x5229c1[_0x34d4b0[0x0]]={'$gte':moment(_0x34d4b0[0x1])['format'](_0xa3df('0xa0'))};_0xfe7fa1[_0xa3df('0x4e')]=_[_0xa3df('0x51')](_0xfe7fa1[_0xa3df('0x4e')],_0x5229c1);}_0xfe7fa1=_[_0xa3df('0x51')]({},_0xfe7fa1,_0x1eea2f[_0xa3df('0x52')]);return db['FaxMessage'][_0xa3df('0x31')]({'where':_0xfe7fa1[_0xa3df('0x4e')]})[_0xa3df('0x3a')](function(_0x368bc4){_0x125e12[_0xa3df('0x31')]=_0x368bc4;if(_0x1eea2f[_0xa3df('0x42')][_0xa3df('0x59')]){_0xfe7fa1[_0xa3df('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0xa3df('0x54')](_0xfe7fa1);})[_0xa3df('0x3a')](function(_0x1e734e){_0x125e12[_0xa3df('0x69')]=_0x1e734e;return _0x125e12;});}})[_0xa3df('0x3a')](respondWithFilteredResult(_0x3212fd,_0xfe7fa1))[_0xa3df('0x2a')](handleError(_0x3212fd,null));};exports['send']=function(_0x584400,_0x582f3d,_0x14211a){var _0x578fbb,_0x4b35dd={},_0x4b8c57;if(_0x584400[_0xa3df('0x5c')]['to']){_0x4b8c57=_0x584400[_0xa3df('0x5c')]['to'][0x0];}return db[_0xa3df('0x3f')][_0xa3df('0x5a')]({'where':{'id':_0x584400[_0xa3df('0x64')]['id']},'include':[{'model':db[_0xa3df('0xa1')],'as':_0xa3df('0xa2'),'include':[{'model':db[_0xa3df('0x74')],'as':_0xa3df('0xa3'),'where':{'fax':_0x4b8c57},'limit':0x1,'order':[['updatedAt',_0xa3df('0xa4')]]}]}]})['then'](handleEntityNotFound(_0x582f3d,null))[_0xa3df('0x3a')](function(_0x4fb6d2){_0x578fbb=_0x4fb6d2;if(_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')]&&_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][_0xa3df('0x46')]){for(var _0x1c48c7=0x0;_0x1c48c7<_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][_0xa3df('0x46')];_0x1c48c7+=0x1){_0x584400['body']['attachments'][_0x1c48c7]={'filename':_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][_0x1c48c7][_0xa3df('0x3c')],'id':_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][_0x1c48c7]['id'],'path':path[_0xa3df('0xa6')](config[_0xa3df('0xa7')],'server/files/attachments',_0x584400['body'][_0xa3df('0xa5')][_0x1c48c7][_0xa3df('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x584400[_0xa3df('0x64')]['id'])?undefined:_0x584400[_0xa3df('0x64')]['id'],'path':_[_0xa3df('0xa9')](_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][0x0]['path'])?undefined:_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][0x0]['path'],'fax':_[_0xa3df('0xa9')](_0x584400[_0xa3df('0x5c')]['to'][0x0])?undefined:_0x584400['body']['to'][0x0]},client9002);})['then'](function(){if(_0x578fbb){if(_[_0xa3df('0xa9')](_0x584400['body'][_0xa3df('0xaa')])){_0x584400['body'][_0xa3df('0xaa')]=util[_0xa3df('0xab')](_0xa3df('0xac'),_0x578fbb[_0xa3df('0x3c')],_0x578fbb[_0xa3df('0xad')]);}if(_0x578fbb[_0xa3df('0xa2')]){if(_0x578fbb[_0xa3df('0xa2')][_0xa3df('0xa3')]['length']){return _0x578fbb[_0xa3df('0xa2')][_0xa3df('0xa3')][0x0];}else{return db[_0xa3df('0x74')]['create'](_[_0xa3df('0xae')](_0x584400['body'],{'firstName':_0x584400[_0xa3df('0x5c')]['to'][0x0],'phone':_0x584400[_0xa3df('0x5c')]['to'][0x0],'fax':_0x584400[_0xa3df('0x5c')]['to'][0x0],'ListId':_0x578fbb['ListId']}));}}else{throw new Error(_0xa3df('0xaf'));}}else{throw new Error(_0xa3df('0xb0'));}})[_0xa3df('0x3a')](function(_0x512159){if(_0x512159){return db[_0xa3df('0x71')]['find']({'where':{'ContactId':_0x512159['id'],'closed':![],'FaxAccountId':_0x578fbb['id']}})[_0xa3df('0x3a')](function(_0xf41bc4){if(_0xf41bc4){return[_0xf41bc4,![]];}return db[_0xa3df('0x71')][_0xa3df('0x5b')]({'UserId':_0x584400[_0xa3df('0x5d')]['id'],'ContactId':_0x512159['id'],'FaxAccountId':_0x578fbb['id'],'fax':_0x584400[_0xa3df('0x5c')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa3df('0x51')](_0x584400['body'],{'read':![],'body':_0x584400[_0xa3df('0x5c')]['attachments'][0x0]['filename'],'FaxAccountId':_0x578fbb['id'],'UserId':_0x584400['user']['id'],'ContactId':_0x512159['id'],'AttachmentId':_0x584400['body'][_0xa3df('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xa3df('0x9d')],'as':_0xa3df('0xb1')}]})[_0xa3df('0x3a')](function(_0x461253){return[_0x461253,!![]];});});}else{throw new Error(_0xa3df('0xb2'));}})[_0xa3df('0xb3')](function(_0x329993,_0x1d998a){if(_0x1d998a){return _0x329993;}return db['FaxMessage'][_0xa3df('0x5b')]({'direction':'out','read':![],'body':_0x584400['body'][_0xa3df('0xa5')][0x0][_0xa3df('0xb4')],'FaxAccountId':_0x578fbb['id'],'FaxInteractionId':_0x329993['id'],'UserId':_0x584400['user']['id'],'ContactId':_0x329993[_0xa3df('0xb5')],'AttachmentId':_0x584400[_0xa3df('0x5c')]['attachments'][0x0]['id']})[_0xa3df('0x3a')](function(_0x209dd9){_0x329993[_0xa3df('0xb6')]['Messages']=[];_0x329993[_0xa3df('0xb6')][_0xa3df('0xb1')]['push'](_0x209dd9['dataValues']);return _0x329993;});})[_0xa3df('0x3a')](function(_0x1e5844){respondWithRpcPromise('SendFax',_0xa3df('0xb7'),{'FaxAccountId':_[_0xa3df('0xa9')](_0x584400['params']['id'])?undefined:_0x584400[_0xa3df('0x64')]['id'],'path':_[_0xa3df('0xa9')](_0x584400['body']['attachments'][0x0][_0xa3df('0x6')])?undefined:_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][0x0][_0xa3df('0x6')],'fax':_[_0xa3df('0xa9')](_0x584400[_0xa3df('0x5c')]['to'][0x0])?undefined:_0x584400[_0xa3df('0x5c')]['to'][0x0],'AttachmentId':_0x584400[_0xa3df('0x5c')][_0xa3df('0xa5')][0x0]['id']},client9002)[_0xa3df('0x3a')](function(_0x31b9b2){logger[_0xa3df('0x22')](_0xa3df('0xb8'),_0x31b9b2);})['catch'](function(_0x1a789a){logger[_0xa3df('0x22')]('SendFaxRpc,\x20%s',_0x1a789a);});return _0x1e5844;})[_0xa3df('0x3a')](respondWithResult(_0x582f3d,null))[_0xa3df('0x2a')](handleError(_0x582f3d,null));};exports[_0xa3df('0xb9')]=function(_0x6f4e12,_0x410615,_0x593057){return db['FaxAccount'][_0xa3df('0x5a')]({'where':{'id':_0x6f4e12['params']['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x410615,null))[_0xa3df('0x3a')](function(_0x5ada98){if(_0x5ada98){return _0x5ada98[_0xa3df('0xb9')](_0x6f4e12[_0xa3df('0x5c')][_0xa3df('0x6b')],_[_0xa3df('0x72')](_0x6f4e12['body'],[_0xa3df('0x6b'),'id'])||{})[_0xa3df('0xb3')](function(_0x54a9d9){for(var _0x1e2175=0x0;_0x1e2175<_0x6f4e12[_0xa3df('0x5c')][_0xa3df('0x6b')]['length'];_0x1e2175+=0x1){socket[_0xa3df('0xba')](_0xa3df('0xbb'),{'UserId':Number(_0x6f4e12[_0xa3df('0x5c')][_0xa3df('0x6b')][_0x1e2175]),'FaxAccountId':Number(_0x6f4e12[_0xa3df('0x64')]['id'])});}return _0x54a9d9;});}})[_0xa3df('0x3a')](respondWithResult(_0x410615,null))['catch'](handleError(_0x410615,null));};exports[_0xa3df('0xbc')]=function(_0x32d3c6,_0x2b5700,_0xb9ba84){return db[_0xa3df('0x3f')]['find']({'where':{'id':_0x32d3c6[_0xa3df('0x64')]['id']}})['then'](handleEntityNotFound(_0x2b5700,null))['then'](function(_0x13437d){if(_0x13437d){return _0x13437d['removeAgents'](_0x32d3c6[_0xa3df('0x42')]['ids'])['then'](function(){if(_[_0xa3df('0xbd')](_0x32d3c6[_0xa3df('0x42')][_0xa3df('0x6b')])){for(var _0x32d806=0x0;_0x32d806<_0x32d3c6['query']['ids'][_0xa3df('0x46')];_0x32d806+=0x1){socket[_0xa3df('0xba')](_0xa3df('0xbe'),{'UserId':Number(_0x32d3c6['query'][_0xa3df('0x6b')][_0x32d806]),'FaxAccountId':Number(_0x32d3c6[_0xa3df('0x64')]['id'])});}}else{socket[_0xa3df('0xba')](_0xa3df('0xbe'),{'UserId':Number(_0x32d3c6[_0xa3df('0x42')][_0xa3df('0x6b')]),'FaxAccountId':Number(_0x32d3c6[_0xa3df('0x64')]['id'])});}});}})[_0xa3df('0x3a')](respondWithStatusCode(_0x2b5700,null))['catch'](handleError(_0x2b5700,null));};exports[_0xa3df('0xbf')]=function(_0x17b2b5,_0x2eba74,_0x40c1a3){var _0x62b231={};var _0x29df30={};var _0x40a62f;var _0x2cb783;return db[_0xa3df('0x3f')]['findOne']({'where':{'id':_0x17b2b5[_0xa3df('0x64')]['id']}})[_0xa3df('0x3a')](handleEntityNotFound(_0x2eba74,null))[_0xa3df('0x3a')](function(_0x344521){if(_0x344521){_0x40a62f=_0x344521;_0x29df30[_0xa3df('0x47')]=_[_0xa3df('0x68')](db['User'][_0xa3df('0x57')]);_0x29df30[_0xa3df('0x42')]=_[_0xa3df('0x68')](_0x17b2b5['query']);_0x29df30[_0xa3df('0x58')]=_[_0xa3df('0x43')](_0x29df30[_0xa3df('0x47')],_0x29df30['query']);_0x62b231['attributes']=_['intersection'](_0x29df30[_0xa3df('0x47')],qs[_0xa3df('0x45')](_0x17b2b5[_0xa3df('0x42')][_0xa3df('0x45')]));_0x62b231[_0xa3df('0x44')]=_0x62b231[_0xa3df('0x44')]['length']?_0x62b231[_0xa3df('0x44')]:_0x29df30[_0xa3df('0x47')];_0x62b231[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x17b2b5['query'][_0xa3df('0x4b')]);_0x62b231[_0xa3df('0x4e')]=qs[_0xa3df('0x58')](_[_0xa3df('0x4c')](_0x17b2b5[_0xa3df('0x42')],_0x29df30['filters']));if(_0x17b2b5[_0xa3df('0x42')][_0xa3df('0x4d')]){_0x62b231['where']=_[_0xa3df('0x51')](_0x62b231[_0xa3df('0x4e')],{'$or':_[_0xa3df('0x3e')](_0x62b231[_0xa3df('0x44')],function(_0x318b0b){var _0x40be21={};_0x40be21[_0x318b0b]={'$like':'%'+_0x17b2b5[_0xa3df('0x42')][_0xa3df('0x4d')]+'%'};return _0x40be21;})});}_0x62b231=_[_0xa3df('0x51')]({},_0x62b231,_0x17b2b5[_0xa3df('0x52')]);return _0x40a62f['getAgents'](_0x62b231);}})[_0xa3df('0x3a')](function(_0x18d46b){if(_0x18d46b){_0x2cb783=_0x18d46b[_0xa3df('0x46')];if(!_0x17b2b5[_0xa3df('0x42')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x62b231[_0xa3df('0x32')]=qs[_0xa3df('0x32')](_0x17b2b5[_0xa3df('0x42')]['limit']);_0x62b231[_0xa3df('0x2f')]=qs[_0xa3df('0x2f')](_0x17b2b5[_0xa3df('0x42')][_0xa3df('0x2f')]);}return _0x40a62f[_0xa3df('0xbf')](_0x62b231);}})[_0xa3df('0x3a')](function(_0x5d42e1){if(_0x5d42e1){return _0x5d42e1?{'count':_0x2cb783,'rows':_0x5d42e1}:null;}})[_0xa3df('0x3a')](respondWithResult(_0x2eba74,null))[_0xa3df('0x2a')](handleError(_0x2eba74,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c8e9bc7..cfa41ef 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 _0x2e3c=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x9e1f23,_0x20f182){var _0x2cfbd6=function(_0x3b30f5){while(--_0x3b30f5){_0x9e1f23['push'](_0x9e1f23['shift']());}};_0x2cfbd6(++_0x20f182);}(_0x2e3c,0x1b1));var _0xc2e3=function(_0x80d8d1,_0x57b402){_0x80d8d1=_0x80d8d1-0x0;var _0x3614f6=_0x2e3c[_0x80d8d1];return _0x3614f6;};'use strict';var EventEmitter=require(_0xc2e3('0x0'));var FaxAccount=require(_0xc2e3('0x1'))['db'][_0xc2e3('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc2e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc2e3('0x4')};function emitEvent(_0xc8cb9){return function(_0x1a5840,_0x5bf0ea,_0x246a54){FaxAccountEvents['emit'](_0xc8cb9+':'+_0x1a5840['id'],_0x1a5840);FaxAccountEvents[_0xc2e3('0x5')](_0xc8cb9,_0x1a5840);_0x246a54(null);};}for(var e in events){if(events[_0xc2e3('0x6')](e)){var event=events[e];FaxAccount[_0xc2e3('0x7')](e,emitEvent(event));}}module[_0xc2e3('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x3c94=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x4d3b97,_0x14b900){var _0xb10143=function(_0x8a3f){while(--_0x8a3f){_0x4d3b97['push'](_0x4d3b97['shift']());}};_0xb10143(++_0x14b900);}(_0x3c94,0x111));var _0x43c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3c94[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x43c9('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x43c9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x43c9('0x2'),'afterDestroy':_0x43c9('0x3')};function emitEvent(_0x388344){return function(_0x37eb74,_0x1b8725,_0x5e6c3e){FaxAccountEvents[_0x43c9('0x4')](_0x388344+':'+_0x37eb74['id'],_0x37eb74);FaxAccountEvents[_0x43c9('0x4')](_0x388344,_0x37eb74);_0x5e6c3e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x43c9('0x5')](e,emitEvent(event));}}module[_0x43c9('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index e16c122..453a30d 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 _0x6230=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define'];(function(_0x3ca8cc,_0x224709){var _0x489cd6=function(_0x1bc33e){while(--_0x1bc33e){_0x3ca8cc['push'](_0x3ca8cc['shift']());}};_0x489cd6(++_0x224709);}(_0x6230,0xe7));var _0x0623=function(_0x8022cb,_0x442c38){_0x8022cb=_0x8022cb-0x0;var _0x3e7a46=_0x6230[_0x8022cb];return _0x3e7a46;};'use strict';var _=require(_0x0623('0x0'));var util=require('util');var logger=require(_0x0623('0x1'))(_0x0623('0x2'));var moment=require(_0x0623('0x3'));var BPromise=require(_0x0623('0x4'));var rp=require(_0x0623('0x5'));var fs=require('fs');var path=require(_0x0623('0x6'));var rimraf=require(_0x0623('0x7'));var config=require(_0x0623('0x8'));var attributes=require(_0x0623('0x9'));module['exports']=function(_0x4a665b,_0xd3ea73){return _0x4a665b[_0x0623('0xa')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbd6=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0xbbd6,0x125));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bbd('0x0'));var util=require(_0x6bbd('0x1'));var logger=require(_0x6bbd('0x2'))('api');var moment=require(_0x6bbd('0x3'));var BPromise=require(_0x6bbd('0x4'));var rp=require(_0x6bbd('0x5'));var fs=require('fs');var path=require(_0x6bbd('0x6'));var rimraf=require(_0x6bbd('0x7'));var config=require(_0x6bbd('0x8'));var attributes=require(_0x6bbd('0x9'));module[_0x6bbd('0xa')]=function(_0x4e9dec,_0x3ad6ce){return _0x4e9dec[_0x6bbd('0xb')](_0x6bbd('0xc'),attributes,{'tableName':_0x6bbd('0xd'),'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 470ea21..fcf69bf 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 _0xe721=['updatedAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','DESC','FaxApplication','Applications','get','applications','orderBy','Contacts','length','ListId','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','info','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','map','include','model','debug','catch','NotifyFaxAccount','body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe721,0xcb));var _0x1e72=function(_0x4f42a6,_0x5b4339){_0x4f42a6=_0x4f42a6-0x0;var _0x1258b1=_0xe721[_0x4f42a6];return _0x1258b1;};'use strict';var _=require(_0x1e72('0x0'));var util=require('util');var moment=require(_0x1e72('0x1'));var BPromise=require(_0x1e72('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e72('0x3'));var db=require(_0x1e72('0x4'))['db'];var utils=require(_0x1e72('0x5'));var logger=require('../../config/logger')(_0x1e72('0x6'));var config=require(_0x1e72('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e72('0x8')][_0x1e72('0x9')]({'port':0x232c});config[_0x1e72('0xa')]=_[_0x1e72('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1e72('0xa')]));require(_0x1e72('0xc'))[_0x1e72('0xd')](socket);function respondWithRpcPromise(_0x31a043,_0x51acb4,_0x418406){return new BPromise(function(_0x3bb44a,_0x318087){return client[_0x1e72('0xe')](_0x31a043,_0x418406)[_0x1e72('0xf')](function(_0x1db222){logger['info'](_0x1e72('0x10'),_0x51acb4,_0x1e72('0x11'));logger['debug'](_0x1e72('0x12'),_0x51acb4,_0x1e72('0x11'),JSON['stringify'](_0x1db222));if(_0x1db222[_0x1e72('0x13')]){if(_0x1db222[_0x1e72('0x13')]['code']===0x1f4){logger[_0x1e72('0x13')](_0x1e72('0x10'),_0x51acb4,_0x1db222[_0x1e72('0x13')]['message']);return _0x318087(_0x1db222['error']['message']);}logger[_0x1e72('0x13')](_0x1e72('0x10'),_0x51acb4,_0x1db222['error'][_0x1e72('0x14')]);return _0x3bb44a(_0x1db222[_0x1e72('0x13')][_0x1e72('0x14')]);}else{logger[_0x1e72('0x15')](_0x1e72('0x10'),_0x51acb4,_0x1e72('0x11'));_0x3bb44a(_0x1db222['result']['message']);}})['catch'](function(_0x50260f){logger[_0x1e72('0x13')]('FaxAccount,\x20%s,\x20%s',_0x51acb4,_0x50260f);_0x318087(_0x50260f);});});}exports[_0x1e72('0x16')]=function(_0x308b74){var _0xba9aa1=this;return new Promise(function(_0x50fb64,_0x28a116){return db[_0x1e72('0x17')][_0x1e72('0x18')]({'raw':_0x308b74[_0x1e72('0x19')]?_0x308b74[_0x1e72('0x19')][_0x1e72('0x1a')]===undefined?!![]:![]:!![],'where':_0x308b74[_0x1e72('0x19')]?_0x308b74[_0x1e72('0x19')][_0x1e72('0x1b')]||null:null,'attributes':_0x308b74[_0x1e72('0x19')]?_0x308b74[_0x1e72('0x19')][_0x1e72('0x1c')]||null:null,'limit':_0x308b74[_0x1e72('0x19')]?_0x308b74[_0x1e72('0x19')]['limit']||null:null,'include':_0x308b74[_0x1e72('0x19')]?_0x308b74[_0x1e72('0x19')]['include']?_[_0x1e72('0x1d')](_0x308b74[_0x1e72('0x19')][_0x1e72('0x1e')],function(_0x3c52f4){return{'model':db[_0x3c52f4['model']],'as':_0x3c52f4['as'],'attributes':_0x3c52f4[_0x1e72('0x1c')],'include':_0x3c52f4[_0x1e72('0x1e')]?_['map'](_0x3c52f4[_0x1e72('0x1e')],function(_0x2dc7ec){return{'model':db[_0x2dc7ec['model']],'as':_0x2dc7ec['as'],'attributes':_0x2dc7ec[_0x1e72('0x1c')],'include':_0x2dc7ec[_0x1e72('0x1e')]?_[_0x1e72('0x1d')](_0x2dc7ec[_0x1e72('0x1e')],function(_0x279b9c){return{'model':db[_0x279b9c[_0x1e72('0x1f')]],'as':_0x279b9c['as'],'attributes':_0x279b9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x222837){logger[_0x1e72('0x15')](_0x1e72('0x16'),_0x308b74);logger[_0x1e72('0x20')]('GetFaxAccount',_0x308b74,JSON['stringify'](_0x222837));_0x50fb64(_0x222837);})[_0x1e72('0x21')](function(_0x4781c6){logger[_0x1e72('0x13')](_0x1e72('0x16'),_0x4781c6[_0x1e72('0x14')],_0x308b74);_0x28a116(_0xba9aa1[_0x1e72('0x13')](0x1f4,_0x4781c6[_0x1e72('0x14')]));});});};exports[_0x1e72('0x22')]=function(_0xa516e7,_0x35d199,_0xab3e42){var _0x555508=this;return new Promise(function(_0x6e97a3,_0x5dcfbd){var _0x19b485={'body':_0xa516e7[_0x1e72('0x23')],'channel':_0x1e72('0x24')};var _0x2c2fdb=[];var _0x517a2e=[];var _0x3f220e={};return db[_0x1e72('0x25')]['describe']()[_0x1e72('0xf')](function(_0x4f5074){if(!_0x4f5074){throw new db[(_0x1e72('0x26'))]['ValidationError'](_0x1e72('0x27'));}_0x2c2fdb=_[_0x1e72('0x28')](_['keys'](_0x4f5074),['createdAt','updatedAt']);_0x517a2e=_[_0x1e72('0x28')](_[_0x1e72('0x29')](_0x4f5074),[_0x1e72('0x2a'),_0x1e72('0x2b'),_0x1e72('0x2c'),'ListId']);if(_0xa516e7[_0x1e72('0x23')]['id']){delete _0xa516e7[_0x1e72('0x23')]['id'];}if(_[_0x1e72('0x2d')](_0xa516e7[_0x1e72('0x23')][_0x1e72('0x2e')])){throw new db[(_0x1e72('0x26'))][(_0x1e72('0x2f'))](_0x1e72('0x30'));}if(_['isNil'](_0xa516e7[_0x1e72('0x23')][_0x1e72('0x23')])||_0xa516e7[_0x1e72('0x23')][_0x1e72('0x23')]===''){throw new db[(_0x1e72('0x26'))][(_0x1e72('0x2f'))](_0x1e72('0x31'));}if(_[_0x1e72('0x2d')](_0xa516e7[_0x1e72('0x23')][_0x1e72('0x32')])){throw new db[(_0x1e72('0x26'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x517a2e);}if(!_[_0x1e72('0x33')](_0x517a2e,_0xa516e7[_0x1e72('0x23')][_0x1e72('0x32')])){throw new db['Sequelize'][(_0x1e72('0x2f'))](_0x1e72('0x34')+_0x517a2e);}_0x3f220e[_0xa516e7[_0x1e72('0x23')][_0x1e72('0x32')]]=_0xa516e7[_0x1e72('0x23')][_0x1e72('0x2e')];})[_0x1e72('0xf')](function(){return db['FaxAccount'][_0x1e72('0x35')]({'where':{'id':_0xa516e7[_0x1e72('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x1e72('0x37'),'include':[{'model':db[_0x1e72('0x25')],'as':'Contacts','where':_0x3f220e,'limit':0x1,'order':[[_0x1e72('0x2b'),_0x1e72('0x38')]]}]},{'model':db[_0x1e72('0x39')],'as':_0x1e72('0x3a')}]});})['then'](function(_0x2de589){if(_0x2de589&&_0x2de589[_0x1e72('0x37')]){var _0x541fdf=_0x2de589[_0x1e72('0x3b')]({'plain':!![]});_0x19b485['account']=_0x541fdf;_0x19b485[_0x1e72('0x3c')]=_0x541fdf[_0x1e72('0x3a')];_0x19b485['list']=_0x541fdf[_0x1e72('0x37')];_0x19b485['applications']=_[_0x1e72('0x3d')](_0x19b485['applications'],['priority'],['asc']);if(_0x19b485['account']['Applications']){delete _0x19b485[_0x1e72('0x36')][_0x1e72('0x3a')];}if(_0x19b485[_0x1e72('0x36')][_0x1e72('0x37')]&&_0x19b485[_0x1e72('0x36')][_0x1e72('0x37')][_0x1e72('0x3e')][_0x1e72('0x3f')]){return _0x19b485['account'][_0x1e72('0x37')][_0x1e72('0x3e')][0x0];}var _0x1bf801=_[_0x1e72('0xb')](_0xa516e7[_0x1e72('0x23')],{'firstName':_0xa516e7[_0x1e72('0x23')][_0x1e72('0x2e')],'ListId':_0x541fdf[_0x1e72('0x40')]});_0x1bf801[_0xa516e7[_0x1e72('0x23')][_0x1e72('0x32')]]=_0xa516e7[_0x1e72('0x23')][_0x1e72('0x2e')];return db['CmContact']['create'](_0x1bf801,{'fields':_0x2c2fdb,'raw':!![]});}})[_0x1e72('0xf')](function(_0x58ae32){_0x19b485[_0x1e72('0x41')]=_0x58ae32;if(_0x58ae32){var _0xb92312={'ContactId':_0x58ae32['id'],'FaxAccountId':_0xa516e7[_0x1e72('0x36')]['id'],'fax':_0x58ae32[_0x1e72('0x24')]};return db[_0x1e72('0x42')]['find']({'where':{'ContactId':_0x58ae32['id'],'closed':![],'FaxAccountId':_0xa516e7[_0x1e72('0x36')]['id']}})[_0x1e72('0xf')](function(_0x58a59f){if(_0x58a59f){return[_0x58a59f,![]];}return db[_0x1e72('0x42')]['create'](_0xb92312)[_0x1e72('0xf')](function(_0x3e361a){return[_0x3e361a,!![]];});});}else{throw new Error(_0x1e72('0x43'));}})['spread'](function(_0x1df6ad,_0x18efcf){var _0x2335d1=_0x1df6ad['get']({'plain':!![]});if(_0x18efcf){if(_0x19b485[_0x1e72('0x36')][_0x1e72('0x44')]){_0x19b485[_0x1e72('0x3c')][_0x1e72('0x45')]({'id':0x0,'priority':_0x19b485['applications'][_0x1e72('0x3f')]+0x1,'app':_0x1e72('0x46'),'appdata':'unmanaged','interval':_0x1e72('0x47')});}_0x2335d1[_0x1e72('0x48')]=!![];}else{_0x2335d1[_0x1e72('0x48')]=![];}_0x19b485[_0x1e72('0x49')]=_0x2335d1;return db[_0x1e72('0x4a')]['create']({'body':_0xa516e7[_0x1e72('0x23')][_0x1e72('0x23')],'FaxAccountId':_0xa516e7[_0x1e72('0x36')]['id'],'FaxInteractionId':_0x1df6ad['id'],'direction':'in','ContactId':_0x1df6ad['ContactId'],'AttachmentId':_0xa516e7[_0x1e72('0x23')]['AttachmentId']});})['then'](function(_0x481d96){_0x19b485[_0x1e72('0x14')]=_0x481d96;if(_0x19b485[_0x1e72('0x49')]['UserId']){return db[_0x1e72('0x4b')][_0x1e72('0x35')]({'attributes':['id',_0x1e72('0x4c')],'where':{'id':_0x19b485[_0x1e72('0x49')]['UserId']}})[_0x1e72('0xf')](function(_0x53a8be){if(_0x53a8be){_0x19b485[_0x1e72('0x3c')][_0x1e72('0x4d')]({'id':0x0,'priority':0x0,'app':_0x1e72('0x4e'),'appdata':_0x53a8be[_0x1e72('0x4c')]+','+(_0x19b485[_0x1e72('0x36')][_0x1e72('0x4f')]||0xa),'interval':_0x1e72('0x47')});}return respondWithRpcPromise('Start','startRouting',_0x19b485);});}return respondWithRpcPromise(_0x1e72('0x50'),_0x1e72('0x51'),_0x19b485);})['then'](function(_0x5b7e41){_0x6e97a3(_0x5b7e41);})[_0x1e72('0x21')](function(_0x1d8a76){_0x5dcfbd(_0x555508[_0x1e72('0x13')](0x1f4,_0x1d8a76['message']));});});}; \ No newline at end of file +var _0xc466=['Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','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','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','map','model','include','NotifyFaxAccount','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','body','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmList','List'];(function(_0x3b0470,_0x1f4e53){var _0x36022e=function(_0x23c540){while(--_0x23c540){_0x3b0470['push'](_0x3b0470['shift']());}};_0x36022e(++_0x1f4e53);}(_0xc466,0x12a));var _0x6c46=function(_0x4c15fc,_0x56cd38){_0x4c15fc=_0x4c15fc-0x0;var _0x24ba1f=_0xc466[_0x4c15fc];return _0x24ba1f;};'use strict';var _=require(_0x6c46('0x0'));var util=require(_0x6c46('0x1'));var moment=require(_0x6c46('0x2'));var BPromise=require(_0x6c46('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c46('0x4'));var db=require(_0x6c46('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c46('0x6'))(_0x6c46('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6c46('0x8')]({'port':0x232c});config[_0x6c46('0x9')]=_[_0x6c46('0xa')](config['redis'],{'host':_0x6c46('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6c46('0xc'))[_0x6c46('0xd')](socket);function respondWithRpcPromise(_0x4146b5,_0xce23eb,_0x190e12){return new BPromise(function(_0x387016,_0x4a547f){return client[_0x6c46('0xe')](_0x4146b5,_0x190e12)[_0x6c46('0xf')](function(_0x5e56fe){logger[_0x6c46('0x10')](_0x6c46('0x11'),_0xce23eb,_0x6c46('0x12'));logger[_0x6c46('0x13')](_0x6c46('0x14'),_0xce23eb,_0x6c46('0x12'),JSON[_0x6c46('0x15')](_0x5e56fe));if(_0x5e56fe[_0x6c46('0x16')]){if(_0x5e56fe['error'][_0x6c46('0x17')]===0x1f4){logger[_0x6c46('0x16')](_0x6c46('0x11'),_0xce23eb,_0x5e56fe['error'][_0x6c46('0x18')]);return _0x4a547f(_0x5e56fe[_0x6c46('0x16')]['message']);}logger[_0x6c46('0x16')]('FaxAccount,\x20%s,\x20%s',_0xce23eb,_0x5e56fe['error'][_0x6c46('0x18')]);return _0x387016(_0x5e56fe[_0x6c46('0x16')][_0x6c46('0x18')]);}else{logger['info'](_0x6c46('0x11'),_0xce23eb,'request\x20sent');_0x387016(_0x5e56fe[_0x6c46('0x19')][_0x6c46('0x18')]);}})[_0x6c46('0x1a')](function(_0x3ff0ed){logger[_0x6c46('0x16')]('FaxAccount,\x20%s,\x20%s',_0xce23eb,_0x3ff0ed);_0x4a547f(_0x3ff0ed);});});}exports[_0x6c46('0x1b')]=function(_0x37b6e7){var _0x5ba534=this;return new Promise(function(_0x598740,_0x5e2adc){return db[_0x6c46('0x1c')][_0x6c46('0x1d')]({'raw':_0x37b6e7[_0x6c46('0x1e')]?_0x37b6e7[_0x6c46('0x1e')][_0x6c46('0x1f')]===undefined?!![]:![]:!![],'where':_0x37b6e7[_0x6c46('0x1e')]?_0x37b6e7['options']['where']||null:null,'attributes':_0x37b6e7['options']?_0x37b6e7[_0x6c46('0x1e')]['attributes']||null:null,'limit':_0x37b6e7[_0x6c46('0x1e')]?_0x37b6e7['options']['limit']||null:null,'include':_0x37b6e7[_0x6c46('0x1e')]?_0x37b6e7[_0x6c46('0x1e')]['include']?_[_0x6c46('0x20')](_0x37b6e7[_0x6c46('0x1e')]['include'],function(_0x3b5645){return{'model':db[_0x3b5645[_0x6c46('0x21')]],'as':_0x3b5645['as'],'attributes':_0x3b5645['attributes'],'include':_0x3b5645[_0x6c46('0x22')]?_[_0x6c46('0x20')](_0x3b5645[_0x6c46('0x22')],function(_0x245746){return{'model':db[_0x245746['model']],'as':_0x245746['as'],'attributes':_0x245746['attributes'],'include':_0x245746[_0x6c46('0x22')]?_[_0x6c46('0x20')](_0x245746[_0x6c46('0x22')],function(_0x5c610a){return{'model':db[_0x5c610a[_0x6c46('0x21')]],'as':_0x5c610a['as'],'attributes':_0x5c610a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c46('0xf')](function(_0x28d1cd){logger[_0x6c46('0x10')](_0x6c46('0x1b'),_0x37b6e7);logger[_0x6c46('0x13')](_0x6c46('0x1b'),_0x37b6e7,JSON[_0x6c46('0x15')](_0x28d1cd));_0x598740(_0x28d1cd);})[_0x6c46('0x1a')](function(_0x26eb19){logger[_0x6c46('0x16')](_0x6c46('0x1b'),_0x26eb19[_0x6c46('0x18')],_0x37b6e7);_0x5e2adc(_0x5ba534[_0x6c46('0x16')](0x1f4,_0x26eb19[_0x6c46('0x18')]));});});};exports[_0x6c46('0x23')]=function(_0x2db5ca,_0x86ff0c,_0x55dad9){var _0xc493d0=this;return new Promise(function(_0x2534df,_0x44c0af){var _0xd216f4={'body':_0x2db5ca['body'],'channel':_0x6c46('0x24')};var _0x5c9146=[];var _0x2f3ddd=[];var _0x1e62cd={};return db[_0x6c46('0x25')][_0x6c46('0x26')]()[_0x6c46('0xf')](function(_0x3232a0){if(!_0x3232a0){throw new db['Sequelize'][(_0x6c46('0x27'))](_0x6c46('0x28'));}_0x5c9146=_[_0x6c46('0x29')](_[_0x6c46('0x2a')](_0x3232a0),[_0x6c46('0x2b'),_0x6c46('0x2c')]);_0x2f3ddd=_[_0x6c46('0x29')](_['keys'](_0x3232a0),[_0x6c46('0x2b'),'updatedAt','CompanyId','ListId']);if(_0x2db5ca[_0x6c46('0x2d')]['id']){delete _0x2db5ca[_0x6c46('0x2d')]['id'];}if(_[_0x6c46('0x2e')](_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2f')])){throw new db[(_0x6c46('0x30'))][(_0x6c46('0x27'))](_0x6c46('0x31'));}if(_[_0x6c46('0x2e')](_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2d')])||_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2d')]===''){throw new db[(_0x6c46('0x30'))]['ValidationError'](_0x6c46('0x32'));}if(_['isNil'](_0x2db5ca[_0x6c46('0x2d')]['mapKey'])){throw new db[(_0x6c46('0x30'))][(_0x6c46('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2f3ddd);}if(!_[_0x6c46('0x33')](_0x2f3ddd,_0x2db5ca[_0x6c46('0x2d')]['mapKey'])){throw new db[(_0x6c46('0x30'))][(_0x6c46('0x27'))](_0x6c46('0x34')+_0x2f3ddd);}_0x1e62cd[_0x2db5ca['body'][_0x6c46('0x35')]]=_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2f')];})[_0x6c46('0xf')](function(){return db[_0x6c46('0x1c')][_0x6c46('0x36')]({'where':{'id':_0x2db5ca[_0x6c46('0x37')]['id']},'include':[{'model':db[_0x6c46('0x38')],'as':_0x6c46('0x39'),'include':[{'model':db[_0x6c46('0x25')],'as':_0x6c46('0x3a'),'where':_0x1e62cd,'limit':0x1,'order':[['updatedAt',_0x6c46('0x3b')]]}]},{'model':db[_0x6c46('0x3c')],'as':_0x6c46('0x3d')}]});})['then'](function(_0x31b425){if(_0x31b425&&_0x31b425['List']){var _0x5999f5=_0x31b425[_0x6c46('0x3e')]({'plain':!![]});_0xd216f4[_0x6c46('0x37')]=_0x5999f5;_0xd216f4[_0x6c46('0x3f')]=_0x5999f5[_0x6c46('0x3d')];_0xd216f4[_0x6c46('0x40')]=_0x5999f5['List'];_0xd216f4[_0x6c46('0x3f')]=_[_0x6c46('0x41')](_0xd216f4[_0x6c46('0x3f')],[_0x6c46('0x42')],[_0x6c46('0x43')]);if(_0xd216f4['account'][_0x6c46('0x3d')]){delete _0xd216f4[_0x6c46('0x37')][_0x6c46('0x3d')];}if(_0xd216f4['account']['List']&&_0xd216f4['account'][_0x6c46('0x39')][_0x6c46('0x3a')][_0x6c46('0x44')]){return _0xd216f4[_0x6c46('0x37')][_0x6c46('0x39')][_0x6c46('0x3a')][0x0];}var _0x2fd5de=_[_0x6c46('0xa')](_0x2db5ca[_0x6c46('0x2d')],{'firstName':_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2f')],'ListId':_0x5999f5[_0x6c46('0x45')]});_0x2fd5de[_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x35')]]=_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2f')];return db['CmContact'][_0x6c46('0x46')](_0x2fd5de,{'fields':_0x5c9146,'raw':!![]});}})[_0x6c46('0xf')](function(_0x52960c){_0xd216f4[_0x6c46('0x47')]=_0x52960c;if(_0x52960c){var _0x34f6fb={'ContactId':_0x52960c['id'],'FaxAccountId':_0x2db5ca[_0x6c46('0x37')]['id'],'fax':_0x52960c['fax']};return db[_0x6c46('0x48')][_0x6c46('0x36')]({'where':{'ContactId':_0x52960c['id'],'closed':![],'FaxAccountId':_0x2db5ca['account']['id']}})[_0x6c46('0xf')](function(_0x18e881){if(_0x18e881){return[_0x18e881,![]];}return db[_0x6c46('0x48')][_0x6c46('0x46')](_0x34f6fb)[_0x6c46('0xf')](function(_0x1ce813){return[_0x1ce813,!![]];});});}else{throw new Error(_0x6c46('0x49'));}})[_0x6c46('0x4a')](function(_0x55576f,_0x1755b5){var _0x596cd7=_0x55576f[_0x6c46('0x3e')]({'plain':!![]});if(_0x1755b5){if(_0xd216f4[_0x6c46('0x37')][_0x6c46('0x4b')]){_0xd216f4[_0x6c46('0x3f')][_0x6c46('0x4c')]({'id':0x0,'priority':_0xd216f4[_0x6c46('0x3f')][_0x6c46('0x44')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x6c46('0x4d')});}_0x596cd7[_0x6c46('0x4e')]=!![];}else{_0x596cd7[_0x6c46('0x4e')]=![];}_0xd216f4['interaction']=_0x596cd7;return db[_0x6c46('0x4f')]['create']({'body':_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x2d')],'FaxAccountId':_0x2db5ca[_0x6c46('0x37')]['id'],'FaxInteractionId':_0x55576f['id'],'direction':'in','ContactId':_0x55576f[_0x6c46('0x50')],'AttachmentId':_0x2db5ca[_0x6c46('0x2d')][_0x6c46('0x51')]});})['then'](function(_0x5430cb){_0xd216f4[_0x6c46('0x18')]=_0x5430cb;if(_0xd216f4[_0x6c46('0x52')][_0x6c46('0x53')]){return db['User'][_0x6c46('0x36')]({'attributes':['id','name'],'where':{'id':_0xd216f4[_0x6c46('0x52')]['UserId']}})[_0x6c46('0xf')](function(_0x32ea84){if(_0x32ea84){_0xd216f4[_0x6c46('0x3f')][_0x6c46('0x54')]({'id':0x0,'priority':0x0,'app':_0x6c46('0x55'),'appdata':_0x32ea84['name']+','+(_0xd216f4[_0x6c46('0x37')][_0x6c46('0x56')]||0xa),'interval':_0x6c46('0x4d')});}return respondWithRpcPromise(_0x6c46('0x57'),'startRouting',_0xd216f4);});}return respondWithRpcPromise(_0x6c46('0x57'),_0x6c46('0x58'),_0xd216f4);})[_0x6c46('0xf')](function(_0x56e644){_0x2534df(_0x56e644);})[_0x6c46('0x1a')](function(_0x2fba40){_0x44c0af(_0xc493d0[_0x6c46('0x16')](0x1f4,_0x2fba40[_0x6c46('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 457603a..ee5b47f 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 _0xccaf=['removeListener','length','faxAccount:','./faxAccount.events','save','emit'];(function(_0x3a806f,_0x5ebb09){var _0x7cf712=function(_0x1f2c53){while(--_0x1f2c53){_0x3a806f['push'](_0x3a806f['shift']());}};_0x7cf712(++_0x5ebb09);}(_0xccaf,0x135));var _0xfcca=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0xccaf[_0xca1091];return _0xd3019c;};'use strict';var FaxAccountEvents=require(_0xfcca('0x0'));var events=[_0xfcca('0x1'),'remove','update'];function createListener(_0x3c58ea,_0x26b3d0){return function(_0xdc67f4){_0x26b3d0[_0xfcca('0x2')](_0x3c58ea,_0xdc67f4);};}function removeListener(_0x40b73d,_0x548310){return function(){FaxAccountEvents[_0xfcca('0x3')](_0x40b73d,_0x548310);};}exports['register']=function(_0x1620f9){for(var _0x418388=0x0,_0x59b43f=events[_0xfcca('0x4')];_0x418388<_0x59b43f;_0x418388++){var _0xf1d2ef=events[_0x418388];var _0x1b57cf=createListener(_0xfcca('0x5')+_0xf1d2ef,_0x1620f9);FaxAccountEvents['on'](_0xf1d2ef,_0x1b57cf);}}; \ No newline at end of file +var _0x31a5=['./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x31a5,0x150));var _0x531a=function(_0x3e90d1,_0x3572fd){_0x3e90d1=_0x3e90d1-0x0;var _0x173162=_0x31a5[_0x3e90d1];return _0x173162;};'use strict';var FaxAccountEvents=require(_0x531a('0x0'));var events=[_0x531a('0x1'),_0x531a('0x2'),_0x531a('0x3')];function createListener(_0xd53ee2,_0xd5e0ff){return function(_0x545446){_0xd5e0ff[_0x531a('0x4')](_0xd53ee2,_0x545446);};}function removeListener(_0x572d08,_0x2765b3){return function(){FaxAccountEvents[_0x531a('0x5')](_0x572d08,_0x2765b3);};}exports[_0x531a('0x6')]=function(_0x38723d){for(var _0x30a4f5=0x0,_0x23df21=events[_0x531a('0x7')];_0x30a4f5<_0x23df21;_0x30a4f5++){var _0xc62c6f=events[_0x30a4f5];var _0x139986=createListener('faxAccount:'+_0xc62c6f,_0x38723d);FaxAccountEvents['on'](_0xc62c6f,_0x139986);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 827a5da..8b83404 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x36b51b,_0x220bd1){var _0x1d87d4=function(_0x5d36f5){while(--_0x5d36f5){_0x36b51b['push'](_0x36b51b['shift']());}};_0x1d87d4(++_0x220bd1);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x296bcd,_0x115fbd){var _0x13523e=function(_0x30ffff){while(--_0x30ffff){_0x296bcd['push'](_0x296bcd['shift']());}};_0x13523e(++_0x115fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index bd38b2c..43c9c61 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 _0xb25b=['exports','INTEGER','STRING','noop'];(function(_0x81f78f,_0x293ac3){var _0x284325=function(_0x2578aa){while(--_0x2578aa){_0x81f78f['push'](_0x81f78f['shift']());}};_0x284325(++_0x293ac3);}(_0xb25b,0x80));var _0xbb25=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb25b[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0xbb25('0x0')]={'priority':{'type':Sequelize[_0xbb25('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbb25('0x2')],'allowNull':![],'defaultValue':_0xbb25('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbb25('0x2')]},'interval':{'type':Sequelize[_0xbb25('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3c00=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x209efa,_0x2d846a){var _0x4b270a=function(_0x224ca9){while(--_0x224ca9){_0x209efa['push'](_0x209efa['shift']());}};_0x4b270a(++_0x2d846a);}(_0x3c00,0x186));var _0x03c0=function(_0x2327f4,_0x3579f2){_0x2327f4=_0x2327f4-0x0;var _0x16fb81=_0x3c00[_0x2327f4];return _0x16fb81;};'use strict';var Sequelize=require(_0x03c0('0x0'));module[_0x03c0('0x1')]={'priority':{'type':Sequelize[_0x03c0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x03c0('0x3')],'allowNull':![],'defaultValue':_0x03c0('0x4')},'appdata':{'type':Sequelize[_0x03c0('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x03c0('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8e38023..7791075 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 _0x752d=['include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','save','update','then','error','stack','name','send','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','options','where','findAll','show','params','rawAttributes','includeAll'];(function(_0x3a8ec5,_0x378f44){var _0x483caf=function(_0x559670){while(--_0x559670){_0x3a8ec5['push'](_0x3a8ec5['shift']());}};_0x483caf(++_0x378f44);}(_0x752d,0x9e));var _0xd752=function(_0x4e8dc7,_0x3263a9){_0x4e8dc7=_0x4e8dc7-0x0;var _0x549820=_0x752d[_0x4e8dc7];return _0x549820;};'use strict';var emlformat=require(_0xd752('0x0'));var rimraf=require(_0xd752('0x1'));var zipdir=require(_0xd752('0x2'));var jsonpatch=require(_0xd752('0x3'));var rp=require(_0xd752('0x4'));var moment=require(_0xd752('0x5'));var BPromise=require(_0xd752('0x6'));var Mustache=require('mustache');var util=require(_0xd752('0x7'));var path=require(_0xd752('0x8'));var sox=require(_0xd752('0x9'));var csv=require(_0xd752('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd752('0xb'));var _=require(_0xd752('0xc'));var squel=require(_0xd752('0xd'));var crypto=require('crypto');var jsforce=require(_0xd752('0xe'));var deskjs=require(_0xd752('0xf'));var toCsv=require(_0xd752('0xa'));var querystring=require(_0xd752('0x10'));var Papa=require(_0xd752('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd752('0x12'));var as=require(_0xd752('0x13'));var hardwareService=require(_0xd752('0x14'));var logger=require(_0xd752('0x15'))('api');var utils=require(_0xd752('0x16'));var config=require(_0xd752('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd752('0x18'))['db'];function respondWithStatusCode(_0x1fa198,_0x11df16){_0x11df16=_0x11df16||0xcc;return function(_0x230064){if(_0x230064){return _0x1fa198[_0xd752('0x19')](_0x11df16);}return _0x1fa198[_0xd752('0x1a')](_0x11df16)[_0xd752('0x1b')]();};}function respondWithResult(_0x36f912,_0xe5cd9a){_0xe5cd9a=_0xe5cd9a||0xc8;return function(_0x5bef15){if(_0x5bef15){return _0x36f912['status'](_0xe5cd9a)[_0xd752('0x1c')](_0x5bef15);}};}function respondWithFilteredResult(_0xa3b9d7,_0x170b49){return function(_0x3de117){if(_0x3de117){var _0x23b773=typeof _0x170b49['offset']==='undefined'&&typeof _0x170b49['limit']===_0xd752('0x1d');var _0x2da634=_0x3de117[_0xd752('0x1e')];var _0x5368ed=_0x23b773?0x0:_0x170b49[_0xd752('0x1f')];var _0x2f5483=_0x23b773?_0x3de117[_0xd752('0x1e')]:_0x170b49['offset']+_0x170b49['limit'];var _0x37214c;if(_0x2f5483>=_0x2da634){_0x2f5483=_0x2da634;_0x37214c=0xc8;}else{_0x37214c=0xce;}_0xa3b9d7[_0xd752('0x1a')](_0x37214c);return _0xa3b9d7[_0xd752('0x20')]('Content-Range',_0x5368ed+'-'+_0x2f5483+'/'+_0x2da634)[_0xd752('0x1c')](_0x3de117);}return null;};}function patchUpdates(_0x4131f1){return function(_0x439035){try{jsonpatch[_0xd752('0x21')](_0x439035,_0x4131f1,!![]);}catch(_0x3a9c92){return BPromise['reject'](_0x3a9c92);}return _0x439035[_0xd752('0x22')]();};}function saveUpdates(_0xc6268b,_0x5a9ac5){return function(_0x33a169){if(_0x33a169){return _0x33a169[_0xd752('0x23')](_0xc6268b)['then'](function(_0x10a7ed){return _0x10a7ed;});}return null;};}function removeEntity(_0xb7a697,_0x5071ba){return function(_0xbc6a70){if(_0xbc6a70){return _0xbc6a70['destroy']()[_0xd752('0x24')](function(){_0xb7a697[_0xd752('0x1a')](0xcc)[_0xd752('0x1b')]();});}};}function handleEntityNotFound(_0x4f0c08,_0x29f2c1){return function(_0x45f430){if(!_0x45f430){_0x4f0c08[_0xd752('0x19')](0x194);}return _0x45f430;};}function handleError(_0x2a554e,_0x42df7a){_0x42df7a=_0x42df7a||0x1f4;return function(_0xd036a4){logger[_0xd752('0x25')](_0xd036a4[_0xd752('0x26')]);if(_0xd036a4[_0xd752('0x27')]){delete _0xd036a4[_0xd752('0x27')];}_0x2a554e[_0xd752('0x1a')](_0x42df7a)[_0xd752('0x28')](_0xd036a4);};}exports['index']=function(_0x1d0351,_0x1d6a91){var _0x4cd546={},_0x56abf3={},_0x47951b={'count':0x0,'rows':[]};var _0x4c2a10=_[_0xd752('0x29')](db[_0xd752('0x2a')]['rawAttributes'],function(_0x176235){return{'name':_0x176235[_0xd752('0x2b')],'type':_0x176235[_0xd752('0x2c')][_0xd752('0x2d')]};});_0x56abf3[_0xd752('0x2e')]=_[_0xd752('0x29')](_0x4c2a10,_0xd752('0x27'));_0x56abf3[_0xd752('0x2f')]=_[_0xd752('0x30')](_0x1d0351[_0xd752('0x2f')]);_0x56abf3[_0xd752('0x31')]=_[_0xd752('0x32')](_0x56abf3[_0xd752('0x2e')],_0x56abf3['query']);_0x4cd546[_0xd752('0x33')]=_[_0xd752('0x32')](_0x56abf3[_0xd752('0x2e')],qs[_0xd752('0x34')](_0x1d0351['query'][_0xd752('0x34')]));_0x4cd546['attributes']=_0x4cd546['attributes'][_0xd752('0x35')]?_0x4cd546[_0xd752('0x33')]:_0x56abf3[_0xd752('0x2e')];if(!_0x1d0351[_0xd752('0x2f')][_0xd752('0x36')](_0xd752('0x37'))){_0x4cd546[_0xd752('0x38')]=qs[_0xd752('0x38')](_0x1d0351['query'][_0xd752('0x38')]);_0x4cd546[_0xd752('0x1f')]=qs[_0xd752('0x1f')](_0x1d0351[_0xd752('0x2f')]['offset']);}_0x4cd546[_0xd752('0x39')]=qs[_0xd752('0x3a')](_0x1d0351['query'][_0xd752('0x3a')]);_0x4cd546['where']=qs['filters'](_[_0xd752('0x3b')](_0x1d0351['query'],_0x56abf3[_0xd752('0x31')]),_0x4c2a10);if(_0x1d0351[_0xd752('0x2f')]['filter']){_0x4cd546['where']=_[_0xd752('0x3c')](_0x4cd546['where'],{'$or':_[_0xd752('0x29')](_0x4c2a10,function(_0x1cde6a){if(_0x1cde6a[_0xd752('0x2c')]!==_0xd752('0x3d')){var _0x3b8ae0={};_0x3b8ae0[_0x1cde6a['name']]={'$like':'%'+_0x1d0351[_0xd752('0x2f')][_0xd752('0x3e')]+'%'};return _0x3b8ae0;}})});}_0x4cd546=_[_0xd752('0x3c')]({},_0x4cd546,_0x1d0351[_0xd752('0x3f')]);var _0x46fde1={'where':_0x4cd546[_0xd752('0x40')]};return db[_0xd752('0x2a')][_0xd752('0x1e')](_0x46fde1)[_0xd752('0x24')](function(_0x49262a){_0x47951b[_0xd752('0x1e')]=_0x49262a;if(_0x1d0351[_0xd752('0x2f')]['includeAll']){_0x4cd546['include']=[{'all':!![]}];}return db[_0xd752('0x2a')][_0xd752('0x41')](_0x4cd546);})['then'](function(_0x3a087f){_0x47951b['rows']=_0x3a087f;return _0x47951b;})[_0xd752('0x24')](respondWithFilteredResult(_0x1d6a91,_0x4cd546))['catch'](handleError(_0x1d6a91,null));};exports[_0xd752('0x42')]=function(_0x1e9c47,_0x414114){var _0x449ba9={'raw':!![],'where':{'id':_0x1e9c47[_0xd752('0x43')]['id']}},_0x2c9a8b={};_0x2c9a8b['model']=_[_0xd752('0x30')](db[_0xd752('0x2a')][_0xd752('0x44')]);_0x2c9a8b[_0xd752('0x2f')]=_[_0xd752('0x30')](_0x1e9c47[_0xd752('0x2f')]);_0x2c9a8b[_0xd752('0x31')]=_[_0xd752('0x32')](_0x2c9a8b[_0xd752('0x2e')],_0x2c9a8b['query']);_0x449ba9[_0xd752('0x33')]=_[_0xd752('0x32')](_0x2c9a8b[_0xd752('0x2e')],qs[_0xd752('0x34')](_0x1e9c47[_0xd752('0x2f')]['fields']));_0x449ba9[_0xd752('0x33')]=_0x449ba9[_0xd752('0x33')][_0xd752('0x35')]?_0x449ba9['attributes']:_0x2c9a8b['model'];if(_0x1e9c47[_0xd752('0x2f')][_0xd752('0x45')]){_0x449ba9[_0xd752('0x46')]=[{'all':!![]}];}_0x449ba9=_[_0xd752('0x3c')]({},_0x449ba9,_0x1e9c47[_0xd752('0x3f')]);return db[_0xd752('0x2a')][_0xd752('0x47')](_0x449ba9)['then'](handleEntityNotFound(_0x414114,null))['then'](respondWithResult(_0x414114,null))[_0xd752('0x48')](handleError(_0x414114,null));};exports[_0xd752('0x49')]=function(_0x29d45e,_0x2cd798){return db[_0xd752('0x2a')][_0xd752('0x49')](_0x29d45e[_0xd752('0x4a')],{})['then'](respondWithResult(_0x2cd798,0xc9))['catch'](handleError(_0x2cd798,null));};exports[_0xd752('0x23')]=function(_0x4e5009,_0x3a5e07){if(_0x4e5009['body']['id']){delete _0x4e5009[_0xd752('0x4a')]['id'];}return db[_0xd752('0x2a')][_0xd752('0x47')]({'where':{'id':_0x4e5009[_0xd752('0x43')]['id']}})[_0xd752('0x24')](handleEntityNotFound(_0x3a5e07,null))[_0xd752('0x24')](saveUpdates(_0x4e5009[_0xd752('0x4a')],null))[_0xd752('0x24')](respondWithResult(_0x3a5e07,null))[_0xd752('0x48')](handleError(_0x3a5e07,null));};exports[_0xd752('0x4b')]=function(_0x3177c3,_0x3c825b){return db[_0xd752('0x2a')]['find']({'where':{'id':_0x3177c3[_0xd752('0x43')]['id']}})[_0xd752('0x24')](handleEntityNotFound(_0x3c825b,null))[_0xd752('0x24')](removeEntity(_0x3c825b,null))[_0xd752('0x48')](handleError(_0x3c825b,null));}; \ No newline at end of file +var _0x7371=['fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','FaxApplication','includeAll','include','findAll','show','params','keys','length','merge','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','stack','name','send','map','rawAttributes'];(function(_0x34f018,_0xff510f){var _0x36546d=function(_0x196bb7){while(--_0x196bb7){_0x34f018['push'](_0x34f018['shift']());}};_0x36546d(++_0xff510f);}(_0x7371,0xad));var _0x1737=function(_0xa00460,_0x304e43){_0xa00460=_0xa00460-0x0;var _0x1eff05=_0x7371[_0xa00460];return _0x1eff05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1737('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1737('0x1'));var rp=require(_0x1737('0x2'));var moment=require(_0x1737('0x3'));var BPromise=require(_0x1737('0x4'));var Mustache=require(_0x1737('0x5'));var util=require(_0x1737('0x6'));var path=require('path');var sox=require(_0x1737('0x7'));var csv=require(_0x1737('0x8'));var ejs=require(_0x1737('0x9'));var fs=require('fs');var fs_extra=require(_0x1737('0xa'));var _=require(_0x1737('0xb'));var squel=require(_0x1737('0xc'));var crypto=require(_0x1737('0xd'));var jsforce=require(_0x1737('0xe'));var deskjs=require(_0x1737('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1737('0x10'));var Papa=require(_0x1737('0x11'));var Redis=require(_0x1737('0x12'));var authService=require(_0x1737('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1737('0x14'));var logger=require(_0x1737('0x15'))(_0x1737('0x16'));var utils=require(_0x1737('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1737('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbbc64,_0x39eba5){_0x39eba5=_0x39eba5||0xcc;return function(_0x25c750){if(_0x25c750){return _0xbbc64['sendStatus'](_0x39eba5);}return _0xbbc64[_0x1737('0x19')](_0x39eba5)[_0x1737('0x1a')]();};}function respondWithResult(_0x2f8359,_0x556f9d){_0x556f9d=_0x556f9d||0xc8;return function(_0x20a2d0){if(_0x20a2d0){return _0x2f8359[_0x1737('0x19')](_0x556f9d)[_0x1737('0x1b')](_0x20a2d0);}};}function respondWithFilteredResult(_0x203878,_0x239777){return function(_0x6af939){if(_0x6af939){var _0x7e5d1c=typeof _0x239777[_0x1737('0x1c')]===_0x1737('0x1d')&&typeof _0x239777['limit']===_0x1737('0x1d');var _0x283ba8=_0x6af939['count'];var _0x2ce4d8=_0x7e5d1c?0x0:_0x239777[_0x1737('0x1c')];var _0x304ff0=_0x7e5d1c?_0x6af939[_0x1737('0x1e')]:_0x239777['offset']+_0x239777[_0x1737('0x1f')];var _0x3a22a7;if(_0x304ff0>=_0x283ba8){_0x304ff0=_0x283ba8;_0x3a22a7=0xc8;}else{_0x3a22a7=0xce;}_0x203878['status'](_0x3a22a7);return _0x203878[_0x1737('0x20')](_0x1737('0x21'),_0x2ce4d8+'-'+_0x304ff0+'/'+_0x283ba8)[_0x1737('0x1b')](_0x6af939);}return null;};}function patchUpdates(_0x35d50c){return function(_0x101ae6){try{jsonpatch['apply'](_0x101ae6,_0x35d50c,!![]);}catch(_0x1611ae){return BPromise['reject'](_0x1611ae);}return _0x101ae6[_0x1737('0x22')]();};}function saveUpdates(_0x308a7e,_0xabe5fc){return function(_0x59307a){if(_0x59307a){return _0x59307a[_0x1737('0x23')](_0x308a7e)['then'](function(_0x705829){return _0x705829;});}return null;};}function removeEntity(_0x449677,_0x82ed57){return function(_0x4f99c4){if(_0x4f99c4){return _0x4f99c4['destroy']()[_0x1737('0x24')](function(){_0x449677[_0x1737('0x19')](0xcc)[_0x1737('0x1a')]();});}};}function handleEntityNotFound(_0x456b98,_0x51742d){return function(_0x16fc0b){if(!_0x16fc0b){_0x456b98['sendStatus'](0x194);}return _0x16fc0b;};}function handleError(_0x49ffc5,_0x22fbe7){_0x22fbe7=_0x22fbe7||0x1f4;return function(_0x4c4595){logger[_0x1737('0x25')](_0x4c4595[_0x1737('0x26')]);if(_0x4c4595['name']){delete _0x4c4595[_0x1737('0x27')];}_0x49ffc5[_0x1737('0x19')](_0x22fbe7)[_0x1737('0x28')](_0x4c4595);};}exports['index']=function(_0x532bd9,_0x3045a9){var _0x5f595a={},_0x30690b={},_0x4d7115={'count':0x0,'rows':[]};var _0x73f5cd=_[_0x1737('0x29')](db['FaxApplication'][_0x1737('0x2a')],function(_0x34d6b8){return{'name':_0x34d6b8[_0x1737('0x2b')],'type':_0x34d6b8['type'][_0x1737('0x2c')]};});_0x30690b[_0x1737('0x2d')]=_[_0x1737('0x29')](_0x73f5cd,_0x1737('0x27'));_0x30690b[_0x1737('0x2e')]=_['keys'](_0x532bd9['query']);_0x30690b[_0x1737('0x2f')]=_[_0x1737('0x30')](_0x30690b[_0x1737('0x2d')],_0x30690b[_0x1737('0x2e')]);_0x5f595a[_0x1737('0x31')]=_[_0x1737('0x30')](_0x30690b[_0x1737('0x2d')],qs[_0x1737('0x32')](_0x532bd9[_0x1737('0x2e')][_0x1737('0x32')]));_0x5f595a[_0x1737('0x31')]=_0x5f595a[_0x1737('0x31')]['length']?_0x5f595a['attributes']:_0x30690b[_0x1737('0x2d')];if(!_0x532bd9[_0x1737('0x2e')]['hasOwnProperty'](_0x1737('0x33'))){_0x5f595a['limit']=qs[_0x1737('0x1f')](_0x532bd9[_0x1737('0x2e')][_0x1737('0x1f')]);_0x5f595a[_0x1737('0x1c')]=qs[_0x1737('0x1c')](_0x532bd9[_0x1737('0x2e')][_0x1737('0x1c')]);}_0x5f595a[_0x1737('0x34')]=qs[_0x1737('0x35')](_0x532bd9[_0x1737('0x2e')]['sort']);_0x5f595a[_0x1737('0x36')]=qs[_0x1737('0x2f')](_[_0x1737('0x37')](_0x532bd9[_0x1737('0x2e')],_0x30690b[_0x1737('0x2f')]),_0x73f5cd);if(_0x532bd9[_0x1737('0x2e')]['filter']){_0x5f595a['where']=_['merge'](_0x5f595a['where'],{'$or':_[_0x1737('0x29')](_0x73f5cd,function(_0x3233e2){if(_0x3233e2['type']!==_0x1737('0x38')){var _0x573984={};_0x573984[_0x3233e2['name']]={'$like':'%'+_0x532bd9[_0x1737('0x2e')][_0x1737('0x39')]+'%'};return _0x573984;}})});}_0x5f595a=_['merge']({},_0x5f595a,_0x532bd9['options']);var _0x36b14c={'where':_0x5f595a[_0x1737('0x36')]};return db[_0x1737('0x3a')][_0x1737('0x1e')](_0x36b14c)['then'](function(_0x14fbbe){_0x4d7115['count']=_0x14fbbe;if(_0x532bd9[_0x1737('0x2e')][_0x1737('0x3b')]){_0x5f595a[_0x1737('0x3c')]=[{'all':!![]}];}return db[_0x1737('0x3a')][_0x1737('0x3d')](_0x5f595a);})[_0x1737('0x24')](function(_0x3f1ec5){_0x4d7115['rows']=_0x3f1ec5;return _0x4d7115;})[_0x1737('0x24')](respondWithFilteredResult(_0x3045a9,_0x5f595a))['catch'](handleError(_0x3045a9,null));};exports[_0x1737('0x3e')]=function(_0x1ae995,_0x1c70ab){var _0xa6aa44={'raw':!![],'where':{'id':_0x1ae995[_0x1737('0x3f')]['id']}},_0x3495fa={};_0x3495fa['model']=_['keys'](db[_0x1737('0x3a')][_0x1737('0x2a')]);_0x3495fa[_0x1737('0x2e')]=_[_0x1737('0x40')](_0x1ae995[_0x1737('0x2e')]);_0x3495fa['filters']=_['intersection'](_0x3495fa[_0x1737('0x2d')],_0x3495fa[_0x1737('0x2e')]);_0xa6aa44[_0x1737('0x31')]=_[_0x1737('0x30')](_0x3495fa[_0x1737('0x2d')],qs[_0x1737('0x32')](_0x1ae995[_0x1737('0x2e')][_0x1737('0x32')]));_0xa6aa44[_0x1737('0x31')]=_0xa6aa44[_0x1737('0x31')][_0x1737('0x41')]?_0xa6aa44[_0x1737('0x31')]:_0x3495fa[_0x1737('0x2d')];if(_0x1ae995[_0x1737('0x2e')]['includeAll']){_0xa6aa44['include']=[{'all':!![]}];}_0xa6aa44=_[_0x1737('0x42')]({},_0xa6aa44,_0x1ae995['options']);return db['FaxApplication'][_0x1737('0x43')](_0xa6aa44)['then'](handleEntityNotFound(_0x1c70ab,null))['then'](respondWithResult(_0x1c70ab,null))[_0x1737('0x44')](handleError(_0x1c70ab,null));};exports[_0x1737('0x45')]=function(_0x3a78af,_0x48a78e){return db['FaxApplication'][_0x1737('0x45')](_0x3a78af[_0x1737('0x46')],{})['then'](respondWithResult(_0x48a78e,0xc9))[_0x1737('0x44')](handleError(_0x48a78e,null));};exports[_0x1737('0x23')]=function(_0x4821bf,_0x54adcb){if(_0x4821bf[_0x1737('0x46')]['id']){delete _0x4821bf['body']['id'];}return db[_0x1737('0x3a')][_0x1737('0x43')]({'where':{'id':_0x4821bf[_0x1737('0x3f')]['id']}})[_0x1737('0x24')](handleEntityNotFound(_0x54adcb,null))['then'](saveUpdates(_0x4821bf['body'],null))[_0x1737('0x24')](respondWithResult(_0x54adcb,null))[_0x1737('0x44')](handleError(_0x54adcb,null));};exports[_0x1737('0x47')]=function(_0x530bb0,_0x37711){return db[_0x1737('0x3a')][_0x1737('0x43')]({'where':{'id':_0x530bb0['params']['id']}})[_0x1737('0x24')](handleEntityNotFound(_0x37711,null))['then'](removeEntity(_0x37711,null))[_0x1737('0x44')](handleError(_0x37711,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index fc3e7c7..c6dd891 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 _0x7b4b=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0xaf80ec,_0x543199){var _0x142bef=function(_0x820c46){while(--_0x820c46){_0xaf80ec['push'](_0xaf80ec['shift']());}};_0x142bef(++_0x543199);}(_0x7b4b,0x171));var _0xb7b4=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x7b4b[_0x1283d4];return _0x433643;};'use strict';var _=require('lodash');var util=require(_0xb7b4('0x0'));var logger=require(_0xb7b4('0x1'))(_0xb7b4('0x2'));var moment=require(_0xb7b4('0x3'));var BPromise=require(_0xb7b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7b4('0x5'));var rimraf=require(_0xb7b4('0x6'));var config=require(_0xb7b4('0x7'));var attributes=require(_0xb7b4('0x8'));module[_0xb7b4('0x9')]=function(_0x2731a3,_0x2aa666){return _0x2731a3[_0xb7b4('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xdab1=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','rimraf','./faxApplication.attributes','exports','define','FaxApplication','fax_applications'];(function(_0xd64a26,_0x107986){var _0x18e8b5=function(_0x192eb6){while(--_0x192eb6){_0xd64a26['push'](_0xd64a26['shift']());}};_0x18e8b5(++_0x107986);}(_0xdab1,0x18e));var _0x1dab=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdab1[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x1dab('0x0'));var util=require('util');var logger=require(_0x1dab('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1dab('0x2'));var rp=require(_0x1dab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dab('0x4'));var config=require('../../config/environment');var attributes=require(_0x1dab('0x5'));module[_0x1dab('0x6')]=function(_0x3185b2,_0x20cb10){return _0x3185b2[_0x1dab('0x7')](_0x1dab('0x8'),attributes,{'tableName':_0x1dab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1dab('0xa'),'collate':_0x1dab('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ab920db..96e7923 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 _0x47f9=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','util'];(function(_0x29d0f2,_0x5d6cd8){var _0x520360=function(_0x17fb8e){while(--_0x17fb8e){_0x29d0f2['push'](_0x29d0f2['shift']());}};_0x520360(++_0x5d6cd8);}(_0x47f9,0xff));var _0x947f=function(_0x411b14,_0x3f9e36){_0x411b14=_0x411b14-0x0;var _0x402736=_0x47f9[_0x411b14];return _0x402736;};'use strict';var _=require('lodash');var util=require(_0x947f('0x0'));var moment=require(_0x947f('0x1'));var BPromise=require(_0x947f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x947f('0x3'));var db=require(_0x947f('0x4'))['db'];var utils=require(_0x947f('0x5'));var logger=require(_0x947f('0x6'))(_0x947f('0x7'));var config=require(_0x947f('0x8'));var jayson=require(_0x947f('0x9'));var client=jayson[_0x947f('0xa')][_0x947f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a9179,_0x4e2dce,_0x249ba2){return new BPromise(function(_0x272053,_0x3e6ea1){return client[_0x947f('0xc')](_0x4a9179,_0x249ba2)[_0x947f('0xd')](function(_0x516300){logger[_0x947f('0xe')](_0x947f('0xf'),_0x4e2dce,_0x947f('0x10'));logger['debug'](_0x947f('0x11'),_0x4e2dce,_0x947f('0x10'),JSON[_0x947f('0x12')](_0x516300));if(_0x516300[_0x947f('0x13')]){if(_0x516300['error'][_0x947f('0x14')]===0x1f4){logger[_0x947f('0x13')]('FaxApplication,\x20%s,\x20%s',_0x4e2dce,_0x516300[_0x947f('0x13')][_0x947f('0x15')]);return _0x3e6ea1(_0x516300[_0x947f('0x13')][_0x947f('0x15')]);}logger[_0x947f('0x13')]('FaxApplication,\x20%s,\x20%s',_0x4e2dce,_0x516300[_0x947f('0x13')][_0x947f('0x15')]);return _0x272053(_0x516300[_0x947f('0x13')][_0x947f('0x15')]);}else{logger[_0x947f('0xe')]('FaxApplication,\x20%s,\x20%s',_0x4e2dce,_0x947f('0x10'));_0x272053(_0x516300[_0x947f('0x16')]['message']);}})[_0x947f('0x17')](function(_0x5b323b){logger[_0x947f('0x13')](_0x947f('0xf'),_0x4e2dce,_0x5b323b);_0x3e6ea1(_0x5b323b);});});}exports[_0x947f('0x18')]=function(_0x55d72a){var _0x23fd02=this;return new Promise(function(_0x2a7ad5,_0x4ca767){return db[_0x947f('0x19')][_0x947f('0x1a')](_0x55d72a[_0x947f('0x1b')],{'raw':_0x55d72a[_0x947f('0x1c')]?_0x55d72a['options'][_0x947f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55d72a[_0x947f('0x1c')]?_0x55d72a[_0x947f('0x1c')]['where']||null:null,'attributes':_0x55d72a[_0x947f('0x1c')]?_0x55d72a[_0x947f('0x1c')][_0x947f('0x1e')]||null:null,'limit':_0x55d72a[_0x947f('0x1c')]?_0x55d72a[_0x947f('0x1c')][_0x947f('0x1f')]||null:null})[_0x947f('0xd')](function(_0x4ea8fe){logger['info'](_0x947f('0x18'),_0x55d72a);logger['debug']('UpdateFaxApplication',_0x55d72a,JSON['stringify'](_0x4ea8fe));_0x2a7ad5(_0x4ea8fe);})[_0x947f('0x17')](function(_0x17a08b){logger[_0x947f('0x13')](_0x947f('0x18'),_0x17a08b[_0x947f('0x15')],_0x55d72a);_0x4ca767(_0x23fd02['error'](0x1f4,_0x17a08b['message']));});});}; \ No newline at end of file +var _0xf442=['FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateFaxApplication','update','body','options','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x31329c,_0x1d5774){var _0x439162=function(_0xd565cb){while(--_0xd565cb){_0x31329c['push'](_0x31329c['shift']());}};_0x439162(++_0x1d5774);}(_0xf442,0xbc));var _0x2f44=function(_0x50e6bd,_0x272431){_0x50e6bd=_0x50e6bd-0x0;var _0x1ef318=_0xf442[_0x50e6bd];return _0x1ef318;};'use strict';var _=require(_0x2f44('0x0'));var util=require(_0x2f44('0x1'));var moment=require(_0x2f44('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f44('0x3'));var fs=require('fs');var Redis=require(_0x2f44('0x4'));var db=require(_0x2f44('0x5'))['db'];var utils=require(_0x2f44('0x6'));var logger=require(_0x2f44('0x7'))(_0x2f44('0x8'));var config=require(_0x2f44('0x9'));var jayson=require(_0x2f44('0xa'));var client=jayson[_0x2f44('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0cff,_0x5bf675,_0x8fd6fa){return new BPromise(function(_0x21ba73,_0xd72531){return client[_0x2f44('0xc')](_0x1a0cff,_0x8fd6fa)[_0x2f44('0xd')](function(_0x3ac3db){logger[_0x2f44('0xe')](_0x2f44('0xf'),_0x5bf675,_0x2f44('0x10'));logger[_0x2f44('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5bf675,_0x2f44('0x10'),JSON['stringify'](_0x3ac3db));if(_0x3ac3db[_0x2f44('0x12')]){if(_0x3ac3db['error'][_0x2f44('0x13')]===0x1f4){logger[_0x2f44('0x12')](_0x2f44('0xf'),_0x5bf675,_0x3ac3db['error'][_0x2f44('0x14')]);return _0xd72531(_0x3ac3db[_0x2f44('0x12')][_0x2f44('0x14')]);}logger[_0x2f44('0x12')](_0x2f44('0xf'),_0x5bf675,_0x3ac3db[_0x2f44('0x12')][_0x2f44('0x14')]);return _0x21ba73(_0x3ac3db[_0x2f44('0x12')][_0x2f44('0x14')]);}else{logger[_0x2f44('0xe')](_0x2f44('0xf'),_0x5bf675,'request\x20sent');_0x21ba73(_0x3ac3db[_0x2f44('0x15')][_0x2f44('0x14')]);}})[_0x2f44('0x16')](function(_0x2a8b91){logger['error'](_0x2f44('0xf'),_0x5bf675,_0x2a8b91);_0xd72531(_0x2a8b91);});});}exports[_0x2f44('0x17')]=function(_0x396e25){var _0x25feaf=this;return new Promise(function(_0x43d014,_0x5984ae){return db['FaxApplication'][_0x2f44('0x18')](_0x396e25[_0x2f44('0x19')],{'raw':_0x396e25[_0x2f44('0x1a')]?_0x396e25[_0x2f44('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x396e25[_0x2f44('0x1a')]?_0x396e25[_0x2f44('0x1a')]['where']||null:null,'attributes':_0x396e25[_0x2f44('0x1a')]?_0x396e25[_0x2f44('0x1a')]['attributes']||null:null,'limit':_0x396e25[_0x2f44('0x1a')]?_0x396e25[_0x2f44('0x1a')][_0x2f44('0x1b')]||null:null})[_0x2f44('0xd')](function(_0x30bf65){logger[_0x2f44('0xe')](_0x2f44('0x17'),_0x396e25);logger[_0x2f44('0x11')]('UpdateFaxApplication',_0x396e25,JSON[_0x2f44('0x1c')](_0x30bf65));_0x43d014(_0x30bf65);})['catch'](function(_0x25793d){logger[_0x2f44('0x12')](_0x2f44('0x17'),_0x25793d['message'],_0x396e25);_0x5984ae(_0x25feaf[_0x2f44('0x12')](0x1f4,_0x25793d[_0x2f44('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index b35ca7f..14d3d62 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 _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea28,0x13a));var _0x8ea2=function(_0x15f4c5,_0x1650d5){_0x15f4c5=_0x15f4c5-0x0;var _0x412861=_0xea28[_0x15f4c5];return _0x412861;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0xe511=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','show','post','put'];(function(_0x2dabcc,_0x43d057){var _0xa786ca=function(_0x3e418f){while(--_0x3e418f){_0x2dabcc['push'](_0x2dabcc['shift']());}};_0xa786ca(++_0x43d057);}(_0xe511,0x16f));var _0x1e51=function(_0x235983,_0xd22673){_0x235983=_0x235983-0x0;var _0x538b67=_0xe511[_0x235983];return _0x538b67;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e51('0xc')](_0x1e51('0xd'),auth[_0x1e51('0xe')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0x11')]);module[_0x1e51('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 f4aa08f..a73d0ce 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 _0x1ea5=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x1006df,_0x556c42){var _0x4484ce=function(_0x507fda){while(--_0x507fda){_0x1006df['push'](_0x1006df['shift']());}};_0x4484ce(++_0x556c42);}(_0x1ea5,0x17f));var _0x51ea=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x1ea5[_0x314a8c];return _0x1d4607;};'use strict';var Sequelize=require(_0x51ea('0x0'));module['exports']={'closed':{'type':Sequelize[_0x51ea('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51ea('0x2')]},'disposition':{'type':Sequelize[_0x51ea('0x3')]},'secondDisposition':{'type':Sequelize[_0x51ea('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x51ea('0x2')]},'fax':{'type':Sequelize[_0x51ea('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x51ea('0x4')]('in',_0x51ea('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51ea('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x51ea('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xdd18=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2ce286,_0x4104e4){var _0x4c471f=function(_0x43326c){while(--_0x43326c){_0x2ce286['push'](_0x2ce286['shift']());}};_0x4c471f(++_0x4104e4);}(_0xdd18,0x1c1));var _0x8dd1=function(_0xddf503,_0x5882c2){_0xddf503=_0xddf503-0x0;var _0x47c083=_0xdd18[_0xddf503];return _0x47c083;};'use strict';var Sequelize=require(_0x8dd1('0x0'));module[_0x8dd1('0x1')]={'closed':{'type':Sequelize[_0x8dd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8dd1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8dd1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8dd1('0x4')]},'read1stAt':{'type':Sequelize[_0x8dd1('0x3')]},'fax':{'type':Sequelize[_0x8dd1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8dd1('0x5')]('in',_0x8dd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8dd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8dd1('0x5')]('in',_0x8dd1('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 ce91cdd..cb8239c 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 _0xf75b=['Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','include','create','params','describe','addMessage','FaxMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','unix','root','server','files','tmp','join','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','download','err','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','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','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','isEmpty','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','FaxInteraction','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName'];(function(_0x16197f,_0x261064){var _0x195dcb=function(_0x3f87fe){while(--_0x3f87fe){_0x16197f['push'](_0x16197f['shift']());}};_0x195dcb(++_0x261064);}(_0xf75b,0x10d));var _0xbf75=function(_0x3e4adc,_0x46038d){_0x3e4adc=_0x3e4adc-0x0;var _0xa5e74e=_0xf75b[_0x3e4adc];return _0xa5e74e;};'use strict';var emlformat=require(_0xbf75('0x0'));var rimraf=require(_0xbf75('0x1'));var zipdir=require(_0xbf75('0x2'));var jsonpatch=require(_0xbf75('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbf75('0x4'));var Mustache=require('mustache');var util=require(_0xbf75('0x5'));var path=require('path');var sox=require(_0xbf75('0x6'));var csv=require(_0xbf75('0x7'));var ejs=require(_0xbf75('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf75('0x9'));var jsforce=require(_0xbf75('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbf75('0x7'));var querystring=require(_0xbf75('0xb'));var Papa=require(_0xbf75('0xc'));var Redis=require(_0xbf75('0xd'));var authService=require(_0xbf75('0xe'));var qs=require(_0xbf75('0xf'));var as=require(_0xbf75('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf75('0x11'))(_0xbf75('0x12'));var utils=require(_0xbf75('0x13'));var config=require(_0xbf75('0x14'));var licenseUtil=require(_0xbf75('0x15'));var db=require('../../mysqldb')['db'];config[_0xbf75('0x16')]=_[_0xbf75('0x17')](config[_0xbf75('0x16')],{'host':_0xbf75('0x18'),'port':0x18eb});var socket=require(_0xbf75('0x19'))(new Redis(config[_0xbf75('0x16')]));require(_0xbf75('0x1a'))['register'](socket);function respondWithStatusCode(_0x57c3f4,_0x55cf3b){_0x55cf3b=_0x55cf3b||0xcc;return function(_0x5edabf){if(_0x5edabf){return _0x57c3f4['sendStatus'](_0x55cf3b);}return _0x57c3f4[_0xbf75('0x1b')](_0x55cf3b)['end']();};}function respondWithResult(_0x40ce50,_0x11c8d8){_0x11c8d8=_0x11c8d8||0xc8;return function(_0x286e7b){if(_0x286e7b){return _0x40ce50['status'](_0x11c8d8)[_0xbf75('0x1c')](_0x286e7b);}};}function respondWithFilteredResult(_0x2b81ee,_0x312cb1){return function(_0x130294){if(_0x130294){var _0x25b925=typeof _0x312cb1[_0xbf75('0x1d')]==='undefined'&&typeof _0x312cb1[_0xbf75('0x1e')]===_0xbf75('0x1f');var _0x27545a=_0x130294[_0xbf75('0x20')];var _0x55352b=_0x25b925?0x0:_0x312cb1['offset'];var _0x1321d8=_0x25b925?_0x130294[_0xbf75('0x20')]:_0x312cb1['offset']+_0x312cb1['limit'];var _0x1c9e0b;if(_0x1321d8>=_0x27545a){_0x1321d8=_0x27545a;_0x1c9e0b=0xc8;}else{_0x1c9e0b=0xce;}_0x2b81ee[_0xbf75('0x1b')](_0x1c9e0b);return _0x2b81ee[_0xbf75('0x21')](_0xbf75('0x22'),_0x55352b+'-'+_0x1321d8+'/'+_0x27545a)[_0xbf75('0x1c')](_0x130294);}return null;};}function patchUpdates(_0x54fd40){return function(_0xfd194){try{jsonpatch[_0xbf75('0x23')](_0xfd194,_0x54fd40,!![]);}catch(_0x30160f){return BPromise[_0xbf75('0x24')](_0x30160f);}return _0xfd194[_0xbf75('0x25')]();};}function saveUpdates(_0x59dcbe,_0x10092c){return function(_0x478ec6){if(_0x478ec6){return _0x478ec6[_0xbf75('0x26')](_0x59dcbe)[_0xbf75('0x27')](function(_0x4c70fb){return _0x4c70fb;});}return null;};}function removeEntity(_0x4f5a23,_0x5b2c0f){return function(_0x10ed47){if(_0x10ed47){return _0x10ed47[_0xbf75('0x28')]()[_0xbf75('0x27')](function(){_0x4f5a23[_0xbf75('0x1b')](0xcc)[_0xbf75('0x29')]();});}};}function handleEntityNotFound(_0x230ea0,_0x513b35){return function(_0x16ac16){if(!_0x16ac16){_0x230ea0['sendStatus'](0x194);}return _0x16ac16;};}function handleError(_0x2c6dee,_0xa402f2){_0xa402f2=_0xa402f2||0x1f4;return function(_0x346d67){logger['error'](_0x346d67[_0xbf75('0x2a')]);if(_0x346d67['name']){delete _0x346d67[_0xbf75('0x2b')];}_0x2c6dee[_0xbf75('0x1b')](_0xa402f2)[_0xbf75('0x2c')](_0x346d67);};}function getInteractionUsers(_0x9b9374,_0x4a57fa){return new BPromise(function(_0x1672d7,_0x34a7ca){try{if(_0x4a57fa[_0x9b9374['id']]){_0x9b9374['Users']=_[_0xbf75('0x2d')](_0x4a57fa[_0x9b9374['id']],function(_0x3d43a5){return{'id':_0x3d43a5['id'],'fullname':_0x3d43a5[_0xbf75('0x2e')]};});}}catch(_0x355cb5){_0x34a7ca(_0x355cb5);}_0x1672d7(_0x9b9374);});}function getInteractionTags(_0x227e95,_0x4eb114){return new BPromise(function(_0x59dbb9,_0xafbc40){try{if(_0x227e95[_0xbf75('0x2f')]){_0x227e95[_0xbf75('0x30')]=[];_0x227e95[_0xbf75('0x2f')][_0xbf75('0x31')](',')[_0xbf75('0x32')](function(_0x3bd287){_0x227e95[_0xbf75('0x30')][_0xbf75('0x33')](_0x4eb114[_0x3bd287]);});}delete _0x227e95[_0xbf75('0x2f')];}catch(_0x52dcc4){_0xafbc40(_0x52dcc4);}_0x59dbb9(_0x227e95);});}function updateFaxInteraction(_0x52b7f3,_0x4e0e8b,_0x3e90e6){return new BPromise(function(_0x5f2efc,_0x4994af){return getInteractionUsers(_0x52b7f3,_0x3e90e6)[_0xbf75('0x27')](function(_0x344fd4){return getInteractionTags(_0x344fd4,_0x4e0e8b);})['then'](function(_0x4a89ae){_0x5f2efc(_0x4a89ae);})[_0xbf75('0x34')](function(_0x1c9f57){_0x4994af(_0x1c9f57);});});}exports[_0xbf75('0x35')]=function(_0x43a9be,_0x57f24c){var _0x41f558={},_0x54ba73={},_0x32fb68={'count':0x0,'rows':[]};var _0x4189c2=_[_0xbf75('0x2d')](db['FaxInteraction'][_0xbf75('0x36')],function(_0x319273){return{'name':_0x319273['fieldName'],'type':_0x319273[_0xbf75('0x37')]['key']};});_0x54ba73[_0xbf75('0x38')]=_[_0xbf75('0x2d')](_0x4189c2,_0xbf75('0x2b'));_0x54ba73[_0xbf75('0x39')]=_[_0xbf75('0x3a')](_0x43a9be[_0xbf75('0x39')]);_0x54ba73[_0xbf75('0x3b')]=_['intersection'](_0x54ba73[_0xbf75('0x38')],_0x54ba73[_0xbf75('0x39')]);_0x41f558[_0xbf75('0x3c')]=_[_0xbf75('0x3d')](_0x54ba73[_0xbf75('0x38')],qs[_0xbf75('0x3e')](_0x43a9be[_0xbf75('0x39')][_0xbf75('0x3e')]));_0x41f558[_0xbf75('0x3c')]=_0x41f558[_0xbf75('0x3c')][_0xbf75('0x3f')]?_0x41f558[_0xbf75('0x3c')]:_0x54ba73[_0xbf75('0x38')];if(!_0x43a9be['query']['hasOwnProperty']('nolimit')){_0x41f558[_0xbf75('0x1e')]=qs[_0xbf75('0x1e')](_0x43a9be[_0xbf75('0x39')][_0xbf75('0x1e')]);_0x41f558[_0xbf75('0x1d')]=qs[_0xbf75('0x1d')](_0x43a9be['query'][_0xbf75('0x1d')]);}_0x41f558[_0xbf75('0x40')]=qs['sort'](_0x43a9be[_0xbf75('0x39')][_0xbf75('0x41')]);_0x41f558[_0xbf75('0x42')]=qs[_0xbf75('0x3b')](_[_0xbf75('0x43')](_0x43a9be['query'],_0x54ba73[_0xbf75('0x3b')]),_0x4189c2);var _0x509f5d=[];var _0x3eeac3=squel[_0xbf75('0x44')]()[_0xbf75('0x45')]('id')[_0xbf75('0x45')]('name')['field'](_0xbf75('0x46'))[_0xbf75('0x47')](_0xbf75('0x48'));var _0x335a51=squel[_0xbf75('0x44')]()[_0xbf75('0x45')]('u.id')[_0xbf75('0x45')](_0xbf75('0x49'))[_0xbf75('0x45')](_0xbf75('0x4a'))['from'](_0xbf75('0x4b'),'ui')['left_join'](_0xbf75('0x4c'),'u',_0xbf75('0x4d'));var _0x3e66fe=squel[_0xbf75('0x44')]()[_0xbf75('0x47')](_0xbf75('0x4e'),'i')[_0xbf75('0x4f')](_0xbf75('0x50'),'c',_0xbf75('0x51'))['left_join'](_0xbf75('0x4c'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xbf75('0x52'),'a',_0xbf75('0x53'))['left_join'](_0xbf75('0x54'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xbf75('0x4f')]('fax_interaction_has_tags','it',_0xbf75('0x55'))[_0xbf75('0x4f')]('tools_tags','t',_0xbf75('0x56'));var _0x5260a3=squel[_0xbf75('0x57')]();var _0x302b37=[];var _0x23782d=squel[_0xbf75('0x57')]();var _0x58d155;if(_0x43a9be[_0xbf75('0x39')]['search']){_0x58d155=as[_0xbf75('0x58')](_0x43a9be['query'][_0xbf75('0x59')]);var _0x7de90a=_0x58d155[_0xbf75('0x5a')];for(var _0x14cf04=0x0;_0x14cf04<_0x58d155['conditions'][_0xbf75('0x3f')];_0x14cf04++){var _0x43914e=_0x58d155[_0xbf75('0x5b')][_0x14cf04];var _0x3c05fc='i';var _0xa34fa4=_[_0xbf75('0x5c')](_0x4189c2,[_0xbf75('0x2b'),_0x43914e[_0xbf75('0x45')]]);if(!_0xa34fa4){switch(_0x43914e[_0xbf75('0x45')]){case'unreadMessages':if(_0x43914e[_0xbf75('0x5d')]==0x1){_0x3e66fe[_0xbf75('0x5e')]('`'+_0x43914e['field']+'`\x20=\x200');}else{_0x3e66fe[_0xbf75('0x5e')]('`'+_0x43914e[_0xbf75('0x45')]+'`\x20>\x200');}break;case _0xbf75('0x5f'):if(_0x43914e[_0xbf75('0x60')]===_0xbf75('0x61')){if(_0x43914e[_0xbf75('0x5d')][_0xbf75('0x31')]('\x20')[_0xbf75('0x3f')]>0x1){_0x5260a3[_0x7de90a](_0xbf75('0x62'),qs[_0xbf75('0x63')](_0x43914e[_0xbf75('0x5d')]),null);}else{var _0x22abc1='%'+_0x43914e[_0xbf75('0x5d')]+'%';_0x5260a3[_0x7de90a](_0xbf75('0x64'),_0x22abc1,_0x22abc1,_0x22abc1);}}else{_0xa34fa4=_[_0xbf75('0x5c')](_0x4189c2,[_0xbf75('0x2b'),_0xbf75('0x65')]);_0x43914e[_0xbf75('0x45')]=_0xbf75('0x65');_0x100df7=as[_0xbf75('0x66')](_0x3c05fc,_0xa34fa4[_0xbf75('0x37')],_0x43914e);_0x5260a3[_0x7de90a](_0x100df7[_0xbf75('0x67')],_0x100df7['value'][_0xbf75('0x68')],_0x100df7['value']['end']);}break;case _0xbf75('0x69'):var _0x4d2b8a=_0x43914e[_0xbf75('0x5d')][_0xbf75('0x31')](',')['map'](function(_0x19e3bc){return Number(_0x19e3bc);});_0x4d2b8a[_0xbf75('0x32')](function(_0xe0832c){_0x23782d['or'](_0xbf75('0x6a'),'%,'+_0xe0832c+',%');});_0x302b37=_[_0xbf75('0x6b')](_0x302b37,_0x4d2b8a);break;case _0xbf75('0x6c'):if(_0x43914e[_0xbf75('0x60')]==='$substring'){_0x5260a3[_0x7de90a](_0xbf75('0x6d'),'%'+_0x43914e[_0xbf75('0x5d')]+'%',null);}else{_0xa34fa4=_[_0xbf75('0x5c')](_0x4189c2,['name',_0xbf75('0x6e')]);_0x43914e[_0xbf75('0x45')]=_0xbf75('0x6e');_0x100df7=as['buildExpression'](_0x3c05fc,_0xa34fa4[_0xbf75('0x37')],_0x43914e);_0x5260a3[_0x7de90a](_0x100df7[_0xbf75('0x67')],_0x100df7[_0xbf75('0x5d')][_0xbf75('0x68')],_0x100df7[_0xbf75('0x5d')]['end']);}break;case _0xbf75('0x6f'):_0x100df7=as[_0xbf75('0x66')]('me',null,_0x43914e);_0x5260a3[_0x7de90a](_0x100df7['text'],_0x100df7[_0xbf75('0x5d')][_0xbf75('0x68')],_0x100df7[_0xbf75('0x5d')][_0xbf75('0x29')]);break;}}else{var _0x100df7=as[_0xbf75('0x66')](_0x3c05fc,_0xa34fa4[_0xbf75('0x37')],_0x43914e);_0x5260a3[_0x7de90a](_0x100df7[_0xbf75('0x67')],_0x100df7[_0xbf75('0x5d')]['start'],_0x100df7[_0xbf75('0x5d')][_0xbf75('0x29')]);}}}else{var _0x341a33=_(_0x43a9be[_0xbf75('0x39')])[_0xbf75('0x3a')]()[_0xbf75('0x2d')](function(_0x2b0674){return _[_0xbf75('0x70')](_0x4189c2,['name',_0x2b0674])?_0x2b0674:undefined;})[_0xbf75('0x71')]()[_0xbf75('0x5d')]();if(!_['isEmpty'](_0x341a33)){_0x341a33['forEach'](function(_0x50bc3b){if(_0x50bc3b===_0xbf75('0x72')){_0x3e66fe[_0xbf75('0x42')](_0xbf75('0x73'),[][_0xbf75('0x74')](_0x43a9be[_0xbf75('0x39')][_0x50bc3b]));}else if(_0x50bc3b===_0xbf75('0x75')){var _0x2f104d=JSON[_0xbf75('0x76')](_0x43a9be['query'][_0x50bc3b])[_0xbf75('0x77')];var _0x2877a0=JSON[_0xbf75('0x76')](_0x43a9be[_0xbf75('0x39')][_0x50bc3b])[_0xbf75('0x78')];_0x3e66fe['where'](_0xbf75('0x79'),_0x2f104d,_0x2877a0);}else{if(_0x43a9be[_0xbf75('0x39')][_0x50bc3b]===_0xbf75('0x7a')){_0x3e66fe[_0xbf75('0x42')]('i.'+_0x50bc3b+_0xbf75('0x7b'));}else{_0x3e66fe['where']('i.'+_0x50bc3b+_0xbf75('0x7c'),_0x43a9be[_0xbf75('0x39')][_0x50bc3b]);}}});}if(_0x43a9be['query'][_0xbf75('0x7d')]){if(_0x43a9be['query']['read']==0x1){_0x3e66fe[_0xbf75('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x3e66fe['having'](_0xbf75('0x7e'));}}if(_0x43a9be[_0xbf75('0x39')][_0xbf75('0x7f')]){_0x302b37=_['isArray'](_0x43a9be['query'][_0xbf75('0x7f')])?_0x43a9be['query'][_0xbf75('0x7f')]:new Array(_0x43a9be[_0xbf75('0x39')][_0xbf75('0x7f')]);_0x302b37[_0xbf75('0x32')](function(_0x2a39c7){_0x23782d['or'](_0xbf75('0x6a'),'%,'+_0x2a39c7+',%');});}if(_0x43a9be[_0xbf75('0x39')][_0xbf75('0x80')]){var _0x58eb36=_0x43a9be[_0xbf75('0x39')][_0xbf75('0x80')][_0xbf75('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbf75('0x82')](_0x58eb36)){_0x5260a3['or'](_0xbf75('0x83'),_0x58eb36+'%')['or'](_0xbf75('0x84'),_0x58eb36+'%');}_0x5260a3['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x58eb36+'%');}}_0x3e66fe[_0xbf75('0x42')](_0x5260a3);_0x3e66fe[_0xbf75('0x85')](_0xbf75('0x86'));var _0x2f5085={'type':db[_0xbf75('0x87')]['QueryTypes'][_0xbf75('0x88')],'raw':!![]};var _0x1048dc=_0x3e66fe[_0xbf75('0x89')]();_0x1048dc[_0xbf75('0x45')](_0xbf75('0x86'));_0x1048dc[_0xbf75('0x45')](_0xbf75('0x8a'),_0xbf75('0x8b'));if(_0x41f558[_0xbf75('0x40')]){_0x41f558[_0xbf75('0x40')]['forEach'](function(_0x1f3d5c){var _0x5d4e76=_0x1f3d5c[0x0]===_0xbf75('0x8c')?_0x1f3d5c[0x0]:'i.'+_0x1f3d5c[0x0];_0x3e66fe[_0xbf75('0x40')](_0x5d4e76,_0x1f3d5c[0x1]===_0xbf75('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x302b37)){_0x3e66fe[_0xbf75('0x5e')](_0x23782d);_0x1048dc[_0xbf75('0x42')]('t.id\x20IN\x20?',_0x302b37);}BPromise[_0xbf75('0x8e')]()[_0xbf75('0x27')](function(){if(!_0x58d155){if(_0x43a9be[_0xbf75('0x39')][_0xbf75('0x72')])return;_0x1048dc['where'](_0xbf75('0x8f'));_0x3e66fe[_0xbf75('0x42')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x43a9be[_0xbf75('0x90')][_0xbf75('0x91')]!==_0xbf75('0x92'))return;return _0x43a9be[_0xbf75('0x90')][_0xbf75('0x93')]({'attributes':['id'],'raw':!![]})[_0xbf75('0x27')](function(_0x20fc43){if(_[_0xbf75('0x94')](_0x20fc43)){_0x1048dc[_0xbf75('0x42')](_0xbf75('0x95'));_0x3e66fe[_0xbf75('0x42')](_0xbf75('0x95'));}else{_0x1048dc[_0xbf75('0x42')](_0xbf75('0x73'),_[_0xbf75('0x2d')](_0x20fc43,'id'));_0x3e66fe['where'](_0xbf75('0x73'),_[_0xbf75('0x2d')](_0x20fc43,'id'));}});})[_0xbf75('0x27')](function(){if(_0x43a9be['user'][_0xbf75('0x91')]===_0xbf75('0x92')&&!_0x58d155&&!_0x43a9be[_0xbf75('0x39')]['FaxAccountId'])return[];return db[_0xbf75('0x96')]['query'](_0x1048dc[_0xbf75('0x97')](),_0x2f5085);})[_0xbf75('0x27')](function(_0x432072){_0x32fb68['count']=_0x432072[_0xbf75('0x3f')];if(_0x32fb68[_0xbf75('0x20')]===0x0)return[];return db[_0xbf75('0x96')][_0xbf75('0x39')](_0x3eeac3['toString'](),_0x2f5085)['then'](function(_0x5bde1a){_0x509f5d=_['keyBy'](_0x5bde1a,'id');_0x2f5085=_[_0xbf75('0x98')](_0x2f5085,{'model':db[_0xbf75('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43a9be[_0xbf75('0x39')]['fields']){_0x41f558['attributes']['forEach'](function(_0x3dd211){_0x3e66fe[_0xbf75('0x45')]('i.'+_0x3dd211);});}else{_0x3e66fe[_0xbf75('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3e66fe[_0xbf75('0x45')]('a.key',_0xbf75('0x9a'));_0x3e66fe[_0xbf75('0x45')](_0xbf75('0x9b'),'Account.mandatoryDisposition');_0x3e66fe[_0xbf75('0x45')](_0xbf75('0x9c'),_0xbf75('0x8c'));_0x3e66fe[_0xbf75('0x45')](_0xbf75('0x9d'));_0x3e66fe['field'](_0xbf75('0x9e'),_0xbf75('0x9f'));_0x3e66fe[_0xbf75('0x45')](_0xbf75('0xa0'),_0xbf75('0xa1'));_0x3e66fe[_0xbf75('0x45')]('c.email',_0xbf75('0xa2'));_0x3e66fe['field'](_0xbf75('0xa3'),_0xbf75('0xa4'));_0x3e66fe[_0xbf75('0x45')]('c.mobile',_0xbf75('0xa5'));_0x3e66fe['field']('c.fax',_0xbf75('0xa6'));_0x3e66fe[_0xbf75('0x45')](_0xbf75('0xa7'),_0xbf75('0xa8'));_0x3e66fe[_0xbf75('0x45')]('o.internal',_0xbf75('0xa9'));_0x3e66fe['field'](_0xbf75('0xaa'),'TagIds');}if(_0x41f558[_0xbf75('0x1e')])_0x3e66fe['limit'](_0x41f558[_0xbf75('0x1e')]);if(_0x41f558['offset'])_0x3e66fe['offset'](_0x41f558[_0xbf75('0x1d')]);return db[_0xbf75('0x96')][_0xbf75('0x39')](_0x3e66fe[_0xbf75('0x97')](),_0x2f5085);})[_0xbf75('0x27')](function(_0x2b29a0){if(_0x2b29a0[_0xbf75('0x3f')]>0x0)_0x335a51['where'](_0xbf75('0xab'),_[_0xbf75('0x2d')](_0x2b29a0,'id'));return db[_0xbf75('0x96')][_0xbf75('0x39')](_0x335a51[_0xbf75('0x97')](),_0x2f5085)['then'](function(_0x5c5845){var _0x2ce9bd=_[_0xbf75('0xac')](_0x5c5845,_0xbf75('0xad'));var _0xa2e035=[];_0x2b29a0[_0xbf75('0x32')](function(_0x3f5728){_0xa2e035['push'](updateFaxInteraction(_0x3f5728,_0x509f5d,_0x2ce9bd));});return BPromise[_0xbf75('0xae')](_0xa2e035);});});})[_0xbf75('0x27')](function(_0x2fad78){_0x32fb68[_0xbf75('0xaf')]=_0x2fad78;return _0x32fb68;})[_0xbf75('0x27')](respondWithFilteredResult(_0x57f24c,_0x41f558))[_0xbf75('0x34')](handleError(_0x57f24c,null));};exports['show']=function(_0x56939a,_0x53b740){var _0x2798ef={'raw':![],'where':{'id':_0x56939a['params']['id']}},_0x488df0={};_0x488df0['model']=_[_0xbf75('0x3a')](db[_0xbf75('0x99')]['rawAttributes']);_0x488df0[_0xbf75('0x39')]=_[_0xbf75('0x3a')](_0x56939a[_0xbf75('0x39')]);_0x488df0[_0xbf75('0x3b')]=_['intersection'](_0x488df0[_0xbf75('0x38')],_0x488df0['query']);_0x2798ef[_0xbf75('0x3c')]=_[_0xbf75('0x3d')](_0x488df0[_0xbf75('0x38')],qs[_0xbf75('0x3e')](_0x56939a[_0xbf75('0x39')][_0xbf75('0x3e')]));_0x2798ef['attributes']=_0x2798ef[_0xbf75('0x3c')][_0xbf75('0x3f')]?_0x2798ef[_0xbf75('0x3c')]:_0x488df0[_0xbf75('0x38')];if(_0x56939a[_0xbf75('0x39')]['includeAll']){_0x2798ef[_0xbf75('0xb0')]=[{'all':!![]}];}_0x2798ef=_['merge']({},_0x2798ef,_0x56939a['options']);return db['FaxInteraction'][_0xbf75('0x5c')](_0x2798ef)[_0xbf75('0x27')](handleEntityNotFound(_0x53b740,null))['then'](respondWithResult(_0x53b740,null))[_0xbf75('0x34')](handleError(_0x53b740,null));};exports[_0xbf75('0xb1')]=function(_0x382d8e,_0x5870a2){return db[_0xbf75('0x99')]['create'](_0x382d8e[_0xbf75('0x6f')],{})[_0xbf75('0x27')](respondWithResult(_0x5870a2,0xc9))[_0xbf75('0x34')](handleError(_0x5870a2,null));};exports[_0xbf75('0x26')]=function(_0x277e8e,_0x3ac4aa){if(_0x277e8e[_0xbf75('0x6f')]['id']){delete _0x277e8e[_0xbf75('0x6f')]['id'];}return db['FaxInteraction'][_0xbf75('0x5c')]({'where':{'id':_0x277e8e[_0xbf75('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3ac4aa,null))[_0xbf75('0x27')](saveUpdates(_0x277e8e['body'],null))[_0xbf75('0x27')](respondWithResult(_0x3ac4aa,null))[_0xbf75('0x34')](handleError(_0x3ac4aa,null));};exports[_0xbf75('0x28')]=function(_0x1da4ad,_0x3b013b){return db[_0xbf75('0x99')][_0xbf75('0x5c')]({'where':{'id':_0x1da4ad[_0xbf75('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3b013b,null))[_0xbf75('0x27')](removeEntity(_0x3b013b,null))[_0xbf75('0x34')](handleError(_0x3b013b,null));};exports['describe']=function(_0x14c4a4,_0x3c468d){return db['FaxInteraction'][_0xbf75('0xb3')]()[_0xbf75('0x27')](respondWithResult(_0x3c468d,null))[_0xbf75('0x34')](handleError(_0x3c468d,null));};exports[_0xbf75('0xb4')]=function(_0x54d27c,_0x5eba81,_0x45166b){return db[_0xbf75('0xb5')][_0xbf75('0x5c')]({'where':{'id':_0x54d27c[_0xbf75('0xb2')]['id']}})[_0xbf75('0x27')](handleEntityNotFound(_0x5eba81,null))[_0xbf75('0x27')](function(_0x403847){if(_0x403847){return _0x403847['addMessage'](_0x54d27c[_0xbf75('0x6f')][_0xbf75('0xb6')],_[_0xbf75('0xb7')](_0x54d27c['body'],[_0xbf75('0xb6'),'id'])||{});}})[_0xbf75('0x27')](respondWithResult(_0x5eba81,null))['catch'](handleError(_0x5eba81,null));};exports[_0xbf75('0xb8')]=function(_0x4ffdc2,_0x4f7308,_0x595cb4){var _0x3fe0ff={'raw':![],'where':{}};var _0x5c4d60={};var _0x54d354={'count':0x0,'rows':[]};return db[_0xbf75('0x99')]['findOne']({'where':{'id':_0x4ffdc2[_0xbf75('0xb2')]['id']}})[_0xbf75('0x27')](handleEntityNotFound(_0x4f7308,null))[_0xbf75('0x27')](function(_0x1e2843){if(_0x1e2843){_0x5c4d60[_0xbf75('0x38')]=_['keys'](db[_0xbf75('0xb5')][_0xbf75('0x36')]);_0x5c4d60[_0xbf75('0x39')]=_[_0xbf75('0x3a')](_0x4ffdc2[_0xbf75('0x39')]);_0x5c4d60[_0xbf75('0x3b')]=_[_0xbf75('0x3d')](_0x5c4d60[_0xbf75('0x38')],_0x5c4d60[_0xbf75('0x39')]);_0x3fe0ff[_0xbf75('0x3c')]=_[_0xbf75('0x3d')](_0x5c4d60['model'],qs[_0xbf75('0x3e')](_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x3e')]));_0x3fe0ff[_0xbf75('0x3c')]=_0x3fe0ff[_0xbf75('0x3c')][_0xbf75('0x3f')]?_0x3fe0ff[_0xbf75('0x3c')]:_0x5c4d60[_0xbf75('0x38')];if(!_0x4ffdc2['query']['hasOwnProperty'](_0xbf75('0xb9'))){_0x3fe0ff[_0xbf75('0x1e')]=qs['limit'](_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x1e')]);_0x3fe0ff[_0xbf75('0x1d')]=qs[_0xbf75('0x1d')](_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x1d')]);}_0x3fe0ff[_0xbf75('0x40')]=qs[_0xbf75('0x41')](_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x41')]);_0x3fe0ff[_0xbf75('0x42')]=qs['filters'](_[_0xbf75('0x43')](_0x4ffdc2[_0xbf75('0x39')],_0x5c4d60['filters']));_0x3fe0ff[_0xbf75('0x42')]['FaxInteractionId']=_0x1e2843['id'];if(_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x80')]){_0x3fe0ff['where']=_[_0xbf75('0x98')](_0x3fe0ff[_0xbf75('0x42')],{'$or':_[_0xbf75('0x2d')](_0x3fe0ff[_0xbf75('0x3c')],function(_0x16bc4a){var _0x29bdec={};_0x29bdec[_0x16bc4a]={'$like':'%'+_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x80')]+'%'};return _0x29bdec;})});}if(_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x77')]){var _0x2e944b=_0x4ffdc2[_0xbf75('0x39')][_0xbf75('0x77')][_0xbf75('0x31')](',');var _0x371f42={};_0x371f42[_0x2e944b[0x0]]={'$gte':moment(_0x2e944b[0x1])['format'](_0xbf75('0xba'))};_0x3fe0ff[_0xbf75('0x42')]=_[_0xbf75('0x98')](_0x3fe0ff['where'],_0x371f42);}_0x3fe0ff=_['merge']({},_0x3fe0ff,_0x4ffdc2[_0xbf75('0xbb')]);return db['FaxMessage']['count']({'where':_0x3fe0ff[_0xbf75('0x42')]})[_0xbf75('0x27')](function(_0x3e6daf){_0x54d354[_0xbf75('0x20')]=_0x3e6daf;if(_0x4ffdc2[_0xbf75('0x39')]['includeAll']){_0x3fe0ff[_0xbf75('0xb0')]=[{'all':!![]}];}return db['FaxMessage'][_0xbf75('0xbc')](_0x3fe0ff);})['then'](function(_0x6e371d){_0x54d354[_0xbf75('0xaf')]=_0x6e371d;return _0x54d354;});}})[_0xbf75('0x27')](respondWithFilteredResult(_0x4f7308,_0x3fe0ff))['catch'](handleError(_0x4f7308,null));};exports[_0xbf75('0xbd')]=function(_0x17fc1e,_0x1f4e8d,_0x113085){return db['FaxInteraction'][_0xbf75('0x5c')]({'where':{'id':_0x17fc1e['params']['id']}})[_0xbf75('0x27')](handleEntityNotFound(_0x1f4e8d,null))['then'](function(_0x84837e){if(_0x84837e){return _0x84837e[_0xbf75('0xbe')](_0x17fc1e[_0xbf75('0x6f')][_0xbf75('0xb6')],_[_0xbf75('0xb7')](_0x17fc1e[_0xbf75('0x6f')],[_0xbf75('0xb6'),'id'])||{})[_0xbf75('0xbf')](function(){return db[_0xbf75('0x69')][_0xbf75('0xbc')]({'attributes':['id',_0xbf75('0x2b'),_0xbf75('0x46')],'where':{'id':_0x17fc1e[_0xbf75('0x6f')][_0xbf75('0xb6')]}});})[_0xbf75('0x27')](function(_0x4a2e80){socket[_0xbf75('0xc0')](_0xbf75('0xc1'),{'id':Number(_0x17fc1e['params']['id']),'tags':_0x4a2e80||[]});return{'id':Number(_0x17fc1e[_0xbf75('0xb2')]['id']),'tags':_0x4a2e80||[]};});}})[_0xbf75('0x27')](respondWithResult(_0x1f4e8d,null))[_0xbf75('0x34')](handleError(_0x1f4e8d,null));};exports[_0xbf75('0xc2')]=function(_0x10d456,_0x804406,_0x421bd8){return db[_0xbf75('0x99')][_0xbf75('0x5c')]({'where':{'id':_0x10d456[_0xbf75('0xb2')]['id']}})[_0xbf75('0x27')](handleEntityNotFound(_0x804406,null))[_0xbf75('0x27')](function(_0x2a2761){if(_0x2a2761){return _0x2a2761[_0xbf75('0xc2')](_0x10d456[_0xbf75('0x39')]['ids']);}})[_0xbf75('0x27')](respondWithStatusCode(_0x804406,null))[_0xbf75('0x34')](handleError(_0x804406,null));};exports['download']=function(_0x529272,_0x1a6d9a){var _0x3db060=moment()[_0xbf75('0xc3')]()[_0xbf75('0x97')]();var _0xd06a96=path['join'](config[_0xbf75('0xc4')],_0xbf75('0xc5'),_0xbf75('0xc6'),_0xbf75('0xc7'));var _0x5f52eb=path[_0xbf75('0xc8')](config[_0xbf75('0xc4')],_0xbf75('0xc5'),_0xbf75('0xc6'),'attachments');var _0xadd88f=path[_0xbf75('0xc8')](_0xd06a96,_0x3db060);var _0x4cb992=util[_0xbf75('0xc9')](_0xbf75('0xca'),_0x529272[_0xbf75('0xb2')]['id'],_0x3db060);var _0x2b8fda=path[_0xbf75('0xc8')](_0xd06a96,_0x4cb992);var _0x1f968f=[];_0x1f968f['push']({'model':db[_0xbf75('0xcb')],'as':_0xbf75('0xcb'),'raw':!![]});var _0x4d86f2=[{'model':db[_0xbf75('0xb5')],'as':'Messages','attributes':['id',_0xbf75('0x6f'),_0xbf75('0x75')],'include':_0x1f968f}];return db['FaxInteraction'][_0xbf75('0x5c')]({'where':{'id':_0x529272[_0xbf75('0xb2')]['id']},'include':_0x4d86f2})[_0xbf75('0x27')](handleEntityNotFound(_0x1a6d9a,null))[_0xbf75('0x27')](function(_0x33793b){if(_0x33793b&&_0x33793b[_0xbf75('0xcc')]){var _0xc064ef=_0x33793b[_0xbf75('0xcd')]({'plain':!![]});fs[_0xbf75('0xce')](_0xadd88f);for(var _0x1852b2=0x0;_0x1852b2<_0xc064ef[_0xbf75('0xcc')]['length'];_0x1852b2++){var _0x1b6616=_0xc064ef['Messages'][_0x1852b2][_0xbf75('0xcb')];if(_0x1b6616){var _0x108266=path['join'](_0x5f52eb,_0x1b6616[_0xbf75('0xcf')]);if(fs[_0xbf75('0xd0')](_0x108266)){fs[_0xbf75('0xd1')](_0x108266)[_0xbf75('0xd2')](fs['createWriteStream'](path[_0xbf75('0xc8')](_0xadd88f,_0x1b6616['basename'])));}}}return BPromise['resolve']()[_0xbf75('0x27')](function(){return new BPromise(function(_0x32bed5,_0x4845b6){zipdir(_0xadd88f,{'saveTo':_0x2b8fda},function(_0xeb55ec,_0x2c1ec0){if(_0xeb55ec)return _0x4845b6(_0xeb55ec);return _0x32bed5(_0x2c1ec0);});})['then'](function(){return new BPromise(function(_0x1ac3a5,_0x19b763){rimraf(_0xadd88f,function(_0x1bffa7){if(_0x1bffa7)_0x19b763(_0x1bffa7);return _0x1ac3a5();});});})[_0xbf75('0x27')](function(){return _0x1a6d9a[_0xbf75('0xd3')](_0x2b8fda,_0x4cb992,function(_0x1c24f4){if(_0x1c24f4){console['log'](_0xbf75('0xd4'),_0x1c24f4);}else{fs['unlinkSync'](_0x2b8fda);}});});});}else{return _0x1a6d9a[_0xbf75('0xd5')](0xc8);}})['catch'](handleError(_0x1a6d9a,null));}; \ No newline at end of file +var _0x1268=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','index','rawAttributes','fieldName','type','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','Tag','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','keys','some','compact','isEmpty','forEach','i.FaxAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','FaxAccountId','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','FaxInteractionId','all','catch','show','params','model','includeAll','options','create','body','describe','addMessage','FaxMessage','omit','ids','getMessages','filter','format','findAll','rows','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','err','unlinkSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3bd62b,_0x462105){var _0x578cd4=function(_0x1f4336){while(--_0x1f4336){_0x3bd62b['push'](_0x3bd62b['shift']());}};_0x578cd4(++_0x462105);}(_0x1268,0xc2));var _0x8126=function(_0x322ee7,_0x584ca2){_0x322ee7=_0x322ee7-0x0;var _0x53c66d=_0x1268[_0x322ee7];return _0x53c66d;};'use strict';var emlformat=require(_0x8126('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8126('0x1'));var rp=require('request-promise');var moment=require(_0x8126('0x2'));var BPromise=require(_0x8126('0x3'));var Mustache=require(_0x8126('0x4'));var util=require(_0x8126('0x5'));var path=require(_0x8126('0x6'));var sox=require(_0x8126('0x7'));var csv=require('to-csv');var ejs=require(_0x8126('0x8'));var fs=require('fs');var fs_extra=require(_0x8126('0x9'));var _=require(_0x8126('0xa'));var squel=require(_0x8126('0xb'));var crypto=require(_0x8126('0xc'));var jsforce=require(_0x8126('0xd'));var deskjs=require(_0x8126('0xe'));var toCsv=require(_0x8126('0xf'));var querystring=require('querystring');var Papa=require(_0x8126('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8126('0x11'));var as=require(_0x8126('0x12'));var hardwareService=require(_0x8126('0x13'));var logger=require(_0x8126('0x14'))(_0x8126('0x15'));var utils=require('../../config/utils');var config=require(_0x8126('0x16'));var licenseUtil=require(_0x8126('0x17'));var db=require(_0x8126('0x18'))['db'];config[_0x8126('0x19')]=_[_0x8126('0x1a')](config[_0x8126('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8126('0x1b'))(new Redis(config[_0x8126('0x19')]));require(_0x8126('0x1c'))[_0x8126('0x1d')](socket);function respondWithStatusCode(_0x280df1,_0x1157c3){_0x1157c3=_0x1157c3||0xcc;return function(_0x3b9cbb){if(_0x3b9cbb){return _0x280df1[_0x8126('0x1e')](_0x1157c3);}return _0x280df1[_0x8126('0x1f')](_0x1157c3)[_0x8126('0x20')]();};}function respondWithResult(_0x1424d6,_0x1a9469){_0x1a9469=_0x1a9469||0xc8;return function(_0x1cc696){if(_0x1cc696){return _0x1424d6[_0x8126('0x1f')](_0x1a9469)[_0x8126('0x21')](_0x1cc696);}};}function respondWithFilteredResult(_0x5bc230,_0x1ceee6){return function(_0x4afdf7){if(_0x4afdf7){var _0x40e8a4=typeof _0x1ceee6[_0x8126('0x22')]===_0x8126('0x23')&&typeof _0x1ceee6[_0x8126('0x24')]==='undefined';var _0x3c66a5=_0x4afdf7[_0x8126('0x25')];var _0x2df6d6=_0x40e8a4?0x0:_0x1ceee6[_0x8126('0x22')];var _0xc54977=_0x40e8a4?_0x4afdf7[_0x8126('0x25')]:_0x1ceee6[_0x8126('0x22')]+_0x1ceee6[_0x8126('0x24')];var _0xf49f93;if(_0xc54977>=_0x3c66a5){_0xc54977=_0x3c66a5;_0xf49f93=0xc8;}else{_0xf49f93=0xce;}_0x5bc230[_0x8126('0x1f')](_0xf49f93);return _0x5bc230['set']('Content-Range',_0x2df6d6+'-'+_0xc54977+'/'+_0x3c66a5)['json'](_0x4afdf7);}return null;};}function patchUpdates(_0x10faa0){return function(_0x1ce854){try{jsonpatch[_0x8126('0x26')](_0x1ce854,_0x10faa0,!![]);}catch(_0x3a3c83){return BPromise[_0x8126('0x27')](_0x3a3c83);}return _0x1ce854['save']();};}function saveUpdates(_0x5d05d6,_0x43b2cb){return function(_0x476246){if(_0x476246){return _0x476246[_0x8126('0x28')](_0x5d05d6)['then'](function(_0x59d6ff){return _0x59d6ff;});}return null;};}function removeEntity(_0x383034,_0x4bd36b){return function(_0x106124){if(_0x106124){return _0x106124[_0x8126('0x29')]()[_0x8126('0x2a')](function(){_0x383034[_0x8126('0x1f')](0xcc)[_0x8126('0x20')]();});}};}function handleEntityNotFound(_0x88a86d,_0x4e2962){return function(_0x1e0839){if(!_0x1e0839){_0x88a86d[_0x8126('0x1e')](0x194);}return _0x1e0839;};}function handleError(_0x442d25,_0x2b661c){_0x2b661c=_0x2b661c||0x1f4;return function(_0x5f4ec9){logger[_0x8126('0x2b')](_0x5f4ec9[_0x8126('0x2c')]);if(_0x5f4ec9[_0x8126('0x2d')]){delete _0x5f4ec9[_0x8126('0x2d')];}_0x442d25[_0x8126('0x1f')](_0x2b661c)[_0x8126('0x2e')](_0x5f4ec9);};}function getInteractionUsers(_0x2edc28,_0x3606e9){return new BPromise(function(_0x4d14a0,_0x19955a){try{if(_0x3606e9[_0x2edc28['id']]){_0x2edc28[_0x8126('0x2f')]=_[_0x8126('0x30')](_0x3606e9[_0x2edc28['id']],function(_0x3cdaf3){return{'id':_0x3cdaf3['id'],'fullname':_0x3cdaf3[_0x8126('0x31')]};});}}catch(_0x48f826){_0x19955a(_0x48f826);}_0x4d14a0(_0x2edc28);});}function getInteractionTags(_0x495144,_0x4de14c){return new BPromise(function(_0x5e962f,_0x101e10){try{if(_0x495144[_0x8126('0x32')]){_0x495144[_0x8126('0x33')]=[];_0x495144[_0x8126('0x32')][_0x8126('0x34')](',')['forEach'](function(_0x576622){_0x495144[_0x8126('0x33')][_0x8126('0x35')](_0x4de14c[_0x576622]);});}delete _0x495144[_0x8126('0x32')];}catch(_0x321a09){_0x101e10(_0x321a09);}_0x5e962f(_0x495144);});}function updateFaxInteraction(_0x258667,_0x12fefa,_0xb8c690){return new BPromise(function(_0x31b370,_0x1fec20){return getInteractionUsers(_0x258667,_0xb8c690)[_0x8126('0x2a')](function(_0x9d9c49){return getInteractionTags(_0x9d9c49,_0x12fefa);})[_0x8126('0x2a')](function(_0x242ff4){_0x31b370(_0x242ff4);})['catch'](function(_0x83e79){_0x1fec20(_0x83e79);});});}exports[_0x8126('0x36')]=function(_0xec0c27,_0x6ab868){var _0x5aea58={},_0x588ec4={},_0x4a0be6={'count':0x0,'rows':[]};var _0x23418b=_[_0x8126('0x30')](db['FaxInteraction'][_0x8126('0x37')],function(_0x538204){return{'name':_0x538204[_0x8126('0x38')],'type':_0x538204[_0x8126('0x39')]['key']};});_0x588ec4['model']=_[_0x8126('0x30')](_0x23418b,_0x8126('0x2d'));_0x588ec4[_0x8126('0x3a')]=_['keys'](_0xec0c27[_0x8126('0x3a')]);_0x588ec4[_0x8126('0x3b')]=_[_0x8126('0x3c')](_0x588ec4['model'],_0x588ec4[_0x8126('0x3a')]);_0x5aea58['attributes']=_['intersection'](_0x588ec4['model'],qs[_0x8126('0x3d')](_0xec0c27[_0x8126('0x3a')]['fields']));_0x5aea58[_0x8126('0x3e')]=_0x5aea58['attributes'][_0x8126('0x3f')]?_0x5aea58['attributes']:_0x588ec4['model'];if(!_0xec0c27[_0x8126('0x3a')][_0x8126('0x40')](_0x8126('0x41'))){_0x5aea58[_0x8126('0x24')]=qs['limit'](_0xec0c27[_0x8126('0x3a')][_0x8126('0x24')]);_0x5aea58[_0x8126('0x22')]=qs[_0x8126('0x22')](_0xec0c27[_0x8126('0x3a')]['offset']);}_0x5aea58[_0x8126('0x42')]=qs[_0x8126('0x43')](_0xec0c27[_0x8126('0x3a')][_0x8126('0x43')]);_0x5aea58[_0x8126('0x44')]=qs[_0x8126('0x3b')](_[_0x8126('0x45')](_0xec0c27[_0x8126('0x3a')],_0x588ec4[_0x8126('0x3b')]),_0x23418b);var _0x5d547b=[];var _0x36745b=squel[_0x8126('0x46')]()[_0x8126('0x47')]('id')[_0x8126('0x47')](_0x8126('0x2d'))[_0x8126('0x47')](_0x8126('0x48'))[_0x8126('0x49')](_0x8126('0x4a'));var _0x3512cd=squel[_0x8126('0x46')]()[_0x8126('0x47')](_0x8126('0x4b'))[_0x8126('0x47')](_0x8126('0x4c'))[_0x8126('0x47')](_0x8126('0x4d'))[_0x8126('0x49')](_0x8126('0x4e'),'ui')['left_join'](_0x8126('0x4f'),'u',_0x8126('0x50'));var _0x1fa1ed=squel[_0x8126('0x46')]()['from'](_0x8126('0x51'),'i')[_0x8126('0x52')](_0x8126('0x53'),'c',_0x8126('0x54'))['left_join'](_0x8126('0x4f'),'o',_0x8126('0x55'))[_0x8126('0x52')](_0x8126('0x56'),'a',_0x8126('0x57'))[_0x8126('0x52')](_0x8126('0x58'),'me',_0x8126('0x59'))['left_join'](_0x8126('0x5a'),'it',_0x8126('0x5b'))[_0x8126('0x52')](_0x8126('0x4a'),'t',_0x8126('0x5c'));var _0x4b939f=squel[_0x8126('0x5d')]();var _0x6ee793=[];var _0x391a32=squel['expr']();var _0x2f1c3c;if(_0xec0c27['query']['search']){_0x2f1c3c=as[_0x8126('0x5e')](_0xec0c27[_0x8126('0x3a')][_0x8126('0x5f')]);var _0x269157=_0x2f1c3c[_0x8126('0x60')];for(var _0x5442e8=0x0;_0x5442e8<_0x2f1c3c['conditions'][_0x8126('0x3f')];_0x5442e8++){var _0x1d7b39=_0x2f1c3c['conditions'][_0x5442e8];var _0x4029f8='i';var _0x41c296=_[_0x8126('0x61')](_0x23418b,[_0x8126('0x2d'),_0x1d7b39['field']]);if(!_0x41c296){switch(_0x1d7b39[_0x8126('0x47')]){case _0x8126('0x62'):if(_0x1d7b39[_0x8126('0x63')]==0x1){_0x1fa1ed[_0x8126('0x64')]('`'+_0x1d7b39[_0x8126('0x47')]+_0x8126('0x65'));}else{_0x1fa1ed[_0x8126('0x64')]('`'+_0x1d7b39[_0x8126('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x1d7b39['operator']===_0x8126('0x66')){if(_0x1d7b39[_0x8126('0x63')][_0x8126('0x34')]('\x20')[_0x8126('0x3f')]>0x1){_0x4b939f[_0x269157](_0x8126('0x67'),qs[_0x8126('0x68')](_0x1d7b39['value']),null);}else{var _0x8cdb32='%'+_0x1d7b39['value']+'%';_0x4b939f[_0x269157]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x8cdb32,_0x8cdb32,_0x8cdb32);}}else{_0x41c296=_[_0x8126('0x61')](_0x23418b,[_0x8126('0x2d'),'ContactId']);_0x1d7b39[_0x8126('0x47')]=_0x8126('0x69');_0x2ad27f=as['buildExpression'](_0x4029f8,_0x41c296[_0x8126('0x39')],_0x1d7b39);_0x4b939f[_0x269157](_0x2ad27f[_0x8126('0x6a')],_0x2ad27f['value']['start'],_0x2ad27f[_0x8126('0x63')][_0x8126('0x20')]);}break;case _0x8126('0x6b'):var _0xd293b8=_0x1d7b39[_0x8126('0x63')]['split'](',')['map'](function(_0x1286bc){return Number(_0x1286bc);});_0xd293b8['forEach'](function(_0x3a589e){_0x391a32['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a589e+',%');});_0x6ee793=_['union'](_0x6ee793,_0xd293b8);break;case _0x8126('0x6c'):if(_0x1d7b39[_0x8126('0x6d')]===_0x8126('0x66')){_0x4b939f[_0x269157](_0x8126('0x6e'),'%'+_0x1d7b39[_0x8126('0x63')]+'%',null);}else{_0x41c296=_[_0x8126('0x61')](_0x23418b,['name','UserId']);_0x1d7b39[_0x8126('0x47')]=_0x8126('0x6f');_0x2ad27f=as[_0x8126('0x70')](_0x4029f8,_0x41c296['type'],_0x1d7b39);_0x4b939f[_0x269157](_0x2ad27f[_0x8126('0x6a')],_0x2ad27f[_0x8126('0x63')][_0x8126('0x71')],_0x2ad27f['value'][_0x8126('0x20')]);}break;case'body':_0x2ad27f=as[_0x8126('0x70')]('me',null,_0x1d7b39);_0x4b939f[_0x269157](_0x2ad27f[_0x8126('0x6a')],_0x2ad27f[_0x8126('0x63')][_0x8126('0x71')],_0x2ad27f[_0x8126('0x63')][_0x8126('0x20')]);break;}}else{var _0x2ad27f=as[_0x8126('0x70')](_0x4029f8,_0x41c296['type'],_0x1d7b39);_0x4b939f[_0x269157](_0x2ad27f[_0x8126('0x6a')],_0x2ad27f[_0x8126('0x63')][_0x8126('0x71')],_0x2ad27f[_0x8126('0x63')]['end']);}}}else{var _0x38ed5a=_(_0xec0c27[_0x8126('0x3a')])[_0x8126('0x72')]()['map'](function(_0x37ce2d){return _[_0x8126('0x73')](_0x23418b,['name',_0x37ce2d])?_0x37ce2d:undefined;})[_0x8126('0x74')]()[_0x8126('0x63')]();if(!_[_0x8126('0x75')](_0x38ed5a)){_0x38ed5a[_0x8126('0x76')](function(_0x238929){if(_0x238929==='FaxAccountId'){_0x1fa1ed['where'](_0x8126('0x77'),[]['concat'](_0xec0c27['query'][_0x238929]));}else if(_0x238929===_0x8126('0x78')){var _0x43aa52=JSON['parse'](_0xec0c27[_0x8126('0x3a')][_0x238929])[_0x8126('0x79')];var _0x3db036=JSON[_0x8126('0x7a')](_0xec0c27['query'][_0x238929])[_0x8126('0x7b')];_0x1fa1ed[_0x8126('0x44')](_0x8126('0x7c'),_0x43aa52,_0x3db036);}else{if(_0xec0c27[_0x8126('0x3a')][_0x238929]==='null'){_0x1fa1ed[_0x8126('0x44')]('i.'+_0x238929+_0x8126('0x7d'));}else{_0x1fa1ed[_0x8126('0x44')]('i.'+_0x238929+'\x20=\x20?',_0xec0c27[_0x8126('0x3a')][_0x238929]);}}});}if(_0xec0c27['query'][_0x8126('0x7e')]){if(_0xec0c27[_0x8126('0x3a')][_0x8126('0x7e')]==0x1){_0x1fa1ed[_0x8126('0x64')](_0x8126('0x7f'));}else{_0x1fa1ed[_0x8126('0x64')](_0x8126('0x80'));}}if(_0xec0c27['query'][_0x8126('0x81')]){_0x6ee793=_[_0x8126('0x82')](_0xec0c27['query'][_0x8126('0x81')])?_0xec0c27['query'][_0x8126('0x81')]:new Array(_0xec0c27[_0x8126('0x3a')][_0x8126('0x81')]);_0x6ee793[_0x8126('0x76')](function(_0x1fbc19){_0x391a32['or'](_0x8126('0x83'),'%,'+_0x1fbc19+',%');});}if(_0xec0c27[_0x8126('0x3a')]['filter']){var _0xb993b=_0xec0c27[_0x8126('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0x8126('0x84')](/'/g,'\x27\x27');if(qs[_0x8126('0x85')](_0xb993b)){_0x4b939f['or'](_0x8126('0x86'),_0xb993b+'%')['or'](_0x8126('0x87'),_0xb993b+'%');}_0x4b939f['or'](_0x8126('0x88'),_0xb993b+'%');}}_0x1fa1ed[_0x8126('0x44')](_0x4b939f);_0x1fa1ed[_0x8126('0x89')](_0x8126('0x8a'));var _0xf52fbb={'type':db['Sequelize']['QueryTypes'][_0x8126('0x8b')],'raw':!![]};var _0x27ead6=_0x1fa1ed[_0x8126('0x8c')]();_0x27ead6[_0x8126('0x47')](_0x8126('0x8a'));_0x27ead6['field'](_0x8126('0x8d'),_0x8126('0x62'));if(_0x5aea58[_0x8126('0x42')]){_0x5aea58['order']['forEach'](function(_0xd8c7a8){var _0x5522df=_0xd8c7a8[0x0]===_0x8126('0x8e')?_0xd8c7a8[0x0]:'i.'+_0xd8c7a8[0x0];_0x1fa1ed[_0x8126('0x42')](_0x5522df,_0xd8c7a8[0x1]===_0x8126('0x8f')?![]:!![]);});}if(!_[_0x8126('0x75')](_0x6ee793)){_0x1fa1ed[_0x8126('0x64')](_0x391a32);_0x27ead6[_0x8126('0x44')]('t.id\x20IN\x20?',_0x6ee793);}BPromise[_0x8126('0x90')]()[_0x8126('0x2a')](function(){if(!_0x2f1c3c){if(_0xec0c27['query']['FaxAccountId'])return;_0x27ead6[_0x8126('0x44')](_0x8126('0x91'));_0x1fa1ed['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xec0c27[_0x8126('0x92')][_0x8126('0x93')]!==_0x8126('0x94'))return;return _0xec0c27[_0x8126('0x92')][_0x8126('0x95')]({'attributes':['id'],'raw':!![]})[_0x8126('0x2a')](function(_0x4b60e4){if(_[_0x8126('0x75')](_0x4b60e4)){_0x27ead6['where'](_0x8126('0x96'));_0x1fa1ed[_0x8126('0x44')](_0x8126('0x96'));}else{_0x27ead6[_0x8126('0x44')](_0x8126('0x77'),_['map'](_0x4b60e4,'id'));_0x1fa1ed[_0x8126('0x44')](_0x8126('0x77'),_[_0x8126('0x30')](_0x4b60e4,'id'));}});})[_0x8126('0x2a')](function(){if(_0xec0c27['user']['role']===_0x8126('0x94')&&!_0x2f1c3c&&!_0xec0c27[_0x8126('0x3a')][_0x8126('0x97')])return[];return db[_0x8126('0x98')][_0x8126('0x3a')](_0x27ead6[_0x8126('0x99')](),_0xf52fbb);})[_0x8126('0x2a')](function(_0x300abb){_0x4a0be6[_0x8126('0x25')]=_0x300abb['length'];if(_0x4a0be6[_0x8126('0x25')]===0x0)return[];return db[_0x8126('0x98')][_0x8126('0x3a')](_0x36745b[_0x8126('0x99')](),_0xf52fbb)[_0x8126('0x2a')](function(_0x12b4a6){_0x5d547b=_[_0x8126('0x9a')](_0x12b4a6,'id');_0xf52fbb=_[_0x8126('0x9b')](_0xf52fbb,{'model':db[_0x8126('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xec0c27[_0x8126('0x3a')][_0x8126('0x3d')]){_0x5aea58[_0x8126('0x3e')][_0x8126('0x76')](function(_0xb1f29){_0x1fa1ed[_0x8126('0x47')]('i.'+_0xb1f29);});}else{_0x1fa1ed['field'](_0x8126('0x8d'),_0x8126('0x62'));_0x1fa1ed['field'](_0x8126('0x9d'),'Account.key');_0x1fa1ed['field']('a.mandatoryDisposition',_0x8126('0x9e'));_0x1fa1ed['field'](_0x8126('0x9f'),_0x8126('0x8e'));_0x1fa1ed[_0x8126('0x47')]('i.*');_0x1fa1ed[_0x8126('0x47')](_0x8126('0xa0'),_0x8126('0xa1'));_0x1fa1ed[_0x8126('0x47')](_0x8126('0xa2'),'Contact.lastName');_0x1fa1ed[_0x8126('0x47')](_0x8126('0xa3'),_0x8126('0xa4'));_0x1fa1ed['field']('c.phone',_0x8126('0xa5'));_0x1fa1ed['field']('c.mobile',_0x8126('0xa6'));_0x1fa1ed['field'](_0x8126('0xa7'),_0x8126('0xa8'));_0x1fa1ed[_0x8126('0x47')](_0x8126('0xa9'),_0x8126('0xaa'));_0x1fa1ed['field'](_0x8126('0xab'),_0x8126('0xac'));_0x1fa1ed[_0x8126('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8126('0x32'));}if(_0x5aea58['limit'])_0x1fa1ed[_0x8126('0x24')](_0x5aea58[_0x8126('0x24')]);if(_0x5aea58[_0x8126('0x22')])_0x1fa1ed['offset'](_0x5aea58[_0x8126('0x22')]);return db[_0x8126('0x98')]['query'](_0x1fa1ed[_0x8126('0x99')](),_0xf52fbb);})['then'](function(_0x2d2ade){if(_0x2d2ade[_0x8126('0x3f')]>0x0)_0x3512cd[_0x8126('0x44')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x2d2ade,'id'));return db['sequelize'][_0x8126('0x3a')](_0x3512cd[_0x8126('0x99')](),_0xf52fbb)[_0x8126('0x2a')](function(_0x3d8c8b){var _0x5b210e=_['groupBy'](_0x3d8c8b,_0x8126('0xad'));var _0x5bb464=[];_0x2d2ade[_0x8126('0x76')](function(_0x16f5a6){_0x5bb464[_0x8126('0x35')](updateFaxInteraction(_0x16f5a6,_0x5d547b,_0x5b210e));});return BPromise[_0x8126('0xae')](_0x5bb464);});});})[_0x8126('0x2a')](function(_0x10b0f2){_0x4a0be6['rows']=_0x10b0f2;return _0x4a0be6;})[_0x8126('0x2a')](respondWithFilteredResult(_0x6ab868,_0x5aea58))[_0x8126('0xaf')](handleError(_0x6ab868,null));};exports[_0x8126('0xb0')]=function(_0x92ce8c,_0x1d6376){var _0x4f531d={'raw':![],'where':{'id':_0x92ce8c[_0x8126('0xb1')]['id']}},_0x535291={};_0x535291['model']=_['keys'](db[_0x8126('0x9c')][_0x8126('0x37')]);_0x535291['query']=_[_0x8126('0x72')](_0x92ce8c[_0x8126('0x3a')]);_0x535291[_0x8126('0x3b')]=_[_0x8126('0x3c')](_0x535291[_0x8126('0xb2')],_0x535291['query']);_0x4f531d['attributes']=_[_0x8126('0x3c')](_0x535291['model'],qs['fields'](_0x92ce8c[_0x8126('0x3a')][_0x8126('0x3d')]));_0x4f531d[_0x8126('0x3e')]=_0x4f531d[_0x8126('0x3e')][_0x8126('0x3f')]?_0x4f531d['attributes']:_0x535291['model'];if(_0x92ce8c[_0x8126('0x3a')][_0x8126('0xb3')]){_0x4f531d['include']=[{'all':!![]}];}_0x4f531d=_[_0x8126('0x9b')]({},_0x4f531d,_0x92ce8c[_0x8126('0xb4')]);return db['FaxInteraction'][_0x8126('0x61')](_0x4f531d)[_0x8126('0x2a')](handleEntityNotFound(_0x1d6376,null))[_0x8126('0x2a')](respondWithResult(_0x1d6376,null))[_0x8126('0xaf')](handleError(_0x1d6376,null));};exports[_0x8126('0xb5')]=function(_0x470e70,_0x3caaf8){return db['FaxInteraction'][_0x8126('0xb5')](_0x470e70[_0x8126('0xb6')],{})[_0x8126('0x2a')](respondWithResult(_0x3caaf8,0xc9))[_0x8126('0xaf')](handleError(_0x3caaf8,null));};exports[_0x8126('0x28')]=function(_0x2c3751,_0x3afba4){if(_0x2c3751[_0x8126('0xb6')]['id']){delete _0x2c3751[_0x8126('0xb6')]['id'];}return db['FaxInteraction'][_0x8126('0x61')]({'where':{'id':_0x2c3751[_0x8126('0xb1')]['id']}})[_0x8126('0x2a')](handleEntityNotFound(_0x3afba4,null))[_0x8126('0x2a')](saveUpdates(_0x2c3751[_0x8126('0xb6')],null))['then'](respondWithResult(_0x3afba4,null))['catch'](handleError(_0x3afba4,null));};exports[_0x8126('0x29')]=function(_0x332ba2,_0x5bf1c0){return db[_0x8126('0x9c')][_0x8126('0x61')]({'where':{'id':_0x332ba2[_0x8126('0xb1')]['id']}})[_0x8126('0x2a')](handleEntityNotFound(_0x5bf1c0,null))[_0x8126('0x2a')](removeEntity(_0x5bf1c0,null))[_0x8126('0xaf')](handleError(_0x5bf1c0,null));};exports[_0x8126('0xb7')]=function(_0x26df9e,_0x5c85bf){return db[_0x8126('0x9c')][_0x8126('0xb7')]()[_0x8126('0x2a')](respondWithResult(_0x5c85bf,null))[_0x8126('0xaf')](handleError(_0x5c85bf,null));};exports[_0x8126('0xb8')]=function(_0x978856,_0x1cbd1f,_0x342215){return db[_0x8126('0xb9')][_0x8126('0x61')]({'where':{'id':_0x978856[_0x8126('0xb1')]['id']}})[_0x8126('0x2a')](handleEntityNotFound(_0x1cbd1f,null))[_0x8126('0x2a')](function(_0x395b70){if(_0x395b70){return _0x395b70[_0x8126('0xb8')](_0x978856[_0x8126('0xb6')]['ids'],_[_0x8126('0xba')](_0x978856[_0x8126('0xb6')],[_0x8126('0xbb'),'id'])||{});}})[_0x8126('0x2a')](respondWithResult(_0x1cbd1f,null))[_0x8126('0xaf')](handleError(_0x1cbd1f,null));};exports[_0x8126('0xbc')]=function(_0x526842,_0x42b02f,_0x406c5d){var _0x2bbcf4={'raw':![],'where':{}};var _0x5d4d59={};var _0x3b85a1={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x526842[_0x8126('0xb1')]['id']}})['then'](handleEntityNotFound(_0x42b02f,null))['then'](function(_0x53d1de){if(_0x53d1de){_0x5d4d59[_0x8126('0xb2')]=_[_0x8126('0x72')](db['FaxMessage'][_0x8126('0x37')]);_0x5d4d59['query']=_[_0x8126('0x72')](_0x526842['query']);_0x5d4d59[_0x8126('0x3b')]=_['intersection'](_0x5d4d59[_0x8126('0xb2')],_0x5d4d59[_0x8126('0x3a')]);_0x2bbcf4[_0x8126('0x3e')]=_[_0x8126('0x3c')](_0x5d4d59[_0x8126('0xb2')],qs['fields'](_0x526842[_0x8126('0x3a')][_0x8126('0x3d')]));_0x2bbcf4[_0x8126('0x3e')]=_0x2bbcf4[_0x8126('0x3e')][_0x8126('0x3f')]?_0x2bbcf4[_0x8126('0x3e')]:_0x5d4d59[_0x8126('0xb2')];if(!_0x526842[_0x8126('0x3a')][_0x8126('0x40')](_0x8126('0x41'))){_0x2bbcf4[_0x8126('0x24')]=qs[_0x8126('0x24')](_0x526842[_0x8126('0x3a')][_0x8126('0x24')]);_0x2bbcf4[_0x8126('0x22')]=qs[_0x8126('0x22')](_0x526842[_0x8126('0x3a')]['offset']);}_0x2bbcf4[_0x8126('0x42')]=qs['sort'](_0x526842[_0x8126('0x3a')][_0x8126('0x43')]);_0x2bbcf4['where']=qs[_0x8126('0x3b')](_[_0x8126('0x45')](_0x526842[_0x8126('0x3a')],_0x5d4d59['filters']));_0x2bbcf4[_0x8126('0x44')]['FaxInteractionId']=_0x53d1de['id'];if(_0x526842['query'][_0x8126('0xbd')]){_0x2bbcf4['where']=_['merge'](_0x2bbcf4['where'],{'$or':_[_0x8126('0x30')](_0x2bbcf4[_0x8126('0x3e')],function(_0x3f4353){var _0x1585f8={};_0x1585f8[_0x3f4353]={'$like':'%'+_0x526842[_0x8126('0x3a')][_0x8126('0xbd')]+'%'};return _0x1585f8;})});}if(_0x526842[_0x8126('0x3a')]['$gte']){var _0xb2f4c1=_0x526842[_0x8126('0x3a')]['$gte'][_0x8126('0x34')](',');var _0x800746={};_0x800746[_0xb2f4c1[0x0]]={'$gte':moment(_0xb2f4c1[0x1])[_0x8126('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2bbcf4[_0x8126('0x44')]=_[_0x8126('0x9b')](_0x2bbcf4['where'],_0x800746);}_0x2bbcf4=_[_0x8126('0x9b')]({},_0x2bbcf4,_0x526842['options']);return db['FaxMessage'][_0x8126('0x25')]({'where':_0x2bbcf4[_0x8126('0x44')]})[_0x8126('0x2a')](function(_0x48c919){_0x3b85a1[_0x8126('0x25')]=_0x48c919;if(_0x526842[_0x8126('0x3a')][_0x8126('0xb3')]){_0x2bbcf4['include']=[{'all':!![]}];}return db['FaxMessage'][_0x8126('0xbf')](_0x2bbcf4);})[_0x8126('0x2a')](function(_0x8f929d){_0x3b85a1[_0x8126('0xc0')]=_0x8f929d;return _0x3b85a1;});}})['then'](respondWithFilteredResult(_0x42b02f,_0x2bbcf4))[_0x8126('0xaf')](handleError(_0x42b02f,null));};exports['addTags']=function(_0x57a9c6,_0x4cd4d1,_0x241d87){return db[_0x8126('0x9c')][_0x8126('0x61')]({'where':{'id':_0x57a9c6[_0x8126('0xb1')]['id']}})['then'](handleEntityNotFound(_0x4cd4d1,null))[_0x8126('0x2a')](function(_0x198495){if(_0x198495){return _0x198495['setTags'](_0x57a9c6['body'][_0x8126('0xbb')],_[_0x8126('0xba')](_0x57a9c6[_0x8126('0xb6')],[_0x8126('0xbb'),'id'])||{})[_0x8126('0xc1')](function(){return db[_0x8126('0x6b')][_0x8126('0xbf')]({'attributes':['id','name','color'],'where':{'id':_0x57a9c6[_0x8126('0xb6')][_0x8126('0xbb')]}});})[_0x8126('0x2a')](function(_0x3afa83){socket[_0x8126('0xc2')](_0x8126('0xc3'),{'id':Number(_0x57a9c6[_0x8126('0xb1')]['id']),'tags':_0x3afa83||[]});return{'id':Number(_0x57a9c6[_0x8126('0xb1')]['id']),'tags':_0x3afa83||[]};});}})['then'](respondWithResult(_0x4cd4d1,null))['catch'](handleError(_0x4cd4d1,null));};exports[_0x8126('0xc4')]=function(_0x296c94,_0x574eb8,_0x4c7d0f){return db['FaxInteraction']['find']({'where':{'id':_0x296c94['params']['id']}})[_0x8126('0x2a')](handleEntityNotFound(_0x574eb8,null))[_0x8126('0x2a')](function(_0x2b3bc3){if(_0x2b3bc3){return _0x2b3bc3['removeTags'](_0x296c94[_0x8126('0x3a')][_0x8126('0xbb')]);}})[_0x8126('0x2a')](respondWithStatusCode(_0x574eb8,null))[_0x8126('0xaf')](handleError(_0x574eb8,null));};exports[_0x8126('0xc5')]=function(_0x15cea7,_0x494efb){var _0x25f666=moment()[_0x8126('0xc6')]()[_0x8126('0x99')]();var _0x578eb9=path['join'](config[_0x8126('0xc7')],_0x8126('0xc8'),_0x8126('0xc9'),_0x8126('0xca'));var _0x12c1fe=path[_0x8126('0xcb')](config[_0x8126('0xc7')],'server',_0x8126('0xc9'),_0x8126('0xcc'));var _0x244a45=path['join'](_0x578eb9,_0x25f666);var _0x529314=util['format']('transcript-%d-%s.zip',_0x15cea7[_0x8126('0xb1')]['id'],_0x25f666);var _0x2b64ac=path[_0x8126('0xcb')](_0x578eb9,_0x529314);var _0x4f8075=[];_0x4f8075['push']({'model':db[_0x8126('0xcd')],'as':_0x8126('0xcd'),'raw':!![]});var _0x2ada0b=[{'model':db[_0x8126('0xb9')],'as':_0x8126('0xce'),'attributes':['id','body',_0x8126('0x78')],'include':_0x4f8075}];return db[_0x8126('0x9c')][_0x8126('0x61')]({'where':{'id':_0x15cea7[_0x8126('0xb1')]['id']},'include':_0x2ada0b})[_0x8126('0x2a')](handleEntityNotFound(_0x494efb,null))[_0x8126('0x2a')](function(_0x5709f2){if(_0x5709f2&&_0x5709f2['Messages']){var _0x983aff=_0x5709f2[_0x8126('0xcf')]({'plain':!![]});fs[_0x8126('0xd0')](_0x244a45);for(var _0x3576a6=0x0;_0x3576a6<_0x983aff['Messages'][_0x8126('0x3f')];_0x3576a6++){var _0x553e10=_0x983aff[_0x8126('0xce')][_0x3576a6][_0x8126('0xcd')];if(_0x553e10){var _0x883fd6=path[_0x8126('0xcb')](_0x12c1fe,_0x553e10[_0x8126('0xd1')]);if(fs[_0x8126('0xd2')](_0x883fd6)){fs[_0x8126('0xd3')](_0x883fd6)[_0x8126('0xd4')](fs[_0x8126('0xd5')](path[_0x8126('0xcb')](_0x244a45,_0x553e10['basename'])));}}}return BPromise['resolve']()[_0x8126('0x2a')](function(){return new BPromise(function(_0x520d78,_0x56b1b6){zipdir(_0x244a45,{'saveTo':_0x2b64ac},function(_0x5ab9f0,_0x43b038){if(_0x5ab9f0)return _0x56b1b6(_0x5ab9f0);return _0x520d78(_0x43b038);});})[_0x8126('0x2a')](function(){return new BPromise(function(_0x24baac,_0x1a747b){rimraf(_0x244a45,function(_0x1ad1ad){if(_0x1ad1ad)_0x1a747b(_0x1ad1ad);return _0x24baac();});});})[_0x8126('0x2a')](function(){return _0x494efb[_0x8126('0xc5')](_0x2b64ac,_0x529314,function(_0x1a8f0b){if(_0x1a8f0b){console['log'](_0x8126('0xd6'),_0x1a8f0b);}else{fs[_0x8126('0xd7')](_0x2b64ac);}});});});}else{return _0x494efb[_0x8126('0x1e')](0xc8);}})[_0x8126('0xaf')](handleError(_0x494efb,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8f7ed00..31dec01 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 _0x8da4=['events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','exports'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0x8da4,0x77));var _0x48da=function(_0x5ad962,_0x3b4f18){_0x5ad962=_0x5ad962-0x0;var _0x2d06d7=_0x8da4[_0x5ad962];return _0x2d06d7;};'use strict';var EventEmitter=require(_0x48da('0x0'));var FaxInteraction=require(_0x48da('0x1'))['db'][_0x48da('0x2')];var FaxMessage=require(_0x48da('0x1'))['db'][_0x48da('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x48da('0x4')](0x0);var events={'afterCreate':_0x48da('0x5'),'afterUpdate':_0x48da('0x6'),'afterDestroy':_0x48da('0x7')};function emitEvent(_0x5ef7c5){return function(_0x50b01b,_0x12c459,_0x4f8b85){_0x50b01b[_0x48da('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x365a9b){_0x50b01b[_0x48da('0x9')]('Users',_0x365a9b[_0x48da('0xa')](function(_0xbe4c04){return{'id':_0xbe4c04['id']};}));return FaxMessage[_0x48da('0xb')]({'where':{'FaxInteractionId':_0x50b01b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x110705){_0x50b01b[_0x48da('0x9')]('unreadMessages',_0x110705[_0x48da('0xc')]);FaxInteractionEvents[_0x48da('0xd')](_0x5ef7c5+':'+_0x50b01b['id'],_0x50b01b);FaxInteractionEvents[_0x48da('0xd')](_0x5ef7c5,_0x50b01b);_0x4f8b85(null);})[_0x48da('0xe')](_0x4f8b85(null));};}for(var e in events){if(events[_0x48da('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x48da('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x129e=['length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages'];(function(_0x5cac5e,_0x529e76){var _0x27bcbe=function(_0x2349cc){while(--_0x2349cc){_0x5cac5e['push'](_0x5cac5e['shift']());}};_0x27bcbe(++_0x529e76);}(_0x129e,0x176));var _0xe129=function(_0x309c84,_0x4b6cd4){_0x309c84=_0x309c84-0x0;var _0x13e5ce=_0x129e[_0x309c84];return _0x13e5ce;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xe129('0x0'))['db'][_0xe129('0x1')];var FaxMessage=require(_0xe129('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe129('0x2'),'afterUpdate':_0xe129('0x3'),'afterDestroy':_0xe129('0x4')};function emitEvent(_0x12e73c){return function(_0x5a483b,_0x2df717,_0x58657c){_0x5a483b[_0xe129('0x5')]({'attributes':['id'],'raw':!![]})[_0xe129('0x6')](function(_0x10d8b2){_0x5a483b[_0xe129('0x7')]('Users',_0x10d8b2['map'](function(_0x54d4fb){return{'id':_0x54d4fb['id']};}));return FaxMessage[_0xe129('0x8')]({'where':{'FaxInteractionId':_0x5a483b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe129('0x6')](function(_0x108124){_0x5a483b['setDataValue'](_0xe129('0x9'),_0x108124[_0xe129('0xa')]);FaxInteractionEvents['emit'](_0x12e73c+':'+_0x5a483b['id'],_0x5a483b);FaxInteractionEvents[_0xe129('0xb')](_0x12e73c,_0x5a483b);_0x58657c(null);})[_0xe129('0xc')](_0x58657c(null));};}for(var e in events){if(events[_0xe129('0xd')](e)){var event=events[e];FaxInteraction[_0xe129('0xe')](e,emitEvent(event));}}module[_0xe129('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 138df15..ce629b8 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 _0xafff=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafff,0x16a));var _0xfaff=function(_0x82de7d,_0x444b41){_0x82de7d=_0x82de7d-0x0;var _0x290c5f=_0xafff[_0x82de7d];return _0x290c5f;};'use strict';var _=require(_0xfaff('0x0'));var util=require(_0xfaff('0x1'));var logger=require(_0xfaff('0x2'))('api');var moment=require(_0xfaff('0x3'));var BPromise=require('bluebird');var rp=require(_0xfaff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfaff('0x5'));var config=require(_0xfaff('0x6'));var attributes=require('./faxInteraction.attributes');module[_0xfaff('0x7')]=function(_0x500efd,_0x1742bb){return _0x500efd[_0xfaff('0x8')](_0xfaff('0x9'),attributes,{'tableName':_0xfaff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e1f75,_0x25cdbf,_0x152a8f){if(_0x2e1f75[_0xfaff('0xb')]('closed')){_0x2e1f75['closedAt']=moment()[_0xfaff('0xc')](_0xfaff('0xd'));}_0x152a8f(null,_0x2e1f75);}}});}; \ No newline at end of file +var _0x2a9a=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','changed','closed','closedAt','format'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x2a9a,0x12d));var _0xa2a9=function(_0x2f5903,_0x599bf0){_0x2f5903=_0x2f5903-0x0;var _0x2d52ed=_0x2a9a[_0x2f5903];return _0x2d52ed;};'use strict';var _=require('lodash');var util=require(_0xa2a9('0x0'));var logger=require(_0xa2a9('0x1'))(_0xa2a9('0x2'));var moment=require(_0xa2a9('0x3'));var BPromise=require(_0xa2a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2a9('0x5'));var rimraf=require(_0xa2a9('0x6'));var config=require(_0xa2a9('0x7'));var attributes=require(_0xa2a9('0x8'));module[_0xa2a9('0x9')]=function(_0x1c3da8,_0x4ac3e7){return _0x1c3da8['define']('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x105f2c,_0x52b177,_0x1a4630){if(_0x105f2c[_0xa2a9('0xa')](_0xa2a9('0xb'))){_0x105f2c[_0xa2a9('0xc')]=moment()[_0xa2a9('0xd')](_0xa2a9('0xe'));}_0x1a4630(null,_0x105f2c);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 36a7c9d..63d911e 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 _0xdca8=['AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','debug','FaxInteraction','find','addTags','ids','omit'];(function(_0x5aa095,_0x2a1831){var _0x3dd1b9=function(_0x184048){while(--_0x184048){_0x5aa095['push'](_0x5aa095['shift']());}};_0x3dd1b9(++_0x2a1831);}(_0xdca8,0x169));var _0x8dca=function(_0x54d352,_0x2951de){_0x54d352=_0x54d352-0x0;var _0x20004f=_0xdca8[_0x54d352];return _0x20004f;};'use strict';var _=require(_0x8dca('0x0'));var util=require('util');var moment=require(_0x8dca('0x1'));var BPromise=require(_0x8dca('0x2'));var rs=require(_0x8dca('0x3'));var fs=require('fs');var Redis=require(_0x8dca('0x4'));var db=require(_0x8dca('0x5'))['db'];var utils=require(_0x8dca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8dca('0x7'));var jayson=require(_0x8dca('0x8'));var client=jayson[_0x8dca('0x9')][_0x8dca('0xa')]({'port':0x232a});config[_0x8dca('0xb')]=_[_0x8dca('0xc')](config[_0x8dca('0xb')],{'host':_0x8dca('0xd'),'port':0x18eb});var socket=require(_0x8dca('0xe'))(new Redis(config[_0x8dca('0xb')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x26fdea,_0x33098a,_0x559e78){return new BPromise(function(_0x43526d,_0x3c6213){return client[_0x8dca('0xf')](_0x26fdea,_0x559e78)[_0x8dca('0x10')](function(_0x364298){logger[_0x8dca('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x33098a,_0x8dca('0x12'));logger['debug'](_0x8dca('0x13'),_0x33098a,_0x8dca('0x12'),JSON[_0x8dca('0x14')](_0x364298));if(_0x364298[_0x8dca('0x15')]){if(_0x364298[_0x8dca('0x15')][_0x8dca('0x16')]===0x1f4){logger[_0x8dca('0x15')](_0x8dca('0x17'),_0x33098a,_0x364298[_0x8dca('0x15')][_0x8dca('0x18')]);return _0x3c6213(_0x364298[_0x8dca('0x15')][_0x8dca('0x18')]);}logger[_0x8dca('0x15')](_0x8dca('0x17'),_0x33098a,_0x364298[_0x8dca('0x15')][_0x8dca('0x18')]);return _0x43526d(_0x364298[_0x8dca('0x15')][_0x8dca('0x18')]);}else{logger[_0x8dca('0x11')](_0x8dca('0x17'),_0x33098a,_0x8dca('0x12'));_0x43526d(_0x364298['result'][_0x8dca('0x18')]);}})[_0x8dca('0x19')](function(_0x50591f){logger[_0x8dca('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x33098a,_0x50591f);_0x3c6213(_0x50591f);});});}exports[_0x8dca('0x1a')]=function(_0x39a40c){var _0x2a65d3=this;return new Promise(function(_0x34977c,_0x1e7858){return db['FaxInteraction'][_0x8dca('0x1b')](_0x39a40c[_0x8dca('0x1c')],{'raw':_0x39a40c[_0x8dca('0x1d')]?_0x39a40c[_0x8dca('0x1d')][_0x8dca('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39a40c['options']?_0x39a40c['options'][_0x8dca('0x1f')]||null:null,'attributes':_0x39a40c['options']?_0x39a40c[_0x8dca('0x1d')][_0x8dca('0x20')]||null:null,'limit':_0x39a40c[_0x8dca('0x1d')]?_0x39a40c[_0x8dca('0x1d')]['limit']||null:null})['then'](function(_0x85bede){logger[_0x8dca('0x11')](_0x8dca('0x1a'),_0x39a40c);logger[_0x8dca('0x21')]('UpdateFaxInteraction',_0x39a40c,JSON['stringify'](_0x85bede));_0x34977c(_0x85bede);})[_0x8dca('0x19')](function(_0xd889bd){logger['error'](_0x8dca('0x1a'),_0xd889bd[_0x8dca('0x18')],_0x39a40c);_0x1e7858(_0x2a65d3[_0x8dca('0x15')](0x1f4,_0xd889bd[_0x8dca('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x15b87f){return new Promise(function(_0xc3630e,_0x4d0769){return db[_0x8dca('0x22')][_0x8dca('0x23')]({'where':_0x15b87f['options']?_0x15b87f['options'][_0x8dca('0x1f')]||null:null})[_0x8dca('0x10')](function(_0x8a6f7f){if(_0x8a6f7f){return _0x8a6f7f[_0x8dca('0x24')](_0x15b87f['body'][_0x8dca('0x25')],_[_0x8dca('0x26')](_0x15b87f[_0x8dca('0x1c')],['ids','id'])||{});}})['spread'](function(_0x8194dd){logger['info']('AddTags',_0x15b87f);logger[_0x8dca('0x21')](_0x8dca('0x27'),_0x15b87f,JSON[_0x8dca('0x14')](_0x8194dd));_0xc3630e(_0x8194dd);})[_0x8dca('0x19')](function(_0xefd12b){logger['error']('AddTags',_0xefd12b[_0x8dca('0x18')],_0x15b87f);_0x4d0769(_this[_0x8dca('0x15')](0x1f4,_0xefd12b[_0x8dca('0x18')]));});});}; \ No newline at end of file +var _0x44ac=['spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','raw','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids'];(function(_0x312da6,_0x5c69e8){var _0x684e9=function(_0x5f5ac1){while(--_0x5f5ac1){_0x312da6['push'](_0x312da6['shift']());}};_0x684e9(++_0x5c69e8);}(_0x44ac,0x185));var _0xc44a=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x44ac[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xc44a('0x0'));var util=require(_0xc44a('0x1'));var moment=require(_0xc44a('0x2'));var BPromise=require(_0xc44a('0x3'));var rs=require(_0xc44a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc44a('0x5'))['db'];var utils=require(_0xc44a('0x6'));var logger=require('../../config/logger')(_0xc44a('0x7'));var config=require(_0xc44a('0x8'));var jayson=require(_0xc44a('0x9'));var client=jayson[_0xc44a('0xa')][_0xc44a('0xb')]({'port':0x232a});config['redis']=_[_0xc44a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc44a('0xd'))(new Redis(config[_0xc44a('0xe')]));require(_0xc44a('0xf'))[_0xc44a('0x10')](socket);function respondWithRpcPromise(_0x3a1a5d,_0x339e1c,_0x56bc7d){return new BPromise(function(_0x150ce9,_0x1fd29b){return client[_0xc44a('0x11')](_0x3a1a5d,_0x56bc7d)[_0xc44a('0x12')](function(_0xbe9713){logger[_0xc44a('0x13')](_0xc44a('0x14'),_0x339e1c,_0xc44a('0x15'));logger[_0xc44a('0x16')](_0xc44a('0x17'),_0x339e1c,_0xc44a('0x15'),JSON[_0xc44a('0x18')](_0xbe9713));if(_0xbe9713[_0xc44a('0x19')]){if(_0xbe9713['error'][_0xc44a('0x1a')]===0x1f4){logger[_0xc44a('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x339e1c,_0xbe9713[_0xc44a('0x19')][_0xc44a('0x1b')]);return _0x1fd29b(_0xbe9713[_0xc44a('0x19')][_0xc44a('0x1b')]);}logger[_0xc44a('0x19')](_0xc44a('0x14'),_0x339e1c,_0xbe9713[_0xc44a('0x19')][_0xc44a('0x1b')]);return _0x150ce9(_0xbe9713[_0xc44a('0x19')][_0xc44a('0x1b')]);}else{logger[_0xc44a('0x13')](_0xc44a('0x14'),_0x339e1c,_0xc44a('0x15'));_0x150ce9(_0xbe9713[_0xc44a('0x1c')]['message']);}})['catch'](function(_0x458068){logger[_0xc44a('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x339e1c,_0x458068);_0x1fd29b(_0x458068);});});}exports[_0xc44a('0x1d')]=function(_0x517206){var _0x3e6beb=this;return new Promise(function(_0x58387c,_0x34b43a){return db[_0xc44a('0x1e')]['update'](_0x517206[_0xc44a('0x1f')],{'raw':_0x517206[_0xc44a('0x20')]?_0x517206[_0xc44a('0x20')][_0xc44a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517206[_0xc44a('0x20')]?_0x517206['options']['where']||null:null,'attributes':_0x517206[_0xc44a('0x20')]?_0x517206[_0xc44a('0x20')][_0xc44a('0x22')]||null:null,'limit':_0x517206[_0xc44a('0x20')]?_0x517206[_0xc44a('0x20')][_0xc44a('0x23')]||null:null})[_0xc44a('0x12')](function(_0xc6349f){logger[_0xc44a('0x13')]('UpdateFaxInteraction',_0x517206);logger['debug'](_0xc44a('0x1d'),_0x517206,JSON[_0xc44a('0x18')](_0xc6349f));_0x58387c(_0xc6349f);})[_0xc44a('0x24')](function(_0x56b30d){logger[_0xc44a('0x19')](_0xc44a('0x1d'),_0x56b30d['message'],_0x517206);_0x34b43a(_0x3e6beb[_0xc44a('0x19')](0x1f4,_0x56b30d[_0xc44a('0x1b')]));});});};exports[_0xc44a('0x25')]=function(_0xca8452){return new Promise(function(_0x11feb9,_0x4a9711){return db[_0xc44a('0x1e')][_0xc44a('0x26')]({'where':_0xca8452[_0xc44a('0x20')]?_0xca8452[_0xc44a('0x20')]['where']||null:null})[_0xc44a('0x12')](function(_0x58242e){if(_0x58242e){return _0x58242e[_0xc44a('0x27')](_0xca8452[_0xc44a('0x1f')][_0xc44a('0x28')],_['omit'](_0xca8452['body'],['ids','id'])||{});}})[_0xc44a('0x29')](function(_0x22a4c1){logger['info']('AddTags',_0xca8452);logger[_0xc44a('0x16')](_0xc44a('0x2a'),_0xca8452,JSON[_0xc44a('0x18')](_0x22a4c1));_0x11feb9(_0x22a4c1);})[_0xc44a('0x24')](function(_0x590025){logger[_0xc44a('0x19')]('AddTags',_0x590025['message'],_0xca8452);_0x4a9711(_this[_0xc44a('0x19')](0x1f4,_0x590025[_0xc44a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 517191e..fba0020 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 _0xa6f0=['save','emit','removeListener','register','faxInteraction:'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0xa6f0,0x1f4));var _0x0a6f=function(_0x6560ab,_0x433689){_0x6560ab=_0x6560ab-0x0;var _0x56cb7a=_0xa6f0[_0x6560ab];return _0x56cb7a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0a6f('0x0'),'remove','update'];function createListener(_0x4ae51e,_0x1de2ba){return function(_0x59e912){_0x1de2ba[_0x0a6f('0x1')](_0x4ae51e,_0x59e912);};}function removeListener(_0xba3bf7,_0xb017ba){return function(){FaxInteractionEvents[_0x0a6f('0x2')](_0xba3bf7,_0xb017ba);};}exports[_0x0a6f('0x3')]=function(_0x2d2a7c){for(var _0x31bebd=0x0,_0x2bfe53=events['length'];_0x31bebd<_0x2bfe53;_0x31bebd++){var _0x3579da=events[_0x31bebd];var _0x590789=createListener(_0x0a6f('0x4')+_0x3579da,_0x2d2a7c);FaxInteractionEvents['on'](_0x3579da,_0x590789);}}; \ No newline at end of file +var _0xcc29=['length','faxInteraction:','./faxInteraction.events','remove','update','emit','removeListener','register'];(function(_0x5343bd,_0x6b65d7){var _0x32e6ec=function(_0x116a3a){while(--_0x116a3a){_0x5343bd['push'](_0x5343bd['shift']());}};_0x32e6ec(++_0x6b65d7);}(_0xcc29,0x11a));var _0x9cc2=function(_0x2d16d8,_0x295ba2){_0x2d16d8=_0x2d16d8-0x0;var _0x40e2bf=_0xcc29[_0x2d16d8];return _0x40e2bf;};'use strict';var FaxInteractionEvents=require(_0x9cc2('0x0'));var events=['save',_0x9cc2('0x1'),_0x9cc2('0x2')];function createListener(_0x1148cb,_0x407e9e){return function(_0x392aac){_0x407e9e[_0x9cc2('0x3')](_0x1148cb,_0x392aac);};}function removeListener(_0xbc034d,_0x5c53f8){return function(){FaxInteractionEvents[_0x9cc2('0x4')](_0xbc034d,_0x5c53f8);};}exports[_0x9cc2('0x5')]=function(_0x574b64){for(var _0x13b4e1=0x0,_0x592bfe=events[_0x9cc2('0x6')];_0x13b4e1<_0x592bfe;_0x13b4e1++){var _0x2f8cb2=events[_0x13b4e1];var _0x566b79=createListener(_0x9cc2('0x7')+_0x2f8cb2,_0x574b64);FaxInteractionEvents['on'](_0x2f8cb2,_0x566b79);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index bc98394..fb52475 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 _0x63cb=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x29d541,_0x5c11de){var _0x59fec4=function(_0x177c50){while(--_0x177c50){_0x29d541['push'](_0x29d541['shift']());}};_0x59fec4(++_0x5c11de);}(_0x63cb,0x158));var _0xb63c=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x63cb[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0xb63c('0x0'));var util=require(_0xb63c('0x1'));var path=require(_0xb63c('0x2'));var timeout=require(_0xb63c('0x3'));var express=require(_0xb63c('0x4'));var router=express[_0xb63c('0x5')]();var fs_extra=require(_0xb63c('0x6'));var auth=require(_0xb63c('0x7'));var interaction=require(_0xb63c('0x8'));var config=require(_0xb63c('0x9'));var controller=require(_0xb63c('0xa'));router[_0xb63c('0xb')]('/',auth[_0xb63c('0xc')](),controller[_0xb63c('0xd')]);router['get'](_0xb63c('0xe'),auth['isAuthenticated'](),controller[_0xb63c('0xf')]);router[_0xb63c('0xb')](_0xb63c('0x10'),auth['isAuthenticated'](),controller[_0xb63c('0x11')]);router[_0xb63c('0xb')](_0xb63c('0x12'),auth['isAuthenticated'](),controller[_0xb63c('0x13')]);router[_0xb63c('0xb')](_0xb63c('0x14'),auth['isAuthenticated'](),controller[_0xb63c('0x15')]);router['post']('/',auth[_0xb63c('0xc')](),controller[_0xb63c('0x16')]);router[_0xb63c('0x17')](_0xb63c('0x12'),auth[_0xb63c('0xc')](),controller[_0xb63c('0x18')]);router[_0xb63c('0x17')](_0xb63c('0x19'),auth[_0xb63c('0xc')](),interaction[_0xb63c('0x1a')](_0xb63c('0x1b'),_0xb63c('0x1c')),controller[_0xb63c('0x1d')]);router[_0xb63c('0x1e')](_0xb63c('0x10'),auth[_0xb63c('0xc')](),interaction['tracked'](_0xb63c('0x1b'),_0xb63c('0x1f')),controller['update']);router['delete'](_0xb63c('0x10'),auth[_0xb63c('0xc')](),interaction[_0xb63c('0x1a')](_0xb63c('0x1b'),_0xb63c('0x20')),controller[_0xb63c('0x21')]);router['delete'](_0xb63c('0x19'),auth[_0xb63c('0xc')](),controller[_0xb63c('0x22')]);module[_0xb63c('0x23')]=router; \ No newline at end of file +var _0x68f8=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index'];(function(_0xf959e1,_0x52b344){var _0x362eca=function(_0x48c164){while(--_0x48c164){_0xf959e1['push'](_0xf959e1['shift']());}};_0x362eca(++_0x52b344);}(_0x68f8,0x10c));var _0x868f=function(_0x17de80,_0x1a0d6b){_0x17de80=_0x17de80-0x0;var _0x5995ae=_0x68f8[_0x17de80];return _0x5995ae;};'use strict';var multer=require(_0x868f('0x0'));var util=require(_0x868f('0x1'));var path=require(_0x868f('0x2'));var timeout=require(_0x868f('0x3'));var express=require(_0x868f('0x4'));var router=express[_0x868f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x868f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x868f('0x7'));var controller=require(_0x868f('0x8'));router[_0x868f('0x9')]('/',auth[_0x868f('0xa')](),controller[_0x868f('0xb')]);router['get'](_0x868f('0xc'),auth[_0x868f('0xa')](),controller[_0x868f('0xd')]);router[_0x868f('0x9')](_0x868f('0xe'),auth[_0x868f('0xa')](),controller[_0x868f('0xf')]);router[_0x868f('0x9')](_0x868f('0x10'),auth[_0x868f('0xa')](),controller[_0x868f('0x11')]);router['get'](_0x868f('0x12'),auth[_0x868f('0xa')](),controller[_0x868f('0x13')]);router[_0x868f('0x14')]('/',auth['isAuthenticated'](),controller[_0x868f('0x15')]);router['post'](_0x868f('0x10'),auth[_0x868f('0xa')](),controller[_0x868f('0x16')]);router['post'](_0x868f('0x17'),auth[_0x868f('0xa')](),interaction[_0x868f('0x18')]('fax',_0x868f('0x19')),controller[_0x868f('0x1a')]);router[_0x868f('0x1b')](_0x868f('0xe'),auth['isAuthenticated'](),interaction[_0x868f('0x18')](_0x868f('0x1c'),_0x868f('0x1d')),controller[_0x868f('0x1e')]);router['delete'](_0x868f('0xe'),auth[_0x868f('0xa')](),interaction[_0x868f('0x18')](_0x868f('0x1c'),_0x868f('0x1f')),controller['destroy']);router[_0x868f('0x20')](_0x868f('0x17'),auth['isAuthenticated'](),controller[_0x868f('0x21')]);module[_0x868f('0x22')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 53ce0e5..03581e7 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 _0x72b1=['sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x72b1,0x16e));var _0x172b=function(_0x4ad5e6,_0x28c564){_0x4ad5e6=_0x4ad5e6-0x0;var _0x3273a2=_0x72b1[_0x4ad5e6];return _0x3273a2;};'use strict';var Sequelize=require(_0x172b('0x0'));module['exports']={'body':{'type':Sequelize[_0x172b('0x1')](_0x172b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x172b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x172b('0x4')]('in',_0x172b('0x5')),'defaultValue':_0x172b('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x172b('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8388=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x19d163,_0x522c4c){var _0x470a93=function(_0x27fbc1){while(--_0x27fbc1){_0x19d163['push'](_0x19d163['shift']());}};_0x470a93(++_0x522c4c);}(_0x8388,0x18d));var _0x8838=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x8388[_0x11ca63];return _0x41f1f6;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'body':{'type':Sequelize[_0x8838('0x2')](_0x8838('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8838('0x4')]('in',_0x8838('0x5')),'defaultValue':_0x8838('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8838('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8838('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 309087a..212af32 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 _0x88e1=['role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','internal','channel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','email','interface','SIP/%s','rejectmessage','create','CmContact','ContactId','Attachment','findOne','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','FaxMessage','includeAll','include','show','params','length','body','find','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x9cd148,_0x5982a9){var _0x76a87f=function(_0x1af3db){while(--_0x1af3db){_0x9cd148['push'](_0x9cd148['shift']());}};_0x76a87f(++_0x5982a9);}(_0x88e1,0x150));var _0x188e=function(_0x165fa0,_0x3a25a9){_0x165fa0=_0x165fa0-0x0;var _0x5d58bb=_0x88e1[_0x165fa0];return _0x5d58bb;};'use strict';var emlformat=require(_0x188e('0x0'));var rimraf=require(_0x188e('0x1'));var zipdir=require(_0x188e('0x2'));var jsonpatch=require(_0x188e('0x3'));var rp=require(_0x188e('0x4'));var moment=require(_0x188e('0x5'));var BPromise=require(_0x188e('0x6'));var Mustache=require('mustache');var util=require(_0x188e('0x7'));var path=require(_0x188e('0x8'));var sox=require(_0x188e('0x9'));var csv=require(_0x188e('0xa'));var ejs=require(_0x188e('0xb'));var fs=require('fs');var fs_extra=require(_0x188e('0xc'));var _=require('lodash');var squel=require(_0x188e('0xd'));var crypto=require(_0x188e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x188e('0xa'));var querystring=require(_0x188e('0xf'));var Papa=require(_0x188e('0x10'));var Redis=require('ioredis');var authService=require(_0x188e('0x11'));var qs=require(_0x188e('0x12'));var as=require(_0x188e('0x13'));var hardwareService=require(_0x188e('0x14'));var logger=require(_0x188e('0x15'))(_0x188e('0x16'));var utils=require(_0x188e('0x17'));var config=require(_0x188e('0x18'));var licenseUtil=require(_0x188e('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x188e('0x1a')](config[_0x188e('0x1b')],{'host':_0x188e('0x1c'),'port':0x18eb});var socket=require(_0x188e('0x1d'))(new Redis(config[_0x188e('0x1b')]));require(_0x188e('0x1e'))[_0x188e('0x1f')](socket);var jayson=require(_0x188e('0x20'));var client=jayson[_0x188e('0x21')][_0x188e('0x22')]({'port':0x232c});var client9002=jayson[_0x188e('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4edfe6,_0x1a91cf,_0x5dcfa4,_0x231659){return new BPromise(function(_0x5ab52c,_0x3c8d16){var _0x294a7d=_0x231659||client;return _0x294a7d['request'](_0x4edfe6,_0x5dcfa4)[_0x188e('0x23')](function(_0x53d851){logger[_0x188e('0x24')]('FaxMessage,\x20%s,\x20%s',_0x1a91cf,'request\x20sent');logger[_0x188e('0x25')](_0x188e('0x26'),_0x1a91cf,'request\x20sent',JSON[_0x188e('0x27')](_0x53d851));if(_0x53d851[_0x188e('0x28')]){if(_0x53d851['error'][_0x188e('0x29')]===0x1f4){logger['error'](_0x188e('0x2a'),_0x1a91cf,_0x53d851[_0x188e('0x28')]['message']);return _0x3c8d16(_0x53d851[_0x188e('0x28')]['message']);}logger[_0x188e('0x28')](_0x188e('0x2a'),_0x1a91cf,_0x53d851['error'][_0x188e('0x2b')]);return _0x5ab52c(_0x53d851[_0x188e('0x28')][_0x188e('0x2b')]);}else{logger['info'](_0x188e('0x2a'),_0x1a91cf,_0x188e('0x2c'));_0x5ab52c(_0x53d851[_0x188e('0x2d')][_0x188e('0x2b')]);}})[_0x188e('0x2e')](function(_0x5c8146){logger[_0x188e('0x28')](_0x188e('0x2a'),_0x1a91cf,_0x5c8146);_0x3c8d16(_0x5c8146);});});}function respondWithStatusCode(_0x12a105,_0x54c011){_0x54c011=_0x54c011||0xcc;return function(_0x598059){if(_0x598059){return _0x12a105['sendStatus'](_0x54c011);}return _0x12a105[_0x188e('0x2f')](_0x54c011)[_0x188e('0x30')]();};}function respondWithResult(_0x18859d,_0x3a7650){_0x3a7650=_0x3a7650||0xc8;return function(_0x321a52){if(_0x321a52){return _0x18859d[_0x188e('0x2f')](_0x3a7650)['json'](_0x321a52);}};}function respondWithFilteredResult(_0x43182c,_0x3ec010){return function(_0x1ec42e){if(_0x1ec42e){var _0x3009e3=typeof _0x3ec010['offset']===_0x188e('0x31')&&typeof _0x3ec010[_0x188e('0x32')]===_0x188e('0x31');var _0x51fc97=_0x1ec42e[_0x188e('0x33')];var _0x2a4a3d=_0x3009e3?0x0:_0x3ec010[_0x188e('0x34')];var _0x5e44f5=_0x3009e3?_0x1ec42e[_0x188e('0x33')]:_0x3ec010[_0x188e('0x34')]+_0x3ec010[_0x188e('0x32')];var _0x29f6c9;if(_0x5e44f5>=_0x51fc97){_0x5e44f5=_0x51fc97;_0x29f6c9=0xc8;}else{_0x29f6c9=0xce;}_0x43182c[_0x188e('0x2f')](_0x29f6c9);return _0x43182c[_0x188e('0x35')](_0x188e('0x36'),_0x2a4a3d+'-'+_0x5e44f5+'/'+_0x51fc97)['json'](_0x1ec42e);}return null;};}function patchUpdates(_0x1a85ac){return function(_0x1c8a77){try{jsonpatch[_0x188e('0x37')](_0x1c8a77,_0x1a85ac,!![]);}catch(_0x22933e){return BPromise[_0x188e('0x38')](_0x22933e);}return _0x1c8a77[_0x188e('0x39')]();};}function saveUpdates(_0x44da2b,_0xeba1d){return function(_0x19e179){if(_0x19e179){return _0x19e179[_0x188e('0x3a')](_0x44da2b)[_0x188e('0x23')](function(_0x6d2b00){return _0x6d2b00;});}return null;};}function removeEntity(_0x552ab7,_0xe79b46){return function(_0x38dbb9){if(_0x38dbb9){return _0x38dbb9['destroy']()[_0x188e('0x23')](function(){_0x552ab7[_0x188e('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51fd66,_0x79b3d8){return function(_0x14ca64){if(!_0x14ca64){_0x51fd66[_0x188e('0x3b')](0x194);}return _0x14ca64;};}function handleError(_0x52c3f0,_0x3fb0d4){_0x3fb0d4=_0x3fb0d4||0x1f4;return function(_0x4e6a88){logger[_0x188e('0x28')](_0x4e6a88[_0x188e('0x3c')]);if(_0x4e6a88[_0x188e('0x3d')]){delete _0x4e6a88[_0x188e('0x3d')];}_0x52c3f0[_0x188e('0x2f')](_0x3fb0d4)[_0x188e('0x3e')](_0x4e6a88);};}exports[_0x188e('0x3f')]=function(_0x3bfa3d,_0x27020d){var _0x9e1e89={},_0x136251={},_0x522437={'count':0x0,'rows':[]};var _0x15a1f1=_['map'](db['FaxMessage'][_0x188e('0x40')],function(_0x226ccd){return{'name':_0x226ccd[_0x188e('0x41')],'type':_0x226ccd[_0x188e('0x42')][_0x188e('0x43')]};});_0x136251[_0x188e('0x44')]=_[_0x188e('0x45')](_0x15a1f1,_0x188e('0x3d'));_0x136251[_0x188e('0x46')]=_[_0x188e('0x47')](_0x3bfa3d[_0x188e('0x46')]);_0x136251[_0x188e('0x48')]=_[_0x188e('0x49')](_0x136251['model'],_0x136251[_0x188e('0x46')]);_0x9e1e89[_0x188e('0x4a')]=_[_0x188e('0x49')](_0x136251[_0x188e('0x44')],qs[_0x188e('0x4b')](_0x3bfa3d['query']['fields']));_0x9e1e89[_0x188e('0x4a')]=_0x9e1e89['attributes']['length']?_0x9e1e89[_0x188e('0x4a')]:_0x136251[_0x188e('0x44')];if(!_0x3bfa3d['query'][_0x188e('0x4c')]('nolimit')){_0x9e1e89[_0x188e('0x32')]=qs['limit'](_0x3bfa3d[_0x188e('0x46')][_0x188e('0x32')]);_0x9e1e89[_0x188e('0x34')]=qs[_0x188e('0x34')](_0x3bfa3d[_0x188e('0x46')][_0x188e('0x34')]);}_0x9e1e89[_0x188e('0x4d')]=qs[_0x188e('0x4e')](_0x3bfa3d['query']['sort']);_0x9e1e89[_0x188e('0x4f')]=qs[_0x188e('0x48')](_[_0x188e('0x50')](_0x3bfa3d['query'],_0x136251[_0x188e('0x48')]),_0x15a1f1);if(_0x3bfa3d[_0x188e('0x46')]['filter']){_0x9e1e89['where']=_['merge'](_0x9e1e89[_0x188e('0x4f')],{'$or':_[_0x188e('0x45')](_0x15a1f1,function(_0x465b1a){if(_0x465b1a[_0x188e('0x42')]!==_0x188e('0x51')){var _0x3ec1db={};_0x3ec1db[_0x465b1a[_0x188e('0x3d')]]={'$like':'%'+_0x3bfa3d[_0x188e('0x46')][_0x188e('0x52')]+'%'};return _0x3ec1db;}})});}_0x9e1e89=_[_0x188e('0x53')]({},_0x9e1e89,_0x3bfa3d[_0x188e('0x54')]);var _0x1ff198={'where':_0x9e1e89[_0x188e('0x4f')]};return db[_0x188e('0x55')][_0x188e('0x33')](_0x1ff198)[_0x188e('0x23')](function(_0x1544d8){_0x522437[_0x188e('0x33')]=_0x1544d8;if(_0x3bfa3d[_0x188e('0x46')][_0x188e('0x56')]){_0x9e1e89[_0x188e('0x57')]=[{'all':!![]}];}return db[_0x188e('0x55')]['findAll'](_0x9e1e89);})[_0x188e('0x23')](function(_0x443200){_0x522437['rows']=_0x443200;return _0x522437;})[_0x188e('0x23')](respondWithFilteredResult(_0x27020d,_0x9e1e89))['catch'](handleError(_0x27020d,null));};exports[_0x188e('0x58')]=function(_0x1de3f5,_0x127176){var _0xb2592b={'raw':!![],'where':{'id':_0x1de3f5[_0x188e('0x59')]['id']}},_0x462fc3={};_0x462fc3['model']=_[_0x188e('0x47')](db['FaxMessage'][_0x188e('0x40')]);_0x462fc3[_0x188e('0x46')]=_[_0x188e('0x47')](_0x1de3f5['query']);_0x462fc3[_0x188e('0x48')]=_[_0x188e('0x49')](_0x462fc3['model'],_0x462fc3[_0x188e('0x46')]);_0xb2592b[_0x188e('0x4a')]=_['intersection'](_0x462fc3[_0x188e('0x44')],qs[_0x188e('0x4b')](_0x1de3f5['query'][_0x188e('0x4b')]));_0xb2592b[_0x188e('0x4a')]=_0xb2592b[_0x188e('0x4a')][_0x188e('0x5a')]?_0xb2592b[_0x188e('0x4a')]:_0x462fc3[_0x188e('0x44')];if(_0x1de3f5[_0x188e('0x46')][_0x188e('0x56')]){_0xb2592b[_0x188e('0x57')]=[{'all':!![]}];}_0xb2592b=_['merge']({},_0xb2592b,_0x1de3f5[_0x188e('0x54')]);return db[_0x188e('0x55')]['find'](_0xb2592b)['then'](handleEntityNotFound(_0x127176,null))[_0x188e('0x23')](respondWithResult(_0x127176,null))[_0x188e('0x2e')](handleError(_0x127176,null));};exports[_0x188e('0x3a')]=function(_0x9995eb,_0x193587){if(_0x9995eb[_0x188e('0x5b')]['id']){delete _0x9995eb[_0x188e('0x5b')]['id'];}return db[_0x188e('0x55')][_0x188e('0x5c')]({'where':{'id':_0x9995eb[_0x188e('0x59')]['id']}})[_0x188e('0x23')](handleEntityNotFound(_0x193587,null))[_0x188e('0x23')](saveUpdates(_0x9995eb[_0x188e('0x5b')],null))['then'](respondWithResult(_0x193587,null))[_0x188e('0x2e')](handleError(_0x193587,null));};exports[_0x188e('0x5d')]=function(_0x25b727,_0x4f0275){return db[_0x188e('0x55')][_0x188e('0x5c')]({'where':{'id':_0x25b727[_0x188e('0x59')]['id']}})[_0x188e('0x23')](handleEntityNotFound(_0x4f0275,null))['then'](removeEntity(_0x4f0275,null))['catch'](handleError(_0x4f0275,null));};exports[_0x188e('0x5e')]=function(_0x13b854,_0x3254b8){return db[_0x188e('0x55')][_0x188e('0x5e')]()[_0x188e('0x23')](respondWithResult(_0x3254b8,null))[_0x188e('0x2e')](handleError(_0x3254b8,null));};var interaction_log=require('../../config/logger')(_0x188e('0x5f'));exports[_0x188e('0x60')]=function(_0x623b48,_0x5b8f5a,_0x58c8ff){var _0x36ec9c={'agent':{},'channel':_0x188e('0x61')};if(_0x623b48[_0x188e('0x5b')]['id']){delete _0x623b48['body']['id'];}_0x623b48['body'][_0x188e('0x62')]=!![];_0x623b48['body'][_0x188e('0x63')]=moment()[_0x188e('0x64')](_0x188e('0x65'));_0x623b48[_0x188e('0x5b')]['UserId']=_0x623b48[_0x188e('0x5b')]['UserId']||_0x623b48[_0x188e('0x66')]['id'];_0x36ec9c[_0x188e('0x67')]['id']=_0x623b48[_0x188e('0x5b')][_0x188e('0x68')];return db[_0x188e('0x55')][_0x188e('0x5c')]({'where':{'id':_0x623b48[_0x188e('0x59')]['id'],'UserId':null}})[_0x188e('0x23')](handleEntityNotFound(_0x5b8f5a,null))['then'](saveUpdates(_0x623b48[_0x188e('0x5b')],null))[_0x188e('0x23')](function(_0x160314){if(_0x160314){_0x36ec9c['message']=_0x160314[_0x188e('0x69')]({'plain':!![]});return db[_0x188e('0x6a')]['find']({'where':{'id':_0x160314['FaxInteractionId']}});}return null;})[_0x188e('0x23')](handleEntityNotFound(_0x5b8f5a,null))[_0x188e('0x23')](function(_0x55a942){if(_0x55a942){return _0x55a942[_0x188e('0x3a')]({'UserId':_0x623b48[_0x188e('0x5b')][_0x188e('0x68')],'read1stAt':_[_0x188e('0x6b')](_0x55a942[_0x188e('0x6c')])?moment()['format'](_0x188e('0x65')):undefined});}return null;})[_0x188e('0x23')](function(_0x1a9c73){if(_0x1a9c73){_0x36ec9c[_0x188e('0x6d')]=_0x1a9c73[_0x188e('0x69')]({'plain':!![]});interaction_log[_0x188e('0x24')](_0x188e('0x6e'),_0x623b48[_0x188e('0x66')]['id'],_0x623b48[_0x188e('0x66')][_0x188e('0x3d')],_0x623b48['user'][_0x188e('0x6f')],_0x36ec9c[_0x188e('0x6d')]['id'],_0x623b48['body']?JSON[_0x188e('0x27')](_0x623b48[_0x188e('0x5b')]):_0x188e('0x70'));return respondWithRpcPromise(_0x188e('0x71'),_0x188e('0x72'),_0x36ec9c);}return null;})[_0x188e('0x23')](function(_0x829c7d){var _0x287c7a=_0x188e('0x73')+_0x829c7d[_0x188e('0x2b')]['ContactId'];return db[_0x188e('0x74')][_0x188e('0x46')](_0x287c7a,{'type':db[_0x188e('0x75')]['QueryTypes'][_0x188e('0x76')],'raw':!![]})[_0x188e('0x23')](function(_0x15b79d){return _0x15b79d;});})[_0x188e('0x23')](function(_0x24631e){if(_0x24631e){_0x36ec9c[_0x188e('0x2b')][_0x188e('0x77')]=_0x24631e[0x0];if(!_0x623b48[_0x188e('0x5b')][_0x188e('0x68')])return;return db[_0x188e('0x78')]['find']({'where':{'id':_0x623b48[_0x188e('0x5b')]['UserId'],'role':'agent'},'attributes':['id','name',_0x188e('0x79'),'email',_0x188e('0x7a')],'raw':!![]});}return null;})[_0x188e('0x23')](function(_0x2e6f40){if(!_0x2e6f40)return null;_0x36ec9c['message'][_0x188e('0x67')]=_0x2e6f40;return _0x36ec9c;})[_0x188e('0x23')](function(_0x478cec){if(_0x478cec){if(_0x623b48[_0x188e('0x5b')]['manual']){_0x36ec9c[_0x188e('0x2b')]['interface']=util[_0x188e('0x64')]('SIP/%s',_0x623b48['user'][_0x188e('0x3d')]);_0x36ec9c['message'][_0x188e('0x7b')]=_0x36ec9c['channel'];_0x36ec9c[_0x188e('0x2b')][_0x188e('0x7c')]=_0x188e('0x60');return respondWithRpcPromise('EventManager',_0x188e('0x7d'),{'event':_0x188e('0x7e'),'message':_0x36ec9c[_0x188e('0x2b')]},client9002)[_0x188e('0x23')](function(){return _0x36ec9c;});}return _0x36ec9c;}return null;})[_0x188e('0x23')](respondWithResult(_0x5b8f5a,null))['catch'](handleError(_0x5b8f5a,null));};var interaction_log=require(_0x188e('0x15'))(_0x188e('0x5f'));exports['reject']=function(_0x34c14e,_0x26d23b,_0x2f1248){var _0xd58162={'agent':{},'channel':_0x188e('0x61')};if(_0x34c14e['body']['id']){delete _0x34c14e[_0x188e('0x5b')]['id'];}_0x34c14e[_0x188e('0x5b')][_0x188e('0x68')]=_0x34c14e[_0x188e('0x5b')][_0x188e('0x68')]||_0x34c14e[_0x188e('0x66')]['id'];_0xd58162[_0x188e('0x67')]['id']=_0x34c14e['body'][_0x188e('0x68')];return db[_0x188e('0x55')][_0x188e('0x5c')]({'where':{'id':_0x34c14e['params']['id'],'UserId':null}})[_0x188e('0x23')](handleEntityNotFound(_0x26d23b,null))[_0x188e('0x23')](function(_0x4a5d13){if(_0x4a5d13){_0xd58162['message']=_0x4a5d13['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4a5d13[_0x188e('0x7f')]}});}return null;})[_0x188e('0x23')](handleEntityNotFound(_0x26d23b,null))[_0x188e('0x23')](function(_0x4b3997){if(_0x4b3997){_0xd58162[_0x188e('0x6d')]=_0x4b3997[_0x188e('0x69')]({'plain':!![]});interaction_log[_0x188e('0x24')](_0x188e('0x80'),_0x34c14e[_0x188e('0x66')]['id'],_0x34c14e[_0x188e('0x66')]['name'],_0x34c14e[_0x188e('0x66')][_0x188e('0x6f')],_0xd58162[_0x188e('0x6d')]['id'],_0x34c14e[_0x188e('0x5b')]?JSON[_0x188e('0x27')](_0x34c14e[_0x188e('0x5b')]):_0x188e('0x70'));return respondWithRpcPromise(_0x188e('0x81'),_0x188e('0x82'),_0xd58162);}return null;})[_0x188e('0x23')](function(_0x25ddfc){var _0x487328=_0x188e('0x73')+_0x25ddfc[_0x188e('0x2b')]['ContactId'];return db['sequelize'][_0x188e('0x46')](_0x487328,{'type':db[_0x188e('0x75')][_0x188e('0x83')][_0x188e('0x76')],'raw':!![]})[_0x188e('0x23')](function(_0x2d49a5){return _0x2d49a5;});})[_0x188e('0x23')](function(_0x415d6d){if(_0x415d6d){_0xd58162[_0x188e('0x2b')]['contact']=_0x415d6d[0x0];if(!_0x34c14e['body'][_0x188e('0x68')])return;return db[_0x188e('0x78')][_0x188e('0x5c')]({'where':{'id':_0x34c14e[_0x188e('0x5b')][_0x188e('0x68')],'role':'agent'},'attributes':['id',_0x188e('0x3d'),'fullname',_0x188e('0x84'),_0x188e('0x7a')],'raw':!![]});}return null;})[_0x188e('0x23')](function(_0x5a33b1){if(!_0x5a33b1)return null;_0xd58162[_0x188e('0x2b')][_0x188e('0x67')]=_0x5a33b1;return _0xd58162;})[_0x188e('0x23')](function(_0x25ee43){if(_0x25ee43){_0x25ee43['message'][_0x188e('0x85')]=util[_0x188e('0x64')](_0x188e('0x86'),_0x34c14e[_0x188e('0x66')][_0x188e('0x3d')]);_0x25ee43['message'][_0x188e('0x7b')]=_0xd58162[_0x188e('0x7b')];_0x25ee43['message']['event']=_0x188e('0x38');respondWithRpcPromise(_0x188e('0x7d'),_0x188e('0x7d'),{'event':_0x188e('0x87'),'message':_0x25ee43[_0x188e('0x2b')]},client9002);return _0xd58162;}return null;})[_0x188e('0x23')](respondWithResult(_0x26d23b,null))[_0x188e('0x2e')](handleError(_0x26d23b,null));};exports[_0x188e('0x88')]=function(_0xa65254,_0x2be858){var _0x40641b;return db[_0x188e('0x55')][_0x188e('0x88')](_0xa65254['body'],{})[_0x188e('0x23')](function(_0x3ddac9){_0x40641b=_0x3ddac9;return db[_0x188e('0x89')]['findOne']({'where':{'id':_0x40641b[_0x188e('0x8a')]}});})['then'](function(_0x3a089c){if(_[_0x188e('0x6b')](_0x3a089c)){return;}else{_0x40641b[_0x188e('0x61')]=_0x3a089c[_0x188e('0x61')];return db[_0x188e('0x8b')][_0x188e('0x8c')]({'where':{'id':_0x40641b['AttachmentId']}});}})[_0x188e('0x23')](function(_0x591429){return respondWithRpcPromise(_0x188e('0x8d'),'SendFax',{'FaxAccountId':_[_0x188e('0x6b')](_0xa65254['body'])?undefined:_0xa65254[_0x188e('0x5b')]['FaxAccountId'],'path':_['isNil'](_0x591429)?undefined:util[_0x188e('0x64')](_0x188e('0x8e'),_0x591429[_0x188e('0x8f')]),'fax':_[_0x188e('0x6b')](_0x40641b[_0x188e('0x61')])?undefined:_0x40641b[_0x188e('0x61')],'AttachmentId':_0x40641b[_0x188e('0x90')]},client9002);})[_0x188e('0x23')](respondWithResult(_0x2be858,0xc9))['catch'](handleError(_0x2be858,null));};exports[_0x188e('0x91')]=function(_0x7d8724,_0x1baf2b){var _0x5a99f8=path[_0x188e('0x92')](config['root'],_0x188e('0x93'),_0x188e('0x94'),'attachments');return db[_0x188e('0x55')][_0x188e('0x5c')]({'where':{'id':_0x7d8724[_0x188e('0x59')]['id']},'include':[{'model':db[_0x188e('0x8b')],'as':_0x188e('0x8b')}]})['then'](handleEntityNotFound(_0x1baf2b,null))['then'](function(_0x8dc84c){if(_0x8dc84c){return _0x1baf2b['download'](path[_0x188e('0x92')](_0x5a99f8,_0x8dc84c['Attachment'][_0x188e('0x8f')]));}})['catch'](handleError(_0x1baf2b,null));}; \ No newline at end of file +var _0x3e0b=['attachments','Attachment','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','body','describe','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','manual','interface','SIP/%s','channel','event','acceptmessage','fax-interactions','reject','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','fullname','internal','EventManager','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','files'];(function(_0x28f08d,_0x286aea){var _0x4fec64=function(_0x30fa70){while(--_0x30fa70){_0x28f08d['push'](_0x28f08d['shift']());}};_0x4fec64(++_0x286aea);}(_0x3e0b,0x1b2));var _0xb3e0=function(_0x5850ab,_0x2f3e09){_0x5850ab=_0x5850ab-0x0;var _0x3a1f6a=_0x3e0b[_0x5850ab];return _0x3a1f6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3e0('0x0'));var zipdir=require(_0xb3e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3e0('0x2'));var moment=require('moment');var BPromise=require(_0xb3e0('0x3'));var Mustache=require(_0xb3e0('0x4'));var util=require(_0xb3e0('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb3e0('0x6'));var ejs=require(_0xb3e0('0x7'));var fs=require('fs');var fs_extra=require(_0xb3e0('0x8'));var _=require(_0xb3e0('0x9'));var squel=require(_0xb3e0('0xa'));var crypto=require(_0xb3e0('0xb'));var jsforce=require(_0xb3e0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3e0('0xd'));var Papa=require(_0xb3e0('0xe'));var Redis=require(_0xb3e0('0xf'));var authService=require(_0xb3e0('0x10'));var qs=require(_0xb3e0('0x11'));var as=require(_0xb3e0('0x12'));var hardwareService=require(_0xb3e0('0x13'));var logger=require(_0xb3e0('0x14'))(_0xb3e0('0x15'));var utils=require(_0xb3e0('0x16'));var config=require(_0xb3e0('0x17'));var licenseUtil=require(_0xb3e0('0x18'));var db=require('../../mysqldb')['db'];config[_0xb3e0('0x19')]=_['defaults'](config[_0xb3e0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3e0('0x1a'))(new Redis(config[_0xb3e0('0x19')]));require(_0xb3e0('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb3e0('0x1c')][_0xb3e0('0x1d')]({'port':0x232c});var client9002=jayson[_0xb3e0('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57d6db,_0x3c874a,_0x4bebf2,_0x1e0929){return new BPromise(function(_0x404710,_0x3076e0){var _0xa6828f=_0x1e0929||client;return _0xa6828f[_0xb3e0('0x1e')](_0x57d6db,_0x4bebf2)[_0xb3e0('0x1f')](function(_0x3d1fb3){logger[_0xb3e0('0x20')](_0xb3e0('0x21'),_0x3c874a,_0xb3e0('0x22'));logger['debug'](_0xb3e0('0x23'),_0x3c874a,_0xb3e0('0x22'),JSON[_0xb3e0('0x24')](_0x3d1fb3));if(_0x3d1fb3[_0xb3e0('0x25')]){if(_0x3d1fb3['error'][_0xb3e0('0x26')]===0x1f4){logger[_0xb3e0('0x25')]('FaxMessage,\x20%s,\x20%s',_0x3c874a,_0x3d1fb3[_0xb3e0('0x25')]['message']);return _0x3076e0(_0x3d1fb3['error'][_0xb3e0('0x27')]);}logger['error'](_0xb3e0('0x21'),_0x3c874a,_0x3d1fb3[_0xb3e0('0x25')][_0xb3e0('0x27')]);return _0x404710(_0x3d1fb3['error']['message']);}else{logger['info'](_0xb3e0('0x21'),_0x3c874a,_0xb3e0('0x22'));_0x404710(_0x3d1fb3[_0xb3e0('0x28')][_0xb3e0('0x27')]);}})[_0xb3e0('0x29')](function(_0x4cec0a){logger[_0xb3e0('0x25')](_0xb3e0('0x21'),_0x3c874a,_0x4cec0a);_0x3076e0(_0x4cec0a);});});}function respondWithStatusCode(_0x4c9eb7,_0x548821){_0x548821=_0x548821||0xcc;return function(_0x374783){if(_0x374783){return _0x4c9eb7[_0xb3e0('0x2a')](_0x548821);}return _0x4c9eb7['status'](_0x548821)[_0xb3e0('0x2b')]();};}function respondWithResult(_0x5a70b7,_0x52ec9d){_0x52ec9d=_0x52ec9d||0xc8;return function(_0x5212f4){if(_0x5212f4){return _0x5a70b7[_0xb3e0('0x2c')](_0x52ec9d)['json'](_0x5212f4);}};}function respondWithFilteredResult(_0x17946c,_0x336323){return function(_0x4c32c3){if(_0x4c32c3){var _0x14d325=typeof _0x336323[_0xb3e0('0x2d')]===_0xb3e0('0x2e')&&typeof _0x336323[_0xb3e0('0x2f')]===_0xb3e0('0x2e');var _0x2f3c06=_0x4c32c3[_0xb3e0('0x30')];var _0x1b07c1=_0x14d325?0x0:_0x336323[_0xb3e0('0x2d')];var _0x365adb=_0x14d325?_0x4c32c3['count']:_0x336323['offset']+_0x336323[_0xb3e0('0x2f')];var _0x5c6764;if(_0x365adb>=_0x2f3c06){_0x365adb=_0x2f3c06;_0x5c6764=0xc8;}else{_0x5c6764=0xce;}_0x17946c[_0xb3e0('0x2c')](_0x5c6764);return _0x17946c[_0xb3e0('0x31')]('Content-Range',_0x1b07c1+'-'+_0x365adb+'/'+_0x2f3c06)[_0xb3e0('0x32')](_0x4c32c3);}return null;};}function patchUpdates(_0x53014b){return function(_0x31a328){try{jsonpatch[_0xb3e0('0x33')](_0x31a328,_0x53014b,!![]);}catch(_0x49f8da){return BPromise['reject'](_0x49f8da);}return _0x31a328[_0xb3e0('0x34')]();};}function saveUpdates(_0x1f6431,_0xbe02d0){return function(_0x1f4efd){if(_0x1f4efd){return _0x1f4efd[_0xb3e0('0x35')](_0x1f6431)[_0xb3e0('0x1f')](function(_0x10638b){return _0x10638b;});}return null;};}function removeEntity(_0x5dc894,_0x4d7591){return function(_0x4182fe){if(_0x4182fe){return _0x4182fe[_0xb3e0('0x36')]()[_0xb3e0('0x1f')](function(){_0x5dc894[_0xb3e0('0x2c')](0xcc)[_0xb3e0('0x2b')]();});}};}function handleEntityNotFound(_0xcc0dfa,_0x3eec6d){return function(_0x202d01){if(!_0x202d01){_0xcc0dfa['sendStatus'](0x194);}return _0x202d01;};}function handleError(_0x193f70,_0x181319){_0x181319=_0x181319||0x1f4;return function(_0x484975){logger['error'](_0x484975[_0xb3e0('0x37')]);if(_0x484975[_0xb3e0('0x38')]){delete _0x484975[_0xb3e0('0x38')];}_0x193f70[_0xb3e0('0x2c')](_0x181319)[_0xb3e0('0x39')](_0x484975);};}exports[_0xb3e0('0x3a')]=function(_0x5b4441,_0x3f63c8){var _0x54a2ec={},_0x32cb0f={},_0x135834={'count':0x0,'rows':[]};var _0x10fc7a=_[_0xb3e0('0x3b')](db[_0xb3e0('0x3c')][_0xb3e0('0x3d')],function(_0x56058b){return{'name':_0x56058b[_0xb3e0('0x3e')],'type':_0x56058b[_0xb3e0('0x3f')][_0xb3e0('0x40')]};});_0x32cb0f[_0xb3e0('0x41')]=_[_0xb3e0('0x3b')](_0x10fc7a,'name');_0x32cb0f['query']=_[_0xb3e0('0x42')](_0x5b4441['query']);_0x32cb0f[_0xb3e0('0x43')]=_['intersection'](_0x32cb0f['model'],_0x32cb0f[_0xb3e0('0x44')]);_0x54a2ec[_0xb3e0('0x45')]=_[_0xb3e0('0x46')](_0x32cb0f['model'],qs[_0xb3e0('0x47')](_0x5b4441[_0xb3e0('0x44')][_0xb3e0('0x47')]));_0x54a2ec[_0xb3e0('0x45')]=_0x54a2ec[_0xb3e0('0x45')][_0xb3e0('0x48')]?_0x54a2ec[_0xb3e0('0x45')]:_0x32cb0f[_0xb3e0('0x41')];if(!_0x5b4441['query'][_0xb3e0('0x49')]('nolimit')){_0x54a2ec[_0xb3e0('0x2f')]=qs[_0xb3e0('0x2f')](_0x5b4441[_0xb3e0('0x44')][_0xb3e0('0x2f')]);_0x54a2ec['offset']=qs['offset'](_0x5b4441['query'][_0xb3e0('0x2d')]);}_0x54a2ec['order']=qs[_0xb3e0('0x4a')](_0x5b4441['query'][_0xb3e0('0x4a')]);_0x54a2ec[_0xb3e0('0x4b')]=qs[_0xb3e0('0x43')](_['pick'](_0x5b4441['query'],_0x32cb0f[_0xb3e0('0x43')]),_0x10fc7a);if(_0x5b4441[_0xb3e0('0x44')][_0xb3e0('0x4c')]){_0x54a2ec['where']=_[_0xb3e0('0x4d')](_0x54a2ec['where'],{'$or':_[_0xb3e0('0x3b')](_0x10fc7a,function(_0x557936){if(_0x557936[_0xb3e0('0x3f')]!=='VIRTUAL'){var _0x1d076d={};_0x1d076d[_0x557936[_0xb3e0('0x38')]]={'$like':'%'+_0x5b4441[_0xb3e0('0x44')][_0xb3e0('0x4c')]+'%'};return _0x1d076d;}})});}_0x54a2ec=_['merge']({},_0x54a2ec,_0x5b4441[_0xb3e0('0x4e')]);var _0x2cf310={'where':_0x54a2ec[_0xb3e0('0x4b')]};return db[_0xb3e0('0x3c')]['count'](_0x2cf310)[_0xb3e0('0x1f')](function(_0x4f163a){_0x135834[_0xb3e0('0x30')]=_0x4f163a;if(_0x5b4441['query'][_0xb3e0('0x4f')]){_0x54a2ec[_0xb3e0('0x50')]=[{'all':!![]}];}return db[_0xb3e0('0x3c')][_0xb3e0('0x51')](_0x54a2ec);})[_0xb3e0('0x1f')](function(_0x248763){_0x135834[_0xb3e0('0x52')]=_0x248763;return _0x135834;})[_0xb3e0('0x1f')](respondWithFilteredResult(_0x3f63c8,_0x54a2ec))[_0xb3e0('0x29')](handleError(_0x3f63c8,null));};exports[_0xb3e0('0x53')]=function(_0x4ad63f,_0x5acecf){var _0x494035={'raw':!![],'where':{'id':_0x4ad63f[_0xb3e0('0x54')]['id']}},_0x24e3f1={};_0x24e3f1[_0xb3e0('0x41')]=_[_0xb3e0('0x42')](db['FaxMessage'][_0xb3e0('0x3d')]);_0x24e3f1[_0xb3e0('0x44')]=_['keys'](_0x4ad63f[_0xb3e0('0x44')]);_0x24e3f1[_0xb3e0('0x43')]=_[_0xb3e0('0x46')](_0x24e3f1['model'],_0x24e3f1[_0xb3e0('0x44')]);_0x494035['attributes']=_[_0xb3e0('0x46')](_0x24e3f1[_0xb3e0('0x41')],qs[_0xb3e0('0x47')](_0x4ad63f['query']['fields']));_0x494035[_0xb3e0('0x45')]=_0x494035[_0xb3e0('0x45')][_0xb3e0('0x48')]?_0x494035['attributes']:_0x24e3f1[_0xb3e0('0x41')];if(_0x4ad63f[_0xb3e0('0x44')][_0xb3e0('0x4f')]){_0x494035['include']=[{'all':!![]}];}_0x494035=_['merge']({},_0x494035,_0x4ad63f[_0xb3e0('0x4e')]);return db['FaxMessage'][_0xb3e0('0x55')](_0x494035)[_0xb3e0('0x1f')](handleEntityNotFound(_0x5acecf,null))[_0xb3e0('0x1f')](respondWithResult(_0x5acecf,null))[_0xb3e0('0x29')](handleError(_0x5acecf,null));};exports[_0xb3e0('0x35')]=function(_0x3c0e8c,_0x3b09c4){if(_0x3c0e8c[_0xb3e0('0x56')]['id']){delete _0x3c0e8c['body']['id'];}return db['FaxMessage'][_0xb3e0('0x55')]({'where':{'id':_0x3c0e8c['params']['id']}})[_0xb3e0('0x1f')](handleEntityNotFound(_0x3b09c4,null))['then'](saveUpdates(_0x3c0e8c[_0xb3e0('0x56')],null))['then'](respondWithResult(_0x3b09c4,null))['catch'](handleError(_0x3b09c4,null));};exports[_0xb3e0('0x36')]=function(_0x137577,_0xe43f15){return db[_0xb3e0('0x3c')][_0xb3e0('0x55')]({'where':{'id':_0x137577['params']['id']}})[_0xb3e0('0x1f')](handleEntityNotFound(_0xe43f15,null))['then'](removeEntity(_0xe43f15,null))['catch'](handleError(_0xe43f15,null));};exports[_0xb3e0('0x57')]=function(_0x2fc36d,_0x102151){return db[_0xb3e0('0x3c')][_0xb3e0('0x57')]()[_0xb3e0('0x1f')](respondWithResult(_0x102151,null))[_0xb3e0('0x29')](handleError(_0x102151,null));};var interaction_log=require(_0xb3e0('0x14'))('fax-interactions');exports[_0xb3e0('0x58')]=function(_0x48dd9a,_0x142102,_0x6137c){var _0x1380e1={'agent':{},'channel':_0xb3e0('0x59')};if(_0x48dd9a[_0xb3e0('0x56')]['id']){delete _0x48dd9a[_0xb3e0('0x56')]['id'];}_0x48dd9a[_0xb3e0('0x56')]['read']=!![];_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x5a')]=moment()[_0xb3e0('0x5b')](_0xb3e0('0x5c'));_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x5d')]=_0x48dd9a[_0xb3e0('0x56')]['UserId']||_0x48dd9a[_0xb3e0('0x5e')]['id'];_0x1380e1['agent']['id']=_0x48dd9a[_0xb3e0('0x56')]['UserId'];return db[_0xb3e0('0x3c')][_0xb3e0('0x55')]({'where':{'id':_0x48dd9a['params']['id'],'UserId':null}})[_0xb3e0('0x1f')](handleEntityNotFound(_0x142102,null))['then'](saveUpdates(_0x48dd9a[_0xb3e0('0x56')],null))[_0xb3e0('0x1f')](function(_0x202b39){if(_0x202b39){_0x1380e1[_0xb3e0('0x27')]=_0x202b39[_0xb3e0('0x5f')]({'plain':!![]});return db[_0xb3e0('0x60')]['find']({'where':{'id':_0x202b39[_0xb3e0('0x61')]}});}return null;})[_0xb3e0('0x1f')](handleEntityNotFound(_0x142102,null))[_0xb3e0('0x1f')](function(_0x417026){if(_0x417026){return _0x417026[_0xb3e0('0x35')]({'UserId':_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x5d')],'read1stAt':_['isNil'](_0x417026[_0xb3e0('0x62')])?moment()[_0xb3e0('0x5b')](_0xb3e0('0x5c')):undefined});}return null;})[_0xb3e0('0x1f')](function(_0x548748){if(_0x548748){_0x1380e1[_0xb3e0('0x63')]=_0x548748[_0xb3e0('0x5f')]({'plain':!![]});interaction_log['info'](_0xb3e0('0x64'),_0x48dd9a[_0xb3e0('0x5e')]['id'],_0x48dd9a[_0xb3e0('0x5e')][_0xb3e0('0x38')],_0x48dd9a[_0xb3e0('0x5e')][_0xb3e0('0x65')],_0x1380e1[_0xb3e0('0x63')]['id'],_0x48dd9a['body']?JSON['stringify'](_0x48dd9a['body']):'null');return respondWithRpcPromise(_0xb3e0('0x66'),'acceptMessage',_0x1380e1);}return null;})['then'](function(_0x1d99d1){var _0x21a321=_0xb3e0('0x67')+_0x1d99d1[_0xb3e0('0x27')][_0xb3e0('0x68')];return db[_0xb3e0('0x69')][_0xb3e0('0x44')](_0x21a321,{'type':db[_0xb3e0('0x6a')][_0xb3e0('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x2653aa){return _0x2653aa;});})[_0xb3e0('0x1f')](function(_0x5703eb){if(_0x5703eb){_0x1380e1[_0xb3e0('0x27')][_0xb3e0('0x6c')]=_0x5703eb[0x0];if(!_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x5d')])return;return db[_0xb3e0('0x6d')]['find']({'where':{'id':_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x5d')],'role':'agent'},'attributes':['id',_0xb3e0('0x38'),'fullname',_0xb3e0('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0xee578c){if(!_0xee578c)return null;_0x1380e1['message']['agent']=_0xee578c;return _0x1380e1;})[_0xb3e0('0x1f')](function(_0x683770){if(_0x683770){if(_0x48dd9a[_0xb3e0('0x56')][_0xb3e0('0x6f')]){_0x1380e1[_0xb3e0('0x27')][_0xb3e0('0x70')]=util[_0xb3e0('0x5b')](_0xb3e0('0x71'),_0x48dd9a[_0xb3e0('0x5e')][_0xb3e0('0x38')]);_0x1380e1[_0xb3e0('0x27')][_0xb3e0('0x72')]=_0x1380e1[_0xb3e0('0x72')];_0x1380e1[_0xb3e0('0x27')][_0xb3e0('0x73')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb3e0('0x74'),'message':_0x1380e1[_0xb3e0('0x27')]},client9002)[_0xb3e0('0x1f')](function(){return _0x1380e1;});}return _0x1380e1;}return null;})[_0xb3e0('0x1f')](respondWithResult(_0x142102,null))[_0xb3e0('0x29')](handleError(_0x142102,null));};var interaction_log=require(_0xb3e0('0x14'))(_0xb3e0('0x75'));exports[_0xb3e0('0x76')]=function(_0x4ea58e,_0x5bde1a,_0x47a46b){var _0x3b8097={'agent':{},'channel':_0xb3e0('0x59')};if(_0x4ea58e[_0xb3e0('0x56')]['id']){delete _0x4ea58e['body']['id'];}_0x4ea58e[_0xb3e0('0x56')]['UserId']=_0x4ea58e[_0xb3e0('0x56')][_0xb3e0('0x5d')]||_0x4ea58e['user']['id'];_0x3b8097[_0xb3e0('0x77')]['id']=_0x4ea58e['body']['UserId'];return db[_0xb3e0('0x3c')]['find']({'where':{'id':_0x4ea58e[_0xb3e0('0x54')]['id'],'UserId':null}})[_0xb3e0('0x1f')](handleEntityNotFound(_0x5bde1a,null))[_0xb3e0('0x1f')](function(_0x4855ba){if(_0x4855ba){_0x3b8097['message']=_0x4855ba[_0xb3e0('0x5f')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4855ba[_0xb3e0('0x61')]}});}return null;})[_0xb3e0('0x1f')](handleEntityNotFound(_0x5bde1a,null))[_0xb3e0('0x1f')](function(_0x450cd4){if(_0x450cd4){_0x3b8097[_0xb3e0('0x63')]=_0x450cd4[_0xb3e0('0x5f')]({'plain':!![]});interaction_log[_0xb3e0('0x20')](_0xb3e0('0x78'),_0x4ea58e[_0xb3e0('0x5e')]['id'],_0x4ea58e[_0xb3e0('0x5e')]['name'],_0x4ea58e[_0xb3e0('0x5e')][_0xb3e0('0x65')],_0x3b8097[_0xb3e0('0x63')]['id'],_0x4ea58e['body']?JSON['stringify'](_0x4ea58e[_0xb3e0('0x56')]):_0xb3e0('0x79'));return respondWithRpcPromise(_0xb3e0('0x7a'),_0xb3e0('0x7b'),_0x3b8097);}return null;})[_0xb3e0('0x1f')](function(_0xed676){var _0x2423b=_0xb3e0('0x67')+_0xed676['message'][_0xb3e0('0x68')];return db['sequelize'][_0xb3e0('0x44')](_0x2423b,{'type':db[_0xb3e0('0x6a')][_0xb3e0('0x6b')][_0xb3e0('0x7c')],'raw':!![]})[_0xb3e0('0x1f')](function(_0x38ecef){return _0x38ecef;});})['then'](function(_0x5accd3){if(_0x5accd3){_0x3b8097[_0xb3e0('0x27')][_0xb3e0('0x6c')]=_0x5accd3[0x0];if(!_0x4ea58e[_0xb3e0('0x56')][_0xb3e0('0x5d')])return;return db[_0xb3e0('0x6d')][_0xb3e0('0x55')]({'where':{'id':_0x4ea58e[_0xb3e0('0x56')][_0xb3e0('0x5d')],'role':'agent'},'attributes':['id',_0xb3e0('0x38'),_0xb3e0('0x7d'),'email',_0xb3e0('0x7e')],'raw':!![]});}return null;})['then'](function(_0x467964){if(!_0x467964)return null;_0x3b8097[_0xb3e0('0x27')][_0xb3e0('0x77')]=_0x467964;return _0x3b8097;})[_0xb3e0('0x1f')](function(_0x164e99){if(_0x164e99){_0x164e99[_0xb3e0('0x27')][_0xb3e0('0x70')]=util['format'](_0xb3e0('0x71'),_0x4ea58e[_0xb3e0('0x5e')][_0xb3e0('0x38')]);_0x164e99[_0xb3e0('0x27')][_0xb3e0('0x72')]=_0x3b8097[_0xb3e0('0x72')];_0x164e99[_0xb3e0('0x27')][_0xb3e0('0x73')]=_0xb3e0('0x76');respondWithRpcPromise(_0xb3e0('0x7f'),_0xb3e0('0x7f'),{'event':_0xb3e0('0x80'),'message':_0x164e99[_0xb3e0('0x27')]},client9002);return _0x3b8097;}return null;})['then'](respondWithResult(_0x5bde1a,null))['catch'](handleError(_0x5bde1a,null));};exports[_0xb3e0('0x81')]=function(_0x9de93,_0x208fa2){var _0x32092e;return db['FaxMessage']['create'](_0x9de93[_0xb3e0('0x56')],{})[_0xb3e0('0x1f')](function(_0x530b1f){_0x32092e=_0x530b1f;return db[_0xb3e0('0x82')][_0xb3e0('0x83')]({'where':{'id':_0x32092e[_0xb3e0('0x68')]}});})['then'](function(_0x254f2e){if(_[_0xb3e0('0x84')](_0x254f2e)){return;}else{_0x32092e[_0xb3e0('0x59')]=_0x254f2e[_0xb3e0('0x59')];return db['Attachment'][_0xb3e0('0x83')]({'where':{'id':_0x32092e[_0xb3e0('0x85')]}});}})[_0xb3e0('0x1f')](function(_0x15580a){return respondWithRpcPromise(_0xb3e0('0x86'),_0xb3e0('0x86'),{'FaxAccountId':_['isNil'](_0x9de93[_0xb3e0('0x56')])?undefined:_0x9de93[_0xb3e0('0x56')][_0xb3e0('0x87')],'path':_[_0xb3e0('0x84')](_0x15580a)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x15580a[_0xb3e0('0x88')]),'fax':_[_0xb3e0('0x84')](_0x32092e['fax'])?undefined:_0x32092e[_0xb3e0('0x59')],'AttachmentId':_0x32092e['AttachmentId']},client9002);})[_0xb3e0('0x1f')](respondWithResult(_0x208fa2,0xc9))['catch'](handleError(_0x208fa2,null));};exports[_0xb3e0('0x89')]=function(_0x194579,_0x2617cf){var _0x2c8d15=path[_0xb3e0('0x8a')](config[_0xb3e0('0x8b')],_0xb3e0('0x8c'),_0xb3e0('0x8d'),_0xb3e0('0x8e'));return db[_0xb3e0('0x3c')]['find']({'where':{'id':_0x194579['params']['id']},'include':[{'model':db[_0xb3e0('0x8f')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x2617cf,null))[_0xb3e0('0x1f')](function(_0x49a0f9){if(_0x49a0f9){return _0x2617cf[_0xb3e0('0x89')](path['join'](_0x2c8d15,_0x49a0f9[_0xb3e0('0x8f')][_0xb3e0('0x88')]));}})['catch'](handleError(_0x2617cf,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 13c3833..5e4528d 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 _0x7919=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7919,0xeb));var _0x9791=function(_0x1bdb8b,_0x39f775){_0x1bdb8b=_0x1bdb8b-0x0;var _0x4aa46e=_0x7919[_0x1bdb8b];return _0x4aa46e;};'use strict';var EventEmitter=require(_0x9791('0x0'));var FaxMessage=require(_0x9791('0x1'))['db'][_0x9791('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9791('0x3')](0x0);var events={'afterCreate':_0x9791('0x4'),'afterUpdate':_0x9791('0x5'),'afterDestroy':_0x9791('0x6')};function emitEvent(_0x54b9c0){return function(_0x13a1a5,_0x193919,_0x4b484f){FaxMessageEvents[_0x9791('0x7')](_0x54b9c0+':'+_0x13a1a5['id'],_0x13a1a5);FaxMessageEvents[_0x9791('0x7')](_0x54b9c0,_0x13a1a5);_0x4b484f(null);};}for(var e in events){if(events[_0x9791('0x8')](e)){var event=events[e];FaxMessage[_0x9791('0x9')](e,emitEvent(event));}}module[_0x9791('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0xe2fe=['exports','events','setMaxListeners','update','remove','emit','hook'];(function(_0x37254c,_0x2c2782){var _0x85e16a=function(_0x28574e){while(--_0x28574e){_0x37254c['push'](_0x37254c['shift']());}};_0x85e16a(++_0x2c2782);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xee2f('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xee2f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee2f('0x2'),'afterDestroy':_0xee2f('0x3')};function emitEvent(_0xe5ad8a){return function(_0x2d2b03,_0xcb45e6,_0x4ba89f){FaxMessageEvents[_0xee2f('0x4')](_0xe5ad8a+':'+_0x2d2b03['id'],_0x2d2b03);FaxMessageEvents[_0xee2f('0x4')](_0xe5ad8a,_0x2d2b03);_0x4ba89f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xee2f('0x5')](e,emitEvent(event));}}module[_0xee2f('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index bb97c33..09a8354 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 _0xe09a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','toLowerCase','secret','isNil','UserId','findOne','FaxInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x504d8f,_0x19845e){var _0x5a3e72=function(_0x1bff84){while(--_0x1bff84){_0x504d8f['push'](_0x504d8f['shift']());}};_0x5a3e72(++_0x19845e);}(_0xe09a,0x179));var _0xae09=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xe09a[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require(_0xae09('0x0'));var util=require('util');var logger=require(_0xae09('0x1'))(_0xae09('0x2'));var moment=require(_0xae09('0x3'));var BPromise=require(_0xae09('0x4'));var rp=require(_0xae09('0x5'));var fs=require('fs');var path=require(_0xae09('0x6'));var rimraf=require(_0xae09('0x7'));var config=require(_0xae09('0x8'));var attributes=require(_0xae09('0x9'));module[_0xae09('0xa')]=function(_0x47d475,_0xda9c0f){return _0x47d475[_0xae09('0xb')](_0xae09('0xc'),attributes,{'tableName':_0xae09('0xd'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xae09('0xe')],'type':_0xae09('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28b319,_0x5a1dcf,_0x84b0e1){var _0x253ff4=_0x47d475[_0xae09('0x10')];var _0x16a72d=_0x28b319[_0xae09('0x11')]({'plain':!![]});if(_0x16a72d['direction'][_0xae09('0x12')]()==='in'||_0x16a72d['direction'][_0xae09('0x12')]()==='out'&&!_0x16a72d[_0xae09('0x13')]&&!_[_0xae09('0x14')](_0x16a72d[_0xae09('0x15')])){_0x253ff4['FaxInteraction'][_0xae09('0x16')]({'where':{'id':_0x16a72d[_0xae09('0x17')]}})[_0xae09('0x18')](function(_0x50735d){if(_0x50735d){_0x50735d[_0xae09('0x19')]({'lastMsgAt':_0x16a72d['createdAt'],'lastMsgDirection':_0x16a72d['direction'][_0xae09('0x12')]()});}})['catch'](function(_0x4e2df5){console[_0xae09('0x1a')](_0x4e2df5);});}_0x84b0e1();}},'charset':_0xae09('0x1b'),'collate':_0xae09('0x1c')});}; \ No newline at end of file +var _0x6b78=['update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','FaxInteraction'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x6b78,0x1b5));var _0x86b7=function(_0x5d2108,_0x283678){_0x5d2108=_0x5d2108-0x0;var _0x44794d=_0x6b78[_0x5d2108];return _0x44794d;};'use strict';var _=require(_0x86b7('0x0'));var util=require(_0x86b7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x86b7('0x2'));var BPromise=require(_0x86b7('0x3'));var rp=require(_0x86b7('0x4'));var fs=require('fs');var path=require(_0x86b7('0x5'));var rimraf=require(_0x86b7('0x6'));var config=require(_0x86b7('0x7'));var attributes=require('./faxMessage.attributes');module[_0x86b7('0x8')]=function(_0x24b450,_0x21e101){return _0x24b450[_0x86b7('0x9')](_0x86b7('0xa'),attributes,{'tableName':_0x86b7('0xb'),'paranoid':![],'indexes':[{'name':_0x86b7('0xc'),'fields':[_0x86b7('0xd')],'type':_0x86b7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1afe84,_0x33889b,_0x979540){var _0x5e2d3b=_0x24b450[_0x86b7('0xf')];var _0x367247=_0x1afe84['get']({'plain':!![]});if(_0x367247[_0x86b7('0x10')][_0x86b7('0x11')]()==='in'||_0x367247['direction'][_0x86b7('0x11')]()===_0x86b7('0x12')&&!_0x367247[_0x86b7('0x13')]&&!_['isNil'](_0x367247[_0x86b7('0x14')])){_0x5e2d3b[_0x86b7('0x15')]['findOne']({'where':{'id':_0x367247['FaxInteractionId']}})['then'](function(_0x461d57){if(_0x461d57){_0x461d57[_0x86b7('0x16')]({'lastMsgAt':_0x367247[_0x86b7('0x17')],'lastMsgDirection':_0x367247['direction'][_0x86b7('0x11')]()});}})[_0x86b7('0x18')](function(_0x3cddf3){console['error'](_0x3cddf3);});}_0x979540();}},'charset':_0x86b7('0x19'),'collate':_0x86b7('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 9ab562b..9b27ebe 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x202517,_0x36628b){var _0x1765c5=function(_0x210cc5){while(--_0x210cc5){_0x202517['push'](_0x202517['shift']());}};_0x1765c5(++_0x36628b);}(_0x9f62,0x154));var _0x29f6=function(_0x337a8f,_0x333658){_0x337a8f=_0x337a8f-0x0;var _0x42f34d=_0x9f62[_0x337a8f];return _0x42f34d;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file +var _0x4ea3=['message','result','catch','body','options','CreateFaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2a0c21,_0x51ad5e){var _0x28f2ff=function(_0x47739f){while(--_0x47739f){_0x2a0c21['push'](_0x2a0c21['shift']());}};_0x28f2ff(++_0x51ad5e);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});config[_0x34ea('0xa')]=_[_0x34ea('0xb')](config[_0x34ea('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x34ea('0xc'))(new Redis(config[_0x34ea('0xa')]));require(_0x34ea('0xd'))['register'](socket);function respondWithRpcPromise(_0x301b98,_0xea1be2,_0x5126de){return new BPromise(function(_0x4a76b1,_0x5bd8b6){return client[_0x34ea('0xe')](_0x301b98,_0x5126de)[_0x34ea('0xf')](function(_0x58bb0d){logger[_0x34ea('0x10')](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));logger[_0x34ea('0x13')](_0x34ea('0x14'),_0xea1be2,_0x34ea('0x12'),JSON[_0x34ea('0x15')](_0x58bb0d));if(_0x58bb0d[_0x34ea('0x16')]){if(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x17')]===0x1f4){logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x5bd8b6(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x4a76b1(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}else{logger['info'](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));_0x4a76b1(_0x58bb0d[_0x34ea('0x19')]['message']);}})[_0x34ea('0x1a')](function(_0x1353de){logger[_0x34ea('0x16')](_0x34ea('0x11'),_0xea1be2,_0x1353de);_0x5bd8b6(_0x1353de);});});}exports['CreateFaxMessage']=function(_0x2eea57){var _0x35328c=this;return new Promise(function(_0x287aaa,_0x247ee7){return db['FaxMessage']['create'](_0x2eea57[_0x34ea('0x1b')],{'raw':_0x2eea57[_0x34ea('0x1c')]?_0x2eea57[_0x34ea('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2eafc6){logger[_0x34ea('0x10')](_0x34ea('0x1d'),_0x2eea57);logger[_0x34ea('0x13')](_0x34ea('0x1d'),_0x2eea57,JSON[_0x34ea('0x15')](_0x2eafc6));_0x287aaa(_0x2eafc6);})['catch'](function(_0xf24962){logger[_0x34ea('0x16')](_0x34ea('0x1d'),_0xf24962[_0x34ea('0x18')],_0x2eea57);_0x247ee7(_0x35328c['error'](0x1f4,_0xf24962['message']));});});};exports['UpdateFaxMessage']=function(_0x142709){var _0x187306=this;return new Promise(function(_0x37c214,_0x4204d7){return db['FaxMessage'][_0x34ea('0x1e')](_0x142709[_0x34ea('0x1b')],{'raw':_0x142709[_0x34ea('0x1c')]?_0x142709['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x142709['options']?_0x142709['options'][_0x34ea('0x1f')]||null:null,'attributes':_0x142709[_0x34ea('0x1c')]?_0x142709[_0x34ea('0x1c')][_0x34ea('0x20')]||null:null,'limit':_0x142709['options']?_0x142709[_0x34ea('0x1c')]['limit']||null:null})[_0x34ea('0xf')](function(_0x4f2b77){logger[_0x34ea('0x10')](_0x34ea('0x21'),_0x142709);logger[_0x34ea('0x13')]('UpdateFaxMessage',_0x142709,JSON[_0x34ea('0x15')](_0x4f2b77));_0x37c214(_0x4f2b77);})[_0x34ea('0x1a')](function(_0x55c8ba){logger[_0x34ea('0x16')]('UpdateFaxMessage',_0x55c8ba[_0x34ea('0x18')],_0x142709);_0x4204d7(_0x187306[_0x34ea('0x16')](0x1f4,_0x55c8ba[_0x34ea('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1e459d1..3f57b8c 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 _0x392c=['register','length','faxMessage:','save','update','emit'];(function(_0x54ff1c,_0x53b396){var _0x25079f=function(_0x517089){while(--_0x517089){_0x54ff1c['push'](_0x54ff1c['shift']());}};_0x25079f(++_0x53b396);}(_0x392c,0x6f));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xc392('0x0'),'remove',_0xc392('0x1')];function createListener(_0x5dc737,_0x52305c){return function(_0x5a43e6){_0x52305c[_0xc392('0x2')](_0x5dc737,_0x5a43e6);};}function removeListener(_0x31ac0f,_0xc4980b){return function(){FaxMessageEvents['removeListener'](_0x31ac0f,_0xc4980b);};}exports[_0xc392('0x3')]=function(_0x1eab57){for(var _0xe33b3b=0x0,_0x45ac07=events[_0xc392('0x4')];_0xe33b3b<_0x45ac07;_0xe33b3b++){var _0xbff566=events[_0xe33b3b];var _0x1236e5=createListener(_0xc392('0x5')+_0xbff566,_0x1eab57);FaxMessageEvents['on'](_0xbff566,_0x1236e5);}}; \ No newline at end of file +var _0xb2d0=['save','remove','update','emit','removeListener','register','length'];(function(_0x37a1e9,_0x265e82){var _0x587f78=function(_0x43077c){while(--_0x43077c){_0x37a1e9['push'](_0x37a1e9['shift']());}};_0x587f78(++_0x265e82);}(_0xb2d0,0x134));var _0x0b2d=function(_0x5308f4,_0x71c764){_0x5308f4=_0x5308f4-0x0;var _0x170cbe=_0xb2d0[_0x5308f4];return _0x170cbe;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0b2d('0x0'),_0x0b2d('0x1'),_0x0b2d('0x2')];function createListener(_0x5e16ab,_0x3738f0){return function(_0x2bb080){_0x3738f0[_0x0b2d('0x3')](_0x5e16ab,_0x2bb080);};}function removeListener(_0x52eac3,_0x3522c9){return function(){FaxMessageEvents[_0x0b2d('0x4')](_0x52eac3,_0x3522c9);};}exports[_0x0b2d('0x5')]=function(_0xb928a7){for(var _0x52e094=0x0,_0x5b6b9e=events[_0x0b2d('0x6')];_0x52e094<_0x5b6b9e;_0x52e094++){var _0x1bbd0e=events[_0x52e094];var _0x4a42e0=createListener('faxMessage:'+_0x1bbd0e,_0xb928a7);FaxMessageEvents['on'](_0x1bbd0e,_0x4a42e0);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2185653..eca968a 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 _0x9c44=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxMessage.controller','isAuthenticated','index','get','/describe','/:id','show','download','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/download',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['post']('/',auth[_0x49c4('0x7')](),interaction[_0x49c4('0xe')]('fax','faxmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router['put'](_0x49c4('0x12'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x10')](_0x49c4('0x14'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x15')]);router[_0x49c4('0x16')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x17')]);module[_0x49c4('0x18')]=router; \ No newline at end of file +var _0xb49a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','tracked','fax','create'];(function(_0x582dd0,_0x5466d6){var _0x3c6d27=function(_0x432049){while(--_0x432049){_0x582dd0['push'](_0x582dd0['shift']());}};_0x3c6d27(++_0x5466d6);}(_0xb49a,0xfb));var _0xab49=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xb49a[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var fs_extra=require(_0xab49('0x5'));var auth=require(_0xab49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab49('0x7'));router[_0xab49('0x8')]('/',auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0x8')](_0xab49('0xb'),auth[_0xab49('0x9')](),controller['describe']);router[_0xab49('0x8')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);router[_0xab49('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xab49('0xe')]);router[_0xab49('0xf')]('/',auth[_0xab49('0x9')](),interaction[_0xab49('0x10')](_0xab49('0x11'),'faxmessage:create'),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x14')]);router[_0xab49('0x13')](_0xab49('0x15'),auth[_0xab49('0x9')](),controller[_0xab49('0x16')]);router[_0xab49('0x13')](_0xab49('0x17'),auth['isAuthenticated'](),controller[_0xab49('0x18')]);router[_0xab49('0x19')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 058925a..0d6523d 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 _0x1792=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','beepall'];(function(_0x1b1123,_0x3f3230){var _0x42ed9b=function(_0x5aacd6){while(--_0x5aacd6){_0x1b1123['push'](_0x1b1123['shift']());}};_0x42ed9b(++_0x3f3230);}(_0x1792,0x111));var _0x2179=function(_0x54a687,_0x4ce189){_0x54a687=_0x54a687-0x0;var _0x4b5083=_0x1792[_0x54a687];return _0x4b5083;};'use strict';var Sequelize=require(_0x2179('0x0'));module[_0x2179('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2179('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2179('0x3')]},'timeout':{'type':Sequelize[_0x2179('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2179('0x5')]('rrmemory',_0x2179('0x6'),_0x2179('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2179('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc92d=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc92d,0x198));var _0xdc92=function(_0x321110,_0x2ab011){_0x321110=_0x321110-0x0;var _0x4c29d3=_0xc92d[_0x321110];return _0x4c29d3;};'use strict';var Sequelize=require('sequelize');module[_0xdc92('0x0')]={'name':{'type':Sequelize[_0xdc92('0x1')],'unique':_0xdc92('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdc92('0x1')]},'timeout':{'type':Sequelize[_0xdc92('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xdc92('0x4'),_0xdc92('0x5'),_0xdc92('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdc92('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 546061b..1eb9c5e 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 _0x1da0=['TeamId','includes','all','union','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','error','stack','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','params','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','User','findAndCountAll','UserId','faxPause','createdAt','format','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every'];(function(_0xf6bb80,_0x5dae7f){var _0x267f87=function(_0x1a7af8){while(--_0x1a7af8){_0xf6bb80['push'](_0xf6bb80['shift']());}};_0x267f87(++_0x5dae7f);}(_0x1da0,0x95));var _0x01da=function(_0x2f1f08,_0x158f35){_0x2f1f08=_0x2f1f08-0x0;var _0x32f365=_0x1da0[_0x2f1f08];return _0x32f365;};'use strict';var emlformat=require(_0x01da('0x0'));var rimraf=require(_0x01da('0x1'));var zipdir=require(_0x01da('0x2'));var jsonpatch=require(_0x01da('0x3'));var rp=require('request-promise');var moment=require(_0x01da('0x4'));var BPromise=require(_0x01da('0x5'));var Mustache=require(_0x01da('0x6'));var util=require('util');var path=require('path');var sox=require(_0x01da('0x7'));var csv=require(_0x01da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01da('0x9'));var _=require(_0x01da('0xa'));var squel=require('squel');var crypto=require(_0x01da('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x01da('0xc'));var toCsv=require(_0x01da('0x8'));var querystring=require(_0x01da('0xd'));var Papa=require(_0x01da('0xe'));var Redis=require(_0x01da('0xf'));var authService=require(_0x01da('0x10'));var qs=require(_0x01da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01da('0x12'));var logger=require(_0x01da('0x13'))(_0x01da('0x14'));var utils=require('../../config/utils');var config=require(_0x01da('0x15'));var licenseUtil=require(_0x01da('0x16'));var db=require(_0x01da('0x17'))['db'];config['redis']=_[_0x01da('0x18')](config[_0x01da('0x19')],{'host':_0x01da('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01da('0x19')]));require(_0x01da('0x1b'))['register'](socket);function respondWithStatusCode(_0x112bec,_0x1e489b){_0x1e489b=_0x1e489b||0xcc;return function(_0x45c471){if(_0x45c471){return _0x112bec[_0x01da('0x1c')](_0x1e489b);}return _0x112bec[_0x01da('0x1d')](_0x1e489b)['end']();};}function respondWithResult(_0x160fc7,_0x3e24ee){_0x3e24ee=_0x3e24ee||0xc8;return function(_0x59205f){if(_0x59205f){return _0x160fc7['status'](_0x3e24ee)[_0x01da('0x1e')](_0x59205f);}};}function respondWithFilteredResult(_0x58f018,_0xa5cc28){return function(_0x562f25){if(_0x562f25){var _0x327ab8=typeof _0xa5cc28[_0x01da('0x1f')]===_0x01da('0x20')&&typeof _0xa5cc28[_0x01da('0x21')]===_0x01da('0x20');var _0xbffc65=_0x562f25[_0x01da('0x22')];var _0x189721=_0x327ab8?0x0:_0xa5cc28['offset'];var _0x11c74a=_0x327ab8?_0x562f25[_0x01da('0x22')]:_0xa5cc28['offset']+_0xa5cc28[_0x01da('0x21')];var _0x2c26fd;if(_0x11c74a>=_0xbffc65){_0x11c74a=_0xbffc65;_0x2c26fd=0xc8;}else{_0x2c26fd=0xce;}_0x58f018[_0x01da('0x1d')](_0x2c26fd);return _0x58f018['set']('Content-Range',_0x189721+'-'+_0x11c74a+'/'+_0xbffc65)[_0x01da('0x1e')](_0x562f25);}return null;};}function patchUpdates(_0x46076c){return function(_0x48007e){try{jsonpatch[_0x01da('0x23')](_0x48007e,_0x46076c,!![]);}catch(_0x3c136e){return BPromise['reject'](_0x3c136e);}return _0x48007e[_0x01da('0x24')]();};}function saveUpdates(_0xa9a127,_0x4f3168){return function(_0x73a1ba){if(_0x73a1ba){return _0x73a1ba[_0x01da('0x25')](_0xa9a127)[_0x01da('0x26')](function(_0x5107bf){return _0x5107bf;});}return null;};}function removeEntity(_0x129fe9,_0x1938da){return function(_0x288d26){if(_0x288d26){return _0x288d26[_0x01da('0x27')]()['then'](function(){var _0x4a1457=_0x288d26[_0x01da('0x28')]({'plain':!![]});var _0x3b9928=_0x01da('0x29');return db[_0x01da('0x2a')][_0x01da('0x27')]({'where':{'type':_0x3b9928,'resourceId':_0x4a1457['id']}})[_0x01da('0x26')](function(){return _0x288d26;});})['then'](function(){_0x129fe9[_0x01da('0x1d')](0xcc)[_0x01da('0x2b')]();});}};}function handleEntityNotFound(_0x58a37d,_0x3bd760){return function(_0x376944){if(!_0x376944){_0x58a37d[_0x01da('0x1c')](0x194);}return _0x376944;};}function handleError(_0x523270,_0x412771){_0x412771=_0x412771||0x1f4;return function(_0x3c8fc5){logger[_0x01da('0x2c')](_0x3c8fc5[_0x01da('0x2d')]);if(_0x3c8fc5[_0x01da('0x2e')]){delete _0x3c8fc5['name'];}_0x523270[_0x01da('0x1d')](_0x412771)['send'](_0x3c8fc5);};}exports[_0x01da('0x2f')]=function(_0x337a1b,_0x409e59){var _0x7fe794={},_0x243803={},_0x153a3f={'count':0x0,'rows':[]};var _0x75ee6=_['map'](db['FaxQueue'][_0x01da('0x30')],function(_0x569fed){return{'name':_0x569fed['fieldName'],'type':_0x569fed['type'][_0x01da('0x31')]};});_0x243803[_0x01da('0x32')]=_[_0x01da('0x33')](_0x75ee6,_0x01da('0x2e'));_0x243803[_0x01da('0x34')]=_[_0x01da('0x35')](_0x337a1b[_0x01da('0x34')]);_0x243803[_0x01da('0x36')]=_[_0x01da('0x37')](_0x243803[_0x01da('0x32')],_0x243803[_0x01da('0x34')]);_0x7fe794[_0x01da('0x38')]=_[_0x01da('0x37')](_0x243803['model'],qs[_0x01da('0x39')](_0x337a1b[_0x01da('0x34')][_0x01da('0x39')]));_0x7fe794[_0x01da('0x38')]=_0x7fe794[_0x01da('0x38')][_0x01da('0x3a')]?_0x7fe794[_0x01da('0x38')]:_0x243803[_0x01da('0x32')];if(!_0x337a1b['query'][_0x01da('0x3b')](_0x01da('0x3c'))){_0x7fe794['limit']=qs['limit'](_0x337a1b[_0x01da('0x34')]['limit']);_0x7fe794[_0x01da('0x1f')]=qs[_0x01da('0x1f')](_0x337a1b[_0x01da('0x34')][_0x01da('0x1f')]);}_0x7fe794[_0x01da('0x3d')]=qs[_0x01da('0x3e')](_0x337a1b[_0x01da('0x34')]['sort']);_0x7fe794[_0x01da('0x3f')]=qs[_0x01da('0x36')](_['pick'](_0x337a1b['query'],_0x243803[_0x01da('0x36')]),_0x75ee6);if(_0x337a1b[_0x01da('0x34')][_0x01da('0x40')]){_0x7fe794[_0x01da('0x3f')]=_[_0x01da('0x41')](_0x7fe794[_0x01da('0x3f')],{'$or':_[_0x01da('0x33')](_0x75ee6,function(_0x103516){if(_0x103516['type']!==_0x01da('0x42')){var _0x2e4db4={};_0x2e4db4[_0x103516[_0x01da('0x2e')]]={'$like':'%'+_0x337a1b[_0x01da('0x34')][_0x01da('0x40')]+'%'};return _0x2e4db4;}})});}_0x7fe794=_[_0x01da('0x41')]({},_0x7fe794,_0x337a1b[_0x01da('0x43')]);var _0x2adcfa={'where':_0x7fe794[_0x01da('0x3f')]};return db[_0x01da('0x44')][_0x01da('0x22')](_0x2adcfa)[_0x01da('0x26')](function(_0x183dc4){_0x153a3f['count']=_0x183dc4;if(_0x337a1b[_0x01da('0x34')][_0x01da('0x45')]){_0x7fe794[_0x01da('0x46')]=[{'all':!![]}];}return db[_0x01da('0x44')][_0x01da('0x47')](_0x7fe794);})[_0x01da('0x26')](function(_0x17adc8){_0x153a3f[_0x01da('0x48')]=_0x17adc8;return _0x153a3f;})[_0x01da('0x26')](respondWithFilteredResult(_0x409e59,_0x7fe794))[_0x01da('0x49')](handleError(_0x409e59,null));};exports[_0x01da('0x4a')]=function(_0x365d62,_0x59d931){var _0x4dc2f3={'raw':!![],'where':{'id':_0x365d62['params']['id']}},_0x5ac1d1={};_0x5ac1d1['model']=_['keys'](db[_0x01da('0x44')][_0x01da('0x30')]);_0x5ac1d1[_0x01da('0x34')]=_[_0x01da('0x35')](_0x365d62[_0x01da('0x34')]);_0x5ac1d1['filters']=_[_0x01da('0x37')](_0x5ac1d1['model'],_0x5ac1d1[_0x01da('0x34')]);_0x4dc2f3[_0x01da('0x38')]=_[_0x01da('0x37')](_0x5ac1d1['model'],qs[_0x01da('0x39')](_0x365d62[_0x01da('0x34')][_0x01da('0x39')]));_0x4dc2f3[_0x01da('0x38')]=_0x4dc2f3[_0x01da('0x38')]['length']?_0x4dc2f3[_0x01da('0x38')]:_0x5ac1d1['model'];if(_0x365d62[_0x01da('0x34')][_0x01da('0x45')]){_0x4dc2f3[_0x01da('0x46')]=[{'all':!![]}];}_0x4dc2f3=_[_0x01da('0x41')]({},_0x4dc2f3,_0x365d62[_0x01da('0x43')]);return db[_0x01da('0x44')][_0x01da('0x4b')](_0x4dc2f3)['then'](handleEntityNotFound(_0x59d931,null))['then'](respondWithResult(_0x59d931,null))[_0x01da('0x49')](handleError(_0x59d931,null));};exports[_0x01da('0x4c')]=function(_0x5f5849,_0x47a8a0){return db['FaxQueue']['create'](_0x5f5849[_0x01da('0x4d')],{})['then'](function(_0xcdf65d){var _0x3e313e=_0x5f5849[_0x01da('0x4e')][_0x01da('0x28')]({'plain':!![]});if(!_0x3e313e)throw new Error(_0x01da('0x4f'));if(_0x3e313e['role']===_0x01da('0x4e')){var _0x1c57ad=_0xcdf65d[_0x01da('0x28')]({'plain':!![]});var _0x558ecf=_0x01da('0x29');return db['UserProfileSection'][_0x01da('0x4b')]({'where':{'name':_0x558ecf,'userProfileId':_0x3e313e[_0x01da('0x50')]},'raw':!![]})[_0x01da('0x26')](function(_0x4a88a5){if(_0x4a88a5&&_0x4a88a5['autoAssociation']===0x0){return db['UserProfileResource'][_0x01da('0x4c')]({'name':_0x1c57ad[_0x01da('0x2e')],'resourceId':_0x1c57ad['id'],'type':_0x4a88a5[_0x01da('0x2e')],'sectionId':_0x4a88a5['id']},{})['then'](function(){return _0xcdf65d;});}else{return _0xcdf65d;}})[_0x01da('0x49')](function(_0x807259){logger[_0x01da('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x807259);throw _0x807259;});}return _0xcdf65d;})['then'](respondWithResult(_0x47a8a0,0xc9))[_0x01da('0x49')](handleError(_0x47a8a0,null));};exports[_0x01da('0x25')]=function(_0x9ef23d,_0x459169){if(_0x9ef23d[_0x01da('0x4d')]['id']){delete _0x9ef23d[_0x01da('0x4d')]['id'];}return db[_0x01da('0x44')]['find']({'where':{'id':_0x9ef23d[_0x01da('0x51')]['id']}})[_0x01da('0x26')](handleEntityNotFound(_0x459169,null))[_0x01da('0x26')](saveUpdates(_0x9ef23d[_0x01da('0x4d')],null))[_0x01da('0x26')](respondWithResult(_0x459169,null))[_0x01da('0x49')](handleError(_0x459169,null));};exports[_0x01da('0x27')]=function(_0x9b397b,_0x3d9e1c){return db[_0x01da('0x44')]['find']({'where':{'id':_0x9b397b[_0x01da('0x51')]['id']}})[_0x01da('0x26')](handleEntityNotFound(_0x3d9e1c,null))[_0x01da('0x26')](removeEntity(_0x3d9e1c,null))['catch'](handleError(_0x3d9e1c,null));};exports[_0x01da('0x52')]=function(_0x2486cb,_0x35f013){return db[_0x01da('0x44')][_0x01da('0x52')]()[_0x01da('0x26')](respondWithResult(_0x35f013,null))['catch'](handleError(_0x35f013,null));};exports[_0x01da('0x53')]=function(_0x355f3e,_0x4d1319,_0x3d53af){var _0x13bcf0={'raw':!![],'where':{}},_0x26f979={},_0x106a64;return db[_0x01da('0x44')][_0x01da('0x54')]({'where':{'id':_0x355f3e[_0x01da('0x51')]['id']}})['then'](handleEntityNotFound(_0x4d1319,null))[_0x01da('0x26')](function(_0x853c17){if(_0x853c17){_0x106a64=_0x853c17[_0x01da('0x28')]({'plain':!![]});_0x26f979[_0x01da('0x32')]=_['keys'](db[_0x01da('0x55')][_0x01da('0x30')]);_0x26f979['query']=_[_0x01da('0x35')](_0x355f3e['query']);_0x26f979[_0x01da('0x36')]=_[_0x01da('0x37')](_0x26f979[_0x01da('0x32')],_0x26f979['query']);_0x13bcf0['attributes']=_[_0x01da('0x37')](_0x26f979[_0x01da('0x32')],qs[_0x01da('0x39')](_0x355f3e[_0x01da('0x34')][_0x01da('0x39')]));_0x13bcf0[_0x01da('0x38')]=_0x13bcf0[_0x01da('0x38')][_0x01da('0x3a')]?_0x13bcf0[_0x01da('0x38')]:_0x26f979[_0x01da('0x32')];if(!_0x355f3e[_0x01da('0x34')][_0x01da('0x3b')]('nolimit')){_0x13bcf0[_0x01da('0x21')]=qs['limit'](_0x355f3e[_0x01da('0x34')][_0x01da('0x21')]);_0x13bcf0[_0x01da('0x1f')]=qs[_0x01da('0x1f')](_0x355f3e[_0x01da('0x34')][_0x01da('0x1f')]);}_0x13bcf0[_0x01da('0x3d')]=qs[_0x01da('0x3e')](_0x355f3e[_0x01da('0x34')][_0x01da('0x3e')]);_0x13bcf0[_0x01da('0x3f')]=qs[_0x01da('0x36')](_[_0x01da('0x56')](_0x355f3e[_0x01da('0x34')],_0x26f979[_0x01da('0x36')]));_0x13bcf0[_0x01da('0x3f')][_0x01da('0x57')]=_0x853c17['id'];if(_0x355f3e[_0x01da('0x34')]['filter']){_0x13bcf0[_0x01da('0x3f')]=_['merge'](_0x13bcf0['where'],{'$or':_[_0x01da('0x33')](_0x13bcf0[_0x01da('0x38')],function(_0x54885e){var _0x5d5e68={};_0x5d5e68[_0x54885e]={'$like':'%'+_0x355f3e[_0x01da('0x34')][_0x01da('0x40')]+'%'};return _0x5d5e68;})});}_0x13bcf0=_[_0x01da('0x41')]({},_0x13bcf0,_0x355f3e[_0x01da('0x43')]);return db[_0x01da('0x55')][_0x01da('0x47')](_0x13bcf0);}})[_0x01da('0x26')](function(_0xbc8722){if(_0xbc8722){return db[_0x01da('0x58')][_0x01da('0x59')]({'where':{'id':_['map'](_0xbc8722,_0x01da('0x5a')),'role':'agent'},'attributes':['id','name',_0x01da('0x5b'),'updatedAt',_0x01da('0x5c')]});}})[_0x01da('0x26')](function(_0x11efb0){if(_0x11efb0){return{'count':_0x11efb0['count'],'rows':_['map'](_0x11efb0[_0x01da('0x48')],function(_0x48e8fe){return{'membername':_0x48e8fe[_0x01da('0x2e')],'UserId':_0x48e8fe['id'],'queue_name':_0x106a64[_0x01da('0x2e')],'FaxQueueId':_0x106a64['id'],'interface':util[_0x01da('0x5d')]('%s/%s','SIP',_0x48e8fe[_0x01da('0x2e')]),'penalty':0x0,'paused':_0x48e8fe[_0x01da('0x5b')],'createdAt':_0x48e8fe[_0x01da('0x5c')],'updatedAt':_0x48e8fe[_0x01da('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x01da('0x26')](respondWithFilteredResult(_0x4d1319,_0x13bcf0))[_0x01da('0x49')](handleError(_0x4d1319,null));};exports[_0x01da('0x5f')]=function(_0x371944,_0x1cb3de,_0x18dd24){var _0x5510b3={};var _0x360c52={};var _0x26db39;var _0x513be7;return db[_0x01da('0x44')][_0x01da('0x54')]({'where':{'id':_0x371944[_0x01da('0x51')]['id']}})['then'](handleEntityNotFound(_0x1cb3de,null))[_0x01da('0x26')](function(_0x4f7255){if(_0x4f7255){_0x26db39=_0x4f7255;_0x360c52[_0x01da('0x32')]=_[_0x01da('0x35')](db[_0x01da('0x60')][_0x01da('0x30')]);_0x360c52[_0x01da('0x34')]=_[_0x01da('0x35')](_0x371944[_0x01da('0x34')]);_0x360c52[_0x01da('0x36')]=_['intersection'](_0x360c52['model'],_0x360c52[_0x01da('0x34')]);_0x5510b3[_0x01da('0x38')]=_[_0x01da('0x37')](_0x360c52['model'],qs['fields'](_0x371944[_0x01da('0x34')][_0x01da('0x39')]));_0x5510b3[_0x01da('0x38')]=_0x5510b3[_0x01da('0x38')][_0x01da('0x3a')]?_0x5510b3[_0x01da('0x38')]:_0x360c52[_0x01da('0x32')];_0x5510b3[_0x01da('0x3d')]=qs[_0x01da('0x3e')](_0x371944[_0x01da('0x34')][_0x01da('0x3e')]);_0x5510b3[_0x01da('0x3f')]=qs['filters'](_[_0x01da('0x56')](_0x371944[_0x01da('0x34')],_0x360c52[_0x01da('0x36')]));if(_0x371944[_0x01da('0x34')][_0x01da('0x40')]){_0x5510b3[_0x01da('0x3f')]=_[_0x01da('0x41')](_0x5510b3[_0x01da('0x3f')],{'$or':_[_0x01da('0x33')](_0x5510b3[_0x01da('0x38')],function(_0x35680a){var _0x303438={};_0x303438[_0x35680a]={'$like':'%'+_0x371944[_0x01da('0x34')][_0x01da('0x40')]+'%'};return _0x303438;})});}_0x5510b3=_[_0x01da('0x41')]({},_0x5510b3,_0x371944[_0x01da('0x43')]);return _0x26db39[_0x01da('0x5f')](_0x5510b3);}})['then'](function(_0x285c8c){if(_0x285c8c){_0x513be7=_0x285c8c[_0x01da('0x3a')];if(!_0x371944[_0x01da('0x34')][_0x01da('0x3b')](_0x01da('0x3c'))){_0x5510b3[_0x01da('0x21')]=qs[_0x01da('0x21')](_0x371944[_0x01da('0x34')][_0x01da('0x21')]);_0x5510b3['offset']=qs[_0x01da('0x1f')](_0x371944[_0x01da('0x34')]['offset']);}return _0x26db39[_0x01da('0x5f')](_0x5510b3);}})[_0x01da('0x26')](function(_0x32a3e8){if(_0x32a3e8){return _0x32a3e8?{'count':_0x513be7,'rows':_0x32a3e8}:null;}})[_0x01da('0x26')](respondWithResult(_0x1cb3de,null))[_0x01da('0x49')](handleError(_0x1cb3de,null));};exports[_0x01da('0x61')]=function(_0x5afd2d,_0x93583b,_0x47d56e){var _0x25bf0a=_0x5afd2d[_0x01da('0x4d')][_0x01da('0x62')];return db[_0x01da('0x60')][_0x01da('0x47')]({'where':{'id':_0x25bf0a},'attributes':['id'],'include':[{'model':db[_0x01da('0x58')],'as':_0x01da('0x63'),'attributes':['id',_0x01da('0x2e'),_0x01da('0x64'),_0x01da('0x65'),'interface'],'raw':!![]}]})[_0x01da('0x26')](function(_0x183036){if(_0x183036){var _0x10f9d3=_[_0x01da('0x66')](_0x183036,function(_0x4ad104){var _0x530f31=_0x4ad104[_0x01da('0x28')]({'plain':!![]});return _0x530f31[_0x01da('0x63')];});return db[_0x01da('0x44')][_0x01da('0x4b')]({'where':{'id':_0x5afd2d[_0x01da('0x51')]['id']}})['then'](function(_0x227f5b){return db[_0x01da('0x67')][_0x01da('0x68')](function(_0x34a0f9){return _0x227f5b[_0x01da('0x61')](_0x25bf0a,{'transaction':_0x34a0f9})['then'](function(){return BPromise[_0x01da('0x69')](_0x10f9d3,function(_0x19acec){return db[_0x01da('0x55')][_0x01da('0x6a')]({'where':{'UserId':_0x19acec['id'],'FaxQueueId':_0x5afd2d[_0x01da('0x51')]['id']},'transaction':_0x34a0f9});});})[_0x01da('0x26')](function(){_0x10f9d3[_0x01da('0x6b')](function(_0x54745c){socket[_0x01da('0x6c')](_0x01da('0x6d'),{'UserId':_0x54745c['id'],'FaxQueueId':_0x227f5b['id']});});});});});}})[_0x01da('0x26')](respondWithStatusCode(_0x93583b,null))[_0x01da('0x49')](handleError(_0x93583b,null));};exports['removeTeams']=function(_0x805fc8,_0x1b3f9e,_0x4a8586){return db[_0x01da('0x60')][_0x01da('0x47')]({'where':{'id':_0x805fc8[_0x01da('0x34')][_0x01da('0x62')]},'attributes':['id'],'include':[{'model':db[_0x01da('0x58')],'as':_0x01da('0x63'),'attributes':['id'],'raw':!![]}]})[_0x01da('0x26')](handleEntityNotFound(_0x1b3f9e,null))[_0x01da('0x26')](function(_0x2ca983){var _0x38d53c=_[_0x01da('0x33')](_0x2ca983,'id');var _0x2c2aac=[];var _0x48d700=[];var _0x402f86=squel[_0x01da('0x6e')]();_0x402f86[_0x01da('0x6f')](_0x01da('0x70'))['from']('team_has_fax_queues','tq')['join'](_0x01da('0x71'),'ut',_0x01da('0x72'))[_0x01da('0x3f')](_0x01da('0x73'),_0x805fc8['params']['id']);for(var _0xad25d4=0x0;_0xad25d4<_0x2ca983[_0x01da('0x3a')];_0xad25d4+=0x1){let _0x1acd8b=_0x2ca983[_0xad25d4];for(var _0x4d89c7=0x0;_0x4d89c7<_0x1acd8b[_0x01da('0x63')][_0x01da('0x3a')];_0x4d89c7+=0x1){let _0x1ef882=_0x1acd8b['Agents'][_0x4d89c7];var _0x5c4c76=_0x402f86[_0x01da('0x74')]();_0x5c4c76[_0x01da('0x3f')](_0x01da('0x75'),_0x1ef882['id']);_0x48d700[_0x01da('0x76')](db[_0x01da('0x67')]['query'](_0x5c4c76[_0x01da('0x77')](),{'type':db['sequelize'][_0x01da('0x78')][_0x01da('0x79')]})[_0x01da('0x26')](function(_0x28763c){if(_0x28763c[_0x01da('0x3a')]===0x1){return _0x1ef882['id'];}else{var _0x2d5e59=_[_0x01da('0x7a')](_['map'](_0x28763c,_0x01da('0x7b')),function(_0x1ad588){return _[_0x01da('0x7c')](_0x38d53c,_0x1ad588);});if(_0x2d5e59){return _0x1ef882['id'];}}}));}}return BPromise[_0x01da('0x7d')](_0x48d700)[_0x01da('0x26')](function(_0xe3c45a){_0x2c2aac=_(_0x2c2aac)[_0x01da('0x7e')](_0xe3c45a)['compact']()[_0x01da('0x7f')]();return db[_0x01da('0x44')][_0x01da('0x4b')]({'where':{'id':_0x805fc8[_0x01da('0x51')]['id']}})[_0x01da('0x26')](function(_0x1b61c9){return db['sequelize']['transaction'](function(_0x574cd7){return _0x1b61c9['removeTeams'](_0x805fc8['query'][_0x01da('0x62')],{'transaction':_0x574cd7})[_0x01da('0x26')](function(){if(!_[_0x01da('0x80')](_0x2c2aac)){return _0x1b61c9['removeAgents'](_0x2c2aac,{'transaction':_0x574cd7});}})[_0x01da('0x26')](function(){_0x2c2aac[_0x01da('0x6b')](function(_0x214103){socket['emit'](_0x01da('0x81'),{'UserId':_0x214103,'FaxQueueId':_0x1b61c9['id']});});});});});});})[_0x01da('0x26')](respondWithStatusCode(_0x1b3f9e,null))['catch'](handleError(_0x1b3f9e,null));};exports[_0x01da('0x82')]=function(_0x5025f4,_0x5e3179,_0x5433cc){return db['FaxQueue'][_0x01da('0x4b')]({'where':{'id':_0x5025f4['params']['id']}})['then'](handleEntityNotFound(_0x5e3179,null))[_0x01da('0x26')](function(_0x3b5bba){if(_0x3b5bba){return _0x3b5bba['addAgents'](_0x5025f4[_0x01da('0x4d')]['ids'],_[_0x01da('0x83')](_0x5025f4[_0x01da('0x4d')],[_0x01da('0x62'),'id'])||{})[_0x01da('0x84')](function(_0x34bd69){for(var _0x45cc38=0x0;_0x45cc38<_0x5025f4['body'][_0x01da('0x62')][_0x01da('0x3a')];_0x45cc38+=0x1){socket[_0x01da('0x6c')](_0x01da('0x6d'),{'UserId':Number(_0x5025f4['body'][_0x01da('0x62')][_0x45cc38]),'FaxQueueId':Number(_0x5025f4['params']['id'])});}return _0x34bd69;});}})['then'](respondWithResult(_0x5e3179,null))[_0x01da('0x49')](handleError(_0x5e3179,null));};exports[_0x01da('0x85')]=function(_0x5a8133,_0x36004d,_0xcbca58){return db[_0x01da('0x44')][_0x01da('0x4b')]({'where':{'id':_0x5a8133[_0x01da('0x51')]['id']}})[_0x01da('0x26')](handleEntityNotFound(_0x36004d,null))[_0x01da('0x26')](function(_0x2d1123){if(_0x2d1123){return _0x2d1123['removeAgents'](_0x5a8133[_0x01da('0x34')]['ids'])['then'](function(){if(_[_0x01da('0x86')](_0x5a8133[_0x01da('0x34')][_0x01da('0x62')])){for(var _0x27fc56=0x0;_0x27fc56<_0x5a8133[_0x01da('0x34')][_0x01da('0x62')][_0x01da('0x3a')];_0x27fc56+=0x1){socket['emit'](_0x01da('0x81'),{'UserId':Number(_0x5a8133[_0x01da('0x34')]['ids'][_0x27fc56]),'FaxQueueId':Number(_0x5a8133[_0x01da('0x51')]['id'])});}}else{socket[_0x01da('0x6c')](_0x01da('0x81'),{'UserId':Number(_0x5a8133['query']['ids']),'FaxQueueId':Number(_0x5a8133[_0x01da('0x51')]['id'])});}});}})[_0x01da('0x26')](respondWithStatusCode(_0x36004d,null))[_0x01da('0x49')](handleError(_0x36004d,null));};exports[_0x01da('0x87')]=function(_0xaf6545,_0x2edf40,_0x49d1fc){var _0x54cba5={};var _0x30a844={};var _0x7181a6;var _0x3833fb;return db[_0x01da('0x44')]['findOne']({'where':{'id':_0xaf6545['params']['id']}})[_0x01da('0x26')](handleEntityNotFound(_0x2edf40,null))[_0x01da('0x26')](function(_0x499ce4){if(_0x499ce4){_0x7181a6=_0x499ce4;_0x30a844[_0x01da('0x32')]=_[_0x01da('0x35')](db['User'][_0x01da('0x30')]);_0x30a844[_0x01da('0x34')]=_[_0x01da('0x35')](_0xaf6545['query']);_0x30a844[_0x01da('0x36')]=_['intersection'](_0x30a844[_0x01da('0x32')],_0x30a844[_0x01da('0x34')]);_0x54cba5[_0x01da('0x38')]=_[_0x01da('0x37')](_0x30a844['model'],qs[_0x01da('0x39')](_0xaf6545[_0x01da('0x34')][_0x01da('0x39')]));_0x54cba5[_0x01da('0x38')]=_0x54cba5['attributes'][_0x01da('0x3a')]?_0x54cba5[_0x01da('0x38')]:_0x30a844['model'];_0x54cba5[_0x01da('0x3d')]=qs[_0x01da('0x3e')](_0xaf6545[_0x01da('0x34')][_0x01da('0x3e')]);_0x54cba5['where']=qs[_0x01da('0x36')](_[_0x01da('0x56')](_0xaf6545[_0x01da('0x34')],_0x30a844[_0x01da('0x36')]));if(_0xaf6545[_0x01da('0x34')][_0x01da('0x40')]){_0x54cba5[_0x01da('0x3f')]=_[_0x01da('0x41')](_0x54cba5[_0x01da('0x3f')],{'$or':_['map'](_0x54cba5[_0x01da('0x38')],function(_0x1b22ce){var _0x2550fe={};_0x2550fe[_0x1b22ce]={'$like':'%'+_0xaf6545['query']['filter']+'%'};return _0x2550fe;})});}_0x54cba5=_[_0x01da('0x41')]({},_0x54cba5,_0xaf6545[_0x01da('0x43')]);return _0x7181a6[_0x01da('0x87')](_0x54cba5);}})['then'](function(_0x132c82){if(_0x132c82){_0x3833fb=_0x132c82['length'];if(!_0xaf6545['query'][_0x01da('0x3b')](_0x01da('0x3c'))){_0x54cba5[_0x01da('0x21')]=qs['limit'](_0xaf6545[_0x01da('0x34')][_0x01da('0x21')]);_0x54cba5[_0x01da('0x1f')]=qs[_0x01da('0x1f')](_0xaf6545[_0x01da('0x34')][_0x01da('0x1f')]);}return _0x7181a6[_0x01da('0x87')](_0x54cba5);}})[_0x01da('0x26')](function(_0x24d390){if(_0x24d390){return _0x24d390?{'count':_0x3833fb,'rows':_0x24d390}:null;}})['then'](respondWithResult(_0x2edf40,null))['catch'](handleError(_0x2edf40,null));}; \ No newline at end of file +var _0x38c4=['lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge','FaxQueue','includeAll','include','findAll','show','params','rawAttributes','fields','find','catch','create','get','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserFaxQueue','hasOwnProperty','order','options','User','findAndCountAll','UserId','faxPause','updatedAt','rows','format','%s/%s','createdAt','Team','getTeams','addTeams','ids','online','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','removeAgents','userFaxQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra'];(function(_0x452fde,_0x50be29){var _0x533b5e=function(_0x7121dd){while(--_0x7121dd){_0x452fde['push'](_0x452fde['shift']());}};_0x533b5e(++_0x50be29);}(_0x38c4,0x10a));var _0x438c=function(_0x529b7a,_0x5c3d68){_0x529b7a=_0x529b7a-0x0;var _0x4995a8=_0x38c4[_0x529b7a];return _0x4995a8;};'use strict';var emlformat=require(_0x438c('0x0'));var rimraf=require(_0x438c('0x1'));var zipdir=require(_0x438c('0x2'));var jsonpatch=require(_0x438c('0x3'));var rp=require(_0x438c('0x4'));var moment=require(_0x438c('0x5'));var BPromise=require(_0x438c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x438c('0x7'));var sox=require(_0x438c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x438c('0x9'));var _=require(_0x438c('0xa'));var squel=require(_0x438c('0xb'));var crypto=require('crypto');var jsforce=require(_0x438c('0xc'));var deskjs=require(_0x438c('0xd'));var toCsv=require(_0x438c('0xe'));var querystring=require(_0x438c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x438c('0x10'));var qs=require(_0x438c('0x11'));var as=require(_0x438c('0x12'));var hardwareService=require(_0x438c('0x13'));var logger=require('../../config/logger')(_0x438c('0x14'));var utils=require(_0x438c('0x15'));var config=require(_0x438c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x438c('0x17'))['db'];config['redis']=_[_0x438c('0x18')](config['redis'],{'host':_0x438c('0x19'),'port':0x18eb});var socket=require(_0x438c('0x1a'))(new Redis(config[_0x438c('0x1b')]));require('./faxQueue.socket')[_0x438c('0x1c')](socket);function respondWithStatusCode(_0x5a5364,_0x244363){_0x244363=_0x244363||0xcc;return function(_0x5eba48){if(_0x5eba48){return _0x5a5364[_0x438c('0x1d')](_0x244363);}return _0x5a5364['status'](_0x244363)[_0x438c('0x1e')]();};}function respondWithResult(_0x23a5b3,_0x152538){_0x152538=_0x152538||0xc8;return function(_0x50f849){if(_0x50f849){return _0x23a5b3['status'](_0x152538)[_0x438c('0x1f')](_0x50f849);}};}function respondWithFilteredResult(_0x196dde,_0x527b1f){return function(_0x2440b9){if(_0x2440b9){var _0x1420b2=typeof _0x527b1f[_0x438c('0x20')]===_0x438c('0x21')&&typeof _0x527b1f[_0x438c('0x22')]==='undefined';var _0x15e237=_0x2440b9[_0x438c('0x23')];var _0x196434=_0x1420b2?0x0:_0x527b1f[_0x438c('0x20')];var _0x14b497=_0x1420b2?_0x2440b9[_0x438c('0x23')]:_0x527b1f[_0x438c('0x20')]+_0x527b1f['limit'];var _0x319583;if(_0x14b497>=_0x15e237){_0x14b497=_0x15e237;_0x319583=0xc8;}else{_0x319583=0xce;}_0x196dde[_0x438c('0x24')](_0x319583);return _0x196dde[_0x438c('0x25')](_0x438c('0x26'),_0x196434+'-'+_0x14b497+'/'+_0x15e237)[_0x438c('0x1f')](_0x2440b9);}return null;};}function patchUpdates(_0x41363a){return function(_0xa46421){try{jsonpatch[_0x438c('0x27')](_0xa46421,_0x41363a,!![]);}catch(_0x2520d1){return BPromise[_0x438c('0x28')](_0x2520d1);}return _0xa46421[_0x438c('0x29')]();};}function saveUpdates(_0x1cbc9b,_0x1e0e5b){return function(_0x3fe1d4){if(_0x3fe1d4){return _0x3fe1d4[_0x438c('0x2a')](_0x1cbc9b)[_0x438c('0x2b')](function(_0x14d38f){return _0x14d38f;});}return null;};}function removeEntity(_0x463574,_0x3402cd){return function(_0x3360f4){if(_0x3360f4){return _0x3360f4[_0x438c('0x2c')]()[_0x438c('0x2b')](function(){var _0xaca86c=_0x3360f4['get']({'plain':!![]});var _0x308956=_0x438c('0x2d');return db[_0x438c('0x2e')]['destroy']({'where':{'type':_0x308956,'resourceId':_0xaca86c['id']}})[_0x438c('0x2b')](function(){return _0x3360f4;});})[_0x438c('0x2b')](function(){_0x463574[_0x438c('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d2c57,_0x87f821){return function(_0x18c475){if(!_0x18c475){_0x1d2c57[_0x438c('0x1d')](0x194);}return _0x18c475;};}function handleError(_0x27f4ad,_0x3f3759){_0x3f3759=_0x3f3759||0x1f4;return function(_0x10ca15){logger[_0x438c('0x2f')](_0x10ca15[_0x438c('0x30')]);if(_0x10ca15['name']){delete _0x10ca15[_0x438c('0x31')];}_0x27f4ad[_0x438c('0x24')](_0x3f3759)[_0x438c('0x32')](_0x10ca15);};}exports[_0x438c('0x33')]=function(_0x37dd30,_0x188774){var _0x3c1f59={},_0x638f3e={},_0x37392c={'count':0x0,'rows':[]};var _0x15e796=_[_0x438c('0x34')](db['FaxQueue']['rawAttributes'],function(_0x3a751d){return{'name':_0x3a751d['fieldName'],'type':_0x3a751d[_0x438c('0x35')]['key']};});_0x638f3e[_0x438c('0x36')]=_['map'](_0x15e796,_0x438c('0x31'));_0x638f3e[_0x438c('0x37')]=_[_0x438c('0x38')](_0x37dd30[_0x438c('0x37')]);_0x638f3e[_0x438c('0x39')]=_[_0x438c('0x3a')](_0x638f3e[_0x438c('0x36')],_0x638f3e[_0x438c('0x37')]);_0x3c1f59[_0x438c('0x3b')]=_['intersection'](_0x638f3e[_0x438c('0x36')],qs['fields'](_0x37dd30['query']['fields']));_0x3c1f59[_0x438c('0x3b')]=_0x3c1f59['attributes'][_0x438c('0x3c')]?_0x3c1f59[_0x438c('0x3b')]:_0x638f3e[_0x438c('0x36')];if(!_0x37dd30[_0x438c('0x37')]['hasOwnProperty'](_0x438c('0x3d'))){_0x3c1f59[_0x438c('0x22')]=qs['limit'](_0x37dd30[_0x438c('0x37')][_0x438c('0x22')]);_0x3c1f59['offset']=qs[_0x438c('0x20')](_0x37dd30[_0x438c('0x37')][_0x438c('0x20')]);}_0x3c1f59['order']=qs[_0x438c('0x3e')](_0x37dd30['query'][_0x438c('0x3e')]);_0x3c1f59['where']=qs[_0x438c('0x39')](_[_0x438c('0x3f')](_0x37dd30[_0x438c('0x37')],_0x638f3e[_0x438c('0x39')]),_0x15e796);if(_0x37dd30[_0x438c('0x37')][_0x438c('0x40')]){_0x3c1f59[_0x438c('0x41')]=_['merge'](_0x3c1f59['where'],{'$or':_[_0x438c('0x34')](_0x15e796,function(_0x2664e7){if(_0x2664e7[_0x438c('0x35')]!=='VIRTUAL'){var _0x44997e={};_0x44997e[_0x2664e7[_0x438c('0x31')]]={'$like':'%'+_0x37dd30['query'][_0x438c('0x40')]+'%'};return _0x44997e;}})});}_0x3c1f59=_[_0x438c('0x42')]({},_0x3c1f59,_0x37dd30['options']);var _0x1e3955={'where':_0x3c1f59[_0x438c('0x41')]};return db[_0x438c('0x43')]['count'](_0x1e3955)[_0x438c('0x2b')](function(_0x399479){_0x37392c[_0x438c('0x23')]=_0x399479;if(_0x37dd30[_0x438c('0x37')][_0x438c('0x44')]){_0x3c1f59[_0x438c('0x45')]=[{'all':!![]}];}return db[_0x438c('0x43')][_0x438c('0x46')](_0x3c1f59);})[_0x438c('0x2b')](function(_0x5a6208){_0x37392c['rows']=_0x5a6208;return _0x37392c;})[_0x438c('0x2b')](respondWithFilteredResult(_0x188774,_0x3c1f59))['catch'](handleError(_0x188774,null));};exports[_0x438c('0x47')]=function(_0x5341e9,_0x512aad){var _0x2d3f61={'raw':!![],'where':{'id':_0x5341e9[_0x438c('0x48')]['id']}},_0x5eb4f2={};_0x5eb4f2[_0x438c('0x36')]=_[_0x438c('0x38')](db[_0x438c('0x43')][_0x438c('0x49')]);_0x5eb4f2[_0x438c('0x37')]=_[_0x438c('0x38')](_0x5341e9[_0x438c('0x37')]);_0x5eb4f2[_0x438c('0x39')]=_[_0x438c('0x3a')](_0x5eb4f2[_0x438c('0x36')],_0x5eb4f2[_0x438c('0x37')]);_0x2d3f61['attributes']=_[_0x438c('0x3a')](_0x5eb4f2[_0x438c('0x36')],qs[_0x438c('0x4a')](_0x5341e9[_0x438c('0x37')][_0x438c('0x4a')]));_0x2d3f61['attributes']=_0x2d3f61[_0x438c('0x3b')][_0x438c('0x3c')]?_0x2d3f61[_0x438c('0x3b')]:_0x5eb4f2['model'];if(_0x5341e9[_0x438c('0x37')][_0x438c('0x44')]){_0x2d3f61['include']=[{'all':!![]}];}_0x2d3f61=_[_0x438c('0x42')]({},_0x2d3f61,_0x5341e9['options']);return db[_0x438c('0x43')][_0x438c('0x4b')](_0x2d3f61)[_0x438c('0x2b')](handleEntityNotFound(_0x512aad,null))['then'](respondWithResult(_0x512aad,null))[_0x438c('0x4c')](handleError(_0x512aad,null));};exports[_0x438c('0x4d')]=function(_0x4cf2c1,_0x32b402){return db['FaxQueue']['create'](_0x4cf2c1['body'],{})[_0x438c('0x2b')](function(_0x538ca4){var _0x203257=_0x4cf2c1['user'][_0x438c('0x4e')]({'plain':!![]});if(!_0x203257)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203257['role']===_0x438c('0x4f')){var _0xe4e9f5=_0x538ca4[_0x438c('0x4e')]({'plain':!![]});var _0x10713e=_0x438c('0x2d');return db[_0x438c('0x50')]['find']({'where':{'name':_0x10713e,'userProfileId':_0x203257[_0x438c('0x51')]},'raw':!![]})[_0x438c('0x2b')](function(_0x2ae464){if(_0x2ae464&&_0x2ae464[_0x438c('0x52')]===0x0){return db['UserProfileResource'][_0x438c('0x4d')]({'name':_0xe4e9f5[_0x438c('0x31')],'resourceId':_0xe4e9f5['id'],'type':_0x2ae464[_0x438c('0x31')],'sectionId':_0x2ae464['id']},{})[_0x438c('0x2b')](function(){return _0x538ca4;});}else{return _0x538ca4;}})[_0x438c('0x4c')](function(_0x3dddf3){logger[_0x438c('0x2f')](_0x438c('0x53'),_0x3dddf3);throw _0x3dddf3;});}return _0x538ca4;})[_0x438c('0x2b')](respondWithResult(_0x32b402,0xc9))['catch'](handleError(_0x32b402,null));};exports[_0x438c('0x2a')]=function(_0x3bf2f3,_0x5d8fab){if(_0x3bf2f3['body']['id']){delete _0x3bf2f3[_0x438c('0x54')]['id'];}return db[_0x438c('0x43')]['find']({'where':{'id':_0x3bf2f3[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](handleEntityNotFound(_0x5d8fab,null))[_0x438c('0x2b')](saveUpdates(_0x3bf2f3[_0x438c('0x54')],null))[_0x438c('0x2b')](respondWithResult(_0x5d8fab,null))[_0x438c('0x4c')](handleError(_0x5d8fab,null));};exports[_0x438c('0x2c')]=function(_0x1c9a6f,_0x30e2ab){return db[_0x438c('0x43')][_0x438c('0x4b')]({'where':{'id':_0x1c9a6f[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](handleEntityNotFound(_0x30e2ab,null))[_0x438c('0x2b')](removeEntity(_0x30e2ab,null))[_0x438c('0x4c')](handleError(_0x30e2ab,null));};exports['describe']=function(_0x4207af,_0x29ce6f){return db[_0x438c('0x43')]['describe']()['then'](respondWithResult(_0x29ce6f,null))['catch'](handleError(_0x29ce6f,null));};exports[_0x438c('0x55')]=function(_0x297ebb,_0x3bc701,_0x121890){var _0x2ea44b={'raw':!![],'where':{}},_0x4c995b={},_0x54ea4f;return db[_0x438c('0x43')][_0x438c('0x56')]({'where':{'id':_0x297ebb[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](handleEntityNotFound(_0x3bc701,null))['then'](function(_0xbd6ae1){if(_0xbd6ae1){_0x54ea4f=_0xbd6ae1[_0x438c('0x4e')]({'plain':!![]});_0x4c995b[_0x438c('0x36')]=_['keys'](db[_0x438c('0x57')][_0x438c('0x49')]);_0x4c995b[_0x438c('0x37')]=_[_0x438c('0x38')](_0x297ebb[_0x438c('0x37')]);_0x4c995b['filters']=_[_0x438c('0x3a')](_0x4c995b[_0x438c('0x36')],_0x4c995b[_0x438c('0x37')]);_0x2ea44b[_0x438c('0x3b')]=_[_0x438c('0x3a')](_0x4c995b[_0x438c('0x36')],qs[_0x438c('0x4a')](_0x297ebb[_0x438c('0x37')][_0x438c('0x4a')]));_0x2ea44b['attributes']=_0x2ea44b[_0x438c('0x3b')]['length']?_0x2ea44b[_0x438c('0x3b')]:_0x4c995b[_0x438c('0x36')];if(!_0x297ebb['query'][_0x438c('0x58')](_0x438c('0x3d'))){_0x2ea44b[_0x438c('0x22')]=qs[_0x438c('0x22')](_0x297ebb[_0x438c('0x37')]['limit']);_0x2ea44b['offset']=qs[_0x438c('0x20')](_0x297ebb[_0x438c('0x37')]['offset']);}_0x2ea44b[_0x438c('0x59')]=qs['sort'](_0x297ebb['query']['sort']);_0x2ea44b[_0x438c('0x41')]=qs['filters'](_[_0x438c('0x3f')](_0x297ebb['query'],_0x4c995b[_0x438c('0x39')]));_0x2ea44b[_0x438c('0x41')]['FaxQueueId']=_0xbd6ae1['id'];if(_0x297ebb[_0x438c('0x37')]['filter']){_0x2ea44b[_0x438c('0x41')]=_[_0x438c('0x42')](_0x2ea44b[_0x438c('0x41')],{'$or':_['map'](_0x2ea44b[_0x438c('0x3b')],function(_0x84a461){var _0x258cf6={};_0x258cf6[_0x84a461]={'$like':'%'+_0x297ebb[_0x438c('0x37')][_0x438c('0x40')]+'%'};return _0x258cf6;})});}_0x2ea44b=_[_0x438c('0x42')]({},_0x2ea44b,_0x297ebb[_0x438c('0x5a')]);return db[_0x438c('0x57')][_0x438c('0x46')](_0x2ea44b);}})[_0x438c('0x2b')](function(_0x205f48){if(_0x205f48){return db[_0x438c('0x5b')][_0x438c('0x5c')]({'where':{'id':_[_0x438c('0x34')](_0x205f48,_0x438c('0x5d')),'role':'agent'},'attributes':['id',_0x438c('0x31'),_0x438c('0x5e'),_0x438c('0x5f'),'createdAt']});}})[_0x438c('0x2b')](function(_0x3f75cf){if(_0x3f75cf){return{'count':_0x3f75cf[_0x438c('0x23')],'rows':_[_0x438c('0x34')](_0x3f75cf[_0x438c('0x60')],function(_0x399959){return{'membername':_0x399959[_0x438c('0x31')],'UserId':_0x399959['id'],'queue_name':_0x54ea4f[_0x438c('0x31')],'FaxQueueId':_0x54ea4f['id'],'interface':util[_0x438c('0x61')](_0x438c('0x62'),'SIP',_0x399959[_0x438c('0x31')]),'penalty':0x0,'paused':_0x399959[_0x438c('0x5e')],'createdAt':_0x399959[_0x438c('0x63')],'updatedAt':_0x399959[_0x438c('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x438c('0x2b')](respondWithFilteredResult(_0x3bc701,_0x2ea44b))[_0x438c('0x4c')](handleError(_0x3bc701,null));};exports['getTeams']=function(_0xd61e98,_0x1a200f,_0x444390){var _0x175f36={};var _0x238043={};var _0x3ef1af;var _0x22ec19;return db[_0x438c('0x43')]['findOne']({'where':{'id':_0xd61e98['params']['id']}})['then'](handleEntityNotFound(_0x1a200f,null))[_0x438c('0x2b')](function(_0x2314e6){if(_0x2314e6){_0x3ef1af=_0x2314e6;_0x238043[_0x438c('0x36')]=_[_0x438c('0x38')](db[_0x438c('0x64')]['rawAttributes']);_0x238043[_0x438c('0x37')]=_[_0x438c('0x38')](_0xd61e98['query']);_0x238043[_0x438c('0x39')]=_[_0x438c('0x3a')](_0x238043[_0x438c('0x36')],_0x238043[_0x438c('0x37')]);_0x175f36['attributes']=_[_0x438c('0x3a')](_0x238043['model'],qs[_0x438c('0x4a')](_0xd61e98['query'][_0x438c('0x4a')]));_0x175f36[_0x438c('0x3b')]=_0x175f36[_0x438c('0x3b')]['length']?_0x175f36[_0x438c('0x3b')]:_0x238043[_0x438c('0x36')];_0x175f36[_0x438c('0x59')]=qs[_0x438c('0x3e')](_0xd61e98[_0x438c('0x37')][_0x438c('0x3e')]);_0x175f36[_0x438c('0x41')]=qs['filters'](_[_0x438c('0x3f')](_0xd61e98[_0x438c('0x37')],_0x238043[_0x438c('0x39')]));if(_0xd61e98['query'][_0x438c('0x40')]){_0x175f36[_0x438c('0x41')]=_[_0x438c('0x42')](_0x175f36[_0x438c('0x41')],{'$or':_['map'](_0x175f36[_0x438c('0x3b')],function(_0x2a5b7e){var _0x1b5e38={};_0x1b5e38[_0x2a5b7e]={'$like':'%'+_0xd61e98[_0x438c('0x37')][_0x438c('0x40')]+'%'};return _0x1b5e38;})});}_0x175f36=_['merge']({},_0x175f36,_0xd61e98['options']);return _0x3ef1af[_0x438c('0x65')](_0x175f36);}})[_0x438c('0x2b')](function(_0xd99a5c){if(_0xd99a5c){_0x22ec19=_0xd99a5c[_0x438c('0x3c')];if(!_0xd61e98[_0x438c('0x37')][_0x438c('0x58')](_0x438c('0x3d'))){_0x175f36[_0x438c('0x22')]=qs[_0x438c('0x22')](_0xd61e98[_0x438c('0x37')]['limit']);_0x175f36[_0x438c('0x20')]=qs[_0x438c('0x20')](_0xd61e98['query'][_0x438c('0x20')]);}return _0x3ef1af[_0x438c('0x65')](_0x175f36);}})[_0x438c('0x2b')](function(_0x451f85){if(_0x451f85){return _0x451f85?{'count':_0x22ec19,'rows':_0x451f85}:null;}})['then'](respondWithResult(_0x1a200f,null))[_0x438c('0x4c')](handleError(_0x1a200f,null));};exports[_0x438c('0x66')]=function(_0x2e3f3f,_0x1abfa3,_0x590cdb){var _0x12281f=_0x2e3f3f[_0x438c('0x54')][_0x438c('0x67')];return db[_0x438c('0x64')][_0x438c('0x46')]({'where':{'id':_0x12281f},'attributes':['id'],'include':[{'model':db[_0x438c('0x5b')],'as':'Agents','attributes':['id',_0x438c('0x31'),_0x438c('0x68'),_0x438c('0x69'),_0x438c('0x6a')],'raw':!![]}]})['then'](function(_0x563adb){if(_0x563adb){var _0x139cb4=_['flatMap'](_0x563adb,function(_0x3cb975){var _0x1168c5=_0x3cb975[_0x438c('0x4e')]({'plain':!![]});return _0x1168c5[_0x438c('0x6b')];});return db[_0x438c('0x43')][_0x438c('0x4b')]({'where':{'id':_0x2e3f3f[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](function(_0x2e5a55){return db[_0x438c('0x6c')][_0x438c('0x6d')](function(_0x85aad8){return _0x2e5a55[_0x438c('0x66')](_0x12281f,{'transaction':_0x85aad8})['then'](function(){return BPromise[_0x438c('0x6e')](_0x139cb4,function(_0x3c77ea){return db['UserFaxQueue'][_0x438c('0x6f')]({'where':{'UserId':_0x3c77ea['id'],'FaxQueueId':_0x2e3f3f['params']['id']},'transaction':_0x85aad8});});})[_0x438c('0x2b')](function(){_0x139cb4['forEach'](function(_0xdc5e63){socket[_0x438c('0x70')](_0x438c('0x71'),{'UserId':_0xdc5e63['id'],'FaxQueueId':_0x2e5a55['id']});});});});});}})[_0x438c('0x2b')](respondWithStatusCode(_0x1abfa3,null))[_0x438c('0x4c')](handleError(_0x1abfa3,null));};exports[_0x438c('0x72')]=function(_0x46d39e,_0x4e2968,_0x434c71){return db[_0x438c('0x64')][_0x438c('0x46')]({'where':{'id':_0x46d39e[_0x438c('0x37')][_0x438c('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x438c('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x438c('0x2b')](handleEntityNotFound(_0x4e2968,null))['then'](function(_0x191119){var _0xd540f4=_['map'](_0x191119,'id');var _0x5374bb=[];var _0x1fde1a=[];var _0x4bde92=squel[_0x438c('0x73')]();_0x4bde92[_0x438c('0x74')]('tq.TeamId')[_0x438c('0x75')](_0x438c('0x76'),'tq')[_0x438c('0x77')](_0x438c('0x78'),'ut',_0x438c('0x79'))[_0x438c('0x41')](_0x438c('0x7a'),_0x46d39e[_0x438c('0x48')]['id']);for(var _0x16e237=0x0;_0x16e237<_0x191119[_0x438c('0x3c')];_0x16e237+=0x1){let _0x232764=_0x191119[_0x16e237];for(var _0x2256ec=0x0;_0x2256ec<_0x232764['Agents']['length'];_0x2256ec+=0x1){let _0x58d02=_0x232764[_0x438c('0x6b')][_0x2256ec];var _0x4d072a=_0x4bde92[_0x438c('0x7b')]();_0x4d072a[_0x438c('0x41')](_0x438c('0x7c'),_0x58d02['id']);_0x1fde1a[_0x438c('0x7d')](db[_0x438c('0x6c')]['query'](_0x4d072a[_0x438c('0x7e')](),{'type':db[_0x438c('0x6c')][_0x438c('0x7f')]['SELECT']})['then'](function(_0x2dbd08){if(_0x2dbd08['length']===0x1){return _0x58d02['id'];}else{var _0x2c54c4=_[_0x438c('0x80')](_['map'](_0x2dbd08,_0x438c('0x81')),function(_0x581e9d){return _['includes'](_0xd540f4,_0x581e9d);});if(_0x2c54c4){return _0x58d02['id'];}}}));}}return BPromise[_0x438c('0x82')](_0x1fde1a)[_0x438c('0x2b')](function(_0xd5f05b){_0x5374bb=_(_0x5374bb)[_0x438c('0x83')](_0xd5f05b)['compact']()[_0x438c('0x84')]();return db[_0x438c('0x43')][_0x438c('0x4b')]({'where':{'id':_0x46d39e['params']['id']}})[_0x438c('0x2b')](function(_0x31131a){return db[_0x438c('0x6c')][_0x438c('0x6d')](function(_0x1e9225){return _0x31131a[_0x438c('0x72')](_0x46d39e[_0x438c('0x37')][_0x438c('0x67')],{'transaction':_0x1e9225})[_0x438c('0x2b')](function(){if(!_['isEmpty'](_0x5374bb)){return _0x31131a[_0x438c('0x85')](_0x5374bb,{'transaction':_0x1e9225});}})['then'](function(){_0x5374bb['forEach'](function(_0x138af6){socket['emit'](_0x438c('0x86'),{'UserId':_0x138af6,'FaxQueueId':_0x31131a['id']});});});});});});})[_0x438c('0x2b')](respondWithStatusCode(_0x4e2968,null))[_0x438c('0x4c')](handleError(_0x4e2968,null));};exports['addAgents']=function(_0x1cf5c4,_0x282889,_0x2ebf9f){return db[_0x438c('0x43')][_0x438c('0x4b')]({'where':{'id':_0x1cf5c4[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](handleEntityNotFound(_0x282889,null))[_0x438c('0x2b')](function(_0x463eec){if(_0x463eec){return _0x463eec[_0x438c('0x87')](_0x1cf5c4[_0x438c('0x54')][_0x438c('0x67')],_[_0x438c('0x88')](_0x1cf5c4['body'],[_0x438c('0x67'),'id'])||{})['spread'](function(_0x17303d){for(var _0x312281=0x0;_0x312281<_0x1cf5c4[_0x438c('0x54')]['ids'][_0x438c('0x3c')];_0x312281+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x1cf5c4['body'][_0x438c('0x67')][_0x312281]),'FaxQueueId':Number(_0x1cf5c4[_0x438c('0x48')]['id'])});}return _0x17303d;});}})[_0x438c('0x2b')](respondWithResult(_0x282889,null))['catch'](handleError(_0x282889,null));};exports[_0x438c('0x85')]=function(_0x3954e7,_0x25ae2c,_0x46e78d){return db[_0x438c('0x43')][_0x438c('0x4b')]({'where':{'id':_0x3954e7[_0x438c('0x48')]['id']}})['then'](handleEntityNotFound(_0x25ae2c,null))[_0x438c('0x2b')](function(_0x295dce){if(_0x295dce){return _0x295dce[_0x438c('0x85')](_0x3954e7[_0x438c('0x37')][_0x438c('0x67')])[_0x438c('0x2b')](function(){if(_['isArray'](_0x3954e7[_0x438c('0x37')]['ids'])){for(var _0x5af353=0x0;_0x5af353<_0x3954e7[_0x438c('0x37')]['ids'][_0x438c('0x3c')];_0x5af353+=0x1){socket[_0x438c('0x70')](_0x438c('0x86'),{'UserId':Number(_0x3954e7['query'][_0x438c('0x67')][_0x5af353]),'FaxQueueId':Number(_0x3954e7[_0x438c('0x48')]['id'])});}}else{socket[_0x438c('0x70')](_0x438c('0x86'),{'UserId':Number(_0x3954e7[_0x438c('0x37')][_0x438c('0x67')]),'FaxQueueId':Number(_0x3954e7[_0x438c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x25ae2c,null))['catch'](handleError(_0x25ae2c,null));};exports[_0x438c('0x89')]=function(_0x256b13,_0x2de935,_0x33533f){var _0x4bd8c0={};var _0x5a491f={};var _0x5b4e9c;var _0x4d3aa3;return db[_0x438c('0x43')]['findOne']({'where':{'id':_0x256b13[_0x438c('0x48')]['id']}})[_0x438c('0x2b')](handleEntityNotFound(_0x2de935,null))[_0x438c('0x2b')](function(_0x239e71){if(_0x239e71){_0x5b4e9c=_0x239e71;_0x5a491f['model']=_[_0x438c('0x38')](db['User'][_0x438c('0x49')]);_0x5a491f[_0x438c('0x37')]=_[_0x438c('0x38')](_0x256b13[_0x438c('0x37')]);_0x5a491f[_0x438c('0x39')]=_[_0x438c('0x3a')](_0x5a491f['model'],_0x5a491f[_0x438c('0x37')]);_0x4bd8c0['attributes']=_[_0x438c('0x3a')](_0x5a491f[_0x438c('0x36')],qs['fields'](_0x256b13['query'][_0x438c('0x4a')]));_0x4bd8c0[_0x438c('0x3b')]=_0x4bd8c0[_0x438c('0x3b')][_0x438c('0x3c')]?_0x4bd8c0[_0x438c('0x3b')]:_0x5a491f[_0x438c('0x36')];_0x4bd8c0[_0x438c('0x59')]=qs[_0x438c('0x3e')](_0x256b13[_0x438c('0x37')]['sort']);_0x4bd8c0['where']=qs[_0x438c('0x39')](_[_0x438c('0x3f')](_0x256b13[_0x438c('0x37')],_0x5a491f[_0x438c('0x39')]));if(_0x256b13[_0x438c('0x37')][_0x438c('0x40')]){_0x4bd8c0['where']=_[_0x438c('0x42')](_0x4bd8c0[_0x438c('0x41')],{'$or':_[_0x438c('0x34')](_0x4bd8c0[_0x438c('0x3b')],function(_0x26e777){var _0x17492d={};_0x17492d[_0x26e777]={'$like':'%'+_0x256b13[_0x438c('0x37')]['filter']+'%'};return _0x17492d;})});}_0x4bd8c0=_[_0x438c('0x42')]({},_0x4bd8c0,_0x256b13[_0x438c('0x5a')]);return _0x5b4e9c[_0x438c('0x89')](_0x4bd8c0);}})[_0x438c('0x2b')](function(_0x3778c6){if(_0x3778c6){_0x4d3aa3=_0x3778c6['length'];if(!_0x256b13[_0x438c('0x37')][_0x438c('0x58')](_0x438c('0x3d'))){_0x4bd8c0[_0x438c('0x22')]=qs[_0x438c('0x22')](_0x256b13[_0x438c('0x37')][_0x438c('0x22')]);_0x4bd8c0['offset']=qs['offset'](_0x256b13[_0x438c('0x37')][_0x438c('0x20')]);}return _0x5b4e9c['getAgents'](_0x4bd8c0);}})[_0x438c('0x2b')](function(_0x56b3d){if(_0x56b3d){return _0x56b3d?{'count':_0x4d3aa3,'rows':_0x56b3d}:null;}})[_0x438c('0x2b')](respondWithResult(_0x2de935,null))[_0x438c('0x4c')](handleError(_0x2de935,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3f3f167..51a0609 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 _0x8810=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2d873a,_0x4656a0){var _0x4e45b9=function(_0x4b331a){while(--_0x4b331a){_0x2d873a['push'](_0x2d873a['shift']());}};_0x4e45b9(++_0x4656a0);}(_0x8810,0x64));var _0x0881=function(_0xaefbf9,_0x36d39c){_0xaefbf9=_0xaefbf9-0x0;var _0x40aebe=_0x8810[_0xaefbf9];return _0x40aebe;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x0881('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0881('0x1')](0x0);var events={'afterCreate':_0x0881('0x2'),'afterUpdate':'update','afterDestroy':_0x0881('0x3')};function emitEvent(_0x2dd50c){return function(_0x141aae,_0xce06ae,_0x37e309){FaxQueueEvents[_0x0881('0x4')](_0x2dd50c+':'+_0x141aae['id'],_0x141aae);FaxQueueEvents[_0x0881('0x4')](_0x2dd50c,_0x141aae);_0x37e309(null);};}for(var e in events){if(events[_0x0881('0x5')](e)){var event=events[e];FaxQueue[_0x0881('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xa471=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x27bc76,_0x475793){var _0x146745=function(_0x54c676){while(--_0x54c676){_0x27bc76['push'](_0x27bc76['shift']());}};_0x146745(++_0x475793);}(_0xa471,0x1a4));var _0x1a47=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xa471[_0x2b7764];return _0x848dcb;};'use strict';var EventEmitter=require(_0x1a47('0x0'));var FaxQueue=require(_0x1a47('0x1'))['db'][_0x1a47('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1a47('0x3')](0x0);var events={'afterCreate':_0x1a47('0x4'),'afterUpdate':_0x1a47('0x5'),'afterDestroy':'remove'};function emitEvent(_0x24f311){return function(_0x2f6b31,_0x1dc0c4,_0x4c266a){FaxQueueEvents[_0x1a47('0x6')](_0x24f311+':'+_0x2f6b31['id'],_0x2f6b31);FaxQueueEvents[_0x1a47('0x6')](_0x24f311,_0x2f6b31);_0x4c266a(null);};}for(var e in events){if(events[_0x1a47('0x7')](e)){var event=events[e];FaxQueue[_0x1a47('0x8')](e,emitEvent(event));}}module[_0x1a47('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b55da6b..3357f82 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 _0xe866=['bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','api','moment'];(function(_0xb14f7d,_0x532fb2){var _0x2bba9f=function(_0x354cff){while(--_0x354cff){_0xb14f7d['push'](_0xb14f7d['shift']());}};_0x2bba9f(++_0x532fb2);}(_0xe866,0x98));var _0x6e86=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe866[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6e86('0x0'));var util=require(_0x6e86('0x1'));var logger=require('../../config/logger')(_0x6e86('0x2'));var moment=require(_0x6e86('0x3'));var BPromise=require(_0x6e86('0x4'));var rp=require(_0x6e86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e86('0x6'));var config=require(_0x6e86('0x7'));var attributes=require(_0x6e86('0x8'));module[_0x6e86('0x9')]=function(_0x3e0a0c,_0x79d7fa){return _0x3e0a0c[_0x6e86('0xa')](_0x6e86('0xb'),attributes,{'tableName':_0x6e86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x042e=['bluebird','request-promise','path','rimraf','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','api','moment'];(function(_0x2753bb,_0x56460f){var _0x2a1d88=function(_0x30efa2){while(--_0x30efa2){_0x2753bb['push'](_0x2753bb['shift']());}};_0x2a1d88(++_0x56460f);}(_0x042e,0xe3));var _0xe042=function(_0x336130,_0x1907b2){_0x336130=_0x336130-0x0;var _0x326ad1=_0x042e[_0x336130];return _0x326ad1;};'use strict';var _=require(_0xe042('0x0'));var util=require(_0xe042('0x1'));var logger=require('../../config/logger')(_0xe042('0x2'));var moment=require(_0xe042('0x3'));var BPromise=require(_0xe042('0x4'));var rp=require(_0xe042('0x5'));var fs=require('fs');var path=require(_0xe042('0x6'));var rimraf=require(_0xe042('0x7'));var config=require('../../config/environment');var attributes=require(_0xe042('0x8'));module['exports']=function(_0x47b8a3,_0x6cda09){return _0x47b8a3['define'](_0xe042('0x9'),attributes,{'tableName':_0xe042('0xa'),'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 29d7e17..28fa697 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 _0x729d=['options','where','limit','include','model','attributes','map','ShowFaxQueue','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','./faxQueue.socket','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','findAll'];(function(_0xd2b693,_0x15f6d0){var _0x3b17e4=function(_0x18bd84){while(--_0x18bd84){_0xd2b693['push'](_0xd2b693['shift']());}};_0x3b17e4(++_0x15f6d0);}(_0x729d,0x18a));var _0xd729=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x729d[_0x9e0cb3];return _0x5926b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd729('0x0'));var BPromise=require('bluebird');var rs=require(_0xd729('0x1'));var fs=require('fs');var Redis=require(_0xd729('0x2'));var db=require(_0xd729('0x3'))['db'];var utils=require(_0xd729('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd729('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd729('0x6')][_0xd729('0x7')]({'port':0x232a});config[_0xd729('0x8')]=_[_0xd729('0x9')](config[_0xd729('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd729('0xa'))['register'](socket);function respondWithRpcPromise(_0x267594,_0x20f386,_0x95d5bf){return new BPromise(function(_0x11741f,_0x55ac2e){return client['request'](_0x267594,_0x95d5bf)[_0xd729('0xb')](function(_0x27b44d){logger[_0xd729('0xc')](_0xd729('0xd'),_0x20f386,'request\x20sent');logger[_0xd729('0xe')](_0xd729('0xf'),_0x20f386,_0xd729('0x10'),JSON[_0xd729('0x11')](_0x27b44d));if(_0x27b44d[_0xd729('0x12')]){if(_0x27b44d[_0xd729('0x12')][_0xd729('0x13')]===0x1f4){logger[_0xd729('0x12')]('FaxQueue,\x20%s,\x20%s',_0x20f386,_0x27b44d[_0xd729('0x12')]['message']);return _0x55ac2e(_0x27b44d[_0xd729('0x12')][_0xd729('0x14')]);}logger[_0xd729('0x12')]('FaxQueue,\x20%s,\x20%s',_0x20f386,_0x27b44d['error'][_0xd729('0x14')]);return _0x11741f(_0x27b44d[_0xd729('0x12')]['message']);}else{logger[_0xd729('0xc')](_0xd729('0xd'),_0x20f386,_0xd729('0x10'));_0x11741f(_0x27b44d[_0xd729('0x15')][_0xd729('0x14')]);}})[_0xd729('0x16')](function(_0x534be1){logger[_0xd729('0x12')](_0xd729('0xd'),_0x20f386,_0x534be1);_0x55ac2e(_0x534be1);});});}exports[_0xd729('0x17')]=function(_0x418924){var _0x178762=this;return new Promise(function(_0x222a06,_0x5066fe){return db[_0xd729('0x18')][_0xd729('0x19')]({'raw':_0x418924[_0xd729('0x1a')]?_0x418924[_0xd729('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x418924[_0xd729('0x1a')]?_0x418924[_0xd729('0x1a')][_0xd729('0x1b')]||null:null,'attributes':_0x418924['options']?_0x418924[_0xd729('0x1a')]['attributes']||null:null,'limit':_0x418924[_0xd729('0x1a')]?_0x418924[_0xd729('0x1a')][_0xd729('0x1c')]||null:null,'include':_0x418924[_0xd729('0x1a')]?_0x418924[_0xd729('0x1a')][_0xd729('0x1d')]?_['map'](_0x418924[_0xd729('0x1a')]['include'],function(_0xabc36f){return{'model':db[_0xabc36f[_0xd729('0x1e')]],'as':_0xabc36f['as'],'attributes':_0xabc36f[_0xd729('0x1f')],'include':_0xabc36f[_0xd729('0x1d')]?_[_0xd729('0x20')](_0xabc36f['include'],function(_0x37d33f){return{'model':db[_0x37d33f[_0xd729('0x1e')]],'as':_0x37d33f['as'],'attributes':_0x37d33f[_0xd729('0x1f')],'include':_0x37d33f['include']?_['map'](_0x37d33f[_0xd729('0x1d')],function(_0x546990){return{'model':db[_0x546990[_0xd729('0x1e')]],'as':_0x546990['as'],'attributes':_0x546990['attributes']};}):[]};}):[]};}):[]:[]})[_0xd729('0xb')](function(_0x23afee){logger[_0xd729('0xc')]('GetFaxQueue',_0x418924);logger[_0xd729('0xe')](_0xd729('0x17'),_0x418924,JSON['stringify'](_0x23afee));_0x222a06(_0x23afee);})['catch'](function(_0x14e94a){logger[_0xd729('0x12')](_0xd729('0x17'),_0x14e94a[_0xd729('0x14')],_0x418924);_0x5066fe(_0x178762['error'](0x1f4,_0x14e94a[_0xd729('0x14')]));});});};exports[_0xd729('0x21')]=function(_0x5c7bea){var _0x245491=this;return new Promise(function(_0x21f175,_0x48b198){return db[_0xd729('0x18')][_0xd729('0x22')]({'raw':_0x5c7bea[_0xd729('0x1a')]?_0x5c7bea[_0xd729('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5c7bea[_0xd729('0x1a')]?_0x5c7bea[_0xd729('0x1a')][_0xd729('0x1b')]||null:null,'attributes':_0x5c7bea[_0xd729('0x1a')]?_0x5c7bea[_0xd729('0x1a')][_0xd729('0x1f')]||null:null,'include':_0x5c7bea['options']?_0x5c7bea[_0xd729('0x1a')][_0xd729('0x1d')]?_['map'](_0x5c7bea['options'][_0xd729('0x1d')],function(_0x53d25a){return{'model':db[_0x53d25a[_0xd729('0x1e')]],'as':_0x53d25a['as'],'attributes':_0x53d25a[_0xd729('0x1f')],'include':_0x53d25a[_0xd729('0x1d')]?_[_0xd729('0x20')](_0x53d25a['include'],function(_0x4b866b){return{'model':db[_0x4b866b[_0xd729('0x1e')]],'as':_0x4b866b['as'],'attributes':_0x4b866b[_0xd729('0x1f')],'include':_0x4b866b[_0xd729('0x1d')]?_['map'](_0x4b866b[_0xd729('0x1d')],function(_0x29eb16){return{'model':db[_0x29eb16[_0xd729('0x1e')]],'as':_0x29eb16['as'],'attributes':_0x29eb16['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30ccef){logger[_0xd729('0xc')](_0xd729('0x21'),_0x5c7bea);logger[_0xd729('0xe')](_0xd729('0x21'),_0x5c7bea,JSON[_0xd729('0x11')](_0x30ccef));_0x21f175(_0x30ccef);})[_0xd729('0x16')](function(_0x55e3a5){logger[_0xd729('0x12')](_0xd729('0x21'),_0x55e3a5['message'],_0x5c7bea);_0x48b198(_0x245491[_0xd729('0x12')](0x1f4,_0x55e3a5[_0xd729('0x14')]));});});}; \ No newline at end of file +var _0xa8db=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x5d0207,_0x4000c4){var _0xf3e249=function(_0x1a1fd9){while(--_0x1a1fd9){_0x5d0207['push'](_0x5d0207['shift']());}};_0xf3e249(++_0x4000c4);}(_0xa8db,0x7f));var _0xba8d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa8db[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xba8d('0x0'));var util=require(_0xba8d('0x1'));var moment=require(_0xba8d('0x2'));var BPromise=require(_0xba8d('0x3'));var rs=require(_0xba8d('0x4'));var fs=require('fs');var Redis=require(_0xba8d('0x5'));var db=require(_0xba8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xba8d('0x7'))('rpc');var config=require(_0xba8d('0x8'));var jayson=require(_0xba8d('0x9'));var client=jayson[_0xba8d('0xa')][_0xba8d('0xb')]({'port':0x232a});config[_0xba8d('0xc')]=_[_0xba8d('0xd')](config[_0xba8d('0xc')],{'host':_0xba8d('0xe'),'port':0x18eb});var socket=require(_0xba8d('0xf'))(new Redis(config[_0xba8d('0xc')]));require(_0xba8d('0x10'))[_0xba8d('0x11')](socket);function respondWithRpcPromise(_0x28a35b,_0x42e54d,_0x573ec7){return new BPromise(function(_0x36669f,_0x2266c9){return client[_0xba8d('0x12')](_0x28a35b,_0x573ec7)[_0xba8d('0x13')](function(_0x4699db){logger[_0xba8d('0x14')](_0xba8d('0x15'),_0x42e54d,_0xba8d('0x16'));logger[_0xba8d('0x17')](_0xba8d('0x18'),_0x42e54d,_0xba8d('0x16'),JSON[_0xba8d('0x19')](_0x4699db));if(_0x4699db[_0xba8d('0x1a')]){if(_0x4699db[_0xba8d('0x1a')][_0xba8d('0x1b')]===0x1f4){logger[_0xba8d('0x1a')](_0xba8d('0x15'),_0x42e54d,_0x4699db[_0xba8d('0x1a')][_0xba8d('0x1c')]);return _0x2266c9(_0x4699db[_0xba8d('0x1a')][_0xba8d('0x1c')]);}logger[_0xba8d('0x1a')](_0xba8d('0x15'),_0x42e54d,_0x4699db[_0xba8d('0x1a')]['message']);return _0x36669f(_0x4699db[_0xba8d('0x1a')]['message']);}else{logger[_0xba8d('0x14')](_0xba8d('0x15'),_0x42e54d,_0xba8d('0x16'));_0x36669f(_0x4699db[_0xba8d('0x1d')][_0xba8d('0x1c')]);}})[_0xba8d('0x1e')](function(_0x1179e5){logger[_0xba8d('0x1a')](_0xba8d('0x15'),_0x42e54d,_0x1179e5);_0x2266c9(_0x1179e5);});});}exports[_0xba8d('0x1f')]=function(_0x19041f){var _0x1d083f=this;return new Promise(function(_0xd8556,_0x12b40a){return db[_0xba8d('0x20')][_0xba8d('0x21')]({'raw':_0x19041f[_0xba8d('0x22')]?_0x19041f['options'][_0xba8d('0x23')]===undefined?!![]:![]:!![],'where':_0x19041f[_0xba8d('0x22')]?_0x19041f[_0xba8d('0x22')][_0xba8d('0x24')]||null:null,'attributes':_0x19041f['options']?_0x19041f[_0xba8d('0x22')][_0xba8d('0x25')]||null:null,'limit':_0x19041f[_0xba8d('0x22')]?_0x19041f[_0xba8d('0x22')][_0xba8d('0x26')]||null:null,'include':_0x19041f[_0xba8d('0x22')]?_0x19041f['options'][_0xba8d('0x27')]?_[_0xba8d('0x28')](_0x19041f[_0xba8d('0x22')]['include'],function(_0x5c2885){return{'model':db[_0x5c2885[_0xba8d('0x29')]],'as':_0x5c2885['as'],'attributes':_0x5c2885[_0xba8d('0x25')],'include':_0x5c2885[_0xba8d('0x27')]?_[_0xba8d('0x28')](_0x5c2885[_0xba8d('0x27')],function(_0xbe3639){return{'model':db[_0xbe3639[_0xba8d('0x29')]],'as':_0xbe3639['as'],'attributes':_0xbe3639[_0xba8d('0x25')],'include':_0xbe3639['include']?_['map'](_0xbe3639['include'],function(_0x2eb3b9){return{'model':db[_0x2eb3b9[_0xba8d('0x29')]],'as':_0x2eb3b9['as'],'attributes':_0x2eb3b9[_0xba8d('0x25')]};}):[]};}):[]};}):[]:[]})[_0xba8d('0x13')](function(_0x29a9c9){logger[_0xba8d('0x14')]('GetFaxQueue',_0x19041f);logger[_0xba8d('0x17')]('GetFaxQueue',_0x19041f,JSON['stringify'](_0x29a9c9));_0xd8556(_0x29a9c9);})[_0xba8d('0x1e')](function(_0x318701){logger[_0xba8d('0x1a')]('GetFaxQueue',_0x318701[_0xba8d('0x1c')],_0x19041f);_0x12b40a(_0x1d083f[_0xba8d('0x1a')](0x1f4,_0x318701[_0xba8d('0x1c')]));});});};exports[_0xba8d('0x2a')]=function(_0xc4cd21){var _0x58a1df=this;return new Promise(function(_0xf3244d,_0x189acf){return db[_0xba8d('0x20')][_0xba8d('0x2b')]({'raw':_0xc4cd21[_0xba8d('0x22')]?_0xc4cd21[_0xba8d('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0xc4cd21[_0xba8d('0x22')]?_0xc4cd21[_0xba8d('0x22')][_0xba8d('0x24')]||null:null,'attributes':_0xc4cd21[_0xba8d('0x22')]?_0xc4cd21[_0xba8d('0x22')][_0xba8d('0x25')]||null:null,'include':_0xc4cd21['options']?_0xc4cd21[_0xba8d('0x22')][_0xba8d('0x27')]?_['map'](_0xc4cd21[_0xba8d('0x22')]['include'],function(_0x160df5){return{'model':db[_0x160df5['model']],'as':_0x160df5['as'],'attributes':_0x160df5[_0xba8d('0x25')],'include':_0x160df5[_0xba8d('0x27')]?_[_0xba8d('0x28')](_0x160df5[_0xba8d('0x27')],function(_0x48fead){return{'model':db[_0x48fead[_0xba8d('0x29')]],'as':_0x48fead['as'],'attributes':_0x48fead[_0xba8d('0x25')],'include':_0x48fead[_0xba8d('0x27')]?_[_0xba8d('0x28')](_0x48fead[_0xba8d('0x27')],function(_0x1ac3a0){return{'model':db[_0x1ac3a0['model']],'as':_0x1ac3a0['as'],'attributes':_0x1ac3a0[_0xba8d('0x25')]};}):[]};}):[]};}):[]:[]})[_0xba8d('0x13')](function(_0x21a7f1){logger[_0xba8d('0x14')](_0xba8d('0x2a'),_0xc4cd21);logger[_0xba8d('0x17')](_0xba8d('0x2a'),_0xc4cd21,JSON['stringify'](_0x21a7f1));_0xf3244d(_0x21a7f1);})[_0xba8d('0x1e')](function(_0x253719){logger[_0xba8d('0x1a')]('ShowFaxQueue',_0x253719[_0xba8d('0x1c')],_0xc4cd21);_0x189acf(_0x58a1df['error'](0x1f4,_0x253719[_0xba8d('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 87c3ef1..38fed5d 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 _0x138c=['update','emit','removeListener','length','save','remove'];(function(_0x195471,_0x3041a8){var _0x2789ec=function(_0x523fe1){while(--_0x523fe1){_0x195471['push'](_0x195471['shift']());}};_0x2789ec(++_0x3041a8);}(_0x138c,0x13c));var _0xc138=function(_0x39c41d,_0x2a0e7a){_0x39c41d=_0x39c41d-0x0;var _0x4c290e=_0x138c[_0x39c41d];return _0x4c290e;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xc138('0x0'),_0xc138('0x1'),_0xc138('0x2')];function createListener(_0x54df9e,_0x5459e9){return function(_0xd02fd){_0x5459e9[_0xc138('0x3')](_0x54df9e,_0xd02fd);};}function removeListener(_0x1878d7,_0x5dd242){return function(){FaxQueueEvents[_0xc138('0x4')](_0x1878d7,_0x5dd242);};}exports['register']=function(_0x2b92dd){for(var _0x25dfc9=0x0,_0x357ff7=events[_0xc138('0x5')];_0x25dfc9<_0x357ff7;_0x25dfc9++){var _0x8f20ec=events[_0x25dfc9];var _0x2a5e72=createListener('faxQueue:'+_0x8f20ec,_0x2b92dd);FaxQueueEvents['on'](_0x8f20ec,_0x2a5e72);}}; \ No newline at end of file +var _0xfd77=['removeListener','length','faxQueue:','./faxQueue.events','save','remove','emit'];(function(_0x425143,_0x10a042){var _0x121282=function(_0x23fc1a){while(--_0x23fc1a){_0x425143['push'](_0x425143['shift']());}};_0x121282(++_0x10a042);}(_0xfd77,0x1d8));var _0x7fd7=function(_0x51ff26,_0x51fa09){_0x51ff26=_0x51ff26-0x0;var _0x5d7396=_0xfd77[_0x51ff26];return _0x5d7396;};'use strict';var FaxQueueEvents=require(_0x7fd7('0x0'));var events=[_0x7fd7('0x1'),_0x7fd7('0x2'),'update'];function createListener(_0x275df0,_0x23131e){return function(_0x2258ec){_0x23131e[_0x7fd7('0x3')](_0x275df0,_0x2258ec);};}function removeListener(_0x3929c4,_0x131889){return function(){FaxQueueEvents[_0x7fd7('0x4')](_0x3929c4,_0x131889);};}exports['register']=function(_0x5748b3){for(var _0x39047b=0x0,_0x567a2d=events[_0x7fd7('0x5')];_0x39047b<_0x567a2d;_0x39047b++){var _0x1fbd1c=events[_0x39047b];var _0x4cdd7a=createListener(_0x7fd7('0x6')+_0x1fbd1c,_0x5748b3);FaxQueueEvents['on'](_0x1fbd1c,_0x4cdd7a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d1f2a8a..a9d5757 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 _0xf2e3=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','/:id/users','put','update','delete','destroy','removeAgents','exports'];(function(_0x2f9346,_0x210ead){var _0x4a8930=function(_0x2eb227){while(--_0x2eb227){_0x2f9346['push'](_0x2f9346['shift']());}};_0x4a8930(++_0x210ead);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xf2e3[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0xc')](_0x3f2e('0x11'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0xc')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0xc')]('/:id/users',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x15')]);router['post']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x16')]);router[_0x3f2e('0x17')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['addTeams']);router[_0x3f2e('0x17')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller['addAgents']);router[_0x3f2e('0x19')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1a')]);router[_0x3f2e('0x1b')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1c')]);router[_0x3f2e('0x1b')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['removeTeams']);router[_0x3f2e('0x1b')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1d')]);module[_0x3f2e('0x1e')]=router; \ No newline at end of file +var _0x5fdc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x506a78,_0x4cf22f){var _0xfbf2aa=function(_0x316816){while(--_0x316816){_0x506a78['push'](_0x506a78['shift']());}};_0xfbf2aa(++_0x4cf22f);}(_0x5fdc,0x127));var _0xc5fd=function(_0x2f40dd,_0x3143a6){_0x2f40dd=_0x2f40dd-0x0;var _0x249bdf=_0x5fdc[_0x2f40dd];return _0x249bdf;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var fs_extra=require(_0xc5fd('0x6'));var auth=require(_0xc5fd('0x7'));var interaction=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var controller=require(_0xc5fd('0xa'));router[_0xc5fd('0xb')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc5fd('0xb')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xf')]);router['get']('/:id/members',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0xb')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x12')]);router['get'](_0xc5fd('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc5fd('0x14')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x15')]);router[_0xc5fd('0x14')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x16')]);router[_0xc5fd('0x14')]('/:id/users',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x17')]);router[_0xc5fd('0x18')](_0xc5fd('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc5fd('0x19')]);router[_0xc5fd('0x1a')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x1b')]);router[_0xc5fd('0x1a')](_0xc5fd('0x13'),auth['isAuthenticated'](),controller[_0xc5fd('0x1c')]);module[_0xc5fd('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index be28cb0..86786b0 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 _0xdd41=['exports','STRING','DATE','moment','sequelize'];(function(_0x10a546,_0x5ea132){var _0x30e897=function(_0x54964b){while(--_0x54964b){_0x10a546['push'](_0x10a546['shift']());}};_0x30e897(++_0x5ea132);}(_0xdd41,0x1f2));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x1dd4('0x0'));var Sequelize=require(_0x1dd4('0x1'));module[_0x1dd4('0x2')]={'uniqueid':{'type':Sequelize[_0x1dd4('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1dd4('0x4')]},'leaveAt':{'type':Sequelize[_0x1dd4('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1dd4('0x3')]}}; \ No newline at end of file +var _0x1641=['sequelize','exports','STRING','DATE','moment'];(function(_0x48e921,_0x26251f){var _0x3b350c=function(_0xb6f567){while(--_0xb6f567){_0x48e921['push'](_0x48e921['shift']());}};_0x3b350c(++_0x26251f);}(_0x1641,0x153));var _0x1164=function(_0x4fc2db,_0x4d0097){_0x4fc2db=_0x4fc2db-0x0;var _0x5c28f7=_0x1641[_0x4fc2db];return _0x5c28f7;};'use strict';var moment=require(_0x1164('0x0'));var Sequelize=require(_0x1164('0x1'));module[_0x1164('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1164('0x3')]},'joinAt':{'type':Sequelize[_0x1164('0x4')]},'leaveAt':{'type':Sequelize[_0x1164('0x4')]},'acceptAt':{'type':Sequelize[_0x1164('0x4')]},'exitAt':{'type':Sequelize[_0x1164('0x4')]},'reason':{'type':Sequelize[_0x1164('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index bb8bb4d..056b9a8 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 _0xa8a8=['filter','where','merge','options','includeAll','findAll','rows','include','find','catch','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x23c408,_0x54e301){_0x23c408=_0x23c408-0x0;var _0x374d67=_0xa8a8[_0x23c408];return _0x374d67;};'use strict';var emlformat=require(_0x8a8a('0x0'));var rimraf=require(_0x8a8a('0x1'));var zipdir=require(_0x8a8a('0x2'));var jsonpatch=require(_0x8a8a('0x3'));var rp=require('request-promise');var moment=require(_0x8a8a('0x4'));var BPromise=require(_0x8a8a('0x5'));var Mustache=require(_0x8a8a('0x6'));var util=require(_0x8a8a('0x7'));var path=require(_0x8a8a('0x8'));var sox=require(_0x8a8a('0x9'));var csv=require(_0x8a8a('0xa'));var ejs=require(_0x8a8a('0xb'));var fs=require('fs');var fs_extra=require(_0x8a8a('0xc'));var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a8a('0x13'));var as=require(_0x8a8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a8a('0x15'))(_0x8a8a('0x16'));var utils=require(_0x8a8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8a8a('0x18'));var db=require(_0x8a8a('0x19'))['db'];function respondWithStatusCode(_0x330796,_0x234481){_0x234481=_0x234481||0xcc;return function(_0x4a1b91){if(_0x4a1b91){return _0x330796[_0x8a8a('0x1a')](_0x234481);}return _0x330796['status'](_0x234481)[_0x8a8a('0x1b')]();};}function respondWithResult(_0xb2a3bc,_0x787eec){_0x787eec=_0x787eec||0xc8;return function(_0x2f6e33){if(_0x2f6e33){return _0xb2a3bc[_0x8a8a('0x1c')](_0x787eec)[_0x8a8a('0x1d')](_0x2f6e33);}};}function respondWithFilteredResult(_0x16d38d,_0x51ce75){return function(_0x1ed3be){if(_0x1ed3be){var _0x568b83=typeof _0x51ce75[_0x8a8a('0x1e')]===_0x8a8a('0x1f')&&typeof _0x51ce75[_0x8a8a('0x20')]===_0x8a8a('0x1f');var _0x42e8b6=_0x1ed3be['count'];var _0x9d55f9=_0x568b83?0x0:_0x51ce75[_0x8a8a('0x1e')];var _0x262ca9=_0x568b83?_0x1ed3be[_0x8a8a('0x21')]:_0x51ce75[_0x8a8a('0x1e')]+_0x51ce75[_0x8a8a('0x20')];var _0x4d7a45;if(_0x262ca9>=_0x42e8b6){_0x262ca9=_0x42e8b6;_0x4d7a45=0xc8;}else{_0x4d7a45=0xce;}_0x16d38d['status'](_0x4d7a45);return _0x16d38d['set']('Content-Range',_0x9d55f9+'-'+_0x262ca9+'/'+_0x42e8b6)['json'](_0x1ed3be);}return null;};}function patchUpdates(_0x3a9b2f){return function(_0x45095b){try{jsonpatch[_0x8a8a('0x22')](_0x45095b,_0x3a9b2f,!![]);}catch(_0x44719e){return BPromise[_0x8a8a('0x23')](_0x44719e);}return _0x45095b[_0x8a8a('0x24')]();};}function saveUpdates(_0x242bac,_0xe0321c){return function(_0x25d5d4){if(_0x25d5d4){return _0x25d5d4[_0x8a8a('0x25')](_0x242bac)[_0x8a8a('0x26')](function(_0x3aa2bb){return _0x3aa2bb;});}return null;};}function removeEntity(_0x3b4ece,_0x625c1b){return function(_0x442c00){if(_0x442c00){return _0x442c00['destroy']()[_0x8a8a('0x26')](function(){_0x3b4ece[_0x8a8a('0x1c')](0xcc)[_0x8a8a('0x1b')]();});}};}function handleEntityNotFound(_0x7662e,_0x36e6d4){return function(_0x251315){if(!_0x251315){_0x7662e[_0x8a8a('0x1a')](0x194);}return _0x251315;};}function handleError(_0x5f4dcc,_0x31d21a){_0x31d21a=_0x31d21a||0x1f4;return function(_0x38c1e0){logger[_0x8a8a('0x27')](_0x38c1e0['stack']);if(_0x38c1e0['name']){delete _0x38c1e0[_0x8a8a('0x28')];}_0x5f4dcc[_0x8a8a('0x1c')](_0x31d21a)['send'](_0x38c1e0);};}exports['index']=function(_0x4b3bc5,_0x78fd48){var _0x5c7e58={},_0x10b916={},_0xdd6221={'count':0x0,'rows':[]};var _0x49ea81=_[_0x8a8a('0x29')](db[_0x8a8a('0x2a')][_0x8a8a('0x2b')],function(_0x8df0cb){return{'name':_0x8df0cb[_0x8a8a('0x2c')],'type':_0x8df0cb[_0x8a8a('0x2d')][_0x8a8a('0x2e')]};});_0x10b916[_0x8a8a('0x2f')]=_['map'](_0x49ea81,'name');_0x10b916['query']=_[_0x8a8a('0x30')](_0x4b3bc5[_0x8a8a('0x31')]);_0x10b916['filters']=_[_0x8a8a('0x32')](_0x10b916[_0x8a8a('0x2f')],_0x10b916['query']);_0x5c7e58[_0x8a8a('0x33')]=_[_0x8a8a('0x32')](_0x10b916[_0x8a8a('0x2f')],qs['fields'](_0x4b3bc5['query'][_0x8a8a('0x34')]));_0x5c7e58['attributes']=_0x5c7e58[_0x8a8a('0x33')][_0x8a8a('0x35')]?_0x5c7e58[_0x8a8a('0x33')]:_0x10b916[_0x8a8a('0x2f')];if(!_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x36')](_0x8a8a('0x37'))){_0x5c7e58[_0x8a8a('0x20')]=qs[_0x8a8a('0x20')](_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x20')]);_0x5c7e58[_0x8a8a('0x1e')]=qs[_0x8a8a('0x1e')](_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x1e')]);}_0x5c7e58[_0x8a8a('0x38')]=qs[_0x8a8a('0x39')](_0x4b3bc5[_0x8a8a('0x31')]['sort']);_0x5c7e58['where']=qs['filters'](_[_0x8a8a('0x3a')](_0x4b3bc5[_0x8a8a('0x31')],_0x10b916[_0x8a8a('0x3b')]),_0x49ea81);if(_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x3c')]){_0x5c7e58['where']=_['merge'](_0x5c7e58[_0x8a8a('0x3d')],{'$or':_['map'](_0x49ea81,function(_0x41a4c4){if(_0x41a4c4['type']!=='VIRTUAL'){var _0x1b33eb={};_0x1b33eb[_0x41a4c4[_0x8a8a('0x28')]]={'$like':'%'+_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x3c')]+'%'};return _0x1b33eb;}})});}_0x5c7e58=_[_0x8a8a('0x3e')]({},_0x5c7e58,_0x4b3bc5[_0x8a8a('0x3f')]);var _0x20584a={'where':_0x5c7e58['where']};return db[_0x8a8a('0x2a')][_0x8a8a('0x21')](_0x20584a)[_0x8a8a('0x26')](function(_0x53f66e){_0xdd6221[_0x8a8a('0x21')]=_0x53f66e;if(_0x4b3bc5[_0x8a8a('0x31')][_0x8a8a('0x40')]){_0x5c7e58['include']=[{'all':!![]}];}return db[_0x8a8a('0x2a')][_0x8a8a('0x41')](_0x5c7e58);})[_0x8a8a('0x26')](function(_0x19fd7a){_0xdd6221[_0x8a8a('0x42')]=_0x19fd7a;return _0xdd6221;})[_0x8a8a('0x26')](respondWithFilteredResult(_0x78fd48,_0x5c7e58))['catch'](handleError(_0x78fd48,null));};exports['show']=function(_0x392e7a,_0x568027){var _0x13e0d4={'raw':!![],'where':{'id':_0x392e7a['params']['id']}},_0x1aa8b5={};_0x1aa8b5['model']=_[_0x8a8a('0x30')](db[_0x8a8a('0x2a')][_0x8a8a('0x2b')]);_0x1aa8b5[_0x8a8a('0x31')]=_['keys'](_0x392e7a[_0x8a8a('0x31')]);_0x1aa8b5['filters']=_[_0x8a8a('0x32')](_0x1aa8b5[_0x8a8a('0x2f')],_0x1aa8b5['query']);_0x13e0d4[_0x8a8a('0x33')]=_[_0x8a8a('0x32')](_0x1aa8b5[_0x8a8a('0x2f')],qs['fields'](_0x392e7a[_0x8a8a('0x31')][_0x8a8a('0x34')]));_0x13e0d4[_0x8a8a('0x33')]=_0x13e0d4['attributes']['length']?_0x13e0d4[_0x8a8a('0x33')]:_0x1aa8b5[_0x8a8a('0x2f')];if(_0x392e7a[_0x8a8a('0x31')]['includeAll']){_0x13e0d4[_0x8a8a('0x43')]=[{'all':!![]}];}_0x13e0d4=_[_0x8a8a('0x3e')]({},_0x13e0d4,_0x392e7a[_0x8a8a('0x3f')]);return db[_0x8a8a('0x2a')][_0x8a8a('0x44')](_0x13e0d4)[_0x8a8a('0x26')](handleEntityNotFound(_0x568027,null))[_0x8a8a('0x26')](respondWithResult(_0x568027,null))[_0x8a8a('0x45')](handleError(_0x568027,null));};exports[_0x8a8a('0x46')]=function(_0x229751,_0x150b42){return db['FaxQueueReport'][_0x8a8a('0x46')](_0x229751[_0x8a8a('0x47')],{})[_0x8a8a('0x26')](respondWithResult(_0x150b42,0xc9))[_0x8a8a('0x45')](handleError(_0x150b42,null));};exports[_0x8a8a('0x25')]=function(_0x2e22b0,_0x565a49){if(_0x2e22b0[_0x8a8a('0x47')]['id']){delete _0x2e22b0[_0x8a8a('0x47')]['id'];}return db[_0x8a8a('0x2a')][_0x8a8a('0x44')]({'where':{'id':_0x2e22b0['params']['id']}})[_0x8a8a('0x26')](handleEntityNotFound(_0x565a49,null))[_0x8a8a('0x26')](saveUpdates(_0x2e22b0[_0x8a8a('0x47')],null))['then'](respondWithResult(_0x565a49,null))['catch'](handleError(_0x565a49,null));};exports[_0x8a8a('0x48')]=function(_0x39a8e0,_0xf4b6ee){return db[_0x8a8a('0x2a')][_0x8a8a('0x44')]({'where':{'id':_0x39a8e0[_0x8a8a('0x49')]['id']}})[_0x8a8a('0x26')](handleEntityNotFound(_0xf4b6ee,null))[_0x8a8a('0x26')](removeEntity(_0xf4b6ee,null))[_0x8a8a('0x45')](handleError(_0xf4b6ee,null));};exports['describe']=function(_0x4c1f1a,_0x17ffeb){return db[_0x8a8a('0x2a')]['describe']()['then'](respondWithResult(_0x17ffeb,null))[_0x8a8a('0x45')](handleError(_0x17ffeb,null));}; \ No newline at end of file +var _0x1d2d=['options','FaxQueueReport','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x19c7d1,_0x3e93ee){var _0x45bb2b=function(_0x4ed821){while(--_0x4ed821){_0x19c7d1['push'](_0x19c7d1['shift']());}};_0x45bb2b(++_0x3e93ee);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x2bf5c2,_0x284bda){_0x2bf5c2=_0x2bf5c2-0x0;var _0x1b15b5=_0x1d2d[_0x2bf5c2];return _0x1b15b5;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['FaxQueueReport'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));};exports[_0xd1d2('0x4b')]=function(_0xfd8024,_0xa013ce){return db[_0xd1d2('0x41')][_0xd1d2('0x4b')]()[_0xd1d2('0x26')](respondWithResult(_0xa013ce,null))[_0xd1d2('0x44')](handleError(_0xa013ce,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 29afdbc..6c4e876 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x5d875f,_0x4ca818){var _0x1d45fc=function(_0x176b67){while(--_0x176b67){_0x5d875f['push'](_0x5d875f['shift']());}};_0x1d45fc(++_0x4ca818);}(_0x326f,0xd1));var _0xf326=function(_0x2b63ba,_0x318d04){_0x2b63ba=_0x2b63ba-0x0;var _0xe2ef1a=_0x326f[_0x2b63ba];return _0xe2ef1a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0x814b,0x1a2));var _0xb814=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x814b[_0x4314d7];return _0x5c599b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7854e0f..3623318 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 _0x1785=['error','message','info','CreateFaxQueueReport','FaxQueueReport','body','options','raw','catch','UpdateFaxQueueReport','update','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x39189e,_0x557a21){var _0x56b157=function(_0x116d62){while(--_0x116d62){_0x39189e['push'](_0x39189e['shift']());}};_0x56b157(++_0x557a21);}(_0x1785,0x1ed));var _0x5178=function(_0xf25c17,_0x288f2c){_0xf25c17=_0xf25c17-0x0;var _0x429736=_0x1785[_0xf25c17];return _0x429736;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5178('0x0'));var BPromise=require(_0x5178('0x1'));var rs=require(_0x5178('0x2'));var fs=require('fs');var Redis=require(_0x5178('0x3'));var db=require(_0x5178('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5178('0x5'))(_0x5178('0x6'));var config=require(_0x5178('0x7'));var jayson=require(_0x5178('0x8'));var client=jayson[_0x5178('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58a7c7,_0x357be1,_0x4b3214){return new BPromise(function(_0x5114af,_0x3e469d){return client[_0x5178('0xa')](_0x58a7c7,_0x4b3214)[_0x5178('0xb')](function(_0x107071){logger['info'](_0x5178('0xc'),_0x357be1,'request\x20sent');logger[_0x5178('0xd')](_0x5178('0xe'),_0x357be1,_0x5178('0xf'),JSON[_0x5178('0x10')](_0x107071));if(_0x107071['error']){if(_0x107071[_0x5178('0x11')]['code']===0x1f4){logger[_0x5178('0x11')](_0x5178('0xc'),_0x357be1,_0x107071[_0x5178('0x11')]['message']);return _0x3e469d(_0x107071[_0x5178('0x11')]['message']);}logger['error'](_0x5178('0xc'),_0x357be1,_0x107071[_0x5178('0x11')][_0x5178('0x12')]);return _0x5114af(_0x107071[_0x5178('0x11')][_0x5178('0x12')]);}else{logger[_0x5178('0x13')](_0x5178('0xc'),_0x357be1,_0x5178('0xf'));_0x5114af(_0x107071['result'][_0x5178('0x12')]);}})['catch'](function(_0x34a21a){logger['error'](_0x5178('0xc'),_0x357be1,_0x34a21a);_0x3e469d(_0x34a21a);});});}exports[_0x5178('0x14')]=function(_0x50b877){var _0x594ad8=this;return new Promise(function(_0x1e053f,_0x377bff){return db[_0x5178('0x15')]['create'](_0x50b877[_0x5178('0x16')],{'raw':_0x50b877[_0x5178('0x17')]?_0x50b877['options'][_0x5178('0x18')]===undefined?!![]:![]:!![]})[_0x5178('0xb')](function(_0x494ee7){logger[_0x5178('0x13')](_0x5178('0x14'),_0x50b877);logger['debug']('CreateFaxQueueReport',_0x50b877,JSON[_0x5178('0x10')](_0x494ee7));_0x1e053f(_0x494ee7);})[_0x5178('0x19')](function(_0x1c9335){logger[_0x5178('0x11')]('CreateFaxQueueReport',_0x1c9335['message'],_0x50b877);_0x377bff(_0x594ad8[_0x5178('0x11')](0x1f4,_0x1c9335[_0x5178('0x12')]));});});};exports[_0x5178('0x1a')]=function(_0x2622cb){var _0x2c25df=this;return new Promise(function(_0x38ffec,_0xf748f3){return db[_0x5178('0x15')][_0x5178('0x1b')](_0x2622cb[_0x5178('0x16')],{'raw':_0x2622cb['options']?_0x2622cb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2622cb[_0x5178('0x17')]?_0x2622cb[_0x5178('0x17')]['where']||null:null,'attributes':_0x2622cb[_0x5178('0x17')]?_0x2622cb[_0x5178('0x17')][_0x5178('0x1c')]||null:null,'limit':_0x2622cb[_0x5178('0x17')]?_0x2622cb[_0x5178('0x17')][_0x5178('0x1d')]||null:null})['then'](function(_0x192ec4){logger[_0x5178('0x13')](_0x5178('0x1a'),_0x2622cb);logger['debug'](_0x5178('0x1a'),_0x2622cb,JSON[_0x5178('0x10')](_0x192ec4));_0x38ffec(_0x192ec4);})['catch'](function(_0x531dd7){logger[_0x5178('0x11')](_0x5178('0x1a'),_0x531dd7[_0x5178('0x12')],_0x2622cb);_0xf748f3(_0x2c25df['error'](0x1f4,_0x531dd7[_0x5178('0x12')]));});});}; \ No newline at end of file +var _0x7437=['info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','body','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x7437,0x1ef));var _0x7743=function(_0x26b2a2,_0x50428a){_0x26b2a2=_0x26b2a2-0x0;var _0x139d27=_0x7437[_0x26b2a2];return _0x139d27;};'use strict';var _=require(_0x7743('0x0'));var util=require(_0x7743('0x1'));var moment=require(_0x7743('0x2'));var BPromise=require(_0x7743('0x3'));var rs=require(_0x7743('0x4'));var fs=require('fs');var Redis=require(_0x7743('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7743('0x6'));var logger=require(_0x7743('0x7'))(_0x7743('0x8'));var config=require(_0x7743('0x9'));var jayson=require(_0x7743('0xa'));var client=jayson[_0x7743('0xb')][_0x7743('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x160bef,_0x57f4f0,_0x1651a0){return new BPromise(function(_0xc186f6,_0x59f4f6){return client[_0x7743('0xd')](_0x160bef,_0x1651a0)[_0x7743('0xe')](function(_0x6ba95c){logger[_0x7743('0xf')](_0x7743('0x10'),_0x57f4f0,'request\x20sent');logger['debug'](_0x7743('0x11'),_0x57f4f0,_0x7743('0x12'),JSON[_0x7743('0x13')](_0x6ba95c));if(_0x6ba95c[_0x7743('0x14')]){if(_0x6ba95c[_0x7743('0x14')][_0x7743('0x15')]===0x1f4){logger[_0x7743('0x14')](_0x7743('0x10'),_0x57f4f0,_0x6ba95c[_0x7743('0x14')][_0x7743('0x16')]);return _0x59f4f6(_0x6ba95c[_0x7743('0x14')]['message']);}logger[_0x7743('0x14')](_0x7743('0x10'),_0x57f4f0,_0x6ba95c[_0x7743('0x14')][_0x7743('0x16')]);return _0xc186f6(_0x6ba95c[_0x7743('0x14')][_0x7743('0x16')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x57f4f0,_0x7743('0x12'));_0xc186f6(_0x6ba95c[_0x7743('0x17')][_0x7743('0x16')]);}})[_0x7743('0x18')](function(_0x455515){logger['error'](_0x7743('0x10'),_0x57f4f0,_0x455515);_0x59f4f6(_0x455515);});});}exports[_0x7743('0x19')]=function(_0x255d85){var _0x4a3587=this;return new Promise(function(_0x51e9b5,_0x148f20){return db[_0x7743('0x1a')]['create'](_0x255d85['body'],{'raw':_0x255d85[_0x7743('0x1b')]?_0x255d85[_0x7743('0x1b')][_0x7743('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x194fb6){logger['info']('CreateFaxQueueReport',_0x255d85);logger['debug'](_0x7743('0x19'),_0x255d85,JSON[_0x7743('0x13')](_0x194fb6));_0x51e9b5(_0x194fb6);})['catch'](function(_0x593d1e){logger[_0x7743('0x14')]('CreateFaxQueueReport',_0x593d1e[_0x7743('0x16')],_0x255d85);_0x148f20(_0x4a3587[_0x7743('0x14')](0x1f4,_0x593d1e[_0x7743('0x16')]));});});};exports[_0x7743('0x1d')]=function(_0x59d90a){var _0x51bf5f=this;return new Promise(function(_0x30aeec,_0x57a2ae){return db[_0x7743('0x1a')][_0x7743('0x1e')](_0x59d90a[_0x7743('0x1f')],{'raw':_0x59d90a['options']?_0x59d90a[_0x7743('0x1b')][_0x7743('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d90a[_0x7743('0x1b')]?_0x59d90a['options']['where']||null:null,'attributes':_0x59d90a[_0x7743('0x1b')]?_0x59d90a[_0x7743('0x1b')][_0x7743('0x20')]||null:null,'limit':_0x59d90a['options']?_0x59d90a['options'][_0x7743('0x21')]||null:null})[_0x7743('0xe')](function(_0xf263c5){logger['info'](_0x7743('0x1d'),_0x59d90a);logger['debug'](_0x7743('0x1d'),_0x59d90a,JSON[_0x7743('0x13')](_0xf263c5));_0x30aeec(_0xf263c5);})[_0x7743('0x18')](function(_0x53095a){logger[_0x7743('0x14')](_0x7743('0x1d'),_0x53095a[_0x7743('0x16')],_0x59d90a);_0x57a2ae(_0x51bf5f[_0x7743('0x14')](0x1f4,_0x53095a[_0x7743('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ee88db2..a991e29 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 _0xff0f=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x131031,_0x521d14){var _0x12134c=function(_0x46f027){while(--_0x46f027){_0x131031['push'](_0x131031['shift']());}};_0x12134c(++_0x521d14);}(_0xff0f,0x13a));var _0xfff0=function(_0x2ae556,_0x4904e4){_0x2ae556=_0x2ae556-0x0;var _0x1e4418=_0xff0f[_0x2ae556];return _0x1e4418;};'use strict';var multer=require(_0xfff0('0x0'));var util=require(_0xfff0('0x1'));var path=require('path');var timeout=require(_0xfff0('0x2'));var express=require(_0xfff0('0x3'));var router=express[_0xfff0('0x4')]();var fs_extra=require(_0xfff0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfff0('0x6'));var config=require(_0xfff0('0x7'));var controller=require(_0xfff0('0x8'));router[_0xfff0('0x9')]('/',auth[_0xfff0('0xa')](),controller['index']);router['get'](_0xfff0('0xb'),auth[_0xfff0('0xa')](),controller[_0xfff0('0xc')]);router[_0xfff0('0x9')](_0xfff0('0xd'),auth['isAuthenticated'](),controller[_0xfff0('0xe')]);router[_0xfff0('0xf')]('/',auth['isAuthenticated'](),controller[_0xfff0('0x10')]);router[_0xfff0('0x11')](_0xfff0('0xd'),auth[_0xfff0('0xa')](),controller[_0xfff0('0x12')]);router['delete']('/:id',auth[_0xfff0('0xa')](),controller['destroy']);module[_0xfff0('0x13')]=router; \ No newline at end of file +var _0x373d=['describe','show','post','/:id','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index'];(function(_0xf549d8,_0x52c9f0){var _0x2ccd9d=function(_0x539801){while(--_0x539801){_0xf549d8['push'](_0xf549d8['shift']());}};_0x2ccd9d(++_0x52c9f0);}(_0x373d,0x15b));var _0xd373=function(_0x4f76b6,_0x38b4ef){_0x4f76b6=_0x4f76b6-0x0;var _0x3a7853=_0x373d[_0x4f76b6];return _0x3a7853;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require('connect-timeout');var express=require(_0xd373('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd373('0x3'));var interaction=require(_0xd373('0x4'));var config=require(_0xd373('0x5'));var controller=require(_0xd373('0x6'));router[_0xd373('0x7')]('/',auth[_0xd373('0x8')](),controller[_0xd373('0x9')]);router[_0xd373('0x7')]('/describe',auth[_0xd373('0x8')](),controller[_0xd373('0xa')]);router[_0xd373('0x7')]('/:id',auth[_0xd373('0x8')](),controller[_0xd373('0xb')]);router[_0xd373('0xc')]('/',auth[_0xd373('0x8')](),controller['create']);router['put'](_0xd373('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd373('0xe')]('/:id',auth[_0xd373('0x8')](),controller[_0xd373('0xf')]);module[_0xd373('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index bf30654..8781a2f 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x1deb84,_0x573d54){var _0x4b951e=function(_0x56afbf){while(--_0x56afbf){_0x1deb84['push'](_0x1deb84['shift']());}};_0x4b951e(++_0x573d54);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a1afd,_0x4934b6){_0x1a1afd=_0x1a1afd-0x0;var _0x278d52=_0xf4eb[_0x1a1afd];return _0x278d52;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x43aac5,_0x2e830e){_0x43aac5=_0x43aac5-0x0;var _0x544f6b=_0xb43b[_0x43aac5];return _0x544f6b;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index aa4026c..865c7b1 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 _0xdbc5=['sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x5ad443,_0x1d5cc4){var _0x279bc4=function(_0x44d6a0){while(--_0x44d6a0){_0x5ad443['push'](_0x5ad443['shift']());}};_0x279bc4(++_0x1d5cc4);}(_0xdbc5,0x87));var _0x5dbc=function(_0x56d039,_0x1c04cb){_0x56d039=_0x56d039-0x0;var _0x1ea0b0=_0xdbc5[_0x56d039];return _0x1ea0b0;};'use strict';var emlformat=require(_0x5dbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5dbc('0x1'));var jsonpatch=require(_0x5dbc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5dbc('0x3'));var Mustache=require(_0x5dbc('0x4'));var util=require(_0x5dbc('0x5'));var path=require(_0x5dbc('0x6'));var sox=require(_0x5dbc('0x7'));var csv=require(_0x5dbc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5dbc('0x9'));var squel=require(_0x5dbc('0xa'));var crypto=require('crypto');var jsforce=require(_0x5dbc('0xb'));var deskjs=require(_0x5dbc('0xc'));var toCsv=require(_0x5dbc('0x8'));var querystring=require(_0x5dbc('0xd'));var Papa=require(_0x5dbc('0xe'));var Redis=require(_0x5dbc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5dbc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbc('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbc('0x12'));var db=require(_0x5dbc('0x13'))['db'];function respondWithStatusCode(_0x39212a,_0x3d450f){_0x3d450f=_0x3d450f||0xcc;return function(_0x126f79){if(_0x126f79){return _0x39212a['sendStatus'](_0x3d450f);}return _0x39212a[_0x5dbc('0x14')](_0x3d450f)[_0x5dbc('0x15')]();};}function respondWithResult(_0x4cc77d,_0x1260e7){_0x1260e7=_0x1260e7||0xc8;return function(_0xed94c3){if(_0xed94c3){return _0x4cc77d['status'](_0x1260e7)[_0x5dbc('0x16')](_0xed94c3);}};}function respondWithFilteredResult(_0x127f8f,_0x4e8bbe){return function(_0x25cc6a){if(_0x25cc6a){var _0x298539=typeof _0x4e8bbe['offset']===_0x5dbc('0x17')&&typeof _0x4e8bbe[_0x5dbc('0x18')]===_0x5dbc('0x17');var _0x29715c=_0x25cc6a[_0x5dbc('0x19')];var _0x443bff=_0x298539?0x0:_0x4e8bbe[_0x5dbc('0x1a')];var _0x31723a=_0x298539?_0x25cc6a[_0x5dbc('0x19')]:_0x4e8bbe[_0x5dbc('0x1a')]+_0x4e8bbe['limit'];var _0x59a98d;if(_0x31723a>=_0x29715c){_0x31723a=_0x29715c;_0x59a98d=0xc8;}else{_0x59a98d=0xce;}_0x127f8f[_0x5dbc('0x14')](_0x59a98d);return _0x127f8f[_0x5dbc('0x1b')](_0x5dbc('0x1c'),_0x443bff+'-'+_0x31723a+'/'+_0x29715c)[_0x5dbc('0x16')](_0x25cc6a);}return null;};}function patchUpdates(_0x45fdc8){return function(_0x923eee){try{jsonpatch[_0x5dbc('0x1d')](_0x923eee,_0x45fdc8,!![]);}catch(_0x61c898){return BPromise[_0x5dbc('0x1e')](_0x61c898);}return _0x923eee['save']();};}function saveUpdates(_0x570ffb,_0x3794f7){return function(_0x1f618){if(_0x1f618){return _0x1f618['update'](_0x570ffb)[_0x5dbc('0x1f')](function(_0x1c1916){return _0x1c1916;});}return null;};}function removeEntity(_0x2563c9,_0x3f17f4){return function(_0x3a2946){if(_0x3a2946){return _0x3a2946[_0x5dbc('0x20')]()[_0x5dbc('0x1f')](function(){_0x2563c9['status'](0xcc)[_0x5dbc('0x15')]();});}};}function handleEntityNotFound(_0xe19371,_0x1e2074){return function(_0x2951bd){if(!_0x2951bd){_0xe19371['sendStatus'](0x194);}return _0x2951bd;};}function handleError(_0x1da232,_0x55a592){_0x55a592=_0x55a592||0x1f4;return function(_0x30ea5e){logger[_0x5dbc('0x21')](_0x30ea5e[_0x5dbc('0x22')]);if(_0x30ea5e[_0x5dbc('0x23')]){delete _0x30ea5e[_0x5dbc('0x23')];}_0x1da232['status'](_0x55a592)[_0x5dbc('0x24')](_0x30ea5e);};}exports['index']=function(_0x7a671d,_0x2f9b5c){var _0x160387={},_0x1ee79b={},_0x906d70={'count':0x0,'rows':[]};var _0xd06297=_[_0x5dbc('0x25')](db[_0x5dbc('0x26')][_0x5dbc('0x27')],function(_0xba4415){return{'name':_0xba4415[_0x5dbc('0x28')],'type':_0xba4415['type'][_0x5dbc('0x29')]};});_0x1ee79b['model']=_[_0x5dbc('0x25')](_0xd06297,_0x5dbc('0x23'));_0x1ee79b['query']=_[_0x5dbc('0x2a')](_0x7a671d['query']);_0x1ee79b[_0x5dbc('0x2b')]=_[_0x5dbc('0x2c')](_0x1ee79b['model'],_0x1ee79b[_0x5dbc('0x2d')]);_0x160387[_0x5dbc('0x2e')]=_[_0x5dbc('0x2c')](_0x1ee79b[_0x5dbc('0x2f')],qs[_0x5dbc('0x30')](_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x30')]));_0x160387[_0x5dbc('0x2e')]=_0x160387[_0x5dbc('0x2e')][_0x5dbc('0x31')]?_0x160387[_0x5dbc('0x2e')]:_0x1ee79b[_0x5dbc('0x2f')];if(!_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x32')]('nolimit')){_0x160387[_0x5dbc('0x18')]=qs[_0x5dbc('0x18')](_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x18')]);_0x160387[_0x5dbc('0x1a')]=qs[_0x5dbc('0x1a')](_0x7a671d[_0x5dbc('0x2d')]['offset']);}_0x160387['order']=qs[_0x5dbc('0x33')](_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x33')]);_0x160387[_0x5dbc('0x34')]=qs[_0x5dbc('0x2b')](_[_0x5dbc('0x35')](_0x7a671d[_0x5dbc('0x2d')],_0x1ee79b[_0x5dbc('0x2b')]),_0xd06297);if(_0x7a671d['query'][_0x5dbc('0x36')]){_0x160387[_0x5dbc('0x34')]=_[_0x5dbc('0x37')](_0x160387[_0x5dbc('0x34')],{'$or':_[_0x5dbc('0x25')](_0xd06297,function(_0x48c7b7){if(_0x48c7b7[_0x5dbc('0x38')]!==_0x5dbc('0x39')){var _0x15f64c={};_0x15f64c[_0x48c7b7['name']]={'$like':'%'+_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x36')]+'%'};return _0x15f64c;}})});}_0x160387=_[_0x5dbc('0x37')]({},_0x160387,_0x7a671d[_0x5dbc('0x3a')]);var _0x4627f6={'where':_0x160387[_0x5dbc('0x34')]};return db[_0x5dbc('0x26')][_0x5dbc('0x19')](_0x4627f6)['then'](function(_0x4df5d5){_0x906d70[_0x5dbc('0x19')]=_0x4df5d5;if(_0x7a671d[_0x5dbc('0x2d')][_0x5dbc('0x3b')]){_0x160387[_0x5dbc('0x3c')]=[{'all':!![]}];}return db[_0x5dbc('0x26')][_0x5dbc('0x3d')](_0x160387);})[_0x5dbc('0x1f')](function(_0x53c68c){_0x906d70[_0x5dbc('0x3e')]=_0x53c68c;return _0x906d70;})['then'](respondWithFilteredResult(_0x2f9b5c,_0x160387))[_0x5dbc('0x3f')](handleError(_0x2f9b5c,null));};exports[_0x5dbc('0x40')]=function(_0xf2ee13,_0x1dacdf){var _0x31431c={'raw':!![],'where':{'id':_0xf2ee13[_0x5dbc('0x41')]['id']}},_0x1e63e6={};_0x1e63e6[_0x5dbc('0x2f')]=_[_0x5dbc('0x2a')](db[_0x5dbc('0x26')]['rawAttributes']);_0x1e63e6['query']=_[_0x5dbc('0x2a')](_0xf2ee13['query']);_0x1e63e6[_0x5dbc('0x2b')]=_[_0x5dbc('0x2c')](_0x1e63e6['model'],_0x1e63e6['query']);_0x31431c[_0x5dbc('0x2e')]=_[_0x5dbc('0x2c')](_0x1e63e6[_0x5dbc('0x2f')],qs['fields'](_0xf2ee13[_0x5dbc('0x2d')][_0x5dbc('0x30')]));_0x31431c['attributes']=_0x31431c[_0x5dbc('0x2e')]['length']?_0x31431c['attributes']:_0x1e63e6[_0x5dbc('0x2f')];if(_0xf2ee13[_0x5dbc('0x2d')][_0x5dbc('0x3b')]){_0x31431c[_0x5dbc('0x3c')]=[{'all':!![]}];}_0x31431c=_['merge']({},_0x31431c,_0xf2ee13[_0x5dbc('0x3a')]);return db['FaxTransferReport'][_0x5dbc('0x42')](_0x31431c)['then'](handleEntityNotFound(_0x1dacdf,null))['then'](respondWithResult(_0x1dacdf,null))[_0x5dbc('0x3f')](handleError(_0x1dacdf,null));};exports[_0x5dbc('0x43')]=function(_0x1c7bde,_0x5ba71b){return db[_0x5dbc('0x26')]['create'](_0x1c7bde[_0x5dbc('0x44')],{})[_0x5dbc('0x1f')](respondWithResult(_0x5ba71b,0xc9))[_0x5dbc('0x3f')](handleError(_0x5ba71b,null));};exports[_0x5dbc('0x45')]=function(_0x30d160,_0x109431){if(_0x30d160[_0x5dbc('0x44')]['id']){delete _0x30d160[_0x5dbc('0x44')]['id'];}return db['FaxTransferReport'][_0x5dbc('0x42')]({'where':{'id':_0x30d160['params']['id']}})[_0x5dbc('0x1f')](handleEntityNotFound(_0x109431,null))[_0x5dbc('0x1f')](saveUpdates(_0x30d160[_0x5dbc('0x44')],null))[_0x5dbc('0x1f')](respondWithResult(_0x109431,null))[_0x5dbc('0x3f')](handleError(_0x109431,null));};exports[_0x5dbc('0x20')]=function(_0x5e0d3e,_0xe3556b){return db[_0x5dbc('0x26')][_0x5dbc('0x42')]({'where':{'id':_0x5e0d3e['params']['id']}})[_0x5dbc('0x1f')](handleEntityNotFound(_0xe3556b,null))[_0x5dbc('0x1f')](removeEntity(_0xe3556b,null))[_0x5dbc('0x3f')](handleError(_0xe3556b,null));};exports['describe']=function(_0x5cda27,_0x35b6ae){return db[_0x5dbc('0x26')][_0x5dbc('0x46')]()['then'](respondWithResult(_0x35b6ae,null))[_0x5dbc('0x3f')](handleError(_0x35b6ae,null));}; \ No newline at end of file +var _0xae01=['path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','FaxTransferReport','includeAll','include','findAll','catch','params','options','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x32920e,_0x1967bb){var _0x472764=function(_0xfa413a){while(--_0xfa413a){_0x32920e['push'](_0x32920e['shift']());}};_0x472764(++_0x1967bb);}(_0xae01,0x115));var _0x1ae0=function(_0x1deb5b,_0x26230e){_0x1deb5b=_0x1deb5b-0x0;var _0x3ee8a8=_0xae01[_0x1deb5b];return _0x3ee8a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ae0('0x0'));var zipdir=require(_0x1ae0('0x1'));var jsonpatch=require(_0x1ae0('0x2'));var rp=require(_0x1ae0('0x3'));var moment=require(_0x1ae0('0x4'));var BPromise=require(_0x1ae0('0x5'));var Mustache=require('mustache');var util=require(_0x1ae0('0x6'));var path=require(_0x1ae0('0x7'));var sox=require('sox');var csv=require(_0x1ae0('0x8'));var ejs=require(_0x1ae0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ae0('0xa'));var squel=require('squel');var crypto=require(_0x1ae0('0xb'));var jsforce=require(_0x1ae0('0xc'));var deskjs=require(_0x1ae0('0xd'));var toCsv=require(_0x1ae0('0x8'));var querystring=require(_0x1ae0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ae0('0xf'));var qs=require(_0x1ae0('0x10'));var as=require(_0x1ae0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ae0('0x12'));var utils=require('../../config/utils');var config=require(_0x1ae0('0x13'));var licenseUtil=require(_0x1ae0('0x14'));var db=require(_0x1ae0('0x15'))['db'];function respondWithStatusCode(_0x2cb93d,_0x1ddc10){_0x1ddc10=_0x1ddc10||0xcc;return function(_0x1d68dd){if(_0x1d68dd){return _0x2cb93d[_0x1ae0('0x16')](_0x1ddc10);}return _0x2cb93d[_0x1ae0('0x17')](_0x1ddc10)[_0x1ae0('0x18')]();};}function respondWithResult(_0x3dd233,_0x51981c){_0x51981c=_0x51981c||0xc8;return function(_0x3365cf){if(_0x3365cf){return _0x3dd233[_0x1ae0('0x17')](_0x51981c)['json'](_0x3365cf);}};}function respondWithFilteredResult(_0x34808d,_0x4944e8){return function(_0x1bcc43){if(_0x1bcc43){var _0x5933f3=typeof _0x4944e8[_0x1ae0('0x19')]==='undefined'&&typeof _0x4944e8[_0x1ae0('0x1a')]==='undefined';var _0x31e86d=_0x1bcc43['count'];var _0x240226=_0x5933f3?0x0:_0x4944e8[_0x1ae0('0x19')];var _0x5b2e09=_0x5933f3?_0x1bcc43[_0x1ae0('0x1b')]:_0x4944e8['offset']+_0x4944e8[_0x1ae0('0x1a')];var _0x13b422;if(_0x5b2e09>=_0x31e86d){_0x5b2e09=_0x31e86d;_0x13b422=0xc8;}else{_0x13b422=0xce;}_0x34808d[_0x1ae0('0x17')](_0x13b422);return _0x34808d[_0x1ae0('0x1c')]('Content-Range',_0x240226+'-'+_0x5b2e09+'/'+_0x31e86d)[_0x1ae0('0x1d')](_0x1bcc43);}return null;};}function patchUpdates(_0x35ebd4){return function(_0x472fd7){try{jsonpatch[_0x1ae0('0x1e')](_0x472fd7,_0x35ebd4,!![]);}catch(_0x39d3fc){return BPromise['reject'](_0x39d3fc);}return _0x472fd7[_0x1ae0('0x1f')]();};}function saveUpdates(_0x5ed9e7,_0x571aa0){return function(_0x1e8196){if(_0x1e8196){return _0x1e8196[_0x1ae0('0x20')](_0x5ed9e7)[_0x1ae0('0x21')](function(_0x564ad9){return _0x564ad9;});}return null;};}function removeEntity(_0x3aa19c,_0x512879){return function(_0x53d415){if(_0x53d415){return _0x53d415['destroy']()[_0x1ae0('0x21')](function(){_0x3aa19c[_0x1ae0('0x17')](0xcc)[_0x1ae0('0x18')]();});}};}function handleEntityNotFound(_0x4c2adf,_0x4d55f6){return function(_0x423309){if(!_0x423309){_0x4c2adf[_0x1ae0('0x16')](0x194);}return _0x423309;};}function handleError(_0x5c3f94,_0x51c879){_0x51c879=_0x51c879||0x1f4;return function(_0x1cde52){logger[_0x1ae0('0x22')](_0x1cde52[_0x1ae0('0x23')]);if(_0x1cde52[_0x1ae0('0x24')]){delete _0x1cde52[_0x1ae0('0x24')];}_0x5c3f94['status'](_0x51c879)['send'](_0x1cde52);};}exports[_0x1ae0('0x25')]=function(_0x4040e3,_0x55abfa){var _0x348ee1={},_0x3855fe={},_0x18bc4f={'count':0x0,'rows':[]};var _0x3fa25b=_[_0x1ae0('0x26')](db['FaxTransferReport'][_0x1ae0('0x27')],function(_0x1c2efe){return{'name':_0x1c2efe[_0x1ae0('0x28')],'type':_0x1c2efe[_0x1ae0('0x29')][_0x1ae0('0x2a')]};});_0x3855fe[_0x1ae0('0x2b')]=_['map'](_0x3fa25b,_0x1ae0('0x24'));_0x3855fe[_0x1ae0('0x2c')]=_[_0x1ae0('0x2d')](_0x4040e3[_0x1ae0('0x2c')]);_0x3855fe['filters']=_[_0x1ae0('0x2e')](_0x3855fe['model'],_0x3855fe['query']);_0x348ee1[_0x1ae0('0x2f')]=_['intersection'](_0x3855fe[_0x1ae0('0x2b')],qs[_0x1ae0('0x30')](_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x30')]));_0x348ee1[_0x1ae0('0x2f')]=_0x348ee1[_0x1ae0('0x2f')][_0x1ae0('0x31')]?_0x348ee1[_0x1ae0('0x2f')]:_0x3855fe['model'];if(!_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x32')]('nolimit')){_0x348ee1['limit']=qs[_0x1ae0('0x1a')](_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x1a')]);_0x348ee1[_0x1ae0('0x19')]=qs[_0x1ae0('0x19')](_0x4040e3['query']['offset']);}_0x348ee1[_0x1ae0('0x33')]=qs[_0x1ae0('0x34')](_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x34')]);_0x348ee1[_0x1ae0('0x35')]=qs[_0x1ae0('0x36')](_[_0x1ae0('0x37')](_0x4040e3[_0x1ae0('0x2c')],_0x3855fe[_0x1ae0('0x36')]),_0x3fa25b);if(_0x4040e3['query']['filter']){_0x348ee1[_0x1ae0('0x35')]=_[_0x1ae0('0x38')](_0x348ee1['where'],{'$or':_['map'](_0x3fa25b,function(_0x39a3df){if(_0x39a3df[_0x1ae0('0x29')]!==_0x1ae0('0x39')){var _0x86e363={};_0x86e363[_0x39a3df[_0x1ae0('0x24')]]={'$like':'%'+_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x3a')]+'%'};return _0x86e363;}})});}_0x348ee1=_[_0x1ae0('0x38')]({},_0x348ee1,_0x4040e3['options']);var _0x41dcab={'where':_0x348ee1['where']};return db[_0x1ae0('0x3b')]['count'](_0x41dcab)[_0x1ae0('0x21')](function(_0x31e3fa){_0x18bc4f[_0x1ae0('0x1b')]=_0x31e3fa;if(_0x4040e3[_0x1ae0('0x2c')][_0x1ae0('0x3c')]){_0x348ee1[_0x1ae0('0x3d')]=[{'all':!![]}];}return db[_0x1ae0('0x3b')][_0x1ae0('0x3e')](_0x348ee1);})['then'](function(_0x33b4a6){_0x18bc4f['rows']=_0x33b4a6;return _0x18bc4f;})[_0x1ae0('0x21')](respondWithFilteredResult(_0x55abfa,_0x348ee1))[_0x1ae0('0x3f')](handleError(_0x55abfa,null));};exports['show']=function(_0x1b089d,_0x309816){var _0x4a6959={'raw':!![],'where':{'id':_0x1b089d[_0x1ae0('0x40')]['id']}},_0xf92a11={};_0xf92a11[_0x1ae0('0x2b')]=_['keys'](db[_0x1ae0('0x3b')]['rawAttributes']);_0xf92a11['query']=_[_0x1ae0('0x2d')](_0x1b089d[_0x1ae0('0x2c')]);_0xf92a11[_0x1ae0('0x36')]=_['intersection'](_0xf92a11[_0x1ae0('0x2b')],_0xf92a11[_0x1ae0('0x2c')]);_0x4a6959[_0x1ae0('0x2f')]=_['intersection'](_0xf92a11[_0x1ae0('0x2b')],qs[_0x1ae0('0x30')](_0x1b089d[_0x1ae0('0x2c')][_0x1ae0('0x30')]));_0x4a6959['attributes']=_0x4a6959[_0x1ae0('0x2f')][_0x1ae0('0x31')]?_0x4a6959[_0x1ae0('0x2f')]:_0xf92a11['model'];if(_0x1b089d[_0x1ae0('0x2c')][_0x1ae0('0x3c')]){_0x4a6959['include']=[{'all':!![]}];}_0x4a6959=_[_0x1ae0('0x38')]({},_0x4a6959,_0x1b089d[_0x1ae0('0x41')]);return db[_0x1ae0('0x3b')][_0x1ae0('0x42')](_0x4a6959)[_0x1ae0('0x21')](handleEntityNotFound(_0x309816,null))[_0x1ae0('0x21')](respondWithResult(_0x309816,null))['catch'](handleError(_0x309816,null));};exports[_0x1ae0('0x43')]=function(_0x47bd3a,_0x4a76c9){return db['FaxTransferReport'][_0x1ae0('0x43')](_0x47bd3a['body'],{})[_0x1ae0('0x21')](respondWithResult(_0x4a76c9,0xc9))[_0x1ae0('0x3f')](handleError(_0x4a76c9,null));};exports['update']=function(_0x273b9a,_0x179ace){if(_0x273b9a['body']['id']){delete _0x273b9a[_0x1ae0('0x44')]['id'];}return db[_0x1ae0('0x3b')]['find']({'where':{'id':_0x273b9a['params']['id']}})[_0x1ae0('0x21')](handleEntityNotFound(_0x179ace,null))[_0x1ae0('0x21')](saveUpdates(_0x273b9a[_0x1ae0('0x44')],null))[_0x1ae0('0x21')](respondWithResult(_0x179ace,null))[_0x1ae0('0x3f')](handleError(_0x179ace,null));};exports[_0x1ae0('0x45')]=function(_0x21b94f,_0x1984ea){return db['FaxTransferReport'][_0x1ae0('0x42')]({'where':{'id':_0x21b94f[_0x1ae0('0x40')]['id']}})[_0x1ae0('0x21')](handleEntityNotFound(_0x1984ea,null))['then'](removeEntity(_0x1984ea,null))['catch'](handleError(_0x1984ea,null));};exports[_0x1ae0('0x46')]=function(_0x673cc1,_0x34ba74){return db[_0x1ae0('0x3b')][_0x1ae0('0x46')]()['then'](respondWithResult(_0x34ba74,null))[_0x1ae0('0x3f')](handleError(_0x34ba74,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 19e7116..36513c9 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 _0xe98f=['report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport'];(function(_0xff7cf6,_0x51fca6){var _0x4c4b41=function(_0x58cee7){while(--_0x58cee7){_0xff7cf6['push'](_0xff7cf6['shift']());}};_0x4c4b41(++_0x51fca6);}(_0xe98f,0xde));var _0xfe98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var logger=require(_0xfe98('0x1'))('api');var moment=require(_0xfe98('0x2'));var BPromise=require(_0xfe98('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe98('0x4'));var config=require('../../config/environment');var attributes=require(_0xfe98('0x5'));module[_0xfe98('0x6')]=function(_0x4a2baa,_0x3aab59){return _0x4a2baa['define'](_0xfe98('0x7'),attributes,{'tableName':_0xfe98('0x8'),'paranoid':![],'indexes':[{'name':_0xfe98('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d20=['define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x2d20,0x1d1));var _0x02d2=function(_0x409789,_0xba72a0){_0x409789=_0x409789-0x0;var _0x56e5b2=_0x2d20[_0x409789];return _0x56e5b2;};'use strict';var _=require(_0x02d2('0x0'));var util=require(_0x02d2('0x1'));var logger=require(_0x02d2('0x2'))('api');var moment=require(_0x02d2('0x3'));var BPromise=require(_0x02d2('0x4'));var rp=require(_0x02d2('0x5'));var fs=require('fs');var path=require(_0x02d2('0x6'));var rimraf=require(_0x02d2('0x7'));var config=require(_0x02d2('0x8'));var attributes=require(_0x02d2('0x9'));module[_0x02d2('0xa')]=function(_0x134048,_0xac81c8){return _0x134048[_0x02d2('0xb')](_0x02d2('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x02d2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index d12b492..d7f7fe5 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 _0x9ae2=['code','message','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5f29e3,_0x113c77){var _0x58fd02=function(_0x3e82ef){while(--_0x3e82ef){_0x5f29e3['push'](_0x5f29e3['shift']());}};_0x58fd02(++_0x113c77);}(_0x9ae2,0x8b));var _0x29ae=function(_0x1b3a72,_0x3a1f98){_0x1b3a72=_0x1b3a72-0x0;var _0x8b247f=_0x9ae2[_0x1b3a72];return _0x8b247f;};'use strict';var _=require('lodash');var util=require(_0x29ae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29ae('0x1'));var db=require(_0x29ae('0x2'))['db'];var utils=require(_0x29ae('0x3'));var logger=require(_0x29ae('0x4'))('rpc');var config=require(_0x29ae('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29ae('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5628e6,_0x2fd26d,_0x5c7847){return new BPromise(function(_0x273e86,_0x204f32){return client[_0x29ae('0x7')](_0x5628e6,_0x5c7847)[_0x29ae('0x8')](function(_0x1703cd){logger[_0x29ae('0x9')](_0x29ae('0xa'),_0x2fd26d,'request\x20sent');logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2fd26d,_0x29ae('0xb'),JSON[_0x29ae('0xc')](_0x1703cd));if(_0x1703cd[_0x29ae('0xd')]){if(_0x1703cd[_0x29ae('0xd')][_0x29ae('0xe')]===0x1f4){logger[_0x29ae('0xd')](_0x29ae('0xa'),_0x2fd26d,_0x1703cd[_0x29ae('0xd')][_0x29ae('0xf')]);return _0x204f32(_0x1703cd[_0x29ae('0xd')][_0x29ae('0xf')]);}logger[_0x29ae('0xd')](_0x29ae('0xa'),_0x2fd26d,_0x1703cd[_0x29ae('0xd')]['message']);return _0x273e86(_0x1703cd['error'][_0x29ae('0xf')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2fd26d,_0x29ae('0xb'));_0x273e86(_0x1703cd['result'][_0x29ae('0xf')]);}})[_0x29ae('0x10')](function(_0x95e851){logger[_0x29ae('0xd')](_0x29ae('0xa'),_0x2fd26d,_0x95e851);_0x204f32(_0x95e851);});});} \ No newline at end of file +var _0x7bc7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x206c4c,_0x5c4ce2){var _0x18d72a=function(_0x3663e0){while(--_0x3663e0){_0x206c4c['push'](_0x206c4c['shift']());}};_0x18d72a(++_0x5c4ce2);}(_0x7bc7,0xe4));var _0x77bc=function(_0x42952c,_0x17b07f){_0x42952c=_0x42952c-0x0;var _0x379eb4=_0x7bc7[_0x42952c];return _0x379eb4;};'use strict';var _=require(_0x77bc('0x0'));var util=require(_0x77bc('0x1'));var moment=require(_0x77bc('0x2'));var BPromise=require(_0x77bc('0x3'));var rs=require(_0x77bc('0x4'));var fs=require('fs');var Redis=require(_0x77bc('0x5'));var db=require(_0x77bc('0x6'))['db'];var utils=require(_0x77bc('0x7'));var logger=require('../../config/logger')(_0x77bc('0x8'));var config=require(_0x77bc('0x9'));var jayson=require(_0x77bc('0xa'));var client=jayson['client'][_0x77bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a234e,_0x20568a,_0x5d61e0){return new BPromise(function(_0x4c3ec7,_0x36e7f6){return client[_0x77bc('0xc')](_0x3a234e,_0x5d61e0)[_0x77bc('0xd')](function(_0x2f7aee){logger[_0x77bc('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x20568a,_0x77bc('0xf'));logger['debug'](_0x77bc('0x10'),_0x20568a,_0x77bc('0xf'),JSON[_0x77bc('0x11')](_0x2f7aee));if(_0x2f7aee[_0x77bc('0x12')]){if(_0x2f7aee[_0x77bc('0x12')][_0x77bc('0x13')]===0x1f4){logger['error'](_0x77bc('0x14'),_0x20568a,_0x2f7aee[_0x77bc('0x12')][_0x77bc('0x15')]);return _0x36e7f6(_0x2f7aee['error'][_0x77bc('0x15')]);}logger[_0x77bc('0x12')](_0x77bc('0x14'),_0x20568a,_0x2f7aee[_0x77bc('0x12')][_0x77bc('0x15')]);return _0x4c3ec7(_0x2f7aee[_0x77bc('0x12')]['message']);}else{logger[_0x77bc('0xe')](_0x77bc('0x14'),_0x20568a,_0x77bc('0xf'));_0x4c3ec7(_0x2f7aee['result'][_0x77bc('0x15')]);}})[_0x77bc('0x16')](function(_0x598534){logger['error'](_0x77bc('0x14'),_0x20568a,_0x598534);_0x36e7f6(_0x598534);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 792b298..4a6c7b1 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 _0x4b2a=['create','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x30ad8c,_0xd7ab54){var _0x1677d5=function(_0x2cd033){while(--_0x2cd033){_0x30ad8c['push'](_0x30ad8c['shift']());}};_0x1677d5(++_0xd7ab54);}(_0x4b2a,0x1a2));var _0xa4b2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b2a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var path=require('path');var timeout=require(_0xa4b2('0x2'));var express=require(_0xa4b2('0x3'));var router=express['Router']();var fs_extra=require(_0xa4b2('0x4'));var auth=require(_0xa4b2('0x5'));var interaction=require(_0xa4b2('0x6'));var config=require('../../config/environment');var controller=require(_0xa4b2('0x7'));router[_0xa4b2('0x8')]('/',auth[_0xa4b2('0x9')](),controller['index']);router['get'](_0xa4b2('0xa'),auth[_0xa4b2('0x9')](),controller[_0xa4b2('0xb')]);router[_0xa4b2('0x8')](_0xa4b2('0xc'),auth[_0xa4b2('0x9')](),controller[_0xa4b2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa4b2('0xe')]);router[_0xa4b2('0xf')](_0xa4b2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa4b2('0xc'),auth[_0xa4b2('0x9')](),controller[_0xa4b2('0x10')]);module[_0xa4b2('0x11')]=router; \ No newline at end of file +var _0xacc8=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xacc8,0x10a));var _0x8acc=function(_0x3ab565,_0x93c0c1){_0x3ab565=_0x3ab565-0x0;var _0x3f01a9=_0xacc8[_0x3ab565];return _0x3f01a9;};'use strict';var multer=require(_0x8acc('0x0'));var util=require(_0x8acc('0x1'));var path=require('path');var timeout=require(_0x8acc('0x2'));var express=require(_0x8acc('0x3'));var router=express[_0x8acc('0x4')]();var fs_extra=require(_0x8acc('0x5'));var auth=require(_0x8acc('0x6'));var interaction=require(_0x8acc('0x7'));var config=require(_0x8acc('0x8'));var controller=require(_0x8acc('0x9'));router[_0x8acc('0xa')]('/',auth[_0x8acc('0xb')](),controller[_0x8acc('0xc')]);router[_0x8acc('0xa')](_0x8acc('0xd'),auth['isAuthenticated'](),controller[_0x8acc('0xe')]);router[_0x8acc('0xa')]('/:id',auth[_0x8acc('0xb')](),controller[_0x8acc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8acc('0x10')]);router['put'](_0x8acc('0x11'),auth[_0x8acc('0xb')](),controller['update']);router[_0x8acc('0x12')](_0x8acc('0x11'),auth['isAuthenticated'](),controller[_0x8acc('0x13')]);module[_0x8acc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 0b08f84..2d2e14f 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 _0x6df0=['create','addConfiguration','put','/:id','update','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x1646fc,_0x4ea26c){var _0xeb2f3f=function(_0x5afebd){while(--_0x5afebd){_0x1646fc['push'](_0x1646fc['shift']());}};_0xeb2f3f(++_0x4ea26c);}(_0x6df0,0x1e6));var _0x06df=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0x6df0[_0x5a7d5f];return _0x5dcded;};'use strict';var multer=require(_0x06df('0x0'));var util=require('util');var path=require(_0x06df('0x1'));var timeout=require(_0x06df('0x2'));var express=require(_0x06df('0x3'));var router=express['Router']();var fs_extra=require(_0x06df('0x4'));var auth=require(_0x06df('0x5'));var interaction=require(_0x06df('0x6'));var config=require(_0x06df('0x7'));var controller=require(_0x06df('0x8'));router['get']('/',auth[_0x06df('0x9')](),controller[_0x06df('0xa')]);router[_0x06df('0xb')]('/:id',auth[_0x06df('0x9')](),controller[_0x06df('0xc')]);router[_0x06df('0xb')](_0x06df('0xd'),auth[_0x06df('0x9')](),controller[_0x06df('0xe')]);router[_0x06df('0xb')](_0x06df('0xf'),auth[_0x06df('0x9')](),controller[_0x06df('0x10')]);router[_0x06df('0x11')]('/',auth[_0x06df('0x9')](),controller[_0x06df('0x12')]);router[_0x06df('0x11')]('/:id/configurations',auth[_0x06df('0x9')](),controller[_0x06df('0x13')]);router[_0x06df('0x14')](_0x06df('0x15'),auth[_0x06df('0x9')](),controller[_0x06df('0x16')]);router['delete'](_0x06df('0x15'),auth[_0x06df('0x9')](),controller[_0x06df('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2f6a=['create','/:id/configurations','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x55b75d,_0x348ced){var _0x343a15=function(_0xb1acbb){while(--_0xb1acbb){_0x55b75d['push'](_0x55b75d['shift']());}};_0x343a15(++_0x348ced);}(_0x2f6a,0x14b));var _0xa2f6=function(_0x313952,_0x22d8a8){_0x313952=_0x313952-0x0;var _0x41780d=_0x2f6a[_0x313952];return _0x41780d;};'use strict';var multer=require(_0xa2f6('0x0'));var util=require('util');var path=require(_0xa2f6('0x1'));var timeout=require(_0xa2f6('0x2'));var express=require(_0xa2f6('0x3'));var router=express[_0xa2f6('0x4')]();var fs_extra=require(_0xa2f6('0x5'));var auth=require(_0xa2f6('0x6'));var interaction=require(_0xa2f6('0x7'));var config=require(_0xa2f6('0x8'));var controller=require(_0xa2f6('0x9'));router[_0xa2f6('0xa')]('/',auth['isAuthenticated'](),controller[_0xa2f6('0xb')]);router[_0xa2f6('0xa')](_0xa2f6('0xc'),auth[_0xa2f6('0xd')](),controller[_0xa2f6('0xe')]);router['get']('/:id/configurations',auth[_0xa2f6('0xd')](),controller[_0xa2f6('0xf')]);router[_0xa2f6('0xa')](_0xa2f6('0x10'),auth[_0xa2f6('0xd')](),controller[_0xa2f6('0x11')]);router[_0xa2f6('0x12')]('/',auth[_0xa2f6('0xd')](),controller[_0xa2f6('0x13')]);router['post'](_0xa2f6('0x14'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa2f6('0x15')](_0xa2f6('0xc'),auth[_0xa2f6('0xd')](),controller[_0xa2f6('0x16')]);router[_0xa2f6('0x17')](_0xa2f6('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa2f6('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 8a38ed4..43ebf92 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 _0x54d2=['STRING','basic','ENUM','integrationTab','sequelize','exports'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0x54d2,0xd0));var _0x254d=function(_0x3e2352,_0x2708c7){_0x3e2352=_0x3e2352-0x0;var _0x3b3c27=_0x54d2[_0x3e2352];return _0x3b3c27;};'use strict';var Sequelize=require(_0x254d('0x0'));module[_0x254d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x254d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x254d('0x3')),'defaultValue':_0x254d('0x3')},'password':{'type':Sequelize[_0x254d('0x2')]},'consumerKey':{'type':Sequelize[_0x254d('0x2')]},'consumerSecret':{'type':Sequelize[_0x254d('0x2')]},'token':{'type':Sequelize[_0x254d('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x254d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x254d('0x4')](_0x254d('0x5'),'newTab'),'defaultValue':_0x254d('0x5')}}; \ No newline at end of file +var _0xc6eb=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x434b74,_0x167332){var _0x8e84d4=function(_0xa96224){while(--_0xa96224){_0x434b74['push'](_0x434b74['shift']());}};_0x8e84d4(++_0x167332);}(_0xc6eb,0x1d5));var _0xbc6e=function(_0x1e2447,_0x5fea89){_0x1e2447=_0x1e2447-0x0;var _0x306f03=_0xc6eb[_0x1e2447];return _0x306f03;};'use strict';var Sequelize=require(_0xbc6e('0x0'));module[_0xbc6e('0x1')]={'name':{'type':Sequelize[_0xbc6e('0x2')]},'description':{'type':Sequelize[_0xbc6e('0x2')]},'username':{'type':Sequelize[_0xbc6e('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xbc6e('0x3')](_0xbc6e('0x4')),'defaultValue':_0xbc6e('0x4')},'password':{'type':Sequelize[_0xbc6e('0x2')]},'consumerKey':{'type':Sequelize[_0xbc6e('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbc6e('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbc6e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbc6e('0x3')](_0xbc6e('0x5'),_0xbc6e('0x6')),'defaultValue':_0xbc6e('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 143f4ec..d481728 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 _0x5266=['findOne','order','pick','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','substring','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','options','includeAll','findAll','rows','catch','show','find','create','body','params','getConfigurations'];(function(_0x29e2ba,_0x1b171f){var _0x5c5920=function(_0x3b09c4){while(--_0x3b09c4){_0x29e2ba['push'](_0x29e2ba['shift']());}};_0x5c5920(++_0x1b171f);}(_0x5266,0x90));var _0x6526=function(_0x13a102,_0x7f6c67){_0x13a102=_0x13a102-0x0;var _0x3a37d2=_0x5266[_0x13a102];return _0x3a37d2;};'use strict';var emlformat=require(_0x6526('0x0'));var rimraf=require(_0x6526('0x1'));var zipdir=require(_0x6526('0x2'));var jsonpatch=require(_0x6526('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6526('0x4'));var util=require(_0x6526('0x5'));var path=require(_0x6526('0x6'));var sox=require(_0x6526('0x7'));var csv=require(_0x6526('0x8'));var ejs=require(_0x6526('0x9'));var fs=require('fs');var fs_extra=require(_0x6526('0xa'));var _=require(_0x6526('0xb'));var squel=require('squel');var crypto=require(_0x6526('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6526('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6526('0xe'));var authService=require(_0x6526('0xf'));var qs=require(_0x6526('0x10'));var as=require(_0x6526('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6526('0x12'))(_0x6526('0x13'));var utils=require(_0x6526('0x14'));var config=require(_0x6526('0x15'));var licenseUtil=require(_0x6526('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6526('0x17'));function respondWithStatusCode(_0x5de2a3,_0x1ca043){_0x1ca043=_0x1ca043||0xcc;return function(_0x4a3b68){if(_0x4a3b68){return _0x5de2a3['sendStatus'](_0x1ca043);}return _0x5de2a3['status'](_0x1ca043)['end']();};}function respondWithResult(_0x3d4112,_0x54192c){_0x54192c=_0x54192c||0xc8;return function(_0x113504){if(_0x113504){return _0x3d4112[_0x6526('0x18')](_0x54192c)[_0x6526('0x19')](_0x113504);}};}function respondWithFilteredResult(_0x4520e4,_0x35a3ef){return function(_0xa59313){if(_0xa59313){var _0x27ef6a=typeof _0x35a3ef[_0x6526('0x1a')]===_0x6526('0x1b')&&typeof _0x35a3ef['limit']==='undefined';var _0x34f942=_0xa59313[_0x6526('0x1c')];var _0x3cfdd2=_0x27ef6a?0x0:_0x35a3ef[_0x6526('0x1a')];var _0x1ac843=_0x27ef6a?_0xa59313['count']:_0x35a3ef[_0x6526('0x1a')]+_0x35a3ef['limit'];var _0x1ccba5;if(_0x1ac843>=_0x34f942){_0x1ac843=_0x34f942;_0x1ccba5=0xc8;}else{_0x1ccba5=0xce;}_0x4520e4[_0x6526('0x18')](_0x1ccba5);return _0x4520e4['set'](_0x6526('0x1d'),_0x3cfdd2+'-'+_0x1ac843+'/'+_0x34f942)[_0x6526('0x19')](_0xa59313);}return null;};}function patchUpdates(_0x50dc92){return function(_0x26820f){try{jsonpatch[_0x6526('0x1e')](_0x26820f,_0x50dc92,!![]);}catch(_0x43274c){return BPromise[_0x6526('0x1f')](_0x43274c);}return _0x26820f[_0x6526('0x20')]();};}function saveUpdates(_0x4539c2,_0x1dc4b1){return function(_0x4861ad){if(_0x4861ad){return _0x4861ad['update'](_0x4539c2)[_0x6526('0x21')](function(_0x3a41ad){return _0x3a41ad;});}return null;};}function removeEntity(_0x2041f4,_0x163e03){return function(_0x326e7b){if(_0x326e7b){return _0x326e7b[_0x6526('0x22')]()[_0x6526('0x21')](function(){_0x2041f4[_0x6526('0x18')](0xcc)[_0x6526('0x23')]();});}};}function handleEntityNotFound(_0x2f9973,_0x24f050){return function(_0x4d285a){if(!_0x4d285a){_0x2f9973[_0x6526('0x24')](0x194);}return _0x4d285a;};}function handleError(_0x4c686a,_0x1ad46a){_0x1ad46a=_0x1ad46a||0x1f4;return function(_0x50439d){logger[_0x6526('0x25')](_0x50439d[_0x6526('0x26')]);if(_0x50439d[_0x6526('0x27')]){delete _0x50439d[_0x6526('0x27')];}_0x4c686a[_0x6526('0x18')](_0x1ad46a)['send'](_0x50439d);};}exports[_0x6526('0x28')]=function(_0x3b56dd,_0x1c45fc){var _0x7c0a02={},_0x2fcb16={},_0xc89ecd={'count':0x0,'rows':[]};var _0x409531=_['map'](db[_0x6526('0x29')][_0x6526('0x2a')],function(_0x29ed6c){return{'name':_0x29ed6c[_0x6526('0x2b')],'type':_0x29ed6c[_0x6526('0x2c')][_0x6526('0x2d')]};});_0x2fcb16[_0x6526('0x2e')]=_[_0x6526('0x2f')](_0x409531,_0x6526('0x27'));_0x2fcb16[_0x6526('0x30')]=_[_0x6526('0x31')](_0x3b56dd['query']);_0x2fcb16[_0x6526('0x32')]=_['intersection'](_0x2fcb16[_0x6526('0x2e')],_0x2fcb16[_0x6526('0x30')]);_0x7c0a02['attributes']=_[_0x6526('0x33')](_0x2fcb16[_0x6526('0x2e')],qs[_0x6526('0x34')](_0x3b56dd[_0x6526('0x30')][_0x6526('0x34')]));_0x7c0a02['attributes']=_0x7c0a02[_0x6526('0x35')][_0x6526('0x36')]?_0x7c0a02[_0x6526('0x35')]:_0x2fcb16[_0x6526('0x2e')];if(!_0x3b56dd['query'][_0x6526('0x37')](_0x6526('0x38'))){_0x7c0a02[_0x6526('0x39')]=qs[_0x6526('0x39')](_0x3b56dd[_0x6526('0x30')][_0x6526('0x39')]);_0x7c0a02[_0x6526('0x1a')]=qs[_0x6526('0x1a')](_0x3b56dd[_0x6526('0x30')][_0x6526('0x1a')]);}_0x7c0a02['order']=qs[_0x6526('0x3a')](_0x3b56dd[_0x6526('0x30')]['sort']);_0x7c0a02[_0x6526('0x3b')]=qs[_0x6526('0x32')](_['pick'](_0x3b56dd[_0x6526('0x30')],_0x2fcb16[_0x6526('0x32')]),_0x409531);if(_0x3b56dd[_0x6526('0x30')]['filter']){_0x7c0a02['where']=_[_0x6526('0x3c')](_0x7c0a02[_0x6526('0x3b')],{'$or':_[_0x6526('0x2f')](_0x409531,function(_0x187f96){if(_0x187f96[_0x6526('0x2c')]!=='VIRTUAL'){var _0x527368={};_0x527368[_0x187f96[_0x6526('0x27')]]={'$like':'%'+_0x3b56dd[_0x6526('0x30')]['filter']+'%'};return _0x527368;}})});}_0x7c0a02=_[_0x6526('0x3c')]({},_0x7c0a02,_0x3b56dd[_0x6526('0x3d')]);var _0x35141b={'where':_0x7c0a02[_0x6526('0x3b')]};return db[_0x6526('0x29')][_0x6526('0x1c')](_0x35141b)['then'](function(_0x43ad0b){_0xc89ecd[_0x6526('0x1c')]=_0x43ad0b;if(_0x3b56dd['query'][_0x6526('0x3e')]){_0x7c0a02['include']=[{'all':!![]}];}return db[_0x6526('0x29')][_0x6526('0x3f')](_0x7c0a02);})['then'](function(_0x4705ee){_0xc89ecd[_0x6526('0x40')]=_0x4705ee;return _0xc89ecd;})['then'](respondWithFilteredResult(_0x1c45fc,_0x7c0a02))[_0x6526('0x41')](handleError(_0x1c45fc,null));};exports[_0x6526('0x42')]=function(_0x16d023,_0x109947){var _0x5ba1d2={'raw':![],'where':{'id':_0x16d023['params']['id']}},_0x3dec4a={};_0x3dec4a['model']=_[_0x6526('0x31')](db['DeskAccount'][_0x6526('0x2a')]);_0x3dec4a['query']=_[_0x6526('0x31')](_0x16d023[_0x6526('0x30')]);_0x3dec4a[_0x6526('0x32')]=_[_0x6526('0x33')](_0x3dec4a[_0x6526('0x2e')],_0x3dec4a['query']);_0x5ba1d2['attributes']=_[_0x6526('0x33')](_0x3dec4a[_0x6526('0x2e')],qs[_0x6526('0x34')](_0x16d023[_0x6526('0x30')]['fields']));_0x5ba1d2[_0x6526('0x35')]=_0x5ba1d2['attributes'][_0x6526('0x36')]?_0x5ba1d2[_0x6526('0x35')]:_0x3dec4a[_0x6526('0x2e')];if(_0x16d023['query'][_0x6526('0x3e')]){_0x5ba1d2['include']=[{'all':!![]}];}_0x5ba1d2=_[_0x6526('0x3c')]({},_0x5ba1d2,_0x16d023[_0x6526('0x3d')]);return db['DeskAccount'][_0x6526('0x43')](_0x5ba1d2)[_0x6526('0x21')](handleEntityNotFound(_0x109947,null))['then'](respondWithResult(_0x109947,null))[_0x6526('0x41')](handleError(_0x109947,null));};exports[_0x6526('0x44')]=function(_0x196c86,_0x31513a){return db[_0x6526('0x29')]['create'](_0x196c86[_0x6526('0x45')],{})['then'](respondWithResult(_0x31513a,0xc9))[_0x6526('0x41')](handleError(_0x31513a,null));};exports['update']=function(_0x43d4dd,_0x3b8823){if(_0x43d4dd[_0x6526('0x45')]['id']){delete _0x43d4dd[_0x6526('0x45')]['id'];}return db[_0x6526('0x29')][_0x6526('0x43')]({'where':{'id':_0x43d4dd[_0x6526('0x46')]['id']}})[_0x6526('0x21')](handleEntityNotFound(_0x3b8823,null))[_0x6526('0x21')](saveUpdates(_0x43d4dd['body'],null))[_0x6526('0x21')](respondWithResult(_0x3b8823,null))[_0x6526('0x41')](handleError(_0x3b8823,null));};exports[_0x6526('0x22')]=function(_0x5309ab,_0x445990){return db[_0x6526('0x29')][_0x6526('0x43')]({'where':{'id':_0x5309ab['params']['id']}})[_0x6526('0x21')](handleEntityNotFound(_0x445990,null))[_0x6526('0x21')](removeEntity(_0x445990,null))['catch'](handleError(_0x445990,null));};exports[_0x6526('0x47')]=function(_0x1fecef,_0x156df6,_0x506798){var _0x3ebbc0={};var _0x131adb={};var _0x3150ea;var _0x37aa75;return db['DeskAccount'][_0x6526('0x48')]({'where':{'id':_0x1fecef[_0x6526('0x46')]['id']}})[_0x6526('0x21')](handleEntityNotFound(_0x156df6,null))['then'](function(_0x57d735){if(_0x57d735){_0x3150ea=_0x57d735;_0x131adb[_0x6526('0x2e')]=_[_0x6526('0x31')](db['DeskConfiguration']['rawAttributes']);_0x131adb[_0x6526('0x30')]=_['keys'](_0x1fecef[_0x6526('0x30')]);_0x131adb[_0x6526('0x32')]=_[_0x6526('0x33')](_0x131adb[_0x6526('0x2e')],_0x131adb[_0x6526('0x30')]);_0x3ebbc0[_0x6526('0x35')]=_[_0x6526('0x33')](_0x131adb[_0x6526('0x2e')],qs['fields'](_0x1fecef[_0x6526('0x30')][_0x6526('0x34')]));_0x3ebbc0[_0x6526('0x35')]=_0x3ebbc0['attributes'][_0x6526('0x36')]?_0x3ebbc0['attributes']:_0x131adb['model'];_0x3ebbc0[_0x6526('0x49')]=qs[_0x6526('0x3a')](_0x1fecef['query'][_0x6526('0x3a')]);_0x3ebbc0[_0x6526('0x3b')]=qs['filters'](_[_0x6526('0x4a')](_0x1fecef[_0x6526('0x30')],_0x131adb[_0x6526('0x32')]));if(_0x1fecef[_0x6526('0x30')][_0x6526('0x4b')]){_0x3ebbc0[_0x6526('0x3b')]=_[_0x6526('0x3c')](_0x3ebbc0[_0x6526('0x3b')],{'$or':_[_0x6526('0x2f')](_0x3ebbc0[_0x6526('0x35')],function(_0x2097a6){var _0xa27d01={};_0xa27d01[_0x2097a6]={'$like':'%'+_0x1fecef['query'][_0x6526('0x4b')]+'%'};return _0xa27d01;})});}_0x3ebbc0=_[_0x6526('0x3c')]({},_0x3ebbc0,_0x1fecef[_0x6526('0x3d')]);return _0x3150ea[_0x6526('0x47')](_0x3ebbc0);}})[_0x6526('0x21')](function(_0x573c50){if(_0x573c50){_0x37aa75=_0x573c50[_0x6526('0x36')];if(!_0x1fecef[_0x6526('0x30')][_0x6526('0x37')](_0x6526('0x38'))){_0x3ebbc0[_0x6526('0x39')]=qs[_0x6526('0x39')](_0x1fecef['query'][_0x6526('0x39')]);_0x3ebbc0[_0x6526('0x1a')]=qs[_0x6526('0x1a')](_0x1fecef[_0x6526('0x30')]['offset']);}return _0x3150ea[_0x6526('0x47')](_0x3ebbc0);}})[_0x6526('0x21')](function(_0x1e1646){if(_0x1e1646){return _0x1e1646?{'count':_0x37aa75,'rows':_0x1e1646}:null;}})['then'](respondWithResult(_0x156df6,null))[_0x6526('0x41')](handleError(_0x156df6,null));};exports['addConfiguration']=function(_0x35cbc8,_0x3b416f,_0x49b201){if(_0x35cbc8['body']['id']){delete _0x35cbc8['body']['id'];}return db[_0x6526('0x29')][_0x6526('0x48')]({'where':{'id':_0x35cbc8['params']['id']}})[_0x6526('0x21')](handleEntityNotFound(_0x3b416f,null))[_0x6526('0x21')](function(_0x1e7d80){if(_0x1e7d80){_0x35cbc8[_0x6526('0x45')][_0x6526('0x4c')]=_0x1e7d80['id'];_0x35cbc8[_0x6526('0x45')][_0x6526('0x4d')]=integrations[_0x6526('0x4e')](_0x35cbc8[_0x6526('0x45')][_0x6526('0x4f')],_0x35cbc8[_0x6526('0x45')][_0x6526('0x2c')]);_0x35cbc8[_0x6526('0x45')][_0x6526('0x50')]=integrations[_0x6526('0x51')](_0x35cbc8[_0x6526('0x45')][_0x6526('0x4f')],_0x35cbc8['body'][_0x6526('0x2c')]);return db['DeskConfiguration'][_0x6526('0x44')](_0x35cbc8[_0x6526('0x45')],{'include':[{'model':db[_0x6526('0x52')],'as':'Subjects'},{'model':db[_0x6526('0x52')],'as':_0x6526('0x50')}]});}return null;})[_0x6526('0x21')](respondWithResult(_0x3b416f,null))[_0x6526('0x41')](handleError(_0x3b416f,null));};exports[_0x6526('0x53')]=function(_0x50298,_0x1a664e,_0x748bc5){var _0x1cf354=[{'name':_0x6526('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2d51f1='';return db[_0x6526('0x29')][_0x6526('0x48')]({'where':{'id':_0x50298['params']['id']},'attributes':['id',_0x6526('0x55'),_0x6526('0x56'),_0x6526('0x57'),_0x6526('0x58'),_0x6526('0x59'),_0x6526('0x5a'),'token','tokenSecret']})[_0x6526('0x21')](handleEntityNotFound(_0x1a664e,null))[_0x6526('0x21')](function(_0x19e6a8){if(_0x19e6a8){_0x2d51f1=_0x19e6a8['remoteUri'];var _0x24cde8=_0x2d51f1['slice'](-0x1);if(_0x24cde8==='/'){_0x2d51f1=_0x2d51f1[_0x6526('0x5b')](0x0,_0x2d51f1['lastIndexOf'](_0x24cde8));}var _0x3f3514={'method':_0x6526('0x5c'),'uri':util[_0x6526('0x5d')](_0x6526('0x5e'),_0x2d51f1),'headers':{'Content-Type':_0x6526('0x5f'),'Accept':_0x6526('0x5f')},'json':!![]};if(_0x19e6a8['authType']===_0x6526('0x60')){_0x3f3514['headers'][_0x6526('0x61')]=util[_0x6526('0x5d')](_0x6526('0x62'),new Buffer(util['format'](_0x6526('0x63'),_0x19e6a8['username'],_0x19e6a8['password']))[_0x6526('0x64')](_0x6526('0x65')));}return rp(_0x3f3514)[_0x6526('0x21')](function(_0x556030){return _0x1cf354[_0x6526('0x66')](_[_0x6526('0x2f')](_0x556030['_embedded']['entries'],function(_0x54c364){return{'id':_0x54c364['name'],'name':_0x54c364[_0x6526('0x27')],'type':_0x54c364[_0x6526('0x2c')],'active':_0x54c364[_0x6526('0x67')],'label':_0x54c364['label'],'custom':!![]};}));});}})[_0x6526('0x21')](function(_0x5604e4){return{'count':_0x5604e4['length'],'rows':_0x5604e4};})['then'](respondWithResult(_0x1a664e,null))[_0x6526('0x41')](function(_0x309366){var _0x1c0306=_0x50298['query']['test']?0x1f4:_0x309366[_0x6526('0x68')]||0x1f4;logger[_0x6526('0x25')](_0x6526('0x69'),'getFields',_0x1c0306,JSON['stringify'](_0x309366));delete _0x309366[_0x6526('0x27')];if(_0x1c0306===0x191){_0x1c0306=0x190;}_0x1a664e[_0x6526('0x18')](_0x1c0306)[_0x6526('0x6a')](_0x50298[_0x6526('0x30')]['test']?{'message':_0x6526('0x6b'),'statusCode':_0x309366[_0x6526('0x68')]}:_0x309366);});}; \ No newline at end of file +var _0x275f=['DeskConfiguration','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','format','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','send','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','pick','filter','where','type','name','merge','options','includeAll','include','findAll','catch','params','find','create','body','getConfigurations','findOne','sort','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions'];(function(_0x5e1990,_0x1700b2){var _0x34430c=function(_0x1455ca){while(--_0x1455ca){_0x5e1990['push'](_0x5e1990['shift']());}};_0x34430c(++_0x1700b2);}(_0x275f,0x1da));var _0xf275=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0x275f[_0x20bc10];return _0x3bd5ce;};'use strict';var emlformat=require(_0xf275('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf275('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf275('0x2'));var moment=require('moment');var BPromise=require(_0xf275('0x3'));var Mustache=require(_0xf275('0x4'));var util=require('util');var path=require(_0xf275('0x5'));var sox=require(_0xf275('0x6'));var csv=require(_0xf275('0x7'));var ejs=require(_0xf275('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf275('0x9'));var crypto=require(_0xf275('0xa'));var jsforce=require(_0xf275('0xb'));var deskjs=require(_0xf275('0xc'));var toCsv=require(_0xf275('0x7'));var querystring=require(_0xf275('0xd'));var Papa=require(_0xf275('0xe'));var Redis=require(_0xf275('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf275('0x10'));var as=require(_0xf275('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf275('0x12'))(_0xf275('0x13'));var utils=require(_0xf275('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf275('0x15'));var db=require(_0xf275('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1ae7f8,_0x3ef0e8){_0x3ef0e8=_0x3ef0e8||0xcc;return function(_0x3ceff5){if(_0x3ceff5){return _0x1ae7f8[_0xf275('0x17')](_0x3ef0e8);}return _0x1ae7f8['status'](_0x3ef0e8)['end']();};}function respondWithResult(_0x4eb9ac,_0x308e19){_0x308e19=_0x308e19||0xc8;return function(_0xabac77){if(_0xabac77){return _0x4eb9ac[_0xf275('0x18')](_0x308e19)[_0xf275('0x19')](_0xabac77);}};}function respondWithFilteredResult(_0x378468,_0x4c6e89){return function(_0x1ddf43){if(_0x1ddf43){var _0x177356=typeof _0x4c6e89[_0xf275('0x1a')]===_0xf275('0x1b')&&typeof _0x4c6e89[_0xf275('0x1c')]===_0xf275('0x1b');var _0x1e4c7e=_0x1ddf43[_0xf275('0x1d')];var _0x2654ad=_0x177356?0x0:_0x4c6e89['offset'];var _0xc57f0a=_0x177356?_0x1ddf43['count']:_0x4c6e89[_0xf275('0x1a')]+_0x4c6e89[_0xf275('0x1c')];var _0x37620b;if(_0xc57f0a>=_0x1e4c7e){_0xc57f0a=_0x1e4c7e;_0x37620b=0xc8;}else{_0x37620b=0xce;}_0x378468[_0xf275('0x18')](_0x37620b);return _0x378468['set'](_0xf275('0x1e'),_0x2654ad+'-'+_0xc57f0a+'/'+_0x1e4c7e)[_0xf275('0x19')](_0x1ddf43);}return null;};}function patchUpdates(_0x3e9824){return function(_0x4bf0ee){try{jsonpatch[_0xf275('0x1f')](_0x4bf0ee,_0x3e9824,!![]);}catch(_0x32a8f0){return BPromise[_0xf275('0x20')](_0x32a8f0);}return _0x4bf0ee[_0xf275('0x21')]();};}function saveUpdates(_0x2d3ede,_0x44b358){return function(_0x6f6cb5){if(_0x6f6cb5){return _0x6f6cb5[_0xf275('0x22')](_0x2d3ede)[_0xf275('0x23')](function(_0x405897){return _0x405897;});}return null;};}function removeEntity(_0x3fec93,_0xee2f24){return function(_0x717cbf){if(_0x717cbf){return _0x717cbf[_0xf275('0x24')]()['then'](function(){_0x3fec93[_0xf275('0x18')](0xcc)[_0xf275('0x25')]();});}};}function handleEntityNotFound(_0x514c21,_0x26818e){return function(_0x162266){if(!_0x162266){_0x514c21[_0xf275('0x17')](0x194);}return _0x162266;};}function handleError(_0x376fff,_0xf948e7){_0xf948e7=_0xf948e7||0x1f4;return function(_0x1f456c){logger[_0xf275('0x26')](_0x1f456c['stack']);if(_0x1f456c['name']){delete _0x1f456c['name'];}_0x376fff['status'](_0xf948e7)[_0xf275('0x27')](_0x1f456c);};}exports[_0xf275('0x28')]=function(_0x1d950a,_0x5c81b6){var _0x32e3f2={},_0x597457={},_0x399464={'count':0x0,'rows':[]};var _0x19ecaa=_[_0xf275('0x29')](db[_0xf275('0x2a')][_0xf275('0x2b')],function(_0xeb610b){return{'name':_0xeb610b[_0xf275('0x2c')],'type':_0xeb610b['type'][_0xf275('0x2d')]};});_0x597457[_0xf275('0x2e')]=_[_0xf275('0x29')](_0x19ecaa,'name');_0x597457[_0xf275('0x2f')]=_[_0xf275('0x30')](_0x1d950a[_0xf275('0x2f')]);_0x597457[_0xf275('0x31')]=_['intersection'](_0x597457['model'],_0x597457['query']);_0x32e3f2[_0xf275('0x32')]=_[_0xf275('0x33')](_0x597457['model'],qs[_0xf275('0x34')](_0x1d950a[_0xf275('0x2f')][_0xf275('0x34')]));_0x32e3f2[_0xf275('0x32')]=_0x32e3f2['attributes'][_0xf275('0x35')]?_0x32e3f2[_0xf275('0x32')]:_0x597457[_0xf275('0x2e')];if(!_0x1d950a[_0xf275('0x2f')]['hasOwnProperty']('nolimit')){_0x32e3f2[_0xf275('0x1c')]=qs[_0xf275('0x1c')](_0x1d950a[_0xf275('0x2f')][_0xf275('0x1c')]);_0x32e3f2[_0xf275('0x1a')]=qs['offset'](_0x1d950a[_0xf275('0x2f')][_0xf275('0x1a')]);}_0x32e3f2[_0xf275('0x36')]=qs['sort'](_0x1d950a[_0xf275('0x2f')]['sort']);_0x32e3f2['where']=qs[_0xf275('0x31')](_[_0xf275('0x37')](_0x1d950a[_0xf275('0x2f')],_0x597457[_0xf275('0x31')]),_0x19ecaa);if(_0x1d950a[_0xf275('0x2f')][_0xf275('0x38')]){_0x32e3f2[_0xf275('0x39')]=_['merge'](_0x32e3f2[_0xf275('0x39')],{'$or':_[_0xf275('0x29')](_0x19ecaa,function(_0x1d6182){if(_0x1d6182[_0xf275('0x3a')]!=='VIRTUAL'){var _0x576de={};_0x576de[_0x1d6182[_0xf275('0x3b')]]={'$like':'%'+_0x1d950a[_0xf275('0x2f')]['filter']+'%'};return _0x576de;}})});}_0x32e3f2=_[_0xf275('0x3c')]({},_0x32e3f2,_0x1d950a[_0xf275('0x3d')]);var _0x511d3f={'where':_0x32e3f2[_0xf275('0x39')]};return db[_0xf275('0x2a')][_0xf275('0x1d')](_0x511d3f)['then'](function(_0x5a4ce8){_0x399464[_0xf275('0x1d')]=_0x5a4ce8;if(_0x1d950a['query'][_0xf275('0x3e')]){_0x32e3f2[_0xf275('0x3f')]=[{'all':!![]}];}return db['DeskAccount'][_0xf275('0x40')](_0x32e3f2);})['then'](function(_0x2039ff){_0x399464['rows']=_0x2039ff;return _0x399464;})[_0xf275('0x23')](respondWithFilteredResult(_0x5c81b6,_0x32e3f2))[_0xf275('0x41')](handleError(_0x5c81b6,null));};exports['show']=function(_0x42bb00,_0x303aa2){var _0x5fa4a6={'raw':![],'where':{'id':_0x42bb00[_0xf275('0x42')]['id']}},_0x43b5e1={};_0x43b5e1[_0xf275('0x2e')]=_[_0xf275('0x30')](db['DeskAccount'][_0xf275('0x2b')]);_0x43b5e1['query']=_['keys'](_0x42bb00[_0xf275('0x2f')]);_0x43b5e1['filters']=_[_0xf275('0x33')](_0x43b5e1[_0xf275('0x2e')],_0x43b5e1[_0xf275('0x2f')]);_0x5fa4a6[_0xf275('0x32')]=_[_0xf275('0x33')](_0x43b5e1['model'],qs[_0xf275('0x34')](_0x42bb00[_0xf275('0x2f')][_0xf275('0x34')]));_0x5fa4a6[_0xf275('0x32')]=_0x5fa4a6[_0xf275('0x32')][_0xf275('0x35')]?_0x5fa4a6[_0xf275('0x32')]:_0x43b5e1[_0xf275('0x2e')];if(_0x42bb00[_0xf275('0x2f')][_0xf275('0x3e')]){_0x5fa4a6[_0xf275('0x3f')]=[{'all':!![]}];}_0x5fa4a6=_[_0xf275('0x3c')]({},_0x5fa4a6,_0x42bb00[_0xf275('0x3d')]);return db['DeskAccount'][_0xf275('0x43')](_0x5fa4a6)['then'](handleEntityNotFound(_0x303aa2,null))[_0xf275('0x23')](respondWithResult(_0x303aa2,null))[_0xf275('0x41')](handleError(_0x303aa2,null));};exports[_0xf275('0x44')]=function(_0x36f6e3,_0x27fa7c){return db['DeskAccount'][_0xf275('0x44')](_0x36f6e3['body'],{})[_0xf275('0x23')](respondWithResult(_0x27fa7c,0xc9))[_0xf275('0x41')](handleError(_0x27fa7c,null));};exports[_0xf275('0x22')]=function(_0x49ccf8,_0x57e890){if(_0x49ccf8[_0xf275('0x45')]['id']){delete _0x49ccf8[_0xf275('0x45')]['id'];}return db[_0xf275('0x2a')][_0xf275('0x43')]({'where':{'id':_0x49ccf8[_0xf275('0x42')]['id']}})[_0xf275('0x23')](handleEntityNotFound(_0x57e890,null))['then'](saveUpdates(_0x49ccf8['body'],null))[_0xf275('0x23')](respondWithResult(_0x57e890,null))[_0xf275('0x41')](handleError(_0x57e890,null));};exports[_0xf275('0x24')]=function(_0x1b6688,_0x4411a1){return db['DeskAccount'][_0xf275('0x43')]({'where':{'id':_0x1b6688[_0xf275('0x42')]['id']}})[_0xf275('0x23')](handleEntityNotFound(_0x4411a1,null))[_0xf275('0x23')](removeEntity(_0x4411a1,null))['catch'](handleError(_0x4411a1,null));};exports[_0xf275('0x46')]=function(_0x4d3b00,_0x5b3866,_0x5e1874){var _0x3ad88f={};var _0x4f8041={};var _0x33055a;var _0x1601ce;return db[_0xf275('0x2a')][_0xf275('0x47')]({'where':{'id':_0x4d3b00[_0xf275('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b3866,null))[_0xf275('0x23')](function(_0x43aad6){if(_0x43aad6){_0x33055a=_0x43aad6;_0x4f8041[_0xf275('0x2e')]=_[_0xf275('0x30')](db['DeskConfiguration'][_0xf275('0x2b')]);_0x4f8041[_0xf275('0x2f')]=_[_0xf275('0x30')](_0x4d3b00[_0xf275('0x2f')]);_0x4f8041['filters']=_['intersection'](_0x4f8041[_0xf275('0x2e')],_0x4f8041['query']);_0x3ad88f['attributes']=_[_0xf275('0x33')](_0x4f8041['model'],qs[_0xf275('0x34')](_0x4d3b00[_0xf275('0x2f')][_0xf275('0x34')]));_0x3ad88f[_0xf275('0x32')]=_0x3ad88f[_0xf275('0x32')]['length']?_0x3ad88f['attributes']:_0x4f8041[_0xf275('0x2e')];_0x3ad88f[_0xf275('0x36')]=qs[_0xf275('0x48')](_0x4d3b00[_0xf275('0x2f')][_0xf275('0x48')]);_0x3ad88f[_0xf275('0x39')]=qs['filters'](_[_0xf275('0x37')](_0x4d3b00['query'],_0x4f8041[_0xf275('0x31')]));if(_0x4d3b00[_0xf275('0x2f')][_0xf275('0x38')]){_0x3ad88f[_0xf275('0x39')]=_[_0xf275('0x3c')](_0x3ad88f[_0xf275('0x39')],{'$or':_[_0xf275('0x29')](_0x3ad88f[_0xf275('0x32')],function(_0x1e1f90){var _0x40edb7={};_0x40edb7[_0x1e1f90]={'$like':'%'+_0x4d3b00[_0xf275('0x2f')]['filter']+'%'};return _0x40edb7;})});}_0x3ad88f=_['merge']({},_0x3ad88f,_0x4d3b00[_0xf275('0x3d')]);return _0x33055a['getConfigurations'](_0x3ad88f);}})['then'](function(_0x5b340f){if(_0x5b340f){_0x1601ce=_0x5b340f[_0xf275('0x35')];if(!_0x4d3b00[_0xf275('0x2f')][_0xf275('0x49')](_0xf275('0x4a'))){_0x3ad88f[_0xf275('0x1c')]=qs[_0xf275('0x1c')](_0x4d3b00[_0xf275('0x2f')][_0xf275('0x1c')]);_0x3ad88f[_0xf275('0x1a')]=qs[_0xf275('0x1a')](_0x4d3b00['query']['offset']);}return _0x33055a[_0xf275('0x46')](_0x3ad88f);}})[_0xf275('0x23')](function(_0x117abf){if(_0x117abf){return _0x117abf?{'count':_0x1601ce,'rows':_0x117abf}:null;}})[_0xf275('0x23')](respondWithResult(_0x5b3866,null))[_0xf275('0x41')](handleError(_0x5b3866,null));};exports[_0xf275('0x4b')]=function(_0x2ffc5b,_0x142781,_0x3668c4){if(_0x2ffc5b[_0xf275('0x45')]['id']){delete _0x2ffc5b[_0xf275('0x45')]['id'];}return db[_0xf275('0x2a')][_0xf275('0x47')]({'where':{'id':_0x2ffc5b['params']['id']}})['then'](handleEntityNotFound(_0x142781,null))[_0xf275('0x23')](function(_0x14a107){if(_0x14a107){_0x2ffc5b['body'][_0xf275('0x4c')]=_0x14a107['id'];_0x2ffc5b['body'][_0xf275('0x4d')]=integrations[_0xf275('0x4e')](_0x2ffc5b['body'][_0xf275('0x4f')],_0x2ffc5b[_0xf275('0x45')][_0xf275('0x3a')]);_0x2ffc5b['body']['Descriptions']=integrations[_0xf275('0x50')](_0x2ffc5b[_0xf275('0x45')]['channel'],_0x2ffc5b[_0xf275('0x45')][_0xf275('0x3a')]);return db[_0xf275('0x51')][_0xf275('0x44')](_0x2ffc5b[_0xf275('0x45')],{'include':[{'model':db[_0xf275('0x52')],'as':_0xf275('0x4d')},{'model':db[_0xf275('0x52')],'as':_0xf275('0x53')}]});}return null;})[_0xf275('0x23')](respondWithResult(_0x142781,null))[_0xf275('0x41')](handleError(_0x142781,null));};exports[_0xf275('0x54')]=function(_0x3577d0,_0x351a81,_0x329b63){var _0xb3a226=[{'name':_0xf275('0x55'),'label':_0xf275('0x55'),'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 _0x46cf28='';return db[_0xf275('0x2a')][_0xf275('0x47')]({'where':{'id':_0x3577d0[_0xf275('0x42')]['id']},'attributes':['id',_0xf275('0x56'),_0xf275('0x57'),_0xf275('0x58'),_0xf275('0x59'),_0xf275('0x5a'),'consumerSecret','token',_0xf275('0x5b')]})[_0xf275('0x23')](handleEntityNotFound(_0x351a81,null))[_0xf275('0x23')](function(_0x4b79ce){if(_0x4b79ce){_0x46cf28=_0x4b79ce['remoteUri'];var _0x45b00a=_0x46cf28[_0xf275('0x5c')](-0x1);if(_0x45b00a==='/'){_0x46cf28=_0x46cf28[_0xf275('0x5d')](0x0,_0x46cf28[_0xf275('0x5e')](_0x45b00a));}var _0x56eade={'method':_0xf275('0x5f'),'uri':util['format'](_0xf275('0x60'),_0x46cf28),'headers':{'Content-Type':_0xf275('0x61'),'Accept':'application/json'},'json':!![]};if(_0x4b79ce[_0xf275('0x57')]===_0xf275('0x62')){_0x56eade[_0xf275('0x63')][_0xf275('0x64')]=util[_0xf275('0x65')]('Basic\x20%s',new Buffer(util[_0xf275('0x65')]('%s:%s',_0x4b79ce[_0xf275('0x58')],_0x4b79ce['password']))['toString'](_0xf275('0x66')));}return rp(_0x56eade)['then'](function(_0x3f7b34){return _0xb3a226[_0xf275('0x67')](_[_0xf275('0x29')](_0x3f7b34['_embedded'][_0xf275('0x68')],function(_0xe12048){return{'id':_0xe12048['name'],'name':_0xe12048[_0xf275('0x3b')],'type':_0xe12048[_0xf275('0x3a')],'active':_0xe12048[_0xf275('0x69')],'label':_0xe12048[_0xf275('0x6a')],'custom':!![]};}));});}})[_0xf275('0x23')](function(_0x3dd5da){return{'count':_0x3dd5da[_0xf275('0x35')],'rows':_0x3dd5da};})[_0xf275('0x23')](respondWithResult(_0x351a81,null))[_0xf275('0x41')](function(_0x5585cb){var _0x1819f9=_0x3577d0['query'][_0xf275('0x6b')]?0x1f4:_0x5585cb[_0xf275('0x6c')]||0x1f4;logger[_0xf275('0x26')](_0xf275('0x6d'),_0xf275('0x54'),_0x1819f9,JSON[_0xf275('0x6e')](_0x5585cb));delete _0x5585cb[_0xf275('0x3b')];if(_0x1819f9===0x191){_0x1819f9=0x190;}_0x351a81[_0xf275('0x18')](_0x1819f9)[_0xf275('0x27')](_0x3577d0[_0xf275('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5585cb['statusCode']}:_0x5585cb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index db86581..a31338d 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 _0x29a6=['path','rimraf','../../config/environment','./intDeskAccount.attributes','DeskAccount','int_desk_accounts','bluebird'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x29a6,0x172));var _0x629a=function(_0x55ffdf,_0x559e0d){_0x55ffdf=_0x55ffdf-0x0;var _0x15e6fe=_0x29a6[_0x55ffdf];return _0x15e6fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x629a('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x629a('0x1'));var rimraf=require(_0x629a('0x2'));var config=require(_0x629a('0x3'));var attributes=require(_0x629a('0x4'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x45fb92,_0x12825f){return _0x45fb92['define'](_0x629a('0x5'),attributes,{'tableName':_0x629a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2baa=['request-promise','path','rimraf','./intDeskAccount.attributes','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x2baa,0xfe));var _0xa2ba=function(_0x425b48,_0x47ff73){_0x425b48=_0x425b48-0x0;var _0x30ddb3=_0x2baa[_0x425b48];return _0x30ddb3;};'use strict';var _=require(_0xa2ba('0x0'));var util=require(_0xa2ba('0x1'));var logger=require(_0xa2ba('0x2'))(_0xa2ba('0x3'));var moment=require(_0xa2ba('0x4'));var BPromise=require(_0xa2ba('0x5'));var rp=require(_0xa2ba('0x6'));var fs=require('fs');var path=require(_0xa2ba('0x7'));var rimraf=require(_0xa2ba('0x8'));var config=require('../../config/environment');var attributes=require(_0xa2ba('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xa2ba('0xa')]=function(_0x2a9e4c,_0x51a1ec){return _0x2a9e4c['define'](_0xa2ba('0xb'),attributes,{'tableName':_0xa2ba('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 1ec51be..2a32bea 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 _0x60fa=['DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','options','raw','attributes','include','map','model','ShowDeskAccount','DeskAccount','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error'];(function(_0x56c513,_0x128123){var _0x198347=function(_0x39fbab){while(--_0x39fbab){_0x56c513['push'](_0x56c513['shift']());}};_0x198347(++_0x128123);}(_0x60fa,0x8b));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa60f('0x0'));var moment=require(_0xa60f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa60f('0x2'));var fs=require('fs');var Redis=require(_0xa60f('0x3'));var db=require(_0xa60f('0x4'))['db'];var utils=require(_0xa60f('0x5'));var logger=require(_0xa60f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa60f('0x7'));var client=jayson[_0xa60f('0x8')][_0xa60f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d8a2,_0x3fa3e4,_0x4051b6){return new BPromise(function(_0x5e3f67,_0x25704c){return client[_0xa60f('0xa')](_0x52d8a2,_0x4051b6)[_0xa60f('0xb')](function(_0x3adf55){logger['info']('DeskAccount,\x20%s,\x20%s',_0x3fa3e4,_0xa60f('0xc'));logger[_0xa60f('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3fa3e4,_0xa60f('0xc'),JSON[_0xa60f('0xe')](_0x3adf55));if(_0x3adf55[_0xa60f('0xf')]){if(_0x3adf55[_0xa60f('0xf')]['code']===0x1f4){logger[_0xa60f('0xf')](_0xa60f('0x10'),_0x3fa3e4,_0x3adf55[_0xa60f('0xf')][_0xa60f('0x11')]);return _0x25704c(_0x3adf55[_0xa60f('0xf')][_0xa60f('0x11')]);}logger['error'](_0xa60f('0x10'),_0x3fa3e4,_0x3adf55[_0xa60f('0xf')][_0xa60f('0x11')]);return _0x5e3f67(_0x3adf55[_0xa60f('0xf')]['message']);}else{logger[_0xa60f('0x12')](_0xa60f('0x10'),_0x3fa3e4,_0xa60f('0xc'));_0x5e3f67(_0x3adf55[_0xa60f('0x13')][_0xa60f('0x11')]);}})[_0xa60f('0x14')](function(_0x3165f6){logger[_0xa60f('0xf')](_0xa60f('0x10'),_0x3fa3e4,_0x3165f6);_0x25704c(_0x3165f6);});});}exports[_0xa60f('0x15')]=function(_0x51142d){var _0x5da459=this;return new Promise(function(_0x2a215d,_0x2c63a9){return db['DeskAccount']['findAll']({'raw':_0x51142d[_0xa60f('0x16')]?_0x51142d[_0xa60f('0x16')][_0xa60f('0x17')]===undefined?!![]:![]:!![],'where':_0x51142d[_0xa60f('0x16')]?_0x51142d[_0xa60f('0x16')]['where']||null:null,'attributes':_0x51142d[_0xa60f('0x16')]?_0x51142d['options'][_0xa60f('0x18')]||null:null,'limit':_0x51142d['options']?_0x51142d[_0xa60f('0x16')]['limit']||null:null,'include':_0x51142d[_0xa60f('0x16')]?_0x51142d[_0xa60f('0x16')][_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0x51142d[_0xa60f('0x16')]['include'],function(_0x593661){return{'model':db[_0x593661[_0xa60f('0x1b')]],'as':_0x593661['as'],'attributes':_0x593661[_0xa60f('0x18')],'include':_0x593661[_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0x593661[_0xa60f('0x19')],function(_0x90183f){return{'model':db[_0x90183f[_0xa60f('0x1b')]],'as':_0x90183f['as'],'attributes':_0x90183f['attributes'],'include':_0x90183f[_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0x90183f[_0xa60f('0x19')],function(_0x12b728){return{'model':db[_0x12b728['model']],'as':_0x12b728['as'],'attributes':_0x12b728[_0xa60f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x498db2){logger[_0xa60f('0x12')](_0xa60f('0x15'),_0x51142d);logger[_0xa60f('0xd')](_0xa60f('0x15'),_0x51142d,JSON[_0xa60f('0xe')](_0x498db2));_0x2a215d(_0x498db2);})[_0xa60f('0x14')](function(_0x3e1132){logger[_0xa60f('0xf')](_0xa60f('0x15'),_0x3e1132[_0xa60f('0x11')],_0x51142d);_0x2c63a9(_0x5da459[_0xa60f('0xf')](0x1f4,_0x3e1132[_0xa60f('0x11')]));});});};exports[_0xa60f('0x1c')]=function(_0x4718f2){var _0xc770cb=this;return new Promise(function(_0x1c7b47,_0x6f72ae){return db[_0xa60f('0x1d')]['find']({'raw':_0x4718f2[_0xa60f('0x16')]?_0x4718f2[_0xa60f('0x16')][_0xa60f('0x17')]===undefined?!![]:![]:!![],'where':_0x4718f2[_0xa60f('0x16')]?_0x4718f2[_0xa60f('0x16')][_0xa60f('0x1e')]||null:null,'attributes':_0x4718f2[_0xa60f('0x16')]?_0x4718f2[_0xa60f('0x16')][_0xa60f('0x18')]||null:null,'include':_0x4718f2[_0xa60f('0x16')]?_0x4718f2[_0xa60f('0x16')][_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0x4718f2[_0xa60f('0x16')][_0xa60f('0x19')],function(_0xc0b44f){return{'model':db[_0xc0b44f[_0xa60f('0x1b')]],'as':_0xc0b44f['as'],'attributes':_0xc0b44f[_0xa60f('0x18')],'include':_0xc0b44f[_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0xc0b44f[_0xa60f('0x19')],function(_0x448705){return{'model':db[_0x448705[_0xa60f('0x1b')]],'as':_0x448705['as'],'attributes':_0x448705['attributes'],'include':_0x448705[_0xa60f('0x19')]?_[_0xa60f('0x1a')](_0x448705['include'],function(_0x127446){return{'model':db[_0x127446[_0xa60f('0x1b')]],'as':_0x127446['as'],'attributes':_0x127446[_0xa60f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa60f('0xb')](function(_0x2a1630){logger['info'](_0xa60f('0x1c'),_0x4718f2);logger['debug'](_0xa60f('0x1c'),_0x4718f2,JSON['stringify'](_0x2a1630));_0x1c7b47(_0x2a1630);})['catch'](function(_0x34f7f1){logger[_0xa60f('0xf')](_0xa60f('0x1c'),_0x34f7f1[_0xa60f('0x11')],_0x4718f2);_0x6f72ae(_0xc770cb['error'](0x1f4,_0x34f7f1[_0xa60f('0x11')]));});});}; \ No newline at end of file +var _0xc72f=['result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','include','model','map','stringify','ShowDeskAccount','find','where','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','DeskAccount,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc72f,0xb3));var _0xfc72=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xc72f[_0x40a825];return _0x273a54;};'use strict';var _=require(_0xfc72('0x0'));var util=require(_0xfc72('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfc72('0x2'));var fs=require('fs');var Redis=require(_0xfc72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc72('0x4'));var logger=require(_0xfc72('0x5'))('rpc');var config=require(_0xfc72('0x6'));var jayson=require(_0xfc72('0x7'));var client=jayson[_0xfc72('0x8')][_0xfc72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37d5aa,_0x13e23c,_0x416098){return new BPromise(function(_0xc0a46f,_0x1acacd){return client[_0xfc72('0xa')](_0x37d5aa,_0x416098)[_0xfc72('0xb')](function(_0x37ac65){logger[_0xfc72('0xc')]('DeskAccount,\x20%s,\x20%s',_0x13e23c,'request\x20sent');logger[_0xfc72('0xd')](_0xfc72('0xe'),_0x13e23c,_0xfc72('0xf'),JSON['stringify'](_0x37ac65));if(_0x37ac65[_0xfc72('0x10')]){if(_0x37ac65[_0xfc72('0x10')]['code']===0x1f4){logger[_0xfc72('0x10')]('DeskAccount,\x20%s,\x20%s',_0x13e23c,_0x37ac65['error']['message']);return _0x1acacd(_0x37ac65[_0xfc72('0x10')][_0xfc72('0x11')]);}logger['error'](_0xfc72('0x12'),_0x13e23c,_0x37ac65['error'][_0xfc72('0x11')]);return _0xc0a46f(_0x37ac65[_0xfc72('0x10')][_0xfc72('0x11')]);}else{logger[_0xfc72('0xc')](_0xfc72('0x12'),_0x13e23c,_0xfc72('0xf'));_0xc0a46f(_0x37ac65[_0xfc72('0x13')]['message']);}})[_0xfc72('0x14')](function(_0x33350b){logger[_0xfc72('0x10')](_0xfc72('0x12'),_0x13e23c,_0x33350b);_0x1acacd(_0x33350b);});});}exports[_0xfc72('0x15')]=function(_0x5d37f1){var _0x1565fe=this;return new Promise(function(_0x279605,_0x1bbb8a){return db[_0xfc72('0x16')]['findAll']({'raw':_0x5d37f1[_0xfc72('0x17')]?_0x5d37f1['options'][_0xfc72('0x18')]===undefined?!![]:![]:!![],'where':_0x5d37f1[_0xfc72('0x17')]?_0x5d37f1['options']['where']||null:null,'attributes':_0x5d37f1[_0xfc72('0x17')]?_0x5d37f1[_0xfc72('0x17')][_0xfc72('0x19')]||null:null,'limit':_0x5d37f1[_0xfc72('0x17')]?_0x5d37f1[_0xfc72('0x17')]['limit']||null:null,'include':_0x5d37f1[_0xfc72('0x17')]?_0x5d37f1[_0xfc72('0x17')][_0xfc72('0x1a')]?_['map'](_0x5d37f1['options']['include'],function(_0x5d8aeb){return{'model':db[_0x5d8aeb[_0xfc72('0x1b')]],'as':_0x5d8aeb['as'],'attributes':_0x5d8aeb[_0xfc72('0x19')],'include':_0x5d8aeb['include']?_[_0xfc72('0x1c')](_0x5d8aeb[_0xfc72('0x1a')],function(_0x40d0e0){return{'model':db[_0x40d0e0['model']],'as':_0x40d0e0['as'],'attributes':_0x40d0e0['attributes'],'include':_0x40d0e0[_0xfc72('0x1a')]?_[_0xfc72('0x1c')](_0x40d0e0['include'],function(_0x26156b){return{'model':db[_0x26156b[_0xfc72('0x1b')]],'as':_0x26156b['as'],'attributes':_0x26156b[_0xfc72('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc72('0xb')](function(_0x400d71){logger[_0xfc72('0xc')](_0xfc72('0x15'),_0x5d37f1);logger[_0xfc72('0xd')](_0xfc72('0x15'),_0x5d37f1,JSON[_0xfc72('0x1d')](_0x400d71));_0x279605(_0x400d71);})[_0xfc72('0x14')](function(_0x396f0d){logger[_0xfc72('0x10')](_0xfc72('0x15'),_0x396f0d[_0xfc72('0x11')],_0x5d37f1);_0x1bbb8a(_0x1565fe[_0xfc72('0x10')](0x1f4,_0x396f0d[_0xfc72('0x11')]));});});};exports[_0xfc72('0x1e')]=function(_0x4371c4){var _0xe8c996=this;return new Promise(function(_0x5b9288,_0x4cee2e){return db[_0xfc72('0x16')][_0xfc72('0x1f')]({'raw':_0x4371c4['options']?_0x4371c4[_0xfc72('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4371c4[_0xfc72('0x17')]?_0x4371c4[_0xfc72('0x17')][_0xfc72('0x20')]||null:null,'attributes':_0x4371c4[_0xfc72('0x17')]?_0x4371c4[_0xfc72('0x17')][_0xfc72('0x19')]||null:null,'include':_0x4371c4[_0xfc72('0x17')]?_0x4371c4[_0xfc72('0x17')]['include']?_[_0xfc72('0x1c')](_0x4371c4['options'][_0xfc72('0x1a')],function(_0x309fba){return{'model':db[_0x309fba[_0xfc72('0x1b')]],'as':_0x309fba['as'],'attributes':_0x309fba[_0xfc72('0x19')],'include':_0x309fba['include']?_['map'](_0x309fba[_0xfc72('0x1a')],function(_0x52924e){return{'model':db[_0x52924e['model']],'as':_0x52924e['as'],'attributes':_0x52924e[_0xfc72('0x19')],'include':_0x52924e['include']?_[_0xfc72('0x1c')](_0x52924e[_0xfc72('0x1a')],function(_0x282bcd){return{'model':db[_0x282bcd['model']],'as':_0x282bcd['as'],'attributes':_0x282bcd['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc72('0xb')](function(_0xabc77b){logger[_0xfc72('0xc')](_0xfc72('0x1e'),_0x4371c4);logger[_0xfc72('0xd')]('ShowDeskAccount',_0x4371c4,JSON[_0xfc72('0x1d')](_0xabc77b));_0x5b9288(_0xabc77b);})[_0xfc72('0x14')](function(_0x1c2ba9){logger['error'](_0xfc72('0x1e'),_0x1c2ba9[_0xfc72('0x11')],_0x4371c4);_0x4cee2e(_0xe8c996[_0xfc72('0x10')](0x1f4,_0x1c2ba9[_0xfc72('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 8145fb1..44de926 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x137d03,_0x2e0e1a){var _0x2e820a=function(_0x4c05c5){while(--_0x4c05c5){_0x137d03['push'](_0x137d03['shift']());}};_0x2e820a(++_0x2e0e1a);}(_0x34e8,0x12c));var _0x834e=function(_0x5303cc,_0x2fc5b2){_0x5303cc=_0x5303cc-0x0;var _0x3cf0ca=_0x34e8[_0x5303cc];return _0x3cf0ca;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0x55ca,0x126));var _0xa55c=function(_0xf3f1ed,_0x57e63e){_0xf3f1ed=_0xf3f1ed-0x0;var _0x3f5837=_0x55ca[_0xf3f1ed];return _0x3f5837;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ad7c67f..e9d2c48 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 _0x2e57=['sequelize','exports','STRING'];(function(_0x15927a,_0x3018c3){var _0x5e4033=function(_0xfaceca){while(--_0xfaceca){_0x15927a['push'](_0x15927a['shift']());}};_0x5e4033(++_0x3018c3);}(_0x2e57,0xfc));var _0x72e5=function(_0x250b28,_0x515f28){_0x250b28=_0x250b28-0x0;var _0x2bac8e=_0x2e57[_0x250b28];return _0x2bac8e;};'use strict';var Sequelize=require(_0x72e5('0x0'));module[_0x72e5('0x1')]={'name':{'type':Sequelize[_0x72e5('0x2')]},'description':{'type':Sequelize[_0x72e5('0x2')]}}; \ No newline at end of file +var _0x43de=['STRING','sequelize'];(function(_0x19d5fc,_0x3dcc08){var _0x1607b8=function(_0x77bf6a){while(--_0x77bf6a){_0x19d5fc['push'](_0x19d5fc['shift']());}};_0x1607b8(++_0x3dcc08);}(_0x43de,0x185));var _0xe43d=function(_0x59a578,_0x300511){_0x59a578=_0x59a578-0x0;var _0x1475e8=_0x43de[_0x59a578];return _0x1475e8;};'use strict';var Sequelize=require(_0xe43d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe43d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3acaf12..33a1f6e 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 _0xb6ec=['ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','findAll','catch','show','params','includeAll','include','create','body','find','destroy','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags'];(function(_0x39918d,_0x327024){var _0x2168f4=function(_0x377e18){while(--_0x377e18){_0x39918d['push'](_0x39918d['shift']());}};_0x2168f4(++_0x327024);}(_0xb6ec,0x141));var _0xcb6e=function(_0x27a9f6,_0x26f796){_0x27a9f6=_0x27a9f6-0x0;var _0xa97a07=_0xb6ec[_0x27a9f6];return _0xa97a07;};'use strict';var emlformat=require(_0xcb6e('0x0'));var rimraf=require(_0xcb6e('0x1'));var zipdir=require(_0xcb6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb6e('0x3'));var moment=require(_0xcb6e('0x4'));var BPromise=require(_0xcb6e('0x5'));var Mustache=require(_0xcb6e('0x6'));var util=require(_0xcb6e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcb6e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb6e('0x9'));var _=require('lodash');var squel=require(_0xcb6e('0xa'));var crypto=require(_0xcb6e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcb6e('0xc'));var toCsv=require(_0xcb6e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcb6e('0xd'));var authService=require(_0xcb6e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb6e('0xf'))(_0xcb6e('0x10'));var utils=require(_0xcb6e('0x11'));var config=require(_0xcb6e('0x12'));var licenseUtil=require(_0xcb6e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34c6e2,_0x262720){_0x262720=_0x262720||0xcc;return function(_0x5b3a3e){if(_0x5b3a3e){return _0x34c6e2[_0xcb6e('0x14')](_0x262720);}return _0x34c6e2[_0xcb6e('0x15')](_0x262720)['end']();};}function respondWithResult(_0x585d7f,_0x5a1a2d){_0x5a1a2d=_0x5a1a2d||0xc8;return function(_0x28f4d8){if(_0x28f4d8){return _0x585d7f['status'](_0x5a1a2d)['json'](_0x28f4d8);}};}function respondWithFilteredResult(_0x5bad08,_0x3c9b4b){return function(_0x33ad9e){if(_0x33ad9e){var _0x2cb4fd=typeof _0x3c9b4b['offset']===_0xcb6e('0x16')&&typeof _0x3c9b4b[_0xcb6e('0x17')]===_0xcb6e('0x16');var _0x351951=_0x33ad9e[_0xcb6e('0x18')];var _0x35ab2b=_0x2cb4fd?0x0:_0x3c9b4b['offset'];var _0x9cd117=_0x2cb4fd?_0x33ad9e['count']:_0x3c9b4b[_0xcb6e('0x19')]+_0x3c9b4b[_0xcb6e('0x17')];var _0x3028c1;if(_0x9cd117>=_0x351951){_0x9cd117=_0x351951;_0x3028c1=0xc8;}else{_0x3028c1=0xce;}_0x5bad08[_0xcb6e('0x15')](_0x3028c1);return _0x5bad08['set'](_0xcb6e('0x1a'),_0x35ab2b+'-'+_0x9cd117+'/'+_0x351951)['json'](_0x33ad9e);}return null;};}function patchUpdates(_0x7339b5){return function(_0x388664){try{jsonpatch[_0xcb6e('0x1b')](_0x388664,_0x7339b5,!![]);}catch(_0x62529){return BPromise[_0xcb6e('0x1c')](_0x62529);}return _0x388664[_0xcb6e('0x1d')]();};}function saveUpdates(_0x356cf4,_0x43498e){return function(_0x518176){if(_0x518176){return _0x518176[_0xcb6e('0x1e')](_0x356cf4)[_0xcb6e('0x1f')](function(_0x3c9efd){return _0x3c9efd;});}return null;};}function removeEntity(_0x3cf465,_0x290d3b){return function(_0x17323b){if(_0x17323b){return _0x17323b['destroy']()[_0xcb6e('0x1f')](function(){_0x3cf465[_0xcb6e('0x15')](0xcc)[_0xcb6e('0x20')]();});}};}function handleEntityNotFound(_0x19f650,_0x2245f8){return function(_0x2287b6){if(!_0x2287b6){_0x19f650['sendStatus'](0x194);}return _0x2287b6;};}function handleError(_0x2de2d7,_0x434f21){_0x434f21=_0x434f21||0x1f4;return function(_0x531290){logger[_0xcb6e('0x21')](_0x531290[_0xcb6e('0x22')]);if(_0x531290[_0xcb6e('0x23')]){delete _0x531290[_0xcb6e('0x23')];}_0x2de2d7[_0xcb6e('0x15')](_0x434f21)[_0xcb6e('0x24')](_0x531290);};}exports['index']=function(_0x38e0b8,_0x20c67a){var _0x28187c={},_0x2648d5={},_0x390c74={'count':0x0,'rows':[]};var _0xbf3dbb=_[_0xcb6e('0x25')](db[_0xcb6e('0x26')][_0xcb6e('0x27')],function(_0x1df6a3){return{'name':_0x1df6a3[_0xcb6e('0x28')],'type':_0x1df6a3[_0xcb6e('0x29')][_0xcb6e('0x2a')]};});_0x2648d5[_0xcb6e('0x2b')]=_[_0xcb6e('0x25')](_0xbf3dbb,_0xcb6e('0x23'));_0x2648d5[_0xcb6e('0x2c')]=_[_0xcb6e('0x2d')](_0x38e0b8['query']);_0x2648d5['filters']=_[_0xcb6e('0x2e')](_0x2648d5[_0xcb6e('0x2b')],_0x2648d5[_0xcb6e('0x2c')]);_0x28187c[_0xcb6e('0x2f')]=_[_0xcb6e('0x2e')](_0x2648d5[_0xcb6e('0x2b')],qs['fields'](_0x38e0b8[_0xcb6e('0x2c')][_0xcb6e('0x30')]));_0x28187c['attributes']=_0x28187c[_0xcb6e('0x2f')][_0xcb6e('0x31')]?_0x28187c[_0xcb6e('0x2f')]:_0x2648d5[_0xcb6e('0x2b')];if(!_0x38e0b8[_0xcb6e('0x2c')][_0xcb6e('0x32')](_0xcb6e('0x33'))){_0x28187c['limit']=qs[_0xcb6e('0x17')](_0x38e0b8[_0xcb6e('0x2c')][_0xcb6e('0x17')]);_0x28187c[_0xcb6e('0x19')]=qs[_0xcb6e('0x19')](_0x38e0b8[_0xcb6e('0x2c')][_0xcb6e('0x19')]);}_0x28187c['order']=qs[_0xcb6e('0x34')](_0x38e0b8['query']['sort']);_0x28187c[_0xcb6e('0x35')]=qs[_0xcb6e('0x36')](_[_0xcb6e('0x37')](_0x38e0b8['query'],_0x2648d5[_0xcb6e('0x36')]),_0xbf3dbb);if(_0x38e0b8['query']['filter']){_0x28187c[_0xcb6e('0x35')]=_['merge'](_0x28187c[_0xcb6e('0x35')],{'$or':_[_0xcb6e('0x25')](_0xbf3dbb,function(_0x33e791){if(_0x33e791[_0xcb6e('0x29')]!==_0xcb6e('0x38')){var _0x3a8aa2={};_0x3a8aa2[_0x33e791['name']]={'$like':'%'+_0x38e0b8['query'][_0xcb6e('0x39')]+'%'};return _0x3a8aa2;}})});}_0x28187c=_[_0xcb6e('0x3a')]({},_0x28187c,_0x38e0b8[_0xcb6e('0x3b')]);var _0x12f9fd={'where':_0x28187c[_0xcb6e('0x35')]};return db[_0xcb6e('0x26')][_0xcb6e('0x18')](_0x12f9fd)['then'](function(_0x60777c){_0x390c74[_0xcb6e('0x18')]=_0x60777c;if(_0x38e0b8[_0xcb6e('0x2c')]['includeAll']){_0x28187c['include']=[{'all':!![]}];}return db[_0xcb6e('0x26')][_0xcb6e('0x3c')](_0x28187c);})[_0xcb6e('0x1f')](function(_0x448fae){_0x390c74['rows']=_0x448fae;return _0x390c74;})[_0xcb6e('0x1f')](respondWithFilteredResult(_0x20c67a,_0x28187c))[_0xcb6e('0x3d')](handleError(_0x20c67a,null));};exports[_0xcb6e('0x3e')]=function(_0x25eaee,_0x26ab6b){var _0x4fd00f={'raw':![],'where':{'id':_0x25eaee[_0xcb6e('0x3f')]['id']}},_0x420469={};_0x420469['model']=_[_0xcb6e('0x2d')](db['DeskConfiguration'][_0xcb6e('0x27')]);_0x420469[_0xcb6e('0x2c')]=_[_0xcb6e('0x2d')](_0x25eaee[_0xcb6e('0x2c')]);_0x420469[_0xcb6e('0x36')]=_[_0xcb6e('0x2e')](_0x420469[_0xcb6e('0x2b')],_0x420469[_0xcb6e('0x2c')]);_0x4fd00f[_0xcb6e('0x2f')]=_[_0xcb6e('0x2e')](_0x420469[_0xcb6e('0x2b')],qs[_0xcb6e('0x30')](_0x25eaee[_0xcb6e('0x2c')][_0xcb6e('0x30')]));_0x4fd00f[_0xcb6e('0x2f')]=_0x4fd00f[_0xcb6e('0x2f')][_0xcb6e('0x31')]?_0x4fd00f[_0xcb6e('0x2f')]:_0x420469[_0xcb6e('0x2b')];if(_0x25eaee[_0xcb6e('0x2c')][_0xcb6e('0x40')]){_0x4fd00f[_0xcb6e('0x41')]=[{'all':!![]}];}_0x4fd00f=_[_0xcb6e('0x3a')]({},_0x4fd00f,_0x25eaee[_0xcb6e('0x3b')]);return db['DeskConfiguration']['find'](_0x4fd00f)[_0xcb6e('0x1f')](handleEntityNotFound(_0x26ab6b,null))['then'](respondWithResult(_0x26ab6b,null))[_0xcb6e('0x3d')](handleError(_0x26ab6b,null));};exports[_0xcb6e('0x42')]=function(_0x70e668,_0x34ef4a){return db[_0xcb6e('0x26')][_0xcb6e('0x42')](_0x70e668[_0xcb6e('0x43')],{})['then'](respondWithResult(_0x34ef4a,0xc9))[_0xcb6e('0x3d')](handleError(_0x34ef4a,null));};exports['update']=function(_0x2b43bf,_0x14f0ad){if(_0x2b43bf[_0xcb6e('0x43')]['id']){delete _0x2b43bf[_0xcb6e('0x43')]['id'];}return db[_0xcb6e('0x26')][_0xcb6e('0x44')]({'where':{'id':_0x2b43bf[_0xcb6e('0x3f')]['id']}})[_0xcb6e('0x1f')](handleEntityNotFound(_0x14f0ad,null))[_0xcb6e('0x1f')](saveUpdates(_0x2b43bf['body'],null))[_0xcb6e('0x1f')](respondWithResult(_0x14f0ad,null))['catch'](handleError(_0x14f0ad,null));};exports[_0xcb6e('0x45')]=function(_0x2044e3,_0x2a976d){return db['DeskConfiguration'][_0xcb6e('0x44')]({'where':{'id':_0x2044e3['params']['id']}})[_0xcb6e('0x1f')](handleEntityNotFound(_0x2a976d,null))[_0xcb6e('0x1f')](removeEntity(_0x2a976d,null))[_0xcb6e('0x3d')](handleError(_0x2a976d,null));};exports[_0xcb6e('0x46')]=function(_0x30336b,_0x5a07b6,_0x56468e){var _0x503dd6={};var _0x2d8e8c={};var _0x4aadcc;var _0x3adcd8;return db[_0xcb6e('0x26')][_0xcb6e('0x47')]({'where':{'id':_0x30336b['params']['id']}})['then'](handleEntityNotFound(_0x5a07b6,null))[_0xcb6e('0x1f')](function(_0x58058e){if(_0x58058e){_0x4aadcc=_0x58058e;_0x2d8e8c['model']=_[_0xcb6e('0x2d')](db[_0xcb6e('0x48')]['rawAttributes']);_0x2d8e8c['query']=_['keys'](_0x30336b['query']);_0x2d8e8c[_0xcb6e('0x36')]=_[_0xcb6e('0x2e')](_0x2d8e8c[_0xcb6e('0x2b')],_0x2d8e8c[_0xcb6e('0x2c')]);_0x503dd6['attributes']=_[_0xcb6e('0x2e')](_0x2d8e8c[_0xcb6e('0x2b')],qs[_0xcb6e('0x30')](_0x30336b[_0xcb6e('0x2c')][_0xcb6e('0x30')]));_0x503dd6[_0xcb6e('0x2f')]=_0x503dd6[_0xcb6e('0x2f')][_0xcb6e('0x31')]?_0x503dd6[_0xcb6e('0x2f')]:_0x2d8e8c['model'];_0x503dd6[_0xcb6e('0x49')]=qs[_0xcb6e('0x34')](_0x30336b['query'][_0xcb6e('0x34')]);_0x503dd6['where']=qs[_0xcb6e('0x36')](_[_0xcb6e('0x37')](_0x30336b[_0xcb6e('0x2c')],_0x2d8e8c[_0xcb6e('0x36')]));if(_0x30336b[_0xcb6e('0x2c')][_0xcb6e('0x39')]){_0x503dd6['where']=_[_0xcb6e('0x3a')](_0x503dd6[_0xcb6e('0x35')],{'$or':_[_0xcb6e('0x25')](_0x503dd6[_0xcb6e('0x2f')],function(_0x37c957){var _0x40b71c={};_0x40b71c[_0x37c957]={'$like':'%'+_0x30336b[_0xcb6e('0x2c')]['filter']+'%'};return _0x40b71c;})});}_0x503dd6=_[_0xcb6e('0x3a')]({},_0x503dd6,_0x30336b[_0xcb6e('0x3b')]);return _0x4aadcc[_0xcb6e('0x46')](_0x503dd6);}})[_0xcb6e('0x1f')](function(_0x39002f){if(_0x39002f){_0x3adcd8=_0x39002f[_0xcb6e('0x31')];if(!_0x30336b[_0xcb6e('0x2c')][_0xcb6e('0x32')]('nolimit')){_0x503dd6[_0xcb6e('0x17')]=qs[_0xcb6e('0x17')](_0x30336b[_0xcb6e('0x2c')][_0xcb6e('0x17')]);_0x503dd6[_0xcb6e('0x19')]=qs['offset'](_0x30336b['query'][_0xcb6e('0x19')]);}return _0x4aadcc[_0xcb6e('0x46')](_0x503dd6);}})['then'](function(_0x1bd67b){if(_0x1bd67b){return _0x1bd67b?{'count':_0x3adcd8,'rows':_0x1bd67b}:null;}})[_0xcb6e('0x1f')](respondWithResult(_0x5a07b6,null))[_0xcb6e('0x3d')](handleError(_0x5a07b6,null));};exports[_0xcb6e('0x4a')]=function(_0xdfbe5c,_0x3732b0,_0x4fffd1){var _0x1dbf5a={};var _0x2197eb={};var _0x2e9565;var _0x123159;return db[_0xcb6e('0x26')][_0xcb6e('0x47')]({'where':{'id':_0xdfbe5c[_0xcb6e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3732b0,null))[_0xcb6e('0x1f')](function(_0x4ed0db){if(_0x4ed0db){_0x2e9565=_0x4ed0db;_0x2197eb[_0xcb6e('0x2b')]=_[_0xcb6e('0x2d')](db[_0xcb6e('0x48')][_0xcb6e('0x27')]);_0x2197eb['query']=_[_0xcb6e('0x2d')](_0xdfbe5c['query']);_0x2197eb[_0xcb6e('0x36')]=_[_0xcb6e('0x2e')](_0x2197eb[_0xcb6e('0x2b')],_0x2197eb['query']);_0x1dbf5a[_0xcb6e('0x2f')]=_[_0xcb6e('0x2e')](_0x2197eb[_0xcb6e('0x2b')],qs['fields'](_0xdfbe5c['query'][_0xcb6e('0x30')]));_0x1dbf5a[_0xcb6e('0x2f')]=_0x1dbf5a[_0xcb6e('0x2f')][_0xcb6e('0x31')]?_0x1dbf5a[_0xcb6e('0x2f')]:_0x2197eb[_0xcb6e('0x2b')];_0x1dbf5a['order']=qs['sort'](_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x34')]);_0x1dbf5a[_0xcb6e('0x35')]=qs[_0xcb6e('0x36')](_[_0xcb6e('0x37')](_0xdfbe5c[_0xcb6e('0x2c')],_0x2197eb[_0xcb6e('0x36')]));if(_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x39')]){_0x1dbf5a[_0xcb6e('0x35')]=_[_0xcb6e('0x3a')](_0x1dbf5a[_0xcb6e('0x35')],{'$or':_[_0xcb6e('0x25')](_0x1dbf5a['attributes'],function(_0x15967f){var _0x464651={};_0x464651[_0x15967f]={'$like':'%'+_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x39')]+'%'};return _0x464651;})});}_0x1dbf5a=_[_0xcb6e('0x3a')]({},_0x1dbf5a,_0xdfbe5c[_0xcb6e('0x3b')]);return _0x2e9565[_0xcb6e('0x4a')](_0x1dbf5a);}})[_0xcb6e('0x1f')](function(_0x451c24){if(_0x451c24){_0x123159=_0x451c24[_0xcb6e('0x31')];if(!_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x32')]('nolimit')){_0x1dbf5a['limit']=qs[_0xcb6e('0x17')](_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x17')]);_0x1dbf5a['offset']=qs[_0xcb6e('0x19')](_0xdfbe5c[_0xcb6e('0x2c')][_0xcb6e('0x19')]);}return _0x2e9565[_0xcb6e('0x4a')](_0x1dbf5a);}})[_0xcb6e('0x1f')](function(_0x4143f5){if(_0x4143f5){return _0x4143f5?{'count':_0x123159,'rows':_0x4143f5}:null;}})[_0xcb6e('0x1f')](respondWithResult(_0x3732b0,null))['catch'](handleError(_0x3732b0,null));};exports['getDescriptions']=function(_0x19990c,_0x576c59,_0x19945f){var _0x1fb979={};var _0x150d32={};var _0x2bfb20;var _0x1d1859;return db[_0xcb6e('0x26')][_0xcb6e('0x47')]({'where':{'id':_0x19990c[_0xcb6e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x576c59,null))[_0xcb6e('0x1f')](function(_0x1cb491){if(_0x1cb491){_0x2bfb20=_0x1cb491;_0x150d32[_0xcb6e('0x2b')]=_[_0xcb6e('0x2d')](db[_0xcb6e('0x48')][_0xcb6e('0x27')]);_0x150d32[_0xcb6e('0x2c')]=_[_0xcb6e('0x2d')](_0x19990c[_0xcb6e('0x2c')]);_0x150d32['filters']=_['intersection'](_0x150d32['model'],_0x150d32[_0xcb6e('0x2c')]);_0x1fb979['attributes']=_[_0xcb6e('0x2e')](_0x150d32[_0xcb6e('0x2b')],qs['fields'](_0x19990c[_0xcb6e('0x2c')][_0xcb6e('0x30')]));_0x1fb979[_0xcb6e('0x2f')]=_0x1fb979['attributes'][_0xcb6e('0x31')]?_0x1fb979[_0xcb6e('0x2f')]:_0x150d32[_0xcb6e('0x2b')];_0x1fb979[_0xcb6e('0x49')]=qs[_0xcb6e('0x34')](_0x19990c['query'][_0xcb6e('0x34')]);_0x1fb979['where']=qs[_0xcb6e('0x36')](_[_0xcb6e('0x37')](_0x19990c['query'],_0x150d32[_0xcb6e('0x36')]));if(_0x19990c[_0xcb6e('0x2c')][_0xcb6e('0x39')]){_0x1fb979[_0xcb6e('0x35')]=_['merge'](_0x1fb979[_0xcb6e('0x35')],{'$or':_[_0xcb6e('0x25')](_0x1fb979[_0xcb6e('0x2f')],function(_0x107d48){var _0x1ad033={};_0x1ad033[_0x107d48]={'$like':'%'+_0x19990c[_0xcb6e('0x2c')][_0xcb6e('0x39')]+'%'};return _0x1ad033;})});}_0x1fb979=_[_0xcb6e('0x3a')]({},_0x1fb979,_0x19990c[_0xcb6e('0x3b')]);return _0x2bfb20['getDescriptions'](_0x1fb979);}})['then'](function(_0x484d92){if(_0x484d92){_0x1d1859=_0x484d92[_0xcb6e('0x31')];if(!_0x19990c[_0xcb6e('0x2c')]['hasOwnProperty']('nolimit')){_0x1fb979[_0xcb6e('0x17')]=qs['limit'](_0x19990c['query']['limit']);_0x1fb979['offset']=qs[_0xcb6e('0x19')](_0x19990c['query'][_0xcb6e('0x19')]);}return _0x2bfb20[_0xcb6e('0x4b')](_0x1fb979);}})[_0xcb6e('0x1f')](function(_0x7e42f0){if(_0x7e42f0){return _0x7e42f0?{'count':_0x1d1859,'rows':_0x7e42f0}:null;}})[_0xcb6e('0x1f')](respondWithResult(_0x576c59,null))[_0xcb6e('0x3d')](handleError(_0x576c59,null));};exports[_0xcb6e('0x4c')]=function(_0x5c425b,_0x48c68e,_0x51d319){var _0x5cfcd5={};var _0x43ad17={};var _0x33bb85;var _0x57ec33;return db['DeskConfiguration'][_0xcb6e('0x47')]({'where':{'id':_0x5c425b['params']['id']}})[_0xcb6e('0x1f')](handleEntityNotFound(_0x48c68e,null))[_0xcb6e('0x1f')](function(_0x1d27dd){if(_0x1d27dd){_0x33bb85=_0x1d27dd;_0x43ad17[_0xcb6e('0x2b')]=_[_0xcb6e('0x2d')](db[_0xcb6e('0x4d')][_0xcb6e('0x27')]);_0x43ad17[_0xcb6e('0x2c')]=_[_0xcb6e('0x2d')](_0x5c425b[_0xcb6e('0x2c')]);_0x43ad17[_0xcb6e('0x36')]=_[_0xcb6e('0x2e')](_0x43ad17[_0xcb6e('0x2b')],_0x43ad17[_0xcb6e('0x2c')]);_0x5cfcd5['attributes']=_['intersection'](_0x43ad17[_0xcb6e('0x2b')],qs[_0xcb6e('0x30')](_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x30')]));_0x5cfcd5[_0xcb6e('0x2f')]=_0x5cfcd5[_0xcb6e('0x2f')][_0xcb6e('0x31')]?_0x5cfcd5[_0xcb6e('0x2f')]:_0x43ad17[_0xcb6e('0x2b')];_0x5cfcd5[_0xcb6e('0x49')]=qs[_0xcb6e('0x34')](_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x34')]);_0x5cfcd5['where']=qs[_0xcb6e('0x36')](_[_0xcb6e('0x37')](_0x5c425b[_0xcb6e('0x2c')],_0x43ad17[_0xcb6e('0x36')]));if(_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x39')]){_0x5cfcd5[_0xcb6e('0x35')]=_[_0xcb6e('0x3a')](_0x5cfcd5['where'],{'$or':_[_0xcb6e('0x25')](_0x5cfcd5[_0xcb6e('0x2f')],function(_0x3c979f){var _0x5c916f={};_0x5c916f[_0x3c979f]={'$like':'%'+_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x39')]+'%'};return _0x5c916f;})});}_0x5cfcd5=_[_0xcb6e('0x3a')]({},_0x5cfcd5,_0x5c425b[_0xcb6e('0x3b')]);return _0x33bb85[_0xcb6e('0x4c')](_0x5cfcd5);}})[_0xcb6e('0x1f')](function(_0x15a79b){if(_0x15a79b){_0x57ec33=_0x15a79b[_0xcb6e('0x31')];if(!_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x32')](_0xcb6e('0x33'))){_0x5cfcd5['limit']=qs[_0xcb6e('0x17')](_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x17')]);_0x5cfcd5[_0xcb6e('0x19')]=qs[_0xcb6e('0x19')](_0x5c425b[_0xcb6e('0x2c')][_0xcb6e('0x19')]);}return _0x33bb85['getTags'](_0x5cfcd5);}})['then'](function(_0xbb24e3){if(_0xbb24e3){return _0xbb24e3?{'count':_0x57ec33,'rows':_0xbb24e3}:null;}})[_0xcb6e('0x1f')](respondWithResult(_0x48c68e,null))['catch'](handleError(_0x48c68e,null));};exports[_0xcb6e('0x4e')]=function(_0x3a6462,_0x51e4d0,_0x50b9fe){if(_0x3a6462[_0xcb6e('0x43')]['id']){delete _0x3a6462['body']['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x3a6462[_0xcb6e('0x3f')]['id']}})[_0xcb6e('0x1f')](handleEntityNotFound(_0x51e4d0,null))[_0xcb6e('0x1f')](function(_0x168c18){if(_0x168c18){return _0x168c18['setTags'](_0x3a6462[_0xcb6e('0x43')][_0xcb6e('0x4f')]||[]);}return null;})[_0xcb6e('0x1f')](respondWithResult(_0x51e4d0,null))[_0xcb6e('0x3d')](handleError(_0x51e4d0,null));}; \ No newline at end of file +var _0x794b=['sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','then','params','length','include','find','catch','create','body','update','getFields','findOne','DeskField','order','pick','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x794b,0xdd));var _0xb794=function(_0xdd2791,_0x386118){_0xdd2791=_0xdd2791-0x0;var _0x3d7170=_0x794b[_0xdd2791];return _0x3d7170;};'use strict';var emlformat=require(_0xb794('0x0'));var rimraf=require(_0xb794('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb794('0x2'));var rp=require('request-promise');var moment=require(_0xb794('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb794('0x4'));var util=require('util');var path=require(_0xb794('0x5'));var sox=require(_0xb794('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb794('0x7'));var squel=require(_0xb794('0x8'));var crypto=require(_0xb794('0x9'));var jsforce=require(_0xb794('0xa'));var deskjs=require(_0xb794('0xb'));var toCsv=require(_0xb794('0xc'));var querystring=require(_0xb794('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb794('0xe'));var qs=require(_0xb794('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb794('0x10'));var logger=require(_0xb794('0x11'))(_0xb794('0x12'));var utils=require(_0xb794('0x13'));var config=require(_0xb794('0x14'));var licenseUtil=require(_0xb794('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e37c8,_0x320c30){_0x320c30=_0x320c30||0xcc;return function(_0x3a59fc){if(_0x3a59fc){return _0x2e37c8[_0xb794('0x16')](_0x320c30);}return _0x2e37c8[_0xb794('0x17')](_0x320c30)['end']();};}function respondWithResult(_0x250195,_0x15cc3c){_0x15cc3c=_0x15cc3c||0xc8;return function(_0x8eda84){if(_0x8eda84){return _0x250195[_0xb794('0x17')](_0x15cc3c)[_0xb794('0x18')](_0x8eda84);}};}function respondWithFilteredResult(_0x1ed9a7,_0x410800){return function(_0x4ec2a1){if(_0x4ec2a1){var _0x55db5a=typeof _0x410800[_0xb794('0x19')]===_0xb794('0x1a')&&typeof _0x410800['limit']===_0xb794('0x1a');var _0x3d18a8=_0x4ec2a1[_0xb794('0x1b')];var _0x541a03=_0x55db5a?0x0:_0x410800[_0xb794('0x19')];var _0x222ec2=_0x55db5a?_0x4ec2a1[_0xb794('0x1b')]:_0x410800[_0xb794('0x19')]+_0x410800[_0xb794('0x1c')];var _0x327ce5;if(_0x222ec2>=_0x3d18a8){_0x222ec2=_0x3d18a8;_0x327ce5=0xc8;}else{_0x327ce5=0xce;}_0x1ed9a7[_0xb794('0x17')](_0x327ce5);return _0x1ed9a7[_0xb794('0x1d')](_0xb794('0x1e'),_0x541a03+'-'+_0x222ec2+'/'+_0x3d18a8)[_0xb794('0x18')](_0x4ec2a1);}return null;};}function patchUpdates(_0x22023d){return function(_0xcce361){try{jsonpatch[_0xb794('0x1f')](_0xcce361,_0x22023d,!![]);}catch(_0x3e9d4b){return BPromise[_0xb794('0x20')](_0x3e9d4b);}return _0xcce361[_0xb794('0x21')]();};}function saveUpdates(_0x54e5b2,_0x2cc440){return function(_0x5becba){if(_0x5becba){return _0x5becba['update'](_0x54e5b2)['then'](function(_0x59e7e9){return _0x59e7e9;});}return null;};}function removeEntity(_0x428773,_0x3b8257){return function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb[_0xb794('0x22')]()['then'](function(){_0x428773[_0xb794('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15847a,_0x33af56){return function(_0x548eda){if(!_0x548eda){_0x15847a[_0xb794('0x16')](0x194);}return _0x548eda;};}function handleError(_0x2a3c2a,_0x17c9ac){_0x17c9ac=_0x17c9ac||0x1f4;return function(_0x2ab624){logger[_0xb794('0x23')](_0x2ab624[_0xb794('0x24')]);if(_0x2ab624[_0xb794('0x25')]){delete _0x2ab624[_0xb794('0x25')];}_0x2a3c2a[_0xb794('0x17')](_0x17c9ac)[_0xb794('0x26')](_0x2ab624);};}exports[_0xb794('0x27')]=function(_0x5db7f2,_0x26af3b){var _0x5e2908={},_0x3545e5={},_0x175ce2={'count':0x0,'rows':[]};var _0x180a26=_['map'](db[_0xb794('0x28')][_0xb794('0x29')],function(_0x72aa5b){return{'name':_0x72aa5b[_0xb794('0x2a')],'type':_0x72aa5b[_0xb794('0x2b')][_0xb794('0x2c')]};});_0x3545e5[_0xb794('0x2d')]=_[_0xb794('0x2e')](_0x180a26,'name');_0x3545e5[_0xb794('0x2f')]=_[_0xb794('0x30')](_0x5db7f2[_0xb794('0x2f')]);_0x3545e5[_0xb794('0x31')]=_[_0xb794('0x32')](_0x3545e5['model'],_0x3545e5[_0xb794('0x2f')]);_0x5e2908[_0xb794('0x33')]=_[_0xb794('0x32')](_0x3545e5['model'],qs['fields'](_0x5db7f2[_0xb794('0x2f')][_0xb794('0x34')]));_0x5e2908[_0xb794('0x33')]=_0x5e2908[_0xb794('0x33')]['length']?_0x5e2908[_0xb794('0x33')]:_0x3545e5[_0xb794('0x2d')];if(!_0x5db7f2[_0xb794('0x2f')][_0xb794('0x35')](_0xb794('0x36'))){_0x5e2908[_0xb794('0x1c')]=qs[_0xb794('0x1c')](_0x5db7f2['query'][_0xb794('0x1c')]);_0x5e2908[_0xb794('0x19')]=qs[_0xb794('0x19')](_0x5db7f2[_0xb794('0x2f')][_0xb794('0x19')]);}_0x5e2908['order']=qs['sort'](_0x5db7f2[_0xb794('0x2f')][_0xb794('0x37')]);_0x5e2908[_0xb794('0x38')]=qs[_0xb794('0x31')](_['pick'](_0x5db7f2['query'],_0x3545e5[_0xb794('0x31')]),_0x180a26);if(_0x5db7f2[_0xb794('0x2f')][_0xb794('0x39')]){_0x5e2908[_0xb794('0x38')]=_['merge'](_0x5e2908[_0xb794('0x38')],{'$or':_[_0xb794('0x2e')](_0x180a26,function(_0x3f384){if(_0x3f384[_0xb794('0x2b')]!==_0xb794('0x3a')){var _0x4186c9={};_0x4186c9[_0x3f384[_0xb794('0x25')]]={'$like':'%'+_0x5db7f2[_0xb794('0x2f')]['filter']+'%'};return _0x4186c9;}})});}_0x5e2908=_[_0xb794('0x3b')]({},_0x5e2908,_0x5db7f2[_0xb794('0x3c')]);var _0x5772f1={'where':_0x5e2908[_0xb794('0x38')]};return db[_0xb794('0x28')]['count'](_0x5772f1)['then'](function(_0x507adb){_0x175ce2['count']=_0x507adb;if(_0x5db7f2[_0xb794('0x2f')][_0xb794('0x3d')]){_0x5e2908['include']=[{'all':!![]}];}return db[_0xb794('0x28')][_0xb794('0x3e')](_0x5e2908);})[_0xb794('0x3f')](function(_0x35250a){_0x175ce2['rows']=_0x35250a;return _0x175ce2;})[_0xb794('0x3f')](respondWithFilteredResult(_0x26af3b,_0x5e2908))['catch'](handleError(_0x26af3b,null));};exports['show']=function(_0x2fb2eb,_0x1d7d96){var _0x3a64e9={'raw':![],'where':{'id':_0x2fb2eb[_0xb794('0x40')]['id']}},_0x363228={};_0x363228[_0xb794('0x2d')]=_[_0xb794('0x30')](db[_0xb794('0x28')][_0xb794('0x29')]);_0x363228['query']=_[_0xb794('0x30')](_0x2fb2eb[_0xb794('0x2f')]);_0x363228['filters']=_['intersection'](_0x363228[_0xb794('0x2d')],_0x363228[_0xb794('0x2f')]);_0x3a64e9[_0xb794('0x33')]=_[_0xb794('0x32')](_0x363228[_0xb794('0x2d')],qs[_0xb794('0x34')](_0x2fb2eb[_0xb794('0x2f')]['fields']));_0x3a64e9['attributes']=_0x3a64e9[_0xb794('0x33')][_0xb794('0x41')]?_0x3a64e9[_0xb794('0x33')]:_0x363228[_0xb794('0x2d')];if(_0x2fb2eb['query'][_0xb794('0x3d')]){_0x3a64e9[_0xb794('0x42')]=[{'all':!![]}];}_0x3a64e9=_['merge']({},_0x3a64e9,_0x2fb2eb[_0xb794('0x3c')]);return db[_0xb794('0x28')][_0xb794('0x43')](_0x3a64e9)['then'](handleEntityNotFound(_0x1d7d96,null))['then'](respondWithResult(_0x1d7d96,null))[_0xb794('0x44')](handleError(_0x1d7d96,null));};exports[_0xb794('0x45')]=function(_0x1b57d3,_0x1248e4){return db['DeskConfiguration']['create'](_0x1b57d3[_0xb794('0x46')],{})[_0xb794('0x3f')](respondWithResult(_0x1248e4,0xc9))[_0xb794('0x44')](handleError(_0x1248e4,null));};exports[_0xb794('0x47')]=function(_0x4014d8,_0x1e57b8){if(_0x4014d8['body']['id']){delete _0x4014d8['body']['id'];}return db[_0xb794('0x28')][_0xb794('0x43')]({'where':{'id':_0x4014d8[_0xb794('0x40')]['id']}})[_0xb794('0x3f')](handleEntityNotFound(_0x1e57b8,null))['then'](saveUpdates(_0x4014d8['body'],null))[_0xb794('0x3f')](respondWithResult(_0x1e57b8,null))['catch'](handleError(_0x1e57b8,null));};exports[_0xb794('0x22')]=function(_0x16848c,_0x427fbb){return db['DeskConfiguration'][_0xb794('0x43')]({'where':{'id':_0x16848c[_0xb794('0x40')]['id']}})['then'](handleEntityNotFound(_0x427fbb,null))[_0xb794('0x3f')](removeEntity(_0x427fbb,null))[_0xb794('0x44')](handleError(_0x427fbb,null));};exports[_0xb794('0x48')]=function(_0x53c935,_0x5d8a21,_0x6ab524){var _0x257f5={};var _0x367cf8={};var _0x529ab5;var _0x2d6c8d;return db['DeskConfiguration'][_0xb794('0x49')]({'where':{'id':_0x53c935[_0xb794('0x40')]['id']}})[_0xb794('0x3f')](handleEntityNotFound(_0x5d8a21,null))[_0xb794('0x3f')](function(_0x4dd36c){if(_0x4dd36c){_0x529ab5=_0x4dd36c;_0x367cf8[_0xb794('0x2d')]=_['keys'](db[_0xb794('0x4a')]['rawAttributes']);_0x367cf8[_0xb794('0x2f')]=_[_0xb794('0x30')](_0x53c935['query']);_0x367cf8['filters']=_[_0xb794('0x32')](_0x367cf8[_0xb794('0x2d')],_0x367cf8[_0xb794('0x2f')]);_0x257f5[_0xb794('0x33')]=_[_0xb794('0x32')](_0x367cf8['model'],qs['fields'](_0x53c935[_0xb794('0x2f')][_0xb794('0x34')]));_0x257f5['attributes']=_0x257f5['attributes'][_0xb794('0x41')]?_0x257f5[_0xb794('0x33')]:_0x367cf8[_0xb794('0x2d')];_0x257f5[_0xb794('0x4b')]=qs[_0xb794('0x37')](_0x53c935[_0xb794('0x2f')][_0xb794('0x37')]);_0x257f5[_0xb794('0x38')]=qs[_0xb794('0x31')](_[_0xb794('0x4c')](_0x53c935[_0xb794('0x2f')],_0x367cf8[_0xb794('0x31')]));if(_0x53c935[_0xb794('0x2f')][_0xb794('0x39')]){_0x257f5[_0xb794('0x38')]=_[_0xb794('0x3b')](_0x257f5['where'],{'$or':_[_0xb794('0x2e')](_0x257f5['attributes'],function(_0x3cd827){var _0x525774={};_0x525774[_0x3cd827]={'$like':'%'+_0x53c935[_0xb794('0x2f')][_0xb794('0x39')]+'%'};return _0x525774;})});}_0x257f5=_[_0xb794('0x3b')]({},_0x257f5,_0x53c935[_0xb794('0x3c')]);return _0x529ab5['getFields'](_0x257f5);}})[_0xb794('0x3f')](function(_0x59208b){if(_0x59208b){_0x2d6c8d=_0x59208b['length'];if(!_0x53c935[_0xb794('0x2f')][_0xb794('0x35')]('nolimit')){_0x257f5[_0xb794('0x1c')]=qs[_0xb794('0x1c')](_0x53c935[_0xb794('0x2f')][_0xb794('0x1c')]);_0x257f5[_0xb794('0x19')]=qs[_0xb794('0x19')](_0x53c935['query'][_0xb794('0x19')]);}return _0x529ab5['getFields'](_0x257f5);}})['then'](function(_0x5c6891){if(_0x5c6891){return _0x5c6891?{'count':_0x2d6c8d,'rows':_0x5c6891}:null;}})[_0xb794('0x3f')](respondWithResult(_0x5d8a21,null))[_0xb794('0x44')](handleError(_0x5d8a21,null));};exports['getSubjects']=function(_0x253285,_0x12672,_0x3e6dc9){var _0x984a79={};var _0x13678e={};var _0x953b24;var _0xb38846;return db[_0xb794('0x28')][_0xb794('0x49')]({'where':{'id':_0x253285[_0xb794('0x40')]['id']}})[_0xb794('0x3f')](handleEntityNotFound(_0x12672,null))[_0xb794('0x3f')](function(_0x39cc83){if(_0x39cc83){_0x953b24=_0x39cc83;_0x13678e['model']=_['keys'](db[_0xb794('0x4a')][_0xb794('0x29')]);_0x13678e['query']=_['keys'](_0x253285[_0xb794('0x2f')]);_0x13678e['filters']=_[_0xb794('0x32')](_0x13678e[_0xb794('0x2d')],_0x13678e[_0xb794('0x2f')]);_0x984a79[_0xb794('0x33')]=_[_0xb794('0x32')](_0x13678e[_0xb794('0x2d')],qs['fields'](_0x253285[_0xb794('0x2f')]['fields']));_0x984a79[_0xb794('0x33')]=_0x984a79[_0xb794('0x33')][_0xb794('0x41')]?_0x984a79[_0xb794('0x33')]:_0x13678e[_0xb794('0x2d')];_0x984a79[_0xb794('0x4b')]=qs[_0xb794('0x37')](_0x253285[_0xb794('0x2f')][_0xb794('0x37')]);_0x984a79[_0xb794('0x38')]=qs[_0xb794('0x31')](_[_0xb794('0x4c')](_0x253285[_0xb794('0x2f')],_0x13678e[_0xb794('0x31')]));if(_0x253285[_0xb794('0x2f')][_0xb794('0x39')]){_0x984a79[_0xb794('0x38')]=_[_0xb794('0x3b')](_0x984a79[_0xb794('0x38')],{'$or':_[_0xb794('0x2e')](_0x984a79[_0xb794('0x33')],function(_0x208483){var _0x34c7cc={};_0x34c7cc[_0x208483]={'$like':'%'+_0x253285[_0xb794('0x2f')]['filter']+'%'};return _0x34c7cc;})});}_0x984a79=_[_0xb794('0x3b')]({},_0x984a79,_0x253285[_0xb794('0x3c')]);return _0x953b24[_0xb794('0x4d')](_0x984a79);}})['then'](function(_0x5174e2){if(_0x5174e2){_0xb38846=_0x5174e2[_0xb794('0x41')];if(!_0x253285[_0xb794('0x2f')][_0xb794('0x35')](_0xb794('0x36'))){_0x984a79[_0xb794('0x1c')]=qs[_0xb794('0x1c')](_0x253285[_0xb794('0x2f')][_0xb794('0x1c')]);_0x984a79[_0xb794('0x19')]=qs[_0xb794('0x19')](_0x253285[_0xb794('0x2f')][_0xb794('0x19')]);}return _0x953b24[_0xb794('0x4d')](_0x984a79);}})[_0xb794('0x3f')](function(_0x71b7f2){if(_0x71b7f2){return _0x71b7f2?{'count':_0xb38846,'rows':_0x71b7f2}:null;}})[_0xb794('0x3f')](respondWithResult(_0x12672,null))[_0xb794('0x44')](handleError(_0x12672,null));};exports['getDescriptions']=function(_0x4ed151,_0x3f7d4e,_0x500a46){var _0x57df9e={};var _0x36b2fa={};var _0x47b6c6;var _0xf695f4;return db[_0xb794('0x28')][_0xb794('0x49')]({'where':{'id':_0x4ed151['params']['id']}})['then'](handleEntityNotFound(_0x3f7d4e,null))[_0xb794('0x3f')](function(_0x56af0e){if(_0x56af0e){_0x47b6c6=_0x56af0e;_0x36b2fa['model']=_[_0xb794('0x30')](db[_0xb794('0x4a')]['rawAttributes']);_0x36b2fa[_0xb794('0x2f')]=_[_0xb794('0x30')](_0x4ed151['query']);_0x36b2fa[_0xb794('0x31')]=_[_0xb794('0x32')](_0x36b2fa[_0xb794('0x2d')],_0x36b2fa['query']);_0x57df9e[_0xb794('0x33')]=_['intersection'](_0x36b2fa[_0xb794('0x2d')],qs[_0xb794('0x34')](_0x4ed151['query'][_0xb794('0x34')]));_0x57df9e[_0xb794('0x33')]=_0x57df9e[_0xb794('0x33')][_0xb794('0x41')]?_0x57df9e[_0xb794('0x33')]:_0x36b2fa[_0xb794('0x2d')];_0x57df9e[_0xb794('0x4b')]=qs[_0xb794('0x37')](_0x4ed151[_0xb794('0x2f')][_0xb794('0x37')]);_0x57df9e[_0xb794('0x38')]=qs[_0xb794('0x31')](_[_0xb794('0x4c')](_0x4ed151['query'],_0x36b2fa[_0xb794('0x31')]));if(_0x4ed151['query']['filter']){_0x57df9e[_0xb794('0x38')]=_[_0xb794('0x3b')](_0x57df9e[_0xb794('0x38')],{'$or':_[_0xb794('0x2e')](_0x57df9e['attributes'],function(_0x1ac709){var _0xf8beac={};_0xf8beac[_0x1ac709]={'$like':'%'+_0x4ed151['query'][_0xb794('0x39')]+'%'};return _0xf8beac;})});}_0x57df9e=_[_0xb794('0x3b')]({},_0x57df9e,_0x4ed151['options']);return _0x47b6c6[_0xb794('0x4e')](_0x57df9e);}})['then'](function(_0x3a8b86){if(_0x3a8b86){_0xf695f4=_0x3a8b86[_0xb794('0x41')];if(!_0x4ed151[_0xb794('0x2f')][_0xb794('0x35')](_0xb794('0x36'))){_0x57df9e[_0xb794('0x1c')]=qs[_0xb794('0x1c')](_0x4ed151[_0xb794('0x2f')][_0xb794('0x1c')]);_0x57df9e[_0xb794('0x19')]=qs[_0xb794('0x19')](_0x4ed151[_0xb794('0x2f')][_0xb794('0x19')]);}return _0x47b6c6[_0xb794('0x4e')](_0x57df9e);}})[_0xb794('0x3f')](function(_0x1e2e04){if(_0x1e2e04){return _0x1e2e04?{'count':_0xf695f4,'rows':_0x1e2e04}:null;}})['then'](respondWithResult(_0x3f7d4e,null))[_0xb794('0x44')](handleError(_0x3f7d4e,null));};exports['getTags']=function(_0x1f5e64,_0x130d70,_0x119cf4){var _0x17248e={};var _0x19853c={};var _0x54b0c8;var _0x2dcb25;return db[_0xb794('0x28')][_0xb794('0x49')]({'where':{'id':_0x1f5e64[_0xb794('0x40')]['id']}})[_0xb794('0x3f')](handleEntityNotFound(_0x130d70,null))[_0xb794('0x3f')](function(_0xa0ac9){if(_0xa0ac9){_0x54b0c8=_0xa0ac9;_0x19853c[_0xb794('0x2d')]=_[_0xb794('0x30')](db['Tag']['rawAttributes']);_0x19853c[_0xb794('0x2f')]=_[_0xb794('0x30')](_0x1f5e64[_0xb794('0x2f')]);_0x19853c['filters']=_['intersection'](_0x19853c['model'],_0x19853c['query']);_0x17248e[_0xb794('0x33')]=_['intersection'](_0x19853c[_0xb794('0x2d')],qs[_0xb794('0x34')](_0x1f5e64[_0xb794('0x2f')][_0xb794('0x34')]));_0x17248e['attributes']=_0x17248e[_0xb794('0x33')][_0xb794('0x41')]?_0x17248e[_0xb794('0x33')]:_0x19853c['model'];_0x17248e[_0xb794('0x4b')]=qs['sort'](_0x1f5e64[_0xb794('0x2f')][_0xb794('0x37')]);_0x17248e['where']=qs['filters'](_[_0xb794('0x4c')](_0x1f5e64['query'],_0x19853c[_0xb794('0x31')]));if(_0x1f5e64[_0xb794('0x2f')][_0xb794('0x39')]){_0x17248e[_0xb794('0x38')]=_[_0xb794('0x3b')](_0x17248e[_0xb794('0x38')],{'$or':_[_0xb794('0x2e')](_0x17248e[_0xb794('0x33')],function(_0x399a4a){var _0x54256f={};_0x54256f[_0x399a4a]={'$like':'%'+_0x1f5e64['query'][_0xb794('0x39')]+'%'};return _0x54256f;})});}_0x17248e=_[_0xb794('0x3b')]({},_0x17248e,_0x1f5e64['options']);return _0x54b0c8[_0xb794('0x4f')](_0x17248e);}})[_0xb794('0x3f')](function(_0x39609a){if(_0x39609a){_0x2dcb25=_0x39609a['length'];if(!_0x1f5e64[_0xb794('0x2f')][_0xb794('0x35')](_0xb794('0x36'))){_0x17248e[_0xb794('0x1c')]=qs['limit'](_0x1f5e64[_0xb794('0x2f')][_0xb794('0x1c')]);_0x17248e[_0xb794('0x19')]=qs[_0xb794('0x19')](_0x1f5e64[_0xb794('0x2f')][_0xb794('0x19')]);}return _0x54b0c8[_0xb794('0x4f')](_0x17248e);}})['then'](function(_0x41ca19){if(_0x41ca19){return _0x41ca19?{'count':_0x2dcb25,'rows':_0x41ca19}:null;}})[_0xb794('0x3f')](respondWithResult(_0x130d70,null))[_0xb794('0x44')](handleError(_0x130d70,null));};exports[_0xb794('0x50')]=function(_0x3517e8,_0x52b4ca,_0x27715c){if(_0x3517e8['body']['id']){delete _0x3517e8[_0xb794('0x46')]['id'];}return db[_0xb794('0x28')][_0xb794('0x49')]({'where':{'id':_0x3517e8[_0xb794('0x40')]['id']}})[_0xb794('0x3f')](handleEntityNotFound(_0x52b4ca,null))[_0xb794('0x3f')](function(_0x8f5899){if(_0x8f5899){return _0x8f5899[_0xb794('0x50')](_0x3517e8[_0xb794('0x46')]['ids']||[]);}return null;})[_0xb794('0x3f')](respondWithResult(_0x52b4ca,null))['catch'](handleError(_0x52b4ca,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 000d33f..29f752b 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 _0x25af=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25af,0x6c));var _0xf25a=function(_0x478de9,_0x1ae0de){_0x478de9=_0x478de9-0x0;var _0x55641f=_0x25af[_0x478de9];return _0x55641f;};'use strict';var _=require(_0xf25a('0x0'));var util=require(_0xf25a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf25a('0x2'));var rp=require(_0xf25a('0x3'));var fs=require('fs');var path=require(_0xf25a('0x4'));var rimraf=require(_0xf25a('0x5'));var config=require(_0xf25a('0x6'));var attributes=require(_0xf25a('0x7'));module[_0xf25a('0x8')]=function(_0x1e80da,_0xe06827){return _0x1e80da[_0xf25a('0x9')](_0xf25a('0xa'),attributes,{'tableName':_0xf25a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0312=['../../config/logger','api','bluebird','path','exports','define','DeskConfiguration','int_desk_configurations','util'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x0312,0x7d));var _0x2031=function(_0x5afd17,_0x3cd835){_0x5afd17=_0x5afd17-0x0;var _0x4e40aa=_0x0312[_0x5afd17];return _0x4e40aa;};'use strict';var _=require('lodash');var util=require(_0x2031('0x0'));var logger=require(_0x2031('0x1'))(_0x2031('0x2'));var moment=require('moment');var BPromise=require(_0x2031('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2031('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x2031('0x5')]=function(_0x46ba63,_0x2c7704){return _0x46ba63[_0x2031('0x6')](_0x2031('0x7'),attributes,{'tableName':_0x2031('0x8'),'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 70f4d79..91e5d8f 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 _0x1cdb=['../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x256cf4,_0x3230d7){var _0x579292=function(_0x4ec7a5){while(--_0x4ec7a5){_0x256cf4['push'](_0x256cf4['shift']());}};_0x579292(++_0x3230d7);}(_0x1cdb,0x117));var _0xb1cd=function(_0x34b890,_0x519dc7){_0x34b890=_0x34b890-0x0;var _0x3a7936=_0x1cdb[_0x34b890];return _0x3a7936;};'use strict';var _=require('lodash');var util=require(_0xb1cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb1cd('0x1'));var fs=require('fs');var Redis=require(_0xb1cd('0x2'));var db=require(_0xb1cd('0x3'))['db'];var utils=require(_0xb1cd('0x4'));var logger=require(_0xb1cd('0x5'))(_0xb1cd('0x6'));var config=require(_0xb1cd('0x7'));var jayson=require(_0xb1cd('0x8'));var client=jayson[_0xb1cd('0x9')][_0xb1cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177dca,_0x2ca721,_0x2fc36a){return new BPromise(function(_0x15d41c,_0x24687d){return client[_0xb1cd('0xb')](_0x177dca,_0x2fc36a)[_0xb1cd('0xc')](function(_0x353643){logger['info'](_0xb1cd('0xd'),_0x2ca721,_0xb1cd('0xe'));logger['debug'](_0xb1cd('0xf'),_0x2ca721,'request\x20sent',JSON[_0xb1cd('0x10')](_0x353643));if(_0x353643[_0xb1cd('0x11')]){if(_0x353643[_0xb1cd('0x11')][_0xb1cd('0x12')]===0x1f4){logger[_0xb1cd('0x11')](_0xb1cd('0xd'),_0x2ca721,_0x353643[_0xb1cd('0x11')][_0xb1cd('0x13')]);return _0x24687d(_0x353643[_0xb1cd('0x11')]['message']);}logger[_0xb1cd('0x11')](_0xb1cd('0xd'),_0x2ca721,_0x353643[_0xb1cd('0x11')][_0xb1cd('0x13')]);return _0x15d41c(_0x353643[_0xb1cd('0x11')][_0xb1cd('0x13')]);}else{logger[_0xb1cd('0x14')](_0xb1cd('0xd'),_0x2ca721,'request\x20sent');_0x15d41c(_0x353643['result']['message']);}})[_0xb1cd('0x15')](function(_0x2f4584){logger[_0xb1cd('0x11')](_0xb1cd('0xd'),_0x2ca721,_0x2f4584);_0x24687d(_0x2f4584);});});} \ No newline at end of file +var _0x6ee9=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x305731,_0x3ca991){var _0x5f46c8=function(_0x1173c2){while(--_0x1173c2){_0x305731['push'](_0x305731['shift']());}};_0x5f46c8(++_0x3ca991);}(_0x6ee9,0x9c));var _0x96ee=function(_0xeb458e,_0x333943){_0xeb458e=_0xeb458e-0x0;var _0xb6158f=_0x6ee9[_0xeb458e];return _0xb6158f;};'use strict';var _=require('lodash');var util=require(_0x96ee('0x0'));var moment=require(_0x96ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x96ee('0x2'));var fs=require('fs');var Redis=require(_0x96ee('0x3'));var db=require(_0x96ee('0x4'))['db'];var utils=require(_0x96ee('0x5'));var logger=require(_0x96ee('0x6'))(_0x96ee('0x7'));var config=require(_0x96ee('0x8'));var jayson=require(_0x96ee('0x9'));var client=jayson[_0x96ee('0xa')][_0x96ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141f00,_0x3ca6f5,_0x37087c){return new BPromise(function(_0x44633a,_0xc2812e){return client[_0x96ee('0xc')](_0x141f00,_0x37087c)[_0x96ee('0xd')](function(_0x74f809){logger[_0x96ee('0xe')](_0x96ee('0xf'),_0x3ca6f5,'request\x20sent');logger['debug'](_0x96ee('0x10'),_0x3ca6f5,_0x96ee('0x11'),JSON[_0x96ee('0x12')](_0x74f809));if(_0x74f809[_0x96ee('0x13')]){if(_0x74f809[_0x96ee('0x13')]['code']===0x1f4){logger[_0x96ee('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3ca6f5,_0x74f809[_0x96ee('0x13')][_0x96ee('0x14')]);return _0xc2812e(_0x74f809[_0x96ee('0x13')][_0x96ee('0x14')]);}logger[_0x96ee('0x13')](_0x96ee('0xf'),_0x3ca6f5,_0x74f809[_0x96ee('0x13')][_0x96ee('0x14')]);return _0x44633a(_0x74f809[_0x96ee('0x13')][_0x96ee('0x14')]);}else{logger[_0x96ee('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x3ca6f5,_0x96ee('0x11'));_0x44633a(_0x74f809[_0x96ee('0x15')][_0x96ee('0x14')]);}})['catch'](function(_0x27929b){logger['error'](_0x96ee('0xf'),_0x3ca6f5,_0x27929b);_0xc2812e(_0x27929b);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4192c85..44f340a 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 _0x6737=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6737,0x11b));var _0x7673=function(_0x41c878,_0x3e748c){_0x41c878=_0x41c878-0x0;var _0x529e64=_0x6737[_0x41c878];return _0x529e64;};'use strict';var multer=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var path=require(_0x7673('0x2'));var timeout=require(_0x7673('0x3'));var express=require('express');var router=express[_0x7673('0x4')]();var fs_extra=require(_0x7673('0x5'));var auth=require(_0x7673('0x6'));var interaction=require(_0x7673('0x7'));var config=require('../../config/environment');var controller=require(_0x7673('0x8'));router[_0x7673('0x9')]('/',auth[_0x7673('0xa')](),controller[_0x7673('0xb')]);router[_0x7673('0x9')](_0x7673('0xc'),auth[_0x7673('0xa')](),controller[_0x7673('0xd')]);router[_0x7673('0xe')]('/',auth[_0x7673('0xa')](),controller[_0x7673('0xf')]);router[_0x7673('0x10')]('/:id',auth[_0x7673('0xa')](),controller[_0x7673('0x11')]);router[_0x7673('0x12')](_0x7673('0xc'),auth[_0x7673('0xa')](),controller[_0x7673('0x13')]);module[_0x7673('0x14')]=router; \ No newline at end of file +var _0xef0a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy'];(function(_0x5a84c8,_0x5e6a04){var _0x3d9648=function(_0x393903){while(--_0x393903){_0x5a84c8['push'](_0x5a84c8['shift']());}};_0x3d9648(++_0x5e6a04);}(_0xef0a,0xdd));var _0xaef0=function(_0x422abc,_0x7d8561){_0x422abc=_0x422abc-0x0;var _0x2704a7=_0xef0a[_0x422abc];return _0x2704a7;};'use strict';var multer=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var path=require(_0xaef0('0x2'));var timeout=require(_0xaef0('0x3'));var express=require(_0xaef0('0x4'));var router=express[_0xaef0('0x5')]();var fs_extra=require(_0xaef0('0x6'));var auth=require(_0xaef0('0x7'));var interaction=require(_0xaef0('0x8'));var config=require(_0xaef0('0x9'));var controller=require(_0xaef0('0xa'));router['get']('/',auth[_0xaef0('0xb')](),controller[_0xaef0('0xc')]);router[_0xaef0('0xd')](_0xaef0('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xaef0('0xf')]('/',auth[_0xaef0('0xb')](),controller[_0xaef0('0x10')]);router[_0xaef0('0x11')](_0xaef0('0xe'),auth[_0xaef0('0xb')](),controller[_0xaef0('0x12')]);router[_0xaef0('0x13')](_0xaef0('0xe'),auth['isAuthenticated'](),controller[_0xaef0('0x14')]);module[_0xaef0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 501b78b..5ee085e 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 _0xb6c9=['exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xb6c9,0x1a6));var _0x9b6c=function(_0x15f972,_0x4a1fc7){_0x15f972=_0x15f972-0x0;var _0x3d916e=_0xb6c9[_0x15f972];return _0x3d916e;};'use strict';var Sequelize=require(_0x9b6c('0x0'));module[_0x9b6c('0x1')]={'type':{'type':Sequelize[_0x9b6c('0x2')](_0x9b6c('0x3'),_0x9b6c('0x4'),'customVariable','keyValue',_0x9b6c('0x5')),'defaultValue':_0x9b6c('0x3')},'content':{'type':Sequelize[_0x9b6c('0x6')]},'key':{'type':Sequelize[_0x9b6c('0x6')]},'keyType':{'type':Sequelize[_0x9b6c('0x2')]('string',_0x9b6c('0x4'),_0x9b6c('0x7'))},'keyContent':{'type':Sequelize[_0x9b6c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9b6c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b6d=['exports','string','variable','keyValue','STRING','ENUM'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6b6d,0x150));var _0xd6b6=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x6b6d[_0x58c20f];return _0x3b0318;};'use strict';var Sequelize=require('sequelize');module[_0xd6b6('0x0')]={'type':{'type':Sequelize['ENUM'](_0xd6b6('0x1'),_0xd6b6('0x2'),'customVariable',_0xd6b6('0x3'),'picklist'),'defaultValue':_0xd6b6('0x1')},'content':{'type':Sequelize[_0xd6b6('0x4')]},'key':{'type':Sequelize[_0xd6b6('0x4')]},'keyType':{'type':Sequelize[_0xd6b6('0x5')](_0xd6b6('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd6b6('0x4')]},'idField':{'type':Sequelize[_0xd6b6('0x4')]},'nameField':{'type':Sequelize[_0xd6b6('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6b6('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 08f1d17..037936c 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 _0x50be=['includeAll','findAll','rows','catch','show','include','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x50be,0x191));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe50b('0x0'));var rimraf=require(_0xe50b('0x1'));var zipdir=require(_0xe50b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe50b('0x3'));var moment=require(_0xe50b('0x4'));var BPromise=require(_0xe50b('0x5'));var Mustache=require(_0xe50b('0x6'));var util=require(_0xe50b('0x7'));var path=require('path');var sox=require(_0xe50b('0x8'));var csv=require(_0xe50b('0x9'));var ejs=require(_0xe50b('0xa'));var fs=require('fs');var fs_extra=require(_0xe50b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe50b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe50b('0x9'));var querystring=require(_0xe50b('0xd'));var Papa=require(_0xe50b('0xe'));var Redis=require(_0xe50b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe50b('0x10'));var as=require(_0xe50b('0x11'));var hardwareService=require(_0xe50b('0x12'));var logger=require(_0xe50b('0x13'))(_0xe50b('0x14'));var utils=require(_0xe50b('0x15'));var config=require(_0xe50b('0x16'));var licenseUtil=require(_0xe50b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d5b34,_0x4b6722){_0x4b6722=_0x4b6722||0xcc;return function(_0x3ad322){if(_0x3ad322){return _0x1d5b34[_0xe50b('0x18')](_0x4b6722);}return _0x1d5b34[_0xe50b('0x19')](_0x4b6722)[_0xe50b('0x1a')]();};}function respondWithResult(_0x429454,_0xa9c07e){_0xa9c07e=_0xa9c07e||0xc8;return function(_0x59084c){if(_0x59084c){return _0x429454[_0xe50b('0x19')](_0xa9c07e)[_0xe50b('0x1b')](_0x59084c);}};}function respondWithFilteredResult(_0x289abb,_0x32cbf2){return function(_0x407efd){if(_0x407efd){var _0x2ddbb6=typeof _0x32cbf2[_0xe50b('0x1c')]===_0xe50b('0x1d')&&typeof _0x32cbf2[_0xe50b('0x1e')]==='undefined';var _0x1f1317=_0x407efd['count'];var _0x1bd1b8=_0x2ddbb6?0x0:_0x32cbf2['offset'];var _0x3a4d07=_0x2ddbb6?_0x407efd[_0xe50b('0x1f')]:_0x32cbf2[_0xe50b('0x1c')]+_0x32cbf2['limit'];var _0x4b7353;if(_0x3a4d07>=_0x1f1317){_0x3a4d07=_0x1f1317;_0x4b7353=0xc8;}else{_0x4b7353=0xce;}_0x289abb[_0xe50b('0x19')](_0x4b7353);return _0x289abb[_0xe50b('0x20')](_0xe50b('0x21'),_0x1bd1b8+'-'+_0x3a4d07+'/'+_0x1f1317)[_0xe50b('0x1b')](_0x407efd);}return null;};}function patchUpdates(_0x204a7f){return function(_0x504d6e){try{jsonpatch[_0xe50b('0x22')](_0x504d6e,_0x204a7f,!![]);}catch(_0x501da4){return BPromise['reject'](_0x501da4);}return _0x504d6e[_0xe50b('0x23')]();};}function saveUpdates(_0x17f56e,_0x4e86f2){return function(_0x2721a9){if(_0x2721a9){return _0x2721a9[_0xe50b('0x24')](_0x17f56e)[_0xe50b('0x25')](function(_0x6fff76){return _0x6fff76;});}return null;};}function removeEntity(_0x34ffc4,_0xb85c4c){return function(_0x24afd5){if(_0x24afd5){return _0x24afd5[_0xe50b('0x26')]()['then'](function(){_0x34ffc4['status'](0xcc)[_0xe50b('0x1a')]();});}};}function handleEntityNotFound(_0x2654e9,_0x24a41e){return function(_0x430198){if(!_0x430198){_0x2654e9[_0xe50b('0x18')](0x194);}return _0x430198;};}function handleError(_0x54b054,_0xb84696){_0xb84696=_0xb84696||0x1f4;return function(_0x12e70c){logger[_0xe50b('0x27')](_0x12e70c[_0xe50b('0x28')]);if(_0x12e70c[_0xe50b('0x29')]){delete _0x12e70c[_0xe50b('0x29')];}_0x54b054[_0xe50b('0x19')](_0xb84696)[_0xe50b('0x2a')](_0x12e70c);};}exports[_0xe50b('0x2b')]=function(_0x284991,_0x37b77c){var _0x4d6ea2={},_0x27780a={},_0x4116a4={'count':0x0,'rows':[]};var _0x1b3307=_['map'](db[_0xe50b('0x2c')][_0xe50b('0x2d')],function(_0x5242e4){return{'name':_0x5242e4[_0xe50b('0x2e')],'type':_0x5242e4[_0xe50b('0x2f')][_0xe50b('0x30')]};});_0x27780a[_0xe50b('0x31')]=_[_0xe50b('0x32')](_0x1b3307,_0xe50b('0x29'));_0x27780a[_0xe50b('0x33')]=_[_0xe50b('0x34')](_0x284991[_0xe50b('0x33')]);_0x27780a['filters']=_[_0xe50b('0x35')](_0x27780a['model'],_0x27780a[_0xe50b('0x33')]);_0x4d6ea2['attributes']=_['intersection'](_0x27780a['model'],qs['fields'](_0x284991['query'][_0xe50b('0x36')]));_0x4d6ea2[_0xe50b('0x37')]=_0x4d6ea2[_0xe50b('0x37')][_0xe50b('0x38')]?_0x4d6ea2[_0xe50b('0x37')]:_0x27780a[_0xe50b('0x31')];if(!_0x284991[_0xe50b('0x33')][_0xe50b('0x39')](_0xe50b('0x3a'))){_0x4d6ea2[_0xe50b('0x1e')]=qs['limit'](_0x284991[_0xe50b('0x33')][_0xe50b('0x1e')]);_0x4d6ea2[_0xe50b('0x1c')]=qs['offset'](_0x284991[_0xe50b('0x33')][_0xe50b('0x1c')]);}_0x4d6ea2[_0xe50b('0x3b')]=qs['sort'](_0x284991['query'][_0xe50b('0x3c')]);_0x4d6ea2['where']=qs[_0xe50b('0x3d')](_[_0xe50b('0x3e')](_0x284991[_0xe50b('0x33')],_0x27780a[_0xe50b('0x3d')]),_0x1b3307);if(_0x284991[_0xe50b('0x33')]['filter']){_0x4d6ea2[_0xe50b('0x3f')]=_['merge'](_0x4d6ea2[_0xe50b('0x3f')],{'$or':_[_0xe50b('0x32')](_0x1b3307,function(_0x256521){if(_0x256521['type']!==_0xe50b('0x40')){var _0x189e75={};_0x189e75[_0x256521['name']]={'$like':'%'+_0x284991[_0xe50b('0x33')][_0xe50b('0x41')]+'%'};return _0x189e75;}})});}_0x4d6ea2=_[_0xe50b('0x42')]({},_0x4d6ea2,_0x284991['options']);var _0x3b82ef={'where':_0x4d6ea2[_0xe50b('0x3f')]};return db[_0xe50b('0x2c')]['count'](_0x3b82ef)[_0xe50b('0x25')](function(_0x256fc7){_0x4116a4[_0xe50b('0x1f')]=_0x256fc7;if(_0x284991[_0xe50b('0x33')][_0xe50b('0x43')]){_0x4d6ea2['include']=[{'all':!![]}];}return db[_0xe50b('0x2c')][_0xe50b('0x44')](_0x4d6ea2);})['then'](function(_0x2868a3){_0x4116a4[_0xe50b('0x45')]=_0x2868a3;return _0x4116a4;})[_0xe50b('0x25')](respondWithFilteredResult(_0x37b77c,_0x4d6ea2))[_0xe50b('0x46')](handleError(_0x37b77c,null));};exports[_0xe50b('0x47')]=function(_0x5cf8c1,_0x53e9e9){var _0x7363fe={'raw':!![],'where':{'id':_0x5cf8c1['params']['id']}},_0x31508b={};_0x31508b[_0xe50b('0x31')]=_['keys'](db[_0xe50b('0x2c')][_0xe50b('0x2d')]);_0x31508b[_0xe50b('0x33')]=_[_0xe50b('0x34')](_0x5cf8c1['query']);_0x31508b[_0xe50b('0x3d')]=_[_0xe50b('0x35')](_0x31508b[_0xe50b('0x31')],_0x31508b[_0xe50b('0x33')]);_0x7363fe[_0xe50b('0x37')]=_['intersection'](_0x31508b['model'],qs['fields'](_0x5cf8c1[_0xe50b('0x33')][_0xe50b('0x36')]));_0x7363fe[_0xe50b('0x37')]=_0x7363fe[_0xe50b('0x37')][_0xe50b('0x38')]?_0x7363fe[_0xe50b('0x37')]:_0x31508b[_0xe50b('0x31')];if(_0x5cf8c1[_0xe50b('0x33')][_0xe50b('0x43')]){_0x7363fe[_0xe50b('0x48')]=[{'all':!![]}];}_0x7363fe=_[_0xe50b('0x42')]({},_0x7363fe,_0x5cf8c1[_0xe50b('0x49')]);return db[_0xe50b('0x2c')][_0xe50b('0x4a')](_0x7363fe)[_0xe50b('0x25')](handleEntityNotFound(_0x53e9e9,null))[_0xe50b('0x25')](respondWithResult(_0x53e9e9,null))[_0xe50b('0x46')](handleError(_0x53e9e9,null));};exports[_0xe50b('0x4b')]=function(_0x5eaaf8,_0x4cde40){return db[_0xe50b('0x2c')]['create'](_0x5eaaf8[_0xe50b('0x4c')],{})[_0xe50b('0x25')](respondWithResult(_0x4cde40,0xc9))[_0xe50b('0x46')](handleError(_0x4cde40,null));};exports[_0xe50b('0x24')]=function(_0x3edce1,_0x126b27){if(_0x3edce1[_0xe50b('0x4c')]['id']){delete _0x3edce1[_0xe50b('0x4c')]['id'];}return db[_0xe50b('0x2c')]['find']({'where':{'id':_0x3edce1[_0xe50b('0x4d')]['id']}})[_0xe50b('0x25')](handleEntityNotFound(_0x126b27,null))[_0xe50b('0x25')](saveUpdates(_0x3edce1[_0xe50b('0x4c')],null))[_0xe50b('0x25')](respondWithResult(_0x126b27,null))[_0xe50b('0x46')](handleError(_0x126b27,null));};exports[_0xe50b('0x26')]=function(_0x3a1834,_0x37f655){return db[_0xe50b('0x2c')][_0xe50b('0x4a')]({'where':{'id':_0x3a1834[_0xe50b('0x4d')]['id']}})[_0xe50b('0x25')](handleEntityNotFound(_0x37f655,null))[_0xe50b('0x25')](removeEntity(_0x37f655,null))[_0xe50b('0x46')](handleError(_0x37f655,null));}; \ No newline at end of file +var _0x7d8d=['include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','DeskField','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x7d8d,0x134));var _0xd7d8=function(_0x964524,_0x2368d2){_0x964524=_0x964524-0x0;var _0x367458=_0x7d8d[_0x964524];return _0x367458;};'use strict';var emlformat=require(_0xd7d8('0x0'));var rimraf=require(_0xd7d8('0x1'));var zipdir=require(_0xd7d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7d8('0x3'));var moment=require('moment');var BPromise=require(_0xd7d8('0x4'));var Mustache=require(_0xd7d8('0x5'));var util=require(_0xd7d8('0x6'));var path=require(_0xd7d8('0x7'));var sox=require('sox');var csv=require(_0xd7d8('0x8'));var ejs=require(_0xd7d8('0x9'));var fs=require('fs');var fs_extra=require(_0xd7d8('0xa'));var _=require(_0xd7d8('0xb'));var squel=require(_0xd7d8('0xc'));var crypto=require(_0xd7d8('0xd'));var jsforce=require(_0xd7d8('0xe'));var deskjs=require(_0xd7d8('0xf'));var toCsv=require(_0xd7d8('0x8'));var querystring=require(_0xd7d8('0x10'));var Papa=require('papaparse');var Redis=require(_0xd7d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd7d8('0x12'));var as=require(_0xd7d8('0x13'));var hardwareService=require(_0xd7d8('0x14'));var logger=require(_0xd7d8('0x15'))(_0xd7d8('0x16'));var utils=require(_0xd7d8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd7d8('0x18'))['db'];function respondWithStatusCode(_0x387b07,_0x2daa02){_0x2daa02=_0x2daa02||0xcc;return function(_0x35e404){if(_0x35e404){return _0x387b07[_0xd7d8('0x19')](_0x2daa02);}return _0x387b07[_0xd7d8('0x1a')](_0x2daa02)['end']();};}function respondWithResult(_0x25daf6,_0x2c4ff1){_0x2c4ff1=_0x2c4ff1||0xc8;return function(_0x221af3){if(_0x221af3){return _0x25daf6[_0xd7d8('0x1a')](_0x2c4ff1)[_0xd7d8('0x1b')](_0x221af3);}};}function respondWithFilteredResult(_0x28f4d7,_0x2f0666){return function(_0x1e0072){if(_0x1e0072){var _0xefac74=typeof _0x2f0666[_0xd7d8('0x1c')]===_0xd7d8('0x1d')&&typeof _0x2f0666[_0xd7d8('0x1e')]===_0xd7d8('0x1d');var _0x2c0d12=_0x1e0072[_0xd7d8('0x1f')];var _0x48b68c=_0xefac74?0x0:_0x2f0666[_0xd7d8('0x1c')];var _0x3680e3=_0xefac74?_0x1e0072['count']:_0x2f0666[_0xd7d8('0x1c')]+_0x2f0666[_0xd7d8('0x1e')];var _0x41cccd;if(_0x3680e3>=_0x2c0d12){_0x3680e3=_0x2c0d12;_0x41cccd=0xc8;}else{_0x41cccd=0xce;}_0x28f4d7[_0xd7d8('0x1a')](_0x41cccd);return _0x28f4d7[_0xd7d8('0x20')](_0xd7d8('0x21'),_0x48b68c+'-'+_0x3680e3+'/'+_0x2c0d12)[_0xd7d8('0x1b')](_0x1e0072);}return null;};}function patchUpdates(_0x3ef3be){return function(_0x2385cd){try{jsonpatch[_0xd7d8('0x22')](_0x2385cd,_0x3ef3be,!![]);}catch(_0x3ba0eb){return BPromise[_0xd7d8('0x23')](_0x3ba0eb);}return _0x2385cd[_0xd7d8('0x24')]();};}function saveUpdates(_0x2e77ae,_0x3c0ed3){return function(_0x3dafe3){if(_0x3dafe3){return _0x3dafe3[_0xd7d8('0x25')](_0x2e77ae)['then'](function(_0x2697f1){return _0x2697f1;});}return null;};}function removeEntity(_0x386ab1,_0x1eeaa5){return function(_0x132ff6){if(_0x132ff6){return _0x132ff6['destroy']()[_0xd7d8('0x26')](function(){_0x386ab1[_0xd7d8('0x1a')](0xcc)[_0xd7d8('0x27')]();});}};}function handleEntityNotFound(_0x86fb09,_0x4777dd){return function(_0x56595f){if(!_0x56595f){_0x86fb09[_0xd7d8('0x19')](0x194);}return _0x56595f;};}function handleError(_0x2caf7b,_0x54d36f){_0x54d36f=_0x54d36f||0x1f4;return function(_0x26df46){logger[_0xd7d8('0x28')](_0x26df46[_0xd7d8('0x29')]);if(_0x26df46['name']){delete _0x26df46[_0xd7d8('0x2a')];}_0x2caf7b[_0xd7d8('0x1a')](_0x54d36f)[_0xd7d8('0x2b')](_0x26df46);};}exports[_0xd7d8('0x2c')]=function(_0x3d2021,_0x54248c){var _0x234ed5={},_0x29854a={},_0xaa4656={'count':0x0,'rows':[]};var _0x513227=_['map'](db[_0xd7d8('0x2d')]['rawAttributes'],function(_0x5638f5){return{'name':_0x5638f5[_0xd7d8('0x2e')],'type':_0x5638f5[_0xd7d8('0x2f')]['key']};});_0x29854a[_0xd7d8('0x30')]=_[_0xd7d8('0x31')](_0x513227,_0xd7d8('0x2a'));_0x29854a[_0xd7d8('0x32')]=_[_0xd7d8('0x33')](_0x3d2021[_0xd7d8('0x32')]);_0x29854a[_0xd7d8('0x34')]=_[_0xd7d8('0x35')](_0x29854a[_0xd7d8('0x30')],_0x29854a[_0xd7d8('0x32')]);_0x234ed5['attributes']=_[_0xd7d8('0x35')](_0x29854a[_0xd7d8('0x30')],qs[_0xd7d8('0x36')](_0x3d2021['query']['fields']));_0x234ed5[_0xd7d8('0x37')]=_0x234ed5[_0xd7d8('0x37')][_0xd7d8('0x38')]?_0x234ed5[_0xd7d8('0x37')]:_0x29854a['model'];if(!_0x3d2021['query']['hasOwnProperty'](_0xd7d8('0x39'))){_0x234ed5[_0xd7d8('0x1e')]=qs['limit'](_0x3d2021['query'][_0xd7d8('0x1e')]);_0x234ed5[_0xd7d8('0x1c')]=qs[_0xd7d8('0x1c')](_0x3d2021['query']['offset']);}_0x234ed5[_0xd7d8('0x3a')]=qs[_0xd7d8('0x3b')](_0x3d2021[_0xd7d8('0x32')][_0xd7d8('0x3b')]);_0x234ed5[_0xd7d8('0x3c')]=qs[_0xd7d8('0x34')](_[_0xd7d8('0x3d')](_0x3d2021[_0xd7d8('0x32')],_0x29854a['filters']),_0x513227);if(_0x3d2021['query'][_0xd7d8('0x3e')]){_0x234ed5[_0xd7d8('0x3c')]=_[_0xd7d8('0x3f')](_0x234ed5[_0xd7d8('0x3c')],{'$or':_[_0xd7d8('0x31')](_0x513227,function(_0x31fb57){if(_0x31fb57[_0xd7d8('0x2f')]!==_0xd7d8('0x40')){var _0x5a46d7={};_0x5a46d7[_0x31fb57[_0xd7d8('0x2a')]]={'$like':'%'+_0x3d2021[_0xd7d8('0x32')]['filter']+'%'};return _0x5a46d7;}})});}_0x234ed5=_[_0xd7d8('0x3f')]({},_0x234ed5,_0x3d2021[_0xd7d8('0x41')]);var _0x297f6a={'where':_0x234ed5[_0xd7d8('0x3c')]};return db[_0xd7d8('0x2d')][_0xd7d8('0x1f')](_0x297f6a)[_0xd7d8('0x26')](function(_0x26e42c){_0xaa4656[_0xd7d8('0x1f')]=_0x26e42c;if(_0x3d2021[_0xd7d8('0x32')][_0xd7d8('0x42')]){_0x234ed5[_0xd7d8('0x43')]=[{'all':!![]}];}return db[_0xd7d8('0x2d')]['findAll'](_0x234ed5);})[_0xd7d8('0x26')](function(_0x4b19c6){_0xaa4656[_0xd7d8('0x44')]=_0x4b19c6;return _0xaa4656;})[_0xd7d8('0x26')](respondWithFilteredResult(_0x54248c,_0x234ed5))[_0xd7d8('0x45')](handleError(_0x54248c,null));};exports['show']=function(_0x563477,_0x30b908){var _0x3743cd={'raw':!![],'where':{'id':_0x563477[_0xd7d8('0x46')]['id']}},_0x5e4ad8={};_0x5e4ad8[_0xd7d8('0x30')]=_[_0xd7d8('0x33')](db[_0xd7d8('0x2d')]['rawAttributes']);_0x5e4ad8[_0xd7d8('0x32')]=_[_0xd7d8('0x33')](_0x563477[_0xd7d8('0x32')]);_0x5e4ad8['filters']=_['intersection'](_0x5e4ad8['model'],_0x5e4ad8[_0xd7d8('0x32')]);_0x3743cd['attributes']=_[_0xd7d8('0x35')](_0x5e4ad8[_0xd7d8('0x30')],qs[_0xd7d8('0x36')](_0x563477['query'][_0xd7d8('0x36')]));_0x3743cd[_0xd7d8('0x37')]=_0x3743cd[_0xd7d8('0x37')]['length']?_0x3743cd[_0xd7d8('0x37')]:_0x5e4ad8[_0xd7d8('0x30')];if(_0x563477[_0xd7d8('0x32')][_0xd7d8('0x42')]){_0x3743cd[_0xd7d8('0x43')]=[{'all':!![]}];}_0x3743cd=_[_0xd7d8('0x3f')]({},_0x3743cd,_0x563477[_0xd7d8('0x41')]);return db[_0xd7d8('0x2d')][_0xd7d8('0x47')](_0x3743cd)[_0xd7d8('0x26')](handleEntityNotFound(_0x30b908,null))[_0xd7d8('0x26')](respondWithResult(_0x30b908,null))[_0xd7d8('0x45')](handleError(_0x30b908,null));};exports[_0xd7d8('0x48')]=function(_0x42323d,_0x392ace){return db[_0xd7d8('0x2d')][_0xd7d8('0x48')](_0x42323d[_0xd7d8('0x49')],{})['then'](respondWithResult(_0x392ace,0xc9))[_0xd7d8('0x45')](handleError(_0x392ace,null));};exports['update']=function(_0x1c581b,_0x418585){if(_0x1c581b[_0xd7d8('0x49')]['id']){delete _0x1c581b['body']['id'];}return db[_0xd7d8('0x2d')][_0xd7d8('0x47')]({'where':{'id':_0x1c581b[_0xd7d8('0x46')]['id']}})[_0xd7d8('0x26')](handleEntityNotFound(_0x418585,null))['then'](saveUpdates(_0x1c581b[_0xd7d8('0x49')],null))[_0xd7d8('0x26')](respondWithResult(_0x418585,null))[_0xd7d8('0x45')](handleError(_0x418585,null));};exports[_0xd7d8('0x4a')]=function(_0x1b8428,_0x2dcebb){return db['DeskField'][_0xd7d8('0x47')]({'where':{'id':_0x1b8428[_0xd7d8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2dcebb,null))[_0xd7d8('0x26')](removeEntity(_0x2dcebb,null))[_0xd7d8('0x45')](handleError(_0x2dcebb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 84bba51..6e2e1ed 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 _0xbcde=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_desk_fields','desk_unique_index','FieldId','lodash'];(function(_0x4676b9,_0x55fcd1){var _0x3a6e12=function(_0xc187c8){while(--_0xc187c8){_0x4676b9['push'](_0x4676b9['shift']());}};_0x3a6e12(++_0x55fcd1);}(_0xbcde,0x81));var _0xebcd=function(_0x2bcc3b,_0x459e9f){_0x2bcc3b=_0x2bcc3b-0x0;var _0x19058e=_0xbcde[_0x2bcc3b];return _0x19058e;};'use strict';var _=require(_0xebcd('0x0'));var util=require(_0xebcd('0x1'));var logger=require('../../config/logger')(_0xebcd('0x2'));var moment=require(_0xebcd('0x3'));var BPromise=require(_0xebcd('0x4'));var rp=require(_0xebcd('0x5'));var fs=require('fs');var path=require(_0xebcd('0x6'));var rimraf=require('rimraf');var config=require(_0xebcd('0x7'));var attributes=require('./intDeskField.attributes');module[_0xebcd('0x8')]=function(_0xf9fcd1,_0x256e2a){return _0xf9fcd1[_0xebcd('0x9')]('DeskField',attributes,{'tableName':_0xebcd('0xa'),'paranoid':![],'indexes':[{'name':_0xebcd('0xb'),'fields':['idField',_0xebcd('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6962=['util','api','moment','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0x6962,0xea));var _0x2696=function(_0x1f46f3,_0x4a2c2e){_0x1f46f3=_0x1f46f3-0x0;var _0x1f5cf8=_0x6962[_0x1f46f3];return _0x1f5cf8;};'use strict';var _=require('lodash');var util=require(_0x2696('0x0'));var logger=require('../../config/logger')(_0x2696('0x1'));var moment=require(_0x2696('0x2'));var BPromise=require(_0x2696('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2696('0x4'));var config=require(_0x2696('0x5'));var attributes=require(_0x2696('0x6'));module[_0x2696('0x7')]=function(_0x144fe2,_0x4ba92e){return _0x144fe2[_0x2696('0x8')](_0x2696('0x9'),attributes,{'tableName':_0x2696('0xa'),'paranoid':![],'indexes':[{'name':_0x2696('0xb'),'fields':[_0x2696('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 8c1d021..f86d375 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 _0x70b5=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x70b5,0x74));var _0x570b=function(_0x3763da,_0x58158b){_0x3763da=_0x3763da-0x0;var _0x5d192f=_0x70b5[_0x3763da];return _0x5d192f;};'use strict';var _=require(_0x570b('0x0'));var util=require(_0x570b('0x1'));var moment=require(_0x570b('0x2'));var BPromise=require(_0x570b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x570b('0x4'));var db=require(_0x570b('0x5'))['db'];var utils=require(_0x570b('0x6'));var logger=require(_0x570b('0x7'))('rpc');var config=require(_0x570b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x570b('0x9')][_0x570b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51dce6,_0x3941c6,_0x4ba276){return new BPromise(function(_0x498fba,_0x24a3cf){return client[_0x570b('0xb')](_0x51dce6,_0x4ba276)[_0x570b('0xc')](function(_0x38d1d8){logger['info'](_0x570b('0xd'),_0x3941c6,_0x570b('0xe'));logger[_0x570b('0xf')](_0x570b('0x10'),_0x3941c6,_0x570b('0xe'),JSON[_0x570b('0x11')](_0x38d1d8));if(_0x38d1d8['error']){if(_0x38d1d8[_0x570b('0x12')][_0x570b('0x13')]===0x1f4){logger[_0x570b('0x12')](_0x570b('0xd'),_0x3941c6,_0x38d1d8['error'][_0x570b('0x14')]);return _0x24a3cf(_0x38d1d8['error'][_0x570b('0x14')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x3941c6,_0x38d1d8[_0x570b('0x12')][_0x570b('0x14')]);return _0x498fba(_0x38d1d8[_0x570b('0x12')]['message']);}else{logger['info'](_0x570b('0xd'),_0x3941c6,_0x570b('0xe'));_0x498fba(_0x38d1d8[_0x570b('0x15')]['message']);}})[_0x570b('0x16')](function(_0x41d571){logger[_0x570b('0x12')]('DeskField,\x20%s,\x20%s',_0x3941c6,_0x41d571);_0x24a3cf(_0x41d571);});});} \ No newline at end of file +var _0x3157=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x56d580,_0x25693e){var _0x1d928a=function(_0x18243d){while(--_0x18243d){_0x56d580['push'](_0x56d580['shift']());}};_0x1d928a(++_0x25693e);}(_0x3157,0x7b));var _0x7315=function(_0x33a6e3,_0x383d77){_0x33a6e3=_0x33a6e3-0x0;var _0x264349=_0x3157[_0x33a6e3];return _0x264349;};'use strict';var _=require(_0x7315('0x0'));var util=require(_0x7315('0x1'));var moment=require(_0x7315('0x2'));var BPromise=require(_0x7315('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7315('0x4'))['db'];var utils=require(_0x7315('0x5'));var logger=require(_0x7315('0x6'))(_0x7315('0x7'));var config=require('../../config/environment');var jayson=require(_0x7315('0x8'));var client=jayson['client'][_0x7315('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b5105,_0x2a208e,_0x49b01a){return new BPromise(function(_0x5d5dee,_0x44fd85){return client[_0x7315('0xa')](_0x1b5105,_0x49b01a)[_0x7315('0xb')](function(_0x12d6ee){logger[_0x7315('0xc')](_0x7315('0xd'),_0x2a208e,_0x7315('0xe'));logger[_0x7315('0xf')](_0x7315('0x10'),_0x2a208e,_0x7315('0xe'),JSON[_0x7315('0x11')](_0x12d6ee));if(_0x12d6ee[_0x7315('0x12')]){if(_0x12d6ee[_0x7315('0x12')][_0x7315('0x13')]===0x1f4){logger[_0x7315('0x12')]('DeskField,\x20%s,\x20%s',_0x2a208e,_0x12d6ee['error']['message']);return _0x44fd85(_0x12d6ee[_0x7315('0x12')][_0x7315('0x14')]);}logger[_0x7315('0x12')](_0x7315('0xd'),_0x2a208e,_0x12d6ee[_0x7315('0x12')][_0x7315('0x14')]);return _0x5d5dee(_0x12d6ee['error']['message']);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x2a208e,_0x7315('0xe'));_0x5d5dee(_0x12d6ee[_0x7315('0x15')][_0x7315('0x14')]);}})[_0x7315('0x16')](function(_0x36dc4a){logger[_0x7315('0x12')](_0x7315('0xd'),_0x2a208e,_0x36dc4a);_0x44fd85(_0x36dc4a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8df516d..c87f383 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 _0x0a8c=['addConfiguration','put','/:id','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x4ee8dd,_0x18f719){var _0x69edb4=function(_0x452a10){while(--_0x452a10){_0x4ee8dd['push'](_0x4ee8dd['shift']());}};_0x69edb4(++_0x18f719);}(_0x0a8c,0x176));var _0xc0a8=function(_0x133b66,_0x2e8b3b){_0x133b66=_0x133b66-0x0;var _0x589a78=_0x0a8c[_0x133b66];return _0x589a78;};'use strict';var multer=require('multer');var util=require(_0xc0a8('0x0'));var path=require(_0xc0a8('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0a8('0x2'));var router=express['Router']();var fs_extra=require(_0xc0a8('0x3'));var auth=require(_0xc0a8('0x4'));var interaction=require(_0xc0a8('0x5'));var config=require(_0xc0a8('0x6'));var controller=require(_0xc0a8('0x7'));router[_0xc0a8('0x8')]('/',auth[_0xc0a8('0x9')](),controller['index']);router[_0xc0a8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc0a8('0xa')]);router['get']('/:id/configurations',auth[_0xc0a8('0x9')](),controller[_0xc0a8('0xb')]);router[_0xc0a8('0x8')](_0xc0a8('0xc'),auth[_0xc0a8('0x9')](),controller[_0xc0a8('0xd')]);router[_0xc0a8('0xe')]('/',auth[_0xc0a8('0x9')](),controller[_0xc0a8('0xf')]);router[_0xc0a8('0xe')](_0xc0a8('0x10'),auth['isAuthenticated'](),controller[_0xc0a8('0x11')]);router[_0xc0a8('0x12')](_0xc0a8('0x13'),auth['isAuthenticated'](),controller[_0xc0a8('0x14')]);router['delete'](_0xc0a8('0x13'),auth['isAuthenticated'](),controller[_0xc0a8('0x15')]);module[_0xc0a8('0x16')]=router; \ No newline at end of file +var _0x98ab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4eaf92,_0x921f17){var _0x5b5dbd=function(_0x14fa28){while(--_0x14fa28){_0x4eaf92['push'](_0x4eaf92['shift']());}};_0x5b5dbd(++_0x921f17);}(_0x98ab,0x85));var _0xb98a=function(_0x577b55,_0x38a861){_0x577b55=_0x577b55-0x0;var _0x224c94=_0x98ab[_0x577b55];return _0x224c94;};'use strict';var multer=require(_0xb98a('0x0'));var util=require(_0xb98a('0x1'));var path=require(_0xb98a('0x2'));var timeout=require(_0xb98a('0x3'));var express=require(_0xb98a('0x4'));var router=express[_0xb98a('0x5')]();var fs_extra=require(_0xb98a('0x6'));var auth=require(_0xb98a('0x7'));var interaction=require(_0xb98a('0x8'));var config=require(_0xb98a('0x9'));var controller=require('./intDynamics365Account.controller');router[_0xb98a('0xa')]('/',auth[_0xb98a('0xb')](),controller[_0xb98a('0xc')]);router[_0xb98a('0xa')](_0xb98a('0xd'),auth[_0xb98a('0xb')](),controller[_0xb98a('0xe')]);router[_0xb98a('0xa')](_0xb98a('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb98a('0xa')](_0xb98a('0x10'),auth[_0xb98a('0xb')](),controller['getFields']);router[_0xb98a('0x11')]('/',auth[_0xb98a('0xb')](),controller[_0xb98a('0x12')]);router[_0xb98a('0x11')](_0xb98a('0xf'),auth[_0xb98a('0xb')](),controller[_0xb98a('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb98a('0x14')]);router['delete'](_0xb98a('0xd'),auth[_0xb98a('0xb')](),controller[_0xb98a('0x15')]);module[_0xb98a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d3f053b..3db5657 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 _0x0ecf=['sequelize','exports','STRING'];(function(_0xd87e60,_0xba77eb){var _0x5ac871=function(_0x6e521d){while(--_0x6e521d){_0xd87e60['push'](_0xd87e60['shift']());}};_0x5ac871(++_0xba77eb);}(_0x0ecf,0x7b));var _0xf0ec=function(_0x147e06,_0x5d344c){_0x147e06=_0x147e06-0x0;var _0x4f5dd3=_0x0ecf[_0x147e06];return _0x4f5dd3;};'use strict';var Sequelize=require(_0xf0ec('0x0'));module[_0xf0ec('0x1')]={'name':{'type':Sequelize[_0xf0ec('0x2')]},'username':{'type':Sequelize[_0xf0ec('0x2')]},'password':{'type':Sequelize[_0xf0ec('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ec('0x2')]},'tenantId':{'type':Sequelize[_0xf0ec('0x2')]},'clientId':{'type':Sequelize[_0xf0ec('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf0ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf0ec('0x2')]}}; \ No newline at end of file +var _0x95fc=['STRING','sequelize','exports'];(function(_0x23c977,_0x5a55f7){var _0x5a93f0=function(_0x156ab7){while(--_0x156ab7){_0x23c977['push'](_0x23c977['shift']());}};_0x5a93f0(++_0x5a55f7);}(_0x95fc,0x1a8));var _0xc95f=function(_0x55df8d,_0x21225e){_0x55df8d=_0x55df8d-0x0;var _0x18cd9b=_0x95fc[_0x55df8d];return _0x18cd9b;};'use strict';var Sequelize=require(_0xc95f('0x0'));module[_0xc95f('0x1')]={'name':{'type':Sequelize[_0xc95f('0x2')]},'username':{'type':Sequelize[_0xc95f('0x2')]},'password':{'type':Sequelize[_0xc95f('0x2')]},'remoteUri':{'type':Sequelize[_0xc95f('0x2')]},'tenantId':{'type':Sequelize[_0xc95f('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc95f('0x2')]},'serverUrl':{'type':Sequelize[_0xc95f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc95f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index d535a6b..f266611 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 _0xf987=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Dynamics365Account','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','rows','catch','show','params','rawAttributes','keys','include','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','Dynamics365Field','getFields','ticketType','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','https://login.microsoftonline.com/','tenantId','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','forEach','@odata.type','MetadataId','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','concat','test','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x91f4f7,_0x513318){var _0x1de3be=function(_0x579053){while(--_0x579053){_0x91f4f7['push'](_0x91f4f7['shift']());}};_0x1de3be(++_0x513318);}(_0xf987,0x18a));var _0x7f98=function(_0x3669ab,_0x412b4f){_0x3669ab=_0x3669ab-0x0;var _0x1da772=_0xf987[_0x3669ab];return _0x1da772;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x9c2633,_0x2c26d8){_0x2c26d8=_0x2c26d8||0xcc;return function(_0x40ca0a){if(_0x40ca0a){return _0x9c2633[_0x7f98('0x18')](_0x2c26d8);}return _0x9c2633[_0x7f98('0x19')](_0x2c26d8)[_0x7f98('0x1a')]();};}function respondWithResult(_0x33108e,_0x3044d4){_0x3044d4=_0x3044d4||0xc8;return function(_0x2336cc){if(_0x2336cc){return _0x33108e[_0x7f98('0x19')](_0x3044d4)[_0x7f98('0x1b')](_0x2336cc);}};}function respondWithFilteredResult(_0x1fa829,_0x5e3bb5){return function(_0xcab406){if(_0xcab406){var _0x4de314=typeof _0x5e3bb5['offset']===_0x7f98('0x1c')&&typeof _0x5e3bb5[_0x7f98('0x1d')]==='undefined';var _0x51e810=_0xcab406['count'];var _0x54e6aa=_0x4de314?0x0:_0x5e3bb5[_0x7f98('0x1e')];var _0x1ab371=_0x4de314?_0xcab406['count']:_0x5e3bb5['offset']+_0x5e3bb5['limit'];var _0x364377;if(_0x1ab371>=_0x51e810){_0x1ab371=_0x51e810;_0x364377=0xc8;}else{_0x364377=0xce;}_0x1fa829['status'](_0x364377);return _0x1fa829[_0x7f98('0x1f')](_0x7f98('0x20'),_0x54e6aa+'-'+_0x1ab371+'/'+_0x51e810)[_0x7f98('0x1b')](_0xcab406);}return null;};}function patchUpdates(_0x446dd5){return function(_0x2dc650){try{jsonpatch[_0x7f98('0x21')](_0x2dc650,_0x446dd5,!![]);}catch(_0x40fe78){return BPromise[_0x7f98('0x22')](_0x40fe78);}return _0x2dc650[_0x7f98('0x23')]();};}function saveUpdates(_0x53c1ef,_0x55189b){return function(_0x12567f){if(_0x12567f){return _0x12567f['update'](_0x53c1ef)[_0x7f98('0x24')](function(_0x2d9e09){return _0x2d9e09;});}return null;};}function removeEntity(_0x51eca3,_0x417ad4){return function(_0xe03ec4){if(_0xe03ec4){return _0xe03ec4['destroy']()[_0x7f98('0x24')](function(){_0x51eca3[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1a5788,_0x3e1cd5){return function(_0x9f366b){if(!_0x9f366b){_0x1a5788[_0x7f98('0x18')](0x194);}return _0x9f366b;};}function handleError(_0x8b27a4,_0x1d086f){_0x1d086f=_0x1d086f||0x1f4;return function(_0x12378f){logger[_0x7f98('0x25')](_0x12378f[_0x7f98('0x26')]);if(_0x12378f[_0x7f98('0x27')]){delete _0x12378f['name'];}_0x8b27a4['status'](_0x1d086f)[_0x7f98('0x28')](_0x12378f);};}exports[_0x7f98('0x29')]=function(_0x186519,_0x1dd8d5){var _0xc8f69f={},_0x16a8cb={},_0x20ff8d={'count':0x0,'rows':[]};var _0x115b45=_[_0x7f98('0x2a')](db[_0x7f98('0x2b')]['rawAttributes'],function(_0x99a891){return{'name':_0x99a891[_0x7f98('0x2c')],'type':_0x99a891['type'][_0x7f98('0x2d')]};});_0x16a8cb[_0x7f98('0x2e')]=_[_0x7f98('0x2a')](_0x115b45,'name');_0x16a8cb[_0x7f98('0x2f')]=_['keys'](_0x186519[_0x7f98('0x2f')]);_0x16a8cb['filters']=_[_0x7f98('0x30')](_0x16a8cb[_0x7f98('0x2e')],_0x16a8cb[_0x7f98('0x2f')]);_0xc8f69f[_0x7f98('0x31')]=_[_0x7f98('0x30')](_0x16a8cb[_0x7f98('0x2e')],qs[_0x7f98('0x32')](_0x186519['query']['fields']));_0xc8f69f[_0x7f98('0x31')]=_0xc8f69f[_0x7f98('0x31')][_0x7f98('0x33')]?_0xc8f69f[_0x7f98('0x31')]:_0x16a8cb[_0x7f98('0x2e')];if(!_0x186519[_0x7f98('0x2f')][_0x7f98('0x34')]('nolimit')){_0xc8f69f['limit']=qs[_0x7f98('0x1d')](_0x186519['query'][_0x7f98('0x1d')]);_0xc8f69f['offset']=qs[_0x7f98('0x1e')](_0x186519[_0x7f98('0x2f')][_0x7f98('0x1e')]);}_0xc8f69f[_0x7f98('0x35')]=qs[_0x7f98('0x36')](_0x186519[_0x7f98('0x2f')][_0x7f98('0x36')]);_0xc8f69f[_0x7f98('0x37')]=qs[_0x7f98('0x38')](_[_0x7f98('0x39')](_0x186519[_0x7f98('0x2f')],_0x16a8cb[_0x7f98('0x38')]),_0x115b45);if(_0x186519[_0x7f98('0x2f')][_0x7f98('0x3a')]){_0xc8f69f[_0x7f98('0x37')]=_[_0x7f98('0x3b')](_0xc8f69f[_0x7f98('0x37')],{'$or':_[_0x7f98('0x2a')](_0x115b45,function(_0x18198a){if(_0x18198a[_0x7f98('0x3c')]!==_0x7f98('0x3d')){var _0x3e520f={};_0x3e520f[_0x18198a[_0x7f98('0x27')]]={'$like':'%'+_0x186519['query'][_0x7f98('0x3a')]+'%'};return _0x3e520f;}})});}_0xc8f69f=_[_0x7f98('0x3b')]({},_0xc8f69f,_0x186519[_0x7f98('0x3e')]);var _0x31bed1={'where':_0xc8f69f['where']};return db['Dynamics365Account'][_0x7f98('0x3f')](_0x31bed1)[_0x7f98('0x24')](function(_0x491cba){_0x20ff8d[_0x7f98('0x3f')]=_0x491cba;if(_0x186519['query']['includeAll']){_0xc8f69f['include']=[{'all':!![]}];}return db[_0x7f98('0x2b')]['findAll'](_0xc8f69f);})[_0x7f98('0x24')](function(_0x4a7599){_0x20ff8d[_0x7f98('0x40')]=_0x4a7599;return _0x20ff8d;})[_0x7f98('0x24')](respondWithFilteredResult(_0x1dd8d5,_0xc8f69f))[_0x7f98('0x41')](handleError(_0x1dd8d5,null));};exports[_0x7f98('0x42')]=function(_0x48ede9,_0x55a8cc){var _0x5b8fef={'raw':![],'where':{'id':_0x48ede9[_0x7f98('0x43')]['id']}},_0x71bfb={};_0x71bfb['model']=_['keys'](db[_0x7f98('0x2b')][_0x7f98('0x44')]);_0x71bfb[_0x7f98('0x2f')]=_[_0x7f98('0x45')](_0x48ede9[_0x7f98('0x2f')]);_0x71bfb[_0x7f98('0x38')]=_['intersection'](_0x71bfb[_0x7f98('0x2e')],_0x71bfb[_0x7f98('0x2f')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x30')](_0x71bfb[_0x7f98('0x2e')],qs[_0x7f98('0x32')](_0x48ede9[_0x7f98('0x2f')][_0x7f98('0x32')]));_0x5b8fef[_0x7f98('0x31')]=_0x5b8fef[_0x7f98('0x31')][_0x7f98('0x33')]?_0x5b8fef[_0x7f98('0x31')]:_0x71bfb['model'];if(_0x48ede9['query']['includeAll']){_0x5b8fef[_0x7f98('0x46')]=[{'all':!![]}];}_0x5b8fef=_[_0x7f98('0x3b')]({},_0x5b8fef,_0x48ede9['options']);return db[_0x7f98('0x2b')][_0x7f98('0x47')](_0x5b8fef)[_0x7f98('0x24')](handleEntityNotFound(_0x55a8cc,null))[_0x7f98('0x24')](respondWithResult(_0x55a8cc,null))[_0x7f98('0x41')](handleError(_0x55a8cc,null));};exports[_0x7f98('0x48')]=function(_0x157723,_0xdbd22d){return db[_0x7f98('0x2b')]['create'](_0x157723[_0x7f98('0x49')],{})[_0x7f98('0x24')](respondWithResult(_0xdbd22d,0xc9))[_0x7f98('0x41')](handleError(_0xdbd22d,null));};exports[_0x7f98('0x4a')]=function(_0x3396a7,_0x5008ff){if(_0x3396a7[_0x7f98('0x49')]['id']){delete _0x3396a7[_0x7f98('0x49')]['id'];}return db['Dynamics365Account'][_0x7f98('0x47')]({'where':{'id':_0x3396a7[_0x7f98('0x43')]['id']}})[_0x7f98('0x24')](handleEntityNotFound(_0x5008ff,null))[_0x7f98('0x24')](saveUpdates(_0x3396a7['body'],null))[_0x7f98('0x24')](respondWithResult(_0x5008ff,null))['catch'](handleError(_0x5008ff,null));};exports['destroy']=function(_0x3467ad,_0xb38a55){return db[_0x7f98('0x2b')][_0x7f98('0x47')]({'where':{'id':_0x3467ad[_0x7f98('0x43')]['id']}})[_0x7f98('0x24')](handleEntityNotFound(_0xb38a55,null))[_0x7f98('0x24')](removeEntity(_0xb38a55,null))[_0x7f98('0x41')](handleError(_0xb38a55,null));};exports[_0x7f98('0x4b')]=function(_0x203a53,_0x53433a,_0x1196b3){var _0x1453a7={};var _0x2eabb8={};var _0x2d4bac;var _0x23aeed;return db[_0x7f98('0x2b')][_0x7f98('0x4c')]({'where':{'id':_0x203a53[_0x7f98('0x43')]['id']}})[_0x7f98('0x24')](handleEntityNotFound(_0x53433a,null))[_0x7f98('0x24')](function(_0x2d5836){if(_0x2d5836){_0x2d4bac=_0x2d5836;_0x2eabb8['model']=_[_0x7f98('0x45')](db[_0x7f98('0x4d')][_0x7f98('0x44')]);_0x2eabb8['query']=_['keys'](_0x203a53['query']);_0x2eabb8['filters']=_['intersection'](_0x2eabb8[_0x7f98('0x2e')],_0x2eabb8[_0x7f98('0x2f')]);_0x1453a7[_0x7f98('0x31')]=_[_0x7f98('0x30')](_0x2eabb8['model'],qs[_0x7f98('0x32')](_0x203a53[_0x7f98('0x2f')]['fields']));_0x1453a7[_0x7f98('0x31')]=_0x1453a7[_0x7f98('0x31')]['length']?_0x1453a7[_0x7f98('0x31')]:_0x2eabb8[_0x7f98('0x2e')];_0x1453a7[_0x7f98('0x35')]=qs[_0x7f98('0x36')](_0x203a53[_0x7f98('0x2f')]['sort']);_0x1453a7['where']=qs[_0x7f98('0x38')](_['pick'](_0x203a53['query'],_0x2eabb8[_0x7f98('0x38')]));if(_0x203a53[_0x7f98('0x2f')]['filter']){_0x1453a7['where']=_['merge'](_0x1453a7['where'],{'$or':_['map'](_0x1453a7[_0x7f98('0x31')],function(_0x4c5fc6){var _0x5bc4e3={};_0x5bc4e3[_0x4c5fc6]={'$like':'%'+_0x203a53[_0x7f98('0x2f')][_0x7f98('0x3a')]+'%'};return _0x5bc4e3;})});}_0x1453a7=_[_0x7f98('0x3b')]({},_0x1453a7,_0x203a53[_0x7f98('0x3e')]);return _0x2d4bac[_0x7f98('0x4b')](_0x1453a7);}})[_0x7f98('0x24')](function(_0x44d29b){if(_0x44d29b){_0x23aeed=_0x44d29b[_0x7f98('0x33')];if(!_0x203a53[_0x7f98('0x2f')]['hasOwnProperty'](_0x7f98('0x4e'))){_0x1453a7[_0x7f98('0x1d')]=qs[_0x7f98('0x1d')](_0x203a53['query'][_0x7f98('0x1d')]);_0x1453a7[_0x7f98('0x1e')]=qs[_0x7f98('0x1e')](_0x203a53[_0x7f98('0x2f')][_0x7f98('0x1e')]);}return _0x2d4bac[_0x7f98('0x4b')](_0x1453a7);}})[_0x7f98('0x24')](function(_0x10a5f0){if(_0x10a5f0){return _0x10a5f0?{'count':_0x23aeed,'rows':_0x10a5f0}:null;}})[_0x7f98('0x24')](respondWithResult(_0x53433a,null))[_0x7f98('0x41')](handleError(_0x53433a,null));};exports[_0x7f98('0x4f')]=function(_0x1520c9,_0x3cb03a,_0x1570a9){if(_0x1520c9['body']['id']){delete _0x1520c9[_0x7f98('0x49')]['id'];}return db[_0x7f98('0x2b')][_0x7f98('0x4c')]({'where':{'id':_0x1520c9['params']['id']}})['then'](handleEntityNotFound(_0x3cb03a,null))[_0x7f98('0x24')](function(_0x2eacc4){if(_0x2eacc4){_0x1520c9[_0x7f98('0x49')][_0x7f98('0x50')]=_0x2eacc4['id'];_0x1520c9[_0x7f98('0x49')][_0x7f98('0x51')]=integrations[_0x7f98('0x52')](_0x1520c9[_0x7f98('0x49')]['channel'],_0x1520c9[_0x7f98('0x49')][_0x7f98('0x3c')]);_0x1520c9[_0x7f98('0x49')]['Descriptions']=integrations[_0x7f98('0x53')](_0x1520c9[_0x7f98('0x49')][_0x7f98('0x54')],_0x1520c9['body'][_0x7f98('0x3c')]);return db[_0x7f98('0x4d')][_0x7f98('0x48')](_0x1520c9[_0x7f98('0x49')],{'include':[{'model':db[_0x7f98('0x55')],'as':_0x7f98('0x51')},{'model':db[_0x7f98('0x55')],'as':'Descriptions'}]});}return null;})[_0x7f98('0x24')](respondWithResult(_0x3cb03a,null))[_0x7f98('0x41')](handleError(_0x3cb03a,null));};exports[_0x7f98('0x56')]=function(_0x2229cb,_0x3b82c3,_0x279c40){var _0x2626b4=_0x2229cb[_0x7f98('0x2f')][_0x7f98('0x57')];var _0x2a9c=_0x2626b4==='incident'?_0x7f98('0x58'):'PhoneCall';var _0x434823='';var _0x58063b='';var _0x374a17='';var _0x447afd='';var _0x5aecb7='';var _0x248875='';var _0x4170bb='';var _0x4b1d8d='';var _0x2e369e=[_0x7f98('0x59'),_0x7f98('0x5a'),_0x7f98('0x5b'),_0x7f98('0x5c'),_0x7f98('0x5d'),_0x7f98('0x5e'),_0x7f98('0x5f'),_0x7f98('0x60'),'directioncode',_0x7f98('0x61')];var _0x45290f=['accountidname',_0x7f98('0x62'),_0x7f98('0x63'),_0x7f98('0x64'),_0x7f98('0x65'),_0x7f98('0x66'),_0x7f98('0x67'),_0x7f98('0x68'),_0x7f98('0x69'),_0x7f98('0x6a'),_0x7f98('0x6b'),'createdbyyominame',_0x7f98('0x6c'),_0x7f98('0x6d'),'createdonbehalfbyyominame',_0x7f98('0x6e'),_0x7f98('0x6f'),_0x7f98('0x70'),_0x7f98('0x71'),_0x7f98('0x72'),_0x7f98('0x73'),_0x7f98('0x74'),_0x7f98('0x75'),_0x7f98('0x76'),_0x7f98('0x77'),_0x7f98('0x78'),_0x7f98('0x79'),_0x7f98('0x7a'),'kbarticleidname',_0x7f98('0x7b'),_0x7f98('0x7c'),_0x7f98('0x7d'),_0x7f98('0x7e'),_0x7f98('0x7f'),'modifiedbyyominame','modifiedon',_0x7f98('0x80'),_0x7f98('0x81'),_0x7f98('0x82'),_0x7f98('0x83'),_0x7f98('0x84'),_0x7f98('0x85'),_0x7f98('0x86'),_0x7f98('0x87'),_0x7f98('0x88'),_0x7f98('0x89'),_0x7f98('0x8a'),_0x7f98('0x8b'),_0x7f98('0x8c'),_0x7f98('0x8d'),'productidname','productserialnumber','resolveby',_0x7f98('0x8e'),_0x7f98('0x8f'),_0x7f98('0x90'),_0x7f98('0x91'),_0x7f98('0x92'),_0x7f98('0x93'),'slaname',_0x7f98('0x94'),_0x7f98('0x95'),_0x7f98('0x96'),_0x7f98('0x97'),_0x7f98('0x98'),'timezoneruleversionnumber',_0x7f98('0x99'),_0x7f98('0x9a'),_0x7f98('0x9b'),_0x7f98('0x9c')];var _0x393aeb=_0x2e369e['concat'](_0x45290f);return db[_0x7f98('0x2b')][_0x7f98('0x4c')]({'where':{'id':_0x2229cb[_0x7f98('0x43')]['id']},'attributes':['id',_0x7f98('0x9d'),'password',_0x7f98('0x9e'),'tenantId',_0x7f98('0x9f'),_0x7f98('0xa0')]})[_0x7f98('0x24')](handleEntityNotFound(_0x3b82c3,null))[_0x7f98('0x24')](function(_0x122695){if(_0x122695){_0x4b1d8d=_0x122695[_0x7f98('0x9e')];var _0x39d5a9=_0x4b1d8d[_0x7f98('0xa1')](-0x1);if(_0x39d5a9==='/'){_0x4b1d8d=_0x4b1d8d[_0x7f98('0xa2')](0x0,_0x4b1d8d[_0x7f98('0xa3')](_0x39d5a9));}_0x4170bb=util[_0x7f98('0xa4')]('%s/api/data/v9.0/',_0x4b1d8d);var _0x4696a0={'method':'POST','uri':_0x7f98('0xa5')+_0x122695[_0x7f98('0xa6')]+_0x7f98('0xa7'),'form':{'client_id':_0x122695['clientId'],'resource':_0x4b1d8d,'username':_0x122695[_0x7f98('0x9d')],'password':_0x122695[_0x7f98('0xa8')],'grant_type':_0x7f98('0xa8'),'client_secret':_0x122695['clientSecret']},'json':!![]};return rp(_0x4696a0);}})[_0x7f98('0x24')](function(_0x4e990c){_0x248875=_0x4e990c[_0x7f98('0xa9')];var _0x742916={'method':_0x7f98('0xaa'),'uri':encodeURI(_0x4170bb+_0x7f98('0xab')+_0x2a9c+'\x27'),'headers':{'Authorization':_0x7f98('0xac')+_0x248875,'If-None-Match':null,'OData-Version':_0x7f98('0xad')},'json':!![]};return rp(_0x742916);})[_0x7f98('0x24')](function(_0x1392b9){var _0x17bf09=_0x1392b9['value'][0x0];var _0x1d4d06=_0x17bf09['MetadataId'];var _0x4ff857={'method':_0x7f98('0xaa'),'uri':_0x4170bb+_0x7f98('0xae')+_0x1d4d06+_0x7f98('0xaf'),'headers':{'Authorization':_0x7f98('0xac')+_0x248875,'If-None-Match':null,'OData-Version':_0x7f98('0xad')},'json':!![]};return rp(_0x4ff857);})[_0x7f98('0x24')](function(_0x5002a0){_0x434823=_0x5002a0;_0x58063b=_0x434823[_0x7f98('0xb0')];_0x58063b=_['remove'](_0x58063b,function(_0x4ef36b){return!_0x393aeb['includes'](_0x4ef36b['LogicalName']);});var _0x29c748=[];var _0x37dbbd=[];_0x58063b[_0x7f98('0xb1')](function(_0x284fb4){if(_0x284fb4[_0x7f98('0xb2')]){var _0x41acc2=_0x284fb4[_0x7f98('0xb2')]['substring'](_0x284fb4[_0x7f98('0xb2')][_0x7f98('0xa3')]('.')+0x1);if(_0x41acc2==='PicklistAttributeMetadata'){_0x29c748['push'](getSelectList(_0x4170bb,_0x2626b4,_0x37dbbd,_0x434823[_0x7f98('0xb3')],_0x284fb4[_0x7f98('0xb3')],_0x248875));}}});return Promise[_0x7f98('0xb4')](_0x29c748);})['then'](function(_0x269ca2){_0x374a17=_0x269ca2[0x0];var _0xeaa518=[];var _0x2ab367=[];_0x58063b[_0x7f98('0xb1')](function(_0x4a9812){if(!_[_0x7f98('0xb5')](_0x4a9812[_0x7f98('0xb2')])){var _0x19f405=_0x4a9812[_0x7f98('0xb2')][_0x7f98('0xa2')](_0x4a9812[_0x7f98('0xb2')][_0x7f98('0xa3')]('.')+0x1);if(_0x19f405==='BooleanAttributeMetadata'){_0xeaa518['push'](getBooleanList(_0x4170bb,_0x2626b4,_0x2ab367,_0x434823['MetadataId'],_0x4a9812[_0x7f98('0xb3')],_0x248875));}}});return Promise[_0x7f98('0xb4')](_0xeaa518);})['then'](function(_0x471877){_0x447afd=_0x471877[0x0];var _0x394e42=[];var _0x281c49=[];_0x58063b[_0x7f98('0xb1')](function(_0x150b73){if(_0x150b73['@odata.type']){var _0x3855ab=_0x150b73[_0x7f98('0xb2')][_0x7f98('0xa2')](_0x150b73[_0x7f98('0xb2')][_0x7f98('0xa3')]('.')+0x1);if(_0x3855ab===_0x7f98('0xb6')||_0x3855ab==='DoubleAttributeMetadata'||_0x3855ab===_0x7f98('0xb7')||_0x3855ab===_0x7f98('0xb8')||_0x3855ab===_0x7f98('0xb9')||_0x3855ab==='DateTimeAttributeMetadata'||_0x3855ab===_0x7f98('0xba')||_0x3855ab===_0x7f98('0xbb')||_0x3855ab===_0x7f98('0xbc')||_0x3855ab===_0x7f98('0xbd')){_0x394e42[_0x7f98('0xbe')](getInputList(_0x4170bb,_0x2626b4,_0x3855ab,_0x281c49,_0x434823['MetadataId'],_0x150b73['MetadataId'],_0x248875));}}});return Promise['all'](_0x394e42);})[_0x7f98('0x24')](function(_0xdeee9e){_0x5aecb7=_0xdeee9e[0x0];var _0x3bcd5d=_0x374a17[_0x7f98('0xbf')](_0x447afd)[_0x7f98('0xbf')](_0x5aecb7);var _0x59c23a={'count':_0x3bcd5d[_0x7f98('0x33')],'rows':_0x3bcd5d};return _0x59c23a;})[_0x7f98('0x24')](respondWithResult(_0x3b82c3,null))[_0x7f98('0x41')](function(_0x18914c){var _0x585d13=_0x2229cb[_0x7f98('0x2f')][_0x7f98('0xc0')]?0x1f4:_0x18914c[_0x7f98('0xc1')]||0x1f4;logger['error'](_0x18914c[_0x7f98('0x26')]);delete _0x18914c[_0x7f98('0x27')];if(_0x585d13===0x191){_0x585d13=0x190;}_0x3b82c3[_0x7f98('0x19')](_0x585d13)['send'](_0x2229cb['query'][_0x7f98('0xc0')]?{'message':'Wrong\x20credentials','statusCode':_0x18914c[_0x7f98('0xc1')]}:_0x18914c);});};function getSelectList(_0x46880a,_0x9baa26,_0x4eb77e,_0x34810c,_0xa721f6,_0x368628){var _0x4e6fba={'method':'GET','uri':_0x46880a+_0x7f98('0xae')+_0x34810c+_0x7f98('0xc2')+_0xa721f6+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7f98('0xc3'),'headers':{'Authorization':_0x7f98('0xac')+_0x368628,'If-None-Match':null,'OData-Version':_0x7f98('0xad')},'json':!![]};return rp(_0x4e6fba)[_0x7f98('0x24')](function(_0x541342){var _0xe25647=[];var _0x117b70=_0x541342['OptionSet'][_0x7f98('0xc4')];_0x117b70[_0x7f98('0xb1')](function(_0x2a71e5){_0xe25647['push']({'name':_0x2a71e5[_0x7f98('0xc5')][_0x7f98('0xc6')][_0x7f98('0xc5')],'value':String(_0x2a71e5['Value'])});});var _0x1b249c={'id':_0x9baa26+'_'+_0x541342['LogicalName'],'name':_0x541342[_0x7f98('0xc7')][_0x7f98('0xc6')][_0x7f98('0xc5')],'custom':![],'options':_0xe25647};_0x4eb77e['push'](_0x1b249c);return _0x4eb77e;});}function getBooleanList(_0x451679,_0x471680,_0x587292,_0xf27b4b,_0x47d4a9,_0x4cb1e4){var _0x1ff4d1={'method':'GET','uri':_0x451679+_0x7f98('0xae')+_0xf27b4b+_0x7f98('0xc2')+_0x47d4a9+_0x7f98('0xc8'),'headers':{'Authorization':_0x7f98('0xac')+_0x4cb1e4,'If-None-Match':null,'OData-Version':_0x7f98('0xad')},'json':!![]};return rp(_0x1ff4d1)[_0x7f98('0x24')](function(_0x5231c2){var _0x139448=[];_0x139448[_0x7f98('0xbe')]({'name':_0x5231c2[_0x7f98('0xc9')][_0x7f98('0xca')]['Label'][_0x7f98('0xc6')][_0x7f98('0xc5')],'value':_0x7f98('0xcb')},{'name':_0x5231c2[_0x7f98('0xc9')][_0x7f98('0xcc')]['Label']['UserLocalizedLabel'][_0x7f98('0xc5')],'value':_0x7f98('0xcd')});var _0x19bdc2={'id':_0x471680+'_'+_0x5231c2[_0x7f98('0xce')],'name':_0x5231c2[_0x7f98('0xc7')][_0x7f98('0xc6')]['Label'],'custom':![],'options':_0x139448};_0x587292['push'](_0x19bdc2);return _0x587292;});}function getInputList(_0x43cf55,_0x1ba457,_0x3cd626,_0x2af085,_0x3893c3,_0xdf0031,_0x30647d){var _0x257113={'method':_0x7f98('0xaa'),'uri':_0x43cf55+_0x7f98('0xae')+_0x3893c3+_0x7f98('0xc2')+_0xdf0031+_0x7f98('0xcf')+_0x3cd626+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7f98('0xac')+_0x30647d,'If-None-Match':null,'OData-Version':_0x7f98('0xad')},'json':!![]};return rp(_0x257113)['then'](function(_0x557694){var _0x5825c1={'id':_0x1ba457+'_'+_0x557694['LogicalName'],'name':_0x557694[_0x7f98('0xc7')][_0x7f98('0xc6')]?_0x557694['DisplayName'][_0x7f98('0xc6')][_0x7f98('0xc5')]:_0x557694[_0x7f98('0xce')],'custom':![],'options':[]};_0x2af085[_0x7f98('0xbe')](_0x5825c1);return _0x2af085;});} \ No newline at end of file +var _0x3663=['transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','substring','https://login.microsoftonline.com/','tenantId','access_token','GET','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','MetadataId','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','index','map','Dynamics365Account','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','merge','where','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','Dynamics365Configuration','filter','hasOwnProperty','addConfiguration','findOne','Subjects','channel','type','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','PhoneCall','title','description','customerid','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x3663,0x1cf));var _0x3366=function(_0x2f44ff,_0x3fc361){_0x2f44ff=_0x2f44ff-0x0;var _0xf448bf=_0x3663[_0x2f44ff];return _0xf448bf;};'use strict';var emlformat=require(_0x3366('0x0'));var rimraf=require(_0x3366('0x1'));var zipdir=require(_0x3366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3366('0x3'));var moment=require(_0x3366('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3366('0x5'));var util=require(_0x3366('0x6'));var path=require(_0x3366('0x7'));var sox=require(_0x3366('0x8'));var csv=require(_0x3366('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3366('0xa'));var _=require(_0x3366('0xb'));var squel=require('squel');var crypto=require(_0x3366('0xc'));var jsforce=require(_0x3366('0xd'));var deskjs=require(_0x3366('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3366('0xf'));var Papa=require(_0x3366('0x10'));var Redis=require(_0x3366('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3366('0x12'));var as=require(_0x3366('0x13'));var hardwareService=require(_0x3366('0x14'));var logger=require(_0x3366('0x15'))(_0x3366('0x16'));var utils=require(_0x3366('0x17'));var config=require(_0x3366('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3366('0x19'));function respondWithStatusCode(_0x783695,_0x693c7d){_0x693c7d=_0x693c7d||0xcc;return function(_0x321468){if(_0x321468){return _0x783695[_0x3366('0x1a')](_0x693c7d);}return _0x783695[_0x3366('0x1b')](_0x693c7d)['end']();};}function respondWithResult(_0x58e02a,_0x27753e){_0x27753e=_0x27753e||0xc8;return function(_0x51ff8c){if(_0x51ff8c){return _0x58e02a[_0x3366('0x1b')](_0x27753e)[_0x3366('0x1c')](_0x51ff8c);}};}function respondWithFilteredResult(_0x190524,_0x334d91){return function(_0xb5d3e4){if(_0xb5d3e4){var _0x58a86c=typeof _0x334d91[_0x3366('0x1d')]===_0x3366('0x1e')&&typeof _0x334d91[_0x3366('0x1f')]===_0x3366('0x1e');var _0x3377be=_0xb5d3e4[_0x3366('0x20')];var _0x4d074a=_0x58a86c?0x0:_0x334d91['offset'];var _0x25320d=_0x58a86c?_0xb5d3e4['count']:_0x334d91[_0x3366('0x1d')]+_0x334d91[_0x3366('0x1f')];var _0xd5ff94;if(_0x25320d>=_0x3377be){_0x25320d=_0x3377be;_0xd5ff94=0xc8;}else{_0xd5ff94=0xce;}_0x190524[_0x3366('0x1b')](_0xd5ff94);return _0x190524[_0x3366('0x21')](_0x3366('0x22'),_0x4d074a+'-'+_0x25320d+'/'+_0x3377be)['json'](_0xb5d3e4);}return null;};}function patchUpdates(_0x3471ab){return function(_0x89c427){try{jsonpatch[_0x3366('0x23')](_0x89c427,_0x3471ab,!![]);}catch(_0x9c705b){return BPromise[_0x3366('0x24')](_0x9c705b);}return _0x89c427['save']();};}function saveUpdates(_0x5a9bb0,_0x239872){return function(_0x1d228b){if(_0x1d228b){return _0x1d228b[_0x3366('0x25')](_0x5a9bb0)['then'](function(_0x5328dd){return _0x5328dd;});}return null;};}function removeEntity(_0x32e25c,_0x4760ff){return function(_0x41d66a){if(_0x41d66a){return _0x41d66a['destroy']()[_0x3366('0x26')](function(){_0x32e25c['status'](0xcc)[_0x3366('0x27')]();});}};}function handleEntityNotFound(_0x1eec67,_0x240e8c){return function(_0x63c903){if(!_0x63c903){_0x1eec67[_0x3366('0x1a')](0x194);}return _0x63c903;};}function handleError(_0x436468,_0x3303f1){_0x3303f1=_0x3303f1||0x1f4;return function(_0x16bb7d){logger[_0x3366('0x28')](_0x16bb7d[_0x3366('0x29')]);if(_0x16bb7d['name']){delete _0x16bb7d[_0x3366('0x2a')];}_0x436468[_0x3366('0x1b')](_0x3303f1)['send'](_0x16bb7d);};}exports[_0x3366('0x2b')]=function(_0x1826e5,_0x1354c6){var _0x280fda={},_0x13cf43={},_0x3d1a35={'count':0x0,'rows':[]};var _0x13e923=_[_0x3366('0x2c')](db[_0x3366('0x2d')][_0x3366('0x2e')],function(_0xbf70fc){return{'name':_0xbf70fc['fieldName'],'type':_0xbf70fc['type'][_0x3366('0x2f')]};});_0x13cf43[_0x3366('0x30')]=_[_0x3366('0x2c')](_0x13e923,_0x3366('0x2a'));_0x13cf43['query']=_[_0x3366('0x31')](_0x1826e5[_0x3366('0x32')]);_0x13cf43['filters']=_[_0x3366('0x33')](_0x13cf43[_0x3366('0x30')],_0x13cf43[_0x3366('0x32')]);_0x280fda['attributes']=_[_0x3366('0x33')](_0x13cf43[_0x3366('0x30')],qs[_0x3366('0x34')](_0x1826e5['query'][_0x3366('0x34')]));_0x280fda['attributes']=_0x280fda[_0x3366('0x35')][_0x3366('0x36')]?_0x280fda[_0x3366('0x35')]:_0x13cf43[_0x3366('0x30')];if(!_0x1826e5['query']['hasOwnProperty'](_0x3366('0x37'))){_0x280fda[_0x3366('0x1f')]=qs[_0x3366('0x1f')](_0x1826e5[_0x3366('0x32')][_0x3366('0x1f')]);_0x280fda['offset']=qs[_0x3366('0x1d')](_0x1826e5[_0x3366('0x32')][_0x3366('0x1d')]);}_0x280fda[_0x3366('0x38')]=qs[_0x3366('0x39')](_0x1826e5[_0x3366('0x32')][_0x3366('0x39')]);_0x280fda['where']=qs[_0x3366('0x3a')](_[_0x3366('0x3b')](_0x1826e5['query'],_0x13cf43[_0x3366('0x3a')]),_0x13e923);if(_0x1826e5[_0x3366('0x32')]['filter']){_0x280fda['where']=_[_0x3366('0x3c')](_0x280fda[_0x3366('0x3d')],{'$or':_[_0x3366('0x2c')](_0x13e923,function(_0x1c8efb){if(_0x1c8efb['type']!=='VIRTUAL'){var _0x2fa48a={};_0x2fa48a[_0x1c8efb[_0x3366('0x2a')]]={'$like':'%'+_0x1826e5[_0x3366('0x32')]['filter']+'%'};return _0x2fa48a;}})});}_0x280fda=_[_0x3366('0x3c')]({},_0x280fda,_0x1826e5[_0x3366('0x3e')]);var _0x4fcedb={'where':_0x280fda[_0x3366('0x3d')]};return db[_0x3366('0x2d')][_0x3366('0x20')](_0x4fcedb)[_0x3366('0x26')](function(_0x1ea142){_0x3d1a35[_0x3366('0x20')]=_0x1ea142;if(_0x1826e5[_0x3366('0x32')][_0x3366('0x3f')]){_0x280fda[_0x3366('0x40')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x3366('0x41')](_0x280fda);})['then'](function(_0x51fe77){_0x3d1a35[_0x3366('0x42')]=_0x51fe77;return _0x3d1a35;})[_0x3366('0x26')](respondWithFilteredResult(_0x1354c6,_0x280fda))[_0x3366('0x43')](handleError(_0x1354c6,null));};exports[_0x3366('0x44')]=function(_0x1b5892,_0x4d110a){var _0x498b1c={'raw':![],'where':{'id':_0x1b5892[_0x3366('0x45')]['id']}},_0x52913c={};_0x52913c[_0x3366('0x30')]=_[_0x3366('0x31')](db[_0x3366('0x2d')][_0x3366('0x2e')]);_0x52913c['query']=_[_0x3366('0x31')](_0x1b5892[_0x3366('0x32')]);_0x52913c[_0x3366('0x3a')]=_[_0x3366('0x33')](_0x52913c[_0x3366('0x30')],_0x52913c[_0x3366('0x32')]);_0x498b1c[_0x3366('0x35')]=_[_0x3366('0x33')](_0x52913c[_0x3366('0x30')],qs['fields'](_0x1b5892['query'][_0x3366('0x34')]));_0x498b1c[_0x3366('0x35')]=_0x498b1c[_0x3366('0x35')][_0x3366('0x36')]?_0x498b1c[_0x3366('0x35')]:_0x52913c[_0x3366('0x30')];if(_0x1b5892[_0x3366('0x32')][_0x3366('0x3f')]){_0x498b1c[_0x3366('0x40')]=[{'all':!![]}];}_0x498b1c=_[_0x3366('0x3c')]({},_0x498b1c,_0x1b5892['options']);return db[_0x3366('0x2d')][_0x3366('0x46')](_0x498b1c)[_0x3366('0x26')](handleEntityNotFound(_0x4d110a,null))['then'](respondWithResult(_0x4d110a,null))[_0x3366('0x43')](handleError(_0x4d110a,null));};exports[_0x3366('0x47')]=function(_0x2c4962,_0x268acc){return db[_0x3366('0x2d')][_0x3366('0x47')](_0x2c4962['body'],{})[_0x3366('0x26')](respondWithResult(_0x268acc,0xc9))[_0x3366('0x43')](handleError(_0x268acc,null));};exports[_0x3366('0x25')]=function(_0xc4f30c,_0x498e90){if(_0xc4f30c['body']['id']){delete _0xc4f30c[_0x3366('0x48')]['id'];}return db[_0x3366('0x2d')][_0x3366('0x46')]({'where':{'id':_0xc4f30c['params']['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x498e90,null))[_0x3366('0x26')](saveUpdates(_0xc4f30c[_0x3366('0x48')],null))[_0x3366('0x26')](respondWithResult(_0x498e90,null))[_0x3366('0x43')](handleError(_0x498e90,null));};exports[_0x3366('0x49')]=function(_0x377000,_0x86bcd7){return db[_0x3366('0x2d')]['find']({'where':{'id':_0x377000[_0x3366('0x45')]['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x86bcd7,null))[_0x3366('0x26')](removeEntity(_0x86bcd7,null))[_0x3366('0x43')](handleError(_0x86bcd7,null));};exports[_0x3366('0x4a')]=function(_0x3c9324,_0x692f7c,_0x2aeb58){var _0x44b472={};var _0x19e931={};var _0x4a68a0;var _0x315bfc;return db['Dynamics365Account']['findOne']({'where':{'id':_0x3c9324['params']['id']}})['then'](handleEntityNotFound(_0x692f7c,null))[_0x3366('0x26')](function(_0x12cc88){if(_0x12cc88){_0x4a68a0=_0x12cc88;_0x19e931['model']=_[_0x3366('0x31')](db[_0x3366('0x4b')][_0x3366('0x2e')]);_0x19e931[_0x3366('0x32')]=_[_0x3366('0x31')](_0x3c9324[_0x3366('0x32')]);_0x19e931[_0x3366('0x3a')]=_[_0x3366('0x33')](_0x19e931[_0x3366('0x30')],_0x19e931[_0x3366('0x32')]);_0x44b472[_0x3366('0x35')]=_[_0x3366('0x33')](_0x19e931['model'],qs['fields'](_0x3c9324[_0x3366('0x32')][_0x3366('0x34')]));_0x44b472[_0x3366('0x35')]=_0x44b472[_0x3366('0x35')]['length']?_0x44b472[_0x3366('0x35')]:_0x19e931[_0x3366('0x30')];_0x44b472[_0x3366('0x38')]=qs[_0x3366('0x39')](_0x3c9324[_0x3366('0x32')][_0x3366('0x39')]);_0x44b472[_0x3366('0x3d')]=qs[_0x3366('0x3a')](_[_0x3366('0x3b')](_0x3c9324['query'],_0x19e931[_0x3366('0x3a')]));if(_0x3c9324[_0x3366('0x32')][_0x3366('0x4c')]){_0x44b472['where']=_[_0x3366('0x3c')](_0x44b472[_0x3366('0x3d')],{'$or':_[_0x3366('0x2c')](_0x44b472[_0x3366('0x35')],function(_0x59d8e0){var _0x248732={};_0x248732[_0x59d8e0]={'$like':'%'+_0x3c9324[_0x3366('0x32')][_0x3366('0x4c')]+'%'};return _0x248732;})});}_0x44b472=_['merge']({},_0x44b472,_0x3c9324[_0x3366('0x3e')]);return _0x4a68a0['getConfigurations'](_0x44b472);}})['then'](function(_0x6f5d3b){if(_0x6f5d3b){_0x315bfc=_0x6f5d3b['length'];if(!_0x3c9324[_0x3366('0x32')][_0x3366('0x4d')](_0x3366('0x37'))){_0x44b472['limit']=qs['limit'](_0x3c9324[_0x3366('0x32')][_0x3366('0x1f')]);_0x44b472[_0x3366('0x1d')]=qs['offset'](_0x3c9324[_0x3366('0x32')]['offset']);}return _0x4a68a0['getConfigurations'](_0x44b472);}})['then'](function(_0x301b0a){if(_0x301b0a){return _0x301b0a?{'count':_0x315bfc,'rows':_0x301b0a}:null;}})['then'](respondWithResult(_0x692f7c,null))[_0x3366('0x43')](handleError(_0x692f7c,null));};exports[_0x3366('0x4e')]=function(_0x40552c,_0x4fcf20,_0x53c3ce){if(_0x40552c['body']['id']){delete _0x40552c[_0x3366('0x48')]['id'];}return db['Dynamics365Account'][_0x3366('0x4f')]({'where':{'id':_0x40552c[_0x3366('0x45')]['id']}})[_0x3366('0x26')](handleEntityNotFound(_0x4fcf20,null))[_0x3366('0x26')](function(_0x173c1c){if(_0x173c1c){_0x40552c[_0x3366('0x48')]['AccountId']=_0x173c1c['id'];_0x40552c[_0x3366('0x48')][_0x3366('0x50')]=integrations['getSubjects'](_0x40552c[_0x3366('0x48')][_0x3366('0x51')],_0x40552c[_0x3366('0x48')][_0x3366('0x52')]);_0x40552c[_0x3366('0x48')]['Descriptions']=integrations[_0x3366('0x53')](_0x40552c[_0x3366('0x48')][_0x3366('0x51')],_0x40552c[_0x3366('0x48')][_0x3366('0x52')]);return db[_0x3366('0x4b')][_0x3366('0x47')](_0x40552c['body'],{'include':[{'model':db[_0x3366('0x54')],'as':'Subjects'},{'model':db[_0x3366('0x54')],'as':_0x3366('0x55')}]});}return null;})[_0x3366('0x26')](respondWithResult(_0x4fcf20,null))[_0x3366('0x43')](handleError(_0x4fcf20,null));};exports[_0x3366('0x56')]=function(_0x3eedf4,_0x2d660c,_0x49e83f){var _0x3706d2=_0x3eedf4[_0x3366('0x32')][_0x3366('0x57')];var _0x2350ec=_0x3706d2==='incident'?'Incident':_0x3366('0x58');var _0x2c4dec='';var _0xd3a695='';var _0x3b33ac='';var _0x31133c='';var _0x338f51='';var _0x47781e='';var _0xd8b23c='';var _0x4810f0='';var _0x47a547=[_0x3366('0x59'),_0x3366('0x5a'),_0x3366('0x5b'),'ownerid','caseorigincode',_0x3366('0x5c'),'phonenumber',_0x3366('0x5d'),'directioncode',_0x3366('0x5e')];var _0x2731bb=[_0x3366('0x5f'),_0x3366('0x60'),'actualserviceunits','billedserviceunits','contactidname','contactidyominame',_0x3366('0x61'),_0x3366('0x62'),_0x3366('0x63'),_0x3366('0x64'),'createdbyname','createdbyyominame',_0x3366('0x65'),_0x3366('0x66'),'createdonbehalfbyyominame',_0x3366('0x67'),_0x3366('0x68'),_0x3366('0x69'),_0x3366('0x6a'),'entitlementidname','entityimage_timestamp',_0x3366('0x6b'),'escalatedon',_0x3366('0x6c'),_0x3366('0x6d'),_0x3366('0x6e'),_0x3366('0x6f'),_0x3366('0x70'),_0x3366('0x71'),_0x3366('0x72'),_0x3366('0x73'),_0x3366('0x74'),_0x3366('0x75'),_0x3366('0x76'),_0x3366('0x77'),_0x3366('0x78'),_0x3366('0x79'),_0x3366('0x7a'),_0x3366('0x7b'),'msdyn_iotalertname',_0x3366('0x7c'),_0x3366('0x7d'),_0x3366('0x7e'),'owneridname',_0x3366('0x7f'),_0x3366('0x80'),_0x3366('0x81'),_0x3366('0x82'),_0x3366('0x83'),'prioritycodename','productidname',_0x3366('0x84'),_0x3366('0x85'),_0x3366('0x86'),'responseby',_0x3366('0x87'),'responsiblecontactidyominame',_0x3366('0x88'),'slainvokedidname','slaname',_0x3366('0x89'),_0x3366('0x8a'),_0x3366('0x8b'),_0x3366('0x8c'),_0x3366('0x8d'),_0x3366('0x8e'),_0x3366('0x8f'),_0x3366('0x90'),_0x3366('0x91'),_0x3366('0x92')];var _0x5328a6=_0x47a547[_0x3366('0x93')](_0x2731bb);return db[_0x3366('0x2d')][_0x3366('0x4f')]({'where':{'id':_0x3eedf4[_0x3366('0x45')]['id']},'attributes':['id',_0x3366('0x94'),_0x3366('0x95'),_0x3366('0x96'),'tenantId',_0x3366('0x97'),_0x3366('0x98')]})[_0x3366('0x26')](handleEntityNotFound(_0x2d660c,null))[_0x3366('0x26')](function(_0x47a4b9){if(_0x47a4b9){_0x4810f0=_0x47a4b9[_0x3366('0x96')];var _0x2c5023=_0x4810f0['slice'](-0x1);if(_0x2c5023==='/'){_0x4810f0=_0x4810f0[_0x3366('0x99')](0x0,_0x4810f0['lastIndexOf'](_0x2c5023));}_0xd8b23c=util['format']('%s/api/data/v9.0/',_0x4810f0);var _0x2008bb={'method':'POST','uri':_0x3366('0x9a')+_0x47a4b9[_0x3366('0x9b')]+'/oauth2/token','form':{'client_id':_0x47a4b9[_0x3366('0x97')],'resource':_0x4810f0,'username':_0x47a4b9['username'],'password':_0x47a4b9[_0x3366('0x95')],'grant_type':'password','client_secret':_0x47a4b9[_0x3366('0x98')]},'json':!![]};return rp(_0x2008bb);}})['then'](function(_0x289a08){_0x47781e=_0x289a08[_0x3366('0x9c')];var _0x512a3b={'method':_0x3366('0x9d'),'uri':encodeURI(_0xd8b23c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2350ec+'\x27'),'headers':{'Authorization':_0x3366('0x9e')+_0x47781e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x512a3b);})[_0x3366('0x26')](function(_0x26c85a){var _0x1c4a0b=_0x26c85a[_0x3366('0x9f')][0x0];var _0x21dbd1=_0x1c4a0b['MetadataId'];var _0x5ba5fd={'method':_0x3366('0x9d'),'uri':_0xd8b23c+_0x3366('0xa0')+_0x21dbd1+_0x3366('0xa1'),'headers':{'Authorization':_0x3366('0x9e')+_0x47781e,'If-None-Match':null,'OData-Version':_0x3366('0xa2')},'json':!![]};return rp(_0x5ba5fd);})[_0x3366('0x26')](function(_0x377dfd){_0x2c4dec=_0x377dfd;_0xd3a695=_0x2c4dec[_0x3366('0xa3')];_0xd3a695=_[_0x3366('0xa4')](_0xd3a695,function(_0x434c7b){return!_0x5328a6[_0x3366('0xa5')](_0x434c7b[_0x3366('0xa6')]);});var _0x36b677=[];var _0x1c4480=[];_0xd3a695[_0x3366('0xa7')](function(_0x5eb4a5){if(_0x5eb4a5[_0x3366('0xa8')]){var _0x1b6742=_0x5eb4a5['@odata.type'][_0x3366('0x99')](_0x5eb4a5[_0x3366('0xa8')][_0x3366('0xa9')]('.')+0x1);if(_0x1b6742===_0x3366('0xaa')){_0x36b677[_0x3366('0xab')](getSelectList(_0xd8b23c,_0x3706d2,_0x1c4480,_0x2c4dec[_0x3366('0xac')],_0x5eb4a5[_0x3366('0xac')],_0x47781e));}}});return Promise['all'](_0x36b677);})[_0x3366('0x26')](function(_0x83b702){_0x3b33ac=_0x83b702[0x0];var _0x48c0ad=[];var _0x3a8cdc=[];_0xd3a695[_0x3366('0xa7')](function(_0x53f76e){if(!_[_0x3366('0xad')](_0x53f76e[_0x3366('0xa8')])){var _0x3f1cfb=_0x53f76e[_0x3366('0xa8')][_0x3366('0x99')](_0x53f76e[_0x3366('0xa8')][_0x3366('0xa9')]('.')+0x1);if(_0x3f1cfb===_0x3366('0xae')){_0x48c0ad[_0x3366('0xab')](getBooleanList(_0xd8b23c,_0x3706d2,_0x3a8cdc,_0x2c4dec['MetadataId'],_0x53f76e[_0x3366('0xac')],_0x47781e));}}});return Promise[_0x3366('0xaf')](_0x48c0ad);})[_0x3366('0x26')](function(_0x5f12ea){_0x31133c=_0x5f12ea[0x0];var _0x2a149b=[];var _0x41a779=[];_0xd3a695['forEach'](function(_0x53f5c7){if(_0x53f5c7[_0x3366('0xa8')]){var _0x3f6995=_0x53f5c7[_0x3366('0xa8')][_0x3366('0x99')](_0x53f5c7[_0x3366('0xa8')][_0x3366('0xa9')]('.')+0x1);if(_0x3f6995===_0x3366('0xb0')||_0x3f6995===_0x3366('0xb1')||_0x3f6995==='BigIntAttributeMetadata'||_0x3f6995===_0x3366('0xb2')||_0x3f6995===_0x3366('0xb3')||_0x3f6995==='DateTimeAttributeMetadata'||_0x3f6995===_0x3366('0xb4')||_0x3f6995===_0x3366('0xb5')||_0x3f6995===_0x3366('0xb6')||_0x3f6995===_0x3366('0xb7')){_0x2a149b[_0x3366('0xab')](getInputList(_0xd8b23c,_0x3706d2,_0x3f6995,_0x41a779,_0x2c4dec['MetadataId'],_0x53f5c7[_0x3366('0xac')],_0x47781e));}}});return Promise[_0x3366('0xaf')](_0x2a149b);})['then'](function(_0x56630e){_0x338f51=_0x56630e[0x0];var _0x3d5a57=_0x3b33ac['concat'](_0x31133c)[_0x3366('0x93')](_0x338f51);var _0x299252={'count':_0x3d5a57[_0x3366('0x36')],'rows':_0x3d5a57};return _0x299252;})[_0x3366('0x26')](respondWithResult(_0x2d660c,null))[_0x3366('0x43')](function(_0x21c228){var _0x22c0e5=_0x3eedf4[_0x3366('0x32')][_0x3366('0xb8')]?0x1f4:_0x21c228[_0x3366('0xb9')]||0x1f4;logger[_0x3366('0x28')](_0x21c228['stack']);delete _0x21c228['name'];if(_0x22c0e5===0x191){_0x22c0e5=0x190;}_0x2d660c[_0x3366('0x1b')](_0x22c0e5)[_0x3366('0xba')](_0x3eedf4['query'][_0x3366('0xb8')]?{'message':'Wrong\x20credentials','statusCode':_0x21c228[_0x3366('0xb9')]}:_0x21c228);});};function getSelectList(_0x107277,_0x3053fa,_0x37058f,_0x4ec7e6,_0x2fac26,_0x13bed){var _0x4759d5={'method':'GET','uri':_0x107277+'EntityDefinitions('+_0x4ec7e6+_0x3366('0xbb')+_0x2fac26+_0x3366('0xbc')+_0x3366('0xbd'),'headers':{'Authorization':_0x3366('0x9e')+_0x13bed,'If-None-Match':null,'OData-Version':_0x3366('0xa2')},'json':!![]};return rp(_0x4759d5)[_0x3366('0x26')](function(_0x51cb63){var _0xda58ba=[];var _0x173b8e=_0x51cb63[_0x3366('0xbe')][_0x3366('0xbf')];_0x173b8e[_0x3366('0xa7')](function(_0x3c9df6){_0xda58ba[_0x3366('0xab')]({'name':_0x3c9df6[_0x3366('0xc0')][_0x3366('0xc1')]['Label'],'value':String(_0x3c9df6['Value'])});});var _0x212ddd={'id':_0x3053fa+'_'+_0x51cb63[_0x3366('0xa6')],'name':_0x51cb63['DisplayName'][_0x3366('0xc1')][_0x3366('0xc0')],'custom':![],'options':_0xda58ba};_0x37058f['push'](_0x212ddd);return _0x37058f;});}function getBooleanList(_0x11b793,_0x115760,_0x1959d6,_0x15b04c,_0x2ca51c,_0x525680){var _0x79d292={'method':_0x3366('0x9d'),'uri':_0x11b793+_0x3366('0xa0')+_0x15b04c+')/Attributes('+_0x2ca51c+_0x3366('0xc2'),'headers':{'Authorization':_0x3366('0x9e')+_0x525680,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x79d292)[_0x3366('0x26')](function(_0x55a180){var _0x339d2c=[];_0x339d2c[_0x3366('0xab')]({'name':_0x55a180[_0x3366('0xbe')][_0x3366('0xc3')]['Label']['UserLocalizedLabel'][_0x3366('0xc0')],'value':_0x3366('0xc4')},{'name':_0x55a180[_0x3366('0xbe')][_0x3366('0xc5')]['Label'][_0x3366('0xc1')][_0x3366('0xc0')],'value':_0x3366('0xc6')});var _0x3de2b1={'id':_0x115760+'_'+_0x55a180[_0x3366('0xa6')],'name':_0x55a180[_0x3366('0xc7')]['UserLocalizedLabel'][_0x3366('0xc0')],'custom':![],'options':_0x339d2c};_0x1959d6[_0x3366('0xab')](_0x3de2b1);return _0x1959d6;});}function getInputList(_0x4fa013,_0x4ed6b0,_0x1ef553,_0x53806a,_0x39e130,_0x104ec8,_0x53a26f){var _0x52be07={'method':_0x3366('0x9d'),'uri':_0x4fa013+_0x3366('0xa0')+_0x39e130+_0x3366('0xbb')+_0x104ec8+_0x3366('0xc8')+_0x1ef553+_0x3366('0xc9'),'headers':{'Authorization':_0x3366('0x9e')+_0x53a26f,'If-None-Match':null,'OData-Version':_0x3366('0xa2')},'json':!![]};return rp(_0x52be07)[_0x3366('0x26')](function(_0x131a20){var _0x5d9007={'id':_0x4ed6b0+'_'+_0x131a20[_0x3366('0xa6')],'name':_0x131a20[_0x3366('0xc7')]['UserLocalizedLabel']?_0x131a20[_0x3366('0xc7')][_0x3366('0xc1')][_0x3366('0xc0')]:_0x131a20[_0x3366('0xa6')],'custom':![],'options':[]};_0x53806a[_0x3366('0xab')](_0x5d9007);return _0x53806a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2f82371..eb54fab 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d7961,_0x476e27){var _0x588f09=function(_0x242806){while(--_0x242806){_0x5d7961['push'](_0x5d7961['shift']());}};_0x588f09(++_0x476e27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x53ae6d,_0x459c2c){var _0x527cb6=function(_0x5eb228){while(--_0x5eb228){_0x53ae6d['push'](_0x53ae6d['shift']());}};_0x527cb6(++_0x459c2c);}(_0xe706,0xa3));var _0x6e70=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xe706[_0x32cd29];return _0x2f7e6e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 97cd6d1..d1ebe06 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 _0xbb34=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowDynamics365Account','util','moment','bluebird','randomstring'];(function(_0x3a05a6,_0x5a2916){var _0x55a922=function(_0x333dd2){while(--_0x333dd2){_0x3a05a6['push'](_0x3a05a6['shift']());}};_0x55a922(++_0x5a2916);}(_0xbb34,0x1ca));var _0x4bb3=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0xbb34[_0x1fc84d];return _0x2658fa;};'use strict';var _=require('lodash');var util=require(_0x4bb3('0x0'));var moment=require(_0x4bb3('0x1'));var BPromise=require(_0x4bb3('0x2'));var rs=require(_0x4bb3('0x3'));var fs=require('fs');var Redis=require(_0x4bb3('0x4'));var db=require(_0x4bb3('0x5'))['db'];var utils=require(_0x4bb3('0x6'));var logger=require(_0x4bb3('0x7'))(_0x4bb3('0x8'));var config=require(_0x4bb3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38eaf2,_0x1dd0a6,_0x42f977){return new BPromise(function(_0x35e7ec,_0x205a56){return client[_0x4bb3('0xb')](_0x38eaf2,_0x42f977)[_0x4bb3('0xc')](function(_0x5ebcaf){logger[_0x4bb3('0xd')](_0x4bb3('0xe'),_0x1dd0a6,_0x4bb3('0xf'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1dd0a6,_0x4bb3('0xf'),JSON['stringify'](_0x5ebcaf));if(_0x5ebcaf[_0x4bb3('0x10')]){if(_0x5ebcaf[_0x4bb3('0x10')][_0x4bb3('0x11')]===0x1f4){logger[_0x4bb3('0x10')](_0x4bb3('0xe'),_0x1dd0a6,_0x5ebcaf['error'][_0x4bb3('0x12')]);return _0x205a56(_0x5ebcaf['error'][_0x4bb3('0x12')]);}logger[_0x4bb3('0x10')](_0x4bb3('0xe'),_0x1dd0a6,_0x5ebcaf[_0x4bb3('0x10')]['message']);return _0x35e7ec(_0x5ebcaf[_0x4bb3('0x10')][_0x4bb3('0x12')]);}else{logger[_0x4bb3('0xd')](_0x4bb3('0xe'),_0x1dd0a6,_0x4bb3('0xf'));_0x35e7ec(_0x5ebcaf['result'][_0x4bb3('0x12')]);}})[_0x4bb3('0x13')](function(_0x466837){logger['error'](_0x4bb3('0xe'),_0x1dd0a6,_0x466837);_0x205a56(_0x466837);});});}exports[_0x4bb3('0x14')]=function(_0x129c63){var _0x364f86=this;return new Promise(function(_0xab98ab,_0x3c2109){return db[_0x4bb3('0x15')]['findAll']({'raw':_0x129c63[_0x4bb3('0x16')]?_0x129c63['options'][_0x4bb3('0x17')]===undefined?!![]:![]:!![],'where':_0x129c63[_0x4bb3('0x16')]?_0x129c63[_0x4bb3('0x16')][_0x4bb3('0x18')]||null:null,'attributes':_0x129c63[_0x4bb3('0x16')]?_0x129c63[_0x4bb3('0x16')][_0x4bb3('0x19')]||null:null,'limit':_0x129c63['options']?_0x129c63['options'][_0x4bb3('0x1a')]||null:null,'include':_0x129c63[_0x4bb3('0x16')]?_0x129c63[_0x4bb3('0x16')][_0x4bb3('0x1b')]?_[_0x4bb3('0x1c')](_0x129c63['options'][_0x4bb3('0x1b')],function(_0x398314){return{'model':db[_0x398314[_0x4bb3('0x1d')]],'as':_0x398314['as'],'attributes':_0x398314[_0x4bb3('0x19')],'include':_0x398314[_0x4bb3('0x1b')]?_['map'](_0x398314['include'],function(_0x42fc1c){return{'model':db[_0x42fc1c[_0x4bb3('0x1d')]],'as':_0x42fc1c['as'],'attributes':_0x42fc1c['attributes'],'include':_0x42fc1c[_0x4bb3('0x1b')]?_['map'](_0x42fc1c[_0x4bb3('0x1b')],function(_0x2518f8){return{'model':db[_0x2518f8['model']],'as':_0x2518f8['as'],'attributes':_0x2518f8[_0x4bb3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4bb3('0xc')](function(_0x355479){logger[_0x4bb3('0xd')](_0x4bb3('0x14'),_0x129c63);logger[_0x4bb3('0x1e')](_0x4bb3('0x14'),_0x129c63,JSON[_0x4bb3('0x1f')](_0x355479));_0xab98ab(_0x355479);})[_0x4bb3('0x13')](function(_0x180f05){logger[_0x4bb3('0x10')]('GetDynamics365Account',_0x180f05[_0x4bb3('0x12')],_0x129c63);_0x3c2109(_0x364f86['error'](0x1f4,_0x180f05['message']));});});};exports['ShowDynamics365Account']=function(_0x25538f){var _0x122047=this;return new Promise(function(_0xb03d38,_0x44e6d0){return db[_0x4bb3('0x15')]['find']({'raw':_0x25538f[_0x4bb3('0x16')]?_0x25538f[_0x4bb3('0x16')][_0x4bb3('0x17')]===undefined?!![]:![]:!![],'where':_0x25538f[_0x4bb3('0x16')]?_0x25538f[_0x4bb3('0x16')][_0x4bb3('0x18')]||null:null,'attributes':_0x25538f[_0x4bb3('0x16')]?_0x25538f['options'][_0x4bb3('0x19')]||null:null,'include':_0x25538f[_0x4bb3('0x16')]?_0x25538f['options'][_0x4bb3('0x1b')]?_[_0x4bb3('0x1c')](_0x25538f[_0x4bb3('0x16')][_0x4bb3('0x1b')],function(_0xf8d850){return{'model':db[_0xf8d850[_0x4bb3('0x1d')]],'as':_0xf8d850['as'],'attributes':_0xf8d850[_0x4bb3('0x19')],'include':_0xf8d850['include']?_['map'](_0xf8d850[_0x4bb3('0x1b')],function(_0x3cf97e){return{'model':db[_0x3cf97e[_0x4bb3('0x1d')]],'as':_0x3cf97e['as'],'attributes':_0x3cf97e[_0x4bb3('0x19')],'include':_0x3cf97e[_0x4bb3('0x1b')]?_[_0x4bb3('0x1c')](_0x3cf97e[_0x4bb3('0x1b')],function(_0xf4479e){return{'model':db[_0xf4479e[_0x4bb3('0x1d')]],'as':_0xf4479e['as'],'attributes':_0xf4479e[_0x4bb3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4bb3('0xc')](function(_0x3938f4){logger[_0x4bb3('0xd')]('ShowDynamics365Account',_0x25538f);logger[_0x4bb3('0x1e')]('ShowDynamics365Account',_0x25538f,JSON[_0x4bb3('0x1f')](_0x3938f4));_0xb03d38(_0x3938f4);})[_0x4bb3('0x13')](function(_0x5de9a7){logger[_0x4bb3('0x10')](_0x4bb3('0x20'),_0x5de9a7[_0x4bb3('0x12')],_0x25538f);_0x44e6d0(_0x122047['error'](0x1f4,_0x5de9a7[_0x4bb3('0x12')]));});});}; \ No newline at end of file +var _0xa4e0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','map','include','model','info','find','ShowDynamics365Account','lodash','util','moment'];(function(_0x1f52ea,_0x1dd436){var _0x2d4b16=function(_0x3cee20){while(--_0x3cee20){_0x1f52ea['push'](_0x1f52ea['shift']());}};_0x2d4b16(++_0x1dd436);}(_0xa4e0,0x189));var _0x0a4e=function(_0x57c1be,_0x1fa863){_0x57c1be=_0x57c1be-0x0;var _0x2674b7=_0xa4e0[_0x57c1be];return _0x2674b7;};'use strict';var _=require(_0x0a4e('0x0'));var util=require(_0x0a4e('0x1'));var moment=require(_0x0a4e('0x2'));var BPromise=require(_0x0a4e('0x3'));var rs=require(_0x0a4e('0x4'));var fs=require('fs');var Redis=require(_0x0a4e('0x5'));var db=require(_0x0a4e('0x6'))['db'];var utils=require(_0x0a4e('0x7'));var logger=require(_0x0a4e('0x8'))(_0x0a4e('0x9'));var config=require(_0x0a4e('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0a4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47d389,_0x2a29cb,_0x1f6b75){return new BPromise(function(_0x507444,_0x14501d){return client[_0x0a4e('0xc')](_0x47d389,_0x1f6b75)[_0x0a4e('0xd')](function(_0x300b2d){logger['info'](_0x0a4e('0xe'),_0x2a29cb,'request\x20sent');logger[_0x0a4e('0xf')](_0x0a4e('0x10'),_0x2a29cb,_0x0a4e('0x11'),JSON[_0x0a4e('0x12')](_0x300b2d));if(_0x300b2d[_0x0a4e('0x13')]){if(_0x300b2d[_0x0a4e('0x13')]['code']===0x1f4){logger[_0x0a4e('0x13')](_0x0a4e('0xe'),_0x2a29cb,_0x300b2d['error'][_0x0a4e('0x14')]);return _0x14501d(_0x300b2d['error'][_0x0a4e('0x14')]);}logger['error'](_0x0a4e('0xe'),_0x2a29cb,_0x300b2d[_0x0a4e('0x13')][_0x0a4e('0x14')]);return _0x507444(_0x300b2d[_0x0a4e('0x13')][_0x0a4e('0x14')]);}else{logger['info'](_0x0a4e('0xe'),_0x2a29cb,_0x0a4e('0x11'));_0x507444(_0x300b2d[_0x0a4e('0x15')][_0x0a4e('0x14')]);}})[_0x0a4e('0x16')](function(_0x3d1491){logger[_0x0a4e('0x13')](_0x0a4e('0xe'),_0x2a29cb,_0x3d1491);_0x14501d(_0x3d1491);});});}exports[_0x0a4e('0x17')]=function(_0x135b38){var _0x216d09=this;return new Promise(function(_0x2b2c2a,_0x34e5db){return db[_0x0a4e('0x18')]['findAll']({'raw':_0x135b38[_0x0a4e('0x19')]?_0x135b38[_0x0a4e('0x19')][_0x0a4e('0x1a')]===undefined?!![]:![]:!![],'where':_0x135b38[_0x0a4e('0x19')]?_0x135b38[_0x0a4e('0x19')][_0x0a4e('0x1b')]||null:null,'attributes':_0x135b38[_0x0a4e('0x19')]?_0x135b38[_0x0a4e('0x19')][_0x0a4e('0x1c')]||null:null,'limit':_0x135b38['options']?_0x135b38['options'][_0x0a4e('0x1d')]||null:null,'include':_0x135b38[_0x0a4e('0x19')]?_0x135b38[_0x0a4e('0x19')]['include']?_[_0x0a4e('0x1e')](_0x135b38[_0x0a4e('0x19')][_0x0a4e('0x1f')],function(_0x55ab6f){return{'model':db[_0x55ab6f[_0x0a4e('0x20')]],'as':_0x55ab6f['as'],'attributes':_0x55ab6f[_0x0a4e('0x1c')],'include':_0x55ab6f[_0x0a4e('0x1f')]?_['map'](_0x55ab6f[_0x0a4e('0x1f')],function(_0x4c7526){return{'model':db[_0x4c7526[_0x0a4e('0x20')]],'as':_0x4c7526['as'],'attributes':_0x4c7526[_0x0a4e('0x1c')],'include':_0x4c7526[_0x0a4e('0x1f')]?_['map'](_0x4c7526['include'],function(_0x948817){return{'model':db[_0x948817[_0x0a4e('0x20')]],'as':_0x948817['as'],'attributes':_0x948817[_0x0a4e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0a4e('0xd')](function(_0x2de7c7){logger[_0x0a4e('0x21')](_0x0a4e('0x17'),_0x135b38);logger[_0x0a4e('0xf')](_0x0a4e('0x17'),_0x135b38,JSON['stringify'](_0x2de7c7));_0x2b2c2a(_0x2de7c7);})[_0x0a4e('0x16')](function(_0x54a06b){logger[_0x0a4e('0x13')](_0x0a4e('0x17'),_0x54a06b[_0x0a4e('0x14')],_0x135b38);_0x34e5db(_0x216d09[_0x0a4e('0x13')](0x1f4,_0x54a06b[_0x0a4e('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x2f6565){var _0x3e3c02=this;return new Promise(function(_0x5d21c5,_0x51699a){return db[_0x0a4e('0x18')][_0x0a4e('0x22')]({'raw':_0x2f6565[_0x0a4e('0x19')]?_0x2f6565['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f6565[_0x0a4e('0x19')]?_0x2f6565['options']['where']||null:null,'attributes':_0x2f6565[_0x0a4e('0x19')]?_0x2f6565[_0x0a4e('0x19')]['attributes']||null:null,'include':_0x2f6565[_0x0a4e('0x19')]?_0x2f6565['options']['include']?_[_0x0a4e('0x1e')](_0x2f6565[_0x0a4e('0x19')][_0x0a4e('0x1f')],function(_0xa7aeb5){return{'model':db[_0xa7aeb5[_0x0a4e('0x20')]],'as':_0xa7aeb5['as'],'attributes':_0xa7aeb5[_0x0a4e('0x1c')],'include':_0xa7aeb5[_0x0a4e('0x1f')]?_[_0x0a4e('0x1e')](_0xa7aeb5[_0x0a4e('0x1f')],function(_0x3b4d4d){return{'model':db[_0x3b4d4d[_0x0a4e('0x20')]],'as':_0x3b4d4d['as'],'attributes':_0x3b4d4d['attributes'],'include':_0x3b4d4d['include']?_[_0x0a4e('0x1e')](_0x3b4d4d[_0x0a4e('0x1f')],function(_0x47f010){return{'model':db[_0x47f010['model']],'as':_0x47f010['as'],'attributes':_0x47f010[_0x0a4e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x353e7d){logger[_0x0a4e('0x21')](_0x0a4e('0x23'),_0x2f6565);logger[_0x0a4e('0xf')](_0x0a4e('0x23'),_0x2f6565,JSON[_0x0a4e('0x12')](_0x353e7d));_0x5d21c5(_0x353e7d);})[_0x0a4e('0x16')](function(_0x3e6555){logger[_0x0a4e('0x13')](_0x0a4e('0x23'),_0x3e6555['message'],_0x2f6565);_0x51699a(_0x3e3c02['error'](0x1f4,_0x3e6555[_0x0a4e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0dc27e5..1070bb2 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 _0xfdad=['fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3b61a3,_0x55b167){var _0x5d76e3=function(_0x2f27ff){while(--_0x2f27ff){_0x3b61a3['push'](_0x3b61a3['shift']());}};_0x5d76e3(++_0x55b167);}(_0xfdad,0x164));var _0xdfda=function(_0x3ee1c3,_0x5a7eff){_0x3ee1c3=_0x3ee1c3-0x0;var _0x5243ce=_0xfdad[_0x3ee1c3];return _0x5243ce;};'use strict';var multer=require(_0xdfda('0x0'));var util=require(_0xdfda('0x1'));var path=require('path');var timeout=require(_0xdfda('0x2'));var express=require(_0xdfda('0x3'));var router=express['Router']();var fs_extra=require(_0xdfda('0x4'));var auth=require(_0xdfda('0x5'));var interaction=require(_0xdfda('0x6'));var config=require('../../config/environment');var controller=require(_0xdfda('0x7'));router[_0xdfda('0x8')]('/',auth['isAuthenticated'](),controller[_0xdfda('0x9')]);router[_0xdfda('0x8')](_0xdfda('0xa'),auth[_0xdfda('0xb')](),controller[_0xdfda('0xc')]);router[_0xdfda('0x8')](_0xdfda('0xd'),auth[_0xdfda('0xb')](),controller[_0xdfda('0xe')]);router[_0xdfda('0x8')](_0xdfda('0xf'),auth[_0xdfda('0xb')](),controller[_0xdfda('0x10')]);router[_0xdfda('0x8')](_0xdfda('0x11'),auth[_0xdfda('0xb')](),controller['getDescriptions']);router[_0xdfda('0x12')]('/',auth[_0xdfda('0xb')](),controller[_0xdfda('0x13')]);router[_0xdfda('0x14')](_0xdfda('0xa'),auth['isAuthenticated'](),controller[_0xdfda('0x15')]);router['delete']('/:id',auth[_0xdfda('0xb')](),controller[_0xdfda('0x16')]);module[_0xdfda('0x17')]=router; \ No newline at end of file +var _0xa1d0=['/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xa1d0,0x1a4));var _0x0a1d=function(_0x4a3361,_0x16ad3b){_0x4a3361=_0x4a3361-0x0;var _0x5ddfae=_0xa1d0[_0x4a3361];return _0x5ddfae;};'use strict';var multer=require(_0x0a1d('0x0'));var util=require('util');var path=require(_0x0a1d('0x1'));var timeout=require('connect-timeout');var express=require(_0x0a1d('0x2'));var router=express[_0x0a1d('0x3')]();var fs_extra=require(_0x0a1d('0x4'));var auth=require(_0x0a1d('0x5'));var interaction=require(_0x0a1d('0x6'));var config=require(_0x0a1d('0x7'));var controller=require(_0x0a1d('0x8'));router[_0x0a1d('0x9')]('/',auth[_0x0a1d('0xa')](),controller[_0x0a1d('0xb')]);router[_0x0a1d('0x9')](_0x0a1d('0xc'),auth[_0x0a1d('0xa')](),controller[_0x0a1d('0xd')]);router[_0x0a1d('0x9')]('/:id/fields',auth[_0x0a1d('0xa')](),controller[_0x0a1d('0xe')]);router[_0x0a1d('0x9')](_0x0a1d('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0a1d('0x9')](_0x0a1d('0x10'),auth[_0x0a1d('0xa')](),controller[_0x0a1d('0x11')]);router[_0x0a1d('0x12')]('/',auth[_0x0a1d('0xa')](),controller[_0x0a1d('0x13')]);router['put'](_0x0a1d('0xc'),auth[_0x0a1d('0xa')](),controller[_0x0a1d('0x14')]);router[_0x0a1d('0x15')]('/:id',auth[_0x0a1d('0xa')](),controller[_0x0a1d('0x16')]);module[_0x0a1d('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 3e91bbf..e97d091 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 _0xddfe=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x5edf7e,_0x50b407){var _0x1817f8=function(_0x3807b2){while(--_0x3807b2){_0x5edf7e['push'](_0x5edf7e['shift']());}};_0x1817f8(++_0x50b407);}(_0xddfe,0x166));var _0xeddf=function(_0xbf6f1a,_0xad91a2){_0xbf6f1a=_0xbf6f1a-0x0;var _0x2fb14a=_0xddfe[_0xbf6f1a];return _0x2fb14a;};'use strict';var Sequelize=require(_0xeddf('0x0'));module[_0xeddf('0x1')]={'name':{'type':Sequelize[_0xeddf('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xeddf('0x3')](_0xeddf('0x4'),_0xeddf('0x5')),'defaultValue':_0xeddf('0x4')}}; \ No newline at end of file +var _0xb2fe=['exports','STRING','ENUM','incident','phonecall','sequelize'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0xb2fe,0x149));var _0xeb2f=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xb2fe[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0xeb2f('0x0'));module[_0xeb2f('0x1')]={'name':{'type':Sequelize[_0xeb2f('0x2')]},'description':{'type':Sequelize[_0xeb2f('0x2')]},'ticketType':{'type':Sequelize[_0xeb2f('0x3')](_0xeb2f('0x4'),_0xeb2f('0x5')),'defaultValue':_0xeb2f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 325142c..eb606f1 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 _0x2b3e=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','then','findAll','rows','catch','show','keys','include','find','create','body','params','findOne','filter','getFields','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x449c94,_0x32f6ac){var _0x19aee3=function(_0x10ae90){while(--_0x10ae90){_0x449c94['push'](_0x449c94['shift']());}};_0x19aee3(++_0x32f6ac);}(_0x2b3e,0x181));var _0xe2b3=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2b3e[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xe2b3('0x0'));var rimraf=require(_0xe2b3('0x1'));var zipdir=require(_0xe2b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2b3('0x3'));var moment=require(_0xe2b3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe2b3('0x5'));var path=require(_0xe2b3('0x6'));var sox=require('sox');var csv=require(_0xe2b3('0x7'));var ejs=require(_0xe2b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe2b3('0x9'));var crypto=require(_0xe2b3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe2b3('0xb'));var toCsv=require(_0xe2b3('0x7'));var querystring=require('querystring');var Papa=require(_0xe2b3('0xc'));var Redis=require('ioredis');var authService=require(_0xe2b3('0xd'));var qs=require(_0xe2b3('0xe'));var as=require(_0xe2b3('0xf'));var hardwareService=require(_0xe2b3('0x10'));var logger=require(_0xe2b3('0x11'))(_0xe2b3('0x12'));var utils=require(_0xe2b3('0x13'));var config=require(_0xe2b3('0x14'));var licenseUtil=require(_0xe2b3('0x15'));var db=require(_0xe2b3('0x16'))['db'];function respondWithStatusCode(_0x26dd0f,_0x7f9b1c){_0x7f9b1c=_0x7f9b1c||0xcc;return function(_0x3b54af){if(_0x3b54af){return _0x26dd0f[_0xe2b3('0x17')](_0x7f9b1c);}return _0x26dd0f[_0xe2b3('0x18')](_0x7f9b1c)[_0xe2b3('0x19')]();};}function respondWithResult(_0x1996a5,_0xa3beb5){_0xa3beb5=_0xa3beb5||0xc8;return function(_0x54e6f8){if(_0x54e6f8){return _0x1996a5[_0xe2b3('0x18')](_0xa3beb5)[_0xe2b3('0x1a')](_0x54e6f8);}};}function respondWithFilteredResult(_0x3518d5,_0x3e47c2){return function(_0x152894){if(_0x152894){var _0xacbed7=typeof _0x3e47c2[_0xe2b3('0x1b')]==='undefined'&&typeof _0x3e47c2[_0xe2b3('0x1c')]===_0xe2b3('0x1d');var _0x5cf5b7=_0x152894[_0xe2b3('0x1e')];var _0x4daece=_0xacbed7?0x0:_0x3e47c2[_0xe2b3('0x1b')];var _0x577175=_0xacbed7?_0x152894[_0xe2b3('0x1e')]:_0x3e47c2[_0xe2b3('0x1b')]+_0x3e47c2['limit'];var _0x65476f;if(_0x577175>=_0x5cf5b7){_0x577175=_0x5cf5b7;_0x65476f=0xc8;}else{_0x65476f=0xce;}_0x3518d5[_0xe2b3('0x18')](_0x65476f);return _0x3518d5[_0xe2b3('0x1f')]('Content-Range',_0x4daece+'-'+_0x577175+'/'+_0x5cf5b7)['json'](_0x152894);}return null;};}function patchUpdates(_0x5a746c){return function(_0x553f1a){try{jsonpatch[_0xe2b3('0x20')](_0x553f1a,_0x5a746c,!![]);}catch(_0x43123e){return BPromise[_0xe2b3('0x21')](_0x43123e);}return _0x553f1a[_0xe2b3('0x22')]();};}function saveUpdates(_0x336e2b,_0x4cd820){return function(_0x4f3c79){if(_0x4f3c79){return _0x4f3c79[_0xe2b3('0x23')](_0x336e2b)['then'](function(_0x4a5693){return _0x4a5693;});}return null;};}function removeEntity(_0x812ea6,_0x3fb291){return function(_0xc3dff9){if(_0xc3dff9){return _0xc3dff9[_0xe2b3('0x24')]()['then'](function(){_0x812ea6[_0xe2b3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368384,_0x48090e){return function(_0x1f6d0b){if(!_0x1f6d0b){_0x368384[_0xe2b3('0x17')](0x194);}return _0x1f6d0b;};}function handleError(_0x6ca71f,_0x50b87f){_0x50b87f=_0x50b87f||0x1f4;return function(_0x738050){logger[_0xe2b3('0x25')](_0x738050[_0xe2b3('0x26')]);if(_0x738050['name']){delete _0x738050[_0xe2b3('0x27')];}_0x6ca71f[_0xe2b3('0x18')](_0x50b87f)[_0xe2b3('0x28')](_0x738050);};}exports[_0xe2b3('0x29')]=function(_0x5bf5c3,_0x3a5f2e){var _0x3dc0fe={},_0x10aa34={},_0x400b21={'count':0x0,'rows':[]};var _0x54d343=_[_0xe2b3('0x2a')](db[_0xe2b3('0x2b')][_0xe2b3('0x2c')],function(_0x20f9d7){return{'name':_0x20f9d7[_0xe2b3('0x2d')],'type':_0x20f9d7[_0xe2b3('0x2e')]['key']};});_0x10aa34['model']=_[_0xe2b3('0x2a')](_0x54d343,_0xe2b3('0x27'));_0x10aa34[_0xe2b3('0x2f')]=_['keys'](_0x5bf5c3[_0xe2b3('0x2f')]);_0x10aa34['filters']=_[_0xe2b3('0x30')](_0x10aa34['model'],_0x10aa34[_0xe2b3('0x2f')]);_0x3dc0fe[_0xe2b3('0x31')]=_[_0xe2b3('0x30')](_0x10aa34['model'],qs[_0xe2b3('0x32')](_0x5bf5c3[_0xe2b3('0x2f')][_0xe2b3('0x32')]));_0x3dc0fe[_0xe2b3('0x31')]=_0x3dc0fe[_0xe2b3('0x31')][_0xe2b3('0x33')]?_0x3dc0fe['attributes']:_0x10aa34[_0xe2b3('0x34')];if(!_0x5bf5c3[_0xe2b3('0x2f')][_0xe2b3('0x35')](_0xe2b3('0x36'))){_0x3dc0fe[_0xe2b3('0x1c')]=qs[_0xe2b3('0x1c')](_0x5bf5c3[_0xe2b3('0x2f')]['limit']);_0x3dc0fe[_0xe2b3('0x1b')]=qs[_0xe2b3('0x1b')](_0x5bf5c3[_0xe2b3('0x2f')][_0xe2b3('0x1b')]);}_0x3dc0fe[_0xe2b3('0x37')]=qs['sort'](_0x5bf5c3[_0xe2b3('0x2f')][_0xe2b3('0x38')]);_0x3dc0fe[_0xe2b3('0x39')]=qs[_0xe2b3('0x3a')](_[_0xe2b3('0x3b')](_0x5bf5c3[_0xe2b3('0x2f')],_0x10aa34[_0xe2b3('0x3a')]),_0x54d343);if(_0x5bf5c3[_0xe2b3('0x2f')]['filter']){_0x3dc0fe[_0xe2b3('0x39')]=_[_0xe2b3('0x3c')](_0x3dc0fe[_0xe2b3('0x39')],{'$or':_[_0xe2b3('0x2a')](_0x54d343,function(_0x58b3a2){if(_0x58b3a2[_0xe2b3('0x2e')]!==_0xe2b3('0x3d')){var _0x50ef1f={};_0x50ef1f[_0x58b3a2['name']]={'$like':'%'+_0x5bf5c3[_0xe2b3('0x2f')]['filter']+'%'};return _0x50ef1f;}})});}_0x3dc0fe=_[_0xe2b3('0x3c')]({},_0x3dc0fe,_0x5bf5c3[_0xe2b3('0x3e')]);var _0x507b59={'where':_0x3dc0fe[_0xe2b3('0x39')]};return db['Dynamics365Configuration']['count'](_0x507b59)[_0xe2b3('0x3f')](function(_0xb3c755){_0x400b21['count']=_0xb3c755;if(_0x5bf5c3[_0xe2b3('0x2f')]['includeAll']){_0x3dc0fe['include']=[{'all':!![]}];}return db[_0xe2b3('0x2b')][_0xe2b3('0x40')](_0x3dc0fe);})[_0xe2b3('0x3f')](function(_0x4c1782){_0x400b21[_0xe2b3('0x41')]=_0x4c1782;return _0x400b21;})[_0xe2b3('0x3f')](respondWithFilteredResult(_0x3a5f2e,_0x3dc0fe))[_0xe2b3('0x42')](handleError(_0x3a5f2e,null));};exports[_0xe2b3('0x43')]=function(_0x1e1a79,_0x3ccbc){var _0x55788c={'raw':![],'where':{'id':_0x1e1a79['params']['id']}},_0x1aa75a={};_0x1aa75a[_0xe2b3('0x34')]=_[_0xe2b3('0x44')](db['Dynamics365Configuration'][_0xe2b3('0x2c')]);_0x1aa75a[_0xe2b3('0x2f')]=_[_0xe2b3('0x44')](_0x1e1a79[_0xe2b3('0x2f')]);_0x1aa75a[_0xe2b3('0x3a')]=_[_0xe2b3('0x30')](_0x1aa75a[_0xe2b3('0x34')],_0x1aa75a[_0xe2b3('0x2f')]);_0x55788c['attributes']=_[_0xe2b3('0x30')](_0x1aa75a[_0xe2b3('0x34')],qs['fields'](_0x1e1a79[_0xe2b3('0x2f')]['fields']));_0x55788c[_0xe2b3('0x31')]=_0x55788c[_0xe2b3('0x31')][_0xe2b3('0x33')]?_0x55788c[_0xe2b3('0x31')]:_0x1aa75a[_0xe2b3('0x34')];if(_0x1e1a79['query']['includeAll']){_0x55788c[_0xe2b3('0x45')]=[{'all':!![]}];}_0x55788c=_[_0xe2b3('0x3c')]({},_0x55788c,_0x1e1a79['options']);return db[_0xe2b3('0x2b')][_0xe2b3('0x46')](_0x55788c)[_0xe2b3('0x3f')](handleEntityNotFound(_0x3ccbc,null))[_0xe2b3('0x3f')](respondWithResult(_0x3ccbc,null))[_0xe2b3('0x42')](handleError(_0x3ccbc,null));};exports['create']=function(_0x2dd972,_0x104092){return db[_0xe2b3('0x2b')][_0xe2b3('0x47')](_0x2dd972[_0xe2b3('0x48')],{})['then'](respondWithResult(_0x104092,0xc9))[_0xe2b3('0x42')](handleError(_0x104092,null));};exports[_0xe2b3('0x23')]=function(_0x5cc2fe,_0x2b10ab){if(_0x5cc2fe['body']['id']){delete _0x5cc2fe[_0xe2b3('0x48')]['id'];}return db[_0xe2b3('0x2b')][_0xe2b3('0x46')]({'where':{'id':_0x5cc2fe[_0xe2b3('0x49')]['id']}})[_0xe2b3('0x3f')](handleEntityNotFound(_0x2b10ab,null))[_0xe2b3('0x3f')](saveUpdates(_0x5cc2fe[_0xe2b3('0x48')],null))[_0xe2b3('0x3f')](respondWithResult(_0x2b10ab,null))[_0xe2b3('0x42')](handleError(_0x2b10ab,null));};exports[_0xe2b3('0x24')]=function(_0xb46ce2,_0x1d2aa2){return db['Dynamics365Configuration'][_0xe2b3('0x46')]({'where':{'id':_0xb46ce2['params']['id']}})['then'](handleEntityNotFound(_0x1d2aa2,null))['then'](removeEntity(_0x1d2aa2,null))[_0xe2b3('0x42')](handleError(_0x1d2aa2,null));};exports['getFields']=function(_0x340412,_0x323348,_0x2fb08e){var _0x2fadb6={};var _0x37ef22={};var _0x3a36b9;var _0x549f86;return db[_0xe2b3('0x2b')][_0xe2b3('0x4a')]({'where':{'id':_0x340412['params']['id']}})[_0xe2b3('0x3f')](handleEntityNotFound(_0x323348,null))[_0xe2b3('0x3f')](function(_0x19c023){if(_0x19c023){_0x3a36b9=_0x19c023;_0x37ef22[_0xe2b3('0x34')]=_['keys'](db['Dynamics365Field'][_0xe2b3('0x2c')]);_0x37ef22[_0xe2b3('0x2f')]=_[_0xe2b3('0x44')](_0x340412[_0xe2b3('0x2f')]);_0x37ef22[_0xe2b3('0x3a')]=_[_0xe2b3('0x30')](_0x37ef22[_0xe2b3('0x34')],_0x37ef22[_0xe2b3('0x2f')]);_0x2fadb6[_0xe2b3('0x31')]=_[_0xe2b3('0x30')](_0x37ef22[_0xe2b3('0x34')],qs[_0xe2b3('0x32')](_0x340412['query'][_0xe2b3('0x32')]));_0x2fadb6[_0xe2b3('0x31')]=_0x2fadb6['attributes'][_0xe2b3('0x33')]?_0x2fadb6[_0xe2b3('0x31')]:_0x37ef22[_0xe2b3('0x34')];_0x2fadb6['order']=qs['sort'](_0x340412[_0xe2b3('0x2f')][_0xe2b3('0x38')]);_0x2fadb6['where']=qs[_0xe2b3('0x3a')](_[_0xe2b3('0x3b')](_0x340412[_0xe2b3('0x2f')],_0x37ef22[_0xe2b3('0x3a')]));if(_0x340412[_0xe2b3('0x2f')][_0xe2b3('0x4b')]){_0x2fadb6[_0xe2b3('0x39')]=_[_0xe2b3('0x3c')](_0x2fadb6[_0xe2b3('0x39')],{'$or':_['map'](_0x2fadb6['attributes'],function(_0x490a81){var _0x3110f8={};_0x3110f8[_0x490a81]={'$like':'%'+_0x340412[_0xe2b3('0x2f')][_0xe2b3('0x4b')]+'%'};return _0x3110f8;})});}_0x2fadb6=_[_0xe2b3('0x3c')]({},_0x2fadb6,_0x340412[_0xe2b3('0x3e')]);return _0x3a36b9['getFields'](_0x2fadb6);}})[_0xe2b3('0x3f')](function(_0x4dbd40){if(_0x4dbd40){_0x549f86=_0x4dbd40[_0xe2b3('0x33')];if(!_0x340412[_0xe2b3('0x2f')][_0xe2b3('0x35')](_0xe2b3('0x36'))){_0x2fadb6[_0xe2b3('0x1c')]=qs[_0xe2b3('0x1c')](_0x340412['query'][_0xe2b3('0x1c')]);_0x2fadb6[_0xe2b3('0x1b')]=qs[_0xe2b3('0x1b')](_0x340412[_0xe2b3('0x2f')][_0xe2b3('0x1b')]);}return _0x3a36b9[_0xe2b3('0x4c')](_0x2fadb6);}})[_0xe2b3('0x3f')](function(_0x27e1a7){if(_0x27e1a7){return _0x27e1a7?{'count':_0x549f86,'rows':_0x27e1a7}:null;}})[_0xe2b3('0x3f')](respondWithResult(_0x323348,null))[_0xe2b3('0x42')](handleError(_0x323348,null));};exports['getSubjects']=function(_0xe7b860,_0x1db226,_0x43fe08){var _0x403183={};var _0x5acccd={};var _0x795434;var _0xdc740b;return db[_0xe2b3('0x2b')][_0xe2b3('0x4a')]({'where':{'id':_0xe7b860[_0xe2b3('0x49')]['id']}})[_0xe2b3('0x3f')](handleEntityNotFound(_0x1db226,null))['then'](function(_0x354003){if(_0x354003){_0x795434=_0x354003;_0x5acccd[_0xe2b3('0x34')]=_[_0xe2b3('0x44')](db[_0xe2b3('0x4d')][_0xe2b3('0x2c')]);_0x5acccd['query']=_[_0xe2b3('0x44')](_0xe7b860['query']);_0x5acccd[_0xe2b3('0x3a')]=_[_0xe2b3('0x30')](_0x5acccd['model'],_0x5acccd[_0xe2b3('0x2f')]);_0x403183[_0xe2b3('0x31')]=_[_0xe2b3('0x30')](_0x5acccd[_0xe2b3('0x34')],qs[_0xe2b3('0x32')](_0xe7b860['query'][_0xe2b3('0x32')]));_0x403183[_0xe2b3('0x31')]=_0x403183['attributes'][_0xe2b3('0x33')]?_0x403183[_0xe2b3('0x31')]:_0x5acccd[_0xe2b3('0x34')];_0x403183[_0xe2b3('0x37')]=qs[_0xe2b3('0x38')](_0xe7b860[_0xe2b3('0x2f')]['sort']);_0x403183[_0xe2b3('0x39')]=qs[_0xe2b3('0x3a')](_[_0xe2b3('0x3b')](_0xe7b860[_0xe2b3('0x2f')],_0x5acccd[_0xe2b3('0x3a')]));if(_0xe7b860['query']['filter']){_0x403183[_0xe2b3('0x39')]=_[_0xe2b3('0x3c')](_0x403183[_0xe2b3('0x39')],{'$or':_[_0xe2b3('0x2a')](_0x403183[_0xe2b3('0x31')],function(_0x33c0c7){var _0x482e4b={};_0x482e4b[_0x33c0c7]={'$like':'%'+_0xe7b860['query']['filter']+'%'};return _0x482e4b;})});}_0x403183=_[_0xe2b3('0x3c')]({},_0x403183,_0xe7b860[_0xe2b3('0x3e')]);return _0x795434[_0xe2b3('0x4e')](_0x403183);}})[_0xe2b3('0x3f')](function(_0x5cb272){if(_0x5cb272){_0xdc740b=_0x5cb272[_0xe2b3('0x33')];if(!_0xe7b860[_0xe2b3('0x2f')]['hasOwnProperty']('nolimit')){_0x403183[_0xe2b3('0x1c')]=qs[_0xe2b3('0x1c')](_0xe7b860['query']['limit']);_0x403183['offset']=qs[_0xe2b3('0x1b')](_0xe7b860[_0xe2b3('0x2f')][_0xe2b3('0x1b')]);}return _0x795434[_0xe2b3('0x4e')](_0x403183);}})[_0xe2b3('0x3f')](function(_0x46d8d2){if(_0x46d8d2){return _0x46d8d2?{'count':_0xdc740b,'rows':_0x46d8d2}:null;}})[_0xe2b3('0x3f')](respondWithResult(_0x1db226,null))[_0xe2b3('0x42')](handleError(_0x1db226,null));};exports[_0xe2b3('0x4f')]=function(_0x27043c,_0x10fd3b,_0x19e040){var _0x2ac930={};var _0x411fe7={};var _0xb0ada5;var _0x28c2c3;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x27043c['params']['id']}})['then'](handleEntityNotFound(_0x10fd3b,null))[_0xe2b3('0x3f')](function(_0x65fb6){if(_0x65fb6){_0xb0ada5=_0x65fb6;_0x411fe7[_0xe2b3('0x34')]=_['keys'](db[_0xe2b3('0x4d')][_0xe2b3('0x2c')]);_0x411fe7[_0xe2b3('0x2f')]=_[_0xe2b3('0x44')](_0x27043c[_0xe2b3('0x2f')]);_0x411fe7[_0xe2b3('0x3a')]=_[_0xe2b3('0x30')](_0x411fe7['model'],_0x411fe7[_0xe2b3('0x2f')]);_0x2ac930['attributes']=_[_0xe2b3('0x30')](_0x411fe7[_0xe2b3('0x34')],qs[_0xe2b3('0x32')](_0x27043c[_0xe2b3('0x2f')][_0xe2b3('0x32')]));_0x2ac930[_0xe2b3('0x31')]=_0x2ac930[_0xe2b3('0x31')]['length']?_0x2ac930['attributes']:_0x411fe7[_0xe2b3('0x34')];_0x2ac930[_0xe2b3('0x37')]=qs['sort'](_0x27043c[_0xe2b3('0x2f')]['sort']);_0x2ac930[_0xe2b3('0x39')]=qs['filters'](_['pick'](_0x27043c[_0xe2b3('0x2f')],_0x411fe7[_0xe2b3('0x3a')]));if(_0x27043c[_0xe2b3('0x2f')][_0xe2b3('0x4b')]){_0x2ac930['where']=_[_0xe2b3('0x3c')](_0x2ac930[_0xe2b3('0x39')],{'$or':_[_0xe2b3('0x2a')](_0x2ac930[_0xe2b3('0x31')],function(_0xdb4fa4){var _0x59faea={};_0x59faea[_0xdb4fa4]={'$like':'%'+_0x27043c[_0xe2b3('0x2f')]['filter']+'%'};return _0x59faea;})});}_0x2ac930=_['merge']({},_0x2ac930,_0x27043c[_0xe2b3('0x3e')]);return _0xb0ada5[_0xe2b3('0x4f')](_0x2ac930);}})[_0xe2b3('0x3f')](function(_0x525941){if(_0x525941){_0x28c2c3=_0x525941[_0xe2b3('0x33')];if(!_0x27043c[_0xe2b3('0x2f')][_0xe2b3('0x35')](_0xe2b3('0x36'))){_0x2ac930[_0xe2b3('0x1c')]=qs['limit'](_0x27043c[_0xe2b3('0x2f')][_0xe2b3('0x1c')]);_0x2ac930['offset']=qs[_0xe2b3('0x1b')](_0x27043c[_0xe2b3('0x2f')][_0xe2b3('0x1b')]);}return _0xb0ada5[_0xe2b3('0x4f')](_0x2ac930);}})[_0xe2b3('0x3f')](function(_0x588b68){if(_0x588b68){return _0x588b68?{'count':_0x28c2c3,'rows':_0x588b68}:null;}})[_0xe2b3('0x3f')](respondWithResult(_0x10fd3b,null))[_0xe2b3('0x42')](handleError(_0x10fd3b,null));}; \ No newline at end of file +var _0x0fb1=['includeAll','findAll','rows','show','params','include','catch','create','body','find','getFields','pick','getSubjects','Dynamics365Field','findOne','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','undefined','limit','count','offset','apply','update','destroy','then','end','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x29260a,_0x59398a){var _0xcdb779=function(_0x463b01){while(--_0x463b01){_0x29260a['push'](_0x29260a['shift']());}};_0xcdb779(++_0x59398a);}(_0x0fb1,0x182));var _0x10fb=function(_0x48f2ab,_0x35c53a){_0x48f2ab=_0x48f2ab-0x0;var _0x280ed8=_0x0fb1[_0x48f2ab];return _0x280ed8;};'use strict';var emlformat=require(_0x10fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10fb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10fb('0x2'));var moment=require(_0x10fb('0x3'));var BPromise=require(_0x10fb('0x4'));var Mustache=require(_0x10fb('0x5'));var util=require(_0x10fb('0x6'));var path=require(_0x10fb('0x7'));var sox=require(_0x10fb('0x8'));var csv=require(_0x10fb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10fb('0xa'));var _=require(_0x10fb('0xb'));var squel=require('squel');var crypto=require(_0x10fb('0xc'));var jsforce=require(_0x10fb('0xd'));var deskjs=require(_0x10fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x10fb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x10fb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10fb('0x12'))(_0x10fb('0x13'));var utils=require('../../config/utils');var config=require(_0x10fb('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5deca4,_0xe7da9e){_0xe7da9e=_0xe7da9e||0xcc;return function(_0x47bc4e){if(_0x47bc4e){return _0x5deca4['sendStatus'](_0xe7da9e);}return _0x5deca4[_0x10fb('0x15')](_0xe7da9e)['end']();};}function respondWithResult(_0xe92837,_0x170ece){_0x170ece=_0x170ece||0xc8;return function(_0x1303df){if(_0x1303df){return _0xe92837[_0x10fb('0x15')](_0x170ece)['json'](_0x1303df);}};}function respondWithFilteredResult(_0x46578a,_0x20511c){return function(_0x1f32d2){if(_0x1f32d2){var _0x5331ac=typeof _0x20511c['offset']===_0x10fb('0x16')&&typeof _0x20511c[_0x10fb('0x17')]==='undefined';var _0x11e41d=_0x1f32d2[_0x10fb('0x18')];var _0x3fe6c9=_0x5331ac?0x0:_0x20511c['offset'];var _0x50c9ae=_0x5331ac?_0x1f32d2['count']:_0x20511c[_0x10fb('0x19')]+_0x20511c['limit'];var _0x1714e0;if(_0x50c9ae>=_0x11e41d){_0x50c9ae=_0x11e41d;_0x1714e0=0xc8;}else{_0x1714e0=0xce;}_0x46578a[_0x10fb('0x15')](_0x1714e0);return _0x46578a['set']('Content-Range',_0x3fe6c9+'-'+_0x50c9ae+'/'+_0x11e41d)['json'](_0x1f32d2);}return null;};}function patchUpdates(_0x2b98a4){return function(_0x17914e){try{jsonpatch[_0x10fb('0x1a')](_0x17914e,_0x2b98a4,!![]);}catch(_0x371f1e){return BPromise['reject'](_0x371f1e);}return _0x17914e['save']();};}function saveUpdates(_0x572249,_0x44fe32){return function(_0x127d4f){if(_0x127d4f){return _0x127d4f[_0x10fb('0x1b')](_0x572249)['then'](function(_0x4fb958){return _0x4fb958;});}return null;};}function removeEntity(_0x2ce870,_0x4c4ce1){return function(_0x898d47){if(_0x898d47){return _0x898d47[_0x10fb('0x1c')]()[_0x10fb('0x1d')](function(){_0x2ce870[_0x10fb('0x15')](0xcc)[_0x10fb('0x1e')]();});}};}function handleEntityNotFound(_0x2b402a,_0x974764){return function(_0xfafbb0){if(!_0xfafbb0){_0x2b402a['sendStatus'](0x194);}return _0xfafbb0;};}function handleError(_0x2a9709,_0x35360c){_0x35360c=_0x35360c||0x1f4;return function(_0xab7c6b){logger[_0x10fb('0x1f')](_0xab7c6b['stack']);if(_0xab7c6b[_0x10fb('0x20')]){delete _0xab7c6b[_0x10fb('0x20')];}_0x2a9709['status'](_0x35360c)[_0x10fb('0x21')](_0xab7c6b);};}exports[_0x10fb('0x22')]=function(_0x3bdc7e,_0x503b9d){var _0x9df10={},_0x1a7719={},_0x2b0b4e={'count':0x0,'rows':[]};var _0x264c84=_[_0x10fb('0x23')](db[_0x10fb('0x24')][_0x10fb('0x25')],function(_0x4a0af4){return{'name':_0x4a0af4[_0x10fb('0x26')],'type':_0x4a0af4[_0x10fb('0x27')][_0x10fb('0x28')]};});_0x1a7719[_0x10fb('0x29')]=_[_0x10fb('0x23')](_0x264c84,_0x10fb('0x20'));_0x1a7719[_0x10fb('0x2a')]=_[_0x10fb('0x2b')](_0x3bdc7e['query']);_0x1a7719[_0x10fb('0x2c')]=_[_0x10fb('0x2d')](_0x1a7719[_0x10fb('0x29')],_0x1a7719[_0x10fb('0x2a')]);_0x9df10['attributes']=_[_0x10fb('0x2d')](_0x1a7719[_0x10fb('0x29')],qs[_0x10fb('0x2e')](_0x3bdc7e['query'][_0x10fb('0x2e')]));_0x9df10[_0x10fb('0x2f')]=_0x9df10[_0x10fb('0x2f')][_0x10fb('0x30')]?_0x9df10[_0x10fb('0x2f')]:_0x1a7719[_0x10fb('0x29')];if(!_0x3bdc7e[_0x10fb('0x2a')][_0x10fb('0x31')](_0x10fb('0x32'))){_0x9df10[_0x10fb('0x17')]=qs['limit'](_0x3bdc7e['query'][_0x10fb('0x17')]);_0x9df10[_0x10fb('0x19')]=qs[_0x10fb('0x19')](_0x3bdc7e[_0x10fb('0x2a')][_0x10fb('0x19')]);}_0x9df10[_0x10fb('0x33')]=qs[_0x10fb('0x34')](_0x3bdc7e[_0x10fb('0x2a')]['sort']);_0x9df10[_0x10fb('0x35')]=qs[_0x10fb('0x2c')](_['pick'](_0x3bdc7e['query'],_0x1a7719[_0x10fb('0x2c')]),_0x264c84);if(_0x3bdc7e[_0x10fb('0x2a')][_0x10fb('0x36')]){_0x9df10['where']=_[_0x10fb('0x37')](_0x9df10['where'],{'$or':_[_0x10fb('0x23')](_0x264c84,function(_0x9db734){if(_0x9db734[_0x10fb('0x27')]!==_0x10fb('0x38')){var _0xa7e5b1={};_0xa7e5b1[_0x9db734['name']]={'$like':'%'+_0x3bdc7e[_0x10fb('0x2a')][_0x10fb('0x36')]+'%'};return _0xa7e5b1;}})});}_0x9df10=_[_0x10fb('0x37')]({},_0x9df10,_0x3bdc7e[_0x10fb('0x39')]);var _0x4e7808={'where':_0x9df10[_0x10fb('0x35')]};return db['Dynamics365Configuration'][_0x10fb('0x18')](_0x4e7808)[_0x10fb('0x1d')](function(_0x40dfd1){_0x2b0b4e[_0x10fb('0x18')]=_0x40dfd1;if(_0x3bdc7e[_0x10fb('0x2a')][_0x10fb('0x3a')]){_0x9df10['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x10fb('0x3b')](_0x9df10);})['then'](function(_0x288c05){_0x2b0b4e[_0x10fb('0x3c')]=_0x288c05;return _0x2b0b4e;})['then'](respondWithFilteredResult(_0x503b9d,_0x9df10))['catch'](handleError(_0x503b9d,null));};exports[_0x10fb('0x3d')]=function(_0xcedb31,_0x452882){var _0x5a3f89={'raw':![],'where':{'id':_0xcedb31[_0x10fb('0x3e')]['id']}},_0x574dac={};_0x574dac[_0x10fb('0x29')]=_[_0x10fb('0x2b')](db[_0x10fb('0x24')][_0x10fb('0x25')]);_0x574dac[_0x10fb('0x2a')]=_['keys'](_0xcedb31[_0x10fb('0x2a')]);_0x574dac[_0x10fb('0x2c')]=_['intersection'](_0x574dac[_0x10fb('0x29')],_0x574dac[_0x10fb('0x2a')]);_0x5a3f89['attributes']=_[_0x10fb('0x2d')](_0x574dac[_0x10fb('0x29')],qs[_0x10fb('0x2e')](_0xcedb31[_0x10fb('0x2a')][_0x10fb('0x2e')]));_0x5a3f89[_0x10fb('0x2f')]=_0x5a3f89[_0x10fb('0x2f')][_0x10fb('0x30')]?_0x5a3f89[_0x10fb('0x2f')]:_0x574dac['model'];if(_0xcedb31[_0x10fb('0x2a')][_0x10fb('0x3a')]){_0x5a3f89[_0x10fb('0x3f')]=[{'all':!![]}];}_0x5a3f89=_[_0x10fb('0x37')]({},_0x5a3f89,_0xcedb31[_0x10fb('0x39')]);return db[_0x10fb('0x24')]['find'](_0x5a3f89)['then'](handleEntityNotFound(_0x452882,null))[_0x10fb('0x1d')](respondWithResult(_0x452882,null))[_0x10fb('0x40')](handleError(_0x452882,null));};exports[_0x10fb('0x41')]=function(_0x3e0d14,_0x26ace2){return db[_0x10fb('0x24')][_0x10fb('0x41')](_0x3e0d14['body'],{})[_0x10fb('0x1d')](respondWithResult(_0x26ace2,0xc9))[_0x10fb('0x40')](handleError(_0x26ace2,null));};exports[_0x10fb('0x1b')]=function(_0x483a58,_0x59d316){if(_0x483a58['body']['id']){delete _0x483a58[_0x10fb('0x42')]['id'];}return db[_0x10fb('0x24')][_0x10fb('0x43')]({'where':{'id':_0x483a58['params']['id']}})[_0x10fb('0x1d')](handleEntityNotFound(_0x59d316,null))['then'](saveUpdates(_0x483a58[_0x10fb('0x42')],null))[_0x10fb('0x1d')](respondWithResult(_0x59d316,null))[_0x10fb('0x40')](handleError(_0x59d316,null));};exports[_0x10fb('0x1c')]=function(_0x42503b,_0x30d080){return db[_0x10fb('0x24')][_0x10fb('0x43')]({'where':{'id':_0x42503b[_0x10fb('0x3e')]['id']}})[_0x10fb('0x1d')](handleEntityNotFound(_0x30d080,null))[_0x10fb('0x1d')](removeEntity(_0x30d080,null))['catch'](handleError(_0x30d080,null));};exports[_0x10fb('0x44')]=function(_0x53b12b,_0x27ee7f,_0x3ff058){var _0x34d390={};var _0x249c9d={};var _0x3157a2;var _0x324ae0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x53b12b['params']['id']}})['then'](handleEntityNotFound(_0x27ee7f,null))[_0x10fb('0x1d')](function(_0x4ae456){if(_0x4ae456){_0x3157a2=_0x4ae456;_0x249c9d[_0x10fb('0x29')]=_[_0x10fb('0x2b')](db['Dynamics365Field']['rawAttributes']);_0x249c9d[_0x10fb('0x2a')]=_['keys'](_0x53b12b[_0x10fb('0x2a')]);_0x249c9d[_0x10fb('0x2c')]=_['intersection'](_0x249c9d[_0x10fb('0x29')],_0x249c9d[_0x10fb('0x2a')]);_0x34d390['attributes']=_[_0x10fb('0x2d')](_0x249c9d[_0x10fb('0x29')],qs[_0x10fb('0x2e')](_0x53b12b[_0x10fb('0x2a')]['fields']));_0x34d390['attributes']=_0x34d390['attributes'][_0x10fb('0x30')]?_0x34d390[_0x10fb('0x2f')]:_0x249c9d[_0x10fb('0x29')];_0x34d390[_0x10fb('0x33')]=qs['sort'](_0x53b12b['query']['sort']);_0x34d390[_0x10fb('0x35')]=qs[_0x10fb('0x2c')](_[_0x10fb('0x45')](_0x53b12b[_0x10fb('0x2a')],_0x249c9d[_0x10fb('0x2c')]));if(_0x53b12b[_0x10fb('0x2a')][_0x10fb('0x36')]){_0x34d390['where']=_[_0x10fb('0x37')](_0x34d390[_0x10fb('0x35')],{'$or':_[_0x10fb('0x23')](_0x34d390[_0x10fb('0x2f')],function(_0x1bb3aa){var _0x14532c={};_0x14532c[_0x1bb3aa]={'$like':'%'+_0x53b12b[_0x10fb('0x2a')][_0x10fb('0x36')]+'%'};return _0x14532c;})});}_0x34d390=_[_0x10fb('0x37')]({},_0x34d390,_0x53b12b[_0x10fb('0x39')]);return _0x3157a2['getFields'](_0x34d390);}})[_0x10fb('0x1d')](function(_0x44ea95){if(_0x44ea95){_0x324ae0=_0x44ea95['length'];if(!_0x53b12b[_0x10fb('0x2a')][_0x10fb('0x31')](_0x10fb('0x32'))){_0x34d390['limit']=qs[_0x10fb('0x17')](_0x53b12b['query'][_0x10fb('0x17')]);_0x34d390[_0x10fb('0x19')]=qs[_0x10fb('0x19')](_0x53b12b[_0x10fb('0x2a')]['offset']);}return _0x3157a2[_0x10fb('0x44')](_0x34d390);}})[_0x10fb('0x1d')](function(_0x541ff9){if(_0x541ff9){return _0x541ff9?{'count':_0x324ae0,'rows':_0x541ff9}:null;}})[_0x10fb('0x1d')](respondWithResult(_0x27ee7f,null))[_0x10fb('0x40')](handleError(_0x27ee7f,null));};exports[_0x10fb('0x46')]=function(_0x2d9c52,_0x41ea23,_0x79f133){var _0x478c14={};var _0x42d1d1={};var _0x53e2df;var _0x22efb9;return db[_0x10fb('0x24')]['findOne']({'where':{'id':_0x2d9c52[_0x10fb('0x3e')]['id']}})[_0x10fb('0x1d')](handleEntityNotFound(_0x41ea23,null))[_0x10fb('0x1d')](function(_0x5e53d1){if(_0x5e53d1){_0x53e2df=_0x5e53d1;_0x42d1d1[_0x10fb('0x29')]=_[_0x10fb('0x2b')](db[_0x10fb('0x47')][_0x10fb('0x25')]);_0x42d1d1[_0x10fb('0x2a')]=_[_0x10fb('0x2b')](_0x2d9c52[_0x10fb('0x2a')]);_0x42d1d1[_0x10fb('0x2c')]=_[_0x10fb('0x2d')](_0x42d1d1[_0x10fb('0x29')],_0x42d1d1['query']);_0x478c14[_0x10fb('0x2f')]=_[_0x10fb('0x2d')](_0x42d1d1[_0x10fb('0x29')],qs[_0x10fb('0x2e')](_0x2d9c52['query'][_0x10fb('0x2e')]));_0x478c14[_0x10fb('0x2f')]=_0x478c14[_0x10fb('0x2f')][_0x10fb('0x30')]?_0x478c14[_0x10fb('0x2f')]:_0x42d1d1[_0x10fb('0x29')];_0x478c14[_0x10fb('0x33')]=qs['sort'](_0x2d9c52['query'][_0x10fb('0x34')]);_0x478c14['where']=qs[_0x10fb('0x2c')](_[_0x10fb('0x45')](_0x2d9c52['query'],_0x42d1d1[_0x10fb('0x2c')]));if(_0x2d9c52[_0x10fb('0x2a')][_0x10fb('0x36')]){_0x478c14[_0x10fb('0x35')]=_[_0x10fb('0x37')](_0x478c14[_0x10fb('0x35')],{'$or':_[_0x10fb('0x23')](_0x478c14[_0x10fb('0x2f')],function(_0x2e8da6){var _0x3f5f04={};_0x3f5f04[_0x2e8da6]={'$like':'%'+_0x2d9c52['query'][_0x10fb('0x36')]+'%'};return _0x3f5f04;})});}_0x478c14=_[_0x10fb('0x37')]({},_0x478c14,_0x2d9c52[_0x10fb('0x39')]);return _0x53e2df[_0x10fb('0x46')](_0x478c14);}})[_0x10fb('0x1d')](function(_0x38999b){if(_0x38999b){_0x22efb9=_0x38999b['length'];if(!_0x2d9c52[_0x10fb('0x2a')]['hasOwnProperty'](_0x10fb('0x32'))){_0x478c14[_0x10fb('0x17')]=qs[_0x10fb('0x17')](_0x2d9c52[_0x10fb('0x2a')][_0x10fb('0x17')]);_0x478c14[_0x10fb('0x19')]=qs['offset'](_0x2d9c52[_0x10fb('0x2a')][_0x10fb('0x19')]);}return _0x53e2df[_0x10fb('0x46')](_0x478c14);}})['then'](function(_0x12bced){if(_0x12bced){return _0x12bced?{'count':_0x22efb9,'rows':_0x12bced}:null;}})['then'](respondWithResult(_0x41ea23,null))[_0x10fb('0x40')](handleError(_0x41ea23,null));};exports['getDescriptions']=function(_0xc6e190,_0x4f36e4,_0x5e50df){var _0x25d29e={};var _0x2cffb2={};var _0x2ad1f6;var _0x2b05f7;return db[_0x10fb('0x24')][_0x10fb('0x48')]({'where':{'id':_0xc6e190[_0x10fb('0x3e')]['id']}})[_0x10fb('0x1d')](handleEntityNotFound(_0x4f36e4,null))[_0x10fb('0x1d')](function(_0x20e3f2){if(_0x20e3f2){_0x2ad1f6=_0x20e3f2;_0x2cffb2['model']=_[_0x10fb('0x2b')](db['Dynamics365Field'][_0x10fb('0x25')]);_0x2cffb2['query']=_[_0x10fb('0x2b')](_0xc6e190[_0x10fb('0x2a')]);_0x2cffb2[_0x10fb('0x2c')]=_[_0x10fb('0x2d')](_0x2cffb2[_0x10fb('0x29')],_0x2cffb2['query']);_0x25d29e['attributes']=_['intersection'](_0x2cffb2[_0x10fb('0x29')],qs[_0x10fb('0x2e')](_0xc6e190['query'][_0x10fb('0x2e')]));_0x25d29e[_0x10fb('0x2f')]=_0x25d29e['attributes'][_0x10fb('0x30')]?_0x25d29e[_0x10fb('0x2f')]:_0x2cffb2['model'];_0x25d29e[_0x10fb('0x33')]=qs[_0x10fb('0x34')](_0xc6e190[_0x10fb('0x2a')]['sort']);_0x25d29e[_0x10fb('0x35')]=qs['filters'](_['pick'](_0xc6e190[_0x10fb('0x2a')],_0x2cffb2[_0x10fb('0x2c')]));if(_0xc6e190[_0x10fb('0x2a')][_0x10fb('0x36')]){_0x25d29e['where']=_['merge'](_0x25d29e[_0x10fb('0x35')],{'$or':_[_0x10fb('0x23')](_0x25d29e[_0x10fb('0x2f')],function(_0x183ff0){var _0xeaaec2={};_0xeaaec2[_0x183ff0]={'$like':'%'+_0xc6e190[_0x10fb('0x2a')][_0x10fb('0x36')]+'%'};return _0xeaaec2;})});}_0x25d29e=_['merge']({},_0x25d29e,_0xc6e190[_0x10fb('0x39')]);return _0x2ad1f6['getDescriptions'](_0x25d29e);}})['then'](function(_0x4ceccb){if(_0x4ceccb){_0x2b05f7=_0x4ceccb['length'];if(!_0xc6e190[_0x10fb('0x2a')]['hasOwnProperty'](_0x10fb('0x32'))){_0x25d29e['limit']=qs['limit'](_0xc6e190[_0x10fb('0x2a')][_0x10fb('0x17')]);_0x25d29e[_0x10fb('0x19')]=qs[_0x10fb('0x19')](_0xc6e190[_0x10fb('0x2a')][_0x10fb('0x19')]);}return _0x2ad1f6[_0x10fb('0x49')](_0x25d29e);}})[_0x10fb('0x1d')](function(_0x36f260){if(_0x36f260){return _0x36f260?{'count':_0x2b05f7,'rows':_0x36f260}:null;}})[_0x10fb('0x1d')](respondWithResult(_0x4f36e4,null))[_0x10fb('0x40')](handleError(_0x4f36e4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7996330..4ef91ee 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 _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x38ed42,_0x3d9a37){var _0x474931=function(_0x1fa601){while(--_0x1fa601){_0x38ed42['push'](_0x38ed42['shift']());}};_0x474931(++_0x3d9a37);}(_0x008c,0x188));var _0xc008=function(_0x53816b,_0x2f9ba3){_0x53816b=_0x53816b-0x0;var _0x7f2259=_0x008c[_0x53816b];return _0x7f2259;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x36d93a,_0x5466a2){var _0x1ea4d9=function(_0x4f8f01){while(--_0x4f8f01){_0x36d93a['push'](_0x36d93a['shift']());}};_0x1ea4d9(++_0x5466a2);}(_0xaa88,0x137));var _0x8aa8=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0xaa88[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 79c29cf..72af063 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 _0x810e=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x810e,0x8b));var _0xe810=function(_0x926b9c,_0x3cc908){_0x926b9c=_0x926b9c-0x0;var _0x523a78=_0x810e[_0x926b9c];return _0x523a78;};'use strict';var _=require(_0xe810('0x0'));var util=require('util');var moment=require(_0xe810('0x1'));var BPromise=require(_0xe810('0x2'));var rs=require(_0xe810('0x3'));var fs=require('fs');var Redis=require(_0xe810('0x4'));var db=require(_0xe810('0x5'))['db'];var utils=require(_0xe810('0x6'));var logger=require(_0xe810('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe810('0x8'));var client=jayson[_0xe810('0x9')][_0xe810('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39fe9f,_0x20a545,_0x3fd870){return new BPromise(function(_0x2de43a,_0x2c4293){return client[_0xe810('0xb')](_0x39fe9f,_0x3fd870)[_0xe810('0xc')](function(_0x17c0c8){logger[_0xe810('0xd')](_0xe810('0xe'),_0x20a545,_0xe810('0xf'));logger[_0xe810('0x10')](_0xe810('0x11'),_0x20a545,_0xe810('0xf'),JSON[_0xe810('0x12')](_0x17c0c8));if(_0x17c0c8[_0xe810('0x13')]){if(_0x17c0c8['error'][_0xe810('0x14')]===0x1f4){logger[_0xe810('0x13')](_0xe810('0xe'),_0x20a545,_0x17c0c8[_0xe810('0x13')][_0xe810('0x15')]);return _0x2c4293(_0x17c0c8[_0xe810('0x13')][_0xe810('0x15')]);}logger[_0xe810('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x20a545,_0x17c0c8['error'][_0xe810('0x15')]);return _0x2de43a(_0x17c0c8[_0xe810('0x13')][_0xe810('0x15')]);}else{logger[_0xe810('0xd')](_0xe810('0xe'),_0x20a545,_0xe810('0xf'));_0x2de43a(_0x17c0c8[_0xe810('0x16')][_0xe810('0x15')]);}})[_0xe810('0x17')](function(_0x2bae74){logger[_0xe810('0x13')](_0xe810('0xe'),_0x20a545,_0x2bae74);_0x2c4293(_0x2bae74);});});} \ No newline at end of file +var _0xeecc=['client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x522cdb,_0x45e2a4){var _0x12c479=function(_0x2a121d){while(--_0x2a121d){_0x522cdb['push'](_0x522cdb['shift']());}};_0x12c479(++_0x45e2a4);}(_0xeecc,0x83));var _0xceec=function(_0x509b2d,_0x47cee9){_0x509b2d=_0x509b2d-0x0;var _0x28b1bf=_0xeecc[_0x509b2d];return _0x28b1bf;};'use strict';var _=require(_0xceec('0x0'));var util=require('util');var moment=require(_0xceec('0x1'));var BPromise=require(_0xceec('0x2'));var rs=require(_0xceec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xceec('0x4'))['db'];var utils=require(_0xceec('0x5'));var logger=require(_0xceec('0x6'))(_0xceec('0x7'));var config=require(_0xceec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xceec('0x9')][_0xceec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x170a59,_0xdd162b,_0x542b9a){return new BPromise(function(_0x79e8ab,_0x5b2676){return client['request'](_0x170a59,_0x542b9a)['then'](function(_0x24395a){logger[_0xceec('0xb')](_0xceec('0xc'),_0xdd162b,_0xceec('0xd'));logger[_0xceec('0xe')](_0xceec('0xf'),_0xdd162b,'request\x20sent',JSON['stringify'](_0x24395a));if(_0x24395a[_0xceec('0x10')]){if(_0x24395a[_0xceec('0x10')][_0xceec('0x11')]===0x1f4){logger[_0xceec('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0xdd162b,_0x24395a[_0xceec('0x10')][_0xceec('0x12')]);return _0x5b2676(_0x24395a['error']['message']);}logger['error'](_0xceec('0xc'),_0xdd162b,_0x24395a[_0xceec('0x10')][_0xceec('0x12')]);return _0x79e8ab(_0x24395a[_0xceec('0x10')][_0xceec('0x12')]);}else{logger[_0xceec('0xb')](_0xceec('0xc'),_0xdd162b,_0xceec('0xd'));_0x79e8ab(_0x24395a[_0xceec('0x13')]['message']);}})['catch'](function(_0x2f416d){logger[_0xceec('0x10')](_0xceec('0xc'),_0xdd162b,_0x2f416d);_0x5b2676(_0x2f416d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index e09cb5f..5c31a4a 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 _0x3814=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','exports'];(function(_0x56e008,_0x3eb53d){var _0x24878f=function(_0x87a70c){while(--_0x87a70c){_0x56e008['push'](_0x56e008['shift']());}};_0x24878f(++_0x3eb53d);}(_0x3814,0x19e));var _0x4381=function(_0x1a5bcc,_0x3ae15c){_0x1a5bcc=_0x1a5bcc-0x0;var _0x561262=_0x3814[_0x1a5bcc];return _0x561262;};'use strict';var multer=require(_0x4381('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4381('0x1'));var express=require(_0x4381('0x2'));var router=express[_0x4381('0x3')]();var fs_extra=require(_0x4381('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4381('0x5'));var config=require(_0x4381('0x6'));var controller=require(_0x4381('0x7'));router['get']('/',auth[_0x4381('0x8')](),controller[_0x4381('0x9')]);router[_0x4381('0xa')](_0x4381('0xb'),auth[_0x4381('0x8')](),controller[_0x4381('0xc')]);router['post']('/',auth[_0x4381('0x8')](),controller[_0x4381('0xd')]);router[_0x4381('0xe')](_0x4381('0xb'),auth['isAuthenticated'](),controller[_0x4381('0xf')]);router['delete']('/:id',auth[_0x4381('0x8')](),controller[_0x4381('0x10')]);module[_0x4381('0x11')]=router; \ No newline at end of file +var _0x84cc=['post','create','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x84cc,0x83));var _0xc84c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x84cc[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xc84c('0x0'));var path=require(_0xc84c('0x1'));var timeout=require(_0xc84c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc84c('0x3'));var auth=require(_0xc84c('0x4'));var interaction=require(_0xc84c('0x5'));var config=require(_0xc84c('0x6'));var controller=require(_0xc84c('0x7'));router[_0xc84c('0x8')]('/',auth[_0xc84c('0x9')](),controller[_0xc84c('0xa')]);router[_0xc84c('0x8')](_0xc84c('0xb'),auth['isAuthenticated'](),controller[_0xc84c('0xc')]);router[_0xc84c('0xd')]('/',auth[_0xc84c('0x9')](),controller[_0xc84c('0xe')]);router['put']('/:id',auth[_0xc84c('0x9')](),controller['update']);router[_0xc84c('0xf')](_0xc84c('0xb'),auth[_0xc84c('0x9')](),controller[_0xc84c('0x10')]);module[_0xc84c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a76914d..f6c4f86 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 _0xbf04=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x33b206,_0x50d200){var _0x50df1e=function(_0x106b1a){while(--_0x106b1a){_0x33b206['push'](_0x33b206['shift']());}};_0x50df1e(++_0x50d200);}(_0xbf04,0xd9));var _0x4bf0=function(_0x1dcb0c,_0x3a96e9){_0x1dcb0c=_0x1dcb0c-0x0;var _0x2dafc2=_0xbf04[_0x1dcb0c];return _0x2dafc2;};'use strict';var Sequelize=require(_0x4bf0('0x0'));module[_0x4bf0('0x1')]={'type':{'type':Sequelize[_0x4bf0('0x2')](_0x4bf0('0x3'),'variable',_0x4bf0('0x4'),_0x4bf0('0x5'),_0x4bf0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4bf0('0x7')]},'key':{'type':Sequelize[_0x4bf0('0x7')]},'keyType':{'type':Sequelize[_0x4bf0('0x2')](_0x4bf0('0x3'),'variable',_0x4bf0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4bf0('0x7')]},'customField':{'type':Sequelize[_0x4bf0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4bf0('0x7')]}}; \ No newline at end of file +var _0x27a0=['STRING','variable','customVariable','exports','ENUM','string','keyValue','picklist'];(function(_0x4115c6,_0x3cc8be){var _0x3c675e=function(_0x17e279){while(--_0x17e279){_0x4115c6['push'](_0x4115c6['shift']());}};_0x3c675e(++_0x3cc8be);}(_0x27a0,0x1e3));var _0x027a=function(_0x4c1ae8,_0x3158d4){_0x4c1ae8=_0x4c1ae8-0x0;var _0x4cc9ab=_0x27a0[_0x4c1ae8];return _0x4cc9ab;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'type':{'type':Sequelize[_0x027a('0x1')](_0x027a('0x2'),'variable','customVariable',_0x027a('0x3'),_0x027a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x027a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x027a('0x1')](_0x027a('0x2'),_0x027a('0x6'),_0x027a('0x7'))},'keyContent':{'type':Sequelize[_0x027a('0x5')]},'idField':{'type':Sequelize[_0x027a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x027a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ca5dd5e..a731e6e 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 _0xd6f2=['fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','map','rawAttributes'];(function(_0x40aaea,_0x3f4db7){var _0x3bac0f=function(_0xd057f9){while(--_0xd057f9){_0x40aaea['push'](_0x40aaea['shift']());}};_0x3bac0f(++_0x3f4db7);}(_0xd6f2,0x19b));var _0x2d6f=function(_0x26ba91,_0x5a2c03){_0x26ba91=_0x26ba91-0x0;var _0x5615ea=_0xd6f2[_0x26ba91];return _0x5615ea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d6f('0x0'));var jsonpatch=require(_0x2d6f('0x1'));var rp=require(_0x2d6f('0x2'));var moment=require(_0x2d6f('0x3'));var BPromise=require(_0x2d6f('0x4'));var Mustache=require(_0x2d6f('0x5'));var util=require(_0x2d6f('0x6'));var path=require(_0x2d6f('0x7'));var sox=require(_0x2d6f('0x8'));var csv=require('to-csv');var ejs=require(_0x2d6f('0x9'));var fs=require('fs');var fs_extra=require(_0x2d6f('0xa'));var _=require(_0x2d6f('0xb'));var squel=require(_0x2d6f('0xc'));var crypto=require('crypto');var jsforce=require(_0x2d6f('0xd'));var deskjs=require(_0x2d6f('0xe'));var toCsv=require(_0x2d6f('0xf'));var querystring=require(_0x2d6f('0x10'));var Papa=require(_0x2d6f('0x11'));var Redis=require(_0x2d6f('0x12'));var authService=require(_0x2d6f('0x13'));var qs=require(_0x2d6f('0x14'));var as=require(_0x2d6f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d6f('0x16'))(_0x2d6f('0x17'));var utils=require(_0x2d6f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2d6f('0x19'));var db=require(_0x2d6f('0x1a'))['db'];function respondWithStatusCode(_0xaa7b62,_0x6cde7d){_0x6cde7d=_0x6cde7d||0xcc;return function(_0x41e586){if(_0x41e586){return _0xaa7b62[_0x2d6f('0x1b')](_0x6cde7d);}return _0xaa7b62[_0x2d6f('0x1c')](_0x6cde7d)['end']();};}function respondWithResult(_0x46ab98,_0x15b2d5){_0x15b2d5=_0x15b2d5||0xc8;return function(_0x1ae8e5){if(_0x1ae8e5){return _0x46ab98['status'](_0x15b2d5)[_0x2d6f('0x1d')](_0x1ae8e5);}};}function respondWithFilteredResult(_0x3f7b26,_0x3ce82d){return function(_0x18aedb){if(_0x18aedb){var _0x34154c=typeof _0x3ce82d[_0x2d6f('0x1e')]==='undefined'&&typeof _0x3ce82d[_0x2d6f('0x1f')]===_0x2d6f('0x20');var _0x74e3fb=_0x18aedb[_0x2d6f('0x21')];var _0x47ca87=_0x34154c?0x0:_0x3ce82d[_0x2d6f('0x1e')];var _0x1c9c20=_0x34154c?_0x18aedb[_0x2d6f('0x21')]:_0x3ce82d[_0x2d6f('0x1e')]+_0x3ce82d['limit'];var _0x304b32;if(_0x1c9c20>=_0x74e3fb){_0x1c9c20=_0x74e3fb;_0x304b32=0xc8;}else{_0x304b32=0xce;}_0x3f7b26[_0x2d6f('0x1c')](_0x304b32);return _0x3f7b26[_0x2d6f('0x22')]('Content-Range',_0x47ca87+'-'+_0x1c9c20+'/'+_0x74e3fb)['json'](_0x18aedb);}return null;};}function patchUpdates(_0x2d5ef6){return function(_0x3160f0){try{jsonpatch[_0x2d6f('0x23')](_0x3160f0,_0x2d5ef6,!![]);}catch(_0x4f360f){return BPromise[_0x2d6f('0x24')](_0x4f360f);}return _0x3160f0[_0x2d6f('0x25')]();};}function saveUpdates(_0x19808d,_0x1fee2e){return function(_0x15b535){if(_0x15b535){return _0x15b535[_0x2d6f('0x26')](_0x19808d)[_0x2d6f('0x27')](function(_0x11a798){return _0x11a798;});}return null;};}function removeEntity(_0x52629d,_0x532789){return function(_0x1c40e6){if(_0x1c40e6){return _0x1c40e6[_0x2d6f('0x28')]()['then'](function(){_0x52629d[_0x2d6f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e2344,_0x441c24){return function(_0x5b1402){if(!_0x5b1402){_0x1e2344[_0x2d6f('0x1b')](0x194);}return _0x5b1402;};}function handleError(_0x2d1a4b,_0xf1c937){_0xf1c937=_0xf1c937||0x1f4;return function(_0x294a83){logger[_0x2d6f('0x29')](_0x294a83['stack']);if(_0x294a83['name']){delete _0x294a83[_0x2d6f('0x2a')];}_0x2d1a4b['status'](_0xf1c937)['send'](_0x294a83);};}exports['index']=function(_0x5710d2,_0x1367b5){var _0x3e2c1e={},_0x53eb24={},_0x3873a6={'count':0x0,'rows':[]};var _0x5aa970=_[_0x2d6f('0x2b')](db['Dynamics365Field'][_0x2d6f('0x2c')],function(_0x9d6899){return{'name':_0x9d6899[_0x2d6f('0x2d')],'type':_0x9d6899[_0x2d6f('0x2e')]['key']};});_0x53eb24['model']=_[_0x2d6f('0x2b')](_0x5aa970,_0x2d6f('0x2a'));_0x53eb24['query']=_[_0x2d6f('0x2f')](_0x5710d2[_0x2d6f('0x30')]);_0x53eb24[_0x2d6f('0x31')]=_[_0x2d6f('0x32')](_0x53eb24[_0x2d6f('0x33')],_0x53eb24['query']);_0x3e2c1e['attributes']=_[_0x2d6f('0x32')](_0x53eb24[_0x2d6f('0x33')],qs[_0x2d6f('0x34')](_0x5710d2[_0x2d6f('0x30')][_0x2d6f('0x34')]));_0x3e2c1e['attributes']=_0x3e2c1e[_0x2d6f('0x35')][_0x2d6f('0x36')]?_0x3e2c1e[_0x2d6f('0x35')]:_0x53eb24[_0x2d6f('0x33')];if(!_0x5710d2[_0x2d6f('0x30')][_0x2d6f('0x37')](_0x2d6f('0x38'))){_0x3e2c1e['limit']=qs[_0x2d6f('0x1f')](_0x5710d2[_0x2d6f('0x30')][_0x2d6f('0x1f')]);_0x3e2c1e[_0x2d6f('0x1e')]=qs[_0x2d6f('0x1e')](_0x5710d2['query']['offset']);}_0x3e2c1e[_0x2d6f('0x39')]=qs['sort'](_0x5710d2['query'][_0x2d6f('0x3a')]);_0x3e2c1e['where']=qs['filters'](_[_0x2d6f('0x3b')](_0x5710d2[_0x2d6f('0x30')],_0x53eb24['filters']),_0x5aa970);if(_0x5710d2['query'][_0x2d6f('0x3c')]){_0x3e2c1e[_0x2d6f('0x3d')]=_[_0x2d6f('0x3e')](_0x3e2c1e[_0x2d6f('0x3d')],{'$or':_['map'](_0x5aa970,function(_0x15a069){if(_0x15a069[_0x2d6f('0x2e')]!==_0x2d6f('0x3f')){var _0x25d9b0={};_0x25d9b0[_0x15a069[_0x2d6f('0x2a')]]={'$like':'%'+_0x5710d2[_0x2d6f('0x30')][_0x2d6f('0x3c')]+'%'};return _0x25d9b0;}})});}_0x3e2c1e=_[_0x2d6f('0x3e')]({},_0x3e2c1e,_0x5710d2[_0x2d6f('0x40')]);var _0x22e7a2={'where':_0x3e2c1e[_0x2d6f('0x3d')]};return db[_0x2d6f('0x41')][_0x2d6f('0x21')](_0x22e7a2)[_0x2d6f('0x27')](function(_0x9f10e3){_0x3873a6['count']=_0x9f10e3;if(_0x5710d2['query'][_0x2d6f('0x42')]){_0x3e2c1e[_0x2d6f('0x43')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x2d6f('0x44')](_0x3e2c1e);})['then'](function(_0x3444cb){_0x3873a6[_0x2d6f('0x45')]=_0x3444cb;return _0x3873a6;})[_0x2d6f('0x27')](respondWithFilteredResult(_0x1367b5,_0x3e2c1e))[_0x2d6f('0x46')](handleError(_0x1367b5,null));};exports[_0x2d6f('0x47')]=function(_0xd00e29,_0x39d74e){var _0x20168b={'raw':!![],'where':{'id':_0xd00e29[_0x2d6f('0x48')]['id']}},_0x1ee97f={};_0x1ee97f[_0x2d6f('0x33')]=_[_0x2d6f('0x2f')](db[_0x2d6f('0x41')]['rawAttributes']);_0x1ee97f[_0x2d6f('0x30')]=_[_0x2d6f('0x2f')](_0xd00e29['query']);_0x1ee97f[_0x2d6f('0x31')]=_[_0x2d6f('0x32')](_0x1ee97f[_0x2d6f('0x33')],_0x1ee97f[_0x2d6f('0x30')]);_0x20168b[_0x2d6f('0x35')]=_[_0x2d6f('0x32')](_0x1ee97f[_0x2d6f('0x33')],qs['fields'](_0xd00e29['query'][_0x2d6f('0x34')]));_0x20168b['attributes']=_0x20168b[_0x2d6f('0x35')][_0x2d6f('0x36')]?_0x20168b[_0x2d6f('0x35')]:_0x1ee97f[_0x2d6f('0x33')];if(_0xd00e29[_0x2d6f('0x30')][_0x2d6f('0x42')]){_0x20168b[_0x2d6f('0x43')]=[{'all':!![]}];}_0x20168b=_['merge']({},_0x20168b,_0xd00e29[_0x2d6f('0x40')]);return db[_0x2d6f('0x41')][_0x2d6f('0x49')](_0x20168b)[_0x2d6f('0x27')](handleEntityNotFound(_0x39d74e,null))[_0x2d6f('0x27')](respondWithResult(_0x39d74e,null))[_0x2d6f('0x46')](handleError(_0x39d74e,null));};exports[_0x2d6f('0x4a')]=function(_0xcbd9ad,_0x1d4692){return db['Dynamics365Field'][_0x2d6f('0x4a')](_0xcbd9ad['body'],{})[_0x2d6f('0x27')](respondWithResult(_0x1d4692,0xc9))[_0x2d6f('0x46')](handleError(_0x1d4692,null));};exports[_0x2d6f('0x26')]=function(_0x36ba6f,_0x4ba59c){if(_0x36ba6f[_0x2d6f('0x4b')]['id']){delete _0x36ba6f[_0x2d6f('0x4b')]['id'];}return db[_0x2d6f('0x41')]['find']({'where':{'id':_0x36ba6f[_0x2d6f('0x48')]['id']}})[_0x2d6f('0x27')](handleEntityNotFound(_0x4ba59c,null))[_0x2d6f('0x27')](saveUpdates(_0x36ba6f['body'],null))[_0x2d6f('0x27')](respondWithResult(_0x4ba59c,null))['catch'](handleError(_0x4ba59c,null));};exports[_0x2d6f('0x28')]=function(_0x186333,_0x3a4315){return db[_0x2d6f('0x41')][_0x2d6f('0x49')]({'where':{'id':_0x186333[_0x2d6f('0x48')]['id']}})[_0x2d6f('0x27')](handleEntityNotFound(_0x3a4315,null))[_0x2d6f('0x27')](removeEntity(_0x3a4315,null))[_0x2d6f('0x46')](handleError(_0x3a4315,null));}; \ No newline at end of file +var _0x251e=['type','query','keys','filters','intersection','model','fields','attributes','length','sort','pick','where','merge','filter','options','include','findAll','rows','show','params','create','body','find','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName'];(function(_0xe1770a,_0x4fc5d6){var _0x3e6274=function(_0x1a016f){while(--_0x1a016f){_0xe1770a['push'](_0xe1770a['shift']());}};_0x3e6274(++_0x4fc5d6);}(_0x251e,0xa8));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe251('0x0'));var rimraf=require(_0xe251('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe251('0x2'));var rp=require(_0xe251('0x3'));var moment=require('moment');var BPromise=require(_0xe251('0x4'));var Mustache=require(_0xe251('0x5'));var util=require(_0xe251('0x6'));var path=require(_0xe251('0x7'));var sox=require(_0xe251('0x8'));var csv=require(_0xe251('0x9'));var ejs=require(_0xe251('0xa'));var fs=require('fs');var fs_extra=require(_0xe251('0xb'));var _=require(_0xe251('0xc'));var squel=require(_0xe251('0xd'));var crypto=require(_0xe251('0xe'));var jsforce=require(_0xe251('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe251('0x9'));var querystring=require(_0xe251('0x10'));var Papa=require(_0xe251('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe251('0x12'));var as=require(_0xe251('0x13'));var hardwareService=require(_0xe251('0x14'));var logger=require(_0xe251('0x15'))(_0xe251('0x16'));var utils=require('../../config/utils');var config=require(_0xe251('0x17'));var licenseUtil=require(_0xe251('0x18'));var db=require(_0xe251('0x19'))['db'];function respondWithStatusCode(_0x212c2e,_0x5ad4c5){_0x5ad4c5=_0x5ad4c5||0xcc;return function(_0x4df5ab){if(_0x4df5ab){return _0x212c2e[_0xe251('0x1a')](_0x5ad4c5);}return _0x212c2e[_0xe251('0x1b')](_0x5ad4c5)[_0xe251('0x1c')]();};}function respondWithResult(_0x358600,_0x3cd727){_0x3cd727=_0x3cd727||0xc8;return function(_0x2ebcd5){if(_0x2ebcd5){return _0x358600[_0xe251('0x1b')](_0x3cd727)[_0xe251('0x1d')](_0x2ebcd5);}};}function respondWithFilteredResult(_0xd134fc,_0x443ef1){return function(_0xbab3b7){if(_0xbab3b7){var _0x43cf64=typeof _0x443ef1[_0xe251('0x1e')]===_0xe251('0x1f')&&typeof _0x443ef1[_0xe251('0x20')]===_0xe251('0x1f');var _0x4de44f=_0xbab3b7[_0xe251('0x21')];var _0x98b0f5=_0x43cf64?0x0:_0x443ef1['offset'];var _0x480644=_0x43cf64?_0xbab3b7[_0xe251('0x21')]:_0x443ef1[_0xe251('0x1e')]+_0x443ef1[_0xe251('0x20')];var _0x344dbb;if(_0x480644>=_0x4de44f){_0x480644=_0x4de44f;_0x344dbb=0xc8;}else{_0x344dbb=0xce;}_0xd134fc['status'](_0x344dbb);return _0xd134fc[_0xe251('0x22')]('Content-Range',_0x98b0f5+'-'+_0x480644+'/'+_0x4de44f)[_0xe251('0x1d')](_0xbab3b7);}return null;};}function patchUpdates(_0x1c6246){return function(_0x240a16){try{jsonpatch['apply'](_0x240a16,_0x1c6246,!![]);}catch(_0x35ae01){return BPromise[_0xe251('0x23')](_0x35ae01);}return _0x240a16[_0xe251('0x24')]();};}function saveUpdates(_0x12ad4a,_0x4d0f35){return function(_0x29a278){if(_0x29a278){return _0x29a278[_0xe251('0x25')](_0x12ad4a)[_0xe251('0x26')](function(_0x555604){return _0x555604;});}return null;};}function removeEntity(_0xa3fd8f,_0x2ad652){return function(_0x414b6d){if(_0x414b6d){return _0x414b6d[_0xe251('0x27')]()[_0xe251('0x26')](function(){_0xa3fd8f[_0xe251('0x1b')](0xcc)[_0xe251('0x1c')]();});}};}function handleEntityNotFound(_0x1b6bc0,_0x5ba9fb){return function(_0x3620ca){if(!_0x3620ca){_0x1b6bc0[_0xe251('0x1a')](0x194);}return _0x3620ca;};}function handleError(_0xf21cc7,_0x2e52dc){_0x2e52dc=_0x2e52dc||0x1f4;return function(_0x5cfdc6){logger[_0xe251('0x28')](_0x5cfdc6['stack']);if(_0x5cfdc6[_0xe251('0x29')]){delete _0x5cfdc6[_0xe251('0x29')];}_0xf21cc7[_0xe251('0x1b')](_0x2e52dc)[_0xe251('0x2a')](_0x5cfdc6);};}exports[_0xe251('0x2b')]=function(_0x7b2aa9,_0x1eadfe){var _0x59faf4={},_0x1a64c5={},_0x19bee9={'count':0x0,'rows':[]};var _0x47fa38=_[_0xe251('0x2c')](db[_0xe251('0x2d')][_0xe251('0x2e')],function(_0x3adbdd){return{'name':_0x3adbdd[_0xe251('0x2f')],'type':_0x3adbdd[_0xe251('0x30')]['key']};});_0x1a64c5['model']=_[_0xe251('0x2c')](_0x47fa38,_0xe251('0x29'));_0x1a64c5[_0xe251('0x31')]=_[_0xe251('0x32')](_0x7b2aa9[_0xe251('0x31')]);_0x1a64c5[_0xe251('0x33')]=_[_0xe251('0x34')](_0x1a64c5[_0xe251('0x35')],_0x1a64c5[_0xe251('0x31')]);_0x59faf4['attributes']=_[_0xe251('0x34')](_0x1a64c5['model'],qs[_0xe251('0x36')](_0x7b2aa9['query'][_0xe251('0x36')]));_0x59faf4[_0xe251('0x37')]=_0x59faf4['attributes'][_0xe251('0x38')]?_0x59faf4[_0xe251('0x37')]:_0x1a64c5['model'];if(!_0x7b2aa9['query']['hasOwnProperty']('nolimit')){_0x59faf4[_0xe251('0x20')]=qs[_0xe251('0x20')](_0x7b2aa9['query']['limit']);_0x59faf4[_0xe251('0x1e')]=qs[_0xe251('0x1e')](_0x7b2aa9['query'][_0xe251('0x1e')]);}_0x59faf4['order']=qs['sort'](_0x7b2aa9['query'][_0xe251('0x39')]);_0x59faf4['where']=qs[_0xe251('0x33')](_[_0xe251('0x3a')](_0x7b2aa9[_0xe251('0x31')],_0x1a64c5[_0xe251('0x33')]),_0x47fa38);if(_0x7b2aa9[_0xe251('0x31')]['filter']){_0x59faf4[_0xe251('0x3b')]=_[_0xe251('0x3c')](_0x59faf4[_0xe251('0x3b')],{'$or':_[_0xe251('0x2c')](_0x47fa38,function(_0x3747a2){if(_0x3747a2[_0xe251('0x30')]!=='VIRTUAL'){var _0x2a8b4a={};_0x2a8b4a[_0x3747a2['name']]={'$like':'%'+_0x7b2aa9[_0xe251('0x31')][_0xe251('0x3d')]+'%'};return _0x2a8b4a;}})});}_0x59faf4=_[_0xe251('0x3c')]({},_0x59faf4,_0x7b2aa9[_0xe251('0x3e')]);var _0x18dc1a={'where':_0x59faf4[_0xe251('0x3b')]};return db[_0xe251('0x2d')]['count'](_0x18dc1a)[_0xe251('0x26')](function(_0x1b9603){_0x19bee9[_0xe251('0x21')]=_0x1b9603;if(_0x7b2aa9[_0xe251('0x31')]['includeAll']){_0x59faf4[_0xe251('0x3f')]=[{'all':!![]}];}return db[_0xe251('0x2d')][_0xe251('0x40')](_0x59faf4);})['then'](function(_0x2e7051){_0x19bee9[_0xe251('0x41')]=_0x2e7051;return _0x19bee9;})[_0xe251('0x26')](respondWithFilteredResult(_0x1eadfe,_0x59faf4))['catch'](handleError(_0x1eadfe,null));};exports[_0xe251('0x42')]=function(_0x3551ff,_0x19330b){var _0x266a34={'raw':!![],'where':{'id':_0x3551ff[_0xe251('0x43')]['id']}},_0x5e7e18={};_0x5e7e18[_0xe251('0x35')]=_[_0xe251('0x32')](db[_0xe251('0x2d')][_0xe251('0x2e')]);_0x5e7e18[_0xe251('0x31')]=_[_0xe251('0x32')](_0x3551ff[_0xe251('0x31')]);_0x5e7e18[_0xe251('0x33')]=_[_0xe251('0x34')](_0x5e7e18[_0xe251('0x35')],_0x5e7e18[_0xe251('0x31')]);_0x266a34['attributes']=_['intersection'](_0x5e7e18[_0xe251('0x35')],qs[_0xe251('0x36')](_0x3551ff[_0xe251('0x31')][_0xe251('0x36')]));_0x266a34[_0xe251('0x37')]=_0x266a34['attributes'][_0xe251('0x38')]?_0x266a34['attributes']:_0x5e7e18[_0xe251('0x35')];if(_0x3551ff['query']['includeAll']){_0x266a34[_0xe251('0x3f')]=[{'all':!![]}];}_0x266a34=_['merge']({},_0x266a34,_0x3551ff[_0xe251('0x3e')]);return db[_0xe251('0x2d')]['find'](_0x266a34)[_0xe251('0x26')](handleEntityNotFound(_0x19330b,null))[_0xe251('0x26')](respondWithResult(_0x19330b,null))['catch'](handleError(_0x19330b,null));};exports['create']=function(_0x3f4bfc,_0x5858f2){return db[_0xe251('0x2d')][_0xe251('0x44')](_0x3f4bfc[_0xe251('0x45')],{})[_0xe251('0x26')](respondWithResult(_0x5858f2,0xc9))['catch'](handleError(_0x5858f2,null));};exports['update']=function(_0x270b89,_0x25e0d6){if(_0x270b89[_0xe251('0x45')]['id']){delete _0x270b89[_0xe251('0x45')]['id'];}return db['Dynamics365Field'][_0xe251('0x46')]({'where':{'id':_0x270b89['params']['id']}})[_0xe251('0x26')](handleEntityNotFound(_0x25e0d6,null))[_0xe251('0x26')](saveUpdates(_0x270b89[_0xe251('0x45')],null))[_0xe251('0x26')](respondWithResult(_0x25e0d6,null))[_0xe251('0x47')](handleError(_0x25e0d6,null));};exports[_0xe251('0x27')]=function(_0x3cbfb4,_0x354c80){return db['Dynamics365Field']['find']({'where':{'id':_0x3cbfb4[_0xe251('0x43')]['id']}})[_0xe251('0x26')](handleEntityNotFound(_0x354c80,null))[_0xe251('0x26')](removeEntity(_0x354c80,null))[_0xe251('0x47')](handleError(_0x354c80,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 44b811d..f1e6851 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 _0x1c90=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c90,0x8d));var _0x01c9=function(_0x5ec85d,_0x5f2d97){_0x5ec85d=_0x5ec85d-0x0;var _0xb46af3=_0x1c90[_0x5ec85d];return _0xb46af3;};'use strict';var _=require('lodash');var util=require(_0x01c9('0x0'));var logger=require(_0x01c9('0x1'))(_0x01c9('0x2'));var moment=require(_0x01c9('0x3'));var BPromise=require(_0x01c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01c9('0x5'));var rimraf=require(_0x01c9('0x6'));var config=require(_0x01c9('0x7'));var attributes=require(_0x01c9('0x8'));module['exports']=function(_0x1d25bb,_0x45da6d){return _0x1d25bb[_0x01c9('0x9')](_0x01c9('0xa'),attributes,{'tableName':_0x01c9('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x01c9('0xc'),_0x01c9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b4=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xd8b4,0x91));var _0x4d8b=function(_0x1d7a48,_0x51490b){_0x1d7a48=_0x1d7a48-0x0;var _0xc0efea=_0xd8b4[_0x1d7a48];return _0xc0efea;};'use strict';var _=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var logger=require(_0x4d8b('0x2'))('api');var moment=require(_0x4d8b('0x3'));var BPromise=require(_0x4d8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d8b('0x5'));var rimraf=require(_0x4d8b('0x6'));var config=require(_0x4d8b('0x7'));var attributes=require(_0x4d8b('0x8'));module[_0x4d8b('0x9')]=function(_0x6a10fc,_0x3d518a){return _0x6a10fc[_0x4d8b('0xa')](_0x4d8b('0xb'),attributes,{'tableName':_0x4d8b('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x4d8b('0xd'),_0x4d8b('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 8c216d0..a201b0c 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 _0x1df1=['request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Field,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1df1,0x17b));var _0x11df=function(_0x5c9e56,_0x96c993){_0x5c9e56=_0x5c9e56-0x0;var _0x39bad7=_0x1df1[_0x5c9e56];return _0x39bad7;};'use strict';var _=require(_0x11df('0x0'));var util=require(_0x11df('0x1'));var moment=require(_0x11df('0x2'));var BPromise=require(_0x11df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11df('0x4'));var db=require(_0x11df('0x5'))['db'];var utils=require(_0x11df('0x6'));var logger=require(_0x11df('0x7'))(_0x11df('0x8'));var config=require(_0x11df('0x9'));var jayson=require(_0x11df('0xa'));var client=jayson[_0x11df('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x224404,_0x2bad3f,_0x16eb4e){return new BPromise(function(_0x31996f,_0x4568b3){return client[_0x11df('0xc')](_0x224404,_0x16eb4e)[_0x11df('0xd')](function(_0x1061e8){logger[_0x11df('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x2bad3f,_0x11df('0xf'));logger[_0x11df('0x10')](_0x11df('0x11'),_0x2bad3f,_0x11df('0xf'),JSON[_0x11df('0x12')](_0x1061e8));if(_0x1061e8[_0x11df('0x13')]){if(_0x1061e8[_0x11df('0x13')]['code']===0x1f4){logger[_0x11df('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2bad3f,_0x1061e8[_0x11df('0x13')]['message']);return _0x4568b3(_0x1061e8[_0x11df('0x13')][_0x11df('0x14')]);}logger[_0x11df('0x13')](_0x11df('0x15'),_0x2bad3f,_0x1061e8['error'][_0x11df('0x14')]);return _0x31996f(_0x1061e8[_0x11df('0x13')][_0x11df('0x14')]);}else{logger[_0x11df('0xe')](_0x11df('0x15'),_0x2bad3f,_0x11df('0xf'));_0x31996f(_0x1061e8['result'][_0x11df('0x14')]);}})[_0x11df('0x16')](function(_0x12df11){logger['error'](_0x11df('0x15'),_0x2bad3f,_0x12df11);_0x4568b3(_0x12df11);});});} \ No newline at end of file +var _0x89d5=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0xac53d2,_0x121075){var _0x2e5759=function(_0x382b9e){while(--_0x382b9e){_0xac53d2['push'](_0xac53d2['shift']());}};_0x2e5759(++_0x121075);}(_0x89d5,0x94));var _0x589d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x89d5[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x589d('0x0'));var util=require('util');var moment=require(_0x589d('0x1'));var BPromise=require(_0x589d('0x2'));var rs=require(_0x589d('0x3'));var fs=require('fs');var Redis=require(_0x589d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x589d('0x5'));var logger=require('../../config/logger')(_0x589d('0x6'));var config=require('../../config/environment');var jayson=require(_0x589d('0x7'));var client=jayson[_0x589d('0x8')][_0x589d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x562931,_0x6c1af1,_0x4fa4d5){return new BPromise(function(_0x8debb,_0x2f8063){return client[_0x589d('0xa')](_0x562931,_0x4fa4d5)[_0x589d('0xb')](function(_0x12f315){logger[_0x589d('0xc')](_0x589d('0xd'),_0x6c1af1,_0x589d('0xe'));logger[_0x589d('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x6c1af1,'request\x20sent',JSON[_0x589d('0x10')](_0x12f315));if(_0x12f315['error']){if(_0x12f315['error']['code']===0x1f4){logger[_0x589d('0x11')](_0x589d('0xd'),_0x6c1af1,_0x12f315[_0x589d('0x11')][_0x589d('0x12')]);return _0x2f8063(_0x12f315[_0x589d('0x11')]['message']);}logger['error'](_0x589d('0xd'),_0x6c1af1,_0x12f315['error'][_0x589d('0x12')]);return _0x8debb(_0x12f315[_0x589d('0x11')][_0x589d('0x12')]);}else{logger[_0x589d('0xc')](_0x589d('0xd'),_0x6c1af1,_0x589d('0xe'));_0x8debb(_0x12f315[_0x589d('0x13')][_0x589d('0x12')]);}})[_0x589d('0x14')](function(_0x274906){logger[_0x589d('0x11')](_0x589d('0xd'),_0x6c1af1,_0x274906);_0x2f8063(_0x274906);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 782a5eb..80ed18c 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 _0xd1de=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd1de,0x1df));var _0xed1d=function(_0x436882,_0x773db9){_0x436882=_0x436882-0x0;var _0x47c573=_0xd1de[_0x436882];return _0x47c573;};'use strict';var multer=require(_0xed1d('0x0'));var util=require('util');var path=require(_0xed1d('0x1'));var timeout=require(_0xed1d('0x2'));var express=require(_0xed1d('0x3'));var router=express[_0xed1d('0x4')]();var fs_extra=require(_0xed1d('0x5'));var auth=require(_0xed1d('0x6'));var interaction=require(_0xed1d('0x7'));var config=require(_0xed1d('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xed1d('0x9')]('/',auth[_0xed1d('0xa')](),controller['index']);router[_0xed1d('0x9')](_0xed1d('0xb'),auth[_0xed1d('0xa')](),controller[_0xed1d('0xc')]);router[_0xed1d('0x9')](_0xed1d('0xd'),auth['isAuthenticated'](),controller[_0xed1d('0xe')]);router[_0xed1d('0x9')](_0xed1d('0xf'),auth[_0xed1d('0xa')](),controller['getFields']);router[_0xed1d('0x10')]('/',auth[_0xed1d('0xa')](),controller[_0xed1d('0x11')]);router[_0xed1d('0x10')](_0xed1d('0xd'),auth[_0xed1d('0xa')](),controller[_0xed1d('0x12')]);router[_0xed1d('0x13')](_0xed1d('0xb'),auth[_0xed1d('0xa')](),controller['update']);router[_0xed1d('0x14')](_0xed1d('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xed1d('0x15')]=router; \ No newline at end of file +var _0xe4c8=['./intFreshdeskAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x569b01,_0x4df4ba){var _0x5be0ed=function(_0x584538){while(--_0x584538){_0x569b01['push'](_0x569b01['shift']());}};_0x5be0ed(++_0x4df4ba);}(_0xe4c8,0x1dd));var _0x8e4c=function(_0x89e691,_0x3fd7be){_0x89e691=_0x89e691-0x0;var _0x1aa710=_0xe4c8[_0x89e691];return _0x1aa710;};'use strict';var multer=require(_0x8e4c('0x0'));var util=require('util');var path=require(_0x8e4c('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e4c('0x2'));var router=express[_0x8e4c('0x3')]();var fs_extra=require(_0x8e4c('0x4'));var auth=require(_0x8e4c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e4c('0x6'));var controller=require(_0x8e4c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8e4c('0x8')]);router['get'](_0x8e4c('0x9'),auth[_0x8e4c('0xa')](),controller[_0x8e4c('0xb')]);router[_0x8e4c('0xc')](_0x8e4c('0xd'),auth[_0x8e4c('0xa')](),controller[_0x8e4c('0xe')]);router[_0x8e4c('0xc')](_0x8e4c('0xf'),auth[_0x8e4c('0xa')](),controller[_0x8e4c('0x10')]);router[_0x8e4c('0x11')]('/',auth[_0x8e4c('0xa')](),controller[_0x8e4c('0x12')]);router['post'](_0x8e4c('0xd'),auth[_0x8e4c('0xa')](),controller['addConfiguration']);router[_0x8e4c('0x13')](_0x8e4c('0x9'),auth[_0x8e4c('0xa')](),controller[_0x8e4c('0x14')]);router[_0x8e4c('0x15')](_0x8e4c('0x9'),auth[_0x8e4c('0xa')](),controller['destroy']);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 9a11dad..a5bdba6 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 _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5844c3,_0x13fc8c){var _0x3a4d56=function(_0x24328e){while(--_0x24328e){_0x5844c3['push'](_0x5844c3['shift']());}};_0x3a4d56(++_0x13fc8c);}(_0x1a37,0xb4));var _0x71a3=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1a37[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x32f4=['sequelize','exports','STRING','username','remoteUri'];(function(_0x532685,_0x1a38c2){var _0x21426a=function(_0xa48343){while(--_0xa48343){_0x532685['push'](_0x532685['shift']());}};_0x21426a(++_0x1a38c2);}(_0x32f4,0x154));var _0x432f=function(_0x2216f4,_0x47f1fc){_0x2216f4=_0x2216f4-0x0;var _0x1ebf36=_0x32f4[_0x2216f4];return _0x1ebf36;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'name':{'type':Sequelize[_0x432f('0x2')]},'description':{'type':Sequelize[_0x432f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x432f('0x3')},'apiKey':{'type':Sequelize[_0x432f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x432f('0x4')},'serverUrl':{'type':Sequelize[_0x432f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1ae4c4e..493edb8 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 _0x65d2=['filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','params','includeAll','include','find','create','body','update','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','type','model','query','keys'];(function(_0x5a8ac9,_0x598af9){var _0x4b3f27=function(_0x21a101){while(--_0x21a101){_0x5a8ac9['push'](_0x5a8ac9['shift']());}};_0x4b3f27(++_0x598af9);}(_0x65d2,0xb8));var _0x265d=function(_0x396c16,_0x29a6a6){_0x396c16=_0x396c16-0x0;var _0xca6331=_0x65d2[_0x396c16];return _0xca6331;};'use strict';var emlformat=require(_0x265d('0x0'));var rimraf=require(_0x265d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x265d('0x2'));var rp=require(_0x265d('0x3'));var moment=require(_0x265d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x265d('0x5'));var util=require(_0x265d('0x6'));var path=require(_0x265d('0x7'));var sox=require('sox');var csv=require(_0x265d('0x8'));var ejs=require(_0x265d('0x9'));var fs=require('fs');var fs_extra=require(_0x265d('0xa'));var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x8'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var Redis=require('ioredis');var authService=require(_0x265d('0x11'));var qs=require(_0x265d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x265d('0x13'));var logger=require(_0x265d('0x14'))(_0x265d('0x15'));var utils=require(_0x265d('0x16'));var config=require(_0x265d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x265d('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c1ea2,_0x24cb9d){_0x24cb9d=_0x24cb9d||0xcc;return function(_0x468ec7){if(_0x468ec7){return _0x4c1ea2[_0x265d('0x19')](_0x24cb9d);}return _0x4c1ea2[_0x265d('0x1a')](_0x24cb9d)[_0x265d('0x1b')]();};}function respondWithResult(_0x5e04f6,_0x97bfdf){_0x97bfdf=_0x97bfdf||0xc8;return function(_0x13fff5){if(_0x13fff5){return _0x5e04f6[_0x265d('0x1a')](_0x97bfdf)[_0x265d('0x1c')](_0x13fff5);}};}function respondWithFilteredResult(_0x21e99b,_0x183f31){return function(_0x29a163){if(_0x29a163){var _0x282c63=typeof _0x183f31[_0x265d('0x1d')]===_0x265d('0x1e')&&typeof _0x183f31[_0x265d('0x1f')]===_0x265d('0x1e');var _0x5bee1=_0x29a163[_0x265d('0x20')];var _0x258198=_0x282c63?0x0:_0x183f31[_0x265d('0x1d')];var _0x4b0637=_0x282c63?_0x29a163[_0x265d('0x20')]:_0x183f31[_0x265d('0x1d')]+_0x183f31[_0x265d('0x1f')];var _0x3ceee1;if(_0x4b0637>=_0x5bee1){_0x4b0637=_0x5bee1;_0x3ceee1=0xc8;}else{_0x3ceee1=0xce;}_0x21e99b[_0x265d('0x1a')](_0x3ceee1);return _0x21e99b['set']('Content-Range',_0x258198+'-'+_0x4b0637+'/'+_0x5bee1)[_0x265d('0x1c')](_0x29a163);}return null;};}function patchUpdates(_0x1ff5b6){return function(_0x56f829){try{jsonpatch[_0x265d('0x21')](_0x56f829,_0x1ff5b6,!![]);}catch(_0x5ca918){return BPromise['reject'](_0x5ca918);}return _0x56f829[_0x265d('0x22')]();};}function saveUpdates(_0x24245b,_0x36a480){return function(_0xe45474){if(_0xe45474){return _0xe45474['update'](_0x24245b)[_0x265d('0x23')](function(_0xc821d2){return _0xc821d2;});}return null;};}function removeEntity(_0x3304e5,_0xf807aa){return function(_0x2a06cd){if(_0x2a06cd){return _0x2a06cd[_0x265d('0x24')]()[_0x265d('0x23')](function(){_0x3304e5[_0x265d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6916db,_0x1fa6b5){return function(_0x248fa3){if(!_0x248fa3){_0x6916db[_0x265d('0x19')](0x194);}return _0x248fa3;};}function handleError(_0x2d1c3d,_0x3c163a){_0x3c163a=_0x3c163a||0x1f4;return function(_0x4e7112){logger[_0x265d('0x25')](_0x4e7112[_0x265d('0x26')]);if(_0x4e7112['name']){delete _0x4e7112[_0x265d('0x27')];}_0x2d1c3d[_0x265d('0x1a')](_0x3c163a)['send'](_0x4e7112);};}exports[_0x265d('0x28')]=function(_0x55e69f,_0x311872){var _0x3873c3={},_0x27c851={},_0x1a3eeb={'count':0x0,'rows':[]};var _0xe326e2=_[_0x265d('0x29')](db[_0x265d('0x2a')][_0x265d('0x2b')],function(_0x213933){return{'name':_0x213933['fieldName'],'type':_0x213933[_0x265d('0x2c')]['key']};});_0x27c851[_0x265d('0x2d')]=_[_0x265d('0x29')](_0xe326e2,_0x265d('0x27'));_0x27c851[_0x265d('0x2e')]=_[_0x265d('0x2f')](_0x55e69f['query']);_0x27c851[_0x265d('0x30')]=_['intersection'](_0x27c851[_0x265d('0x2d')],_0x27c851[_0x265d('0x2e')]);_0x3873c3['attributes']=_[_0x265d('0x31')](_0x27c851[_0x265d('0x2d')],qs['fields'](_0x55e69f[_0x265d('0x2e')][_0x265d('0x32')]));_0x3873c3[_0x265d('0x33')]=_0x3873c3[_0x265d('0x33')][_0x265d('0x34')]?_0x3873c3['attributes']:_0x27c851['model'];if(!_0x55e69f[_0x265d('0x2e')]['hasOwnProperty'](_0x265d('0x35'))){_0x3873c3[_0x265d('0x1f')]=qs[_0x265d('0x1f')](_0x55e69f[_0x265d('0x2e')][_0x265d('0x1f')]);_0x3873c3['offset']=qs[_0x265d('0x1d')](_0x55e69f['query'][_0x265d('0x1d')]);}_0x3873c3[_0x265d('0x36')]=qs[_0x265d('0x37')](_0x55e69f['query'][_0x265d('0x37')]);_0x3873c3[_0x265d('0x38')]=qs[_0x265d('0x30')](_[_0x265d('0x39')](_0x55e69f[_0x265d('0x2e')],_0x27c851['filters']),_0xe326e2);if(_0x55e69f['query'][_0x265d('0x3a')]){_0x3873c3[_0x265d('0x38')]=_[_0x265d('0x3b')](_0x3873c3['where'],{'$or':_['map'](_0xe326e2,function(_0x416a4d){if(_0x416a4d[_0x265d('0x2c')]!==_0x265d('0x3c')){var _0x577977={};_0x577977[_0x416a4d['name']]={'$like':'%'+_0x55e69f['query']['filter']+'%'};return _0x577977;}})});}_0x3873c3=_[_0x265d('0x3b')]({},_0x3873c3,_0x55e69f[_0x265d('0x3d')]);var _0x4315e0={'where':_0x3873c3[_0x265d('0x38')]};return db['FreshdeskAccount']['count'](_0x4315e0)[_0x265d('0x23')](function(_0x243878){_0x1a3eeb[_0x265d('0x20')]=_0x243878;if(_0x55e69f[_0x265d('0x2e')]['includeAll']){_0x3873c3['include']=[{'all':!![]}];}return db[_0x265d('0x2a')][_0x265d('0x3e')](_0x3873c3);})[_0x265d('0x23')](function(_0x59242e){_0x1a3eeb['rows']=_0x59242e;return _0x1a3eeb;})['then'](respondWithFilteredResult(_0x311872,_0x3873c3))[_0x265d('0x3f')](handleError(_0x311872,null));};exports['show']=function(_0x5c50b8,_0x1d915a){var _0x3329b9={'raw':![],'where':{'id':_0x5c50b8[_0x265d('0x40')]['id']}},_0x1275c3={};_0x1275c3['model']=_['keys'](db[_0x265d('0x2a')]['rawAttributes']);_0x1275c3[_0x265d('0x2e')]=_[_0x265d('0x2f')](_0x5c50b8['query']);_0x1275c3[_0x265d('0x30')]=_[_0x265d('0x31')](_0x1275c3[_0x265d('0x2d')],_0x1275c3['query']);_0x3329b9['attributes']=_[_0x265d('0x31')](_0x1275c3[_0x265d('0x2d')],qs[_0x265d('0x32')](_0x5c50b8['query'][_0x265d('0x32')]));_0x3329b9[_0x265d('0x33')]=_0x3329b9['attributes'][_0x265d('0x34')]?_0x3329b9[_0x265d('0x33')]:_0x1275c3['model'];if(_0x5c50b8[_0x265d('0x2e')][_0x265d('0x41')]){_0x3329b9[_0x265d('0x42')]=[{'all':!![]}];}_0x3329b9=_[_0x265d('0x3b')]({},_0x3329b9,_0x5c50b8[_0x265d('0x3d')]);return db[_0x265d('0x2a')][_0x265d('0x43')](_0x3329b9)[_0x265d('0x23')](handleEntityNotFound(_0x1d915a,null))['then'](respondWithResult(_0x1d915a,null))[_0x265d('0x3f')](handleError(_0x1d915a,null));};exports[_0x265d('0x44')]=function(_0xcbc1cc,_0x9234f0){return db[_0x265d('0x2a')][_0x265d('0x44')](_0xcbc1cc[_0x265d('0x45')],{})['then'](respondWithResult(_0x9234f0,0xc9))[_0x265d('0x3f')](handleError(_0x9234f0,null));};exports[_0x265d('0x46')]=function(_0x3d2acf,_0xb0d26d){if(_0x3d2acf[_0x265d('0x45')]['id']){delete _0x3d2acf[_0x265d('0x45')]['id'];}return db[_0x265d('0x2a')]['find']({'where':{'id':_0x3d2acf[_0x265d('0x40')]['id']}})[_0x265d('0x23')](handleEntityNotFound(_0xb0d26d,null))[_0x265d('0x23')](saveUpdates(_0x3d2acf[_0x265d('0x45')],null))[_0x265d('0x23')](respondWithResult(_0xb0d26d,null))['catch'](handleError(_0xb0d26d,null));};exports[_0x265d('0x24')]=function(_0x3738a6,_0x467634){return db[_0x265d('0x2a')][_0x265d('0x43')]({'where':{'id':_0x3738a6[_0x265d('0x40')]['id']}})[_0x265d('0x23')](handleEntityNotFound(_0x467634,null))[_0x265d('0x23')](removeEntity(_0x467634,null))[_0x265d('0x3f')](handleError(_0x467634,null));};exports['getConfigurations']=function(_0x4cd2bc,_0x1cbeb4,_0x141a9a){var _0x87b9d7={};var _0x4649af={};var _0x59023d;var _0x17b2c5;return db[_0x265d('0x2a')][_0x265d('0x47')]({'where':{'id':_0x4cd2bc['params']['id']}})[_0x265d('0x23')](handleEntityNotFound(_0x1cbeb4,null))[_0x265d('0x23')](function(_0x589817){if(_0x589817){_0x59023d=_0x589817;_0x4649af[_0x265d('0x2d')]=_[_0x265d('0x2f')](db['FreshdeskConfiguration'][_0x265d('0x2b')]);_0x4649af[_0x265d('0x2e')]=_['keys'](_0x4cd2bc[_0x265d('0x2e')]);_0x4649af['filters']=_[_0x265d('0x31')](_0x4649af[_0x265d('0x2d')],_0x4649af[_0x265d('0x2e')]);_0x87b9d7['attributes']=_['intersection'](_0x4649af[_0x265d('0x2d')],qs['fields'](_0x4cd2bc[_0x265d('0x2e')][_0x265d('0x32')]));_0x87b9d7['attributes']=_0x87b9d7[_0x265d('0x33')][_0x265d('0x34')]?_0x87b9d7[_0x265d('0x33')]:_0x4649af[_0x265d('0x2d')];_0x87b9d7[_0x265d('0x36')]=qs[_0x265d('0x37')](_0x4cd2bc['query']['sort']);_0x87b9d7[_0x265d('0x38')]=qs[_0x265d('0x30')](_['pick'](_0x4cd2bc[_0x265d('0x2e')],_0x4649af['filters']));if(_0x4cd2bc['query'][_0x265d('0x3a')]){_0x87b9d7[_0x265d('0x38')]=_['merge'](_0x87b9d7[_0x265d('0x38')],{'$or':_[_0x265d('0x29')](_0x87b9d7[_0x265d('0x33')],function(_0xdda331){var _0x4aec41={};_0x4aec41[_0xdda331]={'$like':'%'+_0x4cd2bc['query'][_0x265d('0x3a')]+'%'};return _0x4aec41;})});}_0x87b9d7=_[_0x265d('0x3b')]({},_0x87b9d7,_0x4cd2bc[_0x265d('0x3d')]);return _0x59023d[_0x265d('0x48')](_0x87b9d7);}})[_0x265d('0x23')](function(_0x664242){if(_0x664242){_0x17b2c5=_0x664242[_0x265d('0x34')];if(!_0x4cd2bc[_0x265d('0x2e')][_0x265d('0x49')](_0x265d('0x35'))){_0x87b9d7[_0x265d('0x1f')]=qs[_0x265d('0x1f')](_0x4cd2bc[_0x265d('0x2e')][_0x265d('0x1f')]);_0x87b9d7[_0x265d('0x1d')]=qs[_0x265d('0x1d')](_0x4cd2bc[_0x265d('0x2e')][_0x265d('0x1d')]);}return _0x59023d['getConfigurations'](_0x87b9d7);}})['then'](function(_0x5c9972){if(_0x5c9972){return _0x5c9972?{'count':_0x17b2c5,'rows':_0x5c9972}:null;}})[_0x265d('0x23')](respondWithResult(_0x1cbeb4,null))[_0x265d('0x3f')](handleError(_0x1cbeb4,null));};exports[_0x265d('0x4a')]=function(_0x2db413,_0x53fee8,_0x465a59){if(_0x2db413[_0x265d('0x45')]['id']){delete _0x2db413[_0x265d('0x45')]['id'];}return db[_0x265d('0x2a')]['findOne']({'where':{'id':_0x2db413[_0x265d('0x40')]['id']}})[_0x265d('0x23')](handleEntityNotFound(_0x53fee8,null))[_0x265d('0x23')](function(_0x13f04e){if(_0x13f04e){_0x2db413[_0x265d('0x45')][_0x265d('0x4b')]=_0x13f04e['id'];_0x2db413[_0x265d('0x45')][_0x265d('0x4c')]=integrations[_0x265d('0x4d')](_0x2db413[_0x265d('0x45')][_0x265d('0x4e')],_0x2db413[_0x265d('0x45')]['type']);_0x2db413[_0x265d('0x45')][_0x265d('0x4f')]=integrations[_0x265d('0x50')](_0x2db413[_0x265d('0x45')][_0x265d('0x4e')],_0x2db413[_0x265d('0x45')][_0x265d('0x2c')]);return db[_0x265d('0x51')][_0x265d('0x44')](_0x2db413[_0x265d('0x45')],{'include':[{'model':db[_0x265d('0x52')],'as':'Subjects'},{'model':db[_0x265d('0x52')],'as':_0x265d('0x4f')}]});}return null;})[_0x265d('0x23')](respondWithResult(_0x53fee8,null))[_0x265d('0x3f')](handleError(_0x53fee8,null));};exports[_0x265d('0x53')]=function(_0x5d4a51,_0x1321a7,_0x5f0c5c){var _0xc640b3='';return db[_0x265d('0x2a')][_0x265d('0x47')]({'where':{'id':_0x5d4a51[_0x265d('0x40')]['id']},'attributes':['id','remoteUri',_0x265d('0x54')]})[_0x265d('0x23')](handleEntityNotFound(_0x1321a7,null))['then'](function(_0x38fdce){if(_0x38fdce){_0xc640b3=_0x38fdce[_0x265d('0x55')];var _0xf5fecd=_0xc640b3[_0x265d('0x56')](-0x1);if(_0xf5fecd==='/'){_0xc640b3=_0xc640b3[_0x265d('0x57')](0x0,_0xc640b3['lastIndexOf'](_0xf5fecd));}return rp({'method':_0x265d('0x58'),'uri':util[_0x265d('0x59')](_0x265d('0x5a'),_0xc640b3,_0x265d('0x5b')),'headers':{'Authorization':util[_0x265d('0x59')](_0x265d('0x5c'),new Buffer(util[_0x265d('0x59')](_0x265d('0x5d'),_0x38fdce[_0x265d('0x54')]))[_0x265d('0x5e')]('base64'))},'json':!![]});}})[_0x265d('0x23')](function(_0x28b76e){if(_0x28b76e){var _0x403094=[_0x265d('0x5f'),_0x265d('0x60'),_0x265d('0x61'),'description',_0x265d('0x1a'),_0x265d('0x62'),_0x265d('0x63'),_0x265d('0x64'),_0x265d('0x65'),'group',_0x265d('0x66')];_['remove'](_0x28b76e,function(_0x5c2635){return _0x403094[_0x265d('0x67')](_0x5c2635[_0x265d('0x27')])||!_0x5c2635[_0x265d('0x68')]&&_0x5c2635[_0x265d('0x2c')]!==_0x265d('0x69')&&_0x5c2635[_0x265d('0x2c')]!==_0x265d('0x6a');});return{'count':_0x28b76e[_0x265d('0x34')],'rows':_['map'](_0x28b76e,function(_0x1429ac){return{'id':_0x1429ac[_0x265d('0x27')],'name':_0x1429ac[_0x265d('0x6b')],'custom':!_0x1429ac[_0x265d('0x68')],'options':_0x1429ac['choices']?_[_0x265d('0x29')](_0x1429ac[_0x265d('0x6c')],function(_0x428dce){return{'name':_[_0x265d('0x6d')](_0x428dce),'value':_0x428dce};}):[]};})};}})[_0x265d('0x23')](respondWithResult(_0x1321a7,null))[_0x265d('0x3f')](function(_0x3062e4){var _0x3d09f8=_0x5d4a51['query']['test']?0x1f4:_0x3062e4[_0x265d('0x6e')]||0x1f4;logger['error'](_0x265d('0x6f'),_0x265d('0x53'),_0x3d09f8,JSON[_0x265d('0x70')](_0x3062e4));delete _0x3062e4[_0x265d('0x27')];if(_0x3d09f8===0x191){_0x3d09f8=0x190;}_0x1321a7[_0x265d('0x1a')](_0x3d09f8)[_0x265d('0x71')](_0x5d4a51[_0x265d('0x2e')][_0x265d('0x72')]?{'message':_0x265d('0x73'),'statusCode':_0x3062e4[_0x265d('0x6e')]}:_0x3062e4);});}; \ No newline at end of file +var _0x5d31=['apiKey','toString','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','custom_text','custom_dropdown','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','fields','find','create','body','params','FreshdeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','findOne','remoteUri','slice','substring','lastIndexOf','format','%s/%s','Basic\x20%s'];(function(_0x3e95fa,_0x4a8036){var _0x125ec2=function(_0x1576f3){while(--_0x1576f3){_0x3e95fa['push'](_0x3e95fa['shift']());}};_0x125ec2(++_0x4a8036);}(_0x5d31,0xf7));var _0x15d3=function(_0x64bfc4,_0x46d7fe){_0x64bfc4=_0x64bfc4-0x0;var _0x4f6d04=_0x5d31[_0x64bfc4];return _0x4f6d04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x15d3('0x15'));function respondWithStatusCode(_0x1397d8,_0x2811b5){_0x2811b5=_0x2811b5||0xcc;return function(_0x209104){if(_0x209104){return _0x1397d8[_0x15d3('0x16')](_0x2811b5);}return _0x1397d8[_0x15d3('0x17')](_0x2811b5)[_0x15d3('0x18')]();};}function respondWithResult(_0x1658cf,_0x44b5a4){_0x44b5a4=_0x44b5a4||0xc8;return function(_0x316945){if(_0x316945){return _0x1658cf[_0x15d3('0x17')](_0x44b5a4)['json'](_0x316945);}};}function respondWithFilteredResult(_0x304a13,_0x17401b){return function(_0x5bbfef){if(_0x5bbfef){var _0xf93348=typeof _0x17401b[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x17401b[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x2c25ba=_0x5bbfef[_0x15d3('0x1c')];var _0x31b43d=_0xf93348?0x0:_0x17401b[_0x15d3('0x19')];var _0x15fe0a=_0xf93348?_0x5bbfef[_0x15d3('0x1c')]:_0x17401b['offset']+_0x17401b[_0x15d3('0x1b')];var _0x3dc5be;if(_0x15fe0a>=_0x2c25ba){_0x15fe0a=_0x2c25ba;_0x3dc5be=0xc8;}else{_0x3dc5be=0xce;}_0x304a13['status'](_0x3dc5be);return _0x304a13['set']('Content-Range',_0x31b43d+'-'+_0x15fe0a+'/'+_0x2c25ba)['json'](_0x5bbfef);}return null;};}function patchUpdates(_0x39bb05){return function(_0x154eda){try{jsonpatch[_0x15d3('0x1d')](_0x154eda,_0x39bb05,!![]);}catch(_0x183ec7){return BPromise[_0x15d3('0x1e')](_0x183ec7);}return _0x154eda[_0x15d3('0x1f')]();};}function saveUpdates(_0x4da198,_0x49eb89){return function(_0x32f1c6){if(_0x32f1c6){return _0x32f1c6[_0x15d3('0x20')](_0x4da198)[_0x15d3('0x21')](function(_0x72852f){return _0x72852f;});}return null;};}function removeEntity(_0x5b06cc,_0x232078){return function(_0x2dea07){if(_0x2dea07){return _0x2dea07[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){_0x5b06cc[_0x15d3('0x17')](0xcc)[_0x15d3('0x18')]();});}};}function handleEntityNotFound(_0x4a499a,_0x514380){return function(_0x50f171){if(!_0x50f171){_0x4a499a[_0x15d3('0x16')](0x194);}return _0x50f171;};}function handleError(_0x1cd5bc,_0x23e1f8){_0x23e1f8=_0x23e1f8||0x1f4;return function(_0x374fa4){logger[_0x15d3('0x23')](_0x374fa4[_0x15d3('0x24')]);if(_0x374fa4[_0x15d3('0x25')]){delete _0x374fa4[_0x15d3('0x25')];}_0x1cd5bc[_0x15d3('0x17')](_0x23e1f8)['send'](_0x374fa4);};}exports['index']=function(_0x164aa1,_0x4e5840){var _0x6a9c0c={},_0x5a2ccf={},_0x314c27={'count':0x0,'rows':[]};var _0x1ad737=_['map'](db[_0x15d3('0x26')][_0x15d3('0x27')],function(_0x477624){return{'name':_0x477624[_0x15d3('0x28')],'type':_0x477624[_0x15d3('0x29')][_0x15d3('0x2a')]};});_0x5a2ccf[_0x15d3('0x2b')]=_[_0x15d3('0x2c')](_0x1ad737,_0x15d3('0x25'));_0x5a2ccf[_0x15d3('0x2d')]=_['keys'](_0x164aa1[_0x15d3('0x2d')]);_0x5a2ccf[_0x15d3('0x2e')]=_[_0x15d3('0x2f')](_0x5a2ccf[_0x15d3('0x2b')],_0x5a2ccf[_0x15d3('0x2d')]);_0x6a9c0c[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x5a2ccf[_0x15d3('0x2b')],qs['fields'](_0x164aa1[_0x15d3('0x2d')]['fields']));_0x6a9c0c[_0x15d3('0x30')]=_0x6a9c0c[_0x15d3('0x30')][_0x15d3('0x31')]?_0x6a9c0c[_0x15d3('0x30')]:_0x5a2ccf[_0x15d3('0x2b')];if(!_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x32')](_0x15d3('0x33'))){_0x6a9c0c[_0x15d3('0x1b')]=qs[_0x15d3('0x1b')](_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x1b')]);_0x6a9c0c[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x164aa1[_0x15d3('0x2d')]['offset']);}_0x6a9c0c[_0x15d3('0x34')]=qs[_0x15d3('0x35')](_0x164aa1['query'][_0x15d3('0x35')]);_0x6a9c0c[_0x15d3('0x36')]=qs[_0x15d3('0x2e')](_['pick'](_0x164aa1[_0x15d3('0x2d')],_0x5a2ccf['filters']),_0x1ad737);if(_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x37')]){_0x6a9c0c['where']=_[_0x15d3('0x38')](_0x6a9c0c[_0x15d3('0x36')],{'$or':_[_0x15d3('0x2c')](_0x1ad737,function(_0x114546){if(_0x114546[_0x15d3('0x29')]!==_0x15d3('0x39')){var _0x4aef99={};_0x4aef99[_0x114546[_0x15d3('0x25')]]={'$like':'%'+_0x164aa1['query'][_0x15d3('0x37')]+'%'};return _0x4aef99;}})});}_0x6a9c0c=_[_0x15d3('0x38')]({},_0x6a9c0c,_0x164aa1[_0x15d3('0x3a')]);var _0x289399={'where':_0x6a9c0c[_0x15d3('0x36')]};return db[_0x15d3('0x26')][_0x15d3('0x1c')](_0x289399)[_0x15d3('0x21')](function(_0x1d5dc4){_0x314c27[_0x15d3('0x1c')]=_0x1d5dc4;if(_0x164aa1['query'][_0x15d3('0x3b')]){_0x6a9c0c[_0x15d3('0x3c')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x6a9c0c);})[_0x15d3('0x21')](function(_0x1df387){_0x314c27[_0x15d3('0x3d')]=_0x1df387;return _0x314c27;})[_0x15d3('0x21')](respondWithFilteredResult(_0x4e5840,_0x6a9c0c))[_0x15d3('0x3e')](handleError(_0x4e5840,null));};exports[_0x15d3('0x3f')]=function(_0x1240e5,_0x442faf){var _0x25fa1d={'raw':![],'where':{'id':_0x1240e5['params']['id']}},_0x26ba7d={};_0x26ba7d[_0x15d3('0x2b')]=_[_0x15d3('0x40')](db['FreshdeskAccount'][_0x15d3('0x27')]);_0x26ba7d['query']=_['keys'](_0x1240e5[_0x15d3('0x2d')]);_0x26ba7d[_0x15d3('0x2e')]=_[_0x15d3('0x2f')](_0x26ba7d['model'],_0x26ba7d[_0x15d3('0x2d')]);_0x25fa1d['attributes']=_[_0x15d3('0x2f')](_0x26ba7d[_0x15d3('0x2b')],qs[_0x15d3('0x41')](_0x1240e5[_0x15d3('0x2d')][_0x15d3('0x41')]));_0x25fa1d['attributes']=_0x25fa1d['attributes']['length']?_0x25fa1d[_0x15d3('0x30')]:_0x26ba7d['model'];if(_0x1240e5[_0x15d3('0x2d')][_0x15d3('0x3b')]){_0x25fa1d[_0x15d3('0x3c')]=[{'all':!![]}];}_0x25fa1d=_['merge']({},_0x25fa1d,_0x1240e5[_0x15d3('0x3a')]);return db[_0x15d3('0x26')][_0x15d3('0x42')](_0x25fa1d)[_0x15d3('0x21')](handleEntityNotFound(_0x442faf,null))[_0x15d3('0x21')](respondWithResult(_0x442faf,null))[_0x15d3('0x3e')](handleError(_0x442faf,null));};exports[_0x15d3('0x43')]=function(_0x46a39a,_0x2ab032){return db[_0x15d3('0x26')][_0x15d3('0x43')](_0x46a39a[_0x15d3('0x44')],{})['then'](respondWithResult(_0x2ab032,0xc9))['catch'](handleError(_0x2ab032,null));};exports[_0x15d3('0x20')]=function(_0x446929,_0x13faa2){if(_0x446929['body']['id']){delete _0x446929['body']['id'];}return db[_0x15d3('0x26')]['find']({'where':{'id':_0x446929[_0x15d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x13faa2,null))[_0x15d3('0x21')](saveUpdates(_0x446929[_0x15d3('0x44')],null))['then'](respondWithResult(_0x13faa2,null))['catch'](handleError(_0x13faa2,null));};exports['destroy']=function(_0x5222bf,_0x5547ab){return db[_0x15d3('0x26')][_0x15d3('0x42')]({'where':{'id':_0x5222bf['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x5547ab,null))[_0x15d3('0x21')](removeEntity(_0x5547ab,null))[_0x15d3('0x3e')](handleError(_0x5547ab,null));};exports['getConfigurations']=function(_0x19d713,_0x42092c,_0x284de9){var _0xaf3949={};var _0x3bc48f={};var _0x22a32b;var _0x5f0a42;return db[_0x15d3('0x26')]['findOne']({'where':{'id':_0x19d713['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x42092c,null))['then'](function(_0x16e6bc){if(_0x16e6bc){_0x22a32b=_0x16e6bc;_0x3bc48f['model']=_[_0x15d3('0x40')](db[_0x15d3('0x46')][_0x15d3('0x27')]);_0x3bc48f[_0x15d3('0x2d')]=_[_0x15d3('0x40')](_0x19d713['query']);_0x3bc48f['filters']=_[_0x15d3('0x2f')](_0x3bc48f['model'],_0x3bc48f[_0x15d3('0x2d')]);_0xaf3949[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x3bc48f[_0x15d3('0x2b')],qs[_0x15d3('0x41')](_0x19d713[_0x15d3('0x2d')][_0x15d3('0x41')]));_0xaf3949['attributes']=_0xaf3949[_0x15d3('0x30')][_0x15d3('0x31')]?_0xaf3949[_0x15d3('0x30')]:_0x3bc48f[_0x15d3('0x2b')];_0xaf3949[_0x15d3('0x34')]=qs['sort'](_0x19d713[_0x15d3('0x2d')]['sort']);_0xaf3949['where']=qs[_0x15d3('0x2e')](_[_0x15d3('0x47')](_0x19d713[_0x15d3('0x2d')],_0x3bc48f[_0x15d3('0x2e')]));if(_0x19d713[_0x15d3('0x2d')]['filter']){_0xaf3949[_0x15d3('0x36')]=_[_0x15d3('0x38')](_0xaf3949[_0x15d3('0x36')],{'$or':_[_0x15d3('0x2c')](_0xaf3949['attributes'],function(_0x4242d4){var _0xdfbb70={};_0xdfbb70[_0x4242d4]={'$like':'%'+_0x19d713[_0x15d3('0x2d')][_0x15d3('0x37')]+'%'};return _0xdfbb70;})});}_0xaf3949=_[_0x15d3('0x38')]({},_0xaf3949,_0x19d713[_0x15d3('0x3a')]);return _0x22a32b[_0x15d3('0x48')](_0xaf3949);}})['then'](function(_0x3311ba){if(_0x3311ba){_0x5f0a42=_0x3311ba['length'];if(!_0x19d713[_0x15d3('0x2d')][_0x15d3('0x32')](_0x15d3('0x33'))){_0xaf3949['limit']=qs[_0x15d3('0x1b')](_0x19d713['query'][_0x15d3('0x1b')]);_0xaf3949[_0x15d3('0x19')]=qs['offset'](_0x19d713[_0x15d3('0x2d')]['offset']);}return _0x22a32b['getConfigurations'](_0xaf3949);}})['then'](function(_0x497811){if(_0x497811){return _0x497811?{'count':_0x5f0a42,'rows':_0x497811}:null;}})[_0x15d3('0x21')](respondWithResult(_0x42092c,null))[_0x15d3('0x3e')](handleError(_0x42092c,null));};exports[_0x15d3('0x49')]=function(_0x3b8ae4,_0x5b6d14,_0x289418){if(_0x3b8ae4[_0x15d3('0x44')]['id']){delete _0x3b8ae4[_0x15d3('0x44')]['id'];}return db[_0x15d3('0x26')]['findOne']({'where':{'id':_0x3b8ae4['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x5b6d14,null))['then'](function(_0xb35426){if(_0xb35426){_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x4a')]=_0xb35426['id'];_0x3b8ae4[_0x15d3('0x44')]['Subjects']=integrations[_0x15d3('0x4b')](_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x4c')],_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x29')]);_0x3b8ae4[_0x15d3('0x44')]['Descriptions']=integrations[_0x15d3('0x4d')](_0x3b8ae4['body'][_0x15d3('0x4c')],_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x29')]);return db['FreshdeskConfiguration'][_0x15d3('0x43')](_0x3b8ae4[_0x15d3('0x44')],{'include':[{'model':db[_0x15d3('0x4e')],'as':_0x15d3('0x4f')},{'model':db['FreshdeskField'],'as':_0x15d3('0x50')}]});}return null;})[_0x15d3('0x21')](respondWithResult(_0x5b6d14,null))['catch'](handleError(_0x5b6d14,null));};exports['getFields']=function(_0x2ce2e4,_0x4495e7,_0x1af2a5){var _0x1f53a1='';return db['FreshdeskAccount'][_0x15d3('0x51')]({'where':{'id':_0x2ce2e4[_0x15d3('0x45')]['id']},'attributes':['id',_0x15d3('0x52'),'apiKey']})[_0x15d3('0x21')](handleEntityNotFound(_0x4495e7,null))[_0x15d3('0x21')](function(_0x25ce07){if(_0x25ce07){_0x1f53a1=_0x25ce07[_0x15d3('0x52')];var _0x4f67c6=_0x1f53a1[_0x15d3('0x53')](-0x1);if(_0x4f67c6==='/'){_0x1f53a1=_0x1f53a1[_0x15d3('0x54')](0x0,_0x1f53a1[_0x15d3('0x55')](_0x4f67c6));}return rp({'method':'GET','uri':util[_0x15d3('0x56')](_0x15d3('0x57'),_0x1f53a1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x15d3('0x56')](_0x15d3('0x58'),new Buffer(util[_0x15d3('0x56')]('%s:X',_0x25ce07[_0x15d3('0x59')]))[_0x15d3('0x5a')]('base64'))},'json':!![]});}})[_0x15d3('0x21')](function(_0x1bc347){if(_0x1bc347){var _0x1b3ef0=[_0x15d3('0x5b'),_0x15d3('0x5c'),_0x15d3('0x5d'),_0x15d3('0x5e'),_0x15d3('0x17'),_0x15d3('0x5f'),_0x15d3('0x60'),'source',_0x15d3('0x61'),_0x15d3('0x60'),_0x15d3('0x62')];_[_0x15d3('0x63')](_0x1bc347,function(_0x1e18fa){return _0x1b3ef0[_0x15d3('0x64')](_0x1e18fa['name'])||!_0x1e18fa['default']&&_0x1e18fa['type']!==_0x15d3('0x65')&&_0x1e18fa[_0x15d3('0x29')]!==_0x15d3('0x66');});return{'count':_0x1bc347[_0x15d3('0x31')],'rows':_['map'](_0x1bc347,function(_0x1eb63f){return{'id':_0x1eb63f[_0x15d3('0x25')],'name':_0x1eb63f['label'],'custom':!_0x1eb63f[_0x15d3('0x67')],'options':_0x1eb63f[_0x15d3('0x68')]?_[_0x15d3('0x2c')](_0x1eb63f[_0x15d3('0x68')],function(_0x473456){return{'name':_['capitalize'](_0x473456),'value':_0x473456};}):[]};})};}})[_0x15d3('0x21')](respondWithResult(_0x4495e7,null))['catch'](function(_0x1a233c){var _0x484b01=_0x2ce2e4['query'][_0x15d3('0x69')]?0x1f4:_0x1a233c[_0x15d3('0x6a')]||0x1f4;logger[_0x15d3('0x23')](_0x15d3('0x6b'),_0x15d3('0x6c'),_0x484b01,JSON[_0x15d3('0x6d')](_0x1a233c));delete _0x1a233c[_0x15d3('0x25')];if(_0x484b01===0x191){_0x484b01=0x190;}_0x4495e7[_0x15d3('0x17')](_0x484b01)[_0x15d3('0x6e')](_0x2ce2e4['query'][_0x15d3('0x69')]?{'message':_0x15d3('0x6f'),'statusCode':_0x1a233c[_0x15d3('0x6a')]}:_0x1a233c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index efcf27c..57454bc 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 _0x5899=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','int_freshdesk_accounts','lodash','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5899,0x1e3));var _0x9589=function(_0x354fce,_0x3bc759){_0x354fce=_0x354fce-0x0;var _0x457fd=_0x5899[_0x354fce];return _0x457fd;};'use strict';var _=require(_0x9589('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9589('0x1'));var BPromise=require(_0x9589('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9589('0x3'));var rimraf=require(_0x9589('0x4'));var config=require(_0x9589('0x5'));var attributes=require(_0x9589('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x9589('0x7')]=function(_0x533ecc,_0x59e1ee){return _0x533ecc['define']('FreshdeskAccount',attributes,{'tableName':_0x9589('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacac=['exports','FreshdeskAccount','int_freshdesk_accounts','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4630fc,_0x875b4d){var _0x422612=function(_0x28559c){while(--_0x28559c){_0x4630fc['push'](_0x4630fc['shift']());}};_0x422612(++_0x875b4d);}(_0xacac,0x121));var _0xcaca=function(_0x456769,_0xdfd324){_0x456769=_0x456769-0x0;var _0x1159c9=_0xacac[_0x456769];return _0x1159c9;};'use strict';var _=require('lodash');var util=require(_0xcaca('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcaca('0x1'));var BPromise=require(_0xcaca('0x2'));var rp=require(_0xcaca('0x3'));var fs=require('fs');var path=require(_0xcaca('0x4'));var rimraf=require(_0xcaca('0x5'));var config=require(_0xcaca('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xcaca('0x7'));module[_0xcaca('0x8')]=function(_0x560ace,_0x544436){return _0x560ace['define'](_0xcaca('0x9'),attributes,{'tableName':_0xcaca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index cf95a0b..80f18dd 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 _0xedab=['message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshdeskAccount','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0xedab,0x164));var _0xbeda=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xedab[_0x207811];return _0x170d56;};'use strict';var _=require(_0xbeda('0x0'));var util=require(_0xbeda('0x1'));var moment=require(_0xbeda('0x2'));var BPromise=require(_0xbeda('0x3'));var rs=require(_0xbeda('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeda('0x5'));var logger=require(_0xbeda('0x6'))(_0xbeda('0x7'));var config=require('../../config/environment');var jayson=require(_0xbeda('0x8'));var client=jayson['client'][_0xbeda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b1065,_0x1e52f6,_0x3f672e){return new BPromise(function(_0x4015ca,_0x28f8c4){return client['request'](_0x4b1065,_0x3f672e)[_0xbeda('0xa')](function(_0x1ba3fd){logger[_0xbeda('0xb')](_0xbeda('0xc'),_0x1e52f6,'request\x20sent');logger[_0xbeda('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1e52f6,'request\x20sent',JSON[_0xbeda('0xe')](_0x1ba3fd));if(_0x1ba3fd[_0xbeda('0xf')]){if(_0x1ba3fd[_0xbeda('0xf')]['code']===0x1f4){logger[_0xbeda('0xf')](_0xbeda('0xc'),_0x1e52f6,_0x1ba3fd[_0xbeda('0xf')][_0xbeda('0x10')]);return _0x28f8c4(_0x1ba3fd[_0xbeda('0xf')][_0xbeda('0x10')]);}logger[_0xbeda('0xf')](_0xbeda('0xc'),_0x1e52f6,_0x1ba3fd['error'][_0xbeda('0x10')]);return _0x4015ca(_0x1ba3fd[_0xbeda('0xf')][_0xbeda('0x10')]);}else{logger[_0xbeda('0xb')](_0xbeda('0xc'),_0x1e52f6,'request\x20sent');_0x4015ca(_0x1ba3fd[_0xbeda('0x11')][_0xbeda('0x10')]);}})[_0xbeda('0x12')](function(_0x413404){logger[_0xbeda('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1e52f6,_0x413404);_0x28f8c4(_0x413404);});});}exports[_0xbeda('0x13')]=function(_0xdd8650){var _0x5a7c70=this;return new Promise(function(_0x282866,_0x2c7c9e){return db[_0xbeda('0x14')][_0xbeda('0x15')]({'raw':_0xdd8650['options']?_0xdd8650[_0xbeda('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xdd8650[_0xbeda('0x16')]?_0xdd8650[_0xbeda('0x16')][_0xbeda('0x17')]||null:null,'attributes':_0xdd8650[_0xbeda('0x16')]?_0xdd8650['options']['attributes']||null:null,'limit':_0xdd8650[_0xbeda('0x16')]?_0xdd8650[_0xbeda('0x16')][_0xbeda('0x18')]||null:null,'include':_0xdd8650[_0xbeda('0x16')]?_0xdd8650[_0xbeda('0x16')][_0xbeda('0x19')]?_[_0xbeda('0x1a')](_0xdd8650[_0xbeda('0x16')]['include'],function(_0x4f2307){return{'model':db[_0x4f2307[_0xbeda('0x1b')]],'as':_0x4f2307['as'],'attributes':_0x4f2307[_0xbeda('0x1c')],'include':_0x4f2307[_0xbeda('0x19')]?_['map'](_0x4f2307[_0xbeda('0x19')],function(_0x471206){return{'model':db[_0x471206['model']],'as':_0x471206['as'],'attributes':_0x471206['attributes'],'include':_0x471206[_0xbeda('0x19')]?_[_0xbeda('0x1a')](_0x471206['include'],function(_0x57f963){return{'model':db[_0x57f963[_0xbeda('0x1b')]],'as':_0x57f963['as'],'attributes':_0x57f963[_0xbeda('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10c1b8){logger[_0xbeda('0xb')](_0xbeda('0x13'),_0xdd8650);logger[_0xbeda('0xd')]('GetFreshdeskAccount',_0xdd8650,JSON[_0xbeda('0xe')](_0x10c1b8));_0x282866(_0x10c1b8);})[_0xbeda('0x12')](function(_0x54379d){logger[_0xbeda('0xf')](_0xbeda('0x13'),_0x54379d[_0xbeda('0x10')],_0xdd8650);_0x2c7c9e(_0x5a7c70[_0xbeda('0xf')](0x1f4,_0x54379d[_0xbeda('0x10')]));});});};exports[_0xbeda('0x1d')]=function(_0xb0da29){var _0x1180d0=this;return new Promise(function(_0x4907d6,_0x1e2c32){return db['FreshdeskAccount']['find']({'raw':_0xb0da29[_0xbeda('0x16')]?_0xb0da29[_0xbeda('0x16')][_0xbeda('0x1e')]===undefined?!![]:![]:!![],'where':_0xb0da29['options']?_0xb0da29[_0xbeda('0x16')]['where']||null:null,'attributes':_0xb0da29[_0xbeda('0x16')]?_0xb0da29[_0xbeda('0x16')]['attributes']||null:null,'include':_0xb0da29[_0xbeda('0x16')]?_0xb0da29[_0xbeda('0x16')][_0xbeda('0x19')]?_[_0xbeda('0x1a')](_0xb0da29[_0xbeda('0x16')][_0xbeda('0x19')],function(_0x3cd5e1){return{'model':db[_0x3cd5e1['model']],'as':_0x3cd5e1['as'],'attributes':_0x3cd5e1[_0xbeda('0x1c')],'include':_0x3cd5e1[_0xbeda('0x19')]?_[_0xbeda('0x1a')](_0x3cd5e1[_0xbeda('0x19')],function(_0x184b17){return{'model':db[_0x184b17[_0xbeda('0x1b')]],'as':_0x184b17['as'],'attributes':_0x184b17[_0xbeda('0x1c')],'include':_0x184b17[_0xbeda('0x19')]?_[_0xbeda('0x1a')](_0x184b17[_0xbeda('0x19')],function(_0x19a28f){return{'model':db[_0x19a28f[_0xbeda('0x1b')]],'as':_0x19a28f['as'],'attributes':_0x19a28f[_0xbeda('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbeda('0xa')](function(_0x2cae6b){logger[_0xbeda('0xb')](_0xbeda('0x1d'),_0xb0da29);logger[_0xbeda('0xd')](_0xbeda('0x1d'),_0xb0da29,JSON[_0xbeda('0xe')](_0x2cae6b));_0x4907d6(_0x2cae6b);})[_0xbeda('0x12')](function(_0x4d88d1){logger['error'](_0xbeda('0x1d'),_0x4d88d1[_0xbeda('0x10')],_0xb0da29);_0x1e2c32(_0x1180d0[_0xbeda('0xf')](0x1f4,_0x4d88d1['message']));});});}; \ No newline at end of file +var _0x9cee=['FreshdeskAccount','findAll','options','attributes','limit','include','model','then','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','where','map','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x20343a,_0x40738f){var _0x43157c=function(_0x356625){while(--_0x356625){_0x20343a['push'](_0x20343a['shift']());}};_0x43157c(++_0x40738f);}(_0x9cee,0x176));var _0xe9ce=function(_0x23bdcc,_0x221cc8){_0x23bdcc=_0x23bdcc-0x0;var _0x1757ce=_0x9cee[_0x23bdcc];return _0x1757ce;};'use strict';var _=require(_0xe9ce('0x0'));var util=require(_0xe9ce('0x1'));var moment=require(_0xe9ce('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9ce('0x3'));var db=require(_0xe9ce('0x4'))['db'];var utils=require(_0xe9ce('0x5'));var logger=require(_0xe9ce('0x6'))(_0xe9ce('0x7'));var config=require(_0xe9ce('0x8'));var jayson=require(_0xe9ce('0x9'));var client=jayson['client'][_0xe9ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf5c8fa,_0x386a10,_0x4510d0){return new BPromise(function(_0x30a553,_0x18aa37){return client[_0xe9ce('0xb')](_0xf5c8fa,_0x4510d0)['then'](function(_0x19ea23){logger['info'](_0xe9ce('0xc'),_0x386a10,_0xe9ce('0xd'));logger[_0xe9ce('0xe')](_0xe9ce('0xf'),_0x386a10,'request\x20sent',JSON['stringify'](_0x19ea23));if(_0x19ea23[_0xe9ce('0x10')]){if(_0x19ea23[_0xe9ce('0x10')][_0xe9ce('0x11')]===0x1f4){logger['error'](_0xe9ce('0xc'),_0x386a10,_0x19ea23[_0xe9ce('0x10')]['message']);return _0x18aa37(_0x19ea23['error']['message']);}logger[_0xe9ce('0x10')](_0xe9ce('0xc'),_0x386a10,_0x19ea23[_0xe9ce('0x10')][_0xe9ce('0x12')]);return _0x30a553(_0x19ea23[_0xe9ce('0x10')][_0xe9ce('0x12')]);}else{logger[_0xe9ce('0x13')](_0xe9ce('0xc'),_0x386a10,'request\x20sent');_0x30a553(_0x19ea23[_0xe9ce('0x14')]['message']);}})[_0xe9ce('0x15')](function(_0xda2b0){logger['error'](_0xe9ce('0xc'),_0x386a10,_0xda2b0);_0x18aa37(_0xda2b0);});});}exports['GetFreshdeskAccount']=function(_0x199ee3){var _0x432f7c=this;return new Promise(function(_0x3ab807,_0x2544d1){return db[_0xe9ce('0x16')][_0xe9ce('0x17')]({'raw':_0x199ee3[_0xe9ce('0x18')]?_0x199ee3[_0xe9ce('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x199ee3[_0xe9ce('0x18')]?_0x199ee3[_0xe9ce('0x18')]['where']||null:null,'attributes':_0x199ee3[_0xe9ce('0x18')]?_0x199ee3[_0xe9ce('0x18')][_0xe9ce('0x19')]||null:null,'limit':_0x199ee3[_0xe9ce('0x18')]?_0x199ee3[_0xe9ce('0x18')][_0xe9ce('0x1a')]||null:null,'include':_0x199ee3[_0xe9ce('0x18')]?_0x199ee3[_0xe9ce('0x18')][_0xe9ce('0x1b')]?_['map'](_0x199ee3['options']['include'],function(_0x463bf3){return{'model':db[_0x463bf3[_0xe9ce('0x1c')]],'as':_0x463bf3['as'],'attributes':_0x463bf3[_0xe9ce('0x19')],'include':_0x463bf3[_0xe9ce('0x1b')]?_['map'](_0x463bf3[_0xe9ce('0x1b')],function(_0x11e6bb){return{'model':db[_0x11e6bb[_0xe9ce('0x1c')]],'as':_0x11e6bb['as'],'attributes':_0x11e6bb[_0xe9ce('0x19')],'include':_0x11e6bb['include']?_['map'](_0x11e6bb[_0xe9ce('0x1b')],function(_0x2783cc){return{'model':db[_0x2783cc[_0xe9ce('0x1c')]],'as':_0x2783cc['as'],'attributes':_0x2783cc['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9ce('0x1d')](function(_0x3c400f){logger[_0xe9ce('0x13')](_0xe9ce('0x1e'),_0x199ee3);logger[_0xe9ce('0xe')]('GetFreshdeskAccount',_0x199ee3,JSON[_0xe9ce('0x1f')](_0x3c400f));_0x3ab807(_0x3c400f);})[_0xe9ce('0x15')](function(_0x159ce7){logger[_0xe9ce('0x10')](_0xe9ce('0x1e'),_0x159ce7[_0xe9ce('0x12')],_0x199ee3);_0x2544d1(_0x432f7c[_0xe9ce('0x10')](0x1f4,_0x159ce7[_0xe9ce('0x12')]));});});};exports[_0xe9ce('0x20')]=function(_0x4d9695){var _0x3d5b0b=this;return new Promise(function(_0x5b5f79,_0x4fd403){return db['FreshdeskAccount'][_0xe9ce('0x21')]({'raw':_0x4d9695[_0xe9ce('0x18')]?_0x4d9695['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d9695[_0xe9ce('0x18')]?_0x4d9695['options'][_0xe9ce('0x22')]||null:null,'attributes':_0x4d9695['options']?_0x4d9695[_0xe9ce('0x18')][_0xe9ce('0x19')]||null:null,'include':_0x4d9695[_0xe9ce('0x18')]?_0x4d9695[_0xe9ce('0x18')][_0xe9ce('0x1b')]?_[_0xe9ce('0x23')](_0x4d9695[_0xe9ce('0x18')][_0xe9ce('0x1b')],function(_0x17f73f){return{'model':db[_0x17f73f[_0xe9ce('0x1c')]],'as':_0x17f73f['as'],'attributes':_0x17f73f[_0xe9ce('0x19')],'include':_0x17f73f[_0xe9ce('0x1b')]?_[_0xe9ce('0x23')](_0x17f73f['include'],function(_0x3769e4){return{'model':db[_0x3769e4[_0xe9ce('0x1c')]],'as':_0x3769e4['as'],'attributes':_0x3769e4[_0xe9ce('0x19')],'include':_0x3769e4[_0xe9ce('0x1b')]?_[_0xe9ce('0x23')](_0x3769e4[_0xe9ce('0x1b')],function(_0x5865d2){return{'model':db[_0x5865d2[_0xe9ce('0x1c')]],'as':_0x5865d2['as'],'attributes':_0x5865d2[_0xe9ce('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe9ce('0x1d')](function(_0x452037){logger[_0xe9ce('0x13')](_0xe9ce('0x20'),_0x4d9695);logger[_0xe9ce('0xe')](_0xe9ce('0x20'),_0x4d9695,JSON[_0xe9ce('0x1f')](_0x452037));_0x5b5f79(_0x452037);})[_0xe9ce('0x15')](function(_0x260319){logger[_0xe9ce('0x10')](_0xe9ce('0x20'),_0x260319[_0xe9ce('0x12')],_0x4d9695);_0x4fd403(_0x3d5b0b['error'](0x1f4,_0x260319[_0xe9ce('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 01ad6b4..f056c59 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 _0x3664=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','exports','multer','util','path'];(function(_0x5afa3c,_0x1580c6){var _0x1ce0f2=function(_0x4f7783){while(--_0x4f7783){_0x5afa3c['push'](_0x5afa3c['shift']());}};_0x1ce0f2(++_0x1580c6);}(_0x3664,0x1c5));var _0x4366=function(_0x1db05a,_0x5790c5){_0x1db05a=_0x1db05a-0x0;var _0x4e2ce7=_0x3664[_0x1db05a];return _0x4e2ce7;};'use strict';var multer=require(_0x4366('0x0'));var util=require(_0x4366('0x1'));var path=require(_0x4366('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4366('0x3'));var auth=require(_0x4366('0x4'));var interaction=require(_0x4366('0x5'));var config=require(_0x4366('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x4366('0x7')]('/',auth['isAuthenticated'](),controller[_0x4366('0x8')]);router[_0x4366('0x7')](_0x4366('0x9'),auth[_0x4366('0xa')](),controller[_0x4366('0xb')]);router[_0x4366('0x7')](_0x4366('0xc'),auth[_0x4366('0xa')](),controller[_0x4366('0xd')]);router[_0x4366('0x7')](_0x4366('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4366('0x7')]('/:id/descriptions',auth[_0x4366('0xa')](),controller[_0x4366('0xf')]);router[_0x4366('0x7')](_0x4366('0x10'),auth[_0x4366('0xa')](),controller[_0x4366('0x11')]);router[_0x4366('0x12')]('/',auth[_0x4366('0xa')](),controller[_0x4366('0x13')]);router[_0x4366('0x12')]('/:id/tags',auth[_0x4366('0xa')](),controller[_0x4366('0x14')]);router[_0x4366('0x15')](_0x4366('0x9'),auth['isAuthenticated'](),controller[_0x4366('0x16')]);router['delete'](_0x4366('0x9'),auth[_0x4366('0xa')](),controller['destroy']);module[_0x4366('0x17')]=router; \ No newline at end of file +var _0x2a5d=['post','create','setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags'];(function(_0x21d4d6,_0x59c3ee){var _0x31d8c6=function(_0x38272d){while(--_0x38272d){_0x21d4d6['push'](_0x21d4d6['shift']());}};_0x31d8c6(++_0x59c3ee);}(_0x2a5d,0x1e7));var _0xd2a5=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0x2a5d[_0x507965];return _0x3608fc;};'use strict';var multer=require(_0xd2a5('0x0'));var util=require(_0xd2a5('0x1'));var path=require(_0xd2a5('0x2'));var timeout=require(_0xd2a5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd2a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd2a5('0x5'));var controller=require(_0xd2a5('0x6'));router[_0xd2a5('0x7')]('/',auth['isAuthenticated'](),controller[_0xd2a5('0x8')]);router['get'](_0xd2a5('0x9'),auth[_0xd2a5('0xa')](),controller[_0xd2a5('0xb')]);router[_0xd2a5('0x7')](_0xd2a5('0xc'),auth[_0xd2a5('0xa')](),controller[_0xd2a5('0xd')]);router['get'](_0xd2a5('0xe'),auth[_0xd2a5('0xa')](),controller['getSubjects']);router[_0xd2a5('0x7')](_0xd2a5('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd2a5('0x7')](_0xd2a5('0x10'),auth[_0xd2a5('0xa')](),controller['getTags']);router[_0xd2a5('0x11')]('/',auth[_0xd2a5('0xa')](),controller[_0xd2a5('0x12')]);router[_0xd2a5('0x11')](_0xd2a5('0x10'),auth[_0xd2a5('0xa')](),controller[_0xd2a5('0x13')]);router['put']('/:id',auth[_0xd2a5('0xa')](),controller[_0xd2a5('0x14')]);router[_0xd2a5('0x15')](_0xd2a5('0x9'),auth[_0xd2a5('0xa')](),controller[_0xd2a5('0x16')]);module[_0xd2a5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 3821351..64eb2cb 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 _0x8a4e=['sequelize','exports','STRING'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0x8a4e,0x105));var _0xe8a4=function(_0x48e43a,_0x1c83af){_0x48e43a=_0x48e43a-0x0;var _0x4b0da4=_0x8a4e[_0x48e43a];return _0x4b0da4;};'use strict';var Sequelize=require(_0xe8a4('0x0'));module[_0xe8a4('0x1')]={'name':{'type':Sequelize[_0xe8a4('0x2')]},'description':{'type':Sequelize[_0xe8a4('0x2')]}}; \ No newline at end of file +var _0x15a2=['exports','STRING'];(function(_0x341c04,_0x2b2619){var _0x49a998=function(_0x3c7a6c){while(--_0x3c7a6c){_0x341c04['push'](_0x341c04['shift']());}};_0x49a998(++_0x2b2619);}(_0x15a2,0x90));var _0x215a=function(_0x326407,_0x2c9181){_0x326407=_0x326407-0x0;var _0x1b69f1=_0x15a2[_0x326407];return _0x1b69f1;};'use strict';var Sequelize=require('sequelize');module[_0x215a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x215a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f843b6d..540b777 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 _0x3346=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','FreshdeskConfiguration','include','find','create','body','update','getFields','findOne','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x493a4e,_0x11cc55){var _0x29de31=function(_0x416355){while(--_0x416355){_0x493a4e['push'](_0x493a4e['shift']());}};_0x29de31(++_0x11cc55);}(_0x3346,0x187));var _0x6334=function(_0x3b9e95,_0x56df5f){_0x3b9e95=_0x3b9e95-0x0;var _0x29564a=_0x3346[_0x3b9e95];return _0x29564a;};'use strict';var emlformat=require(_0x6334('0x0'));var rimraf=require(_0x6334('0x1'));var zipdir=require(_0x6334('0x2'));var jsonpatch=require(_0x6334('0x3'));var rp=require(_0x6334('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6334('0x5'));var sox=require(_0x6334('0x6'));var csv=require(_0x6334('0x7'));var ejs=require(_0x6334('0x8'));var fs=require('fs');var fs_extra=require(_0x6334('0x9'));var _=require(_0x6334('0xa'));var squel=require(_0x6334('0xb'));var crypto=require(_0x6334('0xc'));var jsforce=require(_0x6334('0xd'));var deskjs=require(_0x6334('0xe'));var toCsv=require(_0x6334('0x7'));var querystring=require(_0x6334('0xf'));var Papa=require(_0x6334('0x10'));var Redis=require('ioredis');var authService=require(_0x6334('0x11'));var qs=require(_0x6334('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6334('0x13'))(_0x6334('0x14'));var utils=require(_0x6334('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6334('0x16'))['db'];function respondWithStatusCode(_0x2e00d5,_0xc8437e){_0xc8437e=_0xc8437e||0xcc;return function(_0x163fe0){if(_0x163fe0){return _0x2e00d5[_0x6334('0x17')](_0xc8437e);}return _0x2e00d5[_0x6334('0x18')](_0xc8437e)[_0x6334('0x19')]();};}function respondWithResult(_0xab963c,_0x52d326){_0x52d326=_0x52d326||0xc8;return function(_0xf8d5df){if(_0xf8d5df){return _0xab963c['status'](_0x52d326)['json'](_0xf8d5df);}};}function respondWithFilteredResult(_0x1bd27b,_0x4365f2){return function(_0x17edfe){if(_0x17edfe){var _0x5d7e32=typeof _0x4365f2[_0x6334('0x1a')]==='undefined'&&typeof _0x4365f2['limit']===_0x6334('0x1b');var _0x134d85=_0x17edfe[_0x6334('0x1c')];var _0x29fc81=_0x5d7e32?0x0:_0x4365f2[_0x6334('0x1a')];var _0x3a1282=_0x5d7e32?_0x17edfe[_0x6334('0x1c')]:_0x4365f2['offset']+_0x4365f2[_0x6334('0x1d')];var _0xb0a143;if(_0x3a1282>=_0x134d85){_0x3a1282=_0x134d85;_0xb0a143=0xc8;}else{_0xb0a143=0xce;}_0x1bd27b[_0x6334('0x18')](_0xb0a143);return _0x1bd27b[_0x6334('0x1e')]('Content-Range',_0x29fc81+'-'+_0x3a1282+'/'+_0x134d85)[_0x6334('0x1f')](_0x17edfe);}return null;};}function patchUpdates(_0x2deb74){return function(_0x38991d){try{jsonpatch[_0x6334('0x20')](_0x38991d,_0x2deb74,!![]);}catch(_0x465d43){return BPromise[_0x6334('0x21')](_0x465d43);}return _0x38991d[_0x6334('0x22')]();};}function saveUpdates(_0xec2eb2,_0x4593ac){return function(_0x46b213){if(_0x46b213){return _0x46b213['update'](_0xec2eb2)[_0x6334('0x23')](function(_0x4e1dee){return _0x4e1dee;});}return null;};}function removeEntity(_0x13f462,_0x4784c0){return function(_0x27064a){if(_0x27064a){return _0x27064a['destroy']()['then'](function(){_0x13f462[_0x6334('0x18')](0xcc)[_0x6334('0x19')]();});}};}function handleEntityNotFound(_0x12bb5c,_0x38d4d4){return function(_0x2847cf){if(!_0x2847cf){_0x12bb5c[_0x6334('0x17')](0x194);}return _0x2847cf;};}function handleError(_0x3aeb7f,_0x100517){_0x100517=_0x100517||0x1f4;return function(_0x1719fa){logger['error'](_0x1719fa[_0x6334('0x24')]);if(_0x1719fa[_0x6334('0x25')]){delete _0x1719fa[_0x6334('0x25')];}_0x3aeb7f[_0x6334('0x18')](_0x100517)[_0x6334('0x26')](_0x1719fa);};}exports[_0x6334('0x27')]=function(_0x14a1b8,_0x2dff8d){var _0x798d48={},_0x52b7e4={},_0x255e44={'count':0x0,'rows':[]};var _0x1fca75=_['map'](db['FreshdeskConfiguration'][_0x6334('0x28')],function(_0x5c57e2){return{'name':_0x5c57e2[_0x6334('0x29')],'type':_0x5c57e2[_0x6334('0x2a')][_0x6334('0x2b')]};});_0x52b7e4[_0x6334('0x2c')]=_[_0x6334('0x2d')](_0x1fca75,_0x6334('0x25'));_0x52b7e4['query']=_[_0x6334('0x2e')](_0x14a1b8[_0x6334('0x2f')]);_0x52b7e4['filters']=_['intersection'](_0x52b7e4['model'],_0x52b7e4[_0x6334('0x2f')]);_0x798d48[_0x6334('0x30')]=_[_0x6334('0x31')](_0x52b7e4[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x14a1b8[_0x6334('0x2f')][_0x6334('0x32')]));_0x798d48[_0x6334('0x30')]=_0x798d48[_0x6334('0x30')][_0x6334('0x33')]?_0x798d48[_0x6334('0x30')]:_0x52b7e4[_0x6334('0x2c')];if(!_0x14a1b8[_0x6334('0x2f')][_0x6334('0x34')](_0x6334('0x35'))){_0x798d48[_0x6334('0x1d')]=qs[_0x6334('0x1d')](_0x14a1b8[_0x6334('0x2f')][_0x6334('0x1d')]);_0x798d48['offset']=qs[_0x6334('0x1a')](_0x14a1b8['query']['offset']);}_0x798d48[_0x6334('0x36')]=qs[_0x6334('0x37')](_0x14a1b8[_0x6334('0x2f')][_0x6334('0x37')]);_0x798d48[_0x6334('0x38')]=qs[_0x6334('0x39')](_['pick'](_0x14a1b8[_0x6334('0x2f')],_0x52b7e4['filters']),_0x1fca75);if(_0x14a1b8[_0x6334('0x2f')]['filter']){_0x798d48[_0x6334('0x38')]=_['merge'](_0x798d48['where'],{'$or':_[_0x6334('0x2d')](_0x1fca75,function(_0x4c5e34){if(_0x4c5e34[_0x6334('0x2a')]!==_0x6334('0x3a')){var _0x3cb5e2={};_0x3cb5e2[_0x4c5e34[_0x6334('0x25')]]={'$like':'%'+_0x14a1b8[_0x6334('0x2f')][_0x6334('0x3b')]+'%'};return _0x3cb5e2;}})});}_0x798d48=_[_0x6334('0x3c')]({},_0x798d48,_0x14a1b8[_0x6334('0x3d')]);var _0x4e0b04={'where':_0x798d48[_0x6334('0x38')]};return db['FreshdeskConfiguration'][_0x6334('0x1c')](_0x4e0b04)[_0x6334('0x23')](function(_0xee5a01){_0x255e44[_0x6334('0x1c')]=_0xee5a01;if(_0x14a1b8['query'][_0x6334('0x3e')]){_0x798d48['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x798d48);})['then'](function(_0x2aad47){_0x255e44[_0x6334('0x3f')]=_0x2aad47;return _0x255e44;})[_0x6334('0x23')](respondWithFilteredResult(_0x2dff8d,_0x798d48))[_0x6334('0x40')](handleError(_0x2dff8d,null));};exports[_0x6334('0x41')]=function(_0x2a2cac,_0x527369){var _0x3fca42={'raw':![],'where':{'id':_0x2a2cac[_0x6334('0x42')]['id']}},_0x40c059={};_0x40c059[_0x6334('0x2c')]=_[_0x6334('0x2e')](db[_0x6334('0x43')][_0x6334('0x28')]);_0x40c059[_0x6334('0x2f')]=_['keys'](_0x2a2cac[_0x6334('0x2f')]);_0x40c059[_0x6334('0x39')]=_[_0x6334('0x31')](_0x40c059[_0x6334('0x2c')],_0x40c059[_0x6334('0x2f')]);_0x3fca42[_0x6334('0x30')]=_[_0x6334('0x31')](_0x40c059[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x2a2cac['query'][_0x6334('0x32')]));_0x3fca42[_0x6334('0x30')]=_0x3fca42[_0x6334('0x30')][_0x6334('0x33')]?_0x3fca42['attributes']:_0x40c059[_0x6334('0x2c')];if(_0x2a2cac['query'][_0x6334('0x3e')]){_0x3fca42[_0x6334('0x44')]=[{'all':!![]}];}_0x3fca42=_[_0x6334('0x3c')]({},_0x3fca42,_0x2a2cac[_0x6334('0x3d')]);return db[_0x6334('0x43')][_0x6334('0x45')](_0x3fca42)[_0x6334('0x23')](handleEntityNotFound(_0x527369,null))[_0x6334('0x23')](respondWithResult(_0x527369,null))[_0x6334('0x40')](handleError(_0x527369,null));};exports['create']=function(_0x2fdbd5,_0x1fed4b){return db[_0x6334('0x43')][_0x6334('0x46')](_0x2fdbd5[_0x6334('0x47')],{})[_0x6334('0x23')](respondWithResult(_0x1fed4b,0xc9))[_0x6334('0x40')](handleError(_0x1fed4b,null));};exports[_0x6334('0x48')]=function(_0x45c7c6,_0x19ac4b){if(_0x45c7c6[_0x6334('0x47')]['id']){delete _0x45c7c6[_0x6334('0x47')]['id'];}return db['FreshdeskConfiguration'][_0x6334('0x45')]({'where':{'id':_0x45c7c6[_0x6334('0x42')]['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x19ac4b,null))['then'](saveUpdates(_0x45c7c6['body'],null))[_0x6334('0x23')](respondWithResult(_0x19ac4b,null))[_0x6334('0x40')](handleError(_0x19ac4b,null));};exports['destroy']=function(_0x3c24a8,_0x468b51){return db['FreshdeskConfiguration'][_0x6334('0x45')]({'where':{'id':_0x3c24a8[_0x6334('0x42')]['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x468b51,null))['then'](removeEntity(_0x468b51,null))[_0x6334('0x40')](handleError(_0x468b51,null));};exports[_0x6334('0x49')]=function(_0x54a347,_0x221d9a,_0x5134a2){var _0x858b10={};var _0x10278c={};var _0x483de7;var _0x540dd3;return db[_0x6334('0x43')][_0x6334('0x4a')]({'where':{'id':_0x54a347[_0x6334('0x42')]['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x221d9a,null))['then'](function(_0x3993d2){if(_0x3993d2){_0x483de7=_0x3993d2;_0x10278c[_0x6334('0x2c')]=_[_0x6334('0x2e')](db['FreshdeskField'][_0x6334('0x28')]);_0x10278c[_0x6334('0x2f')]=_[_0x6334('0x2e')](_0x54a347[_0x6334('0x2f')]);_0x10278c[_0x6334('0x39')]=_[_0x6334('0x31')](_0x10278c[_0x6334('0x2c')],_0x10278c[_0x6334('0x2f')]);_0x858b10[_0x6334('0x30')]=_[_0x6334('0x31')](_0x10278c[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x54a347[_0x6334('0x2f')]['fields']));_0x858b10[_0x6334('0x30')]=_0x858b10[_0x6334('0x30')][_0x6334('0x33')]?_0x858b10['attributes']:_0x10278c[_0x6334('0x2c')];_0x858b10[_0x6334('0x36')]=qs[_0x6334('0x37')](_0x54a347[_0x6334('0x2f')][_0x6334('0x37')]);_0x858b10[_0x6334('0x38')]=qs[_0x6334('0x39')](_[_0x6334('0x4b')](_0x54a347[_0x6334('0x2f')],_0x10278c['filters']));if(_0x54a347[_0x6334('0x2f')]['filter']){_0x858b10[_0x6334('0x38')]=_[_0x6334('0x3c')](_0x858b10['where'],{'$or':_[_0x6334('0x2d')](_0x858b10['attributes'],function(_0x443611){var _0x5670cc={};_0x5670cc[_0x443611]={'$like':'%'+_0x54a347[_0x6334('0x2f')][_0x6334('0x3b')]+'%'};return _0x5670cc;})});}_0x858b10=_['merge']({},_0x858b10,_0x54a347[_0x6334('0x3d')]);return _0x483de7['getFields'](_0x858b10);}})[_0x6334('0x23')](function(_0x52ec4e){if(_0x52ec4e){_0x540dd3=_0x52ec4e[_0x6334('0x33')];if(!_0x54a347[_0x6334('0x2f')][_0x6334('0x34')](_0x6334('0x35'))){_0x858b10[_0x6334('0x1d')]=qs['limit'](_0x54a347['query'][_0x6334('0x1d')]);_0x858b10[_0x6334('0x1a')]=qs[_0x6334('0x1a')](_0x54a347[_0x6334('0x2f')][_0x6334('0x1a')]);}return _0x483de7[_0x6334('0x49')](_0x858b10);}})[_0x6334('0x23')](function(_0x240e81){if(_0x240e81){return _0x240e81?{'count':_0x540dd3,'rows':_0x240e81}:null;}})[_0x6334('0x23')](respondWithResult(_0x221d9a,null))['catch'](handleError(_0x221d9a,null));};exports[_0x6334('0x4c')]=function(_0x3c129c,_0x4dc885,_0x492854){var _0x19c2d2={};var _0x3c9fc9={};var _0x4f7227;var _0x402738;return db[_0x6334('0x43')]['findOne']({'where':{'id':_0x3c129c[_0x6334('0x42')]['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x4dc885,null))[_0x6334('0x23')](function(_0x2e7cca){if(_0x2e7cca){_0x4f7227=_0x2e7cca;_0x3c9fc9[_0x6334('0x2c')]=_[_0x6334('0x2e')](db['FreshdeskField'][_0x6334('0x28')]);_0x3c9fc9[_0x6334('0x2f')]=_[_0x6334('0x2e')](_0x3c129c[_0x6334('0x2f')]);_0x3c9fc9[_0x6334('0x39')]=_[_0x6334('0x31')](_0x3c9fc9[_0x6334('0x2c')],_0x3c9fc9[_0x6334('0x2f')]);_0x19c2d2['attributes']=_[_0x6334('0x31')](_0x3c9fc9[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x3c129c[_0x6334('0x2f')]['fields']));_0x19c2d2['attributes']=_0x19c2d2[_0x6334('0x30')][_0x6334('0x33')]?_0x19c2d2['attributes']:_0x3c9fc9[_0x6334('0x2c')];_0x19c2d2[_0x6334('0x36')]=qs[_0x6334('0x37')](_0x3c129c['query'][_0x6334('0x37')]);_0x19c2d2['where']=qs['filters'](_[_0x6334('0x4b')](_0x3c129c['query'],_0x3c9fc9['filters']));if(_0x3c129c[_0x6334('0x2f')][_0x6334('0x3b')]){_0x19c2d2['where']=_[_0x6334('0x3c')](_0x19c2d2[_0x6334('0x38')],{'$or':_[_0x6334('0x2d')](_0x19c2d2[_0x6334('0x30')],function(_0x11b60c){var _0x4374a7={};_0x4374a7[_0x11b60c]={'$like':'%'+_0x3c129c[_0x6334('0x2f')]['filter']+'%'};return _0x4374a7;})});}_0x19c2d2=_['merge']({},_0x19c2d2,_0x3c129c['options']);return _0x4f7227[_0x6334('0x4c')](_0x19c2d2);}})[_0x6334('0x23')](function(_0x2ac069){if(_0x2ac069){_0x402738=_0x2ac069[_0x6334('0x33')];if(!_0x3c129c['query'][_0x6334('0x34')](_0x6334('0x35'))){_0x19c2d2['limit']=qs[_0x6334('0x1d')](_0x3c129c[_0x6334('0x2f')]['limit']);_0x19c2d2[_0x6334('0x1a')]=qs[_0x6334('0x1a')](_0x3c129c['query']['offset']);}return _0x4f7227[_0x6334('0x4c')](_0x19c2d2);}})[_0x6334('0x23')](function(_0x29145f){if(_0x29145f){return _0x29145f?{'count':_0x402738,'rows':_0x29145f}:null;}})['then'](respondWithResult(_0x4dc885,null))[_0x6334('0x40')](handleError(_0x4dc885,null));};exports[_0x6334('0x4d')]=function(_0x4b76a1,_0x2e4aff,_0x3a138d){var _0xade1a0={};var _0x21ecb0={};var _0x107cbe;var _0x1c2aa1;return db['FreshdeskConfiguration'][_0x6334('0x4a')]({'where':{'id':_0x4b76a1['params']['id']}})['then'](handleEntityNotFound(_0x2e4aff,null))[_0x6334('0x23')](function(_0x4c4802){if(_0x4c4802){_0x107cbe=_0x4c4802;_0x21ecb0[_0x6334('0x2c')]=_[_0x6334('0x2e')](db['FreshdeskField']['rawAttributes']);_0x21ecb0[_0x6334('0x2f')]=_['keys'](_0x4b76a1[_0x6334('0x2f')]);_0x21ecb0[_0x6334('0x39')]=_[_0x6334('0x31')](_0x21ecb0['model'],_0x21ecb0[_0x6334('0x2f')]);_0xade1a0[_0x6334('0x30')]=_[_0x6334('0x31')](_0x21ecb0[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x4b76a1[_0x6334('0x2f')]['fields']));_0xade1a0[_0x6334('0x30')]=_0xade1a0[_0x6334('0x30')][_0x6334('0x33')]?_0xade1a0[_0x6334('0x30')]:_0x21ecb0[_0x6334('0x2c')];_0xade1a0[_0x6334('0x36')]=qs[_0x6334('0x37')](_0x4b76a1[_0x6334('0x2f')][_0x6334('0x37')]);_0xade1a0['where']=qs[_0x6334('0x39')](_['pick'](_0x4b76a1['query'],_0x21ecb0[_0x6334('0x39')]));if(_0x4b76a1[_0x6334('0x2f')][_0x6334('0x3b')]){_0xade1a0[_0x6334('0x38')]=_[_0x6334('0x3c')](_0xade1a0[_0x6334('0x38')],{'$or':_[_0x6334('0x2d')](_0xade1a0[_0x6334('0x30')],function(_0x493b2e){var _0x4d9011={};_0x4d9011[_0x493b2e]={'$like':'%'+_0x4b76a1[_0x6334('0x2f')][_0x6334('0x3b')]+'%'};return _0x4d9011;})});}_0xade1a0=_[_0x6334('0x3c')]({},_0xade1a0,_0x4b76a1['options']);return _0x107cbe[_0x6334('0x4d')](_0xade1a0);}})[_0x6334('0x23')](function(_0x5be808){if(_0x5be808){_0x1c2aa1=_0x5be808[_0x6334('0x33')];if(!_0x4b76a1[_0x6334('0x2f')][_0x6334('0x34')](_0x6334('0x35'))){_0xade1a0[_0x6334('0x1d')]=qs[_0x6334('0x1d')](_0x4b76a1['query'][_0x6334('0x1d')]);_0xade1a0[_0x6334('0x1a')]=qs['offset'](_0x4b76a1[_0x6334('0x2f')][_0x6334('0x1a')]);}return _0x107cbe[_0x6334('0x4d')](_0xade1a0);}})['then'](function(_0x4d23c6){if(_0x4d23c6){return _0x4d23c6?{'count':_0x1c2aa1,'rows':_0x4d23c6}:null;}})[_0x6334('0x23')](respondWithResult(_0x2e4aff,null))['catch'](handleError(_0x2e4aff,null));};exports[_0x6334('0x4e')]=function(_0x3f953e,_0x2e9ff6,_0x4374ea){var _0x628260={};var _0x43cd80={};var _0x3ca6a1;var _0x538b0e;return db[_0x6334('0x43')][_0x6334('0x4a')]({'where':{'id':_0x3f953e[_0x6334('0x42')]['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x2e9ff6,null))[_0x6334('0x23')](function(_0x43c433){if(_0x43c433){_0x3ca6a1=_0x43c433;_0x43cd80[_0x6334('0x2c')]=_['keys'](db[_0x6334('0x4f')]['rawAttributes']);_0x43cd80['query']=_[_0x6334('0x2e')](_0x3f953e[_0x6334('0x2f')]);_0x43cd80[_0x6334('0x39')]=_[_0x6334('0x31')](_0x43cd80[_0x6334('0x2c')],_0x43cd80[_0x6334('0x2f')]);_0x628260[_0x6334('0x30')]=_[_0x6334('0x31')](_0x43cd80[_0x6334('0x2c')],qs[_0x6334('0x32')](_0x3f953e[_0x6334('0x2f')][_0x6334('0x32')]));_0x628260[_0x6334('0x30')]=_0x628260['attributes'][_0x6334('0x33')]?_0x628260[_0x6334('0x30')]:_0x43cd80[_0x6334('0x2c')];_0x628260[_0x6334('0x36')]=qs[_0x6334('0x37')](_0x3f953e[_0x6334('0x2f')]['sort']);_0x628260['where']=qs[_0x6334('0x39')](_['pick'](_0x3f953e[_0x6334('0x2f')],_0x43cd80[_0x6334('0x39')]));if(_0x3f953e['query']['filter']){_0x628260[_0x6334('0x38')]=_[_0x6334('0x3c')](_0x628260[_0x6334('0x38')],{'$or':_[_0x6334('0x2d')](_0x628260[_0x6334('0x30')],function(_0xeb896){var _0x3b288f={};_0x3b288f[_0xeb896]={'$like':'%'+_0x3f953e[_0x6334('0x2f')][_0x6334('0x3b')]+'%'};return _0x3b288f;})});}_0x628260=_['merge']({},_0x628260,_0x3f953e['options']);return _0x3ca6a1[_0x6334('0x4e')](_0x628260);}})['then'](function(_0x495d89){if(_0x495d89){_0x538b0e=_0x495d89[_0x6334('0x33')];if(!_0x3f953e[_0x6334('0x2f')]['hasOwnProperty'](_0x6334('0x35'))){_0x628260['limit']=qs[_0x6334('0x1d')](_0x3f953e[_0x6334('0x2f')][_0x6334('0x1d')]);_0x628260['offset']=qs['offset'](_0x3f953e[_0x6334('0x2f')][_0x6334('0x1a')]);}return _0x3ca6a1['getTags'](_0x628260);}})[_0x6334('0x23')](function(_0x1bcf1a){if(_0x1bcf1a){return _0x1bcf1a?{'count':_0x538b0e,'rows':_0x1bcf1a}:null;}})[_0x6334('0x23')](respondWithResult(_0x2e9ff6,null))['catch'](handleError(_0x2e9ff6,null));};exports['setTags']=function(_0xa94b2a,_0x57d45a,_0x415557){if(_0xa94b2a[_0x6334('0x47')]['id']){delete _0xa94b2a['body']['id'];}return db[_0x6334('0x43')]['findOne']({'where':{'id':_0xa94b2a['params']['id']}})[_0x6334('0x23')](handleEntityNotFound(_0x57d45a,null))[_0x6334('0x23')](function(_0x18cd4e){if(_0x18cd4e){return _0x18cd4e[_0x6334('0x50')](_0xa94b2a['body'][_0x6334('0x51')]||[]);}return null;})['then'](respondWithResult(_0x57d45a,null))['catch'](handleError(_0x57d45a,null));}; \ No newline at end of file +var _0xe9a6=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','FreshdeskConfiguration','type','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','getFields','params','order','nolimit','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir'];(function(_0x14fac7,_0x14bc6f){var _0x55f9c7=function(_0x600166){while(--_0x600166){_0x14fac7['push'](_0x14fac7['shift']());}};_0x55f9c7(++_0x14bc6f);}(_0xe9a6,0xed));var _0x6e9a=function(_0xb9135,_0x57893b){_0xb9135=_0xb9135-0x0;var _0x2002d3=_0xe9a6[_0xb9135];return _0x2002d3;};'use strict';var emlformat=require(_0x6e9a('0x0'));var rimraf=require(_0x6e9a('0x1'));var zipdir=require(_0x6e9a('0x2'));var jsonpatch=require(_0x6e9a('0x3'));var rp=require(_0x6e9a('0x4'));var moment=require(_0x6e9a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e9a('0x6'));var util=require(_0x6e9a('0x7'));var path=require(_0x6e9a('0x8'));var sox=require(_0x6e9a('0x9'));var csv=require(_0x6e9a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e9a('0xb'));var _=require(_0x6e9a('0xc'));var squel=require('squel');var crypto=require(_0x6e9a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e9a('0xa'));var querystring=require(_0x6e9a('0xe'));var Papa=require('papaparse');var Redis=require(_0x6e9a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e9a('0x10'));var hardwareService=require(_0x6e9a('0x11'));var logger=require(_0x6e9a('0x12'))('api');var utils=require(_0x6e9a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6e9a('0x14'));var db=require(_0x6e9a('0x15'))['db'];function respondWithStatusCode(_0x27bc24,_0x403924){_0x403924=_0x403924||0xcc;return function(_0x1ff27d){if(_0x1ff27d){return _0x27bc24[_0x6e9a('0x16')](_0x403924);}return _0x27bc24[_0x6e9a('0x17')](_0x403924)[_0x6e9a('0x18')]();};}function respondWithResult(_0x1c87bd,_0x556058){_0x556058=_0x556058||0xc8;return function(_0x270448){if(_0x270448){return _0x1c87bd['status'](_0x556058)['json'](_0x270448);}};}function respondWithFilteredResult(_0xa30766,_0x40ac42){return function(_0x1c7270){if(_0x1c7270){var _0x5e45ab=typeof _0x40ac42['offset']===_0x6e9a('0x19')&&typeof _0x40ac42[_0x6e9a('0x1a')]==='undefined';var _0xb77432=_0x1c7270[_0x6e9a('0x1b')];var _0x1791c8=_0x5e45ab?0x0:_0x40ac42['offset'];var _0x14c772=_0x5e45ab?_0x1c7270['count']:_0x40ac42[_0x6e9a('0x1c')]+_0x40ac42[_0x6e9a('0x1a')];var _0x540e97;if(_0x14c772>=_0xb77432){_0x14c772=_0xb77432;_0x540e97=0xc8;}else{_0x540e97=0xce;}_0xa30766['status'](_0x540e97);return _0xa30766[_0x6e9a('0x1d')](_0x6e9a('0x1e'),_0x1791c8+'-'+_0x14c772+'/'+_0xb77432)['json'](_0x1c7270);}return null;};}function patchUpdates(_0x20c3ed){return function(_0x794aa9){try{jsonpatch[_0x6e9a('0x1f')](_0x794aa9,_0x20c3ed,!![]);}catch(_0x108c56){return BPromise[_0x6e9a('0x20')](_0x108c56);}return _0x794aa9[_0x6e9a('0x21')]();};}function saveUpdates(_0x3ad900,_0xee5234){return function(_0x3f6050){if(_0x3f6050){return _0x3f6050[_0x6e9a('0x22')](_0x3ad900)[_0x6e9a('0x23')](function(_0xe7def6){return _0xe7def6;});}return null;};}function removeEntity(_0x3090ca,_0xe22498){return function(_0x3aa617){if(_0x3aa617){return _0x3aa617[_0x6e9a('0x24')]()['then'](function(){_0x3090ca[_0x6e9a('0x17')](0xcc)[_0x6e9a('0x18')]();});}};}function handleEntityNotFound(_0x206a99,_0x4fda70){return function(_0x17ffa7){if(!_0x17ffa7){_0x206a99[_0x6e9a('0x16')](0x194);}return _0x17ffa7;};}function handleError(_0x2bb9bd,_0x278f94){_0x278f94=_0x278f94||0x1f4;return function(_0x15305d){logger[_0x6e9a('0x25')](_0x15305d[_0x6e9a('0x26')]);if(_0x15305d['name']){delete _0x15305d[_0x6e9a('0x27')];}_0x2bb9bd['status'](_0x278f94)[_0x6e9a('0x28')](_0x15305d);};}exports['index']=function(_0x23bf32,_0x3e88bd){var _0x5cbd8b={},_0x32798a={},_0x53e9e1={'count':0x0,'rows':[]};var _0x263f94=_['map'](db[_0x6e9a('0x29')]['rawAttributes'],function(_0x5a7e62){return{'name':_0x5a7e62['fieldName'],'type':_0x5a7e62[_0x6e9a('0x2a')]['key']};});_0x32798a['model']=_[_0x6e9a('0x2b')](_0x263f94,'name');_0x32798a['query']=_[_0x6e9a('0x2c')](_0x23bf32[_0x6e9a('0x2d')]);_0x32798a[_0x6e9a('0x2e')]=_[_0x6e9a('0x2f')](_0x32798a[_0x6e9a('0x30')],_0x32798a[_0x6e9a('0x2d')]);_0x5cbd8b[_0x6e9a('0x31')]=_[_0x6e9a('0x2f')](_0x32798a[_0x6e9a('0x30')],qs[_0x6e9a('0x32')](_0x23bf32['query'][_0x6e9a('0x32')]));_0x5cbd8b['attributes']=_0x5cbd8b['attributes']['length']?_0x5cbd8b['attributes']:_0x32798a[_0x6e9a('0x30')];if(!_0x23bf32['query'][_0x6e9a('0x33')]('nolimit')){_0x5cbd8b[_0x6e9a('0x1a')]=qs[_0x6e9a('0x1a')](_0x23bf32[_0x6e9a('0x2d')]['limit']);_0x5cbd8b['offset']=qs['offset'](_0x23bf32['query'][_0x6e9a('0x1c')]);}_0x5cbd8b['order']=qs['sort'](_0x23bf32['query'][_0x6e9a('0x34')]);_0x5cbd8b['where']=qs[_0x6e9a('0x2e')](_[_0x6e9a('0x35')](_0x23bf32[_0x6e9a('0x2d')],_0x32798a[_0x6e9a('0x2e')]),_0x263f94);if(_0x23bf32[_0x6e9a('0x2d')][_0x6e9a('0x36')]){_0x5cbd8b[_0x6e9a('0x37')]=_[_0x6e9a('0x38')](_0x5cbd8b[_0x6e9a('0x37')],{'$or':_[_0x6e9a('0x2b')](_0x263f94,function(_0x172c72){if(_0x172c72[_0x6e9a('0x2a')]!==_0x6e9a('0x39')){var _0x5ea6df={};_0x5ea6df[_0x172c72[_0x6e9a('0x27')]]={'$like':'%'+_0x23bf32[_0x6e9a('0x2d')][_0x6e9a('0x36')]+'%'};return _0x5ea6df;}})});}_0x5cbd8b=_[_0x6e9a('0x38')]({},_0x5cbd8b,_0x23bf32[_0x6e9a('0x3a')]);var _0x4534ba={'where':_0x5cbd8b['where']};return db[_0x6e9a('0x29')][_0x6e9a('0x1b')](_0x4534ba)[_0x6e9a('0x23')](function(_0x46763b){_0x53e9e1[_0x6e9a('0x1b')]=_0x46763b;if(_0x23bf32[_0x6e9a('0x2d')][_0x6e9a('0x3b')]){_0x5cbd8b[_0x6e9a('0x3c')]=[{'all':!![]}];}return db[_0x6e9a('0x29')][_0x6e9a('0x3d')](_0x5cbd8b);})[_0x6e9a('0x23')](function(_0x1e5a15){_0x53e9e1[_0x6e9a('0x3e')]=_0x1e5a15;return _0x53e9e1;})[_0x6e9a('0x23')](respondWithFilteredResult(_0x3e88bd,_0x5cbd8b))[_0x6e9a('0x3f')](handleError(_0x3e88bd,null));};exports['show']=function(_0x57b447,_0x35bff5){var _0x525a8a={'raw':![],'where':{'id':_0x57b447['params']['id']}},_0x1890be={};_0x1890be[_0x6e9a('0x30')]=_[_0x6e9a('0x2c')](db[_0x6e9a('0x29')][_0x6e9a('0x40')]);_0x1890be['query']=_[_0x6e9a('0x2c')](_0x57b447[_0x6e9a('0x2d')]);_0x1890be[_0x6e9a('0x2e')]=_['intersection'](_0x1890be['model'],_0x1890be[_0x6e9a('0x2d')]);_0x525a8a[_0x6e9a('0x31')]=_[_0x6e9a('0x2f')](_0x1890be[_0x6e9a('0x30')],qs[_0x6e9a('0x32')](_0x57b447[_0x6e9a('0x2d')][_0x6e9a('0x32')]));_0x525a8a['attributes']=_0x525a8a['attributes'][_0x6e9a('0x41')]?_0x525a8a[_0x6e9a('0x31')]:_0x1890be[_0x6e9a('0x30')];if(_0x57b447[_0x6e9a('0x2d')][_0x6e9a('0x3b')]){_0x525a8a[_0x6e9a('0x3c')]=[{'all':!![]}];}_0x525a8a=_['merge']({},_0x525a8a,_0x57b447['options']);return db[_0x6e9a('0x29')][_0x6e9a('0x42')](_0x525a8a)[_0x6e9a('0x23')](handleEntityNotFound(_0x35bff5,null))[_0x6e9a('0x23')](respondWithResult(_0x35bff5,null))[_0x6e9a('0x3f')](handleError(_0x35bff5,null));};exports[_0x6e9a('0x43')]=function(_0x15a2ba,_0x96f817){return db[_0x6e9a('0x29')][_0x6e9a('0x43')](_0x15a2ba[_0x6e9a('0x44')],{})[_0x6e9a('0x23')](respondWithResult(_0x96f817,0xc9))[_0x6e9a('0x3f')](handleError(_0x96f817,null));};exports['update']=function(_0x3d3c6f,_0x33e3cb){if(_0x3d3c6f['body']['id']){delete _0x3d3c6f[_0x6e9a('0x44')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3d3c6f['params']['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0x33e3cb,null))['then'](saveUpdates(_0x3d3c6f[_0x6e9a('0x44')],null))[_0x6e9a('0x23')](respondWithResult(_0x33e3cb,null))[_0x6e9a('0x3f')](handleError(_0x33e3cb,null));};exports[_0x6e9a('0x24')]=function(_0x4f602c,_0x539c08){return db['FreshdeskConfiguration'][_0x6e9a('0x42')]({'where':{'id':_0x4f602c['params']['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0x539c08,null))['then'](removeEntity(_0x539c08,null))[_0x6e9a('0x3f')](handleError(_0x539c08,null));};exports[_0x6e9a('0x45')]=function(_0x458e24,_0x29cfb8,_0x558079){var _0x1ab000={};var _0x101d06={};var _0x4c9333;var _0x4ae9fc;return db[_0x6e9a('0x29')]['findOne']({'where':{'id':_0x458e24[_0x6e9a('0x46')]['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0x29cfb8,null))['then'](function(_0x2a1697){if(_0x2a1697){_0x4c9333=_0x2a1697;_0x101d06[_0x6e9a('0x30')]=_[_0x6e9a('0x2c')](db['FreshdeskField'][_0x6e9a('0x40')]);_0x101d06[_0x6e9a('0x2d')]=_[_0x6e9a('0x2c')](_0x458e24[_0x6e9a('0x2d')]);_0x101d06['filters']=_[_0x6e9a('0x2f')](_0x101d06[_0x6e9a('0x30')],_0x101d06['query']);_0x1ab000['attributes']=_[_0x6e9a('0x2f')](_0x101d06['model'],qs[_0x6e9a('0x32')](_0x458e24[_0x6e9a('0x2d')][_0x6e9a('0x32')]));_0x1ab000[_0x6e9a('0x31')]=_0x1ab000[_0x6e9a('0x31')][_0x6e9a('0x41')]?_0x1ab000['attributes']:_0x101d06[_0x6e9a('0x30')];_0x1ab000[_0x6e9a('0x47')]=qs[_0x6e9a('0x34')](_0x458e24['query'][_0x6e9a('0x34')]);_0x1ab000['where']=qs[_0x6e9a('0x2e')](_[_0x6e9a('0x35')](_0x458e24[_0x6e9a('0x2d')],_0x101d06[_0x6e9a('0x2e')]));if(_0x458e24['query'][_0x6e9a('0x36')]){_0x1ab000[_0x6e9a('0x37')]=_[_0x6e9a('0x38')](_0x1ab000['where'],{'$or':_[_0x6e9a('0x2b')](_0x1ab000[_0x6e9a('0x31')],function(_0x42b60b){var _0x5e8304={};_0x5e8304[_0x42b60b]={'$like':'%'+_0x458e24[_0x6e9a('0x2d')][_0x6e9a('0x36')]+'%'};return _0x5e8304;})});}_0x1ab000=_[_0x6e9a('0x38')]({},_0x1ab000,_0x458e24[_0x6e9a('0x3a')]);return _0x4c9333[_0x6e9a('0x45')](_0x1ab000);}})[_0x6e9a('0x23')](function(_0x41177b){if(_0x41177b){_0x4ae9fc=_0x41177b[_0x6e9a('0x41')];if(!_0x458e24[_0x6e9a('0x2d')][_0x6e9a('0x33')](_0x6e9a('0x48'))){_0x1ab000['limit']=qs[_0x6e9a('0x1a')](_0x458e24[_0x6e9a('0x2d')][_0x6e9a('0x1a')]);_0x1ab000['offset']=qs[_0x6e9a('0x1c')](_0x458e24[_0x6e9a('0x2d')][_0x6e9a('0x1c')]);}return _0x4c9333[_0x6e9a('0x45')](_0x1ab000);}})[_0x6e9a('0x23')](function(_0x5cc67c){if(_0x5cc67c){return _0x5cc67c?{'count':_0x4ae9fc,'rows':_0x5cc67c}:null;}})[_0x6e9a('0x23')](respondWithResult(_0x29cfb8,null))[_0x6e9a('0x3f')](handleError(_0x29cfb8,null));};exports['getSubjects']=function(_0x28d417,_0x194eb8,_0x214938){var _0x48ce9d={};var _0x15b691={};var _0x2b00a1;var _0x26a287;return db[_0x6e9a('0x29')][_0x6e9a('0x49')]({'where':{'id':_0x28d417[_0x6e9a('0x46')]['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0x194eb8,null))['then'](function(_0x6eaa12){if(_0x6eaa12){_0x2b00a1=_0x6eaa12;_0x15b691['model']=_[_0x6e9a('0x2c')](db[_0x6e9a('0x4a')][_0x6e9a('0x40')]);_0x15b691['query']=_[_0x6e9a('0x2c')](_0x28d417[_0x6e9a('0x2d')]);_0x15b691[_0x6e9a('0x2e')]=_[_0x6e9a('0x2f')](_0x15b691[_0x6e9a('0x30')],_0x15b691[_0x6e9a('0x2d')]);_0x48ce9d['attributes']=_[_0x6e9a('0x2f')](_0x15b691[_0x6e9a('0x30')],qs[_0x6e9a('0x32')](_0x28d417[_0x6e9a('0x2d')][_0x6e9a('0x32')]));_0x48ce9d[_0x6e9a('0x31')]=_0x48ce9d[_0x6e9a('0x31')][_0x6e9a('0x41')]?_0x48ce9d[_0x6e9a('0x31')]:_0x15b691[_0x6e9a('0x30')];_0x48ce9d[_0x6e9a('0x47')]=qs[_0x6e9a('0x34')](_0x28d417[_0x6e9a('0x2d')][_0x6e9a('0x34')]);_0x48ce9d[_0x6e9a('0x37')]=qs[_0x6e9a('0x2e')](_[_0x6e9a('0x35')](_0x28d417[_0x6e9a('0x2d')],_0x15b691[_0x6e9a('0x2e')]));if(_0x28d417['query'][_0x6e9a('0x36')]){_0x48ce9d[_0x6e9a('0x37')]=_[_0x6e9a('0x38')](_0x48ce9d[_0x6e9a('0x37')],{'$or':_['map'](_0x48ce9d[_0x6e9a('0x31')],function(_0x44f56c){var _0x3c8000={};_0x3c8000[_0x44f56c]={'$like':'%'+_0x28d417[_0x6e9a('0x2d')]['filter']+'%'};return _0x3c8000;})});}_0x48ce9d=_[_0x6e9a('0x38')]({},_0x48ce9d,_0x28d417[_0x6e9a('0x3a')]);return _0x2b00a1['getSubjects'](_0x48ce9d);}})[_0x6e9a('0x23')](function(_0x4aa345){if(_0x4aa345){_0x26a287=_0x4aa345[_0x6e9a('0x41')];if(!_0x28d417['query'][_0x6e9a('0x33')]('nolimit')){_0x48ce9d[_0x6e9a('0x1a')]=qs['limit'](_0x28d417[_0x6e9a('0x2d')][_0x6e9a('0x1a')]);_0x48ce9d[_0x6e9a('0x1c')]=qs[_0x6e9a('0x1c')](_0x28d417['query'][_0x6e9a('0x1c')]);}return _0x2b00a1[_0x6e9a('0x4b')](_0x48ce9d);}})[_0x6e9a('0x23')](function(_0x568102){if(_0x568102){return _0x568102?{'count':_0x26a287,'rows':_0x568102}:null;}})[_0x6e9a('0x23')](respondWithResult(_0x194eb8,null))['catch'](handleError(_0x194eb8,null));};exports[_0x6e9a('0x4c')]=function(_0x36b896,_0xde778a,_0xfb1196){var _0x1b63cf={};var _0x2bd57f={};var _0x386383;var _0x28a044;return db[_0x6e9a('0x29')]['findOne']({'where':{'id':_0x36b896['params']['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0xde778a,null))['then'](function(_0x25e133){if(_0x25e133){_0x386383=_0x25e133;_0x2bd57f[_0x6e9a('0x30')]=_[_0x6e9a('0x2c')](db['FreshdeskField'][_0x6e9a('0x40')]);_0x2bd57f[_0x6e9a('0x2d')]=_[_0x6e9a('0x2c')](_0x36b896['query']);_0x2bd57f[_0x6e9a('0x2e')]=_[_0x6e9a('0x2f')](_0x2bd57f['model'],_0x2bd57f['query']);_0x1b63cf[_0x6e9a('0x31')]=_[_0x6e9a('0x2f')](_0x2bd57f[_0x6e9a('0x30')],qs['fields'](_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x32')]));_0x1b63cf[_0x6e9a('0x31')]=_0x1b63cf[_0x6e9a('0x31')][_0x6e9a('0x41')]?_0x1b63cf[_0x6e9a('0x31')]:_0x2bd57f['model'];_0x1b63cf[_0x6e9a('0x47')]=qs['sort'](_0x36b896['query'][_0x6e9a('0x34')]);_0x1b63cf['where']=qs[_0x6e9a('0x2e')](_[_0x6e9a('0x35')](_0x36b896[_0x6e9a('0x2d')],_0x2bd57f[_0x6e9a('0x2e')]));if(_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x36')]){_0x1b63cf[_0x6e9a('0x37')]=_[_0x6e9a('0x38')](_0x1b63cf[_0x6e9a('0x37')],{'$or':_[_0x6e9a('0x2b')](_0x1b63cf[_0x6e9a('0x31')],function(_0x7c4845){var _0xa95538={};_0xa95538[_0x7c4845]={'$like':'%'+_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x36')]+'%'};return _0xa95538;})});}_0x1b63cf=_[_0x6e9a('0x38')]({},_0x1b63cf,_0x36b896[_0x6e9a('0x3a')]);return _0x386383['getDescriptions'](_0x1b63cf);}})[_0x6e9a('0x23')](function(_0x23f76f){if(_0x23f76f){_0x28a044=_0x23f76f[_0x6e9a('0x41')];if(!_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x33')](_0x6e9a('0x48'))){_0x1b63cf['limit']=qs[_0x6e9a('0x1a')](_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x1a')]);_0x1b63cf[_0x6e9a('0x1c')]=qs[_0x6e9a('0x1c')](_0x36b896[_0x6e9a('0x2d')][_0x6e9a('0x1c')]);}return _0x386383[_0x6e9a('0x4c')](_0x1b63cf);}})['then'](function(_0x273d58){if(_0x273d58){return _0x273d58?{'count':_0x28a044,'rows':_0x273d58}:null;}})[_0x6e9a('0x23')](respondWithResult(_0xde778a,null))[_0x6e9a('0x3f')](handleError(_0xde778a,null));};exports[_0x6e9a('0x4d')]=function(_0x3dab1f,_0x5791eb,_0x4fc035){var _0x2e09d9={};var _0x49afc7={};var _0x54b657;var _0x2174c8;return db[_0x6e9a('0x29')]['findOne']({'where':{'id':_0x3dab1f['params']['id']}})[_0x6e9a('0x23')](handleEntityNotFound(_0x5791eb,null))['then'](function(_0x373fe0){if(_0x373fe0){_0x54b657=_0x373fe0;_0x49afc7[_0x6e9a('0x30')]=_['keys'](db['Tag']['rawAttributes']);_0x49afc7[_0x6e9a('0x2d')]=_['keys'](_0x3dab1f[_0x6e9a('0x2d')]);_0x49afc7[_0x6e9a('0x2e')]=_[_0x6e9a('0x2f')](_0x49afc7[_0x6e9a('0x30')],_0x49afc7[_0x6e9a('0x2d')]);_0x2e09d9[_0x6e9a('0x31')]=_[_0x6e9a('0x2f')](_0x49afc7[_0x6e9a('0x30')],qs[_0x6e9a('0x32')](_0x3dab1f['query'][_0x6e9a('0x32')]));_0x2e09d9[_0x6e9a('0x31')]=_0x2e09d9['attributes'][_0x6e9a('0x41')]?_0x2e09d9[_0x6e9a('0x31')]:_0x49afc7[_0x6e9a('0x30')];_0x2e09d9[_0x6e9a('0x47')]=qs[_0x6e9a('0x34')](_0x3dab1f['query'][_0x6e9a('0x34')]);_0x2e09d9['where']=qs[_0x6e9a('0x2e')](_[_0x6e9a('0x35')](_0x3dab1f[_0x6e9a('0x2d')],_0x49afc7[_0x6e9a('0x2e')]));if(_0x3dab1f[_0x6e9a('0x2d')][_0x6e9a('0x36')]){_0x2e09d9[_0x6e9a('0x37')]=_[_0x6e9a('0x38')](_0x2e09d9[_0x6e9a('0x37')],{'$or':_[_0x6e9a('0x2b')](_0x2e09d9['attributes'],function(_0x291694){var _0x13f547={};_0x13f547[_0x291694]={'$like':'%'+_0x3dab1f[_0x6e9a('0x2d')]['filter']+'%'};return _0x13f547;})});}_0x2e09d9=_[_0x6e9a('0x38')]({},_0x2e09d9,_0x3dab1f[_0x6e9a('0x3a')]);return _0x54b657['getTags'](_0x2e09d9);}})[_0x6e9a('0x23')](function(_0x568899){if(_0x568899){_0x2174c8=_0x568899[_0x6e9a('0x41')];if(!_0x3dab1f['query'][_0x6e9a('0x33')](_0x6e9a('0x48'))){_0x2e09d9[_0x6e9a('0x1a')]=qs[_0x6e9a('0x1a')](_0x3dab1f[_0x6e9a('0x2d')][_0x6e9a('0x1a')]);_0x2e09d9[_0x6e9a('0x1c')]=qs[_0x6e9a('0x1c')](_0x3dab1f['query'][_0x6e9a('0x1c')]);}return _0x54b657['getTags'](_0x2e09d9);}})[_0x6e9a('0x23')](function(_0x3cfe09){if(_0x3cfe09){return _0x3cfe09?{'count':_0x2174c8,'rows':_0x3cfe09}:null;}})[_0x6e9a('0x23')](respondWithResult(_0x5791eb,null))[_0x6e9a('0x3f')](handleError(_0x5791eb,null));};exports[_0x6e9a('0x4e')]=function(_0x4ca970,_0x366f55,_0x43dfb0){if(_0x4ca970[_0x6e9a('0x44')]['id']){delete _0x4ca970[_0x6e9a('0x44')]['id'];}return db[_0x6e9a('0x29')][_0x6e9a('0x49')]({'where':{'id':_0x4ca970['params']['id']}})['then'](handleEntityNotFound(_0x366f55,null))[_0x6e9a('0x23')](function(_0x7c70bb){if(_0x7c70bb){return _0x7c70bb['setTags'](_0x4ca970['body'][_0x6e9a('0x4f')]||[]);}return null;})[_0x6e9a('0x23')](respondWithResult(_0x366f55,null))[_0x6e9a('0x3f')](handleError(_0x366f55,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f260a98..f91c69a 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 _0x2cfd=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','path','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x21e6e7,_0x395e61){var _0x376be1=function(_0x1b2606){while(--_0x1b2606){_0x21e6e7['push'](_0x21e6e7['shift']());}};_0x376be1(++_0x395e61);}(_0x2cfd,0x17f));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd2cf('0x0'));var util=require(_0xd2cf('0x1'));var logger=require(_0xd2cf('0x2'))(_0xd2cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2cf('0x4'));var rimraf=require(_0xd2cf('0x5'));var config=require('../../config/environment');var attributes=require(_0xd2cf('0x6'));module['exports']=function(_0xf51b93,_0x577ca6){return _0xf51b93[_0xd2cf('0x7')](_0xd2cf('0x8'),attributes,{'tableName':_0xd2cf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x053d=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0x053d,0x14a));var _0xd053=function(_0x3ece00,_0x12e698){_0x3ece00=_0x3ece00-0x0;var _0x37e6f9=_0x053d[_0x3ece00];return _0x37e6f9;};'use strict';var _=require(_0xd053('0x0'));var util=require(_0xd053('0x1'));var logger=require('../../config/logger')(_0xd053('0x2'));var moment=require(_0xd053('0x3'));var BPromise=require('bluebird');var rp=require(_0xd053('0x4'));var fs=require('fs');var path=require(_0xd053('0x5'));var rimraf=require(_0xd053('0x6'));var config=require(_0xd053('0x7'));var attributes=require(_0xd053('0x8'));module[_0xd053('0x9')]=function(_0x33d087,_0x23dd5f){return _0x33d087[_0xd053('0xa')]('FreshdeskConfiguration',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 84aa779..e89021b 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 _0x0d60=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x455580,_0x5cd4dd){var _0x7aabc2=function(_0x10bf94){while(--_0x10bf94){_0x455580['push'](_0x455580['shift']());}};_0x7aabc2(++_0x5cd4dd);}(_0x0d60,0x79));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00d6('0x0'));var util=require(_0x00d6('0x1'));var moment=require(_0x00d6('0x2'));var BPromise=require(_0x00d6('0x3'));var rs=require(_0x00d6('0x4'));var fs=require('fs');var Redis=require(_0x00d6('0x5'));var db=require(_0x00d6('0x6'))['db'];var utils=require(_0x00d6('0x7'));var logger=require(_0x00d6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x00d6('0x9'));var client=jayson[_0x00d6('0xa')][_0x00d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x181b5f,_0x5000a3,_0x121f80){return new BPromise(function(_0x4fa72d,_0x9eb485){return client[_0x00d6('0xc')](_0x181b5f,_0x121f80)[_0x00d6('0xd')](function(_0x248e32){logger['info'](_0x00d6('0xe'),_0x5000a3,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5000a3,_0x00d6('0xf'),JSON['stringify'](_0x248e32));if(_0x248e32[_0x00d6('0x10')]){if(_0x248e32[_0x00d6('0x10')][_0x00d6('0x11')]===0x1f4){logger[_0x00d6('0x10')](_0x00d6('0xe'),_0x5000a3,_0x248e32[_0x00d6('0x10')][_0x00d6('0x12')]);return _0x9eb485(_0x248e32[_0x00d6('0x10')][_0x00d6('0x12')]);}logger[_0x00d6('0x10')](_0x00d6('0xe'),_0x5000a3,_0x248e32[_0x00d6('0x10')][_0x00d6('0x12')]);return _0x4fa72d(_0x248e32[_0x00d6('0x10')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5000a3,'request\x20sent');_0x4fa72d(_0x248e32[_0x00d6('0x13')][_0x00d6('0x12')]);}})[_0x00d6('0x14')](function(_0x368abd){logger['error'](_0x00d6('0xe'),_0x5000a3,_0x368abd);_0x9eb485(_0x368abd);});});} \ No newline at end of file +var _0xe36f=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3fb41e,_0x469ba9){var _0x4ed78b=function(_0x5e15c6){while(--_0x5e15c6){_0x3fb41e['push'](_0x3fb41e['shift']());}};_0x4ed78b(++_0x469ba9);}(_0xe36f,0x123));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe36('0x0'));var util=require(_0xfe36('0x1'));var moment=require(_0xfe36('0x2'));var BPromise=require(_0xfe36('0x3'));var rs=require(_0xfe36('0x4'));var fs=require('fs');var Redis=require(_0xfe36('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe36('0x6'))(_0xfe36('0x7'));var config=require(_0xfe36('0x8'));var jayson=require(_0xfe36('0x9'));var client=jayson[_0xfe36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27bfba,_0x1548f9,_0x431d3e){return new BPromise(function(_0xc891e1,_0x25acbf){return client[_0xfe36('0xb')](_0x27bfba,_0x431d3e)[_0xfe36('0xc')](function(_0x5e9ca3){logger[_0xfe36('0xd')](_0xfe36('0xe'),_0x1548f9,_0xfe36('0xf'));logger[_0xfe36('0x10')](_0xfe36('0x11'),_0x1548f9,_0xfe36('0xf'),JSON[_0xfe36('0x12')](_0x5e9ca3));if(_0x5e9ca3[_0xfe36('0x13')]){if(_0x5e9ca3[_0xfe36('0x13')][_0xfe36('0x14')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1548f9,_0x5e9ca3[_0xfe36('0x13')][_0xfe36('0x15')]);return _0x25acbf(_0x5e9ca3[_0xfe36('0x13')]['message']);}logger[_0xfe36('0x13')](_0xfe36('0xe'),_0x1548f9,_0x5e9ca3[_0xfe36('0x13')][_0xfe36('0x15')]);return _0xc891e1(_0x5e9ca3['error'][_0xfe36('0x15')]);}else{logger['info'](_0xfe36('0xe'),_0x1548f9,_0xfe36('0xf'));_0xc891e1(_0x5e9ca3['result'][_0xfe36('0x15')]);}})['catch'](function(_0x3f921f){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1548f9,_0x3f921f);_0x25acbf(_0x3f921f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4bb9c55..331ef23 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 _0xef52=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xef52,0x16b));var _0x2ef5=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0xef52[_0x4529b3];return _0x21e907;};'use strict';var multer=require(_0x2ef5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ef5('0x1'));var express=require('express');var router=express[_0x2ef5('0x2')]();var fs_extra=require(_0x2ef5('0x3'));var auth=require(_0x2ef5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ef5('0x5'));var controller=require(_0x2ef5('0x6'));router[_0x2ef5('0x7')]('/',auth[_0x2ef5('0x8')](),controller[_0x2ef5('0x9')]);router[_0x2ef5('0x7')](_0x2ef5('0xa'),auth[_0x2ef5('0x8')](),controller['show']);router[_0x2ef5('0xb')]('/',auth[_0x2ef5('0x8')](),controller[_0x2ef5('0xc')]);router[_0x2ef5('0xd')](_0x2ef5('0xa'),auth[_0x2ef5('0x8')](),controller[_0x2ef5('0xe')]);router[_0x2ef5('0xf')](_0x2ef5('0xa'),auth[_0x2ef5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb69c=['fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x363ca0,_0x3d4ba9){var _0x4f27b9=function(_0x8cc7e2){while(--_0x8cc7e2){_0x363ca0['push'](_0x363ca0['shift']());}};_0x4f27b9(++_0x3d4ba9);}(_0xb69c,0x188));var _0xcb69=function(_0x364154,_0x27726d){_0x364154=_0x364154-0x0;var _0x1cb8fc=_0xb69c[_0x364154];return _0x1cb8fc;};'use strict';var multer=require(_0xcb69('0x0'));var util=require(_0xcb69('0x1'));var path=require(_0xcb69('0x2'));var timeout=require(_0xcb69('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcb69('0x4'));var auth=require(_0xcb69('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcb69('0x6'));router[_0xcb69('0x7')]('/',auth['isAuthenticated'](),controller[_0xcb69('0x8')]);router[_0xcb69('0x7')](_0xcb69('0x9'),auth[_0xcb69('0xa')](),controller[_0xcb69('0xb')]);router[_0xcb69('0xc')]('/',auth['isAuthenticated'](),controller[_0xcb69('0xd')]);router[_0xcb69('0xe')](_0xcb69('0x9'),auth[_0xcb69('0xa')](),controller[_0xcb69('0xf')]);router[_0xcb69('0x10')](_0xcb69('0x9'),auth[_0xcb69('0xa')](),controller['destroy']);module[_0xcb69('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 9b4e0e5..c32bb17 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 _0xf068=['picklist','STRING','ENUM','BOOLEAN','string','variable','customVariable','keyValue'];(function(_0x46cfad,_0x490ce0){var _0x48c560=function(_0x4121d6){while(--_0x4121d6){_0x46cfad['push'](_0x46cfad['shift']());}};_0x48c560(++_0x490ce0);}(_0xf068,0x14c));var _0x8f06=function(_0x495fde,_0x420b63){_0x495fde=_0x495fde-0x0;var _0xd41009=_0xf068[_0x495fde];return _0xd41009;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x8f06('0x0'),_0x8f06('0x1'),_0x8f06('0x2'),_0x8f06('0x3'),_0x8f06('0x4')),'defaultValue':_0x8f06('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f06('0x5')]},'keyType':{'type':Sequelize[_0x8f06('0x6')](_0x8f06('0x0'),_0x8f06('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x8f06('0x5')]},'idField':{'type':Sequelize[_0x8f06('0x5')]},'nameField':{'type':Sequelize[_0x8f06('0x5')]},'customField':{'type':Sequelize[_0x8f06('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f06('0x5')]}}; \ No newline at end of file +var _0x8e1f=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x590381,_0x5c3948){var _0xe300df=function(_0x148e67){while(--_0x148e67){_0x590381['push'](_0x590381['shift']());}};_0xe300df(++_0x5c3948);}(_0x8e1f,0xec));var _0xf8e1=function(_0x4ca966,_0x6fdc8){_0x4ca966=_0x4ca966-0x0;var _0x2312b4=_0x8e1f[_0x4ca966];return _0x2312b4;};'use strict';var Sequelize=require(_0xf8e1('0x0'));module[_0xf8e1('0x1')]={'type':{'type':Sequelize[_0xf8e1('0x2')](_0xf8e1('0x3'),_0xf8e1('0x4'),'customVariable',_0xf8e1('0x5'),_0xf8e1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf8e1('0x7')]},'key':{'type':Sequelize[_0xf8e1('0x7')]},'keyType':{'type':Sequelize[_0xf8e1('0x2')]('string','variable',_0xf8e1('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf8e1('0x7')]},'customField':{'type':Sequelize[_0xf8e1('0x9')],'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 115e916..a1dfe5b 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 _0xe205=['merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x321b98,_0x4c7b2b){var _0x22948f=function(_0x12ac50){while(--_0x12ac50){_0x321b98['push'](_0x321b98['shift']());}};_0x22948f(++_0x4c7b2b);}(_0xe205,0xa7));var _0x5e20=function(_0x2f9d4c,_0x1f500a){_0x2f9d4c=_0x2f9d4c-0x0;var _0x5769c2=_0xe205[_0x2f9d4c];return _0x5769c2;};'use strict';var emlformat=require(_0x5e20('0x0'));var rimraf=require(_0x5e20('0x1'));var zipdir=require(_0x5e20('0x2'));var jsonpatch=require(_0x5e20('0x3'));var rp=require(_0x5e20('0x4'));var moment=require(_0x5e20('0x5'));var BPromise=require(_0x5e20('0x6'));var Mustache=require(_0x5e20('0x7'));var util=require(_0x5e20('0x8'));var path=require('path');var sox=require(_0x5e20('0x9'));var csv=require(_0x5e20('0xa'));var ejs=require(_0x5e20('0xb'));var fs=require('fs');var fs_extra=require(_0x5e20('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xa'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var as=require(_0x5e20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e20('0x13'))(_0x5e20('0x14'));var utils=require(_0x5e20('0x15'));var config=require(_0x5e20('0x16'));var licenseUtil=require(_0x5e20('0x17'));var db=require(_0x5e20('0x18'))['db'];function respondWithStatusCode(_0x54deee,_0x19eacf){_0x19eacf=_0x19eacf||0xcc;return function(_0x29b7a2){if(_0x29b7a2){return _0x54deee[_0x5e20('0x19')](_0x19eacf);}return _0x54deee['status'](_0x19eacf)[_0x5e20('0x1a')]();};}function respondWithResult(_0x5d827e,_0x1f47f3){_0x1f47f3=_0x1f47f3||0xc8;return function(_0x5ba833){if(_0x5ba833){return _0x5d827e[_0x5e20('0x1b')](_0x1f47f3)[_0x5e20('0x1c')](_0x5ba833);}};}function respondWithFilteredResult(_0x275026,_0x148ada){return function(_0x294df8){if(_0x294df8){var _0x542b3c=typeof _0x148ada[_0x5e20('0x1d')]===_0x5e20('0x1e')&&typeof _0x148ada[_0x5e20('0x1f')]===_0x5e20('0x1e');var _0x2f194b=_0x294df8[_0x5e20('0x20')];var _0x1cc706=_0x542b3c?0x0:_0x148ada[_0x5e20('0x1d')];var _0x4d3e4a=_0x542b3c?_0x294df8[_0x5e20('0x20')]:_0x148ada[_0x5e20('0x1d')]+_0x148ada['limit'];var _0x295eb3;if(_0x4d3e4a>=_0x2f194b){_0x4d3e4a=_0x2f194b;_0x295eb3=0xc8;}else{_0x295eb3=0xce;}_0x275026[_0x5e20('0x1b')](_0x295eb3);return _0x275026[_0x5e20('0x21')](_0x5e20('0x22'),_0x1cc706+'-'+_0x4d3e4a+'/'+_0x2f194b)['json'](_0x294df8);}return null;};}function patchUpdates(_0x2954fc){return function(_0x50f222){try{jsonpatch['apply'](_0x50f222,_0x2954fc,!![]);}catch(_0x57c7c5){return BPromise['reject'](_0x57c7c5);}return _0x50f222[_0x5e20('0x23')]();};}function saveUpdates(_0x5cca90,_0x3d89e4){return function(_0x29b111){if(_0x29b111){return _0x29b111[_0x5e20('0x24')](_0x5cca90)[_0x5e20('0x25')](function(_0x3ef7fa){return _0x3ef7fa;});}return null;};}function removeEntity(_0x2d4614,_0x4c5732){return function(_0x15705f){if(_0x15705f){return _0x15705f['destroy']()['then'](function(){_0x2d4614[_0x5e20('0x1b')](0xcc)[_0x5e20('0x1a')]();});}};}function handleEntityNotFound(_0x2bae08,_0x1b01af){return function(_0xbf7a24){if(!_0xbf7a24){_0x2bae08[_0x5e20('0x19')](0x194);}return _0xbf7a24;};}function handleError(_0x2973b3,_0x5809fd){_0x5809fd=_0x5809fd||0x1f4;return function(_0x3bf4f4){logger[_0x5e20('0x26')](_0x3bf4f4[_0x5e20('0x27')]);if(_0x3bf4f4[_0x5e20('0x28')]){delete _0x3bf4f4['name'];}_0x2973b3[_0x5e20('0x1b')](_0x5809fd)[_0x5e20('0x29')](_0x3bf4f4);};}exports[_0x5e20('0x2a')]=function(_0x222e7a,_0xbed73a){var _0x19709b={},_0x5ec45b={},_0xbc2b0e={'count':0x0,'rows':[]};var _0x34a3d6=_['map'](db[_0x5e20('0x2b')][_0x5e20('0x2c')],function(_0x335f1e){return{'name':_0x335f1e[_0x5e20('0x2d')],'type':_0x335f1e[_0x5e20('0x2e')][_0x5e20('0x2f')]};});_0x5ec45b['model']=_[_0x5e20('0x30')](_0x34a3d6,_0x5e20('0x28'));_0x5ec45b[_0x5e20('0x31')]=_[_0x5e20('0x32')](_0x222e7a[_0x5e20('0x31')]);_0x5ec45b[_0x5e20('0x33')]=_[_0x5e20('0x34')](_0x5ec45b[_0x5e20('0x35')],_0x5ec45b[_0x5e20('0x31')]);_0x19709b[_0x5e20('0x36')]=_[_0x5e20('0x34')](_0x5ec45b['model'],qs[_0x5e20('0x37')](_0x222e7a[_0x5e20('0x31')][_0x5e20('0x37')]));_0x19709b['attributes']=_0x19709b[_0x5e20('0x36')][_0x5e20('0x38')]?_0x19709b[_0x5e20('0x36')]:_0x5ec45b[_0x5e20('0x35')];if(!_0x222e7a[_0x5e20('0x31')][_0x5e20('0x39')](_0x5e20('0x3a'))){_0x19709b[_0x5e20('0x1f')]=qs[_0x5e20('0x1f')](_0x222e7a[_0x5e20('0x31')][_0x5e20('0x1f')]);_0x19709b[_0x5e20('0x1d')]=qs[_0x5e20('0x1d')](_0x222e7a[_0x5e20('0x31')]['offset']);}_0x19709b[_0x5e20('0x3b')]=qs['sort'](_0x222e7a['query'][_0x5e20('0x3c')]);_0x19709b[_0x5e20('0x3d')]=qs['filters'](_[_0x5e20('0x3e')](_0x222e7a[_0x5e20('0x31')],_0x5ec45b['filters']),_0x34a3d6);if(_0x222e7a[_0x5e20('0x31')][_0x5e20('0x3f')]){_0x19709b[_0x5e20('0x3d')]=_[_0x5e20('0x40')](_0x19709b[_0x5e20('0x3d')],{'$or':_[_0x5e20('0x30')](_0x34a3d6,function(_0x94925e){if(_0x94925e[_0x5e20('0x2e')]!==_0x5e20('0x41')){var _0x20be56={};_0x20be56[_0x94925e[_0x5e20('0x28')]]={'$like':'%'+_0x222e7a[_0x5e20('0x31')][_0x5e20('0x3f')]+'%'};return _0x20be56;}})});}_0x19709b=_[_0x5e20('0x40')]({},_0x19709b,_0x222e7a[_0x5e20('0x42')]);var _0x3d618c={'where':_0x19709b[_0x5e20('0x3d')]};return db[_0x5e20('0x2b')]['count'](_0x3d618c)[_0x5e20('0x25')](function(_0x29215f){_0xbc2b0e[_0x5e20('0x20')]=_0x29215f;if(_0x222e7a[_0x5e20('0x31')][_0x5e20('0x43')]){_0x19709b['include']=[{'all':!![]}];}return db[_0x5e20('0x2b')][_0x5e20('0x44')](_0x19709b);})[_0x5e20('0x25')](function(_0x24c05f){_0xbc2b0e[_0x5e20('0x45')]=_0x24c05f;return _0xbc2b0e;})[_0x5e20('0x25')](respondWithFilteredResult(_0xbed73a,_0x19709b))['catch'](handleError(_0xbed73a,null));};exports[_0x5e20('0x46')]=function(_0xc24cce,_0xa52d83){var _0x5a21f0={'raw':!![],'where':{'id':_0xc24cce[_0x5e20('0x47')]['id']}},_0x2b031d={};_0x2b031d[_0x5e20('0x35')]=_[_0x5e20('0x32')](db[_0x5e20('0x2b')][_0x5e20('0x2c')]);_0x2b031d[_0x5e20('0x31')]=_[_0x5e20('0x32')](_0xc24cce['query']);_0x2b031d[_0x5e20('0x33')]=_[_0x5e20('0x34')](_0x2b031d[_0x5e20('0x35')],_0x2b031d['query']);_0x5a21f0[_0x5e20('0x36')]=_['intersection'](_0x2b031d[_0x5e20('0x35')],qs[_0x5e20('0x37')](_0xc24cce[_0x5e20('0x31')][_0x5e20('0x37')]));_0x5a21f0[_0x5e20('0x36')]=_0x5a21f0['attributes'][_0x5e20('0x38')]?_0x5a21f0['attributes']:_0x2b031d['model'];if(_0xc24cce[_0x5e20('0x31')][_0x5e20('0x43')]){_0x5a21f0[_0x5e20('0x48')]=[{'all':!![]}];}_0x5a21f0=_[_0x5e20('0x40')]({},_0x5a21f0,_0xc24cce[_0x5e20('0x42')]);return db[_0x5e20('0x2b')][_0x5e20('0x49')](_0x5a21f0)['then'](handleEntityNotFound(_0xa52d83,null))['then'](respondWithResult(_0xa52d83,null))[_0x5e20('0x4a')](handleError(_0xa52d83,null));};exports[_0x5e20('0x4b')]=function(_0x5e84bd,_0x22b84e){return db[_0x5e20('0x2b')][_0x5e20('0x4b')](_0x5e84bd[_0x5e20('0x4c')],{})[_0x5e20('0x25')](respondWithResult(_0x22b84e,0xc9))['catch'](handleError(_0x22b84e,null));};exports[_0x5e20('0x24')]=function(_0x245b52,_0x25491e){if(_0x245b52[_0x5e20('0x4c')]['id']){delete _0x245b52[_0x5e20('0x4c')]['id'];}return db[_0x5e20('0x2b')][_0x5e20('0x49')]({'where':{'id':_0x245b52[_0x5e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x25491e,null))['then'](saveUpdates(_0x245b52['body'],null))[_0x5e20('0x25')](respondWithResult(_0x25491e,null))[_0x5e20('0x4a')](handleError(_0x25491e,null));};exports['destroy']=function(_0x4392ca,_0x4bfea7){return db[_0x5e20('0x2b')]['find']({'where':{'id':_0x4392ca[_0x5e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bfea7,null))[_0x5e20('0x25')](removeEntity(_0x4bfea7,null))[_0x5e20('0x4a')](handleError(_0x4bfea7,null));}; \ No newline at end of file +var _0xe130=['includeAll','include','findAll','show','params','keys','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0xe130,0x127));var _0x0e13=function(_0x33c068,_0x26006b){_0x33c068=_0x33c068-0x0;var _0x1c7ba7=_0xe130[_0x33c068];return _0x1c7ba7;};'use strict';var emlformat=require(_0x0e13('0x0'));var rimraf=require(_0x0e13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e13('0x2'));var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require(_0x0e13('0x5'));var Mustache=require(_0x0e13('0x6'));var util=require('util');var path=require(_0x0e13('0x7'));var sox=require(_0x0e13('0x8'));var csv=require(_0x0e13('0x9'));var ejs=require(_0x0e13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e13('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e13('0xc'));var toCsv=require(_0x0e13('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e13('0xd'));var authService=require(_0x0e13('0xe'));var qs=require(_0x0e13('0xf'));var as=require(_0x0e13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e13('0x11'));var utils=require(_0x0e13('0x12'));var config=require(_0x0e13('0x13'));var licenseUtil=require(_0x0e13('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4391,_0x4d9ea0){_0x4d9ea0=_0x4d9ea0||0xcc;return function(_0x2ef77e){if(_0x2ef77e){return _0x1b4391[_0x0e13('0x15')](_0x4d9ea0);}return _0x1b4391[_0x0e13('0x16')](_0x4d9ea0)[_0x0e13('0x17')]();};}function respondWithResult(_0x2f0d82,_0x1ec6ad){_0x1ec6ad=_0x1ec6ad||0xc8;return function(_0x27c3cf){if(_0x27c3cf){return _0x2f0d82[_0x0e13('0x16')](_0x1ec6ad)[_0x0e13('0x18')](_0x27c3cf);}};}function respondWithFilteredResult(_0x530f82,_0x302763){return function(_0xbc1617){if(_0xbc1617){var _0x2057fe=typeof _0x302763[_0x0e13('0x19')]===_0x0e13('0x1a')&&typeof _0x302763[_0x0e13('0x1b')]==='undefined';var _0x11ec50=_0xbc1617[_0x0e13('0x1c')];var _0x510a2b=_0x2057fe?0x0:_0x302763['offset'];var _0x3b85fd=_0x2057fe?_0xbc1617['count']:_0x302763[_0x0e13('0x19')]+_0x302763['limit'];var _0x294aea;if(_0x3b85fd>=_0x11ec50){_0x3b85fd=_0x11ec50;_0x294aea=0xc8;}else{_0x294aea=0xce;}_0x530f82[_0x0e13('0x16')](_0x294aea);return _0x530f82[_0x0e13('0x1d')](_0x0e13('0x1e'),_0x510a2b+'-'+_0x3b85fd+'/'+_0x11ec50)[_0x0e13('0x18')](_0xbc1617);}return null;};}function patchUpdates(_0x5ef062){return function(_0x5cfba8){try{jsonpatch['apply'](_0x5cfba8,_0x5ef062,!![]);}catch(_0x2dddef){return BPromise[_0x0e13('0x1f')](_0x2dddef);}return _0x5cfba8['save']();};}function saveUpdates(_0x515222,_0x295eb0){return function(_0x296ed3){if(_0x296ed3){return _0x296ed3[_0x0e13('0x20')](_0x515222)['then'](function(_0x400e87){return _0x400e87;});}return null;};}function removeEntity(_0x70c3db,_0x22cc15){return function(_0x20303b){if(_0x20303b){return _0x20303b[_0x0e13('0x21')]()[_0x0e13('0x22')](function(){_0x70c3db[_0x0e13('0x16')](0xcc)[_0x0e13('0x17')]();});}};}function handleEntityNotFound(_0x3d6abf,_0x260bf7){return function(_0x9621e2){if(!_0x9621e2){_0x3d6abf[_0x0e13('0x15')](0x194);}return _0x9621e2;};}function handleError(_0x230684,_0x45edf7){_0x45edf7=_0x45edf7||0x1f4;return function(_0xfd19ed){logger[_0x0e13('0x23')](_0xfd19ed[_0x0e13('0x24')]);if(_0xfd19ed['name']){delete _0xfd19ed[_0x0e13('0x25')];}_0x230684[_0x0e13('0x16')](_0x45edf7)[_0x0e13('0x26')](_0xfd19ed);};}exports['index']=function(_0x2182ae,_0x1deb3b){var _0xa38940={},_0x4606de={},_0x5d41c3={'count':0x0,'rows':[]};var _0xe9151f=_[_0x0e13('0x27')](db[_0x0e13('0x28')][_0x0e13('0x29')],function(_0x2e65e2){return{'name':_0x2e65e2[_0x0e13('0x2a')],'type':_0x2e65e2[_0x0e13('0x2b')][_0x0e13('0x2c')]};});_0x4606de['model']=_[_0x0e13('0x27')](_0xe9151f,_0x0e13('0x25'));_0x4606de[_0x0e13('0x2d')]=_['keys'](_0x2182ae[_0x0e13('0x2d')]);_0x4606de[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],_0x4606de[_0x0e13('0x2d')]);_0xa38940[_0x0e13('0x31')]=_[_0x0e13('0x2f')](_0x4606de[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0x2182ae['query'][_0x0e13('0x32')]));_0xa38940[_0x0e13('0x31')]=_0xa38940[_0x0e13('0x31')]['length']?_0xa38940[_0x0e13('0x31')]:_0x4606de['model'];if(!_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x33')](_0x0e13('0x34'))){_0xa38940[_0x0e13('0x1b')]=qs[_0x0e13('0x1b')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x1b')]);_0xa38940['offset']=qs['offset'](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x19')]);}_0xa38940[_0x0e13('0x35')]=qs[_0x0e13('0x36')](_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x36')]);_0xa38940[_0x0e13('0x37')]=qs['filters'](_[_0x0e13('0x38')](_0x2182ae[_0x0e13('0x2d')],_0x4606de[_0x0e13('0x2e')]),_0xe9151f);if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x39')]){_0xa38940['where']=_[_0x0e13('0x3a')](_0xa38940[_0x0e13('0x37')],{'$or':_[_0x0e13('0x27')](_0xe9151f,function(_0x4b17f2){if(_0x4b17f2[_0x0e13('0x2b')]!=='VIRTUAL'){var _0x33af9a={};_0x33af9a[_0x4b17f2['name']]={'$like':'%'+_0x2182ae[_0x0e13('0x2d')]['filter']+'%'};return _0x33af9a;}})});}_0xa38940=_[_0x0e13('0x3a')]({},_0xa38940,_0x2182ae[_0x0e13('0x3b')]);var _0x3cdc25={'where':_0xa38940[_0x0e13('0x37')]};return db[_0x0e13('0x28')][_0x0e13('0x1c')](_0x3cdc25)['then'](function(_0x445949){_0x5d41c3[_0x0e13('0x1c')]=_0x445949;if(_0x2182ae[_0x0e13('0x2d')][_0x0e13('0x3c')]){_0xa38940[_0x0e13('0x3d')]=[{'all':!![]}];}return db[_0x0e13('0x28')][_0x0e13('0x3e')](_0xa38940);})['then'](function(_0x164720){_0x5d41c3['rows']=_0x164720;return _0x5d41c3;})['then'](respondWithFilteredResult(_0x1deb3b,_0xa38940))['catch'](handleError(_0x1deb3b,null));};exports[_0x0e13('0x3f')]=function(_0xe6bb04,_0x3060e1){var _0x14ab2a={'raw':!![],'where':{'id':_0xe6bb04[_0x0e13('0x40')]['id']}},_0x3ee751={};_0x3ee751[_0x0e13('0x30')]=_['keys'](db[_0x0e13('0x28')]['rawAttributes']);_0x3ee751['query']=_[_0x0e13('0x41')](_0xe6bb04[_0x0e13('0x2d')]);_0x3ee751[_0x0e13('0x2e')]=_[_0x0e13('0x2f')](_0x3ee751['model'],_0x3ee751[_0x0e13('0x2d')]);_0x14ab2a[_0x0e13('0x31')]=_['intersection'](_0x3ee751[_0x0e13('0x30')],qs[_0x0e13('0x32')](_0xe6bb04[_0x0e13('0x2d')][_0x0e13('0x32')]));_0x14ab2a[_0x0e13('0x31')]=_0x14ab2a[_0x0e13('0x31')][_0x0e13('0x42')]?_0x14ab2a[_0x0e13('0x31')]:_0x3ee751[_0x0e13('0x30')];if(_0xe6bb04[_0x0e13('0x2d')]['includeAll']){_0x14ab2a['include']=[{'all':!![]}];}_0x14ab2a=_[_0x0e13('0x3a')]({},_0x14ab2a,_0xe6bb04[_0x0e13('0x3b')]);return db[_0x0e13('0x28')][_0x0e13('0x43')](_0x14ab2a)[_0x0e13('0x22')](handleEntityNotFound(_0x3060e1,null))['then'](respondWithResult(_0x3060e1,null))[_0x0e13('0x44')](handleError(_0x3060e1,null));};exports[_0x0e13('0x45')]=function(_0x30b637,_0x548259){return db[_0x0e13('0x28')]['create'](_0x30b637[_0x0e13('0x46')],{})[_0x0e13('0x22')](respondWithResult(_0x548259,0xc9))[_0x0e13('0x44')](handleError(_0x548259,null));};exports[_0x0e13('0x20')]=function(_0x35249c,_0x47e5b8){if(_0x35249c[_0x0e13('0x46')]['id']){delete _0x35249c['body']['id'];}return db[_0x0e13('0x28')][_0x0e13('0x43')]({'where':{'id':_0x35249c['params']['id']}})[_0x0e13('0x22')](handleEntityNotFound(_0x47e5b8,null))[_0x0e13('0x22')](saveUpdates(_0x35249c[_0x0e13('0x46')],null))[_0x0e13('0x22')](respondWithResult(_0x47e5b8,null))['catch'](handleError(_0x47e5b8,null));};exports[_0x0e13('0x21')]=function(_0x359de5,_0x4d9afd){return db[_0x0e13('0x28')]['find']({'where':{'id':_0x359de5['params']['id']}})['then'](handleEntityNotFound(_0x4d9afd,null))[_0x0e13('0x22')](removeEntity(_0x4d9afd,null))['catch'](handleError(_0x4d9afd,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2fd5c60..b28de9d 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 _0x1bfb=['path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x1bfb,0x190));var _0xb1bf=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x1bfb[_0x31abee];return _0x3c1761;};'use strict';var _=require(_0xb1bf('0x0'));var util=require(_0xb1bf('0x1'));var logger=require(_0xb1bf('0x2'))(_0xb1bf('0x3'));var moment=require(_0xb1bf('0x4'));var BPromise=require(_0xb1bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1bf('0x6'));var rimraf=require(_0xb1bf('0x7'));var config=require(_0xb1bf('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0xb1bf('0x9')]=function(_0x4f5c54,_0xb6f1e){return _0x4f5c54[_0xb1bf('0xa')](_0xb1bf('0xb'),attributes,{'tableName':_0xb1bf('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xb1bf('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb31c=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb31c,0x108));var _0xcb31=function(_0x26dcf1,_0x567f3d){_0x26dcf1=_0x26dcf1-0x0;var _0x454d8c=_0xb31c[_0x26dcf1];return _0x454d8c;};'use strict';var _=require(_0xcb31('0x0'));var util=require(_0xcb31('0x1'));var logger=require(_0xcb31('0x2'))(_0xcb31('0x3'));var moment=require(_0xcb31('0x4'));var BPromise=require(_0xcb31('0x5'));var rp=require(_0xcb31('0x6'));var fs=require('fs');var path=require(_0xcb31('0x7'));var rimraf=require(_0xcb31('0x8'));var config=require(_0xcb31('0x9'));var attributes=require(_0xcb31('0xa'));module[_0xcb31('0xb')]=function(_0x485180,_0x29462d){return _0x485180[_0xcb31('0xc')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xcb31('0xd'),'fields':[_0xcb31('0xe'),_0xcb31('0xf')],'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 b450a24..433b2f6 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 _0x6ceb=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x32817d,_0x1c8a1a){var _0x554f3d=function(_0x3d2f64){while(--_0x3d2f64){_0x32817d['push'](_0x32817d['shift']());}};_0x554f3d(++_0x1c8a1a);}(_0x6ceb,0x14b));var _0xb6ce=function(_0x40ef5a,_0x32aa37){_0x40ef5a=_0x40ef5a-0x0;var _0x2fe35b=_0x6ceb[_0x40ef5a];return _0x2fe35b;};'use strict';var _=require(_0xb6ce('0x0'));var util=require('util');var moment=require(_0xb6ce('0x1'));var BPromise=require(_0xb6ce('0x2'));var rs=require(_0xb6ce('0x3'));var fs=require('fs');var Redis=require(_0xb6ce('0x4'));var db=require(_0xb6ce('0x5'))['db'];var utils=require(_0xb6ce('0x6'));var logger=require(_0xb6ce('0x7'))('rpc');var config=require(_0xb6ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb6ce('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fe99,_0x244868,_0x380499){return new BPromise(function(_0x248ef1,_0x2b4d1c){return client[_0xb6ce('0xa')](_0x57fe99,_0x380499)[_0xb6ce('0xb')](function(_0x22e9f0){logger[_0xb6ce('0xc')](_0xb6ce('0xd'),_0x244868,_0xb6ce('0xe'));logger[_0xb6ce('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x244868,'request\x20sent',JSON[_0xb6ce('0x10')](_0x22e9f0));if(_0x22e9f0['error']){if(_0x22e9f0[_0xb6ce('0x11')][_0xb6ce('0x12')]===0x1f4){logger[_0xb6ce('0x11')](_0xb6ce('0xd'),_0x244868,_0x22e9f0[_0xb6ce('0x11')][_0xb6ce('0x13')]);return _0x2b4d1c(_0x22e9f0['error']['message']);}logger[_0xb6ce('0x11')](_0xb6ce('0xd'),_0x244868,_0x22e9f0[_0xb6ce('0x11')]['message']);return _0x248ef1(_0x22e9f0[_0xb6ce('0x11')][_0xb6ce('0x13')]);}else{logger[_0xb6ce('0xc')](_0xb6ce('0xd'),_0x244868,_0xb6ce('0xe'));_0x248ef1(_0x22e9f0[_0xb6ce('0x14')]['message']);}})[_0xb6ce('0x15')](function(_0x339ba2){logger[_0xb6ce('0x11')](_0xb6ce('0xd'),_0x244868,_0x339ba2);_0x2b4d1c(_0x339ba2);});});} \ No newline at end of file +var _0xc5af=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3da04d,_0x45d5ee){var _0x54c15a=function(_0x1a715c){while(--_0x1a715c){_0x3da04d['push'](_0x3da04d['shift']());}};_0x54c15a(++_0x45d5ee);}(_0xc5af,0x10e));var _0xfc5a=function(_0x413203,_0x46b492){_0x413203=_0x413203-0x0;var _0x5bb075=_0xc5af[_0x413203];return _0x5bb075;};'use strict';var _=require(_0xfc5a('0x0'));var util=require(_0xfc5a('0x1'));var moment=require(_0xfc5a('0x2'));var BPromise=require(_0xfc5a('0x3'));var rs=require(_0xfc5a('0x4'));var fs=require('fs');var Redis=require(_0xfc5a('0x5'));var db=require(_0xfc5a('0x6'))['db'];var utils=require(_0xfc5a('0x7'));var logger=require(_0xfc5a('0x8'))('rpc');var config=require(_0xfc5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc5a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354a10,_0x31fb63,_0x28b9e8){return new BPromise(function(_0x5b1d9e,_0x511e5a){return client[_0xfc5a('0xb')](_0x354a10,_0x28b9e8)[_0xfc5a('0xc')](function(_0x24fe21){logger['info'](_0xfc5a('0xd'),_0x31fb63,_0xfc5a('0xe'));logger['debug'](_0xfc5a('0xf'),_0x31fb63,_0xfc5a('0xe'),JSON[_0xfc5a('0x10')](_0x24fe21));if(_0x24fe21[_0xfc5a('0x11')]){if(_0x24fe21['error'][_0xfc5a('0x12')]===0x1f4){logger['error'](_0xfc5a('0xd'),_0x31fb63,_0x24fe21[_0xfc5a('0x11')][_0xfc5a('0x13')]);return _0x511e5a(_0x24fe21[_0xfc5a('0x11')]['message']);}logger[_0xfc5a('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x31fb63,_0x24fe21[_0xfc5a('0x11')][_0xfc5a('0x13')]);return _0x5b1d9e(_0x24fe21[_0xfc5a('0x11')][_0xfc5a('0x13')]);}else{logger[_0xfc5a('0x14')](_0xfc5a('0xd'),_0x31fb63,_0xfc5a('0xe'));_0x5b1d9e(_0x24fe21[_0xfc5a('0x15')][_0xfc5a('0x13')]);}})['catch'](function(_0x3619e9){logger[_0xfc5a('0x11')](_0xfc5a('0xd'),_0x31fb63,_0x3619e9);_0x511e5a(_0x3619e9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index fc94de1..de8bfd8 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x42f98d,_0x4ec2cc){var _0x47401e=function(_0x241340){while(--_0x241340){_0x42f98d['push'](_0x42f98d['shift']());}};_0x47401e(++_0x4ec2cc);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2ac2de,_0x109a1e){_0x2ac2de=_0x2ac2de-0x0;var _0xf453a1=_0x9c00[_0x2ac2de];return _0xf453a1;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id/configurations',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0x11'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x13')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x14')]);router[_0x09c0('0x15')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x16')]);module[_0x09c0('0x17')]=router; \ No newline at end of file +var _0x4cf8=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration'];(function(_0x4f363e,_0x58cfc0){var _0x3dda9c=function(_0x1a5f95){while(--_0x1a5f95){_0x4f363e['push'](_0x4f363e['shift']());}};_0x3dda9c(++_0x58cfc0);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x4cf8[_0x2d982d];return _0x4f36b0;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['getConfigurations']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x11')]);router['post']('/:id/configurations',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x15')]);router[_0x84cf('0x16')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 983441a..e3568ac 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['STRING','remoteUri'];(function(_0x11b9be,_0x3a8373){var _0x32057d=function(_0x4da603){while(--_0x4da603){_0x11b9be['push'](_0x11b9be['shift']());}};_0x32057d(++_0x3a8373);}(_0x1a85,0x178));var _0x51a8=function(_0x4c0629,_0xc61b41){_0x4c0629=_0x4c0629-0x0;var _0xe34b2a=_0x1a85[_0x4c0629];return _0xe34b2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x0adf=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x159d53,_0x521ef9){_0x159d53=_0x159d53-0x0;var _0xe9cfb1=_0x0adf[_0x159d53];return _0xe9cfb1;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x3')},'apiKey':{'type':Sequelize[_0xf0ad('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x4')},'serverUrl':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e9d5795..16407da 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4036=['length','nolimit','sort','where','merge','VIRTUAL','filter','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','apiKey','remoteUri','substring','GET','/api/selector/owners','Token\x20token=','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x2031da,_0x3a2ab5){var _0x2c16ac=function(_0x3ecbc0){while(--_0x3ecbc0){_0x2031da['push'](_0x2031da['shift']());}};_0x2c16ac(++_0x3a2ab5);}(_0x4036,0xf8));var _0x6403=function(_0x6ca07c,_0x5cc954){_0x6ca07c=_0x6ca07c-0x0;var _0x32f9b7=_0x4036[_0x6ca07c];return _0x32f9b7;};'use strict';var emlformat=require(_0x6403('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6403('0x1'));var jsonpatch=require(_0x6403('0x2'));var rp=require(_0x6403('0x3'));var moment=require(_0x6403('0x4'));var BPromise=require(_0x6403('0x5'));var Mustache=require(_0x6403('0x6'));var util=require('util');var path=require(_0x6403('0x7'));var sox=require(_0x6403('0x8'));var csv=require(_0x6403('0x9'));var ejs=require(_0x6403('0xa'));var fs=require('fs');var fs_extra=require(_0x6403('0xb'));var _=require('lodash');var squel=require(_0x6403('0xc'));var crypto=require('crypto');var jsforce=require(_0x6403('0xd'));var deskjs=require(_0x6403('0xe'));var toCsv=require(_0x6403('0x9'));var querystring=require(_0x6403('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6403('0x10'));var as=require(_0x6403('0x11'));var hardwareService=require(_0x6403('0x12'));var logger=require(_0x6403('0x13'))(_0x6403('0x14'));var utils=require(_0x6403('0x15'));var config=require(_0x6403('0x16'));var licenseUtil=require(_0x6403('0x17'));var db=require(_0x6403('0x18'))['db'];var integrations=require(_0x6403('0x19'));function respondWithStatusCode(_0x511808,_0x4dda7a){_0x4dda7a=_0x4dda7a||0xcc;return function(_0x8a69cb){if(_0x8a69cb){return _0x511808[_0x6403('0x1a')](_0x4dda7a);}return _0x511808[_0x6403('0x1b')](_0x4dda7a)[_0x6403('0x1c')]();};}function respondWithResult(_0xd76b3f,_0x32db42){_0x32db42=_0x32db42||0xc8;return function(_0x54f4b3){if(_0x54f4b3){return _0xd76b3f['status'](_0x32db42)[_0x6403('0x1d')](_0x54f4b3);}};}function respondWithFilteredResult(_0x5e6813,_0x55fd){return function(_0x5b7f0a){if(_0x5b7f0a){var _0xf98568=typeof _0x55fd['offset']===_0x6403('0x1e')&&typeof _0x55fd[_0x6403('0x1f')]===_0x6403('0x1e');var _0x529d31=_0x5b7f0a[_0x6403('0x20')];var _0x194ba0=_0xf98568?0x0:_0x55fd[_0x6403('0x21')];var _0x4512a3=_0xf98568?_0x5b7f0a[_0x6403('0x20')]:_0x55fd[_0x6403('0x21')]+_0x55fd[_0x6403('0x1f')];var _0x458211;if(_0x4512a3>=_0x529d31){_0x4512a3=_0x529d31;_0x458211=0xc8;}else{_0x458211=0xce;}_0x5e6813[_0x6403('0x1b')](_0x458211);return _0x5e6813[_0x6403('0x22')](_0x6403('0x23'),_0x194ba0+'-'+_0x4512a3+'/'+_0x529d31)['json'](_0x5b7f0a);}return null;};}function patchUpdates(_0x36f470){return function(_0x31e547){try{jsonpatch['apply'](_0x31e547,_0x36f470,!![]);}catch(_0x3b48be){return BPromise[_0x6403('0x24')](_0x3b48be);}return _0x31e547[_0x6403('0x25')]();};}function saveUpdates(_0x293c0c,_0x10d3d4){return function(_0x212f85){if(_0x212f85){return _0x212f85[_0x6403('0x26')](_0x293c0c)[_0x6403('0x27')](function(_0x8c7ee){return _0x8c7ee;});}return null;};}function removeEntity(_0x5310f5,_0x29517b){return function(_0x1f135d){if(_0x1f135d){return _0x1f135d[_0x6403('0x28')]()[_0x6403('0x27')](function(){_0x5310f5['status'](0xcc)[_0x6403('0x1c')]();});}};}function handleEntityNotFound(_0x10eb8a,_0x5d9473){return function(_0xe5e498){if(!_0xe5e498){_0x10eb8a['sendStatus'](0x194);}return _0xe5e498;};}function handleError(_0x14b2e9,_0x141a58){_0x141a58=_0x141a58||0x1f4;return function(_0x447ace){logger[_0x6403('0x29')](_0x447ace[_0x6403('0x2a')]);if(_0x447ace[_0x6403('0x2b')]){delete _0x447ace[_0x6403('0x2b')];}_0x14b2e9['status'](_0x141a58)[_0x6403('0x2c')](_0x447ace);};}exports['index']=function(_0x52d05d,_0x28d1df){var _0x40f0bb={},_0xeea686={},_0x257ec9={'count':0x0,'rows':[]};var _0x508799=_[_0x6403('0x2d')](db['FreshsalesAccount']['rawAttributes'],function(_0x3a826a){return{'name':_0x3a826a[_0x6403('0x2e')],'type':_0x3a826a[_0x6403('0x2f')][_0x6403('0x30')]};});_0xeea686[_0x6403('0x31')]=_[_0x6403('0x2d')](_0x508799,_0x6403('0x2b'));_0xeea686['query']=_[_0x6403('0x32')](_0x52d05d[_0x6403('0x33')]);_0xeea686[_0x6403('0x34')]=_[_0x6403('0x35')](_0xeea686['model'],_0xeea686[_0x6403('0x33')]);_0x40f0bb['attributes']=_['intersection'](_0xeea686[_0x6403('0x31')],qs['fields'](_0x52d05d[_0x6403('0x33')]['fields']));_0x40f0bb['attributes']=_0x40f0bb[_0x6403('0x36')][_0x6403('0x37')]?_0x40f0bb[_0x6403('0x36')]:_0xeea686['model'];if(!_0x52d05d[_0x6403('0x33')]['hasOwnProperty'](_0x6403('0x38'))){_0x40f0bb[_0x6403('0x1f')]=qs[_0x6403('0x1f')](_0x52d05d['query'][_0x6403('0x1f')]);_0x40f0bb['offset']=qs[_0x6403('0x21')](_0x52d05d[_0x6403('0x33')][_0x6403('0x21')]);}_0x40f0bb['order']=qs[_0x6403('0x39')](_0x52d05d[_0x6403('0x33')][_0x6403('0x39')]);_0x40f0bb[_0x6403('0x3a')]=qs[_0x6403('0x34')](_['pick'](_0x52d05d[_0x6403('0x33')],_0xeea686[_0x6403('0x34')]),_0x508799);if(_0x52d05d[_0x6403('0x33')]['filter']){_0x40f0bb[_0x6403('0x3a')]=_[_0x6403('0x3b')](_0x40f0bb[_0x6403('0x3a')],{'$or':_[_0x6403('0x2d')](_0x508799,function(_0x4cc17c){if(_0x4cc17c[_0x6403('0x2f')]!==_0x6403('0x3c')){var _0x1e4e51={};_0x1e4e51[_0x4cc17c['name']]={'$like':'%'+_0x52d05d[_0x6403('0x33')][_0x6403('0x3d')]+'%'};return _0x1e4e51;}})});}_0x40f0bb=_[_0x6403('0x3b')]({},_0x40f0bb,_0x52d05d[_0x6403('0x3e')]);var _0x4cd5ba={'where':_0x40f0bb[_0x6403('0x3a')]};return db[_0x6403('0x3f')]['count'](_0x4cd5ba)['then'](function(_0x55efa8){_0x257ec9[_0x6403('0x20')]=_0x55efa8;if(_0x52d05d[_0x6403('0x33')][_0x6403('0x40')]){_0x40f0bb[_0x6403('0x41')]=[{'all':!![]}];}return db[_0x6403('0x3f')][_0x6403('0x42')](_0x40f0bb);})[_0x6403('0x27')](function(_0x379e65){_0x257ec9[_0x6403('0x43')]=_0x379e65;return _0x257ec9;})[_0x6403('0x27')](respondWithFilteredResult(_0x28d1df,_0x40f0bb))[_0x6403('0x44')](handleError(_0x28d1df,null));};exports[_0x6403('0x45')]=function(_0x20a35b,_0x23299c){var _0x3de531={'raw':![],'where':{'id':_0x20a35b['params']['id']}},_0x5836d4={};_0x5836d4[_0x6403('0x31')]=_[_0x6403('0x32')](db[_0x6403('0x3f')]['rawAttributes']);_0x5836d4['query']=_[_0x6403('0x32')](_0x20a35b['query']);_0x5836d4[_0x6403('0x34')]=_[_0x6403('0x35')](_0x5836d4[_0x6403('0x31')],_0x5836d4[_0x6403('0x33')]);_0x3de531['attributes']=_[_0x6403('0x35')](_0x5836d4[_0x6403('0x31')],qs['fields'](_0x20a35b[_0x6403('0x33')][_0x6403('0x46')]));_0x3de531['attributes']=_0x3de531[_0x6403('0x36')][_0x6403('0x37')]?_0x3de531[_0x6403('0x36')]:_0x5836d4['model'];if(_0x20a35b[_0x6403('0x33')][_0x6403('0x40')]){_0x3de531[_0x6403('0x41')]=[{'all':!![]}];}_0x3de531=_[_0x6403('0x3b')]({},_0x3de531,_0x20a35b[_0x6403('0x3e')]);return db[_0x6403('0x3f')][_0x6403('0x47')](_0x3de531)['then'](handleEntityNotFound(_0x23299c,null))['then'](respondWithResult(_0x23299c,null))[_0x6403('0x44')](handleError(_0x23299c,null));};exports[_0x6403('0x48')]=function(_0x31c1d6,_0x24da54){return db[_0x6403('0x3f')][_0x6403('0x48')](_0x31c1d6[_0x6403('0x49')],{})[_0x6403('0x27')](respondWithResult(_0x24da54,0xc9))[_0x6403('0x44')](handleError(_0x24da54,null));};exports[_0x6403('0x26')]=function(_0x49ae52,_0x50b347){if(_0x49ae52[_0x6403('0x49')]['id']){delete _0x49ae52['body']['id'];}return db[_0x6403('0x3f')][_0x6403('0x47')]({'where':{'id':_0x49ae52[_0x6403('0x4a')]['id']}})[_0x6403('0x27')](handleEntityNotFound(_0x50b347,null))[_0x6403('0x27')](saveUpdates(_0x49ae52['body'],null))[_0x6403('0x27')](respondWithResult(_0x50b347,null))['catch'](handleError(_0x50b347,null));};exports[_0x6403('0x28')]=function(_0x286185,_0x28e78c){return db[_0x6403('0x3f')][_0x6403('0x47')]({'where':{'id':_0x286185[_0x6403('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28e78c,null))[_0x6403('0x27')](removeEntity(_0x28e78c,null))[_0x6403('0x44')](handleError(_0x28e78c,null));};exports[_0x6403('0x4b')]=function(_0x41c0d4,_0x2d4e5b,_0x31fb4e){var _0x754d7d={};var _0x44c3dc={};var _0x2e8d1a;var _0x219d2d;return db[_0x6403('0x3f')][_0x6403('0x4c')]({'where':{'id':_0x41c0d4['params']['id']}})[_0x6403('0x27')](handleEntityNotFound(_0x2d4e5b,null))[_0x6403('0x27')](function(_0x2cf1c6){if(_0x2cf1c6){_0x2e8d1a=_0x2cf1c6;_0x44c3dc[_0x6403('0x31')]=_['keys'](db[_0x6403('0x4d')][_0x6403('0x4e')]);_0x44c3dc[_0x6403('0x33')]=_[_0x6403('0x32')](_0x41c0d4['query']);_0x44c3dc['filters']=_[_0x6403('0x35')](_0x44c3dc[_0x6403('0x31')],_0x44c3dc[_0x6403('0x33')]);_0x754d7d[_0x6403('0x36')]=_[_0x6403('0x35')](_0x44c3dc[_0x6403('0x31')],qs[_0x6403('0x46')](_0x41c0d4[_0x6403('0x33')][_0x6403('0x46')]));_0x754d7d[_0x6403('0x36')]=_0x754d7d[_0x6403('0x36')][_0x6403('0x37')]?_0x754d7d[_0x6403('0x36')]:_0x44c3dc['model'];_0x754d7d['order']=qs[_0x6403('0x39')](_0x41c0d4[_0x6403('0x33')][_0x6403('0x39')]);_0x754d7d[_0x6403('0x3a')]=qs[_0x6403('0x34')](_[_0x6403('0x4f')](_0x41c0d4[_0x6403('0x33')],_0x44c3dc[_0x6403('0x34')]));if(_0x41c0d4['query'][_0x6403('0x3d')]){_0x754d7d[_0x6403('0x3a')]=_[_0x6403('0x3b')](_0x754d7d[_0x6403('0x3a')],{'$or':_[_0x6403('0x2d')](_0x754d7d[_0x6403('0x36')],function(_0x1e7acb){var _0x586e9e={};_0x586e9e[_0x1e7acb]={'$like':'%'+_0x41c0d4[_0x6403('0x33')]['filter']+'%'};return _0x586e9e;})});}_0x754d7d=_['merge']({},_0x754d7d,_0x41c0d4['options']);return _0x2e8d1a[_0x6403('0x4b')](_0x754d7d);}})[_0x6403('0x27')](function(_0x2fa513){if(_0x2fa513){_0x219d2d=_0x2fa513['length'];if(!_0x41c0d4[_0x6403('0x33')]['hasOwnProperty'](_0x6403('0x38'))){_0x754d7d[_0x6403('0x1f')]=qs[_0x6403('0x1f')](_0x41c0d4['query']['limit']);_0x754d7d[_0x6403('0x21')]=qs['offset'](_0x41c0d4[_0x6403('0x33')][_0x6403('0x21')]);}return _0x2e8d1a['getConfigurations'](_0x754d7d);}})[_0x6403('0x27')](function(_0x3c30b8){if(_0x3c30b8){return _0x3c30b8?{'count':_0x219d2d,'rows':_0x3c30b8}:null;}})[_0x6403('0x27')](respondWithResult(_0x2d4e5b,null))['catch'](handleError(_0x2d4e5b,null));};exports[_0x6403('0x50')]=function(_0x49bd51,_0x300259,_0x1e22fe){if(_0x49bd51[_0x6403('0x49')]['id']){delete _0x49bd51[_0x6403('0x49')]['id'];}return db[_0x6403('0x3f')]['findOne']({'where':{'id':_0x49bd51[_0x6403('0x4a')]['id']}})[_0x6403('0x27')](handleEntityNotFound(_0x300259,null))[_0x6403('0x27')](function(_0x59803f){if(_0x59803f){_0x49bd51[_0x6403('0x49')][_0x6403('0x51')]=_0x59803f['id'];_0x49bd51[_0x6403('0x49')][_0x6403('0x52')]=integrations[_0x6403('0x53')](_0x49bd51[_0x6403('0x49')][_0x6403('0x54')],_0x49bd51['body'][_0x6403('0x2f')]);_0x49bd51[_0x6403('0x49')][_0x6403('0x55')]=integrations[_0x6403('0x56')](_0x49bd51['body'][_0x6403('0x54')],_0x49bd51['body'][_0x6403('0x2f')]);return db[_0x6403('0x4d')][_0x6403('0x48')](_0x49bd51[_0x6403('0x49')],{'include':[{'model':db[_0x6403('0x57')],'as':_0x6403('0x52')},{'model':db[_0x6403('0x57')],'as':_0x6403('0x55')}]});}return null;})[_0x6403('0x27')](respondWithResult(_0x300259,null))[_0x6403('0x44')](handleError(_0x300259,null));};exports[_0x6403('0x58')]=function(_0x5a11ec,_0x323c8e,_0x5196f1){var _0xd6758='';var _0x2779b8='';return db['FreshsalesAccount'][_0x6403('0x4c')]({'where':{'id':_0x5a11ec[_0x6403('0x4a')]['id']},'attributes':['id','username','remoteUri',_0x6403('0x59')]})['then'](handleEntityNotFound(_0x323c8e,null))[_0x6403('0x27')](function(_0x5931e5){if(_0x5931e5){_0x2779b8=_0x5931e5['username'];_0xd6758=_0x5931e5[_0x6403('0x5a')];var _0x2064ab=_0x5931e5[_0x6403('0x5a')]['slice'](-0x1);if(_0x2064ab==='/'){_0xd6758=_0xd6758[_0x6403('0x5b')](0x0,_0xd6758['lastIndexOf'](_0x2064ab));}return rp({'method':_0x6403('0x5c'),'uri':util['format']('%s%s',_0xd6758,_0x6403('0x5d')),'headers':{'Authorization':_0x6403('0x5e')+_0x5931e5[_0x6403('0x59')]},'json':!![]});}})['then'](function(_0x48ed9f){if(_0x48ed9f){var _0x4d149a=_0x48ed9f[_0x6403('0x5f')];var _0x24116d=![];var _0x7871ec=null;for(_0x7871ec=0x0;_0x7871ec<_0x4d149a[_0x6403('0x37')];_0x7871ec++){if(_0x4d149a[_0x7871ec][_0x6403('0x60')]===_0x2779b8){_0x24116d=!![];}}if(_0x24116d){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x323c8e,null))['catch'](function(_0x37b676){var _0xcaa1d1=_0x5a11ec['query']['test']?0x1f4:_0x37b676[_0x6403('0x61')]||0x1f4;logger[_0x6403('0x29')](_0x6403('0x62'),_0x6403('0x58'),_0xcaa1d1,JSON[_0x6403('0x63')](_0x37b676));delete _0x37b676['name'];if(_0xcaa1d1===0x191){_0xcaa1d1=0x190;}_0x323c8e['status'](_0xcaa1d1)[_0x6403('0x2c')](_0x5a11ec[_0x6403('0x33')][_0x6403('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x37b676['statusCode']}:_0x37b676);});}; \ No newline at end of file +var _0xf1bc=['stack','name','send','FreshsalesAccount','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','filter','nolimit','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error'];(function(_0xccbe21,_0x3618d2){var _0x500f5d=function(_0x334e05){while(--_0x334e05){_0xccbe21['push'](_0xccbe21['shift']());}};_0x500f5d(++_0x3618d2);}(_0xf1bc,0x117));var _0xcf1b=function(_0x39df2d,_0x14d7fc){_0x39df2d=_0x39df2d-0x0;var _0x2398cf=_0xf1bc[_0x39df2d];return _0x2398cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf1b('0x0'));var zipdir=require(_0xcf1b('0x1'));var jsonpatch=require(_0xcf1b('0x2'));var rp=require(_0xcf1b('0x3'));var moment=require(_0xcf1b('0x4'));var BPromise=require(_0xcf1b('0x5'));var Mustache=require(_0xcf1b('0x6'));var util=require(_0xcf1b('0x7'));var path=require(_0xcf1b('0x8'));var sox=require('sox');var csv=require(_0xcf1b('0x9'));var ejs=require(_0xcf1b('0xa'));var fs=require('fs');var fs_extra=require(_0xcf1b('0xb'));var _=require(_0xcf1b('0xc'));var squel=require(_0xcf1b('0xd'));var crypto=require(_0xcf1b('0xe'));var jsforce=require(_0xcf1b('0xf'));var deskjs=require(_0xcf1b('0x10'));var toCsv=require(_0xcf1b('0x9'));var querystring=require(_0xcf1b('0x11'));var Papa=require('papaparse');var Redis=require(_0xcf1b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcf1b('0x13'));var as=require(_0xcf1b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf1b('0x15'))(_0xcf1b('0x16'));var utils=require(_0xcf1b('0x17'));var config=require(_0xcf1b('0x18'));var licenseUtil=require(_0xcf1b('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcf1b('0x1a'));function respondWithStatusCode(_0x52c7be,_0x462f60){_0x462f60=_0x462f60||0xcc;return function(_0x3e5f87){if(_0x3e5f87){return _0x52c7be[_0xcf1b('0x1b')](_0x462f60);}return _0x52c7be[_0xcf1b('0x1c')](_0x462f60)[_0xcf1b('0x1d')]();};}function respondWithResult(_0x1f9ac0,_0x3b6058){_0x3b6058=_0x3b6058||0xc8;return function(_0x11e175){if(_0x11e175){return _0x1f9ac0[_0xcf1b('0x1c')](_0x3b6058)[_0xcf1b('0x1e')](_0x11e175);}};}function respondWithFilteredResult(_0xb7508f,_0x122d03){return function(_0x87f1c){if(_0x87f1c){var _0x37b8b0=typeof _0x122d03[_0xcf1b('0x1f')]===_0xcf1b('0x20')&&typeof _0x122d03[_0xcf1b('0x21')]===_0xcf1b('0x20');var _0xfaa250=_0x87f1c[_0xcf1b('0x22')];var _0x30d2a9=_0x37b8b0?0x0:_0x122d03[_0xcf1b('0x1f')];var _0x6c2ec2=_0x37b8b0?_0x87f1c['count']:_0x122d03['offset']+_0x122d03[_0xcf1b('0x21')];var _0xcf2a12;if(_0x6c2ec2>=_0xfaa250){_0x6c2ec2=_0xfaa250;_0xcf2a12=0xc8;}else{_0xcf2a12=0xce;}_0xb7508f['status'](_0xcf2a12);return _0xb7508f[_0xcf1b('0x23')]('Content-Range',_0x30d2a9+'-'+_0x6c2ec2+'/'+_0xfaa250)[_0xcf1b('0x1e')](_0x87f1c);}return null;};}function patchUpdates(_0x67b29f){return function(_0x1f2f9a){try{jsonpatch['apply'](_0x1f2f9a,_0x67b29f,!![]);}catch(_0x21c781){return BPromise[_0xcf1b('0x24')](_0x21c781);}return _0x1f2f9a[_0xcf1b('0x25')]();};}function saveUpdates(_0x1f25e3,_0x186499){return function(_0x4c396e){if(_0x4c396e){return _0x4c396e[_0xcf1b('0x26')](_0x1f25e3)[_0xcf1b('0x27')](function(_0x3720dc){return _0x3720dc;});}return null;};}function removeEntity(_0x14af88,_0x187ab4){return function(_0x55658e){if(_0x55658e){return _0x55658e[_0xcf1b('0x28')]()[_0xcf1b('0x27')](function(){_0x14af88['status'](0xcc)[_0xcf1b('0x1d')]();});}};}function handleEntityNotFound(_0x282bdc,_0x9b3784){return function(_0xdd015d){if(!_0xdd015d){_0x282bdc['sendStatus'](0x194);}return _0xdd015d;};}function handleError(_0xc541c5,_0x566828){_0x566828=_0x566828||0x1f4;return function(_0x3883f4){logger[_0xcf1b('0x29')](_0x3883f4[_0xcf1b('0x2a')]);if(_0x3883f4[_0xcf1b('0x2b')]){delete _0x3883f4[_0xcf1b('0x2b')];}_0xc541c5['status'](_0x566828)[_0xcf1b('0x2c')](_0x3883f4);};}exports['index']=function(_0x500ea5,_0x1de133){var _0xccbbd={},_0x2ef0ae={},_0x1e9616={'count':0x0,'rows':[]};var _0x3e237b=_['map'](db[_0xcf1b('0x2d')]['rawAttributes'],function(_0x5d53b8){return{'name':_0x5d53b8[_0xcf1b('0x2e')],'type':_0x5d53b8[_0xcf1b('0x2f')][_0xcf1b('0x30')]};});_0x2ef0ae[_0xcf1b('0x31')]=_[_0xcf1b('0x32')](_0x3e237b,_0xcf1b('0x2b'));_0x2ef0ae[_0xcf1b('0x33')]=_['keys'](_0x500ea5['query']);_0x2ef0ae[_0xcf1b('0x34')]=_[_0xcf1b('0x35')](_0x2ef0ae[_0xcf1b('0x31')],_0x2ef0ae['query']);_0xccbbd['attributes']=_['intersection'](_0x2ef0ae[_0xcf1b('0x31')],qs[_0xcf1b('0x36')](_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x36')]));_0xccbbd[_0xcf1b('0x37')]=_0xccbbd['attributes'][_0xcf1b('0x38')]?_0xccbbd[_0xcf1b('0x37')]:_0x2ef0ae['model'];if(!_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x39')]('nolimit')){_0xccbbd['limit']=qs[_0xcf1b('0x21')](_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x21')]);_0xccbbd[_0xcf1b('0x1f')]=qs[_0xcf1b('0x1f')](_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x1f')]);}_0xccbbd[_0xcf1b('0x3a')]=qs['sort'](_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x3b')]);_0xccbbd[_0xcf1b('0x3c')]=qs[_0xcf1b('0x34')](_[_0xcf1b('0x3d')](_0x500ea5['query'],_0x2ef0ae[_0xcf1b('0x34')]),_0x3e237b);if(_0x500ea5[_0xcf1b('0x33')]['filter']){_0xccbbd[_0xcf1b('0x3c')]=_[_0xcf1b('0x3e')](_0xccbbd[_0xcf1b('0x3c')],{'$or':_[_0xcf1b('0x32')](_0x3e237b,function(_0x37c041){if(_0x37c041[_0xcf1b('0x2f')]!==_0xcf1b('0x3f')){var _0x155b84={};_0x155b84[_0x37c041[_0xcf1b('0x2b')]]={'$like':'%'+_0x500ea5[_0xcf1b('0x33')]['filter']+'%'};return _0x155b84;}})});}_0xccbbd=_[_0xcf1b('0x3e')]({},_0xccbbd,_0x500ea5[_0xcf1b('0x40')]);var _0x494a60={'where':_0xccbbd[_0xcf1b('0x3c')]};return db['FreshsalesAccount'][_0xcf1b('0x22')](_0x494a60)['then'](function(_0x4f7255){_0x1e9616['count']=_0x4f7255;if(_0x500ea5[_0xcf1b('0x33')][_0xcf1b('0x41')]){_0xccbbd[_0xcf1b('0x42')]=[{'all':!![]}];}return db[_0xcf1b('0x2d')][_0xcf1b('0x43')](_0xccbbd);})['then'](function(_0x5b4bd2){_0x1e9616[_0xcf1b('0x44')]=_0x5b4bd2;return _0x1e9616;})[_0xcf1b('0x27')](respondWithFilteredResult(_0x1de133,_0xccbbd))[_0xcf1b('0x45')](handleError(_0x1de133,null));};exports[_0xcf1b('0x46')]=function(_0x5d4936,_0x46861e){var _0x541105={'raw':![],'where':{'id':_0x5d4936['params']['id']}},_0xa34023={};_0xa34023[_0xcf1b('0x31')]=_[_0xcf1b('0x47')](db[_0xcf1b('0x2d')][_0xcf1b('0x48')]);_0xa34023['query']=_[_0xcf1b('0x47')](_0x5d4936['query']);_0xa34023[_0xcf1b('0x34')]=_['intersection'](_0xa34023[_0xcf1b('0x31')],_0xa34023[_0xcf1b('0x33')]);_0x541105[_0xcf1b('0x37')]=_[_0xcf1b('0x35')](_0xa34023[_0xcf1b('0x31')],qs[_0xcf1b('0x36')](_0x5d4936[_0xcf1b('0x33')]['fields']));_0x541105[_0xcf1b('0x37')]=_0x541105[_0xcf1b('0x37')][_0xcf1b('0x38')]?_0x541105[_0xcf1b('0x37')]:_0xa34023[_0xcf1b('0x31')];if(_0x5d4936[_0xcf1b('0x33')][_0xcf1b('0x41')]){_0x541105[_0xcf1b('0x42')]=[{'all':!![]}];}_0x541105=_['merge']({},_0x541105,_0x5d4936[_0xcf1b('0x40')]);return db[_0xcf1b('0x2d')][_0xcf1b('0x49')](_0x541105)[_0xcf1b('0x27')](handleEntityNotFound(_0x46861e,null))['then'](respondWithResult(_0x46861e,null))[_0xcf1b('0x45')](handleError(_0x46861e,null));};exports['create']=function(_0xcda560,_0x4958d3){return db[_0xcf1b('0x2d')][_0xcf1b('0x4a')](_0xcda560[_0xcf1b('0x4b')],{})[_0xcf1b('0x27')](respondWithResult(_0x4958d3,0xc9))['catch'](handleError(_0x4958d3,null));};exports[_0xcf1b('0x26')]=function(_0x119e10,_0x800a7){if(_0x119e10[_0xcf1b('0x4b')]['id']){delete _0x119e10[_0xcf1b('0x4b')]['id'];}return db[_0xcf1b('0x2d')][_0xcf1b('0x49')]({'where':{'id':_0x119e10[_0xcf1b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x800a7,null))[_0xcf1b('0x27')](saveUpdates(_0x119e10[_0xcf1b('0x4b')],null))[_0xcf1b('0x27')](respondWithResult(_0x800a7,null))[_0xcf1b('0x45')](handleError(_0x800a7,null));};exports[_0xcf1b('0x28')]=function(_0x1a68d1,_0x30030f){return db[_0xcf1b('0x2d')][_0xcf1b('0x49')]({'where':{'id':_0x1a68d1[_0xcf1b('0x4c')]['id']}})[_0xcf1b('0x27')](handleEntityNotFound(_0x30030f,null))[_0xcf1b('0x27')](removeEntity(_0x30030f,null))[_0xcf1b('0x45')](handleError(_0x30030f,null));};exports[_0xcf1b('0x4d')]=function(_0xb7c4f6,_0x4ba36b,_0xd7deee){var _0x1fa331={};var _0x2b29d0={};var _0x2a94c5;var _0x414ea0;return db['FreshsalesAccount'][_0xcf1b('0x4e')]({'where':{'id':_0xb7c4f6['params']['id']}})['then'](handleEntityNotFound(_0x4ba36b,null))[_0xcf1b('0x27')](function(_0xc17bff){if(_0xc17bff){_0x2a94c5=_0xc17bff;_0x2b29d0[_0xcf1b('0x31')]=_[_0xcf1b('0x47')](db[_0xcf1b('0x4f')][_0xcf1b('0x48')]);_0x2b29d0[_0xcf1b('0x33')]=_[_0xcf1b('0x47')](_0xb7c4f6[_0xcf1b('0x33')]);_0x2b29d0[_0xcf1b('0x34')]=_[_0xcf1b('0x35')](_0x2b29d0[_0xcf1b('0x31')],_0x2b29d0[_0xcf1b('0x33')]);_0x1fa331[_0xcf1b('0x37')]=_[_0xcf1b('0x35')](_0x2b29d0[_0xcf1b('0x31')],qs['fields'](_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x36')]));_0x1fa331[_0xcf1b('0x37')]=_0x1fa331['attributes']['length']?_0x1fa331['attributes']:_0x2b29d0[_0xcf1b('0x31')];_0x1fa331[_0xcf1b('0x3a')]=qs[_0xcf1b('0x3b')](_0xb7c4f6[_0xcf1b('0x33')]['sort']);_0x1fa331[_0xcf1b('0x3c')]=qs[_0xcf1b('0x34')](_['pick'](_0xb7c4f6[_0xcf1b('0x33')],_0x2b29d0['filters']));if(_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x50')]){_0x1fa331['where']=_['merge'](_0x1fa331[_0xcf1b('0x3c')],{'$or':_[_0xcf1b('0x32')](_0x1fa331[_0xcf1b('0x37')],function(_0x27f5df){var _0xb94200={};_0xb94200[_0x27f5df]={'$like':'%'+_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x50')]+'%'};return _0xb94200;})});}_0x1fa331=_[_0xcf1b('0x3e')]({},_0x1fa331,_0xb7c4f6[_0xcf1b('0x40')]);return _0x2a94c5[_0xcf1b('0x4d')](_0x1fa331);}})[_0xcf1b('0x27')](function(_0x16cfdf){if(_0x16cfdf){_0x414ea0=_0x16cfdf[_0xcf1b('0x38')];if(!_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x39')](_0xcf1b('0x51'))){_0x1fa331[_0xcf1b('0x21')]=qs[_0xcf1b('0x21')](_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x21')]);_0x1fa331[_0xcf1b('0x1f')]=qs[_0xcf1b('0x1f')](_0xb7c4f6[_0xcf1b('0x33')][_0xcf1b('0x1f')]);}return _0x2a94c5['getConfigurations'](_0x1fa331);}})[_0xcf1b('0x27')](function(_0x8fb18c){if(_0x8fb18c){return _0x8fb18c?{'count':_0x414ea0,'rows':_0x8fb18c}:null;}})[_0xcf1b('0x27')](respondWithResult(_0x4ba36b,null))[_0xcf1b('0x45')](handleError(_0x4ba36b,null));};exports['addConfiguration']=function(_0x591244,_0x5e8462,_0x14fdbb){if(_0x591244['body']['id']){delete _0x591244[_0xcf1b('0x4b')]['id'];}return db['FreshsalesAccount'][_0xcf1b('0x4e')]({'where':{'id':_0x591244[_0xcf1b('0x4c')]['id']}})[_0xcf1b('0x27')](handleEntityNotFound(_0x5e8462,null))[_0xcf1b('0x27')](function(_0x34c491){if(_0x34c491){_0x591244[_0xcf1b('0x4b')][_0xcf1b('0x52')]=_0x34c491['id'];_0x591244[_0xcf1b('0x4b')][_0xcf1b('0x53')]=integrations[_0xcf1b('0x54')](_0x591244[_0xcf1b('0x4b')]['channel'],_0x591244['body'][_0xcf1b('0x2f')]);_0x591244[_0xcf1b('0x4b')]['Descriptions']=integrations[_0xcf1b('0x55')](_0x591244[_0xcf1b('0x4b')][_0xcf1b('0x56')],_0x591244['body'][_0xcf1b('0x2f')]);return db[_0xcf1b('0x4f')][_0xcf1b('0x4a')](_0x591244[_0xcf1b('0x4b')],{'include':[{'model':db[_0xcf1b('0x57')],'as':'Subjects'},{'model':db[_0xcf1b('0x57')],'as':'Descriptions'}]});}return null;})[_0xcf1b('0x27')](respondWithResult(_0x5e8462,null))[_0xcf1b('0x45')](handleError(_0x5e8462,null));};exports[_0xcf1b('0x58')]=function(_0x74adbd,_0x5d0048,_0xd799fd){var _0x445858='';var _0x451277='';return db[_0xcf1b('0x2d')][_0xcf1b('0x4e')]({'where':{'id':_0x74adbd[_0xcf1b('0x4c')]['id']},'attributes':['id',_0xcf1b('0x59'),_0xcf1b('0x5a'),_0xcf1b('0x5b')]})['then'](handleEntityNotFound(_0x5d0048,null))[_0xcf1b('0x27')](function(_0x2addaa){if(_0x2addaa){_0x451277=_0x2addaa['username'];_0x445858=_0x2addaa[_0xcf1b('0x5a')];var _0x47b2de=_0x2addaa[_0xcf1b('0x5a')][_0xcf1b('0x5c')](-0x1);if(_0x47b2de==='/'){_0x445858=_0x445858[_0xcf1b('0x5d')](0x0,_0x445858['lastIndexOf'](_0x47b2de));}return rp({'method':_0xcf1b('0x5e'),'uri':util[_0xcf1b('0x5f')](_0xcf1b('0x60'),_0x445858,_0xcf1b('0x61')),'headers':{'Authorization':_0xcf1b('0x62')+_0x2addaa[_0xcf1b('0x5b')]},'json':!![]});}})[_0xcf1b('0x27')](function(_0x53d499){if(_0x53d499){var _0x426f87=_0x53d499[_0xcf1b('0x63')];var _0x5e2781=![];var _0x51a583=null;for(_0x51a583=0x0;_0x51a583<_0x426f87[_0xcf1b('0x38')];_0x51a583++){if(_0x426f87[_0x51a583][_0xcf1b('0x64')]===_0x451277){_0x5e2781=!![];}}if(_0x5e2781){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcf1b('0x65')});}}})['then'](respondWithResult(_0x5d0048,null))[_0xcf1b('0x45')](function(_0x2a45c4){var _0x2c9b4e=_0x74adbd[_0xcf1b('0x33')]['test']?0x1f4:_0x2a45c4[_0xcf1b('0x66')]||0x1f4;logger[_0xcf1b('0x29')](_0xcf1b('0x67'),'getFields',_0x2c9b4e,JSON[_0xcf1b('0x68')](_0x2a45c4));delete _0x2a45c4['name'];if(_0x2c9b4e===0x191){_0x2c9b4e=0x190;}_0x5d0048[_0xcf1b('0x1c')](_0x2c9b4e)[_0xcf1b('0x2c')](_0x74adbd[_0xcf1b('0x33')][_0xcf1b('0x69')]?{'message':_0xcf1b('0x6a'),'statusCode':_0x2a45c4[_0xcf1b('0x66')]}:_0x2a45c4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index a90c037..575283e 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0adf=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x4dcb04,_0x409be9){var _0x419529=function(_0x5bbea1){while(--_0x5bbea1){_0x4dcb04['push'](_0x4dcb04['shift']());}};_0x419529(++_0x409be9);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x38af04,_0x24f751){_0x38af04=_0x38af04-0x0;var _0x47803c=_0x0adf[_0x38af04];return _0x47803c;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf0ad('0xa')]=function(_0x53221f,_0x2eca0e){return _0x53221f[_0xf0ad('0xb')](_0xf0ad('0xc'),attributes,{'tableName':_0xf0ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x20c35a,_0x7fe10c){_0x20c35a=_0x20c35a-0x0;var _0x5996d2=_0xc6ac[_0x20c35a];return _0x5996d2;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));var integrations=require(_0xcc6a('0xb'));module[_0xcc6a('0xc')]=function(_0x197bd7,_0x5f3887){return _0x197bd7[_0xcc6a('0xd')](_0xcc6a('0xe'),attributes,{'tableName':_0xcc6a('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 5fb41f2..1440394 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x1badb1,_0x375ec6){var _0x260dae=function(_0x2f3bbc){while(--_0x2f3bbc){_0x1badb1['push'](_0x1badb1['shift']());}};_0x260dae(++_0x375ec6);}(_0xafc4,0x69));var _0x4afc=function(_0x4b954e,_0x5e1147){_0x4b954e=_0x4b954e-0x0;var _0x6acb8=_0xafc4[_0x4b954e];return _0x6acb8;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0x4325=['stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x53831c,_0xc302a4){var _0x216076=function(_0x1c384c){while(--_0x1c384c){_0x53831c['push'](_0x53831c['shift']());}};_0x216076(++_0xc302a4);}(_0x4325,0x1da));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('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')]({'raw':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options'][_0x5432('0x1c')]||null:null,'attributes':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'limit':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options']['limit']||null:null,'include':_0x32fe60['options']?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x32fe60[_0x5432('0x1a')]['include'],function(_0x4af5f4){return{'model':db[_0x4af5f4[_0x5432('0x20')]],'as':_0x4af5f4['as'],'attributes':_0x4af5f4[_0x5432('0x1d')],'include':_0x4af5f4['include']?_[_0x5432('0x1f')](_0x4af5f4[_0x5432('0x1e')],function(_0x637582){return{'model':db[_0x637582['model']],'as':_0x637582['as'],'attributes':_0x637582[_0x5432('0x1d')],'include':_0x637582[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x637582['include'],function(_0x4ab09d){return{'model':db[_0x4ab09d[_0x5432('0x20')]],'as':_0x4ab09d['as'],'attributes':_0x4ab09d[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1abe73){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug'](_0x5432('0x17'),_0x32fe60,JSON['stringify'](_0x1abe73));_0x5f011f(_0x1abe73);})['catch'](function(_0x6fc7f5){logger['error'](_0x5432('0x17'),_0x6fc7f5['message'],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x6fc7f5[_0x5432('0x13')]));});});};exports[_0x5432('0x21')]=function(_0x345b51){var _0x4e92d5=this;return new Promise(function(_0x31490c,_0x1d436c){return db[_0x5432('0x18')][_0x5432('0x22')]({'raw':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')]['where']||null:null,'attributes':_0x345b51['options']?_0x345b51[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'include':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1e')]?_['map'](_0x345b51[_0x5432('0x1a')]['include'],function(_0x2955e0){return{'model':db[_0x2955e0[_0x5432('0x20')]],'as':_0x2955e0['as'],'attributes':_0x2955e0[_0x5432('0x1d')],'include':_0x2955e0[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x2955e0[_0x5432('0x1e')],function(_0x5c3c77){return{'model':db[_0x5c3c77[_0x5432('0x20')]],'as':_0x5c3c77['as'],'attributes':_0x5c3c77[_0x5432('0x1d')],'include':_0x5c3c77[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x5c3c77['include'],function(_0xe01f4b){return{'model':db[_0xe01f4b[_0x5432('0x20')]],'as':_0xe01f4b['as'],'attributes':_0xe01f4b[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5432('0xb')](function(_0x3fb586){logger[_0x5432('0x14')](_0x5432('0x21'),_0x345b51);logger[_0x5432('0xd')](_0x5432('0x21'),_0x345b51,JSON[_0x5432('0x10')](_0x3fb586));_0x31490c(_0x3fb586);})[_0x5432('0x16')](function(_0x1f4679){logger[_0x5432('0x12')](_0x5432('0x21'),_0x1f4679['message'],_0x345b51);_0x1d436c(_0x4e92d5[_0x5432('0x12')](0x1f4,_0x1f4679['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index caa6c09..3a51ebc 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe98f=['./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','/:id/fields','getFields','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xe98f,0x6e));var _0xfe98=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe98f[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xfe98('0x0'));var util=require(_0xfe98('0x1'));var path=require(_0xfe98('0x2'));var timeout=require(_0xfe98('0x3'));var express=require(_0xfe98('0x4'));var router=express[_0xfe98('0x5')]();var fs_extra=require(_0xfe98('0x6'));var auth=require(_0xfe98('0x7'));var interaction=require(_0xfe98('0x8'));var config=require(_0xfe98('0x9'));var controller=require(_0xfe98('0xa'));router[_0xfe98('0xb')]('/',auth[_0xfe98('0xc')](),controller[_0xfe98('0xd')]);router['get'](_0xfe98('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xfe98('0xb')](_0xfe98('0xf'),auth[_0xfe98('0xc')](),controller['getSubjects']);router[_0xfe98('0xb')](_0xfe98('0x10'),auth[_0xfe98('0xc')](),controller['getDescriptions']);router[_0xfe98('0xb')](_0xfe98('0x11'),auth['isAuthenticated'](),controller[_0xfe98('0x12')]);router['post']('/',auth[_0xfe98('0xc')](),controller[_0xfe98('0x13')]);router['put'](_0xfe98('0xe'),auth[_0xfe98('0xc')](),controller[_0xfe98('0x14')]);router[_0xfe98('0x15')](_0xfe98('0xe'),auth[_0xfe98('0xc')](),controller[_0xfe98('0x16')]);module[_0xfe98('0x17')]=router; \ No newline at end of file +var _0xef5c=['../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10b217,_0x1ed159){var _0x1727b7=function(_0x2b0ec9){while(--_0x2b0ec9){_0x10b217['push'](_0x10b217['shift']());}};_0x1727b7(++_0x1ed159);}(_0xef5c,0x196));var _0xcef5=function(_0x4d2fe8,_0x5ce287){_0x4d2fe8=_0x4d2fe8-0x0;var _0xf49f8c=_0xef5c[_0x4d2fe8];return _0xf49f8c;};'use strict';var multer=require(_0xcef5('0x0'));var util=require(_0xcef5('0x1'));var path=require(_0xcef5('0x2'));var timeout=require(_0xcef5('0x3'));var express=require(_0xcef5('0x4'));var router=express[_0xcef5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcef5('0x6'));var interaction=require(_0xcef5('0x7'));var config=require(_0xcef5('0x8'));var controller=require(_0xcef5('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcef5('0xa')]('/:id',auth[_0xcef5('0xb')](),controller[_0xcef5('0xc')]);router['get'](_0xcef5('0xd'),auth['isAuthenticated'](),controller[_0xcef5('0xe')]);router['get'](_0xcef5('0xf'),auth[_0xcef5('0xb')](),controller['getDescriptions']);router[_0xcef5('0xa')](_0xcef5('0x10'),auth[_0xcef5('0xb')](),controller[_0xcef5('0x11')]);router[_0xcef5('0x12')]('/',auth[_0xcef5('0xb')](),controller['create']);router[_0xcef5('0x13')]('/:id',auth[_0xcef5('0xb')](),controller['update']);router[_0xcef5('0x14')](_0xcef5('0x15'),auth[_0xcef5('0xb')](),controller[_0xcef5('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index bf251fb..4a25fba 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x964b=['exports'];(function(_0x536068,_0x3de52c){var _0x4a5db2=function(_0x1a8091){while(--_0x1a8091){_0x536068['push'](_0x536068['shift']());}};_0x4a5db2(++_0x3de52c);}(_0x964b,0x1c7));var _0xb964=function(_0x401484,_0x2b2e87){_0x401484=_0x401484-0x0;var _0x3dfda5=_0x964b[_0x401484];return _0x3dfda5;};'use strict';var Sequelize=require('sequelize');module[_0xb964('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1c1=['STRING','sequelize','exports'];(function(_0x5d2072,_0x1c4d0b){var _0xe33ec6=function(_0x1858e8){while(--_0x1858e8){_0x5d2072['push'](_0x5d2072['shift']());}};_0xe33ec6(++_0x1c4d0b);}(_0xd1c1,0x157));var _0x1d1c=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xd1c1[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require(_0x1d1c('0x0'));module[_0x1d1c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1d1c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 020d0cc..e719386 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9950=['model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','getSubjects','FreshsalesField','length','hasOwnProperty','findOne','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','index','FreshsalesConfiguration','fieldName','type','key'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9950,0xc0));var _0x0995=function(_0x4c14b1,_0x2dfa29){_0x4c14b1=_0x4c14b1-0x0;var _0x5cf8b7=_0x9950[_0x4c14b1];return _0x5cf8b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0995('0x0'));var zipdir=require(_0x0995('0x1'));var jsonpatch=require(_0x0995('0x2'));var rp=require(_0x0995('0x3'));var moment=require(_0x0995('0x4'));var BPromise=require(_0x0995('0x5'));var Mustache=require('mustache');var util=require(_0x0995('0x6'));var path=require(_0x0995('0x7'));var sox=require(_0x0995('0x8'));var csv=require(_0x0995('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0995('0xa'));var _=require(_0x0995('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0995('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0995('0x9'));var querystring=require(_0x0995('0xd'));var Papa=require(_0x0995('0xe'));var Redis=require(_0x0995('0xf'));var authService=require(_0x0995('0x10'));var qs=require(_0x0995('0x11'));var as=require(_0x0995('0x12'));var hardwareService=require(_0x0995('0x13'));var logger=require(_0x0995('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0995('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0995('0x16'))['db'];function respondWithStatusCode(_0x58f387,_0x4181ee){_0x4181ee=_0x4181ee||0xcc;return function(_0x4b821f){if(_0x4b821f){return _0x58f387[_0x0995('0x17')](_0x4181ee);}return _0x58f387['status'](_0x4181ee)[_0x0995('0x18')]();};}function respondWithResult(_0x506c0d,_0x108252){_0x108252=_0x108252||0xc8;return function(_0x3539d0){if(_0x3539d0){return _0x506c0d[_0x0995('0x19')](_0x108252)[_0x0995('0x1a')](_0x3539d0);}};}function respondWithFilteredResult(_0x2dd424,_0x339b50){return function(_0x29c59e){if(_0x29c59e){var _0x5949f0=typeof _0x339b50['offset']==='undefined'&&typeof _0x339b50[_0x0995('0x1b')]===_0x0995('0x1c');var _0x1067d4=_0x29c59e[_0x0995('0x1d')];var _0x458cdc=_0x5949f0?0x0:_0x339b50['offset'];var _0x271f8c=_0x5949f0?_0x29c59e['count']:_0x339b50[_0x0995('0x1e')]+_0x339b50['limit'];var _0x4e18ba;if(_0x271f8c>=_0x1067d4){_0x271f8c=_0x1067d4;_0x4e18ba=0xc8;}else{_0x4e18ba=0xce;}_0x2dd424[_0x0995('0x19')](_0x4e18ba);return _0x2dd424[_0x0995('0x1f')]('Content-Range',_0x458cdc+'-'+_0x271f8c+'/'+_0x1067d4)[_0x0995('0x1a')](_0x29c59e);}return null;};}function patchUpdates(_0x4683b2){return function(_0x14b1a1){try{jsonpatch[_0x0995('0x20')](_0x14b1a1,_0x4683b2,!![]);}catch(_0x2f74e1){return BPromise[_0x0995('0x21')](_0x2f74e1);}return _0x14b1a1[_0x0995('0x22')]();};}function saveUpdates(_0xc71cbe,_0x5c0840){return function(_0x5e4d8e){if(_0x5e4d8e){return _0x5e4d8e[_0x0995('0x23')](_0xc71cbe)[_0x0995('0x24')](function(_0xa0097c){return _0xa0097c;});}return null;};}function removeEntity(_0x24d964,_0x4929b4){return function(_0x1a287d){if(_0x1a287d){return _0x1a287d['destroy']()[_0x0995('0x24')](function(){_0x24d964[_0x0995('0x19')](0xcc)[_0x0995('0x18')]();});}};}function handleEntityNotFound(_0x41d1c1,_0x384d2a){return function(_0x489d7f){if(!_0x489d7f){_0x41d1c1[_0x0995('0x17')](0x194);}return _0x489d7f;};}function handleError(_0x3b8627,_0x2bdf3c){_0x2bdf3c=_0x2bdf3c||0x1f4;return function(_0x14ddca){logger[_0x0995('0x25')](_0x14ddca[_0x0995('0x26')]);if(_0x14ddca[_0x0995('0x27')]){delete _0x14ddca[_0x0995('0x27')];}_0x3b8627[_0x0995('0x19')](_0x2bdf3c)['send'](_0x14ddca);};}exports[_0x0995('0x28')]=function(_0x51b1a8,_0x1fd14e){var _0x420c86={},_0x3757f8={},_0x7beae2={'count':0x0,'rows':[]};var _0x29ebe6=_['map'](db[_0x0995('0x29')]['rawAttributes'],function(_0x2827d5){return{'name':_0x2827d5[_0x0995('0x2a')],'type':_0x2827d5[_0x0995('0x2b')][_0x0995('0x2c')]};});_0x3757f8[_0x0995('0x2d')]=_[_0x0995('0x2e')](_0x29ebe6,_0x0995('0x27'));_0x3757f8[_0x0995('0x2f')]=_[_0x0995('0x30')](_0x51b1a8[_0x0995('0x2f')]);_0x3757f8[_0x0995('0x31')]=_[_0x0995('0x32')](_0x3757f8[_0x0995('0x2d')],_0x3757f8['query']);_0x420c86[_0x0995('0x33')]=_[_0x0995('0x32')](_0x3757f8['model'],qs[_0x0995('0x34')](_0x51b1a8[_0x0995('0x2f')][_0x0995('0x34')]));_0x420c86[_0x0995('0x33')]=_0x420c86[_0x0995('0x33')]['length']?_0x420c86[_0x0995('0x33')]:_0x3757f8[_0x0995('0x2d')];if(!_0x51b1a8['query']['hasOwnProperty'](_0x0995('0x35'))){_0x420c86[_0x0995('0x1b')]=qs[_0x0995('0x1b')](_0x51b1a8[_0x0995('0x2f')][_0x0995('0x1b')]);_0x420c86[_0x0995('0x1e')]=qs['offset'](_0x51b1a8[_0x0995('0x2f')][_0x0995('0x1e')]);}_0x420c86[_0x0995('0x36')]=qs[_0x0995('0x37')](_0x51b1a8[_0x0995('0x2f')][_0x0995('0x37')]);_0x420c86['where']=qs[_0x0995('0x31')](_[_0x0995('0x38')](_0x51b1a8[_0x0995('0x2f')],_0x3757f8[_0x0995('0x31')]),_0x29ebe6);if(_0x51b1a8[_0x0995('0x2f')][_0x0995('0x39')]){_0x420c86[_0x0995('0x3a')]=_['merge'](_0x420c86[_0x0995('0x3a')],{'$or':_[_0x0995('0x2e')](_0x29ebe6,function(_0x5c58b7){if(_0x5c58b7[_0x0995('0x2b')]!==_0x0995('0x3b')){var _0x471006={};_0x471006[_0x5c58b7['name']]={'$like':'%'+_0x51b1a8[_0x0995('0x2f')]['filter']+'%'};return _0x471006;}})});}_0x420c86=_[_0x0995('0x3c')]({},_0x420c86,_0x51b1a8['options']);var _0x1b2afd={'where':_0x420c86['where']};return db[_0x0995('0x29')]['count'](_0x1b2afd)[_0x0995('0x24')](function(_0x3b6a0a){_0x7beae2['count']=_0x3b6a0a;if(_0x51b1a8[_0x0995('0x2f')][_0x0995('0x3d')]){_0x420c86[_0x0995('0x3e')]=[{'all':!![]}];}return db[_0x0995('0x29')][_0x0995('0x3f')](_0x420c86);})[_0x0995('0x24')](function(_0x409a6c){_0x7beae2[_0x0995('0x40')]=_0x409a6c;return _0x7beae2;})[_0x0995('0x24')](respondWithFilteredResult(_0x1fd14e,_0x420c86))[_0x0995('0x41')](handleError(_0x1fd14e,null));};exports['show']=function(_0x55bb32,_0x2746b7){var _0x2d1fa6={'raw':![],'where':{'id':_0x55bb32[_0x0995('0x42')]['id']}},_0x182054={};_0x182054[_0x0995('0x2d')]=_[_0x0995('0x30')](db[_0x0995('0x29')][_0x0995('0x43')]);_0x182054['query']=_[_0x0995('0x30')](_0x55bb32['query']);_0x182054[_0x0995('0x31')]=_[_0x0995('0x32')](_0x182054['model'],_0x182054[_0x0995('0x2f')]);_0x2d1fa6['attributes']=_[_0x0995('0x32')](_0x182054['model'],qs['fields'](_0x55bb32['query'][_0x0995('0x34')]));_0x2d1fa6[_0x0995('0x33')]=_0x2d1fa6[_0x0995('0x33')]['length']?_0x2d1fa6[_0x0995('0x33')]:_0x182054['model'];if(_0x55bb32[_0x0995('0x2f')][_0x0995('0x3d')]){_0x2d1fa6[_0x0995('0x3e')]=[{'all':!![]}];}_0x2d1fa6=_['merge']({},_0x2d1fa6,_0x55bb32[_0x0995('0x44')]);return db[_0x0995('0x29')][_0x0995('0x45')](_0x2d1fa6)[_0x0995('0x24')](handleEntityNotFound(_0x2746b7,null))['then'](respondWithResult(_0x2746b7,null))['catch'](handleError(_0x2746b7,null));};exports[_0x0995('0x46')]=function(_0x30717b,_0x207f9b){return db[_0x0995('0x29')]['create'](_0x30717b[_0x0995('0x47')],{})[_0x0995('0x24')](respondWithResult(_0x207f9b,0xc9))[_0x0995('0x41')](handleError(_0x207f9b,null));};exports['update']=function(_0x430424,_0x5a181a){if(_0x430424['body']['id']){delete _0x430424[_0x0995('0x47')]['id'];}return db['FreshsalesConfiguration'][_0x0995('0x45')]({'where':{'id':_0x430424['params']['id']}})[_0x0995('0x24')](handleEntityNotFound(_0x5a181a,null))[_0x0995('0x24')](saveUpdates(_0x430424[_0x0995('0x47')],null))[_0x0995('0x24')](respondWithResult(_0x5a181a,null))[_0x0995('0x41')](handleError(_0x5a181a,null));};exports['destroy']=function(_0xafb1b2,_0x3a9940){return db[_0x0995('0x29')][_0x0995('0x45')]({'where':{'id':_0xafb1b2[_0x0995('0x42')]['id']}})[_0x0995('0x24')](handleEntityNotFound(_0x3a9940,null))[_0x0995('0x24')](removeEntity(_0x3a9940,null))[_0x0995('0x41')](handleError(_0x3a9940,null));};exports[_0x0995('0x48')]=function(_0x85b6c1,_0x4c3504,_0x2ca61e){var _0x13d106={};var _0xd04c6a={};var _0x7482f2;var _0x464afa;return db[_0x0995('0x29')]['findOne']({'where':{'id':_0x85b6c1[_0x0995('0x42')]['id']}})[_0x0995('0x24')](handleEntityNotFound(_0x4c3504,null))[_0x0995('0x24')](function(_0xcc1381){if(_0xcc1381){_0x7482f2=_0xcc1381;_0xd04c6a[_0x0995('0x2d')]=_['keys'](db[_0x0995('0x49')][_0x0995('0x43')]);_0xd04c6a[_0x0995('0x2f')]=_[_0x0995('0x30')](_0x85b6c1['query']);_0xd04c6a['filters']=_[_0x0995('0x32')](_0xd04c6a[_0x0995('0x2d')],_0xd04c6a['query']);_0x13d106[_0x0995('0x33')]=_[_0x0995('0x32')](_0xd04c6a['model'],qs[_0x0995('0x34')](_0x85b6c1[_0x0995('0x2f')][_0x0995('0x34')]));_0x13d106['attributes']=_0x13d106[_0x0995('0x33')][_0x0995('0x4a')]?_0x13d106[_0x0995('0x33')]:_0xd04c6a[_0x0995('0x2d')];_0x13d106['order']=qs['sort'](_0x85b6c1[_0x0995('0x2f')][_0x0995('0x37')]);_0x13d106['where']=qs[_0x0995('0x31')](_['pick'](_0x85b6c1[_0x0995('0x2f')],_0xd04c6a[_0x0995('0x31')]));if(_0x85b6c1[_0x0995('0x2f')]['filter']){_0x13d106[_0x0995('0x3a')]=_[_0x0995('0x3c')](_0x13d106[_0x0995('0x3a')],{'$or':_[_0x0995('0x2e')](_0x13d106[_0x0995('0x33')],function(_0x388758){var _0x3c2e36={};_0x3c2e36[_0x388758]={'$like':'%'+_0x85b6c1[_0x0995('0x2f')][_0x0995('0x39')]+'%'};return _0x3c2e36;})});}_0x13d106=_[_0x0995('0x3c')]({},_0x13d106,_0x85b6c1['options']);return _0x7482f2['getSubjects'](_0x13d106);}})['then'](function(_0x249d5c){if(_0x249d5c){_0x464afa=_0x249d5c[_0x0995('0x4a')];if(!_0x85b6c1[_0x0995('0x2f')][_0x0995('0x4b')](_0x0995('0x35'))){_0x13d106[_0x0995('0x1b')]=qs[_0x0995('0x1b')](_0x85b6c1[_0x0995('0x2f')][_0x0995('0x1b')]);_0x13d106[_0x0995('0x1e')]=qs[_0x0995('0x1e')](_0x85b6c1[_0x0995('0x2f')][_0x0995('0x1e')]);}return _0x7482f2[_0x0995('0x48')](_0x13d106);}})[_0x0995('0x24')](function(_0x5bcccf){if(_0x5bcccf){return _0x5bcccf?{'count':_0x464afa,'rows':_0x5bcccf}:null;}})['then'](respondWithResult(_0x4c3504,null))['catch'](handleError(_0x4c3504,null));};exports['getDescriptions']=function(_0x30e40d,_0x372a43,_0x42b8ac){var _0x195d95={};var _0x261fe0={};var _0x1c3e85;var _0xfd3342;return db[_0x0995('0x29')][_0x0995('0x4c')]({'where':{'id':_0x30e40d[_0x0995('0x42')]['id']}})['then'](handleEntityNotFound(_0x372a43,null))[_0x0995('0x24')](function(_0x205aa8){if(_0x205aa8){_0x1c3e85=_0x205aa8;_0x261fe0['model']=_[_0x0995('0x30')](db[_0x0995('0x49')]['rawAttributes']);_0x261fe0['query']=_['keys'](_0x30e40d[_0x0995('0x2f')]);_0x261fe0['filters']=_[_0x0995('0x32')](_0x261fe0['model'],_0x261fe0[_0x0995('0x2f')]);_0x195d95[_0x0995('0x33')]=_[_0x0995('0x32')](_0x261fe0[_0x0995('0x2d')],qs['fields'](_0x30e40d[_0x0995('0x2f')][_0x0995('0x34')]));_0x195d95[_0x0995('0x33')]=_0x195d95[_0x0995('0x33')][_0x0995('0x4a')]?_0x195d95[_0x0995('0x33')]:_0x261fe0[_0x0995('0x2d')];_0x195d95[_0x0995('0x36')]=qs['sort'](_0x30e40d['query'][_0x0995('0x37')]);_0x195d95['where']=qs[_0x0995('0x31')](_[_0x0995('0x38')](_0x30e40d[_0x0995('0x2f')],_0x261fe0[_0x0995('0x31')]));if(_0x30e40d['query']['filter']){_0x195d95[_0x0995('0x3a')]=_[_0x0995('0x3c')](_0x195d95[_0x0995('0x3a')],{'$or':_['map'](_0x195d95[_0x0995('0x33')],function(_0x17ab1c){var _0xb45dfd={};_0xb45dfd[_0x17ab1c]={'$like':'%'+_0x30e40d['query']['filter']+'%'};return _0xb45dfd;})});}_0x195d95=_[_0x0995('0x3c')]({},_0x195d95,_0x30e40d[_0x0995('0x44')]);return _0x1c3e85['getDescriptions'](_0x195d95);}})[_0x0995('0x24')](function(_0x5d20ff){if(_0x5d20ff){_0xfd3342=_0x5d20ff[_0x0995('0x4a')];if(!_0x30e40d[_0x0995('0x2f')][_0x0995('0x4b')](_0x0995('0x35'))){_0x195d95[_0x0995('0x1b')]=qs['limit'](_0x30e40d[_0x0995('0x2f')][_0x0995('0x1b')]);_0x195d95[_0x0995('0x1e')]=qs[_0x0995('0x1e')](_0x30e40d[_0x0995('0x2f')][_0x0995('0x1e')]);}return _0x1c3e85[_0x0995('0x4d')](_0x195d95);}})[_0x0995('0x24')](function(_0x5b663b){if(_0x5b663b){return _0x5b663b?{'count':_0xfd3342,'rows':_0x5b663b}:null;}})[_0x0995('0x24')](respondWithResult(_0x372a43,null))[_0x0995('0x41')](handleError(_0x372a43,null));};exports['getFields']=function(_0x1b6fdb,_0x67dad,_0x1030c4){var _0x287f8a={};var _0x1a0e0a={};var _0x5d6164;var _0x599763;return db[_0x0995('0x29')][_0x0995('0x4c')]({'where':{'id':_0x1b6fdb[_0x0995('0x42')]['id']}})[_0x0995('0x24')](handleEntityNotFound(_0x67dad,null))[_0x0995('0x24')](function(_0x235270){if(_0x235270){_0x5d6164=_0x235270;_0x1a0e0a[_0x0995('0x2d')]=_['keys'](db[_0x0995('0x49')][_0x0995('0x43')]);_0x1a0e0a[_0x0995('0x2f')]=_[_0x0995('0x30')](_0x1b6fdb['query']);_0x1a0e0a['filters']=_[_0x0995('0x32')](_0x1a0e0a['model'],_0x1a0e0a['query']);_0x287f8a[_0x0995('0x33')]=_['intersection'](_0x1a0e0a['model'],qs[_0x0995('0x34')](_0x1b6fdb[_0x0995('0x2f')][_0x0995('0x34')]));_0x287f8a[_0x0995('0x33')]=_0x287f8a[_0x0995('0x33')][_0x0995('0x4a')]?_0x287f8a[_0x0995('0x33')]:_0x1a0e0a[_0x0995('0x2d')];_0x287f8a[_0x0995('0x36')]=qs[_0x0995('0x37')](_0x1b6fdb['query'][_0x0995('0x37')]);_0x287f8a[_0x0995('0x3a')]=qs[_0x0995('0x31')](_[_0x0995('0x38')](_0x1b6fdb['query'],_0x1a0e0a[_0x0995('0x31')]));if(_0x1b6fdb[_0x0995('0x2f')][_0x0995('0x39')]){_0x287f8a[_0x0995('0x3a')]=_['merge'](_0x287f8a[_0x0995('0x3a')],{'$or':_[_0x0995('0x2e')](_0x287f8a[_0x0995('0x33')],function(_0x5776ae){var _0x386b22={};_0x386b22[_0x5776ae]={'$like':'%'+_0x1b6fdb[_0x0995('0x2f')][_0x0995('0x39')]+'%'};return _0x386b22;})});}_0x287f8a=_[_0x0995('0x3c')]({},_0x287f8a,_0x1b6fdb[_0x0995('0x44')]);return _0x5d6164['getFields'](_0x287f8a);}})['then'](function(_0x27660d){if(_0x27660d){_0x599763=_0x27660d['length'];if(!_0x1b6fdb[_0x0995('0x2f')][_0x0995('0x4b')](_0x0995('0x35'))){_0x287f8a['limit']=qs[_0x0995('0x1b')](_0x1b6fdb['query'][_0x0995('0x1b')]);_0x287f8a[_0x0995('0x1e')]=qs[_0x0995('0x1e')](_0x1b6fdb[_0x0995('0x2f')][_0x0995('0x1e')]);}return _0x5d6164[_0x0995('0x4e')](_0x287f8a);}})[_0x0995('0x24')](function(_0x57b5bc){if(_0x57b5bc){return _0x57b5bc?{'count':_0x599763,'rows':_0x57b5bc}:null;}})[_0x0995('0x24')](respondWithResult(_0x67dad,null))['catch'](handleError(_0x67dad,null));}; \ No newline at end of file +var _0x7e1d=['request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4e463a,_0x49e85f){var _0x458df0=function(_0x2328ed){while(--_0x2328ed){_0x4e463a['push'](_0x4e463a['shift']());}};_0x458df0(++_0x49e85f);}(_0x7e1d,0x138));var _0xd7e1=function(_0xfc4058,_0xc35d9d){_0xfc4058=_0xfc4058-0x0;var _0x237f58=_0x7e1d[_0xfc4058];return _0x237f58;};'use strict';var emlformat=require(_0xd7e1('0x0'));var rimraf=require(_0xd7e1('0x1'));var zipdir=require(_0xd7e1('0x2'));var jsonpatch=require(_0xd7e1('0x3'));var rp=require(_0xd7e1('0x4'));var moment=require(_0xd7e1('0x5'));var BPromise=require(_0xd7e1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd7e1('0x7'));var sox=require('sox');var csv=require(_0xd7e1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7e1('0x9'));var _=require(_0xd7e1('0xa'));var squel=require(_0xd7e1('0xb'));var crypto=require('crypto');var jsforce=require(_0xd7e1('0xc'));var deskjs=require(_0xd7e1('0xd'));var toCsv=require(_0xd7e1('0x8'));var querystring=require(_0xd7e1('0xe'));var Papa=require(_0xd7e1('0xf'));var Redis=require(_0xd7e1('0x10'));var authService=require(_0xd7e1('0x11'));var qs=require(_0xd7e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7e1('0x13'));var logger=require(_0xd7e1('0x14'))('api');var utils=require(_0xd7e1('0x15'));var config=require(_0xd7e1('0x16'));var licenseUtil=require(_0xd7e1('0x17'));var db=require(_0xd7e1('0x18'))['db'];function respondWithStatusCode(_0x5356a8,_0x718ca1){_0x718ca1=_0x718ca1||0xcc;return function(_0x5f4e68){if(_0x5f4e68){return _0x5356a8[_0xd7e1('0x19')](_0x718ca1);}return _0x5356a8[_0xd7e1('0x1a')](_0x718ca1)[_0xd7e1('0x1b')]();};}function respondWithResult(_0x579850,_0x41b929){_0x41b929=_0x41b929||0xc8;return function(_0x4fc478){if(_0x4fc478){return _0x579850[_0xd7e1('0x1a')](_0x41b929)[_0xd7e1('0x1c')](_0x4fc478);}};}function respondWithFilteredResult(_0x4d3b4c,_0x3d72f9){return function(_0x1c4fbe){if(_0x1c4fbe){var _0xd3d722=typeof _0x3d72f9['offset']==='undefined'&&typeof _0x3d72f9['limit']===_0xd7e1('0x1d');var _0x285081=_0x1c4fbe['count'];var _0x5d4ae3=_0xd3d722?0x0:_0x3d72f9[_0xd7e1('0x1e')];var _0x70f011=_0xd3d722?_0x1c4fbe[_0xd7e1('0x1f')]:_0x3d72f9[_0xd7e1('0x1e')]+_0x3d72f9[_0xd7e1('0x20')];var _0x5919dc;if(_0x70f011>=_0x285081){_0x70f011=_0x285081;_0x5919dc=0xc8;}else{_0x5919dc=0xce;}_0x4d3b4c[_0xd7e1('0x1a')](_0x5919dc);return _0x4d3b4c[_0xd7e1('0x21')](_0xd7e1('0x22'),_0x5d4ae3+'-'+_0x70f011+'/'+_0x285081)[_0xd7e1('0x1c')](_0x1c4fbe);}return null;};}function patchUpdates(_0x2e3b77){return function(_0x15a768){try{jsonpatch['apply'](_0x15a768,_0x2e3b77,!![]);}catch(_0x3140b0){return BPromise['reject'](_0x3140b0);}return _0x15a768['save']();};}function saveUpdates(_0x3810ac,_0x42d867){return function(_0x5c7142){if(_0x5c7142){return _0x5c7142[_0xd7e1('0x23')](_0x3810ac)[_0xd7e1('0x24')](function(_0xd0333b){return _0xd0333b;});}return null;};}function removeEntity(_0xc261bf,_0x10071b){return function(_0x25b833){if(_0x25b833){return _0x25b833[_0xd7e1('0x25')]()[_0xd7e1('0x24')](function(){_0xc261bf['status'](0xcc)[_0xd7e1('0x1b')]();});}};}function handleEntityNotFound(_0x72da72,_0x389a83){return function(_0x2f0976){if(!_0x2f0976){_0x72da72[_0xd7e1('0x19')](0x194);}return _0x2f0976;};}function handleError(_0x576c84,_0x49cdec){_0x49cdec=_0x49cdec||0x1f4;return function(_0x14a0c3){logger['error'](_0x14a0c3[_0xd7e1('0x26')]);if(_0x14a0c3[_0xd7e1('0x27')]){delete _0x14a0c3[_0xd7e1('0x27')];}_0x576c84[_0xd7e1('0x1a')](_0x49cdec)[_0xd7e1('0x28')](_0x14a0c3);};}exports[_0xd7e1('0x29')]=function(_0x4f54cf,_0x541ee4){var _0x174257={},_0x148e2b={},_0x14ae7b={'count':0x0,'rows':[]};var _0x28d52e=_['map'](db[_0xd7e1('0x2a')][_0xd7e1('0x2b')],function(_0x13700c){return{'name':_0x13700c[_0xd7e1('0x2c')],'type':_0x13700c[_0xd7e1('0x2d')][_0xd7e1('0x2e')]};});_0x148e2b[_0xd7e1('0x2f')]=_[_0xd7e1('0x30')](_0x28d52e,_0xd7e1('0x27'));_0x148e2b[_0xd7e1('0x31')]=_[_0xd7e1('0x32')](_0x4f54cf[_0xd7e1('0x31')]);_0x148e2b[_0xd7e1('0x33')]=_[_0xd7e1('0x34')](_0x148e2b['model'],_0x148e2b[_0xd7e1('0x31')]);_0x174257[_0xd7e1('0x35')]=_[_0xd7e1('0x34')](_0x148e2b[_0xd7e1('0x2f')],qs[_0xd7e1('0x36')](_0x4f54cf[_0xd7e1('0x31')]['fields']));_0x174257[_0xd7e1('0x35')]=_0x174257['attributes'][_0xd7e1('0x37')]?_0x174257['attributes']:_0x148e2b['model'];if(!_0x4f54cf['query'][_0xd7e1('0x38')](_0xd7e1('0x39'))){_0x174257[_0xd7e1('0x20')]=qs['limit'](_0x4f54cf[_0xd7e1('0x31')][_0xd7e1('0x20')]);_0x174257[_0xd7e1('0x1e')]=qs[_0xd7e1('0x1e')](_0x4f54cf['query'][_0xd7e1('0x1e')]);}_0x174257[_0xd7e1('0x3a')]=qs[_0xd7e1('0x3b')](_0x4f54cf[_0xd7e1('0x31')][_0xd7e1('0x3b')]);_0x174257[_0xd7e1('0x3c')]=qs[_0xd7e1('0x33')](_[_0xd7e1('0x3d')](_0x4f54cf['query'],_0x148e2b[_0xd7e1('0x33')]),_0x28d52e);if(_0x4f54cf[_0xd7e1('0x31')][_0xd7e1('0x3e')]){_0x174257[_0xd7e1('0x3c')]=_[_0xd7e1('0x3f')](_0x174257[_0xd7e1('0x3c')],{'$or':_[_0xd7e1('0x30')](_0x28d52e,function(_0x35ca00){if(_0x35ca00[_0xd7e1('0x2d')]!=='VIRTUAL'){var _0x3a87bb={};_0x3a87bb[_0x35ca00[_0xd7e1('0x27')]]={'$like':'%'+_0x4f54cf['query'][_0xd7e1('0x3e')]+'%'};return _0x3a87bb;}})});}_0x174257=_['merge']({},_0x174257,_0x4f54cf[_0xd7e1('0x40')]);var _0x1e3d1f={'where':_0x174257[_0xd7e1('0x3c')]};return db['FreshsalesConfiguration']['count'](_0x1e3d1f)['then'](function(_0x2fcb54){_0x14ae7b[_0xd7e1('0x1f')]=_0x2fcb54;if(_0x4f54cf[_0xd7e1('0x31')]['includeAll']){_0x174257['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xd7e1('0x41')](_0x174257);})['then'](function(_0x2700e5){_0x14ae7b[_0xd7e1('0x42')]=_0x2700e5;return _0x14ae7b;})[_0xd7e1('0x24')](respondWithFilteredResult(_0x541ee4,_0x174257))[_0xd7e1('0x43')](handleError(_0x541ee4,null));};exports[_0xd7e1('0x44')]=function(_0x2c86b7,_0x3537cd){var _0x49f82e={'raw':![],'where':{'id':_0x2c86b7[_0xd7e1('0x45')]['id']}},_0xd0279e={};_0xd0279e[_0xd7e1('0x2f')]=_[_0xd7e1('0x32')](db[_0xd7e1('0x2a')][_0xd7e1('0x2b')]);_0xd0279e[_0xd7e1('0x31')]=_[_0xd7e1('0x32')](_0x2c86b7['query']);_0xd0279e[_0xd7e1('0x33')]=_[_0xd7e1('0x34')](_0xd0279e[_0xd7e1('0x2f')],_0xd0279e[_0xd7e1('0x31')]);_0x49f82e[_0xd7e1('0x35')]=_['intersection'](_0xd0279e[_0xd7e1('0x2f')],qs[_0xd7e1('0x36')](_0x2c86b7[_0xd7e1('0x31')]['fields']));_0x49f82e[_0xd7e1('0x35')]=_0x49f82e[_0xd7e1('0x35')][_0xd7e1('0x37')]?_0x49f82e[_0xd7e1('0x35')]:_0xd0279e['model'];if(_0x2c86b7[_0xd7e1('0x31')][_0xd7e1('0x46')]){_0x49f82e['include']=[{'all':!![]}];}_0x49f82e=_[_0xd7e1('0x3f')]({},_0x49f82e,_0x2c86b7['options']);return db[_0xd7e1('0x2a')][_0xd7e1('0x47')](_0x49f82e)[_0xd7e1('0x24')](handleEntityNotFound(_0x3537cd,null))[_0xd7e1('0x24')](respondWithResult(_0x3537cd,null))['catch'](handleError(_0x3537cd,null));};exports['create']=function(_0x14d265,_0xbe826a){return db[_0xd7e1('0x2a')][_0xd7e1('0x48')](_0x14d265[_0xd7e1('0x49')],{})[_0xd7e1('0x24')](respondWithResult(_0xbe826a,0xc9))[_0xd7e1('0x43')](handleError(_0xbe826a,null));};exports['update']=function(_0x268cbd,_0x1435a9){if(_0x268cbd[_0xd7e1('0x49')]['id']){delete _0x268cbd['body']['id'];}return db[_0xd7e1('0x2a')]['find']({'where':{'id':_0x268cbd[_0xd7e1('0x45')]['id']}})[_0xd7e1('0x24')](handleEntityNotFound(_0x1435a9,null))[_0xd7e1('0x24')](saveUpdates(_0x268cbd[_0xd7e1('0x49')],null))[_0xd7e1('0x24')](respondWithResult(_0x1435a9,null))[_0xd7e1('0x43')](handleError(_0x1435a9,null));};exports[_0xd7e1('0x25')]=function(_0xa2b4b5,_0x5459ef){return db[_0xd7e1('0x2a')][_0xd7e1('0x47')]({'where':{'id':_0xa2b4b5[_0xd7e1('0x45')]['id']}})[_0xd7e1('0x24')](handleEntityNotFound(_0x5459ef,null))[_0xd7e1('0x24')](removeEntity(_0x5459ef,null))['catch'](handleError(_0x5459ef,null));};exports[_0xd7e1('0x4a')]=function(_0x33642d,_0x533f3c,_0x519ab2){var _0x477f6c={};var _0x28f9e={};var _0x26af48;var _0x38c5d2;return db['FreshsalesConfiguration'][_0xd7e1('0x4b')]({'where':{'id':_0x33642d['params']['id']}})[_0xd7e1('0x24')](handleEntityNotFound(_0x533f3c,null))[_0xd7e1('0x24')](function(_0x40529a){if(_0x40529a){_0x26af48=_0x40529a;_0x28f9e[_0xd7e1('0x2f')]=_[_0xd7e1('0x32')](db[_0xd7e1('0x4c')]['rawAttributes']);_0x28f9e[_0xd7e1('0x31')]=_[_0xd7e1('0x32')](_0x33642d['query']);_0x28f9e[_0xd7e1('0x33')]=_['intersection'](_0x28f9e[_0xd7e1('0x2f')],_0x28f9e[_0xd7e1('0x31')]);_0x477f6c[_0xd7e1('0x35')]=_[_0xd7e1('0x34')](_0x28f9e[_0xd7e1('0x2f')],qs['fields'](_0x33642d[_0xd7e1('0x31')]['fields']));_0x477f6c['attributes']=_0x477f6c[_0xd7e1('0x35')]['length']?_0x477f6c[_0xd7e1('0x35')]:_0x28f9e[_0xd7e1('0x2f')];_0x477f6c[_0xd7e1('0x3a')]=qs['sort'](_0x33642d[_0xd7e1('0x31')][_0xd7e1('0x3b')]);_0x477f6c[_0xd7e1('0x3c')]=qs[_0xd7e1('0x33')](_['pick'](_0x33642d[_0xd7e1('0x31')],_0x28f9e['filters']));if(_0x33642d[_0xd7e1('0x31')]['filter']){_0x477f6c[_0xd7e1('0x3c')]=_[_0xd7e1('0x3f')](_0x477f6c[_0xd7e1('0x3c')],{'$or':_[_0xd7e1('0x30')](_0x477f6c[_0xd7e1('0x35')],function(_0x3284e6){var _0x565640={};_0x565640[_0x3284e6]={'$like':'%'+_0x33642d[_0xd7e1('0x31')][_0xd7e1('0x3e')]+'%'};return _0x565640;})});}_0x477f6c=_[_0xd7e1('0x3f')]({},_0x477f6c,_0x33642d[_0xd7e1('0x40')]);return _0x26af48[_0xd7e1('0x4a')](_0x477f6c);}})[_0xd7e1('0x24')](function(_0x5e8bfd){if(_0x5e8bfd){_0x38c5d2=_0x5e8bfd[_0xd7e1('0x37')];if(!_0x33642d[_0xd7e1('0x31')][_0xd7e1('0x38')]('nolimit')){_0x477f6c[_0xd7e1('0x20')]=qs[_0xd7e1('0x20')](_0x33642d[_0xd7e1('0x31')]['limit']);_0x477f6c[_0xd7e1('0x1e')]=qs[_0xd7e1('0x1e')](_0x33642d[_0xd7e1('0x31')][_0xd7e1('0x1e')]);}return _0x26af48[_0xd7e1('0x4a')](_0x477f6c);}})[_0xd7e1('0x24')](function(_0xc13ae8){if(_0xc13ae8){return _0xc13ae8?{'count':_0x38c5d2,'rows':_0xc13ae8}:null;}})[_0xd7e1('0x24')](respondWithResult(_0x533f3c,null))['catch'](handleError(_0x533f3c,null));};exports[_0xd7e1('0x4d')]=function(_0x29f17b,_0x3c80ce,_0x2d62e9){var _0x49b140={};var _0x7692a={};var _0x4125d8;var _0x5be6dc;return db[_0xd7e1('0x2a')][_0xd7e1('0x4b')]({'where':{'id':_0x29f17b[_0xd7e1('0x45')]['id']}})[_0xd7e1('0x24')](handleEntityNotFound(_0x3c80ce,null))[_0xd7e1('0x24')](function(_0x204b7e){if(_0x204b7e){_0x4125d8=_0x204b7e;_0x7692a['model']=_[_0xd7e1('0x32')](db[_0xd7e1('0x4c')][_0xd7e1('0x2b')]);_0x7692a[_0xd7e1('0x31')]=_[_0xd7e1('0x32')](_0x29f17b[_0xd7e1('0x31')]);_0x7692a[_0xd7e1('0x33')]=_[_0xd7e1('0x34')](_0x7692a[_0xd7e1('0x2f')],_0x7692a[_0xd7e1('0x31')]);_0x49b140[_0xd7e1('0x35')]=_[_0xd7e1('0x34')](_0x7692a['model'],qs[_0xd7e1('0x36')](_0x29f17b[_0xd7e1('0x31')]['fields']));_0x49b140[_0xd7e1('0x35')]=_0x49b140[_0xd7e1('0x35')][_0xd7e1('0x37')]?_0x49b140[_0xd7e1('0x35')]:_0x7692a[_0xd7e1('0x2f')];_0x49b140[_0xd7e1('0x3a')]=qs['sort'](_0x29f17b[_0xd7e1('0x31')][_0xd7e1('0x3b')]);_0x49b140[_0xd7e1('0x3c')]=qs[_0xd7e1('0x33')](_[_0xd7e1('0x3d')](_0x29f17b['query'],_0x7692a[_0xd7e1('0x33')]));if(_0x29f17b[_0xd7e1('0x31')][_0xd7e1('0x3e')]){_0x49b140[_0xd7e1('0x3c')]=_[_0xd7e1('0x3f')](_0x49b140[_0xd7e1('0x3c')],{'$or':_[_0xd7e1('0x30')](_0x49b140[_0xd7e1('0x35')],function(_0x4fa479){var _0x36307b={};_0x36307b[_0x4fa479]={'$like':'%'+_0x29f17b['query'][_0xd7e1('0x3e')]+'%'};return _0x36307b;})});}_0x49b140=_['merge']({},_0x49b140,_0x29f17b['options']);return _0x4125d8[_0xd7e1('0x4d')](_0x49b140);}})[_0xd7e1('0x24')](function(_0xffced6){if(_0xffced6){_0x5be6dc=_0xffced6['length'];if(!_0x29f17b['query'][_0xd7e1('0x38')](_0xd7e1('0x39'))){_0x49b140[_0xd7e1('0x20')]=qs[_0xd7e1('0x20')](_0x29f17b[_0xd7e1('0x31')][_0xd7e1('0x20')]);_0x49b140[_0xd7e1('0x1e')]=qs[_0xd7e1('0x1e')](_0x29f17b[_0xd7e1('0x31')][_0xd7e1('0x1e')]);}return _0x4125d8[_0xd7e1('0x4d')](_0x49b140);}})[_0xd7e1('0x24')](function(_0x3f9eb6){if(_0x3f9eb6){return _0x3f9eb6?{'count':_0x5be6dc,'rows':_0x3f9eb6}:null;}})['then'](respondWithResult(_0x3c80ce,null))['catch'](handleError(_0x3c80ce,null));};exports[_0xd7e1('0x4e')]=function(_0x193baa,_0x5bb50f,_0x27b7e8){var _0x460705={};var _0x56992a={};var _0x4faedc;var _0xee33b6;return db[_0xd7e1('0x2a')][_0xd7e1('0x4b')]({'where':{'id':_0x193baa[_0xd7e1('0x45')]['id']}})[_0xd7e1('0x24')](handleEntityNotFound(_0x5bb50f,null))[_0xd7e1('0x24')](function(_0x5e515a){if(_0x5e515a){_0x4faedc=_0x5e515a;_0x56992a[_0xd7e1('0x2f')]=_['keys'](db[_0xd7e1('0x4c')][_0xd7e1('0x2b')]);_0x56992a['query']=_[_0xd7e1('0x32')](_0x193baa[_0xd7e1('0x31')]);_0x56992a['filters']=_[_0xd7e1('0x34')](_0x56992a[_0xd7e1('0x2f')],_0x56992a[_0xd7e1('0x31')]);_0x460705['attributes']=_['intersection'](_0x56992a['model'],qs[_0xd7e1('0x36')](_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x36')]));_0x460705[_0xd7e1('0x35')]=_0x460705[_0xd7e1('0x35')][_0xd7e1('0x37')]?_0x460705[_0xd7e1('0x35')]:_0x56992a[_0xd7e1('0x2f')];_0x460705['order']=qs[_0xd7e1('0x3b')](_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x3b')]);_0x460705[_0xd7e1('0x3c')]=qs[_0xd7e1('0x33')](_['pick'](_0x193baa[_0xd7e1('0x31')],_0x56992a[_0xd7e1('0x33')]));if(_0x193baa['query'][_0xd7e1('0x3e')]){_0x460705[_0xd7e1('0x3c')]=_[_0xd7e1('0x3f')](_0x460705['where'],{'$or':_['map'](_0x460705[_0xd7e1('0x35')],function(_0x1cace2){var _0x211389={};_0x211389[_0x1cace2]={'$like':'%'+_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x3e')]+'%'};return _0x211389;})});}_0x460705=_[_0xd7e1('0x3f')]({},_0x460705,_0x193baa[_0xd7e1('0x40')]);return _0x4faedc[_0xd7e1('0x4e')](_0x460705);}})[_0xd7e1('0x24')](function(_0x46e74f){if(_0x46e74f){_0xee33b6=_0x46e74f[_0xd7e1('0x37')];if(!_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x38')]('nolimit')){_0x460705[_0xd7e1('0x20')]=qs[_0xd7e1('0x20')](_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x20')]);_0x460705[_0xd7e1('0x1e')]=qs[_0xd7e1('0x1e')](_0x193baa[_0xd7e1('0x31')][_0xd7e1('0x1e')]);}return _0x4faedc[_0xd7e1('0x4e')](_0x460705);}})[_0xd7e1('0x24')](function(_0x1d24cc){if(_0x1d24cc){return _0x1d24cc?{'count':_0xee33b6,'rows':_0x1d24cc}:null;}})[_0xd7e1('0x24')](respondWithResult(_0x5bb50f,null))[_0xd7e1('0x43')](handleError(_0x5bb50f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e89b0ba..1441f11 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8337=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x210283,_0x52a720){var _0x4ea2f5=function(_0x59b77d){while(--_0x59b77d){_0x210283['push'](_0x210283['shift']());}};_0x4ea2f5(++_0x52a720);}(_0x8337,0x1d4));var _0x7833=function(_0x33a66e,_0x51f357){_0x33a66e=_0x33a66e-0x0;var _0x4eacb3=_0x8337[_0x33a66e];return _0x4eacb3;};'use strict';var _=require(_0x7833('0x0'));var util=require('util');var logger=require(_0x7833('0x1'))(_0x7833('0x2'));var moment=require(_0x7833('0x3'));var BPromise=require('bluebird');var rp=require(_0x7833('0x4'));var fs=require('fs');var path=require(_0x7833('0x5'));var rimraf=require(_0x7833('0x6'));var config=require(_0x7833('0x7'));var attributes=require(_0x7833('0x8'));module[_0x7833('0x9')]=function(_0x3c7973,_0x9cc354){return _0x3c7973[_0x7833('0xa')](_0x7833('0xb'),attributes,{'tableName':_0x7833('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0452=['util','api','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash'];(function(_0x429156,_0x43d8b0){var _0x269d70=function(_0x23828b){while(--_0x23828b){_0x429156['push'](_0x429156['shift']());}};_0x269d70(++_0x43d8b0);}(_0x0452,0x1ad));var _0x2045=function(_0x18b53e,_0xb0f01f){_0x18b53e=_0x18b53e-0x0;var _0x566788=_0x0452[_0x18b53e];return _0x566788;};'use strict';var _=require(_0x2045('0x0'));var util=require(_0x2045('0x1'));var logger=require('../../config/logger')(_0x2045('0x2'));var moment=require('moment');var BPromise=require(_0x2045('0x3'));var rp=require(_0x2045('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2045('0x5'));var config=require('../../config/environment');var attributes=require(_0x2045('0x6'));module[_0x2045('0x7')]=function(_0x4b16e9,_0x2a34ba){return _0x4b16e9[_0x2045('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x2045('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 810b65a..7f010e0 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c98=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2bf66e,_0xfb08f0){var _0x10179b=function(_0x2da9cb){while(--_0x2da9cb){_0x2bf66e['push'](_0x2bf66e['shift']());}};_0x10179b(++_0xfb08f0);}(_0x9c98,0x1e1));var _0x89c9=function(_0xc516ea,_0x57f6d2){_0xc516ea=_0xc516ea-0x0;var _0xfcf31a=_0x9c98[_0xc516ea];return _0xfcf31a;};'use strict';var _=require(_0x89c9('0x0'));var util=require(_0x89c9('0x1'));var moment=require(_0x89c9('0x2'));var BPromise=require(_0x89c9('0x3'));var rs=require(_0x89c9('0x4'));var fs=require('fs');var Redis=require(_0x89c9('0x5'));var db=require(_0x89c9('0x6'))['db'];var utils=require(_0x89c9('0x7'));var logger=require(_0x89c9('0x8'))('rpc');var config=require(_0x89c9('0x9'));var jayson=require(_0x89c9('0xa'));var client=jayson['client'][_0x89c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8f9a4b,_0x15be8a,_0x8fd1ac){return new BPromise(function(_0x535d96,_0x485df7){return client[_0x89c9('0xc')](_0x8f9a4b,_0x8fd1ac)[_0x89c9('0xd')](function(_0x3c0b95){logger[_0x89c9('0xe')](_0x89c9('0xf'),_0x15be8a,_0x89c9('0x10'));logger['debug'](_0x89c9('0x11'),_0x15be8a,'request\x20sent',JSON[_0x89c9('0x12')](_0x3c0b95));if(_0x3c0b95[_0x89c9('0x13')]){if(_0x3c0b95['error'][_0x89c9('0x14')]===0x1f4){logger[_0x89c9('0x13')](_0x89c9('0xf'),_0x15be8a,_0x3c0b95[_0x89c9('0x13')][_0x89c9('0x15')]);return _0x485df7(_0x3c0b95[_0x89c9('0x13')][_0x89c9('0x15')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x15be8a,_0x3c0b95[_0x89c9('0x13')][_0x89c9('0x15')]);return _0x535d96(_0x3c0b95[_0x89c9('0x13')][_0x89c9('0x15')]);}else{logger[_0x89c9('0xe')](_0x89c9('0xf'),_0x15be8a,'request\x20sent');_0x535d96(_0x3c0b95[_0x89c9('0x16')]['message']);}})[_0x89c9('0x17')](function(_0x58c055){logger['error'](_0x89c9('0xf'),_0x15be8a,_0x58c055);_0x485df7(_0x58c055);});});} \ No newline at end of file +var _0xd524=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50f957,_0x351291){var _0x4fecea=function(_0x118324){while(--_0x118324){_0x50f957['push'](_0x50f957['shift']());}};_0x4fecea(++_0x351291);}(_0xd524,0x160));var _0x4d52=function(_0x6cbd4d,_0x4ad973){_0x6cbd4d=_0x6cbd4d-0x0;var _0x2bd74c=_0xd524[_0x6cbd4d];return _0x2bd74c;};'use strict';var _=require('lodash');var util=require(_0x4d52('0x0'));var moment=require(_0x4d52('0x1'));var BPromise=require(_0x4d52('0x2'));var rs=require(_0x4d52('0x3'));var fs=require('fs');var Redis=require(_0x4d52('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d52('0x5'));var logger=require(_0x4d52('0x6'))(_0x4d52('0x7'));var config=require(_0x4d52('0x8'));var jayson=require(_0x4d52('0x9'));var client=jayson[_0x4d52('0xa')][_0x4d52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e0f78,_0x5da612,_0x47e60d){return new BPromise(function(_0x3afca8,_0x56a93b){return client[_0x4d52('0xc')](_0x5e0f78,_0x47e60d)[_0x4d52('0xd')](function(_0x2e59ff){logger[_0x4d52('0xe')](_0x4d52('0xf'),_0x5da612,_0x4d52('0x10'));logger[_0x4d52('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5da612,_0x4d52('0x10'),JSON[_0x4d52('0x12')](_0x2e59ff));if(_0x2e59ff['error']){if(_0x2e59ff[_0x4d52('0x13')][_0x4d52('0x14')]===0x1f4){logger[_0x4d52('0x13')](_0x4d52('0xf'),_0x5da612,_0x2e59ff['error'][_0x4d52('0x15')]);return _0x56a93b(_0x2e59ff[_0x4d52('0x13')]['message']);}logger[_0x4d52('0x13')](_0x4d52('0xf'),_0x5da612,_0x2e59ff['error'][_0x4d52('0x15')]);return _0x3afca8(_0x2e59ff['error'][_0x4d52('0x15')]);}else{logger[_0x4d52('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5da612,'request\x20sent');_0x3afca8(_0x2e59ff[_0x4d52('0x16')][_0x4d52('0x15')]);}})[_0x4d52('0x17')](function(_0x356c99){logger[_0x4d52('0x13')](_0x4d52('0xf'),_0x5da612,_0x356c99);_0x56a93b(_0x356c99);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 717b980..4248a4c 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3756=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x1dffc4,_0x464564){var _0x4c799c=function(_0x45e95c){while(--_0x45e95c){_0x1dffc4['push'](_0x1dffc4['shift']());}};_0x4c799c(++_0x464564);}(_0x3756,0x116));var _0x6375=function(_0x2d1e6f,_0x1ebc7d){_0x2d1e6f=_0x2d1e6f-0x0;var _0x43fa60=_0x3756[_0x2d1e6f];return _0x43fa60;};'use strict';var multer=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var path=require(_0x6375('0x2'));var timeout=require(_0x6375('0x3'));var express=require(_0x6375('0x4'));var router=express[_0x6375('0x5')]();var fs_extra=require(_0x6375('0x6'));var auth=require(_0x6375('0x7'));var interaction=require(_0x6375('0x8'));var config=require(_0x6375('0x9'));var controller=require(_0x6375('0xa'));router[_0x6375('0xb')]('/',auth[_0x6375('0xc')](),controller[_0x6375('0xd')]);router[_0x6375('0xb')](_0x6375('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6375('0xf')]('/',auth[_0x6375('0xc')](),controller[_0x6375('0x10')]);router[_0x6375('0x11')](_0x6375('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6375('0x12')](_0x6375('0xe'),auth[_0x6375('0xc')](),controller[_0x6375('0x13')]);module['exports']=router; \ No newline at end of file +var _0xad95=['isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','get','/:id'];(function(_0x3c27a0,_0x3dd9cc){var _0x5b58a2=function(_0x17f50d){while(--_0x17f50d){_0x3c27a0['push'](_0x3c27a0['shift']());}};_0x5b58a2(++_0x3dd9cc);}(_0xad95,0x70));var _0x5ad9=function(_0x19dbc6,_0x1cec5d){_0x19dbc6=_0x19dbc6-0x0;var _0x501bd3=_0xad95[_0x19dbc6];return _0x501bd3;};'use strict';var multer=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var path=require(_0x5ad9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5ad9('0x3')]();var fs_extra=require(_0x5ad9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ad9('0x5'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5ad9('0x6')](_0x5ad9('0x7'),auth[_0x5ad9('0x8')](),controller[_0x5ad9('0x9')]);router[_0x5ad9('0xa')]('/',auth['isAuthenticated'](),controller[_0x5ad9('0xb')]);router['put']('/:id',auth[_0x5ad9('0x8')](),controller[_0x5ad9('0xc')]);router[_0x5ad9('0xd')]('/:id',auth[_0x5ad9('0x8')](),controller[_0x5ad9('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a3cfed1..e2d9cdd 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbba=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xdbba,0xe0));var _0xadbb=function(_0x46fb48,_0x3b6c59){_0x46fb48=_0x46fb48-0x0;var _0x1e3f78=_0xdbba[_0x46fb48];return _0x1e3f78;};'use strict';var Sequelize=require(_0xadbb('0x0'));module['exports']={'type':{'type':Sequelize[_0xadbb('0x1')]('string',_0xadbb('0x2'),_0xadbb('0x3'),_0xadbb('0x4'),_0xadbb('0x5')),'defaultValue':_0xadbb('0x6')},'content':{'type':Sequelize[_0xadbb('0x7')]},'key':{'type':Sequelize[_0xadbb('0x7')]},'keyType':{'type':Sequelize[_0xadbb('0x1')](_0xadbb('0x6'),_0xadbb('0x2'),_0xadbb('0x3'))},'keyContent':{'type':Sequelize[_0xadbb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xadbb('0x7')]},'customField':{'type':Sequelize[_0xadbb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xadbb('0x7')]}}; \ No newline at end of file +var _0x0e7b=['ENUM','variable','customVariable','string','STRING','BOOLEAN','exports'];(function(_0x1e9761,_0x5be100){var _0x419f3e=function(_0x480e16){while(--_0x480e16){_0x1e9761['push'](_0x1e9761['shift']());}};_0x419f3e(++_0x5be100);}(_0x0e7b,0xa7));var _0xb0e7=function(_0x4c97d9,_0x343880){_0x4c97d9=_0x4c97d9-0x0;var _0x532391=_0x0e7b[_0x4c97d9];return _0x532391;};'use strict';var Sequelize=require('sequelize');module[_0xb0e7('0x0')]={'type':{'type':Sequelize[_0xb0e7('0x1')]('string',_0xb0e7('0x2'),_0xb0e7('0x3'),'keyValue','picklist'),'defaultValue':_0xb0e7('0x4')},'content':{'type':Sequelize[_0xb0e7('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb0e7('0x1')](_0xb0e7('0x4'),_0xb0e7('0x2'),_0xb0e7('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb0e7('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb0e7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb0e7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 965598b..df66720 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x155e=['where','pick','merge','filter','include','rows','catch','show','params','length','includeAll','create','find','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','index','FreshsalesField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x155e,0x11f));var _0xe155=function(_0x3566d0,_0x34a49f){_0x3566d0=_0x3566d0-0x0;var _0x3fd4da=_0x155e[_0x3566d0];return _0x3fd4da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe155('0x0'));var jsonpatch=require(_0xe155('0x1'));var rp=require(_0xe155('0x2'));var moment=require(_0xe155('0x3'));var BPromise=require(_0xe155('0x4'));var Mustache=require(_0xe155('0x5'));var util=require(_0xe155('0x6'));var path=require('path');var sox=require(_0xe155('0x7'));var csv=require(_0xe155('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe155('0x9'));var _=require(_0xe155('0xa'));var squel=require('squel');var crypto=require(_0xe155('0xb'));var jsforce=require(_0xe155('0xc'));var deskjs=require(_0xe155('0xd'));var toCsv=require(_0xe155('0x8'));var querystring=require(_0xe155('0xe'));var Papa=require(_0xe155('0xf'));var Redis=require(_0xe155('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe155('0x11'));var logger=require(_0xe155('0x12'))('api');var utils=require(_0xe155('0x13'));var config=require(_0xe155('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55cdb3,_0x2af6f7){_0x2af6f7=_0x2af6f7||0xcc;return function(_0x28997a){if(_0x28997a){return _0x55cdb3[_0xe155('0x15')](_0x2af6f7);}return _0x55cdb3[_0xe155('0x16')](_0x2af6f7)['end']();};}function respondWithResult(_0x2fffe9,_0x6d89a4){_0x6d89a4=_0x6d89a4||0xc8;return function(_0x2524b9){if(_0x2524b9){return _0x2fffe9[_0xe155('0x16')](_0x6d89a4)[_0xe155('0x17')](_0x2524b9);}};}function respondWithFilteredResult(_0x104897,_0xd6c7ef){return function(_0x2e1e0c){if(_0x2e1e0c){var _0x1905c4=typeof _0xd6c7ef[_0xe155('0x18')]===_0xe155('0x19')&&typeof _0xd6c7ef[_0xe155('0x1a')]===_0xe155('0x19');var _0x14cb80=_0x2e1e0c[_0xe155('0x1b')];var _0x5de9b5=_0x1905c4?0x0:_0xd6c7ef[_0xe155('0x18')];var _0x70c4e3=_0x1905c4?_0x2e1e0c['count']:_0xd6c7ef[_0xe155('0x18')]+_0xd6c7ef['limit'];var _0x378a9d;if(_0x70c4e3>=_0x14cb80){_0x70c4e3=_0x14cb80;_0x378a9d=0xc8;}else{_0x378a9d=0xce;}_0x104897[_0xe155('0x16')](_0x378a9d);return _0x104897[_0xe155('0x1c')]('Content-Range',_0x5de9b5+'-'+_0x70c4e3+'/'+_0x14cb80)[_0xe155('0x17')](_0x2e1e0c);}return null;};}function patchUpdates(_0x555b81){return function(_0x4bd7b3){try{jsonpatch[_0xe155('0x1d')](_0x4bd7b3,_0x555b81,!![]);}catch(_0xdb4939){return BPromise[_0xe155('0x1e')](_0xdb4939);}return _0x4bd7b3['save']();};}function saveUpdates(_0x26638f,_0x443c45){return function(_0x57ae99){if(_0x57ae99){return _0x57ae99[_0xe155('0x1f')](_0x26638f)['then'](function(_0x23dfc1){return _0x23dfc1;});}return null;};}function removeEntity(_0x37caa5,_0x41a0dd){return function(_0x402c82){if(_0x402c82){return _0x402c82['destroy']()[_0xe155('0x20')](function(){_0x37caa5[_0xe155('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29391f,_0xc8bb62){return function(_0x4ccaf5){if(!_0x4ccaf5){_0x29391f[_0xe155('0x15')](0x194);}return _0x4ccaf5;};}function handleError(_0x51ea74,_0x52dcd4){_0x52dcd4=_0x52dcd4||0x1f4;return function(_0x5bd93c){logger[_0xe155('0x21')](_0x5bd93c[_0xe155('0x22')]);if(_0x5bd93c[_0xe155('0x23')]){delete _0x5bd93c[_0xe155('0x23')];}_0x51ea74[_0xe155('0x16')](_0x52dcd4)['send'](_0x5bd93c);};}exports[_0xe155('0x24')]=function(_0x3263f3,_0x343763){var _0x2c867a={},_0x516dd9={},_0x1127d2={'count':0x0,'rows':[]};var _0x1ca762=_['map'](db[_0xe155('0x25')][_0xe155('0x26')],function(_0xc3d404){return{'name':_0xc3d404[_0xe155('0x27')],'type':_0xc3d404[_0xe155('0x28')][_0xe155('0x29')]};});_0x516dd9['model']=_[_0xe155('0x2a')](_0x1ca762,_0xe155('0x23'));_0x516dd9[_0xe155('0x2b')]=_[_0xe155('0x2c')](_0x3263f3[_0xe155('0x2b')]);_0x516dd9[_0xe155('0x2d')]=_[_0xe155('0x2e')](_0x516dd9[_0xe155('0x2f')],_0x516dd9[_0xe155('0x2b')]);_0x2c867a['attributes']=_[_0xe155('0x2e')](_0x516dd9['model'],qs[_0xe155('0x30')](_0x3263f3[_0xe155('0x2b')][_0xe155('0x30')]));_0x2c867a[_0xe155('0x31')]=_0x2c867a[_0xe155('0x31')]['length']?_0x2c867a[_0xe155('0x31')]:_0x516dd9[_0xe155('0x2f')];if(!_0x3263f3[_0xe155('0x2b')]['hasOwnProperty'](_0xe155('0x32'))){_0x2c867a[_0xe155('0x1a')]=qs[_0xe155('0x1a')](_0x3263f3['query'][_0xe155('0x1a')]);_0x2c867a[_0xe155('0x18')]=qs[_0xe155('0x18')](_0x3263f3[_0xe155('0x2b')][_0xe155('0x18')]);}_0x2c867a[_0xe155('0x33')]=qs[_0xe155('0x34')](_0x3263f3[_0xe155('0x2b')][_0xe155('0x34')]);_0x2c867a[_0xe155('0x35')]=qs[_0xe155('0x2d')](_[_0xe155('0x36')](_0x3263f3[_0xe155('0x2b')],_0x516dd9['filters']),_0x1ca762);if(_0x3263f3['query']['filter']){_0x2c867a[_0xe155('0x35')]=_[_0xe155('0x37')](_0x2c867a[_0xe155('0x35')],{'$or':_[_0xe155('0x2a')](_0x1ca762,function(_0xa42658){if(_0xa42658[_0xe155('0x28')]!=='VIRTUAL'){var _0x993c1f={};_0x993c1f[_0xa42658[_0xe155('0x23')]]={'$like':'%'+_0x3263f3[_0xe155('0x2b')][_0xe155('0x38')]+'%'};return _0x993c1f;}})});}_0x2c867a=_[_0xe155('0x37')]({},_0x2c867a,_0x3263f3['options']);var _0x61f06a={'where':_0x2c867a[_0xe155('0x35')]};return db[_0xe155('0x25')]['count'](_0x61f06a)[_0xe155('0x20')](function(_0x28de1f){_0x1127d2[_0xe155('0x1b')]=_0x28de1f;if(_0x3263f3[_0xe155('0x2b')]['includeAll']){_0x2c867a[_0xe155('0x39')]=[{'all':!![]}];}return db[_0xe155('0x25')]['findAll'](_0x2c867a);})[_0xe155('0x20')](function(_0x3fe3c3){_0x1127d2[_0xe155('0x3a')]=_0x3fe3c3;return _0x1127d2;})['then'](respondWithFilteredResult(_0x343763,_0x2c867a))[_0xe155('0x3b')](handleError(_0x343763,null));};exports[_0xe155('0x3c')]=function(_0x4f4cdd,_0x287a66){var _0x41eb29={'raw':!![],'where':{'id':_0x4f4cdd[_0xe155('0x3d')]['id']}},_0x3f51a2={};_0x3f51a2[_0xe155('0x2f')]=_[_0xe155('0x2c')](db[_0xe155('0x25')][_0xe155('0x26')]);_0x3f51a2[_0xe155('0x2b')]=_[_0xe155('0x2c')](_0x4f4cdd[_0xe155('0x2b')]);_0x3f51a2['filters']=_['intersection'](_0x3f51a2['model'],_0x3f51a2['query']);_0x41eb29['attributes']=_[_0xe155('0x2e')](_0x3f51a2[_0xe155('0x2f')],qs[_0xe155('0x30')](_0x4f4cdd[_0xe155('0x2b')][_0xe155('0x30')]));_0x41eb29[_0xe155('0x31')]=_0x41eb29[_0xe155('0x31')][_0xe155('0x3e')]?_0x41eb29['attributes']:_0x3f51a2[_0xe155('0x2f')];if(_0x4f4cdd[_0xe155('0x2b')][_0xe155('0x3f')]){_0x41eb29['include']=[{'all':!![]}];}_0x41eb29=_['merge']({},_0x41eb29,_0x4f4cdd['options']);return db[_0xe155('0x25')]['find'](_0x41eb29)[_0xe155('0x20')](handleEntityNotFound(_0x287a66,null))[_0xe155('0x20')](respondWithResult(_0x287a66,null))['catch'](handleError(_0x287a66,null));};exports[_0xe155('0x40')]=function(_0x13787d,_0x1b1961){return db[_0xe155('0x25')]['create'](_0x13787d['body'],{})[_0xe155('0x20')](respondWithResult(_0x1b1961,0xc9))['catch'](handleError(_0x1b1961,null));};exports[_0xe155('0x1f')]=function(_0x6122d2,_0x415a7c){if(_0x6122d2['body']['id']){delete _0x6122d2['body']['id'];}return db['FreshsalesField'][_0xe155('0x41')]({'where':{'id':_0x6122d2[_0xe155('0x3d')]['id']}})[_0xe155('0x20')](handleEntityNotFound(_0x415a7c,null))['then'](saveUpdates(_0x6122d2[_0xe155('0x42')],null))[_0xe155('0x20')](respondWithResult(_0x415a7c,null))[_0xe155('0x3b')](handleError(_0x415a7c,null));};exports[_0xe155('0x43')]=function(_0x334724,_0x274564){return db[_0xe155('0x25')][_0xe155('0x41')]({'where':{'id':_0x334724[_0xe155('0x3d')]['id']}})[_0xe155('0x20')](handleEntityNotFound(_0x274564,null))[_0xe155('0x20')](removeEntity(_0x274564,null))[_0xe155('0x3b')](handleError(_0x274564,null));}; \ No newline at end of file +var _0xe4ea=['attributes','length','hasOwnProperty','sort','pick','where','merge','filter','options','rows','catch','show','includeAll','include','find','create','body','update','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','error','stack','name','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields'];(function(_0x506d20,_0xcd29af){var _0x5befe9=function(_0x369900){while(--_0x369900){_0x506d20['push'](_0x506d20['shift']());}};_0x5befe9(++_0xcd29af);}(_0xe4ea,0x1d0));var _0xae4e=function(_0x48ab0e,_0x1ba05e){_0x48ab0e=_0x48ab0e-0x0;var _0x28c252=_0xe4ea[_0x48ab0e];return _0x28c252;};'use strict';var emlformat=require(_0xae4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae4e('0x1'));var jsonpatch=require(_0xae4e('0x2'));var rp=require(_0xae4e('0x3'));var moment=require(_0xae4e('0x4'));var BPromise=require(_0xae4e('0x5'));var Mustache=require(_0xae4e('0x6'));var util=require(_0xae4e('0x7'));var path=require(_0xae4e('0x8'));var sox=require('sox');var csv=require(_0xae4e('0x9'));var ejs=require(_0xae4e('0xa'));var fs=require('fs');var fs_extra=require(_0xae4e('0xb'));var _=require(_0xae4e('0xc'));var squel=require(_0xae4e('0xd'));var crypto=require('crypto');var jsforce=require(_0xae4e('0xe'));var deskjs=require(_0xae4e('0xf'));var toCsv=require(_0xae4e('0x9'));var querystring=require(_0xae4e('0x10'));var Papa=require(_0xae4e('0x11'));var Redis=require('ioredis');var authService=require(_0xae4e('0x12'));var qs=require(_0xae4e('0x13'));var as=require(_0xae4e('0x14'));var hardwareService=require(_0xae4e('0x15'));var logger=require(_0xae4e('0x16'))(_0xae4e('0x17'));var utils=require(_0xae4e('0x18'));var config=require(_0xae4e('0x19'));var licenseUtil=require(_0xae4e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32e130,_0x59e37e){_0x59e37e=_0x59e37e||0xcc;return function(_0xf1e45a){if(_0xf1e45a){return _0x32e130['sendStatus'](_0x59e37e);}return _0x32e130['status'](_0x59e37e)[_0xae4e('0x1b')]();};}function respondWithResult(_0x1a60fd,_0x426167){_0x426167=_0x426167||0xc8;return function(_0x508d35){if(_0x508d35){return _0x1a60fd[_0xae4e('0x1c')](_0x426167)[_0xae4e('0x1d')](_0x508d35);}};}function respondWithFilteredResult(_0x15f9da,_0x3af386){return function(_0x4d840d){if(_0x4d840d){var _0x4e7497=typeof _0x3af386[_0xae4e('0x1e')]==='undefined'&&typeof _0x3af386['limit']===_0xae4e('0x1f');var _0xbc788c=_0x4d840d[_0xae4e('0x20')];var _0x258a17=_0x4e7497?0x0:_0x3af386[_0xae4e('0x1e')];var _0x46112b=_0x4e7497?_0x4d840d[_0xae4e('0x20')]:_0x3af386[_0xae4e('0x1e')]+_0x3af386[_0xae4e('0x21')];var _0x5c9411;if(_0x46112b>=_0xbc788c){_0x46112b=_0xbc788c;_0x5c9411=0xc8;}else{_0x5c9411=0xce;}_0x15f9da[_0xae4e('0x1c')](_0x5c9411);return _0x15f9da['set'](_0xae4e('0x22'),_0x258a17+'-'+_0x46112b+'/'+_0xbc788c)[_0xae4e('0x1d')](_0x4d840d);}return null;};}function patchUpdates(_0x48b32c){return function(_0x403363){try{jsonpatch[_0xae4e('0x23')](_0x403363,_0x48b32c,!![]);}catch(_0x14f056){return BPromise['reject'](_0x14f056);}return _0x403363[_0xae4e('0x24')]();};}function saveUpdates(_0x17bb92,_0x3efc19){return function(_0x12bb35){if(_0x12bb35){return _0x12bb35['update'](_0x17bb92)[_0xae4e('0x25')](function(_0x1e7a1e){return _0x1e7a1e;});}return null;};}function removeEntity(_0xaf188f,_0x59bafc){return function(_0x5a8908){if(_0x5a8908){return _0x5a8908['destroy']()[_0xae4e('0x25')](function(){_0xaf188f['status'](0xcc)[_0xae4e('0x1b')]();});}};}function handleEntityNotFound(_0x67cac5,_0x50e615){return function(_0x439458){if(!_0x439458){_0x67cac5['sendStatus'](0x194);}return _0x439458;};}function handleError(_0x1acfcb,_0x18dab0){_0x18dab0=_0x18dab0||0x1f4;return function(_0x13927d){logger[_0xae4e('0x26')](_0x13927d[_0xae4e('0x27')]);if(_0x13927d[_0xae4e('0x28')]){delete _0x13927d[_0xae4e('0x28')];}_0x1acfcb['status'](_0x18dab0)['send'](_0x13927d);};}exports[_0xae4e('0x29')]=function(_0x7e6cf3,_0x6dcd44){var _0x1a7d3c={},_0x4c88f7={},_0x5743f9={'count':0x0,'rows':[]};var _0x2f6bb2=_['map'](db[_0xae4e('0x2a')][_0xae4e('0x2b')],function(_0x4f2a1d){return{'name':_0x4f2a1d[_0xae4e('0x2c')],'type':_0x4f2a1d[_0xae4e('0x2d')][_0xae4e('0x2e')]};});_0x4c88f7[_0xae4e('0x2f')]=_[_0xae4e('0x30')](_0x2f6bb2,_0xae4e('0x28'));_0x4c88f7[_0xae4e('0x31')]=_[_0xae4e('0x32')](_0x7e6cf3[_0xae4e('0x31')]);_0x4c88f7[_0xae4e('0x33')]=_[_0xae4e('0x34')](_0x4c88f7[_0xae4e('0x2f')],_0x4c88f7[_0xae4e('0x31')]);_0x1a7d3c['attributes']=_[_0xae4e('0x34')](_0x4c88f7[_0xae4e('0x2f')],qs[_0xae4e('0x35')](_0x7e6cf3['query'][_0xae4e('0x35')]));_0x1a7d3c[_0xae4e('0x36')]=_0x1a7d3c['attributes'][_0xae4e('0x37')]?_0x1a7d3c[_0xae4e('0x36')]:_0x4c88f7[_0xae4e('0x2f')];if(!_0x7e6cf3[_0xae4e('0x31')][_0xae4e('0x38')]('nolimit')){_0x1a7d3c[_0xae4e('0x21')]=qs[_0xae4e('0x21')](_0x7e6cf3[_0xae4e('0x31')]['limit']);_0x1a7d3c[_0xae4e('0x1e')]=qs[_0xae4e('0x1e')](_0x7e6cf3[_0xae4e('0x31')]['offset']);}_0x1a7d3c['order']=qs['sort'](_0x7e6cf3['query'][_0xae4e('0x39')]);_0x1a7d3c['where']=qs[_0xae4e('0x33')](_[_0xae4e('0x3a')](_0x7e6cf3['query'],_0x4c88f7[_0xae4e('0x33')]),_0x2f6bb2);if(_0x7e6cf3[_0xae4e('0x31')]['filter']){_0x1a7d3c[_0xae4e('0x3b')]=_[_0xae4e('0x3c')](_0x1a7d3c['where'],{'$or':_['map'](_0x2f6bb2,function(_0x5d6d0b){if(_0x5d6d0b[_0xae4e('0x2d')]!=='VIRTUAL'){var _0x3d9be8={};_0x3d9be8[_0x5d6d0b['name']]={'$like':'%'+_0x7e6cf3[_0xae4e('0x31')][_0xae4e('0x3d')]+'%'};return _0x3d9be8;}})});}_0x1a7d3c=_['merge']({},_0x1a7d3c,_0x7e6cf3[_0xae4e('0x3e')]);var _0x4f7b6a={'where':_0x1a7d3c[_0xae4e('0x3b')]};return db[_0xae4e('0x2a')][_0xae4e('0x20')](_0x4f7b6a)[_0xae4e('0x25')](function(_0x2f666){_0x5743f9[_0xae4e('0x20')]=_0x2f666;if(_0x7e6cf3[_0xae4e('0x31')]['includeAll']){_0x1a7d3c['include']=[{'all':!![]}];}return db[_0xae4e('0x2a')]['findAll'](_0x1a7d3c);})['then'](function(_0x4baa77){_0x5743f9[_0xae4e('0x3f')]=_0x4baa77;return _0x5743f9;})[_0xae4e('0x25')](respondWithFilteredResult(_0x6dcd44,_0x1a7d3c))[_0xae4e('0x40')](handleError(_0x6dcd44,null));};exports[_0xae4e('0x41')]=function(_0x85c7d9,_0x1cbf6f){var _0x139fad={'raw':!![],'where':{'id':_0x85c7d9['params']['id']}},_0x37a006={};_0x37a006[_0xae4e('0x2f')]=_[_0xae4e('0x32')](db[_0xae4e('0x2a')]['rawAttributes']);_0x37a006[_0xae4e('0x31')]=_[_0xae4e('0x32')](_0x85c7d9[_0xae4e('0x31')]);_0x37a006['filters']=_[_0xae4e('0x34')](_0x37a006[_0xae4e('0x2f')],_0x37a006['query']);_0x139fad[_0xae4e('0x36')]=_[_0xae4e('0x34')](_0x37a006[_0xae4e('0x2f')],qs[_0xae4e('0x35')](_0x85c7d9[_0xae4e('0x31')]['fields']));_0x139fad['attributes']=_0x139fad[_0xae4e('0x36')]['length']?_0x139fad[_0xae4e('0x36')]:_0x37a006['model'];if(_0x85c7d9[_0xae4e('0x31')][_0xae4e('0x42')]){_0x139fad[_0xae4e('0x43')]=[{'all':!![]}];}_0x139fad=_['merge']({},_0x139fad,_0x85c7d9[_0xae4e('0x3e')]);return db[_0xae4e('0x2a')][_0xae4e('0x44')](_0x139fad)['then'](handleEntityNotFound(_0x1cbf6f,null))[_0xae4e('0x25')](respondWithResult(_0x1cbf6f,null))[_0xae4e('0x40')](handleError(_0x1cbf6f,null));};exports['create']=function(_0x2115a8,_0x5042ce){return db[_0xae4e('0x2a')][_0xae4e('0x45')](_0x2115a8[_0xae4e('0x46')],{})[_0xae4e('0x25')](respondWithResult(_0x5042ce,0xc9))[_0xae4e('0x40')](handleError(_0x5042ce,null));};exports[_0xae4e('0x47')]=function(_0x2312e9,_0x592d97){if(_0x2312e9['body']['id']){delete _0x2312e9[_0xae4e('0x46')]['id'];}return db['FreshsalesField'][_0xae4e('0x44')]({'where':{'id':_0x2312e9['params']['id']}})[_0xae4e('0x25')](handleEntityNotFound(_0x592d97,null))[_0xae4e('0x25')](saveUpdates(_0x2312e9[_0xae4e('0x46')],null))[_0xae4e('0x25')](respondWithResult(_0x592d97,null))[_0xae4e('0x40')](handleError(_0x592d97,null));};exports[_0xae4e('0x48')]=function(_0x36617b,_0x1787a5){return db[_0xae4e('0x2a')][_0xae4e('0x44')]({'where':{'id':_0x36617b[_0xae4e('0x49')]['id']}})[_0xae4e('0x25')](handleEntityNotFound(_0x1787a5,null))['then'](removeEntity(_0x1787a5,null))[_0xae4e('0x40')](handleError(_0x1787a5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index a55b445..dab1821 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf108=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf108,0x1d9));var _0x8f10=function(_0x5b826e,_0x517e6a){_0x5b826e=_0x5b826e-0x0;var _0x2ef6eb=_0xf108[_0x5b826e];return _0x2ef6eb;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var logger=require(_0x8f10('0x1'))(_0x8f10('0x2'));var moment=require(_0x8f10('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8f10('0x4'));var config=require(_0x8f10('0x5'));var attributes=require(_0x8f10('0x6'));module[_0x8f10('0x7')]=function(_0x2e3419,_0x235737){return _0x2e3419[_0x8f10('0x8')](_0x8f10('0x9'),attributes,{'tableName':_0x8f10('0xa'),'paranoid':![],'indexes':[{'name':_0x8f10('0xb'),'fields':[_0x8f10('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9563=['exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x470ce2,_0x4b3815){var _0x739076=function(_0x1f16f3){while(--_0x1f16f3){_0x470ce2['push'](_0x470ce2['shift']());}};_0x739076(++_0x4b3815);}(_0x9563,0x1e7));var _0x3956=function(_0x4ac8cd,_0x4517c3){_0x4ac8cd=_0x4ac8cd-0x0;var _0x117c61=_0x9563[_0x4ac8cd];return _0x117c61;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var logger=require('../../config/logger')(_0x3956('0x2'));var moment=require(_0x3956('0x3'));var BPromise=require(_0x3956('0x4'));var rp=require(_0x3956('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3956('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x3956('0x7')]=function(_0x332a45,_0x177a1a){return _0x332a45[_0x3956('0x8')]('FreshsalesField',attributes,{'tableName':_0x3956('0x9'),'paranoid':![],'indexes':[{'name':_0x3956('0xa'),'fields':[_0x3956('0xb'),_0x3956('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index bb53fea..8132b70 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x580db6,_0x2e0479){var _0x31c8ae=function(_0x1aa17e){while(--_0x1aa17e){_0x580db6['push'](_0x580db6['shift']());}};_0x31c8ae(++_0x2e0479);}(_0x1883,0xab));var _0x3188=function(_0x47520c,_0x221932){_0x47520c=_0x47520c-0x0;var _0x184eeb=_0x1883[_0x47520c];return _0x184eeb;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file +var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a116f,_0x3e450d){var _0x146bb1=function(_0x40fe9e){while(--_0x40fe9e){_0x1a116f['push'](_0x1a116f['shift']());}};_0x146bb1(++_0x3e450d);}(_0xafc4,0x69));var _0x4afc=function(_0x5e2d8c,_0x45b02e){_0x5e2d8c=_0x5e2d8c-0x0;var _0x4b03f3=_0xafc4[_0x5e2d8c];return _0x4b03f3;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 1b7481b..ca0d3d4 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x12643d,_0x1ee117){var _0x28edb6=function(_0x1f137d){while(--_0x1f137d){_0x12643d['push'](_0x12643d['shift']());}};_0x28edb6(++_0x1ee117);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x47ff63,_0x1205a9){var _0x23cd88=function(_0xb0cdf4){while(--_0xb0cdf4){_0x47ff63['push'](_0x47ff63['shift']());}};_0x23cd88(++_0x1205a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9f92637..a322d03 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 _0x3fc6=['integrationTab','newTab','sequelize','STRING','username'];(function(_0x5aa5f5,_0x2cf95b){var _0x484e60=function(_0x5cd72e){while(--_0x5cd72e){_0x5aa5f5['push'](_0x5aa5f5['shift']());}};_0x484e60(++_0x2cf95b);}(_0x3fc6,0x115));var _0x63fc=function(_0x46966b,_0x5fdab5){_0x46966b=_0x46966b-0x0;var _0x3e1ef7=_0x3fc6[_0x46966b];return _0x3e1ef7;};'use strict';var Sequelize=require(_0x63fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x63fc('0x1')]},'description':{'type':Sequelize[_0x63fc('0x1')]},'username':{'type':Sequelize[_0x63fc('0x1')],'unique':_0x63fc('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x63fc('0x1')]},'clientId':{'type':Sequelize[_0x63fc('0x1')]},'clientSecret':{'type':Sequelize[_0x63fc('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x63fc('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x63fc('0x3'),_0x63fc('0x4')),'defaultValue':_0x63fc('0x3')}}; \ No newline at end of file +var _0x97a6=['sequelize','exports','STRING','username','ENUM'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x97a6,0x15e));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x697a('0x0'));module[_0x697a('0x1')]={'name':{'type':Sequelize[_0x697a('0x2')]},'description':{'type':Sequelize[_0x697a('0x2')]},'username':{'type':Sequelize[_0x697a('0x2')],'unique':_0x697a('0x3')},'remoteUri':{'type':Sequelize[_0x697a('0x2')]},'password':{'type':Sequelize[_0x697a('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x697a('0x2')]},'serverUrl':{'type':Sequelize[_0x697a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x697a('0x4')]('integrationTab','newTab'),'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 246e088..ba199ee 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 _0x7218=['sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','merge','find','create','body','findOne','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','username','password','concat','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7218,0xce));var _0x8721=function(_0xe4c934,_0x57a4cb){_0xe4c934=_0xe4c934-0x0;var _0x134514=_0x7218[_0xe4c934];return _0x134514;};'use strict';var emlformat=require(_0x8721('0x0'));var rimraf=require(_0x8721('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8721('0x2'));var rp=require(_0x8721('0x3'));var moment=require(_0x8721('0x4'));var BPromise=require(_0x8721('0x5'));var Mustache=require(_0x8721('0x6'));var util=require(_0x8721('0x7'));var path=require(_0x8721('0x8'));var sox=require(_0x8721('0x9'));var csv=require(_0x8721('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8721('0xb'));var _=require(_0x8721('0xc'));var squel=require(_0x8721('0xd'));var crypto=require(_0x8721('0xe'));var jsforce=require(_0x8721('0xf'));var deskjs=require(_0x8721('0x10'));var toCsv=require(_0x8721('0xa'));var querystring=require(_0x8721('0x11'));var Papa=require(_0x8721('0x12'));var Redis=require(_0x8721('0x13'));var authService=require(_0x8721('0x14'));var qs=require(_0x8721('0x15'));var as=require(_0x8721('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8721('0x17'));var utils=require('../../config/utils');var config=require(_0x8721('0x18'));var licenseUtil=require(_0x8721('0x19'));var db=require(_0x8721('0x1a'))['db'];var integrations=require(_0x8721('0x1b'));function respondWithStatusCode(_0x1a25d0,_0x7a25fb){_0x7a25fb=_0x7a25fb||0xcc;return function(_0x15571c){if(_0x15571c){return _0x1a25d0[_0x8721('0x1c')](_0x7a25fb);}return _0x1a25d0[_0x8721('0x1d')](_0x7a25fb)[_0x8721('0x1e')]();};}function respondWithResult(_0x280cdb,_0xba7b53){_0xba7b53=_0xba7b53||0xc8;return function(_0x5428e0){if(_0x5428e0){return _0x280cdb[_0x8721('0x1d')](_0xba7b53)['json'](_0x5428e0);}};}function respondWithFilteredResult(_0x211aec,_0x1250e6){return function(_0x13578d){if(_0x13578d){var _0x2e4d0f=typeof _0x1250e6[_0x8721('0x1f')]===_0x8721('0x20')&&typeof _0x1250e6[_0x8721('0x21')]==='undefined';var _0x51439b=_0x13578d[_0x8721('0x22')];var _0x5e07a7=_0x2e4d0f?0x0:_0x1250e6[_0x8721('0x1f')];var _0x540fb3=_0x2e4d0f?_0x13578d[_0x8721('0x22')]:_0x1250e6['offset']+_0x1250e6[_0x8721('0x21')];var _0x4fd7fa;if(_0x540fb3>=_0x51439b){_0x540fb3=_0x51439b;_0x4fd7fa=0xc8;}else{_0x4fd7fa=0xce;}_0x211aec[_0x8721('0x1d')](_0x4fd7fa);return _0x211aec[_0x8721('0x23')](_0x8721('0x24'),_0x5e07a7+'-'+_0x540fb3+'/'+_0x51439b)[_0x8721('0x25')](_0x13578d);}return null;};}function patchUpdates(_0x56891e){return function(_0x24ac8a){try{jsonpatch['apply'](_0x24ac8a,_0x56891e,!![]);}catch(_0x16e1d4){return BPromise[_0x8721('0x26')](_0x16e1d4);}return _0x24ac8a[_0x8721('0x27')]();};}function saveUpdates(_0x22e2f0,_0x3601ef){return function(_0x3492d3){if(_0x3492d3){return _0x3492d3[_0x8721('0x28')](_0x22e2f0)[_0x8721('0x29')](function(_0x1ffa5d){return _0x1ffa5d;});}return null;};}function removeEntity(_0x26d521,_0x2eb145){return function(_0x2d9c2f){if(_0x2d9c2f){return _0x2d9c2f[_0x8721('0x2a')]()['then'](function(){_0x26d521[_0x8721('0x1d')](0xcc)[_0x8721('0x1e')]();});}};}function handleEntityNotFound(_0x1dff30,_0x25664a){return function(_0x483264){if(!_0x483264){_0x1dff30[_0x8721('0x1c')](0x194);}return _0x483264;};}function handleError(_0x1f8009,_0x5dd7ed){_0x5dd7ed=_0x5dd7ed||0x1f4;return function(_0x877324){logger[_0x8721('0x2b')](_0x877324[_0x8721('0x2c')]);if(_0x877324[_0x8721('0x2d')]){delete _0x877324['name'];}_0x1f8009['status'](_0x5dd7ed)[_0x8721('0x2e')](_0x877324);};}exports[_0x8721('0x2f')]=function(_0x16062d,_0x3da140){var _0x423f1b={},_0x278d3a={},_0x52b8ec={'count':0x0,'rows':[]};var _0x482ddc=_[_0x8721('0x30')](db[_0x8721('0x31')]['rawAttributes'],function(_0x58719c){return{'name':_0x58719c[_0x8721('0x32')],'type':_0x58719c[_0x8721('0x33')][_0x8721('0x34')]};});_0x278d3a[_0x8721('0x35')]=_[_0x8721('0x30')](_0x482ddc,_0x8721('0x2d'));_0x278d3a[_0x8721('0x36')]=_[_0x8721('0x37')](_0x16062d['query']);_0x278d3a[_0x8721('0x38')]=_[_0x8721('0x39')](_0x278d3a['model'],_0x278d3a[_0x8721('0x36')]);_0x423f1b[_0x8721('0x3a')]=_[_0x8721('0x39')](_0x278d3a[_0x8721('0x35')],qs[_0x8721('0x3b')](_0x16062d['query'][_0x8721('0x3b')]));_0x423f1b[_0x8721('0x3a')]=_0x423f1b[_0x8721('0x3a')][_0x8721('0x3c')]?_0x423f1b['attributes']:_0x278d3a[_0x8721('0x35')];if(!_0x16062d[_0x8721('0x36')]['hasOwnProperty'](_0x8721('0x3d'))){_0x423f1b[_0x8721('0x21')]=qs[_0x8721('0x21')](_0x16062d[_0x8721('0x36')]['limit']);_0x423f1b[_0x8721('0x1f')]=qs[_0x8721('0x1f')](_0x16062d[_0x8721('0x36')][_0x8721('0x1f')]);}_0x423f1b['order']=qs[_0x8721('0x3e')](_0x16062d[_0x8721('0x36')]['sort']);_0x423f1b[_0x8721('0x3f')]=qs['filters'](_[_0x8721('0x40')](_0x16062d[_0x8721('0x36')],_0x278d3a[_0x8721('0x38')]),_0x482ddc);if(_0x16062d[_0x8721('0x36')][_0x8721('0x41')]){_0x423f1b[_0x8721('0x3f')]=_['merge'](_0x423f1b['where'],{'$or':_[_0x8721('0x30')](_0x482ddc,function(_0x1cc1c9){if(_0x1cc1c9[_0x8721('0x33')]!==_0x8721('0x42')){var _0x427a4d={};_0x427a4d[_0x1cc1c9[_0x8721('0x2d')]]={'$like':'%'+_0x16062d['query']['filter']+'%'};return _0x427a4d;}})});}_0x423f1b=_['merge']({},_0x423f1b,_0x16062d[_0x8721('0x43')]);var _0x1ff274={'where':_0x423f1b[_0x8721('0x3f')]};return db[_0x8721('0x31')][_0x8721('0x22')](_0x1ff274)[_0x8721('0x29')](function(_0x3ec488){_0x52b8ec[_0x8721('0x22')]=_0x3ec488;if(_0x16062d[_0x8721('0x36')][_0x8721('0x44')]){_0x423f1b['include']=[{'all':!![]}];}return db[_0x8721('0x31')][_0x8721('0x45')](_0x423f1b);})[_0x8721('0x29')](function(_0x51c952){_0x52b8ec[_0x8721('0x46')]=_0x51c952;return _0x52b8ec;})['then'](respondWithFilteredResult(_0x3da140,_0x423f1b))[_0x8721('0x47')](handleError(_0x3da140,null));};exports[_0x8721('0x48')]=function(_0x318485,_0x196b2e){var _0x3e4ce6={'raw':![],'where':{'id':_0x318485[_0x8721('0x49')]['id']}},_0x1ef9db={};_0x1ef9db[_0x8721('0x35')]=_['keys'](db[_0x8721('0x31')][_0x8721('0x4a')]);_0x1ef9db['query']=_[_0x8721('0x37')](_0x318485[_0x8721('0x36')]);_0x1ef9db[_0x8721('0x38')]=_['intersection'](_0x1ef9db[_0x8721('0x35')],_0x1ef9db[_0x8721('0x36')]);_0x3e4ce6[_0x8721('0x3a')]=_['intersection'](_0x1ef9db['model'],qs[_0x8721('0x3b')](_0x318485['query']['fields']));_0x3e4ce6[_0x8721('0x3a')]=_0x3e4ce6[_0x8721('0x3a')][_0x8721('0x3c')]?_0x3e4ce6[_0x8721('0x3a')]:_0x1ef9db[_0x8721('0x35')];if(_0x318485[_0x8721('0x36')][_0x8721('0x44')]){_0x3e4ce6[_0x8721('0x4b')]=[{'all':!![]}];}_0x3e4ce6=_[_0x8721('0x4c')]({},_0x3e4ce6,_0x318485[_0x8721('0x43')]);return db['SalesforceAccount'][_0x8721('0x4d')](_0x3e4ce6)[_0x8721('0x29')](handleEntityNotFound(_0x196b2e,null))[_0x8721('0x29')](respondWithResult(_0x196b2e,null))[_0x8721('0x47')](handleError(_0x196b2e,null));};exports['create']=function(_0x55e885,_0x274b43){return db[_0x8721('0x31')][_0x8721('0x4e')](_0x55e885[_0x8721('0x4f')],{})['then'](respondWithResult(_0x274b43,0xc9))[_0x8721('0x47')](handleError(_0x274b43,null));};exports[_0x8721('0x28')]=function(_0x451897,_0x3b3b81){if(_0x451897[_0x8721('0x4f')]['id']){delete _0x451897[_0x8721('0x4f')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x451897['params']['id']}})[_0x8721('0x29')](handleEntityNotFound(_0x3b3b81,null))[_0x8721('0x29')](saveUpdates(_0x451897[_0x8721('0x4f')],null))[_0x8721('0x29')](respondWithResult(_0x3b3b81,null))[_0x8721('0x47')](handleError(_0x3b3b81,null));};exports[_0x8721('0x2a')]=function(_0x108c45,_0x541203){return db[_0x8721('0x31')][_0x8721('0x4d')]({'where':{'id':_0x108c45[_0x8721('0x49')]['id']}})[_0x8721('0x29')](handleEntityNotFound(_0x541203,null))['then'](removeEntity(_0x541203,null))[_0x8721('0x47')](handleError(_0x541203,null));};exports['getConfigurations']=function(_0x441a38,_0x5aa1dc,_0x4b6eea){var _0x3c9abb={};var _0xcbb0db={};var _0x5c4299;var _0x1577c4;return db[_0x8721('0x31')][_0x8721('0x50')]({'where':{'id':_0x441a38[_0x8721('0x49')]['id']}})[_0x8721('0x29')](handleEntityNotFound(_0x5aa1dc,null))[_0x8721('0x29')](function(_0x1a7bbe){if(_0x1a7bbe){_0x5c4299=_0x1a7bbe;_0xcbb0db[_0x8721('0x35')]=_[_0x8721('0x37')](db['SalesforceConfiguration'][_0x8721('0x4a')]);_0xcbb0db[_0x8721('0x36')]=_[_0x8721('0x37')](_0x441a38[_0x8721('0x36')]);_0xcbb0db[_0x8721('0x38')]=_[_0x8721('0x39')](_0xcbb0db[_0x8721('0x35')],_0xcbb0db[_0x8721('0x36')]);_0x3c9abb[_0x8721('0x3a')]=_[_0x8721('0x39')](_0xcbb0db['model'],qs[_0x8721('0x3b')](_0x441a38[_0x8721('0x36')][_0x8721('0x3b')]));_0x3c9abb[_0x8721('0x3a')]=_0x3c9abb[_0x8721('0x3a')][_0x8721('0x3c')]?_0x3c9abb[_0x8721('0x3a')]:_0xcbb0db[_0x8721('0x35')];_0x3c9abb[_0x8721('0x51')]=qs[_0x8721('0x3e')](_0x441a38[_0x8721('0x36')][_0x8721('0x3e')]);_0x3c9abb[_0x8721('0x3f')]=qs[_0x8721('0x38')](_[_0x8721('0x40')](_0x441a38['query'],_0xcbb0db[_0x8721('0x38')]));if(_0x441a38[_0x8721('0x36')][_0x8721('0x41')]){_0x3c9abb[_0x8721('0x3f')]=_['merge'](_0x3c9abb['where'],{'$or':_[_0x8721('0x30')](_0x3c9abb[_0x8721('0x3a')],function(_0x4df966){var _0x592325={};_0x592325[_0x4df966]={'$like':'%'+_0x441a38[_0x8721('0x36')][_0x8721('0x41')]+'%'};return _0x592325;})});}_0x3c9abb=_[_0x8721('0x4c')]({},_0x3c9abb,_0x441a38['options']);return _0x5c4299[_0x8721('0x52')](_0x3c9abb);}})['then'](function(_0x280852){if(_0x280852){_0x1577c4=_0x280852['length'];if(!_0x441a38[_0x8721('0x36')][_0x8721('0x53')]('nolimit')){_0x3c9abb[_0x8721('0x21')]=qs[_0x8721('0x21')](_0x441a38[_0x8721('0x36')][_0x8721('0x21')]);_0x3c9abb['offset']=qs[_0x8721('0x1f')](_0x441a38[_0x8721('0x36')][_0x8721('0x1f')]);}return _0x5c4299['getConfigurations'](_0x3c9abb);}})[_0x8721('0x29')](function(_0x5f4a69){if(_0x5f4a69){return _0x5f4a69?{'count':_0x1577c4,'rows':_0x5f4a69}:null;}})[_0x8721('0x29')](respondWithResult(_0x5aa1dc,null))[_0x8721('0x47')](handleError(_0x5aa1dc,null));};exports[_0x8721('0x54')]=function(_0x5ba42d,_0x4876c2,_0x198611){if(_0x5ba42d[_0x8721('0x4f')]['id']){delete _0x5ba42d[_0x8721('0x4f')]['id'];}return db[_0x8721('0x31')][_0x8721('0x50')]({'where':{'id':_0x5ba42d[_0x8721('0x49')]['id']}})[_0x8721('0x29')](handleEntityNotFound(_0x4876c2,null))[_0x8721('0x29')](function(_0x2f69e1){if(_0x2f69e1){_0x5ba42d[_0x8721('0x4f')][_0x8721('0x55')]=_0x2f69e1['id'];_0x5ba42d[_0x8721('0x4f')][_0x8721('0x56')]=integrations[_0x8721('0x57')](_0x5ba42d['body'][_0x8721('0x58')],_0x5ba42d[_0x8721('0x4f')][_0x8721('0x33')]);_0x5ba42d[_0x8721('0x4f')]['Descriptions']=integrations[_0x8721('0x59')](_0x5ba42d[_0x8721('0x4f')]['channel'],_0x5ba42d[_0x8721('0x4f')][_0x8721('0x33')]);return db[_0x8721('0x5a')][_0x8721('0x4e')](_0x5ba42d[_0x8721('0x4f')],{'include':[{'model':db[_0x8721('0x5b')],'as':_0x8721('0x56')},{'model':db['SalesforceField'],'as':_0x8721('0x5c')}]});}return null;})[_0x8721('0x29')](respondWithResult(_0x4876c2,null))[_0x8721('0x47')](handleError(_0x4876c2,null));};exports[_0x8721('0x5d')]=function(_0xca35d3,_0x28c6a2,_0x8aa39a){var _0x32b144;var _0x3fef21='';var _0x29cad4=_0x8721('0x5e');return db[_0x8721('0x31')]['findOne']({'where':{'id':_0xca35d3[_0x8721('0x49')]['id']},'attributes':['id',_0x8721('0x5f'),_0x8721('0x60'),'clientSecret','username','password',_0x8721('0x61')]})[_0x8721('0x29')](handleEntityNotFound(_0x28c6a2,null))[_0x8721('0x29')](function(_0x18a370){if(_0x18a370){_0x3fef21=_0x18a370[_0x8721('0x5f')];var _0x1a3f2c=_0x3fef21[_0x8721('0x62')](-0x1);if(_0x1a3f2c==='/'){_0x3fef21=_0x3fef21[_0x8721('0x63')](0x0,_0x3fef21[_0x8721('0x64')](_0x1a3f2c));}_0x32b144=new jsforce[(_0x8721('0x65'))]({'oauth2':{'loginUrl':_0x3fef21,'clientId':_0x18a370[_0x8721('0x60')],'clientSecret':_0x18a370[_0x8721('0x66')]}});return _0x32b144['login'](_0x18a370[_0x8721('0x67')],_0x18a370[_0x8721('0x68')][_0x8721('0x69')](_0x18a370[_0x8721('0x61')]));}})[_0x8721('0x29')](function(_0x584af9){if(_0x584af9){if(!_['isNil'](_0xca35d3['query']['ticketType'])){_0x29cad4=_0xca35d3[_0x8721('0x36')][_0x8721('0x6a')];}return _0x32b144[_0x8721('0x6b')](_0x29cad4)[_0x8721('0x6c')]();}})[_0x8721('0x29')](function(_0x4badc9){var _0x38bcaa=[_0x8721('0x6d'),'ActivityDate',_0x8721('0x6e'),_0x8721('0x6f'),_0x8721('0x70'),_0x8721('0x71')];var _0x9ab2a2=[_0x8721('0x72'),'int',_0x8721('0x73'),_0x8721('0x74'),_0x8721('0x75'),_0x8721('0x76'),'phone'];if(_0x4badc9){_[_0x8721('0x77')](_0x4badc9[_0x8721('0x3b')],function(_0x11bc43){return _0x38bcaa[_0x8721('0x78')](_0x11bc43[_0x8721('0x2d')])||!_0x9ab2a2['includes'](_0x11bc43['type']);});return{'count':_0x4badc9[_0x8721('0x3b')][_0x8721('0x3c')],'rows':_[_0x8721('0x30')](_0x4badc9[_0x8721('0x3b')],function(_0x459cc8){return{'id':_0x459cc8[_0x8721('0x2d')],'name':_0x459cc8[_0x8721('0x79')],'custom':_0x459cc8[_0x8721('0x7a')],'options':_0x459cc8[_0x8721('0x7b')][_0x8721('0x3c')]>0x0?_[_0x8721('0x30')](_0x459cc8[_0x8721('0x7b')],function(_0x4f50b5){return{'name':_0x4f50b5[_0x8721('0x79')],'value':_0x4f50b5[_0x8721('0x7c')]};}):_0x459cc8[_0x8721('0x33')]=='boolean'?[{'name':_0x8721('0x7d'),'value':_0x8721('0x7e')},{'name':_0x8721('0x7f'),'value':_0x8721('0x80')}]:[]};})};}})[_0x8721('0x29')](respondWithResult(_0x28c6a2,null))[_0x8721('0x47')](function(_0x3deeaa){var _0xa398fe=_0xca35d3[_0x8721('0x36')][_0x8721('0x81')]?0x1f4:_0x3deeaa['statusCode']||0x1f4;logger[_0x8721('0x2b')](_0x8721('0x82'),_0x8721('0x5d'),_0xa398fe,JSON[_0x8721('0x83')](_0x3deeaa));delete _0x3deeaa['name'];if(_0xa398fe===0x191){_0xa398fe=0x190;}_0x28c6a2['status'](_0xa398fe)[_0x8721('0x2e')](_0xca35d3[_0x8721('0x36')][_0x8721('0x81')]?{'message':_0x8721('0x84'),'statusCode':_0x3deeaa[_0x8721('0x85')]}:_0x3deeaa);});}; \ No newline at end of file +var _0x4193=['params','keys','intersection','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','login','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','int','picklist','boolean','email','textarea','remove','includes','picklistValues','label','True','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','status','end','offset','undefined','count','limit','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','includeAll','include','rows','catch'];(function(_0x58f908,_0x1fd81a){var _0x5e2701=function(_0x44f6d4){while(--_0x44f6d4){_0x58f908['push'](_0x58f908['shift']());}};_0x5e2701(++_0x1fd81a);}(_0x4193,0x18b));var _0x3419=function(_0x3045ae,_0x276ca0){_0x3045ae=_0x3045ae-0x0;var _0x4751bb=_0x4193[_0x3045ae];return _0x4751bb;};'use strict';var emlformat=require(_0x3419('0x0'));var rimraf=require(_0x3419('0x1'));var zipdir=require(_0x3419('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3419('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3419('0x4'));var util=require('util');var path=require(_0x3419('0x5'));var sox=require(_0x3419('0x6'));var csv=require(_0x3419('0x7'));var ejs=require(_0x3419('0x8'));var fs=require('fs');var fs_extra=require(_0x3419('0x9'));var _=require('lodash');var squel=require(_0x3419('0xa'));var crypto=require(_0x3419('0xb'));var jsforce=require(_0x3419('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3419('0xd'));var Papa=require(_0x3419('0xe'));var Redis=require(_0x3419('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3419('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3419('0x11'));var logger=require(_0x3419('0x12'))(_0x3419('0x13'));var utils=require(_0x3419('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3419('0x15'));function respondWithStatusCode(_0x710a75,_0x2a9f60){_0x2a9f60=_0x2a9f60||0xcc;return function(_0x451b27){if(_0x451b27){return _0x710a75['sendStatus'](_0x2a9f60);}return _0x710a75[_0x3419('0x16')](_0x2a9f60)[_0x3419('0x17')]();};}function respondWithResult(_0x2f828f,_0x3d8034){_0x3d8034=_0x3d8034||0xc8;return function(_0x42f25c){if(_0x42f25c){return _0x2f828f[_0x3419('0x16')](_0x3d8034)['json'](_0x42f25c);}};}function respondWithFilteredResult(_0x58c2e7,_0x14acf8){return function(_0x57f4af){if(_0x57f4af){var _0x642d91=typeof _0x14acf8[_0x3419('0x18')]===_0x3419('0x19')&&typeof _0x14acf8['limit']===_0x3419('0x19');var _0xa2be17=_0x57f4af[_0x3419('0x1a')];var _0x505818=_0x642d91?0x0:_0x14acf8[_0x3419('0x18')];var _0x40b3fb=_0x642d91?_0x57f4af['count']:_0x14acf8[_0x3419('0x18')]+_0x14acf8[_0x3419('0x1b')];var _0x17cc65;if(_0x40b3fb>=_0xa2be17){_0x40b3fb=_0xa2be17;_0x17cc65=0xc8;}else{_0x17cc65=0xce;}_0x58c2e7['status'](_0x17cc65);return _0x58c2e7['set']('Content-Range',_0x505818+'-'+_0x40b3fb+'/'+_0xa2be17)[_0x3419('0x1c')](_0x57f4af);}return null;};}function patchUpdates(_0x124ec1){return function(_0x210c4d){try{jsonpatch[_0x3419('0x1d')](_0x210c4d,_0x124ec1,!![]);}catch(_0x2af8ec){return BPromise[_0x3419('0x1e')](_0x2af8ec);}return _0x210c4d[_0x3419('0x1f')]();};}function saveUpdates(_0x18b877,_0xc51145){return function(_0x36470c){if(_0x36470c){return _0x36470c[_0x3419('0x20')](_0x18b877)['then'](function(_0xd66d04){return _0xd66d04;});}return null;};}function removeEntity(_0x468078,_0x5c8f8a){return function(_0x215b09){if(_0x215b09){return _0x215b09[_0x3419('0x21')]()[_0x3419('0x22')](function(){_0x468078['status'](0xcc)[_0x3419('0x17')]();});}};}function handleEntityNotFound(_0x2cdf81,_0x148e88){return function(_0x2145d6){if(!_0x2145d6){_0x2cdf81[_0x3419('0x23')](0x194);}return _0x2145d6;};}function handleError(_0x168999,_0x201237){_0x201237=_0x201237||0x1f4;return function(_0x1aa17b){logger[_0x3419('0x24')](_0x1aa17b['stack']);if(_0x1aa17b['name']){delete _0x1aa17b[_0x3419('0x25')];}_0x168999[_0x3419('0x16')](_0x201237)[_0x3419('0x26')](_0x1aa17b);};}exports[_0x3419('0x27')]=function(_0x4517ae,_0x38670c){var _0x38c130={},_0x52083b={},_0x43dd8a={'count':0x0,'rows':[]};var _0x7071b4=_[_0x3419('0x28')](db[_0x3419('0x29')][_0x3419('0x2a')],function(_0x1cdbaf){return{'name':_0x1cdbaf[_0x3419('0x2b')],'type':_0x1cdbaf[_0x3419('0x2c')]['key']};});_0x52083b[_0x3419('0x2d')]=_[_0x3419('0x28')](_0x7071b4,_0x3419('0x25'));_0x52083b[_0x3419('0x2e')]=_['keys'](_0x4517ae[_0x3419('0x2e')]);_0x52083b[_0x3419('0x2f')]=_['intersection'](_0x52083b[_0x3419('0x2d')],_0x52083b[_0x3419('0x2e')]);_0x38c130[_0x3419('0x30')]=_['intersection'](_0x52083b[_0x3419('0x2d')],qs[_0x3419('0x31')](_0x4517ae[_0x3419('0x2e')][_0x3419('0x31')]));_0x38c130[_0x3419('0x30')]=_0x38c130[_0x3419('0x30')][_0x3419('0x32')]?_0x38c130['attributes']:_0x52083b[_0x3419('0x2d')];if(!_0x4517ae[_0x3419('0x2e')][_0x3419('0x33')]('nolimit')){_0x38c130['limit']=qs[_0x3419('0x1b')](_0x4517ae[_0x3419('0x2e')][_0x3419('0x1b')]);_0x38c130['offset']=qs[_0x3419('0x18')](_0x4517ae[_0x3419('0x2e')][_0x3419('0x18')]);}_0x38c130['order']=qs[_0x3419('0x34')](_0x4517ae[_0x3419('0x2e')][_0x3419('0x34')]);_0x38c130['where']=qs[_0x3419('0x2f')](_[_0x3419('0x35')](_0x4517ae[_0x3419('0x2e')],_0x52083b[_0x3419('0x2f')]),_0x7071b4);if(_0x4517ae[_0x3419('0x2e')][_0x3419('0x36')]){_0x38c130['where']=_[_0x3419('0x37')](_0x38c130[_0x3419('0x38')],{'$or':_[_0x3419('0x28')](_0x7071b4,function(_0x2fc721){if(_0x2fc721['type']!=='VIRTUAL'){var _0x1afe6b={};_0x1afe6b[_0x2fc721[_0x3419('0x25')]]={'$like':'%'+_0x4517ae[_0x3419('0x2e')]['filter']+'%'};return _0x1afe6b;}})});}_0x38c130=_['merge']({},_0x38c130,_0x4517ae['options']);var _0x3b2724={'where':_0x38c130[_0x3419('0x38')]};return db[_0x3419('0x29')][_0x3419('0x1a')](_0x3b2724)[_0x3419('0x22')](function(_0x5045f9){_0x43dd8a[_0x3419('0x1a')]=_0x5045f9;if(_0x4517ae[_0x3419('0x2e')][_0x3419('0x39')]){_0x38c130[_0x3419('0x3a')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x38c130);})[_0x3419('0x22')](function(_0x52086b){_0x43dd8a[_0x3419('0x3b')]=_0x52086b;return _0x43dd8a;})['then'](respondWithFilteredResult(_0x38670c,_0x38c130))[_0x3419('0x3c')](handleError(_0x38670c,null));};exports['show']=function(_0x2df247,_0x14b92c){var _0x189642={'raw':![],'where':{'id':_0x2df247[_0x3419('0x3d')]['id']}},_0x40aa7c={};_0x40aa7c[_0x3419('0x2d')]=_[_0x3419('0x3e')](db[_0x3419('0x29')][_0x3419('0x2a')]);_0x40aa7c[_0x3419('0x2e')]=_['keys'](_0x2df247[_0x3419('0x2e')]);_0x40aa7c[_0x3419('0x2f')]=_[_0x3419('0x3f')](_0x40aa7c['model'],_0x40aa7c['query']);_0x189642['attributes']=_[_0x3419('0x3f')](_0x40aa7c[_0x3419('0x2d')],qs[_0x3419('0x31')](_0x2df247[_0x3419('0x2e')][_0x3419('0x31')]));_0x189642['attributes']=_0x189642[_0x3419('0x30')][_0x3419('0x32')]?_0x189642[_0x3419('0x30')]:_0x40aa7c[_0x3419('0x2d')];if(_0x2df247[_0x3419('0x2e')]['includeAll']){_0x189642[_0x3419('0x3a')]=[{'all':!![]}];}_0x189642=_[_0x3419('0x37')]({},_0x189642,_0x2df247['options']);return db[_0x3419('0x29')][_0x3419('0x40')](_0x189642)[_0x3419('0x22')](handleEntityNotFound(_0x14b92c,null))[_0x3419('0x22')](respondWithResult(_0x14b92c,null))['catch'](handleError(_0x14b92c,null));};exports[_0x3419('0x41')]=function(_0x4791a9,_0x469d43){return db[_0x3419('0x29')][_0x3419('0x41')](_0x4791a9['body'],{})[_0x3419('0x22')](respondWithResult(_0x469d43,0xc9))[_0x3419('0x3c')](handleError(_0x469d43,null));};exports['update']=function(_0x13e9dc,_0x477d7a){if(_0x13e9dc[_0x3419('0x42')]['id']){delete _0x13e9dc[_0x3419('0x42')]['id'];}return db['SalesforceAccount'][_0x3419('0x40')]({'where':{'id':_0x13e9dc[_0x3419('0x3d')]['id']}})[_0x3419('0x22')](handleEntityNotFound(_0x477d7a,null))[_0x3419('0x22')](saveUpdates(_0x13e9dc[_0x3419('0x42')],null))['then'](respondWithResult(_0x477d7a,null))[_0x3419('0x3c')](handleError(_0x477d7a,null));};exports[_0x3419('0x21')]=function(_0x4c99f1,_0xab7e4a){return db[_0x3419('0x29')][_0x3419('0x40')]({'where':{'id':_0x4c99f1['params']['id']}})[_0x3419('0x22')](handleEntityNotFound(_0xab7e4a,null))[_0x3419('0x22')](removeEntity(_0xab7e4a,null))[_0x3419('0x3c')](handleError(_0xab7e4a,null));};exports[_0x3419('0x43')]=function(_0x589d6b,_0x187d06,_0x52ab2b){var _0x3123fe={};var _0x4d1552={};var _0x2b2711;var _0x4a613e;return db['SalesforceAccount'][_0x3419('0x44')]({'where':{'id':_0x589d6b[_0x3419('0x3d')]['id']}})[_0x3419('0x22')](handleEntityNotFound(_0x187d06,null))[_0x3419('0x22')](function(_0xef89af){if(_0xef89af){_0x2b2711=_0xef89af;_0x4d1552[_0x3419('0x2d')]=_['keys'](db[_0x3419('0x45')][_0x3419('0x2a')]);_0x4d1552[_0x3419('0x2e')]=_[_0x3419('0x3e')](_0x589d6b['query']);_0x4d1552['filters']=_[_0x3419('0x3f')](_0x4d1552['model'],_0x4d1552[_0x3419('0x2e')]);_0x3123fe[_0x3419('0x30')]=_['intersection'](_0x4d1552[_0x3419('0x2d')],qs[_0x3419('0x31')](_0x589d6b[_0x3419('0x2e')][_0x3419('0x31')]));_0x3123fe[_0x3419('0x30')]=_0x3123fe[_0x3419('0x30')][_0x3419('0x32')]?_0x3123fe[_0x3419('0x30')]:_0x4d1552['model'];_0x3123fe['order']=qs[_0x3419('0x34')](_0x589d6b['query'][_0x3419('0x34')]);_0x3123fe[_0x3419('0x38')]=qs[_0x3419('0x2f')](_[_0x3419('0x35')](_0x589d6b[_0x3419('0x2e')],_0x4d1552[_0x3419('0x2f')]));if(_0x589d6b[_0x3419('0x2e')][_0x3419('0x36')]){_0x3123fe['where']=_[_0x3419('0x37')](_0x3123fe['where'],{'$or':_[_0x3419('0x28')](_0x3123fe['attributes'],function(_0x22383f){var _0xa86e5d={};_0xa86e5d[_0x22383f]={'$like':'%'+_0x589d6b[_0x3419('0x2e')][_0x3419('0x36')]+'%'};return _0xa86e5d;})});}_0x3123fe=_[_0x3419('0x37')]({},_0x3123fe,_0x589d6b['options']);return _0x2b2711['getConfigurations'](_0x3123fe);}})[_0x3419('0x22')](function(_0x575f42){if(_0x575f42){_0x4a613e=_0x575f42[_0x3419('0x32')];if(!_0x589d6b[_0x3419('0x2e')][_0x3419('0x33')]('nolimit')){_0x3123fe[_0x3419('0x1b')]=qs[_0x3419('0x1b')](_0x589d6b[_0x3419('0x2e')][_0x3419('0x1b')]);_0x3123fe['offset']=qs[_0x3419('0x18')](_0x589d6b[_0x3419('0x2e')][_0x3419('0x18')]);}return _0x2b2711['getConfigurations'](_0x3123fe);}})[_0x3419('0x22')](function(_0x423c15){if(_0x423c15){return _0x423c15?{'count':_0x4a613e,'rows':_0x423c15}:null;}})[_0x3419('0x22')](respondWithResult(_0x187d06,null))[_0x3419('0x3c')](handleError(_0x187d06,null));};exports[_0x3419('0x46')]=function(_0xca9a24,_0x262a48,_0x322254){if(_0xca9a24['body']['id']){delete _0xca9a24['body']['id'];}return db[_0x3419('0x29')][_0x3419('0x44')]({'where':{'id':_0xca9a24['params']['id']}})[_0x3419('0x22')](handleEntityNotFound(_0x262a48,null))[_0x3419('0x22')](function(_0x3be9ad){if(_0x3be9ad){_0xca9a24['body'][_0x3419('0x47')]=_0x3be9ad['id'];_0xca9a24[_0x3419('0x42')][_0x3419('0x48')]=integrations[_0x3419('0x49')](_0xca9a24[_0x3419('0x42')][_0x3419('0x4a')],_0xca9a24[_0x3419('0x42')][_0x3419('0x2c')]);_0xca9a24[_0x3419('0x42')]['Descriptions']=integrations[_0x3419('0x4b')](_0xca9a24[_0x3419('0x42')]['channel'],_0xca9a24[_0x3419('0x42')][_0x3419('0x2c')]);return db['SalesforceConfiguration']['create'](_0xca9a24[_0x3419('0x42')],{'include':[{'model':db[_0x3419('0x4c')],'as':_0x3419('0x48')},{'model':db[_0x3419('0x4c')],'as':_0x3419('0x4d')}]});}return null;})[_0x3419('0x22')](respondWithResult(_0x262a48,null))[_0x3419('0x3c')](handleError(_0x262a48,null));};exports[_0x3419('0x4e')]=function(_0x50af79,_0x5bc4ae,_0x57be9d){var _0x4c0f2c;var _0x51f082='';var _0x7f8b9c=_0x3419('0x4f');return db[_0x3419('0x29')][_0x3419('0x44')]({'where':{'id':_0x50af79[_0x3419('0x3d')]['id']},'attributes':['id',_0x3419('0x50'),'clientId',_0x3419('0x51'),_0x3419('0x52'),_0x3419('0x53'),_0x3419('0x54')]})['then'](handleEntityNotFound(_0x5bc4ae,null))['then'](function(_0x32cd25){if(_0x32cd25){_0x51f082=_0x32cd25[_0x3419('0x50')];var _0x45db87=_0x51f082[_0x3419('0x55')](-0x1);if(_0x45db87==='/'){_0x51f082=_0x51f082[_0x3419('0x56')](0x0,_0x51f082[_0x3419('0x57')](_0x45db87));}_0x4c0f2c=new jsforce[(_0x3419('0x58'))]({'oauth2':{'loginUrl':_0x51f082,'clientId':_0x32cd25[_0x3419('0x59')],'clientSecret':_0x32cd25[_0x3419('0x51')]}});return _0x4c0f2c[_0x3419('0x5a')](_0x32cd25[_0x3419('0x52')],_0x32cd25['password']['concat'](_0x32cd25['securityToken']));}})[_0x3419('0x22')](function(_0x45e015){if(_0x45e015){if(!_['isNil'](_0x50af79[_0x3419('0x2e')]['ticketType'])){_0x7f8b9c=_0x50af79[_0x3419('0x2e')][_0x3419('0x5b')];}return _0x4c0f2c[_0x3419('0x5c')](_0x7f8b9c)[_0x3419('0x5d')]();}})[_0x3419('0x22')](function(_0x591e5d){var _0x2181a5=[_0x3419('0x5e'),_0x3419('0x5f'),_0x3419('0x60'),_0x3419('0x61'),'Subject',_0x3419('0x62')];var _0x4a1c79=['string',_0x3419('0x63'),_0x3419('0x64'),_0x3419('0x65'),_0x3419('0x66'),_0x3419('0x67'),'phone'];if(_0x591e5d){_[_0x3419('0x68')](_0x591e5d['fields'],function(_0x70098d){return _0x2181a5[_0x3419('0x69')](_0x70098d[_0x3419('0x25')])||!_0x4a1c79[_0x3419('0x69')](_0x70098d[_0x3419('0x2c')]);});return{'count':_0x591e5d[_0x3419('0x31')][_0x3419('0x32')],'rows':_[_0x3419('0x28')](_0x591e5d['fields'],function(_0x151f8b){return{'id':_0x151f8b[_0x3419('0x25')],'name':_0x151f8b['label'],'custom':_0x151f8b['custom'],'options':_0x151f8b[_0x3419('0x6a')][_0x3419('0x32')]>0x0?_[_0x3419('0x28')](_0x151f8b[_0x3419('0x6a')],function(_0x4aa0a4){return{'name':_0x4aa0a4[_0x3419('0x6b')],'value':_0x4aa0a4['value']};}):_0x151f8b[_0x3419('0x2c')]==_0x3419('0x65')?[{'name':_0x3419('0x6c'),'value':'true'},{'name':_0x3419('0x6d'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x5bc4ae,null))[_0x3419('0x3c')](function(_0x6ade16){var _0x1794c2=_0x50af79[_0x3419('0x2e')][_0x3419('0x6e')]?0x1f4:_0x6ade16['statusCode']||0x1f4;logger['error'](_0x3419('0x6f'),'getFields',_0x1794c2,JSON[_0x3419('0x70')](_0x6ade16));delete _0x6ade16['name'];if(_0x1794c2===0x191){_0x1794c2=0x190;}_0x5bc4ae[_0x3419('0x16')](_0x1794c2)['send'](_0x50af79['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x6ade16[_0x3419('0x71')]}:_0x6ade16);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b5a6869..cf48500 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 _0x048c=['api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x048c,0xdb));var _0xc048=function(_0x5c6106,_0x5dbbe8){_0x5c6106=_0x5c6106-0x0;var _0x1ecd0a=_0x048c[_0x5c6106];return _0x1ecd0a;};'use strict';var _=require(_0xc048('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc048('0x1'));var moment=require('moment');var BPromise=require(_0xc048('0x2'));var rp=require(_0xc048('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc048('0x4'));var config=require(_0xc048('0x5'));var attributes=require(_0xc048('0x6'));var integrations=require(_0xc048('0x7'));module[_0xc048('0x8')]=function(_0x29b907,_0xbfb080){return _0x29b907[_0xc048('0x9')]('SalesforceAccount',attributes,{'tableName':_0xc048('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdee=['api','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger'];(function(_0x54972b,_0x33c686){var _0x256781=function(_0x1af263){while(--_0x1af263){_0x54972b['push'](_0x54972b['shift']());}};_0x256781(++_0x33c686);}(_0xbdee,0xc4));var _0xebde=function(_0x447a72,_0x514ae4){_0x447a72=_0x447a72-0x0;var _0x42f864=_0xbdee[_0x447a72];return _0x42f864;};'use strict';var _=require(_0xebde('0x0'));var util=require('util');var logger=require(_0xebde('0x1'))(_0xebde('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xebde('0x3'));var rimraf=require(_0xebde('0x4'));var config=require('../../config/environment');var attributes=require(_0xebde('0x5'));var integrations=require(_0xebde('0x6'));module[_0xebde('0x7')]=function(_0x3beec5,_0x29383b){return _0x3beec5[_0xebde('0x8')](_0xebde('0x9'),attributes,{'tableName':_0xebde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ad8b790..91a47c7 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 _0x7de8=['stringify','ShowSalesforceAccount','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','SalesforceAccount','findAll','options','where','include','map','model','attributes','info','GetSalesforceAccount'];(function(_0x28642b,_0x13d651){var _0x3a60b2=function(_0x113082){while(--_0x113082){_0x28642b['push'](_0x28642b['shift']());}};_0x3a60b2(++_0x13d651);}(_0x7de8,0x8b));var _0x87de=function(_0x4901be,_0x14aff8){_0x4901be=_0x4901be-0x0;var _0x5c7ec9=_0x7de8[_0x4901be];return _0x5c7ec9;};'use strict';var _=require(_0x87de('0x0'));var util=require(_0x87de('0x1'));var moment=require(_0x87de('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87de('0x3'));var db=require(_0x87de('0x4'))['db'];var utils=require(_0x87de('0x5'));var logger=require(_0x87de('0x6'))(_0x87de('0x7'));var config=require('../../config/environment');var jayson=require(_0x87de('0x8'));var client=jayson[_0x87de('0x9')][_0x87de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x531cc8,_0x552135,_0x364c1e){return new BPromise(function(_0x4bbf6a,_0x3eced5){return client[_0x87de('0xb')](_0x531cc8,_0x364c1e)[_0x87de('0xc')](function(_0x325f54){logger['info'](_0x87de('0xd'),_0x552135,_0x87de('0xe'));logger[_0x87de('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x552135,_0x87de('0xe'),JSON['stringify'](_0x325f54));if(_0x325f54['error']){if(_0x325f54[_0x87de('0x10')][_0x87de('0x11')]===0x1f4){logger[_0x87de('0x10')](_0x87de('0xd'),_0x552135,_0x325f54[_0x87de('0x10')][_0x87de('0x12')]);return _0x3eced5(_0x325f54['error'][_0x87de('0x12')]);}logger['error'](_0x87de('0xd'),_0x552135,_0x325f54[_0x87de('0x10')]['message']);return _0x4bbf6a(_0x325f54[_0x87de('0x10')]['message']);}else{logger['info'](_0x87de('0xd'),_0x552135,_0x87de('0xe'));_0x4bbf6a(_0x325f54[_0x87de('0x13')][_0x87de('0x12')]);}})[_0x87de('0x14')](function(_0x30061a){logger[_0x87de('0x10')](_0x87de('0xd'),_0x552135,_0x30061a);_0x3eced5(_0x30061a);});});}exports['GetSalesforceAccount']=function(_0x1bf69e){var _0x4ca1a6=this;return new Promise(function(_0x365c55,_0x351a79){return db[_0x87de('0x15')][_0x87de('0x16')]({'raw':_0x1bf69e[_0x87de('0x17')]?_0x1bf69e[_0x87de('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf69e['options']?_0x1bf69e[_0x87de('0x17')][_0x87de('0x18')]||null:null,'attributes':_0x1bf69e['options']?_0x1bf69e[_0x87de('0x17')]['attributes']||null:null,'limit':_0x1bf69e[_0x87de('0x17')]?_0x1bf69e['options']['limit']||null:null,'include':_0x1bf69e[_0x87de('0x17')]?_0x1bf69e[_0x87de('0x17')][_0x87de('0x19')]?_[_0x87de('0x1a')](_0x1bf69e['options'][_0x87de('0x19')],function(_0x4c5633){return{'model':db[_0x4c5633[_0x87de('0x1b')]],'as':_0x4c5633['as'],'attributes':_0x4c5633[_0x87de('0x1c')],'include':_0x4c5633[_0x87de('0x19')]?_[_0x87de('0x1a')](_0x4c5633[_0x87de('0x19')],function(_0x309ebd){return{'model':db[_0x309ebd[_0x87de('0x1b')]],'as':_0x309ebd['as'],'attributes':_0x309ebd['attributes'],'include':_0x309ebd['include']?_[_0x87de('0x1a')](_0x309ebd['include'],function(_0x51194c){return{'model':db[_0x51194c['model']],'as':_0x51194c['as'],'attributes':_0x51194c[_0x87de('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ff9db){logger[_0x87de('0x1d')](_0x87de('0x1e'),_0x1bf69e);logger[_0x87de('0xf')]('GetSalesforceAccount',_0x1bf69e,JSON[_0x87de('0x1f')](_0x4ff9db));_0x365c55(_0x4ff9db);})[_0x87de('0x14')](function(_0x48e898){logger[_0x87de('0x10')](_0x87de('0x1e'),_0x48e898[_0x87de('0x12')],_0x1bf69e);_0x351a79(_0x4ca1a6['error'](0x1f4,_0x48e898['message']));});});};exports[_0x87de('0x20')]=function(_0x386338){var _0x32db1f=this;return new Promise(function(_0x15d9ba,_0x54a2b1){return db[_0x87de('0x15')]['find']({'raw':_0x386338['options']?_0x386338[_0x87de('0x17')][_0x87de('0x21')]===undefined?!![]:![]:!![],'where':_0x386338[_0x87de('0x17')]?_0x386338['options'][_0x87de('0x18')]||null:null,'attributes':_0x386338[_0x87de('0x17')]?_0x386338[_0x87de('0x17')][_0x87de('0x1c')]||null:null,'include':_0x386338[_0x87de('0x17')]?_0x386338[_0x87de('0x17')]['include']?_[_0x87de('0x1a')](_0x386338[_0x87de('0x17')][_0x87de('0x19')],function(_0x12c2fa){return{'model':db[_0x12c2fa[_0x87de('0x1b')]],'as':_0x12c2fa['as'],'attributes':_0x12c2fa[_0x87de('0x1c')],'include':_0x12c2fa[_0x87de('0x19')]?_[_0x87de('0x1a')](_0x12c2fa[_0x87de('0x19')],function(_0x4e0683){return{'model':db[_0x4e0683[_0x87de('0x1b')]],'as':_0x4e0683['as'],'attributes':_0x4e0683[_0x87de('0x1c')],'include':_0x4e0683[_0x87de('0x19')]?_[_0x87de('0x1a')](_0x4e0683[_0x87de('0x19')],function(_0x340837){return{'model':db[_0x340837['model']],'as':_0x340837['as'],'attributes':_0x340837[_0x87de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x87de('0xc')](function(_0x4d4a39){logger[_0x87de('0x1d')](_0x87de('0x20'),_0x386338);logger[_0x87de('0xf')](_0x87de('0x20'),_0x386338,JSON['stringify'](_0x4d4a39));_0x15d9ba(_0x4d4a39);})[_0x87de('0x14')](function(_0x2bcccf){logger[_0x87de('0x10')](_0x87de('0x20'),_0x2bcccf[_0x87de('0x12')],_0x386338);_0x54a2b1(_0x32db1f[_0x87de('0x10')](0x1f4,_0x2bcccf['message']));});});}; \ No newline at end of file +var _0xe82d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','map','include','model','debug','ShowSalesforceAccount','find','raw','lodash','randomstring','ioredis'];(function(_0x4fa08c,_0x30cac4){var _0x7a920a=function(_0x213fd1){while(--_0x213fd1){_0x4fa08c['push'](_0x4fa08c['shift']());}};_0x7a920a(++_0x30cac4);}(_0xe82d,0xdd));var _0xde82=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xe82d[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xde82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde82('0x1'));var fs=require('fs');var Redis=require(_0xde82('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xde82('0x3'));var logger=require(_0xde82('0x4'))('rpc');var config=require(_0xde82('0x5'));var jayson=require(_0xde82('0x6'));var client=jayson[_0xde82('0x7')][_0xde82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65fe3a,_0x5840d0,_0x592dd3){return new BPromise(function(_0xd78a73,_0x5709e3){return client[_0xde82('0x9')](_0x65fe3a,_0x592dd3)[_0xde82('0xa')](function(_0x33746d){logger[_0xde82('0xb')](_0xde82('0xc'),_0x5840d0,_0xde82('0xd'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x5840d0,_0xde82('0xd'),JSON[_0xde82('0xe')](_0x33746d));if(_0x33746d[_0xde82('0xf')]){if(_0x33746d[_0xde82('0xf')]['code']===0x1f4){logger[_0xde82('0xf')](_0xde82('0xc'),_0x5840d0,_0x33746d[_0xde82('0xf')][_0xde82('0x10')]);return _0x5709e3(_0x33746d[_0xde82('0xf')][_0xde82('0x10')]);}logger['error'](_0xde82('0xc'),_0x5840d0,_0x33746d[_0xde82('0xf')][_0xde82('0x10')]);return _0xd78a73(_0x33746d[_0xde82('0xf')][_0xde82('0x10')]);}else{logger[_0xde82('0xb')](_0xde82('0xc'),_0x5840d0,'request\x20sent');_0xd78a73(_0x33746d[_0xde82('0x11')][_0xde82('0x10')]);}})[_0xde82('0x12')](function(_0x32435c){logger[_0xde82('0xf')](_0xde82('0xc'),_0x5840d0,_0x32435c);_0x5709e3(_0x32435c);});});}exports[_0xde82('0x13')]=function(_0x598d02){var _0x105b5b=this;return new Promise(function(_0xb315be,_0x5c0a14){return db[_0xde82('0x14')][_0xde82('0x15')]({'raw':_0x598d02['options']?_0x598d02[_0xde82('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x598d02[_0xde82('0x16')]?_0x598d02['options'][_0xde82('0x17')]||null:null,'attributes':_0x598d02[_0xde82('0x16')]?_0x598d02[_0xde82('0x16')][_0xde82('0x18')]||null:null,'limit':_0x598d02[_0xde82('0x16')]?_0x598d02[_0xde82('0x16')]['limit']||null:null,'include':_0x598d02[_0xde82('0x16')]?_0x598d02[_0xde82('0x16')]['include']?_[_0xde82('0x19')](_0x598d02['options'][_0xde82('0x1a')],function(_0x34af4e){return{'model':db[_0x34af4e[_0xde82('0x1b')]],'as':_0x34af4e['as'],'attributes':_0x34af4e['attributes'],'include':_0x34af4e[_0xde82('0x1a')]?_['map'](_0x34af4e[_0xde82('0x1a')],function(_0x5a357a){return{'model':db[_0x5a357a[_0xde82('0x1b')]],'as':_0x5a357a['as'],'attributes':_0x5a357a[_0xde82('0x18')],'include':_0x5a357a[_0xde82('0x1a')]?_[_0xde82('0x19')](_0x5a357a[_0xde82('0x1a')],function(_0xc8f43){return{'model':db[_0xc8f43[_0xde82('0x1b')]],'as':_0xc8f43['as'],'attributes':_0xc8f43[_0xde82('0x18')]};}):[]};}):[]};}):[]:[]})[_0xde82('0xa')](function(_0x8da37e){logger[_0xde82('0xb')](_0xde82('0x13'),_0x598d02);logger[_0xde82('0x1c')](_0xde82('0x13'),_0x598d02,JSON[_0xde82('0xe')](_0x8da37e));_0xb315be(_0x8da37e);})[_0xde82('0x12')](function(_0x33b865){logger[_0xde82('0xf')](_0xde82('0x13'),_0x33b865[_0xde82('0x10')],_0x598d02);_0x5c0a14(_0x105b5b['error'](0x1f4,_0x33b865[_0xde82('0x10')]));});});};exports[_0xde82('0x1d')]=function(_0x5af1c0){var _0x3e8ba1=this;return new Promise(function(_0x330cf4,_0x508bb5){return db[_0xde82('0x14')][_0xde82('0x1e')]({'raw':_0x5af1c0['options']?_0x5af1c0[_0xde82('0x16')][_0xde82('0x1f')]===undefined?!![]:![]:!![],'where':_0x5af1c0[_0xde82('0x16')]?_0x5af1c0[_0xde82('0x16')][_0xde82('0x17')]||null:null,'attributes':_0x5af1c0[_0xde82('0x16')]?_0x5af1c0[_0xde82('0x16')][_0xde82('0x18')]||null:null,'include':_0x5af1c0['options']?_0x5af1c0['options'][_0xde82('0x1a')]?_[_0xde82('0x19')](_0x5af1c0[_0xde82('0x16')][_0xde82('0x1a')],function(_0xaee4a8){return{'model':db[_0xaee4a8[_0xde82('0x1b')]],'as':_0xaee4a8['as'],'attributes':_0xaee4a8[_0xde82('0x18')],'include':_0xaee4a8['include']?_[_0xde82('0x19')](_0xaee4a8['include'],function(_0x217617){return{'model':db[_0x217617[_0xde82('0x1b')]],'as':_0x217617['as'],'attributes':_0x217617[_0xde82('0x18')],'include':_0x217617['include']?_[_0xde82('0x19')](_0x217617[_0xde82('0x1a')],function(_0x51cdd8){return{'model':db[_0x51cdd8[_0xde82('0x1b')]],'as':_0x51cdd8['as'],'attributes':_0x51cdd8[_0xde82('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c31cd){logger[_0xde82('0xb')](_0xde82('0x1d'),_0x5af1c0);logger['debug'](_0xde82('0x1d'),_0x5af1c0,JSON['stringify'](_0x5c31cd));_0x330cf4(_0x5c31cd);})[_0xde82('0x12')](function(_0x2d3b1a){logger[_0xde82('0xf')](_0xde82('0x1d'),_0x2d3b1a[_0xde82('0x10')],_0x5af1c0);_0x508bb5(_0x3e8ba1[_0xde82('0xf')](0x1f4,_0x2d3b1a[_0xde82('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 5bbad52..7277d8b 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2d71f2,_0x47c892){var _0x101970=function(_0x4f17f7){while(--_0x4f17f7){_0x2d71f2['push'](_0x2d71f2['shift']());}};_0x101970(++_0x47c892);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52e774,_0x57a2b5){_0x52e774=_0x52e774-0x0;var _0x505359=_0x5f2f[_0x52e774];return _0x505359;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x0b0e,0x187));var _0xe0b0=function(_0x85d5a8,_0x1977be){_0x85d5a8=_0x85d5a8-0x0;var _0x20479b=_0x0b0e[_0x85d5a8];return _0x20479b;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9852bc6..92a1970 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 _0x418b=['lead','account','nothing','sequelize','exports','STRING','ENUM','Case','contact_lead','contact'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0x418b,0x67));var _0xb418=function(_0x1f3f7e,_0x5e14a8){_0x1f3f7e=_0x1f3f7e-0x0;var _0x1558bf=_0x418b[_0x1f3f7e];return _0x1558bf;};'use strict';var Sequelize=require(_0xb418('0x0'));module[_0xb418('0x1')]={'name':{'type':Sequelize[_0xb418('0x2')]},'description':{'type':Sequelize[_0xb418('0x2')]},'ticketType':{'type':Sequelize[_0xb418('0x3')]('Task',_0xb418('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xb418('0x3')](_0xb418('0x5'),_0xb418('0x6'),_0xb418('0x7'),'account_contact_lead',_0xb418('0x8')),'defaultValue':_0xb418('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb418('0x9'),'contact',_0xb418('0x7'),_0xb418('0x8')),'defaultValue':_0xb418('0x7')},'leadId':{'type':Sequelize[_0xb418('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xb418('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xb418('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xb418('0x2')]}}; \ No newline at end of file +var _0xdbfe=['STRING','ENUM','Task','contact_lead','contact','account_contact_lead','account','lead'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xdbfe,0x1b0));var _0xedbf=function(_0xc058d,_0x296518){_0xc058d=_0xc058d-0x0;var _0x1ac7d5=_0xdbfe[_0xc058d];return _0x1ac7d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xedbf('0x0')]},'description':{'type':Sequelize[_0xedbf('0x0')]},'ticketType':{'type':Sequelize[_0xedbf('0x1')](_0xedbf('0x2'),'Case'),'defaultValue':_0xedbf('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xedbf('0x3'),_0xedbf('0x4'),'lead',_0xedbf('0x5'),_0xedbf('0x6')),'defaultValue':_0xedbf('0x3')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xedbf('0x4'),_0xedbf('0x7'),_0xedbf('0x6')),'defaultValue':_0xedbf('0x7')},'leadId':{'type':Sequelize[_0xedbf('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xedbf('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xedbf('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index daf0055..22c5bba 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 _0xaec5=['nolimit','order','sort','where','pick','filter','VIRTUAL','SalesforceConfiguration','includeAll','findAll','include','options','catch','create','body','find','params','findOne','keys','merge','getFields','getSubjects','SalesforceField','getDescriptions','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x24b87a,_0x3e1c7b){var _0x176b14=function(_0x5d3b40){while(--_0x5d3b40){_0x24b87a['push'](_0x24b87a['shift']());}};_0x176b14(++_0x3e1c7b);}(_0xaec5,0x67));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aec('0x0'));var zipdir=require(_0x5aec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5aec('0x2'));var moment=require(_0x5aec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5aec('0x4'));var util=require(_0x5aec('0x5'));var path=require(_0x5aec('0x6'));var sox=require(_0x5aec('0x7'));var csv=require(_0x5aec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5aec('0x9'));var _=require(_0x5aec('0xa'));var squel=require(_0x5aec('0xb'));var crypto=require(_0x5aec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5aec('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5aec('0xe'));var Papa=require(_0x5aec('0xf'));var Redis=require(_0x5aec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5aec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5aec('0x12'))(_0x5aec('0x13'));var utils=require(_0x5aec('0x14'));var config=require(_0x5aec('0x15'));var licenseUtil=require(_0x5aec('0x16'));var db=require(_0x5aec('0x17'))['db'];function respondWithStatusCode(_0x5c74b2,_0x49f9d2){_0x49f9d2=_0x49f9d2||0xcc;return function(_0x1c319f){if(_0x1c319f){return _0x5c74b2[_0x5aec('0x18')](_0x49f9d2);}return _0x5c74b2[_0x5aec('0x19')](_0x49f9d2)[_0x5aec('0x1a')]();};}function respondWithResult(_0x2e4099,_0x2a41bf){_0x2a41bf=_0x2a41bf||0xc8;return function(_0xbc44ab){if(_0xbc44ab){return _0x2e4099[_0x5aec('0x19')](_0x2a41bf)[_0x5aec('0x1b')](_0xbc44ab);}};}function respondWithFilteredResult(_0x5b19d3,_0x43c15e){return function(_0x25fab8){if(_0x25fab8){var _0x395a34=typeof _0x43c15e['offset']===_0x5aec('0x1c')&&typeof _0x43c15e[_0x5aec('0x1d')]===_0x5aec('0x1c');var _0x4441db=_0x25fab8['count'];var _0x425e93=_0x395a34?0x0:_0x43c15e[_0x5aec('0x1e')];var _0xc40772=_0x395a34?_0x25fab8[_0x5aec('0x1f')]:_0x43c15e[_0x5aec('0x1e')]+_0x43c15e['limit'];var _0xa498e3;if(_0xc40772>=_0x4441db){_0xc40772=_0x4441db;_0xa498e3=0xc8;}else{_0xa498e3=0xce;}_0x5b19d3[_0x5aec('0x19')](_0xa498e3);return _0x5b19d3[_0x5aec('0x20')](_0x5aec('0x21'),_0x425e93+'-'+_0xc40772+'/'+_0x4441db)['json'](_0x25fab8);}return null;};}function patchUpdates(_0x2557d0){return function(_0x5af25c){try{jsonpatch['apply'](_0x5af25c,_0x2557d0,!![]);}catch(_0x503ac8){return BPromise[_0x5aec('0x22')](_0x503ac8);}return _0x5af25c['save']();};}function saveUpdates(_0xc479de,_0x156f41){return function(_0x1cd0e5){if(_0x1cd0e5){return _0x1cd0e5[_0x5aec('0x23')](_0xc479de)[_0x5aec('0x24')](function(_0x3cc7d3){return _0x3cc7d3;});}return null;};}function removeEntity(_0x5be426,_0x390906){return function(_0x2597e5){if(_0x2597e5){return _0x2597e5[_0x5aec('0x25')]()['then'](function(){_0x5be426[_0x5aec('0x19')](0xcc)[_0x5aec('0x1a')]();});}};}function handleEntityNotFound(_0x5787c4,_0x16d1df){return function(_0x2770e5){if(!_0x2770e5){_0x5787c4[_0x5aec('0x18')](0x194);}return _0x2770e5;};}function handleError(_0x1d6d0e,_0x4ebaeb){_0x4ebaeb=_0x4ebaeb||0x1f4;return function(_0x18ff79){logger[_0x5aec('0x26')](_0x18ff79[_0x5aec('0x27')]);if(_0x18ff79[_0x5aec('0x28')]){delete _0x18ff79[_0x5aec('0x28')];}_0x1d6d0e[_0x5aec('0x19')](_0x4ebaeb)[_0x5aec('0x29')](_0x18ff79);};}exports[_0x5aec('0x2a')]=function(_0x2570c2,_0x481402){var _0xa18fa4={},_0x4c725d={},_0x402d07={'count':0x0,'rows':[]};var _0x26fc82=_[_0x5aec('0x2b')](db['SalesforceConfiguration'][_0x5aec('0x2c')],function(_0x2688d2){return{'name':_0x2688d2[_0x5aec('0x2d')],'type':_0x2688d2[_0x5aec('0x2e')]['key']};});_0x4c725d[_0x5aec('0x2f')]=_[_0x5aec('0x2b')](_0x26fc82,_0x5aec('0x28'));_0x4c725d[_0x5aec('0x30')]=_['keys'](_0x2570c2[_0x5aec('0x30')]);_0x4c725d[_0x5aec('0x31')]=_['intersection'](_0x4c725d['model'],_0x4c725d['query']);_0xa18fa4[_0x5aec('0x32')]=_[_0x5aec('0x33')](_0x4c725d[_0x5aec('0x2f')],qs[_0x5aec('0x34')](_0x2570c2[_0x5aec('0x30')][_0x5aec('0x34')]));_0xa18fa4['attributes']=_0xa18fa4[_0x5aec('0x32')][_0x5aec('0x35')]?_0xa18fa4[_0x5aec('0x32')]:_0x4c725d['model'];if(!_0x2570c2[_0x5aec('0x30')][_0x5aec('0x36')](_0x5aec('0x37'))){_0xa18fa4[_0x5aec('0x1d')]=qs[_0x5aec('0x1d')](_0x2570c2['query']['limit']);_0xa18fa4[_0x5aec('0x1e')]=qs[_0x5aec('0x1e')](_0x2570c2['query'][_0x5aec('0x1e')]);}_0xa18fa4[_0x5aec('0x38')]=qs['sort'](_0x2570c2[_0x5aec('0x30')][_0x5aec('0x39')]);_0xa18fa4[_0x5aec('0x3a')]=qs[_0x5aec('0x31')](_[_0x5aec('0x3b')](_0x2570c2[_0x5aec('0x30')],_0x4c725d[_0x5aec('0x31')]),_0x26fc82);if(_0x2570c2['query'][_0x5aec('0x3c')]){_0xa18fa4['where']=_['merge'](_0xa18fa4[_0x5aec('0x3a')],{'$or':_['map'](_0x26fc82,function(_0x2f2940){if(_0x2f2940['type']!==_0x5aec('0x3d')){var _0x34d85c={};_0x34d85c[_0x2f2940[_0x5aec('0x28')]]={'$like':'%'+_0x2570c2['query']['filter']+'%'};return _0x34d85c;}})});}_0xa18fa4=_['merge']({},_0xa18fa4,_0x2570c2['options']);var _0x11c728={'where':_0xa18fa4[_0x5aec('0x3a')]};return db[_0x5aec('0x3e')][_0x5aec('0x1f')](_0x11c728)[_0x5aec('0x24')](function(_0xa10604){_0x402d07[_0x5aec('0x1f')]=_0xa10604;if(_0x2570c2[_0x5aec('0x30')][_0x5aec('0x3f')]){_0xa18fa4['include']=[{'all':!![]}];}return db[_0x5aec('0x3e')][_0x5aec('0x40')](_0xa18fa4);})[_0x5aec('0x24')](function(_0x5abf4a){_0x402d07['rows']=_0x5abf4a;return _0x402d07;})[_0x5aec('0x24')](respondWithFilteredResult(_0x481402,_0xa18fa4))['catch'](handleError(_0x481402,null));};exports['show']=function(_0xf88190,_0x27790e){var _0xb6b8a1={'raw':![],'where':{'id':_0xf88190['params']['id']}},_0x84442={};_0x84442[_0x5aec('0x2f')]=_['keys'](db[_0x5aec('0x3e')][_0x5aec('0x2c')]);_0x84442['query']=_['keys'](_0xf88190[_0x5aec('0x30')]);_0x84442[_0x5aec('0x31')]=_[_0x5aec('0x33')](_0x84442[_0x5aec('0x2f')],_0x84442[_0x5aec('0x30')]);_0xb6b8a1['attributes']=_[_0x5aec('0x33')](_0x84442[_0x5aec('0x2f')],qs['fields'](_0xf88190[_0x5aec('0x30')]['fields']));_0xb6b8a1[_0x5aec('0x32')]=_0xb6b8a1[_0x5aec('0x32')][_0x5aec('0x35')]?_0xb6b8a1[_0x5aec('0x32')]:_0x84442['model'];if(_0xf88190[_0x5aec('0x30')][_0x5aec('0x3f')]){_0xb6b8a1[_0x5aec('0x41')]=[{'all':!![]}];}_0xb6b8a1=_['merge']({},_0xb6b8a1,_0xf88190[_0x5aec('0x42')]);return db[_0x5aec('0x3e')]['find'](_0xb6b8a1)[_0x5aec('0x24')](handleEntityNotFound(_0x27790e,null))[_0x5aec('0x24')](respondWithResult(_0x27790e,null))[_0x5aec('0x43')](handleError(_0x27790e,null));};exports[_0x5aec('0x44')]=function(_0x5143a7,_0x5412ae){return db[_0x5aec('0x3e')][_0x5aec('0x44')](_0x5143a7[_0x5aec('0x45')],{})[_0x5aec('0x24')](respondWithResult(_0x5412ae,0xc9))[_0x5aec('0x43')](handleError(_0x5412ae,null));};exports['update']=function(_0x6cbec4,_0x17bcd3){if(_0x6cbec4[_0x5aec('0x45')]['id']){delete _0x6cbec4['body']['id'];}return db[_0x5aec('0x3e')][_0x5aec('0x46')]({'where':{'id':_0x6cbec4['params']['id']}})['then'](handleEntityNotFound(_0x17bcd3,null))[_0x5aec('0x24')](saveUpdates(_0x6cbec4[_0x5aec('0x45')],null))[_0x5aec('0x24')](respondWithResult(_0x17bcd3,null))[_0x5aec('0x43')](handleError(_0x17bcd3,null));};exports[_0x5aec('0x25')]=function(_0x47386e,_0x3403a8){return db['SalesforceConfiguration'][_0x5aec('0x46')]({'where':{'id':_0x47386e[_0x5aec('0x47')]['id']}})['then'](handleEntityNotFound(_0x3403a8,null))[_0x5aec('0x24')](removeEntity(_0x3403a8,null))[_0x5aec('0x43')](handleError(_0x3403a8,null));};exports['getFields']=function(_0x404386,_0x4fc132,_0x3e3f82){var _0xd7e666={};var _0x214a7c={};var _0x24db30;var _0x3a9f6f;return db[_0x5aec('0x3e')][_0x5aec('0x48')]({'where':{'id':_0x404386[_0x5aec('0x47')]['id']}})[_0x5aec('0x24')](handleEntityNotFound(_0x4fc132,null))['then'](function(_0x3c4296){if(_0x3c4296){_0x24db30=_0x3c4296;_0x214a7c[_0x5aec('0x2f')]=_[_0x5aec('0x49')](db['SalesforceField'][_0x5aec('0x2c')]);_0x214a7c[_0x5aec('0x30')]=_[_0x5aec('0x49')](_0x404386[_0x5aec('0x30')]);_0x214a7c['filters']=_[_0x5aec('0x33')](_0x214a7c[_0x5aec('0x2f')],_0x214a7c['query']);_0xd7e666[_0x5aec('0x32')]=_[_0x5aec('0x33')](_0x214a7c[_0x5aec('0x2f')],qs[_0x5aec('0x34')](_0x404386[_0x5aec('0x30')]['fields']));_0xd7e666[_0x5aec('0x32')]=_0xd7e666[_0x5aec('0x32')][_0x5aec('0x35')]?_0xd7e666[_0x5aec('0x32')]:_0x214a7c['model'];_0xd7e666[_0x5aec('0x38')]=qs[_0x5aec('0x39')](_0x404386[_0x5aec('0x30')][_0x5aec('0x39')]);_0xd7e666[_0x5aec('0x3a')]=qs['filters'](_[_0x5aec('0x3b')](_0x404386[_0x5aec('0x30')],_0x214a7c['filters']));if(_0x404386[_0x5aec('0x30')][_0x5aec('0x3c')]){_0xd7e666[_0x5aec('0x3a')]=_[_0x5aec('0x4a')](_0xd7e666[_0x5aec('0x3a')],{'$or':_[_0x5aec('0x2b')](_0xd7e666['attributes'],function(_0x28f62e){var _0x41c912={};_0x41c912[_0x28f62e]={'$like':'%'+_0x404386[_0x5aec('0x30')][_0x5aec('0x3c')]+'%'};return _0x41c912;})});}_0xd7e666=_[_0x5aec('0x4a')]({},_0xd7e666,_0x404386[_0x5aec('0x42')]);return _0x24db30[_0x5aec('0x4b')](_0xd7e666);}})['then'](function(_0xd16220){if(_0xd16220){_0x3a9f6f=_0xd16220[_0x5aec('0x35')];if(!_0x404386[_0x5aec('0x30')][_0x5aec('0x36')](_0x5aec('0x37'))){_0xd7e666['limit']=qs['limit'](_0x404386[_0x5aec('0x30')][_0x5aec('0x1d')]);_0xd7e666[_0x5aec('0x1e')]=qs[_0x5aec('0x1e')](_0x404386[_0x5aec('0x30')][_0x5aec('0x1e')]);}return _0x24db30[_0x5aec('0x4b')](_0xd7e666);}})[_0x5aec('0x24')](function(_0x3664a6){if(_0x3664a6){return _0x3664a6?{'count':_0x3a9f6f,'rows':_0x3664a6}:null;}})[_0x5aec('0x24')](respondWithResult(_0x4fc132,null))[_0x5aec('0x43')](handleError(_0x4fc132,null));};exports[_0x5aec('0x4c')]=function(_0x37cb8a,_0x5820a2,_0x114be5){var _0x396ba7={};var _0x6fd59d={};var _0x6e1775;var _0x270914;return db[_0x5aec('0x3e')][_0x5aec('0x48')]({'where':{'id':_0x37cb8a[_0x5aec('0x47')]['id']}})[_0x5aec('0x24')](handleEntityNotFound(_0x5820a2,null))[_0x5aec('0x24')](function(_0x2b3e0c){if(_0x2b3e0c){_0x6e1775=_0x2b3e0c;_0x6fd59d[_0x5aec('0x2f')]=_[_0x5aec('0x49')](db[_0x5aec('0x4d')]['rawAttributes']);_0x6fd59d[_0x5aec('0x30')]=_['keys'](_0x37cb8a[_0x5aec('0x30')]);_0x6fd59d[_0x5aec('0x31')]=_[_0x5aec('0x33')](_0x6fd59d[_0x5aec('0x2f')],_0x6fd59d[_0x5aec('0x30')]);_0x396ba7['attributes']=_['intersection'](_0x6fd59d['model'],qs[_0x5aec('0x34')](_0x37cb8a['query']['fields']));_0x396ba7[_0x5aec('0x32')]=_0x396ba7[_0x5aec('0x32')][_0x5aec('0x35')]?_0x396ba7[_0x5aec('0x32')]:_0x6fd59d['model'];_0x396ba7[_0x5aec('0x38')]=qs[_0x5aec('0x39')](_0x37cb8a[_0x5aec('0x30')][_0x5aec('0x39')]);_0x396ba7[_0x5aec('0x3a')]=qs[_0x5aec('0x31')](_[_0x5aec('0x3b')](_0x37cb8a[_0x5aec('0x30')],_0x6fd59d[_0x5aec('0x31')]));if(_0x37cb8a[_0x5aec('0x30')][_0x5aec('0x3c')]){_0x396ba7[_0x5aec('0x3a')]=_[_0x5aec('0x4a')](_0x396ba7[_0x5aec('0x3a')],{'$or':_[_0x5aec('0x2b')](_0x396ba7[_0x5aec('0x32')],function(_0x3fe334){var _0x28ad12={};_0x28ad12[_0x3fe334]={'$like':'%'+_0x37cb8a['query'][_0x5aec('0x3c')]+'%'};return _0x28ad12;})});}_0x396ba7=_[_0x5aec('0x4a')]({},_0x396ba7,_0x37cb8a['options']);return _0x6e1775[_0x5aec('0x4c')](_0x396ba7);}})[_0x5aec('0x24')](function(_0x4a3802){if(_0x4a3802){_0x270914=_0x4a3802[_0x5aec('0x35')];if(!_0x37cb8a[_0x5aec('0x30')]['hasOwnProperty']('nolimit')){_0x396ba7['limit']=qs[_0x5aec('0x1d')](_0x37cb8a[_0x5aec('0x30')]['limit']);_0x396ba7['offset']=qs[_0x5aec('0x1e')](_0x37cb8a['query'][_0x5aec('0x1e')]);}return _0x6e1775[_0x5aec('0x4c')](_0x396ba7);}})[_0x5aec('0x24')](function(_0x335ffa){if(_0x335ffa){return _0x335ffa?{'count':_0x270914,'rows':_0x335ffa}:null;}})['then'](respondWithResult(_0x5820a2,null))[_0x5aec('0x43')](handleError(_0x5820a2,null));};exports['getDescriptions']=function(_0x253228,_0x22171c,_0x3e2391){var _0x22e6d2={};var _0x58381c={};var _0x4185ea;var _0x362275;return db[_0x5aec('0x3e')]['findOne']({'where':{'id':_0x253228['params']['id']}})[_0x5aec('0x24')](handleEntityNotFound(_0x22171c,null))['then'](function(_0x445e03){if(_0x445e03){_0x4185ea=_0x445e03;_0x58381c[_0x5aec('0x2f')]=_[_0x5aec('0x49')](db[_0x5aec('0x4d')][_0x5aec('0x2c')]);_0x58381c[_0x5aec('0x30')]=_['keys'](_0x253228[_0x5aec('0x30')]);_0x58381c[_0x5aec('0x31')]=_[_0x5aec('0x33')](_0x58381c[_0x5aec('0x2f')],_0x58381c['query']);_0x22e6d2['attributes']=_[_0x5aec('0x33')](_0x58381c['model'],qs['fields'](_0x253228[_0x5aec('0x30')]['fields']));_0x22e6d2[_0x5aec('0x32')]=_0x22e6d2['attributes'][_0x5aec('0x35')]?_0x22e6d2[_0x5aec('0x32')]:_0x58381c['model'];_0x22e6d2[_0x5aec('0x38')]=qs['sort'](_0x253228[_0x5aec('0x30')]['sort']);_0x22e6d2['where']=qs[_0x5aec('0x31')](_[_0x5aec('0x3b')](_0x253228[_0x5aec('0x30')],_0x58381c[_0x5aec('0x31')]));if(_0x253228[_0x5aec('0x30')][_0x5aec('0x3c')]){_0x22e6d2[_0x5aec('0x3a')]=_[_0x5aec('0x4a')](_0x22e6d2[_0x5aec('0x3a')],{'$or':_[_0x5aec('0x2b')](_0x22e6d2[_0x5aec('0x32')],function(_0x289191){var _0x6758b5={};_0x6758b5[_0x289191]={'$like':'%'+_0x253228[_0x5aec('0x30')][_0x5aec('0x3c')]+'%'};return _0x6758b5;})});}_0x22e6d2=_['merge']({},_0x22e6d2,_0x253228[_0x5aec('0x42')]);return _0x4185ea[_0x5aec('0x4e')](_0x22e6d2);}})[_0x5aec('0x24')](function(_0x11efb1){if(_0x11efb1){_0x362275=_0x11efb1[_0x5aec('0x35')];if(!_0x253228[_0x5aec('0x30')]['hasOwnProperty'](_0x5aec('0x37'))){_0x22e6d2[_0x5aec('0x1d')]=qs[_0x5aec('0x1d')](_0x253228[_0x5aec('0x30')][_0x5aec('0x1d')]);_0x22e6d2[_0x5aec('0x1e')]=qs['offset'](_0x253228[_0x5aec('0x30')][_0x5aec('0x1e')]);}return _0x4185ea[_0x5aec('0x4e')](_0x22e6d2);}})[_0x5aec('0x24')](function(_0x2e470b){if(_0x2e470b){return _0x2e470b?{'count':_0x362275,'rows':_0x2e470b}:null;}})['then'](respondWithResult(_0x22171c,null))[_0x5aec('0x43')](handleError(_0x22171c,null));}; \ No newline at end of file +var _0x3e2a=['nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','find','params','SalesforceField','order','getFields','getSubjects','findOne'];(function(_0x5bf50d,_0x2cc5d2){var _0x4c706c=function(_0x3f8c97){while(--_0x3f8c97){_0x5bf50d['push'](_0x5bf50d['shift']());}};_0x4c706c(++_0x2cc5d2);}(_0x3e2a,0xa0));var _0xa3e2=function(_0x12b855,_0x260471){_0x12b855=_0x12b855-0x0;var _0x4046c8=_0x3e2a[_0x12b855];return _0x4046c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3e2('0x0'));var zipdir=require(_0xa3e2('0x1'));var jsonpatch=require(_0xa3e2('0x2'));var rp=require(_0xa3e2('0x3'));var moment=require(_0xa3e2('0x4'));var BPromise=require(_0xa3e2('0x5'));var Mustache=require(_0xa3e2('0x6'));var util=require(_0xa3e2('0x7'));var path=require('path');var sox=require(_0xa3e2('0x8'));var csv=require(_0xa3e2('0x9'));var ejs=require(_0xa3e2('0xa'));var fs=require('fs');var fs_extra=require(_0xa3e2('0xb'));var _=require(_0xa3e2('0xc'));var squel=require(_0xa3e2('0xd'));var crypto=require(_0xa3e2('0xe'));var jsforce=require(_0xa3e2('0xf'));var deskjs=require(_0xa3e2('0x10'));var toCsv=require(_0xa3e2('0x9'));var querystring=require(_0xa3e2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa3e2('0x12'));var hardwareService=require(_0xa3e2('0x13'));var logger=require('../../config/logger')(_0xa3e2('0x14'));var utils=require(_0xa3e2('0x15'));var config=require(_0xa3e2('0x16'));var licenseUtil=require(_0xa3e2('0x17'));var db=require(_0xa3e2('0x18'))['db'];function respondWithStatusCode(_0x443359,_0x51260d){_0x51260d=_0x51260d||0xcc;return function(_0x2de4ba){if(_0x2de4ba){return _0x443359[_0xa3e2('0x19')](_0x51260d);}return _0x443359[_0xa3e2('0x1a')](_0x51260d)[_0xa3e2('0x1b')]();};}function respondWithResult(_0x31a575,_0x146cef){_0x146cef=_0x146cef||0xc8;return function(_0x232932){if(_0x232932){return _0x31a575[_0xa3e2('0x1a')](_0x146cef)['json'](_0x232932);}};}function respondWithFilteredResult(_0x1eafdc,_0x128db6){return function(_0x21f612){if(_0x21f612){var _0x41135f=typeof _0x128db6[_0xa3e2('0x1c')]===_0xa3e2('0x1d')&&typeof _0x128db6[_0xa3e2('0x1e')]===_0xa3e2('0x1d');var _0x5e50ce=_0x21f612[_0xa3e2('0x1f')];var _0x4b20d1=_0x41135f?0x0:_0x128db6[_0xa3e2('0x1c')];var _0x386e74=_0x41135f?_0x21f612[_0xa3e2('0x1f')]:_0x128db6[_0xa3e2('0x1c')]+_0x128db6['limit'];var _0x365261;if(_0x386e74>=_0x5e50ce){_0x386e74=_0x5e50ce;_0x365261=0xc8;}else{_0x365261=0xce;}_0x1eafdc[_0xa3e2('0x1a')](_0x365261);return _0x1eafdc[_0xa3e2('0x20')]('Content-Range',_0x4b20d1+'-'+_0x386e74+'/'+_0x5e50ce)[_0xa3e2('0x21')](_0x21f612);}return null;};}function patchUpdates(_0x4d9ba9){return function(_0xe718a3){try{jsonpatch[_0xa3e2('0x22')](_0xe718a3,_0x4d9ba9,!![]);}catch(_0x1195c7){return BPromise[_0xa3e2('0x23')](_0x1195c7);}return _0xe718a3['save']();};}function saveUpdates(_0x315736,_0x6440ef){return function(_0x2b98bb){if(_0x2b98bb){return _0x2b98bb[_0xa3e2('0x24')](_0x315736)['then'](function(_0xabda38){return _0xabda38;});}return null;};}function removeEntity(_0x4064e8,_0x4d5034){return function(_0x5c39e9){if(_0x5c39e9){return _0x5c39e9[_0xa3e2('0x25')]()[_0xa3e2('0x26')](function(){_0x4064e8[_0xa3e2('0x1a')](0xcc)[_0xa3e2('0x1b')]();});}};}function handleEntityNotFound(_0x1b47a8,_0x52fe1d){return function(_0x4c77fa){if(!_0x4c77fa){_0x1b47a8[_0xa3e2('0x19')](0x194);}return _0x4c77fa;};}function handleError(_0x1ce131,_0x1d68c9){_0x1d68c9=_0x1d68c9||0x1f4;return function(_0x4af2bd){logger['error'](_0x4af2bd[_0xa3e2('0x27')]);if(_0x4af2bd[_0xa3e2('0x28')]){delete _0x4af2bd['name'];}_0x1ce131[_0xa3e2('0x1a')](_0x1d68c9)['send'](_0x4af2bd);};}exports[_0xa3e2('0x29')]=function(_0x3dc4b1,_0x43b732){var _0x26ec76={},_0x2d4930={},_0x4fdd52={'count':0x0,'rows':[]};var _0x115af5=_[_0xa3e2('0x2a')](db[_0xa3e2('0x2b')][_0xa3e2('0x2c')],function(_0x246b37){return{'name':_0x246b37[_0xa3e2('0x2d')],'type':_0x246b37[_0xa3e2('0x2e')]['key']};});_0x2d4930['model']=_['map'](_0x115af5,_0xa3e2('0x28'));_0x2d4930[_0xa3e2('0x2f')]=_[_0xa3e2('0x30')](_0x3dc4b1['query']);_0x2d4930['filters']=_[_0xa3e2('0x31')](_0x2d4930[_0xa3e2('0x32')],_0x2d4930[_0xa3e2('0x2f')]);_0x26ec76[_0xa3e2('0x33')]=_[_0xa3e2('0x31')](_0x2d4930[_0xa3e2('0x32')],qs[_0xa3e2('0x34')](_0x3dc4b1[_0xa3e2('0x2f')]['fields']));_0x26ec76['attributes']=_0x26ec76[_0xa3e2('0x33')][_0xa3e2('0x35')]?_0x26ec76[_0xa3e2('0x33')]:_0x2d4930[_0xa3e2('0x32')];if(!_0x3dc4b1[_0xa3e2('0x2f')][_0xa3e2('0x36')]('nolimit')){_0x26ec76[_0xa3e2('0x1e')]=qs[_0xa3e2('0x1e')](_0x3dc4b1['query'][_0xa3e2('0x1e')]);_0x26ec76['offset']=qs[_0xa3e2('0x1c')](_0x3dc4b1[_0xa3e2('0x2f')][_0xa3e2('0x1c')]);}_0x26ec76['order']=qs['sort'](_0x3dc4b1[_0xa3e2('0x2f')][_0xa3e2('0x37')]);_0x26ec76[_0xa3e2('0x38')]=qs[_0xa3e2('0x39')](_[_0xa3e2('0x3a')](_0x3dc4b1[_0xa3e2('0x2f')],_0x2d4930[_0xa3e2('0x39')]),_0x115af5);if(_0x3dc4b1[_0xa3e2('0x2f')][_0xa3e2('0x3b')]){_0x26ec76[_0xa3e2('0x38')]=_[_0xa3e2('0x3c')](_0x26ec76['where'],{'$or':_[_0xa3e2('0x2a')](_0x115af5,function(_0x38f01e){if(_0x38f01e['type']!==_0xa3e2('0x3d')){var _0x4e9e72={};_0x4e9e72[_0x38f01e[_0xa3e2('0x28')]]={'$like':'%'+_0x3dc4b1['query'][_0xa3e2('0x3b')]+'%'};return _0x4e9e72;}})});}_0x26ec76=_[_0xa3e2('0x3c')]({},_0x26ec76,_0x3dc4b1[_0xa3e2('0x3e')]);var _0x8bce10={'where':_0x26ec76[_0xa3e2('0x38')]};return db['SalesforceConfiguration'][_0xa3e2('0x1f')](_0x8bce10)[_0xa3e2('0x26')](function(_0x33cc4d){_0x4fdd52[_0xa3e2('0x1f')]=_0x33cc4d;if(_0x3dc4b1[_0xa3e2('0x2f')][_0xa3e2('0x3f')]){_0x26ec76[_0xa3e2('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa3e2('0x41')](_0x26ec76);})[_0xa3e2('0x26')](function(_0x3ff2f5){_0x4fdd52['rows']=_0x3ff2f5;return _0x4fdd52;})[_0xa3e2('0x26')](respondWithFilteredResult(_0x43b732,_0x26ec76))['catch'](handleError(_0x43b732,null));};exports[_0xa3e2('0x42')]=function(_0x48da3c,_0x3bd545){var _0x8e5666={'raw':![],'where':{'id':_0x48da3c['params']['id']}},_0x4a5ccf={};_0x4a5ccf[_0xa3e2('0x32')]=_['keys'](db[_0xa3e2('0x2b')][_0xa3e2('0x2c')]);_0x4a5ccf[_0xa3e2('0x2f')]=_[_0xa3e2('0x30')](_0x48da3c[_0xa3e2('0x2f')]);_0x4a5ccf[_0xa3e2('0x39')]=_[_0xa3e2('0x31')](_0x4a5ccf[_0xa3e2('0x32')],_0x4a5ccf[_0xa3e2('0x2f')]);_0x8e5666[_0xa3e2('0x33')]=_['intersection'](_0x4a5ccf[_0xa3e2('0x32')],qs[_0xa3e2('0x34')](_0x48da3c['query'][_0xa3e2('0x34')]));_0x8e5666[_0xa3e2('0x33')]=_0x8e5666[_0xa3e2('0x33')]['length']?_0x8e5666[_0xa3e2('0x33')]:_0x4a5ccf[_0xa3e2('0x32')];if(_0x48da3c[_0xa3e2('0x2f')][_0xa3e2('0x3f')]){_0x8e5666[_0xa3e2('0x40')]=[{'all':!![]}];}_0x8e5666=_[_0xa3e2('0x3c')]({},_0x8e5666,_0x48da3c[_0xa3e2('0x3e')]);return db['SalesforceConfiguration']['find'](_0x8e5666)['then'](handleEntityNotFound(_0x3bd545,null))[_0xa3e2('0x26')](respondWithResult(_0x3bd545,null))[_0xa3e2('0x43')](handleError(_0x3bd545,null));};exports[_0xa3e2('0x44')]=function(_0x425606,_0x3f3204){return db['SalesforceConfiguration'][_0xa3e2('0x44')](_0x425606[_0xa3e2('0x45')],{})['then'](respondWithResult(_0x3f3204,0xc9))[_0xa3e2('0x43')](handleError(_0x3f3204,null));};exports['update']=function(_0x5c450e,_0x361287){if(_0x5c450e[_0xa3e2('0x45')]['id']){delete _0x5c450e[_0xa3e2('0x45')]['id'];}return db[_0xa3e2('0x2b')][_0xa3e2('0x46')]({'where':{'id':_0x5c450e[_0xa3e2('0x47')]['id']}})[_0xa3e2('0x26')](handleEntityNotFound(_0x361287,null))[_0xa3e2('0x26')](saveUpdates(_0x5c450e[_0xa3e2('0x45')],null))['then'](respondWithResult(_0x361287,null))[_0xa3e2('0x43')](handleError(_0x361287,null));};exports['destroy']=function(_0x33d224,_0x45f015){return db['SalesforceConfiguration'][_0xa3e2('0x46')]({'where':{'id':_0x33d224[_0xa3e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x45f015,null))[_0xa3e2('0x26')](removeEntity(_0x45f015,null))[_0xa3e2('0x43')](handleError(_0x45f015,null));};exports['getFields']=function(_0x2c83af,_0x197d7a,_0x461e2a){var _0x574e9a={};var _0x53b11d={};var _0x2e7022;var _0x1d284a;return db[_0xa3e2('0x2b')]['findOne']({'where':{'id':_0x2c83af[_0xa3e2('0x47')]['id']}})[_0xa3e2('0x26')](handleEntityNotFound(_0x197d7a,null))[_0xa3e2('0x26')](function(_0x2b881b){if(_0x2b881b){_0x2e7022=_0x2b881b;_0x53b11d['model']=_[_0xa3e2('0x30')](db[_0xa3e2('0x48')][_0xa3e2('0x2c')]);_0x53b11d[_0xa3e2('0x2f')]=_[_0xa3e2('0x30')](_0x2c83af[_0xa3e2('0x2f')]);_0x53b11d[_0xa3e2('0x39')]=_[_0xa3e2('0x31')](_0x53b11d[_0xa3e2('0x32')],_0x53b11d['query']);_0x574e9a['attributes']=_['intersection'](_0x53b11d[_0xa3e2('0x32')],qs[_0xa3e2('0x34')](_0x2c83af[_0xa3e2('0x2f')]['fields']));_0x574e9a[_0xa3e2('0x33')]=_0x574e9a[_0xa3e2('0x33')][_0xa3e2('0x35')]?_0x574e9a[_0xa3e2('0x33')]:_0x53b11d['model'];_0x574e9a[_0xa3e2('0x49')]=qs[_0xa3e2('0x37')](_0x2c83af[_0xa3e2('0x2f')][_0xa3e2('0x37')]);_0x574e9a[_0xa3e2('0x38')]=qs['filters'](_[_0xa3e2('0x3a')](_0x2c83af[_0xa3e2('0x2f')],_0x53b11d['filters']));if(_0x2c83af[_0xa3e2('0x2f')][_0xa3e2('0x3b')]){_0x574e9a[_0xa3e2('0x38')]=_[_0xa3e2('0x3c')](_0x574e9a['where'],{'$or':_['map'](_0x574e9a[_0xa3e2('0x33')],function(_0x284e25){var _0x49a7b9={};_0x49a7b9[_0x284e25]={'$like':'%'+_0x2c83af[_0xa3e2('0x2f')]['filter']+'%'};return _0x49a7b9;})});}_0x574e9a=_[_0xa3e2('0x3c')]({},_0x574e9a,_0x2c83af[_0xa3e2('0x3e')]);return _0x2e7022[_0xa3e2('0x4a')](_0x574e9a);}})[_0xa3e2('0x26')](function(_0x2156b4){if(_0x2156b4){_0x1d284a=_0x2156b4[_0xa3e2('0x35')];if(!_0x2c83af[_0xa3e2('0x2f')][_0xa3e2('0x36')]('nolimit')){_0x574e9a[_0xa3e2('0x1e')]=qs[_0xa3e2('0x1e')](_0x2c83af[_0xa3e2('0x2f')][_0xa3e2('0x1e')]);_0x574e9a['offset']=qs[_0xa3e2('0x1c')](_0x2c83af[_0xa3e2('0x2f')]['offset']);}return _0x2e7022[_0xa3e2('0x4a')](_0x574e9a);}})[_0xa3e2('0x26')](function(_0x1fd9ad){if(_0x1fd9ad){return _0x1fd9ad?{'count':_0x1d284a,'rows':_0x1fd9ad}:null;}})['then'](respondWithResult(_0x197d7a,null))['catch'](handleError(_0x197d7a,null));};exports[_0xa3e2('0x4b')]=function(_0x32243d,_0x463d02,_0x12d552){var _0x613906={};var _0x4a7d53={};var _0x4cfc73;var _0x434ac8;return db[_0xa3e2('0x2b')][_0xa3e2('0x4c')]({'where':{'id':_0x32243d['params']['id']}})[_0xa3e2('0x26')](handleEntityNotFound(_0x463d02,null))['then'](function(_0xf36e3a){if(_0xf36e3a){_0x4cfc73=_0xf36e3a;_0x4a7d53[_0xa3e2('0x32')]=_['keys'](db[_0xa3e2('0x48')][_0xa3e2('0x2c')]);_0x4a7d53['query']=_[_0xa3e2('0x30')](_0x32243d[_0xa3e2('0x2f')]);_0x4a7d53[_0xa3e2('0x39')]=_['intersection'](_0x4a7d53[_0xa3e2('0x32')],_0x4a7d53[_0xa3e2('0x2f')]);_0x613906[_0xa3e2('0x33')]=_[_0xa3e2('0x31')](_0x4a7d53[_0xa3e2('0x32')],qs['fields'](_0x32243d[_0xa3e2('0x2f')]['fields']));_0x613906[_0xa3e2('0x33')]=_0x613906[_0xa3e2('0x33')][_0xa3e2('0x35')]?_0x613906[_0xa3e2('0x33')]:_0x4a7d53['model'];_0x613906['order']=qs[_0xa3e2('0x37')](_0x32243d[_0xa3e2('0x2f')]['sort']);_0x613906['where']=qs[_0xa3e2('0x39')](_[_0xa3e2('0x3a')](_0x32243d[_0xa3e2('0x2f')],_0x4a7d53[_0xa3e2('0x39')]));if(_0x32243d[_0xa3e2('0x2f')]['filter']){_0x613906['where']=_[_0xa3e2('0x3c')](_0x613906['where'],{'$or':_[_0xa3e2('0x2a')](_0x613906['attributes'],function(_0x5baec7){var _0x49bcc1={};_0x49bcc1[_0x5baec7]={'$like':'%'+_0x32243d['query'][_0xa3e2('0x3b')]+'%'};return _0x49bcc1;})});}_0x613906=_[_0xa3e2('0x3c')]({},_0x613906,_0x32243d[_0xa3e2('0x3e')]);return _0x4cfc73['getSubjects'](_0x613906);}})[_0xa3e2('0x26')](function(_0x3d7a1b){if(_0x3d7a1b){_0x434ac8=_0x3d7a1b[_0xa3e2('0x35')];if(!_0x32243d['query']['hasOwnProperty'](_0xa3e2('0x4d'))){_0x613906['limit']=qs[_0xa3e2('0x1e')](_0x32243d[_0xa3e2('0x2f')][_0xa3e2('0x1e')]);_0x613906[_0xa3e2('0x1c')]=qs['offset'](_0x32243d[_0xa3e2('0x2f')][_0xa3e2('0x1c')]);}return _0x4cfc73[_0xa3e2('0x4b')](_0x613906);}})[_0xa3e2('0x26')](function(_0x1bd5f0){if(_0x1bd5f0){return _0x1bd5f0?{'count':_0x434ac8,'rows':_0x1bd5f0}:null;}})[_0xa3e2('0x26')](respondWithResult(_0x463d02,null))[_0xa3e2('0x43')](handleError(_0x463d02,null));};exports[_0xa3e2('0x4e')]=function(_0x4d55fe,_0x5e6a87,_0x56822c){var _0x54019f={};var _0x47f593={};var _0x49472b;var _0x2d8c1c;return db['SalesforceConfiguration'][_0xa3e2('0x4c')]({'where':{'id':_0x4d55fe[_0xa3e2('0x47')]['id']}})[_0xa3e2('0x26')](handleEntityNotFound(_0x5e6a87,null))[_0xa3e2('0x26')](function(_0x1be7a6){if(_0x1be7a6){_0x49472b=_0x1be7a6;_0x47f593[_0xa3e2('0x32')]=_[_0xa3e2('0x30')](db[_0xa3e2('0x48')][_0xa3e2('0x2c')]);_0x47f593[_0xa3e2('0x2f')]=_[_0xa3e2('0x30')](_0x4d55fe[_0xa3e2('0x2f')]);_0x47f593[_0xa3e2('0x39')]=_[_0xa3e2('0x31')](_0x47f593['model'],_0x47f593[_0xa3e2('0x2f')]);_0x54019f['attributes']=_[_0xa3e2('0x31')](_0x47f593[_0xa3e2('0x32')],qs['fields'](_0x4d55fe[_0xa3e2('0x2f')][_0xa3e2('0x34')]));_0x54019f[_0xa3e2('0x33')]=_0x54019f[_0xa3e2('0x33')]['length']?_0x54019f['attributes']:_0x47f593[_0xa3e2('0x32')];_0x54019f[_0xa3e2('0x49')]=qs['sort'](_0x4d55fe[_0xa3e2('0x2f')]['sort']);_0x54019f['where']=qs[_0xa3e2('0x39')](_['pick'](_0x4d55fe[_0xa3e2('0x2f')],_0x47f593[_0xa3e2('0x39')]));if(_0x4d55fe[_0xa3e2('0x2f')][_0xa3e2('0x3b')]){_0x54019f['where']=_[_0xa3e2('0x3c')](_0x54019f[_0xa3e2('0x38')],{'$or':_['map'](_0x54019f[_0xa3e2('0x33')],function(_0x2f6af9){var _0x1fac91={};_0x1fac91[_0x2f6af9]={'$like':'%'+_0x4d55fe[_0xa3e2('0x2f')]['filter']+'%'};return _0x1fac91;})});}_0x54019f=_[_0xa3e2('0x3c')]({},_0x54019f,_0x4d55fe[_0xa3e2('0x3e')]);return _0x49472b['getDescriptions'](_0x54019f);}})[_0xa3e2('0x26')](function(_0x539666){if(_0x539666){_0x2d8c1c=_0x539666[_0xa3e2('0x35')];if(!_0x4d55fe[_0xa3e2('0x2f')][_0xa3e2('0x36')]('nolimit')){_0x54019f[_0xa3e2('0x1e')]=qs[_0xa3e2('0x1e')](_0x4d55fe['query'][_0xa3e2('0x1e')]);_0x54019f['offset']=qs[_0xa3e2('0x1c')](_0x4d55fe[_0xa3e2('0x2f')][_0xa3e2('0x1c')]);}return _0x49472b[_0xa3e2('0x4e')](_0x54019f);}})[_0xa3e2('0x26')](function(_0x334e39){if(_0x334e39){return _0x334e39?{'count':_0x2d8c1c,'rows':_0x334e39}:null;}})['then'](respondWithResult(_0x5e6a87,null))[_0xa3e2('0x43')](handleError(_0x5e6a87,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 027db25..1f57c47 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 _0x2fe1=['../../config/environment','define','SalesforceConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xe3d4a2,_0x5dbf95){var _0x131efb=function(_0x90cd0){while(--_0x90cd0){_0xe3d4a2['push'](_0xe3d4a2['shift']());}};_0x131efb(++_0x5dbf95);}(_0x2fe1,0x1b0));var _0x12fe=function(_0x5ce3b6,_0x149a62){_0x5ce3b6=_0x5ce3b6-0x0;var _0xbba1d0=_0x2fe1[_0x5ce3b6];return _0xbba1d0;};'use strict';var _=require(_0x12fe('0x0'));var util=require(_0x12fe('0x1'));var logger=require('../../config/logger')(_0x12fe('0x2'));var moment=require(_0x12fe('0x3'));var BPromise=require(_0x12fe('0x4'));var rp=require(_0x12fe('0x5'));var fs=require('fs');var path=require(_0x12fe('0x6'));var rimraf=require(_0x12fe('0x7'));var config=require(_0x12fe('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x54624d,_0x5aecee){return _0x54624d[_0x12fe('0x9')](_0x12fe('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x184c=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x450a92,_0x8b2ba){var _0x5bbff0=function(_0xbe410f){while(--_0xbe410f){_0x450a92['push'](_0x450a92['shift']());}};_0x5bbff0(++_0x8b2ba);}(_0x184c,0x6b));var _0xc184=function(_0x17982c,_0x5952e8){_0x17982c=_0x17982c-0x0;var _0x50c2d2=_0x184c[_0x17982c];return _0x50c2d2;};'use strict';var _=require(_0xc184('0x0'));var util=require(_0xc184('0x1'));var logger=require(_0xc184('0x2'))(_0xc184('0x3'));var moment=require(_0xc184('0x4'));var BPromise=require(_0xc184('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc184('0x6'));var rimraf=require(_0xc184('0x7'));var config=require('../../config/environment');var attributes=require(_0xc184('0x8'));module[_0xc184('0x9')]=function(_0x23aec9,_0x29ca81){return _0x23aec9[_0xc184('0xa')](_0xc184('0xb'),attributes,{'tableName':_0xc184('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 4cdfe07..6113510 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 _0x2cb6=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x585700,_0x5eaa85){var _0x57eebb=function(_0x98ee7d){while(--_0x98ee7d){_0x585700['push'](_0x585700['shift']());}};_0x57eebb(++_0x5eaa85);}(_0x2cb6,0x191));var _0x62cb=function(_0xccfb6,_0x1a6baf){_0xccfb6=_0xccfb6-0x0;var _0x3b47cf=_0x2cb6[_0xccfb6];return _0x3b47cf;};'use strict';var _=require(_0x62cb('0x0'));var util=require(_0x62cb('0x1'));var moment=require('moment');var BPromise=require(_0x62cb('0x2'));var rs=require(_0x62cb('0x3'));var fs=require('fs');var Redis=require(_0x62cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x62cb('0x5'));var logger=require(_0x62cb('0x6'))(_0x62cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x62cb('0x8'));var client=jayson[_0x62cb('0x9')][_0x62cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbd2ab0,_0x47ce7f,_0x60d512){return new BPromise(function(_0xf53ecc,_0x2231d0){return client[_0x62cb('0xb')](_0xbd2ab0,_0x60d512)[_0x62cb('0xc')](function(_0xee1e4){logger[_0x62cb('0xd')](_0x62cb('0xe'),_0x47ce7f,_0x62cb('0xf'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x47ce7f,'request\x20sent',JSON['stringify'](_0xee1e4));if(_0xee1e4['error']){if(_0xee1e4[_0x62cb('0x10')][_0x62cb('0x11')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x47ce7f,_0xee1e4[_0x62cb('0x10')]['message']);return _0x2231d0(_0xee1e4[_0x62cb('0x10')][_0x62cb('0x12')]);}logger[_0x62cb('0x10')](_0x62cb('0xe'),_0x47ce7f,_0xee1e4[_0x62cb('0x10')][_0x62cb('0x12')]);return _0xf53ecc(_0xee1e4[_0x62cb('0x10')]['message']);}else{logger['info'](_0x62cb('0xe'),_0x47ce7f,_0x62cb('0xf'));_0xf53ecc(_0xee1e4[_0x62cb('0x13')][_0x62cb('0x12')]);}})['catch'](function(_0x46f188){logger[_0x62cb('0x10')](_0x62cb('0xe'),_0x47ce7f,_0x46f188);_0x2231d0(_0x46f188);});});} \ No newline at end of file +var _0xc6a1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','info','catch','util'];(function(_0x271741,_0xb0df1a){var _0x270181=function(_0x26ca4e){while(--_0x26ca4e){_0x271741['push'](_0x271741['shift']());}};_0x270181(++_0xb0df1a);}(_0xc6a1,0x176));var _0x1c6a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc6a1[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x1c6a('0x0'));var moment=require(_0x1c6a('0x1'));var BPromise=require(_0x1c6a('0x2'));var rs=require(_0x1c6a('0x3'));var fs=require('fs');var Redis=require(_0x1c6a('0x4'));var db=require(_0x1c6a('0x5'))['db'];var utils=require(_0x1c6a('0x6'));var logger=require(_0x1c6a('0x7'))(_0x1c6a('0x8'));var config=require(_0x1c6a('0x9'));var jayson=require(_0x1c6a('0xa'));var client=jayson[_0x1c6a('0xb')][_0x1c6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x241b24,_0x551bfb,_0x443829){return new BPromise(function(_0x23e519,_0x2680bd){return client[_0x1c6a('0xd')](_0x241b24,_0x443829)[_0x1c6a('0xe')](function(_0x26582f){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x551bfb,_0x1c6a('0xf'));logger[_0x1c6a('0x10')](_0x1c6a('0x11'),_0x551bfb,'request\x20sent',JSON[_0x1c6a('0x12')](_0x26582f));if(_0x26582f['error']){if(_0x26582f[_0x1c6a('0x13')][_0x1c6a('0x14')]===0x1f4){logger[_0x1c6a('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x551bfb,_0x26582f[_0x1c6a('0x13')][_0x1c6a('0x15')]);return _0x2680bd(_0x26582f[_0x1c6a('0x13')][_0x1c6a('0x15')]);}logger[_0x1c6a('0x13')](_0x1c6a('0x16'),_0x551bfb,_0x26582f['error']['message']);return _0x23e519(_0x26582f['error']['message']);}else{logger[_0x1c6a('0x17')](_0x1c6a('0x16'),_0x551bfb,'request\x20sent');_0x23e519(_0x26582f['result'][_0x1c6a('0x15')]);}})[_0x1c6a('0x18')](function(_0x42a623){logger[_0x1c6a('0x13')](_0x1c6a('0x16'),_0x551bfb,_0x42a623);_0x2680bd(_0x42a623);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7a44d59..7e3da66 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 _0x78fd=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0xfdcb02,_0x1b0b3a){var _0x489e56=function(_0xb268bb){while(--_0xb268bb){_0xfdcb02['push'](_0xfdcb02['shift']());}};_0x489e56(++_0x1b0b3a);}(_0x78fd,0x89));var _0xd78f=function(_0x5aa819,_0x583e04){_0x5aa819=_0x5aa819-0x0;var _0x9a31e5=_0x78fd[_0x5aa819];return _0x9a31e5;};'use strict';var multer=require('multer');var util=require(_0xd78f('0x0'));var path=require(_0xd78f('0x1'));var timeout=require('connect-timeout');var express=require(_0xd78f('0x2'));var router=express[_0xd78f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd78f('0x4'));var interaction=require(_0xd78f('0x5'));var config=require(_0xd78f('0x6'));var controller=require(_0xd78f('0x7'));router[_0xd78f('0x8')]('/',auth['isAuthenticated'](),controller[_0xd78f('0x9')]);router[_0xd78f('0x8')](_0xd78f('0xa'),auth[_0xd78f('0xb')](),controller[_0xd78f('0xc')]);router[_0xd78f('0xd')]('/',auth['isAuthenticated'](),controller[_0xd78f('0xe')]);router[_0xd78f('0xf')](_0xd78f('0xa'),auth[_0xd78f('0xb')](),controller[_0xd78f('0x10')]);router[_0xd78f('0x11')](_0xd78f('0xa'),auth[_0xd78f('0xb')](),controller[_0xd78f('0x12')]);module[_0xd78f('0x13')]=router; \ No newline at end of file +var _0xdefb=['../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','create','put','exports','path','Router','fs-extra'];(function(_0x11d488,_0xeca1c0){var _0x13a366=function(_0x145f1c){while(--_0x145f1c){_0x11d488['push'](_0x11d488['shift']());}};_0x13a366(++_0xeca1c0);}(_0xdefb,0x101));var _0xbdef=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xdefb[_0x403115];return _0x596ef3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbdef('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbdef('0x1')]();var fs_extra=require(_0xbdef('0x2'));var auth=require(_0xbdef('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbdef('0x4'));var controller=require(_0xbdef('0x5'));router[_0xbdef('0x6')]('/',auth[_0xbdef('0x7')](),controller[_0xbdef('0x8')]);router[_0xbdef('0x6')](_0xbdef('0x9'),auth[_0xbdef('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbdef('0xa')]);router[_0xbdef('0xb')](_0xbdef('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbdef('0x9'),auth[_0xbdef('0x7')](),controller['destroy']);module[_0xbdef('0xc')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 2a3b5bd..5268a43 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 _0x88f1=['exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x353552,_0x205fca){var _0x4a4556=function(_0x5c707f){while(--_0x5c707f){_0x353552['push'](_0x353552['shift']());}};_0x4a4556(++_0x205fca);}(_0x88f1,0x126));var _0x188f=function(_0x457d76,_0xfb3a9e){_0x457d76=_0x457d76-0x0;var _0xbde2e6=_0x88f1[_0x457d76];return _0xbde2e6;};'use strict';var Sequelize=require('sequelize');module[_0x188f('0x0')]={'type':{'type':Sequelize[_0x188f('0x1')](_0x188f('0x2'),_0x188f('0x3'),'customVariable',_0x188f('0x4'),'picklist'),'defaultValue':_0x188f('0x2')},'content':{'type':Sequelize[_0x188f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x188f('0x1')](_0x188f('0x2'),_0x188f('0x3'),_0x188f('0x6'))},'keyContent':{'type':Sequelize[_0x188f('0x5')]},'idField':{'type':Sequelize[_0x188f('0x5')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3316=['exports','ENUM','string','variable','picklist','STRING','customVariable','sequelize'];(function(_0x19c92f,_0x382dfd){var _0x2e7420=function(_0x38f936){while(--_0x38f936){_0x19c92f['push'](_0x19c92f['shift']());}};_0x2e7420(++_0x382dfd);}(_0x3316,0x10f));var _0x6331=function(_0x4c15e7,_0x4ad7f5){_0x4c15e7=_0x4c15e7-0x0;var _0x1f119a=_0x3316[_0x4c15e7];return _0x1f119a;};'use strict';var Sequelize=require(_0x6331('0x0'));module[_0x6331('0x1')]={'type':{'type':Sequelize[_0x6331('0x2')](_0x6331('0x3'),_0x6331('0x4'),'customVariable','keyValue',_0x6331('0x5')),'defaultValue':_0x6331('0x3')},'content':{'type':Sequelize[_0x6331('0x6')]},'key':{'type':Sequelize[_0x6331('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6331('0x3'),_0x6331('0x4'),_0x6331('0x7'))},'keyContent':{'type':Sequelize[_0x6331('0x6')]},'idField':{'type':Sequelize[_0x6331('0x6')]},'variableName':{'type':Sequelize[_0x6331('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5bb0be7..6b6d459 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 _0x45c1=['moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x599f49,_0x17262e){var _0x13610a=function(_0x3317c1){while(--_0x3317c1){_0x599f49['push'](_0x599f49['shift']());}};_0x13610a(++_0x17262e);}(_0x45c1,0x1c4));var _0x145c=function(_0xcb1965,_0x4099cb){_0xcb1965=_0xcb1965-0x0;var _0xc89d54=_0x45c1[_0xcb1965];return _0xc89d54;};'use strict';var emlformat=require(_0x145c('0x0'));var rimraf=require(_0x145c('0x1'));var zipdir=require(_0x145c('0x2'));var jsonpatch=require(_0x145c('0x3'));var rp=require('request-promise');var moment=require(_0x145c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x145c('0x5'));var util=require(_0x145c('0x6'));var path=require('path');var sox=require(_0x145c('0x7'));var csv=require(_0x145c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x145c('0x9'));var _=require(_0x145c('0xa'));var squel=require(_0x145c('0xb'));var crypto=require(_0x145c('0xc'));var jsforce=require(_0x145c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x145c('0x8'));var querystring=require(_0x145c('0xe'));var Papa=require('papaparse');var Redis=require(_0x145c('0xf'));var authService=require(_0x145c('0x10'));var qs=require(_0x145c('0x11'));var as=require(_0x145c('0x12'));var hardwareService=require(_0x145c('0x13'));var logger=require(_0x145c('0x14'))(_0x145c('0x15'));var utils=require(_0x145c('0x16'));var config=require(_0x145c('0x17'));var licenseUtil=require(_0x145c('0x18'));var db=require(_0x145c('0x19'))['db'];function respondWithStatusCode(_0x7306ef,_0x19116){_0x19116=_0x19116||0xcc;return function(_0x1d99d9){if(_0x1d99d9){return _0x7306ef[_0x145c('0x1a')](_0x19116);}return _0x7306ef[_0x145c('0x1b')](_0x19116)[_0x145c('0x1c')]();};}function respondWithResult(_0x532aa8,_0x586fba){_0x586fba=_0x586fba||0xc8;return function(_0x5a26b8){if(_0x5a26b8){return _0x532aa8[_0x145c('0x1b')](_0x586fba)[_0x145c('0x1d')](_0x5a26b8);}};}function respondWithFilteredResult(_0x42635c,_0x52323e){return function(_0x36d0e3){if(_0x36d0e3){var _0xb873dc=typeof _0x52323e[_0x145c('0x1e')]===_0x145c('0x1f')&&typeof _0x52323e[_0x145c('0x20')]==='undefined';var _0x2411e0=_0x36d0e3[_0x145c('0x21')];var _0x378115=_0xb873dc?0x0:_0x52323e[_0x145c('0x1e')];var _0x5b2a6f=_0xb873dc?_0x36d0e3[_0x145c('0x21')]:_0x52323e[_0x145c('0x1e')]+_0x52323e[_0x145c('0x20')];var _0x56a46c;if(_0x5b2a6f>=_0x2411e0){_0x5b2a6f=_0x2411e0;_0x56a46c=0xc8;}else{_0x56a46c=0xce;}_0x42635c[_0x145c('0x1b')](_0x56a46c);return _0x42635c[_0x145c('0x22')]('Content-Range',_0x378115+'-'+_0x5b2a6f+'/'+_0x2411e0)[_0x145c('0x1d')](_0x36d0e3);}return null;};}function patchUpdates(_0x35ea8c){return function(_0x202a51){try{jsonpatch[_0x145c('0x23')](_0x202a51,_0x35ea8c,!![]);}catch(_0xebee95){return BPromise[_0x145c('0x24')](_0xebee95);}return _0x202a51[_0x145c('0x25')]();};}function saveUpdates(_0x4508c9,_0x819274){return function(_0xead160){if(_0xead160){return _0xead160[_0x145c('0x26')](_0x4508c9)[_0x145c('0x27')](function(_0x455b23){return _0x455b23;});}return null;};}function removeEntity(_0x473652,_0x4b1236){return function(_0x4c4fb3){if(_0x4c4fb3){return _0x4c4fb3['destroy']()[_0x145c('0x27')](function(){_0x473652[_0x145c('0x1b')](0xcc)[_0x145c('0x1c')]();});}};}function handleEntityNotFound(_0x1daff7,_0xd03319){return function(_0x304801){if(!_0x304801){_0x1daff7[_0x145c('0x1a')](0x194);}return _0x304801;};}function handleError(_0x488faf,_0x137853){_0x137853=_0x137853||0x1f4;return function(_0x376671){logger['error'](_0x376671[_0x145c('0x28')]);if(_0x376671[_0x145c('0x29')]){delete _0x376671[_0x145c('0x29')];}_0x488faf[_0x145c('0x1b')](_0x137853)[_0x145c('0x2a')](_0x376671);};}exports[_0x145c('0x2b')]=function(_0x187950,_0x18862a){var _0x146ab4={},_0x407878={},_0x26c3e3={'count':0x0,'rows':[]};var _0x3fae01=_[_0x145c('0x2c')](db[_0x145c('0x2d')][_0x145c('0x2e')],function(_0x2953dc){return{'name':_0x2953dc[_0x145c('0x2f')],'type':_0x2953dc[_0x145c('0x30')]['key']};});_0x407878[_0x145c('0x31')]=_[_0x145c('0x2c')](_0x3fae01,_0x145c('0x29'));_0x407878[_0x145c('0x32')]=_[_0x145c('0x33')](_0x187950['query']);_0x407878[_0x145c('0x34')]=_[_0x145c('0x35')](_0x407878['model'],_0x407878[_0x145c('0x32')]);_0x146ab4[_0x145c('0x36')]=_[_0x145c('0x35')](_0x407878[_0x145c('0x31')],qs['fields'](_0x187950['query'][_0x145c('0x37')]));_0x146ab4[_0x145c('0x36')]=_0x146ab4['attributes'][_0x145c('0x38')]?_0x146ab4[_0x145c('0x36')]:_0x407878['model'];if(!_0x187950['query'][_0x145c('0x39')](_0x145c('0x3a'))){_0x146ab4[_0x145c('0x20')]=qs[_0x145c('0x20')](_0x187950[_0x145c('0x32')][_0x145c('0x20')]);_0x146ab4[_0x145c('0x1e')]=qs['offset'](_0x187950['query'][_0x145c('0x1e')]);}_0x146ab4[_0x145c('0x3b')]=qs['sort'](_0x187950[_0x145c('0x32')]['sort']);_0x146ab4['where']=qs[_0x145c('0x34')](_[_0x145c('0x3c')](_0x187950['query'],_0x407878[_0x145c('0x34')]),_0x3fae01);if(_0x187950[_0x145c('0x32')][_0x145c('0x3d')]){_0x146ab4[_0x145c('0x3e')]=_[_0x145c('0x3f')](_0x146ab4['where'],{'$or':_[_0x145c('0x2c')](_0x3fae01,function(_0x451563){if(_0x451563[_0x145c('0x30')]!==_0x145c('0x40')){var _0x1fb5d4={};_0x1fb5d4[_0x451563[_0x145c('0x29')]]={'$like':'%'+_0x187950[_0x145c('0x32')]['filter']+'%'};return _0x1fb5d4;}})});}_0x146ab4=_[_0x145c('0x3f')]({},_0x146ab4,_0x187950['options']);var _0x43c531={'where':_0x146ab4['where']};return db[_0x145c('0x2d')]['count'](_0x43c531)['then'](function(_0xdc008b){_0x26c3e3['count']=_0xdc008b;if(_0x187950[_0x145c('0x32')][_0x145c('0x41')]){_0x146ab4[_0x145c('0x42')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x146ab4);})['then'](function(_0x3a5c9b){_0x26c3e3[_0x145c('0x43')]=_0x3a5c9b;return _0x26c3e3;})[_0x145c('0x27')](respondWithFilteredResult(_0x18862a,_0x146ab4))[_0x145c('0x44')](handleError(_0x18862a,null));};exports[_0x145c('0x45')]=function(_0x1d1823,_0x29982f){var _0x378f28={'raw':!![],'where':{'id':_0x1d1823[_0x145c('0x46')]['id']}},_0x5a9766={};_0x5a9766['model']=_[_0x145c('0x33')](db[_0x145c('0x2d')][_0x145c('0x2e')]);_0x5a9766[_0x145c('0x32')]=_[_0x145c('0x33')](_0x1d1823['query']);_0x5a9766['filters']=_[_0x145c('0x35')](_0x5a9766[_0x145c('0x31')],_0x5a9766[_0x145c('0x32')]);_0x378f28[_0x145c('0x36')]=_[_0x145c('0x35')](_0x5a9766[_0x145c('0x31')],qs[_0x145c('0x37')](_0x1d1823['query']['fields']));_0x378f28[_0x145c('0x36')]=_0x378f28[_0x145c('0x36')][_0x145c('0x38')]?_0x378f28['attributes']:_0x5a9766[_0x145c('0x31')];if(_0x1d1823[_0x145c('0x32')][_0x145c('0x41')]){_0x378f28[_0x145c('0x42')]=[{'all':!![]}];}_0x378f28=_[_0x145c('0x3f')]({},_0x378f28,_0x1d1823[_0x145c('0x47')]);return db[_0x145c('0x2d')][_0x145c('0x48')](_0x378f28)[_0x145c('0x27')](handleEntityNotFound(_0x29982f,null))['then'](respondWithResult(_0x29982f,null))[_0x145c('0x44')](handleError(_0x29982f,null));};exports[_0x145c('0x49')]=function(_0x1d7317,_0x3ccc92){return db[_0x145c('0x2d')][_0x145c('0x49')](_0x1d7317[_0x145c('0x4a')],{})[_0x145c('0x27')](respondWithResult(_0x3ccc92,0xc9))[_0x145c('0x44')](handleError(_0x3ccc92,null));};exports[_0x145c('0x26')]=function(_0x17ebf9,_0x352e6c){if(_0x17ebf9['body']['id']){delete _0x17ebf9[_0x145c('0x4a')]['id'];}return db[_0x145c('0x2d')]['find']({'where':{'id':_0x17ebf9[_0x145c('0x46')]['id']}})[_0x145c('0x27')](handleEntityNotFound(_0x352e6c,null))[_0x145c('0x27')](saveUpdates(_0x17ebf9['body'],null))[_0x145c('0x27')](respondWithResult(_0x352e6c,null))[_0x145c('0x44')](handleError(_0x352e6c,null));};exports[_0x145c('0x4b')]=function(_0x55ca4a,_0x30fc77){return db[_0x145c('0x2d')][_0x145c('0x48')]({'where':{'id':_0x55ca4a[_0x145c('0x46')]['id']}})[_0x145c('0x27')](handleEntityNotFound(_0x30fc77,null))[_0x145c('0x27')](removeEntity(_0x30fc77,null))[_0x145c('0x44')](handleError(_0x30fc77,null));}; \ No newline at end of file +var _0x53cc=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','then','catch','show','params','intersection','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra'];(function(_0x41afc5,_0x40a681){var _0x1f0b14=function(_0x3f03d3){while(--_0x3f03d3){_0x41afc5['push'](_0x41afc5['shift']());}};_0x1f0b14(++_0x40a681);}(_0x53cc,0x89));var _0xc53c=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x53cc[_0x12833b];return _0x3acad3;};'use strict';var emlformat=require(_0xc53c('0x0'));var rimraf=require(_0xc53c('0x1'));var zipdir=require(_0xc53c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc53c('0x3'));var moment=require(_0xc53c('0x4'));var BPromise=require(_0xc53c('0x5'));var Mustache=require('mustache');var util=require(_0xc53c('0x6'));var path=require('path');var sox=require(_0xc53c('0x7'));var csv=require(_0xc53c('0x8'));var ejs=require(_0xc53c('0x9'));var fs=require('fs');var fs_extra=require(_0xc53c('0xa'));var _=require(_0xc53c('0xb'));var squel=require(_0xc53c('0xc'));var crypto=require(_0xc53c('0xd'));var jsforce=require(_0xc53c('0xe'));var deskjs=require(_0xc53c('0xf'));var toCsv=require(_0xc53c('0x8'));var querystring=require(_0xc53c('0x10'));var Papa=require(_0xc53c('0x11'));var Redis=require(_0xc53c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc53c('0x13'));var hardwareService=require(_0xc53c('0x14'));var logger=require(_0xc53c('0x15'))(_0xc53c('0x16'));var utils=require(_0xc53c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc53c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x556171,_0x10ec95){_0x10ec95=_0x10ec95||0xcc;return function(_0x26b379){if(_0x26b379){return _0x556171[_0xc53c('0x19')](_0x10ec95);}return _0x556171[_0xc53c('0x1a')](_0x10ec95)['end']();};}function respondWithResult(_0x15bb41,_0x35bf5c){_0x35bf5c=_0x35bf5c||0xc8;return function(_0x319472){if(_0x319472){return _0x15bb41[_0xc53c('0x1a')](_0x35bf5c)[_0xc53c('0x1b')](_0x319472);}};}function respondWithFilteredResult(_0x51993d,_0x400d81){return function(_0x4a3382){if(_0x4a3382){var _0x13fea8=typeof _0x400d81[_0xc53c('0x1c')]===_0xc53c('0x1d')&&typeof _0x400d81[_0xc53c('0x1e')]===_0xc53c('0x1d');var _0x32c3ab=_0x4a3382['count'];var _0x5354d5=_0x13fea8?0x0:_0x400d81['offset'];var _0x5c8ae6=_0x13fea8?_0x4a3382[_0xc53c('0x1f')]:_0x400d81['offset']+_0x400d81[_0xc53c('0x1e')];var _0x572143;if(_0x5c8ae6>=_0x32c3ab){_0x5c8ae6=_0x32c3ab;_0x572143=0xc8;}else{_0x572143=0xce;}_0x51993d[_0xc53c('0x1a')](_0x572143);return _0x51993d[_0xc53c('0x20')](_0xc53c('0x21'),_0x5354d5+'-'+_0x5c8ae6+'/'+_0x32c3ab)[_0xc53c('0x1b')](_0x4a3382);}return null;};}function patchUpdates(_0x1afb1f){return function(_0x2b4165){try{jsonpatch[_0xc53c('0x22')](_0x2b4165,_0x1afb1f,!![]);}catch(_0x9f6a6c){return BPromise[_0xc53c('0x23')](_0x9f6a6c);}return _0x2b4165['save']();};}function saveUpdates(_0x3d6d94,_0x5bad6d){return function(_0x545070){if(_0x545070){return _0x545070[_0xc53c('0x24')](_0x3d6d94)['then'](function(_0xa6f74d){return _0xa6f74d;});}return null;};}function removeEntity(_0x4d11f4,_0x776916){return function(_0x5ca195){if(_0x5ca195){return _0x5ca195[_0xc53c('0x25')]()['then'](function(){_0x4d11f4[_0xc53c('0x1a')](0xcc)[_0xc53c('0x26')]();});}};}function handleEntityNotFound(_0x2171ea,_0x127cfa){return function(_0x3e1f9a){if(!_0x3e1f9a){_0x2171ea[_0xc53c('0x19')](0x194);}return _0x3e1f9a;};}function handleError(_0x3bb612,_0x582f98){_0x582f98=_0x582f98||0x1f4;return function(_0x516489){logger[_0xc53c('0x27')](_0x516489['stack']);if(_0x516489[_0xc53c('0x28')]){delete _0x516489[_0xc53c('0x28')];}_0x3bb612[_0xc53c('0x1a')](_0x582f98)[_0xc53c('0x29')](_0x516489);};}exports[_0xc53c('0x2a')]=function(_0x2f0bba,_0x4c0dd9){var _0x18395b={},_0x409498={},_0x4b73ae={'count':0x0,'rows':[]};var _0x14ec18=_[_0xc53c('0x2b')](db[_0xc53c('0x2c')][_0xc53c('0x2d')],function(_0x1416fe){return{'name':_0x1416fe[_0xc53c('0x2e')],'type':_0x1416fe[_0xc53c('0x2f')][_0xc53c('0x30')]};});_0x409498['model']=_[_0xc53c('0x2b')](_0x14ec18,_0xc53c('0x28'));_0x409498[_0xc53c('0x31')]=_[_0xc53c('0x32')](_0x2f0bba['query']);_0x409498[_0xc53c('0x33')]=_['intersection'](_0x409498[_0xc53c('0x34')],_0x409498[_0xc53c('0x31')]);_0x18395b[_0xc53c('0x35')]=_['intersection'](_0x409498[_0xc53c('0x34')],qs[_0xc53c('0x36')](_0x2f0bba[_0xc53c('0x31')][_0xc53c('0x36')]));_0x18395b[_0xc53c('0x35')]=_0x18395b[_0xc53c('0x35')][_0xc53c('0x37')]?_0x18395b[_0xc53c('0x35')]:_0x409498[_0xc53c('0x34')];if(!_0x2f0bba[_0xc53c('0x31')][_0xc53c('0x38')](_0xc53c('0x39'))){_0x18395b['limit']=qs['limit'](_0x2f0bba[_0xc53c('0x31')]['limit']);_0x18395b[_0xc53c('0x1c')]=qs['offset'](_0x2f0bba[_0xc53c('0x31')][_0xc53c('0x1c')]);}_0x18395b['order']=qs[_0xc53c('0x3a')](_0x2f0bba[_0xc53c('0x31')][_0xc53c('0x3a')]);_0x18395b[_0xc53c('0x3b')]=qs[_0xc53c('0x33')](_[_0xc53c('0x3c')](_0x2f0bba[_0xc53c('0x31')],_0x409498['filters']),_0x14ec18);if(_0x2f0bba[_0xc53c('0x31')][_0xc53c('0x3d')]){_0x18395b['where']=_[_0xc53c('0x3e')](_0x18395b['where'],{'$or':_['map'](_0x14ec18,function(_0x4ebe2c){if(_0x4ebe2c[_0xc53c('0x2f')]!=='VIRTUAL'){var _0x364f10={};_0x364f10[_0x4ebe2c[_0xc53c('0x28')]]={'$like':'%'+_0x2f0bba['query'][_0xc53c('0x3d')]+'%'};return _0x364f10;}})});}_0x18395b=_[_0xc53c('0x3e')]({},_0x18395b,_0x2f0bba['options']);var _0x1645de={'where':_0x18395b[_0xc53c('0x3b')]};return db['SalesforceField'][_0xc53c('0x1f')](_0x1645de)['then'](function(_0x169e84){_0x4b73ae[_0xc53c('0x1f')]=_0x169e84;if(_0x2f0bba[_0xc53c('0x31')]['includeAll']){_0x18395b[_0xc53c('0x3f')]=[{'all':!![]}];}return db[_0xc53c('0x2c')][_0xc53c('0x40')](_0x18395b);})[_0xc53c('0x41')](function(_0x2504ea){_0x4b73ae['rows']=_0x2504ea;return _0x4b73ae;})['then'](respondWithFilteredResult(_0x4c0dd9,_0x18395b))[_0xc53c('0x42')](handleError(_0x4c0dd9,null));};exports[_0xc53c('0x43')]=function(_0x334fc5,_0x3b69b1){var _0x2b28a5={'raw':!![],'where':{'id':_0x334fc5[_0xc53c('0x44')]['id']}},_0x1f0225={};_0x1f0225[_0xc53c('0x34')]=_[_0xc53c('0x32')](db[_0xc53c('0x2c')]['rawAttributes']);_0x1f0225['query']=_[_0xc53c('0x32')](_0x334fc5[_0xc53c('0x31')]);_0x1f0225[_0xc53c('0x33')]=_['intersection'](_0x1f0225['model'],_0x1f0225[_0xc53c('0x31')]);_0x2b28a5[_0xc53c('0x35')]=_[_0xc53c('0x45')](_0x1f0225[_0xc53c('0x34')],qs[_0xc53c('0x36')](_0x334fc5[_0xc53c('0x31')][_0xc53c('0x36')]));_0x2b28a5['attributes']=_0x2b28a5[_0xc53c('0x35')][_0xc53c('0x37')]?_0x2b28a5[_0xc53c('0x35')]:_0x1f0225['model'];if(_0x334fc5[_0xc53c('0x31')][_0xc53c('0x46')]){_0x2b28a5['include']=[{'all':!![]}];}_0x2b28a5=_[_0xc53c('0x3e')]({},_0x2b28a5,_0x334fc5['options']);return db['SalesforceField'][_0xc53c('0x47')](_0x2b28a5)['then'](handleEntityNotFound(_0x3b69b1,null))[_0xc53c('0x41')](respondWithResult(_0x3b69b1,null))[_0xc53c('0x42')](handleError(_0x3b69b1,null));};exports[_0xc53c('0x48')]=function(_0x261638,_0x30ee61){return db['SalesforceField']['create'](_0x261638[_0xc53c('0x49')],{})[_0xc53c('0x41')](respondWithResult(_0x30ee61,0xc9))[_0xc53c('0x42')](handleError(_0x30ee61,null));};exports[_0xc53c('0x24')]=function(_0x3c2c58,_0x49fa7e){if(_0x3c2c58['body']['id']){delete _0x3c2c58['body']['id'];}return db[_0xc53c('0x2c')][_0xc53c('0x47')]({'where':{'id':_0x3c2c58[_0xc53c('0x44')]['id']}})[_0xc53c('0x41')](handleEntityNotFound(_0x49fa7e,null))[_0xc53c('0x41')](saveUpdates(_0x3c2c58[_0xc53c('0x49')],null))[_0xc53c('0x41')](respondWithResult(_0x49fa7e,null))[_0xc53c('0x42')](handleError(_0x49fa7e,null));};exports['destroy']=function(_0x18c865,_0x47ec20){return db[_0xc53c('0x2c')][_0xc53c('0x47')]({'where':{'id':_0x18c865[_0xc53c('0x44')]['id']}})['then'](handleEntityNotFound(_0x47ec20,null))[_0xc53c('0x41')](removeEntity(_0x47ec20,null))[_0xc53c('0x42')](handleError(_0x47ec20,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a615e9f..3e36ec3 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 _0x1321=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','int_salesforce_fields','salesforce_unique_index','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1321,0xee));var _0x1132=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1321[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1132('0x0'));var util=require(_0x1132('0x1'));var logger=require(_0x1132('0x2'))(_0x1132('0x3'));var moment=require('moment');var BPromise=require(_0x1132('0x4'));var rp=require(_0x1132('0x5'));var fs=require('fs');var path=require(_0x1132('0x6'));var rimraf=require('rimraf');var config=require(_0x1132('0x7'));var attributes=require(_0x1132('0x8'));module[_0x1132('0x9')]=function(_0x1dca93,_0x504220){return _0x1dca93['define']('SalesforceField',attributes,{'tableName':_0x1132('0xa'),'paranoid':![],'indexes':[{'name':_0x1132('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27ff=['define','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x27ff,0x18a));var _0xf27f=function(_0x5f3f60,_0x5623b3){_0x5f3f60=_0x5f3f60-0x0;var _0x3f0e96=_0x27ff[_0x5f3f60];return _0x3f0e96;};'use strict';var _=require(_0xf27f('0x0'));var util=require('util');var logger=require(_0xf27f('0x1'))(_0xf27f('0x2'));var moment=require(_0xf27f('0x3'));var BPromise=require(_0xf27f('0x4'));var rp=require(_0xf27f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf27f('0x6'));var config=require(_0xf27f('0x7'));var attributes=require(_0xf27f('0x8'));module['exports']=function(_0x20b926,_0x140df6){return _0x20b926[_0xf27f('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xf27f('0xa'),'fields':[_0xf27f('0xb'),_0xf27f('0xc')],'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 544c1eb..40cff01 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 _0xddc5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4bcbe4,_0x1ced44){var _0x5e9c96=function(_0x802c9d){while(--_0x802c9d){_0x4bcbe4['push'](_0x4bcbe4['shift']());}};_0x5e9c96(++_0x1ced44);}(_0xddc5,0xfc));var _0x5ddc=function(_0x4da3a6,_0x441eb7){_0x4da3a6=_0x4da3a6-0x0;var _0x32c0c2=_0xddc5[_0x4da3a6];return _0x32c0c2;};'use strict';var _=require(_0x5ddc('0x0'));var util=require(_0x5ddc('0x1'));var moment=require(_0x5ddc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ddc('0x3'));var db=require(_0x5ddc('0x4'))['db'];var utils=require(_0x5ddc('0x5'));var logger=require(_0x5ddc('0x6'))(_0x5ddc('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ddc('0x8'));var client=jayson[_0x5ddc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56f7ac,_0xc94c90,_0x425cf2){return new BPromise(function(_0x487b05,_0x28407f){return client['request'](_0x56f7ac,_0x425cf2)[_0x5ddc('0xa')](function(_0x4138bb){logger[_0x5ddc('0xb')](_0x5ddc('0xc'),_0xc94c90,_0x5ddc('0xd'));logger[_0x5ddc('0xe')](_0x5ddc('0xf'),_0xc94c90,_0x5ddc('0xd'),JSON['stringify'](_0x4138bb));if(_0x4138bb[_0x5ddc('0x10')]){if(_0x4138bb['error'][_0x5ddc('0x11')]===0x1f4){logger[_0x5ddc('0x10')](_0x5ddc('0xc'),_0xc94c90,_0x4138bb[_0x5ddc('0x10')][_0x5ddc('0x12')]);return _0x28407f(_0x4138bb[_0x5ddc('0x10')][_0x5ddc('0x12')]);}logger[_0x5ddc('0x10')](_0x5ddc('0xc'),_0xc94c90,_0x4138bb['error']['message']);return _0x487b05(_0x4138bb[_0x5ddc('0x10')][_0x5ddc('0x12')]);}else{logger[_0x5ddc('0xb')](_0x5ddc('0xc'),_0xc94c90,_0x5ddc('0xd'));_0x487b05(_0x4138bb[_0x5ddc('0x13')][_0x5ddc('0x12')]);}})[_0x5ddc('0x14')](function(_0x26b594){logger[_0x5ddc('0x10')]('SalesforceField,\x20%s,\x20%s',_0xc94c90,_0x26b594);_0x28407f(_0x26b594);});});} \ No newline at end of file +var _0x43a0=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x459f59,_0x434ff7){var _0x46d124=function(_0x1064ed){while(--_0x1064ed){_0x459f59['push'](_0x459f59['shift']());}};_0x46d124(++_0x434ff7);}(_0x43a0,0xfa));var _0x043a=function(_0x48bac0,_0x3adfa7){_0x48bac0=_0x48bac0-0x0;var _0xf61025=_0x43a0[_0x48bac0];return _0xf61025;};'use strict';var _=require('lodash');var util=require(_0x043a('0x0'));var moment=require(_0x043a('0x1'));var BPromise=require(_0x043a('0x2'));var rs=require(_0x043a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x043a('0x4'))['db'];var utils=require(_0x043a('0x5'));var logger=require(_0x043a('0x6'))('rpc');var config=require(_0x043a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x043a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53977e,_0x1a0485,_0x47757e){return new BPromise(function(_0x5b6e53,_0x40944a){return client[_0x043a('0x9')](_0x53977e,_0x47757e)[_0x043a('0xa')](function(_0x248177){logger[_0x043a('0xb')](_0x043a('0xc'),_0x1a0485,_0x043a('0xd'));logger[_0x043a('0xe')](_0x043a('0xf'),_0x1a0485,'request\x20sent',JSON[_0x043a('0x10')](_0x248177));if(_0x248177[_0x043a('0x11')]){if(_0x248177[_0x043a('0x11')][_0x043a('0x12')]===0x1f4){logger[_0x043a('0x11')](_0x043a('0xc'),_0x1a0485,_0x248177[_0x043a('0x11')][_0x043a('0x13')]);return _0x40944a(_0x248177[_0x043a('0x11')][_0x043a('0x13')]);}logger[_0x043a('0x11')](_0x043a('0xc'),_0x1a0485,_0x248177[_0x043a('0x11')]['message']);return _0x5b6e53(_0x248177['error'][_0x043a('0x13')]);}else{logger[_0x043a('0xb')]('SalesforceField,\x20%s,\x20%s',_0x1a0485,_0x043a('0xd'));_0x5b6e53(_0x248177[_0x043a('0x14')]['message']);}})[_0x043a('0x15')](function(_0x22dfd2){logger[_0x043a('0x11')](_0x043a('0xc'),_0x1a0485,_0x22dfd2);_0x40944a(_0x22dfd2);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 099db85..5f598a9 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 _0x1cbb=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x1cbb,0x18f));var _0xb1cb=function(_0x1262a7,_0x414c57){_0x1262a7=_0x1262a7-0x0;var _0x1352e6=_0x1cbb[_0x1262a7];return _0x1352e6;};'use strict';var multer=require(_0xb1cb('0x0'));var util=require(_0xb1cb('0x1'));var path=require('path');var timeout=require(_0xb1cb('0x2'));var express=require(_0xb1cb('0x3'));var router=express[_0xb1cb('0x4')]();var fs_extra=require(_0xb1cb('0x5'));var auth=require(_0xb1cb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb1cb('0x7'));var controller=require(_0xb1cb('0x8'));router[_0xb1cb('0x9')]('/',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0xb')]);router[_0xb1cb('0x9')](_0xb1cb('0xc'),auth[_0xb1cb('0xa')](),controller['show']);router['get'](_0xb1cb('0xd'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0xe')]);router[_0xb1cb('0x9')](_0xb1cb('0xf'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x10')]);router[_0xb1cb('0x11')]('/',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x12')]);router[_0xb1cb('0x11')]('/:id/configurations',auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x13')]);router[_0xb1cb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xb1cb('0x15')]);router[_0xb1cb('0x16')](_0xb1cb('0xc'),auth[_0xb1cb('0xa')](),controller[_0xb1cb('0x17')]);module[_0xb1cb('0x18')]=router; \ No newline at end of file +var _0xea4b=['create','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x51a579,_0xc50f58){var _0x2dfc9a=function(_0x47218e){while(--_0x47218e){_0x51a579['push'](_0x51a579['shift']());}};_0x2dfc9a(++_0xc50f58);}(_0xea4b,0x7a));var _0xbea4=function(_0x42508b,_0x693bd2){_0x42508b=_0x42508b-0x0;var _0x4739b6=_0xea4b[_0x42508b];return _0x4739b6;};'use strict';var multer=require(_0xbea4('0x0'));var util=require(_0xbea4('0x1'));var path=require(_0xbea4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbea4('0x3')]();var fs_extra=require(_0xbea4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbea4('0x5'));var config=require(_0xbea4('0x6'));var controller=require(_0xbea4('0x7'));router[_0xbea4('0x8')]('/',auth[_0xbea4('0x9')](),controller['index']);router[_0xbea4('0x8')](_0xbea4('0xa'),auth['isAuthenticated'](),controller[_0xbea4('0xb')]);router[_0xbea4('0x8')](_0xbea4('0xc'),auth[_0xbea4('0x9')](),controller[_0xbea4('0xd')]);router[_0xbea4('0x8')](_0xbea4('0xe'),auth[_0xbea4('0x9')](),controller[_0xbea4('0xf')]);router['post']('/',auth[_0xbea4('0x9')](),controller[_0xbea4('0x10')]);router[_0xbea4('0x11')](_0xbea4('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xbea4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbea4('0x13')]);router[_0xbea4('0x14')]('/:id',auth[_0xbea4('0x9')](),controller[_0xbea4('0x15')]);module[_0xbea4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f263ed0..cdcbd7b 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 _0x002d=['STRING','remoteUri','sequelize','exports'];(function(_0x16da02,_0x458883){var _0x242a86=function(_0x62f74d){while(--_0x62f74d){_0x16da02['push'](_0x16da02['shift']());}};_0x242a86(++_0x458883);}(_0x002d,0x8a));var _0xd002=function(_0x4280b0,_0x332e06){_0x4280b0=_0x4280b0-0x0;var _0x3be225=_0x002d[_0x4280b0];return _0x3be225;};'use strict';var Sequelize=require(_0xd002('0x0'));module[_0xd002('0x1')]={'name':{'type':Sequelize[_0xd002('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd002('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd002('0x2')]},'email':{'type':Sequelize[_0xd002('0x2')]},'remoteUri':{'type':Sequelize[_0xd002('0x2')],'unique':_0xd002('0x3')},'serverUrl':{'type':Sequelize[_0xd002('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8a41=['STRING','username','remoteUri','sequelize','exports'];(function(_0x325ae5,_0x453c3c){var _0x571a4a=function(_0x3183b9){while(--_0x3183b9){_0x325ae5['push'](_0x325ae5['shift']());}};_0x571a4a(++_0x453c3c);}(_0x8a41,0x1a2));var _0x18a4=function(_0x28b049,_0x24d2b){_0x28b049=_0x28b049-0x0;var _0x17fab6=_0x8a41[_0x28b049];return _0x17fab6;};'use strict';var Sequelize=require(_0x18a4('0x0'));module[_0x18a4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x18a4('0x2')]},'username':{'type':Sequelize[_0x18a4('0x2')],'unique':_0x18a4('0x3')},'password':{'type':Sequelize[_0x18a4('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x18a4('0x2')],'unique':_0x18a4('0x4')},'serverUrl':{'type':Sequelize[_0x18a4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 7090399..ce4ad9a 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 _0xadb4=['due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','username','password','remoteUri','slice','substring','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','stack','test','Wrong\x20credentials','boolean','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','fields','body','update','find','params','findOne','order','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','impact','work_notes_list','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','reopened_by','problem_id','company','assigned_to','comments','approval'];(function(_0x53f218,_0x27514c){var _0x21890a=function(_0x445133){while(--_0x445133){_0x53f218['push'](_0x53f218['shift']());}};_0x21890a(++_0x27514c);}(_0xadb4,0xd6));var _0x4adb=function(_0x384765,_0x50ed1a){_0x384765=_0x384765-0x0;var _0xecde24=_0xadb4[_0x384765];return _0xecde24;};'use strict';var emlformat=require(_0x4adb('0x0'));var rimraf=require(_0x4adb('0x1'));var zipdir=require(_0x4adb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4adb('0x3'));var moment=require('moment');var BPromise=require(_0x4adb('0x4'));var Mustache=require('mustache');var util=require(_0x4adb('0x5'));var path=require(_0x4adb('0x6'));var sox=require(_0x4adb('0x7'));var csv=require('to-csv');var ejs=require(_0x4adb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4adb('0x9'));var squel=require('squel');var crypto=require(_0x4adb('0xa'));var jsforce=require(_0x4adb('0xb'));var deskjs=require(_0x4adb('0xc'));var toCsv=require(_0x4adb('0xd'));var querystring=require(_0x4adb('0xe'));var Papa=require(_0x4adb('0xf'));var Redis=require(_0x4adb('0x10'));var authService=require(_0x4adb('0x11'));var qs=require(_0x4adb('0x12'));var as=require(_0x4adb('0x13'));var hardwareService=require(_0x4adb('0x14'));var logger=require(_0x4adb('0x15'))(_0x4adb('0x16'));var utils=require(_0x4adb('0x17'));var config=require(_0x4adb('0x18'));var licenseUtil=require(_0x4adb('0x19'));var db=require(_0x4adb('0x1a'))['db'];var integrations=require(_0x4adb('0x1b'));function respondWithStatusCode(_0x4c9da3,_0x5836d0){_0x5836d0=_0x5836d0||0xcc;return function(_0x55ffe6){if(_0x55ffe6){return _0x4c9da3[_0x4adb('0x1c')](_0x5836d0);}return _0x4c9da3[_0x4adb('0x1d')](_0x5836d0)[_0x4adb('0x1e')]();};}function respondWithResult(_0x3a13c7,_0x558d7f){_0x558d7f=_0x558d7f||0xc8;return function(_0x3be257){if(_0x3be257){return _0x3a13c7[_0x4adb('0x1d')](_0x558d7f)['json'](_0x3be257);}};}function respondWithFilteredResult(_0x3c468c,_0x4aeb90){return function(_0x106b7f){if(_0x106b7f){var _0x45abd4=typeof _0x4aeb90[_0x4adb('0x1f')]===_0x4adb('0x20')&&typeof _0x4aeb90['limit']==='undefined';var _0x449c1e=_0x106b7f['count'];var _0x52a20b=_0x45abd4?0x0:_0x4aeb90[_0x4adb('0x1f')];var _0x3f74cc=_0x45abd4?_0x106b7f[_0x4adb('0x21')]:_0x4aeb90[_0x4adb('0x1f')]+_0x4aeb90[_0x4adb('0x22')];var _0x215f93;if(_0x3f74cc>=_0x449c1e){_0x3f74cc=_0x449c1e;_0x215f93=0xc8;}else{_0x215f93=0xce;}_0x3c468c[_0x4adb('0x1d')](_0x215f93);return _0x3c468c[_0x4adb('0x23')](_0x4adb('0x24'),_0x52a20b+'-'+_0x3f74cc+'/'+_0x449c1e)['json'](_0x106b7f);}return null;};}function patchUpdates(_0x1f58a6){return function(_0x7a761b){try{jsonpatch['apply'](_0x7a761b,_0x1f58a6,!![]);}catch(_0x29d56a){return BPromise[_0x4adb('0x25')](_0x29d56a);}return _0x7a761b[_0x4adb('0x26')]();};}function saveUpdates(_0x39cdde,_0x3ab464){return function(_0x4d6f05){if(_0x4d6f05){return _0x4d6f05['update'](_0x39cdde)[_0x4adb('0x27')](function(_0x2b456d){return _0x2b456d;});}return null;};}function removeEntity(_0x5b0bc9,_0x16026d){return function(_0x5bc23e){if(_0x5bc23e){return _0x5bc23e[_0x4adb('0x28')]()[_0x4adb('0x27')](function(){_0x5b0bc9['status'](0xcc)[_0x4adb('0x1e')]();});}};}function handleEntityNotFound(_0x5c061a,_0x369a6c){return function(_0x305f5f){if(!_0x305f5f){_0x5c061a[_0x4adb('0x1c')](0x194);}return _0x305f5f;};}function handleError(_0x37e78c,_0x2140f6){_0x2140f6=_0x2140f6||0x1f4;return function(_0x4d456e){logger['error'](_0x4d456e['stack']);if(_0x4d456e[_0x4adb('0x29')]){delete _0x4d456e['name'];}_0x37e78c[_0x4adb('0x1d')](_0x2140f6)[_0x4adb('0x2a')](_0x4d456e);};}exports['index']=function(_0x232b50,_0x5be817){var _0x418cc3={},_0x2e628c={},_0x6899d8={'count':0x0,'rows':[]};var _0x4a7b6b=_[_0x4adb('0x2b')](db[_0x4adb('0x2c')][_0x4adb('0x2d')],function(_0x28c565){return{'name':_0x28c565[_0x4adb('0x2e')],'type':_0x28c565[_0x4adb('0x2f')][_0x4adb('0x30')]};});_0x2e628c[_0x4adb('0x31')]=_[_0x4adb('0x2b')](_0x4a7b6b,'name');_0x2e628c[_0x4adb('0x32')]=_[_0x4adb('0x33')](_0x232b50[_0x4adb('0x32')]);_0x2e628c['filters']=_[_0x4adb('0x34')](_0x2e628c[_0x4adb('0x31')],_0x2e628c['query']);_0x418cc3['attributes']=_[_0x4adb('0x34')](_0x2e628c[_0x4adb('0x31')],qs['fields'](_0x232b50['query']['fields']));_0x418cc3['attributes']=_0x418cc3[_0x4adb('0x35')][_0x4adb('0x36')]?_0x418cc3[_0x4adb('0x35')]:_0x2e628c['model'];if(!_0x232b50[_0x4adb('0x32')][_0x4adb('0x37')]('nolimit')){_0x418cc3[_0x4adb('0x22')]=qs[_0x4adb('0x22')](_0x232b50['query']['limit']);_0x418cc3['offset']=qs[_0x4adb('0x1f')](_0x232b50[_0x4adb('0x32')][_0x4adb('0x1f')]);}_0x418cc3['order']=qs['sort'](_0x232b50[_0x4adb('0x32')][_0x4adb('0x38')]);_0x418cc3[_0x4adb('0x39')]=qs[_0x4adb('0x3a')](_[_0x4adb('0x3b')](_0x232b50['query'],_0x2e628c[_0x4adb('0x3a')]),_0x4a7b6b);if(_0x232b50[_0x4adb('0x32')]['filter']){_0x418cc3[_0x4adb('0x39')]=_[_0x4adb('0x3c')](_0x418cc3[_0x4adb('0x39')],{'$or':_[_0x4adb('0x2b')](_0x4a7b6b,function(_0x56ed23){if(_0x56ed23[_0x4adb('0x2f')]!==_0x4adb('0x3d')){var _0x4d8acb={};_0x4d8acb[_0x56ed23[_0x4adb('0x29')]]={'$like':'%'+_0x232b50['query'][_0x4adb('0x3e')]+'%'};return _0x4d8acb;}})});}_0x418cc3=_['merge']({},_0x418cc3,_0x232b50[_0x4adb('0x3f')]);var _0xf33447={'where':_0x418cc3[_0x4adb('0x39')]};return db[_0x4adb('0x2c')][_0x4adb('0x21')](_0xf33447)[_0x4adb('0x27')](function(_0x4c9beb){_0x6899d8[_0x4adb('0x21')]=_0x4c9beb;if(_0x232b50[_0x4adb('0x32')][_0x4adb('0x40')]){_0x418cc3[_0x4adb('0x41')]=[{'all':!![]}];}return db[_0x4adb('0x2c')][_0x4adb('0x42')](_0x418cc3);})[_0x4adb('0x27')](function(_0x14be62){_0x6899d8['rows']=_0x14be62;return _0x6899d8;})[_0x4adb('0x27')](respondWithFilteredResult(_0x5be817,_0x418cc3))[_0x4adb('0x43')](handleError(_0x5be817,null));};exports[_0x4adb('0x44')]=function(_0xa33778,_0xd6b3e8){var _0x1dbb0c={'raw':![],'where':{'id':_0xa33778['params']['id']}},_0x4aa8f1={};_0x4aa8f1[_0x4adb('0x31')]=_['keys'](db[_0x4adb('0x2c')][_0x4adb('0x2d')]);_0x4aa8f1[_0x4adb('0x32')]=_[_0x4adb('0x33')](_0xa33778[_0x4adb('0x32')]);_0x4aa8f1[_0x4adb('0x3a')]=_[_0x4adb('0x34')](_0x4aa8f1['model'],_0x4aa8f1['query']);_0x1dbb0c['attributes']=_['intersection'](_0x4aa8f1[_0x4adb('0x31')],qs['fields'](_0xa33778['query'][_0x4adb('0x45')]));_0x1dbb0c['attributes']=_0x1dbb0c[_0x4adb('0x35')][_0x4adb('0x36')]?_0x1dbb0c[_0x4adb('0x35')]:_0x4aa8f1['model'];if(_0xa33778[_0x4adb('0x32')][_0x4adb('0x40')]){_0x1dbb0c[_0x4adb('0x41')]=[{'all':!![]}];}_0x1dbb0c=_['merge']({},_0x1dbb0c,_0xa33778[_0x4adb('0x3f')]);return db[_0x4adb('0x2c')]['find'](_0x1dbb0c)['then'](handleEntityNotFound(_0xd6b3e8,null))[_0x4adb('0x27')](respondWithResult(_0xd6b3e8,null))[_0x4adb('0x43')](handleError(_0xd6b3e8,null));};exports['create']=function(_0x291f16,_0x414b79){return db['ServicenowAccount']['create'](_0x291f16[_0x4adb('0x46')],{})['then'](respondWithResult(_0x414b79,0xc9))[_0x4adb('0x43')](handleError(_0x414b79,null));};exports[_0x4adb('0x47')]=function(_0x11daaa,_0x54488f){if(_0x11daaa['body']['id']){delete _0x11daaa[_0x4adb('0x46')]['id'];}return db[_0x4adb('0x2c')]['find']({'where':{'id':_0x11daaa['params']['id']}})[_0x4adb('0x27')](handleEntityNotFound(_0x54488f,null))[_0x4adb('0x27')](saveUpdates(_0x11daaa[_0x4adb('0x46')],null))['then'](respondWithResult(_0x54488f,null))['catch'](handleError(_0x54488f,null));};exports[_0x4adb('0x28')]=function(_0x57cce9,_0x59b1a8){return db[_0x4adb('0x2c')][_0x4adb('0x48')]({'where':{'id':_0x57cce9[_0x4adb('0x49')]['id']}})[_0x4adb('0x27')](handleEntityNotFound(_0x59b1a8,null))[_0x4adb('0x27')](removeEntity(_0x59b1a8,null))[_0x4adb('0x43')](handleError(_0x59b1a8,null));};exports['getConfigurations']=function(_0x442f1f,_0x3d1874,_0x333d34){var _0xecdcec={};var _0x5fcbd3={};var _0xb50cc8;var _0x3d3ce9;return db[_0x4adb('0x2c')][_0x4adb('0x4a')]({'where':{'id':_0x442f1f[_0x4adb('0x49')]['id']}})[_0x4adb('0x27')](handleEntityNotFound(_0x3d1874,null))[_0x4adb('0x27')](function(_0x31a5c9){if(_0x31a5c9){_0xb50cc8=_0x31a5c9;_0x5fcbd3[_0x4adb('0x31')]=_[_0x4adb('0x33')](db['ServicenowConfiguration'][_0x4adb('0x2d')]);_0x5fcbd3['query']=_[_0x4adb('0x33')](_0x442f1f[_0x4adb('0x32')]);_0x5fcbd3['filters']=_[_0x4adb('0x34')](_0x5fcbd3['model'],_0x5fcbd3['query']);_0xecdcec['attributes']=_['intersection'](_0x5fcbd3['model'],qs[_0x4adb('0x45')](_0x442f1f[_0x4adb('0x32')]['fields']));_0xecdcec[_0x4adb('0x35')]=_0xecdcec['attributes'][_0x4adb('0x36')]?_0xecdcec[_0x4adb('0x35')]:_0x5fcbd3[_0x4adb('0x31')];_0xecdcec[_0x4adb('0x4b')]=qs['sort'](_0x442f1f[_0x4adb('0x32')]['sort']);_0xecdcec[_0x4adb('0x39')]=qs[_0x4adb('0x3a')](_[_0x4adb('0x3b')](_0x442f1f[_0x4adb('0x32')],_0x5fcbd3[_0x4adb('0x3a')]));if(_0x442f1f['query'][_0x4adb('0x3e')]){_0xecdcec[_0x4adb('0x39')]=_[_0x4adb('0x3c')](_0xecdcec[_0x4adb('0x39')],{'$or':_[_0x4adb('0x2b')](_0xecdcec[_0x4adb('0x35')],function(_0x153b21){var _0x1221f7={};_0x1221f7[_0x153b21]={'$like':'%'+_0x442f1f[_0x4adb('0x32')][_0x4adb('0x3e')]+'%'};return _0x1221f7;})});}_0xecdcec=_['merge']({},_0xecdcec,_0x442f1f[_0x4adb('0x3f')]);return _0xb50cc8['getConfigurations'](_0xecdcec);}})['then'](function(_0x5c2fed){if(_0x5c2fed){_0x3d3ce9=_0x5c2fed[_0x4adb('0x36')];if(!_0x442f1f['query'][_0x4adb('0x37')](_0x4adb('0x4c'))){_0xecdcec[_0x4adb('0x22')]=qs[_0x4adb('0x22')](_0x442f1f['query'][_0x4adb('0x22')]);_0xecdcec[_0x4adb('0x1f')]=qs[_0x4adb('0x1f')](_0x442f1f[_0x4adb('0x32')][_0x4adb('0x1f')]);}return _0xb50cc8['getConfigurations'](_0xecdcec);}})['then'](function(_0x59e362){if(_0x59e362){return _0x59e362?{'count':_0x3d3ce9,'rows':_0x59e362}:null;}})[_0x4adb('0x27')](respondWithResult(_0x3d1874,null))[_0x4adb('0x43')](handleError(_0x3d1874,null));};exports[_0x4adb('0x4d')]=function(_0x24c94e,_0x4d30d4,_0x485314){if(_0x24c94e[_0x4adb('0x46')]['id']){delete _0x24c94e[_0x4adb('0x46')]['id'];}return db[_0x4adb('0x2c')]['findOne']({'where':{'id':_0x24c94e[_0x4adb('0x49')]['id']}})[_0x4adb('0x27')](handleEntityNotFound(_0x4d30d4,null))[_0x4adb('0x27')](function(_0x4d0fc1){if(_0x4d0fc1){_0x24c94e[_0x4adb('0x46')]['AccountId']=_0x4d0fc1['id'];_0x24c94e[_0x4adb('0x46')][_0x4adb('0x4e')]=integrations[_0x4adb('0x4f')](_0x24c94e[_0x4adb('0x46')][_0x4adb('0x50')],_0x24c94e[_0x4adb('0x46')][_0x4adb('0x2f')]);_0x24c94e[_0x4adb('0x46')][_0x4adb('0x51')]=integrations[_0x4adb('0x52')](_0x24c94e['body'][_0x4adb('0x50')],_0x24c94e[_0x4adb('0x46')]['type']);return db['ServicenowConfiguration'][_0x4adb('0x53')](_0x24c94e['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x4adb('0x54')],'as':_0x4adb('0x51')}]});}return null;})['then'](respondWithResult(_0x4d30d4,null))[_0x4adb('0x43')](handleError(_0x4d30d4,null));};exports[_0x4adb('0x55')]=function(_0x2aa240,_0x3f8f5b,_0x4e0087){var _0x3206e7=[_0x4adb('0x56'),_0x4adb('0x57'),_0x4adb('0x58'),_0x4adb('0x59'),'close_code',_0x4adb('0x5a'),_0x4adb('0x5b'),_0x4adb('0x5c'),_0x4adb('0x5d')];var _0x3aeea4=[_0x4adb('0x5e'),_0x4adb('0x56'),'caused_by',_0x4adb('0x5f'),'upon_reject',_0x4adb('0x60'),_0x4adb('0x61'),'hold_reason',_0x4adb('0x62'),_0x4adb('0x63'),_0x4adb('0x64'),'sys_updated_by',_0x4adb('0x65'),_0x4adb('0x66'),_0x4adb('0x67'),_0x4adb('0x68'),_0x4adb('0x69'),_0x4adb('0x6a'),_0x4adb('0x58'),_0x4adb('0x4b'),'calendar_stc','closed_at',_0x4adb('0x6b'),_0x4adb('0x6c'),_0x4adb('0x6d'),'active',_0x4adb('0x6e'),'business_service',_0x4adb('0x6f'),_0x4adb('0x70'),'rfc',_0x4adb('0x71'),_0x4adb('0x72'),_0x4adb('0x73'),_0x4adb('0x74'),_0x4adb('0x75'),'work_end','reopened_time',_0x4adb('0x76'),_0x4adb('0x77'),_0x4adb('0x78'),_0x4adb('0x59'),_0x4adb('0x79'),_0x4adb('0x7a'),_0x4adb('0x7b'),_0x4adb('0x7c'),_0x4adb('0x7d'),_0x4adb('0x7e'),_0x4adb('0x7f'),_0x4adb('0x80'),_0x4adb('0x81'),_0x4adb('0x82'),_0x4adb('0x83'),_0x4adb('0x5a'),'sys_class_name',_0x4adb('0x84'),_0x4adb('0x85'),_0x4adb('0x86'),_0x4adb('0x87'),'sys_id','contact_type',_0x4adb('0x88'),_0x4adb('0x5b'),'urgency',_0x4adb('0x89'),_0x4adb('0x8a'),'reassignment_count','activity_due',_0x4adb('0x8b'),_0x4adb('0x5c'),_0x4adb('0x8c'),'sla_due',_0x4adb('0x8d'),'comments_and_work_notes',_0x4adb('0x8e'),_0x4adb('0x8f'),'reopen_count',_0x4adb('0x90'),_0x4adb('0x91'),_0x4adb('0x92'),_0x4adb('0x93'),'location','category'];var _0x21ec68='';var _0x5e92a5='';var _0x4b5b9a=[];var _0x10b3c0='';var _0x25678f='';var _0x754fe=[];var _0x12b9b='';var _0x5910e1='';var _0x147000={};var _0x23ea7b='';return db[_0x4adb('0x2c')]['findOne']({'where':{'id':_0x2aa240[_0x4adb('0x49')]['id']},'attributes':['id',_0x4adb('0x94'),_0x4adb('0x95'),'email',_0x4adb('0x96'),'serverUrl']})[_0x4adb('0x27')](handleEntityNotFound(_0x3f8f5b,null))[_0x4adb('0x27')](function(_0x1d9970){if(_0x1d9970){_0x23ea7b=_0x1d9970[_0x4adb('0x96')];var _0x135e72=_0x23ea7b[_0x4adb('0x97')](-0x1);if(_0x135e72==='/'){_0x23ea7b=_0x23ea7b[_0x4adb('0x98')](0x0,_0x23ea7b['lastIndexOf'](_0x135e72));}_0x5910e1=util['format']('%s/api/now/doc/table/schema/',_0x23ea7b);_0x12b9b=util['format'](_0x4adb('0x99'),_0x23ea7b);_0x147000={'user':_0x1d9970[_0x4adb('0x94')],'pass':_0x1d9970['password']};var _0x1ec5c3={'method':_0x4adb('0x9a'),'uri':_0x5910e1+_0x4adb('0x9b'),'auth':_0x147000,'json':!![]};return rp(_0x1ec5c3);}})[_0x4adb('0x27')](function(_0x14d407){if(_0x14d407[_0x4adb('0x9c')]['length']>0x0){_0x21ec68=_0x14d407[_0x4adb('0x9c')];}console[_0x4adb('0x9d')]('incident\x20table\x20objects',_0x21ec68);_0x754fe=[];_0x5e92a5=Object[_0x4adb('0x9e')]([],_0x21ec68);_[_0x4adb('0x9f')](_0x5e92a5,function(_0x38c77a){return!_0x3206e7[_0x4adb('0xa0')](_0x38c77a['name']);});_0x5e92a5[_0x4adb('0xa1')](function(_0x1ca2ed){var _0x2edb27=createFieldObject(_0x12b9b,_0x147000,_0x1ca2ed[_0x4adb('0xa2')],_0x1ca2ed[_0x4adb('0x29')],_0x1ca2ed['label'],![]);_0x754fe[_0x4adb('0xa3')](_0x2edb27);});return Promise[_0x4adb('0xa4')](_0x754fe);})[_0x4adb('0x27')](function(_0x21c5b1){_0x4b5b9a=_0x21c5b1;_0x10b3c0=Object[_0x4adb('0x9e')]([],_0x21ec68);console[_0x4adb('0x9d')](_0x4adb('0xa5'),_0x21ec68);_[_0x4adb('0x9f')](_0x10b3c0,function(_0x8651f7){return _0x3aeea4[_0x4adb('0xa0')](_0x8651f7['name']);});console[_0x4adb('0x9d')](_0x4adb('0xa6'),_0x10b3c0);_0x754fe=[];_0x10b3c0[_0x4adb('0xa1')](function(_0x4d8bfc){var _0x209923=createFieldObject(_0x12b9b,_0x147000,_0x4d8bfc[_0x4adb('0xa2')],_0x4d8bfc[_0x4adb('0x29')],_0x4d8bfc[_0x4adb('0xa7')],!![]);_0x754fe[_0x4adb('0xa3')](_0x209923);});return Promise[_0x4adb('0xa4')](_0x754fe);})[_0x4adb('0x27')](function(_0xbf084){_0x25678f=_0xbf084;var _0x2fcaa7=_0x4b5b9a[_0x4adb('0xa8')](_0x25678f);return{'count':_0x2fcaa7['length'],'rows':_0x2fcaa7};})['then'](respondWithResult(_0x3f8f5b,null))[_0x4adb('0x43')](function(_0x3d49d3){console['log'](_0x4adb('0xa9')+_0x3d49d3);var _0xe2cd9d=_0x2aa240[_0x4adb('0x32')]['test']?0x1f4:_0x3d49d3[_0x4adb('0xaa')]||0x1f4;logger['error'](_0x3d49d3[_0x4adb('0xab')]);delete _0x3d49d3[_0x4adb('0x29')];if(_0xe2cd9d===0x191){_0xe2cd9d=0x190;}_0x3f8f5b[_0x4adb('0x1d')](_0xe2cd9d)[_0x4adb('0x2a')](_0x2aa240[_0x4adb('0x32')][_0x4adb('0xac')]?{'message':_0x4adb('0xad'),'statusCode':_0x3d49d3[_0x4adb('0xaa')]}:_0x3d49d3);});};function createFieldObject(_0x445317,_0x5c8296,_0x54a888,_0x4c518a,_0x40eaee,_0x389f37){return new Promise(function(_0x44040f,_0x39a3c7){var _0x288fd2={'id':_0x4c518a,'name':_0x40eaee,'custom':_0x389f37};if(_0x54a888===_0x4adb('0xae')){_0x288fd2[_0x4adb('0x3f')]=[{'name':'True','value':'true'},{'name':'False','value':_0x4adb('0xaf')}];_0x44040f(_0x288fd2);}else{var _0x4741e4={'method':'GET','uri':_0x445317+'sys_choice?sysparm_query=name=incident^element='+_0x4c518a,'auth':_0x5c8296,'json':!![]};return rp(_0x4741e4)[_0x4adb('0x27')](function(_0x55754a){var _0x4862bf=[];if(_0x55754a[_0x4adb('0x9c')][_0x4adb('0x36')]>0x0){_0x55754a[_0x4adb('0x9c')][_0x4adb('0xa1')](function(_0x5842fc){if(_0x5842fc[_0x4adb('0xb0')]===_0x4adb('0xaf')){var _0x5ed3c2={'name':_0x5842fc['label'],'value':_0x5842fc[_0x4adb('0xb1')]};_0x4862bf['push'](_0x5ed3c2);}});}_0x288fd2['options']=_0x4862bf;if(_0x288fd2[_0x4adb('0x3f')][_0x4adb('0x36')]>0x0){_0x44040f(_0x288fd2);}else{if(_0x389f37==![]){_0x44040f();}else{_0x44040f(_0x288fd2);}}});}});} \ No newline at end of file +var _0xc233=['rows','catch','show','include','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','AccountId','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','concat','ServiceNow\x20error:\x20','statusCode','stack','send','test','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','then','destroy','error','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x56cb19,_0x329d9f){var _0x3fa884=function(_0x4e864d){while(--_0x4e864d){_0x56cb19['push'](_0x56cb19['shift']());}};_0x3fa884(++_0x329d9f);}(_0xc233,0x7a));var _0x3c23=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xc233[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0x3c23('0x0'));var rimraf=require(_0x3c23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3c23('0x2'));var moment=require(_0x3c23('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c23('0x4'));var util=require(_0x3c23('0x5'));var path=require(_0x3c23('0x6'));var sox=require(_0x3c23('0x7'));var csv=require('to-csv');var ejs=require(_0x3c23('0x8'));var fs=require('fs');var fs_extra=require(_0x3c23('0x9'));var _=require('lodash');var squel=require(_0x3c23('0xa'));var crypto=require(_0x3c23('0xb'));var jsforce=require(_0x3c23('0xc'));var deskjs=require(_0x3c23('0xd'));var toCsv=require(_0x3c23('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c23('0xf'));var authService=require(_0x3c23('0x10'));var qs=require(_0x3c23('0x11'));var as=require(_0x3c23('0x12'));var hardwareService=require(_0x3c23('0x13'));var logger=require('../../config/logger')(_0x3c23('0x14'));var utils=require(_0x3c23('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3c23('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3c23('0x17'));function respondWithStatusCode(_0xb0da07,_0x177241){_0x177241=_0x177241||0xcc;return function(_0x40b401){if(_0x40b401){return _0xb0da07[_0x3c23('0x18')](_0x177241);}return _0xb0da07['status'](_0x177241)[_0x3c23('0x19')]();};}function respondWithResult(_0x7b2803,_0x46233e){_0x46233e=_0x46233e||0xc8;return function(_0x16bdad){if(_0x16bdad){return _0x7b2803[_0x3c23('0x1a')](_0x46233e)[_0x3c23('0x1b')](_0x16bdad);}};}function respondWithFilteredResult(_0xf47e29,_0x5ab85f){return function(_0x2d2986){if(_0x2d2986){var _0x4c217b=typeof _0x5ab85f[_0x3c23('0x1c')]==='undefined'&&typeof _0x5ab85f['limit']===_0x3c23('0x1d');var _0x3b09b3=_0x2d2986[_0x3c23('0x1e')];var _0xd99f7e=_0x4c217b?0x0:_0x5ab85f[_0x3c23('0x1c')];var _0x508648=_0x4c217b?_0x2d2986[_0x3c23('0x1e')]:_0x5ab85f[_0x3c23('0x1c')]+_0x5ab85f[_0x3c23('0x1f')];var _0x247b60;if(_0x508648>=_0x3b09b3){_0x508648=_0x3b09b3;_0x247b60=0xc8;}else{_0x247b60=0xce;}_0xf47e29[_0x3c23('0x1a')](_0x247b60);return _0xf47e29['set'](_0x3c23('0x20'),_0xd99f7e+'-'+_0x508648+'/'+_0x3b09b3)['json'](_0x2d2986);}return null;};}function patchUpdates(_0x1f6f2d){return function(_0x5088cd){try{jsonpatch['apply'](_0x5088cd,_0x1f6f2d,!![]);}catch(_0x59b249){return BPromise[_0x3c23('0x21')](_0x59b249);}return _0x5088cd['save']();};}function saveUpdates(_0x5b020b,_0x2c00cf){return function(_0x281bb1){if(_0x281bb1){return _0x281bb1['update'](_0x5b020b)[_0x3c23('0x22')](function(_0xddcc0c){return _0xddcc0c;});}return null;};}function removeEntity(_0x99c02a,_0x40ac51){return function(_0x498cec){if(_0x498cec){return _0x498cec[_0x3c23('0x23')]()[_0x3c23('0x22')](function(){_0x99c02a['status'](0xcc)[_0x3c23('0x19')]();});}};}function handleEntityNotFound(_0x4accb9,_0x341639){return function(_0x22acfb){if(!_0x22acfb){_0x4accb9[_0x3c23('0x18')](0x194);}return _0x22acfb;};}function handleError(_0x5a9d83,_0x102dc0){_0x102dc0=_0x102dc0||0x1f4;return function(_0x5f4b34){logger[_0x3c23('0x24')](_0x5f4b34['stack']);if(_0x5f4b34['name']){delete _0x5f4b34[_0x3c23('0x25')];}_0x5a9d83[_0x3c23('0x1a')](_0x102dc0)['send'](_0x5f4b34);};}exports[_0x3c23('0x26')]=function(_0xcee054,_0x347417){var _0x21432e={},_0x438115={},_0x5e681b={'count':0x0,'rows':[]};var _0x34a2dc=_[_0x3c23('0x27')](db[_0x3c23('0x28')][_0x3c23('0x29')],function(_0x36e568){return{'name':_0x36e568[_0x3c23('0x2a')],'type':_0x36e568[_0x3c23('0x2b')][_0x3c23('0x2c')]};});_0x438115[_0x3c23('0x2d')]=_['map'](_0x34a2dc,_0x3c23('0x25'));_0x438115['query']=_[_0x3c23('0x2e')](_0xcee054[_0x3c23('0x2f')]);_0x438115[_0x3c23('0x30')]=_[_0x3c23('0x31')](_0x438115[_0x3c23('0x2d')],_0x438115[_0x3c23('0x2f')]);_0x21432e[_0x3c23('0x32')]=_[_0x3c23('0x31')](_0x438115[_0x3c23('0x2d')],qs[_0x3c23('0x33')](_0xcee054[_0x3c23('0x2f')][_0x3c23('0x33')]));_0x21432e[_0x3c23('0x32')]=_0x21432e[_0x3c23('0x32')][_0x3c23('0x34')]?_0x21432e[_0x3c23('0x32')]:_0x438115['model'];if(!_0xcee054['query'][_0x3c23('0x35')](_0x3c23('0x36'))){_0x21432e[_0x3c23('0x1f')]=qs[_0x3c23('0x1f')](_0xcee054['query'][_0x3c23('0x1f')]);_0x21432e[_0x3c23('0x1c')]=qs[_0x3c23('0x1c')](_0xcee054[_0x3c23('0x2f')][_0x3c23('0x1c')]);}_0x21432e[_0x3c23('0x37')]=qs[_0x3c23('0x38')](_0xcee054[_0x3c23('0x2f')][_0x3c23('0x38')]);_0x21432e[_0x3c23('0x39')]=qs[_0x3c23('0x30')](_[_0x3c23('0x3a')](_0xcee054['query'],_0x438115[_0x3c23('0x30')]),_0x34a2dc);if(_0xcee054[_0x3c23('0x2f')][_0x3c23('0x3b')]){_0x21432e[_0x3c23('0x39')]=_[_0x3c23('0x3c')](_0x21432e[_0x3c23('0x39')],{'$or':_['map'](_0x34a2dc,function(_0x47c8e4){if(_0x47c8e4[_0x3c23('0x2b')]!==_0x3c23('0x3d')){var _0x54f2e5={};_0x54f2e5[_0x47c8e4['name']]={'$like':'%'+_0xcee054['query'][_0x3c23('0x3b')]+'%'};return _0x54f2e5;}})});}_0x21432e=_['merge']({},_0x21432e,_0xcee054[_0x3c23('0x3e')]);var _0x35fc79={'where':_0x21432e[_0x3c23('0x39')]};return db['ServicenowAccount'][_0x3c23('0x1e')](_0x35fc79)['then'](function(_0x3b2187){_0x5e681b[_0x3c23('0x1e')]=_0x3b2187;if(_0xcee054['query'][_0x3c23('0x3f')]){_0x21432e['include']=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x21432e);})[_0x3c23('0x22')](function(_0x4cc138){_0x5e681b[_0x3c23('0x40')]=_0x4cc138;return _0x5e681b;})[_0x3c23('0x22')](respondWithFilteredResult(_0x347417,_0x21432e))[_0x3c23('0x41')](handleError(_0x347417,null));};exports[_0x3c23('0x42')]=function(_0x5ca31e,_0x22a929){var _0x33218d={'raw':![],'where':{'id':_0x5ca31e['params']['id']}},_0x270320={};_0x270320[_0x3c23('0x2d')]=_[_0x3c23('0x2e')](db[_0x3c23('0x28')][_0x3c23('0x29')]);_0x270320[_0x3c23('0x2f')]=_['keys'](_0x5ca31e[_0x3c23('0x2f')]);_0x270320['filters']=_['intersection'](_0x270320[_0x3c23('0x2d')],_0x270320['query']);_0x33218d[_0x3c23('0x32')]=_[_0x3c23('0x31')](_0x270320[_0x3c23('0x2d')],qs[_0x3c23('0x33')](_0x5ca31e[_0x3c23('0x2f')][_0x3c23('0x33')]));_0x33218d[_0x3c23('0x32')]=_0x33218d[_0x3c23('0x32')][_0x3c23('0x34')]?_0x33218d[_0x3c23('0x32')]:_0x270320[_0x3c23('0x2d')];if(_0x5ca31e['query']['includeAll']){_0x33218d[_0x3c23('0x43')]=[{'all':!![]}];}_0x33218d=_[_0x3c23('0x3c')]({},_0x33218d,_0x5ca31e['options']);return db[_0x3c23('0x28')][_0x3c23('0x44')](_0x33218d)[_0x3c23('0x22')](handleEntityNotFound(_0x22a929,null))[_0x3c23('0x22')](respondWithResult(_0x22a929,null))[_0x3c23('0x41')](handleError(_0x22a929,null));};exports[_0x3c23('0x45')]=function(_0x3442af,_0x4454cf){return db[_0x3c23('0x28')][_0x3c23('0x45')](_0x3442af['body'],{})[_0x3c23('0x22')](respondWithResult(_0x4454cf,0xc9))[_0x3c23('0x41')](handleError(_0x4454cf,null));};exports['update']=function(_0x2bdc4b,_0x56ef3c){if(_0x2bdc4b[_0x3c23('0x46')]['id']){delete _0x2bdc4b['body']['id'];}return db[_0x3c23('0x28')][_0x3c23('0x44')]({'where':{'id':_0x2bdc4b[_0x3c23('0x47')]['id']}})['then'](handleEntityNotFound(_0x56ef3c,null))[_0x3c23('0x22')](saveUpdates(_0x2bdc4b[_0x3c23('0x46')],null))[_0x3c23('0x22')](respondWithResult(_0x56ef3c,null))[_0x3c23('0x41')](handleError(_0x56ef3c,null));};exports[_0x3c23('0x23')]=function(_0x4154fa,_0x3e4e2e){return db[_0x3c23('0x28')]['find']({'where':{'id':_0x4154fa[_0x3c23('0x47')]['id']}})[_0x3c23('0x22')](handleEntityNotFound(_0x3e4e2e,null))['then'](removeEntity(_0x3e4e2e,null))['catch'](handleError(_0x3e4e2e,null));};exports[_0x3c23('0x48')]=function(_0x4ddd01,_0x40b27e,_0xb7e32b){var _0x317eb9={};var _0x30009c={};var _0x11b4c6;var _0x52b6e5;return db[_0x3c23('0x28')][_0x3c23('0x49')]({'where':{'id':_0x4ddd01[_0x3c23('0x47')]['id']}})['then'](handleEntityNotFound(_0x40b27e,null))['then'](function(_0x1bbfa4){if(_0x1bbfa4){_0x11b4c6=_0x1bbfa4;_0x30009c[_0x3c23('0x2d')]=_[_0x3c23('0x2e')](db[_0x3c23('0x4a')][_0x3c23('0x29')]);_0x30009c['query']=_[_0x3c23('0x2e')](_0x4ddd01[_0x3c23('0x2f')]);_0x30009c[_0x3c23('0x30')]=_[_0x3c23('0x31')](_0x30009c[_0x3c23('0x2d')],_0x30009c['query']);_0x317eb9[_0x3c23('0x32')]=_[_0x3c23('0x31')](_0x30009c[_0x3c23('0x2d')],qs['fields'](_0x4ddd01['query'][_0x3c23('0x33')]));_0x317eb9[_0x3c23('0x32')]=_0x317eb9['attributes'][_0x3c23('0x34')]?_0x317eb9['attributes']:_0x30009c[_0x3c23('0x2d')];_0x317eb9[_0x3c23('0x37')]=qs['sort'](_0x4ddd01[_0x3c23('0x2f')][_0x3c23('0x38')]);_0x317eb9['where']=qs[_0x3c23('0x30')](_[_0x3c23('0x3a')](_0x4ddd01[_0x3c23('0x2f')],_0x30009c[_0x3c23('0x30')]));if(_0x4ddd01['query'][_0x3c23('0x3b')]){_0x317eb9[_0x3c23('0x39')]=_[_0x3c23('0x3c')](_0x317eb9['where'],{'$or':_[_0x3c23('0x27')](_0x317eb9['attributes'],function(_0x32228d){var _0x429001={};_0x429001[_0x32228d]={'$like':'%'+_0x4ddd01[_0x3c23('0x2f')]['filter']+'%'};return _0x429001;})});}_0x317eb9=_[_0x3c23('0x3c')]({},_0x317eb9,_0x4ddd01[_0x3c23('0x3e')]);return _0x11b4c6['getConfigurations'](_0x317eb9);}})[_0x3c23('0x22')](function(_0x205b47){if(_0x205b47){_0x52b6e5=_0x205b47[_0x3c23('0x34')];if(!_0x4ddd01[_0x3c23('0x2f')][_0x3c23('0x35')]('nolimit')){_0x317eb9[_0x3c23('0x1f')]=qs[_0x3c23('0x1f')](_0x4ddd01['query'][_0x3c23('0x1f')]);_0x317eb9['offset']=qs[_0x3c23('0x1c')](_0x4ddd01[_0x3c23('0x2f')][_0x3c23('0x1c')]);}return _0x11b4c6[_0x3c23('0x48')](_0x317eb9);}})[_0x3c23('0x22')](function(_0x55050c){if(_0x55050c){return _0x55050c?{'count':_0x52b6e5,'rows':_0x55050c}:null;}})[_0x3c23('0x22')](respondWithResult(_0x40b27e,null))[_0x3c23('0x41')](handleError(_0x40b27e,null));};exports['addConfiguration']=function(_0x385389,_0xbcbfc9,_0x7eac23){if(_0x385389[_0x3c23('0x46')]['id']){delete _0x385389[_0x3c23('0x46')]['id'];}return db['ServicenowAccount'][_0x3c23('0x49')]({'where':{'id':_0x385389['params']['id']}})[_0x3c23('0x22')](handleEntityNotFound(_0xbcbfc9,null))[_0x3c23('0x22')](function(_0x21820e){if(_0x21820e){_0x385389['body'][_0x3c23('0x4b')]=_0x21820e['id'];_0x385389[_0x3c23('0x46')]['Subjects']=integrations[_0x3c23('0x4c')](_0x385389['body'][_0x3c23('0x4d')],_0x385389['body'][_0x3c23('0x2b')]);_0x385389['body']['Descriptions']=integrations[_0x3c23('0x4e')](_0x385389['body'][_0x3c23('0x4d')],_0x385389[_0x3c23('0x46')][_0x3c23('0x2b')]);return db[_0x3c23('0x4a')][_0x3c23('0x45')](_0x385389[_0x3c23('0x46')],{'include':[{'model':db[_0x3c23('0x4f')],'as':'Subjects'},{'model':db[_0x3c23('0x4f')],'as':_0x3c23('0x50')}]});}return null;})['then'](respondWithResult(_0xbcbfc9,null))['catch'](handleError(_0xbcbfc9,null));};exports['getFields']=function(_0x5d0471,_0xa58be9,_0x453473){var _0x27c79d=[_0x3c23('0x51'),_0x3c23('0x52'),_0x3c23('0x53'),'subcategory',_0x3c23('0x54'),_0x3c23('0x55'),_0x3c23('0x56'),_0x3c23('0x57'),_0x3c23('0x58')];var _0x6e15c1=[_0x3c23('0x59'),_0x3c23('0x51'),_0x3c23('0x5a'),'watch_list',_0x3c23('0x5b'),_0x3c23('0x5c'),_0x3c23('0x5d'),_0x3c23('0x52'),'approval_history',_0x3c23('0x5e'),_0x3c23('0x5f'),_0x3c23('0x60'),_0x3c23('0x61'),'user_input','sys_created_on',_0x3c23('0x62'),_0x3c23('0x63'),_0x3c23('0x64'),_0x3c23('0x53'),_0x3c23('0x37'),'calendar_stc',_0x3c23('0x65'),_0x3c23('0x66'),_0x3c23('0x67'),_0x3c23('0x68'),'active','work_notes_list',_0x3c23('0x69'),'priority',_0x3c23('0x6a'),_0x3c23('0x6b'),_0x3c23('0x6c'),_0x3c23('0x6d'),_0x3c23('0x6e'),'business_duration',_0x3c23('0x6f'),_0x3c23('0x70'),_0x3c23('0x71'),_0x3c23('0x72'),_0x3c23('0x73'),_0x3c23('0x74'),_0x3c23('0x75'),_0x3c23('0x76'),_0x3c23('0x77'),'close_code',_0x3c23('0x78'),_0x3c23('0x79'),_0x3c23('0x7a'),_0x3c23('0x7b'),_0x3c23('0x7c'),_0x3c23('0x7d'),_0x3c23('0x7e'),_0x3c23('0x7f'),_0x3c23('0x55'),_0x3c23('0x80'),_0x3c23('0x81'),_0x3c23('0x82'),'follow_up',_0x3c23('0x83'),_0x3c23('0x84'),_0x3c23('0x85'),_0x3c23('0x86'),_0x3c23('0x56'),_0x3c23('0x87'),_0x3c23('0x88'),_0x3c23('0x89'),_0x3c23('0x8a'),_0x3c23('0x8b'),_0x3c23('0x8c'),_0x3c23('0x57'),_0x3c23('0x8d'),_0x3c23('0x8e'),_0x3c23('0x8f'),_0x3c23('0x90'),'due_date',_0x3c23('0x91'),_0x3c23('0x92'),_0x3c23('0x93'),_0x3c23('0x94'),_0x3c23('0x95'),'correlation_id',_0x3c23('0x96'),_0x3c23('0x58')];var _0x3a3bb6='';var _0x230e7f='';var _0x45ba93=[];var _0x547a30='';var _0x4518fd='';var _0x2c4f30=[];var _0x1cf3cb='';var _0x11d34f='';var _0x16fc53={};var _0x169780='';return db[_0x3c23('0x28')][_0x3c23('0x49')]({'where':{'id':_0x5d0471[_0x3c23('0x47')]['id']},'attributes':['id',_0x3c23('0x97'),_0x3c23('0x98'),'email','remoteUri',_0x3c23('0x99')]})['then'](handleEntityNotFound(_0xa58be9,null))[_0x3c23('0x22')](function(_0x2dcaed){if(_0x2dcaed){_0x169780=_0x2dcaed[_0x3c23('0x9a')];var _0x5ef2d7=_0x169780[_0x3c23('0x9b')](-0x1);if(_0x5ef2d7==='/'){_0x169780=_0x169780[_0x3c23('0x9c')](0x0,_0x169780[_0x3c23('0x9d')](_0x5ef2d7));}_0x11d34f=util[_0x3c23('0x9e')](_0x3c23('0x9f'),_0x169780);_0x1cf3cb=util[_0x3c23('0x9e')](_0x3c23('0xa0'),_0x169780);_0x16fc53={'user':_0x2dcaed['username'],'pass':_0x2dcaed['password']};var _0x2d952b={'method':_0x3c23('0xa1'),'uri':_0x11d34f+'incident?sysparm_display_value=all','auth':_0x16fc53,'json':!![]};return rp(_0x2d952b);}})[_0x3c23('0x22')](function(_0x35679a){if(_0x35679a[_0x3c23('0xa2')][_0x3c23('0x34')]>0x0){_0x3a3bb6=_0x35679a['result'];}console['log'](_0x3c23('0xa3'),_0x3a3bb6);_0x2c4f30=[];_0x230e7f=Object[_0x3c23('0xa4')]([],_0x3a3bb6);_[_0x3c23('0xa5')](_0x230e7f,function(_0x883aa9){return!_0x27c79d[_0x3c23('0xa6')](_0x883aa9[_0x3c23('0x25')]);});_0x230e7f[_0x3c23('0xa7')](function(_0x348262){var _0x28cb27=createFieldObject(_0x1cf3cb,_0x16fc53,_0x348262[_0x3c23('0xa8')],_0x348262[_0x3c23('0x25')],_0x348262[_0x3c23('0xa9')],![]);_0x2c4f30[_0x3c23('0xaa')](_0x28cb27);});return Promise[_0x3c23('0xab')](_0x2c4f30);})['then'](function(_0x4fecaf){_0x45ba93=_0x4fecaf;_0x547a30=Object[_0x3c23('0xa4')]([],_0x3a3bb6);console[_0x3c23('0xac')](_0x3c23('0xad'),_0x3a3bb6);_['remove'](_0x547a30,function(_0x45149c){return _0x6e15c1[_0x3c23('0xa6')](_0x45149c[_0x3c23('0x25')]);});console[_0x3c23('0xac')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x547a30);_0x2c4f30=[];_0x547a30[_0x3c23('0xa7')](function(_0x32096d){var _0x13f151=createFieldObject(_0x1cf3cb,_0x16fc53,_0x32096d[_0x3c23('0xa8')],_0x32096d['name'],_0x32096d['label'],!![]);_0x2c4f30[_0x3c23('0xaa')](_0x13f151);});return Promise[_0x3c23('0xab')](_0x2c4f30);})[_0x3c23('0x22')](function(_0x5c0326){_0x4518fd=_0x5c0326;var _0x17d3c6=_0x45ba93[_0x3c23('0xae')](_0x4518fd);return{'count':_0x17d3c6[_0x3c23('0x34')],'rows':_0x17d3c6};})[_0x3c23('0x22')](respondWithResult(_0xa58be9,null))[_0x3c23('0x41')](function(_0x4fcf57){console[_0x3c23('0xac')](_0x3c23('0xaf')+_0x4fcf57);var _0x1ca175=_0x5d0471['query']['test']?0x1f4:_0x4fcf57[_0x3c23('0xb0')]||0x1f4;logger[_0x3c23('0x24')](_0x4fcf57[_0x3c23('0xb1')]);delete _0x4fcf57[_0x3c23('0x25')];if(_0x1ca175===0x191){_0x1ca175=0x190;}_0xa58be9[_0x3c23('0x1a')](_0x1ca175)[_0x3c23('0xb2')](_0x5d0471[_0x3c23('0x2f')][_0x3c23('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x4fcf57[_0x3c23('0xb0')]}:_0x4fcf57);});};function createFieldObject(_0x158c87,_0x532c0b,_0x55893d,_0x4631fa,_0x194be0,_0x173cb8){return new Promise(function(_0x2236d4,_0x5f08e9){var _0x11141b={'id':_0x4631fa,'name':_0x194be0,'custom':_0x173cb8};if(_0x55893d==='boolean'){_0x11141b[_0x3c23('0x3e')]=[{'name':_0x3c23('0xb4'),'value':_0x3c23('0xb5')},{'name':_0x3c23('0xb6'),'value':_0x3c23('0xb7')}];_0x2236d4(_0x11141b);}else{var _0x57d405={'method':_0x3c23('0xa1'),'uri':_0x158c87+_0x3c23('0xb8')+_0x4631fa,'auth':_0x532c0b,'json':!![]};return rp(_0x57d405)[_0x3c23('0x22')](function(_0x3fe867){var _0x3ff145=[];if(_0x3fe867[_0x3c23('0xa2')]['length']>0x0){_0x3fe867['result'][_0x3c23('0xa7')](function(_0x263c5d){if(_0x263c5d[_0x3c23('0xb9')]===_0x3c23('0xb7')){var _0x50e635={'name':_0x263c5d[_0x3c23('0xa9')],'value':_0x263c5d['value']};_0x3ff145[_0x3c23('0xaa')](_0x50e635);}});}_0x11141b[_0x3c23('0x3e')]=_0x3ff145;if(_0x11141b[_0x3c23('0x3e')]['length']>0x0){_0x2236d4(_0x11141b);}else{if(_0x173cb8==![]){_0x2236d4();}else{_0x2236d4(_0x11141b);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9c303b4..f706e10 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0xc8a0be,_0x259152){var _0x4a3134=function(_0x311974){while(--_0x311974){_0xc8a0be['push'](_0xc8a0be['shift']());}};_0x4a3134(++_0x259152);}(_0x1261,0x144));var _0x1126=function(_0x56aac9,_0x197362){_0x56aac9=_0x56aac9-0x0;var _0x139b0d=_0x1261[_0x56aac9];return _0x139b0d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x3df0b9,_0x268e99){var _0x5dab68=function(_0x596581){while(--_0x596581){_0x3df0b9['push'](_0x3df0b9['shift']());}};_0x5dab68(++_0x268e99);}(_0xda19,0xd5));var _0x9da1=function(_0x33a13d,_0x1073ec){_0x33a13d=_0x33a13d-0x0;var _0xbf0b74=_0xda19[_0x33a13d];return _0xbf0b74;};'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'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 2a6e72d..e17a532 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 _0xa068=['result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowServicenowAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0xa068,0x1cc));var _0x8a06=function(_0x356a68,_0x54d399){_0x356a68=_0x356a68-0x0;var _0x5b3c51=_0xa068[_0x356a68];return _0x5b3c51;};'use strict';var _=require(_0x8a06('0x0'));var util=require(_0x8a06('0x1'));var moment=require(_0x8a06('0x2'));var BPromise=require(_0x8a06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a06('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a06('0x5'));var logger=require('../../config/logger')(_0x8a06('0x6'));var config=require(_0x8a06('0x7'));var jayson=require(_0x8a06('0x8'));var client=jayson[_0x8a06('0x9')][_0x8a06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210023,_0x42ce17,_0x55153d){return new BPromise(function(_0x32c0e3,_0xec965a){return client[_0x8a06('0xb')](_0x210023,_0x55153d)[_0x8a06('0xc')](function(_0x479d00){logger['info'](_0x8a06('0xd'),_0x42ce17,_0x8a06('0xe'));logger[_0x8a06('0xf')](_0x8a06('0x10'),_0x42ce17,_0x8a06('0xe'),JSON['stringify'](_0x479d00));if(_0x479d00[_0x8a06('0x11')]){if(_0x479d00[_0x8a06('0x11')][_0x8a06('0x12')]===0x1f4){logger[_0x8a06('0x11')](_0x8a06('0xd'),_0x42ce17,_0x479d00[_0x8a06('0x11')]['message']);return _0xec965a(_0x479d00[_0x8a06('0x11')][_0x8a06('0x13')]);}logger[_0x8a06('0x11')](_0x8a06('0xd'),_0x42ce17,_0x479d00[_0x8a06('0x11')][_0x8a06('0x13')]);return _0x32c0e3(_0x479d00[_0x8a06('0x11')][_0x8a06('0x13')]);}else{logger[_0x8a06('0x14')](_0x8a06('0xd'),_0x42ce17,_0x8a06('0xe'));_0x32c0e3(_0x479d00[_0x8a06('0x15')][_0x8a06('0x13')]);}})[_0x8a06('0x16')](function(_0x139b35){logger[_0x8a06('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x42ce17,_0x139b35);_0xec965a(_0x139b35);});});}exports[_0x8a06('0x17')]=function(_0x44841b){var _0x2fd6f9=this;return new Promise(function(_0x50255e,_0x2aa816){return db[_0x8a06('0x18')][_0x8a06('0x19')]({'raw':_0x44841b[_0x8a06('0x1a')]?_0x44841b[_0x8a06('0x1a')][_0x8a06('0x1b')]===undefined?!![]:![]:!![],'where':_0x44841b[_0x8a06('0x1a')]?_0x44841b[_0x8a06('0x1a')][_0x8a06('0x1c')]||null:null,'attributes':_0x44841b[_0x8a06('0x1a')]?_0x44841b[_0x8a06('0x1a')][_0x8a06('0x1d')]||null:null,'limit':_0x44841b['options']?_0x44841b['options'][_0x8a06('0x1e')]||null:null,'include':_0x44841b[_0x8a06('0x1a')]?_0x44841b[_0x8a06('0x1a')][_0x8a06('0x1f')]?_['map'](_0x44841b[_0x8a06('0x1a')][_0x8a06('0x1f')],function(_0x57a112){return{'model':db[_0x57a112[_0x8a06('0x20')]],'as':_0x57a112['as'],'attributes':_0x57a112[_0x8a06('0x1d')],'include':_0x57a112[_0x8a06('0x1f')]?_[_0x8a06('0x21')](_0x57a112[_0x8a06('0x1f')],function(_0x527026){return{'model':db[_0x527026[_0x8a06('0x20')]],'as':_0x527026['as'],'attributes':_0x527026[_0x8a06('0x1d')],'include':_0x527026[_0x8a06('0x1f')]?_[_0x8a06('0x21')](_0x527026['include'],function(_0x441c73){return{'model':db[_0x441c73[_0x8a06('0x20')]],'as':_0x441c73['as'],'attributes':_0x441c73['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a06('0xc')](function(_0x963e82){logger[_0x8a06('0x14')](_0x8a06('0x17'),_0x44841b);logger[_0x8a06('0xf')](_0x8a06('0x17'),_0x44841b,JSON['stringify'](_0x963e82));_0x50255e(_0x963e82);})['catch'](function(_0xa8c839){logger[_0x8a06('0x11')](_0x8a06('0x17'),_0xa8c839[_0x8a06('0x13')],_0x44841b);_0x2aa816(_0x2fd6f9[_0x8a06('0x11')](0x1f4,_0xa8c839[_0x8a06('0x13')]));});});};exports[_0x8a06('0x22')]=function(_0x52549f){var _0xb5d205=this;return new Promise(function(_0x525083,_0x21e6d7){return db['ServicenowAccount'][_0x8a06('0x23')]({'raw':_0x52549f[_0x8a06('0x1a')]?_0x52549f['options'][_0x8a06('0x1b')]===undefined?!![]:![]:!![],'where':_0x52549f['options']?_0x52549f[_0x8a06('0x1a')][_0x8a06('0x1c')]||null:null,'attributes':_0x52549f[_0x8a06('0x1a')]?_0x52549f[_0x8a06('0x1a')]['attributes']||null:null,'include':_0x52549f['options']?_0x52549f[_0x8a06('0x1a')][_0x8a06('0x1f')]?_[_0x8a06('0x21')](_0x52549f[_0x8a06('0x1a')][_0x8a06('0x1f')],function(_0x17d942){return{'model':db[_0x17d942[_0x8a06('0x20')]],'as':_0x17d942['as'],'attributes':_0x17d942[_0x8a06('0x1d')],'include':_0x17d942[_0x8a06('0x1f')]?_['map'](_0x17d942[_0x8a06('0x1f')],function(_0x326ad3){return{'model':db[_0x326ad3['model']],'as':_0x326ad3['as'],'attributes':_0x326ad3[_0x8a06('0x1d')],'include':_0x326ad3[_0x8a06('0x1f')]?_['map'](_0x326ad3[_0x8a06('0x1f')],function(_0xddc9ab){return{'model':db[_0xddc9ab['model']],'as':_0xddc9ab['as'],'attributes':_0xddc9ab[_0x8a06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8a06('0xc')](function(_0x3b6d07){logger[_0x8a06('0x14')]('ShowServicenowAccount',_0x52549f);logger[_0x8a06('0xf')](_0x8a06('0x22'),_0x52549f,JSON[_0x8a06('0x24')](_0x3b6d07));_0x525083(_0x3b6d07);})[_0x8a06('0x16')](function(_0x52d5b3){logger['error'](_0x8a06('0x22'),_0x52d5b3['message'],_0x52549f);_0x21e6d7(_0xb5d205[_0x8a06('0x11')](0x1f4,_0x52d5b3[_0x8a06('0x13')]));});});}; \ No newline at end of file +var _0x17cb=['../../config/logger','../../config/environment','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','stringify','find','then','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2eb2dc,_0x401d0f){var _0x1f2f56=function(_0x288161){while(--_0x288161){_0x2eb2dc['push'](_0x2eb2dc['shift']());}};_0x1f2f56(++_0x401d0f);}(_0x17cb,0x120));var _0xb17c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17cb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb17c('0x0'));var util=require(_0xb17c('0x1'));var moment=require(_0xb17c('0x2'));var BPromise=require(_0xb17c('0x3'));var rs=require(_0xb17c('0x4'));var fs=require('fs');var Redis=require(_0xb17c('0x5'));var db=require(_0xb17c('0x6'))['db'];var utils=require(_0xb17c('0x7'));var logger=require(_0xb17c('0x8'))('rpc');var config=require(_0xb17c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb17c('0xa')][_0xb17c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1751ec,_0x1df3ea,_0x2d8dc6){return new BPromise(function(_0x1952b2,_0x2b81a2){return client[_0xb17c('0xc')](_0x1751ec,_0x2d8dc6)['then'](function(_0x5552df){logger[_0xb17c('0xd')](_0xb17c('0xe'),_0x1df3ea,_0xb17c('0xf'));logger[_0xb17c('0x10')](_0xb17c('0x11'),_0x1df3ea,_0xb17c('0xf'),JSON['stringify'](_0x5552df));if(_0x5552df[_0xb17c('0x12')]){if(_0x5552df[_0xb17c('0x12')][_0xb17c('0x13')]===0x1f4){logger[_0xb17c('0x12')](_0xb17c('0xe'),_0x1df3ea,_0x5552df[_0xb17c('0x12')]['message']);return _0x2b81a2(_0x5552df[_0xb17c('0x12')][_0xb17c('0x14')]);}logger[_0xb17c('0x12')](_0xb17c('0xe'),_0x1df3ea,_0x5552df[_0xb17c('0x12')][_0xb17c('0x14')]);return _0x1952b2(_0x5552df['error'][_0xb17c('0x14')]);}else{logger[_0xb17c('0xd')](_0xb17c('0xe'),_0x1df3ea,_0xb17c('0xf'));_0x1952b2(_0x5552df[_0xb17c('0x15')][_0xb17c('0x14')]);}})[_0xb17c('0x16')](function(_0x24b5dd){logger[_0xb17c('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1df3ea,_0x24b5dd);_0x2b81a2(_0x24b5dd);});});}exports[_0xb17c('0x17')]=function(_0x35a342){var _0x145ed0=this;return new Promise(function(_0x2173e6,_0x47a2ed){return db[_0xb17c('0x18')][_0xb17c('0x19')]({'raw':_0x35a342[_0xb17c('0x1a')]?_0x35a342[_0xb17c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x35a342[_0xb17c('0x1a')]?_0x35a342[_0xb17c('0x1a')][_0xb17c('0x1b')]||null:null,'attributes':_0x35a342[_0xb17c('0x1a')]?_0x35a342[_0xb17c('0x1a')][_0xb17c('0x1c')]||null:null,'limit':_0x35a342[_0xb17c('0x1a')]?_0x35a342['options'][_0xb17c('0x1d')]||null:null,'include':_0x35a342[_0xb17c('0x1a')]?_0x35a342['options'][_0xb17c('0x1e')]?_[_0xb17c('0x1f')](_0x35a342[_0xb17c('0x1a')][_0xb17c('0x1e')],function(_0x200425){return{'model':db[_0x200425[_0xb17c('0x20')]],'as':_0x200425['as'],'attributes':_0x200425[_0xb17c('0x1c')],'include':_0x200425[_0xb17c('0x1e')]?_[_0xb17c('0x1f')](_0x200425['include'],function(_0x925343){return{'model':db[_0x925343[_0xb17c('0x20')]],'as':_0x925343['as'],'attributes':_0x925343[_0xb17c('0x1c')],'include':_0x925343[_0xb17c('0x1e')]?_['map'](_0x925343[_0xb17c('0x1e')],function(_0x1f9f94){return{'model':db[_0x1f9f94[_0xb17c('0x20')]],'as':_0x1f9f94['as'],'attributes':_0x1f9f94[_0xb17c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b8aa3){logger[_0xb17c('0xd')]('GetServicenowAccount',_0x35a342);logger[_0xb17c('0x10')](_0xb17c('0x17'),_0x35a342,JSON[_0xb17c('0x21')](_0x2b8aa3));_0x2173e6(_0x2b8aa3);})['catch'](function(_0x593548){logger['error']('GetServicenowAccount',_0x593548['message'],_0x35a342);_0x47a2ed(_0x145ed0['error'](0x1f4,_0x593548[_0xb17c('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x3eb6b5){var _0x24e074=this;return new Promise(function(_0x23e078,_0x5e319b){return db[_0xb17c('0x18')][_0xb17c('0x22')]({'raw':_0x3eb6b5['options']?_0x3eb6b5['options']['raw']===undefined?!![]:![]:!![],'where':_0x3eb6b5[_0xb17c('0x1a')]?_0x3eb6b5[_0xb17c('0x1a')][_0xb17c('0x1b')]||null:null,'attributes':_0x3eb6b5[_0xb17c('0x1a')]?_0x3eb6b5[_0xb17c('0x1a')][_0xb17c('0x1c')]||null:null,'include':_0x3eb6b5[_0xb17c('0x1a')]?_0x3eb6b5[_0xb17c('0x1a')][_0xb17c('0x1e')]?_[_0xb17c('0x1f')](_0x3eb6b5['options'][_0xb17c('0x1e')],function(_0x5cc4f1){return{'model':db[_0x5cc4f1[_0xb17c('0x20')]],'as':_0x5cc4f1['as'],'attributes':_0x5cc4f1[_0xb17c('0x1c')],'include':_0x5cc4f1[_0xb17c('0x1e')]?_[_0xb17c('0x1f')](_0x5cc4f1[_0xb17c('0x1e')],function(_0x468bee){return{'model':db[_0x468bee[_0xb17c('0x20')]],'as':_0x468bee['as'],'attributes':_0x468bee['attributes'],'include':_0x468bee[_0xb17c('0x1e')]?_[_0xb17c('0x1f')](_0x468bee[_0xb17c('0x1e')],function(_0xd36e5a){return{'model':db[_0xd36e5a[_0xb17c('0x20')]],'as':_0xd36e5a['as'],'attributes':_0xd36e5a[_0xb17c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb17c('0x23')](function(_0x4febba){logger[_0xb17c('0xd')](_0xb17c('0x24'),_0x3eb6b5);logger['debug'](_0xb17c('0x24'),_0x3eb6b5,JSON[_0xb17c('0x21')](_0x4febba));_0x23e078(_0x4febba);})[_0xb17c('0x16')](function(_0x229f03){logger['error'](_0xb17c('0x24'),_0x229f03[_0xb17c('0x14')],_0x3eb6b5);_0x5e319b(_0x24e074['error'](0x1f4,_0x229f03[_0xb17c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 5ad58cb..0985548 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 _0xa59f=['/:id','show','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index'];(function(_0x401af0,_0x1a29f8){var _0x4ab016=function(_0xba68ca){while(--_0xba68ca){_0x401af0['push'](_0x401af0['shift']());}};_0x4ab016(++_0x1a29f8);}(_0xa59f,0xbd));var _0xfa59=function(_0x405476,_0x1fa8aa){_0x405476=_0x405476-0x0;var _0x4d85d7=_0xa59f[_0x405476];return _0x4d85d7;};'use strict';var multer=require(_0xfa59('0x0'));var util=require('util');var path=require(_0xfa59('0x1'));var timeout=require(_0xfa59('0x2'));var express=require(_0xfa59('0x3'));var router=express[_0xfa59('0x4')]();var fs_extra=require(_0xfa59('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa59('0x6'));var config=require('../../config/environment');var controller=require(_0xfa59('0x7'));router[_0xfa59('0x8')]('/',auth[_0xfa59('0x9')](),controller[_0xfa59('0xa')]);router[_0xfa59('0x8')](_0xfa59('0xb'),auth['isAuthenticated'](),controller[_0xfa59('0xc')]);router[_0xfa59('0x8')]('/:id/fields',auth[_0xfa59('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xfa59('0xd')]);router['get']('/:id/descriptions',auth[_0xfa59('0x9')](),controller[_0xfa59('0xe')]);router['post']('/',auth[_0xfa59('0x9')](),controller[_0xfa59('0xf')]);router[_0xfa59('0x10')](_0xfa59('0xb'),auth[_0xfa59('0x9')](),controller[_0xfa59('0x11')]);router['delete'](_0xfa59('0xb'),auth['isAuthenticated'](),controller[_0xfa59('0x12')]);module[_0xfa59('0x13')]=router; \ No newline at end of file +var _0xc5a3=['getDescriptions','post','create','put','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x47fe0e,_0x44dc4e){var _0x145beb=function(_0xa22c29){while(--_0xa22c29){_0x47fe0e['push'](_0x47fe0e['shift']());}};_0x145beb(++_0x44dc4e);}(_0xc5a3,0x16e));var _0x3c5a=function(_0x4d9d44,_0x575d9f){_0x4d9d44=_0x4d9d44-0x0;var _0x4ca1e8=_0xc5a3[_0x4d9d44];return _0x4ca1e8;};'use strict';var multer=require('multer');var util=require(_0x3c5a('0x0'));var path=require(_0x3c5a('0x1'));var timeout=require(_0x3c5a('0x2'));var express=require('express');var router=express[_0x3c5a('0x3')]();var fs_extra=require(_0x3c5a('0x4'));var auth=require(_0x3c5a('0x5'));var interaction=require(_0x3c5a('0x6'));var config=require(_0x3c5a('0x7'));var controller=require(_0x3c5a('0x8'));router[_0x3c5a('0x9')]('/',auth[_0x3c5a('0xa')](),controller[_0x3c5a('0xb')]);router[_0x3c5a('0x9')](_0x3c5a('0xc'),auth[_0x3c5a('0xa')](),controller[_0x3c5a('0xd')]);router[_0x3c5a('0x9')](_0x3c5a('0xe'),auth[_0x3c5a('0xa')](),controller[_0x3c5a('0xf')]);router['get'](_0x3c5a('0x10'),auth['isAuthenticated'](),controller[_0x3c5a('0x11')]);router[_0x3c5a('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3c5a('0x12')]);router[_0x3c5a('0x13')]('/',auth[_0x3c5a('0xa')](),controller[_0x3c5a('0x14')]);router[_0x3c5a('0x15')]('/:id',auth[_0x3c5a('0xa')](),controller[_0x3c5a('0x16')]);router[_0x3c5a('0x17')](_0x3c5a('0xc'),auth[_0x3c5a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 950f047..960c8ae 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 _0x7994=['exports','STRING','sequelize'];(function(_0x111e76,_0x5e5077){var _0x5127f4=function(_0x681201){while(--_0x681201){_0x111e76['push'](_0x111e76['shift']());}};_0x5127f4(++_0x5e5077);}(_0x7994,0x107));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4799('0x0'));module[_0x4799('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4799('0x2')]}}; \ No newline at end of file +var _0x1854=['exports','STRING'];(function(_0x351cfe,_0x30ed80){var _0x3334d6=function(_0x17b213){while(--_0x17b213){_0x351cfe['push'](_0x351cfe['shift']());}};_0x3334d6(++_0x30ed80);}(_0x1854,0x88));var _0x4185=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x1854[_0x269ee8];return _0x4d98bd;};'use strict';var Sequelize=require('sequelize');module[_0x4185('0x0')]={'name':{'type':Sequelize[_0x4185('0x1')]},'description':{'type':Sequelize[_0x4185('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 4f05dc8..466f65e 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 _0x627a=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','then','rows','catch','params','create','body','find','getFields','findOne','ServicenowField','order','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs'];(function(_0x33105a,_0x22d5cb){var _0x5b2830=function(_0x168995){while(--_0x168995){_0x33105a['push'](_0x33105a['shift']());}};_0x5b2830(++_0x22d5cb);}(_0x627a,0x1d0));var _0xa627=function(_0x2f8aa6,_0x3ebee4){_0x2f8aa6=_0x2f8aa6-0x0;var _0x42c928=_0x627a[_0x2f8aa6];return _0x42c928;};'use strict';var emlformat=require(_0xa627('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa627('0x1'));var jsonpatch=require(_0xa627('0x2'));var rp=require(_0xa627('0x3'));var moment=require(_0xa627('0x4'));var BPromise=require(_0xa627('0x5'));var Mustache=require(_0xa627('0x6'));var util=require(_0xa627('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa627('0x8'));var ejs=require(_0xa627('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa627('0xa'));var squel=require('squel');var crypto=require(_0xa627('0xb'));var jsforce=require(_0xa627('0xc'));var deskjs=require(_0xa627('0xd'));var toCsv=require(_0xa627('0x8'));var querystring=require(_0xa627('0xe'));var Papa=require(_0xa627('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa627('0x10'));var as=require(_0xa627('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa627('0x12'))(_0xa627('0x13'));var utils=require(_0xa627('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa627('0x15'));var db=require(_0xa627('0x16'))['db'];function respondWithStatusCode(_0x2dd90f,_0x151996){_0x151996=_0x151996||0xcc;return function(_0x4ca6f9){if(_0x4ca6f9){return _0x2dd90f['sendStatus'](_0x151996);}return _0x2dd90f[_0xa627('0x17')](_0x151996)['end']();};}function respondWithResult(_0xa0e8e3,_0x564a85){_0x564a85=_0x564a85||0xc8;return function(_0x2644c8){if(_0x2644c8){return _0xa0e8e3[_0xa627('0x17')](_0x564a85)[_0xa627('0x18')](_0x2644c8);}};}function respondWithFilteredResult(_0x23cba7,_0x354181){return function(_0x26f10f){if(_0x26f10f){var _0x74212=typeof _0x354181['offset']===_0xa627('0x19')&&typeof _0x354181[_0xa627('0x1a')]===_0xa627('0x19');var _0x72e6bc=_0x26f10f[_0xa627('0x1b')];var _0x5e5456=_0x74212?0x0:_0x354181[_0xa627('0x1c')];var _0x1bf491=_0x74212?_0x26f10f['count']:_0x354181[_0xa627('0x1c')]+_0x354181[_0xa627('0x1a')];var _0x7d9f58;if(_0x1bf491>=_0x72e6bc){_0x1bf491=_0x72e6bc;_0x7d9f58=0xc8;}else{_0x7d9f58=0xce;}_0x23cba7['status'](_0x7d9f58);return _0x23cba7['set'](_0xa627('0x1d'),_0x5e5456+'-'+_0x1bf491+'/'+_0x72e6bc)[_0xa627('0x18')](_0x26f10f);}return null;};}function patchUpdates(_0x202008){return function(_0x295ee9){try{jsonpatch[_0xa627('0x1e')](_0x295ee9,_0x202008,!![]);}catch(_0x38e1bd){return BPromise[_0xa627('0x1f')](_0x38e1bd);}return _0x295ee9[_0xa627('0x20')]();};}function saveUpdates(_0x2f0f55,_0x1c7ae7){return function(_0x170ddc){if(_0x170ddc){return _0x170ddc[_0xa627('0x21')](_0x2f0f55)['then'](function(_0x46f83){return _0x46f83;});}return null;};}function removeEntity(_0x44a7e2,_0x2263f3){return function(_0x534942){if(_0x534942){return _0x534942[_0xa627('0x22')]()['then'](function(){_0x44a7e2[_0xa627('0x17')](0xcc)[_0xa627('0x23')]();});}};}function handleEntityNotFound(_0x3099de,_0x2a759e){return function(_0x51a9a1){if(!_0x51a9a1){_0x3099de[_0xa627('0x24')](0x194);}return _0x51a9a1;};}function handleError(_0x58589b,_0x5e048a){_0x5e048a=_0x5e048a||0x1f4;return function(_0xab2099){logger[_0xa627('0x25')](_0xab2099[_0xa627('0x26')]);if(_0xab2099[_0xa627('0x27')]){delete _0xab2099[_0xa627('0x27')];}_0x58589b[_0xa627('0x17')](_0x5e048a)['send'](_0xab2099);};}exports[_0xa627('0x28')]=function(_0x40a8d0,_0xb75c8){var _0x1d7c60={},_0x206c93={},_0x5dd1f9={'count':0x0,'rows':[]};var _0x17c39d=_[_0xa627('0x29')](db['ServicenowConfiguration'][_0xa627('0x2a')],function(_0x248e4a){return{'name':_0x248e4a[_0xa627('0x2b')],'type':_0x248e4a[_0xa627('0x2c')]['key']};});_0x206c93[_0xa627('0x2d')]=_[_0xa627('0x29')](_0x17c39d,_0xa627('0x27'));_0x206c93[_0xa627('0x2e')]=_[_0xa627('0x2f')](_0x40a8d0[_0xa627('0x2e')]);_0x206c93[_0xa627('0x30')]=_[_0xa627('0x31')](_0x206c93['model'],_0x206c93['query']);_0x1d7c60[_0xa627('0x32')]=_['intersection'](_0x206c93[_0xa627('0x2d')],qs[_0xa627('0x33')](_0x40a8d0[_0xa627('0x2e')][_0xa627('0x33')]));_0x1d7c60[_0xa627('0x32')]=_0x1d7c60[_0xa627('0x32')][_0xa627('0x34')]?_0x1d7c60[_0xa627('0x32')]:_0x206c93[_0xa627('0x2d')];if(!_0x40a8d0[_0xa627('0x2e')][_0xa627('0x35')](_0xa627('0x36'))){_0x1d7c60['limit']=qs[_0xa627('0x1a')](_0x40a8d0[_0xa627('0x2e')]['limit']);_0x1d7c60[_0xa627('0x1c')]=qs[_0xa627('0x1c')](_0x40a8d0[_0xa627('0x2e')][_0xa627('0x1c')]);}_0x1d7c60['order']=qs[_0xa627('0x37')](_0x40a8d0[_0xa627('0x2e')][_0xa627('0x37')]);_0x1d7c60[_0xa627('0x38')]=qs[_0xa627('0x30')](_['pick'](_0x40a8d0['query'],_0x206c93[_0xa627('0x30')]),_0x17c39d);if(_0x40a8d0[_0xa627('0x2e')][_0xa627('0x39')]){_0x1d7c60['where']=_[_0xa627('0x3a')](_0x1d7c60[_0xa627('0x38')],{'$or':_[_0xa627('0x29')](_0x17c39d,function(_0x58ac85){if(_0x58ac85[_0xa627('0x2c')]!==_0xa627('0x3b')){var _0xb6da6a={};_0xb6da6a[_0x58ac85['name']]={'$like':'%'+_0x40a8d0[_0xa627('0x2e')]['filter']+'%'};return _0xb6da6a;}})});}_0x1d7c60=_['merge']({},_0x1d7c60,_0x40a8d0[_0xa627('0x3c')]);var _0x362b31={'where':_0x1d7c60[_0xa627('0x38')]};return db[_0xa627('0x3d')][_0xa627('0x1b')](_0x362b31)['then'](function(_0x1f8bc2){_0x5dd1f9[_0xa627('0x1b')]=_0x1f8bc2;if(_0x40a8d0['query'][_0xa627('0x3e')]){_0x1d7c60[_0xa627('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xa627('0x40')](_0x1d7c60);})[_0xa627('0x41')](function(_0x23396d){_0x5dd1f9[_0xa627('0x42')]=_0x23396d;return _0x5dd1f9;})[_0xa627('0x41')](respondWithFilteredResult(_0xb75c8,_0x1d7c60))[_0xa627('0x43')](handleError(_0xb75c8,null));};exports['show']=function(_0x330f84,_0x2ffc3e){var _0x547a2c={'raw':![],'where':{'id':_0x330f84[_0xa627('0x44')]['id']}},_0x33e25e={};_0x33e25e[_0xa627('0x2d')]=_[_0xa627('0x2f')](db[_0xa627('0x3d')][_0xa627('0x2a')]);_0x33e25e[_0xa627('0x2e')]=_[_0xa627('0x2f')](_0x330f84[_0xa627('0x2e')]);_0x33e25e[_0xa627('0x30')]=_[_0xa627('0x31')](_0x33e25e['model'],_0x33e25e[_0xa627('0x2e')]);_0x547a2c[_0xa627('0x32')]=_['intersection'](_0x33e25e['model'],qs[_0xa627('0x33')](_0x330f84['query'][_0xa627('0x33')]));_0x547a2c[_0xa627('0x32')]=_0x547a2c['attributes'][_0xa627('0x34')]?_0x547a2c[_0xa627('0x32')]:_0x33e25e[_0xa627('0x2d')];if(_0x330f84[_0xa627('0x2e')][_0xa627('0x3e')]){_0x547a2c[_0xa627('0x3f')]=[{'all':!![]}];}_0x547a2c=_[_0xa627('0x3a')]({},_0x547a2c,_0x330f84[_0xa627('0x3c')]);return db['ServicenowConfiguration']['find'](_0x547a2c)['then'](handleEntityNotFound(_0x2ffc3e,null))['then'](respondWithResult(_0x2ffc3e,null))[_0xa627('0x43')](handleError(_0x2ffc3e,null));};exports[_0xa627('0x45')]=function(_0x3a1ba0,_0x4a4c64){return db[_0xa627('0x3d')][_0xa627('0x45')](_0x3a1ba0[_0xa627('0x46')],{})[_0xa627('0x41')](respondWithResult(_0x4a4c64,0xc9))[_0xa627('0x43')](handleError(_0x4a4c64,null));};exports[_0xa627('0x21')]=function(_0x32adb3,_0x591a39){if(_0x32adb3[_0xa627('0x46')]['id']){delete _0x32adb3[_0xa627('0x46')]['id'];}return db[_0xa627('0x3d')][_0xa627('0x47')]({'where':{'id':_0x32adb3['params']['id']}})[_0xa627('0x41')](handleEntityNotFound(_0x591a39,null))[_0xa627('0x41')](saveUpdates(_0x32adb3[_0xa627('0x46')],null))['then'](respondWithResult(_0x591a39,null))['catch'](handleError(_0x591a39,null));};exports[_0xa627('0x22')]=function(_0x578b80,_0x5c6cbc){return db[_0xa627('0x3d')][_0xa627('0x47')]({'where':{'id':_0x578b80[_0xa627('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c6cbc,null))['then'](removeEntity(_0x5c6cbc,null))[_0xa627('0x43')](handleError(_0x5c6cbc,null));};exports[_0xa627('0x48')]=function(_0x6f4c37,_0x596e27,_0x57f41){var _0x4538a0={};var _0xd6e55d={};var _0x30952c;var _0x555da6;return db['ServicenowConfiguration'][_0xa627('0x49')]({'where':{'id':_0x6f4c37['params']['id']}})[_0xa627('0x41')](handleEntityNotFound(_0x596e27,null))[_0xa627('0x41')](function(_0x2a5b63){if(_0x2a5b63){_0x30952c=_0x2a5b63;_0xd6e55d[_0xa627('0x2d')]=_[_0xa627('0x2f')](db[_0xa627('0x4a')]['rawAttributes']);_0xd6e55d[_0xa627('0x2e')]=_[_0xa627('0x2f')](_0x6f4c37[_0xa627('0x2e')]);_0xd6e55d[_0xa627('0x30')]=_[_0xa627('0x31')](_0xd6e55d[_0xa627('0x2d')],_0xd6e55d[_0xa627('0x2e')]);_0x4538a0[_0xa627('0x32')]=_[_0xa627('0x31')](_0xd6e55d[_0xa627('0x2d')],qs[_0xa627('0x33')](_0x6f4c37['query'][_0xa627('0x33')]));_0x4538a0['attributes']=_0x4538a0[_0xa627('0x32')][_0xa627('0x34')]?_0x4538a0[_0xa627('0x32')]:_0xd6e55d[_0xa627('0x2d')];_0x4538a0[_0xa627('0x4b')]=qs[_0xa627('0x37')](_0x6f4c37[_0xa627('0x2e')]['sort']);_0x4538a0[_0xa627('0x38')]=qs[_0xa627('0x30')](_[_0xa627('0x4c')](_0x6f4c37[_0xa627('0x2e')],_0xd6e55d[_0xa627('0x30')]));if(_0x6f4c37[_0xa627('0x2e')][_0xa627('0x39')]){_0x4538a0[_0xa627('0x38')]=_[_0xa627('0x3a')](_0x4538a0[_0xa627('0x38')],{'$or':_[_0xa627('0x29')](_0x4538a0[_0xa627('0x32')],function(_0x3a28fd){var _0x389446={};_0x389446[_0x3a28fd]={'$like':'%'+_0x6f4c37[_0xa627('0x2e')][_0xa627('0x39')]+'%'};return _0x389446;})});}_0x4538a0=_[_0xa627('0x3a')]({},_0x4538a0,_0x6f4c37['options']);return _0x30952c[_0xa627('0x48')](_0x4538a0);}})[_0xa627('0x41')](function(_0x77fcef){if(_0x77fcef){_0x555da6=_0x77fcef[_0xa627('0x34')];if(!_0x6f4c37['query'][_0xa627('0x35')](_0xa627('0x36'))){_0x4538a0[_0xa627('0x1a')]=qs[_0xa627('0x1a')](_0x6f4c37['query'][_0xa627('0x1a')]);_0x4538a0[_0xa627('0x1c')]=qs[_0xa627('0x1c')](_0x6f4c37['query'][_0xa627('0x1c')]);}return _0x30952c[_0xa627('0x48')](_0x4538a0);}})[_0xa627('0x41')](function(_0x10f726){if(_0x10f726){return _0x10f726?{'count':_0x555da6,'rows':_0x10f726}:null;}})['then'](respondWithResult(_0x596e27,null))['catch'](handleError(_0x596e27,null));};exports[_0xa627('0x4d')]=function(_0x1f40bb,_0x32505c,_0x1749df){var _0x464bac={};var _0x4e2e79={};var _0x5c23dd;var _0x3bce9e;return db[_0xa627('0x3d')][_0xa627('0x49')]({'where':{'id':_0x1f40bb[_0xa627('0x44')]['id']}})[_0xa627('0x41')](handleEntityNotFound(_0x32505c,null))[_0xa627('0x41')](function(_0x4b8923){if(_0x4b8923){_0x5c23dd=_0x4b8923;_0x4e2e79[_0xa627('0x2d')]=_[_0xa627('0x2f')](db[_0xa627('0x4a')][_0xa627('0x2a')]);_0x4e2e79[_0xa627('0x2e')]=_['keys'](_0x1f40bb['query']);_0x4e2e79['filters']=_[_0xa627('0x31')](_0x4e2e79[_0xa627('0x2d')],_0x4e2e79[_0xa627('0x2e')]);_0x464bac[_0xa627('0x32')]=_['intersection'](_0x4e2e79[_0xa627('0x2d')],qs['fields'](_0x1f40bb[_0xa627('0x2e')][_0xa627('0x33')]));_0x464bac['attributes']=_0x464bac['attributes']['length']?_0x464bac['attributes']:_0x4e2e79['model'];_0x464bac[_0xa627('0x4b')]=qs['sort'](_0x1f40bb['query'][_0xa627('0x37')]);_0x464bac[_0xa627('0x38')]=qs['filters'](_[_0xa627('0x4c')](_0x1f40bb[_0xa627('0x2e')],_0x4e2e79[_0xa627('0x30')]));if(_0x1f40bb['query'][_0xa627('0x39')]){_0x464bac[_0xa627('0x38')]=_[_0xa627('0x3a')](_0x464bac[_0xa627('0x38')],{'$or':_[_0xa627('0x29')](_0x464bac['attributes'],function(_0x3ad412){var _0x560ffc={};_0x560ffc[_0x3ad412]={'$like':'%'+_0x1f40bb[_0xa627('0x2e')]['filter']+'%'};return _0x560ffc;})});}_0x464bac=_['merge']({},_0x464bac,_0x1f40bb[_0xa627('0x3c')]);return _0x5c23dd[_0xa627('0x4d')](_0x464bac);}})[_0xa627('0x41')](function(_0x10d805){if(_0x10d805){_0x3bce9e=_0x10d805['length'];if(!_0x1f40bb[_0xa627('0x2e')][_0xa627('0x35')](_0xa627('0x36'))){_0x464bac[_0xa627('0x1a')]=qs[_0xa627('0x1a')](_0x1f40bb['query'][_0xa627('0x1a')]);_0x464bac[_0xa627('0x1c')]=qs[_0xa627('0x1c')](_0x1f40bb[_0xa627('0x2e')]['offset']);}return _0x5c23dd[_0xa627('0x4d')](_0x464bac);}})[_0xa627('0x41')](function(_0x7caa02){if(_0x7caa02){return _0x7caa02?{'count':_0x3bce9e,'rows':_0x7caa02}:null;}})[_0xa627('0x41')](respondWithResult(_0x32505c,null))[_0xa627('0x43')](handleError(_0x32505c,null));};exports[_0xa627('0x4e')]=function(_0x5a2f8b,_0xcc8dc2,_0x325289){var _0x21c000={};var _0x12bf1c={};var _0x3b0e62;var _0x22859b;return db[_0xa627('0x3d')]['findOne']({'where':{'id':_0x5a2f8b[_0xa627('0x44')]['id']}})['then'](handleEntityNotFound(_0xcc8dc2,null))['then'](function(_0x55c6b9){if(_0x55c6b9){_0x3b0e62=_0x55c6b9;_0x12bf1c['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x12bf1c[_0xa627('0x2e')]=_[_0xa627('0x2f')](_0x5a2f8b[_0xa627('0x2e')]);_0x12bf1c[_0xa627('0x30')]=_['intersection'](_0x12bf1c['model'],_0x12bf1c[_0xa627('0x2e')]);_0x21c000['attributes']=_[_0xa627('0x31')](_0x12bf1c['model'],qs[_0xa627('0x33')](_0x5a2f8b[_0xa627('0x2e')]['fields']));_0x21c000[_0xa627('0x32')]=_0x21c000['attributes'][_0xa627('0x34')]?_0x21c000[_0xa627('0x32')]:_0x12bf1c[_0xa627('0x2d')];_0x21c000['order']=qs[_0xa627('0x37')](_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x37')]);_0x21c000[_0xa627('0x38')]=qs[_0xa627('0x30')](_[_0xa627('0x4c')](_0x5a2f8b['query'],_0x12bf1c[_0xa627('0x30')]));if(_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x39')]){_0x21c000['where']=_['merge'](_0x21c000[_0xa627('0x38')],{'$or':_['map'](_0x21c000[_0xa627('0x32')],function(_0xe57f77){var _0x138102={};_0x138102[_0xe57f77]={'$like':'%'+_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x39')]+'%'};return _0x138102;})});}_0x21c000=_[_0xa627('0x3a')]({},_0x21c000,_0x5a2f8b['options']);return _0x3b0e62[_0xa627('0x4e')](_0x21c000);}})[_0xa627('0x41')](function(_0x173e0f){if(_0x173e0f){_0x22859b=_0x173e0f['length'];if(!_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x35')](_0xa627('0x36'))){_0x21c000[_0xa627('0x1a')]=qs['limit'](_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x1a')]);_0x21c000['offset']=qs[_0xa627('0x1c')](_0x5a2f8b[_0xa627('0x2e')][_0xa627('0x1c')]);}return _0x3b0e62[_0xa627('0x4e')](_0x21c000);}})[_0xa627('0x41')](function(_0x63ab63){if(_0x63ab63){return _0x63ab63?{'count':_0x22859b,'rows':_0x63ab63}:null;}})[_0xa627('0x41')](respondWithResult(_0xcc8dc2,null))[_0xa627('0x43')](handleError(_0xcc8dc2,null));}; \ No newline at end of file +var _0xeb21=['getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','findAll','rows','find','catch','create','update','body','findOne','params','ServicenowField','hasOwnProperty','getSubjects'];(function(_0x434a5e,_0x17d0be){var _0x39ab58=function(_0x30f275){while(--_0x30f275){_0x434a5e['push'](_0x434a5e['shift']());}};_0x39ab58(++_0x17d0be);}(_0xeb21,0x191));var _0x1eb2=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0xeb21[_0x31b31b];return _0x2c8fc2;};'use strict';var emlformat=require(_0x1eb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1eb2('0x1'));var jsonpatch=require(_0x1eb2('0x2'));var rp=require(_0x1eb2('0x3'));var moment=require(_0x1eb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1eb2('0x5'));var util=require(_0x1eb2('0x6'));var path=require('path');var sox=require(_0x1eb2('0x7'));var csv=require(_0x1eb2('0x8'));var ejs=require(_0x1eb2('0x9'));var fs=require('fs');var fs_extra=require(_0x1eb2('0xa'));var _=require(_0x1eb2('0xb'));var squel=require(_0x1eb2('0xc'));var crypto=require('crypto');var jsforce=require(_0x1eb2('0xd'));var deskjs=require(_0x1eb2('0xe'));var toCsv=require(_0x1eb2('0x8'));var querystring=require('querystring');var Papa=require(_0x1eb2('0xf'));var Redis=require(_0x1eb2('0x10'));var authService=require(_0x1eb2('0x11'));var qs=require(_0x1eb2('0x12'));var as=require(_0x1eb2('0x13'));var hardwareService=require(_0x1eb2('0x14'));var logger=require(_0x1eb2('0x15'))(_0x1eb2('0x16'));var utils=require(_0x1eb2('0x17'));var config=require(_0x1eb2('0x18'));var licenseUtil=require(_0x1eb2('0x19'));var db=require(_0x1eb2('0x1a'))['db'];function respondWithStatusCode(_0x17fd2c,_0x45628c){_0x45628c=_0x45628c||0xcc;return function(_0x1c4907){if(_0x1c4907){return _0x17fd2c[_0x1eb2('0x1b')](_0x45628c);}return _0x17fd2c['status'](_0x45628c)[_0x1eb2('0x1c')]();};}function respondWithResult(_0x177972,_0x3d0a81){_0x3d0a81=_0x3d0a81||0xc8;return function(_0x550d92){if(_0x550d92){return _0x177972[_0x1eb2('0x1d')](_0x3d0a81)[_0x1eb2('0x1e')](_0x550d92);}};}function respondWithFilteredResult(_0x345d26,_0x4b31e6){return function(_0x159fbf){if(_0x159fbf){var _0x283ee2=typeof _0x4b31e6[_0x1eb2('0x1f')]===_0x1eb2('0x20')&&typeof _0x4b31e6[_0x1eb2('0x21')]==='undefined';var _0x3424fb=_0x159fbf['count'];var _0x46e293=_0x283ee2?0x0:_0x4b31e6[_0x1eb2('0x1f')];var _0x59dd09=_0x283ee2?_0x159fbf[_0x1eb2('0x22')]:_0x4b31e6[_0x1eb2('0x1f')]+_0x4b31e6[_0x1eb2('0x21')];var _0x5c608e;if(_0x59dd09>=_0x3424fb){_0x59dd09=_0x3424fb;_0x5c608e=0xc8;}else{_0x5c608e=0xce;}_0x345d26[_0x1eb2('0x1d')](_0x5c608e);return _0x345d26[_0x1eb2('0x23')]('Content-Range',_0x46e293+'-'+_0x59dd09+'/'+_0x3424fb)['json'](_0x159fbf);}return null;};}function patchUpdates(_0x260e61){return function(_0x4d06c){try{jsonpatch[_0x1eb2('0x24')](_0x4d06c,_0x260e61,!![]);}catch(_0x53bdfa){return BPromise[_0x1eb2('0x25')](_0x53bdfa);}return _0x4d06c[_0x1eb2('0x26')]();};}function saveUpdates(_0x30c8f8,_0xdbaa9d){return function(_0x4bcbd0){if(_0x4bcbd0){return _0x4bcbd0['update'](_0x30c8f8)[_0x1eb2('0x27')](function(_0x5d8abf){return _0x5d8abf;});}return null;};}function removeEntity(_0x4b109b,_0x41da42){return function(_0x4254c3){if(_0x4254c3){return _0x4254c3[_0x1eb2('0x28')]()[_0x1eb2('0x27')](function(){_0x4b109b['status'](0xcc)[_0x1eb2('0x1c')]();});}};}function handleEntityNotFound(_0x40fc51,_0x3da25c){return function(_0x2ab65e){if(!_0x2ab65e){_0x40fc51[_0x1eb2('0x1b')](0x194);}return _0x2ab65e;};}function handleError(_0x101c25,_0xf2ee52){_0xf2ee52=_0xf2ee52||0x1f4;return function(_0x2d592f){logger[_0x1eb2('0x29')](_0x2d592f['stack']);if(_0x2d592f[_0x1eb2('0x2a')]){delete _0x2d592f[_0x1eb2('0x2a')];}_0x101c25[_0x1eb2('0x1d')](_0xf2ee52)[_0x1eb2('0x2b')](_0x2d592f);};}exports[_0x1eb2('0x2c')]=function(_0x445053,_0x5b3149){var _0x3ddb73={},_0x4b815e={},_0x2ab93c={'count':0x0,'rows':[]};var _0x3fd302=_[_0x1eb2('0x2d')](db[_0x1eb2('0x2e')][_0x1eb2('0x2f')],function(_0x1a1c4b){return{'name':_0x1a1c4b[_0x1eb2('0x30')],'type':_0x1a1c4b[_0x1eb2('0x31')][_0x1eb2('0x32')]};});_0x4b815e[_0x1eb2('0x33')]=_[_0x1eb2('0x2d')](_0x3fd302,_0x1eb2('0x2a'));_0x4b815e['query']=_[_0x1eb2('0x34')](_0x445053[_0x1eb2('0x35')]);_0x4b815e['filters']=_[_0x1eb2('0x36')](_0x4b815e[_0x1eb2('0x33')],_0x4b815e[_0x1eb2('0x35')]);_0x3ddb73[_0x1eb2('0x37')]=_[_0x1eb2('0x36')](_0x4b815e[_0x1eb2('0x33')],qs[_0x1eb2('0x38')](_0x445053[_0x1eb2('0x35')]['fields']));_0x3ddb73['attributes']=_0x3ddb73[_0x1eb2('0x37')][_0x1eb2('0x39')]?_0x3ddb73[_0x1eb2('0x37')]:_0x4b815e[_0x1eb2('0x33')];if(!_0x445053['query']['hasOwnProperty'](_0x1eb2('0x3a'))){_0x3ddb73[_0x1eb2('0x21')]=qs['limit'](_0x445053[_0x1eb2('0x35')][_0x1eb2('0x21')]);_0x3ddb73[_0x1eb2('0x1f')]=qs[_0x1eb2('0x1f')](_0x445053['query']['offset']);}_0x3ddb73[_0x1eb2('0x3b')]=qs[_0x1eb2('0x3c')](_0x445053[_0x1eb2('0x35')]['sort']);_0x3ddb73[_0x1eb2('0x3d')]=qs['filters'](_[_0x1eb2('0x3e')](_0x445053[_0x1eb2('0x35')],_0x4b815e[_0x1eb2('0x3f')]),_0x3fd302);if(_0x445053['query'][_0x1eb2('0x40')]){_0x3ddb73[_0x1eb2('0x3d')]=_[_0x1eb2('0x41')](_0x3ddb73['where'],{'$or':_['map'](_0x3fd302,function(_0x3347ef){if(_0x3347ef[_0x1eb2('0x31')]!=='VIRTUAL'){var _0x40dfa6={};_0x40dfa6[_0x3347ef['name']]={'$like':'%'+_0x445053[_0x1eb2('0x35')][_0x1eb2('0x40')]+'%'};return _0x40dfa6;}})});}_0x3ddb73=_[_0x1eb2('0x41')]({},_0x3ddb73,_0x445053[_0x1eb2('0x42')]);var _0x38101e={'where':_0x3ddb73['where']};return db[_0x1eb2('0x2e')][_0x1eb2('0x22')](_0x38101e)[_0x1eb2('0x27')](function(_0x7ee59e){_0x2ab93c[_0x1eb2('0x22')]=_0x7ee59e;if(_0x445053[_0x1eb2('0x35')]['includeAll']){_0x3ddb73['include']=[{'all':!![]}];}return db[_0x1eb2('0x2e')][_0x1eb2('0x43')](_0x3ddb73);})[_0x1eb2('0x27')](function(_0x1c105a){_0x2ab93c[_0x1eb2('0x44')]=_0x1c105a;return _0x2ab93c;})[_0x1eb2('0x27')](respondWithFilteredResult(_0x5b3149,_0x3ddb73))['catch'](handleError(_0x5b3149,null));};exports['show']=function(_0x3e07e3,_0xca51d8){var _0x4d7ca5={'raw':![],'where':{'id':_0x3e07e3['params']['id']}},_0x3b0ccf={};_0x3b0ccf[_0x1eb2('0x33')]=_[_0x1eb2('0x34')](db[_0x1eb2('0x2e')][_0x1eb2('0x2f')]);_0x3b0ccf[_0x1eb2('0x35')]=_[_0x1eb2('0x34')](_0x3e07e3[_0x1eb2('0x35')]);_0x3b0ccf['filters']=_[_0x1eb2('0x36')](_0x3b0ccf[_0x1eb2('0x33')],_0x3b0ccf[_0x1eb2('0x35')]);_0x4d7ca5['attributes']=_['intersection'](_0x3b0ccf[_0x1eb2('0x33')],qs[_0x1eb2('0x38')](_0x3e07e3['query']['fields']));_0x4d7ca5['attributes']=_0x4d7ca5[_0x1eb2('0x37')]['length']?_0x4d7ca5[_0x1eb2('0x37')]:_0x3b0ccf[_0x1eb2('0x33')];if(_0x3e07e3[_0x1eb2('0x35')]['includeAll']){_0x4d7ca5['include']=[{'all':!![]}];}_0x4d7ca5=_[_0x1eb2('0x41')]({},_0x4d7ca5,_0x3e07e3['options']);return db['ServicenowConfiguration'][_0x1eb2('0x45')](_0x4d7ca5)[_0x1eb2('0x27')](handleEntityNotFound(_0xca51d8,null))[_0x1eb2('0x27')](respondWithResult(_0xca51d8,null))[_0x1eb2('0x46')](handleError(_0xca51d8,null));};exports['create']=function(_0x144a1b,_0x18ff18){return db[_0x1eb2('0x2e')][_0x1eb2('0x47')](_0x144a1b['body'],{})[_0x1eb2('0x27')](respondWithResult(_0x18ff18,0xc9))[_0x1eb2('0x46')](handleError(_0x18ff18,null));};exports[_0x1eb2('0x48')]=function(_0x3d6061,_0x49666b){if(_0x3d6061['body']['id']){delete _0x3d6061['body']['id'];}return db[_0x1eb2('0x2e')][_0x1eb2('0x45')]({'where':{'id':_0x3d6061['params']['id']}})[_0x1eb2('0x27')](handleEntityNotFound(_0x49666b,null))['then'](saveUpdates(_0x3d6061[_0x1eb2('0x49')],null))[_0x1eb2('0x27')](respondWithResult(_0x49666b,null))[_0x1eb2('0x46')](handleError(_0x49666b,null));};exports[_0x1eb2('0x28')]=function(_0xbc7a14,_0xd83df2){return db['ServicenowConfiguration'][_0x1eb2('0x45')]({'where':{'id':_0xbc7a14['params']['id']}})[_0x1eb2('0x27')](handleEntityNotFound(_0xd83df2,null))['then'](removeEntity(_0xd83df2,null))[_0x1eb2('0x46')](handleError(_0xd83df2,null));};exports['getFields']=function(_0x2799b2,_0x3ca4f9,_0x42b04c){var _0x2de6e0={};var _0x53ff0e={};var _0x5cfb98;var _0x2f4c10;return db[_0x1eb2('0x2e')][_0x1eb2('0x4a')]({'where':{'id':_0x2799b2[_0x1eb2('0x4b')]['id']}})[_0x1eb2('0x27')](handleEntityNotFound(_0x3ca4f9,null))[_0x1eb2('0x27')](function(_0x37edf4){if(_0x37edf4){_0x5cfb98=_0x37edf4;_0x53ff0e[_0x1eb2('0x33')]=_['keys'](db[_0x1eb2('0x4c')][_0x1eb2('0x2f')]);_0x53ff0e[_0x1eb2('0x35')]=_[_0x1eb2('0x34')](_0x2799b2[_0x1eb2('0x35')]);_0x53ff0e[_0x1eb2('0x3f')]=_[_0x1eb2('0x36')](_0x53ff0e[_0x1eb2('0x33')],_0x53ff0e[_0x1eb2('0x35')]);_0x2de6e0['attributes']=_['intersection'](_0x53ff0e['model'],qs[_0x1eb2('0x38')](_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x38')]));_0x2de6e0[_0x1eb2('0x37')]=_0x2de6e0[_0x1eb2('0x37')][_0x1eb2('0x39')]?_0x2de6e0[_0x1eb2('0x37')]:_0x53ff0e[_0x1eb2('0x33')];_0x2de6e0[_0x1eb2('0x3b')]=qs[_0x1eb2('0x3c')](_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x3c')]);_0x2de6e0[_0x1eb2('0x3d')]=qs[_0x1eb2('0x3f')](_[_0x1eb2('0x3e')](_0x2799b2[_0x1eb2('0x35')],_0x53ff0e[_0x1eb2('0x3f')]));if(_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x40')]){_0x2de6e0[_0x1eb2('0x3d')]=_[_0x1eb2('0x41')](_0x2de6e0[_0x1eb2('0x3d')],{'$or':_['map'](_0x2de6e0[_0x1eb2('0x37')],function(_0x2e33dd){var _0x40da19={};_0x40da19[_0x2e33dd]={'$like':'%'+_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x40')]+'%'};return _0x40da19;})});}_0x2de6e0=_[_0x1eb2('0x41')]({},_0x2de6e0,_0x2799b2[_0x1eb2('0x42')]);return _0x5cfb98['getFields'](_0x2de6e0);}})['then'](function(_0x98308a){if(_0x98308a){_0x2f4c10=_0x98308a[_0x1eb2('0x39')];if(!_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x4d')](_0x1eb2('0x3a'))){_0x2de6e0[_0x1eb2('0x21')]=qs[_0x1eb2('0x21')](_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x21')]);_0x2de6e0[_0x1eb2('0x1f')]=qs[_0x1eb2('0x1f')](_0x2799b2[_0x1eb2('0x35')][_0x1eb2('0x1f')]);}return _0x5cfb98['getFields'](_0x2de6e0);}})[_0x1eb2('0x27')](function(_0x13d56e){if(_0x13d56e){return _0x13d56e?{'count':_0x2f4c10,'rows':_0x13d56e}:null;}})[_0x1eb2('0x27')](respondWithResult(_0x3ca4f9,null))[_0x1eb2('0x46')](handleError(_0x3ca4f9,null));};exports[_0x1eb2('0x4e')]=function(_0x361123,_0x5ece9e,_0x371d1f){var _0x13eef9={};var _0x297ba8={};var _0x4e88c5;var _0x5f12fa;return db[_0x1eb2('0x2e')][_0x1eb2('0x4a')]({'where':{'id':_0x361123[_0x1eb2('0x4b')]['id']}})[_0x1eb2('0x27')](handleEntityNotFound(_0x5ece9e,null))[_0x1eb2('0x27')](function(_0x271884){if(_0x271884){_0x4e88c5=_0x271884;_0x297ba8[_0x1eb2('0x33')]=_[_0x1eb2('0x34')](db[_0x1eb2('0x4c')][_0x1eb2('0x2f')]);_0x297ba8[_0x1eb2('0x35')]=_[_0x1eb2('0x34')](_0x361123[_0x1eb2('0x35')]);_0x297ba8[_0x1eb2('0x3f')]=_[_0x1eb2('0x36')](_0x297ba8[_0x1eb2('0x33')],_0x297ba8[_0x1eb2('0x35')]);_0x13eef9[_0x1eb2('0x37')]=_['intersection'](_0x297ba8['model'],qs['fields'](_0x361123[_0x1eb2('0x35')][_0x1eb2('0x38')]));_0x13eef9[_0x1eb2('0x37')]=_0x13eef9[_0x1eb2('0x37')]['length']?_0x13eef9['attributes']:_0x297ba8[_0x1eb2('0x33')];_0x13eef9[_0x1eb2('0x3b')]=qs[_0x1eb2('0x3c')](_0x361123['query'][_0x1eb2('0x3c')]);_0x13eef9['where']=qs['filters'](_[_0x1eb2('0x3e')](_0x361123['query'],_0x297ba8['filters']));if(_0x361123[_0x1eb2('0x35')]['filter']){_0x13eef9[_0x1eb2('0x3d')]=_['merge'](_0x13eef9[_0x1eb2('0x3d')],{'$or':_[_0x1eb2('0x2d')](_0x13eef9[_0x1eb2('0x37')],function(_0x44c29b){var _0x5d0cde={};_0x5d0cde[_0x44c29b]={'$like':'%'+_0x361123[_0x1eb2('0x35')][_0x1eb2('0x40')]+'%'};return _0x5d0cde;})});}_0x13eef9=_[_0x1eb2('0x41')]({},_0x13eef9,_0x361123['options']);return _0x4e88c5['getSubjects'](_0x13eef9);}})['then'](function(_0x346e9e){if(_0x346e9e){_0x5f12fa=_0x346e9e[_0x1eb2('0x39')];if(!_0x361123[_0x1eb2('0x35')][_0x1eb2('0x4d')](_0x1eb2('0x3a'))){_0x13eef9[_0x1eb2('0x21')]=qs[_0x1eb2('0x21')](_0x361123[_0x1eb2('0x35')]['limit']);_0x13eef9['offset']=qs[_0x1eb2('0x1f')](_0x361123[_0x1eb2('0x35')][_0x1eb2('0x1f')]);}return _0x4e88c5[_0x1eb2('0x4e')](_0x13eef9);}})['then'](function(_0x3c8df9){if(_0x3c8df9){return _0x3c8df9?{'count':_0x5f12fa,'rows':_0x3c8df9}:null;}})[_0x1eb2('0x27')](respondWithResult(_0x5ece9e,null))['catch'](handleError(_0x5ece9e,null));};exports[_0x1eb2('0x4f')]=function(_0x5e6517,_0xb0cce8,_0x250725){var _0x23fab1={};var _0x442f06={};var _0xd0fbf9;var _0xbaf01d;return db[_0x1eb2('0x2e')][_0x1eb2('0x4a')]({'where':{'id':_0x5e6517[_0x1eb2('0x4b')]['id']}})[_0x1eb2('0x27')](handleEntityNotFound(_0xb0cce8,null))[_0x1eb2('0x27')](function(_0x353c03){if(_0x353c03){_0xd0fbf9=_0x353c03;_0x442f06[_0x1eb2('0x33')]=_['keys'](db[_0x1eb2('0x4c')][_0x1eb2('0x2f')]);_0x442f06[_0x1eb2('0x35')]=_['keys'](_0x5e6517[_0x1eb2('0x35')]);_0x442f06[_0x1eb2('0x3f')]=_[_0x1eb2('0x36')](_0x442f06[_0x1eb2('0x33')],_0x442f06[_0x1eb2('0x35')]);_0x23fab1[_0x1eb2('0x37')]=_[_0x1eb2('0x36')](_0x442f06['model'],qs[_0x1eb2('0x38')](_0x5e6517[_0x1eb2('0x35')][_0x1eb2('0x38')]));_0x23fab1[_0x1eb2('0x37')]=_0x23fab1[_0x1eb2('0x37')][_0x1eb2('0x39')]?_0x23fab1[_0x1eb2('0x37')]:_0x442f06[_0x1eb2('0x33')];_0x23fab1[_0x1eb2('0x3b')]=qs[_0x1eb2('0x3c')](_0x5e6517['query'][_0x1eb2('0x3c')]);_0x23fab1['where']=qs[_0x1eb2('0x3f')](_[_0x1eb2('0x3e')](_0x5e6517[_0x1eb2('0x35')],_0x442f06['filters']));if(_0x5e6517[_0x1eb2('0x35')]['filter']){_0x23fab1['where']=_[_0x1eb2('0x41')](_0x23fab1[_0x1eb2('0x3d')],{'$or':_[_0x1eb2('0x2d')](_0x23fab1[_0x1eb2('0x37')],function(_0x51b285){var _0x3ac314={};_0x3ac314[_0x51b285]={'$like':'%'+_0x5e6517[_0x1eb2('0x35')][_0x1eb2('0x40')]+'%'};return _0x3ac314;})});}_0x23fab1=_['merge']({},_0x23fab1,_0x5e6517[_0x1eb2('0x42')]);return _0xd0fbf9[_0x1eb2('0x4f')](_0x23fab1);}})['then'](function(_0x3b11f1){if(_0x3b11f1){_0xbaf01d=_0x3b11f1[_0x1eb2('0x39')];if(!_0x5e6517[_0x1eb2('0x35')][_0x1eb2('0x4d')](_0x1eb2('0x3a'))){_0x23fab1[_0x1eb2('0x21')]=qs[_0x1eb2('0x21')](_0x5e6517[_0x1eb2('0x35')][_0x1eb2('0x21')]);_0x23fab1[_0x1eb2('0x1f')]=qs[_0x1eb2('0x1f')](_0x5e6517[_0x1eb2('0x35')][_0x1eb2('0x1f')]);}return _0xd0fbf9[_0x1eb2('0x4f')](_0x23fab1);}})[_0x1eb2('0x27')](function(_0x33c585){if(_0x33c585){return _0x33c585?{'count':_0xbaf01d,'rows':_0x33c585}:null;}})['then'](respondWithResult(_0xb0cce8,null))[_0x1eb2('0x46')](handleError(_0xb0cce8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 1df16d5..771fc55 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 _0x8ae9=['util','bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x2d4104,_0x3f21d8){var _0x27765d=function(_0x2ec02c){while(--_0x2ec02c){_0x2d4104['push'](_0x2d4104['shift']());}};_0x27765d(++_0x3f21d8);}(_0x8ae9,0x179));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x98ae('0x0'));var util=require(_0x98ae('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x98ae('0x2'));var rp=require(_0x98ae('0x3'));var fs=require('fs');var path=require(_0x98ae('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x98ae('0x5'));module[_0x98ae('0x6')]=function(_0x237dd0,_0x3a6b37){return _0x237dd0['define'](_0x98ae('0x7'),attributes,{'tableName':_0x98ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6146=['exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes'];(function(_0x3cdebc,_0x45fb74){var _0x4d7726=function(_0x320c62){while(--_0x320c62){_0x3cdebc['push'](_0x3cdebc['shift']());}};_0x4d7726(++_0x45fb74);}(_0x6146,0xba));var _0x6614=function(_0x567700,_0x1735b9){_0x567700=_0x567700-0x0;var _0x5e6c05=_0x6146[_0x567700];return _0x5e6c05;};'use strict';var _=require(_0x6614('0x0'));var util=require('util');var logger=require(_0x6614('0x1'))(_0x6614('0x2'));var moment=require(_0x6614('0x3'));var BPromise=require(_0x6614('0x4'));var rp=require(_0x6614('0x5'));var fs=require('fs');var path=require(_0x6614('0x6'));var rimraf=require(_0x6614('0x7'));var config=require('../../config/environment');var attributes=require(_0x6614('0x8'));module[_0x6614('0x9')]=function(_0x334591,_0x43c7a7){return _0x334591[_0x6614('0xa')](_0x6614('0xb'),attributes,{'tableName':_0x6614('0xc'),'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 c0e63d2..0a53ade 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 _0x4f8a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x4f8a,0x160));var _0xa4f8=function(_0x3be7ab,_0x26fc42){_0x3be7ab=_0x3be7ab-0x0;var _0x16c433=_0x4f8a[_0x3be7ab];return _0x16c433;};'use strict';var _=require(_0xa4f8('0x0'));var util=require(_0xa4f8('0x1'));var moment=require(_0xa4f8('0x2'));var BPromise=require(_0xa4f8('0x3'));var rs=require(_0xa4f8('0x4'));var fs=require('fs');var Redis=require(_0xa4f8('0x5'));var db=require(_0xa4f8('0x6'))['db'];var utils=require(_0xa4f8('0x7'));var logger=require(_0xa4f8('0x8'))(_0xa4f8('0x9'));var config=require(_0xa4f8('0xa'));var jayson=require(_0xa4f8('0xb'));var client=jayson['client'][_0xa4f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4317e9,_0x230040,_0x29559d){return new BPromise(function(_0x5841e8,_0x3ebddc){return client[_0xa4f8('0xd')](_0x4317e9,_0x29559d)['then'](function(_0x2f9649){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x230040,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x230040,_0xa4f8('0xe'),JSON[_0xa4f8('0xf')](_0x2f9649));if(_0x2f9649[_0xa4f8('0x10')]){if(_0x2f9649['error'][_0xa4f8('0x11')]===0x1f4){logger[_0xa4f8('0x10')](_0xa4f8('0x12'),_0x230040,_0x2f9649['error'][_0xa4f8('0x13')]);return _0x3ebddc(_0x2f9649['error'][_0xa4f8('0x13')]);}logger[_0xa4f8('0x10')](_0xa4f8('0x12'),_0x230040,_0x2f9649[_0xa4f8('0x10')][_0xa4f8('0x13')]);return _0x5841e8(_0x2f9649[_0xa4f8('0x10')][_0xa4f8('0x13')]);}else{logger[_0xa4f8('0x14')](_0xa4f8('0x12'),_0x230040,_0xa4f8('0xe'));_0x5841e8(_0x2f9649['result']['message']);}})['catch'](function(_0x559713){logger['error'](_0xa4f8('0x12'),_0x230040,_0x559713);_0x3ebddc(_0x559713);});});} \ No newline at end of file +var _0x13c8=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0xd41f20,_0x14ab41){var _0x5e2bac=function(_0x3bc208){while(--_0x3bc208){_0xd41f20['push'](_0xd41f20['shift']());}};_0x5e2bac(++_0x14ab41);}(_0x13c8,0xa0));var _0x813c=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x13c8[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x813c('0x0'));var util=require(_0x813c('0x1'));var moment=require(_0x813c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x813c('0x3'));var db=require(_0x813c('0x4'))['db'];var utils=require(_0x813c('0x5'));var logger=require(_0x813c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x813c('0x7'));var client=jayson[_0x813c('0x8')][_0x813c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84cd24,_0xde6f71,_0x6316b1){return new BPromise(function(_0xe0bc37,_0x3b7af0){return client[_0x813c('0xa')](_0x84cd24,_0x6316b1)[_0x813c('0xb')](function(_0x32409a){logger['info'](_0x813c('0xc'),_0xde6f71,_0x813c('0xd'));logger[_0x813c('0xe')](_0x813c('0xf'),_0xde6f71,_0x813c('0xd'),JSON[_0x813c('0x10')](_0x32409a));if(_0x32409a[_0x813c('0x11')]){if(_0x32409a[_0x813c('0x11')][_0x813c('0x12')]===0x1f4){logger[_0x813c('0x11')](_0x813c('0xc'),_0xde6f71,_0x32409a['error'][_0x813c('0x13')]);return _0x3b7af0(_0x32409a[_0x813c('0x11')]['message']);}logger['error'](_0x813c('0xc'),_0xde6f71,_0x32409a['error']['message']);return _0xe0bc37(_0x32409a[_0x813c('0x11')][_0x813c('0x13')]);}else{logger[_0x813c('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0xde6f71,'request\x20sent');_0xe0bc37(_0x32409a[_0x813c('0x15')][_0x813c('0x13')]);}})[_0x813c('0x16')](function(_0x46e47c){logger[_0x813c('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xde6f71,_0x46e47c);_0x3b7af0(_0x46e47c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 392030b..73bb600 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 _0x61e7=['exports','multer','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x61e7,0x188));var _0x761e=function(_0x5ca1c1,_0x5af837){_0x5ca1c1=_0x5ca1c1-0x0;var _0x1cccd7=_0x61e7[_0x5ca1c1];return _0x1cccd7;};'use strict';var multer=require(_0x761e('0x0'));var util=require(_0x761e('0x1'));var path=require(_0x761e('0x2'));var timeout=require('connect-timeout');var express=require(_0x761e('0x3'));var router=express[_0x761e('0x4')]();var fs_extra=require(_0x761e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x761e('0x6'));var controller=require('./intServicenowField.controller');router[_0x761e('0x7')]('/',auth[_0x761e('0x8')](),controller[_0x761e('0x9')]);router[_0x761e('0x7')](_0x761e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x761e('0xb')]('/',auth[_0x761e('0x8')](),controller[_0x761e('0xc')]);router['put'](_0x761e('0xa'),auth[_0x761e('0x8')](),controller[_0x761e('0xd')]);router[_0x761e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x761e('0xf')]);module[_0x761e('0x10')]=router; \ No newline at end of file +var _0x3f0b=['update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f0b,0x1d0));var _0xb3f0=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x3f0b[_0x172133];return _0x2460e5;};'use strict';var multer=require('multer');var util=require(_0xb3f0('0x0'));var path=require('path');var timeout=require(_0xb3f0('0x1'));var express=require(_0xb3f0('0x2'));var router=express[_0xb3f0('0x3')]();var fs_extra=require(_0xb3f0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb3f0('0x5'));var config=require(_0xb3f0('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb3f0('0x7')]('/:id',auth[_0xb3f0('0x8')](),controller[_0xb3f0('0x9')]);router['post']('/',auth[_0xb3f0('0x8')](),controller[_0xb3f0('0xa')]);router[_0xb3f0('0xb')]('/:id',auth[_0xb3f0('0x8')](),controller[_0xb3f0('0xc')]);router[_0xb3f0('0xd')](_0xb3f0('0xe'),auth[_0xb3f0('0x8')](),controller[_0xb3f0('0xf')]);module[_0xb3f0('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ec40d1b..e649ce9 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 _0xa079=['customVariable','picklist','STRING','variable','BOOLEAN','exports','ENUM','string'];(function(_0x3ccd5c,_0x1ee1a7){var _0x1be3e3=function(_0x25059){while(--_0x25059){_0x3ccd5c['push'](_0x3ccd5c['shift']());}};_0x1be3e3(++_0x1ee1a7);}(_0xa079,0x75));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9a07('0x0')]={'type':{'type':Sequelize[_0x9a07('0x1')](_0x9a07('0x2'),'variable',_0x9a07('0x3'),'keyValue',_0x9a07('0x4')),'defaultValue':_0x9a07('0x2')},'content':{'type':Sequelize[_0x9a07('0x5')]},'key':{'type':Sequelize[_0x9a07('0x5')]},'keyType':{'type':Sequelize[_0x9a07('0x1')](_0x9a07('0x2'),_0x9a07('0x6'),_0x9a07('0x3'))},'keyContent':{'type':Sequelize[_0x9a07('0x5')]},'idField':{'type':Sequelize[_0x9a07('0x5')]},'nameField':{'type':Sequelize[_0x9a07('0x5')]},'customField':{'type':Sequelize[_0x9a07('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a07('0x5')]}}; \ No newline at end of file +var _0x2c27=['customVariable','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2c27,0x11c));var _0x72c2=function(_0x15d319,_0x2e0493){_0x15d319=_0x15d319-0x0;var _0x59d461=_0x2c27[_0x15d319];return _0x59d461;};'use strict';var Sequelize=require(_0x72c2('0x0'));module[_0x72c2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x72c2('0x2'),_0x72c2('0x3'),_0x72c2('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x72c2('0x5')]},'key':{'type':Sequelize[_0x72c2('0x5')]},'keyType':{'type':Sequelize[_0x72c2('0x6')](_0x72c2('0x2'),_0x72c2('0x3'),_0x72c2('0x4'))},'keyContent':{'type':Sequelize[_0x72c2('0x5')]},'idField':{'type':Sequelize[_0x72c2('0x5')]},'nameField':{'type':Sequelize[_0x72c2('0x5')]},'customField':{'type':Sequelize[_0x72c2('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 9036cf3..9b4bf32 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 _0xc310=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','update','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc310,0x81));var _0x0c31=function(_0x3ce06b,_0x4f24bf){_0x3ce06b=_0x3ce06b-0x0;var _0x5ff815=_0xc310[_0x3ce06b];return _0x5ff815;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c31('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c31('0x1'));var rp=require('request-promise');var moment=require(_0x0c31('0x2'));var BPromise=require(_0x0c31('0x3'));var Mustache=require(_0x0c31('0x4'));var util=require(_0x0c31('0x5'));var path=require(_0x0c31('0x6'));var sox=require(_0x0c31('0x7'));var csv=require(_0x0c31('0x8'));var ejs=require(_0x0c31('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c31('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0c31('0xb'));var deskjs=require(_0x0c31('0xc'));var toCsv=require(_0x0c31('0x8'));var querystring=require(_0x0c31('0xd'));var Papa=require('papaparse');var Redis=require(_0x0c31('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0c31('0xf'));var hardwareService=require(_0x0c31('0x10'));var logger=require(_0x0c31('0x11'))(_0x0c31('0x12'));var utils=require(_0x0c31('0x13'));var config=require(_0x0c31('0x14'));var licenseUtil=require(_0x0c31('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x324bea,_0x3228ad){_0x3228ad=_0x3228ad||0xcc;return function(_0x4ceb64){if(_0x4ceb64){return _0x324bea[_0x0c31('0x16')](_0x3228ad);}return _0x324bea['status'](_0x3228ad)[_0x0c31('0x17')]();};}function respondWithResult(_0x386089,_0x478f93){_0x478f93=_0x478f93||0xc8;return function(_0x43f99b){if(_0x43f99b){return _0x386089[_0x0c31('0x18')](_0x478f93)['json'](_0x43f99b);}};}function respondWithFilteredResult(_0x302069,_0x1a7e57){return function(_0x48fc00){if(_0x48fc00){var _0x28be97=typeof _0x1a7e57[_0x0c31('0x19')]==='undefined'&&typeof _0x1a7e57[_0x0c31('0x1a')]==='undefined';var _0x2da09a=_0x48fc00[_0x0c31('0x1b')];var _0x11caf4=_0x28be97?0x0:_0x1a7e57[_0x0c31('0x19')];var _0x4f2ba6=_0x28be97?_0x48fc00[_0x0c31('0x1b')]:_0x1a7e57[_0x0c31('0x19')]+_0x1a7e57[_0x0c31('0x1a')];var _0x3d6501;if(_0x4f2ba6>=_0x2da09a){_0x4f2ba6=_0x2da09a;_0x3d6501=0xc8;}else{_0x3d6501=0xce;}_0x302069[_0x0c31('0x18')](_0x3d6501);return _0x302069[_0x0c31('0x1c')](_0x0c31('0x1d'),_0x11caf4+'-'+_0x4f2ba6+'/'+_0x2da09a)['json'](_0x48fc00);}return null;};}function patchUpdates(_0x1bc2f1){return function(_0x5f472d){try{jsonpatch[_0x0c31('0x1e')](_0x5f472d,_0x1bc2f1,!![]);}catch(_0x576e22){return BPromise[_0x0c31('0x1f')](_0x576e22);}return _0x5f472d[_0x0c31('0x20')]();};}function saveUpdates(_0x587cbc,_0x1e8ed4){return function(_0x1a6e66){if(_0x1a6e66){return _0x1a6e66['update'](_0x587cbc)[_0x0c31('0x21')](function(_0x2a1814){return _0x2a1814;});}return null;};}function removeEntity(_0x580801,_0x39ec11){return function(_0x1a1bb7){if(_0x1a1bb7){return _0x1a1bb7[_0x0c31('0x22')]()[_0x0c31('0x21')](function(){_0x580801[_0x0c31('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42c0ac,_0x1995d1){return function(_0x48c938){if(!_0x48c938){_0x42c0ac[_0x0c31('0x16')](0x194);}return _0x48c938;};}function handleError(_0x298c1f,_0x17315c){_0x17315c=_0x17315c||0x1f4;return function(_0x53409c){logger[_0x0c31('0x23')](_0x53409c[_0x0c31('0x24')]);if(_0x53409c[_0x0c31('0x25')]){delete _0x53409c[_0x0c31('0x25')];}_0x298c1f[_0x0c31('0x18')](_0x17315c)[_0x0c31('0x26')](_0x53409c);};}exports[_0x0c31('0x27')]=function(_0x202877,_0x156c80){var _0x23429c={},_0x239847={},_0x5d9a4b={'count':0x0,'rows':[]};var _0x3e9c52=_[_0x0c31('0x28')](db[_0x0c31('0x29')][_0x0c31('0x2a')],function(_0x5e4494){return{'name':_0x5e4494[_0x0c31('0x2b')],'type':_0x5e4494[_0x0c31('0x2c')]['key']};});_0x239847[_0x0c31('0x2d')]=_[_0x0c31('0x28')](_0x3e9c52,_0x0c31('0x25'));_0x239847[_0x0c31('0x2e')]=_[_0x0c31('0x2f')](_0x202877[_0x0c31('0x2e')]);_0x239847[_0x0c31('0x30')]=_[_0x0c31('0x31')](_0x239847['model'],_0x239847[_0x0c31('0x2e')]);_0x23429c['attributes']=_[_0x0c31('0x31')](_0x239847[_0x0c31('0x2d')],qs['fields'](_0x202877[_0x0c31('0x2e')][_0x0c31('0x32')]));_0x23429c[_0x0c31('0x33')]=_0x23429c[_0x0c31('0x33')][_0x0c31('0x34')]?_0x23429c[_0x0c31('0x33')]:_0x239847[_0x0c31('0x2d')];if(!_0x202877[_0x0c31('0x2e')][_0x0c31('0x35')](_0x0c31('0x36'))){_0x23429c[_0x0c31('0x1a')]=qs[_0x0c31('0x1a')](_0x202877[_0x0c31('0x2e')][_0x0c31('0x1a')]);_0x23429c[_0x0c31('0x19')]=qs['offset'](_0x202877[_0x0c31('0x2e')][_0x0c31('0x19')]);}_0x23429c[_0x0c31('0x37')]=qs[_0x0c31('0x38')](_0x202877[_0x0c31('0x2e')][_0x0c31('0x38')]);_0x23429c[_0x0c31('0x39')]=qs[_0x0c31('0x30')](_[_0x0c31('0x3a')](_0x202877['query'],_0x239847['filters']),_0x3e9c52);if(_0x202877[_0x0c31('0x2e')]['filter']){_0x23429c[_0x0c31('0x39')]=_[_0x0c31('0x3b')](_0x23429c[_0x0c31('0x39')],{'$or':_[_0x0c31('0x28')](_0x3e9c52,function(_0x19fd3a){if(_0x19fd3a[_0x0c31('0x2c')]!==_0x0c31('0x3c')){var _0x1c390b={};_0x1c390b[_0x19fd3a[_0x0c31('0x25')]]={'$like':'%'+_0x202877[_0x0c31('0x2e')][_0x0c31('0x3d')]+'%'};return _0x1c390b;}})});}_0x23429c=_['merge']({},_0x23429c,_0x202877[_0x0c31('0x3e')]);var _0x4de213={'where':_0x23429c[_0x0c31('0x39')]};return db['ServicenowField'][_0x0c31('0x1b')](_0x4de213)[_0x0c31('0x21')](function(_0x12f064){_0x5d9a4b[_0x0c31('0x1b')]=_0x12f064;if(_0x202877[_0x0c31('0x2e')][_0x0c31('0x3f')]){_0x23429c[_0x0c31('0x40')]=[{'all':!![]}];}return db[_0x0c31('0x29')]['findAll'](_0x23429c);})[_0x0c31('0x21')](function(_0x5d4c13){_0x5d9a4b[_0x0c31('0x41')]=_0x5d4c13;return _0x5d9a4b;})[_0x0c31('0x21')](respondWithFilteredResult(_0x156c80,_0x23429c))[_0x0c31('0x42')](handleError(_0x156c80,null));};exports[_0x0c31('0x43')]=function(_0x4a0551,_0x41fad5){var _0x708d14={'raw':!![],'where':{'id':_0x4a0551[_0x0c31('0x44')]['id']}},_0x224193={};_0x224193[_0x0c31('0x2d')]=_[_0x0c31('0x2f')](db[_0x0c31('0x29')][_0x0c31('0x2a')]);_0x224193[_0x0c31('0x2e')]=_['keys'](_0x4a0551[_0x0c31('0x2e')]);_0x224193['filters']=_[_0x0c31('0x31')](_0x224193['model'],_0x224193[_0x0c31('0x2e')]);_0x708d14[_0x0c31('0x33')]=_['intersection'](_0x224193[_0x0c31('0x2d')],qs[_0x0c31('0x32')](_0x4a0551['query'][_0x0c31('0x32')]));_0x708d14[_0x0c31('0x33')]=_0x708d14['attributes'][_0x0c31('0x34')]?_0x708d14['attributes']:_0x224193[_0x0c31('0x2d')];if(_0x4a0551['query']['includeAll']){_0x708d14[_0x0c31('0x40')]=[{'all':!![]}];}_0x708d14=_[_0x0c31('0x3b')]({},_0x708d14,_0x4a0551[_0x0c31('0x3e')]);return db[_0x0c31('0x29')][_0x0c31('0x45')](_0x708d14)[_0x0c31('0x21')](handleEntityNotFound(_0x41fad5,null))[_0x0c31('0x21')](respondWithResult(_0x41fad5,null))[_0x0c31('0x42')](handleError(_0x41fad5,null));};exports[_0x0c31('0x46')]=function(_0x173098,_0x5b1dc2){return db[_0x0c31('0x29')][_0x0c31('0x46')](_0x173098['body'],{})['then'](respondWithResult(_0x5b1dc2,0xc9))['catch'](handleError(_0x5b1dc2,null));};exports[_0x0c31('0x47')]=function(_0x2a463a,_0x148944){if(_0x2a463a[_0x0c31('0x48')]['id']){delete _0x2a463a[_0x0c31('0x48')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x2a463a[_0x0c31('0x44')]['id']}})[_0x0c31('0x21')](handleEntityNotFound(_0x148944,null))[_0x0c31('0x21')](saveUpdates(_0x2a463a[_0x0c31('0x48')],null))[_0x0c31('0x21')](respondWithResult(_0x148944,null))[_0x0c31('0x42')](handleError(_0x148944,null));};exports[_0x0c31('0x22')]=function(_0x3c5592,_0x24ebfc){return db[_0x0c31('0x29')][_0x0c31('0x45')]({'where':{'id':_0x3c5592[_0x0c31('0x44')]['id']}})[_0x0c31('0x21')](handleEntityNotFound(_0x24ebfc,null))[_0x0c31('0x21')](removeEntity(_0x24ebfc,null))['catch'](handleError(_0x24ebfc,null));}; \ No newline at end of file +var _0x7b08=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b08,0x91));var _0x87b0=function(_0x24f863,_0x45d483){_0x24f863=_0x24f863-0x0;var _0x3dd636=_0x7b08[_0x24f863];return _0x3dd636;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87b0('0x0'));var zipdir=require(_0x87b0('0x1'));var jsonpatch=require(_0x87b0('0x2'));var rp=require('request-promise');var moment=require(_0x87b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x87b0('0x4'));var util=require(_0x87b0('0x5'));var path=require(_0x87b0('0x6'));var sox=require('sox');var csv=require(_0x87b0('0x7'));var ejs=require(_0x87b0('0x8'));var fs=require('fs');var fs_extra=require(_0x87b0('0x9'));var _=require(_0x87b0('0xa'));var squel=require(_0x87b0('0xb'));var crypto=require(_0x87b0('0xc'));var jsforce=require(_0x87b0('0xd'));var deskjs=require(_0x87b0('0xe'));var toCsv=require(_0x87b0('0x7'));var querystring=require(_0x87b0('0xf'));var Papa=require(_0x87b0('0x10'));var Redis=require('ioredis');var authService=require(_0x87b0('0x11'));var qs=require(_0x87b0('0x12'));var as=require(_0x87b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87b0('0x14'))(_0x87b0('0x15'));var utils=require(_0x87b0('0x16'));var config=require(_0x87b0('0x17'));var licenseUtil=require(_0x87b0('0x18'));var db=require(_0x87b0('0x19'))['db'];function respondWithStatusCode(_0x1fe512,_0x434d09){_0x434d09=_0x434d09||0xcc;return function(_0x21e3e0){if(_0x21e3e0){return _0x1fe512[_0x87b0('0x1a')](_0x434d09);}return _0x1fe512['status'](_0x434d09)[_0x87b0('0x1b')]();};}function respondWithResult(_0x3e1fe2,_0x1efaa8){_0x1efaa8=_0x1efaa8||0xc8;return function(_0x1e0118){if(_0x1e0118){return _0x3e1fe2[_0x87b0('0x1c')](_0x1efaa8)[_0x87b0('0x1d')](_0x1e0118);}};}function respondWithFilteredResult(_0x151e54,_0x426fb5){return function(_0x1a31f6){if(_0x1a31f6){var _0x52cebc=typeof _0x426fb5[_0x87b0('0x1e')]===_0x87b0('0x1f')&&typeof _0x426fb5[_0x87b0('0x20')]===_0x87b0('0x1f');var _0x28a04d=_0x1a31f6[_0x87b0('0x21')];var _0x50a13f=_0x52cebc?0x0:_0x426fb5[_0x87b0('0x1e')];var _0x3931e1=_0x52cebc?_0x1a31f6[_0x87b0('0x21')]:_0x426fb5[_0x87b0('0x1e')]+_0x426fb5['limit'];var _0xe928b1;if(_0x3931e1>=_0x28a04d){_0x3931e1=_0x28a04d;_0xe928b1=0xc8;}else{_0xe928b1=0xce;}_0x151e54[_0x87b0('0x1c')](_0xe928b1);return _0x151e54[_0x87b0('0x22')](_0x87b0('0x23'),_0x50a13f+'-'+_0x3931e1+'/'+_0x28a04d)['json'](_0x1a31f6);}return null;};}function patchUpdates(_0x3cfa6c){return function(_0xb5a103){try{jsonpatch[_0x87b0('0x24')](_0xb5a103,_0x3cfa6c,!![]);}catch(_0x431835){return BPromise[_0x87b0('0x25')](_0x431835);}return _0xb5a103[_0x87b0('0x26')]();};}function saveUpdates(_0x1432e4,_0x51ce9e){return function(_0x239a60){if(_0x239a60){return _0x239a60[_0x87b0('0x27')](_0x1432e4)[_0x87b0('0x28')](function(_0x553db6){return _0x553db6;});}return null;};}function removeEntity(_0x26127e,_0x162227){return function(_0x187a09){if(_0x187a09){return _0x187a09[_0x87b0('0x29')]()[_0x87b0('0x28')](function(){_0x26127e[_0x87b0('0x1c')](0xcc)[_0x87b0('0x1b')]();});}};}function handleEntityNotFound(_0x3938b2,_0x3ebe84){return function(_0x208a85){if(!_0x208a85){_0x3938b2[_0x87b0('0x1a')](0x194);}return _0x208a85;};}function handleError(_0x582c8e,_0x44ec7f){_0x44ec7f=_0x44ec7f||0x1f4;return function(_0x5610f3){logger['error'](_0x5610f3['stack']);if(_0x5610f3[_0x87b0('0x2a')]){delete _0x5610f3['name'];}_0x582c8e[_0x87b0('0x1c')](_0x44ec7f)[_0x87b0('0x2b')](_0x5610f3);};}exports['index']=function(_0x26a8ad,_0x40faba){var _0x54fa58={},_0x566c16={},_0x49b9e4={'count':0x0,'rows':[]};var _0x509e4f=_[_0x87b0('0x2c')](db[_0x87b0('0x2d')][_0x87b0('0x2e')],function(_0x13dd07){return{'name':_0x13dd07[_0x87b0('0x2f')],'type':_0x13dd07[_0x87b0('0x30')]['key']};});_0x566c16[_0x87b0('0x31')]=_[_0x87b0('0x2c')](_0x509e4f,_0x87b0('0x2a'));_0x566c16[_0x87b0('0x32')]=_[_0x87b0('0x33')](_0x26a8ad[_0x87b0('0x32')]);_0x566c16[_0x87b0('0x34')]=_[_0x87b0('0x35')](_0x566c16['model'],_0x566c16[_0x87b0('0x32')]);_0x54fa58[_0x87b0('0x36')]=_[_0x87b0('0x35')](_0x566c16[_0x87b0('0x31')],qs['fields'](_0x26a8ad[_0x87b0('0x32')][_0x87b0('0x37')]));_0x54fa58[_0x87b0('0x36')]=_0x54fa58['attributes'][_0x87b0('0x38')]?_0x54fa58[_0x87b0('0x36')]:_0x566c16[_0x87b0('0x31')];if(!_0x26a8ad[_0x87b0('0x32')]['hasOwnProperty'](_0x87b0('0x39'))){_0x54fa58[_0x87b0('0x20')]=qs[_0x87b0('0x20')](_0x26a8ad['query'][_0x87b0('0x20')]);_0x54fa58['offset']=qs[_0x87b0('0x1e')](_0x26a8ad['query'][_0x87b0('0x1e')]);}_0x54fa58[_0x87b0('0x3a')]=qs[_0x87b0('0x3b')](_0x26a8ad[_0x87b0('0x32')]['sort']);_0x54fa58['where']=qs[_0x87b0('0x34')](_[_0x87b0('0x3c')](_0x26a8ad[_0x87b0('0x32')],_0x566c16[_0x87b0('0x34')]),_0x509e4f);if(_0x26a8ad[_0x87b0('0x32')][_0x87b0('0x3d')]){_0x54fa58[_0x87b0('0x3e')]=_[_0x87b0('0x3f')](_0x54fa58[_0x87b0('0x3e')],{'$or':_[_0x87b0('0x2c')](_0x509e4f,function(_0x40a4fb){if(_0x40a4fb[_0x87b0('0x30')]!==_0x87b0('0x40')){var _0x179e2f={};_0x179e2f[_0x40a4fb[_0x87b0('0x2a')]]={'$like':'%'+_0x26a8ad[_0x87b0('0x32')][_0x87b0('0x3d')]+'%'};return _0x179e2f;}})});}_0x54fa58=_[_0x87b0('0x3f')]({},_0x54fa58,_0x26a8ad[_0x87b0('0x41')]);var _0x131379={'where':_0x54fa58[_0x87b0('0x3e')]};return db[_0x87b0('0x2d')][_0x87b0('0x21')](_0x131379)[_0x87b0('0x28')](function(_0x27a163){_0x49b9e4[_0x87b0('0x21')]=_0x27a163;if(_0x26a8ad[_0x87b0('0x32')][_0x87b0('0x42')]){_0x54fa58[_0x87b0('0x43')]=[{'all':!![]}];}return db[_0x87b0('0x2d')][_0x87b0('0x44')](_0x54fa58);})[_0x87b0('0x28')](function(_0x502128){_0x49b9e4[_0x87b0('0x45')]=_0x502128;return _0x49b9e4;})['then'](respondWithFilteredResult(_0x40faba,_0x54fa58))['catch'](handleError(_0x40faba,null));};exports[_0x87b0('0x46')]=function(_0x5cf489,_0x44a7ec){var _0x57e7bd={'raw':!![],'where':{'id':_0x5cf489[_0x87b0('0x47')]['id']}},_0x46850f={};_0x46850f[_0x87b0('0x31')]=_[_0x87b0('0x33')](db['ServicenowField'][_0x87b0('0x2e')]);_0x46850f[_0x87b0('0x32')]=_[_0x87b0('0x33')](_0x5cf489['query']);_0x46850f['filters']=_[_0x87b0('0x35')](_0x46850f['model'],_0x46850f[_0x87b0('0x32')]);_0x57e7bd[_0x87b0('0x36')]=_['intersection'](_0x46850f[_0x87b0('0x31')],qs[_0x87b0('0x37')](_0x5cf489[_0x87b0('0x32')][_0x87b0('0x37')]));_0x57e7bd[_0x87b0('0x36')]=_0x57e7bd[_0x87b0('0x36')]['length']?_0x57e7bd[_0x87b0('0x36')]:_0x46850f['model'];if(_0x5cf489[_0x87b0('0x32')]['includeAll']){_0x57e7bd['include']=[{'all':!![]}];}_0x57e7bd=_[_0x87b0('0x3f')]({},_0x57e7bd,_0x5cf489['options']);return db['ServicenowField'][_0x87b0('0x48')](_0x57e7bd)[_0x87b0('0x28')](handleEntityNotFound(_0x44a7ec,null))[_0x87b0('0x28')](respondWithResult(_0x44a7ec,null))[_0x87b0('0x49')](handleError(_0x44a7ec,null));};exports['create']=function(_0x345bab,_0x37983e){return db[_0x87b0('0x2d')][_0x87b0('0x4a')](_0x345bab['body'],{})[_0x87b0('0x28')](respondWithResult(_0x37983e,0xc9))[_0x87b0('0x49')](handleError(_0x37983e,null));};exports[_0x87b0('0x27')]=function(_0x505aff,_0x1d0fd6){if(_0x505aff['body']['id']){delete _0x505aff[_0x87b0('0x4b')]['id'];}return db[_0x87b0('0x2d')][_0x87b0('0x48')]({'where':{'id':_0x505aff[_0x87b0('0x47')]['id']}})[_0x87b0('0x28')](handleEntityNotFound(_0x1d0fd6,null))[_0x87b0('0x28')](saveUpdates(_0x505aff[_0x87b0('0x4b')],null))[_0x87b0('0x28')](respondWithResult(_0x1d0fd6,null))['catch'](handleError(_0x1d0fd6,null));};exports['destroy']=function(_0x39cfe8,_0x4f5f5e){return db[_0x87b0('0x2d')]['find']({'where':{'id':_0x39cfe8['params']['id']}})['then'](handleEntityNotFound(_0x4f5f5e,null))[_0x87b0('0x28')](removeEntity(_0x4f5f5e,null))[_0x87b0('0x49')](handleError(_0x4f5f5e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ff55b28..04dc85a 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 _0xdd9a=['exports','define','ServicenowField','servicenow_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./intServicenowField.attributes'];(function(_0x2182f0,_0x445f1e){var _0x45d30b=function(_0x3c428f){while(--_0x3c428f){_0x2182f0['push'](_0x2182f0['shift']());}};_0x45d30b(++_0x445f1e);}(_0xdd9a,0x95));var _0xadd9=function(_0x5666f3,_0x11ebf1){_0x5666f3=_0x5666f3-0x0;var _0x4dedce=_0xdd9a[_0x5666f3];return _0x4dedce;};'use strict';var _=require(_0xadd9('0x0'));var util=require('util');var logger=require(_0xadd9('0x1'))('api');var moment=require(_0xadd9('0x2'));var BPromise=require(_0xadd9('0x3'));var rp=require(_0xadd9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadd9('0x5'));var config=require('../../config/environment');var attributes=require(_0xadd9('0x6'));module[_0xadd9('0x7')]=function(_0x56b174,_0x5d3408){return _0x56b174[_0xadd9('0x8')](_0xadd9('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xadd9('0xa'),'fields':['idField',_0xadd9('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1059=['path','rimraf','../../config/environment','./intServicenowField.attributes','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','moment','bluebird'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x1059,0x1aa));var _0x9105=function(_0x25390f,_0x38b1ec){_0x25390f=_0x25390f-0x0;var _0x4f53e6=_0x1059[_0x25390f];return _0x4f53e6;};'use strict';var _=require(_0x9105('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9105('0x1'));var BPromise=require(_0x9105('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9105('0x3'));var rimraf=require(_0x9105('0x4'));var config=require(_0x9105('0x5'));var attributes=require(_0x9105('0x6'));module['exports']=function(_0x5354e0,_0x7df85d){return _0x5354e0['define']('ServicenowField',attributes,{'tableName':_0x9105('0x7'),'paranoid':![],'indexes':[{'name':_0x9105('0x8'),'fields':[_0x9105('0x9'),_0x9105('0xa')],'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 ee131c2..6336245 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 _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x249a09,_0x3a07e2){_0x249a09=_0x249a09-0x0;var _0x46b971=_0xac4a[_0x249a09];return _0x46b971;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x413bbe,_0x2e2365){var _0x37a5bf=function(_0x552111){while(--_0x552111){_0x413bbe['push'](_0x413bbe['shift']());}};_0x37a5bf(++_0x2e2365);}(_0x70e0,0x17b));var _0x070e=function(_0x54c536,_0x57915e){_0x54c536=_0x54c536-0x0;var _0x370448=_0x70e0[_0x54c536];return _0x370448;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 8cb3b4a..90903e1 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x43efe4,_0x1bc22c){var _0x7c8b7b=function(_0xefe3ac){while(--_0xefe3ac){_0x43efe4['push'](_0x43efe4['shift']());}};_0x7c8b7b(++_0x1bc22c);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3018c4,_0x4cd227){var _0xae17e7=function(_0x34640b){while(--_0x34640b){_0x3018c4['push'](_0x3018c4['shift']());}};_0xae17e7(++_0x4cd227);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 250fe00..198e017 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3af4de,_0x25a78a){var _0x3a069a=function(_0xa405b4){while(--_0xa405b4){_0x3af4de['push'](_0x3af4de['shift']());}};_0x3a069a(++_0x25a78a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xfa477,_0x12e43b){var _0x48bb0b=function(_0x4ab8ad){while(--_0x4ab8ad){_0xfa477['push'](_0xfa477['shift']());}};_0x48bb0b(++_0x12e43b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d2c1b39..706f8b5 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 _0x35cb=['password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','values','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','findAll','rows','catch','show','length','include','find','body','update','params','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','remoteUri','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','username'];(function(_0xe8a2ec,_0x14d15c){var _0x41b1dc=function(_0x4d6f9a){while(--_0x4d6f9a){_0xe8a2ec['push'](_0xe8a2ec['shift']());}};_0x41b1dc(++_0x14d15c);}(_0x35cb,0xff));var _0xb35c=function(_0x5ce0f2,_0x5cf793){_0x5ce0f2=_0x5ce0f2-0x0;var _0x255a69=_0x35cb[_0x5ce0f2];return _0x255a69;};'use strict';var emlformat=require(_0xb35c('0x0'));var rimraf=require(_0xb35c('0x1'));var zipdir=require(_0xb35c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb35c('0x3'));var moment=require(_0xb35c('0x4'));var BPromise=require(_0xb35c('0x5'));var Mustache=require(_0xb35c('0x6'));var util=require(_0xb35c('0x7'));var path=require('path');var sox=require(_0xb35c('0x8'));var csv=require(_0xb35c('0x9'));var ejs=require(_0xb35c('0xa'));var fs=require('fs');var fs_extra=require(_0xb35c('0xb'));var _=require(_0xb35c('0xc'));var squel=require(_0xb35c('0xd'));var crypto=require(_0xb35c('0xe'));var jsforce=require(_0xb35c('0xf'));var deskjs=require(_0xb35c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb35c('0x11'));var Redis=require(_0xb35c('0x12'));var authService=require(_0xb35c('0x13'));var qs=require(_0xb35c('0x14'));var as=require(_0xb35c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb35c('0x16'))(_0xb35c('0x17'));var utils=require(_0xb35c('0x18'));var config=require(_0xb35c('0x19'));var licenseUtil=require(_0xb35c('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb35c('0x1b'));function respondWithStatusCode(_0x3b0daa,_0x45ef85){_0x45ef85=_0x45ef85||0xcc;return function(_0x15de6c){if(_0x15de6c){return _0x3b0daa[_0xb35c('0x1c')](_0x45ef85);}return _0x3b0daa[_0xb35c('0x1d')](_0x45ef85)[_0xb35c('0x1e')]();};}function respondWithResult(_0x19d6ae,_0x4a2625){_0x4a2625=_0x4a2625||0xc8;return function(_0x3a5e34){if(_0x3a5e34){return _0x19d6ae['status'](_0x4a2625)[_0xb35c('0x1f')](_0x3a5e34);}};}function respondWithFilteredResult(_0x3ddb37,_0x3294eb){return function(_0x2b7cb1){if(_0x2b7cb1){var _0x3d2733=typeof _0x3294eb[_0xb35c('0x20')]===_0xb35c('0x21')&&typeof _0x3294eb[_0xb35c('0x22')]===_0xb35c('0x21');var _0x1944b0=_0x2b7cb1[_0xb35c('0x23')];var _0x351a4f=_0x3d2733?0x0:_0x3294eb[_0xb35c('0x20')];var _0x26ba45=_0x3d2733?_0x2b7cb1['count']:_0x3294eb[_0xb35c('0x20')]+_0x3294eb[_0xb35c('0x22')];var _0x3626ca;if(_0x26ba45>=_0x1944b0){_0x26ba45=_0x1944b0;_0x3626ca=0xc8;}else{_0x3626ca=0xce;}_0x3ddb37['status'](_0x3626ca);return _0x3ddb37[_0xb35c('0x24')](_0xb35c('0x25'),_0x351a4f+'-'+_0x26ba45+'/'+_0x1944b0)['json'](_0x2b7cb1);}return null;};}function patchUpdates(_0x3230e5){return function(_0x532984){try{jsonpatch[_0xb35c('0x26')](_0x532984,_0x3230e5,!![]);}catch(_0x101bf8){return BPromise[_0xb35c('0x27')](_0x101bf8);}return _0x532984[_0xb35c('0x28')]();};}function saveUpdates(_0x3adc00,_0x38ce02){return function(_0x59f2c9){if(_0x59f2c9){return _0x59f2c9['update'](_0x3adc00)[_0xb35c('0x29')](function(_0x23ca07){return _0x23ca07;});}return null;};}function removeEntity(_0x2e1e91,_0x3ec85c){return function(_0x516f70){if(_0x516f70){return _0x516f70['destroy']()[_0xb35c('0x29')](function(){_0x2e1e91['status'](0xcc)[_0xb35c('0x1e')]();});}};}function handleEntityNotFound(_0x5eb2b1,_0x15931d){return function(_0x119ede){if(!_0x119ede){_0x5eb2b1[_0xb35c('0x1c')](0x194);}return _0x119ede;};}function handleError(_0x34d2d4,_0x28d297){_0x28d297=_0x28d297||0x1f4;return function(_0x2ec151){logger[_0xb35c('0x2a')](_0x2ec151[_0xb35c('0x2b')]);if(_0x2ec151[_0xb35c('0x2c')]){delete _0x2ec151[_0xb35c('0x2c')];}_0x34d2d4[_0xb35c('0x1d')](_0x28d297)[_0xb35c('0x2d')](_0x2ec151);};}exports['index']=function(_0x5cabdf,_0x3b2c75){var _0x53f221={},_0x1dcef2={},_0x7ec49b={'count':0x0,'rows':[]};var _0x5cd30f=_[_0xb35c('0x2e')](db[_0xb35c('0x2f')][_0xb35c('0x30')],function(_0x8628c4){return{'name':_0x8628c4[_0xb35c('0x31')],'type':_0x8628c4[_0xb35c('0x32')][_0xb35c('0x33')]};});_0x1dcef2[_0xb35c('0x34')]=_[_0xb35c('0x2e')](_0x5cd30f,'name');_0x1dcef2[_0xb35c('0x35')]=_[_0xb35c('0x36')](_0x5cabdf[_0xb35c('0x35')]);_0x1dcef2[_0xb35c('0x37')]=_[_0xb35c('0x38')](_0x1dcef2[_0xb35c('0x34')],_0x1dcef2[_0xb35c('0x35')]);_0x53f221[_0xb35c('0x39')]=_[_0xb35c('0x38')](_0x1dcef2[_0xb35c('0x34')],qs['fields'](_0x5cabdf[_0xb35c('0x35')][_0xb35c('0x3a')]));_0x53f221[_0xb35c('0x39')]=_0x53f221['attributes']['length']?_0x53f221[_0xb35c('0x39')]:_0x1dcef2['model'];if(!_0x5cabdf[_0xb35c('0x35')][_0xb35c('0x3b')]('nolimit')){_0x53f221[_0xb35c('0x22')]=qs['limit'](_0x5cabdf[_0xb35c('0x35')][_0xb35c('0x22')]);_0x53f221[_0xb35c('0x20')]=qs[_0xb35c('0x20')](_0x5cabdf['query']['offset']);}_0x53f221['order']=qs[_0xb35c('0x3c')](_0x5cabdf[_0xb35c('0x35')][_0xb35c('0x3c')]);_0x53f221[_0xb35c('0x3d')]=qs[_0xb35c('0x37')](_[_0xb35c('0x3e')](_0x5cabdf[_0xb35c('0x35')],_0x1dcef2[_0xb35c('0x37')]),_0x5cd30f);if(_0x5cabdf['query'][_0xb35c('0x3f')]){_0x53f221[_0xb35c('0x3d')]=_['merge'](_0x53f221[_0xb35c('0x3d')],{'$or':_[_0xb35c('0x2e')](_0x5cd30f,function(_0xcb90cf){if(_0xcb90cf[_0xb35c('0x32')]!=='VIRTUAL'){var _0x187c15={};_0x187c15[_0xcb90cf[_0xb35c('0x2c')]]={'$like':'%'+_0x5cabdf[_0xb35c('0x35')][_0xb35c('0x3f')]+'%'};return _0x187c15;}})});}_0x53f221=_[_0xb35c('0x40')]({},_0x53f221,_0x5cabdf[_0xb35c('0x41')]);var _0x3d87ca={'where':_0x53f221[_0xb35c('0x3d')]};return db[_0xb35c('0x2f')][_0xb35c('0x23')](_0x3d87ca)['then'](function(_0x580888){_0x7ec49b[_0xb35c('0x23')]=_0x580888;if(_0x5cabdf[_0xb35c('0x35')]['includeAll']){_0x53f221['include']=[{'all':!![]}];}return db[_0xb35c('0x2f')][_0xb35c('0x42')](_0x53f221);})[_0xb35c('0x29')](function(_0x9c73e6){_0x7ec49b[_0xb35c('0x43')]=_0x9c73e6;return _0x7ec49b;})[_0xb35c('0x29')](respondWithFilteredResult(_0x3b2c75,_0x53f221))[_0xb35c('0x44')](handleError(_0x3b2c75,null));};exports[_0xb35c('0x45')]=function(_0x151eb5,_0xe5f1bb){var _0x2cd3dd={'raw':![],'where':{'id':_0x151eb5['params']['id']}},_0x11c55e={};_0x11c55e[_0xb35c('0x34')]=_[_0xb35c('0x36')](db['SugarcrmAccount'][_0xb35c('0x30')]);_0x11c55e[_0xb35c('0x35')]=_[_0xb35c('0x36')](_0x151eb5[_0xb35c('0x35')]);_0x11c55e['filters']=_[_0xb35c('0x38')](_0x11c55e[_0xb35c('0x34')],_0x11c55e[_0xb35c('0x35')]);_0x2cd3dd['attributes']=_['intersection'](_0x11c55e['model'],qs[_0xb35c('0x3a')](_0x151eb5[_0xb35c('0x35')]['fields']));_0x2cd3dd['attributes']=_0x2cd3dd['attributes'][_0xb35c('0x46')]?_0x2cd3dd[_0xb35c('0x39')]:_0x11c55e[_0xb35c('0x34')];if(_0x151eb5['query']['includeAll']){_0x2cd3dd[_0xb35c('0x47')]=[{'all':!![]}];}_0x2cd3dd=_[_0xb35c('0x40')]({},_0x2cd3dd,_0x151eb5[_0xb35c('0x41')]);return db[_0xb35c('0x2f')][_0xb35c('0x48')](_0x2cd3dd)[_0xb35c('0x29')](handleEntityNotFound(_0xe5f1bb,null))['then'](respondWithResult(_0xe5f1bb,null))[_0xb35c('0x44')](handleError(_0xe5f1bb,null));};exports['create']=function(_0x55b2a5,_0x2d5672){return db['SugarcrmAccount']['create'](_0x55b2a5[_0xb35c('0x49')],{})[_0xb35c('0x29')](respondWithResult(_0x2d5672,0xc9))[_0xb35c('0x44')](handleError(_0x2d5672,null));};exports[_0xb35c('0x4a')]=function(_0x4b7605,_0x459acf){if(_0x4b7605[_0xb35c('0x49')]['id']){delete _0x4b7605[_0xb35c('0x49')]['id'];}return db['SugarcrmAccount'][_0xb35c('0x48')]({'where':{'id':_0x4b7605['params']['id']}})[_0xb35c('0x29')](handleEntityNotFound(_0x459acf,null))['then'](saveUpdates(_0x4b7605[_0xb35c('0x49')],null))[_0xb35c('0x29')](respondWithResult(_0x459acf,null))['catch'](handleError(_0x459acf,null));};exports['destroy']=function(_0x43e3eb,_0x447209){return db[_0xb35c('0x2f')]['find']({'where':{'id':_0x43e3eb[_0xb35c('0x4b')]['id']}})[_0xb35c('0x29')](handleEntityNotFound(_0x447209,null))['then'](removeEntity(_0x447209,null))[_0xb35c('0x44')](handleError(_0x447209,null));};exports[_0xb35c('0x4c')]=function(_0x3c8ba9,_0x1305b2,_0x2a18c2){var _0x107a0c={};var _0x93d93d={};var _0x2bbc6e;var _0x287895;return db[_0xb35c('0x2f')][_0xb35c('0x4d')]({'where':{'id':_0x3c8ba9[_0xb35c('0x4b')]['id']}})[_0xb35c('0x29')](handleEntityNotFound(_0x1305b2,null))[_0xb35c('0x29')](function(_0x403eb6){if(_0x403eb6){_0x2bbc6e=_0x403eb6;_0x93d93d[_0xb35c('0x34')]=_[_0xb35c('0x36')](db[_0xb35c('0x4e')][_0xb35c('0x30')]);_0x93d93d['query']=_[_0xb35c('0x36')](_0x3c8ba9[_0xb35c('0x35')]);_0x93d93d[_0xb35c('0x37')]=_[_0xb35c('0x38')](_0x93d93d[_0xb35c('0x34')],_0x93d93d['query']);_0x107a0c[_0xb35c('0x39')]=_[_0xb35c('0x38')](_0x93d93d[_0xb35c('0x34')],qs[_0xb35c('0x3a')](_0x3c8ba9[_0xb35c('0x35')][_0xb35c('0x3a')]));_0x107a0c[_0xb35c('0x39')]=_0x107a0c['attributes'][_0xb35c('0x46')]?_0x107a0c[_0xb35c('0x39')]:_0x93d93d[_0xb35c('0x34')];_0x107a0c[_0xb35c('0x4f')]=qs['sort'](_0x3c8ba9[_0xb35c('0x35')]['sort']);_0x107a0c[_0xb35c('0x3d')]=qs[_0xb35c('0x37')](_[_0xb35c('0x3e')](_0x3c8ba9[_0xb35c('0x35')],_0x93d93d['filters']));if(_0x3c8ba9['query']['filter']){_0x107a0c[_0xb35c('0x3d')]=_[_0xb35c('0x40')](_0x107a0c[_0xb35c('0x3d')],{'$or':_[_0xb35c('0x2e')](_0x107a0c[_0xb35c('0x39')],function(_0x482dce){var _0x36ba7f={};_0x36ba7f[_0x482dce]={'$like':'%'+_0x3c8ba9[_0xb35c('0x35')][_0xb35c('0x3f')]+'%'};return _0x36ba7f;})});}_0x107a0c=_[_0xb35c('0x40')]({},_0x107a0c,_0x3c8ba9[_0xb35c('0x41')]);return _0x2bbc6e['getConfigurations'](_0x107a0c);}})[_0xb35c('0x29')](function(_0xf811c5){if(_0xf811c5){_0x287895=_0xf811c5['length'];if(!_0x3c8ba9[_0xb35c('0x35')][_0xb35c('0x3b')]('nolimit')){_0x107a0c['limit']=qs[_0xb35c('0x22')](_0x3c8ba9['query']['limit']);_0x107a0c[_0xb35c('0x20')]=qs[_0xb35c('0x20')](_0x3c8ba9[_0xb35c('0x35')][_0xb35c('0x20')]);}return _0x2bbc6e[_0xb35c('0x4c')](_0x107a0c);}})[_0xb35c('0x29')](function(_0x8e70a9){if(_0x8e70a9){return _0x8e70a9?{'count':_0x287895,'rows':_0x8e70a9}:null;}})[_0xb35c('0x29')](respondWithResult(_0x1305b2,null))[_0xb35c('0x44')](handleError(_0x1305b2,null));};exports[_0xb35c('0x50')]=function(_0x37471f,_0x1cfe1,_0x2bc0ff){if(_0x37471f[_0xb35c('0x49')]['id']){delete _0x37471f[_0xb35c('0x49')]['id'];}return db['SugarcrmAccount'][_0xb35c('0x4d')]({'where':{'id':_0x37471f['params']['id']}})[_0xb35c('0x29')](handleEntityNotFound(_0x1cfe1,null))['then'](function(_0x1b386b){if(_0x1b386b){_0x37471f[_0xb35c('0x49')]['AccountId']=_0x1b386b['id'];_0x37471f[_0xb35c('0x49')][_0xb35c('0x51')]=integrations[_0xb35c('0x52')](_0x37471f['body'][_0xb35c('0x53')],_0x37471f[_0xb35c('0x49')][_0xb35c('0x32')]);_0x37471f[_0xb35c('0x49')][_0xb35c('0x54')]=integrations[_0xb35c('0x55')](_0x37471f[_0xb35c('0x49')][_0xb35c('0x53')],_0x37471f[_0xb35c('0x49')][_0xb35c('0x32')]);return db[_0xb35c('0x4e')][_0xb35c('0x56')](_0x37471f[_0xb35c('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xb35c('0x51')},{'model':db[_0xb35c('0x57')],'as':'Descriptions'}]});}return null;})[_0xb35c('0x29')](respondWithResult(_0x1cfe1,null))[_0xb35c('0x44')](handleError(_0x1cfe1,null));};exports[_0xb35c('0x58')]=function(_0xaa8bf5,_0x27cecc,_0x5b7fe4){var _0x53537d='';var _0x55da6f=['id',_0xb35c('0x2c'),_0xb35c('0x59'),_0xb35c('0x5a'),_0xb35c('0x5b'),'date_start',_0xb35c('0x5c'),'duration_minutes',_0xb35c('0x5d'),_0xb35c('0x5e'),_0xb35c('0x5f'),_0xb35c('0x60')];return db[_0xb35c('0x2f')][_0xb35c('0x4d')]({'where':{'id':_0xaa8bf5['params']['id']},'attributes':['id','username','password',_0xb35c('0x61')]})[_0xb35c('0x29')](handleEntityNotFound(_0x27cecc,null))[_0xb35c('0x29')](function(_0x35f0a8){if(_0x35f0a8){_0x53537d=_0x35f0a8['remoteUri'];var _0x1e3ab4=_0x53537d['slice'](-0x1);if(_0x1e3ab4==='/'){_0x53537d=_0x53537d[_0xb35c('0x62')](0x0,_0x53537d['lastIndexOf'](_0x1e3ab4));}return rp({'method':_0xb35c('0x63'),'uri':util['format'](_0xb35c('0x64'),_0x53537d,_0xb35c('0x65')),'json':!![],'form':{'method':_0xb35c('0x66'),'input_type':_0xb35c('0x67'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x35f0a8[_0xb35c('0x68')],'password':_0x35f0a8[_0xb35c('0x69')],'encryption':_0xb35c('0x6a')},'application':_0xb35c('0x6b')})}});}})[_0xb35c('0x29')](function(_0x590b5d){if(_0x590b5d&&_0x590b5d[_0xb35c('0x2c')]!==_0xb35c('0x6c')&&_0x590b5d[_0xb35c('0x2c')]!=='Password\x20Expired'){return rp({'method':_0xb35c('0x63'),'uri':util[_0xb35c('0x6d')](_0xb35c('0x64'),_0x53537d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb35c('0x67'),'response_type':_0xb35c('0x67'),'rest_data':JSON['stringify']({'session':_0x590b5d['id'],'module_name':'Calls'})}})[_0xb35c('0x29')](function(_0x593271){if(_0x593271){var _0x2753fc=_[_0xb35c('0x6e')](_0x593271['module_fields']);_[_0xb35c('0x6f')](_0x2753fc,function(_0x400409){return _0x55da6f[_0xb35c('0x70')](_0x400409[_0xb35c('0x2c')]);});return{'count':_0x2753fc['length'],'rows':_[_0xb35c('0x2e')](_0x2753fc,function(_0xb150c7){return{'id':_0xb150c7[_0xb35c('0x2c')],'name':_0xb150c7[_0xb35c('0x71')],'custom':_[_0xb35c('0x72')](_0xb150c7[_0xb35c('0x2c')],'_c')?!![]:![],'options':_0xb150c7[_0xb35c('0x41')]?_[_0xb35c('0x2e')](_['values'](_0xb150c7[_0xb35c('0x41')]),function(_0x1a2616){return{'name':_0x1a2616[_0xb35c('0x73')],'value':_0x1a2616[_0xb35c('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x27cecc,null))['catch'](function(_0xfe77c7){var _0x42572e=_0xaa8bf5[_0xb35c('0x35')][_0xb35c('0x74')]?0x1f4:_0xfe77c7[_0xb35c('0x75')]||0x1f4;logger[_0xb35c('0x2a')](_0xb35c('0x76'),_0xb35c('0x58'),_0x42572e,JSON['stringify'](_0xfe77c7));delete _0xfe77c7[_0xb35c('0x2c')];if(_0x42572e===0x191){_0x42572e=0x190;}_0x27cecc[_0xb35c('0x1d')](_0x42572e)['send'](_0xaa8bf5[_0xb35c('0x35')]['test']?{'message':_0xb35c('0x77'),'statusCode':_0xfe77c7[_0xb35c('0x75')]}:_0xfe77c7);});}else{var _0x1492f1=0x1f4;_0x27cecc['status'](_0x1492f1)['send']({'message':_0xb35c('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6cc3=['../../config/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','SugarcrmAccount','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','duration_hours','duration_minutes','parent_type','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6cc3,0x1ca));var _0x36cc=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x6cc3[_0x9d639c];return _0x1671de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36cc('0x0'));var zipdir=require(_0x36cc('0x1'));var jsonpatch=require(_0x36cc('0x2'));var rp=require(_0x36cc('0x3'));var moment=require(_0x36cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x36cc('0x5'));var util=require(_0x36cc('0x6'));var path=require(_0x36cc('0x7'));var sox=require(_0x36cc('0x8'));var csv=require(_0x36cc('0x9'));var ejs=require(_0x36cc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36cc('0xb'));var squel=require(_0x36cc('0xc'));var crypto=require(_0x36cc('0xd'));var jsforce=require(_0x36cc('0xe'));var deskjs=require(_0x36cc('0xf'));var toCsv=require(_0x36cc('0x9'));var querystring=require('querystring');var Papa=require(_0x36cc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36cc('0x11'));var hardwareService=require(_0x36cc('0x12'));var logger=require(_0x36cc('0x13'))(_0x36cc('0x14'));var utils=require(_0x36cc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x36cc('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x36cc('0x17'));function respondWithStatusCode(_0x325844,_0x57725c){_0x57725c=_0x57725c||0xcc;return function(_0x120da6){if(_0x120da6){return _0x325844['sendStatus'](_0x57725c);}return _0x325844['status'](_0x57725c)[_0x36cc('0x18')]();};}function respondWithResult(_0x14428d,_0x405fef){_0x405fef=_0x405fef||0xc8;return function(_0x5d3738){if(_0x5d3738){return _0x14428d[_0x36cc('0x19')](_0x405fef)[_0x36cc('0x1a')](_0x5d3738);}};}function respondWithFilteredResult(_0x2f6b18,_0x4ad93a){return function(_0x5ae66b){if(_0x5ae66b){var _0x4b3106=typeof _0x4ad93a[_0x36cc('0x1b')]===_0x36cc('0x1c')&&typeof _0x4ad93a[_0x36cc('0x1d')]===_0x36cc('0x1c');var _0x55fe75=_0x5ae66b[_0x36cc('0x1e')];var _0x29c5c=_0x4b3106?0x0:_0x4ad93a['offset'];var _0x36fd6b=_0x4b3106?_0x5ae66b[_0x36cc('0x1e')]:_0x4ad93a[_0x36cc('0x1b')]+_0x4ad93a['limit'];var _0x1fecfb;if(_0x36fd6b>=_0x55fe75){_0x36fd6b=_0x55fe75;_0x1fecfb=0xc8;}else{_0x1fecfb=0xce;}_0x2f6b18[_0x36cc('0x19')](_0x1fecfb);return _0x2f6b18['set'](_0x36cc('0x1f'),_0x29c5c+'-'+_0x36fd6b+'/'+_0x55fe75)['json'](_0x5ae66b);}return null;};}function patchUpdates(_0x120987){return function(_0x5b8630){try{jsonpatch[_0x36cc('0x20')](_0x5b8630,_0x120987,!![]);}catch(_0x5d7b16){return BPromise[_0x36cc('0x21')](_0x5d7b16);}return _0x5b8630[_0x36cc('0x22')]();};}function saveUpdates(_0x4ca114,_0x23fc2c){return function(_0x56c7db){if(_0x56c7db){return _0x56c7db[_0x36cc('0x23')](_0x4ca114)['then'](function(_0x3b8b93){return _0x3b8b93;});}return null;};}function removeEntity(_0x20cfe6,_0x27cf9d){return function(_0x4b62b3){if(_0x4b62b3){return _0x4b62b3[_0x36cc('0x24')]()[_0x36cc('0x25')](function(){_0x20cfe6[_0x36cc('0x19')](0xcc)[_0x36cc('0x18')]();});}};}function handleEntityNotFound(_0x48a99f,_0x5bf1e4){return function(_0x573bc7){if(!_0x573bc7){_0x48a99f[_0x36cc('0x26')](0x194);}return _0x573bc7;};}function handleError(_0x5b9a3e,_0x521422){_0x521422=_0x521422||0x1f4;return function(_0x1c328c){logger[_0x36cc('0x27')](_0x1c328c[_0x36cc('0x28')]);if(_0x1c328c[_0x36cc('0x29')]){delete _0x1c328c[_0x36cc('0x29')];}_0x5b9a3e['status'](_0x521422)[_0x36cc('0x2a')](_0x1c328c);};}exports[_0x36cc('0x2b')]=function(_0x49c6ab,_0x258719){var _0x52a1c0={},_0x416e07={},_0x5594f7={'count':0x0,'rows':[]};var _0x446f40=_['map'](db['SugarcrmAccount'][_0x36cc('0x2c')],function(_0x2609d0){return{'name':_0x2609d0[_0x36cc('0x2d')],'type':_0x2609d0[_0x36cc('0x2e')][_0x36cc('0x2f')]};});_0x416e07[_0x36cc('0x30')]=_[_0x36cc('0x31')](_0x446f40,_0x36cc('0x29'));_0x416e07[_0x36cc('0x32')]=_[_0x36cc('0x33')](_0x49c6ab[_0x36cc('0x32')]);_0x416e07[_0x36cc('0x34')]=_[_0x36cc('0x35')](_0x416e07[_0x36cc('0x30')],_0x416e07[_0x36cc('0x32')]);_0x52a1c0[_0x36cc('0x36')]=_['intersection'](_0x416e07[_0x36cc('0x30')],qs[_0x36cc('0x37')](_0x49c6ab[_0x36cc('0x32')][_0x36cc('0x37')]));_0x52a1c0['attributes']=_0x52a1c0[_0x36cc('0x36')]['length']?_0x52a1c0[_0x36cc('0x36')]:_0x416e07['model'];if(!_0x49c6ab['query'][_0x36cc('0x38')](_0x36cc('0x39'))){_0x52a1c0[_0x36cc('0x1d')]=qs[_0x36cc('0x1d')](_0x49c6ab[_0x36cc('0x32')]['limit']);_0x52a1c0[_0x36cc('0x1b')]=qs[_0x36cc('0x1b')](_0x49c6ab[_0x36cc('0x32')][_0x36cc('0x1b')]);}_0x52a1c0[_0x36cc('0x3a')]=qs[_0x36cc('0x3b')](_0x49c6ab[_0x36cc('0x32')][_0x36cc('0x3b')]);_0x52a1c0['where']=qs['filters'](_[_0x36cc('0x3c')](_0x49c6ab[_0x36cc('0x32')],_0x416e07[_0x36cc('0x34')]),_0x446f40);if(_0x49c6ab[_0x36cc('0x32')]['filter']){_0x52a1c0[_0x36cc('0x3d')]=_[_0x36cc('0x3e')](_0x52a1c0[_0x36cc('0x3d')],{'$or':_[_0x36cc('0x31')](_0x446f40,function(_0x2106fd){if(_0x2106fd[_0x36cc('0x2e')]!=='VIRTUAL'){var _0x4e8e86={};_0x4e8e86[_0x2106fd[_0x36cc('0x29')]]={'$like':'%'+_0x49c6ab[_0x36cc('0x32')][_0x36cc('0x3f')]+'%'};return _0x4e8e86;}})});}_0x52a1c0=_[_0x36cc('0x3e')]({},_0x52a1c0,_0x49c6ab[_0x36cc('0x40')]);var _0x53cfc5={'where':_0x52a1c0[_0x36cc('0x3d')]};return db[_0x36cc('0x41')]['count'](_0x53cfc5)['then'](function(_0x2ba6c1){_0x5594f7[_0x36cc('0x1e')]=_0x2ba6c1;if(_0x49c6ab[_0x36cc('0x32')][_0x36cc('0x42')]){_0x52a1c0['include']=[{'all':!![]}];}return db[_0x36cc('0x41')][_0x36cc('0x43')](_0x52a1c0);})[_0x36cc('0x25')](function(_0x25bf3c){_0x5594f7[_0x36cc('0x44')]=_0x25bf3c;return _0x5594f7;})[_0x36cc('0x25')](respondWithFilteredResult(_0x258719,_0x52a1c0))[_0x36cc('0x45')](handleError(_0x258719,null));};exports[_0x36cc('0x46')]=function(_0x5ec120,_0x15e75d){var _0x3b6959={'raw':![],'where':{'id':_0x5ec120[_0x36cc('0x47')]['id']}},_0x41c3a3={};_0x41c3a3[_0x36cc('0x30')]=_[_0x36cc('0x33')](db[_0x36cc('0x41')][_0x36cc('0x2c')]);_0x41c3a3[_0x36cc('0x32')]=_[_0x36cc('0x33')](_0x5ec120['query']);_0x41c3a3[_0x36cc('0x34')]=_['intersection'](_0x41c3a3[_0x36cc('0x30')],_0x41c3a3['query']);_0x3b6959[_0x36cc('0x36')]=_[_0x36cc('0x35')](_0x41c3a3[_0x36cc('0x30')],qs[_0x36cc('0x37')](_0x5ec120[_0x36cc('0x32')][_0x36cc('0x37')]));_0x3b6959[_0x36cc('0x36')]=_0x3b6959['attributes'][_0x36cc('0x48')]?_0x3b6959[_0x36cc('0x36')]:_0x41c3a3[_0x36cc('0x30')];if(_0x5ec120['query'][_0x36cc('0x42')]){_0x3b6959[_0x36cc('0x49')]=[{'all':!![]}];}_0x3b6959=_[_0x36cc('0x3e')]({},_0x3b6959,_0x5ec120[_0x36cc('0x40')]);return db[_0x36cc('0x41')][_0x36cc('0x4a')](_0x3b6959)[_0x36cc('0x25')](handleEntityNotFound(_0x15e75d,null))[_0x36cc('0x25')](respondWithResult(_0x15e75d,null))['catch'](handleError(_0x15e75d,null));};exports['create']=function(_0x55c1cb,_0x2e7770){return db[_0x36cc('0x41')][_0x36cc('0x4b')](_0x55c1cb[_0x36cc('0x4c')],{})['then'](respondWithResult(_0x2e7770,0xc9))[_0x36cc('0x45')](handleError(_0x2e7770,null));};exports[_0x36cc('0x23')]=function(_0x7e7f9b,_0x44318f){if(_0x7e7f9b['body']['id']){delete _0x7e7f9b[_0x36cc('0x4c')]['id'];}return db[_0x36cc('0x41')][_0x36cc('0x4a')]({'where':{'id':_0x7e7f9b['params']['id']}})[_0x36cc('0x25')](handleEntityNotFound(_0x44318f,null))[_0x36cc('0x25')](saveUpdates(_0x7e7f9b[_0x36cc('0x4c')],null))[_0x36cc('0x25')](respondWithResult(_0x44318f,null))[_0x36cc('0x45')](handleError(_0x44318f,null));};exports[_0x36cc('0x24')]=function(_0x263700,_0x3205f9){return db[_0x36cc('0x41')][_0x36cc('0x4a')]({'where':{'id':_0x263700[_0x36cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3205f9,null))[_0x36cc('0x25')](removeEntity(_0x3205f9,null))[_0x36cc('0x45')](handleError(_0x3205f9,null));};exports[_0x36cc('0x4d')]=function(_0x408040,_0x293727,_0x1562bf){var _0x4ad2f2={};var _0x1c7c1e={};var _0x2109dd;var _0x4c7b00;return db[_0x36cc('0x41')][_0x36cc('0x4e')]({'where':{'id':_0x408040[_0x36cc('0x47')]['id']}})[_0x36cc('0x25')](handleEntityNotFound(_0x293727,null))['then'](function(_0x191361){if(_0x191361){_0x2109dd=_0x191361;_0x1c7c1e['model']=_[_0x36cc('0x33')](db[_0x36cc('0x4f')][_0x36cc('0x2c')]);_0x1c7c1e['query']=_[_0x36cc('0x33')](_0x408040[_0x36cc('0x32')]);_0x1c7c1e[_0x36cc('0x34')]=_[_0x36cc('0x35')](_0x1c7c1e['model'],_0x1c7c1e['query']);_0x4ad2f2[_0x36cc('0x36')]=_[_0x36cc('0x35')](_0x1c7c1e[_0x36cc('0x30')],qs[_0x36cc('0x37')](_0x408040[_0x36cc('0x32')][_0x36cc('0x37')]));_0x4ad2f2['attributes']=_0x4ad2f2[_0x36cc('0x36')][_0x36cc('0x48')]?_0x4ad2f2['attributes']:_0x1c7c1e[_0x36cc('0x30')];_0x4ad2f2['order']=qs[_0x36cc('0x3b')](_0x408040[_0x36cc('0x32')][_0x36cc('0x3b')]);_0x4ad2f2[_0x36cc('0x3d')]=qs[_0x36cc('0x34')](_['pick'](_0x408040['query'],_0x1c7c1e[_0x36cc('0x34')]));if(_0x408040['query'][_0x36cc('0x3f')]){_0x4ad2f2[_0x36cc('0x3d')]=_['merge'](_0x4ad2f2['where'],{'$or':_['map'](_0x4ad2f2['attributes'],function(_0x49733a){var _0x361db7={};_0x361db7[_0x49733a]={'$like':'%'+_0x408040['query'][_0x36cc('0x3f')]+'%'};return _0x361db7;})});}_0x4ad2f2=_[_0x36cc('0x3e')]({},_0x4ad2f2,_0x408040[_0x36cc('0x40')]);return _0x2109dd[_0x36cc('0x4d')](_0x4ad2f2);}})[_0x36cc('0x25')](function(_0x434a18){if(_0x434a18){_0x4c7b00=_0x434a18['length'];if(!_0x408040[_0x36cc('0x32')][_0x36cc('0x38')]('nolimit')){_0x4ad2f2['limit']=qs[_0x36cc('0x1d')](_0x408040[_0x36cc('0x32')]['limit']);_0x4ad2f2[_0x36cc('0x1b')]=qs['offset'](_0x408040[_0x36cc('0x32')]['offset']);}return _0x2109dd[_0x36cc('0x4d')](_0x4ad2f2);}})['then'](function(_0x169687){if(_0x169687){return _0x169687?{'count':_0x4c7b00,'rows':_0x169687}:null;}})['then'](respondWithResult(_0x293727,null))[_0x36cc('0x45')](handleError(_0x293727,null));};exports[_0x36cc('0x50')]=function(_0x134ece,_0x354388,_0x55560f){if(_0x134ece[_0x36cc('0x4c')]['id']){delete _0x134ece[_0x36cc('0x4c')]['id'];}return db[_0x36cc('0x41')][_0x36cc('0x4e')]({'where':{'id':_0x134ece['params']['id']}})[_0x36cc('0x25')](handleEntityNotFound(_0x354388,null))[_0x36cc('0x25')](function(_0x3aabd6){if(_0x3aabd6){_0x134ece[_0x36cc('0x4c')][_0x36cc('0x51')]=_0x3aabd6['id'];_0x134ece[_0x36cc('0x4c')]['Subjects']=integrations[_0x36cc('0x52')](_0x134ece[_0x36cc('0x4c')][_0x36cc('0x53')],_0x134ece[_0x36cc('0x4c')][_0x36cc('0x2e')]);_0x134ece['body']['Descriptions']=integrations[_0x36cc('0x54')](_0x134ece[_0x36cc('0x4c')][_0x36cc('0x53')],_0x134ece[_0x36cc('0x4c')]['type']);return db['SugarcrmConfiguration'][_0x36cc('0x4b')](_0x134ece[_0x36cc('0x4c')],{'include':[{'model':db[_0x36cc('0x55')],'as':_0x36cc('0x56')},{'model':db[_0x36cc('0x55')],'as':'Descriptions'}]});}return null;})[_0x36cc('0x25')](respondWithResult(_0x354388,null))[_0x36cc('0x45')](handleError(_0x354388,null));};exports[_0x36cc('0x57')]=function(_0x1f425f,_0x589207,_0x567cca){var _0x566c='';var _0x57be1f=['id',_0x36cc('0x29'),_0x36cc('0x58'),_0x36cc('0x59'),'description','date_start',_0x36cc('0x5a'),_0x36cc('0x5b'),'parent_id',_0x36cc('0x5c'),'parent_name',_0x36cc('0x5d')];return db[_0x36cc('0x41')]['findOne']({'where':{'id':_0x1f425f[_0x36cc('0x47')]['id']},'attributes':['id',_0x36cc('0x5e'),_0x36cc('0x5f'),_0x36cc('0x60')]})[_0x36cc('0x25')](handleEntityNotFound(_0x589207,null))['then'](function(_0x31b715){if(_0x31b715){_0x566c=_0x31b715[_0x36cc('0x60')];var _0x221662=_0x566c[_0x36cc('0x61')](-0x1);if(_0x221662==='/'){_0x566c=_0x566c[_0x36cc('0x62')](0x0,_0x566c['lastIndexOf'](_0x221662));}return rp({'method':_0x36cc('0x63'),'uri':util[_0x36cc('0x64')](_0x36cc('0x65'),_0x566c,_0x36cc('0x66')),'json':!![],'form':{'method':_0x36cc('0x67'),'input_type':_0x36cc('0x68'),'response_type':_0x36cc('0x68'),'rest_data':JSON[_0x36cc('0x69')]({'user_auth':{'user_name':_0x31b715[_0x36cc('0x5e')],'password':_0x31b715[_0x36cc('0x5f')],'encryption':_0x36cc('0x6a')},'application':_0x36cc('0x6b')})}});}})[_0x36cc('0x25')](function(_0x5c3935){if(_0x5c3935&&_0x5c3935[_0x36cc('0x29')]!==_0x36cc('0x6c')&&_0x5c3935['name']!=='Password\x20Expired'){return rp({'method':_0x36cc('0x63'),'uri':util[_0x36cc('0x64')](_0x36cc('0x65'),_0x566c,_0x36cc('0x66')),'json':!![],'form':{'method':_0x36cc('0x6d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5c3935['id'],'module_name':_0x36cc('0x6e')})}})[_0x36cc('0x25')](function(_0x428da5){if(_0x428da5){var _0x3bf385=_['values'](_0x428da5['module_fields']);_[_0x36cc('0x6f')](_0x3bf385,function(_0x4a8ed1){return _0x57be1f[_0x36cc('0x70')](_0x4a8ed1[_0x36cc('0x29')]);});return{'count':_0x3bf385[_0x36cc('0x48')],'rows':_['map'](_0x3bf385,function(_0x5f63e3){return{'id':_0x5f63e3[_0x36cc('0x29')],'name':_0x5f63e3[_0x36cc('0x71')],'custom':_[_0x36cc('0x72')](_0x5f63e3[_0x36cc('0x29')],'_c')?!![]:![],'options':_0x5f63e3['options']?_[_0x36cc('0x31')](_['values'](_0x5f63e3[_0x36cc('0x40')]),function(_0x1a2a8c){return{'name':_0x1a2a8c[_0x36cc('0x73')],'value':_0x1a2a8c[_0x36cc('0x29')]};}):[]};})};}})[_0x36cc('0x25')](respondWithResult(_0x589207,null))['catch'](function(_0x3b0801){var _0x3fd9f9=_0x1f425f[_0x36cc('0x32')][_0x36cc('0x74')]?0x1f4:_0x3b0801[_0x36cc('0x75')]||0x1f4;logger[_0x36cc('0x27')](_0x36cc('0x76'),_0x36cc('0x57'),_0x3fd9f9,JSON['stringify'](_0x3b0801));delete _0x3b0801[_0x36cc('0x29')];if(_0x3fd9f9===0x191){_0x3fd9f9=0x190;}_0x589207['status'](_0x3fd9f9)[_0x36cc('0x2a')](_0x1f425f[_0x36cc('0x32')][_0x36cc('0x74')]?{'message':_0x36cc('0x77'),'statusCode':_0x3b0801['statusCode']}:_0x3b0801);});}else{var _0x2f8e00=0x1f4;_0x589207[_0x36cc('0x19')](_0x2f8e00)[_0x36cc('0x2a')]({'message':_0x36cc('0x77'),'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 67397d9..e5bb98b 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 _0xe021=['lodash','util','../../config/logger','api','path','../../config/environment','./intSugarcrmAccount.attributes','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x27ffb3,_0x30207d){var _0x327076=function(_0x2b8d5c){while(--_0x2b8d5c){_0x27ffb3['push'](_0x27ffb3['shift']());}};_0x327076(++_0x30207d);}(_0xe021,0x10e));var _0x1e02=function(_0x131e9c,_0x3428cb){_0x131e9c=_0x131e9c-0x0;var _0x519940=_0xe021[_0x131e9c];return _0x519940;};'use strict';var _=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var logger=require(_0x1e02('0x2'))(_0x1e02('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e02('0x4'));var rimraf=require('rimraf');var config=require(_0x1e02('0x5'));var attributes=require(_0x1e02('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2516f8,_0x6f4c4c){return _0x2516f8['define'](_0x1e02('0x7'),attributes,{'tableName':_0x1e02('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d8b=['path','../../config/environment','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2bc326,_0x473cf8){var _0x43722e=function(_0x4dd559){while(--_0x4dd559){_0x2bc326['push'](_0x2bc326['shift']());}};_0x43722e(++_0x473cf8);}(_0x0d8b,0x1e6));var _0xb0d8=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x0d8b[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require('lodash');var util=require(_0xb0d8('0x0'));var logger=require(_0xb0d8('0x1'))(_0xb0d8('0x2'));var moment=require(_0xb0d8('0x3'));var BPromise=require(_0xb0d8('0x4'));var rp=require(_0xb0d8('0x5'));var fs=require('fs');var path=require(_0xb0d8('0x6'));var rimraf=require('rimraf');var config=require(_0xb0d8('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb0d8('0x8')]=function(_0x35f5f7,_0x2c13be){return _0x35f5f7[_0xb0d8('0x9')](_0xb0d8('0xa'),attributes,{'tableName':_0xb0d8('0xb'),'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 352e9c8..4c84f08 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 _0xcdb2=['attributes','limit','include','map','model','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where'];(function(_0x24c81b,_0x561823){var _0x281ef5=function(_0x2a9d6d){while(--_0x2a9d6d){_0x24c81b['push'](_0x24c81b['shift']());}};_0x281ef5(++_0x561823);}(_0xcdb2,0xbb));var _0x2cdb=function(_0x39d6e1,_0x539d5c){_0x39d6e1=_0x39d6e1-0x0;var _0x23f30d=_0xcdb2[_0x39d6e1];return _0x23f30d;};'use strict';var _=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var moment=require(_0x2cdb('0x2'));var BPromise=require(_0x2cdb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cdb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2cdb('0x5'))(_0x2cdb('0x6'));var config=require(_0x2cdb('0x7'));var jayson=require(_0x2cdb('0x8'));var client=jayson['client'][_0x2cdb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d5c4a,_0x2b2529,_0x32ab93){return new BPromise(function(_0x95eb28,_0x269633){return client[_0x2cdb('0xa')](_0x1d5c4a,_0x32ab93)[_0x2cdb('0xb')](function(_0x354592){logger[_0x2cdb('0xc')](_0x2cdb('0xd'),_0x2b2529,_0x2cdb('0xe'));logger[_0x2cdb('0xf')](_0x2cdb('0x10'),_0x2b2529,_0x2cdb('0xe'),JSON[_0x2cdb('0x11')](_0x354592));if(_0x354592[_0x2cdb('0x12')]){if(_0x354592[_0x2cdb('0x12')][_0x2cdb('0x13')]===0x1f4){logger[_0x2cdb('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x2b2529,_0x354592[_0x2cdb('0x12')][_0x2cdb('0x14')]);return _0x269633(_0x354592[_0x2cdb('0x12')][_0x2cdb('0x14')]);}logger[_0x2cdb('0x12')](_0x2cdb('0xd'),_0x2b2529,_0x354592[_0x2cdb('0x12')]['message']);return _0x95eb28(_0x354592[_0x2cdb('0x12')][_0x2cdb('0x14')]);}else{logger[_0x2cdb('0xc')](_0x2cdb('0xd'),_0x2b2529,_0x2cdb('0xe'));_0x95eb28(_0x354592[_0x2cdb('0x15')][_0x2cdb('0x14')]);}})[_0x2cdb('0x16')](function(_0x1c0fd1){logger['error'](_0x2cdb('0xd'),_0x2b2529,_0x1c0fd1);_0x269633(_0x1c0fd1);});});}exports[_0x2cdb('0x17')]=function(_0x503a28){var _0x3a735a=this;return new Promise(function(_0x27584d,_0x2be092){return db[_0x2cdb('0x18')][_0x2cdb('0x19')]({'raw':_0x503a28[_0x2cdb('0x1a')]?_0x503a28[_0x2cdb('0x1a')][_0x2cdb('0x1b')]===undefined?!![]:![]:!![],'where':_0x503a28[_0x2cdb('0x1a')]?_0x503a28[_0x2cdb('0x1a')][_0x2cdb('0x1c')]||null:null,'attributes':_0x503a28[_0x2cdb('0x1a')]?_0x503a28[_0x2cdb('0x1a')][_0x2cdb('0x1d')]||null:null,'limit':_0x503a28[_0x2cdb('0x1a')]?_0x503a28[_0x2cdb('0x1a')][_0x2cdb('0x1e')]||null:null,'include':_0x503a28[_0x2cdb('0x1a')]?_0x503a28[_0x2cdb('0x1a')][_0x2cdb('0x1f')]?_[_0x2cdb('0x20')](_0x503a28['options']['include'],function(_0x231ef2){return{'model':db[_0x231ef2['model']],'as':_0x231ef2['as'],'attributes':_0x231ef2[_0x2cdb('0x1d')],'include':_0x231ef2[_0x2cdb('0x1f')]?_[_0x2cdb('0x20')](_0x231ef2[_0x2cdb('0x1f')],function(_0x2db4cd){return{'model':db[_0x2db4cd[_0x2cdb('0x21')]],'as':_0x2db4cd['as'],'attributes':_0x2db4cd[_0x2cdb('0x1d')],'include':_0x2db4cd[_0x2cdb('0x1f')]?_[_0x2cdb('0x20')](_0x2db4cd[_0x2cdb('0x1f')],function(_0x328e99){return{'model':db[_0x328e99[_0x2cdb('0x21')]],'as':_0x328e99['as'],'attributes':_0x328e99[_0x2cdb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2cdb('0xb')](function(_0x4e60a6){logger[_0x2cdb('0xc')]('GetSugarcrmAccount',_0x503a28);logger[_0x2cdb('0xf')](_0x2cdb('0x17'),_0x503a28,JSON[_0x2cdb('0x11')](_0x4e60a6));_0x27584d(_0x4e60a6);})['catch'](function(_0xc7aae7){logger['error'](_0x2cdb('0x17'),_0xc7aae7[_0x2cdb('0x14')],_0x503a28);_0x2be092(_0x3a735a[_0x2cdb('0x12')](0x1f4,_0xc7aae7[_0x2cdb('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x1ef2d6){var _0x1d2067=this;return new Promise(function(_0x192dec,_0xe1a68a){return db[_0x2cdb('0x18')][_0x2cdb('0x22')]({'raw':_0x1ef2d6[_0x2cdb('0x1a')]?_0x1ef2d6[_0x2cdb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1ef2d6[_0x2cdb('0x1a')]?_0x1ef2d6[_0x2cdb('0x1a')][_0x2cdb('0x1c')]||null:null,'attributes':_0x1ef2d6[_0x2cdb('0x1a')]?_0x1ef2d6[_0x2cdb('0x1a')][_0x2cdb('0x1d')]||null:null,'include':_0x1ef2d6[_0x2cdb('0x1a')]?_0x1ef2d6[_0x2cdb('0x1a')]['include']?_['map'](_0x1ef2d6[_0x2cdb('0x1a')][_0x2cdb('0x1f')],function(_0x1757e6){return{'model':db[_0x1757e6[_0x2cdb('0x21')]],'as':_0x1757e6['as'],'attributes':_0x1757e6[_0x2cdb('0x1d')],'include':_0x1757e6[_0x2cdb('0x1f')]?_[_0x2cdb('0x20')](_0x1757e6[_0x2cdb('0x1f')],function(_0x4ea953){return{'model':db[_0x4ea953['model']],'as':_0x4ea953['as'],'attributes':_0x4ea953[_0x2cdb('0x1d')],'include':_0x4ea953[_0x2cdb('0x1f')]?_[_0x2cdb('0x20')](_0x4ea953[_0x2cdb('0x1f')],function(_0x59743b){return{'model':db[_0x59743b[_0x2cdb('0x21')]],'as':_0x59743b['as'],'attributes':_0x59743b[_0x2cdb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2cdb('0xb')](function(_0x31046d){logger[_0x2cdb('0xc')](_0x2cdb('0x23'),_0x1ef2d6);logger[_0x2cdb('0xf')](_0x2cdb('0x23'),_0x1ef2d6,JSON[_0x2cdb('0x11')](_0x31046d));_0x192dec(_0x31046d);})[_0x2cdb('0x16')](function(_0xe5ae82){logger[_0x2cdb('0x12')](_0x2cdb('0x23'),_0xe5ae82['message'],_0x1ef2d6);_0xe1a68a(_0x1d2067['error'](0x1f4,_0xe5ae82[_0x2cdb('0x14')]));});});}; \ No newline at end of file +var _0x72da=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','limit','include','map','model','attributes','catch','find','where','info','ShowSugarcrmAccount'];(function(_0x2139b1,_0x3a1e56){var _0x24536b=function(_0x593928){while(--_0x593928){_0x2139b1['push'](_0x2139b1['shift']());}};_0x24536b(++_0x3a1e56);}(_0x72da,0xf5));var _0xa72d=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x72da[_0x868b7c];return _0x21683c;};'use strict';var _=require(_0xa72d('0x0'));var util=require(_0xa72d('0x1'));var moment=require(_0xa72d('0x2'));var BPromise=require(_0xa72d('0x3'));var rs=require(_0xa72d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa72d('0x5'))['db'];var utils=require(_0xa72d('0x6'));var logger=require(_0xa72d('0x7'))(_0xa72d('0x8'));var config=require('../../config/environment');var jayson=require(_0xa72d('0x9'));var client=jayson[_0xa72d('0xa')][_0xa72d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f818e,_0x253f46,_0x2818a7){return new BPromise(function(_0x4d7b36,_0x391fa6){return client[_0xa72d('0xc')](_0x5f818e,_0x2818a7)[_0xa72d('0xd')](function(_0x45d9d2){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x253f46,_0xa72d('0xe'));logger[_0xa72d('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x253f46,_0xa72d('0xe'),JSON[_0xa72d('0x10')](_0x45d9d2));if(_0x45d9d2['error']){if(_0x45d9d2[_0xa72d('0x11')]['code']===0x1f4){logger[_0xa72d('0x11')](_0xa72d('0x12'),_0x253f46,_0x45d9d2[_0xa72d('0x11')][_0xa72d('0x13')]);return _0x391fa6(_0x45d9d2[_0xa72d('0x11')][_0xa72d('0x13')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x253f46,_0x45d9d2[_0xa72d('0x11')][_0xa72d('0x13')]);return _0x4d7b36(_0x45d9d2[_0xa72d('0x11')][_0xa72d('0x13')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x253f46,'request\x20sent');_0x4d7b36(_0x45d9d2['result']['message']);}})['catch'](function(_0x12399d){logger[_0xa72d('0x11')](_0xa72d('0x12'),_0x253f46,_0x12399d);_0x391fa6(_0x12399d);});});}exports[_0xa72d('0x14')]=function(_0xb447ba){var _0x13c4f8=this;return new Promise(function(_0x580793,_0x29e950){return db[_0xa72d('0x15')][_0xa72d('0x16')]({'raw':_0xb447ba[_0xa72d('0x17')]?_0xb447ba[_0xa72d('0x17')][_0xa72d('0x18')]===undefined?!![]:![]:!![],'where':_0xb447ba[_0xa72d('0x17')]?_0xb447ba['options']['where']||null:null,'attributes':_0xb447ba['options']?_0xb447ba[_0xa72d('0x17')]['attributes']||null:null,'limit':_0xb447ba[_0xa72d('0x17')]?_0xb447ba[_0xa72d('0x17')][_0xa72d('0x19')]||null:null,'include':_0xb447ba[_0xa72d('0x17')]?_0xb447ba['options'][_0xa72d('0x1a')]?_[_0xa72d('0x1b')](_0xb447ba[_0xa72d('0x17')]['include'],function(_0x55282e){return{'model':db[_0x55282e[_0xa72d('0x1c')]],'as':_0x55282e['as'],'attributes':_0x55282e[_0xa72d('0x1d')],'include':_0x55282e['include']?_[_0xa72d('0x1b')](_0x55282e[_0xa72d('0x1a')],function(_0x3635c9){return{'model':db[_0x3635c9[_0xa72d('0x1c')]],'as':_0x3635c9['as'],'attributes':_0x3635c9['attributes'],'include':_0x3635c9[_0xa72d('0x1a')]?_[_0xa72d('0x1b')](_0x3635c9[_0xa72d('0x1a')],function(_0x5c5530){return{'model':db[_0x5c5530['model']],'as':_0x5c5530['as'],'attributes':_0x5c5530[_0xa72d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa72d('0xd')](function(_0x129d05){logger['info'](_0xa72d('0x14'),_0xb447ba);logger[_0xa72d('0xf')]('GetSugarcrmAccount',_0xb447ba,JSON[_0xa72d('0x10')](_0x129d05));_0x580793(_0x129d05);})[_0xa72d('0x1e')](function(_0x4d1bae){logger['error']('GetSugarcrmAccount',_0x4d1bae[_0xa72d('0x13')],_0xb447ba);_0x29e950(_0x13c4f8[_0xa72d('0x11')](0x1f4,_0x4d1bae[_0xa72d('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0xa41d2b){var _0x17afcf=this;return new Promise(function(_0x5c26dd,_0x4a86f4){return db['SugarcrmAccount'][_0xa72d('0x1f')]({'raw':_0xa41d2b[_0xa72d('0x17')]?_0xa41d2b[_0xa72d('0x17')][_0xa72d('0x18')]===undefined?!![]:![]:!![],'where':_0xa41d2b[_0xa72d('0x17')]?_0xa41d2b[_0xa72d('0x17')][_0xa72d('0x20')]||null:null,'attributes':_0xa41d2b[_0xa72d('0x17')]?_0xa41d2b[_0xa72d('0x17')][_0xa72d('0x1d')]||null:null,'include':_0xa41d2b['options']?_0xa41d2b[_0xa72d('0x17')][_0xa72d('0x1a')]?_[_0xa72d('0x1b')](_0xa41d2b[_0xa72d('0x17')][_0xa72d('0x1a')],function(_0x30be87){return{'model':db[_0x30be87[_0xa72d('0x1c')]],'as':_0x30be87['as'],'attributes':_0x30be87['attributes'],'include':_0x30be87['include']?_[_0xa72d('0x1b')](_0x30be87['include'],function(_0x309d8f){return{'model':db[_0x309d8f[_0xa72d('0x1c')]],'as':_0x309d8f['as'],'attributes':_0x309d8f[_0xa72d('0x1d')],'include':_0x309d8f[_0xa72d('0x1a')]?_['map'](_0x309d8f[_0xa72d('0x1a')],function(_0x34f148){return{'model':db[_0x34f148[_0xa72d('0x1c')]],'as':_0x34f148['as'],'attributes':_0x34f148[_0xa72d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa72d('0xd')](function(_0x50660a){logger[_0xa72d('0x21')](_0xa72d('0x22'),_0xa41d2b);logger[_0xa72d('0xf')]('ShowSugarcrmAccount',_0xa41d2b,JSON[_0xa72d('0x10')](_0x50660a));_0x5c26dd(_0x50660a);})[_0xa72d('0x1e')](function(_0x22ae71){logger[_0xa72d('0x11')]('ShowSugarcrmAccount',_0x22ae71[_0xa72d('0x13')],_0xa41d2b);_0x4a86f4(_0x17afcf[_0xa72d('0x11')](0x1f4,_0x22ae71[_0xa72d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 9dfd12c..3719a80 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 _0xb6c4=['getFields','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields'];(function(_0x22de70,_0x243f39){var _0x34050e=function(_0x21186e){while(--_0x21186e){_0x22de70['push'](_0x22de70['shift']());}};_0x34050e(++_0x243f39);}(_0xb6c4,0xa8));var _0x4b6c=function(_0x2827ed,_0xcf94a3){_0x2827ed=_0x2827ed-0x0;var _0x531f2f=_0xb6c4[_0x2827ed];return _0x531f2f;};'use strict';var multer=require(_0x4b6c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b6c('0x1'));var express=require(_0x4b6c('0x2'));var router=express[_0x4b6c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b6c('0x4'));var config=require(_0x4b6c('0x5'));var controller=require(_0x4b6c('0x6'));router['get']('/',auth[_0x4b6c('0x7')](),controller[_0x4b6c('0x8')]);router[_0x4b6c('0x9')](_0x4b6c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4b6c('0x9')](_0x4b6c('0xb'),auth[_0x4b6c('0x7')](),controller[_0x4b6c('0xc')]);router['get']('/:id/subjects',auth[_0x4b6c('0x7')](),controller['getSubjects']);router[_0x4b6c('0x9')](_0x4b6c('0xd'),auth[_0x4b6c('0x7')](),controller[_0x4b6c('0xe')]);router[_0x4b6c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4b6c('0x10')](_0x4b6c('0xa'),auth[_0x4b6c('0x7')](),controller[_0x4b6c('0x11')]);router[_0x4b6c('0x12')](_0x4b6c('0xa'),auth[_0x4b6c('0x7')](),controller[_0x4b6c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfec8=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects'];(function(_0x5e09d8,_0x327e77){var _0x1a73eb=function(_0x459186){while(--_0x459186){_0x5e09d8['push'](_0x5e09d8['shift']());}};_0x1a73eb(++_0x327e77);}(_0xfec8,0x107));var _0x8fec=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xfec8[_0x158a58];return _0x4935d9;};'use strict';var multer=require(_0x8fec('0x0'));var util=require(_0x8fec('0x1'));var path=require('path');var timeout=require(_0x8fec('0x2'));var express=require('express');var router=express[_0x8fec('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8fec('0x4'));var config=require(_0x8fec('0x5'));var controller=require(_0x8fec('0x6'));router['get']('/',auth[_0x8fec('0x7')](),controller[_0x8fec('0x8')]);router[_0x8fec('0x9')](_0x8fec('0xa'),auth[_0x8fec('0x7')](),controller[_0x8fec('0xb')]);router[_0x8fec('0x9')]('/:id/fields',auth[_0x8fec('0x7')](),controller['getFields']);router[_0x8fec('0x9')](_0x8fec('0xc'),auth[_0x8fec('0x7')](),controller[_0x8fec('0xd')]);router[_0x8fec('0x9')](_0x8fec('0xe'),auth[_0x8fec('0x7')](),controller[_0x8fec('0xf')]);router[_0x8fec('0x10')]('/',auth[_0x8fec('0x7')](),controller[_0x8fec('0x11')]);router[_0x8fec('0x12')]('/:id',auth[_0x8fec('0x7')](),controller[_0x8fec('0x13')]);router[_0x8fec('0x14')](_0x8fec('0xa'),auth[_0x8fec('0x7')](),controller[_0x8fec('0x15')]);module[_0x8fec('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 0a65925..2d573cd 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 _0x856c=['STRING','sequelize','exports'];(function(_0x1bc8cf,_0x54cf01){var _0x40a7de=function(_0x32c9db){while(--_0x32c9db){_0x1bc8cf['push'](_0x1bc8cf['shift']());}};_0x40a7de(++_0x54cf01);}(_0x856c,0xb8));var _0xc856=function(_0xaa98ff,_0x356a7e){_0xaa98ff=_0xaa98ff-0x0;var _0x3db650=_0x856c[_0xaa98ff];return _0x3db650;};'use strict';var Sequelize=require(_0xc856('0x0'));module[_0xc856('0x1')]={'name':{'type':Sequelize[_0xc856('0x2')]},'description':{'type':Sequelize[_0xc856('0x2')]}}; \ No newline at end of file +var _0x53e9=['exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x53e9,0x1bf));var _0x953e=function(_0x275082,_0x265946){_0x275082=_0x275082-0x0;var _0x161957=_0x53e9[_0x275082];return _0x161957;};'use strict';var Sequelize=require('sequelize');module[_0x953e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 12466f1..5019b8b 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 _0x2428=['key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','length','options','find','create','body','update','params','getFields','findOne','sort','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','destroy','then','error','name','index','map','SugarcrmConfiguration','rawAttributes','type'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x2428,0xfc));var _0x8242=function(_0x5a566d,_0x6ffe3a){_0x5a566d=_0x5a566d-0x0;var _0x511056=_0x2428[_0x5a566d];return _0x511056;};'use strict';var emlformat=require(_0x8242('0x0'));var rimraf=require(_0x8242('0x1'));var zipdir=require(_0x8242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8242('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8242('0x4'));var util=require('util');var path=require(_0x8242('0x5'));var sox=require(_0x8242('0x6'));var csv=require(_0x8242('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8242('0x8'));var _=require('lodash');var squel=require(_0x8242('0x9'));var crypto=require(_0x8242('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8242('0xb'));var Papa=require(_0x8242('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8242('0xd'));var as=require(_0x8242('0xe'));var hardwareService=require(_0x8242('0xf'));var logger=require(_0x8242('0x10'))(_0x8242('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8242('0x12'))['db'];function respondWithStatusCode(_0x1ba027,_0x4ab99f){_0x4ab99f=_0x4ab99f||0xcc;return function(_0x596dbe){if(_0x596dbe){return _0x1ba027[_0x8242('0x13')](_0x4ab99f);}return _0x1ba027[_0x8242('0x14')](_0x4ab99f)[_0x8242('0x15')]();};}function respondWithResult(_0x2db957,_0x121319){_0x121319=_0x121319||0xc8;return function(_0x2032f0){if(_0x2032f0){return _0x2db957[_0x8242('0x14')](_0x121319)['json'](_0x2032f0);}};}function respondWithFilteredResult(_0x5f44ce,_0x2e1a9f){return function(_0x4b91ae){if(_0x4b91ae){var _0x4ad859=typeof _0x2e1a9f[_0x8242('0x16')]==='undefined'&&typeof _0x2e1a9f[_0x8242('0x17')]===_0x8242('0x18');var _0x4edbd0=_0x4b91ae[_0x8242('0x19')];var _0x4d8b77=_0x4ad859?0x0:_0x2e1a9f[_0x8242('0x16')];var _0x2bcfad=_0x4ad859?_0x4b91ae[_0x8242('0x19')]:_0x2e1a9f[_0x8242('0x16')]+_0x2e1a9f[_0x8242('0x17')];var _0x1c9f52;if(_0x2bcfad>=_0x4edbd0){_0x2bcfad=_0x4edbd0;_0x1c9f52=0xc8;}else{_0x1c9f52=0xce;}_0x5f44ce[_0x8242('0x14')](_0x1c9f52);return _0x5f44ce['set'](_0x8242('0x1a'),_0x4d8b77+'-'+_0x2bcfad+'/'+_0x4edbd0)[_0x8242('0x1b')](_0x4b91ae);}return null;};}function patchUpdates(_0xf3b47f){return function(_0x4528e7){try{jsonpatch[_0x8242('0x1c')](_0x4528e7,_0xf3b47f,!![]);}catch(_0x595b97){return BPromise[_0x8242('0x1d')](_0x595b97);}return _0x4528e7[_0x8242('0x1e')]();};}function saveUpdates(_0x5e593e,_0x3fc30d){return function(_0x3499b0){if(_0x3499b0){return _0x3499b0['update'](_0x5e593e)['then'](function(_0xd1ce18){return _0xd1ce18;});}return null;};}function removeEntity(_0x4bfbba,_0x3108c1){return function(_0x91c280){if(_0x91c280){return _0x91c280[_0x8242('0x1f')]()[_0x8242('0x20')](function(){_0x4bfbba[_0x8242('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e672b,_0x567802){return function(_0x6d1d1f){if(!_0x6d1d1f){_0x5e672b[_0x8242('0x13')](0x194);}return _0x6d1d1f;};}function handleError(_0x322f62,_0x441687){_0x441687=_0x441687||0x1f4;return function(_0x547146){logger[_0x8242('0x21')](_0x547146['stack']);if(_0x547146[_0x8242('0x22')]){delete _0x547146['name'];}_0x322f62[_0x8242('0x14')](_0x441687)['send'](_0x547146);};}exports[_0x8242('0x23')]=function(_0x36635b,_0x4b35d5){var _0x34fe76={},_0x2737a3={},_0xa08b3={'count':0x0,'rows':[]};var _0x4cf47f=_[_0x8242('0x24')](db[_0x8242('0x25')][_0x8242('0x26')],function(_0x29add1){return{'name':_0x29add1['fieldName'],'type':_0x29add1[_0x8242('0x27')][_0x8242('0x28')]};});_0x2737a3[_0x8242('0x29')]=_[_0x8242('0x24')](_0x4cf47f,_0x8242('0x22'));_0x2737a3[_0x8242('0x2a')]=_[_0x8242('0x2b')](_0x36635b[_0x8242('0x2a')]);_0x2737a3['filters']=_[_0x8242('0x2c')](_0x2737a3[_0x8242('0x29')],_0x2737a3['query']);_0x34fe76[_0x8242('0x2d')]=_[_0x8242('0x2c')](_0x2737a3[_0x8242('0x29')],qs[_0x8242('0x2e')](_0x36635b['query'][_0x8242('0x2e')]));_0x34fe76[_0x8242('0x2d')]=_0x34fe76[_0x8242('0x2d')]['length']?_0x34fe76[_0x8242('0x2d')]:_0x2737a3[_0x8242('0x29')];if(!_0x36635b[_0x8242('0x2a')][_0x8242('0x2f')](_0x8242('0x30'))){_0x34fe76[_0x8242('0x17')]=qs[_0x8242('0x17')](_0x36635b[_0x8242('0x2a')][_0x8242('0x17')]);_0x34fe76['offset']=qs[_0x8242('0x16')](_0x36635b[_0x8242('0x2a')][_0x8242('0x16')]);}_0x34fe76[_0x8242('0x31')]=qs['sort'](_0x36635b[_0x8242('0x2a')]['sort']);_0x34fe76['where']=qs[_0x8242('0x32')](_[_0x8242('0x33')](_0x36635b[_0x8242('0x2a')],_0x2737a3[_0x8242('0x32')]),_0x4cf47f);if(_0x36635b[_0x8242('0x2a')][_0x8242('0x34')]){_0x34fe76[_0x8242('0x35')]=_['merge'](_0x34fe76[_0x8242('0x35')],{'$or':_[_0x8242('0x24')](_0x4cf47f,function(_0x11f6bb){if(_0x11f6bb[_0x8242('0x27')]!==_0x8242('0x36')){var _0x1b5a50={};_0x1b5a50[_0x11f6bb[_0x8242('0x22')]]={'$like':'%'+_0x36635b['query'][_0x8242('0x34')]+'%'};return _0x1b5a50;}})});}_0x34fe76=_[_0x8242('0x37')]({},_0x34fe76,_0x36635b['options']);var _0x53ff78={'where':_0x34fe76[_0x8242('0x35')]};return db[_0x8242('0x25')][_0x8242('0x19')](_0x53ff78)[_0x8242('0x20')](function(_0x33faff){_0xa08b3[_0x8242('0x19')]=_0x33faff;if(_0x36635b[_0x8242('0x2a')][_0x8242('0x38')]){_0x34fe76[_0x8242('0x39')]=[{'all':!![]}];}return db[_0x8242('0x25')][_0x8242('0x3a')](_0x34fe76);})[_0x8242('0x20')](function(_0x527a87){_0xa08b3['rows']=_0x527a87;return _0xa08b3;})[_0x8242('0x20')](respondWithFilteredResult(_0x4b35d5,_0x34fe76))[_0x8242('0x3b')](handleError(_0x4b35d5,null));};exports['show']=function(_0x3e8348,_0xc9d59e){var _0x306edf={'raw':![],'where':{'id':_0x3e8348['params']['id']}},_0x1f6b71={};_0x1f6b71[_0x8242('0x29')]=_[_0x8242('0x2b')](db[_0x8242('0x25')][_0x8242('0x26')]);_0x1f6b71['query']=_[_0x8242('0x2b')](_0x3e8348[_0x8242('0x2a')]);_0x1f6b71[_0x8242('0x32')]=_[_0x8242('0x2c')](_0x1f6b71['model'],_0x1f6b71[_0x8242('0x2a')]);_0x306edf[_0x8242('0x2d')]=_[_0x8242('0x2c')](_0x1f6b71[_0x8242('0x29')],qs['fields'](_0x3e8348['query']['fields']));_0x306edf['attributes']=_0x306edf[_0x8242('0x2d')][_0x8242('0x3c')]?_0x306edf[_0x8242('0x2d')]:_0x1f6b71[_0x8242('0x29')];if(_0x3e8348[_0x8242('0x2a')][_0x8242('0x38')]){_0x306edf[_0x8242('0x39')]=[{'all':!![]}];}_0x306edf=_[_0x8242('0x37')]({},_0x306edf,_0x3e8348[_0x8242('0x3d')]);return db[_0x8242('0x25')][_0x8242('0x3e')](_0x306edf)[_0x8242('0x20')](handleEntityNotFound(_0xc9d59e,null))['then'](respondWithResult(_0xc9d59e,null))[_0x8242('0x3b')](handleError(_0xc9d59e,null));};exports[_0x8242('0x3f')]=function(_0x412850,_0x2d76e2){return db[_0x8242('0x25')][_0x8242('0x3f')](_0x412850[_0x8242('0x40')],{})['then'](respondWithResult(_0x2d76e2,0xc9))['catch'](handleError(_0x2d76e2,null));};exports[_0x8242('0x41')]=function(_0x4050fa,_0x19444a){if(_0x4050fa[_0x8242('0x40')]['id']){delete _0x4050fa[_0x8242('0x40')]['id'];}return db['SugarcrmConfiguration'][_0x8242('0x3e')]({'where':{'id':_0x4050fa[_0x8242('0x42')]['id']}})[_0x8242('0x20')](handleEntityNotFound(_0x19444a,null))['then'](saveUpdates(_0x4050fa[_0x8242('0x40')],null))[_0x8242('0x20')](respondWithResult(_0x19444a,null))[_0x8242('0x3b')](handleError(_0x19444a,null));};exports[_0x8242('0x1f')]=function(_0x197eec,_0xea3434){return db[_0x8242('0x25')]['find']({'where':{'id':_0x197eec[_0x8242('0x42')]['id']}})[_0x8242('0x20')](handleEntityNotFound(_0xea3434,null))['then'](removeEntity(_0xea3434,null))['catch'](handleError(_0xea3434,null));};exports[_0x8242('0x43')]=function(_0x68c128,_0x928709,_0x3becb5){var _0x2b7606={};var _0x516168={};var _0xceb953;var _0x37ea5e;return db[_0x8242('0x25')][_0x8242('0x44')]({'where':{'id':_0x68c128[_0x8242('0x42')]['id']}})[_0x8242('0x20')](handleEntityNotFound(_0x928709,null))[_0x8242('0x20')](function(_0x26d34a){if(_0x26d34a){_0xceb953=_0x26d34a;_0x516168[_0x8242('0x29')]=_[_0x8242('0x2b')](db['SugarcrmField'][_0x8242('0x26')]);_0x516168[_0x8242('0x2a')]=_[_0x8242('0x2b')](_0x68c128[_0x8242('0x2a')]);_0x516168[_0x8242('0x32')]=_[_0x8242('0x2c')](_0x516168[_0x8242('0x29')],_0x516168[_0x8242('0x2a')]);_0x2b7606['attributes']=_[_0x8242('0x2c')](_0x516168['model'],qs[_0x8242('0x2e')](_0x68c128[_0x8242('0x2a')][_0x8242('0x2e')]));_0x2b7606[_0x8242('0x2d')]=_0x2b7606[_0x8242('0x2d')][_0x8242('0x3c')]?_0x2b7606[_0x8242('0x2d')]:_0x516168[_0x8242('0x29')];_0x2b7606[_0x8242('0x31')]=qs['sort'](_0x68c128[_0x8242('0x2a')][_0x8242('0x45')]);_0x2b7606[_0x8242('0x35')]=qs[_0x8242('0x32')](_['pick'](_0x68c128['query'],_0x516168[_0x8242('0x32')]));if(_0x68c128[_0x8242('0x2a')][_0x8242('0x34')]){_0x2b7606[_0x8242('0x35')]=_[_0x8242('0x37')](_0x2b7606[_0x8242('0x35')],{'$or':_['map'](_0x2b7606[_0x8242('0x2d')],function(_0xc624c7){var _0xd0dc47={};_0xd0dc47[_0xc624c7]={'$like':'%'+_0x68c128[_0x8242('0x2a')]['filter']+'%'};return _0xd0dc47;})});}_0x2b7606=_['merge']({},_0x2b7606,_0x68c128['options']);return _0xceb953[_0x8242('0x43')](_0x2b7606);}})[_0x8242('0x20')](function(_0x4f04c3){if(_0x4f04c3){_0x37ea5e=_0x4f04c3[_0x8242('0x3c')];if(!_0x68c128[_0x8242('0x2a')][_0x8242('0x2f')](_0x8242('0x30'))){_0x2b7606[_0x8242('0x17')]=qs[_0x8242('0x17')](_0x68c128['query'][_0x8242('0x17')]);_0x2b7606[_0x8242('0x16')]=qs[_0x8242('0x16')](_0x68c128['query'][_0x8242('0x16')]);}return _0xceb953[_0x8242('0x43')](_0x2b7606);}})[_0x8242('0x20')](function(_0x4c3d53){if(_0x4c3d53){return _0x4c3d53?{'count':_0x37ea5e,'rows':_0x4c3d53}:null;}})[_0x8242('0x20')](respondWithResult(_0x928709,null))[_0x8242('0x3b')](handleError(_0x928709,null));};exports[_0x8242('0x46')]=function(_0x118014,_0x3cee92,_0x483787){var _0x2b1561={};var _0x34c20f={};var _0x30a6b2;var _0x406543;return db[_0x8242('0x25')]['findOne']({'where':{'id':_0x118014[_0x8242('0x42')]['id']}})[_0x8242('0x20')](handleEntityNotFound(_0x3cee92,null))[_0x8242('0x20')](function(_0x2f0ebf){if(_0x2f0ebf){_0x30a6b2=_0x2f0ebf;_0x34c20f[_0x8242('0x29')]=_[_0x8242('0x2b')](db[_0x8242('0x47')]['rawAttributes']);_0x34c20f['query']=_[_0x8242('0x2b')](_0x118014[_0x8242('0x2a')]);_0x34c20f[_0x8242('0x32')]=_['intersection'](_0x34c20f['model'],_0x34c20f[_0x8242('0x2a')]);_0x2b1561['attributes']=_[_0x8242('0x2c')](_0x34c20f['model'],qs[_0x8242('0x2e')](_0x118014[_0x8242('0x2a')][_0x8242('0x2e')]));_0x2b1561[_0x8242('0x2d')]=_0x2b1561[_0x8242('0x2d')][_0x8242('0x3c')]?_0x2b1561[_0x8242('0x2d')]:_0x34c20f[_0x8242('0x29')];_0x2b1561[_0x8242('0x31')]=qs[_0x8242('0x45')](_0x118014['query'][_0x8242('0x45')]);_0x2b1561[_0x8242('0x35')]=qs[_0x8242('0x32')](_[_0x8242('0x33')](_0x118014[_0x8242('0x2a')],_0x34c20f[_0x8242('0x32')]));if(_0x118014['query'][_0x8242('0x34')]){_0x2b1561[_0x8242('0x35')]=_[_0x8242('0x37')](_0x2b1561['where'],{'$or':_[_0x8242('0x24')](_0x2b1561[_0x8242('0x2d')],function(_0x216c9b){var _0x53f5f2={};_0x53f5f2[_0x216c9b]={'$like':'%'+_0x118014[_0x8242('0x2a')]['filter']+'%'};return _0x53f5f2;})});}_0x2b1561=_[_0x8242('0x37')]({},_0x2b1561,_0x118014[_0x8242('0x3d')]);return _0x30a6b2['getSubjects'](_0x2b1561);}})[_0x8242('0x20')](function(_0x315fa9){if(_0x315fa9){_0x406543=_0x315fa9[_0x8242('0x3c')];if(!_0x118014[_0x8242('0x2a')][_0x8242('0x2f')](_0x8242('0x30'))){_0x2b1561[_0x8242('0x17')]=qs[_0x8242('0x17')](_0x118014[_0x8242('0x2a')][_0x8242('0x17')]);_0x2b1561[_0x8242('0x16')]=qs[_0x8242('0x16')](_0x118014[_0x8242('0x2a')][_0x8242('0x16')]);}return _0x30a6b2[_0x8242('0x46')](_0x2b1561);}})[_0x8242('0x20')](function(_0x322ab4){if(_0x322ab4){return _0x322ab4?{'count':_0x406543,'rows':_0x322ab4}:null;}})[_0x8242('0x20')](respondWithResult(_0x3cee92,null))[_0x8242('0x3b')](handleError(_0x3cee92,null));};exports[_0x8242('0x48')]=function(_0x4b0893,_0x2c87ac,_0x25c56d){var _0x40b3c8={};var _0x3d5545={};var _0x1a8e2d;var _0x18ebcc;return db[_0x8242('0x25')][_0x8242('0x44')]({'where':{'id':_0x4b0893[_0x8242('0x42')]['id']}})[_0x8242('0x20')](handleEntityNotFound(_0x2c87ac,null))[_0x8242('0x20')](function(_0x1a20fb){if(_0x1a20fb){_0x1a8e2d=_0x1a20fb;_0x3d5545[_0x8242('0x29')]=_[_0x8242('0x2b')](db[_0x8242('0x47')][_0x8242('0x26')]);_0x3d5545[_0x8242('0x2a')]=_[_0x8242('0x2b')](_0x4b0893[_0x8242('0x2a')]);_0x3d5545['filters']=_[_0x8242('0x2c')](_0x3d5545['model'],_0x3d5545['query']);_0x40b3c8[_0x8242('0x2d')]=_[_0x8242('0x2c')](_0x3d5545[_0x8242('0x29')],qs[_0x8242('0x2e')](_0x4b0893[_0x8242('0x2a')]['fields']));_0x40b3c8[_0x8242('0x2d')]=_0x40b3c8['attributes'][_0x8242('0x3c')]?_0x40b3c8[_0x8242('0x2d')]:_0x3d5545[_0x8242('0x29')];_0x40b3c8[_0x8242('0x31')]=qs['sort'](_0x4b0893['query'][_0x8242('0x45')]);_0x40b3c8['where']=qs['filters'](_[_0x8242('0x33')](_0x4b0893[_0x8242('0x2a')],_0x3d5545[_0x8242('0x32')]));if(_0x4b0893['query'][_0x8242('0x34')]){_0x40b3c8[_0x8242('0x35')]=_[_0x8242('0x37')](_0x40b3c8[_0x8242('0x35')],{'$or':_[_0x8242('0x24')](_0x40b3c8[_0x8242('0x2d')],function(_0x8001dc){var _0x24d5dc={};_0x24d5dc[_0x8001dc]={'$like':'%'+_0x4b0893[_0x8242('0x2a')]['filter']+'%'};return _0x24d5dc;})});}_0x40b3c8=_[_0x8242('0x37')]({},_0x40b3c8,_0x4b0893[_0x8242('0x3d')]);return _0x1a8e2d[_0x8242('0x48')](_0x40b3c8);}})[_0x8242('0x20')](function(_0x51f589){if(_0x51f589){_0x18ebcc=_0x51f589[_0x8242('0x3c')];if(!_0x4b0893[_0x8242('0x2a')][_0x8242('0x2f')](_0x8242('0x30'))){_0x40b3c8['limit']=qs[_0x8242('0x17')](_0x4b0893[_0x8242('0x2a')][_0x8242('0x17')]);_0x40b3c8[_0x8242('0x16')]=qs[_0x8242('0x16')](_0x4b0893[_0x8242('0x2a')][_0x8242('0x16')]);}return _0x1a8e2d[_0x8242('0x48')](_0x40b3c8);}})[_0x8242('0x20')](function(_0x2269ed){if(_0x2269ed){return _0x2269ed?{'count':_0x18ebcc,'rows':_0x2269ed}:null;}})[_0x8242('0x20')](respondWithResult(_0x2c87ac,null))[_0x8242('0x3b')](handleError(_0x2c87ac,null));}; \ No newline at end of file +var _0x88b8=['sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','catch','params','find','create','body','getFields','SugarcrmField','order','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','status','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit'];(function(_0x514df5,_0x3d07c3){var _0x5a63f2=function(_0x4cc1a5){while(--_0x4cc1a5){_0x514df5['push'](_0x514df5['shift']());}};_0x5a63f2(++_0x3d07c3);}(_0x88b8,0x6b));var _0x888b=function(_0xc83c25,_0x106681){_0xc83c25=_0xc83c25-0x0;var _0x5ed069=_0x88b8[_0xc83c25];return _0x5ed069;};'use strict';var emlformat=require(_0x888b('0x0'));var rimraf=require(_0x888b('0x1'));var zipdir=require(_0x888b('0x2'));var jsonpatch=require(_0x888b('0x3'));var rp=require(_0x888b('0x4'));var moment=require(_0x888b('0x5'));var BPromise=require(_0x888b('0x6'));var Mustache=require(_0x888b('0x7'));var util=require(_0x888b('0x8'));var path=require(_0x888b('0x9'));var sox=require(_0x888b('0xa'));var csv=require(_0x888b('0xb'));var ejs=require(_0x888b('0xc'));var fs=require('fs');var fs_extra=require(_0x888b('0xd'));var _=require(_0x888b('0xe'));var squel=require(_0x888b('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x888b('0x10'));var toCsv=require(_0x888b('0xb'));var querystring=require(_0x888b('0x11'));var Papa=require('papaparse');var Redis=require(_0x888b('0x12'));var authService=require(_0x888b('0x13'));var qs=require(_0x888b('0x14'));var as=require(_0x888b('0x15'));var hardwareService=require(_0x888b('0x16'));var logger=require(_0x888b('0x17'))(_0x888b('0x18'));var utils=require(_0x888b('0x19'));var config=require(_0x888b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x888b('0x1b'))['db'];function respondWithStatusCode(_0x3bf00c,_0xe398d2){_0xe398d2=_0xe398d2||0xcc;return function(_0x301c72){if(_0x301c72){return _0x3bf00c['sendStatus'](_0xe398d2);}return _0x3bf00c['status'](_0xe398d2)[_0x888b('0x1c')]();};}function respondWithResult(_0x35bc20,_0x26f7b2){_0x26f7b2=_0x26f7b2||0xc8;return function(_0x2ed071){if(_0x2ed071){return _0x35bc20['status'](_0x26f7b2)[_0x888b('0x1d')](_0x2ed071);}};}function respondWithFilteredResult(_0xaf8a89,_0x48a44b){return function(_0x312f1b){if(_0x312f1b){var _0x350ea5=typeof _0x48a44b[_0x888b('0x1e')]==='undefined'&&typeof _0x48a44b['limit']===_0x888b('0x1f');var _0x2167f1=_0x312f1b[_0x888b('0x20')];var _0x207ac8=_0x350ea5?0x0:_0x48a44b[_0x888b('0x1e')];var _0x173b89=_0x350ea5?_0x312f1b[_0x888b('0x20')]:_0x48a44b['offset']+_0x48a44b['limit'];var _0x24039a;if(_0x173b89>=_0x2167f1){_0x173b89=_0x2167f1;_0x24039a=0xc8;}else{_0x24039a=0xce;}_0xaf8a89['status'](_0x24039a);return _0xaf8a89[_0x888b('0x21')](_0x888b('0x22'),_0x207ac8+'-'+_0x173b89+'/'+_0x2167f1)[_0x888b('0x1d')](_0x312f1b);}return null;};}function patchUpdates(_0x48d21f){return function(_0xc824c6){try{jsonpatch[_0x888b('0x23')](_0xc824c6,_0x48d21f,!![]);}catch(_0x33ff4d){return BPromise[_0x888b('0x24')](_0x33ff4d);}return _0xc824c6[_0x888b('0x25')]();};}function saveUpdates(_0x23b7b5,_0x51e0aa){return function(_0x21b7d1){if(_0x21b7d1){return _0x21b7d1[_0x888b('0x26')](_0x23b7b5)['then'](function(_0x3ace9e){return _0x3ace9e;});}return null;};}function removeEntity(_0x324785,_0x29affd){return function(_0x3cb015){if(_0x3cb015){return _0x3cb015[_0x888b('0x27')]()['then'](function(){_0x324785[_0x888b('0x28')](0xcc)[_0x888b('0x1c')]();});}};}function handleEntityNotFound(_0x109178,_0xe69b5f){return function(_0x56d5cd){if(!_0x56d5cd){_0x109178['sendStatus'](0x194);}return _0x56d5cd;};}function handleError(_0x11648d,_0x532256){_0x532256=_0x532256||0x1f4;return function(_0x2211f7){logger[_0x888b('0x29')](_0x2211f7[_0x888b('0x2a')]);if(_0x2211f7[_0x888b('0x2b')]){delete _0x2211f7[_0x888b('0x2b')];}_0x11648d[_0x888b('0x28')](_0x532256)[_0x888b('0x2c')](_0x2211f7);};}exports[_0x888b('0x2d')]=function(_0x218a6e,_0x441a91){var _0x1060cf={},_0x58d674={},_0x57f5a5={'count':0x0,'rows':[]};var _0x11cf38=_[_0x888b('0x2e')](db[_0x888b('0x2f')][_0x888b('0x30')],function(_0x492b0c){return{'name':_0x492b0c[_0x888b('0x31')],'type':_0x492b0c[_0x888b('0x32')]['key']};});_0x58d674['model']=_[_0x888b('0x2e')](_0x11cf38,_0x888b('0x2b'));_0x58d674[_0x888b('0x33')]=_[_0x888b('0x34')](_0x218a6e['query']);_0x58d674['filters']=_[_0x888b('0x35')](_0x58d674[_0x888b('0x36')],_0x58d674['query']);_0x1060cf['attributes']=_[_0x888b('0x35')](_0x58d674[_0x888b('0x36')],qs[_0x888b('0x37')](_0x218a6e[_0x888b('0x33')]['fields']));_0x1060cf['attributes']=_0x1060cf[_0x888b('0x38')][_0x888b('0x39')]?_0x1060cf[_0x888b('0x38')]:_0x58d674[_0x888b('0x36')];if(!_0x218a6e['query'][_0x888b('0x3a')](_0x888b('0x3b'))){_0x1060cf[_0x888b('0x3c')]=qs[_0x888b('0x3c')](_0x218a6e[_0x888b('0x33')][_0x888b('0x3c')]);_0x1060cf[_0x888b('0x1e')]=qs[_0x888b('0x1e')](_0x218a6e['query']['offset']);}_0x1060cf['order']=qs[_0x888b('0x3d')](_0x218a6e[_0x888b('0x33')][_0x888b('0x3d')]);_0x1060cf[_0x888b('0x3e')]=qs[_0x888b('0x3f')](_[_0x888b('0x40')](_0x218a6e[_0x888b('0x33')],_0x58d674[_0x888b('0x3f')]),_0x11cf38);if(_0x218a6e[_0x888b('0x33')][_0x888b('0x41')]){_0x1060cf['where']=_[_0x888b('0x42')](_0x1060cf[_0x888b('0x3e')],{'$or':_[_0x888b('0x2e')](_0x11cf38,function(_0x59f2c4){if(_0x59f2c4[_0x888b('0x32')]!==_0x888b('0x43')){var _0x279ffb={};_0x279ffb[_0x59f2c4[_0x888b('0x2b')]]={'$like':'%'+_0x218a6e[_0x888b('0x33')][_0x888b('0x41')]+'%'};return _0x279ffb;}})});}_0x1060cf=_[_0x888b('0x42')]({},_0x1060cf,_0x218a6e[_0x888b('0x44')]);var _0x2d5cd1={'where':_0x1060cf['where']};return db[_0x888b('0x2f')][_0x888b('0x20')](_0x2d5cd1)['then'](function(_0x4d4411){_0x57f5a5[_0x888b('0x20')]=_0x4d4411;if(_0x218a6e['query'][_0x888b('0x45')]){_0x1060cf[_0x888b('0x46')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x888b('0x47')](_0x1060cf);})['then'](function(_0x20013b){_0x57f5a5['rows']=_0x20013b;return _0x57f5a5;})[_0x888b('0x48')](respondWithFilteredResult(_0x441a91,_0x1060cf))[_0x888b('0x49')](handleError(_0x441a91,null));};exports['show']=function(_0x1f2a67,_0xb78f72){var _0x2e2faa={'raw':![],'where':{'id':_0x1f2a67[_0x888b('0x4a')]['id']}},_0x54760={};_0x54760[_0x888b('0x36')]=_['keys'](db['SugarcrmConfiguration'][_0x888b('0x30')]);_0x54760[_0x888b('0x33')]=_[_0x888b('0x34')](_0x1f2a67[_0x888b('0x33')]);_0x54760[_0x888b('0x3f')]=_['intersection'](_0x54760[_0x888b('0x36')],_0x54760['query']);_0x2e2faa[_0x888b('0x38')]=_['intersection'](_0x54760['model'],qs[_0x888b('0x37')](_0x1f2a67[_0x888b('0x33')][_0x888b('0x37')]));_0x2e2faa['attributes']=_0x2e2faa[_0x888b('0x38')][_0x888b('0x39')]?_0x2e2faa[_0x888b('0x38')]:_0x54760[_0x888b('0x36')];if(_0x1f2a67[_0x888b('0x33')]['includeAll']){_0x2e2faa['include']=[{'all':!![]}];}_0x2e2faa=_[_0x888b('0x42')]({},_0x2e2faa,_0x1f2a67[_0x888b('0x44')]);return db[_0x888b('0x2f')][_0x888b('0x4b')](_0x2e2faa)[_0x888b('0x48')](handleEntityNotFound(_0xb78f72,null))['then'](respondWithResult(_0xb78f72,null))['catch'](handleError(_0xb78f72,null));};exports[_0x888b('0x4c')]=function(_0x57a8ec,_0x159d19){return db['SugarcrmConfiguration'][_0x888b('0x4c')](_0x57a8ec[_0x888b('0x4d')],{})['then'](respondWithResult(_0x159d19,0xc9))[_0x888b('0x49')](handleError(_0x159d19,null));};exports['update']=function(_0x5aaf4d,_0xa99ec9){if(_0x5aaf4d[_0x888b('0x4d')]['id']){delete _0x5aaf4d[_0x888b('0x4d')]['id'];}return db[_0x888b('0x2f')][_0x888b('0x4b')]({'where':{'id':_0x5aaf4d[_0x888b('0x4a')]['id']}})[_0x888b('0x48')](handleEntityNotFound(_0xa99ec9,null))[_0x888b('0x48')](saveUpdates(_0x5aaf4d['body'],null))[_0x888b('0x48')](respondWithResult(_0xa99ec9,null))[_0x888b('0x49')](handleError(_0xa99ec9,null));};exports['destroy']=function(_0x3d0311,_0x1d573c){return db[_0x888b('0x2f')][_0x888b('0x4b')]({'where':{'id':_0x3d0311[_0x888b('0x4a')]['id']}})[_0x888b('0x48')](handleEntityNotFound(_0x1d573c,null))['then'](removeEntity(_0x1d573c,null))[_0x888b('0x49')](handleError(_0x1d573c,null));};exports[_0x888b('0x4e')]=function(_0x247c1f,_0x14f94e,_0x2a85ee){var _0x7facfd={};var _0x1bfcb9={};var _0x20b705;var _0x511e39;return db[_0x888b('0x2f')]['findOne']({'where':{'id':_0x247c1f['params']['id']}})['then'](handleEntityNotFound(_0x14f94e,null))[_0x888b('0x48')](function(_0x1af065){if(_0x1af065){_0x20b705=_0x1af065;_0x1bfcb9[_0x888b('0x36')]=_['keys'](db[_0x888b('0x4f')][_0x888b('0x30')]);_0x1bfcb9[_0x888b('0x33')]=_[_0x888b('0x34')](_0x247c1f[_0x888b('0x33')]);_0x1bfcb9[_0x888b('0x3f')]=_[_0x888b('0x35')](_0x1bfcb9[_0x888b('0x36')],_0x1bfcb9[_0x888b('0x33')]);_0x7facfd['attributes']=_['intersection'](_0x1bfcb9[_0x888b('0x36')],qs[_0x888b('0x37')](_0x247c1f[_0x888b('0x33')][_0x888b('0x37')]));_0x7facfd['attributes']=_0x7facfd[_0x888b('0x38')][_0x888b('0x39')]?_0x7facfd[_0x888b('0x38')]:_0x1bfcb9['model'];_0x7facfd[_0x888b('0x50')]=qs[_0x888b('0x3d')](_0x247c1f[_0x888b('0x33')][_0x888b('0x3d')]);_0x7facfd[_0x888b('0x3e')]=qs['filters'](_['pick'](_0x247c1f['query'],_0x1bfcb9[_0x888b('0x3f')]));if(_0x247c1f[_0x888b('0x33')][_0x888b('0x41')]){_0x7facfd['where']=_[_0x888b('0x42')](_0x7facfd['where'],{'$or':_[_0x888b('0x2e')](_0x7facfd[_0x888b('0x38')],function(_0x357c8c){var _0x198d9a={};_0x198d9a[_0x357c8c]={'$like':'%'+_0x247c1f[_0x888b('0x33')][_0x888b('0x41')]+'%'};return _0x198d9a;})});}_0x7facfd=_[_0x888b('0x42')]({},_0x7facfd,_0x247c1f['options']);return _0x20b705[_0x888b('0x4e')](_0x7facfd);}})[_0x888b('0x48')](function(_0x5be47b){if(_0x5be47b){_0x511e39=_0x5be47b[_0x888b('0x39')];if(!_0x247c1f[_0x888b('0x33')][_0x888b('0x3a')]('nolimit')){_0x7facfd[_0x888b('0x3c')]=qs[_0x888b('0x3c')](_0x247c1f[_0x888b('0x33')][_0x888b('0x3c')]);_0x7facfd[_0x888b('0x1e')]=qs[_0x888b('0x1e')](_0x247c1f[_0x888b('0x33')][_0x888b('0x1e')]);}return _0x20b705[_0x888b('0x4e')](_0x7facfd);}})[_0x888b('0x48')](function(_0x13a815){if(_0x13a815){return _0x13a815?{'count':_0x511e39,'rows':_0x13a815}:null;}})[_0x888b('0x48')](respondWithResult(_0x14f94e,null))[_0x888b('0x49')](handleError(_0x14f94e,null));};exports[_0x888b('0x51')]=function(_0x2863a7,_0x296034,_0x274182){var _0x3b0fd1={};var _0x30b06c={};var _0x2b94d1;var _0x2ecdb5;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x2863a7[_0x888b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x296034,null))[_0x888b('0x48')](function(_0x2bc0d2){if(_0x2bc0d2){_0x2b94d1=_0x2bc0d2;_0x30b06c[_0x888b('0x36')]=_[_0x888b('0x34')](db[_0x888b('0x4f')][_0x888b('0x30')]);_0x30b06c[_0x888b('0x33')]=_[_0x888b('0x34')](_0x2863a7['query']);_0x30b06c['filters']=_[_0x888b('0x35')](_0x30b06c[_0x888b('0x36')],_0x30b06c['query']);_0x3b0fd1[_0x888b('0x38')]=_['intersection'](_0x30b06c[_0x888b('0x36')],qs[_0x888b('0x37')](_0x2863a7[_0x888b('0x33')][_0x888b('0x37')]));_0x3b0fd1[_0x888b('0x38')]=_0x3b0fd1[_0x888b('0x38')]['length']?_0x3b0fd1[_0x888b('0x38')]:_0x30b06c[_0x888b('0x36')];_0x3b0fd1['order']=qs[_0x888b('0x3d')](_0x2863a7['query'][_0x888b('0x3d')]);_0x3b0fd1[_0x888b('0x3e')]=qs[_0x888b('0x3f')](_[_0x888b('0x40')](_0x2863a7['query'],_0x30b06c['filters']));if(_0x2863a7['query'][_0x888b('0x41')]){_0x3b0fd1['where']=_[_0x888b('0x42')](_0x3b0fd1[_0x888b('0x3e')],{'$or':_['map'](_0x3b0fd1['attributes'],function(_0x3d1bed){var _0x141c80={};_0x141c80[_0x3d1bed]={'$like':'%'+_0x2863a7[_0x888b('0x33')][_0x888b('0x41')]+'%'};return _0x141c80;})});}_0x3b0fd1=_[_0x888b('0x42')]({},_0x3b0fd1,_0x2863a7[_0x888b('0x44')]);return _0x2b94d1[_0x888b('0x51')](_0x3b0fd1);}})['then'](function(_0x42a730){if(_0x42a730){_0x2ecdb5=_0x42a730[_0x888b('0x39')];if(!_0x2863a7['query']['hasOwnProperty']('nolimit')){_0x3b0fd1[_0x888b('0x3c')]=qs['limit'](_0x2863a7['query'][_0x888b('0x3c')]);_0x3b0fd1[_0x888b('0x1e')]=qs['offset'](_0x2863a7[_0x888b('0x33')][_0x888b('0x1e')]);}return _0x2b94d1[_0x888b('0x51')](_0x3b0fd1);}})[_0x888b('0x48')](function(_0x5234f5){if(_0x5234f5){return _0x5234f5?{'count':_0x2ecdb5,'rows':_0x5234f5}:null;}})[_0x888b('0x48')](respondWithResult(_0x296034,null))[_0x888b('0x49')](handleError(_0x296034,null));};exports[_0x888b('0x52')]=function(_0xee68bb,_0xc9617c,_0x5c9b4e){var _0x1cdad9={};var _0x98251b={};var _0x315005;var _0x4ae3cb;return db[_0x888b('0x2f')][_0x888b('0x53')]({'where':{'id':_0xee68bb['params']['id']}})['then'](handleEntityNotFound(_0xc9617c,null))[_0x888b('0x48')](function(_0x2ca5ad){if(_0x2ca5ad){_0x315005=_0x2ca5ad;_0x98251b[_0x888b('0x36')]=_[_0x888b('0x34')](db[_0x888b('0x4f')]['rawAttributes']);_0x98251b[_0x888b('0x33')]=_[_0x888b('0x34')](_0xee68bb[_0x888b('0x33')]);_0x98251b['filters']=_[_0x888b('0x35')](_0x98251b['model'],_0x98251b['query']);_0x1cdad9[_0x888b('0x38')]=_[_0x888b('0x35')](_0x98251b[_0x888b('0x36')],qs['fields'](_0xee68bb[_0x888b('0x33')][_0x888b('0x37')]));_0x1cdad9[_0x888b('0x38')]=_0x1cdad9[_0x888b('0x38')][_0x888b('0x39')]?_0x1cdad9[_0x888b('0x38')]:_0x98251b[_0x888b('0x36')];_0x1cdad9[_0x888b('0x50')]=qs[_0x888b('0x3d')](_0xee68bb['query']['sort']);_0x1cdad9[_0x888b('0x3e')]=qs[_0x888b('0x3f')](_['pick'](_0xee68bb['query'],_0x98251b[_0x888b('0x3f')]));if(_0xee68bb['query'][_0x888b('0x41')]){_0x1cdad9['where']=_[_0x888b('0x42')](_0x1cdad9[_0x888b('0x3e')],{'$or':_['map'](_0x1cdad9['attributes'],function(_0x41fd5e){var _0x17ad49={};_0x17ad49[_0x41fd5e]={'$like':'%'+_0xee68bb[_0x888b('0x33')]['filter']+'%'};return _0x17ad49;})});}_0x1cdad9=_[_0x888b('0x42')]({},_0x1cdad9,_0xee68bb[_0x888b('0x44')]);return _0x315005[_0x888b('0x52')](_0x1cdad9);}})['then'](function(_0x4d6325){if(_0x4d6325){_0x4ae3cb=_0x4d6325[_0x888b('0x39')];if(!_0xee68bb[_0x888b('0x33')]['hasOwnProperty'](_0x888b('0x3b'))){_0x1cdad9[_0x888b('0x3c')]=qs[_0x888b('0x3c')](_0xee68bb[_0x888b('0x33')][_0x888b('0x3c')]);_0x1cdad9['offset']=qs[_0x888b('0x1e')](_0xee68bb['query']['offset']);}return _0x315005[_0x888b('0x52')](_0x1cdad9);}})[_0x888b('0x48')](function(_0x262df9){if(_0x262df9){return _0x262df9?{'count':_0x4ae3cb,'rows':_0x262df9}:null;}})[_0x888b('0x48')](respondWithResult(_0xc9617c,null))[_0x888b('0x49')](handleError(_0xc9617c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9c8b589..a3b80bd 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 _0xe796=['moment','bluebird','rimraf','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','../../config/logger','api'];(function(_0xd6a5a5,_0x18b8a1){var _0x2522e7=function(_0x1be84f){while(--_0x1be84f){_0xd6a5a5['push'](_0xd6a5a5['shift']());}};_0x2522e7(++_0x18b8a1);}(_0xe796,0x193));var _0x6e79=function(_0x780e9,_0x292723){_0x780e9=_0x780e9-0x0;var _0x4231f2=_0xe796[_0x780e9];return _0x4231f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e79('0x0'))(_0x6e79('0x1'));var moment=require(_0x6e79('0x2'));var BPromise=require(_0x6e79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e79('0x4'));var config=require('../../config/environment');var attributes=require(_0x6e79('0x5'));module[_0x6e79('0x6')]=function(_0x2ea9b8,_0x34195b){return _0x2ea9b8[_0x6e79('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x6e79('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ef4=['SugarcrmConfiguration','int_sugarcrm_configurations','util','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x6ef4,0x183));var _0x46ef=function(_0x149055,_0x42bd96){_0x149055=_0x149055-0x0;var _0x2862bf=_0x6ef4[_0x149055];return _0x2862bf;};'use strict';var _=require('lodash');var util=require(_0x46ef('0x0'));var logger=require('../../config/logger')(_0x46ef('0x1'));var moment=require('moment');var BPromise=require(_0x46ef('0x2'));var rp=require(_0x46ef('0x3'));var fs=require('fs');var path=require(_0x46ef('0x4'));var rimraf=require('rimraf');var config=require(_0x46ef('0x5'));var attributes=require(_0x46ef('0x6'));module[_0x46ef('0x7')]=function(_0x41667c,_0x5c816c){return _0x41667c[_0x46ef('0x8')](_0x46ef('0x9'),attributes,{'tableName':_0x46ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 3d354bb..6ead309 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 _0xbacc=['then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x160ea3,_0x41194a){var _0xcfa373=function(_0x11cbc1){while(--_0x11cbc1){_0x160ea3['push'](_0x160ea3['shift']());}};_0xcfa373(++_0x41194a);}(_0xbacc,0xfb));var _0xcbac=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xbacc[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xcbac('0x0'));var util=require('util');var moment=require(_0xcbac('0x1'));var BPromise=require(_0xcbac('0x2'));var rs=require(_0xcbac('0x3'));var fs=require('fs');var Redis=require(_0xcbac('0x4'));var db=require(_0xcbac('0x5'))['db'];var utils=require(_0xcbac('0x6'));var logger=require(_0xcbac('0x7'))(_0xcbac('0x8'));var config=require(_0xcbac('0x9'));var jayson=require(_0xcbac('0xa'));var client=jayson[_0xcbac('0xb')][_0xcbac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2aebe7,_0x11edf4,_0x39ef35){return new BPromise(function(_0x42b6e9,_0x5ed246){return client['request'](_0x2aebe7,_0x39ef35)[_0xcbac('0xd')](function(_0x1aabba){logger['info'](_0xcbac('0xe'),_0x11edf4,_0xcbac('0xf'));logger['debug'](_0xcbac('0x10'),_0x11edf4,'request\x20sent',JSON[_0xcbac('0x11')](_0x1aabba));if(_0x1aabba[_0xcbac('0x12')]){if(_0x1aabba[_0xcbac('0x12')][_0xcbac('0x13')]===0x1f4){logger[_0xcbac('0x12')](_0xcbac('0xe'),_0x11edf4,_0x1aabba[_0xcbac('0x12')][_0xcbac('0x14')]);return _0x5ed246(_0x1aabba[_0xcbac('0x12')][_0xcbac('0x14')]);}logger['error'](_0xcbac('0xe'),_0x11edf4,_0x1aabba[_0xcbac('0x12')][_0xcbac('0x14')]);return _0x42b6e9(_0x1aabba['error'][_0xcbac('0x14')]);}else{logger['info'](_0xcbac('0xe'),_0x11edf4,'request\x20sent');_0x42b6e9(_0x1aabba[_0xcbac('0x15')]['message']);}})['catch'](function(_0x118b2f){logger[_0xcbac('0x12')](_0xcbac('0xe'),_0x11edf4,_0x118b2f);_0x5ed246(_0x118b2f);});});} \ No newline at end of file +var _0xb116=['error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xb116,0xb8));var _0x6b11=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xb116[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b11('0x0'));var BPromise=require('bluebird');var rs=require(_0x6b11('0x1'));var fs=require('fs');var Redis=require(_0x6b11('0x2'));var db=require(_0x6b11('0x3'))['db'];var utils=require(_0x6b11('0x4'));var logger=require(_0x6b11('0x5'))(_0x6b11('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b11('0x7'));var client=jayson[_0x6b11('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4016,_0x304318,_0x5c3ad2){return new BPromise(function(_0x4b6b1d,_0x5d88be){return client[_0x6b11('0x9')](_0x3b4016,_0x5c3ad2)[_0x6b11('0xa')](function(_0x30f812){logger[_0x6b11('0xb')](_0x6b11('0xc'),_0x304318,_0x6b11('0xd'));logger[_0x6b11('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x304318,_0x6b11('0xd'),JSON[_0x6b11('0xf')](_0x30f812));if(_0x30f812[_0x6b11('0x10')]){if(_0x30f812['error'][_0x6b11('0x11')]===0x1f4){logger[_0x6b11('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x304318,_0x30f812['error'][_0x6b11('0x12')]);return _0x5d88be(_0x30f812[_0x6b11('0x10')][_0x6b11('0x12')]);}logger[_0x6b11('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x304318,_0x30f812[_0x6b11('0x10')][_0x6b11('0x12')]);return _0x4b6b1d(_0x30f812[_0x6b11('0x10')][_0x6b11('0x12')]);}else{logger[_0x6b11('0xb')](_0x6b11('0xc'),_0x304318,_0x6b11('0xd'));_0x4b6b1d(_0x30f812[_0x6b11('0x13')]['message']);}})['catch'](function(_0x218731){logger[_0x6b11('0x10')](_0x6b11('0xc'),_0x304318,_0x218731);_0x5d88be(_0x218731);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4a97fdc..689ce82 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 _0xac63=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','path'];(function(_0x5a8179,_0x47cc7b){var _0xfdb5b4=function(_0x570fe0){while(--_0x570fe0){_0x5a8179['push'](_0x5a8179['shift']());}};_0xfdb5b4(++_0x47cc7b);}(_0xac63,0x143));var _0x3ac6=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xac63[_0x11a220];return _0x20d8fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3ac6('0x0'));var timeout=require('connect-timeout');var express=require(_0x3ac6('0x1'));var router=express[_0x3ac6('0x2')]();var fs_extra=require(_0x3ac6('0x3'));var auth=require(_0x3ac6('0x4'));var interaction=require(_0x3ac6('0x5'));var config=require(_0x3ac6('0x6'));var controller=require(_0x3ac6('0x7'));router[_0x3ac6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3ac6('0x9')]);router['get'](_0x3ac6('0xa'),auth[_0x3ac6('0xb')](),controller[_0x3ac6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ac6('0xd')]);router[_0x3ac6('0xe')]('/:id',auth[_0x3ac6('0xb')](),controller[_0x3ac6('0xf')]);router['delete'](_0x3ac6('0xa'),auth[_0x3ac6('0xb')](),controller[_0x3ac6('0x10')]);module[_0x3ac6('0x11')]=router; \ No newline at end of file +var _0x7e93=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x4d1890,_0x4eaf9f){var _0x283bfe=function(_0xfbfb59){while(--_0xfbfb59){_0x4d1890['push'](_0x4d1890['shift']());}};_0x283bfe(++_0x4eaf9f);}(_0x7e93,0x163));var _0x37e9=function(_0x103d70,_0x37dcd8){_0x103d70=_0x103d70-0x0;var _0x16c45d=_0x7e93[_0x103d70];return _0x16c45d;};'use strict';var multer=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37e9('0x2'));var interaction=require(_0x37e9('0x3'));var config=require(_0x37e9('0x4'));var controller=require(_0x37e9('0x5'));router['get']('/',auth[_0x37e9('0x6')](),controller[_0x37e9('0x7')]);router[_0x37e9('0x8')]('/:id',auth[_0x37e9('0x6')](),controller[_0x37e9('0x9')]);router['post']('/',auth[_0x37e9('0x6')](),controller[_0x37e9('0xa')]);router[_0x37e9('0xb')](_0x37e9('0xc'),auth[_0x37e9('0x6')](),controller[_0x37e9('0xd')]);router[_0x37e9('0xe')](_0x37e9('0xc'),auth[_0x37e9('0x6')](),controller[_0x37e9('0xf')]);module[_0x37e9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index fc7c490..b96c558 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 _0x7eaa=['BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','STRING'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7eaa,0x89));var _0xa7ea=function(_0x501e82,_0x161199){_0x501e82=_0x501e82-0x0;var _0x2aef5e=_0x7eaa[_0x501e82];return _0x2aef5e;};'use strict';var Sequelize=require(_0xa7ea('0x0'));module[_0xa7ea('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xa7ea('0x2'),_0xa7ea('0x3'),_0xa7ea('0x4'),'picklist'),'defaultValue':_0xa7ea('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa7ea('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xa7ea('0x3'))},'keyContent':{'type':Sequelize[_0xa7ea('0x6')]},'idField':{'type':Sequelize[_0xa7ea('0x6')]},'nameField':{'type':Sequelize[_0xa7ea('0x6')]},'customField':{'type':Sequelize[_0xa7ea('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa7ea('0x6')]}}; \ No newline at end of file +var _0x388b=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x388b,0xaf));var _0xb388=function(_0x16ac31,_0xa6a9a8){_0x16ac31=_0x16ac31-0x0;var _0x44875e=_0x388b[_0x16ac31];return _0x44875e;};'use strict';var Sequelize=require(_0xb388('0x0'));module[_0xb388('0x1')]={'type':{'type':Sequelize[_0xb388('0x2')](_0xb388('0x3'),_0xb388('0x4'),_0xb388('0x5'),_0xb388('0x6'),_0xb388('0x7')),'defaultValue':_0xb388('0x3')},'content':{'type':Sequelize[_0xb388('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb388('0x2')](_0xb388('0x3'),_0xb388('0x4'),_0xb388('0x5'))},'keyContent':{'type':Sequelize[_0xb388('0x8')]},'idField':{'type':Sequelize[_0xb388('0x8')]},'nameField':{'type':Sequelize[_0xb388('0x8')]},'customField':{'type':Sequelize[_0xb388('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb388('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a005787..2d0948f 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 _0x7bdf=['update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','find','create','body'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x7bdf,0x1b7));var _0xf7bd=function(_0x53d73e,_0x5505b0){_0x53d73e=_0x53d73e-0x0;var _0x438306=_0x7bdf[_0x53d73e];return _0x438306;};'use strict';var emlformat=require(_0xf7bd('0x0'));var rimraf=require(_0xf7bd('0x1'));var zipdir=require(_0xf7bd('0x2'));var jsonpatch=require(_0xf7bd('0x3'));var rp=require(_0xf7bd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf7bd('0x5'));var util=require(_0xf7bd('0x6'));var path=require(_0xf7bd('0x7'));var sox=require(_0xf7bd('0x8'));var csv=require(_0xf7bd('0x9'));var ejs=require(_0xf7bd('0xa'));var fs=require('fs');var fs_extra=require(_0xf7bd('0xb'));var _=require(_0xf7bd('0xc'));var squel=require('squel');var crypto=require(_0xf7bd('0xd'));var jsforce=require(_0xf7bd('0xe'));var deskjs=require(_0xf7bd('0xf'));var toCsv=require(_0xf7bd('0x9'));var querystring=require('querystring');var Papa=require(_0xf7bd('0x10'));var Redis=require(_0xf7bd('0x11'));var authService=require(_0xf7bd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf7bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf7bd('0x14'));var utils=require(_0xf7bd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7bd('0x16'))['db'];function respondWithStatusCode(_0x5006fa,_0x1252d9){_0x1252d9=_0x1252d9||0xcc;return function(_0x4c99e0){if(_0x4c99e0){return _0x5006fa[_0xf7bd('0x17')](_0x1252d9);}return _0x5006fa[_0xf7bd('0x18')](_0x1252d9)[_0xf7bd('0x19')]();};}function respondWithResult(_0x26a62b,_0x27d3a6){_0x27d3a6=_0x27d3a6||0xc8;return function(_0x1a6141){if(_0x1a6141){return _0x26a62b[_0xf7bd('0x18')](_0x27d3a6)['json'](_0x1a6141);}};}function respondWithFilteredResult(_0x79b91c,_0x30c290){return function(_0x2b4742){if(_0x2b4742){var _0x131dfa=typeof _0x30c290[_0xf7bd('0x1a')]==='undefined'&&typeof _0x30c290[_0xf7bd('0x1b')]===_0xf7bd('0x1c');var _0x3bde5a=_0x2b4742[_0xf7bd('0x1d')];var _0xeeb668=_0x131dfa?0x0:_0x30c290['offset'];var _0x3082c8=_0x131dfa?_0x2b4742[_0xf7bd('0x1d')]:_0x30c290['offset']+_0x30c290[_0xf7bd('0x1b')];var _0x531257;if(_0x3082c8>=_0x3bde5a){_0x3082c8=_0x3bde5a;_0x531257=0xc8;}else{_0x531257=0xce;}_0x79b91c[_0xf7bd('0x18')](_0x531257);return _0x79b91c[_0xf7bd('0x1e')](_0xf7bd('0x1f'),_0xeeb668+'-'+_0x3082c8+'/'+_0x3bde5a)[_0xf7bd('0x20')](_0x2b4742);}return null;};}function patchUpdates(_0x8a7688){return function(_0x331f59){try{jsonpatch[_0xf7bd('0x21')](_0x331f59,_0x8a7688,!![]);}catch(_0x2486bf){return BPromise[_0xf7bd('0x22')](_0x2486bf);}return _0x331f59['save']();};}function saveUpdates(_0x32f531,_0x2245f7){return function(_0x2fe5d3){if(_0x2fe5d3){return _0x2fe5d3['update'](_0x32f531)['then'](function(_0x13e50d){return _0x13e50d;});}return null;};}function removeEntity(_0xd3740f,_0x2c5eca){return function(_0x3fc26c){if(_0x3fc26c){return _0x3fc26c[_0xf7bd('0x23')]()[_0xf7bd('0x24')](function(){_0xd3740f[_0xf7bd('0x18')](0xcc)[_0xf7bd('0x19')]();});}};}function handleEntityNotFound(_0x6bc0a8,_0x385e4c){return function(_0x32173a){if(!_0x32173a){_0x6bc0a8[_0xf7bd('0x17')](0x194);}return _0x32173a;};}function handleError(_0x27ff6e,_0xeff1d2){_0xeff1d2=_0xeff1d2||0x1f4;return function(_0x375e4f){logger[_0xf7bd('0x25')](_0x375e4f['stack']);if(_0x375e4f[_0xf7bd('0x26')]){delete _0x375e4f[_0xf7bd('0x26')];}_0x27ff6e[_0xf7bd('0x18')](_0xeff1d2)[_0xf7bd('0x27')](_0x375e4f);};}exports[_0xf7bd('0x28')]=function(_0x959424,_0x515e13){var _0x5afc88={},_0x2369f4={},_0x871347={'count':0x0,'rows':[]};var _0x56434d=_[_0xf7bd('0x29')](db[_0xf7bd('0x2a')][_0xf7bd('0x2b')],function(_0x277080){return{'name':_0x277080[_0xf7bd('0x2c')],'type':_0x277080[_0xf7bd('0x2d')][_0xf7bd('0x2e')]};});_0x2369f4['model']=_[_0xf7bd('0x29')](_0x56434d,_0xf7bd('0x26'));_0x2369f4['query']=_[_0xf7bd('0x2f')](_0x959424[_0xf7bd('0x30')]);_0x2369f4[_0xf7bd('0x31')]=_[_0xf7bd('0x32')](_0x2369f4[_0xf7bd('0x33')],_0x2369f4['query']);_0x5afc88[_0xf7bd('0x34')]=_[_0xf7bd('0x32')](_0x2369f4['model'],qs['fields'](_0x959424[_0xf7bd('0x30')][_0xf7bd('0x35')]));_0x5afc88[_0xf7bd('0x34')]=_0x5afc88['attributes'][_0xf7bd('0x36')]?_0x5afc88[_0xf7bd('0x34')]:_0x2369f4['model'];if(!_0x959424[_0xf7bd('0x30')][_0xf7bd('0x37')]('nolimit')){_0x5afc88[_0xf7bd('0x1b')]=qs['limit'](_0x959424[_0xf7bd('0x30')][_0xf7bd('0x1b')]);_0x5afc88['offset']=qs[_0xf7bd('0x1a')](_0x959424[_0xf7bd('0x30')][_0xf7bd('0x1a')]);}_0x5afc88[_0xf7bd('0x38')]=qs[_0xf7bd('0x39')](_0x959424['query'][_0xf7bd('0x39')]);_0x5afc88[_0xf7bd('0x3a')]=qs[_0xf7bd('0x31')](_[_0xf7bd('0x3b')](_0x959424[_0xf7bd('0x30')],_0x2369f4[_0xf7bd('0x31')]),_0x56434d);if(_0x959424[_0xf7bd('0x30')][_0xf7bd('0x3c')]){_0x5afc88[_0xf7bd('0x3a')]=_['merge'](_0x5afc88[_0xf7bd('0x3a')],{'$or':_[_0xf7bd('0x29')](_0x56434d,function(_0x2fc2a1){if(_0x2fc2a1['type']!==_0xf7bd('0x3d')){var _0x393889={};_0x393889[_0x2fc2a1[_0xf7bd('0x26')]]={'$like':'%'+_0x959424[_0xf7bd('0x30')][_0xf7bd('0x3c')]+'%'};return _0x393889;}})});}_0x5afc88=_['merge']({},_0x5afc88,_0x959424[_0xf7bd('0x3e')]);var _0x1a93a6={'where':_0x5afc88[_0xf7bd('0x3a')]};return db[_0xf7bd('0x2a')][_0xf7bd('0x1d')](_0x1a93a6)['then'](function(_0x43be14){_0x871347[_0xf7bd('0x1d')]=_0x43be14;if(_0x959424[_0xf7bd('0x30')][_0xf7bd('0x3f')]){_0x5afc88[_0xf7bd('0x40')]=[{'all':!![]}];}return db[_0xf7bd('0x2a')][_0xf7bd('0x41')](_0x5afc88);})[_0xf7bd('0x24')](function(_0x46c326){_0x871347['rows']=_0x46c326;return _0x871347;})[_0xf7bd('0x24')](respondWithFilteredResult(_0x515e13,_0x5afc88))[_0xf7bd('0x42')](handleError(_0x515e13,null));};exports['show']=function(_0x2ba851,_0x4d1f1b){var _0x3ab49d={'raw':!![],'where':{'id':_0x2ba851[_0xf7bd('0x43')]['id']}},_0x2c94a9={};_0x2c94a9[_0xf7bd('0x33')]=_[_0xf7bd('0x2f')](db[_0xf7bd('0x2a')][_0xf7bd('0x2b')]);_0x2c94a9[_0xf7bd('0x30')]=_[_0xf7bd('0x2f')](_0x2ba851['query']);_0x2c94a9[_0xf7bd('0x31')]=_[_0xf7bd('0x32')](_0x2c94a9[_0xf7bd('0x33')],_0x2c94a9[_0xf7bd('0x30')]);_0x3ab49d['attributes']=_['intersection'](_0x2c94a9[_0xf7bd('0x33')],qs[_0xf7bd('0x35')](_0x2ba851[_0xf7bd('0x30')][_0xf7bd('0x35')]));_0x3ab49d[_0xf7bd('0x34')]=_0x3ab49d[_0xf7bd('0x34')]['length']?_0x3ab49d[_0xf7bd('0x34')]:_0x2c94a9['model'];if(_0x2ba851[_0xf7bd('0x30')][_0xf7bd('0x3f')]){_0x3ab49d[_0xf7bd('0x40')]=[{'all':!![]}];}_0x3ab49d=_[_0xf7bd('0x44')]({},_0x3ab49d,_0x2ba851[_0xf7bd('0x3e')]);return db[_0xf7bd('0x2a')][_0xf7bd('0x45')](_0x3ab49d)[_0xf7bd('0x24')](handleEntityNotFound(_0x4d1f1b,null))[_0xf7bd('0x24')](respondWithResult(_0x4d1f1b,null))['catch'](handleError(_0x4d1f1b,null));};exports[_0xf7bd('0x46')]=function(_0x71025e,_0x52f935){return db[_0xf7bd('0x2a')]['create'](_0x71025e[_0xf7bd('0x47')],{})['then'](respondWithResult(_0x52f935,0xc9))[_0xf7bd('0x42')](handleError(_0x52f935,null));};exports[_0xf7bd('0x48')]=function(_0x16705e,_0x2af67a){if(_0x16705e[_0xf7bd('0x47')]['id']){delete _0x16705e[_0xf7bd('0x47')]['id'];}return db[_0xf7bd('0x2a')][_0xf7bd('0x45')]({'where':{'id':_0x16705e[_0xf7bd('0x43')]['id']}})['then'](handleEntityNotFound(_0x2af67a,null))[_0xf7bd('0x24')](saveUpdates(_0x16705e[_0xf7bd('0x47')],null))[_0xf7bd('0x24')](respondWithResult(_0x2af67a,null))['catch'](handleError(_0x2af67a,null));};exports['destroy']=function(_0x329b91,_0x442114){return db[_0xf7bd('0x2a')][_0xf7bd('0x45')]({'where':{'id':_0x329b91['params']['id']}})[_0xf7bd('0x24')](handleEntityNotFound(_0x442114,null))[_0xf7bd('0x24')](removeEntity(_0x442114,null))['catch'](handleError(_0x442114,null));}; \ No newline at end of file +var _0x6748=['save','update','then','destroy','error','name','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject'];(function(_0x281ad6,_0x4e02f8){var _0x73f177=function(_0x2f29cd){while(--_0x2f29cd){_0x281ad6['push'](_0x281ad6['shift']());}};_0x73f177(++_0x4e02f8);}(_0x6748,0x1ef));var _0x8674=function(_0x142b72,_0x58eb3d){_0x142b72=_0x142b72-0x0;var _0x5084e3=_0x6748[_0x142b72];return _0x5084e3;};'use strict';var emlformat=require(_0x8674('0x0'));var rimraf=require(_0x8674('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8674('0x2'));var rp=require(_0x8674('0x3'));var moment=require(_0x8674('0x4'));var BPromise=require(_0x8674('0x5'));var Mustache=require(_0x8674('0x6'));var util=require(_0x8674('0x7'));var path=require(_0x8674('0x8'));var sox=require(_0x8674('0x9'));var csv=require('to-csv');var ejs=require(_0x8674('0xa'));var fs=require('fs');var fs_extra=require(_0x8674('0xb'));var _=require(_0x8674('0xc'));var squel=require(_0x8674('0xd'));var crypto=require(_0x8674('0xe'));var jsforce=require(_0x8674('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8674('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8674('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8674('0x12'));var hardwareService=require(_0x8674('0x13'));var logger=require(_0x8674('0x14'))('api');var utils=require(_0x8674('0x15'));var config=require(_0x8674('0x16'));var licenseUtil=require(_0x8674('0x17'));var db=require(_0x8674('0x18'))['db'];function respondWithStatusCode(_0x550831,_0x15267a){_0x15267a=_0x15267a||0xcc;return function(_0xf51b48){if(_0xf51b48){return _0x550831[_0x8674('0x19')](_0x15267a);}return _0x550831['status'](_0x15267a)[_0x8674('0x1a')]();};}function respondWithResult(_0x535a35,_0x28e310){_0x28e310=_0x28e310||0xc8;return function(_0x1a90bf){if(_0x1a90bf){return _0x535a35[_0x8674('0x1b')](_0x28e310)['json'](_0x1a90bf);}};}function respondWithFilteredResult(_0x468647,_0x150bf6){return function(_0x567373){if(_0x567373){var _0x5db851=typeof _0x150bf6['offset']===_0x8674('0x1c')&&typeof _0x150bf6[_0x8674('0x1d')]===_0x8674('0x1c');var _0x1280de=_0x567373['count'];var _0x29530f=_0x5db851?0x0:_0x150bf6[_0x8674('0x1e')];var _0x17ec66=_0x5db851?_0x567373[_0x8674('0x1f')]:_0x150bf6['offset']+_0x150bf6[_0x8674('0x1d')];var _0x28d288;if(_0x17ec66>=_0x1280de){_0x17ec66=_0x1280de;_0x28d288=0xc8;}else{_0x28d288=0xce;}_0x468647[_0x8674('0x1b')](_0x28d288);return _0x468647[_0x8674('0x20')](_0x8674('0x21'),_0x29530f+'-'+_0x17ec66+'/'+_0x1280de)[_0x8674('0x22')](_0x567373);}return null;};}function patchUpdates(_0x5b54b3){return function(_0x16eb74){try{jsonpatch[_0x8674('0x23')](_0x16eb74,_0x5b54b3,!![]);}catch(_0x3b8cae){return BPromise[_0x8674('0x24')](_0x3b8cae);}return _0x16eb74[_0x8674('0x25')]();};}function saveUpdates(_0x1713eb,_0x3ae195){return function(_0x5dd6a0){if(_0x5dd6a0){return _0x5dd6a0[_0x8674('0x26')](_0x1713eb)[_0x8674('0x27')](function(_0x53f132){return _0x53f132;});}return null;};}function removeEntity(_0x1895c3,_0x2e9678){return function(_0x2c1812){if(_0x2c1812){return _0x2c1812[_0x8674('0x28')]()[_0x8674('0x27')](function(){_0x1895c3['status'](0xcc)[_0x8674('0x1a')]();});}};}function handleEntityNotFound(_0x497440,_0x4e8dc8){return function(_0x408e65){if(!_0x408e65){_0x497440[_0x8674('0x19')](0x194);}return _0x408e65;};}function handleError(_0x2bfec0,_0x138671){_0x138671=_0x138671||0x1f4;return function(_0x3041e9){logger[_0x8674('0x29')](_0x3041e9['stack']);if(_0x3041e9[_0x8674('0x2a')]){delete _0x3041e9[_0x8674('0x2a')];}_0x2bfec0['status'](_0x138671)['send'](_0x3041e9);};}exports[_0x8674('0x2b')]=function(_0xa219e,_0x120c35){var _0x2245ee={},_0x22888c={},_0x3180dc={'count':0x0,'rows':[]};var _0x1d3ee6=_['map'](db[_0x8674('0x2c')][_0x8674('0x2d')],function(_0x346583){return{'name':_0x346583[_0x8674('0x2e')],'type':_0x346583[_0x8674('0x2f')][_0x8674('0x30')]};});_0x22888c[_0x8674('0x31')]=_[_0x8674('0x32')](_0x1d3ee6,_0x8674('0x2a'));_0x22888c[_0x8674('0x33')]=_[_0x8674('0x34')](_0xa219e[_0x8674('0x33')]);_0x22888c[_0x8674('0x35')]=_[_0x8674('0x36')](_0x22888c[_0x8674('0x31')],_0x22888c['query']);_0x2245ee[_0x8674('0x37')]=_[_0x8674('0x36')](_0x22888c[_0x8674('0x31')],qs['fields'](_0xa219e[_0x8674('0x33')][_0x8674('0x38')]));_0x2245ee[_0x8674('0x37')]=_0x2245ee['attributes'][_0x8674('0x39')]?_0x2245ee[_0x8674('0x37')]:_0x22888c[_0x8674('0x31')];if(!_0xa219e[_0x8674('0x33')][_0x8674('0x3a')](_0x8674('0x3b'))){_0x2245ee['limit']=qs[_0x8674('0x1d')](_0xa219e[_0x8674('0x33')][_0x8674('0x1d')]);_0x2245ee[_0x8674('0x1e')]=qs[_0x8674('0x1e')](_0xa219e[_0x8674('0x33')][_0x8674('0x1e')]);}_0x2245ee[_0x8674('0x3c')]=qs[_0x8674('0x3d')](_0xa219e[_0x8674('0x33')][_0x8674('0x3d')]);_0x2245ee[_0x8674('0x3e')]=qs[_0x8674('0x35')](_[_0x8674('0x3f')](_0xa219e['query'],_0x22888c['filters']),_0x1d3ee6);if(_0xa219e['query'][_0x8674('0x40')]){_0x2245ee[_0x8674('0x3e')]=_[_0x8674('0x41')](_0x2245ee[_0x8674('0x3e')],{'$or':_[_0x8674('0x32')](_0x1d3ee6,function(_0x51464f){if(_0x51464f[_0x8674('0x2f')]!==_0x8674('0x42')){var _0x26da92={};_0x26da92[_0x51464f[_0x8674('0x2a')]]={'$like':'%'+_0xa219e[_0x8674('0x33')]['filter']+'%'};return _0x26da92;}})});}_0x2245ee=_['merge']({},_0x2245ee,_0xa219e[_0x8674('0x43')]);var _0x14d8b7={'where':_0x2245ee[_0x8674('0x3e')]};return db[_0x8674('0x2c')][_0x8674('0x1f')](_0x14d8b7)[_0x8674('0x27')](function(_0x2a2741){_0x3180dc['count']=_0x2a2741;if(_0xa219e[_0x8674('0x33')][_0x8674('0x44')]){_0x2245ee[_0x8674('0x45')]=[{'all':!![]}];}return db['SugarcrmField'][_0x8674('0x46')](_0x2245ee);})['then'](function(_0x2652ce){_0x3180dc[_0x8674('0x47')]=_0x2652ce;return _0x3180dc;})[_0x8674('0x27')](respondWithFilteredResult(_0x120c35,_0x2245ee))['catch'](handleError(_0x120c35,null));};exports['show']=function(_0x343e16,_0x302335){var _0x144d04={'raw':!![],'where':{'id':_0x343e16[_0x8674('0x48')]['id']}},_0x7bc88c={};_0x7bc88c['model']=_['keys'](db[_0x8674('0x2c')]['rawAttributes']);_0x7bc88c['query']=_[_0x8674('0x34')](_0x343e16[_0x8674('0x33')]);_0x7bc88c['filters']=_['intersection'](_0x7bc88c['model'],_0x7bc88c['query']);_0x144d04['attributes']=_[_0x8674('0x36')](_0x7bc88c[_0x8674('0x31')],qs[_0x8674('0x38')](_0x343e16[_0x8674('0x33')]['fields']));_0x144d04['attributes']=_0x144d04[_0x8674('0x37')][_0x8674('0x39')]?_0x144d04[_0x8674('0x37')]:_0x7bc88c[_0x8674('0x31')];if(_0x343e16[_0x8674('0x33')][_0x8674('0x44')]){_0x144d04[_0x8674('0x45')]=[{'all':!![]}];}_0x144d04=_['merge']({},_0x144d04,_0x343e16[_0x8674('0x43')]);return db[_0x8674('0x2c')]['find'](_0x144d04)[_0x8674('0x27')](handleEntityNotFound(_0x302335,null))[_0x8674('0x27')](respondWithResult(_0x302335,null))[_0x8674('0x49')](handleError(_0x302335,null));};exports[_0x8674('0x4a')]=function(_0x38bfa0,_0xffd9a0){return db['SugarcrmField']['create'](_0x38bfa0[_0x8674('0x4b')],{})[_0x8674('0x27')](respondWithResult(_0xffd9a0,0xc9))[_0x8674('0x49')](handleError(_0xffd9a0,null));};exports[_0x8674('0x26')]=function(_0x5c3f75,_0x36a4fc){if(_0x5c3f75[_0x8674('0x4b')]['id']){delete _0x5c3f75['body']['id'];}return db[_0x8674('0x2c')]['find']({'where':{'id':_0x5c3f75['params']['id']}})[_0x8674('0x27')](handleEntityNotFound(_0x36a4fc,null))['then'](saveUpdates(_0x5c3f75[_0x8674('0x4b')],null))['then'](respondWithResult(_0x36a4fc,null))[_0x8674('0x49')](handleError(_0x36a4fc,null));};exports['destroy']=function(_0x54ed13,_0x539ee5){return db[_0x8674('0x2c')]['find']({'where':{'id':_0x54ed13[_0x8674('0x48')]['id']}})[_0x8674('0x27')](handleEntityNotFound(_0x539ee5,null))[_0x8674('0x27')](removeEntity(_0x539ee5,null))['catch'](handleError(_0x539ee5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c7a7726..e1da2c3 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 _0x8be7=['bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x40a27e,_0x20f5a4){var _0x597d50=function(_0x74101c){while(--_0x74101c){_0x40a27e['push'](_0x40a27e['shift']());}};_0x597d50(++_0x20f5a4);}(_0x8be7,0x1db));var _0x78be=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x8be7[_0xe24fc0];return _0x185c6b;};'use strict';var _=require(_0x78be('0x0'));var util=require(_0x78be('0x1'));var logger=require(_0x78be('0x2'))(_0x78be('0x3'));var moment=require(_0x78be('0x4'));var BPromise=require(_0x78be('0x5'));var rp=require(_0x78be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x78be('0x7'));var attributes=require(_0x78be('0x8'));module[_0x78be('0x9')]=function(_0x4f9430,_0x54287f){return _0x4f9430[_0x78be('0xa')](_0x78be('0xb'),attributes,{'tableName':_0x78be('0xc'),'paranoid':![],'indexes':[{'name':_0x78be('0xd'),'fields':[_0x78be('0xe'),_0x78be('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87ce=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','sugarcrm_unique_index','util','../../config/logger'];(function(_0x548afc,_0x1b4078){var _0x559f41=function(_0x259568){while(--_0x259568){_0x548afc['push'](_0x548afc['shift']());}};_0x559f41(++_0x1b4078);}(_0x87ce,0x177));var _0xe87c=function(_0x2a1cc5,_0x441166){_0x2a1cc5=_0x2a1cc5-0x0;var _0x583ee4=_0x87ce[_0x2a1cc5];return _0x583ee4;};'use strict';var _=require('lodash');var util=require(_0xe87c('0x0'));var logger=require(_0xe87c('0x1'))(_0xe87c('0x2'));var moment=require(_0xe87c('0x3'));var BPromise=require(_0xe87c('0x4'));var rp=require(_0xe87c('0x5'));var fs=require('fs');var path=require(_0xe87c('0x6'));var rimraf=require(_0xe87c('0x7'));var config=require(_0xe87c('0x8'));var attributes=require(_0xe87c('0x9'));module['exports']=function(_0x114388,_0x4440c5){return _0x114388[_0xe87c('0xa')](_0xe87c('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xe87c('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 6f548e9..75daf1b 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 _0x8490=['then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x2a99f1,_0x198fd7){var _0x6948e5=function(_0x2ae413){while(--_0x2ae413){_0x2a99f1['push'](_0x2a99f1['shift']());}};_0x6948e5(++_0x198fd7);}(_0x8490,0x13e));var _0x0849=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x8490[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x0849('0x0'));var util=require(_0x0849('0x1'));var moment=require('moment');var BPromise=require(_0x0849('0x2'));var rs=require(_0x0849('0x3'));var fs=require('fs');var Redis=require(_0x0849('0x4'));var db=require(_0x0849('0x5'))['db'];var utils=require(_0x0849('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0849('0x7'));var jayson=require(_0x0849('0x8'));var client=jayson[_0x0849('0x9')][_0x0849('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x154943,_0x2dbaf6,_0x934bad){return new BPromise(function(_0x51e74e,_0x25bc4f){return client[_0x0849('0xb')](_0x154943,_0x934bad)[_0x0849('0xc')](function(_0xbc74a0){logger[_0x0849('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x2dbaf6,_0x0849('0xe'));logger[_0x0849('0xf')](_0x0849('0x10'),_0x2dbaf6,'request\x20sent',JSON['stringify'](_0xbc74a0));if(_0xbc74a0[_0x0849('0x11')]){if(_0xbc74a0[_0x0849('0x11')][_0x0849('0x12')]===0x1f4){logger[_0x0849('0x11')](_0x0849('0x13'),_0x2dbaf6,_0xbc74a0[_0x0849('0x11')][_0x0849('0x14')]);return _0x25bc4f(_0xbc74a0[_0x0849('0x11')][_0x0849('0x14')]);}logger[_0x0849('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x2dbaf6,_0xbc74a0[_0x0849('0x11')][_0x0849('0x14')]);return _0x51e74e(_0xbc74a0[_0x0849('0x11')][_0x0849('0x14')]);}else{logger[_0x0849('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x2dbaf6,_0x0849('0xe'));_0x51e74e(_0xbc74a0['result'][_0x0849('0x14')]);}})[_0x0849('0x15')](function(_0x1e0ada){logger[_0x0849('0x11')](_0x0849('0x13'),_0x2dbaf6,_0x1e0ada);_0x25bc4f(_0x1e0ada);});});} \ No newline at end of file +var _0x4419=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x46b2f3,_0x13da6){var _0x27219d=function(_0x1da5fa){while(--_0x1da5fa){_0x46b2f3['push'](_0x46b2f3['shift']());}};_0x27219d(++_0x13da6);}(_0x4419,0x10e));var _0x9441=function(_0xb5eda7,_0x50dbc1){_0xb5eda7=_0xb5eda7-0x0;var _0x1ad126=_0x4419[_0xb5eda7];return _0x1ad126;};'use strict';var _=require(_0x9441('0x0'));var util=require('util');var moment=require(_0x9441('0x1'));var BPromise=require(_0x9441('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9441('0x3'))['db'];var utils=require(_0x9441('0x4'));var logger=require('../../config/logger')(_0x9441('0x5'));var config=require(_0x9441('0x6'));var jayson=require(_0x9441('0x7'));var client=jayson[_0x9441('0x8')][_0x9441('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40bee2,_0x2face7,_0x5cf324){return new BPromise(function(_0x548028,_0x5b8162){return client[_0x9441('0xa')](_0x40bee2,_0x5cf324)[_0x9441('0xb')](function(_0x267dab){logger[_0x9441('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x2face7,_0x9441('0xd'));logger[_0x9441('0xe')](_0x9441('0xf'),_0x2face7,_0x9441('0xd'),JSON[_0x9441('0x10')](_0x267dab));if(_0x267dab['error']){if(_0x267dab[_0x9441('0x11')][_0x9441('0x12')]===0x1f4){logger['error'](_0x9441('0x13'),_0x2face7,_0x267dab['error']['message']);return _0x5b8162(_0x267dab[_0x9441('0x11')][_0x9441('0x14')]);}logger[_0x9441('0x11')](_0x9441('0x13'),_0x2face7,_0x267dab[_0x9441('0x11')][_0x9441('0x14')]);return _0x548028(_0x267dab[_0x9441('0x11')][_0x9441('0x14')]);}else{logger['info'](_0x9441('0x13'),_0x2face7,'request\x20sent');_0x548028(_0x267dab[_0x9441('0x15')][_0x9441('0x14')]);}})[_0x9441('0x16')](function(_0x58e58a){logger[_0x9441('0x11')](_0x9441('0x13'),_0x2face7,_0x58e58a);_0x5b8162(_0x58e58a);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 4ff260a..d5b6729 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 _0x782e=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','/:id','destroy','path','connect-timeout','Router','fs-extra'];(function(_0x8aa686,_0x3c7b74){var _0x5d73f7=function(_0x418a3e){while(--_0x418a3e){_0x8aa686['push'](_0x8aa686['shift']());}};_0x5d73f7(++_0x3c7b74);}(_0x782e,0xb9));var _0xe782=function(_0x56b943,_0x66c5e7){_0x56b943=_0x56b943-0x0;var _0x300c0b=_0x782e[_0x56b943];return _0x300c0b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe782('0x0'));var timeout=require(_0xe782('0x1'));var express=require('express');var router=express[_0xe782('0x2')]();var fs_extra=require(_0xe782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var controller=require(_0xe782('0x6'));router[_0xe782('0x7')]('/',auth['isAuthenticated'](),controller[_0xe782('0x8')]);router['get']('/:id',auth[_0xe782('0x9')](),controller['show']);router[_0xe782('0x7')](_0xe782('0xa'),auth[_0xe782('0x9')](),controller[_0xe782('0xb')]);router[_0xe782('0x7')](_0xe782('0xc'),auth[_0xe782('0x9')](),controller[_0xe782('0xd')]);router[_0xe782('0xe')]('/',auth[_0xe782('0x9')](),controller[_0xe782('0xf')]);router[_0xe782('0xe')](_0xe782('0xa'),auth[_0xe782('0x9')](),controller['addConfiguration']);router[_0xe782('0x10')]('/:id',auth[_0xe782('0x9')](),controller[_0xe782('0x11')]);router[_0xe782('0x12')](_0xe782('0x13'),auth[_0xe782('0x9')](),controller[_0xe782('0x14')]);module['exports']=router; \ No newline at end of file +var _0x13c0=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x40afba,_0x5dbc39){var _0x3ceb3e=function(_0x55cfb3){while(--_0x55cfb3){_0x40afba['push'](_0x40afba['shift']());}};_0x3ceb3e(++_0x5dbc39);}(_0x13c0,0x79));var _0x013c=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x13c0[_0xbd77c1];return _0x47fa83;};'use strict';var multer=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var path=require(_0x013c('0x2'));var timeout=require(_0x013c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x013c('0x4'));var interaction=require(_0x013c('0x5'));var config=require(_0x013c('0x6'));var controller=require(_0x013c('0x7'));router[_0x013c('0x8')]('/',auth[_0x013c('0x9')](),controller[_0x013c('0xa')]);router[_0x013c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x013c('0x8')](_0x013c('0xb'),auth['isAuthenticated'](),controller[_0x013c('0xc')]);router[_0x013c('0x8')](_0x013c('0xd'),auth[_0x013c('0x9')](),controller[_0x013c('0xe')]);router[_0x013c('0xf')]('/',auth[_0x013c('0x9')](),controller[_0x013c('0x10')]);router[_0x013c('0xf')](_0x013c('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x013c('0x11')](_0x013c('0x12'),auth[_0x013c('0x9')](),controller[_0x013c('0x13')]);router['delete'](_0x013c('0x12'),auth[_0x013c('0x9')](),controller[_0x013c('0x14')]);module[_0x013c('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 afdd786..6a0d428 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 _0x7cd7=['sequelize','exports','STRING'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x7cd7,0x1da));var _0x77cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cd7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x77cd('0x0'));module[_0x77cd('0x1')]={'name':{'type':Sequelize[_0x77cd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x77cd('0x2')]},'username':{'type':Sequelize[_0x77cd('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x77cd('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x77cd('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xe2ff=['exports','STRING','HelpDesk'];(function(_0x323cd8,_0x5672be){var _0x1d3e5b=function(_0x4c3db7){while(--_0x4c3db7){_0x323cd8['push'](_0x323cd8['shift']());}};_0x1d3e5b(++_0x5672be);}(_0xe2ff,0x93));var _0xfe2f=function(_0x4267f4,_0x138cd4){_0x4267f4=_0x4267f4-0x0;var _0x33c275=_0xe2ff[_0x4267f4];return _0x33c275;};'use strict';var Sequelize=require('sequelize');module[_0xfe2f('0x0')]={'name':{'type':Sequelize[_0xfe2f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfe2f('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfe2f('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index d1439a6..aae3c30 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 _0xd533=['keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','VtigerAccount','then','count','includeAll','include','rows','catch','show','params','merge','options','find','create','body','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','getDescriptions','type','VtigerConfiguration','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','slice','substring','format','%s/webservice.php','GET','getchallenge','success','login','result','sessionName','autogenerated','reference','owner','remove','editable','false','startsWith','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model'];(function(_0x2c41f9,_0x550191){var _0x5f3d76=function(_0x19ff0c){while(--_0x19ff0c){_0x2c41f9['push'](_0x2c41f9['shift']());}};_0x5f3d76(++_0x550191);}(_0xd533,0xbb));var _0x3d53=function(_0x4eecad,_0x4f7efa){_0x4eecad=_0x4eecad-0x0;var _0x16b315=_0xd533[_0x4eecad];return _0x16b315;};'use strict';var emlformat=require(_0x3d53('0x0'));var rimraf=require(_0x3d53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d53('0x2'));var rp=require(_0x3d53('0x3'));var moment=require(_0x3d53('0x4'));var BPromise=require(_0x3d53('0x5'));var Mustache=require('mustache');var util=require(_0x3d53('0x6'));var path=require(_0x3d53('0x7'));var sox=require(_0x3d53('0x8'));var csv=require(_0x3d53('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d53('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d53('0xb'));var deskjs=require(_0x3d53('0xc'));var toCsv=require(_0x3d53('0x9'));var querystring=require(_0x3d53('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d53('0xe'));var as=require(_0x3d53('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d53('0x10'))(_0x3d53('0x11'));var utils=require(_0x3d53('0x12'));var config=require(_0x3d53('0x13'));var licenseUtil=require(_0x3d53('0x14'));var db=require(_0x3d53('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4eeba0,_0x44f56b){_0x44f56b=_0x44f56b||0xcc;return function(_0x431603){if(_0x431603){return _0x4eeba0['sendStatus'](_0x44f56b);}return _0x4eeba0['status'](_0x44f56b)[_0x3d53('0x16')]();};}function respondWithResult(_0x2e16d5,_0xabde1f){_0xabde1f=_0xabde1f||0xc8;return function(_0x433784){if(_0x433784){return _0x2e16d5[_0x3d53('0x17')](_0xabde1f)[_0x3d53('0x18')](_0x433784);}};}function respondWithFilteredResult(_0x106770,_0x4e063a){return function(_0xc98e65){if(_0xc98e65){var _0x4e892a=typeof _0x4e063a['offset']===_0x3d53('0x19')&&typeof _0x4e063a[_0x3d53('0x1a')]===_0x3d53('0x19');var _0x5c9d77=_0xc98e65['count'];var _0x115350=_0x4e892a?0x0:_0x4e063a['offset'];var _0xde5c3a=_0x4e892a?_0xc98e65['count']:_0x4e063a[_0x3d53('0x1b')]+_0x4e063a['limit'];var _0x3a2c83;if(_0xde5c3a>=_0x5c9d77){_0xde5c3a=_0x5c9d77;_0x3a2c83=0xc8;}else{_0x3a2c83=0xce;}_0x106770[_0x3d53('0x17')](_0x3a2c83);return _0x106770[_0x3d53('0x1c')](_0x3d53('0x1d'),_0x115350+'-'+_0xde5c3a+'/'+_0x5c9d77)[_0x3d53('0x18')](_0xc98e65);}return null;};}function patchUpdates(_0x6d74db){return function(_0x2f891e){try{jsonpatch[_0x3d53('0x1e')](_0x2f891e,_0x6d74db,!![]);}catch(_0x383e63){return BPromise[_0x3d53('0x1f')](_0x383e63);}return _0x2f891e[_0x3d53('0x20')]();};}function saveUpdates(_0x3c1036,_0x7fbc25){return function(_0x5e93ae){if(_0x5e93ae){return _0x5e93ae[_0x3d53('0x21')](_0x3c1036)['then'](function(_0x5487fd){return _0x5487fd;});}return null;};}function removeEntity(_0x5d9241,_0x472b7a){return function(_0x43b3d1){if(_0x43b3d1){return _0x43b3d1[_0x3d53('0x22')]()['then'](function(){_0x5d9241[_0x3d53('0x17')](0xcc)[_0x3d53('0x16')]();});}};}function handleEntityNotFound(_0xf4b01,_0x46bb6b){return function(_0x367601){if(!_0x367601){_0xf4b01[_0x3d53('0x23')](0x194);}return _0x367601;};}function handleError(_0x4a4528,_0x545a0c){_0x545a0c=_0x545a0c||0x1f4;return function(_0x112679){logger[_0x3d53('0x24')](_0x112679[_0x3d53('0x25')]);if(_0x112679[_0x3d53('0x26')]){delete _0x112679[_0x3d53('0x26')];}_0x4a4528[_0x3d53('0x17')](_0x545a0c)[_0x3d53('0x27')](_0x112679);};}exports['index']=function(_0x59071a,_0x7f6fe9){var _0x712340={},_0x17a38d={},_0x4c9e57={'count':0x0,'rows':[]};var _0x47ca99=_[_0x3d53('0x28')](db['VtigerAccount'][_0x3d53('0x29')],function(_0x5c21c9){return{'name':_0x5c21c9[_0x3d53('0x2a')],'type':_0x5c21c9['type'][_0x3d53('0x2b')]};});_0x17a38d[_0x3d53('0x2c')]=_[_0x3d53('0x28')](_0x47ca99,'name');_0x17a38d['query']=_[_0x3d53('0x2d')](_0x59071a[_0x3d53('0x2e')]);_0x17a38d[_0x3d53('0x2f')]=_[_0x3d53('0x30')](_0x17a38d[_0x3d53('0x2c')],_0x17a38d[_0x3d53('0x2e')]);_0x712340[_0x3d53('0x31')]=_[_0x3d53('0x30')](_0x17a38d['model'],qs['fields'](_0x59071a['query'][_0x3d53('0x32')]));_0x712340[_0x3d53('0x31')]=_0x712340[_0x3d53('0x31')][_0x3d53('0x33')]?_0x712340[_0x3d53('0x31')]:_0x17a38d['model'];if(!_0x59071a[_0x3d53('0x2e')]['hasOwnProperty'](_0x3d53('0x34'))){_0x712340['limit']=qs[_0x3d53('0x1a')](_0x59071a[_0x3d53('0x2e')][_0x3d53('0x1a')]);_0x712340[_0x3d53('0x1b')]=qs['offset'](_0x59071a[_0x3d53('0x2e')][_0x3d53('0x1b')]);}_0x712340['order']=qs['sort'](_0x59071a[_0x3d53('0x2e')][_0x3d53('0x35')]);_0x712340['where']=qs['filters'](_[_0x3d53('0x36')](_0x59071a['query'],_0x17a38d[_0x3d53('0x2f')]),_0x47ca99);if(_0x59071a['query'][_0x3d53('0x37')]){_0x712340[_0x3d53('0x38')]=_['merge'](_0x712340[_0x3d53('0x38')],{'$or':_[_0x3d53('0x28')](_0x47ca99,function(_0x477b2d){if(_0x477b2d['type']!==_0x3d53('0x39')){var _0x3a363d={};_0x3a363d[_0x477b2d[_0x3d53('0x26')]]={'$like':'%'+_0x59071a['query']['filter']+'%'};return _0x3a363d;}})});}_0x712340=_['merge']({},_0x712340,_0x59071a['options']);var _0x4b02c4={'where':_0x712340[_0x3d53('0x38')]};return db[_0x3d53('0x3a')]['count'](_0x4b02c4)[_0x3d53('0x3b')](function(_0x1d8d99){_0x4c9e57[_0x3d53('0x3c')]=_0x1d8d99;if(_0x59071a[_0x3d53('0x2e')][_0x3d53('0x3d')]){_0x712340[_0x3d53('0x3e')]=[{'all':!![]}];}return db[_0x3d53('0x3a')]['findAll'](_0x712340);})['then'](function(_0x174d67){_0x4c9e57[_0x3d53('0x3f')]=_0x174d67;return _0x4c9e57;})[_0x3d53('0x3b')](respondWithFilteredResult(_0x7f6fe9,_0x712340))[_0x3d53('0x40')](handleError(_0x7f6fe9,null));};exports[_0x3d53('0x41')]=function(_0x506043,_0x1d9e67){var _0x4effaa={'raw':![],'where':{'id':_0x506043[_0x3d53('0x42')]['id']}},_0x27dd9b={};_0x27dd9b[_0x3d53('0x2c')]=_['keys'](db[_0x3d53('0x3a')]['rawAttributes']);_0x27dd9b[_0x3d53('0x2e')]=_[_0x3d53('0x2d')](_0x506043['query']);_0x27dd9b[_0x3d53('0x2f')]=_[_0x3d53('0x30')](_0x27dd9b[_0x3d53('0x2c')],_0x27dd9b[_0x3d53('0x2e')]);_0x4effaa['attributes']=_[_0x3d53('0x30')](_0x27dd9b[_0x3d53('0x2c')],qs['fields'](_0x506043['query'][_0x3d53('0x32')]));_0x4effaa[_0x3d53('0x31')]=_0x4effaa['attributes'][_0x3d53('0x33')]?_0x4effaa[_0x3d53('0x31')]:_0x27dd9b[_0x3d53('0x2c')];if(_0x506043[_0x3d53('0x2e')][_0x3d53('0x3d')]){_0x4effaa[_0x3d53('0x3e')]=[{'all':!![]}];}_0x4effaa=_[_0x3d53('0x43')]({},_0x4effaa,_0x506043[_0x3d53('0x44')]);return db['VtigerAccount'][_0x3d53('0x45')](_0x4effaa)[_0x3d53('0x3b')](handleEntityNotFound(_0x1d9e67,null))['then'](respondWithResult(_0x1d9e67,null))[_0x3d53('0x40')](handleError(_0x1d9e67,null));};exports[_0x3d53('0x46')]=function(_0x533911,_0x48e7e7){return db[_0x3d53('0x3a')][_0x3d53('0x46')](_0x533911['body'],{})['then'](respondWithResult(_0x48e7e7,0xc9))[_0x3d53('0x40')](handleError(_0x48e7e7,null));};exports[_0x3d53('0x21')]=function(_0x11739c,_0x4f5695){if(_0x11739c['body']['id']){delete _0x11739c[_0x3d53('0x47')]['id'];}return db[_0x3d53('0x3a')]['find']({'where':{'id':_0x11739c['params']['id']}})['then'](handleEntityNotFound(_0x4f5695,null))[_0x3d53('0x3b')](saveUpdates(_0x11739c[_0x3d53('0x47')],null))[_0x3d53('0x3b')](respondWithResult(_0x4f5695,null))[_0x3d53('0x40')](handleError(_0x4f5695,null));};exports[_0x3d53('0x22')]=function(_0x55328c,_0x1a3bc1){return db['VtigerAccount'][_0x3d53('0x45')]({'where':{'id':_0x55328c['params']['id']}})['then'](handleEntityNotFound(_0x1a3bc1,null))[_0x3d53('0x3b')](removeEntity(_0x1a3bc1,null))['catch'](handleError(_0x1a3bc1,null));};exports[_0x3d53('0x48')]=function(_0x59e8f8,_0x4a1f72,_0x59acd5){var _0x41f082={};var _0x19104a={};var _0x9a4a8c;var _0x2ee4c8;return db['VtigerAccount'][_0x3d53('0x49')]({'where':{'id':_0x59e8f8[_0x3d53('0x42')]['id']}})[_0x3d53('0x3b')](handleEntityNotFound(_0x4a1f72,null))[_0x3d53('0x3b')](function(_0x4dbe09){if(_0x4dbe09){_0x9a4a8c=_0x4dbe09;_0x19104a[_0x3d53('0x2c')]=_[_0x3d53('0x2d')](db['VtigerConfiguration']['rawAttributes']);_0x19104a[_0x3d53('0x2e')]=_[_0x3d53('0x2d')](_0x59e8f8['query']);_0x19104a[_0x3d53('0x2f')]=_[_0x3d53('0x30')](_0x19104a['model'],_0x19104a[_0x3d53('0x2e')]);_0x41f082[_0x3d53('0x31')]=_[_0x3d53('0x30')](_0x19104a[_0x3d53('0x2c')],qs[_0x3d53('0x32')](_0x59e8f8[_0x3d53('0x2e')][_0x3d53('0x32')]));_0x41f082[_0x3d53('0x31')]=_0x41f082['attributes']['length']?_0x41f082[_0x3d53('0x31')]:_0x19104a['model'];_0x41f082[_0x3d53('0x4a')]=qs[_0x3d53('0x35')](_0x59e8f8[_0x3d53('0x2e')]['sort']);_0x41f082[_0x3d53('0x38')]=qs[_0x3d53('0x2f')](_[_0x3d53('0x36')](_0x59e8f8['query'],_0x19104a[_0x3d53('0x2f')]));if(_0x59e8f8[_0x3d53('0x2e')][_0x3d53('0x37')]){_0x41f082[_0x3d53('0x38')]=_['merge'](_0x41f082[_0x3d53('0x38')],{'$or':_[_0x3d53('0x28')](_0x41f082[_0x3d53('0x31')],function(_0x272ebf){var _0x9777f7={};_0x9777f7[_0x272ebf]={'$like':'%'+_0x59e8f8[_0x3d53('0x2e')][_0x3d53('0x37')]+'%'};return _0x9777f7;})});}_0x41f082=_['merge']({},_0x41f082,_0x59e8f8[_0x3d53('0x44')]);return _0x9a4a8c['getConfigurations'](_0x41f082);}})[_0x3d53('0x3b')](function(_0x55d4d9){if(_0x55d4d9){_0x2ee4c8=_0x55d4d9[_0x3d53('0x33')];if(!_0x59e8f8['query'][_0x3d53('0x4b')]('nolimit')){_0x41f082[_0x3d53('0x1a')]=qs[_0x3d53('0x1a')](_0x59e8f8[_0x3d53('0x2e')][_0x3d53('0x1a')]);_0x41f082[_0x3d53('0x1b')]=qs[_0x3d53('0x1b')](_0x59e8f8['query']['offset']);}return _0x9a4a8c[_0x3d53('0x48')](_0x41f082);}})[_0x3d53('0x3b')](function(_0x42efdf){if(_0x42efdf){return _0x42efdf?{'count':_0x2ee4c8,'rows':_0x42efdf}:null;}})[_0x3d53('0x3b')](respondWithResult(_0x4a1f72,null))['catch'](handleError(_0x4a1f72,null));};exports[_0x3d53('0x4c')]=function(_0x572b2f,_0x35a537,_0x39a34c){if(_0x572b2f[_0x3d53('0x47')]['id']){delete _0x572b2f[_0x3d53('0x47')]['id'];}return db[_0x3d53('0x3a')][_0x3d53('0x49')]({'where':{'id':_0x572b2f['params']['id']}})[_0x3d53('0x3b')](handleEntityNotFound(_0x35a537,null))[_0x3d53('0x3b')](function(_0x51a012){if(_0x51a012){_0x572b2f[_0x3d53('0x47')]['AccountId']=_0x51a012['id'];_0x572b2f[_0x3d53('0x47')][_0x3d53('0x4d')]=integrations[_0x3d53('0x4e')](_0x572b2f[_0x3d53('0x47')][_0x3d53('0x4f')],_0x572b2f['body']['type']);_0x572b2f['body']['Descriptions']=integrations[_0x3d53('0x50')](_0x572b2f[_0x3d53('0x47')][_0x3d53('0x4f')],_0x572b2f[_0x3d53('0x47')][_0x3d53('0x51')]);return db[_0x3d53('0x52')][_0x3d53('0x46')](_0x572b2f[_0x3d53('0x47')],{'include':[{'model':db['VtigerField'],'as':_0x3d53('0x4d')},{'model':db['VtigerField'],'as':_0x3d53('0x53')}]});}return null;})[_0x3d53('0x3b')](respondWithResult(_0x35a537,null))[_0x3d53('0x40')](handleError(_0x35a537,null));};var md5=require(_0x3d53('0x54'));exports[_0x3d53('0x55')]=function(_0x9f4b38,_0xa2b5e5,_0x274e50){var _0x4771d7=null;var _0xb0caf4=null;var _0x3c4ebd=null;var _0x3e49f7=null;var _0x21a603='';return db['VtigerAccount']['findOne']({'where':{'id':_0x9f4b38[_0x3d53('0x42')]['id']},'attributes':['id','name',_0x3d53('0x56'),_0x3d53('0x57'),_0x3d53('0x58'),_0x3d53('0x59'),_0x3d53('0x5a'),'accessKey']})['then'](handleEntityNotFound(_0xa2b5e5,null))[_0x3d53('0x3b')](function(_0x2ce87e){if(_0x2ce87e){_0x4771d7=_0x2ce87e['username'];_0xb0caf4=_0x2ce87e['accessKey'];_0x3c4ebd=_0x2ce87e[_0x3d53('0x58')];_0x21a603=_0x2ce87e[_0x3d53('0x59')];var _0x5a6714=_0x21a603[_0x3d53('0x5b')](-0x1);if(_0x5a6714==='/'){_0x21a603=_0x21a603[_0x3d53('0x5c')](0x0,_0x21a603['lastIndexOf'](_0x5a6714));}_0x3e49f7=util[_0x3d53('0x5d')](_0x3d53('0x5e'),_0x21a603);var _0x45b45c={'method':_0x3d53('0x5f'),'uri':_0x3e49f7,'qs':{'operation':_0x3d53('0x60'),'username':_0x2ce87e[_0x3d53('0x56')]},'json':!![]};return rp(_0x45b45c);}})[_0x3d53('0x3b')](function(_0xb5cb43){if(_0xb5cb43[_0x3d53('0x61')]){var _0x227b69={'method':'POST','uri':_0x3e49f7,'form':{'operation':_0x3d53('0x62'),'username':_0x4771d7,'accessKey':md5(_0xb5cb43[_0x3d53('0x63')]['token']+_0xb0caf4)},'json':!![]};return rp(_0x227b69);}})['then'](function(_0x191d1a){if(_0x191d1a['success']){var _0x49a959={'method':'GET','uri':_0x3e49f7,'qs':{'operation':'describe','username':_0x4771d7,'sessionName':_0x191d1a[_0x3d53('0x63')][_0x3d53('0x64')],'elementType':_0x3c4ebd},'json':!![]};return rp(_0x49a959);}})[_0x3d53('0x3b')](function(_0x53fad6){if(_0x53fad6[_0x3d53('0x61')]){var _0x223048=[_0x3d53('0x65'),_0x3d53('0x66'),_0x3d53('0x67')];_['remove'](_0x53fad6[_0x3d53('0x63')][_0x3d53('0x32')],function(_0x20e5bf){return _0x223048['includes'](_0x20e5bf[_0x3d53('0x51')][_0x3d53('0x26')]);});_[_0x3d53('0x68')](_0x53fad6['result'][_0x3d53('0x32')],function(_0x46b62b){return _0x46b62b[_0x3d53('0x69')]===_0x3d53('0x6a');});return{'count':_0x53fad6['result'][_0x3d53('0x32')][_0x3d53('0x33')],'rows':_[_0x3d53('0x28')](_0x53fad6['result']['fields'],function(_0x157b14){return{'id':_0x157b14['name'],'name':_0x157b14['label'],'custom':_[_0x3d53('0x6b')](_0x157b14['name'],_0x3d53('0x6c'))?!![]:![],'options':_0x157b14[_0x3d53('0x51')]['name']===_0x3d53('0x6d')&&_0x157b14[_0x3d53('0x51')][_0x3d53('0x6e')]['length']>0x0?_[_0x3d53('0x28')](_0x157b14[_0x3d53('0x51')][_0x3d53('0x6e')],function(_0x3f4af8){return{'name':_0x3f4af8[_0x3d53('0x6f')],'value':_0x3f4af8[_0x3d53('0x70')]};}):[]};})};}})[_0x3d53('0x3b')](respondWithResult(_0xa2b5e5,null))['catch'](function(_0x4a1e97){console['log'](_0x3d53('0x71')+_0x4a1e97);var _0x203422=_0x9f4b38[_0x3d53('0x2e')][_0x3d53('0x72')]?0x1f4:_0x4a1e97['statusCode']||0x1f4;logger[_0x3d53('0x24')](_0x3d53('0x73'),'getFields',_0x203422,JSON['stringify'](_0x4a1e97));delete _0x4a1e97[_0x3d53('0x26')];if(_0x203422===0x191){_0x203422=0x190;}_0xa2b5e5[_0x3d53('0x17')](_0x203422)['send'](_0x9f4b38[_0x3d53('0x2e')][_0x3d53('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x4a1e97['statusCode']}:_0x4a1e97);});}; \ No newline at end of file +var _0x1b4d=['fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','update','destroy','then','name','index','map','VtigerAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','show','params','include','find','create','body','catch','getConfigurations','VtigerConfiguration','pick','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','accessKey','remoteUri','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','result','sessionName','reference','owner','remove','includes','false','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3da240,_0x102841){var _0x4db72a=function(_0xb2918b){while(--_0xb2918b){_0x3da240['push'](_0x3da240['shift']());}};_0x4db72a(++_0x102841);}(_0x1b4d,0x1ea));var _0xd1b4=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1b4d[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1b4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1b4('0x1'));var rp=require(_0xd1b4('0x2'));var moment=require(_0xd1b4('0x3'));var BPromise=require(_0xd1b4('0x4'));var Mustache=require(_0xd1b4('0x5'));var util=require(_0xd1b4('0x6'));var path=require(_0xd1b4('0x7'));var sox=require(_0xd1b4('0x8'));var csv=require(_0xd1b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1b4('0xa'));var _=require(_0xd1b4('0xb'));var squel=require(_0xd1b4('0xc'));var crypto=require(_0xd1b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd1b4('0xe'));var toCsv=require(_0xd1b4('0x9'));var querystring=require('querystring');var Papa=require(_0xd1b4('0xf'));var Redis=require(_0xd1b4('0x10'));var authService=require(_0xd1b4('0x11'));var qs=require(_0xd1b4('0x12'));var as=require(_0xd1b4('0x13'));var hardwareService=require(_0xd1b4('0x14'));var logger=require(_0xd1b4('0x15'))(_0xd1b4('0x16'));var utils=require(_0xd1b4('0x17'));var config=require(_0xd1b4('0x18'));var licenseUtil=require(_0xd1b4('0x19'));var db=require(_0xd1b4('0x1a'))['db'];var integrations=require(_0xd1b4('0x1b'));function respondWithStatusCode(_0x3d4439,_0x330f01){_0x330f01=_0x330f01||0xcc;return function(_0x25d675){if(_0x25d675){return _0x3d4439[_0xd1b4('0x1c')](_0x330f01);}return _0x3d4439[_0xd1b4('0x1d')](_0x330f01)[_0xd1b4('0x1e')]();};}function respondWithResult(_0x3146fa,_0x50dc58){_0x50dc58=_0x50dc58||0xc8;return function(_0x5727f7){if(_0x5727f7){return _0x3146fa['status'](_0x50dc58)['json'](_0x5727f7);}};}function respondWithFilteredResult(_0x54f2f1,_0x53d402){return function(_0xd3f8ae){if(_0xd3f8ae){var _0x3c51ec=typeof _0x53d402[_0xd1b4('0x1f')]===_0xd1b4('0x20')&&typeof _0x53d402['limit']==='undefined';var _0x641a74=_0xd3f8ae[_0xd1b4('0x21')];var _0xa44619=_0x3c51ec?0x0:_0x53d402[_0xd1b4('0x1f')];var _0x1f8c4d=_0x3c51ec?_0xd3f8ae[_0xd1b4('0x21')]:_0x53d402[_0xd1b4('0x1f')]+_0x53d402['limit'];var _0x4b7c28;if(_0x1f8c4d>=_0x641a74){_0x1f8c4d=_0x641a74;_0x4b7c28=0xc8;}else{_0x4b7c28=0xce;}_0x54f2f1[_0xd1b4('0x1d')](_0x4b7c28);return _0x54f2f1[_0xd1b4('0x22')](_0xd1b4('0x23'),_0xa44619+'-'+_0x1f8c4d+'/'+_0x641a74)[_0xd1b4('0x24')](_0xd3f8ae);}return null;};}function patchUpdates(_0x5e40c4){return function(_0x2e7ccf){try{jsonpatch['apply'](_0x2e7ccf,_0x5e40c4,!![]);}catch(_0x3019b0){return BPromise[_0xd1b4('0x25')](_0x3019b0);}return _0x2e7ccf['save']();};}function saveUpdates(_0x55eb55,_0x5b964b){return function(_0x4406b6){if(_0x4406b6){return _0x4406b6[_0xd1b4('0x26')](_0x55eb55)['then'](function(_0x30075d){return _0x30075d;});}return null;};}function removeEntity(_0x5cb67f,_0x474253){return function(_0x16d1e0){if(_0x16d1e0){return _0x16d1e0[_0xd1b4('0x27')]()[_0xd1b4('0x28')](function(){_0x5cb67f[_0xd1b4('0x1d')](0xcc)[_0xd1b4('0x1e')]();});}};}function handleEntityNotFound(_0x4d77a8,_0x442bae){return function(_0x441323){if(!_0x441323){_0x4d77a8[_0xd1b4('0x1c')](0x194);}return _0x441323;};}function handleError(_0x3c5737,_0x2d49fb){_0x2d49fb=_0x2d49fb||0x1f4;return function(_0x5d5d23){logger['error'](_0x5d5d23['stack']);if(_0x5d5d23[_0xd1b4('0x29')]){delete _0x5d5d23[_0xd1b4('0x29')];}_0x3c5737[_0xd1b4('0x1d')](_0x2d49fb)['send'](_0x5d5d23);};}exports[_0xd1b4('0x2a')]=function(_0x1d27ce,_0x40bf9){var _0x511daa={},_0x1e5df6={},_0x41f977={'count':0x0,'rows':[]};var _0x2e499e=_[_0xd1b4('0x2b')](db[_0xd1b4('0x2c')][_0xd1b4('0x2d')],function(_0x50b982){return{'name':_0x50b982[_0xd1b4('0x2e')],'type':_0x50b982[_0xd1b4('0x2f')]['key']};});_0x1e5df6['model']=_['map'](_0x2e499e,'name');_0x1e5df6[_0xd1b4('0x30')]=_[_0xd1b4('0x31')](_0x1d27ce['query']);_0x1e5df6[_0xd1b4('0x32')]=_[_0xd1b4('0x33')](_0x1e5df6[_0xd1b4('0x34')],_0x1e5df6[_0xd1b4('0x30')]);_0x511daa[_0xd1b4('0x35')]=_[_0xd1b4('0x33')](_0x1e5df6[_0xd1b4('0x34')],qs[_0xd1b4('0x36')](_0x1d27ce['query'][_0xd1b4('0x36')]));_0x511daa['attributes']=_0x511daa[_0xd1b4('0x35')][_0xd1b4('0x37')]?_0x511daa[_0xd1b4('0x35')]:_0x1e5df6[_0xd1b4('0x34')];if(!_0x1d27ce[_0xd1b4('0x30')][_0xd1b4('0x38')](_0xd1b4('0x39'))){_0x511daa[_0xd1b4('0x3a')]=qs[_0xd1b4('0x3a')](_0x1d27ce[_0xd1b4('0x30')][_0xd1b4('0x3a')]);_0x511daa[_0xd1b4('0x1f')]=qs[_0xd1b4('0x1f')](_0x1d27ce[_0xd1b4('0x30')][_0xd1b4('0x1f')]);}_0x511daa[_0xd1b4('0x3b')]=qs[_0xd1b4('0x3c')](_0x1d27ce[_0xd1b4('0x30')]['sort']);_0x511daa['where']=qs['filters'](_['pick'](_0x1d27ce[_0xd1b4('0x30')],_0x1e5df6[_0xd1b4('0x32')]),_0x2e499e);if(_0x1d27ce[_0xd1b4('0x30')][_0xd1b4('0x3d')]){_0x511daa[_0xd1b4('0x3e')]=_[_0xd1b4('0x3f')](_0x511daa['where'],{'$or':_[_0xd1b4('0x2b')](_0x2e499e,function(_0x188d0d){if(_0x188d0d[_0xd1b4('0x2f')]!==_0xd1b4('0x40')){var _0x234fb6={};_0x234fb6[_0x188d0d['name']]={'$like':'%'+_0x1d27ce[_0xd1b4('0x30')]['filter']+'%'};return _0x234fb6;}})});}_0x511daa=_['merge']({},_0x511daa,_0x1d27ce[_0xd1b4('0x41')]);var _0x47aafe={'where':_0x511daa[_0xd1b4('0x3e')]};return db[_0xd1b4('0x2c')]['count'](_0x47aafe)['then'](function(_0x15821c){_0x41f977[_0xd1b4('0x21')]=_0x15821c;if(_0x1d27ce[_0xd1b4('0x30')][_0xd1b4('0x42')]){_0x511daa['include']=[{'all':!![]}];}return db[_0xd1b4('0x2c')]['findAll'](_0x511daa);})[_0xd1b4('0x28')](function(_0x1eb6ec){_0x41f977['rows']=_0x1eb6ec;return _0x41f977;})[_0xd1b4('0x28')](respondWithFilteredResult(_0x40bf9,_0x511daa))['catch'](handleError(_0x40bf9,null));};exports[_0xd1b4('0x43')]=function(_0x2c2055,_0x2919c6){var _0x3ad616={'raw':![],'where':{'id':_0x2c2055[_0xd1b4('0x44')]['id']}},_0x331189={};_0x331189[_0xd1b4('0x34')]=_[_0xd1b4('0x31')](db[_0xd1b4('0x2c')][_0xd1b4('0x2d')]);_0x331189[_0xd1b4('0x30')]=_['keys'](_0x2c2055[_0xd1b4('0x30')]);_0x331189[_0xd1b4('0x32')]=_['intersection'](_0x331189[_0xd1b4('0x34')],_0x331189[_0xd1b4('0x30')]);_0x3ad616[_0xd1b4('0x35')]=_['intersection'](_0x331189['model'],qs[_0xd1b4('0x36')](_0x2c2055[_0xd1b4('0x30')]['fields']));_0x3ad616[_0xd1b4('0x35')]=_0x3ad616[_0xd1b4('0x35')][_0xd1b4('0x37')]?_0x3ad616[_0xd1b4('0x35')]:_0x331189[_0xd1b4('0x34')];if(_0x2c2055['query'][_0xd1b4('0x42')]){_0x3ad616[_0xd1b4('0x45')]=[{'all':!![]}];}_0x3ad616=_[_0xd1b4('0x3f')]({},_0x3ad616,_0x2c2055[_0xd1b4('0x41')]);return db[_0xd1b4('0x2c')][_0xd1b4('0x46')](_0x3ad616)[_0xd1b4('0x28')](handleEntityNotFound(_0x2919c6,null))[_0xd1b4('0x28')](respondWithResult(_0x2919c6,null))['catch'](handleError(_0x2919c6,null));};exports[_0xd1b4('0x47')]=function(_0x3a6bf1,_0x52c377){return db[_0xd1b4('0x2c')][_0xd1b4('0x47')](_0x3a6bf1[_0xd1b4('0x48')],{})[_0xd1b4('0x28')](respondWithResult(_0x52c377,0xc9))[_0xd1b4('0x49')](handleError(_0x52c377,null));};exports[_0xd1b4('0x26')]=function(_0x2809d8,_0x212392){if(_0x2809d8[_0xd1b4('0x48')]['id']){delete _0x2809d8[_0xd1b4('0x48')]['id'];}return db[_0xd1b4('0x2c')][_0xd1b4('0x46')]({'where':{'id':_0x2809d8[_0xd1b4('0x44')]['id']}})[_0xd1b4('0x28')](handleEntityNotFound(_0x212392,null))['then'](saveUpdates(_0x2809d8[_0xd1b4('0x48')],null))[_0xd1b4('0x28')](respondWithResult(_0x212392,null))['catch'](handleError(_0x212392,null));};exports[_0xd1b4('0x27')]=function(_0x5277c8,_0x1af8ae){return db[_0xd1b4('0x2c')][_0xd1b4('0x46')]({'where':{'id':_0x5277c8[_0xd1b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1af8ae,null))[_0xd1b4('0x28')](removeEntity(_0x1af8ae,null))[_0xd1b4('0x49')](handleError(_0x1af8ae,null));};exports[_0xd1b4('0x4a')]=function(_0x1fb125,_0x367282,_0x404252){var _0x19359f={};var _0x503f8a={};var _0x5aa97a;var _0x386056;return db[_0xd1b4('0x2c')]['findOne']({'where':{'id':_0x1fb125[_0xd1b4('0x44')]['id']}})[_0xd1b4('0x28')](handleEntityNotFound(_0x367282,null))['then'](function(_0x1ff8f3){if(_0x1ff8f3){_0x5aa97a=_0x1ff8f3;_0x503f8a[_0xd1b4('0x34')]=_['keys'](db[_0xd1b4('0x4b')][_0xd1b4('0x2d')]);_0x503f8a[_0xd1b4('0x30')]=_[_0xd1b4('0x31')](_0x1fb125['query']);_0x503f8a['filters']=_[_0xd1b4('0x33')](_0x503f8a[_0xd1b4('0x34')],_0x503f8a['query']);_0x19359f[_0xd1b4('0x35')]=_[_0xd1b4('0x33')](_0x503f8a[_0xd1b4('0x34')],qs[_0xd1b4('0x36')](_0x1fb125[_0xd1b4('0x30')][_0xd1b4('0x36')]));_0x19359f[_0xd1b4('0x35')]=_0x19359f['attributes'][_0xd1b4('0x37')]?_0x19359f['attributes']:_0x503f8a[_0xd1b4('0x34')];_0x19359f[_0xd1b4('0x3b')]=qs[_0xd1b4('0x3c')](_0x1fb125['query']['sort']);_0x19359f[_0xd1b4('0x3e')]=qs['filters'](_[_0xd1b4('0x4c')](_0x1fb125[_0xd1b4('0x30')],_0x503f8a[_0xd1b4('0x32')]));if(_0x1fb125[_0xd1b4('0x30')][_0xd1b4('0x3d')]){_0x19359f['where']=_[_0xd1b4('0x3f')](_0x19359f[_0xd1b4('0x3e')],{'$or':_[_0xd1b4('0x2b')](_0x19359f['attributes'],function(_0x5dd94a){var _0x21fc40={};_0x21fc40[_0x5dd94a]={'$like':'%'+_0x1fb125[_0xd1b4('0x30')]['filter']+'%'};return _0x21fc40;})});}_0x19359f=_[_0xd1b4('0x3f')]({},_0x19359f,_0x1fb125[_0xd1b4('0x41')]);return _0x5aa97a[_0xd1b4('0x4a')](_0x19359f);}})[_0xd1b4('0x28')](function(_0x25056e){if(_0x25056e){_0x386056=_0x25056e[_0xd1b4('0x37')];if(!_0x1fb125[_0xd1b4('0x30')]['hasOwnProperty'](_0xd1b4('0x39'))){_0x19359f['limit']=qs['limit'](_0x1fb125[_0xd1b4('0x30')][_0xd1b4('0x3a')]);_0x19359f[_0xd1b4('0x1f')]=qs[_0xd1b4('0x1f')](_0x1fb125[_0xd1b4('0x30')][_0xd1b4('0x1f')]);}return _0x5aa97a['getConfigurations'](_0x19359f);}})['then'](function(_0x5283c3){if(_0x5283c3){return _0x5283c3?{'count':_0x386056,'rows':_0x5283c3}:null;}})[_0xd1b4('0x28')](respondWithResult(_0x367282,null))[_0xd1b4('0x49')](handleError(_0x367282,null));};exports[_0xd1b4('0x4d')]=function(_0x10f871,_0x1fbafa,_0x5439fb){if(_0x10f871[_0xd1b4('0x48')]['id']){delete _0x10f871['body']['id'];}return db[_0xd1b4('0x2c')][_0xd1b4('0x4e')]({'where':{'id':_0x10f871['params']['id']}})['then'](handleEntityNotFound(_0x1fbafa,null))[_0xd1b4('0x28')](function(_0x357cad){if(_0x357cad){_0x10f871[_0xd1b4('0x48')]['AccountId']=_0x357cad['id'];_0x10f871['body'][_0xd1b4('0x4f')]=integrations[_0xd1b4('0x50')](_0x10f871[_0xd1b4('0x48')][_0xd1b4('0x51')],_0x10f871[_0xd1b4('0x48')]['type']);_0x10f871[_0xd1b4('0x48')][_0xd1b4('0x52')]=integrations[_0xd1b4('0x53')](_0x10f871[_0xd1b4('0x48')][_0xd1b4('0x51')],_0x10f871[_0xd1b4('0x48')][_0xd1b4('0x2f')]);return db['VtigerConfiguration'][_0xd1b4('0x47')](_0x10f871[_0xd1b4('0x48')],{'include':[{'model':db[_0xd1b4('0x54')],'as':_0xd1b4('0x4f')},{'model':db[_0xd1b4('0x54')],'as':_0xd1b4('0x52')}]});}return null;})['then'](respondWithResult(_0x1fbafa,null))[_0xd1b4('0x49')](handleError(_0x1fbafa,null));};var md5=require(_0xd1b4('0x55'));exports[_0xd1b4('0x56')]=function(_0x307e7e,_0x22c56d,_0x4234c6){var _0x16d951=null;var _0x465015=null;var _0x4e329c=null;var _0x46b7fd=null;var _0xde1ea='';return db[_0xd1b4('0x2c')][_0xd1b4('0x4e')]({'where':{'id':_0x307e7e['params']['id']},'attributes':['id','name',_0xd1b4('0x57'),_0xd1b4('0x58'),_0xd1b4('0x59'),'remoteUri','serverUrl',_0xd1b4('0x5a')]})['then'](handleEntityNotFound(_0x22c56d,null))[_0xd1b4('0x28')](function(_0x2de4e2){if(_0x2de4e2){_0x16d951=_0x2de4e2[_0xd1b4('0x57')];_0x465015=_0x2de4e2[_0xd1b4('0x5a')];_0x4e329c=_0x2de4e2[_0xd1b4('0x59')];_0xde1ea=_0x2de4e2[_0xd1b4('0x5b')];var _0x1fb3c0=_0xde1ea['slice'](-0x1);if(_0x1fb3c0==='/'){_0xde1ea=_0xde1ea[_0xd1b4('0x5c')](0x0,_0xde1ea[_0xd1b4('0x5d')](_0x1fb3c0));}_0x46b7fd=util[_0xd1b4('0x5e')](_0xd1b4('0x5f'),_0xde1ea);var _0x4579ce={'method':_0xd1b4('0x60'),'uri':_0x46b7fd,'qs':{'operation':_0xd1b4('0x61'),'username':_0x2de4e2[_0xd1b4('0x57')]},'json':!![]};return rp(_0x4579ce);}})[_0xd1b4('0x28')](function(_0x46ab82){if(_0x46ab82[_0xd1b4('0x62')]){var _0x485796={'method':_0xd1b4('0x63'),'uri':_0x46b7fd,'form':{'operation':_0xd1b4('0x64'),'username':_0x16d951,'accessKey':md5(_0x46ab82['result'][_0xd1b4('0x65')]+_0x465015)},'json':!![]};return rp(_0x485796);}})[_0xd1b4('0x28')](function(_0x34ee2d){if(_0x34ee2d['success']){var _0x150c3f={'method':_0xd1b4('0x60'),'uri':_0x46b7fd,'qs':{'operation':_0xd1b4('0x66'),'username':_0x16d951,'sessionName':_0x34ee2d[_0xd1b4('0x67')][_0xd1b4('0x68')],'elementType':_0x4e329c},'json':!![]};return rp(_0x150c3f);}})[_0xd1b4('0x28')](function(_0x1e34a3){if(_0x1e34a3['success']){var _0x3d73ba=['autogenerated',_0xd1b4('0x69'),_0xd1b4('0x6a')];_[_0xd1b4('0x6b')](_0x1e34a3[_0xd1b4('0x67')][_0xd1b4('0x36')],function(_0x14486d){return _0x3d73ba[_0xd1b4('0x6c')](_0x14486d[_0xd1b4('0x2f')][_0xd1b4('0x29')]);});_[_0xd1b4('0x6b')](_0x1e34a3[_0xd1b4('0x67')][_0xd1b4('0x36')],function(_0x3cdff3){return _0x3cdff3['editable']===_0xd1b4('0x6d');});return{'count':_0x1e34a3['result'][_0xd1b4('0x36')][_0xd1b4('0x37')],'rows':_[_0xd1b4('0x2b')](_0x1e34a3[_0xd1b4('0x67')]['fields'],function(_0xb59575){return{'id':_0xb59575[_0xd1b4('0x29')],'name':_0xb59575['label'],'custom':_[_0xd1b4('0x6e')](_0xb59575[_0xd1b4('0x29')],_0xd1b4('0x6f'))?!![]:![],'options':_0xb59575['type']['name']===_0xd1b4('0x70')&&_0xb59575[_0xd1b4('0x2f')][_0xd1b4('0x71')][_0xd1b4('0x37')]>0x0?_[_0xd1b4('0x2b')](_0xb59575[_0xd1b4('0x2f')][_0xd1b4('0x71')],function(_0x32e6d9){return{'name':_0x32e6d9[_0xd1b4('0x72')],'value':_0x32e6d9[_0xd1b4('0x73')]};}):[]};})};}})[_0xd1b4('0x28')](respondWithResult(_0x22c56d,null))[_0xd1b4('0x49')](function(_0x138563){console[_0xd1b4('0x74')](_0xd1b4('0x75')+_0x138563);var _0x3f27e5=_0x307e7e[_0xd1b4('0x30')][_0xd1b4('0x76')]?0x1f4:_0x138563[_0xd1b4('0x77')]||0x1f4;logger[_0xd1b4('0x78')](_0xd1b4('0x79'),_0xd1b4('0x56'),_0x3f27e5,JSON[_0xd1b4('0x7a')](_0x138563));delete _0x138563[_0xd1b4('0x29')];if(_0x3f27e5===0x191){_0x3f27e5=0x190;}_0x22c56d[_0xd1b4('0x1d')](_0x3f27e5)[_0xd1b4('0x7b')](_0x307e7e['query'][_0xd1b4('0x76')]?{'message':_0xd1b4('0x7c'),'statusCode':_0x138563[_0xd1b4('0x77')]}:_0x138563);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0dbf668..d8fc011 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 _0xb732=['lodash','../../config/logger','api','../../config/environment','exports','define','int_vtiger_accounts'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0xb732,0x1f1));var _0x2b73=function(_0x5aca14,_0x17dcaa){_0x5aca14=_0x5aca14-0x0;var _0x11054a=_0xb732[_0x5aca14];return _0x11054a;};'use strict';var _=require(_0x2b73('0x0'));var util=require('util');var logger=require(_0x2b73('0x1'))(_0x2b73('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(_0x2b73('0x3'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x2b73('0x4')]=function(_0x3ecb35,_0x1db787){return _0x3ecb35[_0x2b73('0x5')]('VtigerAccount',attributes,{'tableName':_0x2b73('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd678=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash'];(function(_0x372387,_0x214d8c){var _0x24181c=function(_0x566b8a){while(--_0x566b8a){_0x372387['push'](_0x372387['shift']());}};_0x24181c(++_0x214d8c);}(_0xd678,0x151));var _0x8d67=function(_0x4b8980,_0x2559d8){_0x4b8980=_0x4b8980-0x0;var _0x2e93b4=_0xd678[_0x4b8980];return _0x2e93b4;};'use strict';var _=require(_0x8d67('0x0'));var util=require(_0x8d67('0x1'));var logger=require(_0x8d67('0x2'))(_0x8d67('0x3'));var moment=require(_0x8d67('0x4'));var BPromise=require(_0x8d67('0x5'));var rp=require(_0x8d67('0x6'));var fs=require('fs');var path=require(_0x8d67('0x7'));var rimraf=require('rimraf');var config=require(_0x8d67('0x8'));var attributes=require(_0x8d67('0x9'));var integrations=require(_0x8d67('0xa'));module['exports']=function(_0x3b3a7d,_0x162835){return _0x3b3a7d[_0x8d67('0xb')]('VtigerAccount',attributes,{'tableName':_0x8d67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 4e71bbb..b574e1b 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 _0x878f=['ShowVtigerAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','then','stringify'];(function(_0x42b54e,_0x5a194f){var _0x3f17cd=function(_0x54bd8a){while(--_0x54bd8a){_0x42b54e['push'](_0x42b54e['shift']());}};_0x3f17cd(++_0x5a194f);}(_0x878f,0x173));var _0xf878=function(_0xece691,_0x5246c2){_0xece691=_0xece691-0x0;var _0x33e161=_0x878f[_0xece691];return _0x33e161;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});}exports[_0xf878('0x15')]=function(_0x3b2e1b){var _0x47a91a=this;return new Promise(function(_0x2b2b54,_0x34ae59){return db[_0xf878('0x16')][_0xf878('0x17')]({'raw':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2e1b['options']?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1a')]||null:null,'attributes':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b['options'][_0xf878('0x1b')]||null:null,'limit':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1c')]||null:null,'include':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')],function(_0x45e61f){return{'model':db[_0x45e61f['model']],'as':_0x45e61f['as'],'attributes':_0x45e61f[_0xf878('0x1b')],'include':_0x45e61f['include']?_[_0xf878('0x1e')](_0x45e61f[_0xf878('0x1d')],function(_0x35b3b4){return{'model':db[_0x35b3b4[_0xf878('0x1f')]],'as':_0x35b3b4['as'],'attributes':_0x35b3b4[_0xf878('0x1b')],'include':_0x35b3b4['include']?_['map'](_0x35b3b4['include'],function(_0x242926){return{'model':db[_0x242926[_0xf878('0x1f')]],'as':_0x242926['as'],'attributes':_0x242926[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa3e11){logger[_0xf878('0xc')](_0xf878('0x15'),_0x3b2e1b);logger[_0xf878('0x20')](_0xf878('0x15'),_0x3b2e1b,JSON['stringify'](_0xfa3e11));_0x2b2b54(_0xfa3e11);})['catch'](function(_0x9a127d){logger[_0xf878('0x10')]('GetVtigerAccount',_0x9a127d[_0xf878('0x12')],_0x3b2e1b);_0x34ae59(_0x47a91a['error'](0x1f4,_0x9a127d[_0xf878('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x2c61c1){var _0x49e66a=this;return new Promise(function(_0x2630fb,_0x48b151){return db[_0xf878('0x16')][_0xf878('0x21')]({'raw':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1a')]||null:null,'attributes':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x1b')]||null:null,'include':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x2c61c1['options'][_0xf878('0x1d')],function(_0xd1ad51){return{'model':db[_0xd1ad51[_0xf878('0x1f')]],'as':_0xd1ad51['as'],'attributes':_0xd1ad51[_0xf878('0x1b')],'include':_0xd1ad51[_0xf878('0x1d')]?_['map'](_0xd1ad51[_0xf878('0x1d')],function(_0x1b09de){return{'model':db[_0x1b09de[_0xf878('0x1f')]],'as':_0x1b09de['as'],'attributes':_0x1b09de[_0xf878('0x1b')],'include':_0x1b09de['include']?_[_0xf878('0x1e')](_0x1b09de['include'],function(_0x4ce1e7){return{'model':db[_0x4ce1e7[_0xf878('0x1f')]],'as':_0x4ce1e7['as'],'attributes':_0x4ce1e7[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf878('0x22')](function(_0x105416){logger[_0xf878('0xc')]('ShowVtigerAccount',_0x2c61c1);logger[_0xf878('0x20')]('ShowVtigerAccount',_0x2c61c1,JSON[_0xf878('0x23')](_0x105416));_0x2630fb(_0x105416);})[_0xf878('0x14')](function(_0x4d4aff){logger[_0xf878('0x10')](_0xf878('0x24'),_0x4d4aff['message'],_0x2c61c1);_0x48b151(_0x49e66a[_0xf878('0x10')](0x1f4,_0x4d4aff[_0xf878('0x12')]));});});}; \ No newline at end of file +var _0x6f7a=['then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','VtigerAccount','options','raw','where','attributes','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3cb6fa,_0x516f15){var _0x4d786e=function(_0x481c65){while(--_0x481c65){_0x3cb6fa['push'](_0x3cb6fa['shift']());}};_0x4d786e(++_0x516f15);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x353b43,_0x3289c8){_0x353b43=_0x353b43-0x0;var _0x58b22d=_0x6f7a[_0x353b43];return _0x58b22d;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['GetVtigerAccount']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['findAll']({'raw':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x4a8827['options']?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1e')]||null:null,'limit':_0x4a8827['options']?_0x4a8827['options']['limit']||null:null,'include':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')]['include']?_['map'](_0x4a8827['options'][_0xa6f7('0x1f')],function(_0xc77e8e){return{'model':db[_0xc77e8e[_0xa6f7('0x20')]],'as':_0xc77e8e['as'],'attributes':_0xc77e8e['attributes'],'include':_0xc77e8e['include']?_[_0xa6f7('0x21')](_0xc77e8e['include'],function(_0x47ef97){return{'model':db[_0x47ef97[_0xa6f7('0x20')]],'as':_0x47ef97['as'],'attributes':_0x47ef97['attributes'],'include':_0x47ef97[_0xa6f7('0x1f')]?_[_0xa6f7('0x21')](_0x47ef97[_0xa6f7('0x1f')],function(_0x2b4c6c){return{'model':db[_0x2b4c6c[_0xa6f7('0x20')]],'as':_0x2b4c6c['as'],'attributes':_0x2b4c6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c419b){logger[_0xa6f7('0xf')]('GetVtigerAccount',_0x4a8827);logger[_0xa6f7('0x10')](_0xa6f7('0x22'),_0x4a8827,JSON[_0xa6f7('0x12')](_0x1c419b));_0x5298ba(_0x1c419b);})[_0xa6f7('0x19')](function(_0x224f5a){logger[_0xa6f7('0x13')](_0xa6f7('0x22'),_0x224f5a[_0xa6f7('0x16')],_0x4a8827);_0x378967(_0xba7755[_0xa6f7('0x13')](0x1f4,_0x224f5a[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x23')]=function(_0x278bad){var _0x52f9c1=this;return new Promise(function(_0x442ccf,_0x42dc49){return db['VtigerAccount'][_0xa6f7('0x24')]({'raw':_0x278bad[_0xa6f7('0x1b')]?_0x278bad['options']['raw']===undefined?!![]:![]:!![],'where':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')]['attributes']||null:null,'include':_0x278bad['options']?_0x278bad[_0xa6f7('0x1b')]['include']?_[_0xa6f7('0x21')](_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1f')],function(_0x237e5d){return{'model':db[_0x237e5d[_0xa6f7('0x20')]],'as':_0x237e5d['as'],'attributes':_0x237e5d[_0xa6f7('0x1e')],'include':_0x237e5d['include']?_[_0xa6f7('0x21')](_0x237e5d[_0xa6f7('0x1f')],function(_0x1a5de5){return{'model':db[_0x1a5de5['model']],'as':_0x1a5de5['as'],'attributes':_0x1a5de5[_0xa6f7('0x1e')],'include':_0x1a5de5['include']?_[_0xa6f7('0x21')](_0x1a5de5[_0xa6f7('0x1f')],function(_0x45837c){return{'model':db[_0x45837c['model']],'as':_0x45837c['as'],'attributes':_0x45837c[_0xa6f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa6f7('0xe')](function(_0x3b3bc2){logger[_0xa6f7('0xf')](_0xa6f7('0x23'),_0x278bad);logger[_0xa6f7('0x10')]('ShowVtigerAccount',_0x278bad,JSON[_0xa6f7('0x12')](_0x3b3bc2));_0x442ccf(_0x3b3bc2);})[_0xa6f7('0x19')](function(_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x23'),_0xc25a1b[_0xa6f7('0x16')],_0x278bad);_0x42dc49(_0x52f9c1[_0xa6f7('0x13')](0x1f4,_0xc25a1b[_0xa6f7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index fd7ddac..a261ef9 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 _0x834f=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x55df6c,_0x389b4e){var _0x12ad05=function(_0x5a07e2){while(--_0x5a07e2){_0x55df6c['push'](_0x55df6c['shift']());}};_0x12ad05(++_0x389b4e);}(_0x834f,0x19c));var _0xf834=function(_0x123c89,_0x319a6b){_0x123c89=_0x123c89-0x0;var _0x4c8869=_0x834f[_0x123c89];return _0x4c8869;};'use strict';var multer=require(_0xf834('0x0'));var util=require(_0xf834('0x1'));var path=require(_0xf834('0x2'));var timeout=require(_0xf834('0x3'));var express=require(_0xf834('0x4'));var router=express[_0xf834('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf834('0x6'));var config=require(_0xf834('0x7'));var controller=require(_0xf834('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf834('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf834('0xa')]);router['get']('/:id/fields',auth[_0xf834('0xb')](),controller[_0xf834('0xc')]);router[_0xf834('0x9')](_0xf834('0xd'),auth['isAuthenticated'](),controller[_0xf834('0xe')]);router['get'](_0xf834('0xf'),auth[_0xf834('0xb')](),controller[_0xf834('0x10')]);router[_0xf834('0x11')]('/',auth[_0xf834('0xb')](),controller[_0xf834('0x12')]);router['put']('/:id',auth[_0xf834('0xb')](),controller[_0xf834('0x13')]);router['delete']('/:id',auth[_0xf834('0xb')](),controller[_0xf834('0x14')]);module[_0xf834('0x15')]=router; \ No newline at end of file +var _0xdb51=['get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller'];(function(_0x3b798b,_0x5f3672){var _0x444a56=function(_0x2c7078){while(--_0x2c7078){_0x3b798b['push'](_0x3b798b['shift']());}};_0x444a56(++_0x5f3672);}(_0xdb51,0x1ea));var _0x1db5=function(_0x149b26,_0x35332e){_0x149b26=_0x149b26-0x0;var _0x2b2688=_0xdb51[_0x149b26];return _0x2b2688;};'use strict';var multer=require(_0x1db5('0x0'));var util=require(_0x1db5('0x1'));var path=require(_0x1db5('0x2'));var timeout=require(_0x1db5('0x3'));var express=require(_0x1db5('0x4'));var router=express[_0x1db5('0x5')]();var fs_extra=require(_0x1db5('0x6'));var auth=require(_0x1db5('0x7'));var interaction=require(_0x1db5('0x8'));var config=require('../../config/environment');var controller=require(_0x1db5('0x9'));router[_0x1db5('0xa')]('/',auth[_0x1db5('0xb')](),controller[_0x1db5('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1db5('0xd')]);router['get'](_0x1db5('0xe'),auth[_0x1db5('0xb')](),controller['getFields']);router[_0x1db5('0xa')](_0x1db5('0xf'),auth[_0x1db5('0xb')](),controller[_0x1db5('0x10')]);router[_0x1db5('0xa')](_0x1db5('0x11'),auth['isAuthenticated'](),controller[_0x1db5('0x12')]);router[_0x1db5('0x13')]('/',auth[_0x1db5('0xb')](),controller[_0x1db5('0x14')]);router[_0x1db5('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1db5('0x16')](_0x1db5('0x17'),auth[_0x1db5('0xb')](),controller[_0x1db5('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 736a715..823b512 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 _0xb542=['STRING','sequelize','exports'];(function(_0x57d4c4,_0x1eb1c7){var _0x551561=function(_0x5aa58d){while(--_0x5aa58d){_0x57d4c4['push'](_0x57d4c4['shift']());}};_0x551561(++_0x1eb1c7);}(_0xb542,0xaf));var _0x2b54=function(_0x1fe4a2,_0x2210b0){_0x1fe4a2=_0x1fe4a2-0x0;var _0x312795=_0xb542[_0x1fe4a2];return _0x312795;};'use strict';var Sequelize=require(_0x2b54('0x0'));module[_0x2b54('0x1')]={'name':{'type':Sequelize[_0x2b54('0x2')]},'description':{'type':Sequelize[_0x2b54('0x2')]}}; \ No newline at end of file +var _0xa474=['STRING','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa474,0x1e3));var _0x4a47=function(_0x19e977,_0x4e56ba){_0x19e977=_0x19e977-0x0;var _0x430fdb=_0xa474[_0x19e977];return _0x430fdb;};'use strict';var Sequelize=require(_0x4a47('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a47('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9124db2..a275e11 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 _0x319c=['set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','VtigerConfiguration','includeAll','include','catch','show','params','find','create','body','getFields','VtigerField','nolimit','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count'];(function(_0x267be9,_0x198757){var _0x431e75=function(_0x46b519){while(--_0x46b519){_0x267be9['push'](_0x267be9['shift']());}};_0x431e75(++_0x198757);}(_0x319c,0x1d9));var _0xc319=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x319c[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require(_0xc319('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc319('0x1'));var jsonpatch=require(_0xc319('0x2'));var rp=require(_0xc319('0x3'));var moment=require('moment');var BPromise=require(_0xc319('0x4'));var Mustache=require(_0xc319('0x5'));var util=require(_0xc319('0x6'));var path=require(_0xc319('0x7'));var sox=require(_0xc319('0x8'));var csv=require(_0xc319('0x9'));var ejs=require(_0xc319('0xa'));var fs=require('fs');var fs_extra=require(_0xc319('0xb'));var _=require(_0xc319('0xc'));var squel=require(_0xc319('0xd'));var crypto=require(_0xc319('0xe'));var jsforce=require(_0xc319('0xf'));var deskjs=require(_0xc319('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc319('0x11'));var Papa=require(_0xc319('0x12'));var Redis=require(_0xc319('0x13'));var authService=require(_0xc319('0x14'));var qs=require(_0xc319('0x15'));var as=require(_0xc319('0x16'));var hardwareService=require(_0xc319('0x17'));var logger=require(_0xc319('0x18'))(_0xc319('0x19'));var utils=require(_0xc319('0x1a'));var config=require(_0xc319('0x1b'));var licenseUtil=require(_0xc319('0x1c'));var db=require(_0xc319('0x1d'))['db'];function respondWithStatusCode(_0x1c1b8a,_0xa2a16b){_0xa2a16b=_0xa2a16b||0xcc;return function(_0x277741){if(_0x277741){return _0x1c1b8a['sendStatus'](_0xa2a16b);}return _0x1c1b8a[_0xc319('0x1e')](_0xa2a16b)[_0xc319('0x1f')]();};}function respondWithResult(_0x3a2833,_0x1615b2){_0x1615b2=_0x1615b2||0xc8;return function(_0x3ea965){if(_0x3ea965){return _0x3a2833[_0xc319('0x1e')](_0x1615b2)[_0xc319('0x20')](_0x3ea965);}};}function respondWithFilteredResult(_0x5183c7,_0x4ff6cd){return function(_0x431c63){if(_0x431c63){var _0x5451dc=typeof _0x4ff6cd['offset']===_0xc319('0x21')&&typeof _0x4ff6cd[_0xc319('0x22')]===_0xc319('0x21');var _0x13242b=_0x431c63['count'];var _0x43cb3b=_0x5451dc?0x0:_0x4ff6cd[_0xc319('0x23')];var _0x3c0dda=_0x5451dc?_0x431c63[_0xc319('0x24')]:_0x4ff6cd[_0xc319('0x23')]+_0x4ff6cd[_0xc319('0x22')];var _0x4d8b11;if(_0x3c0dda>=_0x13242b){_0x3c0dda=_0x13242b;_0x4d8b11=0xc8;}else{_0x4d8b11=0xce;}_0x5183c7[_0xc319('0x1e')](_0x4d8b11);return _0x5183c7[_0xc319('0x25')](_0xc319('0x26'),_0x43cb3b+'-'+_0x3c0dda+'/'+_0x13242b)[_0xc319('0x20')](_0x431c63);}return null;};}function patchUpdates(_0x426618){return function(_0x378963){try{jsonpatch[_0xc319('0x27')](_0x378963,_0x426618,!![]);}catch(_0xbbc1b9){return BPromise[_0xc319('0x28')](_0xbbc1b9);}return _0x378963[_0xc319('0x29')]();};}function saveUpdates(_0x3cb3ac,_0x59315c){return function(_0x587adc){if(_0x587adc){return _0x587adc[_0xc319('0x2a')](_0x3cb3ac)[_0xc319('0x2b')](function(_0x38eb0e){return _0x38eb0e;});}return null;};}function removeEntity(_0x35d5d3,_0xc13131){return function(_0x1ae0b8){if(_0x1ae0b8){return _0x1ae0b8[_0xc319('0x2c')]()[_0xc319('0x2b')](function(){_0x35d5d3[_0xc319('0x1e')](0xcc)[_0xc319('0x1f')]();});}};}function handleEntityNotFound(_0x1c9d84,_0x570104){return function(_0x1aa2e9){if(!_0x1aa2e9){_0x1c9d84['sendStatus'](0x194);}return _0x1aa2e9;};}function handleError(_0x10eee8,_0x5f2fcc){_0x5f2fcc=_0x5f2fcc||0x1f4;return function(_0x303e80){logger['error'](_0x303e80[_0xc319('0x2d')]);if(_0x303e80['name']){delete _0x303e80[_0xc319('0x2e')];}_0x10eee8[_0xc319('0x1e')](_0x5f2fcc)['send'](_0x303e80);};}exports[_0xc319('0x2f')]=function(_0x387caf,_0x310485){var _0x2f5ea5={},_0x5b4f71={},_0x4337d5={'count':0x0,'rows':[]};var _0x3e5082=_[_0xc319('0x30')](db['VtigerConfiguration'][_0xc319('0x31')],function(_0x2b3f60){return{'name':_0x2b3f60[_0xc319('0x32')],'type':_0x2b3f60[_0xc319('0x33')][_0xc319('0x34')]};});_0x5b4f71[_0xc319('0x35')]=_[_0xc319('0x30')](_0x3e5082,_0xc319('0x2e'));_0x5b4f71[_0xc319('0x36')]=_[_0xc319('0x37')](_0x387caf[_0xc319('0x36')]);_0x5b4f71['filters']=_[_0xc319('0x38')](_0x5b4f71[_0xc319('0x35')],_0x5b4f71[_0xc319('0x36')]);_0x2f5ea5[_0xc319('0x39')]=_[_0xc319('0x38')](_0x5b4f71['model'],qs[_0xc319('0x3a')](_0x387caf[_0xc319('0x36')][_0xc319('0x3a')]));_0x2f5ea5['attributes']=_0x2f5ea5[_0xc319('0x39')][_0xc319('0x3b')]?_0x2f5ea5['attributes']:_0x5b4f71[_0xc319('0x35')];if(!_0x387caf[_0xc319('0x36')][_0xc319('0x3c')]('nolimit')){_0x2f5ea5[_0xc319('0x22')]=qs[_0xc319('0x22')](_0x387caf[_0xc319('0x36')]['limit']);_0x2f5ea5[_0xc319('0x23')]=qs[_0xc319('0x23')](_0x387caf[_0xc319('0x36')][_0xc319('0x23')]);}_0x2f5ea5[_0xc319('0x3d')]=qs[_0xc319('0x3e')](_0x387caf['query'][_0xc319('0x3e')]);_0x2f5ea5['where']=qs[_0xc319('0x3f')](_[_0xc319('0x40')](_0x387caf['query'],_0x5b4f71[_0xc319('0x3f')]),_0x3e5082);if(_0x387caf[_0xc319('0x36')]['filter']){_0x2f5ea5[_0xc319('0x41')]=_['merge'](_0x2f5ea5[_0xc319('0x41')],{'$or':_[_0xc319('0x30')](_0x3e5082,function(_0x50105f){if(_0x50105f[_0xc319('0x33')]!==_0xc319('0x42')){var _0x32e1a6={};_0x32e1a6[_0x50105f['name']]={'$like':'%'+_0x387caf[_0xc319('0x36')][_0xc319('0x43')]+'%'};return _0x32e1a6;}})});}_0x2f5ea5=_[_0xc319('0x44')]({},_0x2f5ea5,_0x387caf[_0xc319('0x45')]);var _0x3f58f0={'where':_0x2f5ea5['where']};return db[_0xc319('0x46')][_0xc319('0x24')](_0x3f58f0)['then'](function(_0x450934){_0x4337d5['count']=_0x450934;if(_0x387caf[_0xc319('0x36')][_0xc319('0x47')]){_0x2f5ea5[_0xc319('0x48')]=[{'all':!![]}];}return db[_0xc319('0x46')]['findAll'](_0x2f5ea5);})[_0xc319('0x2b')](function(_0x53dbb3){_0x4337d5['rows']=_0x53dbb3;return _0x4337d5;})['then'](respondWithFilteredResult(_0x310485,_0x2f5ea5))[_0xc319('0x49')](handleError(_0x310485,null));};exports[_0xc319('0x4a')]=function(_0x55b25d,_0x1a26eb){var _0x34c537={'raw':![],'where':{'id':_0x55b25d[_0xc319('0x4b')]['id']}},_0x2373c7={};_0x2373c7[_0xc319('0x35')]=_[_0xc319('0x37')](db[_0xc319('0x46')][_0xc319('0x31')]);_0x2373c7[_0xc319('0x36')]=_[_0xc319('0x37')](_0x55b25d['query']);_0x2373c7[_0xc319('0x3f')]=_[_0xc319('0x38')](_0x2373c7[_0xc319('0x35')],_0x2373c7[_0xc319('0x36')]);_0x34c537[_0xc319('0x39')]=_[_0xc319('0x38')](_0x2373c7[_0xc319('0x35')],qs['fields'](_0x55b25d[_0xc319('0x36')][_0xc319('0x3a')]));_0x34c537['attributes']=_0x34c537['attributes'][_0xc319('0x3b')]?_0x34c537[_0xc319('0x39')]:_0x2373c7[_0xc319('0x35')];if(_0x55b25d['query'][_0xc319('0x47')]){_0x34c537['include']=[{'all':!![]}];}_0x34c537=_['merge']({},_0x34c537,_0x55b25d[_0xc319('0x45')]);return db[_0xc319('0x46')][_0xc319('0x4c')](_0x34c537)['then'](handleEntityNotFound(_0x1a26eb,null))[_0xc319('0x2b')](respondWithResult(_0x1a26eb,null))[_0xc319('0x49')](handleError(_0x1a26eb,null));};exports['create']=function(_0x27ab06,_0x23467f){return db['VtigerConfiguration'][_0xc319('0x4d')](_0x27ab06[_0xc319('0x4e')],{})[_0xc319('0x2b')](respondWithResult(_0x23467f,0xc9))[_0xc319('0x49')](handleError(_0x23467f,null));};exports[_0xc319('0x2a')]=function(_0x3a3b70,_0x606308){if(_0x3a3b70[_0xc319('0x4e')]['id']){delete _0x3a3b70[_0xc319('0x4e')]['id'];}return db[_0xc319('0x46')][_0xc319('0x4c')]({'where':{'id':_0x3a3b70[_0xc319('0x4b')]['id']}})[_0xc319('0x2b')](handleEntityNotFound(_0x606308,null))[_0xc319('0x2b')](saveUpdates(_0x3a3b70[_0xc319('0x4e')],null))['then'](respondWithResult(_0x606308,null))[_0xc319('0x49')](handleError(_0x606308,null));};exports['destroy']=function(_0x17dea8,_0x23fc3b){return db[_0xc319('0x46')]['find']({'where':{'id':_0x17dea8['params']['id']}})[_0xc319('0x2b')](handleEntityNotFound(_0x23fc3b,null))[_0xc319('0x2b')](removeEntity(_0x23fc3b,null))['catch'](handleError(_0x23fc3b,null));};exports[_0xc319('0x4f')]=function(_0x2f0004,_0x34ea90,_0xaebe1e){var _0x5f2fe7={};var _0x119df7={};var _0x1e26f0;var _0x35711b;return db[_0xc319('0x46')]['findOne']({'where':{'id':_0x2f0004[_0xc319('0x4b')]['id']}})[_0xc319('0x2b')](handleEntityNotFound(_0x34ea90,null))['then'](function(_0x3ed985){if(_0x3ed985){_0x1e26f0=_0x3ed985;_0x119df7[_0xc319('0x35')]=_[_0xc319('0x37')](db[_0xc319('0x50')][_0xc319('0x31')]);_0x119df7[_0xc319('0x36')]=_[_0xc319('0x37')](_0x2f0004[_0xc319('0x36')]);_0x119df7['filters']=_[_0xc319('0x38')](_0x119df7['model'],_0x119df7['query']);_0x5f2fe7[_0xc319('0x39')]=_[_0xc319('0x38')](_0x119df7['model'],qs[_0xc319('0x3a')](_0x2f0004['query'][_0xc319('0x3a')]));_0x5f2fe7[_0xc319('0x39')]=_0x5f2fe7[_0xc319('0x39')][_0xc319('0x3b')]?_0x5f2fe7[_0xc319('0x39')]:_0x119df7[_0xc319('0x35')];_0x5f2fe7['order']=qs[_0xc319('0x3e')](_0x2f0004[_0xc319('0x36')][_0xc319('0x3e')]);_0x5f2fe7[_0xc319('0x41')]=qs[_0xc319('0x3f')](_[_0xc319('0x40')](_0x2f0004[_0xc319('0x36')],_0x119df7[_0xc319('0x3f')]));if(_0x2f0004[_0xc319('0x36')][_0xc319('0x43')]){_0x5f2fe7['where']=_[_0xc319('0x44')](_0x5f2fe7[_0xc319('0x41')],{'$or':_[_0xc319('0x30')](_0x5f2fe7[_0xc319('0x39')],function(_0x11bcb4){var _0x4172b0={};_0x4172b0[_0x11bcb4]={'$like':'%'+_0x2f0004[_0xc319('0x36')][_0xc319('0x43')]+'%'};return _0x4172b0;})});}_0x5f2fe7=_[_0xc319('0x44')]({},_0x5f2fe7,_0x2f0004[_0xc319('0x45')]);return _0x1e26f0[_0xc319('0x4f')](_0x5f2fe7);}})[_0xc319('0x2b')](function(_0xbebefa){if(_0xbebefa){_0x35711b=_0xbebefa[_0xc319('0x3b')];if(!_0x2f0004['query']['hasOwnProperty'](_0xc319('0x51'))){_0x5f2fe7[_0xc319('0x22')]=qs[_0xc319('0x22')](_0x2f0004[_0xc319('0x36')][_0xc319('0x22')]);_0x5f2fe7[_0xc319('0x23')]=qs[_0xc319('0x23')](_0x2f0004[_0xc319('0x36')][_0xc319('0x23')]);}return _0x1e26f0[_0xc319('0x4f')](_0x5f2fe7);}})[_0xc319('0x2b')](function(_0x505e48){if(_0x505e48){return _0x505e48?{'count':_0x35711b,'rows':_0x505e48}:null;}})['then'](respondWithResult(_0x34ea90,null))[_0xc319('0x49')](handleError(_0x34ea90,null));};exports['getSubjects']=function(_0x4a5777,_0x3d2ceb,_0x50f4af){var _0x50c298={};var _0x4786b1={};var _0x51162f;var _0x108230;return db[_0xc319('0x46')]['findOne']({'where':{'id':_0x4a5777['params']['id']}})[_0xc319('0x2b')](handleEntityNotFound(_0x3d2ceb,null))[_0xc319('0x2b')](function(_0x2f5225){if(_0x2f5225){_0x51162f=_0x2f5225;_0x4786b1[_0xc319('0x35')]=_[_0xc319('0x37')](db['VtigerField'][_0xc319('0x31')]);_0x4786b1[_0xc319('0x36')]=_[_0xc319('0x37')](_0x4a5777[_0xc319('0x36')]);_0x4786b1[_0xc319('0x3f')]=_[_0xc319('0x38')](_0x4786b1['model'],_0x4786b1[_0xc319('0x36')]);_0x50c298[_0xc319('0x39')]=_[_0xc319('0x38')](_0x4786b1[_0xc319('0x35')],qs['fields'](_0x4a5777[_0xc319('0x36')][_0xc319('0x3a')]));_0x50c298['attributes']=_0x50c298[_0xc319('0x39')][_0xc319('0x3b')]?_0x50c298[_0xc319('0x39')]:_0x4786b1[_0xc319('0x35')];_0x50c298['order']=qs[_0xc319('0x3e')](_0x4a5777['query'][_0xc319('0x3e')]);_0x50c298[_0xc319('0x41')]=qs[_0xc319('0x3f')](_[_0xc319('0x40')](_0x4a5777['query'],_0x4786b1[_0xc319('0x3f')]));if(_0x4a5777[_0xc319('0x36')][_0xc319('0x43')]){_0x50c298[_0xc319('0x41')]=_[_0xc319('0x44')](_0x50c298[_0xc319('0x41')],{'$or':_[_0xc319('0x30')](_0x50c298[_0xc319('0x39')],function(_0x57003a){var _0x320df2={};_0x320df2[_0x57003a]={'$like':'%'+_0x4a5777[_0xc319('0x36')]['filter']+'%'};return _0x320df2;})});}_0x50c298=_[_0xc319('0x44')]({},_0x50c298,_0x4a5777[_0xc319('0x45')]);return _0x51162f[_0xc319('0x52')](_0x50c298);}})[_0xc319('0x2b')](function(_0x19a652){if(_0x19a652){_0x108230=_0x19a652[_0xc319('0x3b')];if(!_0x4a5777[_0xc319('0x36')]['hasOwnProperty'](_0xc319('0x51'))){_0x50c298[_0xc319('0x22')]=qs[_0xc319('0x22')](_0x4a5777[_0xc319('0x36')]['limit']);_0x50c298[_0xc319('0x23')]=qs[_0xc319('0x23')](_0x4a5777[_0xc319('0x36')][_0xc319('0x23')]);}return _0x51162f['getSubjects'](_0x50c298);}})[_0xc319('0x2b')](function(_0x28b5d8){if(_0x28b5d8){return _0x28b5d8?{'count':_0x108230,'rows':_0x28b5d8}:null;}})[_0xc319('0x2b')](respondWithResult(_0x3d2ceb,null))[_0xc319('0x49')](handleError(_0x3d2ceb,null));};exports[_0xc319('0x53')]=function(_0x278278,_0x40b586,_0x1bc251){var _0x371e8f={};var _0x342fa5={};var _0x5be577;var _0x465cda;return db[_0xc319('0x46')][_0xc319('0x54')]({'where':{'id':_0x278278['params']['id']}})['then'](handleEntityNotFound(_0x40b586,null))[_0xc319('0x2b')](function(_0x43b7ea){if(_0x43b7ea){_0x5be577=_0x43b7ea;_0x342fa5['model']=_['keys'](db['VtigerField'][_0xc319('0x31')]);_0x342fa5['query']=_[_0xc319('0x37')](_0x278278[_0xc319('0x36')]);_0x342fa5['filters']=_[_0xc319('0x38')](_0x342fa5[_0xc319('0x35')],_0x342fa5[_0xc319('0x36')]);_0x371e8f[_0xc319('0x39')]=_[_0xc319('0x38')](_0x342fa5[_0xc319('0x35')],qs[_0xc319('0x3a')](_0x278278[_0xc319('0x36')][_0xc319('0x3a')]));_0x371e8f[_0xc319('0x39')]=_0x371e8f[_0xc319('0x39')][_0xc319('0x3b')]?_0x371e8f[_0xc319('0x39')]:_0x342fa5[_0xc319('0x35')];_0x371e8f[_0xc319('0x3d')]=qs['sort'](_0x278278[_0xc319('0x36')][_0xc319('0x3e')]);_0x371e8f[_0xc319('0x41')]=qs[_0xc319('0x3f')](_[_0xc319('0x40')](_0x278278[_0xc319('0x36')],_0x342fa5['filters']));if(_0x278278[_0xc319('0x36')][_0xc319('0x43')]){_0x371e8f[_0xc319('0x41')]=_['merge'](_0x371e8f[_0xc319('0x41')],{'$or':_['map'](_0x371e8f['attributes'],function(_0x5d559f){var _0x53144b={};_0x53144b[_0x5d559f]={'$like':'%'+_0x278278[_0xc319('0x36')]['filter']+'%'};return _0x53144b;})});}_0x371e8f=_[_0xc319('0x44')]({},_0x371e8f,_0x278278[_0xc319('0x45')]);return _0x5be577[_0xc319('0x53')](_0x371e8f);}})[_0xc319('0x2b')](function(_0x3ec55d){if(_0x3ec55d){_0x465cda=_0x3ec55d[_0xc319('0x3b')];if(!_0x278278[_0xc319('0x36')][_0xc319('0x3c')]('nolimit')){_0x371e8f[_0xc319('0x22')]=qs[_0xc319('0x22')](_0x278278[_0xc319('0x36')]['limit']);_0x371e8f[_0xc319('0x23')]=qs['offset'](_0x278278[_0xc319('0x36')]['offset']);}return _0x5be577[_0xc319('0x53')](_0x371e8f);}})[_0xc319('0x2b')](function(_0x1a60ce){if(_0x1a60ce){return _0x1a60ce?{'count':_0x465cda,'rows':_0x1a60ce}:null;}})[_0xc319('0x2b')](respondWithResult(_0x40b586,null))['catch'](handleError(_0x40b586,null));}; \ No newline at end of file +var _0xa581=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','VtigerConfiguration','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','findOne','VtigerField','pick','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x40b759,_0x17afca){var _0x32d8b2=function(_0x14174b){while(--_0x14174b){_0x40b759['push'](_0x40b759['shift']());}};_0x32d8b2(++_0x17afca);}(_0xa581,0x90));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1a58('0x0'));var rimraf=require(_0x1a58('0x1'));var zipdir=require(_0x1a58('0x2'));var jsonpatch=require(_0x1a58('0x3'));var rp=require(_0x1a58('0x4'));var moment=require(_0x1a58('0x5'));var BPromise=require(_0x1a58('0x6'));var Mustache=require(_0x1a58('0x7'));var util=require('util');var path=require(_0x1a58('0x8'));var sox=require(_0x1a58('0x9'));var csv=require(_0x1a58('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a58('0xb'));var squel=require(_0x1a58('0xc'));var crypto=require(_0x1a58('0xd'));var jsforce=require(_0x1a58('0xe'));var deskjs=require(_0x1a58('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1a58('0x10'));var Papa=require(_0x1a58('0x11'));var Redis=require(_0x1a58('0x12'));var authService=require(_0x1a58('0x13'));var qs=require(_0x1a58('0x14'));var as=require(_0x1a58('0x15'));var hardwareService=require(_0x1a58('0x16'));var logger=require(_0x1a58('0x17'))(_0x1a58('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a58('0x19'));var db=require(_0x1a58('0x1a'))['db'];function respondWithStatusCode(_0x26fbb6,_0x2e5f81){_0x2e5f81=_0x2e5f81||0xcc;return function(_0x1fbfd9){if(_0x1fbfd9){return _0x26fbb6[_0x1a58('0x1b')](_0x2e5f81);}return _0x26fbb6[_0x1a58('0x1c')](_0x2e5f81)[_0x1a58('0x1d')]();};}function respondWithResult(_0x3956cd,_0x2936e0){_0x2936e0=_0x2936e0||0xc8;return function(_0x5d2ab0){if(_0x5d2ab0){return _0x3956cd[_0x1a58('0x1c')](_0x2936e0)['json'](_0x5d2ab0);}};}function respondWithFilteredResult(_0x39653d,_0x38a578){return function(_0x13952d){if(_0x13952d){var _0x5761eb=typeof _0x38a578['offset']==='undefined'&&typeof _0x38a578[_0x1a58('0x1e')]==='undefined';var _0x225fd8=_0x13952d[_0x1a58('0x1f')];var _0x165b57=_0x5761eb?0x0:_0x38a578[_0x1a58('0x20')];var _0xab7440=_0x5761eb?_0x13952d[_0x1a58('0x1f')]:_0x38a578['offset']+_0x38a578[_0x1a58('0x1e')];var _0x897e75;if(_0xab7440>=_0x225fd8){_0xab7440=_0x225fd8;_0x897e75=0xc8;}else{_0x897e75=0xce;}_0x39653d[_0x1a58('0x1c')](_0x897e75);return _0x39653d[_0x1a58('0x21')](_0x1a58('0x22'),_0x165b57+'-'+_0xab7440+'/'+_0x225fd8)[_0x1a58('0x23')](_0x13952d);}return null;};}function patchUpdates(_0x472195){return function(_0x37e51d){try{jsonpatch[_0x1a58('0x24')](_0x37e51d,_0x472195,!![]);}catch(_0x5dc88d){return BPromise[_0x1a58('0x25')](_0x5dc88d);}return _0x37e51d[_0x1a58('0x26')]();};}function saveUpdates(_0x530801,_0x2a61c0){return function(_0x5442d6){if(_0x5442d6){return _0x5442d6[_0x1a58('0x27')](_0x530801)[_0x1a58('0x28')](function(_0x3b2fbf){return _0x3b2fbf;});}return null;};}function removeEntity(_0x4b8495,_0x5cbf86){return function(_0xe05971){if(_0xe05971){return _0xe05971['destroy']()[_0x1a58('0x28')](function(){_0x4b8495[_0x1a58('0x1c')](0xcc)[_0x1a58('0x1d')]();});}};}function handleEntityNotFound(_0x56e129,_0x4e0728){return function(_0x20ac29){if(!_0x20ac29){_0x56e129[_0x1a58('0x1b')](0x194);}return _0x20ac29;};}function handleError(_0x587cdf,_0x5842eb){_0x5842eb=_0x5842eb||0x1f4;return function(_0x581320){logger[_0x1a58('0x29')](_0x581320[_0x1a58('0x2a')]);if(_0x581320[_0x1a58('0x2b')]){delete _0x581320[_0x1a58('0x2b')];}_0x587cdf['status'](_0x5842eb)[_0x1a58('0x2c')](_0x581320);};}exports[_0x1a58('0x2d')]=function(_0x5d9c99,_0x1a923a){var _0x31d30b={},_0x2b77c8={},_0x9dd938={'count':0x0,'rows':[]};var _0x316c86=_['map'](db[_0x1a58('0x2e')]['rawAttributes'],function(_0x5993f9){return{'name':_0x5993f9['fieldName'],'type':_0x5993f9['type'][_0x1a58('0x2f')]};});_0x2b77c8[_0x1a58('0x30')]=_[_0x1a58('0x31')](_0x316c86,_0x1a58('0x2b'));_0x2b77c8[_0x1a58('0x32')]=_[_0x1a58('0x33')](_0x5d9c99[_0x1a58('0x32')]);_0x2b77c8[_0x1a58('0x34')]=_[_0x1a58('0x35')](_0x2b77c8['model'],_0x2b77c8['query']);_0x31d30b[_0x1a58('0x36')]=_['intersection'](_0x2b77c8[_0x1a58('0x30')],qs[_0x1a58('0x37')](_0x5d9c99['query'][_0x1a58('0x37')]));_0x31d30b[_0x1a58('0x36')]=_0x31d30b[_0x1a58('0x36')][_0x1a58('0x38')]?_0x31d30b[_0x1a58('0x36')]:_0x2b77c8[_0x1a58('0x30')];if(!_0x5d9c99[_0x1a58('0x32')][_0x1a58('0x39')]('nolimit')){_0x31d30b[_0x1a58('0x1e')]=qs[_0x1a58('0x1e')](_0x5d9c99['query'][_0x1a58('0x1e')]);_0x31d30b[_0x1a58('0x20')]=qs[_0x1a58('0x20')](_0x5d9c99[_0x1a58('0x32')]['offset']);}_0x31d30b[_0x1a58('0x3a')]=qs[_0x1a58('0x3b')](_0x5d9c99['query'][_0x1a58('0x3b')]);_0x31d30b[_0x1a58('0x3c')]=qs['filters'](_['pick'](_0x5d9c99['query'],_0x2b77c8[_0x1a58('0x34')]),_0x316c86);if(_0x5d9c99['query'][_0x1a58('0x3d')]){_0x31d30b['where']=_[_0x1a58('0x3e')](_0x31d30b[_0x1a58('0x3c')],{'$or':_['map'](_0x316c86,function(_0x422464){if(_0x422464['type']!==_0x1a58('0x3f')){var _0x37ed20={};_0x37ed20[_0x422464[_0x1a58('0x2b')]]={'$like':'%'+_0x5d9c99[_0x1a58('0x32')][_0x1a58('0x3d')]+'%'};return _0x37ed20;}})});}_0x31d30b=_[_0x1a58('0x3e')]({},_0x31d30b,_0x5d9c99[_0x1a58('0x40')]);var _0x5e1af4={'where':_0x31d30b[_0x1a58('0x3c')]};return db[_0x1a58('0x2e')]['count'](_0x5e1af4)['then'](function(_0x5d2cf7){_0x9dd938[_0x1a58('0x1f')]=_0x5d2cf7;if(_0x5d9c99['query'][_0x1a58('0x41')]){_0x31d30b['include']=[{'all':!![]}];}return db[_0x1a58('0x2e')]['findAll'](_0x31d30b);})[_0x1a58('0x28')](function(_0x145e7c){_0x9dd938[_0x1a58('0x42')]=_0x145e7c;return _0x9dd938;})[_0x1a58('0x28')](respondWithFilteredResult(_0x1a923a,_0x31d30b))[_0x1a58('0x43')](handleError(_0x1a923a,null));};exports['show']=function(_0x5dc244,_0xdf3422){var _0x39c9eb={'raw':![],'where':{'id':_0x5dc244[_0x1a58('0x44')]['id']}},_0x47035e={};_0x47035e['model']=_[_0x1a58('0x33')](db[_0x1a58('0x2e')][_0x1a58('0x45')]);_0x47035e[_0x1a58('0x32')]=_['keys'](_0x5dc244[_0x1a58('0x32')]);_0x47035e[_0x1a58('0x34')]=_['intersection'](_0x47035e[_0x1a58('0x30')],_0x47035e[_0x1a58('0x32')]);_0x39c9eb['attributes']=_['intersection'](_0x47035e['model'],qs[_0x1a58('0x37')](_0x5dc244[_0x1a58('0x32')][_0x1a58('0x37')]));_0x39c9eb[_0x1a58('0x36')]=_0x39c9eb[_0x1a58('0x36')][_0x1a58('0x38')]?_0x39c9eb[_0x1a58('0x36')]:_0x47035e[_0x1a58('0x30')];if(_0x5dc244[_0x1a58('0x32')][_0x1a58('0x41')]){_0x39c9eb[_0x1a58('0x46')]=[{'all':!![]}];}_0x39c9eb=_[_0x1a58('0x3e')]({},_0x39c9eb,_0x5dc244['options']);return db[_0x1a58('0x2e')][_0x1a58('0x47')](_0x39c9eb)[_0x1a58('0x28')](handleEntityNotFound(_0xdf3422,null))[_0x1a58('0x28')](respondWithResult(_0xdf3422,null))['catch'](handleError(_0xdf3422,null));};exports[_0x1a58('0x48')]=function(_0x560c26,_0x177b92){return db['VtigerConfiguration'][_0x1a58('0x48')](_0x560c26[_0x1a58('0x49')],{})[_0x1a58('0x28')](respondWithResult(_0x177b92,0xc9))['catch'](handleError(_0x177b92,null));};exports[_0x1a58('0x27')]=function(_0x4b2223,_0xf3dbfc){if(_0x4b2223[_0x1a58('0x49')]['id']){delete _0x4b2223[_0x1a58('0x49')]['id'];}return db[_0x1a58('0x2e')][_0x1a58('0x47')]({'where':{'id':_0x4b2223[_0x1a58('0x44')]['id']}})[_0x1a58('0x28')](handleEntityNotFound(_0xf3dbfc,null))[_0x1a58('0x28')](saveUpdates(_0x4b2223[_0x1a58('0x49')],null))[_0x1a58('0x28')](respondWithResult(_0xf3dbfc,null))[_0x1a58('0x43')](handleError(_0xf3dbfc,null));};exports['destroy']=function(_0x3fde89,_0x43c260){return db[_0x1a58('0x2e')]['find']({'where':{'id':_0x3fde89[_0x1a58('0x44')]['id']}})[_0x1a58('0x28')](handleEntityNotFound(_0x43c260,null))['then'](removeEntity(_0x43c260,null))[_0x1a58('0x43')](handleError(_0x43c260,null));};exports['getFields']=function(_0xdd2af2,_0x11050b,_0x2c57a7){var _0x4f6d37={};var _0x17ce93={};var _0x8ceb56;var _0x5be767;return db[_0x1a58('0x2e')][_0x1a58('0x4a')]({'where':{'id':_0xdd2af2[_0x1a58('0x44')]['id']}})['then'](handleEntityNotFound(_0x11050b,null))[_0x1a58('0x28')](function(_0x538a03){if(_0x538a03){_0x8ceb56=_0x538a03;_0x17ce93['model']=_[_0x1a58('0x33')](db[_0x1a58('0x4b')][_0x1a58('0x45')]);_0x17ce93[_0x1a58('0x32')]=_[_0x1a58('0x33')](_0xdd2af2[_0x1a58('0x32')]);_0x17ce93[_0x1a58('0x34')]=_[_0x1a58('0x35')](_0x17ce93[_0x1a58('0x30')],_0x17ce93[_0x1a58('0x32')]);_0x4f6d37['attributes']=_[_0x1a58('0x35')](_0x17ce93[_0x1a58('0x30')],qs[_0x1a58('0x37')](_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x37')]));_0x4f6d37['attributes']=_0x4f6d37[_0x1a58('0x36')][_0x1a58('0x38')]?_0x4f6d37['attributes']:_0x17ce93[_0x1a58('0x30')];_0x4f6d37[_0x1a58('0x3a')]=qs[_0x1a58('0x3b')](_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x3b')]);_0x4f6d37[_0x1a58('0x3c')]=qs[_0x1a58('0x34')](_[_0x1a58('0x4c')](_0xdd2af2['query'],_0x17ce93[_0x1a58('0x34')]));if(_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x3d')]){_0x4f6d37[_0x1a58('0x3c')]=_[_0x1a58('0x3e')](_0x4f6d37[_0x1a58('0x3c')],{'$or':_[_0x1a58('0x31')](_0x4f6d37['attributes'],function(_0x15b86b){var _0x4206f4={};_0x4206f4[_0x15b86b]={'$like':'%'+_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x3d')]+'%'};return _0x4206f4;})});}_0x4f6d37=_['merge']({},_0x4f6d37,_0xdd2af2['options']);return _0x8ceb56[_0x1a58('0x4d')](_0x4f6d37);}})['then'](function(_0x282648){if(_0x282648){_0x5be767=_0x282648['length'];if(!_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x39')](_0x1a58('0x4e'))){_0x4f6d37['limit']=qs[_0x1a58('0x1e')](_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x1e')]);_0x4f6d37[_0x1a58('0x20')]=qs[_0x1a58('0x20')](_0xdd2af2[_0x1a58('0x32')][_0x1a58('0x20')]);}return _0x8ceb56[_0x1a58('0x4d')](_0x4f6d37);}})[_0x1a58('0x28')](function(_0x18550a){if(_0x18550a){return _0x18550a?{'count':_0x5be767,'rows':_0x18550a}:null;}})['then'](respondWithResult(_0x11050b,null))[_0x1a58('0x43')](handleError(_0x11050b,null));};exports['getSubjects']=function(_0x4519aa,_0x22d139,_0x33bed6){var _0x499671={};var _0x10a3e7={};var _0x1aaa6c;var _0x1878f1;return db[_0x1a58('0x2e')][_0x1a58('0x4a')]({'where':{'id':_0x4519aa[_0x1a58('0x44')]['id']}})[_0x1a58('0x28')](handleEntityNotFound(_0x22d139,null))['then'](function(_0x1bacf3){if(_0x1bacf3){_0x1aaa6c=_0x1bacf3;_0x10a3e7[_0x1a58('0x30')]=_[_0x1a58('0x33')](db[_0x1a58('0x4b')][_0x1a58('0x45')]);_0x10a3e7[_0x1a58('0x32')]=_['keys'](_0x4519aa[_0x1a58('0x32')]);_0x10a3e7[_0x1a58('0x34')]=_[_0x1a58('0x35')](_0x10a3e7[_0x1a58('0x30')],_0x10a3e7['query']);_0x499671[_0x1a58('0x36')]=_[_0x1a58('0x35')](_0x10a3e7[_0x1a58('0x30')],qs[_0x1a58('0x37')](_0x4519aa[_0x1a58('0x32')]['fields']));_0x499671[_0x1a58('0x36')]=_0x499671['attributes'][_0x1a58('0x38')]?_0x499671[_0x1a58('0x36')]:_0x10a3e7[_0x1a58('0x30')];_0x499671[_0x1a58('0x3a')]=qs[_0x1a58('0x3b')](_0x4519aa[_0x1a58('0x32')][_0x1a58('0x3b')]);_0x499671[_0x1a58('0x3c')]=qs[_0x1a58('0x34')](_['pick'](_0x4519aa[_0x1a58('0x32')],_0x10a3e7[_0x1a58('0x34')]));if(_0x4519aa[_0x1a58('0x32')]['filter']){_0x499671[_0x1a58('0x3c')]=_[_0x1a58('0x3e')](_0x499671[_0x1a58('0x3c')],{'$or':_[_0x1a58('0x31')](_0x499671['attributes'],function(_0x552590){var _0x2ca37f={};_0x2ca37f[_0x552590]={'$like':'%'+_0x4519aa[_0x1a58('0x32')][_0x1a58('0x3d')]+'%'};return _0x2ca37f;})});}_0x499671=_['merge']({},_0x499671,_0x4519aa[_0x1a58('0x40')]);return _0x1aaa6c[_0x1a58('0x4f')](_0x499671);}})[_0x1a58('0x28')](function(_0x28ba95){if(_0x28ba95){_0x1878f1=_0x28ba95[_0x1a58('0x38')];if(!_0x4519aa[_0x1a58('0x32')]['hasOwnProperty']('nolimit')){_0x499671['limit']=qs['limit'](_0x4519aa[_0x1a58('0x32')][_0x1a58('0x1e')]);_0x499671[_0x1a58('0x20')]=qs[_0x1a58('0x20')](_0x4519aa[_0x1a58('0x32')][_0x1a58('0x20')]);}return _0x1aaa6c[_0x1a58('0x4f')](_0x499671);}})[_0x1a58('0x28')](function(_0xe2054){if(_0xe2054){return _0xe2054?{'count':_0x1878f1,'rows':_0xe2054}:null;}})[_0x1a58('0x28')](respondWithResult(_0x22d139,null))[_0x1a58('0x43')](handleError(_0x22d139,null));};exports[_0x1a58('0x50')]=function(_0x32a87a,_0x122674,_0x13a32b){var _0x511806={};var _0x27eb06={};var _0x3e888f;var _0x4c6052;return db[_0x1a58('0x2e')]['findOne']({'where':{'id':_0x32a87a[_0x1a58('0x44')]['id']}})['then'](handleEntityNotFound(_0x122674,null))[_0x1a58('0x28')](function(_0x19e852){if(_0x19e852){_0x3e888f=_0x19e852;_0x27eb06[_0x1a58('0x30')]=_[_0x1a58('0x33')](db[_0x1a58('0x4b')][_0x1a58('0x45')]);_0x27eb06['query']=_[_0x1a58('0x33')](_0x32a87a[_0x1a58('0x32')]);_0x27eb06[_0x1a58('0x34')]=_['intersection'](_0x27eb06[_0x1a58('0x30')],_0x27eb06[_0x1a58('0x32')]);_0x511806['attributes']=_[_0x1a58('0x35')](_0x27eb06['model'],qs[_0x1a58('0x37')](_0x32a87a[_0x1a58('0x32')][_0x1a58('0x37')]));_0x511806['attributes']=_0x511806['attributes']['length']?_0x511806[_0x1a58('0x36')]:_0x27eb06[_0x1a58('0x30')];_0x511806[_0x1a58('0x3a')]=qs['sort'](_0x32a87a[_0x1a58('0x32')][_0x1a58('0x3b')]);_0x511806['where']=qs[_0x1a58('0x34')](_[_0x1a58('0x4c')](_0x32a87a[_0x1a58('0x32')],_0x27eb06['filters']));if(_0x32a87a[_0x1a58('0x32')]['filter']){_0x511806['where']=_[_0x1a58('0x3e')](_0x511806[_0x1a58('0x3c')],{'$or':_[_0x1a58('0x31')](_0x511806[_0x1a58('0x36')],function(_0x3de954){var _0x2d14e9={};_0x2d14e9[_0x3de954]={'$like':'%'+_0x32a87a['query'][_0x1a58('0x3d')]+'%'};return _0x2d14e9;})});}_0x511806=_[_0x1a58('0x3e')]({},_0x511806,_0x32a87a[_0x1a58('0x40')]);return _0x3e888f['getDescriptions'](_0x511806);}})[_0x1a58('0x28')](function(_0x1ed7f8){if(_0x1ed7f8){_0x4c6052=_0x1ed7f8[_0x1a58('0x38')];if(!_0x32a87a[_0x1a58('0x32')][_0x1a58('0x39')](_0x1a58('0x4e'))){_0x511806[_0x1a58('0x1e')]=qs[_0x1a58('0x1e')](_0x32a87a[_0x1a58('0x32')]['limit']);_0x511806[_0x1a58('0x20')]=qs[_0x1a58('0x20')](_0x32a87a[_0x1a58('0x32')][_0x1a58('0x20')]);}return _0x3e888f[_0x1a58('0x50')](_0x511806);}})['then'](function(_0x49e697){if(_0x49e697){return _0x49e697?{'count':_0x4c6052,'rows':_0x49e697}:null;}})[_0x1a58('0x28')](respondWithResult(_0x122674,null))[_0x1a58('0x43')](handleError(_0x122674,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 9815a61..065f2c4 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 _0x58d0=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','int_vtiger_configurations','lodash'];(function(_0xfb65aa,_0x1651a6){var _0x2aee31=function(_0x492245){while(--_0x492245){_0xfb65aa['push'](_0xfb65aa['shift']());}};_0x2aee31(++_0x1651a6);}(_0x58d0,0x15d));var _0x058d=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x58d0[_0x53f897];return _0x6879f8;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var logger=require(_0x058d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x058d('0x3'));var rp=require(_0x058d('0x4'));var fs=require('fs');var path=require(_0x058d('0x5'));var rimraf=require(_0x058d('0x6'));var config=require(_0x058d('0x7'));var attributes=require(_0x058d('0x8'));module['exports']=function(_0x19d91d,_0x12cdc2){return _0x19d91d['define']('VtigerConfiguration',attributes,{'tableName':_0x058d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187c=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x187c,0x12a));var _0xc187=function(_0x3adb56,_0x158882){_0x3adb56=_0x3adb56-0x0;var _0xb961d1=_0x187c[_0x3adb56];return _0xb961d1;};'use strict';var _=require(_0xc187('0x0'));var util=require(_0xc187('0x1'));var logger=require(_0xc187('0x2'))(_0xc187('0x3'));var moment=require('moment');var BPromise=require(_0xc187('0x4'));var rp=require(_0xc187('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc187('0x6'));var config=require(_0xc187('0x7'));var attributes=require(_0xc187('0x8'));module[_0xc187('0x9')]=function(_0x2700ee,_0x2a7e96){return _0x2700ee[_0xc187('0xa')](_0xc187('0xb'),attributes,{'tableName':_0xc187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 8ccd4a3..4c2627d 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 _0x2674=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0xd78418,_0x17b9dd){var _0x1ed145=function(_0x1c8ff8){while(--_0x1c8ff8){_0xd78418['push'](_0xd78418['shift']());}};_0x1ed145(++_0x17b9dd);}(_0x2674,0x190));var _0x4267=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2674[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x4267('0x0'));var util=require(_0x4267('0x1'));var moment=require(_0x4267('0x2'));var BPromise=require(_0x4267('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4267('0x4'));var db=require(_0x4267('0x5'))['db'];var utils=require(_0x4267('0x6'));var logger=require('../../config/logger')(_0x4267('0x7'));var config=require('../../config/environment');var jayson=require(_0x4267('0x8'));var client=jayson['client'][_0x4267('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fb421,_0x21a4a8,_0x493f21){return new BPromise(function(_0x4432d9,_0x16d069){return client['request'](_0x3fb421,_0x493f21)['then'](function(_0x110fd3){logger['info'](_0x4267('0xa'),_0x21a4a8,'request\x20sent');logger[_0x4267('0xb')](_0x4267('0xc'),_0x21a4a8,'request\x20sent',JSON[_0x4267('0xd')](_0x110fd3));if(_0x110fd3[_0x4267('0xe')]){if(_0x110fd3[_0x4267('0xe')][_0x4267('0xf')]===0x1f4){logger[_0x4267('0xe')](_0x4267('0xa'),_0x21a4a8,_0x110fd3['error']['message']);return _0x16d069(_0x110fd3[_0x4267('0xe')][_0x4267('0x10')]);}logger[_0x4267('0xe')](_0x4267('0xa'),_0x21a4a8,_0x110fd3[_0x4267('0xe')]['message']);return _0x4432d9(_0x110fd3['error'][_0x4267('0x10')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x21a4a8,_0x4267('0x11'));_0x4432d9(_0x110fd3[_0x4267('0x12')][_0x4267('0x10')]);}})['catch'](function(_0x50c6c6){logger[_0x4267('0xe')](_0x4267('0xa'),_0x21a4a8,_0x50c6c6);_0x16d069(_0x50c6c6);});});} \ No newline at end of file +var _0x8428=['stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x329a5d,_0x4a886d){var _0x56d83d=function(_0x310cbc){while(--_0x310cbc){_0x329a5d['push'](_0x329a5d['shift']());}};_0x56d83d(++_0x4a886d);}(_0x8428,0xce));var _0x8842=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8428[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x8842('0x0'));var moment=require('moment');var BPromise=require(_0x8842('0x1'));var rs=require(_0x8842('0x2'));var fs=require('fs');var Redis=require(_0x8842('0x3'));var db=require(_0x8842('0x4'))['db'];var utils=require(_0x8842('0x5'));var logger=require(_0x8842('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8842('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x102cb8,_0x123263,_0x37dcb2){return new BPromise(function(_0x91c66a,_0x17a3e8){return client[_0x8842('0x8')](_0x102cb8,_0x37dcb2)[_0x8842('0x9')](function(_0x55a29e){logger[_0x8842('0xa')](_0x8842('0xb'),_0x123263,'request\x20sent');logger[_0x8842('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x123263,_0x8842('0xd'),JSON[_0x8842('0xe')](_0x55a29e));if(_0x55a29e[_0x8842('0xf')]){if(_0x55a29e['error'][_0x8842('0x10')]===0x1f4){logger[_0x8842('0xf')](_0x8842('0xb'),_0x123263,_0x55a29e[_0x8842('0xf')][_0x8842('0x11')]);return _0x17a3e8(_0x55a29e[_0x8842('0xf')][_0x8842('0x11')]);}logger[_0x8842('0xf')](_0x8842('0xb'),_0x123263,_0x55a29e[_0x8842('0xf')][_0x8842('0x11')]);return _0x91c66a(_0x55a29e[_0x8842('0xf')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x123263,_0x8842('0xd'));_0x91c66a(_0x55a29e[_0x8842('0x12')][_0x8842('0x11')]);}})[_0x8842('0x13')](function(_0x3a5026){logger['error'](_0x8842('0xb'),_0x123263,_0x3a5026);_0x17a3e8(_0x3a5026);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8c962ea..e3323f8 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 _0x1e95=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','get','show','isAuthenticated','put','/:id','update','delete'];(function(_0x3eb24c,_0x33a655){var _0x18ed54=function(_0x1f96eb){while(--_0x1f96eb){_0x3eb24c['push'](_0x3eb24c['shift']());}};_0x18ed54(++_0x33a655);}(_0x1e95,0x122));var _0x51e9=function(_0x29635d,_0x272a16){_0x29635d=_0x29635d-0x0;var _0x5f2a9b=_0x1e95[_0x29635d];return _0x5f2a9b;};'use strict';var multer=require('multer');var util=require(_0x51e9('0x0'));var path=require(_0x51e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x51e9('0x2'));var router=express[_0x51e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x51e9('0x4'));var interaction=require(_0x51e9('0x5'));var config=require(_0x51e9('0x6'));var controller=require(_0x51e9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x51e9('0x8')]);router[_0x51e9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x51e9('0xa')]);router['post']('/',auth[_0x51e9('0xb')](),controller['create']);router[_0x51e9('0xc')](_0x51e9('0xd'),auth['isAuthenticated'](),controller[_0x51e9('0xe')]);router[_0x51e9('0xf')](_0x51e9('0xd'),auth[_0x51e9('0xb')](),controller['destroy']);module[_0x51e9('0x10')]=router; \ No newline at end of file +var _0x3611=['isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4c5ed6,_0x1e0877){var _0x1dbeba=function(_0x53c83f){while(--_0x53c83f){_0x4c5ed6['push'](_0x4c5ed6['shift']());}};_0x1dbeba(++_0x1e0877);}(_0x3611,0xf3));var _0x1361=function(_0x1c40a0,_0x454d78){_0x1c40a0=_0x1c40a0-0x0;var _0x1b0c56=_0x3611[_0x1c40a0];return _0x1b0c56;};'use strict';var multer=require(_0x1361('0x0'));var util=require(_0x1361('0x1'));var path=require('path');var timeout=require(_0x1361('0x2'));var express=require('express');var router=express[_0x1361('0x3')]();var fs_extra=require(_0x1361('0x4'));var auth=require(_0x1361('0x5'));var interaction=require(_0x1361('0x6'));var config=require(_0x1361('0x7'));var controller=require('./intVtigerField.controller');router[_0x1361('0x8')]('/',auth[_0x1361('0x9')](),controller['index']);router[_0x1361('0x8')](_0x1361('0xa'),auth[_0x1361('0x9')](),controller[_0x1361('0xb')]);router[_0x1361('0xc')]('/',auth[_0x1361('0x9')](),controller[_0x1361('0xd')]);router['put'](_0x1361('0xa'),auth[_0x1361('0x9')](),controller[_0x1361('0xe')]);router[_0x1361('0xf')](_0x1361('0xa'),auth[_0x1361('0x9')](),controller[_0x1361('0x10')]);module[_0x1361('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 146a3c4..509d766 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 _0xa22c=['ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0xa22c,0x1ae));var _0xca22=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa22c[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xca22('0x0'));module[_0xca22('0x1')]={'type':{'type':Sequelize[_0xca22('0x2')](_0xca22('0x3'),_0xca22('0x4'),'customVariable','keyValue',_0xca22('0x5')),'defaultValue':_0xca22('0x3')},'content':{'type':Sequelize[_0xca22('0x6')]},'key':{'type':Sequelize[_0xca22('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xca22('0x4'),_0xca22('0x7'))},'keyContent':{'type':Sequelize[_0xca22('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xca22('0x6')]},'customField':{'type':Sequelize[_0xca22('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca22('0x6')]}}; \ No newline at end of file +var _0xdae9=['ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x1f5d35,_0x13db91){var _0x27355a=function(_0x1a3932){while(--_0x1a3932){_0x1f5d35['push'](_0x1f5d35['shift']());}};_0x27355a(++_0x13db91);}(_0xdae9,0x16b));var _0x9dae=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xdae9[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x9dae('0x0'));module['exports']={'type':{'type':Sequelize[_0x9dae('0x1')](_0x9dae('0x2'),_0x9dae('0x3'),_0x9dae('0x4'),'keyValue','picklist'),'defaultValue':_0x9dae('0x2')},'content':{'type':Sequelize[_0x9dae('0x5')]},'key':{'type':Sequelize[_0x9dae('0x5')]},'keyType':{'type':Sequelize[_0x9dae('0x1')]('string',_0x9dae('0x3'),_0x9dae('0x4'))},'keyContent':{'type':Sequelize[_0x9dae('0x5')]},'idField':{'type':Sequelize[_0x9dae('0x5')]},'nameField':{'type':Sequelize[_0x9dae('0x5')]},'customField':{'type':Sequelize[_0x9dae('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9dae('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 81a1521..9f94280 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 _0x7d2c=['model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','VtigerField','includeAll','findAll','rows','catch','show','rawAttributes','include','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','end','error','stack','name','send','index','map','type','key','keys','query','filters','intersection'];(function(_0x9de1d6,_0x27e64c){var _0x505d57=function(_0x5400b4){while(--_0x5400b4){_0x9de1d6['push'](_0x9de1d6['shift']());}};_0x505d57(++_0x27e64c);}(_0x7d2c,0x64));var _0xc7d2=function(_0x56e2bf,_0x547d1e){_0x56e2bf=_0x56e2bf-0x0;var _0xbb9be4=_0x7d2c[_0x56e2bf];return _0xbb9be4;};'use strict';var emlformat=require(_0xc7d2('0x0'));var rimraf=require(_0xc7d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7d2('0x2'));var rp=require(_0xc7d2('0x3'));var moment=require(_0xc7d2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7d2('0x5'));var path=require(_0xc7d2('0x6'));var sox=require(_0xc7d2('0x7'));var csv=require(_0xc7d2('0x8'));var ejs=require(_0xc7d2('0x9'));var fs=require('fs');var fs_extra=require(_0xc7d2('0xa'));var _=require(_0xc7d2('0xb'));var squel=require(_0xc7d2('0xc'));var crypto=require(_0xc7d2('0xd'));var jsforce=require(_0xc7d2('0xe'));var deskjs=require(_0xc7d2('0xf'));var toCsv=require(_0xc7d2('0x8'));var querystring=require(_0xc7d2('0x10'));var Papa=require(_0xc7d2('0x11'));var Redis=require(_0xc7d2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc7d2('0x13'));var as=require(_0xc7d2('0x14'));var hardwareService=require(_0xc7d2('0x15'));var logger=require(_0xc7d2('0x16'))('api');var utils=require(_0xc7d2('0x17'));var config=require(_0xc7d2('0x18'));var licenseUtil=require(_0xc7d2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3488da,_0x5c6443){_0x5c6443=_0x5c6443||0xcc;return function(_0x23c2a3){if(_0x23c2a3){return _0x3488da[_0xc7d2('0x1a')](_0x5c6443);}return _0x3488da[_0xc7d2('0x1b')](_0x5c6443)['end']();};}function respondWithResult(_0x403c88,_0x451a2d){_0x451a2d=_0x451a2d||0xc8;return function(_0x2aa520){if(_0x2aa520){return _0x403c88['status'](_0x451a2d)[_0xc7d2('0x1c')](_0x2aa520);}};}function respondWithFilteredResult(_0x2fa35f,_0x134263){return function(_0x2e07ea){if(_0x2e07ea){var _0xd8d66d=typeof _0x134263[_0xc7d2('0x1d')]===_0xc7d2('0x1e')&&typeof _0x134263[_0xc7d2('0x1f')]===_0xc7d2('0x1e');var _0x17698e=_0x2e07ea['count'];var _0xc1a4c7=_0xd8d66d?0x0:_0x134263[_0xc7d2('0x1d')];var _0x3880f4=_0xd8d66d?_0x2e07ea[_0xc7d2('0x20')]:_0x134263[_0xc7d2('0x1d')]+_0x134263[_0xc7d2('0x1f')];var _0x3821aa;if(_0x3880f4>=_0x17698e){_0x3880f4=_0x17698e;_0x3821aa=0xc8;}else{_0x3821aa=0xce;}_0x2fa35f[_0xc7d2('0x1b')](_0x3821aa);return _0x2fa35f['set']('Content-Range',_0xc1a4c7+'-'+_0x3880f4+'/'+_0x17698e)['json'](_0x2e07ea);}return null;};}function patchUpdates(_0x4e831d){return function(_0x255b4f){try{jsonpatch['apply'](_0x255b4f,_0x4e831d,!![]);}catch(_0x3e57dd){return BPromise[_0xc7d2('0x21')](_0x3e57dd);}return _0x255b4f[_0xc7d2('0x22')]();};}function saveUpdates(_0x31418a,_0x2b191e){return function(_0x4daa6c){if(_0x4daa6c){return _0x4daa6c[_0xc7d2('0x23')](_0x31418a)[_0xc7d2('0x24')](function(_0x31c966){return _0x31c966;});}return null;};}function removeEntity(_0x32a853,_0x458acf){return function(_0x179a13){if(_0x179a13){return _0x179a13['destroy']()['then'](function(){_0x32a853['status'](0xcc)[_0xc7d2('0x25')]();});}};}function handleEntityNotFound(_0x41954a,_0x4b1f45){return function(_0x33cd55){if(!_0x33cd55){_0x41954a[_0xc7d2('0x1a')](0x194);}return _0x33cd55;};}function handleError(_0x5e5093,_0x22319c){_0x22319c=_0x22319c||0x1f4;return function(_0x3e6756){logger[_0xc7d2('0x26')](_0x3e6756[_0xc7d2('0x27')]);if(_0x3e6756[_0xc7d2('0x28')]){delete _0x3e6756[_0xc7d2('0x28')];}_0x5e5093[_0xc7d2('0x1b')](_0x22319c)[_0xc7d2('0x29')](_0x3e6756);};}exports[_0xc7d2('0x2a')]=function(_0x5c021c,_0x25d374){var _0x27fece={},_0x8e546e={},_0x277150={'count':0x0,'rows':[]};var _0x68dd60=_[_0xc7d2('0x2b')](db['VtigerField']['rawAttributes'],function(_0x4a3dbe){return{'name':_0x4a3dbe['fieldName'],'type':_0x4a3dbe[_0xc7d2('0x2c')][_0xc7d2('0x2d')]};});_0x8e546e['model']=_[_0xc7d2('0x2b')](_0x68dd60,_0xc7d2('0x28'));_0x8e546e['query']=_[_0xc7d2('0x2e')](_0x5c021c[_0xc7d2('0x2f')]);_0x8e546e[_0xc7d2('0x30')]=_[_0xc7d2('0x31')](_0x8e546e[_0xc7d2('0x32')],_0x8e546e[_0xc7d2('0x2f')]);_0x27fece['attributes']=_[_0xc7d2('0x31')](_0x8e546e[_0xc7d2('0x32')],qs[_0xc7d2('0x33')](_0x5c021c[_0xc7d2('0x2f')]['fields']));_0x27fece[_0xc7d2('0x34')]=_0x27fece[_0xc7d2('0x34')][_0xc7d2('0x35')]?_0x27fece['attributes']:_0x8e546e[_0xc7d2('0x32')];if(!_0x5c021c[_0xc7d2('0x2f')]['hasOwnProperty'](_0xc7d2('0x36'))){_0x27fece[_0xc7d2('0x1f')]=qs[_0xc7d2('0x1f')](_0x5c021c['query'][_0xc7d2('0x1f')]);_0x27fece[_0xc7d2('0x1d')]=qs[_0xc7d2('0x1d')](_0x5c021c['query'][_0xc7d2('0x1d')]);}_0x27fece[_0xc7d2('0x37')]=qs[_0xc7d2('0x38')](_0x5c021c[_0xc7d2('0x2f')][_0xc7d2('0x38')]);_0x27fece[_0xc7d2('0x39')]=qs[_0xc7d2('0x30')](_[_0xc7d2('0x3a')](_0x5c021c['query'],_0x8e546e[_0xc7d2('0x30')]),_0x68dd60);if(_0x5c021c[_0xc7d2('0x2f')][_0xc7d2('0x3b')]){_0x27fece[_0xc7d2('0x39')]=_['merge'](_0x27fece['where'],{'$or':_['map'](_0x68dd60,function(_0x37e9df){if(_0x37e9df[_0xc7d2('0x2c')]!==_0xc7d2('0x3c')){var _0x59a0b5={};_0x59a0b5[_0x37e9df[_0xc7d2('0x28')]]={'$like':'%'+_0x5c021c[_0xc7d2('0x2f')][_0xc7d2('0x3b')]+'%'};return _0x59a0b5;}})});}_0x27fece=_['merge']({},_0x27fece,_0x5c021c[_0xc7d2('0x3d')]);var _0x338795={'where':_0x27fece[_0xc7d2('0x39')]};return db[_0xc7d2('0x3e')][_0xc7d2('0x20')](_0x338795)[_0xc7d2('0x24')](function(_0x529e23){_0x277150[_0xc7d2('0x20')]=_0x529e23;if(_0x5c021c[_0xc7d2('0x2f')][_0xc7d2('0x3f')]){_0x27fece['include']=[{'all':!![]}];}return db[_0xc7d2('0x3e')][_0xc7d2('0x40')](_0x27fece);})['then'](function(_0x1e5471){_0x277150[_0xc7d2('0x41')]=_0x1e5471;return _0x277150;})[_0xc7d2('0x24')](respondWithFilteredResult(_0x25d374,_0x27fece))[_0xc7d2('0x42')](handleError(_0x25d374,null));};exports[_0xc7d2('0x43')]=function(_0x1c0897,_0x210a41){var _0x49b752={'raw':!![],'where':{'id':_0x1c0897['params']['id']}},_0x2a4e11={};_0x2a4e11['model']=_[_0xc7d2('0x2e')](db['VtigerField'][_0xc7d2('0x44')]);_0x2a4e11[_0xc7d2('0x2f')]=_[_0xc7d2('0x2e')](_0x1c0897['query']);_0x2a4e11['filters']=_[_0xc7d2('0x31')](_0x2a4e11[_0xc7d2('0x32')],_0x2a4e11[_0xc7d2('0x2f')]);_0x49b752['attributes']=_[_0xc7d2('0x31')](_0x2a4e11[_0xc7d2('0x32')],qs[_0xc7d2('0x33')](_0x1c0897[_0xc7d2('0x2f')][_0xc7d2('0x33')]));_0x49b752[_0xc7d2('0x34')]=_0x49b752[_0xc7d2('0x34')][_0xc7d2('0x35')]?_0x49b752[_0xc7d2('0x34')]:_0x2a4e11[_0xc7d2('0x32')];if(_0x1c0897['query'][_0xc7d2('0x3f')]){_0x49b752[_0xc7d2('0x45')]=[{'all':!![]}];}_0x49b752=_[_0xc7d2('0x46')]({},_0x49b752,_0x1c0897[_0xc7d2('0x3d')]);return db[_0xc7d2('0x3e')][_0xc7d2('0x47')](_0x49b752)[_0xc7d2('0x24')](handleEntityNotFound(_0x210a41,null))[_0xc7d2('0x24')](respondWithResult(_0x210a41,null))[_0xc7d2('0x42')](handleError(_0x210a41,null));};exports['create']=function(_0x396c31,_0x54a054){return db[_0xc7d2('0x3e')][_0xc7d2('0x48')](_0x396c31[_0xc7d2('0x49')],{})[_0xc7d2('0x24')](respondWithResult(_0x54a054,0xc9))[_0xc7d2('0x42')](handleError(_0x54a054,null));};exports['update']=function(_0x37f4c2,_0x159a0b){if(_0x37f4c2['body']['id']){delete _0x37f4c2[_0xc7d2('0x49')]['id'];}return db['VtigerField'][_0xc7d2('0x47')]({'where':{'id':_0x37f4c2['params']['id']}})[_0xc7d2('0x24')](handleEntityNotFound(_0x159a0b,null))['then'](saveUpdates(_0x37f4c2['body'],null))[_0xc7d2('0x24')](respondWithResult(_0x159a0b,null))[_0xc7d2('0x42')](handleError(_0x159a0b,null));};exports[_0xc7d2('0x4a')]=function(_0x4c4ae2,_0xf7479c){return db[_0xc7d2('0x3e')][_0xc7d2('0x47')]({'where':{'id':_0x4c4ae2['params']['id']}})[_0xc7d2('0x24')](handleEntityNotFound(_0xf7479c,null))[_0xc7d2('0x24')](removeEntity(_0xf7479c,null))[_0xc7d2('0x42')](handleError(_0xf7479c,null));}; \ No newline at end of file +var _0x7204=['catch','show','params','length','includeAll','include','find','create','body','update','eml-format','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','json','apply','reject','then','destroy','send','map','VtigerField','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows'];(function(_0x42274f,_0x37715f){var _0x11d221=function(_0x2dc054){while(--_0x2dc054){_0x42274f['push'](_0x42274f['shift']());}};_0x11d221(++_0x37715f);}(_0x7204,0x17c));var _0x4720=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7204[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4720('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4720('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4720('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4720('0x3'));var util=require('util');var path=require(_0x4720('0x4'));var sox=require(_0x4720('0x5'));var csv=require(_0x4720('0x6'));var ejs=require(_0x4720('0x7'));var fs=require('fs');var fs_extra=require(_0x4720('0x8'));var _=require(_0x4720('0x9'));var squel=require(_0x4720('0xa'));var crypto=require(_0x4720('0xb'));var jsforce=require(_0x4720('0xc'));var deskjs=require(_0x4720('0xd'));var toCsv=require(_0x4720('0x6'));var querystring=require(_0x4720('0xe'));var Papa=require('papaparse');var Redis=require(_0x4720('0xf'));var authService=require(_0x4720('0x10'));var qs=require(_0x4720('0x11'));var as=require(_0x4720('0x12'));var hardwareService=require(_0x4720('0x13'));var logger=require(_0x4720('0x14'))(_0x4720('0x15'));var utils=require(_0x4720('0x16'));var config=require(_0x4720('0x17'));var licenseUtil=require(_0x4720('0x18'));var db=require(_0x4720('0x19'))['db'];function respondWithStatusCode(_0x4a6113,_0x2a4107){_0x2a4107=_0x2a4107||0xcc;return function(_0x24708d){if(_0x24708d){return _0x4a6113[_0x4720('0x1a')](_0x2a4107);}return _0x4a6113['status'](_0x2a4107)[_0x4720('0x1b')]();};}function respondWithResult(_0x185147,_0x7f6783){_0x7f6783=_0x7f6783||0xc8;return function(_0x322715){if(_0x322715){return _0x185147[_0x4720('0x1c')](_0x7f6783)['json'](_0x322715);}};}function respondWithFilteredResult(_0x5caa08,_0x44b031){return function(_0x1ad31f){if(_0x1ad31f){var _0x17e106=typeof _0x44b031[_0x4720('0x1d')]===_0x4720('0x1e')&&typeof _0x44b031['limit']==='undefined';var _0x284f4f=_0x1ad31f[_0x4720('0x1f')];var _0x44cb09=_0x17e106?0x0:_0x44b031[_0x4720('0x1d')];var _0x46a5e6=_0x17e106?_0x1ad31f[_0x4720('0x1f')]:_0x44b031[_0x4720('0x1d')]+_0x44b031[_0x4720('0x20')];var _0x21d085;if(_0x46a5e6>=_0x284f4f){_0x46a5e6=_0x284f4f;_0x21d085=0xc8;}else{_0x21d085=0xce;}_0x5caa08[_0x4720('0x1c')](_0x21d085);return _0x5caa08['set']('Content-Range',_0x44cb09+'-'+_0x46a5e6+'/'+_0x284f4f)[_0x4720('0x21')](_0x1ad31f);}return null;};}function patchUpdates(_0x52f44e){return function(_0x259937){try{jsonpatch[_0x4720('0x22')](_0x259937,_0x52f44e,!![]);}catch(_0x2e5c11){return BPromise[_0x4720('0x23')](_0x2e5c11);}return _0x259937['save']();};}function saveUpdates(_0x45c36e,_0x300edf){return function(_0x343533){if(_0x343533){return _0x343533['update'](_0x45c36e)[_0x4720('0x24')](function(_0x549e93){return _0x549e93;});}return null;};}function removeEntity(_0x1f7b7a,_0x11ee04){return function(_0x564f3c){if(_0x564f3c){return _0x564f3c[_0x4720('0x25')]()[_0x4720('0x24')](function(){_0x1f7b7a[_0x4720('0x1c')](0xcc)[_0x4720('0x1b')]();});}};}function handleEntityNotFound(_0x19d96e,_0x1be484){return function(_0x5accfb){if(!_0x5accfb){_0x19d96e[_0x4720('0x1a')](0x194);}return _0x5accfb;};}function handleError(_0x5cb5f2,_0x37e3d3){_0x37e3d3=_0x37e3d3||0x1f4;return function(_0x2372cd){logger['error'](_0x2372cd['stack']);if(_0x2372cd['name']){delete _0x2372cd['name'];}_0x5cb5f2[_0x4720('0x1c')](_0x37e3d3)[_0x4720('0x26')](_0x2372cd);};}exports['index']=function(_0x49bbf3,_0x169294){var _0xd1c4bf={},_0x354935={},_0x119ece={'count':0x0,'rows':[]};var _0x2a6940=_[_0x4720('0x27')](db[_0x4720('0x28')][_0x4720('0x29')],function(_0x2beeb9){return{'name':_0x2beeb9[_0x4720('0x2a')],'type':_0x2beeb9['type'][_0x4720('0x2b')]};});_0x354935[_0x4720('0x2c')]=_[_0x4720('0x27')](_0x2a6940,_0x4720('0x2d'));_0x354935[_0x4720('0x2e')]=_[_0x4720('0x2f')](_0x49bbf3['query']);_0x354935[_0x4720('0x30')]=_[_0x4720('0x31')](_0x354935[_0x4720('0x2c')],_0x354935['query']);_0xd1c4bf[_0x4720('0x32')]=_['intersection'](_0x354935['model'],qs[_0x4720('0x33')](_0x49bbf3[_0x4720('0x2e')][_0x4720('0x33')]));_0xd1c4bf['attributes']=_0xd1c4bf[_0x4720('0x32')]['length']?_0xd1c4bf[_0x4720('0x32')]:_0x354935[_0x4720('0x2c')];if(!_0x49bbf3[_0x4720('0x2e')][_0x4720('0x34')](_0x4720('0x35'))){_0xd1c4bf[_0x4720('0x20')]=qs[_0x4720('0x20')](_0x49bbf3[_0x4720('0x2e')][_0x4720('0x20')]);_0xd1c4bf[_0x4720('0x1d')]=qs[_0x4720('0x1d')](_0x49bbf3[_0x4720('0x2e')][_0x4720('0x1d')]);}_0xd1c4bf[_0x4720('0x36')]=qs['sort'](_0x49bbf3[_0x4720('0x2e')][_0x4720('0x37')]);_0xd1c4bf[_0x4720('0x38')]=qs[_0x4720('0x30')](_[_0x4720('0x39')](_0x49bbf3[_0x4720('0x2e')],_0x354935[_0x4720('0x30')]),_0x2a6940);if(_0x49bbf3[_0x4720('0x2e')][_0x4720('0x3a')]){_0xd1c4bf[_0x4720('0x38')]=_[_0x4720('0x3b')](_0xd1c4bf[_0x4720('0x38')],{'$or':_['map'](_0x2a6940,function(_0x1144ae){if(_0x1144ae[_0x4720('0x3c')]!==_0x4720('0x3d')){var _0x4d4aad={};_0x4d4aad[_0x1144ae[_0x4720('0x2d')]]={'$like':'%'+_0x49bbf3[_0x4720('0x2e')]['filter']+'%'};return _0x4d4aad;}})});}_0xd1c4bf=_[_0x4720('0x3b')]({},_0xd1c4bf,_0x49bbf3['options']);var _0x528e2c={'where':_0xd1c4bf[_0x4720('0x38')]};return db[_0x4720('0x28')][_0x4720('0x1f')](_0x528e2c)['then'](function(_0x5a2331){_0x119ece[_0x4720('0x1f')]=_0x5a2331;if(_0x49bbf3[_0x4720('0x2e')]['includeAll']){_0xd1c4bf['include']=[{'all':!![]}];}return db[_0x4720('0x28')][_0x4720('0x3e')](_0xd1c4bf);})[_0x4720('0x24')](function(_0x25d40c){_0x119ece[_0x4720('0x3f')]=_0x25d40c;return _0x119ece;})[_0x4720('0x24')](respondWithFilteredResult(_0x169294,_0xd1c4bf))[_0x4720('0x40')](handleError(_0x169294,null));};exports[_0x4720('0x41')]=function(_0x30082b,_0x333540){var _0xc4517d={'raw':!![],'where':{'id':_0x30082b[_0x4720('0x42')]['id']}},_0x2e21da={};_0x2e21da[_0x4720('0x2c')]=_[_0x4720('0x2f')](db['VtigerField']['rawAttributes']);_0x2e21da['query']=_[_0x4720('0x2f')](_0x30082b[_0x4720('0x2e')]);_0x2e21da[_0x4720('0x30')]=_['intersection'](_0x2e21da[_0x4720('0x2c')],_0x2e21da[_0x4720('0x2e')]);_0xc4517d[_0x4720('0x32')]=_[_0x4720('0x31')](_0x2e21da[_0x4720('0x2c')],qs[_0x4720('0x33')](_0x30082b[_0x4720('0x2e')][_0x4720('0x33')]));_0xc4517d['attributes']=_0xc4517d[_0x4720('0x32')][_0x4720('0x43')]?_0xc4517d[_0x4720('0x32')]:_0x2e21da[_0x4720('0x2c')];if(_0x30082b[_0x4720('0x2e')][_0x4720('0x44')]){_0xc4517d[_0x4720('0x45')]=[{'all':!![]}];}_0xc4517d=_[_0x4720('0x3b')]({},_0xc4517d,_0x30082b['options']);return db[_0x4720('0x28')][_0x4720('0x46')](_0xc4517d)[_0x4720('0x24')](handleEntityNotFound(_0x333540,null))[_0x4720('0x24')](respondWithResult(_0x333540,null))['catch'](handleError(_0x333540,null));};exports[_0x4720('0x47')]=function(_0x37e8ee,_0x309d4e){return db['VtigerField'][_0x4720('0x47')](_0x37e8ee[_0x4720('0x48')],{})[_0x4720('0x24')](respondWithResult(_0x309d4e,0xc9))['catch'](handleError(_0x309d4e,null));};exports[_0x4720('0x49')]=function(_0x13259b,_0x34293b){if(_0x13259b[_0x4720('0x48')]['id']){delete _0x13259b[_0x4720('0x48')]['id'];}return db[_0x4720('0x28')][_0x4720('0x46')]({'where':{'id':_0x13259b[_0x4720('0x42')]['id']}})[_0x4720('0x24')](handleEntityNotFound(_0x34293b,null))[_0x4720('0x24')](saveUpdates(_0x13259b[_0x4720('0x48')],null))[_0x4720('0x24')](respondWithResult(_0x34293b,null))[_0x4720('0x40')](handleError(_0x34293b,null));};exports['destroy']=function(_0x50274d,_0x3a9af3){return db[_0x4720('0x28')][_0x4720('0x46')]({'where':{'id':_0x50274d[_0x4720('0x42')]['id']}})[_0x4720('0x24')](handleEntityNotFound(_0x3a9af3,null))[_0x4720('0x24')](removeEntity(_0x3a9af3,null))[_0x4720('0x40')](handleError(_0x3a9af3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 9987726..9e8f8fc 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 _0x0e3a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId'];(function(_0xfff039,_0x18b801){var _0x44365f=function(_0x3d7f14){while(--_0x3d7f14){_0xfff039['push'](_0xfff039['shift']());}};_0x44365f(++_0x18b801);}(_0x0e3a,0x78));var _0xa0e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e3a[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xa0e3('0x0'));var logger=require('../../config/logger')(_0xa0e3('0x1'));var moment=require(_0xa0e3('0x2'));var BPromise=require(_0xa0e3('0x3'));var rp=require(_0xa0e3('0x4'));var fs=require('fs');var path=require(_0xa0e3('0x5'));var rimraf=require(_0xa0e3('0x6'));var config=require(_0xa0e3('0x7'));var attributes=require(_0xa0e3('0x8'));module[_0xa0e3('0x9')]=function(_0x1014e0,_0x5cca6f){return _0x1014e0[_0xa0e3('0xa')]('VtigerField',attributes,{'tableName':_0xa0e3('0xb'),'paranoid':![],'indexes':[{'name':_0xa0e3('0xc'),'fields':[_0xa0e3('0xd'),_0xa0e3('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xede8=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields'];(function(_0x2e6d7f,_0x27bf54){var _0x485856=function(_0x4da6fd){while(--_0x4da6fd){_0x2e6d7f['push'](_0x2e6d7f['shift']());}};_0x485856(++_0x27bf54);}(_0xede8,0x1e3));var _0x8ede=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xede8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8ede('0x0'));var util=require(_0x8ede('0x1'));var logger=require(_0x8ede('0x2'))(_0x8ede('0x3'));var moment=require(_0x8ede('0x4'));var BPromise=require(_0x8ede('0x5'));var rp=require(_0x8ede('0x6'));var fs=require('fs');var path=require(_0x8ede('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ede('0x8'));module['exports']=function(_0x48ca60,_0x4f74c1){return _0x48ca60[_0x8ede('0x9')](_0x8ede('0xa'),attributes,{'tableName':_0x8ede('0xb'),'paranoid':![],'indexes':[{'name':_0x8ede('0xc'),'fields':[_0x8ede('0xd'),_0x8ede('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 6772a81..fc17a41 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 _0xb6a5=['message','info','catch','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0xb6a5,0x7b));var _0x5b6a=function(_0xa1cd61,_0x1cbf89){_0xa1cd61=_0xa1cd61-0x0;var _0x4807fc=_0xb6a5[_0xa1cd61];return _0x4807fc;};'use strict';var _=require('lodash');var util=require(_0x5b6a('0x0'));var moment=require(_0x5b6a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b6a('0x2'))['db'];var utils=require(_0x5b6a('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x5b6a('0x4'));var jayson=require(_0x5b6a('0x5'));var client=jayson[_0x5b6a('0x6')][_0x5b6a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28223e,_0x136b50,_0xcc3db){return new BPromise(function(_0x812619,_0x4a6cd0){return client[_0x5b6a('0x8')](_0x28223e,_0xcc3db)[_0x5b6a('0x9')](function(_0x505d36){logger['info'](_0x5b6a('0xa'),_0x136b50,_0x5b6a('0xb'));logger[_0x5b6a('0xc')](_0x5b6a('0xd'),_0x136b50,_0x5b6a('0xb'),JSON[_0x5b6a('0xe')](_0x505d36));if(_0x505d36[_0x5b6a('0xf')]){if(_0x505d36[_0x5b6a('0xf')][_0x5b6a('0x10')]===0x1f4){logger[_0x5b6a('0xf')](_0x5b6a('0xa'),_0x136b50,_0x505d36[_0x5b6a('0xf')][_0x5b6a('0x11')]);return _0x4a6cd0(_0x505d36[_0x5b6a('0xf')]['message']);}logger[_0x5b6a('0xf')](_0x5b6a('0xa'),_0x136b50,_0x505d36['error'][_0x5b6a('0x11')]);return _0x812619(_0x505d36[_0x5b6a('0xf')][_0x5b6a('0x11')]);}else{logger[_0x5b6a('0x12')](_0x5b6a('0xa'),_0x136b50,_0x5b6a('0xb'));_0x812619(_0x505d36['result'][_0x5b6a('0x11')]);}})[_0x5b6a('0x13')](function(_0x9e4a92){logger[_0x5b6a('0xf')](_0x5b6a('0xa'),_0x136b50,_0x9e4a92);_0x4a6cd0(_0x9e4a92);});});} \ No newline at end of file +var _0x6e6a=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s'];(function(_0xdaf736,_0xd8c667){var _0x1090b3=function(_0x2eab2e){while(--_0x2eab2e){_0xdaf736['push'](_0xdaf736['shift']());}};_0x1090b3(++_0xd8c667);}(_0x6e6a,0xf0));var _0xa6e6=function(_0x4af45b,_0xd516c6){_0x4af45b=_0x4af45b-0x0;var _0x3e1935=_0x6e6a[_0x4af45b];return _0x3e1935;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa6e6('0x0'));var BPromise=require(_0xa6e6('0x1'));var rs=require(_0xa6e6('0x2'));var fs=require('fs');var Redis=require(_0xa6e6('0x3'));var db=require(_0xa6e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6e6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6e6('0x6'));var client=jayson[_0xa6e6('0x7')][_0xa6e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ecd64,_0x12d145,_0x9d9f5e){return new BPromise(function(_0x43225b,_0x5d5c4c){return client[_0xa6e6('0x9')](_0x4ecd64,_0x9d9f5e)[_0xa6e6('0xa')](function(_0x558797){logger['info'](_0xa6e6('0xb'),_0x12d145,_0xa6e6('0xc'));logger[_0xa6e6('0xd')](_0xa6e6('0xe'),_0x12d145,'request\x20sent',JSON[_0xa6e6('0xf')](_0x558797));if(_0x558797[_0xa6e6('0x10')]){if(_0x558797[_0xa6e6('0x10')][_0xa6e6('0x11')]===0x1f4){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x5d5c4c(_0x558797[_0xa6e6('0x10')]['message']);}logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x43225b(_0x558797['error'][_0xa6e6('0x12')]);}else{logger[_0xa6e6('0x13')](_0xa6e6('0xb'),_0x12d145,'request\x20sent');_0x43225b(_0x558797['result'][_0xa6e6('0x12')]);}})[_0xa6e6('0x14')](function(_0x21d4c0){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x21d4c0);_0x5d5c4c(_0x21d4c0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ef17af2..cb0c42e 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 _0x7fe0=['/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','get','/:id','show'];(function(_0x3be126,_0x53ddd9){var _0x34533a=function(_0x1ee885){while(--_0x1ee885){_0x3be126['push'](_0x3be126['shift']());}};_0x34533a(++_0x53ddd9);}(_0x7fe0,0x198));var _0x07fe=function(_0x302745,_0x22e4e7){_0x302745=_0x302745-0x0;var _0x584c6e=_0x7fe0[_0x302745];return _0x584c6e;};'use strict';var multer=require(_0x07fe('0x0'));var util=require(_0x07fe('0x1'));var path=require(_0x07fe('0x2'));var timeout=require(_0x07fe('0x3'));var express=require(_0x07fe('0x4'));var router=express[_0x07fe('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x07fe('0x6'));var config=require('../../config/environment');var controller=require(_0x07fe('0x7'));router['get']('/',auth[_0x07fe('0x8')](),controller['index']);router[_0x07fe('0x9')](_0x07fe('0xa'),auth[_0x07fe('0x8')](),controller[_0x07fe('0xb')]);router[_0x07fe('0x9')](_0x07fe('0xc'),auth[_0x07fe('0x8')](),controller[_0x07fe('0xd')]);router[_0x07fe('0x9')]('/:id/fields',auth[_0x07fe('0x8')](),controller[_0x07fe('0xe')]);router[_0x07fe('0xf')]('/',auth[_0x07fe('0x8')](),controller[_0x07fe('0x10')]);router['post'](_0x07fe('0xc'),auth[_0x07fe('0x8')](),controller[_0x07fe('0x11')]);router['put'](_0x07fe('0xa'),auth[_0x07fe('0x8')](),controller[_0x07fe('0x12')]);router[_0x07fe('0x13')](_0x07fe('0xa'),auth[_0x07fe('0x8')](),controller['destroy']);module[_0x07fe('0x14')]=router; \ No newline at end of file +var _0x8afb=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x8afb,0x172));var _0xb8af=function(_0x1668b4,_0x4055ec){_0x1668b4=_0x1668b4-0x0;var _0x3e2277=_0x8afb[_0x1668b4];return _0x3e2277;};'use strict';var multer=require('multer');var util=require(_0xb8af('0x0'));var path=require(_0xb8af('0x1'));var timeout=require(_0xb8af('0x2'));var express=require(_0xb8af('0x3'));var router=express['Router']();var fs_extra=require(_0xb8af('0x4'));var auth=require(_0xb8af('0x5'));var interaction=require(_0xb8af('0x6'));var config=require('../../config/environment');var controller=require(_0xb8af('0x7'));router['get']('/',auth[_0xb8af('0x8')](),controller[_0xb8af('0x9')]);router[_0xb8af('0xa')](_0xb8af('0xb'),auth[_0xb8af('0x8')](),controller['show']);router[_0xb8af('0xa')](_0xb8af('0xc'),auth[_0xb8af('0x8')](),controller[_0xb8af('0xd')]);router['get'](_0xb8af('0xe'),auth[_0xb8af('0x8')](),controller['getFields']);router[_0xb8af('0xf')]('/',auth[_0xb8af('0x8')](),controller[_0xb8af('0x10')]);router[_0xb8af('0xf')](_0xb8af('0xc'),auth[_0xb8af('0x8')](),controller['addConfiguration']);router[_0xb8af('0x11')](_0xb8af('0xb'),auth[_0xb8af('0x8')](),controller[_0xb8af('0x12')]);router['delete'](_0xb8af('0xb'),auth[_0xb8af('0x8')](),controller[_0xb8af('0x13')]);module[_0xb8af('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index dae9f6c..be9077b 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 _0x0120=['password','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x458109,_0x33dc5b){var _0x1cc56c=function(_0x2c7c58){while(--_0x2c7c58){_0x458109['push'](_0x458109['shift']());}};_0x1cc56c(++_0x33dc5b);}(_0x0120,0x6f));var _0x0012=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0120[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'password':{'type':Sequelize[_0x0012('0x2')]},'token':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'authType':{'type':Sequelize[_0x0012('0x5')](_0x0012('0x6'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0012('0x5')](_0x0012('0x7'),_0x0012('0x8')),'defaultValue':_0x0012('0x7')}}; \ No newline at end of file +var _0x1b9b=['newTab','sequelize','STRING','username','token','password','ENUM','integrationTab'];(function(_0x2f21d7,_0x2030a0){var _0x4ae801=function(_0x431cb7){while(--_0x431cb7){_0x2f21d7['push'](_0x2f21d7['shift']());}};_0x4ae801(++_0x2030a0);}(_0x1b9b,0x89));var _0xb1b9=function(_0x4ef8f1,_0x30f6e3){_0x4ef8f1=_0x4ef8f1-0x0;var _0x330e8e=_0x1b9b[_0x4ef8f1];return _0x330e8e;};'use strict';var Sequelize=require(_0xb1b9('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1b9('0x1')]},'description':{'type':Sequelize[_0xb1b9('0x1')]},'username':{'type':Sequelize[_0xb1b9('0x1')],'unique':_0xb1b9('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb1b9('0x1')]},'remoteUri':{'type':Sequelize[_0xb1b9('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0xb1b9('0x3')),'defaultValue':_0xb1b9('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb1b9('0x5')](_0xb1b9('0x6'),_0xb1b9('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0acf9dd..f50b673 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 _0x36ee=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','pick','options','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','token','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','zip-dir','request-promise','moment','bluebird'];(function(_0x48a258,_0x278671){var _0xe9cb95=function(_0x792608){while(--_0x792608){_0x48a258['push'](_0x48a258['shift']());}};_0xe9cb95(++_0x278671);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32981d,_0x27841e){_0x27841e=_0x27841e||0xcc;return function(_0x23abfb){if(_0x23abfb){return _0x32981d[_0xe36e('0x19')](_0x27841e);}return _0x32981d['status'](_0x27841e)[_0xe36e('0x1a')]();};}function respondWithResult(_0x521afa,_0x525155){_0x525155=_0x525155||0xc8;return function(_0x27ff47){if(_0x27ff47){return _0x521afa[_0xe36e('0x1b')](_0x525155)[_0xe36e('0x1c')](_0x27ff47);}};}function respondWithFilteredResult(_0x278135,_0xd6828e){return function(_0x924cd5){if(_0x924cd5){var _0x2096f6=typeof _0xd6828e[_0xe36e('0x1d')]===_0xe36e('0x1e')&&typeof _0xd6828e[_0xe36e('0x1f')]==='undefined';var _0x333554=_0x924cd5[_0xe36e('0x20')];var _0x56c019=_0x2096f6?0x0:_0xd6828e[_0xe36e('0x1d')];var _0x533c06=_0x2096f6?_0x924cd5[_0xe36e('0x20')]:_0xd6828e[_0xe36e('0x1d')]+_0xd6828e['limit'];var _0x472825;if(_0x533c06>=_0x333554){_0x533c06=_0x333554;_0x472825=0xc8;}else{_0x472825=0xce;}_0x278135[_0xe36e('0x1b')](_0x472825);return _0x278135[_0xe36e('0x21')]('Content-Range',_0x56c019+'-'+_0x533c06+'/'+_0x333554)[_0xe36e('0x1c')](_0x924cd5);}return null;};}function patchUpdates(_0x21bcf9){return function(_0x3f0ae3){try{jsonpatch[_0xe36e('0x22')](_0x3f0ae3,_0x21bcf9,!![]);}catch(_0x2c4e30){return BPromise[_0xe36e('0x23')](_0x2c4e30);}return _0x3f0ae3['save']();};}function saveUpdates(_0xd71137,_0x4f214a){return function(_0x23bcf3){if(_0x23bcf3){return _0x23bcf3[_0xe36e('0x24')](_0xd71137)[_0xe36e('0x25')](function(_0x53e13a){return _0x53e13a;});}return null;};}function removeEntity(_0x598a7a,_0x4749a8){return function(_0x10818d){if(_0x10818d){return _0x10818d[_0xe36e('0x26')]()[_0xe36e('0x25')](function(){_0x598a7a[_0xe36e('0x1b')](0xcc)[_0xe36e('0x1a')]();});}};}function handleEntityNotFound(_0x1a045c,_0x5ac484){return function(_0x3cafbf){if(!_0x3cafbf){_0x1a045c[_0xe36e('0x19')](0x194);}return _0x3cafbf;};}function handleError(_0x10597f,_0x262caa){_0x262caa=_0x262caa||0x1f4;return function(_0x5e58d8){logger[_0xe36e('0x27')](_0x5e58d8['stack']);if(_0x5e58d8[_0xe36e('0x28')]){delete _0x5e58d8['name'];}_0x10597f[_0xe36e('0x1b')](_0x262caa)['send'](_0x5e58d8);};}exports[_0xe36e('0x29')]=function(_0x4c5d98,_0x3b1045){var _0x59548b={},_0x4bb75b={},_0x5d8fd8={'count':0x0,'rows':[]};var _0x5b5d53=_[_0xe36e('0x2a')](db[_0xe36e('0x2b')]['rawAttributes'],function(_0x4ac819){return{'name':_0x4ac819[_0xe36e('0x2c')],'type':_0x4ac819[_0xe36e('0x2d')][_0xe36e('0x2e')]};});_0x4bb75b[_0xe36e('0x2f')]=_[_0xe36e('0x2a')](_0x5b5d53,_0xe36e('0x28'));_0x4bb75b['query']=_[_0xe36e('0x30')](_0x4c5d98[_0xe36e('0x31')]);_0x4bb75b['filters']=_[_0xe36e('0x32')](_0x4bb75b[_0xe36e('0x2f')],_0x4bb75b[_0xe36e('0x31')]);_0x59548b[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x4bb75b[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x34')]));_0x59548b[_0xe36e('0x33')]=_0x59548b[_0xe36e('0x33')]['length']?_0x59548b[_0xe36e('0x33')]:_0x4bb75b['model'];if(!_0x4c5d98['query'][_0xe36e('0x35')]('nolimit')){_0x59548b[_0xe36e('0x1f')]=qs[_0xe36e('0x1f')](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x1f')]);_0x59548b['offset']=qs['offset'](_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x1d')]);}_0x59548b[_0xe36e('0x36')]=qs[_0xe36e('0x37')](_0x4c5d98['query'][_0xe36e('0x37')]);_0x59548b[_0xe36e('0x38')]=qs[_0xe36e('0x39')](_['pick'](_0x4c5d98[_0xe36e('0x31')],_0x4bb75b[_0xe36e('0x39')]),_0x5b5d53);if(_0x4c5d98['query'][_0xe36e('0x3a')]){_0x59548b[_0xe36e('0x38')]=_[_0xe36e('0x3b')](_0x59548b[_0xe36e('0x38')],{'$or':_[_0xe36e('0x2a')](_0x5b5d53,function(_0x2fc909){if(_0x2fc909[_0xe36e('0x2d')]!==_0xe36e('0x3c')){var _0x458a4e={};_0x458a4e[_0x2fc909[_0xe36e('0x28')]]={'$like':'%'+_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x3a')]+'%'};return _0x458a4e;}})});}_0x59548b=_[_0xe36e('0x3b')]({},_0x59548b,_0x4c5d98['options']);var _0x23d36e={'where':_0x59548b[_0xe36e('0x38')]};return db[_0xe36e('0x2b')][_0xe36e('0x20')](_0x23d36e)[_0xe36e('0x25')](function(_0x4d133b){_0x5d8fd8['count']=_0x4d133b;if(_0x4c5d98[_0xe36e('0x31')][_0xe36e('0x3d')]){_0x59548b[_0xe36e('0x3e')]=[{'all':!![]}];}return db[_0xe36e('0x2b')][_0xe36e('0x3f')](_0x59548b);})[_0xe36e('0x25')](function(_0xff4f63){_0x5d8fd8[_0xe36e('0x40')]=_0xff4f63;return _0x5d8fd8;})['then'](respondWithFilteredResult(_0x3b1045,_0x59548b))[_0xe36e('0x41')](handleError(_0x3b1045,null));};exports[_0xe36e('0x42')]=function(_0x4788a0,_0x21dc35){var _0x5ef3e4={'raw':![],'where':{'id':_0x4788a0[_0xe36e('0x43')]['id']}},_0x23e344={};_0x23e344[_0xe36e('0x2f')]=_[_0xe36e('0x30')](db[_0xe36e('0x2b')]['rawAttributes']);_0x23e344[_0xe36e('0x31')]=_[_0xe36e('0x30')](_0x4788a0[_0xe36e('0x31')]);_0x23e344[_0xe36e('0x39')]=_[_0xe36e('0x32')](_0x23e344[_0xe36e('0x2f')],_0x23e344['query']);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x23e344[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x4788a0[_0xe36e('0x31')]['fields']));_0x5ef3e4[_0xe36e('0x33')]=_0x5ef3e4[_0xe36e('0x33')][_0xe36e('0x44')]?_0x5ef3e4[_0xe36e('0x33')]:_0x23e344[_0xe36e('0x2f')];if(_0x4788a0[_0xe36e('0x31')][_0xe36e('0x3d')]){_0x5ef3e4[_0xe36e('0x3e')]=[{'all':!![]}];}_0x5ef3e4=_[_0xe36e('0x3b')]({},_0x5ef3e4,_0x4788a0['options']);return db['ZendeskAccount'][_0xe36e('0x45')](_0x5ef3e4)['then'](handleEntityNotFound(_0x21dc35,null))[_0xe36e('0x25')](respondWithResult(_0x21dc35,null))[_0xe36e('0x41')](handleError(_0x21dc35,null));};exports[_0xe36e('0x46')]=function(_0x25aa09,_0x51641c){return db[_0xe36e('0x2b')][_0xe36e('0x46')](_0x25aa09['body'],{})[_0xe36e('0x25')](respondWithResult(_0x51641c,0xc9))[_0xe36e('0x41')](handleError(_0x51641c,null));};exports[_0xe36e('0x24')]=function(_0x42eae5,_0x15895d){if(_0x42eae5[_0xe36e('0x47')]['id']){delete _0x42eae5[_0xe36e('0x47')]['id'];}return db[_0xe36e('0x2b')][_0xe36e('0x45')]({'where':{'id':_0x42eae5[_0xe36e('0x43')]['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0x15895d,null))[_0xe36e('0x25')](saveUpdates(_0x42eae5[_0xe36e('0x47')],null))[_0xe36e('0x25')](respondWithResult(_0x15895d,null))[_0xe36e('0x41')](handleError(_0x15895d,null));};exports['destroy']=function(_0x3262bf,_0x55aadf){return db['ZendeskAccount'][_0xe36e('0x45')]({'where':{'id':_0x3262bf[_0xe36e('0x43')]['id']}})['then'](handleEntityNotFound(_0x55aadf,null))[_0xe36e('0x25')](removeEntity(_0x55aadf,null))[_0xe36e('0x41')](handleError(_0x55aadf,null));};exports[_0xe36e('0x48')]=function(_0x1f4a5d,_0xa4be24,_0x22788b){var _0x935e84={};var _0x41e10d={};var _0x4d5762;var _0x55d190;return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x1f4a5d['params']['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0xa4be24,null))[_0xe36e('0x25')](function(_0x3e1040){if(_0x3e1040){_0x4d5762=_0x3e1040;_0x41e10d[_0xe36e('0x2f')]=_[_0xe36e('0x30')](db['ZendeskConfiguration']['rawAttributes']);_0x41e10d['query']=_['keys'](_0x1f4a5d[_0xe36e('0x31')]);_0x41e10d[_0xe36e('0x39')]=_[_0xe36e('0x32')](_0x41e10d[_0xe36e('0x2f')],_0x41e10d[_0xe36e('0x31')]);_0x935e84[_0xe36e('0x33')]=_[_0xe36e('0x32')](_0x41e10d[_0xe36e('0x2f')],qs[_0xe36e('0x34')](_0x1f4a5d['query'][_0xe36e('0x34')]));_0x935e84[_0xe36e('0x33')]=_0x935e84['attributes'][_0xe36e('0x44')]?_0x935e84[_0xe36e('0x33')]:_0x41e10d[_0xe36e('0x2f')];_0x935e84[_0xe36e('0x36')]=qs[_0xe36e('0x37')](_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x37')]);_0x935e84[_0xe36e('0x38')]=qs[_0xe36e('0x39')](_[_0xe36e('0x4a')](_0x1f4a5d[_0xe36e('0x31')],_0x41e10d[_0xe36e('0x39')]));if(_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x3a')]){_0x935e84[_0xe36e('0x38')]=_[_0xe36e('0x3b')](_0x935e84[_0xe36e('0x38')],{'$or':_[_0xe36e('0x2a')](_0x935e84[_0xe36e('0x33')],function(_0x3e7d8d){var _0x362204={};_0x362204[_0x3e7d8d]={'$like':'%'+_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x3a')]+'%'};return _0x362204;})});}_0x935e84=_[_0xe36e('0x3b')]({},_0x935e84,_0x1f4a5d[_0xe36e('0x4b')]);return _0x4d5762['getConfigurations'](_0x935e84);}})[_0xe36e('0x25')](function(_0xedaa96){if(_0xedaa96){_0x55d190=_0xedaa96['length'];if(!_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x35')](_0xe36e('0x4c'))){_0x935e84[_0xe36e('0x1f')]=qs[_0xe36e('0x1f')](_0x1f4a5d[_0xe36e('0x31')]['limit']);_0x935e84[_0xe36e('0x1d')]=qs['offset'](_0x1f4a5d[_0xe36e('0x31')][_0xe36e('0x1d')]);}return _0x4d5762[_0xe36e('0x48')](_0x935e84);}})[_0xe36e('0x25')](function(_0x2a767d){if(_0x2a767d){return _0x2a767d?{'count':_0x55d190,'rows':_0x2a767d}:null;}})[_0xe36e('0x25')](respondWithResult(_0xa4be24,null))[_0xe36e('0x41')](handleError(_0xa4be24,null));};exports[_0xe36e('0x4d')]=function(_0x4c8d2b,_0x34c7a5,_0xcafb87){if(_0x4c8d2b['body']['id']){delete _0x4c8d2b[_0xe36e('0x47')]['id'];}return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x4c8d2b[_0xe36e('0x43')]['id']}})[_0xe36e('0x25')](handleEntityNotFound(_0x34c7a5,null))[_0xe36e('0x25')](function(_0x3d4874){if(_0x3d4874){_0x4c8d2b['body'][_0xe36e('0x4e')]=_0x3d4874['id'];_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x4f')]=integrations[_0xe36e('0x50')](_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x51')],_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x2d')]);_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x52')]=integrations[_0xe36e('0x53')](_0x4c8d2b['body'][_0xe36e('0x51')],_0x4c8d2b[_0xe36e('0x47')][_0xe36e('0x2d')]);return db[_0xe36e('0x54')]['create'](_0x4c8d2b['body'],{'include':[{'model':db[_0xe36e('0x55')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xe36e('0x25')](respondWithResult(_0x34c7a5,null))['catch'](handleError(_0x34c7a5,null));};exports[_0xe36e('0x56')]=function(_0x2f7093,_0x258a63,_0x221a90){var _0x1bd60d='';return db[_0xe36e('0x2b')][_0xe36e('0x49')]({'where':{'id':_0x2f7093[_0xe36e('0x43')]['id']},'attributes':['id',_0xe36e('0x57'),'password',_0xe36e('0x58'),'authType',_0xe36e('0x59')]})['then'](handleEntityNotFound(_0x258a63,null))[_0xe36e('0x25')](function(_0x209e45){if(_0x209e45){_0x1bd60d=_0x209e45[_0xe36e('0x59')];var _0x29a372=_0x1bd60d['slice'](-0x1);if(_0x29a372==='/'){_0x1bd60d=_0x1bd60d['substring'](0x0,_0x1bd60d[_0xe36e('0x5a')](_0x29a372));}var _0x2b44a6={'method':_0xe36e('0x5b'),'uri':util[_0xe36e('0x5c')](_0xe36e('0x5d'),_0x1bd60d,_0xe36e('0x5e')),'json':!![]};switch(_0x209e45['authType']){case _0xe36e('0x5f'):_0x2b44a6[_0xe36e('0x60')]={'Authorization':util['format'](_0xe36e('0x61'),new Buffer(util['format'](_0xe36e('0x62'),_0x209e45[_0xe36e('0x57')],_0x209e45[_0xe36e('0x5f')]))[_0xe36e('0x63')]('base64'))};break;case _0xe36e('0x58'):_0x2b44a6['headers']={'Authorization':util['format'](_0xe36e('0x61'),new Buffer(util[_0xe36e('0x5c')]('%s/token:%s',_0x209e45['username'],_0x209e45[_0xe36e('0x58')]))['toString'](_0xe36e('0x64')))};break;default:throw new db[(_0xe36e('0x65'))][(_0xe36e('0x66'))](_0xe36e('0x67'));}return rp(_0x2b44a6);}})[_0xe36e('0x25')](function(_0x16c26a){if(_0x16c26a){var _0x590885=[_0xe36e('0x68'),_0xe36e('0x69'),_0xe36e('0x6a'),_0xe36e('0x6b')];_['remove'](_0x16c26a[_0xe36e('0x5e')],function(_0x37409f){return _0x590885[_0xe36e('0x6c')](_0x37409f[_0xe36e('0x2d')]);});return{'count':_0x16c26a['ticket_fields'][_0xe36e('0x44')],'rows':_['map'](_0x16c26a[_0xe36e('0x5e')],function(_0x5d3dac){return{'id':_0x5d3dac['id'],'name':_0x5d3dac[_0xe36e('0x6d')]>0x7?_0x5d3dac['title']:_0x5d3dac['type'],'custom':_0x5d3dac[_0xe36e('0x6d')]>0x7?!![]:![],'options':_0x5d3dac[_0xe36e('0x6e')]?_0x5d3dac[_0xe36e('0x6e')]:_0x5d3dac['custom_field_options']?_0x5d3dac[_0xe36e('0x6f')]:[]};})};}})[_0xe36e('0x25')](respondWithResult(_0x258a63,null))['catch'](function(_0x3beba7){var _0x369576=_0x2f7093[_0xe36e('0x31')]['test']?0x1f4:_0x3beba7['statusCode']||0x1f4;logger[_0xe36e('0x27')](_0xe36e('0x70'),_0xe36e('0x56'),_0x369576,JSON[_0xe36e('0x71')](_0x3beba7));delete _0x3beba7[_0xe36e('0x28')];if(_0x369576===0x191){_0x369576=0x190;}_0x258a63['status'](_0x369576)[_0xe36e('0x72')](_0x2f7093[_0xe36e('0x31')][_0xe36e('0x73')]?{'message':_0xe36e('0x74'),'statusCode':_0x3beba7[_0xe36e('0x75')]}:_0x3beba7);});}; \ No newline at end of file +var _0x9348=['authType','remoteUri','substring','lastIndexOf','%s/%s','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','username','token'];(function(_0x2fbbcb,_0x5cd067){var _0x5dc111=function(_0x56a813){while(--_0x56a813){_0x2fbbcb['push'](_0x2fbbcb['shift']());}};_0x5dc111(++_0x5cd067);}(_0x9348,0x10d));var _0x8934=function(_0x2d1f46,_0x548bea){_0x2d1f46=_0x2d1f46-0x0;var _0x5a6f7d=_0x9348[_0x2d1f46];return _0x5a6f7d;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x68427d,_0x108eab){_0x108eab=_0x108eab||0xcc;return function(_0x46bca5){if(_0x46bca5){return _0x68427d[_0x8934('0x19')](_0x108eab);}return _0x68427d[_0x8934('0x1a')](_0x108eab)[_0x8934('0x1b')]();};}function respondWithResult(_0x5b560f,_0x254720){_0x254720=_0x254720||0xc8;return function(_0x38230a){if(_0x38230a){return _0x5b560f[_0x8934('0x1a')](_0x254720)[_0x8934('0x1c')](_0x38230a);}};}function respondWithFilteredResult(_0x34d4dc,_0x41e6a9){return function(_0x2a5b04){if(_0x2a5b04){var _0x357cf8=typeof _0x41e6a9['offset']===_0x8934('0x1d')&&typeof _0x41e6a9[_0x8934('0x1e')]===_0x8934('0x1d');var _0x5de8f0=_0x2a5b04['count'];var _0x597eed=_0x357cf8?0x0:_0x41e6a9[_0x8934('0x1f')];var _0x51f9ed=_0x357cf8?_0x2a5b04[_0x8934('0x20')]:_0x41e6a9[_0x8934('0x1f')]+_0x41e6a9[_0x8934('0x1e')];var _0x36c3b9;if(_0x51f9ed>=_0x5de8f0){_0x51f9ed=_0x5de8f0;_0x36c3b9=0xc8;}else{_0x36c3b9=0xce;}_0x34d4dc[_0x8934('0x1a')](_0x36c3b9);return _0x34d4dc['set'](_0x8934('0x21'),_0x597eed+'-'+_0x51f9ed+'/'+_0x5de8f0)['json'](_0x2a5b04);}return null;};}function patchUpdates(_0x476c6c){return function(_0x34f4e7){try{jsonpatch[_0x8934('0x22')](_0x34f4e7,_0x476c6c,!![]);}catch(_0x379445){return BPromise[_0x8934('0x23')](_0x379445);}return _0x34f4e7[_0x8934('0x24')]();};}function saveUpdates(_0x36fe20,_0x4f4a9b){return function(_0xe763c6){if(_0xe763c6){return _0xe763c6[_0x8934('0x25')](_0x36fe20)[_0x8934('0x26')](function(_0x343e09){return _0x343e09;});}return null;};}function removeEntity(_0x43b89a,_0x5e593b){return function(_0x3cf295){if(_0x3cf295){return _0x3cf295[_0x8934('0x27')]()[_0x8934('0x26')](function(){_0x43b89a['status'](0xcc)[_0x8934('0x1b')]();});}};}function handleEntityNotFound(_0x561df2,_0x14c5f0){return function(_0x1783ce){if(!_0x1783ce){_0x561df2[_0x8934('0x19')](0x194);}return _0x1783ce;};}function handleError(_0x5ef0ed,_0x1fd5eb){_0x1fd5eb=_0x1fd5eb||0x1f4;return function(_0x15910b){logger[_0x8934('0x28')](_0x15910b[_0x8934('0x29')]);if(_0x15910b['name']){delete _0x15910b[_0x8934('0x2a')];}_0x5ef0ed[_0x8934('0x1a')](_0x1fd5eb)[_0x8934('0x2b')](_0x15910b);};}exports[_0x8934('0x2c')]=function(_0x44972b,_0x20d448){var _0x3f328a={},_0x457634={},_0x9c6a71={'count':0x0,'rows':[]};var _0x18938a=_['map'](db[_0x8934('0x2d')][_0x8934('0x2e')],function(_0x54d28d){return{'name':_0x54d28d[_0x8934('0x2f')],'type':_0x54d28d[_0x8934('0x30')][_0x8934('0x31')]};});_0x457634[_0x8934('0x32')]=_['map'](_0x18938a,_0x8934('0x2a'));_0x457634[_0x8934('0x33')]=_[_0x8934('0x34')](_0x44972b[_0x8934('0x33')]);_0x457634[_0x8934('0x35')]=_['intersection'](_0x457634[_0x8934('0x32')],_0x457634['query']);_0x3f328a['attributes']=_[_0x8934('0x36')](_0x457634[_0x8934('0x32')],qs[_0x8934('0x37')](_0x44972b[_0x8934('0x33')]['fields']));_0x3f328a[_0x8934('0x38')]=_0x3f328a[_0x8934('0x38')][_0x8934('0x39')]?_0x3f328a[_0x8934('0x38')]:_0x457634[_0x8934('0x32')];if(!_0x44972b['query'][_0x8934('0x3a')](_0x8934('0x3b'))){_0x3f328a['limit']=qs['limit'](_0x44972b[_0x8934('0x33')][_0x8934('0x1e')]);_0x3f328a['offset']=qs['offset'](_0x44972b[_0x8934('0x33')][_0x8934('0x1f')]);}_0x3f328a[_0x8934('0x3c')]=qs[_0x8934('0x3d')](_0x44972b[_0x8934('0x33')][_0x8934('0x3d')]);_0x3f328a[_0x8934('0x3e')]=qs[_0x8934('0x35')](_[_0x8934('0x3f')](_0x44972b[_0x8934('0x33')],_0x457634[_0x8934('0x35')]),_0x18938a);if(_0x44972b['query'][_0x8934('0x40')]){_0x3f328a[_0x8934('0x3e')]=_['merge'](_0x3f328a[_0x8934('0x3e')],{'$or':_[_0x8934('0x41')](_0x18938a,function(_0x414091){if(_0x414091[_0x8934('0x30')]!==_0x8934('0x42')){var _0x5b0307={};_0x5b0307[_0x414091['name']]={'$like':'%'+_0x44972b['query'][_0x8934('0x40')]+'%'};return _0x5b0307;}})});}_0x3f328a=_[_0x8934('0x43')]({},_0x3f328a,_0x44972b[_0x8934('0x44')]);var _0x53581b={'where':_0x3f328a[_0x8934('0x3e')]};return db['ZendeskAccount']['count'](_0x53581b)[_0x8934('0x26')](function(_0x1f36d0){_0x9c6a71['count']=_0x1f36d0;if(_0x44972b['query'][_0x8934('0x45')]){_0x3f328a[_0x8934('0x46')]=[{'all':!![]}];}return db[_0x8934('0x2d')]['findAll'](_0x3f328a);})[_0x8934('0x26')](function(_0x5e543c){_0x9c6a71[_0x8934('0x47')]=_0x5e543c;return _0x9c6a71;})['then'](respondWithFilteredResult(_0x20d448,_0x3f328a))[_0x8934('0x48')](handleError(_0x20d448,null));};exports[_0x8934('0x49')]=function(_0x83be9e,_0x566d67){var _0xefdfab={'raw':![],'where':{'id':_0x83be9e[_0x8934('0x4a')]['id']}},_0x350d04={};_0x350d04[_0x8934('0x32')]=_['keys'](db[_0x8934('0x2d')][_0x8934('0x2e')]);_0x350d04[_0x8934('0x33')]=_[_0x8934('0x34')](_0x83be9e[_0x8934('0x33')]);_0x350d04[_0x8934('0x35')]=_[_0x8934('0x36')](_0x350d04[_0x8934('0x32')],_0x350d04['query']);_0xefdfab['attributes']=_['intersection'](_0x350d04[_0x8934('0x32')],qs[_0x8934('0x37')](_0x83be9e['query'][_0x8934('0x37')]));_0xefdfab['attributes']=_0xefdfab[_0x8934('0x38')][_0x8934('0x39')]?_0xefdfab['attributes']:_0x350d04[_0x8934('0x32')];if(_0x83be9e[_0x8934('0x33')][_0x8934('0x45')]){_0xefdfab[_0x8934('0x46')]=[{'all':!![]}];}_0xefdfab=_['merge']({},_0xefdfab,_0x83be9e[_0x8934('0x44')]);return db[_0x8934('0x2d')]['find'](_0xefdfab)[_0x8934('0x26')](handleEntityNotFound(_0x566d67,null))[_0x8934('0x26')](respondWithResult(_0x566d67,null))[_0x8934('0x48')](handleError(_0x566d67,null));};exports[_0x8934('0x4b')]=function(_0x406d0a,_0x419e30){return db[_0x8934('0x2d')][_0x8934('0x4b')](_0x406d0a[_0x8934('0x4c')],{})[_0x8934('0x26')](respondWithResult(_0x419e30,0xc9))[_0x8934('0x48')](handleError(_0x419e30,null));};exports[_0x8934('0x25')]=function(_0x2c322d,_0x2febf5){if(_0x2c322d[_0x8934('0x4c')]['id']){delete _0x2c322d[_0x8934('0x4c')]['id'];}return db[_0x8934('0x2d')][_0x8934('0x4d')]({'where':{'id':_0x2c322d['params']['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x2febf5,null))[_0x8934('0x26')](saveUpdates(_0x2c322d['body'],null))['then'](respondWithResult(_0x2febf5,null))['catch'](handleError(_0x2febf5,null));};exports['destroy']=function(_0x3610a0,_0x15310a){return db[_0x8934('0x2d')]['find']({'where':{'id':_0x3610a0['params']['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x15310a,null))['then'](removeEntity(_0x15310a,null))['catch'](handleError(_0x15310a,null));};exports[_0x8934('0x4e')]=function(_0x2778f9,_0x173bc1,_0x334f27){var _0x21ca17={};var _0x1b66d8={};var _0x3902fb;var _0x575bd7;return db[_0x8934('0x2d')]['findOne']({'where':{'id':_0x2778f9[_0x8934('0x4a')]['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x173bc1,null))[_0x8934('0x26')](function(_0x3df31e){if(_0x3df31e){_0x3902fb=_0x3df31e;_0x1b66d8[_0x8934('0x32')]=_[_0x8934('0x34')](db[_0x8934('0x4f')][_0x8934('0x2e')]);_0x1b66d8['query']=_[_0x8934('0x34')](_0x2778f9[_0x8934('0x33')]);_0x1b66d8[_0x8934('0x35')]=_[_0x8934('0x36')](_0x1b66d8[_0x8934('0x32')],_0x1b66d8['query']);_0x21ca17[_0x8934('0x38')]=_[_0x8934('0x36')](_0x1b66d8[_0x8934('0x32')],qs['fields'](_0x2778f9[_0x8934('0x33')][_0x8934('0x37')]));_0x21ca17[_0x8934('0x38')]=_0x21ca17['attributes']['length']?_0x21ca17['attributes']:_0x1b66d8[_0x8934('0x32')];_0x21ca17[_0x8934('0x3c')]=qs[_0x8934('0x3d')](_0x2778f9['query'][_0x8934('0x3d')]);_0x21ca17[_0x8934('0x3e')]=qs['filters'](_['pick'](_0x2778f9[_0x8934('0x33')],_0x1b66d8[_0x8934('0x35')]));if(_0x2778f9[_0x8934('0x33')][_0x8934('0x40')]){_0x21ca17['where']=_['merge'](_0x21ca17['where'],{'$or':_['map'](_0x21ca17[_0x8934('0x38')],function(_0x2b8837){var _0x18d08e={};_0x18d08e[_0x2b8837]={'$like':'%'+_0x2778f9[_0x8934('0x33')][_0x8934('0x40')]+'%'};return _0x18d08e;})});}_0x21ca17=_[_0x8934('0x43')]({},_0x21ca17,_0x2778f9['options']);return _0x3902fb[_0x8934('0x4e')](_0x21ca17);}})[_0x8934('0x26')](function(_0x4991bd){if(_0x4991bd){_0x575bd7=_0x4991bd[_0x8934('0x39')];if(!_0x2778f9['query'][_0x8934('0x3a')]('nolimit')){_0x21ca17[_0x8934('0x1e')]=qs[_0x8934('0x1e')](_0x2778f9[_0x8934('0x33')][_0x8934('0x1e')]);_0x21ca17[_0x8934('0x1f')]=qs[_0x8934('0x1f')](_0x2778f9[_0x8934('0x33')]['offset']);}return _0x3902fb['getConfigurations'](_0x21ca17);}})[_0x8934('0x26')](function(_0x3a0378){if(_0x3a0378){return _0x3a0378?{'count':_0x575bd7,'rows':_0x3a0378}:null;}})[_0x8934('0x26')](respondWithResult(_0x173bc1,null))[_0x8934('0x48')](handleError(_0x173bc1,null));};exports[_0x8934('0x50')]=function(_0x18850a,_0x35c437,_0x112957){if(_0x18850a[_0x8934('0x4c')]['id']){delete _0x18850a[_0x8934('0x4c')]['id'];}return db[_0x8934('0x2d')][_0x8934('0x51')]({'where':{'id':_0x18850a[_0x8934('0x4a')]['id']}})[_0x8934('0x26')](handleEntityNotFound(_0x35c437,null))['then'](function(_0x5c2819){if(_0x5c2819){_0x18850a[_0x8934('0x4c')][_0x8934('0x52')]=_0x5c2819['id'];_0x18850a[_0x8934('0x4c')][_0x8934('0x53')]=integrations[_0x8934('0x54')](_0x18850a[_0x8934('0x4c')][_0x8934('0x55')],_0x18850a['body'][_0x8934('0x30')]);_0x18850a[_0x8934('0x4c')]['Descriptions']=integrations[_0x8934('0x56')](_0x18850a['body'][_0x8934('0x55')],_0x18850a[_0x8934('0x4c')][_0x8934('0x30')]);return db['ZendeskConfiguration'][_0x8934('0x4b')](_0x18850a[_0x8934('0x4c')],{'include':[{'model':db['ZendeskField'],'as':_0x8934('0x53')},{'model':db['ZendeskField'],'as':_0x8934('0x57')}]});}return null;})['then'](respondWithResult(_0x35c437,null))[_0x8934('0x48')](handleError(_0x35c437,null));};exports[_0x8934('0x58')]=function(_0x24b0ce,_0x5ea4fe,_0x196372){var _0xfbad9='';return db[_0x8934('0x2d')][_0x8934('0x51')]({'where':{'id':_0x24b0ce['params']['id']},'attributes':['id',_0x8934('0x59'),'password',_0x8934('0x5a'),_0x8934('0x5b'),_0x8934('0x5c')]})[_0x8934('0x26')](handleEntityNotFound(_0x5ea4fe,null))['then'](function(_0xc2799d){if(_0xc2799d){_0xfbad9=_0xc2799d[_0x8934('0x5c')];var _0xd880ba=_0xfbad9['slice'](-0x1);if(_0xd880ba==='/'){_0xfbad9=_0xfbad9[_0x8934('0x5d')](0x0,_0xfbad9[_0x8934('0x5e')](_0xd880ba));}var _0x2acd18={'method':'GET','uri':util['format'](_0x8934('0x5f'),_0xfbad9,_0x8934('0x60')),'json':!![]};switch(_0xc2799d[_0x8934('0x5b')]){case _0x8934('0x61'):_0x2acd18[_0x8934('0x62')]={'Authorization':util[_0x8934('0x63')](_0x8934('0x64'),new Buffer(util[_0x8934('0x63')](_0x8934('0x65'),_0xc2799d['username'],_0xc2799d[_0x8934('0x61')]))[_0x8934('0x66')](_0x8934('0x67')))};break;case _0x8934('0x5a'):_0x2acd18[_0x8934('0x62')]={'Authorization':util['format'](_0x8934('0x64'),new Buffer(util[_0x8934('0x63')]('%s/token:%s',_0xc2799d[_0x8934('0x59')],_0xc2799d['token']))['toString']('base64'))};break;default:throw new db[(_0x8934('0x68'))][(_0x8934('0x69'))](_0x8934('0x6a'));}return rp(_0x2acd18);}})['then'](function(_0x2c289b){if(_0x2c289b){var _0x1d3372=['subject',_0x8934('0x6b'),_0x8934('0x6c'),_0x8934('0x6d')];_[_0x8934('0x6e')](_0x2c289b[_0x8934('0x60')],function(_0x324722){return _0x1d3372[_0x8934('0x6f')](_0x324722[_0x8934('0x30')]);});return{'count':_0x2c289b[_0x8934('0x60')][_0x8934('0x39')],'rows':_['map'](_0x2c289b[_0x8934('0x60')],function(_0x31e7d1){return{'id':_0x31e7d1['id'],'name':_0x31e7d1[_0x8934('0x70')]>0x7?_0x31e7d1[_0x8934('0x71')]:_0x31e7d1[_0x8934('0x30')],'custom':_0x31e7d1[_0x8934('0x70')]>0x7?!![]:![],'options':_0x31e7d1[_0x8934('0x72')]?_0x31e7d1['system_field_options']:_0x31e7d1[_0x8934('0x73')]?_0x31e7d1[_0x8934('0x73')]:[]};})};}})[_0x8934('0x26')](respondWithResult(_0x5ea4fe,null))[_0x8934('0x48')](function(_0x9de459){var _0xdf0ab2=_0x24b0ce[_0x8934('0x33')][_0x8934('0x74')]?0x1f4:_0x9de459[_0x8934('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8934('0x58'),_0xdf0ab2,JSON[_0x8934('0x76')](_0x9de459));delete _0x9de459['name'];if(_0xdf0ab2===0x191){_0xdf0ab2=0x190;}_0x5ea4fe[_0x8934('0x1a')](_0xdf0ab2)[_0x8934('0x2b')](_0x24b0ce[_0x8934('0x33')][_0x8934('0x74')]?{'message':_0x8934('0x77'),'statusCode':_0x9de459[_0x8934('0x75')]}:_0x9de459);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 5c94cce..f324313 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 _0xa336=['util','../../config/logger','request-promise','path','../../config/environment','./intZendeskAccount.attributes','define','lodash'];(function(_0x2f46e8,_0x5c9ac9){var _0x3c4fdb=function(_0x2854f8){while(--_0x2854f8){_0x2f46e8['push'](_0x2f46e8['shift']());}};_0x3c4fdb(++_0x5c9ac9);}(_0xa336,0x1d7));var _0x6a33=function(_0x5df7e6,_0x12d771){_0x5df7e6=_0x5df7e6-0x0;var _0xfaba1b=_0xa336[_0x5df7e6];return _0xfaba1b;};'use strict';var _=require(_0x6a33('0x0'));var util=require(_0x6a33('0x1'));var logger=require(_0x6a33('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a33('0x3'));var fs=require('fs');var path=require(_0x6a33('0x4'));var rimraf=require('rimraf');var config=require(_0x6a33('0x5'));var attributes=require(_0x6a33('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4eaf19,_0x111509){return _0x4eaf19[_0x6a33('0x7')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce07=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xce07,0x9c));var _0x7ce0=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xce07[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7ce0('0x0'));var util=require(_0x7ce0('0x1'));var logger=require(_0x7ce0('0x2'))(_0x7ce0('0x3'));var moment=require(_0x7ce0('0x4'));var BPromise=require(_0x7ce0('0x5'));var rp=require(_0x7ce0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ce0('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x7ce0('0x8'));module['exports']=function(_0x37530b,_0x460124){return _0x37530b[_0x7ce0('0x9')](_0x7ce0('0xa'),attributes,{'tableName':_0x7ce0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a442edf..b979e31 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 _0x42db=['ShowZendeskAccount','find','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','options','raw','where','attributes','limit','include','map','model'];(function(_0x150599,_0x3bdfb0){var _0x12c65f=function(_0x842f6f){while(--_0x842f6f){_0x150599['push'](_0x150599['shift']());}};_0x12c65f(++_0x3bdfb0);}(_0x42db,0x65));var _0xb42d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x42db[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb42d('0x0'));var BPromise=require(_0xb42d('0x1'));var rs=require(_0xb42d('0x2'));var fs=require('fs');var Redis=require(_0xb42d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb42d('0x4'))(_0xb42d('0x5'));var config=require(_0xb42d('0x6'));var jayson=require(_0xb42d('0x7'));var client=jayson[_0xb42d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7ecb74,_0x43b90a,_0x3615a4){return new BPromise(function(_0x3661e5,_0x5bbc0f){return client[_0xb42d('0x9')](_0x7ecb74,_0x3615a4)[_0xb42d('0xa')](function(_0x49a1f4){logger[_0xb42d('0xb')](_0xb42d('0xc'),_0x43b90a,_0xb42d('0xd'));logger[_0xb42d('0xe')](_0xb42d('0xf'),_0x43b90a,_0xb42d('0xd'),JSON[_0xb42d('0x10')](_0x49a1f4));if(_0x49a1f4[_0xb42d('0x11')]){if(_0x49a1f4[_0xb42d('0x11')][_0xb42d('0x12')]===0x1f4){logger[_0xb42d('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x43b90a,_0x49a1f4[_0xb42d('0x11')][_0xb42d('0x13')]);return _0x5bbc0f(_0x49a1f4[_0xb42d('0x11')][_0xb42d('0x13')]);}logger[_0xb42d('0x11')](_0xb42d('0xc'),_0x43b90a,_0x49a1f4[_0xb42d('0x11')]['message']);return _0x3661e5(_0x49a1f4[_0xb42d('0x11')][_0xb42d('0x13')]);}else{logger[_0xb42d('0xb')](_0xb42d('0xc'),_0x43b90a,'request\x20sent');_0x3661e5(_0x49a1f4[_0xb42d('0x14')]['message']);}})[_0xb42d('0x15')](function(_0x7d5020){logger[_0xb42d('0x11')](_0xb42d('0xc'),_0x43b90a,_0x7d5020);_0x5bbc0f(_0x7d5020);});});}exports[_0xb42d('0x16')]=function(_0x2b7e4b){var _0x422f12=this;return new Promise(function(_0x58854f,_0x9596db){return db['ZendeskAccount']['findAll']({'raw':_0x2b7e4b[_0xb42d('0x17')]?_0x2b7e4b['options'][_0xb42d('0x18')]===undefined?!![]:![]:!![],'where':_0x2b7e4b[_0xb42d('0x17')]?_0x2b7e4b[_0xb42d('0x17')][_0xb42d('0x19')]||null:null,'attributes':_0x2b7e4b[_0xb42d('0x17')]?_0x2b7e4b[_0xb42d('0x17')][_0xb42d('0x1a')]||null:null,'limit':_0x2b7e4b[_0xb42d('0x17')]?_0x2b7e4b[_0xb42d('0x17')][_0xb42d('0x1b')]||null:null,'include':_0x2b7e4b['options']?_0x2b7e4b['options'][_0xb42d('0x1c')]?_['map'](_0x2b7e4b[_0xb42d('0x17')][_0xb42d('0x1c')],function(_0x5cfd8e){return{'model':db[_0x5cfd8e['model']],'as':_0x5cfd8e['as'],'attributes':_0x5cfd8e[_0xb42d('0x1a')],'include':_0x5cfd8e[_0xb42d('0x1c')]?_[_0xb42d('0x1d')](_0x5cfd8e[_0xb42d('0x1c')],function(_0x186e8e){return{'model':db[_0x186e8e[_0xb42d('0x1e')]],'as':_0x186e8e['as'],'attributes':_0x186e8e[_0xb42d('0x1a')],'include':_0x186e8e[_0xb42d('0x1c')]?_['map'](_0x186e8e[_0xb42d('0x1c')],function(_0x1e4200){return{'model':db[_0x1e4200['model']],'as':_0x1e4200['as'],'attributes':_0x1e4200['attributes']};}):[]};}):[]};}):[]:[]})[_0xb42d('0xa')](function(_0x31ffd7){logger[_0xb42d('0xb')](_0xb42d('0x16'),_0x2b7e4b);logger['debug'](_0xb42d('0x16'),_0x2b7e4b,JSON[_0xb42d('0x10')](_0x31ffd7));_0x58854f(_0x31ffd7);})['catch'](function(_0x570b31){logger[_0xb42d('0x11')]('GetZendeskAccount',_0x570b31[_0xb42d('0x13')],_0x2b7e4b);_0x9596db(_0x422f12[_0xb42d('0x11')](0x1f4,_0x570b31[_0xb42d('0x13')]));});});};exports[_0xb42d('0x1f')]=function(_0x5d465b){var _0x4b32b0=this;return new Promise(function(_0xb40f1,_0x2a2262){return db['ZendeskAccount'][_0xb42d('0x20')]({'raw':_0x5d465b[_0xb42d('0x17')]?_0x5d465b[_0xb42d('0x17')][_0xb42d('0x18')]===undefined?!![]:![]:!![],'where':_0x5d465b[_0xb42d('0x17')]?_0x5d465b['options']['where']||null:null,'attributes':_0x5d465b[_0xb42d('0x17')]?_0x5d465b[_0xb42d('0x17')][_0xb42d('0x1a')]||null:null,'include':_0x5d465b[_0xb42d('0x17')]?_0x5d465b['options'][_0xb42d('0x1c')]?_[_0xb42d('0x1d')](_0x5d465b['options'][_0xb42d('0x1c')],function(_0xf2c730){return{'model':db[_0xf2c730[_0xb42d('0x1e')]],'as':_0xf2c730['as'],'attributes':_0xf2c730[_0xb42d('0x1a')],'include':_0xf2c730[_0xb42d('0x1c')]?_[_0xb42d('0x1d')](_0xf2c730['include'],function(_0x58323e){return{'model':db[_0x58323e[_0xb42d('0x1e')]],'as':_0x58323e['as'],'attributes':_0x58323e[_0xb42d('0x1a')],'include':_0x58323e[_0xb42d('0x1c')]?_['map'](_0x58323e[_0xb42d('0x1c')],function(_0x377142){return{'model':db[_0x377142[_0xb42d('0x1e')]],'as':_0x377142['as'],'attributes':_0x377142[_0xb42d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fe230){logger[_0xb42d('0xb')](_0xb42d('0x1f'),_0x5d465b);logger[_0xb42d('0xe')](_0xb42d('0x1f'),_0x5d465b,JSON[_0xb42d('0x10')](_0x4fe230));_0xb40f1(_0x4fe230);})[_0xb42d('0x15')](function(_0x293c98){logger[_0xb42d('0x11')](_0xb42d('0x1f'),_0x293c98[_0xb42d('0x13')],_0x5d465b);_0x2a2262(_0x4b32b0[_0xb42d('0x11')](0x1f4,_0x293c98[_0xb42d('0x13')]));});});}; \ No newline at end of file +var _0xe056=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ZendeskAccount','findAll','raw','options','attributes','map','include','model','GetZendeskAccount','debug','catch','ShowZendeskAccount','find','where','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x118eb7,_0x536a04){var _0x2fd1f1=function(_0x87d0fd){while(--_0x87d0fd){_0x118eb7['push'](_0x118eb7['shift']());}};_0x2fd1f1(++_0x536a04);}(_0xe056,0xc5));var _0x6e05=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xe056[_0x10c51f];return _0x56a0cd;};'use strict';var _=require(_0x6e05('0x0'));var util=require(_0x6e05('0x1'));var moment=require(_0x6e05('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e05('0x3'));var db=require(_0x6e05('0x4'))['db'];var utils=require(_0x6e05('0x5'));var logger=require(_0x6e05('0x6'))(_0x6e05('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e05('0x8'));var client=jayson[_0x6e05('0x9')][_0x6e05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c8b57,_0x592815,_0x50b658){return new BPromise(function(_0x50df5e,_0x4cc2fe){return client[_0x6e05('0xb')](_0x3c8b57,_0x50b658)[_0x6e05('0xc')](function(_0x1d2549){logger[_0x6e05('0xd')](_0x6e05('0xe'),_0x592815,_0x6e05('0xf'));logger['debug'](_0x6e05('0x10'),_0x592815,_0x6e05('0xf'),JSON[_0x6e05('0x11')](_0x1d2549));if(_0x1d2549[_0x6e05('0x12')]){if(_0x1d2549[_0x6e05('0x12')]['code']===0x1f4){logger[_0x6e05('0x12')](_0x6e05('0xe'),_0x592815,_0x1d2549[_0x6e05('0x12')]['message']);return _0x4cc2fe(_0x1d2549[_0x6e05('0x12')][_0x6e05('0x13')]);}logger['error'](_0x6e05('0xe'),_0x592815,_0x1d2549['error'][_0x6e05('0x13')]);return _0x50df5e(_0x1d2549[_0x6e05('0x12')][_0x6e05('0x13')]);}else{logger[_0x6e05('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x592815,_0x6e05('0xf'));_0x50df5e(_0x1d2549[_0x6e05('0x14')][_0x6e05('0x13')]);}})['catch'](function(_0x530b00){logger['error'](_0x6e05('0xe'),_0x592815,_0x530b00);_0x4cc2fe(_0x530b00);});});}exports['GetZendeskAccount']=function(_0x30b572){var _0x343239=this;return new Promise(function(_0x159d1b,_0x57b4ad){return db[_0x6e05('0x15')][_0x6e05('0x16')]({'raw':_0x30b572['options']?_0x30b572['options'][_0x6e05('0x17')]===undefined?!![]:![]:!![],'where':_0x30b572['options']?_0x30b572[_0x6e05('0x18')]['where']||null:null,'attributes':_0x30b572[_0x6e05('0x18')]?_0x30b572[_0x6e05('0x18')][_0x6e05('0x19')]||null:null,'limit':_0x30b572[_0x6e05('0x18')]?_0x30b572[_0x6e05('0x18')]['limit']||null:null,'include':_0x30b572['options']?_0x30b572['options']['include']?_[_0x6e05('0x1a')](_0x30b572[_0x6e05('0x18')][_0x6e05('0x1b')],function(_0x461b75){return{'model':db[_0x461b75[_0x6e05('0x1c')]],'as':_0x461b75['as'],'attributes':_0x461b75[_0x6e05('0x19')],'include':_0x461b75[_0x6e05('0x1b')]?_[_0x6e05('0x1a')](_0x461b75['include'],function(_0x7a1cc2){return{'model':db[_0x7a1cc2[_0x6e05('0x1c')]],'as':_0x7a1cc2['as'],'attributes':_0x7a1cc2[_0x6e05('0x19')],'include':_0x7a1cc2[_0x6e05('0x1b')]?_[_0x6e05('0x1a')](_0x7a1cc2[_0x6e05('0x1b')],function(_0x45fde6){return{'model':db[_0x45fde6[_0x6e05('0x1c')]],'as':_0x45fde6['as'],'attributes':_0x45fde6[_0x6e05('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36a042){logger[_0x6e05('0xd')](_0x6e05('0x1d'),_0x30b572);logger[_0x6e05('0x1e')](_0x6e05('0x1d'),_0x30b572,JSON[_0x6e05('0x11')](_0x36a042));_0x159d1b(_0x36a042);})[_0x6e05('0x1f')](function(_0x4d1b2c){logger['error'](_0x6e05('0x1d'),_0x4d1b2c[_0x6e05('0x13')],_0x30b572);_0x57b4ad(_0x343239[_0x6e05('0x12')](0x1f4,_0x4d1b2c[_0x6e05('0x13')]));});});};exports[_0x6e05('0x20')]=function(_0x2b4ce7){var _0x11d261=this;return new Promise(function(_0x159f77,_0x530605){return db[_0x6e05('0x15')][_0x6e05('0x21')]({'raw':_0x2b4ce7[_0x6e05('0x18')]?_0x2b4ce7[_0x6e05('0x18')][_0x6e05('0x17')]===undefined?!![]:![]:!![],'where':_0x2b4ce7[_0x6e05('0x18')]?_0x2b4ce7['options'][_0x6e05('0x22')]||null:null,'attributes':_0x2b4ce7[_0x6e05('0x18')]?_0x2b4ce7['options'][_0x6e05('0x19')]||null:null,'include':_0x2b4ce7[_0x6e05('0x18')]?_0x2b4ce7[_0x6e05('0x18')]['include']?_[_0x6e05('0x1a')](_0x2b4ce7['options'][_0x6e05('0x1b')],function(_0x1bad91){return{'model':db[_0x1bad91[_0x6e05('0x1c')]],'as':_0x1bad91['as'],'attributes':_0x1bad91[_0x6e05('0x19')],'include':_0x1bad91[_0x6e05('0x1b')]?_[_0x6e05('0x1a')](_0x1bad91[_0x6e05('0x1b')],function(_0x36a920){return{'model':db[_0x36a920[_0x6e05('0x1c')]],'as':_0x36a920['as'],'attributes':_0x36a920[_0x6e05('0x19')],'include':_0x36a920[_0x6e05('0x1b')]?_[_0x6e05('0x1a')](_0x36a920[_0x6e05('0x1b')],function(_0x7fa734){return{'model':db[_0x7fa734[_0x6e05('0x1c')]],'as':_0x7fa734['as'],'attributes':_0x7fa734['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e05('0xc')](function(_0x46bd31){logger[_0x6e05('0xd')](_0x6e05('0x20'),_0x2b4ce7);logger[_0x6e05('0x1e')](_0x6e05('0x20'),_0x2b4ce7,JSON[_0x6e05('0x11')](_0x46bd31));_0x159f77(_0x46bd31);})[_0x6e05('0x1f')](function(_0x1e7d7e){logger['error'](_0x6e05('0x20'),_0x1e7d7e['message'],_0x2b4ce7);_0x530605(_0x11d261[_0x6e05('0x12')](0x1f4,_0x1e7d7e[_0x6e05('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9e22cb0..5d5d036 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 _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x119f88,_0x252337){var _0x568f1a=function(_0x553e30){while(--_0x553e30){_0x119f88['push'](_0x119f88['shift']());}};_0x568f1a(++_0x252337);}(_0x0bb5,0x148));var _0x50bb=function(_0x52a978,_0xb7a7b9){_0x52a978=_0x52a978-0x0;var _0x622f8c=_0x0bb5[_0x52a978];return _0x622f8c;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 34fc355..51a38b3 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 _0xe0d4=['STRING'];(function(_0x464622,_0xd79b74){var _0x518688=function(_0x2526bc){while(--_0x2526bc){_0x464622['push'](_0x464622['shift']());}};_0x518688(++_0xd79b74);}(_0xe0d4,0x174));var _0x4e0d=function(_0x137ba8,_0x19aa78){_0x137ba8=_0x137ba8-0x0;var _0x485e2b=_0xe0d4[_0x137ba8];return _0x485e2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4e0d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x720f=['STRING','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x720f,0x1e3));var _0xf720=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x720f[_0x1d5400];return _0x21d9fe;};'use strict';var Sequelize=require(_0xf720('0x0'));module['exports']={'name':{'type':Sequelize[_0xf720('0x1')]},'description':{'type':Sequelize[_0xf720('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index dcbb502..76d7b9c 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 _0x9189=['set','Content-Range','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x33bced,_0x57c5b7){var _0x4fbac2=function(_0x19c596){while(--_0x19c596){_0x33bced['push'](_0x33bced['shift']());}};_0x4fbac2(++_0x57c5b7);}(_0x9189,0x175));var _0x9918=function(_0x462bb6,_0x4f43e1){_0x462bb6=_0x462bb6-0x0;var _0x2873fe=_0x9189[_0x462bb6];return _0x2873fe;};'use strict';var emlformat=require(_0x9918('0x0'));var rimraf=require(_0x9918('0x1'));var zipdir=require(_0x9918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9918('0x3'));var moment=require(_0x9918('0x4'));var BPromise=require(_0x9918('0x5'));var Mustache=require(_0x9918('0x6'));var util=require(_0x9918('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9918('0x8'));var ejs=require(_0x9918('0x9'));var fs=require('fs');var fs_extra=require(_0x9918('0xa'));var _=require('lodash');var squel=require(_0x9918('0xb'));var crypto=require(_0x9918('0xc'));var jsforce=require(_0x9918('0xd'));var deskjs=require(_0x9918('0xe'));var toCsv=require(_0x9918('0x8'));var querystring=require('querystring');var Papa=require(_0x9918('0xf'));var Redis=require(_0x9918('0x10'));var authService=require(_0x9918('0x11'));var qs=require(_0x9918('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9918('0x13'));var logger=require(_0x9918('0x14'))(_0x9918('0x15'));var utils=require(_0x9918('0x16'));var config=require(_0x9918('0x17'));var licenseUtil=require(_0x9918('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1042ff,_0x3efdf2){_0x3efdf2=_0x3efdf2||0xcc;return function(_0x2dd4b9){if(_0x2dd4b9){return _0x1042ff[_0x9918('0x19')](_0x3efdf2);}return _0x1042ff[_0x9918('0x1a')](_0x3efdf2)['end']();};}function respondWithResult(_0x2d4ef9,_0x4ad310){_0x4ad310=_0x4ad310||0xc8;return function(_0x1f896a){if(_0x1f896a){return _0x2d4ef9[_0x9918('0x1a')](_0x4ad310)[_0x9918('0x1b')](_0x1f896a);}};}function respondWithFilteredResult(_0x10d07c,_0xb5b12c){return function(_0x543ae8){if(_0x543ae8){var _0x16335b=typeof _0xb5b12c[_0x9918('0x1c')]==='undefined'&&typeof _0xb5b12c[_0x9918('0x1d')]===_0x9918('0x1e');var _0x120c7f=_0x543ae8[_0x9918('0x1f')];var _0x51e394=_0x16335b?0x0:_0xb5b12c[_0x9918('0x1c')];var _0x4cf064=_0x16335b?_0x543ae8[_0x9918('0x1f')]:_0xb5b12c[_0x9918('0x1c')]+_0xb5b12c[_0x9918('0x1d')];var _0x406f03;if(_0x4cf064>=_0x120c7f){_0x4cf064=_0x120c7f;_0x406f03=0xc8;}else{_0x406f03=0xce;}_0x10d07c['status'](_0x406f03);return _0x10d07c[_0x9918('0x20')](_0x9918('0x21'),_0x51e394+'-'+_0x4cf064+'/'+_0x120c7f)[_0x9918('0x1b')](_0x543ae8);}return null;};}function patchUpdates(_0xa2faf9){return function(_0x37f6ff){try{jsonpatch['apply'](_0x37f6ff,_0xa2faf9,!![]);}catch(_0x27196c){return BPromise['reject'](_0x27196c);}return _0x37f6ff[_0x9918('0x22')]();};}function saveUpdates(_0xc4d8ec,_0x3f7fe9){return function(_0x4d546a){if(_0x4d546a){return _0x4d546a[_0x9918('0x23')](_0xc4d8ec)[_0x9918('0x24')](function(_0x140813){return _0x140813;});}return null;};}function removeEntity(_0x4482b3,_0x224ac8){return function(_0xba7926){if(_0xba7926){return _0xba7926[_0x9918('0x25')]()[_0x9918('0x24')](function(){_0x4482b3[_0x9918('0x1a')](0xcc)[_0x9918('0x26')]();});}};}function handleEntityNotFound(_0xad5a7d,_0x2470da){return function(_0x121ac8){if(!_0x121ac8){_0xad5a7d[_0x9918('0x19')](0x194);}return _0x121ac8;};}function handleError(_0x5805b0,_0x403aee){_0x403aee=_0x403aee||0x1f4;return function(_0x4734fc){logger[_0x9918('0x27')](_0x4734fc[_0x9918('0x28')]);if(_0x4734fc[_0x9918('0x29')]){delete _0x4734fc[_0x9918('0x29')];}_0x5805b0[_0x9918('0x1a')](_0x403aee)['send'](_0x4734fc);};}exports[_0x9918('0x2a')]=function(_0x33cbce,_0x55f7a2){var _0x472ff0={},_0x4b8ccf={},_0xb7f5eb={'count':0x0,'rows':[]};var _0x476a38=_[_0x9918('0x2b')](db['ZendeskConfiguration'][_0x9918('0x2c')],function(_0x54c7e9){return{'name':_0x54c7e9['fieldName'],'type':_0x54c7e9[_0x9918('0x2d')]['key']};});_0x4b8ccf['model']=_['map'](_0x476a38,_0x9918('0x29'));_0x4b8ccf['query']=_[_0x9918('0x2e')](_0x33cbce['query']);_0x4b8ccf[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x4b8ccf[_0x9918('0x31')],_0x4b8ccf[_0x9918('0x32')]);_0x472ff0['attributes']=_['intersection'](_0x4b8ccf[_0x9918('0x31')],qs['fields'](_0x33cbce[_0x9918('0x32')][_0x9918('0x33')]));_0x472ff0[_0x9918('0x34')]=_0x472ff0[_0x9918('0x34')][_0x9918('0x35')]?_0x472ff0[_0x9918('0x34')]:_0x4b8ccf[_0x9918('0x31')];if(!_0x33cbce[_0x9918('0x32')]['hasOwnProperty'](_0x9918('0x36'))){_0x472ff0[_0x9918('0x1d')]=qs[_0x9918('0x1d')](_0x33cbce[_0x9918('0x32')][_0x9918('0x1d')]);_0x472ff0[_0x9918('0x1c')]=qs['offset'](_0x33cbce['query'][_0x9918('0x1c')]);}_0x472ff0[_0x9918('0x37')]=qs['sort'](_0x33cbce[_0x9918('0x32')][_0x9918('0x38')]);_0x472ff0[_0x9918('0x39')]=qs[_0x9918('0x2f')](_[_0x9918('0x3a')](_0x33cbce[_0x9918('0x32')],_0x4b8ccf[_0x9918('0x2f')]),_0x476a38);if(_0x33cbce[_0x9918('0x32')][_0x9918('0x3b')]){_0x472ff0[_0x9918('0x39')]=_[_0x9918('0x3c')](_0x472ff0['where'],{'$or':_[_0x9918('0x2b')](_0x476a38,function(_0x28309f){if(_0x28309f['type']!==_0x9918('0x3d')){var _0x72796d={};_0x72796d[_0x28309f[_0x9918('0x29')]]={'$like':'%'+_0x33cbce[_0x9918('0x32')][_0x9918('0x3b')]+'%'};return _0x72796d;}})});}_0x472ff0=_[_0x9918('0x3c')]({},_0x472ff0,_0x33cbce[_0x9918('0x3e')]);var _0xa08085={'where':_0x472ff0[_0x9918('0x39')]};return db[_0x9918('0x3f')][_0x9918('0x1f')](_0xa08085)[_0x9918('0x24')](function(_0x287808){_0xb7f5eb[_0x9918('0x1f')]=_0x287808;if(_0x33cbce[_0x9918('0x32')]['includeAll']){_0x472ff0['include']=[{'all':!![]}];}return db[_0x9918('0x3f')]['findAll'](_0x472ff0);})[_0x9918('0x24')](function(_0x1faa49){_0xb7f5eb[_0x9918('0x40')]=_0x1faa49;return _0xb7f5eb;})[_0x9918('0x24')](respondWithFilteredResult(_0x55f7a2,_0x472ff0))[_0x9918('0x41')](handleError(_0x55f7a2,null));};exports[_0x9918('0x42')]=function(_0x38ee02,_0x387e3e){var _0x2c2af6={'raw':![],'where':{'id':_0x38ee02[_0x9918('0x43')]['id']}},_0x42c8ff={};_0x42c8ff[_0x9918('0x31')]=_[_0x9918('0x2e')](db['ZendeskConfiguration'][_0x9918('0x2c')]);_0x42c8ff['query']=_[_0x9918('0x2e')](_0x38ee02[_0x9918('0x32')]);_0x42c8ff['filters']=_[_0x9918('0x30')](_0x42c8ff[_0x9918('0x31')],_0x42c8ff['query']);_0x2c2af6['attributes']=_[_0x9918('0x30')](_0x42c8ff[_0x9918('0x31')],qs[_0x9918('0x33')](_0x38ee02[_0x9918('0x32')][_0x9918('0x33')]));_0x2c2af6[_0x9918('0x34')]=_0x2c2af6[_0x9918('0x34')][_0x9918('0x35')]?_0x2c2af6[_0x9918('0x34')]:_0x42c8ff[_0x9918('0x31')];if(_0x38ee02[_0x9918('0x32')][_0x9918('0x44')]){_0x2c2af6[_0x9918('0x45')]=[{'all':!![]}];}_0x2c2af6=_[_0x9918('0x3c')]({},_0x2c2af6,_0x38ee02[_0x9918('0x3e')]);return db['ZendeskConfiguration'][_0x9918('0x46')](_0x2c2af6)[_0x9918('0x24')](handleEntityNotFound(_0x387e3e,null))[_0x9918('0x24')](respondWithResult(_0x387e3e,null))[_0x9918('0x41')](handleError(_0x387e3e,null));};exports[_0x9918('0x47')]=function(_0x5d722d,_0x7750d9){return db[_0x9918('0x3f')][_0x9918('0x47')](_0x5d722d[_0x9918('0x48')],{})['then'](respondWithResult(_0x7750d9,0xc9))['catch'](handleError(_0x7750d9,null));};exports[_0x9918('0x23')]=function(_0x1861d8,_0x4c16a7){if(_0x1861d8[_0x9918('0x48')]['id']){delete _0x1861d8[_0x9918('0x48')]['id'];}return db[_0x9918('0x3f')][_0x9918('0x46')]({'where':{'id':_0x1861d8[_0x9918('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c16a7,null))['then'](saveUpdates(_0x1861d8[_0x9918('0x48')],null))[_0x9918('0x24')](respondWithResult(_0x4c16a7,null))[_0x9918('0x41')](handleError(_0x4c16a7,null));};exports[_0x9918('0x25')]=function(_0x2324af,_0x116a0b){return db[_0x9918('0x3f')][_0x9918('0x46')]({'where':{'id':_0x2324af[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0x116a0b,null))[_0x9918('0x24')](removeEntity(_0x116a0b,null))[_0x9918('0x41')](handleError(_0x116a0b,null));};exports[_0x9918('0x49')]=function(_0x577293,_0x3c42ce,_0x4b65dd){var _0x43fb12={};var _0x510941={};var _0x3aac85;var _0x2c0ca2;return db[_0x9918('0x3f')][_0x9918('0x4a')]({'where':{'id':_0x577293[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0x3c42ce,null))[_0x9918('0x24')](function(_0xa520d6){if(_0xa520d6){_0x3aac85=_0xa520d6;_0x510941['model']=_[_0x9918('0x2e')](db[_0x9918('0x4b')]['rawAttributes']);_0x510941['query']=_[_0x9918('0x2e')](_0x577293[_0x9918('0x32')]);_0x510941[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x510941[_0x9918('0x31')],_0x510941[_0x9918('0x32')]);_0x43fb12['attributes']=_[_0x9918('0x30')](_0x510941['model'],qs[_0x9918('0x33')](_0x577293['query'][_0x9918('0x33')]));_0x43fb12[_0x9918('0x34')]=_0x43fb12[_0x9918('0x34')][_0x9918('0x35')]?_0x43fb12[_0x9918('0x34')]:_0x510941[_0x9918('0x31')];_0x43fb12[_0x9918('0x37')]=qs[_0x9918('0x38')](_0x577293[_0x9918('0x32')][_0x9918('0x38')]);_0x43fb12['where']=qs['filters'](_[_0x9918('0x3a')](_0x577293[_0x9918('0x32')],_0x510941[_0x9918('0x2f')]));if(_0x577293[_0x9918('0x32')]['filter']){_0x43fb12[_0x9918('0x39')]=_[_0x9918('0x3c')](_0x43fb12[_0x9918('0x39')],{'$or':_[_0x9918('0x2b')](_0x43fb12[_0x9918('0x34')],function(_0x43e27f){var _0x216b23={};_0x216b23[_0x43e27f]={'$like':'%'+_0x577293[_0x9918('0x32')][_0x9918('0x3b')]+'%'};return _0x216b23;})});}_0x43fb12=_[_0x9918('0x3c')]({},_0x43fb12,_0x577293[_0x9918('0x3e')]);return _0x3aac85[_0x9918('0x49')](_0x43fb12);}})[_0x9918('0x24')](function(_0x4f57f3){if(_0x4f57f3){_0x2c0ca2=_0x4f57f3[_0x9918('0x35')];if(!_0x577293[_0x9918('0x32')][_0x9918('0x4c')]('nolimit')){_0x43fb12[_0x9918('0x1d')]=qs[_0x9918('0x1d')](_0x577293[_0x9918('0x32')][_0x9918('0x1d')]);_0x43fb12['offset']=qs[_0x9918('0x1c')](_0x577293[_0x9918('0x32')][_0x9918('0x1c')]);}return _0x3aac85[_0x9918('0x49')](_0x43fb12);}})[_0x9918('0x24')](function(_0x34383e){if(_0x34383e){return _0x34383e?{'count':_0x2c0ca2,'rows':_0x34383e}:null;}})[_0x9918('0x24')](respondWithResult(_0x3c42ce,null))[_0x9918('0x41')](handleError(_0x3c42ce,null));};exports[_0x9918('0x4d')]=function(_0x6ed795,_0x510164,_0x2d26d0){var _0xcc10d0={};var _0x2820a7={};var _0x583d7a;var _0x43bf12;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x6ed795[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0x510164,null))[_0x9918('0x24')](function(_0x5f304e){if(_0x5f304e){_0x583d7a=_0x5f304e;_0x2820a7[_0x9918('0x31')]=_[_0x9918('0x2e')](db['ZendeskField']['rawAttributes']);_0x2820a7[_0x9918('0x32')]=_[_0x9918('0x2e')](_0x6ed795[_0x9918('0x32')]);_0x2820a7['filters']=_[_0x9918('0x30')](_0x2820a7[_0x9918('0x31')],_0x2820a7['query']);_0xcc10d0['attributes']=_[_0x9918('0x30')](_0x2820a7[_0x9918('0x31')],qs[_0x9918('0x33')](_0x6ed795[_0x9918('0x32')][_0x9918('0x33')]));_0xcc10d0['attributes']=_0xcc10d0[_0x9918('0x34')]['length']?_0xcc10d0[_0x9918('0x34')]:_0x2820a7['model'];_0xcc10d0['order']=qs[_0x9918('0x38')](_0x6ed795[_0x9918('0x32')][_0x9918('0x38')]);_0xcc10d0[_0x9918('0x39')]=qs['filters'](_[_0x9918('0x3a')](_0x6ed795['query'],_0x2820a7[_0x9918('0x2f')]));if(_0x6ed795[_0x9918('0x32')]['filter']){_0xcc10d0['where']=_[_0x9918('0x3c')](_0xcc10d0['where'],{'$or':_[_0x9918('0x2b')](_0xcc10d0['attributes'],function(_0x498bba){var _0x1f6d8e={};_0x1f6d8e[_0x498bba]={'$like':'%'+_0x6ed795[_0x9918('0x32')]['filter']+'%'};return _0x1f6d8e;})});}_0xcc10d0=_['merge']({},_0xcc10d0,_0x6ed795[_0x9918('0x3e')]);return _0x583d7a[_0x9918('0x4d')](_0xcc10d0);}})[_0x9918('0x24')](function(_0x45a410){if(_0x45a410){_0x43bf12=_0x45a410[_0x9918('0x35')];if(!_0x6ed795[_0x9918('0x32')][_0x9918('0x4c')](_0x9918('0x36'))){_0xcc10d0['limit']=qs['limit'](_0x6ed795[_0x9918('0x32')][_0x9918('0x1d')]);_0xcc10d0[_0x9918('0x1c')]=qs[_0x9918('0x1c')](_0x6ed795[_0x9918('0x32')][_0x9918('0x1c')]);}return _0x583d7a[_0x9918('0x4d')](_0xcc10d0);}})[_0x9918('0x24')](function(_0x5343e5){if(_0x5343e5){return _0x5343e5?{'count':_0x43bf12,'rows':_0x5343e5}:null;}})[_0x9918('0x24')](respondWithResult(_0x510164,null))[_0x9918('0x41')](handleError(_0x510164,null));};exports[_0x9918('0x4e')]=function(_0x1170db,_0xe99bb9,_0x1b2ac9){var _0x5a0c87={};var _0x4c3898={};var _0x979a7c;var _0x460c3d;return db['ZendeskConfiguration'][_0x9918('0x4a')]({'where':{'id':_0x1170db[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0xe99bb9,null))[_0x9918('0x24')](function(_0x45d887){if(_0x45d887){_0x979a7c=_0x45d887;_0x4c3898['model']=_['keys'](db['ZendeskField'][_0x9918('0x2c')]);_0x4c3898['query']=_[_0x9918('0x2e')](_0x1170db[_0x9918('0x32')]);_0x4c3898['filters']=_[_0x9918('0x30')](_0x4c3898['model'],_0x4c3898['query']);_0x5a0c87[_0x9918('0x34')]=_['intersection'](_0x4c3898['model'],qs['fields'](_0x1170db[_0x9918('0x32')]['fields']));_0x5a0c87[_0x9918('0x34')]=_0x5a0c87[_0x9918('0x34')][_0x9918('0x35')]?_0x5a0c87[_0x9918('0x34')]:_0x4c3898[_0x9918('0x31')];_0x5a0c87['order']=qs[_0x9918('0x38')](_0x1170db[_0x9918('0x32')][_0x9918('0x38')]);_0x5a0c87[_0x9918('0x39')]=qs[_0x9918('0x2f')](_['pick'](_0x1170db['query'],_0x4c3898[_0x9918('0x2f')]));if(_0x1170db[_0x9918('0x32')]['filter']){_0x5a0c87[_0x9918('0x39')]=_['merge'](_0x5a0c87[_0x9918('0x39')],{'$or':_[_0x9918('0x2b')](_0x5a0c87['attributes'],function(_0x641536){var _0x4993d5={};_0x4993d5[_0x641536]={'$like':'%'+_0x1170db['query'][_0x9918('0x3b')]+'%'};return _0x4993d5;})});}_0x5a0c87=_[_0x9918('0x3c')]({},_0x5a0c87,_0x1170db[_0x9918('0x3e')]);return _0x979a7c[_0x9918('0x4e')](_0x5a0c87);}})[_0x9918('0x24')](function(_0x399843){if(_0x399843){_0x460c3d=_0x399843[_0x9918('0x35')];if(!_0x1170db['query'][_0x9918('0x4c')](_0x9918('0x36'))){_0x5a0c87[_0x9918('0x1d')]=qs[_0x9918('0x1d')](_0x1170db['query'][_0x9918('0x1d')]);_0x5a0c87[_0x9918('0x1c')]=qs[_0x9918('0x1c')](_0x1170db[_0x9918('0x32')][_0x9918('0x1c')]);}return _0x979a7c['getDescriptions'](_0x5a0c87);}})[_0x9918('0x24')](function(_0x3fb337){if(_0x3fb337){return _0x3fb337?{'count':_0x460c3d,'rows':_0x3fb337}:null;}})[_0x9918('0x24')](respondWithResult(_0xe99bb9,null))[_0x9918('0x41')](handleError(_0xe99bb9,null));};exports[_0x9918('0x4f')]=function(_0x29fec4,_0x475ec2,_0xe764d){var _0xbf1bd8={};var _0x2a2ddf={};var _0x942b0e;var _0x3ab6d;return db['ZendeskConfiguration'][_0x9918('0x4a')]({'where':{'id':_0x29fec4[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0x475ec2,null))[_0x9918('0x24')](function(_0x2f5f1a){if(_0x2f5f1a){_0x942b0e=_0x2f5f1a;_0x2a2ddf[_0x9918('0x31')]=_['keys'](db['Tag'][_0x9918('0x2c')]);_0x2a2ddf[_0x9918('0x32')]=_[_0x9918('0x2e')](_0x29fec4['query']);_0x2a2ddf[_0x9918('0x2f')]=_[_0x9918('0x30')](_0x2a2ddf[_0x9918('0x31')],_0x2a2ddf[_0x9918('0x32')]);_0xbf1bd8[_0x9918('0x34')]=_['intersection'](_0x2a2ddf[_0x9918('0x31')],qs[_0x9918('0x33')](_0x29fec4[_0x9918('0x32')]['fields']));_0xbf1bd8[_0x9918('0x34')]=_0xbf1bd8[_0x9918('0x34')][_0x9918('0x35')]?_0xbf1bd8['attributes']:_0x2a2ddf[_0x9918('0x31')];_0xbf1bd8[_0x9918('0x37')]=qs[_0x9918('0x38')](_0x29fec4[_0x9918('0x32')][_0x9918('0x38')]);_0xbf1bd8[_0x9918('0x39')]=qs[_0x9918('0x2f')](_[_0x9918('0x3a')](_0x29fec4[_0x9918('0x32')],_0x2a2ddf[_0x9918('0x2f')]));if(_0x29fec4[_0x9918('0x32')][_0x9918('0x3b')]){_0xbf1bd8[_0x9918('0x39')]=_[_0x9918('0x3c')](_0xbf1bd8[_0x9918('0x39')],{'$or':_[_0x9918('0x2b')](_0xbf1bd8[_0x9918('0x34')],function(_0x2bf867){var _0x149417={};_0x149417[_0x2bf867]={'$like':'%'+_0x29fec4[_0x9918('0x32')][_0x9918('0x3b')]+'%'};return _0x149417;})});}_0xbf1bd8=_['merge']({},_0xbf1bd8,_0x29fec4[_0x9918('0x3e')]);return _0x942b0e['getTags'](_0xbf1bd8);}})[_0x9918('0x24')](function(_0x65c4b9){if(_0x65c4b9){_0x3ab6d=_0x65c4b9[_0x9918('0x35')];if(!_0x29fec4[_0x9918('0x32')][_0x9918('0x4c')](_0x9918('0x36'))){_0xbf1bd8[_0x9918('0x1d')]=qs['limit'](_0x29fec4[_0x9918('0x32')][_0x9918('0x1d')]);_0xbf1bd8[_0x9918('0x1c')]=qs[_0x9918('0x1c')](_0x29fec4[_0x9918('0x32')][_0x9918('0x1c')]);}return _0x942b0e[_0x9918('0x4f')](_0xbf1bd8);}})[_0x9918('0x24')](function(_0x4e4cf3){if(_0x4e4cf3){return _0x4e4cf3?{'count':_0x3ab6d,'rows':_0x4e4cf3}:null;}})[_0x9918('0x24')](respondWithResult(_0x475ec2,null))['catch'](handleError(_0x475ec2,null));};exports['setTags']=function(_0x4f69b5,_0x26b613,_0x5ace44){if(_0x4f69b5[_0x9918('0x48')]['id']){delete _0x4f69b5[_0x9918('0x48')]['id'];}return db['ZendeskConfiguration'][_0x9918('0x4a')]({'where':{'id':_0x4f69b5[_0x9918('0x43')]['id']}})[_0x9918('0x24')](handleEntityNotFound(_0x26b613,null))['then'](function(_0x123e41){if(_0x123e41){return _0x123e41['setTags'](_0x4f69b5[_0x9918('0x48')][_0x9918('0x50')]||[]);}return null;})[_0x9918('0x24')](respondWithResult(_0x26b613,null))[_0x9918('0x41')](handleError(_0x26b613,null));}; \ No newline at end of file +var _0xc2ba=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','ZendeskConfiguration','rawAttributes','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','show','params','keys','find','catch','create','body','getFields','ZendeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','order','setTags','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x3f4841,_0x1d422b){var _0x45569f=function(_0x1df835){while(--_0x1df835){_0x3f4841['push'](_0x3f4841['shift']());}};_0x45569f(++_0x1d422b);}(_0xc2ba,0x131));var _0xac2b=function(_0x462e0e,_0x9e5c2e){_0x462e0e=_0x462e0e-0x0;var _0x1163f0=_0xc2ba[_0x462e0e];return _0x1163f0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac2b('0x0'));var jsonpatch=require(_0xac2b('0x1'));var rp=require(_0xac2b('0x2'));var moment=require(_0xac2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac2b('0x4'));var util=require('util');var path=require(_0xac2b('0x5'));var sox=require(_0xac2b('0x6'));var csv=require(_0xac2b('0x7'));var ejs=require(_0xac2b('0x8'));var fs=require('fs');var fs_extra=require(_0xac2b('0x9'));var _=require(_0xac2b('0xa'));var squel=require(_0xac2b('0xb'));var crypto=require(_0xac2b('0xc'));var jsforce=require(_0xac2b('0xd'));var deskjs=require(_0xac2b('0xe'));var toCsv=require(_0xac2b('0x7'));var querystring=require(_0xac2b('0xf'));var Papa=require('papaparse');var Redis=require(_0xac2b('0x10'));var authService=require(_0xac2b('0x11'));var qs=require(_0xac2b('0x12'));var as=require(_0xac2b('0x13'));var hardwareService=require(_0xac2b('0x14'));var logger=require(_0xac2b('0x15'))('api');var utils=require(_0xac2b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xac2b('0x17'));var db=require(_0xac2b('0x18'))['db'];function respondWithStatusCode(_0x249e80,_0x32b9ea){_0x32b9ea=_0x32b9ea||0xcc;return function(_0x1689b4){if(_0x1689b4){return _0x249e80[_0xac2b('0x19')](_0x32b9ea);}return _0x249e80['status'](_0x32b9ea)[_0xac2b('0x1a')]();};}function respondWithResult(_0x368a53,_0x36d121){_0x36d121=_0x36d121||0xc8;return function(_0x37e88e){if(_0x37e88e){return _0x368a53[_0xac2b('0x1b')](_0x36d121)[_0xac2b('0x1c')](_0x37e88e);}};}function respondWithFilteredResult(_0x35428e,_0x242649){return function(_0x4c3f06){if(_0x4c3f06){var _0x56d7d4=typeof _0x242649[_0xac2b('0x1d')]===_0xac2b('0x1e')&&typeof _0x242649[_0xac2b('0x1f')]===_0xac2b('0x1e');var _0x2b583e=_0x4c3f06[_0xac2b('0x20')];var _0x1633b0=_0x56d7d4?0x0:_0x242649[_0xac2b('0x1d')];var _0x1733a2=_0x56d7d4?_0x4c3f06[_0xac2b('0x20')]:_0x242649[_0xac2b('0x1d')]+_0x242649[_0xac2b('0x1f')];var _0x2cef93;if(_0x1733a2>=_0x2b583e){_0x1733a2=_0x2b583e;_0x2cef93=0xc8;}else{_0x2cef93=0xce;}_0x35428e['status'](_0x2cef93);return _0x35428e[_0xac2b('0x21')](_0xac2b('0x22'),_0x1633b0+'-'+_0x1733a2+'/'+_0x2b583e)[_0xac2b('0x1c')](_0x4c3f06);}return null;};}function patchUpdates(_0x3025da){return function(_0x2b7b62){try{jsonpatch['apply'](_0x2b7b62,_0x3025da,!![]);}catch(_0x498e51){return BPromise[_0xac2b('0x23')](_0x498e51);}return _0x2b7b62[_0xac2b('0x24')]();};}function saveUpdates(_0x1d6c0c,_0x53c02d){return function(_0x3db2a0){if(_0x3db2a0){return _0x3db2a0['update'](_0x1d6c0c)[_0xac2b('0x25')](function(_0x2e855b){return _0x2e855b;});}return null;};}function removeEntity(_0x255ceb,_0xc822b0){return function(_0x54a4c6){if(_0x54a4c6){return _0x54a4c6[_0xac2b('0x26')]()[_0xac2b('0x25')](function(){_0x255ceb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41faff,_0x146847){return function(_0x4ec0f7){if(!_0x4ec0f7){_0x41faff[_0xac2b('0x19')](0x194);}return _0x4ec0f7;};}function handleError(_0x35aa32,_0x2aab63){_0x2aab63=_0x2aab63||0x1f4;return function(_0x1fe456){logger[_0xac2b('0x27')](_0x1fe456[_0xac2b('0x28')]);if(_0x1fe456[_0xac2b('0x29')]){delete _0x1fe456[_0xac2b('0x29')];}_0x35aa32[_0xac2b('0x1b')](_0x2aab63)['send'](_0x1fe456);};}exports[_0xac2b('0x2a')]=function(_0x15a447,_0x588158){var _0x1978db={},_0x3f5229={},_0x50fa65={'count':0x0,'rows':[]};var _0x419a1a=_['map'](db[_0xac2b('0x2b')][_0xac2b('0x2c')],function(_0x25da09){return{'name':_0x25da09['fieldName'],'type':_0x25da09['type'][_0xac2b('0x2d')]};});_0x3f5229[_0xac2b('0x2e')]=_[_0xac2b('0x2f')](_0x419a1a,_0xac2b('0x29'));_0x3f5229[_0xac2b('0x30')]=_['keys'](_0x15a447['query']);_0x3f5229[_0xac2b('0x31')]=_['intersection'](_0x3f5229[_0xac2b('0x2e')],_0x3f5229[_0xac2b('0x30')]);_0x1978db[_0xac2b('0x32')]=_[_0xac2b('0x33')](_0x3f5229[_0xac2b('0x2e')],qs['fields'](_0x15a447[_0xac2b('0x30')][_0xac2b('0x34')]));_0x1978db[_0xac2b('0x32')]=_0x1978db[_0xac2b('0x32')][_0xac2b('0x35')]?_0x1978db['attributes']:_0x3f5229['model'];if(!_0x15a447['query'][_0xac2b('0x36')]('nolimit')){_0x1978db[_0xac2b('0x1f')]=qs[_0xac2b('0x1f')](_0x15a447['query'][_0xac2b('0x1f')]);_0x1978db[_0xac2b('0x1d')]=qs[_0xac2b('0x1d')](_0x15a447['query'][_0xac2b('0x1d')]);}_0x1978db['order']=qs[_0xac2b('0x37')](_0x15a447[_0xac2b('0x30')][_0xac2b('0x37')]);_0x1978db['where']=qs[_0xac2b('0x31')](_[_0xac2b('0x38')](_0x15a447['query'],_0x3f5229[_0xac2b('0x31')]),_0x419a1a);if(_0x15a447[_0xac2b('0x30')][_0xac2b('0x39')]){_0x1978db['where']=_[_0xac2b('0x3a')](_0x1978db['where'],{'$or':_[_0xac2b('0x2f')](_0x419a1a,function(_0x33cdc2){if(_0x33cdc2['type']!==_0xac2b('0x3b')){var _0x4f3782={};_0x4f3782[_0x33cdc2['name']]={'$like':'%'+_0x15a447['query']['filter']+'%'};return _0x4f3782;}})});}_0x1978db=_[_0xac2b('0x3a')]({},_0x1978db,_0x15a447[_0xac2b('0x3c')]);var _0x1ee9d7={'where':_0x1978db[_0xac2b('0x3d')]};return db[_0xac2b('0x2b')]['count'](_0x1ee9d7)['then'](function(_0x536a08){_0x50fa65[_0xac2b('0x20')]=_0x536a08;if(_0x15a447[_0xac2b('0x30')][_0xac2b('0x3e')]){_0x1978db[_0xac2b('0x3f')]=[{'all':!![]}];}return db[_0xac2b('0x2b')][_0xac2b('0x40')](_0x1978db);})[_0xac2b('0x25')](function(_0x1e2f5a){_0x50fa65['rows']=_0x1e2f5a;return _0x50fa65;})[_0xac2b('0x25')](respondWithFilteredResult(_0x588158,_0x1978db))['catch'](handleError(_0x588158,null));};exports[_0xac2b('0x41')]=function(_0xdc46de,_0x50f1b5){var _0x16359a={'raw':![],'where':{'id':_0xdc46de[_0xac2b('0x42')]['id']}},_0x37d00e={};_0x37d00e[_0xac2b('0x2e')]=_[_0xac2b('0x43')](db[_0xac2b('0x2b')][_0xac2b('0x2c')]);_0x37d00e['query']=_[_0xac2b('0x43')](_0xdc46de[_0xac2b('0x30')]);_0x37d00e[_0xac2b('0x31')]=_[_0xac2b('0x33')](_0x37d00e[_0xac2b('0x2e')],_0x37d00e[_0xac2b('0x30')]);_0x16359a[_0xac2b('0x32')]=_['intersection'](_0x37d00e[_0xac2b('0x2e')],qs[_0xac2b('0x34')](_0xdc46de[_0xac2b('0x30')][_0xac2b('0x34')]));_0x16359a[_0xac2b('0x32')]=_0x16359a[_0xac2b('0x32')][_0xac2b('0x35')]?_0x16359a['attributes']:_0x37d00e[_0xac2b('0x2e')];if(_0xdc46de['query']['includeAll']){_0x16359a[_0xac2b('0x3f')]=[{'all':!![]}];}_0x16359a=_[_0xac2b('0x3a')]({},_0x16359a,_0xdc46de[_0xac2b('0x3c')]);return db['ZendeskConfiguration'][_0xac2b('0x44')](_0x16359a)[_0xac2b('0x25')](handleEntityNotFound(_0x50f1b5,null))['then'](respondWithResult(_0x50f1b5,null))[_0xac2b('0x45')](handleError(_0x50f1b5,null));};exports['create']=function(_0x692254,_0x413335){return db['ZendeskConfiguration'][_0xac2b('0x46')](_0x692254[_0xac2b('0x47')],{})['then'](respondWithResult(_0x413335,0xc9))['catch'](handleError(_0x413335,null));};exports['update']=function(_0x81504c,_0x3b4572){if(_0x81504c[_0xac2b('0x47')]['id']){delete _0x81504c[_0xac2b('0x47')]['id'];}return db['ZendeskConfiguration'][_0xac2b('0x44')]({'where':{'id':_0x81504c[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x3b4572,null))[_0xac2b('0x25')](saveUpdates(_0x81504c['body'],null))[_0xac2b('0x25')](respondWithResult(_0x3b4572,null))[_0xac2b('0x45')](handleError(_0x3b4572,null));};exports[_0xac2b('0x26')]=function(_0x4691fe,_0x1ec61b){return db[_0xac2b('0x2b')][_0xac2b('0x44')]({'where':{'id':_0x4691fe[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x1ec61b,null))[_0xac2b('0x25')](removeEntity(_0x1ec61b,null))[_0xac2b('0x45')](handleError(_0x1ec61b,null));};exports[_0xac2b('0x48')]=function(_0x372abf,_0x24f134,_0x58ff17){var _0x1c617f={};var _0x28cba9={};var _0x32093a;var _0x208589;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x372abf[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x24f134,null))[_0xac2b('0x25')](function(_0x5c255b){if(_0x5c255b){_0x32093a=_0x5c255b;_0x28cba9[_0xac2b('0x2e')]=_[_0xac2b('0x43')](db[_0xac2b('0x49')][_0xac2b('0x2c')]);_0x28cba9[_0xac2b('0x30')]=_[_0xac2b('0x43')](_0x372abf[_0xac2b('0x30')]);_0x28cba9[_0xac2b('0x31')]=_[_0xac2b('0x33')](_0x28cba9[_0xac2b('0x2e')],_0x28cba9[_0xac2b('0x30')]);_0x1c617f['attributes']=_['intersection'](_0x28cba9[_0xac2b('0x2e')],qs['fields'](_0x372abf['query'][_0xac2b('0x34')]));_0x1c617f[_0xac2b('0x32')]=_0x1c617f[_0xac2b('0x32')][_0xac2b('0x35')]?_0x1c617f[_0xac2b('0x32')]:_0x28cba9[_0xac2b('0x2e')];_0x1c617f['order']=qs[_0xac2b('0x37')](_0x372abf[_0xac2b('0x30')]['sort']);_0x1c617f[_0xac2b('0x3d')]=qs[_0xac2b('0x31')](_[_0xac2b('0x38')](_0x372abf[_0xac2b('0x30')],_0x28cba9[_0xac2b('0x31')]));if(_0x372abf[_0xac2b('0x30')][_0xac2b('0x39')]){_0x1c617f[_0xac2b('0x3d')]=_[_0xac2b('0x3a')](_0x1c617f[_0xac2b('0x3d')],{'$or':_['map'](_0x1c617f[_0xac2b('0x32')],function(_0x635b74){var _0x3271b7={};_0x3271b7[_0x635b74]={'$like':'%'+_0x372abf['query'][_0xac2b('0x39')]+'%'};return _0x3271b7;})});}_0x1c617f=_[_0xac2b('0x3a')]({},_0x1c617f,_0x372abf[_0xac2b('0x3c')]);return _0x32093a[_0xac2b('0x48')](_0x1c617f);}})['then'](function(_0x2b197b){if(_0x2b197b){_0x208589=_0x2b197b[_0xac2b('0x35')];if(!_0x372abf[_0xac2b('0x30')][_0xac2b('0x36')](_0xac2b('0x4a'))){_0x1c617f[_0xac2b('0x1f')]=qs['limit'](_0x372abf[_0xac2b('0x30')][_0xac2b('0x1f')]);_0x1c617f[_0xac2b('0x1d')]=qs[_0xac2b('0x1d')](_0x372abf[_0xac2b('0x30')]['offset']);}return _0x32093a[_0xac2b('0x48')](_0x1c617f);}})[_0xac2b('0x25')](function(_0x349785){if(_0x349785){return _0x349785?{'count':_0x208589,'rows':_0x349785}:null;}})[_0xac2b('0x25')](respondWithResult(_0x24f134,null))[_0xac2b('0x45')](handleError(_0x24f134,null));};exports[_0xac2b('0x4b')]=function(_0x707534,_0x3ba906,_0x2c026a){var _0x421fdc={};var _0x4eab08={};var _0x5c9ced;var _0x189d87;return db[_0xac2b('0x2b')][_0xac2b('0x4c')]({'where':{'id':_0x707534['params']['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x3ba906,null))[_0xac2b('0x25')](function(_0x305518){if(_0x305518){_0x5c9ced=_0x305518;_0x4eab08[_0xac2b('0x2e')]=_[_0xac2b('0x43')](db[_0xac2b('0x49')][_0xac2b('0x2c')]);_0x4eab08[_0xac2b('0x30')]=_[_0xac2b('0x43')](_0x707534[_0xac2b('0x30')]);_0x4eab08[_0xac2b('0x31')]=_[_0xac2b('0x33')](_0x4eab08['model'],_0x4eab08[_0xac2b('0x30')]);_0x421fdc[_0xac2b('0x32')]=_['intersection'](_0x4eab08['model'],qs[_0xac2b('0x34')](_0x707534[_0xac2b('0x30')][_0xac2b('0x34')]));_0x421fdc[_0xac2b('0x32')]=_0x421fdc[_0xac2b('0x32')][_0xac2b('0x35')]?_0x421fdc['attributes']:_0x4eab08['model'];_0x421fdc['order']=qs[_0xac2b('0x37')](_0x707534[_0xac2b('0x30')][_0xac2b('0x37')]);_0x421fdc['where']=qs[_0xac2b('0x31')](_['pick'](_0x707534[_0xac2b('0x30')],_0x4eab08[_0xac2b('0x31')]));if(_0x707534[_0xac2b('0x30')][_0xac2b('0x39')]){_0x421fdc[_0xac2b('0x3d')]=_[_0xac2b('0x3a')](_0x421fdc[_0xac2b('0x3d')],{'$or':_['map'](_0x421fdc[_0xac2b('0x32')],function(_0xf77309){var _0x156883={};_0x156883[_0xf77309]={'$like':'%'+_0x707534[_0xac2b('0x30')]['filter']+'%'};return _0x156883;})});}_0x421fdc=_[_0xac2b('0x3a')]({},_0x421fdc,_0x707534[_0xac2b('0x3c')]);return _0x5c9ced[_0xac2b('0x4b')](_0x421fdc);}})[_0xac2b('0x25')](function(_0x136382){if(_0x136382){_0x189d87=_0x136382[_0xac2b('0x35')];if(!_0x707534[_0xac2b('0x30')][_0xac2b('0x36')](_0xac2b('0x4a'))){_0x421fdc['limit']=qs[_0xac2b('0x1f')](_0x707534['query'][_0xac2b('0x1f')]);_0x421fdc['offset']=qs[_0xac2b('0x1d')](_0x707534[_0xac2b('0x30')]['offset']);}return _0x5c9ced[_0xac2b('0x4b')](_0x421fdc);}})[_0xac2b('0x25')](function(_0x34e2bf){if(_0x34e2bf){return _0x34e2bf?{'count':_0x189d87,'rows':_0x34e2bf}:null;}})['then'](respondWithResult(_0x3ba906,null))[_0xac2b('0x45')](handleError(_0x3ba906,null));};exports[_0xac2b('0x4d')]=function(_0x2c7bc3,_0x5db995,_0x4f1abd){var _0x5ac374={};var _0xe0a75e={};var _0x1bd519;var _0x23cc05;return db[_0xac2b('0x2b')][_0xac2b('0x4c')]({'where':{'id':_0x2c7bc3[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x5db995,null))[_0xac2b('0x25')](function(_0x39a335){if(_0x39a335){_0x1bd519=_0x39a335;_0xe0a75e[_0xac2b('0x2e')]=_[_0xac2b('0x43')](db[_0xac2b('0x49')][_0xac2b('0x2c')]);_0xe0a75e['query']=_[_0xac2b('0x43')](_0x2c7bc3[_0xac2b('0x30')]);_0xe0a75e['filters']=_[_0xac2b('0x33')](_0xe0a75e[_0xac2b('0x2e')],_0xe0a75e[_0xac2b('0x30')]);_0x5ac374[_0xac2b('0x32')]=_[_0xac2b('0x33')](_0xe0a75e['model'],qs[_0xac2b('0x34')](_0x2c7bc3[_0xac2b('0x30')][_0xac2b('0x34')]));_0x5ac374[_0xac2b('0x32')]=_0x5ac374[_0xac2b('0x32')][_0xac2b('0x35')]?_0x5ac374[_0xac2b('0x32')]:_0xe0a75e[_0xac2b('0x2e')];_0x5ac374['order']=qs[_0xac2b('0x37')](_0x2c7bc3[_0xac2b('0x30')]['sort']);_0x5ac374[_0xac2b('0x3d')]=qs['filters'](_['pick'](_0x2c7bc3[_0xac2b('0x30')],_0xe0a75e[_0xac2b('0x31')]));if(_0x2c7bc3[_0xac2b('0x30')][_0xac2b('0x39')]){_0x5ac374['where']=_[_0xac2b('0x3a')](_0x5ac374[_0xac2b('0x3d')],{'$or':_[_0xac2b('0x2f')](_0x5ac374[_0xac2b('0x32')],function(_0x342691){var _0x46339a={};_0x46339a[_0x342691]={'$like':'%'+_0x2c7bc3[_0xac2b('0x30')]['filter']+'%'};return _0x46339a;})});}_0x5ac374=_[_0xac2b('0x3a')]({},_0x5ac374,_0x2c7bc3[_0xac2b('0x3c')]);return _0x1bd519[_0xac2b('0x4d')](_0x5ac374);}})['then'](function(_0x4373a1){if(_0x4373a1){_0x23cc05=_0x4373a1[_0xac2b('0x35')];if(!_0x2c7bc3[_0xac2b('0x30')][_0xac2b('0x36')](_0xac2b('0x4a'))){_0x5ac374['limit']=qs[_0xac2b('0x1f')](_0x2c7bc3[_0xac2b('0x30')]['limit']);_0x5ac374[_0xac2b('0x1d')]=qs[_0xac2b('0x1d')](_0x2c7bc3['query'][_0xac2b('0x1d')]);}return _0x1bd519[_0xac2b('0x4d')](_0x5ac374);}})[_0xac2b('0x25')](function(_0x3853a0){if(_0x3853a0){return _0x3853a0?{'count':_0x23cc05,'rows':_0x3853a0}:null;}})[_0xac2b('0x25')](respondWithResult(_0x5db995,null))[_0xac2b('0x45')](handleError(_0x5db995,null));};exports[_0xac2b('0x4e')]=function(_0x36c4d6,_0x57eddb,_0x23a064){var _0x4beb55={};var _0xee1b4e={};var _0x372227;var _0x78ade4;return db[_0xac2b('0x2b')][_0xac2b('0x4c')]({'where':{'id':_0x36c4d6[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x57eddb,null))[_0xac2b('0x25')](function(_0x31b1cd){if(_0x31b1cd){_0x372227=_0x31b1cd;_0xee1b4e[_0xac2b('0x2e')]=_['keys'](db[_0xac2b('0x4f')][_0xac2b('0x2c')]);_0xee1b4e[_0xac2b('0x30')]=_['keys'](_0x36c4d6['query']);_0xee1b4e[_0xac2b('0x31')]=_['intersection'](_0xee1b4e['model'],_0xee1b4e[_0xac2b('0x30')]);_0x4beb55[_0xac2b('0x32')]=_[_0xac2b('0x33')](_0xee1b4e[_0xac2b('0x2e')],qs['fields'](_0x36c4d6[_0xac2b('0x30')]['fields']));_0x4beb55[_0xac2b('0x32')]=_0x4beb55[_0xac2b('0x32')][_0xac2b('0x35')]?_0x4beb55['attributes']:_0xee1b4e[_0xac2b('0x2e')];_0x4beb55[_0xac2b('0x50')]=qs[_0xac2b('0x37')](_0x36c4d6[_0xac2b('0x30')][_0xac2b('0x37')]);_0x4beb55[_0xac2b('0x3d')]=qs['filters'](_[_0xac2b('0x38')](_0x36c4d6[_0xac2b('0x30')],_0xee1b4e[_0xac2b('0x31')]));if(_0x36c4d6[_0xac2b('0x30')][_0xac2b('0x39')]){_0x4beb55[_0xac2b('0x3d')]=_['merge'](_0x4beb55[_0xac2b('0x3d')],{'$or':_['map'](_0x4beb55[_0xac2b('0x32')],function(_0x479f2a){var _0x5b808d={};_0x5b808d[_0x479f2a]={'$like':'%'+_0x36c4d6[_0xac2b('0x30')]['filter']+'%'};return _0x5b808d;})});}_0x4beb55=_['merge']({},_0x4beb55,_0x36c4d6[_0xac2b('0x3c')]);return _0x372227[_0xac2b('0x4e')](_0x4beb55);}})[_0xac2b('0x25')](function(_0x2ab077){if(_0x2ab077){_0x78ade4=_0x2ab077['length'];if(!_0x36c4d6[_0xac2b('0x30')][_0xac2b('0x36')](_0xac2b('0x4a'))){_0x4beb55['limit']=qs[_0xac2b('0x1f')](_0x36c4d6['query'][_0xac2b('0x1f')]);_0x4beb55[_0xac2b('0x1d')]=qs[_0xac2b('0x1d')](_0x36c4d6[_0xac2b('0x30')][_0xac2b('0x1d')]);}return _0x372227[_0xac2b('0x4e')](_0x4beb55);}})[_0xac2b('0x25')](function(_0x132d30){if(_0x132d30){return _0x132d30?{'count':_0x78ade4,'rows':_0x132d30}:null;}})[_0xac2b('0x25')](respondWithResult(_0x57eddb,null))['catch'](handleError(_0x57eddb,null));};exports[_0xac2b('0x51')]=function(_0x513ee5,_0x282459,_0x589ab0){if(_0x513ee5[_0xac2b('0x47')]['id']){delete _0x513ee5['body']['id'];}return db[_0xac2b('0x2b')]['findOne']({'where':{'id':_0x513ee5[_0xac2b('0x42')]['id']}})[_0xac2b('0x25')](handleEntityNotFound(_0x282459,null))[_0xac2b('0x25')](function(_0x378df0){if(_0x378df0){return _0x378df0[_0xac2b('0x51')](_0x513ee5['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x282459,null))['catch'](handleError(_0x282459,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ca4e832..a205c6d 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 _0x0972=['util','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0972,0x64));var _0x2097=function(_0x170ad1,_0x559a05){_0x170ad1=_0x170ad1-0x0;var _0x4db796=_0x0972[_0x170ad1];return _0x4db796;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f59=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','lodash'];(function(_0x9ec7b2,_0x2cc345){var _0x2f9675=function(_0x5f2fc4){while(--_0x5f2fc4){_0x9ec7b2['push'](_0x9ec7b2['shift']());}};_0x2f9675(++_0x2cc345);}(_0x8f59,0x11d));var _0x98f5=function(_0x2cbd58,_0x278e75){_0x2cbd58=_0x2cbd58-0x0;var _0x42ef2a=_0x8f59[_0x2cbd58];return _0x42ef2a;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var logger=require(_0x98f5('0x2'))(_0x98f5('0x3'));var moment=require(_0x98f5('0x4'));var BPromise=require(_0x98f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f5('0x6'));var rimraf=require(_0x98f5('0x7'));var config=require(_0x98f5('0x8'));var attributes=require(_0x98f5('0x9'));module['exports']=function(_0xdcce7a,_0x358618){return _0xdcce7a[_0x98f5('0xa')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index a584256..bd91ea4 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 _0x8830=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4eda4e,_0x3e95c5){var _0x5d026f=function(_0x43558b){while(--_0x43558b){_0x4eda4e['push'](_0x4eda4e['shift']());}};_0x5d026f(++_0x3e95c5);}(_0x8830,0xa6));var _0x0883=function(_0x48baec,_0x5e0d23){_0x48baec=_0x48baec-0x0;var _0x32cee3=_0x8830[_0x48baec];return _0x32cee3;};'use strict';var _=require(_0x0883('0x0'));var util=require(_0x0883('0x1'));var moment=require(_0x0883('0x2'));var BPromise=require(_0x0883('0x3'));var rs=require(_0x0883('0x4'));var fs=require('fs');var Redis=require(_0x0883('0x5'));var db=require(_0x0883('0x6'))['db'];var utils=require(_0x0883('0x7'));var logger=require(_0x0883('0x8'))(_0x0883('0x9'));var config=require(_0x0883('0xa'));var jayson=require(_0x0883('0xb'));var client=jayson[_0x0883('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18e951,_0x3a97eb,_0x15d411){return new BPromise(function(_0x3814fa,_0x49b0cb){return client[_0x0883('0xd')](_0x18e951,_0x15d411)['then'](function(_0x403ed1){logger[_0x0883('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3a97eb,_0x0883('0xf'));logger[_0x0883('0x10')](_0x0883('0x11'),_0x3a97eb,'request\x20sent',JSON[_0x0883('0x12')](_0x403ed1));if(_0x403ed1[_0x0883('0x13')]){if(_0x403ed1[_0x0883('0x13')][_0x0883('0x14')]===0x1f4){logger[_0x0883('0x13')](_0x0883('0x15'),_0x3a97eb,_0x403ed1[_0x0883('0x13')][_0x0883('0x16')]);return _0x49b0cb(_0x403ed1[_0x0883('0x13')][_0x0883('0x16')]);}logger[_0x0883('0x13')](_0x0883('0x15'),_0x3a97eb,_0x403ed1[_0x0883('0x13')][_0x0883('0x16')]);return _0x3814fa(_0x403ed1[_0x0883('0x13')][_0x0883('0x16')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x3a97eb,_0x0883('0xf'));_0x3814fa(_0x403ed1[_0x0883('0x17')][_0x0883('0x16')]);}})[_0x0883('0x18')](function(_0x3dc798){logger['error'](_0x0883('0x15'),_0x3a97eb,_0x3dc798);_0x49b0cb(_0x3dc798);});});} \ No newline at end of file +var _0xada7=['result','catch','lodash','moment','randomstring','../../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','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xada7,0x178));var _0x7ada=function(_0x2cbe8f,_0x1433a2){_0x2cbe8f=_0x2cbe8f-0x0;var _0x509791=_0xada7[_0x2cbe8f];return _0x509791;};'use strict';var _=require(_0x7ada('0x0'));var util=require('util');var moment=require(_0x7ada('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ada('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ada('0x3'))['db'];var utils=require(_0x7ada('0x4'));var logger=require(_0x7ada('0x5'))(_0x7ada('0x6'));var config=require(_0x7ada('0x7'));var jayson=require(_0x7ada('0x8'));var client=jayson[_0x7ada('0x9')][_0x7ada('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x350aa5,_0x2a0b77,_0x1c4d8f){return new BPromise(function(_0x397d5f,_0x72b31b){return client['request'](_0x350aa5,_0x1c4d8f)[_0x7ada('0xb')](function(_0x3c10b5){logger[_0x7ada('0xc')](_0x7ada('0xd'),_0x2a0b77,_0x7ada('0xe'));logger[_0x7ada('0xf')](_0x7ada('0x10'),_0x2a0b77,_0x7ada('0xe'),JSON['stringify'](_0x3c10b5));if(_0x3c10b5[_0x7ada('0x11')]){if(_0x3c10b5[_0x7ada('0x11')][_0x7ada('0x12')]===0x1f4){logger[_0x7ada('0x11')](_0x7ada('0xd'),_0x2a0b77,_0x3c10b5[_0x7ada('0x11')][_0x7ada('0x13')]);return _0x72b31b(_0x3c10b5[_0x7ada('0x11')][_0x7ada('0x13')]);}logger[_0x7ada('0x11')](_0x7ada('0xd'),_0x2a0b77,_0x3c10b5[_0x7ada('0x11')]['message']);return _0x397d5f(_0x3c10b5['error']['message']);}else{logger[_0x7ada('0xc')](_0x7ada('0xd'),_0x2a0b77,_0x7ada('0xe'));_0x397d5f(_0x3c10b5[_0x7ada('0x14')]['message']);}})[_0x7ada('0x15')](function(_0x5170de){logger['error'](_0x7ada('0xd'),_0x2a0b77,_0x5170de);_0x72b31b(_0x5170de);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index e07aacf..8bb4a11 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 _0x409c=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','get','index','isAuthenticated','show','post'];(function(_0x38a792,_0x5a21a5){var _0x2cee7b=function(_0x3e9555){while(--_0x3e9555){_0x38a792['push'](_0x38a792['shift']());}};_0x2cee7b(++_0x5a21a5);}(_0x409c,0x7d));var _0xc409=function(_0x2d4777,_0x1c3020){_0x2d4777=_0x2d4777-0x0;var _0x564c5f=_0x409c[_0x2d4777];return _0x564c5f;};'use strict';var multer=require('multer');var util=require(_0xc409('0x0'));var path=require(_0xc409('0x1'));var timeout=require(_0xc409('0x2'));var express=require(_0xc409('0x3'));var router=express[_0xc409('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc409('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xc409('0x6')]('/',auth['isAuthenticated'](),controller[_0xc409('0x7')]);router[_0xc409('0x6')]('/:id',auth[_0xc409('0x8')](),controller[_0xc409('0x9')]);router[_0xc409('0xa')]('/',auth[_0xc409('0x8')](),controller['create']);router[_0xc409('0xb')](_0xc409('0xc'),auth[_0xc409('0x8')](),controller[_0xc409('0xd')]);router[_0xc409('0xe')]('/:id',auth[_0xc409('0x8')](),controller[_0xc409('0xf')]);module[_0xc409('0x10')]=router; \ No newline at end of file +var _0xba8c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','create','update','delete'];(function(_0x246db4,_0x382f5d){var _0x58826a=function(_0x3c4e55){while(--_0x3c4e55){_0x246db4['push'](_0x246db4['shift']());}};_0x58826a(++_0x382f5d);}(_0xba8c,0xeb));var _0xcba8=function(_0x3838f7,_0x37a398){_0x3838f7=_0x3838f7-0x0;var _0xd51595=_0xba8c[_0x3838f7];return _0xd51595;};'use strict';var multer=require(_0xcba8('0x0'));var util=require(_0xcba8('0x1'));var path=require(_0xcba8('0x2'));var timeout=require(_0xcba8('0x3'));var express=require(_0xcba8('0x4'));var router=express['Router']();var fs_extra=require(_0xcba8('0x5'));var auth=require(_0xcba8('0x6'));var interaction=require(_0xcba8('0x7'));var config=require(_0xcba8('0x8'));var controller=require(_0xcba8('0x9'));router[_0xcba8('0xa')]('/',auth[_0xcba8('0xb')](),controller['index']);router[_0xcba8('0xa')](_0xcba8('0xc'),auth[_0xcba8('0xb')](),controller[_0xcba8('0xd')]);router['post']('/',auth[_0xcba8('0xb')](),controller[_0xcba8('0xe')]);router['put'](_0xcba8('0xc'),auth[_0xcba8('0xb')](),controller[_0xcba8('0xf')]);router[_0xcba8('0x10')](_0xcba8('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xcba8('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 ededa6c..80eddf3 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 _0xa926=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xa926,0x64));var _0x6a92=function(_0x1054a1,_0x9b6bdd){_0x1054a1=_0x1054a1-0x0;var _0x3b2e86=_0xa926[_0x1054a1];return _0x3b2e86;};'use strict';var Sequelize=require(_0x6a92('0x0'));module[_0x6a92('0x1')]={'type':{'type':Sequelize[_0x6a92('0x2')]('string','variable',_0x6a92('0x3'),_0x6a92('0x4'),_0x6a92('0x5')),'defaultValue':_0x6a92('0x6')},'content':{'type':Sequelize[_0x6a92('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6a92('0x6'),'variable',_0x6a92('0x3'))},'keyContent':{'type':Sequelize[_0x6a92('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6a92('0x7')]},'customField':{'type':Sequelize[_0x6a92('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a92('0x7')]}}; \ No newline at end of file +var _0x22dd=['picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable','keyValue'];(function(_0x2eafd5,_0x55653e){var _0x394c31=function(_0xbcc01){while(--_0xbcc01){_0x2eafd5['push'](_0x2eafd5['shift']());}};_0x394c31(++_0x55653e);}(_0x22dd,0x187));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd22d('0x0'));module['exports']={'type':{'type':Sequelize[_0xd22d('0x1')](_0xd22d('0x2'),_0xd22d('0x3'),'customVariable',_0xd22d('0x4'),_0xd22d('0x5')),'defaultValue':_0xd22d('0x2')},'content':{'type':Sequelize[_0xd22d('0x6')]},'key':{'type':Sequelize[_0xd22d('0x6')]},'keyType':{'type':Sequelize[_0xd22d('0x1')](_0xd22d('0x2'),'variable',_0xd22d('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd22d('0x6')]},'nameField':{'type':Sequelize[_0xd22d('0x6')]},'customField':{'type':Sequelize[_0xd22d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd22d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index e7b2088..f02bebf 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 _0x253c=['pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x253c,0x13f));var _0xc253=function(_0x3b7976,_0x540132){_0x3b7976=_0x3b7976-0x0;var _0x51fc0f=_0x253c[_0x3b7976];return _0x51fc0f;};'use strict';var emlformat=require(_0xc253('0x0'));var rimraf=require(_0xc253('0x1'));var zipdir=require(_0xc253('0x2'));var jsonpatch=require(_0xc253('0x3'));var rp=require(_0xc253('0x4'));var moment=require(_0xc253('0x5'));var BPromise=require(_0xc253('0x6'));var Mustache=require(_0xc253('0x7'));var util=require(_0xc253('0x8'));var path=require(_0xc253('0x9'));var sox=require(_0xc253('0xa'));var csv=require('to-csv');var ejs=require(_0xc253('0xb'));var fs=require('fs');var fs_extra=require(_0xc253('0xc'));var _=require('lodash');var squel=require(_0xc253('0xd'));var crypto=require(_0xc253('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc253('0xf'));var toCsv=require(_0xc253('0x10'));var querystring=require(_0xc253('0x11'));var Papa=require(_0xc253('0x12'));var Redis=require('ioredis');var authService=require(_0xc253('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc253('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc253('0x15'))(_0xc253('0x16'));var utils=require('../../config/utils');var config=require(_0xc253('0x17'));var licenseUtil=require(_0xc253('0x18'));var db=require(_0xc253('0x19'))['db'];function respondWithStatusCode(_0x446967,_0x3ad2d5){_0x3ad2d5=_0x3ad2d5||0xcc;return function(_0x1428df){if(_0x1428df){return _0x446967[_0xc253('0x1a')](_0x3ad2d5);}return _0x446967[_0xc253('0x1b')](_0x3ad2d5)[_0xc253('0x1c')]();};}function respondWithResult(_0x4fdb54,_0x1f4542){_0x1f4542=_0x1f4542||0xc8;return function(_0x5a7f24){if(_0x5a7f24){return _0x4fdb54[_0xc253('0x1b')](_0x1f4542)['json'](_0x5a7f24);}};}function respondWithFilteredResult(_0x479566,_0x477106){return function(_0x3ae330){if(_0x3ae330){var _0x13f373=typeof _0x477106[_0xc253('0x1d')]==='undefined'&&typeof _0x477106['limit']===_0xc253('0x1e');var _0x17370b=_0x3ae330['count'];var _0x48e147=_0x13f373?0x0:_0x477106[_0xc253('0x1d')];var _0x982b88=_0x13f373?_0x3ae330[_0xc253('0x1f')]:_0x477106[_0xc253('0x1d')]+_0x477106[_0xc253('0x20')];var _0x3a6358;if(_0x982b88>=_0x17370b){_0x982b88=_0x17370b;_0x3a6358=0xc8;}else{_0x3a6358=0xce;}_0x479566[_0xc253('0x1b')](_0x3a6358);return _0x479566[_0xc253('0x21')](_0xc253('0x22'),_0x48e147+'-'+_0x982b88+'/'+_0x17370b)[_0xc253('0x23')](_0x3ae330);}return null;};}function patchUpdates(_0x21f329){return function(_0x18d639){try{jsonpatch[_0xc253('0x24')](_0x18d639,_0x21f329,!![]);}catch(_0x36b1a7){return BPromise[_0xc253('0x25')](_0x36b1a7);}return _0x18d639['save']();};}function saveUpdates(_0x5833e6,_0xf28750){return function(_0x2a2171){if(_0x2a2171){return _0x2a2171[_0xc253('0x26')](_0x5833e6)['then'](function(_0x1dc641){return _0x1dc641;});}return null;};}function removeEntity(_0x345e11,_0x5bd052){return function(_0x4fa60d){if(_0x4fa60d){return _0x4fa60d['destroy']()[_0xc253('0x27')](function(){_0x345e11['status'](0xcc)[_0xc253('0x1c')]();});}};}function handleEntityNotFound(_0x5d14a6,_0x13aaf2){return function(_0x39e569){if(!_0x39e569){_0x5d14a6[_0xc253('0x1a')](0x194);}return _0x39e569;};}function handleError(_0x96914d,_0xb52ea4){_0xb52ea4=_0xb52ea4||0x1f4;return function(_0x35aa81){logger[_0xc253('0x28')](_0x35aa81['stack']);if(_0x35aa81[_0xc253('0x29')]){delete _0x35aa81[_0xc253('0x29')];}_0x96914d['status'](_0xb52ea4)[_0xc253('0x2a')](_0x35aa81);};}exports[_0xc253('0x2b')]=function(_0x52387b,_0x2271ed){var _0x2993b2={},_0x418abb={},_0x12c4f3={'count':0x0,'rows':[]};var _0x58ab77=_[_0xc253('0x2c')](db[_0xc253('0x2d')][_0xc253('0x2e')],function(_0x20bb93){return{'name':_0x20bb93[_0xc253('0x2f')],'type':_0x20bb93[_0xc253('0x30')][_0xc253('0x31')]};});_0x418abb[_0xc253('0x32')]=_[_0xc253('0x2c')](_0x58ab77,_0xc253('0x29'));_0x418abb[_0xc253('0x33')]=_['keys'](_0x52387b[_0xc253('0x33')]);_0x418abb[_0xc253('0x34')]=_[_0xc253('0x35')](_0x418abb['model'],_0x418abb[_0xc253('0x33')]);_0x2993b2['attributes']=_[_0xc253('0x35')](_0x418abb[_0xc253('0x32')],qs['fields'](_0x52387b[_0xc253('0x33')][_0xc253('0x36')]));_0x2993b2[_0xc253('0x37')]=_0x2993b2['attributes']['length']?_0x2993b2[_0xc253('0x37')]:_0x418abb[_0xc253('0x32')];if(!_0x52387b['query'][_0xc253('0x38')](_0xc253('0x39'))){_0x2993b2[_0xc253('0x20')]=qs[_0xc253('0x20')](_0x52387b[_0xc253('0x33')][_0xc253('0x20')]);_0x2993b2[_0xc253('0x1d')]=qs[_0xc253('0x1d')](_0x52387b[_0xc253('0x33')]['offset']);}_0x2993b2[_0xc253('0x3a')]=qs[_0xc253('0x3b')](_0x52387b[_0xc253('0x33')][_0xc253('0x3b')]);_0x2993b2[_0xc253('0x3c')]=qs[_0xc253('0x34')](_[_0xc253('0x3d')](_0x52387b['query'],_0x418abb[_0xc253('0x34')]),_0x58ab77);if(_0x52387b[_0xc253('0x33')]['filter']){_0x2993b2[_0xc253('0x3c')]=_[_0xc253('0x3e')](_0x2993b2['where'],{'$or':_[_0xc253('0x2c')](_0x58ab77,function(_0x122bba){if(_0x122bba[_0xc253('0x30')]!==_0xc253('0x3f')){var _0x241847={};_0x241847[_0x122bba[_0xc253('0x29')]]={'$like':'%'+_0x52387b['query']['filter']+'%'};return _0x241847;}})});}_0x2993b2=_['merge']({},_0x2993b2,_0x52387b[_0xc253('0x40')]);var _0x19e4a4={'where':_0x2993b2[_0xc253('0x3c')]};return db[_0xc253('0x2d')][_0xc253('0x1f')](_0x19e4a4)[_0xc253('0x27')](function(_0xac31a4){_0x12c4f3[_0xc253('0x1f')]=_0xac31a4;if(_0x52387b[_0xc253('0x33')]['includeAll']){_0x2993b2[_0xc253('0x41')]=[{'all':!![]}];}return db[_0xc253('0x2d')][_0xc253('0x42')](_0x2993b2);})[_0xc253('0x27')](function(_0x36cf88){_0x12c4f3[_0xc253('0x43')]=_0x36cf88;return _0x12c4f3;})[_0xc253('0x27')](respondWithFilteredResult(_0x2271ed,_0x2993b2))[_0xc253('0x44')](handleError(_0x2271ed,null));};exports[_0xc253('0x45')]=function(_0x232087,_0x55a86f){var _0x340e2b={'raw':!![],'where':{'id':_0x232087['params']['id']}},_0x1913a4={};_0x1913a4['model']=_[_0xc253('0x46')](db['ZendeskField'][_0xc253('0x2e')]);_0x1913a4['query']=_[_0xc253('0x46')](_0x232087['query']);_0x1913a4['filters']=_[_0xc253('0x35')](_0x1913a4[_0xc253('0x32')],_0x1913a4[_0xc253('0x33')]);_0x340e2b[_0xc253('0x37')]=_[_0xc253('0x35')](_0x1913a4[_0xc253('0x32')],qs[_0xc253('0x36')](_0x232087[_0xc253('0x33')][_0xc253('0x36')]));_0x340e2b[_0xc253('0x37')]=_0x340e2b[_0xc253('0x37')]['length']?_0x340e2b[_0xc253('0x37')]:_0x1913a4[_0xc253('0x32')];if(_0x232087[_0xc253('0x33')][_0xc253('0x47')]){_0x340e2b[_0xc253('0x41')]=[{'all':!![]}];}_0x340e2b=_['merge']({},_0x340e2b,_0x232087[_0xc253('0x40')]);return db[_0xc253('0x2d')][_0xc253('0x48')](_0x340e2b)['then'](handleEntityNotFound(_0x55a86f,null))['then'](respondWithResult(_0x55a86f,null))[_0xc253('0x44')](handleError(_0x55a86f,null));};exports['create']=function(_0x3a763f,_0x24bfb2){return db[_0xc253('0x2d')][_0xc253('0x49')](_0x3a763f['body'],{})[_0xc253('0x27')](respondWithResult(_0x24bfb2,0xc9))[_0xc253('0x44')](handleError(_0x24bfb2,null));};exports[_0xc253('0x26')]=function(_0x2de1a7,_0x57d1ad){if(_0x2de1a7[_0xc253('0x4a')]['id']){delete _0x2de1a7['body']['id'];}return db[_0xc253('0x2d')][_0xc253('0x48')]({'where':{'id':_0x2de1a7['params']['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x57d1ad,null))['then'](saveUpdates(_0x2de1a7[_0xc253('0x4a')],null))[_0xc253('0x27')](respondWithResult(_0x57d1ad,null))['catch'](handleError(_0x57d1ad,null));};exports['destroy']=function(_0xacf0,_0x4b0d41){return db[_0xc253('0x2d')]['find']({'where':{'id':_0xacf0[_0xc253('0x4b')]['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x4b0d41,null))['then'](removeEntity(_0x4b0d41,null))[_0xc253('0x44')](handleError(_0x4b0d41,null));}; \ No newline at end of file +var _0xd953=['limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','params','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0xe2f12,_0x45419c){var _0x21e14b=function(_0x17749a){while(--_0x17749a){_0xe2f12['push'](_0xe2f12['shift']());}};_0x21e14b(++_0x45419c);}(_0xd953,0x1f0));var _0x3d95=function(_0x17dcd7,_0x2b8951){_0x17dcd7=_0x17dcd7-0x0;var _0x174581=_0xd953[_0x17dcd7];return _0x174581;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d95('0x0'));var zipdir=require(_0x3d95('0x1'));var jsonpatch=require(_0x3d95('0x2'));var rp=require('request-promise');var moment=require(_0x3d95('0x3'));var BPromise=require(_0x3d95('0x4'));var Mustache=require(_0x3d95('0x5'));var util=require('util');var path=require(_0x3d95('0x6'));var sox=require(_0x3d95('0x7'));var csv=require(_0x3d95('0x8'));var ejs=require(_0x3d95('0x9'));var fs=require('fs');var fs_extra=require(_0x3d95('0xa'));var _=require('lodash');var squel=require(_0x3d95('0xb'));var crypto=require(_0x3d95('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3d95('0x8'));var querystring=require(_0x3d95('0xd'));var Papa=require(_0x3d95('0xe'));var Redis=require(_0x3d95('0xf'));var authService=require(_0x3d95('0x10'));var qs=require(_0x3d95('0x11'));var as=require(_0x3d95('0x12'));var hardwareService=require(_0x3d95('0x13'));var logger=require(_0x3d95('0x14'))(_0x3d95('0x15'));var utils=require('../../config/utils');var config=require(_0x3d95('0x16'));var licenseUtil=require(_0x3d95('0x17'));var db=require(_0x3d95('0x18'))['db'];function respondWithStatusCode(_0x5c8fe6,_0x587be5){_0x587be5=_0x587be5||0xcc;return function(_0x3e9c03){if(_0x3e9c03){return _0x5c8fe6[_0x3d95('0x19')](_0x587be5);}return _0x5c8fe6['status'](_0x587be5)[_0x3d95('0x1a')]();};}function respondWithResult(_0x43555b,_0x2e0f74){_0x2e0f74=_0x2e0f74||0xc8;return function(_0x25acf6){if(_0x25acf6){return _0x43555b[_0x3d95('0x1b')](_0x2e0f74)[_0x3d95('0x1c')](_0x25acf6);}};}function respondWithFilteredResult(_0x91764,_0xcc2fc2){return function(_0x33ce4a){if(_0x33ce4a){var _0x56e33d=typeof _0xcc2fc2['offset']==='undefined'&&typeof _0xcc2fc2[_0x3d95('0x1d')]==='undefined';var _0xffdce6=_0x33ce4a[_0x3d95('0x1e')];var _0x439478=_0x56e33d?0x0:_0xcc2fc2[_0x3d95('0x1f')];var _0x36735e=_0x56e33d?_0x33ce4a[_0x3d95('0x1e')]:_0xcc2fc2[_0x3d95('0x1f')]+_0xcc2fc2[_0x3d95('0x1d')];var _0x56701d;if(_0x36735e>=_0xffdce6){_0x36735e=_0xffdce6;_0x56701d=0xc8;}else{_0x56701d=0xce;}_0x91764['status'](_0x56701d);return _0x91764['set'](_0x3d95('0x20'),_0x439478+'-'+_0x36735e+'/'+_0xffdce6)[_0x3d95('0x1c')](_0x33ce4a);}return null;};}function patchUpdates(_0x445ff8){return function(_0x58c259){try{jsonpatch[_0x3d95('0x21')](_0x58c259,_0x445ff8,!![]);}catch(_0x571645){return BPromise[_0x3d95('0x22')](_0x571645);}return _0x58c259[_0x3d95('0x23')]();};}function saveUpdates(_0xb28600,_0xbcb7a6){return function(_0x29c6b1){if(_0x29c6b1){return _0x29c6b1[_0x3d95('0x24')](_0xb28600)[_0x3d95('0x25')](function(_0x262802){return _0x262802;});}return null;};}function removeEntity(_0x500d0e,_0x32acde){return function(_0x39f199){if(_0x39f199){return _0x39f199[_0x3d95('0x26')]()['then'](function(){_0x500d0e[_0x3d95('0x1b')](0xcc)[_0x3d95('0x1a')]();});}};}function handleEntityNotFound(_0x2c1006,_0x5c2a0d){return function(_0x1428a4){if(!_0x1428a4){_0x2c1006[_0x3d95('0x19')](0x194);}return _0x1428a4;};}function handleError(_0x2eaa59,_0x1305b1){_0x1305b1=_0x1305b1||0x1f4;return function(_0xb4bf22){logger[_0x3d95('0x27')](_0xb4bf22[_0x3d95('0x28')]);if(_0xb4bf22['name']){delete _0xb4bf22['name'];}_0x2eaa59[_0x3d95('0x1b')](_0x1305b1)[_0x3d95('0x29')](_0xb4bf22);};}exports[_0x3d95('0x2a')]=function(_0x3d28e3,_0x4005f5){var _0x21a503={},_0x18a5c8={},_0x2ebb0d={'count':0x0,'rows':[]};var _0x34e105=_[_0x3d95('0x2b')](db[_0x3d95('0x2c')][_0x3d95('0x2d')],function(_0x3c74ea){return{'name':_0x3c74ea[_0x3d95('0x2e')],'type':_0x3c74ea[_0x3d95('0x2f')][_0x3d95('0x30')]};});_0x18a5c8['model']=_[_0x3d95('0x2b')](_0x34e105,_0x3d95('0x31'));_0x18a5c8[_0x3d95('0x32')]=_[_0x3d95('0x33')](_0x3d28e3[_0x3d95('0x32')]);_0x18a5c8[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x18a5c8['model'],_0x18a5c8[_0x3d95('0x32')]);_0x21a503[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x18a5c8[_0x3d95('0x37')],qs[_0x3d95('0x38')](_0x3d28e3[_0x3d95('0x32')]['fields']));_0x21a503[_0x3d95('0x36')]=_0x21a503[_0x3d95('0x36')][_0x3d95('0x39')]?_0x21a503[_0x3d95('0x36')]:_0x18a5c8[_0x3d95('0x37')];if(!_0x3d28e3[_0x3d95('0x32')][_0x3d95('0x3a')](_0x3d95('0x3b'))){_0x21a503[_0x3d95('0x1d')]=qs[_0x3d95('0x1d')](_0x3d28e3[_0x3d95('0x32')][_0x3d95('0x1d')]);_0x21a503[_0x3d95('0x1f')]=qs['offset'](_0x3d28e3['query']['offset']);}_0x21a503['order']=qs[_0x3d95('0x3c')](_0x3d28e3[_0x3d95('0x32')]['sort']);_0x21a503[_0x3d95('0x3d')]=qs[_0x3d95('0x34')](_[_0x3d95('0x3e')](_0x3d28e3[_0x3d95('0x32')],_0x18a5c8[_0x3d95('0x34')]),_0x34e105);if(_0x3d28e3['query']['filter']){_0x21a503[_0x3d95('0x3d')]=_[_0x3d95('0x3f')](_0x21a503[_0x3d95('0x3d')],{'$or':_[_0x3d95('0x2b')](_0x34e105,function(_0x27bbb0){if(_0x27bbb0[_0x3d95('0x2f')]!==_0x3d95('0x40')){var _0x2fe4e7={};_0x2fe4e7[_0x27bbb0[_0x3d95('0x31')]]={'$like':'%'+_0x3d28e3[_0x3d95('0x32')][_0x3d95('0x41')]+'%'};return _0x2fe4e7;}})});}_0x21a503=_[_0x3d95('0x3f')]({},_0x21a503,_0x3d28e3['options']);var _0x30fa82={'where':_0x21a503[_0x3d95('0x3d')]};return db['ZendeskField'][_0x3d95('0x1e')](_0x30fa82)[_0x3d95('0x25')](function(_0x336810){_0x2ebb0d['count']=_0x336810;if(_0x3d28e3[_0x3d95('0x32')]['includeAll']){_0x21a503[_0x3d95('0x42')]=[{'all':!![]}];}return db[_0x3d95('0x2c')][_0x3d95('0x43')](_0x21a503);})[_0x3d95('0x25')](function(_0x43bcdb){_0x2ebb0d['rows']=_0x43bcdb;return _0x2ebb0d;})[_0x3d95('0x25')](respondWithFilteredResult(_0x4005f5,_0x21a503))[_0x3d95('0x44')](handleError(_0x4005f5,null));};exports['show']=function(_0x3fcb9f,_0x1232b6){var _0x10be9e={'raw':!![],'where':{'id':_0x3fcb9f[_0x3d95('0x45')]['id']}},_0x5e23dc={};_0x5e23dc[_0x3d95('0x37')]=_[_0x3d95('0x33')](db[_0x3d95('0x2c')]['rawAttributes']);_0x5e23dc['query']=_[_0x3d95('0x33')](_0x3fcb9f[_0x3d95('0x32')]);_0x5e23dc[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x5e23dc['model'],_0x5e23dc['query']);_0x10be9e[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x5e23dc[_0x3d95('0x37')],qs['fields'](_0x3fcb9f['query'][_0x3d95('0x38')]));_0x10be9e[_0x3d95('0x36')]=_0x10be9e[_0x3d95('0x36')][_0x3d95('0x39')]?_0x10be9e['attributes']:_0x5e23dc['model'];if(_0x3fcb9f['query'][_0x3d95('0x46')]){_0x10be9e['include']=[{'all':!![]}];}_0x10be9e=_[_0x3d95('0x3f')]({},_0x10be9e,_0x3fcb9f[_0x3d95('0x47')]);return db[_0x3d95('0x2c')][_0x3d95('0x48')](_0x10be9e)[_0x3d95('0x25')](handleEntityNotFound(_0x1232b6,null))[_0x3d95('0x25')](respondWithResult(_0x1232b6,null))['catch'](handleError(_0x1232b6,null));};exports[_0x3d95('0x49')]=function(_0x4a38d7,_0x2075ee){return db['ZendeskField'][_0x3d95('0x49')](_0x4a38d7[_0x3d95('0x4a')],{})[_0x3d95('0x25')](respondWithResult(_0x2075ee,0xc9))['catch'](handleError(_0x2075ee,null));};exports[_0x3d95('0x24')]=function(_0x4f4a89,_0x47f28b){if(_0x4f4a89['body']['id']){delete _0x4f4a89[_0x3d95('0x4a')]['id'];}return db[_0x3d95('0x2c')][_0x3d95('0x48')]({'where':{'id':_0x4f4a89['params']['id']}})['then'](handleEntityNotFound(_0x47f28b,null))['then'](saveUpdates(_0x4f4a89[_0x3d95('0x4a')],null))[_0x3d95('0x25')](respondWithResult(_0x47f28b,null))[_0x3d95('0x44')](handleError(_0x47f28b,null));};exports[_0x3d95('0x26')]=function(_0x4bc7f0,_0x447eae){return db[_0x3d95('0x2c')]['find']({'where':{'id':_0x4bc7f0[_0x3d95('0x45')]['id']}})[_0x3d95('0x25')](handleEntityNotFound(_0x447eae,null))[_0x3d95('0x25')](removeEntity(_0x447eae,null))['catch'](handleError(_0x447eae,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5a38b6a..48d42e0 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 _0xaffd=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x254fab,_0x280101){var _0x5546e6=function(_0x5d1f0f){while(--_0x5d1f0f){_0x254fab['push'](_0x254fab['shift']());}};_0x5546e6(++_0x280101);}(_0xaffd,0x13b));var _0xdaff=function(_0x5d94bd,_0x4f777f){_0x5d94bd=_0x5d94bd-0x0;var _0xacb86b=_0xaffd[_0x5d94bd];return _0xacb86b;};'use strict';var _=require(_0xdaff('0x0'));var util=require('util');var logger=require(_0xdaff('0x1'))(_0xdaff('0x2'));var moment=require('moment');var BPromise=require(_0xdaff('0x3'));var rp=require(_0xdaff('0x4'));var fs=require('fs');var path=require(_0xdaff('0x5'));var rimraf=require('rimraf');var config=require(_0xdaff('0x6'));var attributes=require(_0xdaff('0x7'));module[_0xdaff('0x8')]=function(_0x2b0c41,_0x545692){return _0x2b0c41[_0xdaff('0x9')](_0xdaff('0xa'),attributes,{'tableName':_0xdaff('0xb'),'paranoid':![],'indexes':[{'name':_0xdaff('0xc'),'fields':[_0xdaff('0xd'),_0xdaff('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2867=['api','bluebird','request-promise','../../config/environment','define','zendesk_unique_index','lodash','../../config/logger'];(function(_0x103c03,_0xfde8d3){var _0x39f4f6=function(_0x591c1d){while(--_0x591c1d){_0x103c03['push'](_0x103c03['shift']());}};_0x39f4f6(++_0xfde8d3);}(_0x2867,0x166));var _0x7286=function(_0x32088f,_0x538e0a){_0x32088f=_0x32088f-0x0;var _0x43abf1=_0x2867[_0x32088f];return _0x43abf1;};'use strict';var _=require(_0x7286('0x0'));var util=require('util');var logger=require(_0x7286('0x1'))(_0x7286('0x2'));var moment=require('moment');var BPromise=require(_0x7286('0x3'));var rp=require(_0x7286('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7286('0x5'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x11421b,_0x291ef5){return _0x11421b[_0x7286('0x6')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x7286('0x7'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 540762b..98853b6 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 _0xe902=['../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','catch','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x122650,_0x47cafd){var _0x14c028=function(_0x40305d){while(--_0x40305d){_0x122650['push'](_0x122650['shift']());}};_0x14c028(++_0x47cafd);}(_0xe902,0x128));var _0x2e90=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe902[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x2e90('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e90('0x1'));var db=require(_0x2e90('0x2'))['db'];var utils=require(_0x2e90('0x3'));var logger=require(_0x2e90('0x4'))(_0x2e90('0x5'));var config=require(_0x2e90('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e90('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1d2b,_0x1219ca,_0x3a2dc9){return new BPromise(function(_0x521e37,_0x22360b){return client[_0x2e90('0x8')](_0x2e1d2b,_0x3a2dc9)[_0x2e90('0x9')](function(_0x281651){logger[_0x2e90('0xa')]('ZendeskField,\x20%s,\x20%s',_0x1219ca,_0x2e90('0xb'));logger[_0x2e90('0xc')](_0x2e90('0xd'),_0x1219ca,_0x2e90('0xb'),JSON[_0x2e90('0xe')](_0x281651));if(_0x281651[_0x2e90('0xf')]){if(_0x281651[_0x2e90('0xf')][_0x2e90('0x10')]===0x1f4){logger[_0x2e90('0xf')](_0x2e90('0x11'),_0x1219ca,_0x281651[_0x2e90('0xf')][_0x2e90('0x12')]);return _0x22360b(_0x281651[_0x2e90('0xf')][_0x2e90('0x12')]);}logger[_0x2e90('0xf')]('ZendeskField,\x20%s,\x20%s',_0x1219ca,_0x281651[_0x2e90('0xf')][_0x2e90('0x12')]);return _0x521e37(_0x281651[_0x2e90('0xf')][_0x2e90('0x12')]);}else{logger[_0x2e90('0xa')](_0x2e90('0x11'),_0x1219ca,_0x2e90('0xb'));_0x521e37(_0x281651['result']['message']);}})[_0x2e90('0x13')](function(_0x4083a6){logger[_0x2e90('0xf')](_0x2e90('0x11'),_0x1219ca,_0x4083a6);_0x22360b(_0x4083a6);});});} \ No newline at end of file +var _0xfd66=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util'];(function(_0x1bc969,_0x20e907){var _0x3830b9=function(_0x5d4c0e){while(--_0x5d4c0e){_0x1bc969['push'](_0x1bc969['shift']());}};_0x3830b9(++_0x20e907);}(_0xfd66,0xda));var _0x6fd6=function(_0xcf6ffb,_0x1064d2){_0xcf6ffb=_0xcf6ffb-0x0;var _0x2acd49=_0xfd66[_0xcf6ffb];return _0x2acd49;};'use strict';var _=require(_0x6fd6('0x0'));var util=require(_0x6fd6('0x1'));var moment=require(_0x6fd6('0x2'));var BPromise=require(_0x6fd6('0x3'));var rs=require(_0x6fd6('0x4'));var fs=require('fs');var Redis=require(_0x6fd6('0x5'));var db=require(_0x6fd6('0x6'))['db'];var utils=require(_0x6fd6('0x7'));var logger=require(_0x6fd6('0x8'))(_0x6fd6('0x9'));var config=require(_0x6fd6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6fd6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311bf9,_0x33a330,_0x555730){return new BPromise(function(_0x59c32e,_0x5dfc48){return client[_0x6fd6('0xc')](_0x311bf9,_0x555730)[_0x6fd6('0xd')](function(_0x5b0934){logger['info'](_0x6fd6('0xe'),_0x33a330,'request\x20sent');logger[_0x6fd6('0xf')](_0x6fd6('0x10'),_0x33a330,'request\x20sent',JSON['stringify'](_0x5b0934));if(_0x5b0934[_0x6fd6('0x11')]){if(_0x5b0934[_0x6fd6('0x11')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x33a330,_0x5b0934[_0x6fd6('0x11')][_0x6fd6('0x12')]);return _0x5dfc48(_0x5b0934['error'][_0x6fd6('0x12')]);}logger[_0x6fd6('0x11')]('ZendeskField,\x20%s,\x20%s',_0x33a330,_0x5b0934[_0x6fd6('0x11')][_0x6fd6('0x12')]);return _0x59c32e(_0x5b0934['error'][_0x6fd6('0x12')]);}else{logger[_0x6fd6('0x13')](_0x6fd6('0xe'),_0x33a330,'request\x20sent');_0x59c32e(_0x5b0934[_0x6fd6('0x14')][_0x6fd6('0x12')]);}})[_0x6fd6('0x15')](function(_0x263838){logger[_0x6fd6('0x11')](_0x6fd6('0xe'),_0x33a330,_0x263838);_0x5dfc48(_0x263838);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4c9a63f..d471d8b 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 _0x050e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x1184e6,_0x567817){var _0x52052d=function(_0x178525){while(--_0x178525){_0x1184e6['push'](_0x1184e6['shift']());}};_0x52052d(++_0x567817);}(_0x050e,0x6e));var _0xe050=function(_0x36bb19,_0x8eed11){_0x36bb19=_0x36bb19-0x0;var _0x3ca8ac=_0x050e[_0x36bb19];return _0x3ca8ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe050('0x0'));var timeout=require(_0xe050('0x1'));var express=require(_0xe050('0x2'));var router=express[_0xe050('0x3')]();var fs_extra=require(_0xe050('0x4'));var auth=require(_0xe050('0x5'));var interaction=require(_0xe050('0x6'));var config=require(_0xe050('0x7'));var controller=require('./intZohoAccount.controller');router[_0xe050('0x8')]('/',auth[_0xe050('0x9')](),controller[_0xe050('0xa')]);router['get'](_0xe050('0xb'),auth[_0xe050('0x9')](),controller[_0xe050('0xc')]);router['get'](_0xe050('0xd'),auth[_0xe050('0x9')](),controller[_0xe050('0xe')]);router['get'](_0xe050('0xf'),auth[_0xe050('0x9')](),controller[_0xe050('0x10')]);router[_0xe050('0x11')]('/',auth[_0xe050('0x9')](),controller['create']);router['post'](_0xe050('0xd'),auth[_0xe050('0x9')](),controller[_0xe050('0x12')]);router[_0xe050('0x13')]('/:id',auth[_0xe050('0x9')](),controller['update']);router[_0xe050('0x14')](_0xe050('0xb'),auth[_0xe050('0x9')](),controller[_0xe050('0x15')]);module[_0xe050('0x16')]=router; \ No newline at end of file +var _0xc37d=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x4669e4,_0x5459e7){var _0x354ce7=function(_0x3256fd){while(--_0x3256fd){_0x4669e4['push'](_0x4669e4['shift']());}};_0x354ce7(++_0x5459e7);}(_0xc37d,0x192));var _0xdc37=function(_0x2156c3,_0x2c8a71){_0x2156c3=_0x2156c3-0x0;var _0x4c393d=_0xc37d[_0x2156c3];return _0x4c393d;};'use strict';var multer=require(_0xdc37('0x0'));var util=require(_0xdc37('0x1'));var path=require(_0xdc37('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc37('0x3'));var router=express[_0xdc37('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdc37('0x5'));var interaction=require(_0xdc37('0x6'));var config=require(_0xdc37('0x7'));var controller=require(_0xdc37('0x8'));router['get']('/',auth[_0xdc37('0x9')](),controller[_0xdc37('0xa')]);router[_0xdc37('0xb')](_0xdc37('0xc'),auth[_0xdc37('0x9')](),controller[_0xdc37('0xd')]);router[_0xdc37('0xb')]('/:id/configurations',auth[_0xdc37('0x9')](),controller[_0xdc37('0xe')]);router[_0xdc37('0xb')](_0xdc37('0xf'),auth['isAuthenticated'](),controller[_0xdc37('0x10')]);router[_0xdc37('0x11')]('/',auth[_0xdc37('0x9')](),controller['create']);router['post'](_0xdc37('0x12'),auth[_0xdc37('0x9')](),controller[_0xdc37('0x13')]);router[_0xdc37('0x14')](_0xdc37('0xc'),auth['isAuthenticated'](),controller[_0xdc37('0x15')]);router[_0xdc37('0x16')]('/:id',auth[_0xdc37('0x9')](),controller[_0xdc37('0x17')]);module[_0xdc37('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e44e1d5..a1da003 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 _0x91a7=['STRING','exports'];(function(_0x594a9e,_0x45c30e){var _0x2baf96=function(_0x5b8982){while(--_0x5b8982){_0x594a9e['push'](_0x594a9e['shift']());}};_0x2baf96(++_0x45c30e);}(_0x91a7,0xe7));var _0x791a=function(_0x3e8233,_0xf5f2c9){_0x3e8233=_0x3e8233-0x0;var _0x4be91e=_0x91a7[_0x3e8233];return _0x4be91e;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x791a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x791a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file +var _0x5ff3=['STRING','exports'];(function(_0x39c276,_0x2f28c7){var _0x49e415=function(_0x473e92){while(--_0x473e92){_0x39c276['push'](_0x39c276['shift']());}};_0x49e415(++_0x2f28c7);}(_0x5ff3,0x17d));var _0x35ff=function(_0xe2847,_0x100bab){_0xe2847=_0xe2847-0x0;var _0x141e43=_0x5ff3[_0xe2847];return _0x141e43;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e1950c5..1079710 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 _0x8dca=['where','merge','VIRTUAL','includeAll','include','findAll','params','find','create','body','catch','getConfigurations','pick','options','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','findOne','host','serverUrl','code','zoho.eu','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Subject','Call_Result','Call_Start_Time','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','filter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8dca,0xb1));var _0xa8dc=function(_0x30be74,_0x328e9f){_0x30be74=_0x30be74-0x0;var _0x4edeb8=_0x8dca[_0x30be74];return _0x4edeb8;};'use strict';var emlformat=require(_0xa8dc('0x0'));var rimraf=require(_0xa8dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8dc('0x2'));var rp=require(_0xa8dc('0x3'));var moment=require('moment');var BPromise=require(_0xa8dc('0x4'));var Mustache=require(_0xa8dc('0x5'));var util=require(_0xa8dc('0x6'));var path=require(_0xa8dc('0x7'));var sox=require(_0xa8dc('0x8'));var csv=require('to-csv');var ejs=require(_0xa8dc('0x9'));var fs=require('fs');var fs_extra=require(_0xa8dc('0xa'));var _=require(_0xa8dc('0xb'));var squel=require(_0xa8dc('0xc'));var crypto=require(_0xa8dc('0xd'));var jsforce=require(_0xa8dc('0xe'));var deskjs=require(_0xa8dc('0xf'));var toCsv=require(_0xa8dc('0x10'));var querystring=require('querystring');var Papa=require(_0xa8dc('0x11'));var Redis=require('ioredis');var authService=require(_0xa8dc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8dc('0x13'));var hardwareService=require(_0xa8dc('0x14'));var logger=require(_0xa8dc('0x15'))(_0xa8dc('0x16'));var utils=require('../../config/utils');var config=require(_0xa8dc('0x17'));var licenseUtil=require(_0xa8dc('0x18'));var db=require(_0xa8dc('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5a4f78,_0x131a57){_0x131a57=_0x131a57||0xcc;return function(_0x346099){if(_0x346099){return _0x5a4f78['sendStatus'](_0x131a57);}return _0x5a4f78['status'](_0x131a57)[_0xa8dc('0x1a')]();};}function respondWithResult(_0x4517f8,_0x18c17b){_0x18c17b=_0x18c17b||0xc8;return function(_0x57a9fd){if(_0x57a9fd){return _0x4517f8[_0xa8dc('0x1b')](_0x18c17b)[_0xa8dc('0x1c')](_0x57a9fd);}};}function respondWithFilteredResult(_0x23b095,_0x50b5e1){return function(_0x1c07da){if(_0x1c07da){var _0x3c71cb=typeof _0x50b5e1[_0xa8dc('0x1d')]==='undefined'&&typeof _0x50b5e1['limit']===_0xa8dc('0x1e');var _0x4b7f99=_0x1c07da['count'];var _0x11f91d=_0x3c71cb?0x0:_0x50b5e1[_0xa8dc('0x1d')];var _0x5a1ab1=_0x3c71cb?_0x1c07da[_0xa8dc('0x1f')]:_0x50b5e1[_0xa8dc('0x1d')]+_0x50b5e1[_0xa8dc('0x20')];var _0x39f901;if(_0x5a1ab1>=_0x4b7f99){_0x5a1ab1=_0x4b7f99;_0x39f901=0xc8;}else{_0x39f901=0xce;}_0x23b095['status'](_0x39f901);return _0x23b095['set']('Content-Range',_0x11f91d+'-'+_0x5a1ab1+'/'+_0x4b7f99)[_0xa8dc('0x1c')](_0x1c07da);}return null;};}function patchUpdates(_0x1d3df7){return function(_0x1bfee7){try{jsonpatch[_0xa8dc('0x21')](_0x1bfee7,_0x1d3df7,!![]);}catch(_0x45a245){return BPromise['reject'](_0x45a245);}return _0x1bfee7[_0xa8dc('0x22')]();};}function saveUpdates(_0x4f579f,_0x2a0df4){return function(_0x6fb8b5){if(_0x6fb8b5){return _0x6fb8b5[_0xa8dc('0x23')](_0x4f579f)[_0xa8dc('0x24')](function(_0x57b7a2){return _0x57b7a2;});}return null;};}function removeEntity(_0x4aa80e,_0x5b4ece){return function(_0x246132){if(_0x246132){return _0x246132[_0xa8dc('0x25')]()[_0xa8dc('0x24')](function(){_0x4aa80e[_0xa8dc('0x1b')](0xcc)[_0xa8dc('0x1a')]();});}};}function handleEntityNotFound(_0xa74f03,_0x2e9178){return function(_0x31e996){if(!_0x31e996){_0xa74f03[_0xa8dc('0x26')](0x194);}return _0x31e996;};}function handleError(_0x2a8b21,_0x7a9e42){_0x7a9e42=_0x7a9e42||0x1f4;return function(_0x478fab){logger[_0xa8dc('0x27')](_0x478fab[_0xa8dc('0x28')]);if(_0x478fab[_0xa8dc('0x29')]){delete _0x478fab['name'];}_0x2a8b21['status'](_0x7a9e42)['send'](_0x478fab);};}exports['index']=function(_0xafb4c5,_0x3cb335){var _0x2dd24c={},_0x1b7b4e={},_0x45a11e={'count':0x0,'rows':[]};var _0x2404d8=_[_0xa8dc('0x2a')](db[_0xa8dc('0x2b')][_0xa8dc('0x2c')],function(_0x4acfd1){return{'name':_0x4acfd1[_0xa8dc('0x2d')],'type':_0x4acfd1[_0xa8dc('0x2e')]['key']};});_0x1b7b4e['model']=_['map'](_0x2404d8,_0xa8dc('0x29'));_0x1b7b4e['query']=_[_0xa8dc('0x2f')](_0xafb4c5[_0xa8dc('0x30')]);_0x1b7b4e['filters']=_[_0xa8dc('0x31')](_0x1b7b4e[_0xa8dc('0x32')],_0x1b7b4e[_0xa8dc('0x30')]);_0x2dd24c[_0xa8dc('0x33')]=_['intersection'](_0x1b7b4e[_0xa8dc('0x32')],qs['fields'](_0xafb4c5[_0xa8dc('0x30')][_0xa8dc('0x34')]));_0x2dd24c[_0xa8dc('0x33')]=_0x2dd24c[_0xa8dc('0x33')][_0xa8dc('0x35')]?_0x2dd24c[_0xa8dc('0x33')]:_0x1b7b4e[_0xa8dc('0x32')];if(!_0xafb4c5[_0xa8dc('0x30')]['hasOwnProperty'](_0xa8dc('0x36'))){_0x2dd24c[_0xa8dc('0x20')]=qs['limit'](_0xafb4c5[_0xa8dc('0x30')][_0xa8dc('0x20')]);_0x2dd24c['offset']=qs[_0xa8dc('0x1d')](_0xafb4c5[_0xa8dc('0x30')][_0xa8dc('0x1d')]);}_0x2dd24c[_0xa8dc('0x37')]=qs[_0xa8dc('0x38')](_0xafb4c5['query'][_0xa8dc('0x38')]);_0x2dd24c['where']=qs[_0xa8dc('0x39')](_['pick'](_0xafb4c5[_0xa8dc('0x30')],_0x1b7b4e[_0xa8dc('0x39')]),_0x2404d8);if(_0xafb4c5['query'][_0xa8dc('0x3a')]){_0x2dd24c[_0xa8dc('0x3b')]=_[_0xa8dc('0x3c')](_0x2dd24c[_0xa8dc('0x3b')],{'$or':_[_0xa8dc('0x2a')](_0x2404d8,function(_0x14ca75){if(_0x14ca75['type']!==_0xa8dc('0x3d')){var _0x1a84b6={};_0x1a84b6[_0x14ca75[_0xa8dc('0x29')]]={'$like':'%'+_0xafb4c5[_0xa8dc('0x30')]['filter']+'%'};return _0x1a84b6;}})});}_0x2dd24c=_[_0xa8dc('0x3c')]({},_0x2dd24c,_0xafb4c5['options']);var _0x22066f={'where':_0x2dd24c['where']};return db['ZohoAccount'][_0xa8dc('0x1f')](_0x22066f)[_0xa8dc('0x24')](function(_0x133623){_0x45a11e['count']=_0x133623;if(_0xafb4c5['query'][_0xa8dc('0x3e')]){_0x2dd24c[_0xa8dc('0x3f')]=[{'all':!![]}];}return db[_0xa8dc('0x2b')][_0xa8dc('0x40')](_0x2dd24c);})[_0xa8dc('0x24')](function(_0x299b45){_0x45a11e['rows']=_0x299b45;return _0x45a11e;})['then'](respondWithFilteredResult(_0x3cb335,_0x2dd24c))['catch'](handleError(_0x3cb335,null));};exports['show']=function(_0x5d15f3,_0x18d033){var _0x5346bc={'raw':![],'where':{'id':_0x5d15f3[_0xa8dc('0x41')]['id']}},_0x33d370={};_0x33d370[_0xa8dc('0x32')]=_[_0xa8dc('0x2f')](db['ZohoAccount'][_0xa8dc('0x2c')]);_0x33d370['query']=_[_0xa8dc('0x2f')](_0x5d15f3[_0xa8dc('0x30')]);_0x33d370[_0xa8dc('0x39')]=_[_0xa8dc('0x31')](_0x33d370[_0xa8dc('0x32')],_0x33d370[_0xa8dc('0x30')]);_0x5346bc[_0xa8dc('0x33')]=_[_0xa8dc('0x31')](_0x33d370['model'],qs[_0xa8dc('0x34')](_0x5d15f3[_0xa8dc('0x30')][_0xa8dc('0x34')]));_0x5346bc[_0xa8dc('0x33')]=_0x5346bc[_0xa8dc('0x33')]['length']?_0x5346bc['attributes']:_0x33d370['model'];if(_0x5d15f3[_0xa8dc('0x30')][_0xa8dc('0x3e')]){_0x5346bc['include']=[{'all':!![]}];}_0x5346bc=_['merge']({},_0x5346bc,_0x5d15f3['options']);return db[_0xa8dc('0x2b')][_0xa8dc('0x42')](_0x5346bc)[_0xa8dc('0x24')](handleEntityNotFound(_0x18d033,null))[_0xa8dc('0x24')](respondWithResult(_0x18d033,null))['catch'](handleError(_0x18d033,null));};exports[_0xa8dc('0x43')]=function(_0x4cf6d5,_0x358cfa){return db[_0xa8dc('0x2b')][_0xa8dc('0x43')](_0x4cf6d5[_0xa8dc('0x44')],{})[_0xa8dc('0x24')](respondWithResult(_0x358cfa,0xc9))['catch'](handleError(_0x358cfa,null));};exports[_0xa8dc('0x23')]=function(_0x227563,_0x4a9059){if(_0x227563[_0xa8dc('0x44')]['id']){delete _0x227563[_0xa8dc('0x44')]['id'];}return db[_0xa8dc('0x2b')]['find']({'where':{'id':_0x227563[_0xa8dc('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a9059,null))[_0xa8dc('0x24')](saveUpdates(_0x227563['body'],null))[_0xa8dc('0x24')](respondWithResult(_0x4a9059,null))[_0xa8dc('0x45')](handleError(_0x4a9059,null));};exports[_0xa8dc('0x25')]=function(_0x3471ad,_0x4d775d){return db[_0xa8dc('0x2b')][_0xa8dc('0x42')]({'where':{'id':_0x3471ad['params']['id']}})[_0xa8dc('0x24')](handleEntityNotFound(_0x4d775d,null))[_0xa8dc('0x24')](removeEntity(_0x4d775d,null))[_0xa8dc('0x45')](handleError(_0x4d775d,null));};exports[_0xa8dc('0x46')]=function(_0x1127d9,_0x1833ae,_0x360ee2){var _0x5ef4a2={};var _0x1af17d={};var _0x19d893;var _0x103367;return db[_0xa8dc('0x2b')]['findOne']({'where':{'id':_0x1127d9[_0xa8dc('0x41')]['id']}})[_0xa8dc('0x24')](handleEntityNotFound(_0x1833ae,null))['then'](function(_0x3735ae){if(_0x3735ae){_0x19d893=_0x3735ae;_0x1af17d['model']=_[_0xa8dc('0x2f')](db['ZohoConfiguration'][_0xa8dc('0x2c')]);_0x1af17d[_0xa8dc('0x30')]=_[_0xa8dc('0x2f')](_0x1127d9[_0xa8dc('0x30')]);_0x1af17d['filters']=_[_0xa8dc('0x31')](_0x1af17d[_0xa8dc('0x32')],_0x1af17d['query']);_0x5ef4a2[_0xa8dc('0x33')]=_[_0xa8dc('0x31')](_0x1af17d[_0xa8dc('0x32')],qs[_0xa8dc('0x34')](_0x1127d9[_0xa8dc('0x30')][_0xa8dc('0x34')]));_0x5ef4a2[_0xa8dc('0x33')]=_0x5ef4a2[_0xa8dc('0x33')]['length']?_0x5ef4a2[_0xa8dc('0x33')]:_0x1af17d[_0xa8dc('0x32')];_0x5ef4a2['order']=qs[_0xa8dc('0x38')](_0x1127d9[_0xa8dc('0x30')]['sort']);_0x5ef4a2[_0xa8dc('0x3b')]=qs[_0xa8dc('0x39')](_[_0xa8dc('0x47')](_0x1127d9[_0xa8dc('0x30')],_0x1af17d[_0xa8dc('0x39')]));if(_0x1127d9[_0xa8dc('0x30')][_0xa8dc('0x3a')]){_0x5ef4a2[_0xa8dc('0x3b')]=_[_0xa8dc('0x3c')](_0x5ef4a2['where'],{'$or':_[_0xa8dc('0x2a')](_0x5ef4a2[_0xa8dc('0x33')],function(_0x536d42){var _0x522f5c={};_0x522f5c[_0x536d42]={'$like':'%'+_0x1127d9['query'][_0xa8dc('0x3a')]+'%'};return _0x522f5c;})});}_0x5ef4a2=_['merge']({},_0x5ef4a2,_0x1127d9[_0xa8dc('0x48')]);return _0x19d893[_0xa8dc('0x46')](_0x5ef4a2);}})[_0xa8dc('0x24')](function(_0x599013){if(_0x599013){_0x103367=_0x599013[_0xa8dc('0x35')];if(!_0x1127d9['query']['hasOwnProperty'](_0xa8dc('0x36'))){_0x5ef4a2[_0xa8dc('0x20')]=qs['limit'](_0x1127d9[_0xa8dc('0x30')][_0xa8dc('0x20')]);_0x5ef4a2['offset']=qs['offset'](_0x1127d9[_0xa8dc('0x30')][_0xa8dc('0x1d')]);}return _0x19d893[_0xa8dc('0x46')](_0x5ef4a2);}})[_0xa8dc('0x24')](function(_0x150aa0){if(_0x150aa0){return _0x150aa0?{'count':_0x103367,'rows':_0x150aa0}:null;}})['then'](respondWithResult(_0x1833ae,null))['catch'](handleError(_0x1833ae,null));};exports['addConfiguration']=function(_0x3c57e4,_0x229fca,_0x316f2f){if(_0x3c57e4[_0xa8dc('0x44')]['id']){delete _0x3c57e4[_0xa8dc('0x44')]['id'];}return db[_0xa8dc('0x2b')]['findOne']({'where':{'id':_0x3c57e4[_0xa8dc('0x41')]['id']}})['then'](handleEntityNotFound(_0x229fca,null))[_0xa8dc('0x24')](function(_0x44a2d7){if(_0x44a2d7){_0x3c57e4['body'][_0xa8dc('0x49')]=_0x44a2d7['id'];_0x3c57e4[_0xa8dc('0x44')]['Subjects']=integrations[_0xa8dc('0x4a')](_0x3c57e4['body'][_0xa8dc('0x4b')],_0x3c57e4[_0xa8dc('0x44')][_0xa8dc('0x2e')]);_0x3c57e4['body'][_0xa8dc('0x4c')]=integrations[_0xa8dc('0x4d')](_0x3c57e4['body'][_0xa8dc('0x4b')],_0x3c57e4[_0xa8dc('0x44')][_0xa8dc('0x2e')]);return db[_0xa8dc('0x4e')][_0xa8dc('0x43')](_0x3c57e4[_0xa8dc('0x44')],{'include':[{'model':db[_0xa8dc('0x4f')],'as':_0xa8dc('0x50')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xa8dc('0x24')](respondWithResult(_0x229fca,null))[_0xa8dc('0x45')](handleError(_0x229fca,null));};function getAccessToken(_0x5d42f4){return new Promise(function(_0x13227a,_0x2e5dc2){var _0x481600;switch(_0x5d42f4[_0xa8dc('0x51')]){case'US':_0x481600=_0xa8dc('0x52');break;case'AU':_0x481600='https://accounts.zoho.com.au';break;case'EU':_0x481600=_0xa8dc('0x53');break;case'IN':_0x481600='https://accounts.zoho.in';break;case'CN':_0x481600=_0xa8dc('0x54');break;default:_0x481600='https://accounts.zoho.eu';break;}var _0x269fda={'method':_0xa8dc('0x55'),'uri':_0x481600+_0xa8dc('0x56'),'qs':{'refresh_token':_0x5d42f4[_0xa8dc('0x57')],'client_id':_0x5d42f4[_0xa8dc('0x58')],'client_secret':_0x5d42f4['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x269fda)['then'](function(_0x5751bf){if(_0x5751bf[_0xa8dc('0x59')]){_0x13227a(_0x5751bf[_0xa8dc('0x59')]);}else{_0x2e5dc2(_0xa8dc('0x5a'));}})[_0xa8dc('0x45')](function(_0x88ba3e){_0x2e5dc2(_0x88ba3e);});});}exports['getFields']=function(_0x1d7599,_0x178ff4,_0x1785d4){var _0x4c472b,_0x27b969,_0x3fe5c6,_0x5f3f04,_0x1124cd;return db[_0xa8dc('0x2b')][_0xa8dc('0x5b')]({'where':{'id':_0x1d7599[_0xa8dc('0x41')]['id']},'attributes':['id',_0xa8dc('0x5c'),_0xa8dc('0x51'),_0xa8dc('0x58'),'clientSecret',_0xa8dc('0x5d'),_0xa8dc('0x5e'),_0xa8dc('0x57')]})[_0xa8dc('0x24')](handleEntityNotFound(_0x178ff4,null))['then'](function(_0x529813){_0x1124cd=_0x529813;_0x4c472b=_0x1124cd['host'];_0x27b969=_0x4c472b===_0xa8dc('0x5f')?'eu':_0xa8dc('0x60');_0x3fe5c6=_0x1124cd[_0xa8dc('0x5d')];var _0x243537=_0x3fe5c6['slice'](-0x1);if(_0x243537==='/'||_0x243537==='\x5c'||_0x243537===':'){_0x3fe5c6=_0x3fe5c6[_0xa8dc('0x61')](0x0,_0x3fe5c6['lastIndexOf'](_0x243537));}if(!_0x1124cd[_0xa8dc('0x57')]){throw new Error(_0xa8dc('0x62'));}return getAccessToken(_0x1124cd);})[_0xa8dc('0x24')](function(_0x484397){if(_0x484397){return rp({'method':'GET','uri':util[_0xa8dc('0x63')](_0xa8dc('0x64'),_0x27b969),'qs':{'module':_0xa8dc('0x65')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x484397},'json':!![]});}})['then'](function(_0x2e84c3){if(_0x2e84c3){if(_0x2e84c3[_0xa8dc('0x66')]&&_0x2e84c3[_0xa8dc('0x66')]['error']){throw new Error(_0x2e84c3[_0xa8dc('0x66')][_0xa8dc('0x27')]['message']);}var _0x2ae4e4=[];var _0x117ebc=[];var _0x5d69a8=['Owner',_0xa8dc('0x67'),'Description','WhoId','Call_Duration',_0xa8dc('0x68'),_0xa8dc('0x69'),'Call_Type'];_0x117ebc=_[_0xa8dc('0x6a')](_0x2e84c3[_0xa8dc('0x34')],function(_0x255632){return _0x5d69a8[_0xa8dc('0x6b')](_0x255632[_0xa8dc('0x6c')]);});for(var _0x3fd974=0x0;_0x3fd974<_0x117ebc[_0xa8dc('0x35')];_0x3fd974++){if(_0x117ebc[_0x3fd974]['system_mandatory']===![]){_0x2ae4e4[_0xa8dc('0x6d')]({'id':_0x117ebc[_0x3fd974]['id'],'name':_0x117ebc[_0x3fd974][_0xa8dc('0x6e')],'custom':_0x117ebc[_0x3fd974][_0xa8dc('0x6f')],'options':_0x117ebc[_0x3fd974][_0xa8dc('0x70')]===_0xa8dc('0x71')&&_0x117ebc[_0x3fd974][_0xa8dc('0x72')][_0xa8dc('0x35')]>-0x1?_[_0xa8dc('0x2a')](_0x117ebc[_0x3fd974][_0xa8dc('0x72')],function(_0x85bcb2){return{'name':_0x85bcb2,'value':_0x85bcb2};}):[]});}}return{'count':_0x2ae4e4[_0xa8dc('0x35')],'rows':_0x2ae4e4};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x178ff4,null))[_0xa8dc('0x45')](function(_0x7f5d33){var _0x542fa0=_0x1d7599['query']['test']?0x1f4:_0x7f5d33[_0xa8dc('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x542fa0,JSON['stringify'](_0x7f5d33));delete _0x7f5d33[_0xa8dc('0x29')];if(_0x542fa0===0x191){_0x542fa0=0x190;}_0x178ff4[_0xa8dc('0x1b')](_0x542fa0)[_0xa8dc('0x74')](_0x1d7599['query']['test']?{'message':_0xa8dc('0x75'),'statusCode':_0x7f5d33[_0xa8dc('0x73')]}:_0x7f5d33);});}; \ No newline at end of file +var _0xc401=['getConfigurations','findOne','ZohoConfiguration','length','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','response','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','name','send','index','map','ZohoAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','include','find','create','body','params'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc401,0x138));var _0x1c40=function(_0x22a701,_0x4c9127){_0x22a701=_0x22a701-0x0;var _0x47f7f8=_0xc401[_0x22a701];return _0x47f7f8;};'use strict';var emlformat=require(_0x1c40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c40('0x1'));var jsonpatch=require(_0x1c40('0x2'));var rp=require(_0x1c40('0x3'));var moment=require('moment');var BPromise=require(_0x1c40('0x4'));var Mustache=require(_0x1c40('0x5'));var util=require(_0x1c40('0x6'));var path=require(_0x1c40('0x7'));var sox=require(_0x1c40('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c40('0x9'));var _=require('lodash');var squel=require(_0x1c40('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c40('0xb'));var deskjs=require(_0x1c40('0xc'));var toCsv=require(_0x1c40('0xd'));var querystring=require(_0x1c40('0xe'));var Papa=require(_0x1c40('0xf'));var Redis=require(_0x1c40('0x10'));var authService=require(_0x1c40('0x11'));var qs=require(_0x1c40('0x12'));var as=require(_0x1c40('0x13'));var hardwareService=require(_0x1c40('0x14'));var logger=require(_0x1c40('0x15'))(_0x1c40('0x16'));var utils=require(_0x1c40('0x17'));var config=require(_0x1c40('0x18'));var licenseUtil=require(_0x1c40('0x19'));var db=require(_0x1c40('0x1a'))['db'];var integrations=require(_0x1c40('0x1b'));function respondWithStatusCode(_0x24d4a3,_0x5c5bd0){_0x5c5bd0=_0x5c5bd0||0xcc;return function(_0x5f5ae0){if(_0x5f5ae0){return _0x24d4a3[_0x1c40('0x1c')](_0x5c5bd0);}return _0x24d4a3['status'](_0x5c5bd0)[_0x1c40('0x1d')]();};}function respondWithResult(_0x346c87,_0x3026a1){_0x3026a1=_0x3026a1||0xc8;return function(_0x2b75d6){if(_0x2b75d6){return _0x346c87[_0x1c40('0x1e')](_0x3026a1)[_0x1c40('0x1f')](_0x2b75d6);}};}function respondWithFilteredResult(_0xff4ace,_0x91c41d){return function(_0x45252a){if(_0x45252a){var _0x3e8040=typeof _0x91c41d['offset']==='undefined'&&typeof _0x91c41d[_0x1c40('0x20')]===_0x1c40('0x21');var _0x5c7614=_0x45252a[_0x1c40('0x22')];var _0x49667a=_0x3e8040?0x0:_0x91c41d['offset'];var _0x278976=_0x3e8040?_0x45252a[_0x1c40('0x22')]:_0x91c41d[_0x1c40('0x23')]+_0x91c41d[_0x1c40('0x20')];var _0x1da7da;if(_0x278976>=_0x5c7614){_0x278976=_0x5c7614;_0x1da7da=0xc8;}else{_0x1da7da=0xce;}_0xff4ace['status'](_0x1da7da);return _0xff4ace[_0x1c40('0x24')](_0x1c40('0x25'),_0x49667a+'-'+_0x278976+'/'+_0x5c7614)[_0x1c40('0x1f')](_0x45252a);}return null;};}function patchUpdates(_0x37421c){return function(_0x415132){try{jsonpatch[_0x1c40('0x26')](_0x415132,_0x37421c,!![]);}catch(_0x520826){return BPromise['reject'](_0x520826);}return _0x415132[_0x1c40('0x27')]();};}function saveUpdates(_0x2257b6,_0x4a39e8){return function(_0x5c1863){if(_0x5c1863){return _0x5c1863[_0x1c40('0x28')](_0x2257b6)['then'](function(_0x7274e7){return _0x7274e7;});}return null;};}function removeEntity(_0x1b4b86,_0x63ed14){return function(_0x270c71){if(_0x270c71){return _0x270c71[_0x1c40('0x29')]()['then'](function(){_0x1b4b86[_0x1c40('0x1e')](0xcc)[_0x1c40('0x1d')]();});}};}function handleEntityNotFound(_0x141099,_0x7f287f){return function(_0x2a6607){if(!_0x2a6607){_0x141099['sendStatus'](0x194);}return _0x2a6607;};}function handleError(_0x40d49d,_0x3eb442){_0x3eb442=_0x3eb442||0x1f4;return function(_0x5be58e){logger['error'](_0x5be58e['stack']);if(_0x5be58e[_0x1c40('0x2a')]){delete _0x5be58e[_0x1c40('0x2a')];}_0x40d49d[_0x1c40('0x1e')](_0x3eb442)[_0x1c40('0x2b')](_0x5be58e);};}exports[_0x1c40('0x2c')]=function(_0x1e652e,_0x5a0b31){var _0x476bd3={},_0x2e2031={},_0x178c12={'count':0x0,'rows':[]};var _0x33a3c5=_[_0x1c40('0x2d')](db[_0x1c40('0x2e')][_0x1c40('0x2f')],function(_0x1b03da){return{'name':_0x1b03da['fieldName'],'type':_0x1b03da[_0x1c40('0x30')]['key']};});_0x2e2031[_0x1c40('0x31')]=_[_0x1c40('0x2d')](_0x33a3c5,_0x1c40('0x2a'));_0x2e2031[_0x1c40('0x32')]=_[_0x1c40('0x33')](_0x1e652e['query']);_0x2e2031[_0x1c40('0x34')]=_[_0x1c40('0x35')](_0x2e2031['model'],_0x2e2031[_0x1c40('0x32')]);_0x476bd3[_0x1c40('0x36')]=_['intersection'](_0x2e2031[_0x1c40('0x31')],qs[_0x1c40('0x37')](_0x1e652e[_0x1c40('0x32')]['fields']));_0x476bd3[_0x1c40('0x36')]=_0x476bd3['attributes']['length']?_0x476bd3[_0x1c40('0x36')]:_0x2e2031[_0x1c40('0x31')];if(!_0x1e652e[_0x1c40('0x32')]['hasOwnProperty']('nolimit')){_0x476bd3['limit']=qs[_0x1c40('0x20')](_0x1e652e[_0x1c40('0x32')][_0x1c40('0x20')]);_0x476bd3[_0x1c40('0x23')]=qs[_0x1c40('0x23')](_0x1e652e[_0x1c40('0x32')]['offset']);}_0x476bd3[_0x1c40('0x38')]=qs[_0x1c40('0x39')](_0x1e652e[_0x1c40('0x32')]['sort']);_0x476bd3['where']=qs[_0x1c40('0x34')](_[_0x1c40('0x3a')](_0x1e652e['query'],_0x2e2031[_0x1c40('0x34')]),_0x33a3c5);if(_0x1e652e['query'][_0x1c40('0x3b')]){_0x476bd3[_0x1c40('0x3c')]=_['merge'](_0x476bd3['where'],{'$or':_[_0x1c40('0x2d')](_0x33a3c5,function(_0x2dc758){if(_0x2dc758['type']!==_0x1c40('0x3d')){var _0x460a4a={};_0x460a4a[_0x2dc758[_0x1c40('0x2a')]]={'$like':'%'+_0x1e652e[_0x1c40('0x32')][_0x1c40('0x3b')]+'%'};return _0x460a4a;}})});}_0x476bd3=_[_0x1c40('0x3e')]({},_0x476bd3,_0x1e652e[_0x1c40('0x3f')]);var _0x4ded0c={'where':_0x476bd3['where']};return db['ZohoAccount'][_0x1c40('0x22')](_0x4ded0c)[_0x1c40('0x40')](function(_0xfb3022){_0x178c12[_0x1c40('0x22')]=_0xfb3022;if(_0x1e652e[_0x1c40('0x32')][_0x1c40('0x41')]){_0x476bd3['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x1c40('0x42')](_0x476bd3);})[_0x1c40('0x40')](function(_0x48bb71){_0x178c12[_0x1c40('0x43')]=_0x48bb71;return _0x178c12;})[_0x1c40('0x40')](respondWithFilteredResult(_0x5a0b31,_0x476bd3))[_0x1c40('0x44')](handleError(_0x5a0b31,null));};exports[_0x1c40('0x45')]=function(_0x3eee4f,_0x4fbdb){var _0xe803ea={'raw':![],'where':{'id':_0x3eee4f['params']['id']}},_0x5178f3={};_0x5178f3[_0x1c40('0x31')]=_[_0x1c40('0x33')](db[_0x1c40('0x2e')]['rawAttributes']);_0x5178f3[_0x1c40('0x32')]=_[_0x1c40('0x33')](_0x3eee4f[_0x1c40('0x32')]);_0x5178f3[_0x1c40('0x34')]=_[_0x1c40('0x35')](_0x5178f3['model'],_0x5178f3[_0x1c40('0x32')]);_0xe803ea['attributes']=_[_0x1c40('0x35')](_0x5178f3[_0x1c40('0x31')],qs['fields'](_0x3eee4f[_0x1c40('0x32')][_0x1c40('0x37')]));_0xe803ea[_0x1c40('0x36')]=_0xe803ea[_0x1c40('0x36')]['length']?_0xe803ea[_0x1c40('0x36')]:_0x5178f3['model'];if(_0x3eee4f[_0x1c40('0x32')][_0x1c40('0x41')]){_0xe803ea[_0x1c40('0x46')]=[{'all':!![]}];}_0xe803ea=_[_0x1c40('0x3e')]({},_0xe803ea,_0x3eee4f[_0x1c40('0x3f')]);return db[_0x1c40('0x2e')][_0x1c40('0x47')](_0xe803ea)['then'](handleEntityNotFound(_0x4fbdb,null))['then'](respondWithResult(_0x4fbdb,null))[_0x1c40('0x44')](handleError(_0x4fbdb,null));};exports['create']=function(_0x3c52e8,_0x58446b){return db[_0x1c40('0x2e')][_0x1c40('0x48')](_0x3c52e8[_0x1c40('0x49')],{})[_0x1c40('0x40')](respondWithResult(_0x58446b,0xc9))[_0x1c40('0x44')](handleError(_0x58446b,null));};exports[_0x1c40('0x28')]=function(_0x12a6e1,_0x228004){if(_0x12a6e1[_0x1c40('0x49')]['id']){delete _0x12a6e1['body']['id'];}return db[_0x1c40('0x2e')][_0x1c40('0x47')]({'where':{'id':_0x12a6e1[_0x1c40('0x4a')]['id']}})['then'](handleEntityNotFound(_0x228004,null))[_0x1c40('0x40')](saveUpdates(_0x12a6e1[_0x1c40('0x49')],null))['then'](respondWithResult(_0x228004,null))[_0x1c40('0x44')](handleError(_0x228004,null));};exports[_0x1c40('0x29')]=function(_0x38baea,_0x513c40){return db[_0x1c40('0x2e')][_0x1c40('0x47')]({'where':{'id':_0x38baea[_0x1c40('0x4a')]['id']}})['then'](handleEntityNotFound(_0x513c40,null))[_0x1c40('0x40')](removeEntity(_0x513c40,null))['catch'](handleError(_0x513c40,null));};exports[_0x1c40('0x4b')]=function(_0x3ec7cb,_0x26c4bf,_0xcb7f9f){var _0x1c1550={};var _0x3054b7={};var _0x39c1fa;var _0x1526e6;return db[_0x1c40('0x2e')][_0x1c40('0x4c')]({'where':{'id':_0x3ec7cb[_0x1c40('0x4a')]['id']}})[_0x1c40('0x40')](handleEntityNotFound(_0x26c4bf,null))[_0x1c40('0x40')](function(_0x37d0e8){if(_0x37d0e8){_0x39c1fa=_0x37d0e8;_0x3054b7[_0x1c40('0x31')]=_[_0x1c40('0x33')](db[_0x1c40('0x4d')][_0x1c40('0x2f')]);_0x3054b7[_0x1c40('0x32')]=_[_0x1c40('0x33')](_0x3ec7cb[_0x1c40('0x32')]);_0x3054b7['filters']=_[_0x1c40('0x35')](_0x3054b7['model'],_0x3054b7[_0x1c40('0x32')]);_0x1c1550['attributes']=_[_0x1c40('0x35')](_0x3054b7[_0x1c40('0x31')],qs['fields'](_0x3ec7cb[_0x1c40('0x32')]['fields']));_0x1c1550[_0x1c40('0x36')]=_0x1c1550[_0x1c40('0x36')]['length']?_0x1c1550['attributes']:_0x3054b7[_0x1c40('0x31')];_0x1c1550[_0x1c40('0x38')]=qs[_0x1c40('0x39')](_0x3ec7cb['query']['sort']);_0x1c1550['where']=qs[_0x1c40('0x34')](_[_0x1c40('0x3a')](_0x3ec7cb[_0x1c40('0x32')],_0x3054b7[_0x1c40('0x34')]));if(_0x3ec7cb[_0x1c40('0x32')][_0x1c40('0x3b')]){_0x1c1550[_0x1c40('0x3c')]=_[_0x1c40('0x3e')](_0x1c1550[_0x1c40('0x3c')],{'$or':_[_0x1c40('0x2d')](_0x1c1550[_0x1c40('0x36')],function(_0x57d89c){var _0x64121e={};_0x64121e[_0x57d89c]={'$like':'%'+_0x3ec7cb[_0x1c40('0x32')][_0x1c40('0x3b')]+'%'};return _0x64121e;})});}_0x1c1550=_[_0x1c40('0x3e')]({},_0x1c1550,_0x3ec7cb[_0x1c40('0x3f')]);return _0x39c1fa[_0x1c40('0x4b')](_0x1c1550);}})[_0x1c40('0x40')](function(_0x5c9cf6){if(_0x5c9cf6){_0x1526e6=_0x5c9cf6[_0x1c40('0x4e')];if(!_0x3ec7cb[_0x1c40('0x32')][_0x1c40('0x4f')]('nolimit')){_0x1c1550[_0x1c40('0x20')]=qs[_0x1c40('0x20')](_0x3ec7cb['query'][_0x1c40('0x20')]);_0x1c1550[_0x1c40('0x23')]=qs['offset'](_0x3ec7cb['query']['offset']);}return _0x39c1fa[_0x1c40('0x4b')](_0x1c1550);}})[_0x1c40('0x40')](function(_0x41cb8f){if(_0x41cb8f){return _0x41cb8f?{'count':_0x1526e6,'rows':_0x41cb8f}:null;}})['then'](respondWithResult(_0x26c4bf,null))[_0x1c40('0x44')](handleError(_0x26c4bf,null));};exports['addConfiguration']=function(_0x4f79c1,_0x1fa2a1,_0x57decb){if(_0x4f79c1['body']['id']){delete _0x4f79c1[_0x1c40('0x49')]['id'];}return db['ZohoAccount'][_0x1c40('0x4c')]({'where':{'id':_0x4f79c1[_0x1c40('0x4a')]['id']}})[_0x1c40('0x40')](handleEntityNotFound(_0x1fa2a1,null))[_0x1c40('0x40')](function(_0x118700){if(_0x118700){_0x4f79c1[_0x1c40('0x49')][_0x1c40('0x50')]=_0x118700['id'];_0x4f79c1[_0x1c40('0x49')][_0x1c40('0x51')]=integrations[_0x1c40('0x52')](_0x4f79c1[_0x1c40('0x49')][_0x1c40('0x53')],_0x4f79c1[_0x1c40('0x49')]['type']);_0x4f79c1['body'][_0x1c40('0x54')]=integrations[_0x1c40('0x55')](_0x4f79c1['body'][_0x1c40('0x53')],_0x4f79c1['body'][_0x1c40('0x30')]);return db[_0x1c40('0x4d')][_0x1c40('0x48')](_0x4f79c1[_0x1c40('0x49')],{'include':[{'model':db[_0x1c40('0x56')],'as':_0x1c40('0x51')},{'model':db[_0x1c40('0x56')],'as':_0x1c40('0x54')}]});}return null;})[_0x1c40('0x40')](respondWithResult(_0x1fa2a1,null))[_0x1c40('0x44')](handleError(_0x1fa2a1,null));};function getAccessToken(_0x449769){return new Promise(function(_0x214f88,_0x4a0389){var _0x5419ab;switch(_0x449769[_0x1c40('0x57')]){case'US':_0x5419ab=_0x1c40('0x58');break;case'AU':_0x5419ab=_0x1c40('0x59');break;case'EU':_0x5419ab=_0x1c40('0x5a');break;case'IN':_0x5419ab='https://accounts.zoho.in';break;case'CN':_0x5419ab='https://accounts.zoho.com.cn';break;default:_0x5419ab=_0x1c40('0x5a');break;}var _0xfc5200={'method':'POST','uri':_0x5419ab+'/oauth/v2/token','qs':{'refresh_token':_0x449769['refreshToken'],'client_id':_0x449769[_0x1c40('0x5b')],'client_secret':_0x449769[_0x1c40('0x5c')],'grant_type':_0x1c40('0x5d')},'json':!![]};return rp(_0xfc5200)[_0x1c40('0x40')](function(_0xb81cf8){if(_0xb81cf8[_0x1c40('0x5e')]){_0x214f88(_0xb81cf8['access_token']);}else{_0x4a0389(_0x1c40('0x5f'));}})[_0x1c40('0x44')](function(_0x35f110){_0x4a0389(_0x35f110);});});}exports[_0x1c40('0x60')]=function(_0xc14027,_0x19404c,_0xa81533){var _0x407b80,_0x1f1167,_0x4045ef,_0x2de806,_0x429021;return db[_0x1c40('0x2e')][_0x1c40('0x4c')]({'where':{'id':_0xc14027[_0x1c40('0x4a')]['id']},'attributes':['id',_0x1c40('0x61'),'zone',_0x1c40('0x5b'),_0x1c40('0x5c'),_0x1c40('0x62'),'code',_0x1c40('0x63')]})[_0x1c40('0x40')](handleEntityNotFound(_0x19404c,null))[_0x1c40('0x40')](function(_0x445eeb){_0x429021=_0x445eeb;_0x407b80=_0x429021[_0x1c40('0x61')];_0x1f1167=_0x407b80==='zoho.eu'?'eu':_0x1c40('0x64');_0x4045ef=_0x429021[_0x1c40('0x62')];var _0x5622e5=_0x4045ef[_0x1c40('0x65')](-0x1);if(_0x5622e5==='/'||_0x5622e5==='\x5c'||_0x5622e5===':'){_0x4045ef=_0x4045ef[_0x1c40('0x66')](0x0,_0x4045ef['lastIndexOf'](_0x5622e5));}if(!_0x429021['refreshToken']){throw new Error(_0x1c40('0x67'));}return getAccessToken(_0x429021);})['then'](function(_0x11ab4c){if(_0x11ab4c){return rp({'method':_0x1c40('0x68'),'uri':util[_0x1c40('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1f1167),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x11ab4c},'json':!![]});}})['then'](function(_0x13b239){if(_0x13b239){if(_0x13b239[_0x1c40('0x6a')]&&_0x13b239['response']['error']){throw new Error(_0x13b239[_0x1c40('0x6a')]['error']['message']);}var _0x13abeb=[];var _0x338a51=[];var _0x553d08=['Owner',_0x1c40('0x6b'),_0x1c40('0x6c'),_0x1c40('0x6d'),'Call_Duration',_0x1c40('0x6e'),_0x1c40('0x6f'),_0x1c40('0x70')];_0x338a51=_[_0x1c40('0x71')](_0x13b239[_0x1c40('0x37')],function(_0x1b4858){return _0x553d08[_0x1c40('0x72')](_0x1b4858[_0x1c40('0x73')]);});for(var _0x4731f9=0x0;_0x4731f9<_0x338a51[_0x1c40('0x4e')];_0x4731f9++){if(_0x338a51[_0x4731f9][_0x1c40('0x74')]===![]){_0x13abeb[_0x1c40('0x75')]({'id':_0x338a51[_0x4731f9]['id'],'name':_0x338a51[_0x4731f9][_0x1c40('0x76')],'custom':_0x338a51[_0x4731f9][_0x1c40('0x77')],'options':_0x338a51[_0x4731f9][_0x1c40('0x78')]===_0x1c40('0x79')&&_0x338a51[_0x4731f9]['pick_list_values']['length']>-0x1?_[_0x1c40('0x2d')](_0x338a51[_0x4731f9][_0x1c40('0x7a')],function(_0x18b3a0){return{'name':_0x18b3a0,'value':_0x18b3a0};}):[]});}}return{'count':_0x13abeb[_0x1c40('0x4e')],'rows':_0x13abeb};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x19404c,null))[_0x1c40('0x44')](function(_0x2ea46c){var _0x1b4bbc=_0xc14027[_0x1c40('0x32')][_0x1c40('0x7b')]?0x1f4:_0x2ea46c[_0x1c40('0x7c')]||0x1f4;logger[_0x1c40('0x7d')](_0x1c40('0x7e'),_0x1c40('0x60'),_0x1b4bbc,JSON[_0x1c40('0x7f')](_0x2ea46c));delete _0x2ea46c[_0x1c40('0x2a')];if(_0x1b4bbc===0x191){_0x1b4bbc=0x190;}_0x19404c[_0x1c40('0x1e')](_0x1b4bbc)['send'](_0xc14027[_0x1c40('0x32')][_0x1c40('0x7b')]?{'message':_0x1c40('0x80'),'statusCode':_0x2ea46c[_0x1c40('0x7c')]}:_0x2ea46c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 8c7beb3..c117efb 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 _0xfed5=['https://accounts.zoho.eu','/oauth/v2/token','authorization_code','then','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','lastIndexOf','POST','application/x-www-form-urlencoded','parse','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xfed5,0xb5));var _0x5fed=function(_0x4067a9,_0x57c513){_0x4067a9=_0x4067a9-0x0;var _0x37fccf=_0xfed5[_0x4067a9];return _0x37fccf;};'use strict';var _=require(_0x5fed('0x0'));var util=require(_0x5fed('0x1'));var logger=require(_0x5fed('0x2'))(_0x5fed('0x3'));var moment=require('moment');var BPromise=require(_0x5fed('0x4'));var rp=require(_0x5fed('0x5'));var fs=require('fs');var path=require(_0x5fed('0x6'));var rimraf=require(_0x5fed('0x7'));var config=require(_0x5fed('0x8'));var attributes=require(_0x5fed('0x9'));var integrations=require(_0x5fed('0xa'));module['exports']=function(_0xe7441a,_0x2af24e){return _0xe7441a[_0x5fed('0xb')](_0x5fed('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48ae4d,_0x4427e3,_0x2949a6){if(_0x48ae4d[_0x5fed('0xd')](_0x5fed('0xe'))||_0x48ae4d[_0x5fed('0xd')](_0x5fed('0xf'))||_0x48ae4d[_0x5fed('0xd')](_0x5fed('0x10'))||_0x48ae4d[_0x5fed('0xd')](_0x5fed('0x11'))||_0x48ae4d['changed'](_0x5fed('0x12'))||_0x48ae4d['changed'](_0x5fed('0x13'))){var _0x59e337,_0x184c86;_0x59e337=_0x48ae4d[_0x5fed('0xf')];var _0x132780=_0x59e337['slice'](-0x1);if(_0x132780==='/'||_0x132780==='\x5c'||_0x132780===':'){_0x59e337=_0x59e337[_0x5fed('0x14')](0x0,_0x59e337['lastIndexOf'](_0x132780));}switch(_0x48ae4d[_0x5fed('0xe')]){case'US':_0x184c86=_0x5fed('0x15');break;case'AU':_0x184c86='https://accounts.zoho.com.au';break;case'IN':_0x184c86=_0x5fed('0x16');break;case'CN':_0x184c86=_0x5fed('0x17');break;default:_0x184c86=_0x5fed('0x18');break;}var _0x47b542={'method':'POST','uri':_0x184c86+_0x5fed('0x19'),'form':{'grant_type':_0x5fed('0x1a'),'client_id':_0x48ae4d[_0x5fed('0x10')],'client_secret':_0x48ae4d[_0x5fed('0x11')],'redirect_uri':_0x48ae4d[_0x5fed('0xf')],'code':_0x48ae4d[_0x5fed('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x47b542)[_0x5fed('0x1b')](function(_0x2e91b4){var _0xa39a39=JSON['parse'](_0x2e91b4);if(_0xa39a39['refresh_token']){_0x48ae4d[_0x5fed('0x1c')]=_0xa39a39['refresh_token'];logger[_0x5fed('0x1d')](util[_0x5fed('0x1e')](_0x5fed('0x1f'),_0x48ae4d[_0x5fed('0x20')],_0x48ae4d['id']));}else{logger['error'](util[_0x5fed('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x48ae4d[_0x5fed('0x20')],_0x48ae4d['id']),util[_0x5fed('0x21')](_0xa39a39,{'showHidden':![],'depth':null}));}return _0x2949a6(null,_0x4427e3);})[_0x5fed('0x22')](function(_0x1edcb2){logger[_0x5fed('0x23')](util[_0x5fed('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x48ae4d[_0x5fed('0x20')],_0x48ae4d['id']),util[_0x5fed('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2949a6(_0x1edcb2);});}else{return _0x2949a6(null,_0x4427e3);}},'beforeUpdate':function(_0x10a75e,_0x890ab7,_0x51971e){if(_0x10a75e[_0x5fed('0xd')](_0x5fed('0xe'))||_0x10a75e[_0x5fed('0xd')](_0x5fed('0xf'))||_0x10a75e[_0x5fed('0xd')]('clientId')||_0x10a75e[_0x5fed('0xd')](_0x5fed('0x11'))||_0x10a75e['changed'](_0x5fed('0x12'))||_0x10a75e['changed'](_0x5fed('0x13'))){var _0x169b5e,_0x427b02;_0x169b5e=_0x10a75e[_0x5fed('0xf')];var _0x345ed5=_0x169b5e['slice'](-0x1);if(_0x345ed5==='/'||_0x345ed5==='\x5c'||_0x345ed5===':'){_0x169b5e=_0x169b5e[_0x5fed('0x14')](0x0,_0x169b5e[_0x5fed('0x24')](_0x345ed5));}switch(_0x10a75e['zone']){case'US':_0x427b02=_0x5fed('0x15');break;case'AU':_0x427b02='https://accounts.zoho.com.au';break;case'IN':_0x427b02=_0x5fed('0x16');break;case'CN':_0x427b02=_0x5fed('0x17');break;default:_0x427b02=_0x5fed('0x18');break;}var _0x42462d={'method':_0x5fed('0x25'),'uri':_0x427b02+'/oauth/v2/token','form':{'grant_type':_0x5fed('0x1a'),'client_id':_0x10a75e[_0x5fed('0x10')],'client_secret':_0x10a75e[_0x5fed('0x11')],'redirect_uri':_0x10a75e[_0x5fed('0xf')],'code':_0x10a75e[_0x5fed('0x12')]},'headers':{'Content-Type':_0x5fed('0x26')}};return rp(_0x42462d)[_0x5fed('0x1b')](function(_0x15ea1c){var _0x3309a3=JSON[_0x5fed('0x27')](_0x15ea1c);if(_0x3309a3['refresh_token']){_0x10a75e[_0x5fed('0x1c')]=_0x3309a3['refresh_token'];logger[_0x5fed('0x1d')](util[_0x5fed('0x1e')](_0x5fed('0x1f'),_0x10a75e[_0x5fed('0x20')],_0x10a75e['id']));}else{logger[_0x5fed('0x23')](util[_0x5fed('0x1e')](_0x5fed('0x28'),_0x10a75e[_0x5fed('0x20')],_0x10a75e['id']),util['inspect'](_0x3309a3,{'showHidden':![],'depth':null}));}return _0x51971e(null,_0x890ab7);})[_0x5fed('0x22')](function(_0x42a26f){logger[_0x5fed('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10a75e['name'],_0x10a75e['id']),util[_0x5fed('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x51971e(_0x42a26f);});}else{return _0x51971e(null,_0x890ab7);}}}});}; \ No newline at end of file +var _0x6668=['clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','host','https://accounts.zoho.eu','refresh_token','lodash','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6668,0xec));var _0x8666=function(_0x319261,_0x2b165a){_0x319261=_0x319261-0x0;var _0x4a5cc9=_0x6668[_0x319261];return _0x4a5cc9;};'use strict';var _=require(_0x8666('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8666('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8666('0x2'));var fs=require('fs');var path=require(_0x8666('0x3'));var rimraf=require(_0x8666('0x4'));var config=require(_0x8666('0x5'));var attributes=require(_0x8666('0x6'));var integrations=require(_0x8666('0x7'));module[_0x8666('0x8')]=function(_0x3bd939,_0x2c5165){return _0x3bd939[_0x8666('0x9')](_0x8666('0xa'),attributes,{'tableName':_0x8666('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x323618,_0x44a8bc,_0xfcded){if(_0x323618[_0x8666('0xc')](_0x8666('0xd'))||_0x323618[_0x8666('0xc')](_0x8666('0xe'))||_0x323618[_0x8666('0xc')](_0x8666('0xf'))||_0x323618[_0x8666('0xc')](_0x8666('0x10'))||_0x323618[_0x8666('0xc')](_0x8666('0x11'))||_0x323618[_0x8666('0xc')]('host')){var _0x226ed4,_0x2ac9a1;_0x226ed4=_0x323618[_0x8666('0xe')];var _0x54ca4a=_0x226ed4[_0x8666('0x12')](-0x1);if(_0x54ca4a==='/'||_0x54ca4a==='\x5c'||_0x54ca4a===':'){_0x226ed4=_0x226ed4[_0x8666('0x13')](0x0,_0x226ed4[_0x8666('0x14')](_0x54ca4a));}switch(_0x323618[_0x8666('0xd')]){case'US':_0x2ac9a1=_0x8666('0x15');break;case'AU':_0x2ac9a1=_0x8666('0x16');break;case'IN':_0x2ac9a1='https://accounts.zoho.in';break;case'CN':_0x2ac9a1=_0x8666('0x17');break;default:_0x2ac9a1='https://accounts.zoho.eu';break;}var _0x5cca17={'method':_0x8666('0x18'),'uri':_0x2ac9a1+_0x8666('0x19'),'form':{'grant_type':_0x8666('0x1a'),'client_id':_0x323618[_0x8666('0xf')],'client_secret':_0x323618[_0x8666('0x10')],'redirect_uri':_0x323618[_0x8666('0xe')],'code':_0x323618[_0x8666('0x11')]},'headers':{'Content-Type':_0x8666('0x1b')}};return rp(_0x5cca17)[_0x8666('0x1c')](function(_0x2abbc5){var _0xe39bf3=JSON[_0x8666('0x1d')](_0x2abbc5);if(_0xe39bf3['refresh_token']){_0x323618[_0x8666('0x1e')]=_0xe39bf3['refresh_token'];logger[_0x8666('0x1f')](util['format'](_0x8666('0x20'),_0x323618[_0x8666('0x21')],_0x323618['id']));}else{logger['error'](util[_0x8666('0x22')](_0x8666('0x23'),_0x323618[_0x8666('0x21')],_0x323618['id']),util[_0x8666('0x24')](_0xe39bf3,{'showHidden':![],'depth':null}));}return _0xfcded(null,_0x44a8bc);})[_0x8666('0x25')](function(_0x28a139){logger[_0x8666('0x26')](util['format'](_0x8666('0x23'),_0x323618[_0x8666('0x21')],_0x323618['id']),util[_0x8666('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xfcded(_0x28a139);});}else{return _0xfcded(null,_0x44a8bc);}},'beforeUpdate':function(_0x5e7ba9,_0x5c7e0b,_0x31492f){if(_0x5e7ba9[_0x8666('0xc')](_0x8666('0xd'))||_0x5e7ba9['changed'](_0x8666('0xe'))||_0x5e7ba9['changed']('clientId')||_0x5e7ba9[_0x8666('0xc')](_0x8666('0x10'))||_0x5e7ba9[_0x8666('0xc')](_0x8666('0x11'))||_0x5e7ba9['changed'](_0x8666('0x27'))){var _0x507f1d,_0xa944c1;_0x507f1d=_0x5e7ba9['serverUrl'];var _0x5f36a4=_0x507f1d[_0x8666('0x12')](-0x1);if(_0x5f36a4==='/'||_0x5f36a4==='\x5c'||_0x5f36a4===':'){_0x507f1d=_0x507f1d[_0x8666('0x13')](0x0,_0x507f1d['lastIndexOf'](_0x5f36a4));}switch(_0x5e7ba9['zone']){case'US':_0xa944c1=_0x8666('0x15');break;case'AU':_0xa944c1=_0x8666('0x16');break;case'IN':_0xa944c1='https://accounts.zoho.in';break;case'CN':_0xa944c1=_0x8666('0x17');break;default:_0xa944c1=_0x8666('0x28');break;}var _0x4f805e={'method':_0x8666('0x18'),'uri':_0xa944c1+_0x8666('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x5e7ba9[_0x8666('0xf')],'client_secret':_0x5e7ba9[_0x8666('0x10')],'redirect_uri':_0x5e7ba9[_0x8666('0xe')],'code':_0x5e7ba9['code']},'headers':{'Content-Type':_0x8666('0x1b')}};return rp(_0x4f805e)[_0x8666('0x1c')](function(_0x389074){var _0xfcf5dd=JSON[_0x8666('0x1d')](_0x389074);if(_0xfcf5dd[_0x8666('0x29')]){_0x5e7ba9[_0x8666('0x1e')]=_0xfcf5dd[_0x8666('0x29')];logger[_0x8666('0x1f')](util['format'](_0x8666('0x20'),_0x5e7ba9[_0x8666('0x21')],_0x5e7ba9['id']));}else{logger[_0x8666('0x26')](util[_0x8666('0x22')](_0x8666('0x23'),_0x5e7ba9[_0x8666('0x21')],_0x5e7ba9['id']),util[_0x8666('0x24')](_0xfcf5dd,{'showHidden':![],'depth':null}));}return _0x31492f(null,_0x5c7e0b);})['catch'](function(_0x2720b9){logger[_0x8666('0x26')](util['format'](_0x8666('0x23'),_0x5e7ba9[_0x8666('0x21')],_0x5e7ba9['id']),util[_0x8666('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x31492f(_0x2720b9);});}else{return _0x31492f(null,_0x5c7e0b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 6c40b90..ee5d71e 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 _0xc224=['request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc224,0x1af));var _0x4c22=function(_0x3830a5,_0x1c22df){_0x3830a5=_0x3830a5-0x0;var _0x3c8665=_0xc224[_0x3830a5];return _0x3c8665;};'use strict';var _=require(_0x4c22('0x0'));var util=require(_0x4c22('0x1'));var moment=require(_0x4c22('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c22('0x3'));var fs=require('fs');var Redis=require(_0x4c22('0x4'));var db=require(_0x4c22('0x5'))['db'];var utils=require(_0x4c22('0x6'));var logger=require(_0x4c22('0x7'))(_0x4c22('0x8'));var config=require(_0x4c22('0x9'));var jayson=require(_0x4c22('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49f782,_0x4195b6,_0x3a6191){return new BPromise(function(_0x45397c,_0x309dad){return client[_0x4c22('0xb')](_0x49f782,_0x3a6191)[_0x4c22('0xc')](function(_0x44ec98){logger['info'](_0x4c22('0xd'),_0x4195b6,_0x4c22('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4195b6,_0x4c22('0xe'),JSON[_0x4c22('0xf')](_0x44ec98));if(_0x44ec98[_0x4c22('0x10')]){if(_0x44ec98['error'][_0x4c22('0x11')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4195b6,_0x44ec98['error'][_0x4c22('0x12')]);return _0x309dad(_0x44ec98[_0x4c22('0x10')][_0x4c22('0x12')]);}logger[_0x4c22('0x10')](_0x4c22('0xd'),_0x4195b6,_0x44ec98['error'][_0x4c22('0x12')]);return _0x45397c(_0x44ec98[_0x4c22('0x10')][_0x4c22('0x12')]);}else{logger[_0x4c22('0x13')](_0x4c22('0xd'),_0x4195b6,'request\x20sent');_0x45397c(_0x44ec98['result'][_0x4c22('0x12')]);}})[_0x4c22('0x14')](function(_0x46aaaa){logger[_0x4c22('0x10')](_0x4c22('0xd'),_0x4195b6,_0x46aaaa);_0x309dad(_0x46aaaa);});});}exports[_0x4c22('0x15')]=function(_0x408f6f){var _0x1577c6=this;return new Promise(function(_0x629d81,_0x59f120){return db[_0x4c22('0x16')]['findAll']({'raw':_0x408f6f['options']?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x18')]===undefined?!![]:![]:!![],'where':_0x408f6f[_0x4c22('0x17')]?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x19')]||null:null,'attributes':_0x408f6f[_0x4c22('0x17')]?_0x408f6f['options'][_0x4c22('0x1a')]||null:null,'limit':_0x408f6f['options']?_0x408f6f['options'][_0x4c22('0x1b')]||null:null,'include':_0x408f6f[_0x4c22('0x17')]?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x408f6f[_0x4c22('0x17')][_0x4c22('0x1c')],function(_0x38e6d5){return{'model':db[_0x38e6d5[_0x4c22('0x1e')]],'as':_0x38e6d5['as'],'attributes':_0x38e6d5[_0x4c22('0x1a')],'include':_0x38e6d5[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x38e6d5[_0x4c22('0x1c')],function(_0x2fa3d8){return{'model':db[_0x2fa3d8[_0x4c22('0x1e')]],'as':_0x2fa3d8['as'],'attributes':_0x2fa3d8['attributes'],'include':_0x2fa3d8[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x2fa3d8['include'],function(_0x3d15b9){return{'model':db[_0x3d15b9[_0x4c22('0x1e')]],'as':_0x3d15b9['as'],'attributes':_0x3d15b9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c22('0xc')](function(_0x2d5d49){logger[_0x4c22('0x13')](_0x4c22('0x15'),_0x408f6f);logger['debug'](_0x4c22('0x15'),_0x408f6f,JSON[_0x4c22('0xf')](_0x2d5d49));_0x629d81(_0x2d5d49);})[_0x4c22('0x14')](function(_0x55ca00){logger[_0x4c22('0x10')](_0x4c22('0x15'),_0x55ca00[_0x4c22('0x12')],_0x408f6f);_0x59f120(_0x1577c6[_0x4c22('0x10')](0x1f4,_0x55ca00[_0x4c22('0x12')]));});});};exports[_0x4c22('0x1f')]=function(_0x47fa82){var _0x1ad5e8=this;return new Promise(function(_0x4d10bd,_0x4f4d67){return db['ZohoAccount'][_0x4c22('0x20')]({'raw':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x18')]===undefined?!![]:![]:!![],'where':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x19')]||null:null,'attributes':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x1a')]||null:null,'include':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')]['include']?_['map'](_0x47fa82[_0x4c22('0x17')][_0x4c22('0x1c')],function(_0x139726){return{'model':db[_0x139726[_0x4c22('0x1e')]],'as':_0x139726['as'],'attributes':_0x139726[_0x4c22('0x1a')],'include':_0x139726[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x139726[_0x4c22('0x1c')],function(_0x4ad211){return{'model':db[_0x4ad211['model']],'as':_0x4ad211['as'],'attributes':_0x4ad211['attributes'],'include':_0x4ad211['include']?_[_0x4c22('0x1d')](_0x4ad211[_0x4c22('0x1c')],function(_0x17f237){return{'model':db[_0x17f237[_0x4c22('0x1e')]],'as':_0x17f237['as'],'attributes':_0x17f237[_0x4c22('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e1837){logger['info'](_0x4c22('0x1f'),_0x47fa82);logger[_0x4c22('0x21')](_0x4c22('0x1f'),_0x47fa82,JSON[_0x4c22('0xf')](_0x1e1837));_0x4d10bd(_0x1e1837);})[_0x4c22('0x14')](function(_0xf29ec9){logger[_0x4c22('0x10')](_0x4c22('0x1f'),_0xf29ec9[_0x4c22('0x12')],_0x47fa82);_0x4f4d67(_0x1ad5e8[_0x4c22('0x10')](0x1f4,_0xf29ec9['message']));});});}; \ No newline at end of file +var _0xdec3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','map','include','model','GetZohoAccount','ShowZohoAccount','find','lodash','moment','bluebird'];(function(_0x3b940c,_0x48b4f3){var _0x58af9a=function(_0x561a34){while(--_0x561a34){_0x3b940c['push'](_0x3b940c['shift']());}};_0x58af9a(++_0x48b4f3);}(_0xdec3,0x89));var _0x3dec=function(_0x9c1f48,_0x25da55){_0x9c1f48=_0x9c1f48-0x0;var _0x52ecd4=_0xdec3[_0x9c1f48];return _0x52ecd4;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var moment=require(_0x3dec('0x1'));var BPromise=require(_0x3dec('0x2'));var rs=require(_0x3dec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dec('0x4'))['db'];var utils=require(_0x3dec('0x5'));var logger=require(_0x3dec('0x6'))(_0x3dec('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dec('0x8'));var client=jayson[_0x3dec('0x9')][_0x3dec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd3208e,_0x1826ab,_0x311a74){return new BPromise(function(_0x207dcf,_0x4b32d2){return client[_0x3dec('0xb')](_0xd3208e,_0x311a74)[_0x3dec('0xc')](function(_0x599552){logger[_0x3dec('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x1826ab,'request\x20sent');logger[_0x3dec('0xe')](_0x3dec('0xf'),_0x1826ab,'request\x20sent',JSON[_0x3dec('0x10')](_0x599552));if(_0x599552[_0x3dec('0x11')]){if(_0x599552['error'][_0x3dec('0x12')]===0x1f4){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x599552[_0x3dec('0x11')][_0x3dec('0x14')]);return _0x4b32d2(_0x599552[_0x3dec('0x11')]['message']);}logger['error'](_0x3dec('0x13'),_0x1826ab,_0x599552['error'][_0x3dec('0x14')]);return _0x207dcf(_0x599552[_0x3dec('0x11')]['message']);}else{logger['info'](_0x3dec('0x13'),_0x1826ab,'request\x20sent');_0x207dcf(_0x599552[_0x3dec('0x15')]['message']);}})[_0x3dec('0x16')](function(_0x51cb2c){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x51cb2c);_0x4b32d2(_0x51cb2c);});});}exports['GetZohoAccount']=function(_0x31ff6d){var _0x249bc2=this;return new Promise(function(_0x253af9,_0x2f2868){return db[_0x3dec('0x17')][_0x3dec('0x18')]({'raw':_0x31ff6d[_0x3dec('0x19')]?_0x31ff6d[_0x3dec('0x19')][_0x3dec('0x1a')]===undefined?!![]:![]:!![],'where':_0x31ff6d[_0x3dec('0x19')]?_0x31ff6d[_0x3dec('0x19')][_0x3dec('0x1b')]||null:null,'attributes':_0x31ff6d[_0x3dec('0x19')]?_0x31ff6d[_0x3dec('0x19')][_0x3dec('0x1c')]||null:null,'limit':_0x31ff6d[_0x3dec('0x19')]?_0x31ff6d[_0x3dec('0x19')]['limit']||null:null,'include':_0x31ff6d['options']?_0x31ff6d['options']['include']?_[_0x3dec('0x1d')](_0x31ff6d[_0x3dec('0x19')][_0x3dec('0x1e')],function(_0x15267f){return{'model':db[_0x15267f[_0x3dec('0x1f')]],'as':_0x15267f['as'],'attributes':_0x15267f[_0x3dec('0x1c')],'include':_0x15267f[_0x3dec('0x1e')]?_[_0x3dec('0x1d')](_0x15267f[_0x3dec('0x1e')],function(_0x559b91){return{'model':db[_0x559b91[_0x3dec('0x1f')]],'as':_0x559b91['as'],'attributes':_0x559b91[_0x3dec('0x1c')],'include':_0x559b91[_0x3dec('0x1e')]?_['map'](_0x559b91[_0x3dec('0x1e')],function(_0x2febf7){return{'model':db[_0x2febf7['model']],'as':_0x2febf7['as'],'attributes':_0x2febf7[_0x3dec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3dec('0xc')](function(_0x5a578f){logger[_0x3dec('0xd')](_0x3dec('0x20'),_0x31ff6d);logger[_0x3dec('0xe')](_0x3dec('0x20'),_0x31ff6d,JSON[_0x3dec('0x10')](_0x5a578f));_0x253af9(_0x5a578f);})['catch'](function(_0x2d7db9){logger['error']('GetZohoAccount',_0x2d7db9[_0x3dec('0x14')],_0x31ff6d);_0x2f2868(_0x249bc2['error'](0x1f4,_0x2d7db9['message']));});});};exports[_0x3dec('0x21')]=function(_0x3c8d47){var _0x20ad4e=this;return new Promise(function(_0x127b17,_0x53b279){return db[_0x3dec('0x17')][_0x3dec('0x22')]({'raw':_0x3c8d47[_0x3dec('0x19')]?_0x3c8d47[_0x3dec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3c8d47[_0x3dec('0x19')]?_0x3c8d47['options']['where']||null:null,'attributes':_0x3c8d47[_0x3dec('0x19')]?_0x3c8d47[_0x3dec('0x19')][_0x3dec('0x1c')]||null:null,'include':_0x3c8d47[_0x3dec('0x19')]?_0x3c8d47[_0x3dec('0x19')][_0x3dec('0x1e')]?_['map'](_0x3c8d47['options'][_0x3dec('0x1e')],function(_0x561906){return{'model':db[_0x561906[_0x3dec('0x1f')]],'as':_0x561906['as'],'attributes':_0x561906[_0x3dec('0x1c')],'include':_0x561906[_0x3dec('0x1e')]?_[_0x3dec('0x1d')](_0x561906['include'],function(_0x118b8b){return{'model':db[_0x118b8b['model']],'as':_0x118b8b['as'],'attributes':_0x118b8b[_0x3dec('0x1c')],'include':_0x118b8b[_0x3dec('0x1e')]?_[_0x3dec('0x1d')](_0x118b8b[_0x3dec('0x1e')],function(_0x5a7a41){return{'model':db[_0x5a7a41['model']],'as':_0x5a7a41['as'],'attributes':_0x5a7a41[_0x3dec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3dec('0xc')](function(_0x5e8a49){logger[_0x3dec('0xd')](_0x3dec('0x21'),_0x3c8d47);logger[_0x3dec('0xe')](_0x3dec('0x21'),_0x3c8d47,JSON[_0x3dec('0x10')](_0x5e8a49));_0x127b17(_0x5e8a49);})['catch'](function(_0x5903cc){logger[_0x3dec('0x11')](_0x3dec('0x21'),_0x5903cc[_0x3dec('0x14')],_0x3c8d47);_0x53b279(_0x20ad4e[_0x3dec('0x11')](0x1f4,_0x5903cc[_0x3dec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1fd0b0a..6460d6e 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 _0x6265=['multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete'];(function(_0x564629,_0xd4b72b){var _0x5b2d56=function(_0x5696e4){while(--_0x5696e4){_0x564629['push'](_0x564629['shift']());}};_0x5b2d56(++_0xd4b72b);}(_0x6265,0x1e0));var _0x5626=function(_0x2b3131,_0x43eb1c){_0x2b3131=_0x2b3131-0x0;var _0x2018f7=_0x6265[_0x2b3131];return _0x2018f7;};'use strict';var multer=require(_0x5626('0x0'));var util=require(_0x5626('0x1'));var path=require(_0x5626('0x2'));var timeout=require(_0x5626('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5626('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5626('0x5'));var config=require(_0x5626('0x6'));var controller=require(_0x5626('0x7'));router[_0x5626('0x8')]('/',auth['isAuthenticated'](),controller[_0x5626('0x9')]);router[_0x5626('0x8')](_0x5626('0xa'),auth[_0x5626('0xb')](),controller['show']);router[_0x5626('0x8')](_0x5626('0xc'),auth[_0x5626('0xb')](),controller['getFields']);router[_0x5626('0x8')](_0x5626('0xd'),auth[_0x5626('0xb')](),controller[_0x5626('0xe')]);router['get'](_0x5626('0xf'),auth[_0x5626('0xb')](),controller['getDescriptions']);router[_0x5626('0x10')]('/',auth[_0x5626('0xb')](),controller[_0x5626('0x11')]);router[_0x5626('0x12')](_0x5626('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5626('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x08f8=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x23ae1a,_0x17ad63){var _0x22a6eb=function(_0x12e8ce){while(--_0x12e8ce){_0x23ae1a['push'](_0x23ae1a['shift']());}};_0x22a6eb(++_0x17ad63);}(_0x08f8,0x90));var _0x808f=function(_0x2263f4,_0x54851e){_0x2263f4=_0x2263f4-0x0;var _0x28d271=_0x08f8[_0x2263f4];return _0x28d271;};'use strict';var multer=require(_0x808f('0x0'));var util=require('util');var path=require(_0x808f('0x1'));var timeout=require(_0x808f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x808f('0x3'));var auth=require(_0x808f('0x4'));var interaction=require(_0x808f('0x5'));var config=require(_0x808f('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x808f('0x7')]('/',auth[_0x808f('0x8')](),controller[_0x808f('0x9')]);router[_0x808f('0x7')](_0x808f('0xa'),auth[_0x808f('0x8')](),controller[_0x808f('0xb')]);router[_0x808f('0x7')](_0x808f('0xc'),auth[_0x808f('0x8')](),controller[_0x808f('0xd')]);router[_0x808f('0x7')](_0x808f('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x808f('0x7')](_0x808f('0xf'),auth['isAuthenticated'](),controller[_0x808f('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x808f('0x11')]);router[_0x808f('0x12')](_0x808f('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x808f('0x13')](_0x808f('0xa'),auth[_0x808f('0x8')](),controller[_0x808f('0x14')]);module[_0x808f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1d5e325..d198199 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 _0xa59f=['lead','contact','contact_lead','sequelize','STRING','ENUM'];(function(_0x266e7a,_0x3b833c){var _0xf57090=function(_0xac813f){while(--_0xac813f){_0x266e7a['push'](_0x266e7a['shift']());}};_0xf57090(++_0x3b833c);}(_0xa59f,0x6f));var _0xfa59=function(_0x17df72,_0x2cf032){_0x17df72=_0x17df72-0x0;var _0x1b6ec9=_0xa59f[_0x17df72];return _0x1b6ec9;};'use strict';var Sequelize=require(_0xfa59('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa59('0x1')]},'moduleCreate':{'type':Sequelize[_0xfa59('0x2')](_0xfa59('0x3'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfa59('0x2')]('contact_lead',_0xfa59('0x4'),_0xfa59('0x3')),'defaultValue':_0xfa59('0x5')},'description':{'type':Sequelize[_0xfa59('0x1')]}}; \ No newline at end of file +var _0xf212=['lead','contact','nothing','contact_lead','exports','STRING','ENUM'];(function(_0x561060,_0x5434c8){var _0x12eb81=function(_0x202fe4){while(--_0x202fe4){_0x561060['push'](_0x561060['shift']());}};_0x12eb81(++_0x5434c8);}(_0xf212,0xf2));var _0x2f21=function(_0x59a46d,_0x1ea46b){_0x59a46d=_0x59a46d-0x0;var _0x445c70=_0xf212[_0x59a46d];return _0x445c70;};'use strict';var Sequelize=require('sequelize');module[_0x2f21('0x0')]={'name':{'type':Sequelize[_0x2f21('0x1')]},'moduleCreate':{'type':Sequelize[_0x2f21('0x2')](_0x2f21('0x3'),_0x2f21('0x4'),_0x2f21('0x5')),'defaultValue':_0x2f21('0x3')},'moduleSearch':{'type':Sequelize[_0x2f21('0x2')](_0x2f21('0x6'),_0x2f21('0x4'),_0x2f21('0x3')),'defaultValue':_0x2f21('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 59fbf95..fd94810 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 _0x6482=['sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6482,0x18b));var _0x2648=function(_0x29cc90,_0x30a476){_0x29cc90=_0x29cc90-0x0;var _0x3addcc=_0x6482[_0x29cc90];return _0x3addcc;};'use strict';var emlformat=require(_0x2648('0x0'));var rimraf=require(_0x2648('0x1'));var zipdir=require(_0x2648('0x2'));var jsonpatch=require(_0x2648('0x3'));var rp=require(_0x2648('0x4'));var moment=require(_0x2648('0x5'));var BPromise=require(_0x2648('0x6'));var Mustache=require('mustache');var util=require(_0x2648('0x7'));var path=require(_0x2648('0x8'));var sox=require(_0x2648('0x9'));var csv=require(_0x2648('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2648('0xb'));var _=require(_0x2648('0xc'));var squel=require(_0x2648('0xd'));var crypto=require('crypto');var jsforce=require(_0x2648('0xe'));var deskjs=require(_0x2648('0xf'));var toCsv=require(_0x2648('0xa'));var querystring=require('querystring');var Papa=require(_0x2648('0x10'));var Redis=require(_0x2648('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2648('0x12'));var as=require(_0x2648('0x13'));var hardwareService=require(_0x2648('0x14'));var logger=require(_0x2648('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2648('0x16'));var licenseUtil=require(_0x2648('0x17'));var db=require(_0x2648('0x18'))['db'];function respondWithStatusCode(_0x43763b,_0x4c26cf){_0x4c26cf=_0x4c26cf||0xcc;return function(_0x32ba96){if(_0x32ba96){return _0x43763b[_0x2648('0x19')](_0x4c26cf);}return _0x43763b[_0x2648('0x1a')](_0x4c26cf)['end']();};}function respondWithResult(_0x1f9b55,_0x4810b7){_0x4810b7=_0x4810b7||0xc8;return function(_0x298169){if(_0x298169){return _0x1f9b55[_0x2648('0x1a')](_0x4810b7)[_0x2648('0x1b')](_0x298169);}};}function respondWithFilteredResult(_0x5a4379,_0x224162){return function(_0x3a033f){if(_0x3a033f){var _0x1faa06=typeof _0x224162[_0x2648('0x1c')]===_0x2648('0x1d')&&typeof _0x224162['limit']===_0x2648('0x1d');var _0x563c6b=_0x3a033f[_0x2648('0x1e')];var _0x5f5d44=_0x1faa06?0x0:_0x224162[_0x2648('0x1c')];var _0x3ae871=_0x1faa06?_0x3a033f['count']:_0x224162[_0x2648('0x1c')]+_0x224162[_0x2648('0x1f')];var _0x276c0e;if(_0x3ae871>=_0x563c6b){_0x3ae871=_0x563c6b;_0x276c0e=0xc8;}else{_0x276c0e=0xce;}_0x5a4379['status'](_0x276c0e);return _0x5a4379[_0x2648('0x20')](_0x2648('0x21'),_0x5f5d44+'-'+_0x3ae871+'/'+_0x563c6b)[_0x2648('0x1b')](_0x3a033f);}return null;};}function patchUpdates(_0x28c61f){return function(_0x32800c){try{jsonpatch[_0x2648('0x22')](_0x32800c,_0x28c61f,!![]);}catch(_0x4626bc){return BPromise[_0x2648('0x23')](_0x4626bc);}return _0x32800c[_0x2648('0x24')]();};}function saveUpdates(_0x9765e,_0x5d64fc){return function(_0x4d23d5){if(_0x4d23d5){return _0x4d23d5[_0x2648('0x25')](_0x9765e)[_0x2648('0x26')](function(_0x530051){return _0x530051;});}return null;};}function removeEntity(_0x4dc6b7,_0x2d7804){return function(_0x3e24c6){if(_0x3e24c6){return _0x3e24c6[_0x2648('0x27')]()[_0x2648('0x26')](function(){_0x4dc6b7[_0x2648('0x1a')](0xcc)[_0x2648('0x28')]();});}};}function handleEntityNotFound(_0x1b3c88,_0xbdd1b9){return function(_0x28f95e){if(!_0x28f95e){_0x1b3c88[_0x2648('0x19')](0x194);}return _0x28f95e;};}function handleError(_0x1455e2,_0x225df8){_0x225df8=_0x225df8||0x1f4;return function(_0x89957a){logger[_0x2648('0x29')](_0x89957a[_0x2648('0x2a')]);if(_0x89957a[_0x2648('0x2b')]){delete _0x89957a[_0x2648('0x2b')];}_0x1455e2['status'](_0x225df8)[_0x2648('0x2c')](_0x89957a);};}exports[_0x2648('0x2d')]=function(_0x4da77b,_0x2db24d){var _0x191025={},_0x5d0122={},_0xb6d405={'count':0x0,'rows':[]};var _0x420088=_[_0x2648('0x2e')](db[_0x2648('0x2f')][_0x2648('0x30')],function(_0xbadc30){return{'name':_0xbadc30[_0x2648('0x31')],'type':_0xbadc30['type'][_0x2648('0x32')]};});_0x5d0122[_0x2648('0x33')]=_[_0x2648('0x2e')](_0x420088,'name');_0x5d0122[_0x2648('0x34')]=_[_0x2648('0x35')](_0x4da77b['query']);_0x5d0122['filters']=_[_0x2648('0x36')](_0x5d0122[_0x2648('0x33')],_0x5d0122['query']);_0x191025[_0x2648('0x37')]=_[_0x2648('0x36')](_0x5d0122[_0x2648('0x33')],qs[_0x2648('0x38')](_0x4da77b['query'][_0x2648('0x38')]));_0x191025[_0x2648('0x37')]=_0x191025[_0x2648('0x37')][_0x2648('0x39')]?_0x191025[_0x2648('0x37')]:_0x5d0122[_0x2648('0x33')];if(!_0x4da77b[_0x2648('0x34')][_0x2648('0x3a')](_0x2648('0x3b'))){_0x191025[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0x4da77b[_0x2648('0x34')][_0x2648('0x1f')]);_0x191025[_0x2648('0x1c')]=qs[_0x2648('0x1c')](_0x4da77b[_0x2648('0x34')][_0x2648('0x1c')]);}_0x191025[_0x2648('0x3c')]=qs[_0x2648('0x3d')](_0x4da77b[_0x2648('0x34')][_0x2648('0x3d')]);_0x191025[_0x2648('0x3e')]=qs[_0x2648('0x3f')](_[_0x2648('0x40')](_0x4da77b[_0x2648('0x34')],_0x5d0122['filters']),_0x420088);if(_0x4da77b[_0x2648('0x34')][_0x2648('0x41')]){_0x191025[_0x2648('0x3e')]=_['merge'](_0x191025[_0x2648('0x3e')],{'$or':_[_0x2648('0x2e')](_0x420088,function(_0x55929a){if(_0x55929a[_0x2648('0x42')]!==_0x2648('0x43')){var _0x2f8ca5={};_0x2f8ca5[_0x55929a[_0x2648('0x2b')]]={'$like':'%'+_0x4da77b[_0x2648('0x34')][_0x2648('0x41')]+'%'};return _0x2f8ca5;}})});}_0x191025=_[_0x2648('0x44')]({},_0x191025,_0x4da77b[_0x2648('0x45')]);var _0x40a793={'where':_0x191025[_0x2648('0x3e')]};return db[_0x2648('0x2f')][_0x2648('0x1e')](_0x40a793)[_0x2648('0x26')](function(_0x3c4212){_0xb6d405[_0x2648('0x1e')]=_0x3c4212;if(_0x4da77b['query'][_0x2648('0x46')]){_0x191025[_0x2648('0x47')]=[{'all':!![]}];}return db[_0x2648('0x2f')][_0x2648('0x48')](_0x191025);})[_0x2648('0x26')](function(_0x4304af){_0xb6d405['rows']=_0x4304af;return _0xb6d405;})[_0x2648('0x26')](respondWithFilteredResult(_0x2db24d,_0x191025))['catch'](handleError(_0x2db24d,null));};exports[_0x2648('0x49')]=function(_0x4259f4,_0x3b0708){var _0x449f49={'raw':![],'where':{'id':_0x4259f4[_0x2648('0x4a')]['id']}},_0x24fd6b={};_0x24fd6b[_0x2648('0x33')]=_[_0x2648('0x35')](db[_0x2648('0x2f')][_0x2648('0x30')]);_0x24fd6b[_0x2648('0x34')]=_[_0x2648('0x35')](_0x4259f4[_0x2648('0x34')]);_0x24fd6b['filters']=_[_0x2648('0x36')](_0x24fd6b[_0x2648('0x33')],_0x24fd6b['query']);_0x449f49[_0x2648('0x37')]=_['intersection'](_0x24fd6b[_0x2648('0x33')],qs[_0x2648('0x38')](_0x4259f4[_0x2648('0x34')]['fields']));_0x449f49[_0x2648('0x37')]=_0x449f49[_0x2648('0x37')]['length']?_0x449f49[_0x2648('0x37')]:_0x24fd6b[_0x2648('0x33')];if(_0x4259f4[_0x2648('0x34')]['includeAll']){_0x449f49[_0x2648('0x47')]=[{'all':!![]}];}_0x449f49=_['merge']({},_0x449f49,_0x4259f4[_0x2648('0x45')]);return db[_0x2648('0x2f')][_0x2648('0x4b')](_0x449f49)['then'](handleEntityNotFound(_0x3b0708,null))[_0x2648('0x26')](respondWithResult(_0x3b0708,null))[_0x2648('0x4c')](handleError(_0x3b0708,null));};exports[_0x2648('0x4d')]=function(_0x1711c4,_0x4db7e6){return db[_0x2648('0x2f')][_0x2648('0x4d')](_0x1711c4[_0x2648('0x4e')],{})[_0x2648('0x26')](respondWithResult(_0x4db7e6,0xc9))[_0x2648('0x4c')](handleError(_0x4db7e6,null));};exports[_0x2648('0x25')]=function(_0x203301,_0x8611d5){if(_0x203301['body']['id']){delete _0x203301['body']['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x203301['params']['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x8611d5,null))[_0x2648('0x26')](saveUpdates(_0x203301[_0x2648('0x4e')],null))[_0x2648('0x26')](respondWithResult(_0x8611d5,null))['catch'](handleError(_0x8611d5,null));};exports[_0x2648('0x27')]=function(_0x3f8f4d,_0x3d91f3){return db[_0x2648('0x2f')][_0x2648('0x4b')]({'where':{'id':_0x3f8f4d[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x3d91f3,null))[_0x2648('0x26')](removeEntity(_0x3d91f3,null))[_0x2648('0x4c')](handleError(_0x3d91f3,null));};exports[_0x2648('0x4f')]=function(_0x1fd3c9,_0x2306a1,_0x5b3fc5){var _0x1ee49f={};var _0x335139={};var _0x3fc164;var _0x316e7b;return db[_0x2648('0x2f')][_0x2648('0x50')]({'where':{'id':_0x1fd3c9['params']['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x2306a1,null))['then'](function(_0x4000b2){if(_0x4000b2){_0x3fc164=_0x4000b2;_0x335139[_0x2648('0x33')]=_[_0x2648('0x35')](db['ZohoField'][_0x2648('0x30')]);_0x335139[_0x2648('0x34')]=_['keys'](_0x1fd3c9[_0x2648('0x34')]);_0x335139['filters']=_[_0x2648('0x36')](_0x335139['model'],_0x335139[_0x2648('0x34')]);_0x1ee49f['attributes']=_[_0x2648('0x36')](_0x335139[_0x2648('0x33')],qs[_0x2648('0x38')](_0x1fd3c9[_0x2648('0x34')][_0x2648('0x38')]));_0x1ee49f[_0x2648('0x37')]=_0x1ee49f[_0x2648('0x37')][_0x2648('0x39')]?_0x1ee49f[_0x2648('0x37')]:_0x335139['model'];_0x1ee49f[_0x2648('0x3c')]=qs[_0x2648('0x3d')](_0x1fd3c9[_0x2648('0x34')][_0x2648('0x3d')]);_0x1ee49f['where']=qs[_0x2648('0x3f')](_[_0x2648('0x40')](_0x1fd3c9[_0x2648('0x34')],_0x335139[_0x2648('0x3f')]));if(_0x1fd3c9[_0x2648('0x34')][_0x2648('0x41')]){_0x1ee49f[_0x2648('0x3e')]=_['merge'](_0x1ee49f[_0x2648('0x3e')],{'$or':_['map'](_0x1ee49f[_0x2648('0x37')],function(_0x17af97){var _0x1c2eee={};_0x1c2eee[_0x17af97]={'$like':'%'+_0x1fd3c9['query'][_0x2648('0x41')]+'%'};return _0x1c2eee;})});}_0x1ee49f=_[_0x2648('0x44')]({},_0x1ee49f,_0x1fd3c9[_0x2648('0x45')]);return _0x3fc164[_0x2648('0x4f')](_0x1ee49f);}})[_0x2648('0x26')](function(_0x3b4765){if(_0x3b4765){_0x316e7b=_0x3b4765['length'];if(!_0x1fd3c9['query'][_0x2648('0x3a')]('nolimit')){_0x1ee49f[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0x1fd3c9[_0x2648('0x34')][_0x2648('0x1f')]);_0x1ee49f[_0x2648('0x1c')]=qs[_0x2648('0x1c')](_0x1fd3c9[_0x2648('0x34')][_0x2648('0x1c')]);}return _0x3fc164[_0x2648('0x4f')](_0x1ee49f);}})['then'](function(_0x1ea478){if(_0x1ea478){return _0x1ea478?{'count':_0x316e7b,'rows':_0x1ea478}:null;}})[_0x2648('0x26')](respondWithResult(_0x2306a1,null))['catch'](handleError(_0x2306a1,null));};exports[_0x2648('0x51')]=function(_0xdd4de0,_0x5e8362,_0x3d8eaf){var _0x16c249={};var _0x279971={};var _0x382610;var _0x4b23d4;return db[_0x2648('0x2f')][_0x2648('0x50')]({'where':{'id':_0xdd4de0[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x5e8362,null))[_0x2648('0x26')](function(_0x38f965){if(_0x38f965){_0x382610=_0x38f965;_0x279971[_0x2648('0x33')]=_[_0x2648('0x35')](db[_0x2648('0x52')]['rawAttributes']);_0x279971[_0x2648('0x34')]=_[_0x2648('0x35')](_0xdd4de0['query']);_0x279971[_0x2648('0x3f')]=_[_0x2648('0x36')](_0x279971[_0x2648('0x33')],_0x279971[_0x2648('0x34')]);_0x16c249[_0x2648('0x37')]=_[_0x2648('0x36')](_0x279971['model'],qs[_0x2648('0x38')](_0xdd4de0[_0x2648('0x34')][_0x2648('0x38')]));_0x16c249[_0x2648('0x37')]=_0x16c249[_0x2648('0x37')][_0x2648('0x39')]?_0x16c249[_0x2648('0x37')]:_0x279971[_0x2648('0x33')];_0x16c249[_0x2648('0x3c')]=qs[_0x2648('0x3d')](_0xdd4de0[_0x2648('0x34')][_0x2648('0x3d')]);_0x16c249[_0x2648('0x3e')]=qs[_0x2648('0x3f')](_[_0x2648('0x40')](_0xdd4de0[_0x2648('0x34')],_0x279971['filters']));if(_0xdd4de0[_0x2648('0x34')]['filter']){_0x16c249[_0x2648('0x3e')]=_['merge'](_0x16c249[_0x2648('0x3e')],{'$or':_['map'](_0x16c249['attributes'],function(_0x446f6d){var _0x1b5513={};_0x1b5513[_0x446f6d]={'$like':'%'+_0xdd4de0[_0x2648('0x34')][_0x2648('0x41')]+'%'};return _0x1b5513;})});}_0x16c249=_[_0x2648('0x44')]({},_0x16c249,_0xdd4de0[_0x2648('0x45')]);return _0x382610[_0x2648('0x51')](_0x16c249);}})[_0x2648('0x26')](function(_0x4769d6){if(_0x4769d6){_0x4b23d4=_0x4769d6[_0x2648('0x39')];if(!_0xdd4de0['query'][_0x2648('0x3a')]('nolimit')){_0x16c249[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0xdd4de0['query']['limit']);_0x16c249['offset']=qs[_0x2648('0x1c')](_0xdd4de0[_0x2648('0x34')][_0x2648('0x1c')]);}return _0x382610[_0x2648('0x51')](_0x16c249);}})['then'](function(_0x5b9ca2){if(_0x5b9ca2){return _0x5b9ca2?{'count':_0x4b23d4,'rows':_0x5b9ca2}:null;}})[_0x2648('0x26')](respondWithResult(_0x5e8362,null))[_0x2648('0x4c')](handleError(_0x5e8362,null));};exports[_0x2648('0x53')]=function(_0x30d364,_0x5118a7,_0x142764){var _0x251261={};var _0x584998={};var _0x2561b0;var _0x395954;return db[_0x2648('0x2f')][_0x2648('0x50')]({'where':{'id':_0x30d364[_0x2648('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5118a7,null))['then'](function(_0x23f4a6){if(_0x23f4a6){_0x2561b0=_0x23f4a6;_0x584998[_0x2648('0x33')]=_['keys'](db['ZohoField'][_0x2648('0x30')]);_0x584998[_0x2648('0x34')]=_['keys'](_0x30d364[_0x2648('0x34')]);_0x584998[_0x2648('0x3f')]=_[_0x2648('0x36')](_0x584998[_0x2648('0x33')],_0x584998['query']);_0x251261['attributes']=_['intersection'](_0x584998[_0x2648('0x33')],qs['fields'](_0x30d364['query']['fields']));_0x251261[_0x2648('0x37')]=_0x251261[_0x2648('0x37')]['length']?_0x251261[_0x2648('0x37')]:_0x584998[_0x2648('0x33')];_0x251261[_0x2648('0x3c')]=qs[_0x2648('0x3d')](_0x30d364['query'][_0x2648('0x3d')]);_0x251261[_0x2648('0x3e')]=qs[_0x2648('0x3f')](_[_0x2648('0x40')](_0x30d364['query'],_0x584998[_0x2648('0x3f')]));if(_0x30d364[_0x2648('0x34')][_0x2648('0x41')]){_0x251261[_0x2648('0x3e')]=_[_0x2648('0x44')](_0x251261[_0x2648('0x3e')],{'$or':_[_0x2648('0x2e')](_0x251261['attributes'],function(_0x2d1ebc){var _0x1a897d={};_0x1a897d[_0x2d1ebc]={'$like':'%'+_0x30d364[_0x2648('0x34')][_0x2648('0x41')]+'%'};return _0x1a897d;})});}_0x251261=_[_0x2648('0x44')]({},_0x251261,_0x30d364['options']);return _0x2561b0['getDescriptions'](_0x251261);}})['then'](function(_0x2134b3){if(_0x2134b3){_0x395954=_0x2134b3[_0x2648('0x39')];if(!_0x30d364[_0x2648('0x34')][_0x2648('0x3a')]('nolimit')){_0x251261[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0x30d364[_0x2648('0x34')]['limit']);_0x251261[_0x2648('0x1c')]=qs['offset'](_0x30d364[_0x2648('0x34')]['offset']);}return _0x2561b0[_0x2648('0x53')](_0x251261);}})[_0x2648('0x26')](function(_0x5d691e){if(_0x5d691e){return _0x5d691e?{'count':_0x395954,'rows':_0x5d691e}:null;}})[_0x2648('0x26')](respondWithResult(_0x5118a7,null))[_0x2648('0x4c')](handleError(_0x5118a7,null));}; \ No newline at end of file +var _0x5ebd=['set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','ZohoConfiguration','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rawAttributes','include','find','catch','create','body','params','getFields','findOne','ZohoField','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x5ebd,0x83));var _0xd5eb=function(_0x1d484c,_0x27c954){_0x1d484c=_0x1d484c-0x0;var _0xb2ec18=_0x5ebd[_0x1d484c];return _0xb2ec18;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd5eb('0x0'));var jsonpatch=require(_0xd5eb('0x1'));var rp=require(_0xd5eb('0x2'));var moment=require(_0xd5eb('0x3'));var BPromise=require(_0xd5eb('0x4'));var Mustache=require('mustache');var util=require(_0xd5eb('0x5'));var path=require(_0xd5eb('0x6'));var sox=require(_0xd5eb('0x7'));var csv=require(_0xd5eb('0x8'));var ejs=require(_0xd5eb('0x9'));var fs=require('fs');var fs_extra=require(_0xd5eb('0xa'));var _=require(_0xd5eb('0xb'));var squel=require(_0xd5eb('0xc'));var crypto=require('crypto');var jsforce=require(_0xd5eb('0xd'));var deskjs=require(_0xd5eb('0xe'));var toCsv=require(_0xd5eb('0x8'));var querystring=require(_0xd5eb('0xf'));var Papa=require(_0xd5eb('0x10'));var Redis=require(_0xd5eb('0x11'));var authService=require(_0xd5eb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd5eb('0x13'));var hardwareService=require(_0xd5eb('0x14'));var logger=require(_0xd5eb('0x15'))(_0xd5eb('0x16'));var utils=require(_0xd5eb('0x17'));var config=require(_0xd5eb('0x18'));var licenseUtil=require(_0xd5eb('0x19'));var db=require(_0xd5eb('0x1a'))['db'];function respondWithStatusCode(_0xba81bb,_0x428d85){_0x428d85=_0x428d85||0xcc;return function(_0x561bc1){if(_0x561bc1){return _0xba81bb['sendStatus'](_0x428d85);}return _0xba81bb[_0xd5eb('0x1b')](_0x428d85)['end']();};}function respondWithResult(_0x3ddea8,_0x2d91c0){_0x2d91c0=_0x2d91c0||0xc8;return function(_0x5a5390){if(_0x5a5390){return _0x3ddea8['status'](_0x2d91c0)[_0xd5eb('0x1c')](_0x5a5390);}};}function respondWithFilteredResult(_0x4f7568,_0x473d09){return function(_0x178343){if(_0x178343){var _0x13ad12=typeof _0x473d09[_0xd5eb('0x1d')]===_0xd5eb('0x1e')&&typeof _0x473d09[_0xd5eb('0x1f')]===_0xd5eb('0x1e');var _0x2cbb87=_0x178343[_0xd5eb('0x20')];var _0x5e202c=_0x13ad12?0x0:_0x473d09[_0xd5eb('0x1d')];var _0x1e23ef=_0x13ad12?_0x178343[_0xd5eb('0x20')]:_0x473d09[_0xd5eb('0x1d')]+_0x473d09[_0xd5eb('0x1f')];var _0x22e184;if(_0x1e23ef>=_0x2cbb87){_0x1e23ef=_0x2cbb87;_0x22e184=0xc8;}else{_0x22e184=0xce;}_0x4f7568[_0xd5eb('0x1b')](_0x22e184);return _0x4f7568[_0xd5eb('0x21')](_0xd5eb('0x22'),_0x5e202c+'-'+_0x1e23ef+'/'+_0x2cbb87)[_0xd5eb('0x1c')](_0x178343);}return null;};}function patchUpdates(_0x107181){return function(_0x498d18){try{jsonpatch[_0xd5eb('0x23')](_0x498d18,_0x107181,!![]);}catch(_0x30dde6){return BPromise[_0xd5eb('0x24')](_0x30dde6);}return _0x498d18[_0xd5eb('0x25')]();};}function saveUpdates(_0x41e360,_0x43a178){return function(_0x32dbe9){if(_0x32dbe9){return _0x32dbe9[_0xd5eb('0x26')](_0x41e360)[_0xd5eb('0x27')](function(_0x18c7fd){return _0x18c7fd;});}return null;};}function removeEntity(_0x525da0,_0xd3b96c){return function(_0x22f839){if(_0x22f839){return _0x22f839[_0xd5eb('0x28')]()['then'](function(){_0x525da0[_0xd5eb('0x1b')](0xcc)[_0xd5eb('0x29')]();});}};}function handleEntityNotFound(_0x4e2cfe,_0x3093e7){return function(_0x55b7bb){if(!_0x55b7bb){_0x4e2cfe[_0xd5eb('0x2a')](0x194);}return _0x55b7bb;};}function handleError(_0x4a8dc9,_0x22b7bf){_0x22b7bf=_0x22b7bf||0x1f4;return function(_0x5aebbf){logger['error'](_0x5aebbf[_0xd5eb('0x2b')]);if(_0x5aebbf[_0xd5eb('0x2c')]){delete _0x5aebbf[_0xd5eb('0x2c')];}_0x4a8dc9[_0xd5eb('0x1b')](_0x22b7bf)[_0xd5eb('0x2d')](_0x5aebbf);};}exports[_0xd5eb('0x2e')]=function(_0x157336,_0x11b947){var _0x3209eb={},_0x54f905={},_0x5e7553={'count':0x0,'rows':[]};var _0x2d32ce=_['map'](db[_0xd5eb('0x2f')]['rawAttributes'],function(_0xd9ead4){return{'name':_0xd9ead4[_0xd5eb('0x30')],'type':_0xd9ead4[_0xd5eb('0x31')][_0xd5eb('0x32')]};});_0x54f905['model']=_[_0xd5eb('0x33')](_0x2d32ce,_0xd5eb('0x2c'));_0x54f905[_0xd5eb('0x34')]=_[_0xd5eb('0x35')](_0x157336[_0xd5eb('0x34')]);_0x54f905[_0xd5eb('0x36')]=_[_0xd5eb('0x37')](_0x54f905[_0xd5eb('0x38')],_0x54f905[_0xd5eb('0x34')]);_0x3209eb['attributes']=_['intersection'](_0x54f905[_0xd5eb('0x38')],qs[_0xd5eb('0x39')](_0x157336[_0xd5eb('0x34')][_0xd5eb('0x39')]));_0x3209eb[_0xd5eb('0x3a')]=_0x3209eb[_0xd5eb('0x3a')][_0xd5eb('0x3b')]?_0x3209eb[_0xd5eb('0x3a')]:_0x54f905[_0xd5eb('0x38')];if(!_0x157336['query'][_0xd5eb('0x3c')](_0xd5eb('0x3d'))){_0x3209eb[_0xd5eb('0x1f')]=qs['limit'](_0x157336['query']['limit']);_0x3209eb[_0xd5eb('0x1d')]=qs[_0xd5eb('0x1d')](_0x157336['query'][_0xd5eb('0x1d')]);}_0x3209eb[_0xd5eb('0x3e')]=qs[_0xd5eb('0x3f')](_0x157336['query'][_0xd5eb('0x3f')]);_0x3209eb[_0xd5eb('0x40')]=qs[_0xd5eb('0x36')](_[_0xd5eb('0x41')](_0x157336['query'],_0x54f905[_0xd5eb('0x36')]),_0x2d32ce);if(_0x157336['query'][_0xd5eb('0x42')]){_0x3209eb[_0xd5eb('0x40')]=_[_0xd5eb('0x43')](_0x3209eb[_0xd5eb('0x40')],{'$or':_[_0xd5eb('0x33')](_0x2d32ce,function(_0x36f19e){if(_0x36f19e[_0xd5eb('0x31')]!=='VIRTUAL'){var _0x444a22={};_0x444a22[_0x36f19e[_0xd5eb('0x2c')]]={'$like':'%'+_0x157336['query'][_0xd5eb('0x42')]+'%'};return _0x444a22;}})});}_0x3209eb=_['merge']({},_0x3209eb,_0x157336[_0xd5eb('0x44')]);var _0x53956a={'where':_0x3209eb[_0xd5eb('0x40')]};return db[_0xd5eb('0x2f')]['count'](_0x53956a)[_0xd5eb('0x27')](function(_0x3e3047){_0x5e7553[_0xd5eb('0x20')]=_0x3e3047;if(_0x157336[_0xd5eb('0x34')][_0xd5eb('0x45')]){_0x3209eb['include']=[{'all':!![]}];}return db[_0xd5eb('0x2f')]['findAll'](_0x3209eb);})[_0xd5eb('0x27')](function(_0x59655a){_0x5e7553['rows']=_0x59655a;return _0x5e7553;})[_0xd5eb('0x27')](respondWithFilteredResult(_0x11b947,_0x3209eb))['catch'](handleError(_0x11b947,null));};exports['show']=function(_0x1a83e4,_0x93ad12){var _0x2dabde={'raw':![],'where':{'id':_0x1a83e4['params']['id']}},_0x41fe69={};_0x41fe69[_0xd5eb('0x38')]=_[_0xd5eb('0x35')](db[_0xd5eb('0x2f')][_0xd5eb('0x46')]);_0x41fe69[_0xd5eb('0x34')]=_['keys'](_0x1a83e4[_0xd5eb('0x34')]);_0x41fe69['filters']=_[_0xd5eb('0x37')](_0x41fe69[_0xd5eb('0x38')],_0x41fe69[_0xd5eb('0x34')]);_0x2dabde[_0xd5eb('0x3a')]=_[_0xd5eb('0x37')](_0x41fe69[_0xd5eb('0x38')],qs[_0xd5eb('0x39')](_0x1a83e4['query'][_0xd5eb('0x39')]));_0x2dabde[_0xd5eb('0x3a')]=_0x2dabde[_0xd5eb('0x3a')][_0xd5eb('0x3b')]?_0x2dabde[_0xd5eb('0x3a')]:_0x41fe69[_0xd5eb('0x38')];if(_0x1a83e4[_0xd5eb('0x34')][_0xd5eb('0x45')]){_0x2dabde[_0xd5eb('0x47')]=[{'all':!![]}];}_0x2dabde=_['merge']({},_0x2dabde,_0x1a83e4[_0xd5eb('0x44')]);return db[_0xd5eb('0x2f')][_0xd5eb('0x48')](_0x2dabde)[_0xd5eb('0x27')](handleEntityNotFound(_0x93ad12,null))[_0xd5eb('0x27')](respondWithResult(_0x93ad12,null))[_0xd5eb('0x49')](handleError(_0x93ad12,null));};exports[_0xd5eb('0x4a')]=function(_0xf1f253,_0x563df8){return db['ZohoConfiguration'][_0xd5eb('0x4a')](_0xf1f253[_0xd5eb('0x4b')],{})[_0xd5eb('0x27')](respondWithResult(_0x563df8,0xc9))['catch'](handleError(_0x563df8,null));};exports[_0xd5eb('0x26')]=function(_0x142871,_0x3b161b){if(_0x142871['body']['id']){delete _0x142871[_0xd5eb('0x4b')]['id'];}return db[_0xd5eb('0x2f')][_0xd5eb('0x48')]({'where':{'id':_0x142871[_0xd5eb('0x4c')]['id']}})[_0xd5eb('0x27')](handleEntityNotFound(_0x3b161b,null))[_0xd5eb('0x27')](saveUpdates(_0x142871[_0xd5eb('0x4b')],null))['then'](respondWithResult(_0x3b161b,null))[_0xd5eb('0x49')](handleError(_0x3b161b,null));};exports['destroy']=function(_0x5212d0,_0x508749){return db[_0xd5eb('0x2f')]['find']({'where':{'id':_0x5212d0['params']['id']}})[_0xd5eb('0x27')](handleEntityNotFound(_0x508749,null))[_0xd5eb('0x27')](removeEntity(_0x508749,null))[_0xd5eb('0x49')](handleError(_0x508749,null));};exports[_0xd5eb('0x4d')]=function(_0x32df6c,_0x1254ee,_0xfa865){var _0x5014e3={};var _0x459481={};var _0x46a62e;var _0xb6ea57;return db[_0xd5eb('0x2f')][_0xd5eb('0x4e')]({'where':{'id':_0x32df6c[_0xd5eb('0x4c')]['id']}})[_0xd5eb('0x27')](handleEntityNotFound(_0x1254ee,null))[_0xd5eb('0x27')](function(_0x4e84b9){if(_0x4e84b9){_0x46a62e=_0x4e84b9;_0x459481[_0xd5eb('0x38')]=_[_0xd5eb('0x35')](db[_0xd5eb('0x4f')]['rawAttributes']);_0x459481[_0xd5eb('0x34')]=_[_0xd5eb('0x35')](_0x32df6c[_0xd5eb('0x34')]);_0x459481[_0xd5eb('0x36')]=_['intersection'](_0x459481[_0xd5eb('0x38')],_0x459481[_0xd5eb('0x34')]);_0x5014e3[_0xd5eb('0x3a')]=_['intersection'](_0x459481[_0xd5eb('0x38')],qs['fields'](_0x32df6c[_0xd5eb('0x34')][_0xd5eb('0x39')]));_0x5014e3[_0xd5eb('0x3a')]=_0x5014e3[_0xd5eb('0x3a')][_0xd5eb('0x3b')]?_0x5014e3['attributes']:_0x459481[_0xd5eb('0x38')];_0x5014e3[_0xd5eb('0x3e')]=qs[_0xd5eb('0x3f')](_0x32df6c[_0xd5eb('0x34')][_0xd5eb('0x3f')]);_0x5014e3[_0xd5eb('0x40')]=qs[_0xd5eb('0x36')](_[_0xd5eb('0x41')](_0x32df6c['query'],_0x459481[_0xd5eb('0x36')]));if(_0x32df6c[_0xd5eb('0x34')]['filter']){_0x5014e3[_0xd5eb('0x40')]=_[_0xd5eb('0x43')](_0x5014e3['where'],{'$or':_[_0xd5eb('0x33')](_0x5014e3[_0xd5eb('0x3a')],function(_0xeb0a03){var _0x1e661d={};_0x1e661d[_0xeb0a03]={'$like':'%'+_0x32df6c['query'][_0xd5eb('0x42')]+'%'};return _0x1e661d;})});}_0x5014e3=_[_0xd5eb('0x43')]({},_0x5014e3,_0x32df6c[_0xd5eb('0x44')]);return _0x46a62e[_0xd5eb('0x4d')](_0x5014e3);}})[_0xd5eb('0x27')](function(_0x37fdfa){if(_0x37fdfa){_0xb6ea57=_0x37fdfa[_0xd5eb('0x3b')];if(!_0x32df6c['query'][_0xd5eb('0x3c')](_0xd5eb('0x3d'))){_0x5014e3[_0xd5eb('0x1f')]=qs['limit'](_0x32df6c[_0xd5eb('0x34')][_0xd5eb('0x1f')]);_0x5014e3['offset']=qs['offset'](_0x32df6c[_0xd5eb('0x34')]['offset']);}return _0x46a62e[_0xd5eb('0x4d')](_0x5014e3);}})[_0xd5eb('0x27')](function(_0x25780f){if(_0x25780f){return _0x25780f?{'count':_0xb6ea57,'rows':_0x25780f}:null;}})[_0xd5eb('0x27')](respondWithResult(_0x1254ee,null))['catch'](handleError(_0x1254ee,null));};exports[_0xd5eb('0x50')]=function(_0x2be890,_0x481176,_0x71b013){var _0x473d5c={};var _0x54ff44={};var _0x2e6355;var _0x1b7771;return db['ZohoConfiguration'][_0xd5eb('0x4e')]({'where':{'id':_0x2be890['params']['id']}})[_0xd5eb('0x27')](handleEntityNotFound(_0x481176,null))[_0xd5eb('0x27')](function(_0x23bfe9){if(_0x23bfe9){_0x2e6355=_0x23bfe9;_0x54ff44['model']=_[_0xd5eb('0x35')](db['ZohoField'][_0xd5eb('0x46')]);_0x54ff44[_0xd5eb('0x34')]=_[_0xd5eb('0x35')](_0x2be890[_0xd5eb('0x34')]);_0x54ff44[_0xd5eb('0x36')]=_['intersection'](_0x54ff44[_0xd5eb('0x38')],_0x54ff44[_0xd5eb('0x34')]);_0x473d5c[_0xd5eb('0x3a')]=_['intersection'](_0x54ff44[_0xd5eb('0x38')],qs[_0xd5eb('0x39')](_0x2be890[_0xd5eb('0x34')][_0xd5eb('0x39')]));_0x473d5c['attributes']=_0x473d5c[_0xd5eb('0x3a')]['length']?_0x473d5c[_0xd5eb('0x3a')]:_0x54ff44[_0xd5eb('0x38')];_0x473d5c[_0xd5eb('0x3e')]=qs[_0xd5eb('0x3f')](_0x2be890[_0xd5eb('0x34')][_0xd5eb('0x3f')]);_0x473d5c[_0xd5eb('0x40')]=qs[_0xd5eb('0x36')](_[_0xd5eb('0x41')](_0x2be890[_0xd5eb('0x34')],_0x54ff44['filters']));if(_0x2be890[_0xd5eb('0x34')]['filter']){_0x473d5c['where']=_['merge'](_0x473d5c[_0xd5eb('0x40')],{'$or':_[_0xd5eb('0x33')](_0x473d5c[_0xd5eb('0x3a')],function(_0x2089e7){var _0x10da1c={};_0x10da1c[_0x2089e7]={'$like':'%'+_0x2be890[_0xd5eb('0x34')][_0xd5eb('0x42')]+'%'};return _0x10da1c;})});}_0x473d5c=_['merge']({},_0x473d5c,_0x2be890['options']);return _0x2e6355['getSubjects'](_0x473d5c);}})[_0xd5eb('0x27')](function(_0x50de6f){if(_0x50de6f){_0x1b7771=_0x50de6f['length'];if(!_0x2be890[_0xd5eb('0x34')][_0xd5eb('0x3c')](_0xd5eb('0x3d'))){_0x473d5c[_0xd5eb('0x1f')]=qs[_0xd5eb('0x1f')](_0x2be890[_0xd5eb('0x34')][_0xd5eb('0x1f')]);_0x473d5c[_0xd5eb('0x1d')]=qs['offset'](_0x2be890['query'][_0xd5eb('0x1d')]);}return _0x2e6355['getSubjects'](_0x473d5c);}})[_0xd5eb('0x27')](function(_0x5b4303){if(_0x5b4303){return _0x5b4303?{'count':_0x1b7771,'rows':_0x5b4303}:null;}})[_0xd5eb('0x27')](respondWithResult(_0x481176,null))[_0xd5eb('0x49')](handleError(_0x481176,null));};exports[_0xd5eb('0x51')]=function(_0x26dc8f,_0x24eb07,_0x86ae0d){var _0xe2d0f4={};var _0x39de38={};var _0x17edc7;var _0x374fa9;return db[_0xd5eb('0x2f')]['findOne']({'where':{'id':_0x26dc8f[_0xd5eb('0x4c')]['id']}})[_0xd5eb('0x27')](handleEntityNotFound(_0x24eb07,null))[_0xd5eb('0x27')](function(_0x3bc969){if(_0x3bc969){_0x17edc7=_0x3bc969;_0x39de38[_0xd5eb('0x38')]=_[_0xd5eb('0x35')](db[_0xd5eb('0x4f')][_0xd5eb('0x46')]);_0x39de38[_0xd5eb('0x34')]=_['keys'](_0x26dc8f[_0xd5eb('0x34')]);_0x39de38[_0xd5eb('0x36')]=_[_0xd5eb('0x37')](_0x39de38['model'],_0x39de38[_0xd5eb('0x34')]);_0xe2d0f4[_0xd5eb('0x3a')]=_[_0xd5eb('0x37')](_0x39de38['model'],qs[_0xd5eb('0x39')](_0x26dc8f[_0xd5eb('0x34')][_0xd5eb('0x39')]));_0xe2d0f4[_0xd5eb('0x3a')]=_0xe2d0f4[_0xd5eb('0x3a')][_0xd5eb('0x3b')]?_0xe2d0f4[_0xd5eb('0x3a')]:_0x39de38['model'];_0xe2d0f4[_0xd5eb('0x3e')]=qs[_0xd5eb('0x3f')](_0x26dc8f['query'][_0xd5eb('0x3f')]);_0xe2d0f4[_0xd5eb('0x40')]=qs[_0xd5eb('0x36')](_['pick'](_0x26dc8f['query'],_0x39de38[_0xd5eb('0x36')]));if(_0x26dc8f[_0xd5eb('0x34')][_0xd5eb('0x42')]){_0xe2d0f4[_0xd5eb('0x40')]=_[_0xd5eb('0x43')](_0xe2d0f4[_0xd5eb('0x40')],{'$or':_['map'](_0xe2d0f4[_0xd5eb('0x3a')],function(_0x4df029){var _0x1b2000={};_0x1b2000[_0x4df029]={'$like':'%'+_0x26dc8f[_0xd5eb('0x34')][_0xd5eb('0x42')]+'%'};return _0x1b2000;})});}_0xe2d0f4=_[_0xd5eb('0x43')]({},_0xe2d0f4,_0x26dc8f[_0xd5eb('0x44')]);return _0x17edc7[_0xd5eb('0x51')](_0xe2d0f4);}})[_0xd5eb('0x27')](function(_0x2b8be7){if(_0x2b8be7){_0x374fa9=_0x2b8be7['length'];if(!_0x26dc8f['query']['hasOwnProperty'](_0xd5eb('0x3d'))){_0xe2d0f4['limit']=qs[_0xd5eb('0x1f')](_0x26dc8f[_0xd5eb('0x34')][_0xd5eb('0x1f')]);_0xe2d0f4[_0xd5eb('0x1d')]=qs[_0xd5eb('0x1d')](_0x26dc8f['query'][_0xd5eb('0x1d')]);}return _0x17edc7[_0xd5eb('0x51')](_0xe2d0f4);}})['then'](function(_0x4b9a35){if(_0x4b9a35){return _0x4b9a35?{'count':_0x374fa9,'rows':_0x4b9a35}:null;}})[_0xd5eb('0x27')](respondWithResult(_0x24eb07,null))[_0xd5eb('0x49')](handleError(_0x24eb07,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 1f73fd4..06be61e 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 _0xc53e=['moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','api'];(function(_0x3a1f15,_0x227cb9){var _0x5c5a40=function(_0x1eecd0){while(--_0x1eecd0){_0x3a1f15['push'](_0x3a1f15['shift']());}};_0x5c5a40(++_0x227cb9);}(_0xc53e,0xa5));var _0xec53=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc53e[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xec53('0x0'));var util=require(_0xec53('0x1'));var logger=require('../../config/logger')(_0xec53('0x2'));var moment=require(_0xec53('0x3'));var BPromise=require(_0xec53('0x4'));var rp=require(_0xec53('0x5'));var fs=require('fs');var path=require(_0xec53('0x6'));var rimraf=require('rimraf');var config=require(_0xec53('0x7'));var attributes=require(_0xec53('0x8'));module[_0xec53('0x9')]=function(_0x2bc97c,_0x1bd880){return _0x2bc97c['define'](_0xec53('0xa'),attributes,{'tableName':_0xec53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eb7=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','util','api','moment'];(function(_0x8e970c,_0x107a20){var _0x2b2a26=function(_0x40a61e){while(--_0x40a61e){_0x8e970c['push'](_0x8e970c['shift']());}};_0x2b2a26(++_0x107a20);}(_0x8eb7,0x1b8));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(_0x78eb('0x3'));var BPromise=require(_0x78eb('0x4'));var rp=require(_0x78eb('0x5'));var fs=require('fs');var path=require(_0x78eb('0x6'));var rimraf=require(_0x78eb('0x7'));var config=require(_0x78eb('0x8'));var attributes=require(_0x78eb('0x9'));module['exports']=function(_0x2d79c4,_0x3e54c4){return _0x2d79c4[_0x78eb('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x78eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index e5860eb..8b1388c 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 _0xb600=['request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3de9f3,_0x4d17c2){var _0x3aa413=function(_0x1fb4d7){while(--_0x1fb4d7){_0x3de9f3['push'](_0x3de9f3['shift']());}};_0x3aa413(++_0x4d17c2);}(_0xb600,0x7e));var _0x0b60=function(_0xef8337,_0xa3b04a){_0xef8337=_0xef8337-0x0;var _0x278454=_0xb600[_0xef8337];return _0x278454;};'use strict';var _=require(_0x0b60('0x0'));var util=require('util');var moment=require(_0x0b60('0x1'));var BPromise=require('bluebird');var rs=require(_0x0b60('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b60('0x3'));var logger=require(_0x0b60('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0b60('0x5'));var client=jayson[_0x0b60('0x6')][_0x0b60('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18a68f,_0x3e3f65,_0x47a95c){return new BPromise(function(_0x3b5183,_0x37f8){return client[_0x0b60('0x8')](_0x18a68f,_0x47a95c)[_0x0b60('0x9')](function(_0x427bbb){logger[_0x0b60('0xa')](_0x0b60('0xb'),_0x3e3f65,'request\x20sent');logger[_0x0b60('0xc')](_0x0b60('0xd'),_0x3e3f65,_0x0b60('0xe'),JSON[_0x0b60('0xf')](_0x427bbb));if(_0x427bbb[_0x0b60('0x10')]){if(_0x427bbb[_0x0b60('0x10')][_0x0b60('0x11')]===0x1f4){logger[_0x0b60('0x10')](_0x0b60('0xb'),_0x3e3f65,_0x427bbb[_0x0b60('0x10')]['message']);return _0x37f8(_0x427bbb[_0x0b60('0x10')][_0x0b60('0x12')]);}logger[_0x0b60('0x10')](_0x0b60('0xb'),_0x3e3f65,_0x427bbb[_0x0b60('0x10')]['message']);return _0x3b5183(_0x427bbb[_0x0b60('0x10')][_0x0b60('0x12')]);}else{logger[_0x0b60('0xa')](_0x0b60('0xb'),_0x3e3f65,_0x0b60('0xe'));_0x3b5183(_0x427bbb[_0x0b60('0x13')][_0x0b60('0x12')]);}})['catch'](function(_0x4aa7b0){logger[_0x0b60('0x10')](_0x0b60('0xb'),_0x3e3f65,_0x4aa7b0);_0x37f8(_0x4aa7b0);});});} \ No newline at end of file +var _0xcc05=['error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x297741,_0x21136a){var _0x62dd73=function(_0x2f4e73){while(--_0x2f4e73){_0x297741['push'](_0x297741['shift']());}};_0x62dd73(++_0x21136a);}(_0xcc05,0x180));var _0x5cc0=function(_0x492c4e,_0xae9e96){_0x492c4e=_0x492c4e-0x0;var _0x1d1ade=_0xcc05[_0x492c4e];return _0x1d1ade;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5cc0('0x0'));var BPromise=require(_0x5cc0('0x1'));var rs=require(_0x5cc0('0x2'));var fs=require('fs');var Redis=require(_0x5cc0('0x3'));var db=require(_0x5cc0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cc0('0x5'))(_0x5cc0('0x6'));var config=require(_0x5cc0('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3cf2,_0x3f0665,_0x14a5fe){return new BPromise(function(_0x5519fd,_0x1b0abf){return client[_0x5cc0('0x8')](_0x3e3cf2,_0x14a5fe)[_0x5cc0('0x9')](function(_0x2359a2){logger[_0x5cc0('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x5cc0('0xb'));logger[_0x5cc0('0xc')](_0x5cc0('0xd'),_0x3f0665,_0x5cc0('0xb'),JSON[_0x5cc0('0xe')](_0x2359a2));if(_0x2359a2['error']){if(_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x10')]===0x1f4){logger[_0x5cc0('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x11')]);return _0x1b0abf(_0x2359a2[_0x5cc0('0xf')]['message']);}logger['error'](_0x5cc0('0x12'),_0x3f0665,_0x2359a2[_0x5cc0('0xf')][_0x5cc0('0x11')]);return _0x5519fd(_0x2359a2['error']['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0665,_0x5cc0('0xb'));_0x5519fd(_0x2359a2[_0x5cc0('0x13')][_0x5cc0('0x11')]);}})[_0x5cc0('0x14')](function(_0x307f97){logger[_0x5cc0('0xf')](_0x5cc0('0x12'),_0x3f0665,_0x307f97);_0x1b0abf(_0x307f97);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 76639ab..c29cac2 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 _0x9fde=['path','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','update','destroy','exports','multer','util'];(function(_0x11e49b,_0x5a77f0){var _0x51f776=function(_0xb677ff){while(--_0xb677ff){_0x11e49b['push'](_0x11e49b['shift']());}};_0x51f776(++_0x5a77f0);}(_0x9fde,0x116));var _0xe9fd=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x9fde[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0xe9fd('0x0'));var util=require(_0xe9fd('0x1'));var path=require(_0xe9fd('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9fd('0x3'));var router=express['Router']();var fs_extra=require(_0xe9fd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9fd('0x5'));var controller=require('./intZohoField.controller');router[_0xe9fd('0x6')]('/',auth[_0xe9fd('0x7')](),controller[_0xe9fd('0x8')]);router['get'](_0xe9fd('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe9fd('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe9fd('0x9'),auth[_0xe9fd('0x7')](),controller[_0xe9fd('0xb')]);router['delete'](_0xe9fd('0x9'),auth['isAuthenticated'](),controller[_0xe9fd('0xc')]);module[_0xe9fd('0xd')]=router; \ No newline at end of file +var _0x0cd6=['/:id','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','show','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0cd6,0x113));var _0x60cd=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x0cd6[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var path=require('path');var timeout=require(_0x60cd('0x2'));var express=require(_0x60cd('0x3'));var router=express['Router']();var fs_extra=require(_0x60cd('0x4'));var auth=require(_0x60cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60cd('0x6'));router[_0x60cd('0x7')]('/',auth[_0x60cd('0x8')](),controller['index']);router[_0x60cd('0x7')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x9')]);router[_0x60cd('0xa')]('/',auth[_0x60cd('0x8')](),controller[_0x60cd('0xb')]);router[_0x60cd('0xc')](_0x60cd('0xd'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xe')]);router['delete'](_0x60cd('0xd'),auth[_0x60cd('0x8')](),controller['destroy']);module[_0x60cd('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index e430f37..b764533 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 _0x3b04=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3b04,0x1a8));var _0x43b0=function(_0x56cf52,_0x57758a){_0x56cf52=_0x56cf52-0x0;var _0x186ef1=_0x3b04[_0x56cf52];return _0x186ef1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x43b0('0x0')](_0x43b0('0x1'),_0x43b0('0x2'),_0x43b0('0x3'),_0x43b0('0x4'),_0x43b0('0x5')),'defaultValue':_0x43b0('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x43b0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x43b0('0x1'),_0x43b0('0x2'),_0x43b0('0x3'))},'keyContent':{'type':Sequelize[_0x43b0('0x6')]},'idField':{'type':Sequelize[_0x43b0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x43b0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43b0('0x6')]}}; \ No newline at end of file +var _0x8375=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5b360e,_0x494136){var _0x1bf752=function(_0x6df32e){while(--_0x6df32e){_0x5b360e['push'](_0x5b360e['shift']());}};_0x1bf752(++_0x494136);}(_0x8375,0x177));var _0x5837=function(_0x429c02,_0x6dad05){_0x429c02=_0x429c02-0x0;var _0x2e7e07=_0x8375[_0x429c02];return _0x2e7e07;};'use strict';var Sequelize=require(_0x5837('0x0'));module[_0x5837('0x1')]={'type':{'type':Sequelize[_0x5837('0x2')](_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5'),_0x5837('0x6'),'picklist'),'defaultValue':_0x5837('0x3')},'content':{'type':Sequelize[_0x5837('0x7')]},'key':{'type':Sequelize[_0x5837('0x7')]},'keyType':{'type':Sequelize[_0x5837('0x2')](_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5837('0x7')]},'nameField':{'type':Sequelize[_0x5837('0x7')]},'customField':{'type':Sequelize[_0x5837('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3c080f1..71b35c3 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 _0x1c5e=['offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x1c5e,0xc0));var _0xe1c5=function(_0x5d23be,_0x3b4f3c){_0x5d23be=_0x5d23be-0x0;var _0x4d60a9=_0x1c5e[_0x5d23be];return _0x4d60a9;};'use strict';var emlformat=require(_0xe1c5('0x0'));var rimraf=require(_0xe1c5('0x1'));var zipdir=require(_0xe1c5('0x2'));var jsonpatch=require(_0xe1c5('0x3'));var rp=require(_0xe1c5('0x4'));var moment=require(_0xe1c5('0x5'));var BPromise=require(_0xe1c5('0x6'));var Mustache=require(_0xe1c5('0x7'));var util=require(_0xe1c5('0x8'));var path=require(_0xe1c5('0x9'));var sox=require(_0xe1c5('0xa'));var csv=require('to-csv');var ejs=require(_0xe1c5('0xb'));var fs=require('fs');var fs_extra=require(_0xe1c5('0xc'));var _=require('lodash');var squel=require(_0xe1c5('0xd'));var crypto=require(_0xe1c5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe1c5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe1c5('0x10'));var Papa=require(_0xe1c5('0x11'));var Redis=require(_0xe1c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe1c5('0x13'));var as=require(_0xe1c5('0x14'));var hardwareService=require(_0xe1c5('0x15'));var logger=require(_0xe1c5('0x16'))('api');var utils=require(_0xe1c5('0x17'));var config=require(_0xe1c5('0x18'));var licenseUtil=require(_0xe1c5('0x19'));var db=require(_0xe1c5('0x1a'))['db'];function respondWithStatusCode(_0x1a7c81,_0x4a0097){_0x4a0097=_0x4a0097||0xcc;return function(_0x4c9c09){if(_0x4c9c09){return _0x1a7c81[_0xe1c5('0x1b')](_0x4a0097);}return _0x1a7c81[_0xe1c5('0x1c')](_0x4a0097)['end']();};}function respondWithResult(_0x2538b6,_0x547d50){_0x547d50=_0x547d50||0xc8;return function(_0x5c0659){if(_0x5c0659){return _0x2538b6[_0xe1c5('0x1c')](_0x547d50)[_0xe1c5('0x1d')](_0x5c0659);}};}function respondWithFilteredResult(_0x8370ec,_0x29515c){return function(_0xe1fbe6){if(_0xe1fbe6){var _0x26b357=typeof _0x29515c[_0xe1c5('0x1e')]===_0xe1c5('0x1f')&&typeof _0x29515c[_0xe1c5('0x20')]==='undefined';var _0x125065=_0xe1fbe6[_0xe1c5('0x21')];var _0x150268=_0x26b357?0x0:_0x29515c['offset'];var _0x37ade0=_0x26b357?_0xe1fbe6[_0xe1c5('0x21')]:_0x29515c[_0xe1c5('0x1e')]+_0x29515c[_0xe1c5('0x20')];var _0x5f50df;if(_0x37ade0>=_0x125065){_0x37ade0=_0x125065;_0x5f50df=0xc8;}else{_0x5f50df=0xce;}_0x8370ec[_0xe1c5('0x1c')](_0x5f50df);return _0x8370ec[_0xe1c5('0x22')](_0xe1c5('0x23'),_0x150268+'-'+_0x37ade0+'/'+_0x125065)[_0xe1c5('0x1d')](_0xe1fbe6);}return null;};}function patchUpdates(_0xa9ae01){return function(_0x4062f6){try{jsonpatch['apply'](_0x4062f6,_0xa9ae01,!![]);}catch(_0x5c7869){return BPromise['reject'](_0x5c7869);}return _0x4062f6[_0xe1c5('0x24')]();};}function saveUpdates(_0x53be8c,_0x2d017f){return function(_0x1e93cc){if(_0x1e93cc){return _0x1e93cc[_0xe1c5('0x25')](_0x53be8c)[_0xe1c5('0x26')](function(_0x1d5ebe){return _0x1d5ebe;});}return null;};}function removeEntity(_0x5f23a9,_0x285ec9){return function(_0x4d89dc){if(_0x4d89dc){return _0x4d89dc[_0xe1c5('0x27')]()[_0xe1c5('0x26')](function(){_0x5f23a9['status'](0xcc)[_0xe1c5('0x28')]();});}};}function handleEntityNotFound(_0x4a10bc,_0x2b19c3){return function(_0x236d4c){if(!_0x236d4c){_0x4a10bc[_0xe1c5('0x1b')](0x194);}return _0x236d4c;};}function handleError(_0x15f430,_0x2f3148){_0x2f3148=_0x2f3148||0x1f4;return function(_0x5a0082){logger[_0xe1c5('0x29')](_0x5a0082[_0xe1c5('0x2a')]);if(_0x5a0082['name']){delete _0x5a0082[_0xe1c5('0x2b')];}_0x15f430[_0xe1c5('0x1c')](_0x2f3148)[_0xe1c5('0x2c')](_0x5a0082);};}exports['index']=function(_0x45da65,_0x2574f9){var _0x4d81b2={},_0x2266f5={},_0x15ba3d={'count':0x0,'rows':[]};var _0x22afb1=_[_0xe1c5('0x2d')](db[_0xe1c5('0x2e')][_0xe1c5('0x2f')],function(_0x3d3f2d){return{'name':_0x3d3f2d[_0xe1c5('0x30')],'type':_0x3d3f2d['type'][_0xe1c5('0x31')]};});_0x2266f5[_0xe1c5('0x32')]=_[_0xe1c5('0x2d')](_0x22afb1,_0xe1c5('0x2b'));_0x2266f5[_0xe1c5('0x33')]=_[_0xe1c5('0x34')](_0x45da65['query']);_0x2266f5['filters']=_[_0xe1c5('0x35')](_0x2266f5[_0xe1c5('0x32')],_0x2266f5[_0xe1c5('0x33')]);_0x4d81b2[_0xe1c5('0x36')]=_[_0xe1c5('0x35')](_0x2266f5['model'],qs['fields'](_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x37')]));_0x4d81b2[_0xe1c5('0x36')]=_0x4d81b2[_0xe1c5('0x36')]['length']?_0x4d81b2['attributes']:_0x2266f5[_0xe1c5('0x32')];if(!_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x38')](_0xe1c5('0x39'))){_0x4d81b2[_0xe1c5('0x20')]=qs[_0xe1c5('0x20')](_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x20')]);_0x4d81b2['offset']=qs[_0xe1c5('0x1e')](_0x45da65['query'][_0xe1c5('0x1e')]);}_0x4d81b2[_0xe1c5('0x3a')]=qs[_0xe1c5('0x3b')](_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x3b')]);_0x4d81b2['where']=qs['filters'](_['pick'](_0x45da65['query'],_0x2266f5['filters']),_0x22afb1);if(_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x3c')]){_0x4d81b2[_0xe1c5('0x3d')]=_['merge'](_0x4d81b2[_0xe1c5('0x3d')],{'$or':_[_0xe1c5('0x2d')](_0x22afb1,function(_0x1776de){if(_0x1776de[_0xe1c5('0x3e')]!==_0xe1c5('0x3f')){var _0x33d75b={};_0x33d75b[_0x1776de[_0xe1c5('0x2b')]]={'$like':'%'+_0x45da65[_0xe1c5('0x33')][_0xe1c5('0x3c')]+'%'};return _0x33d75b;}})});}_0x4d81b2=_[_0xe1c5('0x40')]({},_0x4d81b2,_0x45da65[_0xe1c5('0x41')]);var _0x229bfd={'where':_0x4d81b2['where']};return db[_0xe1c5('0x2e')][_0xe1c5('0x21')](_0x229bfd)[_0xe1c5('0x26')](function(_0xf457a0){_0x15ba3d['count']=_0xf457a0;if(_0x45da65['query'][_0xe1c5('0x42')]){_0x4d81b2[_0xe1c5('0x43')]=[{'all':!![]}];}return db[_0xe1c5('0x2e')][_0xe1c5('0x44')](_0x4d81b2);})[_0xe1c5('0x26')](function(_0x5466bc){_0x15ba3d['rows']=_0x5466bc;return _0x15ba3d;})[_0xe1c5('0x26')](respondWithFilteredResult(_0x2574f9,_0x4d81b2))['catch'](handleError(_0x2574f9,null));};exports['show']=function(_0x1d4d8f,_0x50f82d){var _0x231886={'raw':!![],'where':{'id':_0x1d4d8f[_0xe1c5('0x45')]['id']}},_0x27e4b6={};_0x27e4b6[_0xe1c5('0x32')]=_['keys'](db[_0xe1c5('0x2e')][_0xe1c5('0x2f')]);_0x27e4b6['query']=_[_0xe1c5('0x34')](_0x1d4d8f[_0xe1c5('0x33')]);_0x27e4b6['filters']=_[_0xe1c5('0x35')](_0x27e4b6['model'],_0x27e4b6[_0xe1c5('0x33')]);_0x231886[_0xe1c5('0x36')]=_['intersection'](_0x27e4b6[_0xe1c5('0x32')],qs[_0xe1c5('0x37')](_0x1d4d8f['query'][_0xe1c5('0x37')]));_0x231886[_0xe1c5('0x36')]=_0x231886['attributes']['length']?_0x231886[_0xe1c5('0x36')]:_0x27e4b6[_0xe1c5('0x32')];if(_0x1d4d8f['query'][_0xe1c5('0x42')]){_0x231886['include']=[{'all':!![]}];}_0x231886=_[_0xe1c5('0x40')]({},_0x231886,_0x1d4d8f[_0xe1c5('0x41')]);return db[_0xe1c5('0x2e')]['find'](_0x231886)[_0xe1c5('0x26')](handleEntityNotFound(_0x50f82d,null))[_0xe1c5('0x26')](respondWithResult(_0x50f82d,null))[_0xe1c5('0x46')](handleError(_0x50f82d,null));};exports[_0xe1c5('0x47')]=function(_0x38f606,_0x1c77c0){return db[_0xe1c5('0x2e')][_0xe1c5('0x47')](_0x38f606[_0xe1c5('0x48')],{})[_0xe1c5('0x26')](respondWithResult(_0x1c77c0,0xc9))['catch'](handleError(_0x1c77c0,null));};exports[_0xe1c5('0x25')]=function(_0x553fdf,_0x470dd2){if(_0x553fdf[_0xe1c5('0x48')]['id']){delete _0x553fdf[_0xe1c5('0x48')]['id'];}return db[_0xe1c5('0x2e')][_0xe1c5('0x49')]({'where':{'id':_0x553fdf[_0xe1c5('0x45')]['id']}})[_0xe1c5('0x26')](handleEntityNotFound(_0x470dd2,null))['then'](saveUpdates(_0x553fdf[_0xe1c5('0x48')],null))[_0xe1c5('0x26')](respondWithResult(_0x470dd2,null))['catch'](handleError(_0x470dd2,null));};exports[_0xe1c5('0x27')]=function(_0x202931,_0x656bd5){return db[_0xe1c5('0x2e')]['find']({'where':{'id':_0x202931['params']['id']}})['then'](handleEntityNotFound(_0x656bd5,null))['then'](removeEntity(_0x656bd5,null))[_0xe1c5('0x46')](handleError(_0x656bd5,null));}; \ No newline at end of file +var _0xf751=['include','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','stack','name','send','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ZohoField','includeAll'];(function(_0x2f0f25,_0x590000){var _0x13e516=function(_0x593906){while(--_0x593906){_0x2f0f25['push'](_0x2f0f25['shift']());}};_0x13e516(++_0x590000);}(_0xf751,0x132));var _0x1f75=function(_0xc96208,_0x25e62c){_0xc96208=_0xc96208-0x0;var _0x21da50=_0xf751[_0xc96208];return _0x21da50;};'use strict';var emlformat=require(_0x1f75('0x0'));var rimraf=require(_0x1f75('0x1'));var zipdir=require(_0x1f75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f75('0x3'));var moment=require(_0x1f75('0x4'));var BPromise=require(_0x1f75('0x5'));var Mustache=require(_0x1f75('0x6'));var util=require('util');var path=require(_0x1f75('0x7'));var sox=require(_0x1f75('0x8'));var csv=require('to-csv');var ejs=require(_0x1f75('0x9'));var fs=require('fs');var fs_extra=require(_0x1f75('0xa'));var _=require(_0x1f75('0xb'));var squel=require(_0x1f75('0xc'));var crypto=require(_0x1f75('0xd'));var jsforce=require(_0x1f75('0xe'));var deskjs=require(_0x1f75('0xf'));var toCsv=require(_0x1f75('0x10'));var querystring=require(_0x1f75('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f75('0x12'));var authService=require(_0x1f75('0x13'));var qs=require(_0x1f75('0x14'));var as=require(_0x1f75('0x15'));var hardwareService=require(_0x1f75('0x16'));var logger=require(_0x1f75('0x17'))(_0x1f75('0x18'));var utils=require(_0x1f75('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1f75('0x1a'));var db=require(_0x1f75('0x1b'))['db'];function respondWithStatusCode(_0xfc0ea9,_0x5582da){_0x5582da=_0x5582da||0xcc;return function(_0x325c19){if(_0x325c19){return _0xfc0ea9[_0x1f75('0x1c')](_0x5582da);}return _0xfc0ea9[_0x1f75('0x1d')](_0x5582da)['end']();};}function respondWithResult(_0x3b75b9,_0x586842){_0x586842=_0x586842||0xc8;return function(_0x46e8af){if(_0x46e8af){return _0x3b75b9[_0x1f75('0x1d')](_0x586842)[_0x1f75('0x1e')](_0x46e8af);}};}function respondWithFilteredResult(_0x4286f1,_0x52886f){return function(_0x4c8a20){if(_0x4c8a20){var _0x2db0d9=typeof _0x52886f[_0x1f75('0x1f')]===_0x1f75('0x20')&&typeof _0x52886f['limit']===_0x1f75('0x20');var _0x494522=_0x4c8a20[_0x1f75('0x21')];var _0x3b3c03=_0x2db0d9?0x0:_0x52886f['offset'];var _0x25f3a9=_0x2db0d9?_0x4c8a20['count']:_0x52886f[_0x1f75('0x1f')]+_0x52886f[_0x1f75('0x22')];var _0x4fc6dd;if(_0x25f3a9>=_0x494522){_0x25f3a9=_0x494522;_0x4fc6dd=0xc8;}else{_0x4fc6dd=0xce;}_0x4286f1[_0x1f75('0x1d')](_0x4fc6dd);return _0x4286f1[_0x1f75('0x23')]('Content-Range',_0x3b3c03+'-'+_0x25f3a9+'/'+_0x494522)[_0x1f75('0x1e')](_0x4c8a20);}return null;};}function patchUpdates(_0x5119ba){return function(_0x5d871d){try{jsonpatch[_0x1f75('0x24')](_0x5d871d,_0x5119ba,!![]);}catch(_0x2ccdf0){return BPromise['reject'](_0x2ccdf0);}return _0x5d871d[_0x1f75('0x25')]();};}function saveUpdates(_0x512645,_0x4e3892){return function(_0xa57176){if(_0xa57176){return _0xa57176[_0x1f75('0x26')](_0x512645)[_0x1f75('0x27')](function(_0x4bb299){return _0x4bb299;});}return null;};}function removeEntity(_0x355f1a,_0x46b746){return function(_0x55db55){if(_0x55db55){return _0x55db55[_0x1f75('0x28')]()[_0x1f75('0x27')](function(){_0x355f1a[_0x1f75('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44eda3,_0x22e5fb){return function(_0x1ed9ee){if(!_0x1ed9ee){_0x44eda3[_0x1f75('0x1c')](0x194);}return _0x1ed9ee;};}function handleError(_0x131290,_0x569102){_0x569102=_0x569102||0x1f4;return function(_0x541e7f){logger['error'](_0x541e7f[_0x1f75('0x29')]);if(_0x541e7f[_0x1f75('0x2a')]){delete _0x541e7f[_0x1f75('0x2a')];}_0x131290[_0x1f75('0x1d')](_0x569102)[_0x1f75('0x2b')](_0x541e7f);};}exports['index']=function(_0x3253cd,_0x4f1192){var _0x14011f={},_0x2dccdd={},_0x183d00={'count':0x0,'rows':[]};var _0x3e791b=_[_0x1f75('0x2c')](db['ZohoField']['rawAttributes'],function(_0x596f8f){return{'name':_0x596f8f[_0x1f75('0x2d')],'type':_0x596f8f[_0x1f75('0x2e')]['key']};});_0x2dccdd['model']=_[_0x1f75('0x2c')](_0x3e791b,_0x1f75('0x2a'));_0x2dccdd[_0x1f75('0x2f')]=_['keys'](_0x3253cd[_0x1f75('0x2f')]);_0x2dccdd[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x2dccdd[_0x1f75('0x32')],_0x2dccdd[_0x1f75('0x2f')]);_0x14011f[_0x1f75('0x33')]=_[_0x1f75('0x31')](_0x2dccdd[_0x1f75('0x32')],qs[_0x1f75('0x34')](_0x3253cd['query'][_0x1f75('0x34')]));_0x14011f[_0x1f75('0x33')]=_0x14011f[_0x1f75('0x33')][_0x1f75('0x35')]?_0x14011f['attributes']:_0x2dccdd[_0x1f75('0x32')];if(!_0x3253cd[_0x1f75('0x2f')][_0x1f75('0x36')](_0x1f75('0x37'))){_0x14011f[_0x1f75('0x22')]=qs[_0x1f75('0x22')](_0x3253cd[_0x1f75('0x2f')][_0x1f75('0x22')]);_0x14011f[_0x1f75('0x1f')]=qs[_0x1f75('0x1f')](_0x3253cd[_0x1f75('0x2f')][_0x1f75('0x1f')]);}_0x14011f['order']=qs[_0x1f75('0x38')](_0x3253cd[_0x1f75('0x2f')]['sort']);_0x14011f[_0x1f75('0x39')]=qs['filters'](_[_0x1f75('0x3a')](_0x3253cd[_0x1f75('0x2f')],_0x2dccdd[_0x1f75('0x30')]),_0x3e791b);if(_0x3253cd['query'][_0x1f75('0x3b')]){_0x14011f[_0x1f75('0x39')]=_[_0x1f75('0x3c')](_0x14011f[_0x1f75('0x39')],{'$or':_[_0x1f75('0x2c')](_0x3e791b,function(_0x51f17f){if(_0x51f17f[_0x1f75('0x2e')]!==_0x1f75('0x3d')){var _0xd0e58a={};_0xd0e58a[_0x51f17f[_0x1f75('0x2a')]]={'$like':'%'+_0x3253cd[_0x1f75('0x2f')][_0x1f75('0x3b')]+'%'};return _0xd0e58a;}})});}_0x14011f=_['merge']({},_0x14011f,_0x3253cd['options']);var _0x5b1c52={'where':_0x14011f[_0x1f75('0x39')]};return db[_0x1f75('0x3e')][_0x1f75('0x21')](_0x5b1c52)[_0x1f75('0x27')](function(_0x42b3cd){_0x183d00['count']=_0x42b3cd;if(_0x3253cd[_0x1f75('0x2f')][_0x1f75('0x3f')]){_0x14011f[_0x1f75('0x40')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x14011f);})[_0x1f75('0x27')](function(_0x3ad868){_0x183d00[_0x1f75('0x41')]=_0x3ad868;return _0x183d00;})['then'](respondWithFilteredResult(_0x4f1192,_0x14011f))[_0x1f75('0x42')](handleError(_0x4f1192,null));};exports[_0x1f75('0x43')]=function(_0x3750a9,_0x14bfa0){var _0x3825af={'raw':!![],'where':{'id':_0x3750a9[_0x1f75('0x44')]['id']}},_0x4d9de8={};_0x4d9de8[_0x1f75('0x32')]=_[_0x1f75('0x45')](db[_0x1f75('0x3e')]['rawAttributes']);_0x4d9de8[_0x1f75('0x2f')]=_[_0x1f75('0x45')](_0x3750a9[_0x1f75('0x2f')]);_0x4d9de8[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x4d9de8[_0x1f75('0x32')],_0x4d9de8['query']);_0x3825af[_0x1f75('0x33')]=_[_0x1f75('0x31')](_0x4d9de8[_0x1f75('0x32')],qs[_0x1f75('0x34')](_0x3750a9[_0x1f75('0x2f')][_0x1f75('0x34')]));_0x3825af[_0x1f75('0x33')]=_0x3825af[_0x1f75('0x33')][_0x1f75('0x35')]?_0x3825af[_0x1f75('0x33')]:_0x4d9de8[_0x1f75('0x32')];if(_0x3750a9[_0x1f75('0x2f')]['includeAll']){_0x3825af[_0x1f75('0x40')]=[{'all':!![]}];}_0x3825af=_[_0x1f75('0x3c')]({},_0x3825af,_0x3750a9[_0x1f75('0x46')]);return db[_0x1f75('0x3e')][_0x1f75('0x47')](_0x3825af)[_0x1f75('0x27')](handleEntityNotFound(_0x14bfa0,null))[_0x1f75('0x27')](respondWithResult(_0x14bfa0,null))['catch'](handleError(_0x14bfa0,null));};exports['create']=function(_0x376b20,_0x511f2e){return db[_0x1f75('0x3e')][_0x1f75('0x48')](_0x376b20[_0x1f75('0x49')],{})[_0x1f75('0x27')](respondWithResult(_0x511f2e,0xc9))[_0x1f75('0x42')](handleError(_0x511f2e,null));};exports['update']=function(_0x139ed3,_0x132ebf){if(_0x139ed3[_0x1f75('0x49')]['id']){delete _0x139ed3[_0x1f75('0x49')]['id'];}return db[_0x1f75('0x3e')][_0x1f75('0x47')]({'where':{'id':_0x139ed3['params']['id']}})['then'](handleEntityNotFound(_0x132ebf,null))[_0x1f75('0x27')](saveUpdates(_0x139ed3[_0x1f75('0x49')],null))[_0x1f75('0x27')](respondWithResult(_0x132ebf,null))[_0x1f75('0x42')](handleError(_0x132ebf,null));};exports['destroy']=function(_0x219269,_0x5d4e75){return db['ZohoField'][_0x1f75('0x47')]({'where':{'id':_0x219269['params']['id']}})[_0x1f75('0x27')](handleEntityNotFound(_0x5d4e75,null))[_0x1f75('0x27')](removeEntity(_0x5d4e75,null))['catch'](handleError(_0x5d4e75,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index af07e64..76c6ecc 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 _0x6d11=['exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger','moment','request-promise','path','./intZohoField.attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6d11,0xbf));var _0x16d1=function(_0x91369,_0x3f91c5){_0x91369=_0x91369-0x0;var _0x58f57a=_0x6d11[_0x91369];return _0x58f57a;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0xc8b05d,_0x55edaa){var _0x26507a=function(_0x3f91df){while(--_0x3f91df){_0xc8b05d['push'](_0xc8b05d['shift']());}};_0x26507a(++_0x55edaa);}(_0x5464,0x15d));var _0x4546=function(_0x297862,_0x2e85d4){_0x297862=_0x297862-0x0;var _0x21307f=_0x5464[_0x297862];return _0x21307f;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('0xd')],'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 24b7ded..4e989fb 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 _0x5b0f=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x46d259,_0x53473f){var _0xd3ee63=function(_0x27cb94){while(--_0x27cb94){_0x46d259['push'](_0x46d259['shift']());}};_0xd3ee63(++_0x53473f);}(_0x5b0f,0xea));var _0xf5b0=function(_0xa1f2af,_0x3d00c0){_0xa1f2af=_0xa1f2af-0x0;var _0xecb670=_0x5b0f[_0xa1f2af];return _0xecb670;};'use strict';var _=require(_0xf5b0('0x0'));var util=require(_0xf5b0('0x1'));var moment=require(_0xf5b0('0x2'));var BPromise=require(_0xf5b0('0x3'));var rs=require(_0xf5b0('0x4'));var fs=require('fs');var Redis=require(_0xf5b0('0x5'));var db=require(_0xf5b0('0x6'))['db'];var utils=require(_0xf5b0('0x7'));var logger=require(_0xf5b0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf5b0('0x9'));var client=jayson[_0xf5b0('0xa')][_0xf5b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a88d6,_0x18371c,_0x3eb201){return new BPromise(function(_0x47eab4,_0x5a7477){return client[_0xf5b0('0xc')](_0x3a88d6,_0x3eb201)['then'](function(_0x3c2efd){logger[_0xf5b0('0xd')](_0xf5b0('0xe'),_0x18371c,_0xf5b0('0xf'));logger['debug'](_0xf5b0('0x10'),_0x18371c,_0xf5b0('0xf'),JSON[_0xf5b0('0x11')](_0x3c2efd));if(_0x3c2efd['error']){if(_0x3c2efd['error'][_0xf5b0('0x12')]===0x1f4){logger[_0xf5b0('0x13')](_0xf5b0('0xe'),_0x18371c,_0x3c2efd['error'][_0xf5b0('0x14')]);return _0x5a7477(_0x3c2efd[_0xf5b0('0x13')]['message']);}logger[_0xf5b0('0x13')](_0xf5b0('0xe'),_0x18371c,_0x3c2efd[_0xf5b0('0x13')][_0xf5b0('0x14')]);return _0x47eab4(_0x3c2efd[_0xf5b0('0x13')][_0xf5b0('0x14')]);}else{logger[_0xf5b0('0xd')]('ZohoField,\x20%s,\x20%s',_0x18371c,_0xf5b0('0xf'));_0x47eab4(_0x3c2efd[_0xf5b0('0x15')][_0xf5b0('0x14')]);}})[_0xf5b0('0x16')](function(_0x154b6a){logger['error']('ZohoField,\x20%s,\x20%s',_0x18371c,_0x154b6a);_0x5a7477(_0x154b6a);});});} \ No newline at end of file +var _0xa018=['ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa018,0xd8));var _0x8a01=function(_0x7580a2,_0x25bde1){_0x7580a2=_0x7580a2-0x0;var _0x5b78d7=_0xa018[_0x7580a2];return _0x5b78d7;};'use strict';var _=require(_0x8a01('0x0'));var util=require(_0x8a01('0x1'));var moment=require('moment');var BPromise=require(_0x8a01('0x2'));var rs=require(_0x8a01('0x3'));var fs=require('fs');var Redis=require(_0x8a01('0x4'));var db=require(_0x8a01('0x5'))['db'];var utils=require(_0x8a01('0x6'));var logger=require('../../config/logger')(_0x8a01('0x7'));var config=require(_0x8a01('0x8'));var jayson=require(_0x8a01('0x9'));var client=jayson[_0x8a01('0xa')][_0x8a01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14c516,_0x234b03,_0x54da36){return new BPromise(function(_0xebbfb,_0x1d801f){return client[_0x8a01('0xc')](_0x14c516,_0x54da36)['then'](function(_0x53b205){logger[_0x8a01('0xd')](_0x8a01('0xe'),_0x234b03,_0x8a01('0xf'));logger[_0x8a01('0x10')](_0x8a01('0x11'),_0x234b03,_0x8a01('0xf'),JSON[_0x8a01('0x12')](_0x53b205));if(_0x53b205[_0x8a01('0x13')]){if(_0x53b205[_0x8a01('0x13')][_0x8a01('0x14')]===0x1f4){logger['error'](_0x8a01('0xe'),_0x234b03,_0x53b205[_0x8a01('0x13')][_0x8a01('0x15')]);return _0x1d801f(_0x53b205['error']['message']);}logger[_0x8a01('0x13')]('ZohoField,\x20%s,\x20%s',_0x234b03,_0x53b205[_0x8a01('0x13')][_0x8a01('0x15')]);return _0xebbfb(_0x53b205[_0x8a01('0x13')][_0x8a01('0x15')]);}else{logger[_0x8a01('0xd')]('ZohoField,\x20%s,\x20%s',_0x234b03,_0x8a01('0xf'));_0xebbfb(_0x53b205['result'][_0x8a01('0x15')]);}})[_0x8a01('0x16')](function(_0xc1e13){logger[_0x8a01('0x13')](_0x8a01('0xe'),_0x234b03,_0xc1e13);_0x1d801f(_0xc1e13);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index a8b99d1..45edd93 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x529326,_0x4f2260){var _0x220cc5=function(_0x22d1d0){while(--_0x22d1d0){_0x529326['push'](_0x529326['shift']());}};_0x220cc5(++_0x4f2260);}(_0xe706,0xa3));var _0x6e70=function(_0x4f66,_0x4c4a2e){_0x4f66=_0x4f66-0x0;var _0x4e3d42=_0xe706[_0x4f66];return _0x4e3d42;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xdd45,_0x2daf10){var _0x106736=function(_0xe27a56){while(--_0xe27a56){_0xdd45['push'](_0xdd45['shift']());}};_0x106736(++_0x2daf10);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 6d5441d..60b53c1 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 _0x987a=['unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x477671,_0x247c67){var _0x467112=function(_0x3eb2a){while(--_0x3eb2a){_0x477671['push'](_0x477671['shift']());}};_0x467112(++_0x247c67);}(_0x987a,0x17e));var _0xa987=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x987a[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xa987('0x0'));module[_0xa987('0x1')]={'name':{'type':Sequelize[_0xa987('0x2')],'allowNull':![],'unique':_0xa987('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa987('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xa987('0x2')]},'path':{'type':Sequelize[_0xa987('0x2')]},'type':{'type':Sequelize[_0xa987('0x2')]},'size':{'type':Sequelize[_0xa987('0x4')]},'active':{'type':Sequelize[_0xa987('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xa987('0x2')]},'logo':{'type':Sequelize[_0xa987('0x2')]},'state':{'type':Sequelize[_0xa987('0x2')],'unique':_0xa987('0x6')},'description':{'type':Sequelize[_0xa987('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa987('0x2')]},'link':{'type':Sequelize[_0xa987('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe0af=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x144c9d,_0x1777e6){var _0x396a0b=function(_0xee8d){while(--_0xee8d){_0x144c9d['push'](_0x144c9d['shift']());}};_0x396a0b(++_0x1777e6);}(_0xe0af,0x1c9));var _0xfe0a=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0xe0af[_0x3f0b30];return _0x2748a5;};'use strict';var Sequelize=require(_0xfe0a('0x0'));module[_0xfe0a('0x1')]={'name':{'type':Sequelize[_0xfe0a('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xfe0a('0x2')],'allowNull':![],'unique':_0xfe0a('0x3')},'main':{'type':Sequelize[_0xfe0a('0x2')],'defaultValue':_0xfe0a('0x4')},'filename':{'type':Sequelize[_0xfe0a('0x2')]},'path':{'type':Sequelize[_0xfe0a('0x2')]},'type':{'type':Sequelize[_0xfe0a('0x2')]},'size':{'type':Sequelize[_0xfe0a('0x5')]},'active':{'type':Sequelize[_0xfe0a('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xfe0a('0x2')],'unique':_0xfe0a('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xfe0a('0x2')]},'remoteUri':{'type':Sequelize[_0xfe0a('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index cecaa9d..5accb82 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 _0xdb28=['error','stack','name','send','index','Integration','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x401297,_0x463ef7){var _0x2c902f=function(_0x6801ce){while(--_0x6801ce){_0x401297['push'](_0x401297['shift']());}};_0x2c902f(++_0x463ef7);}(_0xdb28,0x106));var _0x8db2=function(_0x456833,_0x1b9e00){_0x456833=_0x456833-0x0;var _0x5280e3=_0xdb28[_0x456833];return _0x5280e3;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x57ca=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','Integration','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','rimraf','zip-dir','request-promise','moment'];(function(_0x4c5101,_0x641f87){var _0x84fb68=function(_0x19583c){while(--_0x19583c){_0x4c5101['push'](_0x4c5101['shift']());}};_0x84fb68(++_0x641f87);}(_0x57ca,0x108));var _0xa57c=function(_0x29686c,_0xb32a4a){_0x29686c=_0x29686c-0x0;var _0x46cd15=_0x57ca[_0x29686c];return _0x46cd15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['Integration']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['Integration'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c905515..2b9b46a 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 _0xd203=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Integration','integrations','lodash'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xd203,0x1cd));var _0x3d20=function(_0x1ba870,_0x495ed7){_0x1ba870=_0x1ba870-0x0;var _0x20ea35=_0xd203[_0x1ba870];return _0x20ea35;};'use strict';var _=require(_0x3d20('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3d20('0x1'));var BPromise=require(_0x3d20('0x2'));var rp=require(_0x3d20('0x3'));var fs=require('fs');var path=require(_0x3d20('0x4'));var rimraf=require(_0x3d20('0x5'));var config=require(_0x3d20('0x6'));var attributes=require('./integration.attributes');module[_0x3d20('0x7')]=function(_0x1e7b49,_0x14eef7){return _0x1e7b49[_0x3d20('0x8')](_0x3d20('0x9'),attributes,{'tableName':_0x3d20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x016a=['path','rimraf','../../config/environment','exports','define','integrations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4e9bb4,_0x286ed8){var _0x399a77=function(_0x5854cf){while(--_0x5854cf){_0x4e9bb4['push'](_0x4e9bb4['shift']());}};_0x399a77(++_0x286ed8);}(_0x016a,0x1da));var _0xa016=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x016a[_0x11e30d];return _0x2d4e29;};'use strict';var _=require(_0xa016('0x0'));var util=require(_0xa016('0x1'));var logger=require(_0xa016('0x2'))(_0xa016('0x3'));var moment=require('moment');var BPromise=require(_0xa016('0x4'));var rp=require(_0xa016('0x5'));var fs=require('fs');var path=require(_0xa016('0x6'));var rimraf=require(_0xa016('0x7'));var config=require(_0xa016('0x8'));var attributes=require('./integration.attributes');module[_0xa016('0x9')]=function(_0x50d04d,_0x545426){return _0x50d04d[_0xa016('0xa')]('Integration',attributes,{'tableName':_0xa016('0xb'),'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 66d9bb4..50785ba 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4cec98,_0x13f121){var _0xe7251e=function(_0x42fb02){while(--_0x42fb02){_0x4cec98['push'](_0x4cec98['shift']());}};_0xe7251e(++_0x13f121);}(_0x66fa,0x117));var _0xa66f=function(_0x23f462,_0x288068){_0x23f462=_0x23f462-0x0;var _0x421d87=_0x66fa[_0x23f462];return _0x421d87;};'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')]('Integration,\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')]('Integration,\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 +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2f599b,_0x267a9d){var _0x20423d=function(_0x2b9832){while(--_0x2b9832){_0x2f599b['push'](_0x2f599b['shift']());}};_0x20423d(++_0x267a9d);}(_0x66fa,0x117));var _0xa66f=function(_0x52b497,_0x38ddf2){_0x52b497=_0x52b497-0x0;var _0x4bd56b=_0x66fa[_0x52b497];return _0x4bd56b;};'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')]('Integration,\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')]('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index df5eb5f..5daeb27 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 _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x489b79,_0x576663){var _0x4f6096=function(_0x36381c){while(--_0x36381c){_0x489b79['push'](_0x489b79['shift']());}};_0x4f6096(++_0x576663);}(_0x524e,0x15e));var _0xe524=function(_0x3d2912,_0x1906d5){_0x3d2912=_0x3d2912-0x0;var _0x8e6dd7=_0x524e[_0x3d2912];return _0x8e6dd7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x3afecb,_0x5dd151){var _0x5cad25=function(_0x39a357){while(--_0x39a357){_0x3afecb['push'](_0x3afecb['shift']());}};_0x5cad25(++_0x5dd151);}(_0x524e,0x15e));var _0xe524=function(_0x2d54f3,_0x4c5dfa){_0x2d54f3=_0x2d54f3-0x0;var _0x4d766e=_0x524e[_0x2d54f3];return _0x4d766e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);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 063cfc7..afb9442 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 _0xc708=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','exports'];(function(_0x2d5b9e,_0x4e79f5){var _0x2f039b=function(_0x3575c1){while(--_0x3575c1){_0x2d5b9e['push'](_0x2d5b9e['shift']());}};_0x2f039b(++_0x4e79f5);}(_0xc708,0x8b));var _0x8c70=function(_0x358bf3,_0x40ec1f){_0x358bf3=_0x358bf3-0x0;var _0x248106=_0xc708[_0x358bf3];return _0x248106;};'use strict';var Sequelize=require('sequelize');module[_0x8c70('0x0')]={'integration':{'type':Sequelize[_0x8c70('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x8c70('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8c70('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8c70('0x1')]},'calleridnum':{'type':Sequelize[_0x8c70('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8c70('0x1')]},'interface':{'type':Sequelize[_0x8c70('0x1')]},'membername':{'type':Sequelize[_0x8c70('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8c70('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8c70('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8c70('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8c70('0x3')]},'talktime':{'type':Sequelize[_0x8c70('0x2')]},'agentacw':{'type':Sequelize[_0x8c70('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8c70('0x2')]},'reason':{'type':Sequelize[_0x8c70('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8c70('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8c70('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8c70('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8c70('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8c70('0x1')]},'language':{'type':Sequelize[_0x8c70('0x1')]},'accountcode':{'type':Sequelize[_0x8c70('0x1')]},'context':{'type':Sequelize[_0x8c70('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8c70('0x1')]},'destchannel':{'type':Sequelize[_0x8c70('0x1')]},'destchannelstate':{'type':Sequelize[_0x8c70('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x8c70('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8c70('0x1')]},'destcalleridname':{'type':Sequelize[_0x8c70('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8c70('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8c70('0x1')]},'destaccountcode':{'type':Sequelize[_0x8c70('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8c70('0x1')]},'destpriority':{'type':Sequelize[_0x8c70('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8c70('0x1')]},'subject':{'type':Sequelize[_0x8c70('0x1')]},'from':{'type':Sequelize[_0x8c70('0x1')]},'to':{'type':Sequelize[_0x8c70('0x1')]},'cc':{'type':Sequelize[_0x8c70('0x1')]},'attachment':{'type':Sequelize[_0x8c70('0x5')]},'html':{'type':Sequelize[_0x8c70('0x5')]},'text':{'type':Sequelize[_0x8c70('0x5')]},'status':{'type':Sequelize['ENUM'](_0x8c70('0x6'),_0x8c70('0x7'),_0x8c70('0x8'),_0x8c70('0x9'))},'url':{'type':Sequelize[_0x8c70('0x1')]},'app':{'type':Sequelize[_0x8c70('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x8c70('0x2')]}}; \ No newline at end of file +var _0x382d=['SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x507c6f,_0x25cb42){var _0x5ee1f9=function(_0x102b16){while(--_0x102b16){_0x507c6f['push'](_0x507c6f['shift']());}};_0x5ee1f9(++_0x25cb42);}(_0x382d,0xc9));var _0xd382=function(_0x19eac8,_0x338838){_0x19eac8=_0x19eac8-0x0;var _0x516687=_0x382d[_0x19eac8];return _0x516687;};'use strict';var Sequelize=require('sequelize');module[_0xd382('0x0')]={'integration':{'type':Sequelize[_0xd382('0x1')]},'eventChannel':{'type':Sequelize[_0xd382('0x1')]},'exitStatus':{'type':Sequelize[_0xd382('0x1')]},'ticketId':{'type':Sequelize[_0xd382('0x1')]},'integrationId':{'type':Sequelize[_0xd382('0x2')]},'contacts':{'type':Sequelize[_0xd382('0x1')]},'uniqueid':{'type':Sequelize[_0xd382('0x1')]},'calleridnum':{'type':Sequelize[_0xd382('0x1')]},'calleridname':{'type':Sequelize[_0xd382('0x1')]},'queue':{'type':Sequelize[_0xd382('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd382('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd382('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd382('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd382('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xd382('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd382('0x2')]},'reason':{'type':Sequelize[_0xd382('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xd382('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd382('0x3')]},'lastevent':{'type':Sequelize[_0xd382('0x1')]},'channel':{'type':Sequelize[_0xd382('0x1')]},'channelstate':{'type':Sequelize[_0xd382('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd382('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd382('0x1')]},'connectedlinename':{'type':Sequelize[_0xd382('0x1')]},'language':{'type':Sequelize[_0xd382('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd382('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd382('0x1')]},'destchannel':{'type':Sequelize[_0xd382('0x1')]},'destchannelstate':{'type':Sequelize[_0xd382('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd382('0x1')]},'destcalleridname':{'type':Sequelize[_0xd382('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd382('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd382('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xd382('0x1')]},'destcontext':{'type':Sequelize[_0xd382('0x1')]},'destexten':{'type':Sequelize[_0xd382('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd382('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xd382('0x1')]},'from':{'type':Sequelize[_0xd382('0x1')]},'to':{'type':Sequelize[_0xd382('0x1')]},'cc':{'type':Sequelize[_0xd382('0x1')]},'attachment':{'type':Sequelize[_0xd382('0x5')]},'html':{'type':Sequelize[_0xd382('0x5')]},'text':{'type':Sequelize[_0xd382('0x5')]},'status':{'type':Sequelize[_0xd382('0x6')](_0xd382('0x7'),_0xd382('0x8'),_0xd382('0x9'),_0xd382('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xd382('0x1')]},'appdata':{'type':Sequelize[_0xd382('0x1')]},'projectId':{'type':Sequelize[_0xd382('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e38f2ab..5a2ba63 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 _0x1e35=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e35,0x173));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x51e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51e3('0x1'));var jsonpatch=require(_0x51e3('0x2'));var rp=require(_0x51e3('0x3'));var moment=require(_0x51e3('0x4'));var BPromise=require(_0x51e3('0x5'));var Mustache=require(_0x51e3('0x6'));var util=require('util');var path=require(_0x51e3('0x7'));var sox=require(_0x51e3('0x8'));var csv=require(_0x51e3('0x9'));var ejs=require(_0x51e3('0xa'));var fs=require('fs');var fs_extra=require(_0x51e3('0xb'));var _=require(_0x51e3('0xc'));var squel=require(_0x51e3('0xd'));var crypto=require('crypto');var jsforce=require(_0x51e3('0xe'));var deskjs=require(_0x51e3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51e3('0x10'));var Redis=require(_0x51e3('0x11'));var authService=require(_0x51e3('0x12'));var qs=require(_0x51e3('0x13'));var as=require(_0x51e3('0x14'));var hardwareService=require(_0x51e3('0x15'));var logger=require(_0x51e3('0x16'))(_0x51e3('0x17'));var utils=require(_0x51e3('0x18'));var config=require(_0x51e3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x51e3('0x1a'))['db'];function respondWithStatusCode(_0x31c43c,_0x42656c){_0x42656c=_0x42656c||0xcc;return function(_0x52afbf){if(_0x52afbf){return _0x31c43c[_0x51e3('0x1b')](_0x42656c);}return _0x31c43c[_0x51e3('0x1c')](_0x42656c)[_0x51e3('0x1d')]();};}function respondWithResult(_0x5e0ef7,_0x5df81e){_0x5df81e=_0x5df81e||0xc8;return function(_0x3979f4){if(_0x3979f4){return _0x5e0ef7[_0x51e3('0x1c')](_0x5df81e)[_0x51e3('0x1e')](_0x3979f4);}};}function respondWithFilteredResult(_0x251e57,_0x55a012){return function(_0x2cdd84){if(_0x2cdd84){var _0x59316b=typeof _0x55a012[_0x51e3('0x1f')]===_0x51e3('0x20')&&typeof _0x55a012['limit']==='undefined';var _0x11da8a=_0x2cdd84['count'];var _0x26bfc7=_0x59316b?0x0:_0x55a012['offset'];var _0x3b8d21=_0x59316b?_0x2cdd84[_0x51e3('0x21')]:_0x55a012[_0x51e3('0x1f')]+_0x55a012[_0x51e3('0x22')];var _0x159e7a;if(_0x3b8d21>=_0x11da8a){_0x3b8d21=_0x11da8a;_0x159e7a=0xc8;}else{_0x159e7a=0xce;}_0x251e57[_0x51e3('0x1c')](_0x159e7a);return _0x251e57[_0x51e3('0x23')](_0x51e3('0x24'),_0x26bfc7+'-'+_0x3b8d21+'/'+_0x11da8a)[_0x51e3('0x1e')](_0x2cdd84);}return null;};}function patchUpdates(_0x387163){return function(_0x5c0f0e){try{jsonpatch[_0x51e3('0x25')](_0x5c0f0e,_0x387163,!![]);}catch(_0x154507){return BPromise['reject'](_0x154507);}return _0x5c0f0e['save']();};}function saveUpdates(_0x9a7926,_0x81d74b){return function(_0x4ddc64){if(_0x4ddc64){return _0x4ddc64[_0x51e3('0x26')](_0x9a7926)['then'](function(_0x55ac75){return _0x55ac75;});}return null;};}function removeEntity(_0x24790c,_0x2493c7){return function(_0x3fef10){if(_0x3fef10){return _0x3fef10[_0x51e3('0x27')]()[_0x51e3('0x28')](function(){_0x24790c[_0x51e3('0x1c')](0xcc)[_0x51e3('0x1d')]();});}};}function handleEntityNotFound(_0x41878f,_0x2bb836){return function(_0x22b062){if(!_0x22b062){_0x41878f['sendStatus'](0x194);}return _0x22b062;};}function handleError(_0x58147f,_0x4bd769){_0x4bd769=_0x4bd769||0x1f4;return function(_0x24c964){logger[_0x51e3('0x29')](_0x24c964['stack']);if(_0x24c964['name']){delete _0x24c964[_0x51e3('0x2a')];}_0x58147f[_0x51e3('0x1c')](_0x4bd769)[_0x51e3('0x2b')](_0x24c964);};}exports[_0x51e3('0x2c')]=function(_0x639aa7,_0x34323e){var _0x2fef78={},_0x18d7a4={},_0x5733ba={'count':0x0,'rows':[]};var _0x542a74=_[_0x51e3('0x2d')](db[_0x51e3('0x2e')][_0x51e3('0x2f')],function(_0x583254){return{'name':_0x583254[_0x51e3('0x30')],'type':_0x583254[_0x51e3('0x31')]['key']};});_0x18d7a4[_0x51e3('0x32')]=_[_0x51e3('0x2d')](_0x542a74,_0x51e3('0x2a'));_0x18d7a4[_0x51e3('0x33')]=_[_0x51e3('0x34')](_0x639aa7[_0x51e3('0x33')]);_0x18d7a4[_0x51e3('0x35')]=_[_0x51e3('0x36')](_0x18d7a4[_0x51e3('0x32')],_0x18d7a4[_0x51e3('0x33')]);_0x2fef78[_0x51e3('0x37')]=_[_0x51e3('0x36')](_0x18d7a4[_0x51e3('0x32')],qs['fields'](_0x639aa7[_0x51e3('0x33')][_0x51e3('0x38')]));_0x2fef78[_0x51e3('0x37')]=_0x2fef78[_0x51e3('0x37')][_0x51e3('0x39')]?_0x2fef78['attributes']:_0x18d7a4[_0x51e3('0x32')];if(!_0x639aa7[_0x51e3('0x33')][_0x51e3('0x3a')](_0x51e3('0x3b'))){_0x2fef78[_0x51e3('0x22')]=qs[_0x51e3('0x22')](_0x639aa7[_0x51e3('0x33')][_0x51e3('0x22')]);_0x2fef78[_0x51e3('0x1f')]=qs[_0x51e3('0x1f')](_0x639aa7['query'][_0x51e3('0x1f')]);}_0x2fef78[_0x51e3('0x3c')]=qs['sort'](_0x639aa7['query'][_0x51e3('0x3d')]);_0x2fef78[_0x51e3('0x3e')]=qs[_0x51e3('0x35')](_[_0x51e3('0x3f')](_0x639aa7[_0x51e3('0x33')],_0x18d7a4[_0x51e3('0x35')]),_0x542a74);if(_0x639aa7[_0x51e3('0x33')][_0x51e3('0x40')]){_0x2fef78[_0x51e3('0x3e')]=_[_0x51e3('0x41')](_0x2fef78['where'],{'$or':_[_0x51e3('0x2d')](_0x542a74,function(_0x29ca77){if(_0x29ca77[_0x51e3('0x31')]!==_0x51e3('0x42')){var _0x4951ff={};_0x4951ff[_0x29ca77[_0x51e3('0x2a')]]={'$like':'%'+_0x639aa7[_0x51e3('0x33')]['filter']+'%'};return _0x4951ff;}})});}_0x2fef78=_['merge']({},_0x2fef78,_0x639aa7[_0x51e3('0x43')]);var _0x1577cd={'where':_0x2fef78[_0x51e3('0x3e')]};return db[_0x51e3('0x2e')][_0x51e3('0x21')](_0x1577cd)[_0x51e3('0x28')](function(_0xfd741b){_0x5733ba[_0x51e3('0x21')]=_0xfd741b;if(_0x639aa7[_0x51e3('0x33')][_0x51e3('0x44')]){_0x2fef78[_0x51e3('0x45')]=[{'all':!![]}];}return db[_0x51e3('0x2e')][_0x51e3('0x46')](_0x2fef78);})['then'](function(_0x2b96b7){_0x5733ba[_0x51e3('0x47')]=_0x2b96b7;return _0x5733ba;})['then'](respondWithFilteredResult(_0x34323e,_0x2fef78))[_0x51e3('0x48')](handleError(_0x34323e,null));};exports[_0x51e3('0x49')]=function(_0x5332d9,_0x249c4c){var _0xa9f8ea={'raw':![],'where':{'id':_0x5332d9[_0x51e3('0x4a')]['id']}},_0x4bfec3={};_0x4bfec3[_0x51e3('0x32')]=_['keys'](db[_0x51e3('0x2e')][_0x51e3('0x2f')]);_0x4bfec3[_0x51e3('0x33')]=_[_0x51e3('0x34')](_0x5332d9[_0x51e3('0x33')]);_0x4bfec3[_0x51e3('0x35')]=_[_0x51e3('0x36')](_0x4bfec3[_0x51e3('0x32')],_0x4bfec3[_0x51e3('0x33')]);_0xa9f8ea[_0x51e3('0x37')]=_['intersection'](_0x4bfec3['model'],qs[_0x51e3('0x38')](_0x5332d9['query'][_0x51e3('0x38')]));_0xa9f8ea[_0x51e3('0x37')]=_0xa9f8ea[_0x51e3('0x37')]['length']?_0xa9f8ea[_0x51e3('0x37')]:_0x4bfec3[_0x51e3('0x32')];if(_0x5332d9[_0x51e3('0x33')][_0x51e3('0x44')]){_0xa9f8ea[_0x51e3('0x45')]=[{'all':!![]}];}_0xa9f8ea=_[_0x51e3('0x41')]({},_0xa9f8ea,_0x5332d9[_0x51e3('0x43')]);return db[_0x51e3('0x2e')]['find'](_0xa9f8ea)['then'](handleEntityNotFound(_0x249c4c,null))['then'](respondWithResult(_0x249c4c,null))[_0x51e3('0x48')](handleError(_0x249c4c,null));};exports[_0x51e3('0x4b')]=function(_0x19bb3a,_0x54a33c){return db[_0x51e3('0x2e')]['create'](_0x19bb3a[_0x51e3('0x4c')],{})[_0x51e3('0x28')](respondWithResult(_0x54a33c,0xc9))[_0x51e3('0x48')](handleError(_0x54a33c,null));};exports[_0x51e3('0x26')]=function(_0x5e52cb,_0x1446d0){if(_0x5e52cb[_0x51e3('0x4c')]['id']){delete _0x5e52cb[_0x51e3('0x4c')]['id'];}return db[_0x51e3('0x2e')][_0x51e3('0x4d')]({'where':{'id':_0x5e52cb[_0x51e3('0x4a')]['id']}})[_0x51e3('0x28')](handleEntityNotFound(_0x1446d0,null))['then'](saveUpdates(_0x5e52cb[_0x51e3('0x4c')],null))[_0x51e3('0x28')](respondWithResult(_0x1446d0,null))['catch'](handleError(_0x1446d0,null));};exports[_0x51e3('0x27')]=function(_0x3a0525,_0x185943){return db[_0x51e3('0x2e')][_0x51e3('0x4d')]({'where':{'id':_0x3a0525[_0x51e3('0x4a')]['id']}})[_0x51e3('0x28')](handleEntityNotFound(_0x185943,null))[_0x51e3('0x28')](removeEntity(_0x185943,null))[_0x51e3('0x48')](handleError(_0x185943,null));};exports['describe']=function(_0x481a96,_0x20dafb){return db[_0x51e3('0x2e')][_0x51e3('0x4e')]()['then'](respondWithResult(_0x20dafb,null))[_0x51e3('0x48')](handleError(_0x20dafb,null));}; \ No newline at end of file +var _0xbd92=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x1ca005,_0x1aff9d){var _0x486476=function(_0xac807e){while(--_0xac807e){_0x1ca005['push'](_0x1ca005['shift']());}};_0x486476(++_0x1aff9d);}(_0xbd92,0x82));var _0x2bd9=function(_0x33dc0b,_0x963a57){_0x33dc0b=_0x33dc0b-0x0;var _0x1d9f2a=_0xbd92[_0x33dc0b];return _0x1d9f2a;};'use strict';var emlformat=require(_0x2bd9('0x0'));var rimraf=require(_0x2bd9('0x1'));var zipdir=require(_0x2bd9('0x2'));var jsonpatch=require(_0x2bd9('0x3'));var rp=require('request-promise');var moment=require(_0x2bd9('0x4'));var BPromise=require(_0x2bd9('0x5'));var Mustache=require(_0x2bd9('0x6'));var util=require('util');var path=require(_0x2bd9('0x7'));var sox=require(_0x2bd9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bd9('0x9'));var _=require('lodash');var squel=require(_0x2bd9('0xa'));var crypto=require('crypto');var jsforce=require(_0x2bd9('0xb'));var deskjs=require(_0x2bd9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2bd9('0xd'));var Papa=require(_0x2bd9('0xe'));var Redis=require(_0x2bd9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2bd9('0x10'));var as=require(_0x2bd9('0x11'));var hardwareService=require(_0x2bd9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2bd9('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd80557,_0x10a679){_0x10a679=_0x10a679||0xcc;return function(_0x19d7c3){if(_0x19d7c3){return _0xd80557['sendStatus'](_0x10a679);}return _0xd80557['status'](_0x10a679)[_0x2bd9('0x14')]();};}function respondWithResult(_0xf82e17,_0x4783b8){_0x4783b8=_0x4783b8||0xc8;return function(_0x4cb460){if(_0x4cb460){return _0xf82e17[_0x2bd9('0x15')](_0x4783b8)[_0x2bd9('0x16')](_0x4cb460);}};}function respondWithFilteredResult(_0x22fe81,_0xbcdc){return function(_0x170c26){if(_0x170c26){var _0x599166=typeof _0xbcdc['offset']===_0x2bd9('0x17')&&typeof _0xbcdc[_0x2bd9('0x18')]===_0x2bd9('0x17');var _0x87db1c=_0x170c26[_0x2bd9('0x19')];var _0x4f08bd=_0x599166?0x0:_0xbcdc[_0x2bd9('0x1a')];var _0x40a281=_0x599166?_0x170c26[_0x2bd9('0x19')]:_0xbcdc[_0x2bd9('0x1a')]+_0xbcdc['limit'];var _0x2c08f9;if(_0x40a281>=_0x87db1c){_0x40a281=_0x87db1c;_0x2c08f9=0xc8;}else{_0x2c08f9=0xce;}_0x22fe81['status'](_0x2c08f9);return _0x22fe81[_0x2bd9('0x1b')](_0x2bd9('0x1c'),_0x4f08bd+'-'+_0x40a281+'/'+_0x87db1c)[_0x2bd9('0x16')](_0x170c26);}return null;};}function patchUpdates(_0x1934e5){return function(_0x2fd11d){try{jsonpatch['apply'](_0x2fd11d,_0x1934e5,!![]);}catch(_0x18978c){return BPromise[_0x2bd9('0x1d')](_0x18978c);}return _0x2fd11d[_0x2bd9('0x1e')]();};}function saveUpdates(_0x2cdd8d,_0x2cee7c){return function(_0x3973d0){if(_0x3973d0){return _0x3973d0[_0x2bd9('0x1f')](_0x2cdd8d)['then'](function(_0x5e46ed){return _0x5e46ed;});}return null;};}function removeEntity(_0x104813,_0x5014a3){return function(_0x3dc369){if(_0x3dc369){return _0x3dc369['destroy']()[_0x2bd9('0x20')](function(){_0x104813[_0x2bd9('0x15')](0xcc)[_0x2bd9('0x14')]();});}};}function handleEntityNotFound(_0x5dd4ce,_0x3159b7){return function(_0x1ecd0e){if(!_0x1ecd0e){_0x5dd4ce['sendStatus'](0x194);}return _0x1ecd0e;};}function handleError(_0x54d7ac,_0x13d7e1){_0x13d7e1=_0x13d7e1||0x1f4;return function(_0x30c25f){logger['error'](_0x30c25f[_0x2bd9('0x21')]);if(_0x30c25f[_0x2bd9('0x22')]){delete _0x30c25f[_0x2bd9('0x22')];}_0x54d7ac[_0x2bd9('0x15')](_0x13d7e1)[_0x2bd9('0x23')](_0x30c25f);};}exports[_0x2bd9('0x24')]=function(_0x90d57a,_0x449bac){var _0x55db58={},_0x52abe5={},_0x47ef97={'count':0x0,'rows':[]};var _0x473967=_[_0x2bd9('0x25')](db[_0x2bd9('0x26')]['rawAttributes'],function(_0x49b0e8){return{'name':_0x49b0e8[_0x2bd9('0x27')],'type':_0x49b0e8[_0x2bd9('0x28')][_0x2bd9('0x29')]};});_0x52abe5[_0x2bd9('0x2a')]=_[_0x2bd9('0x25')](_0x473967,_0x2bd9('0x22'));_0x52abe5[_0x2bd9('0x2b')]=_[_0x2bd9('0x2c')](_0x90d57a[_0x2bd9('0x2b')]);_0x52abe5[_0x2bd9('0x2d')]=_[_0x2bd9('0x2e')](_0x52abe5['model'],_0x52abe5[_0x2bd9('0x2b')]);_0x55db58[_0x2bd9('0x2f')]=_[_0x2bd9('0x2e')](_0x52abe5[_0x2bd9('0x2a')],qs[_0x2bd9('0x30')](_0x90d57a[_0x2bd9('0x2b')][_0x2bd9('0x30')]));_0x55db58[_0x2bd9('0x2f')]=_0x55db58[_0x2bd9('0x2f')][_0x2bd9('0x31')]?_0x55db58[_0x2bd9('0x2f')]:_0x52abe5[_0x2bd9('0x2a')];if(!_0x90d57a[_0x2bd9('0x2b')][_0x2bd9('0x32')](_0x2bd9('0x33'))){_0x55db58['limit']=qs['limit'](_0x90d57a[_0x2bd9('0x2b')][_0x2bd9('0x18')]);_0x55db58[_0x2bd9('0x1a')]=qs[_0x2bd9('0x1a')](_0x90d57a[_0x2bd9('0x2b')]['offset']);}_0x55db58[_0x2bd9('0x34')]=qs['sort'](_0x90d57a['query'][_0x2bd9('0x35')]);_0x55db58[_0x2bd9('0x36')]=qs[_0x2bd9('0x2d')](_[_0x2bd9('0x37')](_0x90d57a['query'],_0x52abe5[_0x2bd9('0x2d')]),_0x473967);if(_0x90d57a['query'][_0x2bd9('0x38')]){_0x55db58[_0x2bd9('0x36')]=_['merge'](_0x55db58[_0x2bd9('0x36')],{'$or':_['map'](_0x473967,function(_0x18d03f){if(_0x18d03f[_0x2bd9('0x28')]!==_0x2bd9('0x39')){var _0x4d3309={};_0x4d3309[_0x18d03f[_0x2bd9('0x22')]]={'$like':'%'+_0x90d57a['query'][_0x2bd9('0x38')]+'%'};return _0x4d3309;}})});}_0x55db58=_[_0x2bd9('0x3a')]({},_0x55db58,_0x90d57a[_0x2bd9('0x3b')]);var _0x28f4eb={'where':_0x55db58['where']};return db[_0x2bd9('0x26')][_0x2bd9('0x19')](_0x28f4eb)[_0x2bd9('0x20')](function(_0x3480ec){_0x47ef97['count']=_0x3480ec;if(_0x90d57a[_0x2bd9('0x2b')][_0x2bd9('0x3c')]){_0x55db58['include']=[{'all':!![]}];}return db[_0x2bd9('0x26')][_0x2bd9('0x3d')](_0x55db58);})[_0x2bd9('0x20')](function(_0x5cbac3){_0x47ef97[_0x2bd9('0x3e')]=_0x5cbac3;return _0x47ef97;})[_0x2bd9('0x20')](respondWithFilteredResult(_0x449bac,_0x55db58))[_0x2bd9('0x3f')](handleError(_0x449bac,null));};exports[_0x2bd9('0x40')]=function(_0x553bf0,_0x1d4053){var _0x2cec47={'raw':![],'where':{'id':_0x553bf0[_0x2bd9('0x41')]['id']}},_0x5b785e={};_0x5b785e['model']=_[_0x2bd9('0x2c')](db[_0x2bd9('0x26')]['rawAttributes']);_0x5b785e['query']=_[_0x2bd9('0x2c')](_0x553bf0[_0x2bd9('0x2b')]);_0x5b785e[_0x2bd9('0x2d')]=_[_0x2bd9('0x2e')](_0x5b785e['model'],_0x5b785e[_0x2bd9('0x2b')]);_0x2cec47[_0x2bd9('0x2f')]=_[_0x2bd9('0x2e')](_0x5b785e[_0x2bd9('0x2a')],qs['fields'](_0x553bf0[_0x2bd9('0x2b')][_0x2bd9('0x30')]));_0x2cec47[_0x2bd9('0x2f')]=_0x2cec47[_0x2bd9('0x2f')][_0x2bd9('0x31')]?_0x2cec47[_0x2bd9('0x2f')]:_0x5b785e[_0x2bd9('0x2a')];if(_0x553bf0['query'][_0x2bd9('0x3c')]){_0x2cec47[_0x2bd9('0x42')]=[{'all':!![]}];}_0x2cec47=_['merge']({},_0x2cec47,_0x553bf0[_0x2bd9('0x3b')]);return db[_0x2bd9('0x26')]['find'](_0x2cec47)[_0x2bd9('0x20')](handleEntityNotFound(_0x1d4053,null))[_0x2bd9('0x20')](respondWithResult(_0x1d4053,null))[_0x2bd9('0x3f')](handleError(_0x1d4053,null));};exports[_0x2bd9('0x43')]=function(_0x433bea,_0x1fd675){return db[_0x2bd9('0x26')][_0x2bd9('0x43')](_0x433bea[_0x2bd9('0x44')],{})[_0x2bd9('0x20')](respondWithResult(_0x1fd675,0xc9))[_0x2bd9('0x3f')](handleError(_0x1fd675,null));};exports[_0x2bd9('0x1f')]=function(_0x1ab6f0,_0x3d768c){if(_0x1ab6f0[_0x2bd9('0x44')]['id']){delete _0x1ab6f0['body']['id'];}return db[_0x2bd9('0x26')][_0x2bd9('0x45')]({'where':{'id':_0x1ab6f0[_0x2bd9('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d768c,null))[_0x2bd9('0x20')](saveUpdates(_0x1ab6f0[_0x2bd9('0x44')],null))[_0x2bd9('0x20')](respondWithResult(_0x3d768c,null))[_0x2bd9('0x3f')](handleError(_0x3d768c,null));};exports[_0x2bd9('0x46')]=function(_0x23b070,_0x1c0c20){return db[_0x2bd9('0x26')][_0x2bd9('0x45')]({'where':{'id':_0x23b070['params']['id']}})[_0x2bd9('0x20')](handleEntityNotFound(_0x1c0c20,null))['then'](removeEntity(_0x1c0c20,null))['catch'](handleError(_0x1c0c20,null));};exports['describe']=function(_0x46c0cc,_0x2d2762){return db[_0x2bd9('0x26')][_0x2bd9('0x47')]()['then'](respondWithResult(_0x2d2762,null))['catch'](handleError(_0x2d2762,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b858a9c..8594615 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 _0x3422=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','moment','bluebird','request-promise'];(function(_0x2919de,_0x503ebb){var _0x449294=function(_0xb9ffae){while(--_0xb9ffae){_0x2919de['push'](_0x2919de['shift']());}};_0x449294(++_0x503ebb);}(_0x3422,0x74));var _0x2342=function(_0x12f4e5,_0x3a69ba){_0x12f4e5=_0x12f4e5-0x0;var _0x414d5b=_0x3422[_0x12f4e5];return _0x414d5b;};'use strict';var _=require('lodash');var util=require(_0x2342('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2342('0x1'));var BPromise=require(_0x2342('0x2'));var rp=require(_0x2342('0x3'));var fs=require('fs');var path=require(_0x2342('0x4'));var rimraf=require(_0x2342('0x5'));var config=require(_0x2342('0x6'));var attributes=require(_0x2342('0x7'));module[_0x2342('0x8')]=function(_0x1f820a,_0x37fe0f){return _0x1f820a[_0x2342('0x9')](_0x2342('0xa'),attributes,{'tableName':_0x2342('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6e4=['api','moment','bluebird','request-promise','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','util','../../config/logger'];(function(_0x1d7791,_0x2a291f){var _0x2293f8=function(_0x464734){while(--_0x464734){_0x1d7791['push'](_0x1d7791['shift']());}};_0x2293f8(++_0x2a291f);}(_0xc6e4,0x195));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4c6e('0x0'));var logger=require(_0x4c6e('0x1'))(_0x4c6e('0x2'));var moment=require(_0x4c6e('0x3'));var BPromise=require(_0x4c6e('0x4'));var rp=require(_0x4c6e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c6e('0x6'));var attributes=require(_0x4c6e('0x7'));module['exports']=function(_0x250010,_0x5ae272){return _0x250010[_0x4c6e('0x8')](_0x4c6e('0x9'),attributes,{'tableName':_0x4c6e('0xa'),'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 a485f97..ec467d4 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x173cf2,_0x4cf799){var _0x466f8f=function(_0x1745d1){while(--_0x1745d1){_0x173cf2['push'](_0x173cf2['shift']());}};_0x466f8f(++_0x4cf799);}(_0x187d,0x93));var _0xd187=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x187d[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 9109bb4..97396c0 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 _0x1670=['get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x966ae0,_0x55cde1){var _0x204c22=function(_0x16e6d4){while(--_0x16e6d4){_0x966ae0['push'](_0x966ae0['shift']());}};_0x204c22(++_0x55cde1);}(_0x1670,0x9a));var _0x0167=function(_0x172a34,_0x587d42){_0x172a34=_0x172a34-0x0;var _0x5d2b80=_0x1670[_0x172a34];return _0x5d2b80;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var fs_extra=require(_0x0167('0x4'));var auth=require(_0x0167('0x5'));var interaction=require(_0x0167('0x6'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x0167('0x7')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0x9')]);router[_0x0167('0x7')](_0x0167('0xa'),auth[_0x0167('0x8')](),controller[_0x0167('0xb')]);router[_0x0167('0x7')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x0167('0xc')]);router[_0x0167('0xd')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0xe')]);router[_0x0167('0xd')](_0x0167('0xf'),auth[_0x0167('0x8')](),controller[_0x0167('0x10')]);router[_0x0167('0xd')](_0x0167('0x11'),auth[_0x0167('0x8')](),controller[_0x0167('0x12')]);router[_0x0167('0x13')](_0x0167('0xa'),auth['isAuthenticated'](),controller[_0x0167('0x14')]);router['delete'](_0x0167('0xa'),auth['isAuthenticated'](),controller[_0x0167('0x15')]);module[_0x0167('0x16')]=router; \ No newline at end of file +var _0x07e8=['create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','multer','util','path','express','fs-extra','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07e8,0x10f));var _0x807e=function(_0x366965,_0x44412a){_0x366965=_0x366965-0x0;var _0x10544c=_0x07e8[_0x366965];return _0x10544c;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require(_0x807e('0x2'));var timeout=require('connect-timeout');var express=require(_0x807e('0x3'));var router=express['Router']();var fs_extra=require(_0x807e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807e('0x5'));var controller=require(_0x807e('0x6'));router[_0x807e('0x7')]('/',auth['isAuthenticated'](),controller[_0x807e('0x8')]);router[_0x807e('0x7')](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0xb')]);router['get'](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0xd')]);router[_0x807e('0xe')]('/',auth[_0x807e('0xa')](),controller[_0x807e('0xf')]);router[_0x807e('0xe')](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0x10')]);router[_0x807e('0xe')](_0x807e('0x11'),auth[_0x807e('0xa')](),controller[_0x807e('0x12')]);router['put'](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0x13')]);router[_0x807e('0x14')](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 68bd53e..f6c58d1 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 _0x0a25=['STRING','sequelize'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0x0a25,0xa3));var _0x50a2=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x0a25[_0x16e0c8];return _0xe4b5af;};'use strict';var Sequelize=require(_0x50a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x50a2('0x1')]},'description':{'type':Sequelize[_0x50a2('0x1')]},'interval':{'type':Sequelize[_0x50a2('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x4e03=['STRING','sequelize'];(function(_0x11c60a,_0x2f40ac){var _0x5b1ee0=function(_0x5a1715){while(--_0x5a1715){_0x11c60a['push'](_0x11c60a['shift']());}};_0x5b1ee0(++_0x2f40ac);}(_0x4e03,0x69));var _0x34e0=function(_0x4085c4,_0x159051){_0x4085c4=_0x4085c4-0x0;var _0x3f11cf=_0x4e03[_0x4085c4];return _0x3f11cf;};'use strict';var Sequelize=require(_0x34e0('0x0'));module['exports']={'name':{'type':Sequelize[_0x34e0('0x1')]},'description':{'type':Sequelize[_0x34e0('0x1')]},'interval':{'type':Sequelize[_0x34e0('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 6dc57d2..eae79f8 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 _0x5c31=['../../config/logger','api','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','Intervals','UserProfileResource','destroy','end','error','stack','name','send','index','map','Interval','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','getIntervals','findOne','filters','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','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','../../components/parsers/advancedSearch'];(function(_0xba64d8,_0x30a1dc){var _0x49c9bb=function(_0x47f39e){while(--_0x47f39e){_0xba64d8['push'](_0xba64d8['shift']());}};_0x49c9bb(++_0x30a1dc);}(_0x5c31,0x157));var _0x15c3=function(_0x1933fc,_0x379b78){_0x1933fc=_0x1933fc-0x0;var _0x40d74e=_0x5c31[_0x1933fc];return _0x40d74e;};'use strict';var emlformat=require(_0x15c3('0x0'));var rimraf=require(_0x15c3('0x1'));var zipdir=require(_0x15c3('0x2'));var jsonpatch=require(_0x15c3('0x3'));var rp=require('request-promise');var moment=require(_0x15c3('0x4'));var BPromise=require(_0x15c3('0x5'));var Mustache=require(_0x15c3('0x6'));var util=require(_0x15c3('0x7'));var path=require(_0x15c3('0x8'));var sox=require(_0x15c3('0x9'));var csv=require(_0x15c3('0xa'));var ejs=require(_0x15c3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15c3('0xc'));var squel=require(_0x15c3('0xd'));var crypto=require(_0x15c3('0xe'));var jsforce=require(_0x15c3('0xf'));var deskjs=require(_0x15c3('0x10'));var toCsv=require(_0x15c3('0xa'));var querystring=require(_0x15c3('0x11'));var Papa=require(_0x15c3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15c3('0x13'));var as=require(_0x15c3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15c3('0x15'))(_0x15c3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x15c3('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5112e8,_0xf45ef1){_0xf45ef1=_0xf45ef1||0xcc;return function(_0x17a72d){if(_0x17a72d){return _0x5112e8[_0x15c3('0x18')](_0xf45ef1);}return _0x5112e8[_0x15c3('0x19')](_0xf45ef1)['end']();};}function respondWithResult(_0x21c75c,_0x3c888b){_0x3c888b=_0x3c888b||0xc8;return function(_0x53c054){if(_0x53c054){return _0x21c75c['status'](_0x3c888b)['json'](_0x53c054);}};}function respondWithFilteredResult(_0xd42243,_0x403b8c){return function(_0xf042d9){if(_0xf042d9){var _0xf11d69=typeof _0x403b8c[_0x15c3('0x1a')]===_0x15c3('0x1b')&&typeof _0x403b8c[_0x15c3('0x1c')]===_0x15c3('0x1b');var _0x1c42e9=_0xf042d9[_0x15c3('0x1d')];var _0x41fad2=_0xf11d69?0x0:_0x403b8c['offset'];var _0x124e83=_0xf11d69?_0xf042d9[_0x15c3('0x1d')]:_0x403b8c[_0x15c3('0x1a')]+_0x403b8c[_0x15c3('0x1c')];var _0xecb97d;if(_0x124e83>=_0x1c42e9){_0x124e83=_0x1c42e9;_0xecb97d=0xc8;}else{_0xecb97d=0xce;}_0xd42243[_0x15c3('0x19')](_0xecb97d);return _0xd42243[_0x15c3('0x1e')](_0x15c3('0x1f'),_0x41fad2+'-'+_0x124e83+'/'+_0x1c42e9)[_0x15c3('0x20')](_0xf042d9);}return null;};}function patchUpdates(_0x38efce){return function(_0x1c833b){try{jsonpatch['apply'](_0x1c833b,_0x38efce,!![]);}catch(_0x51b453){return BPromise[_0x15c3('0x21')](_0x51b453);}return _0x1c833b[_0x15c3('0x22')]();};}function saveUpdates(_0x414449,_0x53d2ae){return function(_0x518f56){if(_0x518f56){return _0x518f56[_0x15c3('0x23')](_0x414449)[_0x15c3('0x24')](function(_0xdf357b){return _0xdf357b;});}return null;};}function removeEntity(_0x43280a,_0x5aa6b9){return function(_0x5eee79){if(_0x5eee79){return _0x5eee79['destroy']()[_0x15c3('0x24')](function(){var _0x2bf610=_0x5eee79['get']({'plain':!![]});var _0x4440d2=_0x15c3('0x25');return db[_0x15c3('0x26')][_0x15c3('0x27')]({'where':{'type':_0x4440d2,'resourceId':_0x2bf610['id']}})[_0x15c3('0x24')](function(){return _0x5eee79;});})[_0x15c3('0x24')](function(){_0x43280a['status'](0xcc)[_0x15c3('0x28')]();});}};}function handleEntityNotFound(_0x3fd078,_0x14ba39){return function(_0x3458b2){if(!_0x3458b2){_0x3fd078[_0x15c3('0x18')](0x194);}return _0x3458b2;};}function handleError(_0x25729c,_0x268f4f){_0x268f4f=_0x268f4f||0x1f4;return function(_0x3f0cfc){logger[_0x15c3('0x29')](_0x3f0cfc[_0x15c3('0x2a')]);if(_0x3f0cfc[_0x15c3('0x2b')]){delete _0x3f0cfc[_0x15c3('0x2b')];}_0x25729c[_0x15c3('0x19')](_0x268f4f)[_0x15c3('0x2c')](_0x3f0cfc);};}exports[_0x15c3('0x2d')]=function(_0x15d241,_0x116059){var _0x2d644e={},_0x308ac9={},_0x4d1ed8={'count':0x0,'rows':[]};var _0x5e7d99=_[_0x15c3('0x2e')](db[_0x15c3('0x2f')][_0x15c3('0x30')],function(_0x427517){return{'name':_0x427517['fieldName'],'type':_0x427517[_0x15c3('0x31')]['key']};});_0x308ac9[_0x15c3('0x32')]=_['map'](_0x5e7d99,'name');_0x308ac9[_0x15c3('0x33')]=_[_0x15c3('0x34')](_0x15d241['query']);_0x308ac9['filters']=_[_0x15c3('0x35')](_0x308ac9[_0x15c3('0x32')],_0x308ac9[_0x15c3('0x33')]);_0x2d644e['attributes']=_[_0x15c3('0x35')](_0x308ac9[_0x15c3('0x32')],qs[_0x15c3('0x36')](_0x15d241['query'][_0x15c3('0x36')]));_0x2d644e[_0x15c3('0x37')]=_0x2d644e[_0x15c3('0x37')][_0x15c3('0x38')]?_0x2d644e[_0x15c3('0x37')]:_0x308ac9[_0x15c3('0x32')];if(!_0x15d241['query']['hasOwnProperty'](_0x15c3('0x39'))){_0x2d644e[_0x15c3('0x1c')]=qs['limit'](_0x15d241[_0x15c3('0x33')]['limit']);_0x2d644e['offset']=qs[_0x15c3('0x1a')](_0x15d241[_0x15c3('0x33')][_0x15c3('0x1a')]);}_0x2d644e['order']=qs['sort'](_0x15d241[_0x15c3('0x33')][_0x15c3('0x3a')]);_0x2d644e[_0x15c3('0x3b')]=qs['filters'](_[_0x15c3('0x3c')](_0x15d241[_0x15c3('0x33')],_0x308ac9['filters']),_0x5e7d99);if(_0x15d241[_0x15c3('0x33')][_0x15c3('0x3d')]){_0x2d644e['where']=_[_0x15c3('0x3e')](_0x2d644e[_0x15c3('0x3b')],{'$or':_[_0x15c3('0x2e')](_0x5e7d99,function(_0x23e231){if(_0x23e231[_0x15c3('0x31')]!==_0x15c3('0x3f')){var _0x41a5da={};_0x41a5da[_0x23e231[_0x15c3('0x2b')]]={'$like':'%'+_0x15d241[_0x15c3('0x33')]['filter']+'%'};return _0x41a5da;}})});}_0x2d644e=_[_0x15c3('0x3e')]({},_0x2d644e,_0x15d241['options']);var _0x4b4d84={'where':_0x2d644e[_0x15c3('0x3b')]};return db[_0x15c3('0x2f')][_0x15c3('0x1d')](_0x4b4d84)[_0x15c3('0x24')](function(_0x10661a){_0x4d1ed8[_0x15c3('0x1d')]=_0x10661a;if(_0x15d241[_0x15c3('0x33')][_0x15c3('0x40')]){_0x2d644e[_0x15c3('0x41')]=[{'all':!![]}];}return db[_0x15c3('0x2f')]['findAll'](_0x2d644e);})[_0x15c3('0x24')](function(_0x3b7061){_0x4d1ed8[_0x15c3('0x42')]=_0x3b7061;return _0x4d1ed8;})['then'](respondWithFilteredResult(_0x116059,_0x2d644e))['catch'](handleError(_0x116059,null));};exports[_0x15c3('0x43')]=function(_0x247bdf,_0x2ef55f){var _0x107ff0={'raw':!![],'where':{'id':_0x247bdf[_0x15c3('0x44')]['id']}},_0x84d58f={};_0x84d58f['model']=_['keys'](db[_0x15c3('0x2f')][_0x15c3('0x30')]);_0x84d58f[_0x15c3('0x33')]=_[_0x15c3('0x34')](_0x247bdf['query']);_0x84d58f['filters']=_[_0x15c3('0x35')](_0x84d58f[_0x15c3('0x32')],_0x84d58f['query']);_0x107ff0[_0x15c3('0x37')]=_['intersection'](_0x84d58f['model'],qs[_0x15c3('0x36')](_0x247bdf[_0x15c3('0x33')][_0x15c3('0x36')]));_0x107ff0[_0x15c3('0x37')]=_0x107ff0[_0x15c3('0x37')][_0x15c3('0x38')]?_0x107ff0['attributes']:_0x84d58f[_0x15c3('0x32')];if(_0x247bdf['query'][_0x15c3('0x40')]){_0x107ff0['include']=[{'all':!![]}];}_0x107ff0=_[_0x15c3('0x3e')]({},_0x107ff0,_0x247bdf[_0x15c3('0x45')]);return db[_0x15c3('0x2f')][_0x15c3('0x46')](_0x107ff0)[_0x15c3('0x24')](handleEntityNotFound(_0x2ef55f,null))[_0x15c3('0x24')](respondWithResult(_0x2ef55f,null))[_0x15c3('0x47')](handleError(_0x2ef55f,null));};exports[_0x15c3('0x48')]=function(_0x32d47f,_0x3add86){return db[_0x15c3('0x2f')][_0x15c3('0x48')](_0x32d47f['body'],{})[_0x15c3('0x24')](function(_0x36a41c){var _0x431773=_0x32d47f[_0x15c3('0x49')][_0x15c3('0x4a')]({'plain':!![]});if(!_0x431773)throw new Error(_0x15c3('0x4b'));if(_0x431773[_0x15c3('0x4c')]===_0x15c3('0x49')){var _0xe35f50=_0x36a41c[_0x15c3('0x4a')]({'plain':!![]});var _0x337ffc=_0x15c3('0x25');return db['UserProfileSection'][_0x15c3('0x46')]({'where':{'name':_0x337ffc,'userProfileId':_0x431773[_0x15c3('0x4d')]},'raw':!![]})['then'](function(_0x42721f){if(_0x42721f&&_0x42721f[_0x15c3('0x4e')]===0x0){return db[_0x15c3('0x26')]['create']({'name':_0xe35f50['name'],'resourceId':_0xe35f50['id'],'type':_0x42721f[_0x15c3('0x2b')],'sectionId':_0x42721f['id']},{})[_0x15c3('0x24')](function(){return _0x36a41c;});}else{return _0x36a41c;}})[_0x15c3('0x47')](function(_0xa746a5){logger[_0x15c3('0x29')](_0x15c3('0x4f'),_0xa746a5);throw _0xa746a5;});}return _0x36a41c;})[_0x15c3('0x24')](respondWithResult(_0x3add86,0xc9))['catch'](handleError(_0x3add86,null));};exports['update']=function(_0x1cc48c,_0x25efd9){if(_0x1cc48c['body']['id']){delete _0x1cc48c[_0x15c3('0x50')]['id'];}return db[_0x15c3('0x2f')][_0x15c3('0x46')]({'where':{'id':_0x1cc48c[_0x15c3('0x44')]['id']}})[_0x15c3('0x24')](handleEntityNotFound(_0x25efd9,null))[_0x15c3('0x24')](saveUpdates(_0x1cc48c[_0x15c3('0x50')],null))[_0x15c3('0x24')](respondWithResult(_0x25efd9,null))['catch'](handleError(_0x25efd9,null));};exports[_0x15c3('0x27')]=function(_0x43b921,_0x4af0a0){return db[_0x15c3('0x2f')][_0x15c3('0x46')]({'where':{'id':_0x43b921[_0x15c3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4af0a0,null))[_0x15c3('0x24')](removeEntity(_0x4af0a0,null))[_0x15c3('0x47')](handleError(_0x4af0a0,null));};exports['addInterval']=function(_0x4c3a12,_0x59e3de,_0x4ee2b6){if(_0x4c3a12[_0x15c3('0x50')]['id']){delete _0x4c3a12[_0x15c3('0x50')]['id'];}return db[_0x15c3('0x2f')][_0x15c3('0x46')]({'where':{'id':_0x4c3a12[_0x15c3('0x44')]['id']}})['then'](handleEntityNotFound(_0x59e3de,null))[_0x15c3('0x24')](function(_0x337eb0){if(_0x337eb0){_0x4c3a12[_0x15c3('0x50')][_0x15c3('0x51')]=_0x337eb0['id'];return db[_0x15c3('0x2f')][_0x15c3('0x48')](_0x4c3a12['body']);}})[_0x15c3('0x24')](respondWithResult(_0x59e3de,null))[_0x15c3('0x47')](handleError(_0x59e3de,null));};exports[_0x15c3('0x52')]=function(_0x142923,_0x5af5e3,_0x38099b){var _0x5a913c={};var _0x3752e4={};var _0xb0b3c0;var _0x48dc3b;return db[_0x15c3('0x2f')][_0x15c3('0x53')]({'where':{'id':_0x142923['params']['id']}})['then'](handleEntityNotFound(_0x5af5e3,null))[_0x15c3('0x24')](function(_0x42e64a){if(_0x42e64a){_0xb0b3c0=_0x42e64a;_0x3752e4[_0x15c3('0x32')]=_['keys'](db[_0x15c3('0x2f')][_0x15c3('0x30')]);_0x3752e4[_0x15c3('0x33')]=_[_0x15c3('0x34')](_0x142923[_0x15c3('0x33')]);_0x3752e4['filters']=_[_0x15c3('0x35')](_0x3752e4[_0x15c3('0x32')],_0x3752e4[_0x15c3('0x33')]);_0x5a913c[_0x15c3('0x37')]=_[_0x15c3('0x35')](_0x3752e4[_0x15c3('0x32')],qs[_0x15c3('0x36')](_0x142923[_0x15c3('0x33')]['fields']));_0x5a913c[_0x15c3('0x37')]=_0x5a913c['attributes']['length']?_0x5a913c[_0x15c3('0x37')]:_0x3752e4[_0x15c3('0x32')];_0x5a913c['order']=qs[_0x15c3('0x3a')](_0x142923['query'][_0x15c3('0x3a')]);_0x5a913c[_0x15c3('0x3b')]=qs[_0x15c3('0x54')](_[_0x15c3('0x3c')](_0x142923[_0x15c3('0x33')],_0x3752e4[_0x15c3('0x54')]));if(_0x142923[_0x15c3('0x33')]['filter']){_0x5a913c[_0x15c3('0x3b')]=_[_0x15c3('0x3e')](_0x5a913c['where'],{'$or':_[_0x15c3('0x2e')](_0x5a913c[_0x15c3('0x37')],function(_0xb9f1f6){var _0x487c10={};_0x487c10[_0xb9f1f6]={'$like':'%'+_0x142923[_0x15c3('0x33')][_0x15c3('0x3d')]+'%'};return _0x487c10;})});}_0x5a913c=_[_0x15c3('0x3e')]({},_0x5a913c,_0x142923[_0x15c3('0x45')]);return _0xb0b3c0[_0x15c3('0x52')](_0x5a913c);}})['then'](function(_0x7c4295){if(_0x7c4295){_0x48dc3b=_0x7c4295[_0x15c3('0x38')];if(!_0x142923[_0x15c3('0x33')][_0x15c3('0x55')](_0x15c3('0x39'))){_0x5a913c[_0x15c3('0x1c')]=qs[_0x15c3('0x1c')](_0x142923[_0x15c3('0x33')]['limit']);_0x5a913c['offset']=qs['offset'](_0x142923[_0x15c3('0x33')]['offset']);}return _0xb0b3c0[_0x15c3('0x52')](_0x5a913c);}})['then'](function(_0x104c3e){if(_0x104c3e){return _0x104c3e?{'count':_0x48dc3b,'rows':_0x104c3e}:null;}})[_0x15c3('0x24')](respondWithResult(_0x5af5e3,null))[_0x15c3('0x47')](handleError(_0x5af5e3,null));};exports[_0x15c3('0x56')]=function(_0x560a10,_0x347909,_0x173fb6){return db['Interval'][_0x15c3('0x53')]({'where':{'id':_0x560a10[_0x15c3('0x44')]['id']}})['then'](handleEntityNotFound(_0x347909,null))[_0x15c3('0x24')](function(_0x1963e4){if(_0x1963e4){return db[_0x15c3('0x57')][_0x15c3('0x58')](function(_0x191f9f){return db[_0x15c3('0x2f')][_0x15c3('0x27')]({'where':{'IntervalId':_0x560a10[_0x15c3('0x44')]['id']},'transaction':_0x191f9f})[_0x15c3('0x24')](function(_0x276091){var _0x57b89a=_[_0x15c3('0x2e')](_0x560a10[_0x15c3('0x50')],function(_0xbf322){delete _0xbf322['id'];_0xbf322[_0x15c3('0x51')]=_0x560a10[_0x15c3('0x44')]['id'];return _0xbf322;});return db['Interval'][_0x15c3('0x59')](_0x57b89a,{'transaction':_0x191f9f});});})['then'](function(){return db[_0x15c3('0x2f')][_0x15c3('0x5a')]({'where':{'IntervalId':_0x560a10[_0x15c3('0x44')]['id']}});});}})[_0x15c3('0x24')](respondWithResult(_0x347909,null))['catch'](handleError(_0x347909,null));}; \ No newline at end of file +var _0xd7b3=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','getIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Interval','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId'];(function(_0x52f59,_0x6cc06){var _0x35d88f=function(_0x50b506){while(--_0x50b506){_0x52f59['push'](_0x52f59['shift']());}};_0x35d88f(++_0x6cc06);}(_0xd7b3,0xcf));var _0x3d7b=function(_0x3f3c46,_0x33e972){_0x3f3c46=_0x3f3c46-0x0;var _0x7d1132=_0xd7b3[_0x3f3c46];return _0x7d1132;};'use strict';var emlformat=require(_0x3d7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d7b('0x1'));var jsonpatch=require(_0x3d7b('0x2'));var rp=require(_0x3d7b('0x3'));var moment=require(_0x3d7b('0x4'));var BPromise=require(_0x3d7b('0x5'));var Mustache=require(_0x3d7b('0x6'));var util=require('util');var path=require(_0x3d7b('0x7'));var sox=require(_0x3d7b('0x8'));var csv=require(_0x3d7b('0x9'));var ejs=require(_0x3d7b('0xa'));var fs=require('fs');var fs_extra=require(_0x3d7b('0xb'));var _=require(_0x3d7b('0xc'));var squel=require('squel');var crypto=require(_0x3d7b('0xd'));var jsforce=require(_0x3d7b('0xe'));var deskjs=require(_0x3d7b('0xf'));var toCsv=require(_0x3d7b('0x9'));var querystring=require(_0x3d7b('0x10'));var Papa=require(_0x3d7b('0x11'));var Redis=require(_0x3d7b('0x12'));var authService=require(_0x3d7b('0x13'));var qs=require(_0x3d7b('0x14'));var as=require(_0x3d7b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d7b('0x16'))(_0x3d7b('0x17'));var utils=require(_0x3d7b('0x18'));var config=require(_0x3d7b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d7b('0x1a'))['db'];var extensions=require(_0x3d7b('0x1b'));function respondWithStatusCode(_0x389997,_0x2aeab1){_0x2aeab1=_0x2aeab1||0xcc;return function(_0x4c886a){if(_0x4c886a){return _0x389997[_0x3d7b('0x1c')](_0x2aeab1);}return _0x389997[_0x3d7b('0x1d')](_0x2aeab1)[_0x3d7b('0x1e')]();};}function respondWithResult(_0x4316ee,_0x1d7511){_0x1d7511=_0x1d7511||0xc8;return function(_0x44ff48){if(_0x44ff48){return _0x4316ee['status'](_0x1d7511)['json'](_0x44ff48);}};}function respondWithFilteredResult(_0x368098,_0x4b933c){return function(_0x265773){if(_0x265773){var _0x33fa3a=typeof _0x4b933c['offset']===_0x3d7b('0x1f')&&typeof _0x4b933c[_0x3d7b('0x20')]===_0x3d7b('0x1f');var _0x3cea8a=_0x265773[_0x3d7b('0x21')];var _0x30c82f=_0x33fa3a?0x0:_0x4b933c['offset'];var _0x963f08=_0x33fa3a?_0x265773[_0x3d7b('0x21')]:_0x4b933c[_0x3d7b('0x22')]+_0x4b933c[_0x3d7b('0x20')];var _0x23609b;if(_0x963f08>=_0x3cea8a){_0x963f08=_0x3cea8a;_0x23609b=0xc8;}else{_0x23609b=0xce;}_0x368098[_0x3d7b('0x1d')](_0x23609b);return _0x368098[_0x3d7b('0x23')](_0x3d7b('0x24'),_0x30c82f+'-'+_0x963f08+'/'+_0x3cea8a)[_0x3d7b('0x25')](_0x265773);}return null;};}function patchUpdates(_0x58bc25){return function(_0x1b7979){try{jsonpatch[_0x3d7b('0x26')](_0x1b7979,_0x58bc25,!![]);}catch(_0x90cade){return BPromise[_0x3d7b('0x27')](_0x90cade);}return _0x1b7979[_0x3d7b('0x28')]();};}function saveUpdates(_0x293d64,_0x4da6f4){return function(_0x40cc9b){if(_0x40cc9b){return _0x40cc9b[_0x3d7b('0x29')](_0x293d64)[_0x3d7b('0x2a')](function(_0x407635){return _0x407635;});}return null;};}function removeEntity(_0x1f6dec,_0x1ab97d){return function(_0x415945){if(_0x415945){return _0x415945['destroy']()['then'](function(){var _0x1faf6c=_0x415945[_0x3d7b('0x2b')]({'plain':!![]});var _0x30bef3=_0x3d7b('0x2c');return db[_0x3d7b('0x2d')][_0x3d7b('0x2e')]({'where':{'type':_0x30bef3,'resourceId':_0x1faf6c['id']}})[_0x3d7b('0x2a')](function(){return _0x415945;});})[_0x3d7b('0x2a')](function(){_0x1f6dec['status'](0xcc)[_0x3d7b('0x1e')]();});}};}function handleEntityNotFound(_0x2fb9de,_0x2f6048){return function(_0xd8d261){if(!_0xd8d261){_0x2fb9de[_0x3d7b('0x1c')](0x194);}return _0xd8d261;};}function handleError(_0x5c21e3,_0x391efa){_0x391efa=_0x391efa||0x1f4;return function(_0x56a1f4){logger['error'](_0x56a1f4[_0x3d7b('0x2f')]);if(_0x56a1f4[_0x3d7b('0x30')]){delete _0x56a1f4[_0x3d7b('0x30')];}_0x5c21e3['status'](_0x391efa)[_0x3d7b('0x31')](_0x56a1f4);};}exports[_0x3d7b('0x32')]=function(_0x40681c,_0x11972c){var _0x25ee2f={},_0x5d1c41={},_0x59ec3b={'count':0x0,'rows':[]};var _0x59e793=_[_0x3d7b('0x33')](db['Interval'][_0x3d7b('0x34')],function(_0x36393a){return{'name':_0x36393a[_0x3d7b('0x35')],'type':_0x36393a[_0x3d7b('0x36')][_0x3d7b('0x37')]};});_0x5d1c41['model']=_[_0x3d7b('0x33')](_0x59e793,_0x3d7b('0x30'));_0x5d1c41[_0x3d7b('0x38')]=_[_0x3d7b('0x39')](_0x40681c[_0x3d7b('0x38')]);_0x5d1c41[_0x3d7b('0x3a')]=_[_0x3d7b('0x3b')](_0x5d1c41[_0x3d7b('0x3c')],_0x5d1c41[_0x3d7b('0x38')]);_0x25ee2f[_0x3d7b('0x3d')]=_[_0x3d7b('0x3b')](_0x5d1c41[_0x3d7b('0x3c')],qs[_0x3d7b('0x3e')](_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x3e')]));_0x25ee2f['attributes']=_0x25ee2f['attributes']['length']?_0x25ee2f['attributes']:_0x5d1c41[_0x3d7b('0x3c')];if(!_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x3f')](_0x3d7b('0x40'))){_0x25ee2f[_0x3d7b('0x20')]=qs[_0x3d7b('0x20')](_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x20')]);_0x25ee2f['offset']=qs[_0x3d7b('0x22')](_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x22')]);}_0x25ee2f['order']=qs[_0x3d7b('0x41')](_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x41')]);_0x25ee2f[_0x3d7b('0x42')]=qs[_0x3d7b('0x3a')](_[_0x3d7b('0x43')](_0x40681c[_0x3d7b('0x38')],_0x5d1c41['filters']),_0x59e793);if(_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x44')]){_0x25ee2f[_0x3d7b('0x42')]=_['merge'](_0x25ee2f[_0x3d7b('0x42')],{'$or':_[_0x3d7b('0x33')](_0x59e793,function(_0x94a147){if(_0x94a147[_0x3d7b('0x36')]!==_0x3d7b('0x45')){var _0x3b97d5={};_0x3b97d5[_0x94a147['name']]={'$like':'%'+_0x40681c['query']['filter']+'%'};return _0x3b97d5;}})});}_0x25ee2f=_[_0x3d7b('0x46')]({},_0x25ee2f,_0x40681c[_0x3d7b('0x47')]);var _0x518e4c={'where':_0x25ee2f['where']};return db[_0x3d7b('0x48')]['count'](_0x518e4c)[_0x3d7b('0x2a')](function(_0x283204){_0x59ec3b[_0x3d7b('0x21')]=_0x283204;if(_0x40681c[_0x3d7b('0x38')][_0x3d7b('0x49')]){_0x25ee2f[_0x3d7b('0x4a')]=[{'all':!![]}];}return db['Interval'][_0x3d7b('0x4b')](_0x25ee2f);})[_0x3d7b('0x2a')](function(_0x3ca310){_0x59ec3b[_0x3d7b('0x4c')]=_0x3ca310;return _0x59ec3b;})[_0x3d7b('0x2a')](respondWithFilteredResult(_0x11972c,_0x25ee2f))[_0x3d7b('0x4d')](handleError(_0x11972c,null));};exports[_0x3d7b('0x4e')]=function(_0x199eab,_0x207cad){var _0x7090d8={'raw':!![],'where':{'id':_0x199eab[_0x3d7b('0x4f')]['id']}},_0x19151a={};_0x19151a[_0x3d7b('0x3c')]=_[_0x3d7b('0x39')](db[_0x3d7b('0x48')][_0x3d7b('0x34')]);_0x19151a[_0x3d7b('0x38')]=_[_0x3d7b('0x39')](_0x199eab[_0x3d7b('0x38')]);_0x19151a[_0x3d7b('0x3a')]=_[_0x3d7b('0x3b')](_0x19151a['model'],_0x19151a[_0x3d7b('0x38')]);_0x7090d8[_0x3d7b('0x3d')]=_['intersection'](_0x19151a['model'],qs[_0x3d7b('0x3e')](_0x199eab['query'][_0x3d7b('0x3e')]));_0x7090d8[_0x3d7b('0x3d')]=_0x7090d8['attributes'][_0x3d7b('0x50')]?_0x7090d8[_0x3d7b('0x3d')]:_0x19151a[_0x3d7b('0x3c')];if(_0x199eab[_0x3d7b('0x38')][_0x3d7b('0x49')]){_0x7090d8[_0x3d7b('0x4a')]=[{'all':!![]}];}_0x7090d8=_[_0x3d7b('0x46')]({},_0x7090d8,_0x199eab[_0x3d7b('0x47')]);return db['Interval']['find'](_0x7090d8)[_0x3d7b('0x2a')](handleEntityNotFound(_0x207cad,null))[_0x3d7b('0x2a')](respondWithResult(_0x207cad,null))[_0x3d7b('0x4d')](handleError(_0x207cad,null));};exports[_0x3d7b('0x51')]=function(_0x316bd8,_0x1b5c6f){return db[_0x3d7b('0x48')][_0x3d7b('0x51')](_0x316bd8[_0x3d7b('0x52')],{})[_0x3d7b('0x2a')](function(_0x44c569){var _0x2faecb=_0x316bd8[_0x3d7b('0x53')][_0x3d7b('0x2b')]({'plain':!![]});if(!_0x2faecb)throw new Error(_0x3d7b('0x54'));if(_0x2faecb[_0x3d7b('0x55')]===_0x3d7b('0x53')){var _0x487942=_0x44c569[_0x3d7b('0x2b')]({'plain':!![]});var _0x5806af='Intervals';return db['UserProfileSection']['find']({'where':{'name':_0x5806af,'userProfileId':_0x2faecb[_0x3d7b('0x56')]},'raw':!![]})[_0x3d7b('0x2a')](function(_0x43de90){if(_0x43de90&&_0x43de90[_0x3d7b('0x57')]===0x0){return db[_0x3d7b('0x2d')][_0x3d7b('0x51')]({'name':_0x487942[_0x3d7b('0x30')],'resourceId':_0x487942['id'],'type':_0x43de90[_0x3d7b('0x30')],'sectionId':_0x43de90['id']},{})[_0x3d7b('0x2a')](function(){return _0x44c569;});}else{return _0x44c569;}})[_0x3d7b('0x4d')](function(_0x497143){logger[_0x3d7b('0x58')](_0x3d7b('0x59'),_0x497143);throw _0x497143;});}return _0x44c569;})['then'](respondWithResult(_0x1b5c6f,0xc9))[_0x3d7b('0x4d')](handleError(_0x1b5c6f,null));};exports[_0x3d7b('0x29')]=function(_0x35cd17,_0x189ba7){if(_0x35cd17[_0x3d7b('0x52')]['id']){delete _0x35cd17['body']['id'];}return db['Interval'][_0x3d7b('0x5a')]({'where':{'id':_0x35cd17[_0x3d7b('0x4f')]['id']}})[_0x3d7b('0x2a')](handleEntityNotFound(_0x189ba7,null))['then'](saveUpdates(_0x35cd17['body'],null))['then'](respondWithResult(_0x189ba7,null))[_0x3d7b('0x4d')](handleError(_0x189ba7,null));};exports[_0x3d7b('0x2e')]=function(_0x429bee,_0x2addf1){return db['Interval'][_0x3d7b('0x5a')]({'where':{'id':_0x429bee[_0x3d7b('0x4f')]['id']}})[_0x3d7b('0x2a')](handleEntityNotFound(_0x2addf1,null))[_0x3d7b('0x2a')](removeEntity(_0x2addf1,null))[_0x3d7b('0x4d')](handleError(_0x2addf1,null));};exports[_0x3d7b('0x5b')]=function(_0x8723b2,_0x11dcd0,_0x2cac6b){if(_0x8723b2[_0x3d7b('0x52')]['id']){delete _0x8723b2[_0x3d7b('0x52')]['id'];}return db['Interval'][_0x3d7b('0x5a')]({'where':{'id':_0x8723b2[_0x3d7b('0x4f')]['id']}})[_0x3d7b('0x2a')](handleEntityNotFound(_0x11dcd0,null))[_0x3d7b('0x2a')](function(_0x3359b2){if(_0x3359b2){_0x8723b2['body']['IntervalId']=_0x3359b2['id'];return db['Interval'][_0x3d7b('0x51')](_0x8723b2[_0x3d7b('0x52')]);}})[_0x3d7b('0x2a')](respondWithResult(_0x11dcd0,null))[_0x3d7b('0x4d')](handleError(_0x11dcd0,null));};exports[_0x3d7b('0x5c')]=function(_0x4e80de,_0xab961f,_0x803f24){var _0x13043d={};var _0x1b9a70={};var _0xb875b9;var _0x48ae34;return db[_0x3d7b('0x48')][_0x3d7b('0x5d')]({'where':{'id':_0x4e80de[_0x3d7b('0x4f')]['id']}})[_0x3d7b('0x2a')](handleEntityNotFound(_0xab961f,null))[_0x3d7b('0x2a')](function(_0x4fceb7){if(_0x4fceb7){_0xb875b9=_0x4fceb7;_0x1b9a70['model']=_['keys'](db['Interval']['rawAttributes']);_0x1b9a70['query']=_[_0x3d7b('0x39')](_0x4e80de[_0x3d7b('0x38')]);_0x1b9a70[_0x3d7b('0x3a')]=_[_0x3d7b('0x3b')](_0x1b9a70['model'],_0x1b9a70[_0x3d7b('0x38')]);_0x13043d[_0x3d7b('0x3d')]=_['intersection'](_0x1b9a70['model'],qs['fields'](_0x4e80de[_0x3d7b('0x38')]['fields']));_0x13043d[_0x3d7b('0x3d')]=_0x13043d[_0x3d7b('0x3d')][_0x3d7b('0x50')]?_0x13043d[_0x3d7b('0x3d')]:_0x1b9a70[_0x3d7b('0x3c')];_0x13043d['order']=qs[_0x3d7b('0x41')](_0x4e80de[_0x3d7b('0x38')][_0x3d7b('0x41')]);_0x13043d[_0x3d7b('0x42')]=qs['filters'](_[_0x3d7b('0x43')](_0x4e80de['query'],_0x1b9a70['filters']));if(_0x4e80de['query'][_0x3d7b('0x44')]){_0x13043d['where']=_['merge'](_0x13043d[_0x3d7b('0x42')],{'$or':_[_0x3d7b('0x33')](_0x13043d[_0x3d7b('0x3d')],function(_0x1167dd){var _0x3a9ca1={};_0x3a9ca1[_0x1167dd]={'$like':'%'+_0x4e80de['query'][_0x3d7b('0x44')]+'%'};return _0x3a9ca1;})});}_0x13043d=_[_0x3d7b('0x46')]({},_0x13043d,_0x4e80de[_0x3d7b('0x47')]);return _0xb875b9[_0x3d7b('0x5c')](_0x13043d);}})[_0x3d7b('0x2a')](function(_0x4ed798){if(_0x4ed798){_0x48ae34=_0x4ed798[_0x3d7b('0x50')];if(!_0x4e80de[_0x3d7b('0x38')]['hasOwnProperty']('nolimit')){_0x13043d[_0x3d7b('0x20')]=qs[_0x3d7b('0x20')](_0x4e80de[_0x3d7b('0x38')][_0x3d7b('0x20')]);_0x13043d[_0x3d7b('0x22')]=qs['offset'](_0x4e80de[_0x3d7b('0x38')][_0x3d7b('0x22')]);}return _0xb875b9[_0x3d7b('0x5c')](_0x13043d);}})[_0x3d7b('0x2a')](function(_0xb24b29){if(_0xb24b29){return _0xb24b29?{'count':_0x48ae34,'rows':_0xb24b29}:null;}})['then'](respondWithResult(_0xab961f,null))[_0x3d7b('0x4d')](handleError(_0xab961f,null));};exports['addIntervals']=function(_0x23f9a3,_0x47c29e,_0x5d93a9){return db[_0x3d7b('0x48')][_0x3d7b('0x5d')]({'where':{'id':_0x23f9a3[_0x3d7b('0x4f')]['id']}})[_0x3d7b('0x2a')](handleEntityNotFound(_0x47c29e,null))[_0x3d7b('0x2a')](function(_0x54ea8e){if(_0x54ea8e){return db[_0x3d7b('0x5e')][_0x3d7b('0x5f')](function(_0x322750){return db[_0x3d7b('0x48')][_0x3d7b('0x2e')]({'where':{'IntervalId':_0x23f9a3[_0x3d7b('0x4f')]['id']},'transaction':_0x322750})['then'](function(_0x2feb46){var _0x575fe2=_[_0x3d7b('0x33')](_0x23f9a3[_0x3d7b('0x52')],function(_0x2bac99){delete _0x2bac99['id'];_0x2bac99[_0x3d7b('0x60')]=_0x23f9a3[_0x3d7b('0x4f')]['id'];return _0x2bac99;});return db['Interval'][_0x3d7b('0x61')](_0x575fe2,{'transaction':_0x322750});});})[_0x3d7b('0x2a')](function(){return db['Interval'][_0x3d7b('0x4b')]({'where':{'IntervalId':_0x23f9a3['params']['id']}});});}})[_0x3d7b('0x2a')](respondWithResult(_0x47c29e,null))['catch'](handleError(_0x47c29e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 230b7f2..5179b8a 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 _0xd897=['exports','Interval','rewrite','util','../../config/logger','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x3d3cd4,_0x164263){var _0x70d940=function(_0x1fda27){while(--_0x1fda27){_0x3d3cd4['push'](_0x3d3cd4['shift']());}};_0x70d940(++_0x164263);}(_0xd897,0xd5));var _0x7d89=function(_0x142826,_0x2cc21a){_0x142826=_0x142826-0x0;var _0x2379e3=_0xd897[_0x142826];return _0x2379e3;};'use strict';var _=require('lodash');var util=require(_0x7d89('0x0'));var logger=require(_0x7d89('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d89('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7d89('0x3'));var config=require(_0x7d89('0x4'));var attributes=require(_0x7d89('0x5'));var extensions=require(_0x7d89('0x6'));module[_0x7d89('0x7')]=function(_0x27f136,_0x4ef046){return _0x27f136['define'](_0x7d89('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x136e4e,_0xaf5c87){extensions[_0x7d89('0x9')](_0x27f136,_0x136e4e);},'afterBulkCreate':function(_0x374041,_0x4ae1b9,_0x3256b5){_0x3256b5();extensions[_0x7d89('0x9')](_0x27f136,_0x374041[0x0]);},'afterUpdate':function(_0x4d211b,_0x359178){extensions[_0x7d89('0x9')](_0x27f136,_0x4d211b);},'afterDestroy':function(_0x49a157,_0x2e8b01){extensions[_0x7d89('0x9')](_0x27f136,_0x49a157);}}});}; \ No newline at end of file +var _0xc16b=['rimraf','../../config/environment','./interval.attributes','exports','define','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x24e7b0,_0x23104f){var _0x1b09a1=function(_0xf17972){while(--_0xf17972){_0x24e7b0['push'](_0x24e7b0['shift']());}};_0x1b09a1(++_0x23104f);}(_0xc16b,0xca));var _0xbc16=function(_0x47145e,_0x33b375){_0x47145e=_0x47145e-0x0;var _0x54890d=_0xc16b[_0x47145e];return _0x54890d;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var logger=require(_0xbc16('0x2'))(_0xbc16('0x3'));var moment=require(_0xbc16('0x4'));var BPromise=require(_0xbc16('0x5'));var rp=require(_0xbc16('0x6'));var fs=require('fs');var path=require(_0xbc16('0x7'));var rimraf=require(_0xbc16('0x8'));var config=require(_0xbc16('0x9'));var attributes=require(_0xbc16('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0xbc16('0xb')]=function(_0x479e79,_0x5a7198){return _0x479e79[_0xbc16('0xc')](_0xbc16('0xd'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2230f4,_0xa8c379){extensions[_0xbc16('0xe')](_0x479e79,_0x2230f4);},'afterBulkCreate':function(_0x3099b5,_0xdff288,_0x308dd7){_0x308dd7();extensions[_0xbc16('0xe')](_0x479e79,_0x3099b5[0x0]);},'afterUpdate':function(_0x143c28,_0x48d451){extensions[_0xbc16('0xe')](_0x479e79,_0x143c28);},'afterDestroy':function(_0x5685bc,_0x39e3d2){extensions['rewrite'](_0x479e79,_0x5685bc);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index d212ce3..d287a5b 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 4969db2..7a09527 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x12ade5,_0x26fb5a){var _0x44f79e=function(_0x1fbca9){while(--_0x1fbca9){_0x12ade5['push'](_0x12ade5['shift']());}};_0x44f79e(++_0x26fb5a);}(_0x2032,0xd9));var _0x2203=function(_0x28f4ab,_0x5a6685){_0x28f4ab=_0x28f4ab-0x0;var _0x325b8f=_0x2032[_0x28f4ab];return _0x325b8f;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x13834b,_0x19e11e){var _0x3ae648=function(_0x463030){while(--_0x463030){_0x13834b['push'](_0x13834b['shift']());}};_0x3ae648(++_0x19e11e);}(_0xdb28,0x106));var _0x8db2=function(_0x1df3c5,_0x4ddaa5){_0x1df3c5=_0x1df3c5-0x0;var _0x2e2029=_0xdb28[_0x1df3c5];return _0x2e2029;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 672afd3..c2af859 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 _0xaf5f=['issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','data','end','status','json','error','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','support','key','summary','\x20from\x20','description'];(function(_0x25202e,_0x1becd2){var _0x3862f7=function(_0x362d65){while(--_0x362d65){_0x25202e['push'](_0x25202e['shift']());}};_0x3862f7(++_0x1becd2);}(_0xaf5f,0x101));var _0xfaf5=function(_0x984d39,_0x5890e0){_0x984d39=_0x984d39-0x0;var _0x595b10=_0xaf5f[_0x984d39];return _0x595b10;};'use strict';var BPromise=require(_0xfaf5('0x0'));var https=require(_0xfaf5('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0xfaf5('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x1c60b8,_0x32e28d){var _0x4525dc={'fields':{'project':{'key':_0x1c60b8[_0xfaf5('0x3')]||'MOTGUI'},'summary':(_0x1c60b8[_0xfaf5('0x4')]||'Report')+_0xfaf5('0x5')+_0x1c60b8['ip'],'description':_0x1c60b8[_0xfaf5('0x6')]||JSON['stringify'](_0x1c60b8),'issuetype':{'name':_0x1c60b8[_0xfaf5('0x7')]||_0xfaf5('0x8')}}};_0x4525dc[_0xfaf5('0x9')][_0xfaf5('0xa')]=_0x1c60b8[_0xfaf5('0xb')];_0x4525dc[_0xfaf5('0x9')][_0xfaf5('0xc')]=_0x1c60b8[_0xfaf5('0xd')];_0x4525dc[_0xfaf5('0x9')][_0xfaf5('0xe')]=_0x1c60b8[_0xfaf5('0xf')];_0x4525dc['fields'][_0xfaf5('0x10')]=_0x1c60b8[_0xfaf5('0x11')];_0x4525dc[_0xfaf5('0x9')]['customfield_11504']=_0x1c60b8[_0xfaf5('0x12')];_0x4525dc[_0xfaf5('0x9')][_0xfaf5('0x13')]=_0x1c60b8['ip'];var _0x594952={'host':_0xfaf5('0x14'),'port':0x1bb,'path':_0xfaf5('0x15'),'method':_0xfaf5('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xfaf5('0x17'),'Authorization':_0xfaf5('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xfaf5('0x19')](_0xfaf5('0x1a'))}};var _0x117f99=JSON[_0xfaf5('0x1b')](_0x4525dc);var _0x51fc2f=https[_0xfaf5('0x1c')](_0x594952,function(_0x44b5fa){_0x44b5fa[_0xfaf5('0x1d')]('utf8');var _0x1766ea='';_0x44b5fa['on'](_0xfaf5('0x1e'),function(_0x56308e){_0x1766ea+=_0x56308e;});_0x44b5fa['on'](_0xfaf5('0x1f'),function(){if(_0x32e28d){return _0x32e28d[_0xfaf5('0x20')](_0x44b5fa['statusCode'])[_0xfaf5('0x21')](JSON['parse'](_0x1766ea));}});});_0x51fc2f['on'](_0xfaf5('0x22'),function(_0x45d796){if(_0x32e28d){return _0x32e28d[_0xfaf5('0x20')](0x1f4)[_0xfaf5('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xfaf5('0x23')}]});}});_0x51fc2f[_0xfaf5('0x24')](_0x117f99);_0x51fc2f[_0xfaf5('0x1f')]();}exports[_0xfaf5('0x25')]=openIssue;exports['send']=function(_0x1af48b,_0x12dcd5){_0x1af48b[_0xfaf5('0x26')]['ip']=_0x1af48b[_0xfaf5('0x27')][_0xfaf5('0x28')]||_0x1af48b[_0xfaf5('0x29')][_0xfaf5('0x2a')]||_0x1af48b[_0xfaf5('0x2b')][_0xfaf5('0x2a')]||_0x1af48b['connection'][_0xfaf5('0x2b')]['remoteAddress'];return openIssue(_0x1af48b[_0xfaf5('0x26')],_0x12dcd5);}; \ No newline at end of file +var _0xd484=['customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','x-forwarded-for','remoteAddress','connection','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd484,0x1e9));var _0x4d48=function(_0x5a44e5,_0x127b88){_0x5a44e5=_0x5a44e5-0x0;var _0x15b1b4=_0xd484[_0x5a44e5];return _0x15b1b4;};'use strict';var BPromise=require(_0x4d48('0x0'));var https=require(_0x4d48('0x1'));var logger=require(_0x4d48('0x2'))('api');var USERNAME=_0x4d48('0x3');var PASSWORD=_0x4d48('0x4');function openIssue(_0x42c9f9,_0x18d554){var _0x31d0b6={'fields':{'project':{'key':_0x42c9f9[_0x4d48('0x5')]||_0x4d48('0x6')},'summary':(_0x42c9f9[_0x4d48('0x7')]||_0x4d48('0x8'))+_0x4d48('0x9')+_0x42c9f9['ip'],'description':_0x42c9f9[_0x4d48('0xa')]||JSON[_0x4d48('0xb')](_0x42c9f9),'issuetype':{'name':_0x42c9f9[_0x4d48('0xc')]||_0x4d48('0xd')}}};_0x31d0b6[_0x4d48('0xe')][_0x4d48('0xf')]=_0x42c9f9[_0x4d48('0x10')];_0x31d0b6[_0x4d48('0xe')][_0x4d48('0x11')]=_0x42c9f9[_0x4d48('0x12')];_0x31d0b6[_0x4d48('0xe')][_0x4d48('0x13')]=_0x42c9f9[_0x4d48('0x14')];_0x31d0b6[_0x4d48('0xe')][_0x4d48('0x15')]=_0x42c9f9[_0x4d48('0x16')];_0x31d0b6['fields']['customfield_11504']=_0x42c9f9[_0x4d48('0x17')];_0x31d0b6[_0x4d48('0xe')]['customfield_10102']=_0x42c9f9['ip'];var _0xacd518={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x4d48('0x18'),'method':_0x4d48('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x4d48('0x1a'),'Authorization':_0x4d48('0x1b')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x4d48('0x1c'))}};var _0x17d170=JSON[_0x4d48('0xb')](_0x31d0b6);var _0x388627=https[_0x4d48('0x1d')](_0xacd518,function(_0x15672c){_0x15672c['setEncoding'](_0x4d48('0x1e'));var _0x36cf22='';_0x15672c['on']('data',function(_0xa23043){_0x36cf22+=_0xa23043;});_0x15672c['on'](_0x4d48('0x1f'),function(){if(_0x18d554){return _0x18d554[_0x4d48('0x20')](_0x15672c[_0x4d48('0x21')])[_0x4d48('0x22')](JSON[_0x4d48('0x23')](_0x36cf22));}});});_0x388627['on'](_0x4d48('0x24'),function(_0x1cce06){if(_0x18d554){return _0x18d554[_0x4d48('0x20')](0x1f4)[_0x4d48('0x22')]({'errors':[{'message':_0x4d48('0x25'),'type':'api.jira'}]});}});_0x388627[_0x4d48('0x26')](_0x17d170);_0x388627[_0x4d48('0x1f')]();}exports[_0x4d48('0x27')]=openIssue;exports[_0x4d48('0x28')]=function(_0x1ec417,_0x7235fc){_0x1ec417[_0x4d48('0x29')]['ip']=_0x1ec417['headers'][_0x4d48('0x2a')]||_0x1ec417['connection'][_0x4d48('0x2b')]||_0x1ec417['socket'][_0x4d48('0x2b')]||_0x1ec417[_0x4d48('0x2c')][_0x4d48('0x2d')][_0x4d48('0x2b')];return openIssue(_0x1ec417[_0x4d48('0x29')],_0x7235fc);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index b565b74..5f8680b 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 _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x150845,_0x385c5c){var _0x130b5a=function(_0x54600a){while(--_0x54600a){_0x150845['push'](_0x150845['shift']());}};_0x130b5a(++_0x385c5c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0xbdb7[_0xdbe2de];return _0x2facd7;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router; \ No newline at end of file +var _0x4ea3=['multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports'];(function(_0x218479,_0x4fb190){var _0x3b67a0=function(_0x3ee034){while(--_0x3ee034){_0x218479['push'](_0x218479['shift']());}};_0x3b67a0(++_0x4fb190);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0xc')]('/',auth[_0x34ea('0x8')](),controller['create']);router['put'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['delete'](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xe')]);module[_0x34ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fc9ce2d..c259f0e 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x2285a5,_0x4fafb1){_0x2285a5=_0x2285a5-0x0;var _0x4c6706=_0x7a54[_0x2285a5];return _0x4c6706;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7a54,0x106));var _0x47a5=function(_0x5af868,_0x5bd044){_0x5af868=_0x5af868-0x0;var _0x1b714d=_0x7a54[_0x5af868];return _0x1b714d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index a0e73b5..f7b786e 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 _0xb182=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3eb593,_0x41b905){var _0x5e4605=function(_0x14a73e){while(--_0x14a73e){_0x3eb593['push'](_0x3eb593['shift']());}};_0x5e4605(++_0x41b905);}(_0xb182,0x121));var _0x2b18=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xb182[_0xae1a83];return _0xdb9da8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b18('0x0'));var zipdir=require(_0x2b18('0x1'));var jsonpatch=require(_0x2b18('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b18('0x3'));var Mustache=require(_0x2b18('0x4'));var util=require(_0x2b18('0x5'));var path=require('path');var sox=require(_0x2b18('0x6'));var csv=require(_0x2b18('0x7'));var ejs=require(_0x2b18('0x8'));var fs=require('fs');var fs_extra=require(_0x2b18('0x9'));var _=require(_0x2b18('0xa'));var squel=require(_0x2b18('0xb'));var crypto=require(_0x2b18('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2b18('0xd'));var toCsv=require(_0x2b18('0x7'));var querystring=require(_0x2b18('0xe'));var Papa=require(_0x2b18('0xf'));var Redis=require(_0x2b18('0x10'));var authService=require(_0x2b18('0x11'));var qs=require(_0x2b18('0x12'));var as=require(_0x2b18('0x13'));var hardwareService=require(_0x2b18('0x14'));var logger=require(_0x2b18('0x15'))(_0x2b18('0x16'));var utils=require(_0x2b18('0x17'));var config=require(_0x2b18('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b18('0x19'))['db'];function respondWithStatusCode(_0x5a185f,_0x5be72d){_0x5be72d=_0x5be72d||0xcc;return function(_0x540e8e){if(_0x540e8e){return _0x5a185f[_0x2b18('0x1a')](_0x5be72d);}return _0x5a185f[_0x2b18('0x1b')](_0x5be72d)[_0x2b18('0x1c')]();};}function respondWithResult(_0x1d20a0,_0x2aee11){_0x2aee11=_0x2aee11||0xc8;return function(_0x195a26){if(_0x195a26){return _0x1d20a0[_0x2b18('0x1b')](_0x2aee11)[_0x2b18('0x1d')](_0x195a26);}};}function respondWithFilteredResult(_0x5e4785,_0x2ef594){return function(_0xa339af){if(_0xa339af){var _0x1191ee=typeof _0x2ef594['offset']===_0x2b18('0x1e')&&typeof _0x2ef594['limit']==='undefined';var _0x480cd3=_0xa339af[_0x2b18('0x1f')];var _0xc4714f=_0x1191ee?0x0:_0x2ef594[_0x2b18('0x20')];var _0x149ee0=_0x1191ee?_0xa339af[_0x2b18('0x1f')]:_0x2ef594[_0x2b18('0x20')]+_0x2ef594[_0x2b18('0x21')];var _0x59b28e;if(_0x149ee0>=_0x480cd3){_0x149ee0=_0x480cd3;_0x59b28e=0xc8;}else{_0x59b28e=0xce;}_0x5e4785[_0x2b18('0x1b')](_0x59b28e);return _0x5e4785[_0x2b18('0x22')]('Content-Range',_0xc4714f+'-'+_0x149ee0+'/'+_0x480cd3)['json'](_0xa339af);}return null;};}function patchUpdates(_0x2cef3a){return function(_0x603b94){try{jsonpatch['apply'](_0x603b94,_0x2cef3a,!![]);}catch(_0x14d38a){return BPromise[_0x2b18('0x23')](_0x14d38a);}return _0x603b94[_0x2b18('0x24')]();};}function saveUpdates(_0x2975ab,_0x4e45d0){return function(_0x1b1635){if(_0x1b1635){return _0x1b1635['update'](_0x2975ab)[_0x2b18('0x25')](function(_0x1dbfb4){return _0x1dbfb4;});}return null;};}function removeEntity(_0x118197,_0x493931){return function(_0x571121){if(_0x571121){return _0x571121['destroy']()[_0x2b18('0x25')](function(){_0x118197[_0x2b18('0x1b')](0xcc)[_0x2b18('0x1c')]();});}};}function handleEntityNotFound(_0x38e879,_0x3e52c2){return function(_0x3f0425){if(!_0x3f0425){_0x38e879[_0x2b18('0x1a')](0x194);}return _0x3f0425;};}function handleError(_0x420ca7,_0x3b8aaa){_0x3b8aaa=_0x3b8aaa||0x1f4;return function(_0x4e600b){logger[_0x2b18('0x26')](_0x4e600b[_0x2b18('0x27')]);if(_0x4e600b[_0x2b18('0x28')]){delete _0x4e600b[_0x2b18('0x28')];}_0x420ca7[_0x2b18('0x1b')](_0x3b8aaa)[_0x2b18('0x29')](_0x4e600b);};}exports[_0x2b18('0x2a')]=function(_0x35c65e,_0x1dd39e){var _0x26afc0={},_0x225521={},_0x390724={'count':0x0,'rows':[]};var _0x161709=_[_0x2b18('0x2b')](db[_0x2b18('0x2c')][_0x2b18('0x2d')],function(_0x407eba){return{'name':_0x407eba[_0x2b18('0x2e')],'type':_0x407eba[_0x2b18('0x2f')][_0x2b18('0x30')]};});_0x225521[_0x2b18('0x31')]=_[_0x2b18('0x2b')](_0x161709,'name');_0x225521[_0x2b18('0x32')]=_[_0x2b18('0x33')](_0x35c65e[_0x2b18('0x32')]);_0x225521[_0x2b18('0x34')]=_['intersection'](_0x225521['model'],_0x225521['query']);_0x26afc0[_0x2b18('0x35')]=_[_0x2b18('0x36')](_0x225521[_0x2b18('0x31')],qs[_0x2b18('0x37')](_0x35c65e[_0x2b18('0x32')][_0x2b18('0x37')]));_0x26afc0[_0x2b18('0x35')]=_0x26afc0[_0x2b18('0x35')][_0x2b18('0x38')]?_0x26afc0[_0x2b18('0x35')]:_0x225521[_0x2b18('0x31')];if(!_0x35c65e[_0x2b18('0x32')][_0x2b18('0x39')](_0x2b18('0x3a'))){_0x26afc0['limit']=qs['limit'](_0x35c65e['query'][_0x2b18('0x21')]);_0x26afc0[_0x2b18('0x20')]=qs[_0x2b18('0x20')](_0x35c65e[_0x2b18('0x32')]['offset']);}_0x26afc0['order']=qs[_0x2b18('0x3b')](_0x35c65e[_0x2b18('0x32')][_0x2b18('0x3b')]);_0x26afc0[_0x2b18('0x3c')]=qs[_0x2b18('0x34')](_[_0x2b18('0x3d')](_0x35c65e[_0x2b18('0x32')],_0x225521[_0x2b18('0x34')]),_0x161709);if(_0x35c65e[_0x2b18('0x32')][_0x2b18('0x3e')]){_0x26afc0[_0x2b18('0x3c')]=_[_0x2b18('0x3f')](_0x26afc0[_0x2b18('0x3c')],{'$or':_[_0x2b18('0x2b')](_0x161709,function(_0x139761){if(_0x139761[_0x2b18('0x2f')]!=='VIRTUAL'){var _0x23e46d={};_0x23e46d[_0x139761[_0x2b18('0x28')]]={'$like':'%'+_0x35c65e[_0x2b18('0x32')][_0x2b18('0x3e')]+'%'};return _0x23e46d;}})});}_0x26afc0=_[_0x2b18('0x3f')]({},_0x26afc0,_0x35c65e[_0x2b18('0x40')]);var _0x1532b9={'where':_0x26afc0[_0x2b18('0x3c')]};return db[_0x2b18('0x2c')][_0x2b18('0x1f')](_0x1532b9)[_0x2b18('0x25')](function(_0xd192ca){_0x390724[_0x2b18('0x1f')]=_0xd192ca;if(_0x35c65e[_0x2b18('0x32')][_0x2b18('0x41')]){_0x26afc0[_0x2b18('0x42')]=[{'all':!![]}];}return db[_0x2b18('0x2c')][_0x2b18('0x43')](_0x26afc0);})[_0x2b18('0x25')](function(_0xffbf0a){_0x390724[_0x2b18('0x44')]=_0xffbf0a;return _0x390724;})[_0x2b18('0x25')](respondWithFilteredResult(_0x1dd39e,_0x26afc0))[_0x2b18('0x45')](handleError(_0x1dd39e,null));};exports['show']=function(_0x55137c,_0x7a8181){var _0x39db64={'raw':!![],'where':{'id':_0x55137c[_0x2b18('0x46')]['id']}},_0x3f1101={};_0x3f1101[_0x2b18('0x31')]=_[_0x2b18('0x33')](db['JscriptyAnswerReport']['rawAttributes']);_0x3f1101[_0x2b18('0x32')]=_[_0x2b18('0x33')](_0x55137c[_0x2b18('0x32')]);_0x3f1101[_0x2b18('0x34')]=_[_0x2b18('0x36')](_0x3f1101['model'],_0x3f1101['query']);_0x39db64[_0x2b18('0x35')]=_[_0x2b18('0x36')](_0x3f1101['model'],qs['fields'](_0x55137c[_0x2b18('0x32')][_0x2b18('0x37')]));_0x39db64[_0x2b18('0x35')]=_0x39db64[_0x2b18('0x35')][_0x2b18('0x38')]?_0x39db64[_0x2b18('0x35')]:_0x3f1101[_0x2b18('0x31')];if(_0x55137c[_0x2b18('0x32')]['includeAll']){_0x39db64[_0x2b18('0x42')]=[{'all':!![]}];}_0x39db64=_[_0x2b18('0x3f')]({},_0x39db64,_0x55137c['options']);return db[_0x2b18('0x2c')]['find'](_0x39db64)['then'](handleEntityNotFound(_0x7a8181,null))['then'](respondWithResult(_0x7a8181,null))[_0x2b18('0x45')](handleError(_0x7a8181,null));};exports['create']=function(_0x58b9dd,_0x166e40){return db[_0x2b18('0x2c')][_0x2b18('0x47')](_0x58b9dd[_0x2b18('0x48')],{})[_0x2b18('0x25')](respondWithResult(_0x166e40,0xc9))[_0x2b18('0x45')](handleError(_0x166e40,null));};exports[_0x2b18('0x49')]=function(_0x15b243,_0x4aa130){if(_0x15b243[_0x2b18('0x48')]['id']){delete _0x15b243[_0x2b18('0x48')]['id'];}return db[_0x2b18('0x2c')][_0x2b18('0x4a')]({'where':{'id':_0x15b243[_0x2b18('0x46')]['id']}})[_0x2b18('0x25')](handleEntityNotFound(_0x4aa130,null))[_0x2b18('0x25')](saveUpdates(_0x15b243[_0x2b18('0x48')],null))['then'](respondWithResult(_0x4aa130,null))[_0x2b18('0x45')](handleError(_0x4aa130,null));};exports[_0x2b18('0x4b')]=function(_0x337e16,_0xab744a){return db['JscriptyAnswerReport'][_0x2b18('0x4a')]({'where':{'id':_0x337e16[_0x2b18('0x46')]['id']}})['then'](handleEntityNotFound(_0xab744a,null))[_0x2b18('0x25')](removeEntity(_0xab744a,null))[_0x2b18('0x45')](handleError(_0xab744a,null));};exports[_0x2b18('0x4c')]=function(_0x1078b9,_0x482d20){return db[_0x2b18('0x2c')]['describe']()['then'](respondWithResult(_0x482d20,null))[_0x2b18('0x45')](handleError(_0x482d20,null));}; \ No newline at end of file +var _0xda19=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','findAll','catch','show','body','find','params','describe'];(function(_0xdfaa17,_0x399dca){var _0x3c79c1=function(_0x4df68a){while(--_0x4df68a){_0xdfaa17['push'](_0xdfaa17['shift']());}};_0x3c79c1(++_0x399dca);}(_0xda19,0xd5));var _0x9da1=function(_0x5671f2,_0x147cf9){_0x5671f2=_0x5671f2-0x0;var _0x353378=_0xda19[_0x5671f2];return _0x353378;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['JscriptyAnswerReport'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['create']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['create'](_0x336fc3[_0x9da1('0x43')],{})['then'](respondWithResult(_0x351d4d,0xc9))['catch'](handleError(_0x351d4d,null));};exports[_0x9da1('0x23')]=function(_0x43c47d,_0x5afbc7){if(_0x43c47d[_0x9da1('0x43')]['id']){delete _0x43c47d[_0x9da1('0x43')]['id'];}return db['JscriptyAnswerReport'][_0x9da1('0x44')]({'where':{'id':_0x43c47d[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5afbc7,null))[_0x9da1('0x24')](saveUpdates(_0x43c47d[_0x9da1('0x43')],null))[_0x9da1('0x24')](respondWithResult(_0x5afbc7,null))[_0x9da1('0x41')](handleError(_0x5afbc7,null));};exports[_0x9da1('0x25')]=function(_0x3889f4,_0x5c9b46){return db[_0x9da1('0x3e')][_0x9da1('0x44')]({'where':{'id':_0x3889f4[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5c9b46,null))['then'](removeEntity(_0x5c9b46,null))['catch'](handleError(_0x5c9b46,null));};exports[_0x9da1('0x46')]=function(_0x6ca1ac,_0x3870dd){return db[_0x9da1('0x3e')][_0x9da1('0x46')]()[_0x9da1('0x24')](respondWithResult(_0x3870dd,null))[_0x9da1('0x41')](handleError(_0x3870dd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ff3afcc..d6e5b5f 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 _0x23ca=['bluebird','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment'];(function(_0xb87d36,_0x17f981){var _0x30d133=function(_0xe29839){while(--_0xe29839){_0xb87d36['push'](_0xb87d36['shift']());}};_0x30d133(++_0x17f981);}(_0x23ca,0x1f3));var _0xa23c=function(_0x54daf5,_0x528643){_0x54daf5=_0x54daf5-0x0;var _0xf70158=_0x23ca[_0x54daf5];return _0xf70158;};'use strict';var _=require(_0xa23c('0x0'));var util=require(_0xa23c('0x1'));var logger=require(_0xa23c('0x2'))(_0xa23c('0x3'));var moment=require(_0xa23c('0x4'));var BPromise=require(_0xa23c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa23c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa23c('0x7'));module[_0xa23c('0x8')]=function(_0x12f90b,_0x465a09){return _0x12f90b[_0xa23c('0x9')](_0xa23c('0xa'),attributes,{'tableName':_0xa23c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc65=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x3d0c70,_0x314b44){var _0x1d6d43=function(_0x11b60){while(--_0x11b60){_0x3d0c70['push'](_0x3d0c70['shift']());}};_0x1d6d43(++_0x314b44);}(_0xbc65,0x1f0));var _0x5bc6=function(_0x5818b0,_0x2e1f16){_0x5818b0=_0x5818b0-0x0;var _0x596811=_0xbc65[_0x5818b0];return _0x596811;};'use strict';var _=require(_0x5bc6('0x0'));var util=require(_0x5bc6('0x1'));var logger=require(_0x5bc6('0x2'))(_0x5bc6('0x3'));var moment=require(_0x5bc6('0x4'));var BPromise=require(_0x5bc6('0x5'));var rp=require(_0x5bc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc6('0x7'));var config=require(_0x5bc6('0x8'));var attributes=require(_0x5bc6('0x9'));module[_0x5bc6('0xa')]=function(_0x276c80,_0x1463b4){return _0x276c80['define'](_0x5bc6('0xb'),attributes,{'tableName':_0x5bc6('0xc'),'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 78db15c..33c7e05 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 _0x0487=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x0487,0x102));var _0x7048=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x0487[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x7048('0x0'));var util=require(_0x7048('0x1'));var moment=require(_0x7048('0x2'));var BPromise=require(_0x7048('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7048('0x4'));var db=require(_0x7048('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7048('0x6'))(_0x7048('0x7'));var config=require(_0x7048('0x8'));var jayson=require(_0x7048('0x9'));var client=jayson[_0x7048('0xa')][_0x7048('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5354bf,_0x2391c7,_0x5944b9){return new BPromise(function(_0x3504bd,_0x5c1f3c){return client[_0x7048('0xc')](_0x5354bf,_0x5944b9)['then'](function(_0x2ef7ea){logger[_0x7048('0xd')](_0x7048('0xe'),_0x2391c7,_0x7048('0xf'));logger[_0x7048('0x10')](_0x7048('0x11'),_0x2391c7,_0x7048('0xf'),JSON['stringify'](_0x2ef7ea));if(_0x2ef7ea['error']){if(_0x2ef7ea[_0x7048('0x12')][_0x7048('0x13')]===0x1f4){logger['error'](_0x7048('0xe'),_0x2391c7,_0x2ef7ea['error'][_0x7048('0x14')]);return _0x5c1f3c(_0x2ef7ea['error'][_0x7048('0x14')]);}logger[_0x7048('0x12')](_0x7048('0xe'),_0x2391c7,_0x2ef7ea[_0x7048('0x12')][_0x7048('0x14')]);return _0x3504bd(_0x2ef7ea[_0x7048('0x12')]['message']);}else{logger[_0x7048('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2391c7,_0x7048('0xf'));_0x3504bd(_0x2ef7ea['result']['message']);}})['catch'](function(_0x2c8209){logger[_0x7048('0x12')](_0x7048('0xe'),_0x2391c7,_0x2c8209);_0x5c1f3c(_0x2c8209);});});} \ No newline at end of file +var _0xcc21=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x42e297,_0x1cb2d2){var _0x399e28=function(_0x47a5d8){while(--_0x47a5d8){_0x42e297['push'](_0x42e297['shift']());}};_0x399e28(++_0x1cb2d2);}(_0xcc21,0x124));var _0x1cc2=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0xcc21[_0x18d38c];return _0x474ba7;};'use strict';var _=require(_0x1cc2('0x0'));var util=require(_0x1cc2('0x1'));var moment=require(_0x1cc2('0x2'));var BPromise=require(_0x1cc2('0x3'));var rs=require(_0x1cc2('0x4'));var fs=require('fs');var Redis=require(_0x1cc2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cc2('0x6'));var logger=require(_0x1cc2('0x7'))(_0x1cc2('0x8'));var config=require('../../config/environment');var jayson=require(_0x1cc2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56c7a9,_0x49fea8,_0x41a041){return new BPromise(function(_0x2c7d76,_0x391bb2){return client['request'](_0x56c7a9,_0x41a041)[_0x1cc2('0xa')](function(_0x24328e){logger['info'](_0x1cc2('0xb'),_0x49fea8,_0x1cc2('0xc'));logger[_0x1cc2('0xd')](_0x1cc2('0xe'),_0x49fea8,_0x1cc2('0xc'),JSON[_0x1cc2('0xf')](_0x24328e));if(_0x24328e[_0x1cc2('0x10')]){if(_0x24328e['error'][_0x1cc2('0x11')]===0x1f4){logger[_0x1cc2('0x10')](_0x1cc2('0xb'),_0x49fea8,_0x24328e[_0x1cc2('0x10')][_0x1cc2('0x12')]);return _0x391bb2(_0x24328e['error'][_0x1cc2('0x12')]);}logger[_0x1cc2('0x10')](_0x1cc2('0xb'),_0x49fea8,_0x24328e[_0x1cc2('0x10')][_0x1cc2('0x12')]);return _0x2c7d76(_0x24328e[_0x1cc2('0x10')]['message']);}else{logger['info'](_0x1cc2('0xb'),_0x49fea8,'request\x20sent');_0x2c7d76(_0x24328e[_0x1cc2('0x13')][_0x1cc2('0x12')]);}})[_0x1cc2('0x14')](function(_0x224662){logger[_0x1cc2('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x49fea8,_0x224662);_0x391bb2(_0x224662);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 12eb192..edf58c2 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 _0x4859=['index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','create','clone','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x5d5177,_0x24d3c8){var _0x195c11=function(_0x5e4f32){while(--_0x5e4f32){_0x5d5177['push'](_0x5d5177['shift']());}};_0x195c11(++_0x24d3c8);}(_0x4859,0x8c));var _0x9485=function(_0x2d061c,_0xdcaf78){_0x2d061c=_0x2d061c-0x0;var _0x5218bf=_0x4859[_0x2d061c];return _0x5218bf;};'use strict';var multer=require('multer');var util=require(_0x9485('0x0'));var path=require(_0x9485('0x1'));var timeout=require('connect-timeout');var express=require(_0x9485('0x2'));var router=express[_0x9485('0x3')]();var fs_extra=require(_0x9485('0x4'));var auth=require(_0x9485('0x5'));var interaction=require(_0x9485('0x6'));var config=require('../../config/environment');var controller=require(_0x9485('0x7'));router[_0x9485('0x8')]('/',auth[_0x9485('0x9')](),controller[_0x9485('0xa')]);router[_0x9485('0x8')](_0x9485('0xb'),auth['isAuthenticated'](),controller[_0x9485('0xc')]);router[_0x9485('0x8')](_0x9485('0xd'),auth[_0x9485('0x9')](),controller[_0x9485('0xe')]);router[_0x9485('0x8')](_0x9485('0xf'),auth['isAuthenticated'](),controller[_0x9485('0x10')]);router['get'](_0x9485('0x11'),auth[_0x9485('0x9')](),timeout(_0x9485('0x12')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller[_0x9485('0x13')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x9485('0x14')]);router[_0x9485('0x15')]('/:id',auth[_0x9485('0x9')](),controller[_0x9485('0x16')]);router['delete']('/:id',auth[_0x9485('0x9')](),controller[_0x9485('0x17')]);module[_0x9485('0x18')]=router; \ No newline at end of file +var _0x9afa=['get','isAuthenticated','index','/:id','show','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9afa,0xb1));var _0xa9af=function(_0x5adaf5,_0x33395b){_0x5adaf5=_0x5adaf5-0x0;var _0x2725db=_0x9afa[_0x5adaf5];return _0x2725db;};'use strict';var multer=require('multer');var util=require(_0xa9af('0x0'));var path=require(_0xa9af('0x1'));var timeout=require(_0xa9af('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa9af('0x3'));var auth=require(_0xa9af('0x4'));var interaction=require(_0xa9af('0x5'));var config=require('../../config/environment');var controller=require(_0xa9af('0x6'));router[_0xa9af('0x7')]('/',auth[_0xa9af('0x8')](),controller[_0xa9af('0x9')]);router[_0xa9af('0x7')](_0xa9af('0xa'),auth[_0xa9af('0x8')](),controller[_0xa9af('0xb')]);router[_0xa9af('0x7')]('/:id/sessions',auth[_0xa9af('0x8')](),controller['getSessions']);router[_0xa9af('0x7')]('/:id/answers',auth[_0xa9af('0x8')](),controller[_0xa9af('0xc')]);router[_0xa9af('0x7')](_0xa9af('0xd'),auth['isAuthenticated'](),timeout('30s'),controller[_0xa9af('0xe')]);router[_0xa9af('0xf')]('/',auth[_0xa9af('0x8')](),controller[_0xa9af('0x10')]);router[_0xa9af('0xf')](_0xa9af('0x11'),auth[_0xa9af('0x8')](),controller[_0xa9af('0x12')]);router[_0xa9af('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa9af('0x14')]);router[_0xa9af('0x15')](_0xa9af('0xa'),auth[_0xa9af('0x8')](),controller[_0xa9af('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index d408697..a6d8277 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 _0xdec3=['setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT','isObjectLike'];(function(_0x45f2ff,_0xdc4c22){var _0x3f0203=function(_0x4964d6){while(--_0x4964d6){_0x45f2ff['push'](_0x45f2ff['shift']());}};_0x3f0203(++_0xdc4c22);}(_0xdec3,0x125));var _0x3dec=function(_0x12899a,_0x357eb5){_0x12899a=_0x12899a-0x0;var _0x33da45=_0xdec3[_0x12899a];return _0x33da45;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3dec('0x0'));var util=require(_0x3dec('0x1'));module['exports']={'name':{'type':Sequelize[_0x3dec('0x2')],'unique':_0x3dec('0x3')},'description':{'type':Sequelize[_0x3dec('0x2')]},'formData':{'type':Sequelize[_0x3dec('0x4')]('long'),'set':function(_0x4908c6){if(_[_0x3dec('0x5')](_0x4908c6)){this[_0x3dec('0x6')](_0x3dec('0x7'),JSON['stringify'](_0x4908c6));}else if(_['isString'](_0x4908c6)){this[_0x3dec('0x6')](_0x3dec('0x7'),_0x4908c6);}else{this[_0x3dec('0x6')](_0x3dec('0x7'),util[_0x3dec('0x8')](_0x3dec('0x9'),this[_0x3dec('0xa')](_0x3dec('0x3'))||'',this[_0x3dec('0xa')](_0x3dec('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3dec('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3dec('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf0b=['description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue'];(function(_0x51e916,_0x549682){var _0x2f718d=function(_0x402905){while(--_0x402905){_0x51e916['push'](_0x51e916['shift']());}};_0x2f718d(++_0x549682);}(_0xcf0b,0x189));var _0xbcf0=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0xcf0b[_0x23c262];return _0x9b913f;};'use strict';var Sequelize=require(_0xbcf0('0x0'));var _=require(_0xbcf0('0x1'));var util=require(_0xbcf0('0x2'));module[_0xbcf0('0x3')]={'name':{'type':Sequelize[_0xbcf0('0x4')],'unique':_0xbcf0('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xbcf0('0x6')](_0xbcf0('0x7')),'set':function(_0xef3eeb){if(_[_0xbcf0('0x8')](_0xef3eeb)){this[_0xbcf0('0x9')](_0xbcf0('0xa'),JSON[_0xbcf0('0xb')](_0xef3eeb));}else if(_[_0xbcf0('0xc')](_0xef3eeb)){this[_0xbcf0('0x9')](_0xbcf0('0xa'),_0xef3eeb);}else{this[_0xbcf0('0x9')](_0xbcf0('0xa'),util[_0xbcf0('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xbcf0('0xe')](_0xbcf0('0x5'))||'',this[_0xbcf0('0xe')](_0xbcf0('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbcf0('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 8042d20..8a74113 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 _0x2b50=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','get','Projects','UserProfileResource','error','stack','send','index','map','fieldName','type','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','JscriptyProject','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','includeAll','userProfileId','getSessions','findOne','JscriptySessionReport','nolimit','getAnswers','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3505a2,_0x3ebfc6){var _0x57bc30=function(_0x48dd52){while(--_0x48dd52){_0x3505a2['push'](_0x3505a2['shift']());}};_0x57bc30(++_0x3ebfc6);}(_0x2b50,0x68));var _0x02b5=function(_0x28c073,_0x5aabe3){_0x28c073=_0x28c073-0x0;var _0x1bca43=_0x2b50[_0x28c073];return _0x1bca43;};'use strict';var emlformat=require(_0x02b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02b5('0x2'));var Mustache=require(_0x02b5('0x3'));var util=require(_0x02b5('0x4'));var path=require(_0x02b5('0x5'));var sox=require('sox');var csv=require(_0x02b5('0x6'));var ejs=require(_0x02b5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x02b5('0x8'));var jsforce=require(_0x02b5('0x9'));var deskjs=require(_0x02b5('0xa'));var toCsv=require(_0x02b5('0x6'));var querystring=require(_0x02b5('0xb'));var Papa=require(_0x02b5('0xc'));var Redis=require(_0x02b5('0xd'));var authService=require(_0x02b5('0xe'));var qs=require(_0x02b5('0xf'));var as=require(_0x02b5('0x10'));var hardwareService=require(_0x02b5('0x11'));var logger=require(_0x02b5('0x12'))(_0x02b5('0x13'));var utils=require(_0x02b5('0x14'));var config=require(_0x02b5('0x15'));var licenseUtil=require(_0x02b5('0x16'));var db=require(_0x02b5('0x17'))['db'];function respondWithStatusCode(_0x128397,_0x279f40){_0x279f40=_0x279f40||0xcc;return function(_0xcc7739){if(_0xcc7739){return _0x128397[_0x02b5('0x18')](_0x279f40);}return _0x128397[_0x02b5('0x19')](_0x279f40)[_0x02b5('0x1a')]();};}function respondWithResult(_0x4a0d64,_0x5c5550){_0x5c5550=_0x5c5550||0xc8;return function(_0x23582d){if(_0x23582d){return _0x4a0d64[_0x02b5('0x19')](_0x5c5550)['json'](_0x23582d);}};}function respondWithFilteredResult(_0x1e72ea,_0xbf4606){return function(_0xecd194){if(_0xecd194){var _0x381b6f=typeof _0xbf4606[_0x02b5('0x1b')]===_0x02b5('0x1c')&&typeof _0xbf4606[_0x02b5('0x1d')]===_0x02b5('0x1c');var _0x3487d6=_0xecd194['count'];var _0x25d471=_0x381b6f?0x0:_0xbf4606[_0x02b5('0x1b')];var _0x5d446f=_0x381b6f?_0xecd194[_0x02b5('0x1e')]:_0xbf4606[_0x02b5('0x1b')]+_0xbf4606['limit'];var _0x134163;if(_0x5d446f>=_0x3487d6){_0x5d446f=_0x3487d6;_0x134163=0xc8;}else{_0x134163=0xce;}_0x1e72ea[_0x02b5('0x19')](_0x134163);return _0x1e72ea[_0x02b5('0x1f')](_0x02b5('0x20'),_0x25d471+'-'+_0x5d446f+'/'+_0x3487d6)[_0x02b5('0x21')](_0xecd194);}return null;};}function patchUpdates(_0x5d9b67){return function(_0x49046a){try{jsonpatch[_0x02b5('0x22')](_0x49046a,_0x5d9b67,!![]);}catch(_0x5d7937){return BPromise['reject'](_0x5d7937);}return _0x49046a['save']();};}function saveUpdates(_0xc4cbd9,_0x1efd10){return function(_0x3cfe56){if(_0x3cfe56){return _0x3cfe56[_0x02b5('0x23')](_0xc4cbd9)[_0x02b5('0x24')](function(_0x5b7377){return _0x5b7377;});}return null;};}function removeEntity(_0x193dfe,_0xa59f56){return function(_0x280e2a){if(_0x280e2a){return _0x280e2a[_0x02b5('0x25')]()[_0x02b5('0x24')](function(){var _0x4d68be=_0x280e2a[_0x02b5('0x26')]({'plain':!![]});var _0x39e2e0=_0x02b5('0x27');return db[_0x02b5('0x28')]['destroy']({'where':{'type':_0x39e2e0,'resourceId':_0x4d68be['id']}})[_0x02b5('0x24')](function(){return _0x280e2a;});})[_0x02b5('0x24')](function(){_0x193dfe[_0x02b5('0x19')](0xcc)[_0x02b5('0x1a')]();});}};}function handleEntityNotFound(_0x2c2522,_0x5cabc8){return function(_0x3988cf){if(!_0x3988cf){_0x2c2522['sendStatus'](0x194);}return _0x3988cf;};}function handleError(_0x668fd3,_0x5b7ba0){_0x5b7ba0=_0x5b7ba0||0x1f4;return function(_0x5dc17e){logger[_0x02b5('0x29')](_0x5dc17e[_0x02b5('0x2a')]);if(_0x5dc17e['name']){delete _0x5dc17e['name'];}_0x668fd3[_0x02b5('0x19')](_0x5b7ba0)[_0x02b5('0x2b')](_0x5dc17e);};}exports[_0x02b5('0x2c')]=function(_0x1edcf2,_0xf20299){var _0x59a39f={},_0x28c0e3={},_0x97c42e={'count':0x0,'rows':[]};var _0x5934e7=_[_0x02b5('0x2d')](db['JscriptyProject']['rawAttributes'],function(_0x6efd9e){return{'name':_0x6efd9e[_0x02b5('0x2e')],'type':_0x6efd9e[_0x02b5('0x2f')]['key']};});_0x28c0e3[_0x02b5('0x30')]=_['map'](_0x5934e7,'name');_0x28c0e3['query']=_[_0x02b5('0x31')](_0x1edcf2['query']);_0x28c0e3[_0x02b5('0x32')]=_[_0x02b5('0x33')](_0x28c0e3[_0x02b5('0x30')],_0x28c0e3[_0x02b5('0x34')]);_0x59a39f[_0x02b5('0x35')]=_[_0x02b5('0x33')](_0x28c0e3[_0x02b5('0x30')],qs['fields'](_0x1edcf2['query']['fields']));_0x59a39f[_0x02b5('0x35')]=_0x59a39f['attributes'][_0x02b5('0x36')]?_0x59a39f[_0x02b5('0x35')]:_0x28c0e3['model'];if(!_0x1edcf2[_0x02b5('0x34')][_0x02b5('0x37')]('nolimit')){_0x59a39f[_0x02b5('0x1d')]=qs['limit'](_0x1edcf2['query'][_0x02b5('0x1d')]);_0x59a39f[_0x02b5('0x1b')]=qs['offset'](_0x1edcf2[_0x02b5('0x34')][_0x02b5('0x1b')]);}_0x59a39f[_0x02b5('0x38')]=qs[_0x02b5('0x39')](_0x1edcf2[_0x02b5('0x34')][_0x02b5('0x39')]);_0x59a39f[_0x02b5('0x3a')]=qs['filters'](_[_0x02b5('0x3b')](_0x1edcf2[_0x02b5('0x34')],_0x28c0e3[_0x02b5('0x32')]),_0x5934e7);if(_0x1edcf2[_0x02b5('0x34')][_0x02b5('0x3c')]){_0x59a39f[_0x02b5('0x3a')]=_[_0x02b5('0x3d')](_0x59a39f[_0x02b5('0x3a')],{'$or':_['map'](_0x5934e7,function(_0x4ca079){if(_0x4ca079['type']!==_0x02b5('0x3e')){var _0x26d30e={};_0x26d30e[_0x4ca079[_0x02b5('0x3f')]]={'$like':'%'+_0x1edcf2[_0x02b5('0x34')][_0x02b5('0x3c')]+'%'};return _0x26d30e;}})});}_0x59a39f=_['merge']({},_0x59a39f,_0x1edcf2[_0x02b5('0x40')]);var _0xd6de63={'where':_0x59a39f[_0x02b5('0x3a')]};return db[_0x02b5('0x41')][_0x02b5('0x1e')](_0xd6de63)[_0x02b5('0x24')](function(_0x3ee3ef){_0x97c42e[_0x02b5('0x1e')]=_0x3ee3ef;if(_0x1edcf2[_0x02b5('0x34')]['includeAll']){_0x59a39f[_0x02b5('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0x02b5('0x43')](_0x59a39f);})['then'](function(_0x5d4853){_0x97c42e[_0x02b5('0x44')]=_0x5d4853;return _0x97c42e;})[_0x02b5('0x24')](respondWithFilteredResult(_0xf20299,_0x59a39f))[_0x02b5('0x45')](handleError(_0xf20299,null));};exports[_0x02b5('0x46')]=function(_0x18b40a,_0x391736){var _0x52b4d8={'raw':![],'where':{'id':_0x18b40a[_0x02b5('0x47')]['id']}},_0x3f196b={};_0x3f196b[_0x02b5('0x30')]=_[_0x02b5('0x31')](db[_0x02b5('0x41')][_0x02b5('0x48')]);_0x3f196b[_0x02b5('0x34')]=_[_0x02b5('0x31')](_0x18b40a[_0x02b5('0x34')]);_0x3f196b[_0x02b5('0x32')]=_[_0x02b5('0x33')](_0x3f196b[_0x02b5('0x30')],_0x3f196b[_0x02b5('0x34')]);_0x52b4d8[_0x02b5('0x35')]=_[_0x02b5('0x33')](_0x3f196b[_0x02b5('0x30')],qs[_0x02b5('0x49')](_0x18b40a[_0x02b5('0x34')]['fields']));_0x52b4d8[_0x02b5('0x35')]=_0x52b4d8['attributes'][_0x02b5('0x36')]?_0x52b4d8[_0x02b5('0x35')]:_0x3f196b[_0x02b5('0x30')];if(_0x18b40a[_0x02b5('0x34')]['includeAll']){_0x52b4d8[_0x02b5('0x42')]=[{'all':!![]}];}_0x52b4d8=_[_0x02b5('0x3d')]({},_0x52b4d8,_0x18b40a[_0x02b5('0x40')]);return db[_0x02b5('0x41')][_0x02b5('0x4a')](_0x52b4d8)[_0x02b5('0x24')](handleEntityNotFound(_0x391736,null))['then'](respondWithResult(_0x391736,null))['catch'](handleError(_0x391736,null));};exports['create']=function(_0x2b0c33,_0x555405){return db[_0x02b5('0x41')][_0x02b5('0x4b')](_0x2b0c33['body'],{})[_0x02b5('0x24')](function(_0x4901a9){var _0x4f8069=_0x2b0c33[_0x02b5('0x4c')][_0x02b5('0x26')]({'plain':!![]});if(!_0x4f8069)throw new Error(_0x02b5('0x4d'));if(_0x4f8069[_0x02b5('0x4e')]==='user'){var _0x1f26a7=_0x4901a9[_0x02b5('0x26')]({'plain':!![]});var _0x15c840=_0x02b5('0x27');return db[_0x02b5('0x4f')][_0x02b5('0x4a')]({'where':{'name':_0x15c840,'userProfileId':_0x4f8069['userProfileId']},'raw':!![]})[_0x02b5('0x24')](function(_0x32f30e){if(_0x32f30e&&_0x32f30e[_0x02b5('0x50')]===0x0){return db[_0x02b5('0x28')][_0x02b5('0x4b')]({'name':_0x1f26a7['name'],'resourceId':_0x1f26a7['id'],'type':_0x32f30e[_0x02b5('0x3f')],'sectionId':_0x32f30e['id']},{})[_0x02b5('0x24')](function(){return _0x4901a9;});}else{return _0x4901a9;}})['catch'](function(_0x1ba83d){logger[_0x02b5('0x29')](_0x02b5('0x51'),_0x1ba83d);throw _0x1ba83d;});}return _0x4901a9;})[_0x02b5('0x24')](respondWithResult(_0x555405,0xc9))[_0x02b5('0x45')](handleError(_0x555405,null));};exports[_0x02b5('0x52')]=function(_0x592b0b,_0x3ee55e){var _0x49f1b2={'where':{'id':_0x592b0b[_0x02b5('0x47')]['id']}},_0x192e0d={};_0x192e0d[_0x02b5('0x30')]=_[_0x02b5('0x31')](db[_0x02b5('0x41')][_0x02b5('0x48')]);_0x49f1b2[_0x02b5('0x35')]=_['intersection'](_0x192e0d['model'],qs['fields'](_0x592b0b[_0x02b5('0x34')][_0x02b5('0x49')]));_0x49f1b2['attributes']=_0x49f1b2[_0x02b5('0x35')][_0x02b5('0x36')]?_0x49f1b2['attributes']:_0x192e0d[_0x02b5('0x30')];if(_0x592b0b[_0x02b5('0x34')]['includeAll']){_0x49f1b2['include']=[{'all':!![]}];}_0x49f1b2=_[_0x02b5('0x3d')]({},_0x49f1b2,_0x592b0b[_0x02b5('0x40')]);return db[_0x02b5('0x41')][_0x02b5('0x4a')](_0x49f1b2)['then'](handleEntityNotFound(_0x3ee55e,null))['then'](function(_0xb715cb){if(_0xb715cb){var _0x34e22f=_0xb715cb[_0x02b5('0x26')]({'plain':!![]});_0x34e22f=qs[_0x02b5('0x53')](_0x34e22f,['id',_0x02b5('0x54'),_0x02b5('0x55')]);_0x592b0b[_0x02b5('0x56')]=_[_0x02b5('0x53')](_0x592b0b[_0x02b5('0x56')],['id',_0x02b5('0x54'),'updatedAt']);return db[_0x02b5('0x41')][_0x02b5('0x4b')](_['merge'](_0x34e22f,_0x592b0b['body']),{'include':_0x592b0b['query'][_0x02b5('0x57')]?[{'all':!![]}]:undefined})['then'](function(_0x17abc3){var _0x57ab10=_0x592b0b[_0x02b5('0x4c')][_0x02b5('0x26')]({'plain':!![]});if(!_0x57ab10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ab10[_0x02b5('0x4e')]===_0x02b5('0x4c')){var _0x3ea03d=_0x17abc3[_0x02b5('0x26')]({'plain':!![]});var _0x1855d1='Projects';return db['UserProfileSection'][_0x02b5('0x4a')]({'where':{'name':_0x1855d1,'userProfileId':_0x57ab10[_0x02b5('0x58')]},'raw':!![]})[_0x02b5('0x24')](function(_0x1cd883){if(_0x1cd883&&_0x1cd883[_0x02b5('0x50')]===0x0){return db[_0x02b5('0x28')][_0x02b5('0x4b')]({'name':_0x3ea03d[_0x02b5('0x3f')],'resourceId':_0x3ea03d['id'],'type':_0x1cd883[_0x02b5('0x3f')],'sectionId':_0x1cd883['id']},{})['then'](function(){return _0x17abc3;});}else{return _0x17abc3;}})['catch'](function(_0xc58a0d){logger[_0x02b5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc58a0d);throw _0xc58a0d;});}return _0x17abc3;});}})[_0x02b5('0x24')](respondWithResult(_0x3ee55e,0xc9))[_0x02b5('0x45')](handleError(_0x3ee55e,null));};exports['update']=function(_0x27798a,_0x6ebb7f){if(_0x27798a[_0x02b5('0x56')]['id']){delete _0x27798a['body']['id'];}return db[_0x02b5('0x41')][_0x02b5('0x4a')]({'where':{'id':_0x27798a[_0x02b5('0x47')]['id']}})[_0x02b5('0x24')](handleEntityNotFound(_0x6ebb7f,null))[_0x02b5('0x24')](saveUpdates(_0x27798a[_0x02b5('0x56')],null))[_0x02b5('0x24')](respondWithResult(_0x6ebb7f,null))[_0x02b5('0x45')](handleError(_0x6ebb7f,null));};exports[_0x02b5('0x25')]=function(_0x1e7ab7,_0x3636c3){return db[_0x02b5('0x41')][_0x02b5('0x4a')]({'where':{'id':_0x1e7ab7['params']['id']}})[_0x02b5('0x24')](handleEntityNotFound(_0x3636c3,null))[_0x02b5('0x24')](removeEntity(_0x3636c3,null))[_0x02b5('0x45')](handleError(_0x3636c3,null));};exports[_0x02b5('0x59')]=function(_0x5c3a68,_0x5a7133,_0x1cb7c3){var _0x290817={'raw':!![],'where':{}};var _0x4b44ee={};var _0x4f2915={'count':0x0,'rows':[]};return db[_0x02b5('0x41')][_0x02b5('0x5a')]({'where':{'id':_0x5c3a68[_0x02b5('0x47')]['id']}})[_0x02b5('0x24')](handleEntityNotFound(_0x5a7133,null))[_0x02b5('0x24')](function(_0x3bd8bd){if(_0x3bd8bd){_0x4b44ee[_0x02b5('0x30')]=_[_0x02b5('0x31')](db[_0x02b5('0x5b')][_0x02b5('0x48')]);_0x4b44ee['query']=_[_0x02b5('0x31')](_0x5c3a68[_0x02b5('0x34')]);_0x4b44ee[_0x02b5('0x32')]=_[_0x02b5('0x33')](_0x4b44ee['model'],_0x4b44ee[_0x02b5('0x34')]);_0x290817[_0x02b5('0x35')]=_[_0x02b5('0x33')](_0x4b44ee['model'],qs[_0x02b5('0x49')](_0x5c3a68[_0x02b5('0x34')][_0x02b5('0x49')]));_0x290817[_0x02b5('0x35')]=_0x290817[_0x02b5('0x35')][_0x02b5('0x36')]?_0x290817[_0x02b5('0x35')]:_0x4b44ee['model'];if(!_0x5c3a68[_0x02b5('0x34')]['hasOwnProperty'](_0x02b5('0x5c'))){_0x290817['limit']=qs[_0x02b5('0x1d')](_0x5c3a68[_0x02b5('0x34')][_0x02b5('0x1d')]);_0x290817[_0x02b5('0x1b')]=qs[_0x02b5('0x1b')](_0x5c3a68[_0x02b5('0x34')][_0x02b5('0x1b')]);}_0x290817['order']=qs['sort'](_0x5c3a68['query'][_0x02b5('0x39')]);_0x290817[_0x02b5('0x3a')]=qs[_0x02b5('0x32')](_[_0x02b5('0x3b')](_0x5c3a68['query'],_0x4b44ee['filters']));_0x290817['where']['ProjectId']=_0x3bd8bd['id'];if(_0x5c3a68[_0x02b5('0x34')]['filter']){_0x290817[_0x02b5('0x3a')]=_['merge'](_0x290817[_0x02b5('0x3a')],{'$or':_[_0x02b5('0x2d')](_0x290817['attributes'],function(_0x36d164){var _0x573dd7={};_0x573dd7[_0x36d164]={'$like':'%'+_0x5c3a68['query'][_0x02b5('0x3c')]+'%'};return _0x573dd7;})});}_0x290817=_[_0x02b5('0x3d')]({},_0x290817,_0x5c3a68['options']);return db[_0x02b5('0x5b')][_0x02b5('0x1e')]({'where':_0x290817[_0x02b5('0x3a')]})[_0x02b5('0x24')](function(_0x4120b4){_0x4f2915[_0x02b5('0x1e')]=_0x4120b4;if(_0x5c3a68['query'][_0x02b5('0x57')]){_0x290817[_0x02b5('0x42')]=[{'all':!![]}];}return db[_0x02b5('0x5b')][_0x02b5('0x43')](_0x290817);})[_0x02b5('0x24')](function(_0x9b68fe){_0x4f2915[_0x02b5('0x44')]=_0x9b68fe;return _0x4f2915;});}})['then'](respondWithFilteredResult(_0x5a7133,_0x290817))['catch'](handleError(_0x5a7133,null));};exports[_0x02b5('0x5d')]=function(_0x32da5e,_0x3d63e4,_0x586a21){var _0x42379e={'raw':!![],'where':{}};var _0x2aa957={};var _0x3b5945={'count':0x0,'rows':[]};return db[_0x02b5('0x41')]['findOne']({'where':{'id':_0x32da5e['params']['id']}})[_0x02b5('0x24')](handleEntityNotFound(_0x3d63e4,null))[_0x02b5('0x24')](function(_0x1ddb69){if(_0x1ddb69){_0x2aa957[_0x02b5('0x30')]=_['keys'](db['JscriptyAnswerReport'][_0x02b5('0x48')]);_0x2aa957[_0x02b5('0x34')]=_['keys'](_0x32da5e[_0x02b5('0x34')]);_0x2aa957[_0x02b5('0x32')]=_[_0x02b5('0x33')](_0x2aa957['model'],_0x2aa957[_0x02b5('0x34')]);_0x42379e[_0x02b5('0x35')]=_[_0x02b5('0x33')](_0x2aa957[_0x02b5('0x30')],qs[_0x02b5('0x49')](_0x32da5e['query']['fields']));_0x42379e[_0x02b5('0x35')]=_0x42379e['attributes'][_0x02b5('0x36')]?_0x42379e[_0x02b5('0x35')]:_0x2aa957[_0x02b5('0x30')];if(!_0x32da5e[_0x02b5('0x34')][_0x02b5('0x37')](_0x02b5('0x5c'))){_0x42379e['limit']=qs['limit'](_0x32da5e['query'][_0x02b5('0x1d')]);_0x42379e['offset']=qs[_0x02b5('0x1b')](_0x32da5e['query'][_0x02b5('0x1b')]);}_0x42379e['order']=qs[_0x02b5('0x39')](_0x32da5e[_0x02b5('0x34')][_0x02b5('0x39')]);_0x42379e[_0x02b5('0x3a')]=qs[_0x02b5('0x32')](_['pick'](_0x32da5e[_0x02b5('0x34')],_0x2aa957[_0x02b5('0x32')]));_0x42379e['where'][_0x02b5('0x5e')]=_0x1ddb69['id'];if(_0x32da5e[_0x02b5('0x34')][_0x02b5('0x3c')]){_0x42379e[_0x02b5('0x3a')]=_['merge'](_0x42379e[_0x02b5('0x3a')],{'$or':_[_0x02b5('0x2d')](_0x42379e[_0x02b5('0x35')],function(_0xebbf81){var _0xa09d17={};_0xa09d17[_0xebbf81]={'$like':'%'+_0x32da5e[_0x02b5('0x34')][_0x02b5('0x3c')]+'%'};return _0xa09d17;})});}_0x42379e=_[_0x02b5('0x3d')]({},_0x42379e,_0x32da5e[_0x02b5('0x40')]);return db[_0x02b5('0x5f')][_0x02b5('0x1e')]({'where':_0x42379e['where']})[_0x02b5('0x24')](function(_0x52a5d7){_0x3b5945[_0x02b5('0x1e')]=_0x52a5d7;if(_0x32da5e['query']['includeAll']){_0x42379e['include']=[{'all':!![]}];}return db[_0x02b5('0x5f')]['findAll'](_0x42379e);})[_0x02b5('0x24')](function(_0xe7abff){_0x3b5945[_0x02b5('0x44')]=_0xe7abff;return _0x3b5945;});}})['then'](respondWithFilteredResult(_0x3d63e4,_0x42379e))[_0x02b5('0x45')](handleError(_0x3d63e4,null));};function char(_0x3a656f){return _0x02b5('0x60')===typeof _0x3a656f?String[_0x02b5('0x61')][_0x02b5('0x22')](null,arguments):_0x3a656f;}function needsEncapsulation(_0x3f3ab1){return!!_0x3f3ab1&&(_0x3f3ab1[_0x02b5('0x62')]()[_0x02b5('0x63')](char(0xd))>=0x0||_0x3f3ab1[_0x02b5('0x62')]()['indexOf'](char(0xa))>=0x0||_0x3f3ab1['toString']()[_0x02b5('0x63')](char(0x2c))>=0x0||_0x3f3ab1[_0x02b5('0x62')]()[_0x02b5('0x63')](char(0x22))>=0x0);}function encapsulate(_0x4d5dfe){var _0xb99c6e=char(0x22),_0x5e1219='\x5c'+char(0x22),_0x439344=_0x4d5dfe['toString']()['replace'](new RegExp(_0xb99c6e,'g'),_0x5e1219);return _0xb99c6e+_0x439344+_0xb99c6e;}exports['getSummary']=function(_0x10d547,_0x3de207,_0x46b1a2){var _0x4fe170,_0x11d0e1;var _0x21dc4e={'where':{'ProjectId':_0x10d547[_0x02b5('0x47')]['id']}};if(_0x10d547['query'][_0x02b5('0x64')]){_0x21dc4e[_0x02b5('0x3a')]['starttime']=JSON[_0x02b5('0x65')](_0x10d547[_0x02b5('0x34')][_0x02b5('0x64')]);}return db[_0x02b5('0x5b')]['findAll'](_0x21dc4e)[_0x02b5('0x24')](handleEntityNotFound(_0x3de207,null))[_0x02b5('0x24')](function(_0x59bd06){if(_0x59bd06){_0x4fe170=_0x59bd06;return db[_0x02b5('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0x02b5('0x2d')](_0x4fe170,'id')},'ProjectId':_0x10d547[_0x02b5('0x47')]['id']},'order':_0x02b5('0x67')});}})[_0x02b5('0x24')](handleEntityNotFound(_0x3de207,null))[_0x02b5('0x24')](function(_0x48d69e){if(_0x48d69e){_0x11d0e1=_0x48d69e;var _0xe75b07={};for(var _0x284a3f=0x0,_0x36c53b=_0x11d0e1[_0x02b5('0x36')];_0x284a3f<_0x36c53b;_0x284a3f++){if(!_0xe75b07[_0x02b5('0x37')](_0x11d0e1[_0x284a3f][_0x02b5('0x68')])){_0xe75b07[_0x11d0e1[_0x284a3f][_0x02b5('0x68')]]=needsEncapsulation(_0x11d0e1[_0x284a3f][_0x02b5('0x69')])?encapsulate(_0x11d0e1[_0x284a3f][_0x02b5('0x69')]):_0x11d0e1[_0x284a3f]['question'];}}var _0x14587d=[],_0x2d16af={};for(var _0x448f75=0x0,_0x30e1fd=_0x4fe170[_0x02b5('0x36')];_0x448f75<_0x30e1fd;_0x448f75++){_0x2d16af={'ProjectId':_0x10d547['params']['id'],'SessionId':_0x4fe170[_0x448f75]['id'],'StartTime':moment(_0x4fe170[_0x448f75]['starttime'])[_0x02b5('0x6a')](_0x02b5('0x6b'))};for(var _0x4061c8=0x0,_0x26ad19=_0x11d0e1['length'];_0x4061c8<_0x26ad19;_0x4061c8++){if(_0x11d0e1[_0x4061c8][_0x02b5('0x6c')]==_0x4fe170[_0x448f75]['id']&&_0xe75b07[_0x02b5('0x37')](_0x11d0e1[_0x4061c8][_0x02b5('0x68')])){_0x2d16af[_0xe75b07[_0x11d0e1[_0x4061c8]['questionId']]]=_0x11d0e1[_0x4061c8][_0x02b5('0x6d')];}}for(var _0x5f5336 in _0xe75b07){if(!_0x2d16af[_0x02b5('0x37')](_0xe75b07[_0x5f5336])){_0x2d16af[_0xe75b07[_0x5f5336]]=null;}}_0x14587d[_0x02b5('0x6e')](_0x2d16af);}return _0x14587d;}})[_0x02b5('0x24')](function(_0x43f71e){if(!_[_0x02b5('0x6f')](_0x43f71e)){var _0x132147=toCsv(_0x43f71e);var _0x2b4c51=Date[_0x02b5('0x70')]();fs[_0x02b5('0x71')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x10d547[_0x02b5('0x47')]['id'],_0x2b4c51),_0x132147);_0x3de207['setHeader']('Content-disposition','attachment;\x20filename='+util[_0x02b5('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x10d547['params']['id'],_0x2b4c51));_0x3de207[_0x02b5('0x72')](_0x02b5('0x73'),_0x02b5('0x74'));return _0x3de207[_0x02b5('0x75')](util[_0x02b5('0x6a')](_0x02b5('0x76'),_0x10d547['params']['id'],_0x2b4c51));}else{return _0x3de207[_0x02b5('0x18')](0xcc);}})[_0x02b5('0x45')](handleError(_0x3de207,null));}; \ No newline at end of file +var _0xd6cb=['end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','clone','omit','updatedAt','createdAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getSessions','JscriptySessionReport','pick','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x307c64,_0x505f1a){var _0x53bf8b=function(_0x56cedc){while(--_0x56cedc){_0x307c64['push'](_0x307c64['shift']());}};_0x53bf8b(++_0x505f1a);}(_0xd6cb,0x1cb));var _0xbd6c=function(_0x58a239,_0x4b5d29){_0x58a239=_0x58a239-0x0;var _0x3ba432=_0xd6cb[_0x58a239];return _0x3ba432;};'use strict';var emlformat=require(_0xbd6c('0x0'));var rimraf=require(_0xbd6c('0x1'));var zipdir=require(_0xbd6c('0x2'));var jsonpatch=require(_0xbd6c('0x3'));var rp=require(_0xbd6c('0x4'));var moment=require(_0xbd6c('0x5'));var BPromise=require(_0xbd6c('0x6'));var Mustache=require(_0xbd6c('0x7'));var util=require(_0xbd6c('0x8'));var path=require('path');var sox=require(_0xbd6c('0x9'));var csv=require(_0xbd6c('0xa'));var ejs=require(_0xbd6c('0xb'));var fs=require('fs');var fs_extra=require(_0xbd6c('0xc'));var _=require(_0xbd6c('0xd'));var squel=require(_0xbd6c('0xe'));var crypto=require('crypto');var jsforce=require(_0xbd6c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbd6c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd6c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbd6c('0x11'));var as=require(_0xbd6c('0x12'));var hardwareService=require(_0xbd6c('0x13'));var logger=require('../../config/logger')(_0xbd6c('0x14'));var utils=require(_0xbd6c('0x15'));var config=require(_0xbd6c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd6c('0x17'))['db'];function respondWithStatusCode(_0x2227f3,_0x953ca){_0x953ca=_0x953ca||0xcc;return function(_0x5102d7){if(_0x5102d7){return _0x2227f3[_0xbd6c('0x18')](_0x953ca);}return _0x2227f3['status'](_0x953ca)[_0xbd6c('0x19')]();};}function respondWithResult(_0x1842a8,_0x3494e5){_0x3494e5=_0x3494e5||0xc8;return function(_0xc03b7c){if(_0xc03b7c){return _0x1842a8[_0xbd6c('0x1a')](_0x3494e5)[_0xbd6c('0x1b')](_0xc03b7c);}};}function respondWithFilteredResult(_0x4d0776,_0xc9328b){return function(_0x3f8835){if(_0x3f8835){var _0xc69f45=typeof _0xc9328b['offset']===_0xbd6c('0x1c')&&typeof _0xc9328b[_0xbd6c('0x1d')]==='undefined';var _0x26aef8=_0x3f8835[_0xbd6c('0x1e')];var _0x11adc6=_0xc69f45?0x0:_0xc9328b[_0xbd6c('0x1f')];var _0x359f80=_0xc69f45?_0x3f8835[_0xbd6c('0x1e')]:_0xc9328b[_0xbd6c('0x1f')]+_0xc9328b[_0xbd6c('0x1d')];var _0x3ac9fc;if(_0x359f80>=_0x26aef8){_0x359f80=_0x26aef8;_0x3ac9fc=0xc8;}else{_0x3ac9fc=0xce;}_0x4d0776[_0xbd6c('0x1a')](_0x3ac9fc);return _0x4d0776[_0xbd6c('0x20')](_0xbd6c('0x21'),_0x11adc6+'-'+_0x359f80+'/'+_0x26aef8)['json'](_0x3f8835);}return null;};}function patchUpdates(_0xe9603a){return function(_0x2b5643){try{jsonpatch[_0xbd6c('0x22')](_0x2b5643,_0xe9603a,!![]);}catch(_0x7eba45){return BPromise[_0xbd6c('0x23')](_0x7eba45);}return _0x2b5643['save']();};}function saveUpdates(_0x2a6972,_0x743130){return function(_0x4b9754){if(_0x4b9754){return _0x4b9754['update'](_0x2a6972)[_0xbd6c('0x24')](function(_0x400eca){return _0x400eca;});}return null;};}function removeEntity(_0x533d42,_0x74d03b){return function(_0x292e63){if(_0x292e63){return _0x292e63['destroy']()[_0xbd6c('0x24')](function(){var _0x3ee7e8=_0x292e63['get']({'plain':!![]});var _0xe9bb87=_0xbd6c('0x25');return db[_0xbd6c('0x26')][_0xbd6c('0x27')]({'where':{'type':_0xe9bb87,'resourceId':_0x3ee7e8['id']}})['then'](function(){return _0x292e63;});})[_0xbd6c('0x24')](function(){_0x533d42[_0xbd6c('0x1a')](0xcc)[_0xbd6c('0x19')]();});}};}function handleEntityNotFound(_0x175dd9,_0x19e6cf){return function(_0x40e6f8){if(!_0x40e6f8){_0x175dd9[_0xbd6c('0x18')](0x194);}return _0x40e6f8;};}function handleError(_0x55566c,_0x1b7d8d){_0x1b7d8d=_0x1b7d8d||0x1f4;return function(_0x13d8cd){logger[_0xbd6c('0x28')](_0x13d8cd[_0xbd6c('0x29')]);if(_0x13d8cd[_0xbd6c('0x2a')]){delete _0x13d8cd[_0xbd6c('0x2a')];}_0x55566c[_0xbd6c('0x1a')](_0x1b7d8d)[_0xbd6c('0x2b')](_0x13d8cd);};}exports[_0xbd6c('0x2c')]=function(_0xb35178,_0x489ad4){var _0x224bc3={},_0x5c659f={},_0x5d6a0f={'count':0x0,'rows':[]};var _0x21a440=_[_0xbd6c('0x2d')](db[_0xbd6c('0x2e')][_0xbd6c('0x2f')],function(_0x5b6bb3){return{'name':_0x5b6bb3['fieldName'],'type':_0x5b6bb3['type'][_0xbd6c('0x30')]};});_0x5c659f[_0xbd6c('0x31')]=_[_0xbd6c('0x2d')](_0x21a440,_0xbd6c('0x2a'));_0x5c659f[_0xbd6c('0x32')]=_[_0xbd6c('0x33')](_0xb35178['query']);_0x5c659f[_0xbd6c('0x34')]=_[_0xbd6c('0x35')](_0x5c659f[_0xbd6c('0x31')],_0x5c659f[_0xbd6c('0x32')]);_0x224bc3[_0xbd6c('0x36')]=_[_0xbd6c('0x35')](_0x5c659f[_0xbd6c('0x31')],qs[_0xbd6c('0x37')](_0xb35178[_0xbd6c('0x32')]['fields']));_0x224bc3[_0xbd6c('0x36')]=_0x224bc3[_0xbd6c('0x36')][_0xbd6c('0x38')]?_0x224bc3[_0xbd6c('0x36')]:_0x5c659f[_0xbd6c('0x31')];if(!_0xb35178[_0xbd6c('0x32')][_0xbd6c('0x39')](_0xbd6c('0x3a'))){_0x224bc3['limit']=qs[_0xbd6c('0x1d')](_0xb35178[_0xbd6c('0x32')][_0xbd6c('0x1d')]);_0x224bc3[_0xbd6c('0x1f')]=qs['offset'](_0xb35178[_0xbd6c('0x32')]['offset']);}_0x224bc3[_0xbd6c('0x3b')]=qs[_0xbd6c('0x3c')](_0xb35178['query'][_0xbd6c('0x3c')]);_0x224bc3[_0xbd6c('0x3d')]=qs[_0xbd6c('0x34')](_['pick'](_0xb35178[_0xbd6c('0x32')],_0x5c659f[_0xbd6c('0x34')]),_0x21a440);if(_0xb35178['query'][_0xbd6c('0x3e')]){_0x224bc3[_0xbd6c('0x3d')]=_[_0xbd6c('0x3f')](_0x224bc3[_0xbd6c('0x3d')],{'$or':_[_0xbd6c('0x2d')](_0x21a440,function(_0xad6570){if(_0xad6570[_0xbd6c('0x40')]!==_0xbd6c('0x41')){var _0x2a6e4e={};_0x2a6e4e[_0xad6570['name']]={'$like':'%'+_0xb35178[_0xbd6c('0x32')][_0xbd6c('0x3e')]+'%'};return _0x2a6e4e;}})});}_0x224bc3=_[_0xbd6c('0x3f')]({},_0x224bc3,_0xb35178[_0xbd6c('0x42')]);var _0x24ee0c={'where':_0x224bc3[_0xbd6c('0x3d')]};return db['JscriptyProject'][_0xbd6c('0x1e')](_0x24ee0c)['then'](function(_0x17b2ed){_0x5d6a0f[_0xbd6c('0x1e')]=_0x17b2ed;if(_0xb35178[_0xbd6c('0x32')][_0xbd6c('0x43')]){_0x224bc3['include']=[{'all':!![]}];}return db[_0xbd6c('0x2e')][_0xbd6c('0x44')](_0x224bc3);})['then'](function(_0x5fb461){_0x5d6a0f[_0xbd6c('0x45')]=_0x5fb461;return _0x5d6a0f;})[_0xbd6c('0x24')](respondWithFilteredResult(_0x489ad4,_0x224bc3))['catch'](handleError(_0x489ad4,null));};exports['show']=function(_0x17d8b8,_0x1d64b2){var _0x46ce33={'raw':![],'where':{'id':_0x17d8b8[_0xbd6c('0x46')]['id']}},_0x2d6890={};_0x2d6890[_0xbd6c('0x31')]=_[_0xbd6c('0x33')](db[_0xbd6c('0x2e')][_0xbd6c('0x2f')]);_0x2d6890[_0xbd6c('0x32')]=_[_0xbd6c('0x33')](_0x17d8b8[_0xbd6c('0x32')]);_0x2d6890['filters']=_[_0xbd6c('0x35')](_0x2d6890[_0xbd6c('0x31')],_0x2d6890[_0xbd6c('0x32')]);_0x46ce33[_0xbd6c('0x36')]=_[_0xbd6c('0x35')](_0x2d6890[_0xbd6c('0x31')],qs[_0xbd6c('0x37')](_0x17d8b8[_0xbd6c('0x32')][_0xbd6c('0x37')]));_0x46ce33[_0xbd6c('0x36')]=_0x46ce33['attributes'][_0xbd6c('0x38')]?_0x46ce33[_0xbd6c('0x36')]:_0x2d6890[_0xbd6c('0x31')];if(_0x17d8b8[_0xbd6c('0x32')][_0xbd6c('0x43')]){_0x46ce33[_0xbd6c('0x47')]=[{'all':!![]}];}_0x46ce33=_[_0xbd6c('0x3f')]({},_0x46ce33,_0x17d8b8[_0xbd6c('0x42')]);return db['JscriptyProject'][_0xbd6c('0x48')](_0x46ce33)['then'](handleEntityNotFound(_0x1d64b2,null))[_0xbd6c('0x24')](respondWithResult(_0x1d64b2,null))[_0xbd6c('0x49')](handleError(_0x1d64b2,null));};exports[_0xbd6c('0x4a')]=function(_0x30162f,_0x943ee6){return db[_0xbd6c('0x2e')][_0xbd6c('0x4a')](_0x30162f[_0xbd6c('0x4b')],{})[_0xbd6c('0x24')](function(_0x42833e){var _0x4fe96e=_0x30162f['user'][_0xbd6c('0x4c')]({'plain':!![]});if(!_0x4fe96e)throw new Error(_0xbd6c('0x4d'));if(_0x4fe96e[_0xbd6c('0x4e')]===_0xbd6c('0x4f')){var _0xccbf32=_0x42833e[_0xbd6c('0x4c')]({'plain':!![]});var _0x22428b='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x22428b,'userProfileId':_0x4fe96e['userProfileId']},'raw':!![]})[_0xbd6c('0x24')](function(_0x45d680){if(_0x45d680&&_0x45d680[_0xbd6c('0x50')]===0x0){return db[_0xbd6c('0x26')][_0xbd6c('0x4a')]({'name':_0xccbf32['name'],'resourceId':_0xccbf32['id'],'type':_0x45d680[_0xbd6c('0x2a')],'sectionId':_0x45d680['id']},{})[_0xbd6c('0x24')](function(){return _0x42833e;});}else{return _0x42833e;}})[_0xbd6c('0x49')](function(_0x230602){logger[_0xbd6c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x230602);throw _0x230602;});}return _0x42833e;})[_0xbd6c('0x24')](respondWithResult(_0x943ee6,0xc9))['catch'](handleError(_0x943ee6,null));};exports[_0xbd6c('0x51')]=function(_0x1f49ae,_0x29f694){var _0x24e076={'where':{'id':_0x1f49ae['params']['id']}},_0x46a30c={};_0x46a30c[_0xbd6c('0x31')]=_[_0xbd6c('0x33')](db[_0xbd6c('0x2e')][_0xbd6c('0x2f')]);_0x24e076['attributes']=_['intersection'](_0x46a30c[_0xbd6c('0x31')],qs[_0xbd6c('0x37')](_0x1f49ae[_0xbd6c('0x32')]['fields']));_0x24e076[_0xbd6c('0x36')]=_0x24e076['attributes'][_0xbd6c('0x38')]?_0x24e076[_0xbd6c('0x36')]:_0x46a30c[_0xbd6c('0x31')];if(_0x1f49ae[_0xbd6c('0x32')][_0xbd6c('0x43')]){_0x24e076[_0xbd6c('0x47')]=[{'all':!![]}];}_0x24e076=_[_0xbd6c('0x3f')]({},_0x24e076,_0x1f49ae[_0xbd6c('0x42')]);return db[_0xbd6c('0x2e')][_0xbd6c('0x48')](_0x24e076)['then'](handleEntityNotFound(_0x29f694,null))[_0xbd6c('0x24')](function(_0x52601c){if(_0x52601c){var _0x2a2144=_0x52601c[_0xbd6c('0x4c')]({'plain':!![]});_0x2a2144=qs[_0xbd6c('0x52')](_0x2a2144,['id','createdAt',_0xbd6c('0x53')]);_0x1f49ae[_0xbd6c('0x4b')]=_[_0xbd6c('0x52')](_0x1f49ae[_0xbd6c('0x4b')],['id',_0xbd6c('0x54'),'updatedAt']);return db[_0xbd6c('0x2e')][_0xbd6c('0x4a')](_[_0xbd6c('0x3f')](_0x2a2144,_0x1f49ae[_0xbd6c('0x4b')]),{'include':_0x1f49ae[_0xbd6c('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xbd6c('0x24')](function(_0x42740a){var _0x56d937=_0x1f49ae[_0xbd6c('0x4f')][_0xbd6c('0x4c')]({'plain':!![]});if(!_0x56d937)throw new Error(_0xbd6c('0x4d'));if(_0x56d937['role']==='user'){var _0x479802=_0x42740a[_0xbd6c('0x4c')]({'plain':!![]});var _0x39fce4='Projects';return db[_0xbd6c('0x55')][_0xbd6c('0x48')]({'where':{'name':_0x39fce4,'userProfileId':_0x56d937['userProfileId']},'raw':!![]})[_0xbd6c('0x24')](function(_0x43d5e9){if(_0x43d5e9&&_0x43d5e9[_0xbd6c('0x50')]===0x0){return db[_0xbd6c('0x26')][_0xbd6c('0x4a')]({'name':_0x479802['name'],'resourceId':_0x479802['id'],'type':_0x43d5e9['name'],'sectionId':_0x43d5e9['id']},{})[_0xbd6c('0x24')](function(){return _0x42740a;});}else{return _0x42740a;}})['catch'](function(_0x8a755f){logger[_0xbd6c('0x28')](_0xbd6c('0x56'),_0x8a755f);throw _0x8a755f;});}return _0x42740a;});}})[_0xbd6c('0x24')](respondWithResult(_0x29f694,0xc9))['catch'](handleError(_0x29f694,null));};exports[_0xbd6c('0x57')]=function(_0x475c2c,_0xb38f8a){if(_0x475c2c['body']['id']){delete _0x475c2c[_0xbd6c('0x4b')]['id'];}return db[_0xbd6c('0x2e')][_0xbd6c('0x48')]({'where':{'id':_0x475c2c['params']['id']}})[_0xbd6c('0x24')](handleEntityNotFound(_0xb38f8a,null))[_0xbd6c('0x24')](saveUpdates(_0x475c2c[_0xbd6c('0x4b')],null))[_0xbd6c('0x24')](respondWithResult(_0xb38f8a,null))[_0xbd6c('0x49')](handleError(_0xb38f8a,null));};exports[_0xbd6c('0x27')]=function(_0x3c7677,_0x247f86){return db[_0xbd6c('0x2e')]['find']({'where':{'id':_0x3c7677[_0xbd6c('0x46')]['id']}})[_0xbd6c('0x24')](handleEntityNotFound(_0x247f86,null))[_0xbd6c('0x24')](removeEntity(_0x247f86,null))[_0xbd6c('0x49')](handleError(_0x247f86,null));};exports[_0xbd6c('0x58')]=function(_0x28605c,_0x447f2c,_0x3d7409){var _0x78c65e={'raw':!![],'where':{}};var _0x42f717={};var _0x1c5abe={'count':0x0,'rows':[]};return db[_0xbd6c('0x2e')]['findOne']({'where':{'id':_0x28605c[_0xbd6c('0x46')]['id']}})[_0xbd6c('0x24')](handleEntityNotFound(_0x447f2c,null))[_0xbd6c('0x24')](function(_0x5dd37f){if(_0x5dd37f){_0x42f717['model']=_[_0xbd6c('0x33')](db[_0xbd6c('0x59')][_0xbd6c('0x2f')]);_0x42f717[_0xbd6c('0x32')]=_['keys'](_0x28605c['query']);_0x42f717[_0xbd6c('0x34')]=_[_0xbd6c('0x35')](_0x42f717[_0xbd6c('0x31')],_0x42f717[_0xbd6c('0x32')]);_0x78c65e['attributes']=_['intersection'](_0x42f717[_0xbd6c('0x31')],qs[_0xbd6c('0x37')](_0x28605c[_0xbd6c('0x32')]['fields']));_0x78c65e[_0xbd6c('0x36')]=_0x78c65e[_0xbd6c('0x36')]['length']?_0x78c65e[_0xbd6c('0x36')]:_0x42f717[_0xbd6c('0x31')];if(!_0x28605c['query'][_0xbd6c('0x39')](_0xbd6c('0x3a'))){_0x78c65e[_0xbd6c('0x1d')]=qs[_0xbd6c('0x1d')](_0x28605c[_0xbd6c('0x32')][_0xbd6c('0x1d')]);_0x78c65e[_0xbd6c('0x1f')]=qs['offset'](_0x28605c[_0xbd6c('0x32')]['offset']);}_0x78c65e[_0xbd6c('0x3b')]=qs[_0xbd6c('0x3c')](_0x28605c['query'][_0xbd6c('0x3c')]);_0x78c65e['where']=qs[_0xbd6c('0x34')](_[_0xbd6c('0x5a')](_0x28605c[_0xbd6c('0x32')],_0x42f717[_0xbd6c('0x34')]));_0x78c65e[_0xbd6c('0x3d')][_0xbd6c('0x5b')]=_0x5dd37f['id'];if(_0x28605c[_0xbd6c('0x32')]['filter']){_0x78c65e[_0xbd6c('0x3d')]=_[_0xbd6c('0x3f')](_0x78c65e[_0xbd6c('0x3d')],{'$or':_[_0xbd6c('0x2d')](_0x78c65e[_0xbd6c('0x36')],function(_0x5aaa26){var _0x576598={};_0x576598[_0x5aaa26]={'$like':'%'+_0x28605c[_0xbd6c('0x32')][_0xbd6c('0x3e')]+'%'};return _0x576598;})});}_0x78c65e=_[_0xbd6c('0x3f')]({},_0x78c65e,_0x28605c[_0xbd6c('0x42')]);return db[_0xbd6c('0x59')]['count']({'where':_0x78c65e[_0xbd6c('0x3d')]})[_0xbd6c('0x24')](function(_0x209c3b){_0x1c5abe[_0xbd6c('0x1e')]=_0x209c3b;if(_0x28605c['query'][_0xbd6c('0x43')]){_0x78c65e[_0xbd6c('0x47')]=[{'all':!![]}];}return db[_0xbd6c('0x59')]['findAll'](_0x78c65e);})[_0xbd6c('0x24')](function(_0x41102e){_0x1c5abe[_0xbd6c('0x45')]=_0x41102e;return _0x1c5abe;});}})['then'](respondWithFilteredResult(_0x447f2c,_0x78c65e))[_0xbd6c('0x49')](handleError(_0x447f2c,null));};exports['getAnswers']=function(_0x3b0cbd,_0x424c3a,_0x2bedaa){var _0x52025a={'raw':!![],'where':{}};var _0x504ee9={};var _0x2316b9={'count':0x0,'rows':[]};return db[_0xbd6c('0x2e')][_0xbd6c('0x5c')]({'where':{'id':_0x3b0cbd[_0xbd6c('0x46')]['id']}})[_0xbd6c('0x24')](handleEntityNotFound(_0x424c3a,null))[_0xbd6c('0x24')](function(_0x272280){if(_0x272280){_0x504ee9[_0xbd6c('0x31')]=_[_0xbd6c('0x33')](db['JscriptyAnswerReport'][_0xbd6c('0x2f')]);_0x504ee9[_0xbd6c('0x32')]=_[_0xbd6c('0x33')](_0x3b0cbd['query']);_0x504ee9[_0xbd6c('0x34')]=_[_0xbd6c('0x35')](_0x504ee9[_0xbd6c('0x31')],_0x504ee9[_0xbd6c('0x32')]);_0x52025a[_0xbd6c('0x36')]=_['intersection'](_0x504ee9['model'],qs['fields'](_0x3b0cbd[_0xbd6c('0x32')][_0xbd6c('0x37')]));_0x52025a[_0xbd6c('0x36')]=_0x52025a[_0xbd6c('0x36')][_0xbd6c('0x38')]?_0x52025a[_0xbd6c('0x36')]:_0x504ee9[_0xbd6c('0x31')];if(!_0x3b0cbd[_0xbd6c('0x32')]['hasOwnProperty']('nolimit')){_0x52025a[_0xbd6c('0x1d')]=qs[_0xbd6c('0x1d')](_0x3b0cbd[_0xbd6c('0x32')][_0xbd6c('0x1d')]);_0x52025a[_0xbd6c('0x1f')]=qs[_0xbd6c('0x1f')](_0x3b0cbd[_0xbd6c('0x32')][_0xbd6c('0x1f')]);}_0x52025a[_0xbd6c('0x3b')]=qs[_0xbd6c('0x3c')](_0x3b0cbd['query'][_0xbd6c('0x3c')]);_0x52025a[_0xbd6c('0x3d')]=qs[_0xbd6c('0x34')](_['pick'](_0x3b0cbd[_0xbd6c('0x32')],_0x504ee9[_0xbd6c('0x34')]));_0x52025a[_0xbd6c('0x3d')][_0xbd6c('0x5b')]=_0x272280['id'];if(_0x3b0cbd['query'][_0xbd6c('0x3e')]){_0x52025a['where']=_['merge'](_0x52025a[_0xbd6c('0x3d')],{'$or':_['map'](_0x52025a[_0xbd6c('0x36')],function(_0x341988){var _0x3df2f7={};_0x3df2f7[_0x341988]={'$like':'%'+_0x3b0cbd[_0xbd6c('0x32')][_0xbd6c('0x3e')]+'%'};return _0x3df2f7;})});}_0x52025a=_[_0xbd6c('0x3f')]({},_0x52025a,_0x3b0cbd[_0xbd6c('0x42')]);return db['JscriptyAnswerReport'][_0xbd6c('0x1e')]({'where':_0x52025a[_0xbd6c('0x3d')]})[_0xbd6c('0x24')](function(_0x53a68){_0x2316b9['count']=_0x53a68;if(_0x3b0cbd[_0xbd6c('0x32')][_0xbd6c('0x43')]){_0x52025a[_0xbd6c('0x47')]=[{'all':!![]}];}return db[_0xbd6c('0x5d')][_0xbd6c('0x44')](_0x52025a);})[_0xbd6c('0x24')](function(_0x4b6ed4){_0x2316b9[_0xbd6c('0x45')]=_0x4b6ed4;return _0x2316b9;});}})[_0xbd6c('0x24')](respondWithFilteredResult(_0x424c3a,_0x52025a))[_0xbd6c('0x49')](handleError(_0x424c3a,null));};function char(_0xe5e3f6){return _0xbd6c('0x5e')===typeof _0xe5e3f6?String[_0xbd6c('0x5f')][_0xbd6c('0x22')](null,arguments):_0xe5e3f6;}function needsEncapsulation(_0x38e9d2){return!!_0x38e9d2&&(_0x38e9d2[_0xbd6c('0x60')]()[_0xbd6c('0x61')](char(0xd))>=0x0||_0x38e9d2['toString']()[_0xbd6c('0x61')](char(0xa))>=0x0||_0x38e9d2[_0xbd6c('0x60')]()[_0xbd6c('0x61')](char(0x2c))>=0x0||_0x38e9d2[_0xbd6c('0x60')]()[_0xbd6c('0x61')](char(0x22))>=0x0);}function encapsulate(_0x39fa20){var _0x571605=char(0x22),_0x5e42a0='\x5c'+char(0x22),_0x3d9d10=_0x39fa20['toString']()['replace'](new RegExp(_0x571605,'g'),_0x5e42a0);return _0x571605+_0x3d9d10+_0x571605;}exports[_0xbd6c('0x62')]=function(_0x538c05,_0x1bca68,_0x66143){var _0xbda0d,_0x46b7cd;var _0x4cc0ed={'where':{'ProjectId':_0x538c05[_0xbd6c('0x46')]['id']}};if(_0x538c05[_0xbd6c('0x32')]['startTime']){_0x4cc0ed['where'][_0xbd6c('0x63')]=JSON[_0xbd6c('0x64')](_0x538c05[_0xbd6c('0x32')][_0xbd6c('0x65')]);}return db[_0xbd6c('0x59')][_0xbd6c('0x44')](_0x4cc0ed)[_0xbd6c('0x24')](handleEntityNotFound(_0x1bca68,null))[_0xbd6c('0x24')](function(_0x25937e){if(_0x25937e){_0xbda0d=_0x25937e;return db[_0xbd6c('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0xbd6c('0x2d')](_0xbda0d,'id')},'ProjectId':_0x538c05['params']['id']},'order':_0xbd6c('0x67')});}})[_0xbd6c('0x24')](handleEntityNotFound(_0x1bca68,null))[_0xbd6c('0x24')](function(_0x145d04){if(_0x145d04){_0x46b7cd=_0x145d04;var _0x12e8ab={};for(var _0x3b3981=0x0,_0x5640db=_0x46b7cd[_0xbd6c('0x38')];_0x3b3981<_0x5640db;_0x3b3981++){if(!_0x12e8ab['hasOwnProperty'](_0x46b7cd[_0x3b3981]['questionId'])){_0x12e8ab[_0x46b7cd[_0x3b3981]['questionId']]=needsEncapsulation(_0x46b7cd[_0x3b3981][_0xbd6c('0x68')])?encapsulate(_0x46b7cd[_0x3b3981][_0xbd6c('0x68')]):_0x46b7cd[_0x3b3981][_0xbd6c('0x68')];}}var _0x52887c=[],_0x21eb59={};for(var _0x1a7e35=0x0,_0x5185b5=_0xbda0d[_0xbd6c('0x38')];_0x1a7e35<_0x5185b5;_0x1a7e35++){_0x21eb59={'ProjectId':_0x538c05['params']['id'],'SessionId':_0xbda0d[_0x1a7e35]['id'],'StartTime':moment(_0xbda0d[_0x1a7e35]['starttime'])[_0xbd6c('0x69')](_0xbd6c('0x6a'))};for(var _0x1f82c9=0x0,_0x5b683f=_0x46b7cd[_0xbd6c('0x38')];_0x1f82c9<_0x5b683f;_0x1f82c9++){if(_0x46b7cd[_0x1f82c9][_0xbd6c('0x6b')]==_0xbda0d[_0x1a7e35]['id']&&_0x12e8ab[_0xbd6c('0x39')](_0x46b7cd[_0x1f82c9][_0xbd6c('0x6c')])){_0x21eb59[_0x12e8ab[_0x46b7cd[_0x1f82c9][_0xbd6c('0x6c')]]]=_0x46b7cd[_0x1f82c9][_0xbd6c('0x6d')];}}for(var _0x6b9d2 in _0x12e8ab){if(!_0x21eb59[_0xbd6c('0x39')](_0x12e8ab[_0x6b9d2])){_0x21eb59[_0x12e8ab[_0x6b9d2]]=null;}}_0x52887c[_0xbd6c('0x6e')](_0x21eb59);}return _0x52887c;}})[_0xbd6c('0x24')](function(_0x26514f){if(!_[_0xbd6c('0x6f')](_0x26514f)){var _0xe5215f=toCsv(_0x26514f);var _0x3b6cf4=Date[_0xbd6c('0x70')]();fs[_0xbd6c('0x71')](util[_0xbd6c('0x69')](_0xbd6c('0x72'),_0x538c05['params']['id'],_0x3b6cf4),_0xe5215f);_0x1bca68[_0xbd6c('0x73')](_0xbd6c('0x74'),_0xbd6c('0x75')+util[_0xbd6c('0x69')](_0xbd6c('0x76'),_0x538c05[_0xbd6c('0x46')]['id'],_0x3b6cf4));_0x1bca68[_0xbd6c('0x73')]('Content-type',_0xbd6c('0x77'));return _0x1bca68[_0xbd6c('0x78')](util[_0xbd6c('0x69')](_0xbd6c('0x72'),_0x538c05[_0xbd6c('0x46')]['id'],_0x3b6cf4));}else{return _0x1bca68[_0xbd6c('0x18')](0xcc);}})[_0xbd6c('0x49')](handleError(_0x1bca68,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index ba4bf4e..b51e42c 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 _0x0c02=['./jscriptyProject.attributes','exports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57de3c,_0x18693f){var _0x3d6ab0=function(_0x5773a8){while(--_0x5773a8){_0x57de3c['push'](_0x57de3c['shift']());}};_0x3d6ab0(++_0x18693f);}(_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']('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfe8=['jscripty_projects','util','api','moment','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x155506,_0x202f81){var _0x14b973=function(_0x560bd2){while(--_0x560bd2){_0x155506['push'](_0x155506['shift']());}};_0x14b973(++_0x202f81);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x537336,_0xa00da2){_0x537336=_0x537336-0x0;var _0xaab50d=_0xbfe8[_0x537336];return _0xaab50d;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var logger=require('../../config/logger')(_0x8bfe('0x1'));var moment=require(_0x8bfe('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bfe('0x3'));var rimraf=require(_0x8bfe('0x4'));var config=require('../../config/environment');var attributes=require(_0x8bfe('0x5'));module[_0x8bfe('0x6')]=function(_0x314a9a,_0x4933c9){return _0x314a9a[_0x8bfe('0x7')](_0x8bfe('0x8'),attributes,{'tableName':_0x8bfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 50a6e17..9e7d033 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x529b45,_0x1be540){var _0x4d9b8b=function(_0x48195d){while(--_0x48195d){_0x529b45['push'](_0x529b45['shift']());}};_0x4d9b8b(++_0x1be540);}(_0x70e0,0x17b));var _0x070e=function(_0x428f75,_0x585a1c){_0x428f75=_0x428f75-0x0;var _0x1ab95a=_0x70e0[_0x428f75];return _0x1ab95a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4e1ef7,_0x349fa5){_0x4e1ef7=_0x4e1ef7-0x0;var _0x20f191=_0xbdb7[_0x4e1ef7];return _0x20f191;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 62fe29c..47744ec 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 _0xcbd4=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x452cb0,_0x465fff){var _0x1f9ca7=function(_0x5c9457){while(--_0x5c9457){_0x452cb0['push'](_0x452cb0['shift']());}};_0x1f9ca7(++_0x465fff);}(_0xcbd4,0x8f));var _0x4cbd=function(_0x2f1898,_0x5a80c9){_0x2f1898=_0x2f1898-0x0;var _0x514306=_0xcbd4[_0x2f1898];return _0x514306;};'use strict';var multer=require('multer');var util=require(_0x4cbd('0x0'));var path=require(_0x4cbd('0x1'));var timeout=require(_0x4cbd('0x2'));var express=require(_0x4cbd('0x3'));var router=express[_0x4cbd('0x4')]();var fs_extra=require(_0x4cbd('0x5'));var auth=require(_0x4cbd('0x6'));var interaction=require(_0x4cbd('0x7'));var config=require(_0x4cbd('0x8'));var controller=require(_0x4cbd('0x9'));router['get']('/',auth[_0x4cbd('0xa')](),controller[_0x4cbd('0xb')]);router[_0x4cbd('0xc')](_0x4cbd('0xd'),auth['isAuthenticated'](),controller[_0x4cbd('0xe')]);router[_0x4cbd('0xc')](_0x4cbd('0xf'),auth[_0x4cbd('0xa')](),controller[_0x4cbd('0x10')]);router[_0x4cbd('0x11')]('/',auth['isAuthenticated'](),controller[_0x4cbd('0x12')]);router[_0x4cbd('0x13')](_0x4cbd('0xf'),auth[_0x4cbd('0xa')](),controller[_0x4cbd('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4cbd('0x15')]);module[_0x4cbd('0x16')]=router; \ No newline at end of file +var _0x512a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xd4ae3f,_0x410d0f){var _0x52e69b=function(_0x454872){while(--_0x454872){_0xd4ae3f['push'](_0xd4ae3f['shift']());}};_0x52e69b(++_0x410d0f);}(_0x512a,0xd9));var _0xa512=function(_0x52cb67,_0x61d95c){_0x52cb67=_0x52cb67-0x0;var _0xc5a829=_0x512a[_0x52cb67];return _0xc5a829;};'use strict';var multer=require(_0xa512('0x0'));var util=require('util');var path=require(_0xa512('0x1'));var timeout=require(_0xa512('0x2'));var express=require('express');var router=express[_0xa512('0x3')]();var fs_extra=require(_0xa512('0x4'));var auth=require(_0xa512('0x5'));var interaction=require(_0xa512('0x6'));var config=require(_0xa512('0x7'));var controller=require(_0xa512('0x8'));router[_0xa512('0x9')]('/',auth[_0xa512('0xa')](),controller[_0xa512('0xb')]);router[_0xa512('0x9')](_0xa512('0xc'),auth[_0xa512('0xa')](),controller[_0xa512('0xd')]);router[_0xa512('0x9')](_0xa512('0xe'),auth['isAuthenticated'](),controller[_0xa512('0xf')]);router[_0xa512('0x10')]('/',auth[_0xa512('0xa')](),controller[_0xa512('0x11')]);router['put'](_0xa512('0xe'),auth[_0xa512('0xa')](),controller[_0xa512('0x12')]);router[_0xa512('0x13')](_0xa512('0xe'),auth[_0xa512('0xa')](),controller[_0xa512('0x14')]);module[_0xa512('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index c63d05b..bb70d82 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x26a4af,_0x11f12e){_0x26a4af=_0x26a4af-0x0;var _0x462b9b=_0x7a54[_0x26a4af];return _0x462b9b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x23ab9a,_0x1de835){_0x23ab9a=_0x23ab9a-0x0;var _0x5b5c48=_0x7a54[_0x23ab9a];return _0x5b5c48;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 8346a72..8548840 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 _0xd501=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','fast-json-patch','moment','bluebird','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd501,0x83));var _0x1d50=function(_0x54b36d,_0x134c39){_0x54b36d=_0x54b36d-0x0;var _0x5cb86c=_0xd501[_0x54b36d];return _0x5cb86c;};'use strict';var emlformat=require(_0x1d50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d50('0x1'));var rp=require('request-promise');var moment=require(_0x1d50('0x2'));var BPromise=require(_0x1d50('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d50('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d50('0x5'));var _=require(_0x1d50('0x6'));var squel=require(_0x1d50('0x7'));var crypto=require(_0x1d50('0x8'));var jsforce=require(_0x1d50('0x9'));var deskjs=require(_0x1d50('0xa'));var toCsv=require(_0x1d50('0xb'));var querystring=require(_0x1d50('0xc'));var Papa=require('papaparse');var Redis=require(_0x1d50('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1d50('0xe'));var config=require(_0x1d50('0xf'));var licenseUtil=require(_0x1d50('0x10'));var db=require(_0x1d50('0x11'))['db'];function respondWithStatusCode(_0x421774,_0x4c65ce){_0x4c65ce=_0x4c65ce||0xcc;return function(_0x350df8){if(_0x350df8){return _0x421774[_0x1d50('0x12')](_0x4c65ce);}return _0x421774[_0x1d50('0x13')](_0x4c65ce)[_0x1d50('0x14')]();};}function respondWithResult(_0x306b1e,_0x3c73c8){_0x3c73c8=_0x3c73c8||0xc8;return function(_0x383a87){if(_0x383a87){return _0x306b1e[_0x1d50('0x13')](_0x3c73c8)['json'](_0x383a87);}};}function respondWithFilteredResult(_0x5b88a5,_0x2a5542){return function(_0x32779e){if(_0x32779e){var _0x42b45d=typeof _0x2a5542['offset']===_0x1d50('0x15')&&typeof _0x2a5542[_0x1d50('0x16')]===_0x1d50('0x15');var _0x561dd1=_0x32779e[_0x1d50('0x17')];var _0x100325=_0x42b45d?0x0:_0x2a5542[_0x1d50('0x18')];var _0x425736=_0x42b45d?_0x32779e['count']:_0x2a5542[_0x1d50('0x18')]+_0x2a5542[_0x1d50('0x16')];var _0x1b4fd2;if(_0x425736>=_0x561dd1){_0x425736=_0x561dd1;_0x1b4fd2=0xc8;}else{_0x1b4fd2=0xce;}_0x5b88a5[_0x1d50('0x13')](_0x1b4fd2);return _0x5b88a5[_0x1d50('0x19')](_0x1d50('0x1a'),_0x100325+'-'+_0x425736+'/'+_0x561dd1)[_0x1d50('0x1b')](_0x32779e);}return null;};}function patchUpdates(_0x5be8d5){return function(_0x263c0d){try{jsonpatch[_0x1d50('0x1c')](_0x263c0d,_0x5be8d5,!![]);}catch(_0x2e4e43){return BPromise[_0x1d50('0x1d')](_0x2e4e43);}return _0x263c0d[_0x1d50('0x1e')]();};}function saveUpdates(_0x1ebeea,_0x5a1fae){return function(_0x804d73){if(_0x804d73){return _0x804d73['update'](_0x1ebeea)[_0x1d50('0x1f')](function(_0x1114be){return _0x1114be;});}return null;};}function removeEntity(_0x3e8441,_0x1d690a){return function(_0x2da911){if(_0x2da911){return _0x2da911[_0x1d50('0x20')]()['then'](function(){_0x3e8441[_0x1d50('0x13')](0xcc)[_0x1d50('0x14')]();});}};}function handleEntityNotFound(_0x5a4ce3,_0x28b654){return function(_0x4b2604){if(!_0x4b2604){_0x5a4ce3[_0x1d50('0x12')](0x194);}return _0x4b2604;};}function handleError(_0x5a5e2a,_0x3cbb7b){_0x3cbb7b=_0x3cbb7b||0x1f4;return function(_0x8fa9a6){logger[_0x1d50('0x21')](_0x8fa9a6[_0x1d50('0x22')]);if(_0x8fa9a6[_0x1d50('0x23')]){delete _0x8fa9a6[_0x1d50('0x23')];}_0x5a5e2a['status'](_0x3cbb7b)['send'](_0x8fa9a6);};}exports['index']=function(_0x341953,_0x208047){var _0x197320={},_0x376ab4={},_0x13a68b={'count':0x0,'rows':[]};var _0xd38415=_[_0x1d50('0x24')](db[_0x1d50('0x25')][_0x1d50('0x26')],function(_0x488f86){return{'name':_0x488f86[_0x1d50('0x27')],'type':_0x488f86[_0x1d50('0x28')][_0x1d50('0x29')]};});_0x376ab4[_0x1d50('0x2a')]=_['map'](_0xd38415,_0x1d50('0x23'));_0x376ab4[_0x1d50('0x2b')]=_['keys'](_0x341953[_0x1d50('0x2b')]);_0x376ab4[_0x1d50('0x2c')]=_[_0x1d50('0x2d')](_0x376ab4['model'],_0x376ab4['query']);_0x197320[_0x1d50('0x2e')]=_[_0x1d50('0x2d')](_0x376ab4[_0x1d50('0x2a')],qs[_0x1d50('0x2f')](_0x341953[_0x1d50('0x2b')]['fields']));_0x197320[_0x1d50('0x2e')]=_0x197320[_0x1d50('0x2e')][_0x1d50('0x30')]?_0x197320[_0x1d50('0x2e')]:_0x376ab4[_0x1d50('0x2a')];if(!_0x341953['query']['hasOwnProperty']('nolimit')){_0x197320[_0x1d50('0x16')]=qs[_0x1d50('0x16')](_0x341953[_0x1d50('0x2b')][_0x1d50('0x16')]);_0x197320[_0x1d50('0x18')]=qs[_0x1d50('0x18')](_0x341953[_0x1d50('0x2b')][_0x1d50('0x18')]);}_0x197320[_0x1d50('0x31')]=qs[_0x1d50('0x32')](_0x341953[_0x1d50('0x2b')][_0x1d50('0x32')]);_0x197320[_0x1d50('0x33')]=qs['filters'](_['pick'](_0x341953[_0x1d50('0x2b')],_0x376ab4['filters']),_0xd38415);if(_0x341953[_0x1d50('0x2b')][_0x1d50('0x34')]){_0x197320['where']=_[_0x1d50('0x35')](_0x197320['where'],{'$or':_[_0x1d50('0x24')](_0xd38415,function(_0x4f10ff){if(_0x4f10ff[_0x1d50('0x28')]!=='VIRTUAL'){var _0x2a88ab={};_0x2a88ab[_0x4f10ff[_0x1d50('0x23')]]={'$like':'%'+_0x341953[_0x1d50('0x2b')][_0x1d50('0x34')]+'%'};return _0x2a88ab;}})});}_0x197320=_[_0x1d50('0x35')]({},_0x197320,_0x341953[_0x1d50('0x36')]);var _0x15e5db={'where':_0x197320[_0x1d50('0x33')]};return db['JscriptyQuestionReport'][_0x1d50('0x17')](_0x15e5db)['then'](function(_0x48f529){_0x13a68b[_0x1d50('0x17')]=_0x48f529;if(_0x341953['query'][_0x1d50('0x37')]){_0x197320[_0x1d50('0x38')]=[{'all':!![]}];}return db[_0x1d50('0x25')][_0x1d50('0x39')](_0x197320);})[_0x1d50('0x1f')](function(_0x51d8cd){_0x13a68b[_0x1d50('0x3a')]=_0x51d8cd;return _0x13a68b;})[_0x1d50('0x1f')](respondWithFilteredResult(_0x208047,_0x197320))[_0x1d50('0x3b')](handleError(_0x208047,null));};exports[_0x1d50('0x3c')]=function(_0x12498f,_0x4c0817){var _0x2706f4={'raw':!![],'where':{'id':_0x12498f[_0x1d50('0x3d')]['id']}},_0x33bf23={};_0x33bf23[_0x1d50('0x2a')]=_[_0x1d50('0x3e')](db[_0x1d50('0x25')]['rawAttributes']);_0x33bf23[_0x1d50('0x2b')]=_[_0x1d50('0x3e')](_0x12498f['query']);_0x33bf23[_0x1d50('0x2c')]=_[_0x1d50('0x2d')](_0x33bf23[_0x1d50('0x2a')],_0x33bf23[_0x1d50('0x2b')]);_0x2706f4['attributes']=_[_0x1d50('0x2d')](_0x33bf23[_0x1d50('0x2a')],qs['fields'](_0x12498f[_0x1d50('0x2b')][_0x1d50('0x2f')]));_0x2706f4[_0x1d50('0x2e')]=_0x2706f4[_0x1d50('0x2e')][_0x1d50('0x30')]?_0x2706f4[_0x1d50('0x2e')]:_0x33bf23[_0x1d50('0x2a')];if(_0x12498f[_0x1d50('0x2b')][_0x1d50('0x37')]){_0x2706f4[_0x1d50('0x38')]=[{'all':!![]}];}_0x2706f4=_[_0x1d50('0x35')]({},_0x2706f4,_0x12498f[_0x1d50('0x36')]);return db[_0x1d50('0x25')][_0x1d50('0x3f')](_0x2706f4)[_0x1d50('0x1f')](handleEntityNotFound(_0x4c0817,null))[_0x1d50('0x1f')](respondWithResult(_0x4c0817,null))['catch'](handleError(_0x4c0817,null));};exports[_0x1d50('0x40')]=function(_0x4d8419,_0x865a83){return db[_0x1d50('0x25')][_0x1d50('0x40')](_0x4d8419[_0x1d50('0x41')],{})[_0x1d50('0x1f')](respondWithResult(_0x865a83,0xc9))[_0x1d50('0x3b')](handleError(_0x865a83,null));};exports[_0x1d50('0x42')]=function(_0x491787,_0x462b72){if(_0x491787[_0x1d50('0x41')]['id']){delete _0x491787[_0x1d50('0x41')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x491787['params']['id']}})[_0x1d50('0x1f')](handleEntityNotFound(_0x462b72,null))[_0x1d50('0x1f')](saveUpdates(_0x491787[_0x1d50('0x41')],null))[_0x1d50('0x1f')](respondWithResult(_0x462b72,null))[_0x1d50('0x3b')](handleError(_0x462b72,null));};exports[_0x1d50('0x20')]=function(_0x2fd825,_0x63bfff){return db[_0x1d50('0x25')][_0x1d50('0x3f')]({'where':{'id':_0x2fd825[_0x1d50('0x3d')]['id']}})[_0x1d50('0x1f')](handleEntityNotFound(_0x63bfff,null))[_0x1d50('0x1f')](removeEntity(_0x63bfff,null))['catch'](handleError(_0x63bfff,null));};exports[_0x1d50('0x43')]=function(_0x32e662,_0x1586d3){return db[_0x1d50('0x25')][_0x1d50('0x43')]()[_0x1d50('0x1f')](respondWithResult(_0x1586d3,null))[_0x1d50('0x3b')](handleError(_0x1586d3,null));}; \ No newline at end of file +var _0x336d=['lodash','squel','jsforce','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','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','options','count','includeAll','include','findAll','rows','params','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x336d,0xd2));var _0xd336=function(_0x22b0bc,_0x43a250){_0x22b0bc=_0x22b0bc-0x0;var _0x51b760=_0x336d[_0x22b0bc];return _0x51b760;};'use strict';var emlformat=require(_0xd336('0x0'));var rimraf=require(_0xd336('0x1'));var zipdir=require(_0xd336('0x2'));var jsonpatch=require(_0xd336('0x3'));var rp=require(_0xd336('0x4'));var moment=require(_0xd336('0x5'));var BPromise=require(_0xd336('0x6'));var Mustache=require(_0xd336('0x7'));var util=require(_0xd336('0x8'));var path=require(_0xd336('0x9'));var sox=require(_0xd336('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd336('0xb'));var _=require(_0xd336('0xc'));var squel=require(_0xd336('0xd'));var crypto=require('crypto');var jsforce=require(_0xd336('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd336('0xf'));var Papa=require(_0xd336('0x10'));var Redis=require('ioredis');var authService=require(_0xd336('0x11'));var qs=require(_0xd336('0x12'));var as=require(_0xd336('0x13'));var hardwareService=require(_0xd336('0x14'));var logger=require(_0xd336('0x15'))('api');var utils=require(_0xd336('0x16'));var config=require(_0xd336('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd336('0x18'))['db'];function respondWithStatusCode(_0x22fafe,_0x5d4054){_0x5d4054=_0x5d4054||0xcc;return function(_0x4096ce){if(_0x4096ce){return _0x22fafe[_0xd336('0x19')](_0x5d4054);}return _0x22fafe[_0xd336('0x1a')](_0x5d4054)['end']();};}function respondWithResult(_0x2cd0a8,_0x55d4a0){_0x55d4a0=_0x55d4a0||0xc8;return function(_0xcab06){if(_0xcab06){return _0x2cd0a8[_0xd336('0x1a')](_0x55d4a0)[_0xd336('0x1b')](_0xcab06);}};}function respondWithFilteredResult(_0x1fef71,_0x187915){return function(_0x329c90){if(_0x329c90){var _0x10a4c1=typeof _0x187915[_0xd336('0x1c')]===_0xd336('0x1d')&&typeof _0x187915[_0xd336('0x1e')]===_0xd336('0x1d');var _0x30723c=_0x329c90['count'];var _0x33734e=_0x10a4c1?0x0:_0x187915[_0xd336('0x1c')];var _0x22e457=_0x10a4c1?_0x329c90['count']:_0x187915[_0xd336('0x1c')]+_0x187915['limit'];var _0x23e95b;if(_0x22e457>=_0x30723c){_0x22e457=_0x30723c;_0x23e95b=0xc8;}else{_0x23e95b=0xce;}_0x1fef71[_0xd336('0x1a')](_0x23e95b);return _0x1fef71[_0xd336('0x1f')](_0xd336('0x20'),_0x33734e+'-'+_0x22e457+'/'+_0x30723c)[_0xd336('0x1b')](_0x329c90);}return null;};}function patchUpdates(_0x48345c){return function(_0x1f7401){try{jsonpatch[_0xd336('0x21')](_0x1f7401,_0x48345c,!![]);}catch(_0x3ca282){return BPromise[_0xd336('0x22')](_0x3ca282);}return _0x1f7401[_0xd336('0x23')]();};}function saveUpdates(_0x3d7ec5,_0x24f424){return function(_0x7fbedd){if(_0x7fbedd){return _0x7fbedd[_0xd336('0x24')](_0x3d7ec5)[_0xd336('0x25')](function(_0x121bcf){return _0x121bcf;});}return null;};}function removeEntity(_0x2578d3,_0x1e7999){return function(_0x78a091){if(_0x78a091){return _0x78a091[_0xd336('0x26')]()['then'](function(){_0x2578d3[_0xd336('0x1a')](0xcc)[_0xd336('0x27')]();});}};}function handleEntityNotFound(_0x20ad54,_0x56eaf3){return function(_0x35c21f){if(!_0x35c21f){_0x20ad54[_0xd336('0x19')](0x194);}return _0x35c21f;};}function handleError(_0x2c99c3,_0x4f8b96){_0x4f8b96=_0x4f8b96||0x1f4;return function(_0x347fc6){logger[_0xd336('0x28')](_0x347fc6[_0xd336('0x29')]);if(_0x347fc6['name']){delete _0x347fc6[_0xd336('0x2a')];}_0x2c99c3[_0xd336('0x1a')](_0x4f8b96)[_0xd336('0x2b')](_0x347fc6);};}exports[_0xd336('0x2c')]=function(_0x2f0819,_0xc18342){var _0xa33ded={},_0x480501={},_0x1cc802={'count':0x0,'rows':[]};var _0x3d34c2=_[_0xd336('0x2d')](db[_0xd336('0x2e')][_0xd336('0x2f')],function(_0x58e881){return{'name':_0x58e881['fieldName'],'type':_0x58e881[_0xd336('0x30')][_0xd336('0x31')]};});_0x480501[_0xd336('0x32')]=_['map'](_0x3d34c2,_0xd336('0x2a'));_0x480501[_0xd336('0x33')]=_[_0xd336('0x34')](_0x2f0819[_0xd336('0x33')]);_0x480501[_0xd336('0x35')]=_['intersection'](_0x480501[_0xd336('0x32')],_0x480501[_0xd336('0x33')]);_0xa33ded[_0xd336('0x36')]=_[_0xd336('0x37')](_0x480501['model'],qs['fields'](_0x2f0819[_0xd336('0x33')][_0xd336('0x38')]));_0xa33ded['attributes']=_0xa33ded[_0xd336('0x36')][_0xd336('0x39')]?_0xa33ded[_0xd336('0x36')]:_0x480501['model'];if(!_0x2f0819['query'][_0xd336('0x3a')](_0xd336('0x3b'))){_0xa33ded['limit']=qs['limit'](_0x2f0819[_0xd336('0x33')][_0xd336('0x1e')]);_0xa33ded[_0xd336('0x1c')]=qs[_0xd336('0x1c')](_0x2f0819[_0xd336('0x33')][_0xd336('0x1c')]);}_0xa33ded['order']=qs[_0xd336('0x3c')](_0x2f0819[_0xd336('0x33')][_0xd336('0x3c')]);_0xa33ded[_0xd336('0x3d')]=qs[_0xd336('0x35')](_['pick'](_0x2f0819['query'],_0x480501[_0xd336('0x35')]),_0x3d34c2);if(_0x2f0819[_0xd336('0x33')]['filter']){_0xa33ded[_0xd336('0x3d')]=_[_0xd336('0x3e')](_0xa33ded[_0xd336('0x3d')],{'$or':_[_0xd336('0x2d')](_0x3d34c2,function(_0x4478a6){if(_0x4478a6['type']!=='VIRTUAL'){var _0x4eb6d2={};_0x4eb6d2[_0x4478a6[_0xd336('0x2a')]]={'$like':'%'+_0x2f0819[_0xd336('0x33')]['filter']+'%'};return _0x4eb6d2;}})});}_0xa33ded=_[_0xd336('0x3e')]({},_0xa33ded,_0x2f0819[_0xd336('0x3f')]);var _0xf2cd35={'where':_0xa33ded['where']};return db[_0xd336('0x2e')][_0xd336('0x40')](_0xf2cd35)[_0xd336('0x25')](function(_0x226b3d){_0x1cc802[_0xd336('0x40')]=_0x226b3d;if(_0x2f0819[_0xd336('0x33')][_0xd336('0x41')]){_0xa33ded[_0xd336('0x42')]=[{'all':!![]}];}return db[_0xd336('0x2e')][_0xd336('0x43')](_0xa33ded);})['then'](function(_0x4210ea){_0x1cc802[_0xd336('0x44')]=_0x4210ea;return _0x1cc802;})[_0xd336('0x25')](respondWithFilteredResult(_0xc18342,_0xa33ded))['catch'](handleError(_0xc18342,null));};exports['show']=function(_0x2f100f,_0x20a56d){var _0x22d5db={'raw':!![],'where':{'id':_0x2f100f[_0xd336('0x45')]['id']}},_0x3ea193={};_0x3ea193[_0xd336('0x32')]=_[_0xd336('0x34')](db[_0xd336('0x2e')][_0xd336('0x2f')]);_0x3ea193[_0xd336('0x33')]=_[_0xd336('0x34')](_0x2f100f[_0xd336('0x33')]);_0x3ea193[_0xd336('0x35')]=_[_0xd336('0x37')](_0x3ea193[_0xd336('0x32')],_0x3ea193[_0xd336('0x33')]);_0x22d5db[_0xd336('0x36')]=_[_0xd336('0x37')](_0x3ea193[_0xd336('0x32')],qs['fields'](_0x2f100f[_0xd336('0x33')]['fields']));_0x22d5db[_0xd336('0x36')]=_0x22d5db[_0xd336('0x36')]['length']?_0x22d5db[_0xd336('0x36')]:_0x3ea193[_0xd336('0x32')];if(_0x2f100f[_0xd336('0x33')][_0xd336('0x41')]){_0x22d5db[_0xd336('0x42')]=[{'all':!![]}];}_0x22d5db=_['merge']({},_0x22d5db,_0x2f100f[_0xd336('0x3f')]);return db[_0xd336('0x2e')][_0xd336('0x46')](_0x22d5db)[_0xd336('0x25')](handleEntityNotFound(_0x20a56d,null))['then'](respondWithResult(_0x20a56d,null))[_0xd336('0x47')](handleError(_0x20a56d,null));};exports['create']=function(_0x26719d,_0x3b2bf9){return db['JscriptyQuestionReport']['create'](_0x26719d['body'],{})[_0xd336('0x25')](respondWithResult(_0x3b2bf9,0xc9))[_0xd336('0x47')](handleError(_0x3b2bf9,null));};exports[_0xd336('0x24')]=function(_0x32f167,_0x41452c){if(_0x32f167[_0xd336('0x48')]['id']){delete _0x32f167['body']['id'];}return db[_0xd336('0x2e')][_0xd336('0x46')]({'where':{'id':_0x32f167[_0xd336('0x45')]['id']}})[_0xd336('0x25')](handleEntityNotFound(_0x41452c,null))[_0xd336('0x25')](saveUpdates(_0x32f167['body'],null))['then'](respondWithResult(_0x41452c,null))[_0xd336('0x47')](handleError(_0x41452c,null));};exports[_0xd336('0x26')]=function(_0x5d7ff0,_0x5dca67){return db[_0xd336('0x2e')][_0xd336('0x46')]({'where':{'id':_0x5d7ff0[_0xd336('0x45')]['id']}})[_0xd336('0x25')](handleEntityNotFound(_0x5dca67,null))[_0xd336('0x25')](removeEntity(_0x5dca67,null))['catch'](handleError(_0x5dca67,null));};exports[_0xd336('0x49')]=function(_0x161d10,_0x1c1989){return db[_0xd336('0x2e')][_0xd336('0x49')]()['then'](respondWithResult(_0x1c1989,null))[_0xd336('0x47')](handleError(_0x1c1989,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e18dbb1..b92667e 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 _0xdc22=['./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xdc22,0x7b));var _0x2dc2=function(_0x447b23,_0x49c577){_0x447b23=_0x447b23-0x0;var _0x2f37c7=_0xdc22[_0x447b23];return _0x2f37c7;};'use strict';var _=require(_0x2dc2('0x0'));var util=require('util');var logger=require(_0x2dc2('0x1'))(_0x2dc2('0x2'));var moment=require(_0x2dc2('0x3'));var BPromise=require(_0x2dc2('0x4'));var rp=require(_0x2dc2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2dc2('0x6'));var attributes=require(_0x2dc2('0x7'));module['exports']=function(_0x41a50b,_0x4ebe44){return _0x41a50b[_0x2dc2('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x2dc2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0c5=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','bluebird','request-promise','path'];(function(_0x511f48,_0x29aed8){var _0x5f4a96=function(_0x234580){while(--_0x234580){_0x511f48['push'](_0x511f48['shift']());}};_0x5f4a96(++_0x29aed8);}(_0xd0c5,0x150));var _0x5d0c=function(_0x17d8ba,_0xa22135){_0x17d8ba=_0x17d8ba-0x0;var _0x58f9b1=_0xd0c5[_0x17d8ba];return _0x58f9b1;};'use strict';var _=require(_0x5d0c('0x0'));var util=require(_0x5d0c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5d0c('0x2'));var rp=require(_0x5d0c('0x3'));var fs=require('fs');var path=require(_0x5d0c('0x4'));var rimraf=require(_0x5d0c('0x5'));var config=require(_0x5d0c('0x6'));var attributes=require(_0x5d0c('0x7'));module[_0x5d0c('0x8')]=function(_0x5b6c84,_0x4b009c){return _0x5b6c84[_0x5d0c('0x9')](_0x5d0c('0xa'),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 cad3576..ae1a650 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 _0xb633=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x59fcf8,_0x38cb2e){var _0x178a68=function(_0x319d96){while(--_0x319d96){_0x59fcf8['push'](_0x59fcf8['shift']());}};_0x178a68(++_0x38cb2e);}(_0xb633,0xdf));var _0x3b63=function(_0xbe2747,_0xab3bea){_0xbe2747=_0xbe2747-0x0;var _0x1c583b=_0xb633[_0xbe2747];return _0x1c583b;};'use strict';var _=require(_0x3b63('0x0'));var util=require(_0x3b63('0x1'));var moment=require(_0x3b63('0x2'));var BPromise=require(_0x3b63('0x3'));var rs=require(_0x3b63('0x4'));var fs=require('fs');var Redis=require(_0x3b63('0x5'));var db=require(_0x3b63('0x6'))['db'];var utils=require(_0x3b63('0x7'));var logger=require('../../config/logger')(_0x3b63('0x8'));var config=require('../../config/environment');var jayson=require(_0x3b63('0x9'));var client=jayson[_0x3b63('0xa')][_0x3b63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b8d51,_0x375395,_0x300436){return new BPromise(function(_0x22dfa3,_0x37cf32){return client[_0x3b63('0xc')](_0x2b8d51,_0x300436)[_0x3b63('0xd')](function(_0x11fbc9){logger[_0x3b63('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x375395,_0x3b63('0xf'));logger[_0x3b63('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x375395,_0x3b63('0xf'),JSON['stringify'](_0x11fbc9));if(_0x11fbc9[_0x3b63('0x11')]){if(_0x11fbc9['error'][_0x3b63('0x12')]===0x1f4){logger['error'](_0x3b63('0x13'),_0x375395,_0x11fbc9[_0x3b63('0x11')][_0x3b63('0x14')]);return _0x37cf32(_0x11fbc9[_0x3b63('0x11')]['message']);}logger['error'](_0x3b63('0x13'),_0x375395,_0x11fbc9[_0x3b63('0x11')][_0x3b63('0x14')]);return _0x22dfa3(_0x11fbc9[_0x3b63('0x11')][_0x3b63('0x14')]);}else{logger[_0x3b63('0xe')](_0x3b63('0x13'),_0x375395,_0x3b63('0xf'));_0x22dfa3(_0x11fbc9[_0x3b63('0x15')][_0x3b63('0x14')]);}})[_0x3b63('0x16')](function(_0x586518){logger[_0x3b63('0x11')](_0x3b63('0x13'),_0x375395,_0x586518);_0x37cf32(_0x586518);});});} \ No newline at end of file +var _0xdb38=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xdb38,0xbb));var _0x8db3=function(_0xac554a,_0x5d145b){_0xac554a=_0xac554a-0x0;var _0x520c82=_0xdb38[_0xac554a];return _0x520c82;};'use strict';var _=require('lodash');var util=require(_0x8db3('0x0'));var moment=require(_0x8db3('0x1'));var BPromise=require(_0x8db3('0x2'));var rs=require(_0x8db3('0x3'));var fs=require('fs');var Redis=require(_0x8db3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8db3('0x5'));var logger=require(_0x8db3('0x6'))(_0x8db3('0x7'));var config=require('../../config/environment');var jayson=require(_0x8db3('0x8'));var client=jayson[_0x8db3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f6944,_0x2f0506,_0x265418){return new BPromise(function(_0x5d77bb,_0x3616b9){return client['request'](_0x4f6944,_0x265418)[_0x8db3('0xa')](function(_0x8ccfa){logger[_0x8db3('0xb')](_0x8db3('0xc'),_0x2f0506,_0x8db3('0xd'));logger['debug'](_0x8db3('0xe'),_0x2f0506,'request\x20sent',JSON[_0x8db3('0xf')](_0x8ccfa));if(_0x8ccfa[_0x8db3('0x10')]){if(_0x8ccfa['error'][_0x8db3('0x11')]===0x1f4){logger[_0x8db3('0x10')](_0x8db3('0xc'),_0x2f0506,_0x8ccfa[_0x8db3('0x10')][_0x8db3('0x12')]);return _0x3616b9(_0x8ccfa[_0x8db3('0x10')]['message']);}logger[_0x8db3('0x10')](_0x8db3('0xc'),_0x2f0506,_0x8ccfa[_0x8db3('0x10')][_0x8db3('0x12')]);return _0x5d77bb(_0x8ccfa[_0x8db3('0x10')]['message']);}else{logger[_0x8db3('0xb')](_0x8db3('0xc'),_0x2f0506,_0x8db3('0xd'));_0x5d77bb(_0x8ccfa[_0x8db3('0x13')][_0x8db3('0x12')]);}})['catch'](function(_0x4f9c05){logger[_0x8db3('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f0506,_0x4f9c05);_0x3616b9(_0x4f9c05);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8f253df..55e9470 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 _0x6356=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x6356,0xc3));var _0x6635=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x6356[_0x46401e];return _0x447cba;};'use strict';var multer=require(_0x6635('0x0'));var util=require(_0x6635('0x1'));var path=require('path');var timeout=require(_0x6635('0x2'));var express=require(_0x6635('0x3'));var router=express[_0x6635('0x4')]();var fs_extra=require(_0x6635('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6635('0x6'));var config=require(_0x6635('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x6635('0x8')]('/',auth[_0x6635('0x9')](),controller['index']);router[_0x6635('0x8')](_0x6635('0xa'),auth[_0x6635('0x9')](),controller[_0x6635('0xb')]);router[_0x6635('0x8')](_0x6635('0xc'),auth[_0x6635('0x9')](),controller[_0x6635('0xd')]);router[_0x6635('0x8')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router['post']('/',auth[_0x6635('0x9')](),controller[_0x6635('0xe')]);router[_0x6635('0xf')](_0x6635('0xc'),auth[_0x6635('0x9')](),controller['update']);router[_0x6635('0x10')](_0x6635('0xc'),auth[_0x6635('0x9')](),controller[_0x6635('0x11')]);module['exports']=router; \ No newline at end of file +var _0x98c2=['destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','post','create','put','update','delete','/:id'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x98c2,0x1b2));var _0x298c=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x98c2[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0x298c('0x0'));var path=require(_0x298c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x298c('0x2')]();var fs_extra=require(_0x298c('0x3'));var auth=require(_0x298c('0x4'));var interaction=require(_0x298c('0x5'));var config=require(_0x298c('0x6'));var controller=require(_0x298c('0x7'));router[_0x298c('0x8')]('/',auth[_0x298c('0x9')](),controller[_0x298c('0xa')]);router['get'](_0x298c('0xb'),auth[_0x298c('0x9')](),controller[_0x298c('0xc')]);router[_0x298c('0x8')]('/:id',auth[_0x298c('0x9')](),controller[_0x298c('0xd')]);router[_0x298c('0x8')](_0x298c('0xe'),auth[_0x298c('0x9')](),controller[_0x298c('0xf')]);router[_0x298c('0x10')]('/',auth[_0x298c('0x9')](),controller[_0x298c('0x11')]);router[_0x298c('0x12')]('/:id',auth[_0x298c('0x9')](),controller[_0x298c('0x13')]);router[_0x298c('0x14')](_0x298c('0x15'),auth['isAuthenticated'](),controller[_0x298c('0x16')]);module[_0x298c('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a367dc9..8b4c1c1 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 _0x69a4=['setDataValue','endtime','format','DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x69a4,0x76));var _0x469a=function(_0x209cfa,_0x1cd18f){_0x209cfa=_0x209cfa-0x0;var _0x5a56d9=_0x69a4[_0x209cfa];return _0x5a56d9;};'use strict';var moment=require('moment');var Sequelize=require(_0x469a('0x0'));module[_0x469a('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x43327d){this[_0x469a('0x2')]('starttime',_0x43327d);this['setDataValue'](_0x469a('0x3'),moment()[_0x469a('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x469a('0x5')]},'membername':{'type':Sequelize[_0x469a('0x6')]},'projectname':{'type':Sequelize[_0x469a('0x6')]},'queue':{'type':Sequelize[_0x469a('0x6')]},'uniqueid':{'type':Sequelize[_0x469a('0x6')]},'calleridname':{'type':Sequelize[_0x469a('0x6')]},'calleridnum':{'type':Sequelize[_0x469a('0x6')]},'completed':{'type':Sequelize[_0x469a('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x68c7=['STRING','BOOLEAN','moment','sequelize','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE'];(function(_0x49ca67,_0x4b8bf0){var _0x7249ed=function(_0x5b9948){while(--_0x5b9948){_0x49ca67['push'](_0x49ca67['shift']());}};_0x7249ed(++_0x4b8bf0);}(_0x68c7,0x16a));var _0x768c=function(_0x4dfec8,_0x136a3f){_0x4dfec8=_0x4dfec8-0x0;var _0x1646e8=_0x68c7[_0x4dfec8];return _0x1646e8;};'use strict';var moment=require(_0x768c('0x0'));var Sequelize=require(_0x768c('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x59ea38){this['setDataValue'](_0x768c('0x2'),_0x59ea38);this[_0x768c('0x3')](_0x768c('0x4'),moment()['format'](_0x768c('0x5')));}},'endtime':{'type':Sequelize[_0x768c('0x6')]},'membername':{'type':Sequelize[_0x768c('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x768c('0x7')]},'calleridname':{'type':Sequelize[_0x768c('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x768c('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 3fe8e13..73c17db 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 _0x793c=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','describe','getQuestions','findOne','JscriptyQuestionReport','sort','pick','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','index','JscriptySessionReport','fieldName','type','model','map','query','keys'];(function(_0x93f8f8,_0x44fb1b){var _0xee28f5=function(_0x502552){while(--_0x502552){_0x93f8f8['push'](_0x93f8f8['shift']());}};_0xee28f5(++_0x44fb1b);}(_0x793c,0xc2));var _0xc793=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x793c[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc793('0x0'));var zipdir=require(_0xc793('0x1'));var jsonpatch=require(_0xc793('0x2'));var rp=require(_0xc793('0x3'));var moment=require(_0xc793('0x4'));var BPromise=require(_0xc793('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc793('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc793('0x7'));var _=require(_0xc793('0x8'));var squel=require(_0xc793('0x9'));var crypto=require(_0xc793('0xa'));var jsforce=require(_0xc793('0xb'));var deskjs=require(_0xc793('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc793('0xd'));var Papa=require(_0xc793('0xe'));var Redis=require('ioredis');var authService=require(_0xc793('0xf'));var qs=require(_0xc793('0x10'));var as=require(_0xc793('0x11'));var hardwareService=require(_0xc793('0x12'));var logger=require('../../config/logger')(_0xc793('0x13'));var utils=require(_0xc793('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc793('0x15'));var db=require(_0xc793('0x16'))['db'];function respondWithStatusCode(_0x1127ee,_0x30dd20){_0x30dd20=_0x30dd20||0xcc;return function(_0xbf89f5){if(_0xbf89f5){return _0x1127ee['sendStatus'](_0x30dd20);}return _0x1127ee[_0xc793('0x17')](_0x30dd20)[_0xc793('0x18')]();};}function respondWithResult(_0x3c7e53,_0x214459){_0x214459=_0x214459||0xc8;return function(_0xfcde57){if(_0xfcde57){return _0x3c7e53[_0xc793('0x17')](_0x214459)[_0xc793('0x19')](_0xfcde57);}};}function respondWithFilteredResult(_0x561633,_0x55fc05){return function(_0x2a6cb4){if(_0x2a6cb4){var _0x3eec68=typeof _0x55fc05[_0xc793('0x1a')]==='undefined'&&typeof _0x55fc05[_0xc793('0x1b')]===_0xc793('0x1c');var _0x5e87f8=_0x2a6cb4[_0xc793('0x1d')];var _0x53a322=_0x3eec68?0x0:_0x55fc05[_0xc793('0x1a')];var _0x59852b=_0x3eec68?_0x2a6cb4['count']:_0x55fc05['offset']+_0x55fc05['limit'];var _0x399e94;if(_0x59852b>=_0x5e87f8){_0x59852b=_0x5e87f8;_0x399e94=0xc8;}else{_0x399e94=0xce;}_0x561633[_0xc793('0x17')](_0x399e94);return _0x561633[_0xc793('0x1e')](_0xc793('0x1f'),_0x53a322+'-'+_0x59852b+'/'+_0x5e87f8)['json'](_0x2a6cb4);}return null;};}function patchUpdates(_0x183ab8){return function(_0x332f84){try{jsonpatch[_0xc793('0x20')](_0x332f84,_0x183ab8,!![]);}catch(_0x5a5ed3){return BPromise['reject'](_0x5a5ed3);}return _0x332f84[_0xc793('0x21')]();};}function saveUpdates(_0xbf3b75,_0xf3d8ed){return function(_0x1db821){if(_0x1db821){return _0x1db821[_0xc793('0x22')](_0xbf3b75)['then'](function(_0x1b5924){return _0x1b5924;});}return null;};}function removeEntity(_0x173fe3,_0x75204d){return function(_0x5bf95e){if(_0x5bf95e){return _0x5bf95e[_0xc793('0x23')]()['then'](function(){_0x173fe3[_0xc793('0x17')](0xcc)[_0xc793('0x18')]();});}};}function handleEntityNotFound(_0x395182,_0x4ac439){return function(_0xbe3e4b){if(!_0xbe3e4b){_0x395182[_0xc793('0x24')](0x194);}return _0xbe3e4b;};}function handleError(_0x4a9705,_0x552c4a){_0x552c4a=_0x552c4a||0x1f4;return function(_0x1d91d6){logger[_0xc793('0x25')](_0x1d91d6[_0xc793('0x26')]);if(_0x1d91d6['name']){delete _0x1d91d6[_0xc793('0x27')];}_0x4a9705[_0xc793('0x17')](_0x552c4a)[_0xc793('0x28')](_0x1d91d6);};}exports[_0xc793('0x29')]=function(_0x5aafa2,_0x39da9c){var _0xb6a103={},_0x415de5={},_0x44710b={'count':0x0,'rows':[]};var _0x1c8c9e=_['map'](db[_0xc793('0x2a')]['rawAttributes'],function(_0x18aa46){return{'name':_0x18aa46[_0xc793('0x2b')],'type':_0x18aa46[_0xc793('0x2c')]['key']};});_0x415de5[_0xc793('0x2d')]=_[_0xc793('0x2e')](_0x1c8c9e,'name');_0x415de5[_0xc793('0x2f')]=_[_0xc793('0x30')](_0x5aafa2[_0xc793('0x2f')]);_0x415de5[_0xc793('0x31')]=_[_0xc793('0x32')](_0x415de5[_0xc793('0x2d')],_0x415de5[_0xc793('0x2f')]);_0xb6a103[_0xc793('0x33')]=_['intersection'](_0x415de5[_0xc793('0x2d')],qs['fields'](_0x5aafa2[_0xc793('0x2f')][_0xc793('0x34')]));_0xb6a103['attributes']=_0xb6a103['attributes'][_0xc793('0x35')]?_0xb6a103[_0xc793('0x33')]:_0x415de5[_0xc793('0x2d')];if(!_0x5aafa2[_0xc793('0x2f')][_0xc793('0x36')](_0xc793('0x37'))){_0xb6a103[_0xc793('0x1b')]=qs[_0xc793('0x1b')](_0x5aafa2['query'][_0xc793('0x1b')]);_0xb6a103['offset']=qs[_0xc793('0x1a')](_0x5aafa2[_0xc793('0x2f')][_0xc793('0x1a')]);}_0xb6a103[_0xc793('0x38')]=qs['sort'](_0x5aafa2[_0xc793('0x2f')]['sort']);_0xb6a103[_0xc793('0x39')]=qs[_0xc793('0x31')](_['pick'](_0x5aafa2['query'],_0x415de5['filters']),_0x1c8c9e);if(_0x5aafa2['query'][_0xc793('0x3a')]){_0xb6a103['where']=_[_0xc793('0x3b')](_0xb6a103[_0xc793('0x39')],{'$or':_[_0xc793('0x2e')](_0x1c8c9e,function(_0x441e82){if(_0x441e82[_0xc793('0x2c')]!==_0xc793('0x3c')){var _0x3598f6={};_0x3598f6[_0x441e82[_0xc793('0x27')]]={'$like':'%'+_0x5aafa2['query'][_0xc793('0x3a')]+'%'};return _0x3598f6;}})});}_0xb6a103=_[_0xc793('0x3b')]({},_0xb6a103,_0x5aafa2[_0xc793('0x3d')]);var _0x3cca47={'where':_0xb6a103[_0xc793('0x39')]};return db['JscriptySessionReport'][_0xc793('0x1d')](_0x3cca47)[_0xc793('0x3e')](function(_0x2fcc58){_0x44710b[_0xc793('0x1d')]=_0x2fcc58;if(_0x5aafa2[_0xc793('0x2f')][_0xc793('0x3f')]){_0xb6a103[_0xc793('0x40')]=[{'all':!![]}];}return db[_0xc793('0x2a')][_0xc793('0x41')](_0xb6a103);})['then'](function(_0x5c227a){_0x44710b[_0xc793('0x42')]=_0x5c227a;return _0x44710b;})['then'](respondWithFilteredResult(_0x39da9c,_0xb6a103))['catch'](handleError(_0x39da9c,null));};exports[_0xc793('0x43')]=function(_0x11db5c,_0x3bf086){var _0x3bf457={'raw':!![],'where':{'id':_0x11db5c['params']['id']}},_0x1fa924={};_0x1fa924[_0xc793('0x2d')]=_[_0xc793('0x30')](db[_0xc793('0x2a')][_0xc793('0x44')]);_0x1fa924[_0xc793('0x2f')]=_[_0xc793('0x30')](_0x11db5c[_0xc793('0x2f')]);_0x1fa924[_0xc793('0x31')]=_[_0xc793('0x32')](_0x1fa924[_0xc793('0x2d')],_0x1fa924[_0xc793('0x2f')]);_0x3bf457['attributes']=_[_0xc793('0x32')](_0x1fa924[_0xc793('0x2d')],qs[_0xc793('0x34')](_0x11db5c[_0xc793('0x2f')]['fields']));_0x3bf457[_0xc793('0x33')]=_0x3bf457[_0xc793('0x33')]['length']?_0x3bf457['attributes']:_0x1fa924['model'];if(_0x11db5c[_0xc793('0x2f')][_0xc793('0x3f')]){_0x3bf457[_0xc793('0x40')]=[{'all':!![]}];}_0x3bf457=_['merge']({},_0x3bf457,_0x11db5c[_0xc793('0x3d')]);return db['JscriptySessionReport'][_0xc793('0x45')](_0x3bf457)[_0xc793('0x3e')](handleEntityNotFound(_0x3bf086,null))[_0xc793('0x3e')](respondWithResult(_0x3bf086,null))['catch'](handleError(_0x3bf086,null));};exports[_0xc793('0x46')]=function(_0x1bc66d,_0x417bff){return db[_0xc793('0x2a')][_0xc793('0x46')](_0x1bc66d[_0xc793('0x47')],{})[_0xc793('0x3e')](respondWithResult(_0x417bff,0xc9))[_0xc793('0x48')](handleError(_0x417bff,null));};exports[_0xc793('0x22')]=function(_0x23c5e4,_0x6f4794){if(_0x23c5e4[_0xc793('0x47')]['id']){delete _0x23c5e4[_0xc793('0x47')]['id'];}return db[_0xc793('0x2a')][_0xc793('0x45')]({'where':{'id':_0x23c5e4[_0xc793('0x49')]['id']}})[_0xc793('0x3e')](handleEntityNotFound(_0x6f4794,null))[_0xc793('0x3e')](saveUpdates(_0x23c5e4[_0xc793('0x47')],null))[_0xc793('0x3e')](respondWithResult(_0x6f4794,null))['catch'](handleError(_0x6f4794,null));};exports['destroy']=function(_0xed8257,_0x8935e3){return db['JscriptySessionReport'][_0xc793('0x45')]({'where':{'id':_0xed8257[_0xc793('0x49')]['id']}})['then'](handleEntityNotFound(_0x8935e3,null))[_0xc793('0x3e')](removeEntity(_0x8935e3,null))[_0xc793('0x48')](handleError(_0x8935e3,null));};exports[_0xc793('0x4a')]=function(_0x16dd52,_0x4883f2){return db[_0xc793('0x2a')][_0xc793('0x4a')]()[_0xc793('0x3e')](respondWithResult(_0x4883f2,null))[_0xc793('0x48')](handleError(_0x4883f2,null));};exports[_0xc793('0x4b')]=function(_0x36affb,_0x4151fe,_0x4f2186){var _0x5d0255={'raw':!![],'where':{}};var _0x39c367={};var _0x3ae5c9={'count':0x0,'rows':[]};return db[_0xc793('0x2a')][_0xc793('0x4c')]({'where':{'id':_0x36affb[_0xc793('0x49')]['id']}})[_0xc793('0x3e')](handleEntityNotFound(_0x4151fe,null))['then'](function(_0x439ee7){if(_0x439ee7){_0x39c367['model']=_['keys'](db[_0xc793('0x4d')][_0xc793('0x44')]);_0x39c367[_0xc793('0x2f')]=_[_0xc793('0x30')](_0x36affb[_0xc793('0x2f')]);_0x39c367[_0xc793('0x31')]=_[_0xc793('0x32')](_0x39c367[_0xc793('0x2d')],_0x39c367[_0xc793('0x2f')]);_0x5d0255['attributes']=_[_0xc793('0x32')](_0x39c367[_0xc793('0x2d')],qs[_0xc793('0x34')](_0x36affb['query']['fields']));_0x5d0255[_0xc793('0x33')]=_0x5d0255[_0xc793('0x33')]['length']?_0x5d0255[_0xc793('0x33')]:_0x39c367[_0xc793('0x2d')];if(!_0x36affb[_0xc793('0x2f')]['hasOwnProperty'](_0xc793('0x37'))){_0x5d0255[_0xc793('0x1b')]=qs[_0xc793('0x1b')](_0x36affb['query'][_0xc793('0x1b')]);_0x5d0255[_0xc793('0x1a')]=qs[_0xc793('0x1a')](_0x36affb[_0xc793('0x2f')][_0xc793('0x1a')]);}_0x5d0255['order']=qs['sort'](_0x36affb[_0xc793('0x2f')][_0xc793('0x4e')]);_0x5d0255[_0xc793('0x39')]=qs[_0xc793('0x31')](_[_0xc793('0x4f')](_0x36affb[_0xc793('0x2f')],_0x39c367[_0xc793('0x31')]));_0x5d0255['where'][_0xc793('0x50')]=_0x439ee7['id'];if(_0x36affb[_0xc793('0x2f')][_0xc793('0x3a')]){_0x5d0255[_0xc793('0x39')]=_[_0xc793('0x3b')](_0x5d0255[_0xc793('0x39')],{'$or':_[_0xc793('0x2e')](_0x5d0255['attributes'],function(_0x23d81e){var _0x2625b2={};_0x2625b2[_0x23d81e]={'$like':'%'+_0x36affb[_0xc793('0x2f')]['filter']+'%'};return _0x2625b2;})});}_0x5d0255=_[_0xc793('0x3b')]({},_0x5d0255,_0x36affb[_0xc793('0x3d')]);return db[_0xc793('0x4d')][_0xc793('0x1d')]({'where':_0x5d0255[_0xc793('0x39')]})['then'](function(_0x5047da){_0x3ae5c9[_0xc793('0x1d')]=_0x5047da;if(_0x36affb[_0xc793('0x2f')]['includeAll']){_0x5d0255['include']=[{'all':!![]}];}return db[_0xc793('0x4d')][_0xc793('0x41')](_0x5d0255);})[_0xc793('0x3e')](function(_0x242039){_0x3ae5c9[_0xc793('0x42')]=_0x242039;return _0x3ae5c9;});}})[_0xc793('0x3e')](respondWithFilteredResult(_0x4151fe,_0x5d0255))[_0xc793('0x48')](handleError(_0x4151fe,null));}; \ No newline at end of file +var _0x9eaa=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','findOne','JscriptyQuestionReport','nolimit','SessionId','options','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x22c50e,_0x4ea131){var _0x500f85=function(_0x412f7b){while(--_0x412f7b){_0x22c50e['push'](_0x22c50e['shift']());}};_0x500f85(++_0x4ea131);}(_0x9eaa,0x191));var _0xa9ea=function(_0x8b27c1,_0x5a478a){_0x8b27c1=_0x8b27c1-0x0;var _0x37a7c3=_0x9eaa[_0x8b27c1];return _0x37a7c3;};'use strict';var emlformat=require(_0xa9ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9ea('0x1'));var jsonpatch=require(_0xa9ea('0x2'));var rp=require(_0xa9ea('0x3'));var moment=require(_0xa9ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa9ea('0x5'));var util=require(_0xa9ea('0x6'));var path=require(_0xa9ea('0x7'));var sox=require(_0xa9ea('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9ea('0x9'));var _=require('lodash');var squel=require(_0xa9ea('0xa'));var crypto=require(_0xa9ea('0xb'));var jsforce=require(_0xa9ea('0xc'));var deskjs=require(_0xa9ea('0xd'));var toCsv=require(_0xa9ea('0xe'));var querystring=require(_0xa9ea('0xf'));var Papa=require(_0xa9ea('0x10'));var Redis=require('ioredis');var authService=require(_0xa9ea('0x11'));var qs=require(_0xa9ea('0x12'));var as=require(_0xa9ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ea('0x14'))(_0xa9ea('0x15'));var utils=require(_0xa9ea('0x16'));var config=require(_0xa9ea('0x17'));var licenseUtil=require(_0xa9ea('0x18'));var db=require(_0xa9ea('0x19'))['db'];function respondWithStatusCode(_0xbb9006,_0x2826bc){_0x2826bc=_0x2826bc||0xcc;return function(_0x5c6770){if(_0x5c6770){return _0xbb9006[_0xa9ea('0x1a')](_0x2826bc);}return _0xbb9006[_0xa9ea('0x1b')](_0x2826bc)[_0xa9ea('0x1c')]();};}function respondWithResult(_0x59a78b,_0x114967){_0x114967=_0x114967||0xc8;return function(_0x2f4a57){if(_0x2f4a57){return _0x59a78b[_0xa9ea('0x1b')](_0x114967)[_0xa9ea('0x1d')](_0x2f4a57);}};}function respondWithFilteredResult(_0x4d3e9a,_0x2e4ba9){return function(_0x201a1f){if(_0x201a1f){var _0x161a13=typeof _0x2e4ba9[_0xa9ea('0x1e')]===_0xa9ea('0x1f')&&typeof _0x2e4ba9['limit']===_0xa9ea('0x1f');var _0x183608=_0x201a1f['count'];var _0x248507=_0x161a13?0x0:_0x2e4ba9['offset'];var _0x37e036=_0x161a13?_0x201a1f[_0xa9ea('0x20')]:_0x2e4ba9[_0xa9ea('0x1e')]+_0x2e4ba9[_0xa9ea('0x21')];var _0x2e97de;if(_0x37e036>=_0x183608){_0x37e036=_0x183608;_0x2e97de=0xc8;}else{_0x2e97de=0xce;}_0x4d3e9a['status'](_0x2e97de);return _0x4d3e9a[_0xa9ea('0x22')](_0xa9ea('0x23'),_0x248507+'-'+_0x37e036+'/'+_0x183608)['json'](_0x201a1f);}return null;};}function patchUpdates(_0x137abb){return function(_0x5275f2){try{jsonpatch['apply'](_0x5275f2,_0x137abb,!![]);}catch(_0x38d685){return BPromise[_0xa9ea('0x24')](_0x38d685);}return _0x5275f2[_0xa9ea('0x25')]();};}function saveUpdates(_0x4655ac,_0x1b4812){return function(_0x1843ba){if(_0x1843ba){return _0x1843ba[_0xa9ea('0x26')](_0x4655ac)['then'](function(_0x5602ab){return _0x5602ab;});}return null;};}function removeEntity(_0x27aa3e,_0x57d8f8){return function(_0x20bc0e){if(_0x20bc0e){return _0x20bc0e[_0xa9ea('0x27')]()[_0xa9ea('0x28')](function(){_0x27aa3e[_0xa9ea('0x1b')](0xcc)[_0xa9ea('0x1c')]();});}};}function handleEntityNotFound(_0x35d620,_0x5e6223){return function(_0x2ea7ee){if(!_0x2ea7ee){_0x35d620[_0xa9ea('0x1a')](0x194);}return _0x2ea7ee;};}function handleError(_0x49e402,_0xbb1c56){_0xbb1c56=_0xbb1c56||0x1f4;return function(_0x32fd90){logger[_0xa9ea('0x29')](_0x32fd90[_0xa9ea('0x2a')]);if(_0x32fd90[_0xa9ea('0x2b')]){delete _0x32fd90[_0xa9ea('0x2b')];}_0x49e402[_0xa9ea('0x1b')](_0xbb1c56)[_0xa9ea('0x2c')](_0x32fd90);};}exports[_0xa9ea('0x2d')]=function(_0x21afcc,_0x31c437){var _0x327f87={},_0x46b880={},_0x42cbf1={'count':0x0,'rows':[]};var _0x44af83=_[_0xa9ea('0x2e')](db[_0xa9ea('0x2f')][_0xa9ea('0x30')],function(_0x215fb4){return{'name':_0x215fb4['fieldName'],'type':_0x215fb4[_0xa9ea('0x31')][_0xa9ea('0x32')]};});_0x46b880['model']=_['map'](_0x44af83,_0xa9ea('0x2b'));_0x46b880[_0xa9ea('0x33')]=_[_0xa9ea('0x34')](_0x21afcc[_0xa9ea('0x33')]);_0x46b880[_0xa9ea('0x35')]=_[_0xa9ea('0x36')](_0x46b880[_0xa9ea('0x37')],_0x46b880['query']);_0x327f87[_0xa9ea('0x38')]=_['intersection'](_0x46b880[_0xa9ea('0x37')],qs[_0xa9ea('0x39')](_0x21afcc[_0xa9ea('0x33')]['fields']));_0x327f87[_0xa9ea('0x38')]=_0x327f87['attributes'][_0xa9ea('0x3a')]?_0x327f87['attributes']:_0x46b880['model'];if(!_0x21afcc['query'][_0xa9ea('0x3b')]('nolimit')){_0x327f87['limit']=qs[_0xa9ea('0x21')](_0x21afcc[_0xa9ea('0x33')][_0xa9ea('0x21')]);_0x327f87[_0xa9ea('0x1e')]=qs[_0xa9ea('0x1e')](_0x21afcc[_0xa9ea('0x33')][_0xa9ea('0x1e')]);}_0x327f87[_0xa9ea('0x3c')]=qs[_0xa9ea('0x3d')](_0x21afcc[_0xa9ea('0x33')]['sort']);_0x327f87['where']=qs[_0xa9ea('0x35')](_[_0xa9ea('0x3e')](_0x21afcc[_0xa9ea('0x33')],_0x46b880[_0xa9ea('0x35')]),_0x44af83);if(_0x21afcc[_0xa9ea('0x33')][_0xa9ea('0x3f')]){_0x327f87[_0xa9ea('0x40')]=_[_0xa9ea('0x41')](_0x327f87['where'],{'$or':_[_0xa9ea('0x2e')](_0x44af83,function(_0x5d69bd){if(_0x5d69bd['type']!==_0xa9ea('0x42')){var _0x1ba3f9={};_0x1ba3f9[_0x5d69bd[_0xa9ea('0x2b')]]={'$like':'%'+_0x21afcc[_0xa9ea('0x33')][_0xa9ea('0x3f')]+'%'};return _0x1ba3f9;}})});}_0x327f87=_[_0xa9ea('0x41')]({},_0x327f87,_0x21afcc['options']);var _0x5368ea={'where':_0x327f87[_0xa9ea('0x40')]};return db[_0xa9ea('0x2f')]['count'](_0x5368ea)[_0xa9ea('0x28')](function(_0x35f581){_0x42cbf1[_0xa9ea('0x20')]=_0x35f581;if(_0x21afcc[_0xa9ea('0x33')]['includeAll']){_0x327f87[_0xa9ea('0x43')]=[{'all':!![]}];}return db[_0xa9ea('0x2f')][_0xa9ea('0x44')](_0x327f87);})['then'](function(_0x448234){_0x42cbf1[_0xa9ea('0x45')]=_0x448234;return _0x42cbf1;})['then'](respondWithFilteredResult(_0x31c437,_0x327f87))[_0xa9ea('0x46')](handleError(_0x31c437,null));};exports[_0xa9ea('0x47')]=function(_0x2a2b8c,_0x12cdc3){var _0x19edc5={'raw':!![],'where':{'id':_0x2a2b8c[_0xa9ea('0x48')]['id']}},_0x4cdacb={};_0x4cdacb['model']=_['keys'](db[_0xa9ea('0x2f')][_0xa9ea('0x30')]);_0x4cdacb['query']=_[_0xa9ea('0x34')](_0x2a2b8c['query']);_0x4cdacb['filters']=_[_0xa9ea('0x36')](_0x4cdacb[_0xa9ea('0x37')],_0x4cdacb['query']);_0x19edc5[_0xa9ea('0x38')]=_[_0xa9ea('0x36')](_0x4cdacb[_0xa9ea('0x37')],qs['fields'](_0x2a2b8c[_0xa9ea('0x33')][_0xa9ea('0x39')]));_0x19edc5[_0xa9ea('0x38')]=_0x19edc5['attributes']['length']?_0x19edc5[_0xa9ea('0x38')]:_0x4cdacb['model'];if(_0x2a2b8c['query'][_0xa9ea('0x49')]){_0x19edc5[_0xa9ea('0x43')]=[{'all':!![]}];}_0x19edc5=_[_0xa9ea('0x41')]({},_0x19edc5,_0x2a2b8c['options']);return db[_0xa9ea('0x2f')][_0xa9ea('0x4a')](_0x19edc5)[_0xa9ea('0x28')](handleEntityNotFound(_0x12cdc3,null))[_0xa9ea('0x28')](respondWithResult(_0x12cdc3,null))[_0xa9ea('0x46')](handleError(_0x12cdc3,null));};exports[_0xa9ea('0x4b')]=function(_0x34a995,_0xf4955c){return db[_0xa9ea('0x2f')][_0xa9ea('0x4b')](_0x34a995[_0xa9ea('0x4c')],{})[_0xa9ea('0x28')](respondWithResult(_0xf4955c,0xc9))[_0xa9ea('0x46')](handleError(_0xf4955c,null));};exports['update']=function(_0x48a4d9,_0x3b1ade){if(_0x48a4d9[_0xa9ea('0x4c')]['id']){delete _0x48a4d9['body']['id'];}return db[_0xa9ea('0x2f')][_0xa9ea('0x4a')]({'where':{'id':_0x48a4d9['params']['id']}})[_0xa9ea('0x28')](handleEntityNotFound(_0x3b1ade,null))[_0xa9ea('0x28')](saveUpdates(_0x48a4d9[_0xa9ea('0x4c')],null))['then'](respondWithResult(_0x3b1ade,null))[_0xa9ea('0x46')](handleError(_0x3b1ade,null));};exports[_0xa9ea('0x27')]=function(_0x106356,_0xefa0d9){return db[_0xa9ea('0x2f')][_0xa9ea('0x4a')]({'where':{'id':_0x106356[_0xa9ea('0x48')]['id']}})['then'](handleEntityNotFound(_0xefa0d9,null))[_0xa9ea('0x28')](removeEntity(_0xefa0d9,null))[_0xa9ea('0x46')](handleError(_0xefa0d9,null));};exports[_0xa9ea('0x4d')]=function(_0x3908c5,_0x21d488){return db['JscriptySessionReport'][_0xa9ea('0x4d')]()[_0xa9ea('0x28')](respondWithResult(_0x21d488,null))[_0xa9ea('0x46')](handleError(_0x21d488,null));};exports['getQuestions']=function(_0x919ca6,_0x24c538,_0x4f7f33){var _0x3f6939={'raw':!![],'where':{}};var _0x2bf8ca={};var _0x4f4c63={'count':0x0,'rows':[]};return db[_0xa9ea('0x2f')][_0xa9ea('0x4e')]({'where':{'id':_0x919ca6['params']['id']}})[_0xa9ea('0x28')](handleEntityNotFound(_0x24c538,null))[_0xa9ea('0x28')](function(_0x47dd7f){if(_0x47dd7f){_0x2bf8ca[_0xa9ea('0x37')]=_[_0xa9ea('0x34')](db[_0xa9ea('0x4f')]['rawAttributes']);_0x2bf8ca['query']=_[_0xa9ea('0x34')](_0x919ca6[_0xa9ea('0x33')]);_0x2bf8ca[_0xa9ea('0x35')]=_['intersection'](_0x2bf8ca[_0xa9ea('0x37')],_0x2bf8ca[_0xa9ea('0x33')]);_0x3f6939['attributes']=_[_0xa9ea('0x36')](_0x2bf8ca[_0xa9ea('0x37')],qs['fields'](_0x919ca6[_0xa9ea('0x33')][_0xa9ea('0x39')]));_0x3f6939[_0xa9ea('0x38')]=_0x3f6939[_0xa9ea('0x38')]['length']?_0x3f6939[_0xa9ea('0x38')]:_0x2bf8ca[_0xa9ea('0x37')];if(!_0x919ca6[_0xa9ea('0x33')][_0xa9ea('0x3b')](_0xa9ea('0x50'))){_0x3f6939[_0xa9ea('0x21')]=qs[_0xa9ea('0x21')](_0x919ca6[_0xa9ea('0x33')][_0xa9ea('0x21')]);_0x3f6939[_0xa9ea('0x1e')]=qs[_0xa9ea('0x1e')](_0x919ca6['query'][_0xa9ea('0x1e')]);}_0x3f6939[_0xa9ea('0x3c')]=qs[_0xa9ea('0x3d')](_0x919ca6['query'][_0xa9ea('0x3d')]);_0x3f6939['where']=qs['filters'](_[_0xa9ea('0x3e')](_0x919ca6[_0xa9ea('0x33')],_0x2bf8ca[_0xa9ea('0x35')]));_0x3f6939[_0xa9ea('0x40')][_0xa9ea('0x51')]=_0x47dd7f['id'];if(_0x919ca6[_0xa9ea('0x33')][_0xa9ea('0x3f')]){_0x3f6939[_0xa9ea('0x40')]=_[_0xa9ea('0x41')](_0x3f6939['where'],{'$or':_[_0xa9ea('0x2e')](_0x3f6939[_0xa9ea('0x38')],function(_0x396814){var _0x53e370={};_0x53e370[_0x396814]={'$like':'%'+_0x919ca6[_0xa9ea('0x33')][_0xa9ea('0x3f')]+'%'};return _0x53e370;})});}_0x3f6939=_[_0xa9ea('0x41')]({},_0x3f6939,_0x919ca6[_0xa9ea('0x52')]);return db[_0xa9ea('0x4f')][_0xa9ea('0x20')]({'where':_0x3f6939[_0xa9ea('0x40')]})['then'](function(_0x391e25){_0x4f4c63[_0xa9ea('0x20')]=_0x391e25;if(_0x919ca6['query'][_0xa9ea('0x49')]){_0x3f6939[_0xa9ea('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa9ea('0x44')](_0x3f6939);})[_0xa9ea('0x28')](function(_0x1c5bea){_0x4f4c63[_0xa9ea('0x45')]=_0x1c5bea;return _0x4f4c63;});}})[_0xa9ea('0x28')](respondWithFilteredResult(_0x24c538,_0x3f6939))['catch'](handleError(_0x24c538,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b7143cd..1036368 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 _0xba34=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x64f713,_0x42cc4c){var _0x41ea6c=function(_0x13c5e5){while(--_0x13c5e5){_0x64f713['push'](_0x64f713['shift']());}};_0x41ea6c(++_0x42cc4c);}(_0xba34,0x119));var _0x4ba3=function(_0x1f8304,_0x512193){_0x1f8304=_0x1f8304-0x0;var _0x3252c1=_0xba34[_0x1f8304];return _0x3252c1;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef17=['./jscriptySessionReport.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0xef17,0x136));var _0x7ef1=function(_0x1e62a9,_0x48ed69){_0x1e62a9=_0x1e62a9-0x0;var _0x5b50f9=_0xef17[_0x1e62a9];return _0x5b50f9;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var rp=require(_0x7ef1('0x6'));var fs=require('fs');var path=require(_0x7ef1('0x7'));var rimraf=require(_0x7ef1('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ef1('0x9'));module['exports']=function(_0x138ed1,_0x498596){return _0x138ed1[_0x7ef1('0xa')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index d8fd617..c741873 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 _0x6455=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2fa4c8,_0x4dccc0){var _0x45c786=function(_0xb2a73){while(--_0xb2a73){_0x2fa4c8['push'](_0x2fa4c8['shift']());}};_0x45c786(++_0x4dccc0);}(_0x6455,0x97));var _0x5645=function(_0x4921b5,_0x26f911){_0x4921b5=_0x4921b5-0x0;var _0x533896=_0x6455[_0x4921b5];return _0x533896;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});} \ No newline at end of file +var _0xafb9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x472416,_0x3d61fb){var _0x157509=function(_0x100ea8){while(--_0x100ea8){_0x472416['push'](_0x472416['shift']());}};_0x157509(++_0x3d61fb);}(_0xafb9,0x68));var _0x9afb=function(_0x54f943,_0x5bbdc5){_0x54f943=_0x54f943-0x0;var _0x582e7b=_0xafb9[_0x54f943];return _0x582e7b;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 934a6ea..9b68575 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 _0xe06f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','/:id','isAuthenticated','update','exports','multer','util','connect-timeout'];(function(_0xa23838,_0x4991f0){var _0x1f958c=function(_0x1f39d8){while(--_0x1f39d8){_0xa23838['push'](_0xa23838['shift']());}};_0x1f958c(++_0x4991f0);}(_0xe06f,0x65));var _0xfe06=function(_0x3b8ea3,_0x22a249){_0x3b8ea3=_0x3b8ea3-0x0;var _0x4de412=_0xe06f[_0x3b8ea3];return _0x4de412;};'use strict';var multer=require(_0xfe06('0x0'));var util=require(_0xfe06('0x1'));var path=require('path');var timeout=require(_0xfe06('0x2'));var express=require('express');var router=express[_0xfe06('0x3')]();var fs_extra=require(_0xfe06('0x4'));var auth=require(_0xfe06('0x5'));var interaction=require(_0xfe06('0x6'));var config=require(_0xfe06('0x7'));var controller=require(_0xfe06('0x8'));router['get']('/',controller['index']);router['put'](_0xfe06('0x9'),auth[_0xfe06('0xa')](),controller[_0xfe06('0xb')]);module[_0xfe06('0xc')]=router; \ No newline at end of file +var _0xb2f1=['connect-timeout','express','fs-extra','../../components/auth/service','./license.controller','get','index','put','update','exports','multer','util'];(function(_0x428d78,_0x372962){var _0x3f8d3f=function(_0x473b2a){while(--_0x473b2a){_0x428d78['push'](_0x428d78['shift']());}};_0x3f8d3f(++_0x372962);}(_0xb2f1,0xee));var _0x1b2f=function(_0x88902,_0x494283){_0x88902=_0x88902-0x0;var _0x3b16b6=_0xb2f1[_0x88902];return _0x3b16b6;};'use strict';var multer=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var path=require('path');var timeout=require(_0x1b2f('0x2'));var express=require(_0x1b2f('0x3'));var router=express['Router']();var fs_extra=require(_0x1b2f('0x4'));var auth=require(_0x1b2f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b2f('0x6'));router[_0x1b2f('0x7')]('/',controller[_0x1b2f('0x8')]);router[_0x1b2f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1b2f('0xa')]);module[_0x1b2f('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 86ff2b4..33de1a8 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 _0xf5ca=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x3871bb,_0x151b7a){var _0x438be8=function(_0x34e179){while(--_0x34e179){_0x3871bb['push'](_0x3871bb['shift']());}};_0x438be8(++_0x151b7a);}(_0xf5ca,0x7f));var _0xaf5c=function(_0x346f5a,_0x33de62){_0x346f5a=_0x346f5a-0x0;var _0x2c1254=_0xf5ca[_0x346f5a];return _0x2c1254;};'use strict';var Sequelize=require(_0xaf5c('0x0'));module[_0xaf5c('0x1')]={'license':{'type':Sequelize[_0xaf5c('0x2')]},'data1':{'type':Sequelize[_0xaf5c('0x3')]},'data2':{'type':Sequelize[_0xaf5c('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xaf5c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34ff=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x612234,_0x41c144){var _0x42ce27=function(_0x958227){while(--_0x958227){_0x612234['push'](_0x612234['shift']());}};_0x42ce27(++_0x41c144);}(_0x34ff,0x1aa));var _0xf34f=function(_0x188600,_0x814ba4){_0x188600=_0x188600-0x0;var _0x1f5379=_0x34ff[_0x188600];return _0x1f5379;};'use strict';var Sequelize=require(_0xf34f('0x0'));module[_0xf34f('0x1')]={'license':{'type':Sequelize[_0xf34f('0x2')]},'data1':{'type':Sequelize[_0xf34f('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xf34f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 7fadabc..d1abdf0 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 _0x814b=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x437a28,_0x10d04d){var _0x440a9c=function(_0x32ee9c){while(--_0x32ee9c){_0x437a28['push'](_0x437a28['shift']());}};_0x440a9c(++_0x10d04d);}(_0x814b,0x1a2));var _0xb814=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0x814b[_0x36147b];return _0x141351;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xa'));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 licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}var utilLicense=require(_0xb814('0x19'));exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={'raw':!![],'where':{'id':0x1}},_0x499f22={};_0x499f22[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['License'][_0xb814('0x30')]);_0x499f22['query']=_[_0xb814('0x2f')](_0x9008b2['query']);_0x499f22['filters']=_[_0xb814('0x31')](_0x499f22['model'],_0x499f22[_0xb814('0x32')]);_0x530744[_0xb814('0x33')]=_[_0xb814('0x31')](_0x499f22['model'],qs['fields'](_0x9008b2[_0xb814('0x32')][_0xb814('0x34')]));_0x530744['attributes']=_0x530744[_0xb814('0x33')][_0xb814('0x35')]?_0x530744[_0xb814('0x33')]:_0x499f22[_0xb814('0x2e')];_0x530744=_[_0xb814('0x36')]({},_0x530744,_0x9008b2[_0xb814('0x37')]);return utilLicense[_0xb814('0x38')](_0x530744)['then'](respondWithResult(_0x37d24d,null))[_0xb814('0x39')](handleError(_0x37d24d,null));};exports[_0xb814('0x27')]=function(_0x30de5a,_0x424e2b){if(_0x30de5a[_0xb814('0x3a')]['id']){delete _0x30de5a['body']['id'];}return db[_0xb814('0x3b')]['find']({'where':{'id':_0x30de5a[_0xb814('0x3c')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x424e2b,null))[_0xb814('0x28')](function(_0x492d5e){var _0x40b885=_0x492d5e[_0xb814('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b885,_0x30de5a[_0xb814('0x3a')][_0xb814('0x3e')]);})[_0xb814('0x28')](function(_0x1f7cd8){if(!_0x1f7cd8[_0xb814('0x3f')]){return saveUpdates(_0x30de5a[_0xb814('0x3a')],null);}return _0x1f7cd8;})['then'](respondWithResult(_0x424e2b,null))[_0xb814('0x39')](handleError(_0x424e2b,null));}; \ No newline at end of file +var _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x2b1551,_0x1776fe){var _0x2fc2a1=function(_0x5d43c8){while(--_0x5d43c8){_0x2b1551['push'](_0x2b1551['shift']());}};_0x2fc2a1(++_0x1776fe);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0bc4d42..17cf1c6 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 _0xde27=['rimraf','../../config/environment','License','license','lodash','util','../../config/logger','bluebird','path'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xde27,0xa6));var _0x7de2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xde27[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7de2('0x0'));var util=require(_0x7de2('0x1'));var logger=require(_0x7de2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7de2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7de2('0x4'));var rimraf=require(_0x7de2('0x5'));var config=require(_0x7de2('0x6'));var attributes=require('./license.attributes');module['exports']=function(_0x347e0b,_0x1387f7){return _0x347e0b['define'](_0x7de2('0x7'),attributes,{'tableName':_0x7de2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bea=['./license.attributes','exports','define','License','license','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x18be96,_0x15e628){var _0x4b9baa=function(_0x2791b9){while(--_0x2791b9){_0x18be96['push'](_0x18be96['shift']());}};_0x4b9baa(++_0x15e628);}(_0x9bea,0x109));var _0xa9be=function(_0x35e0ac,_0x57e4ee){_0x35e0ac=_0x35e0ac-0x0;var _0x23553f=_0x9bea[_0x35e0ac];return _0x23553f;};'use strict';var _=require(_0xa9be('0x0'));var util=require(_0xa9be('0x1'));var logger=require('../../config/logger')(_0xa9be('0x2'));var moment=require(_0xa9be('0x3'));var BPromise=require(_0xa9be('0x4'));var rp=require(_0xa9be('0x5'));var fs=require('fs');var path=require(_0xa9be('0x6'));var rimraf=require('rimraf');var config=require(_0xa9be('0x7'));var attributes=require(_0xa9be('0x8'));module[_0xa9be('0x9')]=function(_0x28d2e3,_0x2653e1){return _0x28d2e3[_0xa9be('0xa')](_0xa9be('0xb'),attributes,{'tableName':_0xa9be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e24aa09..1e67a2b 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 _0x83f3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','code','message','License,\x20%s,\x20%s','result','util','moment'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x83f3,0x148));var _0x383f=function(_0x23ec05,_0x17be80){_0x23ec05=_0x23ec05-0x0;var _0xb12f86=_0x83f3[_0x23ec05];return _0xb12f86;};'use strict';var _=require('lodash');var util=require(_0x383f('0x0'));var moment=require(_0x383f('0x1'));var BPromise=require(_0x383f('0x2'));var rs=require(_0x383f('0x3'));var fs=require('fs');var Redis=require(_0x383f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x383f('0x5'));var logger=require(_0x383f('0x6'))(_0x383f('0x7'));var config=require(_0x383f('0x8'));var jayson=require(_0x383f('0x9'));var client=jayson[_0x383f('0xa')][_0x383f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f1cb9,_0x14d1e6,_0x44df37){return new BPromise(function(_0xb1faf1,_0x48e6cf){return client[_0x383f('0xc')](_0x5f1cb9,_0x44df37)[_0x383f('0xd')](function(_0x4fd4a3){logger[_0x383f('0xe')]('License,\x20%s,\x20%s',_0x14d1e6,_0x383f('0xf'));logger['debug'](_0x383f('0x10'),_0x14d1e6,_0x383f('0xf'),JSON['stringify'](_0x4fd4a3));if(_0x4fd4a3['error']){if(_0x4fd4a3[_0x383f('0x11')][_0x383f('0x12')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x14d1e6,_0x4fd4a3['error']['message']);return _0x48e6cf(_0x4fd4a3[_0x383f('0x11')][_0x383f('0x13')]);}logger['error'](_0x383f('0x14'),_0x14d1e6,_0x4fd4a3[_0x383f('0x11')][_0x383f('0x13')]);return _0xb1faf1(_0x4fd4a3[_0x383f('0x11')][_0x383f('0x13')]);}else{logger[_0x383f('0xe')](_0x383f('0x14'),_0x14d1e6,_0x383f('0xf'));_0xb1faf1(_0x4fd4a3[_0x383f('0x15')][_0x383f('0x13')]);}})['catch'](function(_0x3bdf87){logger[_0x383f('0x11')](_0x383f('0x14'),_0x14d1e6,_0x3bdf87);_0x48e6cf(_0x3bdf87);});});} \ No newline at end of file +var _0x9e94=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x399554,_0x570f3c){var _0x59cdf2=function(_0x3f3982){while(--_0x3f3982){_0x399554['push'](_0x399554['shift']());}};_0x59cdf2(++_0x570f3c);}(_0x9e94,0x1ce));var _0x49e9=function(_0x37ebf3,_0x10a0aa){_0x37ebf3=_0x37ebf3-0x0;var _0x2242a1=_0x9e94[_0x37ebf3];return _0x2242a1;};'use strict';var _=require(_0x49e9('0x0'));var util=require(_0x49e9('0x1'));var moment=require(_0x49e9('0x2'));var BPromise=require(_0x49e9('0x3'));var rs=require(_0x49e9('0x4'));var fs=require('fs');var Redis=require(_0x49e9('0x5'));var db=require(_0x49e9('0x6'))['db'];var utils=require(_0x49e9('0x7'));var logger=require(_0x49e9('0x8'))(_0x49e9('0x9'));var config=require('../../config/environment');var jayson=require(_0x49e9('0xa'));var client=jayson['client'][_0x49e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21c6ee,_0x2c2295,_0x3ed645){return new BPromise(function(_0x16ab27,_0x4b3459){return client[_0x49e9('0xc')](_0x21c6ee,_0x3ed645)[_0x49e9('0xd')](function(_0x14c304){logger[_0x49e9('0xe')](_0x49e9('0xf'),_0x2c2295,'request\x20sent');logger[_0x49e9('0x10')](_0x49e9('0x11'),_0x2c2295,'request\x20sent',JSON['stringify'](_0x14c304));if(_0x14c304[_0x49e9('0x12')]){if(_0x14c304[_0x49e9('0x12')][_0x49e9('0x13')]===0x1f4){logger[_0x49e9('0x12')](_0x49e9('0xf'),_0x2c2295,_0x14c304[_0x49e9('0x12')][_0x49e9('0x14')]);return _0x4b3459(_0x14c304[_0x49e9('0x12')]['message']);}logger['error'](_0x49e9('0xf'),_0x2c2295,_0x14c304[_0x49e9('0x12')][_0x49e9('0x14')]);return _0x16ab27(_0x14c304[_0x49e9('0x12')]['message']);}else{logger[_0x49e9('0xe')](_0x49e9('0xf'),_0x2c2295,_0x49e9('0x15'));_0x16ab27(_0x14c304[_0x49e9('0x16')][_0x49e9('0x14')]);}})[_0x49e9('0x17')](function(_0x3ca38f){logger[_0x49e9('0x12')](_0x49e9('0xf'),_0x2c2295,_0x3ca38f);_0x4b3459(_0x3ca38f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9a6cc5b..04f4b63 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 _0x90d8=['addApplications','/:id/send','send','addAgents','put','/:id','update','removeDispositions','delete','removeImap','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addDisposition','create','addImap','addSmtp'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x90d8,0x17d));var _0x890d=function(_0x4e5d21,_0x54c86c){_0x4e5d21=_0x4e5d21-0x0;var _0x3bf914=_0x90d8[_0x4e5d21];return _0x3bf914;};'use strict';var multer=require('multer');var util=require(_0x890d('0x0'));var path=require(_0x890d('0x1'));var timeout=require('connect-timeout');var express=require(_0x890d('0x2'));var router=express[_0x890d('0x3')]();var fs_extra=require(_0x890d('0x4'));var auth=require(_0x890d('0x5'));var interaction=require(_0x890d('0x6'));var config=require(_0x890d('0x7'));var controller=require('./mailAccount.controller');router[_0x890d('0x8')]('/',auth[_0x890d('0x9')](),controller[_0x890d('0xa')]);router[_0x890d('0x8')](_0x890d('0xb'),auth[_0x890d('0x9')](),controller[_0x890d('0xc')]);router[_0x890d('0x8')]('/:id',auth[_0x890d('0x9')](),controller[_0x890d('0xd')]);router[_0x890d('0x8')](_0x890d('0xe'),auth[_0x890d('0x9')](),controller[_0x890d('0xf')]);router[_0x890d('0x8')](_0x890d('0x10'),auth[_0x890d('0x9')](),controller[_0x890d('0x11')]);router[_0x890d('0x8')](_0x890d('0x12'),auth[_0x890d('0x9')](),controller[_0x890d('0x13')]);router[_0x890d('0x8')](_0x890d('0x14'),auth[_0x890d('0x9')](),controller['getSmtp']);router[_0x890d('0x8')](_0x890d('0x15'),auth[_0x890d('0x9')](),controller['getInteractions']);router[_0x890d('0x8')](_0x890d('0x16'),auth[_0x890d('0x9')](),controller[_0x890d('0x17')]);router['get'](_0x890d('0x18'),auth['isAuthenticated'](),controller['getMessages']);router[_0x890d('0x8')](_0x890d('0x19'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x890d('0x8')](_0x890d('0x1a'),auth['isAuthenticated'](),controller[_0x890d('0x1b')]);router[_0x890d('0x1c')](_0x890d('0xe'),auth[_0x890d('0x9')](),controller[_0x890d('0x1d')]);router[_0x890d('0x1c')](_0x890d('0x10'),auth[_0x890d('0x9')](),controller['addAnswer']);router[_0x890d('0x1c')]('/',auth[_0x890d('0x9')](),controller[_0x890d('0x1e')]);router['post'](_0x890d('0x12'),auth[_0x890d('0x9')](),controller[_0x890d('0x1f')]);router[_0x890d('0x1c')](_0x890d('0x14'),auth['isAuthenticated'](),controller[_0x890d('0x20')]);router['post']('/:id/interactions',auth[_0x890d('0x9')](),controller['addInteraction']);router['post'](_0x890d('0x16'),auth[_0x890d('0x9')](),controller[_0x890d('0x21')]);router[_0x890d('0x1c')](_0x890d('0x22'),auth[_0x890d('0x9')](),controller[_0x890d('0x23')]);router[_0x890d('0x1c')](_0x890d('0x1a'),auth[_0x890d('0x9')](),controller[_0x890d('0x24')]);router[_0x890d('0x25')](_0x890d('0x26'),auth[_0x890d('0x9')](),controller[_0x890d('0x27')]);router['delete']('/:id/dispositions',auth[_0x890d('0x9')](),controller[_0x890d('0x28')]);router[_0x890d('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x890d('0x29')]('/:id/in_servers',auth[_0x890d('0x9')](),controller[_0x890d('0x2a')]);router[_0x890d('0x29')](_0x890d('0x14'),auth['isAuthenticated'](),controller['removeSmtp']);router[_0x890d('0x29')](_0x890d('0x26'),auth[_0x890d('0x9')](),controller[_0x890d('0x2b')]);router[_0x890d('0x29')]('/:id/users',auth[_0x890d('0x9')](),controller[_0x890d('0x2c')]);module[_0x890d('0x2d')]=router; \ No newline at end of file +var _0x969d=['addImap','/:id/out_servers','/:id/send','send','addAgents','put','update','delete','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create'];(function(_0x199e46,_0x416a13){var _0x1a0b17=function(_0x3ebbf0){while(--_0x3ebbf0){_0x199e46['push'](_0x199e46['shift']());}};_0x1a0b17(++_0x416a13);}(_0x969d,0x15b));var _0xd969=function(_0x3dae4e,_0x1b4721){_0x3dae4e=_0x3dae4e-0x0;var _0x13ba96=_0x969d[_0x3dae4e];return _0x13ba96;};'use strict';var multer=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var path=require(_0xd969('0x2'));var timeout=require(_0xd969('0x3'));var express=require(_0xd969('0x4'));var router=express[_0xd969('0x5')]();var fs_extra=require(_0xd969('0x6'));var auth=require(_0xd969('0x7'));var interaction=require(_0xd969('0x8'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xd969('0x9')]('/',auth[_0xd969('0xa')](),controller[_0xd969('0xb')]);router[_0xd969('0x9')](_0xd969('0xc'),auth[_0xd969('0xa')](),controller[_0xd969('0xd')]);router['get'](_0xd969('0xe'),auth[_0xd969('0xa')](),controller[_0xd969('0xf')]);router[_0xd969('0x9')]('/:id/dispositions',auth[_0xd969('0xa')](),controller[_0xd969('0x10')]);router[_0xd969('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd969('0x11')]);router[_0xd969('0x9')](_0xd969('0x12'),auth[_0xd969('0xa')](),controller[_0xd969('0x13')]);router[_0xd969('0x9')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xd969('0x14')]);router[_0xd969('0x9')](_0xd969('0x15'),auth[_0xd969('0xa')](),controller[_0xd969('0x16')]);router[_0xd969('0x9')](_0xd969('0x17'),auth[_0xd969('0xa')](),controller[_0xd969('0x18')]);router[_0xd969('0x9')](_0xd969('0x19'),auth[_0xd969('0xa')](),controller[_0xd969('0x1a')]);router[_0xd969('0x9')](_0xd969('0x1b'),auth[_0xd969('0xa')](),controller[_0xd969('0x1c')]);router[_0xd969('0x9')](_0xd969('0x1d'),auth['isAuthenticated'](),controller[_0xd969('0x1e')]);router[_0xd969('0x1f')](_0xd969('0x20'),auth[_0xd969('0xa')](),controller[_0xd969('0x21')]);router[_0xd969('0x1f')](_0xd969('0x22'),auth[_0xd969('0xa')](),controller[_0xd969('0x23')]);router[_0xd969('0x1f')]('/',auth[_0xd969('0xa')](),controller[_0xd969('0x24')]);router[_0xd969('0x1f')](_0xd969('0x12'),auth['isAuthenticated'](),controller[_0xd969('0x25')]);router[_0xd969('0x1f')](_0xd969('0x26'),auth[_0xd969('0xa')](),controller['addSmtp']);router[_0xd969('0x1f')](_0xd969('0x15'),auth[_0xd969('0xa')](),controller['addInteraction']);router[_0xd969('0x1f')](_0xd969('0x17'),auth[_0xd969('0xa')](),controller['addApplications']);router['post'](_0xd969('0x27'),auth[_0xd969('0xa')](),controller[_0xd969('0x28')]);router['post'](_0xd969('0x1d'),auth[_0xd969('0xa')](),controller[_0xd969('0x29')]);router[_0xd969('0x2a')]('/:id',auth['isAuthenticated'](),controller[_0xd969('0x2b')]);router[_0xd969('0x2c')](_0xd969('0x20'),auth[_0xd969('0xa')](),controller['removeDispositions']);router[_0xd969('0x2c')]('/:id/canned_answers',auth[_0xd969('0xa')](),controller['removeAnswers']);router['delete'](_0xd969('0x12'),auth['isAuthenticated'](),controller[_0xd969('0x2d')]);router['delete'](_0xd969('0x26'),auth[_0xd969('0xa')](),controller['removeSmtp']);router[_0xd969('0x2c')](_0xd969('0xe'),auth[_0xd969('0xa')](),controller[_0xd969('0x2e')]);router[_0xd969('0x2c')](_0xd969('0x1d'),auth[_0xd969('0xa')](),controller[_0xd969('0x2f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3e4b9b5..8fd1ad9 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 _0x4fef=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x4fef,0x10f));var _0xf4fe=function(_0x2b96c3,_0x110e50){_0x2b96c3=_0x2b96c3-0x0;var _0xe7973e=_0x4fef[_0x2b96c3];return _0xe7973e;};'use strict';var Sequelize=require(_0xf4fe('0x0'));module[_0xf4fe('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf4fe('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf4fe('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf4fe('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf4fe('0x4')]},'markAsUnread':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf4fe('0x2')],'allowNull':![],'defaultValue':_0xf4fe('0x5')},'fontSize':{'type':Sequelize[_0xf4fe('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf4fe('0x4')],'defaultValue':function(){return _0xf4fe('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf4fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf4fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf4fe('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf4fe('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf4fe('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf4fe('0x9'),'set':function(_0x49d480){if(!_0x49d480)this[_0xf4fe('0xa')](_0xf4fe('0xb'),null);this[_0xf4fe('0xa')](_0xf4fe('0xc'),_0x49d480);}}}; \ No newline at end of file +var _0x6ddd=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','BOOLEAN'];(function(_0x1ecc01,_0x4be34f){var _0x260da7=function(_0x5736db){while(--_0x5736db){_0x1ecc01['push'](_0x1ecc01['shift']());}};_0x260da7(++_0x4be34f);}(_0x6ddd,0xae));var _0xd6dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ddd[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xd6dd('0x0')]},'name':{'type':Sequelize[_0xd6dd('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xd6dd('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xd6dd('0x0')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd6dd('0x2')},'fontSize':{'type':Sequelize[_0xd6dd('0x3')](0x2)[_0xd6dd('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd6dd('0x5');}},'notificationSound':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6dd('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd6dd('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6dd('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6dd('0x3')],'allowNull':!![],'defaultValue':null,'comment':_0xd6dd('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xd6dd('0x1')],'defaultValue':![],'comment':_0xd6dd('0x7'),'set':function(_0x399823){if(!_0x399823)this[_0xd6dd('0x8')](_0xd6dd('0x9'),null);this[_0xd6dd('0x8')](_0xd6dd('0xa'),_0x399823);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f40624d..896fa19 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 _0xe2df=['options','find','catch','body','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','pick','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','email','isNil','active','description','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','cservice','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','inlineCss','CmList','List','DESC','from','format','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','MailAccount','includeAll','findAll','rows','show','params','Pause','rawAttributes','length','include'];(function(_0x1d5a0e,_0x340fef){var _0x144867=function(_0x33e3ee){while(--_0x33e3ee){_0x1d5a0e['push'](_0x1d5a0e['shift']());}};_0x144867(++_0x340fef);}(_0xe2df,0x126));var _0xfe2d=function(_0x3ae251,_0x7200d3){_0x3ae251=_0x3ae251-0x0;var _0x8d205b=_0xe2df[_0x3ae251];return _0x8d205b;};'use strict';var emlformat=require(_0xfe2d('0x0'));var rimraf=require(_0xfe2d('0x1'));var zipdir=require(_0xfe2d('0x2'));var jsonpatch=require(_0xfe2d('0x3'));var rp=require(_0xfe2d('0x4'));var moment=require(_0xfe2d('0x5'));var BPromise=require(_0xfe2d('0x6'));var Mustache=require(_0xfe2d('0x7'));var util=require(_0xfe2d('0x8'));var path=require(_0xfe2d('0x9'));var sox=require(_0xfe2d('0xa'));var csv=require(_0xfe2d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2d('0xc'));var toCsv=require(_0xfe2d('0xb'));var querystring=require(_0xfe2d('0xd'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require(_0xfe2d('0xe'));var authService=require(_0xfe2d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfe2d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe2d('0x11'))(_0xfe2d('0x12'));var utils=require(_0xfe2d('0x13'));var config=require(_0xfe2d('0x14'));var licenseUtil=require(_0xfe2d('0x15'));var db=require(_0xfe2d('0x16'))['db'];config['redis']=_[_0xfe2d('0x17')](config[_0xfe2d('0x18')],{'host':_0xfe2d('0x19'),'port':0x18eb});var socket=require(_0xfe2d('0x1a'))(new Redis(config[_0xfe2d('0x18')]));require(_0xfe2d('0x1b'))[_0xfe2d('0x1c')](socket);var jayson=require(_0xfe2d('0x1d'));var client=jayson['client'][_0xfe2d('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0xca2bb7,_0x39fff3,_0x2ac76b,_0xcefe08){return new BPromise(function(_0x2273f6,_0x561374){var _0x27d796=_0xcefe08||client;return _0x27d796[_0xfe2d('0x1f')](_0xca2bb7,_0x2ac76b)[_0xfe2d('0x20')](function(_0x13b074){logger[_0xfe2d('0x21')](_0xfe2d('0x22'),_0x39fff3,_0xfe2d('0x23'));logger[_0xfe2d('0x24')](_0xfe2d('0x25'),_0x39fff3,'request\x20sent',JSON[_0xfe2d('0x26')](_0x13b074));if(_0x13b074[_0xfe2d('0x27')]){if(_0x13b074['error'][_0xfe2d('0x28')]===0x1f4){logger[_0xfe2d('0x27')](_0xfe2d('0x22'),_0x39fff3,_0x13b074[_0xfe2d('0x27')][_0xfe2d('0x29')]);return _0x561374(_0x13b074['error'][_0xfe2d('0x29')]);}logger[_0xfe2d('0x27')]('MailAccount,\x20%s,\x20%s',_0x39fff3,_0x13b074[_0xfe2d('0x27')][_0xfe2d('0x29')]);return _0x2273f6(_0x13b074['error'][_0xfe2d('0x29')]);}else{logger[_0xfe2d('0x21')](_0xfe2d('0x22'),_0x39fff3,_0xfe2d('0x23'));_0x2273f6(_0x13b074[_0xfe2d('0x2a')][_0xfe2d('0x29')]);}})['catch'](function(_0x30da0c){logger[_0xfe2d('0x27')]('MailAccount,\x20%s,\x20%s',_0x39fff3,_0x30da0c);_0x561374(_0x30da0c);});});}function respondWithStatusCode(_0x228264,_0x4a0422){_0x4a0422=_0x4a0422||0xcc;return function(_0x59c5dd){if(_0x59c5dd){return _0x228264[_0xfe2d('0x2b')](_0x4a0422);}return _0x228264[_0xfe2d('0x2c')](_0x4a0422)['end']();};}function respondWithResult(_0x480b30,_0x49bc37){_0x49bc37=_0x49bc37||0xc8;return function(_0x2d95a1){if(_0x2d95a1){return _0x480b30['status'](_0x49bc37)['json'](_0x2d95a1);}};}function respondWithFilteredResult(_0x3a20f8,_0x596fd2){return function(_0x4d342c){if(_0x4d342c){var _0x429220=typeof _0x596fd2[_0xfe2d('0x2d')]==='undefined'&&typeof _0x596fd2[_0xfe2d('0x2e')]===_0xfe2d('0x2f');var _0x18930f=_0x4d342c['count'];var _0x37f10c=_0x429220?0x0:_0x596fd2[_0xfe2d('0x2d')];var _0x4f3dd3=_0x429220?_0x4d342c[_0xfe2d('0x30')]:_0x596fd2[_0xfe2d('0x2d')]+_0x596fd2[_0xfe2d('0x2e')];var _0x18dd57;if(_0x4f3dd3>=_0x18930f){_0x4f3dd3=_0x18930f;_0x18dd57=0xc8;}else{_0x18dd57=0xce;}_0x3a20f8[_0xfe2d('0x2c')](_0x18dd57);return _0x3a20f8[_0xfe2d('0x31')](_0xfe2d('0x32'),_0x37f10c+'-'+_0x4f3dd3+'/'+_0x18930f)[_0xfe2d('0x33')](_0x4d342c);}return null;};}function patchUpdates(_0x5d5935){return function(_0x36ce8c){try{jsonpatch[_0xfe2d('0x34')](_0x36ce8c,_0x5d5935,!![]);}catch(_0x53462b){return BPromise[_0xfe2d('0x35')](_0x53462b);}return _0x36ce8c[_0xfe2d('0x36')]();};}function saveUpdates(_0x12a904,_0x107273){return function(_0x2a4bdb){if(_0x2a4bdb){return _0x2a4bdb[_0xfe2d('0x37')](_0x12a904)['then'](function(_0x505941){return _0x505941;});}return null;};}function removeEntity(_0x44b1cf,_0x5135dd){return function(_0x1ee3a5){if(_0x1ee3a5){return _0x1ee3a5[_0xfe2d('0x38')]()[_0xfe2d('0x20')](function(){var _0x1f06fa=_0x1ee3a5[_0xfe2d('0x39')]({'plain':!![]});var _0x522c8d=_0xfe2d('0x3a');return db[_0xfe2d('0x3b')][_0xfe2d('0x38')]({'where':{'type':_0x522c8d,'resourceId':_0x1f06fa['id']}})[_0xfe2d('0x20')](function(){return _0x1ee3a5;});})['then'](function(){_0x44b1cf['status'](0xcc)[_0xfe2d('0x3c')]();});}};}function handleEntityNotFound(_0x50851c,_0x20e0a3){return function(_0x2fa6b0){if(!_0x2fa6b0){_0x50851c[_0xfe2d('0x2b')](0x194);}return _0x2fa6b0;};}function handleError(_0x99b1c7,_0x5efaed){_0x5efaed=_0x5efaed||0x1f4;return function(_0xead34b){logger[_0xfe2d('0x27')](_0xead34b[_0xfe2d('0x3d')]);if(_0xead34b['name']){delete _0xead34b[_0xfe2d('0x3e')];}_0x99b1c7[_0xfe2d('0x2c')](_0x5efaed)[_0xfe2d('0x3f')](_0xead34b);};}exports[_0xfe2d('0x40')]=function(_0x22caad,_0x3aa88c){var _0x5d3143={'include':[{'model':db[_0xfe2d('0x41')],'as':_0xfe2d('0x42')},{'model':db[_0xfe2d('0x43')],'as':_0xfe2d('0x44')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xcf56bf={},_0x5809a9={'count':0x0,'rows':[]};var _0x2da5d3=_[_0xfe2d('0x45')](db['MailAccount']['rawAttributes'],function(_0x278532){return{'name':_0x278532[_0xfe2d('0x46')],'type':_0x278532['type'][_0xfe2d('0x47')]};});_0xcf56bf[_0xfe2d('0x48')]=_[_0xfe2d('0x45')](_0x2da5d3,_0xfe2d('0x3e'));_0xcf56bf[_0xfe2d('0x49')]=_[_0xfe2d('0x4a')](_0x22caad[_0xfe2d('0x49')]);_0xcf56bf[_0xfe2d('0x4b')]=_[_0xfe2d('0x4c')](_0xcf56bf[_0xfe2d('0x48')],_0xcf56bf['query']);_0x5d3143[_0xfe2d('0x4d')]=_[_0xfe2d('0x4c')](_0xcf56bf[_0xfe2d('0x48')],qs['fields'](_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x4e')]));_0x5d3143[_0xfe2d('0x4d')]=_0x5d3143[_0xfe2d('0x4d')]['length']?_0x5d3143['attributes']:_0xcf56bf[_0xfe2d('0x48')];if(!_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x5d3143[_0xfe2d('0x2e')]=qs[_0xfe2d('0x2e')](_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x5d3143[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x2d')]);}_0x5d3143[_0xfe2d('0x51')]=qs[_0xfe2d('0x52')](_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x52')]);_0x5d3143[_0xfe2d('0x53')]=qs[_0xfe2d('0x4b')](_['pick'](_0x22caad[_0xfe2d('0x49')],_0xcf56bf['filters']),_0x2da5d3);if(_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x5d3143[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x5d3143[_0xfe2d('0x53')],{'$or':_[_0xfe2d('0x45')](_0x2da5d3,function(_0x517e17){if(_0x517e17[_0xfe2d('0x56')]!==_0xfe2d('0x57')){var _0xa3c91={};_0xa3c91[_0x517e17['name']]={'$like':'%'+_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x54')]+'%'};return _0xa3c91;}})});}_0x5d3143=_[_0xfe2d('0x55')]({},_0x5d3143,_0x22caad['options']);var _0x4c9dd1={'where':_0x5d3143[_0xfe2d('0x53')]};return db[_0xfe2d('0x58')][_0xfe2d('0x30')](_0x4c9dd1)['then'](function(_0x2ddcd3){_0x5809a9[_0xfe2d('0x30')]=_0x2ddcd3;if(_0x22caad[_0xfe2d('0x49')][_0xfe2d('0x59')]){_0x5d3143['include']=[{'all':!![]}];}return db['MailAccount'][_0xfe2d('0x5a')](_0x5d3143);})[_0xfe2d('0x20')](function(_0x51aca5){_0x5809a9[_0xfe2d('0x5b')]=_0x51aca5;return _0x5809a9;})[_0xfe2d('0x20')](respondWithFilteredResult(_0x3aa88c,_0x5d3143))['catch'](handleError(_0x3aa88c,null));};exports[_0xfe2d('0x5c')]=function(_0x49c418,_0xd1391f){var _0x252c79={'raw':![],'where':{'id':_0x49c418[_0xfe2d('0x5d')]['id']},'include':[{'model':db[_0xfe2d('0x41')],'as':_0xfe2d('0x42')},{'model':db['MailServerOut'],'as':_0xfe2d('0x44')},{'model':db[_0xfe2d('0x5e')],'as':'mandatoryDispositionPause'}]},_0x545e91={};_0x545e91['model']=_[_0xfe2d('0x4a')](db[_0xfe2d('0x58')][_0xfe2d('0x5f')]);_0x545e91['query']=_[_0xfe2d('0x4a')](_0x49c418[_0xfe2d('0x49')]);_0x545e91['filters']=_[_0xfe2d('0x4c')](_0x545e91[_0xfe2d('0x48')],_0x545e91[_0xfe2d('0x49')]);_0x252c79['attributes']=_['intersection'](_0x545e91[_0xfe2d('0x48')],qs[_0xfe2d('0x4e')](_0x49c418['query'][_0xfe2d('0x4e')]));_0x252c79[_0xfe2d('0x4d')]=_0x252c79[_0xfe2d('0x4d')][_0xfe2d('0x60')]?_0x252c79['attributes']:_0x545e91['model'];if(_0x49c418[_0xfe2d('0x49')][_0xfe2d('0x59')]){_0x252c79[_0xfe2d('0x61')]=[{'all':!![]}];}_0x252c79=_[_0xfe2d('0x55')]({},_0x252c79,_0x49c418[_0xfe2d('0x62')]);return db[_0xfe2d('0x58')][_0xfe2d('0x63')](_0x252c79)[_0xfe2d('0x20')](handleEntityNotFound(_0xd1391f,null))[_0xfe2d('0x20')](respondWithResult(_0xd1391f,null))[_0xfe2d('0x64')](handleError(_0xd1391f,null));};exports['update']=function(_0x4dedfa,_0x594bc9){if(_0x4dedfa['body']['id']){delete _0x4dedfa[_0xfe2d('0x65')]['id'];}return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x4dedfa[_0xfe2d('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xfe2d('0x42')},{'model':db[_0xfe2d('0x43')],'as':_0xfe2d('0x44')},{'model':db['Pause'],'as':_0xfe2d('0x66')}]})[_0xfe2d('0x20')](handleEntityNotFound(_0x594bc9,null))[_0xfe2d('0x20')](saveUpdates(_0x4dedfa[_0xfe2d('0x65')],null))[_0xfe2d('0x20')](function(_0x4cab00){if(_0x4cab00&&_0x4dedfa[_0xfe2d('0x65')][_0xfe2d('0x42')]){return db[_0xfe2d('0x41')][_0xfe2d('0x37')](_0x4dedfa['body'][_0xfe2d('0x42')],{'where':{'MailAccountId':_0x4cab00['id']}})['then'](function(){return _0x4cab00;});}return _0x4cab00;})[_0xfe2d('0x20')](function(_0x5eab75){if(_0x5eab75&&_0x4dedfa['body'][_0xfe2d('0x44')]){return db[_0xfe2d('0x43')]['update'](_0x4dedfa[_0xfe2d('0x65')][_0xfe2d('0x44')],{'where':{'MailAccountId':_0x5eab75['id']}})[_0xfe2d('0x20')](function(){return _0x5eab75;});}return _0x5eab75;})[_0xfe2d('0x20')](respondWithResult(_0x594bc9,null))[_0xfe2d('0x64')](handleError(_0x594bc9,null));};exports[_0xfe2d('0x67')]=function(_0x4fc93c,_0x959cf0){return db[_0xfe2d('0x58')][_0xfe2d('0x67')]()[_0xfe2d('0x20')](respondWithResult(_0x959cf0,null))['catch'](handleError(_0x959cf0,null));};exports[_0xfe2d('0x68')]=function(_0x3ab964,_0x38145e,_0x2eb8a7){if(_0x3ab964[_0xfe2d('0x65')]['id']){delete _0x3ab964[_0xfe2d('0x65')]['id'];}return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x3ab964['params']['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x38145e,null))['then'](function(_0x13799b){if(_0x13799b){_0x3ab964['body'][_0xfe2d('0x69')]=_0x13799b['id'];return db[_0xfe2d('0x6a')][_0xfe2d('0x6b')](_0x3ab964[_0xfe2d('0x65')]);}})[_0xfe2d('0x20')](respondWithResult(_0x38145e,null))[_0xfe2d('0x64')](handleError(_0x38145e,null));};exports[_0xfe2d('0x6c')]=function(_0x2bb7f8,_0x4f965c,_0x1b4316){var _0x59ed6f={'raw':![],'where':{}};var _0x416179={};var _0x9ac73d={'count':0x0,'rows':[]};return db[_0xfe2d('0x58')]['findOne']({'where':{'id':_0x2bb7f8[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4f965c,null))[_0xfe2d('0x20')](function(_0x4e38ea){if(_0x4e38ea){_0x416179[_0xfe2d('0x48')]=_[_0xfe2d('0x4a')](db['Disposition'][_0xfe2d('0x5f')]);_0x416179['query']=_['keys'](_0x2bb7f8[_0xfe2d('0x49')]);_0x416179[_0xfe2d('0x4b')]=_[_0xfe2d('0x4c')](_0x416179[_0xfe2d('0x48')],_0x416179[_0xfe2d('0x49')]);_0x59ed6f[_0xfe2d('0x4d')]=_[_0xfe2d('0x4c')](_0x416179[_0xfe2d('0x48')],qs[_0xfe2d('0x4e')](_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x4e')]));_0x59ed6f[_0xfe2d('0x4d')]=_0x59ed6f[_0xfe2d('0x4d')]['length']?_0x59ed6f[_0xfe2d('0x4d')]:_0x416179['model'];if(!_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x59ed6f[_0xfe2d('0x2e')]=qs[_0xfe2d('0x2e')](_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x59ed6f[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x2d')]);}_0x59ed6f[_0xfe2d('0x51')]=qs[_0xfe2d('0x52')](_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x52')]);_0x59ed6f[_0xfe2d('0x53')]=qs[_0xfe2d('0x4b')](_[_0xfe2d('0x6d')](_0x2bb7f8[_0xfe2d('0x49')],_0x416179[_0xfe2d('0x4b')]));_0x59ed6f['where'][_0xfe2d('0x69')]=_0x4e38ea['id'];if(_0x2bb7f8[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x59ed6f[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x59ed6f[_0xfe2d('0x53')],{'$or':_[_0xfe2d('0x45')](_0x59ed6f[_0xfe2d('0x4d')],function(_0x3af552){var _0x2cafb1={};_0x2cafb1[_0x3af552]={'$like':'%'+_0x2bb7f8['query']['filter']+'%'};return _0x2cafb1;})});}_0x59ed6f=_['merge']({},_0x59ed6f,_0x2bb7f8[_0xfe2d('0x62')]);return db[_0xfe2d('0x6a')][_0xfe2d('0x30')]({'where':_0x59ed6f[_0xfe2d('0x53')]})['then'](function(_0x36c7d5){_0x9ac73d[_0xfe2d('0x30')]=_0x36c7d5;if(_0x2bb7f8[_0xfe2d('0x49')]['includeAll']){_0x59ed6f[_0xfe2d('0x61')]=[{'all':!![]}];}return db['Disposition'][_0xfe2d('0x5a')](_0x59ed6f);})[_0xfe2d('0x20')](function(_0x4aa74d){_0x9ac73d[_0xfe2d('0x5b')]=_0x4aa74d;return _0x9ac73d;});}})[_0xfe2d('0x20')](respondWithFilteredResult(_0x4f965c,_0x59ed6f))[_0xfe2d('0x64')](handleError(_0x4f965c,null));};exports[_0xfe2d('0x6e')]=function(_0x38afc7,_0x27865b,_0x1c273b){return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x38afc7[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x27865b,null))['then'](function(_0x217e37){if(_0x217e37){return _0x217e37[_0xfe2d('0x6e')](_0x38afc7[_0xfe2d('0x49')][_0xfe2d('0x6f')]);}})[_0xfe2d('0x20')](respondWithStatusCode(_0x27865b,null))[_0xfe2d('0x64')](handleError(_0x27865b,null));};exports['addAnswer']=function(_0x573a1f,_0x589539,_0x51f5c6){if(_0x573a1f[_0xfe2d('0x65')]['id']){delete _0x573a1f[_0xfe2d('0x65')]['id'];}return db['MailAccount'][_0xfe2d('0x63')]({'where':{'id':_0x573a1f['params']['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x589539,null))[_0xfe2d('0x20')](function(_0x164b47){if(_0x164b47){_0x573a1f[_0xfe2d('0x65')][_0xfe2d('0x69')]=_0x164b47['id'];return db[_0xfe2d('0x70')][_0xfe2d('0x6b')](_0x573a1f['body']);}})[_0xfe2d('0x20')](respondWithResult(_0x589539,null))['catch'](handleError(_0x589539,null));};exports['getAnswers']=function(_0xf0b968,_0x2448aa,_0x259081){var _0x559922={'raw':![],'where':{}};var _0x4c1597={};var _0x145858={'count':0x0,'rows':[]};return db[_0xfe2d('0x58')][_0xfe2d('0x71')]({'where':{'id':_0xf0b968[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x2448aa,null))[_0xfe2d('0x20')](function(_0x533979){if(_0x533979){_0x4c1597[_0xfe2d('0x48')]=_['keys'](db[_0xfe2d('0x70')][_0xfe2d('0x5f')]);_0x4c1597['query']=_[_0xfe2d('0x4a')](_0xf0b968[_0xfe2d('0x49')]);_0x4c1597[_0xfe2d('0x4b')]=_['intersection'](_0x4c1597[_0xfe2d('0x48')],_0x4c1597['query']);_0x559922[_0xfe2d('0x4d')]=_['intersection'](_0x4c1597['model'],qs[_0xfe2d('0x4e')](_0xf0b968['query'][_0xfe2d('0x4e')]));_0x559922[_0xfe2d('0x4d')]=_0x559922[_0xfe2d('0x4d')][_0xfe2d('0x60')]?_0x559922[_0xfe2d('0x4d')]:_0x4c1597[_0xfe2d('0x48')];if(!_0xf0b968[_0xfe2d('0x49')][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x559922[_0xfe2d('0x2e')]=qs[_0xfe2d('0x2e')](_0xf0b968[_0xfe2d('0x49')]['limit']);_0x559922[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0xf0b968['query'][_0xfe2d('0x2d')]);}_0x559922[_0xfe2d('0x51')]=qs[_0xfe2d('0x52')](_0xf0b968[_0xfe2d('0x49')][_0xfe2d('0x52')]);_0x559922['where']=qs[_0xfe2d('0x4b')](_[_0xfe2d('0x6d')](_0xf0b968[_0xfe2d('0x49')],_0x4c1597['filters']));_0x559922[_0xfe2d('0x53')][_0xfe2d('0x69')]=_0x533979['id'];if(_0xf0b968[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x559922['where']=_[_0xfe2d('0x55')](_0x559922[_0xfe2d('0x53')],{'$or':_[_0xfe2d('0x45')](_0x559922['attributes'],function(_0xaee66e){var _0x1c251c={};_0x1c251c[_0xaee66e]={'$like':'%'+_0xf0b968['query'][_0xfe2d('0x54')]+'%'};return _0x1c251c;})});}_0x559922=_[_0xfe2d('0x55')]({},_0x559922,_0xf0b968[_0xfe2d('0x62')]);return db['CannedAnswer']['count']({'where':_0x559922[_0xfe2d('0x53')]})['then'](function(_0x1200f0){_0x145858['count']=_0x1200f0;if(_0xf0b968['query'][_0xfe2d('0x59')]){_0x559922[_0xfe2d('0x61')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfe2d('0x5a')](_0x559922);})[_0xfe2d('0x20')](function(_0x2f4485){_0x145858[_0xfe2d('0x5b')]=_0x2f4485;return _0x145858;});}})[_0xfe2d('0x20')](respondWithFilteredResult(_0x2448aa,_0x559922))[_0xfe2d('0x64')](handleError(_0x2448aa,null));};exports[_0xfe2d('0x72')]=function(_0x4d88f7,_0x3fd4db,_0x5116f4){return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x4d88f7[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3fd4db,null))[_0xfe2d('0x20')](function(_0x30197c){if(_0x30197c){return _0x30197c[_0xfe2d('0x72')](_0x4d88f7[_0xfe2d('0x49')][_0xfe2d('0x6f')]);}})['then'](respondWithStatusCode(_0x3fd4db,null))[_0xfe2d('0x64')](handleError(_0x3fd4db,null));};exports[_0xfe2d('0x6b')]=function(_0x36e3af,_0x511468){var _0x69e926={'name':_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x3e')],'key':_0x36e3af['body'][_0xfe2d('0x47')],'email':_0x36e3af['body'][_0xfe2d('0x73')],'ListId':_0x36e3af['body']['ListId'],'active':!_[_0xfe2d('0x74')](_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x75')])?_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x75')]:!![],'description':_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x76')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x36e3af[_0xfe2d('0x65')]['cservice'])){if(_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x77')]){_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x78')]=_0x69e926[_0xfe2d('0x44')]['user']=_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x79')];_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7a')]=_0x69e926[_0xfe2d('0x44')]['pass']=_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x7b')];}else{_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7c')]=_0x69e926[_0xfe2d('0x44')][_0xfe2d('0x7c')]=![];}_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7d')]=_0x36e3af['body']['Imap']['host'];_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7e')]=_0x36e3af['body']['Imap'][_0xfe2d('0x7e')];_0x69e926[_0xfe2d('0x44')][_0xfe2d('0x7d')]=_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x44')][_0xfe2d('0x7d')];_0x69e926['Smtp'][_0xfe2d('0x7e')]=_0x36e3af['body'][_0xfe2d('0x44')][_0xfe2d('0x7e')];}else{_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7f')]=_0x69e926[_0xfe2d('0x44')][_0xfe2d('0x7f')]=_0x36e3af['body'][_0xfe2d('0x80')];_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x78')]=_0x69e926[_0xfe2d('0x44')]['user']=_0x36e3af['body'][_0xfe2d('0x79')];_0x69e926[_0xfe2d('0x42')][_0xfe2d('0x7a')]=_0x69e926[_0xfe2d('0x44')][_0xfe2d('0x81')]=_0x36e3af[_0xfe2d('0x65')][_0xfe2d('0x7b')];}return db[_0xfe2d('0x58')]['create'](_0x69e926,{'include':[{'model':db[_0xfe2d('0x43')],'as':_0xfe2d('0x44')},{'model':db[_0xfe2d('0x41')],'as':_0xfe2d('0x42')}]})['then'](function(_0x358218){var _0x33237b=_0x36e3af[_0xfe2d('0x78')][_0xfe2d('0x39')]({'plain':!![]});if(!_0x33237b)throw new Error(_0xfe2d('0x82'));if(_0x33237b[_0xfe2d('0x83')]==='user'){var _0x3c750b=_0x358218['get']({'plain':!![]});return db[_0xfe2d('0x84')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x33237b[_0xfe2d('0x85')]},'raw':!![]})[_0xfe2d('0x20')](function(_0xe855d4){if(_0xe855d4&&_0xe855d4[_0xfe2d('0x86')]===0x0){return db['UserProfileResource']['create']({'name':_0x3c750b[_0xfe2d('0x3e')],'resourceId':_0x3c750b['id'],'type':_0xe855d4['name'],'sectionId':_0xe855d4['id']},{})[_0xfe2d('0x20')](function(){return _0x358218;});}else{return _0x358218;}})[_0xfe2d('0x64')](function(_0x483cc4){logger['error'](_0xfe2d('0x87'),_0x483cc4);throw _0x483cc4;});}return _0x358218;})[_0xfe2d('0x20')](respondWithResult(_0x511468,0xc9))[_0xfe2d('0x64')](handleError(_0x511468,null));};exports['getImap']=function(_0xfc5e86,_0x20f898,_0x436838){return db[_0xfe2d('0x58')][_0xfe2d('0x71')]({'where':{'id':_0xfc5e86[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x20f898,null))[_0xfe2d('0x20')](function(_0x1ed579){if(_0x1ed579){return _0x1ed579[_0xfe2d('0x88')]();}return null;})['then'](respondWithResult(_0x20f898,null))[_0xfe2d('0x64')](handleError(_0x20f898,null));};exports['addImap']=function(_0x5f6d71,_0xa0c3a3,_0x39e82e){if(_0x5f6d71['body']['id']){delete _0x5f6d71[_0xfe2d('0x65')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x5f6d71[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0xa0c3a3,null))['then'](function(_0x53ca05){if(_0x53ca05){_0x5f6d71[_0xfe2d('0x65')][_0xfe2d('0x69')]=_0x53ca05['id'];return db['MailServerIn'][_0xfe2d('0x6b')](_0x5f6d71[_0xfe2d('0x65')]);}})[_0xfe2d('0x20')](respondWithResult(_0xa0c3a3,null))[_0xfe2d('0x64')](handleError(_0xa0c3a3,null));};exports[_0xfe2d('0x89')]=function(_0x2534fd,_0x567fe2,_0x51fbe5){return db['MailAccount'][_0xfe2d('0x71')]({'where':{'id':_0x2534fd[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x567fe2,null))[_0xfe2d('0x20')](function(_0x37b8f7){if(_0x37b8f7){return _0x37b8f7[_0xfe2d('0x8a')](null);}return null;})[_0xfe2d('0x20')](respondWithStatusCode(_0x567fe2,null))['catch'](handleError(_0x567fe2,null));};exports[_0xfe2d('0x8b')]=function(_0x501c37,_0x15dea0,_0x261d4f){return db[_0xfe2d('0x58')]['findOne']({'where':{'id':_0x501c37[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x15dea0,null))[_0xfe2d('0x20')](function(_0x594648){if(_0x594648){return _0x594648[_0xfe2d('0x8b')]();}return null;})['then'](respondWithResult(_0x15dea0,null))['catch'](handleError(_0x15dea0,null));};exports[_0xfe2d('0x8c')]=function(_0x5c50ff,_0x3ddac5,_0x3ef933){if(_0x5c50ff[_0xfe2d('0x65')]['id']){delete _0x5c50ff[_0xfe2d('0x65')]['id'];}return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x5c50ff[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x3ddac5,null))['then'](function(_0xbf87b0){if(_0xbf87b0){_0x5c50ff[_0xfe2d('0x65')][_0xfe2d('0x69')]=_0xbf87b0['id'];return db['MailServerOut'][_0xfe2d('0x6b')](_0x5c50ff[_0xfe2d('0x65')]);}})[_0xfe2d('0x20')](respondWithResult(_0x3ddac5,null))[_0xfe2d('0x64')](handleError(_0x3ddac5,null));};exports[_0xfe2d('0x8d')]=function(_0x8bf90,_0x1c70c1,_0x2dd927){return db['MailAccount']['findOne']({'where':{'id':_0x8bf90[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1c70c1,null))[_0xfe2d('0x20')](function(_0xeffee2){if(_0xeffee2){return _0xeffee2['setSmtp'](null);}return null;})[_0xfe2d('0x20')](respondWithStatusCode(_0x1c70c1,null))[_0xfe2d('0x64')](handleError(_0x1c70c1,null));};exports[_0xfe2d('0x8e')]=function(_0x3fc96b,_0xfbd16b,_0x1de04d){return db[_0xfe2d('0x8f')][_0xfe2d('0x63')]({'where':{'id':_0x3fc96b[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0xfbd16b,null))[_0xfe2d('0x20')](function(_0x7812db){if(_0x7812db){return _0x7812db[_0xfe2d('0x8e')](_0x3fc96b[_0xfe2d('0x65')]['ids'],_[_0xfe2d('0x90')](_0x3fc96b[_0xfe2d('0x65')],[_0xfe2d('0x6f'),'id'])||{});}})[_0xfe2d('0x20')](respondWithResult(_0xfbd16b,null))[_0xfe2d('0x64')](handleError(_0xfbd16b,null));};exports['getInteractions']=function(_0x2509f1,_0x334767,_0x1999fd){var _0x29d01d={'raw':![],'where':{}};var _0x102255={};var _0x2e48c6={'count':0x0,'rows':[]};return db[_0xfe2d('0x58')]['findOne']({'where':{'id':_0x2509f1[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x334767,null))[_0xfe2d('0x20')](function(_0x441b99){if(_0x441b99){_0x102255[_0xfe2d('0x48')]=_[_0xfe2d('0x4a')](db['MailInteraction'][_0xfe2d('0x5f')]);_0x102255['query']=_['keys'](_0x2509f1['query']);_0x102255['filters']=_[_0xfe2d('0x4c')](_0x102255['model'],_0x102255[_0xfe2d('0x49')]);_0x29d01d['attributes']=_[_0xfe2d('0x4c')](_0x102255['model'],qs[_0xfe2d('0x4e')](_0x2509f1['query'][_0xfe2d('0x4e')]));_0x29d01d[_0xfe2d('0x4d')]=_0x29d01d['attributes']['length']?_0x29d01d['attributes']:_0x102255[_0xfe2d('0x48')];if(!_0x2509f1['query'][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x29d01d[_0xfe2d('0x2e')]=qs[_0xfe2d('0x2e')](_0x2509f1[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x29d01d['offset']=qs['offset'](_0x2509f1['query'][_0xfe2d('0x2d')]);}_0x29d01d['order']=qs['sort'](_0x2509f1['query'][_0xfe2d('0x52')]);_0x29d01d['where']=qs[_0xfe2d('0x4b')](_[_0xfe2d('0x6d')](_0x2509f1[_0xfe2d('0x49')],_0x102255[_0xfe2d('0x4b')]));_0x29d01d['where'][_0xfe2d('0x69')]=_0x441b99['id'];if(_0x2509f1[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x29d01d[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x29d01d['where'],{'$or':_[_0xfe2d('0x45')](_0x29d01d['attributes'],function(_0x1e4c80){var _0x370c97={};_0x370c97[_0x1e4c80]={'$like':'%'+_0x2509f1[_0xfe2d('0x49')][_0xfe2d('0x54')]+'%'};return _0x370c97;})});}_0x29d01d=_[_0xfe2d('0x55')]({},_0x29d01d,_0x2509f1[_0xfe2d('0x62')]);return db[_0xfe2d('0x8f')][_0xfe2d('0x30')]({'where':_0x29d01d[_0xfe2d('0x53')]})['then'](function(_0x2a8730){_0x2e48c6['count']=_0x2a8730;if(_0x2509f1[_0xfe2d('0x49')]['includeAll']){_0x29d01d['include']=[{'model':db[_0xfe2d('0x91')],'as':_0xfe2d('0x92'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xfe2d('0x3e'),_0xfe2d('0x93'),_0xfe2d('0x94')],'required':![]},{'model':db[_0xfe2d('0x95')],'as':'Tags','attributes':['id',_0xfe2d('0x3e'),_0xfe2d('0x96')],'where':_0x2509f1[_0xfe2d('0x49')][_0xfe2d('0x97')]?{'id':_0x2509f1[_0xfe2d('0x49')]['tag']}:undefined,'required':_0x2509f1[_0xfe2d('0x49')][_0xfe2d('0x97')]?!![]:![]}];}return db[_0xfe2d('0x8f')][_0xfe2d('0x5a')](_0x29d01d);})['then'](function(_0x47bb47){_0x2e48c6[_0xfe2d('0x5b')]=_0x47bb47;return _0x2e48c6;});}})[_0xfe2d('0x20')](respondWithFilteredResult(_0x334767,_0x29d01d))[_0xfe2d('0x64')](handleError(_0x334767,null));};exports[_0xfe2d('0x98')]=function(_0x1d06ab,_0x669116,_0x30d99f){return db[_0xfe2d('0x58')]['findOne']({'where':{'id':_0x1d06ab['params']['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x669116,null))[_0xfe2d('0x20')](function(_0xc03743){if(_0xc03743){return db[_0xfe2d('0x99')][_0xfe2d('0x9a')](function(_0xd09366){return db['MailApplication'][_0xfe2d('0x38')]({'where':{'MailAccountId':_0x1d06ab[_0xfe2d('0x5d')]['id']},'transaction':_0xd09366})[_0xfe2d('0x20')](function(_0x4cf7da){var _0x4ce0a1=_[_0xfe2d('0x45')](_0x1d06ab['body'],function(_0x49a034){_0x49a034['MailAccountId']=_0x1d06ab[_0xfe2d('0x5d')]['id'];return _0x49a034;});return db[_0xfe2d('0x9b')][_0xfe2d('0x9c')](_0x4ce0a1,{'transaction':_0xd09366});});})['then'](function(){return db[_0xfe2d('0x9b')][_0xfe2d('0x9d')]({'where':{'MailAccountId':_0x1d06ab['params']['id']},'order':_0xfe2d('0x9e')});});}})['then'](respondWithResult(_0x669116,null))[_0xfe2d('0x64')](handleError(_0x669116,null));};exports['getApplications']=function(_0x36cf05,_0x427b4f,_0x5b0437){var _0x2b5d22={};var _0x3d884f={};var _0x1f3927;var _0x49bac0;return db['MailAccount'][_0xfe2d('0x71')]({'where':{'id':_0x36cf05[_0xfe2d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x427b4f,null))['then'](function(_0x7a1b1d){if(_0x7a1b1d){_0x1f3927=_0x7a1b1d;_0x3d884f['model']=_[_0xfe2d('0x4a')](db[_0xfe2d('0x9b')][_0xfe2d('0x5f')]);_0x3d884f[_0xfe2d('0x49')]=_['keys'](_0x36cf05[_0xfe2d('0x49')]);_0x3d884f[_0xfe2d('0x4b')]=_[_0xfe2d('0x4c')](_0x3d884f[_0xfe2d('0x48')],_0x3d884f['query']);_0x2b5d22[_0xfe2d('0x4d')]=_['intersection'](_0x3d884f['model'],qs[_0xfe2d('0x4e')](_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x4e')]));_0x2b5d22[_0xfe2d('0x4d')]=_0x2b5d22[_0xfe2d('0x4d')][_0xfe2d('0x60')]?_0x2b5d22[_0xfe2d('0x4d')]:_0x3d884f[_0xfe2d('0x48')];_0x2b5d22[_0xfe2d('0x51')]=qs[_0xfe2d('0x52')](_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x52')]);_0x2b5d22[_0xfe2d('0x53')]=qs[_0xfe2d('0x4b')](_[_0xfe2d('0x6d')](_0x36cf05[_0xfe2d('0x49')],_0x3d884f[_0xfe2d('0x4b')]));if(_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x2b5d22[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x2b5d22[_0xfe2d('0x53')],{'$or':_[_0xfe2d('0x45')](_0x2b5d22[_0xfe2d('0x4d')],function(_0x56f98e){var _0x2c2417={};_0x2c2417[_0x56f98e]={'$like':'%'+_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x54')]+'%'};return _0x2c2417;})});}_0x2b5d22=_[_0xfe2d('0x55')]({},_0x2b5d22,_0x36cf05[_0xfe2d('0x62')]);return _0x1f3927[_0xfe2d('0x9f')](_0x2b5d22);}})[_0xfe2d('0x20')](function(_0x252f29){if(_0x252f29){_0x49bac0=_0x252f29[_0xfe2d('0x60')];if(!_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x4f')]('nolimit')){_0x2b5d22[_0xfe2d('0x2e')]=qs['limit'](_0x36cf05[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x2b5d22[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0x36cf05['query'][_0xfe2d('0x2d')]);}return _0x1f3927['getApplications'](_0x2b5d22);}})[_0xfe2d('0x20')](function(_0x5ec450){if(_0x5ec450){return _0x5ec450?{'count':_0x49bac0,'rows':_0x5ec450}:null;}})[_0xfe2d('0x20')](respondWithResult(_0x427b4f,null))[_0xfe2d('0x64')](handleError(_0x427b4f,null));};exports[_0xfe2d('0xa0')]=function(_0x59ef59,_0x3acb25,_0x4228b3){var _0x2ced1d={'raw':!![],'where':{}};var _0x4e3125={};var _0x47210b={'count':0x0,'rows':[]};return db['MailAccount'][_0xfe2d('0x71')]({'where':{'id':_0x59ef59[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x3acb25,null))['then'](function(_0x9dc704){if(_0x9dc704){_0x4e3125[_0xfe2d('0x48')]=_[_0xfe2d('0x4a')](db[_0xfe2d('0xa1')][_0xfe2d('0x5f')]);_0x4e3125[_0xfe2d('0x49')]=_[_0xfe2d('0x4a')](_0x59ef59[_0xfe2d('0x49')]);_0x4e3125[_0xfe2d('0x4b')]=_['intersection'](_0x4e3125[_0xfe2d('0x48')],_0x4e3125[_0xfe2d('0x49')]);_0x2ced1d[_0xfe2d('0x4d')]=_[_0xfe2d('0x4c')](_0x4e3125[_0xfe2d('0x48')],qs[_0xfe2d('0x4e')](_0x59ef59['query']['fields']));_0x2ced1d[_0xfe2d('0x4d')]=_0x2ced1d[_0xfe2d('0x4d')]['length']?_0x2ced1d['attributes']:_0x4e3125[_0xfe2d('0x48')];if(!_0x59ef59['query'][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x2ced1d[_0xfe2d('0x2e')]=qs[_0xfe2d('0x2e')](_0x59ef59[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x2ced1d[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0x59ef59[_0xfe2d('0x49')][_0xfe2d('0x2d')]);}_0x2ced1d[_0xfe2d('0x51')]=qs['sort'](_0x59ef59[_0xfe2d('0x49')]['sort']);_0x2ced1d[_0xfe2d('0x53')]=qs['filters'](_['pick'](_0x59ef59[_0xfe2d('0x49')],_0x4e3125[_0xfe2d('0x4b')]));_0x2ced1d[_0xfe2d('0x53')][_0xfe2d('0x69')]=_0x9dc704['id'];if(_0x59ef59[_0xfe2d('0x49')]['filter']){_0x2ced1d['where']=_['merge'](_0x2ced1d['where'],{'$or':_[_0xfe2d('0x45')](_0x2ced1d['attributes'],function(_0x279459){var _0x404102={};_0x404102[_0x279459]={'$like':'%'+_0x59ef59[_0xfe2d('0x49')]['filter']+'%'};return _0x404102;})});}if(_0x59ef59[_0xfe2d('0x49')][_0xfe2d('0xa2')]){var _0x178286=_0x59ef59[_0xfe2d('0x49')][_0xfe2d('0xa2')][_0xfe2d('0xa3')](',');var _0x2e01e6={};_0x2e01e6[_0x178286[0x0]]={'$gte':moment(_0x178286[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2ced1d[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x2ced1d[_0xfe2d('0x53')],_0x2e01e6);}_0x2ced1d=_[_0xfe2d('0x55')]({},_0x2ced1d,_0x59ef59[_0xfe2d('0x62')]);return db[_0xfe2d('0xa1')][_0xfe2d('0x30')]({'where':_0x2ced1d[_0xfe2d('0x53')]})['then'](function(_0x1acfe8){_0x47210b[_0xfe2d('0x30')]=_0x1acfe8;if(_0x59ef59['query'][_0xfe2d('0x59')]){_0x2ced1d[_0xfe2d('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0xfe2d('0x5a')](_0x2ced1d);})[_0xfe2d('0x20')](function(_0x33cf65){if(_0x59ef59[_0xfe2d('0x49')][_0xfe2d('0xa4')]==='true'){for(var _0x3e0682=0x0;_0x3e0682<_0x33cf65['length'];_0x3e0682++){_0x33cf65[_0x3e0682]['body']=juice(_0x33cf65[_0x3e0682][_0xfe2d('0x65')]);}}_0x47210b[_0xfe2d('0x5b')]=_0x33cf65;return _0x47210b;});}})[_0xfe2d('0x20')](respondWithFilteredResult(_0x3acb25,_0x2ced1d))[_0xfe2d('0x64')](handleError(_0x3acb25,null));};exports[_0xfe2d('0x3f')]=function(_0xf7155f,_0x1f9b68,_0x1afe1b){var _0x137dbc,_0x202dbe={},_0xf8f986;if(_0xf7155f[_0xfe2d('0x65')]['to']){_0xf8f986=_0xf7155f[_0xfe2d('0x65')]['to'][_0xfe2d('0xa3')](',')[0x0];}return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0xf7155f['params']['id']},'include':[{'model':db[_0xfe2d('0xa5')],'as':_0xfe2d('0xa6'),'include':[{'model':db[_0xfe2d('0x91')],'as':'Contacts','where':{'email':_0xf8f986},'limit':0x1,'order':[['updatedAt',_0xfe2d('0xa7')]]}]},{'model':db[_0xfe2d('0x43')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x1f9b68,null))[_0xfe2d('0x20')](function(_0x2047c6){if(_0x2047c6){_0x137dbc=_0x2047c6;if(_0x2047c6[_0xfe2d('0x44')]){if(_[_0xfe2d('0x74')](_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xa8')])){_0xf7155f['body'][_0xfe2d('0xa8')]=util[_0xfe2d('0xa9')](_0xfe2d('0xaa'),_0x2047c6[_0xfe2d('0x3e')],_0x2047c6[_0xfe2d('0x73')]||_0x2047c6[_0xfe2d('0x44')]['user']);}if(_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xab')]&&_0xf7155f['body'][_0xfe2d('0xab')]['length']){for(var _0x3481fa=0x0;_0x3481fa<_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xab')]['length'];_0x3481fa+=0x1){_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xab')][_0x3481fa]={'filename':_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xab')][_0x3481fa][_0xfe2d('0x3e')],'path':path[_0xfe2d('0xac')](config['root'],_0xfe2d('0xad'),_0xf7155f[_0xfe2d('0x65')]['attachments'][_0x3481fa][_0xfe2d('0xae')])};}}var _0x4670f4={'tls':{'rejectUnauthorized':![]}};if(_[_0xfe2d('0x74')](_0x2047c6['Smtp'][_0xfe2d('0x7f')])){if(_0x2047c6['Smtp'][_0xfe2d('0x7c')]){_0x4670f4[_0xfe2d('0xaf')]={'user':_0x2047c6['Smtp'][_0xfe2d('0x78')],'pass':_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0x81')]};}_0x4670f4[_0xfe2d('0x7d')]=_0x2047c6[_0xfe2d('0x44')]['host'];_0x4670f4['port']=_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0x7e')];_0x4670f4['secure']=_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0xb0')];}else{_0x4670f4[_0xfe2d('0x7f')]=_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0x7f')];_0x4670f4[_0xfe2d('0xaf')]={'user':_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0x78')],'pass':_0x2047c6[_0xfe2d('0x44')][_0xfe2d('0x81')]};}return respondWithRpcPromise(_0xfe2d('0xb1'),_0xfe2d('0xb2'),{'account':_0x4670f4,'message':_0xf7155f['body']});}else{throw new Error(_0xfe2d('0xb3'));}}})['then'](function(_0x1c58aa){if(_0x1c58aa){_0x202dbe=_0x1c58aa;if(_0x137dbc[_0xfe2d('0xa6')]){if(_0x137dbc[_0xfe2d('0xa6')][_0xfe2d('0xb4')][_0xfe2d('0x60')]){return _0x137dbc[_0xfe2d('0xa6')]['Contacts'][0x0];}else{return db[_0xfe2d('0x91')][_0xfe2d('0x6b')](_['defaults'](_0xf7155f['body'],{'firstName':_0xf7155f[_0xfe2d('0x65')]['to'],'email':_0xf7155f[_0xfe2d('0x65')]['to'],'phone':_0xf7155f[_0xfe2d('0x65')]['to'],'ListId':_0x137dbc[_0xfe2d('0xb5')]}));}}else{throw new Error(_0xfe2d('0xb3'));}}})[_0xfe2d('0x20')](function(_0x2d6034){if(_0x2d6034){var _0x29c3ee={'UserId':_0xf7155f[_0xfe2d('0x78')]['id'],'ContactId':_0x2d6034['id'],'MailAccountId':_0x137dbc['id'],'inReplyTo':_0x202dbe[_0xfe2d('0xb6')],'to':_0xf7155f['body'][_0xfe2d('0xa8')],'cc':_0xf7155f[_0xfe2d('0x65')]['cc'],'subject':_0xf7155f[_0xfe2d('0x65')][_0xfe2d('0xb7')],'attach':_0xf7155f['body'][_0xfe2d('0xb8')],'firstMsgDirection':_0xfe2d('0xb9'),'lastMsgAt':moment()[_0xfe2d('0xa9')](_0xfe2d('0xba')),'lastMsgDirection':_0xfe2d('0xb9'),'Messages':[_['merge'](_0xf7155f[_0xfe2d('0x65')],{'messageId':_0x202dbe[_0xfe2d('0xb6')],'sentAt':moment()[_0xfe2d('0xa9')](_0xfe2d('0xba')),'read':!![],'MailAccountId':_0x137dbc['id'],'UserId':_0xf7155f[_0xfe2d('0x78')]['id'],'ContactId':_0x2d6034['id']})]};if(_0xf7155f[_0xfe2d('0x65')]['Interaction']){_0x29c3ee=_[_0xfe2d('0x55')](_0x29c3ee,_0xf7155f[_0xfe2d('0x65')]['Interaction']);}return db[_0xfe2d('0x8f')][_0xfe2d('0x6b')](_0x29c3ee,{'include':[{'model':db[_0xfe2d('0xa1')],'as':_0xfe2d('0xbb')}]});}})[_0xfe2d('0x20')](respondWithResult(_0x1f9b68,null))[_0xfe2d('0x64')](handleError(_0x1f9b68,null));};exports[_0xfe2d('0xbc')]=function(_0x13efb5,_0x1798f5,_0x43d625){return db[_0xfe2d('0x58')]['find']({'where':{'id':_0x13efb5[_0xfe2d('0x5d')]['id']},'include':[{'model':db[_0xfe2d('0x43')],'as':'Smtp','raw':!![]}]})[_0xfe2d('0x20')](handleEntityNotFound(_0x1798f5,null))[_0xfe2d('0x20')](function(_0x23b59d){if(_0x23b59d&&_0x23b59d[_0xfe2d('0x44')]){var _0x280a7b={'id':_0x23b59d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x23b59d[_0xfe2d('0x44')][_0xfe2d('0x7f')]){_0x280a7b[_0xfe2d('0x7f')]=_0x23b59d[_0xfe2d('0x44')][_0xfe2d('0x7f')];}else{_0x280a7b[_0xfe2d('0x7d')]=_0x23b59d[_0xfe2d('0x44')][_0xfe2d('0x7d')];_0x280a7b['port']=_0x23b59d[_0xfe2d('0x44')][_0xfe2d('0x7e')];_0x280a7b[_0xfe2d('0xb0')]=_0x23b59d['Smtp'][_0xfe2d('0xb0')];}if(_0x23b59d['Smtp'][_0xfe2d('0x7c')]){_0x280a7b[_0xfe2d('0xaf')]={'user':_0x23b59d[_0xfe2d('0x44')]['user'],'pass':_0x23b59d[_0xfe2d('0x44')]['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x280a7b});}})['then'](respondWithResult(_0x1798f5,null))[_0xfe2d('0x64')](handleError(_0x1798f5,null));};exports[_0xfe2d('0x38')]=function(_0x497693,_0x26cb6b){return db['MailAccount']['find']({'where':{'id':_0x497693['params']['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x26cb6b,null))[_0xfe2d('0x20')](function(_0x5385e7){if(_0x5385e7&&_0x5385e7[_0xfe2d('0x7f')]){throw new db['Sequelize'][(_0xfe2d('0xbd'))](_0xfe2d('0xbe'));}return _0x5385e7;})[_0xfe2d('0x20')](removeEntity(_0x26cb6b,null))[_0xfe2d('0x64')](handleError(_0x26cb6b,null));};exports[_0xfe2d('0xbf')]=function(_0x441c22,_0xea8965,_0x3e2011){return db[_0xfe2d('0x58')][_0xfe2d('0x63')]({'where':{'id':_0x441c22[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0xea8965,null))['then'](function(_0x375996){if(_0x375996){return _0x375996['addAgents'](_0x441c22[_0xfe2d('0x65')][_0xfe2d('0x6f')],_[_0xfe2d('0x90')](_0x441c22[_0xfe2d('0x65')],['ids','id'])||{})[_0xfe2d('0xc0')](function(_0x384dbe){for(var _0x51e61d=0x0;_0x51e61d<_0x441c22[_0xfe2d('0x65')][_0xfe2d('0x6f')][_0xfe2d('0x60')];_0x51e61d+=0x1){socket[_0xfe2d('0xc1')]('userMailAccount:save',{'UserId':Number(_0x441c22[_0xfe2d('0x65')]['ids'][_0x51e61d]),'MailAccountId':Number(_0x441c22[_0xfe2d('0x5d')]['id'])});}return _0x384dbe;});}})['then'](respondWithResult(_0xea8965,null))['catch'](handleError(_0xea8965,null));};exports[_0xfe2d('0xc2')]=function(_0x25f33a,_0x367c80,_0x394503){return db[_0xfe2d('0x58')]['find']({'where':{'id':_0x25f33a[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x367c80,null))[_0xfe2d('0x20')](function(_0x2183e5){if(_0x2183e5){return _0x2183e5[_0xfe2d('0xc2')](_0x25f33a['query'][_0xfe2d('0x6f')])[_0xfe2d('0x20')](function(){if(_['isArray'](_0x25f33a[_0xfe2d('0x49')]['ids'])){for(var _0x548941=0x0;_0x548941<_0x25f33a[_0xfe2d('0x49')]['ids'][_0xfe2d('0x60')];_0x548941+=0x1){socket[_0xfe2d('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x25f33a['query'][_0xfe2d('0x6f')][_0x548941]),'MailAccountId':Number(_0x25f33a[_0xfe2d('0x5d')]['id'])});}}else{socket[_0xfe2d('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x25f33a['query']['ids']),'MailAccountId':Number(_0x25f33a['params']['id'])});}});}})[_0xfe2d('0x20')](respondWithStatusCode(_0x367c80,null))[_0xfe2d('0x64')](handleError(_0x367c80,null));};exports[_0xfe2d('0xc3')]=function(_0x410a31,_0x5a1321,_0xae69b6){var _0x26a5cb={};var _0x27713d={};var _0xa3be31;var _0x1db477;return db[_0xfe2d('0x58')][_0xfe2d('0x71')]({'where':{'id':_0x410a31[_0xfe2d('0x5d')]['id']}})[_0xfe2d('0x20')](handleEntityNotFound(_0x5a1321,null))[_0xfe2d('0x20')](function(_0x43204f){if(_0x43204f){_0xa3be31=_0x43204f;_0x27713d[_0xfe2d('0x48')]=_['keys'](db['User'][_0xfe2d('0x5f')]);_0x27713d[_0xfe2d('0x49')]=_[_0xfe2d('0x4a')](_0x410a31[_0xfe2d('0x49')]);_0x27713d[_0xfe2d('0x4b')]=_[_0xfe2d('0x4c')](_0x27713d[_0xfe2d('0x48')],_0x27713d[_0xfe2d('0x49')]);_0x26a5cb['attributes']=_[_0xfe2d('0x4c')](_0x27713d[_0xfe2d('0x48')],qs[_0xfe2d('0x4e')](_0x410a31['query']['fields']));_0x26a5cb['attributes']=_0x26a5cb[_0xfe2d('0x4d')][_0xfe2d('0x60')]?_0x26a5cb['attributes']:_0x27713d[_0xfe2d('0x48')];_0x26a5cb['order']=qs[_0xfe2d('0x52')](_0x410a31[_0xfe2d('0x49')][_0xfe2d('0x52')]);_0x26a5cb['where']=qs[_0xfe2d('0x4b')](_['pick'](_0x410a31[_0xfe2d('0x49')],_0x27713d[_0xfe2d('0x4b')]));if(_0x410a31[_0xfe2d('0x49')][_0xfe2d('0x54')]){_0x26a5cb[_0xfe2d('0x53')]=_[_0xfe2d('0x55')](_0x26a5cb[_0xfe2d('0x53')],{'$or':_[_0xfe2d('0x45')](_0x26a5cb[_0xfe2d('0x4d')],function(_0x100762){var _0x4152cb={};_0x4152cb[_0x100762]={'$like':'%'+_0x410a31[_0xfe2d('0x49')][_0xfe2d('0x54')]+'%'};return _0x4152cb;})});}_0x26a5cb=_[_0xfe2d('0x55')]({},_0x26a5cb,_0x410a31[_0xfe2d('0x62')]);return _0xa3be31[_0xfe2d('0xc3')](_0x26a5cb);}})[_0xfe2d('0x20')](function(_0x2bc4b5){if(_0x2bc4b5){_0x1db477=_0x2bc4b5[_0xfe2d('0x60')];if(!_0x410a31[_0xfe2d('0x49')][_0xfe2d('0x4f')](_0xfe2d('0x50'))){_0x26a5cb['limit']=qs[_0xfe2d('0x2e')](_0x410a31[_0xfe2d('0x49')][_0xfe2d('0x2e')]);_0x26a5cb[_0xfe2d('0x2d')]=qs[_0xfe2d('0x2d')](_0x410a31[_0xfe2d('0x49')]['offset']);}return _0xa3be31[_0xfe2d('0xc3')](_0x26a5cb);}})['then'](function(_0x5489d0){if(_0x5489d0){return _0x5489d0?{'count':_0x1db477,'rows':_0x5489d0}:null;}})['then'](respondWithResult(_0x5a1321,null))[_0xfe2d('0x64')](handleError(_0x5a1321,null));}; \ No newline at end of file +var _0x0d86=['removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','color','tag','MailInteraction','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','order','getApplications','getMessages','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','basename','auth','secure','sendMail','List\x20not\x20found','Contacts','ListId','out','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','nolimit','sort','pick','filters','filter','merge','options','where','includeAll','rows','show','params','MailServerIn','fields','length','include','find','body','describe','MailAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findAll','email','isNil','active','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','cservice','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap'];(function(_0x2cdd4d,_0x394c2f){var _0x55cbc8=function(_0x3b92cb){while(--_0x3b92cb){_0x2cdd4d['push'](_0x2cdd4d['shift']());}};_0x55cbc8(++_0x394c2f);}(_0x0d86,0xfc));var _0x60d8=function(_0x259e05,_0x27fcb2){_0x259e05=_0x259e05-0x0;var _0x45fedc=_0x0d86[_0x259e05];return _0x45fedc;};'use strict';var emlformat=require(_0x60d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60d8('0x1'));var jsonpatch=require(_0x60d8('0x2'));var rp=require(_0x60d8('0x3'));var moment=require(_0x60d8('0x4'));var BPromise=require(_0x60d8('0x5'));var Mustache=require(_0x60d8('0x6'));var util=require(_0x60d8('0x7'));var path=require(_0x60d8('0x8'));var sox=require(_0x60d8('0x9'));var csv=require(_0x60d8('0xa'));var ejs=require(_0x60d8('0xb'));var fs=require('fs');var fs_extra=require(_0x60d8('0xc'));var _=require(_0x60d8('0xd'));var squel=require(_0x60d8('0xe'));var crypto=require(_0x60d8('0xf'));var jsforce=require(_0x60d8('0x10'));var deskjs=require(_0x60d8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x60d8('0x12'));var Papa=require(_0x60d8('0x13'));var htmlToText=require(_0x60d8('0x14'));var juice=require('juice');var Redis=require(_0x60d8('0x15'));var authService=require(_0x60d8('0x16'));var qs=require(_0x60d8('0x17'));var as=require(_0x60d8('0x18'));var hardwareService=require(_0x60d8('0x19'));var logger=require('../../config/logger')(_0x60d8('0x1a'));var utils=require(_0x60d8('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x60d8('0x1c'));var db=require(_0x60d8('0x1d'))['db'];config[_0x60d8('0x1e')]=_[_0x60d8('0x1f')](config[_0x60d8('0x1e')],{'host':_0x60d8('0x20'),'port':0x18eb});var socket=require(_0x60d8('0x21'))(new Redis(config[_0x60d8('0x1e')]));require('./mailAccount.socket')[_0x60d8('0x22')](socket);var jayson=require('jayson/promise');var client=jayson[_0x60d8('0x23')][_0x60d8('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x4c4689,_0x4f9997,_0x199d02,_0x4c6bc1){return new BPromise(function(_0x36ce3a,_0x49b40e){var _0x137355=_0x4c6bc1||client;return _0x137355[_0x60d8('0x25')](_0x4c4689,_0x199d02)[_0x60d8('0x26')](function(_0xfe5f51){logger[_0x60d8('0x27')](_0x60d8('0x28'),_0x4f9997,'request\x20sent');logger[_0x60d8('0x29')](_0x60d8('0x2a'),_0x4f9997,'request\x20sent',JSON['stringify'](_0xfe5f51));if(_0xfe5f51['error']){if(_0xfe5f51[_0x60d8('0x2b')][_0x60d8('0x2c')]===0x1f4){logger[_0x60d8('0x2b')](_0x60d8('0x28'),_0x4f9997,_0xfe5f51[_0x60d8('0x2b')][_0x60d8('0x2d')]);return _0x49b40e(_0xfe5f51[_0x60d8('0x2b')][_0x60d8('0x2d')]);}logger[_0x60d8('0x2b')](_0x60d8('0x28'),_0x4f9997,_0xfe5f51[_0x60d8('0x2b')][_0x60d8('0x2d')]);return _0x36ce3a(_0xfe5f51['error'][_0x60d8('0x2d')]);}else{logger[_0x60d8('0x27')](_0x60d8('0x28'),_0x4f9997,_0x60d8('0x2e'));_0x36ce3a(_0xfe5f51[_0x60d8('0x2f')][_0x60d8('0x2d')]);}})[_0x60d8('0x30')](function(_0xe7dd25){logger['error'](_0x60d8('0x28'),_0x4f9997,_0xe7dd25);_0x49b40e(_0xe7dd25);});});}function respondWithStatusCode(_0xb424da,_0xe780de){_0xe780de=_0xe780de||0xcc;return function(_0x28eec3){if(_0x28eec3){return _0xb424da[_0x60d8('0x31')](_0xe780de);}return _0xb424da[_0x60d8('0x32')](_0xe780de)[_0x60d8('0x33')]();};}function respondWithResult(_0x1e7731,_0x426f4a){_0x426f4a=_0x426f4a||0xc8;return function(_0x1ba945){if(_0x1ba945){return _0x1e7731[_0x60d8('0x32')](_0x426f4a)['json'](_0x1ba945);}};}function respondWithFilteredResult(_0x2090eb,_0x655302){return function(_0xaa066f){if(_0xaa066f){var _0x4877d1=typeof _0x655302[_0x60d8('0x34')]===_0x60d8('0x35')&&typeof _0x655302[_0x60d8('0x36')]===_0x60d8('0x35');var _0xeeaeae=_0xaa066f[_0x60d8('0x37')];var _0x242f69=_0x4877d1?0x0:_0x655302[_0x60d8('0x34')];var _0x363628=_0x4877d1?_0xaa066f['count']:_0x655302[_0x60d8('0x34')]+_0x655302['limit'];var _0x2990d8;if(_0x363628>=_0xeeaeae){_0x363628=_0xeeaeae;_0x2990d8=0xc8;}else{_0x2990d8=0xce;}_0x2090eb[_0x60d8('0x32')](_0x2990d8);return _0x2090eb['set'](_0x60d8('0x38'),_0x242f69+'-'+_0x363628+'/'+_0xeeaeae)['json'](_0xaa066f);}return null;};}function patchUpdates(_0x526428){return function(_0x92c571){try{jsonpatch[_0x60d8('0x39')](_0x92c571,_0x526428,!![]);}catch(_0x594c11){return BPromise[_0x60d8('0x3a')](_0x594c11);}return _0x92c571[_0x60d8('0x3b')]();};}function saveUpdates(_0x48a467,_0x2ed241){return function(_0x3af4de){if(_0x3af4de){return _0x3af4de[_0x60d8('0x3c')](_0x48a467)[_0x60d8('0x26')](function(_0x3fe245){return _0x3fe245;});}return null;};}function removeEntity(_0xc88828,_0x13d38e){return function(_0x15e671){if(_0x15e671){return _0x15e671[_0x60d8('0x3d')]()['then'](function(){var _0x3e7b13=_0x15e671[_0x60d8('0x3e')]({'plain':!![]});var _0x3a336a=_0x60d8('0x3f');return db[_0x60d8('0x40')]['destroy']({'where':{'type':_0x3a336a,'resourceId':_0x3e7b13['id']}})[_0x60d8('0x26')](function(){return _0x15e671;});})[_0x60d8('0x26')](function(){_0xc88828[_0x60d8('0x32')](0xcc)[_0x60d8('0x33')]();});}};}function handleEntityNotFound(_0x38a746,_0x232c7d){return function(_0x244020){if(!_0x244020){_0x38a746[_0x60d8('0x31')](0x194);}return _0x244020;};}function handleError(_0x2f64d2,_0x334875){_0x334875=_0x334875||0x1f4;return function(_0x74b3f9){logger['error'](_0x74b3f9[_0x60d8('0x41')]);if(_0x74b3f9[_0x60d8('0x42')]){delete _0x74b3f9[_0x60d8('0x42')];}_0x2f64d2[_0x60d8('0x32')](_0x334875)[_0x60d8('0x43')](_0x74b3f9);};}exports[_0x60d8('0x44')]=function(_0x2fd2f9,_0x2299a7){var _0x4ab3dd={'include':[{'model':db['MailServerIn'],'as':_0x60d8('0x45')},{'model':db[_0x60d8('0x46')],'as':_0x60d8('0x47')},{'model':db['Pause'],'as':_0x60d8('0x48')}]},_0x402b8e={},_0x7f514d={'count':0x0,'rows':[]};var _0xa0f7f2=_['map'](db[_0x60d8('0x49')][_0x60d8('0x4a')],function(_0xddd7d3){return{'name':_0xddd7d3[_0x60d8('0x4b')],'type':_0xddd7d3[_0x60d8('0x4c')][_0x60d8('0x4d')]};});_0x402b8e[_0x60d8('0x4e')]=_[_0x60d8('0x4f')](_0xa0f7f2,_0x60d8('0x42'));_0x402b8e[_0x60d8('0x50')]=_[_0x60d8('0x51')](_0x2fd2f9['query']);_0x402b8e['filters']=_[_0x60d8('0x52')](_0x402b8e[_0x60d8('0x4e')],_0x402b8e['query']);_0x4ab3dd[_0x60d8('0x53')]=_[_0x60d8('0x52')](_0x402b8e[_0x60d8('0x4e')],qs['fields'](_0x2fd2f9[_0x60d8('0x50')]['fields']));_0x4ab3dd[_0x60d8('0x53')]=_0x4ab3dd[_0x60d8('0x53')]['length']?_0x4ab3dd[_0x60d8('0x53')]:_0x402b8e[_0x60d8('0x4e')];if(!_0x2fd2f9[_0x60d8('0x50')]['hasOwnProperty'](_0x60d8('0x54'))){_0x4ab3dd['limit']=qs['limit'](_0x2fd2f9['query'][_0x60d8('0x36')]);_0x4ab3dd[_0x60d8('0x34')]=qs[_0x60d8('0x34')](_0x2fd2f9[_0x60d8('0x50')][_0x60d8('0x34')]);}_0x4ab3dd['order']=qs[_0x60d8('0x55')](_0x2fd2f9[_0x60d8('0x50')]['sort']);_0x4ab3dd['where']=qs['filters'](_[_0x60d8('0x56')](_0x2fd2f9[_0x60d8('0x50')],_0x402b8e[_0x60d8('0x57')]),_0xa0f7f2);if(_0x2fd2f9[_0x60d8('0x50')][_0x60d8('0x58')]){_0x4ab3dd['where']=_[_0x60d8('0x59')](_0x4ab3dd['where'],{'$or':_[_0x60d8('0x4f')](_0xa0f7f2,function(_0x4c5bd3){if(_0x4c5bd3[_0x60d8('0x4c')]!=='VIRTUAL'){var _0x2b2529={};_0x2b2529[_0x4c5bd3['name']]={'$like':'%'+_0x2fd2f9[_0x60d8('0x50')][_0x60d8('0x58')]+'%'};return _0x2b2529;}})});}_0x4ab3dd=_[_0x60d8('0x59')]({},_0x4ab3dd,_0x2fd2f9[_0x60d8('0x5a')]);var _0x47850b={'where':_0x4ab3dd[_0x60d8('0x5b')]};return db['MailAccount'][_0x60d8('0x37')](_0x47850b)[_0x60d8('0x26')](function(_0x3581a0){_0x7f514d['count']=_0x3581a0;if(_0x2fd2f9[_0x60d8('0x50')][_0x60d8('0x5c')]){_0x4ab3dd['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x4ab3dd);})['then'](function(_0x32356b){_0x7f514d[_0x60d8('0x5d')]=_0x32356b;return _0x7f514d;})[_0x60d8('0x26')](respondWithFilteredResult(_0x2299a7,_0x4ab3dd))[_0x60d8('0x30')](handleError(_0x2299a7,null));};exports[_0x60d8('0x5e')]=function(_0x1e8e19,_0x53b70c){var _0x3752ca={'raw':![],'where':{'id':_0x1e8e19[_0x60d8('0x5f')]['id']},'include':[{'model':db[_0x60d8('0x60')],'as':_0x60d8('0x45')},{'model':db['MailServerOut'],'as':_0x60d8('0x47')},{'model':db['Pause'],'as':_0x60d8('0x48')}]},_0x3a57d9={};_0x3a57d9['model']=_['keys'](db[_0x60d8('0x49')]['rawAttributes']);_0x3a57d9[_0x60d8('0x50')]=_[_0x60d8('0x51')](_0x1e8e19[_0x60d8('0x50')]);_0x3a57d9[_0x60d8('0x57')]=_[_0x60d8('0x52')](_0x3a57d9[_0x60d8('0x4e')],_0x3a57d9[_0x60d8('0x50')]);_0x3752ca['attributes']=_[_0x60d8('0x52')](_0x3a57d9[_0x60d8('0x4e')],qs[_0x60d8('0x61')](_0x1e8e19['query'][_0x60d8('0x61')]));_0x3752ca['attributes']=_0x3752ca['attributes'][_0x60d8('0x62')]?_0x3752ca[_0x60d8('0x53')]:_0x3a57d9[_0x60d8('0x4e')];if(_0x1e8e19[_0x60d8('0x50')][_0x60d8('0x5c')]){_0x3752ca[_0x60d8('0x63')]=[{'all':!![]}];}_0x3752ca=_[_0x60d8('0x59')]({},_0x3752ca,_0x1e8e19[_0x60d8('0x5a')]);return db['MailAccount'][_0x60d8('0x64')](_0x3752ca)[_0x60d8('0x26')](handleEntityNotFound(_0x53b70c,null))['then'](respondWithResult(_0x53b70c,null))[_0x60d8('0x30')](handleError(_0x53b70c,null));};exports['update']=function(_0x49f9e8,_0x317896){if(_0x49f9e8[_0x60d8('0x65')]['id']){delete _0x49f9e8[_0x60d8('0x65')]['id'];}return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x49f9e8[_0x60d8('0x5f')]['id']},'include':[{'model':db[_0x60d8('0x60')],'as':_0x60d8('0x45')},{'model':db[_0x60d8('0x46')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x60d8('0x26')](handleEntityNotFound(_0x317896,null))['then'](saveUpdates(_0x49f9e8[_0x60d8('0x65')],null))[_0x60d8('0x26')](function(_0x6b0e49){if(_0x6b0e49&&_0x49f9e8[_0x60d8('0x65')][_0x60d8('0x45')]){return db[_0x60d8('0x60')][_0x60d8('0x3c')](_0x49f9e8[_0x60d8('0x65')]['Imap'],{'where':{'MailAccountId':_0x6b0e49['id']}})['then'](function(){return _0x6b0e49;});}return _0x6b0e49;})[_0x60d8('0x26')](function(_0x2f5415){if(_0x2f5415&&_0x49f9e8[_0x60d8('0x65')][_0x60d8('0x47')]){return db[_0x60d8('0x46')][_0x60d8('0x3c')](_0x49f9e8[_0x60d8('0x65')]['Smtp'],{'where':{'MailAccountId':_0x2f5415['id']}})['then'](function(){return _0x2f5415;});}return _0x2f5415;})['then'](respondWithResult(_0x317896,null))[_0x60d8('0x30')](handleError(_0x317896,null));};exports[_0x60d8('0x66')]=function(_0x4c704b,_0xa68eac){return db[_0x60d8('0x49')][_0x60d8('0x66')]()[_0x60d8('0x26')](respondWithResult(_0xa68eac,null))[_0x60d8('0x30')](handleError(_0xa68eac,null));};exports['addDisposition']=function(_0x5db893,_0x3cb9ee,_0x33b813){if(_0x5db893['body']['id']){delete _0x5db893[_0x60d8('0x65')]['id'];}return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x5db893[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x3cb9ee,null))[_0x60d8('0x26')](function(_0x59418e){if(_0x59418e){_0x5db893['body'][_0x60d8('0x67')]=_0x59418e['id'];return db[_0x60d8('0x68')]['create'](_0x5db893['body']);}})[_0x60d8('0x26')](respondWithResult(_0x3cb9ee,null))['catch'](handleError(_0x3cb9ee,null));};exports[_0x60d8('0x69')]=function(_0x5182f5,_0x1a4dc2,_0x191274){var _0x72efe0={'raw':![],'where':{}};var _0x65bbf9={};var _0x5a7920={'count':0x0,'rows':[]};return db[_0x60d8('0x49')][_0x60d8('0x6a')]({'where':{'id':_0x5182f5[_0x60d8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1a4dc2,null))[_0x60d8('0x26')](function(_0x447a3a){if(_0x447a3a){_0x65bbf9[_0x60d8('0x4e')]=_[_0x60d8('0x51')](db[_0x60d8('0x68')][_0x60d8('0x4a')]);_0x65bbf9[_0x60d8('0x50')]=_[_0x60d8('0x51')](_0x5182f5[_0x60d8('0x50')]);_0x65bbf9[_0x60d8('0x57')]=_['intersection'](_0x65bbf9['model'],_0x65bbf9[_0x60d8('0x50')]);_0x72efe0[_0x60d8('0x53')]=_[_0x60d8('0x52')](_0x65bbf9['model'],qs[_0x60d8('0x61')](_0x5182f5['query'][_0x60d8('0x61')]));_0x72efe0[_0x60d8('0x53')]=_0x72efe0[_0x60d8('0x53')][_0x60d8('0x62')]?_0x72efe0[_0x60d8('0x53')]:_0x65bbf9[_0x60d8('0x4e')];if(!_0x5182f5[_0x60d8('0x50')][_0x60d8('0x6b')](_0x60d8('0x54'))){_0x72efe0[_0x60d8('0x36')]=qs[_0x60d8('0x36')](_0x5182f5[_0x60d8('0x50')][_0x60d8('0x36')]);_0x72efe0[_0x60d8('0x34')]=qs[_0x60d8('0x34')](_0x5182f5[_0x60d8('0x50')][_0x60d8('0x34')]);}_0x72efe0['order']=qs[_0x60d8('0x55')](_0x5182f5[_0x60d8('0x50')][_0x60d8('0x55')]);_0x72efe0['where']=qs[_0x60d8('0x57')](_[_0x60d8('0x56')](_0x5182f5[_0x60d8('0x50')],_0x65bbf9[_0x60d8('0x57')]));_0x72efe0['where'][_0x60d8('0x67')]=_0x447a3a['id'];if(_0x5182f5['query']['filter']){_0x72efe0[_0x60d8('0x5b')]=_[_0x60d8('0x59')](_0x72efe0['where'],{'$or':_[_0x60d8('0x4f')](_0x72efe0[_0x60d8('0x53')],function(_0x280cb5){var _0x20556e={};_0x20556e[_0x280cb5]={'$like':'%'+_0x5182f5[_0x60d8('0x50')][_0x60d8('0x58')]+'%'};return _0x20556e;})});}_0x72efe0=_['merge']({},_0x72efe0,_0x5182f5[_0x60d8('0x5a')]);return db[_0x60d8('0x68')][_0x60d8('0x37')]({'where':_0x72efe0[_0x60d8('0x5b')]})[_0x60d8('0x26')](function(_0x4e6781){_0x5a7920[_0x60d8('0x37')]=_0x4e6781;if(_0x5182f5[_0x60d8('0x50')][_0x60d8('0x5c')]){_0x72efe0[_0x60d8('0x63')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x72efe0);})['then'](function(_0x635688){_0x5a7920['rows']=_0x635688;return _0x5a7920;});}})[_0x60d8('0x26')](respondWithFilteredResult(_0x1a4dc2,_0x72efe0))[_0x60d8('0x30')](handleError(_0x1a4dc2,null));};exports['removeDispositions']=function(_0x20f0f6,_0x523dc7,_0x55c5a6){return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x20f0f6[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x523dc7,null))['then'](function(_0x2a719e){if(_0x2a719e){return _0x2a719e[_0x60d8('0x6c')](_0x20f0f6[_0x60d8('0x50')][_0x60d8('0x6d')]);}})['then'](respondWithStatusCode(_0x523dc7,null))[_0x60d8('0x30')](handleError(_0x523dc7,null));};exports[_0x60d8('0x6e')]=function(_0x3d36ac,_0x27cf4b,_0x48bdae){if(_0x3d36ac[_0x60d8('0x65')]['id']){delete _0x3d36ac[_0x60d8('0x65')]['id'];}return db[_0x60d8('0x49')]['find']({'where':{'id':_0x3d36ac[_0x60d8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x27cf4b,null))[_0x60d8('0x26')](function(_0x50e3a6){if(_0x50e3a6){_0x3d36ac[_0x60d8('0x65')][_0x60d8('0x67')]=_0x50e3a6['id'];return db[_0x60d8('0x6f')][_0x60d8('0x70')](_0x3d36ac[_0x60d8('0x65')]);}})[_0x60d8('0x26')](respondWithResult(_0x27cf4b,null))['catch'](handleError(_0x27cf4b,null));};exports[_0x60d8('0x71')]=function(_0xd95152,_0x3b83d6,_0x1ac5de){var _0x1d9ab0={'raw':![],'where':{}};var _0x5444c0={};var _0x277e29={'count':0x0,'rows':[]};return db['MailAccount'][_0x60d8('0x6a')]({'where':{'id':_0xd95152[_0x60d8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3b83d6,null))['then'](function(_0x3e764c){if(_0x3e764c){_0x5444c0[_0x60d8('0x4e')]=_[_0x60d8('0x51')](db[_0x60d8('0x6f')][_0x60d8('0x4a')]);_0x5444c0[_0x60d8('0x50')]=_['keys'](_0xd95152[_0x60d8('0x50')]);_0x5444c0[_0x60d8('0x57')]=_[_0x60d8('0x52')](_0x5444c0[_0x60d8('0x4e')],_0x5444c0['query']);_0x1d9ab0['attributes']=_[_0x60d8('0x52')](_0x5444c0[_0x60d8('0x4e')],qs[_0x60d8('0x61')](_0xd95152[_0x60d8('0x50')][_0x60d8('0x61')]));_0x1d9ab0[_0x60d8('0x53')]=_0x1d9ab0['attributes'][_0x60d8('0x62')]?_0x1d9ab0[_0x60d8('0x53')]:_0x5444c0[_0x60d8('0x4e')];if(!_0xd95152['query'][_0x60d8('0x6b')](_0x60d8('0x54'))){_0x1d9ab0[_0x60d8('0x36')]=qs[_0x60d8('0x36')](_0xd95152[_0x60d8('0x50')]['limit']);_0x1d9ab0[_0x60d8('0x34')]=qs[_0x60d8('0x34')](_0xd95152[_0x60d8('0x50')][_0x60d8('0x34')]);}_0x1d9ab0['order']=qs[_0x60d8('0x55')](_0xd95152[_0x60d8('0x50')][_0x60d8('0x55')]);_0x1d9ab0[_0x60d8('0x5b')]=qs[_0x60d8('0x57')](_['pick'](_0xd95152['query'],_0x5444c0[_0x60d8('0x57')]));_0x1d9ab0[_0x60d8('0x5b')][_0x60d8('0x67')]=_0x3e764c['id'];if(_0xd95152[_0x60d8('0x50')][_0x60d8('0x58')]){_0x1d9ab0['where']=_[_0x60d8('0x59')](_0x1d9ab0['where'],{'$or':_[_0x60d8('0x4f')](_0x1d9ab0[_0x60d8('0x53')],function(_0x3fcd43){var _0xbc92c6={};_0xbc92c6[_0x3fcd43]={'$like':'%'+_0xd95152[_0x60d8('0x50')][_0x60d8('0x58')]+'%'};return _0xbc92c6;})});}_0x1d9ab0=_['merge']({},_0x1d9ab0,_0xd95152['options']);return db[_0x60d8('0x6f')][_0x60d8('0x37')]({'where':_0x1d9ab0['where']})[_0x60d8('0x26')](function(_0x41d30c){_0x277e29[_0x60d8('0x37')]=_0x41d30c;if(_0xd95152[_0x60d8('0x50')]['includeAll']){_0x1d9ab0['include']=[{'all':!![]}];}return db[_0x60d8('0x6f')][_0x60d8('0x72')](_0x1d9ab0);})[_0x60d8('0x26')](function(_0x52b730){_0x277e29['rows']=_0x52b730;return _0x277e29;});}})[_0x60d8('0x26')](respondWithFilteredResult(_0x3b83d6,_0x1d9ab0))['catch'](handleError(_0x3b83d6,null));};exports['removeAnswers']=function(_0x592b8b,_0x368aef,_0x4afc28){return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x592b8b[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x368aef,null))['then'](function(_0x463aa0){if(_0x463aa0){return _0x463aa0['removeAnswers'](_0x592b8b['query'][_0x60d8('0x6d')]);}})[_0x60d8('0x26')](respondWithStatusCode(_0x368aef,null))['catch'](handleError(_0x368aef,null));};exports[_0x60d8('0x70')]=function(_0x46a565,_0x3e53c9){var _0x55617d={'name':_0x46a565[_0x60d8('0x65')][_0x60d8('0x42')],'key':_0x46a565['body']['key'],'email':_0x46a565[_0x60d8('0x65')][_0x60d8('0x73')],'ListId':_0x46a565[_0x60d8('0x65')]['ListId'],'active':!_[_0x60d8('0x74')](_0x46a565[_0x60d8('0x65')][_0x60d8('0x75')])?_0x46a565[_0x60d8('0x65')][_0x60d8('0x75')]:!![],'description':_0x46a565[_0x60d8('0x65')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x46a565[_0x60d8('0x65')]['cservice'])){if(_0x46a565[_0x60d8('0x65')][_0x60d8('0x76')]){_0x55617d[_0x60d8('0x45')][_0x60d8('0x77')]=_0x55617d[_0x60d8('0x47')]['user']=_0x46a565[_0x60d8('0x65')][_0x60d8('0x78')];_0x55617d[_0x60d8('0x45')][_0x60d8('0x79')]=_0x55617d[_0x60d8('0x47')]['pass']=_0x46a565[_0x60d8('0x65')][_0x60d8('0x7a')];}else{_0x55617d[_0x60d8('0x45')][_0x60d8('0x7b')]=_0x55617d[_0x60d8('0x47')][_0x60d8('0x7b')]=![];}_0x55617d[_0x60d8('0x45')][_0x60d8('0x7c')]=_0x46a565['body'][_0x60d8('0x45')][_0x60d8('0x7c')];_0x55617d[_0x60d8('0x45')][_0x60d8('0x7d')]=_0x46a565[_0x60d8('0x65')][_0x60d8('0x45')][_0x60d8('0x7d')];_0x55617d[_0x60d8('0x47')][_0x60d8('0x7c')]=_0x46a565[_0x60d8('0x65')]['Smtp'][_0x60d8('0x7c')];_0x55617d[_0x60d8('0x47')]['port']=_0x46a565[_0x60d8('0x65')][_0x60d8('0x47')][_0x60d8('0x7d')];}else{_0x55617d[_0x60d8('0x45')][_0x60d8('0x7e')]=_0x55617d[_0x60d8('0x47')][_0x60d8('0x7e')]=_0x46a565[_0x60d8('0x65')][_0x60d8('0x7f')];_0x55617d[_0x60d8('0x45')][_0x60d8('0x77')]=_0x55617d['Smtp'][_0x60d8('0x77')]=_0x46a565[_0x60d8('0x65')][_0x60d8('0x78')];_0x55617d[_0x60d8('0x45')][_0x60d8('0x79')]=_0x55617d[_0x60d8('0x47')][_0x60d8('0x80')]=_0x46a565[_0x60d8('0x65')][_0x60d8('0x7a')];}return db['MailAccount']['create'](_0x55617d,{'include':[{'model':db[_0x60d8('0x46')],'as':_0x60d8('0x47')},{'model':db[_0x60d8('0x60')],'as':'Imap'}]})[_0x60d8('0x26')](function(_0x2f11c9){var _0x42fc5d=_0x46a565[_0x60d8('0x77')][_0x60d8('0x3e')]({'plain':!![]});if(!_0x42fc5d)throw new Error(_0x60d8('0x81'));if(_0x42fc5d[_0x60d8('0x82')]===_0x60d8('0x77')){var _0x139da1=_0x2f11c9['get']({'plain':!![]});return db['UserProfileSection'][_0x60d8('0x64')]({'where':{'name':_0x60d8('0x3f'),'userProfileId':_0x42fc5d[_0x60d8('0x83')]},'raw':!![]})[_0x60d8('0x26')](function(_0x2c7274){if(_0x2c7274&&_0x2c7274[_0x60d8('0x84')]===0x0){return db[_0x60d8('0x40')][_0x60d8('0x70')]({'name':_0x139da1[_0x60d8('0x42')],'resourceId':_0x139da1['id'],'type':_0x2c7274[_0x60d8('0x42')],'sectionId':_0x2c7274['id']},{})[_0x60d8('0x26')](function(){return _0x2f11c9;});}else{return _0x2f11c9;}})[_0x60d8('0x30')](function(_0x342729){logger['error'](_0x60d8('0x85'),_0x342729);throw _0x342729;});}return _0x2f11c9;})[_0x60d8('0x26')](respondWithResult(_0x3e53c9,0xc9))[_0x60d8('0x30')](handleError(_0x3e53c9,null));};exports[_0x60d8('0x86')]=function(_0x2a1df7,_0x3a4523,_0x1af03c){return db[_0x60d8('0x49')]['findOne']({'where':{'id':_0x2a1df7[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x3a4523,null))['then'](function(_0x2e084f){if(_0x2e084f){return _0x2e084f[_0x60d8('0x86')]();}return null;})[_0x60d8('0x26')](respondWithResult(_0x3a4523,null))[_0x60d8('0x30')](handleError(_0x3a4523,null));};exports[_0x60d8('0x87')]=function(_0x111dee,_0x10e257,_0xeb7d42){if(_0x111dee[_0x60d8('0x65')]['id']){delete _0x111dee[_0x60d8('0x65')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x111dee[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x10e257,null))['then'](function(_0x84517c){if(_0x84517c){_0x111dee[_0x60d8('0x65')]['MailAccountId']=_0x84517c['id'];return db[_0x60d8('0x60')][_0x60d8('0x70')](_0x111dee[_0x60d8('0x65')]);}})[_0x60d8('0x26')](respondWithResult(_0x10e257,null))['catch'](handleError(_0x10e257,null));};exports[_0x60d8('0x88')]=function(_0x5cf9f8,_0x59cb14,_0x5d5c91){return db[_0x60d8('0x49')][_0x60d8('0x6a')]({'where':{'id':_0x5cf9f8[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x59cb14,null))[_0x60d8('0x26')](function(_0x5bd96e){if(_0x5bd96e){return _0x5bd96e['setImap'](null);}return null;})[_0x60d8('0x26')](respondWithStatusCode(_0x59cb14,null))['catch'](handleError(_0x59cb14,null));};exports[_0x60d8('0x89')]=function(_0x507f47,_0x335b82,_0x332357){return db[_0x60d8('0x49')]['findOne']({'where':{'id':_0x507f47[_0x60d8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x335b82,null))['then'](function(_0x44ff3f){if(_0x44ff3f){return _0x44ff3f[_0x60d8('0x89')]();}return null;})['then'](respondWithResult(_0x335b82,null))[_0x60d8('0x30')](handleError(_0x335b82,null));};exports[_0x60d8('0x8a')]=function(_0x38de45,_0x22708f,_0x4de4b8){if(_0x38de45[_0x60d8('0x65')]['id']){delete _0x38de45[_0x60d8('0x65')]['id'];}return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x38de45[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x22708f,null))['then'](function(_0x10102f){if(_0x10102f){_0x38de45[_0x60d8('0x65')][_0x60d8('0x67')]=_0x10102f['id'];return db[_0x60d8('0x46')][_0x60d8('0x70')](_0x38de45['body']);}})[_0x60d8('0x26')](respondWithResult(_0x22708f,null))[_0x60d8('0x30')](handleError(_0x22708f,null));};exports[_0x60d8('0x8b')]=function(_0x3a8585,_0x525165,_0x56b53e){return db['MailAccount'][_0x60d8('0x6a')]({'where':{'id':_0x3a8585[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x525165,null))[_0x60d8('0x26')](function(_0x28eb2f){if(_0x28eb2f){return _0x28eb2f[_0x60d8('0x8c')](null);}return null;})[_0x60d8('0x26')](respondWithStatusCode(_0x525165,null))[_0x60d8('0x30')](handleError(_0x525165,null));};exports[_0x60d8('0x8d')]=function(_0x21793c,_0x55952c,_0x5a621b){return db['MailInteraction']['find']({'where':{'id':_0x21793c[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x55952c,null))[_0x60d8('0x26')](function(_0x5ecd5f){if(_0x5ecd5f){return _0x5ecd5f[_0x60d8('0x8d')](_0x21793c[_0x60d8('0x65')][_0x60d8('0x6d')],_[_0x60d8('0x8e')](_0x21793c[_0x60d8('0x65')],[_0x60d8('0x6d'),'id'])||{});}})[_0x60d8('0x26')](respondWithResult(_0x55952c,null))[_0x60d8('0x30')](handleError(_0x55952c,null));};exports[_0x60d8('0x8f')]=function(_0x47c696,_0x47517b,_0x28a6b8){var _0x3f39d7={'raw':![],'where':{}};var _0x4f9f72={};var _0x4ca877={'count':0x0,'rows':[]};return db['MailAccount'][_0x60d8('0x6a')]({'where':{'id':_0x47c696['params']['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x47517b,null))[_0x60d8('0x26')](function(_0x2b5ace){if(_0x2b5ace){_0x4f9f72[_0x60d8('0x4e')]=_[_0x60d8('0x51')](db['MailInteraction'][_0x60d8('0x4a')]);_0x4f9f72[_0x60d8('0x50')]=_[_0x60d8('0x51')](_0x47c696[_0x60d8('0x50')]);_0x4f9f72[_0x60d8('0x57')]=_[_0x60d8('0x52')](_0x4f9f72[_0x60d8('0x4e')],_0x4f9f72['query']);_0x3f39d7['attributes']=_['intersection'](_0x4f9f72['model'],qs['fields'](_0x47c696[_0x60d8('0x50')][_0x60d8('0x61')]));_0x3f39d7[_0x60d8('0x53')]=_0x3f39d7[_0x60d8('0x53')][_0x60d8('0x62')]?_0x3f39d7[_0x60d8('0x53')]:_0x4f9f72[_0x60d8('0x4e')];if(!_0x47c696[_0x60d8('0x50')]['hasOwnProperty'](_0x60d8('0x54'))){_0x3f39d7['limit']=qs[_0x60d8('0x36')](_0x47c696[_0x60d8('0x50')][_0x60d8('0x36')]);_0x3f39d7[_0x60d8('0x34')]=qs['offset'](_0x47c696[_0x60d8('0x50')][_0x60d8('0x34')]);}_0x3f39d7['order']=qs[_0x60d8('0x55')](_0x47c696[_0x60d8('0x50')][_0x60d8('0x55')]);_0x3f39d7[_0x60d8('0x5b')]=qs[_0x60d8('0x57')](_['pick'](_0x47c696[_0x60d8('0x50')],_0x4f9f72[_0x60d8('0x57')]));_0x3f39d7[_0x60d8('0x5b')][_0x60d8('0x67')]=_0x2b5ace['id'];if(_0x47c696['query'][_0x60d8('0x58')]){_0x3f39d7[_0x60d8('0x5b')]=_[_0x60d8('0x59')](_0x3f39d7[_0x60d8('0x5b')],{'$or':_[_0x60d8('0x4f')](_0x3f39d7[_0x60d8('0x53')],function(_0x2299a5){var _0x216fca={};_0x216fca[_0x2299a5]={'$like':'%'+_0x47c696[_0x60d8('0x50')][_0x60d8('0x58')]+'%'};return _0x216fca;})});}_0x3f39d7=_[_0x60d8('0x59')]({},_0x3f39d7,_0x47c696['options']);return db['MailInteraction'][_0x60d8('0x37')]({'where':_0x3f39d7[_0x60d8('0x5b')]})[_0x60d8('0x26')](function(_0x296bd2){_0x4ca877[_0x60d8('0x37')]=_0x296bd2;if(_0x47c696['query']['includeAll']){_0x3f39d7['include']=[{'model':db[_0x60d8('0x90')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x60d8('0x91'),'attributes':[_0x60d8('0x42'),_0x60d8('0x92'),_0x60d8('0x93')],'required':![]},{'model':db[_0x60d8('0x94')],'as':'Tags','attributes':['id',_0x60d8('0x42'),_0x60d8('0x95')],'where':_0x47c696['query'][_0x60d8('0x96')]?{'id':_0x47c696['query']['tag']}:undefined,'required':_0x47c696[_0x60d8('0x50')]['tag']?!![]:![]}];}return db[_0x60d8('0x97')][_0x60d8('0x72')](_0x3f39d7);})[_0x60d8('0x26')](function(_0x419997){_0x4ca877[_0x60d8('0x5d')]=_0x419997;return _0x4ca877;});}})[_0x60d8('0x26')](respondWithFilteredResult(_0x47517b,_0x3f39d7))[_0x60d8('0x30')](handleError(_0x47517b,null));};exports[_0x60d8('0x98')]=function(_0x1eca94,_0x511c10,_0xb09fe9){return db[_0x60d8('0x49')][_0x60d8('0x6a')]({'where':{'id':_0x1eca94[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x511c10,null))[_0x60d8('0x26')](function(_0x1a1358){if(_0x1a1358){return db[_0x60d8('0x99')]['transaction'](function(_0x595b88){return db[_0x60d8('0x9a')][_0x60d8('0x3d')]({'where':{'MailAccountId':_0x1eca94[_0x60d8('0x5f')]['id']},'transaction':_0x595b88})['then'](function(_0xbaf04d){var _0x908348=_[_0x60d8('0x4f')](_0x1eca94['body'],function(_0x3320e8){_0x3320e8['MailAccountId']=_0x1eca94[_0x60d8('0x5f')]['id'];return _0x3320e8;});return db[_0x60d8('0x9a')][_0x60d8('0x9b')](_0x908348,{'transaction':_0x595b88});});})['then'](function(){return db['MailApplication'][_0x60d8('0x9c')]({'where':{'MailAccountId':_0x1eca94['params']['id']},'order':_0x60d8('0x9d')});});}})[_0x60d8('0x26')](respondWithResult(_0x511c10,null))[_0x60d8('0x30')](handleError(_0x511c10,null));};exports['getApplications']=function(_0x187794,_0x2d0bbd,_0x5551b5){var _0x29ee60={};var _0x2d43e1={};var _0x36694d;var _0x14319d;return db[_0x60d8('0x49')]['findOne']({'where':{'id':_0x187794['params']['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x2d0bbd,null))[_0x60d8('0x26')](function(_0x9b3c7c){if(_0x9b3c7c){_0x36694d=_0x9b3c7c;_0x2d43e1[_0x60d8('0x4e')]=_['keys'](db[_0x60d8('0x9a')][_0x60d8('0x4a')]);_0x2d43e1['query']=_[_0x60d8('0x51')](_0x187794[_0x60d8('0x50')]);_0x2d43e1[_0x60d8('0x57')]=_[_0x60d8('0x52')](_0x2d43e1[_0x60d8('0x4e')],_0x2d43e1['query']);_0x29ee60[_0x60d8('0x53')]=_[_0x60d8('0x52')](_0x2d43e1[_0x60d8('0x4e')],qs[_0x60d8('0x61')](_0x187794[_0x60d8('0x50')][_0x60d8('0x61')]));_0x29ee60[_0x60d8('0x53')]=_0x29ee60[_0x60d8('0x53')][_0x60d8('0x62')]?_0x29ee60[_0x60d8('0x53')]:_0x2d43e1[_0x60d8('0x4e')];_0x29ee60[_0x60d8('0x9e')]=qs[_0x60d8('0x55')](_0x187794[_0x60d8('0x50')]['sort']);_0x29ee60['where']=qs['filters'](_[_0x60d8('0x56')](_0x187794[_0x60d8('0x50')],_0x2d43e1[_0x60d8('0x57')]));if(_0x187794[_0x60d8('0x50')]['filter']){_0x29ee60[_0x60d8('0x5b')]=_[_0x60d8('0x59')](_0x29ee60[_0x60d8('0x5b')],{'$or':_['map'](_0x29ee60[_0x60d8('0x53')],function(_0x51c6e0){var _0x146f29={};_0x146f29[_0x51c6e0]={'$like':'%'+_0x187794['query'][_0x60d8('0x58')]+'%'};return _0x146f29;})});}_0x29ee60=_['merge']({},_0x29ee60,_0x187794['options']);return _0x36694d['getApplications'](_0x29ee60);}})[_0x60d8('0x26')](function(_0x32a10f){if(_0x32a10f){_0x14319d=_0x32a10f[_0x60d8('0x62')];if(!_0x187794[_0x60d8('0x50')][_0x60d8('0x6b')](_0x60d8('0x54'))){_0x29ee60['limit']=qs['limit'](_0x187794[_0x60d8('0x50')][_0x60d8('0x36')]);_0x29ee60[_0x60d8('0x34')]=qs[_0x60d8('0x34')](_0x187794[_0x60d8('0x50')][_0x60d8('0x34')]);}return _0x36694d[_0x60d8('0x9f')](_0x29ee60);}})[_0x60d8('0x26')](function(_0x2d2e60){if(_0x2d2e60){return _0x2d2e60?{'count':_0x14319d,'rows':_0x2d2e60}:null;}})[_0x60d8('0x26')](respondWithResult(_0x2d0bbd,null))[_0x60d8('0x30')](handleError(_0x2d0bbd,null));};exports[_0x60d8('0xa0')]=function(_0x52ea4c,_0x354fda,_0x4c8651){var _0x8ce8cc={'raw':!![],'where':{}};var _0x28e011={};var _0x46a602={'count':0x0,'rows':[]};return db[_0x60d8('0x49')][_0x60d8('0x6a')]({'where':{'id':_0x52ea4c['params']['id']}})['then'](handleEntityNotFound(_0x354fda,null))[_0x60d8('0x26')](function(_0x2eb71d){if(_0x2eb71d){_0x28e011[_0x60d8('0x4e')]=_[_0x60d8('0x51')](db[_0x60d8('0xa1')]['rawAttributes']);_0x28e011['query']=_[_0x60d8('0x51')](_0x52ea4c[_0x60d8('0x50')]);_0x28e011[_0x60d8('0x57')]=_['intersection'](_0x28e011[_0x60d8('0x4e')],_0x28e011[_0x60d8('0x50')]);_0x8ce8cc[_0x60d8('0x53')]=_[_0x60d8('0x52')](_0x28e011[_0x60d8('0x4e')],qs[_0x60d8('0x61')](_0x52ea4c['query']['fields']));_0x8ce8cc['attributes']=_0x8ce8cc['attributes'][_0x60d8('0x62')]?_0x8ce8cc['attributes']:_0x28e011['model'];if(!_0x52ea4c[_0x60d8('0x50')][_0x60d8('0x6b')]('nolimit')){_0x8ce8cc[_0x60d8('0x36')]=qs['limit'](_0x52ea4c[_0x60d8('0x50')]['limit']);_0x8ce8cc[_0x60d8('0x34')]=qs['offset'](_0x52ea4c[_0x60d8('0x50')][_0x60d8('0x34')]);}_0x8ce8cc[_0x60d8('0x9e')]=qs[_0x60d8('0x55')](_0x52ea4c[_0x60d8('0x50')][_0x60d8('0x55')]);_0x8ce8cc['where']=qs[_0x60d8('0x57')](_['pick'](_0x52ea4c['query'],_0x28e011[_0x60d8('0x57')]));_0x8ce8cc[_0x60d8('0x5b')]['MailAccountId']=_0x2eb71d['id'];if(_0x52ea4c[_0x60d8('0x50')][_0x60d8('0x58')]){_0x8ce8cc[_0x60d8('0x5b')]=_['merge'](_0x8ce8cc['where'],{'$or':_[_0x60d8('0x4f')](_0x8ce8cc[_0x60d8('0x53')],function(_0x3e3384){var _0x42c14a={};_0x42c14a[_0x3e3384]={'$like':'%'+_0x52ea4c[_0x60d8('0x50')]['filter']+'%'};return _0x42c14a;})});}if(_0x52ea4c[_0x60d8('0x50')]['$gte']){var _0x4ae40f=_0x52ea4c[_0x60d8('0x50')]['$gte'][_0x60d8('0xa2')](',');var _0x379bec={};_0x379bec[_0x4ae40f[0x0]]={'$gte':moment(_0x4ae40f[0x1])[_0x60d8('0xa3')](_0x60d8('0xa4'))};_0x8ce8cc[_0x60d8('0x5b')]=_[_0x60d8('0x59')](_0x8ce8cc[_0x60d8('0x5b')],_0x379bec);}_0x8ce8cc=_['merge']({},_0x8ce8cc,_0x52ea4c[_0x60d8('0x5a')]);return db['MailMessage'][_0x60d8('0x37')]({'where':_0x8ce8cc[_0x60d8('0x5b')]})[_0x60d8('0x26')](function(_0x54044a){_0x46a602['count']=_0x54044a;if(_0x52ea4c['query'][_0x60d8('0x5c')]){_0x8ce8cc[_0x60d8('0x63')]=[{'all':!![]}];}return db[_0x60d8('0xa1')][_0x60d8('0x72')](_0x8ce8cc);})[_0x60d8('0x26')](function(_0x50d499){if(_0x52ea4c[_0x60d8('0x50')][_0x60d8('0xa5')]===_0x60d8('0xa6')){for(var _0x10a3c7=0x0;_0x10a3c7<_0x50d499['length'];_0x10a3c7++){_0x50d499[_0x10a3c7][_0x60d8('0x65')]=juice(_0x50d499[_0x10a3c7][_0x60d8('0x65')]);}}_0x46a602['rows']=_0x50d499;return _0x46a602;});}})['then'](respondWithFilteredResult(_0x354fda,_0x8ce8cc))[_0x60d8('0x30')](handleError(_0x354fda,null));};exports['send']=function(_0x2a3072,_0x57b9f9,_0x25b72f){var _0xe6ae7d,_0x3b80d7={},_0x424c0e;if(_0x2a3072['body']['to']){_0x424c0e=_0x2a3072[_0x60d8('0x65')]['to'][_0x60d8('0xa2')](',')[0x0];}return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x2a3072['params']['id']},'include':[{'model':db['CmList'],'as':_0x60d8('0xa7'),'include':[{'model':db[_0x60d8('0x90')],'as':'Contacts','where':{'email':_0x424c0e},'limit':0x1,'order':[[_0x60d8('0xa8'),_0x60d8('0xa9')]]}]},{'model':db[_0x60d8('0x46')],'as':_0x60d8('0x47'),'raw':!![]}]})[_0x60d8('0x26')](handleEntityNotFound(_0x57b9f9,null))[_0x60d8('0x26')](function(_0x328022){if(_0x328022){_0xe6ae7d=_0x328022;if(_0x328022['Smtp']){if(_[_0x60d8('0x74')](_0x2a3072[_0x60d8('0x65')]['from'])){_0x2a3072['body'][_0x60d8('0xaa')]=util[_0x60d8('0xa3')](_0x60d8('0xab'),_0x328022[_0x60d8('0x42')],_0x328022[_0x60d8('0x73')]||_0x328022[_0x60d8('0x47')][_0x60d8('0x77')]);}if(_0x2a3072[_0x60d8('0x65')][_0x60d8('0xac')]&&_0x2a3072[_0x60d8('0x65')]['attachments'][_0x60d8('0x62')]){for(var _0x115420=0x0;_0x115420<_0x2a3072[_0x60d8('0x65')][_0x60d8('0xac')][_0x60d8('0x62')];_0x115420+=0x1){_0x2a3072['body'][_0x60d8('0xac')][_0x115420]={'filename':_0x2a3072[_0x60d8('0x65')][_0x60d8('0xac')][_0x115420]['name'],'path':path[_0x60d8('0xad')](config['root'],'server/files/attachments',_0x2a3072[_0x60d8('0x65')][_0x60d8('0xac')][_0x115420][_0x60d8('0xae')])};}}var _0x58a21a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x328022[_0x60d8('0x47')][_0x60d8('0x7e')])){if(_0x328022[_0x60d8('0x47')][_0x60d8('0x7b')]){_0x58a21a[_0x60d8('0xaf')]={'user':_0x328022[_0x60d8('0x47')]['user'],'pass':_0x328022['Smtp']['pass']};}_0x58a21a[_0x60d8('0x7c')]=_0x328022[_0x60d8('0x47')][_0x60d8('0x7c')];_0x58a21a['port']=_0x328022[_0x60d8('0x47')][_0x60d8('0x7d')];_0x58a21a[_0x60d8('0xb0')]=_0x328022[_0x60d8('0x47')][_0x60d8('0xb0')];}else{_0x58a21a[_0x60d8('0x7e')]=_0x328022[_0x60d8('0x47')][_0x60d8('0x7e')];_0x58a21a[_0x60d8('0xaf')]={'user':_0x328022[_0x60d8('0x47')][_0x60d8('0x77')],'pass':_0x328022[_0x60d8('0x47')]['pass']};}return respondWithRpcPromise('SendMail',_0x60d8('0xb1'),{'account':_0x58a21a,'message':_0x2a3072['body']});}else{throw new Error(_0x60d8('0xb2'));}}})[_0x60d8('0x26')](function(_0x180070){if(_0x180070){_0x3b80d7=_0x180070;if(_0xe6ae7d[_0x60d8('0xa7')]){if(_0xe6ae7d['List'][_0x60d8('0xb3')][_0x60d8('0x62')]){return _0xe6ae7d['List'][_0x60d8('0xb3')][0x0];}else{return db[_0x60d8('0x90')]['create'](_['defaults'](_0x2a3072['body'],{'firstName':_0x2a3072[_0x60d8('0x65')]['to'],'email':_0x2a3072[_0x60d8('0x65')]['to'],'phone':_0x2a3072[_0x60d8('0x65')]['to'],'ListId':_0xe6ae7d[_0x60d8('0xb4')]}));}}else{throw new Error(_0x60d8('0xb2'));}}})[_0x60d8('0x26')](function(_0x596923){if(_0x596923){var _0x5806ae={'UserId':_0x2a3072['user']['id'],'ContactId':_0x596923['id'],'MailAccountId':_0xe6ae7d['id'],'inReplyTo':_0x3b80d7['messageId'],'to':_0x2a3072[_0x60d8('0x65')][_0x60d8('0xaa')],'cc':_0x2a3072[_0x60d8('0x65')]['cc'],'subject':_0x2a3072[_0x60d8('0x65')]['subject'],'attach':_0x2a3072[_0x60d8('0x65')]['attach'],'firstMsgDirection':_0x60d8('0xb5'),'lastMsgAt':moment()[_0x60d8('0xa3')](_0x60d8('0xa4')),'lastMsgDirection':_0x60d8('0xb5'),'Messages':[_[_0x60d8('0x59')](_0x2a3072[_0x60d8('0x65')],{'messageId':_0x3b80d7['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xe6ae7d['id'],'UserId':_0x2a3072['user']['id'],'ContactId':_0x596923['id']})]};if(_0x2a3072[_0x60d8('0x65')]['Interaction']){_0x5806ae=_[_0x60d8('0x59')](_0x5806ae,_0x2a3072['body']['Interaction']);}return db[_0x60d8('0x97')][_0x60d8('0x70')](_0x5806ae,{'include':[{'model':db[_0x60d8('0xa1')],'as':'Messages'}]});}})[_0x60d8('0x26')](respondWithResult(_0x57b9f9,null))['catch'](handleError(_0x57b9f9,null));};exports[_0x60d8('0xb6')]=function(_0x45333b,_0x5b4b05,_0x10aa57){return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x45333b[_0x60d8('0x5f')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x60d8('0x47'),'raw':!![]}]})['then'](handleEntityNotFound(_0x5b4b05,null))['then'](function(_0x30f551){if(_0x30f551&&_0x30f551[_0x60d8('0x47')]){var _0x171bb0={'id':_0x30f551['id'],'tls':{'rejectUnauthorized':![]}};if(_0x30f551['Smtp'][_0x60d8('0x7e')]){_0x171bb0['service']=_0x30f551['Smtp'][_0x60d8('0x7e')];}else{_0x171bb0['host']=_0x30f551[_0x60d8('0x47')][_0x60d8('0x7c')];_0x171bb0[_0x60d8('0x7d')]=_0x30f551[_0x60d8('0x47')][_0x60d8('0x7d')];_0x171bb0[_0x60d8('0xb0')]=_0x30f551[_0x60d8('0x47')][_0x60d8('0xb0')];}if(_0x30f551[_0x60d8('0x47')][_0x60d8('0x7b')]){_0x171bb0[_0x60d8('0xaf')]={'user':_0x30f551[_0x60d8('0x47')]['user'],'pass':_0x30f551['Smtp'][_0x60d8('0x80')]};}return respondWithRpcPromise(_0x60d8('0xb7'),_0x60d8('0xb6'),{'account':_0x171bb0});}})['then'](respondWithResult(_0x5b4b05,null))[_0x60d8('0x30')](handleError(_0x5b4b05,null));};exports[_0x60d8('0x3d')]=function(_0x4c0d05,_0x4e57c3){return db['MailAccount'][_0x60d8('0x64')]({'where':{'id':_0x4c0d05[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x4e57c3,null))['then'](function(_0x26c533){if(_0x26c533&&_0x26c533[_0x60d8('0x7e')]){throw new db[(_0x60d8('0xb8'))][(_0x60d8('0xb9'))](_0x60d8('0xba'));}return _0x26c533;})['then'](removeEntity(_0x4e57c3,null))[_0x60d8('0x30')](handleError(_0x4e57c3,null));};exports[_0x60d8('0xbb')]=function(_0x40439c,_0x3ce5a5,_0x21cc1b){return db[_0x60d8('0x49')][_0x60d8('0x64')]({'where':{'id':_0x40439c[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x3ce5a5,null))[_0x60d8('0x26')](function(_0x2206fa){if(_0x2206fa){return _0x2206fa[_0x60d8('0xbb')](_0x40439c['body'][_0x60d8('0x6d')],_[_0x60d8('0x8e')](_0x40439c[_0x60d8('0x65')],[_0x60d8('0x6d'),'id'])||{})['spread'](function(_0x22d84e){for(var _0x91cd8f=0x0;_0x91cd8f<_0x40439c[_0x60d8('0x65')]['ids'][_0x60d8('0x62')];_0x91cd8f+=0x1){socket[_0x60d8('0xbc')](_0x60d8('0xbd'),{'UserId':Number(_0x40439c['body']['ids'][_0x91cd8f]),'MailAccountId':Number(_0x40439c[_0x60d8('0x5f')]['id'])});}return _0x22d84e;});}})[_0x60d8('0x26')](respondWithResult(_0x3ce5a5,null))[_0x60d8('0x30')](handleError(_0x3ce5a5,null));};exports[_0x60d8('0xbe')]=function(_0x18ddb0,_0x4782c6,_0x345805){return db[_0x60d8('0x49')]['find']({'where':{'id':_0x18ddb0[_0x60d8('0x5f')]['id']}})[_0x60d8('0x26')](handleEntityNotFound(_0x4782c6,null))[_0x60d8('0x26')](function(_0x47672e){if(_0x47672e){return _0x47672e['removeAgents'](_0x18ddb0[_0x60d8('0x50')][_0x60d8('0x6d')])[_0x60d8('0x26')](function(){if(_['isArray'](_0x18ddb0[_0x60d8('0x50')][_0x60d8('0x6d')])){for(var _0x257fbb=0x0;_0x257fbb<_0x18ddb0[_0x60d8('0x50')]['ids'][_0x60d8('0x62')];_0x257fbb+=0x1){socket[_0x60d8('0xbc')](_0x60d8('0xbf'),{'UserId':Number(_0x18ddb0['query'][_0x60d8('0x6d')][_0x257fbb]),'MailAccountId':Number(_0x18ddb0[_0x60d8('0x5f')]['id'])});}}else{socket[_0x60d8('0xbc')](_0x60d8('0xbf'),{'UserId':Number(_0x18ddb0['query'][_0x60d8('0x6d')]),'MailAccountId':Number(_0x18ddb0[_0x60d8('0x5f')]['id'])});}});}})[_0x60d8('0x26')](respondWithStatusCode(_0x4782c6,null))[_0x60d8('0x30')](handleError(_0x4782c6,null));};exports[_0x60d8('0xc0')]=function(_0x2a39bc,_0x446189,_0x4a5fbc){var _0x4c2eb1={};var _0x4af18a={};var _0x1768ce;var _0x3ce4e0;return db[_0x60d8('0x49')][_0x60d8('0x6a')]({'where':{'id':_0x2a39bc[_0x60d8('0x5f')]['id']}})['then'](handleEntityNotFound(_0x446189,null))[_0x60d8('0x26')](function(_0x5e39da){if(_0x5e39da){_0x1768ce=_0x5e39da;_0x4af18a[_0x60d8('0x4e')]=_['keys'](db[_0x60d8('0xc1')][_0x60d8('0x4a')]);_0x4af18a[_0x60d8('0x50')]=_[_0x60d8('0x51')](_0x2a39bc['query']);_0x4af18a['filters']=_[_0x60d8('0x52')](_0x4af18a[_0x60d8('0x4e')],_0x4af18a['query']);_0x4c2eb1[_0x60d8('0x53')]=_[_0x60d8('0x52')](_0x4af18a[_0x60d8('0x4e')],qs['fields'](_0x2a39bc[_0x60d8('0x50')][_0x60d8('0x61')]));_0x4c2eb1[_0x60d8('0x53')]=_0x4c2eb1['attributes'][_0x60d8('0x62')]?_0x4c2eb1[_0x60d8('0x53')]:_0x4af18a[_0x60d8('0x4e')];_0x4c2eb1['order']=qs['sort'](_0x2a39bc[_0x60d8('0x50')][_0x60d8('0x55')]);_0x4c2eb1['where']=qs['filters'](_[_0x60d8('0x56')](_0x2a39bc['query'],_0x4af18a[_0x60d8('0x57')]));if(_0x2a39bc[_0x60d8('0x50')][_0x60d8('0x58')]){_0x4c2eb1[_0x60d8('0x5b')]=_[_0x60d8('0x59')](_0x4c2eb1[_0x60d8('0x5b')],{'$or':_['map'](_0x4c2eb1[_0x60d8('0x53')],function(_0x50b998){var _0x4be647={};_0x4be647[_0x50b998]={'$like':'%'+_0x2a39bc[_0x60d8('0x50')][_0x60d8('0x58')]+'%'};return _0x4be647;})});}_0x4c2eb1=_[_0x60d8('0x59')]({},_0x4c2eb1,_0x2a39bc['options']);return _0x1768ce[_0x60d8('0xc0')](_0x4c2eb1);}})[_0x60d8('0x26')](function(_0x364e39){if(_0x364e39){_0x3ce4e0=_0x364e39[_0x60d8('0x62')];if(!_0x2a39bc['query'][_0x60d8('0x6b')](_0x60d8('0x54'))){_0x4c2eb1[_0x60d8('0x36')]=qs[_0x60d8('0x36')](_0x2a39bc[_0x60d8('0x50')][_0x60d8('0x36')]);_0x4c2eb1[_0x60d8('0x34')]=qs[_0x60d8('0x34')](_0x2a39bc['query'][_0x60d8('0x34')]);}return _0x1768ce['getAgents'](_0x4c2eb1);}})[_0x60d8('0x26')](function(_0x398d52){if(_0x398d52){return _0x398d52?{'count':_0x3ce4e0,'rows':_0x398d52}:null;}})['then'](respondWithResult(_0x446189,null))[_0x60d8('0x30')](handleError(_0x446189,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index d56de1e..cbe5703 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 _0xba79=['save','hook','exports','events','../../mysqldb','MailAccount'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xba79,0x153));var _0x9ba7=function(_0x4d65dc,_0x1bc42b){_0x4d65dc=_0x4d65dc-0x0;var _0x3c2057=_0xba79[_0x4d65dc];return _0x3c2057;};'use strict';var EventEmitter=require(_0x9ba7('0x0'));var MailAccount=require(_0x9ba7('0x1'))['db'][_0x9ba7('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ba7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21a14f){return function(_0x8dd31f,_0x407489,_0x30c57c){MailAccountEvents['emit'](_0x21a14f+':'+_0x8dd31f['id'],_0x8dd31f);MailAccountEvents['emit'](_0x21a14f,_0x8dd31f);_0x30c57c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x9ba7('0x4')](e,emitEvent(event));}}module[_0x9ba7('0x5')]=MailAccountEvents; \ No newline at end of file +var _0xd76a=['exports','events','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d6ea7,_0x71cb77){var _0x5b8189=function(_0xe2d8fd){while(--_0xe2d8fd){_0x3d6ea7['push'](_0x3d6ea7['shift']());}};_0x5b8189(++_0x71cb77);}(_0xd76a,0x105));var _0xad76=function(_0x4ed8ca,_0x7545d9){_0x4ed8ca=_0x4ed8ca-0x0;var _0x14112b=_0xd76a[_0x4ed8ca];return _0x14112b;};'use strict';var EventEmitter=require(_0xad76('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xad76('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xad76('0x2')](0x0);var events={'afterCreate':_0xad76('0x3'),'afterUpdate':_0xad76('0x4'),'afterDestroy':_0xad76('0x5')};function emitEvent(_0x4b29ed){return function(_0xd88075,_0xc55d60,_0x86111c){MailAccountEvents[_0xad76('0x6')](_0x4b29ed+':'+_0xd88075['id'],_0xd88075);MailAccountEvents[_0xad76('0x6')](_0x4b29ed,_0xd88075);_0x86111c(null);};}for(var e in events){if(events[_0xad76('0x7')](e)){var event=events[e];MailAccount[_0xad76('0x8')](e,emitEvent(event));}}module[_0xad76('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 721dfe1..9584822 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 _0x7348=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts'];(function(_0x255a6e,_0x2be4a8){var _0x1338d2=function(_0x28c3ac){while(--_0x28c3ac){_0x255a6e['push'](_0x255a6e['shift']());}};_0x1338d2(++_0x2be4a8);}(_0x7348,0x174));var _0x8734=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7348[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8734('0x0'));var util=require(_0x8734('0x1'));var logger=require(_0x8734('0x2'))(_0x8734('0x3'));var moment=require('moment');var BPromise=require(_0x8734('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8734('0x5'));var rimraf=require(_0x8734('0x6'));var config=require(_0x8734('0x7'));var attributes=require(_0x8734('0x8'));module[_0x8734('0x9')]=function(_0x26d3ef,_0x3515af){return _0x26d3ef['define'](_0x8734('0xa'),attributes,{'tableName':_0x8734('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac7e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x5d29b1,_0x5a9f3a){var _0x5bf3f6=function(_0x2701a7){while(--_0x2701a7){_0x5d29b1['push'](_0x5d29b1['shift']());}};_0x5bf3f6(++_0x5a9f3a);}(_0xac7e,0x145));var _0xeac7=function(_0x4d720e,_0x1a9801){_0x4d720e=_0x4d720e-0x0;var _0x4a5e07=_0xac7e[_0x4d720e];return _0x4a5e07;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeac7('0x0'))(_0xeac7('0x1'));var moment=require(_0xeac7('0x2'));var BPromise=require(_0xeac7('0x3'));var rp=require(_0xeac7('0x4'));var fs=require('fs');var path=require(_0xeac7('0x5'));var rimraf=require(_0xeac7('0x6'));var config=require(_0xeac7('0x7'));var attributes=require(_0xeac7('0x8'));module[_0xeac7('0x9')]=function(_0x369979,_0x28efb4){return _0x369979[_0xeac7('0xa')](_0xeac7('0xb'),attributes,{'tableName':_0xeac7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index c8ac34a..a2f00ba 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 _0x7242=['ShowMailAccount','stringify','NotifyMailAccount','body','difference','CmContact','rawAttributes','createdAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','Contacts','updatedAt','MailApplication','Applications','MailServerOut','get','omit','List','applications','priority','asc','autoclose','push','*,*,*,*','length','ListId','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','find','MailMessage','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','update','attach','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','interaction','UserId','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','map','model'];(function(_0x58675f,_0x390355){var _0x1cc7f0=function(_0x31d6d6){while(--_0x31d6d6){_0x58675f['push'](_0x58675f['shift']());}};_0x1cc7f0(++_0x390355);}(_0x7242,0x107));var _0x2724=function(_0x4e66c0,_0x205283){_0x4e66c0=_0x4e66c0-0x0;var _0x47ca20=_0x7242[_0x4e66c0];return _0x47ca20;};'use strict';var _=require(_0x2724('0x0'));var util=require(_0x2724('0x1'));var moment=require('moment');var BPromise=require(_0x2724('0x2'));var rs=require(_0x2724('0x3'));var fs=require('fs');var Redis=require(_0x2724('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2724('0x5'));var logger=require(_0x2724('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2724('0x7'));var client=jayson[_0x2724('0x8')][_0x2724('0x9')]({'port':0x232c});config[_0x2724('0xa')]=_[_0x2724('0xb')](config[_0x2724('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2724('0xc'))[_0x2724('0xd')](socket);function respondWithRpcPromise(_0x3e329b,_0x56b554,_0x4ebd0e){return new BPromise(function(_0x2e6eec,_0xdb7b86){return client[_0x2724('0xe')](_0x3e329b,_0x4ebd0e)[_0x2724('0xf')](function(_0x10fe26){logger['info'](_0x2724('0x10'),_0x56b554,_0x2724('0x11'));logger[_0x2724('0x12')](_0x2724('0x13'),_0x56b554,_0x2724('0x11'),JSON['stringify'](_0x10fe26));if(_0x10fe26[_0x2724('0x14')]){if(_0x10fe26[_0x2724('0x14')]['code']===0x1f4){logger['error'](_0x2724('0x10'),_0x56b554,_0x10fe26[_0x2724('0x14')][_0x2724('0x15')]);return _0xdb7b86(_0x10fe26['error'][_0x2724('0x15')]);}logger[_0x2724('0x14')]('MailAccount,\x20%s,\x20%s',_0x56b554,_0x10fe26[_0x2724('0x14')][_0x2724('0x15')]);return _0x2e6eec(_0x10fe26['error'][_0x2724('0x15')]);}else{logger[_0x2724('0x16')](_0x2724('0x10'),_0x56b554,_0x2724('0x11'));_0x2e6eec(_0x10fe26['result'][_0x2724('0x15')]);}})[_0x2724('0x17')](function(_0x4308c5){logger[_0x2724('0x14')](_0x2724('0x10'),_0x56b554,_0x4308c5);_0xdb7b86(_0x4308c5);});});}exports[_0x2724('0x18')]=function(_0x5c12ea){var _0x3cdd49=this;return new Promise(function(_0x5a44c7,_0x56f257){return db[_0x2724('0x19')]['findAll']({'raw':_0x5c12ea[_0x2724('0x1a')]?_0x5c12ea['options'][_0x2724('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c12ea[_0x2724('0x1a')]?_0x5c12ea[_0x2724('0x1a')][_0x2724('0x1c')]||null:null,'attributes':_0x5c12ea[_0x2724('0x1a')]?_0x5c12ea[_0x2724('0x1a')][_0x2724('0x1d')]||null:null,'limit':_0x5c12ea[_0x2724('0x1a')]?_0x5c12ea[_0x2724('0x1a')][_0x2724('0x1e')]||null:null,'include':_0x5c12ea['options']?_0x5c12ea[_0x2724('0x1a')][_0x2724('0x1f')]?_[_0x2724('0x20')](_0x5c12ea[_0x2724('0x1a')]['include'],function(_0xc27f82){return{'model':db[_0xc27f82['model']],'as':_0xc27f82['as'],'attributes':_0xc27f82[_0x2724('0x1d')],'include':_0xc27f82['include']?_[_0x2724('0x20')](_0xc27f82[_0x2724('0x1f')],function(_0x3c1546){return{'model':db[_0x3c1546[_0x2724('0x21')]],'as':_0x3c1546['as'],'attributes':_0x3c1546[_0x2724('0x1d')],'include':_0x3c1546[_0x2724('0x1f')]?_[_0x2724('0x20')](_0x3c1546[_0x2724('0x1f')],function(_0xc59d7e){return{'model':db[_0xc59d7e['model']],'as':_0xc59d7e['as'],'attributes':_0xc59d7e[_0x2724('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2724('0xf')](function(_0x48717f){logger[_0x2724('0x16')](_0x2724('0x18'),_0x5c12ea);logger['debug'](_0x2724('0x18'),_0x5c12ea,JSON['stringify'](_0x48717f));_0x5a44c7(_0x48717f);})[_0x2724('0x17')](function(_0x550fb4){logger[_0x2724('0x14')]('GetMailAccount',_0x550fb4[_0x2724('0x15')],_0x5c12ea);_0x56f257(_0x3cdd49[_0x2724('0x14')](0x1f4,_0x550fb4['message']));});});};exports[_0x2724('0x22')]=function(_0x26f611){var _0xebff07=this;return new Promise(function(_0x1329a9,_0x363b5d){return db[_0x2724('0x19')]['find']({'raw':_0x26f611['options']?_0x26f611[_0x2724('0x1a')][_0x2724('0x1b')]===undefined?!![]:![]:!![],'where':_0x26f611['options']?_0x26f611[_0x2724('0x1a')][_0x2724('0x1c')]||null:null,'attributes':_0x26f611[_0x2724('0x1a')]?_0x26f611['options'][_0x2724('0x1d')]||null:null,'include':_0x26f611[_0x2724('0x1a')]?_0x26f611[_0x2724('0x1a')][_0x2724('0x1f')]?_[_0x2724('0x20')](_0x26f611['options']['include'],function(_0xd50455){return{'model':db[_0xd50455[_0x2724('0x21')]],'as':_0xd50455['as'],'attributes':_0xd50455[_0x2724('0x1d')],'include':_0xd50455[_0x2724('0x1f')]?_['map'](_0xd50455[_0x2724('0x1f')],function(_0x2e2d2b){return{'model':db[_0x2e2d2b[_0x2724('0x21')]],'as':_0x2e2d2b['as'],'attributes':_0x2e2d2b['attributes'],'include':_0x2e2d2b[_0x2724('0x1f')]?_[_0x2724('0x20')](_0x2e2d2b[_0x2724('0x1f')],function(_0x205a5d){return{'model':db[_0x205a5d[_0x2724('0x21')]],'as':_0x205a5d['as'],'attributes':_0x205a5d[_0x2724('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2724('0xf')](function(_0x59a32e){logger[_0x2724('0x16')](_0x2724('0x22'),_0x26f611);logger['debug']('ShowMailAccount',_0x26f611,JSON[_0x2724('0x23')](_0x59a32e));_0x1329a9(_0x59a32e);})['catch'](function(_0x2edf1d){logger[_0x2724('0x14')](_0x2724('0x22'),_0x2edf1d[_0x2724('0x15')],_0x26f611);_0x363b5d(_0xebff07[_0x2724('0x14')](0x1f4,_0x2edf1d[_0x2724('0x15')]));});});};exports[_0x2724('0x24')]=function(_0x162d46){var _0x12a487=this;return new Promise(function(_0x211edf,_0x985400){var _0x1cba26={'body':_0x162d46[_0x2724('0x25')],'channel':'mail'};var _0x2468cf=_[_0x2724('0x26')](_['keys'](db[_0x2724('0x27')][_0x2724('0x28')]),[_0x2724('0x29'),'updatedAt','CompanyId','ListId']);var _0x252536=![];if(_0x162d46[_0x2724('0x25')]['id']){delete _0x162d46[_0x2724('0x25')]['id'];}if(_[_0x2724('0x2a')](_0x162d46[_0x2724('0x25')][_0x2724('0x2b')])){return _0x985400(_0x12a487['error'](0x1f4,_0x2724('0x2c')));}if(_[_0x2724('0x2a')](_0x162d46[_0x2724('0x25')][_0x2724('0x25')])||_0x162d46[_0x2724('0x25')][_0x2724('0x25')]===''){return _0x985400(_0x12a487[_0x2724('0x14')](0x1f4,_0x2724('0x2d')));}if(_[_0x2724('0x2a')](_0x162d46['body']['mapKey'])){return _0x985400(_0x12a487[_0x2724('0x14')](0x1f4,_0x2724('0x2e')+_0x2468cf));}if(!_[_0x2724('0x2f')](_0x2468cf,_0x162d46[_0x2724('0x25')]['mapKey'])){return _0x985400(_0x12a487[_0x2724('0x14')](0x1f4,_0x2724('0x30')+_0x2468cf));}var _0x540341={};_0x540341[_0x162d46[_0x2724('0x25')][_0x2724('0x31')]]=_0x162d46[_0x2724('0x25')][_0x2724('0x2b')];return db['MailAccount']['find']({'where':{'id':_0x162d46[_0x2724('0x32')]['id']},'include':[{'model':db[_0x2724('0x33')],'as':'List','include':[{'model':db['CmContact'],'as':_0x2724('0x34'),'where':_0x540341,'limit':0x1,'order':[[_0x2724('0x35'),'DESC']]}]},{'model':db[_0x2724('0x36')],'as':_0x2724('0x37')},{'model':db[_0x2724('0x38')],'as':'Smtp'}]})[_0x2724('0xf')](function(_0x1a4597){if(_0x1a4597&&_0x1a4597['List']){var _0x204482=_0x1a4597[_0x2724('0x39')]({'plain':!![]});_0x1cba26['account']=_[_0x2724('0x3a')](_0x204482,[_0x2724('0x37'),_0x2724('0x3b')]);_0x1cba26[_0x2724('0x3c')]=_0x204482['Applications'];_0x1cba26['list']=_0x204482[_0x2724('0x3b')];_0x1cba26[_0x2724('0x3c')]=_['orderBy'](_0x1cba26[_0x2724('0x3c')],[_0x2724('0x3d')],[_0x2724('0x3e')]);if(_0x1cba26['account']&&_0x1cba26[_0x2724('0x32')][_0x2724('0x3f')]){_0x1cba26[_0x2724('0x3c')][_0x2724('0x40')]({'id':0x0,'priority':_0x1cba26[_0x2724('0x3c')]['length']+0x1,'app':'close','appdata':_0x2724('0x3f'),'interval':_0x2724('0x41')});}if(_0x1cba26[_0x2724('0x32')]['Applications']){delete _0x1cba26['account'][_0x2724('0x37')];}if(_0x1cba26['account']['List']){delete _0x1cba26['account']['List'];}if(_0x204482['List'][_0x2724('0x34')][_0x2724('0x42')]){return _0x204482[_0x2724('0x3b')][_0x2724('0x34')][0x0];}var _0x1d6436=_[_0x2724('0xb')](_0x162d46[_0x2724('0x25')],{'firstName':_0x162d46[_0x2724('0x25')][_0x2724('0x2b')],'ListId':_0x204482[_0x2724('0x43')]});_0x1d6436[_0x162d46[_0x2724('0x25')][_0x2724('0x31')]]=_0x162d46[_0x2724('0x25')][_0x2724('0x2b')];return db[_0x2724('0x27')]['create'](_0x1d6436);}else{throw new Error(_0x2724('0x44'));}})['then'](function(_0x42a004){_0x1cba26[_0x2724('0x45')]=_0x42a004;if(_0x42a004){if(!_0x162d46['body'][_0x2724('0x15')][_0x2724('0x46')]){_0x162d46['body'][_0x2724('0x15')][_0x2724('0x46')]=rs[_0x2724('0x47')]()+'\x20'+_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x2b')];}var _0x3df063={'ContactId':_0x42a004['id'],'MailAccountId':_0x162d46['account']['id'],'inReplyTo':_0x162d46[_0x2724('0x25')][_0x2724('0x15')]['messageId'],'to':_0x162d46['body'][_0x2724('0x15')][_0x2724('0x2b')],'cc':_0x162d46[_0x2724('0x25')]['message']['cc'],'subject':_0x162d46[_0x2724('0x25')]['message'][_0x2724('0x48')],'attach':_0x162d46['body'][_0x2724('0x15')]['attach'],'lastMsgAt':moment()[_0x2724('0x49')](_0x2724('0x4a')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x2724('0x4b')]({'where':{'closed':![],'MailAccountId':_0x162d46[_0x2724('0x32')]['id']},'include':[{'model':db[_0x2724('0x4c')],'as':_0x2724('0x4d'),'attributes':[_0x2724('0x46')],'where':{'messageId':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x4e')]}}]})[_0x2724('0xf')](function(_0x462a03){if(_0x462a03){return[_0x462a03,![]];}return db[_0x2724('0x4f')][_0x2724('0x50')](_0x3df063)[_0x2724('0xf')](function(_0x2e3825){return[_0x2e3825,!![]];});});}else{throw new Error(_0x2724('0x51'));}})['spread'](function(_0x462943,_0x2d165a){if(_0x462943){_0x252536=_0x2d165a;if(!_0x2d165a){return _0x462943[_0x2724('0x52')]({'inReplyTo':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x46')],'to':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x2b')],'cc':_0x162d46[_0x2724('0x25')][_0x2724('0x15')]['cc'],'subject':_0x162d46['body'][_0x2724('0x15')][_0x2724('0x48')],'attach':_0x462943[_0x2724('0x53')]?_0x462943['attach']:_0x162d46[_0x2724('0x25')][_0x2724('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x2724('0x49')](_0x2724('0x4a')),'lastMsgAt':moment()[_0x2724('0x49')](_0x2724('0x4a')),'lastMsgDirection':'in'});}else{return _0x462943;}}})[_0x2724('0xf')](function(_0x5014ea){_0x1cba26['interaction']=_0x5014ea['get']({'plain':!![]});_0x1cba26['interaction'][_0x2724('0x54')]=_0x252536;return db[_0x2724('0x4c')][_0x2724('0x50')]({'body':_0x162d46[_0x2724('0x25')][_0x2724('0x25')],'MailAccountId':_0x162d46[_0x2724('0x32')]['id'],'MailInteractionId':_0x5014ea['id'],'direction':'in','ContactId':_0x1cba26[_0x2724('0x45')]['id'],'messageId':_0x162d46[_0x2724('0x25')]['message'][_0x2724('0x46')],'from':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x2b')],'to':_0x162d46['body'][_0x2724('0x15')]['to'],'cc':_0x162d46['body']['message']['cc'],'subject':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x48')],'attach':_0x162d46[_0x2724('0x25')]['message'][_0x2724('0x53')],'Attachments':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x55')],'originTo':_0x162d46['body'][_0x2724('0x15')][_0x2724('0x56')],'originCc':_0x162d46['body']['message']['originCc'],'bcc':_0x162d46[_0x2724('0x25')][_0x2724('0x15')][_0x2724('0x57')],'ChatWebsiteId':_0x162d46['body']['message'][_0x2724('0x58')]||null,'originChannel':_0x162d46['body'][_0x2724('0x15')][_0x2724('0x59')]||_0x2724('0x5a'),'ChatOfflineMessageId':_0x162d46[_0x2724('0x25')]['message'][_0x2724('0x5b')]||null},{'include':[{'model':db[_0x2724('0x5c')],'as':'Attachments'}]});})[_0x2724('0xf')](function(_0x5e3bc9){_0x1cba26['message']=_0x5e3bc9;if(_0x1cba26[_0x2724('0x5d')][_0x2724('0x5e')]){return db['User'][_0x2724('0x4b')]({'attributes':['id','name'],'where':{'id':_0x1cba26[_0x2724('0x5d')][_0x2724('0x5e')]}})[_0x2724('0xf')](function(_0x1bddc9){if(_0x1bddc9){_0x1cba26[_0x2724('0x3c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2724('0x5f'),'appdata':_0x1bddc9['name']+','+(_0x1cba26['account'][_0x2724('0x60')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2724('0x61'),_0x2724('0x62'),_0x1cba26);});}return respondWithRpcPromise(_0x2724('0x61'),_0x2724('0x62'),_0x1cba26);})['then'](function(_0x289ac0){_0x211edf(_0x289ac0);})[_0x2724('0x17')](function(_0x977640){_0x985400(_0x12a487[_0x2724('0x14')](0x1f4,_0x977640[_0x2724('0x15')]));});});}; \ No newline at end of file +var _0x4b12=['originChannel','Email','ChatOfflineMessageId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','map','include','model','debug','stringify','find','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','get','omit','applications','priority','asc','autoclose','push','length','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','interaction','created','MailMessage','originTo','originCc','bcc','ChatWebsiteId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b12,0x72));var _0x24b1=function(_0x37989e,_0x5e4e70){_0x37989e=_0x37989e-0x0;var _0x435324=_0x4b12[_0x37989e];return _0x435324;};'use strict';var _=require(_0x24b1('0x0'));var util=require(_0x24b1('0x1'));var moment=require(_0x24b1('0x2'));var BPromise=require(_0x24b1('0x3'));var rs=require(_0x24b1('0x4'));var fs=require('fs');var Redis=require(_0x24b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x24b1('0x6'))(_0x24b1('0x7'));var config=require(_0x24b1('0x8'));var jayson=require(_0x24b1('0x9'));var client=jayson[_0x24b1('0xa')]['http']({'port':0x232c});config[_0x24b1('0xb')]=_[_0x24b1('0xc')](config['redis'],{'host':_0x24b1('0xd'),'port':0x18eb});var socket=require(_0x24b1('0xe'))(new Redis(config['redis']));require(_0x24b1('0xf'))[_0x24b1('0x10')](socket);function respondWithRpcPromise(_0x33ef68,_0x1aa1e6,_0xe69746){return new BPromise(function(_0x278361,_0x284396){return client[_0x24b1('0x11')](_0x33ef68,_0xe69746)[_0x24b1('0x12')](function(_0x16a709){logger[_0x24b1('0x13')](_0x24b1('0x14'),_0x1aa1e6,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x1aa1e6,_0x24b1('0x15'),JSON['stringify'](_0x16a709));if(_0x16a709[_0x24b1('0x16')]){if(_0x16a709[_0x24b1('0x16')][_0x24b1('0x17')]===0x1f4){logger[_0x24b1('0x16')](_0x24b1('0x14'),_0x1aa1e6,_0x16a709[_0x24b1('0x16')][_0x24b1('0x18')]);return _0x284396(_0x16a709[_0x24b1('0x16')][_0x24b1('0x18')]);}logger[_0x24b1('0x16')](_0x24b1('0x14'),_0x1aa1e6,_0x16a709[_0x24b1('0x16')][_0x24b1('0x18')]);return _0x278361(_0x16a709[_0x24b1('0x16')]['message']);}else{logger[_0x24b1('0x13')](_0x24b1('0x14'),_0x1aa1e6,_0x24b1('0x15'));_0x278361(_0x16a709[_0x24b1('0x19')]['message']);}})[_0x24b1('0x1a')](function(_0x5d6bb2){logger[_0x24b1('0x16')](_0x24b1('0x14'),_0x1aa1e6,_0x5d6bb2);_0x284396(_0x5d6bb2);});});}exports[_0x24b1('0x1b')]=function(_0x2d9df0){var _0x3a817c=this;return new Promise(function(_0x32fb59,_0x10d2e3){return db[_0x24b1('0x1c')]['findAll']({'raw':_0x2d9df0[_0x24b1('0x1d')]?_0x2d9df0[_0x24b1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2d9df0[_0x24b1('0x1d')]?_0x2d9df0[_0x24b1('0x1d')][_0x24b1('0x1e')]||null:null,'attributes':_0x2d9df0[_0x24b1('0x1d')]?_0x2d9df0[_0x24b1('0x1d')][_0x24b1('0x1f')]||null:null,'limit':_0x2d9df0[_0x24b1('0x1d')]?_0x2d9df0['options'][_0x24b1('0x20')]||null:null,'include':_0x2d9df0[_0x24b1('0x1d')]?_0x2d9df0[_0x24b1('0x1d')]['include']?_[_0x24b1('0x21')](_0x2d9df0[_0x24b1('0x1d')][_0x24b1('0x22')],function(_0x759aae){return{'model':db[_0x759aae['model']],'as':_0x759aae['as'],'attributes':_0x759aae[_0x24b1('0x1f')],'include':_0x759aae[_0x24b1('0x22')]?_['map'](_0x759aae[_0x24b1('0x22')],function(_0x1dab3f){return{'model':db[_0x1dab3f[_0x24b1('0x23')]],'as':_0x1dab3f['as'],'attributes':_0x1dab3f[_0x24b1('0x1f')],'include':_0x1dab3f[_0x24b1('0x22')]?_['map'](_0x1dab3f[_0x24b1('0x22')],function(_0x1201eb){return{'model':db[_0x1201eb['model']],'as':_0x1201eb['as'],'attributes':_0x1201eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x24b1('0x12')](function(_0x5e1024){logger[_0x24b1('0x13')](_0x24b1('0x1b'),_0x2d9df0);logger[_0x24b1('0x24')](_0x24b1('0x1b'),_0x2d9df0,JSON[_0x24b1('0x25')](_0x5e1024));_0x32fb59(_0x5e1024);})['catch'](function(_0x1f1458){logger['error'](_0x24b1('0x1b'),_0x1f1458[_0x24b1('0x18')],_0x2d9df0);_0x10d2e3(_0x3a817c['error'](0x1f4,_0x1f1458[_0x24b1('0x18')]));});});};exports['ShowMailAccount']=function(_0x1b498c){var _0x140f8b=this;return new Promise(function(_0x5c050f,_0x476f58){return db[_0x24b1('0x1c')][_0x24b1('0x26')]({'raw':_0x1b498c['options']?_0x1b498c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b498c['options']?_0x1b498c[_0x24b1('0x1d')][_0x24b1('0x1e')]||null:null,'attributes':_0x1b498c[_0x24b1('0x1d')]?_0x1b498c[_0x24b1('0x1d')][_0x24b1('0x1f')]||null:null,'include':_0x1b498c[_0x24b1('0x1d')]?_0x1b498c[_0x24b1('0x1d')][_0x24b1('0x22')]?_[_0x24b1('0x21')](_0x1b498c['options']['include'],function(_0x16898e){return{'model':db[_0x16898e['model']],'as':_0x16898e['as'],'attributes':_0x16898e[_0x24b1('0x1f')],'include':_0x16898e[_0x24b1('0x22')]?_[_0x24b1('0x21')](_0x16898e[_0x24b1('0x22')],function(_0x3b7e15){return{'model':db[_0x3b7e15[_0x24b1('0x23')]],'as':_0x3b7e15['as'],'attributes':_0x3b7e15[_0x24b1('0x1f')],'include':_0x3b7e15[_0x24b1('0x22')]?_[_0x24b1('0x21')](_0x3b7e15[_0x24b1('0x22')],function(_0x306485){return{'model':db[_0x306485['model']],'as':_0x306485['as'],'attributes':_0x306485[_0x24b1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dea67){logger[_0x24b1('0x13')]('ShowMailAccount',_0x1b498c);logger[_0x24b1('0x24')]('ShowMailAccount',_0x1b498c,JSON[_0x24b1('0x25')](_0x5dea67));_0x5c050f(_0x5dea67);})[_0x24b1('0x1a')](function(_0x591b4c){logger[_0x24b1('0x16')](_0x24b1('0x27'),_0x591b4c[_0x24b1('0x18')],_0x1b498c);_0x476f58(_0x140f8b[_0x24b1('0x16')](0x1f4,_0x591b4c[_0x24b1('0x18')]));});});};exports[_0x24b1('0x28')]=function(_0x35be3f){var _0x49b547=this;return new Promise(function(_0x4796e1,_0x4fdba1){var _0x317a98={'body':_0x35be3f[_0x24b1('0x29')],'channel':'mail'};var _0x140a50=_[_0x24b1('0x2a')](_[_0x24b1('0x2b')](db[_0x24b1('0x2c')][_0x24b1('0x2d')]),[_0x24b1('0x2e'),'updatedAt','CompanyId',_0x24b1('0x2f')]);var _0x42df9e=![];if(_0x35be3f[_0x24b1('0x29')]['id']){delete _0x35be3f[_0x24b1('0x29')]['id'];}if(_[_0x24b1('0x30')](_0x35be3f['body']['from'])){return _0x4fdba1(_0x49b547['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x24b1('0x30')](_0x35be3f[_0x24b1('0x29')][_0x24b1('0x29')])||_0x35be3f[_0x24b1('0x29')][_0x24b1('0x29')]===''){return _0x4fdba1(_0x49b547['error'](0x1f4,_0x24b1('0x31')));}if(_[_0x24b1('0x30')](_0x35be3f['body'][_0x24b1('0x32')])){return _0x4fdba1(_0x49b547[_0x24b1('0x16')](0x1f4,_0x24b1('0x33')+_0x140a50));}if(!_['includes'](_0x140a50,_0x35be3f['body']['mapKey'])){return _0x4fdba1(_0x49b547[_0x24b1('0x16')](0x1f4,_0x24b1('0x34')+_0x140a50));}var _0xb87bc={};_0xb87bc[_0x35be3f[_0x24b1('0x29')]['mapKey']]=_0x35be3f[_0x24b1('0x29')]['from'];return db[_0x24b1('0x1c')][_0x24b1('0x26')]({'where':{'id':_0x35be3f[_0x24b1('0x35')]['id']},'include':[{'model':db[_0x24b1('0x36')],'as':_0x24b1('0x37'),'include':[{'model':db[_0x24b1('0x2c')],'as':_0x24b1('0x38'),'where':_0xb87bc,'limit':0x1,'order':[[_0x24b1('0x39'),_0x24b1('0x3a')]]}]},{'model':db[_0x24b1('0x3b')],'as':_0x24b1('0x3c')},{'model':db['MailServerOut'],'as':_0x24b1('0x3d')}]})[_0x24b1('0x12')](function(_0x4c56a3){if(_0x4c56a3&&_0x4c56a3['List']){var _0x4db32c=_0x4c56a3[_0x24b1('0x3e')]({'plain':!![]});_0x317a98[_0x24b1('0x35')]=_[_0x24b1('0x3f')](_0x4db32c,['Applications',_0x24b1('0x37')]);_0x317a98[_0x24b1('0x40')]=_0x4db32c[_0x24b1('0x3c')];_0x317a98['list']=_0x4db32c[_0x24b1('0x37')];_0x317a98[_0x24b1('0x40')]=_['orderBy'](_0x317a98[_0x24b1('0x40')],[_0x24b1('0x41')],[_0x24b1('0x42')]);if(_0x317a98[_0x24b1('0x35')]&&_0x317a98[_0x24b1('0x35')][_0x24b1('0x43')]){_0x317a98[_0x24b1('0x40')][_0x24b1('0x44')]({'id':0x0,'priority':_0x317a98[_0x24b1('0x40')][_0x24b1('0x45')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x317a98[_0x24b1('0x35')][_0x24b1('0x3c')]){delete _0x317a98[_0x24b1('0x35')][_0x24b1('0x3c')];}if(_0x317a98[_0x24b1('0x35')][_0x24b1('0x37')]){delete _0x317a98['account'][_0x24b1('0x37')];}if(_0x4db32c[_0x24b1('0x37')][_0x24b1('0x38')]['length']){return _0x4db32c[_0x24b1('0x37')][_0x24b1('0x38')][0x0];}var _0x1b2ee0=_[_0x24b1('0xc')](_0x35be3f['body'],{'firstName':_0x35be3f[_0x24b1('0x29')]['from'],'ListId':_0x4db32c['ListId']});_0x1b2ee0[_0x35be3f[_0x24b1('0x29')][_0x24b1('0x32')]]=_0x35be3f[_0x24b1('0x29')][_0x24b1('0x46')];return db[_0x24b1('0x2c')][_0x24b1('0x47')](_0x1b2ee0);}else{throw new Error(_0x24b1('0x48'));}})['then'](function(_0x26c51e){_0x317a98[_0x24b1('0x49')]=_0x26c51e;if(_0x26c51e){if(!_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x4a')]){_0x35be3f['body'][_0x24b1('0x18')][_0x24b1('0x4a')]=rs[_0x24b1('0x4b')]()+'\x20'+_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x46')];}var _0x383422={'ContactId':_0x26c51e['id'],'MailAccountId':_0x35be3f[_0x24b1('0x35')]['id'],'inReplyTo':_0x35be3f['body'][_0x24b1('0x18')][_0x24b1('0x4a')],'to':_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x46')],'cc':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['cc'],'subject':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x4c')],'attach':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x4d')],'lastMsgAt':moment()['format'](_0x24b1('0x4e')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x24b1('0x26')]({'where':{'closed':![],'MailAccountId':_0x35be3f[_0x24b1('0x35')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x4f')]}}]})[_0x24b1('0x12')](function(_0x5b3cb6){if(_0x5b3cb6){return[_0x5b3cb6,![]];}return db[_0x24b1('0x50')][_0x24b1('0x47')](_0x383422)[_0x24b1('0x12')](function(_0x592801){return[_0x592801,!![]];});});}else{throw new Error(_0x24b1('0x51'));}})[_0x24b1('0x52')](function(_0x175ce1,_0xe65175){if(_0x175ce1){_0x42df9e=_0xe65175;if(!_0xe65175){return _0x175ce1['update']({'inReplyTo':_0x35be3f['body']['message'][_0x24b1('0x4a')],'to':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x46')],'cc':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['cc'],'subject':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x4c')],'attach':_0x175ce1['attach']?_0x175ce1[_0x24b1('0x4d')]:_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x4d')],'substatus':null,'substatusAt':moment()['format'](_0x24b1('0x4e')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x175ce1;}}})['then'](function(_0x657422){_0x317a98[_0x24b1('0x53')]=_0x657422['get']({'plain':!![]});_0x317a98[_0x24b1('0x53')][_0x24b1('0x54')]=_0x42df9e;return db[_0x24b1('0x55')][_0x24b1('0x47')]({'body':_0x35be3f[_0x24b1('0x29')]['body'],'MailAccountId':_0x35be3f[_0x24b1('0x35')]['id'],'MailInteractionId':_0x657422['id'],'direction':'in','ContactId':_0x317a98['contact']['id'],'messageId':_0x35be3f[_0x24b1('0x29')]['message']['messageId'],'from':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['from'],'to':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['to'],'cc':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['cc'],'subject':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x4c')],'attach':_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x4d')],'Attachments':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')]['attachments'],'originTo':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x56')],'originCc':_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x57')],'bcc':_0x35be3f[_0x24b1('0x29')][_0x24b1('0x18')][_0x24b1('0x58')],'ChatWebsiteId':_0x35be3f['body']['message'][_0x24b1('0x59')]||null,'originChannel':_0x35be3f['body'][_0x24b1('0x18')][_0x24b1('0x5a')]||_0x24b1('0x5b'),'ChatOfflineMessageId':_0x35be3f[_0x24b1('0x29')]['message'][_0x24b1('0x5c')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x24b1('0x12')](function(_0x49d898){_0x317a98[_0x24b1('0x18')]=_0x49d898;if(_0x317a98[_0x24b1('0x53')][_0x24b1('0x5d')]){return db[_0x24b1('0x5e')][_0x24b1('0x26')]({'attributes':['id',_0x24b1('0x5f')],'where':{'id':_0x317a98[_0x24b1('0x53')]['UserId']}})[_0x24b1('0x12')](function(_0x540a62){if(_0x540a62){_0x317a98[_0x24b1('0x40')][_0x24b1('0x60')]({'id':0x0,'priority':0x0,'app':_0x24b1('0x61'),'appdata':_0x540a62[_0x24b1('0x5f')]+','+(_0x317a98[_0x24b1('0x35')][_0x24b1('0x62')]||0xa),'interval':_0x24b1('0x63')});}return respondWithRpcPromise(_0x24b1('0x64'),_0x24b1('0x65'),_0x317a98);});}return respondWithRpcPromise(_0x24b1('0x64'),'startRouting',_0x317a98);})[_0x24b1('0x12')](function(_0x38a1db){_0x4796e1(_0x38a1db);})[_0x24b1('0x1a')](function(_0x21fc8b){_0x4fdba1(_0x49b547[_0x24b1('0x16')](0x1f4,_0x21fc8b[_0x24b1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 0e0a694..006b479 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 _0xb2f3=['mailAccount:','./mailAccount.events','save','remove','update','removeListener','register'];(function(_0x42b05c,_0x24762a){var _0x5de25f=function(_0x467118){while(--_0x467118){_0x42b05c['push'](_0x42b05c['shift']());}};_0x5de25f(++_0x24762a);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xb2f3[_0x2e4e19];return _0x9ba20b;};'use strict';var MailAccountEvents=require(_0x3b2f('0x0'));var events=[_0x3b2f('0x1'),_0x3b2f('0x2'),_0x3b2f('0x3')];function createListener(_0x32cf85,_0xbf059b){return function(_0x409dd5){_0xbf059b['emit'](_0x32cf85,_0x409dd5);};}function removeListener(_0x6748ce,_0x3e35a1){return function(){MailAccountEvents[_0x3b2f('0x4')](_0x6748ce,_0x3e35a1);};}exports[_0x3b2f('0x5')]=function(_0x1879cf){for(var _0xa38042=0x0,_0x26719d=events['length'];_0xa38042<_0x26719d;_0xa38042++){var _0x200ca4=events[_0xa38042];var _0x56e425=createListener(_0x3b2f('0x6')+_0x200ca4,_0x1879cf);MailAccountEvents['on'](_0x200ca4,_0x56e425);}}; \ No newline at end of file +var _0x9f89=['length','mailAccount:','save','update','emit','removeListener','register'];(function(_0x495d17,_0x5ea40d){var _0x5361c6=function(_0x505015){while(--_0x505015){_0x495d17['push'](_0x495d17['shift']());}};_0x5361c6(++_0x5ea40d);}(_0x9f89,0x13d));var _0x99f8=function(_0xd2d514,_0x1f4176){_0xd2d514=_0xd2d514-0x0;var _0x4d0ff3=_0x9f89[_0xd2d514];return _0x4d0ff3;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x99f8('0x0'),'remove',_0x99f8('0x1')];function createListener(_0x416139,_0x292345){return function(_0x1cfadd){_0x292345[_0x99f8('0x2')](_0x416139,_0x1cfadd);};}function removeListener(_0x48c2a1,_0x3507a2){return function(){MailAccountEvents[_0x99f8('0x3')](_0x48c2a1,_0x3507a2);};}exports[_0x99f8('0x4')]=function(_0x7254ad){for(var _0x153726=0x0,_0x24c45f=events[_0x99f8('0x5')];_0x153726<_0x24c45f;_0x153726++){var _0x597101=events[_0x153726];var _0x22c84d=createListener(_0x99f8('0x6')+_0x597101,_0x7254ad);MailAccountEvents['on'](_0x597101,_0x22c84d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 0b4d207..3dc4e0a 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 _0x5491=['../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x396d2a,_0x2e4409){var _0x10428e=function(_0x327feb){while(--_0x327feb){_0x396d2a['push'](_0x396d2a['shift']());}};_0x10428e(++_0x2e4409);}(_0x5491,0x11f));var _0x1549=function(_0x10f027,_0x1fed60){_0x10f027=_0x10f027-0x0;var _0x5eeeac=_0x5491[_0x10f027];return _0x5eeeac;};'use strict';var multer=require(_0x1549('0x0'));var util=require(_0x1549('0x1'));var path=require(_0x1549('0x2'));var timeout=require(_0x1549('0x3'));var express=require('express');var router=express[_0x1549('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1549('0x5'));var interaction=require(_0x1549('0x6'));var config=require(_0x1549('0x7'));var controller=require(_0x1549('0x8'));router[_0x1549('0x9')](_0x1549('0xa'),auth[_0x1549('0xb')](),controller['show']);router[_0x1549('0xc')](_0x1549('0xa'),auth[_0x1549('0xb')](),controller[_0x1549('0xd')]);router['delete'](_0x1549('0xa'),auth[_0x1549('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x67df=['get','/:id','isAuthenticated','show','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller'];(function(_0x2a9a39,_0x48ad65){var _0x28b699=function(_0x253bf3){while(--_0x253bf3){_0x2a9a39['push'](_0x2a9a39['shift']());}};_0x28b699(++_0x48ad65);}(_0x67df,0x124));var _0xf67d=function(_0x200f23,_0xa2e08f){_0x200f23=_0x200f23-0x0;var _0x34048b=_0x67df[_0x200f23];return _0x34048b;};'use strict';var multer=require(_0xf67d('0x0'));var util=require('util');var path=require(_0xf67d('0x1'));var timeout=require(_0xf67d('0x2'));var express=require('express');var router=express[_0xf67d('0x3')]();var fs_extra=require(_0xf67d('0x4'));var auth=require(_0xf67d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf67d('0x6'));var controller=require(_0xf67d('0x7'));router[_0xf67d('0x8')](_0xf67d('0x9'),auth[_0xf67d('0xa')](),controller[_0xf67d('0xb')]);router['put'](_0xf67d('0x9'),auth[_0xf67d('0xa')](),controller[_0xf67d('0xc')]);router[_0xf67d('0xd')](_0xf67d('0x9'),auth[_0xf67d('0xa')](),controller[_0xf67d('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a6ebefa..4b1d043 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 _0x8e18=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x914578,_0x564dcf){var _0x41ee7e=function(_0x577ab1){while(--_0x577ab1){_0x914578['push'](_0x914578['shift']());}};_0x41ee7e(++_0x564dcf);}(_0x8e18,0x124));var _0x88e1=function(_0xb4f825,_0x1c3696){_0xb4f825=_0xb4f825-0x0;var _0x4abbd7=_0x8e18[_0xb4f825];return _0x4abbd7;};'use strict';var Sequelize=require('sequelize');module[_0x88e1('0x0')]={'priority':{'type':Sequelize[_0x88e1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x88e1('0x2')},'appdata':{'type':Sequelize[_0x88e1('0x3')]()},'description':{'type':Sequelize[_0x88e1('0x4')]},'interval':{'type':Sequelize[_0x88e1('0x4')],'defaultValue':_0x88e1('0x5')}}; \ No newline at end of file +var _0x8a3c=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x543e69,_0x324620){var _0x3250d2=function(_0x540f54){while(--_0x540f54){_0x543e69['push'](_0x543e69['shift']());}};_0x3250d2(++_0x324620);}(_0x8a3c,0x1c3));var _0xc8a3=function(_0x19fab3,_0x2379c7){_0x19fab3=_0x19fab3-0x0;var _0x3ed5f7=_0x8a3c[_0x19fab3];return _0x3ed5f7;};'use strict';var Sequelize=require(_0xc8a3('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc8a3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc8a3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc8a3('0x3')]()},'description':{'type':Sequelize[_0xc8a3('0x2')]},'interval':{'type':Sequelize[_0xc8a3('0x2')],'defaultValue':_0xc8a3('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b675804..0272e60 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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x5c2cfc,_0x225457){var _0x39ef01=function(_0x2b507b){while(--_0x2b507b){_0x5c2cfc['push'](_0x5c2cfc['shift']());}};_0x39ef01(++_0x225457);}(_0xe706,0xa3));var _0x6e70=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xe706[_0x41582d];return _0x59c504;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2f8ea0,_0x560ea7){var _0xa84360=function(_0x1378e8){while(--_0x1378e8){_0x2f8ea0['push'](_0x2f8ea0['shift']());}};_0xa84360(++_0x560ea7);}(_0x54ef,0x112));var _0xf54e=function(_0x2edfc1,_0x3d1539){_0x2edfc1=_0x2edfc1-0x0;var _0x45f187=_0x54ef[_0x2edfc1];return _0x45f187;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 70c236b..5037fbb 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 _0xa294=['path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise'];(function(_0x20b7ab,_0x14bf28){var _0x13f5bc=function(_0x474a5a){while(--_0x474a5a){_0x20b7ab['push'](_0x20b7ab['shift']());}};_0x13f5bc(++_0x14bf28);}(_0xa294,0x1ca));var _0x4a29=function(_0x1a66aa,_0x7c9aec){_0x1a66aa=_0x1a66aa-0x0;var _0x1561a8=_0xa294[_0x1a66aa];return _0x1561a8;};'use strict';var _=require(_0x4a29('0x0'));var util=require('util');var logger=require(_0x4a29('0x1'))('api');var moment=require(_0x4a29('0x2'));var BPromise=require('bluebird');var rp=require(_0x4a29('0x3'));var fs=require('fs');var path=require(_0x4a29('0x4'));var rimraf=require(_0x4a29('0x5'));var config=require(_0x4a29('0x6'));var attributes=require(_0x4a29('0x7'));module[_0x4a29('0x8')]=function(_0x2ceb43,_0x41e12d){return _0x2ceb43[_0x4a29('0x9')](_0x4a29('0xa'),attributes,{'tableName':_0x4a29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a29('0xc'),'collate':_0x4a29('0xd')});}; \ No newline at end of file +var _0x3a34=['./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x19d2e2,_0x39e08a){var _0x1da833=function(_0x2ba050){while(--_0x2ba050){_0x19d2e2['push'](_0x19d2e2['shift']());}};_0x1da833(++_0x39e08a);}(_0x3a34,0x10a));var _0x43a3=function(_0x4bf604,_0x150a6a){_0x4bf604=_0x4bf604-0x0;var _0x7fa56a=_0x3a34[_0x4bf604];return _0x7fa56a;};'use strict';var _=require(_0x43a3('0x0'));var util=require(_0x43a3('0x1'));var logger=require(_0x43a3('0x2'))('api');var moment=require(_0x43a3('0x3'));var BPromise=require('bluebird');var rp=require(_0x43a3('0x4'));var fs=require('fs');var path=require(_0x43a3('0x5'));var rimraf=require(_0x43a3('0x6'));var config=require('../../config/environment');var attributes=require(_0x43a3('0x7'));module[_0x43a3('0x8')]=function(_0x4ab80f,_0x13206e){return _0x4ab80f[_0x43a3('0x9')]('MailApplication',attributes,{'tableName':_0x43a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43a3('0xb'),'collate':_0x43a3('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7f525bc..1694ffb 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 _0x56c8=['../../config/logger','rpc','jayson/promise','client','http','request','then','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailApplication,\x20%s,\x20%s','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x56c8,0x12f));var _0x856c=function(_0xb4718b,_0x4549fd){_0xb4718b=_0xb4718b-0x0;var _0x3b0b29=_0x56c8[_0xb4718b];return _0x3b0b29;};'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']('MailApplication,\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);});});}exports[_0x856c('0x17')]=function(_0xf24755){var _0x44cb08=this;return new Promise(function(_0x417cd3,_0x28ea3f){return db[_0x856c('0x18')][_0x856c('0x19')](_0xf24755[_0x856c('0x1a')],{'raw':_0xf24755[_0x856c('0x1b')]?_0xf24755[_0x856c('0x1b')][_0x856c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf24755[_0x856c('0x1b')]?_0xf24755['options']['where']||null:null,'attributes':_0xf24755[_0x856c('0x1b')]?_0xf24755[_0x856c('0x1b')][_0x856c('0x1d')]||null:null,'limit':_0xf24755['options']?_0xf24755[_0x856c('0x1b')]['limit']||null:null})[_0x856c('0xd')](function(_0x372f60){logger[_0x856c('0x14')]('UpdateMailApplication',_0xf24755);logger[_0x856c('0xe')](_0x856c('0x17'),_0xf24755,JSON[_0x856c('0x1e')](_0x372f60));_0x417cd3(_0x372f60);})[_0x856c('0x16')](function(_0x901a0c){logger[_0x856c('0x11')]('UpdateMailApplication',_0x901a0c[_0x856c('0x13')],_0xf24755);_0x28ea3f(_0x44cb08[_0x856c('0x11')](0x1f4,_0x901a0c[_0x856c('0x13')]));});});}; \ No newline at end of file +var _0xcb5d=['request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','MailApplication,\x20%s,\x20%s'];(function(_0x9f24a7,_0x546df7){var _0x26be17=function(_0x5eecae){while(--_0x5eecae){_0x9f24a7['push'](_0x9f24a7['shift']());}};_0x26be17(++_0x546df7);}(_0xcb5d,0x1b6));var _0xdcb5=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0xcb5d[_0x515afd];return _0x536d53;};'use strict';var _=require(_0xdcb5('0x0'));var util=require(_0xdcb5('0x1'));var moment=require('moment');var BPromise=require(_0xdcb5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcb5('0x3'))['db'];var utils=require(_0xdcb5('0x4'));var logger=require(_0xdcb5('0x5'))(_0xdcb5('0x6'));var config=require(_0xdcb5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdcb5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ebbd,_0x2b5366,_0x292178){return new BPromise(function(_0x6e8c7,_0x369e3f){return client[_0xdcb5('0x9')](_0x25ebbd,_0x292178)['then'](function(_0x4d4295){logger[_0xdcb5('0xa')](_0xdcb5('0xb'),_0x2b5366,_0xdcb5('0xc'));logger[_0xdcb5('0xd')](_0xdcb5('0xe'),_0x2b5366,_0xdcb5('0xc'),JSON[_0xdcb5('0xf')](_0x4d4295));if(_0x4d4295[_0xdcb5('0x10')]){if(_0x4d4295['error']['code']===0x1f4){logger[_0xdcb5('0x10')](_0xdcb5('0xb'),_0x2b5366,_0x4d4295[_0xdcb5('0x10')][_0xdcb5('0x11')]);return _0x369e3f(_0x4d4295[_0xdcb5('0x10')]['message']);}logger[_0xdcb5('0x10')](_0xdcb5('0xb'),_0x2b5366,_0x4d4295[_0xdcb5('0x10')][_0xdcb5('0x11')]);return _0x6e8c7(_0x4d4295['error'][_0xdcb5('0x11')]);}else{logger[_0xdcb5('0xa')](_0xdcb5('0xb'),_0x2b5366,_0xdcb5('0xc'));_0x6e8c7(_0x4d4295[_0xdcb5('0x12')][_0xdcb5('0x11')]);}})[_0xdcb5('0x13')](function(_0x543707){logger[_0xdcb5('0x10')]('MailApplication,\x20%s,\x20%s',_0x2b5366,_0x543707);_0x369e3f(_0x543707);});});}exports[_0xdcb5('0x14')]=function(_0x40a24c){var _0x55ed02=this;return new Promise(function(_0x259ad6,_0x2c1721){return db[_0xdcb5('0x15')][_0xdcb5('0x16')](_0x40a24c[_0xdcb5('0x17')],{'raw':_0x40a24c['options']?_0x40a24c[_0xdcb5('0x18')][_0xdcb5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40a24c[_0xdcb5('0x18')]?_0x40a24c[_0xdcb5('0x18')][_0xdcb5('0x1a')]||null:null,'attributes':_0x40a24c[_0xdcb5('0x18')]?_0x40a24c['options'][_0xdcb5('0x1b')]||null:null,'limit':_0x40a24c[_0xdcb5('0x18')]?_0x40a24c['options'][_0xdcb5('0x1c')]||null:null})[_0xdcb5('0x1d')](function(_0x44cea0){logger['info'](_0xdcb5('0x14'),_0x40a24c);logger[_0xdcb5('0xd')](_0xdcb5('0x14'),_0x40a24c,JSON['stringify'](_0x44cea0));_0x259ad6(_0x44cea0);})[_0xdcb5('0x13')](function(_0x5154cc){logger[_0xdcb5('0x10')]('UpdateMailApplication',_0x5154cc[_0xdcb5('0x11')],_0x40a24c);_0x2c1721(_0x55ed02[_0xdcb5('0x10')](0x1f4,_0x5154cc[_0xdcb5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2535385..24b0eb2 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 _0x6b99=['mailinteraction:addtags','addTags','mailinteraction:update','delete','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mail'];(function(_0x3896af,_0x2bd2c0){var _0x5b7835=function(_0x3e62d1){while(--_0x3e62d1){_0x3896af['push'](_0x3896af['shift']());}};_0x5b7835(++_0x2bd2c0);}(_0x6b99,0x172));var _0x96b9=function(_0xf43cb,_0x465374){_0xf43cb=_0xf43cb-0x0;var _0x14e869=_0x6b99[_0xf43cb];return _0x14e869;};'use strict';var express=require(_0x96b9('0x0'));var router=express[_0x96b9('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x96b9('0x2'));var controller=require(_0x96b9('0x3'));router[_0x96b9('0x4')]('/',auth['isAuthenticated'](),controller[_0x96b9('0x5')]);router['get'](_0x96b9('0x6'),auth[_0x96b9('0x7')](),controller[_0x96b9('0x8')]);router[_0x96b9('0x4')](_0x96b9('0x9'),auth[_0x96b9('0x7')](),controller[_0x96b9('0xa')]);router[_0x96b9('0x4')](_0x96b9('0xb'),auth[_0x96b9('0x7')](),controller[_0x96b9('0xc')]);router['get']('/:id/download',auth[_0x96b9('0x7')](),controller[_0x96b9('0xd')]);router[_0x96b9('0xe')]('/',auth[_0x96b9('0x7')](),controller[_0x96b9('0xf')]);router[_0x96b9('0xe')](_0x96b9('0xb'),auth['isAuthenticated'](),controller[_0x96b9('0x10')]);router[_0x96b9('0xe')](_0x96b9('0x11'),auth[_0x96b9('0x7')](),interaction[_0x96b9('0x12')](_0x96b9('0x13'),_0x96b9('0x14')),controller[_0x96b9('0x15')]);router['put']('/:id',auth[_0x96b9('0x7')](),interaction[_0x96b9('0x12')]('mail',_0x96b9('0x16')),controller['update']);router[_0x96b9('0x17')](_0x96b9('0x9'),auth[_0x96b9('0x7')](),interaction[_0x96b9('0x12')](_0x96b9('0x13'),'mailinteraction:destroy'),controller['destroy']);router[_0x96b9('0x17')](_0x96b9('0x11'),auth[_0x96b9('0x7')](),controller[_0x96b9('0x18')]);module[_0x96b9('0x19')]=router; \ No newline at end of file +var _0xf7c5=['get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','./mailInteraction.controller'];(function(_0x8ffcae,_0x4c62b6){var _0x56e5a5=function(_0x575909){while(--_0x575909){_0x8ffcae['push'](_0x8ffcae['shift']());}};_0x56e5a5(++_0x4c62b6);}(_0xf7c5,0x174));var _0x5f7c=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0xf7c5[_0x2af3e1];return _0xfa27d;};'use strict';var express=require(_0x5f7c('0x0'));var router=express[_0x5f7c('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x5f7c('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5f7c('0x3')](_0x5f7c('0x4'),auth[_0x5f7c('0x5')](),controller[_0x5f7c('0x6')]);router[_0x5f7c('0x3')]('/:id',auth[_0x5f7c('0x5')](),controller[_0x5f7c('0x7')]);router['get'](_0x5f7c('0x8'),auth[_0x5f7c('0x5')](),controller[_0x5f7c('0x9')]);router[_0x5f7c('0x3')](_0x5f7c('0xa'),auth[_0x5f7c('0x5')](),controller['download']);router[_0x5f7c('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f7c('0xb')](_0x5f7c('0x8'),auth[_0x5f7c('0x5')](),controller[_0x5f7c('0xc')]);router[_0x5f7c('0xb')](_0x5f7c('0xd'),auth[_0x5f7c('0x5')](),interaction[_0x5f7c('0xe')](_0x5f7c('0xf'),_0x5f7c('0x10')),controller[_0x5f7c('0x11')]);router['put'](_0x5f7c('0x12'),auth[_0x5f7c('0x5')](),interaction[_0x5f7c('0xe')](_0x5f7c('0xf'),_0x5f7c('0x13')),controller['update']);router[_0x5f7c('0x14')]('/:id',auth[_0x5f7c('0x5')](),interaction['tracked']('mail',_0x5f7c('0x15')),controller[_0x5f7c('0x16')]);router[_0x5f7c('0x14')](_0x5f7c('0xd'),auth[_0x5f7c('0x5')](),controller[_0x5f7c('0x17')]);module[_0x5f7c('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4999163..ff482d3 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 _0x17fa=['out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x231574,_0x2edd25){var _0x504f5d=function(_0x32d270){while(--_0x32d270){_0x231574['push'](_0x231574['shift']());}};_0x504f5d(++_0x2edd25);}(_0x17fa,0x89));var _0xa17f=function(_0x449829,_0x4f7db8){_0x449829=_0x449829-0x0;var _0x403ac4=_0x17fa[_0x449829];return _0x403ac4;};'use strict';var Sequelize=require(_0xa17f('0x0'));var iconv=require('iconv');module[_0xa17f('0x1')]={'closed':{'type':Sequelize[_0xa17f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa17f('0x3')]},'disposition':{'type':Sequelize[_0xa17f('0x4')]},'secondDisposition':{'type':Sequelize[_0xa17f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa17f('0x4')]},'inReplyTo':{'type':Sequelize[_0xa17f('0x4')](0x1fe)},'to':{'type':Sequelize[_0xa17f('0x4')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xa17f('0x5')]()},'attach':{'type':Sequelize[_0xa17f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xa17f('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xa17f('0x6')]('in',_0xa17f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa17f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa17f('0x6')]('in',_0xa17f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa17f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd02=['DATE','STRING','long','TEXT','ENUM','sequelize','exports','BOOLEAN'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfd02,0xbd));var _0x2fd0=function(_0x1ad5a2,_0x45632b){_0x1ad5a2=_0x1ad5a2-0x0;var _0x51eba3=_0xfd02[_0x1ad5a2];return _0x51eba3;};'use strict';var Sequelize=require(_0x2fd0('0x0'));var iconv=require('iconv');module[_0x2fd0('0x1')]={'closed':{'type':Sequelize[_0x2fd0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2fd0('0x3')]},'disposition':{'type':Sequelize[_0x2fd0('0x4')]},'secondDisposition':{'type':Sequelize[_0x2fd0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2fd0('0x4')]},'note':{'type':Sequelize[_0x2fd0('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x2fd0('0x5'))},'subject':{'type':Sequelize[_0x2fd0('0x6')]()},'attach':{'type':Sequelize[_0x2fd0('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2fd0('0x3')]},'substatus':{'type':Sequelize[_0x2fd0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x2fd0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2fd0('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2fd0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2fd0('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2fd0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b0d0368..e54127f 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 _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0xb10b[_0x2fc113];return _0x5144ce;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ba71b,_0xfa5ab){_0x1ba71b=_0x1ba71b-0x0;var _0x386eed=_0xb10b[_0x1ba71b];return _0x386eed;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b988217..4ef6864 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 _0xd8e0=['emit','catch','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x97a737,_0x5663e9){var _0x1a7463=function(_0x491656){while(--_0x491656){_0x97a737['push'](_0x97a737['shift']());}};_0x1a7463(++_0x5663e9);}(_0xd8e0,0x111));var _0x0d8e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd8e0[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x0d8e('0x0'));var MailInteraction=require(_0x0d8e('0x1'))['db'][_0x0d8e('0x2')];var MailMessage=require(_0x0d8e('0x1'))['db'][_0x0d8e('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0d8e('0x4')](0x0);var events={'afterCreate':_0x0d8e('0x5'),'afterUpdate':_0x0d8e('0x6'),'afterDestroy':_0x0d8e('0x7')};function emitEvent(_0x9349b3){return function(_0x11cd41,_0x8d4040,_0x2e80da){_0x11cd41[_0x0d8e('0x8')]({'attributes':['id'],'raw':!![]})[_0x0d8e('0x9')](function(_0x37a624){_0x11cd41[_0x0d8e('0xa')](_0x0d8e('0xb'),_0x37a624['map'](function(_0x178010){return{'id':_0x178010['id']};}));return MailMessage[_0x0d8e('0xc')]({'where':{'MailInteractionId':_0x11cd41['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0d8e('0x9')](function(_0xfa6994){_0x11cd41['setDataValue'](_0x0d8e('0xd'),_0xfa6994[_0x0d8e('0xe')]);MailInteractionEvents[_0x0d8e('0xf')](_0x9349b3+':'+_0x11cd41['id'],_0x11cd41);MailInteractionEvents[_0x0d8e('0xf')](_0x9349b3,_0x11cd41);_0x2e80da(null);})[_0x0d8e('0x10')](_0x2e80da(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x0d8e('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xe0ad=['emit','catch','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','Users','setDataValue'];(function(_0x3cdba4,_0x38853d){var _0x5b35bc=function(_0x3d77e7){while(--_0x3d77e7){_0x3cdba4['push'](_0x3cdba4['shift']());}};_0x5b35bc(++_0x38853d);}(_0xe0ad,0xab));var _0xde0a=function(_0x5a4199,_0x2bc3d8){_0x5a4199=_0x5a4199-0x0;var _0x478ed0=_0xe0ad[_0x5a4199];return _0x478ed0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xde0a('0x0'))['db'][_0xde0a('0x1')];var MailMessage=require(_0xde0a('0x0'))['db'][_0xde0a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xde0a('0x3')](0x0);var events={'afterCreate':_0xde0a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4599bd){return function(_0x50d83f,_0x1359a4,_0x178bb7){_0x50d83f[_0xde0a('0x5')]({'attributes':['id'],'raw':!![]})[_0xde0a('0x6')](function(_0x568095){_0x50d83f['setDataValue'](_0xde0a('0x7'),_0x568095['map'](function(_0x3b63ef){return{'id':_0x3b63ef['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x50d83f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1f199d){_0x50d83f[_0xde0a('0x8')]('unreadMessages',_0x1f199d['length']);MailInteractionEvents[_0xde0a('0x9')](_0x4599bd+':'+_0x50d83f['id'],_0x50d83f);MailInteractionEvents[_0xde0a('0x9')](_0x4599bd,_0x50d83f);_0x178bb7(null);})[_0xde0a('0xa')](_0x178bb7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xde0a('0xb')](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 d1ae03a..76b9010 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 _0xa6bc=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','subject','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','substatus','substatusAt','changed','get','then','catch'];(function(_0x505f0f,_0x247dbe){var _0x57af=function(_0xa2d9f4){while(--_0xa2d9f4){_0x505f0f['push'](_0x505f0f['shift']());}};_0x57af(++_0x247dbe);}(_0xa6bc,0x16a));var _0xca6b=function(_0xb6afe,_0x38671f){_0xb6afe=_0xb6afe-0x0;var _0x335218=_0xa6bc[_0xb6afe];return _0x335218;};'use strict';var _=require('lodash');var util=require(_0xca6b('0x0'));var logger=require(_0xca6b('0x1'))('api');var moment=require(_0xca6b('0x2'));var BPromise=require(_0xca6b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca6b('0x4'));var rimraf=require(_0xca6b('0x5'));var config=require(_0xca6b('0x6'));var attributes=require(_0xca6b('0x7'));module[_0xca6b('0x8')]=function(_0x4687b4,_0x24e5fc){return _0x4687b4[_0xca6b('0x9')]('MailInteraction',attributes,{'tableName':_0xca6b('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xca6b('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x492401,_0x8a1e86,_0x334104){if(_0x492401['substatus']){_0x492401['substatusAt']=moment()[_0xca6b('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x492401[_0xca6b('0xd')]){_0x492401[_0xca6b('0xe')]=moment()['format'](_0xca6b('0xf'));}_0x334104(null,_0x8a1e86);},'beforeUpdate':function(_0x36f3cb,_0xe9198b,_0x1b46ca){if(_0x36f3cb['changed'](_0xca6b('0x10'))){_0x36f3cb[_0xca6b('0x11')]=_0x36f3cb[_0xca6b('0x10')]?moment()[_0xca6b('0xc')](_0xca6b('0xf')):null;}if(_0x36f3cb[_0xca6b('0x12')](_0xca6b('0xd'))){_0x36f3cb[_0xca6b('0xe')]=moment()[_0xca6b('0xc')](_0xca6b('0xf'));_0x36f3cb[_0xca6b('0x10')]=null;_0x36f3cb['substatusAt']=null;}_0x1b46ca(null,_0x36f3cb);},'afterUpdate':function(_0x486861,_0x50538c,_0x1e4c30){var _0x4cf5ef=_0x4687b4['models'];var _0x3ec9b2=_0x486861[_0xca6b('0x13')]({'plain':!![]});if(_0x3ec9b2[_0xca6b('0xd')]){return _0x4cf5ef['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x3ec9b2['id']}})[_0xca6b('0x14')](function(){_0x1e4c30();})[_0xca6b('0x15')](function(_0x3c0ee1){_0x1e4c30(_0x3c0ee1);});}else{_0x1e4c30();}}},'charset':_0xca6b('0x16'),'collate':_0xca6b('0x17')});}; \ No newline at end of file +var _0x2e32=['MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get'];(function(_0x4ab924,_0xc6f891){var _0x29647d=function(_0x13186b){while(--_0x13186b){_0x4ab924['push'](_0x4ab924['shift']());}};_0x29647d(++_0xc6f891);}(_0x2e32,0x1e2));var _0x22e3=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2e32[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x22e3('0x0'));var util=require(_0x22e3('0x1'));var logger=require(_0x22e3('0x2'))(_0x22e3('0x3'));var moment=require(_0x22e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x22e3('0x5'));var config=require(_0x22e3('0x6'));var attributes=require(_0x22e3('0x7'));module['exports']=function(_0x4dc3aa,_0x389c77){return _0x4dc3aa[_0x22e3('0x8')](_0x22e3('0x9'),attributes,{'tableName':_0x22e3('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x22e3('0xb'),'to'],'type':_0x22e3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d07ad,_0x243f13,_0x5aa19b){if(_0x2d07ad['substatus']){_0x2d07ad[_0x22e3('0xd')]=moment()[_0x22e3('0xe')](_0x22e3('0xf'));}if(_0x2d07ad[_0x22e3('0x10')]){_0x2d07ad[_0x22e3('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5aa19b(null,_0x243f13);},'beforeUpdate':function(_0x52c3d4,_0x565c14,_0x22139e){if(_0x52c3d4[_0x22e3('0x12')](_0x22e3('0x13'))){_0x52c3d4[_0x22e3('0xd')]=_0x52c3d4['substatus']?moment()[_0x22e3('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x52c3d4[_0x22e3('0x12')](_0x22e3('0x10'))){_0x52c3d4[_0x22e3('0x11')]=moment()[_0x22e3('0xe')](_0x22e3('0xf'));_0x52c3d4[_0x22e3('0x13')]=null;_0x52c3d4[_0x22e3('0xd')]=null;}_0x22139e(null,_0x52c3d4);},'afterUpdate':function(_0x186894,_0x4e42a5,_0x1331ec){var _0x2d1dfd=_0x4dc3aa[_0x22e3('0x14')];var _0x4570fd=_0x186894[_0x22e3('0x15')]({'plain':!![]});if(_0x4570fd[_0x22e3('0x10')]){return _0x2d1dfd[_0x22e3('0x16')][_0x22e3('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4570fd['id']}})[_0x22e3('0x18')](function(){_0x1331ec();})[_0x22e3('0x19')](function(_0x2e0114){_0x1331ec(_0x2e0114);});}else{_0x1331ec();}}},'charset':_0x22e3('0x1a'),'collate':_0x22e3('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 6f7458e..2fb0ba5 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 _0xc624=['MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','limit','then','AddTagsToMailInteraction','where','addTags','ids','omit','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xc624,0x65));var _0x4c62=function(_0x4afb1f,_0x739e5a){_0x4afb1f=_0x4afb1f-0x0;var _0x316d7d=_0xc624[_0x4afb1f];return _0x316d7d;};'use strict';var _=require(_0x4c62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4c62('0x1'));var rs=require(_0x4c62('0x2'));var fs=require('fs');var Redis=require(_0x4c62('0x3'));var db=require(_0x4c62('0x4'))['db'];var utils=require(_0x4c62('0x5'));var logger=require('../../config/logger')(_0x4c62('0x6'));var config=require(_0x4c62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c62('0x8')][_0x4c62('0x9')]({'port':0x232a});config[_0x4c62('0xa')]=_[_0x4c62('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c62('0xc'))(new Redis(config[_0x4c62('0xa')]));require(_0x4c62('0xd'))[_0x4c62('0xe')](socket);function respondWithRpcPromise(_0x3cc924,_0x428ffa,_0x3bc592){return new BPromise(function(_0x35a19e,_0x350899){return client[_0x4c62('0xf')](_0x3cc924,_0x3bc592)['then'](function(_0x1a3f4a){logger['info'](_0x4c62('0x10'),_0x428ffa,_0x4c62('0x11'));logger[_0x4c62('0x12')](_0x4c62('0x13'),_0x428ffa,_0x4c62('0x11'),JSON[_0x4c62('0x14')](_0x1a3f4a));if(_0x1a3f4a['error']){if(_0x1a3f4a[_0x4c62('0x15')][_0x4c62('0x16')]===0x1f4){logger[_0x4c62('0x15')](_0x4c62('0x10'),_0x428ffa,_0x1a3f4a[_0x4c62('0x15')][_0x4c62('0x17')]);return _0x350899(_0x1a3f4a[_0x4c62('0x15')][_0x4c62('0x17')]);}logger[_0x4c62('0x15')](_0x4c62('0x10'),_0x428ffa,_0x1a3f4a[_0x4c62('0x15')]['message']);return _0x35a19e(_0x1a3f4a[_0x4c62('0x15')][_0x4c62('0x17')]);}else{logger[_0x4c62('0x18')](_0x4c62('0x10'),_0x428ffa,'request\x20sent');_0x35a19e(_0x1a3f4a[_0x4c62('0x19')][_0x4c62('0x17')]);}})[_0x4c62('0x1a')](function(_0x4877cd){logger['error'](_0x4c62('0x10'),_0x428ffa,_0x4877cd);_0x350899(_0x4877cd);});});}exports[_0x4c62('0x1b')]=function(_0x5aa148){var _0x1f60a8=this;return new Promise(function(_0x5a1080,_0x263d7c){return db[_0x4c62('0x1c')]['update'](_0x5aa148[_0x4c62('0x1d')],{'raw':_0x5aa148[_0x4c62('0x1e')]?_0x5aa148[_0x4c62('0x1e')][_0x4c62('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa148[_0x4c62('0x1e')]?_0x5aa148['options']['where']||null:null,'attributes':_0x5aa148['options']?_0x5aa148[_0x4c62('0x1e')]['attributes']||null:null,'limit':_0x5aa148['options']?_0x5aa148[_0x4c62('0x1e')][_0x4c62('0x20')]||null:null})[_0x4c62('0x21')](function(_0x17c84f){logger[_0x4c62('0x18')](_0x4c62('0x1b'),_0x5aa148);logger[_0x4c62('0x12')]('UpdateMailInteraction',_0x5aa148,JSON[_0x4c62('0x14')](_0x17c84f));_0x5a1080(_0x17c84f);})['catch'](function(_0x2d23ac){logger[_0x4c62('0x15')](_0x4c62('0x1b'),_0x2d23ac[_0x4c62('0x17')],_0x5aa148);_0x263d7c(_0x1f60a8['error'](0x1f4,_0x2d23ac['message']));});});};exports[_0x4c62('0x22')]=function(_0x5343a6){return new Promise(function(_0x1f73bd,_0x54a68b){return db['MailInteraction']['find']({'where':_0x5343a6['options']?_0x5343a6['options'][_0x4c62('0x23')]||null:null})[_0x4c62('0x21')](function(_0x380da0){if(_0x380da0){return _0x380da0[_0x4c62('0x24')](_0x5343a6[_0x4c62('0x1d')][_0x4c62('0x25')],_[_0x4c62('0x26')](_0x5343a6[_0x4c62('0x1d')],['ids','id'])||{});}})['spread'](function(_0x31c930){logger[_0x4c62('0x18')]('AddTags',_0x5343a6);logger[_0x4c62('0x12')](_0x4c62('0x27'),_0x5343a6,JSON[_0x4c62('0x14')](_0x31c930));_0x1f73bd(_0x31c930);})['catch'](function(_0x2d2d09){logger[_0x4c62('0x15')]('AddTags',_0x2d2d09[_0x4c62('0x17')],_0x5343a6);_0x54a68b(_this[_0x4c62('0x15')](0x1f4,_0x2d2d09['message']));});});}; \ No newline at end of file +var _0x0755=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateMailInteraction','update','options','where','attributes','limit','AddTagsToMailInteraction','MailInteraction','addTags','body','omit','ids','info'];(function(_0x67907,_0xbbb151){var _0x4724b6=function(_0x2bdec7){while(--_0x2bdec7){_0x67907['push'](_0x67907['shift']());}};_0x4724b6(++_0xbbb151);}(_0x0755,0x7c));var _0x5075=function(_0x5626f5,_0x4291fa){_0x5626f5=_0x5626f5-0x0;var _0x2a6e1e=_0x0755[_0x5626f5];return _0x2a6e1e;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var moment=require(_0x5075('0x2'));var BPromise=require(_0x5075('0x3'));var rs=require(_0x5075('0x4'));var fs=require('fs');var Redis=require(_0x5075('0x5'));var db=require(_0x5075('0x6'))['db'];var utils=require(_0x5075('0x7'));var logger=require(_0x5075('0x8'))(_0x5075('0x9'));var config=require('../../config/environment');var jayson=require(_0x5075('0xa'));var client=jayson[_0x5075('0xb')][_0x5075('0xc')]({'port':0x232a});config[_0x5075('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5075('0xe'))(new Redis(config[_0x5075('0xd')]));require('./mailInteraction.socket')[_0x5075('0xf')](socket);function respondWithRpcPromise(_0x4f1eaa,_0x53409b,_0x2c0979){return new BPromise(function(_0x4dab6e,_0x537da8){return client[_0x5075('0x10')](_0x4f1eaa,_0x2c0979)[_0x5075('0x11')](function(_0x252773){logger['info'](_0x5075('0x12'),_0x53409b,'request\x20sent');logger[_0x5075('0x13')](_0x5075('0x14'),_0x53409b,_0x5075('0x15'),JSON[_0x5075('0x16')](_0x252773));if(_0x252773[_0x5075('0x17')]){if(_0x252773[_0x5075('0x17')][_0x5075('0x18')]===0x1f4){logger[_0x5075('0x17')](_0x5075('0x12'),_0x53409b,_0x252773[_0x5075('0x17')][_0x5075('0x19')]);return _0x537da8(_0x252773[_0x5075('0x17')][_0x5075('0x19')]);}logger['error'](_0x5075('0x12'),_0x53409b,_0x252773[_0x5075('0x17')][_0x5075('0x19')]);return _0x4dab6e(_0x252773[_0x5075('0x17')][_0x5075('0x19')]);}else{logger['info'](_0x5075('0x12'),_0x53409b,_0x5075('0x15'));_0x4dab6e(_0x252773['result'][_0x5075('0x19')]);}})[_0x5075('0x1a')](function(_0xcea172){logger[_0x5075('0x17')]('MailInteraction,\x20%s,\x20%s',_0x53409b,_0xcea172);_0x537da8(_0xcea172);});});}exports[_0x5075('0x1b')]=function(_0x5e4f40){var _0x3d6c11=this;return new Promise(function(_0x55f829,_0x17382e){return db['MailInteraction'][_0x5075('0x1c')](_0x5e4f40['body'],{'raw':_0x5e4f40[_0x5075('0x1d')]?_0x5e4f40[_0x5075('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4f40['options']?_0x5e4f40['options'][_0x5075('0x1e')]||null:null,'attributes':_0x5e4f40[_0x5075('0x1d')]?_0x5e4f40[_0x5075('0x1d')][_0x5075('0x1f')]||null:null,'limit':_0x5e4f40[_0x5075('0x1d')]?_0x5e4f40['options'][_0x5075('0x20')]||null:null})[_0x5075('0x11')](function(_0x1b67c6){logger['info'](_0x5075('0x1b'),_0x5e4f40);logger[_0x5075('0x13')]('UpdateMailInteraction',_0x5e4f40,JSON[_0x5075('0x16')](_0x1b67c6));_0x55f829(_0x1b67c6);})[_0x5075('0x1a')](function(_0x1340ea){logger[_0x5075('0x17')]('UpdateMailInteraction',_0x1340ea['message'],_0x5e4f40);_0x17382e(_0x3d6c11['error'](0x1f4,_0x1340ea[_0x5075('0x19')]));});});};exports[_0x5075('0x21')]=function(_0x5652db){return new Promise(function(_0x1ddccd,_0x36dbf7){return db[_0x5075('0x22')]['find']({'where':_0x5652db[_0x5075('0x1d')]?_0x5652db['options']['where']||null:null})[_0x5075('0x11')](function(_0x1bf4a6){if(_0x1bf4a6){return _0x1bf4a6[_0x5075('0x23')](_0x5652db[_0x5075('0x24')]['ids'],_[_0x5075('0x25')](_0x5652db[_0x5075('0x24')],[_0x5075('0x26'),'id'])||{});}})['spread'](function(_0x2c24a1){logger[_0x5075('0x27')](_0x5075('0x28'),_0x5652db);logger[_0x5075('0x13')]('AddTags',_0x5652db,JSON[_0x5075('0x16')](_0x2c24a1));_0x1ddccd(_0x2c24a1);})[_0x5075('0x1a')](function(_0x3af863){logger['error'](_0x5075('0x28'),_0x3af863[_0x5075('0x19')],_0x5652db);_0x36dbf7(_this[_0x5075('0x17')](0x1f4,_0x3af863[_0x5075('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1b5ef9e..403ad0c 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 _0xfbb2=['update','emit','removeListener','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x587280,_0x27df62){var _0x418c24=function(_0x419d0){while(--_0x419d0){_0x587280['push'](_0x587280['shift']());}};_0x418c24(++_0x27df62);}(_0xfbb2,0xbd));var _0x2fbb=function(_0x390b37,_0x23ed18){_0x390b37=_0x390b37-0x0;var _0x265e6e=_0xfbb2[_0x390b37];return _0x265e6e;};'use strict';var MailInteractionEvents=require(_0x2fbb('0x0'));var events=[_0x2fbb('0x1'),_0x2fbb('0x2'),_0x2fbb('0x3')];function createListener(_0x397fd5,_0x526837){return function(_0x383c97){_0x526837[_0x2fbb('0x4')](_0x397fd5,_0x383c97);};}function removeListener(_0x36f696,_0x9cb456){return function(){MailInteractionEvents[_0x2fbb('0x5')](_0x36f696,_0x9cb456);};}exports['register']=function(_0x36e196){for(var _0x3a16b0=0x0,_0x17d0e7=events[_0x2fbb('0x6')];_0x3a16b0<_0x17d0e7;_0x3a16b0++){var _0x2c0f8d=events[_0x3a16b0];var _0x439f23=createListener(_0x2fbb('0x7')+_0x2c0f8d,_0x36e196);MailInteractionEvents['on'](_0x2c0f8d,_0x439f23);}}; \ No newline at end of file +var _0x339d=['update','emit','removeListener','register','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x5c10d3,_0x3a3b3a){var _0x2cbab4=function(_0x167680){while(--_0x167680){_0x5c10d3['push'](_0x5c10d3['shift']());}};_0x2cbab4(++_0x3a3b3a);}(_0x339d,0x165));var _0xd339=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x339d[_0x4dc7b9];return _0x3ab114;};'use strict';var MailInteractionEvents=require(_0xd339('0x0'));var events=[_0xd339('0x1'),_0xd339('0x2'),_0xd339('0x3')];function createListener(_0x226481,_0x26c030){return function(_0x3657c1){_0x26c030[_0xd339('0x4')](_0x226481,_0x3657c1);};}function removeListener(_0x15b930,_0x19de5f){return function(){MailInteractionEvents[_0xd339('0x5')](_0x15b930,_0x19de5f);};}exports[_0xd339('0x6')]=function(_0x430183){for(var _0xa8bece=0x0,_0x3b2145=events['length'];_0xa8bece<_0x3b2145;_0xa8bece++){var _0x3faa85=events[_0xa8bece];var _0x57f03e=createListener(_0xd339('0x7')+_0x3faa85,_0x430183);MailInteractionEvents['on'](_0x3faa85,_0x57f03e);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 70d0b35..d99aa56 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 _0x38d0=['/describe','describe','/:id','show','/:id/download','download','tracked','mail','create','put','update','/:id/accept','accept','reject','delete','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x3f82b9,_0x6e5508){var _0x3370fa=function(_0x155cc7){while(--_0x155cc7){_0x3f82b9['push'](_0x3f82b9['shift']());}};_0x3370fa(++_0x6e5508);}(_0x38d0,0x123));var _0x038d=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x38d0[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0x038d('0x0'));var path=require(_0x038d('0x1'));var timeout=require(_0x038d('0x2'));var express=require('express');var router=express[_0x038d('0x3')]();var fs_extra=require(_0x038d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x038d('0x5'));var controller=require('./mailMessage.controller');router[_0x038d('0x6')]('/',auth[_0x038d('0x7')](),controller['index']);router[_0x038d('0x6')](_0x038d('0x8'),auth[_0x038d('0x7')](),controller[_0x038d('0x9')]);router[_0x038d('0x6')](_0x038d('0xa'),auth[_0x038d('0x7')](),controller[_0x038d('0xb')]);router[_0x038d('0x6')](_0x038d('0xc'),auth[_0x038d('0x7')](),controller[_0x038d('0xd')]);router['post']('/',auth[_0x038d('0x7')](),interaction[_0x038d('0xe')](_0x038d('0xf'),'mailmessage:create'),controller[_0x038d('0x10')]);router[_0x038d('0x11')](_0x038d('0xa'),auth[_0x038d('0x7')](),controller[_0x038d('0x12')]);router[_0x038d('0x11')](_0x038d('0x13'),auth[_0x038d('0x7')](),controller[_0x038d('0x14')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x038d('0x15')]);router[_0x038d('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x22dd=['update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd22d('0x0'));var util=require(_0xd22d('0x1'));var path=require(_0xd22d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd22d('0x3')]();var fs_extra=require(_0xd22d('0x4'));var auth=require(_0xd22d('0x5'));var interaction=require(_0xd22d('0x6'));var config=require(_0xd22d('0x7'));var controller=require(_0xd22d('0x8'));router[_0xd22d('0x9')]('/',auth[_0xd22d('0xa')](),controller[_0xd22d('0xb')]);router[_0xd22d('0x9')]('/describe',auth[_0xd22d('0xa')](),controller[_0xd22d('0xc')]);router['get'](_0xd22d('0xd'),auth['isAuthenticated'](),controller[_0xd22d('0xe')]);router['get'](_0xd22d('0xf'),auth[_0xd22d('0xa')](),controller[_0xd22d('0x10')]);router[_0xd22d('0x11')]('/',auth[_0xd22d('0xa')](),interaction[_0xd22d('0x12')](_0xd22d('0x13'),_0xd22d('0x14')),controller['create']);router[_0xd22d('0x15')](_0xd22d('0xd'),auth['isAuthenticated'](),controller[_0xd22d('0x16')]);router[_0xd22d('0x15')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0xd22d('0x15')]('/:id/reject',auth[_0xd22d('0xa')](),controller['reject']);router[_0xd22d('0x17')]('/:id',auth[_0xd22d('0xa')](),controller[_0xd22d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 1ce2073..630901a 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 _0xb50e=['ENUM','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb50e,0x1ca));var _0xeb50=function(_0x209f9c,_0x4ea385){_0x209f9c=_0x209f9c-0x0;var _0x13c1ef=_0xb50e[_0x209f9c];return _0x13c1ef;};'use strict';var Sequelize=require(_0xeb50('0x0'));var _=require(_0xeb50('0x1'));module[_0xeb50('0x2')]={'body':{'type':Sequelize[_0xeb50('0x3')](_0xeb50('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeb50('0x3')](_0xeb50('0x5'))},'read':{'type':Sequelize[_0xeb50('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xeb50('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xeb50('0x8')]},'to':{'type':Sequelize[_0xeb50('0x3')](_0xeb50('0x4'))},'cc':{'type':Sequelize[_0xeb50('0x3')](_0xeb50('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xeb50('0x4'))},'subject':{'type':Sequelize[_0xeb50('0x3')]},'sentAt':{'type':Sequelize[_0xeb50('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xeb50('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xeb50('0x3')](_0xeb50('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xeb50('0x4'))},'originChannel':{'type':Sequelize[_0xeb50('0xa')](_0xeb50('0xb'),_0xeb50('0xc')),'defaultValue':_0xeb50('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xe931=['ENUM','out','STRING','TEXT','DATE','INTEGER','Chat','Email','sequelize','lodash','exports','long','BOOLEAN'];(function(_0x10de2e,_0x1a1e20){var _0x4b3a8e=function(_0x4bc96a){while(--_0x4bc96a){_0x10de2e['push'](_0x10de2e['shift']());}};_0x4b3a8e(++_0x1a1e20);}(_0xe931,0xff));var _0x1e93=function(_0x2e2f35,_0x105509){_0x2e2f35=_0x2e2f35-0x0;var _0x2877ff=_0xe931[_0x2e2f35];return _0x2877ff;};'use strict';var Sequelize=require(_0x1e93('0x0'));var _=require(_0x1e93('0x1'));module[_0x1e93('0x2')]={'body':{'type':Sequelize['TEXT'](_0x1e93('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x1e93('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1e93('0x5')]('in','out'),'defaultValue':_0x1e93('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1e93('0x7')](0x1fe)},'from':{'type':Sequelize[_0x1e93('0x7')]},'to':{'type':Sequelize[_0x1e93('0x8')](_0x1e93('0x3'))},'cc':{'type':Sequelize[_0x1e93('0x8')](_0x1e93('0x3'))},'bcc':{'type':Sequelize[_0x1e93('0x8')]('long')},'subject':{'type':Sequelize[_0x1e93('0x8')]},'sentAt':{'type':Sequelize[_0x1e93('0x9')]},'attach':{'type':Sequelize[_0x1e93('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1e93('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1e93('0x9')]},'originTo':{'type':Sequelize[_0x1e93('0x8')](_0x1e93('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x1e93('0x3'))},'originChannel':{'type':Sequelize[_0x1e93('0x5')]('Email',_0x1e93('0xb')),'defaultValue':_0x1e93('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index f0bbc69..2598bfe 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 _0x55ca=['offset','limit','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','attributes','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','fields','include','options','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','CmContact','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','interface','SIP/%s','rejectmessage','unix','server','files','message-%s.eml','from','bcc','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','eml-format','moment','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','count'];(function(_0x1fe254,_0x1b9aa0){var _0x2a7b22=function(_0x1f5e5b){while(--_0x1f5e5b){_0x1fe254['push'](_0x1fe254['shift']());}};_0x2a7b22(++_0x1b9aa0);}(_0x55ca,0x126));var _0xa55c=function(_0x49748c,_0x3d2005){_0x49748c=_0x49748c-0x0;var _0xedf6b6=_0x55ca[_0x49748c];return _0xedf6b6;};'use strict';var emlformat=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xa55c('0x2'));var Redis=require(_0xa55c('0x3'));var htmlToText=require('html-to-text');var qs=require(_0xa55c('0x4'));var logger=require(_0xa55c('0x5'))(_0xa55c('0x6'));var interaction_log=require(_0xa55c('0x5'))(_0xa55c('0x7'));var config=require(_0xa55c('0x8'));var db=require(_0xa55c('0x9'))['db'];config['redis']=_[_0xa55c('0xa')](config[_0xa55c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0xc'))(new Redis(config[_0xa55c('0xb')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xa55c('0xd'));var client=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232c});var client9003=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232b});var client9002=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x70c2de,_0x3998f7,_0x15eec8,_0x5d47ff){return new BPromise(function(_0x59d84a,_0x2a35be){var _0x576044=_0x5d47ff||client;return _0x576044['request'](_0x70c2de,_0x15eec8)['then'](function(_0x18ee85){logger[_0xa55c('0x10')](_0xa55c('0x11'),_0x3998f7,_0xa55c('0x12'));logger[_0xa55c('0x13')](_0xa55c('0x14'),_0x3998f7,'request\x20sent',JSON[_0xa55c('0x15')](_0x18ee85));if(_0x18ee85[_0xa55c('0x16')]){if(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x17')]===0x1f4){logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x2a35be(_0x18ee85[_0xa55c('0x16')]['message']);}logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x59d84a(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x3998f7,_0xa55c('0x12'));_0x59d84a(_0x18ee85[_0xa55c('0x19')][_0xa55c('0x18')]);}})['catch'](function(_0x383d92){logger[_0xa55c('0x16')]('MailMessage,\x20%s,\x20%s',_0x3998f7,_0x383d92);_0x2a35be(_0x383d92);});});}function respondWithResult(_0x187a87,_0x133096){_0x133096=_0x133096||0xc8;return function(_0x940f28){if(_0x940f28){return _0x187a87[_0xa55c('0x1a')](_0x133096)[_0xa55c('0x1b')](_0x940f28);}};}function respondWithFilteredResult(_0x49ed04,_0x1fc828){return function(_0x504c24){if(_0x504c24){var _0x5ba836=typeof _0x1fc828['offset']===_0xa55c('0x1c')&&typeof _0x1fc828['limit']===_0xa55c('0x1c');var _0x190757=_0x504c24[_0xa55c('0x1d')];var _0xf0e574=_0x5ba836?0x0:_0x1fc828[_0xa55c('0x1e')];var _0x170ba4=_0x5ba836?_0x504c24[_0xa55c('0x1d')]:_0x1fc828[_0xa55c('0x1e')]+_0x1fc828[_0xa55c('0x1f')];var _0x3cd152;if(_0x170ba4>=_0x190757){_0x170ba4=_0x190757;_0x3cd152=0xc8;}else{_0x3cd152=0xce;}_0x49ed04[_0xa55c('0x1a')](_0x3cd152);return _0x49ed04['set'](_0xa55c('0x20'),_0xf0e574+'-'+_0x170ba4+'/'+_0x190757)[_0xa55c('0x1b')](_0x504c24);}return null;};}function saveUpdates(_0x1c9f6b){return function(_0x906caa){if(_0x906caa){return _0x906caa['update'](_0x1c9f6b)[_0xa55c('0x21')](function(_0x22f6b6){return _0x22f6b6;});}return null;};}function removeEntity(_0x1b8388){return function(_0x201941){if(_0x201941){return _0x201941[_0xa55c('0x22')]()[_0xa55c('0x21')](function(){_0x1b8388['status'](0xcc)[_0xa55c('0x23')]();});}};}function handleEntityNotFound(_0x490b7d){return function(_0x35c9c2){if(!_0x35c9c2){_0x490b7d[_0xa55c('0x24')](0x194);}return _0x35c9c2;};}function handleError(_0x1cc53e,_0x223813){_0x223813=_0x223813||0x1f4;return function(_0x4d8416){logger[_0xa55c('0x16')](_0x4d8416[_0xa55c('0x25')]);if(_0x4d8416[_0xa55c('0x26')]){delete _0x4d8416[_0xa55c('0x26')];}_0x1cc53e[_0xa55c('0x1a')](_0x223813)[_0xa55c('0x27')](_0x4d8416);};}exports[_0xa55c('0x28')]=function(_0x24d44d,_0x2808e9){var _0xcbaf2e={},_0x197099={},_0x4eb7c4={'count':0x0,'rows':[]};var _0x54ca97=_[_0xa55c('0x29')](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x30fadd){return{'name':_0x30fadd[_0xa55c('0x2b')],'type':_0x30fadd[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x197099[_0xa55c('0x2e')]=_[_0xa55c('0x29')](_0x54ca97,_0xa55c('0x26'));_0x197099[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x24d44d['query']);_0x197099['filters']=_['intersection'](_0x197099[_0xa55c('0x2e')],_0x197099[_0xa55c('0x2f')]);_0xcbaf2e[_0xa55c('0x31')]=_['intersection'](_0x197099[_0xa55c('0x2e')],qs['fields'](_0x24d44d[_0xa55c('0x2f')]['fields']));_0xcbaf2e[_0xa55c('0x31')]=_0xcbaf2e[_0xa55c('0x31')][_0xa55c('0x32')]?_0xcbaf2e['attributes']:_0x197099[_0xa55c('0x2e')];if(!_0x24d44d[_0xa55c('0x2f')]['hasOwnProperty'](_0xa55c('0x33'))){_0xcbaf2e[_0xa55c('0x1f')]=qs['limit'](_0x24d44d['query'][_0xa55c('0x1f')]);_0xcbaf2e['offset']=qs[_0xa55c('0x1e')](_0x24d44d[_0xa55c('0x2f')]['offset']);}_0xcbaf2e['order']=qs['sort'](_0x24d44d['query'][_0xa55c('0x34')]);_0xcbaf2e[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_[_0xa55c('0x37')](_0x24d44d[_0xa55c('0x2f')],_0x197099['filters']),_0x54ca97);if(_0x24d44d[_0xa55c('0x2f')][_0xa55c('0x38')]){_0xcbaf2e[_0xa55c('0x35')]=_[_0xa55c('0x39')](_0xcbaf2e[_0xa55c('0x35')],{'$or':_[_0xa55c('0x29')](_0x54ca97,function(_0x554620){if(_0x554620[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x57a972={};_0x57a972[_0x554620[_0xa55c('0x26')]]={'$like':'%'+_0x24d44d[_0xa55c('0x2f')]['filter']+'%'};return _0x57a972;}})});}_0xcbaf2e=_[_0xa55c('0x39')]({},_0xcbaf2e,_0x24d44d['options']);var _0x5f25f7={'where':_0xcbaf2e[_0xa55c('0x35')]};return db[_0xa55c('0x2a')][_0xa55c('0x1d')](_0x5f25f7)['then'](function(_0x1b2708){_0x4eb7c4[_0xa55c('0x1d')]=_0x1b2708;if(_0x24d44d['query'][_0xa55c('0x3a')]){_0xcbaf2e['include']=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x3b')](_0xcbaf2e);})['then'](function(_0x66d1de){_0x4eb7c4[_0xa55c('0x3c')]=_0x66d1de;return _0x4eb7c4;})['then'](respondWithFilteredResult(_0x2808e9,_0xcbaf2e))[_0xa55c('0x3d')](handleError(_0x2808e9,null));};exports[_0xa55c('0x3e')]=function(_0x204767,_0x59a6c8){var _0x334f52={'raw':!![],'where':{'id':_0x204767[_0xa55c('0x3f')]['id']}},_0x582901={};_0x582901[_0xa55c('0x2e')]=_[_0xa55c('0x30')](db['MailMessage'][_0xa55c('0x40')]);_0x582901[_0xa55c('0x2f')]=_['keys'](_0x204767[_0xa55c('0x2f')]);_0x582901[_0xa55c('0x36')]=_['intersection'](_0x582901[_0xa55c('0x2e')],_0x582901[_0xa55c('0x2f')]);_0x334f52['attributes']=_[_0xa55c('0x41')](_0x582901[_0xa55c('0x2e')],qs[_0xa55c('0x42')](_0x204767[_0xa55c('0x2f')]['fields']));_0x334f52[_0xa55c('0x31')]=_0x334f52['attributes'][_0xa55c('0x32')]?_0x334f52[_0xa55c('0x31')]:_0x582901[_0xa55c('0x2e')];if(_0x204767['query'][_0xa55c('0x3a')]){_0x334f52[_0xa55c('0x43')]=[{'all':!![]}];}_0x334f52=_['merge']({},_0x334f52,_0x204767[_0xa55c('0x44')]);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x334f52)[_0xa55c('0x21')](handleEntityNotFound(_0x59a6c8,null))[_0xa55c('0x21')](respondWithResult(_0x59a6c8,null))[_0xa55c('0x3d')](handleError(_0x59a6c8,null));};exports[_0xa55c('0x46')]=function(_0x129626,_0x3c147b){if(_0x129626[_0xa55c('0x47')]['id']){delete _0x129626['body']['id'];}return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x129626[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c147b,null))[_0xa55c('0x21')](saveUpdates(_0x129626[_0xa55c('0x47')],null))['then'](respondWithResult(_0x3c147b,null))[_0xa55c('0x3d')](handleError(_0x3c147b,null));};exports['destroy']=function(_0x2b6a0e,_0x228df4){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x2b6a0e[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x228df4,null))[_0xa55c('0x21')](removeEntity(_0x228df4,null))[_0xa55c('0x3d')](handleError(_0x228df4,null));};exports['describe']=function(_0x3929a6,_0x2291e0){return db[_0xa55c('0x2a')][_0xa55c('0x48')]()['then'](respondWithResult(_0x2291e0,null))['catch'](handleError(_0x2291e0,null));};exports[_0xa55c('0x49')]=function(_0x250dea,_0x3ca5b8){return db[_0xa55c('0x2a')]['create'](_0x250dea[_0xa55c('0x47')])['then'](function(_0x2742e4){if(_0x2742e4){if(_0x2742e4[_0xa55c('0x4a')]===_0xa55c('0x4b')&&!_0x2742e4[_0xa55c('0x4c')]){var _0xec640,_0x53b2f7,_0x1cb73b;if(_0x250dea['body']['to']){_0x53b2f7=_0x250dea[_0xa55c('0x47')]['to'][_0xa55c('0x4d')](',')[0x0];}return db[_0xa55c('0x4e')][_0xa55c('0x4f')]({'where':{'id':_0x2742e4[_0xa55c('0x50')]},'include':[{'model':db[_0xa55c('0x51')],'as':_0xa55c('0x52'),'include':[{'model':db['CmContact'],'as':_0xa55c('0x53'),'where':{'email':_0x53b2f7},'limit':0x1,'order':[[_0xa55c('0x54'),_0xa55c('0x55')]]}]},{'model':db[_0xa55c('0x56')],'as':_0xa55c('0x57'),'raw':!![]}]})['then'](function(_0xa72718){_0xec640=_0xa72718;if(_0xec640&&_0xec640[_0xa55c('0x57')]){var _0x28bac4={'tls':{'rejectUnauthorized':![]}};if(_[_0xa55c('0x58')](_0xec640[_0xa55c('0x57')]['service'])){_0x28bac4[_0xa55c('0x59')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x59')];_0x28bac4[_0xa55c('0x5a')]=_0xec640[_0xa55c('0x57')]['port'];_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];if(_0xec640['Smtp'][_0xa55c('0x5c')]){_0x28bac4['auth']={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640[_0xa55c('0x57')][_0xa55c('0x5e')]};}}else{_0x28bac4[_0xa55c('0x5f')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x5f')];_0x28bac4[_0xa55c('0x60')]={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640['Smtp'][_0xa55c('0x5e')]};_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];}if(_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')]&&_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0xa55c('0x32')]){for(var _0x3cef1f=0x0;_0x3cef1f<_0x250dea[_0xa55c('0x47')]['attachments'][_0xa55c('0x32')];_0x3cef1f+=0x1){_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f]={'filename':_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x26')],'path':path[_0xa55c('0x62')](config[_0xa55c('0x63')],_0xa55c('0x64'),_0x250dea['body'][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x65')])};}}_0x1cb73b={'account':_0x28bac4,'message':_0x250dea[_0xa55c('0x47')]};return;}})[_0xa55c('0x21')](function(){if(_0xec640[_0xa55c('0x52')]){if(_0xec640[_0xa55c('0x52')][_0xa55c('0x53')][_0xa55c('0x32')]){return _0xec640[_0xa55c('0x52')][_0xa55c('0x53')][0x0];}else{return db[_0xa55c('0x66')]['create'](_[_0xa55c('0xa')](_0x250dea['body'],{'firstName':_0x250dea[_0xa55c('0x47')]['to'],'email':_0x250dea[_0xa55c('0x47')]['to'],'phone':_0x250dea[_0xa55c('0x47')]['to'],'ListId':_0xec640['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xa55c('0x21')](function(){if(_0x1cb73b){return respondWithRpcPromise(_0xa55c('0x67'),_0xa55c('0x68'),_0x1cb73b,client9003)[_0xa55c('0x21')](function(_0x4c7ee1){return _0x2742e4[_0xa55c('0x46')]({'read':!![],'messageId':_0x4c7ee1[_0xa55c('0x69')],'sentAt':moment()[_0xa55c('0x6a')](_0xa55c('0x6b'))});})[_0xa55c('0x3d')](function(_0x500968){logger['error']('%s',JSON[_0xa55c('0x15')](_0x500968));return _0x2742e4;});}return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x21')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x3d')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x6c')]=function(_0x1af9d5,_0x4b2032){var _0x14febc={'agent':{},'channel':_0xa55c('0x6d')};if(_0x1af9d5['body']['id']){delete _0x1af9d5[_0xa55c('0x47')]['id'];}_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x6e')]=!![];_0x1af9d5['body'][_0xa55c('0x6f')]=moment()[_0xa55c('0x6a')](_0xa55c('0x6b'));_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')]=_0x1af9d5['body'][_0xa55c('0x70')]||_0x1af9d5[_0xa55c('0x5d')]['id'];_0x14febc['agent']['id']=_0x1af9d5['body'][_0xa55c('0x70')];return db['MailMessage'][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](saveUpdates(_0x1af9d5[_0xa55c('0x47')],null))[_0xa55c('0x21')](function(_0x22b06f){if(_0x22b06f){_0x14febc[_0xa55c('0x18')]=_0x22b06f[_0xa55c('0x71')]({'plain':!![]});return db['MailInteraction'][_0xa55c('0x45')]({'where':{'id':_0x22b06f[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](function(_0x4f0a26){if(_0x4f0a26){return _0x4f0a26[_0xa55c('0x46')]({'UserId':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'read1stAt':_[_0xa55c('0x58')](_0x4f0a26['read1stAt'])?moment()['format'](_0xa55c('0x6b')):undefined});}return null;})[_0xa55c('0x21')](function(_0x12e3a8){if(_0x12e3a8){_0x14febc[_0xa55c('0x73')]=_0x12e3a8['get']({'plain':!![]});interaction_log['info'](_0xa55c('0x74'),_0x1af9d5[_0xa55c('0x5d')]['id'],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x26')],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x75')],_0x14febc[_0xa55c('0x73')]['id'],_0x1af9d5['body']?JSON[_0xa55c('0x15')](_0x1af9d5['body']):_0xa55c('0x76'));return respondWithRpcPromise('AcceptMessage',_0xa55c('0x77'),_0x14febc);}return null;})[_0xa55c('0x21')](function(_0x441c11){var _0xcc187f=_0xa55c('0x78')+_0x441c11[_0xa55c('0x18')][_0xa55c('0x79')];return db[_0xa55c('0x7a')]['query'](_0xcc187f,{'type':db['Sequelize'][_0xa55c('0x7b')][_0xa55c('0x7c')],'raw':!![]})[_0xa55c('0x21')](function(_0x256db0){return _0x256db0;});})[_0xa55c('0x21')](function(_0x137728){if(_0x137728){_0x14febc['message'][_0xa55c('0x7d')]=_0x137728[0x0];if(!_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')])return;return db[_0xa55c('0x7e')][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id','name',_0xa55c('0x80'),_0xa55c('0x81'),_0xa55c('0x82')],'raw':!![]});}return null;})[_0xa55c('0x21')](function(_0xa957ad){if(!_0xa957ad)return null;_0x14febc['message'][_0xa55c('0x7f')]=_0xa957ad;return _0x14febc;})[_0xa55c('0x21')](function(_0x58296a){if(_0x58296a){if(_0x1af9d5['body'][_0xa55c('0x83')]){_0x14febc[_0xa55c('0x18')]['interface']=util['format']('SIP/%s',_0x1af9d5['user'][_0xa55c('0x26')]);_0x14febc[_0xa55c('0x18')][_0xa55c('0x84')]=_0x14febc[_0xa55c('0x84')];_0x14febc[_0xa55c('0x18')][_0xa55c('0x85')]='accept';_0x14febc[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText[_0xa55c('0x86')](_0x14febc[_0xa55c('0x18')]['body']);return respondWithRpcPromise(_0xa55c('0x87'),_0xa55c('0x87'),{'event':_0xa55c('0x88'),'message':_0x14febc['message']},client9002)[_0xa55c('0x21')](function(){return _0x14febc;});}return _0x14febc;}return null;})['then'](respondWithResult(_0x4b2032,null))['catch'](handleError(_0x4b2032,null));};exports[_0xa55c('0x89')]=function(_0x413b45,_0x1e298d){var _0x249b0c={'agent':{},'channel':_0xa55c('0x6d')};if(_0x413b45[_0xa55c('0x47')]['id']){delete _0x413b45[_0xa55c('0x47')]['id'];}_0x413b45['body']['UserId']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')]||_0x413b45[_0xa55c('0x5d')]['id'];_0x249b0c[_0xa55c('0x7f')]['id']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')];return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))['then'](function(_0xc9c3fa){if(_0xc9c3fa){_0x249b0c[_0xa55c('0x18')]=_0xc9c3fa['get']({'plain':!![]});return db[_0xa55c('0x8a')]['find']({'where':{'id':_0xc9c3fa[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))[_0xa55c('0x21')](function(_0x314205){if(_0x314205){_0x249b0c[_0xa55c('0x73')]=_0x314205['get']({'plain':!![]});interaction_log[_0xa55c('0x10')](_0xa55c('0x8b'),_0x413b45[_0xa55c('0x5d')]['id'],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x26')],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x75')],_0x249b0c['interaction']['id'],_0x413b45['body']?JSON['stringify'](_0x413b45[_0xa55c('0x47')]):'null');return respondWithRpcPromise(_0xa55c('0x8c'),_0xa55c('0x8d'),_0x249b0c);}return null;})[_0xa55c('0x21')](function(_0x73162a){var _0x26ca90='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x73162a[_0xa55c('0x18')]['ContactId'];return db[_0xa55c('0x7a')][_0xa55c('0x2f')](_0x26ca90,{'type':db[_0xa55c('0x8e')][_0xa55c('0x7b')]['SELECT'],'raw':!![]})[_0xa55c('0x21')](function(_0x46f8ab){return _0x46f8ab;});})[_0xa55c('0x21')](function(_0x17a36c){if(_0x17a36c){_0x249b0c[_0xa55c('0x18')][_0xa55c('0x7d')]=_0x17a36c[0x0];if(!_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')])return;return db['User'][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id',_0xa55c('0x26'),_0xa55c('0x80'),'email',_0xa55c('0x82')],'raw':!![]});}return null;})['then'](function(_0x3b9712){if(!_0x3b9712)return null;_0x249b0c['message'][_0xa55c('0x7f')]=_0x3b9712;return _0x249b0c;})[_0xa55c('0x21')](function(_0x17312b){if(_0x17312b){_0x17312b['message'][_0xa55c('0x8f')]=util[_0xa55c('0x6a')](_0xa55c('0x90'),_0x413b45['user'][_0xa55c('0x26')]);_0x17312b['message'][_0xa55c('0x84')]=_0x249b0c[_0xa55c('0x84')];_0x17312b['message'][_0xa55c('0x85')]='reject';_0x17312b[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText['fromString'](_0x249b0c[_0xa55c('0x18')][_0xa55c('0x47')]);respondWithRpcPromise('EventManager',_0xa55c('0x87'),{'event':_0xa55c('0x91'),'message':_0x17312b['message']},client9002);return _0x249b0c;}return null;})[_0xa55c('0x21')](respondWithResult(_0x1e298d,null))['catch'](handleError(_0x1e298d,null));};exports['download']=function(_0x28a26d,_0x3113b9){var _0x28a71e=moment()[_0xa55c('0x92')]()['toString']();var _0x307895=path['join'](config[_0xa55c('0x63')],'server','files','tmp');var _0x999114=path['join'](config['root'],_0xa55c('0x93'),_0xa55c('0x94'),_0xa55c('0x61'));var _0x4046ae=util[_0xa55c('0x6a')](_0xa55c('0x95'),_0x28a71e);return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x28a26d[_0xa55c('0x3f')]['id']},'attributes':['id',_0xa55c('0x47'),_0xa55c('0x96'),'to','cc',_0xa55c('0x97'),_0xa55c('0x98'),'createdAt'],'include':_0x28a26d[_0xa55c('0x2f')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xa55c('0x21')](handleEntityNotFound(_0x3113b9,null))['then'](function(_0xd5a27a){if(_0xd5a27a){var _0x55e447=_0xd5a27a;var _0x3169dd={'from':_0x55e447['from'],'to':_0x55e447['to'],'subject':_0x55e447['subject'],'html':_0x55e447[_0xa55c('0x47')],'headers':{'Date':moment(_0x55e447['createdAt'])['format'](_0xa55c('0x99'))},'attachments':[]};if(_0xd5a27a['cc']){_0x3169dd[_0xa55c('0x9a')]['Cc']=_0xd5a27a['cc'];}if(_0xd5a27a['bcc']){_0x3169dd[_0xa55c('0x9a')]['Bcc']=_0xd5a27a[_0xa55c('0x97')];}return new BPromise(function(_0x403dff,_0x1dcd8a){if(_0xd5a27a['Attachments']){for(var _0x50df67=0x0;_0x50df67<_0xd5a27a[_0xa55c('0x9b')][_0xa55c('0x32')];_0x50df67++){var _0x36064f=_0xd5a27a[_0xa55c('0x9b')][_0x50df67];var _0x4297bf=path[_0xa55c('0x62')](_0x999114,_0x36064f[_0xa55c('0x65')]);if(fs[_0xa55c('0x9c')](_0x4297bf)){_0x3169dd['attachments'][_0xa55c('0x9d')]({'name':_0x36064f[_0xa55c('0x26')],'contentType':_0x36064f[_0xa55c('0x2c')],'data':fs[_0xa55c('0x9e')](_0x4297bf)});}}}emlformat[_0xa55c('0x9f')](_0x3169dd,function(_0x1a01de,_0x2fa186){if(_0x1a01de)return _0x1dcd8a(_0x1a01de);fs[_0xa55c('0xa0')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x2fa186);return _0x403dff(_0x2fa186);});});}})['then'](function(_0x19ebd5){if(_0x19ebd5){return _0x3113b9[_0xa55c('0xa1')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x4046ae,function(_0x5ea9c8){if(!_0x5ea9c8)fs['unlinkSync'](path['join'](_0x307895,_0x4046ae));});}})[_0xa55c('0x3d')](handleError(_0x3113b9,null));}; \ No newline at end of file +var _0x7217=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','length','include','find','body','describe','create','direction','out','secret','MailAccount','CmContact','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','List','ListId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','email','reject','rejectmessage','download','toString','server','tmp','files','message-%s.eml','from','bcc','subject','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','Content-Range','update','destroy','stack','name','send','MailMessage','fieldName','type','key','model','map','query','keys'];(function(_0x433d0e,_0x3a190a){var _0x4ec711=function(_0x4b3b55){while(--_0x4b3b55){_0x433d0e['push'](_0x433d0e['shift']());}};_0x4ec711(++_0x3a190a);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var emlformat=require(_0x7721('0x0'));var moment=require('moment');var BPromise=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var path=require(_0x7721('0x3'));var fs=require('fs');var _=require(_0x7721('0x4'));var Redis=require(_0x7721('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x7721('0x6'))(_0x7721('0x7'));var interaction_log=require(_0x7721('0x6'))(_0x7721('0x8'));var config=require(_0x7721('0x9'));var db=require(_0x7721('0xa'))['db'];config[_0x7721('0xb')]=_[_0x7721('0xc')](config[_0x7721('0xb')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config[_0x7721('0xb')]));require(_0x7721('0xf'))[_0x7721('0x10')](socket);var jayson=require(_0x7721('0x11'));var client=jayson['client'][_0x7721('0x12')]({'port':0x232c});var client9003=jayson[_0x7721('0x13')][_0x7721('0x12')]({'port':0x232b});var client9002=jayson[_0x7721('0x13')][_0x7721('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x409b37,_0x1e7fd7,_0x27b36b,_0x55b4ca){return new BPromise(function(_0x2911ec,_0x199930){var _0x57ff6d=_0x55b4ca||client;return _0x57ff6d[_0x7721('0x14')](_0x409b37,_0x27b36b)[_0x7721('0x15')](function(_0x3f01c5){logger[_0x7721('0x16')]('MailMessage,\x20%s,\x20%s',_0x1e7fd7,_0x7721('0x17'));logger[_0x7721('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1e7fd7,'request\x20sent',JSON['stringify'](_0x3f01c5));if(_0x3f01c5[_0x7721('0x19')]){if(_0x3f01c5[_0x7721('0x19')][_0x7721('0x1a')]===0x1f4){logger[_0x7721('0x19')]('MailMessage,\x20%s,\x20%s',_0x1e7fd7,_0x3f01c5[_0x7721('0x19')]['message']);return _0x199930(_0x3f01c5[_0x7721('0x19')]['message']);}logger[_0x7721('0x19')](_0x7721('0x1b'),_0x1e7fd7,_0x3f01c5[_0x7721('0x19')][_0x7721('0x1c')]);return _0x2911ec(_0x3f01c5[_0x7721('0x19')][_0x7721('0x1c')]);}else{logger[_0x7721('0x16')](_0x7721('0x1b'),_0x1e7fd7,_0x7721('0x17'));_0x2911ec(_0x3f01c5[_0x7721('0x1d')]['message']);}})[_0x7721('0x1e')](function(_0x2c1583){logger[_0x7721('0x19')](_0x7721('0x1b'),_0x1e7fd7,_0x2c1583);_0x199930(_0x2c1583);});});}function respondWithResult(_0x57140c,_0x28f5a6){_0x28f5a6=_0x28f5a6||0xc8;return function(_0x512f31){if(_0x512f31){return _0x57140c[_0x7721('0x1f')](_0x28f5a6)[_0x7721('0x20')](_0x512f31);}};}function respondWithFilteredResult(_0x3e8a4e,_0x1caad8){return function(_0x121cc4){if(_0x121cc4){var _0x395b15=typeof _0x1caad8[_0x7721('0x21')]==='undefined'&&typeof _0x1caad8[_0x7721('0x22')]===_0x7721('0x23');var _0x125564=_0x121cc4[_0x7721('0x24')];var _0x40d550=_0x395b15?0x0:_0x1caad8[_0x7721('0x21')];var _0x424e05=_0x395b15?_0x121cc4[_0x7721('0x24')]:_0x1caad8[_0x7721('0x21')]+_0x1caad8['limit'];var _0x258ddf;if(_0x424e05>=_0x125564){_0x424e05=_0x125564;_0x258ddf=0xc8;}else{_0x258ddf=0xce;}_0x3e8a4e['status'](_0x258ddf);return _0x3e8a4e['set'](_0x7721('0x25'),_0x40d550+'-'+_0x424e05+'/'+_0x125564)[_0x7721('0x20')](_0x121cc4);}return null;};}function saveUpdates(_0x53c904){return function(_0x158d98){if(_0x158d98){return _0x158d98[_0x7721('0x26')](_0x53c904)[_0x7721('0x15')](function(_0xd7d703){return _0xd7d703;});}return null;};}function removeEntity(_0x1da2d8){return function(_0x5c54f0){if(_0x5c54f0){return _0x5c54f0[_0x7721('0x27')]()[_0x7721('0x15')](function(){_0x1da2d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfde9ec){return function(_0x220bbf){if(!_0x220bbf){_0xfde9ec['sendStatus'](0x194);}return _0x220bbf;};}function handleError(_0x46f772,_0x4651b5){_0x4651b5=_0x4651b5||0x1f4;return function(_0x382821){logger['error'](_0x382821[_0x7721('0x28')]);if(_0x382821[_0x7721('0x29')]){delete _0x382821[_0x7721('0x29')];}_0x46f772[_0x7721('0x1f')](_0x4651b5)[_0x7721('0x2a')](_0x382821);};}exports['index']=function(_0x195ffb,_0x3e4e56){var _0xb2386d={},_0x5c5b33={},_0x35de7a={'count':0x0,'rows':[]};var _0x213a2e=_['map'](db[_0x7721('0x2b')]['rawAttributes'],function(_0x2d6ba0){return{'name':_0x2d6ba0[_0x7721('0x2c')],'type':_0x2d6ba0[_0x7721('0x2d')][_0x7721('0x2e')]};});_0x5c5b33[_0x7721('0x2f')]=_[_0x7721('0x30')](_0x213a2e,_0x7721('0x29'));_0x5c5b33[_0x7721('0x31')]=_[_0x7721('0x32')](_0x195ffb[_0x7721('0x31')]);_0x5c5b33[_0x7721('0x33')]=_['intersection'](_0x5c5b33[_0x7721('0x2f')],_0x5c5b33['query']);_0xb2386d[_0x7721('0x34')]=_[_0x7721('0x35')](_0x5c5b33[_0x7721('0x2f')],qs[_0x7721('0x36')](_0x195ffb[_0x7721('0x31')][_0x7721('0x36')]));_0xb2386d['attributes']=_0xb2386d['attributes']['length']?_0xb2386d['attributes']:_0x5c5b33[_0x7721('0x2f')];if(!_0x195ffb[_0x7721('0x31')][_0x7721('0x37')](_0x7721('0x38'))){_0xb2386d['limit']=qs[_0x7721('0x22')](_0x195ffb['query'][_0x7721('0x22')]);_0xb2386d[_0x7721('0x21')]=qs['offset'](_0x195ffb[_0x7721('0x31')][_0x7721('0x21')]);}_0xb2386d['order']=qs['sort'](_0x195ffb[_0x7721('0x31')][_0x7721('0x39')]);_0xb2386d[_0x7721('0x3a')]=qs[_0x7721('0x33')](_['pick'](_0x195ffb[_0x7721('0x31')],_0x5c5b33[_0x7721('0x33')]),_0x213a2e);if(_0x195ffb[_0x7721('0x31')][_0x7721('0x3b')]){_0xb2386d[_0x7721('0x3a')]=_['merge'](_0xb2386d[_0x7721('0x3a')],{'$or':_['map'](_0x213a2e,function(_0xaa3216){if(_0xaa3216['type']!==_0x7721('0x3c')){var _0x15fa2c={};_0x15fa2c[_0xaa3216[_0x7721('0x29')]]={'$like':'%'+_0x195ffb['query'][_0x7721('0x3b')]+'%'};return _0x15fa2c;}})});}_0xb2386d=_[_0x7721('0x3d')]({},_0xb2386d,_0x195ffb[_0x7721('0x3e')]);var _0x481fa8={'where':_0xb2386d[_0x7721('0x3a')]};return db[_0x7721('0x2b')][_0x7721('0x24')](_0x481fa8)[_0x7721('0x15')](function(_0x135dbc){_0x35de7a[_0x7721('0x24')]=_0x135dbc;if(_0x195ffb[_0x7721('0x31')]['includeAll']){_0xb2386d['include']=[{'all':!![]}];}return db[_0x7721('0x2b')][_0x7721('0x3f')](_0xb2386d);})[_0x7721('0x15')](function(_0x39a3ad){_0x35de7a[_0x7721('0x40')]=_0x39a3ad;return _0x35de7a;})[_0x7721('0x15')](respondWithFilteredResult(_0x3e4e56,_0xb2386d))[_0x7721('0x1e')](handleError(_0x3e4e56,null));};exports[_0x7721('0x41')]=function(_0xa601bc,_0x3af123){var _0x5460cd={'raw':!![],'where':{'id':_0xa601bc[_0x7721('0x42')]['id']}},_0x578867={};_0x578867[_0x7721('0x2f')]=_[_0x7721('0x32')](db[_0x7721('0x2b')]['rawAttributes']);_0x578867[_0x7721('0x31')]=_[_0x7721('0x32')](_0xa601bc['query']);_0x578867[_0x7721('0x33')]=_['intersection'](_0x578867[_0x7721('0x2f')],_0x578867['query']);_0x5460cd[_0x7721('0x34')]=_[_0x7721('0x35')](_0x578867[_0x7721('0x2f')],qs['fields'](_0xa601bc[_0x7721('0x31')][_0x7721('0x36')]));_0x5460cd['attributes']=_0x5460cd[_0x7721('0x34')][_0x7721('0x43')]?_0x5460cd[_0x7721('0x34')]:_0x578867['model'];if(_0xa601bc[_0x7721('0x31')]['includeAll']){_0x5460cd[_0x7721('0x44')]=[{'all':!![]}];}_0x5460cd=_[_0x7721('0x3d')]({},_0x5460cd,_0xa601bc[_0x7721('0x3e')]);return db[_0x7721('0x2b')][_0x7721('0x45')](_0x5460cd)[_0x7721('0x15')](handleEntityNotFound(_0x3af123,null))[_0x7721('0x15')](respondWithResult(_0x3af123,null))[_0x7721('0x1e')](handleError(_0x3af123,null));};exports[_0x7721('0x26')]=function(_0x3386aa,_0x31770e){if(_0x3386aa[_0x7721('0x46')]['id']){delete _0x3386aa[_0x7721('0x46')]['id'];}return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x3386aa['params']['id']}})[_0x7721('0x15')](handleEntityNotFound(_0x31770e,null))[_0x7721('0x15')](saveUpdates(_0x3386aa[_0x7721('0x46')],null))[_0x7721('0x15')](respondWithResult(_0x31770e,null))[_0x7721('0x1e')](handleError(_0x31770e,null));};exports[_0x7721('0x27')]=function(_0x267f5e,_0x57484c){return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x267f5e[_0x7721('0x42')]['id']}})[_0x7721('0x15')](handleEntityNotFound(_0x57484c,null))[_0x7721('0x15')](removeEntity(_0x57484c,null))[_0x7721('0x1e')](handleError(_0x57484c,null));};exports[_0x7721('0x47')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x2b')][_0x7721('0x47')]()['then'](respondWithResult(_0x11b300,null))[_0x7721('0x1e')](handleError(_0x11b300,null));};exports[_0x7721('0x48')]=function(_0x1234bc,_0x2ee3c0){return db[_0x7721('0x2b')][_0x7721('0x48')](_0x1234bc[_0x7721('0x46')])[_0x7721('0x15')](function(_0x360882){if(_0x360882){if(_0x360882[_0x7721('0x49')]===_0x7721('0x4a')&&!_0x360882[_0x7721('0x4b')]){var _0x106664,_0x18f7f6,_0x300ea4;if(_0x1234bc['body']['to']){_0x18f7f6=_0x1234bc['body']['to']['split'](',')[0x0];}return db[_0x7721('0x4c')]['findOne']({'where':{'id':_0x360882['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7721('0x4d')],'as':_0x7721('0x4e'),'where':{'email':_0x18f7f6},'limit':0x1,'order':[[_0x7721('0x4f'),'DESC']]}]},{'model':db[_0x7721('0x50')],'as':'Smtp','raw':!![]}]})['then'](function(_0x484b8e){_0x106664=_0x484b8e;if(_0x106664&&_0x106664[_0x7721('0x51')]){var _0x4f0d38={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x106664['Smtp'][_0x7721('0x52')])){_0x4f0d38[_0x7721('0x53')]=_0x106664[_0x7721('0x51')]['host'];_0x4f0d38[_0x7721('0x54')]=_0x106664[_0x7721('0x51')][_0x7721('0x54')];_0x4f0d38[_0x7721('0x55')]=_0x106664[_0x7721('0x51')][_0x7721('0x55')];if(_0x106664[_0x7721('0x51')][_0x7721('0x56')]){_0x4f0d38[_0x7721('0x57')]={'user':_0x106664[_0x7721('0x51')][_0x7721('0x58')],'pass':_0x106664[_0x7721('0x51')][_0x7721('0x59')]};}}else{_0x4f0d38[_0x7721('0x52')]=_0x106664[_0x7721('0x51')]['service'];_0x4f0d38[_0x7721('0x57')]={'user':_0x106664[_0x7721('0x51')][_0x7721('0x58')],'pass':_0x106664[_0x7721('0x51')]['pass']};_0x4f0d38[_0x7721('0x55')]=_0x106664[_0x7721('0x51')]['secure'];}if(_0x1234bc[_0x7721('0x46')]['attachments']&&_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x7721('0x43')]){for(var _0x3f9eaa=0x0;_0x3f9eaa<_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x7721('0x43')];_0x3f9eaa+=0x1){_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x3f9eaa]={'filename':_0x1234bc['body'][_0x7721('0x5a')][_0x3f9eaa][_0x7721('0x29')],'path':path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x5d'),_0x1234bc[_0x7721('0x46')][_0x7721('0x5a')][_0x3f9eaa]['basename'])};}}_0x300ea4={'account':_0x4f0d38,'message':_0x1234bc[_0x7721('0x46')]};return;}})[_0x7721('0x15')](function(){if(_0x106664['List']){if(_0x106664[_0x7721('0x5e')]['Contacts'][_0x7721('0x43')]){return _0x106664[_0x7721('0x5e')][_0x7721('0x4e')][0x0];}else{return db[_0x7721('0x4d')][_0x7721('0x48')](_[_0x7721('0xc')](_0x1234bc[_0x7721('0x46')],{'firstName':_0x1234bc['body']['to'],'email':_0x1234bc[_0x7721('0x46')]['to'],'phone':_0x1234bc[_0x7721('0x46')]['to'],'ListId':_0x106664[_0x7721('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x300ea4){return respondWithRpcPromise('SendMail','sendMail',_0x300ea4,client9003)['then'](function(_0x1fc5f7){return _0x360882[_0x7721('0x26')]({'read':!![],'messageId':_0x1fc5f7['messageId'],'sentAt':moment()[_0x7721('0x60')](_0x7721('0x61'))});})[_0x7721('0x1e')](function(_0x4593e1){logger['error']('%s',JSON[_0x7721('0x62')](_0x4593e1));return _0x360882;});}return _0x360882;});}return _0x360882;}})[_0x7721('0x15')](respondWithResult(_0x2ee3c0,0xc9))[_0x7721('0x1e')](handleError(_0x2ee3c0,null));};exports[_0x7721('0x63')]=function(_0x3cf3fd,_0x53adb1){var _0x29ac64={'agent':{},'channel':_0x7721('0x64')};if(_0x3cf3fd[_0x7721('0x46')]['id']){delete _0x3cf3fd['body']['id'];}_0x3cf3fd['body'][_0x7721('0x65')]=!![];_0x3cf3fd[_0x7721('0x46')][_0x7721('0x66')]=moment()[_0x7721('0x60')](_0x7721('0x61'));_0x3cf3fd['body']['UserId']=_0x3cf3fd[_0x7721('0x46')][_0x7721('0x67')]||_0x3cf3fd[_0x7721('0x58')]['id'];_0x29ac64[_0x7721('0x68')]['id']=_0x3cf3fd[_0x7721('0x46')][_0x7721('0x67')];return db[_0x7721('0x2b')]['find']({'where':{'id':_0x3cf3fd[_0x7721('0x42')]['id'],'UserId':null}})[_0x7721('0x15')](handleEntityNotFound(_0x53adb1,null))[_0x7721('0x15')](saveUpdates(_0x3cf3fd['body'],null))[_0x7721('0x15')](function(_0x1a53d6){if(_0x1a53d6){_0x29ac64[_0x7721('0x1c')]=_0x1a53d6[_0x7721('0x69')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x1a53d6[_0x7721('0x6a')]}});}return null;})[_0x7721('0x15')](handleEntityNotFound(_0x53adb1,null))[_0x7721('0x15')](function(_0x42c849){if(_0x42c849){return _0x42c849[_0x7721('0x26')]({'UserId':_0x3cf3fd[_0x7721('0x46')]['UserId'],'read1stAt':_[_0x7721('0x6b')](_0x42c849[_0x7721('0x6c')])?moment()[_0x7721('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7721('0x15')](function(_0x3b16f3){if(_0x3b16f3){_0x29ac64[_0x7721('0x6d')]=_0x3b16f3[_0x7721('0x69')]({'plain':!![]});interaction_log[_0x7721('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cf3fd[_0x7721('0x58')]['id'],_0x3cf3fd['user'][_0x7721('0x29')],_0x3cf3fd[_0x7721('0x58')][_0x7721('0x6e')],_0x29ac64[_0x7721('0x6d')]['id'],_0x3cf3fd[_0x7721('0x46')]?JSON[_0x7721('0x62')](_0x3cf3fd[_0x7721('0x46')]):_0x7721('0x6f'));return respondWithRpcPromise(_0x7721('0x70'),_0x7721('0x71'),_0x29ac64);}return null;})[_0x7721('0x15')](function(_0x55d209){var _0x19fad6=_0x7721('0x72')+_0x55d209[_0x7721('0x1c')]['ContactId'];return db[_0x7721('0x73')][_0x7721('0x31')](_0x19fad6,{'type':db[_0x7721('0x74')][_0x7721('0x75')][_0x7721('0x76')],'raw':!![]})['then'](function(_0x1276ce){return _0x1276ce;});})[_0x7721('0x15')](function(_0x44326d){if(_0x44326d){_0x29ac64[_0x7721('0x1c')][_0x7721('0x77')]=_0x44326d[0x0];if(!_0x3cf3fd[_0x7721('0x46')]['UserId'])return;return db[_0x7721('0x78')][_0x7721('0x45')]({'where':{'id':_0x3cf3fd['body'][_0x7721('0x67')],'role':'agent'},'attributes':['id',_0x7721('0x29'),_0x7721('0x79'),'email',_0x7721('0x7a')],'raw':!![]});}return null;})['then'](function(_0x56069f){if(!_0x56069f)return null;_0x29ac64['message'][_0x7721('0x68')]=_0x56069f;return _0x29ac64;})[_0x7721('0x15')](function(_0x21a686){if(_0x21a686){if(_0x3cf3fd['body']['manual']){_0x29ac64['message'][_0x7721('0x7b')]=util[_0x7721('0x60')](_0x7721('0x7c'),_0x3cf3fd[_0x7721('0x58')][_0x7721('0x29')]);_0x29ac64[_0x7721('0x1c')]['channel']=_0x29ac64[_0x7721('0x7d')];_0x29ac64[_0x7721('0x1c')][_0x7721('0x7e')]=_0x7721('0x63');_0x29ac64[_0x7721('0x1c')][_0x7721('0x46')]=htmlToText[_0x7721('0x7f')](_0x29ac64[_0x7721('0x1c')][_0x7721('0x46')]);return respondWithRpcPromise(_0x7721('0x80'),_0x7721('0x80'),{'event':_0x7721('0x81'),'message':_0x29ac64['message']},client9002)['then'](function(){return _0x29ac64;});}return _0x29ac64;}return null;})[_0x7721('0x15')](respondWithResult(_0x53adb1,null))[_0x7721('0x1e')](handleError(_0x53adb1,null));};exports['reject']=function(_0x167e05,_0x570cf4){var _0x4e3c93={'agent':{},'channel':_0x7721('0x64')};if(_0x167e05['body']['id']){delete _0x167e05['body']['id'];}_0x167e05[_0x7721('0x46')][_0x7721('0x67')]=_0x167e05[_0x7721('0x46')][_0x7721('0x67')]||_0x167e05[_0x7721('0x58')]['id'];_0x4e3c93['agent']['id']=_0x167e05[_0x7721('0x46')][_0x7721('0x67')];return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x167e05['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x570cf4,null))[_0x7721('0x15')](function(_0x1790d3){if(_0x1790d3){_0x4e3c93['message']=_0x1790d3[_0x7721('0x69')]({'plain':!![]});return db[_0x7721('0x82')]['find']({'where':{'id':_0x1790d3['MailInteractionId']}});}return null;})[_0x7721('0x15')](handleEntityNotFound(_0x570cf4,null))[_0x7721('0x15')](function(_0x606b4b){if(_0x606b4b){_0x4e3c93[_0x7721('0x6d')]=_0x606b4b[_0x7721('0x69')]({'plain':!![]});interaction_log[_0x7721('0x16')](_0x7721('0x83'),_0x167e05[_0x7721('0x58')]['id'],_0x167e05['user'][_0x7721('0x29')],_0x167e05[_0x7721('0x58')][_0x7721('0x6e')],_0x4e3c93[_0x7721('0x6d')]['id'],_0x167e05[_0x7721('0x46')]?JSON[_0x7721('0x62')](_0x167e05[_0x7721('0x46')]):'null');return respondWithRpcPromise(_0x7721('0x84'),_0x7721('0x85'),_0x4e3c93);}return null;})['then'](function(_0x9b3e44){var _0x1cc8ee=_0x7721('0x72')+_0x9b3e44[_0x7721('0x1c')][_0x7721('0x86')];return db[_0x7721('0x73')][_0x7721('0x31')](_0x1cc8ee,{'type':db[_0x7721('0x74')][_0x7721('0x75')][_0x7721('0x76')],'raw':!![]})['then'](function(_0x418954){return _0x418954;});})[_0x7721('0x15')](function(_0xc894d4){if(_0xc894d4){_0x4e3c93[_0x7721('0x1c')][_0x7721('0x77')]=_0xc894d4[0x0];if(!_0x167e05[_0x7721('0x46')][_0x7721('0x67')])return;return db[_0x7721('0x78')][_0x7721('0x45')]({'where':{'id':_0x167e05[_0x7721('0x46')][_0x7721('0x67')],'role':_0x7721('0x68')},'attributes':['id',_0x7721('0x29'),_0x7721('0x79'),_0x7721('0x87'),_0x7721('0x7a')],'raw':!![]});}return null;})[_0x7721('0x15')](function(_0x1fb651){if(!_0x1fb651)return null;_0x4e3c93[_0x7721('0x1c')][_0x7721('0x68')]=_0x1fb651;return _0x4e3c93;})['then'](function(_0x3fc25c){if(_0x3fc25c){_0x3fc25c['message'][_0x7721('0x7b')]=util[_0x7721('0x60')](_0x7721('0x7c'),_0x167e05[_0x7721('0x58')][_0x7721('0x29')]);_0x3fc25c['message']['channel']=_0x4e3c93['channel'];_0x3fc25c['message'][_0x7721('0x7e')]=_0x7721('0x88');_0x3fc25c[_0x7721('0x1c')][_0x7721('0x46')]=htmlToText[_0x7721('0x7f')](_0x4e3c93['message'][_0x7721('0x46')]);respondWithRpcPromise('EventManager',_0x7721('0x80'),{'event':_0x7721('0x89'),'message':_0x3fc25c[_0x7721('0x1c')]},client9002);return _0x4e3c93;}return null;})[_0x7721('0x15')](respondWithResult(_0x570cf4,null))[_0x7721('0x1e')](handleError(_0x570cf4,null));};exports[_0x7721('0x8a')]=function(_0x56b916,_0x30ce7c){var _0x56f321=moment()['unix']()[_0x7721('0x8b')]();var _0xf718dd=path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x8c'),'files',_0x7721('0x8d'));var _0x2561b5=path[_0x7721('0x5b')](config[_0x7721('0x5c')],_0x7721('0x8c'),_0x7721('0x8e'),_0x7721('0x5a'));var _0x50ee94=util[_0x7721('0x60')](_0x7721('0x8f'),_0x56f321);return db[_0x7721('0x2b')][_0x7721('0x45')]({'where':{'id':_0x56b916[_0x7721('0x42')]['id']},'attributes':['id','body',_0x7721('0x90'),'to','cc',_0x7721('0x91'),_0x7721('0x92'),'createdAt'],'include':_0x56b916[_0x7721('0x31')][_0x7721('0x5a')]?[{'model':db['Attachment'],'as':_0x7721('0x93')}]:undefined})[_0x7721('0x15')](handleEntityNotFound(_0x30ce7c,null))[_0x7721('0x15')](function(_0x30f548){if(_0x30f548){var _0x5b64de=_0x30f548;var _0x40beb8={'from':_0x5b64de['from'],'to':_0x5b64de['to'],'subject':_0x5b64de[_0x7721('0x92')],'html':_0x5b64de[_0x7721('0x46')],'headers':{'Date':moment(_0x5b64de['createdAt'])[_0x7721('0x60')](_0x7721('0x94'))},'attachments':[]};if(_0x30f548['cc']){_0x40beb8['headers']['Cc']=_0x30f548['cc'];}if(_0x30f548[_0x7721('0x91')]){_0x40beb8[_0x7721('0x95')]['Bcc']=_0x30f548[_0x7721('0x91')];}return new BPromise(function(_0x52e8b1,_0x240b0a){if(_0x30f548[_0x7721('0x93')]){for(var _0x271632=0x0;_0x271632<_0x30f548['Attachments'][_0x7721('0x43')];_0x271632++){var _0x506f9c=_0x30f548['Attachments'][_0x271632];var _0x287d61=path[_0x7721('0x5b')](_0x2561b5,_0x506f9c[_0x7721('0x96')]);if(fs[_0x7721('0x97')](_0x287d61)){_0x40beb8[_0x7721('0x5a')]['push']({'name':_0x506f9c[_0x7721('0x29')],'contentType':_0x506f9c[_0x7721('0x2d')],'data':fs[_0x7721('0x98')](_0x287d61)});}}}emlformat[_0x7721('0x99')](_0x40beb8,function(_0x42cd58,_0x58173d){if(_0x42cd58)return _0x240b0a(_0x42cd58);fs[_0x7721('0x9a')](path['join'](_0xf718dd,_0x50ee94),_0x58173d);return _0x52e8b1(_0x58173d);});});}})[_0x7721('0x15')](function(_0x4ade82){if(_0x4ade82){return _0x30ce7c['download'](path[_0x7721('0x5b')](_0xf718dd,_0x50ee94),_0x50ee94,function(_0x52f3c8){if(!_0x52f3c8)fs['unlinkSync'](path[_0x7721('0x5b')](_0xf718dd,_0x50ee94));});}})[_0x7721('0x1e')](handleError(_0x30ce7c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0f66c89..7e9762d 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 _0xeee0=['save','update','remove','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x1a18f6,_0x58266e){var _0x1a72fc=function(_0x123460){while(--_0x123460){_0x1a18f6['push'](_0x1a18f6['shift']());}};_0x1a72fc(++_0x58266e);}(_0xeee0,0x13c));var _0x0eee=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xeee0[_0x1acc2d];return _0xabfa6d;};'use strict';var EventEmitter=require(_0x0eee('0x0'));var MailMessage=require(_0x0eee('0x1'))['db'][_0x0eee('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0eee('0x3')](0x0);var events={'afterCreate':_0x0eee('0x4'),'afterUpdate':_0x0eee('0x5'),'afterDestroy':_0x0eee('0x6')};function emitEvent(_0x21f387){return function(_0x2227c6,_0x235e4f,_0x1b6a4d){MailMessageEvents[_0x0eee('0x7')](_0x21f387+':'+_0x2227c6['id'],_0x2227c6);MailMessageEvents[_0x0eee('0x7')](_0x21f387,_0x2227c6);_0x1b6a4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x0eee('0x8')](e,emitEvent(event));}}module[_0x0eee('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x83fe=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x83fe,0x1cf));var _0xe83f=function(_0x49acca,_0x498ccf){_0x49acca=_0x49acca-0x0;var _0xa951db=_0x83fe[_0x49acca];return _0xa951db;};'use strict';var EventEmitter=require(_0xe83f('0x0'));var MailMessage=require(_0xe83f('0x1'))['db'][_0xe83f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe83f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe83f('0x4'),'afterDestroy':_0xe83f('0x5')};function emitEvent(_0x1992e5){return function(_0x521992,_0x29f7ee,_0x4d6444){MailMessageEvents['emit'](_0x1992e5+':'+_0x521992['id'],_0x521992);MailMessageEvents['emit'](_0x1992e5,_0x521992);_0x4d6444(null);};}for(var e in events){if(events[_0xe83f('0x6')](e)){var event=events[e];MailMessage[_0xe83f('0x7')](e,emitEvent(event));}}module[_0xe83f('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 e53f3d8..5ec9f6d 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 _0xaeac=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch'];(function(_0x3d1683,_0x43fcab){var _0x5440f6=function(_0x46764f){while(--_0x46764f){_0x3d1683['push'](_0x3d1683['shift']());}};_0x5440f6(++_0x43fcab);}(_0xaeac,0x14d));var _0xcaea=function(_0x37ff29,_0x4c79a4){_0x37ff29=_0x37ff29-0x0;var _0x5d79b7=_0xaeac[_0x37ff29];return _0x5d79b7;};'use strict';var _=require(_0xcaea('0x0'));var util=require(_0xcaea('0x1'));var logger=require('../../config/logger')(_0xcaea('0x2'));var moment=require(_0xcaea('0x3'));var BPromise=require('bluebird');var rp=require(_0xcaea('0x4'));var htmlToText=require(_0xcaea('0x5'));var fs=require('fs');var path=require(_0xcaea('0x6'));var rimraf=require('rimraf');var config=require(_0xcaea('0x7'));var attributes=require(_0xcaea('0x8'));module['exports']=function(_0x78d708,_0x4f799e){return _0x78d708[_0xcaea('0x9')](_0xcaea('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xcaea('0xb'),'fields':[_0xcaea('0xb')]},{'name':_0xcaea('0xc'),'fields':[_0xcaea('0xd'),'subject'],'type':_0xcaea('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x153d7c,_0x184923,_0x37adbf){if(_0x153d7c['body']){_0x153d7c[_0xcaea('0xd')]=htmlToText['fromString'](_0x153d7c[_0xcaea('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x37adbf(null,_0x184923);},'afterCreate':function(_0x4b0854,_0x4a9495,_0x34cdd0){var _0x1784b0=_0x78d708[_0xcaea('0x10')];var _0x268a95=_0x4b0854[_0xcaea('0x11')]({'plain':!![]});if(_0x268a95[_0xcaea('0x12')][_0xcaea('0x13')]()==='in'||_0x268a95[_0xcaea('0x12')][_0xcaea('0x13')]()===_0xcaea('0x14')&&!_0x268a95[_0xcaea('0x15')]&&!_[_0xcaea('0x16')](_0x268a95[_0xcaea('0x17')])){_0x1784b0[_0xcaea('0x18')][_0xcaea('0x19')]({'where':{'id':_0x268a95[_0xcaea('0x1a')]}})['then'](function(_0x318309){if(_0x318309){_0x318309[_0xcaea('0x1b')]({'lastMsgAt':_0x268a95[_0xcaea('0x1c')],'lastMsgDirection':_0x268a95['direction'][_0xcaea('0x13')]()});}})[_0xcaea('0x1d')](function(_0x4ccc25){console[_0xcaea('0x1e')](_0x4ccc25);});}_0x34cdd0();}},'charset':_0xcaea('0x1f'),'collate':_0xcaea('0x20')});}; \ No newline at end of file +var _0x0d81=['MailMessage','mail_messages','messageId','plainBody','FULLTEXT','fromString','body','models','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports'];(function(_0x3314a3,_0x34eaec){var _0x266a03=function(_0x22d8b0){while(--_0x22d8b0){_0x3314a3['push'](_0x3314a3['shift']());}};_0x266a03(++_0x34eaec);}(_0x0d81,0x6d));var _0x10d8=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x0d81[_0x99facc];return _0xd39ed0;};'use strict';var _=require(_0x10d8('0x0'));var util=require(_0x10d8('0x1'));var logger=require('../../config/logger')(_0x10d8('0x2'));var moment=require(_0x10d8('0x3'));var BPromise=require(_0x10d8('0x4'));var rp=require(_0x10d8('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x10d8('0x6'));var rimraf=require(_0x10d8('0x7'));var config=require(_0x10d8('0x8'));var attributes=require(_0x10d8('0x9'));module[_0x10d8('0xa')]=function(_0x327bee,_0x438da2){return _0x327bee['define'](_0x10d8('0xb'),attributes,{'tableName':_0x10d8('0xc'),'paranoid':![],'indexes':[{'name':_0x10d8('0xd'),'fields':[_0x10d8('0xd')]},{'name':'fti_mail_messages','fields':[_0x10d8('0xe'),'subject'],'type':_0x10d8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b8fe0,_0x1ecb84,_0x2c3ba6){if(_0x4b8fe0['body']){_0x4b8fe0[_0x10d8('0xe')]=htmlToText[_0x10d8('0x10')](_0x4b8fe0[_0x10d8('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2c3ba6(null,_0x1ecb84);},'afterCreate':function(_0x3ebbe4,_0x50c622,_0x4df7a1){var _0x7c7e0a=_0x327bee[_0x10d8('0x12')];var _0x28c12c=_0x3ebbe4['get']({'plain':!![]});if(_0x28c12c[_0x10d8('0x13')][_0x10d8('0x14')]()==='in'||_0x28c12c[_0x10d8('0x13')][_0x10d8('0x14')]()===_0x10d8('0x15')&&!_0x28c12c['secret']&&!_[_0x10d8('0x16')](_0x28c12c[_0x10d8('0x17')])){_0x7c7e0a[_0x10d8('0x18')][_0x10d8('0x19')]({'where':{'id':_0x28c12c['MailInteractionId']}})['then'](function(_0x303bf5){if(_0x303bf5){_0x303bf5['update']({'lastMsgAt':_0x28c12c[_0x10d8('0x1a')],'lastMsgDirection':_0x28c12c[_0x10d8('0x13')][_0x10d8('0x14')]()});}})[_0x10d8('0x1b')](function(_0x5b76d3){console[_0x10d8('0x1c')](_0x5b76d3);});}_0x4df7a1();}},'charset':'utf8mb4','collate':_0x10d8('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 941248b..b6ec960 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 _0xbbbc=['CreateMailMessage','MailMessage','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x325511,_0x580446){_0x325511=_0x325511-0x0;var _0x3ab17a=_0xbbbc[_0x325511];return _0x3ab17a;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('MailMessage,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')](_0x25e92f[_0xcbbb('0x1d')],{'raw':_0x25e92f['options']?_0x25e92f[_0xcbbb('0x1e')][_0xcbbb('0x1f')]===undefined?!![]:![]:!![]})[_0xcbbb('0x20')](function(_0x42aaf1){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x21')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x42aaf1));_0x1cca90(_0x42aaf1);})['catch'](function(_0xf39ddd){logger[_0xcbbb('0x16')]('CreateMailMessage',_0xf39ddd[_0xcbbb('0x18')],_0x25e92f);_0x45de5f(_0x658337['error'](0x1f4,_0xf39ddd['message']));});});}; \ No newline at end of file +var _0x160f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./mailMessage.socket','register','request','then','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','options','raw'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf160('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf160('0xd'))[_0xf160('0xe')](socket);function respondWithRpcPromise(_0x393f70,_0x2736b8,_0x5e09c6){return new BPromise(function(_0x4a0639,_0xf8ec3d){return client[_0xf160('0xf')](_0x393f70,_0x5e09c6)[_0xf160('0x10')](function(_0x56072f){logger[_0xf160('0x11')](_0xf160('0x12'),_0x2736b8,_0xf160('0x13'));logger[_0xf160('0x14')](_0xf160('0x15'),_0x2736b8,'request\x20sent',JSON[_0xf160('0x16')](_0x56072f));if(_0x56072f['error']){if(_0x56072f[_0xf160('0x17')][_0xf160('0x18')]===0x1f4){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0xf8ec3d(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}logger[_0xf160('0x17')]('MailMessage,\x20%s,\x20%s',_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0x4a0639(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}else{logger['info'](_0xf160('0x12'),_0x2736b8,'request\x20sent');_0x4a0639(_0x56072f[_0xf160('0x1a')][_0xf160('0x19')]);}})[_0xf160('0x1b')](function(_0x1e09f3){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x1e09f3);_0xf8ec3d(_0x1e09f3);});});}exports[_0xf160('0x1c')]=function(_0x2a8cb4){var _0x1fdb38=this;return new Promise(function(_0x4a58d9,_0x40ccf0){return db[_0xf160('0x1d')][_0xf160('0x1e')](_0x2a8cb4['body'],{'raw':_0x2a8cb4[_0xf160('0x1f')]?_0x2a8cb4[_0xf160('0x1f')][_0xf160('0x20')]===undefined?!![]:![]:!![]})[_0xf160('0x10')](function(_0x2e03c8){logger[_0xf160('0x11')](_0xf160('0x1c'),_0x2a8cb4);logger['debug'](_0xf160('0x1c'),_0x2a8cb4,JSON[_0xf160('0x16')](_0x2e03c8));_0x4a58d9(_0x2e03c8);})[_0xf160('0x1b')](function(_0x49bb5c){logger['error'](_0xf160('0x1c'),_0x49bb5c[_0xf160('0x19')],_0x2a8cb4);_0x40ccf0(_0x1fdb38['error'](0x1f4,_0x49bb5c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 199a1c7..0bde67f 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 _0xedc0=['./mailMessage.events','remove','update','removeListener','length','mailMessage:'];(function(_0x4337e7,_0x12cf0b){var _0x3a22e5=function(_0x4719e8){while(--_0x4719e8){_0x4337e7['push'](_0x4337e7['shift']());}};_0x3a22e5(++_0x12cf0b);}(_0xedc0,0x12c));var _0x0edc=function(_0x18b56f,_0x2d8823){_0x18b56f=_0x18b56f-0x0;var _0x4df0e0=_0xedc0[_0x18b56f];return _0x4df0e0;};'use strict';var MailMessageEvents=require(_0x0edc('0x0'));var events=['save',_0x0edc('0x1'),_0x0edc('0x2')];function createListener(_0x255abf,_0x347c2f){return function(_0x3522a1){_0x347c2f['emit'](_0x255abf,_0x3522a1);};}function removeListener(_0x43e377,_0x47d263){return function(){MailMessageEvents[_0x0edc('0x3')](_0x43e377,_0x47d263);};}exports['register']=function(_0x597d9e){for(var _0x20d011=0x0,_0x561102=events[_0x0edc('0x4')];_0x20d011<_0x561102;_0x20d011++){var _0x27ff01=events[_0x20d011];var _0x3f9e3f=createListener(_0x0edc('0x5')+_0x27ff01,_0x597d9e);MailMessageEvents['on'](_0x27ff01,_0x3f9e3f);}}; \ No newline at end of file +var _0x61a2=['removeListener','register','length','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x61a2,0x184));var _0x261a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61a2[_0xa464c9];return _0x3d73c4;};'use strict';var MailMessageEvents=require(_0x261a('0x0'));var events=[_0x261a('0x1'),'remove',_0x261a('0x2')];function createListener(_0x3011e0,_0xa42e1e){return function(_0x236b91){_0xa42e1e[_0x261a('0x3')](_0x3011e0,_0x236b91);};}function removeListener(_0x156ef3,_0x104617){return function(){MailMessageEvents[_0x261a('0x4')](_0x156ef3,_0x104617);};}exports[_0x261a('0x5')]=function(_0x3bba0c){for(var _0x209c7c=0x0,_0x4c8f2b=events[_0x261a('0x6')];_0x209c7c<_0x4c8f2b;_0x209c7c++){var _0x1eaa92=events[_0x209c7c];var _0x1457e8=createListener(_0x261a('0x7')+_0x1eaa92,_0x3bba0c);MailMessageEvents['on'](_0x1eaa92,_0x1457e8);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9385e56..339cfbc 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 _0x57ab=['isAuthenticated','index','get','/describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','delete','destroy','removeTeams','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller'];(function(_0x452d6a,_0x24c4b0){var _0x512067=function(_0x48aef2){while(--_0x48aef2){_0x452d6a['push'](_0x452d6a['shift']());}};_0x512067(++_0x24c4b0);}(_0x57ab,0x110));var _0xb57a=function(_0x3aba72,_0x1f4876){_0x3aba72=_0x3aba72-0x0;var _0x59b797=_0x57ab[_0x3aba72];return _0x59b797;};'use strict';var multer=require(_0xb57a('0x0'));var util=require(_0xb57a('0x1'));var path=require(_0xb57a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb57a('0x3')]();var fs_extra=require(_0xb57a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb57a('0x5'));var config=require(_0xb57a('0x6'));var controller=require(_0xb57a('0x7'));router['get']('/',auth[_0xb57a('0x8')](),controller[_0xb57a('0x9')]);router[_0xb57a('0xa')](_0xb57a('0xb'),auth[_0xb57a('0x8')](),controller['describe']);router['get'](_0xb57a('0xc'),auth['isAuthenticated'](),controller[_0xb57a('0xd')]);router[_0xb57a('0xa')](_0xb57a('0xe'),auth[_0xb57a('0x8')](),controller['getMembers']);router['get'](_0xb57a('0xf'),auth['isAuthenticated'](),controller[_0xb57a('0x10')]);router[_0xb57a('0xa')]('/:id/users',auth[_0xb57a('0x8')](),controller[_0xb57a('0x11')]);router[_0xb57a('0x12')]('/',auth[_0xb57a('0x8')](),controller[_0xb57a('0x13')]);router[_0xb57a('0x12')](_0xb57a('0xf'),auth[_0xb57a('0x8')](),controller[_0xb57a('0x14')]);router[_0xb57a('0x12')](_0xb57a('0x15'),auth[_0xb57a('0x8')](),controller['addAgents']);router[_0xb57a('0x16')](_0xb57a('0xc'),auth[_0xb57a('0x8')](),controller[_0xb57a('0x17')]);router[_0xb57a('0x18')](_0xb57a('0xc'),auth['isAuthenticated'](),controller[_0xb57a('0x19')]);router[_0xb57a('0x18')]('/:id/teams',auth[_0xb57a('0x8')](),controller[_0xb57a('0x1a')]);router[_0xb57a('0x18')](_0xb57a('0x15'),auth[_0xb57a('0x8')](),controller['removeAgents']);module[_0xb57a('0x1b')]=router; \ No newline at end of file +var _0x34f9=['update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create'];(function(_0x58d006,_0x163581){var _0x44def4=function(_0x2d50c3){while(--_0x2d50c3){_0x58d006['push'](_0x58d006['shift']());}};_0x44def4(++_0x163581);}(_0x34f9,0x1d9));var _0x934f=function(_0xf01a3a,_0x2ea8f5){_0xf01a3a=_0xf01a3a-0x0;var _0x2f7c3e=_0x34f9[_0xf01a3a];return _0x2f7c3e;};'use strict';var multer=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var path=require('path');var timeout=require(_0x934f('0x2'));var express=require(_0x934f('0x3'));var router=express[_0x934f('0x4')]();var fs_extra=require(_0x934f('0x5'));var auth=require(_0x934f('0x6'));var interaction=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var controller=require('./mailQueue.controller');router[_0x934f('0x9')]('/',auth[_0x934f('0xa')](),controller[_0x934f('0xb')]);router['get'](_0x934f('0xc'),auth[_0x934f('0xa')](),controller[_0x934f('0xd')]);router[_0x934f('0x9')](_0x934f('0xe'),auth[_0x934f('0xa')](),controller[_0x934f('0xf')]);router[_0x934f('0x9')]('/:id/members',auth[_0x934f('0xa')](),controller[_0x934f('0x10')]);router[_0x934f('0x9')](_0x934f('0x11'),auth[_0x934f('0xa')](),controller['getTeams']);router['get'](_0x934f('0x12'),auth[_0x934f('0xa')](),controller[_0x934f('0x13')]);router['post']('/',auth[_0x934f('0xa')](),controller[_0x934f('0x14')]);router['post'](_0x934f('0x11'),auth[_0x934f('0xa')](),controller['addTeams']);router['post']('/:id/users',auth[_0x934f('0xa')](),controller['addAgents']);router['put'](_0x934f('0xe'),auth[_0x934f('0xa')](),controller[_0x934f('0x15')]);router[_0x934f('0x16')](_0x934f('0xe'),auth[_0x934f('0xa')](),controller[_0x934f('0x17')]);router[_0x934f('0x16')](_0x934f('0x11'),auth[_0x934f('0xa')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x934f('0xa')](),controller[_0x934f('0x18')]);module[_0x934f('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 ab0b686..ca11b4a 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 _0x52e5=['sequelize','exports','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x23d313,_0x4a9058){var _0x30aaa0=function(_0x4f3735){while(--_0x4f3735){_0x23d313['push'](_0x23d313['shift']());}};_0x30aaa0(++_0x4a9058);}(_0x52e5,0xcb));var _0x552e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x52e5[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x552e('0x0'));module[_0x552e('0x1')]={'name':{'type':Sequelize[_0x552e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x552e('0x2')]},'timeout':{'type':Sequelize[_0x552e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x552e('0x4'),_0x552e('0x5'),_0x552e('0x6'))}}; \ No newline at end of file +var _0x49b6=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','name'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x49b6,0xec));var _0x649b=function(_0x4748a2,_0x5d04bd){_0x4748a2=_0x4748a2-0x0;var _0x16c342=_0x49b6[_0x4748a2];return _0x16c342;};'use strict';var Sequelize=require(_0x649b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x649b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x649b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x649b('0x3')](_0x649b('0x4'),_0x649b('0x5'),_0x649b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ca81a4c..9f43230 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 _0x699a=['select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','UserProfileResource','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','type','include','rows','catch','params','includeAll','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','findAll','User','UserId','mailPause','updatedAt','createdAt','format','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','removeTeams','ids'];(function(_0x38a09e,_0x35178f){var _0x1c645b=function(_0x4104a0){while(--_0x4104a0){_0x38a09e['push'](_0x38a09e['shift']());}};_0x1c645b(++_0x35178f);}(_0x699a,0x12a));var _0xa699=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0x699a[_0x558e45];return _0x3e9075;};'use strict';var emlformat=require(_0xa699('0x0'));var rimraf=require(_0xa699('0x1'));var zipdir=require(_0xa699('0x2'));var jsonpatch=require(_0xa699('0x3'));var rp=require('request-promise');var moment=require(_0xa699('0x4'));var BPromise=require(_0xa699('0x5'));var Mustache=require(_0xa699('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa699('0x7'));var csv=require(_0xa699('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa699('0x9'));var _=require(_0xa699('0xa'));var squel=require(_0xa699('0xb'));var crypto=require(_0xa699('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa699('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa699('0xe'));var Redis=require(_0xa699('0xf'));var authService=require(_0xa699('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa699('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa699('0x12'))(_0xa699('0x13'));var utils=require('../../config/utils');var config=require(_0xa699('0x14'));var licenseUtil=require(_0xa699('0x15'));var db=require(_0xa699('0x16'))['db'];config[_0xa699('0x17')]=_['defaults'](config[_0xa699('0x17')],{'host':_0xa699('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa699('0x17')]));require('./mailQueue.socket')[_0xa699('0x19')](socket);function respondWithStatusCode(_0x538dfe,_0x129d3a){_0x129d3a=_0x129d3a||0xcc;return function(_0x1633dc){if(_0x1633dc){return _0x538dfe[_0xa699('0x1a')](_0x129d3a);}return _0x538dfe[_0xa699('0x1b')](_0x129d3a)['end']();};}function respondWithResult(_0x570208,_0x3b90bf){_0x3b90bf=_0x3b90bf||0xc8;return function(_0x3dd2e0){if(_0x3dd2e0){return _0x570208[_0xa699('0x1b')](_0x3b90bf)[_0xa699('0x1c')](_0x3dd2e0);}};}function respondWithFilteredResult(_0xd2402f,_0x2d5af8){return function(_0x398758){if(_0x398758){var _0xb151c3=typeof _0x2d5af8[_0xa699('0x1d')]==='undefined'&&typeof _0x2d5af8[_0xa699('0x1e')]===_0xa699('0x1f');var _0x59b2ad=_0x398758['count'];var _0x3351d7=_0xb151c3?0x0:_0x2d5af8[_0xa699('0x1d')];var _0xdb3270=_0xb151c3?_0x398758[_0xa699('0x20')]:_0x2d5af8[_0xa699('0x1d')]+_0x2d5af8['limit'];var _0x5b13c7;if(_0xdb3270>=_0x59b2ad){_0xdb3270=_0x59b2ad;_0x5b13c7=0xc8;}else{_0x5b13c7=0xce;}_0xd2402f[_0xa699('0x1b')](_0x5b13c7);return _0xd2402f[_0xa699('0x21')](_0xa699('0x22'),_0x3351d7+'-'+_0xdb3270+'/'+_0x59b2ad)[_0xa699('0x1c')](_0x398758);}return null;};}function patchUpdates(_0x5955b4){return function(_0x3d236d){try{jsonpatch['apply'](_0x3d236d,_0x5955b4,!![]);}catch(_0x3a8bfd){return BPromise[_0xa699('0x23')](_0x3a8bfd);}return _0x3d236d[_0xa699('0x24')]();};}function saveUpdates(_0x6c4297,_0x2e3307){return function(_0x2595dc){if(_0x2595dc){return _0x2595dc[_0xa699('0x25')](_0x6c4297)['then'](function(_0x4bf14f){return _0x4bf14f;});}return null;};}function removeEntity(_0x259261,_0x4fa6ed){return function(_0x1f4351){if(_0x1f4351){return _0x1f4351[_0xa699('0x26')]()[_0xa699('0x27')](function(){var _0xe9f284=_0x1f4351['get']({'plain':!![]});var _0x38c312='MailQueues';return db[_0xa699('0x28')][_0xa699('0x26')]({'where':{'type':_0x38c312,'resourceId':_0xe9f284['id']}})[_0xa699('0x27')](function(){return _0x1f4351;});})[_0xa699('0x27')](function(){_0x259261[_0xa699('0x1b')](0xcc)[_0xa699('0x29')]();});}};}function handleEntityNotFound(_0x42ce02,_0x13bc96){return function(_0x4eb1ab){if(!_0x4eb1ab){_0x42ce02[_0xa699('0x1a')](0x194);}return _0x4eb1ab;};}function handleError(_0x54bccf,_0x39feef){_0x39feef=_0x39feef||0x1f4;return function(_0x204de2){logger[_0xa699('0x2a')](_0x204de2[_0xa699('0x2b')]);if(_0x204de2['name']){delete _0x204de2[_0xa699('0x2c')];}_0x54bccf[_0xa699('0x1b')](_0x39feef)[_0xa699('0x2d')](_0x204de2);};}exports[_0xa699('0x2e')]=function(_0x4d0ef5,_0x4fe94b){var _0x3c88dd={},_0x7a73ea={},_0x2b3299={'count':0x0,'rows':[]};var _0x838496=_[_0xa699('0x2f')](db[_0xa699('0x30')][_0xa699('0x31')],function(_0xe5663c){return{'name':_0xe5663c[_0xa699('0x32')],'type':_0xe5663c['type'][_0xa699('0x33')]};});_0x7a73ea[_0xa699('0x34')]=_[_0xa699('0x2f')](_0x838496,_0xa699('0x2c'));_0x7a73ea[_0xa699('0x35')]=_[_0xa699('0x36')](_0x4d0ef5[_0xa699('0x35')]);_0x7a73ea['filters']=_[_0xa699('0x37')](_0x7a73ea[_0xa699('0x34')],_0x7a73ea[_0xa699('0x35')]);_0x3c88dd[_0xa699('0x38')]=_[_0xa699('0x37')](_0x7a73ea[_0xa699('0x34')],qs[_0xa699('0x39')](_0x4d0ef5['query']['fields']));_0x3c88dd[_0xa699('0x38')]=_0x3c88dd[_0xa699('0x38')][_0xa699('0x3a')]?_0x3c88dd[_0xa699('0x38')]:_0x7a73ea[_0xa699('0x34')];if(!_0x4d0ef5[_0xa699('0x35')][_0xa699('0x3b')](_0xa699('0x3c'))){_0x3c88dd[_0xa699('0x1e')]=qs['limit'](_0x4d0ef5[_0xa699('0x35')][_0xa699('0x1e')]);_0x3c88dd[_0xa699('0x1d')]=qs[_0xa699('0x1d')](_0x4d0ef5[_0xa699('0x35')][_0xa699('0x1d')]);}_0x3c88dd['order']=qs['sort'](_0x4d0ef5[_0xa699('0x35')][_0xa699('0x3d')]);_0x3c88dd['where']=qs[_0xa699('0x3e')](_[_0xa699('0x3f')](_0x4d0ef5[_0xa699('0x35')],_0x7a73ea[_0xa699('0x3e')]),_0x838496);if(_0x4d0ef5[_0xa699('0x35')][_0xa699('0x40')]){_0x3c88dd['where']=_[_0xa699('0x41')](_0x3c88dd[_0xa699('0x42')],{'$or':_[_0xa699('0x2f')](_0x838496,function(_0x322d73){if(_0x322d73[_0xa699('0x43')]!=='VIRTUAL'){var _0x304fc5={};_0x304fc5[_0x322d73['name']]={'$like':'%'+_0x4d0ef5[_0xa699('0x35')][_0xa699('0x40')]+'%'};return _0x304fc5;}})});}_0x3c88dd=_[_0xa699('0x41')]({},_0x3c88dd,_0x4d0ef5['options']);var _0x2df6ac={'where':_0x3c88dd[_0xa699('0x42')]};return db[_0xa699('0x30')][_0xa699('0x20')](_0x2df6ac)[_0xa699('0x27')](function(_0x590d01){_0x2b3299['count']=_0x590d01;if(_0x4d0ef5['query']['includeAll']){_0x3c88dd[_0xa699('0x44')]=[{'all':!![]}];}return db[_0xa699('0x30')]['findAll'](_0x3c88dd);})['then'](function(_0x29cfbf){_0x2b3299[_0xa699('0x45')]=_0x29cfbf;return _0x2b3299;})[_0xa699('0x27')](respondWithFilteredResult(_0x4fe94b,_0x3c88dd))[_0xa699('0x46')](handleError(_0x4fe94b,null));};exports['show']=function(_0x379b08,_0x270dd4){var _0x3ac87d={'raw':!![],'where':{'id':_0x379b08[_0xa699('0x47')]['id']}},_0xcf65ca={};_0xcf65ca['model']=_[_0xa699('0x36')](db[_0xa699('0x30')][_0xa699('0x31')]);_0xcf65ca[_0xa699('0x35')]=_['keys'](_0x379b08[_0xa699('0x35')]);_0xcf65ca['filters']=_[_0xa699('0x37')](_0xcf65ca[_0xa699('0x34')],_0xcf65ca['query']);_0x3ac87d['attributes']=_['intersection'](_0xcf65ca[_0xa699('0x34')],qs[_0xa699('0x39')](_0x379b08[_0xa699('0x35')][_0xa699('0x39')]));_0x3ac87d[_0xa699('0x38')]=_0x3ac87d[_0xa699('0x38')][_0xa699('0x3a')]?_0x3ac87d['attributes']:_0xcf65ca[_0xa699('0x34')];if(_0x379b08['query'][_0xa699('0x48')]){_0x3ac87d[_0xa699('0x44')]=[{'all':!![]}];}_0x3ac87d=_[_0xa699('0x41')]({},_0x3ac87d,_0x379b08[_0xa699('0x49')]);return db['MailQueue']['find'](_0x3ac87d)['then'](handleEntityNotFound(_0x270dd4,null))[_0xa699('0x27')](respondWithResult(_0x270dd4,null))[_0xa699('0x46')](handleError(_0x270dd4,null));};exports[_0xa699('0x4a')]=function(_0x2aade8,_0xd108ca){return db[_0xa699('0x30')][_0xa699('0x4a')](_0x2aade8['body'],{})['then'](function(_0x199f6f){var _0x5eb2eb=_0x2aade8['user'][_0xa699('0x4b')]({'plain':!![]});if(!_0x5eb2eb)throw new Error(_0xa699('0x4c'));if(_0x5eb2eb[_0xa699('0x4d')]===_0xa699('0x4e')){var _0x20a09a=_0x199f6f[_0xa699('0x4b')]({'plain':!![]});var _0x3fdd55='MailQueues';return db['UserProfileSection'][_0xa699('0x4f')]({'where':{'name':_0x3fdd55,'userProfileId':_0x5eb2eb['userProfileId']},'raw':!![]})[_0xa699('0x27')](function(_0x4c9643){if(_0x4c9643&&_0x4c9643[_0xa699('0x50')]===0x0){return db[_0xa699('0x28')][_0xa699('0x4a')]({'name':_0x20a09a[_0xa699('0x2c')],'resourceId':_0x20a09a['id'],'type':_0x4c9643[_0xa699('0x2c')],'sectionId':_0x4c9643['id']},{})[_0xa699('0x27')](function(){return _0x199f6f;});}else{return _0x199f6f;}})[_0xa699('0x46')](function(_0xfdb2df){logger[_0xa699('0x2a')](_0xa699('0x51'),_0xfdb2df);throw _0xfdb2df;});}return _0x199f6f;})[_0xa699('0x27')](respondWithResult(_0xd108ca,0xc9))[_0xa699('0x46')](handleError(_0xd108ca,null));};exports['update']=function(_0x995160,_0x5a69e8){if(_0x995160[_0xa699('0x52')]['id']){delete _0x995160[_0xa699('0x52')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x995160[_0xa699('0x47')]['id']}})[_0xa699('0x27')](handleEntityNotFound(_0x5a69e8,null))[_0xa699('0x27')](saveUpdates(_0x995160['body'],null))['then'](respondWithResult(_0x5a69e8,null))[_0xa699('0x46')](handleError(_0x5a69e8,null));};exports[_0xa699('0x26')]=function(_0x1b76d9,_0x2ebbdc){return db[_0xa699('0x30')][_0xa699('0x4f')]({'where':{'id':_0x1b76d9[_0xa699('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ebbdc,null))[_0xa699('0x27')](removeEntity(_0x2ebbdc,null))[_0xa699('0x46')](handleError(_0x2ebbdc,null));};exports[_0xa699('0x53')]=function(_0x230bde,_0x40ab4c){return db[_0xa699('0x30')][_0xa699('0x53')]()[_0xa699('0x27')](respondWithResult(_0x40ab4c,null))[_0xa699('0x46')](handleError(_0x40ab4c,null));};exports[_0xa699('0x54')]=function(_0x3a80,_0xdbd15a,_0x40e4d8){var _0x12f35f={'raw':!![],'where':{}},_0x5481b3={},_0x2efb25;return db[_0xa699('0x30')][_0xa699('0x55')]({'where':{'id':_0x3a80[_0xa699('0x47')]['id']}})[_0xa699('0x27')](handleEntityNotFound(_0xdbd15a,null))['then'](function(_0x3c475d){if(_0x3c475d){_0x2efb25=_0x3c475d[_0xa699('0x4b')]({'plain':!![]});_0x5481b3[_0xa699('0x34')]=_['keys'](db[_0xa699('0x56')][_0xa699('0x31')]);_0x5481b3[_0xa699('0x35')]=_[_0xa699('0x36')](_0x3a80['query']);_0x5481b3[_0xa699('0x3e')]=_['intersection'](_0x5481b3['model'],_0x5481b3[_0xa699('0x35')]);_0x12f35f[_0xa699('0x38')]=_[_0xa699('0x37')](_0x5481b3['model'],qs['fields'](_0x3a80[_0xa699('0x35')][_0xa699('0x39')]));_0x12f35f['attributes']=_0x12f35f['attributes'][_0xa699('0x3a')]?_0x12f35f[_0xa699('0x38')]:_0x5481b3[_0xa699('0x34')];if(!_0x3a80[_0xa699('0x35')][_0xa699('0x3b')](_0xa699('0x3c'))){_0x12f35f['limit']=qs['limit'](_0x3a80[_0xa699('0x35')][_0xa699('0x1e')]);_0x12f35f['offset']=qs[_0xa699('0x1d')](_0x3a80[_0xa699('0x35')][_0xa699('0x1d')]);}_0x12f35f[_0xa699('0x57')]=qs[_0xa699('0x3d')](_0x3a80[_0xa699('0x35')][_0xa699('0x3d')]);_0x12f35f[_0xa699('0x42')]=qs[_0xa699('0x3e')](_[_0xa699('0x3f')](_0x3a80[_0xa699('0x35')],_0x5481b3['filters']));_0x12f35f[_0xa699('0x42')][_0xa699('0x58')]=_0x3c475d['id'];if(_0x3a80[_0xa699('0x35')][_0xa699('0x40')]){_0x12f35f[_0xa699('0x42')]=_[_0xa699('0x41')](_0x12f35f[_0xa699('0x42')],{'$or':_[_0xa699('0x2f')](_0x12f35f['attributes'],function(_0x3594db){var _0x2a5012={};_0x2a5012[_0x3594db]={'$like':'%'+_0x3a80[_0xa699('0x35')][_0xa699('0x40')]+'%'};return _0x2a5012;})});}_0x12f35f=_['merge']({},_0x12f35f,_0x3a80[_0xa699('0x49')]);return db[_0xa699('0x56')][_0xa699('0x59')](_0x12f35f);}})[_0xa699('0x27')](function(_0x1bf8b9){if(_0x1bf8b9){return db[_0xa699('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0x1bf8b9,_0xa699('0x5b')),'role':'agent'},'attributes':['id',_0xa699('0x2c'),_0xa699('0x5c'),_0xa699('0x5d'),_0xa699('0x5e')]});}})[_0xa699('0x27')](function(_0x2289df){if(_0x2289df){return{'count':_0x2289df[_0xa699('0x20')],'rows':_[_0xa699('0x2f')](_0x2289df[_0xa699('0x45')],function(_0x10ef65){return{'membername':_0x10ef65['name'],'UserId':_0x10ef65['id'],'queue_name':_0x2efb25[_0xa699('0x2c')],'MailQueueId':_0x2efb25['id'],'interface':util[_0xa699('0x5f')]('%s/%s','SIP',_0x10ef65[_0xa699('0x2c')]),'penalty':0x0,'paused':_0x10ef65[_0xa699('0x5c')],'createdAt':_0x10ef65['createdAt'],'updatedAt':_0x10ef65[_0xa699('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xdbd15a,_0x12f35f))['catch'](handleError(_0xdbd15a,null));};exports[_0xa699('0x60')]=function(_0x47916d,_0x3e785c,_0x1b1e01){var _0x4e7627={};var _0x2b4aaa={};var _0x187345;var _0x32555c;return db[_0xa699('0x30')][_0xa699('0x55')]({'where':{'id':_0x47916d['params']['id']}})[_0xa699('0x27')](handleEntityNotFound(_0x3e785c,null))['then'](function(_0x27524e){if(_0x27524e){_0x187345=_0x27524e;_0x2b4aaa[_0xa699('0x34')]=_[_0xa699('0x36')](db[_0xa699('0x61')]['rawAttributes']);_0x2b4aaa[_0xa699('0x35')]=_[_0xa699('0x36')](_0x47916d[_0xa699('0x35')]);_0x2b4aaa[_0xa699('0x3e')]=_[_0xa699('0x37')](_0x2b4aaa[_0xa699('0x34')],_0x2b4aaa[_0xa699('0x35')]);_0x4e7627[_0xa699('0x38')]=_['intersection'](_0x2b4aaa[_0xa699('0x34')],qs[_0xa699('0x39')](_0x47916d['query'][_0xa699('0x39')]));_0x4e7627['attributes']=_0x4e7627[_0xa699('0x38')][_0xa699('0x3a')]?_0x4e7627[_0xa699('0x38')]:_0x2b4aaa[_0xa699('0x34')];_0x4e7627[_0xa699('0x57')]=qs[_0xa699('0x3d')](_0x47916d['query'][_0xa699('0x3d')]);_0x4e7627['where']=qs[_0xa699('0x3e')](_['pick'](_0x47916d[_0xa699('0x35')],_0x2b4aaa[_0xa699('0x3e')]));if(_0x47916d[_0xa699('0x35')][_0xa699('0x40')]){_0x4e7627['where']=_[_0xa699('0x41')](_0x4e7627[_0xa699('0x42')],{'$or':_[_0xa699('0x2f')](_0x4e7627[_0xa699('0x38')],function(_0x33c86b){var _0x37208e={};_0x37208e[_0x33c86b]={'$like':'%'+_0x47916d['query']['filter']+'%'};return _0x37208e;})});}_0x4e7627=_[_0xa699('0x41')]({},_0x4e7627,_0x47916d[_0xa699('0x49')]);return _0x187345[_0xa699('0x60')](_0x4e7627);}})[_0xa699('0x27')](function(_0x38f759){if(_0x38f759){_0x32555c=_0x38f759['length'];if(!_0x47916d[_0xa699('0x35')][_0xa699('0x3b')](_0xa699('0x3c'))){_0x4e7627[_0xa699('0x1e')]=qs[_0xa699('0x1e')](_0x47916d[_0xa699('0x35')]['limit']);_0x4e7627[_0xa699('0x1d')]=qs[_0xa699('0x1d')](_0x47916d[_0xa699('0x35')][_0xa699('0x1d')]);}return _0x187345[_0xa699('0x60')](_0x4e7627);}})[_0xa699('0x27')](function(_0x25ca2f){if(_0x25ca2f){return _0x25ca2f?{'count':_0x32555c,'rows':_0x25ca2f}:null;}})[_0xa699('0x27')](respondWithResult(_0x3e785c,null))['catch'](handleError(_0x3e785c,null));};exports[_0xa699('0x62')]=function(_0x5a2ee8,_0x34f202,_0x4f981f){var _0x3dff49=_0x5a2ee8[_0xa699('0x52')]['ids'];return db['Team'][_0xa699('0x59')]({'where':{'id':_0x3dff49},'attributes':['id'],'include':[{'model':db[_0xa699('0x5a')],'as':'Agents','attributes':['id',_0xa699('0x2c'),_0xa699('0x63'),_0xa699('0x64'),_0xa699('0x65')],'raw':!![]}]})[_0xa699('0x27')](function(_0x170f68){if(_0x170f68){var _0x35259a=_[_0xa699('0x66')](_0x170f68,function(_0x4e8de6){var _0x32ca12=_0x4e8de6[_0xa699('0x4b')]({'plain':!![]});return _0x32ca12[_0xa699('0x67')];});return db[_0xa699('0x30')][_0xa699('0x4f')]({'where':{'id':_0x5a2ee8[_0xa699('0x47')]['id']}})[_0xa699('0x27')](function(_0x7d5772){return db[_0xa699('0x68')][_0xa699('0x69')](function(_0x4c1d5e){return _0x7d5772[_0xa699('0x62')](_0x3dff49,{'transaction':_0x4c1d5e})[_0xa699('0x27')](function(){return BPromise[_0xa699('0x6a')](_0x35259a,function(_0x53b510){return db[_0xa699('0x56')]['findOrCreate']({'where':{'UserId':_0x53b510['id'],'MailQueueId':_0x5a2ee8[_0xa699('0x47')]['id']},'transaction':_0x4c1d5e});});})[_0xa699('0x27')](function(){_0x35259a[_0xa699('0x6b')](function(_0x2827d2){socket['emit']('userMailQueue:save',{'UserId':_0x2827d2['id'],'MailQueueId':_0x7d5772['id']});});});});});}})[_0xa699('0x27')](respondWithStatusCode(_0x34f202,null))[_0xa699('0x46')](handleError(_0x34f202,null));};exports[_0xa699('0x6c')]=function(_0x2ad52f,_0x240009,_0x3b2ac5){return db[_0xa699('0x61')]['findAll']({'where':{'id':_0x2ad52f[_0xa699('0x35')][_0xa699('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xa699('0x5a')],'as':_0xa699('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa699('0x27')](handleEntityNotFound(_0x240009,null))[_0xa699('0x27')](function(_0x3a2924){var _0x162f0d=_[_0xa699('0x2f')](_0x3a2924,'id');var _0x24239b=[];var _0x1a2ea4=[];var _0x2a162b=squel[_0xa699('0x6e')]();_0x2a162b[_0xa699('0x6f')](_0xa699('0x70'))['from'](_0xa699('0x71'),'tq')[_0xa699('0x72')]('user_has_teams','ut',_0xa699('0x73'))[_0xa699('0x42')](_0xa699('0x74'),_0x2ad52f[_0xa699('0x47')]['id']);for(var _0xd9b708=0x0;_0xd9b708<_0x3a2924[_0xa699('0x3a')];_0xd9b708+=0x1){let _0x4e183b=_0x3a2924[_0xd9b708];for(var _0x29c2de=0x0;_0x29c2de<_0x4e183b[_0xa699('0x67')][_0xa699('0x3a')];_0x29c2de+=0x1){let _0x413b99=_0x4e183b[_0xa699('0x67')][_0x29c2de];var _0x234e1b=_0x2a162b[_0xa699('0x75')]();_0x234e1b[_0xa699('0x42')]('ut.UserId\x20=\x20?',_0x413b99['id']);_0x1a2ea4[_0xa699('0x76')](db[_0xa699('0x68')][_0xa699('0x35')](_0x234e1b[_0xa699('0x77')](),{'type':db[_0xa699('0x68')]['QueryTypes'][_0xa699('0x78')]})[_0xa699('0x27')](function(_0x1df73c){if(_0x1df73c[_0xa699('0x3a')]===0x1){return _0x413b99['id'];}else{var _0x5646b6=_[_0xa699('0x79')](_[_0xa699('0x2f')](_0x1df73c,'TeamId'),function(_0x4d6986){return _[_0xa699('0x7a')](_0x162f0d,_0x4d6986);});if(_0x5646b6){return _0x413b99['id'];}}}));}}return BPromise[_0xa699('0x7b')](_0x1a2ea4)[_0xa699('0x27')](function(_0x12692d){_0x24239b=_(_0x24239b)[_0xa699('0x7c')](_0x12692d)[_0xa699('0x7d')]()['value']();return db[_0xa699('0x30')][_0xa699('0x4f')]({'where':{'id':_0x2ad52f[_0xa699('0x47')]['id']}})[_0xa699('0x27')](function(_0x432650){return db[_0xa699('0x68')][_0xa699('0x69')](function(_0x454287){return _0x432650[_0xa699('0x6c')](_0x2ad52f['query'][_0xa699('0x6d')],{'transaction':_0x454287})[_0xa699('0x27')](function(){if(!_[_0xa699('0x7e')](_0x24239b)){return _0x432650[_0xa699('0x7f')](_0x24239b,{'transaction':_0x454287});}})[_0xa699('0x27')](function(){_0x24239b[_0xa699('0x6b')](function(_0x1014a0){socket[_0xa699('0x80')](_0xa699('0x81'),{'UserId':_0x1014a0,'MailQueueId':_0x432650['id']});});});});});});})[_0xa699('0x27')](respondWithStatusCode(_0x240009,null))[_0xa699('0x46')](handleError(_0x240009,null));};exports['addAgents']=function(_0x326edf,_0x322ac0,_0x58c332){return db[_0xa699('0x30')]['find']({'where':{'id':_0x326edf['params']['id']}})[_0xa699('0x27')](handleEntityNotFound(_0x322ac0,null))[_0xa699('0x27')](function(_0x2fe345){if(_0x2fe345){return _0x2fe345[_0xa699('0x82')](_0x326edf[_0xa699('0x52')]['ids'],_[_0xa699('0x83')](_0x326edf['body'],[_0xa699('0x6d'),'id'])||{})[_0xa699('0x84')](function(_0x12518b){for(var _0x1ec034=0x0;_0x1ec034<_0x326edf[_0xa699('0x52')]['ids'][_0xa699('0x3a')];_0x1ec034+=0x1){socket['emit'](_0xa699('0x85'),{'UserId':Number(_0x326edf[_0xa699('0x52')][_0xa699('0x6d')][_0x1ec034]),'MailQueueId':Number(_0x326edf[_0xa699('0x47')]['id'])});}return _0x12518b;});}})[_0xa699('0x27')](respondWithResult(_0x322ac0,null))[_0xa699('0x46')](handleError(_0x322ac0,null));};exports[_0xa699('0x7f')]=function(_0x12c6f9,_0xd104f9,_0x42ffcd){return db[_0xa699('0x30')]['find']({'where':{'id':_0x12c6f9['params']['id']}})[_0xa699('0x27')](handleEntityNotFound(_0xd104f9,null))[_0xa699('0x27')](function(_0x120d24){if(_0x120d24){return _0x120d24[_0xa699('0x7f')](_0x12c6f9[_0xa699('0x35')][_0xa699('0x6d')])['then'](function(){if(_[_0xa699('0x86')](_0x12c6f9[_0xa699('0x35')][_0xa699('0x6d')])){for(var _0x15678e=0x0;_0x15678e<_0x12c6f9[_0xa699('0x35')]['ids'][_0xa699('0x3a')];_0x15678e+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x12c6f9[_0xa699('0x35')][_0xa699('0x6d')][_0x15678e]),'MailQueueId':Number(_0x12c6f9['params']['id'])});}}else{socket[_0xa699('0x80')](_0xa699('0x81'),{'UserId':Number(_0x12c6f9[_0xa699('0x35')]['ids']),'MailQueueId':Number(_0x12c6f9[_0xa699('0x47')]['id'])});}});}})[_0xa699('0x27')](respondWithStatusCode(_0xd104f9,null))[_0xa699('0x46')](handleError(_0xd104f9,null));};exports[_0xa699('0x87')]=function(_0x45bd2a,_0x2bb9a5,_0x1ffe7d){var _0x4b356f={};var _0x516758={};var _0x3f165d;var _0x3e3d20;return db[_0xa699('0x30')]['findOne']({'where':{'id':_0x45bd2a[_0xa699('0x47')]['id']}})[_0xa699('0x27')](handleEntityNotFound(_0x2bb9a5,null))['then'](function(_0x1ccaa5){if(_0x1ccaa5){_0x3f165d=_0x1ccaa5;_0x516758[_0xa699('0x34')]=_[_0xa699('0x36')](db[_0xa699('0x5a')][_0xa699('0x31')]);_0x516758[_0xa699('0x35')]=_[_0xa699('0x36')](_0x45bd2a['query']);_0x516758['filters']=_[_0xa699('0x37')](_0x516758['model'],_0x516758['query']);_0x4b356f[_0xa699('0x38')]=_[_0xa699('0x37')](_0x516758['model'],qs[_0xa699('0x39')](_0x45bd2a['query'][_0xa699('0x39')]));_0x4b356f['attributes']=_0x4b356f['attributes'][_0xa699('0x3a')]?_0x4b356f[_0xa699('0x38')]:_0x516758['model'];_0x4b356f[_0xa699('0x57')]=qs['sort'](_0x45bd2a[_0xa699('0x35')][_0xa699('0x3d')]);_0x4b356f[_0xa699('0x42')]=qs['filters'](_['pick'](_0x45bd2a[_0xa699('0x35')],_0x516758['filters']));if(_0x45bd2a[_0xa699('0x35')][_0xa699('0x40')]){_0x4b356f[_0xa699('0x42')]=_[_0xa699('0x41')](_0x4b356f['where'],{'$or':_[_0xa699('0x2f')](_0x4b356f[_0xa699('0x38')],function(_0x2ed373){var _0x18d3bf={};_0x18d3bf[_0x2ed373]={'$like':'%'+_0x45bd2a[_0xa699('0x35')][_0xa699('0x40')]+'%'};return _0x18d3bf;})});}_0x4b356f=_[_0xa699('0x41')]({},_0x4b356f,_0x45bd2a[_0xa699('0x49')]);return _0x3f165d['getAgents'](_0x4b356f);}})[_0xa699('0x27')](function(_0x369787){if(_0x369787){_0x3e3d20=_0x369787[_0xa699('0x3a')];if(!_0x45bd2a['query']['hasOwnProperty'](_0xa699('0x3c'))){_0x4b356f['limit']=qs[_0xa699('0x1e')](_0x45bd2a[_0xa699('0x35')][_0xa699('0x1e')]);_0x4b356f[_0xa699('0x1d')]=qs[_0xa699('0x1d')](_0x45bd2a[_0xa699('0x35')][_0xa699('0x1d')]);}return _0x3f165d[_0xa699('0x87')](_0x4b356f);}})[_0xa699('0x27')](function(_0x162b9e){if(_0x162b9e){return _0x162b9e?{'count':_0x3e3d20,'rows':_0x162b9e}:null;}})['then'](respondWithResult(_0x2bb9a5,null))['catch'](handleError(_0x2bb9a5,null));}; \ No newline at end of file +var _0xb5ed=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','then','error','name','send','index','map','MailQueue','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','length','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3c8c63,_0x5530ea){var _0x872537=function(_0x10236e){while(--_0x10236e){_0x3c8c63['push'](_0x3c8c63['shift']());}};_0x872537(++_0x5530ea);}(_0xb5ed,0x1a4));var _0xdb5e=function(_0x485ac6,_0x3f6dba){_0x485ac6=_0x485ac6-0x0;var _0xdcb456=_0xb5ed[_0x485ac6];return _0xdcb456;};'use strict';var emlformat=require(_0xdb5e('0x0'));var rimraf=require(_0xdb5e('0x1'));var zipdir=require(_0xdb5e('0x2'));var jsonpatch=require(_0xdb5e('0x3'));var rp=require('request-promise');var moment=require(_0xdb5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb5e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdb5e('0x6'));var ejs=require(_0xdb5e('0x7'));var fs=require('fs');var fs_extra=require(_0xdb5e('0x8'));var _=require(_0xdb5e('0x9'));var squel=require(_0xdb5e('0xa'));var crypto=require(_0xdb5e('0xb'));var jsforce=require(_0xdb5e('0xc'));var deskjs=require(_0xdb5e('0xd'));var toCsv=require(_0xdb5e('0x6'));var querystring=require(_0xdb5e('0xe'));var Papa=require(_0xdb5e('0xf'));var Redis=require(_0xdb5e('0x10'));var authService=require(_0xdb5e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdb5e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb5e('0x13'));var utils=require(_0xdb5e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdb5e('0x15')]=_[_0xdb5e('0x16')](config['redis'],{'host':_0xdb5e('0x17'),'port':0x18eb});var socket=require(_0xdb5e('0x18'))(new Redis(config[_0xdb5e('0x15')]));require(_0xdb5e('0x19'))['register'](socket);function respondWithStatusCode(_0x415387,_0x3a63db){_0x3a63db=_0x3a63db||0xcc;return function(_0x552d59){if(_0x552d59){return _0x415387[_0xdb5e('0x1a')](_0x3a63db);}return _0x415387['status'](_0x3a63db)[_0xdb5e('0x1b')]();};}function respondWithResult(_0x5d1588,_0x252bfa){_0x252bfa=_0x252bfa||0xc8;return function(_0x5caa2a){if(_0x5caa2a){return _0x5d1588[_0xdb5e('0x1c')](_0x252bfa)[_0xdb5e('0x1d')](_0x5caa2a);}};}function respondWithFilteredResult(_0x33c9bb,_0x4571f5){return function(_0x117dda){if(_0x117dda){var _0x65c30a=typeof _0x4571f5[_0xdb5e('0x1e')]===_0xdb5e('0x1f')&&typeof _0x4571f5['limit']===_0xdb5e('0x1f');var _0x3cf173=_0x117dda['count'];var _0x58d15a=_0x65c30a?0x0:_0x4571f5[_0xdb5e('0x1e')];var _0x570a39=_0x65c30a?_0x117dda['count']:_0x4571f5['offset']+_0x4571f5[_0xdb5e('0x20')];var _0x1fc4fb;if(_0x570a39>=_0x3cf173){_0x570a39=_0x3cf173;_0x1fc4fb=0xc8;}else{_0x1fc4fb=0xce;}_0x33c9bb[_0xdb5e('0x1c')](_0x1fc4fb);return _0x33c9bb[_0xdb5e('0x21')](_0xdb5e('0x22'),_0x58d15a+'-'+_0x570a39+'/'+_0x3cf173)[_0xdb5e('0x1d')](_0x117dda);}return null;};}function patchUpdates(_0x2f7a57){return function(_0x3af1b9){try{jsonpatch[_0xdb5e('0x23')](_0x3af1b9,_0x2f7a57,!![]);}catch(_0x478954){return BPromise[_0xdb5e('0x24')](_0x478954);}return _0x3af1b9[_0xdb5e('0x25')]();};}function saveUpdates(_0x56b123,_0x5bf591){return function(_0x41639c){if(_0x41639c){return _0x41639c[_0xdb5e('0x26')](_0x56b123)['then'](function(_0x58ce6c){return _0x58ce6c;});}return null;};}function removeEntity(_0x488819,_0x362ddd){return function(_0x47dda0){if(_0x47dda0){return _0x47dda0['destroy']()['then'](function(){var _0x4f9f03=_0x47dda0[_0xdb5e('0x27')]({'plain':!![]});var _0x1e79df='MailQueues';return db[_0xdb5e('0x28')][_0xdb5e('0x29')]({'where':{'type':_0x1e79df,'resourceId':_0x4f9f03['id']}})[_0xdb5e('0x2a')](function(){return _0x47dda0;});})[_0xdb5e('0x2a')](function(){_0x488819[_0xdb5e('0x1c')](0xcc)[_0xdb5e('0x1b')]();});}};}function handleEntityNotFound(_0x465b76,_0x145076){return function(_0xf7695c){if(!_0xf7695c){_0x465b76[_0xdb5e('0x1a')](0x194);}return _0xf7695c;};}function handleError(_0x6b4001,_0x48e0b3){_0x48e0b3=_0x48e0b3||0x1f4;return function(_0x265f4c){logger[_0xdb5e('0x2b')](_0x265f4c['stack']);if(_0x265f4c['name']){delete _0x265f4c[_0xdb5e('0x2c')];}_0x6b4001[_0xdb5e('0x1c')](_0x48e0b3)[_0xdb5e('0x2d')](_0x265f4c);};}exports[_0xdb5e('0x2e')]=function(_0xe5d7bb,_0x43e712){var _0x3ec438={},_0x1f36ca={},_0x5e5728={'count':0x0,'rows':[]};var _0x192184=_[_0xdb5e('0x2f')](db[_0xdb5e('0x30')][_0xdb5e('0x31')],function(_0x1887dc){return{'name':_0x1887dc['fieldName'],'type':_0x1887dc[_0xdb5e('0x32')]['key']};});_0x1f36ca[_0xdb5e('0x33')]=_[_0xdb5e('0x2f')](_0x192184,_0xdb5e('0x2c'));_0x1f36ca[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0xe5d7bb[_0xdb5e('0x34')]);_0x1f36ca[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x1f36ca[_0xdb5e('0x33')],_0x1f36ca['query']);_0x3ec438['attributes']=_['intersection'](_0x1f36ca[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x3ec438[_0xdb5e('0x39')]=_0x3ec438[_0xdb5e('0x39')]['length']?_0x3ec438['attributes']:_0x1f36ca['model'];if(!_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x3a')](_0xdb5e('0x3b'))){_0x3ec438[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x20')]);_0x3ec438['offset']=qs['offset'](_0xe5d7bb[_0xdb5e('0x34')]['offset']);}_0x3ec438[_0xdb5e('0x3c')]=qs[_0xdb5e('0x3d')](_0xe5d7bb[_0xdb5e('0x34')]['sort']);_0x3ec438[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0xe5d7bb[_0xdb5e('0x34')],_0x1f36ca['filters']),_0x192184);if(_0xe5d7bb[_0xdb5e('0x34')]['filter']){_0x3ec438[_0xdb5e('0x3e')]=_[_0xdb5e('0x40')](_0x3ec438['where'],{'$or':_['map'](_0x192184,function(_0x47c223){if(_0x47c223[_0xdb5e('0x32')]!==_0xdb5e('0x41')){var _0x76db4d={};_0x76db4d[_0x47c223[_0xdb5e('0x2c')]]={'$like':'%'+_0xe5d7bb['query'][_0xdb5e('0x42')]+'%'};return _0x76db4d;}})});}_0x3ec438=_[_0xdb5e('0x40')]({},_0x3ec438,_0xe5d7bb[_0xdb5e('0x43')]);var _0x5b56a3={'where':_0x3ec438[_0xdb5e('0x3e')]};return db['MailQueue']['count'](_0x5b56a3)[_0xdb5e('0x2a')](function(_0x1176c5){_0x5e5728[_0xdb5e('0x44')]=_0x1176c5;if(_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x45')]){_0x3ec438[_0xdb5e('0x46')]=[{'all':!![]}];}return db[_0xdb5e('0x30')][_0xdb5e('0x47')](_0x3ec438);})['then'](function(_0x2c85e1){_0x5e5728[_0xdb5e('0x48')]=_0x2c85e1;return _0x5e5728;})[_0xdb5e('0x2a')](respondWithFilteredResult(_0x43e712,_0x3ec438))[_0xdb5e('0x49')](handleError(_0x43e712,null));};exports[_0xdb5e('0x4a')]=function(_0x107ff7,_0x2120cd){var _0x356a4d={'raw':!![],'where':{'id':_0x107ff7[_0xdb5e('0x4b')]['id']}},_0x39ae82={};_0x39ae82['model']=_[_0xdb5e('0x35')](db[_0xdb5e('0x30')]['rawAttributes']);_0x39ae82['query']=_['keys'](_0x107ff7[_0xdb5e('0x34')]);_0x39ae82[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x39ae82[_0xdb5e('0x33')],_0x39ae82[_0xdb5e('0x34')]);_0x356a4d[_0xdb5e('0x39')]=_['intersection'](_0x39ae82[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0x107ff7[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x356a4d[_0xdb5e('0x39')]=_0x356a4d[_0xdb5e('0x39')]['length']?_0x356a4d[_0xdb5e('0x39')]:_0x39ae82[_0xdb5e('0x33')];if(_0x107ff7[_0xdb5e('0x34')]['includeAll']){_0x356a4d['include']=[{'all':!![]}];}_0x356a4d=_[_0xdb5e('0x40')]({},_0x356a4d,_0x107ff7[_0xdb5e('0x43')]);return db[_0xdb5e('0x30')][_0xdb5e('0x4c')](_0x356a4d)[_0xdb5e('0x2a')](handleEntityNotFound(_0x2120cd,null))[_0xdb5e('0x2a')](respondWithResult(_0x2120cd,null))[_0xdb5e('0x49')](handleError(_0x2120cd,null));};exports[_0xdb5e('0x4d')]=function(_0x169246,_0x19e016){return db[_0xdb5e('0x30')]['create'](_0x169246['body'],{})[_0xdb5e('0x2a')](function(_0x17a33c){var _0x2fb35b=_0x169246[_0xdb5e('0x4e')][_0xdb5e('0x27')]({'plain':!![]});if(!_0x2fb35b)throw new Error(_0xdb5e('0x4f'));if(_0x2fb35b[_0xdb5e('0x50')]===_0xdb5e('0x4e')){var _0x308c04=_0x17a33c[_0xdb5e('0x27')]({'plain':!![]});var _0x5eeee2=_0xdb5e('0x51');return db[_0xdb5e('0x52')]['find']({'where':{'name':_0x5eeee2,'userProfileId':_0x2fb35b[_0xdb5e('0x53')]},'raw':!![]})[_0xdb5e('0x2a')](function(_0x3bac8e){if(_0x3bac8e&&_0x3bac8e[_0xdb5e('0x54')]===0x0){return db[_0xdb5e('0x28')][_0xdb5e('0x4d')]({'name':_0x308c04[_0xdb5e('0x2c')],'resourceId':_0x308c04['id'],'type':_0x3bac8e[_0xdb5e('0x2c')],'sectionId':_0x3bac8e['id']},{})[_0xdb5e('0x2a')](function(){return _0x17a33c;});}else{return _0x17a33c;}})[_0xdb5e('0x49')](function(_0x5c34b4){logger[_0xdb5e('0x2b')](_0xdb5e('0x55'),_0x5c34b4);throw _0x5c34b4;});}return _0x17a33c;})[_0xdb5e('0x2a')](respondWithResult(_0x19e016,0xc9))[_0xdb5e('0x49')](handleError(_0x19e016,null));};exports[_0xdb5e('0x26')]=function(_0x4f2581,_0x1409cf){if(_0x4f2581[_0xdb5e('0x56')]['id']){delete _0x4f2581[_0xdb5e('0x56')]['id'];}return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x4f2581[_0xdb5e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1409cf,null))['then'](saveUpdates(_0x4f2581['body'],null))[_0xdb5e('0x2a')](respondWithResult(_0x1409cf,null))[_0xdb5e('0x49')](handleError(_0x1409cf,null));};exports[_0xdb5e('0x29')]=function(_0x2cff0a,_0x15dfa4){return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x2cff0a['params']['id']}})['then'](handleEntityNotFound(_0x15dfa4,null))[_0xdb5e('0x2a')](removeEntity(_0x15dfa4,null))[_0xdb5e('0x49')](handleError(_0x15dfa4,null));};exports[_0xdb5e('0x57')]=function(_0x4ad721,_0x39727a){return db[_0xdb5e('0x30')][_0xdb5e('0x57')]()[_0xdb5e('0x2a')](respondWithResult(_0x39727a,null))[_0xdb5e('0x49')](handleError(_0x39727a,null));};exports[_0xdb5e('0x58')]=function(_0x492e14,_0x4a32c0,_0x84ec96){var _0x3b9476={'raw':!![],'where':{}},_0xc1288e={},_0x263be8;return db[_0xdb5e('0x30')]['findOne']({'where':{'id':_0x492e14[_0xdb5e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a32c0,null))[_0xdb5e('0x2a')](function(_0x3fe724){if(_0x3fe724){_0x263be8=_0x3fe724[_0xdb5e('0x27')]({'plain':!![]});_0xc1288e[_0xdb5e('0x33')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0xc1288e[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x492e14['query']);_0xc1288e[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0xc1288e[_0xdb5e('0x33')],_0xc1288e[_0xdb5e('0x34')]);_0x3b9476[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0xc1288e[_0xdb5e('0x33')],qs['fields'](_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x3b9476[_0xdb5e('0x39')]=_0x3b9476[_0xdb5e('0x39')][_0xdb5e('0x59')]?_0x3b9476[_0xdb5e('0x39')]:_0xc1288e[_0xdb5e('0x33')];if(!_0x492e14['query'][_0xdb5e('0x3a')]('nolimit')){_0x3b9476[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x20')]);_0x3b9476['offset']=qs['offset'](_0x492e14[_0xdb5e('0x34')]['offset']);}_0x3b9476['order']=qs[_0xdb5e('0x3d')](_0x492e14[_0xdb5e('0x34')]['sort']);_0x3b9476[_0xdb5e('0x3e')]=qs[_0xdb5e('0x36')](_[_0xdb5e('0x3f')](_0x492e14[_0xdb5e('0x34')],_0xc1288e['filters']));_0x3b9476['where'][_0xdb5e('0x5a')]=_0x3fe724['id'];if(_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0x3b9476[_0xdb5e('0x3e')]=_[_0xdb5e('0x40')](_0x3b9476[_0xdb5e('0x3e')],{'$or':_[_0xdb5e('0x2f')](_0x3b9476[_0xdb5e('0x39')],function(_0x52f52b){var _0xed9e16={};_0xed9e16[_0x52f52b]={'$like':'%'+_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x42')]+'%'};return _0xed9e16;})});}_0x3b9476=_[_0xdb5e('0x40')]({},_0x3b9476,_0x492e14[_0xdb5e('0x43')]);return db[_0xdb5e('0x5b')][_0xdb5e('0x47')](_0x3b9476);}})[_0xdb5e('0x2a')](function(_0x46f1f1){if(_0x46f1f1){return db[_0xdb5e('0x5c')][_0xdb5e('0x5d')]({'where':{'id':_['map'](_0x46f1f1,_0xdb5e('0x5e')),'role':_0xdb5e('0x5f')},'attributes':['id',_0xdb5e('0x2c'),_0xdb5e('0x60'),_0xdb5e('0x61'),_0xdb5e('0x62')]});}})[_0xdb5e('0x2a')](function(_0x3a65d9){if(_0x3a65d9){return{'count':_0x3a65d9[_0xdb5e('0x44')],'rows':_['map'](_0x3a65d9[_0xdb5e('0x48')],function(_0x38ee64){return{'membername':_0x38ee64[_0xdb5e('0x2c')],'UserId':_0x38ee64['id'],'queue_name':_0x263be8[_0xdb5e('0x2c')],'MailQueueId':_0x263be8['id'],'interface':util['format'](_0xdb5e('0x63'),_0xdb5e('0x64'),_0x38ee64[_0xdb5e('0x2c')]),'penalty':0x0,'paused':_0x38ee64['mailPause'],'createdAt':_0x38ee64[_0xdb5e('0x62')],'updatedAt':_0x38ee64[_0xdb5e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a32c0,_0x3b9476))[_0xdb5e('0x49')](handleError(_0x4a32c0,null));};exports[_0xdb5e('0x65')]=function(_0x1d6675,_0x40ec4d,_0x554134){var _0x13e49e={};var _0x3127ec={};var _0x55a133;var _0x1511c6;return db[_0xdb5e('0x30')][_0xdb5e('0x66')]({'where':{'id':_0x1d6675[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x40ec4d,null))[_0xdb5e('0x2a')](function(_0x10d009){if(_0x10d009){_0x55a133=_0x10d009;_0x3127ec['model']=_[_0xdb5e('0x35')](db[_0xdb5e('0x67')][_0xdb5e('0x31')]);_0x3127ec[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x1d6675[_0xdb5e('0x34')]);_0x3127ec['filters']=_['intersection'](_0x3127ec[_0xdb5e('0x33')],_0x3127ec[_0xdb5e('0x34')]);_0x13e49e[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0x3127ec[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x13e49e[_0xdb5e('0x39')]=_0x13e49e['attributes'][_0xdb5e('0x59')]?_0x13e49e[_0xdb5e('0x39')]:_0x3127ec[_0xdb5e('0x33')];_0x13e49e[_0xdb5e('0x3c')]=qs[_0xdb5e('0x3d')](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x3d')]);_0x13e49e[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0x1d6675[_0xdb5e('0x34')],_0x3127ec[_0xdb5e('0x36')]));if(_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0x13e49e['where']=_[_0xdb5e('0x40')](_0x13e49e['where'],{'$or':_[_0xdb5e('0x2f')](_0x13e49e[_0xdb5e('0x39')],function(_0x1dacf4){var _0x5c4fe4={};_0x5c4fe4[_0x1dacf4]={'$like':'%'+_0x1d6675['query'][_0xdb5e('0x42')]+'%'};return _0x5c4fe4;})});}_0x13e49e=_[_0xdb5e('0x40')]({},_0x13e49e,_0x1d6675[_0xdb5e('0x43')]);return _0x55a133[_0xdb5e('0x65')](_0x13e49e);}})[_0xdb5e('0x2a')](function(_0x2c1ae3){if(_0x2c1ae3){_0x1511c6=_0x2c1ae3[_0xdb5e('0x59')];if(!_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x3a')](_0xdb5e('0x3b'))){_0x13e49e[_0xdb5e('0x20')]=qs['limit'](_0x1d6675['query'][_0xdb5e('0x20')]);_0x13e49e[_0xdb5e('0x1e')]=qs['offset'](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x1e')]);}return _0x55a133[_0xdb5e('0x65')](_0x13e49e);}})['then'](function(_0x22a84c){if(_0x22a84c){return _0x22a84c?{'count':_0x1511c6,'rows':_0x22a84c}:null;}})[_0xdb5e('0x2a')](respondWithResult(_0x40ec4d,null))[_0xdb5e('0x49')](handleError(_0x40ec4d,null));};exports[_0xdb5e('0x68')]=function(_0x5479a8,_0x5dabd5,_0x3785bf){var _0x214753=_0x5479a8[_0xdb5e('0x56')][_0xdb5e('0x69')];return db['Team'][_0xdb5e('0x47')]({'where':{'id':_0x214753},'attributes':['id'],'include':[{'model':db[_0xdb5e('0x5c')],'as':_0xdb5e('0x6a'),'attributes':['id',_0xdb5e('0x2c'),_0xdb5e('0x6b'),_0xdb5e('0x6c'),_0xdb5e('0x6d')],'raw':!![]}]})['then'](function(_0x376d82){if(_0x376d82){var _0x5a58a6=_['flatMap'](_0x376d82,function(_0x2ae39f){var _0x5d3ea4=_0x2ae39f[_0xdb5e('0x27')]({'plain':!![]});return _0x5d3ea4[_0xdb5e('0x6a')];});return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x5479a8[_0xdb5e('0x4b')]['id']}})['then'](function(_0x50d352){return db['sequelize'][_0xdb5e('0x6e')](function(_0x23ad60){return _0x50d352[_0xdb5e('0x68')](_0x214753,{'transaction':_0x23ad60})[_0xdb5e('0x2a')](function(){return BPromise[_0xdb5e('0x6f')](_0x5a58a6,function(_0x1f392e){return db['UserMailQueue'][_0xdb5e('0x70')]({'where':{'UserId':_0x1f392e['id'],'MailQueueId':_0x5479a8[_0xdb5e('0x4b')]['id']},'transaction':_0x23ad60});});})[_0xdb5e('0x2a')](function(){_0x5a58a6[_0xdb5e('0x71')](function(_0x2d47bc){socket[_0xdb5e('0x72')](_0xdb5e('0x73'),{'UserId':_0x2d47bc['id'],'MailQueueId':_0x50d352['id']});});});});});}})[_0xdb5e('0x2a')](respondWithStatusCode(_0x5dabd5,null))[_0xdb5e('0x49')](handleError(_0x5dabd5,null));};exports[_0xdb5e('0x74')]=function(_0x2db791,_0x4dffcf,_0x342097){return db[_0xdb5e('0x67')][_0xdb5e('0x47')]({'where':{'id':_0x2db791[_0xdb5e('0x34')][_0xdb5e('0x69')]},'attributes':['id'],'include':[{'model':db[_0xdb5e('0x5c')],'as':_0xdb5e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xdb5e('0x2a')](handleEntityNotFound(_0x4dffcf,null))[_0xdb5e('0x2a')](function(_0x6b03c5){var _0xc6c730=_[_0xdb5e('0x2f')](_0x6b03c5,'id');var _0x582e0a=[];var _0x4a7700=[];var _0xaba9c=squel[_0xdb5e('0x75')]();_0xaba9c[_0xdb5e('0x76')](_0xdb5e('0x77'))['from'](_0xdb5e('0x78'),'tq')['join'](_0xdb5e('0x79'),'ut',_0xdb5e('0x7a'))['where'](_0xdb5e('0x7b'),_0x2db791[_0xdb5e('0x4b')]['id']);for(var _0x4e3d99=0x0;_0x4e3d99<_0x6b03c5[_0xdb5e('0x59')];_0x4e3d99+=0x1){let _0x19bd66=_0x6b03c5[_0x4e3d99];for(var _0x35dca4=0x0;_0x35dca4<_0x19bd66['Agents']['length'];_0x35dca4+=0x1){let _0x51c592=_0x19bd66[_0xdb5e('0x6a')][_0x35dca4];var _0x101129=_0xaba9c[_0xdb5e('0x7c')]();_0x101129[_0xdb5e('0x3e')](_0xdb5e('0x7d'),_0x51c592['id']);_0x4a7700[_0xdb5e('0x7e')](db['sequelize'][_0xdb5e('0x34')](_0x101129['toString'](),{'type':db[_0xdb5e('0x7f')][_0xdb5e('0x80')][_0xdb5e('0x81')]})[_0xdb5e('0x2a')](function(_0x5abd2f){if(_0x5abd2f[_0xdb5e('0x59')]===0x1){return _0x51c592['id'];}else{var _0x36016d=_[_0xdb5e('0x82')](_[_0xdb5e('0x2f')](_0x5abd2f,_0xdb5e('0x83')),function(_0x42507e){return _[_0xdb5e('0x84')](_0xc6c730,_0x42507e);});if(_0x36016d){return _0x51c592['id'];}}}));}}return BPromise[_0xdb5e('0x85')](_0x4a7700)[_0xdb5e('0x2a')](function(_0x115cf1){_0x582e0a=_(_0x582e0a)[_0xdb5e('0x86')](_0x115cf1)[_0xdb5e('0x87')]()[_0xdb5e('0x88')]();return db[_0xdb5e('0x30')]['find']({'where':{'id':_0x2db791[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](function(_0x576117){return db[_0xdb5e('0x7f')]['transaction'](function(_0x5d5e98){return _0x576117[_0xdb5e('0x74')](_0x2db791[_0xdb5e('0x34')][_0xdb5e('0x69')],{'transaction':_0x5d5e98})[_0xdb5e('0x2a')](function(){if(!_[_0xdb5e('0x89')](_0x582e0a)){return _0x576117[_0xdb5e('0x8a')](_0x582e0a,{'transaction':_0x5d5e98});}})[_0xdb5e('0x2a')](function(){_0x582e0a[_0xdb5e('0x71')](function(_0x53dcdf){socket['emit']('userMailQueue:remove',{'UserId':_0x53dcdf,'MailQueueId':_0x576117['id']});});});});});});})['then'](respondWithStatusCode(_0x4dffcf,null))['catch'](handleError(_0x4dffcf,null));};exports[_0xdb5e('0x8b')]=function(_0x31568e,_0x18f458,_0x4b2a60){return db[_0xdb5e('0x30')]['find']({'where':{'id':_0x31568e[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x18f458,null))[_0xdb5e('0x2a')](function(_0x571f0b){if(_0x571f0b){return _0x571f0b[_0xdb5e('0x8b')](_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')],_[_0xdb5e('0x8c')](_0x31568e[_0xdb5e('0x56')],[_0xdb5e('0x69'),'id'])||{})[_0xdb5e('0x8d')](function(_0x465d94){for(var _0x53248d=0x0;_0x53248d<_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')][_0xdb5e('0x59')];_0x53248d+=0x1){socket['emit'](_0xdb5e('0x73'),{'UserId':Number(_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')][_0x53248d]),'MailQueueId':Number(_0x31568e[_0xdb5e('0x4b')]['id'])});}return _0x465d94;});}})['then'](respondWithResult(_0x18f458,null))['catch'](handleError(_0x18f458,null));};exports[_0xdb5e('0x8a')]=function(_0x2af38d,_0x37a2da,_0x40a818){return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x2af38d[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x37a2da,null))[_0xdb5e('0x2a')](function(_0x3a8e2b){if(_0x3a8e2b){return _0x3a8e2b[_0xdb5e('0x8a')](_0x2af38d[_0xdb5e('0x34')][_0xdb5e('0x69')])[_0xdb5e('0x2a')](function(){if(_['isArray'](_0x2af38d[_0xdb5e('0x34')][_0xdb5e('0x69')])){for(var _0x12da85=0x0;_0x12da85<_0x2af38d[_0xdb5e('0x34')]['ids']['length'];_0x12da85+=0x1){socket['emit'](_0xdb5e('0x8e'),{'UserId':Number(_0x2af38d['query'][_0xdb5e('0x69')][_0x12da85]),'MailQueueId':Number(_0x2af38d[_0xdb5e('0x4b')]['id'])});}}else{socket[_0xdb5e('0x72')](_0xdb5e('0x8e'),{'UserId':Number(_0x2af38d['query'][_0xdb5e('0x69')]),'MailQueueId':Number(_0x2af38d[_0xdb5e('0x4b')]['id'])});}});}})[_0xdb5e('0x2a')](respondWithStatusCode(_0x37a2da,null))[_0xdb5e('0x49')](handleError(_0x37a2da,null));};exports[_0xdb5e('0x8f')]=function(_0x372feb,_0x14b736,_0x488f79){var _0xaf0f78={};var _0x465c14={};var _0x4a5079;var _0x4d6e4a;return db[_0xdb5e('0x30')][_0xdb5e('0x66')]({'where':{'id':_0x372feb[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x14b736,null))[_0xdb5e('0x2a')](function(_0x229af8){if(_0x229af8){_0x4a5079=_0x229af8;_0x465c14['model']=_[_0xdb5e('0x35')](db['User'][_0xdb5e('0x31')]);_0x465c14[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x372feb[_0xdb5e('0x34')]);_0x465c14[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x465c14['model'],_0x465c14[_0xdb5e('0x34')]);_0xaf0f78[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0x465c14['model'],qs[_0xdb5e('0x38')](_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0xaf0f78['attributes']=_0xaf0f78['attributes'][_0xdb5e('0x59')]?_0xaf0f78[_0xdb5e('0x39')]:_0x465c14[_0xdb5e('0x33')];_0xaf0f78[_0xdb5e('0x3c')]=qs['sort'](_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x3d')]);_0xaf0f78[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0x372feb[_0xdb5e('0x34')],_0x465c14[_0xdb5e('0x36')]));if(_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0xaf0f78['where']=_[_0xdb5e('0x40')](_0xaf0f78['where'],{'$or':_[_0xdb5e('0x2f')](_0xaf0f78[_0xdb5e('0x39')],function(_0x531fd6){var _0x2b8085={};_0x2b8085[_0x531fd6]={'$like':'%'+_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x42')]+'%'};return _0x2b8085;})});}_0xaf0f78=_['merge']({},_0xaf0f78,_0x372feb['options']);return _0x4a5079['getAgents'](_0xaf0f78);}})['then'](function(_0x51d34b){if(_0x51d34b){_0x4d6e4a=_0x51d34b[_0xdb5e('0x59')];if(!_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x3a')]('nolimit')){_0xaf0f78[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0x372feb[_0xdb5e('0x34')]['limit']);_0xaf0f78[_0xdb5e('0x1e')]=qs['offset'](_0x372feb[_0xdb5e('0x34')]['offset']);}return _0x4a5079['getAgents'](_0xaf0f78);}})[_0xdb5e('0x2a')](function(_0x133f39){if(_0x133f39){return _0x133f39?{'count':_0x4d6e4a,'rows':_0x133f39}:null;}})[_0xdb5e('0x2a')](respondWithResult(_0x14b736,null))[_0xdb5e('0x49')](handleError(_0x14b736,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5f3e3c9..5ed34d5 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 _0x0a93=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0a93,0x11d));var _0x30a9=function(_0x3c1480,_0x44bea0){_0x3c1480=_0x3c1480-0x0;var _0x290b7b=_0x0a93[_0x3c1480];return _0x290b7b;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x30a9('0x0'))['db'][_0x30a9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x30a9('0x2')](0x0);var events={'afterCreate':_0x30a9('0x3'),'afterUpdate':'update','afterDestroy':_0x30a9('0x4')};function emitEvent(_0x5ac60e){return function(_0x22b9ff,_0x570a7e,_0x518cc5){MailQueueEvents[_0x30a9('0x5')](_0x5ac60e+':'+_0x22b9ff['id'],_0x22b9ff);MailQueueEvents[_0x30a9('0x5')](_0x5ac60e,_0x22b9ff);_0x518cc5(null);};}for(var e in events){if(events[_0x30a9('0x6')](e)){var event=events[e];MailQueue[_0x30a9('0x7')](e,emitEvent(event));}}module[_0x30a9('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xa42c=['hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x131a7c,_0x52bf29){var _0x8e6684=function(_0x310fe1){while(--_0x310fe1){_0x131a7c['push'](_0x131a7c['shift']());}};_0x8e6684(++_0x52bf29);}(_0xa42c,0x16b));var _0xca42=function(_0x317c62,_0x26e37e){_0x317c62=_0x317c62-0x0;var _0x3bd6ce=_0xa42c[_0x317c62];return _0x3bd6ce;};'use strict';var EventEmitter=require(_0xca42('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xca42('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xca42('0x2')](0x0);var events={'afterCreate':_0xca42('0x3'),'afterUpdate':_0xca42('0x4'),'afterDestroy':_0xca42('0x5')};function emitEvent(_0x50f625){return function(_0x5118b6,_0x4a9a10,_0x4b6ccb){MailQueueEvents[_0xca42('0x6')](_0x50f625+':'+_0x5118b6['id'],_0x5118b6);MailQueueEvents[_0xca42('0x6')](_0x50f625,_0x5118b6);_0x4b6ccb(null);};}for(var e in events){if(events[_0xca42('0x7')](e)){var event=events[e];MailQueue[_0xca42('0x8')](e,emitEvent(event));}}module[_0xca42('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 0ccb206..db6bf0c 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 _0xae57=['./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x12c98f,_0x496370){var _0x43becd=function(_0x324553){while(--_0x324553){_0x12c98f['push'](_0x12c98f['shift']());}};_0x43becd(++_0x496370);}(_0xae57,0x124));var _0x7ae5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xae57[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x7ae5('0x0'));var util=require(_0x7ae5('0x1'));var logger=require('../../config/logger')(_0x7ae5('0x2'));var moment=require(_0x7ae5('0x3'));var BPromise=require(_0x7ae5('0x4'));var rp=require(_0x7ae5('0x5'));var fs=require('fs');var path=require(_0x7ae5('0x6'));var rimraf=require('rimraf');var config=require(_0x7ae5('0x7'));var attributes=require(_0x7ae5('0x8'));module['exports']=function(_0x1e6db9,_0x2b1450){return _0x1e6db9[_0x7ae5('0x9')](_0x7ae5('0xa'),attributes,{'tableName':_0x7ae5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4573=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47624e,_0x2ca646){var _0x3337b6=function(_0x16cff5){while(--_0x16cff5){_0x47624e['push'](_0x47624e['shift']());}};_0x3337b6(++_0x2ca646);}(_0x4573,0x7c));var _0x3457=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3457('0x0'));var util=require(_0x3457('0x1'));var logger=require(_0x3457('0x2'))(_0x3457('0x3'));var moment=require(_0x3457('0x4'));var BPromise=require(_0x3457('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3457('0x6'));var rimraf=require('rimraf');var config=require(_0x3457('0x7'));var attributes=require(_0x3457('0x8'));module[_0x3457('0x9')]=function(_0x133d0c,_0x4f5d70){return _0x133d0c[_0x3457('0xa')](_0x3457('0xb'),attributes,{'tableName':_0x3457('0xc'),'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 78c96a0..ddbc533 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 _0xe145=['then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','attributes','limit','include','map','model','GetMailQueue','find','where','ShowMailQueue','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xe145,0xd6));var _0x5e14=function(_0x1e17f2,_0x3bdfc1){_0x1e17f2=_0x1e17f2-0x0;var _0xbcfbb6=_0xe145[_0x1e17f2];return _0xbcfbb6;};'use strict';var _=require('lodash');var util=require(_0x5e14('0x0'));var moment=require(_0x5e14('0x1'));var BPromise=require(_0x5e14('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e14('0x3'));var db=require(_0x5e14('0x4'))['db'];var utils=require(_0x5e14('0x5'));var logger=require(_0x5e14('0x6'))('rpc');var config=require(_0x5e14('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e14('0x8')]({'port':0x232a});config[_0x5e14('0x9')]=_['defaults'](config['redis'],{'host':_0x5e14('0xa'),'port':0x18eb});var socket=require(_0x5e14('0xb'))(new Redis(config[_0x5e14('0x9')]));require('./mailQueue.socket')[_0x5e14('0xc')](socket);function respondWithRpcPromise(_0x2588ad,_0x30a890,_0x13648b){return new BPromise(function(_0x3fe9ab,_0x697f29){return client[_0x5e14('0xd')](_0x2588ad,_0x13648b)[_0x5e14('0xe')](function(_0x138ad1){logger[_0x5e14('0xf')](_0x5e14('0x10'),_0x30a890,_0x5e14('0x11'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x30a890,_0x5e14('0x11'),JSON[_0x5e14('0x12')](_0x138ad1));if(_0x138ad1[_0x5e14('0x13')]){if(_0x138ad1['error'][_0x5e14('0x14')]===0x1f4){logger[_0x5e14('0x13')](_0x5e14('0x10'),_0x30a890,_0x138ad1[_0x5e14('0x13')]['message']);return _0x697f29(_0x138ad1[_0x5e14('0x13')]['message']);}logger[_0x5e14('0x13')](_0x5e14('0x10'),_0x30a890,_0x138ad1[_0x5e14('0x13')][_0x5e14('0x15')]);return _0x3fe9ab(_0x138ad1[_0x5e14('0x13')][_0x5e14('0x15')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x30a890,_0x5e14('0x11'));_0x3fe9ab(_0x138ad1[_0x5e14('0x16')][_0x5e14('0x15')]);}})[_0x5e14('0x17')](function(_0x5684c5){logger[_0x5e14('0x13')](_0x5e14('0x10'),_0x30a890,_0x5684c5);_0x697f29(_0x5684c5);});});}exports['GetMailQueue']=function(_0x557ef2){var _0x333f50=this;return new Promise(function(_0x328414,_0x52836d){return db[_0x5e14('0x18')][_0x5e14('0x19')]({'raw':_0x557ef2[_0x5e14('0x1a')]?_0x557ef2[_0x5e14('0x1a')][_0x5e14('0x1b')]===undefined?!![]:![]:!![],'where':_0x557ef2[_0x5e14('0x1a')]?_0x557ef2[_0x5e14('0x1a')]['where']||null:null,'attributes':_0x557ef2[_0x5e14('0x1a')]?_0x557ef2['options'][_0x5e14('0x1c')]||null:null,'limit':_0x557ef2[_0x5e14('0x1a')]?_0x557ef2[_0x5e14('0x1a')][_0x5e14('0x1d')]||null:null,'include':_0x557ef2[_0x5e14('0x1a')]?_0x557ef2[_0x5e14('0x1a')][_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x557ef2[_0x5e14('0x1a')][_0x5e14('0x1e')],function(_0x347551){return{'model':db[_0x347551[_0x5e14('0x20')]],'as':_0x347551['as'],'attributes':_0x347551[_0x5e14('0x1c')],'include':_0x347551[_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x347551['include'],function(_0x20ee97){return{'model':db[_0x20ee97[_0x5e14('0x20')]],'as':_0x20ee97['as'],'attributes':_0x20ee97['attributes'],'include':_0x20ee97[_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x20ee97[_0x5e14('0x1e')],function(_0x202d5f){return{'model':db[_0x202d5f['model']],'as':_0x202d5f['as'],'attributes':_0x202d5f[_0x5e14('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf489a){logger[_0x5e14('0xf')]('GetMailQueue',_0x557ef2);logger['debug'](_0x5e14('0x21'),_0x557ef2,JSON[_0x5e14('0x12')](_0xf489a));_0x328414(_0xf489a);})[_0x5e14('0x17')](function(_0x3678b5){logger[_0x5e14('0x13')](_0x5e14('0x21'),_0x3678b5[_0x5e14('0x15')],_0x557ef2);_0x52836d(_0x333f50[_0x5e14('0x13')](0x1f4,_0x3678b5[_0x5e14('0x15')]));});});};exports['ShowMailQueue']=function(_0x86fed3){var _0xa044e1=this;return new Promise(function(_0x56d956,_0x2a60d4){return db[_0x5e14('0x18')][_0x5e14('0x22')]({'raw':_0x86fed3[_0x5e14('0x1a')]?_0x86fed3[_0x5e14('0x1a')][_0x5e14('0x1b')]===undefined?!![]:![]:!![],'where':_0x86fed3[_0x5e14('0x1a')]?_0x86fed3['options'][_0x5e14('0x23')]||null:null,'attributes':_0x86fed3[_0x5e14('0x1a')]?_0x86fed3[_0x5e14('0x1a')][_0x5e14('0x1c')]||null:null,'include':_0x86fed3['options']?_0x86fed3[_0x5e14('0x1a')][_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x86fed3[_0x5e14('0x1a')][_0x5e14('0x1e')],function(_0x229ee7){return{'model':db[_0x229ee7[_0x5e14('0x20')]],'as':_0x229ee7['as'],'attributes':_0x229ee7[_0x5e14('0x1c')],'include':_0x229ee7[_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x229ee7[_0x5e14('0x1e')],function(_0x55327a){return{'model':db[_0x55327a[_0x5e14('0x20')]],'as':_0x55327a['as'],'attributes':_0x55327a[_0x5e14('0x1c')],'include':_0x55327a[_0x5e14('0x1e')]?_[_0x5e14('0x1f')](_0x55327a['include'],function(_0x364f4a){return{'model':db[_0x364f4a[_0x5e14('0x20')]],'as':_0x364f4a['as'],'attributes':_0x364f4a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x471a45){logger[_0x5e14('0xf')](_0x5e14('0x24'),_0x86fed3);logger[_0x5e14('0x25')](_0x5e14('0x24'),_0x86fed3,JSON[_0x5e14('0x12')](_0x471a45));_0x56d956(_0x471a45);})[_0x5e14('0x17')](function(_0x8cc47b){logger[_0x5e14('0x13')](_0x5e14('0x24'),_0x8cc47b[_0x5e14('0x15')],_0x86fed3);_0x2a60d4(_0xa044e1['error'](0x1f4,_0x8cc47b['message']));});});}; \ No newline at end of file +var _0x5dda=['ShowMailQueue','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','model','map'];(function(_0x5971c6,_0x328b60){var _0x2df529=function(_0x270c64){while(--_0x270c64){_0x5971c6['push'](_0x5971c6['shift']());}};_0x2df529(++_0x328b60);}(_0x5dda,0xed));var _0xa5dd=function(_0x2fc917,_0x4aaee5){_0x2fc917=_0x2fc917-0x0;var _0x10314a=_0x5dda[_0x2fc917];return _0x10314a;};'use strict';var _=require(_0xa5dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa5dd('0x1'));var rs=require(_0xa5dd('0x2'));var fs=require('fs');var Redis=require(_0xa5dd('0x3'));var db=require(_0xa5dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5dd('0x5'))(_0xa5dd('0x6'));var config=require(_0xa5dd('0x7'));var jayson=require(_0xa5dd('0x8'));var client=jayson['client'][_0xa5dd('0x9')]({'port':0x232a});config[_0xa5dd('0xa')]=_[_0xa5dd('0xb')](config[_0xa5dd('0xa')],{'host':_0xa5dd('0xc'),'port':0x18eb});var socket=require(_0xa5dd('0xd'))(new Redis(config[_0xa5dd('0xa')]));require('./mailQueue.socket')[_0xa5dd('0xe')](socket);function respondWithRpcPromise(_0x58a721,_0x32e106,_0x10b2a2){return new BPromise(function(_0x459c09,_0x3a8c4b){return client[_0xa5dd('0xf')](_0x58a721,_0x10b2a2)[_0xa5dd('0x10')](function(_0x57d13c){logger[_0xa5dd('0x11')](_0xa5dd('0x12'),_0x32e106,_0xa5dd('0x13'));logger[_0xa5dd('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x32e106,_0xa5dd('0x13'),JSON[_0xa5dd('0x15')](_0x57d13c));if(_0x57d13c[_0xa5dd('0x16')]){if(_0x57d13c[_0xa5dd('0x16')][_0xa5dd('0x17')]===0x1f4){logger[_0xa5dd('0x16')](_0xa5dd('0x12'),_0x32e106,_0x57d13c['error'][_0xa5dd('0x18')]);return _0x3a8c4b(_0x57d13c[_0xa5dd('0x16')][_0xa5dd('0x18')]);}logger[_0xa5dd('0x16')](_0xa5dd('0x12'),_0x32e106,_0x57d13c['error']['message']);return _0x459c09(_0x57d13c[_0xa5dd('0x16')][_0xa5dd('0x18')]);}else{logger[_0xa5dd('0x11')](_0xa5dd('0x12'),_0x32e106,_0xa5dd('0x13'));_0x459c09(_0x57d13c[_0xa5dd('0x19')][_0xa5dd('0x18')]);}})[_0xa5dd('0x1a')](function(_0x4fb386){logger[_0xa5dd('0x16')](_0xa5dd('0x12'),_0x32e106,_0x4fb386);_0x3a8c4b(_0x4fb386);});});}exports[_0xa5dd('0x1b')]=function(_0x163526){var _0x2416b1=this;return new Promise(function(_0x168ac9,_0x2debf7){return db[_0xa5dd('0x1c')][_0xa5dd('0x1d')]({'raw':_0x163526[_0xa5dd('0x1e')]?_0x163526['options'][_0xa5dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x163526[_0xa5dd('0x1e')]?_0x163526['options']['where']||null:null,'attributes':_0x163526[_0xa5dd('0x1e')]?_0x163526['options'][_0xa5dd('0x20')]||null:null,'limit':_0x163526['options']?_0x163526[_0xa5dd('0x1e')]['limit']||null:null,'include':_0x163526['options']?_0x163526['options'][_0xa5dd('0x21')]?_['map'](_0x163526[_0xa5dd('0x1e')][_0xa5dd('0x21')],function(_0x2cb719){return{'model':db[_0x2cb719[_0xa5dd('0x22')]],'as':_0x2cb719['as'],'attributes':_0x2cb719[_0xa5dd('0x20')],'include':_0x2cb719[_0xa5dd('0x21')]?_[_0xa5dd('0x23')](_0x2cb719[_0xa5dd('0x21')],function(_0x4ee9db){return{'model':db[_0x4ee9db['model']],'as':_0x4ee9db['as'],'attributes':_0x4ee9db[_0xa5dd('0x20')],'include':_0x4ee9db['include']?_['map'](_0x4ee9db['include'],function(_0x2be6fe){return{'model':db[_0x2be6fe['model']],'as':_0x2be6fe['as'],'attributes':_0x2be6fe[_0xa5dd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa5dd('0x10')](function(_0x58c421){logger[_0xa5dd('0x11')](_0xa5dd('0x1b'),_0x163526);logger['debug'](_0xa5dd('0x1b'),_0x163526,JSON[_0xa5dd('0x15')](_0x58c421));_0x168ac9(_0x58c421);})[_0xa5dd('0x1a')](function(_0x5815ca){logger[_0xa5dd('0x16')](_0xa5dd('0x1b'),_0x5815ca[_0xa5dd('0x18')],_0x163526);_0x2debf7(_0x2416b1['error'](0x1f4,_0x5815ca[_0xa5dd('0x18')]));});});};exports[_0xa5dd('0x24')]=function(_0x326d13){var _0x19dc91=this;return new Promise(function(_0x20beeb,_0x49c778){return db[_0xa5dd('0x1c')][_0xa5dd('0x25')]({'raw':_0x326d13[_0xa5dd('0x1e')]?_0x326d13[_0xa5dd('0x1e')][_0xa5dd('0x1f')]===undefined?!![]:![]:!![],'where':_0x326d13[_0xa5dd('0x1e')]?_0x326d13[_0xa5dd('0x1e')][_0xa5dd('0x26')]||null:null,'attributes':_0x326d13[_0xa5dd('0x1e')]?_0x326d13['options'][_0xa5dd('0x20')]||null:null,'include':_0x326d13[_0xa5dd('0x1e')]?_0x326d13[_0xa5dd('0x1e')][_0xa5dd('0x21')]?_['map'](_0x326d13[_0xa5dd('0x1e')][_0xa5dd('0x21')],function(_0x1c8091){return{'model':db[_0x1c8091[_0xa5dd('0x22')]],'as':_0x1c8091['as'],'attributes':_0x1c8091['attributes'],'include':_0x1c8091[_0xa5dd('0x21')]?_[_0xa5dd('0x23')](_0x1c8091[_0xa5dd('0x21')],function(_0x4bc2a3){return{'model':db[_0x4bc2a3['model']],'as':_0x4bc2a3['as'],'attributes':_0x4bc2a3['attributes'],'include':_0x4bc2a3['include']?_[_0xa5dd('0x23')](_0x4bc2a3['include'],function(_0x490403){return{'model':db[_0x490403['model']],'as':_0x490403['as'],'attributes':_0x490403['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x266db9){logger['info'](_0xa5dd('0x24'),_0x326d13);logger['debug'](_0xa5dd('0x24'),_0x326d13,JSON[_0xa5dd('0x15')](_0x266db9));_0x20beeb(_0x266db9);})[_0xa5dd('0x1a')](function(_0x29064d){logger[_0xa5dd('0x16')](_0xa5dd('0x24'),_0x29064d[_0xa5dd('0x18')],_0x326d13);_0x49c778(_0x19dc91['error'](0x1f4,_0x29064d[_0xa5dd('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d49cc90..e4fe671 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 _0x09a5=['register','length','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x22f51c,_0xca9b6e){var _0x475190=function(_0x2c91bd){while(--_0x2c91bd){_0x22f51c['push'](_0x22f51c['shift']());}};_0x475190(++_0xca9b6e);}(_0x09a5,0x8b));var _0x509a=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x09a5[_0x16d10f];return _0x50c823;};'use strict';var MailQueueEvents=require(_0x509a('0x0'));var events=[_0x509a('0x1'),'remove',_0x509a('0x2')];function createListener(_0x4e9388,_0x49ed48){return function(_0x1c83a1){_0x49ed48[_0x509a('0x3')](_0x4e9388,_0x1c83a1);};}function removeListener(_0x4a69a9,_0x45d8ca){return function(){MailQueueEvents[_0x509a('0x4')](_0x4a69a9,_0x45d8ca);};}exports[_0x509a('0x5')]=function(_0x3c9084){for(var _0xb0a8db=0x0,_0x47148f=events[_0x509a('0x6')];_0xb0a8db<_0x47148f;_0xb0a8db++){var _0x5041e3=events[_0xb0a8db];var _0xc35304=createListener(_0x509a('0x7')+_0x5041e3,_0x3c9084);MailQueueEvents['on'](_0x5041e3,_0xc35304);}}; \ No newline at end of file +var _0xdafa=['register','length','mailQueue:','save','remove','update','emit','removeListener'];(function(_0x9aaf48,_0x26bd24){var _0x4ce7e6=function(_0x3e4b2e){while(--_0x3e4b2e){_0x9aaf48['push'](_0x9aaf48['shift']());}};_0x4ce7e6(++_0x26bd24);}(_0xdafa,0x113));var _0xadaf=function(_0x56d7fc,_0x5eb9b0){_0x56d7fc=_0x56d7fc-0x0;var _0x35c6dd=_0xdafa[_0x56d7fc];return _0x35c6dd;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xadaf('0x0'),_0xadaf('0x1'),_0xadaf('0x2')];function createListener(_0x4c325c,_0xf860e5){return function(_0x9e9d5b){_0xf860e5[_0xadaf('0x3')](_0x4c325c,_0x9e9d5b);};}function removeListener(_0x1c4f48,_0xd745b1){return function(){MailQueueEvents[_0xadaf('0x4')](_0x1c4f48,_0xd745b1);};}exports[_0xadaf('0x5')]=function(_0x8dd02d){for(var _0x481c10=0x0,_0x283994=events[_0xadaf('0x6')];_0x481c10<_0x283994;_0x481c10++){var _0x2ac1e9=events[_0x481c10];var _0x3f3b44=createListener(_0xadaf('0x7')+_0x2ac1e9,_0x8dd02d);MailQueueEvents['on'](_0x2ac1e9,_0x3f3b44);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 82f28ef..8997e28 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 _0xb7de=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x13ddda,_0x4b5836){var _0x5ca279=function(_0x6d6d2a){while(--_0x6d6d2a){_0x13ddda['push'](_0x13ddda['shift']());}};_0x5ca279(++_0x4b5836);}(_0xb7de,0xa6));var _0xeb7d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xb7de[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var path=require(_0xeb7d('0x2'));var timeout=require(_0xeb7d('0x3'));var express=require(_0xeb7d('0x4'));var router=express['Router']();var fs_extra=require(_0xeb7d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeb7d('0x6'));var config=require(_0xeb7d('0x7'));var controller=require('./mailQueueReport.controller');router[_0xeb7d('0x8')]('/',auth[_0xeb7d('0x9')](),controller[_0xeb7d('0xa')]);router[_0xeb7d('0x8')](_0xeb7d('0xb'),auth[_0xeb7d('0x9')](),controller[_0xeb7d('0xc')]);router[_0xeb7d('0x8')](_0xeb7d('0xd'),auth['isAuthenticated'](),controller[_0xeb7d('0xe')]);router[_0xeb7d('0xf')]('/',auth[_0xeb7d('0x9')](),controller[_0xeb7d('0x10')]);router['put'](_0xeb7d('0xd'),auth[_0xeb7d('0x9')](),controller[_0xeb7d('0x11')]);router[_0xeb7d('0x12')](_0xeb7d('0xd'),auth[_0xeb7d('0x9')](),controller['destroy']);module[_0xeb7d('0x13')]=router; \ No newline at end of file +var _0x205d=['create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x2fe88f,_0x2a19d5){var _0x15eb30=function(_0x55c393){while(--_0x55c393){_0x2fe88f['push'](_0x2fe88f['shift']());}};_0x15eb30(++_0x2a19d5);}(_0x205d,0x1a9));var _0xd205=function(_0x5c23cc,_0x3bac85){_0x5c23cc=_0x5c23cc-0x0;var _0x1add2d=_0x205d[_0x5c23cc];return _0x1add2d;};'use strict';var multer=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd205('0x2'));var router=express[_0xd205('0x3')]();var fs_extra=require(_0xd205('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd205('0x5'));var config=require(_0xd205('0x6'));var controller=require(_0xd205('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd205('0x8')]);router[_0xd205('0x9')](_0xd205('0xa'),auth[_0xd205('0xb')](),controller[_0xd205('0xc')]);router[_0xd205('0x9')](_0xd205('0xd'),auth[_0xd205('0xb')](),controller[_0xd205('0xe')]);router[_0xd205('0xf')]('/',auth[_0xd205('0xb')](),controller[_0xd205('0x10')]);router[_0xd205('0x11')](_0xd205('0xd'),auth['isAuthenticated'](),controller[_0xd205('0x12')]);router[_0xd205('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd205('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b46ceef..d68bd2a 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 _0xf59f=['sequelize','exports','STRING','DATE'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf59f,0xb4));var _0xff59=function(_0x557fb5,_0x3a056e){_0x557fb5=_0x557fb5-0x0;var _0x57aa93=_0xf59f[_0x557fb5];return _0x57aa93;};'use strict';var moment=require('moment');var Sequelize=require(_0xff59('0x0'));module[_0xff59('0x1')]={'uniqueid':{'type':Sequelize[_0xff59('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xff59('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xff59('0x3')]},'acceptAt':{'type':Sequelize[_0xff59('0x3')]},'exitAt':{'type':Sequelize[_0xff59('0x3')]},'reason':{'type':Sequelize[_0xff59('0x2')]}}; \ No newline at end of file +var _0xb27f=['exports','STRING','DATE','moment','sequelize'];(function(_0x1071d6,_0x293323){var _0x4c6be4=function(_0x43a973){while(--_0x43a973){_0x1071d6['push'](_0x1071d6['shift']());}};_0x4c6be4(++_0x293323);}(_0xb27f,0x67));var _0xfb27=function(_0x1c9dc6,_0x405757){_0x1c9dc6=_0x1c9dc6-0x0;var _0x3893aa=_0xb27f[_0x1c9dc6];return _0x3893aa;};'use strict';var moment=require(_0xfb27('0x0'));var Sequelize=require(_0xfb27('0x1'));module[_0xfb27('0x2')]={'uniqueid':{'type':Sequelize[_0xfb27('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfb27('0x3')]},'joinAt':{'type':Sequelize[_0xfb27('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfb27('0x4')]},'exitAt':{'type':Sequelize[_0xfb27('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1d7417d..36f9a1c 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 _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0xead684,_0x585eec){var _0x5e1fad=function(_0x5baa7a){while(--_0x5baa7a){_0xead684['push'](_0xead684['shift']());}};_0x5e1fad(++_0x585eec);}(_0x4975,0x86));var _0x5497=function(_0x29c1d4,_0x3d79d3){_0x29c1d4=_0x29c1d4-0x0;var _0x59995d=_0x4975[_0x29c1d4];return _0x59995d;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['MailQueueReport'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['MailQueueReport'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file +var _0xed1c=['rows','catch','show','MailQueueReport','create','body','params','find','describe','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0xc82606,_0x201a53){var _0x1782c4=function(_0x1b1dbd){while(--_0x1b1dbd){_0xc82606['push'](_0xc82606['shift']());}};_0x1782c4(++_0x201a53);}(_0xed1c,0xe4));var _0xced1=function(_0xc1ff78,_0x4a0de7){_0xc1ff78=_0xc1ff78-0x0;var _0x57769a=_0xed1c[_0xc1ff78];return _0x57769a;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];function respondWithStatusCode(_0x5e5637,_0x118f69){_0x118f69=_0x118f69||0xcc;return function(_0x2a5cd6){if(_0x2a5cd6){return _0x5e5637[_0xced1('0x18')](_0x118f69);}return _0x5e5637[_0xced1('0x19')](_0x118f69)['end']();};}function respondWithResult(_0xdaaea7,_0x31a32c){_0x31a32c=_0x31a32c||0xc8;return function(_0x54cba9){if(_0x54cba9){return _0xdaaea7[_0xced1('0x19')](_0x31a32c)[_0xced1('0x1a')](_0x54cba9);}};}function respondWithFilteredResult(_0x3708b1,_0x32100b){return function(_0x47baec){if(_0x47baec){var _0x5560af=typeof _0x32100b[_0xced1('0x1b')]===_0xced1('0x1c')&&typeof _0x32100b[_0xced1('0x1d')]===_0xced1('0x1c');var _0x3e53bd=_0x47baec[_0xced1('0x1e')];var _0x5a563a=_0x5560af?0x0:_0x32100b['offset'];var _0x2a92c8=_0x5560af?_0x47baec[_0xced1('0x1e')]:_0x32100b[_0xced1('0x1b')]+_0x32100b['limit'];var _0x1eac14;if(_0x2a92c8>=_0x3e53bd){_0x2a92c8=_0x3e53bd;_0x1eac14=0xc8;}else{_0x1eac14=0xce;}_0x3708b1[_0xced1('0x19')](_0x1eac14);return _0x3708b1[_0xced1('0x1f')]('Content-Range',_0x5a563a+'-'+_0x2a92c8+'/'+_0x3e53bd)[_0xced1('0x1a')](_0x47baec);}return null;};}function patchUpdates(_0x42b146){return function(_0x23ded4){try{jsonpatch['apply'](_0x23ded4,_0x42b146,!![]);}catch(_0x138c8b){return BPromise[_0xced1('0x20')](_0x138c8b);}return _0x23ded4[_0xced1('0x21')]();};}function saveUpdates(_0x5f1474,_0x4dab56){return function(_0x1d3884){if(_0x1d3884){return _0x1d3884[_0xced1('0x22')](_0x5f1474)[_0xced1('0x23')](function(_0x20dcb4){return _0x20dcb4;});}return null;};}function removeEntity(_0x210d7e,_0x49c8b9){return function(_0x14f47e){if(_0x14f47e){return _0x14f47e[_0xced1('0x24')]()['then'](function(){_0x210d7e['status'](0xcc)[_0xced1('0x25')]();});}};}function handleEntityNotFound(_0x258c9a,_0x3af9c0){return function(_0x3912fe){if(!_0x3912fe){_0x258c9a[_0xced1('0x18')](0x194);}return _0x3912fe;};}function handleError(_0x25b6e7,_0x50c543){_0x50c543=_0x50c543||0x1f4;return function(_0x181f6e){logger[_0xced1('0x26')](_0x181f6e[_0xced1('0x27')]);if(_0x181f6e[_0xced1('0x28')]){delete _0x181f6e[_0xced1('0x28')];}_0x25b6e7[_0xced1('0x19')](_0x50c543)[_0xced1('0x29')](_0x181f6e);};}exports['index']=function(_0x15c4f4,_0x4ef64e){var _0x45cb03={},_0x2c2269={},_0x6dc558={'count':0x0,'rows':[]};var _0x176215=_['map'](db['MailQueueReport'][_0xced1('0x2a')],function(_0x15117b){return{'name':_0x15117b[_0xced1('0x2b')],'type':_0x15117b['type']['key']};});_0x2c2269['model']=_[_0xced1('0x2c')](_0x176215,_0xced1('0x28'));_0x2c2269[_0xced1('0x2d')]=_[_0xced1('0x2e')](_0x15c4f4['query']);_0x2c2269[_0xced1('0x2f')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],_0x2c2269[_0xced1('0x2d')]);_0x45cb03[_0xced1('0x32')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],qs['fields'](_0x15c4f4['query'][_0xced1('0x33')]));_0x45cb03[_0xced1('0x32')]=_0x45cb03[_0xced1('0x32')][_0xced1('0x34')]?_0x45cb03[_0xced1('0x32')]:_0x2c2269[_0xced1('0x31')];if(!_0x15c4f4['query']['hasOwnProperty']('nolimit')){_0x45cb03['limit']=qs[_0xced1('0x1d')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1d')]);_0x45cb03[_0xced1('0x1b')]=qs[_0xced1('0x1b')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1b')]);}_0x45cb03[_0xced1('0x35')]=qs[_0xced1('0x36')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x36')]);_0x45cb03[_0xced1('0x37')]=qs[_0xced1('0x2f')](_['pick'](_0x15c4f4[_0xced1('0x2d')],_0x2c2269[_0xced1('0x2f')]),_0x176215);if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]){_0x45cb03[_0xced1('0x37')]=_[_0xced1('0x39')](_0x45cb03['where'],{'$or':_[_0xced1('0x2c')](_0x176215,function(_0x3f3632){if(_0x3f3632[_0xced1('0x3a')]!==_0xced1('0x3b')){var _0x282361={};_0x282361[_0x3f3632[_0xced1('0x28')]]={'$like':'%'+_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]+'%'};return _0x282361;}})});}_0x45cb03=_[_0xced1('0x39')]({},_0x45cb03,_0x15c4f4[_0xced1('0x3c')]);var _0x1e119c={'where':_0x45cb03['where']};return db['MailQueueReport'][_0xced1('0x1e')](_0x1e119c)[_0xced1('0x23')](function(_0x1887a3){_0x6dc558['count']=_0x1887a3;if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x3d')]){_0x45cb03[_0xced1('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0xced1('0x3f')](_0x45cb03);})[_0xced1('0x23')](function(_0x5a01f6){_0x6dc558[_0xced1('0x40')]=_0x5a01f6;return _0x6dc558;})['then'](respondWithFilteredResult(_0x4ef64e,_0x45cb03))[_0xced1('0x41')](handleError(_0x4ef64e,null));};exports[_0xced1('0x42')]=function(_0x4f99df,_0x1ddaea){var _0x172a7e={'raw':!![],'where':{'id':_0x4f99df['params']['id']}},_0xdb8e8e={};_0xdb8e8e[_0xced1('0x31')]=_[_0xced1('0x2e')](db['MailQueueReport'][_0xced1('0x2a')]);_0xdb8e8e['query']=_['keys'](_0x4f99df[_0xced1('0x2d')]);_0xdb8e8e['filters']=_[_0xced1('0x30')](_0xdb8e8e[_0xced1('0x31')],_0xdb8e8e[_0xced1('0x2d')]);_0x172a7e['attributes']=_[_0xced1('0x30')](_0xdb8e8e['model'],qs[_0xced1('0x33')](_0x4f99df[_0xced1('0x2d')][_0xced1('0x33')]));_0x172a7e[_0xced1('0x32')]=_0x172a7e['attributes'][_0xced1('0x34')]?_0x172a7e[_0xced1('0x32')]:_0xdb8e8e['model'];if(_0x4f99df[_0xced1('0x2d')][_0xced1('0x3d')]){_0x172a7e['include']=[{'all':!![]}];}_0x172a7e=_[_0xced1('0x39')]({},_0x172a7e,_0x4f99df[_0xced1('0x3c')]);return db[_0xced1('0x43')]['find'](_0x172a7e)[_0xced1('0x23')](handleEntityNotFound(_0x1ddaea,null))[_0xced1('0x23')](respondWithResult(_0x1ddaea,null))[_0xced1('0x41')](handleError(_0x1ddaea,null));};exports[_0xced1('0x44')]=function(_0x376619,_0x528cd5){return db[_0xced1('0x43')]['create'](_0x376619[_0xced1('0x45')],{})[_0xced1('0x23')](respondWithResult(_0x528cd5,0xc9))[_0xced1('0x41')](handleError(_0x528cd5,null));};exports[_0xced1('0x22')]=function(_0x412693,_0x38aa3b){if(_0x412693['body']['id']){delete _0x412693[_0xced1('0x45')]['id'];}return db[_0xced1('0x43')]['find']({'where':{'id':_0x412693[_0xced1('0x46')]['id']}})['then'](handleEntityNotFound(_0x38aa3b,null))['then'](saveUpdates(_0x412693[_0xced1('0x45')],null))[_0xced1('0x23')](respondWithResult(_0x38aa3b,null))[_0xced1('0x41')](handleError(_0x38aa3b,null));};exports[_0xced1('0x24')]=function(_0x4f0183,_0x1090bc){return db[_0xced1('0x43')][_0xced1('0x47')]({'where':{'id':_0x4f0183['params']['id']}})['then'](handleEntityNotFound(_0x1090bc,null))[_0xced1('0x23')](removeEntity(_0x1090bc,null))[_0xced1('0x41')](handleError(_0x1090bc,null));};exports[_0xced1('0x48')]=function(_0x226b3e,_0x4b460e){return db['MailQueueReport']['describe']()[_0xced1('0x23')](respondWithResult(_0x4b460e,null))[_0xced1('0x41')](handleError(_0x4b460e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 3b05d37..ae178ab 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 _0x4a87=['report_mail_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x2ec044,_0x59bf82){var _0x32208c=function(_0x293ee7){while(--_0x293ee7){_0x2ec044['push'](_0x2ec044['shift']());}};_0x32208c(++_0x59bf82);}(_0x4a87,0xe5));var _0x74a8=function(_0x5f30b2,_0x27642d){_0x5f30b2=_0x5f30b2-0x0;var _0x338756=_0x4a87[_0x5f30b2];return _0x338756;};'use strict';var _=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var logger=require(_0x74a8('0x2'))(_0x74a8('0x3'));var moment=require(_0x74a8('0x4'));var BPromise=require(_0x74a8('0x5'));var rp=require(_0x74a8('0x6'));var fs=require('fs');var path=require(_0x74a8('0x7'));var rimraf=require(_0x74a8('0x8'));var config=require(_0x74a8('0x9'));var attributes=require(_0x74a8('0xa'));module['exports']=function(_0x1825f5,_0x6685b4){return _0x1825f5['define']('MailQueueReport',attributes,{'tableName':_0x74a8('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8273=['util','api','moment','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x55e8b6,_0x4a566d){var _0x19c940=function(_0x55729b){while(--_0x55729b){_0x55e8b6['push'](_0x55e8b6['shift']());}};_0x19c940(++_0x4a566d);}(_0x8273,0x1d3));var _0x3827=function(_0x42080d,_0x287608){_0x42080d=_0x42080d-0x0;var _0x6cc9cd=_0x8273[_0x42080d];return _0x6cc9cd;};'use strict';var _=require(_0x3827('0x0'));var util=require(_0x3827('0x1'));var logger=require('../../config/logger')(_0x3827('0x2'));var moment=require(_0x3827('0x3'));var BPromise=require(_0x3827('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3827('0x5'));var config=require(_0x3827('0x6'));var attributes=require(_0x3827('0x7'));module[_0x3827('0x8')]=function(_0x1f1099,_0x58534b){return _0x1f1099[_0x3827('0x9')](_0x3827('0xa'),attributes,{'tableName':_0x3827('0xb'),'paranoid':![],'indexes':[{'name':_0x3827('0xc'),'fields':[_0x3827('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 1087ac6..4268b5c 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x44fd0b,_0x981d85){var _0x3afb84=function(_0x5090c5){while(--_0x5090c5){_0x44fd0b['push'](_0x44fd0b['shift']());}};_0x3afb84(++_0x981d85);}(_0xadb5,0xad));var _0x5adb=function(_0x30159b,_0x9e5951){_0x30159b=_0x30159b-0x0;var _0x396a32=_0xadb5[_0x30159b];return _0x396a32;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x295b69,_0x2012c8){var _0x532a4f=function(_0x15f87b){while(--_0x15f87b){_0x295b69['push'](_0x295b69['shift']());}};_0x532a4f(++_0x2012c8);}(_0x1261,0x144));var _0x1126=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0x1261[_0x49b14d];return _0x3d2488;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 0df52ac..bfa2768 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3871ad,_0x3e6dca){var _0x58fa2a=function(_0x492e4c){while(--_0x492e4c){_0x3871ad['push'](_0x3871ad['shift']());}};_0x58fa2a(++_0x3e6dca);}(_0x70e0,0x17b));var _0x070e=function(_0x346d34,_0x3f5a7e){_0x346d34=_0x346d34-0x0;var _0x26c9cb=_0x70e0[_0x346d34];return _0x26c9cb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x32da14,_0x477a3e){var _0x36306b=function(_0x24f0ba){while(--_0x24f0ba){_0x32da14['push'](_0x32da14['shift']());}};_0x36306b(++_0x477a3e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 52fe9e7..dd0cecb 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 _0x41bb=['exports','STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x57b263,_0x8bc21e){var _0x38ead5=function(_0x4c3beb){while(--_0x4c3beb){_0x57b263['push'](_0x57b263['shift']());}};_0x38ead5(++_0x8bc21e);}(_0x41bb,0xc5));var _0xb41b=function(_0x3d1e90,_0x33e6bd){_0x3d1e90=_0x3d1e90-0x0;var _0x49ccc2=_0x41bb[_0x3d1e90];return _0x49ccc2;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb41b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xb41b('0x2')]},'password':{'type':Sequelize[_0xb41b('0x2')]},'port':{'type':Sequelize[_0xb41b('0x3')]},'tls':{'type':Sequelize[_0xb41b('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x5')},'connTimeout':{'type':Sequelize[_0xb41b('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb41b('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6324=['STRING','INTEGER','sequelize','exports'];(function(_0x40127c,_0x3ab4ab){var _0xddb92=function(_0xa0b358){while(--_0xa0b358){_0x40127c['push'](_0x40127c['shift']());}};_0xddb92(++_0x3ab4ab);}(_0x6324,0x142));var _0x4632=function(_0x163f94,_0x1d0c28){_0x163f94=_0x163f94-0x0;var _0x3a7506=_0x6324[_0x163f94];return _0x3a7506;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'description':{'type':Sequelize[_0x4632('0x2')]},'host':{'type':Sequelize[_0x4632('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x4632('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4632('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4632('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x4632('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4632('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4632('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 2e0524c..33021d1 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 _0x7fad=['api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','util','../../config/logger'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x7fad,0xfb));var _0xd7fa=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x7fad[_0x26fc81];return _0x9feece;};'use strict';var _=require('lodash');var util=require(_0xd7fa('0x0'));var logger=require(_0xd7fa('0x1'))(_0xd7fa('0x2'));var moment=require(_0xd7fa('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7fa('0x4'));var fs=require('fs');var path=require(_0xd7fa('0x5'));var rimraf=require(_0xd7fa('0x6'));var config=require(_0xd7fa('0x7'));var attributes=require(_0xd7fa('0x8'));module[_0xd7fa('0x9')]=function(_0x44d42a,_0xc68c29){return _0x44d42a['define'](_0xd7fa('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e64=['../../config/logger','api','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','util'];(function(_0x10b8f4,_0x151f63){var _0x3dd748=function(_0x4d890a){while(--_0x4d890a){_0x10b8f4['push'](_0x10b8f4['shift']());}};_0x3dd748(++_0x151f63);}(_0x9e64,0x1a1));var _0x49e6=function(_0x5f0219,_0x30cad1){_0x5f0219=_0x5f0219-0x0;var _0x563bc9=_0x9e64[_0x5f0219];return _0x563bc9;};'use strict';var _=require('lodash');var util=require(_0x49e6('0x0'));var logger=require(_0x49e6('0x1'))(_0x49e6('0x2'));var moment=require('moment');var BPromise=require(_0x49e6('0x3'));var rp=require(_0x49e6('0x4'));var fs=require('fs');var path=require(_0x49e6('0x5'));var rimraf=require(_0x49e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x49e6('0x7'));module[_0x49e6('0x8')]=function(_0x41cd33,_0xc5cd81){return _0x41cd33['define'](_0x49e6('0x9'),attributes,{'tableName':_0x49e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 13cabcd..f2a9a6b 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 _0xecf3=['then','info','request\x20sent','debug','stringify','error','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','findAll','options','raw','limit','map','include','attributes','model','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x5457a1,_0x2478b3){var _0x52ad60=function(_0x43692b){while(--_0x43692b){_0x5457a1['push'](_0x5457a1['shift']());}};_0x52ad60(++_0x2478b3);}(_0xecf3,0x66));var _0x3ecf=function(_0x293743,_0x5c620b){_0x293743=_0x293743-0x0;var _0x2322ad=_0xecf3[_0x293743];return _0x2322ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ecf('0x0'));var BPromise=require(_0x3ecf('0x1'));var rs=require(_0x3ecf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ecf('0x3'))['db'];var utils=require(_0x3ecf('0x4'));var logger=require(_0x3ecf('0x5'))('rpc');var config=require(_0x3ecf('0x6'));var jayson=require(_0x3ecf('0x7'));var client=jayson['client'][_0x3ecf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d13b8,_0x99055c,_0x17dd93){return new BPromise(function(_0x1ef6c3,_0x3d1eb2){return client[_0x3ecf('0x9')](_0x4d13b8,_0x17dd93)[_0x3ecf('0xa')](function(_0x20de04){logger[_0x3ecf('0xb')]('MailServerIn,\x20%s,\x20%s',_0x99055c,_0x3ecf('0xc'));logger[_0x3ecf('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x99055c,_0x3ecf('0xc'),JSON[_0x3ecf('0xe')](_0x20de04));if(_0x20de04['error']){if(_0x20de04[_0x3ecf('0xf')]['code']===0x1f4){logger[_0x3ecf('0xf')](_0x3ecf('0x10'),_0x99055c,_0x20de04['error'][_0x3ecf('0x11')]);return _0x3d1eb2(_0x20de04[_0x3ecf('0xf')][_0x3ecf('0x11')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x99055c,_0x20de04['error']['message']);return _0x1ef6c3(_0x20de04[_0x3ecf('0xf')][_0x3ecf('0x11')]);}else{logger[_0x3ecf('0xb')](_0x3ecf('0x10'),_0x99055c,'request\x20sent');_0x1ef6c3(_0x20de04['result']['message']);}})[_0x3ecf('0x12')](function(_0x60735f){logger[_0x3ecf('0xf')](_0x3ecf('0x10'),_0x99055c,_0x60735f);_0x3d1eb2(_0x60735f);});});}exports[_0x3ecf('0x13')]=function(_0x428f24){var _0x51dae0=this;return new Promise(function(_0x3014ef,_0x105612){return db['MailServerIn'][_0x3ecf('0x14')]({'raw':_0x428f24[_0x3ecf('0x15')]?_0x428f24[_0x3ecf('0x15')][_0x3ecf('0x16')]===undefined?!![]:![]:!![],'where':_0x428f24['options']?_0x428f24['options']['where']||null:null,'attributes':_0x428f24[_0x3ecf('0x15')]?_0x428f24[_0x3ecf('0x15')]['attributes']||null:null,'limit':_0x428f24['options']?_0x428f24['options'][_0x3ecf('0x17')]||null:null,'include':_0x428f24[_0x3ecf('0x15')]?_0x428f24[_0x3ecf('0x15')]['include']?_[_0x3ecf('0x18')](_0x428f24['options'][_0x3ecf('0x19')],function(_0x6c8a4f){return{'model':db[_0x6c8a4f['model']],'as':_0x6c8a4f['as'],'attributes':_0x6c8a4f[_0x3ecf('0x1a')],'include':_0x6c8a4f[_0x3ecf('0x19')]?_[_0x3ecf('0x18')](_0x6c8a4f[_0x3ecf('0x19')],function(_0xc6e2f7){return{'model':db[_0xc6e2f7[_0x3ecf('0x1b')]],'as':_0xc6e2f7['as'],'attributes':_0xc6e2f7[_0x3ecf('0x1a')],'include':_0xc6e2f7[_0x3ecf('0x19')]?_[_0x3ecf('0x18')](_0xc6e2f7[_0x3ecf('0x19')],function(_0x3b2d75){return{'model':db[_0x3b2d75['model']],'as':_0x3b2d75['as'],'attributes':_0x3b2d75[_0x3ecf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3ecf('0xa')](function(_0x1f34ca){logger[_0x3ecf('0xb')](_0x3ecf('0x13'),_0x428f24);logger[_0x3ecf('0xd')](_0x3ecf('0x13'),_0x428f24,JSON[_0x3ecf('0xe')](_0x1f34ca));_0x3014ef(_0x1f34ca);})[_0x3ecf('0x12')](function(_0xa17e6d){logger[_0x3ecf('0xf')](_0x3ecf('0x13'),_0xa17e6d['message'],_0x428f24);_0x105612(_0x51dae0[_0x3ecf('0xf')](0x1f4,_0xa17e6d[_0x3ecf('0x11')]));});});}; \ No newline at end of file +var _0xb65c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','findAll','options','attributes','limit','include','map','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x25f82f,_0x51bb08){var _0x453365=function(_0x45dc47){while(--_0x45dc47){_0x25f82f['push'](_0x25f82f['shift']());}};_0x453365(++_0x51bb08);}(_0xb65c,0x16e));var _0xcb65=function(_0x52dc0d,_0x4db716){_0x52dc0d=_0x52dc0d-0x0;var _0x9e4e71=_0xb65c[_0x52dc0d];return _0x9e4e71;};'use strict';var _=require(_0xcb65('0x0'));var util=require(_0xcb65('0x1'));var moment=require('moment');var BPromise=require(_0xcb65('0x2'));var rs=require(_0xcb65('0x3'));var fs=require('fs');var Redis=require(_0xcb65('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb65('0x5'));var logger=require(_0xcb65('0x6'))('rpc');var config=require(_0xcb65('0x7'));var jayson=require(_0xcb65('0x8'));var client=jayson[_0xcb65('0x9')][_0xcb65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a361e,_0x2c0a19,_0x5cfc4f){return new BPromise(function(_0x436361,_0x45ab37){return client[_0xcb65('0xb')](_0x5a361e,_0x5cfc4f)[_0xcb65('0xc')](function(_0x2af6d4){logger[_0xcb65('0xd')](_0xcb65('0xe'),_0x2c0a19,_0xcb65('0xf'));logger[_0xcb65('0x10')](_0xcb65('0x11'),_0x2c0a19,'request\x20sent',JSON['stringify'](_0x2af6d4));if(_0x2af6d4[_0xcb65('0x12')]){if(_0x2af6d4[_0xcb65('0x12')][_0xcb65('0x13')]===0x1f4){logger[_0xcb65('0x12')]('MailServerIn,\x20%s,\x20%s',_0x2c0a19,_0x2af6d4['error']['message']);return _0x45ab37(_0x2af6d4[_0xcb65('0x12')]['message']);}logger[_0xcb65('0x12')](_0xcb65('0xe'),_0x2c0a19,_0x2af6d4[_0xcb65('0x12')][_0xcb65('0x14')]);return _0x436361(_0x2af6d4[_0xcb65('0x12')][_0xcb65('0x14')]);}else{logger[_0xcb65('0xd')](_0xcb65('0xe'),_0x2c0a19,'request\x20sent');_0x436361(_0x2af6d4['result']['message']);}})[_0xcb65('0x15')](function(_0x12636){logger['error'](_0xcb65('0xe'),_0x2c0a19,_0x12636);_0x45ab37(_0x12636);});});}exports[_0xcb65('0x16')]=function(_0x24339e){var _0x1e9a96=this;return new Promise(function(_0x151f39,_0x4b3e50){return db['MailServerIn'][_0xcb65('0x17')]({'raw':_0x24339e['options']?_0x24339e[_0xcb65('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24339e[_0xcb65('0x18')]?_0x24339e[_0xcb65('0x18')]['where']||null:null,'attributes':_0x24339e[_0xcb65('0x18')]?_0x24339e[_0xcb65('0x18')][_0xcb65('0x19')]||null:null,'limit':_0x24339e[_0xcb65('0x18')]?_0x24339e[_0xcb65('0x18')][_0xcb65('0x1a')]||null:null,'include':_0x24339e[_0xcb65('0x18')]?_0x24339e['options'][_0xcb65('0x1b')]?_[_0xcb65('0x1c')](_0x24339e[_0xcb65('0x18')][_0xcb65('0x1b')],function(_0x48e22d){return{'model':db[_0x48e22d['model']],'as':_0x48e22d['as'],'attributes':_0x48e22d[_0xcb65('0x19')],'include':_0x48e22d[_0xcb65('0x1b')]?_['map'](_0x48e22d[_0xcb65('0x1b')],function(_0x6d0c43){return{'model':db[_0x6d0c43[_0xcb65('0x1d')]],'as':_0x6d0c43['as'],'attributes':_0x6d0c43[_0xcb65('0x19')],'include':_0x6d0c43[_0xcb65('0x1b')]?_[_0xcb65('0x1c')](_0x6d0c43[_0xcb65('0x1b')],function(_0x5bd449){return{'model':db[_0x5bd449[_0xcb65('0x1d')]],'as':_0x5bd449['as'],'attributes':_0x5bd449[_0xcb65('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcb65('0xc')](function(_0x252f87){logger[_0xcb65('0xd')](_0xcb65('0x16'),_0x24339e);logger[_0xcb65('0x10')](_0xcb65('0x16'),_0x24339e,JSON[_0xcb65('0x1e')](_0x252f87));_0x151f39(_0x252f87);})[_0xcb65('0x15')](function(_0x452a25){logger[_0xcb65('0x12')](_0xcb65('0x16'),_0x452a25[_0xcb65('0x14')],_0x24339e);_0x4b3e50(_0x1e9a96[_0xcb65('0x12')](0x1f4,_0x452a25[_0xcb65('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3dee683..7566f64 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index e256240..957030d 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 _0xb201=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xb201,0x117));var _0x1b20=function(_0x2ace4d,_0x235458){_0x2ace4d=_0x2ace4d-0x0;var _0x485284=_0xb201[_0x2ace4d];return _0x485284;};'use strict';var Sequelize=require(_0x1b20('0x0'));module['exports']={'description':{'type':Sequelize[_0x1b20('0x1')]},'host':{'type':Sequelize[_0x1b20('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1b20('0x1')]},'port':{'type':Sequelize[_0x1b20('0x2')]},'secure':{'type':Sequelize[_0x1b20('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x04d0=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x3ddfe1,_0x5f37f0){var _0x4a543f=function(_0x44f351){while(--_0x44f351){_0x3ddfe1['push'](_0x3ddfe1['shift']());}};_0x4a543f(++_0x5f37f0);}(_0x04d0,0x12a));var _0x004d=function(_0x7d8d6f,_0x27eef4){_0x7d8d6f=_0x7d8d6f-0x0;var _0x4e79dd=_0x04d0[_0x7d8d6f];return _0x4e79dd;};'use strict';var Sequelize=require(_0x004d('0x0'));module['exports']={'description':{'type':Sequelize[_0x004d('0x1')]},'host':{'type':Sequelize[_0x004d('0x1')]},'user':{'type':Sequelize[_0x004d('0x1')]},'pass':{'type':Sequelize[_0x004d('0x1')]},'port':{'type':Sequelize[_0x004d('0x2')]},'secure':{'type':Sequelize[_0x004d('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x004d('0x1')]},'authentication':{'type':Sequelize[_0x004d('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 3e24902..9066f60 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 _0x40e6=['index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','MailServerOut','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x153a9f,_0x4ab2bd){var _0x11b1e0=function(_0x46caa4){while(--_0x46caa4){_0x153a9f['push'](_0x153a9f['shift']());}};_0x11b1e0(++_0x4ab2bd);}(_0x40e6,0x6c));var _0x640e=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x40e6[_0x13b7fd];return _0x32a74a;};'use strict';var emlformat=require(_0x640e('0x0'));var rimraf=require(_0x640e('0x1'));var zipdir=require(_0x640e('0x2'));var jsonpatch=require(_0x640e('0x3'));var rp=require(_0x640e('0x4'));var moment=require(_0x640e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x640e('0x6'));var util=require(_0x640e('0x7'));var path=require(_0x640e('0x8'));var sox=require(_0x640e('0x9'));var csv=require('to-csv');var ejs=require(_0x640e('0xa'));var fs=require('fs');var fs_extra=require(_0x640e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x640e('0xc'));var jsforce=require(_0x640e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x640e('0xe'));var querystring=require(_0x640e('0xf'));var Papa=require('papaparse');var Redis=require(_0x640e('0x10'));var authService=require(_0x640e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x640e('0x12'));var hardwareService=require(_0x640e('0x13'));var logger=require(_0x640e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x640e('0x15'));var licenseUtil=require(_0x640e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x555286,_0x4204ec){_0x4204ec=_0x4204ec||0xcc;return function(_0x4770c4){if(_0x4770c4){return _0x555286[_0x640e('0x17')](_0x4204ec);}return _0x555286[_0x640e('0x18')](_0x4204ec)[_0x640e('0x19')]();};}function respondWithResult(_0x481df5,_0x109408){_0x109408=_0x109408||0xc8;return function(_0x121a31){if(_0x121a31){return _0x481df5[_0x640e('0x18')](_0x109408)['json'](_0x121a31);}};}function respondWithFilteredResult(_0x578819,_0x223ba0){return function(_0x132699){if(_0x132699){var _0x1997d4=typeof _0x223ba0[_0x640e('0x1a')]===_0x640e('0x1b')&&typeof _0x223ba0[_0x640e('0x1c')]===_0x640e('0x1b');var _0x3d2da7=_0x132699[_0x640e('0x1d')];var _0x90465d=_0x1997d4?0x0:_0x223ba0[_0x640e('0x1a')];var _0x2912c0=_0x1997d4?_0x132699[_0x640e('0x1d')]:_0x223ba0[_0x640e('0x1a')]+_0x223ba0[_0x640e('0x1c')];var _0x321193;if(_0x2912c0>=_0x3d2da7){_0x2912c0=_0x3d2da7;_0x321193=0xc8;}else{_0x321193=0xce;}_0x578819['status'](_0x321193);return _0x578819[_0x640e('0x1e')](_0x640e('0x1f'),_0x90465d+'-'+_0x2912c0+'/'+_0x3d2da7)[_0x640e('0x20')](_0x132699);}return null;};}function patchUpdates(_0x5ae6e5){return function(_0x135edd){try{jsonpatch[_0x640e('0x21')](_0x135edd,_0x5ae6e5,!![]);}catch(_0x447d3f){return BPromise[_0x640e('0x22')](_0x447d3f);}return _0x135edd[_0x640e('0x23')]();};}function saveUpdates(_0x4cab37,_0x30bced){return function(_0x58d3ed){if(_0x58d3ed){return _0x58d3ed[_0x640e('0x24')](_0x4cab37)[_0x640e('0x25')](function(_0x38fedb){return _0x38fedb;});}return null;};}function removeEntity(_0x4c5eb7,_0x26e497){return function(_0x33aa51){if(_0x33aa51){return _0x33aa51[_0x640e('0x26')]()[_0x640e('0x25')](function(){_0x4c5eb7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59ed3d,_0xfa4de9){return function(_0x5a4323){if(!_0x5a4323){_0x59ed3d[_0x640e('0x17')](0x194);}return _0x5a4323;};}function handleError(_0x27bb7a,_0x4839e8){_0x4839e8=_0x4839e8||0x1f4;return function(_0x2d026a){logger[_0x640e('0x27')](_0x2d026a['stack']);if(_0x2d026a[_0x640e('0x28')]){delete _0x2d026a[_0x640e('0x28')];}_0x27bb7a['status'](_0x4839e8)[_0x640e('0x29')](_0x2d026a);};}exports[_0x640e('0x2a')]=function(_0x3fd9e7,_0x59d046){var _0x5a6bb3={},_0x46fc98={},_0x54a34c={'count':0x0,'rows':[]};var _0x1b0a2c=_[_0x640e('0x2b')](db['MailServerOut'][_0x640e('0x2c')],function(_0x9d5b54){return{'name':_0x9d5b54['fieldName'],'type':_0x9d5b54[_0x640e('0x2d')][_0x640e('0x2e')]};});_0x46fc98['model']=_[_0x640e('0x2b')](_0x1b0a2c,_0x640e('0x28'));_0x46fc98['query']=_[_0x640e('0x2f')](_0x3fd9e7[_0x640e('0x30')]);_0x46fc98[_0x640e('0x31')]=_[_0x640e('0x32')](_0x46fc98[_0x640e('0x33')],_0x46fc98[_0x640e('0x30')]);_0x5a6bb3[_0x640e('0x34')]=_[_0x640e('0x32')](_0x46fc98[_0x640e('0x33')],qs[_0x640e('0x35')](_0x3fd9e7[_0x640e('0x30')]['fields']));_0x5a6bb3['attributes']=_0x5a6bb3[_0x640e('0x34')][_0x640e('0x36')]?_0x5a6bb3[_0x640e('0x34')]:_0x46fc98['model'];if(!_0x3fd9e7[_0x640e('0x30')][_0x640e('0x37')](_0x640e('0x38'))){_0x5a6bb3[_0x640e('0x1c')]=qs['limit'](_0x3fd9e7[_0x640e('0x30')][_0x640e('0x1c')]);_0x5a6bb3[_0x640e('0x1a')]=qs[_0x640e('0x1a')](_0x3fd9e7[_0x640e('0x30')]['offset']);}_0x5a6bb3[_0x640e('0x39')]=qs[_0x640e('0x3a')](_0x3fd9e7[_0x640e('0x30')][_0x640e('0x3a')]);_0x5a6bb3[_0x640e('0x3b')]=qs[_0x640e('0x31')](_[_0x640e('0x3c')](_0x3fd9e7[_0x640e('0x30')],_0x46fc98[_0x640e('0x31')]),_0x1b0a2c);if(_0x3fd9e7[_0x640e('0x30')]['filter']){_0x5a6bb3['where']=_[_0x640e('0x3d')](_0x5a6bb3['where'],{'$or':_[_0x640e('0x2b')](_0x1b0a2c,function(_0x19b045){if(_0x19b045[_0x640e('0x2d')]!=='VIRTUAL'){var _0x18ba95={};_0x18ba95[_0x19b045[_0x640e('0x28')]]={'$like':'%'+_0x3fd9e7[_0x640e('0x30')][_0x640e('0x3e')]+'%'};return _0x18ba95;}})});}_0x5a6bb3=_[_0x640e('0x3d')]({},_0x5a6bb3,_0x3fd9e7['options']);var _0x3b1838={'where':_0x5a6bb3[_0x640e('0x3b')]};return db[_0x640e('0x3f')][_0x640e('0x1d')](_0x3b1838)['then'](function(_0x397b1f){_0x54a34c['count']=_0x397b1f;if(_0x3fd9e7[_0x640e('0x30')][_0x640e('0x40')]){_0x5a6bb3[_0x640e('0x41')]=[{'all':!![]}];}return db[_0x640e('0x3f')][_0x640e('0x42')](_0x5a6bb3);})['then'](function(_0x5c34eb){_0x54a34c[_0x640e('0x43')]=_0x5c34eb;return _0x54a34c;})[_0x640e('0x25')](respondWithFilteredResult(_0x59d046,_0x5a6bb3))[_0x640e('0x44')](handleError(_0x59d046,null));};exports[_0x640e('0x45')]=function(_0x53f95e,_0x269caa){var _0x6b412={'raw':!![],'where':{'id':_0x53f95e[_0x640e('0x46')]['id']}},_0x5dacf7={};_0x5dacf7[_0x640e('0x33')]=_[_0x640e('0x2f')](db[_0x640e('0x3f')][_0x640e('0x2c')]);_0x5dacf7['query']=_[_0x640e('0x2f')](_0x53f95e['query']);_0x5dacf7['filters']=_['intersection'](_0x5dacf7[_0x640e('0x33')],_0x5dacf7[_0x640e('0x30')]);_0x6b412['attributes']=_[_0x640e('0x32')](_0x5dacf7['model'],qs['fields'](_0x53f95e['query'][_0x640e('0x35')]));_0x6b412[_0x640e('0x34')]=_0x6b412[_0x640e('0x34')][_0x640e('0x36')]?_0x6b412[_0x640e('0x34')]:_0x5dacf7['model'];if(_0x53f95e[_0x640e('0x30')]['includeAll']){_0x6b412['include']=[{'all':!![]}];}_0x6b412=_['merge']({},_0x6b412,_0x53f95e[_0x640e('0x47')]);return db[_0x640e('0x3f')][_0x640e('0x48')](_0x6b412)[_0x640e('0x25')](handleEntityNotFound(_0x269caa,null))[_0x640e('0x25')](respondWithResult(_0x269caa,null))[_0x640e('0x44')](handleError(_0x269caa,null));};exports[_0x640e('0x49')]=function(_0x47498b,_0x52fff6){return db[_0x640e('0x3f')][_0x640e('0x49')](_0x47498b[_0x640e('0x4a')],{})['then'](respondWithResult(_0x52fff6,0xc9))[_0x640e('0x44')](handleError(_0x52fff6,null));};exports[_0x640e('0x24')]=function(_0x39bacb,_0x425c8c){if(_0x39bacb[_0x640e('0x4a')]['id']){delete _0x39bacb['body']['id'];}return db['MailServerOut'][_0x640e('0x48')]({'where':{'id':_0x39bacb[_0x640e('0x46')]['id']}})[_0x640e('0x25')](handleEntityNotFound(_0x425c8c,null))['then'](saveUpdates(_0x39bacb[_0x640e('0x4a')],null))['then'](respondWithResult(_0x425c8c,null))['catch'](handleError(_0x425c8c,null));};exports[_0x640e('0x26')]=function(_0x3a1f53,_0x5bcc1a){return db['MailServerOut'][_0x640e('0x48')]({'where':{'id':_0x3a1f53[_0x640e('0x46')]['id']}})[_0x640e('0x25')](handleEntityNotFound(_0x5bcc1a,null))[_0x640e('0x25')](removeEntity(_0x5bcc1a,null))[_0x640e('0x44')](handleError(_0x5bcc1a,null));}; \ No newline at end of file +var _0x2485=['index','map','MailServerOut','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','end','error'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x2485,0x70));var _0x5248=function(_0x53bf29,_0x1d05f1){_0x53bf29=_0x53bf29-0x0;var _0xd7eecd=_0x2485[_0x53bf29];return _0xd7eecd;};'use strict';var emlformat=require(_0x5248('0x0'));var rimraf=require(_0x5248('0x1'));var zipdir=require(_0x5248('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5248('0x3'));var moment=require(_0x5248('0x4'));var BPromise=require(_0x5248('0x5'));var Mustache=require(_0x5248('0x6'));var util=require(_0x5248('0x7'));var path=require('path');var sox=require(_0x5248('0x8'));var csv=require(_0x5248('0x9'));var ejs=require(_0x5248('0xa'));var fs=require('fs');var fs_extra=require(_0x5248('0xb'));var _=require(_0x5248('0xc'));var squel=require(_0x5248('0xd'));var crypto=require(_0x5248('0xe'));var jsforce=require(_0x5248('0xf'));var deskjs=require(_0x5248('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5248('0x11'));var Papa=require(_0x5248('0x12'));var Redis=require(_0x5248('0x13'));var authService=require(_0x5248('0x14'));var qs=require(_0x5248('0x15'));var as=require(_0x5248('0x16'));var hardwareService=require(_0x5248('0x17'));var logger=require(_0x5248('0x18'))(_0x5248('0x19'));var utils=require(_0x5248('0x1a'));var config=require(_0x5248('0x1b'));var licenseUtil=require(_0x5248('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360291,_0x40911){_0x40911=_0x40911||0xcc;return function(_0x335a68){if(_0x335a68){return _0x360291[_0x5248('0x1d')](_0x40911);}return _0x360291['status'](_0x40911)['end']();};}function respondWithResult(_0x6e90c0,_0x28307b){_0x28307b=_0x28307b||0xc8;return function(_0x115382){if(_0x115382){return _0x6e90c0['status'](_0x28307b)[_0x5248('0x1e')](_0x115382);}};}function respondWithFilteredResult(_0x18e35c,_0x324232){return function(_0x274322){if(_0x274322){var _0x43e020=typeof _0x324232[_0x5248('0x1f')]===_0x5248('0x20')&&typeof _0x324232[_0x5248('0x21')]===_0x5248('0x20');var _0xde3b9d=_0x274322[_0x5248('0x22')];var _0x2d2a51=_0x43e020?0x0:_0x324232[_0x5248('0x1f')];var _0x3f291a=_0x43e020?_0x274322[_0x5248('0x22')]:_0x324232[_0x5248('0x1f')]+_0x324232[_0x5248('0x21')];var _0x3fd435;if(_0x3f291a>=_0xde3b9d){_0x3f291a=_0xde3b9d;_0x3fd435=0xc8;}else{_0x3fd435=0xce;}_0x18e35c[_0x5248('0x23')](_0x3fd435);return _0x18e35c[_0x5248('0x24')]('Content-Range',_0x2d2a51+'-'+_0x3f291a+'/'+_0xde3b9d)[_0x5248('0x1e')](_0x274322);}return null;};}function patchUpdates(_0x41195e){return function(_0x10520e){try{jsonpatch[_0x5248('0x25')](_0x10520e,_0x41195e,!![]);}catch(_0x4162ac){return BPromise['reject'](_0x4162ac);}return _0x10520e[_0x5248('0x26')]();};}function saveUpdates(_0x5e0d64,_0x4df722){return function(_0x28ccd8){if(_0x28ccd8){return _0x28ccd8[_0x5248('0x27')](_0x5e0d64)[_0x5248('0x28')](function(_0x113d46){return _0x113d46;});}return null;};}function removeEntity(_0x17314b,_0x86ec03){return function(_0x1d422f){if(_0x1d422f){return _0x1d422f[_0x5248('0x29')]()[_0x5248('0x28')](function(){_0x17314b['status'](0xcc)[_0x5248('0x2a')]();});}};}function handleEntityNotFound(_0x232a64,_0x382fe1){return function(_0x21c3d8){if(!_0x21c3d8){_0x232a64['sendStatus'](0x194);}return _0x21c3d8;};}function handleError(_0x48c2c4,_0x4e68e2){_0x4e68e2=_0x4e68e2||0x1f4;return function(_0x950ddb){logger[_0x5248('0x2b')](_0x950ddb['stack']);if(_0x950ddb['name']){delete _0x950ddb['name'];}_0x48c2c4['status'](_0x4e68e2)['send'](_0x950ddb);};}exports[_0x5248('0x2c')]=function(_0x215699,_0x3a43a6){var _0x468344={},_0x1c79d8={},_0x2af31a={'count':0x0,'rows':[]};var _0x41a47b=_[_0x5248('0x2d')](db[_0x5248('0x2e')][_0x5248('0x2f')],function(_0x13c823){return{'name':_0x13c823[_0x5248('0x30')],'type':_0x13c823[_0x5248('0x31')]['key']};});_0x1c79d8[_0x5248('0x32')]=_[_0x5248('0x2d')](_0x41a47b,_0x5248('0x33'));_0x1c79d8[_0x5248('0x34')]=_[_0x5248('0x35')](_0x215699[_0x5248('0x34')]);_0x1c79d8[_0x5248('0x36')]=_[_0x5248('0x37')](_0x1c79d8[_0x5248('0x32')],_0x1c79d8[_0x5248('0x34')]);_0x468344['attributes']=_[_0x5248('0x37')](_0x1c79d8['model'],qs['fields'](_0x215699[_0x5248('0x34')][_0x5248('0x38')]));_0x468344[_0x5248('0x39')]=_0x468344['attributes']['length']?_0x468344[_0x5248('0x39')]:_0x1c79d8['model'];if(!_0x215699[_0x5248('0x34')]['hasOwnProperty'](_0x5248('0x3a'))){_0x468344[_0x5248('0x21')]=qs[_0x5248('0x21')](_0x215699[_0x5248('0x34')]['limit']);_0x468344[_0x5248('0x1f')]=qs[_0x5248('0x1f')](_0x215699[_0x5248('0x34')][_0x5248('0x1f')]);}_0x468344[_0x5248('0x3b')]=qs[_0x5248('0x3c')](_0x215699[_0x5248('0x34')]['sort']);_0x468344[_0x5248('0x3d')]=qs[_0x5248('0x36')](_[_0x5248('0x3e')](_0x215699[_0x5248('0x34')],_0x1c79d8[_0x5248('0x36')]),_0x41a47b);if(_0x215699['query']['filter']){_0x468344[_0x5248('0x3d')]=_[_0x5248('0x3f')](_0x468344[_0x5248('0x3d')],{'$or':_[_0x5248('0x2d')](_0x41a47b,function(_0x4d54c5){if(_0x4d54c5[_0x5248('0x31')]!==_0x5248('0x40')){var _0x434c5d={};_0x434c5d[_0x4d54c5[_0x5248('0x33')]]={'$like':'%'+_0x215699[_0x5248('0x34')][_0x5248('0x41')]+'%'};return _0x434c5d;}})});}_0x468344=_[_0x5248('0x3f')]({},_0x468344,_0x215699['options']);var _0x283135={'where':_0x468344[_0x5248('0x3d')]};return db[_0x5248('0x2e')][_0x5248('0x22')](_0x283135)[_0x5248('0x28')](function(_0x3fd0ee){_0x2af31a[_0x5248('0x22')]=_0x3fd0ee;if(_0x215699['query'][_0x5248('0x42')]){_0x468344[_0x5248('0x43')]=[{'all':!![]}];}return db[_0x5248('0x2e')][_0x5248('0x44')](_0x468344);})[_0x5248('0x28')](function(_0x29b1d5){_0x2af31a[_0x5248('0x45')]=_0x29b1d5;return _0x2af31a;})['then'](respondWithFilteredResult(_0x3a43a6,_0x468344))['catch'](handleError(_0x3a43a6,null));};exports[_0x5248('0x46')]=function(_0x562c40,_0x302672){var _0x54c94d={'raw':!![],'where':{'id':_0x562c40[_0x5248('0x47')]['id']}},_0x1a67a5={};_0x1a67a5[_0x5248('0x32')]=_[_0x5248('0x35')](db[_0x5248('0x2e')][_0x5248('0x2f')]);_0x1a67a5[_0x5248('0x34')]=_['keys'](_0x562c40[_0x5248('0x34')]);_0x1a67a5[_0x5248('0x36')]=_[_0x5248('0x37')](_0x1a67a5[_0x5248('0x32')],_0x1a67a5[_0x5248('0x34')]);_0x54c94d[_0x5248('0x39')]=_[_0x5248('0x37')](_0x1a67a5[_0x5248('0x32')],qs[_0x5248('0x38')](_0x562c40[_0x5248('0x34')][_0x5248('0x38')]));_0x54c94d['attributes']=_0x54c94d[_0x5248('0x39')][_0x5248('0x48')]?_0x54c94d[_0x5248('0x39')]:_0x1a67a5[_0x5248('0x32')];if(_0x562c40[_0x5248('0x34')][_0x5248('0x42')]){_0x54c94d['include']=[{'all':!![]}];}_0x54c94d=_['merge']({},_0x54c94d,_0x562c40[_0x5248('0x49')]);return db['MailServerOut'][_0x5248('0x4a')](_0x54c94d)[_0x5248('0x28')](handleEntityNotFound(_0x302672,null))[_0x5248('0x28')](respondWithResult(_0x302672,null))[_0x5248('0x4b')](handleError(_0x302672,null));};exports[_0x5248('0x4c')]=function(_0x1677e5,_0x157035){return db[_0x5248('0x2e')]['create'](_0x1677e5[_0x5248('0x4d')],{})[_0x5248('0x28')](respondWithResult(_0x157035,0xc9))['catch'](handleError(_0x157035,null));};exports['update']=function(_0x581d74,_0x1ae3c4){if(_0x581d74['body']['id']){delete _0x581d74['body']['id'];}return db[_0x5248('0x2e')][_0x5248('0x4a')]({'where':{'id':_0x581d74['params']['id']}})[_0x5248('0x28')](handleEntityNotFound(_0x1ae3c4,null))[_0x5248('0x28')](saveUpdates(_0x581d74[_0x5248('0x4d')],null))['then'](respondWithResult(_0x1ae3c4,null))[_0x5248('0x4b')](handleError(_0x1ae3c4,null));};exports[_0x5248('0x29')]=function(_0xd97941,_0x211aa8){return db['MailServerOut'][_0x5248('0x4a')]({'where':{'id':_0xd97941[_0x5248('0x47')]['id']}})[_0x5248('0x28')](handleEntityNotFound(_0x211aa8,null))[_0x5248('0x28')](removeEntity(_0x211aa8,null))[_0x5248('0x4b')](handleError(_0x211aa8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 856a7a6..c1a3993 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 _0x7611=['./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3934ae,_0x44267d){var _0x5b74c9=function(_0x381fe7){while(--_0x381fe7){_0x3934ae['push'](_0x3934ae['shift']());}};_0x5b74c9(++_0x44267d);}(_0x7611,0x1d2));var _0x1761=function(_0xa79465,_0x427a98){_0xa79465=_0xa79465-0x0;var _0x27295d=_0x7611[_0xa79465];return _0x27295d;};'use strict';var _=require('lodash');var util=require(_0x1761('0x0'));var logger=require(_0x1761('0x1'))(_0x1761('0x2'));var moment=require(_0x1761('0x3'));var BPromise=require(_0x1761('0x4'));var rp=require(_0x1761('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1761('0x6'));var attributes=require(_0x1761('0x7'));module['exports']=function(_0x2de326,_0x392ac0){return _0x2de326[_0x1761('0x8')](_0x1761('0x9'),attributes,{'tableName':_0x1761('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1da=['path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','api','bluebird'];(function(_0x1ecfc8,_0x39ea27){var _0x7b6b6c=function(_0x344974){while(--_0x344974){_0x1ecfc8['push'](_0x1ecfc8['shift']());}};_0x7b6b6c(++_0x39ea27);}(_0xc1da,0x119));var _0xac1d=function(_0x511291,_0x52d364){_0x511291=_0x511291-0x0;var _0x4289bb=_0xc1da[_0x511291];return _0x4289bb;};'use strict';var _=require(_0xac1d('0x0'));var util=require(_0xac1d('0x1'));var logger=require(_0xac1d('0x2'))(_0xac1d('0x3'));var moment=require('moment');var BPromise=require(_0xac1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac1d('0x5'));var rimraf=require(_0xac1d('0x6'));var config=require(_0xac1d('0x7'));var attributes=require(_0xac1d('0x8'));module[_0xac1d('0x9')]=function(_0x3d3b04,_0x44ddd2){return _0x3d3b04['define'](_0xac1d('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 8a4e922..fb9d30b 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2e3846,_0x3249f5){var _0x4565d2=function(_0x5be3e6){while(--_0x5be3e6){_0x2e3846['push'](_0x2e3846['shift']());}};_0x4565d2(++_0x3249f5);}(_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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x101b52,_0x33df15){_0x101b52=_0x101b52-0x0;var _0x12ee62=_0x7a54[_0x101b52];return _0x12ee62;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 8c1e788..bda7c47 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 _0xc8c6=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','show','post'];(function(_0x5e14a6,_0x7e2a85){var _0x5ab516=function(_0x23c420){while(--_0x23c420){_0x5e14a6['push'](_0x5e14a6['shift']());}};_0x5ab516(++_0x7e2a85);}(_0xc8c6,0x91));var _0x6c8c=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0xc8c6[_0x26cd05];return _0x3e13b9;};'use strict';var multer=require(_0x6c8c('0x0'));var util=require(_0x6c8c('0x1'));var path=require(_0x6c8c('0x2'));var timeout=require(_0x6c8c('0x3'));var express=require(_0x6c8c('0x4'));var router=express[_0x6c8c('0x5')]();var fs_extra=require(_0x6c8c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6c8c('0x7'));var config=require(_0x6c8c('0x8'));var controller=require(_0x6c8c('0x9'));router['get']('/',auth[_0x6c8c('0xa')](),controller[_0x6c8c('0xb')]);router[_0x6c8c('0xc')](_0x6c8c('0xd'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6c8c('0xa')](),controller[_0x6c8c('0xe')]);router[_0x6c8c('0xf')]('/',auth['isAuthenticated'](),controller[_0x6c8c('0x10')]);router[_0x6c8c('0x11')](_0x6c8c('0x12'),auth[_0x6c8c('0xa')](),controller[_0x6c8c('0x13')]);router[_0x6c8c('0x14')](_0x6c8c('0x12'),auth[_0x6c8c('0xa')](),controller[_0x6c8c('0x15')]);module[_0x6c8c('0x16')]=router; \ No newline at end of file +var _0xb49c=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb49c,0x12d));var _0xcb49=function(_0x3d7342,_0x2e1bc2){_0x3d7342=_0x3d7342-0x0;var _0x3de5a1=_0xb49c[_0x3d7342];return _0x3de5a1;};'use strict';var multer=require(_0xcb49('0x0'));var util=require(_0xcb49('0x1'));var path=require(_0xcb49('0x2'));var timeout=require(_0xcb49('0x3'));var express=require('express');var router=express[_0xcb49('0x4')]();var fs_extra=require(_0xcb49('0x5'));var auth=require(_0xcb49('0x6'));var interaction=require(_0xcb49('0x7'));var config=require(_0xcb49('0x8'));var controller=require(_0xcb49('0x9'));router[_0xcb49('0xa')]('/',auth['isAuthenticated'](),controller[_0xcb49('0xb')]);router[_0xcb49('0xa')](_0xcb49('0xc'),auth[_0xcb49('0xd')](),controller[_0xcb49('0xe')]);router['get'](_0xcb49('0xf'),auth['isAuthenticated'](),controller[_0xcb49('0x10')]);router[_0xcb49('0x11')]('/',auth['isAuthenticated'](),controller[_0xcb49('0x12')]);router[_0xcb49('0x13')](_0xcb49('0xf'),auth[_0xcb49('0xd')](),controller[_0xcb49('0x14')]);router['delete']('/:id',auth[_0xcb49('0xd')](),controller[_0xcb49('0x15')]);module[_0xcb49('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 84f2bab..bf65d9f 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 _0xf69d=['exports','STRING','name','sequelize'];(function(_0x229e01,_0x75d644){var _0x160115=function(_0x4772dc){while(--_0x4772dc){_0x229e01['push'](_0x229e01['shift']());}};_0x160115(++_0x75d644);}(_0xf69d,0xd3));var _0xdf69=function(_0x273836,_0x5afb92){_0x273836=_0x273836-0x0;var _0x364ac0=_0xf69d[_0x273836];return _0x364ac0;};'use strict';var Sequelize=require(_0xdf69('0x0'));module[_0xdf69('0x1')]={'name':{'type':Sequelize[_0xdf69('0x2')],'unique':_0xdf69('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdf69('0x2')]}}; \ No newline at end of file +var _0x85d0=['STRING'];(function(_0x2bfb0b,_0x4c6d1e){var _0x4e9063=function(_0x500deb){while(--_0x500deb){_0x2bfb0b['push'](_0x2bfb0b['shift']());}};_0x4e9063(++_0x4c6d1e);}(_0x85d0,0x164));var _0x085d=function(_0x30bc71,_0x4f5162){_0x30bc71=_0x30bc71-0x0;var _0x169d68=_0x85d0[_0x30bc71];return _0x169d68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x085d('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 86250a7..344e4bd 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 _0x3640=['where','pick','filters','filter','VIRTUAL','merge','options','MailSubstatus','count','includeAll','findAll','then','rows','show','params','rawAttributes','length','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','error','stack','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x307d5c,_0x789ca7){var _0x4b3211=function(_0x10bd6b){while(--_0x10bd6b){_0x307d5c['push'](_0x307d5c['shift']());}};_0x4b3211(++_0x789ca7);}(_0x3640,0x67));var _0x0364=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x3640[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x0364('0x0'));var rimraf=require(_0x0364('0x1'));var zipdir=require(_0x0364('0x2'));var jsonpatch=require(_0x0364('0x3'));var rp=require('request-promise');var moment=require(_0x0364('0x4'));var BPromise=require(_0x0364('0x5'));var Mustache=require(_0x0364('0x6'));var util=require(_0x0364('0x7'));var path=require(_0x0364('0x8'));var sox=require(_0x0364('0x9'));var csv=require(_0x0364('0xa'));var ejs=require(_0x0364('0xb'));var fs=require('fs');var fs_extra=require(_0x0364('0xc'));var _=require(_0x0364('0xd'));var squel=require(_0x0364('0xe'));var crypto=require(_0x0364('0xf'));var jsforce=require(_0x0364('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0364('0xa'));var querystring=require(_0x0364('0x11'));var Papa=require(_0x0364('0x12'));var Redis=require(_0x0364('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0364('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0364('0x15'));var logger=require(_0x0364('0x16'))(_0x0364('0x17'));var utils=require(_0x0364('0x18'));var config=require(_0x0364('0x19'));var licenseUtil=require(_0x0364('0x1a'));var db=require(_0x0364('0x1b'))['db'];function respondWithStatusCode(_0x41932f,_0x455201){_0x455201=_0x455201||0xcc;return function(_0x1250b2){if(_0x1250b2){return _0x41932f[_0x0364('0x1c')](_0x455201);}return _0x41932f[_0x0364('0x1d')](_0x455201)[_0x0364('0x1e')]();};}function respondWithResult(_0x9821ac,_0x7e003e){_0x7e003e=_0x7e003e||0xc8;return function(_0x1be459){if(_0x1be459){return _0x9821ac[_0x0364('0x1d')](_0x7e003e)[_0x0364('0x1f')](_0x1be459);}};}function respondWithFilteredResult(_0x4ba3ce,_0x2dcb9b){return function(_0x52475e){if(_0x52475e){var _0x4d2085=typeof _0x2dcb9b[_0x0364('0x20')]===_0x0364('0x21')&&typeof _0x2dcb9b[_0x0364('0x22')]===_0x0364('0x21');var _0xc33c15=_0x52475e['count'];var _0x32a27f=_0x4d2085?0x0:_0x2dcb9b[_0x0364('0x20')];var _0x337ec0=_0x4d2085?_0x52475e['count']:_0x2dcb9b[_0x0364('0x20')]+_0x2dcb9b[_0x0364('0x22')];var _0x311c5c;if(_0x337ec0>=_0xc33c15){_0x337ec0=_0xc33c15;_0x311c5c=0xc8;}else{_0x311c5c=0xce;}_0x4ba3ce['status'](_0x311c5c);return _0x4ba3ce['set'](_0x0364('0x23'),_0x32a27f+'-'+_0x337ec0+'/'+_0xc33c15)[_0x0364('0x1f')](_0x52475e);}return null;};}function patchUpdates(_0x4d453e){return function(_0xe2a5cf){try{jsonpatch[_0x0364('0x24')](_0xe2a5cf,_0x4d453e,!![]);}catch(_0x4e6c72){return BPromise[_0x0364('0x25')](_0x4e6c72);}return _0xe2a5cf['save']();};}function saveUpdates(_0x3fe496,_0x4edc6e){return function(_0x2dcb53){if(_0x2dcb53){return _0x2dcb53[_0x0364('0x26')](_0x3fe496)['then'](function(_0x1c7c92){return _0x1c7c92;});}return null;};}function removeEntity(_0x547750,_0xddd715){return function(_0x3ee9d2){if(_0x3ee9d2){return _0x3ee9d2[_0x0364('0x27')]()['then'](function(){_0x547750[_0x0364('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e563,_0x2ecea8){return function(_0x3cbb85){if(!_0x3cbb85){_0x26e563[_0x0364('0x1c')](0x194);}return _0x3cbb85;};}function handleError(_0x4f1282,_0x4d30bd){_0x4d30bd=_0x4d30bd||0x1f4;return function(_0x4d4421){logger[_0x0364('0x28')](_0x4d4421[_0x0364('0x29')]);if(_0x4d4421[_0x0364('0x2a')]){delete _0x4d4421[_0x0364('0x2a')];}_0x4f1282['status'](_0x4d30bd)[_0x0364('0x2b')](_0x4d4421);};}exports['index']=function(_0x515eda,_0x21fc6a){var _0x1d58c1={},_0x5c9ba6={},_0x369555={'count':0x0,'rows':[]};var _0xe9ec76=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x38f631){return{'name':_0x38f631[_0x0364('0x2c')],'type':_0x38f631[_0x0364('0x2d')][_0x0364('0x2e')]};});_0x5c9ba6[_0x0364('0x2f')]=_[_0x0364('0x30')](_0xe9ec76,_0x0364('0x2a'));_0x5c9ba6[_0x0364('0x31')]=_[_0x0364('0x32')](_0x515eda[_0x0364('0x31')]);_0x5c9ba6['filters']=_[_0x0364('0x33')](_0x5c9ba6[_0x0364('0x2f')],_0x5c9ba6['query']);_0x1d58c1[_0x0364('0x34')]=_[_0x0364('0x33')](_0x5c9ba6['model'],qs[_0x0364('0x35')](_0x515eda[_0x0364('0x31')][_0x0364('0x35')]));_0x1d58c1[_0x0364('0x34')]=_0x1d58c1[_0x0364('0x34')]['length']?_0x1d58c1['attributes']:_0x5c9ba6[_0x0364('0x2f')];if(!_0x515eda['query'][_0x0364('0x36')](_0x0364('0x37'))){_0x1d58c1['limit']=qs['limit'](_0x515eda[_0x0364('0x31')][_0x0364('0x22')]);_0x1d58c1[_0x0364('0x20')]=qs[_0x0364('0x20')](_0x515eda['query']['offset']);}_0x1d58c1['order']=qs[_0x0364('0x38')](_0x515eda[_0x0364('0x31')][_0x0364('0x38')]);_0x1d58c1[_0x0364('0x39')]=qs['filters'](_[_0x0364('0x3a')](_0x515eda[_0x0364('0x31')],_0x5c9ba6[_0x0364('0x3b')]),_0xe9ec76);if(_0x515eda[_0x0364('0x31')][_0x0364('0x3c')]){_0x1d58c1['where']=_['merge'](_0x1d58c1[_0x0364('0x39')],{'$or':_[_0x0364('0x30')](_0xe9ec76,function(_0x5dc4c5){if(_0x5dc4c5[_0x0364('0x2d')]!==_0x0364('0x3d')){var _0x450905={};_0x450905[_0x5dc4c5[_0x0364('0x2a')]]={'$like':'%'+_0x515eda[_0x0364('0x31')][_0x0364('0x3c')]+'%'};return _0x450905;}})});}_0x1d58c1=_[_0x0364('0x3e')]({},_0x1d58c1,_0x515eda[_0x0364('0x3f')]);var _0x5c263c={'where':_0x1d58c1[_0x0364('0x39')]};return db[_0x0364('0x40')][_0x0364('0x41')](_0x5c263c)['then'](function(_0x3da631){_0x369555['count']=_0x3da631;if(_0x515eda[_0x0364('0x31')][_0x0364('0x42')]){_0x1d58c1['include']=[{'all':!![]}];}return db[_0x0364('0x40')][_0x0364('0x43')](_0x1d58c1);})[_0x0364('0x44')](function(_0x37011a){_0x369555[_0x0364('0x45')]=_0x37011a;return _0x369555;})[_0x0364('0x44')](respondWithFilteredResult(_0x21fc6a,_0x1d58c1))['catch'](handleError(_0x21fc6a,null));};exports[_0x0364('0x46')]=function(_0x32aeeb,_0x5d09fd){var _0x33d562={'raw':!![],'where':{'id':_0x32aeeb[_0x0364('0x47')]['id']}},_0x4d8a3c={};_0x4d8a3c[_0x0364('0x2f')]=_[_0x0364('0x32')](db[_0x0364('0x40')][_0x0364('0x48')]);_0x4d8a3c[_0x0364('0x31')]=_[_0x0364('0x32')](_0x32aeeb['query']);_0x4d8a3c[_0x0364('0x3b')]=_[_0x0364('0x33')](_0x4d8a3c[_0x0364('0x2f')],_0x4d8a3c['query']);_0x33d562[_0x0364('0x34')]=_['intersection'](_0x4d8a3c[_0x0364('0x2f')],qs['fields'](_0x32aeeb[_0x0364('0x31')][_0x0364('0x35')]));_0x33d562['attributes']=_0x33d562[_0x0364('0x34')][_0x0364('0x49')]?_0x33d562[_0x0364('0x34')]:_0x4d8a3c[_0x0364('0x2f')];if(_0x32aeeb['query']['includeAll']){_0x33d562[_0x0364('0x4a')]=[{'all':!![]}];}_0x33d562=_[_0x0364('0x3e')]({},_0x33d562,_0x32aeeb['options']);return db[_0x0364('0x40')][_0x0364('0x4b')](_0x33d562)[_0x0364('0x44')](handleEntityNotFound(_0x5d09fd,null))[_0x0364('0x44')](respondWithResult(_0x5d09fd,null))[_0x0364('0x4c')](handleError(_0x5d09fd,null));};exports[_0x0364('0x4d')]=function(_0x1a9699,_0x434181){return db[_0x0364('0x40')][_0x0364('0x4d')](_0x1a9699[_0x0364('0x4e')],{})['then'](respondWithResult(_0x434181,0xc9))['catch'](handleError(_0x434181,null));};exports[_0x0364('0x26')]=function(_0x51a5cd,_0x1d3199){if(_0x51a5cd[_0x0364('0x4e')]['id']){delete _0x51a5cd[_0x0364('0x4e')]['id'];}return db[_0x0364('0x40')][_0x0364('0x4b')]({'where':{'id':_0x51a5cd[_0x0364('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d3199,null))[_0x0364('0x44')](saveUpdates(_0x51a5cd[_0x0364('0x4e')],null))['then'](respondWithResult(_0x1d3199,null))[_0x0364('0x4c')](handleError(_0x1d3199,null));};exports[_0x0364('0x27')]=function(_0x716c91,_0x54d4f2){return db[_0x0364('0x40')]['find']({'where':{'id':_0x716c91['params']['id']}})['then'](handleEntityNotFound(_0x54d4f2,null))[_0x0364('0x44')](removeEntity(_0x54d4f2,null))[_0x0364('0x4c')](handleError(_0x54d4f2,null));};exports[_0x0364('0x4f')]=function(_0x453cb9,_0x1b13f1){return db[_0x0364('0x40')][_0x0364('0x4f')]()[_0x0364('0x44')](respondWithResult(_0x1b13f1,null))['catch'](handleError(_0x1b13f1,null));}; \ No newline at end of file +var _0xf1ba=['sendStatus','error','stack','map','MailSubstatus','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','end'];(function(_0x9c62d6,_0x36db94){var _0x28164a=function(_0x4e84e7){while(--_0x4e84e7){_0x9c62d6['push'](_0x9c62d6['shift']());}};_0x28164a(++_0x36db94);}(_0xf1ba,0x148));var _0xaf1b=function(_0x132ec7,_0x5d05b4){_0x132ec7=_0x132ec7-0x0;var _0x30bddd=_0xf1ba[_0x132ec7];return _0x30bddd;};'use strict';var emlformat=require(_0xaf1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf1b('0x1'));var jsonpatch=require(_0xaf1b('0x2'));var rp=require(_0xaf1b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaf1b('0x4'));var util=require('util');var path=require(_0xaf1b('0x5'));var sox=require(_0xaf1b('0x6'));var csv=require(_0xaf1b('0x7'));var ejs=require(_0xaf1b('0x8'));var fs=require('fs');var fs_extra=require(_0xaf1b('0x9'));var _=require(_0xaf1b('0xa'));var squel=require(_0xaf1b('0xb'));var crypto=require('crypto');var jsforce=require(_0xaf1b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xaf1b('0x7'));var querystring=require(_0xaf1b('0xd'));var Papa=require(_0xaf1b('0xe'));var Redis=require(_0xaf1b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaf1b('0x10'));var as=require(_0xaf1b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf1b('0x12'))(_0xaf1b('0x13'));var utils=require(_0xaf1b('0x14'));var config=require(_0xaf1b('0x15'));var licenseUtil=require(_0xaf1b('0x16'));var db=require(_0xaf1b('0x17'))['db'];function respondWithStatusCode(_0x2ce1c0,_0x7f8939){_0x7f8939=_0x7f8939||0xcc;return function(_0x118b9b){if(_0x118b9b){return _0x2ce1c0['sendStatus'](_0x7f8939);}return _0x2ce1c0[_0xaf1b('0x18')](_0x7f8939)['end']();};}function respondWithResult(_0x159ceb,_0x42aca6){_0x42aca6=_0x42aca6||0xc8;return function(_0x5ce411){if(_0x5ce411){return _0x159ceb[_0xaf1b('0x18')](_0x42aca6)[_0xaf1b('0x19')](_0x5ce411);}};}function respondWithFilteredResult(_0x24bf81,_0x571b96){return function(_0x146994){if(_0x146994){var _0x2b0e23=typeof _0x571b96['offset']==='undefined'&&typeof _0x571b96[_0xaf1b('0x1a')]===_0xaf1b('0x1b');var _0x4bb1b3=_0x146994[_0xaf1b('0x1c')];var _0x15e270=_0x2b0e23?0x0:_0x571b96[_0xaf1b('0x1d')];var _0x5997f8=_0x2b0e23?_0x146994[_0xaf1b('0x1c')]:_0x571b96[_0xaf1b('0x1d')]+_0x571b96[_0xaf1b('0x1a')];var _0x252070;if(_0x5997f8>=_0x4bb1b3){_0x5997f8=_0x4bb1b3;_0x252070=0xc8;}else{_0x252070=0xce;}_0x24bf81[_0xaf1b('0x18')](_0x252070);return _0x24bf81[_0xaf1b('0x1e')](_0xaf1b('0x1f'),_0x15e270+'-'+_0x5997f8+'/'+_0x4bb1b3)[_0xaf1b('0x19')](_0x146994);}return null;};}function patchUpdates(_0x5afe83){return function(_0x402992){try{jsonpatch[_0xaf1b('0x20')](_0x402992,_0x5afe83,!![]);}catch(_0x34ac5){return BPromise['reject'](_0x34ac5);}return _0x402992['save']();};}function saveUpdates(_0x47f04b,_0x4a7e18){return function(_0x5026f6){if(_0x5026f6){return _0x5026f6[_0xaf1b('0x21')](_0x47f04b)[_0xaf1b('0x22')](function(_0x55dab5){return _0x55dab5;});}return null;};}function removeEntity(_0x4715e6,_0x5d44bd){return function(_0x1f993d){if(_0x1f993d){return _0x1f993d[_0xaf1b('0x23')]()['then'](function(){_0x4715e6[_0xaf1b('0x18')](0xcc)[_0xaf1b('0x24')]();});}};}function handleEntityNotFound(_0x298e69,_0x267a6b){return function(_0x569247){if(!_0x569247){_0x298e69[_0xaf1b('0x25')](0x194);}return _0x569247;};}function handleError(_0x1b1e19,_0x4f1413){_0x4f1413=_0x4f1413||0x1f4;return function(_0x314e65){logger[_0xaf1b('0x26')](_0x314e65[_0xaf1b('0x27')]);if(_0x314e65['name']){delete _0x314e65['name'];}_0x1b1e19[_0xaf1b('0x18')](_0x4f1413)['send'](_0x314e65);};}exports['index']=function(_0xac0079,_0x56cebb){var _0x4591e7={},_0x520ac0={},_0x11b02a={'count':0x0,'rows':[]};var _0x49c5fe=_[_0xaf1b('0x28')](db[_0xaf1b('0x29')][_0xaf1b('0x2a')],function(_0x4f4a69){return{'name':_0x4f4a69[_0xaf1b('0x2b')],'type':_0x4f4a69[_0xaf1b('0x2c')][_0xaf1b('0x2d')]};});_0x520ac0['model']=_[_0xaf1b('0x28')](_0x49c5fe,_0xaf1b('0x2e'));_0x520ac0[_0xaf1b('0x2f')]=_[_0xaf1b('0x30')](_0xac0079[_0xaf1b('0x2f')]);_0x520ac0[_0xaf1b('0x31')]=_[_0xaf1b('0x32')](_0x520ac0[_0xaf1b('0x33')],_0x520ac0[_0xaf1b('0x2f')]);_0x4591e7[_0xaf1b('0x34')]=_[_0xaf1b('0x32')](_0x520ac0['model'],qs[_0xaf1b('0x35')](_0xac0079[_0xaf1b('0x2f')][_0xaf1b('0x35')]));_0x4591e7['attributes']=_0x4591e7[_0xaf1b('0x34')]['length']?_0x4591e7[_0xaf1b('0x34')]:_0x520ac0[_0xaf1b('0x33')];if(!_0xac0079[_0xaf1b('0x2f')]['hasOwnProperty'](_0xaf1b('0x36'))){_0x4591e7['limit']=qs[_0xaf1b('0x1a')](_0xac0079[_0xaf1b('0x2f')][_0xaf1b('0x1a')]);_0x4591e7['offset']=qs['offset'](_0xac0079[_0xaf1b('0x2f')][_0xaf1b('0x1d')]);}_0x4591e7[_0xaf1b('0x37')]=qs['sort'](_0xac0079[_0xaf1b('0x2f')][_0xaf1b('0x38')]);_0x4591e7[_0xaf1b('0x39')]=qs[_0xaf1b('0x31')](_[_0xaf1b('0x3a')](_0xac0079[_0xaf1b('0x2f')],_0x520ac0[_0xaf1b('0x31')]),_0x49c5fe);if(_0xac0079['query'][_0xaf1b('0x3b')]){_0x4591e7[_0xaf1b('0x39')]=_[_0xaf1b('0x3c')](_0x4591e7['where'],{'$or':_['map'](_0x49c5fe,function(_0x15aa30){if(_0x15aa30[_0xaf1b('0x2c')]!==_0xaf1b('0x3d')){var _0x543f26={};_0x543f26[_0x15aa30['name']]={'$like':'%'+_0xac0079['query'][_0xaf1b('0x3b')]+'%'};return _0x543f26;}})});}_0x4591e7=_[_0xaf1b('0x3c')]({},_0x4591e7,_0xac0079['options']);var _0x9036cd={'where':_0x4591e7[_0xaf1b('0x39')]};return db[_0xaf1b('0x29')][_0xaf1b('0x1c')](_0x9036cd)[_0xaf1b('0x22')](function(_0x33cf48){_0x11b02a[_0xaf1b('0x1c')]=_0x33cf48;if(_0xac0079[_0xaf1b('0x2f')][_0xaf1b('0x3e')]){_0x4591e7[_0xaf1b('0x3f')]=[{'all':!![]}];}return db[_0xaf1b('0x29')][_0xaf1b('0x40')](_0x4591e7);})[_0xaf1b('0x22')](function(_0x2afdcb){_0x11b02a[_0xaf1b('0x41')]=_0x2afdcb;return _0x11b02a;})[_0xaf1b('0x22')](respondWithFilteredResult(_0x56cebb,_0x4591e7))[_0xaf1b('0x42')](handleError(_0x56cebb,null));};exports['show']=function(_0x3eb1fc,_0x37d85a){var _0x410ea9={'raw':!![],'where':{'id':_0x3eb1fc[_0xaf1b('0x43')]['id']}},_0x2671a9={};_0x2671a9[_0xaf1b('0x33')]=_[_0xaf1b('0x30')](db['MailSubstatus'][_0xaf1b('0x2a')]);_0x2671a9['query']=_[_0xaf1b('0x30')](_0x3eb1fc['query']);_0x2671a9[_0xaf1b('0x31')]=_[_0xaf1b('0x32')](_0x2671a9[_0xaf1b('0x33')],_0x2671a9[_0xaf1b('0x2f')]);_0x410ea9[_0xaf1b('0x34')]=_[_0xaf1b('0x32')](_0x2671a9[_0xaf1b('0x33')],qs[_0xaf1b('0x35')](_0x3eb1fc['query'][_0xaf1b('0x35')]));_0x410ea9[_0xaf1b('0x34')]=_0x410ea9[_0xaf1b('0x34')][_0xaf1b('0x44')]?_0x410ea9[_0xaf1b('0x34')]:_0x2671a9['model'];if(_0x3eb1fc['query'][_0xaf1b('0x3e')]){_0x410ea9[_0xaf1b('0x3f')]=[{'all':!![]}];}_0x410ea9=_['merge']({},_0x410ea9,_0x3eb1fc['options']);return db[_0xaf1b('0x29')][_0xaf1b('0x45')](_0x410ea9)[_0xaf1b('0x22')](handleEntityNotFound(_0x37d85a,null))['then'](respondWithResult(_0x37d85a,null))[_0xaf1b('0x42')](handleError(_0x37d85a,null));};exports[_0xaf1b('0x46')]=function(_0x936047,_0x57163e){return db[_0xaf1b('0x29')]['create'](_0x936047['body'],{})[_0xaf1b('0x22')](respondWithResult(_0x57163e,0xc9))[_0xaf1b('0x42')](handleError(_0x57163e,null));};exports[_0xaf1b('0x21')]=function(_0x198c68,_0xf0b5e2){if(_0x198c68[_0xaf1b('0x47')]['id']){delete _0x198c68[_0xaf1b('0x47')]['id'];}return db[_0xaf1b('0x29')][_0xaf1b('0x45')]({'where':{'id':_0x198c68[_0xaf1b('0x43')]['id']}})[_0xaf1b('0x22')](handleEntityNotFound(_0xf0b5e2,null))[_0xaf1b('0x22')](saveUpdates(_0x198c68[_0xaf1b('0x47')],null))[_0xaf1b('0x22')](respondWithResult(_0xf0b5e2,null))[_0xaf1b('0x42')](handleError(_0xf0b5e2,null));};exports[_0xaf1b('0x23')]=function(_0x4d7b6b,_0x2c35a7){return db[_0xaf1b('0x29')][_0xaf1b('0x45')]({'where':{'id':_0x4d7b6b[_0xaf1b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c35a7,null))[_0xaf1b('0x22')](removeEntity(_0x2c35a7,null))['catch'](handleError(_0x2c35a7,null));};exports[_0xaf1b('0x48')]=function(_0x431ba6,_0x256471){return db[_0xaf1b('0x29')]['describe']()['then'](respondWithResult(_0x256471,null))[_0xaf1b('0x42')](handleError(_0x256471,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 88fcfa0..337bea7 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 _0xeaf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','../../config/logger','api'];(function(_0x395718,_0x20322d){var _0x3028b8=function(_0x416f5c){while(--_0x416f5c){_0x395718['push'](_0x395718['shift']());}};_0x3028b8(++_0x20322d);}(_0xeaf0,0x98));var _0x0eaf=function(_0x5230ce,_0x405f0d){_0x5230ce=_0x5230ce-0x0;var _0x30197d=_0xeaf0[_0x5230ce];return _0x30197d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0eaf('0x0'))(_0x0eaf('0x1'));var moment=require(_0x0eaf('0x2'));var BPromise=require(_0x0eaf('0x3'));var rp=require(_0x0eaf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0eaf('0x5'));var config=require(_0x0eaf('0x6'));var attributes=require(_0x0eaf('0x7'));module[_0x0eaf('0x8')]=function(_0x5b4ab6,_0x47df27){return _0x5b4ab6[_0x0eaf('0x9')](_0x0eaf('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd42d=['define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./mailSubstatus.attributes'];(function(_0x5828e2,_0x728c78){var _0x4545c8=function(_0x3cb188){while(--_0x3cb188){_0x5828e2['push'](_0x5828e2['shift']());}};_0x4545c8(++_0x728c78);}(_0xd42d,0x71));var _0xdd42=function(_0x44d1b7,_0x4dc229){_0x44d1b7=_0x44d1b7-0x0;var _0x5a0e6a=_0xd42d[_0x44d1b7];return _0x5a0e6a;};'use strict';var _=require(_0xdd42('0x0'));var util=require(_0xdd42('0x1'));var logger=require(_0xdd42('0x2'))(_0xdd42('0x3'));var moment=require(_0xdd42('0x4'));var BPromise=require(_0xdd42('0x5'));var rp=require(_0xdd42('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd42('0x7'));module['exports']=function(_0x1bb643,_0xe2e4c7){return _0x1bb643[_0xdd42('0x8')](_0xdd42('0x9'),attributes,{'tableName':_0xdd42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9fb6a11..1f06f79 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 _0x52fa=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21d62f,_0x264bcd){var _0x13ee00=function(_0x19685d){while(--_0x19685d){_0x21d62f['push'](_0x21d62f['shift']());}};_0x13ee00(++_0x264bcd);}(_0x52fa,0x1b0));var _0xa52f=function(_0x54cbc0,_0x5a97ea){_0x54cbc0=_0x54cbc0-0x0;var _0x4bac24=_0x52fa[_0x54cbc0];return _0x4bac24;};'use strict';var _=require('lodash');var util=require(_0xa52f('0x0'));var moment=require(_0xa52f('0x1'));var BPromise=require(_0xa52f('0x2'));var rs=require(_0xa52f('0x3'));var fs=require('fs');var Redis=require(_0xa52f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa52f('0x5'));var logger=require(_0xa52f('0x6'))(_0xa52f('0x7'));var config=require(_0xa52f('0x8'));var jayson=require(_0xa52f('0x9'));var client=jayson[_0xa52f('0xa')][_0xa52f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x517bb9,_0x3b93f2,_0x7dbcb2){return new BPromise(function(_0x1d2a86,_0x184144){return client[_0xa52f('0xc')](_0x517bb9,_0x7dbcb2)[_0xa52f('0xd')](function(_0x292e31){logger[_0xa52f('0xe')](_0xa52f('0xf'),_0x3b93f2,_0xa52f('0x10'));logger[_0xa52f('0x11')](_0xa52f('0x12'),_0x3b93f2,_0xa52f('0x10'),JSON[_0xa52f('0x13')](_0x292e31));if(_0x292e31[_0xa52f('0x14')]){if(_0x292e31['error'][_0xa52f('0x15')]===0x1f4){logger['error'](_0xa52f('0xf'),_0x3b93f2,_0x292e31[_0xa52f('0x14')][_0xa52f('0x16')]);return _0x184144(_0x292e31['error'][_0xa52f('0x16')]);}logger[_0xa52f('0x14')](_0xa52f('0xf'),_0x3b93f2,_0x292e31[_0xa52f('0x14')][_0xa52f('0x16')]);return _0x1d2a86(_0x292e31['error']['message']);}else{logger[_0xa52f('0xe')](_0xa52f('0xf'),_0x3b93f2,_0xa52f('0x10'));_0x1d2a86(_0x292e31[_0xa52f('0x17')][_0xa52f('0x16')]);}})[_0xa52f('0x18')](function(_0x1ab1b6){logger[_0xa52f('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x3b93f2,_0x1ab1b6);_0x184144(_0x1ab1b6);});});} \ No newline at end of file +var _0x8e6b=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0x8e6b,0x112));var _0xb8e6=function(_0x1c4efd,_0xb0b73b){_0x1c4efd=_0x1c4efd-0x0;var _0x461474=_0x8e6b[_0x1c4efd];return _0x461474;};'use strict';var _=require(_0xb8e6('0x0'));var util=require(_0xb8e6('0x1'));var moment=require(_0xb8e6('0x2'));var BPromise=require(_0xb8e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8e6('0x5'))(_0xb8e6('0x6'));var config=require(_0xb8e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb8e6('0x8')][_0xb8e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295c20,_0x15c64d,_0x2d5d65){return new BPromise(function(_0x167096,_0x5a87d1){return client['request'](_0x295c20,_0x2d5d65)['then'](function(_0x4a768c){logger[_0xb8e6('0xa')](_0xb8e6('0xb'),_0x15c64d,'request\x20sent');logger[_0xb8e6('0xc')](_0xb8e6('0xd'),_0x15c64d,_0xb8e6('0xe'),JSON[_0xb8e6('0xf')](_0x4a768c));if(_0x4a768c[_0xb8e6('0x10')]){if(_0x4a768c[_0xb8e6('0x10')][_0xb8e6('0x11')]===0x1f4){logger[_0xb8e6('0x10')](_0xb8e6('0xb'),_0x15c64d,_0x4a768c[_0xb8e6('0x10')]['message']);return _0x5a87d1(_0x4a768c[_0xb8e6('0x10')][_0xb8e6('0x12')]);}logger[_0xb8e6('0x10')](_0xb8e6('0xb'),_0x15c64d,_0x4a768c[_0xb8e6('0x10')][_0xb8e6('0x12')]);return _0x167096(_0x4a768c[_0xb8e6('0x10')]['message']);}else{logger[_0xb8e6('0xa')](_0xb8e6('0xb'),_0x15c64d,_0xb8e6('0xe'));_0x167096(_0x4a768c[_0xb8e6('0x13')][_0xb8e6('0x12')]);}})[_0xb8e6('0x14')](function(_0x17a3c1){logger[_0xb8e6('0x10')](_0xb8e6('0xb'),_0x15c64d,_0x17a3c1);_0x5a87d1(_0x17a3c1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8ba7d47..f345c6a 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 _0xc99d=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update'];(function(_0x61b91f,_0x244d2a){var _0x2424bd=function(_0x3d0ede){while(--_0x3d0ede){_0x61b91f['push'](_0x61b91f['shift']());}};_0x2424bd(++_0x244d2a);}(_0xc99d,0x142));var _0xdc99=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xc99d[_0x75f869];return _0x10af8b;};'use strict';var multer=require('multer');var util=require(_0xdc99('0x0'));var path=require(_0xdc99('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc99('0x2'));var router=express[_0xdc99('0x3')]();var fs_extra=require(_0xdc99('0x4'));var auth=require(_0xdc99('0x5'));var interaction=require(_0xdc99('0x6'));var config=require(_0xdc99('0x7'));var controller=require(_0xdc99('0x8'));router['get']('/',auth[_0xdc99('0x9')](),controller[_0xdc99('0xa')]);router[_0xdc99('0xb')](_0xdc99('0xc'),auth['isAuthenticated'](),controller[_0xdc99('0xd')]);router[_0xdc99('0xb')](_0xdc99('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xdc99('0x9')](),controller[_0xdc99('0xf')]);router[_0xdc99('0x10')](_0xdc99('0xe'),auth[_0xdc99('0x9')](),controller[_0xdc99('0x11')]);router[_0xdc99('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xdc99('0x13')]);module['exports']=router; \ No newline at end of file +var _0x96de=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x96de,0x122));var _0xe96d=function(_0x1b511e,_0x58f205){_0x1b511e=_0x1b511e-0x0;var _0x193c41=_0x96de[_0x1b511e];return _0x193c41;};'use strict';var multer=require(_0xe96d('0x0'));var util=require('util');var path=require(_0xe96d('0x1'));var timeout=require('connect-timeout');var express=require(_0xe96d('0x2'));var router=express[_0xe96d('0x3')]();var fs_extra=require(_0xe96d('0x4'));var auth=require(_0xe96d('0x5'));var interaction=require(_0xe96d('0x6'));var config=require(_0xe96d('0x7'));var controller=require(_0xe96d('0x8'));router[_0xe96d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe96d('0xa')]);router[_0xe96d('0x9')](_0xe96d('0xb'),auth[_0xe96d('0xc')](),controller['describe']);router[_0xe96d('0x9')](_0xe96d('0xd'),auth[_0xe96d('0xc')](),controller[_0xe96d('0xe')]);router[_0xe96d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe96d('0x10')](_0xe96d('0xd'),auth[_0xe96d('0xc')](),controller[_0xe96d('0x11')]);router[_0xe96d('0x12')](_0xe96d('0xd'),auth[_0xe96d('0xc')](),controller[_0xe96d('0x13')]);module[_0xe96d('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 1bbc8ec..271a464 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4e8346,_0x329652){var _0x4c9e57=function(_0x5430a4){while(--_0x5430a4){_0x4e8346['push'](_0x4e8346['shift']());}};_0x4c9e57(++_0x329652);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5308e1,_0x23629d){_0x5308e1=_0x5308e1-0x0;var _0x54c899=_0xf4eb[_0x5308e1];return _0x54c899;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x139c24,_0x562ba1){var _0xed1b28=function(_0x3d0f24){while(--_0x3d0f24){_0x139c24['push'](_0x139c24['shift']());}};_0xed1b28(++_0x562ba1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index efe37de..a787fb3 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 _0x1e92=['set','Content-Range','apply','save','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','MailTransferReport','include','findAll','rows','catch','params','includeAll','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x4a0ee0,_0x5bb338){var _0x15ab52=function(_0x3af07b){while(--_0x3af07b){_0x4a0ee0['push'](_0x4a0ee0['shift']());}};_0x15ab52(++_0x5bb338);}(_0x1e92,0x74));var _0x21e9=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1e92[_0xda464c];return _0x19e222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21e9('0x1'));var rp=require(_0x21e9('0x2'));var moment=require(_0x21e9('0x3'));var BPromise=require(_0x21e9('0x4'));var Mustache=require(_0x21e9('0x5'));var util=require('util');var path=require(_0x21e9('0x6'));var sox=require(_0x21e9('0x7'));var csv=require(_0x21e9('0x8'));var ejs=require(_0x21e9('0x9'));var fs=require('fs');var fs_extra=require(_0x21e9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x21e9('0xb'));var deskjs=require(_0x21e9('0xc'));var toCsv=require(_0x21e9('0x8'));var querystring=require(_0x21e9('0xd'));var Papa=require(_0x21e9('0xe'));var Redis=require('ioredis');var authService=require(_0x21e9('0xf'));var qs=require(_0x21e9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21e9('0x11'));var logger=require(_0x21e9('0x12'))(_0x21e9('0x13'));var utils=require(_0x21e9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x21e9('0x15'));var db=require(_0x21e9('0x16'))['db'];function respondWithStatusCode(_0x119884,_0x516104){_0x516104=_0x516104||0xcc;return function(_0x28dc84){if(_0x28dc84){return _0x119884[_0x21e9('0x17')](_0x516104);}return _0x119884[_0x21e9('0x18')](_0x516104)['end']();};}function respondWithResult(_0x3b2472,_0x2c95da){_0x2c95da=_0x2c95da||0xc8;return function(_0x4bc147){if(_0x4bc147){return _0x3b2472['status'](_0x2c95da)[_0x21e9('0x19')](_0x4bc147);}};}function respondWithFilteredResult(_0x5a6d40,_0x455995){return function(_0x546a65){if(_0x546a65){var _0x727761=typeof _0x455995[_0x21e9('0x1a')]===_0x21e9('0x1b')&&typeof _0x455995['limit']===_0x21e9('0x1b');var _0x5e5ee4=_0x546a65[_0x21e9('0x1c')];var _0x3e1ecb=_0x727761?0x0:_0x455995[_0x21e9('0x1a')];var _0x14602f=_0x727761?_0x546a65[_0x21e9('0x1c')]:_0x455995[_0x21e9('0x1a')]+_0x455995[_0x21e9('0x1d')];var _0x2ef0e4;if(_0x14602f>=_0x5e5ee4){_0x14602f=_0x5e5ee4;_0x2ef0e4=0xc8;}else{_0x2ef0e4=0xce;}_0x5a6d40[_0x21e9('0x18')](_0x2ef0e4);return _0x5a6d40[_0x21e9('0x1e')](_0x21e9('0x1f'),_0x3e1ecb+'-'+_0x14602f+'/'+_0x5e5ee4)[_0x21e9('0x19')](_0x546a65);}return null;};}function patchUpdates(_0x2d1517){return function(_0x3fb62b){try{jsonpatch[_0x21e9('0x20')](_0x3fb62b,_0x2d1517,!![]);}catch(_0x55e6ad){return BPromise['reject'](_0x55e6ad);}return _0x3fb62b[_0x21e9('0x21')]();};}function saveUpdates(_0x34b1f8,_0xd36bd){return function(_0x19ea3a){if(_0x19ea3a){return _0x19ea3a['update'](_0x34b1f8)[_0x21e9('0x22')](function(_0x974ea4){return _0x974ea4;});}return null;};}function removeEntity(_0x2eb05a,_0xeaa1e3){return function(_0x1fd049){if(_0x1fd049){return _0x1fd049[_0x21e9('0x23')]()[_0x21e9('0x22')](function(){_0x2eb05a['status'](0xcc)[_0x21e9('0x24')]();});}};}function handleEntityNotFound(_0x5fb061,_0x25afb4){return function(_0x3d62e5){if(!_0x3d62e5){_0x5fb061[_0x21e9('0x17')](0x194);}return _0x3d62e5;};}function handleError(_0x46dda3,_0x217295){_0x217295=_0x217295||0x1f4;return function(_0x3dd7af){logger['error'](_0x3dd7af[_0x21e9('0x25')]);if(_0x3dd7af[_0x21e9('0x26')]){delete _0x3dd7af[_0x21e9('0x26')];}_0x46dda3[_0x21e9('0x18')](_0x217295)['send'](_0x3dd7af);};}exports[_0x21e9('0x27')]=function(_0x4b416a,_0x6181bb){var _0x349b56={},_0xf7267d={},_0x54c666={'count':0x0,'rows':[]};var _0x31b557=_[_0x21e9('0x28')](db['MailTransferReport'][_0x21e9('0x29')],function(_0x4cdc18){return{'name':_0x4cdc18[_0x21e9('0x2a')],'type':_0x4cdc18[_0x21e9('0x2b')][_0x21e9('0x2c')]};});_0xf7267d[_0x21e9('0x2d')]=_[_0x21e9('0x28')](_0x31b557,'name');_0xf7267d[_0x21e9('0x2e')]=_[_0x21e9('0x2f')](_0x4b416a[_0x21e9('0x2e')]);_0xf7267d[_0x21e9('0x30')]=_[_0x21e9('0x31')](_0xf7267d['model'],_0xf7267d[_0x21e9('0x2e')]);_0x349b56[_0x21e9('0x32')]=_[_0x21e9('0x31')](_0xf7267d['model'],qs[_0x21e9('0x33')](_0x4b416a[_0x21e9('0x2e')][_0x21e9('0x33')]));_0x349b56[_0x21e9('0x32')]=_0x349b56[_0x21e9('0x32')][_0x21e9('0x34')]?_0x349b56[_0x21e9('0x32')]:_0xf7267d[_0x21e9('0x2d')];if(!_0x4b416a['query'][_0x21e9('0x35')](_0x21e9('0x36'))){_0x349b56[_0x21e9('0x1d')]=qs[_0x21e9('0x1d')](_0x4b416a[_0x21e9('0x2e')][_0x21e9('0x1d')]);_0x349b56[_0x21e9('0x1a')]=qs[_0x21e9('0x1a')](_0x4b416a[_0x21e9('0x2e')]['offset']);}_0x349b56[_0x21e9('0x37')]=qs[_0x21e9('0x38')](_0x4b416a['query']['sort']);_0x349b56[_0x21e9('0x39')]=qs[_0x21e9('0x30')](_['pick'](_0x4b416a[_0x21e9('0x2e')],_0xf7267d['filters']),_0x31b557);if(_0x4b416a[_0x21e9('0x2e')]['filter']){_0x349b56[_0x21e9('0x39')]=_[_0x21e9('0x3a')](_0x349b56[_0x21e9('0x39')],{'$or':_[_0x21e9('0x28')](_0x31b557,function(_0x48cb63){if(_0x48cb63[_0x21e9('0x2b')]!=='VIRTUAL'){var _0x278928={};_0x278928[_0x48cb63[_0x21e9('0x26')]]={'$like':'%'+_0x4b416a[_0x21e9('0x2e')][_0x21e9('0x3b')]+'%'};return _0x278928;}})});}_0x349b56=_[_0x21e9('0x3a')]({},_0x349b56,_0x4b416a[_0x21e9('0x3c')]);var _0x13af69={'where':_0x349b56[_0x21e9('0x39')]};return db[_0x21e9('0x3d')][_0x21e9('0x1c')](_0x13af69)[_0x21e9('0x22')](function(_0x180d8e){_0x54c666[_0x21e9('0x1c')]=_0x180d8e;if(_0x4b416a['query']['includeAll']){_0x349b56[_0x21e9('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x21e9('0x3f')](_0x349b56);})[_0x21e9('0x22')](function(_0x534a94){_0x54c666[_0x21e9('0x40')]=_0x534a94;return _0x54c666;})['then'](respondWithFilteredResult(_0x6181bb,_0x349b56))[_0x21e9('0x41')](handleError(_0x6181bb,null));};exports['show']=function(_0x49842a,_0x506fce){var _0x1d6d5b={'raw':!![],'where':{'id':_0x49842a[_0x21e9('0x42')]['id']}},_0x32daf8={};_0x32daf8[_0x21e9('0x2d')]=_[_0x21e9('0x2f')](db[_0x21e9('0x3d')][_0x21e9('0x29')]);_0x32daf8[_0x21e9('0x2e')]=_[_0x21e9('0x2f')](_0x49842a[_0x21e9('0x2e')]);_0x32daf8[_0x21e9('0x30')]=_[_0x21e9('0x31')](_0x32daf8['model'],_0x32daf8[_0x21e9('0x2e')]);_0x1d6d5b[_0x21e9('0x32')]=_['intersection'](_0x32daf8[_0x21e9('0x2d')],qs['fields'](_0x49842a['query'][_0x21e9('0x33')]));_0x1d6d5b[_0x21e9('0x32')]=_0x1d6d5b['attributes'][_0x21e9('0x34')]?_0x1d6d5b[_0x21e9('0x32')]:_0x32daf8[_0x21e9('0x2d')];if(_0x49842a[_0x21e9('0x2e')][_0x21e9('0x43')]){_0x1d6d5b[_0x21e9('0x3e')]=[{'all':!![]}];}_0x1d6d5b=_[_0x21e9('0x3a')]({},_0x1d6d5b,_0x49842a[_0x21e9('0x3c')]);return db['MailTransferReport'][_0x21e9('0x44')](_0x1d6d5b)['then'](handleEntityNotFound(_0x506fce,null))[_0x21e9('0x22')](respondWithResult(_0x506fce,null))[_0x21e9('0x41')](handleError(_0x506fce,null));};exports[_0x21e9('0x45')]=function(_0x2f37b4,_0x503a33){return db['MailTransferReport']['create'](_0x2f37b4[_0x21e9('0x46')],{})[_0x21e9('0x22')](respondWithResult(_0x503a33,0xc9))[_0x21e9('0x41')](handleError(_0x503a33,null));};exports[_0x21e9('0x47')]=function(_0xde8c88,_0x17643f){if(_0xde8c88[_0x21e9('0x46')]['id']){delete _0xde8c88['body']['id'];}return db[_0x21e9('0x3d')]['find']({'where':{'id':_0xde8c88['params']['id']}})[_0x21e9('0x22')](handleEntityNotFound(_0x17643f,null))[_0x21e9('0x22')](saveUpdates(_0xde8c88[_0x21e9('0x46')],null))['then'](respondWithResult(_0x17643f,null))[_0x21e9('0x41')](handleError(_0x17643f,null));};exports[_0x21e9('0x23')]=function(_0x305b8b,_0x19abed){return db[_0x21e9('0x3d')][_0x21e9('0x44')]({'where':{'id':_0x305b8b[_0x21e9('0x42')]['id']}})[_0x21e9('0x22')](handleEntityNotFound(_0x19abed,null))['then'](removeEntity(_0x19abed,null))[_0x21e9('0x41')](handleError(_0x19abed,null));};exports[_0x21e9('0x48')]=function(_0x22264e,_0x15887a){return db[_0x21e9('0x3d')][_0x21e9('0x48')]()[_0x21e9('0x22')](respondWithResult(_0x15887a,null))[_0x21e9('0x41')](handleError(_0x15887a,null));}; \ No newline at end of file +var _0xa978=['offset','undefined','count','set','apply','reject','update','then','status','end','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','options','MailTransferReport','include','findAll','catch','show','rawAttributes','includeAll','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x11a566,_0x4b82c5){var _0x2395ac=function(_0x2344ef){while(--_0x2344ef){_0x11a566['push'](_0x11a566['shift']());}};_0x2395ac(++_0x4b82c5);}(_0xa978,0x197));var _0x8a97=function(_0x3d082c,_0x373413){_0x3d082c=_0x3d082c-0x0;var _0x38de5a=_0xa978[_0x3d082c];return _0x38de5a;};'use strict';var emlformat=require(_0x8a97('0x0'));var rimraf=require(_0x8a97('0x1'));var zipdir=require(_0x8a97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a97('0x3'));var BPromise=require(_0x8a97('0x4'));var Mustache=require(_0x8a97('0x5'));var util=require('util');var path=require(_0x8a97('0x6'));var sox=require(_0x8a97('0x7'));var csv=require(_0x8a97('0x8'));var ejs=require(_0x8a97('0x9'));var fs=require('fs');var fs_extra=require(_0x8a97('0xa'));var _=require(_0x8a97('0xb'));var squel=require(_0x8a97('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a97('0x8'));var querystring=require('querystring');var Papa=require(_0x8a97('0xd'));var Redis=require(_0x8a97('0xe'));var authService=require(_0x8a97('0xf'));var qs=require(_0x8a97('0x10'));var as=require(_0x8a97('0x11'));var hardwareService=require(_0x8a97('0x12'));var logger=require(_0x8a97('0x13'))('api');var utils=require(_0x8a97('0x14'));var config=require(_0x8a97('0x15'));var licenseUtil=require(_0x8a97('0x16'));var db=require(_0x8a97('0x17'))['db'];function respondWithStatusCode(_0x503fa2,_0x427e5e){_0x427e5e=_0x427e5e||0xcc;return function(_0x1cdfc3){if(_0x1cdfc3){return _0x503fa2[_0x8a97('0x18')](_0x427e5e);}return _0x503fa2['status'](_0x427e5e)['end']();};}function respondWithResult(_0x10c260,_0x4da2cb){_0x4da2cb=_0x4da2cb||0xc8;return function(_0x38b69f){if(_0x38b69f){return _0x10c260['status'](_0x4da2cb)['json'](_0x38b69f);}};}function respondWithFilteredResult(_0x88bb7c,_0x513339){return function(_0x5cf26e){if(_0x5cf26e){var _0x3f4967=typeof _0x513339[_0x8a97('0x19')]===_0x8a97('0x1a')&&typeof _0x513339['limit']===_0x8a97('0x1a');var _0x56c8cf=_0x5cf26e[_0x8a97('0x1b')];var _0x5e0fe2=_0x3f4967?0x0:_0x513339[_0x8a97('0x19')];var _0x2a52d2=_0x3f4967?_0x5cf26e[_0x8a97('0x1b')]:_0x513339[_0x8a97('0x19')]+_0x513339['limit'];var _0x38ad4b;if(_0x2a52d2>=_0x56c8cf){_0x2a52d2=_0x56c8cf;_0x38ad4b=0xc8;}else{_0x38ad4b=0xce;}_0x88bb7c['status'](_0x38ad4b);return _0x88bb7c[_0x8a97('0x1c')]('Content-Range',_0x5e0fe2+'-'+_0x2a52d2+'/'+_0x56c8cf)['json'](_0x5cf26e);}return null;};}function patchUpdates(_0x5a6839){return function(_0x3e8cf9){try{jsonpatch[_0x8a97('0x1d')](_0x3e8cf9,_0x5a6839,!![]);}catch(_0x4357ae){return BPromise[_0x8a97('0x1e')](_0x4357ae);}return _0x3e8cf9['save']();};}function saveUpdates(_0x3b8ef6,_0xbcfd51){return function(_0x2366f1){if(_0x2366f1){return _0x2366f1[_0x8a97('0x1f')](_0x3b8ef6)[_0x8a97('0x20')](function(_0x30b0b){return _0x30b0b;});}return null;};}function removeEntity(_0x3efa4b,_0x2730e4){return function(_0x5c7c2c){if(_0x5c7c2c){return _0x5c7c2c['destroy']()[_0x8a97('0x20')](function(){_0x3efa4b[_0x8a97('0x21')](0xcc)[_0x8a97('0x22')]();});}};}function handleEntityNotFound(_0x1c9004,_0x458c5d){return function(_0x5c2e34){if(!_0x5c2e34){_0x1c9004[_0x8a97('0x18')](0x194);}return _0x5c2e34;};}function handleError(_0x3deab8,_0x791254){_0x791254=_0x791254||0x1f4;return function(_0x9e44c5){logger[_0x8a97('0x23')](_0x9e44c5[_0x8a97('0x24')]);if(_0x9e44c5[_0x8a97('0x25')]){delete _0x9e44c5[_0x8a97('0x25')];}_0x3deab8[_0x8a97('0x21')](_0x791254)['send'](_0x9e44c5);};}exports[_0x8a97('0x26')]=function(_0x3b46c0,_0x6298fc){var _0x253082={},_0x337622={},_0x22be89={'count':0x0,'rows':[]};var _0x3ccf55=_[_0x8a97('0x27')](db['MailTransferReport']['rawAttributes'],function(_0x54e778){return{'name':_0x54e778[_0x8a97('0x28')],'type':_0x54e778[_0x8a97('0x29')][_0x8a97('0x2a')]};});_0x337622[_0x8a97('0x2b')]=_[_0x8a97('0x27')](_0x3ccf55,'name');_0x337622[_0x8a97('0x2c')]=_[_0x8a97('0x2d')](_0x3b46c0[_0x8a97('0x2c')]);_0x337622[_0x8a97('0x2e')]=_['intersection'](_0x337622[_0x8a97('0x2b')],_0x337622['query']);_0x253082[_0x8a97('0x2f')]=_[_0x8a97('0x30')](_0x337622[_0x8a97('0x2b')],qs[_0x8a97('0x31')](_0x3b46c0['query'][_0x8a97('0x31')]));_0x253082[_0x8a97('0x2f')]=_0x253082[_0x8a97('0x2f')][_0x8a97('0x32')]?_0x253082[_0x8a97('0x2f')]:_0x337622[_0x8a97('0x2b')];if(!_0x3b46c0[_0x8a97('0x2c')][_0x8a97('0x33')]('nolimit')){_0x253082[_0x8a97('0x34')]=qs['limit'](_0x3b46c0[_0x8a97('0x2c')][_0x8a97('0x34')]);_0x253082[_0x8a97('0x19')]=qs[_0x8a97('0x19')](_0x3b46c0['query']['offset']);}_0x253082['order']=qs[_0x8a97('0x35')](_0x3b46c0['query'][_0x8a97('0x35')]);_0x253082[_0x8a97('0x36')]=qs[_0x8a97('0x2e')](_[_0x8a97('0x37')](_0x3b46c0[_0x8a97('0x2c')],_0x337622[_0x8a97('0x2e')]),_0x3ccf55);if(_0x3b46c0[_0x8a97('0x2c')]['filter']){_0x253082[_0x8a97('0x36')]=_[_0x8a97('0x38')](_0x253082[_0x8a97('0x36')],{'$or':_[_0x8a97('0x27')](_0x3ccf55,function(_0x1fa598){if(_0x1fa598['type']!==_0x8a97('0x39')){var _0xb64a44={};_0xb64a44[_0x1fa598['name']]={'$like':'%'+_0x3b46c0['query']['filter']+'%'};return _0xb64a44;}})});}_0x253082=_['merge']({},_0x253082,_0x3b46c0[_0x8a97('0x3a')]);var _0x3a2655={'where':_0x253082[_0x8a97('0x36')]};return db[_0x8a97('0x3b')]['count'](_0x3a2655)[_0x8a97('0x20')](function(_0x21b9b4){_0x22be89[_0x8a97('0x1b')]=_0x21b9b4;if(_0x3b46c0['query']['includeAll']){_0x253082[_0x8a97('0x3c')]=[{'all':!![]}];}return db['MailTransferReport'][_0x8a97('0x3d')](_0x253082);})[_0x8a97('0x20')](function(_0x323b5a){_0x22be89['rows']=_0x323b5a;return _0x22be89;})[_0x8a97('0x20')](respondWithFilteredResult(_0x6298fc,_0x253082))[_0x8a97('0x3e')](handleError(_0x6298fc,null));};exports[_0x8a97('0x3f')]=function(_0x8ff95e,_0x5afeb8){var _0x33e306={'raw':!![],'where':{'id':_0x8ff95e['params']['id']}},_0x3f9389={};_0x3f9389['model']=_[_0x8a97('0x2d')](db[_0x8a97('0x3b')][_0x8a97('0x40')]);_0x3f9389[_0x8a97('0x2c')]=_[_0x8a97('0x2d')](_0x8ff95e[_0x8a97('0x2c')]);_0x3f9389[_0x8a97('0x2e')]=_[_0x8a97('0x30')](_0x3f9389[_0x8a97('0x2b')],_0x3f9389[_0x8a97('0x2c')]);_0x33e306[_0x8a97('0x2f')]=_[_0x8a97('0x30')](_0x3f9389[_0x8a97('0x2b')],qs[_0x8a97('0x31')](_0x8ff95e['query']['fields']));_0x33e306[_0x8a97('0x2f')]=_0x33e306['attributes'][_0x8a97('0x32')]?_0x33e306['attributes']:_0x3f9389['model'];if(_0x8ff95e[_0x8a97('0x2c')][_0x8a97('0x41')]){_0x33e306[_0x8a97('0x3c')]=[{'all':!![]}];}_0x33e306=_[_0x8a97('0x38')]({},_0x33e306,_0x8ff95e[_0x8a97('0x3a')]);return db['MailTransferReport']['find'](_0x33e306)[_0x8a97('0x20')](handleEntityNotFound(_0x5afeb8,null))[_0x8a97('0x20')](respondWithResult(_0x5afeb8,null))[_0x8a97('0x3e')](handleError(_0x5afeb8,null));};exports['create']=function(_0xb99b3d,_0x29cd0e){return db['MailTransferReport'][_0x8a97('0x42')](_0xb99b3d[_0x8a97('0x43')],{})[_0x8a97('0x20')](respondWithResult(_0x29cd0e,0xc9))[_0x8a97('0x3e')](handleError(_0x29cd0e,null));};exports[_0x8a97('0x1f')]=function(_0x120657,_0x1bfad2){if(_0x120657[_0x8a97('0x43')]['id']){delete _0x120657['body']['id'];}return db['MailTransferReport'][_0x8a97('0x44')]({'where':{'id':_0x120657[_0x8a97('0x45')]['id']}})[_0x8a97('0x20')](handleEntityNotFound(_0x1bfad2,null))[_0x8a97('0x20')](saveUpdates(_0x120657[_0x8a97('0x43')],null))[_0x8a97('0x20')](respondWithResult(_0x1bfad2,null))[_0x8a97('0x3e')](handleError(_0x1bfad2,null));};exports[_0x8a97('0x46')]=function(_0x313e91,_0x4b4e06){return db['MailTransferReport'][_0x8a97('0x44')]({'where':{'id':_0x313e91['params']['id']}})['then'](handleEntityNotFound(_0x4b4e06,null))[_0x8a97('0x20')](removeEntity(_0x4b4e06,null))[_0x8a97('0x3e')](handleError(_0x4b4e06,null));};exports[_0x8a97('0x47')]=function(_0x3179cd,_0x2d79b6){return db[_0x8a97('0x3b')][_0x8a97('0x47')]()['then'](respondWithResult(_0x2d79b6,null))[_0x8a97('0x3e')](handleError(_0x2d79b6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index dc39fef..03f7ef6 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 _0x7351=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x2ea073,_0x3de17e){var _0xf0ff5e=function(_0x44276c){while(--_0x44276c){_0x2ea073['push'](_0x2ea073['shift']());}};_0xf0ff5e(++_0x3de17e);}(_0x7351,0x139));var _0x1735=function(_0x50aff5,_0x55b1b1){_0x50aff5=_0x50aff5-0x0;var _0x5d88ef=_0x7351[_0x50aff5];return _0x5d88ef;};'use strict';var _=require(_0x1735('0x0'));var util=require(_0x1735('0x1'));var logger=require(_0x1735('0x2'))(_0x1735('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1735('0x4'));var fs=require('fs');var path=require(_0x1735('0x5'));var rimraf=require(_0x1735('0x6'));var config=require(_0x1735('0x7'));var attributes=require(_0x1735('0x8'));module[_0x1735('0x9')]=function(_0x47fa51,_0x3fdcc1){return _0x47fa51[_0x1735('0xa')](_0x1735('0xb'),attributes,{'tableName':_0x1735('0xc'),'paranoid':![],'indexes':[{'name':_0x1735('0xd'),'fields':[_0x1735('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x979e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x4965e5,_0x29f2dc){var _0x50924d=function(_0xcb39ec){while(--_0xcb39ec){_0x4965e5['push'](_0x4965e5['shift']());}};_0x50924d(++_0x29f2dc);}(_0x979e,0x195));var _0xe979=function(_0x1ecaee,_0x2c922c){_0x1ecaee=_0x1ecaee-0x0;var _0x3ccfae=_0x979e[_0x1ecaee];return _0x3ccfae;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var logger=require(_0xe979('0x2'))(_0xe979('0x3'));var moment=require('moment');var BPromise=require(_0xe979('0x4'));var rp=require(_0xe979('0x5'));var fs=require('fs');var path=require(_0xe979('0x6'));var rimraf=require(_0xe979('0x7'));var config=require(_0xe979('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0xe979('0x9')]=function(_0x580e20,_0x1a0d35){return _0x580e20[_0xe979('0xa')](_0xe979('0xb'),attributes,{'tableName':_0xe979('0xc'),'paranoid':![],'indexes':[{'name':_0xe979('0xd'),'fields':[_0xe979('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 47ba1c4..286a77e 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 _0xf3f1=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2198fb,_0x36b25d){var _0x4b4e02=function(_0x5c14d4){while(--_0x5c14d4){_0x2198fb['push'](_0x2198fb['shift']());}};_0x4b4e02(++_0x36b25d);}(_0xf3f1,0x17b));var _0x1f3f=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0xf3f1[_0x470f63];return _0x4f09e2;};'use strict';var _=require('lodash');var util=require(_0x1f3f('0x0'));var moment=require('moment');var BPromise=require(_0x1f3f('0x1'));var rs=require(_0x1f3f('0x2'));var fs=require('fs');var Redis=require(_0x1f3f('0x3'));var db=require(_0x1f3f('0x4'))['db'];var utils=require(_0x1f3f('0x5'));var logger=require(_0x1f3f('0x6'))(_0x1f3f('0x7'));var config=require(_0x1f3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf3b30c,_0x2d6215,_0x1eaf3d){return new BPromise(function(_0x2c216a,_0x3a6237){return client[_0x1f3f('0xa')](_0xf3b30c,_0x1eaf3d)[_0x1f3f('0xb')](function(_0x467a73){logger[_0x1f3f('0xc')](_0x1f3f('0xd'),_0x2d6215,_0x1f3f('0xe'));logger['debug'](_0x1f3f('0xf'),_0x2d6215,_0x1f3f('0xe'),JSON[_0x1f3f('0x10')](_0x467a73));if(_0x467a73[_0x1f3f('0x11')]){if(_0x467a73[_0x1f3f('0x11')][_0x1f3f('0x12')]===0x1f4){logger[_0x1f3f('0x11')](_0x1f3f('0xd'),_0x2d6215,_0x467a73[_0x1f3f('0x11')][_0x1f3f('0x13')]);return _0x3a6237(_0x467a73[_0x1f3f('0x11')][_0x1f3f('0x13')]);}logger[_0x1f3f('0x11')](_0x1f3f('0xd'),_0x2d6215,_0x467a73[_0x1f3f('0x11')][_0x1f3f('0x13')]);return _0x2c216a(_0x467a73[_0x1f3f('0x11')][_0x1f3f('0x13')]);}else{logger[_0x1f3f('0xc')](_0x1f3f('0xd'),_0x2d6215,_0x1f3f('0xe'));_0x2c216a(_0x467a73[_0x1f3f('0x14')]['message']);}})[_0x1f3f('0x15')](function(_0x203230){logger[_0x1f3f('0x11')](_0x1f3f('0xd'),_0x2d6215,_0x203230);_0x3a6237(_0x203230);});});} \ No newline at end of file +var _0xf953=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash'];(function(_0x142201,_0x31a272){var _0x491d21=function(_0x16a51c){while(--_0x16a51c){_0x142201['push'](_0x142201['shift']());}};_0x491d21(++_0x31a272);}(_0xf953,0x11d));var _0x3f95=function(_0xbe060e,_0xe4e728){_0xbe060e=_0xbe060e-0x0;var _0x3de665=_0xf953[_0xbe060e];return _0x3de665;};'use strict';var _=require(_0x3f95('0x0'));var util=require(_0x3f95('0x1'));var moment=require(_0x3f95('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f95('0x3'));var fs=require('fs');var Redis=require(_0x3f95('0x4'));var db=require(_0x3f95('0x5'))['db'];var utils=require(_0x3f95('0x6'));var logger=require(_0x3f95('0x7'))(_0x3f95('0x8'));var config=require(_0x3f95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f95('0xa')][_0x3f95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9469,_0x1c24c2,_0x2f17cd){return new BPromise(function(_0xfe42d0,_0x49cbc4){return client[_0x3f95('0xc')](_0x1c9469,_0x2f17cd)['then'](function(_0x130b20){logger['info'](_0x3f95('0xd'),_0x1c24c2,_0x3f95('0xe'));logger[_0x3f95('0xf')](_0x3f95('0x10'),_0x1c24c2,_0x3f95('0xe'),JSON['stringify'](_0x130b20));if(_0x130b20[_0x3f95('0x11')]){if(_0x130b20[_0x3f95('0x11')][_0x3f95('0x12')]===0x1f4){logger[_0x3f95('0x11')](_0x3f95('0xd'),_0x1c24c2,_0x130b20['error']['message']);return _0x49cbc4(_0x130b20['error'][_0x3f95('0x13')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1c24c2,_0x130b20[_0x3f95('0x11')][_0x3f95('0x13')]);return _0xfe42d0(_0x130b20['error']['message']);}else{logger[_0x3f95('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x1c24c2,_0x3f95('0xe'));_0xfe42d0(_0x130b20[_0x3f95('0x15')]['message']);}})['catch'](function(_0x1e7740){logger[_0x3f95('0x11')](_0x3f95('0xd'),_0x1c24c2,_0x1e7740);_0x49cbc4(_0x1e7740);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index fc7a727..fb4843c 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 _0x5ac2=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x3015f9,_0x6eeb0d){var _0x3390b6=function(_0x4cff57){while(--_0x4cff57){_0x3015f9['push'](_0x3015f9['shift']());}};_0x3390b6(++_0x6eeb0d);}(_0x5ac2,0x79));var _0x25ac=function(_0x406723,_0x321803){_0x406723=_0x406723-0x0;var _0x4bdf25=_0x5ac2[_0x406723];return _0x4bdf25;};'use strict';var multer=require('multer');var util=require(_0x25ac('0x0'));var path=require(_0x25ac('0x1'));var timeout=require('connect-timeout');var express=require(_0x25ac('0x2'));var router=express[_0x25ac('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x25ac('0x4'));var interaction=require(_0x25ac('0x5'));var config=require('../../config/environment');var controller=require(_0x25ac('0x6'));router[_0x25ac('0x7')]('/',auth[_0x25ac('0x8')](),controller['index']);router[_0x25ac('0x7')](_0x25ac('0x9'),auth['isAuthenticated'](),controller[_0x25ac('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x25ac('0xb')]);router[_0x25ac('0xc')]('/',auth[_0x25ac('0x8')](),controller[_0x25ac('0xd')]);router[_0x25ac('0xe')](_0x25ac('0xf'),auth[_0x25ac('0x8')](),controller[_0x25ac('0x10')]);router[_0x25ac('0x11')](_0x25ac('0xf'),auth[_0x25ac('0x8')](),controller[_0x25ac('0x12')]);module[_0x25ac('0x13')]=router; \ No newline at end of file +var _0x8bfc=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x31321c,_0x567c99){var _0x594860=function(_0x57578a){while(--_0x57578a){_0x31321c['push'](_0x31321c['shift']());}};_0x594860(++_0x567c99);}(_0x8bfc,0x181));var _0xc8bf=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x8bfc[_0x336376];return _0x1d2a8e;};'use strict';var multer=require(_0xc8bf('0x0'));var util=require(_0xc8bf('0x1'));var path=require(_0xc8bf('0x2'));var timeout=require(_0xc8bf('0x3'));var express=require('express');var router=express[_0xc8bf('0x4')]();var fs_extra=require(_0xc8bf('0x5'));var auth=require(_0xc8bf('0x6'));var interaction=require(_0xc8bf('0x7'));var config=require('../../config/environment');var controller=require(_0xc8bf('0x8'));router[_0xc8bf('0x9')]('/',auth[_0xc8bf('0xa')](),controller['index']);router[_0xc8bf('0x9')](_0xc8bf('0xb'),auth[_0xc8bf('0xa')](),controller[_0xc8bf('0xc')]);router[_0xc8bf('0x9')](_0xc8bf('0xd'),auth[_0xc8bf('0xa')](),controller[_0xc8bf('0xe')]);router[_0xc8bf('0xf')]('/',auth[_0xc8bf('0xa')](),controller[_0xc8bf('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc8bf('0x11')]);router[_0xc8bf('0x12')](_0xc8bf('0xd'),auth['isAuthenticated'](),controller[_0xc8bf('0x13')]);module[_0xc8bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4eb406a..024a158 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 _0x37f8=['moment','exports','STRING','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','INTEGER'];(function(_0x1c7fdc,_0x4e8ace){var _0x29e864=function(_0x23e7c5){while(--_0x23e7c5){_0x1c7fdc['push'](_0x1c7fdc['shift']());}};_0x29e864(++_0x4e8ace);}(_0x37f8,0xd2));var _0x837f=function(_0xa7c5c,_0x36a313){_0xa7c5c=_0xa7c5c-0x0;var _0x160718=_0x37f8[_0xa7c5c];return _0x160718;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x837f('0x0'));module[_0x837f('0x1')]={'channel':{'type':Sequelize[_0x837f('0x2')]},'membername':{'type':Sequelize[_0x837f('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x837f('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x19c939){var _0x42986f=moment(_0x19c939);var _0x224ad2=moment(this[_0x837f('0x3')](_0x837f('0x4')));var _0x25bbcb=_0x42986f[_0x837f('0x5')](_0x224ad2,_0x837f('0x6'));this[_0x837f('0x7')](_0x837f('0x8'),_0x19c939);this[_0x837f('0x7')](_0x837f('0x9'),_0x25bbcb||null);}},'data1':{'type':Sequelize[_0x837f('0x2')],'comment':_0x837f('0xa')},'data2':{'type':Sequelize[_0x837f('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x837f('0x2')],'comment':_0x837f('0xb')},'data4':{'type':Sequelize[_0x837f('0x2')],'comment':_0x837f('0xc')},'data5':{'type':Sequelize[_0x837f('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x837f('0xd')]},'uniqueid':{'type':Sequelize[_0x837f('0x2')]}}; \ No newline at end of file +var _0x938c=['talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]'];(function(_0x334af8,_0x9219e5){var _0x553e36=function(_0x39458f){while(--_0x39458f){_0x334af8['push'](_0x334af8['shift']());}};_0x553e36(++_0x9219e5);}(_0x938c,0x11f));var _0xc938=function(_0x4f050d,_0xb13402){_0x4f050d=_0x4f050d-0x0;var _0x5df066=_0x938c[_0x4f050d];return _0x5df066;};'use strict';var Sequelize=require(_0xc938('0x0'));var moment=require(_0xc938('0x1'));module['exports']={'channel':{'type':Sequelize[_0xc938('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc938('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xc938('0x3')},'duration':{'type':Sequelize[_0xc938('0x4')]},'enterAt':{'type':Sequelize[_0xc938('0x5')]},'exitAt':{'type':Sequelize[_0xc938('0x5')],'set':function(_0x235110){var _0x8cfbb6=moment(_0x235110);var _0x5c08fe=moment(this[_0xc938('0x6')](_0xc938('0x7')));var _0x52fbb1=_0x8cfbb6[_0xc938('0x8')](_0x5c08fe,_0xc938('0x9'));this['setDataValue'](_0xc938('0xa'),_0x235110);this['setDataValue']('duration',_0x52fbb1||null);}},'data1':{'type':Sequelize[_0xc938('0x2')],'comment':_0xc938('0xb')},'data2':{'type':Sequelize[_0xc938('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xc938('0x2')],'comment':_0xc938('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0xc938('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0xc938('0xe')},'role':{'type':Sequelize[_0xc938('0x2')]},'internal':{'type':Sequelize[_0xc938('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f8aef3c..b0bfae1 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ee9f1,_0x2d6c01){_0x4ee9f1=_0x4ee9f1-0x0;var _0x45a5d6=_0xedd9[_0x4ee9f1];return _0x45a5d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x1da811,_0x2e30db){_0x1da811=_0x1da811-0x0;var _0x53858b=_0x55ca[_0x1da811];return _0x53858b;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index fb86caa..b9a98ca 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 _0xa234=['api','moment','bluebird','request-promise','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger'];(function(_0x440800,_0x391868){var _0x1b3ff9=function(_0x3f3739){while(--_0x3f3739){_0x440800['push'](_0x440800['shift']());}};_0x1b3ff9(++_0x391868);}(_0xa234,0x15c));var _0x4a23=function(_0x4d1003,_0x395c94){_0x4d1003=_0x4d1003-0x0;var _0x24f6af=_0xa234[_0x4d1003];return _0x24f6af;};'use strict';var _=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var logger=require(_0x4a23('0x2'))(_0x4a23('0x3'));var moment=require(_0x4a23('0x4'));var BPromise=require(_0x4a23('0x5'));var rp=require(_0x4a23('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4a23('0x7'));module[_0x4a23('0x8')]=function(_0x1a4aa6,_0x28e461){return _0x1a4aa6['define'](_0x4a23('0x9'),attributes,{'tableName':_0x4a23('0xa'),'paranoid':![],'indexes':[{'name':_0x4a23('0xb'),'fields':['membername',_0x4a23('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa12=['membername_interface','membername','interface','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x2eb0ba,_0x174584){_0x2eb0ba=_0x2eb0ba-0x0;var _0x109c0d=_0xfa12[_0x2eb0ba];return _0x109c0d;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var logger=require(_0x2fa1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2fa1('0x3'));var rp=require(_0x2fa1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fa1('0x5'));var attributes=require(_0x2fa1('0x6'));module[_0x2fa1('0x7')]=function(_0x4dfb6e,_0x19a57a){return _0x4dfb6e['define'](_0x2fa1('0x8'),attributes,{'tableName':_0x2fa1('0x9'),'paranoid':![],'indexes':[{'name':_0x2fa1('0xa'),'fields':[_0x2fa1('0xb'),_0x2fa1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7462890..6c19156 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 _0x77a9=['map','model','CreateMemberReport','create','UpdateMemberReport','body','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','attributes','include'];(function(_0x48168a,_0xf9dfe5){var _0x346d98=function(_0x22e41f){while(--_0x22e41f){_0x48168a['push'](_0x48168a['shift']());}};_0x346d98(++_0xf9dfe5);}(_0x77a9,0x19e));var _0x977a=function(_0x47e899,_0x5dfdaa){_0x47e899=_0x47e899-0x0;var _0x2e27a0=_0x77a9[_0x47e899];return _0x2e27a0;};'use strict';var _=require(_0x977a('0x0'));var util=require('util');var moment=require(_0x977a('0x1'));var BPromise=require('bluebird');var rs=require(_0x977a('0x2'));var fs=require('fs');var Redis=require(_0x977a('0x3'));var db=require(_0x977a('0x4'))['db'];var utils=require(_0x977a('0x5'));var logger=require('../../config/logger')(_0x977a('0x6'));var config=require(_0x977a('0x7'));var jayson=require(_0x977a('0x8'));var client=jayson[_0x977a('0x9')][_0x977a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x579e03,_0x51950c,_0x2e177f){return new BPromise(function(_0x12fd82,_0x5ac9c7){return client[_0x977a('0xb')](_0x579e03,_0x2e177f)[_0x977a('0xc')](function(_0xb29d7c){logger[_0x977a('0xd')](_0x977a('0xe'),_0x51950c,_0x977a('0xf'));logger[_0x977a('0x10')](_0x977a('0x11'),_0x51950c,_0x977a('0xf'),JSON[_0x977a('0x12')](_0xb29d7c));if(_0xb29d7c['error']){if(_0xb29d7c[_0x977a('0x13')][_0x977a('0x14')]===0x1f4){logger[_0x977a('0x13')](_0x977a('0xe'),_0x51950c,_0xb29d7c[_0x977a('0x13')][_0x977a('0x15')]);return _0x5ac9c7(_0xb29d7c[_0x977a('0x13')][_0x977a('0x15')]);}logger[_0x977a('0x13')](_0x977a('0xe'),_0x51950c,_0xb29d7c['error'][_0x977a('0x15')]);return _0x12fd82(_0xb29d7c['error'][_0x977a('0x15')]);}else{logger[_0x977a('0xd')]('MemberReport,\x20%s,\x20%s',_0x51950c,_0x977a('0xf'));_0x12fd82(_0xb29d7c[_0x977a('0x16')][_0x977a('0x15')]);}})[_0x977a('0x17')](function(_0x5a352c){logger[_0x977a('0x13')](_0x977a('0xe'),_0x51950c,_0x5a352c);_0x5ac9c7(_0x5a352c);});});}exports[_0x977a('0x18')]=function(_0x5b57bd){var _0x3e7dac=this;return new Promise(function(_0x20b70b,_0x5ee316){return db[_0x977a('0x19')]['findAll']({'raw':_0x5b57bd[_0x977a('0x1a')]?_0x5b57bd[_0x977a('0x1a')][_0x977a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b57bd[_0x977a('0x1a')]?_0x5b57bd[_0x977a('0x1a')]['where']||null:null,'attributes':_0x5b57bd[_0x977a('0x1a')]?_0x5b57bd[_0x977a('0x1a')][_0x977a('0x1c')]||null:null,'limit':_0x5b57bd[_0x977a('0x1a')]?_0x5b57bd[_0x977a('0x1a')]['limit']||null:null,'include':_0x5b57bd['options']?_0x5b57bd[_0x977a('0x1a')][_0x977a('0x1d')]?_[_0x977a('0x1e')](_0x5b57bd[_0x977a('0x1a')][_0x977a('0x1d')],function(_0x51f4b6){return{'model':db[_0x51f4b6[_0x977a('0x1f')]],'as':_0x51f4b6['as'],'attributes':_0x51f4b6['attributes'],'include':_0x51f4b6[_0x977a('0x1d')]?_[_0x977a('0x1e')](_0x51f4b6[_0x977a('0x1d')],function(_0x5794c6){return{'model':db[_0x5794c6[_0x977a('0x1f')]],'as':_0x5794c6['as'],'attributes':_0x5794c6[_0x977a('0x1c')],'include':_0x5794c6[_0x977a('0x1d')]?_['map'](_0x5794c6[_0x977a('0x1d')],function(_0x49a87a){return{'model':db[_0x49a87a[_0x977a('0x1f')]],'as':_0x49a87a['as'],'attributes':_0x49a87a[_0x977a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x977a('0xc')](function(_0x562dfd){logger['info']('GetMemberReport',_0x5b57bd);logger[_0x977a('0x10')]('GetMemberReport',_0x5b57bd,JSON['stringify'](_0x562dfd));_0x20b70b(_0x562dfd);})[_0x977a('0x17')](function(_0x5c36de){logger[_0x977a('0x13')]('GetMemberReport',_0x5c36de[_0x977a('0x15')],_0x5b57bd);_0x5ee316(_0x3e7dac[_0x977a('0x13')](0x1f4,_0x5c36de[_0x977a('0x15')]));});});};exports[_0x977a('0x20')]=function(_0x53aad3){var _0x1f1063=this;return new Promise(function(_0x37aeea,_0x477976){return db[_0x977a('0x19')][_0x977a('0x21')](_0x53aad3['body'],{'raw':_0x53aad3['options']?_0x53aad3[_0x977a('0x1a')][_0x977a('0x1b')]===undefined?!![]:![]:!![]})[_0x977a('0xc')](function(_0x4d85b8){logger[_0x977a('0xd')](_0x977a('0x20'),_0x53aad3);logger[_0x977a('0x10')]('CreateMemberReport',_0x53aad3,JSON[_0x977a('0x12')](_0x4d85b8));_0x37aeea(_0x4d85b8);})[_0x977a('0x17')](function(_0xef4509){logger[_0x977a('0x13')](_0x977a('0x20'),_0xef4509['message'],_0x53aad3);_0x477976(_0x1f1063[_0x977a('0x13')](0x1f4,_0xef4509[_0x977a('0x15')]));});});};exports[_0x977a('0x22')]=function(_0x3ed20a){var _0x229677=this;return new Promise(function(_0x1a0344,_0x1bcbad){return db[_0x977a('0x19')]['update'](_0x3ed20a[_0x977a('0x23')],{'raw':_0x3ed20a[_0x977a('0x1a')]?_0x3ed20a[_0x977a('0x1a')][_0x977a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed20a[_0x977a('0x1a')]?_0x3ed20a[_0x977a('0x1a')][_0x977a('0x24')]||null:null,'attributes':_0x3ed20a['options']?_0x3ed20a[_0x977a('0x1a')]['attributes']||null:null,'limit':_0x3ed20a[_0x977a('0x1a')]?_0x3ed20a['options']['limit']||null:null})[_0x977a('0xc')](function(_0x8ece8d){logger[_0x977a('0xd')]('UpdateMemberReport',_0x3ed20a);logger['debug'](_0x977a('0x22'),_0x3ed20a,JSON[_0x977a('0x12')](_0x8ece8d));_0x1a0344(_0x8ece8d);})[_0x977a('0x17')](function(_0x2ae0d2){logger['error']('UpdateMemberReport',_0x2ae0d2[_0x977a('0x15')],_0x3ed20a);_0x1bcbad(_0x229677[_0x977a('0x13')](0x1f4,_0x2ae0d2[_0x977a('0x15')]));});});}; \ No newline at end of file +var _0x598a=['request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','body','CreateMemberReport','update','where','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s'];(function(_0x2af160,_0x765b1){var _0x439d67=function(_0x4d26af){while(--_0x4d26af){_0x2af160['push'](_0x2af160['shift']());}};_0x439d67(++_0x765b1);}(_0x598a,0xfb));var _0xa598=function(_0x37dd84,_0x3e47b4){_0x37dd84=_0x37dd84-0x0;var _0x66df75=_0x598a[_0x37dd84];return _0x66df75;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var moment=require(_0xa598('0x2'));var BPromise=require(_0xa598('0x3'));var rs=require(_0xa598('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa598('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa598('0x6'));var jayson=require(_0xa598('0x7'));var client=jayson[_0xa598('0x8')][_0xa598('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc65a6c,_0x4d82ee,_0x51fa08){return new BPromise(function(_0x4279e3,_0xebf6e5){return client[_0xa598('0xa')](_0xc65a6c,_0x51fa08)[_0xa598('0xb')](function(_0x190ccf){logger[_0xa598('0xc')]('MemberReport,\x20%s,\x20%s',_0x4d82ee,'request\x20sent');logger[_0xa598('0xd')](_0xa598('0xe'),_0x4d82ee,_0xa598('0xf'),JSON[_0xa598('0x10')](_0x190ccf));if(_0x190ccf[_0xa598('0x11')]){if(_0x190ccf['error'][_0xa598('0x12')]===0x1f4){logger[_0xa598('0x11')](_0xa598('0x13'),_0x4d82ee,_0x190ccf['error'][_0xa598('0x14')]);return _0xebf6e5(_0x190ccf['error'][_0xa598('0x14')]);}logger[_0xa598('0x11')](_0xa598('0x13'),_0x4d82ee,_0x190ccf[_0xa598('0x11')][_0xa598('0x14')]);return _0x4279e3(_0x190ccf[_0xa598('0x11')][_0xa598('0x14')]);}else{logger[_0xa598('0xc')](_0xa598('0x13'),_0x4d82ee,'request\x20sent');_0x4279e3(_0x190ccf[_0xa598('0x15')][_0xa598('0x14')]);}})[_0xa598('0x16')](function(_0x27c34e){logger[_0xa598('0x11')](_0xa598('0x13'),_0x4d82ee,_0x27c34e);_0xebf6e5(_0x27c34e);});});}exports[_0xa598('0x17')]=function(_0x2746e3){var _0x36492f=this;return new Promise(function(_0x44c872,_0x5e5806){return db[_0xa598('0x18')][_0xa598('0x19')]({'raw':_0x2746e3[_0xa598('0x1a')]?_0x2746e3[_0xa598('0x1a')][_0xa598('0x1b')]===undefined?!![]:![]:!![],'where':_0x2746e3[_0xa598('0x1a')]?_0x2746e3['options']['where']||null:null,'attributes':_0x2746e3[_0xa598('0x1a')]?_0x2746e3['options'][_0xa598('0x1c')]||null:null,'limit':_0x2746e3[_0xa598('0x1a')]?_0x2746e3[_0xa598('0x1a')][_0xa598('0x1d')]||null:null,'include':_0x2746e3[_0xa598('0x1a')]?_0x2746e3[_0xa598('0x1a')]['include']?_[_0xa598('0x1e')](_0x2746e3[_0xa598('0x1a')][_0xa598('0x1f')],function(_0x14643d){return{'model':db[_0x14643d[_0xa598('0x20')]],'as':_0x14643d['as'],'attributes':_0x14643d[_0xa598('0x1c')],'include':_0x14643d[_0xa598('0x1f')]?_[_0xa598('0x1e')](_0x14643d['include'],function(_0x473d07){return{'model':db[_0x473d07[_0xa598('0x20')]],'as':_0x473d07['as'],'attributes':_0x473d07['attributes'],'include':_0x473d07['include']?_[_0xa598('0x1e')](_0x473d07['include'],function(_0x527c9f){return{'model':db[_0x527c9f[_0xa598('0x20')]],'as':_0x527c9f['as'],'attributes':_0x527c9f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa598('0xb')](function(_0x5eae63){logger['info'](_0xa598('0x17'),_0x2746e3);logger[_0xa598('0xd')]('GetMemberReport',_0x2746e3,JSON[_0xa598('0x10')](_0x5eae63));_0x44c872(_0x5eae63);})[_0xa598('0x16')](function(_0x3cdc59){logger[_0xa598('0x11')]('GetMemberReport',_0x3cdc59[_0xa598('0x14')],_0x2746e3);_0x5e5806(_0x36492f['error'](0x1f4,_0x3cdc59['message']));});});};exports['CreateMemberReport']=function(_0x25b8fe){var _0x4f1025=this;return new Promise(function(_0x308282,_0x3324df){return db[_0xa598('0x18')]['create'](_0x25b8fe[_0xa598('0x21')],{'raw':_0x25b8fe[_0xa598('0x1a')]?_0x25b8fe[_0xa598('0x1a')][_0xa598('0x1b')]===undefined?!![]:![]:!![]})[_0xa598('0xb')](function(_0x4e5f9b){logger[_0xa598('0xc')](_0xa598('0x22'),_0x25b8fe);logger[_0xa598('0xd')](_0xa598('0x22'),_0x25b8fe,JSON['stringify'](_0x4e5f9b));_0x308282(_0x4e5f9b);})[_0xa598('0x16')](function(_0x1d1d83){logger['error']('CreateMemberReport',_0x1d1d83[_0xa598('0x14')],_0x25b8fe);_0x3324df(_0x4f1025[_0xa598('0x11')](0x1f4,_0x1d1d83[_0xa598('0x14')]));});});};exports['UpdateMemberReport']=function(_0x1fed30){var _0x3928a1=this;return new Promise(function(_0x556d2d,_0x45e006){return db['MemberReport'][_0xa598('0x23')](_0x1fed30[_0xa598('0x21')],{'raw':_0x1fed30['options']?_0x1fed30[_0xa598('0x1a')][_0xa598('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fed30['options']?_0x1fed30[_0xa598('0x1a')][_0xa598('0x24')]||null:null,'attributes':_0x1fed30[_0xa598('0x1a')]?_0x1fed30['options'][_0xa598('0x1c')]||null:null,'limit':_0x1fed30[_0xa598('0x1a')]?_0x1fed30[_0xa598('0x1a')]['limit']||null:null})[_0xa598('0xb')](function(_0x58ecdb){logger[_0xa598('0xc')](_0xa598('0x25'),_0x1fed30);logger[_0xa598('0xd')]('UpdateMemberReport',_0x1fed30,JSON['stringify'](_0x58ecdb));_0x556d2d(_0x58ecdb);})['catch'](function(_0x58df2a){logger[_0xa598('0x11')](_0xa598('0x25'),_0x58df2a[_0xa598('0x14')],_0x1fed30);_0x45e006(_0x3928a1[_0xa598('0x11')](0x1f4,_0x58df2a[_0xa598('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 322ce71..d16cedf 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 _0xf2a5=['util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x4648f1,_0x565e1c){_0x4648f1=_0x4648f1-0x0;var _0x14a5fe=_0xf2a5[_0x4648f1];return _0x14a5fe;};'use strict';var multer=require('multer');var util=require(_0x5f2a('0x0'));var path=require(_0x5f2a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5f2a('0x2'));var interaction=require(_0x5f2a('0x3'));var config=require(_0x5f2a('0x4'));var controller=require(_0x5f2a('0x5'));router['get']('/',controller[_0x5f2a('0x6')]);module[_0x5f2a('0x7')]=router; \ No newline at end of file +var _0xf483=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','exports','util'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xf483,0xf2));var _0x3f48=function(_0x31d525,_0x186377){_0x31d525=_0x31d525-0x0;var _0x3febd5=_0xf483[_0x31d525];return _0x3febd5;};'use strict';var multer=require('multer');var util=require(_0x3f48('0x0'));var path=require('path');var timeout=require(_0x3f48('0x1'));var express=require(_0x3f48('0x2'));var router=express[_0x3f48('0x3')]();var fs_extra=require(_0x3f48('0x4'));var auth=require(_0x3f48('0x5'));var interaction=require(_0x3f48('0x6'));var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0x3f48('0x7')]);module[_0x3f48('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b5a2bca..b27ae70 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 _0xde3b=['exports','STRING','version','sequelize'];(function(_0x2ff127,_0x3d6e2b){var _0x53af48=function(_0x4a0c47){while(--_0x4a0c47){_0x2ff127['push'](_0x2ff127['shift']());}};_0x53af48(++_0x3d6e2b);}(_0xde3b,0xc7));var _0xbde3=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xde3b[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xbde3('0x0'));module[_0xbde3('0x1')]={'version':{'type':Sequelize[_0xbde3('0x2')],'unique':_0xbde3('0x3')}}; \ No newline at end of file +var _0x3307=['version','sequelize','exports','STRING'];(function(_0x4acf0f,_0x14657b){var _0x2d34d3=function(_0x38c5fd){while(--_0x38c5fd){_0x4acf0f['push'](_0x4acf0f['shift']());}};_0x2d34d3(++_0x14657b);}(_0x3307,0xa9));var _0x7330=function(_0xaeb95,_0x40ebfe){_0xaeb95=_0xaeb95-0x0;var _0x60cf50=_0x3307[_0xaeb95];return _0x60cf50;};'use strict';var Sequelize=require(_0x7330('0x0'));module[_0x7330('0x1')]={'version':{'type':Sequelize[_0x7330('0x2')],'unique':_0x7330('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 35f89c0..5122fc0 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 _0x9f20=['zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f20,0x153));var _0x09f2=function(_0x6c852,_0x4553a9){_0x6c852=_0x6c852-0x0;var _0x668a34=_0x9f20[_0x6c852];return _0x668a34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09f2('0x0'));var zipdir=require(_0x09f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09f2('0x2'));var moment=require(_0x09f2('0x3'));var BPromise=require(_0x09f2('0x4'));var Mustache=require('mustache');var util=require(_0x09f2('0x5'));var path=require(_0x09f2('0x6'));var sox=require(_0x09f2('0x7'));var csv=require(_0x09f2('0x8'));var ejs=require(_0x09f2('0x9'));var fs=require('fs');var fs_extra=require(_0x09f2('0xa'));var _=require(_0x09f2('0xb'));var squel=require('squel');var crypto=require(_0x09f2('0xc'));var jsforce=require(_0x09f2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x09f2('0x8'));var querystring=require(_0x09f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x09f2('0xf'));var authService=require(_0x09f2('0x10'));var qs=require(_0x09f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09f2('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x09f2('0x13'));var licenseUtil=require(_0x09f2('0x14'));var db=require(_0x09f2('0x15'))['db'];function respondWithStatusCode(_0xe647f8,_0x105c5f){_0x105c5f=_0x105c5f||0xcc;return function(_0x1b96b0){if(_0x1b96b0){return _0xe647f8[_0x09f2('0x16')](_0x105c5f);}return _0xe647f8['status'](_0x105c5f)[_0x09f2('0x17')]();};}function respondWithResult(_0x2d6274,_0x910cb4){_0x910cb4=_0x910cb4||0xc8;return function(_0x4a2500){if(_0x4a2500){return _0x2d6274[_0x09f2('0x18')](_0x910cb4)[_0x09f2('0x19')](_0x4a2500);}};}function respondWithFilteredResult(_0x369b9e,_0x3f86b4){return function(_0x32dc86){if(_0x32dc86){var _0xf46916=typeof _0x3f86b4[_0x09f2('0x1a')]==='undefined'&&typeof _0x3f86b4[_0x09f2('0x1b')]===_0x09f2('0x1c');var _0x2fb0d4=_0x32dc86[_0x09f2('0x1d')];var _0x38761d=_0xf46916?0x0:_0x3f86b4[_0x09f2('0x1a')];var _0x1a759e=_0xf46916?_0x32dc86[_0x09f2('0x1d')]:_0x3f86b4[_0x09f2('0x1a')]+_0x3f86b4[_0x09f2('0x1b')];var _0x5d5832;if(_0x1a759e>=_0x2fb0d4){_0x1a759e=_0x2fb0d4;_0x5d5832=0xc8;}else{_0x5d5832=0xce;}_0x369b9e[_0x09f2('0x18')](_0x5d5832);return _0x369b9e[_0x09f2('0x1e')](_0x09f2('0x1f'),_0x38761d+'-'+_0x1a759e+'/'+_0x2fb0d4)[_0x09f2('0x19')](_0x32dc86);}return null;};}function patchUpdates(_0x412013){return function(_0x47a186){try{jsonpatch[_0x09f2('0x20')](_0x47a186,_0x412013,!![]);}catch(_0x120d33){return BPromise[_0x09f2('0x21')](_0x120d33);}return _0x47a186[_0x09f2('0x22')]();};}function saveUpdates(_0x240c5,_0x5c9afe){return function(_0x28577c){if(_0x28577c){return _0x28577c[_0x09f2('0x23')](_0x240c5)[_0x09f2('0x24')](function(_0x36f80b){return _0x36f80b;});}return null;};}function removeEntity(_0x1368d7,_0x3acb8a){return function(_0x5f2cbb){if(_0x5f2cbb){return _0x5f2cbb[_0x09f2('0x25')]()[_0x09f2('0x24')](function(){_0x1368d7['status'](0xcc)[_0x09f2('0x17')]();});}};}function handleEntityNotFound(_0x1f693d,_0x3b42bc){return function(_0xf4ddb3){if(!_0xf4ddb3){_0x1f693d[_0x09f2('0x16')](0x194);}return _0xf4ddb3;};}function handleError(_0xdcb509,_0x520505){_0x520505=_0x520505||0x1f4;return function(_0x256eff){logger[_0x09f2('0x26')](_0x256eff[_0x09f2('0x27')]);if(_0x256eff[_0x09f2('0x28')]){delete _0x256eff['name'];}_0xdcb509[_0x09f2('0x18')](_0x520505)[_0x09f2('0x29')](_0x256eff);};}exports[_0x09f2('0x2a')]=function(_0xb5177a,_0x553707){var _0x554637={},_0x5d968c={},_0x1194e4={'count':0x0,'rows':[]};var _0x4c7a99=_[_0x09f2('0x2b')](db['Migration'][_0x09f2('0x2c')],function(_0x1fb0fb){return{'name':_0x1fb0fb[_0x09f2('0x2d')],'type':_0x1fb0fb['type'][_0x09f2('0x2e')]};});_0x5d968c[_0x09f2('0x2f')]=_[_0x09f2('0x2b')](_0x4c7a99,_0x09f2('0x28'));_0x5d968c[_0x09f2('0x30')]=_[_0x09f2('0x31')](_0xb5177a[_0x09f2('0x30')]);_0x5d968c['filters']=_[_0x09f2('0x32')](_0x5d968c[_0x09f2('0x2f')],_0x5d968c[_0x09f2('0x30')]);_0x554637[_0x09f2('0x33')]=_[_0x09f2('0x32')](_0x5d968c[_0x09f2('0x2f')],qs[_0x09f2('0x34')](_0xb5177a[_0x09f2('0x30')][_0x09f2('0x34')]));_0x554637[_0x09f2('0x33')]=_0x554637[_0x09f2('0x33')][_0x09f2('0x35')]?_0x554637[_0x09f2('0x33')]:_0x5d968c[_0x09f2('0x2f')];if(!_0xb5177a[_0x09f2('0x30')][_0x09f2('0x36')](_0x09f2('0x37'))){_0x554637['limit']=qs[_0x09f2('0x1b')](_0xb5177a['query'][_0x09f2('0x1b')]);_0x554637[_0x09f2('0x1a')]=qs[_0x09f2('0x1a')](_0xb5177a['query'][_0x09f2('0x1a')]);}_0x554637['order']=qs[_0x09f2('0x38')](_0xb5177a[_0x09f2('0x30')][_0x09f2('0x38')]);_0x554637[_0x09f2('0x39')]=qs[_0x09f2('0x3a')](_[_0x09f2('0x3b')](_0xb5177a[_0x09f2('0x30')],_0x5d968c['filters']),_0x4c7a99);if(_0xb5177a[_0x09f2('0x30')]['filter']){_0x554637[_0x09f2('0x39')]=_['merge'](_0x554637[_0x09f2('0x39')],{'$or':_['map'](_0x4c7a99,function(_0x56150d){if(_0x56150d[_0x09f2('0x3c')]!==_0x09f2('0x3d')){var _0x404e98={};_0x404e98[_0x56150d['name']]={'$like':'%'+_0xb5177a['query'][_0x09f2('0x3e')]+'%'};return _0x404e98;}})});}_0x554637=_['merge']({},_0x554637,_0xb5177a['options']);var _0x467f0e={'where':_0x554637['where']};return db['Migration'][_0x09f2('0x1d')](_0x467f0e)['then'](function(_0x42a2ba){_0x1194e4['count']=_0x42a2ba;if(_0xb5177a['query'][_0x09f2('0x3f')]){_0x554637[_0x09f2('0x40')]=[{'all':!![]}];}return db['Migration'][_0x09f2('0x41')](_0x554637);})[_0x09f2('0x24')](function(_0x5577f6){_0x1194e4[_0x09f2('0x42')]=_0x5577f6;return _0x1194e4;})[_0x09f2('0x24')](respondWithFilteredResult(_0x553707,_0x554637))[_0x09f2('0x43')](handleError(_0x553707,null));}; \ No newline at end of file +var _0x64d4=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','then','include','findAll','rows','catch'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x64d4,0x94));var _0x464d=function(_0x29a9da,_0x10ced8){_0x29a9da=_0x29a9da-0x0;var _0x32cb94=_0x64d4[_0x29a9da];return _0x32cb94;};'use strict';var emlformat=require(_0x464d('0x0'));var rimraf=require(_0x464d('0x1'));var zipdir=require(_0x464d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x464d('0x3'));var BPromise=require(_0x464d('0x4'));var Mustache=require(_0x464d('0x5'));var util=require(_0x464d('0x6'));var path=require(_0x464d('0x7'));var sox=require(_0x464d('0x8'));var csv=require(_0x464d('0x9'));var ejs=require(_0x464d('0xa'));var fs=require('fs');var fs_extra=require(_0x464d('0xb'));var _=require(_0x464d('0xc'));var squel=require(_0x464d('0xd'));var crypto=require(_0x464d('0xe'));var jsforce=require(_0x464d('0xf'));var deskjs=require(_0x464d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x464d('0x11'));var Papa=require(_0x464d('0x12'));var Redis=require(_0x464d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x464d('0x14'));var as=require(_0x464d('0x15'));var hardwareService=require(_0x464d('0x16'));var logger=require(_0x464d('0x17'))(_0x464d('0x18'));var utils=require('../../config/utils');var config=require(_0x464d('0x19'));var licenseUtil=require(_0x464d('0x1a'));var db=require(_0x464d('0x1b'))['db'];function respondWithStatusCode(_0x10c579,_0x4d7fb0){_0x4d7fb0=_0x4d7fb0||0xcc;return function(_0x1b15ec){if(_0x1b15ec){return _0x10c579[_0x464d('0x1c')](_0x4d7fb0);}return _0x10c579[_0x464d('0x1d')](_0x4d7fb0)['end']();};}function respondWithResult(_0x533eb0,_0x21fcdd){_0x21fcdd=_0x21fcdd||0xc8;return function(_0x362024){if(_0x362024){return _0x533eb0[_0x464d('0x1d')](_0x21fcdd)[_0x464d('0x1e')](_0x362024);}};}function respondWithFilteredResult(_0x177bb1,_0x585374){return function(_0x4aa62b){if(_0x4aa62b){var _0x2c8e37=typeof _0x585374[_0x464d('0x1f')]==='undefined'&&typeof _0x585374[_0x464d('0x20')]===_0x464d('0x21');var _0x5cf7de=_0x4aa62b[_0x464d('0x22')];var _0x27dd65=_0x2c8e37?0x0:_0x585374[_0x464d('0x1f')];var _0x17797f=_0x2c8e37?_0x4aa62b[_0x464d('0x22')]:_0x585374[_0x464d('0x1f')]+_0x585374[_0x464d('0x20')];var _0x2745f1;if(_0x17797f>=_0x5cf7de){_0x17797f=_0x5cf7de;_0x2745f1=0xc8;}else{_0x2745f1=0xce;}_0x177bb1[_0x464d('0x1d')](_0x2745f1);return _0x177bb1[_0x464d('0x23')](_0x464d('0x24'),_0x27dd65+'-'+_0x17797f+'/'+_0x5cf7de)[_0x464d('0x1e')](_0x4aa62b);}return null;};}function patchUpdates(_0x18f755){return function(_0x3586bf){try{jsonpatch['apply'](_0x3586bf,_0x18f755,!![]);}catch(_0x1a5ae7){return BPromise[_0x464d('0x25')](_0x1a5ae7);}return _0x3586bf[_0x464d('0x26')]();};}function saveUpdates(_0xdf721d,_0x121c8f){return function(_0x3a7120){if(_0x3a7120){return _0x3a7120[_0x464d('0x27')](_0xdf721d)['then'](function(_0x1d6e12){return _0x1d6e12;});}return null;};}function removeEntity(_0x12f5b9,_0x2a779e){return function(_0x412eae){if(_0x412eae){return _0x412eae[_0x464d('0x28')]()['then'](function(){_0x12f5b9['status'](0xcc)[_0x464d('0x29')]();});}};}function handleEntityNotFound(_0x180e26,_0x2d9260){return function(_0x522c4f){if(!_0x522c4f){_0x180e26['sendStatus'](0x194);}return _0x522c4f;};}function handleError(_0x32f4f3,_0x40367d){_0x40367d=_0x40367d||0x1f4;return function(_0x39f1f7){logger[_0x464d('0x2a')](_0x39f1f7[_0x464d('0x2b')]);if(_0x39f1f7['name']){delete _0x39f1f7[_0x464d('0x2c')];}_0x32f4f3[_0x464d('0x1d')](_0x40367d)[_0x464d('0x2d')](_0x39f1f7);};}exports[_0x464d('0x2e')]=function(_0x7a522c,_0x131471){var _0x4d841d={},_0x380394={},_0x2bf9e0={'count':0x0,'rows':[]};var _0x4dfd94=_[_0x464d('0x2f')](db[_0x464d('0x30')][_0x464d('0x31')],function(_0x236934){return{'name':_0x236934[_0x464d('0x32')],'type':_0x236934[_0x464d('0x33')][_0x464d('0x34')]};});_0x380394[_0x464d('0x35')]=_[_0x464d('0x2f')](_0x4dfd94,_0x464d('0x2c'));_0x380394[_0x464d('0x36')]=_[_0x464d('0x37')](_0x7a522c['query']);_0x380394['filters']=_[_0x464d('0x38')](_0x380394['model'],_0x380394[_0x464d('0x36')]);_0x4d841d[_0x464d('0x39')]=_[_0x464d('0x38')](_0x380394[_0x464d('0x35')],qs[_0x464d('0x3a')](_0x7a522c[_0x464d('0x36')]['fields']));_0x4d841d[_0x464d('0x39')]=_0x4d841d[_0x464d('0x39')][_0x464d('0x3b')]?_0x4d841d[_0x464d('0x39')]:_0x380394['model'];if(!_0x7a522c[_0x464d('0x36')][_0x464d('0x3c')](_0x464d('0x3d'))){_0x4d841d['limit']=qs[_0x464d('0x20')](_0x7a522c[_0x464d('0x36')]['limit']);_0x4d841d[_0x464d('0x1f')]=qs[_0x464d('0x1f')](_0x7a522c[_0x464d('0x36')]['offset']);}_0x4d841d[_0x464d('0x3e')]=qs['sort'](_0x7a522c[_0x464d('0x36')][_0x464d('0x3f')]);_0x4d841d['where']=qs[_0x464d('0x40')](_['pick'](_0x7a522c['query'],_0x380394['filters']),_0x4dfd94);if(_0x7a522c[_0x464d('0x36')][_0x464d('0x41')]){_0x4d841d[_0x464d('0x42')]=_[_0x464d('0x43')](_0x4d841d[_0x464d('0x42')],{'$or':_[_0x464d('0x2f')](_0x4dfd94,function(_0x5c2d74){if(_0x5c2d74['type']!==_0x464d('0x44')){var _0x136f01={};_0x136f01[_0x5c2d74[_0x464d('0x2c')]]={'$like':'%'+_0x7a522c['query'][_0x464d('0x41')]+'%'};return _0x136f01;}})});}_0x4d841d=_[_0x464d('0x43')]({},_0x4d841d,_0x7a522c['options']);var _0x219c41={'where':_0x4d841d[_0x464d('0x42')]};return db['Migration']['count'](_0x219c41)[_0x464d('0x45')](function(_0x3149c1){_0x2bf9e0[_0x464d('0x22')]=_0x3149c1;if(_0x7a522c[_0x464d('0x36')]['includeAll']){_0x4d841d[_0x464d('0x46')]=[{'all':!![]}];}return db[_0x464d('0x30')][_0x464d('0x47')](_0x4d841d);})[_0x464d('0x45')](function(_0x260ed4){_0x2bf9e0[_0x464d('0x48')]=_0x260ed4;return _0x2bf9e0;})['then'](respondWithFilteredResult(_0x131471,_0x4d841d))[_0x464d('0x49')](handleError(_0x131471,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b69c07b..e651bd8 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 _0x5fe0=['path','rimraf','../../config/environment','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2bcd1f,_0x1e147d){var _0x4fc3ce=function(_0x2931d2){while(--_0x2931d2){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x4fc3ce(++_0x1e147d);}(_0x5fe0,0x10a));var _0x05fe=function(_0x234208,_0x23d460){_0x234208=_0x234208-0x0;var _0x202282=_0x5fe0[_0x234208];return _0x202282;};'use strict';var _=require(_0x05fe('0x0'));var util=require(_0x05fe('0x1'));var logger=require(_0x05fe('0x2'))(_0x05fe('0x3'));var moment=require(_0x05fe('0x4'));var BPromise=require(_0x05fe('0x5'));var rp=require(_0x05fe('0x6'));var fs=require('fs');var path=require(_0x05fe('0x7'));var rimraf=require(_0x05fe('0x8'));var config=require(_0x05fe('0x9'));var attributes=require('./migration.attributes');module['exports']=function(_0x489103,_0x2ff568){return _0x489103[_0x05fe('0xa')](_0x05fe('0xb'),attributes,{'tableName':_0x05fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3473=['bluebird','request-promise','path','rimraf','./migration.attributes','exports','define','Migration','util','api'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x3473,0x15c));var _0x3347=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0x3473[_0x10a1ac];return _0x45b99e;};'use strict';var _=require('lodash');var util=require(_0x3347('0x0'));var logger=require('../../config/logger')(_0x3347('0x1'));var moment=require('moment');var BPromise=require(_0x3347('0x2'));var rp=require(_0x3347('0x3'));var fs=require('fs');var path=require(_0x3347('0x4'));var rimraf=require(_0x3347('0x5'));var config=require('../../config/environment');var attributes=require(_0x3347('0x6'));module[_0x3347('0x7')]=function(_0x2e84f5,_0x30ad0b){return _0x2e84f5[_0x3347('0x8')](_0x3347('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 3a52bb8..4c63346 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 _0xa9e5=['http','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b4f82,_0x3f74aa){var _0x12deb9=function(_0x46172c){while(--_0x46172c){_0x1b4f82['push'](_0x1b4f82['shift']());}};_0x12deb9(++_0x3f74aa);}(_0xa9e5,0x8a));var _0x5a9e=function(_0x17417c,_0x4bc740){_0x17417c=_0x17417c-0x0;var _0x4a9f94=_0xa9e5[_0x17417c];return _0x4a9f94;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var moment=require('moment');var BPromise=require(_0x5a9e('0x2'));var rs=require(_0x5a9e('0x3'));var fs=require('fs');var Redis=require(_0x5a9e('0x4'));var db=require(_0x5a9e('0x5'))['db'];var utils=require(_0x5a9e('0x6'));var logger=require(_0x5a9e('0x7'))(_0x5a9e('0x8'));var config=require(_0x5a9e('0x9'));var jayson=require(_0x5a9e('0xa'));var client=jayson[_0x5a9e('0xb')][_0x5a9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36831b,_0x69b06a,_0xa3e37b){return new BPromise(function(_0x4e1213,_0x7050d0){return client[_0x5a9e('0xd')](_0x36831b,_0xa3e37b)[_0x5a9e('0xe')](function(_0x328786){logger['info'](_0x5a9e('0xf'),_0x69b06a,'request\x20sent');logger[_0x5a9e('0x10')](_0x5a9e('0x11'),_0x69b06a,_0x5a9e('0x12'),JSON[_0x5a9e('0x13')](_0x328786));if(_0x328786[_0x5a9e('0x14')]){if(_0x328786[_0x5a9e('0x14')][_0x5a9e('0x15')]===0x1f4){logger[_0x5a9e('0x14')]('Migration,\x20%s,\x20%s',_0x69b06a,_0x328786['error'][_0x5a9e('0x16')]);return _0x7050d0(_0x328786[_0x5a9e('0x14')][_0x5a9e('0x16')]);}logger[_0x5a9e('0x14')]('Migration,\x20%s,\x20%s',_0x69b06a,_0x328786[_0x5a9e('0x14')]['message']);return _0x4e1213(_0x328786[_0x5a9e('0x14')][_0x5a9e('0x16')]);}else{logger['info'](_0x5a9e('0xf'),_0x69b06a,_0x5a9e('0x12'));_0x4e1213(_0x328786[_0x5a9e('0x17')][_0x5a9e('0x16')]);}})[_0x5a9e('0x18')](function(_0x732c43){logger[_0x5a9e('0x14')](_0x5a9e('0xf'),_0x69b06a,_0x732c43);_0x7050d0(_0x732c43);});});} \ No newline at end of file +var _0x76a3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Migration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x76a3,0xf8));var _0x376a=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x76a3[_0xe3e0af];return _0x4828e9;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var moment=require(_0x376a('0x2'));var BPromise=require(_0x376a('0x3'));var rs=require(_0x376a('0x4'));var fs=require('fs');var Redis=require(_0x376a('0x5'));var db=require(_0x376a('0x6'))['db'];var utils=require(_0x376a('0x7'));var logger=require(_0x376a('0x8'))(_0x376a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x376a('0xa')][_0x376a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139dbc,_0x3cb57e,_0x548516){return new BPromise(function(_0x3e2261,_0x409960){return client[_0x376a('0xc')](_0x139dbc,_0x548516)[_0x376a('0xd')](function(_0x347b32){logger[_0x376a('0xe')]('Migration,\x20%s,\x20%s',_0x3cb57e,'request\x20sent');logger['debug'](_0x376a('0xf'),_0x3cb57e,_0x376a('0x10'),JSON['stringify'](_0x347b32));if(_0x347b32[_0x376a('0x11')]){if(_0x347b32['error'][_0x376a('0x12')]===0x1f4){logger[_0x376a('0x11')]('Migration,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x409960(_0x347b32[_0x376a('0x11')]['message']);}logger[_0x376a('0x11')]('Migration,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x3e2261(_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);}else{logger[_0x376a('0xe')](_0x376a('0x14'),_0x3cb57e,_0x376a('0x10'));_0x3e2261(_0x347b32[_0x376a('0x15')]['message']);}})[_0x376a('0x16')](function(_0xe3c5fc){logger['error'](_0x376a('0x14'),_0x3cb57e,_0xe3c5fc);_0x409960(_0xe3c5fc);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3c5646a..3037d62 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 _0x4364=['show','post','create','put','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x36d20c,_0x60bfb9){var _0x227550=function(_0x5c68db){while(--_0x5c68db){_0x36d20c['push'](_0x36d20c['shift']());}};_0x227550(++_0x60bfb9);}(_0x4364,0x1b0));var _0x4436=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4364[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x4436('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4436('0x1'));var router=express[_0x4436('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4436('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4436('0x4'));var controller=require(_0x4436('0x5'));router[_0x4436('0x6')]('/',auth[_0x4436('0x7')](),controller[_0x4436('0x8')]);router[_0x4436('0x6')](_0x4436('0x9'),auth['isAuthenticated'](),controller[_0x4436('0xa')]);router[_0x4436('0xb')]('/',auth[_0x4436('0x7')](),controller[_0x4436('0xc')]);router[_0x4436('0xd')](_0x4436('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4436('0xe')]('/:id',auth[_0x4436('0x7')](),controller[_0x4436('0xf')]);module[_0x4436('0x10')]=router; \ No newline at end of file +var _0x99fd=['/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','post','put'];(function(_0x58ad1d,_0xefa109){var _0x57c158=function(_0x5c85af){while(--_0x5c85af){_0x58ad1d['push'](_0x58ad1d['shift']());}};_0x57c158(++_0xefa109);}(_0x99fd,0x1e0));var _0xd99f=function(_0x254f86,_0x4cbb6a){_0x254f86=_0x254f86-0x0;var _0x3acf36=_0x99fd[_0x254f86];return _0x3acf36;};'use strict';var multer=require(_0xd99f('0x0'));var util=require('util');var path=require(_0xd99f('0x1'));var timeout=require(_0xd99f('0x2'));var express=require(_0xd99f('0x3'));var router=express[_0xd99f('0x4')]();var fs_extra=require(_0xd99f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd99f('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0xd99f('0x7')]('/',auth[_0xd99f('0x8')](),controller[_0xd99f('0x9')]);router[_0xd99f('0x7')]('/:id',auth[_0xd99f('0x8')](),controller[_0xd99f('0xa')]);router[_0xd99f('0xb')]('/',auth[_0xd99f('0x8')](),controller['create']);router[_0xd99f('0xc')](_0xd99f('0xd'),auth['isAuthenticated'](),controller[_0xd99f('0xe')]);router['delete'](_0xd99f('0xd'),auth[_0xd99f('0x8')](),controller[_0xd99f('0xf')]);module[_0xd99f('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 1359795..693b66c 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 _0x7ad4=['STRING','sequelize','externip'];(function(_0x3b3aa4,_0x814b07){var _0x3ee286=function(_0x203248){while(--_0x203248){_0x3b3aa4['push'](_0x3b3aa4['shift']());}};_0x3ee286(++_0x814b07);}(_0x7ad4,0x8b));var _0x47ad=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7ad4[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x47ad('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet',_0x47ad('0x1'),'stun','turn')},'value':{'type':Sequelize[_0x47ad('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x47ad('0x2')]}}; \ No newline at end of file +var _0xedb6=['sequelize','ENUM','externip','turn','STRING'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xedb6,0xf0));var _0x6edb=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0xedb6[_0x5a1cc9];return _0x471761;};'use strict';var Sequelize=require(_0x6edb('0x0'));module['exports']={'type':{'type':Sequelize[_0x6edb('0x1')]('localnet',_0x6edb('0x2'),'stun',_0x6edb('0x3'))},'value':{'type':Sequelize[_0x6edb('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6edb('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 8db377e..6e26eeb 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 _0x3ffb=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','name','send','index','map','Network','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','rows','show','params','keys','include','find','create','sequelize','transaction','body','findAll','type','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','utf8','render','root','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','server/files/templates/turn_multiple.ejs','format','toLowerCase','TURN','/etc/asterisk/turn_xcally.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3689c7,_0x3b8430){var _0x2af4e7=function(_0x469c24){while(--_0x469c24){_0x3689c7['push'](_0x3689c7['shift']());}};_0x2af4e7(++_0x3b8430);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x12e7cb,_0x5c66e0){_0x12e7cb=_0x12e7cb-0x0;var _0x59d202=_0x3ffb[_0x12e7cb];return _0x59d202;};'use strict';var emlformat=require(_0xb3ff('0x0'));var rimraf=require(_0xb3ff('0x1'));var zipdir=require(_0xb3ff('0x2'));var jsonpatch=require(_0xb3ff('0x3'));var rp=require(_0xb3ff('0x4'));var moment=require('moment');var BPromise=require(_0xb3ff('0x5'));var Mustache=require(_0xb3ff('0x6'));var util=require(_0xb3ff('0x7'));var path=require(_0xb3ff('0x8'));var sox=require(_0xb3ff('0x9'));var csv=require(_0xb3ff('0xa'));var ejs=require(_0xb3ff('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3ff('0xc'));var squel=require(_0xb3ff('0xd'));var crypto=require(_0xb3ff('0xe'));var jsforce=require(_0xb3ff('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3ff('0x10'));var Papa=require(_0xb3ff('0x11'));var Redis=require(_0xb3ff('0x12'));var authService=require(_0xb3ff('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb3ff('0x14'));var hardwareService=require(_0xb3ff('0x15'));var logger=require('../../config/logger')(_0xb3ff('0x16'));var utils=require(_0xb3ff('0x17'));var config=require(_0xb3ff('0x18'));var licenseUtil=require(_0xb3ff('0x19'));var db=require(_0xb3ff('0x1a'))['db'];var jayson=require(_0xb3ff('0x1b'));var client=jayson[_0xb3ff('0x1c')][_0xb3ff('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x57056a,_0x2f548b,_0x2f8f65,_0x2db25a){return new BPromise(function(_0xb7cfa0,_0xb0c045){var _0xad770=_0x2db25a||client;return _0xad770['request'](_0x57056a,_0x2f8f65)[_0xb3ff('0x1e')](function(_0x4d8826){logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,'request\x20sent');logger[_0xb3ff('0x21')](_0xb3ff('0x22'),_0x2f548b,_0xb3ff('0x23'),JSON[_0xb3ff('0x24')](_0x4d8826));if(_0x4d8826[_0xb3ff('0x25')]){if(_0x4d8826[_0xb3ff('0x25')][_0xb3ff('0x26')]===0x1f4){logger[_0xb3ff('0x25')]('Network,\x20%s,\x20%s',_0x2f548b,_0x4d8826[_0xb3ff('0x25')]['message']);return _0xb0c045(_0x4d8826[_0xb3ff('0x25')]['message']);}logger[_0xb3ff('0x25')](_0xb3ff('0x20'),_0x2f548b,_0x4d8826['error'][_0xb3ff('0x27')]);return _0xb7cfa0(_0x4d8826[_0xb3ff('0x25')]['message']);}else{logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,_0xb3ff('0x23'));_0xb7cfa0(_0x4d8826['result'][_0xb3ff('0x27')]);}})[_0xb3ff('0x28')](function(_0x4cfd0a){logger['error'](_0xb3ff('0x20'),_0x2f548b,_0x4cfd0a);_0xb0c045(_0x4cfd0a);});});}function respondWithStatusCode(_0x3d7b88,_0x3465be){_0x3465be=_0x3465be||0xcc;return function(_0x3056b9){if(_0x3056b9){return _0x3d7b88[_0xb3ff('0x29')](_0x3465be);}return _0x3d7b88[_0xb3ff('0x2a')](_0x3465be)[_0xb3ff('0x2b')]();};}function respondWithResult(_0x2dba59,_0x3f8017){_0x3f8017=_0x3f8017||0xc8;return function(_0x38f9ef){if(_0x38f9ef){return _0x2dba59[_0xb3ff('0x2a')](_0x3f8017)[_0xb3ff('0x2c')](_0x38f9ef);}};}function respondWithFilteredResult(_0x1d092d,_0x50a318){return function(_0x599f87){if(_0x599f87){var _0x22b4f6=typeof _0x50a318[_0xb3ff('0x2d')]==='undefined'&&typeof _0x50a318['limit']===_0xb3ff('0x2e');var _0x41369e=_0x599f87['count'];var _0x3466f2=_0x22b4f6?0x0:_0x50a318[_0xb3ff('0x2d')];var _0x1fb7ed=_0x22b4f6?_0x599f87[_0xb3ff('0x2f')]:_0x50a318[_0xb3ff('0x2d')]+_0x50a318[_0xb3ff('0x30')];var _0x341c9c;if(_0x1fb7ed>=_0x41369e){_0x1fb7ed=_0x41369e;_0x341c9c=0xc8;}else{_0x341c9c=0xce;}_0x1d092d[_0xb3ff('0x2a')](_0x341c9c);return _0x1d092d[_0xb3ff('0x31')]('Content-Range',_0x3466f2+'-'+_0x1fb7ed+'/'+_0x41369e)[_0xb3ff('0x2c')](_0x599f87);}return null;};}function patchUpdates(_0x2827eb){return function(_0x1f47f9){try{jsonpatch[_0xb3ff('0x32')](_0x1f47f9,_0x2827eb,!![]);}catch(_0x4ace33){return BPromise[_0xb3ff('0x33')](_0x4ace33);}return _0x1f47f9[_0xb3ff('0x34')]();};}function saveUpdates(_0x2c2059,_0x406870){return function(_0x5104d8){if(_0x5104d8){return _0x5104d8['update'](_0x2c2059)['then'](function(_0x2990e3){return _0x2990e3;});}return null;};}function removeEntity(_0x67f1a6,_0x11e7c6){return function(_0x3cefd4){if(_0x3cefd4){return _0x3cefd4[_0xb3ff('0x35')]()[_0xb3ff('0x1e')](function(){_0x67f1a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57adce,_0xcbfa6e){return function(_0x1bb717){if(!_0x1bb717){_0x57adce[_0xb3ff('0x29')](0x194);}return _0x1bb717;};}function handleError(_0x44addf,_0x503a31){_0x503a31=_0x503a31||0x1f4;return function(_0x37352a){logger[_0xb3ff('0x25')](_0x37352a['stack']);if(_0x37352a[_0xb3ff('0x36')]){delete _0x37352a[_0xb3ff('0x36')];}_0x44addf['status'](_0x503a31)[_0xb3ff('0x37')](_0x37352a);};}exports[_0xb3ff('0x38')]=function(_0xa67e66,_0x316ca3){var _0x49b156={},_0x5469ff={},_0xa98669={'count':0x0,'rows':[]};var _0x2f34aa=_[_0xb3ff('0x39')](db[_0xb3ff('0x3a')]['rawAttributes'],function(_0x3d70ab){return{'name':_0x3d70ab[_0xb3ff('0x3b')],'type':_0x3d70ab['type']['key']};});_0x5469ff[_0xb3ff('0x3c')]=_['map'](_0x2f34aa,'name');_0x5469ff[_0xb3ff('0x3d')]=_['keys'](_0xa67e66[_0xb3ff('0x3d')]);_0x5469ff['filters']=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],_0x5469ff[_0xb3ff('0x3d')]);_0x49b156[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],qs['fields'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x49b156[_0xb3ff('0x3f')]=_0x49b156['attributes'][_0xb3ff('0x41')]?_0x49b156[_0xb3ff('0x3f')]:_0x5469ff['model'];if(!_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x42')](_0xb3ff('0x43'))){_0x49b156[_0xb3ff('0x30')]=qs['limit'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x30')]);_0x49b156[_0xb3ff('0x2d')]=qs[_0xb3ff('0x2d')](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x2d')]);}_0x49b156['order']=qs['sort'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x44')]);_0x49b156[_0xb3ff('0x45')]=qs[_0xb3ff('0x46')](_[_0xb3ff('0x47')](_0xa67e66['query'],_0x5469ff[_0xb3ff('0x46')]),_0x2f34aa);if(_0xa67e66['query']['filter']){_0x49b156[_0xb3ff('0x45')]=_['merge'](_0x49b156[_0xb3ff('0x45')],{'$or':_[_0xb3ff('0x39')](_0x2f34aa,function(_0x28a021){if(_0x28a021['type']!==_0xb3ff('0x48')){var _0xc42e40={};_0xc42e40[_0x28a021[_0xb3ff('0x36')]]={'$like':'%'+_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x49')]+'%'};return _0xc42e40;}})});}_0x49b156=_['merge']({},_0x49b156,_0xa67e66[_0xb3ff('0x4a')]);var _0x4a23d1={'where':_0x49b156[_0xb3ff('0x45')]};return db['Network'][_0xb3ff('0x2f')](_0x4a23d1)[_0xb3ff('0x1e')](function(_0x57e5e7){_0xa98669[_0xb3ff('0x2f')]=_0x57e5e7;if(_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x4b')]){_0x49b156['include']=[{'all':!![]}];}return db[_0xb3ff('0x3a')]['findAll'](_0x49b156);})[_0xb3ff('0x1e')](function(_0x89fc8a){_0xa98669[_0xb3ff('0x4c')]=_0x89fc8a;return _0xa98669;})[_0xb3ff('0x1e')](respondWithFilteredResult(_0x316ca3,_0x49b156))[_0xb3ff('0x28')](handleError(_0x316ca3,null));};exports[_0xb3ff('0x4d')]=function(_0x3253c4,_0x549b8a){var _0x206fea={'raw':!![],'where':{'id':_0x3253c4[_0xb3ff('0x4e')]['id']}},_0x2eba0c={};_0x2eba0c[_0xb3ff('0x3c')]=_['keys'](db['Network']['rawAttributes']);_0x2eba0c[_0xb3ff('0x3d')]=_[_0xb3ff('0x4f')](_0x3253c4[_0xb3ff('0x3d')]);_0x2eba0c[_0xb3ff('0x46')]=_['intersection'](_0x2eba0c[_0xb3ff('0x3c')],_0x2eba0c[_0xb3ff('0x3d')]);_0x206fea[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x2eba0c['model'],qs[_0xb3ff('0x40')](_0x3253c4[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x206fea['attributes']=_0x206fea['attributes'][_0xb3ff('0x41')]?_0x206fea['attributes']:_0x2eba0c[_0xb3ff('0x3c')];if(_0x3253c4['query'][_0xb3ff('0x4b')]){_0x206fea[_0xb3ff('0x50')]=[{'all':!![]}];}_0x206fea=_['merge']({},_0x206fea,_0x3253c4[_0xb3ff('0x4a')]);return db[_0xb3ff('0x3a')][_0xb3ff('0x51')](_0x206fea)[_0xb3ff('0x1e')](handleEntityNotFound(_0x549b8a,null))['then'](respondWithResult(_0x549b8a,null))[_0xb3ff('0x28')](handleError(_0x549b8a,null));};exports[_0xb3ff('0x52')]=function(_0x5b2138,_0x5cdffd,_0x117311){var _0x5bebb6;return db[_0xb3ff('0x53')][_0xb3ff('0x54')](function(_0x160d12){return db[_0xb3ff('0x3a')][_0xb3ff('0x52')](_0x5b2138[_0xb3ff('0x55')],{'raw':!![]})[_0xb3ff('0x1e')](function(_0x485ba7){_0x5bebb6=_0x485ba7;return db[_0xb3ff('0x3a')][_0xb3ff('0x56')]({'where':{'type':_0x5b2138['body'][_0xb3ff('0x57')]},'raw':!![]});})[_0xb3ff('0x1e')](function(_0x45188e){if(_0x5bebb6[_0xb3ff('0x57')][_0xb3ff('0x58')]()==_0xb3ff('0x59')){var _0x2bac0e=fs[_0xb3ff('0x5a')](path[_0xb3ff('0x5b')](config['root'],_0xb3ff('0x5c')),'utf8');var _0x21d700=ejs['render'](_0x2bac0e,{'networks':_0x45188e||[]});fs[_0xb3ff('0x5d')](_0xb3ff('0x5e'),_0x21d700);return respondWithRpcPromise(_0xb3ff('0x5f'),_0xb3ff('0x52'),{'module':_0xb3ff('0x60')});}else if(_0x5bebb6['type'][_0xb3ff('0x58')]()=='TURN'){var _0x388cbc=fs['readFileSync'](path[_0xb3ff('0x5b')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb3ff('0x61'));var _0x5fdd1b=ejs[_0xb3ff('0x62')](_0x388cbc,{'networks':_0x45188e||[]});fs[_0xb3ff('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x5fdd1b);return respondWithRpcPromise('Reload',_0xb3ff('0x52'),{'module':'res_stun_monitor.so'});}else{var _0x40db9b=fs[_0xb3ff('0x5a')](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],_0xb3ff('0x64')),_0xb3ff('0x61'));var _0x45dd0c=ejs[_0xb3ff('0x62')](_0x40db9b,{'networks':_0x45188e||[]});fs['writeFileSync'](util['format'](_0xb3ff('0x65'),_0x5b2138[_0xb3ff('0x55')][_0xb3ff('0x57')]['toLowerCase']()),_0x45dd0c);return respondWithRpcPromise('Reload','create',{'module':_0xb3ff('0x66')});}return null;})[_0xb3ff('0x1e')](function(){return _0x5bebb6;});})[_0xb3ff('0x1e')](respondWithResult(_0x5cdffd,0xc9))[_0xb3ff('0x28')](handleError(_0x5cdffd,null));};exports[_0xb3ff('0x67')]=function(_0x3f5877,_0x2255f8,_0x554df9){var _0x236622;return db[_0xb3ff('0x53')][_0xb3ff('0x54')](function(_0x48ad09){return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0x3f5877['params']['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0x2255f8,null))['then'](saveUpdates(_0x3f5877[_0xb3ff('0x55')],null))[_0xb3ff('0x1e')](function(_0x371212){if(_0x371212){_0x236622=_0x371212;return db[_0xb3ff('0x3a')][_0xb3ff('0x56')]({'where':{'type':_0x236622['type']},'raw':!![]});}return null;})[_0xb3ff('0x1e')](function(_0x2123e7){if(_0x236622['type'][_0xb3ff('0x58')]()==_0xb3ff('0x59')){var _0x19b866=fs[_0xb3ff('0x5a')](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x14c8a2=ejs[_0xb3ff('0x62')](_0x19b866,{'networks':_0x2123e7||[]});fs['writeFileSync'](_0xb3ff('0x5e'),_0x14c8a2);return respondWithRpcPromise(_0xb3ff('0x5f'),_0xb3ff('0x67'),{'module':_0xb3ff('0x60')});}else if(_0x236622['type']['toUpperCase']()=='TURN'){var _0x72b470=fs[_0xb3ff('0x5a')](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],_0xb3ff('0x68')),_0xb3ff('0x61'));var _0x3fab99=ejs['render'](_0x72b470,{'networks':_0x2123e7||[]});fs[_0xb3ff('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x3fab99);return respondWithRpcPromise(_0xb3ff('0x5f'),'update',{'module':_0xb3ff('0x60')});}else{var _0x1d6deb=fs['readFileSync'](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],_0xb3ff('0x64')),'utf8');var _0x3509b=ejs[_0xb3ff('0x62')](_0x1d6deb,{'networks':_0x2123e7||[]});fs[_0xb3ff('0x5d')](util[_0xb3ff('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x3f5877[_0xb3ff('0x55')]['type'][_0xb3ff('0x6a')]()),_0x3509b);return respondWithRpcPromise(_0xb3ff('0x5f'),_0xb3ff('0x67'),{'module':_0xb3ff('0x66')});}return null;})[_0xb3ff('0x1e')](function(_0x4c02b7){if(_0x4c02b7){return _0x236622;}return null;});})['then'](respondWithResult(_0x2255f8,null))['catch'](handleError(_0x2255f8,null));};exports[_0xb3ff('0x35')]=function(_0x4e1546,_0x4618c9,_0x4833aa){var _0x5d116e;return db['Network']['find']({'where':{'id':_0x4e1546[_0xb3ff('0x4e')]['id']}})['then'](function(_0x2c0458){_0x5d116e=_0x2c0458;return _0x2c0458;})[_0xb3ff('0x1e')](handleEntityNotFound(_0x4618c9,null))[_0xb3ff('0x1e')](removeEntity(_0x4618c9,null))['then'](function(){if(_0x5d116e){return db['Network'][_0xb3ff('0x56')]({'where':{'type':_0x5d116e[_0xb3ff('0x57')]},'raw':!![]});}})[_0xb3ff('0x1e')](function(_0x501882){if(_0x5d116e[_0xb3ff('0x57')][_0xb3ff('0x58')]()=='STUN'){var _0x301a5d=fs['readFileSync'](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x310fda=ejs['render'](_0x301a5d,{'networks':_0x501882||[]});fs[_0xb3ff('0x5d')](_0xb3ff('0x5e'),_0x310fda);return respondWithRpcPromise(_0xb3ff('0x5f'),_0xb3ff('0x35'),{'module':_0xb3ff('0x60')});}else if(_0x5d116e['type'][_0xb3ff('0x58')]()==_0xb3ff('0x6b')){var _0x1672c7=fs['readFileSync'](path[_0xb3ff('0x5b')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xb3ff('0x61'));var _0xc67687=ejs[_0xb3ff('0x62')](_0x1672c7,{'networks':_0x501882||[]});fs[_0xb3ff('0x5d')](_0xb3ff('0x6c'),_0xc67687);return respondWithRpcPromise('Reload','destroy',{'module':_0xb3ff('0x60')});}else{var _0x3eb7f4=fs[_0xb3ff('0x5a')](path[_0xb3ff('0x5b')](config[_0xb3ff('0x63')],_0xb3ff('0x64')),_0xb3ff('0x61'));var _0x23a1fa=ejs[_0xb3ff('0x62')](_0x3eb7f4,{'networks':_0x501882||[]});fs[_0xb3ff('0x5d')](util[_0xb3ff('0x69')](_0xb3ff('0x65'),_0x4e1546[_0xb3ff('0x55')][_0xb3ff('0x57')]['toLowerCase']()),_0x23a1fa);return respondWithRpcPromise(_0xb3ff('0x5f'),'destroy',{'module':_0xb3ff('0x66')});}return null;})[_0xb3ff('0x28')](handleError(_0x4618c9,null));}; \ No newline at end of file +var _0xe14f=['body','findAll','toUpperCase','STUN','readFileSync','utf8','render','Reload','res_stun_monitor.so','join','root','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','format','toLowerCase','chan_sip.so','transaction','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','end','stack','name','map','Network','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','type','VIRTUAL','filter','merge','includeAll','rows','params','rawAttributes','options','find','create','sequelize'];(function(_0xd14f8e,_0x18396d){var _0x1cb270=function(_0x457065){while(--_0x457065){_0xd14f8e['push'](_0xd14f8e['shift']());}};_0x1cb270(++_0x18396d);}(_0xe14f,0xea));var _0xfe14=function(_0x2319d4,_0x3423b6){_0x2319d4=_0x2319d4-0x0;var _0x32e25b=_0xe14f[_0x2319d4];return _0x32e25b;};'use strict';var emlformat=require(_0xfe14('0x0'));var rimraf=require(_0xfe14('0x1'));var zipdir=require(_0xfe14('0x2'));var jsonpatch=require(_0xfe14('0x3'));var rp=require(_0xfe14('0x4'));var moment=require(_0xfe14('0x5'));var BPromise=require(_0xfe14('0x6'));var Mustache=require(_0xfe14('0x7'));var util=require(_0xfe14('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfe14('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe14('0xa'));var _=require(_0xfe14('0xb'));var squel=require(_0xfe14('0xc'));var crypto=require(_0xfe14('0xd'));var jsforce=require(_0xfe14('0xe'));var deskjs=require(_0xfe14('0xf'));var toCsv=require(_0xfe14('0x9'));var querystring=require(_0xfe14('0x10'));var Papa=require(_0xfe14('0x11'));var Redis=require('ioredis');var authService=require(_0xfe14('0x12'));var qs=require(_0xfe14('0x13'));var as=require(_0xfe14('0x14'));var hardwareService=require(_0xfe14('0x15'));var logger=require(_0xfe14('0x16'))(_0xfe14('0x17'));var utils=require('../../config/utils');var config=require(_0xfe14('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe14('0x19'))['db'];var jayson=require(_0xfe14('0x1a'));var client=jayson[_0xfe14('0x1b')][_0xfe14('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x174ed0,_0x390736,_0x56ad1f,_0x4aabda){return new BPromise(function(_0x39799a,_0x43db84){var _0x40e4c9=_0x4aabda||client;return _0x40e4c9['request'](_0x174ed0,_0x56ad1f)[_0xfe14('0x1d')](function(_0x546d82){logger[_0xfe14('0x1e')](_0xfe14('0x1f'),_0x390736,_0xfe14('0x20'));logger[_0xfe14('0x21')](_0xfe14('0x22'),_0x390736,_0xfe14('0x20'),JSON[_0xfe14('0x23')](_0x546d82));if(_0x546d82[_0xfe14('0x24')]){if(_0x546d82[_0xfe14('0x24')]['code']===0x1f4){logger['error'](_0xfe14('0x1f'),_0x390736,_0x546d82[_0xfe14('0x24')][_0xfe14('0x25')]);return _0x43db84(_0x546d82[_0xfe14('0x24')][_0xfe14('0x25')]);}logger[_0xfe14('0x24')](_0xfe14('0x1f'),_0x390736,_0x546d82[_0xfe14('0x24')]['message']);return _0x39799a(_0x546d82[_0xfe14('0x24')][_0xfe14('0x25')]);}else{logger[_0xfe14('0x1e')](_0xfe14('0x1f'),_0x390736,_0xfe14('0x20'));_0x39799a(_0x546d82['result'][_0xfe14('0x25')]);}})[_0xfe14('0x26')](function(_0x41120e){logger[_0xfe14('0x24')](_0xfe14('0x1f'),_0x390736,_0x41120e);_0x43db84(_0x41120e);});});}function respondWithStatusCode(_0x48299e,_0x1a8620){_0x1a8620=_0x1a8620||0xcc;return function(_0x400f5d){if(_0x400f5d){return _0x48299e[_0xfe14('0x27')](_0x1a8620);}return _0x48299e[_0xfe14('0x28')](_0x1a8620)['end']();};}function respondWithResult(_0x4f4750,_0x12ab29){_0x12ab29=_0x12ab29||0xc8;return function(_0x185569){if(_0x185569){return _0x4f4750[_0xfe14('0x28')](_0x12ab29)[_0xfe14('0x29')](_0x185569);}};}function respondWithFilteredResult(_0xbd2789,_0x422e9e){return function(_0x28aa60){if(_0x28aa60){var _0x334dff=typeof _0x422e9e['offset']===_0xfe14('0x2a')&&typeof _0x422e9e[_0xfe14('0x2b')]===_0xfe14('0x2a');var _0x247a71=_0x28aa60[_0xfe14('0x2c')];var _0xce2ec6=_0x334dff?0x0:_0x422e9e[_0xfe14('0x2d')];var _0xfa695a=_0x334dff?_0x28aa60[_0xfe14('0x2c')]:_0x422e9e['offset']+_0x422e9e[_0xfe14('0x2b')];var _0xf23d3b;if(_0xfa695a>=_0x247a71){_0xfa695a=_0x247a71;_0xf23d3b=0xc8;}else{_0xf23d3b=0xce;}_0xbd2789['status'](_0xf23d3b);return _0xbd2789[_0xfe14('0x2e')](_0xfe14('0x2f'),_0xce2ec6+'-'+_0xfa695a+'/'+_0x247a71)[_0xfe14('0x29')](_0x28aa60);}return null;};}function patchUpdates(_0x278805){return function(_0x353f9d){try{jsonpatch[_0xfe14('0x30')](_0x353f9d,_0x278805,!![]);}catch(_0x4c680d){return BPromise['reject'](_0x4c680d);}return _0x353f9d[_0xfe14('0x31')]();};}function saveUpdates(_0x10317c,_0x109a94){return function(_0x1defc1){if(_0x1defc1){return _0x1defc1[_0xfe14('0x32')](_0x10317c)[_0xfe14('0x1d')](function(_0x4d32e3){return _0x4d32e3;});}return null;};}function removeEntity(_0x54e01d,_0x142747){return function(_0x5450a5){if(_0x5450a5){return _0x5450a5['destroy']()[_0xfe14('0x1d')](function(){_0x54e01d[_0xfe14('0x28')](0xcc)[_0xfe14('0x33')]();});}};}function handleEntityNotFound(_0x7ae01c,_0x2e56e1){return function(_0x1d4336){if(!_0x1d4336){_0x7ae01c[_0xfe14('0x27')](0x194);}return _0x1d4336;};}function handleError(_0x5359c4,_0x4f81d2){_0x4f81d2=_0x4f81d2||0x1f4;return function(_0x231181){logger[_0xfe14('0x24')](_0x231181[_0xfe14('0x34')]);if(_0x231181[_0xfe14('0x35')]){delete _0x231181[_0xfe14('0x35')];}_0x5359c4[_0xfe14('0x28')](_0x4f81d2)['send'](_0x231181);};}exports['index']=function(_0xeb954b,_0x5f58f1){var _0x557bf5={},_0x188959={},_0x26a534={'count':0x0,'rows':[]};var _0x42a90e=_[_0xfe14('0x36')](db[_0xfe14('0x37')]['rawAttributes'],function(_0x13538b){return{'name':_0x13538b[_0xfe14('0x38')],'type':_0x13538b['type'][_0xfe14('0x39')]};});_0x188959[_0xfe14('0x3a')]=_[_0xfe14('0x36')](_0x42a90e,'name');_0x188959['query']=_[_0xfe14('0x3b')](_0xeb954b[_0xfe14('0x3c')]);_0x188959[_0xfe14('0x3d')]=_[_0xfe14('0x3e')](_0x188959[_0xfe14('0x3a')],_0x188959[_0xfe14('0x3c')]);_0x557bf5[_0xfe14('0x3f')]=_[_0xfe14('0x3e')](_0x188959[_0xfe14('0x3a')],qs[_0xfe14('0x40')](_0xeb954b[_0xfe14('0x3c')]['fields']));_0x557bf5['attributes']=_0x557bf5['attributes'][_0xfe14('0x41')]?_0x557bf5['attributes']:_0x188959[_0xfe14('0x3a')];if(!_0xeb954b[_0xfe14('0x3c')][_0xfe14('0x42')]('nolimit')){_0x557bf5[_0xfe14('0x2b')]=qs[_0xfe14('0x2b')](_0xeb954b[_0xfe14('0x3c')][_0xfe14('0x2b')]);_0x557bf5[_0xfe14('0x2d')]=qs['offset'](_0xeb954b[_0xfe14('0x3c')][_0xfe14('0x2d')]);}_0x557bf5[_0xfe14('0x43')]=qs['sort'](_0xeb954b['query']['sort']);_0x557bf5[_0xfe14('0x44')]=qs[_0xfe14('0x3d')](_['pick'](_0xeb954b[_0xfe14('0x3c')],_0x188959['filters']),_0x42a90e);if(_0xeb954b[_0xfe14('0x3c')]['filter']){_0x557bf5[_0xfe14('0x44')]=_['merge'](_0x557bf5[_0xfe14('0x44')],{'$or':_[_0xfe14('0x36')](_0x42a90e,function(_0xe80dba){if(_0xe80dba[_0xfe14('0x45')]!==_0xfe14('0x46')){var _0x3c26d2={};_0x3c26d2[_0xe80dba[_0xfe14('0x35')]]={'$like':'%'+_0xeb954b['query'][_0xfe14('0x47')]+'%'};return _0x3c26d2;}})});}_0x557bf5=_[_0xfe14('0x48')]({},_0x557bf5,_0xeb954b['options']);var _0xc7fa5f={'where':_0x557bf5[_0xfe14('0x44')]};return db[_0xfe14('0x37')][_0xfe14('0x2c')](_0xc7fa5f)['then'](function(_0x48289c){_0x26a534[_0xfe14('0x2c')]=_0x48289c;if(_0xeb954b[_0xfe14('0x3c')][_0xfe14('0x49')]){_0x557bf5['include']=[{'all':!![]}];}return db[_0xfe14('0x37')]['findAll'](_0x557bf5);})[_0xfe14('0x1d')](function(_0x21b19f){_0x26a534[_0xfe14('0x4a')]=_0x21b19f;return _0x26a534;})[_0xfe14('0x1d')](respondWithFilteredResult(_0x5f58f1,_0x557bf5))[_0xfe14('0x26')](handleError(_0x5f58f1,null));};exports['show']=function(_0x42b43e,_0x21c2f2){var _0x5e4ae6={'raw':!![],'where':{'id':_0x42b43e[_0xfe14('0x4b')]['id']}},_0x427453={};_0x427453['model']=_[_0xfe14('0x3b')](db['Network'][_0xfe14('0x4c')]);_0x427453['query']=_[_0xfe14('0x3b')](_0x42b43e['query']);_0x427453[_0xfe14('0x3d')]=_['intersection'](_0x427453['model'],_0x427453[_0xfe14('0x3c')]);_0x5e4ae6['attributes']=_[_0xfe14('0x3e')](_0x427453[_0xfe14('0x3a')],qs[_0xfe14('0x40')](_0x42b43e['query'][_0xfe14('0x40')]));_0x5e4ae6['attributes']=_0x5e4ae6[_0xfe14('0x3f')]['length']?_0x5e4ae6[_0xfe14('0x3f')]:_0x427453[_0xfe14('0x3a')];if(_0x42b43e['query'][_0xfe14('0x49')]){_0x5e4ae6['include']=[{'all':!![]}];}_0x5e4ae6=_[_0xfe14('0x48')]({},_0x5e4ae6,_0x42b43e[_0xfe14('0x4d')]);return db['Network'][_0xfe14('0x4e')](_0x5e4ae6)[_0xfe14('0x1d')](handleEntityNotFound(_0x21c2f2,null))[_0xfe14('0x1d')](respondWithResult(_0x21c2f2,null))[_0xfe14('0x26')](handleError(_0x21c2f2,null));};exports[_0xfe14('0x4f')]=function(_0x4ce28f,_0x46ca99,_0x25391b){var _0xa3b9c8;return db[_0xfe14('0x50')]['transaction'](function(_0x182236){return db[_0xfe14('0x37')]['create'](_0x4ce28f[_0xfe14('0x51')],{'raw':!![]})[_0xfe14('0x1d')](function(_0x420da8){_0xa3b9c8=_0x420da8;return db[_0xfe14('0x37')][_0xfe14('0x52')]({'where':{'type':_0x4ce28f[_0xfe14('0x51')]['type']},'raw':!![]});})[_0xfe14('0x1d')](function(_0x47f763){if(_0xa3b9c8[_0xfe14('0x45')][_0xfe14('0x53')]()==_0xfe14('0x54')){var _0x281cc6=fs[_0xfe14('0x55')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xfe14('0x56'));var _0x34c667=ejs[_0xfe14('0x57')](_0x281cc6,{'networks':_0x47f763||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x34c667);return respondWithRpcPromise(_0xfe14('0x58'),'create',{'module':_0xfe14('0x59')});}else if(_0xa3b9c8[_0xfe14('0x45')][_0xfe14('0x53')]()=='TURN'){var _0x41e70c=fs[_0xfe14('0x55')](path[_0xfe14('0x5a')](config[_0xfe14('0x5b')],_0xfe14('0x5c')),_0xfe14('0x56'));var _0x1973a4=ejs['render'](_0x41e70c,{'networks':_0x47f763||[]});fs[_0xfe14('0x5d')](_0xfe14('0x5e'),_0x1973a4);return respondWithRpcPromise('Reload',_0xfe14('0x4f'),{'module':_0xfe14('0x59')});}else{var _0x57b9f1=fs['readFileSync'](path[_0xfe14('0x5a')](config[_0xfe14('0x5b')],'server/files/templates/network.ejs'),_0xfe14('0x56'));var _0x4a29ad=ejs[_0xfe14('0x57')](_0x57b9f1,{'networks':_0x47f763||[]});fs[_0xfe14('0x5d')](util[_0xfe14('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x4ce28f['body']['type'][_0xfe14('0x60')]()),_0x4a29ad);return respondWithRpcPromise(_0xfe14('0x58'),'create',{'module':_0xfe14('0x61')});}return null;})['then'](function(){return _0xa3b9c8;});})[_0xfe14('0x1d')](respondWithResult(_0x46ca99,0xc9))[_0xfe14('0x26')](handleError(_0x46ca99,null));};exports[_0xfe14('0x32')]=function(_0x2b552b,_0x3e2569,_0x1100e2){var _0x5bcbe6;return db[_0xfe14('0x50')][_0xfe14('0x62')](function(_0xd5556d){return db['Network'][_0xfe14('0x4e')]({'where':{'id':_0x2b552b[_0xfe14('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e2569,null))[_0xfe14('0x1d')](saveUpdates(_0x2b552b[_0xfe14('0x51')],null))[_0xfe14('0x1d')](function(_0x4f6da4){if(_0x4f6da4){_0x5bcbe6=_0x4f6da4;return db[_0xfe14('0x37')][_0xfe14('0x52')]({'where':{'type':_0x5bcbe6[_0xfe14('0x45')]},'raw':!![]});}return null;})['then'](function(_0x488d89){if(_0x5bcbe6[_0xfe14('0x45')][_0xfe14('0x53')]()=='STUN'){var _0x85d4bd=fs[_0xfe14('0x55')](path[_0xfe14('0x5a')](config['root'],_0xfe14('0x63')),_0xfe14('0x56'));var _0x140540=ejs[_0xfe14('0x57')](_0x85d4bd,{'networks':_0x488d89||[]});fs[_0xfe14('0x5d')](_0xfe14('0x64'),_0x140540);return respondWithRpcPromise('Reload',_0xfe14('0x32'),{'module':_0xfe14('0x59')});}else if(_0x5bcbe6[_0xfe14('0x45')][_0xfe14('0x53')]()==_0xfe14('0x65')){var _0x30211b=fs[_0xfe14('0x55')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0xfe14('0x56'));var _0x448918=ejs['render'](_0x30211b,{'networks':_0x488d89||[]});fs[_0xfe14('0x5d')](_0xfe14('0x5e'),_0x448918);return respondWithRpcPromise(_0xfe14('0x58'),'update',{'module':_0xfe14('0x59')});}else{var _0x2065f6=fs[_0xfe14('0x55')](path[_0xfe14('0x5a')](config[_0xfe14('0x5b')],_0xfe14('0x66')),_0xfe14('0x56'));var _0x4d1f61=ejs[_0xfe14('0x57')](_0x2065f6,{'networks':_0x488d89||[]});fs['writeFileSync'](util[_0xfe14('0x5f')](_0xfe14('0x67'),_0x2b552b[_0xfe14('0x51')][_0xfe14('0x45')]['toLowerCase']()),_0x4d1f61);return respondWithRpcPromise(_0xfe14('0x58'),'update',{'module':_0xfe14('0x61')});}return null;})['then'](function(_0x1b479c){if(_0x1b479c){return _0x5bcbe6;}return null;});})[_0xfe14('0x1d')](respondWithResult(_0x3e2569,null))[_0xfe14('0x26')](handleError(_0x3e2569,null));};exports[_0xfe14('0x68')]=function(_0x5ee146,_0x1f0ac0,_0x8972c4){var _0x59a81a;return db[_0xfe14('0x37')][_0xfe14('0x4e')]({'where':{'id':_0x5ee146[_0xfe14('0x4b')]['id']}})['then'](function(_0x80321a){_0x59a81a=_0x80321a;return _0x80321a;})[_0xfe14('0x1d')](handleEntityNotFound(_0x1f0ac0,null))[_0xfe14('0x1d')](removeEntity(_0x1f0ac0,null))[_0xfe14('0x1d')](function(){if(_0x59a81a){return db[_0xfe14('0x37')][_0xfe14('0x52')]({'where':{'type':_0x59a81a[_0xfe14('0x45')]},'raw':!![]});}})['then'](function(_0x11b4b8){if(_0x59a81a['type'][_0xfe14('0x53')]()==_0xfe14('0x54')){var _0x3f14d9=fs['readFileSync'](path[_0xfe14('0x5a')](config[_0xfe14('0x5b')],_0xfe14('0x63')),'utf8');var _0x33a554=ejs['render'](_0x3f14d9,{'networks':_0x11b4b8||[]});fs[_0xfe14('0x5d')](_0xfe14('0x64'),_0x33a554);return respondWithRpcPromise(_0xfe14('0x58'),_0xfe14('0x68'),{'module':_0xfe14('0x59')});}else if(_0x59a81a[_0xfe14('0x45')][_0xfe14('0x53')]()=='TURN'){var _0x5cb81c=fs[_0xfe14('0x55')](path['join'](config[_0xfe14('0x5b')],'server/files/templates/turn_multiple.ejs'),_0xfe14('0x56'));var _0x5be6db=ejs[_0xfe14('0x57')](_0x5cb81c,{'networks':_0x11b4b8||[]});fs['writeFileSync'](_0xfe14('0x5e'),_0x5be6db);return respondWithRpcPromise(_0xfe14('0x58'),_0xfe14('0x68'),{'module':_0xfe14('0x59')});}else{var _0x4ee094=fs[_0xfe14('0x55')](path[_0xfe14('0x5a')](config[_0xfe14('0x5b')],_0xfe14('0x66')),_0xfe14('0x56'));var _0xb393d4=ejs[_0xfe14('0x57')](_0x4ee094,{'networks':_0x11b4b8||[]});fs[_0xfe14('0x5d')](util['format'](_0xfe14('0x67'),_0x5ee146['body'][_0xfe14('0x45')]['toLowerCase']()),_0xb393d4);return respondWithRpcPromise(_0xfe14('0x58'),_0xfe14('0x68'),{'module':_0xfe14('0x61')});}return null;})['catch'](handleError(_0x1f0ac0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 11e4b8e..d1b0c48 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 _0xf290=['Network','network','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x50bf21,_0xb9f7b2){var _0x220238=function(_0x5ce4be){while(--_0x5ce4be){_0x50bf21['push'](_0x50bf21['shift']());}};_0x220238(++_0xb9f7b2);}(_0xf290,0xde));var _0x0f29=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xf290[_0x2ca9d4];return _0x258956;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var logger=require('../../config/logger')(_0x0f29('0x1'));var moment=require('moment');var BPromise=require(_0x0f29('0x2'));var rp=require(_0x0f29('0x3'));var fs=require('fs');var path=require(_0x0f29('0x4'));var rimraf=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var attributes=require('./network.attributes');module[_0x0f29('0x7')]=function(_0x4911fb,_0x2d5350){return _0x4911fb[_0x0f29('0x8')](_0x0f29('0x9'),attributes,{'tableName':_0x0f29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./network.attributes','exports','network','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x122fe6,_0x4ac758){var _0x36b7d2=function(_0x12fca2){while(--_0x12fca2){_0x122fe6['push'](_0x122fe6['shift']());}};_0x36b7d2(++_0x4ac758);}(_0xb903,0x185));var _0x3b90=function(_0x54deee,_0x1fc573){_0x54deee=_0x54deee-0x0;var _0x3211f3=_0xb903[_0x54deee];return _0x3211f3;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('Network',attributes,{'tableName':_0x3b90('0xb'),'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 dcdea66..8125f9a 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 _0x7a54=['info','Network,\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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x29aaee,_0x1078ba){_0x29aaee=_0x29aaee-0x0;var _0x4a6e6b=_0x7a54[_0x29aaee];return _0x4a6e6b;};'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')]('Network,\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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xbc07d,_0x165141){var _0x437941=function(_0xdefec2){while(--_0xdefec2){_0xbc07d['push'](_0xbc07d['shift']());}};_0x437941(++_0x165141);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 9b28759..1fa7276 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 _0x66ea=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','multer','util'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x66ea,0x67));var _0xa66e=function(_0x3bf3a1,_0x379a3b){_0x3bf3a1=_0x3bf3a1-0x0;var _0x4f936d=_0x66ea[_0x3bf3a1];return _0x4f936d;};'use strict';var multer=require(_0xa66e('0x0'));var util=require(_0xa66e('0x1'));var path=require(_0xa66e('0x2'));var timeout=require(_0xa66e('0x3'));var express=require(_0xa66e('0x4'));var router=express['Router']();var fs_extra=require(_0xa66e('0x5'));var auth=require(_0xa66e('0x6'));var interaction=require(_0xa66e('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xa66e('0x8')]('/',auth[_0xa66e('0x9')](),controller[_0xa66e('0xa')]);router[_0xa66e('0x8')](_0xa66e('0xb'),auth[_0xa66e('0x9')](),controller[_0xa66e('0xc')]);router[_0xa66e('0x8')](_0xa66e('0xd'),auth[_0xa66e('0x9')](),controller['show']);router[_0xa66e('0x8')](_0xa66e('0xe'),auth[_0xa66e('0x9')](),controller['getDispositions']);router['get'](_0xa66e('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xa66e('0x8')](_0xa66e('0x10'),auth[_0xa66e('0x9')](),controller[_0xa66e('0x11')]);router[_0xa66e('0x8')](_0xa66e('0x12'),auth[_0xa66e('0x9')](),controller['getInteractions']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xa66e('0x13')]);router[_0xa66e('0x14')]('/',auth[_0xa66e('0x9')](),controller[_0xa66e('0x15')]);router['post'](_0xa66e('0xe'),auth['isAuthenticated'](),controller[_0xa66e('0x16')]);router[_0xa66e('0x14')](_0xa66e('0xf'),auth['isAuthenticated'](),controller[_0xa66e('0x17')]);router['post'](_0xa66e('0x18'),controller[_0xa66e('0x19')]);router['post']('/:id/applications',auth[_0xa66e('0x9')](),controller[_0xa66e('0x1a')]);router[_0xa66e('0x14')](_0xa66e('0x1b'),auth[_0xa66e('0x9')](),controller[_0xa66e('0x1c')]);router[_0xa66e('0x14')]('/:id/send',auth[_0xa66e('0x9')](),controller['send']);router[_0xa66e('0x1d')](_0xa66e('0xd'),auth['isAuthenticated'](),controller[_0xa66e('0x1e')]);router[_0xa66e('0x1f')](_0xa66e('0xd'),auth[_0xa66e('0x9')](),controller[_0xa66e('0x20')]);router[_0xa66e('0x1f')](_0xa66e('0xe'),auth['isAuthenticated'](),controller[_0xa66e('0x21')]);router[_0xa66e('0x1f')](_0xa66e('0xf'),auth[_0xa66e('0x9')](),controller[_0xa66e('0x22')]);router['delete']('/:id/users',auth[_0xa66e('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xdfe0=['/:id','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','/:id/send','send'];(function(_0x497a57,_0x169a05){var _0x4d8ddc=function(_0xe951af){while(--_0xe951af){_0x497a57['push'](_0x497a57['shift']());}};_0x4d8ddc(++_0x169a05);}(_0xdfe0,0x19d));var _0x0dfe=function(_0x3e9768,_0x3aee38){_0x3e9768=_0x3e9768-0x0;var _0x2ef6c1=_0xdfe0[_0x3e9768];return _0x2ef6c1;};'use strict';var multer=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));var path=require(_0x0dfe('0x2'));var timeout=require(_0x0dfe('0x3'));var express=require(_0x0dfe('0x4'));var router=express[_0x0dfe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0dfe('0x6'));var interaction=require(_0x0dfe('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x0dfe('0x8')]('/',auth['isAuthenticated'](),controller[_0x0dfe('0x9')]);router[_0x0dfe('0x8')](_0x0dfe('0xa'),auth[_0x0dfe('0xb')](),controller[_0x0dfe('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0dfe('0xd')]);router[_0x0dfe('0x8')](_0x0dfe('0xe'),auth[_0x0dfe('0xb')](),controller['getDispositions']);router['get'](_0x0dfe('0xf'),auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x10')]);router['get'](_0x0dfe('0x11'),auth[_0x0dfe('0xb')](),controller['getApplications']);router[_0x0dfe('0x8')](_0x0dfe('0x12'),auth[_0x0dfe('0xb')](),controller['getInteractions']);router[_0x0dfe('0x8')](_0x0dfe('0x13'),auth['isAuthenticated'](),controller[_0x0dfe('0x14')]);router[_0x0dfe('0x15')]('/',auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x16')]);router[_0x0dfe('0x15')]('/:id/dispositions',auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x17')]);router['post'](_0x0dfe('0xf'),auth[_0x0dfe('0xb')](),controller['addAnswer']);router[_0x0dfe('0x15')](_0x0dfe('0x18'),controller[_0x0dfe('0x19')]);router[_0x0dfe('0x15')]('/:id/applications',auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x1a')]);router[_0x0dfe('0x15')]('/:id/users',auth[_0x0dfe('0xb')](),controller['addAgents']);router[_0x0dfe('0x15')](_0x0dfe('0x1b'),auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x1c')]);router['put'](_0x0dfe('0x1d'),auth[_0x0dfe('0xb')](),controller[_0x0dfe('0x1e')]);router[_0x0dfe('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x0dfe('0x1f')](_0x0dfe('0xe'),auth[_0x0dfe('0xb')](),controller['removeDispositions']);router[_0x0dfe('0x1f')](_0x0dfe('0xf'),auth['isAuthenticated'](),controller[_0x0dfe('0x20')]);router[_0x0dfe('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x0dfe('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9bfa0a1..44194a2 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 _0x52d1=['exports','STRING','name','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x52d1,0x153));var _0x152d=function(_0x7afa3c,_0x3fecca){_0x7afa3c=_0x7afa3c-0x0;var _0x435153=_0x52d1[_0x7afa3c];return _0x435153;};'use strict';var Sequelize=require(_0x152d('0x0'));var rs=require(_0x152d('0x1'));module[_0x152d('0x2')]={'name':{'type':Sequelize[_0x152d('0x3')],'unique':_0x152d('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x152d('0x3')]},'token':{'type':Sequelize[_0x152d('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x152d('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x152d('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x152d('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x152d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x152d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x152d('0x3')]},'queueTransfer':{'type':Sequelize[_0x152d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x152d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x152d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x152d('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x152d('0x6')],'defaultValue':![],'comment':_0x152d('0x8'),'set':function(_0x5ec1bd){if(!_0x5ec1bd)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x152d('0x9')](_0x152d('0xa'),_0x5ec1bd);}}}; \ No newline at end of file +var _0x07f8=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x172345,_0x5808fd){var _0x2ae6fd=function(_0x195f74){while(--_0x195f74){_0x172345['push'](_0x172345['shift']());}};_0x2ae6fd(++_0x5808fd);}(_0x07f8,0x103));var _0x807f=function(_0x216fab,_0x247753){_0x216fab=_0x216fab-0x0;var _0x30f089=_0x07f8[_0x216fab];return _0x30f089;};'use strict';var Sequelize=require(_0x807f('0x0'));var rs=require(_0x807f('0x1'));module[_0x807f('0x2')]={'name':{'type':Sequelize[_0x807f('0x3')],'unique':_0x807f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x807f('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x807f('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x807f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x807f('0x6');}},'notificationSound':{'type':Sequelize[_0x807f('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x807f('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x807f('0x3')]},'queueTransfer':{'type':Sequelize[_0x807f('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x807f('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x807f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x807f('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x807f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x807f('0x7')],'defaultValue':![],'comment':_0x807f('0xa'),'set':function(_0x1146a5){if(!_0x1146a5)this['setDataValue'](_0x807f('0xb'),null);this[_0x807f('0xc')](_0x807f('0xd'),_0x1146a5);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index abc2194..acdf3b8 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 _0xc3f3=['getInteractions','Contact','fullname','Tag','Tags','tag','addAgents','ids','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','get','OpenchannelAccounts','sendStatus','name','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','keys','query','filters','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','params','Pause','intersection','length','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','OpenchannelAccountId','getDispositions','findOne','nolimit','order','Disposition','includeAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','notify','openchannel','CmContact','describe','createdAt','updatedAt','difference','CompanyId','ListId','from','isNil','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','transaction','bulkCreate','findAndCountAll','priority','getApplications'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xc3f3,0xce));var _0x3c3f=function(_0x3ad1b9,_0x2962d1){_0x3ad1b9=_0x3ad1b9-0x0;var _0x109270=_0xc3f3[_0x3ad1b9];return _0x109270;};'use strict';var emlformat=require(_0x3c3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c3f('0x1'));var jsonpatch=require(_0x3c3f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c3f('0x3'));var Mustache=require(_0x3c3f('0x4'));var util=require(_0x3c3f('0x5'));var path=require(_0x3c3f('0x6'));var sox=require(_0x3c3f('0x7'));var csv=require(_0x3c3f('0x8'));var ejs=require(_0x3c3f('0x9'));var fs=require('fs');var fs_extra=require(_0x3c3f('0xa'));var _=require(_0x3c3f('0xb'));var squel=require(_0x3c3f('0xc'));var crypto=require(_0x3c3f('0xd'));var jsforce=require(_0x3c3f('0xe'));var deskjs=require(_0x3c3f('0xf'));var toCsv=require(_0x3c3f('0x8'));var querystring=require(_0x3c3f('0x10'));var Papa=require(_0x3c3f('0x11'));var Redis=require(_0x3c3f('0x12'));var authService=require(_0x3c3f('0x13'));var qs=require(_0x3c3f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c3f('0x15'));var logger=require(_0x3c3f('0x16'))('api');var utils=require(_0x3c3f('0x17'));var config=require(_0x3c3f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c3f('0x19'))['db'];config[_0x3c3f('0x1a')]=_[_0x3c3f('0x1b')](config[_0x3c3f('0x1a')],{'host':_0x3c3f('0x1c'),'port':0x18eb});var socket=require(_0x3c3f('0x1d'))(new Redis(config[_0x3c3f('0x1a')]));require(_0x3c3f('0x1e'))[_0x3c3f('0x1f')](socket);var jayson=require(_0x3c3f('0x20'));var client=jayson['client'][_0x3c3f('0x21')]({'port':0x232c});var client9002=jayson[_0x3c3f('0x22')][_0x3c3f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3b6f54,_0x17749b,_0x685613,_0x1ca960){return new BPromise(function(_0x2dd169,_0xb4b601){var _0x2e32c2=_0x1ca960||client;return _0x2e32c2[_0x3c3f('0x23')](_0x3b6f54,_0x685613)['then'](function(_0x33e534){logger[_0x3c3f('0x24')](_0x3c3f('0x25'),_0x17749b,_0x3c3f('0x26'));logger['debug'](_0x3c3f('0x27'),_0x17749b,_0x3c3f('0x26'),JSON[_0x3c3f('0x28')](_0x33e534));if(_0x33e534['error']){if(_0x33e534['error'][_0x3c3f('0x29')]===0x1f4){logger[_0x3c3f('0x2a')](_0x3c3f('0x25'),_0x17749b,_0x33e534['error'][_0x3c3f('0x2b')]);return _0xb4b601(_0x33e534[_0x3c3f('0x2a')][_0x3c3f('0x2b')]);}logger[_0x3c3f('0x2a')](_0x3c3f('0x25'),_0x17749b,_0x33e534[_0x3c3f('0x2a')][_0x3c3f('0x2b')]);return _0x2dd169(_0x33e534[_0x3c3f('0x2a')][_0x3c3f('0x2b')]);}else{logger[_0x3c3f('0x24')](_0x3c3f('0x25'),_0x17749b,_0x3c3f('0x26'));_0x2dd169(_0x33e534[_0x3c3f('0x2c')][_0x3c3f('0x2b')]);}})[_0x3c3f('0x2d')](function(_0x4c3a6d){logger[_0x3c3f('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x17749b,_0x4c3a6d);_0xb4b601(_0x4c3a6d);});});}function respondWithStatusCode(_0x5e68f0,_0x2b43f9){_0x2b43f9=_0x2b43f9||0xcc;return function(_0x1b127e){if(_0x1b127e){return _0x5e68f0['sendStatus'](_0x2b43f9);}return _0x5e68f0[_0x3c3f('0x2e')](_0x2b43f9)[_0x3c3f('0x2f')]();};}function respondWithResult(_0x208596,_0x1b0996){_0x1b0996=_0x1b0996||0xc8;return function(_0xe9219e){if(_0xe9219e){return _0x208596['status'](_0x1b0996)[_0x3c3f('0x30')](_0xe9219e);}};}function respondWithFilteredResult(_0x5b75d8,_0x3211da){return function(_0xef46a6){if(_0xef46a6){var _0x508a04=typeof _0x3211da[_0x3c3f('0x31')]==='undefined'&&typeof _0x3211da[_0x3c3f('0x32')]===_0x3c3f('0x33');var _0x214f51=_0xef46a6['count'];var _0x191fb4=_0x508a04?0x0:_0x3211da[_0x3c3f('0x31')];var _0x1ba7f8=_0x508a04?_0xef46a6[_0x3c3f('0x34')]:_0x3211da[_0x3c3f('0x31')]+_0x3211da['limit'];var _0x11af00;if(_0x1ba7f8>=_0x214f51){_0x1ba7f8=_0x214f51;_0x11af00=0xc8;}else{_0x11af00=0xce;}_0x5b75d8[_0x3c3f('0x2e')](_0x11af00);return _0x5b75d8[_0x3c3f('0x35')]('Content-Range',_0x191fb4+'-'+_0x1ba7f8+'/'+_0x214f51)[_0x3c3f('0x30')](_0xef46a6);}return null;};}function patchUpdates(_0x10b2a3){return function(_0xe88c01){try{jsonpatch['apply'](_0xe88c01,_0x10b2a3,!![]);}catch(_0x245fdf){return BPromise[_0x3c3f('0x36')](_0x245fdf);}return _0xe88c01[_0x3c3f('0x37')]();};}function saveUpdates(_0x5f0c70,_0x5bf1b9){return function(_0x107805){if(_0x107805){return _0x107805[_0x3c3f('0x38')](_0x5f0c70)['then'](function(_0x1d6c58){return _0x1d6c58;});}return null;};}function removeEntity(_0x34941d,_0x60bab1){return function(_0x55639e){if(_0x55639e){return _0x55639e[_0x3c3f('0x39')]()[_0x3c3f('0x3a')](function(){var _0x38254f=_0x55639e[_0x3c3f('0x3b')]({'plain':!![]});var _0x542881=_0x3c3f('0x3c');return db['UserProfileResource'][_0x3c3f('0x39')]({'where':{'type':_0x542881,'resourceId':_0x38254f['id']}})[_0x3c3f('0x3a')](function(){return _0x55639e;});})[_0x3c3f('0x3a')](function(){_0x34941d['status'](0xcc)[_0x3c3f('0x2f')]();});}};}function handleEntityNotFound(_0x22849d,_0x228f76){return function(_0x34652a){if(!_0x34652a){_0x22849d[_0x3c3f('0x3d')](0x194);}return _0x34652a;};}function handleError(_0x1c703a,_0x139a43){_0x139a43=_0x139a43||0x1f4;return function(_0x48d02e){logger[_0x3c3f('0x2a')](_0x48d02e['stack']);if(_0x48d02e[_0x3c3f('0x3e')]){delete _0x48d02e['name'];}_0x1c703a[_0x3c3f('0x2e')](_0x139a43)['send'](_0x48d02e);};}exports['index']=function(_0x77d394,_0x3e9194){var _0x37cbbe={'include':[{'model':db['Pause'],'as':_0x3c3f('0x3f')}]},_0x3041ce={},_0x559b2e={'count':0x0,'rows':[]};var _0x266be4=_[_0x3c3f('0x40')](db[_0x3c3f('0x41')][_0x3c3f('0x42')],function(_0xcbe1e7){return{'name':_0xcbe1e7[_0x3c3f('0x43')],'type':_0xcbe1e7['type'][_0x3c3f('0x44')]};});_0x3041ce['model']=_[_0x3c3f('0x40')](_0x266be4,_0x3c3f('0x3e'));_0x3041ce['query']=_[_0x3c3f('0x45')](_0x77d394[_0x3c3f('0x46')]);_0x3041ce[_0x3c3f('0x47')]=_['intersection'](_0x3041ce[_0x3c3f('0x48')],_0x3041ce[_0x3c3f('0x46')]);_0x37cbbe[_0x3c3f('0x49')]=_['intersection'](_0x3041ce['model'],qs['fields'](_0x77d394[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x37cbbe[_0x3c3f('0x49')]=_0x37cbbe[_0x3c3f('0x49')]['length']?_0x37cbbe['attributes']:_0x3041ce[_0x3c3f('0x48')];if(!_0x77d394[_0x3c3f('0x46')][_0x3c3f('0x4b')]('nolimit')){_0x37cbbe['limit']=qs['limit'](_0x77d394['query'][_0x3c3f('0x32')]);_0x37cbbe[_0x3c3f('0x31')]=qs[_0x3c3f('0x31')](_0x77d394[_0x3c3f('0x46')][_0x3c3f('0x31')]);}_0x37cbbe['order']=qs[_0x3c3f('0x4c')](_0x77d394['query'][_0x3c3f('0x4c')]);_0x37cbbe[_0x3c3f('0x4d')]=qs[_0x3c3f('0x47')](_[_0x3c3f('0x4e')](_0x77d394[_0x3c3f('0x46')],_0x3041ce[_0x3c3f('0x47')]),_0x266be4);if(_0x77d394[_0x3c3f('0x46')][_0x3c3f('0x4f')]){_0x37cbbe[_0x3c3f('0x4d')]=_[_0x3c3f('0x50')](_0x37cbbe[_0x3c3f('0x4d')],{'$or':_[_0x3c3f('0x40')](_0x266be4,function(_0x28dac3){if(_0x28dac3[_0x3c3f('0x51')]!==_0x3c3f('0x52')){var _0x3e8d5d={};_0x3e8d5d[_0x28dac3[_0x3c3f('0x3e')]]={'$like':'%'+_0x77d394[_0x3c3f('0x46')][_0x3c3f('0x4f')]+'%'};return _0x3e8d5d;}})});}_0x37cbbe=_[_0x3c3f('0x50')]({},_0x37cbbe,_0x77d394[_0x3c3f('0x53')]);var _0x342d13={'where':_0x37cbbe['where']};return db['OpenchannelAccount'][_0x3c3f('0x34')](_0x342d13)['then'](function(_0x54cd3b){_0x559b2e[_0x3c3f('0x34')]=_0x54cd3b;if(_0x77d394[_0x3c3f('0x46')]['includeAll']){_0x37cbbe[_0x3c3f('0x54')]=[{'all':!![]}];}return db[_0x3c3f('0x41')]['findAll'](_0x37cbbe);})[_0x3c3f('0x3a')](function(_0x5e5354){_0x559b2e[_0x3c3f('0x55')]=_0x5e5354;return _0x559b2e;})[_0x3c3f('0x3a')](respondWithFilteredResult(_0x3e9194,_0x37cbbe))['catch'](handleError(_0x3e9194,null));};exports[_0x3c3f('0x56')]=function(_0x5880f9,_0x5c7fb6){var _0x25442f={'raw':![],'where':{'id':_0x5880f9[_0x3c3f('0x57')]['id']},'include':[{'model':db[_0x3c3f('0x58')],'as':_0x3c3f('0x3f')}]},_0x43fd88={};_0x43fd88[_0x3c3f('0x48')]=_[_0x3c3f('0x45')](db['OpenchannelAccount'][_0x3c3f('0x42')]);_0x43fd88['query']=_[_0x3c3f('0x45')](_0x5880f9[_0x3c3f('0x46')]);_0x43fd88[_0x3c3f('0x47')]=_[_0x3c3f('0x59')](_0x43fd88[_0x3c3f('0x48')],_0x43fd88[_0x3c3f('0x46')]);_0x25442f[_0x3c3f('0x49')]=_[_0x3c3f('0x59')](_0x43fd88[_0x3c3f('0x48')],qs['fields'](_0x5880f9[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x25442f['attributes']=_0x25442f['attributes'][_0x3c3f('0x5a')]?_0x25442f[_0x3c3f('0x49')]:_0x43fd88[_0x3c3f('0x48')];if(_0x5880f9['query']['includeAll']){_0x25442f[_0x3c3f('0x54')]=[{'all':!![]}];}_0x25442f=_[_0x3c3f('0x50')]({},_0x25442f,_0x5880f9[_0x3c3f('0x53')]);return db['OpenchannelAccount'][_0x3c3f('0x5b')](_0x25442f)['then'](handleEntityNotFound(_0x5c7fb6,null))[_0x3c3f('0x3a')](respondWithResult(_0x5c7fb6,null))[_0x3c3f('0x2d')](handleError(_0x5c7fb6,null));};exports['create']=function(_0x46cca5,_0x48f8ec){return db[_0x3c3f('0x41')]['create'](_0x46cca5[_0x3c3f('0x5c')],{})[_0x3c3f('0x3a')](function(_0x5c540a){var _0x5a32ec=_0x46cca5['user'][_0x3c3f('0x3b')]({'plain':!![]});if(!_0x5a32ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a32ec[_0x3c3f('0x5d')]===_0x3c3f('0x5e')){var _0x22f110=_0x5c540a[_0x3c3f('0x3b')]({'plain':!![]});var _0x164f05='OpenchannelAccounts';return db[_0x3c3f('0x5f')][_0x3c3f('0x5b')]({'where':{'name':_0x164f05,'userProfileId':_0x5a32ec[_0x3c3f('0x60')]},'raw':!![]})[_0x3c3f('0x3a')](function(_0x47c437){if(_0x47c437&&_0x47c437[_0x3c3f('0x61')]===0x0){return db['UserProfileResource'][_0x3c3f('0x62')]({'name':_0x22f110[_0x3c3f('0x3e')],'resourceId':_0x22f110['id'],'type':_0x47c437[_0x3c3f('0x3e')],'sectionId':_0x47c437['id']},{})[_0x3c3f('0x3a')](function(){return _0x5c540a;});}else{return _0x5c540a;}})['catch'](function(_0x42c85f){logger[_0x3c3f('0x2a')](_0x3c3f('0x63'),_0x42c85f);throw _0x42c85f;});}return _0x5c540a;})[_0x3c3f('0x3a')](respondWithResult(_0x48f8ec,0xc9))[_0x3c3f('0x2d')](handleError(_0x48f8ec,null));};exports[_0x3c3f('0x38')]=function(_0xe31e6f,_0x352a5b){if(_0xe31e6f[_0x3c3f('0x5c')]['id']){delete _0xe31e6f[_0x3c3f('0x5c')]['id'];}return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0xe31e6f['params']['id']},'include':[{'model':db['Pause'],'as':_0x3c3f('0x3f')}]})[_0x3c3f('0x3a')](handleEntityNotFound(_0x352a5b,null))[_0x3c3f('0x3a')](saveUpdates(_0xe31e6f['body'],null))[_0x3c3f('0x3a')](respondWithResult(_0x352a5b,null))['catch'](handleError(_0x352a5b,null));};exports[_0x3c3f('0x39')]=function(_0x45f8bc,_0x245310){return db[_0x3c3f('0x41')]['find']({'where':{'id':_0x45f8bc[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x245310,null))['then'](removeEntity(_0x245310,null))[_0x3c3f('0x2d')](handleError(_0x245310,null));};exports['describe']=function(_0x42a39b,_0xda96b7){return db[_0x3c3f('0x41')]['describe']()[_0x3c3f('0x3a')](respondWithResult(_0xda96b7,null))[_0x3c3f('0x2d')](handleError(_0xda96b7,null));};exports['addDisposition']=function(_0x3d5f37,_0x25d84d,_0x1b93ed){if(_0x3d5f37[_0x3c3f('0x5c')]['id']){delete _0x3d5f37['body']['id'];}return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x3d5f37[_0x3c3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x25d84d,null))[_0x3c3f('0x3a')](function(_0x484c10){if(_0x484c10){_0x3d5f37[_0x3c3f('0x5c')][_0x3c3f('0x64')]=_0x484c10['id'];return db['Disposition'][_0x3c3f('0x62')](_0x3d5f37['body']);}})[_0x3c3f('0x3a')](respondWithResult(_0x25d84d,null))[_0x3c3f('0x2d')](handleError(_0x25d84d,null));};exports[_0x3c3f('0x65')]=function(_0x18a10b,_0x481ee6,_0x264243){var _0x45e78f={'raw':![],'where':{}};var _0x3aff66={};var _0x7d9b2={'count':0x0,'rows':[]};return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0x18a10b[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x481ee6,null))['then'](function(_0x18c025){if(_0x18c025){_0x3aff66[_0x3c3f('0x48')]=_[_0x3c3f('0x45')](db['Disposition'][_0x3c3f('0x42')]);_0x3aff66[_0x3c3f('0x46')]=_['keys'](_0x18a10b[_0x3c3f('0x46')]);_0x3aff66[_0x3c3f('0x47')]=_['intersection'](_0x3aff66[_0x3c3f('0x48')],_0x3aff66[_0x3c3f('0x46')]);_0x45e78f[_0x3c3f('0x49')]=_[_0x3c3f('0x59')](_0x3aff66[_0x3c3f('0x48')],qs[_0x3c3f('0x4a')](_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x45e78f[_0x3c3f('0x49')]=_0x45e78f[_0x3c3f('0x49')][_0x3c3f('0x5a')]?_0x45e78f['attributes']:_0x3aff66['model'];if(!_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x4b')](_0x3c3f('0x67'))){_0x45e78f[_0x3c3f('0x32')]=qs[_0x3c3f('0x32')](_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x32')]);_0x45e78f[_0x3c3f('0x31')]=qs[_0x3c3f('0x31')](_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x31')]);}_0x45e78f[_0x3c3f('0x68')]=qs[_0x3c3f('0x4c')](_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x4c')]);_0x45e78f[_0x3c3f('0x4d')]=qs[_0x3c3f('0x47')](_['pick'](_0x18a10b['query'],_0x3aff66['filters']));_0x45e78f[_0x3c3f('0x4d')][_0x3c3f('0x64')]=_0x18c025['id'];if(_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x4f')]){_0x45e78f['where']=_['merge'](_0x45e78f[_0x3c3f('0x4d')],{'$or':_[_0x3c3f('0x40')](_0x45e78f[_0x3c3f('0x49')],function(_0x4b0b0a){var _0x54cd9d={};_0x54cd9d[_0x4b0b0a]={'$like':'%'+_0x18a10b[_0x3c3f('0x46')]['filter']+'%'};return _0x54cd9d;})});}_0x45e78f=_[_0x3c3f('0x50')]({},_0x45e78f,_0x18a10b[_0x3c3f('0x53')]);return db[_0x3c3f('0x69')][_0x3c3f('0x34')]({'where':_0x45e78f[_0x3c3f('0x4d')]})[_0x3c3f('0x3a')](function(_0xb0219a){_0x7d9b2['count']=_0xb0219a;if(_0x18a10b[_0x3c3f('0x46')][_0x3c3f('0x6a')]){_0x45e78f['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x45e78f);})['then'](function(_0x42999b){_0x7d9b2['rows']=_0x42999b;return _0x7d9b2;});}})['then'](respondWithFilteredResult(_0x481ee6,_0x45e78f))[_0x3c3f('0x2d')](handleError(_0x481ee6,null));};exports[_0x3c3f('0x6b')]=function(_0x41d0af,_0x5cfec3,_0x236db7){return db['OpenchannelAccount'][_0x3c3f('0x5b')]({'where':{'id':_0x41d0af['params']['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x5cfec3,null))[_0x3c3f('0x3a')](function(_0x3e8a2d){if(_0x3e8a2d){return _0x3e8a2d['removeDispositions'](_0x41d0af[_0x3c3f('0x46')]['ids']);}})[_0x3c3f('0x3a')](respondWithStatusCode(_0x5cfec3,null))[_0x3c3f('0x2d')](handleError(_0x5cfec3,null));};exports[_0x3c3f('0x6c')]=function(_0x475ec6,_0x419801,_0x34f11e){if(_0x475ec6[_0x3c3f('0x5c')]['id']){delete _0x475ec6['body']['id'];}return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x475ec6[_0x3c3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x419801,null))[_0x3c3f('0x3a')](function(_0x4c9649){if(_0x4c9649){_0x475ec6[_0x3c3f('0x5c')]['OpenchannelAccountId']=_0x4c9649['id'];return db['CannedAnswer'][_0x3c3f('0x62')](_0x475ec6['body']);}})['then'](respondWithResult(_0x419801,null))['catch'](handleError(_0x419801,null));};exports[_0x3c3f('0x6d')]=function(_0xced50e,_0x189023,_0x42cb3c){var _0x515f3e={'raw':![],'where':{}};var _0x5da242={};var _0x16208b={'count':0x0,'rows':[]};return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0xced50e[_0x3c3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x189023,null))[_0x3c3f('0x3a')](function(_0x584f4b){if(_0x584f4b){_0x5da242['model']=_[_0x3c3f('0x45')](db['CannedAnswer'][_0x3c3f('0x42')]);_0x5da242[_0x3c3f('0x46')]=_[_0x3c3f('0x45')](_0xced50e['query']);_0x5da242[_0x3c3f('0x47')]=_[_0x3c3f('0x59')](_0x5da242[_0x3c3f('0x48')],_0x5da242[_0x3c3f('0x46')]);_0x515f3e[_0x3c3f('0x49')]=_[_0x3c3f('0x59')](_0x5da242[_0x3c3f('0x48')],qs['fields'](_0xced50e[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x515f3e[_0x3c3f('0x49')]=_0x515f3e[_0x3c3f('0x49')][_0x3c3f('0x5a')]?_0x515f3e['attributes']:_0x5da242[_0x3c3f('0x48')];if(!_0xced50e[_0x3c3f('0x46')][_0x3c3f('0x4b')](_0x3c3f('0x67'))){_0x515f3e[_0x3c3f('0x32')]=qs[_0x3c3f('0x32')](_0xced50e['query'][_0x3c3f('0x32')]);_0x515f3e[_0x3c3f('0x31')]=qs[_0x3c3f('0x31')](_0xced50e[_0x3c3f('0x46')][_0x3c3f('0x31')]);}_0x515f3e[_0x3c3f('0x68')]=qs[_0x3c3f('0x4c')](_0xced50e['query'][_0x3c3f('0x4c')]);_0x515f3e[_0x3c3f('0x4d')]=qs[_0x3c3f('0x47')](_[_0x3c3f('0x4e')](_0xced50e[_0x3c3f('0x46')],_0x5da242[_0x3c3f('0x47')]));_0x515f3e[_0x3c3f('0x4d')]['OpenchannelAccountId']=_0x584f4b['id'];if(_0xced50e[_0x3c3f('0x46')][_0x3c3f('0x4f')]){_0x515f3e['where']=_[_0x3c3f('0x50')](_0x515f3e['where'],{'$or':_['map'](_0x515f3e[_0x3c3f('0x49')],function(_0x10399c){var _0x5f049e={};_0x5f049e[_0x10399c]={'$like':'%'+_0xced50e['query']['filter']+'%'};return _0x5f049e;})});}_0x515f3e=_[_0x3c3f('0x50')]({},_0x515f3e,_0xced50e['options']);return db[_0x3c3f('0x6e')][_0x3c3f('0x34')]({'where':_0x515f3e['where']})[_0x3c3f('0x3a')](function(_0x5a4ee4){_0x16208b[_0x3c3f('0x34')]=_0x5a4ee4;if(_0xced50e[_0x3c3f('0x46')][_0x3c3f('0x6a')]){_0x515f3e[_0x3c3f('0x54')]=[{'all':!![]}];}return db[_0x3c3f('0x6e')][_0x3c3f('0x6f')](_0x515f3e);})[_0x3c3f('0x3a')](function(_0x4279c3){_0x16208b[_0x3c3f('0x55')]=_0x4279c3;return _0x16208b;});}})[_0x3c3f('0x3a')](respondWithFilteredResult(_0x189023,_0x515f3e))['catch'](handleError(_0x189023,null));};exports[_0x3c3f('0x70')]=function(_0x2878b5,_0x121352,_0x2b260f){return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x2878b5[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x121352,null))[_0x3c3f('0x3a')](function(_0x4e6726){if(_0x4e6726){return _0x4e6726[_0x3c3f('0x70')](_0x2878b5[_0x3c3f('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x121352,null))[_0x3c3f('0x2d')](handleError(_0x121352,null));};exports[_0x3c3f('0x71')]=function(_0x31fbde,_0x3ad7b3,_0x3af113){var _0x4d7461={'body':_0x31fbde[_0x3c3f('0x5c')],'channel':_0x3c3f('0x72')};var _0x5f0abc=[];var _0x29fc4d=[];var _0x302cc5={};var _0x5f393a=![];return db[_0x3c3f('0x73')][_0x3c3f('0x74')]()[_0x3c3f('0x3a')](function(_0x28c7c1){if(!_0x28c7c1){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x5f0abc=_['difference'](_[_0x3c3f('0x45')](_0x28c7c1),[_0x3c3f('0x75'),_0x3c3f('0x76')]);_0x29fc4d=_[_0x3c3f('0x77')](_['keys'](_0x28c7c1),[_0x3c3f('0x75'),_0x3c3f('0x76'),_0x3c3f('0x78'),_0x3c3f('0x79')]);if(_0x31fbde[_0x3c3f('0x5c')]['id']){delete _0x31fbde[_0x3c3f('0x5c')]['id'];}if(_['isNil'](_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x7a')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x3c3f('0x7b')](_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x5c')])||_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x5c')]===''){throw new db[(_0x3c3f('0x7c'))][(_0x3c3f('0x7d'))](_0x3c3f('0x7e'));}if(_[_0x3c3f('0x7b')](_0x31fbde[_0x3c3f('0x5c')]['mapKey'])){throw new db[(_0x3c3f('0x7c'))][(_0x3c3f('0x7d'))](_0x3c3f('0x7f')+_0x29fc4d);}if(!_['includes'](_0x29fc4d,_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x80')])){throw new db[(_0x3c3f('0x7c'))][(_0x3c3f('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x29fc4d);}_0x302cc5[_0x31fbde[_0x3c3f('0x5c')]['mapKey']]=_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x7a')];})[_0x3c3f('0x3a')](function(){return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x31fbde[_0x3c3f('0x57')]['id']},'include':[{'model':db[_0x3c3f('0x81')],'as':_0x3c3f('0x82'),'include':[{'model':db[_0x3c3f('0x73')],'as':_0x3c3f('0x83'),'where':_0x302cc5,'limit':0x1,'order':[[_0x3c3f('0x76'),'DESC']]}]},{'model':db[_0x3c3f('0x84')],'as':_0x3c3f('0x85')}]});})[_0x3c3f('0x3a')](handleEntityNotFound(_0x3ad7b3,null))['then'](function(_0x20fbdc){if(_0x20fbdc&&_0x20fbdc[_0x3c3f('0x82')]){_0x4d7461[_0x3c3f('0x86')]=_0x20fbdc;_0x4d7461[_0x3c3f('0x87')]=_0x20fbdc[_0x3c3f('0x85')];_0x4d7461[_0x3c3f('0x88')]=_0x20fbdc['List'];_0x4d7461[_0x3c3f('0x87')]=_[_0x3c3f('0x89')](_0x4d7461[_0x3c3f('0x87')],['priority'],['asc']);if(_0x4d7461[_0x3c3f('0x86')][_0x3c3f('0x85')]){delete _0x4d7461['account'][_0x3c3f('0x85')];}if(_0x4d7461[_0x3c3f('0x86')][_0x3c3f('0x82')]&&_0x4d7461[_0x3c3f('0x86')][_0x3c3f('0x82')][_0x3c3f('0x83')][_0x3c3f('0x5a')]){return _0x4d7461[_0x3c3f('0x86')][_0x3c3f('0x82')][_0x3c3f('0x83')][0x0];}var _0x11e2e3=_[_0x3c3f('0x1b')](_0x31fbde[_0x3c3f('0x5c')],{'firstName':_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x7a')],'ListId':_0x20fbdc[_0x3c3f('0x79')]});_0x11e2e3[_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x80')]]=_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x7a')];return db[_0x3c3f('0x73')][_0x3c3f('0x62')](_0x11e2e3,{'fields':_0x5f0abc,'raw':!![]});}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x3ad7b3,null))[_0x3c3f('0x3a')](function(_0x4724fe){_0x4d7461['contact']=_0x4724fe;if(_0x4724fe){var _0x560908={'ContactId':_0x4724fe['id'],'OpenchannelAccountId':_0x31fbde[_0x3c3f('0x57')]['id'],'from':(_0x4724fe[_0x3c3f('0x8a')]||'')+'\x20'+(_0x4724fe['lastName']||'')};var _0x36da79={'OpenchannelAccountId':_0x31fbde[_0x3c3f('0x57')]['id'],'closed':![]};if(_0x31fbde[_0x3c3f('0x5c')]['threadId']){_0x36da79['threadId']=_0x31fbde['body'][_0x3c3f('0x8b')];return db[_0x3c3f('0x8c')]['find']({'where':_0x36da79})[_0x3c3f('0x3a')](function(_0x475e19){if(_0x475e19){return[_0x475e19,![]];}_0x560908[_0x3c3f('0x8b')]=_0x31fbde['body'][_0x3c3f('0x8b')];_0x560908['externalUrl']=_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x8d')];return db[_0x3c3f('0x8c')][_0x3c3f('0x62')](_0x560908)[_0x3c3f('0x3a')](function(_0x3543d6){return[_0x3543d6,!![]];});});}else{_0x36da79['threadId']=null;}_0x36da79[_0x3c3f('0x8e')]=_0x4724fe['id'];return db[_0x3c3f('0x8c')][_0x3c3f('0x5b')]({'where':_0x36da79})[_0x3c3f('0x3a')](function(_0x54e2fd){if(_0x54e2fd){return[_0x54e2fd,![]];}return db[_0x3c3f('0x8c')][_0x3c3f('0x62')](_0x560908)[_0x3c3f('0x3a')](function(_0x6fe34c){return[_0x6fe34c,!![]];});});}})[_0x3c3f('0x8f')](function(_0x6a37ee,_0x2db703){if(_0x6a37ee){_0x5f393a=_0x2db703;if(!_0x2db703){var _0x13d2c5={'from':(_0x4d7461[_0x3c3f('0x90')]['firstName']||'')+'\x20'+(_0x4d7461[_0x3c3f('0x90')][_0x3c3f('0x91')]||'')};if(_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x8b')]&&_0x31fbde[_0x3c3f('0x5c')]['messageId']&&_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x8b')]!=_0x31fbde[_0x3c3f('0x5c')]['messageId']){_0x13d2c5[_0x3c3f('0x8b')]=_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x92')];}return _0x6a37ee[_0x3c3f('0x38')](_0x13d2c5);}else{return _0x6a37ee;}}})[_0x3c3f('0x3a')](function(_0x40ac88){_0x4d7461['interaction']=_0x40ac88[_0x3c3f('0x3b')]({'plain':!![]});_0x4d7461[_0x3c3f('0x93')][_0x3c3f('0x94')]=_0x5f393a;if(_0x4d7461[_0x3c3f('0x93')][_0x3c3f('0x94')]){if(_0x4d7461['account']['autoclose']){_0x4d7461['applications'][_0x3c3f('0x95')]({'id':0x0,'priority':_0x4d7461[_0x3c3f('0x87')]['length']+0x1,'app':_0x3c3f('0x96'),'appdata':_0x3c3f('0x97'),'interval':_0x3c3f('0x98')});}}return db['OpenchannelMessage']['create']({'body':_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x5c')],'OpenchannelAccountId':_0x31fbde['params']['id'],'OpenchannelInteractionId':_0x40ac88['id'],'direction':'in','ContactId':_0x4d7461['contact']['id'],'AttachmentId':_0x31fbde[_0x3c3f('0x5c')][_0x3c3f('0x99')]});})['then'](function(_0x53f685){_0x4d7461['message']=_0x53f685;if(_0x4d7461[_0x3c3f('0x93')][_0x3c3f('0x9a')]){return db[_0x3c3f('0x9b')][_0x3c3f('0x5b')]({'attributes':['id',_0x3c3f('0x3e')],'where':{'id':_0x4d7461['interaction']['UserId']}})[_0x3c3f('0x3a')](function(_0xd78ac5){if(_0xd78ac5){_0x4d7461[_0x3c3f('0x87')][_0x3c3f('0x9c')]({'id':0x0,'priority':0x0,'app':_0x3c3f('0x9d'),'appdata':_0xd78ac5[_0x3c3f('0x3e')]+','+(_0x4d7461[_0x3c3f('0x86')][_0x3c3f('0x9e')]||0xa),'interval':_0x3c3f('0x98')});_0x4d7461[_0x3c3f('0x9f')]=![];}return respondWithRpcPromise('Start',_0x3c3f('0xa0'),_0x4d7461);});}return respondWithRpcPromise(_0x3c3f('0xa1'),_0x3c3f('0xa0'),_0x4d7461);})[_0x3c3f('0x3a')](function(_0x560948){respondWithRpcPromise(_0x3c3f('0xa2'),'EventManager',{'event':_0x3c3f('0x71'),'message':_0x560948},client9002);return _0x560948;})[_0x3c3f('0x3a')](respondWithResult(_0x3ad7b3,null))['catch'](handleError(_0x3ad7b3,null));};exports['addApplications']=function(_0xe421af,_0xec780e,_0x408576){return db[_0x3c3f('0x41')]['findOne']({'where':{'id':_0xe421af[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0xec780e,null))['then'](function(_0x15251c){if(_0x15251c){return db['sequelize'][_0x3c3f('0xa3')](function(_0x18ef76){return db[_0x3c3f('0x84')][_0x3c3f('0x39')]({'where':{'OpenchannelAccountId':_0xe421af['params']['id']},'transaction':_0x18ef76})[_0x3c3f('0x3a')](function(_0x2b754b){var _0x1bdc01=_['map'](_0xe421af[_0x3c3f('0x5c')],function(_0x186cb6){_0x186cb6['OpenchannelAccountId']=_0xe421af['params']['id'];return _0x186cb6;});return db[_0x3c3f('0x84')][_0x3c3f('0xa4')](_0x1bdc01,{'transaction':_0x18ef76});});})['then'](function(){return db[_0x3c3f('0x84')][_0x3c3f('0xa5')]({'where':{'OpenchannelAccountId':_0xe421af[_0x3c3f('0x57')]['id']},'order':_0x3c3f('0xa6')});});}})[_0x3c3f('0x3a')](respondWithResult(_0xec780e,null))[_0x3c3f('0x2d')](handleError(_0xec780e,null));};exports[_0x3c3f('0xa7')]=function(_0x1490ab,_0x3e5ddf,_0x45fc6f){var _0x5bc27a={};var _0x3ee36f={};var _0x33e078;var _0x5cce7e;return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0x1490ab[_0x3c3f('0x57')]['id']}})['then'](handleEntityNotFound(_0x3e5ddf,null))[_0x3c3f('0x3a')](function(_0x39d183){if(_0x39d183){_0x33e078=_0x39d183;_0x3ee36f[_0x3c3f('0x48')]=_[_0x3c3f('0x45')](db[_0x3c3f('0x84')][_0x3c3f('0x42')]);_0x3ee36f[_0x3c3f('0x46')]=_[_0x3c3f('0x45')](_0x1490ab[_0x3c3f('0x46')]);_0x3ee36f['filters']=_[_0x3c3f('0x59')](_0x3ee36f['model'],_0x3ee36f[_0x3c3f('0x46')]);_0x5bc27a[_0x3c3f('0x49')]=_[_0x3c3f('0x59')](_0x3ee36f[_0x3c3f('0x48')],qs[_0x3c3f('0x4a')](_0x1490ab[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x5bc27a[_0x3c3f('0x49')]=_0x5bc27a[_0x3c3f('0x49')]['length']?_0x5bc27a[_0x3c3f('0x49')]:_0x3ee36f['model'];_0x5bc27a['order']=qs[_0x3c3f('0x4c')](_0x1490ab[_0x3c3f('0x46')][_0x3c3f('0x4c')]);_0x5bc27a[_0x3c3f('0x4d')]=qs[_0x3c3f('0x47')](_[_0x3c3f('0x4e')](_0x1490ab['query'],_0x3ee36f[_0x3c3f('0x47')]));if(_0x1490ab[_0x3c3f('0x46')]['filter']){_0x5bc27a['where']=_[_0x3c3f('0x50')](_0x5bc27a[_0x3c3f('0x4d')],{'$or':_[_0x3c3f('0x40')](_0x5bc27a[_0x3c3f('0x49')],function(_0x4f5bc4){var _0x30f11c={};_0x30f11c[_0x4f5bc4]={'$like':'%'+_0x1490ab[_0x3c3f('0x46')]['filter']+'%'};return _0x30f11c;})});}_0x5bc27a=_[_0x3c3f('0x50')]({},_0x5bc27a,_0x1490ab[_0x3c3f('0x53')]);return _0x33e078[_0x3c3f('0xa7')](_0x5bc27a);}})['then'](function(_0x122d14){if(_0x122d14){_0x5cce7e=_0x122d14[_0x3c3f('0x5a')];if(!_0x1490ab['query']['hasOwnProperty']('nolimit')){_0x5bc27a['limit']=qs[_0x3c3f('0x32')](_0x1490ab[_0x3c3f('0x46')]['limit']);_0x5bc27a['offset']=qs[_0x3c3f('0x31')](_0x1490ab['query'][_0x3c3f('0x31')]);}return _0x33e078[_0x3c3f('0xa7')](_0x5bc27a);}})[_0x3c3f('0x3a')](function(_0x2590f6){if(_0x2590f6){return _0x2590f6?{'count':_0x5cce7e,'rows':_0x2590f6}:null;}})['then'](respondWithResult(_0x3e5ddf,null))[_0x3c3f('0x2d')](handleError(_0x3e5ddf,null));};exports[_0x3c3f('0xa8')]=function(_0x1cac99,_0x425620,_0xa19e08){var _0x2d3e2c={'raw':![],'where':{}};var _0x3358c4={};var _0x43c636={'count':0x0,'rows':[]};return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0x1cac99[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x425620,null))[_0x3c3f('0x3a')](function(_0x1f3880){if(_0x1f3880){_0x3358c4[_0x3c3f('0x48')]=_['keys'](db[_0x3c3f('0x8c')][_0x3c3f('0x42')]);_0x3358c4[_0x3c3f('0x46')]=_[_0x3c3f('0x45')](_0x1cac99[_0x3c3f('0x46')]);_0x3358c4[_0x3c3f('0x47')]=_[_0x3c3f('0x59')](_0x3358c4['model'],_0x3358c4[_0x3c3f('0x46')]);_0x2d3e2c[_0x3c3f('0x49')]=_['intersection'](_0x3358c4[_0x3c3f('0x48')],qs['fields'](_0x1cac99[_0x3c3f('0x46')]['fields']));_0x2d3e2c[_0x3c3f('0x49')]=_0x2d3e2c[_0x3c3f('0x49')][_0x3c3f('0x5a')]?_0x2d3e2c[_0x3c3f('0x49')]:_0x3358c4[_0x3c3f('0x48')];if(!_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0x4b')](_0x3c3f('0x67'))){_0x2d3e2c[_0x3c3f('0x32')]=qs[_0x3c3f('0x32')](_0x1cac99[_0x3c3f('0x46')]['limit']);_0x2d3e2c['offset']=qs[_0x3c3f('0x31')](_0x1cac99['query'][_0x3c3f('0x31')]);}_0x2d3e2c[_0x3c3f('0x68')]=qs[_0x3c3f('0x4c')](_0x1cac99['query'][_0x3c3f('0x4c')]);_0x2d3e2c['where']=qs['filters'](_['pick'](_0x1cac99[_0x3c3f('0x46')],_0x3358c4[_0x3c3f('0x47')]));_0x2d3e2c[_0x3c3f('0x4d')][_0x3c3f('0x64')]=_0x1f3880['id'];if(_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0x4f')]){_0x2d3e2c[_0x3c3f('0x4d')]=_[_0x3c3f('0x50')](_0x2d3e2c[_0x3c3f('0x4d')],{'$or':_[_0x3c3f('0x40')](_0x2d3e2c[_0x3c3f('0x49')],function(_0x54f120){var _0x49b4d6={};_0x49b4d6[_0x54f120]={'$like':'%'+_0x1cac99['query']['filter']+'%'};return _0x49b4d6;})});}_0x2d3e2c=_[_0x3c3f('0x50')]({},_0x2d3e2c,_0x1cac99['options']);return db[_0x3c3f('0x8c')][_0x3c3f('0x34')]({'where':_0x2d3e2c[_0x3c3f('0x4d')]})[_0x3c3f('0x3a')](function(_0x3025b0){_0x43c636[_0x3c3f('0x34')]=_0x3025b0;if(_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0x6a')]){_0x2d3e2c[_0x3c3f('0x54')]=[{'model':db[_0x3c3f('0x73')],'as':_0x3c3f('0xa9'),'required':![]},{'model':db[_0x3c3f('0x9b')],'as':'Owner','attributes':[_0x3c3f('0x3e'),_0x3c3f('0xaa'),'internal'],'required':![]},{'model':db[_0x3c3f('0xab')],'as':_0x3c3f('0xac'),'attributes':['id',_0x3c3f('0x3e'),'color'],'where':_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0xad')]?{'id':_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0xad')]}:undefined,'required':_0x1cac99[_0x3c3f('0x46')][_0x3c3f('0xad')]?!![]:![]}];}return db[_0x3c3f('0x8c')][_0x3c3f('0x6f')](_0x2d3e2c);})[_0x3c3f('0x3a')](function(_0xbb7610){_0x43c636[_0x3c3f('0x55')]=_0xbb7610;return _0x43c636;});}})[_0x3c3f('0x3a')](respondWithFilteredResult(_0x425620,_0x2d3e2c))[_0x3c3f('0x2d')](handleError(_0x425620,null));};exports[_0x3c3f('0xae')]=function(_0x1c1c2c,_0x161900,_0xc19a4d){return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x1c1c2c[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x161900,null))['then'](function(_0x598e6c){if(_0x598e6c){return _0x598e6c[_0x3c3f('0xae')](_0x1c1c2c[_0x3c3f('0x5c')][_0x3c3f('0xaf')],_[_0x3c3f('0xb0')](_0x1c1c2c[_0x3c3f('0x5c')],[_0x3c3f('0xaf'),'id'])||{})[_0x3c3f('0x8f')](function(_0x189e20){for(var _0x5a936b=0x0;_0x5a936b<_0x1c1c2c[_0x3c3f('0x5c')]['ids'][_0x3c3f('0x5a')];_0x5a936b+=0x1){socket[_0x3c3f('0xb1')]('userOpenchannelAccount:save',{'UserId':Number(_0x1c1c2c[_0x3c3f('0x5c')][_0x3c3f('0xaf')][_0x5a936b]),'OpenchannelAccountId':Number(_0x1c1c2c[_0x3c3f('0x57')]['id'])});}return _0x189e20;});}})[_0x3c3f('0x3a')](respondWithResult(_0x161900,null))[_0x3c3f('0x2d')](handleError(_0x161900,null));};exports['removeAgents']=function(_0x5e4d5d,_0x307551,_0x53f18b){return db[_0x3c3f('0x41')]['find']({'where':{'id':_0x5e4d5d['params']['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x307551,null))[_0x3c3f('0x3a')](function(_0x18ad16){if(_0x18ad16){return _0x18ad16[_0x3c3f('0xb2')](_0x5e4d5d[_0x3c3f('0x46')][_0x3c3f('0xaf')])[_0x3c3f('0x3a')](function(){if(_[_0x3c3f('0xb3')](_0x5e4d5d[_0x3c3f('0x46')][_0x3c3f('0xaf')])){for(var _0x3d4de1=0x0;_0x3d4de1<_0x5e4d5d[_0x3c3f('0x46')]['ids'][_0x3c3f('0x5a')];_0x3d4de1+=0x1){socket[_0x3c3f('0xb1')](_0x3c3f('0xb4'),{'UserId':Number(_0x5e4d5d[_0x3c3f('0x46')][_0x3c3f('0xaf')][_0x3d4de1]),'OpenchannelAccountId':Number(_0x5e4d5d[_0x3c3f('0x57')]['id'])});}}else{socket['emit'](_0x3c3f('0xb4'),{'UserId':Number(_0x5e4d5d['query'][_0x3c3f('0xaf')]),'OpenchannelAccountId':Number(_0x5e4d5d[_0x3c3f('0x57')]['id'])});}});}})[_0x3c3f('0x3a')](respondWithStatusCode(_0x307551,null))[_0x3c3f('0x2d')](handleError(_0x307551,null));};exports[_0x3c3f('0xb5')]=function(_0x27efe0,_0x4b1fec,_0x1d6e93){var _0x4d1192={};var _0x23f0cd={};var _0xf7d6f4;var _0x9179f3;return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0x27efe0[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x4b1fec,null))[_0x3c3f('0x3a')](function(_0x382d26){if(_0x382d26){_0xf7d6f4=_0x382d26;_0x23f0cd[_0x3c3f('0x48')]=_[_0x3c3f('0x45')](db[_0x3c3f('0x9b')][_0x3c3f('0x42')]);_0x23f0cd[_0x3c3f('0x46')]=_[_0x3c3f('0x45')](_0x27efe0[_0x3c3f('0x46')]);_0x23f0cd[_0x3c3f('0x47')]=_[_0x3c3f('0x59')](_0x23f0cd[_0x3c3f('0x48')],_0x23f0cd[_0x3c3f('0x46')]);_0x4d1192[_0x3c3f('0x49')]=_[_0x3c3f('0x59')](_0x23f0cd[_0x3c3f('0x48')],qs[_0x3c3f('0x4a')](_0x27efe0[_0x3c3f('0x46')][_0x3c3f('0x4a')]));_0x4d1192[_0x3c3f('0x49')]=_0x4d1192['attributes'][_0x3c3f('0x5a')]?_0x4d1192['attributes']:_0x23f0cd[_0x3c3f('0x48')];_0x4d1192['order']=qs[_0x3c3f('0x4c')](_0x27efe0[_0x3c3f('0x46')][_0x3c3f('0x4c')]);_0x4d1192[_0x3c3f('0x4d')]=qs[_0x3c3f('0x47')](_[_0x3c3f('0x4e')](_0x27efe0['query'],_0x23f0cd[_0x3c3f('0x47')]));if(_0x27efe0[_0x3c3f('0x46')][_0x3c3f('0x4f')]){_0x4d1192[_0x3c3f('0x4d')]=_[_0x3c3f('0x50')](_0x4d1192[_0x3c3f('0x4d')],{'$or':_[_0x3c3f('0x40')](_0x4d1192[_0x3c3f('0x49')],function(_0x1a4144){var _0x4d30c4={};_0x4d30c4[_0x1a4144]={'$like':'%'+_0x27efe0[_0x3c3f('0x46')][_0x3c3f('0x4f')]+'%'};return _0x4d30c4;})});}_0x4d1192=_[_0x3c3f('0x50')]({},_0x4d1192,_0x27efe0['options']);return _0xf7d6f4[_0x3c3f('0xb5')](_0x4d1192);}})['then'](function(_0x3574bb){if(_0x3574bb){_0x9179f3=_0x3574bb[_0x3c3f('0x5a')];if(!_0x27efe0[_0x3c3f('0x46')][_0x3c3f('0x4b')](_0x3c3f('0x67'))){_0x4d1192[_0x3c3f('0x32')]=qs['limit'](_0x27efe0[_0x3c3f('0x46')]['limit']);_0x4d1192[_0x3c3f('0x31')]=qs[_0x3c3f('0x31')](_0x27efe0['query'][_0x3c3f('0x31')]);}return _0xf7d6f4[_0x3c3f('0xb5')](_0x4d1192);}})[_0x3c3f('0x3a')](function(_0x5abfb8){if(_0x5abfb8){return _0x5abfb8?{'count':_0x9179f3,'rows':_0x5abfb8}:null;}})[_0x3c3f('0x3a')](respondWithResult(_0x4b1fec,null))[_0x3c3f('0x2d')](handleError(_0x4b1fec,null));};exports[_0x3c3f('0xb6')]=function(_0x14baba,_0x23bcbc,_0x57f30e){var _0x46fac2,_0x3fdec8,_0x3092d2;if(_[_0x3c3f('0x7b')](_0x14baba[_0x3c3f('0x5c')][_0x3c3f('0x5c')])||_0x14baba[_0x3c3f('0x5c')][_0x3c3f('0x5c')]===''){throw new db[(_0x3c3f('0x7c'))][(_0x3c3f('0x7d'))](_0x3c3f('0x7e'));}if(_[_0x3c3f('0x7b')](_0x14baba[_0x3c3f('0x5c')]['to'])){}_0x46fac2=_0x14baba[_0x3c3f('0x5c')]['to'];return db[_0x3c3f('0x41')][_0x3c3f('0x66')]({'where':{'id':_0x14baba[_0x3c3f('0x57')]['id']}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x23bcbc,null))[_0x3c3f('0x3a')](function(_0x53a3b7){if(_0x53a3b7){return db[_0x3c3f('0x41')][_0x3c3f('0x5b')]({'where':{'id':_0x53a3b7['id']},'include':[{'model':db[_0x3c3f('0x81')],'as':_0x3c3f('0x82'),'include':[{'model':db[_0x3c3f('0x73')],'as':_0x3c3f('0x83'),'where':{[_0x53a3b7[_0x3c3f('0x80')]]:_0x46fac2},'limit':0x1,'order':[[_0x3c3f('0x76'),'DESC']]}]}]})[_0x3c3f('0x3a')](handleEntityNotFound(_0x23bcbc,null))[_0x3c3f('0x3a')](function(_0xc0f54d){if(_0xc0f54d&&_0xc0f54d[_0x3c3f('0x82')]){_0x3fdec8=_0xc0f54d[_0x3c3f('0x3b')]({'plain':!![]});if(_0x3fdec8['List']&&_0x3fdec8[_0x3c3f('0x82')][_0x3c3f('0x83')]['length']){return _0x3fdec8[_0x3c3f('0x82')]['Contacts'][0x0];}return db[_0x3c3f('0x73')]['create'](_[_0x3c3f('0x1b')](_0x14baba['body'],{'firstName':_0x46fac2,[_0xc0f54d[_0x3c3f('0x80')]]:_0x46fac2,'phone':_0x46fac2,'ListId':_0x3fdec8[_0x3c3f('0x79')]}));}})[_0x3c3f('0x3a')](handleEntityNotFound(_0x23bcbc,null))[_0x3c3f('0x3a')](function(_0x2e306e){if(_0x2e306e){_0x3092d2=_0x2e306e;return db['OpenchannelInteraction'][_0x3c3f('0x5b')]({'where':{'ContactId':_0x3092d2['id'],'closed':![],'OpenchannelAccountId':_0x3fdec8['id']}})[_0x3c3f('0x3a')](function(_0x2e63f2){if(_0x2e63f2){return[_0x2e63f2,![]];}return db[_0x3c3f('0x8c')][_0x3c3f('0x62')]({'UserId':_0x14baba[_0x3c3f('0x5e')]['id'],'ContactId':_0x3092d2['id'],'OpenchannelAccountId':_0x3fdec8['id'],'lastMsgDirection':_0x3c3f('0xb7'),'Messages':[_[_0x3c3f('0x50')](_0x14baba[_0x3c3f('0x5c')],{'read':![],'body':_0x14baba['body'][_0x3c3f('0x5c')],'OpenchannelAccountId':_0x3fdec8['id'],'UserId':_0x14baba[_0x3c3f('0x5e')]['id'],'ContactId':_0x3092d2['id']})]},{'include':[{'model':db[_0x3c3f('0xb8')],'as':_0x3c3f('0xb9')}]})[_0x3c3f('0x3a')](function(_0x8891ae){return[_0x8891ae,!![]];});});}})[_0x3c3f('0x8f')](function(_0x20dc42,_0x5e5b68){if(_0x5e5b68){return _0x20dc42;}return db['OpenchannelMessage'][_0x3c3f('0x62')](_[_0x3c3f('0x50')](_0x14baba[_0x3c3f('0x5c')],{'read':![],'body':_0x14baba[_0x3c3f('0x5c')][_0x3c3f('0x5c')],'OpenchannelAccountId':_0x3fdec8['id'],'OpenchannelInteractionId':_0x20dc42['id'],'UserId':_0x14baba[_0x3c3f('0x5e')]['id'],'ContactId':_0x3092d2['id']}))['then'](function(_0x2c45b7){_0x20dc42[_0x3c3f('0xba')][_0x3c3f('0xb9')]=[];_0x20dc42[_0x3c3f('0xba')][_0x3c3f('0xb9')][_0x3c3f('0x95')](_0x2c45b7[_0x3c3f('0xba')]);return _0x20dc42;});});}})['then'](respondWithResult(_0x23bcbc,null))['catch'](handleError(_0x23bcbc,null));}; \ No newline at end of file +var _0xefdf=['close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','set','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','length','create','user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefdf,0x1a9));var _0xfefd=function(_0x5a6d8b,_0x102446){_0x5a6d8b=_0x5a6d8b-0x0;var _0x2b6546=_0xefdf[_0x5a6d8b];return _0x2b6546;};'use strict';var emlformat=require(_0xfefd('0x0'));var rimraf=require(_0xfefd('0x1'));var zipdir=require(_0xfefd('0x2'));var jsonpatch=require(_0xfefd('0x3'));var rp=require(_0xfefd('0x4'));var moment=require(_0xfefd('0x5'));var BPromise=require(_0xfefd('0x6'));var Mustache=require(_0xfefd('0x7'));var util=require(_0xfefd('0x8'));var path=require(_0xfefd('0x9'));var sox=require(_0xfefd('0xa'));var csv=require('to-csv');var ejs=require(_0xfefd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfefd('0xc'));var squel=require(_0xfefd('0xd'));var crypto=require(_0xfefd('0xe'));var jsforce=require(_0xfefd('0xf'));var deskjs=require(_0xfefd('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfefd('0x11'));var Papa=require(_0xfefd('0x12'));var Redis=require('ioredis');var authService=require(_0xfefd('0x13'));var qs=require(_0xfefd('0x14'));var as=require(_0xfefd('0x15'));var hardwareService=require(_0xfefd('0x16'));var logger=require(_0xfefd('0x17'))('api');var utils=require(_0xfefd('0x18'));var config=require(_0xfefd('0x19'));var licenseUtil=require(_0xfefd('0x1a'));var db=require(_0xfefd('0x1b'))['db'];config[_0xfefd('0x1c')]=_[_0xfefd('0x1d')](config[_0xfefd('0x1c')],{'host':_0xfefd('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfefd('0x1f'))[_0xfefd('0x20')](socket);var jayson=require(_0xfefd('0x21'));var client=jayson[_0xfefd('0x22')][_0xfefd('0x23')]({'port':0x232c});var client9002=jayson[_0xfefd('0x22')][_0xfefd('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x160561,_0x4f79a1,_0x331f27,_0x208d90){return new BPromise(function(_0x587a10,_0x164833){var _0x499a52=_0x208d90||client;return _0x499a52['request'](_0x160561,_0x331f27)[_0xfefd('0x24')](function(_0x2013a0){logger['info'](_0xfefd('0x25'),_0x4f79a1,_0xfefd('0x26'));logger[_0xfefd('0x27')](_0xfefd('0x28'),_0x4f79a1,_0xfefd('0x26'),JSON[_0xfefd('0x29')](_0x2013a0));if(_0x2013a0['error']){if(_0x2013a0[_0xfefd('0x2a')][_0xfefd('0x2b')]===0x1f4){logger[_0xfefd('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f79a1,_0x2013a0[_0xfefd('0x2a')][_0xfefd('0x2c')]);return _0x164833(_0x2013a0[_0xfefd('0x2a')]['message']);}logger[_0xfefd('0x2a')](_0xfefd('0x25'),_0x4f79a1,_0x2013a0[_0xfefd('0x2a')][_0xfefd('0x2c')]);return _0x587a10(_0x2013a0[_0xfefd('0x2a')]['message']);}else{logger[_0xfefd('0x2d')](_0xfefd('0x25'),_0x4f79a1,_0xfefd('0x26'));_0x587a10(_0x2013a0[_0xfefd('0x2e')][_0xfefd('0x2c')]);}})[_0xfefd('0x2f')](function(_0x2a2acb){logger[_0xfefd('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f79a1,_0x2a2acb);_0x164833(_0x2a2acb);});});}function respondWithStatusCode(_0x28c6be,_0x50cc43){_0x50cc43=_0x50cc43||0xcc;return function(_0x6fd339){if(_0x6fd339){return _0x28c6be[_0xfefd('0x30')](_0x50cc43);}return _0x28c6be['status'](_0x50cc43)[_0xfefd('0x31')]();};}function respondWithResult(_0x3f3642,_0x22c57b){_0x22c57b=_0x22c57b||0xc8;return function(_0x565384){if(_0x565384){return _0x3f3642['status'](_0x22c57b)[_0xfefd('0x32')](_0x565384);}};}function respondWithFilteredResult(_0x21a0fb,_0x3b5fc0){return function(_0x3e4cce){if(_0x3e4cce){var _0x7f7c5c=typeof _0x3b5fc0[_0xfefd('0x33')]==='undefined'&&typeof _0x3b5fc0[_0xfefd('0x34')]===_0xfefd('0x35');var _0x48b8b4=_0x3e4cce['count'];var _0x5dac2f=_0x7f7c5c?0x0:_0x3b5fc0[_0xfefd('0x33')];var _0x4a7b9e=_0x7f7c5c?_0x3e4cce[_0xfefd('0x36')]:_0x3b5fc0['offset']+_0x3b5fc0[_0xfefd('0x34')];var _0x34a54d;if(_0x4a7b9e>=_0x48b8b4){_0x4a7b9e=_0x48b8b4;_0x34a54d=0xc8;}else{_0x34a54d=0xce;}_0x21a0fb[_0xfefd('0x37')](_0x34a54d);return _0x21a0fb[_0xfefd('0x38')]('Content-Range',_0x5dac2f+'-'+_0x4a7b9e+'/'+_0x48b8b4)[_0xfefd('0x32')](_0x3e4cce);}return null;};}function patchUpdates(_0x259f8f){return function(_0x43cef6){try{jsonpatch['apply'](_0x43cef6,_0x259f8f,!![]);}catch(_0x8ece43){return BPromise[_0xfefd('0x39')](_0x8ece43);}return _0x43cef6['save']();};}function saveUpdates(_0x3c4861,_0x54173d){return function(_0xcd64d5){if(_0xcd64d5){return _0xcd64d5[_0xfefd('0x3a')](_0x3c4861)[_0xfefd('0x24')](function(_0x45d965){return _0x45d965;});}return null;};}function removeEntity(_0x452bec,_0x4a1011){return function(_0x232891){if(_0x232891){return _0x232891[_0xfefd('0x3b')]()[_0xfefd('0x24')](function(){var _0xb3e705=_0x232891[_0xfefd('0x3c')]({'plain':!![]});var _0x3c368a='OpenchannelAccounts';return db[_0xfefd('0x3d')][_0xfefd('0x3b')]({'where':{'type':_0x3c368a,'resourceId':_0xb3e705['id']}})[_0xfefd('0x24')](function(){return _0x232891;});})[_0xfefd('0x24')](function(){_0x452bec[_0xfefd('0x37')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b65e4,_0x33079b){return function(_0x9c2acd){if(!_0x9c2acd){_0x3b65e4[_0xfefd('0x30')](0x194);}return _0x9c2acd;};}function handleError(_0x1c3dd0,_0x220a2b){_0x220a2b=_0x220a2b||0x1f4;return function(_0x64b44b){logger[_0xfefd('0x2a')](_0x64b44b[_0xfefd('0x3e')]);if(_0x64b44b[_0xfefd('0x3f')]){delete _0x64b44b[_0xfefd('0x3f')];}_0x1c3dd0[_0xfefd('0x37')](_0x220a2b)[_0xfefd('0x40')](_0x64b44b);};}exports[_0xfefd('0x41')]=function(_0x140854,_0x5839f1){var _0x2dcf1b={'include':[{'model':db[_0xfefd('0x42')],'as':_0xfefd('0x43')}]},_0x4b3d10={},_0x959217={'count':0x0,'rows':[]};var _0x4920ae=_[_0xfefd('0x44')](db[_0xfefd('0x45')]['rawAttributes'],function(_0x3afbee){return{'name':_0x3afbee[_0xfefd('0x46')],'type':_0x3afbee[_0xfefd('0x47')]['key']};});_0x4b3d10[_0xfefd('0x48')]=_[_0xfefd('0x44')](_0x4920ae,_0xfefd('0x3f'));_0x4b3d10['query']=_[_0xfefd('0x49')](_0x140854[_0xfefd('0x4a')]);_0x4b3d10['filters']=_[_0xfefd('0x4b')](_0x4b3d10[_0xfefd('0x48')],_0x4b3d10['query']);_0x2dcf1b[_0xfefd('0x4c')]=_['intersection'](_0x4b3d10[_0xfefd('0x48')],qs[_0xfefd('0x4d')](_0x140854[_0xfefd('0x4a')][_0xfefd('0x4d')]));_0x2dcf1b[_0xfefd('0x4c')]=_0x2dcf1b[_0xfefd('0x4c')]['length']?_0x2dcf1b[_0xfefd('0x4c')]:_0x4b3d10[_0xfefd('0x48')];if(!_0x140854[_0xfefd('0x4a')][_0xfefd('0x4e')](_0xfefd('0x4f'))){_0x2dcf1b[_0xfefd('0x34')]=qs[_0xfefd('0x34')](_0x140854[_0xfefd('0x4a')][_0xfefd('0x34')]);_0x2dcf1b[_0xfefd('0x33')]=qs[_0xfefd('0x33')](_0x140854[_0xfefd('0x4a')][_0xfefd('0x33')]);}_0x2dcf1b[_0xfefd('0x50')]=qs[_0xfefd('0x51')](_0x140854[_0xfefd('0x4a')][_0xfefd('0x51')]);_0x2dcf1b['where']=qs['filters'](_['pick'](_0x140854[_0xfefd('0x4a')],_0x4b3d10[_0xfefd('0x52')]),_0x4920ae);if(_0x140854[_0xfefd('0x4a')]['filter']){_0x2dcf1b[_0xfefd('0x53')]=_[_0xfefd('0x54')](_0x2dcf1b[_0xfefd('0x53')],{'$or':_[_0xfefd('0x44')](_0x4920ae,function(_0x210d88){if(_0x210d88[_0xfefd('0x47')]!==_0xfefd('0x55')){var _0x1200a8={};_0x1200a8[_0x210d88[_0xfefd('0x3f')]]={'$like':'%'+_0x140854[_0xfefd('0x4a')][_0xfefd('0x56')]+'%'};return _0x1200a8;}})});}_0x2dcf1b=_[_0xfefd('0x54')]({},_0x2dcf1b,_0x140854[_0xfefd('0x57')]);var _0x1559c3={'where':_0x2dcf1b[_0xfefd('0x53')]};return db[_0xfefd('0x45')][_0xfefd('0x36')](_0x1559c3)[_0xfefd('0x24')](function(_0x5db7f1){_0x959217[_0xfefd('0x36')]=_0x5db7f1;if(_0x140854['query'][_0xfefd('0x58')]){_0x2dcf1b[_0xfefd('0x59')]=[{'all':!![]}];}return db[_0xfefd('0x45')][_0xfefd('0x5a')](_0x2dcf1b);})[_0xfefd('0x24')](function(_0x4a7824){_0x959217[_0xfefd('0x5b')]=_0x4a7824;return _0x959217;})[_0xfefd('0x24')](respondWithFilteredResult(_0x5839f1,_0x2dcf1b))[_0xfefd('0x2f')](handleError(_0x5839f1,null));};exports[_0xfefd('0x5c')]=function(_0x502930,_0x240b99){var _0x2373cd={'raw':![],'where':{'id':_0x502930['params']['id']},'include':[{'model':db['Pause'],'as':_0xfefd('0x43')}]},_0x193481={};_0x193481[_0xfefd('0x48')]=_[_0xfefd('0x49')](db[_0xfefd('0x45')][_0xfefd('0x5d')]);_0x193481[_0xfefd('0x4a')]=_[_0xfefd('0x49')](_0x502930[_0xfefd('0x4a')]);_0x193481['filters']=_['intersection'](_0x193481[_0xfefd('0x48')],_0x193481[_0xfefd('0x4a')]);_0x2373cd['attributes']=_['intersection'](_0x193481[_0xfefd('0x48')],qs[_0xfefd('0x4d')](_0x502930['query'][_0xfefd('0x4d')]));_0x2373cd[_0xfefd('0x4c')]=_0x2373cd[_0xfefd('0x4c')][_0xfefd('0x5e')]?_0x2373cd[_0xfefd('0x4c')]:_0x193481['model'];if(_0x502930[_0xfefd('0x4a')][_0xfefd('0x58')]){_0x2373cd[_0xfefd('0x59')]=[{'all':!![]}];}_0x2373cd=_[_0xfefd('0x54')]({},_0x2373cd,_0x502930[_0xfefd('0x57')]);return db[_0xfefd('0x45')]['find'](_0x2373cd)[_0xfefd('0x24')](handleEntityNotFound(_0x240b99,null))[_0xfefd('0x24')](respondWithResult(_0x240b99,null))[_0xfefd('0x2f')](handleError(_0x240b99,null));};exports[_0xfefd('0x5f')]=function(_0x25890a,_0x4be58c){return db[_0xfefd('0x45')][_0xfefd('0x5f')](_0x25890a['body'],{})[_0xfefd('0x24')](function(_0x51ab16){var _0x311bca=_0x25890a[_0xfefd('0x60')][_0xfefd('0x3c')]({'plain':!![]});if(!_0x311bca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x311bca[_0xfefd('0x61')]==='user'){var _0x2c7293=_0x51ab16[_0xfefd('0x3c')]({'plain':!![]});var _0x1fcc0c=_0xfefd('0x62');return db[_0xfefd('0x63')]['find']({'where':{'name':_0x1fcc0c,'userProfileId':_0x311bca[_0xfefd('0x64')]},'raw':!![]})[_0xfefd('0x24')](function(_0x512ee2){if(_0x512ee2&&_0x512ee2[_0xfefd('0x65')]===0x0){return db[_0xfefd('0x3d')][_0xfefd('0x5f')]({'name':_0x2c7293[_0xfefd('0x3f')],'resourceId':_0x2c7293['id'],'type':_0x512ee2[_0xfefd('0x3f')],'sectionId':_0x512ee2['id']},{})['then'](function(){return _0x51ab16;});}else{return _0x51ab16;}})[_0xfefd('0x2f')](function(_0x534aab){logger[_0xfefd('0x2a')](_0xfefd('0x66'),_0x534aab);throw _0x534aab;});}return _0x51ab16;})[_0xfefd('0x24')](respondWithResult(_0x4be58c,0xc9))[_0xfefd('0x2f')](handleError(_0x4be58c,null));};exports[_0xfefd('0x3a')]=function(_0x175ae1,_0x51065a){if(_0x175ae1[_0xfefd('0x67')]['id']){delete _0x175ae1[_0xfefd('0x67')]['id'];}return db[_0xfefd('0x45')]['find']({'where':{'id':_0x175ae1[_0xfefd('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0xfefd('0x43')}]})[_0xfefd('0x24')](handleEntityNotFound(_0x51065a,null))[_0xfefd('0x24')](saveUpdates(_0x175ae1[_0xfefd('0x67')],null))[_0xfefd('0x24')](respondWithResult(_0x51065a,null))[_0xfefd('0x2f')](handleError(_0x51065a,null));};exports[_0xfefd('0x3b')]=function(_0x40ea20,_0x273ac2){return db[_0xfefd('0x45')][_0xfefd('0x69')]({'where':{'id':_0x40ea20[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x273ac2,null))[_0xfefd('0x24')](removeEntity(_0x273ac2,null))[_0xfefd('0x2f')](handleError(_0x273ac2,null));};exports['describe']=function(_0x4dd1d4,_0x247f63){return db['OpenchannelAccount'][_0xfefd('0x6a')]()[_0xfefd('0x24')](respondWithResult(_0x247f63,null))[_0xfefd('0x2f')](handleError(_0x247f63,null));};exports[_0xfefd('0x6b')]=function(_0x15df70,_0x41e096,_0xff1726){if(_0x15df70[_0xfefd('0x67')]['id']){delete _0x15df70[_0xfefd('0x67')]['id'];}return db[_0xfefd('0x45')]['find']({'where':{'id':_0x15df70[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x41e096,null))[_0xfefd('0x24')](function(_0x63c1bd){if(_0x63c1bd){_0x15df70[_0xfefd('0x67')][_0xfefd('0x6c')]=_0x63c1bd['id'];return db[_0xfefd('0x6d')][_0xfefd('0x5f')](_0x15df70['body']);}})[_0xfefd('0x24')](respondWithResult(_0x41e096,null))['catch'](handleError(_0x41e096,null));};exports[_0xfefd('0x6e')]=function(_0xe0427c,_0x2c73d7,_0x5d275a){var _0x2b4f89={'raw':![],'where':{}};var _0x47a683={};var _0x2704ff={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfefd('0x6f')]({'where':{'id':_0xe0427c['params']['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x2c73d7,null))[_0xfefd('0x24')](function(_0x4585d4){if(_0x4585d4){_0x47a683['model']=_['keys'](db['Disposition'][_0xfefd('0x5d')]);_0x47a683[_0xfefd('0x4a')]=_[_0xfefd('0x49')](_0xe0427c[_0xfefd('0x4a')]);_0x47a683[_0xfefd('0x52')]=_['intersection'](_0x47a683[_0xfefd('0x48')],_0x47a683['query']);_0x2b4f89[_0xfefd('0x4c')]=_[_0xfefd('0x4b')](_0x47a683[_0xfefd('0x48')],qs[_0xfefd('0x4d')](_0xe0427c[_0xfefd('0x4a')][_0xfefd('0x4d')]));_0x2b4f89[_0xfefd('0x4c')]=_0x2b4f89['attributes'][_0xfefd('0x5e')]?_0x2b4f89[_0xfefd('0x4c')]:_0x47a683[_0xfefd('0x48')];if(!_0xe0427c[_0xfefd('0x4a')][_0xfefd('0x4e')](_0xfefd('0x4f'))){_0x2b4f89[_0xfefd('0x34')]=qs['limit'](_0xe0427c[_0xfefd('0x4a')]['limit']);_0x2b4f89['offset']=qs['offset'](_0xe0427c[_0xfefd('0x4a')]['offset']);}_0x2b4f89[_0xfefd('0x50')]=qs['sort'](_0xe0427c[_0xfefd('0x4a')][_0xfefd('0x51')]);_0x2b4f89[_0xfefd('0x53')]=qs['filters'](_[_0xfefd('0x70')](_0xe0427c[_0xfefd('0x4a')],_0x47a683[_0xfefd('0x52')]));_0x2b4f89[_0xfefd('0x53')][_0xfefd('0x6c')]=_0x4585d4['id'];if(_0xe0427c[_0xfefd('0x4a')][_0xfefd('0x56')]){_0x2b4f89[_0xfefd('0x53')]=_[_0xfefd('0x54')](_0x2b4f89[_0xfefd('0x53')],{'$or':_['map'](_0x2b4f89[_0xfefd('0x4c')],function(_0x10ee07){var _0x15fe92={};_0x15fe92[_0x10ee07]={'$like':'%'+_0xe0427c[_0xfefd('0x4a')][_0xfefd('0x56')]+'%'};return _0x15fe92;})});}_0x2b4f89=_[_0xfefd('0x54')]({},_0x2b4f89,_0xe0427c[_0xfefd('0x57')]);return db[_0xfefd('0x6d')][_0xfefd('0x36')]({'where':_0x2b4f89[_0xfefd('0x53')]})[_0xfefd('0x24')](function(_0x2471b){_0x2704ff[_0xfefd('0x36')]=_0x2471b;if(_0xe0427c[_0xfefd('0x4a')]['includeAll']){_0x2b4f89[_0xfefd('0x59')]=[{'all':!![]}];}return db[_0xfefd('0x6d')][_0xfefd('0x5a')](_0x2b4f89);})[_0xfefd('0x24')](function(_0x19c876){_0x2704ff[_0xfefd('0x5b')]=_0x19c876;return _0x2704ff;});}})['then'](respondWithFilteredResult(_0x2c73d7,_0x2b4f89))[_0xfefd('0x2f')](handleError(_0x2c73d7,null));};exports[_0xfefd('0x71')]=function(_0x270f3d,_0x4c8cf8,_0x4e86fe){return db[_0xfefd('0x45')][_0xfefd('0x69')]({'where':{'id':_0x270f3d['params']['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x4c8cf8,null))[_0xfefd('0x24')](function(_0x3b92fa){if(_0x3b92fa){return _0x3b92fa[_0xfefd('0x71')](_0x270f3d['query']['ids']);}})[_0xfefd('0x24')](respondWithStatusCode(_0x4c8cf8,null))[_0xfefd('0x2f')](handleError(_0x4c8cf8,null));};exports[_0xfefd('0x72')]=function(_0x1b5250,_0x2ed627,_0x3bcd89){if(_0x1b5250['body']['id']){delete _0x1b5250[_0xfefd('0x67')]['id'];}return db['OpenchannelAccount'][_0xfefd('0x69')]({'where':{'id':_0x1b5250[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x2ed627,null))[_0xfefd('0x24')](function(_0x37bc89){if(_0x37bc89){_0x1b5250[_0xfefd('0x67')]['OpenchannelAccountId']=_0x37bc89['id'];return db[_0xfefd('0x73')]['create'](_0x1b5250[_0xfefd('0x67')]);}})['then'](respondWithResult(_0x2ed627,null))[_0xfefd('0x2f')](handleError(_0x2ed627,null));};exports['getAnswers']=function(_0x4eb08a,_0x2c75cc,_0x49b76a){var _0x4d712e={'raw':![],'where':{}};var _0x9f50ad={};var _0x1916e2={'count':0x0,'rows':[]};return db[_0xfefd('0x45')][_0xfefd('0x6f')]({'where':{'id':_0x4eb08a[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x2c75cc,null))[_0xfefd('0x24')](function(_0x46e228){if(_0x46e228){_0x9f50ad['model']=_[_0xfefd('0x49')](db[_0xfefd('0x73')][_0xfefd('0x5d')]);_0x9f50ad[_0xfefd('0x4a')]=_[_0xfefd('0x49')](_0x4eb08a[_0xfefd('0x4a')]);_0x9f50ad[_0xfefd('0x52')]=_['intersection'](_0x9f50ad[_0xfefd('0x48')],_0x9f50ad['query']);_0x4d712e[_0xfefd('0x4c')]=_['intersection'](_0x9f50ad['model'],qs['fields'](_0x4eb08a[_0xfefd('0x4a')][_0xfefd('0x4d')]));_0x4d712e[_0xfefd('0x4c')]=_0x4d712e['attributes'][_0xfefd('0x5e')]?_0x4d712e[_0xfefd('0x4c')]:_0x9f50ad['model'];if(!_0x4eb08a['query'][_0xfefd('0x4e')](_0xfefd('0x4f'))){_0x4d712e[_0xfefd('0x34')]=qs[_0xfefd('0x34')](_0x4eb08a['query'][_0xfefd('0x34')]);_0x4d712e['offset']=qs['offset'](_0x4eb08a[_0xfefd('0x4a')]['offset']);}_0x4d712e['order']=qs[_0xfefd('0x51')](_0x4eb08a['query'][_0xfefd('0x51')]);_0x4d712e[_0xfefd('0x53')]=qs[_0xfefd('0x52')](_[_0xfefd('0x70')](_0x4eb08a[_0xfefd('0x4a')],_0x9f50ad[_0xfefd('0x52')]));_0x4d712e['where'][_0xfefd('0x6c')]=_0x46e228['id'];if(_0x4eb08a[_0xfefd('0x4a')][_0xfefd('0x56')]){_0x4d712e[_0xfefd('0x53')]=_['merge'](_0x4d712e[_0xfefd('0x53')],{'$or':_[_0xfefd('0x44')](_0x4d712e[_0xfefd('0x4c')],function(_0x2afabb){var _0x10077d={};_0x10077d[_0x2afabb]={'$like':'%'+_0x4eb08a['query'][_0xfefd('0x56')]+'%'};return _0x10077d;})});}_0x4d712e=_[_0xfefd('0x54')]({},_0x4d712e,_0x4eb08a[_0xfefd('0x57')]);return db['CannedAnswer']['count']({'where':_0x4d712e[_0xfefd('0x53')]})[_0xfefd('0x24')](function(_0x523184){_0x1916e2['count']=_0x523184;if(_0x4eb08a[_0xfefd('0x4a')][_0xfefd('0x58')]){_0x4d712e[_0xfefd('0x59')]=[{'all':!![]}];}return db[_0xfefd('0x73')][_0xfefd('0x5a')](_0x4d712e);})[_0xfefd('0x24')](function(_0x18f38f){_0x1916e2['rows']=_0x18f38f;return _0x1916e2;});}})[_0xfefd('0x24')](respondWithFilteredResult(_0x2c75cc,_0x4d712e))['catch'](handleError(_0x2c75cc,null));};exports[_0xfefd('0x74')]=function(_0x4bd300,_0x136a9d,_0x3d8df8){return db[_0xfefd('0x45')][_0xfefd('0x69')]({'where':{'id':_0x4bd300[_0xfefd('0x68')]['id']}})['then'](handleEntityNotFound(_0x136a9d,null))[_0xfefd('0x24')](function(_0x47f411){if(_0x47f411){return _0x47f411['removeAnswers'](_0x4bd300[_0xfefd('0x4a')][_0xfefd('0x75')]);}})[_0xfefd('0x24')](respondWithStatusCode(_0x136a9d,null))[_0xfefd('0x2f')](handleError(_0x136a9d,null));};exports['notify']=function(_0x2c5afe,_0x2289ec,_0x532f24){var _0x1cfa84={'body':_0x2c5afe[_0xfefd('0x67')],'channel':_0xfefd('0x76')};var _0x1ee947=[];var _0x2c73c8=[];var _0x3a2987={};var _0x333b25=![];return db[_0xfefd('0x77')]['describe']()['then'](function(_0x59abbb){if(!_0x59abbb){throw new db['Sequelize'][(_0xfefd('0x78'))]('no\x20available\x20attributes');}_0x1ee947=_[_0xfefd('0x79')](_[_0xfefd('0x49')](_0x59abbb),[_0xfefd('0x7a'),_0xfefd('0x7b')]);_0x2c73c8=_[_0xfefd('0x79')](_['keys'](_0x59abbb),['createdAt',_0xfefd('0x7b'),_0xfefd('0x7c'),'ListId']);if(_0x2c5afe[_0xfefd('0x67')]['id']){delete _0x2c5afe['body']['id'];}if(_['isNil'](_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x7d')])){throw new db[(_0xfefd('0x7e'))][(_0xfefd('0x78'))](_0xfefd('0x7f'));}if(_[_0xfefd('0x80')](_0x2c5afe[_0xfefd('0x67')]['body'])||_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x67')]===''){throw new db[(_0xfefd('0x7e'))][(_0xfefd('0x78'))](_0xfefd('0x81'));}if(_['isNil'](_0x2c5afe['body']['mapKey'])){throw new db[(_0xfefd('0x7e'))][(_0xfefd('0x78'))](_0xfefd('0x82')+_0x2c73c8);}if(!_[_0xfefd('0x83')](_0x2c73c8,_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x84')])){throw new db[(_0xfefd('0x7e'))][(_0xfefd('0x78'))](_0xfefd('0x85')+_0x2c73c8);}_0x3a2987[_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x84')]]=_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x7d')];})[_0xfefd('0x24')](function(){return db[_0xfefd('0x45')][_0xfefd('0x69')]({'where':{'id':_0x2c5afe[_0xfefd('0x68')]['id']},'include':[{'model':db[_0xfefd('0x86')],'as':_0xfefd('0x87'),'include':[{'model':db[_0xfefd('0x77')],'as':_0xfefd('0x88'),'where':_0x3a2987,'limit':0x1,'order':[[_0xfefd('0x7b'),_0xfefd('0x89')]]}]},{'model':db[_0xfefd('0x8a')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x2289ec,null))[_0xfefd('0x24')](function(_0x1e1909){if(_0x1e1909&&_0x1e1909[_0xfefd('0x87')]){_0x1cfa84[_0xfefd('0x8b')]=_0x1e1909;_0x1cfa84[_0xfefd('0x8c')]=_0x1e1909[_0xfefd('0x8d')];_0x1cfa84[_0xfefd('0x8e')]=_0x1e1909[_0xfefd('0x87')];_0x1cfa84[_0xfefd('0x8c')]=_[_0xfefd('0x8f')](_0x1cfa84['applications'],[_0xfefd('0x90')],[_0xfefd('0x91')]);if(_0x1cfa84[_0xfefd('0x8b')]['Applications']){delete _0x1cfa84[_0xfefd('0x8b')]['Applications'];}if(_0x1cfa84[_0xfefd('0x8b')][_0xfefd('0x87')]&&_0x1cfa84['account'][_0xfefd('0x87')][_0xfefd('0x88')][_0xfefd('0x5e')]){return _0x1cfa84[_0xfefd('0x8b')][_0xfefd('0x87')][_0xfefd('0x88')][0x0];}var _0x224491=_['defaults'](_0x2c5afe[_0xfefd('0x67')],{'firstName':_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x7d')],'ListId':_0x1e1909[_0xfefd('0x92')]});_0x224491[_0x2c5afe[_0xfefd('0x67')]['mapKey']]=_0x2c5afe['body'][_0xfefd('0x7d')];return db[_0xfefd('0x77')][_0xfefd('0x5f')](_0x224491,{'fields':_0x1ee947,'raw':!![]});}})['then'](handleEntityNotFound(_0x2289ec,null))['then'](function(_0x9eef11){_0x1cfa84[_0xfefd('0x93')]=_0x9eef11;if(_0x9eef11){var _0x49566d={'ContactId':_0x9eef11['id'],'OpenchannelAccountId':_0x2c5afe['params']['id'],'from':(_0x9eef11[_0xfefd('0x94')]||'')+'\x20'+(_0x9eef11[_0xfefd('0x95')]||'')};var _0x3ecf32={'OpenchannelAccountId':_0x2c5afe['params']['id'],'closed':![]};if(_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x96')]){_0x3ecf32['threadId']=_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x96')];return db[_0xfefd('0x97')][_0xfefd('0x69')]({'where':_0x3ecf32})[_0xfefd('0x24')](function(_0x5a4e70){if(_0x5a4e70){return[_0x5a4e70,![]];}_0x49566d[_0xfefd('0x96')]=_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x96')];_0x49566d[_0xfefd('0x98')]=_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x98')];return db[_0xfefd('0x97')][_0xfefd('0x5f')](_0x49566d)[_0xfefd('0x24')](function(_0x4c91c6){return[_0x4c91c6,!![]];});});}else{_0x3ecf32[_0xfefd('0x96')]=null;}_0x3ecf32[_0xfefd('0x99')]=_0x9eef11['id'];return db[_0xfefd('0x97')][_0xfefd('0x69')]({'where':_0x3ecf32})[_0xfefd('0x24')](function(_0x33168a){if(_0x33168a){return[_0x33168a,![]];}return db['OpenchannelInteraction'][_0xfefd('0x5f')](_0x49566d)[_0xfefd('0x24')](function(_0x58ea87){return[_0x58ea87,!![]];});});}})[_0xfefd('0x9a')](function(_0x380864,_0x1783c8){if(_0x380864){_0x333b25=_0x1783c8;if(!_0x1783c8){var _0x3e2067={'from':(_0x1cfa84[_0xfefd('0x93')]['firstName']||'')+'\x20'+(_0x1cfa84[_0xfefd('0x93')]['lastName']||'')};if(_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x96')]&&_0x2c5afe[_0xfefd('0x67')][_0xfefd('0x9b')]&&_0x2c5afe[_0xfefd('0x67')]['threadId']!=_0x2c5afe[_0xfefd('0x67')]['messageId']){_0x3e2067[_0xfefd('0x96')]=_0x2c5afe['body'][_0xfefd('0x9b')];}return _0x380864[_0xfefd('0x3a')](_0x3e2067);}else{return _0x380864;}}})[_0xfefd('0x24')](function(_0x50dfb7){_0x1cfa84[_0xfefd('0x9c')]=_0x50dfb7[_0xfefd('0x3c')]({'plain':!![]});_0x1cfa84[_0xfefd('0x9c')][_0xfefd('0x9d')]=_0x333b25;if(_0x1cfa84[_0xfefd('0x9c')][_0xfefd('0x9d')]){if(_0x1cfa84[_0xfefd('0x8b')][_0xfefd('0x9e')]){_0x1cfa84['applications'][_0xfefd('0x9f')]({'id':0x0,'priority':_0x1cfa84[_0xfefd('0x8c')][_0xfefd('0x5e')]+0x1,'app':_0xfefd('0xa0'),'appdata':_0xfefd('0xa1'),'interval':_0xfefd('0xa2')});}}return db[_0xfefd('0xa3')]['create']({'body':_0x2c5afe[_0xfefd('0x67')]['body'],'OpenchannelAccountId':_0x2c5afe['params']['id'],'OpenchannelInteractionId':_0x50dfb7['id'],'direction':'in','ContactId':_0x1cfa84[_0xfefd('0x93')]['id'],'AttachmentId':_0x2c5afe[_0xfefd('0x67')][_0xfefd('0xa4')]});})[_0xfefd('0x24')](function(_0x12503a){_0x1cfa84[_0xfefd('0x2c')]=_0x12503a;if(_0x1cfa84[_0xfefd('0x9c')][_0xfefd('0xa5')]){return db[_0xfefd('0xa6')][_0xfefd('0x69')]({'attributes':['id',_0xfefd('0x3f')],'where':{'id':_0x1cfa84[_0xfefd('0x9c')][_0xfefd('0xa5')]}})[_0xfefd('0x24')](function(_0x4749c4){if(_0x4749c4){_0x1cfa84[_0xfefd('0x8c')][_0xfefd('0xa7')]({'id':0x0,'priority':0x0,'app':_0xfefd('0xa8'),'appdata':_0x4749c4['name']+','+(_0x1cfa84['account']['waitForTheAssignedAgent']||0xa),'interval':_0xfefd('0xa2')});_0x1cfa84[_0xfefd('0xa9')]=![];}return respondWithRpcPromise(_0xfefd('0xaa'),_0xfefd('0xab'),_0x1cfa84);});}return respondWithRpcPromise(_0xfefd('0xaa'),_0xfefd('0xab'),_0x1cfa84);})[_0xfefd('0x24')](function(_0x49d21e){respondWithRpcPromise(_0xfefd('0xac'),_0xfefd('0xac'),{'event':_0xfefd('0xad'),'message':_0x49d21e},client9002);return _0x49d21e;})[_0xfefd('0x24')](respondWithResult(_0x2289ec,null))[_0xfefd('0x2f')](handleError(_0x2289ec,null));};exports[_0xfefd('0xae')]=function(_0x1af47f,_0x3989ed,_0x1b34db){return db['OpenchannelAccount'][_0xfefd('0x6f')]({'where':{'id':_0x1af47f['params']['id']}})['then'](handleEntityNotFound(_0x3989ed,null))['then'](function(_0x2c19cf){if(_0x2c19cf){return db['sequelize']['transaction'](function(_0xaea0d8){return db[_0xfefd('0x8a')][_0xfefd('0x3b')]({'where':{'OpenchannelAccountId':_0x1af47f[_0xfefd('0x68')]['id']},'transaction':_0xaea0d8})[_0xfefd('0x24')](function(_0x3eeeb6){var _0x12de1d=_[_0xfefd('0x44')](_0x1af47f[_0xfefd('0x67')],function(_0x52c0d6){_0x52c0d6['OpenchannelAccountId']=_0x1af47f[_0xfefd('0x68')]['id'];return _0x52c0d6;});return db[_0xfefd('0x8a')][_0xfefd('0xaf')](_0x12de1d,{'transaction':_0xaea0d8});});})[_0xfefd('0x24')](function(){return db[_0xfefd('0x8a')][_0xfefd('0xb0')]({'where':{'OpenchannelAccountId':_0x1af47f[_0xfefd('0x68')]['id']},'order':'priority'});});}})[_0xfefd('0x24')](respondWithResult(_0x3989ed,null))[_0xfefd('0x2f')](handleError(_0x3989ed,null));};exports['getApplications']=function(_0x1ad1a3,_0x411868,_0x56fa2a){var _0x4d9bc7={};var _0x323aad={};var _0x304413;var _0x17de4b;return db[_0xfefd('0x45')]['findOne']({'where':{'id':_0x1ad1a3['params']['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x411868,null))[_0xfefd('0x24')](function(_0x52ffc5){if(_0x52ffc5){_0x304413=_0x52ffc5;_0x323aad['model']=_['keys'](db['OpenchannelApplication'][_0xfefd('0x5d')]);_0x323aad['query']=_[_0xfefd('0x49')](_0x1ad1a3[_0xfefd('0x4a')]);_0x323aad[_0xfefd('0x52')]=_['intersection'](_0x323aad[_0xfefd('0x48')],_0x323aad[_0xfefd('0x4a')]);_0x4d9bc7[_0xfefd('0x4c')]=_[_0xfefd('0x4b')](_0x323aad[_0xfefd('0x48')],qs['fields'](_0x1ad1a3[_0xfefd('0x4a')][_0xfefd('0x4d')]));_0x4d9bc7[_0xfefd('0x4c')]=_0x4d9bc7['attributes']['length']?_0x4d9bc7[_0xfefd('0x4c')]:_0x323aad[_0xfefd('0x48')];_0x4d9bc7[_0xfefd('0x50')]=qs[_0xfefd('0x51')](_0x1ad1a3[_0xfefd('0x4a')]['sort']);_0x4d9bc7[_0xfefd('0x53')]=qs[_0xfefd('0x52')](_[_0xfefd('0x70')](_0x1ad1a3[_0xfefd('0x4a')],_0x323aad['filters']));if(_0x1ad1a3[_0xfefd('0x4a')][_0xfefd('0x56')]){_0x4d9bc7[_0xfefd('0x53')]=_[_0xfefd('0x54')](_0x4d9bc7[_0xfefd('0x53')],{'$or':_[_0xfefd('0x44')](_0x4d9bc7[_0xfefd('0x4c')],function(_0x14ca2a){var _0x121ad8={};_0x121ad8[_0x14ca2a]={'$like':'%'+_0x1ad1a3[_0xfefd('0x4a')]['filter']+'%'};return _0x121ad8;})});}_0x4d9bc7=_[_0xfefd('0x54')]({},_0x4d9bc7,_0x1ad1a3[_0xfefd('0x57')]);return _0x304413['getApplications'](_0x4d9bc7);}})[_0xfefd('0x24')](function(_0x363b1d){if(_0x363b1d){_0x17de4b=_0x363b1d[_0xfefd('0x5e')];if(!_0x1ad1a3[_0xfefd('0x4a')][_0xfefd('0x4e')](_0xfefd('0x4f'))){_0x4d9bc7['limit']=qs[_0xfefd('0x34')](_0x1ad1a3[_0xfefd('0x4a')][_0xfefd('0x34')]);_0x4d9bc7[_0xfefd('0x33')]=qs[_0xfefd('0x33')](_0x1ad1a3['query'][_0xfefd('0x33')]);}return _0x304413[_0xfefd('0xb1')](_0x4d9bc7);}})['then'](function(_0x8f744a){if(_0x8f744a){return _0x8f744a?{'count':_0x17de4b,'rows':_0x8f744a}:null;}})[_0xfefd('0x24')](respondWithResult(_0x411868,null))[_0xfefd('0x2f')](handleError(_0x411868,null));};exports[_0xfefd('0xb2')]=function(_0x4f2600,_0x4c5896,_0x2ad4ff){var _0x5da9b4={'raw':![],'where':{}};var _0x51fcdc={};var _0x5b2c60={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfefd('0x6f')]({'where':{'id':_0x4f2600[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x4c5896,null))[_0xfefd('0x24')](function(_0x5b36a7){if(_0x5b36a7){_0x51fcdc[_0xfefd('0x48')]=_[_0xfefd('0x49')](db[_0xfefd('0x97')]['rawAttributes']);_0x51fcdc[_0xfefd('0x4a')]=_[_0xfefd('0x49')](_0x4f2600[_0xfefd('0x4a')]);_0x51fcdc[_0xfefd('0x52')]=_['intersection'](_0x51fcdc['model'],_0x51fcdc[_0xfefd('0x4a')]);_0x5da9b4[_0xfefd('0x4c')]=_['intersection'](_0x51fcdc[_0xfefd('0x48')],qs['fields'](_0x4f2600[_0xfefd('0x4a')][_0xfefd('0x4d')]));_0x5da9b4[_0xfefd('0x4c')]=_0x5da9b4[_0xfefd('0x4c')][_0xfefd('0x5e')]?_0x5da9b4[_0xfefd('0x4c')]:_0x51fcdc[_0xfefd('0x48')];if(!_0x4f2600[_0xfefd('0x4a')][_0xfefd('0x4e')](_0xfefd('0x4f'))){_0x5da9b4['limit']=qs[_0xfefd('0x34')](_0x4f2600[_0xfefd('0x4a')][_0xfefd('0x34')]);_0x5da9b4['offset']=qs[_0xfefd('0x33')](_0x4f2600['query'][_0xfefd('0x33')]);}_0x5da9b4[_0xfefd('0x50')]=qs[_0xfefd('0x51')](_0x4f2600[_0xfefd('0x4a')]['sort']);_0x5da9b4[_0xfefd('0x53')]=qs[_0xfefd('0x52')](_['pick'](_0x4f2600['query'],_0x51fcdc[_0xfefd('0x52')]));_0x5da9b4['where']['OpenchannelAccountId']=_0x5b36a7['id'];if(_0x4f2600['query'][_0xfefd('0x56')]){_0x5da9b4[_0xfefd('0x53')]=_[_0xfefd('0x54')](_0x5da9b4[_0xfefd('0x53')],{'$or':_['map'](_0x5da9b4[_0xfefd('0x4c')],function(_0x95bdfb){var _0x2862da={};_0x2862da[_0x95bdfb]={'$like':'%'+_0x4f2600[_0xfefd('0x4a')][_0xfefd('0x56')]+'%'};return _0x2862da;})});}_0x5da9b4=_[_0xfefd('0x54')]({},_0x5da9b4,_0x4f2600['options']);return db[_0xfefd('0x97')][_0xfefd('0x36')]({'where':_0x5da9b4[_0xfefd('0x53')]})[_0xfefd('0x24')](function(_0x2b3c2b){_0x5b2c60[_0xfefd('0x36')]=_0x2b3c2b;if(_0x4f2600[_0xfefd('0x4a')]['includeAll']){_0x5da9b4['include']=[{'model':db['CmContact'],'as':_0xfefd('0xb3'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xfefd('0x3f'),_0xfefd('0xb4'),_0xfefd('0xb5')],'required':![]},{'model':db[_0xfefd('0xb6')],'as':_0xfefd('0xb7'),'attributes':['id','name','color'],'where':_0x4f2600[_0xfefd('0x4a')][_0xfefd('0xb8')]?{'id':_0x4f2600[_0xfefd('0x4a')]['tag']}:undefined,'required':_0x4f2600['query'][_0xfefd('0xb8')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xfefd('0x5a')](_0x5da9b4);})[_0xfefd('0x24')](function(_0x4ecf29){_0x5b2c60['rows']=_0x4ecf29;return _0x5b2c60;});}})[_0xfefd('0x24')](respondWithFilteredResult(_0x4c5896,_0x5da9b4))['catch'](handleError(_0x4c5896,null));};exports[_0xfefd('0xb9')]=function(_0x3e02d9,_0x2ca1c7,_0x1fdb20){return db[_0xfefd('0x45')]['find']({'where':{'id':_0x3e02d9[_0xfefd('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ca1c7,null))['then'](function(_0x4a4f52){if(_0x4a4f52){return _0x4a4f52[_0xfefd('0xb9')](_0x3e02d9[_0xfefd('0x67')][_0xfefd('0x75')],_[_0xfefd('0xba')](_0x3e02d9[_0xfefd('0x67')],[_0xfefd('0x75'),'id'])||{})[_0xfefd('0x9a')](function(_0x5e9dc4){for(var _0x469cdc=0x0;_0x469cdc<_0x3e02d9[_0xfefd('0x67')][_0xfefd('0x75')]['length'];_0x469cdc+=0x1){socket['emit'](_0xfefd('0xbb'),{'UserId':Number(_0x3e02d9[_0xfefd('0x67')][_0xfefd('0x75')][_0x469cdc]),'OpenchannelAccountId':Number(_0x3e02d9['params']['id'])});}return _0x5e9dc4;});}})[_0xfefd('0x24')](respondWithResult(_0x2ca1c7,null))[_0xfefd('0x2f')](handleError(_0x2ca1c7,null));};exports[_0xfefd('0xbc')]=function(_0x272fec,_0x1bcc87,_0x55905b){return db[_0xfefd('0x45')][_0xfefd('0x69')]({'where':{'id':_0x272fec[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x1bcc87,null))['then'](function(_0x330791){if(_0x330791){return _0x330791['removeAgents'](_0x272fec[_0xfefd('0x4a')][_0xfefd('0x75')])['then'](function(){if(_[_0xfefd('0xbd')](_0x272fec[_0xfefd('0x4a')]['ids'])){for(var _0x1375c4=0x0;_0x1375c4<_0x272fec[_0xfefd('0x4a')][_0xfefd('0x75')][_0xfefd('0x5e')];_0x1375c4+=0x1){socket[_0xfefd('0xbe')]('userOpenchannelAccount:remove',{'UserId':Number(_0x272fec[_0xfefd('0x4a')][_0xfefd('0x75')][_0x1375c4]),'OpenchannelAccountId':Number(_0x272fec['params']['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x272fec[_0xfefd('0x4a')][_0xfefd('0x75')]),'OpenchannelAccountId':Number(_0x272fec[_0xfefd('0x68')]['id'])});}});}})[_0xfefd('0x24')](respondWithStatusCode(_0x1bcc87,null))['catch'](handleError(_0x1bcc87,null));};exports[_0xfefd('0xbf')]=function(_0x558020,_0x99e4a3,_0x407496){var _0x582d54={};var _0x516480={};var _0x19a5fb;var _0x119742;return db[_0xfefd('0x45')][_0xfefd('0x6f')]({'where':{'id':_0x558020[_0xfefd('0x68')]['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x99e4a3,null))[_0xfefd('0x24')](function(_0x217b69){if(_0x217b69){_0x19a5fb=_0x217b69;_0x516480[_0xfefd('0x48')]=_[_0xfefd('0x49')](db['User'][_0xfefd('0x5d')]);_0x516480[_0xfefd('0x4a')]=_[_0xfefd('0x49')](_0x558020['query']);_0x516480[_0xfefd('0x52')]=_['intersection'](_0x516480[_0xfefd('0x48')],_0x516480[_0xfefd('0x4a')]);_0x582d54[_0xfefd('0x4c')]=_[_0xfefd('0x4b')](_0x516480[_0xfefd('0x48')],qs[_0xfefd('0x4d')](_0x558020['query'][_0xfefd('0x4d')]));_0x582d54['attributes']=_0x582d54[_0xfefd('0x4c')][_0xfefd('0x5e')]?_0x582d54[_0xfefd('0x4c')]:_0x516480[_0xfefd('0x48')];_0x582d54['order']=qs[_0xfefd('0x51')](_0x558020['query']['sort']);_0x582d54[_0xfefd('0x53')]=qs[_0xfefd('0x52')](_[_0xfefd('0x70')](_0x558020['query'],_0x516480[_0xfefd('0x52')]));if(_0x558020[_0xfefd('0x4a')][_0xfefd('0x56')]){_0x582d54[_0xfefd('0x53')]=_['merge'](_0x582d54[_0xfefd('0x53')],{'$or':_[_0xfefd('0x44')](_0x582d54['attributes'],function(_0x2ee175){var _0x3850cd={};_0x3850cd[_0x2ee175]={'$like':'%'+_0x558020[_0xfefd('0x4a')][_0xfefd('0x56')]+'%'};return _0x3850cd;})});}_0x582d54=_[_0xfefd('0x54')]({},_0x582d54,_0x558020[_0xfefd('0x57')]);return _0x19a5fb[_0xfefd('0xbf')](_0x582d54);}})[_0xfefd('0x24')](function(_0x38917){if(_0x38917){_0x119742=_0x38917[_0xfefd('0x5e')];if(!_0x558020[_0xfefd('0x4a')][_0xfefd('0x4e')]('nolimit')){_0x582d54[_0xfefd('0x34')]=qs['limit'](_0x558020['query'][_0xfefd('0x34')]);_0x582d54[_0xfefd('0x33')]=qs[_0xfefd('0x33')](_0x558020['query'][_0xfefd('0x33')]);}return _0x19a5fb[_0xfefd('0xbf')](_0x582d54);}})[_0xfefd('0x24')](function(_0x4fa1a4){if(_0x4fa1a4){return _0x4fa1a4?{'count':_0x119742,'rows':_0x4fa1a4}:null;}})[_0xfefd('0x24')](respondWithResult(_0x99e4a3,null))[_0xfefd('0x2f')](handleError(_0x99e4a3,null));};exports['send']=function(_0xfe2414,_0x141c5b,_0xe8be4d){var _0x4cf9cb,_0x1bafb9,_0x5ace69;if(_[_0xfefd('0x80')](_0xfe2414[_0xfefd('0x67')][_0xfefd('0x67')])||_0xfe2414[_0xfefd('0x67')][_0xfefd('0x67')]===''){throw new db[(_0xfefd('0x7e'))][(_0xfefd('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xfe2414[_0xfefd('0x67')]['to'])){}_0x4cf9cb=_0xfe2414['body']['to'];return db[_0xfefd('0x45')][_0xfefd('0x6f')]({'where':{'id':_0xfe2414['params']['id']}})[_0xfefd('0x24')](handleEntityNotFound(_0x141c5b,null))[_0xfefd('0x24')](function(_0x17aa4e){if(_0x17aa4e){return db['OpenchannelAccount'][_0xfefd('0x69')]({'where':{'id':_0x17aa4e['id']},'include':[{'model':db[_0xfefd('0x86')],'as':_0xfefd('0x87'),'include':[{'model':db[_0xfefd('0x77')],'as':_0xfefd('0x88'),'where':{[_0x17aa4e[_0xfefd('0x84')]]:_0x4cf9cb},'limit':0x1,'order':[[_0xfefd('0x7b'),_0xfefd('0x89')]]}]}]})[_0xfefd('0x24')](handleEntityNotFound(_0x141c5b,null))[_0xfefd('0x24')](function(_0x355be4){if(_0x355be4&&_0x355be4[_0xfefd('0x87')]){_0x1bafb9=_0x355be4[_0xfefd('0x3c')]({'plain':!![]});if(_0x1bafb9[_0xfefd('0x87')]&&_0x1bafb9[_0xfefd('0x87')]['Contacts'][_0xfefd('0x5e')]){return _0x1bafb9['List'][_0xfefd('0x88')][0x0];}return db[_0xfefd('0x77')][_0xfefd('0x5f')](_[_0xfefd('0x1d')](_0xfe2414[_0xfefd('0x67')],{'firstName':_0x4cf9cb,[_0x355be4['mapKey']]:_0x4cf9cb,'phone':_0x4cf9cb,'ListId':_0x1bafb9[_0xfefd('0x92')]}));}})[_0xfefd('0x24')](handleEntityNotFound(_0x141c5b,null))[_0xfefd('0x24')](function(_0x548938){if(_0x548938){_0x5ace69=_0x548938;return db[_0xfefd('0x97')][_0xfefd('0x69')]({'where':{'ContactId':_0x5ace69['id'],'closed':![],'OpenchannelAccountId':_0x1bafb9['id']}})[_0xfefd('0x24')](function(_0x3573ef){if(_0x3573ef){return[_0x3573ef,![]];}return db[_0xfefd('0x97')]['create']({'UserId':_0xfe2414[_0xfefd('0x60')]['id'],'ContactId':_0x5ace69['id'],'OpenchannelAccountId':_0x1bafb9['id'],'lastMsgDirection':_0xfefd('0xc0'),'Messages':[_['merge'](_0xfe2414['body'],{'read':![],'body':_0xfe2414[_0xfefd('0x67')][_0xfefd('0x67')],'OpenchannelAccountId':_0x1bafb9['id'],'UserId':_0xfe2414[_0xfefd('0x60')]['id'],'ContactId':_0x5ace69['id']})]},{'include':[{'model':db[_0xfefd('0xa3')],'as':_0xfefd('0xc1')}]})[_0xfefd('0x24')](function(_0x83ef28){return[_0x83ef28,!![]];});});}})[_0xfefd('0x9a')](function(_0x4fdd42,_0x3345f2){if(_0x3345f2){return _0x4fdd42;}return db['OpenchannelMessage'][_0xfefd('0x5f')](_[_0xfefd('0x54')](_0xfe2414[_0xfefd('0x67')],{'read':![],'body':_0xfe2414[_0xfefd('0x67')][_0xfefd('0x67')],'OpenchannelAccountId':_0x1bafb9['id'],'OpenchannelInteractionId':_0x4fdd42['id'],'UserId':_0xfe2414[_0xfefd('0x60')]['id'],'ContactId':_0x5ace69['id']}))[_0xfefd('0x24')](function(_0x28d2b3){_0x4fdd42[_0xfefd('0xc2')]['Messages']=[];_0x4fdd42['dataValues'][_0xfefd('0xc1')][_0xfefd('0x9f')](_0x28d2b3[_0xfefd('0xc2')]);return _0x4fdd42;});});}})[_0xfefd('0x24')](respondWithResult(_0x141c5b,null))['catch'](handleError(_0x141c5b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e1a5771..5cbaf50 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 _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2e0d2a,_0x8d568){var _0x4014f0=function(_0x3dd59d){while(--_0x3dd59d){_0x2e0d2a['push'](_0x2e0d2a['shift']());}};_0x4014f0(++_0x8d568);}(_0xb688,0xcf));var _0x8b68=function(_0x2c180c,_0x17f93d){_0x2c180c=_0x2c180c-0x0;var _0x50a331=_0xb688[_0x2c180c];return _0x50a331;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xda55,0x6d));var _0x5da5=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0xda55[_0x40d078];return _0x46fc81;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 0a9aa45..9fe9dec 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xdea6f3,_0x8c6aad){var _0x237677=function(_0x4cec05){while(--_0x4cec05){_0xdea6f3['push'](_0xdea6f3['shift']());}};_0x237677(++_0x8c6aad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x16e231,_0x3ac9e3){var _0x16b90c=function(_0x374f7c){while(--_0x374f7c){_0x16e231['push'](_0x16e231['shift']());}};_0x16b90c(++_0x3ac9e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 5dfbcc7..5d12ea3 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 _0x5eb8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x43c29e,_0x8b5359){var _0x2bef22=function(_0x2fa707){while(--_0x2fa707){_0x43c29e['push'](_0x43c29e['shift']());}};_0x2bef22(++_0x8b5359);}(_0x5eb8,0xb0));var _0x85eb=function(_0x114bdf,_0x119ada){_0x114bdf=_0x114bdf-0x0;var _0x5658f6=_0x5eb8[_0x114bdf];return _0x5658f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./openchannelAccount.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});} \ No newline at end of file +var _0xa571=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x4cdedd,_0x419dc7){var _0x5f3f4e=function(_0x1bcd16){while(--_0x1bcd16){_0x4cdedd['push'](_0x4cdedd['shift']());}};_0x5f3f4e(++_0x419dc7);}(_0xa571,0x107));var _0x1a57=function(_0x1b1a85,_0x13080e){_0x1b1a85=_0x1b1a85-0x0;var _0x1374f2=_0xa571[_0x1b1a85];return _0x1374f2;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});config[_0x1a57('0xa')]=_[_0x1a57('0xb')](config[_0x1a57('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a57('0xc'))(new Redis(config[_0x1a57('0xa')]));require(_0x1a57('0xd'))['register'](socket);function respondWithRpcPromise(_0x3c8182,_0x1f7086,_0x4740ef){return new BPromise(function(_0x289dc0,_0x831937){return client[_0x1a57('0xe')](_0x3c8182,_0x4740ef)[_0x1a57('0xf')](function(_0x22c683){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1f7086,_0x1a57('0x10'));logger[_0x1a57('0x11')](_0x1a57('0x12'),_0x1f7086,'request\x20sent',JSON[_0x1a57('0x13')](_0x22c683));if(_0x22c683[_0x1a57('0x14')]){if(_0x22c683['error'][_0x1a57('0x15')]===0x1f4){logger['error'](_0x1a57('0x16'),_0x1f7086,_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);return _0x831937(_0x22c683[_0x1a57('0x14')]['message']);}logger[_0x1a57('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x1f7086,_0x22c683['error'][_0x1a57('0x17')]);return _0x289dc0(_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);}else{logger['info'](_0x1a57('0x16'),_0x1f7086,_0x1a57('0x10'));_0x289dc0(_0x22c683[_0x1a57('0x18')]['message']);}})[_0x1a57('0x19')](function(_0x4262c8){logger[_0x1a57('0x14')](_0x1a57('0x16'),_0x1f7086,_0x4262c8);_0x831937(_0x4262c8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9a42e77..1c122d9 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 _0x0e9f=['register','length','./openchannelAccount.events','save','emit','removeListener'];(function(_0x4129c6,_0x34f475){var _0x3cb731=function(_0x3c3d0c){while(--_0x3c3d0c){_0x4129c6['push'](_0x4129c6['shift']());}};_0x3cb731(++_0x34f475);}(_0x0e9f,0x116));var _0xf0e9=function(_0x37398a,_0x3e15b9){_0x37398a=_0x37398a-0x0;var _0x27eced=_0x0e9f[_0x37398a];return _0x27eced;};'use strict';var OpenchannelAccountEvents=require(_0xf0e9('0x0'));var events=[_0xf0e9('0x1'),'remove','update'];function createListener(_0x15215f,_0x4c067c){return function(_0x4b7f25){_0x4c067c[_0xf0e9('0x2')](_0x15215f,_0x4b7f25);};}function removeListener(_0x559cad,_0x52a19d){return function(){OpenchannelAccountEvents[_0xf0e9('0x3')](_0x559cad,_0x52a19d);};}exports[_0xf0e9('0x4')]=function(_0x59ac7e){for(var _0x2322dc=0x0,_0x4a35a3=events[_0xf0e9('0x5')];_0x2322dc<_0x4a35a3;_0x2322dc++){var _0x2fa08f=events[_0x2322dc];var _0x106ba0=createListener('openchannelAccount:'+_0x2fa08f,_0x59ac7e);OpenchannelAccountEvents['on'](_0x2fa08f,_0x106ba0);}}; \ No newline at end of file +var _0x81d5=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0x81d5,0x1ab));var _0x581d=function(_0x40d652,_0x3442ff){_0x40d652=_0x40d652-0x0;var _0x5e92f1=_0x81d5[_0x40d652];return _0x5e92f1;};'use strict';var OpenchannelAccountEvents=require(_0x581d('0x0'));var events=[_0x581d('0x1'),'remove',_0x581d('0x2')];function createListener(_0x20d1a8,_0x2fe463){return function(_0x9fb336){_0x2fe463[_0x581d('0x3')](_0x20d1a8,_0x9fb336);};}function removeListener(_0x553617,_0x4801bc){return function(){OpenchannelAccountEvents[_0x581d('0x4')](_0x553617,_0x4801bc);};}exports[_0x581d('0x5')]=function(_0x1895d2){for(var _0x4bb545=0x0,_0x16067b=events[_0x581d('0x6')];_0x4bb545<_0x16067b;_0x4bb545++){var _0x43124c=events[_0x4bb545];var _0x497368=createListener(_0x581d('0x7')+_0x43124c,_0x1895d2);OpenchannelAccountEvents['on'](_0x43124c,_0x497368);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d890284..8cab9ef 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 _0xc31c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc31c,0x151));var _0xcc31=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc31c[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0xcc31('0x0'));var util=require(_0xcc31('0x1'));var path=require(_0xcc31('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc31('0x3'));var router=express[_0xcc31('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc31('0x5'));var interaction=require(_0xcc31('0x6'));var config=require(_0xcc31('0x7'));var controller=require(_0xcc31('0x8'));router['get']('/',auth[_0xcc31('0x9')](),controller[_0xcc31('0xa')]);router['get'](_0xcc31('0xb'),auth[_0xcc31('0x9')](),controller[_0xcc31('0xc')]);router['post']('/',auth[_0xcc31('0x9')](),controller[_0xcc31('0xd')]);router[_0xcc31('0xe')](_0xcc31('0xb'),auth[_0xcc31('0x9')](),controller[_0xcc31('0xf')]);router[_0xcc31('0x10')](_0xcc31('0xb'),auth[_0xcc31('0x9')](),controller[_0xcc31('0x11')]);module[_0xcc31('0x12')]=router; \ No newline at end of file +var _0x3e26=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x48effb,_0x224637){var _0x43c343=function(_0x42a3c1){while(--_0x42a3c1){_0x48effb['push'](_0x48effb['shift']());}};_0x43c343(++_0x224637);}(_0x3e26,0xfb));var _0x63e2=function(_0x6ec628,_0x2483f2){_0x6ec628=_0x6ec628-0x0;var _0x15867d=_0x3e26[_0x6ec628];return _0x15867d;};'use strict';var multer=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var path=require(_0x63e2('0x2'));var timeout=require(_0x63e2('0x3'));var express=require(_0x63e2('0x4'));var router=express[_0x63e2('0x5')]();var fs_extra=require(_0x63e2('0x6'));var auth=require(_0x63e2('0x7'));var interaction=require(_0x63e2('0x8'));var config=require(_0x63e2('0x9'));var controller=require(_0x63e2('0xa'));router[_0x63e2('0xb')]('/',auth[_0x63e2('0xc')](),controller['index']);router[_0x63e2('0xb')](_0x63e2('0xd'),auth[_0x63e2('0xc')](),controller[_0x63e2('0xe')]);router[_0x63e2('0xf')]('/',auth[_0x63e2('0xc')](),controller[_0x63e2('0x10')]);router[_0x63e2('0x11')](_0x63e2('0xd'),auth[_0x63e2('0xc')](),controller[_0x63e2('0x12')]);router[_0x63e2('0x13')]('/:id',auth[_0x63e2('0xc')](),controller[_0x63e2('0x14')]);module[_0x63e2('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index f45d260..15d0f9b 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 _0x0b57=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4c3385,_0x449ed0){var _0x4dfc59=function(_0x286a1b){while(--_0x286a1b){_0x4c3385['push'](_0x4c3385['shift']());}};_0x4dfc59(++_0x449ed0);}(_0x0b57,0xb1));var _0x70b5=function(_0xc46b33,_0x34fc66){_0xc46b33=_0xc46b33-0x0;var _0x477de6=_0x0b57[_0xc46b33];return _0x477de6;};'use strict';var Sequelize=require(_0x70b5('0x0'));module[_0x70b5('0x1')]={'priority':{'type':Sequelize[_0x70b5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x70b5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x70b5('0x4')],'defaultValue':_0x70b5('0x5')}}; \ No newline at end of file +var _0x1df4=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1df4,0x15f));var _0x41df=function(_0x39ad75,_0x1da505){_0x39ad75=_0x39ad75-0x0;var _0xd11f45=_0x1df4[_0x39ad75];return _0xd11f45;};'use strict';var Sequelize=require(_0x41df('0x0'));module[_0x41df('0x1')]={'priority':{'type':Sequelize[_0x41df('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x41df('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x41df('0x4')]()},'description':{'type':Sequelize[_0x41df('0x3')]},'interval':{'type':Sequelize[_0x41df('0x3')],'defaultValue':_0x41df('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 2b55e5b..4c59b69 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 _0xc3b5=['to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','moment','util','path'];(function(_0xc3b6a4,_0x3c1201){var _0x212df7=function(_0x4c1431){while(--_0x4c1431){_0xc3b6a4['push'](_0xc3b6a4['shift']());}};_0x212df7(++_0x3c1201);}(_0xc3b5,0xcc));var _0x5c3b=function(_0x1a5ce3,_0x465a2c){_0x1a5ce3=_0x1a5ce3-0x0;var _0xd8a877=_0xc3b5[_0x1a5ce3];return _0xd8a877;};'use strict';var emlformat=require(_0x5c3b('0x0'));var rimraf=require(_0x5c3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c3b('0x2'));var rp=require('request-promise');var moment=require(_0x5c3b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c3b('0x4'));var path=require(_0x5c3b('0x5'));var sox=require('sox');var csv=require(_0x5c3b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3b('0x7'));var squel=require(_0x5c3b('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c3b('0x6'));var querystring=require(_0x5c3b('0x9'));var Papa=require(_0x5c3b('0xa'));var Redis=require(_0x5c3b('0xb'));var authService=require(_0x5c3b('0xc'));var qs=require(_0x5c3b('0xd'));var as=require(_0x5c3b('0xe'));var hardwareService=require(_0x5c3b('0xf'));var logger=require(_0x5c3b('0x10'))(_0x5c3b('0x11'));var utils=require(_0x5c3b('0x12'));var config=require(_0x5c3b('0x13'));var licenseUtil=require(_0x5c3b('0x14'));var db=require(_0x5c3b('0x15'))['db'];function respondWithStatusCode(_0x1b4765,_0x543c03){_0x543c03=_0x543c03||0xcc;return function(_0x53ba1e){if(_0x53ba1e){return _0x1b4765['sendStatus'](_0x543c03);}return _0x1b4765[_0x5c3b('0x16')](_0x543c03)['end']();};}function respondWithResult(_0x577e2d,_0x342b21){_0x342b21=_0x342b21||0xc8;return function(_0xbcb35){if(_0xbcb35){return _0x577e2d[_0x5c3b('0x16')](_0x342b21)[_0x5c3b('0x17')](_0xbcb35);}};}function respondWithFilteredResult(_0x2a0baa,_0xba2d69){return function(_0x57d9dd){if(_0x57d9dd){var _0x1b2291=typeof _0xba2d69[_0x5c3b('0x18')]===_0x5c3b('0x19')&&typeof _0xba2d69[_0x5c3b('0x1a')]==='undefined';var _0x28b9f3=_0x57d9dd[_0x5c3b('0x1b')];var _0x3975d9=_0x1b2291?0x0:_0xba2d69[_0x5c3b('0x18')];var _0x4a737e=_0x1b2291?_0x57d9dd[_0x5c3b('0x1b')]:_0xba2d69[_0x5c3b('0x18')]+_0xba2d69[_0x5c3b('0x1a')];var _0x4a1f3c;if(_0x4a737e>=_0x28b9f3){_0x4a737e=_0x28b9f3;_0x4a1f3c=0xc8;}else{_0x4a1f3c=0xce;}_0x2a0baa[_0x5c3b('0x16')](_0x4a1f3c);return _0x2a0baa['set'](_0x5c3b('0x1c'),_0x3975d9+'-'+_0x4a737e+'/'+_0x28b9f3)[_0x5c3b('0x17')](_0x57d9dd);}return null;};}function patchUpdates(_0x45d4c4){return function(_0xbe7201){try{jsonpatch[_0x5c3b('0x1d')](_0xbe7201,_0x45d4c4,!![]);}catch(_0x3c7c3a){return BPromise[_0x5c3b('0x1e')](_0x3c7c3a);}return _0xbe7201['save']();};}function saveUpdates(_0x51fd9d,_0x11ee5d){return function(_0xe8f95c){if(_0xe8f95c){return _0xe8f95c[_0x5c3b('0x1f')](_0x51fd9d)[_0x5c3b('0x20')](function(_0xef08cc){return _0xef08cc;});}return null;};}function removeEntity(_0x37f362,_0x117a5f){return function(_0x2c7d33){if(_0x2c7d33){return _0x2c7d33[_0x5c3b('0x21')]()[_0x5c3b('0x20')](function(){_0x37f362[_0x5c3b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5987b2,_0x1e1000){return function(_0x39e1e2){if(!_0x39e1e2){_0x5987b2[_0x5c3b('0x22')](0x194);}return _0x39e1e2;};}function handleError(_0x2a39bb,_0x317da3){_0x317da3=_0x317da3||0x1f4;return function(_0x2e44c4){logger[_0x5c3b('0x23')](_0x2e44c4[_0x5c3b('0x24')]);if(_0x2e44c4[_0x5c3b('0x25')]){delete _0x2e44c4[_0x5c3b('0x25')];}_0x2a39bb[_0x5c3b('0x16')](_0x317da3)[_0x5c3b('0x26')](_0x2e44c4);};}exports[_0x5c3b('0x27')]=function(_0x3ff624,_0x2fb29c){var _0x55ed91={},_0x1f0866={},_0x2f937a={'count':0x0,'rows':[]};var _0x1371fa=_['map'](db[_0x5c3b('0x28')][_0x5c3b('0x29')],function(_0x219e1a){return{'name':_0x219e1a[_0x5c3b('0x2a')],'type':_0x219e1a[_0x5c3b('0x2b')][_0x5c3b('0x2c')]};});_0x1f0866[_0x5c3b('0x2d')]=_[_0x5c3b('0x2e')](_0x1371fa,'name');_0x1f0866[_0x5c3b('0x2f')]=_[_0x5c3b('0x30')](_0x3ff624['query']);_0x1f0866['filters']=_['intersection'](_0x1f0866['model'],_0x1f0866[_0x5c3b('0x2f')]);_0x55ed91[_0x5c3b('0x31')]=_[_0x5c3b('0x32')](_0x1f0866[_0x5c3b('0x2d')],qs[_0x5c3b('0x33')](_0x3ff624['query'][_0x5c3b('0x33')]));_0x55ed91[_0x5c3b('0x31')]=_0x55ed91[_0x5c3b('0x31')]['length']?_0x55ed91[_0x5c3b('0x31')]:_0x1f0866[_0x5c3b('0x2d')];if(!_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x34')](_0x5c3b('0x35'))){_0x55ed91['limit']=qs[_0x5c3b('0x1a')](_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x1a')]);_0x55ed91['offset']=qs['offset'](_0x3ff624['query'][_0x5c3b('0x18')]);}_0x55ed91['order']=qs[_0x5c3b('0x36')](_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x36')]);_0x55ed91['where']=qs[_0x5c3b('0x37')](_[_0x5c3b('0x38')](_0x3ff624['query'],_0x1f0866[_0x5c3b('0x37')]),_0x1371fa);if(_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x39')]){_0x55ed91['where']=_[_0x5c3b('0x3a')](_0x55ed91[_0x5c3b('0x3b')],{'$or':_[_0x5c3b('0x2e')](_0x1371fa,function(_0xa78d7f){if(_0xa78d7f[_0x5c3b('0x2b')]!=='VIRTUAL'){var _0x1db9a9={};_0x1db9a9[_0xa78d7f[_0x5c3b('0x25')]]={'$like':'%'+_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x39')]+'%'};return _0x1db9a9;}})});}_0x55ed91=_[_0x5c3b('0x3a')]({},_0x55ed91,_0x3ff624[_0x5c3b('0x3c')]);var _0x14563c={'where':_0x55ed91['where']};return db[_0x5c3b('0x28')][_0x5c3b('0x1b')](_0x14563c)[_0x5c3b('0x20')](function(_0x3648b2){_0x2f937a[_0x5c3b('0x1b')]=_0x3648b2;if(_0x3ff624[_0x5c3b('0x2f')][_0x5c3b('0x3d')]){_0x55ed91[_0x5c3b('0x3e')]=[{'all':!![]}];}return db[_0x5c3b('0x28')]['findAll'](_0x55ed91);})['then'](function(_0x516301){_0x2f937a[_0x5c3b('0x3f')]=_0x516301;return _0x2f937a;})[_0x5c3b('0x20')](respondWithFilteredResult(_0x2fb29c,_0x55ed91))[_0x5c3b('0x40')](handleError(_0x2fb29c,null));};exports[_0x5c3b('0x41')]=function(_0x3c37ed,_0x1761a1){var _0xacf4dc={'raw':!![],'where':{'id':_0x3c37ed[_0x5c3b('0x42')]['id']}},_0x5db724={};_0x5db724[_0x5c3b('0x2d')]=_[_0x5c3b('0x30')](db[_0x5c3b('0x28')]['rawAttributes']);_0x5db724['query']=_[_0x5c3b('0x30')](_0x3c37ed[_0x5c3b('0x2f')]);_0x5db724['filters']=_[_0x5c3b('0x32')](_0x5db724[_0x5c3b('0x2d')],_0x5db724['query']);_0xacf4dc['attributes']=_[_0x5c3b('0x32')](_0x5db724['model'],qs['fields'](_0x3c37ed[_0x5c3b('0x2f')][_0x5c3b('0x33')]));_0xacf4dc[_0x5c3b('0x31')]=_0xacf4dc[_0x5c3b('0x31')]['length']?_0xacf4dc['attributes']:_0x5db724[_0x5c3b('0x2d')];if(_0x3c37ed['query']['includeAll']){_0xacf4dc[_0x5c3b('0x3e')]=[{'all':!![]}];}_0xacf4dc=_[_0x5c3b('0x3a')]({},_0xacf4dc,_0x3c37ed[_0x5c3b('0x3c')]);return db[_0x5c3b('0x28')][_0x5c3b('0x43')](_0xacf4dc)[_0x5c3b('0x20')](handleEntityNotFound(_0x1761a1,null))[_0x5c3b('0x20')](respondWithResult(_0x1761a1,null))[_0x5c3b('0x40')](handleError(_0x1761a1,null));};exports[_0x5c3b('0x44')]=function(_0x23acc1,_0x50a50a){return db[_0x5c3b('0x28')]['create'](_0x23acc1[_0x5c3b('0x45')],{})[_0x5c3b('0x20')](respondWithResult(_0x50a50a,0xc9))[_0x5c3b('0x40')](handleError(_0x50a50a,null));};exports['update']=function(_0x46e73d,_0x15d96a){if(_0x46e73d[_0x5c3b('0x45')]['id']){delete _0x46e73d[_0x5c3b('0x45')]['id'];}return db[_0x5c3b('0x28')][_0x5c3b('0x43')]({'where':{'id':_0x46e73d[_0x5c3b('0x42')]['id']}})['then'](handleEntityNotFound(_0x15d96a,null))['then'](saveUpdates(_0x46e73d[_0x5c3b('0x45')],null))[_0x5c3b('0x20')](respondWithResult(_0x15d96a,null))[_0x5c3b('0x40')](handleError(_0x15d96a,null));};exports[_0x5c3b('0x21')]=function(_0x494ec4,_0x19e655){return db[_0x5c3b('0x28')]['find']({'where':{'id':_0x494ec4[_0x5c3b('0x42')]['id']}})['then'](handleEntityNotFound(_0x19e655,null))[_0x5c3b('0x20')](removeEntity(_0x19e655,null))[_0x5c3b('0x40')](handleError(_0x19e655,null));}; \ No newline at end of file +var _0x3301=['intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','query','keys','filters'];(function(_0x951d50,_0x2a9162){var _0x244190=function(_0x5c3ca6){while(--_0x5c3ca6){_0x951d50['push'](_0x951d50['shift']());}};_0x244190(++_0x2a9162);}(_0x3301,0x64));var _0x1330=function(_0x34d993,_0x3c7017){_0x34d993=_0x34d993-0x0;var _0x4728c7=_0x3301[_0x34d993];return _0x4728c7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1330('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1330('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1330('0x2'));var util=require(_0x1330('0x3'));var path=require(_0x1330('0x4'));var sox=require(_0x1330('0x5'));var csv=require('to-csv');var ejs=require(_0x1330('0x6'));var fs=require('fs');var fs_extra=require(_0x1330('0x7'));var _=require(_0x1330('0x8'));var squel=require(_0x1330('0x9'));var crypto=require(_0x1330('0xa'));var jsforce=require(_0x1330('0xb'));var deskjs=require(_0x1330('0xc'));var toCsv=require(_0x1330('0xd'));var querystring=require(_0x1330('0xe'));var Papa=require(_0x1330('0xf'));var Redis=require(_0x1330('0x10'));var authService=require(_0x1330('0x11'));var qs=require(_0x1330('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1330('0x13'));var logger=require(_0x1330('0x14'))(_0x1330('0x15'));var utils=require(_0x1330('0x16'));var config=require(_0x1330('0x17'));var licenseUtil=require(_0x1330('0x18'));var db=require(_0x1330('0x19'))['db'];function respondWithStatusCode(_0x203f3b,_0x43e066){_0x43e066=_0x43e066||0xcc;return function(_0x3a2d26){if(_0x3a2d26){return _0x203f3b[_0x1330('0x1a')](_0x43e066);}return _0x203f3b[_0x1330('0x1b')](_0x43e066)[_0x1330('0x1c')]();};}function respondWithResult(_0x5bbbdc,_0x5128ca){_0x5128ca=_0x5128ca||0xc8;return function(_0xcf0298){if(_0xcf0298){return _0x5bbbdc['status'](_0x5128ca)[_0x1330('0x1d')](_0xcf0298);}};}function respondWithFilteredResult(_0x144cb6,_0x3802fa){return function(_0x495a59){if(_0x495a59){var _0x5d880d=typeof _0x3802fa[_0x1330('0x1e')]===_0x1330('0x1f')&&typeof _0x3802fa[_0x1330('0x20')]===_0x1330('0x1f');var _0x24b6d6=_0x495a59[_0x1330('0x21')];var _0x4ca3fd=_0x5d880d?0x0:_0x3802fa[_0x1330('0x1e')];var _0x312b8f=_0x5d880d?_0x495a59[_0x1330('0x21')]:_0x3802fa[_0x1330('0x1e')]+_0x3802fa[_0x1330('0x20')];var _0x33e613;if(_0x312b8f>=_0x24b6d6){_0x312b8f=_0x24b6d6;_0x33e613=0xc8;}else{_0x33e613=0xce;}_0x144cb6[_0x1330('0x1b')](_0x33e613);return _0x144cb6[_0x1330('0x22')](_0x1330('0x23'),_0x4ca3fd+'-'+_0x312b8f+'/'+_0x24b6d6)[_0x1330('0x1d')](_0x495a59);}return null;};}function patchUpdates(_0x5d1624){return function(_0x454da7){try{jsonpatch[_0x1330('0x24')](_0x454da7,_0x5d1624,!![]);}catch(_0x1471e9){return BPromise[_0x1330('0x25')](_0x1471e9);}return _0x454da7['save']();};}function saveUpdates(_0x3840e7,_0x3f033a){return function(_0x4989e8){if(_0x4989e8){return _0x4989e8[_0x1330('0x26')](_0x3840e7)[_0x1330('0x27')](function(_0x280723){return _0x280723;});}return null;};}function removeEntity(_0x52a57b,_0x4d05e3){return function(_0x2c5117){if(_0x2c5117){return _0x2c5117[_0x1330('0x28')]()[_0x1330('0x27')](function(){_0x52a57b['status'](0xcc)[_0x1330('0x1c')]();});}};}function handleEntityNotFound(_0x1095cd,_0x3e358a){return function(_0x3bfa80){if(!_0x3bfa80){_0x1095cd['sendStatus'](0x194);}return _0x3bfa80;};}function handleError(_0x58cfbc,_0x4f175a){_0x4f175a=_0x4f175a||0x1f4;return function(_0x47284d){logger[_0x1330('0x29')](_0x47284d[_0x1330('0x2a')]);if(_0x47284d[_0x1330('0x2b')]){delete _0x47284d['name'];}_0x58cfbc[_0x1330('0x1b')](_0x4f175a)[_0x1330('0x2c')](_0x47284d);};}exports[_0x1330('0x2d')]=function(_0x2f02f8,_0x14ff89){var _0x1de945={},_0x4c75f9={},_0x4fb87f={'count':0x0,'rows':[]};var _0x414f2d=_[_0x1330('0x2e')](db[_0x1330('0x2f')][_0x1330('0x30')],function(_0x59f01a){return{'name':_0x59f01a['fieldName'],'type':_0x59f01a[_0x1330('0x31')][_0x1330('0x32')]};});_0x4c75f9['model']=_[_0x1330('0x2e')](_0x414f2d,'name');_0x4c75f9[_0x1330('0x33')]=_[_0x1330('0x34')](_0x2f02f8[_0x1330('0x33')]);_0x4c75f9[_0x1330('0x35')]=_[_0x1330('0x36')](_0x4c75f9[_0x1330('0x37')],_0x4c75f9['query']);_0x1de945[_0x1330('0x38')]=_['intersection'](_0x4c75f9[_0x1330('0x37')],qs['fields'](_0x2f02f8[_0x1330('0x33')][_0x1330('0x39')]));_0x1de945[_0x1330('0x38')]=_0x1de945[_0x1330('0x38')][_0x1330('0x3a')]?_0x1de945[_0x1330('0x38')]:_0x4c75f9[_0x1330('0x37')];if(!_0x2f02f8[_0x1330('0x33')]['hasOwnProperty'](_0x1330('0x3b'))){_0x1de945[_0x1330('0x20')]=qs['limit'](_0x2f02f8[_0x1330('0x33')]['limit']);_0x1de945['offset']=qs[_0x1330('0x1e')](_0x2f02f8[_0x1330('0x33')][_0x1330('0x1e')]);}_0x1de945[_0x1330('0x3c')]=qs[_0x1330('0x3d')](_0x2f02f8[_0x1330('0x33')][_0x1330('0x3d')]);_0x1de945['where']=qs[_0x1330('0x35')](_[_0x1330('0x3e')](_0x2f02f8['query'],_0x4c75f9['filters']),_0x414f2d);if(_0x2f02f8[_0x1330('0x33')][_0x1330('0x3f')]){_0x1de945[_0x1330('0x40')]=_[_0x1330('0x41')](_0x1de945[_0x1330('0x40')],{'$or':_['map'](_0x414f2d,function(_0x17f1e){if(_0x17f1e['type']!==_0x1330('0x42')){var _0x439660={};_0x439660[_0x17f1e[_0x1330('0x2b')]]={'$like':'%'+_0x2f02f8['query']['filter']+'%'};return _0x439660;}})});}_0x1de945=_[_0x1330('0x41')]({},_0x1de945,_0x2f02f8[_0x1330('0x43')]);var _0x133735={'where':_0x1de945[_0x1330('0x40')]};return db['OpenchannelApplication'][_0x1330('0x21')](_0x133735)['then'](function(_0x5cd7f4){_0x4fb87f[_0x1330('0x21')]=_0x5cd7f4;if(_0x2f02f8[_0x1330('0x33')][_0x1330('0x44')]){_0x1de945['include']=[{'all':!![]}];}return db[_0x1330('0x2f')]['findAll'](_0x1de945);})[_0x1330('0x27')](function(_0x59f61c){_0x4fb87f[_0x1330('0x45')]=_0x59f61c;return _0x4fb87f;})[_0x1330('0x27')](respondWithFilteredResult(_0x14ff89,_0x1de945))[_0x1330('0x46')](handleError(_0x14ff89,null));};exports[_0x1330('0x47')]=function(_0x10a198,_0x7f51ce){var _0x2050a5={'raw':!![],'where':{'id':_0x10a198[_0x1330('0x48')]['id']}},_0x4b5cc3={};_0x4b5cc3[_0x1330('0x37')]=_[_0x1330('0x34')](db[_0x1330('0x2f')][_0x1330('0x30')]);_0x4b5cc3[_0x1330('0x33')]=_[_0x1330('0x34')](_0x10a198[_0x1330('0x33')]);_0x4b5cc3[_0x1330('0x35')]=_[_0x1330('0x36')](_0x4b5cc3[_0x1330('0x37')],_0x4b5cc3[_0x1330('0x33')]);_0x2050a5[_0x1330('0x38')]=_[_0x1330('0x36')](_0x4b5cc3[_0x1330('0x37')],qs[_0x1330('0x39')](_0x10a198['query'][_0x1330('0x39')]));_0x2050a5['attributes']=_0x2050a5['attributes'][_0x1330('0x3a')]?_0x2050a5['attributes']:_0x4b5cc3[_0x1330('0x37')];if(_0x10a198['query'][_0x1330('0x44')]){_0x2050a5[_0x1330('0x49')]=[{'all':!![]}];}_0x2050a5=_[_0x1330('0x41')]({},_0x2050a5,_0x10a198['options']);return db[_0x1330('0x2f')]['find'](_0x2050a5)[_0x1330('0x27')](handleEntityNotFound(_0x7f51ce,null))['then'](respondWithResult(_0x7f51ce,null))[_0x1330('0x46')](handleError(_0x7f51ce,null));};exports[_0x1330('0x4a')]=function(_0x1739c7,_0x7ae1c6){return db[_0x1330('0x2f')][_0x1330('0x4a')](_0x1739c7['body'],{})[_0x1330('0x27')](respondWithResult(_0x7ae1c6,0xc9))[_0x1330('0x46')](handleError(_0x7ae1c6,null));};exports[_0x1330('0x26')]=function(_0x21db4b,_0x405c5f){if(_0x21db4b[_0x1330('0x4b')]['id']){delete _0x21db4b['body']['id'];}return db['OpenchannelApplication'][_0x1330('0x4c')]({'where':{'id':_0x21db4b[_0x1330('0x48')]['id']}})[_0x1330('0x27')](handleEntityNotFound(_0x405c5f,null))['then'](saveUpdates(_0x21db4b['body'],null))[_0x1330('0x27')](respondWithResult(_0x405c5f,null))['catch'](handleError(_0x405c5f,null));};exports['destroy']=function(_0x3d987f,_0x208339){return db[_0x1330('0x2f')]['find']({'where':{'id':_0x3d987f['params']['id']}})['then'](handleEntityNotFound(_0x208339,null))['then'](removeEntity(_0x208339,null))[_0x1330('0x46')](handleError(_0x208339,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d1ec5fd..5f8386b 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 _0xece6=['moment','request-promise','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xece6,0x110));var _0x6ece=function(_0x4d0f0c,_0x3c225a){_0x4d0f0c=_0x4d0f0c-0x0;var _0x1fe673=_0xece6[_0x4d0f0c];return _0x1fe673;};'use strict';var _=require(_0x6ece('0x0'));var util=require(_0x6ece('0x1'));var logger=require(_0x6ece('0x2'))(_0x6ece('0x3'));var moment=require(_0x6ece('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ece('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ece('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x6ece('0x7')]=function(_0x4b9367,_0x1f2dfb){return _0x4b9367[_0x6ece('0x8')](_0x6ece('0x9'),attributes,{'tableName':_0x6ece('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ece('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4b7e=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b7e,0x174));var _0xe4b7=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4b7e[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe4b7('0x0'));var util=require('util');var logger=require(_0xe4b7('0x1'))(_0xe4b7('0x2'));var moment=require(_0xe4b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4b7('0x4'));var fs=require('fs');var path=require(_0xe4b7('0x5'));var rimraf=require(_0xe4b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4b7('0x7'));module['exports']=function(_0x2038b0,_0x2f71ee){return _0x2038b0[_0xe4b7('0x8')](_0xe4b7('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4b7('0xa'),'collate':_0xe4b7('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 6c0e755..912aa08 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 _0xd497=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f750b,_0x4e3e43){var _0x918b39=function(_0x106d8f){while(--_0x106d8f){_0x4f750b['push'](_0x4f750b['shift']());}};_0x918b39(++_0x4e3e43);}(_0xd497,0x10a));var _0x7d49=function(_0x41232a,_0x20440d){_0x41232a=_0x41232a-0x0;var _0x1ab731=_0xd497[_0x41232a];return _0x1ab731;};'use strict';var _=require(_0x7d49('0x0'));var util=require(_0x7d49('0x1'));var moment=require('moment');var BPromise=require(_0x7d49('0x2'));var rs=require(_0x7d49('0x3'));var fs=require('fs');var Redis=require(_0x7d49('0x4'));var db=require(_0x7d49('0x5'))['db'];var utils=require(_0x7d49('0x6'));var logger=require(_0x7d49('0x7'))(_0x7d49('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d49('0x9'));var client=jayson[_0x7d49('0xa')][_0x7d49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58d52d,_0x2e1f61,_0x5669a6){return new BPromise(function(_0xcf7405,_0x2c8db5){return client[_0x7d49('0xc')](_0x58d52d,_0x5669a6)[_0x7d49('0xd')](function(_0x52f367){logger[_0x7d49('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x2e1f61,_0x7d49('0xf'));logger[_0x7d49('0x10')](_0x7d49('0x11'),_0x2e1f61,_0x7d49('0xf'),JSON[_0x7d49('0x12')](_0x52f367));if(_0x52f367[_0x7d49('0x13')]){if(_0x52f367[_0x7d49('0x13')][_0x7d49('0x14')]===0x1f4){logger[_0x7d49('0x13')](_0x7d49('0x15'),_0x2e1f61,_0x52f367[_0x7d49('0x13')][_0x7d49('0x16')]);return _0x2c8db5(_0x52f367[_0x7d49('0x13')][_0x7d49('0x16')]);}logger[_0x7d49('0x13')](_0x7d49('0x15'),_0x2e1f61,_0x52f367[_0x7d49('0x13')]['message']);return _0xcf7405(_0x52f367[_0x7d49('0x13')][_0x7d49('0x16')]);}else{logger[_0x7d49('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x2e1f61,_0x7d49('0xf'));_0xcf7405(_0x52f367[_0x7d49('0x17')][_0x7d49('0x16')]);}})[_0x7d49('0x18')](function(_0x409ae7){logger['error'](_0x7d49('0x15'),_0x2e1f61,_0x409ae7);_0x2c8db5(_0x409ae7);});});}exports[_0x7d49('0x19')]=function(_0x1846b9){var _0x432de9=this;return new Promise(function(_0x1690f8,_0x2584ec){return db[_0x7d49('0x1a')][_0x7d49('0x1b')](_0x1846b9[_0x7d49('0x1c')],{'raw':_0x1846b9[_0x7d49('0x1d')]?_0x1846b9['options'][_0x7d49('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1846b9[_0x7d49('0x1d')]?_0x1846b9[_0x7d49('0x1d')][_0x7d49('0x1f')]||null:null,'attributes':_0x1846b9[_0x7d49('0x1d')]?_0x1846b9['options'][_0x7d49('0x20')]||null:null,'limit':_0x1846b9[_0x7d49('0x1d')]?_0x1846b9[_0x7d49('0x1d')][_0x7d49('0x21')]||null:null})['then'](function(_0x25873d){logger[_0x7d49('0xe')](_0x7d49('0x19'),_0x1846b9);logger[_0x7d49('0x10')]('UpdateOpenchannelApplication',_0x1846b9,JSON['stringify'](_0x25873d));_0x1690f8(_0x25873d);})[_0x7d49('0x18')](function(_0x4ffa30){logger['error'](_0x7d49('0x19'),_0x4ffa30['message'],_0x1846b9);_0x2584ec(_0x432de9[_0x7d49('0x13')](0x1f4,_0x4ffa30['message']));});});}; \ No newline at end of file +var _0x2c0d=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x37d043,_0x150ef5){var _0x573b81=function(_0x3fc389){while(--_0x3fc389){_0x37d043['push'](_0x37d043['shift']());}};_0x573b81(++_0x150ef5);}(_0x2c0d,0x1ec));var _0xd2c0=function(_0x2e6bff,_0x13be11){_0x2e6bff=_0x2e6bff-0x0;var _0x33cda0=_0x2c0d[_0x2e6bff];return _0x33cda0;};'use strict';var _=require(_0xd2c0('0x0'));var util=require(_0xd2c0('0x1'));var moment=require(_0xd2c0('0x2'));var BPromise=require(_0xd2c0('0x3'));var rs=require(_0xd2c0('0x4'));var fs=require('fs');var Redis=require(_0xd2c0('0x5'));var db=require(_0xd2c0('0x6'))['db'];var utils=require(_0xd2c0('0x7'));var logger=require(_0xd2c0('0x8'))(_0xd2c0('0x9'));var config=require(_0xd2c0('0xa'));var jayson=require(_0xd2c0('0xb'));var client=jayson[_0xd2c0('0xc')][_0xd2c0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3175ba,_0x5994e1,_0x194872){return new BPromise(function(_0x27fc90,_0x2af10a){return client[_0xd2c0('0xe')](_0x3175ba,_0x194872)['then'](function(_0x4f1bee){logger[_0xd2c0('0xf')](_0xd2c0('0x10'),_0x5994e1,_0xd2c0('0x11'));logger['debug'](_0xd2c0('0x12'),_0x5994e1,_0xd2c0('0x11'),JSON[_0xd2c0('0x13')](_0x4f1bee));if(_0x4f1bee[_0xd2c0('0x14')]){if(_0x4f1bee['error'][_0xd2c0('0x15')]===0x1f4){logger[_0xd2c0('0x14')](_0xd2c0('0x10'),_0x5994e1,_0x4f1bee[_0xd2c0('0x14')][_0xd2c0('0x16')]);return _0x2af10a(_0x4f1bee[_0xd2c0('0x14')][_0xd2c0('0x16')]);}logger[_0xd2c0('0x14')](_0xd2c0('0x10'),_0x5994e1,_0x4f1bee[_0xd2c0('0x14')][_0xd2c0('0x16')]);return _0x27fc90(_0x4f1bee[_0xd2c0('0x14')]['message']);}else{logger[_0xd2c0('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x5994e1,_0xd2c0('0x11'));_0x27fc90(_0x4f1bee[_0xd2c0('0x17')][_0xd2c0('0x16')]);}})['catch'](function(_0x5cc861){logger[_0xd2c0('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x5994e1,_0x5cc861);_0x2af10a(_0x5cc861);});});}exports[_0xd2c0('0x18')]=function(_0x584ff9){var _0x46303d=this;return new Promise(function(_0xe9fc8c,_0x301186){return db[_0xd2c0('0x19')][_0xd2c0('0x1a')](_0x584ff9[_0xd2c0('0x1b')],{'raw':_0x584ff9[_0xd2c0('0x1c')]?_0x584ff9[_0xd2c0('0x1c')][_0xd2c0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x584ff9[_0xd2c0('0x1c')]?_0x584ff9['options']['where']||null:null,'attributes':_0x584ff9[_0xd2c0('0x1c')]?_0x584ff9[_0xd2c0('0x1c')][_0xd2c0('0x1e')]||null:null,'limit':_0x584ff9[_0xd2c0('0x1c')]?_0x584ff9[_0xd2c0('0x1c')][_0xd2c0('0x1f')]||null:null})[_0xd2c0('0x20')](function(_0x528028){logger[_0xd2c0('0xf')](_0xd2c0('0x18'),_0x584ff9);logger['debug']('UpdateOpenchannelApplication',_0x584ff9,JSON[_0xd2c0('0x13')](_0x528028));_0xe9fc8c(_0x528028);})[_0xd2c0('0x21')](function(_0x61311d){logger[_0xd2c0('0x14')](_0xd2c0('0x18'),_0x61311d['message'],_0x584ff9);_0x301186(_0x46303d[_0xd2c0('0x14')](0x1f4,_0x61311d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 62245b3..2828511 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 _0xf028=['download','post','create','/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','update','delete','openchannelinteraction:destroy','removeTags','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages'];(function(_0x161b30,_0x5a18ad){var _0x3b03aa=function(_0x4a0d2f){while(--_0x4a0d2f){_0x161b30['push'](_0x161b30['shift']());}};_0x3b03aa(++_0x5a18ad);}(_0xf028,0xff));var _0x8f02=function(_0x44f726,_0x1f03f2){_0x44f726=_0x44f726-0x0;var _0x2055bd=_0xf028[_0x44f726];return _0x2055bd;};'use strict';var multer=require(_0x8f02('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8f02('0x1'));var express=require('express');var router=express[_0x8f02('0x2')]();var fs_extra=require(_0x8f02('0x3'));var auth=require(_0x8f02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f02('0x5'));var controller=require(_0x8f02('0x6'));router[_0x8f02('0x7')]('/',auth[_0x8f02('0x8')](),controller[_0x8f02('0x9')]);router[_0x8f02('0x7')](_0x8f02('0xa'),auth[_0x8f02('0x8')](),controller[_0x8f02('0xb')]);router[_0x8f02('0x7')](_0x8f02('0xc'),auth[_0x8f02('0x8')](),controller[_0x8f02('0xd')]);router['get']('/:id/messages',auth[_0x8f02('0x8')](),controller[_0x8f02('0xe')]);router[_0x8f02('0x7')]('/:id/download',auth[_0x8f02('0x8')](),controller[_0x8f02('0xf')]);router[_0x8f02('0x10')]('/',auth[_0x8f02('0x8')](),controller[_0x8f02('0x11')]);router[_0x8f02('0x10')](_0x8f02('0x12'),auth[_0x8f02('0x8')](),controller[_0x8f02('0x13')]);router[_0x8f02('0x10')](_0x8f02('0x14'),auth[_0x8f02('0x8')](),interaction['tracked'](_0x8f02('0x15'),_0x8f02('0x16')),controller[_0x8f02('0x17')]);router[_0x8f02('0x18')](_0x8f02('0xc'),auth[_0x8f02('0x8')](),interaction[_0x8f02('0x19')](_0x8f02('0x15'),'openchannelinteraction:update'),controller[_0x8f02('0x1a')]);router[_0x8f02('0x1b')]('/:id',auth[_0x8f02('0x8')](),interaction[_0x8f02('0x19')](_0x8f02('0x15'),_0x8f02('0x1c')),controller['destroy']);router[_0x8f02('0x1b')](_0x8f02('0x14'),auth[_0x8f02('0x8')](),controller[_0x8f02('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x1f81=['Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express'];(function(_0x2ba0dd,_0xbfe715){var _0x53e811=function(_0x283b7c){while(--_0x283b7c){_0x2ba0dd['push'](_0x2ba0dd['shift']());}};_0x53e811(++_0xbfe715);}(_0x1f81,0x17b));var _0x11f8=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x1f81[_0x3b16e1];return _0x311d1b;};'use strict';var multer=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var path=require(_0x11f8('0x2'));var timeout=require(_0x11f8('0x3'));var express=require(_0x11f8('0x4'));var router=express[_0x11f8('0x5')]();var fs_extra=require(_0x11f8('0x6'));var auth=require(_0x11f8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11f8('0x8'));router[_0x11f8('0x9')]('/',auth[_0x11f8('0xa')](),controller['index']);router['get'](_0x11f8('0xb'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xc')]);router[_0x11f8('0x9')](_0x11f8('0xd'),auth['isAuthenticated'](),controller[_0x11f8('0xe')]);router[_0x11f8('0x9')]('/:id/messages',auth[_0x11f8('0xa')](),controller['getMessages']);router[_0x11f8('0x9')](_0x11f8('0xf'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x10')]);router[_0x11f8('0x11')]('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0x12')]);router[_0x11f8('0x11')](_0x11f8('0x13'),auth[_0x11f8('0xa')](),controller['addMessage']);router[_0x11f8('0x11')](_0x11f8('0x14'),auth[_0x11f8('0xa')](),interaction[_0x11f8('0x15')](_0x11f8('0x16'),_0x11f8('0x17')),controller[_0x11f8('0x18')]);router[_0x11f8('0x19')](_0x11f8('0xd'),auth[_0x11f8('0xa')](),interaction[_0x11f8('0x15')](_0x11f8('0x16'),_0x11f8('0x1a')),controller[_0x11f8('0x1b')]);router['delete']('/:id',auth[_0x11f8('0xa')](),interaction['tracked']('openchannel',_0x11f8('0x1c')),controller[_0x11f8('0x1d')]);router[_0x11f8('0x1e')](_0x11f8('0x14'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index d1248fa..312ec67 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 _0xeedf=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1875c8,_0x4e5f7a){var _0x28ed91=function(_0x326695){while(--_0x326695){_0x1875c8['push'](_0x1875c8['shift']());}};_0x28ed91(++_0x4e5f7a);}(_0xeedf,0x12c));var _0xfeed=function(_0x48eecf,_0x19ad51){_0x48eecf=_0x48eecf-0x0;var _0x2b0c3f=_0xeedf[_0x48eecf];return _0x2b0c3f;};'use strict';var Sequelize=require(_0xfeed('0x0'));module[_0xfeed('0x1')]={'closed':{'type':Sequelize[_0xfeed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfeed('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfeed('0x3')]},'note':{'type':Sequelize[_0xfeed('0x3')]},'read1stAt':{'type':Sequelize[_0xfeed('0x4')]},'threadId':{'type':Sequelize[_0xfeed('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xfeed('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfeed('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfeed('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc8e9=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc8e9,0x1f4));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9c8e('0x0')]={'closed':{'type':Sequelize[_0x9c8e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9c8e('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9c8e('0x3')]},'note':{'type':Sequelize[_0x9c8e('0x3')]},'read1stAt':{'type':Sequelize[_0x9c8e('0x2')]},'threadId':{'type':Sequelize[_0x9c8e('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x9c8e('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9c8e('0x4')]('in',_0x9c8e('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9c8e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x9c8e('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index fbfa6fc..26e8a89 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 _0x2f31=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','fullname','TagIds','Tags','split','forEach','push','index','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','select','field','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','UserId','body','text','some','compact','isEmpty','concat','createdAt','parse','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','params','rawAttributes','includeAll','include','options','create','describe','OpenchannelMessage','addMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','Tag','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','out','basename','renderFile','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash'];(function(_0x563a54,_0x3205c7){var _0x1dc29c=function(_0x2e56d2){while(--_0x2e56d2){_0x563a54['push'](_0x563a54['shift']());}};_0x1dc29c(++_0x3205c7);}(_0x2f31,0x1db));var _0x12f3=function(_0xeac3e6,_0x599ed1){_0xeac3e6=_0xeac3e6-0x0;var _0x12082=_0x2f31[_0xeac3e6];return _0x12082;};'use strict';var emlformat=require(_0x12f3('0x0'));var rimraf=require(_0x12f3('0x1'));var zipdir=require(_0x12f3('0x2'));var jsonpatch=require(_0x12f3('0x3'));var rp=require(_0x12f3('0x4'));var moment=require('moment');var BPromise=require(_0x12f3('0x5'));var Mustache=require(_0x12f3('0x6'));var util=require(_0x12f3('0x7'));var path=require('path');var sox=require(_0x12f3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12f3('0x9'));var _=require(_0x12f3('0xa'));var squel=require(_0x12f3('0xb'));var crypto=require(_0x12f3('0xc'));var jsforce=require(_0x12f3('0xd'));var deskjs=require(_0x12f3('0xe'));var toCsv=require(_0x12f3('0xf'));var querystring=require(_0x12f3('0x10'));var Papa=require(_0x12f3('0x11'));var Redis=require(_0x12f3('0x12'));var authService=require(_0x12f3('0x13'));var qs=require(_0x12f3('0x14'));var as=require(_0x12f3('0x15'));var pdf=require(_0x12f3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x12f3('0x17'));var utils=require(_0x12f3('0x18'));var config=require(_0x12f3('0x19'));var licenseUtil=require(_0x12f3('0x1a'));var db=require(_0x12f3('0x1b'))['db'];config[_0x12f3('0x1c')]=_[_0x12f3('0x1d')](config[_0x12f3('0x1c')],{'host':_0x12f3('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12f3('0x1c')]));require(_0x12f3('0x1f'))[_0x12f3('0x20')](socket);function respondWithStatusCode(_0x5955d3,_0x29c688){_0x29c688=_0x29c688||0xcc;return function(_0x246c41){if(_0x246c41){return _0x5955d3[_0x12f3('0x21')](_0x29c688);}return _0x5955d3['status'](_0x29c688)['end']();};}function respondWithResult(_0x2a721b,_0x65731c){_0x65731c=_0x65731c||0xc8;return function(_0xd09231){if(_0xd09231){return _0x2a721b['status'](_0x65731c)[_0x12f3('0x22')](_0xd09231);}};}function respondWithFilteredResult(_0x3be008,_0x5dc823){return function(_0x37e4af){if(_0x37e4af){var _0x63998d=typeof _0x5dc823['offset']===_0x12f3('0x23')&&typeof _0x5dc823[_0x12f3('0x24')]===_0x12f3('0x23');var _0x551011=_0x37e4af['count'];var _0x4a0bc0=_0x63998d?0x0:_0x5dc823[_0x12f3('0x25')];var _0x142a57=_0x63998d?_0x37e4af[_0x12f3('0x26')]:_0x5dc823[_0x12f3('0x25')]+_0x5dc823[_0x12f3('0x24')];var _0x5d6959;if(_0x142a57>=_0x551011){_0x142a57=_0x551011;_0x5d6959=0xc8;}else{_0x5d6959=0xce;}_0x3be008[_0x12f3('0x27')](_0x5d6959);return _0x3be008[_0x12f3('0x28')](_0x12f3('0x29'),_0x4a0bc0+'-'+_0x142a57+'/'+_0x551011)[_0x12f3('0x22')](_0x37e4af);}return null;};}function patchUpdates(_0x59a135){return function(_0x25afc4){try{jsonpatch[_0x12f3('0x2a')](_0x25afc4,_0x59a135,!![]);}catch(_0x640213){return BPromise[_0x12f3('0x2b')](_0x640213);}return _0x25afc4[_0x12f3('0x2c')]();};}function saveUpdates(_0x2296c4,_0x248864){return function(_0x1a6847){if(_0x1a6847){return _0x1a6847[_0x12f3('0x2d')](_0x2296c4)[_0x12f3('0x2e')](function(_0x69e0d7){return _0x69e0d7;});}return null;};}function removeEntity(_0x37939e,_0x347d63){return function(_0x2bb2ee){if(_0x2bb2ee){return _0x2bb2ee[_0x12f3('0x2f')]()[_0x12f3('0x2e')](function(){_0x37939e[_0x12f3('0x27')](0xcc)[_0x12f3('0x30')]();});}};}function handleEntityNotFound(_0x544c6f,_0x401ac9){return function(_0x25a5d3){if(!_0x25a5d3){_0x544c6f[_0x12f3('0x21')](0x194);}return _0x25a5d3;};}function handleError(_0x27683d,_0x508068){_0x508068=_0x508068||0x1f4;return function(_0x197520){logger['error'](_0x197520[_0x12f3('0x31')]);if(_0x197520[_0x12f3('0x32')]){delete _0x197520[_0x12f3('0x32')];}_0x27683d[_0x12f3('0x27')](_0x508068)[_0x12f3('0x33')](_0x197520);};}function getInteractionUsers(_0x1d8ab0,_0x3f0db1){return new BPromise(function(_0x214810,_0x4e1123){try{if(_0x3f0db1[_0x1d8ab0['id']]){_0x1d8ab0['Users']=_['map'](_0x3f0db1[_0x1d8ab0['id']],function(_0x574175){return{'id':_0x574175['id'],'fullname':_0x574175[_0x12f3('0x34')]};});}}catch(_0x36ede4){_0x4e1123(_0x36ede4);}_0x214810(_0x1d8ab0);});}function getInteractionTags(_0x246d6c,_0x53a20c){return new BPromise(function(_0x54549a,_0x1b2fdc){try{if(_0x246d6c[_0x12f3('0x35')]){_0x246d6c[_0x12f3('0x36')]=[];_0x246d6c[_0x12f3('0x35')][_0x12f3('0x37')](',')[_0x12f3('0x38')](function(_0x197ce1){_0x246d6c[_0x12f3('0x36')][_0x12f3('0x39')](_0x53a20c[_0x197ce1]);});}delete _0x246d6c[_0x12f3('0x35')];}catch(_0xbf8bf){_0x1b2fdc(_0xbf8bf);}_0x54549a(_0x246d6c);});}function updateOpenchannelInteraction(_0x10d072,_0x242dcb,_0x466aa8){return new BPromise(function(_0x455725,_0x307abb){return getInteractionUsers(_0x10d072,_0x466aa8)[_0x12f3('0x2e')](function(_0x438f44){return getInteractionTags(_0x438f44,_0x242dcb);})[_0x12f3('0x2e')](function(_0x31d4ea){_0x455725(_0x31d4ea);})['catch'](function(_0x9aa51b){_0x307abb(_0x9aa51b);});});}exports[_0x12f3('0x3a')]=function(_0x3d1186,_0x4e9127){var _0x584adf={},_0x1998ec={},_0x56963f={'count':0x0,'rows':[]};var _0x487272=_['map'](db['OpenchannelInteraction']['rawAttributes'],function(_0x84fb01){return{'name':_0x84fb01['fieldName'],'type':_0x84fb01[_0x12f3('0x3b')][_0x12f3('0x3c')]};});_0x1998ec[_0x12f3('0x3d')]=_[_0x12f3('0x3e')](_0x487272,_0x12f3('0x32'));_0x1998ec[_0x12f3('0x3f')]=_[_0x12f3('0x40')](_0x3d1186[_0x12f3('0x3f')]);_0x1998ec['filters']=_[_0x12f3('0x41')](_0x1998ec['model'],_0x1998ec[_0x12f3('0x3f')]);_0x584adf['attributes']=_[_0x12f3('0x41')](_0x1998ec[_0x12f3('0x3d')],qs[_0x12f3('0x42')](_0x3d1186[_0x12f3('0x3f')]['fields']));_0x584adf[_0x12f3('0x43')]=_0x584adf[_0x12f3('0x43')][_0x12f3('0x44')]?_0x584adf[_0x12f3('0x43')]:_0x1998ec[_0x12f3('0x3d')];if(!_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x45')](_0x12f3('0x46'))){_0x584adf[_0x12f3('0x24')]=qs[_0x12f3('0x24')](_0x3d1186[_0x12f3('0x3f')]['limit']);_0x584adf[_0x12f3('0x25')]=qs[_0x12f3('0x25')](_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x25')]);}_0x584adf[_0x12f3('0x47')]=qs[_0x12f3('0x48')](_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x48')]);_0x584adf['where']=qs['filters'](_[_0x12f3('0x49')](_0x3d1186[_0x12f3('0x3f')],_0x1998ec[_0x12f3('0x4a')]),_0x487272);var _0x9a095d=[];var _0x69459a=squel[_0x12f3('0x4b')]()[_0x12f3('0x4c')]('id')[_0x12f3('0x4c')](_0x12f3('0x32'))[_0x12f3('0x4c')]('color')[_0x12f3('0x4d')]('tools_tags');var _0x5c85c4=squel[_0x12f3('0x4b')]()[_0x12f3('0x4c')](_0x12f3('0x4e'))[_0x12f3('0x4c')]('u.fullname')[_0x12f3('0x4c')](_0x12f3('0x4f'))[_0x12f3('0x4d')](_0x12f3('0x50'),'ui')[_0x12f3('0x51')](_0x12f3('0x52'),'u',_0x12f3('0x53'));var _0x12d2b1=squel['select']()[_0x12f3('0x4d')](_0x12f3('0x54'),'i')[_0x12f3('0x51')]('cm_contacts','c',_0x12f3('0x55'))[_0x12f3('0x51')]('users','o',_0x12f3('0x56'))[_0x12f3('0x51')](_0x12f3('0x57'),'a',_0x12f3('0x58'))['left_join']('openchannel_messages','me',_0x12f3('0x59'))[_0x12f3('0x51')](_0x12f3('0x5a'),'it',_0x12f3('0x5b'))[_0x12f3('0x51')]('tools_tags','t',_0x12f3('0x5c'));var _0x1ad8c4=squel[_0x12f3('0x5d')]();var _0x436f64=[];var _0x3b1aff=squel[_0x12f3('0x5d')]();var _0x5619bb;if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x5e')]){_0x5619bb=as['parseSearch'](_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x5e')]);var _0x53be96=_0x5619bb[_0x12f3('0x5f')];for(var _0x14543b=0x0;_0x14543b<_0x5619bb['conditions'][_0x12f3('0x44')];_0x14543b++){var _0xec6f1a=_0x5619bb['conditions'][_0x14543b];var _0x3d830c='i';var _0x544038=_['find'](_0x487272,[_0x12f3('0x32'),_0xec6f1a[_0x12f3('0x4c')]]);if(!_0x544038){switch(_0xec6f1a[_0x12f3('0x4c')]){case _0x12f3('0x60'):if(_0xec6f1a[_0x12f3('0x61')]==0x1){_0x12d2b1[_0x12f3('0x62')]('`'+_0xec6f1a['field']+_0x12f3('0x63'));}else{_0x12d2b1[_0x12f3('0x62')]('`'+_0xec6f1a[_0x12f3('0x4c')]+_0x12f3('0x64'));}break;case _0x12f3('0x65'):if(_0xec6f1a['operator']==='$substring'){if(_0xec6f1a['value'][_0x12f3('0x37')]('\x20')[_0x12f3('0x44')]>0x1){_0x1ad8c4[_0x53be96](_0x12f3('0x66'),qs[_0x12f3('0x67')](_0xec6f1a['value']),null);}else{var _0x492a34='%'+_0xec6f1a[_0x12f3('0x61')]+'%';_0x1ad8c4[_0x53be96](_0x12f3('0x68'),_0x492a34,_0x492a34,_0x492a34);}}else{_0x544038=_[_0x12f3('0x69')](_0x487272,[_0x12f3('0x32'),_0x12f3('0x6a')]);_0xec6f1a[_0x12f3('0x4c')]=_0x12f3('0x6a');_0x17a0bd=as[_0x12f3('0x6b')](_0x3d830c,_0x544038['type'],_0xec6f1a);_0x1ad8c4[_0x53be96](_0x17a0bd['text'],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x6c')],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x30')]);}break;case'Tag':var _0x59032b=_0xec6f1a[_0x12f3('0x61')]['split'](',')['map'](function(_0x527500){return Number(_0x527500);});_0x59032b[_0x12f3('0x38')](function(_0x18810a){_0x3b1aff['or'](_0x12f3('0x6d'),'%,'+_0x18810a+',%');});_0x436f64=_[_0x12f3('0x6e')](_0x436f64,_0x59032b);break;case _0x12f3('0x6f'):if(_0xec6f1a[_0x12f3('0x70')]===_0x12f3('0x71')){_0x1ad8c4[_0x53be96]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xec6f1a['value']+'%',null);}else{_0x544038=_[_0x12f3('0x69')](_0x487272,[_0x12f3('0x32'),'UserId']);_0xec6f1a[_0x12f3('0x4c')]=_0x12f3('0x72');_0x17a0bd=as[_0x12f3('0x6b')](_0x3d830c,_0x544038[_0x12f3('0x3b')],_0xec6f1a);_0x1ad8c4[_0x53be96](_0x17a0bd['text'],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x6c')],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x30')]);}break;case _0x12f3('0x73'):_0x17a0bd=as[_0x12f3('0x6b')]('me',null,_0xec6f1a);_0x1ad8c4[_0x53be96](_0x17a0bd[_0x12f3('0x74')],_0x17a0bd['value']['start'],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x30')]);break;}}else{var _0x17a0bd=as[_0x12f3('0x6b')](_0x3d830c,_0x544038[_0x12f3('0x3b')],_0xec6f1a);_0x1ad8c4[_0x53be96](_0x17a0bd[_0x12f3('0x74')],_0x17a0bd['value'][_0x12f3('0x6c')],_0x17a0bd[_0x12f3('0x61')][_0x12f3('0x30')]);}}}else{var _0x502a0a=_(_0x3d1186[_0x12f3('0x3f')])[_0x12f3('0x40')]()['map'](function(_0x108aa6){return _[_0x12f3('0x75')](_0x487272,[_0x12f3('0x32'),_0x108aa6])?_0x108aa6:undefined;})[_0x12f3('0x76')]()[_0x12f3('0x61')]();if(!_[_0x12f3('0x77')](_0x502a0a)){_0x502a0a[_0x12f3('0x38')](function(_0x36093b){if(_0x36093b==='OpenchannelAccountId'){_0x12d2b1['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x12f3('0x78')](_0x3d1186[_0x12f3('0x3f')][_0x36093b]));}else if(_0x36093b===_0x12f3('0x79')){var _0x168835=JSON[_0x12f3('0x7a')](_0x3d1186[_0x12f3('0x3f')][_0x36093b])[_0x12f3('0x7b')];var _0xa9ff77=JSON[_0x12f3('0x7a')](_0x3d1186[_0x12f3('0x3f')][_0x36093b])['$lte'];_0x12d2b1[_0x12f3('0x7c')](_0x12f3('0x7d'),_0x168835,_0xa9ff77);}else{if(_0x3d1186[_0x12f3('0x3f')][_0x36093b]===_0x12f3('0x7e')){_0x12d2b1['where']('i.'+_0x36093b+'\x20IS\x20NULL');}else{_0x12d2b1[_0x12f3('0x7c')]('i.'+_0x36093b+'\x20=\x20?',_0x3d1186[_0x12f3('0x3f')][_0x36093b]);}}});}if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x7f')]){if(_0x3d1186['query'][_0x12f3('0x7f')]==0x1){_0x12d2b1[_0x12f3('0x62')](_0x12f3('0x80'));}else{_0x12d2b1['having'](_0x12f3('0x81'));}}if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x82')]){_0x436f64=_[_0x12f3('0x83')](_0x3d1186['query'][_0x12f3('0x82')])?_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x82')]:new Array(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x82')]);_0x436f64['forEach'](function(_0x1dbcbd){_0x3b1aff['or'](_0x12f3('0x6d'),'%,'+_0x1dbcbd+',%');});}if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x84')]){var _0x585980=_0x3d1186['query'][_0x12f3('0x84')][_0x12f3('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x12f3('0x86')](_0x585980)){_0x1ad8c4['or'](_0x12f3('0x87'),_0x585980+'%');}else{_0x1ad8c4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x12f3('0x67')](_0x585980))['or'](_0x12f3('0x88'),_0x585980+'%')['or'](_0x12f3('0x89'),_0x585980+'%');}}}_0x12d2b1[_0x12f3('0x7c')](_0x1ad8c4);_0x12d2b1[_0x12f3('0x8a')](_0x12f3('0x8b'));var _0x517255={'type':db[_0x12f3('0x8c')]['QueryTypes'][_0x12f3('0x8d')],'raw':!![]};var _0xd67c38=_0x12d2b1[_0x12f3('0x8e')]();_0xd67c38[_0x12f3('0x4c')]('i.id');_0xd67c38[_0x12f3('0x4c')](_0x12f3('0x8f'),_0x12f3('0x60'));if(_0x584adf[_0x12f3('0x47')]){_0x584adf['order'][_0x12f3('0x38')](function(_0x21a4f4){var _0x4381ec=_0x21a4f4[0x0]===_0x12f3('0x90')?_0x21a4f4[0x0]:'i.'+_0x21a4f4[0x0];_0x12d2b1[_0x12f3('0x47')](_0x4381ec,_0x21a4f4[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x436f64)){_0x12d2b1['having'](_0x3b1aff);_0xd67c38[_0x12f3('0x7c')]('t.id\x20IN\x20?',_0x436f64);}BPromise[_0x12f3('0x91')]()[_0x12f3('0x2e')](function(){if(!_0x5619bb){if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x92')])return;_0xd67c38[_0x12f3('0x7c')](_0x12f3('0x93'));_0x12d2b1[_0x12f3('0x7c')](_0x12f3('0x93'));return;}if(_0x3d1186[_0x12f3('0x94')][_0x12f3('0x95')]!==_0x12f3('0x96'))return;return _0x3d1186[_0x12f3('0x94')][_0x12f3('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e1039){if(_[_0x12f3('0x77')](_0x1e1039)){_0xd67c38[_0x12f3('0x7c')](_0x12f3('0x98'));_0x12d2b1['where'](_0x12f3('0x98'));}else{_0xd67c38[_0x12f3('0x7c')](_0x12f3('0x99'),_[_0x12f3('0x3e')](_0x1e1039,'id'));_0x12d2b1[_0x12f3('0x7c')](_0x12f3('0x99'),_[_0x12f3('0x3e')](_0x1e1039,'id'));}});})[_0x12f3('0x2e')](function(){if(_0x3d1186['user']['role']===_0x12f3('0x96')&&!_0x5619bb&&!_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x92')])return[];return db['sequelize'][_0x12f3('0x3f')](_0xd67c38[_0x12f3('0x9a')](),_0x517255);})[_0x12f3('0x2e')](function(_0x1ecbe5){_0x56963f[_0x12f3('0x26')]=_0x1ecbe5[_0x12f3('0x44')];if(_0x56963f[_0x12f3('0x26')]===0x0)return[];return db[_0x12f3('0x9b')][_0x12f3('0x3f')](_0x69459a['toString'](),_0x517255)[_0x12f3('0x2e')](function(_0x428ce7){_0x9a095d=_[_0x12f3('0x9c')](_0x428ce7,'id');_0x517255=_[_0x12f3('0x9d')](_0x517255,{'model':db[_0x12f3('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d1186[_0x12f3('0x3f')][_0x12f3('0x42')]){_0x584adf['attributes']['forEach'](function(_0x56ccb8){_0x12d2b1[_0x12f3('0x4c')]('i.'+_0x56ccb8);});}else{_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0x8f'),_0x12f3('0x60'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0x9f'),_0x12f3('0xa0'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xa1'),'Account.mandatoryDisposition');_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xa2'),'contactName');_0x12d2b1[_0x12f3('0x4c')]('i.*');_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xa3'),'Contact.firstName');_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xa4'),_0x12f3('0xa5'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xa6'),_0x12f3('0xa7'));_0x12d2b1['field'](_0x12f3('0xa8'),_0x12f3('0xa9'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xaa'),_0x12f3('0xab'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xac'),_0x12f3('0xad'));_0x12d2b1['field'](_0x12f3('0xae'),_0x12f3('0xaf'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xb0'),_0x12f3('0xb1'));_0x12d2b1[_0x12f3('0x4c')](_0x12f3('0xb2'),'TagIds');}if(_0x584adf[_0x12f3('0x24')])_0x12d2b1[_0x12f3('0x24')](_0x584adf[_0x12f3('0x24')]);if(_0x584adf['offset'])_0x12d2b1[_0x12f3('0x25')](_0x584adf[_0x12f3('0x25')]);return db['sequelize'][_0x12f3('0x3f')](_0x12d2b1[_0x12f3('0x9a')](),_0x517255);})[_0x12f3('0x2e')](function(_0x386d2d){if(_0x386d2d[_0x12f3('0x44')]>0x0)_0x5c85c4[_0x12f3('0x7c')](_0x12f3('0xb3'),_['map'](_0x386d2d,'id'));return db[_0x12f3('0x9b')][_0x12f3('0x3f')](_0x5c85c4[_0x12f3('0x9a')](),_0x517255)['then'](function(_0x1ab0a3){var _0x5ce745=_[_0x12f3('0xb4')](_0x1ab0a3,_0x12f3('0xb5'));var _0x2e8fde=[];_0x386d2d[_0x12f3('0x38')](function(_0x3d53e3){_0x2e8fde[_0x12f3('0x39')](updateOpenchannelInteraction(_0x3d53e3,_0x9a095d,_0x5ce745));});return BPromise[_0x12f3('0xb6')](_0x2e8fde);});});})[_0x12f3('0x2e')](function(_0x2d2f30){_0x56963f[_0x12f3('0xb7')]=_0x2d2f30;return _0x56963f;})[_0x12f3('0x2e')](respondWithFilteredResult(_0x4e9127,_0x584adf))[_0x12f3('0xb8')](handleError(_0x4e9127,null));};exports['show']=function(_0xf5b1d2,_0x1ce8c8){var _0x4f457b={};if(_0xf5b1d2[_0x12f3('0x3f')][_0x12f3('0x3b')]&&_0xf5b1d2[_0x12f3('0x3f')][_0x12f3('0x3b')]===_0x12f3('0x4d')){_0x4f457b[_0x12f3('0x4d')]=_0xf5b1d2[_0x12f3('0xb9')]['id'];}else{_0x4f457b['id']=_0xf5b1d2[_0x12f3('0xb9')]['id'];}var _0x1274d1={'raw':![],'where':_0x4f457b},_0x56a949={};_0x56a949[_0x12f3('0x3d')]=_[_0x12f3('0x40')](db['OpenchannelInteraction'][_0x12f3('0xba')]);_0x56a949[_0x12f3('0x3f')]=_[_0x12f3('0x40')](_0xf5b1d2[_0x12f3('0x3f')]);_0x56a949[_0x12f3('0x4a')]=_[_0x12f3('0x41')](_0x56a949[_0x12f3('0x3d')],_0x56a949['query']);_0x1274d1[_0x12f3('0x43')]=_['intersection'](_0x56a949[_0x12f3('0x3d')],qs[_0x12f3('0x42')](_0xf5b1d2[_0x12f3('0x3f')][_0x12f3('0x42')]));_0x1274d1[_0x12f3('0x43')]=_0x1274d1[_0x12f3('0x43')][_0x12f3('0x44')]?_0x1274d1[_0x12f3('0x43')]:_0x56a949[_0x12f3('0x3d')];if(_0xf5b1d2[_0x12f3('0x3f')][_0x12f3('0xbb')]){_0x1274d1[_0x12f3('0xbc')]=[{'all':!![]}];}_0x1274d1=_[_0x12f3('0x9d')]({},_0x1274d1,_0xf5b1d2[_0x12f3('0xbd')]);return db[_0x12f3('0x9e')]['find'](_0x1274d1)[_0x12f3('0x2e')](handleEntityNotFound(_0x1ce8c8,null))['then'](respondWithResult(_0x1ce8c8,null))[_0x12f3('0xb8')](handleError(_0x1ce8c8,null));};exports[_0x12f3('0xbe')]=function(_0x158e86,_0x354fc7){return db[_0x12f3('0x9e')][_0x12f3('0xbe')](_0x158e86[_0x12f3('0x73')],{})['then'](respondWithResult(_0x354fc7,0xc9))[_0x12f3('0xb8')](handleError(_0x354fc7,null));};exports[_0x12f3('0x2d')]=function(_0xd9c204,_0x564056){if(_0xd9c204[_0x12f3('0x73')]['id']){delete _0xd9c204[_0x12f3('0x73')]['id'];}return db[_0x12f3('0x9e')][_0x12f3('0x69')]({'where':{'id':_0xd9c204[_0x12f3('0xb9')]['id']}})[_0x12f3('0x2e')](handleEntityNotFound(_0x564056,null))['then'](saveUpdates(_0xd9c204[_0x12f3('0x73')],null))['then'](respondWithResult(_0x564056,null))[_0x12f3('0xb8')](handleError(_0x564056,null));};exports[_0x12f3('0x2f')]=function(_0x1105c0,_0x3b53bd){return db[_0x12f3('0x9e')][_0x12f3('0x69')]({'where':{'id':_0x1105c0[_0x12f3('0xb9')]['id']}})['then'](handleEntityNotFound(_0x3b53bd,null))[_0x12f3('0x2e')](removeEntity(_0x3b53bd,null))[_0x12f3('0xb8')](handleError(_0x3b53bd,null));};exports[_0x12f3('0xbf')]=function(_0x292f52,_0x929f30){return db['OpenchannelInteraction'][_0x12f3('0xbf')]()[_0x12f3('0x2e')](respondWithResult(_0x929f30,null))[_0x12f3('0xb8')](handleError(_0x929f30,null));};exports['addMessage']=function(_0xfa566e,_0x55777,_0x5d42d3){return db[_0x12f3('0xc0')]['find']({'where':{'id':_0xfa566e[_0x12f3('0xb9')]['id']}})[_0x12f3('0x2e')](handleEntityNotFound(_0x55777,null))[_0x12f3('0x2e')](function(_0x573b62){if(_0x573b62){return _0x573b62[_0x12f3('0xc1')](_0xfa566e[_0x12f3('0x73')][_0x12f3('0xc2')],_['omit'](_0xfa566e['body'],[_0x12f3('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x55777,null))[_0x12f3('0xb8')](handleError(_0x55777,null));};exports['getMessages']=function(_0x2b3df6,_0x21659e,_0x5c29ca){var _0x3f7181={'raw':![],'where':{}};var _0x391fbb={};var _0xed7f0e={'count':0x0,'rows':[]};return db[_0x12f3('0x9e')]['findOne']({'where':{'id':_0x2b3df6['params']['id']}})['then'](handleEntityNotFound(_0x21659e,null))['then'](function(_0x442f92){if(_0x442f92){_0x391fbb['model']=_[_0x12f3('0x40')](db[_0x12f3('0xc0')][_0x12f3('0xba')]);_0x391fbb[_0x12f3('0x3f')]=_['keys'](_0x2b3df6[_0x12f3('0x3f')]);_0x391fbb[_0x12f3('0x4a')]=_[_0x12f3('0x41')](_0x391fbb[_0x12f3('0x3d')],_0x391fbb['query']);_0x3f7181[_0x12f3('0x43')]=_[_0x12f3('0x41')](_0x391fbb[_0x12f3('0x3d')],qs[_0x12f3('0x42')](_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x42')]));_0x3f7181[_0x12f3('0x43')]=_0x3f7181[_0x12f3('0x43')][_0x12f3('0x44')]?_0x3f7181[_0x12f3('0x43')]:_0x391fbb[_0x12f3('0x3d')];if(!_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x45')](_0x12f3('0x46'))){_0x3f7181['limit']=qs[_0x12f3('0x24')](_0x2b3df6[_0x12f3('0x3f')]['limit']);_0x3f7181[_0x12f3('0x25')]=qs[_0x12f3('0x25')](_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x25')]);}_0x3f7181[_0x12f3('0x47')]=qs[_0x12f3('0x48')](_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x48')]);_0x3f7181[_0x12f3('0x7c')]=qs[_0x12f3('0x4a')](_[_0x12f3('0x49')](_0x2b3df6[_0x12f3('0x3f')],_0x391fbb[_0x12f3('0x4a')]));_0x3f7181[_0x12f3('0x7c')][_0x12f3('0xb5')]=_0x442f92['id'];if(_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x84')]){_0x3f7181[_0x12f3('0x7c')]=_[_0x12f3('0x9d')](_0x3f7181[_0x12f3('0x7c')],{'$or':_[_0x12f3('0x3e')](_0x3f7181[_0x12f3('0x43')],function(_0x50353f){var _0x473320={};_0x473320[_0x50353f]={'$like':'%'+_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x84')]+'%'};return _0x473320;})});}if(_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x7b')]){var _0x4e8913=_0x2b3df6[_0x12f3('0x3f')][_0x12f3('0x7b')][_0x12f3('0x37')](',');var _0x4af169={};_0x4af169[_0x4e8913[0x0]]={'$gte':moment(_0x4e8913[0x1])[_0x12f3('0xc3')](_0x12f3('0xc4'))};_0x3f7181[_0x12f3('0x7c')]=_[_0x12f3('0x9d')](_0x3f7181['where'],_0x4af169);}_0x3f7181=_['merge']({},_0x3f7181,_0x2b3df6[_0x12f3('0xbd')]);return db[_0x12f3('0xc0')][_0x12f3('0x26')]({'where':_0x3f7181[_0x12f3('0x7c')]})['then'](function(_0x1874aa){_0xed7f0e['count']=_0x1874aa;if(_0x2b3df6['query'][_0x12f3('0xbb')]){_0x3f7181[_0x12f3('0xbc')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x12f3('0xc5')](_0x3f7181);})[_0x12f3('0x2e')](function(_0x5c1741){_0xed7f0e['rows']=_0x5c1741;return _0xed7f0e;});}})[_0x12f3('0x2e')](respondWithFilteredResult(_0x21659e,_0x3f7181))['catch'](handleError(_0x21659e,null));};exports[_0x12f3('0xc6')]=function(_0x1b710b,_0x3c7ffa,_0x749c52){return db[_0x12f3('0x9e')]['find']({'where':{'id':_0x1b710b[_0x12f3('0xb9')]['id']}})[_0x12f3('0x2e')](handleEntityNotFound(_0x3c7ffa,null))[_0x12f3('0x2e')](function(_0x23951e){if(_0x23951e){return _0x23951e[_0x12f3('0xc7')](_0x1b710b[_0x12f3('0x73')][_0x12f3('0xc2')],_[_0x12f3('0xc8')](_0x1b710b[_0x12f3('0x73')],[_0x12f3('0xc2'),'id'])||{})[_0x12f3('0xc9')](function(){return db[_0x12f3('0xca')][_0x12f3('0xc5')]({'attributes':['id',_0x12f3('0x32'),'color'],'where':{'id':_0x1b710b[_0x12f3('0x73')]['ids']}});})['then'](function(_0x2207be){socket['emit'](_0x12f3('0xcb'),{'id':Number(_0x1b710b[_0x12f3('0xb9')]['id']),'tags':_0x2207be||[]});return{'id':Number(_0x1b710b[_0x12f3('0xb9')]['id']),'tags':_0x2207be||[]};});}})[_0x12f3('0x2e')](respondWithResult(_0x3c7ffa,null))[_0x12f3('0xb8')](handleError(_0x3c7ffa,null));};exports['removeTags']=function(_0x33f863,_0x4b6b8e,_0x33d1ee){return db['OpenchannelInteraction'][_0x12f3('0x69')]({'where':{'id':_0x33f863[_0x12f3('0xb9')]['id']}})['then'](handleEntityNotFound(_0x4b6b8e,null))[_0x12f3('0x2e')](function(_0x19eb43){if(_0x19eb43){return _0x19eb43[_0x12f3('0xcc')](_0x33f863[_0x12f3('0x3f')][_0x12f3('0xc2')]);}})[_0x12f3('0x2e')](respondWithStatusCode(_0x4b6b8e,null))['catch'](handleError(_0x4b6b8e,null));};exports[_0x12f3('0xcd')]=function(_0x2870b4,_0x31489b){var _0xb14c5b=moment()[_0x12f3('0xce')]()[_0x12f3('0x9a')]();var _0x2a83e4=path[_0x12f3('0xcf')](config[_0x12f3('0xd0')],_0x12f3('0xd1'),_0x12f3('0xd2'),_0x12f3('0xd3'));var _0xeaca4a=path['join'](config[_0x12f3('0xd0')],_0x12f3('0xd1'),_0x12f3('0xd2'),'attachments');var _0x1b1bf8=path[_0x12f3('0xcf')](_0x2a83e4,_0xb14c5b);var _0x522372=util[_0x12f3('0xc3')](_0x12f3('0xd4'),_0x2870b4[_0x12f3('0xb9')]['id'],_0xb14c5b);var _0x23edc4=path[_0x12f3('0xcf')](_0x2a83e4,_0x522372);var _0x505cf5=[];_0x505cf5[_0x12f3('0x39')]({'model':db[_0x12f3('0x6f')],'as':_0x12f3('0x6f'),'attributes':['id',_0x12f3('0x34')],'raw':!![]});_0x505cf5['push']({'model':db['CmContact'],'as':_0x12f3('0x65'),'attributes':['id',_0x12f3('0xd5'),_0x12f3('0xd6')],'raw':!![]});if(_0x2870b4[_0x12f3('0x3f')][_0x12f3('0xd7')]){_0x505cf5[_0x12f3('0x39')]({'model':db[_0x12f3('0xd8')],'as':'Attachment','raw':!![]});}var _0x449f6d=[{'model':db[_0x12f3('0xc0')],'as':_0x12f3('0xd9'),'attributes':['id',_0x12f3('0x73'),_0x12f3('0x79'),_0x12f3('0xda'),_0x12f3('0xdb'),'read'],'include':_0x505cf5}];_0x449f6d['push']({'model':db[_0x12f3('0xdc')],'as':_0x12f3('0xdd'),'attributes':['id',_0x12f3('0x32')]});_0x449f6d[_0x12f3('0x39')]({'model':db[_0x12f3('0x6f')],'as':'Owner','attributes':['id','fullname']});return db[_0x12f3('0x9e')][_0x12f3('0x69')]({'where':{'id':_0x2870b4[_0x12f3('0xb9')]['id']},'include':_0x449f6d})['then'](handleEntityNotFound(_0x31489b,null))[_0x12f3('0x2e')](function(_0x19c72e){if(_0x19c72e){var _0x39c478=_0x19c72e[_0x12f3('0xde')]({'plain':!![]});fs['mkdirSync'](_0x1b1bf8);var _0x24c751={'channel':_0x12f3('0xdf'),'account':_0x39c478['Account'][_0x12f3('0x32')],'agent':_0x39c478['Owner']?_0x39c478[_0x12f3('0xe0')][_0x12f3('0x34')]:_0x12f3('0xe1'),'createdAt':moment(_0x39c478['createdAt'])[_0x12f3('0xc3')](_0x12f3('0xc4'))[_0x12f3('0x9a')](),'closedAt':_0x39c478[_0x12f3('0xe2')]?moment(_0x39c478[_0x12f3('0xe3')])[_0x12f3('0xc3')](_0x12f3('0xc4'))[_0x12f3('0x9a')]():'','disposition':_0x39c478[_0x12f3('0xe4')],'visibility':_0x39c478[_0x12f3('0xe5')]?_0x12f3('0xe6'):_0x12f3('0xe7'),'messages':_(_0x39c478[_0x12f3('0xd9')])['filter']({'secret':![]})[_0x12f3('0x3e')](function(_0x347e80){if(_0x347e80['Attachment']){var _0x2002f9=path['join'](_0xeaca4a,_0x347e80[_0x12f3('0xd8')]['basename']);if(fs[_0x12f3('0xe8')](_0x2002f9)){fs['createReadStream'](_0x2002f9)[_0x12f3('0xe9')](fs[_0x12f3('0xea')](path[_0x12f3('0xcf')](_0x1b1bf8,_0x347e80[_0x12f3('0xd8')]['basename'])));}}return{'date':moment(_0x347e80[_0x12f3('0x79')])[_0x12f3('0xc3')](_0x12f3('0xc4'))['toString'](),'sender':_0x347e80[_0x12f3('0xda')]===_0x12f3('0xeb')?_0x347e80[_0x12f3('0x6f')]?_0x347e80['User'][_0x12f3('0x34')]:'System':_0x347e80[_0x12f3('0x65')][_0x12f3('0xd5')]+(_0x347e80[_0x12f3('0x65')][_0x12f3('0xd6')]?'\x20'+_0x347e80[_0x12f3('0x65')]['lastName']:''),'body':_0x347e80['Attachment']?_0x347e80[_0x12f3('0xd8')][_0x12f3('0xec')]:_0x347e80[_0x12f3('0x73')],'direction':_0x347e80['direction']===_0x12f3('0xeb')?'A':'C','secret':_0x347e80[_0x12f3('0xdb')],'read':_0x347e80['read'],'attachment':_0x347e80['Attachment']};})[_0x12f3('0x61')]()};return ejs[_0x12f3('0xed')](path[_0x12f3('0xcf')](config[_0x12f3('0xd0')],_0x12f3('0xd1'),'views','downloadInteraction.ejs'),{'interaction':_0x24c751})[_0x12f3('0x2e')](function(_0x2b3e4f){var _0x535532=path[_0x12f3('0xcf')](_0x1b1bf8,'transcript-'+_0x39c478['id']+'-'+_0xb14c5b+_0x12f3('0xee'));var _0x13e246={'path':_0x535532,'channel':_0x12f3('0xdf'),'interactionId':_0x39c478['id']};return pdf[_0x12f3('0xef')](_0x2b3e4f,_0x13e246);})['then'](function(){return new BPromise(function(_0x5d49e9,_0x381f0a){zipdir(_0x1b1bf8,{'saveTo':_0x23edc4},function(_0x58f3a7,_0x3ee964){if(_0x58f3a7)return _0x381f0a(_0x58f3a7);return _0x5d49e9(_0x3ee964);});})['then'](function(){return new BPromise(function(_0x2411e0,_0x2b2377){rimraf(_0x1b1bf8,function(_0x2ae00d){if(_0x2ae00d)_0x2b2377(_0x2ae00d);return _0x2411e0();});});})[_0x12f3('0x2e')](function(){return _0x31489b['download'](_0x23edc4,_0x522372,function(_0x43511a){if(_0x43511a){console[_0x12f3('0xf0')](_0x12f3('0xf1'),_0x43511a);}else{fs[_0x12f3('0xf2')](_0x23edc4);}});});});}else{return _0x31489b[_0x12f3('0x21')](0xc8);}})[_0x12f3('0xb8')](handleError(_0x31489b,null));}; \ No newline at end of file +var _0xebc4=['i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.internal','Owner.internal','toString','OpenchannelInteractionId','all','rows','params','keys','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','server','files','root','attachments','join','transcript-%d-%s.zip','firstName','Attachment','direction','OpenchannelAccount','Account','get','mkdirSync','Openchannel','Owner','N.A.','disposition','threadId','Public','Private','Messages','pipe','createWriteStream','basename','out','Contact','lastName','views','downloadInteraction.ejs','transcript-','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','index','OpenchannelInteraction','rawAttributes','type','model','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','ui.OpenchannelInteractionId','left_join','users','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','length','conditions','find','unreadMessages','value','`\x20>\x200','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric'];(function(_0x396991,_0x14df54){var _0x238296=function(_0x110b7f){while(--_0x110b7f){_0x396991['push'](_0x396991['shift']());}};_0x238296(++_0x14df54);}(_0xebc4,0x139));var _0x4ebc=function(_0x536699,_0x3c458b){_0x536699=_0x536699-0x0;var _0xdea2=_0xebc4[_0x536699];return _0xdea2;};'use strict';var emlformat=require(_0x4ebc('0x0'));var rimraf=require(_0x4ebc('0x1'));var zipdir=require(_0x4ebc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ebc('0x3'));var BPromise=require(_0x4ebc('0x4'));var Mustache=require(_0x4ebc('0x5'));var util=require(_0x4ebc('0x6'));var path=require(_0x4ebc('0x7'));var sox=require('sox');var csv=require(_0x4ebc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ebc('0x9'));var _=require(_0x4ebc('0xa'));var squel=require(_0x4ebc('0xb'));var crypto=require(_0x4ebc('0xc'));var jsforce=require(_0x4ebc('0xd'));var deskjs=require(_0x4ebc('0xe'));var toCsv=require(_0x4ebc('0x8'));var querystring=require(_0x4ebc('0xf'));var Papa=require('papaparse');var Redis=require(_0x4ebc('0x10'));var authService=require(_0x4ebc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4ebc('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x4ebc('0x13'));var logger=require('../../config/logger')(_0x4ebc('0x14'));var utils=require(_0x4ebc('0x15'));var config=require(_0x4ebc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ebc('0x17'))['db'];config[_0x4ebc('0x18')]=_[_0x4ebc('0x19')](config[_0x4ebc('0x18')],{'host':_0x4ebc('0x1a'),'port':0x18eb});var socket=require(_0x4ebc('0x1b'))(new Redis(config[_0x4ebc('0x18')]));require(_0x4ebc('0x1c'))['register'](socket);function respondWithStatusCode(_0xddf2fc,_0x36e781){_0x36e781=_0x36e781||0xcc;return function(_0x3c4269){if(_0x3c4269){return _0xddf2fc['sendStatus'](_0x36e781);}return _0xddf2fc[_0x4ebc('0x1d')](_0x36e781)[_0x4ebc('0x1e')]();};}function respondWithResult(_0x13b634,_0xd57dda){_0xd57dda=_0xd57dda||0xc8;return function(_0x44334f){if(_0x44334f){return _0x13b634[_0x4ebc('0x1d')](_0xd57dda)[_0x4ebc('0x1f')](_0x44334f);}};}function respondWithFilteredResult(_0xbcd632,_0x1159e9){return function(_0x26f594){if(_0x26f594){var _0x52ed4=typeof _0x1159e9['offset']===_0x4ebc('0x20')&&typeof _0x1159e9[_0x4ebc('0x21')]===_0x4ebc('0x20');var _0x5ad924=_0x26f594[_0x4ebc('0x22')];var _0x260f0f=_0x52ed4?0x0:_0x1159e9[_0x4ebc('0x23')];var _0x20f493=_0x52ed4?_0x26f594['count']:_0x1159e9[_0x4ebc('0x23')]+_0x1159e9['limit'];var _0x206f83;if(_0x20f493>=_0x5ad924){_0x20f493=_0x5ad924;_0x206f83=0xc8;}else{_0x206f83=0xce;}_0xbcd632[_0x4ebc('0x1d')](_0x206f83);return _0xbcd632['set'](_0x4ebc('0x24'),_0x260f0f+'-'+_0x20f493+'/'+_0x5ad924)[_0x4ebc('0x1f')](_0x26f594);}return null;};}function patchUpdates(_0x194fc){return function(_0x38e2ac){try{jsonpatch['apply'](_0x38e2ac,_0x194fc,!![]);}catch(_0x27ab00){return BPromise[_0x4ebc('0x25')](_0x27ab00);}return _0x38e2ac[_0x4ebc('0x26')]();};}function saveUpdates(_0xd6b753,_0x2dcf75){return function(_0x1c66d4){if(_0x1c66d4){return _0x1c66d4[_0x4ebc('0x27')](_0xd6b753)['then'](function(_0x492436){return _0x492436;});}return null;};}function removeEntity(_0x76eaec,_0x60c23b){return function(_0x1cacd6){if(_0x1cacd6){return _0x1cacd6[_0x4ebc('0x28')]()[_0x4ebc('0x29')](function(){_0x76eaec[_0x4ebc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1180c6,_0x24f3a4){return function(_0x3deb08){if(!_0x3deb08){_0x1180c6[_0x4ebc('0x2a')](0x194);}return _0x3deb08;};}function handleError(_0x2bd2e2,_0xef2ef){_0xef2ef=_0xef2ef||0x1f4;return function(_0x15e8e3){logger[_0x4ebc('0x2b')](_0x15e8e3[_0x4ebc('0x2c')]);if(_0x15e8e3[_0x4ebc('0x2d')]){delete _0x15e8e3[_0x4ebc('0x2d')];}_0x2bd2e2[_0x4ebc('0x1d')](_0xef2ef)[_0x4ebc('0x2e')](_0x15e8e3);};}function getInteractionUsers(_0x5c0252,_0x54ffa4){return new BPromise(function(_0x15bb6b,_0x5b21f0){try{if(_0x54ffa4[_0x5c0252['id']]){_0x5c0252[_0x4ebc('0x2f')]=_[_0x4ebc('0x30')](_0x54ffa4[_0x5c0252['id']],function(_0x532e09){return{'id':_0x532e09['id'],'fullname':_0x532e09[_0x4ebc('0x31')]};});}}catch(_0x570b57){_0x5b21f0(_0x570b57);}_0x15bb6b(_0x5c0252);});}function getInteractionTags(_0x394fb9,_0x399973){return new BPromise(function(_0x566a2f,_0x27c696){try{if(_0x394fb9[_0x4ebc('0x32')]){_0x394fb9['Tags']=[];_0x394fb9[_0x4ebc('0x32')]['split'](',')['forEach'](function(_0x35064c){_0x394fb9[_0x4ebc('0x33')][_0x4ebc('0x34')](_0x399973[_0x35064c]);});}delete _0x394fb9[_0x4ebc('0x32')];}catch(_0x1463ea){_0x27c696(_0x1463ea);}_0x566a2f(_0x394fb9);});}function updateOpenchannelInteraction(_0x34f5f9,_0x2cff8f,_0x544dac){return new BPromise(function(_0x283b09,_0x3ac0d5){return getInteractionUsers(_0x34f5f9,_0x544dac)['then'](function(_0x1a8359){return getInteractionTags(_0x1a8359,_0x2cff8f);})[_0x4ebc('0x29')](function(_0x509b22){_0x283b09(_0x509b22);})[_0x4ebc('0x35')](function(_0x25cbb1){_0x3ac0d5(_0x25cbb1);});});}exports[_0x4ebc('0x36')]=function(_0x49a0e1,_0x4b51cd){var _0x22a73e={},_0x243a9d={},_0x5b9466={'count':0x0,'rows':[]};var _0x1432d7=_[_0x4ebc('0x30')](db[_0x4ebc('0x37')][_0x4ebc('0x38')],function(_0x30dc4d){return{'name':_0x30dc4d['fieldName'],'type':_0x30dc4d[_0x4ebc('0x39')]['key']};});_0x243a9d[_0x4ebc('0x3a')]=_[_0x4ebc('0x30')](_0x1432d7,_0x4ebc('0x2d'));_0x243a9d['query']=_['keys'](_0x49a0e1['query']);_0x243a9d[_0x4ebc('0x3b')]=_['intersection'](_0x243a9d[_0x4ebc('0x3a')],_0x243a9d['query']);_0x22a73e[_0x4ebc('0x3c')]=_[_0x4ebc('0x3d')](_0x243a9d[_0x4ebc('0x3a')],qs[_0x4ebc('0x3e')](_0x49a0e1['query'][_0x4ebc('0x3e')]));_0x22a73e[_0x4ebc('0x3c')]=_0x22a73e[_0x4ebc('0x3c')]['length']?_0x22a73e['attributes']:_0x243a9d[_0x4ebc('0x3a')];if(!_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x40')](_0x4ebc('0x41'))){_0x22a73e['limit']=qs[_0x4ebc('0x21')](_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x21')]);_0x22a73e[_0x4ebc('0x23')]=qs[_0x4ebc('0x23')](_0x49a0e1['query'][_0x4ebc('0x23')]);}_0x22a73e[_0x4ebc('0x42')]=qs[_0x4ebc('0x43')](_0x49a0e1['query'][_0x4ebc('0x43')]);_0x22a73e[_0x4ebc('0x44')]=qs[_0x4ebc('0x3b')](_[_0x4ebc('0x45')](_0x49a0e1['query'],_0x243a9d[_0x4ebc('0x3b')]),_0x1432d7);var _0x1bf467=[];var _0x975040=squel[_0x4ebc('0x46')]()[_0x4ebc('0x47')]('id')[_0x4ebc('0x47')](_0x4ebc('0x2d'))['field'](_0x4ebc('0x48'))[_0x4ebc('0x49')](_0x4ebc('0x4a'));var _0x20d2b2=squel[_0x4ebc('0x46')]()[_0x4ebc('0x47')]('u.id')['field']('u.fullname')[_0x4ebc('0x47')](_0x4ebc('0x4b'))[_0x4ebc('0x49')]('user_has_openchannel_interactions','ui')[_0x4ebc('0x4c')](_0x4ebc('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x184496=squel[_0x4ebc('0x46')]()['from']('openchannel_interactions','i')[_0x4ebc('0x4c')](_0x4ebc('0x4e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4ebc('0x4c')](_0x4ebc('0x4d'),'o',_0x4ebc('0x4f'))[_0x4ebc('0x4c')](_0x4ebc('0x50'),'a',_0x4ebc('0x51'))[_0x4ebc('0x4c')](_0x4ebc('0x52'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join']('openchannel_interaction_has_tags','it',_0x4ebc('0x53'))[_0x4ebc('0x4c')](_0x4ebc('0x4a'),'t',_0x4ebc('0x54'));var _0x1e43a2=squel[_0x4ebc('0x55')]();var _0x452e2a=[];var _0x53bc87=squel[_0x4ebc('0x55')]();var _0x24c723;if(_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x56')]){_0x24c723=as['parseSearch'](_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x56')]);var _0x1da3d0=_0x24c723[_0x4ebc('0x57')];for(var _0x4e7e03=0x0;_0x4e7e03<_0x24c723['conditions'][_0x4ebc('0x58')];_0x4e7e03++){var _0x2eb9ea=_0x24c723[_0x4ebc('0x59')][_0x4e7e03];var _0x5053ff='i';var _0x300fe1=_[_0x4ebc('0x5a')](_0x1432d7,[_0x4ebc('0x2d'),_0x2eb9ea[_0x4ebc('0x47')]]);if(!_0x300fe1){switch(_0x2eb9ea[_0x4ebc('0x47')]){case _0x4ebc('0x5b'):if(_0x2eb9ea[_0x4ebc('0x5c')]==0x1){_0x184496['having']('`'+_0x2eb9ea[_0x4ebc('0x47')]+'`\x20=\x200');}else{_0x184496['having']('`'+_0x2eb9ea[_0x4ebc('0x47')]+_0x4ebc('0x5d'));}break;case'Contact':if(_0x2eb9ea[_0x4ebc('0x5e')]==='$substring'){if(_0x2eb9ea['value'][_0x4ebc('0x5f')]('\x20')[_0x4ebc('0x58')]>0x1){_0x1e43a2[_0x1da3d0](_0x4ebc('0x60'),qs[_0x4ebc('0x61')](_0x2eb9ea[_0x4ebc('0x5c')]),null);}else{var _0x5d37cd='%'+_0x2eb9ea['value']+'%';_0x1e43a2[_0x1da3d0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5d37cd,_0x5d37cd,_0x5d37cd);}}else{_0x300fe1=_[_0x4ebc('0x5a')](_0x1432d7,[_0x4ebc('0x2d'),_0x4ebc('0x62')]);_0x2eb9ea[_0x4ebc('0x47')]=_0x4ebc('0x62');_0x3f16c=as['buildExpression'](_0x5053ff,_0x300fe1[_0x4ebc('0x39')],_0x2eb9ea);_0x1e43a2[_0x1da3d0](_0x3f16c[_0x4ebc('0x63')],_0x3f16c['value'][_0x4ebc('0x64')],_0x3f16c['value'][_0x4ebc('0x1e')]);}break;case _0x4ebc('0x65'):var _0x16f776=_0x2eb9ea[_0x4ebc('0x5c')]['split'](',')[_0x4ebc('0x30')](function(_0x2bde2e){return Number(_0x2bde2e);});_0x16f776[_0x4ebc('0x66')](function(_0x1c6c5a){_0x53bc87['or'](_0x4ebc('0x67'),'%,'+_0x1c6c5a+',%');});_0x452e2a=_['union'](_0x452e2a,_0x16f776);break;case _0x4ebc('0x68'):if(_0x2eb9ea[_0x4ebc('0x5e')]===_0x4ebc('0x69')){_0x1e43a2[_0x1da3d0](_0x4ebc('0x6a'),'%'+_0x2eb9ea[_0x4ebc('0x5c')]+'%',null);}else{_0x300fe1=_[_0x4ebc('0x5a')](_0x1432d7,['name','UserId']);_0x2eb9ea[_0x4ebc('0x47')]=_0x4ebc('0x6b');_0x3f16c=as[_0x4ebc('0x6c')](_0x5053ff,_0x300fe1[_0x4ebc('0x39')],_0x2eb9ea);_0x1e43a2[_0x1da3d0](_0x3f16c[_0x4ebc('0x63')],_0x3f16c['value'][_0x4ebc('0x64')],_0x3f16c[_0x4ebc('0x5c')][_0x4ebc('0x1e')]);}break;case _0x4ebc('0x6d'):_0x3f16c=as[_0x4ebc('0x6c')]('me',null,_0x2eb9ea);_0x1e43a2[_0x1da3d0](_0x3f16c['text'],_0x3f16c[_0x4ebc('0x5c')][_0x4ebc('0x64')],_0x3f16c[_0x4ebc('0x5c')][_0x4ebc('0x1e')]);break;}}else{var _0x3f16c=as[_0x4ebc('0x6c')](_0x5053ff,_0x300fe1[_0x4ebc('0x39')],_0x2eb9ea);_0x1e43a2[_0x1da3d0](_0x3f16c[_0x4ebc('0x63')],_0x3f16c[_0x4ebc('0x5c')][_0x4ebc('0x64')],_0x3f16c['value'][_0x4ebc('0x1e')]);}}}else{var _0x136ab5=_(_0x49a0e1[_0x4ebc('0x3f')])['keys']()[_0x4ebc('0x30')](function(_0x1568d0){return _['some'](_0x1432d7,[_0x4ebc('0x2d'),_0x1568d0])?_0x1568d0:undefined;})[_0x4ebc('0x6e')]()['value']();if(!_['isEmpty'](_0x136ab5)){_0x136ab5['forEach'](function(_0x3e5eb8){if(_0x3e5eb8===_0x4ebc('0x6f')){_0x184496[_0x4ebc('0x44')](_0x4ebc('0x70'),[]['concat'](_0x49a0e1['query'][_0x3e5eb8]));}else if(_0x3e5eb8===_0x4ebc('0x71')){var _0x5b1bb0=JSON['parse'](_0x49a0e1['query'][_0x3e5eb8])[_0x4ebc('0x72')];var _0x4e61a9=JSON[_0x4ebc('0x73')](_0x49a0e1[_0x4ebc('0x3f')][_0x3e5eb8])[_0x4ebc('0x74')];_0x184496[_0x4ebc('0x44')](_0x4ebc('0x75'),_0x5b1bb0,_0x4e61a9);}else{if(_0x49a0e1[_0x4ebc('0x3f')][_0x3e5eb8]==='null'){_0x184496[_0x4ebc('0x44')]('i.'+_0x3e5eb8+_0x4ebc('0x76'));}else{_0x184496[_0x4ebc('0x44')]('i.'+_0x3e5eb8+_0x4ebc('0x77'),_0x49a0e1['query'][_0x3e5eb8]);}}});}if(_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x78')]){if(_0x49a0e1['query'][_0x4ebc('0x78')]==0x1){_0x184496['having'](_0x4ebc('0x79'));}else{_0x184496[_0x4ebc('0x7a')](_0x4ebc('0x7b'));}}if(_0x49a0e1[_0x4ebc('0x3f')]['tag']){_0x452e2a=_[_0x4ebc('0x7c')](_0x49a0e1['query'][_0x4ebc('0x7d')])?_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x7d')]:new Array(_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x7d')]);_0x452e2a[_0x4ebc('0x66')](function(_0x3f76aa){_0x53bc87['or'](_0x4ebc('0x67'),'%,'+_0x3f76aa+',%');});}if(_0x49a0e1['query'][_0x4ebc('0x7e')]){var _0x583782=_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x7e')]['replace']('\x5c','\x5c\x5c')[_0x4ebc('0x7f')](/'/g,'\x27\x27');if(qs[_0x4ebc('0x80')](_0x583782)){_0x1e43a2['or'](_0x4ebc('0x81'),_0x583782+'%');}else{_0x1e43a2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4ebc('0x61')](_0x583782))['or']('i.from\x20LIKE\x20?',_0x583782+'%')['or'](_0x4ebc('0x82'),_0x583782+'%');}}}_0x184496[_0x4ebc('0x44')](_0x1e43a2);_0x184496['group']('i.id');var _0x5efc55={'type':db[_0x4ebc('0x83')][_0x4ebc('0x84')][_0x4ebc('0x85')],'raw':!![]};var _0x28485f=_0x184496[_0x4ebc('0x86')]();_0x28485f[_0x4ebc('0x47')]('i.id');_0x28485f[_0x4ebc('0x47')](_0x4ebc('0x87'),_0x4ebc('0x5b'));if(_0x22a73e[_0x4ebc('0x42')]){_0x22a73e[_0x4ebc('0x42')]['forEach'](function(_0x568fbf){var _0x1bcd57=_0x568fbf[0x0]===_0x4ebc('0x88')?_0x568fbf[0x0]:'i.'+_0x568fbf[0x0];_0x184496['order'](_0x1bcd57,_0x568fbf[0x1]===_0x4ebc('0x89')?![]:!![]);});}if(!_[_0x4ebc('0x8a')](_0x452e2a)){_0x184496['having'](_0x53bc87);_0x28485f['where'](_0x4ebc('0x8b'),_0x452e2a);}BPromise['resolve']()[_0x4ebc('0x29')](function(){if(!_0x24c723){if(_0x49a0e1[_0x4ebc('0x3f')][_0x4ebc('0x6f')])return;_0x28485f[_0x4ebc('0x44')](_0x4ebc('0x8c'));_0x184496[_0x4ebc('0x44')](_0x4ebc('0x8c'));return;}if(_0x49a0e1[_0x4ebc('0x8d')][_0x4ebc('0x8e')]!==_0x4ebc('0x8f'))return;return _0x49a0e1[_0x4ebc('0x8d')][_0x4ebc('0x90')]({'attributes':['id'],'raw':!![]})[_0x4ebc('0x29')](function(_0x5daa27){if(_[_0x4ebc('0x8a')](_0x5daa27)){_0x28485f[_0x4ebc('0x44')](_0x4ebc('0x91'));_0x184496[_0x4ebc('0x44')](_0x4ebc('0x91'));}else{_0x28485f[_0x4ebc('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x4ebc('0x30')](_0x5daa27,'id'));_0x184496[_0x4ebc('0x44')](_0x4ebc('0x70'),_[_0x4ebc('0x30')](_0x5daa27,'id'));}});})[_0x4ebc('0x29')](function(){if(_0x49a0e1[_0x4ebc('0x8d')][_0x4ebc('0x8e')]===_0x4ebc('0x8f')&&!_0x24c723&&!_0x49a0e1['query'][_0x4ebc('0x6f')])return[];return db[_0x4ebc('0x92')][_0x4ebc('0x3f')](_0x28485f['toString'](),_0x5efc55);})[_0x4ebc('0x29')](function(_0x5607c8){_0x5b9466[_0x4ebc('0x22')]=_0x5607c8[_0x4ebc('0x58')];if(_0x5b9466[_0x4ebc('0x22')]===0x0)return[];return db[_0x4ebc('0x92')][_0x4ebc('0x3f')](_0x975040['toString'](),_0x5efc55)[_0x4ebc('0x29')](function(_0x88b655){_0x1bf467=_[_0x4ebc('0x93')](_0x88b655,'id');_0x5efc55=_[_0x4ebc('0x94')](_0x5efc55,{'model':db[_0x4ebc('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49a0e1['query'][_0x4ebc('0x3e')]){_0x22a73e[_0x4ebc('0x3c')][_0x4ebc('0x66')](function(_0x5d055d){_0x184496[_0x4ebc('0x47')]('i.'+_0x5d055d);});}else{_0x184496[_0x4ebc('0x47')](_0x4ebc('0x87'),'unreadMessages');_0x184496[_0x4ebc('0x47')](_0x4ebc('0x95'),_0x4ebc('0x96'));_0x184496[_0x4ebc('0x47')](_0x4ebc('0x97'),_0x4ebc('0x98'));_0x184496['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x4ebc('0x88'));_0x184496[_0x4ebc('0x47')]('i.*');_0x184496['field'](_0x4ebc('0x99'),_0x4ebc('0x9a'));_0x184496[_0x4ebc('0x47')]('c.lastName','Contact.lastName');_0x184496[_0x4ebc('0x47')](_0x4ebc('0x9b'),_0x4ebc('0x9c'));_0x184496[_0x4ebc('0x47')]('c.phone',_0x4ebc('0x9d'));_0x184496[_0x4ebc('0x47')](_0x4ebc('0x9e'),_0x4ebc('0x9f'));_0x184496['field']('c.fax','Contact.fax');_0x184496['field']('o.fullname','Owner.fullname');_0x184496[_0x4ebc('0x47')](_0x4ebc('0xa0'),_0x4ebc('0xa1'));_0x184496['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4ebc('0x32'));}if(_0x22a73e['limit'])_0x184496['limit'](_0x22a73e['limit']);if(_0x22a73e[_0x4ebc('0x23')])_0x184496[_0x4ebc('0x23')](_0x22a73e[_0x4ebc('0x23')]);return db[_0x4ebc('0x92')][_0x4ebc('0x3f')](_0x184496['toString'](),_0x5efc55);})[_0x4ebc('0x29')](function(_0x136c74){if(_0x136c74[_0x4ebc('0x58')]>0x0)_0x20d2b2[_0x4ebc('0x44')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x4ebc('0x30')](_0x136c74,'id'));return db[_0x4ebc('0x92')][_0x4ebc('0x3f')](_0x20d2b2[_0x4ebc('0xa2')](),_0x5efc55)[_0x4ebc('0x29')](function(_0x416860){var _0x4d6dfb=_['groupBy'](_0x416860,_0x4ebc('0xa3'));var _0xce3a8b=[];_0x136c74[_0x4ebc('0x66')](function(_0x35ab60){_0xce3a8b[_0x4ebc('0x34')](updateOpenchannelInteraction(_0x35ab60,_0x1bf467,_0x4d6dfb));});return BPromise[_0x4ebc('0xa4')](_0xce3a8b);});});})[_0x4ebc('0x29')](function(_0x282c36){_0x5b9466[_0x4ebc('0xa5')]=_0x282c36;return _0x5b9466;})[_0x4ebc('0x29')](respondWithFilteredResult(_0x4b51cd,_0x22a73e))['catch'](handleError(_0x4b51cd,null));};exports['show']=function(_0x3c0ae1,_0x5d485d){var _0x2b57af={};if(_0x3c0ae1['query'][_0x4ebc('0x39')]&&_0x3c0ae1[_0x4ebc('0x3f')][_0x4ebc('0x39')]===_0x4ebc('0x49')){_0x2b57af[_0x4ebc('0x49')]=_0x3c0ae1[_0x4ebc('0xa6')]['id'];}else{_0x2b57af['id']=_0x3c0ae1['params']['id'];}var _0x3a9946={'raw':![],'where':_0x2b57af},_0x536e5c={};_0x536e5c[_0x4ebc('0x3a')]=_[_0x4ebc('0xa7')](db['OpenchannelInteraction'][_0x4ebc('0x38')]);_0x536e5c[_0x4ebc('0x3f')]=_[_0x4ebc('0xa7')](_0x3c0ae1['query']);_0x536e5c['filters']=_[_0x4ebc('0x3d')](_0x536e5c[_0x4ebc('0x3a')],_0x536e5c[_0x4ebc('0x3f')]);_0x3a9946[_0x4ebc('0x3c')]=_[_0x4ebc('0x3d')](_0x536e5c[_0x4ebc('0x3a')],qs['fields'](_0x3c0ae1[_0x4ebc('0x3f')][_0x4ebc('0x3e')]));_0x3a9946['attributes']=_0x3a9946[_0x4ebc('0x3c')][_0x4ebc('0x58')]?_0x3a9946['attributes']:_0x536e5c[_0x4ebc('0x3a')];if(_0x3c0ae1[_0x4ebc('0x3f')]['includeAll']){_0x3a9946['include']=[{'all':!![]}];}_0x3a9946=_[_0x4ebc('0x94')]({},_0x3a9946,_0x3c0ae1[_0x4ebc('0xa8')]);return db[_0x4ebc('0x37')][_0x4ebc('0x5a')](_0x3a9946)[_0x4ebc('0x29')](handleEntityNotFound(_0x5d485d,null))[_0x4ebc('0x29')](respondWithResult(_0x5d485d,null))[_0x4ebc('0x35')](handleError(_0x5d485d,null));};exports[_0x4ebc('0xa9')]=function(_0x290d51,_0x121de3){return db[_0x4ebc('0x37')]['create'](_0x290d51[_0x4ebc('0x6d')],{})[_0x4ebc('0x29')](respondWithResult(_0x121de3,0xc9))['catch'](handleError(_0x121de3,null));};exports['update']=function(_0x4ffaec,_0x4d8208){if(_0x4ffaec[_0x4ebc('0x6d')]['id']){delete _0x4ffaec['body']['id'];}return db[_0x4ebc('0x37')][_0x4ebc('0x5a')]({'where':{'id':_0x4ffaec[_0x4ebc('0xa6')]['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x4d8208,null))['then'](saveUpdates(_0x4ffaec[_0x4ebc('0x6d')],null))[_0x4ebc('0x29')](respondWithResult(_0x4d8208,null))['catch'](handleError(_0x4d8208,null));};exports[_0x4ebc('0x28')]=function(_0xa043e3,_0x1bfdb6){return db[_0x4ebc('0x37')][_0x4ebc('0x5a')]({'where':{'id':_0xa043e3['params']['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x1bfdb6,null))[_0x4ebc('0x29')](removeEntity(_0x1bfdb6,null))[_0x4ebc('0x35')](handleError(_0x1bfdb6,null));};exports[_0x4ebc('0xaa')]=function(_0x3b8c3b,_0x37e41c){return db[_0x4ebc('0x37')][_0x4ebc('0xaa')]()[_0x4ebc('0x29')](respondWithResult(_0x37e41c,null))[_0x4ebc('0x35')](handleError(_0x37e41c,null));};exports[_0x4ebc('0xab')]=function(_0x3a1cae,_0x11d7f9,_0x2c5408){return db[_0x4ebc('0xac')][_0x4ebc('0x5a')]({'where':{'id':_0x3a1cae[_0x4ebc('0xa6')]['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x11d7f9,null))['then'](function(_0x57cf84){if(_0x57cf84){return _0x57cf84[_0x4ebc('0xab')](_0x3a1cae[_0x4ebc('0x6d')][_0x4ebc('0xad')],_[_0x4ebc('0xae')](_0x3a1cae['body'],[_0x4ebc('0xad'),'id'])||{});}})['then'](respondWithResult(_0x11d7f9,null))[_0x4ebc('0x35')](handleError(_0x11d7f9,null));};exports[_0x4ebc('0xaf')]=function(_0x3faf02,_0x3b97d7,_0x4942a8){var _0x3c15fd={'raw':![],'where':{}};var _0x1c69a3={};var _0x451e96={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4ebc('0xb0')]({'where':{'id':_0x3faf02[_0x4ebc('0xa6')]['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x3b97d7,null))['then'](function(_0x4111c3){if(_0x4111c3){_0x1c69a3[_0x4ebc('0x3a')]=_[_0x4ebc('0xa7')](db[_0x4ebc('0xac')]['rawAttributes']);_0x1c69a3[_0x4ebc('0x3f')]=_['keys'](_0x3faf02[_0x4ebc('0x3f')]);_0x1c69a3['filters']=_[_0x4ebc('0x3d')](_0x1c69a3[_0x4ebc('0x3a')],_0x1c69a3[_0x4ebc('0x3f')]);_0x3c15fd['attributes']=_[_0x4ebc('0x3d')](_0x1c69a3[_0x4ebc('0x3a')],qs[_0x4ebc('0x3e')](_0x3faf02['query']['fields']));_0x3c15fd['attributes']=_0x3c15fd[_0x4ebc('0x3c')]['length']?_0x3c15fd[_0x4ebc('0x3c')]:_0x1c69a3[_0x4ebc('0x3a')];if(!_0x3faf02[_0x4ebc('0x3f')][_0x4ebc('0x40')](_0x4ebc('0x41'))){_0x3c15fd['limit']=qs[_0x4ebc('0x21')](_0x3faf02[_0x4ebc('0x3f')][_0x4ebc('0x21')]);_0x3c15fd[_0x4ebc('0x23')]=qs[_0x4ebc('0x23')](_0x3faf02[_0x4ebc('0x3f')]['offset']);}_0x3c15fd[_0x4ebc('0x42')]=qs[_0x4ebc('0x43')](_0x3faf02['query'][_0x4ebc('0x43')]);_0x3c15fd['where']=qs['filters'](_['pick'](_0x3faf02[_0x4ebc('0x3f')],_0x1c69a3[_0x4ebc('0x3b')]));_0x3c15fd[_0x4ebc('0x44')]['OpenchannelInteractionId']=_0x4111c3['id'];if(_0x3faf02[_0x4ebc('0x3f')]['filter']){_0x3c15fd[_0x4ebc('0x44')]=_[_0x4ebc('0x94')](_0x3c15fd[_0x4ebc('0x44')],{'$or':_[_0x4ebc('0x30')](_0x3c15fd[_0x4ebc('0x3c')],function(_0x14580a){var _0x1eb275={};_0x1eb275[_0x14580a]={'$like':'%'+_0x3faf02[_0x4ebc('0x3f')][_0x4ebc('0x7e')]+'%'};return _0x1eb275;})});}if(_0x3faf02[_0x4ebc('0x3f')][_0x4ebc('0x72')]){var _0x5672ea=_0x3faf02[_0x4ebc('0x3f')]['$gte'][_0x4ebc('0x5f')](',');var _0xdd8f9f={};_0xdd8f9f[_0x5672ea[0x0]]={'$gte':moment(_0x5672ea[0x1])[_0x4ebc('0xb1')](_0x4ebc('0xb2'))};_0x3c15fd[_0x4ebc('0x44')]=_[_0x4ebc('0x94')](_0x3c15fd[_0x4ebc('0x44')],_0xdd8f9f);}_0x3c15fd=_[_0x4ebc('0x94')]({},_0x3c15fd,_0x3faf02[_0x4ebc('0xa8')]);return db[_0x4ebc('0xac')][_0x4ebc('0x22')]({'where':_0x3c15fd['where']})[_0x4ebc('0x29')](function(_0x4e927e){_0x451e96[_0x4ebc('0x22')]=_0x4e927e;if(_0x3faf02[_0x4ebc('0x3f')]['includeAll']){_0x3c15fd[_0x4ebc('0xb3')]=[{'all':!![]}];}return db[_0x4ebc('0xac')][_0x4ebc('0xb4')](_0x3c15fd);})[_0x4ebc('0x29')](function(_0xf5dc65){_0x451e96[_0x4ebc('0xa5')]=_0xf5dc65;return _0x451e96;});}})[_0x4ebc('0x29')](respondWithFilteredResult(_0x3b97d7,_0x3c15fd))[_0x4ebc('0x35')](handleError(_0x3b97d7,null));};exports[_0x4ebc('0xb5')]=function(_0x5f5a68,_0x93d948,_0x44e363){return db['OpenchannelInteraction'][_0x4ebc('0x5a')]({'where':{'id':_0x5f5a68['params']['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x93d948,null))[_0x4ebc('0x29')](function(_0x28ee0b){if(_0x28ee0b){return _0x28ee0b[_0x4ebc('0xb6')](_0x5f5a68[_0x4ebc('0x6d')][_0x4ebc('0xad')],_[_0x4ebc('0xae')](_0x5f5a68[_0x4ebc('0x6d')],[_0x4ebc('0xad'),'id'])||{})[_0x4ebc('0xb7')](function(){return db['Tag'][_0x4ebc('0xb4')]({'attributes':['id',_0x4ebc('0x2d'),_0x4ebc('0x48')],'where':{'id':_0x5f5a68[_0x4ebc('0x6d')][_0x4ebc('0xad')]}});})[_0x4ebc('0x29')](function(_0x383d8b){socket[_0x4ebc('0xb8')](_0x4ebc('0xb9'),{'id':Number(_0x5f5a68[_0x4ebc('0xa6')]['id']),'tags':_0x383d8b||[]});return{'id':Number(_0x5f5a68['params']['id']),'tags':_0x383d8b||[]};});}})['then'](respondWithResult(_0x93d948,null))[_0x4ebc('0x35')](handleError(_0x93d948,null));};exports['removeTags']=function(_0x405d39,_0x473bb9,_0x509bc0){return db['OpenchannelInteraction']['find']({'where':{'id':_0x405d39[_0x4ebc('0xa6')]['id']}})[_0x4ebc('0x29')](handleEntityNotFound(_0x473bb9,null))[_0x4ebc('0x29')](function(_0x39ceaf){if(_0x39ceaf){return _0x39ceaf[_0x4ebc('0xba')](_0x405d39[_0x4ebc('0x3f')][_0x4ebc('0xad')]);}})[_0x4ebc('0x29')](respondWithStatusCode(_0x473bb9,null))[_0x4ebc('0x35')](handleError(_0x473bb9,null));};exports[_0x4ebc('0xbb')]=function(_0x40d93a,_0x20d6a9){var _0x262662=moment()['unix']()['toString']();var _0x489e8d=path['join'](config['root'],_0x4ebc('0xbc'),_0x4ebc('0xbd'),'tmp');var _0x51e518=path['join'](config[_0x4ebc('0xbe')],_0x4ebc('0xbc'),'files',_0x4ebc('0xbf'));var _0x354dc0=path[_0x4ebc('0xc0')](_0x489e8d,_0x262662);var _0x2cdf56=util[_0x4ebc('0xb1')](_0x4ebc('0xc1'),_0x40d93a[_0x4ebc('0xa6')]['id'],_0x262662);var _0xbf07e0=path[_0x4ebc('0xc0')](_0x489e8d,_0x2cdf56);var _0x4d9c21=[];_0x4d9c21[_0x4ebc('0x34')]({'model':db[_0x4ebc('0x68')],'as':_0x4ebc('0x68'),'attributes':['id',_0x4ebc('0x31')],'raw':!![]});_0x4d9c21[_0x4ebc('0x34')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x4ebc('0xc2'),'lastName'],'raw':!![]});if(_0x40d93a[_0x4ebc('0x3f')][_0x4ebc('0xbf')]){_0x4d9c21[_0x4ebc('0x34')]({'model':db[_0x4ebc('0xc3')],'as':'Attachment','raw':!![]});}var _0x25e3d4=[{'model':db[_0x4ebc('0xac')],'as':'Messages','attributes':['id','body',_0x4ebc('0x71'),_0x4ebc('0xc4'),'secret',_0x4ebc('0x78')],'include':_0x4d9c21}];_0x25e3d4[_0x4ebc('0x34')]({'model':db[_0x4ebc('0xc5')],'as':_0x4ebc('0xc6'),'attributes':['id',_0x4ebc('0x2d')]});_0x25e3d4[_0x4ebc('0x34')]({'model':db['User'],'as':'Owner','attributes':['id',_0x4ebc('0x31')]});return db[_0x4ebc('0x37')][_0x4ebc('0x5a')]({'where':{'id':_0x40d93a[_0x4ebc('0xa6')]['id']},'include':_0x25e3d4})['then'](handleEntityNotFound(_0x20d6a9,null))[_0x4ebc('0x29')](function(_0xc3a46c){if(_0xc3a46c){var _0x4f4e47=_0xc3a46c[_0x4ebc('0xc7')]({'plain':!![]});fs[_0x4ebc('0xc8')](_0x354dc0);var _0x181bd4={'channel':_0x4ebc('0xc9'),'account':_0x4f4e47['Account'][_0x4ebc('0x2d')],'agent':_0x4f4e47[_0x4ebc('0xca')]?_0x4f4e47[_0x4ebc('0xca')]['fullname']:_0x4ebc('0xcb'),'createdAt':moment(_0x4f4e47[_0x4ebc('0x71')])[_0x4ebc('0xb1')](_0x4ebc('0xb2'))[_0x4ebc('0xa2')](),'closedAt':_0x4f4e47['closed']?moment(_0x4f4e47['closedAt'])[_0x4ebc('0xb1')](_0x4ebc('0xb2'))['toString']():'','disposition':_0x4f4e47[_0x4ebc('0xcc')],'visibility':_0x4f4e47[_0x4ebc('0xcd')]?_0x4ebc('0xce'):_0x4ebc('0xcf'),'messages':_(_0x4f4e47[_0x4ebc('0xd0')])['filter']({'secret':![]})[_0x4ebc('0x30')](function(_0xd7af8a){if(_0xd7af8a[_0x4ebc('0xc3')]){var _0x480fd0=path['join'](_0x51e518,_0xd7af8a['Attachment']['basename']);if(fs['existsSync'](_0x480fd0)){fs['createReadStream'](_0x480fd0)[_0x4ebc('0xd1')](fs[_0x4ebc('0xd2')](path[_0x4ebc('0xc0')](_0x354dc0,_0xd7af8a[_0x4ebc('0xc3')][_0x4ebc('0xd3')])));}}return{'date':moment(_0xd7af8a[_0x4ebc('0x71')])[_0x4ebc('0xb1')](_0x4ebc('0xb2'))['toString'](),'sender':_0xd7af8a[_0x4ebc('0xc4')]===_0x4ebc('0xd4')?_0xd7af8a[_0x4ebc('0x68')]?_0xd7af8a[_0x4ebc('0x68')]['fullname']:'System':_0xd7af8a[_0x4ebc('0xd5')][_0x4ebc('0xc2')]+(_0xd7af8a[_0x4ebc('0xd5')][_0x4ebc('0xd6')]?'\x20'+_0xd7af8a[_0x4ebc('0xd5')][_0x4ebc('0xd6')]:''),'body':_0xd7af8a[_0x4ebc('0xc3')]?_0xd7af8a[_0x4ebc('0xc3')][_0x4ebc('0xd3')]:_0xd7af8a[_0x4ebc('0x6d')],'direction':_0xd7af8a[_0x4ebc('0xc4')]===_0x4ebc('0xd4')?'A':'C','secret':_0xd7af8a['secret'],'read':_0xd7af8a['read'],'attachment':_0xd7af8a['Attachment']};})['value']()};return ejs['renderFile'](path[_0x4ebc('0xc0')](config[_0x4ebc('0xbe')],'server',_0x4ebc('0xd7'),_0x4ebc('0xd8')),{'interaction':_0x181bd4})[_0x4ebc('0x29')](function(_0x46873f){var _0x5ea6cc=path[_0x4ebc('0xc0')](_0x354dc0,_0x4ebc('0xd9')+_0x4f4e47['id']+'-'+_0x262662+'.pdf');var _0x48675b={'path':_0x5ea6cc,'channel':_0x4ebc('0xc9'),'interactionId':_0x4f4e47['id']};return pdf['createPdfFromHTML'](_0x46873f,_0x48675b);})[_0x4ebc('0x29')](function(){return new BPromise(function(_0x499886,_0x19118b){zipdir(_0x354dc0,{'saveTo':_0xbf07e0},function(_0x446b71,_0x58d114){if(_0x446b71)return _0x19118b(_0x446b71);return _0x499886(_0x58d114);});})[_0x4ebc('0x29')](function(){return new BPromise(function(_0x9149a2,_0xc00285){rimraf(_0x354dc0,function(_0x3637cb){if(_0x3637cb)_0xc00285(_0x3637cb);return _0x9149a2();});});})[_0x4ebc('0x29')](function(){return _0x20d6a9[_0x4ebc('0xbb')](_0xbf07e0,_0x2cdf56,function(_0x4285ef){if(_0x4285ef){console[_0x4ebc('0xda')](_0x4ebc('0xdb'),_0x4285ef);}else{fs[_0x4ebc('0xdc')](_0xbf07e0);}});});});}else{return _0x20d6a9[_0x4ebc('0x2a')](0xc8);}})[_0x4ebc('0x35')](handleError(_0x20d6a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 185b2ec..1adbe55 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 _0xa10a=['hook','exports','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xa10a,0xb6));var _0xaa10=function(_0x1a660d,_0x182bba){_0x1a660d=_0x1a660d-0x0;var _0x3c1a19=_0xa10a[_0x1a660d];return _0x3c1a19;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xaa10('0x0')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xaa10('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xaa10('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa10('0x3'),'afterDestroy':_0xaa10('0x4')};function emitEvent(_0x86f131){return function(_0x481f52,_0x20bf7d,_0x499e60){_0x481f52[_0xaa10('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x20e916){_0x481f52[_0xaa10('0x6')](_0xaa10('0x7'),_0x20e916[_0xaa10('0x8')](function(_0x3666a0){return{'id':_0x3666a0['id']};}));return OpenchannelMessage[_0xaa10('0x9')]({'where':{'OpenchannelInteractionId':_0x481f52['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa10('0xa')](function(_0x290a69){_0x481f52['setDataValue'](_0xaa10('0xb'),_0x290a69[_0xaa10('0xc')]);OpenchannelInteractionEvents[_0xaa10('0xd')](_0x86f131+':'+_0x481f52['id'],_0x481f52);OpenchannelInteractionEvents[_0xaa10('0xd')](_0x86f131,_0x481f52);_0x499e60(null);})[_0xaa10('0xe')](_0x499e60(null));};}for(var e in events){if(events[_0xaa10('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xaa10('0x10')](e,emitEvent(event));}}module[_0xaa10('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xa929=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xa929,0x1ce));var _0x9a92=function(_0x581bd9,_0x3016cd){_0x581bd9=_0x581bd9-0x0;var _0x55ad80=_0xa929[_0x581bd9];return _0x55ad80;};'use strict';var EventEmitter=require(_0x9a92('0x0'));var OpenchannelInteraction=require(_0x9a92('0x1'))['db'][_0x9a92('0x2')];var OpenchannelMessage=require(_0x9a92('0x1'))['db'][_0x9a92('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9a92('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a92('0x5'),'afterDestroy':_0x9a92('0x6')};function emitEvent(_0x4986a8){return function(_0x3482bd,_0x321e4f,_0x59fd92){_0x3482bd[_0x9a92('0x7')]({'attributes':['id'],'raw':!![]})[_0x9a92('0x8')](function(_0x125177){_0x3482bd['setDataValue'](_0x9a92('0x9'),_0x125177[_0x9a92('0xa')](function(_0x4aed06){return{'id':_0x4aed06['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3482bd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9a92('0x8')](function(_0xa91cd5){_0x3482bd[_0x9a92('0xb')](_0x9a92('0xc'),_0xa91cd5[_0x9a92('0xd')]);OpenchannelInteractionEvents[_0x9a92('0xe')](_0x4986a8+':'+_0x3482bd['id'],_0x3482bd);OpenchannelInteractionEvents['emit'](_0x4986a8,_0x3482bd);_0x59fd92(null);})[_0x9a92('0xf')](_0x59fd92(null));};}for(var e in events){if(events[_0x9a92('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x9a92('0x11')](e,emitEvent(event));}}module[_0x9a92('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b273427..0649587 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 _0x2689=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4e141a,_0x29b849){var _0x1ce7fa=function(_0xcfdfd7){while(--_0xcfdfd7){_0x4e141a['push'](_0x4e141a['shift']());}};_0x1ce7fa(++_0x29b849);}(_0x2689,0x6a));var _0x9268=function(_0x11edbe,_0x215132){_0x11edbe=_0x11edbe-0x0;var _0xd09adf=_0x2689[_0x11edbe];return _0xd09adf;};'use strict';var _=require(_0x9268('0x0'));var util=require(_0x9268('0x1'));var logger=require(_0x9268('0x2'))('api');var moment=require(_0x9268('0x3'));var BPromise=require('bluebird');var rp=require(_0x9268('0x4'));var fs=require('fs');var path=require(_0x9268('0x5'));var rimraf=require(_0x9268('0x6'));var config=require(_0x9268('0x7'));var attributes=require(_0x9268('0x8'));module[_0x9268('0x9')]=function(_0x185681,_0x45490a){return _0x185681['define']('OpenchannelInteraction',attributes,{'tableName':_0x9268('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9268('0xb'),'collate':_0x9268('0xc'),'hooks':{'beforeUpdate':function(_0x26bb34,_0xdd02ed,_0xf19ad3){if(_0x26bb34[_0x9268('0xd')]('closed')){_0x26bb34[_0x9268('0xe')]=moment()[_0x9268('0xf')](_0x9268('0x10'));}_0xf19ad3(null,_0x26bb34);}}});}; \ No newline at end of file +var _0xee73=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x56782b,_0x571079){var _0xcc177=function(_0x2423bd){while(--_0x2423bd){_0x56782b['push'](_0x56782b['shift']());}};_0xcc177(++_0x571079);}(_0xee73,0x196));var _0x3ee7=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xee73[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x3ee7('0x0'));var util=require(_0x3ee7('0x1'));var logger=require(_0x3ee7('0x2'))(_0x3ee7('0x3'));var moment=require(_0x3ee7('0x4'));var BPromise=require(_0x3ee7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ee7('0x6'));var rimraf=require(_0x3ee7('0x7'));var config=require(_0x3ee7('0x8'));var attributes=require(_0x3ee7('0x9'));module['exports']=function(_0x526d2c,_0x226045){return _0x526d2c['define']('OpenchannelInteraction',attributes,{'tableName':_0x3ee7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3ee7('0xb'),'hooks':{'beforeUpdate':function(_0x344516,_0xc7b73e,_0x311145){if(_0x344516[_0x3ee7('0xc')](_0x3ee7('0xd'))){_0x344516[_0x3ee7('0xe')]=moment()[_0x3ee7('0xf')](_0x3ee7('0x10'));}_0x311145(null,_0x344516);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 14545cb..6f4f1e8 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 _0x51f3=['AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x51f3,0x163));var _0x351f=function(_0x34adcf,_0x27e0d2){_0x34adcf=_0x34adcf-0x0;var _0x123266=_0x51f3[_0x34adcf];return _0x123266;};'use strict';var _=require(_0x351f('0x0'));var util=require('util');var moment=require(_0x351f('0x1'));var BPromise=require(_0x351f('0x2'));var rs=require(_0x351f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x351f('0x4'))['db'];var utils=require(_0x351f('0x5'));var logger=require('../../config/logger')(_0x351f('0x6'));var config=require('../../config/environment');var jayson=require(_0x351f('0x7'));var client=jayson['client'][_0x351f('0x8')]({'port':0x232a});config[_0x351f('0x9')]=_['defaults'](config[_0x351f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x351f('0xa'))(new Redis(config['redis']));require(_0x351f('0xb'))[_0x351f('0xc')](socket);function respondWithRpcPromise(_0x14c9a8,_0x293e8b,_0x4f560b){return new BPromise(function(_0x2424c0,_0x37cefe){return client[_0x351f('0xd')](_0x14c9a8,_0x4f560b)[_0x351f('0xe')](function(_0x161069){logger['info'](_0x351f('0xf'),_0x293e8b,_0x351f('0x10'));logger[_0x351f('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x293e8b,_0x351f('0x10'),JSON[_0x351f('0x12')](_0x161069));if(_0x161069[_0x351f('0x13')]){if(_0x161069[_0x351f('0x13')][_0x351f('0x14')]===0x1f4){logger['error'](_0x351f('0xf'),_0x293e8b,_0x161069[_0x351f('0x13')]['message']);return _0x37cefe(_0x161069[_0x351f('0x13')][_0x351f('0x15')]);}logger[_0x351f('0x13')](_0x351f('0xf'),_0x293e8b,_0x161069['error'][_0x351f('0x15')]);return _0x2424c0(_0x161069[_0x351f('0x13')]['message']);}else{logger[_0x351f('0x16')](_0x351f('0xf'),_0x293e8b,_0x351f('0x10'));_0x2424c0(_0x161069[_0x351f('0x17')][_0x351f('0x15')]);}})[_0x351f('0x18')](function(_0x185f90){logger['error'](_0x351f('0xf'),_0x293e8b,_0x185f90);_0x37cefe(_0x185f90);});});}exports[_0x351f('0x19')]=function(_0x1a07c4){var _0x408fee=this;return new Promise(function(_0x194ff7,_0x275ce4){return db[_0x351f('0x1a')]['update'](_0x1a07c4[_0x351f('0x1b')],{'raw':_0x1a07c4[_0x351f('0x1c')]?_0x1a07c4[_0x351f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a07c4[_0x351f('0x1c')]?_0x1a07c4['options'][_0x351f('0x1d')]||null:null,'attributes':_0x1a07c4[_0x351f('0x1c')]?_0x1a07c4['options']['attributes']||null:null,'limit':_0x1a07c4[_0x351f('0x1c')]?_0x1a07c4[_0x351f('0x1c')]['limit']||null:null})[_0x351f('0xe')](function(_0x1f68a5){logger[_0x351f('0x16')](_0x351f('0x19'),_0x1a07c4);logger[_0x351f('0x11')](_0x351f('0x19'),_0x1a07c4,JSON['stringify'](_0x1f68a5));_0x194ff7(_0x1f68a5);})['catch'](function(_0xb92109){logger['error']('UpdateOpenchannelInteraction',_0xb92109[_0x351f('0x15')],_0x1a07c4);_0x275ce4(_0x408fee[_0x351f('0x13')](0x1f4,_0xb92109['message']));});});};exports[_0x351f('0x1e')]=function(_0x583ecb){return new Promise(function(_0x11991a,_0x54f148){return db[_0x351f('0x1a')][_0x351f('0x1f')]({'where':_0x583ecb['options']?_0x583ecb['options']['where']||null:null})[_0x351f('0xe')](function(_0xd708cb){if(_0xd708cb){return _0xd708cb['addTags'](_0x583ecb[_0x351f('0x1b')][_0x351f('0x20')],_[_0x351f('0x21')](_0x583ecb[_0x351f('0x1b')],[_0x351f('0x20'),'id'])||{});}})['spread'](function(_0x3ccf9a){logger['info']('AddTags',_0x583ecb);logger[_0x351f('0x11')](_0x351f('0x22'),_0x583ecb,JSON[_0x351f('0x12')](_0x3ccf9a));_0x11991a(_0x3ccf9a);})['catch'](function(_0x4cfd05){logger[_0x351f('0x13')](_0x351f('0x22'),_0x4cfd05[_0x351f('0x15')],_0x583ecb);_0x54f148(_this[_0x351f('0x13')](0x1f4,_0x4cfd05[_0x351f('0x15')]));});});}; \ No newline at end of file +var _0xf1a4=['redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','where','addTags','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x23200d,_0x15fb6e){var _0x3f8381=function(_0x3318d6){while(--_0x3318d6){_0x23200d['push'](_0x23200d['shift']());}};_0x3f8381(++_0x15fb6e);}(_0xf1a4,0x1e1));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4f1a('0x0'));var util=require(_0x4f1a('0x1'));var moment=require(_0x4f1a('0x2'));var BPromise=require(_0x4f1a('0x3'));var rs=require(_0x4f1a('0x4'));var fs=require('fs');var Redis=require(_0x4f1a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f1a('0x6'));var logger=require(_0x4f1a('0x7'))('rpc');var config=require(_0x4f1a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4f1a('0x9')][_0x4f1a('0xa')]({'port':0x232a});config[_0x4f1a('0xb')]=_['defaults'](config[_0x4f1a('0xb')],{'host':_0x4f1a('0xc'),'port':0x18eb});var socket=require(_0x4f1a('0xd'))(new Redis(config[_0x4f1a('0xb')]));require(_0x4f1a('0xe'))[_0x4f1a('0xf')](socket);function respondWithRpcPromise(_0x4497c4,_0x12557b,_0x303a37){return new BPromise(function(_0x29e715,_0xb294e3){return client[_0x4f1a('0x10')](_0x4497c4,_0x303a37)[_0x4f1a('0x11')](function(_0x1b9f76){logger[_0x4f1a('0x12')](_0x4f1a('0x13'),_0x12557b,_0x4f1a('0x14'));logger[_0x4f1a('0x15')](_0x4f1a('0x16'),_0x12557b,_0x4f1a('0x14'),JSON[_0x4f1a('0x17')](_0x1b9f76));if(_0x1b9f76[_0x4f1a('0x18')]){if(_0x1b9f76[_0x4f1a('0x18')][_0x4f1a('0x19')]===0x1f4){logger['error'](_0x4f1a('0x13'),_0x12557b,_0x1b9f76[_0x4f1a('0x18')][_0x4f1a('0x1a')]);return _0xb294e3(_0x1b9f76[_0x4f1a('0x18')][_0x4f1a('0x1a')]);}logger[_0x4f1a('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x12557b,_0x1b9f76['error'][_0x4f1a('0x1a')]);return _0x29e715(_0x1b9f76[_0x4f1a('0x18')]['message']);}else{logger['info'](_0x4f1a('0x13'),_0x12557b,_0x4f1a('0x14'));_0x29e715(_0x1b9f76[_0x4f1a('0x1b')][_0x4f1a('0x1a')]);}})[_0x4f1a('0x1c')](function(_0x14801d){logger[_0x4f1a('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x12557b,_0x14801d);_0xb294e3(_0x14801d);});});}exports[_0x4f1a('0x1d')]=function(_0x3f70ff){var _0xd24b0=this;return new Promise(function(_0x5ab91f,_0x448f56){return db[_0x4f1a('0x1e')][_0x4f1a('0x1f')](_0x3f70ff[_0x4f1a('0x20')],{'raw':_0x3f70ff['options']?_0x3f70ff[_0x4f1a('0x21')][_0x4f1a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f70ff['options']?_0x3f70ff[_0x4f1a('0x21')]['where']||null:null,'attributes':_0x3f70ff['options']?_0x3f70ff[_0x4f1a('0x21')][_0x4f1a('0x23')]||null:null,'limit':_0x3f70ff['options']?_0x3f70ff[_0x4f1a('0x21')][_0x4f1a('0x24')]||null:null})['then'](function(_0x53020d){logger[_0x4f1a('0x12')](_0x4f1a('0x1d'),_0x3f70ff);logger['debug'](_0x4f1a('0x1d'),_0x3f70ff,JSON[_0x4f1a('0x17')](_0x53020d));_0x5ab91f(_0x53020d);})[_0x4f1a('0x1c')](function(_0x3acdee){logger[_0x4f1a('0x18')](_0x4f1a('0x1d'),_0x3acdee[_0x4f1a('0x1a')],_0x3f70ff);_0x448f56(_0xd24b0[_0x4f1a('0x18')](0x1f4,_0x3acdee[_0x4f1a('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x350761){return new Promise(function(_0x561fcd,_0x53086f){return db[_0x4f1a('0x1e')]['find']({'where':_0x350761[_0x4f1a('0x21')]?_0x350761[_0x4f1a('0x21')][_0x4f1a('0x25')]||null:null})[_0x4f1a('0x11')](function(_0x4b3d22){if(_0x4b3d22){return _0x4b3d22[_0x4f1a('0x26')](_0x350761['body']['ids'],_[_0x4f1a('0x27')](_0x350761[_0x4f1a('0x20')],['ids','id'])||{});}})['spread'](function(_0x34bbb3){logger[_0x4f1a('0x12')](_0x4f1a('0x28'),_0x350761);logger[_0x4f1a('0x15')]('AddTags',_0x350761,JSON[_0x4f1a('0x17')](_0x34bbb3));_0x561fcd(_0x34bbb3);})['catch'](function(_0x52b9ad){logger['error'](_0x4f1a('0x28'),_0x52b9ad['message'],_0x350761);_0x53086f(_this[_0x4f1a('0x18')](0x1f4,_0x52b9ad[_0x4f1a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0577a21..c9a3cfd 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 _0x0235=['emit','removeListener','register','./openchannelInteraction.events','update'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x0235,0xdf));var _0x5023=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x0235[_0xbb091];return _0x467a04;};'use strict';var OpenchannelInteractionEvents=require(_0x5023('0x0'));var events=['save','remove',_0x5023('0x1')];function createListener(_0x246d44,_0x4f0cc9){return function(_0x19ba43){_0x4f0cc9[_0x5023('0x2')](_0x246d44,_0x19ba43);};}function removeListener(_0x2dac39,_0x2ed358){return function(){OpenchannelInteractionEvents[_0x5023('0x3')](_0x2dac39,_0x2ed358);};}exports[_0x5023('0x4')]=function(_0x1466f5){for(var _0x2b8a7d=0x0,_0x210e5c=events['length'];_0x2b8a7d<_0x210e5c;_0x2b8a7d++){var _0x32c4ff=events[_0x2b8a7d];var _0x3fd05e=createListener('openchannelInteraction:'+_0x32c4ff,_0x1466f5);OpenchannelInteractionEvents['on'](_0x32c4ff,_0x3fd05e);}}; \ No newline at end of file +var _0x4990=['openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','removeListener'];(function(_0x48c01a,_0x2fa4a6){var _0x2389f4=function(_0x185bd4){while(--_0x185bd4){_0x48c01a['push'](_0x48c01a['shift']());}};_0x2389f4(++_0x2fa4a6);}(_0x4990,0x15d));var _0x0499=function(_0x1621dd,_0x172229){_0x1621dd=_0x1621dd-0x0;var _0x3b0046=_0x4990[_0x1621dd];return _0x3b0046;};'use strict';var OpenchannelInteractionEvents=require(_0x0499('0x0'));var events=[_0x0499('0x1'),_0x0499('0x2'),'update'];function createListener(_0x510067,_0x2f62c6){return function(_0x1f8866){_0x2f62c6[_0x0499('0x3')](_0x510067,_0x1f8866);};}function removeListener(_0x390cb9,_0x105193){return function(){OpenchannelInteractionEvents[_0x0499('0x4')](_0x390cb9,_0x105193);};}exports['register']=function(_0x37f8c8){for(var _0xda1326=0x0,_0x415a43=events['length'];_0xda1326<_0x415a43;_0xda1326++){var _0x568976=events[_0xda1326];var _0x9ffc85=createListener(_0x0499('0x5')+_0x568976,_0x37f8c8);OpenchannelInteractionEvents['on'](_0x568976,_0x9ffc85);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 7a96ac1..8816a28 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x32af67,_0xd5da7b){var _0x82acc6=function(_0x30adf8){while(--_0x30adf8){_0x32af67['push'](_0x32af67['shift']());}};_0x82acc6(++_0xd5da7b);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x3ca659,_0x35476a){_0x3ca659=_0x3ca659-0x0;var _0x1bb18e=_0x70e0[_0x3ca659];return _0x1bb18e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index c1bd1a8..8fc6c19 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 _0x4c99=['sequelize','TEXT','ENUM','out','DATE','STRING'];(function(_0x2e8242,_0xdd7c17){var _0x910da8=function(_0xd0d321){while(--_0xd0d321){_0x2e8242['push'](_0x2e8242['shift']());}};_0x910da8(++_0xdd7c17);}(_0x4c99,0x1ec));var _0x94c9=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4c99[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x94c9('0x0'));module['exports']={'body':{'type':Sequelize[_0x94c9('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x94c9('0x2')]('in',_0x94c9('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x94c9('0x4')]},'providerName':{'type':Sequelize[_0x94c9('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x1d21,0x158));var _0x11d2=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x1d21[_0x5bff0];return _0x3ead2e;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2c67ab5..b3815eb 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 _0x3f42=['ContactId','sequelize','SELECT','contact','email','internal','manual','format','channel','event','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','User','fullname','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','name','query','filters','attributes','model','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','intersection','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'];(function(_0x144889,_0x516537){var _0x1793da=function(_0x25f47b){while(--_0x25f47b){_0x144889['push'](_0x144889['shift']());}};_0x1793da(++_0x516537);}(_0x3f42,0x9a));var _0x23f4=function(_0x15630e,_0x51d470){_0x15630e=_0x15630e-0x0;var _0xf5a30=_0x3f42[_0x15630e];return _0xf5a30;};'use strict';var emlformat=require(_0x23f4('0x0'));var rimraf=require(_0x23f4('0x1'));var zipdir=require(_0x23f4('0x2'));var jsonpatch=require(_0x23f4('0x3'));var rp=require(_0x23f4('0x4'));var moment=require('moment');var BPromise=require(_0x23f4('0x5'));var Mustache=require(_0x23f4('0x6'));var util=require(_0x23f4('0x7'));var path=require(_0x23f4('0x8'));var sox=require(_0x23f4('0x9'));var csv=require(_0x23f4('0xa'));var ejs=require(_0x23f4('0xb'));var fs=require('fs');var fs_extra=require(_0x23f4('0xc'));var _=require(_0x23f4('0xd'));var squel=require(_0x23f4('0xe'));var crypto=require(_0x23f4('0xf'));var jsforce=require(_0x23f4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x23f4('0xa'));var querystring=require(_0x23f4('0x11'));var Papa=require(_0x23f4('0x12'));var Redis=require(_0x23f4('0x13'));var authService=require(_0x23f4('0x14'));var qs=require(_0x23f4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23f4('0x16'));var logger=require('../../config/logger')(_0x23f4('0x17'));var utils=require(_0x23f4('0x18'));var config=require(_0x23f4('0x19'));var licenseUtil=require(_0x23f4('0x1a'));var db=require('../../mysqldb')['db'];config[_0x23f4('0x1b')]=_[_0x23f4('0x1c')](config[_0x23f4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x23f4('0x1d'))(new Redis(config[_0x23f4('0x1b')]));require('./openchannelMessage.socket')[_0x23f4('0x1e')](socket);var jayson=require(_0x23f4('0x1f'));var client=jayson['client'][_0x23f4('0x20')]({'port':0x232c});var client9002=jayson[_0x23f4('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eec82,_0x11e068,_0x1f7cc3,_0x46ccbd){return new BPromise(function(_0x5d220e,_0xf1aced){var _0x55b247=_0x46ccbd||client;return _0x55b247['request'](_0x1eec82,_0x1f7cc3)[_0x23f4('0x22')](function(_0x12a2c4){logger['info'](_0x23f4('0x23'),_0x11e068,_0x23f4('0x24'));logger[_0x23f4('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x11e068,_0x23f4('0x24'),JSON[_0x23f4('0x26')](_0x12a2c4));if(_0x12a2c4[_0x23f4('0x27')]){if(_0x12a2c4[_0x23f4('0x27')][_0x23f4('0x28')]===0x1f4){logger[_0x23f4('0x27')](_0x23f4('0x23'),_0x11e068,_0x12a2c4[_0x23f4('0x27')][_0x23f4('0x29')]);return _0xf1aced(_0x12a2c4[_0x23f4('0x27')][_0x23f4('0x29')]);}logger[_0x23f4('0x27')](_0x23f4('0x23'),_0x11e068,_0x12a2c4[_0x23f4('0x27')]['message']);return _0x5d220e(_0x12a2c4[_0x23f4('0x27')][_0x23f4('0x29')]);}else{logger['info'](_0x23f4('0x23'),_0x11e068,_0x23f4('0x24'));_0x5d220e(_0x12a2c4[_0x23f4('0x2a')][_0x23f4('0x29')]);}})[_0x23f4('0x2b')](function(_0x14c347){logger[_0x23f4('0x27')](_0x23f4('0x23'),_0x11e068,_0x14c347);_0xf1aced(_0x14c347);});});}function respondWithStatusCode(_0x1e0d75,_0x1a88ab){_0x1a88ab=_0x1a88ab||0xcc;return function(_0x103df5){if(_0x103df5){return _0x1e0d75['sendStatus'](_0x1a88ab);}return _0x1e0d75[_0x23f4('0x2c')](_0x1a88ab)[_0x23f4('0x2d')]();};}function respondWithResult(_0x18e8bf,_0x52dbba){_0x52dbba=_0x52dbba||0xc8;return function(_0x1af2c4){if(_0x1af2c4){return _0x18e8bf['status'](_0x52dbba)[_0x23f4('0x2e')](_0x1af2c4);}};}function respondWithFilteredResult(_0x2c9816,_0x1c7516){return function(_0x37778b){if(_0x37778b){var _0x309fcf=typeof _0x1c7516['offset']===_0x23f4('0x2f')&&typeof _0x1c7516[_0x23f4('0x30')]==='undefined';var _0x9dd9e2=_0x37778b['count'];var _0xe02c60=_0x309fcf?0x0:_0x1c7516[_0x23f4('0x31')];var _0x448808=_0x309fcf?_0x37778b[_0x23f4('0x32')]:_0x1c7516[_0x23f4('0x31')]+_0x1c7516[_0x23f4('0x30')];var _0x5b9ad5;if(_0x448808>=_0x9dd9e2){_0x448808=_0x9dd9e2;_0x5b9ad5=0xc8;}else{_0x5b9ad5=0xce;}_0x2c9816['status'](_0x5b9ad5);return _0x2c9816[_0x23f4('0x33')](_0x23f4('0x34'),_0xe02c60+'-'+_0x448808+'/'+_0x9dd9e2)[_0x23f4('0x2e')](_0x37778b);}return null;};}function patchUpdates(_0x1b8246){return function(_0x4e57dd){try{jsonpatch[_0x23f4('0x35')](_0x4e57dd,_0x1b8246,!![]);}catch(_0x2f7bd5){return BPromise[_0x23f4('0x36')](_0x2f7bd5);}return _0x4e57dd[_0x23f4('0x37')]();};}function saveUpdates(_0x5b476d,_0x27d067){return function(_0x51ae15){if(_0x51ae15){return _0x51ae15[_0x23f4('0x38')](_0x5b476d)[_0x23f4('0x22')](function(_0x496700){return _0x496700;});}return null;};}function removeEntity(_0x3fdc1d,_0x2953ac){return function(_0x1c2704){if(_0x1c2704){return _0x1c2704[_0x23f4('0x39')]()['then'](function(){_0x3fdc1d[_0x23f4('0x2c')](0xcc)[_0x23f4('0x2d')]();});}};}function handleEntityNotFound(_0x5e4313,_0x352128){return function(_0x1b05c9){if(!_0x1b05c9){_0x5e4313[_0x23f4('0x3a')](0x194);}return _0x1b05c9;};}function handleError(_0x43dcc9,_0x2de1eb){_0x2de1eb=_0x2de1eb||0x1f4;return function(_0x3f2ad6){logger[_0x23f4('0x27')](_0x3f2ad6['stack']);if(_0x3f2ad6['name']){delete _0x3f2ad6['name'];}_0x43dcc9['status'](_0x2de1eb)[_0x23f4('0x3b')](_0x3f2ad6);};}exports[_0x23f4('0x3c')]=function(_0x1d64a5,_0xcdf0ac){var _0x5bb2ae={},_0x4e7837={},_0x4d19a0={'count':0x0,'rows':[]};var _0x144a3c=_[_0x23f4('0x3d')](db[_0x23f4('0x3e')][_0x23f4('0x3f')],function(_0x550bf5){return{'name':_0x550bf5[_0x23f4('0x40')],'type':_0x550bf5[_0x23f4('0x41')]['key']};});_0x4e7837['model']=_[_0x23f4('0x3d')](_0x144a3c,_0x23f4('0x42'));_0x4e7837[_0x23f4('0x43')]=_['keys'](_0x1d64a5[_0x23f4('0x43')]);_0x4e7837[_0x23f4('0x44')]=_['intersection'](_0x4e7837['model'],_0x4e7837[_0x23f4('0x43')]);_0x5bb2ae[_0x23f4('0x45')]=_['intersection'](_0x4e7837[_0x23f4('0x46')],qs[_0x23f4('0x47')](_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x47')]));_0x5bb2ae[_0x23f4('0x45')]=_0x5bb2ae['attributes']['length']?_0x5bb2ae[_0x23f4('0x45')]:_0x4e7837[_0x23f4('0x46')];if(!_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x48')](_0x23f4('0x49'))){_0x5bb2ae['limit']=qs[_0x23f4('0x30')](_0x1d64a5['query']['limit']);_0x5bb2ae[_0x23f4('0x31')]=qs['offset'](_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x31')]);}_0x5bb2ae['order']=qs[_0x23f4('0x4a')](_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x4a')]);_0x5bb2ae[_0x23f4('0x4b')]=qs[_0x23f4('0x44')](_['pick'](_0x1d64a5[_0x23f4('0x43')],_0x4e7837['filters']),_0x144a3c);if(_0x1d64a5[_0x23f4('0x43')]['filter']){_0x5bb2ae[_0x23f4('0x4b')]=_[_0x23f4('0x4c')](_0x5bb2ae[_0x23f4('0x4b')],{'$or':_['map'](_0x144a3c,function(_0x5c6c7c){if(_0x5c6c7c[_0x23f4('0x41')]!==_0x23f4('0x4d')){var _0x2a3990={};_0x2a3990[_0x5c6c7c[_0x23f4('0x42')]]={'$like':'%'+_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x4e')]+'%'};return _0x2a3990;}})});}_0x5bb2ae=_[_0x23f4('0x4c')]({},_0x5bb2ae,_0x1d64a5[_0x23f4('0x4f')]);var _0x4f0f14={'where':_0x5bb2ae[_0x23f4('0x4b')]};return db[_0x23f4('0x3e')][_0x23f4('0x32')](_0x4f0f14)['then'](function(_0x2f919d){_0x4d19a0[_0x23f4('0x32')]=_0x2f919d;if(_0x1d64a5[_0x23f4('0x43')][_0x23f4('0x50')]){_0x5bb2ae[_0x23f4('0x51')]=[{'all':!![]}];}return db[_0x23f4('0x3e')]['findAll'](_0x5bb2ae);})[_0x23f4('0x22')](function(_0xad3be2){_0x4d19a0[_0x23f4('0x52')]=_0xad3be2;return _0x4d19a0;})[_0x23f4('0x22')](respondWithFilteredResult(_0xcdf0ac,_0x5bb2ae))[_0x23f4('0x2b')](handleError(_0xcdf0ac,null));};exports['show']=function(_0x58285c,_0x554b9b){var _0x5e53fe={'raw':!![],'where':{'id':_0x58285c[_0x23f4('0x53')]['id']}},_0x476148={};_0x476148['model']=_['keys'](db['OpenchannelMessage'][_0x23f4('0x3f')]);_0x476148['query']=_['keys'](_0x58285c[_0x23f4('0x43')]);_0x476148[_0x23f4('0x44')]=_[_0x23f4('0x54')](_0x476148[_0x23f4('0x46')],_0x476148[_0x23f4('0x43')]);_0x5e53fe[_0x23f4('0x45')]=_[_0x23f4('0x54')](_0x476148[_0x23f4('0x46')],qs[_0x23f4('0x47')](_0x58285c['query'][_0x23f4('0x47')]));_0x5e53fe[_0x23f4('0x45')]=_0x5e53fe['attributes']['length']?_0x5e53fe[_0x23f4('0x45')]:_0x476148[_0x23f4('0x46')];if(_0x58285c[_0x23f4('0x43')][_0x23f4('0x50')]){_0x5e53fe[_0x23f4('0x51')]=[{'all':!![]}];}_0x5e53fe=_[_0x23f4('0x4c')]({},_0x5e53fe,_0x58285c[_0x23f4('0x4f')]);return db[_0x23f4('0x3e')][_0x23f4('0x55')](_0x5e53fe)[_0x23f4('0x22')](handleEntityNotFound(_0x554b9b,null))[_0x23f4('0x22')](respondWithResult(_0x554b9b,null))['catch'](handleError(_0x554b9b,null));};exports[_0x23f4('0x56')]=function(_0x5e9274,_0x58d404){return db[_0x23f4('0x3e')][_0x23f4('0x56')](_0x5e9274[_0x23f4('0x57')],{})[_0x23f4('0x22')](respondWithResult(_0x58d404,0xc9))[_0x23f4('0x2b')](handleError(_0x58d404,null));};exports[_0x23f4('0x38')]=function(_0x373b4d,_0x1eb02f){if(_0x373b4d[_0x23f4('0x57')]['id']){delete _0x373b4d[_0x23f4('0x57')]['id'];}return db[_0x23f4('0x3e')]['find']({'where':{'id':_0x373b4d['params']['id']}})[_0x23f4('0x22')](handleEntityNotFound(_0x1eb02f,null))['then'](saveUpdates(_0x373b4d[_0x23f4('0x57')],null))[_0x23f4('0x22')](respondWithResult(_0x1eb02f,null))['catch'](handleError(_0x1eb02f,null));};exports[_0x23f4('0x39')]=function(_0x19abf6,_0x4c64b5){return db[_0x23f4('0x3e')][_0x23f4('0x55')]({'where':{'id':_0x19abf6['params']['id']}})[_0x23f4('0x22')](handleEntityNotFound(_0x4c64b5,null))[_0x23f4('0x22')](removeEntity(_0x4c64b5,null))[_0x23f4('0x2b')](handleError(_0x4c64b5,null));};exports[_0x23f4('0x58')]=function(_0x2265c9,_0x248b12){return db['OpenchannelMessage']['describe']()[_0x23f4('0x22')](respondWithResult(_0x248b12,null))[_0x23f4('0x2b')](handleError(_0x248b12,null));};var interaction_log=require(_0x23f4('0x59'))(_0x23f4('0x5a'));exports[_0x23f4('0x5b')]=function(_0x22a816,_0x45aba4,_0x5d7a61){var _0x16052e={'agent':{},'channel':_0x23f4('0x5c')};if(_0x22a816['body']['id']){delete _0x22a816['body']['id'];}_0x22a816[_0x23f4('0x57')][_0x23f4('0x5d')]=!![];_0x22a816[_0x23f4('0x57')][_0x23f4('0x5e')]=moment()['format'](_0x23f4('0x5f'));_0x22a816[_0x23f4('0x57')]['UserId']=_0x22a816[_0x23f4('0x57')][_0x23f4('0x60')]||_0x22a816['user']['id'];_0x16052e[_0x23f4('0x61')]['id']=_0x22a816['body'][_0x23f4('0x60')];return db['OpenchannelMessage'][_0x23f4('0x55')]({'where':{'id':_0x22a816[_0x23f4('0x53')]['id'],'UserId':null}})[_0x23f4('0x22')](handleEntityNotFound(_0x45aba4,null))[_0x23f4('0x22')](saveUpdates(_0x22a816[_0x23f4('0x57')],null))[_0x23f4('0x22')](function(_0x430940){if(_0x430940){_0x16052e[_0x23f4('0x29')]=_0x430940[_0x23f4('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x23f4('0x55')]({'where':{'id':_0x430940['OpenchannelInteractionId']}});}return null;})[_0x23f4('0x22')](handleEntityNotFound(_0x45aba4,null))['then'](function(_0x207f90){if(_0x207f90){return _0x207f90[_0x23f4('0x38')]({'UserId':_0x22a816[_0x23f4('0x57')]['UserId'],'read1stAt':_[_0x23f4('0x63')](_0x207f90['read1stAt'])?moment()['format'](_0x23f4('0x5f')):undefined});}return null;})[_0x23f4('0x22')](function(_0x3d4c9f){if(_0x3d4c9f){_0x16052e['interaction']=_0x3d4c9f[_0x23f4('0x62')]({'plain':!![]});interaction_log[_0x23f4('0x64')](_0x23f4('0x65'),_0x22a816[_0x23f4('0x66')]['id'],_0x22a816['user']['name'],_0x22a816[_0x23f4('0x66')]['role'],_0x16052e[_0x23f4('0x67')]['id'],_0x22a816[_0x23f4('0x57')]?JSON[_0x23f4('0x26')](_0x22a816['body']):_0x23f4('0x68'));return respondWithRpcPromise(_0x23f4('0x69'),_0x23f4('0x6a'),_0x16052e);}return null;})[_0x23f4('0x22')](function(_0x578f12){var _0x56ae6e=_0x23f4('0x6b')+_0x578f12[_0x23f4('0x29')][_0x23f4('0x6c')];return db[_0x23f4('0x6d')][_0x23f4('0x43')](_0x56ae6e,{'type':db['Sequelize']['QueryTypes'][_0x23f4('0x6e')],'raw':!![]})['then'](function(_0x129e1a){return _0x129e1a;});})[_0x23f4('0x22')](function(_0x5712d6){if(_0x5712d6){_0x16052e[_0x23f4('0x29')][_0x23f4('0x6f')]=_0x5712d6[0x0];if(!_0x22a816[_0x23f4('0x57')][_0x23f4('0x60')])return;return db['User'][_0x23f4('0x55')]({'where':{'id':_0x22a816[_0x23f4('0x57')][_0x23f4('0x60')],'role':_0x23f4('0x61')},'attributes':['id','name','fullname',_0x23f4('0x70'),_0x23f4('0x71')],'raw':!![]});}return null;})['then'](function(_0xf6c02c){if(!_0xf6c02c)return null;_0x16052e[_0x23f4('0x29')]['agent']=_0xf6c02c;return _0x16052e;})[_0x23f4('0x22')](function(_0x113565){if(_0x113565){if(_0x22a816[_0x23f4('0x57')][_0x23f4('0x72')]){_0x16052e['message']['interface']=util[_0x23f4('0x73')]('SIP/%s',_0x22a816[_0x23f4('0x66')][_0x23f4('0x42')]);_0x16052e[_0x23f4('0x29')][_0x23f4('0x74')]=_0x16052e[_0x23f4('0x74')];_0x16052e['message'][_0x23f4('0x75')]=_0x23f4('0x5b');return respondWithRpcPromise(_0x23f4('0x76'),_0x23f4('0x76'),{'event':_0x23f4('0x77'),'message':_0x16052e['message']},client9002)[_0x23f4('0x22')](function(){return _0x16052e;});}return _0x16052e;}return null;})[_0x23f4('0x22')](respondWithResult(_0x45aba4,null))[_0x23f4('0x2b')](handleError(_0x45aba4,null));};var interaction_log=require(_0x23f4('0x59'))(_0x23f4('0x5a'));exports[_0x23f4('0x36')]=function(_0x1e97c5,_0x6b867f,_0x22968a){var _0x4fa46e={'agent':{},'channel':_0x23f4('0x5c')};if(_0x1e97c5['body']['id']){delete _0x1e97c5[_0x23f4('0x57')]['id'];}_0x1e97c5[_0x23f4('0x57')][_0x23f4('0x60')]=_0x1e97c5[_0x23f4('0x57')][_0x23f4('0x60')]||_0x1e97c5[_0x23f4('0x66')]['id'];_0x4fa46e[_0x23f4('0x61')]['id']=_0x1e97c5[_0x23f4('0x57')][_0x23f4('0x60')];return db['OpenchannelMessage'][_0x23f4('0x55')]({'where':{'id':_0x1e97c5[_0x23f4('0x53')]['id'],'UserId':null}})[_0x23f4('0x22')](handleEntityNotFound(_0x6b867f,null))['then'](function(_0x24652c){if(_0x24652c){_0x4fa46e[_0x23f4('0x29')]=_0x24652c[_0x23f4('0x62')]({'plain':!![]});return db[_0x23f4('0x78')]['find']({'where':{'id':_0x24652c[_0x23f4('0x79')]}});}return null;})[_0x23f4('0x22')](handleEntityNotFound(_0x6b867f,null))[_0x23f4('0x22')](function(_0x503c1f){if(_0x503c1f){_0x4fa46e[_0x23f4('0x67')]=_0x503c1f[_0x23f4('0x62')]({'plain':!![]});interaction_log['info'](_0x23f4('0x7a'),_0x1e97c5[_0x23f4('0x66')]['id'],_0x1e97c5['user']['name'],_0x1e97c5[_0x23f4('0x66')][_0x23f4('0x7b')],_0x4fa46e[_0x23f4('0x67')]['id'],_0x1e97c5[_0x23f4('0x57')]?JSON[_0x23f4('0x26')](_0x1e97c5[_0x23f4('0x57')]):_0x23f4('0x68'));return respondWithRpcPromise(_0x23f4('0x7c'),_0x23f4('0x7d'),_0x4fa46e);}return null;})[_0x23f4('0x22')](function(_0x200dec){var _0x4f50c2=_0x23f4('0x6b')+_0x200dec[_0x23f4('0x29')]['ContactId'];return db[_0x23f4('0x6d')][_0x23f4('0x43')](_0x4f50c2,{'type':db[_0x23f4('0x7e')]['QueryTypes'][_0x23f4('0x6e')],'raw':!![]})[_0x23f4('0x22')](function(_0x14c6f9){return _0x14c6f9;});})['then'](function(_0xe996d4){if(_0xe996d4){_0x4fa46e[_0x23f4('0x29')]['contact']=_0xe996d4[0x0];if(!_0x1e97c5[_0x23f4('0x57')][_0x23f4('0x60')])return;return db[_0x23f4('0x7f')][_0x23f4('0x55')]({'where':{'id':_0x1e97c5['body'][_0x23f4('0x60')],'role':'agent'},'attributes':['id',_0x23f4('0x42'),_0x23f4('0x80'),_0x23f4('0x70'),_0x23f4('0x71')],'raw':!![]});}return null;})['then'](function(_0x59e7e5){if(!_0x59e7e5)return null;_0x4fa46e[_0x23f4('0x29')][_0x23f4('0x61')]=_0x59e7e5;return _0x4fa46e;})[_0x23f4('0x22')](function(_0x375ddc){if(_0x375ddc){_0x375ddc[_0x23f4('0x29')][_0x23f4('0x81')]=util[_0x23f4('0x73')]('SIP/%s',_0x1e97c5[_0x23f4('0x66')][_0x23f4('0x42')]);_0x375ddc[_0x23f4('0x29')][_0x23f4('0x74')]=_0x4fa46e[_0x23f4('0x74')];_0x375ddc[_0x23f4('0x29')][_0x23f4('0x75')]=_0x23f4('0x36');respondWithRpcPromise('EventManager',_0x23f4('0x76'),{'event':_0x23f4('0x82'),'message':_0x375ddc[_0x23f4('0x29')]},client9002);return _0x4fa46e;}return null;})[_0x23f4('0x22')](respondWithResult(_0x6b867f,null))[_0x23f4('0x2b')](handleError(_0x6b867f,null));}; \ No newline at end of file +var _0x9be8=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','length','attributes','model','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','sequelize','SIP/%s','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x12e1cf,_0x46aaa4){var _0x33dca4=function(_0x456777){while(--_0x456777){_0x12e1cf['push'](_0x12e1cf['shift']());}};_0x33dca4(++_0x46aaa4);}(_0x9be8,0x103));var _0x89be=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x9be8[_0x25d2fb];return _0x1ded53;};'use strict';var emlformat=require(_0x89be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89be('0x1'));var jsonpatch=require(_0x89be('0x2'));var rp=require(_0x89be('0x3'));var moment=require(_0x89be('0x4'));var BPromise=require(_0x89be('0x5'));var Mustache=require(_0x89be('0x6'));var util=require(_0x89be('0x7'));var path=require('path');var sox=require(_0x89be('0x8'));var csv=require('to-csv');var ejs=require(_0x89be('0x9'));var fs=require('fs');var fs_extra=require(_0x89be('0xa'));var _=require(_0x89be('0xb'));var squel=require(_0x89be('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x89be('0xd'));var toCsv=require(_0x89be('0xe'));var querystring=require(_0x89be('0xf'));var Papa=require('papaparse');var Redis=require(_0x89be('0x10'));var authService=require(_0x89be('0x11'));var qs=require(_0x89be('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89be('0x13'));var logger=require(_0x89be('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x89be('0x15'));var licenseUtil=require(_0x89be('0x16'));var db=require(_0x89be('0x17'))['db'];config[_0x89be('0x18')]=_[_0x89be('0x19')](config[_0x89be('0x18')],{'host':_0x89be('0x1a'),'port':0x18eb});var socket=require(_0x89be('0x1b'))(new Redis(config[_0x89be('0x18')]));require(_0x89be('0x1c'))[_0x89be('0x1d')](socket);var jayson=require(_0x89be('0x1e'));var client=jayson[_0x89be('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x89be('0x1f')][_0x89be('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x58ee1a,_0xab6a3a,_0x58103c,_0x529e2e){return new BPromise(function(_0x40c801,_0x4a8cd0){var _0x3e9b24=_0x529e2e||client;return _0x3e9b24[_0x89be('0x21')](_0x58ee1a,_0x58103c)[_0x89be('0x22')](function(_0x4a77ac){logger[_0x89be('0x23')](_0x89be('0x24'),_0xab6a3a,_0x89be('0x25'));logger[_0x89be('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xab6a3a,_0x89be('0x25'),JSON[_0x89be('0x27')](_0x4a77ac));if(_0x4a77ac[_0x89be('0x28')]){if(_0x4a77ac[_0x89be('0x28')]['code']===0x1f4){logger[_0x89be('0x28')](_0x89be('0x24'),_0xab6a3a,_0x4a77ac[_0x89be('0x28')]['message']);return _0x4a8cd0(_0x4a77ac[_0x89be('0x28')]['message']);}logger['error'](_0x89be('0x24'),_0xab6a3a,_0x4a77ac[_0x89be('0x28')][_0x89be('0x29')]);return _0x40c801(_0x4a77ac[_0x89be('0x28')][_0x89be('0x29')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xab6a3a,_0x89be('0x25'));_0x40c801(_0x4a77ac[_0x89be('0x2a')][_0x89be('0x29')]);}})['catch'](function(_0x3d2ff6){logger[_0x89be('0x28')](_0x89be('0x24'),_0xab6a3a,_0x3d2ff6);_0x4a8cd0(_0x3d2ff6);});});}function respondWithStatusCode(_0x169673,_0x3c2ab4){_0x3c2ab4=_0x3c2ab4||0xcc;return function(_0x51298e){if(_0x51298e){return _0x169673[_0x89be('0x2b')](_0x3c2ab4);}return _0x169673[_0x89be('0x2c')](_0x3c2ab4)[_0x89be('0x2d')]();};}function respondWithResult(_0x4ca9d7,_0x140eb6){_0x140eb6=_0x140eb6||0xc8;return function(_0x56ba5a){if(_0x56ba5a){return _0x4ca9d7['status'](_0x140eb6)[_0x89be('0x2e')](_0x56ba5a);}};}function respondWithFilteredResult(_0x378fb5,_0xf7b209){return function(_0x1916dd){if(_0x1916dd){var _0x3be5bc=typeof _0xf7b209[_0x89be('0x2f')]===_0x89be('0x30')&&typeof _0xf7b209['limit']==='undefined';var _0x474a23=_0x1916dd['count'];var _0x45ed5f=_0x3be5bc?0x0:_0xf7b209[_0x89be('0x2f')];var _0x5a07fb=_0x3be5bc?_0x1916dd['count']:_0xf7b209['offset']+_0xf7b209[_0x89be('0x31')];var _0x5b889d;if(_0x5a07fb>=_0x474a23){_0x5a07fb=_0x474a23;_0x5b889d=0xc8;}else{_0x5b889d=0xce;}_0x378fb5['status'](_0x5b889d);return _0x378fb5[_0x89be('0x32')]('Content-Range',_0x45ed5f+'-'+_0x5a07fb+'/'+_0x474a23)[_0x89be('0x2e')](_0x1916dd);}return null;};}function patchUpdates(_0x5a503f){return function(_0x1aac1f){try{jsonpatch[_0x89be('0x33')](_0x1aac1f,_0x5a503f,!![]);}catch(_0x2306d8){return BPromise[_0x89be('0x34')](_0x2306d8);}return _0x1aac1f[_0x89be('0x35')]();};}function saveUpdates(_0x51de6d,_0x4f686f){return function(_0x49a2bb){if(_0x49a2bb){return _0x49a2bb[_0x89be('0x36')](_0x51de6d)[_0x89be('0x22')](function(_0x42efdf){return _0x42efdf;});}return null;};}function removeEntity(_0x9fc530,_0x51b91d){return function(_0x1419ff){if(_0x1419ff){return _0x1419ff[_0x89be('0x37')]()[_0x89be('0x22')](function(){_0x9fc530[_0x89be('0x2c')](0xcc)[_0x89be('0x2d')]();});}};}function handleEntityNotFound(_0x309e56,_0x2857fc){return function(_0x2d35cc){if(!_0x2d35cc){_0x309e56[_0x89be('0x2b')](0x194);}return _0x2d35cc;};}function handleError(_0x5257c3,_0x47ecd1){_0x47ecd1=_0x47ecd1||0x1f4;return function(_0x1d8791){logger[_0x89be('0x28')](_0x1d8791[_0x89be('0x38')]);if(_0x1d8791[_0x89be('0x39')]){delete _0x1d8791[_0x89be('0x39')];}_0x5257c3[_0x89be('0x2c')](_0x47ecd1)[_0x89be('0x3a')](_0x1d8791);};}exports[_0x89be('0x3b')]=function(_0x5a3baf,_0x2c96e2){var _0x5e760d={},_0x1977fc={},_0x3b27d2={'count':0x0,'rows':[]};var _0x4ae16d=_[_0x89be('0x3c')](db[_0x89be('0x3d')][_0x89be('0x3e')],function(_0x5668c2){return{'name':_0x5668c2[_0x89be('0x3f')],'type':_0x5668c2['type'][_0x89be('0x40')]};});_0x1977fc['model']=_[_0x89be('0x3c')](_0x4ae16d,'name');_0x1977fc[_0x89be('0x41')]=_[_0x89be('0x42')](_0x5a3baf['query']);_0x1977fc[_0x89be('0x43')]=_['intersection'](_0x1977fc['model'],_0x1977fc[_0x89be('0x41')]);_0x5e760d['attributes']=_[_0x89be('0x44')](_0x1977fc['model'],qs[_0x89be('0x45')](_0x5a3baf['query'][_0x89be('0x45')]));_0x5e760d['attributes']=_0x5e760d['attributes'][_0x89be('0x46')]?_0x5e760d[_0x89be('0x47')]:_0x1977fc[_0x89be('0x48')];if(!_0x5a3baf[_0x89be('0x41')]['hasOwnProperty'](_0x89be('0x49'))){_0x5e760d[_0x89be('0x31')]=qs[_0x89be('0x31')](_0x5a3baf[_0x89be('0x41')]['limit']);_0x5e760d[_0x89be('0x2f')]=qs[_0x89be('0x2f')](_0x5a3baf[_0x89be('0x41')]['offset']);}_0x5e760d[_0x89be('0x4a')]=qs[_0x89be('0x4b')](_0x5a3baf[_0x89be('0x41')][_0x89be('0x4b')]);_0x5e760d[_0x89be('0x4c')]=qs[_0x89be('0x43')](_[_0x89be('0x4d')](_0x5a3baf[_0x89be('0x41')],_0x1977fc[_0x89be('0x43')]),_0x4ae16d);if(_0x5a3baf[_0x89be('0x41')]['filter']){_0x5e760d['where']=_[_0x89be('0x4e')](_0x5e760d['where'],{'$or':_[_0x89be('0x3c')](_0x4ae16d,function(_0x2c07ed){if(_0x2c07ed[_0x89be('0x4f')]!==_0x89be('0x50')){var _0x21d56d={};_0x21d56d[_0x2c07ed['name']]={'$like':'%'+_0x5a3baf[_0x89be('0x41')][_0x89be('0x51')]+'%'};return _0x21d56d;}})});}_0x5e760d=_['merge']({},_0x5e760d,_0x5a3baf['options']);var _0x58968d={'where':_0x5e760d[_0x89be('0x4c')]};return db[_0x89be('0x3d')][_0x89be('0x52')](_0x58968d)['then'](function(_0x48a15a){_0x3b27d2[_0x89be('0x52')]=_0x48a15a;if(_0x5a3baf[_0x89be('0x41')]['includeAll']){_0x5e760d[_0x89be('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x89be('0x54')](_0x5e760d);})[_0x89be('0x22')](function(_0x8d2469){_0x3b27d2[_0x89be('0x55')]=_0x8d2469;return _0x3b27d2;})['then'](respondWithFilteredResult(_0x2c96e2,_0x5e760d))[_0x89be('0x56')](handleError(_0x2c96e2,null));};exports['show']=function(_0x69e136,_0x4e6485){var _0x3cd155={'raw':!![],'where':{'id':_0x69e136[_0x89be('0x57')]['id']}},_0x4d6cd7={};_0x4d6cd7[_0x89be('0x48')]=_[_0x89be('0x42')](db[_0x89be('0x3d')]['rawAttributes']);_0x4d6cd7[_0x89be('0x41')]=_[_0x89be('0x42')](_0x69e136[_0x89be('0x41')]);_0x4d6cd7[_0x89be('0x43')]=_[_0x89be('0x44')](_0x4d6cd7[_0x89be('0x48')],_0x4d6cd7[_0x89be('0x41')]);_0x3cd155[_0x89be('0x47')]=_[_0x89be('0x44')](_0x4d6cd7[_0x89be('0x48')],qs[_0x89be('0x45')](_0x69e136[_0x89be('0x41')][_0x89be('0x45')]));_0x3cd155['attributes']=_0x3cd155[_0x89be('0x47')][_0x89be('0x46')]?_0x3cd155[_0x89be('0x47')]:_0x4d6cd7[_0x89be('0x48')];if(_0x69e136[_0x89be('0x41')][_0x89be('0x58')]){_0x3cd155['include']=[{'all':!![]}];}_0x3cd155=_['merge']({},_0x3cd155,_0x69e136[_0x89be('0x59')]);return db[_0x89be('0x3d')][_0x89be('0x5a')](_0x3cd155)[_0x89be('0x22')](handleEntityNotFound(_0x4e6485,null))[_0x89be('0x22')](respondWithResult(_0x4e6485,null))[_0x89be('0x56')](handleError(_0x4e6485,null));};exports[_0x89be('0x5b')]=function(_0x410a3a,_0x339876){return db[_0x89be('0x3d')][_0x89be('0x5b')](_0x410a3a[_0x89be('0x5c')],{})[_0x89be('0x22')](respondWithResult(_0x339876,0xc9))[_0x89be('0x56')](handleError(_0x339876,null));};exports[_0x89be('0x36')]=function(_0x17367e,_0xe8c5c0){if(_0x17367e[_0x89be('0x5c')]['id']){delete _0x17367e[_0x89be('0x5c')]['id'];}return db[_0x89be('0x3d')]['find']({'where':{'id':_0x17367e[_0x89be('0x57')]['id']}})[_0x89be('0x22')](handleEntityNotFound(_0xe8c5c0,null))[_0x89be('0x22')](saveUpdates(_0x17367e[_0x89be('0x5c')],null))[_0x89be('0x22')](respondWithResult(_0xe8c5c0,null))[_0x89be('0x56')](handleError(_0xe8c5c0,null));};exports[_0x89be('0x37')]=function(_0x3f2b20,_0x3d5233){return db[_0x89be('0x3d')][_0x89be('0x5a')]({'where':{'id':_0x3f2b20[_0x89be('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d5233,null))[_0x89be('0x22')](removeEntity(_0x3d5233,null))[_0x89be('0x56')](handleError(_0x3d5233,null));};exports[_0x89be('0x5d')]=function(_0x4fec42,_0x1206ba){return db[_0x89be('0x3d')][_0x89be('0x5d')]()[_0x89be('0x22')](respondWithResult(_0x1206ba,null))[_0x89be('0x56')](handleError(_0x1206ba,null));};var interaction_log=require(_0x89be('0x14'))('openchannel-interactions');exports[_0x89be('0x5e')]=function(_0x3a2a90,_0x4f63a5,_0x49bbc5){var _0x2cbbca={'agent':{},'channel':_0x89be('0x5f')};if(_0x3a2a90[_0x89be('0x5c')]['id']){delete _0x3a2a90[_0x89be('0x5c')]['id'];}_0x3a2a90['body'][_0x89be('0x60')]=!![];_0x3a2a90['body'][_0x89be('0x61')]=moment()[_0x89be('0x62')](_0x89be('0x63'));_0x3a2a90[_0x89be('0x5c')][_0x89be('0x64')]=_0x3a2a90['body'][_0x89be('0x64')]||_0x3a2a90[_0x89be('0x65')]['id'];_0x2cbbca[_0x89be('0x66')]['id']=_0x3a2a90[_0x89be('0x5c')][_0x89be('0x64')];return db[_0x89be('0x3d')][_0x89be('0x5a')]({'where':{'id':_0x3a2a90['params']['id'],'UserId':null}})[_0x89be('0x22')](handleEntityNotFound(_0x4f63a5,null))[_0x89be('0x22')](saveUpdates(_0x3a2a90[_0x89be('0x5c')],null))['then'](function(_0x2a6c31){if(_0x2a6c31){_0x2cbbca[_0x89be('0x29')]=_0x2a6c31[_0x89be('0x67')]({'plain':!![]});return db[_0x89be('0x68')]['find']({'where':{'id':_0x2a6c31[_0x89be('0x69')]}});}return null;})[_0x89be('0x22')](handleEntityNotFound(_0x4f63a5,null))[_0x89be('0x22')](function(_0x55e414){if(_0x55e414){return _0x55e414['update']({'UserId':_0x3a2a90[_0x89be('0x5c')][_0x89be('0x64')],'read1stAt':_[_0x89be('0x6a')](_0x55e414[_0x89be('0x6b')])?moment()[_0x89be('0x62')](_0x89be('0x63')):undefined});}return null;})[_0x89be('0x22')](function(_0x311c25){if(_0x311c25){_0x2cbbca[_0x89be('0x6c')]=_0x311c25[_0x89be('0x67')]({'plain':!![]});interaction_log[_0x89be('0x23')](_0x89be('0x6d'),_0x3a2a90[_0x89be('0x65')]['id'],_0x3a2a90[_0x89be('0x65')][_0x89be('0x39')],_0x3a2a90[_0x89be('0x65')]['role'],_0x2cbbca[_0x89be('0x6c')]['id'],_0x3a2a90['body']?JSON[_0x89be('0x27')](_0x3a2a90[_0x89be('0x5c')]):_0x89be('0x6e'));return respondWithRpcPromise(_0x89be('0x6f'),'acceptMessage',_0x2cbbca);}return null;})[_0x89be('0x22')](function(_0x5a8bfd){var _0x4cfb29='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a8bfd[_0x89be('0x29')][_0x89be('0x70')];return db['sequelize'][_0x89be('0x41')](_0x4cfb29,{'type':db[_0x89be('0x71')][_0x89be('0x72')][_0x89be('0x73')],'raw':!![]})['then'](function(_0x350b47){return _0x350b47;});})['then'](function(_0x4ac74e){if(_0x4ac74e){_0x2cbbca[_0x89be('0x29')][_0x89be('0x74')]=_0x4ac74e[0x0];if(!_0x3a2a90[_0x89be('0x5c')]['UserId'])return;return db[_0x89be('0x75')][_0x89be('0x5a')]({'where':{'id':_0x3a2a90['body'][_0x89be('0x64')],'role':'agent'},'attributes':['id',_0x89be('0x39'),_0x89be('0x76'),_0x89be('0x77'),_0x89be('0x78')],'raw':!![]});}return null;})['then'](function(_0x3d3d5c){if(!_0x3d3d5c)return null;_0x2cbbca['message'][_0x89be('0x66')]=_0x3d3d5c;return _0x2cbbca;})[_0x89be('0x22')](function(_0x57a684){if(_0x57a684){if(_0x3a2a90['body'][_0x89be('0x79')]){_0x2cbbca[_0x89be('0x29')]['interface']=util[_0x89be('0x62')]('SIP/%s',_0x3a2a90[_0x89be('0x65')]['name']);_0x2cbbca[_0x89be('0x29')][_0x89be('0x7a')]=_0x2cbbca['channel'];_0x2cbbca['message'][_0x89be('0x7b')]=_0x89be('0x5e');return respondWithRpcPromise(_0x89be('0x7c'),'EventManager',{'event':_0x89be('0x7d'),'message':_0x2cbbca['message']},client9002)[_0x89be('0x22')](function(){return _0x2cbbca;});}return _0x2cbbca;}return null;})['then'](respondWithResult(_0x4f63a5,null))[_0x89be('0x56')](handleError(_0x4f63a5,null));};var interaction_log=require(_0x89be('0x14'))(_0x89be('0x7e'));exports[_0x89be('0x34')]=function(_0x52c901,_0x145b1a,_0x403464){var _0x34996d={'agent':{},'channel':_0x89be('0x5f')};if(_0x52c901[_0x89be('0x5c')]['id']){delete _0x52c901['body']['id'];}_0x52c901['body'][_0x89be('0x64')]=_0x52c901[_0x89be('0x5c')][_0x89be('0x64')]||_0x52c901['user']['id'];_0x34996d[_0x89be('0x66')]['id']=_0x52c901[_0x89be('0x5c')][_0x89be('0x64')];return db[_0x89be('0x3d')][_0x89be('0x5a')]({'where':{'id':_0x52c901[_0x89be('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x145b1a,null))[_0x89be('0x22')](function(_0x372208){if(_0x372208){_0x34996d[_0x89be('0x29')]=_0x372208['get']({'plain':!![]});return db[_0x89be('0x68')][_0x89be('0x5a')]({'where':{'id':_0x372208['OpenchannelInteractionId']}});}return null;})[_0x89be('0x22')](handleEntityNotFound(_0x145b1a,null))['then'](function(_0x4eb530){if(_0x4eb530){_0x34996d[_0x89be('0x6c')]=_0x4eb530['get']({'plain':!![]});interaction_log[_0x89be('0x23')](_0x89be('0x7f'),_0x52c901[_0x89be('0x65')]['id'],_0x52c901[_0x89be('0x65')][_0x89be('0x39')],_0x52c901[_0x89be('0x65')][_0x89be('0x80')],_0x34996d[_0x89be('0x6c')]['id'],_0x52c901[_0x89be('0x5c')]?JSON['stringify'](_0x52c901[_0x89be('0x5c')]):_0x89be('0x6e'));return respondWithRpcPromise('RejectMessage',_0x89be('0x81'),_0x34996d);}return null;})[_0x89be('0x22')](function(_0x2ef74c){var _0x3c8b5c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ef74c[_0x89be('0x29')][_0x89be('0x70')];return db[_0x89be('0x82')][_0x89be('0x41')](_0x3c8b5c,{'type':db['Sequelize']['QueryTypes'][_0x89be('0x73')],'raw':!![]})[_0x89be('0x22')](function(_0x538812){return _0x538812;});})[_0x89be('0x22')](function(_0x530ebb){if(_0x530ebb){_0x34996d[_0x89be('0x29')]['contact']=_0x530ebb[0x0];if(!_0x52c901['body'][_0x89be('0x64')])return;return db[_0x89be('0x75')]['find']({'where':{'id':_0x52c901[_0x89be('0x5c')]['UserId'],'role':'agent'},'attributes':['id',_0x89be('0x39'),_0x89be('0x76'),_0x89be('0x77'),_0x89be('0x78')],'raw':!![]});}return null;})[_0x89be('0x22')](function(_0x3d2cf7){if(!_0x3d2cf7)return null;_0x34996d[_0x89be('0x29')]['agent']=_0x3d2cf7;return _0x34996d;})[_0x89be('0x22')](function(_0x432737){if(_0x432737){_0x432737[_0x89be('0x29')]['interface']=util[_0x89be('0x62')](_0x89be('0x83'),_0x52c901[_0x89be('0x65')][_0x89be('0x39')]);_0x432737[_0x89be('0x29')][_0x89be('0x7a')]=_0x34996d[_0x89be('0x7a')];_0x432737[_0x89be('0x29')][_0x89be('0x7b')]=_0x89be('0x34');respondWithRpcPromise(_0x89be('0x7c'),_0x89be('0x7c'),{'event':'rejectmessage','message':_0x432737[_0x89be('0x29')]},client9002);return _0x34996d;}return null;})[_0x89be('0x22')](respondWithResult(_0x145b1a,null))[_0x89be('0x56')](handleError(_0x145b1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fefcf0d..85776e8 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 _0x7c3c=['save','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7c3c,0x9f));var _0xc7c3=function(_0x3702ba,_0x460951){_0x3702ba=_0x3702ba-0x0;var _0x115695=_0x7c3c[_0x3702ba];return _0x115695;};'use strict';var EventEmitter=require(_0xc7c3('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xc7c3('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc7c3('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a32b5){return function(_0x4bf415,_0x601931,_0x31dfc3){OpenchannelMessageEvents[_0xc7c3('0x3')](_0x5a32b5+':'+_0x4bf415['id'],_0x4bf415);OpenchannelMessageEvents[_0xc7c3('0x3')](_0x5a32b5,_0x4bf415);_0x31dfc3(null);};}for(var e in events){if(events[_0xc7c3('0x4')](e)){var event=events[e];OpenchannelMessage[_0xc7c3('0x5')](e,emitEvent(event));}}module[_0xc7c3('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8ebb=['OpenchannelMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b740c,_0x1911a5){var _0x510f5c=function(_0x344547){while(--_0x344547){_0x4b740c['push'](_0x4b740c['shift']());}};_0x510f5c(++_0x1911a5);}(_0x8ebb,0x6a));var _0xb8eb=function(_0x2958e7,_0x1b39c5){_0x2958e7=_0x2958e7-0x0;var _0x39b2e8=_0x8ebb[_0x2958e7];return _0x39b2e8;};'use strict';var EventEmitter=require(_0xb8eb('0x0'));var OpenchannelMessage=require(_0xb8eb('0x1'))['db'][_0xb8eb('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8eb('0x3'),'afterUpdate':_0xb8eb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2dfa4d){return function(_0x56203a,_0x589e53,_0x5f44ac){OpenchannelMessageEvents[_0xb8eb('0x5')](_0x2dfa4d+':'+_0x56203a['id'],_0x56203a);OpenchannelMessageEvents[_0xb8eb('0x5')](_0x2dfa4d,_0x56203a);_0x5f44ac(null);};}for(var e in events){if(events[_0xb8eb('0x6')](e)){var event=events[e];OpenchannelMessage[_0xb8eb('0x7')](e,emitEvent(event));}}module[_0xb8eb('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 3bcd7b5..ec35a87 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 _0x5c00=['afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','POST','GET','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','OpenchannelInteraction','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','models','toLowerCase','out','secret','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','direction','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get'];(function(_0x860b76,_0x13e129){var _0x4d9cb1=function(_0xf6e8cf){while(--_0xf6e8cf){_0x860b76['push'](_0x860b76['shift']());}};_0x4d9cb1(++_0x13e129);}(_0x5c00,0x17e));var _0x05c0=function(_0x4504e7,_0x2ae46f){_0x4504e7=_0x4504e7-0x0;var _0x98c486=_0x5c00[_0x4504e7];return _0x98c486;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var fs=require('fs');var path=require(_0x05c0('0x5'));var rimraf=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x05c0('0x8')]=function(_0x3521fe,_0x261624){return _0x3521fe[_0x05c0('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x05c0('0xa'),'paranoid':![],'indexes':[{'name':_0x05c0('0xb'),'fields':[_0x05c0('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32a795,_0x32cdfa,_0x996d6b){var _0x321c09=_0x3521fe[_0x05c0('0xd')];var _0x1edbb=_0x32a795['get']({'plain':!![]});if(_0x1edbb['direction'][_0x05c0('0xe')]()==='in'||_0x1edbb['direction'][_0x05c0('0xe')]()===_0x05c0('0xf')&&!_0x1edbb[_0x05c0('0x10')]&&!_['isNil'](_0x1edbb[_0x05c0('0x11')])){_0x321c09['OpenchannelInteraction'][_0x05c0('0x12')]({'where':{'id':_0x1edbb[_0x05c0('0x13')]}})[_0x05c0('0x14')](function(_0x12deeb){if(_0x12deeb){_0x12deeb[_0x05c0('0x15')]({'lastMsgAt':_0x1edbb[_0x05c0('0x16')],'lastMsgDirection':_0x1edbb[_0x05c0('0x17')][_0x05c0('0xe')]()});}})['catch'](function(_0x238e25){console[_0x05c0('0x18')](_0x238e25);});}if(_0x1edbb[_0x05c0('0x17')]===_0x05c0('0xf')&&!_0x1edbb[_0x05c0('0x10')]){var _0x40153e;_0x321c09[_0x05c0('0x19')][_0x05c0('0x1a')]()[_0x05c0('0x14')](function(_0x521cbd){return _0x321c09[_0x05c0('0x1b')][_0x05c0('0x1c')]({'where':{'id':_0x1edbb[_0x05c0('0x1d')]},'include':[{'model':_0x321c09['OpenchannelInteraction'],'as':_0x05c0('0x1e'),'where':{'id':_0x1edbb[_0x05c0('0x13')]},'limit':0x1,'include':[{'model':_0x321c09[_0x05c0('0x19')],'as':_0x05c0('0x1f'),'attributes':_[_0x05c0('0x20')](_0x521cbd)}]}]});})['then'](function(_0x407c1f){_0x40153e=_0x407c1f[_0x05c0('0x21')]({'plain':!![]});if(_0x40153e&&_0x40153e['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x05c0('0x22'),util[_0x05c0('0x23')](_0x05c0('0x24'),_0x1edbb['id'],_0x40153e[_0x05c0('0x25')]));if(_0x40153e[_0x05c0('0x1e')]&&_0x40153e[_0x05c0('0x1e')][_0x05c0('0x26')]){_0x1edbb['Interaction']=_[_0x05c0('0x27')](_0x40153e[_0x05c0('0x1e')][0x0],'Contact');_0x1edbb['Contact']=_0x40153e['Interactions'][0x0]['Contact'];}var _0x32cdfa={'method':_0x05c0('0x28'),'uri':encodeURI(_0x40153e[_0x05c0('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32cdfa['method']){case _0x05c0('0x29'):_0x32cdfa['qs']=_0x1edbb;break;case _0x05c0('0x28'):_0x32cdfa[_0x05c0('0xc')]=_0x1edbb;break;}return rp(_0x32cdfa)[_0x05c0('0x14')](function(_0x58769a){logger[_0x05c0('0x2a')](_0x05c0('0x2b'),_0x05c0('0x22'),util[_0x05c0('0x23')](_0x05c0('0x2c'),_0x1edbb['id'],_0x40153e[_0x05c0('0x25')]));if(_0x58769a['body']['threadId']&&_0x58769a[_0x05c0('0xc')][_0x05c0('0x2d')]!=_0x1edbb[_0x05c0('0x2e')][_0x05c0('0x2d')]){return _0x321c09[_0x05c0('0x2f')][_0x05c0('0x15')]({'threadId':_0x58769a[_0x05c0('0xc')][_0x05c0('0x2d')]},{'logging':!![],'where':{'id':_0x1edbb[_0x05c0('0x2e')]['id']}});}else{return;}})[_0x05c0('0x14')](function(){return _0x32a795[_0x05c0('0x15')]({'read':!![]});})[_0x05c0('0x30')](function(_0x50f03d){logger['error'](_0x05c0('0x2b'),_0x05c0('0x22'),util[_0x05c0('0x31')](_0x50f03d,{'showHidden':![],'depth':null}));_0x996d6b();});}else{_0x996d6b();}})['finally'](function(){_0x996d6b();});}else{_0x996d6b();}}},'charset':_0x05c0('0x32'),'collate':_0x05c0('0x33')});}; \ No newline at end of file +var _0xdd4f=['OpenchannelMessage','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','body','OpenchannelMessage,\x20%s,\x20%s','threadId','update','inspect','utf8mb4_unicode_ci','lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x30108c,_0x269861){_0x30108c=_0x30108c-0x0;var _0x322e2f=_0xdd4f[_0x30108c];return _0x322e2f;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xfdd4('0x9'),'fields':['body'],'type':_0xfdd4('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25470a,_0x1e823e,_0x4ee02f){var _0x3d06c9=_0x43cbcf['models'];var _0x27a9f3=_0x25470a[_0xfdd4('0xb')]({'plain':!![]});if(_0x27a9f3[_0xfdd4('0xc')][_0xfdd4('0xd')]()==='in'||_0x27a9f3[_0xfdd4('0xc')][_0xfdd4('0xd')]()===_0xfdd4('0xe')&&!_0x27a9f3[_0xfdd4('0xf')]&&!_[_0xfdd4('0x10')](_0x27a9f3[_0xfdd4('0x11')])){_0x3d06c9[_0xfdd4('0x12')]['findOne']({'where':{'id':_0x27a9f3[_0xfdd4('0x13')]}})[_0xfdd4('0x14')](function(_0x227099){if(_0x227099){_0x227099['update']({'lastMsgAt':_0x27a9f3[_0xfdd4('0x15')],'lastMsgDirection':_0x27a9f3['direction'][_0xfdd4('0xd')]()});}})[_0xfdd4('0x16')](function(_0x2f34ec){console[_0xfdd4('0x17')](_0x2f34ec);});}if(_0x27a9f3[_0xfdd4('0xc')]==='out'&&!_0x27a9f3['secret']){var _0x559c77;_0x3d06c9[_0xfdd4('0x18')][_0xfdd4('0x19')]()[_0xfdd4('0x14')](function(_0x2ccc88){return _0x3d06c9[_0xfdd4('0x1a')][_0xfdd4('0x1b')]({'where':{'id':_0x27a9f3[_0xfdd4('0x1c')]},'include':[{'model':_0x3d06c9[_0xfdd4('0x12')],'as':_0xfdd4('0x1d'),'where':{'id':_0x27a9f3['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3d06c9[_0xfdd4('0x18')],'as':_0xfdd4('0x1e'),'attributes':_[_0xfdd4('0x1f')](_0x2ccc88)}]}]});})[_0xfdd4('0x14')](function(_0x1454f1){_0x559c77=_0x1454f1[_0xfdd4('0xb')]({'plain':!![]});if(_0x559c77&&_0x559c77[_0xfdd4('0x20')]){logger[_0xfdd4('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xfdd4('0x22'),util[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x27a9f3['id'],_0x559c77[_0xfdd4('0x20')]));if(_0x559c77[_0xfdd4('0x1d')]&&_0x559c77[_0xfdd4('0x1d')][_0xfdd4('0x25')]){_0x27a9f3[_0xfdd4('0x26')]=_['omit'](_0x559c77[_0xfdd4('0x1d')][0x0],_0xfdd4('0x1e'));_0x27a9f3[_0xfdd4('0x1e')]=_0x559c77['Interactions'][0x0][_0xfdd4('0x1e')];}var _0x1e823e={'method':_0xfdd4('0x27'),'uri':encodeURI(_0x559c77[_0xfdd4('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1e823e[_0xfdd4('0x28')]){case'GET':_0x1e823e['qs']=_0x27a9f3;break;case _0xfdd4('0x27'):_0x1e823e[_0xfdd4('0x29')]=_0x27a9f3;break;}return rp(_0x1e823e)[_0xfdd4('0x14')](function(_0x31e053){logger[_0xfdd4('0x21')](_0xfdd4('0x2a'),_0xfdd4('0x22'),util[_0xfdd4('0x23')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x27a9f3['id'],_0x559c77[_0xfdd4('0x20')]));if(_0x31e053[_0xfdd4('0x29')][_0xfdd4('0x2b')]&&_0x31e053[_0xfdd4('0x29')][_0xfdd4('0x2b')]!=_0x27a9f3['Interaction'][_0xfdd4('0x2b')]){return _0x3d06c9[_0xfdd4('0x12')][_0xfdd4('0x2c')]({'threadId':_0x31e053[_0xfdd4('0x29')][_0xfdd4('0x2b')]},{'logging':!![],'where':{'id':_0x27a9f3['Interaction']['id']}});}else{return;}})[_0xfdd4('0x14')](function(){return _0x25470a[_0xfdd4('0x2c')]({'read':!![]});})[_0xfdd4('0x16')](function(_0x5ba4e8){logger[_0xfdd4('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xfdd4('0x22'),util[_0xfdd4('0x2d')](_0x5ba4e8,{'showHidden':![],'depth':null}));_0x4ee02f();});}else{_0x4ee02f();}})['finally'](function(){_0x4ee02f();});}else{_0x4ee02f();}}},'charset':'utf8mb4','collate':_0xfdd4('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 64ba90b..ed338ff 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x2f921e,_0x382966){var _0xe1bbee=function(_0x1f0e14){while(--_0x1f0e14){_0x2f921e['push'](_0x2f921e['shift']());}};_0xe1bbee(++_0x382966);}(_0x0b0e,0x187));var _0xe0b0=function(_0x52dfa9,_0x306d3f){_0x52dfa9=_0x52dfa9-0x0;var _0xdfaa57=_0x0b0e[_0x52dfa9];return _0xdfaa57;};'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});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4f5b24,_0x58e8a4){var _0x1b3307=function(_0x5a41e9){while(--_0x5a41e9){_0x4f5b24['push'](_0x4f5b24['shift']());}};_0x1b3307(++_0x58e8a4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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')]('OpenchannelMessage,\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')]('OpenchannelMessage,\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')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=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']('CreateOpenchannelMessage',_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/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 39de7cd..07ad599 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 _0xf603=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xf603,0x124));var _0x3f60=function(_0x32281f,_0x2ac013){_0x32281f=_0x32281f-0x0;var _0x4434fd=_0xf603[_0x32281f];return _0x4434fd;};'use strict';var OpenchannelMessageEvents=require(_0x3f60('0x0'));var events=[_0x3f60('0x1'),'remove',_0x3f60('0x2')];function createListener(_0x23c3fb,_0x2f1d81){return function(_0x1b68aa){_0x2f1d81[_0x3f60('0x3')](_0x23c3fb,_0x1b68aa);};}function removeListener(_0x1403db,_0x21a566){return function(){OpenchannelMessageEvents[_0x3f60('0x4')](_0x1403db,_0x21a566);};}exports[_0x3f60('0x5')]=function(_0x49d1e0){for(var _0x59bc82=0x0,_0x49a08c=events[_0x3f60('0x6')];_0x59bc82<_0x49a08c;_0x59bc82++){var _0x43ec55=events[_0x59bc82];var _0x75bb34=createListener(_0x3f60('0x7')+_0x43ec55,_0x49d1e0);OpenchannelMessageEvents['on'](_0x43ec55,_0x75bb34);}}; \ No newline at end of file +var _0x0699=['length','./openchannelMessage.events','save','remove','update','removeListener'];(function(_0x53cfed,_0x4c5086){var _0x4b39b0=function(_0x3021a2){while(--_0x3021a2){_0x53cfed['push'](_0x53cfed['shift']());}};_0x4b39b0(++_0x4c5086);}(_0x0699,0x181));var _0x9069=function(_0x518b3f,_0x3ce5e8){_0x518b3f=_0x518b3f-0x0;var _0x4776df=_0x0699[_0x518b3f];return _0x4776df;};'use strict';var OpenchannelMessageEvents=require(_0x9069('0x0'));var events=[_0x9069('0x1'),_0x9069('0x2'),_0x9069('0x3')];function createListener(_0x5dd7ef,_0x31d7d6){return function(_0x3ff490){_0x31d7d6['emit'](_0x5dd7ef,_0x3ff490);};}function removeListener(_0x6dcc78,_0x8a001f){return function(){OpenchannelMessageEvents[_0x9069('0x4')](_0x6dcc78,_0x8a001f);};}exports['register']=function(_0x5da1c9){for(var _0x854611=0x0,_0x19152e=events[_0x9069('0x5')];_0x854611<_0x19152e;_0x854611++){var _0x44a634=events[_0x854611];var _0x2db100=createListener('openchannelMessage:'+_0x44a634,_0x5da1c9);OpenchannelMessageEvents['on'](_0x44a634,_0x2db100);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 81f7c14..88f8b10 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 _0x3c7b=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','removeTeams','delete','removeAgents','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','getMembers'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3c7b,0x112));var _0xb3c7=function(_0xf61948,_0x329bc9){_0xf61948=_0xf61948-0x0;var _0x1aa119=_0x3c7b[_0xf61948];return _0x1aa119;};'use strict';var multer=require('multer');var util=require(_0xb3c7('0x0'));var path=require('path');var timeout=require(_0xb3c7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb3c7('0x2'));var interaction=require(_0xb3c7('0x3'));var config=require(_0xb3c7('0x4'));var controller=require(_0xb3c7('0x5'));router[_0xb3c7('0x6')]('/',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x8')]);router[_0xb3c7('0x6')]('/describe',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x9')]);router['get'](_0xb3c7('0xa'),auth[_0xb3c7('0x7')](),controller['show']);router[_0xb3c7('0x6')]('/:id/members',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xb')]);router[_0xb3c7('0x6')](_0xb3c7('0xc'),auth['isAuthenticated'](),controller[_0xb3c7('0xd')]);router[_0xb3c7('0x6')](_0xb3c7('0xe'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xf')]);router[_0xb3c7('0x10')]('/',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x11')]);router['post']('/:id/teams',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x12')]);router[_0xb3c7('0x10')](_0xb3c7('0xe'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x13')]);router['put'](_0xb3c7('0xa'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x14')]);router['delete']('/:id',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x15')]);router['delete'](_0xb3c7('0xc'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x16')]);router[_0xb3c7('0x17')](_0xb3c7('0xe'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0x18')]);module[_0xb3c7('0x19')]=router; \ No newline at end of file +var _0x28af=['delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28af,0x14f));var _0xf28a=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x28af[_0x401676];return _0x4f13fe;};'use strict';var multer=require(_0xf28a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf28a('0x1'));var express=require(_0xf28a('0x2'));var router=express[_0xf28a('0x3')]();var fs_extra=require(_0xf28a('0x4'));var auth=require(_0xf28a('0x5'));var interaction=require(_0xf28a('0x6'));var config=require(_0xf28a('0x7'));var controller=require(_0xf28a('0x8'));router[_0xf28a('0x9')]('/',auth[_0xf28a('0xa')](),controller[_0xf28a('0xb')]);router[_0xf28a('0x9')]('/describe',auth[_0xf28a('0xa')](),controller[_0xf28a('0xc')]);router['get']('/:id',auth[_0xf28a('0xa')](),controller['show']);router['get'](_0xf28a('0xd'),auth['isAuthenticated'](),controller[_0xf28a('0xe')]);router['get']('/:id/teams',auth[_0xf28a('0xa')](),controller[_0xf28a('0xf')]);router[_0xf28a('0x9')](_0xf28a('0x10'),auth[_0xf28a('0xa')](),controller[_0xf28a('0x11')]);router['post']('/',auth[_0xf28a('0xa')](),controller[_0xf28a('0x12')]);router[_0xf28a('0x13')](_0xf28a('0x14'),auth[_0xf28a('0xa')](),controller[_0xf28a('0x15')]);router[_0xf28a('0x13')](_0xf28a('0x10'),auth['isAuthenticated'](),controller[_0xf28a('0x16')]);router[_0xf28a('0x17')](_0xf28a('0x18'),auth[_0xf28a('0xa')](),controller['update']);router[_0xf28a('0x19')](_0xf28a('0x18'),auth[_0xf28a('0xa')](),controller[_0xf28a('0x1a')]);router[_0xf28a('0x19')](_0xf28a('0x14'),auth[_0xf28a('0xa')](),controller[_0xf28a('0x1b')]);router['delete'](_0xf28a('0x10'),auth[_0xf28a('0xa')](),controller[_0xf28a('0x1c')]);module[_0xf28a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 26f87bc..cc92610 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 _0xf652=['beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x2e076c,_0x1db3c4){var _0x2bd579=function(_0x33ab63){while(--_0x33ab63){_0x2e076c['push'](_0x2e076c['shift']());}};_0x2bd579(++_0x1db3c4);}(_0xf652,0x12a));var _0x2f65=function(_0xd3900c,_0x290f0d){_0xd3900c=_0xd3900c-0x0;var _0x25f6f9=_0xf652[_0xd3900c];return _0x25f6f9;};'use strict';var Sequelize=require(_0x2f65('0x0'));module[_0x2f65('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f65('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2f65('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f65('0x4')](_0x2f65('0x5'),_0x2f65('0x6'),_0x2f65('0x7'))}}; \ No newline at end of file +var _0x5212=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4d5705,_0x18e3e6){var _0x20fd7c=function(_0x42d997){while(--_0x42d997){_0x4d5705['push'](_0x4d5705['shift']());}};_0x20fd7c(++_0x18e3e6);}(_0x5212,0x10a));var _0x2521=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x5212[_0x59befa];return _0x1dd63d;};'use strict';var Sequelize=require(_0x2521('0x0'));module[_0x2521('0x1')]={'name':{'type':Sequelize[_0x2521('0x2')],'unique':_0x2521('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2521('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2521('0x5')]('rrmemory',_0x2521('0x6'),_0x2521('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 675d2b6..7fef441 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 _0x1ae5=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','OpenchannelQueues','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','user','role','UserProfileSection','autoAssociation','body','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','openchannelPause','updatedAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','Agents','online','voicePause','interface','sequelize','addTeams','each','forEach','emit','userOpenchannelQueue:save','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','includes','all','value','transaction','ids','isEmpty','removeAgents','addAgents','omit','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x4aab9e,_0x172a37){var _0x42f016=function(_0x4f6dcd){while(--_0x4f6dcd){_0x4aab9e['push'](_0x4aab9e['shift']());}};_0x42f016(++_0x172a37);}(_0x1ae5,0x18d));var _0x51ae=function(_0x1ae375,_0x25626e){_0x1ae375=_0x1ae375-0x0;var _0x51c6b4=_0x1ae5[_0x1ae375];return _0x51c6b4;};'use strict';var emlformat=require(_0x51ae('0x0'));var rimraf=require(_0x51ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51ae('0x2'));var rp=require(_0x51ae('0x3'));var moment=require(_0x51ae('0x4'));var BPromise=require(_0x51ae('0x5'));var Mustache=require(_0x51ae('0x6'));var util=require('util');var path=require(_0x51ae('0x7'));var sox=require('sox');var csv=require(_0x51ae('0x8'));var ejs=require(_0x51ae('0x9'));var fs=require('fs');var fs_extra=require(_0x51ae('0xa'));var _=require(_0x51ae('0xb'));var squel=require(_0x51ae('0xc'));var crypto=require(_0x51ae('0xd'));var jsforce=require(_0x51ae('0xe'));var deskjs=require(_0x51ae('0xf'));var toCsv=require(_0x51ae('0x8'));var querystring=require(_0x51ae('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51ae('0x11'));var qs=require(_0x51ae('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51ae('0x13'));var logger=require(_0x51ae('0x14'))(_0x51ae('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51ae('0x16'));var db=require('../../mysqldb')['db'];config[_0x51ae('0x17')]=_[_0x51ae('0x18')](config['redis'],{'host':_0x51ae('0x19'),'port':0x18eb});var socket=require(_0x51ae('0x1a'))(new Redis(config[_0x51ae('0x17')]));require(_0x51ae('0x1b'))['register'](socket);function respondWithStatusCode(_0x489cda,_0x516488){_0x516488=_0x516488||0xcc;return function(_0x324daa){if(_0x324daa){return _0x489cda[_0x51ae('0x1c')](_0x516488);}return _0x489cda[_0x51ae('0x1d')](_0x516488)[_0x51ae('0x1e')]();};}function respondWithResult(_0x47f679,_0x4f5efb){_0x4f5efb=_0x4f5efb||0xc8;return function(_0x14c10c){if(_0x14c10c){return _0x47f679[_0x51ae('0x1d')](_0x4f5efb)[_0x51ae('0x1f')](_0x14c10c);}};}function respondWithFilteredResult(_0x1377ef,_0x3b6f37){return function(_0x3bc2b1){if(_0x3bc2b1){var _0x459ac9=typeof _0x3b6f37[_0x51ae('0x20')]===_0x51ae('0x21')&&typeof _0x3b6f37[_0x51ae('0x22')]===_0x51ae('0x21');var _0xa1f25=_0x3bc2b1[_0x51ae('0x23')];var _0x4102b3=_0x459ac9?0x0:_0x3b6f37[_0x51ae('0x20')];var _0x34587e=_0x459ac9?_0x3bc2b1[_0x51ae('0x23')]:_0x3b6f37[_0x51ae('0x20')]+_0x3b6f37[_0x51ae('0x22')];var _0x1bffa9;if(_0x34587e>=_0xa1f25){_0x34587e=_0xa1f25;_0x1bffa9=0xc8;}else{_0x1bffa9=0xce;}_0x1377ef[_0x51ae('0x1d')](_0x1bffa9);return _0x1377ef[_0x51ae('0x24')](_0x51ae('0x25'),_0x4102b3+'-'+_0x34587e+'/'+_0xa1f25)[_0x51ae('0x1f')](_0x3bc2b1);}return null;};}function patchUpdates(_0x11924c){return function(_0x4b7403){try{jsonpatch[_0x51ae('0x26')](_0x4b7403,_0x11924c,!![]);}catch(_0x4bb060){return BPromise[_0x51ae('0x27')](_0x4bb060);}return _0x4b7403[_0x51ae('0x28')]();};}function saveUpdates(_0x24cda5,_0x141f72){return function(_0x4f6f7f){if(_0x4f6f7f){return _0x4f6f7f[_0x51ae('0x29')](_0x24cda5)[_0x51ae('0x2a')](function(_0x379e4b){return _0x379e4b;});}return null;};}function removeEntity(_0x4248be,_0x5e8ad4){return function(_0x1a071c){if(_0x1a071c){return _0x1a071c['destroy']()['then'](function(){var _0x43bf5d=_0x1a071c[_0x51ae('0x2b')]({'plain':!![]});var _0x344320=_0x51ae('0x2c');return db['UserProfileResource'][_0x51ae('0x2d')]({'where':{'type':_0x344320,'resourceId':_0x43bf5d['id']}})[_0x51ae('0x2a')](function(){return _0x1a071c;});})['then'](function(){_0x4248be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ae9d,_0x5d3d93){return function(_0x30e774){if(!_0x30e774){_0x16ae9d[_0x51ae('0x1c')](0x194);}return _0x30e774;};}function handleError(_0x3ca525,_0x33a067){_0x33a067=_0x33a067||0x1f4;return function(_0x598de4){logger[_0x51ae('0x2e')](_0x598de4[_0x51ae('0x2f')]);if(_0x598de4['name']){delete _0x598de4[_0x51ae('0x30')];}_0x3ca525[_0x51ae('0x1d')](_0x33a067)[_0x51ae('0x31')](_0x598de4);};}exports[_0x51ae('0x32')]=function(_0x1d47fb,_0x18c795){var _0x17b69b={},_0x5285a4={},_0x3b63e8={'count':0x0,'rows':[]};var _0x1f72b5=_[_0x51ae('0x33')](db[_0x51ae('0x34')][_0x51ae('0x35')],function(_0xd0be8d){return{'name':_0xd0be8d['fieldName'],'type':_0xd0be8d[_0x51ae('0x36')][_0x51ae('0x37')]};});_0x5285a4['model']=_[_0x51ae('0x33')](_0x1f72b5,_0x51ae('0x30'));_0x5285a4[_0x51ae('0x38')]=_['keys'](_0x1d47fb[_0x51ae('0x38')]);_0x5285a4[_0x51ae('0x39')]=_[_0x51ae('0x3a')](_0x5285a4[_0x51ae('0x3b')],_0x5285a4['query']);_0x17b69b[_0x51ae('0x3c')]=_[_0x51ae('0x3a')](_0x5285a4['model'],qs[_0x51ae('0x3d')](_0x1d47fb[_0x51ae('0x38')]['fields']));_0x17b69b[_0x51ae('0x3c')]=_0x17b69b[_0x51ae('0x3c')][_0x51ae('0x3e')]?_0x17b69b[_0x51ae('0x3c')]:_0x5285a4[_0x51ae('0x3b')];if(!_0x1d47fb[_0x51ae('0x38')][_0x51ae('0x3f')](_0x51ae('0x40'))){_0x17b69b[_0x51ae('0x22')]=qs[_0x51ae('0x22')](_0x1d47fb[_0x51ae('0x38')]['limit']);_0x17b69b['offset']=qs[_0x51ae('0x20')](_0x1d47fb[_0x51ae('0x38')]['offset']);}_0x17b69b[_0x51ae('0x41')]=qs[_0x51ae('0x42')](_0x1d47fb[_0x51ae('0x38')][_0x51ae('0x42')]);_0x17b69b[_0x51ae('0x43')]=qs['filters'](_[_0x51ae('0x44')](_0x1d47fb[_0x51ae('0x38')],_0x5285a4[_0x51ae('0x39')]),_0x1f72b5);if(_0x1d47fb[_0x51ae('0x38')][_0x51ae('0x45')]){_0x17b69b[_0x51ae('0x43')]=_[_0x51ae('0x46')](_0x17b69b[_0x51ae('0x43')],{'$or':_['map'](_0x1f72b5,function(_0x31ab97){if(_0x31ab97[_0x51ae('0x36')]!==_0x51ae('0x47')){var _0x27c05a={};_0x27c05a[_0x31ab97[_0x51ae('0x30')]]={'$like':'%'+_0x1d47fb[_0x51ae('0x38')]['filter']+'%'};return _0x27c05a;}})});}_0x17b69b=_[_0x51ae('0x46')]({},_0x17b69b,_0x1d47fb[_0x51ae('0x48')]);var _0x4916c3={'where':_0x17b69b['where']};return db[_0x51ae('0x34')]['count'](_0x4916c3)[_0x51ae('0x2a')](function(_0xe690a){_0x3b63e8[_0x51ae('0x23')]=_0xe690a;if(_0x1d47fb[_0x51ae('0x38')][_0x51ae('0x49')]){_0x17b69b[_0x51ae('0x4a')]=[{'all':!![]}];}return db[_0x51ae('0x34')][_0x51ae('0x4b')](_0x17b69b);})[_0x51ae('0x2a')](function(_0x1a7167){_0x3b63e8['rows']=_0x1a7167;return _0x3b63e8;})[_0x51ae('0x2a')](respondWithFilteredResult(_0x18c795,_0x17b69b))[_0x51ae('0x4c')](handleError(_0x18c795,null));};exports[_0x51ae('0x4d')]=function(_0x3d73ff,_0x2fed1b){var _0x528fd7={'raw':!![],'where':{'id':_0x3d73ff[_0x51ae('0x4e')]['id']}},_0x400a69={};_0x400a69[_0x51ae('0x3b')]=_[_0x51ae('0x4f')](db[_0x51ae('0x34')][_0x51ae('0x35')]);_0x400a69['query']=_[_0x51ae('0x4f')](_0x3d73ff['query']);_0x400a69['filters']=_[_0x51ae('0x3a')](_0x400a69['model'],_0x400a69['query']);_0x528fd7[_0x51ae('0x3c')]=_['intersection'](_0x400a69[_0x51ae('0x3b')],qs[_0x51ae('0x3d')](_0x3d73ff['query'][_0x51ae('0x3d')]));_0x528fd7[_0x51ae('0x3c')]=_0x528fd7[_0x51ae('0x3c')]['length']?_0x528fd7[_0x51ae('0x3c')]:_0x400a69[_0x51ae('0x3b')];if(_0x3d73ff[_0x51ae('0x38')][_0x51ae('0x49')]){_0x528fd7[_0x51ae('0x4a')]=[{'all':!![]}];}_0x528fd7=_[_0x51ae('0x46')]({},_0x528fd7,_0x3d73ff[_0x51ae('0x48')]);return db['OpenchannelQueue'][_0x51ae('0x50')](_0x528fd7)[_0x51ae('0x2a')](handleEntityNotFound(_0x2fed1b,null))[_0x51ae('0x2a')](respondWithResult(_0x2fed1b,null))[_0x51ae('0x4c')](handleError(_0x2fed1b,null));};exports['create']=function(_0x4984de,_0x411321){return db['OpenchannelQueue'][_0x51ae('0x51')](_0x4984de['body'],{})[_0x51ae('0x2a')](function(_0x250761){var _0x3e15c7=_0x4984de[_0x51ae('0x52')][_0x51ae('0x2b')]({'plain':!![]});if(!_0x3e15c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e15c7[_0x51ae('0x53')]===_0x51ae('0x52')){var _0x3014a5=_0x250761[_0x51ae('0x2b')]({'plain':!![]});var _0x97518a=_0x51ae('0x2c');return db[_0x51ae('0x54')]['find']({'where':{'name':_0x97518a,'userProfileId':_0x3e15c7['userProfileId']},'raw':!![]})['then'](function(_0x26dc07){if(_0x26dc07&&_0x26dc07[_0x51ae('0x55')]===0x0){return db['UserProfileResource'][_0x51ae('0x51')]({'name':_0x3014a5[_0x51ae('0x30')],'resourceId':_0x3014a5['id'],'type':_0x26dc07[_0x51ae('0x30')],'sectionId':_0x26dc07['id']},{})['then'](function(){return _0x250761;});}else{return _0x250761;}})['catch'](function(_0x3de19a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3de19a);throw _0x3de19a;});}return _0x250761;})[_0x51ae('0x2a')](respondWithResult(_0x411321,0xc9))[_0x51ae('0x4c')](handleError(_0x411321,null));};exports[_0x51ae('0x29')]=function(_0x49dbe3,_0x39e17e){if(_0x49dbe3[_0x51ae('0x56')]['id']){delete _0x49dbe3[_0x51ae('0x56')]['id'];}return db[_0x51ae('0x34')][_0x51ae('0x50')]({'where':{'id':_0x49dbe3[_0x51ae('0x4e')]['id']}})[_0x51ae('0x2a')](handleEntityNotFound(_0x39e17e,null))[_0x51ae('0x2a')](saveUpdates(_0x49dbe3[_0x51ae('0x56')],null))[_0x51ae('0x2a')](respondWithResult(_0x39e17e,null))['catch'](handleError(_0x39e17e,null));};exports[_0x51ae('0x2d')]=function(_0x5778aa,_0x2149b8){return db[_0x51ae('0x34')]['find']({'where':{'id':_0x5778aa['params']['id']}})[_0x51ae('0x2a')](handleEntityNotFound(_0x2149b8,null))[_0x51ae('0x2a')](removeEntity(_0x2149b8,null))[_0x51ae('0x4c')](handleError(_0x2149b8,null));};exports['describe']=function(_0x2a80ae,_0x212a57){return db[_0x51ae('0x34')][_0x51ae('0x57')]()[_0x51ae('0x2a')](respondWithResult(_0x212a57,null))[_0x51ae('0x4c')](handleError(_0x212a57,null));};exports[_0x51ae('0x58')]=function(_0x3de4ae,_0x4ead61,_0x4e26ae){var _0x39365f={'raw':!![],'where':{}},_0x389608={},_0x5e1562;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3de4ae[_0x51ae('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4ead61,null))[_0x51ae('0x2a')](function(_0x52d7cf){if(_0x52d7cf){_0x5e1562=_0x52d7cf[_0x51ae('0x2b')]({'plain':!![]});_0x389608['model']=_[_0x51ae('0x4f')](db[_0x51ae('0x59')][_0x51ae('0x35')]);_0x389608[_0x51ae('0x38')]=_[_0x51ae('0x4f')](_0x3de4ae['query']);_0x389608[_0x51ae('0x39')]=_[_0x51ae('0x3a')](_0x389608[_0x51ae('0x3b')],_0x389608[_0x51ae('0x38')]);_0x39365f[_0x51ae('0x3c')]=_[_0x51ae('0x3a')](_0x389608[_0x51ae('0x3b')],qs[_0x51ae('0x3d')](_0x3de4ae[_0x51ae('0x38')][_0x51ae('0x3d')]));_0x39365f[_0x51ae('0x3c')]=_0x39365f[_0x51ae('0x3c')][_0x51ae('0x3e')]?_0x39365f['attributes']:_0x389608[_0x51ae('0x3b')];if(!_0x3de4ae[_0x51ae('0x38')][_0x51ae('0x3f')]('nolimit')){_0x39365f[_0x51ae('0x22')]=qs[_0x51ae('0x22')](_0x3de4ae[_0x51ae('0x38')][_0x51ae('0x22')]);_0x39365f[_0x51ae('0x20')]=qs[_0x51ae('0x20')](_0x3de4ae[_0x51ae('0x38')]['offset']);}_0x39365f[_0x51ae('0x41')]=qs[_0x51ae('0x42')](_0x3de4ae[_0x51ae('0x38')][_0x51ae('0x42')]);_0x39365f['where']=qs[_0x51ae('0x39')](_[_0x51ae('0x44')](_0x3de4ae[_0x51ae('0x38')],_0x389608[_0x51ae('0x39')]));_0x39365f[_0x51ae('0x43')][_0x51ae('0x5a')]=_0x52d7cf['id'];if(_0x3de4ae[_0x51ae('0x38')][_0x51ae('0x45')]){_0x39365f[_0x51ae('0x43')]=_['merge'](_0x39365f[_0x51ae('0x43')],{'$or':_[_0x51ae('0x33')](_0x39365f[_0x51ae('0x3c')],function(_0x3e7a78){var _0x4d4240={};_0x4d4240[_0x3e7a78]={'$like':'%'+_0x3de4ae['query'][_0x51ae('0x45')]+'%'};return _0x4d4240;})});}_0x39365f=_[_0x51ae('0x46')]({},_0x39365f,_0x3de4ae[_0x51ae('0x48')]);return db[_0x51ae('0x59')][_0x51ae('0x4b')](_0x39365f);}})[_0x51ae('0x2a')](function(_0x119991){if(_0x119991){return db[_0x51ae('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x119991,_0x51ae('0x5c')),'role':'agent'},'attributes':['id',_0x51ae('0x30'),_0x51ae('0x5d'),_0x51ae('0x5e'),'createdAt']});}})[_0x51ae('0x2a')](function(_0x23697b){if(_0x23697b){return{'count':_0x23697b[_0x51ae('0x23')],'rows':_[_0x51ae('0x33')](_0x23697b[_0x51ae('0x5f')],function(_0x364a2d){return{'membername':_0x364a2d[_0x51ae('0x30')],'UserId':_0x364a2d['id'],'queue_name':_0x5e1562[_0x51ae('0x30')],'OpenchannelQueueId':_0x5e1562['id'],'interface':util[_0x51ae('0x60')](_0x51ae('0x61'),_0x51ae('0x62'),_0x364a2d[_0x51ae('0x30')]),'penalty':0x0,'paused':_0x364a2d[_0x51ae('0x5d')],'createdAt':_0x364a2d['createdAt'],'updatedAt':_0x364a2d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x51ae('0x2a')](respondWithFilteredResult(_0x4ead61,_0x39365f))[_0x51ae('0x4c')](handleError(_0x4ead61,null));};exports[_0x51ae('0x63')]=function(_0x5eda91,_0x235a78,_0x48a741){var _0x1d0c53={};var _0x38ae6f={};var _0x4ca048;var _0x2038df;return db[_0x51ae('0x34')][_0x51ae('0x64')]({'where':{'id':_0x5eda91[_0x51ae('0x4e')]['id']}})[_0x51ae('0x2a')](handleEntityNotFound(_0x235a78,null))[_0x51ae('0x2a')](function(_0x1beffd){if(_0x1beffd){_0x4ca048=_0x1beffd;_0x38ae6f[_0x51ae('0x3b')]=_[_0x51ae('0x4f')](db['Team'][_0x51ae('0x35')]);_0x38ae6f[_0x51ae('0x38')]=_['keys'](_0x5eda91['query']);_0x38ae6f[_0x51ae('0x39')]=_[_0x51ae('0x3a')](_0x38ae6f['model'],_0x38ae6f[_0x51ae('0x38')]);_0x1d0c53[_0x51ae('0x3c')]=_[_0x51ae('0x3a')](_0x38ae6f[_0x51ae('0x3b')],qs[_0x51ae('0x3d')](_0x5eda91[_0x51ae('0x38')][_0x51ae('0x3d')]));_0x1d0c53['attributes']=_0x1d0c53[_0x51ae('0x3c')][_0x51ae('0x3e')]?_0x1d0c53['attributes']:_0x38ae6f[_0x51ae('0x3b')];_0x1d0c53[_0x51ae('0x41')]=qs[_0x51ae('0x42')](_0x5eda91[_0x51ae('0x38')]['sort']);_0x1d0c53['where']=qs[_0x51ae('0x39')](_[_0x51ae('0x44')](_0x5eda91['query'],_0x38ae6f['filters']));if(_0x5eda91[_0x51ae('0x38')][_0x51ae('0x45')]){_0x1d0c53['where']=_[_0x51ae('0x46')](_0x1d0c53['where'],{'$or':_[_0x51ae('0x33')](_0x1d0c53[_0x51ae('0x3c')],function(_0x40bcc9){var _0x6b6bc1={};_0x6b6bc1[_0x40bcc9]={'$like':'%'+_0x5eda91[_0x51ae('0x38')][_0x51ae('0x45')]+'%'};return _0x6b6bc1;})});}_0x1d0c53=_[_0x51ae('0x46')]({},_0x1d0c53,_0x5eda91['options']);return _0x4ca048[_0x51ae('0x63')](_0x1d0c53);}})[_0x51ae('0x2a')](function(_0x22ae77){if(_0x22ae77){_0x2038df=_0x22ae77[_0x51ae('0x3e')];if(!_0x5eda91['query'][_0x51ae('0x3f')](_0x51ae('0x40'))){_0x1d0c53[_0x51ae('0x22')]=qs['limit'](_0x5eda91['query']['limit']);_0x1d0c53[_0x51ae('0x20')]=qs[_0x51ae('0x20')](_0x5eda91[_0x51ae('0x38')]['offset']);}return _0x4ca048[_0x51ae('0x63')](_0x1d0c53);}})[_0x51ae('0x2a')](function(_0x53da8a){if(_0x53da8a){return _0x53da8a?{'count':_0x2038df,'rows':_0x53da8a}:null;}})['then'](respondWithResult(_0x235a78,null))['catch'](handleError(_0x235a78,null));};exports['addTeams']=function(_0x2282f9,_0x5d2322,_0x959fcb){var _0x349163=_0x2282f9['body']['ids'];return db[_0x51ae('0x65')][_0x51ae('0x4b')]({'where':{'id':_0x349163},'attributes':['id'],'include':[{'model':db[_0x51ae('0x5b')],'as':_0x51ae('0x66'),'attributes':['id',_0x51ae('0x30'),_0x51ae('0x67'),_0x51ae('0x68'),_0x51ae('0x69')],'raw':!![]}]})['then'](function(_0x138fe3){if(_0x138fe3){var _0x58cd63=_['flatMap'](_0x138fe3,function(_0x33c7dd){var _0x4d34f4=_0x33c7dd[_0x51ae('0x2b')]({'plain':!![]});return _0x4d34f4['Agents'];});return db[_0x51ae('0x34')][_0x51ae('0x50')]({'where':{'id':_0x2282f9[_0x51ae('0x4e')]['id']}})[_0x51ae('0x2a')](function(_0x1b116c){return db[_0x51ae('0x6a')]['transaction'](function(_0x4cb01c){return _0x1b116c[_0x51ae('0x6b')](_0x349163,{'transaction':_0x4cb01c})[_0x51ae('0x2a')](function(){return BPromise[_0x51ae('0x6c')](_0x58cd63,function(_0x45d217){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x45d217['id'],'OpenchannelQueueId':_0x2282f9['params']['id']},'transaction':_0x4cb01c});});})['then'](function(){_0x58cd63[_0x51ae('0x6d')](function(_0x527d4e){socket[_0x51ae('0x6e')](_0x51ae('0x6f'),{'UserId':_0x527d4e['id'],'OpenchannelQueueId':_0x1b116c['id']});});});});});}})[_0x51ae('0x2a')](respondWithStatusCode(_0x5d2322,null))['catch'](handleError(_0x5d2322,null));};exports['removeTeams']=function(_0x55eeb4,_0x206433,_0x28f36a){return db[_0x51ae('0x65')][_0x51ae('0x4b')]({'where':{'id':_0x55eeb4[_0x51ae('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x51ae('0x5b')],'as':_0x51ae('0x66'),'attributes':['id'],'raw':!![]}]})[_0x51ae('0x2a')](handleEntityNotFound(_0x206433,null))[_0x51ae('0x2a')](function(_0xf31369){var _0x5df652=_['map'](_0xf31369,'id');var _0x27b77b=[];var _0x4f1f5c=[];var _0x228c4d=squel['select']();_0x228c4d['field'](_0x51ae('0x70'))[_0x51ae('0x71')](_0x51ae('0x72'),'tq')[_0x51ae('0x73')](_0x51ae('0x74'),'ut',_0x51ae('0x75'))['where'](_0x51ae('0x76'),_0x55eeb4['params']['id']);for(var _0x30456d=0x0;_0x30456d<_0xf31369[_0x51ae('0x3e')];_0x30456d+=0x1){let _0x27ec9f=_0xf31369[_0x30456d];for(var _0x2551e6=0x0;_0x2551e6<_0x27ec9f['Agents'][_0x51ae('0x3e')];_0x2551e6+=0x1){let _0x5085c6=_0x27ec9f[_0x51ae('0x66')][_0x2551e6];var _0x5329ab=_0x228c4d[_0x51ae('0x77')]();_0x5329ab[_0x51ae('0x43')]('ut.UserId\x20=\x20?',_0x5085c6['id']);_0x4f1f5c[_0x51ae('0x78')](db['sequelize'][_0x51ae('0x38')](_0x5329ab[_0x51ae('0x79')](),{'type':db[_0x51ae('0x6a')][_0x51ae('0x7a')][_0x51ae('0x7b')]})['then'](function(_0x27b183){if(_0x27b183['length']===0x1){return _0x5085c6['id'];}else{var _0x16b22f=_['every'](_['map'](_0x27b183,'TeamId'),function(_0x484da5){return _[_0x51ae('0x7c')](_0x5df652,_0x484da5);});if(_0x16b22f){return _0x5085c6['id'];}}}));}}return BPromise[_0x51ae('0x7d')](_0x4f1f5c)[_0x51ae('0x2a')](function(_0x4307a3){_0x27b77b=_(_0x27b77b)['union'](_0x4307a3)['compact']()[_0x51ae('0x7e')]();return db[_0x51ae('0x34')]['find']({'where':{'id':_0x55eeb4[_0x51ae('0x4e')]['id']}})[_0x51ae('0x2a')](function(_0x1abe10){return db[_0x51ae('0x6a')][_0x51ae('0x7f')](function(_0x50817f){return _0x1abe10['removeTeams'](_0x55eeb4['query'][_0x51ae('0x80')],{'transaction':_0x50817f})['then'](function(){if(!_[_0x51ae('0x81')](_0x27b77b)){return _0x1abe10[_0x51ae('0x82')](_0x27b77b,{'transaction':_0x50817f});}})[_0x51ae('0x2a')](function(){_0x27b77b[_0x51ae('0x6d')](function(_0x25f174){socket[_0x51ae('0x6e')]('userOpenchannelQueue:remove',{'UserId':_0x25f174,'OpenchannelQueueId':_0x1abe10['id']});});});});});});})[_0x51ae('0x2a')](respondWithStatusCode(_0x206433,null))['catch'](handleError(_0x206433,null));};exports['addAgents']=function(_0x2ec0b7,_0x1be0cb,_0x4f8bd6){return db[_0x51ae('0x34')]['find']({'where':{'id':_0x2ec0b7['params']['id']}})[_0x51ae('0x2a')](handleEntityNotFound(_0x1be0cb,null))[_0x51ae('0x2a')](function(_0x2f2a4d){if(_0x2f2a4d){return _0x2f2a4d[_0x51ae('0x83')](_0x2ec0b7[_0x51ae('0x56')][_0x51ae('0x80')],_[_0x51ae('0x84')](_0x2ec0b7[_0x51ae('0x56')],[_0x51ae('0x80'),'id'])||{})['spread'](function(_0x185e03){for(var _0x3fb199=0x0;_0x3fb199<_0x2ec0b7['body'][_0x51ae('0x80')][_0x51ae('0x3e')];_0x3fb199+=0x1){socket[_0x51ae('0x6e')](_0x51ae('0x6f'),{'UserId':Number(_0x2ec0b7[_0x51ae('0x56')][_0x51ae('0x80')][_0x3fb199]),'OpenchannelQueueId':Number(_0x2ec0b7['params']['id'])});}return _0x185e03;});}})[_0x51ae('0x2a')](respondWithResult(_0x1be0cb,null))['catch'](handleError(_0x1be0cb,null));};exports['removeAgents']=function(_0x36ce87,_0x5e3a30,_0xe37d71){return db['OpenchannelQueue'][_0x51ae('0x50')]({'where':{'id':_0x36ce87['params']['id']}})['then'](handleEntityNotFound(_0x5e3a30,null))['then'](function(_0x337623){if(_0x337623){return _0x337623['removeAgents'](_0x36ce87[_0x51ae('0x38')][_0x51ae('0x80')])[_0x51ae('0x2a')](function(){if(_['isArray'](_0x36ce87[_0x51ae('0x38')][_0x51ae('0x80')])){for(var _0x4f53e7=0x0;_0x4f53e7<_0x36ce87['query'][_0x51ae('0x80')][_0x51ae('0x3e')];_0x4f53e7+=0x1){socket[_0x51ae('0x6e')](_0x51ae('0x85'),{'UserId':Number(_0x36ce87[_0x51ae('0x38')][_0x51ae('0x80')][_0x4f53e7]),'OpenchannelQueueId':Number(_0x36ce87['params']['id'])});}}else{socket[_0x51ae('0x6e')](_0x51ae('0x85'),{'UserId':Number(_0x36ce87['query'][_0x51ae('0x80')]),'OpenchannelQueueId':Number(_0x36ce87[_0x51ae('0x4e')]['id'])});}});}})[_0x51ae('0x2a')](respondWithStatusCode(_0x5e3a30,null))[_0x51ae('0x4c')](handleError(_0x5e3a30,null));};exports['getAgents']=function(_0x48a7f8,_0x214f72,_0x38642e){var _0x2e13c0={};var _0x319ab7={};var _0x165195;var _0x47401c;return db['OpenchannelQueue'][_0x51ae('0x64')]({'where':{'id':_0x48a7f8[_0x51ae('0x4e')]['id']}})[_0x51ae('0x2a')](handleEntityNotFound(_0x214f72,null))[_0x51ae('0x2a')](function(_0x434f09){if(_0x434f09){_0x165195=_0x434f09;_0x319ab7['model']=_[_0x51ae('0x4f')](db['User'][_0x51ae('0x35')]);_0x319ab7[_0x51ae('0x38')]=_[_0x51ae('0x4f')](_0x48a7f8[_0x51ae('0x38')]);_0x319ab7['filters']=_['intersection'](_0x319ab7['model'],_0x319ab7[_0x51ae('0x38')]);_0x2e13c0[_0x51ae('0x3c')]=_[_0x51ae('0x3a')](_0x319ab7['model'],qs[_0x51ae('0x3d')](_0x48a7f8[_0x51ae('0x38')][_0x51ae('0x3d')]));_0x2e13c0[_0x51ae('0x3c')]=_0x2e13c0['attributes']['length']?_0x2e13c0[_0x51ae('0x3c')]:_0x319ab7['model'];_0x2e13c0['order']=qs[_0x51ae('0x42')](_0x48a7f8['query'][_0x51ae('0x42')]);_0x2e13c0[_0x51ae('0x43')]=qs['filters'](_[_0x51ae('0x44')](_0x48a7f8[_0x51ae('0x38')],_0x319ab7[_0x51ae('0x39')]));if(_0x48a7f8[_0x51ae('0x38')][_0x51ae('0x45')]){_0x2e13c0[_0x51ae('0x43')]=_[_0x51ae('0x46')](_0x2e13c0[_0x51ae('0x43')],{'$or':_[_0x51ae('0x33')](_0x2e13c0[_0x51ae('0x3c')],function(_0x571cb0){var _0x3c1494={};_0x3c1494[_0x571cb0]={'$like':'%'+_0x48a7f8['query'][_0x51ae('0x45')]+'%'};return _0x3c1494;})});}_0x2e13c0=_[_0x51ae('0x46')]({},_0x2e13c0,_0x48a7f8[_0x51ae('0x48')]);return _0x165195[_0x51ae('0x86')](_0x2e13c0);}})[_0x51ae('0x2a')](function(_0x223e75){if(_0x223e75){_0x47401c=_0x223e75[_0x51ae('0x3e')];if(!_0x48a7f8['query'][_0x51ae('0x3f')](_0x51ae('0x40'))){_0x2e13c0[_0x51ae('0x22')]=qs[_0x51ae('0x22')](_0x48a7f8[_0x51ae('0x38')][_0x51ae('0x22')]);_0x2e13c0['offset']=qs['offset'](_0x48a7f8['query'][_0x51ae('0x20')]);}return _0x165195['getAgents'](_0x2e13c0);}})[_0x51ae('0x2a')](function(_0x32f488){if(_0x32f488){return _0x32f488?{'count':_0x47401c,'rows':_0x32f488}:null;}})[_0x51ae('0x2a')](respondWithResult(_0x214f72,null))[_0x51ae('0x4c')](handleError(_0x214f72,null));}; \ No newline at end of file +var _0x19c4=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','destroy','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelQueue','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','Agents','online','flatMap','sequelize','each','findOrCreate','emit','Team','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','ids','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x19c4,0x86));var _0x419c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x19c4[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x419c('0x0'));var rimraf=require(_0x419c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x419c('0x2'));var rp=require(_0x419c('0x3'));var moment=require(_0x419c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x419c('0x5'));var util=require(_0x419c('0x6'));var path=require(_0x419c('0x7'));var sox=require(_0x419c('0x8'));var csv=require(_0x419c('0x9'));var ejs=require(_0x419c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x419c('0xb'));var squel=require(_0x419c('0xc'));var crypto=require(_0x419c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x419c('0xe'));var toCsv=require(_0x419c('0x9'));var querystring=require(_0x419c('0xf'));var Papa=require(_0x419c('0x10'));var Redis=require(_0x419c('0x11'));var authService=require(_0x419c('0x12'));var qs=require(_0x419c('0x13'));var as=require(_0x419c('0x14'));var hardwareService=require(_0x419c('0x15'));var logger=require(_0x419c('0x16'))(_0x419c('0x17'));var utils=require(_0x419c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x419c('0x19'));var db=require(_0x419c('0x1a'))['db'];config[_0x419c('0x1b')]=_[_0x419c('0x1c')](config[_0x419c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x419c('0x1d'))(new Redis(config[_0x419c('0x1b')]));require(_0x419c('0x1e'))['register'](socket);function respondWithStatusCode(_0x55246c,_0xf9fdf0){_0xf9fdf0=_0xf9fdf0||0xcc;return function(_0x358b60){if(_0x358b60){return _0x55246c[_0x419c('0x1f')](_0xf9fdf0);}return _0x55246c[_0x419c('0x20')](_0xf9fdf0)[_0x419c('0x21')]();};}function respondWithResult(_0x19f66b,_0x15b685){_0x15b685=_0x15b685||0xc8;return function(_0x2d8b0e){if(_0x2d8b0e){return _0x19f66b['status'](_0x15b685)[_0x419c('0x22')](_0x2d8b0e);}};}function respondWithFilteredResult(_0x3d45c8,_0x392dba){return function(_0x44f594){if(_0x44f594){var _0x34ad4f=typeof _0x392dba[_0x419c('0x23')]==='undefined'&&typeof _0x392dba[_0x419c('0x24')]===_0x419c('0x25');var _0x59e98d=_0x44f594['count'];var _0x3df99a=_0x34ad4f?0x0:_0x392dba['offset'];var _0x5f4e14=_0x34ad4f?_0x44f594[_0x419c('0x26')]:_0x392dba[_0x419c('0x23')]+_0x392dba[_0x419c('0x24')];var _0x486f8f;if(_0x5f4e14>=_0x59e98d){_0x5f4e14=_0x59e98d;_0x486f8f=0xc8;}else{_0x486f8f=0xce;}_0x3d45c8[_0x419c('0x20')](_0x486f8f);return _0x3d45c8[_0x419c('0x27')](_0x419c('0x28'),_0x3df99a+'-'+_0x5f4e14+'/'+_0x59e98d)[_0x419c('0x22')](_0x44f594);}return null;};}function patchUpdates(_0xf79133){return function(_0x543c1f){try{jsonpatch[_0x419c('0x29')](_0x543c1f,_0xf79133,!![]);}catch(_0x2403f4){return BPromise[_0x419c('0x2a')](_0x2403f4);}return _0x543c1f[_0x419c('0x2b')]();};}function saveUpdates(_0x37ba6b,_0x2d86ee){return function(_0xb685f5){if(_0xb685f5){return _0xb685f5[_0x419c('0x2c')](_0x37ba6b)[_0x419c('0x2d')](function(_0x2f4730){return _0x2f4730;});}return null;};}function removeEntity(_0x29c4f9,_0x375a30){return function(_0x31277a){if(_0x31277a){return _0x31277a['destroy']()[_0x419c('0x2d')](function(){var _0x3bd52a=_0x31277a[_0x419c('0x2e')]({'plain':!![]});var _0xb6cf84='OpenchannelQueues';return db['UserProfileResource'][_0x419c('0x2f')]({'where':{'type':_0xb6cf84,'resourceId':_0x3bd52a['id']}})[_0x419c('0x2d')](function(){return _0x31277a;});})['then'](function(){_0x29c4f9[_0x419c('0x20')](0xcc)[_0x419c('0x21')]();});}};}function handleEntityNotFound(_0x1db906,_0x435da2){return function(_0x1f14e2){if(!_0x1f14e2){_0x1db906[_0x419c('0x1f')](0x194);}return _0x1f14e2;};}function handleError(_0x2b9bba,_0x27aa80){_0x27aa80=_0x27aa80||0x1f4;return function(_0x103011){logger[_0x419c('0x30')](_0x103011[_0x419c('0x31')]);if(_0x103011[_0x419c('0x32')]){delete _0x103011[_0x419c('0x32')];}_0x2b9bba[_0x419c('0x20')](_0x27aa80)[_0x419c('0x33')](_0x103011);};}exports[_0x419c('0x34')]=function(_0x43e232,_0x3aa4db){var _0x562e3d={},_0x4e8ec2={},_0x5f173c={'count':0x0,'rows':[]};var _0x4a8faa=_[_0x419c('0x35')](db['OpenchannelQueue']['rawAttributes'],function(_0x400644){return{'name':_0x400644[_0x419c('0x36')],'type':_0x400644[_0x419c('0x37')][_0x419c('0x38')]};});_0x4e8ec2['model']=_[_0x419c('0x35')](_0x4a8faa,_0x419c('0x32'));_0x4e8ec2['query']=_[_0x419c('0x39')](_0x43e232[_0x419c('0x3a')]);_0x4e8ec2[_0x419c('0x3b')]=_['intersection'](_0x4e8ec2['model'],_0x4e8ec2[_0x419c('0x3a')]);_0x562e3d[_0x419c('0x3c')]=_[_0x419c('0x3d')](_0x4e8ec2[_0x419c('0x3e')],qs[_0x419c('0x3f')](_0x43e232[_0x419c('0x3a')][_0x419c('0x3f')]));_0x562e3d[_0x419c('0x3c')]=_0x562e3d[_0x419c('0x3c')][_0x419c('0x40')]?_0x562e3d['attributes']:_0x4e8ec2[_0x419c('0x3e')];if(!_0x43e232[_0x419c('0x3a')]['hasOwnProperty'](_0x419c('0x41'))){_0x562e3d['limit']=qs[_0x419c('0x24')](_0x43e232['query']['limit']);_0x562e3d[_0x419c('0x23')]=qs[_0x419c('0x23')](_0x43e232[_0x419c('0x3a')]['offset']);}_0x562e3d[_0x419c('0x42')]=qs[_0x419c('0x43')](_0x43e232[_0x419c('0x3a')][_0x419c('0x43')]);_0x562e3d['where']=qs['filters'](_[_0x419c('0x44')](_0x43e232['query'],_0x4e8ec2[_0x419c('0x3b')]),_0x4a8faa);if(_0x43e232['query'][_0x419c('0x45')]){_0x562e3d['where']=_[_0x419c('0x46')](_0x562e3d[_0x419c('0x47')],{'$or':_['map'](_0x4a8faa,function(_0x1ed158){if(_0x1ed158[_0x419c('0x37')]!==_0x419c('0x48')){var _0x501710={};_0x501710[_0x1ed158['name']]={'$like':'%'+_0x43e232[_0x419c('0x3a')][_0x419c('0x45')]+'%'};return _0x501710;}})});}_0x562e3d=_[_0x419c('0x46')]({},_0x562e3d,_0x43e232[_0x419c('0x49')]);var _0x57a2db={'where':_0x562e3d[_0x419c('0x47')]};return db[_0x419c('0x4a')]['count'](_0x57a2db)[_0x419c('0x2d')](function(_0x542a18){_0x5f173c[_0x419c('0x26')]=_0x542a18;if(_0x43e232['query'][_0x419c('0x4b')]){_0x562e3d['include']=[{'all':!![]}];}return db[_0x419c('0x4a')][_0x419c('0x4c')](_0x562e3d);})[_0x419c('0x2d')](function(_0x48a44b){_0x5f173c[_0x419c('0x4d')]=_0x48a44b;return _0x5f173c;})[_0x419c('0x2d')](respondWithFilteredResult(_0x3aa4db,_0x562e3d))['catch'](handleError(_0x3aa4db,null));};exports[_0x419c('0x4e')]=function(_0x389c0b,_0x509461){var _0x204d24={'raw':!![],'where':{'id':_0x389c0b[_0x419c('0x4f')]['id']}},_0x2bcbe8={};_0x2bcbe8[_0x419c('0x3e')]=_['keys'](db['OpenchannelQueue'][_0x419c('0x50')]);_0x2bcbe8[_0x419c('0x3a')]=_[_0x419c('0x39')](_0x389c0b[_0x419c('0x3a')]);_0x2bcbe8[_0x419c('0x3b')]=_[_0x419c('0x3d')](_0x2bcbe8[_0x419c('0x3e')],_0x2bcbe8[_0x419c('0x3a')]);_0x204d24['attributes']=_[_0x419c('0x3d')](_0x2bcbe8[_0x419c('0x3e')],qs[_0x419c('0x3f')](_0x389c0b['query']['fields']));_0x204d24[_0x419c('0x3c')]=_0x204d24[_0x419c('0x3c')][_0x419c('0x40')]?_0x204d24[_0x419c('0x3c')]:_0x2bcbe8['model'];if(_0x389c0b[_0x419c('0x3a')][_0x419c('0x4b')]){_0x204d24[_0x419c('0x51')]=[{'all':!![]}];}_0x204d24=_[_0x419c('0x46')]({},_0x204d24,_0x389c0b[_0x419c('0x49')]);return db[_0x419c('0x4a')][_0x419c('0x52')](_0x204d24)['then'](handleEntityNotFound(_0x509461,null))[_0x419c('0x2d')](respondWithResult(_0x509461,null))[_0x419c('0x53')](handleError(_0x509461,null));};exports['create']=function(_0x22e1c0,_0x4be00e){return db['OpenchannelQueue']['create'](_0x22e1c0['body'],{})['then'](function(_0x2f6bc9){var _0xda1124=_0x22e1c0[_0x419c('0x54')][_0x419c('0x2e')]({'plain':!![]});if(!_0xda1124)throw new Error(_0x419c('0x55'));if(_0xda1124['role']===_0x419c('0x54')){var _0x5786e2=_0x2f6bc9[_0x419c('0x2e')]({'plain':!![]});var _0x5c8249=_0x419c('0x56');return db[_0x419c('0x57')][_0x419c('0x52')]({'where':{'name':_0x5c8249,'userProfileId':_0xda1124[_0x419c('0x58')]},'raw':!![]})['then'](function(_0x25be64){if(_0x25be64&&_0x25be64[_0x419c('0x59')]===0x0){return db[_0x419c('0x5a')][_0x419c('0x5b')]({'name':_0x5786e2[_0x419c('0x32')],'resourceId':_0x5786e2['id'],'type':_0x25be64[_0x419c('0x32')],'sectionId':_0x25be64['id']},{})['then'](function(){return _0x2f6bc9;});}else{return _0x2f6bc9;}})[_0x419c('0x53')](function(_0x48a96e){logger[_0x419c('0x30')](_0x419c('0x5c'),_0x48a96e);throw _0x48a96e;});}return _0x2f6bc9;})[_0x419c('0x2d')](respondWithResult(_0x4be00e,0xc9))[_0x419c('0x53')](handleError(_0x4be00e,null));};exports[_0x419c('0x2c')]=function(_0x1c468d,_0xf63604){if(_0x1c468d[_0x419c('0x5d')]['id']){delete _0x1c468d[_0x419c('0x5d')]['id'];}return db[_0x419c('0x4a')]['find']({'where':{'id':_0x1c468d[_0x419c('0x4f')]['id']}})[_0x419c('0x2d')](handleEntityNotFound(_0xf63604,null))[_0x419c('0x2d')](saveUpdates(_0x1c468d[_0x419c('0x5d')],null))['then'](respondWithResult(_0xf63604,null))[_0x419c('0x53')](handleError(_0xf63604,null));};exports['destroy']=function(_0x2cdfe2,_0x349bfb){return db['OpenchannelQueue'][_0x419c('0x52')]({'where':{'id':_0x2cdfe2[_0x419c('0x4f')]['id']}})[_0x419c('0x2d')](handleEntityNotFound(_0x349bfb,null))[_0x419c('0x2d')](removeEntity(_0x349bfb,null))[_0x419c('0x53')](handleError(_0x349bfb,null));};exports[_0x419c('0x5e')]=function(_0xa018ae,_0x8340e9){return db[_0x419c('0x4a')][_0x419c('0x5e')]()[_0x419c('0x2d')](respondWithResult(_0x8340e9,null))[_0x419c('0x53')](handleError(_0x8340e9,null));};exports[_0x419c('0x5f')]=function(_0x49d5a3,_0x1b4c1a,_0x47f08f){var _0x451038={'raw':!![],'where':{}},_0x263a0e={},_0x3e7de1;return db[_0x419c('0x4a')][_0x419c('0x60')]({'where':{'id':_0x49d5a3[_0x419c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1b4c1a,null))[_0x419c('0x2d')](function(_0x547448){if(_0x547448){_0x3e7de1=_0x547448['get']({'plain':!![]});_0x263a0e['model']=_['keys'](db[_0x419c('0x61')]['rawAttributes']);_0x263a0e[_0x419c('0x3a')]=_['keys'](_0x49d5a3[_0x419c('0x3a')]);_0x263a0e['filters']=_[_0x419c('0x3d')](_0x263a0e['model'],_0x263a0e[_0x419c('0x3a')]);_0x451038[_0x419c('0x3c')]=_[_0x419c('0x3d')](_0x263a0e[_0x419c('0x3e')],qs[_0x419c('0x3f')](_0x49d5a3[_0x419c('0x3a')][_0x419c('0x3f')]));_0x451038['attributes']=_0x451038[_0x419c('0x3c')][_0x419c('0x40')]?_0x451038[_0x419c('0x3c')]:_0x263a0e[_0x419c('0x3e')];if(!_0x49d5a3[_0x419c('0x3a')][_0x419c('0x62')](_0x419c('0x41'))){_0x451038[_0x419c('0x24')]=qs[_0x419c('0x24')](_0x49d5a3[_0x419c('0x3a')]['limit']);_0x451038['offset']=qs['offset'](_0x49d5a3[_0x419c('0x3a')][_0x419c('0x23')]);}_0x451038[_0x419c('0x42')]=qs[_0x419c('0x43')](_0x49d5a3[_0x419c('0x3a')][_0x419c('0x43')]);_0x451038['where']=qs[_0x419c('0x3b')](_['pick'](_0x49d5a3[_0x419c('0x3a')],_0x263a0e[_0x419c('0x3b')]));_0x451038[_0x419c('0x47')][_0x419c('0x63')]=_0x547448['id'];if(_0x49d5a3['query'][_0x419c('0x45')]){_0x451038['where']=_['merge'](_0x451038[_0x419c('0x47')],{'$or':_['map'](_0x451038[_0x419c('0x3c')],function(_0x335897){var _0x23a510={};_0x23a510[_0x335897]={'$like':'%'+_0x49d5a3[_0x419c('0x3a')]['filter']+'%'};return _0x23a510;})});}_0x451038=_[_0x419c('0x46')]({},_0x451038,_0x49d5a3[_0x419c('0x49')]);return db[_0x419c('0x61')]['findAll'](_0x451038);}})[_0x419c('0x2d')](function(_0x54bb3b){if(_0x54bb3b){return db[_0x419c('0x64')][_0x419c('0x65')]({'where':{'id':_[_0x419c('0x35')](_0x54bb3b,'UserId'),'role':_0x419c('0x66')},'attributes':['id','name',_0x419c('0x67'),_0x419c('0x68'),_0x419c('0x69')]});}})[_0x419c('0x2d')](function(_0x2b6e98){if(_0x2b6e98){return{'count':_0x2b6e98[_0x419c('0x26')],'rows':_['map'](_0x2b6e98['rows'],function(_0x3cec14){return{'membername':_0x3cec14[_0x419c('0x32')],'UserId':_0x3cec14['id'],'queue_name':_0x3e7de1[_0x419c('0x32')],'OpenchannelQueueId':_0x3e7de1['id'],'interface':util[_0x419c('0x6a')]('%s/%s',_0x419c('0x6b'),_0x3cec14['name']),'penalty':0x0,'paused':_0x3cec14[_0x419c('0x67')],'createdAt':_0x3cec14['createdAt'],'updatedAt':_0x3cec14['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b4c1a,_0x451038))[_0x419c('0x53')](handleError(_0x1b4c1a,null));};exports['getTeams']=function(_0x5a7806,_0x33ff29,_0x1ffb8){var _0x57e4c8={};var _0x18a5cc={};var _0x59cf15;var _0x2994de;return db[_0x419c('0x4a')]['findOne']({'where':{'id':_0x5a7806[_0x419c('0x4f')]['id']}})[_0x419c('0x2d')](handleEntityNotFound(_0x33ff29,null))[_0x419c('0x2d')](function(_0xb57a5a){if(_0xb57a5a){_0x59cf15=_0xb57a5a;_0x18a5cc['model']=_['keys'](db['Team'][_0x419c('0x50')]);_0x18a5cc[_0x419c('0x3a')]=_[_0x419c('0x39')](_0x5a7806[_0x419c('0x3a')]);_0x18a5cc[_0x419c('0x3b')]=_['intersection'](_0x18a5cc['model'],_0x18a5cc[_0x419c('0x3a')]);_0x57e4c8[_0x419c('0x3c')]=_[_0x419c('0x3d')](_0x18a5cc['model'],qs[_0x419c('0x3f')](_0x5a7806[_0x419c('0x3a')][_0x419c('0x3f')]));_0x57e4c8[_0x419c('0x3c')]=_0x57e4c8[_0x419c('0x3c')][_0x419c('0x40')]?_0x57e4c8[_0x419c('0x3c')]:_0x18a5cc[_0x419c('0x3e')];_0x57e4c8['order']=qs[_0x419c('0x43')](_0x5a7806['query']['sort']);_0x57e4c8[_0x419c('0x47')]=qs[_0x419c('0x3b')](_[_0x419c('0x44')](_0x5a7806[_0x419c('0x3a')],_0x18a5cc['filters']));if(_0x5a7806[_0x419c('0x3a')]['filter']){_0x57e4c8[_0x419c('0x47')]=_[_0x419c('0x46')](_0x57e4c8[_0x419c('0x47')],{'$or':_[_0x419c('0x35')](_0x57e4c8[_0x419c('0x3c')],function(_0x3f9159){var _0x9cde63={};_0x9cde63[_0x3f9159]={'$like':'%'+_0x5a7806['query']['filter']+'%'};return _0x9cde63;})});}_0x57e4c8=_[_0x419c('0x46')]({},_0x57e4c8,_0x5a7806[_0x419c('0x49')]);return _0x59cf15[_0x419c('0x6c')](_0x57e4c8);}})[_0x419c('0x2d')](function(_0x1cd13b){if(_0x1cd13b){_0x2994de=_0x1cd13b[_0x419c('0x40')];if(!_0x5a7806['query']['hasOwnProperty'](_0x419c('0x41'))){_0x57e4c8[_0x419c('0x24')]=qs['limit'](_0x5a7806['query'][_0x419c('0x24')]);_0x57e4c8[_0x419c('0x23')]=qs[_0x419c('0x23')](_0x5a7806['query'][_0x419c('0x23')]);}return _0x59cf15[_0x419c('0x6c')](_0x57e4c8);}})[_0x419c('0x2d')](function(_0x46847a){if(_0x46847a){return _0x46847a?{'count':_0x2994de,'rows':_0x46847a}:null;}})['then'](respondWithResult(_0x33ff29,null))[_0x419c('0x53')](handleError(_0x33ff29,null));};exports[_0x419c('0x6d')]=function(_0x7c4aeb,_0x45a7df,_0x1876ce){var _0x4a4b63=_0x7c4aeb[_0x419c('0x5d')]['ids'];return db['Team'][_0x419c('0x4c')]({'where':{'id':_0x4a4b63},'attributes':['id'],'include':[{'model':db['User'],'as':_0x419c('0x6e'),'attributes':['id','name',_0x419c('0x6f'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x47235e){if(_0x47235e){var _0x46911d=_[_0x419c('0x70')](_0x47235e,function(_0x4e0d35){var _0x1be60b=_0x4e0d35[_0x419c('0x2e')]({'plain':!![]});return _0x1be60b[_0x419c('0x6e')];});return db[_0x419c('0x4a')][_0x419c('0x52')]({'where':{'id':_0x7c4aeb['params']['id']}})[_0x419c('0x2d')](function(_0x307e55){return db[_0x419c('0x71')]['transaction'](function(_0xd8a875){return _0x307e55[_0x419c('0x6d')](_0x4a4b63,{'transaction':_0xd8a875})['then'](function(){return BPromise[_0x419c('0x72')](_0x46911d,function(_0x28ad28){return db['UserOpenchannelQueue'][_0x419c('0x73')]({'where':{'UserId':_0x28ad28['id'],'OpenchannelQueueId':_0x7c4aeb[_0x419c('0x4f')]['id']},'transaction':_0xd8a875});});})[_0x419c('0x2d')](function(){_0x46911d['forEach'](function(_0x371f9b){socket[_0x419c('0x74')]('userOpenchannelQueue:save',{'UserId':_0x371f9b['id'],'OpenchannelQueueId':_0x307e55['id']});});});});});}})['then'](respondWithStatusCode(_0x45a7df,null))[_0x419c('0x53')](handleError(_0x45a7df,null));};exports['removeTeams']=function(_0x4ae456,_0xfee451,_0x46e250){return db[_0x419c('0x75')]['findAll']({'where':{'id':_0x4ae456['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x419c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xfee451,null))['then'](function(_0x3b969f){var _0x4a5525=_[_0x419c('0x35')](_0x3b969f,'id');var _0x384ecd=[];var _0x567f89=[];var _0x45b227=squel[_0x419c('0x76')]();_0x45b227[_0x419c('0x77')](_0x419c('0x78'))[_0x419c('0x79')](_0x419c('0x7a'),'tq')[_0x419c('0x7b')]('user_has_teams','ut',_0x419c('0x7c'))['where'](_0x419c('0x7d'),_0x4ae456['params']['id']);for(var _0x3517e3=0x0;_0x3517e3<_0x3b969f[_0x419c('0x40')];_0x3517e3+=0x1){let _0x3371a4=_0x3b969f[_0x3517e3];for(var _0x1f978f=0x0;_0x1f978f<_0x3371a4[_0x419c('0x6e')][_0x419c('0x40')];_0x1f978f+=0x1){let _0x50c8c3=_0x3371a4['Agents'][_0x1f978f];var _0x2f5af4=_0x45b227[_0x419c('0x7e')]();_0x2f5af4['where']('ut.UserId\x20=\x20?',_0x50c8c3['id']);_0x567f89[_0x419c('0x7f')](db[_0x419c('0x71')][_0x419c('0x3a')](_0x2f5af4[_0x419c('0x80')](),{'type':db['sequelize'][_0x419c('0x81')][_0x419c('0x82')]})['then'](function(_0x4bf6e4){if(_0x4bf6e4['length']===0x1){return _0x50c8c3['id'];}else{var _0x109e57=_[_0x419c('0x83')](_[_0x419c('0x35')](_0x4bf6e4,_0x419c('0x84')),function(_0x2c2184){return _['includes'](_0x4a5525,_0x2c2184);});if(_0x109e57){return _0x50c8c3['id'];}}}));}}return BPromise[_0x419c('0x85')](_0x567f89)['then'](function(_0x4cad8f){_0x384ecd=_(_0x384ecd)[_0x419c('0x86')](_0x4cad8f)[_0x419c('0x87')]()[_0x419c('0x88')]();return db[_0x419c('0x4a')][_0x419c('0x52')]({'where':{'id':_0x4ae456[_0x419c('0x4f')]['id']}})[_0x419c('0x2d')](function(_0x435cb8){return db['sequelize'][_0x419c('0x89')](function(_0x59a53c){return _0x435cb8['removeTeams'](_0x4ae456['query'][_0x419c('0x8a')],{'transaction':_0x59a53c})[_0x419c('0x2d')](function(){if(!_[_0x419c('0x8b')](_0x384ecd)){return _0x435cb8[_0x419c('0x8c')](_0x384ecd,{'transaction':_0x59a53c});}})['then'](function(){_0x384ecd[_0x419c('0x8d')](function(_0x2f323b){socket[_0x419c('0x74')](_0x419c('0x8e'),{'UserId':_0x2f323b,'OpenchannelQueueId':_0x435cb8['id']});});});});});});})[_0x419c('0x2d')](respondWithStatusCode(_0xfee451,null))[_0x419c('0x53')](handleError(_0xfee451,null));};exports[_0x419c('0x8f')]=function(_0x2c865b,_0x16f28d,_0x829dbd){return db[_0x419c('0x4a')][_0x419c('0x52')]({'where':{'id':_0x2c865b[_0x419c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x16f28d,null))[_0x419c('0x2d')](function(_0x5b4cc5){if(_0x5b4cc5){return _0x5b4cc5[_0x419c('0x8f')](_0x2c865b[_0x419c('0x5d')][_0x419c('0x8a')],_[_0x419c('0x90')](_0x2c865b['body'],[_0x419c('0x8a'),'id'])||{})[_0x419c('0x91')](function(_0x2c6d34){for(var _0x4bc29c=0x0;_0x4bc29c<_0x2c865b[_0x419c('0x5d')][_0x419c('0x8a')][_0x419c('0x40')];_0x4bc29c+=0x1){socket['emit'](_0x419c('0x92'),{'UserId':Number(_0x2c865b['body'][_0x419c('0x8a')][_0x4bc29c]),'OpenchannelQueueId':Number(_0x2c865b[_0x419c('0x4f')]['id'])});}return _0x2c6d34;});}})[_0x419c('0x2d')](respondWithResult(_0x16f28d,null))['catch'](handleError(_0x16f28d,null));};exports['removeAgents']=function(_0x52aa44,_0x2d40f,_0x193eb8){return db[_0x419c('0x4a')][_0x419c('0x52')]({'where':{'id':_0x52aa44[_0x419c('0x4f')]['id']}})[_0x419c('0x2d')](handleEntityNotFound(_0x2d40f,null))[_0x419c('0x2d')](function(_0x19db41){if(_0x19db41){return _0x19db41[_0x419c('0x8c')](_0x52aa44[_0x419c('0x3a')][_0x419c('0x8a')])[_0x419c('0x2d')](function(){if(_[_0x419c('0x93')](_0x52aa44[_0x419c('0x3a')][_0x419c('0x8a')])){for(var _0x5885b1=0x0;_0x5885b1<_0x52aa44[_0x419c('0x3a')][_0x419c('0x8a')][_0x419c('0x40')];_0x5885b1+=0x1){socket[_0x419c('0x74')](_0x419c('0x8e'),{'UserId':Number(_0x52aa44[_0x419c('0x3a')][_0x419c('0x8a')][_0x5885b1]),'OpenchannelQueueId':Number(_0x52aa44[_0x419c('0x4f')]['id'])});}}else{socket[_0x419c('0x74')](_0x419c('0x8e'),{'UserId':Number(_0x52aa44[_0x419c('0x3a')][_0x419c('0x8a')]),'OpenchannelQueueId':Number(_0x52aa44[_0x419c('0x4f')]['id'])});}});}})[_0x419c('0x2d')](respondWithStatusCode(_0x2d40f,null))[_0x419c('0x53')](handleError(_0x2d40f,null));};exports['getAgents']=function(_0x20b78f,_0x2a2dea,_0x42e9ec){var _0x47437a={};var _0x32635d={};var _0x5fb715;var _0x103862;return db[_0x419c('0x4a')][_0x419c('0x60')]({'where':{'id':_0x20b78f['params']['id']}})['then'](handleEntityNotFound(_0x2a2dea,null))[_0x419c('0x2d')](function(_0xc9c4b){if(_0xc9c4b){_0x5fb715=_0xc9c4b;_0x32635d[_0x419c('0x3e')]=_['keys'](db[_0x419c('0x64')][_0x419c('0x50')]);_0x32635d['query']=_['keys'](_0x20b78f[_0x419c('0x3a')]);_0x32635d['filters']=_[_0x419c('0x3d')](_0x32635d[_0x419c('0x3e')],_0x32635d[_0x419c('0x3a')]);_0x47437a['attributes']=_[_0x419c('0x3d')](_0x32635d['model'],qs[_0x419c('0x3f')](_0x20b78f[_0x419c('0x3a')]['fields']));_0x47437a[_0x419c('0x3c')]=_0x47437a[_0x419c('0x3c')][_0x419c('0x40')]?_0x47437a['attributes']:_0x32635d[_0x419c('0x3e')];_0x47437a['order']=qs[_0x419c('0x43')](_0x20b78f['query'][_0x419c('0x43')]);_0x47437a[_0x419c('0x47')]=qs[_0x419c('0x3b')](_['pick'](_0x20b78f[_0x419c('0x3a')],_0x32635d[_0x419c('0x3b')]));if(_0x20b78f[_0x419c('0x3a')][_0x419c('0x45')]){_0x47437a['where']=_[_0x419c('0x46')](_0x47437a[_0x419c('0x47')],{'$or':_[_0x419c('0x35')](_0x47437a[_0x419c('0x3c')],function(_0x43c7c6){var _0x500483={};_0x500483[_0x43c7c6]={'$like':'%'+_0x20b78f[_0x419c('0x3a')]['filter']+'%'};return _0x500483;})});}_0x47437a=_['merge']({},_0x47437a,_0x20b78f['options']);return _0x5fb715[_0x419c('0x94')](_0x47437a);}})[_0x419c('0x2d')](function(_0x3a1556){if(_0x3a1556){_0x103862=_0x3a1556[_0x419c('0x40')];if(!_0x20b78f[_0x419c('0x3a')][_0x419c('0x62')](_0x419c('0x41'))){_0x47437a['limit']=qs[_0x419c('0x24')](_0x20b78f[_0x419c('0x3a')]['limit']);_0x47437a['offset']=qs[_0x419c('0x23')](_0x20b78f[_0x419c('0x3a')]['offset']);}return _0x5fb715[_0x419c('0x94')](_0x47437a);}})[_0x419c('0x2d')](function(_0x23ac5b){if(_0x23ac5b){return _0x23ac5b?{'count':_0x103862,'rows':_0x23ac5b}:null;}})[_0x419c('0x2d')](respondWithResult(_0x2a2dea,null))[_0x419c('0x53')](handleError(_0x2a2dea,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 3a965bd..c2b98f8 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 _0x9a29=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x388fc6,_0x2b6ddf){var _0x13f116=function(_0x335600){while(--_0x335600){_0x388fc6['push'](_0x388fc6['shift']());}};_0x13f116(++_0x2b6ddf);}(_0x9a29,0x1be));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x99a2('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x99a2('0x1')](0x0);var events={'afterCreate':_0x99a2('0x2'),'afterUpdate':_0x99a2('0x3'),'afterDestroy':_0x99a2('0x4')};function emitEvent(_0x45f22b){return function(_0x380a3f,_0x196db3,_0x40bb73){OpenchannelQueueEvents[_0x99a2('0x5')](_0x45f22b+':'+_0x380a3f['id'],_0x380a3f);OpenchannelQueueEvents['emit'](_0x45f22b,_0x380a3f);_0x40bb73(null);};}for(var e in events){if(events[_0x99a2('0x6')](e)){var event=events[e];OpenchannelQueue[_0x99a2('0x7')](e,emitEvent(event));}}module[_0x99a2('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4366=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue'];(function(_0x4a3b99,_0x1c33e7){var _0x42db20=function(_0x30e72b){while(--_0x30e72b){_0x4a3b99['push'](_0x4a3b99['shift']());}};_0x42db20(++_0x1c33e7);}(_0x4366,0x1b6));var _0x6436=function(_0x712d1b,_0x46f17b){_0x712d1b=_0x712d1b-0x0;var _0x3ac8fe=_0x4366[_0x712d1b];return _0x3ac8fe;};'use strict';var EventEmitter=require(_0x6436('0x0'));var OpenchannelQueue=require(_0x6436('0x1'))['db'][_0x6436('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6436('0x3')};function emitEvent(_0x2cc974){return function(_0x235d21,_0x3cb954,_0x123a1e){OpenchannelQueueEvents['emit'](_0x2cc974+':'+_0x235d21['id'],_0x235d21);OpenchannelQueueEvents[_0x6436('0x4')](_0x2cc974,_0x235d21);_0x123a1e(null);};}for(var e in events){if(events[_0x6436('0x5')](e)){var event=events[e];OpenchannelQueue[_0x6436('0x6')](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 2daee21..0c36554 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 _0x386e=['./openchannelQueue.attributes','define','openchannel_queues','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x2361c0,_0x3d8e6e){var _0x90ee28=function(_0x362674){while(--_0x362674){_0x2361c0['push'](_0x2361c0['shift']());}};_0x90ee28(++_0x3d8e6e);}(_0x386e,0x186));var _0xe386=function(_0x135ebc,_0x123430){_0x135ebc=_0x135ebc-0x0;var _0x210162=_0x386e[_0x135ebc];return _0x210162;};'use strict';var _=require('lodash');var util=require(_0xe386('0x0'));var logger=require(_0xe386('0x1'))('api');var moment=require(_0xe386('0x2'));var BPromise=require('bluebird');var rp=require(_0xe386('0x3'));var fs=require('fs');var path=require(_0xe386('0x4'));var rimraf=require(_0xe386('0x5'));var config=require('../../config/environment');var attributes=require(_0xe386('0x6'));module['exports']=function(_0x106ed6,_0x51587c){return _0x106ed6[_0xe386('0x7')]('OpenchannelQueue',attributes,{'tableName':_0xe386('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dae=['openchannel_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','OpenchannelQueue'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4dae,0x1b9));var _0xe4da=function(_0x41726d,_0x234e92){_0x41726d=_0x41726d-0x0;var _0x337811=_0x4dae[_0x41726d];return _0x337811;};'use strict';var _=require('lodash');var util=require(_0xe4da('0x0'));var logger=require(_0xe4da('0x1'))(_0xe4da('0x2'));var moment=require(_0xe4da('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4da('0x4'));var fs=require('fs');var path=require(_0xe4da('0x5'));var rimraf=require(_0xe4da('0x6'));var config=require(_0xe4da('0x7'));var attributes=require(_0xe4da('0x8'));module['exports']=function(_0x41f3dc,_0x18b475){return _0x41f3dc['define'](_0xe4da('0x9'),attributes,{'tableName':_0xe4da('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 c245826..e40256a 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 _0x7938=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','debug','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7938,0x10b));var _0x8793=function(_0x4de529,_0x479844){_0x4de529=_0x4de529-0x0;var _0x28b61c=_0x7938[_0x4de529];return _0x28b61c;};'use strict';var _=require(_0x8793('0x0'));var util=require(_0x8793('0x1'));var moment=require(_0x8793('0x2'));var BPromise=require(_0x8793('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8793('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8793('0x5'));var logger=require(_0x8793('0x6'))(_0x8793('0x7'));var config=require('../../config/environment');var jayson=require(_0x8793('0x8'));var client=jayson[_0x8793('0x9')][_0x8793('0xa')]({'port':0x232a});config[_0x8793('0xb')]=_[_0x8793('0xc')](config['redis'],{'host':_0x8793('0xd'),'port':0x18eb});var socket=require(_0x8793('0xe'))(new Redis(config[_0x8793('0xb')]));require(_0x8793('0xf'))[_0x8793('0x10')](socket);function respondWithRpcPromise(_0x5d594d,_0x4169e7,_0x532458){return new BPromise(function(_0x2ced72,_0x4715b8){return client['request'](_0x5d594d,_0x532458)[_0x8793('0x11')](function(_0x23e036){logger[_0x8793('0x12')](_0x8793('0x13'),_0x4169e7,'request\x20sent');logger['debug'](_0x8793('0x14'),_0x4169e7,_0x8793('0x15'),JSON['stringify'](_0x23e036));if(_0x23e036[_0x8793('0x16')]){if(_0x23e036[_0x8793('0x16')]['code']===0x1f4){logger[_0x8793('0x16')](_0x8793('0x13'),_0x4169e7,_0x23e036[_0x8793('0x16')][_0x8793('0x17')]);return _0x4715b8(_0x23e036[_0x8793('0x16')]['message']);}logger[_0x8793('0x16')](_0x8793('0x13'),_0x4169e7,_0x23e036[_0x8793('0x16')][_0x8793('0x17')]);return _0x2ced72(_0x23e036[_0x8793('0x16')]['message']);}else{logger[_0x8793('0x12')](_0x8793('0x13'),_0x4169e7,_0x8793('0x15'));_0x2ced72(_0x23e036[_0x8793('0x18')]['message']);}})[_0x8793('0x19')](function(_0x1b0425){logger['error'](_0x8793('0x13'),_0x4169e7,_0x1b0425);_0x4715b8(_0x1b0425);});});}exports['GetOpenchannelQueue']=function(_0x6ae70c){var _0x7519cf=this;return new Promise(function(_0x30c9f0,_0x2822b6){return db[_0x8793('0x1a')][_0x8793('0x1b')]({'raw':_0x6ae70c[_0x8793('0x1c')]?_0x6ae70c[_0x8793('0x1c')][_0x8793('0x1d')]===undefined?!![]:![]:!![],'where':_0x6ae70c[_0x8793('0x1c')]?_0x6ae70c[_0x8793('0x1c')]['where']||null:null,'attributes':_0x6ae70c[_0x8793('0x1c')]?_0x6ae70c[_0x8793('0x1c')][_0x8793('0x1e')]||null:null,'limit':_0x6ae70c[_0x8793('0x1c')]?_0x6ae70c[_0x8793('0x1c')][_0x8793('0x1f')]||null:null,'include':_0x6ae70c[_0x8793('0x1c')]?_0x6ae70c[_0x8793('0x1c')][_0x8793('0x20')]?_[_0x8793('0x21')](_0x6ae70c[_0x8793('0x1c')]['include'],function(_0x39646a){return{'model':db[_0x39646a['model']],'as':_0x39646a['as'],'attributes':_0x39646a[_0x8793('0x1e')],'include':_0x39646a[_0x8793('0x20')]?_[_0x8793('0x21')](_0x39646a[_0x8793('0x20')],function(_0x68767){return{'model':db[_0x68767['model']],'as':_0x68767['as'],'attributes':_0x68767[_0x8793('0x1e')],'include':_0x68767[_0x8793('0x20')]?_[_0x8793('0x21')](_0x68767['include'],function(_0x2299e2){return{'model':db[_0x2299e2[_0x8793('0x22')]],'as':_0x2299e2['as'],'attributes':_0x2299e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x8793('0x11')](function(_0x3c7536){logger[_0x8793('0x12')]('GetOpenchannelQueue',_0x6ae70c);logger[_0x8793('0x23')](_0x8793('0x24'),_0x6ae70c,JSON[_0x8793('0x25')](_0x3c7536));_0x30c9f0(_0x3c7536);})[_0x8793('0x19')](function(_0x5bc7a9){logger[_0x8793('0x16')](_0x8793('0x24'),_0x5bc7a9[_0x8793('0x17')],_0x6ae70c);_0x2822b6(_0x7519cf[_0x8793('0x16')](0x1f4,_0x5bc7a9[_0x8793('0x17')]));});});};exports[_0x8793('0x26')]=function(_0x6b0237){var _0x3b06c4=this;return new Promise(function(_0x19bcaa,_0x365627){return db[_0x8793('0x1a')][_0x8793('0x27')]({'raw':_0x6b0237['options']?_0x6b0237[_0x8793('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x6b0237[_0x8793('0x1c')]?_0x6b0237[_0x8793('0x1c')][_0x8793('0x28')]||null:null,'attributes':_0x6b0237['options']?_0x6b0237[_0x8793('0x1c')][_0x8793('0x1e')]||null:null,'include':_0x6b0237[_0x8793('0x1c')]?_0x6b0237[_0x8793('0x1c')][_0x8793('0x20')]?_[_0x8793('0x21')](_0x6b0237[_0x8793('0x1c')][_0x8793('0x20')],function(_0x3c065c){return{'model':db[_0x3c065c[_0x8793('0x22')]],'as':_0x3c065c['as'],'attributes':_0x3c065c[_0x8793('0x1e')],'include':_0x3c065c[_0x8793('0x20')]?_['map'](_0x3c065c['include'],function(_0x303c6f){return{'model':db[_0x303c6f[_0x8793('0x22')]],'as':_0x303c6f['as'],'attributes':_0x303c6f[_0x8793('0x1e')],'include':_0x303c6f[_0x8793('0x20')]?_[_0x8793('0x21')](_0x303c6f[_0x8793('0x20')],function(_0x3ea661){return{'model':db[_0x3ea661[_0x8793('0x22')]],'as':_0x3ea661['as'],'attributes':_0x3ea661['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29ad8e){logger[_0x8793('0x12')](_0x8793('0x26'),_0x6b0237);logger[_0x8793('0x23')](_0x8793('0x26'),_0x6b0237,JSON['stringify'](_0x29ad8e));_0x19bcaa(_0x29ad8e);})[_0x8793('0x19')](function(_0x1b0a28){logger[_0x8793('0x16')]('ShowOpenchannelQueue',_0x1b0a28[_0x8793('0x17')],_0x6b0237);_0x365627(_0x3b06c4['error'](0x1f4,_0x1b0a28[_0x8793('0x17')]));});});}; \ No newline at end of file +var _0x005f=['model','attributes','ShowOpenchannelQueue','OpenchannelQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','where','limit','map','include'];(function(_0x240a29,_0x2e281c){var _0x67dac5=function(_0x558f32){while(--_0x558f32){_0x240a29['push'](_0x240a29['shift']());}};_0x67dac5(++_0x2e281c);}(_0x005f,0xf0));var _0xf005=function(_0x4b67d1,_0x1e6867){_0x4b67d1=_0x4b67d1-0x0;var _0x5e316e=_0x005f[_0x4b67d1];return _0x5e316e;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var moment=require(_0xf005('0x2'));var BPromise=require(_0xf005('0x3'));var rs=require(_0xf005('0x4'));var fs=require('fs');var Redis=require(_0xf005('0x5'));var db=require(_0xf005('0x6'))['db'];var utils=require(_0xf005('0x7'));var logger=require(_0xf005('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf005('0x9'));var client=jayson[_0xf005('0xa')][_0xf005('0xb')]({'port':0x232a});config[_0xf005('0xc')]=_['defaults'](config[_0xf005('0xc')],{'host':_0xf005('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf005('0xc')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x155d3f,_0x1b8bbb,_0x17718e){return new BPromise(function(_0x196371,_0x59126e){return client[_0xf005('0xe')](_0x155d3f,_0x17718e)[_0xf005('0xf')](function(_0x3bd378){logger[_0xf005('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x1b8bbb,_0xf005('0x11'));logger[_0xf005('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1b8bbb,_0xf005('0x11'),JSON[_0xf005('0x13')](_0x3bd378));if(_0x3bd378[_0xf005('0x14')]){if(_0x3bd378[_0xf005('0x14')][_0xf005('0x15')]===0x1f4){logger['error'](_0xf005('0x16'),_0x1b8bbb,_0x3bd378['error'][_0xf005('0x17')]);return _0x59126e(_0x3bd378[_0xf005('0x14')][_0xf005('0x17')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1b8bbb,_0x3bd378['error'][_0xf005('0x17')]);return _0x196371(_0x3bd378[_0xf005('0x14')]['message']);}else{logger[_0xf005('0x10')](_0xf005('0x16'),_0x1b8bbb,_0xf005('0x11'));_0x196371(_0x3bd378[_0xf005('0x18')][_0xf005('0x17')]);}})[_0xf005('0x19')](function(_0xb4da51){logger[_0xf005('0x14')](_0xf005('0x16'),_0x1b8bbb,_0xb4da51);_0x59126e(_0xb4da51);});});}exports[_0xf005('0x1a')]=function(_0x18fd82){var _0x7d5f5f=this;return new Promise(function(_0x5b5f8a,_0x1daa86){return db['OpenchannelQueue'][_0xf005('0x1b')]({'raw':_0x18fd82[_0xf005('0x1c')]?_0x18fd82[_0xf005('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x18fd82[_0xf005('0x1c')]?_0x18fd82[_0xf005('0x1c')][_0xf005('0x1d')]||null:null,'attributes':_0x18fd82[_0xf005('0x1c')]?_0x18fd82[_0xf005('0x1c')]['attributes']||null:null,'limit':_0x18fd82[_0xf005('0x1c')]?_0x18fd82[_0xf005('0x1c')][_0xf005('0x1e')]||null:null,'include':_0x18fd82['options']?_0x18fd82[_0xf005('0x1c')]['include']?_[_0xf005('0x1f')](_0x18fd82[_0xf005('0x1c')][_0xf005('0x20')],function(_0x1255c7){return{'model':db[_0x1255c7[_0xf005('0x21')]],'as':_0x1255c7['as'],'attributes':_0x1255c7[_0xf005('0x22')],'include':_0x1255c7[_0xf005('0x20')]?_[_0xf005('0x1f')](_0x1255c7[_0xf005('0x20')],function(_0x5b991e){return{'model':db[_0x5b991e[_0xf005('0x21')]],'as':_0x5b991e['as'],'attributes':_0x5b991e[_0xf005('0x22')],'include':_0x5b991e['include']?_[_0xf005('0x1f')](_0x5b991e[_0xf005('0x20')],function(_0x885534){return{'model':db[_0x885534[_0xf005('0x21')]],'as':_0x885534['as'],'attributes':_0x885534[_0xf005('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf005('0xf')](function(_0x35411b){logger[_0xf005('0x10')](_0xf005('0x1a'),_0x18fd82);logger[_0xf005('0x12')](_0xf005('0x1a'),_0x18fd82,JSON[_0xf005('0x13')](_0x35411b));_0x5b5f8a(_0x35411b);})[_0xf005('0x19')](function(_0x2328c3){logger[_0xf005('0x14')](_0xf005('0x1a'),_0x2328c3[_0xf005('0x17')],_0x18fd82);_0x1daa86(_0x7d5f5f[_0xf005('0x14')](0x1f4,_0x2328c3[_0xf005('0x17')]));});});};exports[_0xf005('0x23')]=function(_0x20c778){var _0x2d9402=this;return new Promise(function(_0x140c10,_0x742de1){return db[_0xf005('0x24')][_0xf005('0x25')]({'raw':_0x20c778[_0xf005('0x1c')]?_0x20c778[_0xf005('0x1c')][_0xf005('0x26')]===undefined?!![]:![]:!![],'where':_0x20c778[_0xf005('0x1c')]?_0x20c778[_0xf005('0x1c')][_0xf005('0x1d')]||null:null,'attributes':_0x20c778['options']?_0x20c778['options']['attributes']||null:null,'include':_0x20c778[_0xf005('0x1c')]?_0x20c778[_0xf005('0x1c')][_0xf005('0x20')]?_['map'](_0x20c778[_0xf005('0x1c')][_0xf005('0x20')],function(_0x5e536b){return{'model':db[_0x5e536b[_0xf005('0x21')]],'as':_0x5e536b['as'],'attributes':_0x5e536b[_0xf005('0x22')],'include':_0x5e536b[_0xf005('0x20')]?_['map'](_0x5e536b['include'],function(_0x4962c1){return{'model':db[_0x4962c1[_0xf005('0x21')]],'as':_0x4962c1['as'],'attributes':_0x4962c1[_0xf005('0x22')],'include':_0x4962c1[_0xf005('0x20')]?_[_0xf005('0x1f')](_0x4962c1[_0xf005('0x20')],function(_0x19d848){return{'model':db[_0x19d848[_0xf005('0x21')]],'as':_0x19d848['as'],'attributes':_0x19d848[_0xf005('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56f8eb){logger[_0xf005('0x10')](_0xf005('0x23'),_0x20c778);logger[_0xf005('0x12')](_0xf005('0x23'),_0x20c778,JSON['stringify'](_0x56f8eb));_0x140c10(_0x56f8eb);})[_0xf005('0x19')](function(_0xf8df1e){logger[_0xf005('0x14')]('ShowOpenchannelQueue',_0xf8df1e[_0xf005('0x17')],_0x20c778);_0x742de1(_0x2d9402[_0xf005('0x14')](0x1f4,_0xf8df1e[_0xf005('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 0b95d3f..a439b11 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 _0x782b=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x312484,_0x2605e6){var _0x5035e8=function(_0x5b4330){while(--_0x5b4330){_0x312484['push'](_0x312484['shift']());}};_0x5035e8(++_0x2605e6);}(_0x782b,0x1c0));var _0xb782=function(_0x56f14,_0x4c1ee2){_0x56f14=_0x56f14-0x0;var _0x429577=_0x782b[_0x56f14];return _0x429577;};'use strict';var OpenchannelQueueEvents=require(_0xb782('0x0'));var events=[_0xb782('0x1'),_0xb782('0x2'),_0xb782('0x3')];function createListener(_0x7aa85d,_0x42476b){return function(_0x33864a){_0x42476b[_0xb782('0x4')](_0x7aa85d,_0x33864a);};}function removeListener(_0x598ae7,_0x2bf406){return function(){OpenchannelQueueEvents[_0xb782('0x5')](_0x598ae7,_0x2bf406);};}exports[_0xb782('0x6')]=function(_0x320bb5){for(var _0x12ffa8=0x0,_0x405e11=events[_0xb782('0x7')];_0x12ffa8<_0x405e11;_0x12ffa8++){var _0x3f9eaa=events[_0x12ffa8];var _0x2a0229=createListener(_0xb782('0x8')+_0x3f9eaa,_0x320bb5);OpenchannelQueueEvents['on'](_0x3f9eaa,_0x2a0229);}}; \ No newline at end of file +var _0x76c7=['./openchannelQueue.events','save','update','emit','register'];(function(_0x12cffb,_0x346bc9){var _0x2ecd12=function(_0x5d9cb1){while(--_0x5d9cb1){_0x12cffb['push'](_0x12cffb['shift']());}};_0x2ecd12(++_0x346bc9);}(_0x76c7,0xf5));var _0x776c=function(_0x34fe71,_0x2ac7ed){_0x34fe71=_0x34fe71-0x0;var _0x433faa=_0x76c7[_0x34fe71];return _0x433faa;};'use strict';var OpenchannelQueueEvents=require(_0x776c('0x0'));var events=[_0x776c('0x1'),'remove',_0x776c('0x2')];function createListener(_0x4f57f7,_0xbdbec){return function(_0x4d5411){_0xbdbec[_0x776c('0x3')](_0x4f57f7,_0x4d5411);};}function removeListener(_0x799f3b,_0x2a752b){return function(){OpenchannelQueueEvents['removeListener'](_0x799f3b,_0x2a752b);};}exports[_0x776c('0x4')]=function(_0x5e5feb){for(var _0x3e57bc=0x0,_0x442809=events['length'];_0x3e57bc<_0x442809;_0x3e57bc++){var _0x53f825=events[_0x3e57bc];var _0x5367cc=createListener('openchannelQueue:'+_0x53f825,_0x5e5feb);OpenchannelQueueEvents['on'](_0x53f825,_0x5367cc);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 6b3af20..bfdf72c 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 _0x5fe2=['describe','create','/:id','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x4fc71e,_0x2abaef){var _0x20c873=function(_0x52c872){while(--_0x52c872){_0x4fc71e['push'](_0x4fc71e['shift']());}};_0x20c873(++_0x2abaef);}(_0x5fe2,0x146));var _0x25fe=function(_0x363f6e,_0xd48952){_0x363f6e=_0x363f6e-0x0;var _0x1e3f67=_0x5fe2[_0x363f6e];return _0x1e3f67;};'use strict';var multer=require('multer');var util=require(_0x25fe('0x0'));var path=require(_0x25fe('0x1'));var timeout=require(_0x25fe('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25fe('0x3'));var auth=require(_0x25fe('0x4'));var interaction=require(_0x25fe('0x5'));var config=require(_0x25fe('0x6'));var controller=require(_0x25fe('0x7'));router[_0x25fe('0x8')]('/',auth[_0x25fe('0x9')](),controller['index']);router[_0x25fe('0x8')]('/describe',auth[_0x25fe('0x9')](),controller[_0x25fe('0xa')]);router[_0x25fe('0x8')]('/:id',auth[_0x25fe('0x9')](),controller['show']);router['post']('/',auth[_0x25fe('0x9')](),controller[_0x25fe('0xb')]);router['put'](_0x25fe('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x25fe('0xd')](_0x25fe('0xc'),auth['isAuthenticated'](),controller[_0x25fe('0xe')]);module[_0x25fe('0xf')]=router; \ No newline at end of file +var _0x43a1=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0x43a1,0x133));var _0x143a=function(_0x399869,_0x11b444){_0x399869=_0x399869-0x0;var _0x4ff731=_0x43a1[_0x399869];return _0x4ff731;};'use strict';var multer=require('multer');var util=require(_0x143a('0x0'));var path=require(_0x143a('0x1'));var timeout=require(_0x143a('0x2'));var express=require(_0x143a('0x3'));var router=express[_0x143a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x143a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x143a('0x6'));router[_0x143a('0x7')]('/',auth[_0x143a('0x8')](),controller[_0x143a('0x9')]);router[_0x143a('0x7')](_0x143a('0xa'),auth[_0x143a('0x8')](),controller[_0x143a('0xb')]);router[_0x143a('0x7')](_0x143a('0xc'),auth[_0x143a('0x8')](),controller['show']);router[_0x143a('0xd')]('/',auth[_0x143a('0x8')](),controller[_0x143a('0xe')]);router[_0x143a('0xf')]('/:id',auth[_0x143a('0x8')](),controller[_0x143a('0x10')]);router[_0x143a('0x11')]('/:id',auth[_0x143a('0x8')](),controller[_0x143a('0x12')]);module[_0x143a('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 4aa6e7f..8968d35 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 _0xb986=['STRING','DATE','exports'];(function(_0x3fb166,_0x4eb985){var _0x5e91be=function(_0x53f4d9){while(--_0x53f4d9){_0x3fb166['push'](_0x3fb166['shift']());}};_0x5e91be(++_0x4eb985);}(_0xb986,0xc8));var _0x6b98=function(_0x142a92,_0x27407){_0x142a92=_0x142a92-0x0;var _0x530ad5=_0xb986[_0x142a92];return _0x530ad5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6b98('0x0')]={'uniqueid':{'type':Sequelize[_0x6b98('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6b98('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6b98('0x2')]},'acceptAt':{'type':Sequelize[_0x6b98('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x6b98('0x1')]}}; \ No newline at end of file +var _0x045f=['DATE','moment','sequelize','exports','STRING'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x045f,0x150));var _0xf045=function(_0x4a5635,_0x443b90){_0x4a5635=_0x4a5635-0x0;var _0x18d602=_0x045f[_0x4a5635];return _0x18d602;};'use strict';var moment=require(_0xf045('0x0'));var Sequelize=require(_0xf045('0x1'));module[_0xf045('0x2')]={'uniqueid':{'type':Sequelize[_0xf045('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf045('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf045('0x4')]},'acceptAt':{'type':Sequelize[_0xf045('0x4')]},'exitAt':{'type':Sequelize[_0xf045('0x4')]},'reason':{'type':Sequelize[_0xf045('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c38b3aa..a2b2e4e 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 _0x6409=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','error','name','send','map','OpenchannelQueueReport','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x6409,0x115));var _0x9640=function(_0x231766,_0x1401d3){_0x231766=_0x231766-0x0;var _0xf3b659=_0x6409[_0x231766];return _0xf3b659;};'use strict';var emlformat=require(_0x9640('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9640('0x1'));var jsonpatch=require(_0x9640('0x2'));var rp=require('request-promise');var moment=require(_0x9640('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9640('0x4'));var util=require(_0x9640('0x5'));var path=require(_0x9640('0x6'));var sox=require(_0x9640('0x7'));var csv=require('to-csv');var ejs=require(_0x9640('0x8'));var fs=require('fs');var fs_extra=require(_0x9640('0x9'));var _=require('lodash');var squel=require(_0x9640('0xa'));var crypto=require(_0x9640('0xb'));var jsforce=require(_0x9640('0xc'));var deskjs=require(_0x9640('0xd'));var toCsv=require(_0x9640('0xe'));var querystring=require(_0x9640('0xf'));var Papa=require(_0x9640('0x10'));var Redis=require(_0x9640('0x11'));var authService=require(_0x9640('0x12'));var qs=require(_0x9640('0x13'));var as=require(_0x9640('0x14'));var hardwareService=require(_0x9640('0x15'));var logger=require(_0x9640('0x16'))(_0x9640('0x17'));var utils=require(_0x9640('0x18'));var config=require(_0x9640('0x19'));var licenseUtil=require(_0x9640('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e40e,_0x27139e){_0x27139e=_0x27139e||0xcc;return function(_0x10a324){if(_0x10a324){return _0x48e40e['sendStatus'](_0x27139e);}return _0x48e40e[_0x9640('0x1b')](_0x27139e)[_0x9640('0x1c')]();};}function respondWithResult(_0x196f60,_0x83d5f5){_0x83d5f5=_0x83d5f5||0xc8;return function(_0x1bfc88){if(_0x1bfc88){return _0x196f60[_0x9640('0x1b')](_0x83d5f5)[_0x9640('0x1d')](_0x1bfc88);}};}function respondWithFilteredResult(_0x4380ec,_0x4f43c2){return function(_0x4b8c99){if(_0x4b8c99){var _0x558e38=typeof _0x4f43c2[_0x9640('0x1e')]===_0x9640('0x1f')&&typeof _0x4f43c2[_0x9640('0x20')]===_0x9640('0x1f');var _0x1a63cd=_0x4b8c99[_0x9640('0x21')];var _0x52a0f7=_0x558e38?0x0:_0x4f43c2[_0x9640('0x1e')];var _0x3302ed=_0x558e38?_0x4b8c99[_0x9640('0x21')]:_0x4f43c2[_0x9640('0x1e')]+_0x4f43c2[_0x9640('0x20')];var _0x102b27;if(_0x3302ed>=_0x1a63cd){_0x3302ed=_0x1a63cd;_0x102b27=0xc8;}else{_0x102b27=0xce;}_0x4380ec['status'](_0x102b27);return _0x4380ec['set'](_0x9640('0x22'),_0x52a0f7+'-'+_0x3302ed+'/'+_0x1a63cd)[_0x9640('0x1d')](_0x4b8c99);}return null;};}function patchUpdates(_0xaf9030){return function(_0x2b970b){try{jsonpatch['apply'](_0x2b970b,_0xaf9030,!![]);}catch(_0x1ec404){return BPromise['reject'](_0x1ec404);}return _0x2b970b[_0x9640('0x23')]();};}function saveUpdates(_0x329ed9,_0x3d92e4){return function(_0x2b5e86){if(_0x2b5e86){return _0x2b5e86[_0x9640('0x24')](_0x329ed9)[_0x9640('0x25')](function(_0x4997cb){return _0x4997cb;});}return null;};}function removeEntity(_0x5a3189,_0x10b6b0){return function(_0x1dfffd){if(_0x1dfffd){return _0x1dfffd['destroy']()['then'](function(){_0x5a3189[_0x9640('0x1b')](0xcc)[_0x9640('0x1c')]();});}};}function handleEntityNotFound(_0x2e7ac2,_0x56d942){return function(_0x2d45ca){if(!_0x2d45ca){_0x2e7ac2['sendStatus'](0x194);}return _0x2d45ca;};}function handleError(_0x4847a5,_0x994158){_0x994158=_0x994158||0x1f4;return function(_0x58e84f){logger[_0x9640('0x26')](_0x58e84f['stack']);if(_0x58e84f[_0x9640('0x27')]){delete _0x58e84f[_0x9640('0x27')];}_0x4847a5[_0x9640('0x1b')](_0x994158)[_0x9640('0x28')](_0x58e84f);};}exports['index']=function(_0x1be7e9,_0x1a29c1){var _0xf4e304={},_0x34583d={},_0x440e3={'count':0x0,'rows':[]};var _0x4fd2f1=_[_0x9640('0x29')](db[_0x9640('0x2a')]['rawAttributes'],function(_0x12c1a5){return{'name':_0x12c1a5['fieldName'],'type':_0x12c1a5['type'][_0x9640('0x2b')]};});_0x34583d['model']=_[_0x9640('0x29')](_0x4fd2f1,_0x9640('0x27'));_0x34583d[_0x9640('0x2c')]=_[_0x9640('0x2d')](_0x1be7e9['query']);_0x34583d[_0x9640('0x2e')]=_['intersection'](_0x34583d['model'],_0x34583d[_0x9640('0x2c')]);_0xf4e304['attributes']=_[_0x9640('0x2f')](_0x34583d[_0x9640('0x30')],qs[_0x9640('0x31')](_0x1be7e9['query'][_0x9640('0x31')]));_0xf4e304[_0x9640('0x32')]=_0xf4e304[_0x9640('0x32')][_0x9640('0x33')]?_0xf4e304[_0x9640('0x32')]:_0x34583d[_0x9640('0x30')];if(!_0x1be7e9['query'][_0x9640('0x34')](_0x9640('0x35'))){_0xf4e304[_0x9640('0x20')]=qs[_0x9640('0x20')](_0x1be7e9[_0x9640('0x2c')][_0x9640('0x20')]);_0xf4e304['offset']=qs['offset'](_0x1be7e9[_0x9640('0x2c')][_0x9640('0x1e')]);}_0xf4e304[_0x9640('0x36')]=qs[_0x9640('0x37')](_0x1be7e9[_0x9640('0x2c')][_0x9640('0x37')]);_0xf4e304[_0x9640('0x38')]=qs[_0x9640('0x2e')](_[_0x9640('0x39')](_0x1be7e9[_0x9640('0x2c')],_0x34583d[_0x9640('0x2e')]),_0x4fd2f1);if(_0x1be7e9[_0x9640('0x2c')][_0x9640('0x3a')]){_0xf4e304['where']=_['merge'](_0xf4e304[_0x9640('0x38')],{'$or':_[_0x9640('0x29')](_0x4fd2f1,function(_0x348ce0){if(_0x348ce0[_0x9640('0x3b')]!==_0x9640('0x3c')){var _0x4d4ee2={};_0x4d4ee2[_0x348ce0[_0x9640('0x27')]]={'$like':'%'+_0x1be7e9[_0x9640('0x2c')][_0x9640('0x3a')]+'%'};return _0x4d4ee2;}})});}_0xf4e304=_[_0x9640('0x3d')]({},_0xf4e304,_0x1be7e9[_0x9640('0x3e')]);var _0x5961b6={'where':_0xf4e304['where']};return db[_0x9640('0x2a')][_0x9640('0x21')](_0x5961b6)[_0x9640('0x25')](function(_0x2dbc55){_0x440e3[_0x9640('0x21')]=_0x2dbc55;if(_0x1be7e9[_0x9640('0x2c')][_0x9640('0x3f')]){_0xf4e304['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x9640('0x40')](_0xf4e304);})[_0x9640('0x25')](function(_0x27a41a){_0x440e3[_0x9640('0x41')]=_0x27a41a;return _0x440e3;})[_0x9640('0x25')](respondWithFilteredResult(_0x1a29c1,_0xf4e304))[_0x9640('0x42')](handleError(_0x1a29c1,null));};exports['show']=function(_0x1a224b,_0x1e3735){var _0x490897={'raw':!![],'where':{'id':_0x1a224b[_0x9640('0x43')]['id']}},_0x1f8b5b={};_0x1f8b5b[_0x9640('0x30')]=_[_0x9640('0x2d')](db[_0x9640('0x2a')][_0x9640('0x44')]);_0x1f8b5b[_0x9640('0x2c')]=_[_0x9640('0x2d')](_0x1a224b[_0x9640('0x2c')]);_0x1f8b5b[_0x9640('0x2e')]=_[_0x9640('0x2f')](_0x1f8b5b[_0x9640('0x30')],_0x1f8b5b[_0x9640('0x2c')]);_0x490897[_0x9640('0x32')]=_[_0x9640('0x2f')](_0x1f8b5b[_0x9640('0x30')],qs[_0x9640('0x31')](_0x1a224b[_0x9640('0x2c')]['fields']));_0x490897[_0x9640('0x32')]=_0x490897['attributes'][_0x9640('0x33')]?_0x490897['attributes']:_0x1f8b5b[_0x9640('0x30')];if(_0x1a224b[_0x9640('0x2c')]['includeAll']){_0x490897[_0x9640('0x45')]=[{'all':!![]}];}_0x490897=_[_0x9640('0x3d')]({},_0x490897,_0x1a224b[_0x9640('0x3e')]);return db[_0x9640('0x2a')][_0x9640('0x46')](_0x490897)[_0x9640('0x25')](handleEntityNotFound(_0x1e3735,null))['then'](respondWithResult(_0x1e3735,null))[_0x9640('0x42')](handleError(_0x1e3735,null));};exports['create']=function(_0x1e7fd2,_0x284338){return db[_0x9640('0x2a')][_0x9640('0x47')](_0x1e7fd2[_0x9640('0x48')],{})[_0x9640('0x25')](respondWithResult(_0x284338,0xc9))[_0x9640('0x42')](handleError(_0x284338,null));};exports[_0x9640('0x24')]=function(_0x3bbadb,_0x496edf){if(_0x3bbadb[_0x9640('0x48')]['id']){delete _0x3bbadb[_0x9640('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x9640('0x46')]({'where':{'id':_0x3bbadb[_0x9640('0x43')]['id']}})[_0x9640('0x25')](handleEntityNotFound(_0x496edf,null))[_0x9640('0x25')](saveUpdates(_0x3bbadb['body'],null))[_0x9640('0x25')](respondWithResult(_0x496edf,null))[_0x9640('0x42')](handleError(_0x496edf,null));};exports[_0x9640('0x49')]=function(_0x1285c7,_0x24c211){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x1285c7[_0x9640('0x43')]['id']}})['then'](handleEntityNotFound(_0x24c211,null))[_0x9640('0x25')](removeEntity(_0x24c211,null))[_0x9640('0x42')](handleError(_0x24c211,null));};exports[_0x9640('0x4a')]=function(_0x3c5cf4,_0x4424a5){return db[_0x9640('0x2a')][_0x9640('0x4a')]()[_0x9640('0x25')](respondWithResult(_0x4424a5,null))[_0x9640('0x42')](handleError(_0x4424a5,null));}; \ No newline at end of file +var _0x38cc=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','destroy','then','error','name','send','index','OpenchannelQueueReport','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','rimraf'];(function(_0x83400d,_0x46a7f7){var _0x5ca1d0=function(_0x6df0cf){while(--_0x6df0cf){_0x83400d['push'](_0x83400d['shift']());}};_0x5ca1d0(++_0x46a7f7);}(_0x38cc,0x89));var _0xc38c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38cc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc38c('0x0'));var zipdir=require(_0xc38c('0x1'));var jsonpatch=require(_0xc38c('0x2'));var rp=require(_0xc38c('0x3'));var moment=require('moment');var BPromise=require(_0xc38c('0x4'));var Mustache=require(_0xc38c('0x5'));var util=require('util');var path=require(_0xc38c('0x6'));var sox=require(_0xc38c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc38c('0x8'));var crypto=require('crypto');var jsforce=require(_0xc38c('0x9'));var deskjs=require(_0xc38c('0xa'));var toCsv=require(_0xc38c('0xb'));var querystring=require('querystring');var Papa=require(_0xc38c('0xc'));var Redis=require(_0xc38c('0xd'));var authService=require(_0xc38c('0xe'));var qs=require(_0xc38c('0xf'));var as=require(_0xc38c('0x10'));var hardwareService=require(_0xc38c('0x11'));var logger=require(_0xc38c('0x12'))('api');var utils=require(_0xc38c('0x13'));var config=require(_0xc38c('0x14'));var licenseUtil=require(_0xc38c('0x15'));var db=require(_0xc38c('0x16'))['db'];function respondWithStatusCode(_0x333a42,_0x23b99d){_0x23b99d=_0x23b99d||0xcc;return function(_0x3f7218){if(_0x3f7218){return _0x333a42[_0xc38c('0x17')](_0x23b99d);}return _0x333a42[_0xc38c('0x18')](_0x23b99d)[_0xc38c('0x19')]();};}function respondWithResult(_0x3096b3,_0x77a75e){_0x77a75e=_0x77a75e||0xc8;return function(_0x4df431){if(_0x4df431){return _0x3096b3[_0xc38c('0x18')](_0x77a75e)[_0xc38c('0x1a')](_0x4df431);}};}function respondWithFilteredResult(_0x337ee2,_0xda1302){return function(_0x4d204e){if(_0x4d204e){var _0x470b46=typeof _0xda1302[_0xc38c('0x1b')]===_0xc38c('0x1c')&&typeof _0xda1302[_0xc38c('0x1d')]===_0xc38c('0x1c');var _0x4a81b2=_0x4d204e['count'];var _0x195de8=_0x470b46?0x0:_0xda1302[_0xc38c('0x1b')];var _0x579f49=_0x470b46?_0x4d204e[_0xc38c('0x1e')]:_0xda1302['offset']+_0xda1302['limit'];var _0x58f814;if(_0x579f49>=_0x4a81b2){_0x579f49=_0x4a81b2;_0x58f814=0xc8;}else{_0x58f814=0xce;}_0x337ee2[_0xc38c('0x18')](_0x58f814);return _0x337ee2['set']('Content-Range',_0x195de8+'-'+_0x579f49+'/'+_0x4a81b2)[_0xc38c('0x1a')](_0x4d204e);}return null;};}function patchUpdates(_0xd923ab){return function(_0x41c421){try{jsonpatch[_0xc38c('0x1f')](_0x41c421,_0xd923ab,!![]);}catch(_0x52e287){return BPromise['reject'](_0x52e287);}return _0x41c421['save']();};}function saveUpdates(_0xa3fd35,_0x1390a6){return function(_0x31e450){if(_0x31e450){return _0x31e450[_0xc38c('0x20')](_0xa3fd35)['then'](function(_0x3491c7){return _0x3491c7;});}return null;};}function removeEntity(_0x49ffeb,_0x2ccdcd){return function(_0x1b71fb){if(_0x1b71fb){return _0x1b71fb[_0xc38c('0x21')]()[_0xc38c('0x22')](function(){_0x49ffeb['status'](0xcc)[_0xc38c('0x19')]();});}};}function handleEntityNotFound(_0x2c5701,_0x405d3c){return function(_0x368124){if(!_0x368124){_0x2c5701[_0xc38c('0x17')](0x194);}return _0x368124;};}function handleError(_0x120149,_0x39f3a8){_0x39f3a8=_0x39f3a8||0x1f4;return function(_0x34f8db){logger[_0xc38c('0x23')](_0x34f8db['stack']);if(_0x34f8db[_0xc38c('0x24')]){delete _0x34f8db['name'];}_0x120149[_0xc38c('0x18')](_0x39f3a8)[_0xc38c('0x25')](_0x34f8db);};}exports[_0xc38c('0x26')]=function(_0x47a56f,_0x12b9f8){var _0x55d0bd={},_0x35a1f5={},_0x142eb9={'count':0x0,'rows':[]};var _0x545f00=_['map'](db[_0xc38c('0x27')]['rawAttributes'],function(_0x18cfd7){return{'name':_0x18cfd7['fieldName'],'type':_0x18cfd7[_0xc38c('0x28')][_0xc38c('0x29')]};});_0x35a1f5[_0xc38c('0x2a')]=_[_0xc38c('0x2b')](_0x545f00,'name');_0x35a1f5[_0xc38c('0x2c')]=_[_0xc38c('0x2d')](_0x47a56f['query']);_0x35a1f5[_0xc38c('0x2e')]=_[_0xc38c('0x2f')](_0x35a1f5[_0xc38c('0x2a')],_0x35a1f5[_0xc38c('0x2c')]);_0x55d0bd[_0xc38c('0x30')]=_[_0xc38c('0x2f')](_0x35a1f5[_0xc38c('0x2a')],qs[_0xc38c('0x31')](_0x47a56f[_0xc38c('0x2c')]['fields']));_0x55d0bd[_0xc38c('0x30')]=_0x55d0bd['attributes'][_0xc38c('0x32')]?_0x55d0bd[_0xc38c('0x30')]:_0x35a1f5[_0xc38c('0x2a')];if(!_0x47a56f['query']['hasOwnProperty'](_0xc38c('0x33'))){_0x55d0bd[_0xc38c('0x1d')]=qs['limit'](_0x47a56f[_0xc38c('0x2c')]['limit']);_0x55d0bd['offset']=qs[_0xc38c('0x1b')](_0x47a56f[_0xc38c('0x2c')][_0xc38c('0x1b')]);}_0x55d0bd['order']=qs[_0xc38c('0x34')](_0x47a56f[_0xc38c('0x2c')][_0xc38c('0x34')]);_0x55d0bd[_0xc38c('0x35')]=qs['filters'](_[_0xc38c('0x36')](_0x47a56f[_0xc38c('0x2c')],_0x35a1f5[_0xc38c('0x2e')]),_0x545f00);if(_0x47a56f[_0xc38c('0x2c')]['filter']){_0x55d0bd[_0xc38c('0x35')]=_[_0xc38c('0x37')](_0x55d0bd[_0xc38c('0x35')],{'$or':_[_0xc38c('0x2b')](_0x545f00,function(_0x14bfbb){if(_0x14bfbb[_0xc38c('0x28')]!=='VIRTUAL'){var _0x57edb2={};_0x57edb2[_0x14bfbb['name']]={'$like':'%'+_0x47a56f[_0xc38c('0x2c')][_0xc38c('0x38')]+'%'};return _0x57edb2;}})});}_0x55d0bd=_['merge']({},_0x55d0bd,_0x47a56f[_0xc38c('0x39')]);var _0x351456={'where':_0x55d0bd['where']};return db[_0xc38c('0x27')][_0xc38c('0x1e')](_0x351456)['then'](function(_0x301ccf){_0x142eb9[_0xc38c('0x1e')]=_0x301ccf;if(_0x47a56f[_0xc38c('0x2c')][_0xc38c('0x3a')]){_0x55d0bd[_0xc38c('0x3b')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x55d0bd);})[_0xc38c('0x22')](function(_0x1f86b9){_0x142eb9[_0xc38c('0x3c')]=_0x1f86b9;return _0x142eb9;})['then'](respondWithFilteredResult(_0x12b9f8,_0x55d0bd))['catch'](handleError(_0x12b9f8,null));};exports[_0xc38c('0x3d')]=function(_0x57fb4a,_0x43dda9){var _0x349388={'raw':!![],'where':{'id':_0x57fb4a[_0xc38c('0x3e')]['id']}},_0xb37670={};_0xb37670[_0xc38c('0x2a')]=_['keys'](db['OpenchannelQueueReport'][_0xc38c('0x3f')]);_0xb37670[_0xc38c('0x2c')]=_[_0xc38c('0x2d')](_0x57fb4a[_0xc38c('0x2c')]);_0xb37670[_0xc38c('0x2e')]=_[_0xc38c('0x2f')](_0xb37670['model'],_0xb37670[_0xc38c('0x2c')]);_0x349388[_0xc38c('0x30')]=_['intersection'](_0xb37670['model'],qs['fields'](_0x57fb4a[_0xc38c('0x2c')][_0xc38c('0x31')]));_0x349388[_0xc38c('0x30')]=_0x349388[_0xc38c('0x30')][_0xc38c('0x32')]?_0x349388[_0xc38c('0x30')]:_0xb37670[_0xc38c('0x2a')];if(_0x57fb4a[_0xc38c('0x2c')][_0xc38c('0x3a')]){_0x349388['include']=[{'all':!![]}];}_0x349388=_[_0xc38c('0x37')]({},_0x349388,_0x57fb4a[_0xc38c('0x39')]);return db[_0xc38c('0x27')][_0xc38c('0x40')](_0x349388)['then'](handleEntityNotFound(_0x43dda9,null))[_0xc38c('0x22')](respondWithResult(_0x43dda9,null))[_0xc38c('0x41')](handleError(_0x43dda9,null));};exports[_0xc38c('0x42')]=function(_0x1c98e4,_0x2ea80a){return db[_0xc38c('0x27')][_0xc38c('0x42')](_0x1c98e4['body'],{})[_0xc38c('0x22')](respondWithResult(_0x2ea80a,0xc9))[_0xc38c('0x41')](handleError(_0x2ea80a,null));};exports[_0xc38c('0x20')]=function(_0x2095c5,_0x58f921){if(_0x2095c5[_0xc38c('0x43')]['id']){delete _0x2095c5[_0xc38c('0x43')]['id'];}return db['OpenchannelQueueReport'][_0xc38c('0x40')]({'where':{'id':_0x2095c5[_0xc38c('0x3e')]['id']}})[_0xc38c('0x22')](handleEntityNotFound(_0x58f921,null))[_0xc38c('0x22')](saveUpdates(_0x2095c5[_0xc38c('0x43')],null))[_0xc38c('0x22')](respondWithResult(_0x58f921,null))[_0xc38c('0x41')](handleError(_0x58f921,null));};exports[_0xc38c('0x21')]=function(_0x454724,_0x1b1ddf){return db[_0xc38c('0x27')][_0xc38c('0x40')]({'where':{'id':_0x454724['params']['id']}})[_0xc38c('0x22')](handleEntityNotFound(_0x1b1ddf,null))['then'](removeEntity(_0x1b1ddf,null))[_0xc38c('0x41')](handleError(_0x1b1ddf,null));};exports[_0xc38c('0x44')]=function(_0x229e76,_0x53bc6e){return db[_0xc38c('0x27')][_0xc38c('0x44')]()[_0xc38c('0x22')](respondWithResult(_0x53bc6e,null))[_0xc38c('0x41')](handleError(_0x53bc6e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index d4b1984..523a9f2 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x16cbd6,_0x3b017d){var _0x4e9de0=function(_0x294b60){while(--_0x294b60){_0x16cbd6['push'](_0x16cbd6['shift']());}};_0x4e9de0(++_0x3b017d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x18e0ea,_0x495cc7){var _0x464b50=function(_0x7497ea){while(--_0x7497ea){_0x18e0ea['push'](_0x18e0ea['shift']());}};_0x464b50(++_0x495cc7);}(_0x7a54,0x106));var _0x47a5=function(_0x23882b,_0x3bc0c2){_0x23882b=_0x23882b-0x0;var _0x1a3666=_0x7a54[_0x23882b];return _0x1a3666;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index e5c60fd..001b0ac 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 _0x09df=['info','request\x20sent','debug','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','catch','UpdateOpenchannelQueueReport','update','raw','where','limit','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','request','then'];(function(_0x590117,_0x1ee43c){var _0x3efc84=function(_0x5cf061){while(--_0x5cf061){_0x590117['push'](_0x590117['shift']());}};_0x3efc84(++_0x1ee43c);}(_0x09df,0x164));var _0xf09d=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x09df[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}exports[_0xf09d('0xf')]=function(_0x57e3f8){var _0x38083e=this;return new Promise(function(_0xc4b380,_0x106fb0){return db[_0xf09d('0x10')][_0xf09d('0x11')](_0x57e3f8[_0xf09d('0x12')],{'raw':_0x57e3f8['options']?_0x57e3f8[_0xf09d('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xf09d('0x7')](function(_0x342e14){logger[_0xf09d('0x8')](_0xf09d('0xf'),_0x57e3f8);logger[_0xf09d('0xa')](_0xf09d('0xf'),_0x57e3f8,JSON['stringify'](_0x342e14));_0xc4b380(_0x342e14);})[_0xf09d('0x14')](function(_0x2ab436){logger[_0xf09d('0xb')](_0xf09d('0xf'),_0x2ab436[_0xf09d('0xe')],_0x57e3f8);_0x106fb0(_0x38083e[_0xf09d('0xb')](0x1f4,_0x2ab436[_0xf09d('0xe')]));});});};exports[_0xf09d('0x15')]=function(_0x507484){var _0x394934=this;return new Promise(function(_0x59f232,_0x383ff6){return db['OpenchannelQueueReport'][_0xf09d('0x16')](_0x507484[_0xf09d('0x12')],{'raw':_0x507484[_0xf09d('0x13')]?_0x507484[_0xf09d('0x13')][_0xf09d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507484[_0xf09d('0x13')]?_0x507484['options'][_0xf09d('0x18')]||null:null,'attributes':_0x507484[_0xf09d('0x13')]?_0x507484[_0xf09d('0x13')]['attributes']||null:null,'limit':_0x507484['options']?_0x507484['options'][_0xf09d('0x19')]||null:null})[_0xf09d('0x7')](function(_0x28eb98){logger[_0xf09d('0x8')](_0xf09d('0x15'),_0x507484);logger[_0xf09d('0xa')](_0xf09d('0x15'),_0x507484,JSON['stringify'](_0x28eb98));_0x59f232(_0x28eb98);})[_0xf09d('0x14')](function(_0x4b20f5){logger['error'](_0xf09d('0x15'),_0x4b20f5[_0xf09d('0xe')],_0x507484);_0x383ff6(_0x394934['error'](0x1f4,_0x4b20f5[_0xf09d('0xe')]));});});}; \ No newline at end of file +var _0x2ace=['result','CreateOpenchannelQueueReport','body','options','raw','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x1addbd,_0x4d2a35){var _0x3b3fd6=function(_0xd6e309){while(--_0xd6e309){_0x1addbd['push'](_0x1addbd['shift']());}};_0x3b3fd6(++_0x4d2a35);}(_0x2ace,0x17e));var _0xe2ac=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0x2ace[_0x32358b];return _0x58c21d;};'use strict';var _=require('lodash');var util=require(_0xe2ac('0x0'));var moment=require(_0xe2ac('0x1'));var BPromise=require(_0xe2ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2ac('0x3'));var db=require(_0xe2ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2ac('0x5'))(_0xe2ac('0x6'));var config=require(_0xe2ac('0x7'));var jayson=require(_0xe2ac('0x8'));var client=jayson[_0xe2ac('0x9')][_0xe2ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f1f8c,_0x391f96,_0x8e831b){return new BPromise(function(_0x28d0d1,_0x4064f9){return client[_0xe2ac('0xb')](_0x2f1f8c,_0x8e831b)[_0xe2ac('0xc')](function(_0x4fb111){logger['info'](_0xe2ac('0xd'),_0x391f96,'request\x20sent');logger[_0xe2ac('0xe')](_0xe2ac('0xf'),_0x391f96,'request\x20sent',JSON[_0xe2ac('0x10')](_0x4fb111));if(_0x4fb111[_0xe2ac('0x11')]){if(_0x4fb111[_0xe2ac('0x11')]['code']===0x1f4){logger[_0xe2ac('0x11')](_0xe2ac('0xd'),_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x4064f9(_0x4fb111[_0xe2ac('0x11')]['message']);}logger[_0xe2ac('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x28d0d1(_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);}else{logger[_0xe2ac('0x13')](_0xe2ac('0xd'),_0x391f96,_0xe2ac('0x14'));_0x28d0d1(_0x4fb111[_0xe2ac('0x15')][_0xe2ac('0x12')]);}})['catch'](function(_0x557ef6){logger[_0xe2ac('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x391f96,_0x557ef6);_0x4064f9(_0x557ef6);});});}exports[_0xe2ac('0x16')]=function(_0x3c8999){var _0x2aad2a=this;return new Promise(function(_0x2f5d32,_0x5000ba){return db['OpenchannelQueueReport']['create'](_0x3c8999[_0xe2ac('0x17')],{'raw':_0x3c8999[_0xe2ac('0x18')]?_0x3c8999[_0xe2ac('0x18')][_0xe2ac('0x19')]===undefined?!![]:![]:!![]})[_0xe2ac('0xc')](function(_0x279a90){logger['info']('CreateOpenchannelQueueReport',_0x3c8999);logger[_0xe2ac('0xe')]('CreateOpenchannelQueueReport',_0x3c8999,JSON[_0xe2ac('0x10')](_0x279a90));_0x2f5d32(_0x279a90);})[_0xe2ac('0x1a')](function(_0x2083b3){logger[_0xe2ac('0x11')](_0xe2ac('0x16'),_0x2083b3[_0xe2ac('0x12')],_0x3c8999);_0x5000ba(_0x2aad2a[_0xe2ac('0x11')](0x1f4,_0x2083b3[_0xe2ac('0x12')]));});});};exports[_0xe2ac('0x1b')]=function(_0x4e7597){var _0x5e27eb=this;return new Promise(function(_0x2f6220,_0x4c9981){return db[_0xe2ac('0x1c')][_0xe2ac('0x1d')](_0x4e7597['body'],{'raw':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597['options'][_0xe2ac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597[_0xe2ac('0x18')]['where']||null:null,'attributes':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597[_0xe2ac('0x18')]['attributes']||null:null,'limit':_0x4e7597['options']?_0x4e7597[_0xe2ac('0x18')][_0xe2ac('0x1e')]||null:null})[_0xe2ac('0xc')](function(_0x23bef4){logger['info'](_0xe2ac('0x1b'),_0x4e7597);logger['debug'](_0xe2ac('0x1b'),_0x4e7597,JSON[_0xe2ac('0x10')](_0x23bef4));_0x2f6220(_0x23bef4);})[_0xe2ac('0x1a')](function(_0xbc6eed){logger[_0xe2ac('0x11')](_0xe2ac('0x1b'),_0xbc6eed['message'],_0x4e7597);_0x4c9981(_0x5e27eb[_0xe2ac('0x11')](0x1f4,_0xbc6eed['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 21858ab..ca59c0f 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 _0xa49c=['connect-timeout','Router','fs-extra','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','show','post','create','delete','/:id','destroy','exports','path'];(function(_0x3f54ce,_0x46f954){var _0x3ec189=function(_0x5cebbb){while(--_0x5cebbb){_0x3f54ce['push'](_0x3f54ce['shift']());}};_0x3ec189(++_0x46f954);}(_0xa49c,0x14f));var _0xca49=function(_0x174e6b,_0x124a26){_0x174e6b=_0x174e6b-0x0;var _0x10ab0e=_0xa49c[_0x174e6b];return _0x10ab0e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xca49('0x0'));var timeout=require(_0xca49('0x1'));var express=require('express');var router=express[_0xca49('0x2')]();var fs_extra=require(_0xca49('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xca49('0x4'));var controller=require(_0xca49('0x5'));router[_0xca49('0x6')]('/',auth[_0xca49('0x7')](),controller['index']);router[_0xca49('0x6')]('/describe',auth[_0xca49('0x7')](),controller[_0xca49('0x8')]);router[_0xca49('0x6')]('/:id',auth[_0xca49('0x7')](),controller[_0xca49('0x9')]);router[_0xca49('0xa')]('/',auth[_0xca49('0x7')](),controller[_0xca49('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xca49('0xc')](_0xca49('0xd'),auth[_0xca49('0x7')](),controller[_0xca49('0xe')]);module[_0xca49('0xf')]=router; \ No newline at end of file +var _0xb55b=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','util','path'];(function(_0x205995,_0x15792d){var _0x1603f3=function(_0x2bcd90){while(--_0x2bcd90){_0x205995['push'](_0x205995['shift']());}};_0x1603f3(++_0x15792d);}(_0xb55b,0x18d));var _0xbb55=function(_0x5891a9,_0x287078){_0x5891a9=_0x5891a9-0x0;var _0xd8362d=_0xb55b[_0x5891a9];return _0xd8362d;};'use strict';var multer=require('multer');var util=require(_0xbb55('0x0'));var path=require(_0xbb55('0x1'));var timeout=require(_0xbb55('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbb55('0x3'));var auth=require(_0xbb55('0x4'));var interaction=require(_0xbb55('0x5'));var config=require(_0xbb55('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0xbb55('0x7')]('/',auth[_0xbb55('0x8')](),controller[_0xbb55('0x9')]);router[_0xbb55('0x7')](_0xbb55('0xa'),auth[_0xbb55('0x8')](),controller[_0xbb55('0xb')]);router['get'](_0xbb55('0xc'),auth['isAuthenticated'](),controller[_0xbb55('0xd')]);router['post']('/',auth[_0xbb55('0x8')](),controller[_0xbb55('0xe')]);router[_0xbb55('0xf')]('/:id',auth[_0xbb55('0x8')](),controller[_0xbb55('0x10')]);router[_0xbb55('0x11')]('/:id',auth[_0xbb55('0x8')](),controller[_0xbb55('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 5bb1aa9..d385af5 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x270323,_0x72160){var _0x48a027=function(_0x4cb12e){while(--_0x4cb12e){_0x270323['push'](_0x270323['shift']());}};_0x48a027(++_0x72160);}(_0x34e8,0x12c));var _0x834e=function(_0x27b5c7,_0x472c26){_0x27b5c7=_0x27b5c7-0x0;var _0x3f7be9=_0x34e8[_0x27b5c7];return _0x3f7be9;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x26f721,_0xffbe6c){var _0x58aa4c=function(_0x767280){while(--_0x767280){_0x26f721['push'](_0x26f721['shift']());}};_0x58aa4c(++_0xffbe6c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6407430..d46c84e 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 _0x546e=['status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x546e,0x79));var _0xe546=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x546e[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require(_0xe546('0x0'));var rimraf=require(_0xe546('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe546('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe546('0x3'));var Mustache=require(_0xe546('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe546('0x5'));var csv=require(_0xe546('0x6'));var ejs=require(_0xe546('0x7'));var fs=require('fs');var fs_extra=require(_0xe546('0x8'));var _=require(_0xe546('0x9'));var squel=require(_0xe546('0xa'));var crypto=require(_0xe546('0xb'));var jsforce=require(_0xe546('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe546('0x6'));var querystring=require(_0xe546('0xd'));var Papa=require('papaparse');var Redis=require(_0xe546('0xe'));var authService=require(_0xe546('0xf'));var qs=require(_0xe546('0x10'));var as=require(_0xe546('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe546('0x12'))(_0xe546('0x13'));var utils=require('../../config/utils');var config=require(_0xe546('0x14'));var licenseUtil=require(_0xe546('0x15'));var db=require(_0xe546('0x16'))['db'];function respondWithStatusCode(_0x3a283f,_0x1556e8){_0x1556e8=_0x1556e8||0xcc;return function(_0x367b65){if(_0x367b65){return _0x3a283f[_0xe546('0x17')](_0x1556e8);}return _0x3a283f['status'](_0x1556e8)[_0xe546('0x18')]();};}function respondWithResult(_0x6001f8,_0x35c8c7){_0x35c8c7=_0x35c8c7||0xc8;return function(_0x272bca){if(_0x272bca){return _0x6001f8[_0xe546('0x19')](_0x35c8c7)['json'](_0x272bca);}};}function respondWithFilteredResult(_0x3c8414,_0x164ec2){return function(_0x49098f){if(_0x49098f){var _0x479913=typeof _0x164ec2[_0xe546('0x1a')]===_0xe546('0x1b')&&typeof _0x164ec2[_0xe546('0x1c')]==='undefined';var _0x196e54=_0x49098f[_0xe546('0x1d')];var _0x46fcf0=_0x479913?0x0:_0x164ec2[_0xe546('0x1a')];var _0x5af104=_0x479913?_0x49098f[_0xe546('0x1d')]:_0x164ec2[_0xe546('0x1a')]+_0x164ec2[_0xe546('0x1c')];var _0x4c3602;if(_0x5af104>=_0x196e54){_0x5af104=_0x196e54;_0x4c3602=0xc8;}else{_0x4c3602=0xce;}_0x3c8414[_0xe546('0x19')](_0x4c3602);return _0x3c8414['set'](_0xe546('0x1e'),_0x46fcf0+'-'+_0x5af104+'/'+_0x196e54)[_0xe546('0x1f')](_0x49098f);}return null;};}function patchUpdates(_0x471b48){return function(_0x4d7d0b){try{jsonpatch[_0xe546('0x20')](_0x4d7d0b,_0x471b48,!![]);}catch(_0x19f0a2){return BPromise[_0xe546('0x21')](_0x19f0a2);}return _0x4d7d0b[_0xe546('0x22')]();};}function saveUpdates(_0x3ff573,_0x911025){return function(_0x528163){if(_0x528163){return _0x528163[_0xe546('0x23')](_0x3ff573)[_0xe546('0x24')](function(_0x3b15e5){return _0x3b15e5;});}return null;};}function removeEntity(_0x20fbc2,_0x42d956){return function(_0x5ecf1a){if(_0x5ecf1a){return _0x5ecf1a[_0xe546('0x25')]()[_0xe546('0x24')](function(){_0x20fbc2[_0xe546('0x19')](0xcc)[_0xe546('0x18')]();});}};}function handleEntityNotFound(_0x300908,_0x1fb0b7){return function(_0x47e4b6){if(!_0x47e4b6){_0x300908[_0xe546('0x17')](0x194);}return _0x47e4b6;};}function handleError(_0x1945d9,_0x7196a9){_0x7196a9=_0x7196a9||0x1f4;return function(_0x594139){logger[_0xe546('0x26')](_0x594139[_0xe546('0x27')]);if(_0x594139[_0xe546('0x28')]){delete _0x594139[_0xe546('0x28')];}_0x1945d9[_0xe546('0x19')](_0x7196a9)[_0xe546('0x29')](_0x594139);};}exports[_0xe546('0x2a')]=function(_0x2d6ebb,_0x2f4542){var _0x2c3df9={},_0x43ccf9={},_0x282a68={'count':0x0,'rows':[]};var _0x4b8297=_['map'](db[_0xe546('0x2b')][_0xe546('0x2c')],function(_0x3dff71){return{'name':_0x3dff71[_0xe546('0x2d')],'type':_0x3dff71[_0xe546('0x2e')]['key']};});_0x43ccf9['model']=_['map'](_0x4b8297,_0xe546('0x28'));_0x43ccf9[_0xe546('0x2f')]=_[_0xe546('0x30')](_0x2d6ebb[_0xe546('0x2f')]);_0x43ccf9[_0xe546('0x31')]=_[_0xe546('0x32')](_0x43ccf9[_0xe546('0x33')],_0x43ccf9[_0xe546('0x2f')]);_0x2c3df9[_0xe546('0x34')]=_['intersection'](_0x43ccf9[_0xe546('0x33')],qs['fields'](_0x2d6ebb['query'][_0xe546('0x35')]));_0x2c3df9[_0xe546('0x34')]=_0x2c3df9['attributes'][_0xe546('0x36')]?_0x2c3df9[_0xe546('0x34')]:_0x43ccf9[_0xe546('0x33')];if(!_0x2d6ebb[_0xe546('0x2f')][_0xe546('0x37')](_0xe546('0x38'))){_0x2c3df9[_0xe546('0x1c')]=qs[_0xe546('0x1c')](_0x2d6ebb[_0xe546('0x2f')]['limit']);_0x2c3df9['offset']=qs[_0xe546('0x1a')](_0x2d6ebb['query'][_0xe546('0x1a')]);}_0x2c3df9['order']=qs[_0xe546('0x39')](_0x2d6ebb['query'][_0xe546('0x39')]);_0x2c3df9[_0xe546('0x3a')]=qs[_0xe546('0x31')](_['pick'](_0x2d6ebb[_0xe546('0x2f')],_0x43ccf9[_0xe546('0x31')]),_0x4b8297);if(_0x2d6ebb[_0xe546('0x2f')]['filter']){_0x2c3df9[_0xe546('0x3a')]=_[_0xe546('0x3b')](_0x2c3df9[_0xe546('0x3a')],{'$or':_['map'](_0x4b8297,function(_0x39b449){if(_0x39b449['type']!==_0xe546('0x3c')){var _0x15b840={};_0x15b840[_0x39b449[_0xe546('0x28')]]={'$like':'%'+_0x2d6ebb[_0xe546('0x2f')][_0xe546('0x3d')]+'%'};return _0x15b840;}})});}_0x2c3df9=_[_0xe546('0x3b')]({},_0x2c3df9,_0x2d6ebb[_0xe546('0x3e')]);var _0xa18551={'where':_0x2c3df9['where']};return db[_0xe546('0x2b')][_0xe546('0x1d')](_0xa18551)[_0xe546('0x24')](function(_0x115921){_0x282a68[_0xe546('0x1d')]=_0x115921;if(_0x2d6ebb[_0xe546('0x2f')]['includeAll']){_0x2c3df9[_0xe546('0x3f')]=[{'all':!![]}];}return db[_0xe546('0x2b')]['findAll'](_0x2c3df9);})[_0xe546('0x24')](function(_0x51e1ab){_0x282a68[_0xe546('0x40')]=_0x51e1ab;return _0x282a68;})[_0xe546('0x24')](respondWithFilteredResult(_0x2f4542,_0x2c3df9))[_0xe546('0x41')](handleError(_0x2f4542,null));};exports[_0xe546('0x42')]=function(_0x31cd05,_0x4405aa){var _0x2262bc={'raw':!![],'where':{'id':_0x31cd05[_0xe546('0x43')]['id']}},_0xadcf9d={};_0xadcf9d[_0xe546('0x33')]=_[_0xe546('0x30')](db[_0xe546('0x2b')][_0xe546('0x2c')]);_0xadcf9d[_0xe546('0x2f')]=_[_0xe546('0x30')](_0x31cd05['query']);_0xadcf9d['filters']=_[_0xe546('0x32')](_0xadcf9d[_0xe546('0x33')],_0xadcf9d[_0xe546('0x2f')]);_0x2262bc[_0xe546('0x34')]=_['intersection'](_0xadcf9d[_0xe546('0x33')],qs[_0xe546('0x35')](_0x31cd05[_0xe546('0x2f')][_0xe546('0x35')]));_0x2262bc[_0xe546('0x34')]=_0x2262bc[_0xe546('0x34')][_0xe546('0x36')]?_0x2262bc[_0xe546('0x34')]:_0xadcf9d[_0xe546('0x33')];if(_0x31cd05[_0xe546('0x2f')][_0xe546('0x44')]){_0x2262bc['include']=[{'all':!![]}];}_0x2262bc=_[_0xe546('0x3b')]({},_0x2262bc,_0x31cd05[_0xe546('0x3e')]);return db[_0xe546('0x2b')]['find'](_0x2262bc)[_0xe546('0x24')](handleEntityNotFound(_0x4405aa,null))[_0xe546('0x24')](respondWithResult(_0x4405aa,null))[_0xe546('0x41')](handleError(_0x4405aa,null));};exports[_0xe546('0x45')]=function(_0x12721a,_0x337861){return db[_0xe546('0x2b')][_0xe546('0x45')](_0x12721a['body'],{})[_0xe546('0x24')](respondWithResult(_0x337861,0xc9))[_0xe546('0x41')](handleError(_0x337861,null));};exports[_0xe546('0x23')]=function(_0x329bcb,_0x285c85){if(_0x329bcb[_0xe546('0x46')]['id']){delete _0x329bcb[_0xe546('0x46')]['id'];}return db[_0xe546('0x2b')]['find']({'where':{'id':_0x329bcb[_0xe546('0x43')]['id']}})[_0xe546('0x24')](handleEntityNotFound(_0x285c85,null))['then'](saveUpdates(_0x329bcb['body'],null))['then'](respondWithResult(_0x285c85,null))[_0xe546('0x41')](handleError(_0x285c85,null));};exports[_0xe546('0x25')]=function(_0x5ed2a5,_0x2c2a6d){return db[_0xe546('0x2b')][_0xe546('0x47')]({'where':{'id':_0x5ed2a5[_0xe546('0x43')]['id']}})[_0xe546('0x24')](handleEntityNotFound(_0x2c2a6d,null))[_0xe546('0x24')](removeEntity(_0x2c2a6d,null))[_0xe546('0x41')](handleError(_0x2c2a6d,null));};exports[_0xe546('0x48')]=function(_0x8c04d7,_0x2c1864){return db['OpenchannelTransferReport'][_0xe546('0x48')]()[_0xe546('0x24')](respondWithResult(_0x2c1864,null))[_0xe546('0x41')](handleError(_0x2c1864,null));}; \ No newline at end of file +var _0x0538=['VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','catch','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','stack','name','send','map','OpenchannelTransferReport','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x3e3043,_0x456031){var _0x1dc2df=function(_0x317a33){while(--_0x317a33){_0x3e3043['push'](_0x3e3043['shift']());}};_0x1dc2df(++_0x456031);}(_0x0538,0x1d8));var _0x8053=function(_0x2a7c2a,_0x37cc9e){_0x2a7c2a=_0x2a7c2a-0x0;var _0x195732=_0x0538[_0x2a7c2a];return _0x195732;};'use strict';var emlformat=require(_0x8053('0x0'));var rimraf=require(_0x8053('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8053('0x2'));var rp=require(_0x8053('0x3'));var moment=require(_0x8053('0x4'));var BPromise=require(_0x8053('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8053('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8053('0x7'));var _=require(_0x8053('0x8'));var squel=require(_0x8053('0x9'));var crypto=require(_0x8053('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8053('0xb'));var toCsv=require(_0x8053('0xc'));var querystring=require('querystring');var Papa=require(_0x8053('0xd'));var Redis=require(_0x8053('0xe'));var authService=require(_0x8053('0xf'));var qs=require(_0x8053('0x10'));var as=require(_0x8053('0x11'));var hardwareService=require(_0x8053('0x12'));var logger=require(_0x8053('0x13'))(_0x8053('0x14'));var utils=require(_0x8053('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8053('0x16'));var db=require(_0x8053('0x17'))['db'];function respondWithStatusCode(_0x43855b,_0x2e8773){_0x2e8773=_0x2e8773||0xcc;return function(_0x2a96b0){if(_0x2a96b0){return _0x43855b[_0x8053('0x18')](_0x2e8773);}return _0x43855b[_0x8053('0x19')](_0x2e8773)[_0x8053('0x1a')]();};}function respondWithResult(_0x1add64,_0x1d6e92){_0x1d6e92=_0x1d6e92||0xc8;return function(_0x3a29c0){if(_0x3a29c0){return _0x1add64[_0x8053('0x19')](_0x1d6e92)[_0x8053('0x1b')](_0x3a29c0);}};}function respondWithFilteredResult(_0x1ab66c,_0x3383a9){return function(_0x2219e9){if(_0x2219e9){var _0xb80e6c=typeof _0x3383a9[_0x8053('0x1c')]===_0x8053('0x1d')&&typeof _0x3383a9['limit']==='undefined';var _0x2b9755=_0x2219e9[_0x8053('0x1e')];var _0x46460d=_0xb80e6c?0x0:_0x3383a9[_0x8053('0x1c')];var _0xeee46f=_0xb80e6c?_0x2219e9['count']:_0x3383a9['offset']+_0x3383a9[_0x8053('0x1f')];var _0x3c48d5;if(_0xeee46f>=_0x2b9755){_0xeee46f=_0x2b9755;_0x3c48d5=0xc8;}else{_0x3c48d5=0xce;}_0x1ab66c[_0x8053('0x19')](_0x3c48d5);return _0x1ab66c[_0x8053('0x20')](_0x8053('0x21'),_0x46460d+'-'+_0xeee46f+'/'+_0x2b9755)['json'](_0x2219e9);}return null;};}function patchUpdates(_0x4c8fa6){return function(_0x3d1eb2){try{jsonpatch['apply'](_0x3d1eb2,_0x4c8fa6,!![]);}catch(_0x944b8f){return BPromise[_0x8053('0x22')](_0x944b8f);}return _0x3d1eb2[_0x8053('0x23')]();};}function saveUpdates(_0x33507a,_0x522927){return function(_0x2f1fac){if(_0x2f1fac){return _0x2f1fac[_0x8053('0x24')](_0x33507a)[_0x8053('0x25')](function(_0x180357){return _0x180357;});}return null;};}function removeEntity(_0x3746dd,_0x227092){return function(_0x346ac8){if(_0x346ac8){return _0x346ac8['destroy']()['then'](function(){_0x3746dd[_0x8053('0x19')](0xcc)[_0x8053('0x1a')]();});}};}function handleEntityNotFound(_0x17688b,_0x35460a){return function(_0x224d17){if(!_0x224d17){_0x17688b[_0x8053('0x18')](0x194);}return _0x224d17;};}function handleError(_0x32a9b7,_0x11f376){_0x11f376=_0x11f376||0x1f4;return function(_0x42bcc8){logger['error'](_0x42bcc8[_0x8053('0x26')]);if(_0x42bcc8[_0x8053('0x27')]){delete _0x42bcc8[_0x8053('0x27')];}_0x32a9b7[_0x8053('0x19')](_0x11f376)[_0x8053('0x28')](_0x42bcc8);};}exports['index']=function(_0x570f9d,_0x52dc82){var _0x2f0a74={},_0x434302={},_0x40913c={'count':0x0,'rows':[]};var _0x4c7c2c=_[_0x8053('0x29')](db[_0x8053('0x2a')]['rawAttributes'],function(_0x3a9f01){return{'name':_0x3a9f01[_0x8053('0x2b')],'type':_0x3a9f01[_0x8053('0x2c')][_0x8053('0x2d')]};});_0x434302['model']=_[_0x8053('0x29')](_0x4c7c2c,'name');_0x434302[_0x8053('0x2e')]=_[_0x8053('0x2f')](_0x570f9d[_0x8053('0x2e')]);_0x434302[_0x8053('0x30')]=_['intersection'](_0x434302[_0x8053('0x31')],_0x434302['query']);_0x2f0a74['attributes']=_[_0x8053('0x32')](_0x434302['model'],qs[_0x8053('0x33')](_0x570f9d[_0x8053('0x2e')][_0x8053('0x33')]));_0x2f0a74[_0x8053('0x34')]=_0x2f0a74[_0x8053('0x34')][_0x8053('0x35')]?_0x2f0a74[_0x8053('0x34')]:_0x434302[_0x8053('0x31')];if(!_0x570f9d[_0x8053('0x2e')][_0x8053('0x36')](_0x8053('0x37'))){_0x2f0a74[_0x8053('0x1f')]=qs[_0x8053('0x1f')](_0x570f9d[_0x8053('0x2e')][_0x8053('0x1f')]);_0x2f0a74[_0x8053('0x1c')]=qs['offset'](_0x570f9d[_0x8053('0x2e')]['offset']);}_0x2f0a74[_0x8053('0x38')]=qs[_0x8053('0x39')](_0x570f9d[_0x8053('0x2e')][_0x8053('0x39')]);_0x2f0a74[_0x8053('0x3a')]=qs[_0x8053('0x30')](_['pick'](_0x570f9d[_0x8053('0x2e')],_0x434302['filters']),_0x4c7c2c);if(_0x570f9d[_0x8053('0x2e')][_0x8053('0x3b')]){_0x2f0a74[_0x8053('0x3a')]=_['merge'](_0x2f0a74[_0x8053('0x3a')],{'$or':_[_0x8053('0x29')](_0x4c7c2c,function(_0x5371dd){if(_0x5371dd[_0x8053('0x2c')]!==_0x8053('0x3c')){var _0x276adc={};_0x276adc[_0x5371dd['name']]={'$like':'%'+_0x570f9d[_0x8053('0x2e')]['filter']+'%'};return _0x276adc;}})});}_0x2f0a74=_[_0x8053('0x3d')]({},_0x2f0a74,_0x570f9d[_0x8053('0x3e')]);var _0x2b01b1={'where':_0x2f0a74[_0x8053('0x3a')]};return db[_0x8053('0x2a')][_0x8053('0x1e')](_0x2b01b1)[_0x8053('0x25')](function(_0x4ecca8){_0x40913c[_0x8053('0x1e')]=_0x4ecca8;if(_0x570f9d[_0x8053('0x2e')][_0x8053('0x3f')]){_0x2f0a74[_0x8053('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x8053('0x41')](_0x2f0a74);})[_0x8053('0x25')](function(_0x5c5933){_0x40913c[_0x8053('0x42')]=_0x5c5933;return _0x40913c;})[_0x8053('0x25')](respondWithFilteredResult(_0x52dc82,_0x2f0a74))['catch'](handleError(_0x52dc82,null));};exports[_0x8053('0x43')]=function(_0x47c393,_0x22eea7){var _0x751565={'raw':!![],'where':{'id':_0x47c393['params']['id']}},_0x41c4c0={};_0x41c4c0[_0x8053('0x31')]=_['keys'](db['OpenchannelTransferReport'][_0x8053('0x44')]);_0x41c4c0['query']=_['keys'](_0x47c393[_0x8053('0x2e')]);_0x41c4c0[_0x8053('0x30')]=_[_0x8053('0x32')](_0x41c4c0[_0x8053('0x31')],_0x41c4c0[_0x8053('0x2e')]);_0x751565[_0x8053('0x34')]=_['intersection'](_0x41c4c0['model'],qs['fields'](_0x47c393[_0x8053('0x2e')][_0x8053('0x33')]));_0x751565['attributes']=_0x751565['attributes'][_0x8053('0x35')]?_0x751565['attributes']:_0x41c4c0['model'];if(_0x47c393[_0x8053('0x2e')][_0x8053('0x3f')]){_0x751565['include']=[{'all':!![]}];}_0x751565=_['merge']({},_0x751565,_0x47c393[_0x8053('0x3e')]);return db[_0x8053('0x2a')][_0x8053('0x45')](_0x751565)[_0x8053('0x25')](handleEntityNotFound(_0x22eea7,null))[_0x8053('0x25')](respondWithResult(_0x22eea7,null))['catch'](handleError(_0x22eea7,null));};exports['create']=function(_0x57d867,_0x3df282){return db[_0x8053('0x2a')][_0x8053('0x46')](_0x57d867['body'],{})[_0x8053('0x25')](respondWithResult(_0x3df282,0xc9))[_0x8053('0x47')](handleError(_0x3df282,null));};exports['update']=function(_0x32e00e,_0x342e50){if(_0x32e00e['body']['id']){delete _0x32e00e[_0x8053('0x48')]['id'];}return db[_0x8053('0x2a')][_0x8053('0x45')]({'where':{'id':_0x32e00e[_0x8053('0x49')]['id']}})[_0x8053('0x25')](handleEntityNotFound(_0x342e50,null))[_0x8053('0x25')](saveUpdates(_0x32e00e[_0x8053('0x48')],null))[_0x8053('0x25')](respondWithResult(_0x342e50,null))['catch'](handleError(_0x342e50,null));};exports[_0x8053('0x4a')]=function(_0x4ca0ed,_0x3c64ef){return db['OpenchannelTransferReport'][_0x8053('0x45')]({'where':{'id':_0x4ca0ed[_0x8053('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c64ef,null))[_0x8053('0x25')](removeEntity(_0x3c64ef,null))['catch'](handleError(_0x3c64ef,null));};exports[_0x8053('0x4b')]=function(_0x45b5c1,_0x8ceb13){return db[_0x8053('0x2a')][_0x8053('0x4b')]()['then'](respondWithResult(_0x8ceb13,null))[_0x8053('0x47')](handleError(_0x8ceb13,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 222da18..4003842 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 _0x136e=['exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x2fdbb2,_0x45e0c6){var _0x45655b=function(_0x27f76f){while(--_0x27f76f){_0x2fdbb2['push'](_0x2fdbb2['shift']());}};_0x45655b(++_0x45e0c6);}(_0x136e,0x118));var _0xe136=function(_0x4719cd,_0x5f4e8c){_0x4719cd=_0x4719cd-0x0;var _0x475ae3=_0x136e[_0x4719cd];return _0x475ae3;};'use strict';var _=require(_0xe136('0x0'));var util=require('util');var logger=require(_0xe136('0x1'))(_0xe136('0x2'));var moment=require(_0xe136('0x3'));var BPromise=require('bluebird');var rp=require(_0xe136('0x4'));var fs=require('fs');var path=require(_0xe136('0x5'));var rimraf=require('rimraf');var config=require(_0xe136('0x6'));var attributes=require(_0xe136('0x7'));module[_0xe136('0x8')]=function(_0x25fb28,_0x4d529d){return _0x25fb28[_0xe136('0x9')](_0xe136('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xe136('0xb'),'fields':[_0xe136('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd43b=['rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x468f6d,_0x4cecda){var _0x395b96=function(_0x2abd42){while(--_0x2abd42){_0x468f6d['push'](_0x468f6d['shift']());}};_0x395b96(++_0x4cecda);}(_0xd43b,0xe7));var _0xbd43=function(_0x18115e,_0x2355da){_0x18115e=_0x18115e-0x0;var _0x53366c=_0xd43b[_0x18115e];return _0x53366c;};'use strict';var _=require(_0xbd43('0x0'));var util=require(_0xbd43('0x1'));var logger=require(_0xbd43('0x2'))(_0xbd43('0x3'));var moment=require('moment');var BPromise=require(_0xbd43('0x4'));var rp=require(_0xbd43('0x5'));var fs=require('fs');var path=require(_0xbd43('0x6'));var rimraf=require(_0xbd43('0x7'));var config=require(_0xbd43('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0xbd43('0x9')]=function(_0x4dbf21,_0x282ecc){return _0x4dbf21[_0xbd43('0xa')](_0xbd43('0xb'),attributes,{'tableName':_0xbd43('0xc'),'paranoid':![],'indexes':[{'name':_0xbd43('0xd'),'fields':[_0xbd43('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5b69679..bdefe75 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 _0xa8eb=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','randomstring'];(function(_0x25b858,_0x50a4c1){var _0x5a0e80=function(_0x484d83){while(--_0x484d83){_0x25b858['push'](_0x25b858['shift']());}};_0x5a0e80(++_0x50a4c1);}(_0xa8eb,0x179));var _0xba8e=function(_0x4bc08a,_0x58660d){_0x4bc08a=_0x4bc08a-0x0;var _0x3ee179=_0xa8eb[_0x4bc08a];return _0x3ee179;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var moment=require(_0xba8e('0x1'));var BPromise=require('bluebird');var rs=require(_0xba8e('0x2'));var fs=require('fs');var Redis=require(_0xba8e('0x3'));var db=require(_0xba8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba8e('0x5'))(_0xba8e('0x6'));var config=require('../../config/environment');var jayson=require(_0xba8e('0x7'));var client=jayson['client'][_0xba8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52a8ef,_0x25dc04,_0x69ccbe){return new BPromise(function(_0x4b1bd6,_0x54a27a){return client[_0xba8e('0x9')](_0x52a8ef,_0x69ccbe)[_0xba8e('0xa')](function(_0x415f75){logger[_0xba8e('0xb')](_0xba8e('0xc'),_0x25dc04,_0xba8e('0xd'));logger[_0xba8e('0xe')](_0xba8e('0xf'),_0x25dc04,_0xba8e('0xd'),JSON['stringify'](_0x415f75));if(_0x415f75[_0xba8e('0x10')]){if(_0x415f75[_0xba8e('0x10')][_0xba8e('0x11')]===0x1f4){logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x415f75['error']['message']);return _0x54a27a(_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);}logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);return _0x4b1bd6(_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);}else{logger[_0xba8e('0xb')](_0xba8e('0xc'),_0x25dc04,_0xba8e('0xd'));_0x4b1bd6(_0x415f75['result'][_0xba8e('0x12')]);}})['catch'](function(_0x1abdfe){logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x1abdfe);_0x54a27a(_0x1abdfe);});});} \ No newline at end of file +var _0xfc17=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x29520f,_0x29d9c3){var _0x1116e8=function(_0x5cd849){while(--_0x5cd849){_0x29520f['push'](_0x29520f['shift']());}};_0x1116e8(++_0x29d9c3);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x5ace81,_0x5b2c1d){_0x5ace81=_0x5ace81-0x0;var _0x18d08a=_0xfc17[_0x5ace81];return _0x18d08a;};'use strict';var _=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var moment=require(_0x7fc1('0x2'));var BPromise=require(_0x7fc1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fc1('0x4'));var db=require(_0x7fc1('0x5'))['db'];var utils=require(_0x7fc1('0x6'));var logger=require(_0x7fc1('0x7'))(_0x7fc1('0x8'));var config=require(_0x7fc1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7fc1('0xa')][_0x7fc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2267ea,_0xf0d3fa,_0x24c678){return new BPromise(function(_0x1b7106,_0x3b631b){return client['request'](_0x2267ea,_0x24c678)[_0x7fc1('0xc')](function(_0x10e02b){logger[_0x7fc1('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xf0d3fa,_0x7fc1('0xe'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0xf0d3fa,_0x7fc1('0xe'),JSON[_0x7fc1('0xf')](_0x10e02b));if(_0x10e02b[_0x7fc1('0x10')]){if(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x11')]===0x1f4){logger[_0x7fc1('0x10')](_0x7fc1('0x12'),_0xf0d3fa,_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);return _0x3b631b(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);}logger[_0x7fc1('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xf0d3fa,_0x10e02b['error'][_0x7fc1('0x13')]);return _0x1b7106(_0x10e02b[_0x7fc1('0x10')][_0x7fc1('0x13')]);}else{logger[_0x7fc1('0xd')](_0x7fc1('0x12'),_0xf0d3fa,_0x7fc1('0xe'));_0x1b7106(_0x10e02b[_0x7fc1('0x14')][_0x7fc1('0x13')]);}})[_0x7fc1('0x15')](function(_0x442176){logger['error'](_0x7fc1('0x12'),_0xf0d3fa,_0x442176);_0x3b631b(_0x442176);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2017993..6c96cf1 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 _0xde53=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0xde53,0x163));var _0x3de5=function(_0x7583a7,_0x1b1350){_0x7583a7=_0x7583a7-0x0;var _0x978121=_0xde53[_0x7583a7];return _0x978121;};'use strict';var multer=require(_0x3de5('0x0'));var util=require(_0x3de5('0x1'));var path=require(_0x3de5('0x2'));var timeout=require(_0x3de5('0x3'));var express=require(_0x3de5('0x4'));var router=express['Router']();var fs_extra=require(_0x3de5('0x5'));var auth=require(_0x3de5('0x6'));var interaction=require(_0x3de5('0x7'));var config=require(_0x3de5('0x8'));var controller=require(_0x3de5('0x9'));router[_0x3de5('0xa')]('/',auth['isAuthenticated'](),controller[_0x3de5('0xb')]);router[_0x3de5('0xa')](_0x3de5('0xc'),auth[_0x3de5('0xd')](),controller[_0x3de5('0xe')]);router[_0x3de5('0xf')]('/',auth[_0x3de5('0xd')](),controller['create']);router['put'](_0x3de5('0xc'),auth[_0x3de5('0xd')](),controller[_0x3de5('0x10')]);router['delete'](_0x3de5('0xc'),auth[_0x3de5('0xd')](),controller[_0x3de5('0x11')]);module[_0x3de5('0x12')]=router; \ No newline at end of file +var _0x2f3a=['fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router'];(function(_0x1f43f4,_0x16d500){var _0x5435b7=function(_0x54f029){while(--_0x54f029){_0x1f43f4['push'](_0x1f43f4['shift']());}};_0x5435b7(++_0x16d500);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x44e734,_0x1ab928){_0x44e734=_0x44e734-0x0;var _0x4a681b=_0x2f3a[_0x44e734];return _0x4a681b;};'use strict';var multer=require(_0xa2f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2f3('0x1'));var express=require(_0xa2f3('0x2'));var router=express[_0xa2f3('0x3')]();var fs_extra=require(_0xa2f3('0x4'));var auth=require(_0xa2f3('0x5'));var interaction=require(_0xa2f3('0x6'));var config=require('../../config/environment');var controller=require(_0xa2f3('0x7'));router['get']('/',auth[_0xa2f3('0x8')](),controller[_0xa2f3('0x9')]);router['get']('/:id',auth[_0xa2f3('0x8')](),controller[_0xa2f3('0xa')]);router[_0xa2f3('0xb')]('/',auth[_0xa2f3('0x8')](),controller['create']);router[_0xa2f3('0xc')](_0xa2f3('0xd'),auth[_0xa2f3('0x8')](),controller[_0xa2f3('0xe')]);router[_0xa2f3('0xf')]('/:id',auth[_0xa2f3('0x8')](),controller[_0xa2f3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0c8dac4..d9b949f 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 _0xf002=['sequelize','exports','name'];(function(_0x2e3d53,_0x1cb38e){var _0x1885cc=function(_0x34b8f1){while(--_0x34b8f1){_0x2e3d53['push'](_0x2e3d53['shift']());}};_0x1885cc(++_0x1cb38e);}(_0xf002,0x78));var _0x2f00=function(_0x3c92f1,_0x183339){_0x3c92f1=_0x3c92f1-0x0;var _0x3bd7e0=_0xf002[_0x3c92f1];return _0x3bd7e0;};'use strict';var Sequelize=require(_0x2f00('0x0'));module[_0x2f00('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f00('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x541c=['sequelize','exports','STRING','name'];(function(_0x525bdf,_0x7dc498){var _0x5e4ade=function(_0x44d0c2){while(--_0x44d0c2){_0x525bdf['push'](_0x525bdf['shift']());}};_0x5e4ade(++_0x7dc498);}(_0x541c,0x19c));var _0xc541=function(_0x6fae04,_0x33078d){_0x6fae04=_0x6fae04-0x0;var _0x546f87=_0x541c[_0x6fae04];return _0x546f87;};'use strict';var Sequelize=require(_0xc541('0x0'));module[_0xc541('0x1')]={'name':{'type':Sequelize[_0xc541('0x2')],'unique':_0xc541('0x3'),'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 64ba779..ae0f1ac 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 _0xf68f=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','limit','count','offset','set','json','reject','save','update','destroy','get','UserProfileResource','then','end','error','stack','name','map','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','Pause','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','role','userProfileId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf68f,0x137));var _0xff68=function(_0x37b37f,_0x10b793){_0x37b37f=_0x37b37f-0x0;var _0x5720c8=_0xf68f[_0x37b37f];return _0x5720c8;};'use strict';var emlformat=require(_0xff68('0x0'));var rimraf=require(_0xff68('0x1'));var zipdir=require(_0xff68('0x2'));var jsonpatch=require(_0xff68('0x3'));var rp=require(_0xff68('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff68('0x5'));var util=require(_0xff68('0x6'));var path=require(_0xff68('0x7'));var sox=require('sox');var csv=require(_0xff68('0x8'));var ejs=require(_0xff68('0x9'));var fs=require('fs');var fs_extra=require(_0xff68('0xa'));var _=require(_0xff68('0xb'));var squel=require(_0xff68('0xc'));var crypto=require(_0xff68('0xd'));var jsforce=require(_0xff68('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff68('0xf'));var Papa=require('papaparse');var Redis=require(_0xff68('0x10'));var authService=require(_0xff68('0x11'));var qs=require(_0xff68('0x12'));var as=require(_0xff68('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff68('0x14'))(_0xff68('0x15'));var utils=require(_0xff68('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff68('0x17'))['db'];function respondWithStatusCode(_0x121502,_0x18b39c){_0x18b39c=_0x18b39c||0xcc;return function(_0x81f20e){if(_0x81f20e){return _0x121502[_0xff68('0x18')](_0x18b39c);}return _0x121502[_0xff68('0x19')](_0x18b39c)['end']();};}function respondWithResult(_0x2f498c,_0x1c67ff){_0x1c67ff=_0x1c67ff||0xc8;return function(_0x15b2ec){if(_0x15b2ec){return _0x2f498c[_0xff68('0x19')](_0x1c67ff)['json'](_0x15b2ec);}};}function respondWithFilteredResult(_0x3ccaff,_0x16392b){return function(_0x18443f){if(_0x18443f){var _0x11bd5c=typeof _0x16392b['offset']==='undefined'&&typeof _0x16392b[_0xff68('0x1a')]==='undefined';var _0x4b366f=_0x18443f[_0xff68('0x1b')];var _0xfcbe3b=_0x11bd5c?0x0:_0x16392b[_0xff68('0x1c')];var _0x396c0e=_0x11bd5c?_0x18443f[_0xff68('0x1b')]:_0x16392b[_0xff68('0x1c')]+_0x16392b[_0xff68('0x1a')];var _0x368b81;if(_0x396c0e>=_0x4b366f){_0x396c0e=_0x4b366f;_0x368b81=0xc8;}else{_0x368b81=0xce;}_0x3ccaff[_0xff68('0x19')](_0x368b81);return _0x3ccaff[_0xff68('0x1d')]('Content-Range',_0xfcbe3b+'-'+_0x396c0e+'/'+_0x4b366f)[_0xff68('0x1e')](_0x18443f);}return null;};}function patchUpdates(_0x12f242){return function(_0x3a840c){try{jsonpatch['apply'](_0x3a840c,_0x12f242,!![]);}catch(_0x18a7c9){return BPromise[_0xff68('0x1f')](_0x18a7c9);}return _0x3a840c[_0xff68('0x20')]();};}function saveUpdates(_0xd1b938,_0x5c23b1){return function(_0x48cccc){if(_0x48cccc){return _0x48cccc[_0xff68('0x21')](_0xd1b938)['then'](function(_0x1799ad){return _0x1799ad;});}return null;};}function removeEntity(_0x24100,_0x26c113){return function(_0x16a5cb){if(_0x16a5cb){return _0x16a5cb[_0xff68('0x22')]()['then'](function(){var _0x4ae9e2=_0x16a5cb[_0xff68('0x23')]({'plain':!![]});var _0x24dd2b='Pauses';return db[_0xff68('0x24')][_0xff68('0x22')]({'where':{'type':_0x24dd2b,'resourceId':_0x4ae9e2['id']}})[_0xff68('0x25')](function(){return _0x16a5cb;});})['then'](function(){_0x24100[_0xff68('0x19')](0xcc)[_0xff68('0x26')]();});}};}function handleEntityNotFound(_0x5ad64d,_0x593395){return function(_0x246ac5){if(!_0x246ac5){_0x5ad64d[_0xff68('0x18')](0x194);}return _0x246ac5;};}function handleError(_0x5d040d,_0x454092){_0x454092=_0x454092||0x1f4;return function(_0x28f7f4){logger[_0xff68('0x27')](_0x28f7f4[_0xff68('0x28')]);if(_0x28f7f4[_0xff68('0x29')]){delete _0x28f7f4[_0xff68('0x29')];}_0x5d040d[_0xff68('0x19')](_0x454092)['send'](_0x28f7f4);};}exports['index']=function(_0x1563bc,_0x203b5a){var _0x14988d={},_0x2bc794={},_0x5cebfc={'count':0x0,'rows':[]};var _0x18a1e7=_[_0xff68('0x2a')](db['Pause']['rawAttributes'],function(_0x40c340){return{'name':_0x40c340[_0xff68('0x2b')],'type':_0x40c340[_0xff68('0x2c')][_0xff68('0x2d')]};});_0x2bc794[_0xff68('0x2e')]=_['map'](_0x18a1e7,_0xff68('0x29'));_0x2bc794['query']=_[_0xff68('0x2f')](_0x1563bc[_0xff68('0x30')]);_0x2bc794['filters']=_[_0xff68('0x31')](_0x2bc794['model'],_0x2bc794[_0xff68('0x30')]);_0x14988d['attributes']=_[_0xff68('0x31')](_0x2bc794[_0xff68('0x2e')],qs['fields'](_0x1563bc[_0xff68('0x30')][_0xff68('0x32')]));_0x14988d['attributes']=_0x14988d[_0xff68('0x33')][_0xff68('0x34')]?_0x14988d[_0xff68('0x33')]:_0x2bc794[_0xff68('0x2e')];if(!_0x1563bc[_0xff68('0x30')][_0xff68('0x35')]('nolimit')){_0x14988d[_0xff68('0x1a')]=qs[_0xff68('0x1a')](_0x1563bc['query'][_0xff68('0x1a')]);_0x14988d['offset']=qs['offset'](_0x1563bc['query'][_0xff68('0x1c')]);}_0x14988d['order']=qs['sort'](_0x1563bc[_0xff68('0x30')][_0xff68('0x36')]);_0x14988d[_0xff68('0x37')]=qs[_0xff68('0x38')](_['pick'](_0x1563bc[_0xff68('0x30')],_0x2bc794[_0xff68('0x38')]),_0x18a1e7);if(_0x1563bc[_0xff68('0x30')][_0xff68('0x39')]){_0x14988d[_0xff68('0x37')]=_[_0xff68('0x3a')](_0x14988d[_0xff68('0x37')],{'$or':_[_0xff68('0x2a')](_0x18a1e7,function(_0x3ce1d0){if(_0x3ce1d0[_0xff68('0x2c')]!==_0xff68('0x3b')){var _0x564e8f={};_0x564e8f[_0x3ce1d0[_0xff68('0x29')]]={'$like':'%'+_0x1563bc[_0xff68('0x30')][_0xff68('0x39')]+'%'};return _0x564e8f;}})});}_0x14988d=_[_0xff68('0x3a')]({},_0x14988d,_0x1563bc['options']);var _0x3133e1={'where':_0x14988d[_0xff68('0x37')]};return db[_0xff68('0x3c')]['count'](_0x3133e1)['then'](function(_0x2338f0){_0x5cebfc[_0xff68('0x1b')]=_0x2338f0;if(_0x1563bc[_0xff68('0x30')][_0xff68('0x3d')]){_0x14988d[_0xff68('0x3e')]=[{'all':!![]}];}return db[_0xff68('0x3c')][_0xff68('0x3f')](_0x14988d);})[_0xff68('0x25')](function(_0x1a4494){_0x5cebfc[_0xff68('0x40')]=_0x1a4494;return _0x5cebfc;})[_0xff68('0x25')](respondWithFilteredResult(_0x203b5a,_0x14988d))[_0xff68('0x41')](handleError(_0x203b5a,null));};exports[_0xff68('0x42')]=function(_0x3edd2a,_0x3f1fbc){var _0x193232={'raw':!![],'where':{'id':_0x3edd2a[_0xff68('0x43')]['id']}},_0xf11bea={};_0xf11bea['model']=_[_0xff68('0x2f')](db[_0xff68('0x3c')][_0xff68('0x44')]);_0xf11bea['query']=_[_0xff68('0x2f')](_0x3edd2a[_0xff68('0x30')]);_0xf11bea['filters']=_['intersection'](_0xf11bea[_0xff68('0x2e')],_0xf11bea[_0xff68('0x30')]);_0x193232[_0xff68('0x33')]=_[_0xff68('0x31')](_0xf11bea[_0xff68('0x2e')],qs[_0xff68('0x32')](_0x3edd2a['query'][_0xff68('0x32')]));_0x193232['attributes']=_0x193232[_0xff68('0x33')][_0xff68('0x34')]?_0x193232[_0xff68('0x33')]:_0xf11bea[_0xff68('0x2e')];if(_0x3edd2a['query']['includeAll']){_0x193232[_0xff68('0x3e')]=[{'all':!![]}];}_0x193232=_[_0xff68('0x3a')]({},_0x193232,_0x3edd2a['options']);return db[_0xff68('0x3c')][_0xff68('0x45')](_0x193232)['then'](handleEntityNotFound(_0x3f1fbc,null))[_0xff68('0x25')](respondWithResult(_0x3f1fbc,null))[_0xff68('0x41')](handleError(_0x3f1fbc,null));};exports['create']=function(_0x59d0cb,_0x6ed507){return db[_0xff68('0x3c')][_0xff68('0x46')](_0x59d0cb['body'],{})[_0xff68('0x25')](function(_0x5a1334){var _0x174a73=_0x59d0cb[_0xff68('0x47')][_0xff68('0x23')]({'plain':!![]});if(!_0x174a73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x174a73[_0xff68('0x48')]===_0xff68('0x47')){var _0xc55455=_0x5a1334[_0xff68('0x23')]({'plain':!![]});var _0x30be80='Pauses';return db['UserProfileSection'][_0xff68('0x45')]({'where':{'name':_0x30be80,'userProfileId':_0x174a73[_0xff68('0x49')]},'raw':!![]})['then'](function(_0x2bb17e){if(_0x2bb17e&&_0x2bb17e[_0xff68('0x4a')]===0x0){return db[_0xff68('0x24')][_0xff68('0x46')]({'name':_0xc55455[_0xff68('0x29')],'resourceId':_0xc55455['id'],'type':_0x2bb17e[_0xff68('0x29')],'sectionId':_0x2bb17e['id']},{})[_0xff68('0x25')](function(){return _0x5a1334;});}else{return _0x5a1334;}})[_0xff68('0x41')](function(_0x3fc0a6){logger[_0xff68('0x27')](_0xff68('0x4b'),_0x3fc0a6);throw _0x3fc0a6;});}return _0x5a1334;})['then'](respondWithResult(_0x6ed507,0xc9))[_0xff68('0x41')](handleError(_0x6ed507,null));};exports[_0xff68('0x21')]=function(_0x33f2b2,_0x187ac4){if(_0x33f2b2[_0xff68('0x4c')]['id']){delete _0x33f2b2[_0xff68('0x4c')]['id'];}return db[_0xff68('0x3c')]['find']({'where':{'id':_0x33f2b2[_0xff68('0x43')]['id']}})['then'](handleEntityNotFound(_0x187ac4,null))[_0xff68('0x25')](saveUpdates(_0x33f2b2[_0xff68('0x4c')],null))[_0xff68('0x25')](respondWithResult(_0x187ac4,null))['catch'](handleError(_0x187ac4,null));};exports[_0xff68('0x22')]=function(_0x2172f4,_0x98618c){return db['Pause'][_0xff68('0x45')]({'where':{'id':_0x2172f4[_0xff68('0x43')]['id']}})['then'](handleEntityNotFound(_0x98618c,null))[_0xff68('0x25')](removeEntity(_0x98618c,null))['catch'](handleError(_0x98618c,null));}; \ No newline at end of file +var _0xca53=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','keys','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','get','Pauses','UserProfileResource','then','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0xca53,0xca));var _0x3ca5=function(_0x5d7b48,_0x1c8eaa){_0x5d7b48=_0x5d7b48-0x0;var _0x31bd82=_0xca53[_0x5d7b48];return _0x31bd82;};'use strict';var emlformat=require(_0x3ca5('0x0'));var rimraf=require(_0x3ca5('0x1'));var zipdir=require(_0x3ca5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ca5('0x3'));var BPromise=require(_0x3ca5('0x4'));var Mustache=require('mustache');var util=require(_0x3ca5('0x5'));var path=require(_0x3ca5('0x6'));var sox=require('sox');var csv=require(_0x3ca5('0x7'));var ejs=require(_0x3ca5('0x8'));var fs=require('fs');var fs_extra=require(_0x3ca5('0x9'));var _=require(_0x3ca5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ca5('0xb'));var deskjs=require(_0x3ca5('0xc'));var toCsv=require(_0x3ca5('0x7'));var querystring=require(_0x3ca5('0xd'));var Papa=require(_0x3ca5('0xe'));var Redis=require(_0x3ca5('0xf'));var authService=require(_0x3ca5('0x10'));var qs=require(_0x3ca5('0x11'));var as=require(_0x3ca5('0x12'));var hardwareService=require(_0x3ca5('0x13'));var logger=require('../../config/logger')(_0x3ca5('0x14'));var utils=require(_0x3ca5('0x15'));var config=require(_0x3ca5('0x16'));var licenseUtil=require(_0x3ca5('0x17'));var db=require(_0x3ca5('0x18'))['db'];function respondWithStatusCode(_0xcc3fca,_0x117c1c){_0x117c1c=_0x117c1c||0xcc;return function(_0x5e8de1){if(_0x5e8de1){return _0xcc3fca['sendStatus'](_0x117c1c);}return _0xcc3fca[_0x3ca5('0x19')](_0x117c1c)['end']();};}function respondWithResult(_0x478c49,_0x4be9a3){_0x4be9a3=_0x4be9a3||0xc8;return function(_0x1312a1){if(_0x1312a1){return _0x478c49[_0x3ca5('0x19')](_0x4be9a3)['json'](_0x1312a1);}};}function respondWithFilteredResult(_0x29924d,_0xb05e96){return function(_0x66e788){if(_0x66e788){var _0x5d8855=typeof _0xb05e96[_0x3ca5('0x1a')]==='undefined'&&typeof _0xb05e96[_0x3ca5('0x1b')]===_0x3ca5('0x1c');var _0x45f46c=_0x66e788[_0x3ca5('0x1d')];var _0x3e3178=_0x5d8855?0x0:_0xb05e96[_0x3ca5('0x1a')];var _0x2f0d5a=_0x5d8855?_0x66e788[_0x3ca5('0x1d')]:_0xb05e96[_0x3ca5('0x1a')]+_0xb05e96[_0x3ca5('0x1b')];var _0x4d6faa;if(_0x2f0d5a>=_0x45f46c){_0x2f0d5a=_0x45f46c;_0x4d6faa=0xc8;}else{_0x4d6faa=0xce;}_0x29924d[_0x3ca5('0x19')](_0x4d6faa);return _0x29924d[_0x3ca5('0x1e')](_0x3ca5('0x1f'),_0x3e3178+'-'+_0x2f0d5a+'/'+_0x45f46c)[_0x3ca5('0x20')](_0x66e788);}return null;};}function patchUpdates(_0x5ee085){return function(_0x1194cd){try{jsonpatch['apply'](_0x1194cd,_0x5ee085,!![]);}catch(_0x124bab){return BPromise[_0x3ca5('0x21')](_0x124bab);}return _0x1194cd['save']();};}function saveUpdates(_0x2d9c78,_0x27272d){return function(_0x3a8736){if(_0x3a8736){return _0x3a8736[_0x3ca5('0x22')](_0x2d9c78)['then'](function(_0x22d7c5){return _0x22d7c5;});}return null;};}function removeEntity(_0x36dd29,_0x1dc895){return function(_0x5c610b){if(_0x5c610b){return _0x5c610b['destroy']()['then'](function(){var _0x4f418d=_0x5c610b[_0x3ca5('0x23')]({'plain':!![]});var _0x4ee44b=_0x3ca5('0x24');return db[_0x3ca5('0x25')]['destroy']({'where':{'type':_0x4ee44b,'resourceId':_0x4f418d['id']}})[_0x3ca5('0x26')](function(){return _0x5c610b;});})[_0x3ca5('0x26')](function(){_0x36dd29[_0x3ca5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cdc3e,_0x553c5a){return function(_0x8efe2c){if(!_0x8efe2c){_0x3cdc3e[_0x3ca5('0x27')](0x194);}return _0x8efe2c;};}function handleError(_0x1276dc,_0x41b18e){_0x41b18e=_0x41b18e||0x1f4;return function(_0x2d5a16){logger['error'](_0x2d5a16[_0x3ca5('0x28')]);if(_0x2d5a16[_0x3ca5('0x29')]){delete _0x2d5a16[_0x3ca5('0x29')];}_0x1276dc[_0x3ca5('0x19')](_0x41b18e)[_0x3ca5('0x2a')](_0x2d5a16);};}exports[_0x3ca5('0x2b')]=function(_0x285249,_0x1e2277){var _0x1d97de={},_0x111e6f={},_0x1c590c={'count':0x0,'rows':[]};var _0x578bf9=_[_0x3ca5('0x2c')](db[_0x3ca5('0x2d')][_0x3ca5('0x2e')],function(_0x3634e6){return{'name':_0x3634e6[_0x3ca5('0x2f')],'type':_0x3634e6[_0x3ca5('0x30')][_0x3ca5('0x31')]};});_0x111e6f['model']=_[_0x3ca5('0x2c')](_0x578bf9,_0x3ca5('0x29'));_0x111e6f[_0x3ca5('0x32')]=_['keys'](_0x285249[_0x3ca5('0x32')]);_0x111e6f['filters']=_[_0x3ca5('0x33')](_0x111e6f[_0x3ca5('0x34')],_0x111e6f[_0x3ca5('0x32')]);_0x1d97de['attributes']=_[_0x3ca5('0x33')](_0x111e6f['model'],qs[_0x3ca5('0x35')](_0x285249['query'][_0x3ca5('0x35')]));_0x1d97de[_0x3ca5('0x36')]=_0x1d97de[_0x3ca5('0x36')][_0x3ca5('0x37')]?_0x1d97de[_0x3ca5('0x36')]:_0x111e6f[_0x3ca5('0x34')];if(!_0x285249['query'][_0x3ca5('0x38')](_0x3ca5('0x39'))){_0x1d97de['limit']=qs[_0x3ca5('0x1b')](_0x285249[_0x3ca5('0x32')]['limit']);_0x1d97de[_0x3ca5('0x1a')]=qs[_0x3ca5('0x1a')](_0x285249[_0x3ca5('0x32')][_0x3ca5('0x1a')]);}_0x1d97de[_0x3ca5('0x3a')]=qs[_0x3ca5('0x3b')](_0x285249[_0x3ca5('0x32')][_0x3ca5('0x3b')]);_0x1d97de[_0x3ca5('0x3c')]=qs[_0x3ca5('0x3d')](_[_0x3ca5('0x3e')](_0x285249[_0x3ca5('0x32')],_0x111e6f[_0x3ca5('0x3d')]),_0x578bf9);if(_0x285249[_0x3ca5('0x32')][_0x3ca5('0x3f')]){_0x1d97de[_0x3ca5('0x3c')]=_['merge'](_0x1d97de[_0x3ca5('0x3c')],{'$or':_[_0x3ca5('0x2c')](_0x578bf9,function(_0x157270){if(_0x157270[_0x3ca5('0x30')]!==_0x3ca5('0x40')){var _0x27a5e6={};_0x27a5e6[_0x157270[_0x3ca5('0x29')]]={'$like':'%'+_0x285249['query'][_0x3ca5('0x3f')]+'%'};return _0x27a5e6;}})});}_0x1d97de=_[_0x3ca5('0x41')]({},_0x1d97de,_0x285249['options']);var _0x320a16={'where':_0x1d97de[_0x3ca5('0x3c')]};return db[_0x3ca5('0x2d')][_0x3ca5('0x1d')](_0x320a16)[_0x3ca5('0x26')](function(_0x2dbe93){_0x1c590c[_0x3ca5('0x1d')]=_0x2dbe93;if(_0x285249[_0x3ca5('0x32')]['includeAll']){_0x1d97de[_0x3ca5('0x42')]=[{'all':!![]}];}return db['Pause'][_0x3ca5('0x43')](_0x1d97de);})['then'](function(_0x5388b6){_0x1c590c[_0x3ca5('0x44')]=_0x5388b6;return _0x1c590c;})[_0x3ca5('0x26')](respondWithFilteredResult(_0x1e2277,_0x1d97de))['catch'](handleError(_0x1e2277,null));};exports[_0x3ca5('0x45')]=function(_0x4f6de0,_0x20fea7){var _0x4e084c={'raw':!![],'where':{'id':_0x4f6de0[_0x3ca5('0x46')]['id']}},_0x2da02d={};_0x2da02d[_0x3ca5('0x34')]=_[_0x3ca5('0x47')](db[_0x3ca5('0x2d')][_0x3ca5('0x2e')]);_0x2da02d[_0x3ca5('0x32')]=_[_0x3ca5('0x47')](_0x4f6de0[_0x3ca5('0x32')]);_0x2da02d['filters']=_[_0x3ca5('0x33')](_0x2da02d[_0x3ca5('0x34')],_0x2da02d[_0x3ca5('0x32')]);_0x4e084c[_0x3ca5('0x36')]=_[_0x3ca5('0x33')](_0x2da02d['model'],qs[_0x3ca5('0x35')](_0x4f6de0[_0x3ca5('0x32')][_0x3ca5('0x35')]));_0x4e084c[_0x3ca5('0x36')]=_0x4e084c[_0x3ca5('0x36')][_0x3ca5('0x37')]?_0x4e084c[_0x3ca5('0x36')]:_0x2da02d[_0x3ca5('0x34')];if(_0x4f6de0[_0x3ca5('0x32')][_0x3ca5('0x48')]){_0x4e084c[_0x3ca5('0x42')]=[{'all':!![]}];}_0x4e084c=_[_0x3ca5('0x41')]({},_0x4e084c,_0x4f6de0[_0x3ca5('0x49')]);return db[_0x3ca5('0x2d')][_0x3ca5('0x4a')](_0x4e084c)['then'](handleEntityNotFound(_0x20fea7,null))[_0x3ca5('0x26')](respondWithResult(_0x20fea7,null))['catch'](handleError(_0x20fea7,null));};exports['create']=function(_0x133ff6,_0x4ff1f6){return db[_0x3ca5('0x2d')][_0x3ca5('0x4b')](_0x133ff6['body'],{})[_0x3ca5('0x26')](function(_0x41dac){var _0x21ef30=_0x133ff6[_0x3ca5('0x4c')][_0x3ca5('0x23')]({'plain':!![]});if(!_0x21ef30)throw new Error(_0x3ca5('0x4d'));if(_0x21ef30[_0x3ca5('0x4e')]===_0x3ca5('0x4c')){var _0x15e7ee=_0x41dac['get']({'plain':!![]});var _0x3851df=_0x3ca5('0x24');return db[_0x3ca5('0x4f')][_0x3ca5('0x4a')]({'where':{'name':_0x3851df,'userProfileId':_0x21ef30[_0x3ca5('0x50')]},'raw':!![]})[_0x3ca5('0x26')](function(_0x12764e){if(_0x12764e&&_0x12764e['autoAssociation']===0x0){return db[_0x3ca5('0x25')][_0x3ca5('0x4b')]({'name':_0x15e7ee['name'],'resourceId':_0x15e7ee['id'],'type':_0x12764e[_0x3ca5('0x29')],'sectionId':_0x12764e['id']},{})['then'](function(){return _0x41dac;});}else{return _0x41dac;}})[_0x3ca5('0x51')](function(_0x25cb7f){logger[_0x3ca5('0x52')](_0x3ca5('0x53'),_0x25cb7f);throw _0x25cb7f;});}return _0x41dac;})['then'](respondWithResult(_0x4ff1f6,0xc9))['catch'](handleError(_0x4ff1f6,null));};exports['update']=function(_0x406c47,_0x5836bb){if(_0x406c47[_0x3ca5('0x54')]['id']){delete _0x406c47['body']['id'];}return db['Pause'][_0x3ca5('0x4a')]({'where':{'id':_0x406c47[_0x3ca5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5836bb,null))['then'](saveUpdates(_0x406c47[_0x3ca5('0x54')],null))[_0x3ca5('0x26')](respondWithResult(_0x5836bb,null))[_0x3ca5('0x51')](handleError(_0x5836bb,null));};exports[_0x3ca5('0x55')]=function(_0x5b1f5b,_0x3d3c9c){return db[_0x3ca5('0x2d')][_0x3ca5('0x4a')]({'where':{'id':_0x5b1f5b[_0x3ca5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d3c9c,null))[_0x3ca5('0x26')](removeEntity(_0x3d3c9c,null))['catch'](handleError(_0x3d3c9c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 377a5bf..57b9946 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4e9059,_0x326207){var _0x53816f=function(_0x12d704){while(--_0x12d704){_0x4e9059['push'](_0x4e9059['shift']());}};_0x53816f(++_0x326207);}(_0x1cb9,0x14e));var _0x91cb=function(_0x490702,_0x220aa3){_0x490702=_0x490702-0x0;var _0x250a5b=_0x1cb9[_0x490702];return _0x250a5b;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x441a42,_0x1b238d){var _0x506b11=function(_0x4afa02){while(--_0x4afa02){_0x441a42['push'](_0x441a42['shift']());}};_0x506b11(++_0x1b238d);}(_0x53ec,0x192));var _0xc53e=function(_0x217483,_0x422422){_0x217483=_0x217483-0x0;var _0x37f8a4=_0x53ec[_0x217483];return _0x37f8a4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),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 aa4c8f6..b037246 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2fcf1b,_0x1d48af){var _0xc2aa21=function(_0x209209){while(--_0x209209){_0x2fcf1b['push'](_0x2fcf1b['shift']());}};_0xc2aa21(++_0x1d48af);}(_0xb10b,0x12a));var _0xbb10=function(_0x27d675,_0x4f1135){_0x27d675=_0x27d675-0x0;var _0x35b1d5=_0xb10b[_0x27d675];return _0x35b1d5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x22daf1,_0x3ec5c6){var _0x325f44=function(_0x20009c){while(--_0x20009c){_0x22daf1['push'](_0x22daf1['shift']());}};_0x325f44(++_0x3ec5c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ed1ad,_0x1fb8a1){_0x2ed1ad=_0x2ed1ad-0x0;var _0x1deb5e=_0xb10b[_0x2ed1ad];return _0x1deb5e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 5b70aad..cac9c2b 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 _0x984b=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/webhook','webhookGet','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','file','upload','put','update','delete','exports','connect-timeout','express'];(function(_0x3e00d5,_0x4c16dd){var _0xbbcc25=function(_0x15d7cc){while(--_0x15d7cc){_0x3e00d5['push'](_0x3e00d5['shift']());}};_0xbbcc25(++_0x4c16dd);}(_0x984b,0xee));var _0xb984=function(_0x3ad9b5,_0x23e807){_0x3ad9b5=_0x3ad9b5-0x0;var _0x1e200f=_0x984b[_0x3ad9b5];return _0x1e200f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var controller=require('./plugin.controller');router['get']('/',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['get'](_0xb984('0x7'),controller[_0xb984('0x8')]);router['get'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0xa')]);router[_0xb984('0xb')](_0xb984('0xc'),auth[_0xb984('0x5')](),controller[_0xb984('0xd')]);var upload=multer({'storage':multer[_0xb984('0xe')]({'destination':function(_0x11525c,_0xfca315,_0x16d46f){_0x16d46f(null,path[_0xb984('0xf')](config[_0xb984('0x10')],_0xb984('0x11')));},'filename':function(_0x5b4add,_0x1b922b,_0x4b9c75){_0x1b922b[_0xb984('0x12')]=_0x1b922b[_0xb984('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b9c75(null,util[_0xb984('0x13')](_0xb984('0x14'),path['basename'](_0x1b922b[_0xb984('0x12')],path[_0xb984('0x15')](_0x1b922b['originalname'])),Date[_0xb984('0x16')](),path[_0xb984('0x15')](_0x1b922b['originalname'])));}})});router[_0xb984('0x17')]('/',upload['single'](_0xb984('0x18')),controller[_0xb984('0x19')]);router[_0xb984('0x17')](_0xb984('0x7'),controller['webhookPost']);router[_0xb984('0x1a')](_0xb984('0x9'),auth[_0xb984('0x5')](),controller[_0xb984('0x1b')]);router[_0xb984('0x1c')](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0x1c')]);module[_0xb984('0x1d')]=router; \ No newline at end of file +var _0x55e0=['webhookPost','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','post','file','upload','/webhook'];(function(_0x38e933,_0x36a618){var _0x989205=function(_0x479382){while(--_0x479382){_0x38e933['push'](_0x38e933['shift']());}};_0x989205(++_0x36a618);}(_0x55e0,0xdc));var _0x055e=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x55e0[_0xdd827a];return _0x2f46f1;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/webhook',controller[_0x055e('0xa')]);router[_0x055e('0x9')](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0xd')]);router['get'](_0x055e('0xe'),auth[_0x055e('0xc')](),controller[_0x055e('0xf')]);var upload=multer({'storage':multer[_0x055e('0x10')]({'destination':function(_0x238068,_0x5237d9,_0x56c78a){_0x56c78a(null,path[_0x055e('0x11')](config['root'],_0x055e('0x12')));},'filename':function(_0x466da3,_0x72d424,_0x101bc3){_0x72d424[_0x055e('0x13')]=_0x72d424[_0x055e('0x13')][_0x055e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101bc3(null,util['format'](_0x055e('0x15'),path[_0x055e('0x16')](_0x72d424[_0x055e('0x13')],path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])),Date['now'](),path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])));}})});router[_0x055e('0x18')]('/',upload['single'](_0x055e('0x19')),controller[_0x055e('0x1a')]);router[_0x055e('0x18')](_0x055e('0x1b'),controller[_0x055e('0x1c')]);router['put'](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0x1d')]);router[_0x055e('0x1e')]('/:id',auth[_0x055e('0xc')](),controller[_0x055e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 5897905..873715d 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 _0x969d=['adminOnly','agentOnly','always','never','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x969d,0x70));var _0xd969=function(_0x128176,_0x2286f0){_0x128176=_0x128176-0x0;var _0x3c3181=_0x969d[_0x128176];return _0x3c3181;};'use strict';var Sequelize=require('sequelize');module[_0xd969('0x0')]={'name':{'type':Sequelize[_0xd969('0x1')]},'type':{'type':Sequelize[_0xd969('0x2')]('html',_0xd969('0x3'))},'description':{'type':Sequelize[_0xd969('0x4')]},'version':{'type':Sequelize[_0xd969('0x4')]},'path':{'type':Sequelize[_0xd969('0x1')],'comment':_0xd969('0x5')},'active':{'type':Sequelize[_0xd969('0x6')],'defaultValue':0x0,'comment':_0xd969('0x7')},'sidebar':{'type':Sequelize[_0xd969('0x2')](_0xd969('0x8'),_0xd969('0x9'),_0xd969('0xa'),_0xd969('0xb')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xd969('0x1')]},'adminUrl':{'type':Sequelize[_0xd969('0x1')]},'agentUrl':{'type':Sequelize[_0xd969('0x1')]},'scriptName':{'type':Sequelize[_0xd969('0x1')]},'scriptPath':{'type':Sequelize[_0xd969('0x1')]}}; \ No newline at end of file +var _0x10dd=['adminOnly','agentOnly','never','always','sequelize','STRING','ENUM','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x22b02b,_0x231699){var _0x5313ed=function(_0x2670c4){while(--_0x2670c4){_0x22b02b['push'](_0x22b02b['shift']());}};_0x5313ed(++_0x231699);}(_0x10dd,0x1b1));var _0xd10d=function(_0x4b068a,_0x4c3704){_0x4b068a=_0x4b068a-0x0;var _0x493363=_0x10dd[_0x4b068a];return _0x493363;};'use strict';var Sequelize=require(_0xd10d('0x0'));module['exports']={'name':{'type':Sequelize[_0xd10d('0x1')]},'type':{'type':Sequelize[_0xd10d('0x2')](_0xd10d('0x3'),'script')},'description':{'type':Sequelize[_0xd10d('0x4')]},'version':{'type':Sequelize[_0xd10d('0x4')]},'path':{'type':Sequelize[_0xd10d('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xd10d('0x5')],'defaultValue':0x0,'comment':_0xd10d('0x6')},'sidebar':{'type':Sequelize[_0xd10d('0x2')](_0xd10d('0x7'),_0xd10d('0x8'),'always',_0xd10d('0x9')),'defaultValue':_0xd10d('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xd10d('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xd10d('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 969849c..d05e40b 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 _0x847d=['type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','length','find','params','join','root','format','%s.zip','basename','createWriteStream','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','existsSync','Error','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','extname','filename','server/files/plugins','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','plugins','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','content-type','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x847d,0x1c4));var _0xd847=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x847d[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x2'));var util=require(_0xd847('0x3'));var path=require(_0xd847('0x4'));var sox=require(_0xd847('0x5'));var csv=require(_0xd847('0x6'));var ejs=require(_0xd847('0x7'));var fs=require('fs');var fs_extra=require(_0xd847('0x8'));var _=require(_0xd847('0x9'));var squel=require(_0xd847('0xa'));var crypto=require('crypto');var jsforce=require(_0xd847('0xb'));var deskjs=require(_0xd847('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd847('0xd'));var Papa=require(_0xd847('0xe'));var extract=require('extract-zip');var rimraf=require(_0xd847('0xf'));var archiver=require('archiver');var Redis=require(_0xd847('0x10'));var authService=require(_0xd847('0x11'));var qs=require(_0xd847('0x12'));var as=require(_0xd847('0x13'));var hardwareService=require(_0xd847('0x14'));var logger=require(_0xd847('0x15'))('api');var utils=require(_0xd847('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x17'));var db=require(_0xd847('0x18'))['db'];config[_0xd847('0x19')]=_[_0xd847('0x1a')](config['redis'],{'host':_0xd847('0x1b'),'port':0x18eb});var socket=require(_0xd847('0x1c'))(new Redis(config['redis']));require(_0xd847('0x1d'))[_0xd847('0x1e')](socket);function respondWithStatusCode(_0xb0d889,_0x5c3dde){_0x5c3dde=_0x5c3dde||0xcc;return function(_0x2322ec){if(_0x2322ec){return _0xb0d889[_0xd847('0x1f')](_0x5c3dde);}return _0xb0d889[_0xd847('0x20')](_0x5c3dde)['end']();};}function respondWithResult(_0x32766f,_0x52f046){_0x52f046=_0x52f046||0xc8;return function(_0x215cd0){if(_0x215cd0){return _0x32766f[_0xd847('0x20')](_0x52f046)[_0xd847('0x21')](_0x215cd0);}};}function respondWithFilteredResult(_0x3222cf,_0x52a20a){return function(_0x438f7a){if(_0x438f7a){var _0x306dbd=typeof _0x52a20a[_0xd847('0x22')]===_0xd847('0x23')&&typeof _0x52a20a[_0xd847('0x24')]===_0xd847('0x23');var _0x5062d5=_0x438f7a[_0xd847('0x25')];var _0x2940ee=_0x306dbd?0x0:_0x52a20a[_0xd847('0x22')];var _0x1e7dd5=_0x306dbd?_0x438f7a[_0xd847('0x25')]:_0x52a20a[_0xd847('0x22')]+_0x52a20a[_0xd847('0x24')];var _0x4f2faf;if(_0x1e7dd5>=_0x5062d5){_0x1e7dd5=_0x5062d5;_0x4f2faf=0xc8;}else{_0x4f2faf=0xce;}_0x3222cf[_0xd847('0x20')](_0x4f2faf);return _0x3222cf[_0xd847('0x26')](_0xd847('0x27'),_0x2940ee+'-'+_0x1e7dd5+'/'+_0x5062d5)[_0xd847('0x21')](_0x438f7a);}return null;};}function patchUpdates(_0x21c432){return function(_0x3cf070){try{jsonpatch[_0xd847('0x28')](_0x3cf070,_0x21c432,!![]);}catch(_0x341396){return BPromise[_0xd847('0x29')](_0x341396);}return _0x3cf070['save']();};}function saveUpdates(_0x5d5d7d,_0x2ebaf6){return function(_0x4f2e48){if(_0x4f2e48){return _0x4f2e48[_0xd847('0x2a')](_0x5d5d7d)[_0xd847('0x2b')](function(_0x61c784){return _0x61c784;});}return null;};}function removeEntity(_0x2be1ed,_0x506e5c){return function(_0x3b4b06){if(_0x3b4b06){return _0x3b4b06[_0xd847('0x2c')]()['then'](function(){var _0x3baf91=_0x3b4b06['get']({'plain':!![]});var _0x13bc98=_0xd847('0x2d');return db[_0xd847('0x2e')][_0xd847('0x2c')]({'where':{'type':_0x13bc98,'resourceId':_0x3baf91['id']}})['then'](function(){return _0x3b4b06;});})[_0xd847('0x2b')](function(){_0x2be1ed[_0xd847('0x20')](0xcc)[_0xd847('0x2f')]();});}};}function handleEntityNotFound(_0x2b6334,_0x52870f){return function(_0x35bf05){if(!_0x35bf05){_0x2b6334[_0xd847('0x1f')](0x194);}return _0x35bf05;};}function handleError(_0x52e0fc,_0x201c8b){_0x201c8b=_0x201c8b||0x1f4;return function(_0x43b513){logger[_0xd847('0x30')](_0x43b513[_0xd847('0x31')]);if(_0x43b513[_0xd847('0x32')]){delete _0x43b513[_0xd847('0x32')];}_0x52e0fc[_0xd847('0x20')](_0x201c8b)[_0xd847('0x33')](_0x43b513);};}exports[_0xd847('0x34')]=function(_0x56cfed,_0x3f647a){var _0x3b0c19={},_0x5674dd={},_0x575f0d={'count':0x0,'rows':[]};var _0x5a00cb=_[_0xd847('0x35')](db[_0xd847('0x36')][_0xd847('0x37')],function(_0x2e3d9c){return{'name':_0x2e3d9c['fieldName'],'type':_0x2e3d9c['type'][_0xd847('0x38')]};});_0x5674dd[_0xd847('0x39')]=_['map'](_0x5a00cb,'name');_0x5674dd[_0xd847('0x3a')]=_[_0xd847('0x3b')](_0x56cfed[_0xd847('0x3a')]);_0x5674dd[_0xd847('0x3c')]=_[_0xd847('0x3d')](_0x5674dd[_0xd847('0x39')],_0x5674dd[_0xd847('0x3a')]);_0x3b0c19[_0xd847('0x3e')]=_['intersection'](_0x5674dd[_0xd847('0x39')],qs[_0xd847('0x3f')](_0x56cfed[_0xd847('0x3a')][_0xd847('0x3f')]));_0x3b0c19[_0xd847('0x3e')]=_0x3b0c19[_0xd847('0x3e')]['length']?_0x3b0c19['attributes']:_0x5674dd['model'];if(!_0x56cfed[_0xd847('0x3a')][_0xd847('0x40')]('nolimit')){_0x3b0c19[_0xd847('0x24')]=qs['limit'](_0x56cfed[_0xd847('0x3a')][_0xd847('0x24')]);_0x3b0c19['offset']=qs[_0xd847('0x22')](_0x56cfed[_0xd847('0x3a')][_0xd847('0x22')]);}_0x3b0c19[_0xd847('0x41')]=qs['sort'](_0x56cfed[_0xd847('0x3a')][_0xd847('0x42')]);_0x3b0c19[_0xd847('0x43')]=qs['filters'](_[_0xd847('0x44')](_0x56cfed[_0xd847('0x3a')],_0x5674dd[_0xd847('0x3c')]),_0x5a00cb);if(_0x56cfed[_0xd847('0x3a')]['filter']){_0x3b0c19['where']=_[_0xd847('0x45')](_0x3b0c19[_0xd847('0x43')],{'$or':_[_0xd847('0x35')](_0x5a00cb,function(_0x1596be){if(_0x1596be[_0xd847('0x46')]!==_0xd847('0x47')){var _0x11f475={};_0x11f475[_0x1596be[_0xd847('0x32')]]={'$like':'%'+_0x56cfed['query'][_0xd847('0x48')]+'%'};return _0x11f475;}})});}_0x3b0c19=_[_0xd847('0x45')]({},_0x3b0c19,_0x56cfed[_0xd847('0x49')]);var _0x2a4a9f={'where':_0x3b0c19[_0xd847('0x43')]};return db[_0xd847('0x36')]['count'](_0x2a4a9f)[_0xd847('0x2b')](function(_0x383d4f){_0x575f0d[_0xd847('0x25')]=_0x383d4f;if(_0x56cfed['query'][_0xd847('0x4a')]){_0x3b0c19[_0xd847('0x4b')]=[{'all':!![]}];}return db[_0xd847('0x36')][_0xd847('0x4c')](_0x3b0c19);})[_0xd847('0x2b')](function(_0x4a7825){_0x575f0d[_0xd847('0x4d')]=_0x4a7825;return _0x575f0d;})[_0xd847('0x2b')](respondWithFilteredResult(_0x3f647a,_0x3b0c19))[_0xd847('0x4e')](handleError(_0x3f647a,null));};exports['show']=function(_0x4bf6dd,_0x243ded){var _0x54c9fc={'raw':!![],'where':{'id':_0x4bf6dd['params']['id']}},_0xd0c0e7={};_0xd0c0e7[_0xd847('0x39')]=_[_0xd847('0x3b')](db['Plugin'][_0xd847('0x37')]);_0xd0c0e7[_0xd847('0x3a')]=_[_0xd847('0x3b')](_0x4bf6dd[_0xd847('0x3a')]);_0xd0c0e7[_0xd847('0x3c')]=_['intersection'](_0xd0c0e7[_0xd847('0x39')],_0xd0c0e7[_0xd847('0x3a')]);_0x54c9fc[_0xd847('0x3e')]=_[_0xd847('0x3d')](_0xd0c0e7['model'],qs[_0xd847('0x3f')](_0x4bf6dd[_0xd847('0x3a')]['fields']));_0x54c9fc['attributes']=_0x54c9fc[_0xd847('0x3e')][_0xd847('0x4f')]?_0x54c9fc[_0xd847('0x3e')]:_0xd0c0e7['model'];if(_0x4bf6dd[_0xd847('0x3a')][_0xd847('0x4a')]){_0x54c9fc[_0xd847('0x4b')]=[{'all':!![]}];}_0x54c9fc=_['merge']({},_0x54c9fc,_0x4bf6dd['options']);return db[_0xd847('0x36')][_0xd847('0x50')](_0x54c9fc)['then'](handleEntityNotFound(_0x243ded,null))['then'](respondWithResult(_0x243ded,null))[_0xd847('0x4e')](handleError(_0x243ded,null));};exports['download']=function(_0x63e3b0,_0x467b44,_0x24fdaa){return db[_0xd847('0x36')][_0xd847('0x50')]({'where':{'id':_0x63e3b0[_0xd847('0x51')]['id']},'attributes':[_0xd847('0x32'),_0xd847('0x4')],'raw':!![]})[_0xd847('0x2b')](handleEntityNotFound(_0x467b44,null))[_0xd847('0x2b')](function(_0x3c381d){if(_0x3c381d){var _0x130b29=path[_0xd847('0x52')](config[_0xd847('0x53')],'server/files/plugins',util[_0xd847('0x54')](_0xd847('0x55'),path[_0xd847('0x56')](_0x3c381d[_0xd847('0x4')])));var _0x527431=fs[_0xd847('0x57')](_0x130b29);var _0x2e8cb0=archiver('zip',{'zlib':{'level':0x9}});_0x2e8cb0['on']('warning',function(_0x58fe8b){if(_0x58fe8b['code']===_0xd847('0x58')){logger[_0xd847('0x30')](_0x58fe8b);}else{throw new db['Sequelize']['Error'](_0xd847('0x59'));}});_0x2e8cb0['on'](_0xd847('0x30'),function(_0x18e171){throw new db[(_0xd847('0x5a'))]['Error'](_0xd847('0x59'));});_0x2e8cb0[_0xd847('0x5b')](_0x527431);_0x2e8cb0[_0xd847('0x5c')](_0xd847('0x5d'),{'cwd':path[_0xd847('0x52')](config['root'],'server/files/plugins',path['dirname'](_0x3c381d[_0xd847('0x4')])),'ignore':[path[_0xd847('0x52')](path[_0xd847('0x56')](_0x3c381d[_0xd847('0x4')]),_0xd847('0x5e')),path[_0xd847('0x52')](path['basename'](_0x3c381d[_0xd847('0x4')]),_0xd847('0x5f'))],'nodir':!![]})[_0xd847('0x60')]();_0x527431['on']('close',function(){if(!fs[_0xd847('0x61')](_0x130b29)){throw new db['Sequelize'][(_0xd847('0x62'))](_0xd847('0x63'));}return _0x467b44[_0xd847('0x64')](_0x130b29,util[_0xd847('0x54')](_0xd847('0x55'),path[_0xd847('0x56')](_0x3c381d[_0xd847('0x4')])),function(_0x113835){if(_0x113835){throw new db[(_0xd847('0x5a'))]['Error'](_0xd847('0x65'));}fs[_0xd847('0x66')](_0x130b29);logger[_0xd847('0x67')](_0xd847('0x68'));logger[_0xd847('0x67')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x467b44,null));};exports[_0xd847('0x69')]=function(_0x2a6a12,_0xa617d,_0x1e3ddc){var _0x243faa=path['basename'](_0x2a6a12[_0xd847('0x6a')]['filename'],path[_0xd847('0x6b')](_0x2a6a12['file'][_0xd847('0x6c')]));var _0xf33eb7=path['join'](config['root'],_0xd847('0x6d'),_0x2a6a12[_0xd847('0x6a')][_0xd847('0x6c')]);var _0x3ca5c8=path['join'](config[_0xd847('0x53')],'server/files/plugins',_0x243faa);logger[_0xd847('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0xf33eb7);logger[_0xd847('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x3ca5c8);try{fs[_0xd847('0x6e')](_0xf33eb7,parseInt('0777',0x8));extract(_0xf33eb7,{'dir':_0x3ca5c8},function(_0x53bf5d){if(_0x53bf5d){logger['error'](_0x53bf5d);handleError(_0x53bf5d,!![]);};var _0x179ccf=fs[_0xd847('0x6f')](_0x3ca5c8);if(_0x179ccf['length']>0x1){removeReferences(_0xf33eb7,_0x3ca5c8);logger['error'](_0xd847('0x70'));return _0x1e3ddc(new Error(_0xd847('0x70')));}var _0x2993e2=fs[_0xd847('0x71')](path[_0xd847('0x52')](_0x3ca5c8,_0x179ccf[0x0]));if(_0x2993e2[_0xd847('0x72')]()){removeReferences(_0xf33eb7,_0x3ca5c8);logger['error']('Invalid\x20plugin\x20structure');return _0x1e3ddc(new Error('Invalid\x20plugin\x20structure'));}if(_0x2993e2[_0xd847('0x73')]()){var _0x510225=fs[_0xd847('0x6f')](path['join'](_0x3ca5c8,_0x179ccf[0x0]));if(_0x510225[_0xd847('0x4f')]===0x0){removeReferences(_0xf33eb7,_0x3ca5c8);logger[_0xd847('0x30')]('Invalid\x20plugin\x20structure');return _0x1e3ddc(new Error(_0xd847('0x70')));}var _0x3db05e=_0x510225[_0xd847('0x74')](function(_0x8f4e){return _0x8f4e==='manifest.json';});if(!_0x3db05e){return _0x1e3ddc(new Error('Plugin\x20manifest\x20missing'));}var _0x91fd70=fs[_0xd847('0x75')](path[_0xd847('0x52')](_0x3ca5c8,_0x179ccf[0x0],_0xd847('0x76')));var _0x29cccb=JSON[_0xd847('0x77')](_0x91fd70);if(_0xd847('0x23')==typeof _0x29cccb['name']){return _0x1e3ddc(new Error(_0xd847('0x78')));}if(_0xd847('0x23')==typeof _0x29cccb[_0xd847('0x46')]){return _0x1e3ddc(new Error(_0xd847('0x79')));}if('undefined'==typeof _0x29cccb[_0xd847('0x7a')]){return _0x1e3ddc(new Error(_0xd847('0x7b')));}if(_0xd847('0x23')==typeof _0x29cccb['parameters']){return _0x1e3ddc(new Error(_0xd847('0x7c')));}if(_0x29cccb[_0xd847('0x46')]===_0xd847('0x7d')){if('undefined'==typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')]){return _0x1e3ddc(new Error(_0xd847('0x80')));}if('undefined'==typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x81')]&&_0xd847('0x23')==typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x82')]){return _0x1e3ddc(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x29cccb['type']===_0xd847('0x83')){if(_0xd847('0x23')==typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x84')]){return _0x1e3ddc(new Error(_0xd847('0x85')));}if(_0xd847('0x23')==typeof _0x29cccb['parameters']['scriptPath']){return _0x1e3ddc(new Error(_0xd847('0x86')));}}else{return _0x1e3ddc(new Error(_0xd847('0x87')));}var _0x2dd44d=_0x29cccb['name'];var _0x4cd15e=_0x29cccb[_0xd847('0x88')];var _0x59339f=_0x29cccb[_0xd847('0x46')];var _0x17d707=_0x29cccb[_0xd847('0x89')]?_0x29cccb[_0xd847('0x89')]:_0xd847('0x8a');var _0x2d9555=_0x29cccb['icon']?_0x29cccb[_0xd847('0x8b')]:_0xd847('0x8c');var _0x1dec37='';var _0x4759cb='';var _0xb3f856='';var _0xb37311='';var _0x233e0d=_0x29cccb[_0xd847('0x7a')];if(_0x59339f===_0xd847('0x7d')){if(_0xd847('0x23')!=typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x81')]){var _0x5f520d=_0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5f520d)){_0x1dec37=path[_0xd847('0x52')]('plugins',_0x243faa,_0x179ccf[0x0],_0x5f520d);}else{_0x1dec37=_0x5f520d;}}else{logger[_0xd847('0x67')](_0xd847('0x8d'));}if('undefined'!=typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x82')]){var _0x6a207=_0x29cccb[_0xd847('0x7e')]['views'][_0xd847('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x6a207)){_0x4759cb=path[_0xd847('0x52')]('plugins',_0x243faa,_0x179ccf[0x0],_0x6a207);}else{_0x4759cb=_0x6a207;}}else{logger[_0xd847('0x67')](_0xd847('0x8e'));}}else if(_0x59339f===_0xd847('0x83')){_0xb3f856=_0x29cccb[_0xd847('0x7e')]['scriptName'];_0xb37311=_0x29cccb[_0xd847('0x7e')][_0xd847('0x8f')];if(_0xd847('0x23')!=typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')]){if(_0xd847('0x23')!=typeof _0x29cccb['parameters']['views']['admin']){var _0x5f520d=_0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5f520d)){_0x1dec37=path[_0xd847('0x52')]('plugins',_0x243faa,_0x179ccf[0x0],_0x5f520d);}else{_0x1dec37=_0x5f520d;}}if(_0xd847('0x23')!=typeof _0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x82')]){var _0x6a207=_0x29cccb[_0xd847('0x7e')][_0xd847('0x7f')][_0xd847('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x6a207)){_0x4759cb=path[_0xd847('0x52')](_0xd847('0x90'),_0x243faa,_0x179ccf[0x0],_0x6a207);}else{_0x4759cb=_0x6a207;}}}}var _0x23af7d={'name':_0x2dd44d,'description':_0x4cd15e,'path':path['join'](_0x243faa,_0x179ccf[0x0]),'type':_0x59339f,'sidebar':_0x17d707,'icon':_0x2d9555,'adminUrl':_0x1dec37,'agentUrl':_0x4759cb,'scriptName':_0xb3f856,'scriptPath':_0xb37311,'version':_0x233e0d};removeReferences(_0xf33eb7,null);return db[_0xd847('0x36')][_0xd847('0x91')](_0x23af7d)[_0xd847('0x2b')](function(_0x80adc6){var _0x15dc94={'role':_0x2a6a12['body'][_0xd847('0x92')],'userProfileId':_0x2a6a12[_0xd847('0x93')]['userProfileId']};if(!_0x15dc94)throw new Error(_0xd847('0x94'));if(_0x15dc94[_0xd847('0x92')]===_0xd847('0x95')){var _0x459319=_0x80adc6['get']({'plain':!![]});return db[_0xd847('0x96')]['find']({'where':{'name':_0xd847('0x2d'),'userProfileId':_0x15dc94[_0xd847('0x97')]},'raw':!![]})[_0xd847('0x2b')](function(_0x8cbece){if(_0x8cbece&&_0x8cbece[_0xd847('0x98')]===0x0){return db[_0xd847('0x2e')][_0xd847('0x91')]({'name':_0x459319[_0xd847('0x32')],'resourceId':_0x459319['id'],'type':_0x8cbece[_0xd847('0x32')],'sectionId':_0x8cbece['id']},{})[_0xd847('0x2b')](function(){return _0x80adc6;});}else{return _0x80adc6;}})[_0xd847('0x4e')](function(_0x33a14c){logger[_0xd847('0x30')](_0xd847('0x99'),_0x33a14c);throw _0x33a14c;});}return _0x80adc6;})['then'](respondWithResult(_0xa617d,null))[_0xd847('0x4e')](handleError(_0xa617d,null));}});}catch(_0x1e476a){_0xa617d['status'](0x1f4)['send'](_0x1e476a);}};function removeReferences(_0x257576,_0x346f0f){try{if(_0x257576){fs[_0xd847('0x66')](_0x257576);logger['info'](_0xd847('0x9a'));}if(_0x346f0f){rimraf(_0x346f0f,function(){});logger[_0xd847('0x67')](_0xd847('0x9b'));}}catch(_0x5cb21c){logger[_0xd847('0x30')](_0x5cb21c);}}exports[_0xd847('0x2a')]=function(_0x227e48,_0x208a20,_0x36917c){return db['Plugin'][_0xd847('0x50')]({'where':{'id':_0x227e48['params']['id']}})[_0xd847('0x2b')](handleEntityNotFound(_0x208a20,null))['then'](saveUpdates(_0x227e48[_0xd847('0x93')],null))[_0xd847('0x2b')](respondWithResult(_0x208a20,null))[_0xd847('0x4e')](handleError(_0x208a20,null));};exports[_0xd847('0x9c')]=function(_0x4d8bae,_0x5f3ea0,_0x11f9b4){return db['Plugin'][_0xd847('0x50')]({'where':{'id':_0x4d8bae[_0xd847('0x51')]['id']}})['then'](function(_0x5c6c01){if(_0x5c6c01){return _0x5c6c01[_0xd847('0x2c')]();}})[_0xd847('0x2b')](function(_0x1026e3){rimraf(path[_0xd847('0x52')](config['root'],_0xd847('0x6d'),path[_0xd847('0x9d')](_0x1026e3[_0xd847('0x4')])),function(){});return _0x1026e3;})['then'](handleEntityNotFound(_0x5f3ea0,null))[_0xd847('0x2b')](respondWithStatusCode(_0x5f3ea0,null))[_0xd847('0x4e')](handleError(_0x5f3ea0,null));};exports[_0xd847('0x9e')]=function(_0x5f0cee,_0x3200c6,_0x44d059){return BPromise[_0xd847('0x9f')]()[_0xd847('0x2b')](function(){if(!_0x5f0cee['query'][_0xd847('0x4')]){throw new Error(_0xd847('0xa0'));}if(!_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x56e2b9=_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa2')]?_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa2')]+':'+_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa1')]:_0xd847('0xa3')+_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa1')];var _0x1d4259=_0x5f0cee[_0xd847('0x3a')][_0xd847('0x21')]?_0x5f0cee[_0xd847('0x3a')][_0xd847('0x21')]:!![];var _0x22cbb0=_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa4')]?_0x5f0cee[_0xd847('0x3a')][_0xd847('0xa4')]:null;var _0x198986={'method':_0x5f0cee[_0xd847('0xa5')],'uri':util['format'](_0xd847('0xa6'),_0x56e2b9,_0x5f0cee[_0xd847('0x3a')][_0xd847('0x4')]),'json':_0x1d4259,'resolveWithFullResponse':!![],'encoding':_0x22cbb0,'qs':_0x5f0cee['query']};if(_0x5f0cee[_0xd847('0xa7')]){_0x198986[_0xd847('0xa7')]=_0x5f0cee['headers'];if(_0x198986[_0xd847('0xa7')][_0xd847('0xa8')]){delete _0x198986[_0xd847('0xa7')][_0xd847('0xa8')];}}if(_0x198986[_0xd847('0xa7')]['content-type']){delete _0x198986['headers']['content-type'];}return rp(_0x198986);})['then'](function(_0x44ae45){if(_0x44ae45){_0x3200c6[_0xd847('0x26')](_0x44ae45[_0xd847('0xa7')]);logger[_0xd847('0x67')](_0x44ae45['body']);if(_[_0xd847('0xa9')](_0x5f0cee[_0xd847('0x3a')][_0xd847('0x4')],_0xd847('0x64'))&&_0x44ae45[_0xd847('0xaa')]==0x1f4){return _0x3200c6[_0xd847('0x1f')](_0x44ae45[_0xd847('0xaa')]);}else{return _0x3200c6[_0xd847('0x20')](_0x44ae45[_0xd847('0xaa')])['send'](_0x44ae45['body']);}}else{return _0x3200c6['sendStatus'](0xc8);}})[_0xd847('0x4e')](handleError(_0x3200c6,null));};exports[_0xd847('0xab')]=function(_0x1f0ddf,_0x124e2f,_0xbb7294){return BPromise[_0xd847('0x9f')]()[_0xd847('0x2b')](function(){if(!_0x1f0ddf['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1f0ddf[_0xd847('0x3a')]['port']){throw new Error(_0xd847('0xac'));}var _0x167c89=_0x1f0ddf[_0xd847('0x3a')]['hostname']?_0x1f0ddf[_0xd847('0x3a')][_0xd847('0xa2')]+':'+_0x1f0ddf['query'][_0xd847('0xa1')]:_0xd847('0xa3')+_0x1f0ddf[_0xd847('0x3a')][_0xd847('0xa1')];var _0x2ff2b0=_0x1f0ddf[_0xd847('0x3a')][_0xd847('0x21')]?_0x1f0ddf[_0xd847('0x3a')][_0xd847('0x21')]:!![];var _0x509029=_0x1f0ddf[_0xd847('0x3a')][_0xd847('0xa4')]?_0x1f0ddf[_0xd847('0x3a')]['encoding']:null;var _0x5d1f94={'method':_0x1f0ddf[_0xd847('0xa5')],'uri':util[_0xd847('0x54')](_0xd847('0xa6'),_0x167c89,_0x1f0ddf[_0xd847('0x3a')][_0xd847('0x4')]),'json':_0x2ff2b0,'resolveWithFullResponse':!![],'encoding':_0x509029,'body':_0x1f0ddf[_0xd847('0x93')]};if(_0x1f0ddf[_0xd847('0xa7')]){_0x5d1f94[_0xd847('0xa7')]=_0x1f0ddf[_0xd847('0xa7')];if(_0x5d1f94[_0xd847('0xa7')][_0xd847('0xa8')]){delete _0x5d1f94[_0xd847('0xa7')][_0xd847('0xa8')];}}if(_0x5d1f94[_0xd847('0xa7')][_0xd847('0xad')]){delete _0x5d1f94[_0xd847('0xa7')]['content-type'];}return rp(_0x5d1f94);})[_0xd847('0x2b')](function(_0x45018d){if(_0x45018d){_0x124e2f[_0xd847('0x26')](_0x45018d[_0xd847('0xa7')]);logger['info'](_0x45018d[_0xd847('0x93')]);return _0x124e2f[_0xd847('0x20')](_0x45018d[_0xd847('0xaa')])[_0xd847('0x33')](_0x45018d[_0xd847('0x93')]);}else{return _0x124e2f[_0xd847('0x1f')](0xc8);}})[_0xd847('0x4e')](handleError(_0x124e2f,null));}; \ No newline at end of file +var _0xa8a7=['util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','Plugin','includeAll','include','findAll','catch','show','find','download','path','join','root','server/files/plugins','format','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','node_modules/**/*','finalize','Plugin\x20not\x20found','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0xa8a7,0x1f4));var _0x7a8a=function(_0x103518,_0x9cb56){_0x103518=_0x103518-0x0;var _0xef88a1=_0xa8a7[_0x103518];return _0xef88a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a8a('0x0'));var zipdir=require(_0x7a8a('0x1'));var jsonpatch=require(_0x7a8a('0x2'));var rp=require(_0x7a8a('0x3'));var moment=require(_0x7a8a('0x4'));var BPromise=require(_0x7a8a('0x5'));var Mustache=require(_0x7a8a('0x6'));var util=require(_0x7a8a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7a8a('0x8'));var ejs=require(_0x7a8a('0x9'));var fs=require('fs');var fs_extra=require(_0x7a8a('0xa'));var _=require('lodash');var squel=require(_0x7a8a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7a8a('0xc'));var deskjs=require(_0x7a8a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a8a('0xe'));var Papa=require('papaparse');var extract=require(_0x7a8a('0xf'));var rimraf=require(_0x7a8a('0x0'));var archiver=require('archiver');var Redis=require(_0x7a8a('0x10'));var authService=require(_0x7a8a('0x11'));var qs=require(_0x7a8a('0x12'));var as=require(_0x7a8a('0x13'));var hardwareService=require(_0x7a8a('0x14'));var logger=require('../../config/logger')(_0x7a8a('0x15'));var utils=require('../../config/utils');var config=require(_0x7a8a('0x16'));var licenseUtil=require(_0x7a8a('0x17'));var db=require('../../mysqldb')['db'];config[_0x7a8a('0x18')]=_[_0x7a8a('0x19')](config[_0x7a8a('0x18')],{'host':_0x7a8a('0x1a'),'port':0x18eb});var socket=require(_0x7a8a('0x1b'))(new Redis(config[_0x7a8a('0x18')]));require(_0x7a8a('0x1c'))[_0x7a8a('0x1d')](socket);function respondWithStatusCode(_0x5a1281,_0x2e7f8f){_0x2e7f8f=_0x2e7f8f||0xcc;return function(_0x4713e8){if(_0x4713e8){return _0x5a1281['sendStatus'](_0x2e7f8f);}return _0x5a1281[_0x7a8a('0x1e')](_0x2e7f8f)[_0x7a8a('0x1f')]();};}function respondWithResult(_0x7651c1,_0x1d4fce){_0x1d4fce=_0x1d4fce||0xc8;return function(_0x3f8ac0){if(_0x3f8ac0){return _0x7651c1['status'](_0x1d4fce)[_0x7a8a('0x20')](_0x3f8ac0);}};}function respondWithFilteredResult(_0x2a381b,_0x3b339f){return function(_0x5f0e8d){if(_0x5f0e8d){var _0x5918ee=typeof _0x3b339f[_0x7a8a('0x21')]==='undefined'&&typeof _0x3b339f['limit']===_0x7a8a('0x22');var _0x3eae6e=_0x5f0e8d[_0x7a8a('0x23')];var _0x12c251=_0x5918ee?0x0:_0x3b339f[_0x7a8a('0x21')];var _0x3a1f38=_0x5918ee?_0x5f0e8d[_0x7a8a('0x23')]:_0x3b339f[_0x7a8a('0x21')]+_0x3b339f['limit'];var _0x1709cb;if(_0x3a1f38>=_0x3eae6e){_0x3a1f38=_0x3eae6e;_0x1709cb=0xc8;}else{_0x1709cb=0xce;}_0x2a381b[_0x7a8a('0x1e')](_0x1709cb);return _0x2a381b[_0x7a8a('0x24')](_0x7a8a('0x25'),_0x12c251+'-'+_0x3a1f38+'/'+_0x3eae6e)[_0x7a8a('0x20')](_0x5f0e8d);}return null;};}function patchUpdates(_0x11f7d2){return function(_0x40310a){try{jsonpatch[_0x7a8a('0x26')](_0x40310a,_0x11f7d2,!![]);}catch(_0x27e51d){return BPromise[_0x7a8a('0x27')](_0x27e51d);}return _0x40310a[_0x7a8a('0x28')]();};}function saveUpdates(_0x35f137,_0xb11460){return function(_0x23aead){if(_0x23aead){return _0x23aead[_0x7a8a('0x29')](_0x35f137)[_0x7a8a('0x2a')](function(_0x5f39b9){return _0x5f39b9;});}return null;};}function removeEntity(_0x47ebc6,_0x15a6c4){return function(_0x78c768){if(_0x78c768){return _0x78c768[_0x7a8a('0x2b')]()[_0x7a8a('0x2a')](function(){var _0x3d4a1f=_0x78c768[_0x7a8a('0x2c')]({'plain':!![]});var _0x7398a2=_0x7a8a('0x2d');return db[_0x7a8a('0x2e')][_0x7a8a('0x2b')]({'where':{'type':_0x7398a2,'resourceId':_0x3d4a1f['id']}})[_0x7a8a('0x2a')](function(){return _0x78c768;});})[_0x7a8a('0x2a')](function(){_0x47ebc6['status'](0xcc)[_0x7a8a('0x1f')]();});}};}function handleEntityNotFound(_0x3904fc,_0x55579f){return function(_0x24fcc3){if(!_0x24fcc3){_0x3904fc[_0x7a8a('0x2f')](0x194);}return _0x24fcc3;};}function handleError(_0x17bbb0,_0x2d73ed){_0x2d73ed=_0x2d73ed||0x1f4;return function(_0x31da6a){logger[_0x7a8a('0x30')](_0x31da6a[_0x7a8a('0x31')]);if(_0x31da6a[_0x7a8a('0x32')]){delete _0x31da6a[_0x7a8a('0x32')];}_0x17bbb0[_0x7a8a('0x1e')](_0x2d73ed)[_0x7a8a('0x33')](_0x31da6a);};}exports[_0x7a8a('0x34')]=function(_0x496a58,_0x4e6363){var _0xde534a={},_0x530887={},_0x469d4a={'count':0x0,'rows':[]};var _0x2a4f64=_[_0x7a8a('0x35')](db['Plugin'][_0x7a8a('0x36')],function(_0x55bcec){return{'name':_0x55bcec[_0x7a8a('0x37')],'type':_0x55bcec[_0x7a8a('0x38')][_0x7a8a('0x39')]};});_0x530887['model']=_[_0x7a8a('0x35')](_0x2a4f64,_0x7a8a('0x32'));_0x530887['query']=_[_0x7a8a('0x3a')](_0x496a58[_0x7a8a('0x3b')]);_0x530887[_0x7a8a('0x3c')]=_[_0x7a8a('0x3d')](_0x530887[_0x7a8a('0x3e')],_0x530887['query']);_0xde534a[_0x7a8a('0x3f')]=_[_0x7a8a('0x3d')](_0x530887['model'],qs[_0x7a8a('0x40')](_0x496a58[_0x7a8a('0x3b')]['fields']));_0xde534a[_0x7a8a('0x3f')]=_0xde534a[_0x7a8a('0x3f')][_0x7a8a('0x41')]?_0xde534a[_0x7a8a('0x3f')]:_0x530887[_0x7a8a('0x3e')];if(!_0x496a58['query'][_0x7a8a('0x42')](_0x7a8a('0x43'))){_0xde534a[_0x7a8a('0x44')]=qs[_0x7a8a('0x44')](_0x496a58[_0x7a8a('0x3b')]['limit']);_0xde534a[_0x7a8a('0x21')]=qs[_0x7a8a('0x21')](_0x496a58[_0x7a8a('0x3b')][_0x7a8a('0x21')]);}_0xde534a[_0x7a8a('0x45')]=qs[_0x7a8a('0x46')](_0x496a58[_0x7a8a('0x3b')][_0x7a8a('0x46')]);_0xde534a[_0x7a8a('0x47')]=qs[_0x7a8a('0x3c')](_['pick'](_0x496a58['query'],_0x530887[_0x7a8a('0x3c')]),_0x2a4f64);if(_0x496a58['query'][_0x7a8a('0x48')]){_0xde534a[_0x7a8a('0x47')]=_[_0x7a8a('0x49')](_0xde534a[_0x7a8a('0x47')],{'$or':_[_0x7a8a('0x35')](_0x2a4f64,function(_0x512093){if(_0x512093['type']!==_0x7a8a('0x4a')){var _0x4f799e={};_0x4f799e[_0x512093[_0x7a8a('0x32')]]={'$like':'%'+_0x496a58[_0x7a8a('0x3b')][_0x7a8a('0x48')]+'%'};return _0x4f799e;}})});}_0xde534a=_[_0x7a8a('0x49')]({},_0xde534a,_0x496a58['options']);var _0x2b61e9={'where':_0xde534a['where']};return db[_0x7a8a('0x4b')][_0x7a8a('0x23')](_0x2b61e9)[_0x7a8a('0x2a')](function(_0xca5f5c){_0x469d4a[_0x7a8a('0x23')]=_0xca5f5c;if(_0x496a58[_0x7a8a('0x3b')][_0x7a8a('0x4c')]){_0xde534a[_0x7a8a('0x4d')]=[{'all':!![]}];}return db[_0x7a8a('0x4b')][_0x7a8a('0x4e')](_0xde534a);})[_0x7a8a('0x2a')](function(_0x152dcf){_0x469d4a['rows']=_0x152dcf;return _0x469d4a;})[_0x7a8a('0x2a')](respondWithFilteredResult(_0x4e6363,_0xde534a))[_0x7a8a('0x4f')](handleError(_0x4e6363,null));};exports[_0x7a8a('0x50')]=function(_0x240359,_0x1ba303){var _0x17aaae={'raw':!![],'where':{'id':_0x240359['params']['id']}},_0x463f2f={};_0x463f2f[_0x7a8a('0x3e')]=_[_0x7a8a('0x3a')](db[_0x7a8a('0x4b')][_0x7a8a('0x36')]);_0x463f2f['query']=_[_0x7a8a('0x3a')](_0x240359[_0x7a8a('0x3b')]);_0x463f2f[_0x7a8a('0x3c')]=_[_0x7a8a('0x3d')](_0x463f2f[_0x7a8a('0x3e')],_0x463f2f[_0x7a8a('0x3b')]);_0x17aaae['attributes']=_[_0x7a8a('0x3d')](_0x463f2f[_0x7a8a('0x3e')],qs[_0x7a8a('0x40')](_0x240359[_0x7a8a('0x3b')]['fields']));_0x17aaae[_0x7a8a('0x3f')]=_0x17aaae[_0x7a8a('0x3f')][_0x7a8a('0x41')]?_0x17aaae[_0x7a8a('0x3f')]:_0x463f2f[_0x7a8a('0x3e')];if(_0x240359[_0x7a8a('0x3b')][_0x7a8a('0x4c')]){_0x17aaae['include']=[{'all':!![]}];}_0x17aaae=_[_0x7a8a('0x49')]({},_0x17aaae,_0x240359['options']);return db['Plugin'][_0x7a8a('0x51')](_0x17aaae)['then'](handleEntityNotFound(_0x1ba303,null))[_0x7a8a('0x2a')](respondWithResult(_0x1ba303,null))['catch'](handleError(_0x1ba303,null));};exports[_0x7a8a('0x52')]=function(_0x1a16ce,_0x4829ba,_0x34e9b1){return db[_0x7a8a('0x4b')][_0x7a8a('0x51')]({'where':{'id':_0x1a16ce['params']['id']},'attributes':[_0x7a8a('0x32'),_0x7a8a('0x53')],'raw':!![]})[_0x7a8a('0x2a')](handleEntityNotFound(_0x4829ba,null))['then'](function(_0x4cc24d){if(_0x4cc24d){var _0x2395a4=path[_0x7a8a('0x54')](config[_0x7a8a('0x55')],_0x7a8a('0x56'),util[_0x7a8a('0x57')]('%s.zip',path[_0x7a8a('0x58')](_0x4cc24d[_0x7a8a('0x53')])));var _0x48358c=fs['createWriteStream'](_0x2395a4);var _0x2700fa=archiver('zip',{'zlib':{'level':0x9}});_0x2700fa['on'](_0x7a8a('0x59'),function(_0x596676){if(_0x596676[_0x7a8a('0x5a')]===_0x7a8a('0x5b')){logger['error'](_0x596676);}else{throw new db[(_0x7a8a('0x5c'))][(_0x7a8a('0x5d'))](_0x7a8a('0x5e'));}});_0x2700fa['on'](_0x7a8a('0x30'),function(_0x212156){throw new db[(_0x7a8a('0x5c'))][(_0x7a8a('0x5d'))](_0x7a8a('0x5e'));});_0x2700fa[_0x7a8a('0x5f')](_0x48358c);_0x2700fa['glob'](_0x7a8a('0x60'),{'cwd':path['join'](config['root'],_0x7a8a('0x56'),path['dirname'](_0x4cc24d[_0x7a8a('0x53')])),'ignore':[path[_0x7a8a('0x54')](path[_0x7a8a('0x58')](_0x4cc24d[_0x7a8a('0x53')]),_0x7a8a('0x61')),path[_0x7a8a('0x54')](path[_0x7a8a('0x58')](_0x4cc24d[_0x7a8a('0x53')]),'attachments/**/*')],'nodir':!![]})[_0x7a8a('0x62')]();_0x48358c['on']('close',function(){if(!fs['existsSync'](_0x2395a4)){throw new db[(_0x7a8a('0x5c'))]['Error'](_0x7a8a('0x63'));}return _0x4829ba['download'](_0x2395a4,util[_0x7a8a('0x57')](_0x7a8a('0x64'),path[_0x7a8a('0x58')](_0x4cc24d[_0x7a8a('0x53')])),function(_0x4955b4){if(_0x4955b4){throw new db[(_0x7a8a('0x5c'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x2395a4);logger[_0x7a8a('0x65')](_0x7a8a('0x66'));logger[_0x7a8a('0x65')](_0x7a8a('0x67'));});});}return null;})['catch'](handleError(_0x4829ba,null));};exports[_0x7a8a('0x68')]=function(_0x40eefb,_0x24c1cb,_0x374ee6){var _0x538170=path[_0x7a8a('0x58')](_0x40eefb[_0x7a8a('0x69')]['filename'],path['extname'](_0x40eefb['file'][_0x7a8a('0x6a')]));var _0x4cc26e=path['join'](config['root'],_0x7a8a('0x56'),_0x40eefb[_0x7a8a('0x69')]['filename']);var _0x5189b1=path[_0x7a8a('0x54')](config[_0x7a8a('0x55')],_0x7a8a('0x56'),_0x538170);logger[_0x7a8a('0x65')](_0x7a8a('0x6b'),_0x4cc26e);logger[_0x7a8a('0x65')](_0x7a8a('0x6c'),_0x5189b1);try{fs[_0x7a8a('0x6d')](_0x4cc26e,parseInt(_0x7a8a('0x6e'),0x8));extract(_0x4cc26e,{'dir':_0x5189b1},function(_0x23bd43){if(_0x23bd43){logger['error'](_0x23bd43);handleError(_0x23bd43,!![]);};var _0x4d970f=fs['readdirSync'](_0x5189b1);if(_0x4d970f[_0x7a8a('0x41')]>0x1){removeReferences(_0x4cc26e,_0x5189b1);logger[_0x7a8a('0x30')](_0x7a8a('0x6f'));return _0x374ee6(new Error('Invalid\x20plugin\x20structure'));}var _0x48ab01=fs[_0x7a8a('0x70')](path[_0x7a8a('0x54')](_0x5189b1,_0x4d970f[0x0]));if(_0x48ab01[_0x7a8a('0x71')]()){removeReferences(_0x4cc26e,_0x5189b1);logger[_0x7a8a('0x30')](_0x7a8a('0x6f'));return _0x374ee6(new Error('Invalid\x20plugin\x20structure'));}if(_0x48ab01[_0x7a8a('0x72')]()){var _0x5b1d0f=fs['readdirSync'](path[_0x7a8a('0x54')](_0x5189b1,_0x4d970f[0x0]));if(_0x5b1d0f[_0x7a8a('0x41')]===0x0){removeReferences(_0x4cc26e,_0x5189b1);logger[_0x7a8a('0x30')](_0x7a8a('0x6f'));return _0x374ee6(new Error(_0x7a8a('0x6f')));}var _0x3ee095=_0x5b1d0f['some'](function(_0x5542f5){return _0x5542f5==='manifest.json';});if(!_0x3ee095){return _0x374ee6(new Error('Plugin\x20manifest\x20missing'));}var _0x14b1d9=fs['readFileSync'](path[_0x7a8a('0x54')](_0x5189b1,_0x4d970f[0x0],_0x7a8a('0x73')));var _0x2d06fe=JSON[_0x7a8a('0x74')](_0x14b1d9);if(_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x32')]){return _0x374ee6(new Error(_0x7a8a('0x75')));}if(_0x7a8a('0x22')==typeof _0x2d06fe['type']){return _0x374ee6(new Error(_0x7a8a('0x76')));}if(_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x77')]){return _0x374ee6(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7a8a('0x22')==typeof _0x2d06fe['parameters']){return _0x374ee6(new Error(_0x7a8a('0x78')));}if(_0x2d06fe['type']===_0x7a8a('0x79')){if(_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x7a')]['views']){return _0x374ee6(new Error(_0x7a8a('0x7b')));}if(_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x7c')]['admin']&&_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x7c')][_0x7a8a('0x7d')]){return _0x374ee6(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x2d06fe['type']===_0x7a8a('0x7e')){if(_0x7a8a('0x22')==typeof _0x2d06fe[_0x7a8a('0x7a')]['scriptName']){return _0x374ee6(new Error(_0x7a8a('0x7f')));}if(_0x7a8a('0x22')==typeof _0x2d06fe['parameters']['scriptPath']){return _0x374ee6(new Error(_0x7a8a('0x80')));}}else{return _0x374ee6(new Error(_0x7a8a('0x81')));}var _0x1a5f38=_0x2d06fe[_0x7a8a('0x32')];var _0x535ea4=_0x2d06fe[_0x7a8a('0x82')];var _0x572258=_0x2d06fe[_0x7a8a('0x38')];var _0x5e71a7=_0x2d06fe['sidebar']?_0x2d06fe[_0x7a8a('0x83')]:_0x7a8a('0x84');var _0x48874f=_0x2d06fe[_0x7a8a('0x85')]?_0x2d06fe['icon']:'icon-apps';var _0x111276='';var _0x2460ea='';var _0x2d2822='';var _0x441faf='';var _0x2f93eb=_0x2d06fe[_0x7a8a('0x77')];if(_0x572258===_0x7a8a('0x79')){if(_0x7a8a('0x22')!=typeof _0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x7c')]['admin']){var _0x223dc5=_0x2d06fe['parameters'][_0x7a8a('0x7c')][_0x7a8a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x7a8a('0x87')](_0x223dc5)){_0x111276=path[_0x7a8a('0x54')]('plugins',_0x538170,_0x4d970f[0x0],_0x223dc5);}else{_0x111276=_0x223dc5;}}else{logger[_0x7a8a('0x65')](_0x7a8a('0x88'));}if(_0x7a8a('0x22')!=typeof _0x2d06fe['parameters'][_0x7a8a('0x7c')][_0x7a8a('0x7d')]){var _0x15cc1f=_0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x7c')][_0x7a8a('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x7a8a('0x87')](_0x15cc1f)){_0x2460ea=path[_0x7a8a('0x54')](_0x7a8a('0x89'),_0x538170,_0x4d970f[0x0],_0x15cc1f);}else{_0x2460ea=_0x15cc1f;}}else{logger[_0x7a8a('0x65')](_0x7a8a('0x8a'));}}else if(_0x572258==='script'){_0x2d2822=_0x2d06fe['parameters'][_0x7a8a('0x8b')];_0x441faf=_0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x8c')];if(_0x7a8a('0x22')!=typeof _0x2d06fe[_0x7a8a('0x7a')]['views']){if(_0x7a8a('0x22')!=typeof _0x2d06fe[_0x7a8a('0x7a')][_0x7a8a('0x7c')][_0x7a8a('0x86')]){var _0x223dc5=_0x2d06fe[_0x7a8a('0x7a')]['views'][_0x7a8a('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x7a8a('0x87')](_0x223dc5)){_0x111276=path[_0x7a8a('0x54')](_0x7a8a('0x89'),_0x538170,_0x4d970f[0x0],_0x223dc5);}else{_0x111276=_0x223dc5;}}if(_0x7a8a('0x22')!=typeof _0x2d06fe['parameters']['views']['agent']){var _0x15cc1f=_0x2d06fe['parameters'][_0x7a8a('0x7c')][_0x7a8a('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x15cc1f)){_0x2460ea=path['join'](_0x7a8a('0x89'),_0x538170,_0x4d970f[0x0],_0x15cc1f);}else{_0x2460ea=_0x15cc1f;}}}}var _0x25abc1={'name':_0x1a5f38,'description':_0x535ea4,'path':path[_0x7a8a('0x54')](_0x538170,_0x4d970f[0x0]),'type':_0x572258,'sidebar':_0x5e71a7,'icon':_0x48874f,'adminUrl':_0x111276,'agentUrl':_0x2460ea,'scriptName':_0x2d2822,'scriptPath':_0x441faf,'version':_0x2f93eb};removeReferences(_0x4cc26e,null);return db[_0x7a8a('0x4b')]['create'](_0x25abc1)['then'](function(_0x4a700f){var _0x516f22={'role':_0x40eefb[_0x7a8a('0x8d')]['role'],'userProfileId':_0x40eefb[_0x7a8a('0x8d')][_0x7a8a('0x8e')]};if(!_0x516f22)throw new Error(_0x7a8a('0x8f'));if(_0x516f22[_0x7a8a('0x90')]===_0x7a8a('0x91')){var _0x261bea=_0x4a700f[_0x7a8a('0x2c')]({'plain':!![]});return db[_0x7a8a('0x92')][_0x7a8a('0x51')]({'where':{'name':_0x7a8a('0x2d'),'userProfileId':_0x516f22[_0x7a8a('0x8e')]},'raw':!![]})[_0x7a8a('0x2a')](function(_0x1686ec){if(_0x1686ec&&_0x1686ec[_0x7a8a('0x93')]===0x0){return db[_0x7a8a('0x2e')][_0x7a8a('0x94')]({'name':_0x261bea[_0x7a8a('0x32')],'resourceId':_0x261bea['id'],'type':_0x1686ec[_0x7a8a('0x32')],'sectionId':_0x1686ec['id']},{})[_0x7a8a('0x2a')](function(){return _0x4a700f;});}else{return _0x4a700f;}})[_0x7a8a('0x4f')](function(_0x4e9e51){logger[_0x7a8a('0x30')](_0x7a8a('0x95'),_0x4e9e51);throw _0x4e9e51;});}return _0x4a700f;})[_0x7a8a('0x2a')](respondWithResult(_0x24c1cb,null))[_0x7a8a('0x4f')](handleError(_0x24c1cb,null));}});}catch(_0x584800){_0x24c1cb[_0x7a8a('0x1e')](0x1f4)[_0x7a8a('0x33')](_0x584800);}};function removeReferences(_0x6892a4,_0xde1ddc){try{if(_0x6892a4){fs[_0x7a8a('0x96')](_0x6892a4);logger['info'](_0x7a8a('0x97'));}if(_0xde1ddc){rimraf(_0xde1ddc,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x440818){logger[_0x7a8a('0x30')](_0x440818);}}exports[_0x7a8a('0x29')]=function(_0x1be95e,_0x1e74d4,_0x5781ac){return db[_0x7a8a('0x4b')][_0x7a8a('0x51')]({'where':{'id':_0x1be95e['params']['id']}})[_0x7a8a('0x2a')](handleEntityNotFound(_0x1e74d4,null))[_0x7a8a('0x2a')](saveUpdates(_0x1be95e[_0x7a8a('0x8d')],null))[_0x7a8a('0x2a')](respondWithResult(_0x1e74d4,null))['catch'](handleError(_0x1e74d4,null));};exports['delete']=function(_0x21c037,_0x5a51a2,_0x12e4ca){return db[_0x7a8a('0x4b')]['find']({'where':{'id':_0x21c037['params']['id']}})[_0x7a8a('0x2a')](function(_0x1d3b96){if(_0x1d3b96){return _0x1d3b96[_0x7a8a('0x2b')]();}})[_0x7a8a('0x2a')](function(_0x107c62){rimraf(path[_0x7a8a('0x54')](config[_0x7a8a('0x55')],'server/files/plugins',path[_0x7a8a('0x98')](_0x107c62[_0x7a8a('0x53')])),function(){});return _0x107c62;})['then'](handleEntityNotFound(_0x5a51a2,null))[_0x7a8a('0x2a')](respondWithStatusCode(_0x5a51a2,null))[_0x7a8a('0x4f')](handleError(_0x5a51a2,null));};exports[_0x7a8a('0x99')]=function(_0x4c5c10,_0x2198f4,_0x437b79){return BPromise['resolve']()[_0x7a8a('0x2a')](function(){if(!_0x4c5c10['query']['path']){throw new Error(_0x7a8a('0x9a'));}if(!_0x4c5c10['query']['port']){throw new Error(_0x7a8a('0x9b'));}var _0x4787de=_0x4c5c10[_0x7a8a('0x3b')]['hostname']?_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x9c')]+':'+_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x9d')]:_0x7a8a('0x9e')+_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x9d')];var _0x5f53ba=_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x20')]?_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x20')]:!![];var _0x42d2ec=_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x9f')]?_0x4c5c10['query'][_0x7a8a('0x9f')]:null;var _0x3ad33e={'method':_0x4c5c10['method'],'uri':util[_0x7a8a('0x57')](_0x7a8a('0xa0'),_0x4787de,_0x4c5c10[_0x7a8a('0x3b')][_0x7a8a('0x53')]),'json':_0x5f53ba,'resolveWithFullResponse':!![],'encoding':_0x42d2ec,'qs':_0x4c5c10[_0x7a8a('0x3b')]};if(_0x4c5c10[_0x7a8a('0xa1')]){_0x3ad33e[_0x7a8a('0xa1')]=_0x4c5c10[_0x7a8a('0xa1')];if(_0x3ad33e['headers'][_0x7a8a('0xa2')]){delete _0x3ad33e[_0x7a8a('0xa1')][_0x7a8a('0xa2')];}}if(_0x3ad33e[_0x7a8a('0xa1')][_0x7a8a('0xa3')]){delete _0x3ad33e['headers'][_0x7a8a('0xa3')];}return rp(_0x3ad33e);})[_0x7a8a('0x2a')](function(_0x47e277){if(_0x47e277){_0x2198f4[_0x7a8a('0x24')](_0x47e277['headers']);logger[_0x7a8a('0x65')](_0x47e277[_0x7a8a('0x8d')]);if(_[_0x7a8a('0xa4')](_0x4c5c10[_0x7a8a('0x3b')]['path'],_0x7a8a('0x52'))&&_0x47e277[_0x7a8a('0xa5')]==0x1f4){return _0x2198f4[_0x7a8a('0x2f')](_0x47e277[_0x7a8a('0xa5')]);}else{return _0x2198f4['status'](_0x47e277[_0x7a8a('0xa5')])[_0x7a8a('0x33')](_0x47e277['body']);}}else{return _0x2198f4[_0x7a8a('0x2f')](0xc8);}})[_0x7a8a('0x4f')](handleError(_0x2198f4,null));};exports[_0x7a8a('0xa6')]=function(_0x164d9f,_0x5df37b,_0x2ae4be){return BPromise[_0x7a8a('0xa7')]()[_0x7a8a('0x2a')](function(){if(!_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x53')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x9d')]){throw new Error(_0x7a8a('0x9b'));}var _0x595ee0=_0x164d9f[_0x7a8a('0x3b')]['hostname']?_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x9c')]+':'+_0x164d9f[_0x7a8a('0x3b')]['port']:'http://localhost:'+_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x9d')];var _0x324a69=_0x164d9f[_0x7a8a('0x3b')]['json']?_0x164d9f[_0x7a8a('0x3b')]['json']:!![];var _0x8ed23d=_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x9f')]?_0x164d9f[_0x7a8a('0x3b')][_0x7a8a('0x9f')]:null;var _0x30c827={'method':_0x164d9f[_0x7a8a('0xa8')],'uri':util[_0x7a8a('0x57')](_0x7a8a('0xa0'),_0x595ee0,_0x164d9f[_0x7a8a('0x3b')]['path']),'json':_0x324a69,'resolveWithFullResponse':!![],'encoding':_0x8ed23d,'body':_0x164d9f['body']};if(_0x164d9f['headers']){_0x30c827['headers']=_0x164d9f[_0x7a8a('0xa1')];if(_0x30c827[_0x7a8a('0xa1')]['content-length']){delete _0x30c827[_0x7a8a('0xa1')][_0x7a8a('0xa2')];}}if(_0x30c827['headers'][_0x7a8a('0xa3')]){delete _0x30c827[_0x7a8a('0xa1')][_0x7a8a('0xa3')];}return rp(_0x30c827);})[_0x7a8a('0x2a')](function(_0x665b8f){if(_0x665b8f){_0x5df37b[_0x7a8a('0x24')](_0x665b8f[_0x7a8a('0xa1')]);logger[_0x7a8a('0x65')](_0x665b8f[_0x7a8a('0x8d')]);return _0x5df37b[_0x7a8a('0x1e')](_0x665b8f[_0x7a8a('0xa5')])[_0x7a8a('0x33')](_0x665b8f['body']);}else{return _0x5df37b[_0x7a8a('0x2f')](0xc8);}})['catch'](handleError(_0x5df37b,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ccf67bd..e2eeeb2 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 _0x5e8d=['hasOwnProperty','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x573a47,_0x1e909b){var _0x4b232e=function(_0x198995){while(--_0x198995){_0x573a47['push'](_0x573a47['shift']());}};_0x4b232e(++_0x1e909b);}(_0x5e8d,0x11a));var _0xd5e8=function(_0xd6841b,_0xcf9290){_0xd6841b=_0xd6841b-0x0;var _0x38eab5=_0x5e8d[_0xd6841b];return _0x38eab5;};'use strict';var EventEmitter=require(_0xd5e8('0x0'));var Plugin=require(_0xd5e8('0x1'))['db'][_0xd5e8('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd5e8('0x3')](0x0);var events={'afterCreate':_0xd5e8('0x4'),'afterUpdate':_0xd5e8('0x5'),'afterDestroy':_0xd5e8('0x6')};function emitEvent(_0x48375a){return function(_0x2c2191,_0xa3ad8a,_0x4c1dda){PluginEvents[_0xd5e8('0x7')](_0x48375a+':'+_0x2c2191['id'],_0x2c2191);PluginEvents[_0xd5e8('0x7')](_0x48375a,_0x2c2191);_0x4c1dda(null);};}for(var e in events){if(events[_0xd5e8('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xd5e8('0x9')]=PluginEvents; \ No newline at end of file +var _0x39c7=['save','update','remove','hasOwnProperty','hook','../../mysqldb','Plugin','setMaxListeners'];(function(_0x57ed05,_0x4e28b7){var _0x5c08eb=function(_0x46293b){while(--_0x46293b){_0x57ed05['push'](_0x57ed05['shift']());}};_0x5c08eb(++_0x4e28b7);}(_0x39c7,0x85));var _0x739c=function(_0x1bd41f,_0x1044e2){_0x1bd41f=_0x1bd41f-0x0;var _0x456a47=_0x39c7[_0x1bd41f];return _0x456a47;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x739c('0x0'))['db'][_0x739c('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x739c('0x2')](0x0);var events={'afterCreate':_0x739c('0x3'),'afterUpdate':_0x739c('0x4'),'afterDestroy':_0x739c('0x5')};function emitEvent(_0x48c547){return function(_0x11c0a6,_0xff8215,_0x43dd74){PluginEvents['emit'](_0x48c547+':'+_0x11c0a6['id'],_0x11c0a6);PluginEvents['emit'](_0x48c547,_0x11c0a6);_0x43dd74(null);};}for(var e in events){if(events[_0x739c('0x6')](e)){var event=events[e];Plugin[_0x739c('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 59d73bb..339eba5 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 _0xa952=['../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2de814,_0x3c1953){var _0x43dc42=function(_0x4fe884){while(--_0x4fe884){_0x2de814['push'](_0x2de814['shift']());}};_0x43dc42(++_0x3c1953);}(_0xa952,0x1b2));var _0x2a95=function(_0x4211bd,_0xfc36c6){_0x4211bd=_0x4211bd-0x0;var _0x5154a6=_0xa952[_0x4211bd];return _0x5154a6;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var logger=require(_0x2a95('0x2'))(_0x2a95('0x3'));var moment=require(_0x2a95('0x4'));var BPromise=require(_0x2a95('0x5'));var rp=require(_0x2a95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a95('0x7'));var config=require(_0x2a95('0x8'));var attributes=require(_0x2a95('0x9'));module[_0x2a95('0xa')]=function(_0x53c54f,_0x153806){return _0x53c54f[_0x2a95('0xb')](_0x2a95('0xc'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5ad=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins'];(function(_0x5af948,_0x5c7c39){var _0x565dba=function(_0x2d5bea){while(--_0x2d5bea){_0x5af948['push'](_0x5af948['shift']());}};_0x565dba(++_0x5c7c39);}(_0xc5ad,0xea));var _0xdc5a=function(_0x299289,_0x3e007e){_0x299289=_0x299289-0x0;var _0x9a347a=_0xc5ad[_0x299289];return _0x9a347a;};'use strict';var _=require(_0xdc5a('0x0'));var util=require(_0xdc5a('0x1'));var logger=require(_0xdc5a('0x2'))(_0xdc5a('0x3'));var moment=require(_0xdc5a('0x4'));var BPromise=require(_0xdc5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc5a('0x6'));var rimraf=require(_0xdc5a('0x7'));var config=require(_0xdc5a('0x8'));var attributes=require(_0xdc5a('0x9'));module[_0xdc5a('0xa')]=function(_0x51544e,_0x5a71f1){return _0x51544e[_0xdc5a('0xb')]('Plugin',attributes,{'tableName':_0xdc5a('0xc'),'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 2b4033b..9595ecd 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 _0x37e9=['message','info','result','catch','CreatePlugin','Plugin','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','request','then','request\x20sent','debug','stringify','error','Plugin,\x20%s,\x20%s'];(function(_0x3e2efa,_0x1a075b){var _0x1f259b=function(_0xba380e){while(--_0xba380e){_0x3e2efa['push'](_0x3e2efa['shift']());}};_0x1f259b(++_0x1a075b);}(_0x37e9,0x1e7));var _0x937e=function(_0x5460cc,_0x13ec73){_0x5460cc=_0x5460cc-0x0;var _0x346fb2=_0x37e9[_0x5460cc];return _0x346fb2;};'use strict';var _=require(_0x937e('0x0'));var util=require(_0x937e('0x1'));var moment=require(_0x937e('0x2'));var BPromise=require(_0x937e('0x3'));var rs=require(_0x937e('0x4'));var fs=require('fs');var Redis=require(_0x937e('0x5'));var db=require(_0x937e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x937e('0x7'))(_0x937e('0x8'));var config=require(_0x937e('0x9'));var jayson=require(_0x937e('0xa'));var client=jayson[_0x937e('0xb')][_0x937e('0xc')]({'port':0x232a});config['redis']=_[_0x937e('0xd')](config[_0x937e('0xe')],{'host':_0x937e('0xf'),'port':0x18eb});var socket=require(_0x937e('0x10'))(new Redis(config[_0x937e('0xe')]));require(_0x937e('0x11'))['register'](socket);function respondWithRpcPromise(_0x4b9059,_0x359f09,_0x1c3a8c){return new BPromise(function(_0x32f562,_0x2f71ed){return client[_0x937e('0x12')](_0x4b9059,_0x1c3a8c)[_0x937e('0x13')](function(_0x490e42){logger['info']('Plugin,\x20%s,\x20%s',_0x359f09,_0x937e('0x14'));logger[_0x937e('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x359f09,_0x937e('0x14'),JSON[_0x937e('0x16')](_0x490e42));if(_0x490e42[_0x937e('0x17')]){if(_0x490e42[_0x937e('0x17')]['code']===0x1f4){logger[_0x937e('0x17')](_0x937e('0x18'),_0x359f09,_0x490e42[_0x937e('0x17')][_0x937e('0x19')]);return _0x2f71ed(_0x490e42['error'][_0x937e('0x19')]);}logger[_0x937e('0x17')](_0x937e('0x18'),_0x359f09,_0x490e42[_0x937e('0x17')][_0x937e('0x19')]);return _0x32f562(_0x490e42[_0x937e('0x17')][_0x937e('0x19')]);}else{logger[_0x937e('0x1a')]('Plugin,\x20%s,\x20%s',_0x359f09,'request\x20sent');_0x32f562(_0x490e42[_0x937e('0x1b')][_0x937e('0x19')]);}})[_0x937e('0x1c')](function(_0x2c0420){logger[_0x937e('0x17')](_0x937e('0x18'),_0x359f09,_0x2c0420);_0x2f71ed(_0x2c0420);});});}exports[_0x937e('0x1d')]=function(_0x244109){var _0x456533=this;return new Promise(function(_0x5a8903,_0x25c1e3){return db[_0x937e('0x1e')]['create'](_0x244109['body'],{'raw':_0x244109[_0x937e('0x1f')]?_0x244109[_0x937e('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x937e('0x13')](function(_0x5ae493){logger[_0x937e('0x1a')](_0x937e('0x1d'),_0x244109);logger[_0x937e('0x15')](_0x937e('0x1d'),_0x244109,JSON[_0x937e('0x16')](_0x5ae493));_0x5a8903(_0x5ae493);})['catch'](function(_0x43ce58){logger[_0x937e('0x17')](_0x937e('0x1d'),_0x43ce58[_0x937e('0x19')],_0x244109);_0x25c1e3(_0x456533[_0x937e('0x17')](0x1f4,_0x43ce58[_0x937e('0x19')]));});});}; \ No newline at end of file +var _0x9548=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','bluebird','ioredis','../../config/environment','client'];(function(_0x582343,_0x56519e){var _0x3af364=function(_0x999f42){while(--_0x999f42){_0x582343['push'](_0x582343['shift']());}};_0x3af364(++_0x56519e);}(_0x9548,0xcc));var _0x8954=function(_0x19fcac,_0x19439f){_0x19fcac=_0x19fcac-0x0;var _0x30086a=_0x9548[_0x19fcac];return _0x30086a;};'use strict';var _=require(_0x8954('0x0'));var util=require(_0x8954('0x1'));var moment=require('moment');var BPromise=require(_0x8954('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8954('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8954('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8954('0x5')][_0x8954('0x6')]({'port':0x232a});config[_0x8954('0x7')]=_[_0x8954('0x8')](config[_0x8954('0x7')],{'host':_0x8954('0x9'),'port':0x18eb});var socket=require(_0x8954('0xa'))(new Redis(config['redis']));require('./plugin.socket')[_0x8954('0xb')](socket);function respondWithRpcPromise(_0x5d715b,_0x58e25e,_0xd0c24f){return new BPromise(function(_0x96858f,_0x2a7287){return client[_0x8954('0xc')](_0x5d715b,_0xd0c24f)[_0x8954('0xd')](function(_0x4ecac4){logger[_0x8954('0xe')](_0x8954('0xf'),_0x58e25e,_0x8954('0x10'));logger[_0x8954('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x58e25e,_0x8954('0x10'),JSON[_0x8954('0x12')](_0x4ecac4));if(_0x4ecac4[_0x8954('0x13')]){if(_0x4ecac4[_0x8954('0x13')][_0x8954('0x14')]===0x1f4){logger['error'](_0x8954('0xf'),_0x58e25e,_0x4ecac4[_0x8954('0x13')][_0x8954('0x15')]);return _0x2a7287(_0x4ecac4[_0x8954('0x13')]['message']);}logger[_0x8954('0x13')](_0x8954('0xf'),_0x58e25e,_0x4ecac4[_0x8954('0x13')][_0x8954('0x15')]);return _0x96858f(_0x4ecac4['error'][_0x8954('0x15')]);}else{logger[_0x8954('0xe')](_0x8954('0xf'),_0x58e25e,'request\x20sent');_0x96858f(_0x4ecac4[_0x8954('0x16')][_0x8954('0x15')]);}})[_0x8954('0x17')](function(_0x1fd942){logger[_0x8954('0x13')](_0x8954('0xf'),_0x58e25e,_0x1fd942);_0x2a7287(_0x1fd942);});});}exports[_0x8954('0x18')]=function(_0x2cc1b1){var _0x35ea64=this;return new Promise(function(_0x4b58d2,_0x4c87b3){return db[_0x8954('0x19')][_0x8954('0x1a')](_0x2cc1b1[_0x8954('0x1b')],{'raw':_0x2cc1b1['options']?_0x2cc1b1[_0x8954('0x1c')][_0x8954('0x1d')]===undefined?!![]:![]:!![]})[_0x8954('0xd')](function(_0x277742){logger[_0x8954('0xe')](_0x8954('0x18'),_0x2cc1b1);logger[_0x8954('0x11')](_0x8954('0x18'),_0x2cc1b1,JSON[_0x8954('0x12')](_0x277742));_0x4b58d2(_0x277742);})[_0x8954('0x17')](function(_0x1cdaa7){logger[_0x8954('0x13')]('CreatePlugin',_0x1cdaa7[_0x8954('0x15')],_0x2cc1b1);_0x4c87b3(_0x35ea64[_0x8954('0x13')](0x1f4,_0x1cdaa7[_0x8954('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 82198bb..654cc8d 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 _0xf2fb=['emit','removeListener','register','length','./plugin.events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xf2fb,0x112));var _0xbf2f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2fb[_0x122ef9];return _0x42fba0;};'use strict';var PluginEvents=require(_0xbf2f('0x0'));var events=['save','remove','update'];function createListener(_0xf0ba8a,_0x4d45a5){return function(_0x2cb575){_0x4d45a5[_0xbf2f('0x1')](_0xf0ba8a,_0x2cb575);};}function removeListener(_0x56fd3e,_0x30808d){return function(){PluginEvents[_0xbf2f('0x2')](_0x56fd3e,_0x30808d);};}exports[_0xbf2f('0x3')]=function(_0x1e85c0){for(var _0x34ffa7=0x0,_0x545c3b=events[_0xbf2f('0x4')];_0x34ffa7<_0x545c3b;_0x34ffa7++){var _0x184219=events[_0x34ffa7];var _0x39031b=createListener('plugin:'+_0x184219,_0x1e85c0);PluginEvents['on'](_0x184219,_0x39031b);}}; \ No newline at end of file +var _0x75de=['register','./plugin.events'];(function(_0xc4e9cf,_0x470fc0){var _0x1c431f=function(_0x92f14){while(--_0x92f14){_0xc4e9cf['push'](_0xc4e9cf['shift']());}};_0x1c431f(++_0x470fc0);}(_0x75de,0x1e5));var _0xe75d=function(_0x1acb12,_0x4f5300){_0x1acb12=_0x1acb12-0x0;var _0x1b1cd2=_0x75de[_0x1acb12];return _0x1b1cd2;};'use strict';var PluginEvents=require(_0xe75d('0x0'));var events=['save','remove','update'];function createListener(_0x592eba,_0x58d880){return function(_0x263ad2){_0x58d880['emit'](_0x592eba,_0x263ad2);};}function removeListener(_0x31e749,_0x1650e1){return function(){PluginEvents['removeListener'](_0x31e749,_0x1650e1);};}exports[_0xe75d('0x1')]=function(_0x2c3948){for(var _0x270c9b=0x0,_0x1e2680=events['length'];_0x270c9b<_0x1e2680;_0x270c9b++){var _0x448351=events[_0x270c9b];var _0x2ffba0=createListener('plugin:'+_0x448351,_0x2c3948);PluginEvents['on'](_0x448351,_0x2ffba0);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 654fdc1..3dd3f1c 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3a3278,_0x231919){var _0x41000d=function(_0x11af85){while(--_0x11af85){_0x3a3278['push'](_0x3a3278['shift']());}};_0x41000d(++_0x231919);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x2de5ea,_0x2e4b5b){var _0x101b82=function(_0x4a9ec2){while(--_0x4a9ec2){_0x2de5ea['push'](_0x2de5ea['shift']());}};_0x101b82(++_0x2e4b5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 5e5bd35..28b4c70 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 _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x3e5060,_0x23438a){var _0x34e0f9=function(_0x4bc65f){while(--_0x4bc65f){_0x3e5060['push'](_0x3e5060['shift']());}};_0x34e0f9(++_0x23438a);}(_0x2750,0x13b));var _0x0275=function(_0x11cf04,_0xf9ae50){_0x11cf04=_0x11cf04-0x0;var _0x254acf=_0x2750[_0x11cf04];return _0x254acf;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xdace=['path','exec','bluebird','sendStatus','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','express','length','catch','show','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','params','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/logger','api'];(function(_0x48ffee,_0x5689e8){var _0x84674f=function(_0x4348e9){while(--_0x4348e9){_0x48ffee['push'](_0x48ffee['shift']());}};_0x84674f(++_0x5689e8);}(_0xdace,0xc5));var _0xedac=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xdace[_0x117f4c];return _0x2b24e9;};'use strict';var _=require(_0xedac('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var path=require(_0xedac('0x3'));var exec=require('child_process')[_0xedac('0x4')];var BPromise=require(_0xedac('0x5'));function handleEntityNotFound(_0x15d3bd,_0xefb142){return function(_0x5a97c0){if(!_0x5a97c0){_0x15d3bd[_0xedac('0x6')](0x194);;}return _0x5a97c0;};}function respondWithResult(_0x1cba89,_0x39328a){_0x39328a=_0x39328a||0xc8;return function(_0x5ecbd3){if(_0x5ecbd3){return _0x1cba89[_0xedac('0x7')](_0x39328a)[_0xedac('0x8')](_0x5ecbd3);}return null;};}function handleError(_0x162eea,_0x53fa43){_0x53fa43=_0x53fa43||0x1f4;return function(_0x27243f){logger[_0xedac('0x9')](_0x27243f[_0xedac('0xa')]);if(_0x27243f['name']){delete _0x27243f['name'];}_0x162eea[_0xedac('0x7')](_0x53fa43)[_0xedac('0xb')](_0x27243f);};}function execChildProcess(){return new BPromise(function(_0x57e1bf,_0x4d6a29){exec(_0xedac('0xc'),function(_0x25395d,_0x57f637,_0x261401){logger['info'](_0x57f637);logger[_0xedac('0xd')](_0x261401);if(_0x25395d){logger[_0xedac('0x9')](_0x25395d);return _0x4d6a29(_0x25395d);}return _0x57e1bf(_0x57f637);});});}exports[_0xedac('0xe')]=function(_0x342186,_0x9a79a0){return pm2[_0xedac('0xf')]()[_0xedac('0x10')](function(_0x11f0b0){if(_0x11f0b0){var _0x593030=_[_0xedac('0x11')](_0x11f0b0,function(_0x4651d4){return _0x4651d4[_0xedac('0x12')]===_0xedac('0x13')||_0x4651d4[_0xedac('0x12')]==='motion2';});return{'rows':_0x593030,'count':_0x593030[_0xedac('0x14')]};}return null;})['then'](respondWithResult(_0x9a79a0,null))[_0xedac('0x15')](handleError(_0x9a79a0,null));};exports[_0xedac('0x16')]=function(_0xdad128,_0xba0c93){return pm2['describe'](_0xdad128['params']['id'])[_0xedac('0x10')](respondWithResult(_0xba0c93,null))[_0xedac('0x10')](handleEntityNotFound(_0xba0c93,null))[_0xedac('0x15')](handleError(_0xba0c93,null));};exports[_0xedac('0x17')]=function(_0x5a5438,_0x4a699b){if(_0x5a5438[_0xedac('0x18')][_0xedac('0x12')]&&_0x5a5438[_0xedac('0x18')][_0xedac('0x19')]){var _0x2f5eee=path[_0xedac('0x1a')](__dirname,_0xedac('0x1b'),_0x5a5438[_0xedac('0x18')]['script']);var _0x4593e8=process['cwd']();process[_0xedac('0x1c')](path[_0xedac('0x1d')](_0x2f5eee));return execChildProcess()['then'](function(_0x46e09d){process[_0xedac('0x1c')](_0x4593e8);return pm2[_0xedac('0x1e')]({'name':_0x5a5438[_0xedac('0x18')][_0xedac('0x12')],'script':_0x2f5eee});})[_0xedac('0x10')](function(_0x5d7c31){pm2[_0xedac('0x1f')]();return _0x5d7c31[0x0];})[_0xedac('0x10')](respondWithResult(_0x4a699b,0xc9))[_0xedac('0x15')](handleError(_0x4a699b,null));}else{return _0x4a699b[_0xedac('0x7')](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x20')});}};exports[_0xedac('0x21')]=function(_0x26c6f7,_0x409825){if(_0x26c6f7[_0xedac('0x18')]['id']){delete _0x26c6f7['body']['id'];}var _0x25d7f5={'online':_0xedac('0x22'),'stopped':_0xedac('0x23')};if(_0x25d7f5['hasOwnProperty'](_0x26c6f7[_0xedac('0x18')]['status'])){return pm2[_0x25d7f5[_0x26c6f7['body'][_0xedac('0x7')]]](_0x26c6f7[_0xedac('0x24')]['id'])[_0xedac('0x10')](respondWithResult(_0x409825,0xc8))[_0xedac('0x15')](handleError(_0x409825,null));}else{return _0x409825['status'](0x1f4)['send']({'message':_0xedac('0x25')});}};exports[_0xedac('0x26')]=function(_0x24b182,_0x2ee8d7){if(_0x24b182[_0xedac('0x18')]['id']){delete _0x24b182[_0xedac('0x18')]['id'];}if(_0x24b182[_0xedac('0x24')]['id']){return pm2['delete'](_0x24b182[_0xedac('0x24')]['id'])[_0xedac('0x10')](function(_0x2cbe33){pm2['dump']();return _0x2cbe33[0x0];})[_0xedac('0x10')](respondWithResult(_0x2ee8d7,null))[_0xedac('0x15')](handleError(_0x2ee8d7,null));}else{return _0x2ee8d7['status'](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 9fb8de2..bfdf2fb 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4364=['express','get','/queues','getQueues'];(function(_0x15e426,_0x3dcf1a){var _0x10fb3c=function(_0x376e48){while(--_0x376e48){_0x15e426['push'](_0x15e426['shift']());}};_0x10fb3c(++_0x3dcf1a);}(_0x4364,0x1b0));var _0x4436=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4364[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x4436('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x4436('0x1')](_0x4436('0x2'),auth['isAuthenticated'](),controller[_0x4436('0x3')]);module['exports']=router; \ No newline at end of file +var _0x7e74=['express','../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated','exports'];(function(_0x291f52,_0xd7ac54){var _0x4ffb2e=function(_0x1f43af){while(--_0x1f43af){_0x291f52['push'](_0x291f52['shift']());}};_0x4ffb2e(++_0xd7ac54);}(_0x7e74,0xbd));var _0x47e7=function(_0x5e5c26,_0x2d13a7){_0x5e5c26=_0x5e5c26-0x0;var _0x3c8454=_0x7e74[_0x5e5c26];return _0x3c8454;};'use strict';var express=require(_0x47e7('0x0'));var router=express['Router']();var auth=require(_0x47e7('0x1'));var controller=require(_0x47e7('0x2'));router[_0x47e7('0x3')](_0x47e7('0x4'),auth[_0x47e7('0x5')](),controller['getQueues']);module[_0x47e7('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 495437f..264632a 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb4b=['push','User','QueueId','Pause','agent','length','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','status','set','Content-Range','json','error','stack','name','send','getQueues','mail','chat','sms','openchannel','whatsapp','resolve','then','query','channel','toLowerCase','startCase','Queue','map','rawAttributes','type','key','user','role','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','findAndCountAll','count','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','talking','paused','outbound','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','waiting','originated','agents','find','merge','pick','getAgents','online','getMembers','UserId'];(function(_0x149453,_0x31aa64){var _0xcb1048=function(_0x3db762){while(--_0x3db762){_0x149453['push'](_0x149453['shift']());}};_0xcb1048(++_0x31aa64);}(_0xcb4b,0x172));var _0xbcb4=function(_0x4145b5,_0x1a41ad){_0x4145b5=_0x4145b5-0x0;var _0xe11a00=_0xcb4b[_0x4145b5];return _0xe11a00;};'use strict';var util=require(_0xbcb4('0x0'));var _=require(_0xbcb4('0x1'));var jayson=require(_0xbcb4('0x2'));var qs=require(_0xbcb4('0x3'));var logger=require(_0xbcb4('0x4'))('api');var db=require(_0xbcb4('0x5'))['db'];var client=jayson[_0xbcb4('0x6')][_0xbcb4('0x7')]({'port':0x232a});var routingClient=jayson[_0xbcb4('0x6')][_0xbcb4('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x473e50,_0x23e0f1){return function(_0x1d575a){if(_0x1d575a){var _0x46932c=typeof _0x23e0f1[_0xbcb4('0x8')]===_0xbcb4('0x9')&&typeof _0x23e0f1[_0xbcb4('0xa')]===_0xbcb4('0x9');var _0x6c396f=_0x1d575a['count'];var _0x20104f=_0x46932c?0x0:_0x23e0f1[_0xbcb4('0x8')];var _0x200a18=_0x46932c?_0x1d575a['count']:_0x23e0f1[_0xbcb4('0x8')]+_0x23e0f1[_0xbcb4('0xa')];var _0x4ed200;if(_0x200a18>=_0x6c396f){_0x200a18=_0x6c396f;_0x4ed200=0xc8;}else{_0x4ed200=0xce;}_0x473e50[_0xbcb4('0xb')](_0x4ed200);return _0x473e50[_0xbcb4('0xc')](_0xbcb4('0xd'),_0x20104f+'-'+_0x200a18+'/'+_0x6c396f)[_0xbcb4('0xe')](_0x1d575a);}return null;};}function handleError(_0x3204f2,_0x31b1fd){_0x31b1fd=_0x31b1fd||0x1f4;return function(_0x46ada2){logger[_0xbcb4('0xf')](_0x46ada2[_0xbcb4('0x10')]);if(_0x46ada2[_0xbcb4('0x11')]){delete _0x46ada2['name'];}_0x3204f2['status'](_0x31b1fd)[_0xbcb4('0x12')](_0x46ada2);};}exports[_0xbcb4('0x13')]=function(_0x34ade8,_0x273a70){var _0x22ce37=[_0xbcb4('0x14'),_0xbcb4('0x15'),_0xbcb4('0x16'),_0xbcb4('0x17'),'fax',_0xbcb4('0x18'),'voice'];var _0xcf7fc6={'count':0x0,'rows':[]},_0x46a16c={},_0xf07658;Promise[_0xbcb4('0x19')]()[_0xbcb4('0x1a')](function(){if(_0x34ade8[_0xbcb4('0x1b')][_0xbcb4('0x1c')]){if(!_['includes'](_0x22ce37,_0x34ade8['query'][_0xbcb4('0x1c')][_0xbcb4('0x1d')]()))throw new Error('Invalid\x20channel');_0xf07658=_0x34ade8[_0xbcb4('0x1b')]['channel'][_0xbcb4('0x1d')]();}var _0x167766=_[_0xbcb4('0x1e')](_0xf07658)+_0xbcb4('0x1f');var _0x59d7a0=_[_0xbcb4('0x20')](db[_0x167766][_0xbcb4('0x21')],function(_0x2f6cad){return{'name':_0x2f6cad['fieldName'],'type':_0x2f6cad[_0xbcb4('0x22')][_0xbcb4('0x23')]};});_0x46a16c=qs['getOptions'](_0x59d7a0,_0x34ade8);if(_0x34ade8[_0xbcb4('0x24')][_0xbcb4('0x25')]===_0xbcb4('0x24')){var _0x5a32d3={'params':{'id':_0x34ade8[_0xbcb4('0x24')][_0xbcb4('0x26')]},'query':{'section':_0xf07658===_0xbcb4('0x27')&&_0x34ade8['query'][_0xbcb4('0x22')]==='outbound'?_0xbcb4('0x28'):_[_0xbcb4('0x1e')](_0xf07658)+_0xbcb4('0x29'),'type':_0x34ade8[_0xbcb4('0x1b')]['type'],'nolimit':!![],'sort':_0xbcb4('0x11'),'filter':_0x34ade8['query'][_0xbcb4('0x2a')]}};return db['UserProfile'][_0xbcb4('0x2b')](_0x5a32d3);}return db[_0x167766][_0xbcb4('0x2c')](_0x46a16c);})['then'](function(_0x269267){_0xcf7fc6[_0xbcb4('0x2d')]=_0x269267['count'];var _0x44c95f=_0xf07658==='voice'?client:routingClient;return _0x44c95f[_0xbcb4('0x2e')](_[_0xbcb4('0x1e')](_0xf07658)+_0xbcb4('0x29'),_0x34ade8)[_0xbcb4('0x1a')](function(_0xbc181d){if(_0xbc181d[_0xbcb4('0xf')])throw new Error(util['format'](_0xbcb4('0x2f'),_0xf07658));var _0x25ee32=_0xbc181d[_0xbcb4('0x30')];var _0x3384e7=['loggedIn','available','waiting',_0xbcb4('0x31'),_0xbcb4('0x32')];if(_0xf07658==='voice'&&_0x34ade8[_0xbcb4('0x1b')]['type']===_0xbcb4('0x33')){_0x3384e7['push'](_0xbcb4('0x34'),'originated',_0xbcb4('0x35'),_0xbcb4('0x36'),_0xbcb4('0x37'),_0xbcb4('0x38'),_0xbcb4('0x39'),_0xbcb4('0x3a'),_0xbcb4('0x3b'),_0xbcb4('0x3c'),_0xbcb4('0x3d'),_0xbcb4('0x3e'),_0xbcb4('0x3f'),_0xbcb4('0x40'),_0xbcb4('0x41'),_0xbcb4('0x42'),_0xbcb4('0x43'),_0xbcb4('0x44'),'predictiveIntervalDroppedCallsTimeout',_0xbcb4('0x45'),_0xbcb4('0x46'),_0xbcb4('0x47'));}var _0xf95ffc=_0x269267[_0xbcb4('0x48')][_0xbcb4('0x20')](function(_0x210c13){var _0x453037=_0x210c13[_0xbcb4('0x49')]({'plain':!![]});_0x453037[_0xbcb4('0x32')]=0x0;_0x453037[_0xbcb4('0x4a')]=0x0;_0x453037['loggedIn']=0x0;_0x453037['available']=0x0;_0x453037[_0xbcb4('0x32')]=0x0;_0x453037[_0xbcb4('0x4b')]=0x0;if(_0xf07658===_0xbcb4('0x27')){_0x453037[_0xbcb4('0x31')]=0x0;if(_0x34ade8[_0xbcb4('0x1b')][_0xbcb4('0x22')]===_0xbcb4('0x33')){_0x453037[_0xbcb4('0x34')]=0x0;_0x453037[_0xbcb4('0x4c')]=0x0;}}_0x453037[_0xbcb4('0x4d')]=[];var _0x509582=_[_0xbcb4('0x4e')](_0x25ee32[_0xbcb4('0x48')],['id',_0x453037['id']]);if(_0x509582)_[_0xbcb4('0x4f')](_0x453037,_[_0xbcb4('0x50')](_0x509582,_0x3384e7));if(_0xf07658===_0xbcb4('0x27')){return _0x210c13[_0xbcb4('0x51')]({'attributes':['id',_0xbcb4('0x11'),_0xbcb4('0x52')],'joinTableAttributes':[],'raw':!![]})[_0xbcb4('0x1a')](function(_0x5e0740){return _0x210c13[_0xbcb4('0x53')]({'raw':!![]})['then'](function(_0x36bf0e){for(var _0x31b4f7=0x0;_0x31b4f7<_0x5e0740['length'];_0x31b4f7++){var _0x289a14=_[_0xbcb4('0x4e')](_0x36bf0e,[_0xbcb4('0x54'),_0x5e0740[_0x31b4f7]['id']]);var _0x55a29e={'id':_0x5e0740[_0x31b4f7]['id'],'name':_0x5e0740[_0x31b4f7]['name'],'online':Boolean(_0x5e0740[_0x31b4f7][_0xbcb4('0x52')]),'paused':_0x289a14?Boolean(_0x289a14['paused']):![]};if(_0x55a29e['online'])_0x453037['loggedInDb']++;if(_0x55a29e[_0xbcb4('0x32')])_0x453037[_0xbcb4('0x32')]++;_0x453037[_0xbcb4('0x4d')][_0xbcb4('0x55')](_0x55a29e);}return _0x453037;});});}else{var _0x3a7a18=_0xbcb4('0x56')+_[_0xbcb4('0x1e')](_0xf07658)+_0xbcb4('0x1f');var _0x37d79c=_[_0xbcb4('0x1e')](_0xf07658)+_0xbcb4('0x57');var _0x481e99=_0xf07658+_0xbcb4('0x58');return db[_0x3a7a18]['findAll']({'where':{['userQueueKey']:_0x210c13['id']},'raw':!![]})['then'](function(_0x108e13){return db[_0xbcb4('0x56')]['findAll']({'attributes':['id',_0xbcb4('0x11'),'online',_0x481e99],'where':{'id':_[_0xbcb4('0x20')](_0x108e13,'UserId'),'role':_0xbcb4('0x59')},'raw':!![]});})[_0xbcb4('0x1a')](function(_0x36372d){for(var _0x3b0818=0x0;_0x3b0818<_0x36372d[_0xbcb4('0x5a')];_0x3b0818++){var _0x21923a={'id':_0x36372d[_0x3b0818]['id'],'name':_0x36372d[_0x3b0818]['name'],'online':Boolean(_0x36372d[_0x3b0818][_0xbcb4('0x52')]),'paused':Boolean(_0x36372d[_0x3b0818][_0x481e99])};if(_0x21923a[_0xbcb4('0x52')])_0x453037[_0xbcb4('0x4a')]++;if(_0x21923a[_0xbcb4('0x32')])_0x453037['paused']++;_0x453037[_0xbcb4('0x4d')][_0xbcb4('0x55')](_0x21923a);}return _0x453037;});}});return Promise['all'](_0xf95ffc);});})[_0xbcb4('0x1a')](function(_0x3533b2){_0xcf7fc6[_0xbcb4('0x48')]=_0x3533b2;return _0xcf7fc6;})['then'](respondWithFilteredResult(_0x273a70,_0x46a16c))['catch'](handleError(_0x273a70,null));}; \ No newline at end of file +var _0x4642=['filter','UserProfile','getResources','findAndCountAll','request','result','loggedIn','available','waiting','talking','paused','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','merge','pick','getAgents','online','getMembers','length','UserId','loggedInDb','agents','User','Queue','QueueId','Pause','findAll','agent','all','util','lodash','jayson/promise','../../components/parsers/qs','api','client','http','offset','undefined','limit','count','status','Content-Range','json','error','name','send','getQueues','mail','chat','sms','fax','whatsapp','voice','resolve','then','query','channel','toLowerCase','Invalid\x20channel','startCase','rawAttributes','fieldName','type','getOptions','user','role','userProfileId','outbound'];(function(_0x4c6d31,_0x226ec1){var _0x5b8e08=function(_0x3196d3){while(--_0x3196d3){_0x4c6d31['push'](_0x4c6d31['shift']());}};_0x5b8e08(++_0x226ec1);}(_0x4642,0xe4));var _0x2464=function(_0x543bfb,_0x1be2ec){_0x543bfb=_0x543bfb-0x0;var _0x7fecc9=_0x4642[_0x543bfb];return _0x7fecc9;};'use strict';var util=require(_0x2464('0x0'));var _=require(_0x2464('0x1'));var jayson=require(_0x2464('0x2'));var qs=require(_0x2464('0x3'));var logger=require('../../config/logger')(_0x2464('0x4'));var db=require('../../mysqldb')['db'];var client=jayson[_0x2464('0x5')][_0x2464('0x6')]({'port':0x232a});var routingClient=jayson[_0x2464('0x5')][_0x2464('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x59b399,_0x5822d1){return function(_0x3ab2ba){if(_0x3ab2ba){var _0x5a95d7=typeof _0x5822d1[_0x2464('0x7')]===_0x2464('0x8')&&typeof _0x5822d1[_0x2464('0x9')]===_0x2464('0x8');var _0x5e2e9b=_0x3ab2ba[_0x2464('0xa')];var _0x4093fa=_0x5a95d7?0x0:_0x5822d1[_0x2464('0x7')];var _0x5b721b=_0x5a95d7?_0x3ab2ba[_0x2464('0xa')]:_0x5822d1['offset']+_0x5822d1['limit'];var _0x3aab0a;if(_0x5b721b>=_0x5e2e9b){_0x5b721b=_0x5e2e9b;_0x3aab0a=0xc8;}else{_0x3aab0a=0xce;}_0x59b399[_0x2464('0xb')](_0x3aab0a);return _0x59b399['set'](_0x2464('0xc'),_0x4093fa+'-'+_0x5b721b+'/'+_0x5e2e9b)[_0x2464('0xd')](_0x3ab2ba);}return null;};}function handleError(_0x72b56c,_0x4996ba){_0x4996ba=_0x4996ba||0x1f4;return function(_0x3ec2fd){logger[_0x2464('0xe')](_0x3ec2fd['stack']);if(_0x3ec2fd['name']){delete _0x3ec2fd[_0x2464('0xf')];}_0x72b56c['status'](_0x4996ba)[_0x2464('0x10')](_0x3ec2fd);};}exports[_0x2464('0x11')]=function(_0xe5d591,_0x16e9c4){var _0x4df2dd=[_0x2464('0x12'),_0x2464('0x13'),_0x2464('0x14'),'openchannel',_0x2464('0x15'),_0x2464('0x16'),_0x2464('0x17')];var _0xc643fe={'count':0x0,'rows':[]},_0xaa7767={},_0x378f3a;Promise[_0x2464('0x18')]()[_0x2464('0x19')](function(){if(_0xe5d591[_0x2464('0x1a')][_0x2464('0x1b')]){if(!_['includes'](_0x4df2dd,_0xe5d591[_0x2464('0x1a')][_0x2464('0x1b')][_0x2464('0x1c')]()))throw new Error(_0x2464('0x1d'));_0x378f3a=_0xe5d591[_0x2464('0x1a')][_0x2464('0x1b')][_0x2464('0x1c')]();}var _0x392729=_[_0x2464('0x1e')](_0x378f3a)+'Queue';var _0x18d0e7=_['map'](db[_0x392729][_0x2464('0x1f')],function(_0x4f85b2){return{'name':_0x4f85b2[_0x2464('0x20')],'type':_0x4f85b2[_0x2464('0x21')]['key']};});_0xaa7767=qs[_0x2464('0x22')](_0x18d0e7,_0xe5d591);if(_0xe5d591[_0x2464('0x23')][_0x2464('0x24')]===_0x2464('0x23')){var _0x5461ac={'params':{'id':_0xe5d591['user'][_0x2464('0x25')]},'query':{'section':_0x378f3a===_0x2464('0x17')&&_0xe5d591[_0x2464('0x1a')][_0x2464('0x21')]===_0x2464('0x26')?'QueueCampaigns':_[_0x2464('0x1e')](_0x378f3a)+'Queues','type':_0xe5d591[_0x2464('0x1a')]['type'],'nolimit':!![],'sort':_0x2464('0xf'),'filter':_0xe5d591[_0x2464('0x1a')][_0x2464('0x27')]}};return db[_0x2464('0x28')][_0x2464('0x29')](_0x5461ac);}return db[_0x392729][_0x2464('0x2a')](_0xaa7767);})[_0x2464('0x19')](function(_0x3e4af1){_0xc643fe[_0x2464('0xa')]=_0x3e4af1[_0x2464('0xa')];var _0x541459=_0x378f3a===_0x2464('0x17')?client:routingClient;return _0x541459[_0x2464('0x2b')](_[_0x2464('0x1e')](_0x378f3a)+'Queues',_0xe5d591)[_0x2464('0x19')](function(_0xf8fbb7){if(_0xf8fbb7[_0x2464('0xe')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x378f3a));var _0x379cc3=_0xf8fbb7[_0x2464('0x2c')];var _0x5b6b27=[_0x2464('0x2d'),_0x2464('0x2e'),_0x2464('0x2f'),_0x2464('0x30'),_0x2464('0x31')];if(_0x378f3a===_0x2464('0x17')&&_0xe5d591[_0x2464('0x1a')]['type']===_0x2464('0x26')){_0x5b6b27['push'](_0x2464('0x32'),_0x2464('0x33'),_0x2464('0x34'),'dialActive',_0x2464('0x35'),_0x2464('0x36'),_0x2464('0x37'),_0x2464('0x38'),_0x2464('0x39'),_0x2464('0x3a'),_0x2464('0x3b'),_0x2464('0x3c'),_0x2464('0x3d'),_0x2464('0x3e'),_0x2464('0x3f'),_0x2464('0x40'),'predictiveIntervalTotalCalls',_0x2464('0x41'),_0x2464('0x42'),_0x2464('0x43'),_0x2464('0x44'),_0x2464('0x45'));}var _0xc54b1=_0x3e4af1[_0x2464('0x46')][_0x2464('0x47')](function(_0x3ff1cf){var _0xdf7411=_0x3ff1cf[_0x2464('0x48')]({'plain':!![]});_0xdf7411[_0x2464('0x31')]=0x0;_0xdf7411['loggedInDb']=0x0;_0xdf7411[_0x2464('0x2d')]=0x0;_0xdf7411['available']=0x0;_0xdf7411[_0x2464('0x31')]=0x0;_0xdf7411[_0x2464('0x2f')]=0x0;if(_0x378f3a===_0x2464('0x17')){_0xdf7411[_0x2464('0x30')]=0x0;if(_0xe5d591[_0x2464('0x1a')][_0x2464('0x21')]===_0x2464('0x26')){_0xdf7411[_0x2464('0x32')]=0x0;_0xdf7411['originated']=0x0;}}_0xdf7411['agents']=[];var _0x5e9797=_['find'](_0x379cc3[_0x2464('0x46')],['id',_0xdf7411['id']]);if(_0x5e9797)_[_0x2464('0x49')](_0xdf7411,_[_0x2464('0x4a')](_0x5e9797,_0x5b6b27));if(_0x378f3a===_0x2464('0x17')){return _0x3ff1cf[_0x2464('0x4b')]({'attributes':['id',_0x2464('0xf'),_0x2464('0x4c')],'joinTableAttributes':[],'raw':!![]})[_0x2464('0x19')](function(_0x2506ef){return _0x3ff1cf[_0x2464('0x4d')]({'raw':!![]})['then'](function(_0x51bdc3){for(var _0x194997=0x0;_0x194997<_0x2506ef[_0x2464('0x4e')];_0x194997++){var _0x34391c=_['find'](_0x51bdc3,[_0x2464('0x4f'),_0x2506ef[_0x194997]['id']]);var _0x57504a={'id':_0x2506ef[_0x194997]['id'],'name':_0x2506ef[_0x194997][_0x2464('0xf')],'online':Boolean(_0x2506ef[_0x194997][_0x2464('0x4c')]),'paused':_0x34391c?Boolean(_0x34391c[_0x2464('0x31')]):![]};if(_0x57504a[_0x2464('0x4c')])_0xdf7411[_0x2464('0x50')]++;if(_0x57504a[_0x2464('0x31')])_0xdf7411[_0x2464('0x31')]++;_0xdf7411[_0x2464('0x51')]['push'](_0x57504a);}return _0xdf7411;});});}else{var _0x53a11a=_0x2464('0x52')+_[_0x2464('0x1e')](_0x378f3a)+_0x2464('0x53');var _0x36736d=_[_0x2464('0x1e')](_0x378f3a)+_0x2464('0x54');var _0x2bba40=_0x378f3a+_0x2464('0x55');return db[_0x53a11a][_0x2464('0x56')]({'where':{['userQueueKey']:_0x3ff1cf['id']},'raw':!![]})['then'](function(_0x1aa63e){return db[_0x2464('0x52')][_0x2464('0x56')]({'attributes':['id',_0x2464('0xf'),_0x2464('0x4c'),_0x2bba40],'where':{'id':_[_0x2464('0x47')](_0x1aa63e,_0x2464('0x4f')),'role':_0x2464('0x57')},'raw':!![]});})[_0x2464('0x19')](function(_0x4da460){for(var _0x48d3f6=0x0;_0x48d3f6<_0x4da460[_0x2464('0x4e')];_0x48d3f6++){var _0x19832d={'id':_0x4da460[_0x48d3f6]['id'],'name':_0x4da460[_0x48d3f6][_0x2464('0xf')],'online':Boolean(_0x4da460[_0x48d3f6][_0x2464('0x4c')]),'paused':Boolean(_0x4da460[_0x48d3f6][_0x2bba40])};if(_0x19832d['online'])_0xdf7411['loggedInDb']++;if(_0x19832d[_0x2464('0x31')])_0xdf7411['paused']++;_0xdf7411[_0x2464('0x51')]['push'](_0x19832d);}return _0xdf7411;});}});return Promise[_0x2464('0x58')](_0xc54b1);});})[_0x2464('0x19')](function(_0x7df026){_0xc643fe[_0x2464('0x46')]=_0x7df026;return _0xc643fe;})[_0x2464('0x19')](respondWithFilteredResult(_0x16e9c4,_0xaa7767))['catch'](handleError(_0x16e9c4,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 682875e..349f1e3 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x39a5a0,_0x576399){var _0x4a60ce=function(_0x210a51){while(--_0x210a51){_0x39a5a0['push'](_0x39a5a0['shift']());}};_0x4a60ce(++_0x576399);}(_0xe706,0xa3));var _0x6e70=function(_0x31080a,_0x55b5cd){_0x31080a=_0x31080a-0x0;var _0x58d2fc=_0xe706[_0x31080a];return _0x58d2fc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e3cb3db..ecf520a 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 _0xe978=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe978,0x70));var _0x8e97=function(_0x301718,_0x546e76){_0x301718=_0x301718-0x0;var _0x5a69cb=_0xe978[_0x301718];return _0x5a69cb;};'use strict';var Sequelize=require(_0x8e97('0x0'));module[_0x8e97('0x1')]={'state':{'type':Sequelize[_0x8e97('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x8e97('0x3')]},'starttime':{'type':Sequelize[_0x8e97('0x4')]},'responsetime':{'type':Sequelize[_0x8e97('0x4')]},'ringtime':{'type':Sequelize[_0x8e97('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8e97('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8e97('0x3')]}}; \ No newline at end of file +var _0x1ffe=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0xc8698b,_0x9ef7da){var _0x2c1534=function(_0x4162b6){while(--_0x4162b6){_0xc8698b['push'](_0xc8698b['shift']());}};_0x2c1534(++_0x9ef7da);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x2c70b9,_0x3adda1){_0x2c70b9=_0x2c70b9-0x0;var _0x3e1e5c=_0x1ffe[_0x2c70b9];return _0x3e1e5c;};'use strict';var Sequelize=require(_0xe1ff('0x0'));module[_0xe1ff('0x1')]={'state':{'type':Sequelize[_0xe1ff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe1ff('0x3')]},'scheduledat':{'type':Sequelize[_0xe1ff('0x4')]},'uniqueid':{'type':Sequelize[_0xe1ff('0x3')]},'starttime':{'type':Sequelize[_0xe1ff('0x4')]},'responsetime':{'type':Sequelize[_0xe1ff('0x4')]},'ringtime':{'type':Sequelize[_0xe1ff('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe1ff('0x3')]},'campaigntype':{'type':Sequelize[_0xe1ff('0x3')]},'membername':{'type':Sequelize[_0xe1ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 39dd83c..5b34d9c 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 _0x635c=['request-promise','path','exports','define','ReportAgentPreview','report_agent_preview','lodash','api','moment','bluebird'];(function(_0x3832b5,_0x3a813b){var _0x466368=function(_0x56db97){while(--_0x56db97){_0x3832b5['push'](_0x3832b5['shift']());}};_0x466368(++_0x3a813b);}(_0x635c,0x11e));var _0xc635=function(_0x2044c6,_0x55899c){_0x2044c6=_0x2044c6-0x0;var _0x2e00b7=_0x635c[_0x2044c6];return _0x2e00b7;};'use strict';var _=require(_0xc635('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc635('0x1'));var moment=require(_0xc635('0x2'));var BPromise=require(_0xc635('0x3'));var rp=require(_0xc635('0x4'));var fs=require('fs');var path=require(_0xc635('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xc635('0x6')]=function(_0xdd5893,_0x32e543){return _0xdd5893[_0xc635('0x7')](_0xc635('0x8'),attributes,{'tableName':_0xc635('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39ab=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x515084,_0x12d2c5){var _0x3412d9=function(_0x5748e2){while(--_0x5748e2){_0x515084['push'](_0x515084['shift']());}};_0x3412d9(++_0x12d2c5);}(_0x39ab,0xec));var _0xb39a=function(_0x39c2ee,_0x3d11c8){_0x39c2ee=_0x39c2ee-0x0;var _0x1ad84b=_0x39ab[_0x39c2ee];return _0x1ad84b;};'use strict';var _=require(_0xb39a('0x0'));var util=require(_0xb39a('0x1'));var logger=require(_0xb39a('0x2'))(_0xb39a('0x3'));var moment=require('moment');var BPromise=require(_0xb39a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb39a('0x5'));var rimraf=require(_0xb39a('0x6'));var config=require(_0xb39a('0x7'));var attributes=require(_0xb39a('0x8'));module[_0xb39a('0x9')]=function(_0x30a575,_0xb4b68a){return _0x30a575[_0xb39a('0xa')](_0xb39a('0xb'),attributes,{'tableName':_0xb39a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 64b1fa9..7ae6641 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 _0x5d9d=['catch','ReportAgentPreview','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result'];(function(_0x14f41c,_0x3becf3){var _0x18fcd8=function(_0xd08791){while(--_0xd08791){_0x14f41c['push'](_0x14f41c['shift']());}};_0x18fcd8(++_0x3becf3);}(_0x5d9d,0x101));var _0xd5d9=function(_0xc25159,_0x673abf){_0xc25159=_0xc25159-0x0;var _0x466320=_0x5d9d[_0xc25159];return _0x466320;};'use strict';var _=require(_0xd5d9('0x0'));var util=require(_0xd5d9('0x1'));var moment=require(_0xd5d9('0x2'));var BPromise=require(_0xd5d9('0x3'));var rs=require(_0xd5d9('0x4'));var fs=require('fs');var Redis=require(_0xd5d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5d9('0x6'));var logger=require(_0xd5d9('0x7'))(_0xd5d9('0x8'));var config=require(_0xd5d9('0x9'));var jayson=require(_0xd5d9('0xa'));var client=jayson[_0xd5d9('0xb')][_0xd5d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3833fe,_0x25c252,_0x211416){return new BPromise(function(_0x2a673a,_0x47d441){return client['request'](_0x3833fe,_0x211416)[_0xd5d9('0xd')](function(_0x38fb91){logger[_0xd5d9('0xe')](_0xd5d9('0xf'),_0x25c252,_0xd5d9('0x10'));logger[_0xd5d9('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x25c252,_0xd5d9('0x10'),JSON[_0xd5d9('0x12')](_0x38fb91));if(_0x38fb91['error']){if(_0x38fb91['error'][_0xd5d9('0x13')]===0x1f4){logger[_0xd5d9('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x25c252,_0x38fb91[_0xd5d9('0x14')]['message']);return _0x47d441(_0x38fb91['error'][_0xd5d9('0x15')]);}logger[_0xd5d9('0x14')](_0xd5d9('0xf'),_0x25c252,_0x38fb91[_0xd5d9('0x14')]['message']);return _0x2a673a(_0x38fb91['error'][_0xd5d9('0x15')]);}else{logger[_0xd5d9('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x25c252,_0xd5d9('0x10'));_0x2a673a(_0x38fb91[_0xd5d9('0x16')][_0xd5d9('0x15')]);}})[_0xd5d9('0x17')](function(_0x1e9516){logger[_0xd5d9('0x14')](_0xd5d9('0xf'),_0x25c252,_0x1e9516);_0x47d441(_0x1e9516);});});}exports['CreateReportAgentPreview']=function(_0xb71501){var _0x45cf51=this;return new Promise(function(_0x1df722,_0x439318){return db[_0xd5d9('0x18')]['create'](_0xb71501['body'],{'raw':_0xb71501['options']?_0xb71501[_0xd5d9('0x19')][_0xd5d9('0x1a')]===undefined?!![]:![]:!![]})[_0xd5d9('0xd')](function(_0x3830db){logger['info'](_0xd5d9('0x1b'),_0xb71501);logger[_0xd5d9('0x11')](_0xd5d9('0x1b'),_0xb71501,JSON[_0xd5d9('0x12')](_0x3830db));_0x1df722(_0x3830db);})['catch'](function(_0x2d6c08){logger['error'](_0xd5d9('0x1b'),_0x2d6c08[_0xd5d9('0x15')],_0xb71501);_0x439318(_0x45cf51['error'](0x1f4,_0x2d6c08[_0xd5d9('0x15')]));});});}; \ No newline at end of file +var _0xc939=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc939,0xed));var _0x9c93=function(_0x36d51f,_0x429b73){_0x36d51f=_0x36d51f-0x0;var _0x5e912c=_0xc939[_0x36d51f];return _0x5e912c;};'use strict';var _=require(_0x9c93('0x0'));var util=require(_0x9c93('0x1'));var moment=require(_0x9c93('0x2'));var BPromise=require(_0x9c93('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c93('0x4'));var db=require(_0x9c93('0x5'))['db'];var utils=require(_0x9c93('0x6'));var logger=require(_0x9c93('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c93('0x8'));var client=jayson[_0x9c93('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x395d47,_0x3334ff,_0x257a49){return new BPromise(function(_0x519e7c,_0x3e7355){return client[_0x9c93('0xa')](_0x395d47,_0x257a49)[_0x9c93('0xb')](function(_0x592ece){logger[_0x9c93('0xc')](_0x9c93('0xd'),_0x3334ff,_0x9c93('0xe'));logger[_0x9c93('0xf')](_0x9c93('0x10'),_0x3334ff,_0x9c93('0xe'),JSON[_0x9c93('0x11')](_0x592ece));if(_0x592ece['error']){if(_0x592ece['error'][_0x9c93('0x12')]===0x1f4){logger[_0x9c93('0x13')](_0x9c93('0xd'),_0x3334ff,_0x592ece[_0x9c93('0x13')][_0x9c93('0x14')]);return _0x3e7355(_0x592ece['error'][_0x9c93('0x14')]);}logger['error'](_0x9c93('0xd'),_0x3334ff,_0x592ece[_0x9c93('0x13')][_0x9c93('0x14')]);return _0x519e7c(_0x592ece[_0x9c93('0x13')][_0x9c93('0x14')]);}else{logger[_0x9c93('0xc')](_0x9c93('0xd'),_0x3334ff,_0x9c93('0xe'));_0x519e7c(_0x592ece['result']['message']);}})[_0x9c93('0x15')](function(_0x131d81){logger[_0x9c93('0x13')](_0x9c93('0xd'),_0x3334ff,_0x131d81);_0x3e7355(_0x131d81);});});}exports[_0x9c93('0x16')]=function(_0xf6bde3){var _0x496e22=this;return new Promise(function(_0x4501ea,_0x3eb99b){return db[_0x9c93('0x17')][_0x9c93('0x18')](_0xf6bde3[_0x9c93('0x19')],{'raw':_0xf6bde3[_0x9c93('0x1a')]?_0xf6bde3['options'][_0x9c93('0x1b')]===undefined?!![]:![]:!![]})[_0x9c93('0xb')](function(_0x12ecab){logger['info'](_0x9c93('0x16'),_0xf6bde3);logger[_0x9c93('0xf')](_0x9c93('0x16'),_0xf6bde3,JSON[_0x9c93('0x11')](_0x12ecab));_0x4501ea(_0x12ecab);})[_0x9c93('0x15')](function(_0x15b6fa){logger[_0x9c93('0x13')]('CreateReportAgentPreview',_0x15b6fa[_0x9c93('0x14')],_0xf6bde3);_0x3eb99b(_0x496e22[_0x9c93('0x13')](0x1f4,_0x15b6fa[_0x9c93('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 62f7d60..b5ea0ae 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 _0xcc1e=['/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten'];(function(_0x2094d0,_0x56c2b6){var _0x2c1e4c=function(_0x103bef){while(--_0x103bef){_0x2094d0['push'](_0x2094d0['shift']());}};_0x2c1e4c(++_0x56c2b6);}(_0xcc1e,0xcf));var _0xecc1=function(_0x2e6319,_0x232551){_0x2e6319=_0x2e6319-0x0;var _0x30aaef=_0xcc1e[_0x2e6319];return _0x30aaef;};'use strict';var multer=require(_0xecc1('0x0'));var util=require(_0xecc1('0x1'));var path=require('path');var express=require('express');var router=express[_0xecc1('0x2')]();var auth=require(_0xecc1('0x3'));var controller=require(_0xecc1('0x4'));router[_0xecc1('0x5')](_0xecc1('0x6'),auth[_0xecc1('0x7')](),controller['voiceChannels']);router[_0xecc1('0x5')](_0xecc1('0x8'),auth[_0xecc1('0x7')](),controller['voiceChannelMixMonitor']);router[_0xecc1('0x5')](_0xecc1('0x9'),auth[_0xecc1('0x7')](),controller[_0xecc1('0xa')]);router[_0xecc1('0x5')]('/voice/queues',auth[_0xecc1('0x7')](),controller[_0xecc1('0xb')]);router[_0xecc1('0x5')]('/chat/queues',auth[_0xecc1('0x7')](),controller[_0xecc1('0xc')]);router[_0xecc1('0x5')](_0xecc1('0xd'),auth[_0xecc1('0x7')](),controller[_0xecc1('0xe')]);router[_0xecc1('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xecc1('0xf')]);router[_0xecc1('0x5')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0xecc1('0x10')]);router[_0xecc1('0x5')](_0xecc1('0x11'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x12')]);router[_0xecc1('0x5')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xecc1('0x13')]);router[_0xecc1('0x5')](_0xecc1('0x14'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x15')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xecc1('0x16')]);router[_0xecc1('0x5')]('/voice/queues/channels',auth[_0xecc1('0x7')](),controller['voiceQueuesChannels']);router[_0xecc1('0x5')](_0xecc1('0x17'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x18')]);router['get'](_0xecc1('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xecc1('0x5')](_0xecc1('0x1a'),auth[_0xecc1('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0xecc1('0x5')](_0xecc1('0x1b'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x1c')]);router[_0xecc1('0x1d')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xecc1('0x1e')]);router[_0xecc1('0x5')](_0xecc1('0x1f'),auth[_0xecc1('0x7')](),controller['outbound']);router['get'](_0xecc1('0x20'),auth[_0xecc1('0x7')](),controller['outboundChannels']);router[_0xecc1('0x5')](_0xecc1('0x21'),auth[_0xecc1('0x7')](),controller['agents']);router[_0xecc1('0x1d')](_0xecc1('0x22'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x23')]);router[_0xecc1('0x5')](_0xecc1('0x24'),auth['isAuthenticated'](),controller[_0xecc1('0x25')]);router[_0xecc1('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0xecc1('0x26')]);router[_0xecc1('0x5')](_0xecc1('0x27'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x28')]);router['get'](_0xecc1('0x29'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x2a')]);router[_0xecc1('0x5')](_0xecc1('0x2b'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x2c')]);router[_0xecc1('0x5')](_0xecc1('0x2d'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x2e')]);router[_0xecc1('0x5')]('/openchannel/queues/waitinginteractions',auth[_0xecc1('0x7')](),controller['openchannelQueuesWaitingInteractions']);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0xecc1('0x7')](),controller[_0xecc1('0x2f')]);router['get'](_0xecc1('0x30'),auth['isAuthenticated'](),controller[_0xecc1('0x31')]);router[_0xecc1('0x5')](_0xecc1('0x32'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x33')]);router[_0xecc1('0x5')](_0xecc1('0x34'),auth[_0xecc1('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0xecc1('0x35')](_0xecc1('0x36'),auth['isAuthenticated'](),controller[_0xecc1('0x37')](_0xecc1('0x38')));router[_0xecc1('0x5')](_0xecc1('0x39'),auth[_0xecc1('0x7')](),controller['showMailQueues']);router[_0xecc1('0x35')](_0xecc1('0x3a'),auth[_0xecc1('0x7')](),controller['queueNotify'](_0xecc1('0x3b')));router['get'](_0xecc1('0x3c'),auth['isAuthenticated'](),controller[_0xecc1('0x3d')]);router[_0xecc1('0x35')](_0xecc1('0x3e'),auth['isAuthenticated'](),controller[_0xecc1('0x37')](_0xecc1('0x3f')));router[_0xecc1('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0xecc1('0x40')]);router[_0xecc1('0x35')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xecc1('0x37')](_0xecc1('0x41')));router[_0xecc1('0x5')](_0xecc1('0x42'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x43')]);router['post'](_0xecc1('0x44'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x37')](_0xecc1('0x45')));router[_0xecc1('0x35')](_0xecc1('0x46'),auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router[_0xecc1('0x5')](_0xecc1('0x47'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x48')]);router[_0xecc1('0x5')](_0xecc1('0x49'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x4a')]);router[_0xecc1('0x35')](_0xecc1('0x4b'),auth[_0xecc1('0x7')](),controller[_0xecc1('0x4c')]);module[_0xecc1('0x4d')]=router; \ No newline at end of file +var _0x4e98=['voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','post','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4e98,0x100));var _0x84e9=function(_0x3a0aad,_0x35fe68){_0x3a0aad=_0x3a0aad-0x0;var _0x324ab5=_0x4e98[_0x3a0aad];return _0x324ab5;};'use strict';var multer=require(_0x84e9('0x0'));var util=require(_0x84e9('0x1'));var path=require(_0x84e9('0x2'));var express=require(_0x84e9('0x3'));var router=express[_0x84e9('0x4')]();var auth=require(_0x84e9('0x5'));var controller=require(_0x84e9('0x6'));router['get'](_0x84e9('0x7'),auth['isAuthenticated'](),controller[_0x84e9('0x8')]);router[_0x84e9('0x9')](_0x84e9('0xa'),auth[_0x84e9('0xb')](),controller[_0x84e9('0xc')]);router[_0x84e9('0x9')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x84e9('0xb')](),controller[_0x84e9('0xd')]);router[_0x84e9('0x9')]('/voice/queues',auth[_0x84e9('0xb')](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0x84e9('0xb')](),controller[_0x84e9('0xe')]);router[_0x84e9('0x9')](_0x84e9('0xf'),auth[_0x84e9('0xb')](),controller['mailQueues']);router['get'](_0x84e9('0x10'),auth['isAuthenticated'](),controller[_0x84e9('0x11')]);router[_0x84e9('0x9')](_0x84e9('0x12'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x13')]);router[_0x84e9('0x9')](_0x84e9('0x14'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x15')]);router['get'](_0x84e9('0x16'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x17')]);router[_0x84e9('0x9')](_0x84e9('0x18'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x19')]);router[_0x84e9('0x9')]('/voice/queues/preview/:id',auth[_0x84e9('0xb')](),controller[_0x84e9('0x1a')]);router[_0x84e9('0x9')](_0x84e9('0x1b'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x1c')]);router['get'](_0x84e9('0x1d'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x1e')]);router[_0x84e9('0x9')](_0x84e9('0x1f'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x20')]);router['get'](_0x84e9('0x21'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x22')]);router[_0x84e9('0x9')](_0x84e9('0x23'),auth['isAuthenticated'](),controller[_0x84e9('0x24')]);router[_0x84e9('0x25')](_0x84e9('0x23'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x26')]);router[_0x84e9('0x9')](_0x84e9('0x27'),auth['isAuthenticated'](),controller[_0x84e9('0x28')]);router[_0x84e9('0x9')](_0x84e9('0x29'),auth['isAuthenticated'](),controller[_0x84e9('0x2a')]);router[_0x84e9('0x9')]('/agents',auth[_0x84e9('0xb')](),controller['agents']);router[_0x84e9('0x25')](_0x84e9('0x2b'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x2c')]);router[_0x84e9('0x9')](_0x84e9('0x2d'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x2e')]);router[_0x84e9('0x9')](_0x84e9('0x2f'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x30')]);router[_0x84e9('0x9')](_0x84e9('0x31'),auth['isAuthenticated'](),controller[_0x84e9('0x32')]);router[_0x84e9('0x9')](_0x84e9('0x33'),auth['isAuthenticated'](),controller[_0x84e9('0x34')]);router['get'](_0x84e9('0x35'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x36')]);router['get'](_0x84e9('0x37'),auth[_0x84e9('0xb')](),controller['mailQueuesWaitingInteractions']);router[_0x84e9('0x9')](_0x84e9('0x38'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x39')]);router[_0x84e9('0x9')](_0x84e9('0x3a'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x3b')]);router[_0x84e9('0x9')]('/sms/queues/waitinginteractions',auth[_0x84e9('0xb')](),controller[_0x84e9('0x3c')]);router['get'](_0x84e9('0x3d'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x3e')]);router[_0x84e9('0x9')]('/fax/queues/waitinginteractions',auth[_0x84e9('0xb')](),controller[_0x84e9('0x3f')]);router['post'](_0x84e9('0x40'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x41')](_0x84e9('0x42')));router['get'](_0x84e9('0x43'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x44')]);router['post'](_0x84e9('0x45'),auth[_0x84e9('0xb')](),controller['queueNotify'](_0x84e9('0x46')));router[_0x84e9('0x9')](_0x84e9('0x47'),auth[_0x84e9('0xb')](),controller['showChatQueues']);router[_0x84e9('0x48')](_0x84e9('0x49'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x41')](_0x84e9('0x4a')));router[_0x84e9('0x9')](_0x84e9('0x4b'),auth[_0x84e9('0xb')](),controller['showFaxQueues']);router[_0x84e9('0x48')](_0x84e9('0x4c'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x41')](_0x84e9('0x4d')));router['get'](_0x84e9('0x4e'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x4f')]);router['post'](_0x84e9('0x50'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x41')]('sms'));router[_0x84e9('0x48')](_0x84e9('0x51'),auth[_0x84e9('0xb')](),controller['queueNotify'](_0x84e9('0x52')));router['get'](_0x84e9('0x53'),auth[_0x84e9('0xb')](),controller['showSmsQueues']);router[_0x84e9('0x9')](_0x84e9('0x54'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x84e9('0x48')](_0x84e9('0x55'),auth[_0x84e9('0xb')](),controller[_0x84e9('0x56')]);module[_0x84e9('0x57')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6cbf056..b3ccd3a 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 _0xb458=['InteractionId','TransferReport','agentTransferTimeout','bluebird','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','code','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','VoiceChannelStopMixMonitor','params','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','Message','Interaction','update','queue','MessageId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','findOne','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found'];(function(_0x5b9b88,_0x1628cd){var _0x2efa9b=function(_0x55e2c5){while(--_0x55e2c5){_0x5b9b88['push'](_0x5b9b88['shift']());}};_0x2efa9b(++_0x1628cd);}(_0xb458,0x103));var _0x8b45=function(_0x51f67c,_0x45f896){_0x51f67c=_0x51f67c-0x0;var _0x3ff50f=_0xb458[_0x51f67c];return _0x3ff50f;};'use strict';var BPromise=require(_0x8b45('0x0'));var moment=require(_0x8b45('0x1'));var _=require(_0x8b45('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var jayson=require(_0x8b45('0x5'));var amiClient=jayson[_0x8b45('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x8b45('0x6')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x8b45('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){var _0xa54725=_0x3a8ccb?_0x3a8ccb:amiClient;return _0xa54725[_0x8b45('0x8')](_0x12bd05,_0x2daa9a)[_0x8b45('0x9')](function(_0x2bc809){if(_0x2bc809[_0x8b45('0xa')]){if(_0x2bc809['error'][_0x8b45('0xb')]===0x1f4){return _0x4d1718(_0x2bc809[_0x8b45('0xa')]['message']);}return _0x32342f(_0x2bc809['error']['message']);}else{_0x32342f(_0x2bc809['result']);}})[_0x8b45('0xc')](function(_0x285728){_0x4d1718(_0x285728);});});}function respondWithResult(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xc8;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0xd')](_0x52c4db)[_0x8b45('0xe')](_0x30d38c);}return _0x37c220[_0x8b45('0xf')](0x194);};}function handleError(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0x1f4;return function(_0x5f0b20){logger['error'](_0x5f0b20[_0x8b45('0x10')]);if(_0x5f0b20[_0x8b45('0x11')]){delete _0x5f0b20[_0x8b45('0x11')];}_0x32babc[_0x8b45('0xd')](_0x2ad2ae)[_0x8b45('0x12')](_0x5f0b20);};}function findById(_0x27ebb3){return function(_0x902c50){if(!_[_0x8b45('0x13')](_0x27ebb3)&&!_[_0x8b45('0x13')](_0x902c50)&&!_[_0x8b45('0x13')](_0x902c50[_0x8b45('0x14')])){return _[_0x8b45('0x15')](_0x902c50[_0x8b45('0x14')],function(_0x43ffb7){return _0x43ffb7['id']==_0x27ebb3;});}return null;};}exports[_0x8b45('0x16')]=function(_0x31c6b4,_0x23c520){return respondWithRpcPromise(_0x8b45('0x17'),_0x31c6b4['query'])[_0x8b45('0x9')](respondWithResult(_0x23c520,null))[_0x8b45('0xc')](handleError(_0x23c520,null));};exports[_0x8b45('0x18')]=function(_0x46e21a,_0x3e1438){return respondWithRpcPromise(_0x8b45('0x19'),_[_0x8b45('0x1a')](_0x46e21a[_0x8b45('0x1b')],_0x46e21a['params']))['then'](respondWithResult(_0x3e1438,null))[_0x8b45('0xc')](handleError(_0x3e1438,null));};exports['voiceChannelStopMixMonitor']=function(_0x1952fc,_0x3ddb50){return respondWithRpcPromise(_0x8b45('0x1c'),_[_0x8b45('0x1a')](_0x1952fc[_0x8b45('0x1b')],_0x1952fc[_0x8b45('0x1d')]))[_0x8b45('0x9')](respondWithResult(_0x3ddb50,null))['catch'](handleError(_0x3ddb50,null));};exports['voiceQueues']=function(_0x11ffcc,_0x2c2c06){return respondWithRpcPromise('VoiceQueues',_0x11ffcc['query'])[_0x8b45('0x9')](respondWithResult(_0x2c2c06,null))[_0x8b45('0xc')](handleError(_0x2c2c06,null));};exports[_0x8b45('0x1e')]=function(_0x2f37bc,_0x4e84cc){return respondWithRpcPromise(_0x8b45('0x1f'),_0x2f37bc[_0x8b45('0x1b')])[_0x8b45('0x9')](findById(_0x2f37bc[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x4e84cc,null))[_0x8b45('0xc')](handleError(_0x4e84cc,null));};exports[_0x8b45('0x20')]=function(_0x234f62,_0x1733a7){return respondWithRpcPromise(_0x8b45('0x21'),_[_0x8b45('0x1a')](_0x234f62[_0x8b45('0x22')],_0x234f62[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1733a7,null))[_0x8b45('0xc')](handleError(_0x1733a7,null));};exports[_0x8b45('0x23')]=function(_0x34eb03,_0x15107a){return respondWithRpcPromise(_0x8b45('0x24'),_[_0x8b45('0x1a')](_0x34eb03[_0x8b45('0x1b')],_0x34eb03[_0x8b45('0x1d')]))['then'](respondWithResult(_0x15107a,null))[_0x8b45('0xc')](handleError(_0x15107a,null));};exports[_0x8b45('0x25')]=function(_0x50302,_0xc2ae94){return respondWithRpcPromise(_0x8b45('0x26'),_0x50302['query'])[_0x8b45('0x9')](respondWithResult(_0xc2ae94,null))['catch'](handleError(_0xc2ae94,null));};exports['voiceQueuesChannel']=function(_0x1f8a11,_0x94e3b6){return respondWithRpcPromise(_0x8b45('0x27'),_[_0x8b45('0x1a')](_0x1f8a11[_0x8b45('0x1b')],_0x1f8a11[_0x8b45('0x1d')]))['then'](respondWithResult(_0x94e3b6,null))[_0x8b45('0xc')](handleError(_0x94e3b6,null));};exports[_0x8b45('0x28')]=function(_0x264be7,_0x1f66a3){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x8b45('0x1a')](_0x264be7[_0x8b45('0x1b')],_0x264be7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1f66a3,null))[_0x8b45('0xc')](handleError(_0x1f66a3,null));};exports[_0x8b45('0x29')]=function(_0x1571b7,_0x58f32e){return respondWithRpcPromise(_0x8b45('0x2a'),_[_0x8b45('0x1a')](_0x1571b7[_0x8b45('0x1b')],_0x1571b7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x58f32e,null))[_0x8b45('0xc')](handleError(_0x58f32e,null));};exports[_0x8b45('0x2b')]=function(_0x2de02d,_0x15df7c){return respondWithRpcPromise(_0x8b45('0x2c'),_0x2de02d[_0x8b45('0x1b')])['then'](respondWithResult(_0x15df7c,null))['catch'](handleError(_0x15df7c,null));};exports[_0x8b45('0x2d')]=function(_0x179f3b,_0x41d6b5){return respondWithRpcPromise(_0x8b45('0x2e'),_0x179f3b[_0x8b45('0x1b')])['then'](respondWithResult(_0x41d6b5,null))[_0x8b45('0xc')](handleError(_0x41d6b5,null));};exports['agents']=function(_0x67c59a,_0x17e9a8){var _0x5fae26;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')])[_0x8b45('0x9')](function(_0x14d665){_0x5fae26=_0x14d665;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')],routingClient);})[_0x8b45('0x9')](function(_0x3a97d5){return _['merge']({},_0x3a97d5,_0x5fae26);})[_0x8b45('0x9')](respondWithResult(_0x17e9a8,null))['catch'](handleError(_0x17e9a8,null));};exports[_0x8b45('0x30')]=function(_0x4eda71,_0x412c53){if(_0x4eda71[_0x8b45('0x22')]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')]&&_0x4eda71[_0x8b45('0x32')]&&_0x4eda71[_0x8b45('0x32')]['name']){for(var _0x6fbca4 in _0x4eda71['body']['interaction']){if(_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x8b45('0x33')](_0x6fbca4)){db['MemberReport'][_0x8b45('0x34')]({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user'][_0x8b45('0x11')],'type':_0x8b45('0x35'),'exitAt':null,'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]['length']?{'$notIn':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]}:{'$ne':null}}})[_0x8b45('0x9')](function(_0xee45ac){var _0x1a13dd=moment()[_0x8b45('0x36')](_0x8b45('0x37'));for(var _0x3de3c2=0x0,_0x37b94a=_0xee45ac[_0x8b45('0x38')];_0x3de3c2<_0x37b94a;_0x3de3c2+=0x1){_0xee45ac[_0x3de3c2][_0x8b45('0x39')]({'exitAt':_0x1a13dd});}});for(var _0x3385db=0x0;_0x3385db<_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x8b45('0x38')];_0x3385db+=0x1){db[_0x8b45('0x3a')]['findOrCreate']({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user']['name'],'type':_0x8b45('0x35'),'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x3385db],'exitAt':null},'defaults':{'channel':_0x6fbca4,'membername':_0x4eda71[_0x8b45('0x32')][_0x8b45('0x11')],'interface':_[_0x8b45('0x13')](_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')])?util['format'](_0x8b45('0x3c'),_0x4eda71['user'][_0x8b45('0x11')]):_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')],'type':_0x8b45('0x35'),'enterAt':moment()['format'](_0x8b45('0x37')),'role':_0x8b45('0x3d'),'internal':_0x4eda71['user'][_0x8b45('0x3e')],'uniqueid':_0x4eda71[_0x8b45('0x22')]['interaction'][_0x6fbca4][_0x3385db]}});}}}}return respondWithRpcPromise(_0x8b45('0x3f'),{'id':_0x4eda71[_0x8b45('0x1d')]['id'],'capacity':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x40')]},routingClient)[_0x8b45('0x9')](respondWithResult(_0x412c53,null))[_0x8b45('0xc')](handleError(_0x412c53,null));};exports['telephones']=function(_0x4b8826,_0x3f7a16){return respondWithRpcPromise(_0x8b45('0x41'),_0x4b8826[_0x8b45('0x1b')])['then'](respondWithResult(_0x3f7a16,null))[_0x8b45('0xc')](handleError(_0x3f7a16,null));};exports[_0x8b45('0x42')]=function(_0x20a68b,_0x3e8a7d){return respondWithRpcPromise(_0x8b45('0x43'),_0x20a68b['query'])[_0x8b45('0x9')](respondWithResult(_0x3e8a7d,null))[_0x8b45('0xc')](handleError(_0x3e8a7d,null));};exports['campaigns']=function(_0x422da0,_0x4c3f38){return respondWithRpcPromise(_0x8b45('0x44'),_0x422da0[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x4c3f38,null))[_0x8b45('0xc')](handleError(_0x4c3f38,null));};exports['chatQueues']=function(_0xb9f390,_0x423231){return respondWithRpcPromise(_0x8b45('0x45'),_0xb9f390[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x423231,null))[_0x8b45('0xc')](handleError(_0x423231,null));};exports[_0x8b45('0x46')]=function(_0x2a35c1,_0x446fe5){return respondWithRpcPromise(_0x8b45('0x45'),_0x2a35c1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x2a35c1[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x446fe5,null))[_0x8b45('0xc')](handleError(_0x446fe5,null));};exports['mailQueues']=function(_0x1744f8,_0x1477bd){return respondWithRpcPromise(_0x8b45('0x47'),_0x1744f8['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1477bd,null))[_0x8b45('0xc')](handleError(_0x1477bd,null));};exports[_0x8b45('0x48')]=function(_0x9eacc1,_0x5795ca){return respondWithRpcPromise(_0x8b45('0x47'),_0x9eacc1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x9eacc1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x5795ca,null))[_0x8b45('0xc')](handleError(_0x5795ca,null));};exports[_0x8b45('0x49')]=function(_0x417778,_0x27503f){return respondWithRpcPromise(_0x8b45('0x4a'),_0x417778['query'],mailClient)[_0x8b45('0x9')](respondWithResult(_0x27503f,null))['catch'](handleError(_0x27503f,null));};exports[_0x8b45('0x4b')]=function(_0x2f7ab0,_0x19152b){return respondWithRpcPromise(_0x8b45('0x4c'),_0x2f7ab0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x19152b,null))['catch'](handleError(_0x19152b,null));};exports['showOpenchannelQueues']=function(_0x5ace1,_0x2224b7){return respondWithRpcPromise('OpenchannelQueues',_0x5ace1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x5ace1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x2224b7,null))['catch'](handleError(_0x2224b7,null));};exports[_0x8b45('0x4d')]=function(_0x8e5a41,_0x5abc79){return respondWithRpcPromise(_0x8b45('0x4e'),_0x8e5a41['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x5abc79,null))['catch'](handleError(_0x5abc79,null));};exports['showSmsQueues']=function(_0x28e57a,_0x7f5a4e){return respondWithRpcPromise('SmsQueues',_0x28e57a[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x28e57a[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x7f5a4e,null))[_0x8b45('0xc')](handleError(_0x7f5a4e,null));};exports['whatsappQueues']=function(_0x37f580,_0x3b3d21){return respondWithRpcPromise(_0x8b45('0x4f'),_0x37f580['query'],routingClient)['then'](respondWithResult(_0x3b3d21,null))[_0x8b45('0xc')](handleError(_0x3b3d21,null));};exports['showWhatsappQueues']=function(_0x43f031,_0x5a4834){return respondWithRpcPromise('WhatsappQueues',_0x43f031['query'],routingClient)[_0x8b45('0x9')](findById(_0x43f031['params']['id']))[_0x8b45('0x9')](respondWithResult(_0x5a4834,null))[_0x8b45('0xc')](handleError(_0x5a4834,null));};exports['faxQueues']=function(_0x3db84e,_0x1b3890){return respondWithRpcPromise('FaxQueues',_0x3db84e[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1b3890,null))[_0x8b45('0xc')](handleError(_0x1b3890,null));};exports[_0x8b45('0x50')]=function(_0x15cf9d,_0x877766){return respondWithRpcPromise(_0x8b45('0x51'),_0x15cf9d[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x15cf9d[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x877766,null))[_0x8b45('0xc')](handleError(_0x877766,null));};exports['faxAccounts']=function(_0x225180,_0x403ee2){return respondWithRpcPromise(_0x8b45('0x52'),_0x225180[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x403ee2,null))[_0x8b45('0xc')](handleError(_0x403ee2,null));};exports[_0x8b45('0x53')]=function(_0x3d3216,_0x243632){return respondWithRpcPromise(_0x8b45('0x54'),_0x3d3216[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x243632,null))[_0x8b45('0xc')](handleError(_0x243632,null));};exports[_0x8b45('0x55')]=function(_0x562c5f,_0x53143d){return respondWithRpcPromise(_0x8b45('0x56'),_0x562c5f[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x53143d,null))[_0x8b45('0xc')](handleError(_0x53143d,null));};exports[_0x8b45('0x57')]=function(_0xd88538,_0x1ebbca){return respondWithRpcPromise(_0x8b45('0x58'),_0xd88538['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1ebbca,null))[_0x8b45('0xc')](handleError(_0x1ebbca,null));};exports[_0x8b45('0x59')]=function(_0xa22bd0,_0xa44ba5){return respondWithRpcPromise(_0x8b45('0x58'),_0xa22bd0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](function(_0x2a6fee){if(_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')]!==undefined){var _0x5e54c6=_(_0x2a6fee['rows'])[_0x8b45('0x5b')]([_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')],_0xa22bd0[_0x8b45('0x1d')]['id']])[_0x8b45('0x5c')](_0x8b45('0x5d'))[_0x8b45('0x5e')]()[_0x8b45('0x5f')]();return _0x2a6fee[_0x8b45('0x14')]['filter'](function(_0x55acf0){return _0x5e54c6[_0x8b45('0x60')](_0x55acf0[_0x8b45('0x5d')])>-0x1;});}else{return _0x2a6fee[_0x8b45('0x14')][_0x8b45('0x5b')](function(_0x55bafb){return _0x55bafb[_0x8b45('0x5d')]===parseInt(_0xa22bd0[_0x8b45('0x1d')]['id']);});}})[_0x8b45('0x9')](respondWithResult(_0xa44ba5,null))[_0x8b45('0xc')](handleError(_0xa44ba5,null));};exports[_0x8b45('0x61')]=function(_0x17588b,_0x4ed113){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x17588b[_0x8b45('0x1b')],routingClient)['then'](respondWithResult(_0x4ed113,null))['catch'](handleError(_0x4ed113,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xf602c7,_0x170b95){return respondWithRpcPromise(_0x8b45('0x62'),_0xf602c7[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x170b95,null))[_0x8b45('0xc')](handleError(_0x170b95,null));};exports[_0x8b45('0x63')]=function(_0xc9be77,_0xc89fc6){return respondWithRpcPromise(_0x8b45('0x64'),_0xc9be77[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0xc89fc6,null))[_0x8b45('0xc')](handleError(_0xc89fc6,null));};exports[_0x8b45('0x65')]=function(_0x42b192){return function(_0x4a42e1,_0x29bfcc){var _0x91270d,_0x217798;var _0x19a135=_[_0x8b45('0x66')](_0x42b192);var _0x1446b1=_0x42b192===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x19a135+_0x8b45('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x4a42e1[_0x8b45('0x1d')]['id']}})[_0x8b45('0x9')](function(_0x408fff){if(_[_0x8b45('0x13')](_0x408fff)){throw new Error(_0x19a135+'\x20Queue\x20not\x20found');}_0x91270d=_0x408fff;return db[_0x19a135+_0x8b45('0x6b')]['findOne']({'where':{'id':_0x4a42e1[_0x8b45('0x22')]['messageId']},'include':[{'model':db[_0x19a135+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x19a135+_0x1446b1],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x16bb83){if(_[_0x8b45('0x13')](_0x16bb83)){throw new Error(_0x19a135+'\x20Message\x20not\x20found');}_0x217798=_0x16bb83;return _0x16bb83[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x17364d={'uniqueid':_0x42b192+'.'+_0x217798['id']+'.'+_0x217798[_0x8b45('0x6c')]['id'],'FromUserId':_0x4a42e1['user']['id'],'type':_0x8b45('0x6e')};_0x17364d[_0x19a135+_0x8b45('0x6f')]=_0x217798['id'];_0x17364d[_0x19a135+'InteractionId']=_0x217798['Interaction']['id'];_0x17364d[_0x8b45('0x70')+_0x19a135+_0x1446b1+'Id']=_0x217798[_0x8b45('0x69')]['id'];_0x17364d['To'+_0x19a135+_0x8b45('0x71')]=_0x91270d['id'];return db[_0x19a135+'TransferReport'][_0x8b45('0x72')](_0x17364d);})['then'](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x42b192,'interaction':_0x217798[_0x8b45('0x6c')],'message':_0x217798,'account':_0x217798['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x91270d[_0x8b45('0x11')]+','+(_0x217798[_0x8b45('0x69')][_0x8b45('0x74')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})['then'](respondWithResult(_0x29bfcc,null))[_0x8b45('0xc')](handleError(_0x29bfcc,null));};};exports[_0x8b45('0x76')]=function(_0x376416,_0x1d475c){var _0x2680d5,_0x1abe69;if(_['isNil'](_0x376416[_0x8b45('0x22')][_0x8b45('0x77')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x10a91a=_0x376416[_0x8b45('0x22')]['channel'];var _0x4837af=_['capitalize'](_0x10a91a);var _0x186aa2=_0x10a91a===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x8b45('0x78')][_0x8b45('0x79')]({'raw':!![],'where':{'id':_0x376416[_0x8b45('0x1d')]['id'],'role':'agent'}})[_0x8b45('0x9')](function(_0x3d321f){if(_[_0x8b45('0x13')](_0x3d321f)){throw new Error(_0x8b45('0x7a'));}_0x2680d5=_0x3d321f;return db[_0x4837af+_0x8b45('0x6b')][_0x8b45('0x79')]({'where':{'id':_0x376416['body'][_0x8b45('0x7b')]},'include':[{'model':db[_0x4837af+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x4837af+_0x186aa2],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x4c3bc9){if(_['isNil'](_0x4c3bc9)){throw new Error(_0x4837af+_0x8b45('0x7c'));}_0x1abe69=_0x4c3bc9;return _0x4c3bc9[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x9993ce={'uniqueid':_0x10a91a+'.'+_0x1abe69['id']+'.'+_0x1abe69[_0x8b45('0x6c')]['id'],'FromUserId':_0x376416['user']['id'],'type':_0x8b45('0x6e'),'ToUserId':_0x2680d5['id']};_0x9993ce[_0x4837af+'MessageId']=_0x1abe69['id'];_0x9993ce[_0x4837af+_0x8b45('0x7d')]=_0x1abe69['Interaction']['id'];_0x9993ce[_0x8b45('0x70')+_0x4837af+_0x186aa2+'Id']=_0x1abe69[_0x8b45('0x69')]['id'];return db[_0x4837af+_0x8b45('0x7e')][_0x8b45('0x72')](_0x9993ce);})[_0x8b45('0x9')](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x10a91a,'interaction':_0x1abe69[_0x8b45('0x6c')],'message':_0x1abe69,'account':_0x1abe69[_0x8b45('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b45('0x3d'),'appdata':_0x2680d5[_0x8b45('0x11')]+','+(_0x1abe69[_0x8b45('0x69')][_0x8b45('0x7f')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})[_0x8b45('0x9')](respondWithResult(_0x1d475c,null))['catch'](handleError(_0x1d475c,null));}; \ No newline at end of file +var _0x326f=['VoiceQueuesChannelHangup','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','From','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0xaf8678,_0x3bd5e7){var _0x2bc96f=function(_0x3cf2f9){while(--_0x3cf2f9){_0xaf8678['push'](_0xaf8678['shift']());}};_0x2bc96f(++_0x3bd5e7);}(_0x326f,0xd1));var _0xf326=function(_0x5dfd7b,_0x31129d){_0x5dfd7b=_0x5dfd7b-0x0;var _0x2d7fd7=_0x326f[_0x5dfd7b];return _0x2d7fd7;};'use strict';var BPromise=require(_0xf326('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xf326('0x1'));var db=require(_0xf326('0x2'))['db'];var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var jayson=require(_0xf326('0x5'));var amiClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232a});var mailClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232b});var routingClient=jayson[_0xf326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=_0x165f95?_0x165f95:amiClient;return _0x4c206c['request'](_0x3c254d,_0x3851eb)[_0xf326('0x8')](function(_0x1fc80e){if(_0x1fc80e[_0xf326('0x9')]){if(_0x1fc80e[_0xf326('0x9')][_0xf326('0xa')]===0x1f4){return _0x515bfa(_0x1fc80e['error'][_0xf326('0xb')]);}return _0x1e7b8a(_0x1fc80e['error'][_0xf326('0xb')]);}else{_0x1e7b8a(_0x1fc80e['result']);}})[_0xf326('0xc')](function(_0x518ab5){_0x515bfa(_0x518ab5);});});}function respondWithResult(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xc8;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0xd')](_0x9ed463)[_0xf326('0xe')](_0x4b3966);}return _0x3162f9[_0xf326('0xf')](0x194);};}function handleError(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0x1f4;return function(_0x45c1b6){logger['error'](_0x45c1b6['stack']);if(_0x45c1b6[_0xf326('0x10')]){delete _0x45c1b6[_0xf326('0x10')];}_0x17a098[_0xf326('0xd')](_0x5c8483)[_0xf326('0x11')](_0x45c1b6);};}function findById(_0x292f4b){return function(_0x287a2a){if(!_[_0xf326('0x12')](_0x292f4b)&&!_[_0xf326('0x12')](_0x287a2a)&&!_['isNil'](_0x287a2a[_0xf326('0x13')])){return _[_0xf326('0x14')](_0x287a2a[_0xf326('0x13')],function(_0x31ffb9){return _0x31ffb9['id']==_0x292f4b;});}return null;};}exports[_0xf326('0x15')]=function(_0x311af0,_0x4d3d41){return respondWithRpcPromise('VoiceChannels',_0x311af0['query'])[_0xf326('0x8')](respondWithResult(_0x4d3d41,null))[_0xf326('0xc')](handleError(_0x4d3d41,null));};exports['voiceChannelMixMonitor']=function(_0x4cabce,_0x128c68){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x4cabce[_0xf326('0x16')],_0x4cabce[_0xf326('0x17')]))['then'](respondWithResult(_0x128c68,null))['catch'](handleError(_0x128c68,null));};exports[_0xf326('0x18')]=function(_0xb1efcf,_0x5f21a2){return respondWithRpcPromise(_0xf326('0x19'),_[_0xf326('0x1a')](_0xb1efcf[_0xf326('0x16')],_0xb1efcf[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5f21a2,null))[_0xf326('0xc')](handleError(_0x5f21a2,null));};exports['voiceQueues']=function(_0x55b9f4,_0x4f31f6){return respondWithRpcPromise(_0xf326('0x1b'),_0x55b9f4[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4f31f6,null))[_0xf326('0xc')](handleError(_0x4f31f6,null));};exports[_0xf326('0x1c')]=function(_0x410237,_0x5217d4){return respondWithRpcPromise(_0xf326('0x1b'),_0x410237[_0xf326('0x16')])[_0xf326('0x8')](findById(_0x410237['params']['id']))[_0xf326('0x8')](respondWithResult(_0x5217d4,null))['catch'](handleError(_0x5217d4,null));};exports['updateVoiceQueue']=function(_0x6a8e89,_0x1ae23a){return respondWithRpcPromise(_0xf326('0x1d'),_['merge'](_0x6a8e89[_0xf326('0x1e')],_0x6a8e89[_0xf326('0x17')]))['then'](respondWithResult(_0x1ae23a,null))[_0xf326('0xc')](handleError(_0x1ae23a,null));};exports[_0xf326('0x1f')]=function(_0xd77aba,_0x18d110){return respondWithRpcPromise(_0xf326('0x20'),_[_0xf326('0x1a')](_0xd77aba[_0xf326('0x16')],_0xd77aba[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x18d110,null))[_0xf326('0xc')](handleError(_0x18d110,null));};exports['voiceQueuesChannels']=function(_0x1035ed,_0x424104){return respondWithRpcPromise(_0xf326('0x21'),_0x1035ed['query'])[_0xf326('0x8')](respondWithResult(_0x424104,null))[_0xf326('0xc')](handleError(_0x424104,null));};exports[_0xf326('0x22')]=function(_0x4df451,_0x5b101d){return respondWithRpcPromise(_0xf326('0x23'),_[_0xf326('0x1a')](_0x4df451[_0xf326('0x16')],_0x4df451[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5b101d,null))[_0xf326('0xc')](handleError(_0x5b101d,null));};exports[_0xf326('0x24')]=function(_0x2d5f20,_0x580374){return respondWithRpcPromise(_0xf326('0x25'),_[_0xf326('0x1a')](_0x2d5f20['query'],_0x2d5f20[_0xf326('0x17')]))['then'](respondWithResult(_0x580374,null))[_0xf326('0xc')](handleError(_0x580374,null));};exports['voiceQueuesChannelRedirect']=function(_0x51f147,_0xadb020){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xf326('0x1a')](_0x51f147['query'],_0x51f147[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0xadb020,null))[_0xf326('0xc')](handleError(_0xadb020,null));};exports['outbound']=function(_0x3dcc7e,_0x4095e6){return respondWithRpcPromise('Outbound',_0x3dcc7e[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4095e6,null))[_0xf326('0xc')](handleError(_0x4095e6,null));};exports[_0xf326('0x26')]=function(_0x51076c,_0x2c4416){return respondWithRpcPromise(_0xf326('0x27'),_0x51076c[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x2c4416,null))[_0xf326('0xc')](handleError(_0x2c4416,null));};exports['agents']=function(_0x3e830d,_0x1b7bf6){var _0x5cfb97;return respondWithRpcPromise('Agents',_0x3e830d[_0xf326('0x16')])['then'](function(_0x55dfa8){_0x5cfb97=_0x55dfa8;return respondWithRpcPromise(_0xf326('0x28'),_0x3e830d['query'],routingClient);})[_0xf326('0x8')](function(_0x37a95b){return _[_0xf326('0x1a')]({},_0x37a95b,_0x5cfb97);})[_0xf326('0x8')](respondWithResult(_0x1b7bf6,null))['catch'](handleError(_0x1b7bf6,null));};exports[_0xf326('0x29')]=function(_0x45d344,_0x347e7b){if(_0x45d344[_0xf326('0x1e')]&&_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]&&_0x45d344[_0xf326('0x2b')]&&_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]){for(var _0x1227d3 in _0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]){if(_0x45d344['body'][_0xf326('0x2a')][_0xf326('0x2c')](_0x1227d3)){db[_0xf326('0x2d')][_0xf326('0x2e')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]&&_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')]?{'$notIn':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]}:{'$ne':null}}})[_0xf326('0x8')](function(_0x55361f){var _0x505344=moment()[_0xf326('0x30')](_0xf326('0x31'));for(var _0x5ed62e=0x0,_0x4bd865=_0x55361f[_0xf326('0x2f')];_0x5ed62e<_0x4bd865;_0x5ed62e+=0x1){_0x55361f[_0x5ed62e][_0xf326('0x32')]({'exitAt':_0x505344});}});for(var _0x21c98e=0x0;_0x21c98e<_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')];_0x21c98e+=0x1){db[_0xf326('0x2d')][_0xf326('0x33')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':_0xf326('0x34'),'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e],'exitAt':null},'defaults':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'interface':_[_0xf326('0x12')](_0x45d344[_0xf326('0x2b')][_0xf326('0x35')])?util[_0xf326('0x30')]('SIP/%s',_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]):_0x45d344[_0xf326('0x2b')][_0xf326('0x35')],'type':'INTERACTION','enterAt':moment()[_0xf326('0x30')](_0xf326('0x31')),'role':_0xf326('0x36'),'internal':_0x45d344[_0xf326('0x2b')]['internal'],'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e]}});}}}}return respondWithRpcPromise(_0xf326('0x37'),{'id':_0x45d344[_0xf326('0x17')]['id'],'capacity':_0x45d344[_0xf326('0x1e')]['capacity']},routingClient)['then'](respondWithResult(_0x347e7b,null))[_0xf326('0xc')](handleError(_0x347e7b,null));};exports[_0xf326('0x38')]=function(_0x2ff126,_0x4cb25b){return respondWithRpcPromise(_0xf326('0x39'),_0x2ff126[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4cb25b,null))['catch'](handleError(_0x4cb25b,null));};exports['trunks']=function(_0x36ef89,_0x5b4832){return respondWithRpcPromise(_0xf326('0x3a'),_0x36ef89['query'])[_0xf326('0x8')](respondWithResult(_0x5b4832,null))[_0xf326('0xc')](handleError(_0x5b4832,null));};exports[_0xf326('0x3b')]=function(_0x25e091,_0x212594){return respondWithRpcPromise(_0xf326('0x3c'),_0x25e091[_0xf326('0x16')])['then'](respondWithResult(_0x212594,null))[_0xf326('0xc')](handleError(_0x212594,null));};exports[_0xf326('0x3d')]=function(_0x424d24,_0x4b0d8e){return respondWithRpcPromise(_0xf326('0x3e'),_0x424d24[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4b0d8e,null))[_0xf326('0xc')](handleError(_0x4b0d8e,null));};exports[_0xf326('0x3f')]=function(_0x58fcf0,_0x161fb3){return respondWithRpcPromise(_0xf326('0x3e'),_0x58fcf0[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x58fcf0['params']['id']))[_0xf326('0x8')](respondWithResult(_0x161fb3,null))[_0xf326('0xc')](handleError(_0x161fb3,null));};exports[_0xf326('0x40')]=function(_0x29e52e,_0x4d3b9e){return respondWithRpcPromise('MailQueues',_0x29e52e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4d3b9e,null))['catch'](handleError(_0x4d3b9e,null));};exports[_0xf326('0x41')]=function(_0x29de71,_0x316609){return respondWithRpcPromise(_0xf326('0x42'),_0x29de71['query'],routingClient)[_0xf326('0x8')](findById(_0x29de71['params']['id']))['then'](respondWithResult(_0x316609,null))[_0xf326('0xc')](handleError(_0x316609,null));};exports['mailAccounts']=function(_0x173760,_0x52fb95){return respondWithRpcPromise(_0xf326('0x43'),_0x173760['query'],mailClient)['then'](respondWithResult(_0x52fb95,null))[_0xf326('0xc')](handleError(_0x52fb95,null));};exports[_0xf326('0x44')]=function(_0x33b259,_0x5d0177){return respondWithRpcPromise(_0xf326('0x45'),_0x33b259['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5d0177,null))[_0xf326('0xc')](handleError(_0x5d0177,null));};exports[_0xf326('0x46')]=function(_0x217897,_0xbd3a01){return respondWithRpcPromise(_0xf326('0x45'),_0x217897[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x217897[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0xbd3a01,null))[_0xf326('0xc')](handleError(_0xbd3a01,null));};exports[_0xf326('0x47')]=function(_0x40f7cb,_0x4ca1b8){return respondWithRpcPromise(_0xf326('0x48'),_0x40f7cb['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x4ca1b8,null))[_0xf326('0xc')](handleError(_0x4ca1b8,null));};exports['showSmsQueues']=function(_0x2b770c,_0x5283da){return respondWithRpcPromise(_0xf326('0x48'),_0x2b770c[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x2b770c[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x5283da,null))['catch'](handleError(_0x5283da,null));};exports['whatsappQueues']=function(_0x1209ca,_0x32fe3a){return respondWithRpcPromise(_0xf326('0x49'),_0x1209ca[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x32fe3a,null))['catch'](handleError(_0x32fe3a,null));};exports[_0xf326('0x4a')]=function(_0x471da8,_0x4aadc9){return respondWithRpcPromise('WhatsappQueues',_0x471da8['query'],routingClient)[_0xf326('0x8')](findById(_0x471da8[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x4aadc9,null))[_0xf326('0xc')](handleError(_0x4aadc9,null));};exports[_0xf326('0x4b')]=function(_0x23a56e,_0x230aea){return respondWithRpcPromise('FaxQueues',_0x23a56e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x230aea,null))[_0xf326('0xc')](handleError(_0x230aea,null));};exports[_0xf326('0x4c')]=function(_0x58de1e,_0x3717fe){return respondWithRpcPromise('FaxQueues',_0x58de1e['query'],routingClient)[_0xf326('0x8')](findById(_0x58de1e['params']['id']))[_0xf326('0x8')](respondWithResult(_0x3717fe,null))[_0xf326('0xc')](handleError(_0x3717fe,null));};exports[_0xf326('0x4d')]=function(_0x2ea5a2,_0x17cd36){return respondWithRpcPromise('FaxAccounts',_0x2ea5a2['query'])['then'](respondWithResult(_0x17cd36,null))[_0xf326('0xc')](handleError(_0x17cd36,null));};exports[_0xf326('0x4e')]=function(_0x229a34,_0x180616){return respondWithRpcPromise(_0xf326('0x4f'),_0x229a34['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x180616,null))[_0xf326('0xc')](handleError(_0x180616,null));};exports[_0xf326('0x50')]=function(_0x4f9a6a,_0x567492){return respondWithRpcPromise(_0xf326('0x51'),_0x4f9a6a[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x567492,null))['catch'](handleError(_0x567492,null));};exports[_0xf326('0x52')]=function(_0x5ba28d,_0xc3a897){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ba28d['query'],routingClient)['then'](respondWithResult(_0xc3a897,null))[_0xf326('0xc')](handleError(_0xc3a897,null));};exports[_0xf326('0x53')]=function(_0xd44071,_0x4838d5){return respondWithRpcPromise(_0xf326('0x54'),_0xd44071[_0xf326('0x16')],routingClient)[_0xf326('0x8')](function(_0x457f3d){if(_0xd44071[_0xf326('0x16')][_0xf326('0x55')]!==undefined){var _0x7f6d0e=_(_0x457f3d[_0xf326('0x13')])[_0xf326('0x56')]([_0xd44071['query'][_0xf326('0x55')],_0xd44071['params']['id']])[_0xf326('0x57')](_0xf326('0x58'))[_0xf326('0x59')]()['value']();return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x39c90d){return _0x7f6d0e['indexOf'](_0x39c90d[_0xf326('0x58')])>-0x1;});}else{return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x42c7cf){return _0x42c7cf['queue_id']===parseInt(_0xd44071[_0xf326('0x17')]['id']);});}})['then'](respondWithResult(_0x4838d5,null))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x5a')]=function(_0x2c36d3,_0x5af6b7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c36d3['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5af6b7,null))['catch'](handleError(_0x5af6b7,null));};exports[_0xf326('0x5b')]=function(_0x37a564,_0x3434b2){return respondWithRpcPromise(_0xf326('0x5c'),_0x37a564[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x3434b2,null))['catch'](handleError(_0x3434b2,null));};exports[_0xf326('0x5d')]=function(_0x323926,_0x5f1724){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x323926[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x5f1724,null))[_0xf326('0xc')](handleError(_0x5f1724,null));};exports[_0xf326('0x5e')]=function(_0x153027){return function(_0x363e64,_0x19d676){var _0x6e662,_0x293600;var _0x8ca46f=_[_0xf326('0x5f')](_0x153027);var _0x499cbd=_0x153027===_0xf326('0x60')?_0xf326('0x61'):'Account';return db[_0x8ca46f+_0xf326('0x62')]['findOne']({'raw':!![],'where':{'id':_0x363e64[_0xf326('0x17')]['id']}})[_0xf326('0x8')](function(_0x14e8c0){if(_['isNil'](_0x14e8c0)){throw new Error(_0x8ca46f+_0xf326('0x63'));}_0x6e662=_0x14e8c0;return db[_0x8ca46f+_0xf326('0x64')][_0xf326('0x65')]({'where':{'id':_0x363e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x8ca46f+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x8ca46f+_0x499cbd],'as':_0xf326('0x68')}]});})[_0xf326('0x8')](function(_0x38b696){if(_[_0xf326('0x12')](_0x38b696)){throw new Error(_0x8ca46f+_0xf326('0x69'));}_0x293600=_0x38b696;return _0x38b696[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x1f990d={'uniqueid':_0x153027+'.'+_0x293600['id']+'.'+_0x293600['Interaction']['id'],'FromUserId':_0x363e64[_0xf326('0x2b')]['id'],'type':_0xf326('0x6b')};_0x1f990d[_0x8ca46f+'MessageId']=_0x293600['id'];_0x1f990d[_0x8ca46f+_0xf326('0x6c')]=_0x293600[_0xf326('0x67')]['id'];_0x1f990d['From'+_0x8ca46f+_0x499cbd+'Id']=_0x293600[_0xf326('0x68')]['id'];_0x1f990d['To'+_0x8ca46f+_0xf326('0x6d')]=_0x6e662['id'];return db[_0x8ca46f+_0xf326('0x6e')][_0xf326('0x6f')](_0x1f990d);})[_0xf326('0x8')](function(){return respondWithRpcPromise(_0xf326('0x70'),{'channel':_0x153027,'interaction':_0x293600[_0xf326('0x67')],'message':_0x293600,'account':_0x293600['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x6b'),'appdata':_0x6e662[_0xf326('0x10')]+','+(_0x293600[_0xf326('0x68')][_0xf326('0x71')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0x19d676,null))[_0xf326('0xc')](handleError(_0x19d676,null));};};exports[_0xf326('0x73')]=function(_0x486e64,_0xa8e05b){var _0x2e2103,_0x49c3da;if(_[_0xf326('0x12')](_0x486e64['body'][_0xf326('0x74')])){throw new Error(_0xf326('0x75'));}var _0x16bc97=_0x486e64[_0xf326('0x1e')][_0xf326('0x74')];var _0x3097cf=_[_0xf326('0x5f')](_0x16bc97);var _0x1eb29d=_0x16bc97===_0xf326('0x60')?_0xf326('0x61'):_0xf326('0x68');return db[_0xf326('0x76')][_0xf326('0x65')]({'raw':!![],'where':{'id':_0x486e64[_0xf326('0x17')]['id'],'role':'agent'}})[_0xf326('0x8')](function(_0xdb6e40){if(_[_0xf326('0x12')](_0xdb6e40)){throw new Error(_0xf326('0x77'));}_0x2e2103=_0xdb6e40;return db[_0x3097cf+_0xf326('0x64')]['findOne']({'where':{'id':_0x486e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x3097cf+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x3097cf+_0x1eb29d],'as':_0xf326('0x68')}]});})['then'](function(_0x4b6ec0){if(_[_0xf326('0x12')](_0x4b6ec0)){throw new Error(_0x3097cf+'\x20Message\x20not\x20found');}_0x49c3da=_0x4b6ec0;return _0x4b6ec0[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x29610a={'uniqueid':_0x16bc97+'.'+_0x49c3da['id']+'.'+_0x49c3da['Interaction']['id'],'FromUserId':_0x486e64['user']['id'],'type':_0xf326('0x6b'),'ToUserId':_0x2e2103['id']};_0x29610a[_0x3097cf+_0xf326('0x78')]=_0x49c3da['id'];_0x29610a[_0x3097cf+_0xf326('0x6c')]=_0x49c3da[_0xf326('0x67')]['id'];_0x29610a[_0xf326('0x79')+_0x3097cf+_0x1eb29d+'Id']=_0x49c3da['Account']['id'];return db[_0x3097cf+_0xf326('0x6e')][_0xf326('0x6f')](_0x29610a);})[_0xf326('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x16bc97,'interaction':_0x49c3da['Interaction'],'message':_0x49c3da,'account':_0x49c3da['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x36'),'appdata':_0x2e2103[_0xf326('0x10')]+','+(_0x49c3da[_0xf326('0x68')][_0xf326('0x7a')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0xa8e05b,null))[_0xf326('0xc')](handleError(_0xa8e05b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 864e766..f0f28b1 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 _0x3dcc=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','post','create','update'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x3dcc,0x1ab));var _0xc3dc=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x3dcc[_0x1d80be];return _0xf9a4f3;};'use strict';var multer=require('multer');var util=require(_0xc3dc('0x0'));var path=require('path');var timeout=require(_0xc3dc('0x1'));var express=require(_0xc3dc('0x2'));var router=express[_0xc3dc('0x3')]();var fs_extra=require(_0xc3dc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc3dc('0x5'));var config=require('../../config/environment');var controller=require(_0xc3dc('0x6'));router[_0xc3dc('0x7')]('/',auth[_0xc3dc('0x8')](),controller['index']);router['get'](_0xc3dc('0x9'),auth['isAuthenticated'](),controller[_0xc3dc('0xa')]);router[_0xc3dc('0x7')](_0xc3dc('0xb'),auth[_0xc3dc('0x8')](),controller['run']);router[_0xc3dc('0xc')]('/',auth[_0xc3dc('0x8')](),controller[_0xc3dc('0xd')]);router['put'](_0xc3dc('0x9'),auth[_0xc3dc('0x8')](),controller[_0xc3dc('0xe')]);router['delete'](_0xc3dc('0x9'),auth[_0xc3dc('0x8')](),controller[_0xc3dc('0xf')]);module[_0xc3dc('0x10')]=router; \ No newline at end of file +var _0x00ac=['/:id','show','/:id/run','run','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./schedule.controller','get','isAuthenticated','index'];(function(_0x184274,_0x57f8dc){var _0x3a5e4c=function(_0x404f5c){while(--_0x404f5c){_0x184274['push'](_0x184274['shift']());}};_0x3a5e4c(++_0x57f8dc);}(_0x00ac,0xbe));var _0xc00a=function(_0x4d41df,_0x246c23){_0x4d41df=_0x4d41df-0x0;var _0x3c2f42=_0x00ac[_0x4d41df];return _0x3c2f42;};'use strict';var multer=require('multer');var util=require(_0xc00a('0x0'));var path=require(_0xc00a('0x1'));var timeout=require(_0xc00a('0x2'));var express=require('express');var router=express[_0xc00a('0x3')]();var fs_extra=require(_0xc00a('0x4'));var auth=require(_0xc00a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc00a('0x6'));router[_0xc00a('0x7')]('/',auth[_0xc00a('0x8')](),controller[_0xc00a('0x9')]);router['get'](_0xc00a('0xa'),auth['isAuthenticated'](),controller[_0xc00a('0xb')]);router[_0xc00a('0x7')](_0xc00a('0xc'),auth[_0xc00a('0x8')](),controller[_0xc00a('0xd')]);router[_0xc00a('0xe')]('/',auth['isAuthenticated'](),controller[_0xc00a('0xf')]);router[_0xc00a('0x10')](_0xc00a('0xa'),auth[_0xc00a('0x8')](),controller['update']);router[_0xc00a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc00a('0x12')]);module[_0xc00a('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index be00919..d9f4337 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 _0x5858=['years','quarters','months','days','hours','minutes','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','INTEGER','ENUM'];(function(_0x114656,_0x2ee5d0){var _0x11036f=function(_0x3b8a05){while(--_0x3b8a05){_0x114656['push'](_0x114656['shift']());}};_0x11036f(++_0x2ee5d0);}(_0x5858,0x192));var _0x8585=function(_0x347dd3,_0x4b9dc7){_0x347dd3=_0x347dd3-0x0;var _0x2c121c=_0x5858[_0x347dd3];return _0x2c121c;};'use strict';var Sequelize=require(_0x8585('0x0'));module[_0x8585('0x1')]={'name':{'type':Sequelize[_0x8585('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8585('0x2')]},'active':{'type':Sequelize[_0x8585('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8585('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8585('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8585('0x5')](_0x8585('0x6'),_0x8585('0x7'),_0x8585('0x8'),'weeks',_0x8585('0x9'),_0x8585('0xa'),_0x8585('0xb')),'allowNull':![],'defaultValue':_0x8585('0x9')},'output':{'type':Sequelize[_0x8585('0x5')](_0x8585('0xc'),_0x8585('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x8585('0xc')},'type':{'type':Sequelize[_0x8585('0x5')](_0x8585('0xe'),_0x8585('0xf')),'allowNull':![],'defaultValue':_0x8585('0xe')},'sendMail':{'type':Sequelize[_0x8585('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x8585('0x2')]},'cc':{'type':Sequelize[_0x8585('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x8585('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf9d6=['default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','days','hours','minutes','csv','pdf','custom'];(function(_0x3eb188,_0x5c4d98){var _0x4c50f0=function(_0x49fa21){while(--_0x49fa21){_0x3eb188['push'](_0x3eb188['shift']());}};_0x4c50f0(++_0x5c4d98);}(_0xf9d6,0x113));var _0x6f9d=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xf9d6[_0x55d8c5];return _0x225ae5;};'use strict';var Sequelize=require('sequelize');module[_0x6f9d('0x0')]={'name':{'type':Sequelize[_0x6f9d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6f9d('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f9d('0x2')},'startAt':{'type':Sequelize[_0x6f9d('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6f9d('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6f9d('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6f9d('0x5')]('years',_0x6f9d('0x6'),_0x6f9d('0x7'),'weeks',_0x6f9d('0x8'),_0x6f9d('0x9'),_0x6f9d('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x6f9d('0x5')](_0x6f9d('0xb'),_0x6f9d('0xc'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x6f9d('0x5')](_0x6f9d('0xd'),_0x6f9d('0xe')),'allowNull':![],'defaultValue':_0x6f9d('0xd')},'sendMail':{'type':Sequelize[_0x6f9d('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x6f9d('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x6f9d('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x6f9d('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 744f220..d20ce93 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 _0x3c1a=['filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','run','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','where','pick'];(function(_0x49098b,_0xa2d557){var _0x168303=function(_0x2993a9){while(--_0x2993a9){_0x49098b['push'](_0x49098b['shift']());}};_0x168303(++_0xa2d557);}(_0x3c1a,0x64));var _0xa3c1=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x3c1a[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0xa3c1('0x0'));var rimraf=require(_0xa3c1('0x1'));var zipdir=require(_0xa3c1('0x2'));var jsonpatch=require(_0xa3c1('0x3'));var rp=require('request-promise');var moment=require(_0xa3c1('0x4'));var BPromise=require(_0xa3c1('0x5'));var Mustache=require(_0xa3c1('0x6'));var util=require('util');var path=require(_0xa3c1('0x7'));var sox=require(_0xa3c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa3c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa3c1('0xa'));var _=require('lodash');var squel=require(_0xa3c1('0xb'));var crypto=require('crypto');var jsforce=require(_0xa3c1('0xc'));var deskjs=require(_0xa3c1('0xd'));var toCsv=require(_0xa3c1('0xe'));var querystring=require(_0xa3c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa3c1('0x10'));var authService=require(_0xa3c1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa3c1('0x12'));var hardwareService=require(_0xa3c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa3c1('0x14'));var config=require(_0xa3c1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3c1('0x16'))['db'];function respondWithStatusCode(_0x576350,_0x1a380a){_0x1a380a=_0x1a380a||0xcc;return function(_0x350227){if(_0x350227){return _0x576350['sendStatus'](_0x1a380a);}return _0x576350['status'](_0x1a380a)['end']();};}function respondWithResult(_0x11609d,_0x5618f3){_0x5618f3=_0x5618f3||0xc8;return function(_0x209709){if(_0x209709){return _0x11609d[_0xa3c1('0x17')](_0x5618f3)[_0xa3c1('0x18')](_0x209709);}};}function respondWithFilteredResult(_0x172532,_0x3f5228){return function(_0x4877d6){if(_0x4877d6){var _0xd1efaf=typeof _0x3f5228[_0xa3c1('0x19')]===_0xa3c1('0x1a')&&typeof _0x3f5228[_0xa3c1('0x1b')]===_0xa3c1('0x1a');var _0x1a5f1a=_0x4877d6[_0xa3c1('0x1c')];var _0x5af6d4=_0xd1efaf?0x0:_0x3f5228['offset'];var _0xbde274=_0xd1efaf?_0x4877d6['count']:_0x3f5228['offset']+_0x3f5228[_0xa3c1('0x1b')];var _0x1367bb;if(_0xbde274>=_0x1a5f1a){_0xbde274=_0x1a5f1a;_0x1367bb=0xc8;}else{_0x1367bb=0xce;}_0x172532[_0xa3c1('0x17')](_0x1367bb);return _0x172532[_0xa3c1('0x1d')](_0xa3c1('0x1e'),_0x5af6d4+'-'+_0xbde274+'/'+_0x1a5f1a)[_0xa3c1('0x18')](_0x4877d6);}return null;};}function patchUpdates(_0x222418){return function(_0x2ed0bb){try{jsonpatch[_0xa3c1('0x1f')](_0x2ed0bb,_0x222418,!![]);}catch(_0xc33892){return BPromise['reject'](_0xc33892);}return _0x2ed0bb[_0xa3c1('0x20')]();};}function saveUpdates(_0x277a7a,_0x1082c1){return function(_0x451875){if(_0x451875){return _0x451875[_0xa3c1('0x21')](_0x277a7a)[_0xa3c1('0x22')](function(_0x196f7c){return _0x196f7c;});}return null;};}function removeEntity(_0x55884f,_0x5b7e76){return function(_0x1193b9){if(_0x1193b9){return _0x1193b9[_0xa3c1('0x23')]()[_0xa3c1('0x22')](function(){var _0x51f82a=_0x1193b9['get']({'plain':!![]});var _0x5784ce=_0xa3c1('0x24');return db[_0xa3c1('0x25')][_0xa3c1('0x23')]({'where':{'type':_0x5784ce,'resourceId':_0x51f82a['id']}})[_0xa3c1('0x22')](function(){return _0x1193b9;});})[_0xa3c1('0x22')](function(){_0x55884f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x125e27,_0x51183f){return function(_0x3b2d97){if(!_0x3b2d97){_0x125e27[_0xa3c1('0x26')](0x194);}return _0x3b2d97;};}function handleError(_0x41b43e,_0x2546f4){_0x2546f4=_0x2546f4||0x1f4;return function(_0x1b1435){logger[_0xa3c1('0x27')](_0x1b1435[_0xa3c1('0x28')]);if(_0x1b1435[_0xa3c1('0x29')]){delete _0x1b1435[_0xa3c1('0x29')];}_0x41b43e[_0xa3c1('0x17')](_0x2546f4)[_0xa3c1('0x2a')](_0x1b1435);};}exports[_0xa3c1('0x2b')]=function(_0x4c509d,_0x431911){var _0x1a3fe9={},_0x1a13a3={},_0x9ded86={'count':0x0,'rows':[]};var _0x485433=_[_0xa3c1('0x2c')](db[_0xa3c1('0x2d')][_0xa3c1('0x2e')],function(_0x3c18bf){return{'name':_0x3c18bf[_0xa3c1('0x2f')],'type':_0x3c18bf[_0xa3c1('0x30')][_0xa3c1('0x31')]};});_0x1a13a3['model']=_[_0xa3c1('0x2c')](_0x485433,_0xa3c1('0x29'));_0x1a13a3[_0xa3c1('0x32')]=_[_0xa3c1('0x33')](_0x4c509d[_0xa3c1('0x32')]);_0x1a13a3[_0xa3c1('0x34')]=_[_0xa3c1('0x35')](_0x1a13a3[_0xa3c1('0x36')],_0x1a13a3[_0xa3c1('0x32')]);_0x1a3fe9[_0xa3c1('0x37')]=_[_0xa3c1('0x35')](_0x1a13a3[_0xa3c1('0x36')],qs[_0xa3c1('0x38')](_0x4c509d[_0xa3c1('0x32')][_0xa3c1('0x38')]));_0x1a3fe9[_0xa3c1('0x37')]=_0x1a3fe9[_0xa3c1('0x37')]['length']?_0x1a3fe9['attributes']:_0x1a13a3['model'];if(!_0x4c509d[_0xa3c1('0x32')]['hasOwnProperty']('nolimit')){_0x1a3fe9['limit']=qs['limit'](_0x4c509d[_0xa3c1('0x32')][_0xa3c1('0x1b')]);_0x1a3fe9[_0xa3c1('0x19')]=qs[_0xa3c1('0x19')](_0x4c509d[_0xa3c1('0x32')]['offset']);}_0x1a3fe9['order']=qs['sort'](_0x4c509d['query'][_0xa3c1('0x39')]);_0x1a3fe9[_0xa3c1('0x3a')]=qs[_0xa3c1('0x34')](_[_0xa3c1('0x3b')](_0x4c509d[_0xa3c1('0x32')],_0x1a13a3[_0xa3c1('0x34')]),_0x485433);if(_0x4c509d['query'][_0xa3c1('0x3c')]){_0x1a3fe9[_0xa3c1('0x3a')]=_[_0xa3c1('0x3d')](_0x1a3fe9['where'],{'$or':_[_0xa3c1('0x2c')](_0x485433,function(_0x468274){if(_0x468274[_0xa3c1('0x30')]!==_0xa3c1('0x3e')){var _0x5a3ed7={};_0x5a3ed7[_0x468274[_0xa3c1('0x29')]]={'$like':'%'+_0x4c509d[_0xa3c1('0x32')][_0xa3c1('0x3c')]+'%'};return _0x5a3ed7;}})});}_0x1a3fe9=_['merge']({},_0x1a3fe9,_0x4c509d[_0xa3c1('0x3f')]);var _0x368d1d={'where':_0x1a3fe9[_0xa3c1('0x3a')]};return db[_0xa3c1('0x2d')][_0xa3c1('0x1c')](_0x368d1d)[_0xa3c1('0x22')](function(_0x530d30){_0x9ded86[_0xa3c1('0x1c')]=_0x530d30;if(_0x4c509d[_0xa3c1('0x32')]['includeAll']){_0x1a3fe9['include']=[{'all':!![]}];}return db[_0xa3c1('0x2d')]['findAll'](_0x1a3fe9);})[_0xa3c1('0x22')](function(_0x59b866){_0x9ded86[_0xa3c1('0x40')]=_0x59b866;return _0x9ded86;})['then'](respondWithFilteredResult(_0x431911,_0x1a3fe9))[_0xa3c1('0x41')](handleError(_0x431911,null));};exports[_0xa3c1('0x42')]=function(_0x2f94bf,_0x48e306){var _0xb3bcde={'raw':![],'where':{'id':_0x2f94bf[_0xa3c1('0x43')]['id']}},_0x3531df={};_0x3531df['model']=_[_0xa3c1('0x33')](db[_0xa3c1('0x2d')][_0xa3c1('0x2e')]);_0x3531df[_0xa3c1('0x32')]=_[_0xa3c1('0x33')](_0x2f94bf[_0xa3c1('0x32')]);_0x3531df[_0xa3c1('0x34')]=_[_0xa3c1('0x35')](_0x3531df[_0xa3c1('0x36')],_0x3531df[_0xa3c1('0x32')]);_0xb3bcde[_0xa3c1('0x37')]=_[_0xa3c1('0x35')](_0x3531df[_0xa3c1('0x36')],qs[_0xa3c1('0x38')](_0x2f94bf['query'][_0xa3c1('0x38')]));_0xb3bcde[_0xa3c1('0x37')]=_0xb3bcde[_0xa3c1('0x37')][_0xa3c1('0x44')]?_0xb3bcde[_0xa3c1('0x37')]:_0x3531df['model'];if(_0x2f94bf['query'][_0xa3c1('0x45')]){_0xb3bcde['include']=[{'all':!![]}];}_0xb3bcde=_[_0xa3c1('0x3d')]({},_0xb3bcde,_0x2f94bf[_0xa3c1('0x3f')]);return db[_0xa3c1('0x2d')][_0xa3c1('0x46')](_0xb3bcde)['then'](handleEntityNotFound(_0x48e306,null))[_0xa3c1('0x22')](respondWithResult(_0x48e306,null))[_0xa3c1('0x41')](handleError(_0x48e306,null));};exports[_0xa3c1('0x47')]=function(_0x3235bf,_0x57bfd8){return db[_0xa3c1('0x2d')][_0xa3c1('0x47')](_0x3235bf[_0xa3c1('0x48')],{})[_0xa3c1('0x22')](function(_0x49522d){var _0x2ece85=_0x3235bf[_0xa3c1('0x49')][_0xa3c1('0x4a')]({'plain':!![]});if(!_0x2ece85)throw new Error(_0xa3c1('0x4b'));if(_0x2ece85[_0xa3c1('0x4c')]===_0xa3c1('0x49')){var _0x3a1934=_0x49522d['get']({'plain':!![]});var _0x289b61=_0xa3c1('0x24');return db[_0xa3c1('0x4d')][_0xa3c1('0x46')]({'where':{'name':_0x289b61,'userProfileId':_0x2ece85[_0xa3c1('0x4e')]},'raw':!![]})[_0xa3c1('0x22')](function(_0x2eac81){if(_0x2eac81&&_0x2eac81['autoAssociation']===0x0){return db[_0xa3c1('0x25')][_0xa3c1('0x47')]({'name':_0x3a1934[_0xa3c1('0x29')],'resourceId':_0x3a1934['id'],'type':_0x2eac81['name'],'sectionId':_0x2eac81['id']},{})[_0xa3c1('0x22')](function(){return _0x49522d;});}else{return _0x49522d;}})[_0xa3c1('0x41')](function(_0x2bb79b){logger[_0xa3c1('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bb79b);throw _0x2bb79b;});}return _0x49522d;})[_0xa3c1('0x22')](respondWithResult(_0x57bfd8,0xc9))['catch'](handleError(_0x57bfd8,null));};exports[_0xa3c1('0x21')]=function(_0x2e4f06,_0x3719c8){if(_0x2e4f06[_0xa3c1('0x48')]['id']){delete _0x2e4f06[_0xa3c1('0x48')]['id'];}return db[_0xa3c1('0x2d')][_0xa3c1('0x46')]({'where':{'id':_0x2e4f06[_0xa3c1('0x43')]['id']}})[_0xa3c1('0x22')](handleEntityNotFound(_0x3719c8,null))['then'](saveUpdates(_0x2e4f06['body'],null))[_0xa3c1('0x22')](respondWithResult(_0x3719c8,null))[_0xa3c1('0x41')](handleError(_0x3719c8,null));};exports[_0xa3c1('0x23')]=function(_0x52371d,_0x39583e){return db[_0xa3c1('0x2d')][_0xa3c1('0x46')]({'where':{'id':_0x52371d[_0xa3c1('0x43')]['id']}})[_0xa3c1('0x22')](handleEntityNotFound(_0x39583e,null))['then'](removeEntity(_0x39583e,null))[_0xa3c1('0x41')](handleError(_0x39583e,null));};exports['run']=function(_0x5b203a,_0x259437,_0x3fd15f){var _0x1b3ca6=require('../../config/schedule');return db[_0xa3c1('0x2d')][_0xa3c1('0x46')]({'where':{'id':_0x5b203a[_0xa3c1('0x43')]['id']},'raw':!![]})[_0xa3c1('0x22')](handleEntityNotFound(_0x259437,null))[_0xa3c1('0x22')](function(){_0x1b3ca6[_0xa3c1('0x4f')](_0x5b203a['params']['id']);})[_0xa3c1('0x22')](respondWithStatusCode(_0x259437,null))[_0xa3c1('0x41')](handleError(_0x259437,null));}; \ No newline at end of file +var _0xd632=['to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','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','params','run','../../config/schedule','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path'];(function(_0x5c081f,_0x1a0afe){var _0x51a830=function(_0x59cb3d){while(--_0x59cb3d){_0x5c081f['push'](_0x5c081f['shift']());}};_0x51a830(++_0x1a0afe);}(_0xd632,0x1a7));var _0x2d63=function(_0x37628a,_0x92e3c6){_0x37628a=_0x37628a-0x0;var _0x1cf2bf=_0xd632[_0x37628a];return _0x1cf2bf;};'use strict';var emlformat=require(_0x2d63('0x0'));var rimraf=require(_0x2d63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d63('0x2'));var rp=require('request-promise');var moment=require(_0x2d63('0x3'));var BPromise=require(_0x2d63('0x4'));var Mustache=require('mustache');var util=require(_0x2d63('0x5'));var path=require(_0x2d63('0x6'));var sox=require('sox');var csv=require(_0x2d63('0x7'));var ejs=require(_0x2d63('0x8'));var fs=require('fs');var fs_extra=require(_0x2d63('0x9'));var _=require(_0x2d63('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2d63('0xb'));var deskjs=require(_0x2d63('0xc'));var toCsv=require(_0x2d63('0x7'));var querystring=require(_0x2d63('0xd'));var Papa=require(_0x2d63('0xe'));var Redis=require(_0x2d63('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2d63('0x10'));var as=require(_0x2d63('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d63('0x12'))(_0x2d63('0x13'));var utils=require(_0x2d63('0x14'));var config=require(_0x2d63('0x15'));var licenseUtil=require(_0x2d63('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a699c,_0x48328b){_0x48328b=_0x48328b||0xcc;return function(_0x37d33){if(_0x37d33){return _0x5a699c['sendStatus'](_0x48328b);}return _0x5a699c[_0x2d63('0x17')](_0x48328b)[_0x2d63('0x18')]();};}function respondWithResult(_0x37c796,_0x2316a1){_0x2316a1=_0x2316a1||0xc8;return function(_0x4fdacc){if(_0x4fdacc){return _0x37c796[_0x2d63('0x17')](_0x2316a1)[_0x2d63('0x19')](_0x4fdacc);}};}function respondWithFilteredResult(_0x4850fa,_0x251fa9){return function(_0x4a1613){if(_0x4a1613){var _0x2dc436=typeof _0x251fa9['offset']===_0x2d63('0x1a')&&typeof _0x251fa9['limit']===_0x2d63('0x1a');var _0x3e8fdb=_0x4a1613[_0x2d63('0x1b')];var _0x3cdd40=_0x2dc436?0x0:_0x251fa9['offset'];var _0x1a9c45=_0x2dc436?_0x4a1613[_0x2d63('0x1b')]:_0x251fa9[_0x2d63('0x1c')]+_0x251fa9[_0x2d63('0x1d')];var _0x13d7e3;if(_0x1a9c45>=_0x3e8fdb){_0x1a9c45=_0x3e8fdb;_0x13d7e3=0xc8;}else{_0x13d7e3=0xce;}_0x4850fa[_0x2d63('0x17')](_0x13d7e3);return _0x4850fa[_0x2d63('0x1e')](_0x2d63('0x1f'),_0x3cdd40+'-'+_0x1a9c45+'/'+_0x3e8fdb)[_0x2d63('0x19')](_0x4a1613);}return null;};}function patchUpdates(_0x25024a){return function(_0x40580b){try{jsonpatch[_0x2d63('0x20')](_0x40580b,_0x25024a,!![]);}catch(_0x47597a){return BPromise['reject'](_0x47597a);}return _0x40580b[_0x2d63('0x21')]();};}function saveUpdates(_0x35b990,_0xc909ae){return function(_0x533782){if(_0x533782){return _0x533782[_0x2d63('0x22')](_0x35b990)[_0x2d63('0x23')](function(_0x35bc2e){return _0x35bc2e;});}return null;};}function removeEntity(_0x3b5f78,_0x434f97){return function(_0x2bb63e){if(_0x2bb63e){return _0x2bb63e[_0x2d63('0x24')]()[_0x2d63('0x23')](function(){var _0x140359=_0x2bb63e[_0x2d63('0x25')]({'plain':!![]});var _0x12ccc9=_0x2d63('0x26');return db[_0x2d63('0x27')][_0x2d63('0x24')]({'where':{'type':_0x12ccc9,'resourceId':_0x140359['id']}})['then'](function(){return _0x2bb63e;});})[_0x2d63('0x23')](function(){_0x3b5f78[_0x2d63('0x17')](0xcc)[_0x2d63('0x18')]();});}};}function handleEntityNotFound(_0x3b97e3,_0xd0bb15){return function(_0x36d1c9){if(!_0x36d1c9){_0x3b97e3[_0x2d63('0x28')](0x194);}return _0x36d1c9;};}function handleError(_0x504ec9,_0x218b07){_0x218b07=_0x218b07||0x1f4;return function(_0x2f451c){logger[_0x2d63('0x29')](_0x2f451c[_0x2d63('0x2a')]);if(_0x2f451c[_0x2d63('0x2b')]){delete _0x2f451c[_0x2d63('0x2b')];}_0x504ec9[_0x2d63('0x17')](_0x218b07)[_0x2d63('0x2c')](_0x2f451c);};}exports[_0x2d63('0x2d')]=function(_0x465645,_0x2ddcfe){var _0x8991c4={},_0x207028={},_0x35029f={'count':0x0,'rows':[]};var _0x57d3fb=_['map'](db[_0x2d63('0x2e')][_0x2d63('0x2f')],function(_0x32efd1){return{'name':_0x32efd1[_0x2d63('0x30')],'type':_0x32efd1[_0x2d63('0x31')][_0x2d63('0x32')]};});_0x207028['model']=_[_0x2d63('0x33')](_0x57d3fb,_0x2d63('0x2b'));_0x207028[_0x2d63('0x34')]=_['keys'](_0x465645[_0x2d63('0x34')]);_0x207028[_0x2d63('0x35')]=_[_0x2d63('0x36')](_0x207028[_0x2d63('0x37')],_0x207028['query']);_0x8991c4[_0x2d63('0x38')]=_[_0x2d63('0x36')](_0x207028[_0x2d63('0x37')],qs[_0x2d63('0x39')](_0x465645[_0x2d63('0x34')][_0x2d63('0x39')]));_0x8991c4['attributes']=_0x8991c4[_0x2d63('0x38')][_0x2d63('0x3a')]?_0x8991c4[_0x2d63('0x38')]:_0x207028['model'];if(!_0x465645[_0x2d63('0x34')][_0x2d63('0x3b')](_0x2d63('0x3c'))){_0x8991c4[_0x2d63('0x1d')]=qs[_0x2d63('0x1d')](_0x465645[_0x2d63('0x34')][_0x2d63('0x1d')]);_0x8991c4[_0x2d63('0x1c')]=qs['offset'](_0x465645['query'][_0x2d63('0x1c')]);}_0x8991c4['order']=qs[_0x2d63('0x3d')](_0x465645[_0x2d63('0x34')][_0x2d63('0x3d')]);_0x8991c4[_0x2d63('0x3e')]=qs['filters'](_['pick'](_0x465645[_0x2d63('0x34')],_0x207028[_0x2d63('0x35')]),_0x57d3fb);if(_0x465645['query'][_0x2d63('0x3f')]){_0x8991c4[_0x2d63('0x3e')]=_[_0x2d63('0x40')](_0x8991c4['where'],{'$or':_[_0x2d63('0x33')](_0x57d3fb,function(_0x7dbf30){if(_0x7dbf30[_0x2d63('0x31')]!==_0x2d63('0x41')){var _0x3364e2={};_0x3364e2[_0x7dbf30[_0x2d63('0x2b')]]={'$like':'%'+_0x465645[_0x2d63('0x34')][_0x2d63('0x3f')]+'%'};return _0x3364e2;}})});}_0x8991c4=_[_0x2d63('0x40')]({},_0x8991c4,_0x465645[_0x2d63('0x42')]);var _0x2508ba={'where':_0x8991c4[_0x2d63('0x3e')]};return db[_0x2d63('0x2e')][_0x2d63('0x1b')](_0x2508ba)[_0x2d63('0x23')](function(_0x3fbda1){_0x35029f['count']=_0x3fbda1;if(_0x465645[_0x2d63('0x34')][_0x2d63('0x43')]){_0x8991c4[_0x2d63('0x44')]=[{'all':!![]}];}return db[_0x2d63('0x2e')]['findAll'](_0x8991c4);})['then'](function(_0x162581){_0x35029f[_0x2d63('0x45')]=_0x162581;return _0x35029f;})['then'](respondWithFilteredResult(_0x2ddcfe,_0x8991c4))[_0x2d63('0x46')](handleError(_0x2ddcfe,null));};exports[_0x2d63('0x47')]=function(_0x34b8d7,_0x79a4c1){var _0x53dce4={'raw':![],'where':{'id':_0x34b8d7['params']['id']}},_0x29e28c={};_0x29e28c['model']=_['keys'](db[_0x2d63('0x2e')]['rawAttributes']);_0x29e28c['query']=_[_0x2d63('0x48')](_0x34b8d7[_0x2d63('0x34')]);_0x29e28c['filters']=_[_0x2d63('0x36')](_0x29e28c[_0x2d63('0x37')],_0x29e28c['query']);_0x53dce4[_0x2d63('0x38')]=_[_0x2d63('0x36')](_0x29e28c[_0x2d63('0x37')],qs[_0x2d63('0x39')](_0x34b8d7[_0x2d63('0x34')][_0x2d63('0x39')]));_0x53dce4[_0x2d63('0x38')]=_0x53dce4[_0x2d63('0x38')][_0x2d63('0x3a')]?_0x53dce4[_0x2d63('0x38')]:_0x29e28c[_0x2d63('0x37')];if(_0x34b8d7[_0x2d63('0x34')]['includeAll']){_0x53dce4['include']=[{'all':!![]}];}_0x53dce4=_[_0x2d63('0x40')]({},_0x53dce4,_0x34b8d7[_0x2d63('0x42')]);return db[_0x2d63('0x2e')][_0x2d63('0x49')](_0x53dce4)[_0x2d63('0x23')](handleEntityNotFound(_0x79a4c1,null))[_0x2d63('0x23')](respondWithResult(_0x79a4c1,null))[_0x2d63('0x46')](handleError(_0x79a4c1,null));};exports[_0x2d63('0x4a')]=function(_0x3512fe,_0x3325b2){return db[_0x2d63('0x2e')][_0x2d63('0x4a')](_0x3512fe['body'],{})['then'](function(_0x363016){var _0x354c35=_0x3512fe[_0x2d63('0x4b')][_0x2d63('0x25')]({'plain':!![]});if(!_0x354c35)throw new Error(_0x2d63('0x4c'));if(_0x354c35[_0x2d63('0x4d')]===_0x2d63('0x4b')){var _0x1c310e=_0x363016[_0x2d63('0x25')]({'plain':!![]});var _0x5ea419='Scheduler';return db[_0x2d63('0x4e')][_0x2d63('0x49')]({'where':{'name':_0x5ea419,'userProfileId':_0x354c35[_0x2d63('0x4f')]},'raw':!![]})[_0x2d63('0x23')](function(_0x4d8574){if(_0x4d8574&&_0x4d8574[_0x2d63('0x50')]===0x0){return db[_0x2d63('0x27')][_0x2d63('0x4a')]({'name':_0x1c310e[_0x2d63('0x2b')],'resourceId':_0x1c310e['id'],'type':_0x4d8574[_0x2d63('0x2b')],'sectionId':_0x4d8574['id']},{})[_0x2d63('0x23')](function(){return _0x363016;});}else{return _0x363016;}})['catch'](function(_0x49ac53){logger[_0x2d63('0x29')](_0x2d63('0x51'),_0x49ac53);throw _0x49ac53;});}return _0x363016;})[_0x2d63('0x23')](respondWithResult(_0x3325b2,0xc9))['catch'](handleError(_0x3325b2,null));};exports[_0x2d63('0x22')]=function(_0x1de3bc,_0x2ba7d0){if(_0x1de3bc[_0x2d63('0x52')]['id']){delete _0x1de3bc['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x1de3bc['params']['id']}})['then'](handleEntityNotFound(_0x2ba7d0,null))['then'](saveUpdates(_0x1de3bc[_0x2d63('0x52')],null))[_0x2d63('0x23')](respondWithResult(_0x2ba7d0,null))['catch'](handleError(_0x2ba7d0,null));};exports[_0x2d63('0x24')]=function(_0x14ea80,_0x3f5a40){return db['Schedule'][_0x2d63('0x49')]({'where':{'id':_0x14ea80[_0x2d63('0x53')]['id']}})[_0x2d63('0x23')](handleEntityNotFound(_0x3f5a40,null))[_0x2d63('0x23')](removeEntity(_0x3f5a40,null))[_0x2d63('0x46')](handleError(_0x3f5a40,null));};exports[_0x2d63('0x54')]=function(_0x36261e,_0x9d4505,_0x341187){var _0x104955=require(_0x2d63('0x55'));return db[_0x2d63('0x2e')][_0x2d63('0x49')]({'where':{'id':_0x36261e[_0x2d63('0x53')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x9d4505,null))['then'](function(){_0x104955[_0x2d63('0x54')](_0x36261e[_0x2d63('0x53')]['id']);})[_0x2d63('0x23')](respondWithStatusCode(_0x9d4505,null))[_0x2d63('0x46')](handleError(_0x9d4505,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7f64f3c..083e45d 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 _0x8776=['exports','define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','../../config/environment','./schedule.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8776,0x101));var _0x6877=function(_0x2077aa,_0x371f73){_0x2077aa=_0x2077aa-0x0;var _0x2a9e07=_0x8776[_0x2077aa];return _0x2a9e07;};'use strict';var _=require('lodash');var util=require(_0x6877('0x0'));var logger=require(_0x6877('0x1'))(_0x6877('0x2'));var moment=require(_0x6877('0x3'));var BPromise=require(_0x6877('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6877('0x5'));var attributes=require(_0x6877('0x6'));module[_0x6877('0x7')]=function(_0xbdba0c,_0x5c5aa8){return _0xbdba0c[_0x6877('0x8')](_0x6877('0x9'),attributes,{'tableName':_0x6877('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fe8=['define','Schedule','tools_schedules','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x2475ad,_0x415806){var _0x44a7f0=function(_0x400eee){while(--_0x400eee){_0x2475ad['push'](_0x2475ad['shift']());}};_0x44a7f0(++_0x415806);}(_0x4fe8,0xfd));var _0x84fe=function(_0x375ef0,_0x50d97e){_0x375ef0=_0x375ef0-0x0;var _0x327f1c=_0x4fe8[_0x375ef0];return _0x327f1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x84fe('0x0'))(_0x84fe('0x1'));var moment=require(_0x84fe('0x2'));var BPromise=require(_0x84fe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84fe('0x4'));var rimraf=require('rimraf');var config=require(_0x84fe('0x5'));var attributes=require('./schedule.attributes');module[_0x84fe('0x6')]=function(_0xf08dfb,_0x5b7afa){return _0xf08dfb[_0x84fe('0x7')](_0x84fe('0x8'),attributes,{'tableName':_0x84fe('0x9'),'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 7724d37..0a5c474 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 _0x62bc=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x135507,_0x19d764){var _0x20d5a5=function(_0x377001){while(--_0x377001){_0x135507['push'](_0x135507['shift']());}};_0x20d5a5(++_0x19d764);}(_0x62bc,0x191));var _0xc62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62b('0x0'));var util=require(_0xc62b('0x1'));var moment=require(_0xc62b('0x2'));var BPromise=require(_0xc62b('0x3'));var rs=require(_0xc62b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc62b('0x5'));var logger=require(_0xc62b('0x6'))(_0xc62b('0x7'));var config=require(_0xc62b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc62b('0x9')][_0xc62b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32f31c,_0x3d6534,_0x2c6a5d){return new BPromise(function(_0x4c14d6,_0xa509e8){return client[_0xc62b('0xb')](_0x32f31c,_0x2c6a5d)['then'](function(_0x4da3d9){logger[_0xc62b('0xc')](_0xc62b('0xd'),_0x3d6534,_0xc62b('0xe'));logger[_0xc62b('0xf')](_0xc62b('0x10'),_0x3d6534,_0xc62b('0xe'),JSON[_0xc62b('0x11')](_0x4da3d9));if(_0x4da3d9[_0xc62b('0x12')]){if(_0x4da3d9['error'][_0xc62b('0x13')]===0x1f4){logger[_0xc62b('0x12')](_0xc62b('0xd'),_0x3d6534,_0x4da3d9[_0xc62b('0x12')][_0xc62b('0x14')]);return _0xa509e8(_0x4da3d9[_0xc62b('0x12')][_0xc62b('0x14')]);}logger[_0xc62b('0x12')]('Schedule,\x20%s,\x20%s',_0x3d6534,_0x4da3d9[_0xc62b('0x12')]['message']);return _0x4c14d6(_0x4da3d9['error'][_0xc62b('0x14')]);}else{logger[_0xc62b('0xc')](_0xc62b('0xd'),_0x3d6534,_0xc62b('0xe'));_0x4c14d6(_0x4da3d9[_0xc62b('0x15')]['message']);}})[_0xc62b('0x16')](function(_0x2c7920){logger[_0xc62b('0x12')]('Schedule,\x20%s,\x20%s',_0x3d6534,_0x2c7920);_0xa509e8(_0x2c7920);});});} \ No newline at end of file +var _0x9bc6=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x51766c,_0x4110ef){var _0x243c62=function(_0xdefdbe){while(--_0xdefdbe){_0x51766c['push'](_0x51766c['shift']());}};_0x243c62(++_0x4110ef);}(_0x9bc6,0x1b8));var _0x69bc=function(_0x40bc4a,_0x2f4fa6){_0x40bc4a=_0x40bc4a-0x0;var _0x497b7a=_0x9bc6[_0x40bc4a];return _0x497b7a;};'use strict';var _=require(_0x69bc('0x0'));var util=require(_0x69bc('0x1'));var moment=require(_0x69bc('0x2'));var BPromise=require(_0x69bc('0x3'));var rs=require(_0x69bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69bc('0x5'))['db'];var utils=require(_0x69bc('0x6'));var logger=require(_0x69bc('0x7'))(_0x69bc('0x8'));var config=require(_0x69bc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x69bc('0xa')][_0x69bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aaa34,_0x51131f,_0x1501f4){return new BPromise(function(_0x3e6853,_0x38a4ca){return client['request'](_0x4aaa34,_0x1501f4)[_0x69bc('0xc')](function(_0x6cf032){logger['info'](_0x69bc('0xd'),_0x51131f,_0x69bc('0xe'));logger[_0x69bc('0xf')](_0x69bc('0x10'),_0x51131f,_0x69bc('0xe'),JSON[_0x69bc('0x11')](_0x6cf032));if(_0x6cf032[_0x69bc('0x12')]){if(_0x6cf032[_0x69bc('0x12')][_0x69bc('0x13')]===0x1f4){logger[_0x69bc('0x12')](_0x69bc('0xd'),_0x51131f,_0x6cf032[_0x69bc('0x12')]['message']);return _0x38a4ca(_0x6cf032['error'][_0x69bc('0x14')]);}logger[_0x69bc('0x12')](_0x69bc('0xd'),_0x51131f,_0x6cf032['error'][_0x69bc('0x14')]);return _0x3e6853(_0x6cf032[_0x69bc('0x12')][_0x69bc('0x14')]);}else{logger[_0x69bc('0x15')]('Schedule,\x20%s,\x20%s',_0x51131f,_0x69bc('0xe'));_0x3e6853(_0x6cf032['result'][_0x69bc('0x14')]);}})[_0x69bc('0x16')](function(_0x476cc4){logger[_0x69bc('0x12')]('Schedule,\x20%s,\x20%s',_0x51131f,_0x476cc4);_0x38a4ca(_0x476cc4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index eb658ff..89b708c 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 _0xdd82=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','put','update','delete','destroy'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xdd82,0xb8));var _0x2dd8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdd82[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x2dd8('0x0'));var path=require(_0x2dd8('0x1'));var timeout=require(_0x2dd8('0x2'));var express=require(_0x2dd8('0x3'));var router=express[_0x2dd8('0x4')]();var fs_extra=require(_0x2dd8('0x5'));var auth=require(_0x2dd8('0x6'));var interaction=require(_0x2dd8('0x7'));var config=require(_0x2dd8('0x8'));var controller=require(_0x2dd8('0x9'));router[_0x2dd8('0xa')]('/',auth[_0x2dd8('0xb')](),controller[_0x2dd8('0xc')]);router[_0x2dd8('0xa')](_0x2dd8('0xd'),auth[_0x2dd8('0xb')](),controller[_0x2dd8('0xe')]);router['get'](_0x2dd8('0xf'),auth['isAuthenticated'](),controller[_0x2dd8('0x10')]);router[_0x2dd8('0xa')](_0x2dd8('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x2dd8('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2dd8('0x13')](_0x2dd8('0xf'),auth['isAuthenticated'](),controller[_0x2dd8('0x14')]);router[_0x2dd8('0x15')](_0x2dd8('0xf'),auth[_0x2dd8('0xb')](),controller[_0x2dd8('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6f01=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','post','create','update','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x40c953,_0x438be2){var _0x1d5e14=function(_0x4d2c49){while(--_0x4d2c49){_0x40c953['push'](_0x40c953['shift']());}};_0x1d5e14(++_0x438be2);}(_0x6f01,0x12c));var _0x16f0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6f01[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x16f0('0x0'));var path=require(_0x16f0('0x1'));var timeout=require(_0x16f0('0x2'));var express=require('express');var router=express[_0x16f0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x16f0('0x4'));var interaction=require(_0x16f0('0x5'));var config=require(_0x16f0('0x6'));var controller=require('./screenRecording.controller');router[_0x16f0('0x7')]('/',auth[_0x16f0('0x8')](),controller[_0x16f0('0x9')]);router[_0x16f0('0x7')]('/describe',auth[_0x16f0('0x8')](),controller['describe']);router[_0x16f0('0x7')](_0x16f0('0xa'),auth[_0x16f0('0x8')](),controller[_0x16f0('0xb')]);router['get'](_0x16f0('0xc'),auth[_0x16f0('0x8')](),controller['download']);router[_0x16f0('0xd')]('/',auth['isAuthenticated'](),controller[_0x16f0('0xe')]);router['put'](_0x16f0('0xa'),auth['isAuthenticated'](),controller[_0x16f0('0xf')]);router['delete'](_0x16f0('0xa'),auth[_0x16f0('0x8')](),controller[_0x16f0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index f3fac6a..827c265 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 _0x1131=['setDataValue','INTEGER','startedAt','closedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','format','updatedAt','moment','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x54826c,_0x44bf90){var _0x42e7c1=function(_0x35d5b5){while(--_0x35d5b5){_0x54826c['push'](_0x54826c['shift']());}};_0x42e7c1(++_0x44bf90);}(_0x1131,0x71));var _0x1113=function(_0x2995f0,_0x370757){_0x2995f0=_0x2995f0-0x0;var _0x8302f8=_0x1131[_0x2995f0];return _0x8302f8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1113('0x0'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x1113('0x1')],'get':function(){return this[_0x1113('0x2')](_0x1113('0x3'))?path[_0x1113('0x4')](this[_0x1113('0x2')](_0x1113('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1113('0x5')]},'value':{'type':Sequelize['STRING'],'set':function(_0x1f76a7){var _0x500c86=_0x1f76a7['replace'](/\\/g,'/');this[_0x1113('0x6')](_0x1113('0x3'),_0x500c86);}},'rating':{'type':Sequelize[_0x1113('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1113('0x7')],'set':function(_0x3e20dd){this[_0x1113('0x6')](_0x1113('0x8'),moment()['subtract'](_0x3e20dd,'ms'));this['setDataValue'](_0x1113('0x9'),moment());this[_0x1113('0x6')](_0x1113('0xa'),_0x3e20dd);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1113('0x2')](_0x1113('0x8')))['format'](_0x1113('0xb'))[_0x1113('0xc')]();}},'closedAt':{'type':Sequelize[_0x1113('0xd')],'get':function(){return moment(this[_0x1113('0x2')]('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x1113('0xd')],'get':function(){return moment(this[_0x1113('0x2')](_0x1113('0xe')))[_0x1113('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x1113('0xc')]();}},'updatedAt':{'type':Sequelize[_0x1113('0xd')],'get':function(){return moment(this[_0x1113('0x2')](_0x1113('0x10')))[_0x1113('0xf')](_0x1113('0xb'))[_0x1113('0xc')]();}}}; \ No newline at end of file +var _0x04fa=['STRING','setDataValue','closedAt','duration','startedAt','MM-DD-YYYY\x20HH:mm','toString','format','DATE','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','value','getDataValue'];(function(_0xb28f71,_0x59ba5f){var _0x385e78=function(_0x12ad1e){while(--_0x12ad1e){_0xb28f71['push'](_0xb28f71['shift']());}};_0x385e78(++_0x59ba5f);}(_0x04fa,0x119));var _0xa04f=function(_0x323fd0,_0x319b28){_0x323fd0=_0x323fd0-0x0;var _0x4307a7=_0x04fa[_0x323fd0];return _0x4307a7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa04f('0x0'));var path=require(_0xa04f('0x1'));var config=require(_0xa04f('0x2'));module[_0xa04f('0x3')]={'format':{'type':Sequelize[_0xa04f('0x4')],'get':function(){return this['getDataValue'](_0xa04f('0x5'))?path['extname'](this[_0xa04f('0x6')](_0xa04f('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xa04f('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xa04f('0x7')],'set':function(_0x2c521c){var _0x315771=_0x2c521c['replace'](/\\/g,'/');this[_0xa04f('0x8')]('value',_0x315771);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5ea498){this[_0xa04f('0x8')]('startedAt',moment()['subtract'](_0x5ea498,'ms'));this[_0xa04f('0x8')](_0xa04f('0x9'),moment());this['setDataValue'](_0xa04f('0xa'),_0x5ea498);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa04f('0x6')](_0xa04f('0xb')))['format'](_0xa04f('0xc'))[_0xa04f('0xd')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('closedAt'))[_0xa04f('0xe')](_0xa04f('0xc'))[_0xa04f('0xd')]();}},'createdAt':{'type':Sequelize[_0xa04f('0xf')],'get':function(){return moment(this[_0xa04f('0x6')](_0xa04f('0x10')))['format'](_0xa04f('0xc'))[_0xa04f('0xd')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa04f('0x6')](_0xa04f('0x11')))[_0xa04f('0xe')](_0xa04f('0xc'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 2bef203..b54edf1 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 _0x038b=['offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','root','%s.cypher','decryptFile','secrets','recording','join','server/files/screen_recordings','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','download','unlink','message','send','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0xc99c92,_0x119606){var _0x591994=function(_0x537b4e){while(--_0x537b4e){_0xc99c92['push'](_0xc99c92['shift']());}};_0x591994(++_0x119606);}(_0x038b,0x114));var _0xb038=function(_0x3ed294,_0x17ef98){_0x3ed294=_0x3ed294-0x0;var _0xde1304=_0x038b[_0x3ed294];return _0xde1304;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x2d')](_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24')),[_0xb038('0x2e')]);_0xc387d['query']=_[_0xb038('0x2f')](_0x2855a6['query']);_0xc387d[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x32')]);_0x12b3b6[_0xb038('0x33')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x32')][_0xb038('0x34')]));_0x12b3b6['attributes']=_0x12b3b6[_0xb038('0x33')][_0xb038('0x35')]?_0x12b3b6[_0xb038('0x33')]:_0xc387d['model'];if(!_0x2855a6['query']['hasOwnProperty'](_0xb038('0x36'))){_0x12b3b6[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x32')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs['offset'](_0x2855a6[_0xb038('0x32')][_0xb038('0x18')]);}_0x12b3b6[_0xb038('0x37')]=qs[_0xb038('0x38')](_0x2855a6['query'][_0xb038('0x38')]);_0x12b3b6[_0xb038('0x39')]=qs['filters'](_['pick'](_0x2855a6[_0xb038('0x32')],_0xc387d[_0xb038('0x30')]),_0x1783d4);if(_0x2855a6[_0xb038('0x32')][_0xb038('0x3a')]){_0x12b3b6[_0xb038('0x39')]=_['merge'](_0x12b3b6[_0xb038('0x39')],{'$or':_[_0xb038('0x26')](_0x1783d4,function(_0x26d48c){if(_0x26d48c[_0xb038('0x2a')]!=='VIRTUAL'){var _0x793da9={};_0x793da9[_0x26d48c[_0xb038('0x24')]]={'$like':'%'+_0x2855a6[_0xb038('0x32')]['filter']+'%'};return _0x793da9;}})});}_0x12b3b6=_[_0xb038('0x3b')]({},_0x12b3b6,_0x2855a6['options']);var _0x36f281={'where':_0x12b3b6[_0xb038('0x39')]};return db[_0xb038('0x27')]['count'](_0x36f281)[_0xb038('0x22')](function(_0x357c78){_0x551b55[_0xb038('0x1a')]=_0x357c78;if(_0x2855a6['query'][_0xb038('0x3c')]){_0x12b3b6[_0xb038('0x3d')]=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3e')](_0x12b3b6);})['then'](function(_0x28b922){_0x551b55[_0xb038('0x3f')]=_0x28b922;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x40')](handleError(_0x28a6a9,null));};exports['show']=function(_0x19dc7b,_0x269c7d){var _0x57816c={'raw':![],'where':{'id':_0x19dc7b[_0xb038('0x41')]['id']}},_0x207fb5={};_0x207fb5[_0xb038('0x2c')]=_['keys'](db[_0xb038('0x27')][_0xb038('0x28')]);_0x207fb5['query']=_['keys'](_0x19dc7b[_0xb038('0x32')]);_0x207fb5[_0xb038('0x30')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],_0x207fb5[_0xb038('0x32')]);_0x57816c[_0xb038('0x33')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],qs['fields'](_0x19dc7b['query']['fields']));_0x57816c[_0xb038('0x33')]=_0x57816c[_0xb038('0x33')]['length']?_0x57816c[_0xb038('0x33')]:_0x207fb5[_0xb038('0x2c')];if(_0x19dc7b[_0xb038('0x32')]['includeAll']){_0x57816c[_0xb038('0x3d')]=[{'all':!![]}];}_0x57816c=_['merge']({},_0x57816c,_0x19dc7b['options']);return db[_0xb038('0x27')][_0xb038('0x42')](_0x57816c)[_0xb038('0x22')](handleEntityNotFound(_0x269c7d,null))[_0xb038('0x22')](respondWithResult(_0x269c7d,null))[_0xb038('0x40')](handleError(_0x269c7d,null));};exports[_0xb038('0x43')]=function(_0x2f053a,_0x473aae){return db[_0xb038('0x27')][_0xb038('0x43')](_0x2f053a['body'],{})[_0xb038('0x22')](respondWithResult(_0x473aae,0xc9))[_0xb038('0x40')](handleError(_0x473aae,null));};exports['update']=function(_0x906c9c,_0x19ab72){if(_0x906c9c['body']['id']){delete _0x906c9c[_0xb038('0x44')]['id'];}delete _0x906c9c[_0xb038('0x44')][_0xb038('0x45')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x46')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x47')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x48')];return db['ScreenRecording'][_0xb038('0x42')]({'where':{'id':_0x906c9c[_0xb038('0x41')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x19ab72,null))[_0xb038('0x22')](saveUpdates(_0x906c9c[_0xb038('0x44')],null))[_0xb038('0x22')](respondWithResult(_0x19ab72,null))['catch'](handleError(_0x19ab72,null));};exports[_0xb038('0x49')]=function(_0x2f3622,_0x2b2b4d){return db[_0xb038('0x27')][_0xb038('0x49')]()[_0xb038('0x22')](respondWithResult(_0x2b2b4d,null))[_0xb038('0x40')](handleError(_0x2b2b4d,null));};exports['download']=function(_0x3abe7a,_0x5c4a79,_0x77f211){var _0x1ea8ad=require(_0xb038('0x4a'));var _0x998fe3=![];var _0x1518c4={};if(_0x3abe7a['query']['type']&&_0x3abe7a['query'][_0xb038('0x2a')]===_0xb038('0x4b')){_0x1518c4[_0xb038('0x4b')]=_0x3abe7a[_0xb038('0x41')]['id'];}else{_0x1518c4['id']=_0x3abe7a[_0xb038('0x41')]['id'];}return db[_0xb038('0x27')]['find']({'where':_0x1518c4,'attributes':['id',_0xb038('0x48')],'raw':!![]})[_0xb038('0x22')](handleEntityNotFound(_0x5c4a79,null))['then'](function(_0x5b27d3){if(_0x5b27d3){var _0xf2907b=path['join'](config[_0xb038('0x4c')],'server/files/screen_recordings',_0x5b27d3[_0xb038('0x48')]);var _0x4677b8=util[_0xb038('0x2e')](_0xb038('0x4d'),_0xf2907b);if(fs['existsSync'](_0x4677b8)){_0x998fe3=!![];return _0x1ea8ad[_0xb038('0x4e')](_0x4677b8,_0xf2907b,config[_0xb038('0x4f')][_0xb038('0x50')])[_0xb038('0x22')](function(){return _0x5b27d3;});}return _0x5b27d3;}})[_0xb038('0x22')](function(_0x1246c8){if(_0x1246c8){var _0x14a553=path[_0xb038('0x51')](config[_0xb038('0x4c')],_0xb038('0x52'),_0x1246c8[_0xb038('0x48')]);if(!fs[_0xb038('0x53')](_0x14a553)){throw new db['Sequelize'][(_0xb038('0x54'))](_0xb038('0x55'));}if(_0x1246c8[_0xb038('0x56')]){return _0x5c4a79[_0xb038('0x57')](_0x14a553,_0x1246c8[_0xb038('0x56')]+path['extname'](_0x14a553),function(){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}else{return _0x5c4a79['download'](_0x14a553,function(_0xfb3ce6){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}}})['catch'](function(_0x15d61c){if(_0x15d61c[_0xb038('0x59')]===_0xb038('0x55')){_0x5c4a79[_0xb038('0x16')](0x194)[_0xb038('0x5a')](_0xb038('0x5b'));}else{return handleError(_0x5c4a79,null);}});};exports[_0xb038('0x5c')]=function(_0xe275b8,_0x769f1e){return db[_0xb038('0x27')]['find']({'where':{'id':_0xe275b8[_0xb038('0x41')]['id']}})['then'](function(_0x189894){if(_[_0xb038('0x5d')](_0x189894)){throw new ReferenceError(_0xb038('0x5e'));}return _0x189894;})[_0xb038('0x22')](function(_0x1f5f3f){var _0x23fb92=path[_0xb038('0x51')](config['root'],'server/files/screen_recordings',_0x1f5f3f[_0xb038('0x48')]);logger[_0xb038('0x5f')](_0xb038('0x60'),_0x23fb92);if(!_['isNil'](_0x1f5f3f['value'])&&fs[_0xb038('0x53')](_0x23fb92)){logger['info'](_0xb038('0x61')+_0x23fb92+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb038('0x62')](_0x23fb92);}_0x23fb92=_0x23fb92+'.cypher';if(!_[_0xb038('0x5d')](_0x1f5f3f[_0xb038('0x48')])&&fs[_0xb038('0x53')](_0x23fb92)){logger[_0xb038('0x5f')](_0xb038('0x61')+_0x23fb92+_0xb038('0x63'));fs['unlinkSync'](_0x23fb92);}return _0x1f5f3f;})['then'](function(_0x45e628){if(!_0x45e628)throw new InternalError();return _0x45e628['destroy']();})[_0xb038('0x22')](function(){_0x769f1e[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();})['catch'](handleError(_0x769f1e,null));}; \ No newline at end of file +var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 593a53e..cfa4c9c 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 _0x7d93=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x2c2c19,_0x43c8e8){var _0x2a03a6=function(_0x5329a2){while(--_0x5329a2){_0x2c2c19['push'](_0x2c2c19['shift']());}};_0x2a03a6(++_0x43c8e8);}(_0x7d93,0x97));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var util=require(_0x37d9('0x1'));var logger=require(_0x37d9('0x2'))(_0x37d9('0x3'));var moment=require(_0x37d9('0x4'));var BPromise=require(_0x37d9('0x5'));var rp=require(_0x37d9('0x6'));var fs=require('fs');var path=require(_0x37d9('0x7'));var rimraf=require(_0x37d9('0x8'));var config=require(_0x37d9('0x9'));var attributes=require(_0x37d9('0xa'));module['exports']=function(_0x409064,_0x5186c7){return _0x409064[_0x37d9('0xb')](_0x37d9('0xc'),attributes,{'tableName':_0x37d9('0xd'),'paranoid':![],'indexes':[{'name':_0x37d9('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc4c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','screen_recordings','interactionid','lodash','util'];(function(_0x578a78,_0xfdd763){var _0x5b517b=function(_0x30e4e1){while(--_0x30e4e1){_0x578a78['push'](_0x578a78['shift']());}};_0x5b517b(++_0xfdd763);}(_0xdc4c,0x172));var _0xcdc4=function(_0x51254e,_0x42d0e5){_0x51254e=_0x51254e-0x0;var _0x5835e3=_0xdc4c[_0x51254e];return _0x5835e3;};'use strict';var _=require(_0xcdc4('0x0'));var util=require(_0xcdc4('0x1'));var logger=require(_0xcdc4('0x2'))(_0xcdc4('0x3'));var moment=require(_0xcdc4('0x4'));var BPromise=require(_0xcdc4('0x5'));var rp=require(_0xcdc4('0x6'));var fs=require('fs');var path=require(_0xcdc4('0x7'));var rimraf=require(_0xcdc4('0x8'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xcdc4('0x9')]=function(_0x33da08,_0x401435){return _0x33da08['define']('ScreenRecording',attributes,{'tableName':_0xcdc4('0xa'),'paranoid':![],'indexes':[{'name':_0xcdc4('0xb'),'fields':[_0xcdc4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index c7a3a51..1ab8bc2 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 _0x1b49=['jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x57acdc,_0x2aebcb){var _0x585114=function(_0xc42422){while(--_0xc42422){_0x57acdc['push'](_0x57acdc['shift']());}};_0x585114(++_0x2aebcb);}(_0x1b49,0xce));var _0x91b4=function(_0x4c9730,_0x412b10){_0x4c9730=_0x4c9730-0x0;var _0x16a1ef=_0x1b49[_0x4c9730];return _0x16a1ef;};'use strict';var _=require('lodash');var util=require(_0x91b4('0x0'));var moment=require(_0x91b4('0x1'));var BPromise=require(_0x91b4('0x2'));var rs=require(_0x91b4('0x3'));var fs=require('fs');var Redis=require(_0x91b4('0x4'));var db=require(_0x91b4('0x5'))['db'];var utils=require(_0x91b4('0x6'));var logger=require(_0x91b4('0x7'))(_0x91b4('0x8'));var config=require(_0x91b4('0x9'));var jayson=require(_0x91b4('0xa'));var client=jayson[_0x91b4('0xb')][_0x91b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44c97f,_0x323dcd,_0x56f647){return new BPromise(function(_0x2af0fe,_0x273940){return client[_0x91b4('0xd')](_0x44c97f,_0x56f647)[_0x91b4('0xe')](function(_0x5e64cb){logger['info'](_0x91b4('0xf'),_0x323dcd,_0x91b4('0x10'));logger['debug'](_0x91b4('0x11'),_0x323dcd,_0x91b4('0x10'),JSON['stringify'](_0x5e64cb));if(_0x5e64cb['error']){if(_0x5e64cb[_0x91b4('0x12')][_0x91b4('0x13')]===0x1f4){logger['error'](_0x91b4('0xf'),_0x323dcd,_0x5e64cb['error'][_0x91b4('0x14')]);return _0x273940(_0x5e64cb[_0x91b4('0x12')][_0x91b4('0x14')]);}logger[_0x91b4('0x12')](_0x91b4('0xf'),_0x323dcd,_0x5e64cb[_0x91b4('0x12')][_0x91b4('0x14')]);return _0x2af0fe(_0x5e64cb[_0x91b4('0x12')][_0x91b4('0x14')]);}else{logger[_0x91b4('0x15')](_0x91b4('0xf'),_0x323dcd,_0x91b4('0x10'));_0x2af0fe(_0x5e64cb[_0x91b4('0x16')][_0x91b4('0x14')]);}})[_0x91b4('0x17')](function(_0x34a60e){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x323dcd,_0x34a60e);_0x273940(_0x34a60e);});});} \ No newline at end of file +var _0x0109=['code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x436106,_0x3387f8){var _0xc49e5e=function(_0x5ebaa3){while(--_0x5ebaa3){_0x436106['push'](_0x436106['shift']());}};_0xc49e5e(++_0x3387f8);}(_0x0109,0x96));var _0x9010=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x0109[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x9010('0x0'));var util=require('util');var moment=require(_0x9010('0x1'));var BPromise=require(_0x9010('0x2'));var rs=require(_0x9010('0x3'));var fs=require('fs');var Redis=require(_0x9010('0x4'));var db=require(_0x9010('0x5'))['db'];var utils=require(_0x9010('0x6'));var logger=require(_0x9010('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9010('0x8'));var client=jayson[_0x9010('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb819,_0x46b369,_0x553f86){return new BPromise(function(_0x67300b,_0x548116){return client[_0x9010('0xa')](_0x2bb819,_0x553f86)['then'](function(_0x4bb81b){logger[_0x9010('0xb')](_0x9010('0xc'),_0x46b369,_0x9010('0xd'));logger[_0x9010('0xe')](_0x9010('0xf'),_0x46b369,'request\x20sent',JSON[_0x9010('0x10')](_0x4bb81b));if(_0x4bb81b[_0x9010('0x11')]){if(_0x4bb81b['error'][_0x9010('0x12')]===0x1f4){logger['error'](_0x9010('0xc'),_0x46b369,_0x4bb81b[_0x9010('0x11')]['message']);return _0x548116(_0x4bb81b[_0x9010('0x11')][_0x9010('0x13')]);}logger[_0x9010('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x46b369,_0x4bb81b[_0x9010('0x11')]['message']);return _0x67300b(_0x4bb81b['error']['message']);}else{logger[_0x9010('0xb')](_0x9010('0xc'),_0x46b369,_0x9010('0xd'));_0x67300b(_0x4bb81b['result'][_0x9010('0x13')]);}})[_0x9010('0x14')](function(_0x203c50){logger[_0x9010('0x11')](_0x9010('0xc'),_0x46b369,_0x203c50);_0x548116(_0x203c50);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 99ec881..1ca0d1c 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 _0x6c73=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','/:id','show','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','single','logologin','post','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','util'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x6c73,0x1cc));var _0x36c7=function(_0x1d1bf9,_0x40e4cb){_0x1d1bf9=_0x1d1bf9-0x0;var _0x112bc6=_0x6c73[_0x1d1bf9];return _0x112bc6;};'use strict';var multer=require(_0x36c7('0x0'));var util=require(_0x36c7('0x1'));var path=require(_0x36c7('0x2'));var timeout=require(_0x36c7('0x3'));var express=require(_0x36c7('0x4'));var router=express[_0x36c7('0x5')]();var fs_extra=require(_0x36c7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36c7('0x7'));var controller=require(_0x36c7('0x8'));router['get']('/',auth[_0x36c7('0x9')](),controller[_0x36c7('0xa')]);router[_0x36c7('0xb')](_0x36c7('0xc'),controller['getDate']);router[_0x36c7('0xb')](_0x36c7('0xd'),controller[_0x36c7('0xe')]);router[_0x36c7('0xb')](_0x36c7('0xf'),controller[_0x36c7('0x10')]);router[_0x36c7('0xb')]('/:id/logo_login',controller['getLogoLogin']);router[_0x36c7('0xb')](_0x36c7('0x11'),controller[_0x36c7('0x12')]);router['get'](_0x36c7('0x13'),controller[_0x36c7('0x14')]);router[_0x36c7('0xb')](_0x36c7('0x15'),controller[_0x36c7('0x16')]);var upload=multer({'storage':multer[_0x36c7('0x17')]({'destination':function(_0x1f1959,_0x18b62b,_0x331fbf){_0x331fbf(null,path[_0x36c7('0x18')](config[_0x36c7('0x19')],_0x36c7('0x1a')));},'filename':function(_0x5a3f8e,_0x3a0ba2,_0x195fc1){_0x195fc1(null,util[_0x36c7('0x1b')](_0x36c7('0x1c'),'logo',path[_0x36c7('0x1d')](_0x3a0ba2[_0x36c7('0x1e')])));}})});router['post'](_0x36c7('0xf'),upload[_0x36c7('0x1f')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x36c7('0x17')]({'destination':function(_0x53b95d,_0x21029d,_0x127fb7){_0x127fb7(null,path['join'](config[_0x36c7('0x19')],_0x36c7('0x1a')));},'filename':function(_0x17e563,_0xe7ac5d,_0x13031a){_0x13031a(null,util[_0x36c7('0x1b')](_0x36c7('0x1c'),_0x36c7('0x20'),path[_0x36c7('0x1d')](_0xe7ac5d[_0x36c7('0x1e')])));}})});router[_0x36c7('0x21')](_0x36c7('0x22'),upload[_0x36c7('0x1f')]('file'),controller[_0x36c7('0x23')]);var upload=multer({'storage':multer[_0x36c7('0x17')]({'destination':function(_0x5c6335,_0x1b9af2,_0x5074cc){_0x5074cc(null,path[_0x36c7('0x18')](config[_0x36c7('0x19')],_0x36c7('0x1a')));},'filename':function(_0x4a1497,_0x53fa09,_0x3a6b29){_0x3a6b29(null,util[_0x36c7('0x1b')]('%s%s',_0x36c7('0x24'),path[_0x36c7('0x1d')](_0x53fa09[_0x36c7('0x1e')])));}})});router[_0x36c7('0x21')](_0x36c7('0x13'),upload[_0x36c7('0x1f')]('file'),controller[_0x36c7('0x25')]);var upload=multer({'storage':multer[_0x36c7('0x17')]({'destination':function(_0x9bc0d1,_0x35c13d,_0x20be72){_0x20be72(null,path['join'](config[_0x36c7('0x19')],_0x36c7('0x1a')));},'filename':function(_0x337eb8,_0x4595c7,_0x268296){_0x268296(null,util['format'](_0x36c7('0x1c'),_0x36c7('0x26'),path[_0x36c7('0x1d')](_0x4595c7[_0x36c7('0x1e')])));}})});router[_0x36c7('0x21')](_0x36c7('0x15'),upload['single']('file'),controller['addFavicon']);router[_0x36c7('0x27')](_0x36c7('0xd'),auth[_0x36c7('0x9')](),controller[_0x36c7('0x28')]);module[_0x36c7('0x29')]=router; \ No newline at end of file +var _0x3b9b=['extname','originalname','post','/:id/logo','single','addLogo','diskStorage','/:id/logo_login','addLogoLogin','preferred','file','favicon','/:id/favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','join','root','server/files/images/logos/','format','%s%s'];(function(_0x5fae11,_0x812d2a){var _0x22695b=function(_0xae0edd){while(--_0xae0edd){_0x5fae11['push'](_0x5fae11['shift']());}};_0x22695b(++_0x812d2a);}(_0x3b9b,0xb8));var _0xb3b9=function(_0x25f36b,_0x461894){_0x25f36b=_0x25f36b-0x0;var _0x3dfc95=_0x3b9b[_0x25f36b];return _0x3dfc95;};'use strict';var multer=require(_0xb3b9('0x0'));var util=require(_0xb3b9('0x1'));var path=require(_0xb3b9('0x2'));var timeout=require(_0xb3b9('0x3'));var express=require(_0xb3b9('0x4'));var router=express['Router']();var fs_extra=require(_0xb3b9('0x5'));var auth=require(_0xb3b9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b9('0x7'));var controller=require(_0xb3b9('0x8'));router[_0xb3b9('0x9')]('/',auth[_0xb3b9('0xa')](),controller[_0xb3b9('0xb')]);router[_0xb3b9('0x9')](_0xb3b9('0xc'),controller[_0xb3b9('0xd')]);router[_0xb3b9('0x9')](_0xb3b9('0xe'),controller[_0xb3b9('0xf')]);router['get']('/:id/logo',controller[_0xb3b9('0x10')]);router[_0xb3b9('0x9')]('/:id/logo_login',controller[_0xb3b9('0x11')]);router['get'](_0xb3b9('0x12'),controller['gdpr']);router['get'](_0xb3b9('0x13'),controller[_0xb3b9('0x14')]);router[_0xb3b9('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3aaa8e,_0x27acc8,_0x15dd31){_0x15dd31(null,path[_0xb3b9('0x15')](config[_0xb3b9('0x16')],_0xb3b9('0x17')));},'filename':function(_0x315918,_0x5c9b05,_0x2fd562){_0x2fd562(null,util[_0xb3b9('0x18')](_0xb3b9('0x19'),'logo',path[_0xb3b9('0x1a')](_0x5c9b05[_0xb3b9('0x1b')])));}})});router[_0xb3b9('0x1c')](_0xb3b9('0x1d'),upload[_0xb3b9('0x1e')]('file'),controller[_0xb3b9('0x1f')]);var upload=multer({'storage':multer[_0xb3b9('0x20')]({'destination':function(_0x11559c,_0x559a9e,_0x2f3cc9){_0x2f3cc9(null,path[_0xb3b9('0x15')](config['root'],_0xb3b9('0x17')));},'filename':function(_0x27d685,_0x52f9b6,_0x5aa1e3){_0x5aa1e3(null,util['format']('%s%s','logologin',path[_0xb3b9('0x1a')](_0x52f9b6[_0xb3b9('0x1b')])));}})});router[_0xb3b9('0x1c')](_0xb3b9('0x21'),upload[_0xb3b9('0x1e')]('file'),controller[_0xb3b9('0x22')]);var upload=multer({'storage':multer[_0xb3b9('0x20')]({'destination':function(_0x9b40d3,_0x536c57,_0x4ba992){_0x4ba992(null,path[_0xb3b9('0x15')](config[_0xb3b9('0x16')],_0xb3b9('0x17')));},'filename':function(_0x134053,_0x57c0cf,_0xd4debe){_0xd4debe(null,util[_0xb3b9('0x18')](_0xb3b9('0x19'),_0xb3b9('0x23'),path[_0xb3b9('0x1a')](_0x57c0cf[_0xb3b9('0x1b')])));}})});router[_0xb3b9('0x1c')](_0xb3b9('0x13'),upload[_0xb3b9('0x1e')](_0xb3b9('0x24')),controller['addPreferred']);var upload=multer({'storage':multer[_0xb3b9('0x20')]({'destination':function(_0xbeda53,_0xd99c77,_0x57ea41){_0x57ea41(null,path[_0xb3b9('0x15')](config[_0xb3b9('0x16')],_0xb3b9('0x17')));},'filename':function(_0x14a5fb,_0x2b32e3,_0x52a1fd){_0x52a1fd(null,util['format'](_0xb3b9('0x19'),_0xb3b9('0x25'),path['extname'](_0x2b32e3['originalname'])));}})});router[_0xb3b9('0x1c')](_0xb3b9('0x26'),upload['single'](_0xb3b9('0x24')),controller[_0xb3b9('0x27')]);router['put']('/:id',auth[_0xb3b9('0xa')](),controller[_0xb3b9('0x28')]);module[_0xb3b9('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 1ca3591..3dd97c7 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x3d57d6,_0x5c387d){var _0x59dc57=function(_0x589654){while(--_0x589654){_0x3d57d6['push'](_0x3d57d6['shift']());}};_0x59dc57(++_0x5c387d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53892e,_0x2524ac){_0x53892e=_0x53892e-0x0;var _0x3bdf5e=_0x5f2f[_0x53892e];return _0x3bdf5e;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xdb28,0x106));var _0x8db2=function(_0x4b3b47,_0x3a6297){_0x4b3b47=_0x4b3b47-0x0;var _0x8b608f=_0xdb28[_0x4b3b47];return _0x8b608f;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9de1c32..6ffff39 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 _0x3337=['length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','options','Setting','include','findAll','rows','catch','show','params','includeAll','find','update','body','addLogo','file','filename','logo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','join','toLower','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','getLogoLogin','loginLogo','default_loginLogo.svg','default','ValidationError','download','gdpr','getPreferred','default_preferred.png','addFavicon','getFavicon','getDate','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','send','index','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes'];(function(_0x13d7b6,_0x53bc5d){var _0x954f60=function(_0x2b2f8b){while(--_0x2b2f8b){_0x13d7b6['push'](_0x13d7b6['shift']());}};_0x954f60(++_0x53bc5d);}(_0x3337,0x12e));var _0x7333=function(_0x5b4c44,_0x2e495e){_0x5b4c44=_0x5b4c44-0x0;var _0x58485a=_0x3337[_0x5b4c44];return _0x58485a;};'use strict';var emlformat=require(_0x7333('0x0'));var rimraf=require(_0x7333('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7333('0x2'));var moment=require(_0x7333('0x3'));var BPromise=require(_0x7333('0x4'));var Mustache=require(_0x7333('0x5'));var util=require(_0x7333('0x6'));var path=require(_0x7333('0x7'));var sox=require(_0x7333('0x8'));var csv=require('to-csv');var ejs=require(_0x7333('0x9'));var fs=require('fs');var fs_extra=require(_0x7333('0xa'));var _=require(_0x7333('0xb'));var squel=require(_0x7333('0xc'));var crypto=require(_0x7333('0xd'));var jsforce=require(_0x7333('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7333('0xf'));var querystring=require(_0x7333('0x10'));var Papa=require(_0x7333('0x11'));var Redis=require(_0x7333('0x12'));var authService=require(_0x7333('0x13'));var qs=require(_0x7333('0x14'));var as=require(_0x7333('0x15'));var hardwareService=require(_0x7333('0x16'));var logger=require('../../config/logger')(_0x7333('0x17'));var utils=require(_0x7333('0x18'));var config=require(_0x7333('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7333('0x1a'))['db'];var jayson=require(_0x7333('0x1b'));var client=jayson[_0x7333('0x1c')][_0x7333('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1c8256,_0x166d1b,_0x23ac24,_0x5b99bc){return new BPromise(function(_0x30578f,_0x546382){var _0x32213e=_0x5b99bc||client;return _0x32213e[_0x7333('0x1e')](_0x1c8256,_0x23ac24)['then'](function(_0x2a4756){logger['info'](_0x7333('0x1f'),_0x166d1b,_0x7333('0x20'));logger[_0x7333('0x21')](_0x7333('0x22'),_0x166d1b,_0x7333('0x20'),JSON[_0x7333('0x23')](_0x2a4756));if(_0x2a4756['error']){if(_0x2a4756['error'][_0x7333('0x24')]===0x1f4){logger[_0x7333('0x25')](_0x7333('0x1f'),_0x166d1b,_0x2a4756['error'][_0x7333('0x26')]);return _0x546382(_0x2a4756['error']['message']);}logger[_0x7333('0x25')](_0x7333('0x1f'),_0x166d1b,_0x2a4756['error'][_0x7333('0x26')]);return _0x30578f(_0x2a4756[_0x7333('0x25')][_0x7333('0x26')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x166d1b,_0x7333('0x20'));_0x30578f(_0x2a4756[_0x7333('0x27')][_0x7333('0x26')]);}})['catch'](function(_0x3ab568){logger[_0x7333('0x25')](_0x7333('0x1f'),_0x166d1b,_0x3ab568);_0x546382(_0x3ab568);});});}function respondWithStatusCode(_0x534666,_0x5490fc){_0x5490fc=_0x5490fc||0xcc;return function(_0x112330){if(_0x112330){return _0x534666[_0x7333('0x28')](_0x5490fc);}return _0x534666[_0x7333('0x29')](_0x5490fc)[_0x7333('0x2a')]();};}function respondWithResult(_0x143ffb,_0x557d26){_0x557d26=_0x557d26||0xc8;return function(_0x32fa4e){if(_0x32fa4e){return _0x143ffb[_0x7333('0x29')](_0x557d26)['json'](_0x32fa4e);}};}function respondWithFilteredResult(_0x29982c,_0x232f4b){return function(_0x25ab2b){if(_0x25ab2b){var _0x17b2db=typeof _0x232f4b['offset']===_0x7333('0x2b')&&typeof _0x232f4b[_0x7333('0x2c')]===_0x7333('0x2b');var _0xfe2fec=_0x25ab2b[_0x7333('0x2d')];var _0x438ab3=_0x17b2db?0x0:_0x232f4b['offset'];var _0x3e4603=_0x17b2db?_0x25ab2b[_0x7333('0x2d')]:_0x232f4b[_0x7333('0x2e')]+_0x232f4b['limit'];var _0x10b499;if(_0x3e4603>=_0xfe2fec){_0x3e4603=_0xfe2fec;_0x10b499=0xc8;}else{_0x10b499=0xce;}_0x29982c[_0x7333('0x29')](_0x10b499);return _0x29982c[_0x7333('0x2f')](_0x7333('0x30'),_0x438ab3+'-'+_0x3e4603+'/'+_0xfe2fec)[_0x7333('0x31')](_0x25ab2b);}return null;};}function patchUpdates(_0x2e0f9e){return function(_0x4a8c4f){try{jsonpatch[_0x7333('0x32')](_0x4a8c4f,_0x2e0f9e,!![]);}catch(_0x47671f){return BPromise[_0x7333('0x33')](_0x47671f);}return _0x4a8c4f[_0x7333('0x34')]();};}function saveUpdates(_0x7818f8,_0x21906f){return function(_0x5db41b){if(_0x5db41b){return _0x5db41b['update'](_0x7818f8)[_0x7333('0x35')](function(_0x40a8f5){return _0x40a8f5;});}return null;};}function removeEntity(_0x109fbc,_0x34f951){return function(_0x583146){if(_0x583146){return _0x583146['destroy']()[_0x7333('0x35')](function(){_0x109fbc['status'](0xcc)[_0x7333('0x2a')]();});}};}function handleEntityNotFound(_0x4bacd4,_0x149b80){return function(_0x5c1207){if(!_0x5c1207){_0x4bacd4[_0x7333('0x28')](0x194);}return _0x5c1207;};}function handleError(_0x32591b,_0x32b0e7){_0x32b0e7=_0x32b0e7||0x1f4;return function(_0x584f4d){logger[_0x7333('0x25')](_0x584f4d['stack']);if(_0x584f4d['name']){delete _0x584f4d['name'];}_0x32591b[_0x7333('0x29')](_0x32b0e7)[_0x7333('0x36')](_0x584f4d);};}exports[_0x7333('0x37')]=function(_0x265116,_0x4970ed){var _0x48bb7d={},_0x4f4add={},_0x13b6ef={'count':0x0,'rows':[]};var _0x402e39=_['map'](db['Setting'][_0x7333('0x38')],function(_0x5c9ecf){return{'name':_0x5c9ecf[_0x7333('0x39')],'type':_0x5c9ecf['type'][_0x7333('0x3a')]};});_0x4f4add[_0x7333('0x3b')]=_['map'](_0x402e39,_0x7333('0x3c'));_0x4f4add[_0x7333('0x3d')]=_[_0x7333('0x3e')](_0x265116[_0x7333('0x3d')]);_0x4f4add[_0x7333('0x3f')]=_[_0x7333('0x40')](_0x4f4add['model'],_0x4f4add[_0x7333('0x3d')]);_0x48bb7d['attributes']=_[_0x7333('0x40')](_0x4f4add[_0x7333('0x3b')],qs[_0x7333('0x41')](_0x265116[_0x7333('0x3d')][_0x7333('0x41')]));_0x48bb7d['attributes']=_0x48bb7d[_0x7333('0x42')][_0x7333('0x43')]?_0x48bb7d['attributes']:_0x4f4add[_0x7333('0x3b')];if(!_0x265116[_0x7333('0x3d')][_0x7333('0x44')]('nolimit')){_0x48bb7d[_0x7333('0x2c')]=qs[_0x7333('0x2c')](_0x265116[_0x7333('0x3d')]['limit']);_0x48bb7d[_0x7333('0x2e')]=qs[_0x7333('0x2e')](_0x265116['query']['offset']);}_0x48bb7d[_0x7333('0x45')]=qs[_0x7333('0x46')](_0x265116[_0x7333('0x3d')]['sort']);_0x48bb7d[_0x7333('0x47')]=qs['filters'](_[_0x7333('0x48')](_0x265116[_0x7333('0x3d')],_0x4f4add[_0x7333('0x3f')]),_0x402e39);if(_0x265116['query']['filter']){_0x48bb7d[_0x7333('0x47')]=_[_0x7333('0x49')](_0x48bb7d['where'],{'$or':_[_0x7333('0x4a')](_0x402e39,function(_0x476688){if(_0x476688['type']!==_0x7333('0x4b')){var _0x105d25={};_0x105d25[_0x476688['name']]={'$like':'%'+_0x265116[_0x7333('0x3d')]['filter']+'%'};return _0x105d25;}})});}_0x48bb7d=_[_0x7333('0x49')]({},_0x48bb7d,_0x265116[_0x7333('0x4c')]);var _0x295c81={'where':_0x48bb7d[_0x7333('0x47')]};return db[_0x7333('0x4d')][_0x7333('0x2d')](_0x295c81)[_0x7333('0x35')](function(_0x3e0697){_0x13b6ef['count']=_0x3e0697;if(_0x265116[_0x7333('0x3d')]['includeAll']){_0x48bb7d[_0x7333('0x4e')]=[{'all':!![]}];}return db[_0x7333('0x4d')][_0x7333('0x4f')](_0x48bb7d);})['then'](function(_0x5f3fd8){_0x13b6ef[_0x7333('0x50')]=_0x5f3fd8;return _0x13b6ef;})['then'](respondWithFilteredResult(_0x4970ed,_0x48bb7d))[_0x7333('0x51')](handleError(_0x4970ed,null));};exports[_0x7333('0x52')]=function(_0x314a77,_0x4c7237){var _0x4afa4e={'raw':![],'where':{'id':_0x314a77[_0x7333('0x53')]['id']}},_0x379d03={};_0x379d03[_0x7333('0x3b')]=_[_0x7333('0x3e')](db['Setting'][_0x7333('0x38')]);_0x379d03[_0x7333('0x3d')]=_[_0x7333('0x3e')](_0x314a77['query']);_0x379d03[_0x7333('0x3f')]=_[_0x7333('0x40')](_0x379d03[_0x7333('0x3b')],_0x379d03[_0x7333('0x3d')]);_0x4afa4e[_0x7333('0x42')]=_[_0x7333('0x40')](_0x379d03['model'],qs[_0x7333('0x41')](_0x314a77['query']['fields']));_0x4afa4e[_0x7333('0x42')]=_0x4afa4e[_0x7333('0x42')][_0x7333('0x43')]?_0x4afa4e[_0x7333('0x42')]:_0x379d03[_0x7333('0x3b')];if(_0x314a77[_0x7333('0x3d')][_0x7333('0x54')]){_0x4afa4e[_0x7333('0x4e')]=[{'all':!![]}];}_0x4afa4e=_['merge']({},_0x4afa4e,_0x314a77['options']);return db[_0x7333('0x4d')][_0x7333('0x55')](_0x4afa4e)[_0x7333('0x35')](handleEntityNotFound(_0x4c7237,null))[_0x7333('0x35')](respondWithResult(_0x4c7237,null))['catch'](handleError(_0x4c7237,null));};exports[_0x7333('0x56')]=function(_0x23af8a,_0xb6b090){if(_0x23af8a[_0x7333('0x57')]['id']){delete _0x23af8a['body']['id'];}return db[_0x7333('0x4d')]['find']({'where':{'id':_0x23af8a['params']['id']}})[_0x7333('0x35')](handleEntityNotFound(_0xb6b090,null))['then'](saveUpdates(_0x23af8a[_0x7333('0x57')],null))[_0x7333('0x35')](respondWithResult(_0xb6b090,null))[_0x7333('0x51')](handleError(_0xb6b090,null));};exports[_0x7333('0x58')]=function(_0x59cc07,_0x563bb,_0x59c2f2){if(_0x59cc07[_0x7333('0x59')]&&_0x59cc07[_0x7333('0x59')][_0x7333('0x5a')]){_0x59cc07[_0x7333('0x57')][_0x7333('0x5b')]=_0x59cc07[_0x7333('0x59')][_0x7333('0x5a')];}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x59cc07[_0x7333('0x53')]['id']}})[_0x7333('0x35')](handleEntityNotFound(_0x563bb,null))[_0x7333('0x35')](saveUpdates(_0x59cc07['body'],null))[_0x7333('0x35')](respondWithResult(_0x563bb,null))[_0x7333('0x51')](handleError(_0x563bb,null));};exports['addLogoLogin']=function(_0x41f752,_0x12594e,_0x5ef14c){if(_0x41f752[_0x7333('0x59')]&&_0x41f752[_0x7333('0x59')]['filename']){_0x41f752[_0x7333('0x57')]['loginLogo']=_0x41f752['file'][_0x7333('0x5a')];}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x41f752[_0x7333('0x53')]['id']}})[_0x7333('0x35')](handleEntityNotFound(_0x12594e,null))[_0x7333('0x35')](saveUpdates(_0x41f752[_0x7333('0x57')],null))[_0x7333('0x35')](respondWithResult(_0x12594e,null))['catch'](handleError(_0x12594e,null));};var utilLicense=require(_0x7333('0x5c'));exports[_0x7333('0x5d')]=function(_0x22ac14,_0x72219b,_0x2f467b){var _0x578d4a=_0x7333('0x5e');var _0x337082={'custom':![]};return utilLicense[_0x7333('0x5f')]()[_0x7333('0x35')](function(_0xcf3dc0){if(_0xcf3dc0){_0x337082=_0xcf3dc0;}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x22ac14[_0x7333('0x53')]['id']},'attributes':['logo','loginLogo',_0x7333('0x60'),_0x7333('0x61'),_0x7333('0x62'),_0x7333('0x63'),_0x7333('0x64'),_0x7333('0x65')],'raw':!![]});})[_0x7333('0x35')](handleEntityNotFound(_0x72219b,null))['then'](function(_0x101e04){if(_0x101e04){var _0x5ad7b9=_0x101e04[_0x7333('0x5b')]&&fs[_0x7333('0x66')](path['join'](config[_0x7333('0x67')],_0x578d4a,_['toLower'](_0x101e04[_0x7333('0x5b')])))?path[_0x7333('0x68')](config[_0x7333('0x67')],_0x578d4a,_['toLower'](_0x101e04[_0x7333('0x5b')])):path['join'](config[_0x7333('0x67')],_0x578d4a,_[_0x7333('0x69')](_0x7333('0x6a')));var _0x1d4ec9='default'+_[_0x7333('0x6b')]('logo');if(_0x101e04[_0x1d4ec9]||!_0x337082[_0x7333('0x6c')]){_0x5ad7b9=path[_0x7333('0x68')](config[_0x7333('0x67')],_0x578d4a,_[_0x7333('0x69')]('default_logo.svg'));}if(!fs[_0x7333('0x66')](_0x5ad7b9)){throw new db[(_0x7333('0x6d'))]['ValidationError'](_[_0x7333('0x6b')](_0x7333('0x5b'))+_0x7333('0x6e'));}return _0x72219b['download'](_0x5ad7b9);}})[_0x7333('0x51')](handleError(_0x72219b,null));};var utilLicense=require(_0x7333('0x5c'));exports[_0x7333('0x6f')]=function(_0x4c2c9a,_0x4dc667,_0x305232){var _0x2f0fb4=_0x7333('0x5e');var _0x3e8b49={'custom':![]};return utilLicense[_0x7333('0x5f')]()[_0x7333('0x35')](function(_0x283d59){if(_0x283d59){_0x3e8b49=_0x283d59;}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x4c2c9a[_0x7333('0x53')]['id']},'attributes':['logo',_0x7333('0x70'),_0x7333('0x60'),_0x7333('0x61'),_0x7333('0x62'),_0x7333('0x63'),'defaultPreferred',_0x7333('0x65')],'raw':!![]});})[_0x7333('0x35')](handleEntityNotFound(_0x4dc667,null))[_0x7333('0x35')](function(_0x230c1e){if(_0x230c1e){var _0x169733=_0x230c1e['loginLogo']&&fs['existsSync'](path[_0x7333('0x68')](config[_0x7333('0x67')],_0x2f0fb4,_['toLower'](_0x230c1e[_0x7333('0x70')])))?path[_0x7333('0x68')](config['root'],_0x2f0fb4,_[_0x7333('0x69')](_0x230c1e['loginLogo'])):path[_0x7333('0x68')](config['root'],_0x2f0fb4,_[_0x7333('0x69')](_0x7333('0x71')));var _0x885b8=_0x7333('0x72')+_[_0x7333('0x6b')]('loginLogo');if(_0x230c1e[_0x885b8]||!_0x3e8b49[_0x7333('0x6c')]){_0x169733=path[_0x7333('0x68')](config[_0x7333('0x67')],_0x2f0fb4,_[_0x7333('0x69')](_0x7333('0x71')));}if(!fs[_0x7333('0x66')](_0x169733)){throw new db[(_0x7333('0x6d'))][(_0x7333('0x73'))](_[_0x7333('0x6b')]('loginLogo')+'\x20not\x20found');}return _0x4dc667[_0x7333('0x74')](_0x169733);}})[_0x7333('0x51')](handleError(_0x4dc667,null));};exports[_0x7333('0x75')]=function(_0x11d638,_0x22ac3f){return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x11d638[_0x7333('0x53')]['id']},'attributes':['securePassword']})[_0x7333('0x35')](respondWithResult(_0x22ac3f,null))[_0x7333('0x51')](handleError(_0x22ac3f,null));};exports['addPreferred']=function(_0x485d4f,_0x36a151,_0x2c7ef7){if(_0x485d4f[_0x7333('0x59')]&&_0x485d4f[_0x7333('0x59')]['filename']){_0x485d4f[_0x7333('0x57')]['preferred']=_0x485d4f['file'][_0x7333('0x5a')];}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x485d4f[_0x7333('0x53')]['id']}})['then'](handleEntityNotFound(_0x36a151,null))[_0x7333('0x35')](saveUpdates(_0x485d4f[_0x7333('0x57')],null))[_0x7333('0x35')](respondWithResult(_0x36a151,null))[_0x7333('0x51')](handleError(_0x36a151,null));};var utilLicense=require(_0x7333('0x5c'));exports[_0x7333('0x76')]=function(_0x20f886,_0x3473cf,_0x9d2bdd){var _0x14f0db=_0x7333('0x5e');var _0x5c29bf={'custom':![]};return utilLicense[_0x7333('0x5f')]()[_0x7333('0x35')](function(_0x1fde2f){if(_0x1fde2f){_0x5c29bf=_0x1fde2f;}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x20f886['params']['id']},'attributes':[_0x7333('0x5b'),_0x7333('0x70'),_0x7333('0x60'),_0x7333('0x61'),_0x7333('0x62'),_0x7333('0x63'),_0x7333('0x64'),_0x7333('0x65')],'raw':!![]});})[_0x7333('0x35')](handleEntityNotFound(_0x3473cf,null))[_0x7333('0x35')](function(_0x21c5b3){if(_0x21c5b3){var _0x47e791=_0x21c5b3[_0x7333('0x60')]&&fs[_0x7333('0x66')](path[_0x7333('0x68')](config['root'],_0x14f0db,_[_0x7333('0x69')](_0x21c5b3[_0x7333('0x60')])))?path[_0x7333('0x68')](config[_0x7333('0x67')],_0x14f0db,_[_0x7333('0x69')](_0x21c5b3[_0x7333('0x60')])):path[_0x7333('0x68')](config[_0x7333('0x67')],_0x14f0db,_[_0x7333('0x69')](_0x7333('0x77')));var _0x8b2ef3=_0x7333('0x72')+_[_0x7333('0x6b')](_0x7333('0x60'));if(_0x21c5b3[_0x8b2ef3]||!_0x5c29bf['custom']||!_0x5c29bf['preferred']){_0x47e791=path[_0x7333('0x68')](config[_0x7333('0x67')],_0x14f0db,_[_0x7333('0x69')](_0x7333('0x77')));}if(!fs[_0x7333('0x66')](_0x47e791)){throw new db['Sequelize']['ValidationError'](_[_0x7333('0x6b')](_0x7333('0x60'))+_0x7333('0x6e'));}return _0x3473cf[_0x7333('0x74')](_0x47e791);}})[_0x7333('0x51')](handleError(_0x3473cf,null));};exports[_0x7333('0x78')]=function(_0x35c60a,_0x6c1f0d,_0x33d5a7){if(_0x35c60a[_0x7333('0x59')]&&_0x35c60a[_0x7333('0x59')][_0x7333('0x5a')]){_0x35c60a['body']['favicon']=_0x35c60a[_0x7333('0x59')][_0x7333('0x5a')];}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x35c60a[_0x7333('0x53')]['id']}})[_0x7333('0x35')](handleEntityNotFound(_0x6c1f0d,null))[_0x7333('0x35')](saveUpdates(_0x35c60a[_0x7333('0x57')],null))[_0x7333('0x35')](respondWithResult(_0x6c1f0d,null))[_0x7333('0x51')](handleError(_0x6c1f0d,null));};var utilLicense=require(_0x7333('0x5c'));exports[_0x7333('0x79')]=function(_0x1a3816,_0x548a9c,_0x41674c){var _0x4031dd=_0x7333('0x5e');var _0x30a17d={'custom':![]};return utilLicense[_0x7333('0x5f')]()['then'](function(_0x4c17c0){if(_0x4c17c0){_0x30a17d=_0x4c17c0;}return db[_0x7333('0x4d')][_0x7333('0x55')]({'where':{'id':_0x1a3816[_0x7333('0x53')]['id']},'attributes':[_0x7333('0x5b'),'loginLogo','preferred',_0x7333('0x61'),'defaultLogo',_0x7333('0x63'),_0x7333('0x64'),'defaultFavicon'],'raw':!![]});})[_0x7333('0x35')](handleEntityNotFound(_0x548a9c,null))[_0x7333('0x35')](function(_0x224ac3){if(_0x224ac3){var _0x52f72c=_0x224ac3[_0x7333('0x61')]&&fs[_0x7333('0x66')](path[_0x7333('0x68')](config['root'],_0x4031dd,_['toLower'](_0x224ac3['favicon'])))?path[_0x7333('0x68')](config[_0x7333('0x67')],_0x4031dd,_[_0x7333('0x69')](_0x224ac3[_0x7333('0x61')])):path['join'](config['root'],_0x4031dd,_[_0x7333('0x69')]('default_favicon.ico'));var _0x4b1fa6='default'+_[_0x7333('0x6b')](_0x7333('0x61'));if(_0x224ac3[_0x4b1fa6]||!_0x30a17d[_0x7333('0x6c')]){_0x52f72c=path[_0x7333('0x68')](config[_0x7333('0x67')],_0x4031dd,_['toLower']('default_favicon.ico'));}if(!fs[_0x7333('0x66')](_0x52f72c)){throw new db[(_0x7333('0x6d'))]['ValidationError'](_[_0x7333('0x6b')](_0x7333('0x61'))+'\x20not\x20found');}return _0x548a9c[_0x7333('0x74')](_0x52f72c);}})[_0x7333('0x51')](handleError(_0x548a9c,null));};exports[_0x7333('0x7a')]=function(_0x5b96bf,_0x2b8371){var _0x1262a9={'offset':moment()['utcOffset']()};_0x1262a9['now']=moment()['utcOffset'](_0x1262a9[_0x7333('0x2e')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2b8371[_0x7333('0x29')](0xc8)[_0x7333('0x36')](_0x1262a9);}; \ No newline at end of file +var _0x6f49=['logo','find','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','defaultLogo','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','preferred','getPreferred','custom','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','end','stack','name','index','map','Setting','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','keys','body','params','addLogo','file','filename'];(function(_0x4f0c69,_0x32e44e){var _0x4b4f4d=function(_0x5dc7ab){while(--_0x5dc7ab){_0x4f0c69['push'](_0x4f0c69['shift']());}};_0x4b4f4d(++_0x32e44e);}(_0x6f49,0xa6));var _0x96f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f49[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96f4('0x0'));var zipdir=require(_0x96f4('0x1'));var jsonpatch=require(_0x96f4('0x2'));var rp=require(_0x96f4('0x3'));var moment=require(_0x96f4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x96f4('0x5'));var sox=require('sox');var csv=require(_0x96f4('0x6'));var ejs=require(_0x96f4('0x7'));var fs=require('fs');var fs_extra=require(_0x96f4('0x8'));var _=require('lodash');var squel=require(_0x96f4('0x9'));var crypto=require(_0x96f4('0xa'));var jsforce=require(_0x96f4('0xb'));var deskjs=require(_0x96f4('0xc'));var toCsv=require(_0x96f4('0x6'));var querystring=require(_0x96f4('0xd'));var Papa=require(_0x96f4('0xe'));var Redis=require(_0x96f4('0xf'));var authService=require(_0x96f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x96f4('0x11'));var hardwareService=require(_0x96f4('0x12'));var logger=require(_0x96f4('0x13'))(_0x96f4('0x14'));var utils=require(_0x96f4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x96f4('0x16'));var db=require(_0x96f4('0x17'))['db'];var jayson=require(_0x96f4('0x18'));var client=jayson['client'][_0x96f4('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x9a2d22,_0x4f325f,_0x2faa44,_0x504e91){return new BPromise(function(_0x4db39b,_0x502f3d){var _0x2a8a28=_0x504e91||client;return _0x2a8a28[_0x96f4('0x1a')](_0x9a2d22,_0x2faa44)[_0x96f4('0x1b')](function(_0x24fba9){logger[_0x96f4('0x1c')](_0x96f4('0x1d'),_0x4f325f,'request\x20sent');logger[_0x96f4('0x1e')](_0x96f4('0x1f'),_0x4f325f,_0x96f4('0x20'),JSON[_0x96f4('0x21')](_0x24fba9));if(_0x24fba9['error']){if(_0x24fba9[_0x96f4('0x22')][_0x96f4('0x23')]===0x1f4){logger[_0x96f4('0x22')]('Setting,\x20%s,\x20%s',_0x4f325f,_0x24fba9[_0x96f4('0x22')][_0x96f4('0x24')]);return _0x502f3d(_0x24fba9[_0x96f4('0x22')][_0x96f4('0x24')]);}logger[_0x96f4('0x22')](_0x96f4('0x1d'),_0x4f325f,_0x24fba9['error'][_0x96f4('0x24')]);return _0x4db39b(_0x24fba9[_0x96f4('0x22')]['message']);}else{logger[_0x96f4('0x1c')]('Setting,\x20%s,\x20%s',_0x4f325f,'request\x20sent');_0x4db39b(_0x24fba9[_0x96f4('0x25')][_0x96f4('0x24')]);}})[_0x96f4('0x26')](function(_0x32bd8f){logger[_0x96f4('0x22')](_0x96f4('0x1d'),_0x4f325f,_0x32bd8f);_0x502f3d(_0x32bd8f);});});}function respondWithStatusCode(_0x5c992d,_0x287f36){_0x287f36=_0x287f36||0xcc;return function(_0x3f8b1b){if(_0x3f8b1b){return _0x5c992d[_0x96f4('0x27')](_0x287f36);}return _0x5c992d[_0x96f4('0x28')](_0x287f36)['end']();};}function respondWithResult(_0x3967bb,_0x3404bf){_0x3404bf=_0x3404bf||0xc8;return function(_0x27751e){if(_0x27751e){return _0x3967bb[_0x96f4('0x28')](_0x3404bf)[_0x96f4('0x29')](_0x27751e);}};}function respondWithFilteredResult(_0x5eefb0,_0x25d0a0){return function(_0xff2057){if(_0xff2057){var _0xd3571a=typeof _0x25d0a0[_0x96f4('0x2a')]===_0x96f4('0x2b')&&typeof _0x25d0a0[_0x96f4('0x2c')]===_0x96f4('0x2b');var _0x5b171b=_0xff2057[_0x96f4('0x2d')];var _0x228077=_0xd3571a?0x0:_0x25d0a0['offset'];var _0x750f4d=_0xd3571a?_0xff2057[_0x96f4('0x2d')]:_0x25d0a0[_0x96f4('0x2a')]+_0x25d0a0[_0x96f4('0x2c')];var _0x703e6c;if(_0x750f4d>=_0x5b171b){_0x750f4d=_0x5b171b;_0x703e6c=0xc8;}else{_0x703e6c=0xce;}_0x5eefb0[_0x96f4('0x28')](_0x703e6c);return _0x5eefb0['set']('Content-Range',_0x228077+'-'+_0x750f4d+'/'+_0x5b171b)[_0x96f4('0x29')](_0xff2057);}return null;};}function patchUpdates(_0x53d172){return function(_0x5330b5){try{jsonpatch[_0x96f4('0x2e')](_0x5330b5,_0x53d172,!![]);}catch(_0x242764){return BPromise[_0x96f4('0x2f')](_0x242764);}return _0x5330b5[_0x96f4('0x30')]();};}function saveUpdates(_0x230ee7,_0x329d9e){return function(_0x58e9e8){if(_0x58e9e8){return _0x58e9e8[_0x96f4('0x31')](_0x230ee7)[_0x96f4('0x1b')](function(_0x236d07){return _0x236d07;});}return null;};}function removeEntity(_0x55b16d,_0x5cdd6f){return function(_0x1c65ef){if(_0x1c65ef){return _0x1c65ef[_0x96f4('0x32')]()[_0x96f4('0x1b')](function(){_0x55b16d[_0x96f4('0x28')](0xcc)[_0x96f4('0x33')]();});}};}function handleEntityNotFound(_0x129950,_0x376faf){return function(_0x36bea3){if(!_0x36bea3){_0x129950[_0x96f4('0x27')](0x194);}return _0x36bea3;};}function handleError(_0x51d0bf,_0x1d7316){_0x1d7316=_0x1d7316||0x1f4;return function(_0x541c4c){logger[_0x96f4('0x22')](_0x541c4c[_0x96f4('0x34')]);if(_0x541c4c['name']){delete _0x541c4c[_0x96f4('0x35')];}_0x51d0bf['status'](_0x1d7316)['send'](_0x541c4c);};}exports[_0x96f4('0x36')]=function(_0x5c9d97,_0xfda087){var _0x2918db={},_0x2d3242={},_0x41ac3c={'count':0x0,'rows':[]};var _0x533379=_[_0x96f4('0x37')](db[_0x96f4('0x38')][_0x96f4('0x39')],function(_0x438eb0){return{'name':_0x438eb0['fieldName'],'type':_0x438eb0['type'][_0x96f4('0x3a')]};});_0x2d3242[_0x96f4('0x3b')]=_[_0x96f4('0x37')](_0x533379,_0x96f4('0x35'));_0x2d3242[_0x96f4('0x3c')]=_['keys'](_0x5c9d97['query']);_0x2d3242['filters']=_[_0x96f4('0x3d')](_0x2d3242['model'],_0x2d3242[_0x96f4('0x3c')]);_0x2918db[_0x96f4('0x3e')]=_[_0x96f4('0x3d')](_0x2d3242[_0x96f4('0x3b')],qs[_0x96f4('0x3f')](_0x5c9d97[_0x96f4('0x3c')]['fields']));_0x2918db[_0x96f4('0x3e')]=_0x2918db[_0x96f4('0x3e')][_0x96f4('0x40')]?_0x2918db[_0x96f4('0x3e')]:_0x2d3242['model'];if(!_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x41')](_0x96f4('0x42'))){_0x2918db[_0x96f4('0x2c')]=qs[_0x96f4('0x2c')](_0x5c9d97['query'][_0x96f4('0x2c')]);_0x2918db[_0x96f4('0x2a')]=qs[_0x96f4('0x2a')](_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x2a')]);}_0x2918db[_0x96f4('0x43')]=qs['sort'](_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x44')]);_0x2918db['where']=qs[_0x96f4('0x45')](_[_0x96f4('0x46')](_0x5c9d97['query'],_0x2d3242[_0x96f4('0x45')]),_0x533379);if(_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x47')]){_0x2918db['where']=_[_0x96f4('0x48')](_0x2918db[_0x96f4('0x49')],{'$or':_['map'](_0x533379,function(_0x1328b3){if(_0x1328b3['type']!==_0x96f4('0x4a')){var _0x1a28b0={};_0x1a28b0[_0x1328b3[_0x96f4('0x35')]]={'$like':'%'+_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x47')]+'%'};return _0x1a28b0;}})});}_0x2918db=_[_0x96f4('0x48')]({},_0x2918db,_0x5c9d97[_0x96f4('0x4b')]);var _0xa4dfaa={'where':_0x2918db[_0x96f4('0x49')]};return db['Setting'][_0x96f4('0x2d')](_0xa4dfaa)[_0x96f4('0x1b')](function(_0x1c4df6){_0x41ac3c[_0x96f4('0x2d')]=_0x1c4df6;if(_0x5c9d97['query'][_0x96f4('0x4c')]){_0x2918db[_0x96f4('0x4d')]=[{'all':!![]}];}return db['Setting'][_0x96f4('0x4e')](_0x2918db);})[_0x96f4('0x1b')](function(_0x12371b){_0x41ac3c['rows']=_0x12371b;return _0x41ac3c;})[_0x96f4('0x1b')](respondWithFilteredResult(_0xfda087,_0x2918db))[_0x96f4('0x26')](handleError(_0xfda087,null));};exports[_0x96f4('0x4f')]=function(_0x38fc9c,_0x5e620d){var _0xb92d9={'raw':![],'where':{'id':_0x38fc9c['params']['id']}},_0x24da60={};_0x24da60['model']=_[_0x96f4('0x50')](db['Setting']['rawAttributes']);_0x24da60[_0x96f4('0x3c')]=_[_0x96f4('0x50')](_0x38fc9c[_0x96f4('0x3c')]);_0x24da60[_0x96f4('0x45')]=_[_0x96f4('0x3d')](_0x24da60['model'],_0x24da60[_0x96f4('0x3c')]);_0xb92d9[_0x96f4('0x3e')]=_['intersection'](_0x24da60[_0x96f4('0x3b')],qs['fields'](_0x38fc9c[_0x96f4('0x3c')][_0x96f4('0x3f')]));_0xb92d9[_0x96f4('0x3e')]=_0xb92d9[_0x96f4('0x3e')][_0x96f4('0x40')]?_0xb92d9[_0x96f4('0x3e')]:_0x24da60[_0x96f4('0x3b')];if(_0x38fc9c[_0x96f4('0x3c')]['includeAll']){_0xb92d9['include']=[{'all':!![]}];}_0xb92d9=_[_0x96f4('0x48')]({},_0xb92d9,_0x38fc9c[_0x96f4('0x4b')]);return db['Setting']['find'](_0xb92d9)[_0x96f4('0x1b')](handleEntityNotFound(_0x5e620d,null))[_0x96f4('0x1b')](respondWithResult(_0x5e620d,null))[_0x96f4('0x26')](handleError(_0x5e620d,null));};exports[_0x96f4('0x31')]=function(_0x2f7f5d,_0x4158d2){if(_0x2f7f5d[_0x96f4('0x51')]['id']){delete _0x2f7f5d['body']['id'];}return db['Setting']['find']({'where':{'id':_0x2f7f5d[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x4158d2,null))[_0x96f4('0x1b')](saveUpdates(_0x2f7f5d[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x4158d2,null))[_0x96f4('0x26')](handleError(_0x4158d2,null));};exports[_0x96f4('0x53')]=function(_0x181eb1,_0x1d961f,_0x5781c2){if(_0x181eb1[_0x96f4('0x54')]&&_0x181eb1['file'][_0x96f4('0x55')]){_0x181eb1[_0x96f4('0x51')][_0x96f4('0x56')]=_0x181eb1[_0x96f4('0x54')]['filename'];}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x181eb1[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x1d961f,null))['then'](saveUpdates(_0x181eb1[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x1d961f,null))[_0x96f4('0x26')](handleError(_0x1d961f,null));};exports[_0x96f4('0x58')]=function(_0x41a9f7,_0x1774b1,_0x1470a5){if(_0x41a9f7[_0x96f4('0x54')]&&_0x41a9f7['file']['filename']){_0x41a9f7[_0x96f4('0x51')][_0x96f4('0x59')]=_0x41a9f7[_0x96f4('0x54')][_0x96f4('0x55')];}return db['Setting'][_0x96f4('0x57')]({'where':{'id':_0x41a9f7[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x1774b1,null))[_0x96f4('0x1b')](saveUpdates(_0x41a9f7['body'],null))[_0x96f4('0x1b')](respondWithResult(_0x1774b1,null))['catch'](handleError(_0x1774b1,null));};var utilLicense=require(_0x96f4('0x16'));exports[_0x96f4('0x5a')]=function(_0x4ffad3,_0x198334,_0x1563d0){var _0x2a6a40=_0x96f4('0x5b');var _0x530095={'custom':![]};return utilLicense[_0x96f4('0x5c')]()[_0x96f4('0x1b')](function(_0x4dc092){if(_0x4dc092){_0x530095=_0x4dc092;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x4ffad3[_0x96f4('0x52')]['id']},'attributes':[_0x96f4('0x56'),_0x96f4('0x59'),'preferred',_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),'defaultPreferred',_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x198334,null))[_0x96f4('0x1b')](function(_0x2dde38){if(_0x2dde38){var _0x193ec9=_0x2dde38[_0x96f4('0x56')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_['toLower'](_0x2dde38[_0x96f4('0x56')])))?path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_[_0x96f4('0x63')](_0x2dde38[_0x96f4('0x56')])):path['join'](config[_0x96f4('0x62')],_0x2a6a40,_[_0x96f4('0x63')](_0x96f4('0x64')));var _0x91b1a2=_0x96f4('0x65')+_['upperFirst'](_0x96f4('0x56'));if(_0x2dde38[_0x91b1a2]||!_0x530095['custom']){_0x193ec9=path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_['toLower'](_0x96f4('0x64')));}if(!fs[_0x96f4('0x60')](_0x193ec9)){throw new db[(_0x96f4('0x66'))][(_0x96f4('0x67'))](_[_0x96f4('0x68')](_0x96f4('0x56'))+_0x96f4('0x69'));}return _0x198334[_0x96f4('0x6a')](_0x193ec9);}})[_0x96f4('0x26')](handleError(_0x198334,null));};var utilLicense=require(_0x96f4('0x16'));exports['getLogoLogin']=function(_0x173ef4,_0x2f4cb2,_0x3c4982){var _0x104c39='server/files/images/logos';var _0x7a01ff={'custom':![]};return utilLicense['getLicense']()[_0x96f4('0x1b')](function(_0x2d84ba){if(_0x2d84ba){_0x7a01ff=_0x2d84ba;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x173ef4['params']['id']},'attributes':[_0x96f4('0x56'),'loginLogo','preferred','favicon',_0x96f4('0x6b'),_0x96f4('0x5e'),_0x96f4('0x6c'),_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x2f4cb2,null))['then'](function(_0x286c7b){if(_0x286c7b){var _0x54172c=_0x286c7b[_0x96f4('0x59')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x104c39,_[_0x96f4('0x63')](_0x286c7b[_0x96f4('0x59')])))?path['join'](config[_0x96f4('0x62')],_0x104c39,_[_0x96f4('0x63')](_0x286c7b['loginLogo'])):path[_0x96f4('0x61')](config['root'],_0x104c39,_[_0x96f4('0x63')](_0x96f4('0x6d')));var _0x3e67ba='default'+_[_0x96f4('0x68')](_0x96f4('0x59'));if(_0x286c7b[_0x3e67ba]||!_0x7a01ff['custom']){_0x54172c=path[_0x96f4('0x61')](config['root'],_0x104c39,_[_0x96f4('0x63')](_0x96f4('0x6d')));}if(!fs['existsSync'](_0x54172c)){throw new db['Sequelize'][(_0x96f4('0x67'))](_[_0x96f4('0x68')](_0x96f4('0x59'))+_0x96f4('0x69'));}return _0x2f4cb2['download'](_0x54172c);}})[_0x96f4('0x26')](handleError(_0x2f4cb2,null));};exports[_0x96f4('0x6e')]=function(_0x32c658,_0xb1d584){return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x32c658['params']['id']},'attributes':[_0x96f4('0x6f')]})[_0x96f4('0x1b')](respondWithResult(_0xb1d584,null))['catch'](handleError(_0xb1d584,null));};exports[_0x96f4('0x70')]=function(_0x47aa9,_0x18e1ea,_0x2c7c4b){if(_0x47aa9[_0x96f4('0x54')]&&_0x47aa9['file'][_0x96f4('0x55')]){_0x47aa9[_0x96f4('0x51')][_0x96f4('0x71')]=_0x47aa9['file'][_0x96f4('0x55')];}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x47aa9[_0x96f4('0x52')]['id']}})['then'](handleEntityNotFound(_0x18e1ea,null))[_0x96f4('0x1b')](saveUpdates(_0x47aa9[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x18e1ea,null))['catch'](handleError(_0x18e1ea,null));};var utilLicense=require('../../config/license/util');exports[_0x96f4('0x72')]=function(_0x14494d,_0x4e2388,_0x12d427){var _0x3bab64=_0x96f4('0x5b');var _0x2e5eba={'custom':![]};return utilLicense[_0x96f4('0x5c')]()[_0x96f4('0x1b')](function(_0x3036b7){if(_0x3036b7){_0x2e5eba=_0x3036b7;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x14494d[_0x96f4('0x52')]['id']},'attributes':[_0x96f4('0x56'),_0x96f4('0x59'),_0x96f4('0x71'),_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),_0x96f4('0x6c'),_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x4e2388,null))['then'](function(_0x4b2f50){if(_0x4b2f50){var _0x2a4c11=_0x4b2f50[_0x96f4('0x71')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x4b2f50[_0x96f4('0x71')])))?path['join'](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x4b2f50[_0x96f4('0x71')])):path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_[_0x96f4('0x63')]('default_preferred.png'));var _0x1f7f3f=_0x96f4('0x65')+_[_0x96f4('0x68')]('preferred');if(_0x4b2f50[_0x1f7f3f]||!_0x2e5eba[_0x96f4('0x73')]||!_0x2e5eba['preferred']){_0x2a4c11=path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x96f4('0x74')));}if(!fs[_0x96f4('0x60')](_0x2a4c11)){throw new db['Sequelize'][(_0x96f4('0x67'))](_['upperFirst'](_0x96f4('0x71'))+_0x96f4('0x69'));}return _0x4e2388['download'](_0x2a4c11);}})[_0x96f4('0x26')](handleError(_0x4e2388,null));};exports[_0x96f4('0x75')]=function(_0x48a795,_0x1114ec,_0x10f76f){if(_0x48a795[_0x96f4('0x54')]&&_0x48a795['file'][_0x96f4('0x55')]){_0x48a795[_0x96f4('0x51')][_0x96f4('0x5d')]=_0x48a795[_0x96f4('0x54')][_0x96f4('0x55')];}return db['Setting'][_0x96f4('0x57')]({'where':{'id':_0x48a795['params']['id']}})['then'](handleEntityNotFound(_0x1114ec,null))[_0x96f4('0x1b')](saveUpdates(_0x48a795['body'],null))[_0x96f4('0x1b')](respondWithResult(_0x1114ec,null))[_0x96f4('0x26')](handleError(_0x1114ec,null));};var utilLicense=require(_0x96f4('0x16'));exports[_0x96f4('0x76')]=function(_0x1c3a70,_0x32092f,_0x20c5f2){var _0x54434d=_0x96f4('0x5b');var _0x2aa081={'custom':![]};return utilLicense['getLicense']()[_0x96f4('0x1b')](function(_0x4ee7ad){if(_0x4ee7ad){_0x2aa081=_0x4ee7ad;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x1c3a70[_0x96f4('0x52')]['id']},'attributes':['logo',_0x96f4('0x59'),_0x96f4('0x71'),_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),'defaultPreferred',_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x32092f,null))[_0x96f4('0x1b')](function(_0x3c9f2d){if(_0x3c9f2d){var _0x308c5d=_0x3c9f2d[_0x96f4('0x5d')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x3c9f2d['favicon'])))?path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x3c9f2d[_0x96f4('0x5d')])):path['join'](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x96f4('0x77')));var _0x26b89d=_0x96f4('0x65')+_[_0x96f4('0x68')](_0x96f4('0x5d'));if(_0x3c9f2d[_0x26b89d]||!_0x2aa081[_0x96f4('0x73')]){_0x308c5d=path['join'](config['root'],_0x54434d,_[_0x96f4('0x63')](_0x96f4('0x77')));}if(!fs['existsSync'](_0x308c5d)){throw new db[(_0x96f4('0x66'))]['ValidationError'](_[_0x96f4('0x68')](_0x96f4('0x5d'))+_0x96f4('0x69'));}return _0x32092f[_0x96f4('0x6a')](_0x308c5d);}})[_0x96f4('0x26')](handleError(_0x32092f,null));};exports[_0x96f4('0x78')]=function(_0x437ce9,_0x155388){var _0x404de4={'offset':moment()[_0x96f4('0x79')]()};_0x404de4[_0x96f4('0x7a')]=moment()[_0x96f4('0x79')](_0x404de4[_0x96f4('0x2a')])[_0x96f4('0x7b')](_0x96f4('0x7c'));return _0x155388[_0x96f4('0x28')](0xc8)[_0x96f4('0x7d')](_0x404de4);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index ff26abe..01e753d 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x19ef32,_0x3b78ff){var _0x20034e=function(_0x3eb2d9){while(--_0x3eb2d9){_0x19ef32['push'](_0x19ef32['shift']());}};_0x20034e(++_0x3b78ff);}(_0x3e74,0x175));var _0x43e7=function(_0x3e06ad,_0x4d6564){_0x3e06ad=_0x3e06ad-0x0;var _0x3719cc=_0x3e74[_0x3e06ad];return _0x3719cc;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'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 1f33321..7ea1a1f 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 _0xff16=['stringify','error','code','message','Setting,\x20%s,\x20%s','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x277075,_0x54fdd8){var _0x4e0b9f=function(_0x3d1257){while(--_0x3d1257){_0x277075['push'](_0x277075['shift']());}};_0x4e0b9f(++_0x54fdd8);}(_0xff16,0x1de));var _0x6ff1=function(_0x389ed6,_0x59990c){_0x389ed6=_0x389ed6-0x0;var _0x4dc0d1=_0xff16[_0x389ed6];return _0x4dc0d1;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var moment=require(_0x6ff1('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ff1('0x3'));var fs=require('fs');var Redis=require(_0x6ff1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ff1('0x5'));var logger=require(_0x6ff1('0x6'))(_0x6ff1('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ff1('0x8'));var client=jayson[_0x6ff1('0x9')][_0x6ff1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cccce,_0x25beb2,_0x346742){return new BPromise(function(_0x7b131f,_0x33e0e4){return client[_0x6ff1('0xb')](_0x2cccce,_0x346742)[_0x6ff1('0xc')](function(_0xa0d272){logger[_0x6ff1('0xd')]('Setting,\x20%s,\x20%s',_0x25beb2,_0x6ff1('0xe'));logger[_0x6ff1('0xf')](_0x6ff1('0x10'),_0x25beb2,_0x6ff1('0xe'),JSON[_0x6ff1('0x11')](_0xa0d272));if(_0xa0d272[_0x6ff1('0x12')]){if(_0xa0d272[_0x6ff1('0x12')][_0x6ff1('0x13')]===0x1f4){logger[_0x6ff1('0x12')]('Setting,\x20%s,\x20%s',_0x25beb2,_0xa0d272[_0x6ff1('0x12')]['message']);return _0x33e0e4(_0xa0d272[_0x6ff1('0x12')][_0x6ff1('0x14')]);}logger[_0x6ff1('0x12')](_0x6ff1('0x15'),_0x25beb2,_0xa0d272[_0x6ff1('0x12')][_0x6ff1('0x14')]);return _0x7b131f(_0xa0d272['error'][_0x6ff1('0x14')]);}else{logger[_0x6ff1('0xd')](_0x6ff1('0x15'),_0x25beb2,_0x6ff1('0xe'));_0x7b131f(_0xa0d272['result'][_0x6ff1('0x14')]);}})[_0x6ff1('0x16')](function(_0x233991){logger['error'](_0x6ff1('0x15'),_0x25beb2,_0x233991);_0x33e0e4(_0x233991);});});}exports[_0x6ff1('0x17')]=function(_0x30b5a3){var _0x2fb90a=this;return new Promise(function(_0x20fd5c,_0x42304d){return db[_0x6ff1('0x18')][_0x6ff1('0x19')]({'raw':_0x30b5a3[_0x6ff1('0x1a')]?_0x30b5a3[_0x6ff1('0x1a')][_0x6ff1('0x1b')]===undefined?!![]:![]:!![],'where':_0x30b5a3[_0x6ff1('0x1a')]?_0x30b5a3[_0x6ff1('0x1a')][_0x6ff1('0x1c')]||null:null,'attributes':_0x30b5a3[_0x6ff1('0x1a')]?_0x30b5a3[_0x6ff1('0x1a')][_0x6ff1('0x1d')]||null:null,'include':_0x30b5a3[_0x6ff1('0x1a')]?_0x30b5a3[_0x6ff1('0x1a')][_0x6ff1('0x1e')]?_[_0x6ff1('0x1f')](_0x30b5a3[_0x6ff1('0x1a')]['include'],function(_0x3eb0ca){return{'model':db[_0x3eb0ca[_0x6ff1('0x20')]],'as':_0x3eb0ca['as'],'attributes':_0x3eb0ca['attributes'],'include':_0x3eb0ca['include']?_[_0x6ff1('0x1f')](_0x3eb0ca[_0x6ff1('0x1e')],function(_0x338ec0){return{'model':db[_0x338ec0[_0x6ff1('0x20')]],'as':_0x338ec0['as'],'attributes':_0x338ec0['attributes'],'include':_0x338ec0[_0x6ff1('0x1e')]?_[_0x6ff1('0x1f')](_0x338ec0[_0x6ff1('0x1e')],function(_0x505945){return{'model':db[_0x505945[_0x6ff1('0x20')]],'as':_0x505945['as'],'attributes':_0x505945['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ff1('0xc')](function(_0x3ddef1){logger[_0x6ff1('0xd')](_0x6ff1('0x17'),_0x30b5a3);logger['debug'](_0x6ff1('0x17'),_0x30b5a3,JSON[_0x6ff1('0x11')](_0x3ddef1));_0x20fd5c(_0x3ddef1);})['catch'](function(_0x5edec){logger['error'](_0x6ff1('0x17'),_0x5edec[_0x6ff1('0x14')],_0x30b5a3);_0x42304d(_0x2fb90a['error'](0x1f4,_0x5edec[_0x6ff1('0x14')]));});});}; \ No newline at end of file +var _0x5fdf=['Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','include','map','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','error','code'];(function(_0x56b29c,_0x4e027e){var _0x5064b8=function(_0x5ce5e6){while(--_0x5ce5e6){_0x56b29c['push'](_0x56b29c['shift']());}};_0x5064b8(++_0x4e027e);}(_0x5fdf,0x1f2));var _0xf5fd=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x5fdf[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0xf5fd('0x0'));var util=require(_0xf5fd('0x1'));var moment=require('moment');var BPromise=require(_0xf5fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5fd('0x3'));var db=require(_0xf5fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5fd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf5fd('0x6'));var client=jayson[_0xf5fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5efd06,_0x173541,_0x546b3f){return new BPromise(function(_0x45fe94,_0x4bf42b){return client[_0xf5fd('0x8')](_0x5efd06,_0x546b3f)[_0xf5fd('0x9')](function(_0x5c2db4){logger[_0xf5fd('0xa')]('Setting,\x20%s,\x20%s',_0x173541,_0xf5fd('0xb'));logger[_0xf5fd('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x173541,'request\x20sent',JSON['stringify'](_0x5c2db4));if(_0x5c2db4[_0xf5fd('0xd')]){if(_0x5c2db4[_0xf5fd('0xd')][_0xf5fd('0xe')]===0x1f4){logger['error'](_0xf5fd('0xf'),_0x173541,_0x5c2db4[_0xf5fd('0xd')][_0xf5fd('0x10')]);return _0x4bf42b(_0x5c2db4[_0xf5fd('0xd')][_0xf5fd('0x10')]);}logger['error'](_0xf5fd('0xf'),_0x173541,_0x5c2db4[_0xf5fd('0xd')][_0xf5fd('0x10')]);return _0x45fe94(_0x5c2db4[_0xf5fd('0xd')]['message']);}else{logger[_0xf5fd('0xa')](_0xf5fd('0xf'),_0x173541,_0xf5fd('0xb'));_0x45fe94(_0x5c2db4[_0xf5fd('0x11')]['message']);}})[_0xf5fd('0x12')](function(_0x5ab1b4){logger[_0xf5fd('0xd')](_0xf5fd('0xf'),_0x173541,_0x5ab1b4);_0x4bf42b(_0x5ab1b4);});});}exports[_0xf5fd('0x13')]=function(_0x4345a4){var _0x21bd1e=this;return new Promise(function(_0x5d90fd,_0x325c38){return db[_0xf5fd('0x14')][_0xf5fd('0x15')]({'raw':_0x4345a4[_0xf5fd('0x16')]?_0x4345a4[_0xf5fd('0x16')][_0xf5fd('0x17')]===undefined?!![]:![]:!![],'where':_0x4345a4['options']?_0x4345a4[_0xf5fd('0x16')]['where']||null:null,'attributes':_0x4345a4[_0xf5fd('0x16')]?_0x4345a4[_0xf5fd('0x16')][_0xf5fd('0x18')]||null:null,'include':_0x4345a4[_0xf5fd('0x16')]?_0x4345a4[_0xf5fd('0x16')][_0xf5fd('0x19')]?_['map'](_0x4345a4[_0xf5fd('0x16')]['include'],function(_0x366aea){return{'model':db[_0x366aea['model']],'as':_0x366aea['as'],'attributes':_0x366aea[_0xf5fd('0x18')],'include':_0x366aea['include']?_['map'](_0x366aea[_0xf5fd('0x19')],function(_0x4c14ba){return{'model':db[_0x4c14ba['model']],'as':_0x4c14ba['as'],'attributes':_0x4c14ba['attributes'],'include':_0x4c14ba['include']?_[_0xf5fd('0x1a')](_0x4c14ba[_0xf5fd('0x19')],function(_0x32083f){return{'model':db[_0x32083f['model']],'as':_0x32083f['as'],'attributes':_0x32083f['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5fd('0x9')](function(_0x15571d){logger['info'](_0xf5fd('0x13'),_0x4345a4);logger[_0xf5fd('0xc')](_0xf5fd('0x13'),_0x4345a4,JSON['stringify'](_0x15571d));_0x5d90fd(_0x15571d);})[_0xf5fd('0x12')](function(_0x21c4ec){logger['error'](_0xf5fd('0x13'),_0x21c4ec[_0xf5fd('0x10')],_0x4345a4);_0x325c38(_0x21bd1e[_0xf5fd('0xd')](0x1f4,_0x21c4ec[_0xf5fd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4bdb337..726384c 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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x1ea5e2,_0x382cec){var _0x39380c=function(_0x27893b){while(--_0x27893b){_0x1ea5e2['push'](_0x1ea5e2['shift']());}};_0x39380c(++_0x382cec);}(_0xe14b,0x93));var _0xbe14=function(_0x455072,_0x2adc78){_0x455072=_0x455072-0x0;var _0x357e0a=_0xe14b[_0x455072];return _0x357e0a;};'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 fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x17542e,_0x497c31){var _0x28c798=function(_0x18baa5){while(--_0x18baa5){_0x17542e['push'](_0x17542e['shift']());}};_0x28c798(++_0x497c31);}(_0x814b,0x1a2));var _0xb814=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x814b[_0x265aa2];return _0x447a3a;};'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 fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 53da3a4..c41457e 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 _0xa41f=['ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate'];(function(_0x1db45f,_0x3d160b){var _0x2d68f5=function(_0x210f77){while(--_0x210f77){_0x1db45f['push'](_0x1db45f['shift']());}};_0x2d68f5(++_0x3d160b);}(_0xa41f,0x146));var _0xfa41=function(_0x224b42,_0x4a169a){_0x224b42=_0x224b42-0x0;var _0x5ba401=_0xa41f[_0x224b42];return _0x5ba401;};'use strict';var Sequelize=require(_0xfa41('0x0'));var rs=require('randomstring');module[_0xfa41('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xfa41('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfa41('0x3')]();}},'phone':{'type':Sequelize[_0xfa41('0x2')]},'type':{'type':Sequelize[_0xfa41('0x4')](_0xfa41('0x5'),_0xfa41('0x6'),_0xfa41('0x7'),_0xfa41('0x8'),_0xfa41('0x9'),'clickatell',_0xfa41('0xa'),_0xfa41('0xb'),_0xfa41('0xc'),_0xfa41('0xd'))},'accountSid':{'type':Sequelize[_0xfa41('0x2')]},'authId':{'type':Sequelize[_0xfa41('0x2')]},'authToken':{'type':Sequelize[_0xfa41('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfa41('0x2')]},'apiKey':{'type':Sequelize[_0xfa41('0x2')]},'applicationId':{'type':Sequelize[_0xfa41('0x2')]},'accountId':{'type':Sequelize[_0xfa41('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xfa41('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xfa41('0x2')]},'notificationTemplate':{'type':Sequelize[_0xfa41('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfa41('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa41('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa41('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfa41('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfa41('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa41('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa41('0x10')],'comment':_0xfa41('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfa41('0x12'),'set':function(_0x1eed7a){if(!_0x1eed7a)this[_0xfa41('0x13')](_0xfa41('0x14'),null);this[_0xfa41('0x13')](_0xfa41('0x15'),_0x1eed7a);}}}; \ No newline at end of file +var _0xcd3a=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x55a802,_0x10ab3a){var _0x1a0461=function(_0x43d162){while(--_0x43d162){_0x55a802['push'](_0x55a802['shift']());}};_0x1a0461(++_0x10ab3a);}(_0xcd3a,0x167));var _0xacd3=function(_0x29f0e1,_0x87dc0a){_0x29f0e1=_0x29f0e1-0x0;var _0x380740=_0xcd3a[_0x29f0e1];return _0x380740;};'use strict';var Sequelize=require(_0xacd3('0x0'));var rs=require(_0xacd3('0x1'));module[_0xacd3('0x2')]={'name':{'type':Sequelize[_0xacd3('0x3')],'unique':_0xacd3('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xacd3('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xacd3('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xacd3('0x3')]},'type':{'type':Sequelize[_0xacd3('0x5')](_0xacd3('0x6'),_0xacd3('0x7'),'connectel',_0xacd3('0x8'),_0xacd3('0x9'),_0xacd3('0xa'),_0xacd3('0xb'),'csc','infobip',_0xacd3('0xc'))},'accountSid':{'type':Sequelize[_0xacd3('0x3')]},'authId':{'type':Sequelize[_0xacd3('0x3')]},'authToken':{'type':Sequelize[_0xacd3('0x3')]},'smsMethod':{'type':Sequelize[_0xacd3('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xacd3('0x3')]},'password':{'type':Sequelize[_0xacd3('0x3')]},'apiKey':{'type':Sequelize[_0xacd3('0x3')]},'applicationId':{'type':Sequelize[_0xacd3('0x3')]},'accountId':{'type':Sequelize[_0xacd3('0x3')]},'senderString':{'type':Sequelize[_0xacd3('0x3')]},'deliveryReport':{'type':Sequelize[_0xacd3('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xacd3('0x3')]},'notificationTemplate':{'type':Sequelize[_0xacd3('0xe')],'defaultValue':function(){return _0xacd3('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xacd3('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xacd3('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xacd3('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xacd3('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xacd3('0x10')],'comment':_0xacd3('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xacd3('0xd')],'defaultValue':![],'comment':_0xacd3('0x12'),'set':function(_0x3c3ee5){if(!_0x3c3ee5)this[_0xacd3('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xacd3('0x14'),_0x3c3ee5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f5dfd67..ee2b553 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 _0x5204=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','map','SmsAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','find','Pause','mandatoryDispositionPause','describe','addDisposition','create','getDispositions','findOne','Disposition','nolimit','SmsAccountId','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','bandwidth','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','CmContact','contact','SmsInteraction','spread','interaction','created','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','groupName','clickatell','intelepeer','redif','DELIVERED','error_code','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6e95e9,_0x4ad401){var _0x1b280d=function(_0x1a8e13){while(--_0x1a8e13){_0x6e95e9['push'](_0x6e95e9['shift']());}};_0x1b280d(++_0x4ad401);}(_0x5204,0xcb));var _0x4520=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x5204[_0x20845e];return _0x28cf2b;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x1'));var rp=require('request-promise');var moment=require(_0x4520('0x2'));var BPromise=require(_0x4520('0x3'));var Mustache=require(_0x4520('0x4'));var util=require(_0x4520('0x5'));var path=require('path');var sox=require(_0x4520('0x6'));var csv=require(_0x4520('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4520('0x8'));var crypto=require(_0x4520('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4520('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4520('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4520('0xc'));var as=require(_0x4520('0xd'));var hardwareService=require(_0x4520('0xe'));var logger=require(_0x4520('0xf'))(_0x4520('0x10'));var utils=require(_0x4520('0x11'));var config=require(_0x4520('0x12'));var licenseUtil=require(_0x4520('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4520('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4520('0x15')]));require(_0x4520('0x16'))[_0x4520('0x17')](socket);var jayson=require(_0x4520('0x18'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3bb94a,_0x55bbbe,_0x19870b,_0x45fc87){return new BPromise(function(_0x1556a9,_0x420174){var _0x12ec1c=_0x45fc87||client;return _0x12ec1c[_0x4520('0x19')](_0x3bb94a,_0x19870b)[_0x4520('0x1a')](function(_0x30d451){logger[_0x4520('0x1b')](_0x4520('0x1c'),_0x55bbbe,_0x4520('0x1d'));logger['debug'](_0x4520('0x1e'),_0x55bbbe,_0x4520('0x1d'),JSON[_0x4520('0x1f')](_0x30d451));if(_0x30d451['error']){if(_0x30d451['error'][_0x4520('0x20')]===0x1f4){logger[_0x4520('0x21')](_0x4520('0x1c'),_0x55bbbe,_0x30d451[_0x4520('0x21')][_0x4520('0x22')]);return _0x420174(_0x30d451[_0x4520('0x21')][_0x4520('0x22')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x55bbbe,_0x30d451[_0x4520('0x21')][_0x4520('0x22')]);return _0x1556a9(_0x30d451[_0x4520('0x21')][_0x4520('0x22')]);}else{logger[_0x4520('0x1b')]('SmsAccount,\x20%s,\x20%s',_0x55bbbe,'request\x20sent');_0x1556a9(_0x30d451[_0x4520('0x23')][_0x4520('0x22')]);}})[_0x4520('0x24')](function(_0x125389){logger[_0x4520('0x21')](_0x4520('0x1c'),_0x55bbbe,_0x125389);_0x420174(_0x125389);});});}function respondWithStatusCode(_0x432575,_0x2386d5){_0x2386d5=_0x2386d5||0xcc;return function(_0x5cad0d){if(_0x5cad0d){return _0x432575[_0x4520('0x25')](_0x2386d5);}return _0x432575[_0x4520('0x26')](_0x2386d5)[_0x4520('0x27')]();};}function respondWithResult(_0x366fb1,_0x54d87b){_0x54d87b=_0x54d87b||0xc8;return function(_0x373118){if(_0x373118){return _0x366fb1[_0x4520('0x26')](_0x54d87b)['json'](_0x373118);}};}function respondWithFilteredResult(_0x4b25ba,_0x410261){return function(_0x5609cb){if(_0x5609cb){var _0x3ada0f=typeof _0x410261[_0x4520('0x28')]===_0x4520('0x29')&&typeof _0x410261[_0x4520('0x2a')]===_0x4520('0x29');var _0x45f315=_0x5609cb[_0x4520('0x2b')];var _0x1e0f7d=_0x3ada0f?0x0:_0x410261[_0x4520('0x28')];var _0x414cd9=_0x3ada0f?_0x5609cb[_0x4520('0x2b')]:_0x410261[_0x4520('0x28')]+_0x410261['limit'];var _0x4edea2;if(_0x414cd9>=_0x45f315){_0x414cd9=_0x45f315;_0x4edea2=0xc8;}else{_0x4edea2=0xce;}_0x4b25ba[_0x4520('0x26')](_0x4edea2);return _0x4b25ba[_0x4520('0x2c')]('Content-Range',_0x1e0f7d+'-'+_0x414cd9+'/'+_0x45f315)[_0x4520('0x2d')](_0x5609cb);}return null;};}function patchUpdates(_0x1d53c4){return function(_0x5ede16){try{jsonpatch[_0x4520('0x2e')](_0x5ede16,_0x1d53c4,!![]);}catch(_0x124790){return BPromise[_0x4520('0x2f')](_0x124790);}return _0x5ede16[_0x4520('0x30')]();};}function saveUpdates(_0x5cebcd,_0xec4d29){return function(_0x5c7205){if(_0x5c7205){return _0x5c7205[_0x4520('0x31')](_0x5cebcd)[_0x4520('0x1a')](function(_0x428103){return _0x428103;});}return null;};}function removeEntity(_0x18d824,_0x3417a4){return function(_0x333756){if(_0x333756){return _0x333756[_0x4520('0x32')]()['then'](function(){var _0x57490c=_0x333756[_0x4520('0x33')]({'plain':!![]});var _0x474bea=_0x4520('0x34');return db['UserProfileResource'][_0x4520('0x32')]({'where':{'type':_0x474bea,'resourceId':_0x57490c['id']}})[_0x4520('0x1a')](function(){return _0x333756;});})[_0x4520('0x1a')](function(){_0x18d824['status'](0xcc)[_0x4520('0x27')]();});}};}function handleEntityNotFound(_0x2d2eb7,_0x4faa0e){return function(_0x331248){if(!_0x331248){_0x2d2eb7['sendStatus'](0x194);}return _0x331248;};}function handleError(_0x21f06d,_0x224033){_0x224033=_0x224033||0x1f4;return function(_0x5a3bd7){logger[_0x4520('0x21')](_0x5a3bd7[_0x4520('0x35')]);if(_0x5a3bd7[_0x4520('0x36')]){delete _0x5a3bd7[_0x4520('0x36')];}_0x21f06d[_0x4520('0x26')](_0x224033)[_0x4520('0x37')](_0x5a3bd7);};}exports[_0x4520('0x38')]=function(_0x2d6585,_0x3d79ab){var _0x1a83ee={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1ffd41={},_0x2f33e1={'count':0x0,'rows':[]};var _0x1ffc45=_[_0x4520('0x39')](db[_0x4520('0x3a')][_0x4520('0x3b')],function(_0x1803b5){return{'name':_0x1803b5['fieldName'],'type':_0x1803b5[_0x4520('0x3c')][_0x4520('0x3d')]};});_0x1ffd41['model']=_['map'](_0x1ffc45,_0x4520('0x36'));_0x1ffd41[_0x4520('0x3e')]=_['keys'](_0x2d6585['query']);_0x1ffd41[_0x4520('0x3f')]=_[_0x4520('0x40')](_0x1ffd41[_0x4520('0x41')],_0x1ffd41[_0x4520('0x3e')]);_0x1a83ee[_0x4520('0x42')]=_['intersection'](_0x1ffd41[_0x4520('0x41')],qs[_0x4520('0x43')](_0x2d6585[_0x4520('0x3e')][_0x4520('0x43')]));_0x1a83ee[_0x4520('0x42')]=_0x1a83ee[_0x4520('0x42')][_0x4520('0x44')]?_0x1a83ee[_0x4520('0x42')]:_0x1ffd41[_0x4520('0x41')];if(!_0x2d6585[_0x4520('0x3e')][_0x4520('0x45')]('nolimit')){_0x1a83ee[_0x4520('0x2a')]=qs[_0x4520('0x2a')](_0x2d6585[_0x4520('0x3e')]['limit']);_0x1a83ee[_0x4520('0x28')]=qs[_0x4520('0x28')](_0x2d6585[_0x4520('0x3e')]['offset']);}_0x1a83ee[_0x4520('0x46')]=qs['sort'](_0x2d6585[_0x4520('0x3e')][_0x4520('0x47')]);_0x1a83ee[_0x4520('0x48')]=qs[_0x4520('0x3f')](_[_0x4520('0x49')](_0x2d6585[_0x4520('0x3e')],_0x1ffd41[_0x4520('0x3f')]),_0x1ffc45);if(_0x2d6585[_0x4520('0x3e')][_0x4520('0x4a')]){_0x1a83ee[_0x4520('0x48')]=_[_0x4520('0x4b')](_0x1a83ee[_0x4520('0x48')],{'$or':_['map'](_0x1ffc45,function(_0x5b0ab2){if(_0x5b0ab2[_0x4520('0x3c')]!==_0x4520('0x4c')){var _0x3bebc3={};_0x3bebc3[_0x5b0ab2[_0x4520('0x36')]]={'$like':'%'+_0x2d6585['query'][_0x4520('0x4a')]+'%'};return _0x3bebc3;}})});}_0x1a83ee=_['merge']({},_0x1a83ee,_0x2d6585[_0x4520('0x4d')]);var _0x136c74={'where':_0x1a83ee[_0x4520('0x48')]};return db[_0x4520('0x3a')][_0x4520('0x2b')](_0x136c74)[_0x4520('0x1a')](function(_0x9e2b39){_0x2f33e1['count']=_0x9e2b39;if(_0x2d6585[_0x4520('0x3e')]['includeAll']){_0x1a83ee[_0x4520('0x4e')]=[{'all':!![]}];}return db[_0x4520('0x3a')][_0x4520('0x4f')](_0x1a83ee);})['then'](function(_0x527e5e){_0x2f33e1[_0x4520('0x50')]=_0x527e5e;return _0x2f33e1;})[_0x4520('0x1a')](respondWithFilteredResult(_0x3d79ab,_0x1a83ee))['catch'](handleError(_0x3d79ab,null));};exports[_0x4520('0x51')]=function(_0x2d2d72,_0x5de84b){var _0x1d597c={'raw':![],'where':{'id':_0x2d2d72[_0x4520('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5e0ffd={};_0x5e0ffd[_0x4520('0x41')]=_[_0x4520('0x53')](db[_0x4520('0x3a')][_0x4520('0x3b')]);_0x5e0ffd[_0x4520('0x3e')]=_[_0x4520('0x53')](_0x2d2d72[_0x4520('0x3e')]);_0x5e0ffd[_0x4520('0x3f')]=_[_0x4520('0x40')](_0x5e0ffd[_0x4520('0x41')],_0x5e0ffd[_0x4520('0x3e')]);_0x1d597c['attributes']=_[_0x4520('0x40')](_0x5e0ffd[_0x4520('0x41')],qs['fields'](_0x2d2d72[_0x4520('0x3e')][_0x4520('0x43')]));_0x1d597c[_0x4520('0x42')]=_0x1d597c[_0x4520('0x42')][_0x4520('0x44')]?_0x1d597c[_0x4520('0x42')]:_0x5e0ffd[_0x4520('0x41')];if(_0x2d2d72[_0x4520('0x3e')][_0x4520('0x54')]){_0x1d597c['include']=[{'all':!![]}];}_0x1d597c=_['merge']({},_0x1d597c,_0x2d2d72[_0x4520('0x4d')]);return db['SmsAccount']['find'](_0x1d597c)['then'](handleEntityNotFound(_0x5de84b,null))['then'](respondWithResult(_0x5de84b,null))[_0x4520('0x24')](handleError(_0x5de84b,null));};exports['create']=function(_0x2deee6,_0x89999){return db['SmsAccount']['create'](_0x2deee6['body'],{})[_0x4520('0x1a')](function(_0x3b276a){var _0x338ca6=_0x2deee6[_0x4520('0x55')][_0x4520('0x33')]({'plain':!![]});if(!_0x338ca6)throw new Error(_0x4520('0x56'));if(_0x338ca6[_0x4520('0x57')]===_0x4520('0x55')){var _0xdc0c9a=_0x3b276a['get']({'plain':!![]});var _0xe4408e=_0x4520('0x34');return db[_0x4520('0x58')]['find']({'where':{'name':_0xe4408e,'userProfileId':_0x338ca6[_0x4520('0x59')]},'raw':!![]})[_0x4520('0x1a')](function(_0x4a7fe3){if(_0x4a7fe3&&_0x4a7fe3[_0x4520('0x5a')]===0x0){return db[_0x4520('0x5b')]['create']({'name':_0xdc0c9a[_0x4520('0x36')],'resourceId':_0xdc0c9a['id'],'type':_0x4a7fe3[_0x4520('0x36')],'sectionId':_0x4a7fe3['id']},{})['then'](function(){return _0x3b276a;});}else{return _0x3b276a;}})['catch'](function(_0x3e886e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e886e);throw _0x3e886e;});}return _0x3b276a;})[_0x4520('0x1a')](respondWithResult(_0x89999,0xc9))['catch'](handleError(_0x89999,null));};exports[_0x4520('0x31')]=function(_0x5e603d,_0xd636b4){if(_0x5e603d[_0x4520('0x5c')]['id']){delete _0x5e603d[_0x4520('0x5c')]['id'];}return db[_0x4520('0x3a')][_0x4520('0x5d')]({'where':{'id':_0x5e603d['params']['id']},'include':[{'model':db[_0x4520('0x5e')],'as':_0x4520('0x5f')}]})['then'](handleEntityNotFound(_0xd636b4,null))[_0x4520('0x1a')](saveUpdates(_0x5e603d[_0x4520('0x5c')],null))[_0x4520('0x1a')](respondWithResult(_0xd636b4,null))[_0x4520('0x24')](handleError(_0xd636b4,null));};exports[_0x4520('0x32')]=function(_0x198b69,_0x24f649){return db['SmsAccount'][_0x4520('0x5d')]({'where':{'id':_0x198b69[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x24f649,null))['then'](removeEntity(_0x24f649,null))[_0x4520('0x24')](handleError(_0x24f649,null));};exports[_0x4520('0x60')]=function(_0x471c98,_0x309c05){return db[_0x4520('0x3a')][_0x4520('0x60')]()['then'](respondWithResult(_0x309c05,null))[_0x4520('0x24')](handleError(_0x309c05,null));};exports[_0x4520('0x61')]=function(_0x32aad9,_0x2659c5,_0x550b3e){if(_0x32aad9[_0x4520('0x5c')]['id']){delete _0x32aad9[_0x4520('0x5c')]['id'];}return db[_0x4520('0x3a')][_0x4520('0x5d')]({'where':{'id':_0x32aad9[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x2659c5,null))[_0x4520('0x1a')](function(_0x21a582){if(_0x21a582){_0x32aad9[_0x4520('0x5c')]['SmsAccountId']=_0x21a582['id'];return db['Disposition'][_0x4520('0x62')](_0x32aad9[_0x4520('0x5c')]);}})[_0x4520('0x1a')](respondWithResult(_0x2659c5,null))[_0x4520('0x24')](handleError(_0x2659c5,null));};exports[_0x4520('0x63')]=function(_0x3e0f2e,_0x2e9d22,_0x350d89){var _0x1369ca={'raw':![],'where':{}};var _0x60a26e={};var _0x1dd047={'count':0x0,'rows':[]};return db[_0x4520('0x3a')][_0x4520('0x64')]({'where':{'id':_0x3e0f2e[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x2e9d22,null))['then'](function(_0x4929b6){if(_0x4929b6){_0x60a26e[_0x4520('0x41')]=_[_0x4520('0x53')](db[_0x4520('0x65')][_0x4520('0x3b')]);_0x60a26e[_0x4520('0x3e')]=_['keys'](_0x3e0f2e['query']);_0x60a26e['filters']=_[_0x4520('0x40')](_0x60a26e[_0x4520('0x41')],_0x60a26e[_0x4520('0x3e')]);_0x1369ca[_0x4520('0x42')]=_['intersection'](_0x60a26e[_0x4520('0x41')],qs['fields'](_0x3e0f2e[_0x4520('0x3e')][_0x4520('0x43')]));_0x1369ca[_0x4520('0x42')]=_0x1369ca[_0x4520('0x42')][_0x4520('0x44')]?_0x1369ca[_0x4520('0x42')]:_0x60a26e[_0x4520('0x41')];if(!_0x3e0f2e[_0x4520('0x3e')][_0x4520('0x45')](_0x4520('0x66'))){_0x1369ca[_0x4520('0x2a')]=qs[_0x4520('0x2a')](_0x3e0f2e[_0x4520('0x3e')]['limit']);_0x1369ca['offset']=qs[_0x4520('0x28')](_0x3e0f2e[_0x4520('0x3e')]['offset']);}_0x1369ca[_0x4520('0x46')]=qs['sort'](_0x3e0f2e[_0x4520('0x3e')][_0x4520('0x47')]);_0x1369ca['where']=qs[_0x4520('0x3f')](_['pick'](_0x3e0f2e[_0x4520('0x3e')],_0x60a26e[_0x4520('0x3f')]));_0x1369ca['where'][_0x4520('0x67')]=_0x4929b6['id'];if(_0x3e0f2e[_0x4520('0x3e')][_0x4520('0x4a')]){_0x1369ca[_0x4520('0x48')]=_['merge'](_0x1369ca['where'],{'$or':_[_0x4520('0x39')](_0x1369ca[_0x4520('0x42')],function(_0x175148){var _0x2b79ff={};_0x2b79ff[_0x175148]={'$like':'%'+_0x3e0f2e['query'][_0x4520('0x4a')]+'%'};return _0x2b79ff;})});}_0x1369ca=_[_0x4520('0x4b')]({},_0x1369ca,_0x3e0f2e[_0x4520('0x4d')]);return db['Disposition'][_0x4520('0x2b')]({'where':_0x1369ca[_0x4520('0x48')]})[_0x4520('0x1a')](function(_0x24bb20){_0x1dd047[_0x4520('0x2b')]=_0x24bb20;if(_0x3e0f2e['query'][_0x4520('0x54')]){_0x1369ca[_0x4520('0x4e')]=[{'all':!![]}];}return db['Disposition'][_0x4520('0x4f')](_0x1369ca);})[_0x4520('0x1a')](function(_0xc7ca27){_0x1dd047[_0x4520('0x50')]=_0xc7ca27;return _0x1dd047;});}})[_0x4520('0x1a')](respondWithFilteredResult(_0x2e9d22,_0x1369ca))[_0x4520('0x24')](handleError(_0x2e9d22,null));};exports['removeDispositions']=function(_0x2e2da3,_0x1a8448,_0x1e456e){return db[_0x4520('0x3a')]['find']({'where':{'id':_0x2e2da3['params']['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x1a8448,null))[_0x4520('0x1a')](function(_0x54bd09){if(_0x54bd09){return _0x54bd09['removeDispositions'](_0x2e2da3[_0x4520('0x3e')]['ids']);}})[_0x4520('0x1a')](respondWithStatusCode(_0x1a8448,null))[_0x4520('0x24')](handleError(_0x1a8448,null));};exports[_0x4520('0x68')]=function(_0x146189,_0x2674de,_0x27b50d){if(_0x146189[_0x4520('0x5c')]['id']){delete _0x146189[_0x4520('0x5c')]['id'];}return db[_0x4520('0x3a')][_0x4520('0x5d')]({'where':{'id':_0x146189[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x2674de,null))['then'](function(_0x51c857){if(_0x51c857){_0x146189[_0x4520('0x5c')][_0x4520('0x67')]=_0x51c857['id'];return db[_0x4520('0x69')][_0x4520('0x62')](_0x146189['body']);}})[_0x4520('0x1a')](respondWithResult(_0x2674de,null))[_0x4520('0x24')](handleError(_0x2674de,null));};exports[_0x4520('0x6a')]=function(_0x2cfdb6,_0x2af499,_0x248cb9){var _0x1a039d={'raw':![],'where':{}};var _0x184d58={};var _0x38019d={'count':0x0,'rows':[]};return db[_0x4520('0x3a')][_0x4520('0x64')]({'where':{'id':_0x2cfdb6[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x2af499,null))['then'](function(_0x5f9b6e){if(_0x5f9b6e){_0x184d58[_0x4520('0x41')]=_[_0x4520('0x53')](db[_0x4520('0x69')]['rawAttributes']);_0x184d58[_0x4520('0x3e')]=_[_0x4520('0x53')](_0x2cfdb6['query']);_0x184d58[_0x4520('0x3f')]=_[_0x4520('0x40')](_0x184d58['model'],_0x184d58['query']);_0x1a039d[_0x4520('0x42')]=_[_0x4520('0x40')](_0x184d58[_0x4520('0x41')],qs[_0x4520('0x43')](_0x2cfdb6[_0x4520('0x3e')][_0x4520('0x43')]));_0x1a039d['attributes']=_0x1a039d[_0x4520('0x42')]['length']?_0x1a039d[_0x4520('0x42')]:_0x184d58['model'];if(!_0x2cfdb6[_0x4520('0x3e')][_0x4520('0x45')](_0x4520('0x66'))){_0x1a039d['limit']=qs[_0x4520('0x2a')](_0x2cfdb6[_0x4520('0x3e')][_0x4520('0x2a')]);_0x1a039d[_0x4520('0x28')]=qs[_0x4520('0x28')](_0x2cfdb6[_0x4520('0x3e')]['offset']);}_0x1a039d[_0x4520('0x46')]=qs[_0x4520('0x47')](_0x2cfdb6[_0x4520('0x3e')][_0x4520('0x47')]);_0x1a039d[_0x4520('0x48')]=qs[_0x4520('0x3f')](_['pick'](_0x2cfdb6['query'],_0x184d58[_0x4520('0x3f')]));_0x1a039d['where'][_0x4520('0x67')]=_0x5f9b6e['id'];if(_0x2cfdb6['query'][_0x4520('0x4a')]){_0x1a039d[_0x4520('0x48')]=_[_0x4520('0x4b')](_0x1a039d['where'],{'$or':_[_0x4520('0x39')](_0x1a039d[_0x4520('0x42')],function(_0x4e5552){var _0x4874c7={};_0x4874c7[_0x4e5552]={'$like':'%'+_0x2cfdb6['query'][_0x4520('0x4a')]+'%'};return _0x4874c7;})});}_0x1a039d=_[_0x4520('0x4b')]({},_0x1a039d,_0x2cfdb6[_0x4520('0x4d')]);return db[_0x4520('0x69')][_0x4520('0x2b')]({'where':_0x1a039d[_0x4520('0x48')]})[_0x4520('0x1a')](function(_0x3a307d){_0x38019d['count']=_0x3a307d;if(_0x2cfdb6['query'][_0x4520('0x54')]){_0x1a039d[_0x4520('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4520('0x4f')](_0x1a039d);})[_0x4520('0x1a')](function(_0x28e0dc){_0x38019d['rows']=_0x28e0dc;return _0x38019d;});}})['then'](respondWithFilteredResult(_0x2af499,_0x1a039d))[_0x4520('0x24')](handleError(_0x2af499,null));};exports[_0x4520('0x6b')]=function(_0x328534,_0x582774,_0x37b237){return db[_0x4520('0x3a')]['find']({'where':{'id':_0x328534[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x582774,null))['then'](function(_0x56a098){if(_0x56a098){return _0x56a098['removeAnswers'](_0x328534[_0x4520('0x3e')][_0x4520('0x6c')]);}})['then'](respondWithStatusCode(_0x582774,null))[_0x4520('0x24')](handleError(_0x582774,null));};exports['notify']=function(_0x215c02,_0x2b7d43,_0x174908){var _0x59107a={'channel':_0x4520('0x6d')};var _0xde29df=[];var _0x150022=[];var _0x2b0066={};return db['SmsAccount'][_0x4520('0x5d')]({'where':{'id':_0x215c02['params']['id']},'include':[{'model':db[_0x4520('0x6e')],'as':_0x4520('0x6f')}]})[_0x4520('0x1a')](handleEntityNotFound(_0x2b7d43,null))[_0x4520('0x1a')](function(_0x3fd878){_0x59107a['account']=_0x3fd878;_0x59107a[_0x4520('0x70')]=_[_0x4520('0x71')](_0x3fd878[_0x4520('0x6f')],[_0x4520('0x72')],[_0x4520('0x73')]);if(_0x59107a[_0x4520('0x74')][_0x4520('0x6f')]){delete _0x59107a[_0x4520('0x74')][_0x4520('0x6f')];}return db['CmContact']['describe']();})['then'](function(_0x1e0b85){if(!_0x1e0b85){throw new db[(_0x4520('0x75'))][(_0x4520('0x76'))](_0x4520('0x77'));}_0xde29df=_['difference'](_[_0x4520('0x53')](_0x1e0b85),['createdAt',_0x4520('0x78')]);_0x150022=_[_0x4520('0x79')](_[_0x4520('0x53')](_0x1e0b85),['createdAt',_0x4520('0x78'),_0x4520('0x7a'),_0x4520('0x7b')]);_0x59107a[_0x4520('0x5c')]={'mapKey':'mobile'};if(_0x59107a[_0x4520('0x74')][_0x4520('0x3c')]){switch(_0x59107a['account']['type']){case _0x4520('0x7c'):_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x7e')];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x7f')];_0x59107a['body'][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x81')];break;case'skebby':_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')]='+'+_0x215c02[_0x4520('0x5c')]['sender'];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x82')];break;case _0x4520('0x83'):_0x59107a[_0x4520('0x5c')]['from']=_0x215c02[_0x4520('0x5c')][_0x4520('0x7d')];_0x59107a[_0x4520('0x5c')]['body']=_0x215c02[_0x4520('0x5c')][_0x4520('0x22')];break;case _0x4520('0x84'):_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')]['from'];_0x59107a['body']['body']=_0x215c02[_0x4520('0x5c')][_0x4520('0x5c')];_0x59107a['body'][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x85')];break;case _0x4520('0x86'):_0x59107a[_0x4520('0x5c')]['from']=_0x215c02['body'][_0x4520('0x7e')];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02[_0x4520('0x5c')]['Text'];_0x59107a['body'][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x87')];break;case _0x4520('0x88'):_0x59107a[_0x4520('0x5c')]['from']='+'+_0x215c02[_0x4520('0x5c')][_0x4520('0x89')][0x0][_0x4520('0x7d')];_0x59107a['body']['body']=_0x215c02[_0x4520('0x5c')]['results'][0x0]['text'];_0x59107a[_0x4520('0x5c')][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')]['results'][0x0]['messageId'];break;case _0x4520('0x8a'):_0x59107a['body'][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')]['originatingAddress'];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x8b')][_0x4520('0x22')];break;case'clickatell':_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x8c')];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02['body']['text'];_0x59107a[_0x4520('0x5c')][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')]['replyMessageId'];break;case _0x4520('0x8d'):_0x59107a[_0x4520('0x5c')][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')][0x0][_0x4520('0x22')]['id'];_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')][0x0][_0x4520('0x22')][_0x4520('0x7d')];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02['body'][0x0][_0x4520('0x22')][_0x4520('0x82')];break;case'intelepeer':_0x59107a['body'][_0x4520('0x7d')]=_0x215c02[_0x4520('0x5c')]['from'];_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')]=_0x215c02[_0x4520('0x5c')][_0x4520('0x22')];_0x59107a[_0x4520('0x5c')][_0x4520('0x80')]=_0x215c02[_0x4520('0x5c')]['refid'];break;}}if(_0x59107a[_0x4520('0x5c')]['id']){delete _0x59107a[_0x4520('0x5c')]['id'];}if(_[_0x4520('0x8e')](_0x59107a['body']['from'])){throw new db[(_0x4520('0x75'))][(_0x4520('0x76'))]('from\x20is\x20mandatory');}if(_[_0x4520('0x8e')](_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')])||_0x59107a['body'][_0x4520('0x5c')]===''){throw new db[(_0x4520('0x75'))][(_0x4520('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4520('0x8e')](_0x59107a['body'][_0x4520('0x8f')])){throw new db[(_0x4520('0x75'))]['ValidationError'](_0x4520('0x90')+_0x150022);}if(!_['includes'](_0x150022,_0x59107a['body']['mapKey'])){throw new db[(_0x4520('0x75'))][(_0x4520('0x76'))](_0x4520('0x91')+_0x150022);}_0x2b0066[_0x59107a['body'][_0x4520('0x8f')]]=_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')];return db[_0x4520('0x92')]['find']({'where':{'id':_0x59107a['account']['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2b0066,'limit':0x1,'order':[[_0x4520('0x78'),_0x4520('0x93')]]}]});})['then'](handleEntityNotFound(_0x2b7d43,null))[_0x4520('0x1a')](function(_0x4a3314){if(_0x4a3314){_0x59107a['list']=_['omit'](_0x4a3314,[_0x4520('0x94')]);if(_0x4a3314[_0x4520('0x94')][_0x4520('0x44')]){return _0x4a3314[_0x4520('0x94')][0x0];}var _0x34d48f=_[_0x4520('0x14')](_0x59107a['body'],{'firstName':_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')],'ListId':_0x4a3314['id']});_0x34d48f[_0x59107a['body'][_0x4520('0x8f')]]=_0x59107a['body']['from'];return db[_0x4520('0x95')][_0x4520('0x62')](_0x34d48f,{'fields':_0xde29df,'raw':!![]});}})[_0x4520('0x1a')](handleEntityNotFound(_0x2b7d43,null))['then'](function(_0x402005){if(_0x402005){_0x59107a[_0x4520('0x96')]=_0x402005;var _0x4e75b3={'ContactId':_0x402005['id'],'phone':_0x59107a[_0x4520('0x5c')][_0x4520('0x7d')],'SmsAccountId':_0x215c02[_0x4520('0x52')]['id']};var _0x320bd8={'ContactId':_0x402005['id'],'SmsAccountId':_0x215c02['params']['id'],'closed':![]};return db[_0x4520('0x97')][_0x4520('0x5d')]({'where':_0x320bd8})[_0x4520('0x1a')](function(_0x528c3e){if(_0x528c3e){return[_0x528c3e,![]];}return db[_0x4520('0x97')]['create'](_0x4e75b3)[_0x4520('0x1a')](function(_0x3946c6){return[_0x3946c6,!![]];});});}})[_0x4520('0x98')](function(_0x5afca1,_0x764fec){_0x59107a['interaction']=_0x5afca1[_0x4520('0x33')]({'plain':!![]});_0x59107a[_0x4520('0x99')][_0x4520('0x9a')]=![];if(_0x764fec){if(_0x59107a['account']['autoclose']){_0x59107a['applications'][_0x4520('0x9b')]({'id':0x0,'priority':_0x59107a[_0x4520('0x70')][_0x4520('0x44')]+0x1,'app':'close','appdata':_0x4520('0x9c'),'interval':_0x4520('0x9d')});}_0x59107a[_0x4520('0x99')][_0x4520('0x9a')]=!![];}return db['SmsMessage'][_0x4520('0x62')]({'phone':_0x59107a[_0x4520('0x5c')]['from'],'messageId':_0x59107a['body'][_0x4520('0x80')],'body':_0x59107a[_0x4520('0x5c')][_0x4520('0x5c')],'SmsAccountId':_0x215c02[_0x4520('0x52')]['id'],'SmsInteractionId':_0x5afca1['id'],'direction':'in','ContactId':_0x5afca1[_0x4520('0x9e')],'AttachmentId':_0x59107a['body'][_0x4520('0x9f')]});})[_0x4520('0x1a')](function(_0x129856){_0x59107a[_0x4520('0x22')]=_0x129856;if(_0x59107a['interaction'][_0x4520('0xa0')]){return db[_0x4520('0xa1')][_0x4520('0x5d')]({'attributes':['id',_0x4520('0x36')],'where':{'id':_0x59107a[_0x4520('0x99')][_0x4520('0xa0')]}})[_0x4520('0x1a')](function(_0x131b12){if(_0x131b12){_0x59107a[_0x4520('0x70')][_0x4520('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x131b12['name']+','+(_0x59107a[_0x4520('0x74')][_0x4520('0xa3')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4520('0xa4'),_0x4520('0xa5'),_0x59107a);});}return respondWithRpcPromise(_0x4520('0xa4'),_0x4520('0xa5'),_0x59107a);})[_0x4520('0x1a')](function(_0x153f0c){if(_0x153f0c){var _0x5eb47a=0xc8;var _0x53fcb8=_0x4520('0xa6');logger['info'](_0x4520('0x1e'),_0x53fcb8,_0x5eb47a,'entity\x20found');logger['debug'](_0x4520('0xa7'),_0x53fcb8,_0x5eb47a,_0x4520('0xa8'),JSON['stringify'](_0x153f0c));if(_0x59107a[_0x4520('0x74')][_0x4520('0x3c')]==='twilio'){return _0x2b7d43[_0x4520('0x26')](_0x5eb47a)[_0x4520('0x2c')](_0x4520('0xa9'),_0x4520('0xaa'))[_0x4520('0x37')](_0x4520('0xab'));}else{return _0x2b7d43[_0x4520('0x26')](_0x5eb47a)[_0x4520('0x2d')](_0x153f0c);}}})[_0x4520('0x24')](handleError(_0x2b7d43,null));};exports[_0x4520('0xac')]=function(_0x1f6fe5,_0x432e32,_0x21cd00){return db[_0x4520('0x3a')][_0x4520('0x64')]({'where':{'id':_0x1f6fe5[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x432e32,null))[_0x4520('0x1a')](function(_0x190266){if(_0x190266){return db['sequelize'][_0x4520('0xad')](function(_0x2013dd){return db[_0x4520('0x6e')][_0x4520('0x32')]({'where':{'SmsAccountId':_0x1f6fe5[_0x4520('0x52')]['id']},'transaction':_0x2013dd})[_0x4520('0x1a')](function(_0x1b7906){var _0xad408=_[_0x4520('0x39')](_0x1f6fe5[_0x4520('0x5c')],function(_0x507af7){_0x507af7[_0x4520('0x67')]=_0x1f6fe5[_0x4520('0x52')]['id'];return _0x507af7;});return db['SmsApplication'][_0x4520('0xae')](_0xad408,{'transaction':_0x2013dd});});})[_0x4520('0x1a')](function(){return db['SmsApplication'][_0x4520('0xaf')]({'where':{'SmsAccountId':_0x1f6fe5[_0x4520('0x52')]['id']},'order':'priority'});});}})[_0x4520('0x1a')](respondWithResult(_0x432e32,null))['catch'](handleError(_0x432e32,null));};exports[_0x4520('0xb0')]=function(_0xda43f9,_0x2976c5,_0x1fbefa){var _0x267244={};var _0x1cd62b={};var _0x31d48b;var _0x1a869d;return db['SmsAccount'][_0x4520('0x64')]({'where':{'id':_0xda43f9[_0x4520('0x52')]['id']}})['then'](handleEntityNotFound(_0x2976c5,null))[_0x4520('0x1a')](function(_0x395a27){if(_0x395a27){_0x31d48b=_0x395a27;_0x1cd62b[_0x4520('0x41')]=_['keys'](db[_0x4520('0x6e')][_0x4520('0x3b')]);_0x1cd62b[_0x4520('0x3e')]=_[_0x4520('0x53')](_0xda43f9[_0x4520('0x3e')]);_0x1cd62b[_0x4520('0x3f')]=_[_0x4520('0x40')](_0x1cd62b['model'],_0x1cd62b[_0x4520('0x3e')]);_0x267244[_0x4520('0x42')]=_[_0x4520('0x40')](_0x1cd62b[_0x4520('0x41')],qs[_0x4520('0x43')](_0xda43f9[_0x4520('0x3e')][_0x4520('0x43')]));_0x267244['attributes']=_0x267244[_0x4520('0x42')]['length']?_0x267244[_0x4520('0x42')]:_0x1cd62b[_0x4520('0x41')];_0x267244['order']=qs['sort'](_0xda43f9[_0x4520('0x3e')][_0x4520('0x47')]);_0x267244[_0x4520('0x48')]=qs[_0x4520('0x3f')](_[_0x4520('0x49')](_0xda43f9['query'],_0x1cd62b[_0x4520('0x3f')]));if(_0xda43f9[_0x4520('0x3e')][_0x4520('0x4a')]){_0x267244[_0x4520('0x48')]=_['merge'](_0x267244[_0x4520('0x48')],{'$or':_[_0x4520('0x39')](_0x267244['attributes'],function(_0x431c5d){var _0x3de304={};_0x3de304[_0x431c5d]={'$like':'%'+_0xda43f9[_0x4520('0x3e')][_0x4520('0x4a')]+'%'};return _0x3de304;})});}_0x267244=_[_0x4520('0x4b')]({},_0x267244,_0xda43f9['options']);return _0x31d48b[_0x4520('0xb0')](_0x267244);}})[_0x4520('0x1a')](function(_0x1f58c1){if(_0x1f58c1){_0x1a869d=_0x1f58c1[_0x4520('0x44')];if(!_0xda43f9['query']['hasOwnProperty']('nolimit')){_0x267244[_0x4520('0x2a')]=qs['limit'](_0xda43f9[_0x4520('0x3e')][_0x4520('0x2a')]);_0x267244['offset']=qs[_0x4520('0x28')](_0xda43f9[_0x4520('0x3e')][_0x4520('0x28')]);}return _0x31d48b[_0x4520('0xb0')](_0x267244);}})[_0x4520('0x1a')](function(_0xe5160e){if(_0xe5160e){return _0xe5160e?{'count':_0x1a869d,'rows':_0xe5160e}:null;}})['then'](respondWithResult(_0x2976c5,null))[_0x4520('0x24')](handleError(_0x2976c5,null));};exports[_0x4520('0xb1')]=function(_0x46c9c0,_0x21edd3,_0x55a1e3){var _0x217531={'raw':![],'where':{}};var _0x516609={};var _0x25cd39={'count':0x0,'rows':[]};return db[_0x4520('0x3a')][_0x4520('0x64')]({'where':{'id':_0x46c9c0[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x21edd3,null))['then'](function(_0x302f4f){if(_0x302f4f){_0x516609['model']=_[_0x4520('0x53')](db[_0x4520('0x97')][_0x4520('0x3b')]);_0x516609[_0x4520('0x3e')]=_[_0x4520('0x53')](_0x46c9c0['query']);_0x516609[_0x4520('0x3f')]=_[_0x4520('0x40')](_0x516609[_0x4520('0x41')],_0x516609[_0x4520('0x3e')]);_0x217531[_0x4520('0x42')]=_[_0x4520('0x40')](_0x516609[_0x4520('0x41')],qs[_0x4520('0x43')](_0x46c9c0[_0x4520('0x3e')][_0x4520('0x43')]));_0x217531['attributes']=_0x217531[_0x4520('0x42')][_0x4520('0x44')]?_0x217531['attributes']:_0x516609[_0x4520('0x41')];if(!_0x46c9c0['query']['hasOwnProperty'](_0x4520('0x66'))){_0x217531[_0x4520('0x2a')]=qs['limit'](_0x46c9c0[_0x4520('0x3e')][_0x4520('0x2a')]);_0x217531['offset']=qs['offset'](_0x46c9c0[_0x4520('0x3e')][_0x4520('0x28')]);}_0x217531[_0x4520('0x46')]=qs[_0x4520('0x47')](_0x46c9c0[_0x4520('0x3e')][_0x4520('0x47')]);_0x217531[_0x4520('0x48')]=qs['filters'](_[_0x4520('0x49')](_0x46c9c0['query'],_0x516609[_0x4520('0x3f')]));_0x217531[_0x4520('0x48')]['SmsAccountId']=_0x302f4f['id'];if(_0x46c9c0[_0x4520('0x3e')][_0x4520('0x4a')]){_0x217531[_0x4520('0x48')]=_[_0x4520('0x4b')](_0x217531[_0x4520('0x48')],{'$or':_[_0x4520('0x39')](_0x217531[_0x4520('0x42')],function(_0x258cc7){var _0x135cef={};_0x135cef[_0x258cc7]={'$like':'%'+_0x46c9c0[_0x4520('0x3e')]['filter']+'%'};return _0x135cef;})});}_0x217531=_[_0x4520('0x4b')]({},_0x217531,_0x46c9c0[_0x4520('0x4d')]);return db[_0x4520('0x97')][_0x4520('0x2b')]({'where':_0x217531[_0x4520('0x48')]})[_0x4520('0x1a')](function(_0x47eec7){_0x25cd39['count']=_0x47eec7;if(_0x46c9c0['query'][_0x4520('0x54')]){_0x217531[_0x4520('0x4e')]=[{'model':db[_0x4520('0x95')],'as':'Contact','required':![]},{'model':db[_0x4520('0xa1')],'as':_0x4520('0xb2'),'attributes':['name',_0x4520('0xb3'),_0x4520('0xb4')],'required':![]},{'model':db[_0x4520('0xb5')],'as':_0x4520('0xb6'),'attributes':['id',_0x4520('0x36'),_0x4520('0xb7')],'where':_0x46c9c0['query'][_0x4520('0xb8')]?{'id':_0x46c9c0[_0x4520('0x3e')]['tag']}:undefined,'required':_0x46c9c0[_0x4520('0x3e')]['tag']?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x217531);})[_0x4520('0x1a')](function(_0x12f291){_0x25cd39[_0x4520('0x50')]=_0x12f291;return _0x25cd39;});}})[_0x4520('0x1a')](respondWithFilteredResult(_0x21edd3,_0x217531))[_0x4520('0x24')](handleError(_0x21edd3,null));};exports[_0x4520('0x37')]=function(_0x3927a0,_0x243fc2,_0x4aad19){var _0x57adf2,_0x2ca270,_0x3c38a1;if(_[_0x4520('0x8e')](_0x3927a0[_0x4520('0x5c')][_0x4520('0x5c')])||_0x3927a0[_0x4520('0x5c')][_0x4520('0x5c')]===''){throw new db[(_0x4520('0x75'))]['ValidationError'](_0x4520('0xb9'));}if(_[_0x4520('0x8e')](_0x3927a0[_0x4520('0x5c')]['to'])){throw new db[(_0x4520('0x75'))]['ValidationError'](_0x4520('0xba'));}_0x57adf2=_0x3927a0[_0x4520('0x5c')]['to'];return db[_0x4520('0x3a')]['find']({'where':{'id':_0x3927a0[_0x4520('0x52')]['id']},'include':[{'model':db[_0x4520('0x92')],'as':'List','include':[{'model':db[_0x4520('0x95')],'as':_0x4520('0x94'),'where':{'mobile':_0x57adf2},'limit':0x1,'order':[['updatedAt',_0x4520('0x93')]]}]}]})[_0x4520('0x1a')](handleEntityNotFound(_0x243fc2,null))[_0x4520('0x1a')](function(_0x33e5ca){if(_0x33e5ca&&_0x33e5ca[_0x4520('0xbb')]){_0x2ca270=_0x33e5ca[_0x4520('0x33')]({'plain':!![]});if(_0x2ca270[_0x4520('0xbb')]&&_0x2ca270[_0x4520('0xbb')][_0x4520('0x94')][_0x4520('0x44')]){return _0x2ca270[_0x4520('0xbb')][_0x4520('0x94')][0x0];}return db[_0x4520('0x95')][_0x4520('0x62')](_[_0x4520('0x14')](_0x3927a0['body'],{'firstName':_0x57adf2,'mobile':_0x57adf2,'phone':_0x57adf2,'ListId':_0x2ca270[_0x4520('0x7b')]}));}})[_0x4520('0x1a')](handleEntityNotFound(_0x243fc2,null))[_0x4520('0x1a')](function(_0x240dec){if(_0x240dec){_0x3c38a1=_0x240dec;return db[_0x4520('0x97')][_0x4520('0x5d')]({'where':{'ContactId':_0x3c38a1['id'],'closed':![],'SmsAccountId':_0x2ca270['id']}})['then'](function(_0x39c996){if(_0x39c996){return[_0x39c996,![]];}return db[_0x4520('0x97')][_0x4520('0x62')]({'UserId':_0x3927a0['user']['id'],'ContactId':_0x3c38a1['id'],'SmsAccountId':_0x2ca270['id'],'phone':_0x57adf2,'firstMsgDirection':_0x4520('0xbc'),'Messages':[_['merge'](_0x3927a0[_0x4520('0x5c')],{'read':![],'body':_0x3927a0[_0x4520('0x5c')][_0x4520('0x5c')],'phone':_0x57adf2,'SmsAccountId':_0x2ca270['id'],'UserId':_0x3927a0[_0x4520('0x55')]['id'],'ContactId':_0x3c38a1['id']})]},{'include':[{'model':db[_0x4520('0xbd')],'as':_0x4520('0xbe')}]})['then'](function(_0x1dd3b8){return[_0x1dd3b8,!![]];});});}})[_0x4520('0x98')](function(_0x1f5392,_0x40e318){if(_0x40e318){return _0x1f5392;}return db[_0x4520('0xbd')][_0x4520('0x62')](_[_0x4520('0x4b')](_0x3927a0[_0x4520('0x5c')],{'read':![],'body':_0x3927a0[_0x4520('0x5c')][_0x4520('0x5c')],'phone':_0x57adf2,'SmsAccountId':_0x2ca270['id'],'SmsInteractionId':_0x1f5392['id'],'UserId':_0x3927a0[_0x4520('0x55')]['id'],'ContactId':_0x3c38a1['id']}))[_0x4520('0x1a')](function(_0x5264d5){_0x1f5392[_0x4520('0xbf')]['Messages']=[];_0x1f5392[_0x4520('0xbf')]['Messages'][_0x4520('0x9b')](_0x5264d5[_0x4520('0xbf')]);return _0x1f5392;});})[_0x4520('0x1a')](respondWithResult(_0x243fc2,null))[_0x4520('0x24')](handleError(_0x243fc2,null));};exports[_0x4520('0x26')]=function(_0x42dbb4,_0x13f27b,_0x2bec21){if(_0x42dbb4['body']['id']){delete _0x42dbb4[_0x4520('0x5c')]['id'];}var _0x4b1c5b,_0x474dc8,_0x29bec5;return db['SmsAccount'][_0x4520('0x5d')]({'where':{'id':_0x42dbb4['params']['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x13f27b,null))[_0x4520('0x1a')](function(_0x3e9e87){if(_0x3e9e87){_0x29bec5=_0x3e9e87;logger[_0x4520('0xc0')](_0x4520('0x1e'),_0x4520('0x26'),_0x4520('0xc1'),_0x3e9e87[_0x4520('0x3c')],util[_0x4520('0xc2')](_0x42dbb4[_0x4520('0x5c')],{'showHidden':![],'depth':null}));switch(_0x3e9e87['type']){case _0x4520('0xc3'):if(_0x42dbb4['body']['skebby_dispatch_id']&&_0x42dbb4[_0x4520('0x5c')][_0x4520('0x26')]){_0x474dc8=_0x42dbb4['body'][_0x4520('0x26')];return db[_0x4520('0xbd')][_0x4520('0x5d')]({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')][_0x4520('0xc4')]}});}break;case _0x4520('0x83'):if(_0x42dbb4[_0x4520('0x5c')][_0x4520('0xc5')]&&_0x42dbb4['body'][_0x4520('0xc6')]){_0x474dc8=_0x42dbb4[_0x4520('0x5c')][_0x4520('0xc6')];return db[_0x4520('0xbd')]['find']({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')]['requestid']}});}break;case _0x4520('0x84'):if(_0x42dbb4['body'][_0x4520('0x85')]&&_0x42dbb4[_0x4520('0x5c')]['status_code']){_0x474dc8=_0x42dbb4[_0x4520('0x5c')]['status_code'];return db[_0x4520('0xbd')][_0x4520('0x5d')]({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')][_0x4520('0x85')]}});}break;case'infobip':var _0x43d36a=_0x42dbb4[_0x4520('0x5c')][_0x4520('0x89')][0x0];if(_0x43d36a[_0x4520('0x80')]&&_0x43d36a[_0x4520('0x26')][_0x4520('0xc7')]==='DELIVERED'){_0x474dc8=_0x43d36a[_0x4520('0x26')][_0x4520('0xc7')];return db[_0x4520('0xbd')]['find']({'where':{'messageId':_0x43d36a['messageId']}});}break;case _0x4520('0xc8'):if(_0x42dbb4[_0x4520('0x5c')]['messageId']&&_0x42dbb4[_0x4520('0x5c')][_0x4520('0x26')]){_0x474dc8=_0x42dbb4[_0x4520('0x5c')]['status'];return db[_0x4520('0xbd')][_0x4520('0x5d')]({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')][_0x4520('0x80')]}});}break;case'bandwidth':if(_0x42dbb4[_0x4520('0x5c')][0x0][_0x4520('0x22')]['id']){_0x474dc8=_0x42dbb4[_0x4520('0x5c')][0x0][_0x4520('0x3c')];return db['SmsMessage'][_0x4520('0x5d')]({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')][0x0][_0x4520('0x22')]['id']}});}break;case _0x4520('0xc9'):if(_0x42dbb4[_0x4520('0x5c')][_0x4520('0xca')]&&_0x42dbb4['body'][_0x4520('0x26')]){_0x474dc8=_0x42dbb4[_0x4520('0x5c')]['status'];return db[_0x4520('0xbd')][_0x4520('0x5d')]({'where':{'messageId':_0x42dbb4[_0x4520('0x5c')][_0x4520('0xca')]}});}break;}}})['then'](handleEntityNotFound(_0x13f27b,null))[_0x4520('0x1a')](function(_0x2c6fd8){if(_0x2c6fd8){_0x4b1c5b=_0x2c6fd8;switch(_0x29bec5[_0x4520('0x3c')]){case'skebby':if(_0x474dc8===_0x4520('0xcb')){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger[_0x4520('0x21')](_0x4520('0x1e'),_0x4520('0x26'),_0x4520('0xc3'),util['inspect'](_0x42dbb4[_0x4520('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4520('0x83'):if(_0x474dc8==='1'){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0x4520('0xc2')](_0x42dbb4[_0x4520('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4520('0x84'):if(!_0x42dbb4['body'][_0x4520('0xcc')]&&_0x474dc8>=0xc8&&_0x474dc8<=0xce){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger[_0x4520('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4520('0x26'),_0x4520('0x84'),util[_0x4520('0xc2')](_0x42dbb4['body'],{'showHidden':![],'depth':null}));}break;case _0x4520('0x88'):var _0x45ac9d=_0x42dbb4[_0x4520('0x5c')][_0x4520('0x89')][0x0];if(_0x45ac9d[_0x4520('0x26')][_0x4520('0xc7')]===_0x4520('0xcb')){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger[_0x4520('0x21')](_0x4520('0x1e'),_0x4520('0x26'),'infobip',util[_0x4520('0xc2')](_0x42dbb4[_0x4520('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4520('0xc8'):if(_0x474dc8=='DELIVERED_TO_GATEWAY'||_0x474dc8=='RECEIVED_BY_RECIPIENT'){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4520('0x26'),_0x4520('0xc8'),util[_0x4520('0xc2')](_0x42dbb4[_0x4520('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4520('0x8d'):if(_0x474dc8==_0x4520('0xcd')){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger[_0x4520('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4520('0x26'),_0x4520('0x8d'),util[_0x4520('0xc2')](_0x42dbb4['body'],{'showHidden':![],'depth':null}));}break;case _0x4520('0xc9'):if(_0x474dc8===_0x4520('0xce')||_0x474dc8==='ACCEPTD'){return _0x4b1c5b[_0x4520('0x31')]({'read':!![]});}else{logger['error'](_0x4520('0x1e'),_0x4520('0x26'),_0x4520('0xc9'),util['inspect'](_0x42dbb4['body'],{'showHidden':![],'depth':null}));}break;}return _0x4b1c5b;}})[_0x4520('0x1a')](respondWithResult(_0x13f27b,null))[_0x4520('0x24')](handleError(_0x13f27b,null));};exports[_0x4520('0xcf')]=function(_0x303ca4,_0x2369c2,_0x46932f){var _0x17c422,_0x992d73,_0x3ed027;return db['SmsAccount'][_0x4520('0x5d')]({'where':{'id':_0x303ca4['params']['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x2369c2,null))[_0x4520('0x1a')](function(_0x303907){if(_0x303907){_0x3ed027=_0x303907;logger[_0x4520('0xc0')](_0x4520('0x1e'),_0x4520('0x26'),_0x4520('0xc1'),_0x303907[_0x4520('0x3c')],util['inspect'](_0x303ca4[_0x4520('0x3e')],{'showHidden':![],'depth':null}));switch(_0x303907[_0x4520('0x3c')]){case _0x4520('0x8a'):if(_0x303ca4[_0x4520('0x3e')][_0x4520('0xd0')]&&_0x303ca4['query'][_0x4520('0xd1')]){_0x992d73=_0x303ca4[_0x4520('0x3e')][_0x4520('0xd1')];return db[_0x4520('0xbd')][_0x4520('0x5d')]({'where':{'messageId':_0x303ca4['query'][_0x4520('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x2369c2,null))[_0x4520('0x1a')](function(_0x5671e5){if(_0x5671e5){_0x17c422=_0x5671e5;switch(_0x3ed027['type']){case _0x4520('0x8a'):if(_0x992d73==='2'||_0x992d73==='6'){return _0x17c422[_0x4520('0x31')]({'read':!![]});}else{logger[_0x4520('0x21')](_0x4520('0x1e'),_0x4520('0x26'),_0x4520('0x8a'),util[_0x4520('0xc2')](_0x303ca4[_0x4520('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x17c422;}})[_0x4520('0x1a')](respondWithResult(_0x2369c2,null))[_0x4520('0x24')](handleError(_0x2369c2,null));};exports[_0x4520('0xd2')]=function(_0xd108a9,_0xa923db,_0x23f754){return db['SmsAccount']['find']({'where':{'id':_0xd108a9[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0xa923db,null))[_0x4520('0x1a')](function(_0x35cefb){if(_0x35cefb){return _0x35cefb[_0x4520('0xd2')](_0xd108a9['body'][_0x4520('0x6c')],_['omit'](_0xd108a9[_0x4520('0x5c')],[_0x4520('0x6c'),'id'])||{})[_0x4520('0x98')](function(_0x546ae2){for(var _0x37752b=0x0;_0x37752b<_0xd108a9[_0x4520('0x5c')][_0x4520('0x6c')][_0x4520('0x44')];_0x37752b+=0x1){socket['emit'](_0x4520('0xd3'),{'UserId':Number(_0xd108a9[_0x4520('0x5c')]['ids'][_0x37752b]),'SmsAccountId':Number(_0xd108a9['params']['id'])});}return _0x546ae2;});}})[_0x4520('0x1a')](respondWithResult(_0xa923db,null))[_0x4520('0x24')](handleError(_0xa923db,null));};exports[_0x4520('0xd4')]=function(_0x4a0365,_0x3b1e5d,_0x9f3fbb){return db[_0x4520('0x3a')]['find']({'where':{'id':_0x4a0365[_0x4520('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b1e5d,null))['then'](function(_0x3a44e3){if(_0x3a44e3){return _0x3a44e3['removeAgents'](_0x4a0365[_0x4520('0x3e')][_0x4520('0x6c')])[_0x4520('0x1a')](function(){if(_[_0x4520('0xd5')](_0x4a0365[_0x4520('0x3e')][_0x4520('0x6c')])){for(var _0x2051de=0x0;_0x2051de<_0x4a0365[_0x4520('0x3e')]['ids'][_0x4520('0x44')];_0x2051de+=0x1){socket[_0x4520('0xd6')](_0x4520('0xd7'),{'UserId':Number(_0x4a0365[_0x4520('0x3e')][_0x4520('0x6c')][_0x2051de]),'SmsAccountId':Number(_0x4a0365[_0x4520('0x52')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x4a0365[_0x4520('0x3e')][_0x4520('0x6c')]),'SmsAccountId':Number(_0x4a0365[_0x4520('0x52')]['id'])});}});}})[_0x4520('0x1a')](respondWithStatusCode(_0x3b1e5d,null))[_0x4520('0x24')](handleError(_0x3b1e5d,null));};exports[_0x4520('0xd8')]=function(_0x5c552a,_0x45c878,_0x1087ee){var _0x1bab93={};var _0x491a70={};var _0x3f41d5;var _0xe90d2;return db[_0x4520('0x3a')][_0x4520('0x64')]({'where':{'id':_0x5c552a[_0x4520('0x52')]['id']}})[_0x4520('0x1a')](handleEntityNotFound(_0x45c878,null))['then'](function(_0x20c556){if(_0x20c556){_0x3f41d5=_0x20c556;_0x491a70['model']=_[_0x4520('0x53')](db[_0x4520('0xa1')][_0x4520('0x3b')]);_0x491a70[_0x4520('0x3e')]=_[_0x4520('0x53')](_0x5c552a[_0x4520('0x3e')]);_0x491a70[_0x4520('0x3f')]=_['intersection'](_0x491a70[_0x4520('0x41')],_0x491a70['query']);_0x1bab93[_0x4520('0x42')]=_[_0x4520('0x40')](_0x491a70[_0x4520('0x41')],qs[_0x4520('0x43')](_0x5c552a[_0x4520('0x3e')][_0x4520('0x43')]));_0x1bab93[_0x4520('0x42')]=_0x1bab93['attributes'][_0x4520('0x44')]?_0x1bab93[_0x4520('0x42')]:_0x491a70[_0x4520('0x41')];_0x1bab93[_0x4520('0x46')]=qs['sort'](_0x5c552a['query'][_0x4520('0x47')]);_0x1bab93[_0x4520('0x48')]=qs[_0x4520('0x3f')](_[_0x4520('0x49')](_0x5c552a[_0x4520('0x3e')],_0x491a70[_0x4520('0x3f')]));if(_0x5c552a[_0x4520('0x3e')][_0x4520('0x4a')]){_0x1bab93[_0x4520('0x48')]=_['merge'](_0x1bab93[_0x4520('0x48')],{'$or':_[_0x4520('0x39')](_0x1bab93['attributes'],function(_0x4b8000){var _0x15bc5b={};_0x15bc5b[_0x4b8000]={'$like':'%'+_0x5c552a[_0x4520('0x3e')]['filter']+'%'};return _0x15bc5b;})});}_0x1bab93=_[_0x4520('0x4b')]({},_0x1bab93,_0x5c552a[_0x4520('0x4d')]);return _0x3f41d5['getAgents'](_0x1bab93);}})[_0x4520('0x1a')](function(_0x4303c2){if(_0x4303c2){_0xe90d2=_0x4303c2[_0x4520('0x44')];if(!_0x5c552a['query'][_0x4520('0x45')](_0x4520('0x66'))){_0x1bab93[_0x4520('0x2a')]=qs[_0x4520('0x2a')](_0x5c552a[_0x4520('0x3e')][_0x4520('0x2a')]);_0x1bab93['offset']=qs[_0x4520('0x28')](_0x5c552a['query'][_0x4520('0x28')]);}return _0x3f41d5['getAgents'](_0x1bab93);}})[_0x4520('0x1a')](function(_0x38d269){if(_0x38d269){return _0x38d269?{'count':_0xe90d2,'rows':_0x38d269}:null;}})['then'](respondWithResult(_0x45c878,null))[_0x4520('0x24')](handleError(_0x45c878,null));}; \ No newline at end of file +var _0x7e2e=['request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','SmsAccount','includeAll','findAll','rows','show','params','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','getDispositions','findOne','Disposition','rawAttributes','sort','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sms','Applications','priority','asc','account','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','Body','messageId','MessageSid','from','text','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','ValidationError','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','applications','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','text/xml','\x0a','sequelize','transaction','SmsApplication','bulkCreate','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','connectel','statusInt','status_code','infobip','groupName','DELIVERED','clickatell','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','statusGet','message-id','state','csc','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x260878,_0xa9be1a){var _0x121b93=function(_0x48b755){while(--_0x48b755){_0x260878['push'](_0x260878['shift']());}};_0x121b93(++_0xa9be1a);}(_0x7e2e,0x198));var _0xe7e2=function(_0x2a0487,_0x36ff00){_0x2a0487=_0x2a0487-0x0;var _0x4587fc=_0x7e2e[_0x2a0487];return _0x4587fc;};'use strict';var emlformat=require(_0xe7e2('0x0'));var rimraf=require(_0xe7e2('0x1'));var zipdir=require(_0xe7e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7e2('0x3'));var moment=require('moment');var BPromise=require(_0xe7e2('0x4'));var Mustache=require(_0xe7e2('0x5'));var util=require(_0xe7e2('0x6'));var path=require(_0xe7e2('0x7'));var sox=require(_0xe7e2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7e2('0x9'));var _=require('lodash');var squel=require(_0xe7e2('0xa'));var crypto=require(_0xe7e2('0xb'));var jsforce=require(_0xe7e2('0xc'));var deskjs=require(_0xe7e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe7e2('0xe'));var Papa=require(_0xe7e2('0xf'));var Redis=require(_0xe7e2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe7e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7e2('0x12'));var logger=require(_0xe7e2('0x13'))(_0xe7e2('0x14'));var utils=require(_0xe7e2('0x15'));var config=require(_0xe7e2('0x16'));var licenseUtil=require(_0xe7e2('0x17'));var db=require(_0xe7e2('0x18'))['db'];config['redis']=_[_0xe7e2('0x19')](config[_0xe7e2('0x1a')],{'host':_0xe7e2('0x1b'),'port':0x18eb});var socket=require(_0xe7e2('0x1c'))(new Redis(config[_0xe7e2('0x1a')]));require(_0xe7e2('0x1d'))[_0xe7e2('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe7e2('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x40a80e,_0x23b74d,_0x7eb147,_0x27e85d){return new BPromise(function(_0x151cd5,_0x376c80){var _0x261875=_0x27e85d||client;return _0x261875['request'](_0x40a80e,_0x7eb147)['then'](function(_0x47bdbd){logger[_0xe7e2('0x20')](_0xe7e2('0x21'),_0x23b74d,'request\x20sent');logger[_0xe7e2('0x22')](_0xe7e2('0x23'),_0x23b74d,_0xe7e2('0x24'),JSON['stringify'](_0x47bdbd));if(_0x47bdbd[_0xe7e2('0x25')]){if(_0x47bdbd['error'][_0xe7e2('0x26')]===0x1f4){logger[_0xe7e2('0x25')]('SmsAccount,\x20%s,\x20%s',_0x23b74d,_0x47bdbd['error']['message']);return _0x376c80(_0x47bdbd[_0xe7e2('0x25')][_0xe7e2('0x27')]);}logger[_0xe7e2('0x25')](_0xe7e2('0x21'),_0x23b74d,_0x47bdbd[_0xe7e2('0x25')][_0xe7e2('0x27')]);return _0x151cd5(_0x47bdbd[_0xe7e2('0x25')][_0xe7e2('0x27')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x23b74d,_0xe7e2('0x24'));_0x151cd5(_0x47bdbd[_0xe7e2('0x28')]['message']);}})[_0xe7e2('0x29')](function(_0x2c72bd){logger[_0xe7e2('0x25')](_0xe7e2('0x21'),_0x23b74d,_0x2c72bd);_0x376c80(_0x2c72bd);});});}function respondWithStatusCode(_0x5b6a8b,_0x5146be){_0x5146be=_0x5146be||0xcc;return function(_0x970c50){if(_0x970c50){return _0x5b6a8b[_0xe7e2('0x2a')](_0x5146be);}return _0x5b6a8b[_0xe7e2('0x2b')](_0x5146be)[_0xe7e2('0x2c')]();};}function respondWithResult(_0x2cd4aa,_0x1eb635){_0x1eb635=_0x1eb635||0xc8;return function(_0x5d160c){if(_0x5d160c){return _0x2cd4aa[_0xe7e2('0x2b')](_0x1eb635)['json'](_0x5d160c);}};}function respondWithFilteredResult(_0x237e7c,_0x584ff4){return function(_0x2e17c0){if(_0x2e17c0){var _0x4beeab=typeof _0x584ff4[_0xe7e2('0x2d')]===_0xe7e2('0x2e')&&typeof _0x584ff4[_0xe7e2('0x2f')]===_0xe7e2('0x2e');var _0x57f6d3=_0x2e17c0[_0xe7e2('0x30')];var _0x170d5f=_0x4beeab?0x0:_0x584ff4['offset'];var _0x68a658=_0x4beeab?_0x2e17c0[_0xe7e2('0x30')]:_0x584ff4['offset']+_0x584ff4[_0xe7e2('0x2f')];var _0x16e621;if(_0x68a658>=_0x57f6d3){_0x68a658=_0x57f6d3;_0x16e621=0xc8;}else{_0x16e621=0xce;}_0x237e7c[_0xe7e2('0x2b')](_0x16e621);return _0x237e7c['set'](_0xe7e2('0x31'),_0x170d5f+'-'+_0x68a658+'/'+_0x57f6d3)[_0xe7e2('0x32')](_0x2e17c0);}return null;};}function patchUpdates(_0x40944d){return function(_0x3da93e){try{jsonpatch['apply'](_0x3da93e,_0x40944d,!![]);}catch(_0x566009){return BPromise[_0xe7e2('0x33')](_0x566009);}return _0x3da93e[_0xe7e2('0x34')]();};}function saveUpdates(_0x18ca6e,_0xedaa5c){return function(_0xdaddfd){if(_0xdaddfd){return _0xdaddfd[_0xe7e2('0x35')](_0x18ca6e)[_0xe7e2('0x36')](function(_0x246096){return _0x246096;});}return null;};}function removeEntity(_0x4f415b,_0x2d76c7){return function(_0x96c7f4){if(_0x96c7f4){return _0x96c7f4['destroy']()[_0xe7e2('0x36')](function(){var _0x2ea6cf=_0x96c7f4['get']({'plain':!![]});var _0x17f4ae='SmsAccounts';return db['UserProfileResource'][_0xe7e2('0x37')]({'where':{'type':_0x17f4ae,'resourceId':_0x2ea6cf['id']}})[_0xe7e2('0x36')](function(){return _0x96c7f4;});})[_0xe7e2('0x36')](function(){_0x4f415b[_0xe7e2('0x2b')](0xcc)[_0xe7e2('0x2c')]();});}};}function handleEntityNotFound(_0x471fbd,_0x535fb7){return function(_0x1b161e){if(!_0x1b161e){_0x471fbd[_0xe7e2('0x2a')](0x194);}return _0x1b161e;};}function handleError(_0x30517e,_0x1afb6b){_0x1afb6b=_0x1afb6b||0x1f4;return function(_0x82d7c){logger[_0xe7e2('0x25')](_0x82d7c[_0xe7e2('0x38')]);if(_0x82d7c[_0xe7e2('0x39')]){delete _0x82d7c[_0xe7e2('0x39')];}_0x30517e['status'](_0x1afb6b)[_0xe7e2('0x3a')](_0x82d7c);};}exports[_0xe7e2('0x3b')]=function(_0x199f61,_0x560ed8){var _0x19a8d9={'include':[{'model':db[_0xe7e2('0x3c')],'as':_0xe7e2('0x3d')}]},_0x2bfed0={},_0x27012d={'count':0x0,'rows':[]};var _0x371f94=_['map'](db['SmsAccount']['rawAttributes'],function(_0x27ad55){return{'name':_0x27ad55['fieldName'],'type':_0x27ad55[_0xe7e2('0x3e')][_0xe7e2('0x3f')]};});_0x2bfed0[_0xe7e2('0x40')]=_['map'](_0x371f94,_0xe7e2('0x39'));_0x2bfed0[_0xe7e2('0x41')]=_[_0xe7e2('0x42')](_0x199f61[_0xe7e2('0x41')]);_0x2bfed0[_0xe7e2('0x43')]=_[_0xe7e2('0x44')](_0x2bfed0['model'],_0x2bfed0[_0xe7e2('0x41')]);_0x19a8d9[_0xe7e2('0x45')]=_[_0xe7e2('0x44')](_0x2bfed0[_0xe7e2('0x40')],qs[_0xe7e2('0x46')](_0x199f61[_0xe7e2('0x41')][_0xe7e2('0x46')]));_0x19a8d9[_0xe7e2('0x45')]=_0x19a8d9[_0xe7e2('0x45')][_0xe7e2('0x47')]?_0x19a8d9['attributes']:_0x2bfed0[_0xe7e2('0x40')];if(!_0x199f61['query'][_0xe7e2('0x48')](_0xe7e2('0x49'))){_0x19a8d9[_0xe7e2('0x2f')]=qs['limit'](_0x199f61['query']['limit']);_0x19a8d9['offset']=qs[_0xe7e2('0x2d')](_0x199f61['query'][_0xe7e2('0x2d')]);}_0x19a8d9[_0xe7e2('0x4a')]=qs['sort'](_0x199f61[_0xe7e2('0x41')]['sort']);_0x19a8d9[_0xe7e2('0x4b')]=qs[_0xe7e2('0x43')](_[_0xe7e2('0x4c')](_0x199f61['query'],_0x2bfed0[_0xe7e2('0x43')]),_0x371f94);if(_0x199f61[_0xe7e2('0x41')][_0xe7e2('0x4d')]){_0x19a8d9[_0xe7e2('0x4b')]=_[_0xe7e2('0x4e')](_0x19a8d9[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x371f94,function(_0x35e47b){if(_0x35e47b[_0xe7e2('0x3e')]!=='VIRTUAL'){var _0x4be517={};_0x4be517[_0x35e47b[_0xe7e2('0x39')]]={'$like':'%'+_0x199f61[_0xe7e2('0x41')][_0xe7e2('0x4d')]+'%'};return _0x4be517;}})});}_0x19a8d9=_[_0xe7e2('0x4e')]({},_0x19a8d9,_0x199f61['options']);var _0x126cb2={'where':_0x19a8d9[_0xe7e2('0x4b')]};return db[_0xe7e2('0x50')]['count'](_0x126cb2)[_0xe7e2('0x36')](function(_0xc69a8f){_0x27012d[_0xe7e2('0x30')]=_0xc69a8f;if(_0x199f61[_0xe7e2('0x41')][_0xe7e2('0x51')]){_0x19a8d9['include']=[{'all':!![]}];}return db[_0xe7e2('0x50')][_0xe7e2('0x52')](_0x19a8d9);})[_0xe7e2('0x36')](function(_0x373e52){_0x27012d[_0xe7e2('0x53')]=_0x373e52;return _0x27012d;})[_0xe7e2('0x36')](respondWithFilteredResult(_0x560ed8,_0x19a8d9))[_0xe7e2('0x29')](handleError(_0x560ed8,null));};exports[_0xe7e2('0x54')]=function(_0x16c8c2,_0x165f92){var _0x2bc2b0={'raw':![],'where':{'id':_0x16c8c2[_0xe7e2('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1c4f12={};_0x1c4f12[_0xe7e2('0x40')]=_[_0xe7e2('0x42')](db[_0xe7e2('0x50')]['rawAttributes']);_0x1c4f12['query']=_[_0xe7e2('0x42')](_0x16c8c2[_0xe7e2('0x41')]);_0x1c4f12[_0xe7e2('0x43')]=_['intersection'](_0x1c4f12['model'],_0x1c4f12[_0xe7e2('0x41')]);_0x2bc2b0[_0xe7e2('0x45')]=_['intersection'](_0x1c4f12[_0xe7e2('0x40')],qs['fields'](_0x16c8c2[_0xe7e2('0x41')][_0xe7e2('0x46')]));_0x2bc2b0[_0xe7e2('0x45')]=_0x2bc2b0['attributes'][_0xe7e2('0x47')]?_0x2bc2b0[_0xe7e2('0x45')]:_0x1c4f12['model'];if(_0x16c8c2[_0xe7e2('0x41')][_0xe7e2('0x51')]){_0x2bc2b0[_0xe7e2('0x56')]=[{'all':!![]}];}_0x2bc2b0=_[_0xe7e2('0x4e')]({},_0x2bc2b0,_0x16c8c2[_0xe7e2('0x57')]);return db[_0xe7e2('0x50')][_0xe7e2('0x58')](_0x2bc2b0)[_0xe7e2('0x36')](handleEntityNotFound(_0x165f92,null))[_0xe7e2('0x36')](respondWithResult(_0x165f92,null))[_0xe7e2('0x29')](handleError(_0x165f92,null));};exports['create']=function(_0x4f511d,_0x4f4b85){return db[_0xe7e2('0x50')][_0xe7e2('0x59')](_0x4f511d[_0xe7e2('0x5a')],{})[_0xe7e2('0x36')](function(_0x46e289){var _0xbffc60=_0x4f511d[_0xe7e2('0x5b')][_0xe7e2('0x5c')]({'plain':!![]});if(!_0xbffc60)throw new Error(_0xe7e2('0x5d'));if(_0xbffc60[_0xe7e2('0x5e')]===_0xe7e2('0x5b')){var _0x560d7f=_0x46e289[_0xe7e2('0x5c')]({'plain':!![]});var _0x2e8fec=_0xe7e2('0x5f');return db['UserProfileSection']['find']({'where':{'name':_0x2e8fec,'userProfileId':_0xbffc60[_0xe7e2('0x60')]},'raw':!![]})[_0xe7e2('0x36')](function(_0x368e5b){if(_0x368e5b&&_0x368e5b['autoAssociation']===0x0){return db[_0xe7e2('0x61')][_0xe7e2('0x59')]({'name':_0x560d7f[_0xe7e2('0x39')],'resourceId':_0x560d7f['id'],'type':_0x368e5b[_0xe7e2('0x39')],'sectionId':_0x368e5b['id']},{})[_0xe7e2('0x36')](function(){return _0x46e289;});}else{return _0x46e289;}})['catch'](function(_0x3cb216){logger['error'](_0xe7e2('0x62'),_0x3cb216);throw _0x3cb216;});}return _0x46e289;})['then'](respondWithResult(_0x4f4b85,0xc9))[_0xe7e2('0x29')](handleError(_0x4f4b85,null));};exports[_0xe7e2('0x35')]=function(_0x1e45a,_0x15ed5b){if(_0x1e45a[_0xe7e2('0x5a')]['id']){delete _0x1e45a['body']['id'];}return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x1e45a['params']['id']},'include':[{'model':db[_0xe7e2('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xe7e2('0x36')](handleEntityNotFound(_0x15ed5b,null))[_0xe7e2('0x36')](saveUpdates(_0x1e45a['body'],null))[_0xe7e2('0x36')](respondWithResult(_0x15ed5b,null))['catch'](handleError(_0x15ed5b,null));};exports[_0xe7e2('0x37')]=function(_0x54ca05,_0x3ae239){return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x54ca05['params']['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x3ae239,null))[_0xe7e2('0x36')](removeEntity(_0x3ae239,null))['catch'](handleError(_0x3ae239,null));};exports['describe']=function(_0x57e6d8,_0x183461){return db['SmsAccount']['describe']()[_0xe7e2('0x36')](respondWithResult(_0x183461,null))[_0xe7e2('0x29')](handleError(_0x183461,null));};exports[_0xe7e2('0x63')]=function(_0x2cad19,_0x44e078,_0x5ecac4){if(_0x2cad19[_0xe7e2('0x5a')]['id']){delete _0x2cad19[_0xe7e2('0x5a')]['id'];}return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x2cad19['params']['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x44e078,null))[_0xe7e2('0x36')](function(_0x23551a){if(_0x23551a){_0x2cad19[_0xe7e2('0x5a')]['SmsAccountId']=_0x23551a['id'];return db['Disposition'][_0xe7e2('0x59')](_0x2cad19[_0xe7e2('0x5a')]);}})['then'](respondWithResult(_0x44e078,null))[_0xe7e2('0x29')](handleError(_0x44e078,null));};exports[_0xe7e2('0x64')]=function(_0x1e1da9,_0x37a633,_0x37565b){var _0x4a422d={'raw':![],'where':{}};var _0x14f9c2={};var _0x35d340={'count':0x0,'rows':[]};return db[_0xe7e2('0x50')][_0xe7e2('0x65')]({'where':{'id':_0x1e1da9[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x37a633,null))[_0xe7e2('0x36')](function(_0x509537){if(_0x509537){_0x14f9c2['model']=_[_0xe7e2('0x42')](db[_0xe7e2('0x66')][_0xe7e2('0x67')]);_0x14f9c2['query']=_[_0xe7e2('0x42')](_0x1e1da9[_0xe7e2('0x41')]);_0x14f9c2[_0xe7e2('0x43')]=_[_0xe7e2('0x44')](_0x14f9c2['model'],_0x14f9c2[_0xe7e2('0x41')]);_0x4a422d[_0xe7e2('0x45')]=_['intersection'](_0x14f9c2[_0xe7e2('0x40')],qs[_0xe7e2('0x46')](_0x1e1da9[_0xe7e2('0x41')][_0xe7e2('0x46')]));_0x4a422d[_0xe7e2('0x45')]=_0x4a422d[_0xe7e2('0x45')][_0xe7e2('0x47')]?_0x4a422d[_0xe7e2('0x45')]:_0x14f9c2['model'];if(!_0x1e1da9[_0xe7e2('0x41')]['hasOwnProperty'](_0xe7e2('0x49'))){_0x4a422d['limit']=qs[_0xe7e2('0x2f')](_0x1e1da9[_0xe7e2('0x41')][_0xe7e2('0x2f')]);_0x4a422d[_0xe7e2('0x2d')]=qs[_0xe7e2('0x2d')](_0x1e1da9['query']['offset']);}_0x4a422d[_0xe7e2('0x4a')]=qs[_0xe7e2('0x68')](_0x1e1da9[_0xe7e2('0x41')][_0xe7e2('0x68')]);_0x4a422d[_0xe7e2('0x4b')]=qs[_0xe7e2('0x43')](_[_0xe7e2('0x4c')](_0x1e1da9[_0xe7e2('0x41')],_0x14f9c2[_0xe7e2('0x43')]));_0x4a422d['where'][_0xe7e2('0x69')]=_0x509537['id'];if(_0x1e1da9[_0xe7e2('0x41')]['filter']){_0x4a422d[_0xe7e2('0x4b')]=_[_0xe7e2('0x4e')](_0x4a422d[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x4a422d[_0xe7e2('0x45')],function(_0x5619a0){var _0x399ce7={};_0x399ce7[_0x5619a0]={'$like':'%'+_0x1e1da9['query'][_0xe7e2('0x4d')]+'%'};return _0x399ce7;})});}_0x4a422d=_[_0xe7e2('0x4e')]({},_0x4a422d,_0x1e1da9[_0xe7e2('0x57')]);return db[_0xe7e2('0x66')]['count']({'where':_0x4a422d[_0xe7e2('0x4b')]})['then'](function(_0x4b64e7){_0x35d340['count']=_0x4b64e7;if(_0x1e1da9[_0xe7e2('0x41')][_0xe7e2('0x51')]){_0x4a422d['include']=[{'all':!![]}];}return db['Disposition'][_0xe7e2('0x52')](_0x4a422d);})[_0xe7e2('0x36')](function(_0x2b4eef){_0x35d340[_0xe7e2('0x53')]=_0x2b4eef;return _0x35d340;});}})['then'](respondWithFilteredResult(_0x37a633,_0x4a422d))['catch'](handleError(_0x37a633,null));};exports[_0xe7e2('0x6a')]=function(_0x127818,_0x27e50d,_0x19601e){return db['SmsAccount'][_0xe7e2('0x58')]({'where':{'id':_0x127818['params']['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x27e50d,null))[_0xe7e2('0x36')](function(_0x205708){if(_0x205708){return _0x205708[_0xe7e2('0x6a')](_0x127818[_0xe7e2('0x41')][_0xe7e2('0x6b')]);}})['then'](respondWithStatusCode(_0x27e50d,null))[_0xe7e2('0x29')](handleError(_0x27e50d,null));};exports[_0xe7e2('0x6c')]=function(_0x39fed0,_0xeea313,_0x3a3b75){if(_0x39fed0[_0xe7e2('0x5a')]['id']){delete _0x39fed0[_0xe7e2('0x5a')]['id'];}return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x39fed0[_0xe7e2('0x55')]['id']}})['then'](handleEntityNotFound(_0xeea313,null))[_0xe7e2('0x36')](function(_0x212263){if(_0x212263){_0x39fed0[_0xe7e2('0x5a')][_0xe7e2('0x69')]=_0x212263['id'];return db[_0xe7e2('0x6d')][_0xe7e2('0x59')](_0x39fed0[_0xe7e2('0x5a')]);}})['then'](respondWithResult(_0xeea313,null))[_0xe7e2('0x29')](handleError(_0xeea313,null));};exports[_0xe7e2('0x6e')]=function(_0xbf0d,_0x17a185,_0x3e5e54){var _0x59ad43={'raw':![],'where':{}};var _0x4f8935={};var _0x428d0e={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xbf0d[_0xe7e2('0x55')]['id']}})['then'](handleEntityNotFound(_0x17a185,null))[_0xe7e2('0x36')](function(_0x561d13){if(_0x561d13){_0x4f8935[_0xe7e2('0x40')]=_[_0xe7e2('0x42')](db['CannedAnswer']['rawAttributes']);_0x4f8935[_0xe7e2('0x41')]=_[_0xe7e2('0x42')](_0xbf0d[_0xe7e2('0x41')]);_0x4f8935[_0xe7e2('0x43')]=_[_0xe7e2('0x44')](_0x4f8935[_0xe7e2('0x40')],_0x4f8935[_0xe7e2('0x41')]);_0x59ad43[_0xe7e2('0x45')]=_[_0xe7e2('0x44')](_0x4f8935[_0xe7e2('0x40')],qs[_0xe7e2('0x46')](_0xbf0d['query']['fields']));_0x59ad43['attributes']=_0x59ad43[_0xe7e2('0x45')]['length']?_0x59ad43['attributes']:_0x4f8935[_0xe7e2('0x40')];if(!_0xbf0d[_0xe7e2('0x41')][_0xe7e2('0x48')](_0xe7e2('0x49'))){_0x59ad43[_0xe7e2('0x2f')]=qs[_0xe7e2('0x2f')](_0xbf0d[_0xe7e2('0x41')]['limit']);_0x59ad43['offset']=qs[_0xe7e2('0x2d')](_0xbf0d['query'][_0xe7e2('0x2d')]);}_0x59ad43[_0xe7e2('0x4a')]=qs[_0xe7e2('0x68')](_0xbf0d[_0xe7e2('0x41')][_0xe7e2('0x68')]);_0x59ad43[_0xe7e2('0x4b')]=qs[_0xe7e2('0x43')](_[_0xe7e2('0x4c')](_0xbf0d[_0xe7e2('0x41')],_0x4f8935[_0xe7e2('0x43')]));_0x59ad43[_0xe7e2('0x4b')][_0xe7e2('0x69')]=_0x561d13['id'];if(_0xbf0d[_0xe7e2('0x41')]['filter']){_0x59ad43[_0xe7e2('0x4b')]=_[_0xe7e2('0x4e')](_0x59ad43[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x59ad43[_0xe7e2('0x45')],function(_0x5a055b){var _0x434301={};_0x434301[_0x5a055b]={'$like':'%'+_0xbf0d['query'][_0xe7e2('0x4d')]+'%'};return _0x434301;})});}_0x59ad43=_[_0xe7e2('0x4e')]({},_0x59ad43,_0xbf0d[_0xe7e2('0x57')]);return db[_0xe7e2('0x6d')][_0xe7e2('0x30')]({'where':_0x59ad43['where']})[_0xe7e2('0x36')](function(_0x3f9e5f){_0x428d0e[_0xe7e2('0x30')]=_0x3f9e5f;if(_0xbf0d[_0xe7e2('0x41')][_0xe7e2('0x51')]){_0x59ad43[_0xe7e2('0x56')]=[{'all':!![]}];}return db[_0xe7e2('0x6d')]['findAll'](_0x59ad43);})['then'](function(_0x3949ba){_0x428d0e[_0xe7e2('0x53')]=_0x3949ba;return _0x428d0e;});}})['then'](respondWithFilteredResult(_0x17a185,_0x59ad43))[_0xe7e2('0x29')](handleError(_0x17a185,null));};exports['removeAnswers']=function(_0x2fbcf4,_0x36385b,_0x149c30){return db[_0xe7e2('0x50')]['find']({'where':{'id':_0x2fbcf4[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x36385b,null))[_0xe7e2('0x36')](function(_0x584f14){if(_0x584f14){return _0x584f14['removeAnswers'](_0x2fbcf4['query']['ids']);}})[_0xe7e2('0x36')](respondWithStatusCode(_0x36385b,null))[_0xe7e2('0x29')](handleError(_0x36385b,null));};exports['notify']=function(_0x55b361,_0x11e66f,_0x147010){var _0xccdc39={'channel':_0xe7e2('0x6f')};var _0x52c9ce=[];var _0x5f4994=[];var _0x25c229={};return db['SmsAccount']['find']({'where':{'id':_0x55b361[_0xe7e2('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xe7e2('0x70')}]})[_0xe7e2('0x36')](handleEntityNotFound(_0x11e66f,null))[_0xe7e2('0x36')](function(_0x1a01c0){_0xccdc39['account']=_0x1a01c0;_0xccdc39['applications']=_['orderBy'](_0x1a01c0['Applications'],[_0xe7e2('0x71')],[_0xe7e2('0x72')]);if(_0xccdc39[_0xe7e2('0x73')][_0xe7e2('0x70')]){delete _0xccdc39['account'][_0xe7e2('0x70')];}return db[_0xe7e2('0x74')][_0xe7e2('0x75')]();})['then'](function(_0x1e2007){if(!_0x1e2007){throw new db[(_0xe7e2('0x76'))]['ValidationError'](_0xe7e2('0x77'));}_0x52c9ce=_[_0xe7e2('0x78')](_[_0xe7e2('0x42')](_0x1e2007),[_0xe7e2('0x79'),_0xe7e2('0x7a')]);_0x5f4994=_['difference'](_[_0xe7e2('0x42')](_0x1e2007),[_0xe7e2('0x79'),_0xe7e2('0x7a'),'CompanyId',_0xe7e2('0x7b')]);_0xccdc39['body']={'mapKey':_0xe7e2('0x7c')};if(_0xccdc39[_0xe7e2('0x73')]['type']){switch(_0xccdc39[_0xe7e2('0x73')][_0xe7e2('0x3e')]){case'twilio':_0xccdc39[_0xe7e2('0x5a')]['from']=_0x55b361['body'][_0xe7e2('0x7d')];_0xccdc39[_0xe7e2('0x5a')]['body']=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x7e')];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x7f')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x80')];break;case'skebby':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]='+'+_0x55b361[_0xe7e2('0x5a')]['sender'];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x82')];break;case'connectel':_0xccdc39['body'][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x81')];_0xccdc39[_0xe7e2('0x5a')]['body']=_0x55b361[_0xe7e2('0x5a')]['message'];break;case _0xe7e2('0x83'):_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x81')];_0xccdc39[_0xe7e2('0x5a')]['body']=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x5a')];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x7f')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x84')];break;case _0xe7e2('0x85'):_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')]['From'];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x86')];_0xccdc39[_0xe7e2('0x5a')]['messageId']=_0x55b361['body'][_0xe7e2('0x87')];break;case'infobip':_0xccdc39['body']['from']='+'+_0x55b361['body'][_0xe7e2('0x88')][0x0][_0xe7e2('0x81')];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x88')][0x0][_0xe7e2('0x82')];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x7f')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x88')][0x0][_0xe7e2('0x7f')];break;case'csc':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x89')];_0xccdc39['body'][_0xe7e2('0x5a')]=_0x55b361['body'][_0xe7e2('0x8a')][_0xe7e2('0x27')];break;case'clickatell':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x8b')];_0xccdc39[_0xe7e2('0x5a')]['body']=_0x55b361[_0xe7e2('0x5a')]['text'];_0xccdc39['body'][_0xe7e2('0x7f')]=_0x55b361['body'][_0xe7e2('0x8c')];break;case _0xe7e2('0x8d'):_0xccdc39['body'][_0xe7e2('0x7f')]=_0x55b361[_0xe7e2('0x5a')][0x0][_0xe7e2('0x27')]['id'];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')]=_0x55b361[_0xe7e2('0x5a')][0x0][_0xe7e2('0x27')][_0xe7e2('0x81')];_0xccdc39['body'][_0xe7e2('0x5a')]=_0x55b361['body'][0x0][_0xe7e2('0x27')][_0xe7e2('0x82')];break;case _0xe7e2('0x8e'):_0xccdc39['body']['from']=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x81')];_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')]=_0x55b361[_0xe7e2('0x5a')][_0xe7e2('0x27')];_0xccdc39['body']['messageId']=_0x55b361['body']['refid'];break;}}if(_0xccdc39[_0xe7e2('0x5a')]['id']){delete _0xccdc39[_0xe7e2('0x5a')]['id'];}if(_['isNil'](_0xccdc39['body'][_0xe7e2('0x81')])){throw new db['Sequelize'][(_0xe7e2('0x8f'))](_0xe7e2('0x90'));}if(_[_0xe7e2('0x91')](_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')])||_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x5a')]===''){throw new db['Sequelize'][(_0xe7e2('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe7e2('0x91')](_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x92')])){throw new db[(_0xe7e2('0x76'))][(_0xe7e2('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5f4994);}if(!_[_0xe7e2('0x93')](_0x5f4994,_0xccdc39['body'][_0xe7e2('0x92')])){throw new db[(_0xe7e2('0x76'))]['ValidationError'](_0xe7e2('0x94')+_0x5f4994);}_0x25c229[_0xccdc39[_0xe7e2('0x5a')]['mapKey']]=_0xccdc39['body'][_0xe7e2('0x81')];return db[_0xe7e2('0x95')][_0xe7e2('0x58')]({'where':{'id':_0xccdc39['account'][_0xe7e2('0x7b')]},'include':[{'model':db[_0xe7e2('0x74')],'as':_0xe7e2('0x96'),'where':_0x25c229,'limit':0x1,'order':[[_0xe7e2('0x7a'),_0xe7e2('0x97')]]}]});})[_0xe7e2('0x36')](handleEntityNotFound(_0x11e66f,null))[_0xe7e2('0x36')](function(_0x543eb6){if(_0x543eb6){_0xccdc39[_0xe7e2('0x98')]=_[_0xe7e2('0x99')](_0x543eb6,[_0xe7e2('0x96')]);if(_0x543eb6[_0xe7e2('0x96')][_0xe7e2('0x47')]){return _0x543eb6[_0xe7e2('0x96')][0x0];}var _0x3da4e1=_['defaults'](_0xccdc39[_0xe7e2('0x5a')],{'firstName':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')],'ListId':_0x543eb6['id']});_0x3da4e1[_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x92')]]=_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')];return db['CmContact'][_0xe7e2('0x59')](_0x3da4e1,{'fields':_0x52c9ce,'raw':!![]});}})['then'](handleEntityNotFound(_0x11e66f,null))[_0xe7e2('0x36')](function(_0x451496){if(_0x451496){_0xccdc39[_0xe7e2('0x9a')]=_0x451496;var _0x534034={'ContactId':_0x451496['id'],'phone':_0xccdc39['body'][_0xe7e2('0x81')],'SmsAccountId':_0x55b361['params']['id']};var _0x257f68={'ContactId':_0x451496['id'],'SmsAccountId':_0x55b361['params']['id'],'closed':![]};return db[_0xe7e2('0x9b')][_0xe7e2('0x58')]({'where':_0x257f68})['then'](function(_0x18cb9a){if(_0x18cb9a){return[_0x18cb9a,![]];}return db[_0xe7e2('0x9b')]['create'](_0x534034)['then'](function(_0x4099b6){return[_0x4099b6,!![]];});});}})[_0xe7e2('0x9c')](function(_0x1365f1,_0x29aa1b){_0xccdc39[_0xe7e2('0x9d')]=_0x1365f1[_0xe7e2('0x5c')]({'plain':!![]});_0xccdc39[_0xe7e2('0x9d')][_0xe7e2('0x9e')]=![];if(_0x29aa1b){if(_0xccdc39[_0xe7e2('0x73')]['autoclose']){_0xccdc39[_0xe7e2('0x9f')]['push']({'id':0x0,'priority':_0xccdc39[_0xe7e2('0x9f')]['length']+0x1,'app':_0xe7e2('0xa0'),'appdata':_0xe7e2('0xa1'),'interval':_0xe7e2('0xa2')});}_0xccdc39[_0xe7e2('0x9d')][_0xe7e2('0x9e')]=!![];}return db[_0xe7e2('0xa3')][_0xe7e2('0x59')]({'phone':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x81')],'messageId':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0x7f')],'body':_0xccdc39['body'][_0xe7e2('0x5a')],'SmsAccountId':_0x55b361[_0xe7e2('0x55')]['id'],'SmsInteractionId':_0x1365f1['id'],'direction':'in','ContactId':_0x1365f1['ContactId'],'AttachmentId':_0xccdc39[_0xe7e2('0x5a')][_0xe7e2('0xa4')]});})['then'](function(_0x561ace){_0xccdc39[_0xe7e2('0x27')]=_0x561ace;if(_0xccdc39[_0xe7e2('0x9d')][_0xe7e2('0xa5')]){return db[_0xe7e2('0xa6')][_0xe7e2('0x58')]({'attributes':['id',_0xe7e2('0x39')],'where':{'id':_0xccdc39[_0xe7e2('0x9d')]['UserId']}})[_0xe7e2('0x36')](function(_0x4aad11){if(_0x4aad11){_0xccdc39['applications'][_0xe7e2('0xa7')]({'id':0x0,'priority':0x0,'app':_0xe7e2('0xa8'),'appdata':_0x4aad11['name']+','+(_0xccdc39[_0xe7e2('0x73')][_0xe7e2('0xa9')]||0xa),'interval':_0xe7e2('0xa2')});}return respondWithRpcPromise('Start',_0xe7e2('0xaa'),_0xccdc39);});}return respondWithRpcPromise(_0xe7e2('0xab'),_0xe7e2('0xaa'),_0xccdc39);})['then'](function(_0x4d8e96){if(_0x4d8e96){var _0x45961a=0xc8;var _0x4f0d43=_0xe7e2('0xac');logger[_0xe7e2('0x20')](_0xe7e2('0x23'),_0x4f0d43,_0x45961a,'entity\x20found');logger['debug'](_0xe7e2('0xad'),_0x4f0d43,_0x45961a,_0xe7e2('0xae'),JSON[_0xe7e2('0xaf')](_0x4d8e96));if(_0xccdc39['account'][_0xe7e2('0x3e')]==='twilio'){return _0x11e66f[_0xe7e2('0x2b')](_0x45961a)[_0xe7e2('0xb0')](_0xe7e2('0xb1'),_0xe7e2('0xb2'))[_0xe7e2('0x3a')](_0xe7e2('0xb3'));}else{return _0x11e66f[_0xe7e2('0x2b')](_0x45961a)[_0xe7e2('0x32')](_0x4d8e96);}}})['catch'](handleError(_0x11e66f,null));};exports['addApplications']=function(_0x3ed0cc,_0x5d2119,_0x195c24){return db[_0xe7e2('0x50')][_0xe7e2('0x65')]({'where':{'id':_0x3ed0cc[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x5d2119,null))[_0xe7e2('0x36')](function(_0x519ed9){if(_0x519ed9){return db[_0xe7e2('0xb4')][_0xe7e2('0xb5')](function(_0x3c4dcd){return db[_0xe7e2('0xb6')][_0xe7e2('0x37')]({'where':{'SmsAccountId':_0x3ed0cc[_0xe7e2('0x55')]['id']},'transaction':_0x3c4dcd})[_0xe7e2('0x36')](function(_0x44c126){var _0x2b7b97=_[_0xe7e2('0x4f')](_0x3ed0cc[_0xe7e2('0x5a')],function(_0x5195e5){_0x5195e5['SmsAccountId']=_0x3ed0cc['params']['id'];return _0x5195e5;});return db['SmsApplication'][_0xe7e2('0xb7')](_0x2b7b97,{'transaction':_0x3c4dcd});});})[_0xe7e2('0x36')](function(){return db[_0xe7e2('0xb6')]['findAndCountAll']({'where':{'SmsAccountId':_0x3ed0cc[_0xe7e2('0x55')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5d2119,null))[_0xe7e2('0x29')](handleError(_0x5d2119,null));};exports[_0xe7e2('0xb8')]=function(_0x1c447f,_0x4a7e60,_0x3c99d7){var _0x1bda57={};var _0x4c97c3={};var _0x3bdf30;var _0x4bd786;return db[_0xe7e2('0x50')][_0xe7e2('0x65')]({'where':{'id':_0x1c447f[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x4a7e60,null))['then'](function(_0xc77d9e){if(_0xc77d9e){_0x3bdf30=_0xc77d9e;_0x4c97c3[_0xe7e2('0x40')]=_[_0xe7e2('0x42')](db[_0xe7e2('0xb6')][_0xe7e2('0x67')]);_0x4c97c3[_0xe7e2('0x41')]=_[_0xe7e2('0x42')](_0x1c447f[_0xe7e2('0x41')]);_0x4c97c3[_0xe7e2('0x43')]=_['intersection'](_0x4c97c3[_0xe7e2('0x40')],_0x4c97c3[_0xe7e2('0x41')]);_0x1bda57['attributes']=_[_0xe7e2('0x44')](_0x4c97c3[_0xe7e2('0x40')],qs[_0xe7e2('0x46')](_0x1c447f[_0xe7e2('0x41')][_0xe7e2('0x46')]));_0x1bda57[_0xe7e2('0x45')]=_0x1bda57[_0xe7e2('0x45')][_0xe7e2('0x47')]?_0x1bda57[_0xe7e2('0x45')]:_0x4c97c3[_0xe7e2('0x40')];_0x1bda57['order']=qs[_0xe7e2('0x68')](_0x1c447f[_0xe7e2('0x41')]['sort']);_0x1bda57[_0xe7e2('0x4b')]=qs['filters'](_[_0xe7e2('0x4c')](_0x1c447f['query'],_0x4c97c3['filters']));if(_0x1c447f[_0xe7e2('0x41')]['filter']){_0x1bda57['where']=_[_0xe7e2('0x4e')](_0x1bda57[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x1bda57['attributes'],function(_0x3dbcad){var _0x438d12={};_0x438d12[_0x3dbcad]={'$like':'%'+_0x1c447f[_0xe7e2('0x41')][_0xe7e2('0x4d')]+'%'};return _0x438d12;})});}_0x1bda57=_[_0xe7e2('0x4e')]({},_0x1bda57,_0x1c447f['options']);return _0x3bdf30[_0xe7e2('0xb8')](_0x1bda57);}})[_0xe7e2('0x36')](function(_0x23d972){if(_0x23d972){_0x4bd786=_0x23d972[_0xe7e2('0x47')];if(!_0x1c447f['query'][_0xe7e2('0x48')](_0xe7e2('0x49'))){_0x1bda57['limit']=qs[_0xe7e2('0x2f')](_0x1c447f[_0xe7e2('0x41')]['limit']);_0x1bda57['offset']=qs[_0xe7e2('0x2d')](_0x1c447f[_0xe7e2('0x41')][_0xe7e2('0x2d')]);}return _0x3bdf30[_0xe7e2('0xb8')](_0x1bda57);}})[_0xe7e2('0x36')](function(_0x47e959){if(_0x47e959){return _0x47e959?{'count':_0x4bd786,'rows':_0x47e959}:null;}})['then'](respondWithResult(_0x4a7e60,null))[_0xe7e2('0x29')](handleError(_0x4a7e60,null));};exports['getInteractions']=function(_0x3ccc85,_0x386697,_0x457bcb){var _0x2920f6={'raw':![],'where':{}};var _0x32f16b={};var _0x14c543={'count':0x0,'rows':[]};return db[_0xe7e2('0x50')][_0xe7e2('0x65')]({'where':{'id':_0x3ccc85[_0xe7e2('0x55')]['id']}})['then'](handleEntityNotFound(_0x386697,null))[_0xe7e2('0x36')](function(_0x3afb00){if(_0x3afb00){_0x32f16b[_0xe7e2('0x40')]=_[_0xe7e2('0x42')](db[_0xe7e2('0x9b')][_0xe7e2('0x67')]);_0x32f16b[_0xe7e2('0x41')]=_[_0xe7e2('0x42')](_0x3ccc85[_0xe7e2('0x41')]);_0x32f16b[_0xe7e2('0x43')]=_[_0xe7e2('0x44')](_0x32f16b['model'],_0x32f16b[_0xe7e2('0x41')]);_0x2920f6[_0xe7e2('0x45')]=_[_0xe7e2('0x44')](_0x32f16b['model'],qs[_0xe7e2('0x46')](_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0x46')]));_0x2920f6[_0xe7e2('0x45')]=_0x2920f6['attributes'][_0xe7e2('0x47')]?_0x2920f6['attributes']:_0x32f16b[_0xe7e2('0x40')];if(!_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0x48')](_0xe7e2('0x49'))){_0x2920f6[_0xe7e2('0x2f')]=qs[_0xe7e2('0x2f')](_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0x2f')]);_0x2920f6['offset']=qs[_0xe7e2('0x2d')](_0x3ccc85[_0xe7e2('0x41')]['offset']);}_0x2920f6['order']=qs[_0xe7e2('0x68')](_0x3ccc85[_0xe7e2('0x41')]['sort']);_0x2920f6['where']=qs[_0xe7e2('0x43')](_[_0xe7e2('0x4c')](_0x3ccc85[_0xe7e2('0x41')],_0x32f16b[_0xe7e2('0x43')]));_0x2920f6[_0xe7e2('0x4b')][_0xe7e2('0x69')]=_0x3afb00['id'];if(_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0x4d')]){_0x2920f6[_0xe7e2('0x4b')]=_['merge'](_0x2920f6[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x2920f6[_0xe7e2('0x45')],function(_0x38d196){var _0x2c1986={};_0x2c1986[_0x38d196]={'$like':'%'+_0x3ccc85['query'][_0xe7e2('0x4d')]+'%'};return _0x2c1986;})});}_0x2920f6=_['merge']({},_0x2920f6,_0x3ccc85['options']);return db[_0xe7e2('0x9b')][_0xe7e2('0x30')]({'where':_0x2920f6['where']})[_0xe7e2('0x36')](function(_0x4586df){_0x14c543['count']=_0x4586df;if(_0x3ccc85[_0xe7e2('0x41')]['includeAll']){_0x2920f6['include']=[{'model':db[_0xe7e2('0x74')],'as':_0xe7e2('0xb9'),'required':![]},{'model':db[_0xe7e2('0xa6')],'as':_0xe7e2('0xba'),'attributes':['name',_0xe7e2('0xbb'),'internal'],'required':![]},{'model':db[_0xe7e2('0xbc')],'as':_0xe7e2('0xbd'),'attributes':['id',_0xe7e2('0x39'),_0xe7e2('0xbe')],'where':_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0xbf')]?{'id':_0x3ccc85[_0xe7e2('0x41')][_0xe7e2('0xbf')]}:undefined,'required':_0x3ccc85['query'][_0xe7e2('0xbf')]?!![]:![]}];}return db['SmsInteraction'][_0xe7e2('0x52')](_0x2920f6);})[_0xe7e2('0x36')](function(_0x51d6cc){_0x14c543[_0xe7e2('0x53')]=_0x51d6cc;return _0x14c543;});}})[_0xe7e2('0x36')](respondWithFilteredResult(_0x386697,_0x2920f6))['catch'](handleError(_0x386697,null));};exports[_0xe7e2('0x3a')]=function(_0x55f3b7,_0xaf2bc4,_0x2cf028){var _0x3a20cc,_0x5a33b3,_0x2a1720;if(_[_0xe7e2('0x91')](_0x55f3b7[_0xe7e2('0x5a')]['body'])||_0x55f3b7[_0xe7e2('0x5a')][_0xe7e2('0x5a')]===''){throw new db[(_0xe7e2('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe7e2('0x91')](_0x55f3b7[_0xe7e2('0x5a')]['to'])){throw new db[(_0xe7e2('0x76'))][(_0xe7e2('0x8f'))](_0xe7e2('0xc0'));}_0x3a20cc=_0x55f3b7['body']['to'];return db['SmsAccount'][_0xe7e2('0x58')]({'where':{'id':_0x55f3b7[_0xe7e2('0x55')]['id']},'include':[{'model':db[_0xe7e2('0x95')],'as':_0xe7e2('0xc1'),'include':[{'model':db[_0xe7e2('0x74')],'as':_0xe7e2('0x96'),'where':{'mobile':_0x3a20cc},'limit':0x1,'order':[['updatedAt',_0xe7e2('0x97')]]}]}]})[_0xe7e2('0x36')](handleEntityNotFound(_0xaf2bc4,null))[_0xe7e2('0x36')](function(_0x117c19){if(_0x117c19&&_0x117c19[_0xe7e2('0xc1')]){_0x5a33b3=_0x117c19[_0xe7e2('0x5c')]({'plain':!![]});if(_0x5a33b3[_0xe7e2('0xc1')]&&_0x5a33b3['List'][_0xe7e2('0x96')]['length']){return _0x5a33b3['List']['Contacts'][0x0];}return db[_0xe7e2('0x74')][_0xe7e2('0x59')](_[_0xe7e2('0x19')](_0x55f3b7['body'],{'firstName':_0x3a20cc,'mobile':_0x3a20cc,'phone':_0x3a20cc,'ListId':_0x5a33b3[_0xe7e2('0x7b')]}));}})[_0xe7e2('0x36')](handleEntityNotFound(_0xaf2bc4,null))['then'](function(_0x4ed5f7){if(_0x4ed5f7){_0x2a1720=_0x4ed5f7;return db[_0xe7e2('0x9b')][_0xe7e2('0x58')]({'where':{'ContactId':_0x2a1720['id'],'closed':![],'SmsAccountId':_0x5a33b3['id']}})[_0xe7e2('0x36')](function(_0x6c09fb){if(_0x6c09fb){return[_0x6c09fb,![]];}return db['SmsInteraction'][_0xe7e2('0x59')]({'UserId':_0x55f3b7[_0xe7e2('0x5b')]['id'],'ContactId':_0x2a1720['id'],'SmsAccountId':_0x5a33b3['id'],'phone':_0x3a20cc,'firstMsgDirection':_0xe7e2('0xc2'),'Messages':[_[_0xe7e2('0x4e')](_0x55f3b7[_0xe7e2('0x5a')],{'read':![],'body':_0x55f3b7[_0xe7e2('0x5a')]['body'],'phone':_0x3a20cc,'SmsAccountId':_0x5a33b3['id'],'UserId':_0x55f3b7[_0xe7e2('0x5b')]['id'],'ContactId':_0x2a1720['id']})]},{'include':[{'model':db[_0xe7e2('0xa3')],'as':_0xe7e2('0xc3')}]})[_0xe7e2('0x36')](function(_0xf30bf9){return[_0xf30bf9,!![]];});});}})[_0xe7e2('0x9c')](function(_0xf4f11,_0x228911){if(_0x228911){return _0xf4f11;}return db[_0xe7e2('0xa3')][_0xe7e2('0x59')](_[_0xe7e2('0x4e')](_0x55f3b7['body'],{'read':![],'body':_0x55f3b7[_0xe7e2('0x5a')]['body'],'phone':_0x3a20cc,'SmsAccountId':_0x5a33b3['id'],'SmsInteractionId':_0xf4f11['id'],'UserId':_0x55f3b7['user']['id'],'ContactId':_0x2a1720['id']}))['then'](function(_0x3f8fc6){_0xf4f11[_0xe7e2('0xc4')]['Messages']=[];_0xf4f11[_0xe7e2('0xc4')][_0xe7e2('0xc3')]['push'](_0x3f8fc6[_0xe7e2('0xc4')]);return _0xf4f11;});})[_0xe7e2('0x36')](respondWithResult(_0xaf2bc4,null))[_0xe7e2('0x29')](handleError(_0xaf2bc4,null));};exports[_0xe7e2('0x2b')]=function(_0xb46609,_0x16e861,_0x1342dc){if(_0xb46609['body']['id']){delete _0xb46609[_0xe7e2('0x5a')]['id'];}var _0xbd0c9,_0x270f1f,_0x59d9ac;return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0xb46609[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x16e861,null))[_0xe7e2('0x36')](function(_0x25474b){if(_0x25474b){_0x59d9ac=_0x25474b;logger[_0xe7e2('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe7e2('0x2b'),_0xe7e2('0xc5'),_0x25474b[_0xe7e2('0x3e')],util['inspect'](_0xb46609['body'],{'showHidden':![],'depth':null}));switch(_0x25474b['type']){case _0xe7e2('0xc6'):if(_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0xc7')]&&_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')]){_0x270f1f=_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')];return db['SmsMessage'][_0xe7e2('0x58')]({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0xc7')]}});}break;case _0xe7e2('0xc8'):if(_0xb46609[_0xe7e2('0x5a')]['requestid']&&_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0xc9')]){_0x270f1f=_0xb46609[_0xe7e2('0x5a')]['statusInt'];return db['SmsMessage'][_0xe7e2('0x58')]({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')]['requestid']}});}break;case _0xe7e2('0x83'):if(_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x84')]&&_0xb46609[_0xe7e2('0x5a')]['status_code']){_0x270f1f=_0xb46609['body'][_0xe7e2('0xca')];return db[_0xe7e2('0xa3')][_0xe7e2('0x58')]({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x84')]}});}break;case _0xe7e2('0xcb'):var _0x57438a=_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x88')][0x0];if(_0x57438a[_0xe7e2('0x7f')]&&_0x57438a[_0xe7e2('0x2b')][_0xe7e2('0xcc')]===_0xe7e2('0xcd')){_0x270f1f=_0x57438a[_0xe7e2('0x2b')]['groupName'];return db['SmsMessage'][_0xe7e2('0x58')]({'where':{'messageId':_0x57438a[_0xe7e2('0x7f')]}});}break;case _0xe7e2('0xce'):if(_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x7f')]&&_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')]){_0x270f1f=_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')];return db[_0xe7e2('0xa3')][_0xe7e2('0x58')]({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')]['messageId']}});}break;case _0xe7e2('0x8d'):if(_0xb46609['body'][0x0][_0xe7e2('0x27')]['id']){_0x270f1f=_0xb46609[_0xe7e2('0x5a')][0x0]['type'];return db[_0xe7e2('0xa3')]['find']({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')][0x0][_0xe7e2('0x27')]['id']}});}break;case _0xe7e2('0x8e'):if(_0xb46609[_0xe7e2('0x5a')]['redif']&&_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')]){_0x270f1f=_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0x2b')];return db[_0xe7e2('0xa3')][_0xe7e2('0x58')]({'where':{'messageId':_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0xcf')]}});}break;}}})[_0xe7e2('0x36')](handleEntityNotFound(_0x16e861,null))[_0xe7e2('0x36')](function(_0x170a00){if(_0x170a00){_0xbd0c9=_0x170a00;switch(_0x59d9ac['type']){case'skebby':if(_0x270f1f===_0xe7e2('0xcd')){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe7e2('0x2b'),'skebby',util[_0xe7e2('0xd0')](_0xb46609[_0xe7e2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe7e2('0xc8'):if(_0x270f1f==='1'){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger[_0xe7e2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe7e2('0x2b'),'skebby',util[_0xe7e2('0xd0')](_0xb46609[_0xe7e2('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xb46609[_0xe7e2('0x5a')][_0xe7e2('0xd1')]&&_0x270f1f>=0xc8&&_0x270f1f<=0xce){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger['error'](_0xe7e2('0x23'),_0xe7e2('0x2b'),_0xe7e2('0x83'),util['inspect'](_0xb46609['body'],{'showHidden':![],'depth':null}));}break;case _0xe7e2('0xcb'):var _0x5102a8=_0xb46609['body'][_0xe7e2('0x88')][0x0];if(_0x5102a8['status'][_0xe7e2('0xcc')]===_0xe7e2('0xcd')){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger[_0xe7e2('0x25')](_0xe7e2('0x23'),_0xe7e2('0x2b'),_0xe7e2('0xcb'),util[_0xe7e2('0xd0')](_0xb46609[_0xe7e2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe7e2('0xce'):if(_0x270f1f==_0xe7e2('0xd2')||_0x270f1f==_0xe7e2('0xd3')){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger[_0xe7e2('0x25')](_0xe7e2('0x23'),_0xe7e2('0x2b'),_0xe7e2('0xce'),util[_0xe7e2('0xd0')](_0xb46609[_0xe7e2('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x270f1f=='message-delivered'){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger[_0xe7e2('0x25')](_0xe7e2('0x23'),_0xe7e2('0x2b'),'bandwidth',util['inspect'](_0xb46609[_0xe7e2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe7e2('0x8e'):if(_0x270f1f==='DELIVRD'||_0x270f1f==='ACCEPTD'){return _0xbd0c9[_0xe7e2('0x35')]({'read':!![]});}else{logger['error'](_0xe7e2('0x23'),_0xe7e2('0x2b'),'intelepeer',util[_0xe7e2('0xd0')](_0xb46609['body'],{'showHidden':![],'depth':null}));}break;}return _0xbd0c9;}})['then'](respondWithResult(_0x16e861,null))[_0xe7e2('0x29')](handleError(_0x16e861,null));};exports[_0xe7e2('0xd4')]=function(_0x199162,_0x48daf0,_0xa77918){var _0x1ce61f,_0x29d5b3,_0x3d5771;return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x199162[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x48daf0,null))['then'](function(_0x1431de){if(_0x1431de){_0x3d5771=_0x1431de;logger[_0xe7e2('0x22')](_0xe7e2('0x23'),'status',_0xe7e2('0xc5'),_0x1431de[_0xe7e2('0x3e')],util[_0xe7e2('0xd0')](_0x199162[_0xe7e2('0x41')],{'showHidden':![],'depth':null}));switch(_0x1431de['type']){case'csc':if(_0x199162['query'][_0xe7e2('0xd5')]&&_0x199162[_0xe7e2('0x41')][_0xe7e2('0xd6')]){_0x29d5b3=_0x199162['query']['state'];return db[_0xe7e2('0xa3')][_0xe7e2('0x58')]({'where':{'messageId':_0x199162[_0xe7e2('0x41')]['message-id']}});}break;}}})[_0xe7e2('0x36')](handleEntityNotFound(_0x48daf0,null))[_0xe7e2('0x36')](function(_0x2bca51){if(_0x2bca51){_0x1ce61f=_0x2bca51;switch(_0x3d5771[_0xe7e2('0x3e')]){case _0xe7e2('0xd7'):if(_0x29d5b3==='2'||_0x29d5b3==='6'){return _0x1ce61f['update']({'read':!![]});}else{logger[_0xe7e2('0x25')](_0xe7e2('0x23'),_0xe7e2('0x2b'),'csc',util[_0xe7e2('0xd0')](_0x199162[_0xe7e2('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1ce61f;}})[_0xe7e2('0x36')](respondWithResult(_0x48daf0,null))[_0xe7e2('0x29')](handleError(_0x48daf0,null));};exports[_0xe7e2('0xd8')]=function(_0x26bfae,_0x5f5252,_0x30dba5){return db['SmsAccount'][_0xe7e2('0x58')]({'where':{'id':_0x26bfae[_0xe7e2('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f5252,null))['then'](function(_0x1e2fa2){if(_0x1e2fa2){return _0x1e2fa2['addAgents'](_0x26bfae['body']['ids'],_['omit'](_0x26bfae['body'],['ids','id'])||{})[_0xe7e2('0x9c')](function(_0xcfc69f){for(var _0x5a98ca=0x0;_0x5a98ca<_0x26bfae['body'][_0xe7e2('0x6b')][_0xe7e2('0x47')];_0x5a98ca+=0x1){socket[_0xe7e2('0xd9')](_0xe7e2('0xda'),{'UserId':Number(_0x26bfae['body'][_0xe7e2('0x6b')][_0x5a98ca]),'SmsAccountId':Number(_0x26bfae['params']['id'])});}return _0xcfc69f;});}})['then'](respondWithResult(_0x5f5252,null))[_0xe7e2('0x29')](handleError(_0x5f5252,null));};exports[_0xe7e2('0xdb')]=function(_0x981c58,_0x3b23bf,_0x202b63){return db[_0xe7e2('0x50')][_0xe7e2('0x58')]({'where':{'id':_0x981c58[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x3b23bf,null))[_0xe7e2('0x36')](function(_0x237cb3){if(_0x237cb3){return _0x237cb3[_0xe7e2('0xdb')](_0x981c58['query'][_0xe7e2('0x6b')])[_0xe7e2('0x36')](function(){if(_['isArray'](_0x981c58[_0xe7e2('0x41')][_0xe7e2('0x6b')])){for(var _0x4afa98=0x0;_0x4afa98<_0x981c58[_0xe7e2('0x41')][_0xe7e2('0x6b')][_0xe7e2('0x47')];_0x4afa98+=0x1){socket[_0xe7e2('0xd9')](_0xe7e2('0xdc'),{'UserId':Number(_0x981c58[_0xe7e2('0x41')][_0xe7e2('0x6b')][_0x4afa98]),'SmsAccountId':Number(_0x981c58[_0xe7e2('0x55')]['id'])});}}else{socket[_0xe7e2('0xd9')](_0xe7e2('0xdc'),{'UserId':Number(_0x981c58[_0xe7e2('0x41')][_0xe7e2('0x6b')]),'SmsAccountId':Number(_0x981c58['params']['id'])});}});}})[_0xe7e2('0x36')](respondWithStatusCode(_0x3b23bf,null))[_0xe7e2('0x29')](handleError(_0x3b23bf,null));};exports[_0xe7e2('0xdd')]=function(_0x1faa78,_0x191a2a,_0x3dbcc9){var _0x4f4efd={};var _0x1827bf={};var _0x5b46b0;var _0xd0ae3f;return db['SmsAccount'][_0xe7e2('0x65')]({'where':{'id':_0x1faa78[_0xe7e2('0x55')]['id']}})[_0xe7e2('0x36')](handleEntityNotFound(_0x191a2a,null))['then'](function(_0x177002){if(_0x177002){_0x5b46b0=_0x177002;_0x1827bf[_0xe7e2('0x40')]=_[_0xe7e2('0x42')](db[_0xe7e2('0xa6')][_0xe7e2('0x67')]);_0x1827bf[_0xe7e2('0x41')]=_[_0xe7e2('0x42')](_0x1faa78[_0xe7e2('0x41')]);_0x1827bf[_0xe7e2('0x43')]=_[_0xe7e2('0x44')](_0x1827bf[_0xe7e2('0x40')],_0x1827bf[_0xe7e2('0x41')]);_0x4f4efd[_0xe7e2('0x45')]=_[_0xe7e2('0x44')](_0x1827bf[_0xe7e2('0x40')],qs[_0xe7e2('0x46')](_0x1faa78[_0xe7e2('0x41')]['fields']));_0x4f4efd['attributes']=_0x4f4efd[_0xe7e2('0x45')]['length']?_0x4f4efd['attributes']:_0x1827bf[_0xe7e2('0x40')];_0x4f4efd[_0xe7e2('0x4a')]=qs[_0xe7e2('0x68')](_0x1faa78['query'][_0xe7e2('0x68')]);_0x4f4efd['where']=qs['filters'](_[_0xe7e2('0x4c')](_0x1faa78[_0xe7e2('0x41')],_0x1827bf[_0xe7e2('0x43')]));if(_0x1faa78[_0xe7e2('0x41')][_0xe7e2('0x4d')]){_0x4f4efd['where']=_[_0xe7e2('0x4e')](_0x4f4efd[_0xe7e2('0x4b')],{'$or':_[_0xe7e2('0x4f')](_0x4f4efd['attributes'],function(_0x89e0a4){var _0x4722d6={};_0x4722d6[_0x89e0a4]={'$like':'%'+_0x1faa78[_0xe7e2('0x41')][_0xe7e2('0x4d')]+'%'};return _0x4722d6;})});}_0x4f4efd=_[_0xe7e2('0x4e')]({},_0x4f4efd,_0x1faa78[_0xe7e2('0x57')]);return _0x5b46b0['getAgents'](_0x4f4efd);}})[_0xe7e2('0x36')](function(_0x4769ae){if(_0x4769ae){_0xd0ae3f=_0x4769ae[_0xe7e2('0x47')];if(!_0x1faa78[_0xe7e2('0x41')][_0xe7e2('0x48')](_0xe7e2('0x49'))){_0x4f4efd[_0xe7e2('0x2f')]=qs[_0xe7e2('0x2f')](_0x1faa78[_0xe7e2('0x41')][_0xe7e2('0x2f')]);_0x4f4efd['offset']=qs['offset'](_0x1faa78[_0xe7e2('0x41')][_0xe7e2('0x2d')]);}return _0x5b46b0[_0xe7e2('0xdd')](_0x4f4efd);}})['then'](function(_0x505578){if(_0x505578){return _0x505578?{'count':_0xd0ae3f,'rows':_0x505578}:null;}})[_0xe7e2('0x36')](respondWithResult(_0x191a2a,null))['catch'](handleError(_0x191a2a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 43575ba..e6977b7 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 _0xca92=['save','update','remove','emit','hasOwnProperty','hook','events','SmsAccount','setMaxListeners'];(function(_0x20fb4b,_0x540d62){var _0x360045=function(_0x30a517){while(--_0x30a517){_0x20fb4b['push'](_0x20fb4b['shift']());}};_0x360045(++_0x540d62);}(_0xca92,0x189));var _0x2ca9=function(_0x26fa43,_0x30a86c){_0x26fa43=_0x26fa43-0x0;var _0x81ca8d=_0xca92[_0x26fa43];return _0x81ca8d;};'use strict';var EventEmitter=require(_0x2ca9('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x2ca9('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2ca9('0x2')](0x0);var events={'afterCreate':_0x2ca9('0x3'),'afterUpdate':_0x2ca9('0x4'),'afterDestroy':_0x2ca9('0x5')};function emitEvent(_0x387a31){return function(_0x22b25f,_0x362240,_0x39ef20){SmsAccountEvents[_0x2ca9('0x6')](_0x387a31+':'+_0x22b25f['id'],_0x22b25f);SmsAccountEvents[_0x2ca9('0x6')](_0x387a31,_0x22b25f);_0x39ef20(null);};}for(var e in events){if(events[_0x2ca9('0x7')](e)){var event=events[e];SmsAccount[_0x2ca9('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xf773=['../../mysqldb','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xf773,0xcf));var _0x3f77=function(_0x56367a,_0x508f61){_0x56367a=_0x56367a-0x0;var _0x17d845=_0xf773[_0x56367a];return _0x17d845;};'use strict';var EventEmitter=require(_0x3f77('0x0'));var SmsAccount=require(_0x3f77('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3f77('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3f77('0x3'),'afterDestroy':_0x3f77('0x4')};function emitEvent(_0x4bc4f8){return function(_0x4de712,_0x472816,_0x2d9b78){SmsAccountEvents[_0x3f77('0x5')](_0x4bc4f8+':'+_0x4de712['id'],_0x4de712);SmsAccountEvents[_0x3f77('0x5')](_0x4bc4f8,_0x4de712);_0x2d9b78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x3f77('0x6')](e,emitEvent(event));}}module[_0x3f77('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 46e8010..dfbc669 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 _0xeecc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api'];(function(_0x2fb0c1,_0x4487f9){var _0x11ff83=function(_0x4c63d8){while(--_0x4c63d8){_0x2fb0c1['push'](_0x2fb0c1['shift']());}};_0x11ff83(++_0x4487f9);}(_0xeecc,0xa4));var _0xceec=function(_0x1d3d8a,_0x46e13b){_0x1d3d8a=_0x1d3d8a-0x0;var _0x5a1afd=_0xeecc[_0x1d3d8a];return _0x5a1afd;};'use strict';var _=require(_0xceec('0x0'));var util=require(_0xceec('0x1'));var logger=require(_0xceec('0x2'))(_0xceec('0x3'));var moment=require(_0xceec('0x4'));var BPromise=require(_0xceec('0x5'));var rp=require(_0xceec('0x6'));var fs=require('fs');var path=require(_0xceec('0x7'));var rimraf=require(_0xceec('0x8'));var config=require(_0xceec('0x9'));var attributes=require(_0xceec('0xa'));module['exports']=function(_0x3a6f26,_0x531492){return _0x3a6f26[_0xceec('0xb')](_0xceec('0xc'),attributes,{'tableName':_0xceec('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd5f=['path','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','../../config/logger','moment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xdd5f,0xba));var _0xfdd5=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xdd5f[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0xfdd5('0x0'));var util=require('util');var logger=require(_0xfdd5('0x1'))('api');var moment=require(_0xfdd5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd5('0x3'));var rimraf=require('rimraf');var config=require(_0xfdd5('0x4'));var attributes=require(_0xfdd5('0x5'));module[_0xfdd5('0x6')]=function(_0x43f396,_0x5b197b){return _0x43f396['define'](_0xfdd5('0x7'),attributes,{'tableName':_0xfdd5('0x8'),'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 851ddc0..c8b8de0 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 _0x987d=['rpc','client','http','redis','defaults','socket.io-emitter','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','where','attributes','map','include','model','then','ShowSmsAccount','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x57532c,_0x2c75cf){var _0x5cb9a6=function(_0x3a4dea){while(--_0x3a4dea){_0x57532c['push'](_0x57532c['shift']());}};_0x5cb9a6(++_0x2c75cf);}(_0x987d,0x1da));var _0xd987=function(_0x22bd3d,_0x5db464){_0x22bd3d=_0x22bd3d-0x0;var _0x56b288=_0x987d[_0x22bd3d];return _0x56b288;};'use strict';var _=require('lodash');var util=require(_0xd987('0x0'));var moment=require(_0xd987('0x1'));var BPromise=require(_0xd987('0x2'));var rs=require(_0xd987('0x3'));var fs=require('fs');var Redis=require(_0xd987('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd987('0x5'))(_0xd987('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd987('0x7')][_0xd987('0x8')]({'port':0x232a});config[_0xd987('0x9')]=_[_0xd987('0xa')](config[_0xd987('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd987('0xb'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xd987('0xc')](socket);function respondWithRpcPromise(_0x301f45,_0x23675e,_0x1d592c){return new BPromise(function(_0xeb4d1,_0x3f8b10){return client[_0xd987('0xd')](_0x301f45,_0x1d592c)['then'](function(_0x265f7f){logger[_0xd987('0xe')](_0xd987('0xf'),_0x23675e,_0xd987('0x10'));logger[_0xd987('0x11')](_0xd987('0x12'),_0x23675e,_0xd987('0x10'),JSON[_0xd987('0x13')](_0x265f7f));if(_0x265f7f[_0xd987('0x14')]){if(_0x265f7f[_0xd987('0x14')][_0xd987('0x15')]===0x1f4){logger[_0xd987('0x14')](_0xd987('0xf'),_0x23675e,_0x265f7f[_0xd987('0x14')][_0xd987('0x16')]);return _0x3f8b10(_0x265f7f[_0xd987('0x14')][_0xd987('0x16')]);}logger[_0xd987('0x14')](_0xd987('0xf'),_0x23675e,_0x265f7f[_0xd987('0x14')]['message']);return _0xeb4d1(_0x265f7f[_0xd987('0x14')][_0xd987('0x16')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x23675e,_0xd987('0x10'));_0xeb4d1(_0x265f7f['result']['message']);}})[_0xd987('0x17')](function(_0x2eabdb){logger[_0xd987('0x14')](_0xd987('0xf'),_0x23675e,_0x2eabdb);_0x3f8b10(_0x2eabdb);});});}exports['ShowSmsAccount']=function(_0x24fee4){var _0x16207f=this;return new Promise(function(_0x1e476d,_0x2d6067){return db['SmsAccount']['find']({'raw':_0x24fee4[_0xd987('0x18')]?_0x24fee4['options']['raw']===undefined?!![]:![]:!![],'where':_0x24fee4['options']?_0x24fee4[_0xd987('0x18')][_0xd987('0x19')]||null:null,'attributes':_0x24fee4[_0xd987('0x18')]?_0x24fee4['options'][_0xd987('0x1a')]||null:null,'include':_0x24fee4[_0xd987('0x18')]?_0x24fee4[_0xd987('0x18')]['include']?_[_0xd987('0x1b')](_0x24fee4['options']['include'],function(_0x365754){return{'model':db[_0x365754['model']],'as':_0x365754['as'],'attributes':_0x365754['attributes'],'include':_0x365754[_0xd987('0x1c')]?_[_0xd987('0x1b')](_0x365754[_0xd987('0x1c')],function(_0x517820){return{'model':db[_0x517820[_0xd987('0x1d')]],'as':_0x517820['as'],'attributes':_0x517820['attributes'],'include':_0x517820['include']?_['map'](_0x517820[_0xd987('0x1c')],function(_0xd92fef){return{'model':db[_0xd92fef[_0xd987('0x1d')]],'as':_0xd92fef['as'],'attributes':_0xd92fef[_0xd987('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd987('0x1e')](function(_0x100495){logger[_0xd987('0xe')](_0xd987('0x1f'),_0x24fee4);logger[_0xd987('0x11')](_0xd987('0x1f'),_0x24fee4,JSON[_0xd987('0x13')](_0x100495));_0x1e476d(_0x100495);})['catch'](function(_0xea583){logger[_0xd987('0x14')](_0xd987('0x1f'),_0xea583[_0xd987('0x16')],_0x24fee4);_0x2d6067(_0x16207f['error'](0x1f4,_0xea583[_0xd987('0x16')]));});});}; \ No newline at end of file +var _0xe4e0=['model','map','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include'];(function(_0x27dbd2,_0x5a02c6){var _0x2e1803=function(_0x458b18){while(--_0x458b18){_0x27dbd2['push'](_0x27dbd2['shift']());}};_0x2e1803(++_0x5a02c6);}(_0xe4e0,0x1c9));var _0x0e4e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe4e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require(_0x0e4e('0x0'));var moment=require(_0x0e4e('0x1'));var BPromise=require(_0x0e4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e4e('0x3'));var db=require(_0x0e4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e4e('0x5'))(_0x0e4e('0x6'));var config=require(_0x0e4e('0x7'));var jayson=require(_0x0e4e('0x8'));var client=jayson[_0x0e4e('0x9')][_0x0e4e('0xa')]({'port':0x232a});config[_0x0e4e('0xb')]=_['defaults'](config['redis'],{'host':_0x0e4e('0xc'),'port':0x18eb});var socket=require(_0x0e4e('0xd'))(new Redis(config[_0x0e4e('0xb')]));require(_0x0e4e('0xe'))[_0x0e4e('0xf')](socket);function respondWithRpcPromise(_0x11be7e,_0x432585,_0x5e8d94){return new BPromise(function(_0x1a6cbd,_0x2b737c){return client['request'](_0x11be7e,_0x5e8d94)[_0x0e4e('0x10')](function(_0x5010c9){logger['info'](_0x0e4e('0x11'),_0x432585,_0x0e4e('0x12'));logger['debug'](_0x0e4e('0x13'),_0x432585,_0x0e4e('0x12'),JSON[_0x0e4e('0x14')](_0x5010c9));if(_0x5010c9[_0x0e4e('0x15')]){if(_0x5010c9['error'][_0x0e4e('0x16')]===0x1f4){logger['error'](_0x0e4e('0x11'),_0x432585,_0x5010c9[_0x0e4e('0x15')][_0x0e4e('0x17')]);return _0x2b737c(_0x5010c9[_0x0e4e('0x15')][_0x0e4e('0x17')]);}logger['error'](_0x0e4e('0x11'),_0x432585,_0x5010c9[_0x0e4e('0x15')]['message']);return _0x1a6cbd(_0x5010c9[_0x0e4e('0x15')][_0x0e4e('0x17')]);}else{logger[_0x0e4e('0x18')](_0x0e4e('0x11'),_0x432585,'request\x20sent');_0x1a6cbd(_0x5010c9['result'][_0x0e4e('0x17')]);}})[_0x0e4e('0x19')](function(_0x37269d){logger['error'](_0x0e4e('0x11'),_0x432585,_0x37269d);_0x2b737c(_0x37269d);});});}exports[_0x0e4e('0x1a')]=function(_0x2bf4c2){var _0x3c5a3d=this;return new Promise(function(_0x4fe104,_0x205225){return db[_0x0e4e('0x1b')][_0x0e4e('0x1c')]({'raw':_0x2bf4c2[_0x0e4e('0x1d')]?_0x2bf4c2[_0x0e4e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2bf4c2['options']?_0x2bf4c2['options'][_0x0e4e('0x1e')]||null:null,'attributes':_0x2bf4c2[_0x0e4e('0x1d')]?_0x2bf4c2['options'][_0x0e4e('0x1f')]||null:null,'include':_0x2bf4c2[_0x0e4e('0x1d')]?_0x2bf4c2[_0x0e4e('0x1d')]['include']?_['map'](_0x2bf4c2[_0x0e4e('0x1d')][_0x0e4e('0x20')],function(_0xd6a9a2){return{'model':db[_0xd6a9a2[_0x0e4e('0x21')]],'as':_0xd6a9a2['as'],'attributes':_0xd6a9a2[_0x0e4e('0x1f')],'include':_0xd6a9a2[_0x0e4e('0x20')]?_['map'](_0xd6a9a2['include'],function(_0xa555a5){return{'model':db[_0xa555a5['model']],'as':_0xa555a5['as'],'attributes':_0xa555a5['attributes'],'include':_0xa555a5['include']?_[_0x0e4e('0x22')](_0xa555a5['include'],function(_0x33f407){return{'model':db[_0x33f407[_0x0e4e('0x21')]],'as':_0x33f407['as'],'attributes':_0x33f407[_0x0e4e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0e4e('0x10')](function(_0x328848){logger[_0x0e4e('0x18')]('ShowSmsAccount',_0x2bf4c2);logger['debug']('ShowSmsAccount',_0x2bf4c2,JSON[_0x0e4e('0x14')](_0x328848));_0x4fe104(_0x328848);})['catch'](function(_0x3c3a8b){logger[_0x0e4e('0x15')](_0x0e4e('0x1a'),_0x3c3a8b['message'],_0x2bf4c2);_0x205225(_0x3c5a3d[_0x0e4e('0x15')](0x1f4,_0x3c3a8b[_0x0e4e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 832b38c..990c47e 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 5bd15e1..6e20f52 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0x34e8,0x12c));var _0x834e=function(_0x318951,_0x5efa89){_0x318951=_0x318951-0x0;var _0x1857ee=_0x34e8[_0x318951];return _0x1857ee;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x34bc53,_0x4ee852){var _0x48b9f6=function(_0x5b4e16){while(--_0x5b4e16){_0x34bc53['push'](_0x34bc53['shift']());}};_0x48b9f6(++_0x4ee852);}(_0x55ca,0x126));var _0xa55c=function(_0x5316d3,_0x5cba98){_0x5316d3=_0x5316d3-0x0;var _0x27d9fa=_0x55ca[_0x5316d3];return _0x27d9fa;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 742fcba..1083784 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 _0x641b=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x45cfe7,_0x36635f){var _0x293960=function(_0x473e67){while(--_0x473e67){_0x45cfe7['push'](_0x45cfe7['shift']());}};_0x293960(++_0x36635f);}(_0x641b,0x143));var _0xb641=function(_0x489a2a,_0x374536){_0x489a2a=_0x489a2a-0x0;var _0x1ebf4d=_0x641b[_0x489a2a];return _0x1ebf4d;};'use strict';var Sequelize=require(_0xb641('0x0'));module[_0xb641('0x1')]={'priority':{'type':Sequelize[_0xb641('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb641('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb641('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb641('0x5')}}; \ No newline at end of file +var _0x5d20=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5d20,0x9e));var _0x05d2=function(_0x204dc7,_0x3ecb07){_0x204dc7=_0x204dc7-0x0;var _0x13e545=_0x5d20[_0x204dc7];return _0x13e545;};'use strict';var Sequelize=require(_0x05d2('0x0'));module[_0x05d2('0x1')]={'priority':{'type':Sequelize[_0x05d2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x05d2('0x3')],'allowNull':![],'defaultValue':_0x05d2('0x4')},'appdata':{'type':Sequelize[_0x05d2('0x5')]()},'description':{'type':Sequelize[_0x05d2('0x3')]},'interval':{'type':Sequelize[_0x05d2('0x3')],'defaultValue':_0x05d2('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c798f22..ce1418c 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 _0x777d=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body'];(function(_0x14462f,_0x2202e3){var _0x5a3c14=function(_0x339a5c){while(--_0x339a5c){_0x14462f['push'](_0x14462f['shift']());}};_0x5a3c14(++_0x2202e3);}(_0x777d,0x1ce));var _0xd777=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x777d[_0x2797c6];return _0x54809f;};'use strict';var emlformat=require(_0xd777('0x0'));var rimraf=require(_0xd777('0x1'));var zipdir=require(_0xd777('0x2'));var jsonpatch=require(_0xd777('0x3'));var rp=require('request-promise');var moment=require(_0xd777('0x4'));var BPromise=require(_0xd777('0x5'));var Mustache=require(_0xd777('0x6'));var util=require('util');var path=require(_0xd777('0x7'));var sox=require(_0xd777('0x8'));var csv=require(_0xd777('0x9'));var ejs=require(_0xd777('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd777('0xb'));var squel=require(_0xd777('0xc'));var crypto=require(_0xd777('0xd'));var jsforce=require(_0xd777('0xe'));var deskjs=require(_0xd777('0xf'));var toCsv=require(_0xd777('0x9'));var querystring=require(_0xd777('0x10'));var Papa=require(_0xd777('0x11'));var Redis=require('ioredis');var authService=require(_0xd777('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd777('0x13'));var hardwareService=require(_0xd777('0x14'));var logger=require(_0xd777('0x15'))(_0xd777('0x16'));var utils=require('../../config/utils');var config=require(_0xd777('0x17'));var licenseUtil=require(_0xd777('0x18'));var db=require(_0xd777('0x19'))['db'];function respondWithStatusCode(_0x58923f,_0x986723){_0x986723=_0x986723||0xcc;return function(_0x4ef6c6){if(_0x4ef6c6){return _0x58923f[_0xd777('0x1a')](_0x986723);}return _0x58923f[_0xd777('0x1b')](_0x986723)[_0xd777('0x1c')]();};}function respondWithResult(_0x170196,_0x41cbce){_0x41cbce=_0x41cbce||0xc8;return function(_0xb1798){if(_0xb1798){return _0x170196[_0xd777('0x1b')](_0x41cbce)[_0xd777('0x1d')](_0xb1798);}};}function respondWithFilteredResult(_0x33dce6,_0x116dce){return function(_0x2c2e6a){if(_0x2c2e6a){var _0x15f6c4=typeof _0x116dce[_0xd777('0x1e')]===_0xd777('0x1f')&&typeof _0x116dce['limit']==='undefined';var _0x207f4f=_0x2c2e6a[_0xd777('0x20')];var _0x179bac=_0x15f6c4?0x0:_0x116dce[_0xd777('0x1e')];var _0xa459c9=_0x15f6c4?_0x2c2e6a[_0xd777('0x20')]:_0x116dce[_0xd777('0x1e')]+_0x116dce[_0xd777('0x21')];var _0x192a46;if(_0xa459c9>=_0x207f4f){_0xa459c9=_0x207f4f;_0x192a46=0xc8;}else{_0x192a46=0xce;}_0x33dce6['status'](_0x192a46);return _0x33dce6[_0xd777('0x22')](_0xd777('0x23'),_0x179bac+'-'+_0xa459c9+'/'+_0x207f4f)[_0xd777('0x1d')](_0x2c2e6a);}return null;};}function patchUpdates(_0x4c9be3){return function(_0x40d422){try{jsonpatch[_0xd777('0x24')](_0x40d422,_0x4c9be3,!![]);}catch(_0xca4fdf){return BPromise[_0xd777('0x25')](_0xca4fdf);}return _0x40d422[_0xd777('0x26')]();};}function saveUpdates(_0x4f0a07,_0x529ffc){return function(_0x1b87f7){if(_0x1b87f7){return _0x1b87f7[_0xd777('0x27')](_0x4f0a07)[_0xd777('0x28')](function(_0x562af3){return _0x562af3;});}return null;};}function removeEntity(_0x23acd7,_0x26f27d){return function(_0x2a0f89){if(_0x2a0f89){return _0x2a0f89['destroy']()[_0xd777('0x28')](function(){_0x23acd7[_0xd777('0x1b')](0xcc)[_0xd777('0x1c')]();});}};}function handleEntityNotFound(_0x2e11b1,_0x44cc8f){return function(_0x4a0233){if(!_0x4a0233){_0x2e11b1['sendStatus'](0x194);}return _0x4a0233;};}function handleError(_0x31e88e,_0x25ac9b){_0x25ac9b=_0x25ac9b||0x1f4;return function(_0xb20d38){logger['error'](_0xb20d38[_0xd777('0x29')]);if(_0xb20d38[_0xd777('0x2a')]){delete _0xb20d38[_0xd777('0x2a')];}_0x31e88e[_0xd777('0x1b')](_0x25ac9b)[_0xd777('0x2b')](_0xb20d38);};}exports[_0xd777('0x2c')]=function(_0x1d81b9,_0x538881){var _0x13c62c={},_0x1eed7d={},_0x1e59bd={'count':0x0,'rows':[]};var _0x296e59=_[_0xd777('0x2d')](db[_0xd777('0x2e')][_0xd777('0x2f')],function(_0x5f20ec){return{'name':_0x5f20ec[_0xd777('0x30')],'type':_0x5f20ec['type'][_0xd777('0x31')]};});_0x1eed7d[_0xd777('0x32')]=_[_0xd777('0x2d')](_0x296e59,_0xd777('0x2a'));_0x1eed7d[_0xd777('0x33')]=_[_0xd777('0x34')](_0x1d81b9[_0xd777('0x33')]);_0x1eed7d[_0xd777('0x35')]=_['intersection'](_0x1eed7d[_0xd777('0x32')],_0x1eed7d['query']);_0x13c62c['attributes']=_[_0xd777('0x36')](_0x1eed7d[_0xd777('0x32')],qs[_0xd777('0x37')](_0x1d81b9[_0xd777('0x33')][_0xd777('0x37')]));_0x13c62c[_0xd777('0x38')]=_0x13c62c['attributes'][_0xd777('0x39')]?_0x13c62c['attributes']:_0x1eed7d[_0xd777('0x32')];if(!_0x1d81b9[_0xd777('0x33')][_0xd777('0x3a')](_0xd777('0x3b'))){_0x13c62c[_0xd777('0x21')]=qs[_0xd777('0x21')](_0x1d81b9['query'][_0xd777('0x21')]);_0x13c62c[_0xd777('0x1e')]=qs['offset'](_0x1d81b9['query']['offset']);}_0x13c62c[_0xd777('0x3c')]=qs[_0xd777('0x3d')](_0x1d81b9[_0xd777('0x33')][_0xd777('0x3d')]);_0x13c62c[_0xd777('0x3e')]=qs[_0xd777('0x35')](_[_0xd777('0x3f')](_0x1d81b9['query'],_0x1eed7d[_0xd777('0x35')]),_0x296e59);if(_0x1d81b9[_0xd777('0x33')][_0xd777('0x40')]){_0x13c62c[_0xd777('0x3e')]=_[_0xd777('0x41')](_0x13c62c[_0xd777('0x3e')],{'$or':_[_0xd777('0x2d')](_0x296e59,function(_0xc8103f){if(_0xc8103f[_0xd777('0x42')]!==_0xd777('0x43')){var _0x55346e={};_0x55346e[_0xc8103f[_0xd777('0x2a')]]={'$like':'%'+_0x1d81b9['query'][_0xd777('0x40')]+'%'};return _0x55346e;}})});}_0x13c62c=_[_0xd777('0x41')]({},_0x13c62c,_0x1d81b9[_0xd777('0x44')]);var _0x5a00a8={'where':_0x13c62c[_0xd777('0x3e')]};return db[_0xd777('0x2e')][_0xd777('0x20')](_0x5a00a8)[_0xd777('0x28')](function(_0x275eaa){_0x1e59bd[_0xd777('0x20')]=_0x275eaa;if(_0x1d81b9[_0xd777('0x33')]['includeAll']){_0x13c62c[_0xd777('0x45')]=[{'all':!![]}];}return db[_0xd777('0x2e')]['findAll'](_0x13c62c);})[_0xd777('0x28')](function(_0x2569c6){_0x1e59bd['rows']=_0x2569c6;return _0x1e59bd;})['then'](respondWithFilteredResult(_0x538881,_0x13c62c))[_0xd777('0x46')](handleError(_0x538881,null));};exports[_0xd777('0x47')]=function(_0x5a02b0,_0x55b77f){var _0x193587={'raw':!![],'where':{'id':_0x5a02b0[_0xd777('0x48')]['id']}},_0x35cbe9={};_0x35cbe9['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x35cbe9[_0xd777('0x33')]=_[_0xd777('0x34')](_0x5a02b0[_0xd777('0x33')]);_0x35cbe9[_0xd777('0x35')]=_[_0xd777('0x36')](_0x35cbe9['model'],_0x35cbe9['query']);_0x193587[_0xd777('0x38')]=_[_0xd777('0x36')](_0x35cbe9[_0xd777('0x32')],qs[_0xd777('0x37')](_0x5a02b0[_0xd777('0x33')][_0xd777('0x37')]));_0x193587[_0xd777('0x38')]=_0x193587['attributes'][_0xd777('0x39')]?_0x193587[_0xd777('0x38')]:_0x35cbe9[_0xd777('0x32')];if(_0x5a02b0[_0xd777('0x33')][_0xd777('0x49')]){_0x193587[_0xd777('0x45')]=[{'all':!![]}];}_0x193587=_[_0xd777('0x41')]({},_0x193587,_0x5a02b0[_0xd777('0x44')]);return db[_0xd777('0x2e')][_0xd777('0x4a')](_0x193587)[_0xd777('0x28')](handleEntityNotFound(_0x55b77f,null))[_0xd777('0x28')](respondWithResult(_0x55b77f,null))['catch'](handleError(_0x55b77f,null));};exports[_0xd777('0x4b')]=function(_0x1cd9f2,_0xbbc51c){return db[_0xd777('0x2e')]['create'](_0x1cd9f2[_0xd777('0x4c')],{})[_0xd777('0x28')](respondWithResult(_0xbbc51c,0xc9))[_0xd777('0x46')](handleError(_0xbbc51c,null));};exports[_0xd777('0x27')]=function(_0x41c473,_0x2f9b0e){if(_0x41c473[_0xd777('0x4c')]['id']){delete _0x41c473['body']['id'];}return db[_0xd777('0x2e')][_0xd777('0x4a')]({'where':{'id':_0x41c473[_0xd777('0x48')]['id']}})[_0xd777('0x28')](handleEntityNotFound(_0x2f9b0e,null))[_0xd777('0x28')](saveUpdates(_0x41c473['body'],null))['then'](respondWithResult(_0x2f9b0e,null))[_0xd777('0x46')](handleError(_0x2f9b0e,null));};exports['destroy']=function(_0xba523d,_0x11c9c1){return db['SmsApplication'][_0xd777('0x4a')]({'where':{'id':_0xba523d['params']['id']}})[_0xd777('0x28')](handleEntityNotFound(_0x11c9c1,null))[_0xd777('0x28')](removeEntity(_0x11c9c1,null))['catch'](handleError(_0x11c9c1,null));}; \ No newline at end of file +var _0x2e99=['count','limit','set','Content-Range','apply','update','then','end','stack','name','send','index','map','SmsApplication','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','show','params','includeAll','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2e99,0xfc));var _0x92e9=function(_0x2d0cb4,_0x5f5af4){_0x2d0cb4=_0x2d0cb4-0x0;var _0xe0747d=_0x2e99[_0x2d0cb4];return _0xe0747d;};'use strict';var emlformat=require(_0x92e9('0x0'));var rimraf=require(_0x92e9('0x1'));var zipdir=require(_0x92e9('0x2'));var jsonpatch=require(_0x92e9('0x3'));var rp=require(_0x92e9('0x4'));var moment=require(_0x92e9('0x5'));var BPromise=require(_0x92e9('0x6'));var Mustache=require(_0x92e9('0x7'));var util=require(_0x92e9('0x8'));var path=require(_0x92e9('0x9'));var sox=require(_0x92e9('0xa'));var csv=require(_0x92e9('0xb'));var ejs=require(_0x92e9('0xc'));var fs=require('fs');var fs_extra=require(_0x92e9('0xd'));var _=require(_0x92e9('0xe'));var squel=require(_0x92e9('0xf'));var crypto=require('crypto');var jsforce=require(_0x92e9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x92e9('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x92e9('0x11'));var authService=require(_0x92e9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x92e9('0x13'));var hardwareService=require(_0x92e9('0x14'));var logger=require(_0x92e9('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x92e9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x139b2d,_0x5e12eb){_0x5e12eb=_0x5e12eb||0xcc;return function(_0x8d4241){if(_0x8d4241){return _0x139b2d[_0x92e9('0x17')](_0x5e12eb);}return _0x139b2d[_0x92e9('0x18')](_0x5e12eb)['end']();};}function respondWithResult(_0x32ad62,_0x2f852b){_0x2f852b=_0x2f852b||0xc8;return function(_0x186d61){if(_0x186d61){return _0x32ad62[_0x92e9('0x18')](_0x2f852b)[_0x92e9('0x19')](_0x186d61);}};}function respondWithFilteredResult(_0x2988d4,_0x55ba64){return function(_0x58e9c5){if(_0x58e9c5){var _0xd45fd6=typeof _0x55ba64[_0x92e9('0x1a')]===_0x92e9('0x1b')&&typeof _0x55ba64['limit']===_0x92e9('0x1b');var _0x470332=_0x58e9c5[_0x92e9('0x1c')];var _0x4eb03b=_0xd45fd6?0x0:_0x55ba64['offset'];var _0x3dabe9=_0xd45fd6?_0x58e9c5[_0x92e9('0x1c')]:_0x55ba64[_0x92e9('0x1a')]+_0x55ba64[_0x92e9('0x1d')];var _0x34a748;if(_0x3dabe9>=_0x470332){_0x3dabe9=_0x470332;_0x34a748=0xc8;}else{_0x34a748=0xce;}_0x2988d4[_0x92e9('0x18')](_0x34a748);return _0x2988d4[_0x92e9('0x1e')](_0x92e9('0x1f'),_0x4eb03b+'-'+_0x3dabe9+'/'+_0x470332)[_0x92e9('0x19')](_0x58e9c5);}return null;};}function patchUpdates(_0x1cf964){return function(_0x2616eb){try{jsonpatch[_0x92e9('0x20')](_0x2616eb,_0x1cf964,!![]);}catch(_0x24ddd3){return BPromise['reject'](_0x24ddd3);}return _0x2616eb['save']();};}function saveUpdates(_0x1abe75,_0x19128e){return function(_0x17715c){if(_0x17715c){return _0x17715c[_0x92e9('0x21')](_0x1abe75)[_0x92e9('0x22')](function(_0x2b8a3c){return _0x2b8a3c;});}return null;};}function removeEntity(_0x20ad81,_0x53457f){return function(_0x57f72b){if(_0x57f72b){return _0x57f72b['destroy']()[_0x92e9('0x22')](function(){_0x20ad81[_0x92e9('0x18')](0xcc)[_0x92e9('0x23')]();});}};}function handleEntityNotFound(_0x2605fe,_0x239226){return function(_0x6aebc0){if(!_0x6aebc0){_0x2605fe[_0x92e9('0x17')](0x194);}return _0x6aebc0;};}function handleError(_0x2dca5d,_0x3b7d8f){_0x3b7d8f=_0x3b7d8f||0x1f4;return function(_0x564131){logger['error'](_0x564131[_0x92e9('0x24')]);if(_0x564131[_0x92e9('0x25')]){delete _0x564131[_0x92e9('0x25')];}_0x2dca5d[_0x92e9('0x18')](_0x3b7d8f)[_0x92e9('0x26')](_0x564131);};}exports[_0x92e9('0x27')]=function(_0xaca1c1,_0x2be23d){var _0x535797={},_0x4fa961={},_0x58699a={'count':0x0,'rows':[]};var _0x53e179=_[_0x92e9('0x28')](db[_0x92e9('0x29')]['rawAttributes'],function(_0x46cd53){return{'name':_0x46cd53[_0x92e9('0x2a')],'type':_0x46cd53['type'][_0x92e9('0x2b')]};});_0x4fa961[_0x92e9('0x2c')]=_[_0x92e9('0x28')](_0x53e179,_0x92e9('0x25'));_0x4fa961[_0x92e9('0x2d')]=_['keys'](_0xaca1c1['query']);_0x4fa961[_0x92e9('0x2e')]=_[_0x92e9('0x2f')](_0x4fa961['model'],_0x4fa961[_0x92e9('0x2d')]);_0x535797[_0x92e9('0x30')]=_[_0x92e9('0x2f')](_0x4fa961[_0x92e9('0x2c')],qs['fields'](_0xaca1c1[_0x92e9('0x2d')][_0x92e9('0x31')]));_0x535797['attributes']=_0x535797[_0x92e9('0x30')][_0x92e9('0x32')]?_0x535797['attributes']:_0x4fa961['model'];if(!_0xaca1c1[_0x92e9('0x2d')]['hasOwnProperty'](_0x92e9('0x33'))){_0x535797['limit']=qs[_0x92e9('0x1d')](_0xaca1c1[_0x92e9('0x2d')]['limit']);_0x535797['offset']=qs[_0x92e9('0x1a')](_0xaca1c1['query'][_0x92e9('0x1a')]);}_0x535797[_0x92e9('0x34')]=qs['sort'](_0xaca1c1[_0x92e9('0x2d')][_0x92e9('0x35')]);_0x535797[_0x92e9('0x36')]=qs[_0x92e9('0x2e')](_[_0x92e9('0x37')](_0xaca1c1[_0x92e9('0x2d')],_0x4fa961['filters']),_0x53e179);if(_0xaca1c1[_0x92e9('0x2d')]['filter']){_0x535797[_0x92e9('0x36')]=_[_0x92e9('0x38')](_0x535797[_0x92e9('0x36')],{'$or':_[_0x92e9('0x28')](_0x53e179,function(_0x4bafa7){if(_0x4bafa7['type']!==_0x92e9('0x39')){var _0x4791f3={};_0x4791f3[_0x4bafa7[_0x92e9('0x25')]]={'$like':'%'+_0xaca1c1['query'][_0x92e9('0x3a')]+'%'};return _0x4791f3;}})});}_0x535797=_[_0x92e9('0x38')]({},_0x535797,_0xaca1c1['options']);var _0x217f6d={'where':_0x535797['where']};return db['SmsApplication'][_0x92e9('0x1c')](_0x217f6d)[_0x92e9('0x22')](function(_0xe4cf1c){_0x58699a[_0x92e9('0x1c')]=_0xe4cf1c;if(_0xaca1c1[_0x92e9('0x2d')]['includeAll']){_0x535797[_0x92e9('0x3b')]=[{'all':!![]}];}return db[_0x92e9('0x29')][_0x92e9('0x3c')](_0x535797);})[_0x92e9('0x22')](function(_0x374d3b){_0x58699a['rows']=_0x374d3b;return _0x58699a;})[_0x92e9('0x22')](respondWithFilteredResult(_0x2be23d,_0x535797))[_0x92e9('0x3d')](handleError(_0x2be23d,null));};exports[_0x92e9('0x3e')]=function(_0x16785d,_0x5898f1){var _0x13afed={'raw':!![],'where':{'id':_0x16785d[_0x92e9('0x3f')]['id']}},_0x371241={};_0x371241['model']=_['keys'](db[_0x92e9('0x29')]['rawAttributes']);_0x371241[_0x92e9('0x2d')]=_['keys'](_0x16785d[_0x92e9('0x2d')]);_0x371241['filters']=_[_0x92e9('0x2f')](_0x371241[_0x92e9('0x2c')],_0x371241[_0x92e9('0x2d')]);_0x13afed[_0x92e9('0x30')]=_[_0x92e9('0x2f')](_0x371241[_0x92e9('0x2c')],qs[_0x92e9('0x31')](_0x16785d['query']['fields']));_0x13afed[_0x92e9('0x30')]=_0x13afed[_0x92e9('0x30')][_0x92e9('0x32')]?_0x13afed[_0x92e9('0x30')]:_0x371241[_0x92e9('0x2c')];if(_0x16785d[_0x92e9('0x2d')][_0x92e9('0x40')]){_0x13afed[_0x92e9('0x3b')]=[{'all':!![]}];}_0x13afed=_[_0x92e9('0x38')]({},_0x13afed,_0x16785d[_0x92e9('0x41')]);return db[_0x92e9('0x29')]['find'](_0x13afed)[_0x92e9('0x22')](handleEntityNotFound(_0x5898f1,null))[_0x92e9('0x22')](respondWithResult(_0x5898f1,null))[_0x92e9('0x3d')](handleError(_0x5898f1,null));};exports[_0x92e9('0x42')]=function(_0x2f0bf3,_0x3b7c80){return db['SmsApplication']['create'](_0x2f0bf3['body'],{})[_0x92e9('0x22')](respondWithResult(_0x3b7c80,0xc9))[_0x92e9('0x3d')](handleError(_0x3b7c80,null));};exports[_0x92e9('0x21')]=function(_0x68a927,_0xc98aea){if(_0x68a927[_0x92e9('0x43')]['id']){delete _0x68a927[_0x92e9('0x43')]['id'];}return db[_0x92e9('0x29')][_0x92e9('0x44')]({'where':{'id':_0x68a927['params']['id']}})[_0x92e9('0x22')](handleEntityNotFound(_0xc98aea,null))[_0x92e9('0x22')](saveUpdates(_0x68a927['body'],null))['then'](respondWithResult(_0xc98aea,null))['catch'](handleError(_0xc98aea,null));};exports[_0x92e9('0x45')]=function(_0x365954,_0x56ff74){return db['SmsApplication'][_0x92e9('0x44')]({'where':{'id':_0x365954['params']['id']}})[_0x92e9('0x22')](handleEntityNotFound(_0x56ff74,null))[_0x92e9('0x22')](removeEntity(_0x56ff74,null))[_0x92e9('0x3d')](handleError(_0x56ff74,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e88bdaa..3ebc27b 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 _0xfef5=['./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2c437b,_0x10e4d6){var _0x1214cb=function(_0x232004){while(--_0x232004){_0x2c437b['push'](_0x2c437b['shift']());}};_0x1214cb(++_0x10e4d6);}(_0xfef5,0x6d));var _0x5fef=function(_0x9d0ca0,_0x534e5f){_0x9d0ca0=_0x9d0ca0-0x0;var _0x61f8bf=_0xfef5[_0x9d0ca0];return _0x61f8bf;};'use strict';var _=require(_0x5fef('0x0'));var util=require('util');var logger=require(_0x5fef('0x1'))(_0x5fef('0x2'));var moment=require(_0x5fef('0x3'));var BPromise=require(_0x5fef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fef('0x5'));var rimraf=require(_0x5fef('0x6'));var config=require(_0x5fef('0x7'));var attributes=require(_0x5fef('0x8'));module[_0x5fef('0x9')]=function(_0x3f1d5c,_0x2a2ad5){return _0x3f1d5c['define']('SmsApplication',attributes,{'tableName':_0x5fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5fef('0xb'),'collate':_0x5fef('0xc')});}; \ No newline at end of file +var _0x28dd=['bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x502601,_0x283559){var _0xfa0fe2=function(_0x26df89){while(--_0x26df89){_0x502601['push'](_0x502601['shift']());}};_0xfa0fe2(++_0x283559);}(_0x28dd,0x15c));var _0xd28d=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0x28dd[_0x1a5eb0];return _0x30f9ba;};'use strict';var _=require(_0xd28d('0x0'));var util=require(_0xd28d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd28d('0x2'));var BPromise=require(_0xd28d('0x3'));var rp=require(_0xd28d('0x4'));var fs=require('fs');var path=require(_0xd28d('0x5'));var rimraf=require('rimraf');var config=require(_0xd28d('0x6'));var attributes=require(_0xd28d('0x7'));module[_0xd28d('0x8')]=function(_0x1efa00,_0x51e6c9){return _0x1efa00[_0xd28d('0x9')](_0xd28d('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd28d('0xb'),'collate':_0xd28d('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0c063e1..2cbebce 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 _0x42f4=['jayson/promise','http','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x57a3c6,_0x3da7be){var _0x311fa6=function(_0x1ef42b){while(--_0x1ef42b){_0x57a3c6['push'](_0x57a3c6['shift']());}};_0x311fa6(++_0x3da7be);}(_0x42f4,0x19d));var _0x442f=function(_0x388b47,_0x5cdac5){_0x388b47=_0x388b47-0x0;var _0x4859df=_0x42f4[_0x388b47];return _0x4859df;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('SmsApplication,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});} \ No newline at end of file +var _0x5242=['stringify','error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x275951,_0x24de53){var _0x24f26e=function(_0x1b093c){while(--_0x1b093c){_0x275951['push'](_0x275951['shift']());}};_0x24f26e(++_0x24de53);}(_0x5242,0x148));var _0x2524=function(_0x33a324,_0x47bdff){_0x33a324=_0x33a324-0x0;var _0x1d406d=_0x5242[_0x33a324];return _0x1d406d;};'use strict';var _=require(_0x2524('0x0'));var util=require(_0x2524('0x1'));var moment=require(_0x2524('0x2'));var BPromise=require(_0x2524('0x3'));var rs=require(_0x2524('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2524('0x5'))['db'];var utils=require(_0x2524('0x6'));var logger=require(_0x2524('0x7'))(_0x2524('0x8'));var config=require(_0x2524('0x9'));var jayson=require(_0x2524('0xa'));var client=jayson[_0x2524('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b070c,_0x1eca6b,_0x91975b){return new BPromise(function(_0x9f927c,_0x5729dd){return client['request'](_0x2b070c,_0x91975b)[_0x2524('0xc')](function(_0x2ecd8f){logger[_0x2524('0xd')]('SmsApplication,\x20%s,\x20%s',_0x1eca6b,_0x2524('0xe'));logger[_0x2524('0xf')](_0x2524('0x10'),_0x1eca6b,_0x2524('0xe'),JSON[_0x2524('0x11')](_0x2ecd8f));if(_0x2ecd8f[_0x2524('0x12')]){if(_0x2ecd8f[_0x2524('0x12')]['code']===0x1f4){logger['error'](_0x2524('0x13'),_0x1eca6b,_0x2ecd8f[_0x2524('0x12')][_0x2524('0x14')]);return _0x5729dd(_0x2ecd8f[_0x2524('0x12')][_0x2524('0x14')]);}logger[_0x2524('0x12')](_0x2524('0x13'),_0x1eca6b,_0x2ecd8f[_0x2524('0x12')][_0x2524('0x14')]);return _0x9f927c(_0x2ecd8f[_0x2524('0x12')][_0x2524('0x14')]);}else{logger[_0x2524('0xd')](_0x2524('0x13'),_0x1eca6b,_0x2524('0xe'));_0x9f927c(_0x2ecd8f[_0x2524('0x15')][_0x2524('0x14')]);}})[_0x2524('0x16')](function(_0x14c347){logger[_0x2524('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1eca6b,_0x14c347);_0x5729dd(_0x14c347);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 35003cb..776773b 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 _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0x3e4e06,_0x577430){var _0x58e857=function(_0x19dc70){while(--_0x19dc70){_0x3e4e06['push'](_0x3e4e06['shift']());}};_0x58e857(++_0x577430);}(_0x80ed,0x11c));var _0xd80e=function(_0x11dbea,_0x4ed570){_0x11dbea=_0x11dbea-0x0;var _0x5b21c6=_0x80ed[_0x11dbea];return _0x5b21c6;};'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 fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0x5853a2,_0x2e8e4e){_0x5853a2=_0x5853a2-0x0;var _0x2c8b33=_0x757a[_0x5853a2];return _0x2c8b33;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e396cac..900897b 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 _0x9206=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9206,0x176));var _0x6920=function(_0x34a10b,_0x463918){_0x34a10b=_0x34a10b-0x0;var _0x7f8dda=_0x9206[_0x34a10b];return _0x7f8dda;};'use strict';var Sequelize=require(_0x6920('0x0'));var moment=require(_0x6920('0x1'));module[_0x6920('0x2')]={'closed':{'type':Sequelize[_0x6920('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6920('0x4')]},'disposition':{'type':Sequelize[_0x6920('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6920('0x5')]},'phone':{'type':Sequelize[_0x6920('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6920('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6920('0x7')]('in',_0x6920('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6920('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xce22=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x555f0b,_0x402421){var _0xfc1bae=function(_0x427321){while(--_0x427321){_0x555f0b['push'](_0x555f0b['shift']());}};_0xfc1bae(++_0x402421);}(_0xce22,0xea));var _0x2ce2=function(_0x29e327,_0x2b6ea9){_0x29e327=_0x29e327-0x0;var _0x3dac9e=_0xce22[_0x29e327];return _0x3dac9e;};'use strict';var Sequelize=require(_0x2ce2('0x0'));var moment=require(_0x2ce2('0x1'));module[_0x2ce2('0x2')]={'closed':{'type':Sequelize[_0x2ce2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2ce2('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2ce2('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2ce2('0x5')]},'phone':{'type':Sequelize[_0x2ce2('0x5')]},'read1stAt':{'type':Sequelize[_0x2ce2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2ce2('0x6')]('in',_0x2ce2('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2ce2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2ce2('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2ce2('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index a92ae81..eedd57a 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 _0x8192=['buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','agent','i.SmsAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','keys','includeAll','include','merge','create','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','pick','SmsInteractionId','format','options','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','CmContact','lastName','Messages','direction','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','System','firstName','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','send','Users','map','TagIds','Tags','split','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0x8192,0x82));var _0x2819=function(_0x27dd49,_0x47ffd1){_0x27dd49=_0x27dd49-0x0;var _0x10ddeb=_0x8192[_0x27dd49];return _0x10ddeb;};'use strict';var emlformat=require(_0x2819('0x0'));var rimraf=require(_0x2819('0x1'));var zipdir=require(_0x2819('0x2'));var jsonpatch=require(_0x2819('0x3'));var rp=require(_0x2819('0x4'));var moment=require('moment');var BPromise=require(_0x2819('0x5'));var Mustache=require(_0x2819('0x6'));var util=require(_0x2819('0x7'));var path=require(_0x2819('0x8'));var sox=require(_0x2819('0x9'));var csv=require(_0x2819('0xa'));var ejs=require(_0x2819('0xb'));var fs=require('fs');var fs_extra=require(_0x2819('0xc'));var _=require('lodash');var squel=require(_0x2819('0xd'));var crypto=require(_0x2819('0xe'));var jsforce=require(_0x2819('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2819('0x10'));var Papa=require(_0x2819('0x11'));var Redis=require(_0x2819('0x12'));var authService=require(_0x2819('0x13'));var qs=require(_0x2819('0x14'));var as=require(_0x2819('0x15'));var pdf=require(_0x2819('0x16'));var hardwareService=require(_0x2819('0x17'));var logger=require(_0x2819('0x18'))(_0x2819('0x19'));var utils=require(_0x2819('0x1a'));var config=require(_0x2819('0x1b'));var licenseUtil=require(_0x2819('0x1c'));var db=require(_0x2819('0x1d'))['db'];config[_0x2819('0x1e')]=_[_0x2819('0x1f')](config['redis'],{'host':_0x2819('0x20'),'port':0x18eb});var socket=require(_0x2819('0x21'))(new Redis(config[_0x2819('0x1e')]));require(_0x2819('0x22'))['register'](socket);function respondWithStatusCode(_0x28ada4,_0xc88a35){_0xc88a35=_0xc88a35||0xcc;return function(_0x2ab9e7){if(_0x2ab9e7){return _0x28ada4['sendStatus'](_0xc88a35);}return _0x28ada4[_0x2819('0x23')](_0xc88a35)['end']();};}function respondWithResult(_0x168a57,_0x3920f2){_0x3920f2=_0x3920f2||0xc8;return function(_0x3a731e){if(_0x3a731e){return _0x168a57[_0x2819('0x23')](_0x3920f2)[_0x2819('0x24')](_0x3a731e);}};}function respondWithFilteredResult(_0x1a4384,_0x2673d3){return function(_0xe8bf50){if(_0xe8bf50){var _0x3e55b2=typeof _0x2673d3[_0x2819('0x25')]===_0x2819('0x26')&&typeof _0x2673d3[_0x2819('0x27')]===_0x2819('0x26');var _0x454059=_0xe8bf50[_0x2819('0x28')];var _0x3c2906=_0x3e55b2?0x0:_0x2673d3[_0x2819('0x25')];var _0x5b94fc=_0x3e55b2?_0xe8bf50[_0x2819('0x28')]:_0x2673d3[_0x2819('0x25')]+_0x2673d3[_0x2819('0x27')];var _0x984c09;if(_0x5b94fc>=_0x454059){_0x5b94fc=_0x454059;_0x984c09=0xc8;}else{_0x984c09=0xce;}_0x1a4384['status'](_0x984c09);return _0x1a4384[_0x2819('0x29')]('Content-Range',_0x3c2906+'-'+_0x5b94fc+'/'+_0x454059)[_0x2819('0x24')](_0xe8bf50);}return null;};}function patchUpdates(_0x6b289){return function(_0x2cd10b){try{jsonpatch[_0x2819('0x2a')](_0x2cd10b,_0x6b289,!![]);}catch(_0x163a6a){return BPromise[_0x2819('0x2b')](_0x163a6a);}return _0x2cd10b[_0x2819('0x2c')]();};}function saveUpdates(_0x4a2608,_0x4a2d47){return function(_0x399c2c){if(_0x399c2c){return _0x399c2c[_0x2819('0x2d')](_0x4a2608)[_0x2819('0x2e')](function(_0x242f8e){return _0x242f8e;});}return null;};}function removeEntity(_0x415695,_0x55bbac){return function(_0x1be98c){if(_0x1be98c){return _0x1be98c[_0x2819('0x2f')]()[_0x2819('0x2e')](function(){_0x415695[_0x2819('0x23')](0xcc)[_0x2819('0x30')]();});}};}function handleEntityNotFound(_0x4a811a,_0x2d4182){return function(_0x52b706){if(!_0x52b706){_0x4a811a[_0x2819('0x31')](0x194);}return _0x52b706;};}function handleError(_0x37cd96,_0x5a6c84){_0x5a6c84=_0x5a6c84||0x1f4;return function(_0x4df929){logger[_0x2819('0x32')](_0x4df929['stack']);if(_0x4df929['name']){delete _0x4df929['name'];}_0x37cd96['status'](_0x5a6c84)[_0x2819('0x33')](_0x4df929);};}function getInteractionUsers(_0x541c14,_0x33c1d9){return new BPromise(function(_0x16573e,_0x241a59){try{if(_0x33c1d9[_0x541c14['id']]){_0x541c14[_0x2819('0x34')]=_[_0x2819('0x35')](_0x33c1d9[_0x541c14['id']],function(_0x4ba395){return{'id':_0x4ba395['id'],'fullname':_0x4ba395['fullname']};});}}catch(_0x54271e){_0x241a59(_0x54271e);}_0x16573e(_0x541c14);});}function getInteractionTags(_0x994a05,_0x2d241f){return new BPromise(function(_0x21d6c3,_0x138ef4){try{if(_0x994a05[_0x2819('0x36')]){_0x994a05[_0x2819('0x37')]=[];_0x994a05['TagIds'][_0x2819('0x38')](',')[_0x2819('0x39')](function(_0x2d4139){_0x994a05[_0x2819('0x37')]['push'](_0x2d241f[_0x2d4139]);});}delete _0x994a05[_0x2819('0x36')];}catch(_0x211881){_0x138ef4(_0x211881);}_0x21d6c3(_0x994a05);});}function updateSmsInteraction(_0x2fb244,_0x11a51f,_0x2d57ca){return new BPromise(function(_0x35869f,_0x3b2c94){return getInteractionUsers(_0x2fb244,_0x2d57ca)[_0x2819('0x2e')](function(_0x5725b4){return getInteractionTags(_0x5725b4,_0x11a51f);})[_0x2819('0x2e')](function(_0x34423c){_0x35869f(_0x34423c);})[_0x2819('0x3a')](function(_0x547cd1){_0x3b2c94(_0x547cd1);});});}exports[_0x2819('0x3b')]=function(_0x26d7b3,_0x22bec3){var _0x377c58={},_0x3d4c90={},_0x379a02={'count':0x0,'rows':[]};var _0x1871e6=_['map'](db[_0x2819('0x3c')][_0x2819('0x3d')],function(_0x4af7b4){return{'name':_0x4af7b4[_0x2819('0x3e')],'type':_0x4af7b4[_0x2819('0x3f')][_0x2819('0x40')]};});_0x3d4c90[_0x2819('0x41')]=_[_0x2819('0x35')](_0x1871e6,_0x2819('0x42'));_0x3d4c90[_0x2819('0x43')]=_['keys'](_0x26d7b3[_0x2819('0x43')]);_0x3d4c90[_0x2819('0x44')]=_['intersection'](_0x3d4c90[_0x2819('0x41')],_0x3d4c90['query']);_0x377c58[_0x2819('0x45')]=_[_0x2819('0x46')](_0x3d4c90[_0x2819('0x41')],qs[_0x2819('0x47')](_0x26d7b3[_0x2819('0x43')]['fields']));_0x377c58['attributes']=_0x377c58[_0x2819('0x45')][_0x2819('0x48')]?_0x377c58[_0x2819('0x45')]:_0x3d4c90['model'];if(!_0x26d7b3[_0x2819('0x43')][_0x2819('0x49')](_0x2819('0x4a'))){_0x377c58[_0x2819('0x27')]=qs['limit'](_0x26d7b3[_0x2819('0x43')][_0x2819('0x27')]);_0x377c58[_0x2819('0x25')]=qs[_0x2819('0x25')](_0x26d7b3[_0x2819('0x43')][_0x2819('0x25')]);}_0x377c58[_0x2819('0x4b')]=qs[_0x2819('0x4c')](_0x26d7b3[_0x2819('0x43')][_0x2819('0x4c')]);_0x377c58[_0x2819('0x4d')]=qs['filters'](_['pick'](_0x26d7b3['query'],_0x3d4c90[_0x2819('0x44')]),_0x1871e6);var _0x3da85c=[];var _0x30a40d=squel[_0x2819('0x4e')]()[_0x2819('0x4f')]('id')['field']('name')[_0x2819('0x4f')](_0x2819('0x50'))['from'](_0x2819('0x51'));var _0x127a69=squel[_0x2819('0x4e')]()[_0x2819('0x4f')](_0x2819('0x52'))[_0x2819('0x4f')](_0x2819('0x53'))[_0x2819('0x4f')](_0x2819('0x54'))[_0x2819('0x55')](_0x2819('0x56'),'ui')[_0x2819('0x57')](_0x2819('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x37689d=squel[_0x2819('0x4e')]()[_0x2819('0x55')](_0x2819('0x59'),'i')[_0x2819('0x57')](_0x2819('0x5a'),'c',_0x2819('0x5b'))[_0x2819('0x57')](_0x2819('0x58'),'o','o.id\x20=\x20i.UserId')[_0x2819('0x57')](_0x2819('0x5c'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x2819('0x5d'),'me',_0x2819('0x5e'))[_0x2819('0x57')](_0x2819('0x5f'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x2819('0x57')](_0x2819('0x51'),'t','t.id\x20=\x20it.TagId');var _0x556f8d=squel[_0x2819('0x60')]();var _0x5edd95=[];var _0xe8be32=squel[_0x2819('0x60')]();var _0x3bb153;if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x61')]){_0x3bb153=as['parseSearch'](_0x26d7b3[_0x2819('0x43')][_0x2819('0x61')]);var _0x4877ae=_0x3bb153[_0x2819('0x62')];for(var _0x121e52=0x0;_0x121e52<_0x3bb153['conditions'][_0x2819('0x48')];_0x121e52++){var _0x239d58=_0x3bb153[_0x2819('0x63')][_0x121e52];var _0x55c840='i';var _0x163248=_['find'](_0x1871e6,[_0x2819('0x42'),_0x239d58[_0x2819('0x4f')]]);if(!_0x163248){switch(_0x239d58[_0x2819('0x4f')]){case _0x2819('0x64'):if(_0x239d58[_0x2819('0x65')]==0x1){_0x37689d[_0x2819('0x66')]('`'+_0x239d58[_0x2819('0x4f')]+_0x2819('0x67'));}else{_0x37689d[_0x2819('0x66')]('`'+_0x239d58[_0x2819('0x4f')]+_0x2819('0x68'));}break;case _0x2819('0x69'):if(_0x239d58['operator']===_0x2819('0x6a')){if(_0x239d58[_0x2819('0x65')][_0x2819('0x38')]('\x20')[_0x2819('0x48')]>0x1){_0x556f8d[_0x4877ae](_0x2819('0x6b'),qs[_0x2819('0x6c')](_0x239d58[_0x2819('0x65')]),null);}else{var _0x38fae9='%'+_0x239d58[_0x2819('0x65')]+'%';_0x556f8d[_0x4877ae](_0x2819('0x6d'),_0x38fae9,_0x38fae9,_0x38fae9);}}else{_0x163248=_['find'](_0x1871e6,['name',_0x2819('0x6e')]);_0x239d58[_0x2819('0x4f')]=_0x2819('0x6e');_0x1450fa=as[_0x2819('0x6f')](_0x55c840,_0x163248[_0x2819('0x3f')],_0x239d58);_0x556f8d[_0x4877ae](_0x1450fa[_0x2819('0x70')],_0x1450fa[_0x2819('0x65')][_0x2819('0x71')],_0x1450fa[_0x2819('0x65')][_0x2819('0x30')]);}break;case _0x2819('0x72'):var _0x85ae69=_0x239d58[_0x2819('0x65')][_0x2819('0x38')](',')[_0x2819('0x35')](function(_0x98a685){return Number(_0x98a685);});_0x85ae69[_0x2819('0x39')](function(_0x29684e){_0xe8be32['or'](_0x2819('0x73'),'%,'+_0x29684e+',%');});_0x5edd95=_['union'](_0x5edd95,_0x85ae69);break;case _0x2819('0x74'):if(_0x239d58['operator']===_0x2819('0x6a')){_0x556f8d[_0x4877ae](_0x2819('0x75'),'%'+_0x239d58['value']+'%',null);}else{_0x163248=_[_0x2819('0x76')](_0x1871e6,[_0x2819('0x42'),_0x2819('0x77')]);_0x239d58['field']=_0x2819('0x77');_0x1450fa=as[_0x2819('0x6f')](_0x55c840,_0x163248[_0x2819('0x3f')],_0x239d58);_0x556f8d[_0x4877ae](_0x1450fa[_0x2819('0x70')],_0x1450fa[_0x2819('0x65')][_0x2819('0x71')],_0x1450fa[_0x2819('0x65')][_0x2819('0x30')]);}break;case _0x2819('0x78'):_0x1450fa=as[_0x2819('0x6f')]('me',null,_0x239d58);_0x556f8d[_0x4877ae](_0x1450fa['text'],_0x1450fa[_0x2819('0x65')]['start'],_0x1450fa['value'][_0x2819('0x30')]);break;}}else{var _0x1450fa=as[_0x2819('0x6f')](_0x55c840,_0x163248['type'],_0x239d58);_0x556f8d[_0x4877ae](_0x1450fa[_0x2819('0x70')],_0x1450fa['value']['start'],_0x1450fa['value'][_0x2819('0x30')]);}}}else{var _0x5b03ca=_(_0x26d7b3[_0x2819('0x43')])['keys']()[_0x2819('0x35')](function(_0xd5e8b9){return _[_0x2819('0x79')](_0x1871e6,['name',_0xd5e8b9])?_0xd5e8b9:undefined;})[_0x2819('0x7a')]()[_0x2819('0x65')]();if(!_[_0x2819('0x7b')](_0x5b03ca)){_0x5b03ca[_0x2819('0x39')](function(_0x57a745){if(_0x57a745===_0x2819('0x7c')){_0x37689d['where'](_0x2819('0x7d'),[][_0x2819('0x7e')](_0x26d7b3[_0x2819('0x43')][_0x57a745]));}else if(_0x57a745===_0x2819('0x7f')){var _0x29e793=JSON[_0x2819('0x80')](_0x26d7b3['query'][_0x57a745])[_0x2819('0x81')];var _0x3b7dcd=JSON[_0x2819('0x80')](_0x26d7b3[_0x2819('0x43')][_0x57a745])[_0x2819('0x82')];_0x37689d['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x29e793,_0x3b7dcd);}else{if(_0x26d7b3['query'][_0x57a745]===_0x2819('0x83')){_0x37689d['where']('i.'+_0x57a745+_0x2819('0x84'));}else{_0x37689d[_0x2819('0x4d')]('i.'+_0x57a745+_0x2819('0x85'),_0x26d7b3['query'][_0x57a745]);}}});}if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x86')]){if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x86')]==0x1){_0x37689d['having']('`unreadMessages`\x20=\x200');}else{_0x37689d[_0x2819('0x66')](_0x2819('0x87'));}}if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x88')]){_0x5edd95=_[_0x2819('0x89')](_0x26d7b3[_0x2819('0x43')][_0x2819('0x88')])?_0x26d7b3[_0x2819('0x43')][_0x2819('0x88')]:new Array(_0x26d7b3[_0x2819('0x43')][_0x2819('0x88')]);_0x5edd95[_0x2819('0x39')](function(_0xfdc5b){_0xe8be32['or'](_0x2819('0x73'),'%,'+_0xfdc5b+',%');});}if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x8a')]){var _0x5dfaa6=_0x26d7b3[_0x2819('0x43')][_0x2819('0x8a')][_0x2819('0x8b')]('\x5c','\x5c\x5c')[_0x2819('0x8b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5dfaa6)){_0x556f8d['or'](_0x2819('0x8c'),_0x5dfaa6+'%')['or']('i.phone\x20LIKE\x20?',_0x5dfaa6+'%');}else{_0x556f8d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2819('0x6c')](_0x5dfaa6))['or'](_0x2819('0x8d'),_0x5dfaa6+'%');}}}_0x37689d[_0x2819('0x4d')](_0x556f8d);_0x37689d[_0x2819('0x8e')](_0x2819('0x8f'));var _0x203bcc={'type':db[_0x2819('0x90')]['QueryTypes'][_0x2819('0x91')],'raw':!![]};var _0x8dbfa4=_0x37689d[_0x2819('0x92')]();_0x8dbfa4[_0x2819('0x4f')](_0x2819('0x8f'));_0x8dbfa4[_0x2819('0x4f')](_0x2819('0x93'),_0x2819('0x64'));if(_0x377c58[_0x2819('0x4b')]){_0x377c58[_0x2819('0x4b')][_0x2819('0x39')](function(_0x557cc0){var _0x52f10f=_0x557cc0[0x0]==='contactName'?_0x557cc0[0x0]:'i.'+_0x557cc0[0x0];_0x37689d['order'](_0x52f10f,_0x557cc0[0x1]===_0x2819('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x5edd95)){_0x37689d['having'](_0xe8be32);_0x8dbfa4[_0x2819('0x4d')](_0x2819('0x95'),_0x5edd95);}BPromise[_0x2819('0x96')]()['then'](function(){if(!_0x3bb153){if(_0x26d7b3['query'][_0x2819('0x7c')])return;_0x8dbfa4[_0x2819('0x4d')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x37689d['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x26d7b3[_0x2819('0x97')]['role']!==_0x2819('0x98'))return;return _0x26d7b3[_0x2819('0x97')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3f89b4){if(_[_0x2819('0x7b')](_0x3f89b4)){_0x8dbfa4['where']('i.SmsAccountId\x20IS\x20NULL');_0x37689d[_0x2819('0x4d')](_0x2819('0x99'));}else{_0x8dbfa4['where'](_0x2819('0x7d'),_[_0x2819('0x35')](_0x3f89b4,'id'));_0x37689d[_0x2819('0x4d')](_0x2819('0x7d'),_[_0x2819('0x35')](_0x3f89b4,'id'));}});})[_0x2819('0x2e')](function(){if(_0x26d7b3['user'][_0x2819('0x9a')]===_0x2819('0x98')&&!_0x3bb153&&!_0x26d7b3[_0x2819('0x43')]['SmsAccountId'])return[];return db['sequelize'][_0x2819('0x43')](_0x8dbfa4[_0x2819('0x9b')](),_0x203bcc);})[_0x2819('0x2e')](function(_0x4b5379){_0x379a02[_0x2819('0x28')]=_0x4b5379[_0x2819('0x48')];if(_0x379a02[_0x2819('0x28')]===0x0)return[];return db[_0x2819('0x9c')][_0x2819('0x43')](_0x30a40d['toString'](),_0x203bcc)['then'](function(_0x2d17b4){_0x3da85c=_[_0x2819('0x9d')](_0x2d17b4,'id');_0x203bcc=_['merge'](_0x203bcc,{'model':db[_0x2819('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x26d7b3[_0x2819('0x43')][_0x2819('0x47')]){_0x377c58['attributes']['forEach'](function(_0x252632){_0x37689d[_0x2819('0x4f')]('i.'+_0x252632);});}else{_0x37689d[_0x2819('0x4f')](_0x2819('0x93'),_0x2819('0x64'));_0x37689d['field']('a.key',_0x2819('0x9e'));_0x37689d[_0x2819('0x4f')](_0x2819('0x9f'),'Account.mandatoryDisposition');_0x37689d[_0x2819('0x4f')](_0x2819('0xa0'),_0x2819('0xa1'));_0x37689d['field']('i.*');_0x37689d[_0x2819('0x4f')]('c.firstName','Contact.firstName');_0x37689d[_0x2819('0x4f')](_0x2819('0xa2'),_0x2819('0xa3'));_0x37689d[_0x2819('0x4f')](_0x2819('0xa4'),_0x2819('0xa5'));_0x37689d[_0x2819('0x4f')](_0x2819('0xa6'),_0x2819('0xa7'));_0x37689d[_0x2819('0x4f')](_0x2819('0xa8'),'Contact.mobile');_0x37689d['field']('c.fax',_0x2819('0xa9'));_0x37689d[_0x2819('0x4f')](_0x2819('0xaa'),_0x2819('0xab'));_0x37689d[_0x2819('0x4f')](_0x2819('0xac'),_0x2819('0xad'));_0x37689d[_0x2819('0x4f')](_0x2819('0xae'),_0x2819('0x36'));}if(_0x377c58[_0x2819('0x27')])_0x37689d['limit'](_0x377c58[_0x2819('0x27')]);if(_0x377c58['offset'])_0x37689d[_0x2819('0x25')](_0x377c58[_0x2819('0x25')]);return db['sequelize'][_0x2819('0x43')](_0x37689d['toString'](),_0x203bcc);})[_0x2819('0x2e')](function(_0x5083cc){if(_0x5083cc[_0x2819('0x48')]>0x0)_0x127a69[_0x2819('0x4d')](_0x2819('0xaf'),_[_0x2819('0x35')](_0x5083cc,'id'));return db[_0x2819('0x9c')][_0x2819('0x43')](_0x127a69[_0x2819('0x9b')](),_0x203bcc)[_0x2819('0x2e')](function(_0x49e44c){var _0x95709d=_[_0x2819('0xb0')](_0x49e44c,'SmsInteractionId');var _0x598c38=[];_0x5083cc[_0x2819('0x39')](function(_0x8b0381){_0x598c38['push'](updateSmsInteraction(_0x8b0381,_0x3da85c,_0x95709d));});return BPromise[_0x2819('0xb1')](_0x598c38);});});})[_0x2819('0x2e')](function(_0x9b1f19){_0x379a02[_0x2819('0xb2')]=_0x9b1f19;return _0x379a02;})['then'](respondWithFilteredResult(_0x22bec3,_0x377c58))['catch'](handleError(_0x22bec3,null));};exports[_0x2819('0xb3')]=function(_0x3937a2,_0x300708){var _0x38ccb9={'raw':![],'where':{'id':_0x3937a2[_0x2819('0xb4')]['id']}},_0x328dc5={};_0x328dc5[_0x2819('0x41')]=_[_0x2819('0xb5')](db[_0x2819('0x3c')][_0x2819('0x3d')]);_0x328dc5['query']=_[_0x2819('0xb5')](_0x3937a2[_0x2819('0x43')]);_0x328dc5[_0x2819('0x44')]=_[_0x2819('0x46')](_0x328dc5[_0x2819('0x41')],_0x328dc5[_0x2819('0x43')]);_0x38ccb9[_0x2819('0x45')]=_[_0x2819('0x46')](_0x328dc5[_0x2819('0x41')],qs[_0x2819('0x47')](_0x3937a2[_0x2819('0x43')][_0x2819('0x47')]));_0x38ccb9[_0x2819('0x45')]=_0x38ccb9[_0x2819('0x45')][_0x2819('0x48')]?_0x38ccb9[_0x2819('0x45')]:_0x328dc5[_0x2819('0x41')];if(_0x3937a2[_0x2819('0x43')][_0x2819('0xb6')]){_0x38ccb9[_0x2819('0xb7')]=[{'all':!![]}];}_0x38ccb9=_[_0x2819('0xb8')]({},_0x38ccb9,_0x3937a2['options']);return db[_0x2819('0x3c')]['find'](_0x38ccb9)[_0x2819('0x2e')](handleEntityNotFound(_0x300708,null))['then'](respondWithResult(_0x300708,null))[_0x2819('0x3a')](handleError(_0x300708,null));};exports[_0x2819('0xb9')]=function(_0x12bb60,_0x33ca2d){return db['SmsInteraction']['create'](_0x12bb60[_0x2819('0x78')],{})[_0x2819('0x2e')](respondWithResult(_0x33ca2d,0xc9))[_0x2819('0x3a')](handleError(_0x33ca2d,null));};exports['update']=function(_0x4e4282,_0x15cc2b){if(_0x4e4282[_0x2819('0x78')]['id']){delete _0x4e4282[_0x2819('0x78')]['id'];}return db['SmsInteraction'][_0x2819('0x76')]({'where':{'id':_0x4e4282[_0x2819('0xb4')]['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x15cc2b,null))[_0x2819('0x2e')](saveUpdates(_0x4e4282[_0x2819('0x78')],null))[_0x2819('0x2e')](respondWithResult(_0x15cc2b,null))['catch'](handleError(_0x15cc2b,null));};exports['destroy']=function(_0x4d007b,_0x4212b8){return db['SmsInteraction'][_0x2819('0x76')]({'where':{'id':_0x4d007b[_0x2819('0xb4')]['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x4212b8,null))[_0x2819('0x2e')](removeEntity(_0x4212b8,null))[_0x2819('0x3a')](handleError(_0x4212b8,null));};exports[_0x2819('0xba')]=function(_0x2ee62b,_0x5badcd){return db[_0x2819('0x3c')][_0x2819('0xba')]()['then'](respondWithResult(_0x5badcd,null))['catch'](handleError(_0x5badcd,null));};exports['addMessage']=function(_0x50bde1,_0x13ccc5,_0x216eb9){return db[_0x2819('0xbb')]['find']({'where':{'id':_0x50bde1[_0x2819('0xb4')]['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x13ccc5,null))[_0x2819('0x2e')](function(_0x5b92b3){if(_0x5b92b3){return _0x5b92b3[_0x2819('0xbc')](_0x50bde1[_0x2819('0x78')]['ids'],_[_0x2819('0xbd')](_0x50bde1[_0x2819('0x78')],[_0x2819('0xbe'),'id'])||{});}})[_0x2819('0x2e')](respondWithResult(_0x13ccc5,null))[_0x2819('0x3a')](handleError(_0x13ccc5,null));};exports[_0x2819('0xbf')]=function(_0x102032,_0x51bedb,_0x200306){var _0x5b95db={'raw':![],'where':{}};var _0x1d641c={};var _0x1a1ac2={'count':0x0,'rows':[]};return db[_0x2819('0x3c')][_0x2819('0xc0')]({'where':{'id':_0x102032[_0x2819('0xb4')]['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x51bedb,null))[_0x2819('0x2e')](function(_0xf127f2){if(_0xf127f2){_0x1d641c[_0x2819('0x41')]=_[_0x2819('0xb5')](db['SmsMessage'][_0x2819('0x3d')]);_0x1d641c['query']=_[_0x2819('0xb5')](_0x102032[_0x2819('0x43')]);_0x1d641c['filters']=_[_0x2819('0x46')](_0x1d641c[_0x2819('0x41')],_0x1d641c[_0x2819('0x43')]);_0x5b95db[_0x2819('0x45')]=_[_0x2819('0x46')](_0x1d641c[_0x2819('0x41')],qs['fields'](_0x102032['query'][_0x2819('0x47')]));_0x5b95db[_0x2819('0x45')]=_0x5b95db['attributes'][_0x2819('0x48')]?_0x5b95db['attributes']:_0x1d641c[_0x2819('0x41')];if(!_0x102032[_0x2819('0x43')][_0x2819('0x49')](_0x2819('0x4a'))){_0x5b95db['limit']=qs[_0x2819('0x27')](_0x102032[_0x2819('0x43')][_0x2819('0x27')]);_0x5b95db[_0x2819('0x25')]=qs[_0x2819('0x25')](_0x102032[_0x2819('0x43')]['offset']);}_0x5b95db[_0x2819('0x4b')]=qs[_0x2819('0x4c')](_0x102032[_0x2819('0x43')][_0x2819('0x4c')]);_0x5b95db[_0x2819('0x4d')]=qs[_0x2819('0x44')](_[_0x2819('0xc1')](_0x102032[_0x2819('0x43')],_0x1d641c[_0x2819('0x44')]));_0x5b95db[_0x2819('0x4d')][_0x2819('0xc2')]=_0xf127f2['id'];if(_0x102032[_0x2819('0x43')][_0x2819('0x8a')]){_0x5b95db['where']=_['merge'](_0x5b95db[_0x2819('0x4d')],{'$or':_[_0x2819('0x35')](_0x5b95db['attributes'],function(_0x1c0119){var _0x31cc2b={};_0x31cc2b[_0x1c0119]={'$like':'%'+_0x102032['query'][_0x2819('0x8a')]+'%'};return _0x31cc2b;})});}if(_0x102032[_0x2819('0x43')][_0x2819('0x81')]){var _0x20581d=_0x102032[_0x2819('0x43')]['$gte']['split'](',');var _0x2de58a={};_0x2de58a[_0x20581d[0x0]]={'$gte':moment(_0x20581d[0x1])[_0x2819('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b95db['where']=_[_0x2819('0xb8')](_0x5b95db[_0x2819('0x4d')],_0x2de58a);}_0x5b95db=_[_0x2819('0xb8')]({},_0x5b95db,_0x102032[_0x2819('0xc4')]);return db[_0x2819('0xbb')][_0x2819('0x28')]({'where':_0x5b95db[_0x2819('0x4d')]})['then'](function(_0x5cd095){_0x1a1ac2[_0x2819('0x28')]=_0x5cd095;if(_0x102032[_0x2819('0x43')][_0x2819('0xb6')]){_0x5b95db[_0x2819('0xb7')]=[{'all':!![]}];}return db[_0x2819('0xbb')][_0x2819('0xc5')](_0x5b95db);})[_0x2819('0x2e')](function(_0x4b2c16){_0x1a1ac2['rows']=_0x4b2c16;return _0x1a1ac2;});}})[_0x2819('0x2e')](respondWithFilteredResult(_0x51bedb,_0x5b95db))[_0x2819('0x3a')](handleError(_0x51bedb,null));};exports[_0x2819('0xc6')]=function(_0x2c2daf,_0x3d3a46,_0x276bb0){return db[_0x2819('0x3c')]['find']({'where':{'id':_0x2c2daf['params']['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x3d3a46,null))[_0x2819('0x2e')](function(_0x3622af){if(_0x3622af){return _0x3622af[_0x2819('0xc7')](_0x2c2daf[_0x2819('0x78')][_0x2819('0xbe')],_[_0x2819('0xbd')](_0x2c2daf[_0x2819('0x78')],[_0x2819('0xbe'),'id'])||{})[_0x2819('0xc8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2819('0x42'),_0x2819('0x50')],'where':{'id':_0x2c2daf[_0x2819('0x78')][_0x2819('0xbe')]}});})['then'](function(_0x35613a){socket[_0x2819('0xc9')](_0x2819('0xca'),{'id':Number(_0x2c2daf[_0x2819('0xb4')]['id']),'tags':_0x35613a||[]});return{'id':Number(_0x2c2daf[_0x2819('0xb4')]['id']),'tags':_0x35613a||[]};});}})[_0x2819('0x2e')](respondWithResult(_0x3d3a46,null))['catch'](handleError(_0x3d3a46,null));};exports['removeTags']=function(_0x56b5a1,_0x2cc12c,_0x31bbd3){return db[_0x2819('0x3c')][_0x2819('0x76')]({'where':{'id':_0x56b5a1['params']['id']}})[_0x2819('0x2e')](handleEntityNotFound(_0x2cc12c,null))[_0x2819('0x2e')](function(_0x4fa97f){if(_0x4fa97f){return _0x4fa97f[_0x2819('0xcb')](_0x56b5a1[_0x2819('0x43')]['ids']);}})[_0x2819('0x2e')](respondWithStatusCode(_0x2cc12c,null))[_0x2819('0x3a')](handleError(_0x2cc12c,null));};exports[_0x2819('0xcc')]=function(_0x39cff0,_0x2a0385){var _0x459d4c=moment()['unix']()[_0x2819('0x9b')]();var _0x2352d9=path[_0x2819('0xcd')](config[_0x2819('0xce')],_0x2819('0xcf'),_0x2819('0xd0'),_0x2819('0xd1'));var _0x553831=path[_0x2819('0xcd')](config[_0x2819('0xce')],'server',_0x2819('0xd0'),_0x2819('0xd2'));var _0x4137b7=path['join'](_0x2352d9,_0x459d4c);var _0x2ac4d5=util[_0x2819('0xc3')](_0x2819('0xd3'),_0x39cff0[_0x2819('0xb4')]['id'],_0x459d4c);var _0x58d1d3=path[_0x2819('0xcd')](_0x2352d9,_0x2ac4d5);var _0x43193c=[];_0x43193c[_0x2819('0xd4')]({'model':db[_0x2819('0x74')],'as':_0x2819('0x74'),'attributes':['id','fullname'],'raw':!![]});_0x43193c[_0x2819('0xd4')]({'model':db[_0x2819('0xd5')],'as':_0x2819('0x69'),'attributes':['id','firstName',_0x2819('0xd6')],'raw':!![]});var _0x124945=[{'model':db[_0x2819('0xbb')],'as':_0x2819('0xd7'),'attributes':['id',_0x2819('0x78'),'createdAt',_0x2819('0xd8'),'secret',_0x2819('0x86')],'include':_0x43193c}];_0x124945[_0x2819('0xd4')]({'model':db[_0x2819('0xd9')],'as':_0x2819('0xda'),'attributes':['id',_0x2819('0x42')]});_0x124945[_0x2819('0xd4')]({'model':db[_0x2819('0x74')],'as':_0x2819('0xdb'),'attributes':['id',_0x2819('0xdc')]});return db[_0x2819('0x3c')][_0x2819('0x76')]({'where':{'id':_0x39cff0[_0x2819('0xb4')]['id']},'include':_0x124945})[_0x2819('0x2e')](handleEntityNotFound(_0x2a0385,null))[_0x2819('0x2e')](function(_0xeb0346){if(_0xeb0346){var _0x118243=_0xeb0346[_0x2819('0xdd')]({'plain':!![]});fs[_0x2819('0xde')](_0x4137b7);var _0x2e2265={'channel':'Sms','account':_0x118243[_0x2819('0xda')][_0x2819('0x42')],'agent':_0x118243[_0x2819('0xdb')]?_0x118243['Owner']['fullname']:_0x2819('0xdf'),'createdAt':moment(_0x118243[_0x2819('0x7f')])['format'](_0x2819('0xe0'))['toString'](),'closedAt':_0x118243[_0x2819('0xe1')]?moment(_0x118243[_0x2819('0xe2')])[_0x2819('0xc3')](_0x2819('0xe0'))[_0x2819('0x9b')]():'','disposition':_0x118243[_0x2819('0xe3')],'messages':_(_0x118243[_0x2819('0xd7')])[_0x2819('0x8a')]({'secret':![]})[_0x2819('0x35')](function(_0x389173){return{'date':moment(_0x389173[_0x2819('0x7f')])[_0x2819('0xc3')](_0x2819('0xe0'))[_0x2819('0x9b')](),'sender':_0x389173[_0x2819('0xd8')]===_0x2819('0xe4')?_0x389173[_0x2819('0x74')]?_0x389173[_0x2819('0x74')][_0x2819('0xdc')]:_0x2819('0xe5'):_0x389173['Contact'][_0x2819('0xe6')]+(_0x389173[_0x2819('0x69')][_0x2819('0xd6')]?'\x20'+_0x389173[_0x2819('0x69')][_0x2819('0xd6')]:''),'body':_0x389173[_0x2819('0x78')],'direction':_0x389173[_0x2819('0xd8')]===_0x2819('0xe4')?'A':'C','secret':_0x389173[_0x2819('0xe7')],'read':_0x389173[_0x2819('0x86')]};})[_0x2819('0x65')]()};return ejs[_0x2819('0xe8')](path[_0x2819('0xcd')](config[_0x2819('0xce')],'server','views',_0x2819('0xe9')),{'interaction':_0x2e2265})['then'](function(_0x694138){var _0x6b9250=path[_0x2819('0xcd')](_0x4137b7,_0x2819('0xea')+_0x118243['id']+'-'+_0x459d4c+_0x2819('0xeb'));var _0x2ad21b={'path':_0x6b9250,'channel':_0x2819('0xec'),'interactionId':_0x118243['id']};return pdf[_0x2819('0xed')](_0x694138,_0x2ad21b);})['then'](function(){return new BPromise(function(_0x3ac184,_0x6cbb79){zipdir(_0x4137b7,{'saveTo':_0x58d1d3},function(_0x3de38c,_0x28ea13){if(_0x3de38c)return _0x6cbb79(_0x3de38c);return _0x3ac184(_0x28ea13);});})[_0x2819('0x2e')](function(){return new BPromise(function(_0x511f2c,_0x4566da){rimraf(_0x4137b7,function(_0x3eedcf){if(_0x3eedcf)_0x4566da(_0x3eedcf);return _0x511f2c();});});})[_0x2819('0x2e')](function(){return _0x2a0385[_0x2819('0xcc')](_0x58d1d3,_0x2ac4d5,function(_0x35e67b){if(_0x35e67b){console[_0x2819('0xee')](_0x2819('0xef'),_0x35e67b);}else{fs[_0x2819('0xf0')](_0x58d1d3);}});});});}else{return _0x2a0385[_0x2819('0x31')](0xc8);}})['catch'](handleError(_0x2a0385,null));}; \ No newline at end of file +var _0xab75=['unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','Users','map','TagIds','split','forEach','push','catch','index','SmsInteraction','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','body','keys','some','compact','isEmpty','SmsAccountId','where','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','lastName','Messages','secret','Account','get','mkdirSync','Sms','Owner','N.A.','closed','closedAt','disposition','direction','out','System','transcript-','.pdf','createPdfFromHTML','log'];(function(_0x2828b2,_0x4b2485){var _0x3422b5=function(_0x378320){while(--_0x378320){_0x2828b2['push'](_0x2828b2['shift']());}};_0x3422b5(++_0x4b2485);}(_0xab75,0xe7));var _0x5ab7=function(_0x2d63a9,_0x340028){_0x2d63a9=_0x2d63a9-0x0;var _0x4b3def=_0xab75[_0x2d63a9];return _0x4b3def;};'use strict';var emlformat=require(_0x5ab7('0x0'));var rimraf=require(_0x5ab7('0x1'));var zipdir=require(_0x5ab7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ab7('0x3'));var moment=require(_0x5ab7('0x4'));var BPromise=require(_0x5ab7('0x5'));var Mustache=require('mustache');var util=require(_0x5ab7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5ab7('0x7'));var ejs=require(_0x5ab7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ab7('0x9'));var squel=require(_0x5ab7('0xa'));var crypto=require(_0x5ab7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5ab7('0x7'));var querystring=require('querystring');var Papa=require(_0x5ab7('0xc'));var Redis=require(_0x5ab7('0xd'));var authService=require(_0x5ab7('0xe'));var qs=require(_0x5ab7('0xf'));var as=require(_0x5ab7('0x10'));var pdf=require(_0x5ab7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ab7('0x12'))('api');var utils=require(_0x5ab7('0x13'));var config=require(_0x5ab7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ab7('0x15'))['db'];config[_0x5ab7('0x16')]=_[_0x5ab7('0x17')](config[_0x5ab7('0x16')],{'host':_0x5ab7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ab7('0x16')]));require(_0x5ab7('0x19'))[_0x5ab7('0x1a')](socket);function respondWithStatusCode(_0x1a05ed,_0x4f1113){_0x4f1113=_0x4f1113||0xcc;return function(_0xb14f09){if(_0xb14f09){return _0x1a05ed[_0x5ab7('0x1b')](_0x4f1113);}return _0x1a05ed[_0x5ab7('0x1c')](_0x4f1113)['end']();};}function respondWithResult(_0x24374c,_0xda8f0d){_0xda8f0d=_0xda8f0d||0xc8;return function(_0x43874f){if(_0x43874f){return _0x24374c['status'](_0xda8f0d)[_0x5ab7('0x1d')](_0x43874f);}};}function respondWithFilteredResult(_0x1bc1dd,_0x2d813c){return function(_0x12ddd5){if(_0x12ddd5){var _0x3efc70=typeof _0x2d813c[_0x5ab7('0x1e')]===_0x5ab7('0x1f')&&typeof _0x2d813c['limit']===_0x5ab7('0x1f');var _0xc05fca=_0x12ddd5[_0x5ab7('0x20')];var _0x57d1c0=_0x3efc70?0x0:_0x2d813c[_0x5ab7('0x1e')];var _0x4e3bdf=_0x3efc70?_0x12ddd5[_0x5ab7('0x20')]:_0x2d813c[_0x5ab7('0x1e')]+_0x2d813c[_0x5ab7('0x21')];var _0x447c0f;if(_0x4e3bdf>=_0xc05fca){_0x4e3bdf=_0xc05fca;_0x447c0f=0xc8;}else{_0x447c0f=0xce;}_0x1bc1dd[_0x5ab7('0x1c')](_0x447c0f);return _0x1bc1dd[_0x5ab7('0x22')](_0x5ab7('0x23'),_0x57d1c0+'-'+_0x4e3bdf+'/'+_0xc05fca)['json'](_0x12ddd5);}return null;};}function patchUpdates(_0x5b5197){return function(_0x5a94ab){try{jsonpatch[_0x5ab7('0x24')](_0x5a94ab,_0x5b5197,!![]);}catch(_0x5bfed8){return BPromise[_0x5ab7('0x25')](_0x5bfed8);}return _0x5a94ab['save']();};}function saveUpdates(_0x1adddb,_0x3874b1){return function(_0x32727c){if(_0x32727c){return _0x32727c[_0x5ab7('0x26')](_0x1adddb)[_0x5ab7('0x27')](function(_0xef8c8c){return _0xef8c8c;});}return null;};}function removeEntity(_0x4dab48,_0x13c088){return function(_0x48cc39){if(_0x48cc39){return _0x48cc39[_0x5ab7('0x28')]()[_0x5ab7('0x27')](function(){_0x4dab48[_0x5ab7('0x1c')](0xcc)[_0x5ab7('0x29')]();});}};}function handleEntityNotFound(_0x33df4d,_0x1bcbeb){return function(_0x923d68){if(!_0x923d68){_0x33df4d['sendStatus'](0x194);}return _0x923d68;};}function handleError(_0x37303e,_0x438c26){_0x438c26=_0x438c26||0x1f4;return function(_0x3f18e2){logger[_0x5ab7('0x2a')](_0x3f18e2[_0x5ab7('0x2b')]);if(_0x3f18e2[_0x5ab7('0x2c')]){delete _0x3f18e2[_0x5ab7('0x2c')];}_0x37303e[_0x5ab7('0x1c')](_0x438c26)[_0x5ab7('0x2d')](_0x3f18e2);};}function getInteractionUsers(_0x413075,_0x5589f7){return new BPromise(function(_0x3c8d67,_0x5b5584){try{if(_0x5589f7[_0x413075['id']]){_0x413075[_0x5ab7('0x2e')]=_[_0x5ab7('0x2f')](_0x5589f7[_0x413075['id']],function(_0x2f296a){return{'id':_0x2f296a['id'],'fullname':_0x2f296a['fullname']};});}}catch(_0x23bfaf){_0x5b5584(_0x23bfaf);}_0x3c8d67(_0x413075);});}function getInteractionTags(_0x149dd4,_0x4a68b8){return new BPromise(function(_0x576dac,_0x28b073){try{if(_0x149dd4[_0x5ab7('0x30')]){_0x149dd4['Tags']=[];_0x149dd4[_0x5ab7('0x30')][_0x5ab7('0x31')](',')[_0x5ab7('0x32')](function(_0xd1cfa){_0x149dd4['Tags'][_0x5ab7('0x33')](_0x4a68b8[_0xd1cfa]);});}delete _0x149dd4[_0x5ab7('0x30')];}catch(_0x227046){_0x28b073(_0x227046);}_0x576dac(_0x149dd4);});}function updateSmsInteraction(_0x1c2ead,_0x2cec56,_0x322db3){return new BPromise(function(_0x15e291,_0x3d66bc){return getInteractionUsers(_0x1c2ead,_0x322db3)[_0x5ab7('0x27')](function(_0x26c15c){return getInteractionTags(_0x26c15c,_0x2cec56);})['then'](function(_0x5375ec){_0x15e291(_0x5375ec);})[_0x5ab7('0x34')](function(_0x3e4cd2){_0x3d66bc(_0x3e4cd2);});});}exports[_0x5ab7('0x35')]=function(_0x1fac1c,_0x44690f){var _0x1c9797={},_0x528420={},_0xbb3ea4={'count':0x0,'rows':[]};var _0x18ee19=_['map'](db[_0x5ab7('0x36')]['rawAttributes'],function(_0x275d00){return{'name':_0x275d00['fieldName'],'type':_0x275d00[_0x5ab7('0x37')][_0x5ab7('0x38')]};});_0x528420[_0x5ab7('0x39')]=_['map'](_0x18ee19,_0x5ab7('0x2c'));_0x528420[_0x5ab7('0x3a')]=_['keys'](_0x1fac1c['query']);_0x528420[_0x5ab7('0x3b')]=_[_0x5ab7('0x3c')](_0x528420[_0x5ab7('0x39')],_0x528420['query']);_0x1c9797[_0x5ab7('0x3d')]=_[_0x5ab7('0x3c')](_0x528420[_0x5ab7('0x39')],qs[_0x5ab7('0x3e')](_0x1fac1c[_0x5ab7('0x3a')]['fields']));_0x1c9797[_0x5ab7('0x3d')]=_0x1c9797[_0x5ab7('0x3d')]['length']?_0x1c9797['attributes']:_0x528420[_0x5ab7('0x39')];if(!_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x3f')]('nolimit')){_0x1c9797[_0x5ab7('0x21')]=qs[_0x5ab7('0x21')](_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x21')]);_0x1c9797['offset']=qs[_0x5ab7('0x1e')](_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x1e')]);}_0x1c9797[_0x5ab7('0x40')]=qs[_0x5ab7('0x41')](_0x1fac1c[_0x5ab7('0x3a')]['sort']);_0x1c9797['where']=qs[_0x5ab7('0x3b')](_['pick'](_0x1fac1c[_0x5ab7('0x3a')],_0x528420['filters']),_0x18ee19);var _0x188142=[];var _0x5e8081=squel[_0x5ab7('0x42')]()[_0x5ab7('0x43')]('id')[_0x5ab7('0x43')](_0x5ab7('0x2c'))['field'](_0x5ab7('0x44'))[_0x5ab7('0x45')](_0x5ab7('0x46'));var _0x2987f2=squel[_0x5ab7('0x42')]()[_0x5ab7('0x43')](_0x5ab7('0x47'))[_0x5ab7('0x43')]('u.fullname')['field'](_0x5ab7('0x48'))[_0x5ab7('0x45')](_0x5ab7('0x49'),'ui')[_0x5ab7('0x4a')]('users','u','u.id\x20=\x20ui.UserId');var _0x4a40eb=squel[_0x5ab7('0x42')]()[_0x5ab7('0x45')](_0x5ab7('0x4b'),'i')[_0x5ab7('0x4a')]('cm_contacts','c',_0x5ab7('0x4c'))['left_join']('users','o',_0x5ab7('0x4d'))[_0x5ab7('0x4a')]('sms_accounts','a',_0x5ab7('0x4e'))['left_join'](_0x5ab7('0x4f'),'me',_0x5ab7('0x50'))[_0x5ab7('0x4a')]('sms_interaction_has_tags','it',_0x5ab7('0x51'))[_0x5ab7('0x4a')]('tools_tags','t',_0x5ab7('0x52'));var _0x2c1726=squel[_0x5ab7('0x53')]();var _0x43bf64=[];var _0x29aced=squel['expr']();var _0x23c26c;if(_0x1fac1c['query'][_0x5ab7('0x54')]){_0x23c26c=as[_0x5ab7('0x55')](_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x54')]);var _0x1d3717=_0x23c26c[_0x5ab7('0x56')];for(var _0x5e4c2b=0x0;_0x5e4c2b<_0x23c26c[_0x5ab7('0x57')]['length'];_0x5e4c2b++){var _0x19d825=_0x23c26c[_0x5ab7('0x57')][_0x5e4c2b];var _0x2e0f61='i';var _0x47f40e=_['find'](_0x18ee19,[_0x5ab7('0x2c'),_0x19d825[_0x5ab7('0x43')]]);if(!_0x47f40e){switch(_0x19d825[_0x5ab7('0x43')]){case _0x5ab7('0x58'):if(_0x19d825[_0x5ab7('0x59')]==0x1){_0x4a40eb[_0x5ab7('0x5a')]('`'+_0x19d825[_0x5ab7('0x43')]+_0x5ab7('0x5b'));}else{_0x4a40eb[_0x5ab7('0x5a')]('`'+_0x19d825[_0x5ab7('0x43')]+_0x5ab7('0x5c'));}break;case'Contact':if(_0x19d825[_0x5ab7('0x5d')]===_0x5ab7('0x5e')){if(_0x19d825[_0x5ab7('0x59')][_0x5ab7('0x31')]('\x20')[_0x5ab7('0x5f')]>0x1){_0x2c1726[_0x1d3717](_0x5ab7('0x60'),qs[_0x5ab7('0x61')](_0x19d825[_0x5ab7('0x59')]),null);}else{var _0x236b3b='%'+_0x19d825[_0x5ab7('0x59')]+'%';_0x2c1726[_0x1d3717](_0x5ab7('0x62'),_0x236b3b,_0x236b3b,_0x236b3b);}}else{_0x47f40e=_[_0x5ab7('0x63')](_0x18ee19,[_0x5ab7('0x2c'),_0x5ab7('0x64')]);_0x19d825[_0x5ab7('0x43')]='ContactId';_0x14ad7b=as[_0x5ab7('0x65')](_0x2e0f61,_0x47f40e[_0x5ab7('0x37')],_0x19d825);_0x2c1726[_0x1d3717](_0x14ad7b['text'],_0x14ad7b['value'][_0x5ab7('0x66')],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x29')]);}break;case _0x5ab7('0x67'):var _0x1590d7=_0x19d825[_0x5ab7('0x59')][_0x5ab7('0x31')](',')[_0x5ab7('0x2f')](function(_0x2e2615){return Number(_0x2e2615);});_0x1590d7['forEach'](function(_0xffa8eb){_0x29aced['or'](_0x5ab7('0x68'),'%,'+_0xffa8eb+',%');});_0x43bf64=_[_0x5ab7('0x69')](_0x43bf64,_0x1590d7);break;case _0x5ab7('0x6a'):if(_0x19d825[_0x5ab7('0x5d')]==='$substring'){_0x2c1726[_0x1d3717]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x19d825[_0x5ab7('0x59')]+'%',null);}else{_0x47f40e=_[_0x5ab7('0x63')](_0x18ee19,['name',_0x5ab7('0x6b')]);_0x19d825[_0x5ab7('0x43')]='UserId';_0x14ad7b=as[_0x5ab7('0x65')](_0x2e0f61,_0x47f40e[_0x5ab7('0x37')],_0x19d825);_0x2c1726[_0x1d3717](_0x14ad7b[_0x5ab7('0x6c')],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x66')],_0x14ad7b['value'][_0x5ab7('0x29')]);}break;case _0x5ab7('0x6d'):_0x14ad7b=as['buildExpression']('me',null,_0x19d825);_0x2c1726[_0x1d3717](_0x14ad7b['text'],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x66')],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x29')]);break;}}else{var _0x14ad7b=as[_0x5ab7('0x65')](_0x2e0f61,_0x47f40e[_0x5ab7('0x37')],_0x19d825);_0x2c1726[_0x1d3717](_0x14ad7b[_0x5ab7('0x6c')],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x66')],_0x14ad7b[_0x5ab7('0x59')][_0x5ab7('0x29')]);}}}else{var _0x5c098b=_(_0x1fac1c['query'])[_0x5ab7('0x6e')]()[_0x5ab7('0x2f')](function(_0x582a78){return _[_0x5ab7('0x6f')](_0x18ee19,[_0x5ab7('0x2c'),_0x582a78])?_0x582a78:undefined;})[_0x5ab7('0x70')]()[_0x5ab7('0x59')]();if(!_[_0x5ab7('0x71')](_0x5c098b)){_0x5c098b[_0x5ab7('0x32')](function(_0x4e0360){if(_0x4e0360===_0x5ab7('0x72')){_0x4a40eb[_0x5ab7('0x73')]('i.SmsAccountId\x20IN\x20?',[][_0x5ab7('0x74')](_0x1fac1c[_0x5ab7('0x3a')][_0x4e0360]));}else if(_0x4e0360===_0x5ab7('0x75')){var _0x42cf38=JSON[_0x5ab7('0x76')](_0x1fac1c[_0x5ab7('0x3a')][_0x4e0360])[_0x5ab7('0x77')];var _0x23d738=JSON['parse'](_0x1fac1c[_0x5ab7('0x3a')][_0x4e0360])['$lte'];_0x4a40eb['where'](_0x5ab7('0x78'),_0x42cf38,_0x23d738);}else{if(_0x1fac1c[_0x5ab7('0x3a')][_0x4e0360]===_0x5ab7('0x79')){_0x4a40eb[_0x5ab7('0x73')]('i.'+_0x4e0360+_0x5ab7('0x7a'));}else{_0x4a40eb[_0x5ab7('0x73')]('i.'+_0x4e0360+_0x5ab7('0x7b'),_0x1fac1c['query'][_0x4e0360]);}}});}if(_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x7c')]){if(_0x1fac1c['query']['read']==0x1){_0x4a40eb['having'](_0x5ab7('0x7d'));}else{_0x4a40eb[_0x5ab7('0x5a')]('`unreadMessages`\x20>\x200');}}if(_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x7e')]){_0x43bf64=_['isArray'](_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x7e')])?_0x1fac1c['query'][_0x5ab7('0x7e')]:new Array(_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x7e')]);_0x43bf64[_0x5ab7('0x32')](function(_0x2920de){_0x29aced['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2920de+',%');});}if(_0x1fac1c[_0x5ab7('0x3a')][_0x5ab7('0x7f')]){var _0x57e112=_0x1fac1c['query'][_0x5ab7('0x7f')][_0x5ab7('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5ab7('0x81')](_0x57e112)){_0x2c1726['or']('i.id\x20LIKE\x20?',_0x57e112+'%')['or'](_0x5ab7('0x82'),_0x57e112+'%');}else{_0x2c1726['or'](_0x5ab7('0x83'),qs[_0x5ab7('0x61')](_0x57e112))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57e112+'%');}}}_0x4a40eb[_0x5ab7('0x73')](_0x2c1726);_0x4a40eb[_0x5ab7('0x84')](_0x5ab7('0x85'));var _0x123bd8={'type':db[_0x5ab7('0x86')][_0x5ab7('0x87')][_0x5ab7('0x88')],'raw':!![]};var _0x101c50=_0x4a40eb[_0x5ab7('0x89')]();_0x101c50[_0x5ab7('0x43')](_0x5ab7('0x85'));_0x101c50[_0x5ab7('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5ab7('0x58'));if(_0x1c9797[_0x5ab7('0x40')]){_0x1c9797['order']['forEach'](function(_0x1b0c2a){var _0xc6cbd=_0x1b0c2a[0x0]===_0x5ab7('0x8a')?_0x1b0c2a[0x0]:'i.'+_0x1b0c2a[0x0];_0x4a40eb['order'](_0xc6cbd,_0x1b0c2a[0x1]===_0x5ab7('0x8b')?![]:!![]);});}if(!_[_0x5ab7('0x71')](_0x43bf64)){_0x4a40eb['having'](_0x29aced);_0x101c50['where']('t.id\x20IN\x20?',_0x43bf64);}BPromise[_0x5ab7('0x8c')]()[_0x5ab7('0x27')](function(){if(!_0x23c26c){if(_0x1fac1c['query'][_0x5ab7('0x72')])return;_0x101c50[_0x5ab7('0x73')](_0x5ab7('0x8d'));_0x4a40eb[_0x5ab7('0x73')](_0x5ab7('0x8d'));return;}if(_0x1fac1c[_0x5ab7('0x8e')][_0x5ab7('0x8f')]!=='agent')return;return _0x1fac1c[_0x5ab7('0x8e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x5ab7('0x27')](function(_0x244c3d){if(_[_0x5ab7('0x71')](_0x244c3d)){_0x101c50[_0x5ab7('0x73')](_0x5ab7('0x90'));_0x4a40eb['where'](_0x5ab7('0x90'));}else{_0x101c50[_0x5ab7('0x73')](_0x5ab7('0x91'),_[_0x5ab7('0x2f')](_0x244c3d,'id'));_0x4a40eb[_0x5ab7('0x73')](_0x5ab7('0x91'),_['map'](_0x244c3d,'id'));}});})[_0x5ab7('0x27')](function(){if(_0x1fac1c[_0x5ab7('0x8e')][_0x5ab7('0x8f')]===_0x5ab7('0x92')&&!_0x23c26c&&!_0x1fac1c['query'][_0x5ab7('0x72')])return[];return db[_0x5ab7('0x93')]['query'](_0x101c50[_0x5ab7('0x94')](),_0x123bd8);})[_0x5ab7('0x27')](function(_0x17edc7){_0xbb3ea4[_0x5ab7('0x20')]=_0x17edc7[_0x5ab7('0x5f')];if(_0xbb3ea4[_0x5ab7('0x20')]===0x0)return[];return db[_0x5ab7('0x93')]['query'](_0x5e8081[_0x5ab7('0x94')](),_0x123bd8)['then'](function(_0x5294f4){_0x188142=_[_0x5ab7('0x95')](_0x5294f4,'id');_0x123bd8=_[_0x5ab7('0x96')](_0x123bd8,{'model':db[_0x5ab7('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1fac1c[_0x5ab7('0x3a')]['fields']){_0x1c9797[_0x5ab7('0x3d')][_0x5ab7('0x32')](function(_0x552c7d){_0x4a40eb[_0x5ab7('0x43')]('i.'+_0x552c7d);});}else{_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0x97'),_0x5ab7('0x58'));_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0x98'),_0x5ab7('0x99'));_0x4a40eb['field'](_0x5ab7('0x9a'),_0x5ab7('0x9b'));_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0x9c'),_0x5ab7('0x8a'));_0x4a40eb[_0x5ab7('0x43')]('i.*');_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0x9d'),_0x5ab7('0x9e'));_0x4a40eb['field']('c.lastName',_0x5ab7('0x9f'));_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0xa0'),_0x5ab7('0xa1'));_0x4a40eb['field'](_0x5ab7('0xa2'),_0x5ab7('0xa3'));_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0xa4'),_0x5ab7('0xa5'));_0x4a40eb['field'](_0x5ab7('0xa6'),'Contact.fax');_0x4a40eb[_0x5ab7('0x43')]('o.fullname','Owner.fullname');_0x4a40eb[_0x5ab7('0x43')](_0x5ab7('0xa7'),_0x5ab7('0xa8'));_0x4a40eb['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1c9797[_0x5ab7('0x21')])_0x4a40eb[_0x5ab7('0x21')](_0x1c9797['limit']);if(_0x1c9797[_0x5ab7('0x1e')])_0x4a40eb[_0x5ab7('0x1e')](_0x1c9797[_0x5ab7('0x1e')]);return db[_0x5ab7('0x93')][_0x5ab7('0x3a')](_0x4a40eb[_0x5ab7('0x94')](),_0x123bd8);})['then'](function(_0x62676f){if(_0x62676f[_0x5ab7('0x5f')]>0x0)_0x2987f2[_0x5ab7('0x73')](_0x5ab7('0xa9'),_[_0x5ab7('0x2f')](_0x62676f,'id'));return db['sequelize'][_0x5ab7('0x3a')](_0x2987f2[_0x5ab7('0x94')](),_0x123bd8)[_0x5ab7('0x27')](function(_0x3acb53){var _0x545367=_[_0x5ab7('0xaa')](_0x3acb53,'SmsInteractionId');var _0x2a4275=[];_0x62676f[_0x5ab7('0x32')](function(_0x4321fd){_0x2a4275[_0x5ab7('0x33')](updateSmsInteraction(_0x4321fd,_0x188142,_0x545367));});return BPromise[_0x5ab7('0xab')](_0x2a4275);});});})[_0x5ab7('0x27')](function(_0xcabb27){_0xbb3ea4[_0x5ab7('0xac')]=_0xcabb27;return _0xbb3ea4;})[_0x5ab7('0x27')](respondWithFilteredResult(_0x44690f,_0x1c9797))[_0x5ab7('0x34')](handleError(_0x44690f,null));};exports[_0x5ab7('0xad')]=function(_0x347fe1,_0x2001ba){var _0x3df25f={'raw':![],'where':{'id':_0x347fe1[_0x5ab7('0xae')]['id']}},_0xae6f08={};_0xae6f08[_0x5ab7('0x39')]=_[_0x5ab7('0x6e')](db['SmsInteraction'][_0x5ab7('0xaf')]);_0xae6f08['query']=_[_0x5ab7('0x6e')](_0x347fe1[_0x5ab7('0x3a')]);_0xae6f08[_0x5ab7('0x3b')]=_[_0x5ab7('0x3c')](_0xae6f08[_0x5ab7('0x39')],_0xae6f08['query']);_0x3df25f[_0x5ab7('0x3d')]=_[_0x5ab7('0x3c')](_0xae6f08[_0x5ab7('0x39')],qs[_0x5ab7('0x3e')](_0x347fe1[_0x5ab7('0x3a')][_0x5ab7('0x3e')]));_0x3df25f[_0x5ab7('0x3d')]=_0x3df25f[_0x5ab7('0x3d')][_0x5ab7('0x5f')]?_0x3df25f[_0x5ab7('0x3d')]:_0xae6f08[_0x5ab7('0x39')];if(_0x347fe1[_0x5ab7('0x3a')][_0x5ab7('0xb0')]){_0x3df25f[_0x5ab7('0xb1')]=[{'all':!![]}];}_0x3df25f=_[_0x5ab7('0x96')]({},_0x3df25f,_0x347fe1[_0x5ab7('0xb2')]);return db[_0x5ab7('0x36')][_0x5ab7('0x63')](_0x3df25f)[_0x5ab7('0x27')](handleEntityNotFound(_0x2001ba,null))[_0x5ab7('0x27')](respondWithResult(_0x2001ba,null))['catch'](handleError(_0x2001ba,null));};exports[_0x5ab7('0xb3')]=function(_0x353892,_0x1317c1){return db['SmsInteraction'][_0x5ab7('0xb3')](_0x353892[_0x5ab7('0x6d')],{})[_0x5ab7('0x27')](respondWithResult(_0x1317c1,0xc9))['catch'](handleError(_0x1317c1,null));};exports[_0x5ab7('0x26')]=function(_0x4a1269,_0xbce89a){if(_0x4a1269[_0x5ab7('0x6d')]['id']){delete _0x4a1269['body']['id'];}return db[_0x5ab7('0x36')][_0x5ab7('0x63')]({'where':{'id':_0x4a1269[_0x5ab7('0xae')]['id']}})[_0x5ab7('0x27')](handleEntityNotFound(_0xbce89a,null))[_0x5ab7('0x27')](saveUpdates(_0x4a1269[_0x5ab7('0x6d')],null))[_0x5ab7('0x27')](respondWithResult(_0xbce89a,null))[_0x5ab7('0x34')](handleError(_0xbce89a,null));};exports['destroy']=function(_0x3a9d8e,_0x4bb11f){return db[_0x5ab7('0x36')][_0x5ab7('0x63')]({'where':{'id':_0x3a9d8e['params']['id']}})[_0x5ab7('0x27')](handleEntityNotFound(_0x4bb11f,null))['then'](removeEntity(_0x4bb11f,null))[_0x5ab7('0x34')](handleError(_0x4bb11f,null));};exports[_0x5ab7('0xb4')]=function(_0x563898,_0x5a055f){return db[_0x5ab7('0x36')]['describe']()[_0x5ab7('0x27')](respondWithResult(_0x5a055f,null))['catch'](handleError(_0x5a055f,null));};exports[_0x5ab7('0xb5')]=function(_0x471a64,_0x7d0773,_0x2d3f97){return db[_0x5ab7('0xb6')]['find']({'where':{'id':_0x471a64[_0x5ab7('0xae')]['id']}})['then'](handleEntityNotFound(_0x7d0773,null))[_0x5ab7('0x27')](function(_0x262cbb){if(_0x262cbb){return _0x262cbb['addMessage'](_0x471a64[_0x5ab7('0x6d')][_0x5ab7('0xb7')],_[_0x5ab7('0xb8')](_0x471a64['body'],[_0x5ab7('0xb7'),'id'])||{});}})['then'](respondWithResult(_0x7d0773,null))[_0x5ab7('0x34')](handleError(_0x7d0773,null));};exports[_0x5ab7('0xb9')]=function(_0x3576d8,_0x7fdebc,_0x41fb48){var _0x5cfb01={'raw':![],'where':{}};var _0x310803={};var _0x550de2={'count':0x0,'rows':[]};return db[_0x5ab7('0x36')][_0x5ab7('0xba')]({'where':{'id':_0x3576d8[_0x5ab7('0xae')]['id']}})[_0x5ab7('0x27')](handleEntityNotFound(_0x7fdebc,null))[_0x5ab7('0x27')](function(_0x11e98d){if(_0x11e98d){_0x310803[_0x5ab7('0x39')]=_[_0x5ab7('0x6e')](db[_0x5ab7('0xb6')][_0x5ab7('0xaf')]);_0x310803[_0x5ab7('0x3a')]=_[_0x5ab7('0x6e')](_0x3576d8[_0x5ab7('0x3a')]);_0x310803[_0x5ab7('0x3b')]=_[_0x5ab7('0x3c')](_0x310803[_0x5ab7('0x39')],_0x310803[_0x5ab7('0x3a')]);_0x5cfb01['attributes']=_[_0x5ab7('0x3c')](_0x310803['model'],qs[_0x5ab7('0x3e')](_0x3576d8[_0x5ab7('0x3a')][_0x5ab7('0x3e')]));_0x5cfb01[_0x5ab7('0x3d')]=_0x5cfb01[_0x5ab7('0x3d')][_0x5ab7('0x5f')]?_0x5cfb01[_0x5ab7('0x3d')]:_0x310803[_0x5ab7('0x39')];if(!_0x3576d8['query'][_0x5ab7('0x3f')]('nolimit')){_0x5cfb01[_0x5ab7('0x21')]=qs['limit'](_0x3576d8[_0x5ab7('0x3a')][_0x5ab7('0x21')]);_0x5cfb01[_0x5ab7('0x1e')]=qs['offset'](_0x3576d8[_0x5ab7('0x3a')]['offset']);}_0x5cfb01[_0x5ab7('0x40')]=qs[_0x5ab7('0x41')](_0x3576d8['query']['sort']);_0x5cfb01[_0x5ab7('0x73')]=qs[_0x5ab7('0x3b')](_[_0x5ab7('0xbb')](_0x3576d8['query'],_0x310803[_0x5ab7('0x3b')]));_0x5cfb01[_0x5ab7('0x73')][_0x5ab7('0xbc')]=_0x11e98d['id'];if(_0x3576d8[_0x5ab7('0x3a')]['filter']){_0x5cfb01[_0x5ab7('0x73')]=_[_0x5ab7('0x96')](_0x5cfb01[_0x5ab7('0x73')],{'$or':_[_0x5ab7('0x2f')](_0x5cfb01[_0x5ab7('0x3d')],function(_0x30a70e){var _0x2151dd={};_0x2151dd[_0x30a70e]={'$like':'%'+_0x3576d8[_0x5ab7('0x3a')][_0x5ab7('0x7f')]+'%'};return _0x2151dd;})});}if(_0x3576d8['query']['$gte']){var _0x191e85=_0x3576d8[_0x5ab7('0x3a')][_0x5ab7('0x77')]['split'](',');var _0x4b8462={};_0x4b8462[_0x191e85[0x0]]={'$gte':moment(_0x191e85[0x1])[_0x5ab7('0xbd')](_0x5ab7('0xbe'))};_0x5cfb01[_0x5ab7('0x73')]=_['merge'](_0x5cfb01['where'],_0x4b8462);}_0x5cfb01=_[_0x5ab7('0x96')]({},_0x5cfb01,_0x3576d8[_0x5ab7('0xb2')]);return db['SmsMessage'][_0x5ab7('0x20')]({'where':_0x5cfb01[_0x5ab7('0x73')]})[_0x5ab7('0x27')](function(_0xb4c185){_0x550de2[_0x5ab7('0x20')]=_0xb4c185;if(_0x3576d8[_0x5ab7('0x3a')][_0x5ab7('0xb0')]){_0x5cfb01[_0x5ab7('0xb1')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x5cfb01);})['then'](function(_0x4c2c86){_0x550de2[_0x5ab7('0xac')]=_0x4c2c86;return _0x550de2;});}})[_0x5ab7('0x27')](respondWithFilteredResult(_0x7fdebc,_0x5cfb01))[_0x5ab7('0x34')](handleError(_0x7fdebc,null));};exports[_0x5ab7('0xbf')]=function(_0x349eb3,_0x3c5929,_0x323cec){return db[_0x5ab7('0x36')][_0x5ab7('0x63')]({'where':{'id':_0x349eb3[_0x5ab7('0xae')]['id']}})[_0x5ab7('0x27')](handleEntityNotFound(_0x3c5929,null))[_0x5ab7('0x27')](function(_0x1ecdbc){if(_0x1ecdbc){return _0x1ecdbc[_0x5ab7('0xc0')](_0x349eb3[_0x5ab7('0x6d')][_0x5ab7('0xb7')],_['omit'](_0x349eb3[_0x5ab7('0x6d')],[_0x5ab7('0xb7'),'id'])||{})[_0x5ab7('0xc1')](function(){return db[_0x5ab7('0x67')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x349eb3[_0x5ab7('0x6d')][_0x5ab7('0xb7')]}});})[_0x5ab7('0x27')](function(_0x124a3d){socket[_0x5ab7('0xc2')](_0x5ab7('0xc3'),{'id':Number(_0x349eb3[_0x5ab7('0xae')]['id']),'tags':_0x124a3d||[]});return{'id':Number(_0x349eb3[_0x5ab7('0xae')]['id']),'tags':_0x124a3d||[]};});}})['then'](respondWithResult(_0x3c5929,null))['catch'](handleError(_0x3c5929,null));};exports[_0x5ab7('0xc4')]=function(_0x54b7d3,_0x48c370,_0x3f6ddb){return db[_0x5ab7('0x36')]['find']({'where':{'id':_0x54b7d3[_0x5ab7('0xae')]['id']}})[_0x5ab7('0x27')](handleEntityNotFound(_0x48c370,null))[_0x5ab7('0x27')](function(_0x1074cb){if(_0x1074cb){return _0x1074cb['removeTags'](_0x54b7d3[_0x5ab7('0x3a')][_0x5ab7('0xb7')]);}})[_0x5ab7('0x27')](respondWithStatusCode(_0x48c370,null))[_0x5ab7('0x34')](handleError(_0x48c370,null));};exports[_0x5ab7('0xc5')]=function(_0x84ce44,_0x419f2c){var _0x3a6a4b=moment()[_0x5ab7('0xc6')]()[_0x5ab7('0x94')]();var _0x45c8df=path[_0x5ab7('0xc7')](config[_0x5ab7('0xc8')],'server',_0x5ab7('0xc9'),_0x5ab7('0xca'));var _0x371e22=path[_0x5ab7('0xc7')](config[_0x5ab7('0xc8')],_0x5ab7('0xcb'),_0x5ab7('0xc9'),_0x5ab7('0xcc'));var _0x5d1903=path[_0x5ab7('0xc7')](_0x45c8df,_0x3a6a4b);var _0x56ee2b=util['format'](_0x5ab7('0xcd'),_0x84ce44[_0x5ab7('0xae')]['id'],_0x3a6a4b);var _0x26c69e=path[_0x5ab7('0xc7')](_0x45c8df,_0x56ee2b);var _0x90f19e=[];_0x90f19e[_0x5ab7('0x33')]({'model':db[_0x5ab7('0x6a')],'as':_0x5ab7('0x6a'),'attributes':['id',_0x5ab7('0xce')],'raw':!![]});_0x90f19e[_0x5ab7('0x33')]({'model':db[_0x5ab7('0xcf')],'as':_0x5ab7('0xd0'),'attributes':['id',_0x5ab7('0xd1'),_0x5ab7('0xd2')],'raw':!![]});var _0x1f0cf4=[{'model':db[_0x5ab7('0xb6')],'as':_0x5ab7('0xd3'),'attributes':['id','body',_0x5ab7('0x75'),'direction',_0x5ab7('0xd4'),_0x5ab7('0x7c')],'include':_0x90f19e}];_0x1f0cf4[_0x5ab7('0x33')]({'model':db['SmsAccount'],'as':_0x5ab7('0xd5'),'attributes':['id',_0x5ab7('0x2c')]});_0x1f0cf4[_0x5ab7('0x33')]({'model':db['User'],'as':'Owner','attributes':['id',_0x5ab7('0xce')]});return db[_0x5ab7('0x36')]['find']({'where':{'id':_0x84ce44[_0x5ab7('0xae')]['id']},'include':_0x1f0cf4})['then'](handleEntityNotFound(_0x419f2c,null))['then'](function(_0x2413f0){if(_0x2413f0){var _0x218fe8=_0x2413f0[_0x5ab7('0xd6')]({'plain':!![]});fs[_0x5ab7('0xd7')](_0x5d1903);var _0x49bc65={'channel':_0x5ab7('0xd8'),'account':_0x218fe8[_0x5ab7('0xd5')][_0x5ab7('0x2c')],'agent':_0x218fe8[_0x5ab7('0xd9')]?_0x218fe8[_0x5ab7('0xd9')][_0x5ab7('0xce')]:_0x5ab7('0xda'),'createdAt':moment(_0x218fe8[_0x5ab7('0x75')])['format'](_0x5ab7('0xbe'))[_0x5ab7('0x94')](),'closedAt':_0x218fe8[_0x5ab7('0xdb')]?moment(_0x218fe8[_0x5ab7('0xdc')])['format'](_0x5ab7('0xbe'))[_0x5ab7('0x94')]():'','disposition':_0x218fe8[_0x5ab7('0xdd')],'messages':_(_0x218fe8['Messages'])[_0x5ab7('0x7f')]({'secret':![]})[_0x5ab7('0x2f')](function(_0x472907){return{'date':moment(_0x472907[_0x5ab7('0x75')])[_0x5ab7('0xbd')](_0x5ab7('0xbe'))[_0x5ab7('0x94')](),'sender':_0x472907[_0x5ab7('0xde')]===_0x5ab7('0xdf')?_0x472907[_0x5ab7('0x6a')]?_0x472907['User'][_0x5ab7('0xce')]:_0x5ab7('0xe0'):_0x472907['Contact']['firstName']+(_0x472907['Contact'][_0x5ab7('0xd2')]?'\x20'+_0x472907[_0x5ab7('0xd0')][_0x5ab7('0xd2')]:''),'body':_0x472907['body'],'direction':_0x472907[_0x5ab7('0xde')]==='out'?'A':'C','secret':_0x472907[_0x5ab7('0xd4')],'read':_0x472907[_0x5ab7('0x7c')]};})['value']()};return ejs['renderFile'](path[_0x5ab7('0xc7')](config[_0x5ab7('0xc8')],_0x5ab7('0xcb'),'views','downloadInteraction.ejs'),{'interaction':_0x49bc65})[_0x5ab7('0x27')](function(_0xf7c3c5){var _0x2fde18=path['join'](_0x5d1903,_0x5ab7('0xe1')+_0x218fe8['id']+'-'+_0x3a6a4b+_0x5ab7('0xe2'));var _0x3ec7ad={'path':_0x2fde18,'channel':'Sms','interactionId':_0x218fe8['id']};return pdf[_0x5ab7('0xe3')](_0xf7c3c5,_0x3ec7ad);})[_0x5ab7('0x27')](function(){return new BPromise(function(_0x4e32b8,_0x455f6f){zipdir(_0x5d1903,{'saveTo':_0x26c69e},function(_0x160358,_0x4dd059){if(_0x160358)return _0x455f6f(_0x160358);return _0x4e32b8(_0x4dd059);});})[_0x5ab7('0x27')](function(){return new BPromise(function(_0x43d487,_0x44db4e){rimraf(_0x5d1903,function(_0x1b449f){if(_0x1b449f)_0x44db4e(_0x1b449f);return _0x43d487();});});})[_0x5ab7('0x27')](function(){return _0x419f2c[_0x5ab7('0xc5')](_0x26c69e,_0x56ee2b,function(_0x592d12){if(_0x592d12){console[_0x5ab7('0xe4')]('err',_0x592d12);}else{fs[_0x5ab7('0xe5')](_0x26c69e);}});});});}else{return _0x419f2c[_0x5ab7('0x1b')](0xc8);}})['catch'](handleError(_0x419f2c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3b6ebad..b2a8ffc 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 _0x1775=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x4206f4,_0x47e54f){var _0x68c762=function(_0x306651){while(--_0x306651){_0x4206f4['push'](_0x4206f4['shift']());}};_0x68c762(++_0x47e54f);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var SmsMessage=require(_0x5177('0x0'))['db'][_0x5177('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5177('0x3')](0x0);var events={'afterCreate':_0x5177('0x4'),'afterUpdate':_0x5177('0x5'),'afterDestroy':_0x5177('0x6')};function emitEvent(_0x359401){return function(_0x51275f,_0x159a20,_0x2c5c42){_0x51275f[_0x5177('0x7')]({'attributes':['id'],'raw':!![]})[_0x5177('0x8')](function(_0x300b43){_0x51275f[_0x5177('0x9')](_0x5177('0xa'),_0x300b43[_0x5177('0xb')](function(_0x16e7a7){return{'id':_0x16e7a7['id']};}));return SmsMessage[_0x5177('0xc')]({'where':{'SmsInteractionId':_0x51275f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5177('0x8')](function(_0x206035){_0x51275f['setDataValue']('unreadMessages',_0x206035[_0x5177('0xd')]);SmsInteractionEvents[_0x5177('0xe')](_0x359401+':'+_0x51275f['id'],_0x51275f);SmsInteractionEvents[_0x5177('0xe')](_0x359401,_0x51275f);_0x2c5c42(null);})[_0x5177('0xf')](_0x2c5c42(null));};}for(var e in events){if(events[_0x5177('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5177('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x3dac49,_0xdf0a0c){var _0x96fcd0=function(_0x38ceb2){while(--_0x38ceb2){_0x3dac49['push'](_0x3dac49['shift']());}};_0x96fcd0(++_0xdf0a0c);}(_0x93e9,0xcc));var _0x993e=function(_0x4ca92a,_0x4a2b42){_0x4ca92a=_0x4ca92a-0x0;var _0x12a5a8=_0x93e9[_0x4ca92a];return _0x12a5a8;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](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 bc5c9dc..2357131 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 _0x7c5d=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed'];(function(_0x157df3,_0x1c7645){var _0x51a47a=function(_0x3f11d1){while(--_0x3f11d1){_0x157df3['push'](_0x157df3['shift']());}};_0x51a47a(++_0x1c7645);}(_0x7c5d,0xb3));var _0xd7c5=function(_0x3ade7b,_0x5067b0){_0x3ade7b=_0x3ade7b-0x0;var _0x4dc1a9=_0x7c5d[_0x3ade7b];return _0x4dc1a9;};'use strict';var _=require(_0xd7c5('0x0'));var util=require(_0xd7c5('0x1'));var logger=require(_0xd7c5('0x2'))(_0xd7c5('0x3'));var moment=require(_0xd7c5('0x4'));var BPromise=require(_0xd7c5('0x5'));var rp=require(_0xd7c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7c5('0x7'));var config=require('../../config/environment');var attributes=require(_0xd7c5('0x8'));module['exports']=function(_0x20f308,_0x42a795){return _0x20f308[_0xd7c5('0x9')](_0xd7c5('0xa'),attributes,{'tableName':_0xd7c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x121fb4,_0x5e58ee,_0x3d7731){if(_0x121fb4[_0xd7c5('0xc')]('closed')){_0x121fb4[_0xd7c5('0xd')]=moment()[_0xd7c5('0xe')](_0xd7c5('0xf'));}_0x3d7731(null,_0x121fb4);}}});}; \ No newline at end of file +var _0xe6f0=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3396cd,_0x4047f0){var _0x2d6b4a=function(_0x389663){while(--_0x389663){_0x3396cd['push'](_0x3396cd['shift']());}};_0x2d6b4a(++_0x4047f0);}(_0xe6f0,0x11f));var _0x0e6f=function(_0x3d3fe5,_0x2fcf2b){_0x3d3fe5=_0x3d3fe5-0x0;var _0xb4ce88=_0xe6f0[_0x3d3fe5];return _0xb4ce88;};'use strict';var _=require(_0x0e6f('0x0'));var util=require(_0x0e6f('0x1'));var logger=require('../../config/logger')(_0x0e6f('0x2'));var moment=require(_0x0e6f('0x3'));var BPromise=require(_0x0e6f('0x4'));var rp=require(_0x0e6f('0x5'));var fs=require('fs');var path=require(_0x0e6f('0x6'));var rimraf=require(_0x0e6f('0x7'));var config=require(_0x0e6f('0x8'));var attributes=require(_0x0e6f('0x9'));module[_0x0e6f('0xa')]=function(_0x3ff305,_0x1ea897){return _0x3ff305[_0x0e6f('0xb')](_0x0e6f('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b35e5,_0x2f75d2,_0x3946ee){if(_0x3b35e5['changed']('closed')){_0x3b35e5[_0x0e6f('0xd')]=moment()[_0x0e6f('0xe')](_0x0e6f('0xf'));}_0x3946ee(null,_0x3b35e5);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 13ae396..0966601 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 _0x9cfc=['socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0x9cfc,0x144));var _0xc9cf=function(_0x14dac2,_0xa774e0){_0x14dac2=_0x14dac2-0x0;var _0x387727=_0x9cfc[_0x14dac2];return _0x387727;};'use strict';var _=require(_0xc9cf('0x0'));var util=require(_0xc9cf('0x1'));var moment=require(_0xc9cf('0x2'));var BPromise=require(_0xc9cf('0x3'));var rs=require(_0xc9cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc9cf('0x5'));var config=require(_0xc9cf('0x6'));var jayson=require(_0xc9cf('0x7'));var client=jayson[_0xc9cf('0x8')]['http']({'port':0x232a});config[_0xc9cf('0x9')]=_[_0xc9cf('0xa')](config[_0xc9cf('0x9')],{'host':_0xc9cf('0xb'),'port':0x18eb});var socket=require(_0xc9cf('0xc'))(new Redis(config[_0xc9cf('0x9')]));require(_0xc9cf('0xd'))[_0xc9cf('0xe')](socket);function respondWithRpcPromise(_0x2e6d04,_0x4152d4,_0x5ca8c6){return new BPromise(function(_0x163805,_0x1737bb){return client[_0xc9cf('0xf')](_0x2e6d04,_0x5ca8c6)[_0xc9cf('0x10')](function(_0x3e6c78){logger[_0xc9cf('0x11')](_0xc9cf('0x12'),_0x4152d4,_0xc9cf('0x13'));logger[_0xc9cf('0x14')](_0xc9cf('0x15'),_0x4152d4,'request\x20sent',JSON[_0xc9cf('0x16')](_0x3e6c78));if(_0x3e6c78[_0xc9cf('0x17')]){if(_0x3e6c78[_0xc9cf('0x17')][_0xc9cf('0x18')]===0x1f4){logger[_0xc9cf('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x4152d4,_0x3e6c78[_0xc9cf('0x17')][_0xc9cf('0x19')]);return _0x1737bb(_0x3e6c78[_0xc9cf('0x17')][_0xc9cf('0x19')]);}logger[_0xc9cf('0x17')](_0xc9cf('0x12'),_0x4152d4,_0x3e6c78[_0xc9cf('0x17')]['message']);return _0x163805(_0x3e6c78[_0xc9cf('0x17')][_0xc9cf('0x19')]);}else{logger[_0xc9cf('0x11')](_0xc9cf('0x12'),_0x4152d4,_0xc9cf('0x13'));_0x163805(_0x3e6c78[_0xc9cf('0x1a')][_0xc9cf('0x19')]);}})[_0xc9cf('0x1b')](function(_0x350550){logger[_0xc9cf('0x17')](_0xc9cf('0x12'),_0x4152d4,_0x350550);_0x1737bb(_0x350550);});});}exports[_0xc9cf('0x1c')]=function(_0x5a8dbc){var _0x517777=this;return new Promise(function(_0x21a799,_0x1c39e3){return db[_0xc9cf('0x1d')]['update'](_0x5a8dbc['body'],{'raw':_0x5a8dbc[_0xc9cf('0x1e')]?_0x5a8dbc[_0xc9cf('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a8dbc[_0xc9cf('0x1e')]?_0x5a8dbc[_0xc9cf('0x1e')][_0xc9cf('0x1f')]||null:null,'attributes':_0x5a8dbc[_0xc9cf('0x1e')]?_0x5a8dbc[_0xc9cf('0x1e')][_0xc9cf('0x20')]||null:null,'limit':_0x5a8dbc[_0xc9cf('0x1e')]?_0x5a8dbc[_0xc9cf('0x1e')][_0xc9cf('0x21')]||null:null})[_0xc9cf('0x10')](function(_0x122157){logger[_0xc9cf('0x11')](_0xc9cf('0x1c'),_0x5a8dbc);logger[_0xc9cf('0x14')]('UpdateSmsInteraction',_0x5a8dbc,JSON[_0xc9cf('0x16')](_0x122157));_0x21a799(_0x122157);})[_0xc9cf('0x1b')](function(_0x5e87af){logger['error'](_0xc9cf('0x1c'),_0x5e87af[_0xc9cf('0x19')],_0x5a8dbc);_0x1c39e3(_0x517777['error'](0x1f4,_0x5e87af['message']));});});};exports[_0xc9cf('0x22')]=function(_0x3076a4){return new Promise(function(_0x54991f,_0x1c331e){return db[_0xc9cf('0x1d')][_0xc9cf('0x23')]({'where':_0x3076a4['options']?_0x3076a4[_0xc9cf('0x1e')][_0xc9cf('0x1f')]||null:null})[_0xc9cf('0x10')](function(_0x33aadf){if(_0x33aadf){return _0x33aadf[_0xc9cf('0x24')](_0x3076a4[_0xc9cf('0x25')][_0xc9cf('0x26')],_[_0xc9cf('0x27')](_0x3076a4['body'],[_0xc9cf('0x26'),'id'])||{});}})[_0xc9cf('0x28')](function(_0x287a1c){logger[_0xc9cf('0x11')](_0xc9cf('0x29'),_0x3076a4);logger[_0xc9cf('0x14')]('AddTags',_0x3076a4,JSON[_0xc9cf('0x16')](_0x287a1c));_0x54991f(_0x287a1c);})[_0xc9cf('0x1b')](function(_0x406009){logger[_0xc9cf('0x17')](_0xc9cf('0x29'),_0x406009[_0xc9cf('0x19')],_0x3076a4);_0x1c331e(_this[_0xc9cf('0x17')](0x1f4,_0x406009[_0xc9cf('0x19')]));});});}; \ No newline at end of file +var _0x01a8=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateSmsInteraction','options','raw','where','limit','AddTagsToSmsInteraction','SmsInteraction','find','body','ids','omit','stringify','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1be39d,_0x390f07){var _0x1064b5=function(_0x5b818d){while(--_0x5b818d){_0x1be39d['push'](_0x1be39d['shift']());}};_0x1064b5(++_0x390f07);}(_0x01a8,0x159));var _0x801a=function(_0x35f829,_0x14f670){_0x35f829=_0x35f829-0x0;var _0x2c1fe0=_0x01a8[_0x35f829];return _0x2c1fe0;};'use strict';var _=require(_0x801a('0x0'));var util=require(_0x801a('0x1'));var moment=require(_0x801a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x801a('0x3'));var db=require(_0x801a('0x4'))['db'];var utils=require(_0x801a('0x5'));var logger=require(_0x801a('0x6'))('rpc');var config=require(_0x801a('0x7'));var jayson=require(_0x801a('0x8'));var client=jayson[_0x801a('0x9')][_0x801a('0xa')]({'port':0x232a});config[_0x801a('0xb')]=_[_0x801a('0xc')](config[_0x801a('0xb')],{'host':_0x801a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x801a('0xb')]));require('./smsInteraction.socket')[_0x801a('0xe')](socket);function respondWithRpcPromise(_0x2f0f84,_0x1874fa,_0x479ca1){return new BPromise(function(_0x55e5cb,_0x448178){return client['request'](_0x2f0f84,_0x479ca1)[_0x801a('0xf')](function(_0x4270dd){logger[_0x801a('0x10')](_0x801a('0x11'),_0x1874fa,'request\x20sent');logger[_0x801a('0x12')](_0x801a('0x13'),_0x1874fa,'request\x20sent',JSON['stringify'](_0x4270dd));if(_0x4270dd['error']){if(_0x4270dd[_0x801a('0x14')][_0x801a('0x15')]===0x1f4){logger[_0x801a('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x1874fa,_0x4270dd['error'][_0x801a('0x16')]);return _0x448178(_0x4270dd[_0x801a('0x14')][_0x801a('0x16')]);}logger[_0x801a('0x14')](_0x801a('0x11'),_0x1874fa,_0x4270dd['error'][_0x801a('0x16')]);return _0x55e5cb(_0x4270dd[_0x801a('0x14')]['message']);}else{logger[_0x801a('0x10')](_0x801a('0x11'),_0x1874fa,_0x801a('0x17'));_0x55e5cb(_0x4270dd[_0x801a('0x18')]['message']);}})[_0x801a('0x19')](function(_0x172d3b){logger[_0x801a('0x14')](_0x801a('0x11'),_0x1874fa,_0x172d3b);_0x448178(_0x172d3b);});});}exports[_0x801a('0x1a')]=function(_0x3772b4){var _0x5a178c=this;return new Promise(function(_0x390743,_0x11e0bd){return db['SmsInteraction']['update'](_0x3772b4['body'],{'raw':_0x3772b4['options']?_0x3772b4[_0x801a('0x1b')][_0x801a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3772b4['options']?_0x3772b4[_0x801a('0x1b')][_0x801a('0x1d')]||null:null,'attributes':_0x3772b4[_0x801a('0x1b')]?_0x3772b4['options']['attributes']||null:null,'limit':_0x3772b4[_0x801a('0x1b')]?_0x3772b4[_0x801a('0x1b')][_0x801a('0x1e')]||null:null})['then'](function(_0x495754){logger[_0x801a('0x10')](_0x801a('0x1a'),_0x3772b4);logger[_0x801a('0x12')](_0x801a('0x1a'),_0x3772b4,JSON['stringify'](_0x495754));_0x390743(_0x495754);})[_0x801a('0x19')](function(_0x544880){logger[_0x801a('0x14')]('UpdateSmsInteraction',_0x544880['message'],_0x3772b4);_0x11e0bd(_0x5a178c[_0x801a('0x14')](0x1f4,_0x544880[_0x801a('0x16')]));});});};exports[_0x801a('0x1f')]=function(_0x82514b){return new Promise(function(_0x3ac127,_0x21b53b){return db[_0x801a('0x20')][_0x801a('0x21')]({'where':_0x82514b[_0x801a('0x1b')]?_0x82514b[_0x801a('0x1b')][_0x801a('0x1d')]||null:null})[_0x801a('0xf')](function(_0x20405b){if(_0x20405b){return _0x20405b['addTags'](_0x82514b[_0x801a('0x22')][_0x801a('0x23')],_[_0x801a('0x24')](_0x82514b[_0x801a('0x22')],['ids','id'])||{});}})['spread'](function(_0x84b89c){logger['info']('AddTags',_0x82514b);logger['debug']('AddTags',_0x82514b,JSON[_0x801a('0x25')](_0x84b89c));_0x3ac127(_0x84b89c);})[_0x801a('0x19')](function(_0xcad451){logger[_0x801a('0x14')](_0x801a('0x26'),_0xcad451[_0x801a('0x16')],_0x82514b);_0x21b53b(_this[_0x801a('0x14')](0x1f4,_0xcad451[_0x801a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index cde37e1..40cc949 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 _0x7ae7=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7ae7,0x17e));var _0x77ae=function(_0xb327f0,_0x35df9c){_0xb327f0=_0xb327f0-0x0;var _0x585904=_0x7ae7[_0xb327f0];return _0x585904;};'use strict';var SmsInteractionEvents=require(_0x77ae('0x0'));var events=[_0x77ae('0x1'),_0x77ae('0x2'),_0x77ae('0x3')];function createListener(_0x1545c7,_0x58d922){return function(_0x3750dc){_0x58d922[_0x77ae('0x4')](_0x1545c7,_0x3750dc);};}function removeListener(_0xb26cfc,_0x25c002){return function(){SmsInteractionEvents[_0x77ae('0x5')](_0xb26cfc,_0x25c002);};}exports[_0x77ae('0x6')]=function(_0x3c7f92){for(var _0x5c0d11=0x0,_0xdea550=events[_0x77ae('0x7')];_0x5c0d11<_0xdea550;_0x5c0d11++){var _0xfc5c01=events[_0x5c0d11];var _0x21589d=createListener(_0x77ae('0x8')+_0xfc5c01,_0x3c7f92);SmsInteractionEvents['on'](_0xfc5c01,_0x21589d);}}; \ No newline at end of file +var _0x070b=['update','emit','removeListener','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x300304,_0x5606c5){var _0x5ae992=function(_0x251c85){while(--_0x251c85){_0x300304['push'](_0x300304['shift']());}};_0x5ae992(++_0x5606c5);}(_0x070b,0x6d));var _0xb070=function(_0x2477e0,_0x5266b1){_0x2477e0=_0x2477e0-0x0;var _0x579436=_0x070b[_0x2477e0];return _0x579436;};'use strict';var SmsInteractionEvents=require(_0xb070('0x0'));var events=[_0xb070('0x1'),_0xb070('0x2'),_0xb070('0x3')];function createListener(_0x163792,_0x52eea1){return function(_0x39bb16){_0x52eea1[_0xb070('0x4')](_0x163792,_0x39bb16);};}function removeListener(_0x41c6e3,_0x37e692){return function(){SmsInteractionEvents[_0xb070('0x5')](_0x41c6e3,_0x37e692);};}exports['register']=function(_0x136971){for(var _0xd504d2=0x0,_0x31099e=events['length'];_0xd504d2<_0x31099e;_0xd504d2++){var _0x52f839=events[_0xd504d2];var _0x41d4e4=createListener(_0xb070('0x6')+_0x52f839,_0x136971);SmsInteractionEvents['on'](_0x52f839,_0x41d4e4);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index fcb099c..289353f 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 _0xb346=['tracked','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','/describe','isAuthenticated','describe','get','/:id','show','post'];(function(_0x45b7eb,_0x1a4535){var _0x33678b=function(_0x51517e){while(--_0x51517e){_0x45b7eb['push'](_0x45b7eb['shift']());}};_0x33678b(++_0x1a4535);}(_0xb346,0xcb));var _0x6b34=function(_0x225d05,_0x143a2b){_0x225d05=_0x225d05-0x0;var _0x26f7b1=_0xb346[_0x225d05];return _0x26f7b1;};'use strict';var multer=require(_0x6b34('0x0'));var util=require(_0x6b34('0x1'));var path=require('path');var timeout=require(_0x6b34('0x2'));var express=require(_0x6b34('0x3'));var router=express[_0x6b34('0x4')]();var fs_extra=require(_0x6b34('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6b34('0x6'),auth[_0x6b34('0x7')](),controller[_0x6b34('0x8')]);router[_0x6b34('0x9')](_0x6b34('0xa'),auth[_0x6b34('0x7')](),controller[_0x6b34('0xb')]);router[_0x6b34('0xc')]('/',auth[_0x6b34('0x7')](),interaction[_0x6b34('0xd')]('sms','smsmessage:create'),controller['create']);router[_0x6b34('0xc')](_0x6b34('0xe'),controller[_0x6b34('0xf')]);router[_0x6b34('0x10')]('/:id',auth[_0x6b34('0x7')](),controller[_0x6b34('0x11')]);router[_0x6b34('0x10')](_0x6b34('0x12'),auth[_0x6b34('0x7')](),controller[_0x6b34('0x13')]);router[_0x6b34('0x10')](_0x6b34('0x14'),auth[_0x6b34('0x7')](),controller[_0x6b34('0x15')]);router[_0x6b34('0x16')](_0x6b34('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b34('0x17')]=router; \ No newline at end of file +var _0x0246=['/:id','show','post','tracked','smsmessage:create','/:id/status','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x53439f,_0x45705f){var _0x2042bb=function(_0x288dbc){while(--_0x288dbc){_0x53439f['push'](_0x53439f['shift']());}};_0x2042bb(++_0x45705f);}(_0x0246,0x1c1));var _0x6024=function(_0x3575f5,_0x31177b){_0x3575f5=_0x3575f5-0x0;var _0x3d256f=_0x0246[_0x3575f5];return _0x3d256f;};'use strict';var multer=require(_0x6024('0x0'));var util=require(_0x6024('0x1'));var path=require(_0x6024('0x2'));var timeout=require(_0x6024('0x3'));var express=require(_0x6024('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6024('0x6'));var controller=require('./smsMessage.controller');router[_0x6024('0x7')]('/',auth[_0x6024('0x8')](),controller[_0x6024('0x9')]);router['get']('/describe',auth[_0x6024('0x8')](),controller[_0x6024('0xa')]);router[_0x6024('0x7')](_0x6024('0xb'),auth[_0x6024('0x8')](),controller[_0x6024('0xc')]);router[_0x6024('0xd')]('/',auth[_0x6024('0x8')](),interaction[_0x6024('0xe')]('sms',_0x6024('0xf')),controller['create']);router[_0x6024('0xd')](_0x6024('0x10'),controller['status']);router[_0x6024('0x11')](_0x6024('0xb'),auth[_0x6024('0x8')](),controller['update']);router[_0x6024('0x11')](_0x6024('0x12'),auth[_0x6024('0x8')](),controller[_0x6024('0x13')]);router[_0x6024('0x11')](_0x6024('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x6024('0x15')](_0x6024('0xb'),auth[_0x6024('0x8')](),controller[_0x6024('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 44695ae..a46eded 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 _0xafbf=['ENUM','out','DATE','STRING','TEXT','exports','medium','BOOLEAN'];(function(_0x4211e4,_0x1d8189){var _0x1a14d9=function(_0x4bb9c9){while(--_0x4bb9c9){_0x4211e4['push'](_0x4211e4['shift']());}};_0x1a14d9(++_0x1d8189);}(_0xafbf,0x65));var _0xfafb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xafbf[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xfafb('0x0')]={'body':{'type':Sequelize['TEXT'](_0xfafb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfafb('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfafb('0x3')]('in',_0xfafb('0x4')),'defaultValue':_0xfafb('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xfafb('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfafb('0x6')]},'providerResponse':{'type':Sequelize[_0xfafb('0x7')]}}; \ No newline at end of file +var _0x2cca=['ENUM','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x2cca,0xa4));var _0xa2cc=function(_0x5dbc6a,_0x3b6611){_0x5dbc6a=_0x5dbc6a-0x0;var _0x39f9ee=_0x2cca[_0x5dbc6a];return _0x39f9ee;};'use strict';var Sequelize=require(_0xa2cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xa2cc('0x1')](_0xa2cc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa2cc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa2cc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa2cc('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa2cc('0x5')]},'readAt':{'type':Sequelize[_0xa2cc('0x6')]},'secret':{'type':Sequelize[_0xa2cc('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa2cc('0x5')]},'providerResponse':{'type':Sequelize[_0xa2cc('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index aa239cc..80f395c 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 _0x1146=['redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','SmsMessage','includeAll','include','findAll','rows','params','merge','options','find','create','body','describe','../../config/logger','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','rejectmessage','SmsAccountId','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1bae01,_0x4a53de){var _0x1344a1=function(_0x216f8d){while(--_0x216f8d){_0x1bae01['push'](_0x1bae01['shift']());}};_0x1344a1(++_0x4a53de);}(_0x1146,0x112));var _0x6114=function(_0x583793,_0x5450ee){_0x583793=_0x583793-0x0;var _0x5750df=_0x1146[_0x583793];return _0x5750df;};'use strict';var emlformat=require(_0x6114('0x0'));var rimraf=require(_0x6114('0x1'));var zipdir=require(_0x6114('0x2'));var jsonpatch=require(_0x6114('0x3'));var rp=require(_0x6114('0x4'));var moment=require(_0x6114('0x5'));var BPromise=require(_0x6114('0x6'));var Mustache=require(_0x6114('0x7'));var util=require(_0x6114('0x8'));var path=require(_0x6114('0x9'));var sox=require(_0x6114('0xa'));var csv=require('to-csv');var ejs=require(_0x6114('0xb'));var fs=require('fs');var fs_extra=require(_0x6114('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6114('0xd'));var deskjs=require(_0x6114('0xe'));var toCsv=require(_0x6114('0xf'));var querystring=require(_0x6114('0x10'));var Papa=require('papaparse');var Redis=require(_0x6114('0x11'));var authService=require(_0x6114('0x12'));var qs=require(_0x6114('0x13'));var as=require(_0x6114('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6114('0x15'));var utils=require(_0x6114('0x16'));var config=require(_0x6114('0x17'));var licenseUtil=require(_0x6114('0x18'));var db=require(_0x6114('0x19'))['db'];config[_0x6114('0x1a')]=_['defaults'](config[_0x6114('0x1a')],{'host':_0x6114('0x1b'),'port':0x18eb});var socket=require(_0x6114('0x1c'))(new Redis(config[_0x6114('0x1a')]));require(_0x6114('0x1d'))[_0x6114('0x1e')](socket);var jayson=require(_0x6114('0x1f'));var client=jayson[_0x6114('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x6114('0x20')][_0x6114('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2688bf,_0x29f958,_0x4abb04,_0x80745b){return new BPromise(function(_0x18e0b0,_0x5d7441){var _0x1162f6=_0x80745b||client;return _0x1162f6[_0x6114('0x22')](_0x2688bf,_0x4abb04)[_0x6114('0x23')](function(_0x11bbae){logger[_0x6114('0x24')](_0x6114('0x25'),_0x29f958,_0x6114('0x26'));logger[_0x6114('0x27')](_0x6114('0x28'),_0x29f958,_0x6114('0x26'),JSON[_0x6114('0x29')](_0x11bbae));if(_0x11bbae[_0x6114('0x2a')]){if(_0x11bbae[_0x6114('0x2a')][_0x6114('0x2b')]===0x1f4){logger[_0x6114('0x2a')](_0x6114('0x25'),_0x29f958,_0x11bbae[_0x6114('0x2a')][_0x6114('0x2c')]);return _0x5d7441(_0x11bbae[_0x6114('0x2a')][_0x6114('0x2c')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x29f958,_0x11bbae[_0x6114('0x2a')][_0x6114('0x2c')]);return _0x18e0b0(_0x11bbae[_0x6114('0x2a')][_0x6114('0x2c')]);}else{logger[_0x6114('0x24')](_0x6114('0x25'),_0x29f958,_0x6114('0x26'));_0x18e0b0(_0x11bbae[_0x6114('0x2d')][_0x6114('0x2c')]);}})[_0x6114('0x2e')](function(_0x88cdf8){logger['error'](_0x6114('0x25'),_0x29f958,_0x88cdf8);_0x5d7441(_0x88cdf8);});});}function respondWithStatusCode(_0x1c8c37,_0x4b2656){_0x4b2656=_0x4b2656||0xcc;return function(_0x2e9f2d){if(_0x2e9f2d){return _0x1c8c37[_0x6114('0x2f')](_0x4b2656);}return _0x1c8c37[_0x6114('0x30')](_0x4b2656)[_0x6114('0x31')]();};}function respondWithResult(_0x2ac706,_0x59b2ab){_0x59b2ab=_0x59b2ab||0xc8;return function(_0x187b62){if(_0x187b62){return _0x2ac706[_0x6114('0x30')](_0x59b2ab)[_0x6114('0x32')](_0x187b62);}};}function respondWithFilteredResult(_0x2ba299,_0x4ca880){return function(_0x2c4d11){if(_0x2c4d11){var _0x4e82e6=typeof _0x4ca880[_0x6114('0x33')]===_0x6114('0x34')&&typeof _0x4ca880[_0x6114('0x35')]===_0x6114('0x34');var _0x5ad25e=_0x2c4d11[_0x6114('0x36')];var _0x3cc31f=_0x4e82e6?0x0:_0x4ca880[_0x6114('0x33')];var _0x298fb3=_0x4e82e6?_0x2c4d11[_0x6114('0x36')]:_0x4ca880['offset']+_0x4ca880[_0x6114('0x35')];var _0x54705f;if(_0x298fb3>=_0x5ad25e){_0x298fb3=_0x5ad25e;_0x54705f=0xc8;}else{_0x54705f=0xce;}_0x2ba299['status'](_0x54705f);return _0x2ba299[_0x6114('0x37')](_0x6114('0x38'),_0x3cc31f+'-'+_0x298fb3+'/'+_0x5ad25e)[_0x6114('0x32')](_0x2c4d11);}return null;};}function patchUpdates(_0x515bf4){return function(_0x595fac){try{jsonpatch[_0x6114('0x39')](_0x595fac,_0x515bf4,!![]);}catch(_0xd598c5){return BPromise[_0x6114('0x3a')](_0xd598c5);}return _0x595fac[_0x6114('0x3b')]();};}function saveUpdates(_0x6ab3d1,_0x385849){return function(_0xe4a89c){if(_0xe4a89c){return _0xe4a89c[_0x6114('0x3c')](_0x6ab3d1)['then'](function(_0x9f0d84){return _0x9f0d84;});}return null;};}function removeEntity(_0x9c1a28,_0x5bdcdf){return function(_0x486dfa){if(_0x486dfa){return _0x486dfa[_0x6114('0x3d')]()[_0x6114('0x23')](function(){_0x9c1a28[_0x6114('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d6cc3,_0x54b5cc){return function(_0x50169e){if(!_0x50169e){_0x3d6cc3['sendStatus'](0x194);}return _0x50169e;};}function handleError(_0x286366,_0x156bd5){_0x156bd5=_0x156bd5||0x1f4;return function(_0x562124){logger[_0x6114('0x2a')](_0x562124[_0x6114('0x3e')]);if(_0x562124[_0x6114('0x3f')]){delete _0x562124['name'];}_0x286366[_0x6114('0x30')](_0x156bd5)[_0x6114('0x40')](_0x562124);};}exports[_0x6114('0x41')]=function(_0x26888f,_0x517fb9){var _0x19f1c2={},_0x24c99d={},_0x4e5535={'count':0x0,'rows':[]};var _0x2d0f8b=_[_0x6114('0x42')](db['SmsMessage']['rawAttributes'],function(_0x460f18){return{'name':_0x460f18[_0x6114('0x43')],'type':_0x460f18[_0x6114('0x44')][_0x6114('0x45')]};});_0x24c99d[_0x6114('0x46')]=_[_0x6114('0x42')](_0x2d0f8b,_0x6114('0x3f'));_0x24c99d[_0x6114('0x47')]=_[_0x6114('0x48')](_0x26888f[_0x6114('0x47')]);_0x24c99d[_0x6114('0x49')]=_[_0x6114('0x4a')](_0x24c99d[_0x6114('0x46')],_0x24c99d[_0x6114('0x47')]);_0x19f1c2[_0x6114('0x4b')]=_[_0x6114('0x4a')](_0x24c99d[_0x6114('0x46')],qs[_0x6114('0x4c')](_0x26888f[_0x6114('0x47')]['fields']));_0x19f1c2[_0x6114('0x4b')]=_0x19f1c2[_0x6114('0x4b')][_0x6114('0x4d')]?_0x19f1c2['attributes']:_0x24c99d[_0x6114('0x46')];if(!_0x26888f['query'][_0x6114('0x4e')]('nolimit')){_0x19f1c2[_0x6114('0x35')]=qs[_0x6114('0x35')](_0x26888f['query'][_0x6114('0x35')]);_0x19f1c2['offset']=qs[_0x6114('0x33')](_0x26888f[_0x6114('0x47')]['offset']);}_0x19f1c2[_0x6114('0x4f')]=qs[_0x6114('0x50')](_0x26888f[_0x6114('0x47')][_0x6114('0x50')]);_0x19f1c2['where']=qs[_0x6114('0x49')](_[_0x6114('0x51')](_0x26888f['query'],_0x24c99d[_0x6114('0x49')]),_0x2d0f8b);if(_0x26888f[_0x6114('0x47')][_0x6114('0x52')]){_0x19f1c2['where']=_['merge'](_0x19f1c2[_0x6114('0x53')],{'$or':_[_0x6114('0x42')](_0x2d0f8b,function(_0x3534a4){if(_0x3534a4[_0x6114('0x44')]!==_0x6114('0x54')){var _0xa58c37={};_0xa58c37[_0x3534a4['name']]={'$like':'%'+_0x26888f[_0x6114('0x47')][_0x6114('0x52')]+'%'};return _0xa58c37;}})});}_0x19f1c2=_['merge']({},_0x19f1c2,_0x26888f['options']);var _0x3d8cb6={'where':_0x19f1c2[_0x6114('0x53')]};return db[_0x6114('0x55')][_0x6114('0x36')](_0x3d8cb6)[_0x6114('0x23')](function(_0x38e9af){_0x4e5535[_0x6114('0x36')]=_0x38e9af;if(_0x26888f['query'][_0x6114('0x56')]){_0x19f1c2[_0x6114('0x57')]=[{'all':!![]}];}return db[_0x6114('0x55')][_0x6114('0x58')](_0x19f1c2);})[_0x6114('0x23')](function(_0x1cc1e6){_0x4e5535[_0x6114('0x59')]=_0x1cc1e6;return _0x4e5535;})[_0x6114('0x23')](respondWithFilteredResult(_0x517fb9,_0x19f1c2))[_0x6114('0x2e')](handleError(_0x517fb9,null));};exports['show']=function(_0x1cccfd,_0x5d79c6){var _0x1c5320={'raw':!![],'where':{'id':_0x1cccfd[_0x6114('0x5a')]['id']}},_0x4263e0={};_0x4263e0['model']=_[_0x6114('0x48')](db[_0x6114('0x55')]['rawAttributes']);_0x4263e0['query']=_[_0x6114('0x48')](_0x1cccfd[_0x6114('0x47')]);_0x4263e0['filters']=_['intersection'](_0x4263e0['model'],_0x4263e0[_0x6114('0x47')]);_0x1c5320['attributes']=_['intersection'](_0x4263e0[_0x6114('0x46')],qs['fields'](_0x1cccfd[_0x6114('0x47')][_0x6114('0x4c')]));_0x1c5320['attributes']=_0x1c5320[_0x6114('0x4b')][_0x6114('0x4d')]?_0x1c5320[_0x6114('0x4b')]:_0x4263e0[_0x6114('0x46')];if(_0x1cccfd['query'][_0x6114('0x56')]){_0x1c5320['include']=[{'all':!![]}];}_0x1c5320=_[_0x6114('0x5b')]({},_0x1c5320,_0x1cccfd[_0x6114('0x5c')]);return db[_0x6114('0x55')][_0x6114('0x5d')](_0x1c5320)[_0x6114('0x23')](handleEntityNotFound(_0x5d79c6,null))[_0x6114('0x23')](respondWithResult(_0x5d79c6,null))[_0x6114('0x2e')](handleError(_0x5d79c6,null));};exports[_0x6114('0x5e')]=function(_0x8c9f29,_0x3db0f7){return db[_0x6114('0x55')][_0x6114('0x5e')](_0x8c9f29[_0x6114('0x5f')],{})[_0x6114('0x23')](respondWithResult(_0x3db0f7,0xc9))[_0x6114('0x2e')](handleError(_0x3db0f7,null));};exports[_0x6114('0x3c')]=function(_0x431bfd,_0x3ba75f){if(_0x431bfd[_0x6114('0x5f')]['id']){delete _0x431bfd[_0x6114('0x5f')]['id'];}return db[_0x6114('0x55')][_0x6114('0x5d')]({'where':{'id':_0x431bfd[_0x6114('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ba75f,null))[_0x6114('0x23')](saveUpdates(_0x431bfd[_0x6114('0x5f')],null))['then'](respondWithResult(_0x3ba75f,null))['catch'](handleError(_0x3ba75f,null));};exports[_0x6114('0x3d')]=function(_0x165f18,_0x52b5c9){return db[_0x6114('0x55')][_0x6114('0x5d')]({'where':{'id':_0x165f18['params']['id']}})[_0x6114('0x23')](handleEntityNotFound(_0x52b5c9,null))[_0x6114('0x23')](removeEntity(_0x52b5c9,null))[_0x6114('0x2e')](handleError(_0x52b5c9,null));};exports[_0x6114('0x60')]=function(_0x50f609,_0x1cb375){return db['SmsMessage'][_0x6114('0x60')]()[_0x6114('0x23')](respondWithResult(_0x1cb375,null))[_0x6114('0x2e')](handleError(_0x1cb375,null));};var interaction_log=require(_0x6114('0x61'))(_0x6114('0x62'));exports[_0x6114('0x63')]=function(_0x59c86d,_0x33c677,_0x29fee0){var _0x589d53={'agent':{},'channel':'sms'};if(_0x59c86d['body']['id']){delete _0x59c86d['body']['id'];}_0x59c86d['body'][_0x6114('0x64')]=!![];_0x59c86d[_0x6114('0x5f')]['readAt']=moment()[_0x6114('0x65')](_0x6114('0x66'));_0x59c86d[_0x6114('0x5f')][_0x6114('0x67')]=_0x59c86d[_0x6114('0x5f')][_0x6114('0x67')]||_0x59c86d[_0x6114('0x68')]['id'];_0x589d53[_0x6114('0x69')]['id']=_0x59c86d[_0x6114('0x5f')][_0x6114('0x67')];return db[_0x6114('0x55')][_0x6114('0x5d')]({'where':{'id':_0x59c86d[_0x6114('0x5a')]['id'],'UserId':null}})[_0x6114('0x23')](handleEntityNotFound(_0x33c677,null))[_0x6114('0x23')](saveUpdates(_0x59c86d[_0x6114('0x5f')],null))[_0x6114('0x23')](function(_0x1ec222){if(_0x1ec222){_0x589d53['message']=_0x1ec222['get']({'plain':!![]});return db[_0x6114('0x6a')][_0x6114('0x5d')]({'where':{'id':_0x1ec222[_0x6114('0x6b')]}});}return null;})[_0x6114('0x23')](handleEntityNotFound(_0x33c677,null))[_0x6114('0x23')](function(_0x30c921){if(_0x30c921){return _0x30c921['update']({'UserId':_0x59c86d['body'][_0x6114('0x67')],'read1stAt':_[_0x6114('0x6c')](_0x30c921[_0x6114('0x6d')])?moment()[_0x6114('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6114('0x23')](function(_0x49f878){if(_0x49f878){_0x589d53[_0x6114('0x6e')]=_0x49f878[_0x6114('0x6f')]({'plain':!![]});interaction_log[_0x6114('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59c86d[_0x6114('0x68')]['id'],_0x59c86d['user'][_0x6114('0x3f')],_0x59c86d['user'][_0x6114('0x70')],_0x589d53['interaction']['id'],_0x59c86d['body']?JSON[_0x6114('0x29')](_0x59c86d['body']):_0x6114('0x71'));return respondWithRpcPromise('AcceptMessage',_0x6114('0x72'),_0x589d53);}return null;})['then'](function(_0x1170b1){var _0x102a3c=_0x6114('0x73')+_0x1170b1[_0x6114('0x2c')][_0x6114('0x74')];return db['sequelize'][_0x6114('0x47')](_0x102a3c,{'type':db[_0x6114('0x75')][_0x6114('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x4f5cbb){return _0x4f5cbb;});})[_0x6114('0x23')](function(_0x207614){if(_0x207614){_0x589d53['message'][_0x6114('0x77')]=_0x207614[0x0];if(!_0x59c86d[_0x6114('0x5f')]['UserId'])return;return db['User']['find']({'where':{'id':_0x59c86d[_0x6114('0x5f')]['UserId'],'role':_0x6114('0x69')},'attributes':['id',_0x6114('0x3f'),_0x6114('0x78'),_0x6114('0x79'),_0x6114('0x7a')],'raw':!![]});}return null;})[_0x6114('0x23')](function(_0x5764fa){if(!_0x5764fa)return null;_0x589d53['message'][_0x6114('0x69')]=_0x5764fa;return _0x589d53;})['then'](function(_0x401feb){if(_0x401feb){if(_0x59c86d[_0x6114('0x5f')][_0x6114('0x7b')]){_0x589d53['message'][_0x6114('0x7c')]=util['format'](_0x6114('0x7d'),_0x59c86d[_0x6114('0x68')][_0x6114('0x3f')]);_0x589d53[_0x6114('0x2c')][_0x6114('0x7e')]=_0x589d53[_0x6114('0x7e')];_0x589d53[_0x6114('0x2c')][_0x6114('0x7f')]='accept';return respondWithRpcPromise(_0x6114('0x80'),_0x6114('0x80'),{'event':_0x6114('0x81'),'message':_0x589d53['message']},client9002)[_0x6114('0x23')](function(){return _0x589d53;});}return _0x589d53;}return null;})[_0x6114('0x23')](respondWithResult(_0x33c677,null))[_0x6114('0x2e')](handleError(_0x33c677,null));};var interaction_log=require(_0x6114('0x61'))(_0x6114('0x62'));exports[_0x6114('0x3a')]=function(_0x522556,_0x386609,_0x75e8f2){var _0x25304a={'agent':{},'channel':_0x6114('0x82')};if(_0x522556[_0x6114('0x5f')]['id']){delete _0x522556['body']['id'];}_0x522556[_0x6114('0x5f')][_0x6114('0x67')]=_0x522556[_0x6114('0x5f')][_0x6114('0x67')]||_0x522556[_0x6114('0x68')]['id'];_0x25304a['agent']['id']=_0x522556[_0x6114('0x5f')][_0x6114('0x67')];return db['SmsMessage']['find']({'where':{'id':_0x522556[_0x6114('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x386609,null))['then'](function(_0x4eeaae){if(_0x4eeaae){_0x25304a['message']=_0x4eeaae[_0x6114('0x6f')]({'plain':!![]});return db[_0x6114('0x6a')][_0x6114('0x5d')]({'where':{'id':_0x4eeaae[_0x6114('0x6b')]}});}return null;})[_0x6114('0x23')](handleEntityNotFound(_0x386609,null))['then'](function(_0x26accc){if(_0x26accc){_0x25304a[_0x6114('0x6e')]=_0x26accc[_0x6114('0x6f')]({'plain':!![]});interaction_log[_0x6114('0x24')](_0x6114('0x83'),_0x522556[_0x6114('0x68')]['id'],_0x522556['user'][_0x6114('0x3f')],_0x522556[_0x6114('0x68')][_0x6114('0x70')],_0x25304a[_0x6114('0x6e')]['id'],_0x522556[_0x6114('0x5f')]?JSON[_0x6114('0x29')](_0x522556[_0x6114('0x5f')]):_0x6114('0x71'));return respondWithRpcPromise(_0x6114('0x84'),_0x6114('0x85'),_0x25304a);}return null;})['then'](function(_0x490c72){var _0x552578='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x490c72[_0x6114('0x2c')][_0x6114('0x74')];return db['sequelize'][_0x6114('0x47')](_0x552578,{'type':db[_0x6114('0x75')]['QueryTypes'][_0x6114('0x86')],'raw':!![]})[_0x6114('0x23')](function(_0x4c4f26){return _0x4c4f26;});})['then'](function(_0x3f6d8c){if(_0x3f6d8c){_0x25304a[_0x6114('0x2c')][_0x6114('0x77')]=_0x3f6d8c[0x0];if(!_0x522556[_0x6114('0x5f')][_0x6114('0x67')])return;return db[_0x6114('0x87')][_0x6114('0x5d')]({'where':{'id':_0x522556['body'][_0x6114('0x67')],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x6114('0x23')](function(_0x197f4d){if(!_0x197f4d)return null;_0x25304a[_0x6114('0x2c')][_0x6114('0x69')]=_0x197f4d;return _0x25304a;})['then'](function(_0x2165d8){if(_0x2165d8){_0x2165d8[_0x6114('0x2c')][_0x6114('0x7c')]=util[_0x6114('0x65')](_0x6114('0x7d'),_0x522556[_0x6114('0x68')][_0x6114('0x3f')]);_0x2165d8['message'][_0x6114('0x7e')]=_0x25304a[_0x6114('0x7e')];_0x2165d8[_0x6114('0x2c')][_0x6114('0x7f')]=_0x6114('0x3a');respondWithRpcPromise(_0x6114('0x80'),'EventManager',{'event':_0x6114('0x88'),'message':_0x2165d8[_0x6114('0x2c')]},client9002);return _0x25304a;}return null;})[_0x6114('0x23')](respondWithResult(_0x386609,null))[_0x6114('0x2e')](handleError(_0x386609,null));};exports[_0x6114('0x30')]=function(_0xd7bc55,_0x5e3ece,_0x47b9a3){if(_0xd7bc55[_0x6114('0x5f')]['id']){delete _0xd7bc55[_0x6114('0x5f')]['id'];}var _0x40d957;return db[_0x6114('0x55')]['find']({'where':{'id':_0xd7bc55[_0x6114('0x5a')]['id']}})[_0x6114('0x23')](handleEntityNotFound(_0x5e3ece,null))[_0x6114('0x23')](function(_0x2cc94f){if(_0x2cc94f){_0x40d957=_0x2cc94f;return db['SmsAccount'][_0x6114('0x5d')]({'where':{'id':_0x2cc94f[_0x6114('0x89')]}});}})[_0x6114('0x23')](handleEntityNotFound(_0x5e3ece,null))[_0x6114('0x23')](function(_0x3633f8){if(_0x3633f8){logger[_0x6114('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6114('0x30'),'received\x20delivery\x20report\x20from',_0x3633f8['type'],util[_0x6114('0x8a')](_0xd7bc55[_0x6114('0x5f')],{'showHidden':![],'depth':null}));switch(_0x3633f8[_0x6114('0x44')]){case _0x6114('0x8b'):if(_0xd7bc55[_0x6114('0x5f')]['MessageSid']&&_0xd7bc55[_0x6114('0x5f')]['MessageSid']===_0x40d957[_0x6114('0x8c')]){return _0x40d957[_0x6114('0x3c')]({'read':!![]});}else{logger[_0x6114('0x2a')](_0x6114('0x8d'),_0x6114('0x30'),_0x6114('0x8b'),util['inspect'](_0xd7bc55['body'],{'showHidden':![],'depth':null}));}break;case _0x6114('0x8e'):if(_0xd7bc55['body'][_0x6114('0x8f')]&&_0xd7bc55[_0x6114('0x5f')][_0x6114('0x8f')]===_0x40d957['messageId']&&_['indexOf']([_0x6114('0x90'),'delivered'],_0xd7bc55[_0x6114('0x5f')][_0x6114('0x91')])>=0x0){return _0x40d957[_0x6114('0x3c')]({'read':!![]});}else{logger[_0x6114('0x2a')](_0x6114('0x8d'),_0x6114('0x30'),_0x6114('0x92'),util[_0x6114('0x8a')](_0xd7bc55[_0x6114('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x6114('0x93'):var _0x55bbe0=_0xd7bc55[_0x6114('0x5f')][_0x6114('0x94')][0x0];if(_0x55bbe0[_0x6114('0x30')][_0x6114('0x95')]==='DELIVERED'){return _0x40d957[_0x6114('0x3c')]({'read':!![]});}else{logger[_0x6114('0x2a')](_0x6114('0x8d'),_0x6114('0x30'),'infobip',util['inspect'](_0xd7bc55[_0x6114('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x40d957;}})[_0x6114('0x23')](respondWithResult(_0x5e3ece,null))[_0x6114('0x2e')](handleError(_0x5e3ece,null));}; \ No newline at end of file +var _0x50f1=['api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','user','SmsInteraction','SmsInteractionId','UserId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','agent','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','reject','sms','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','email','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','DELIVERED','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4b9eaf,_0x390733){var _0x38ae4f=function(_0x290e7f){while(--_0x290e7f){_0x4b9eaf['push'](_0x4b9eaf['shift']());}};_0x38ae4f(++_0x390733);}(_0x50f1,0x111));var _0x150f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50f1[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x150f('0x0'));var jsonpatch=require(_0x150f('0x1'));var rp=require(_0x150f('0x2'));var moment=require(_0x150f('0x3'));var BPromise=require(_0x150f('0x4'));var Mustache=require(_0x150f('0x5'));var util=require('util');var path=require(_0x150f('0x6'));var sox=require(_0x150f('0x7'));var csv=require('to-csv');var ejs=require(_0x150f('0x8'));var fs=require('fs');var fs_extra=require(_0x150f('0x9'));var _=require('lodash');var squel=require(_0x150f('0xa'));var crypto=require(_0x150f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x150f('0xc'));var Papa=require(_0x150f('0xd'));var Redis=require(_0x150f('0xe'));var authService=require(_0x150f('0xf'));var qs=require(_0x150f('0x10'));var as=require(_0x150f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x150f('0x12'))(_0x150f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x150f('0x14'));var db=require(_0x150f('0x15'))['db'];config['redis']=_[_0x150f('0x16')](config[_0x150f('0x17')],{'host':_0x150f('0x18'),'port':0x18eb});var socket=require(_0x150f('0x19'))(new Redis(config[_0x150f('0x17')]));require(_0x150f('0x1a'))['register'](socket);var jayson=require(_0x150f('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x150f('0x1c')][_0x150f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x22e2d8,_0x59bc52,_0x72fb46,_0xd8c23e){return new BPromise(function(_0x4d9f93,_0x181fcf){var _0xccc361=_0xd8c23e||client;return _0xccc361['request'](_0x22e2d8,_0x72fb46)[_0x150f('0x1e')](function(_0x25785f){logger[_0x150f('0x1f')](_0x150f('0x20'),_0x59bc52,_0x150f('0x21'));logger[_0x150f('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x59bc52,_0x150f('0x21'),JSON['stringify'](_0x25785f));if(_0x25785f[_0x150f('0x23')]){if(_0x25785f[_0x150f('0x23')][_0x150f('0x24')]===0x1f4){logger[_0x150f('0x23')](_0x150f('0x20'),_0x59bc52,_0x25785f['error']['message']);return _0x181fcf(_0x25785f[_0x150f('0x23')]['message']);}logger[_0x150f('0x23')]('SmsMessage,\x20%s,\x20%s',_0x59bc52,_0x25785f['error'][_0x150f('0x25')]);return _0x4d9f93(_0x25785f[_0x150f('0x23')][_0x150f('0x25')]);}else{logger[_0x150f('0x1f')](_0x150f('0x20'),_0x59bc52,_0x150f('0x21'));_0x4d9f93(_0x25785f[_0x150f('0x26')][_0x150f('0x25')]);}})[_0x150f('0x27')](function(_0x458ef9){logger[_0x150f('0x23')]('SmsMessage,\x20%s,\x20%s',_0x59bc52,_0x458ef9);_0x181fcf(_0x458ef9);});});}function respondWithStatusCode(_0x4daf8d,_0x9bea15){_0x9bea15=_0x9bea15||0xcc;return function(_0x5285fa){if(_0x5285fa){return _0x4daf8d[_0x150f('0x28')](_0x9bea15);}return _0x4daf8d['status'](_0x9bea15)['end']();};}function respondWithResult(_0x2407a4,_0x183f37){_0x183f37=_0x183f37||0xc8;return function(_0x1eb3b0){if(_0x1eb3b0){return _0x2407a4[_0x150f('0x29')](_0x183f37)['json'](_0x1eb3b0);}};}function respondWithFilteredResult(_0x44d5d5,_0x53adcd){return function(_0x1b801e){if(_0x1b801e){var _0x33c2d9=typeof _0x53adcd[_0x150f('0x2a')]===_0x150f('0x2b')&&typeof _0x53adcd[_0x150f('0x2c')]===_0x150f('0x2b');var _0x211910=_0x1b801e[_0x150f('0x2d')];var _0x5544d7=_0x33c2d9?0x0:_0x53adcd[_0x150f('0x2a')];var _0x948ec0=_0x33c2d9?_0x1b801e[_0x150f('0x2d')]:_0x53adcd[_0x150f('0x2a')]+_0x53adcd[_0x150f('0x2c')];var _0x566188;if(_0x948ec0>=_0x211910){_0x948ec0=_0x211910;_0x566188=0xc8;}else{_0x566188=0xce;}_0x44d5d5[_0x150f('0x29')](_0x566188);return _0x44d5d5['set'](_0x150f('0x2e'),_0x5544d7+'-'+_0x948ec0+'/'+_0x211910)[_0x150f('0x2f')](_0x1b801e);}return null;};}function patchUpdates(_0x4d6ff1){return function(_0x1abf8f){try{jsonpatch[_0x150f('0x30')](_0x1abf8f,_0x4d6ff1,!![]);}catch(_0x2de037){return BPromise['reject'](_0x2de037);}return _0x1abf8f[_0x150f('0x31')]();};}function saveUpdates(_0x1bf992,_0x2f6642){return function(_0x3f5308){if(_0x3f5308){return _0x3f5308['update'](_0x1bf992)[_0x150f('0x1e')](function(_0x2ac145){return _0x2ac145;});}return null;};}function removeEntity(_0x143e83,_0x28d055){return function(_0x4759b2){if(_0x4759b2){return _0x4759b2['destroy']()[_0x150f('0x1e')](function(){_0x143e83['status'](0xcc)[_0x150f('0x32')]();});}};}function handleEntityNotFound(_0x554ee7,_0x4e7942){return function(_0x213719){if(!_0x213719){_0x554ee7[_0x150f('0x28')](0x194);}return _0x213719;};}function handleError(_0x3b5660,_0x215d37){_0x215d37=_0x215d37||0x1f4;return function(_0x324c6a){logger[_0x150f('0x23')](_0x324c6a[_0x150f('0x33')]);if(_0x324c6a[_0x150f('0x34')]){delete _0x324c6a[_0x150f('0x34')];}_0x3b5660[_0x150f('0x29')](_0x215d37)[_0x150f('0x35')](_0x324c6a);};}exports[_0x150f('0x36')]=function(_0x430568,_0x1a2c47){var _0x44dc74={},_0x4f8add={},_0x2a297d={'count':0x0,'rows':[]};var _0x5e3b89=_[_0x150f('0x37')](db[_0x150f('0x38')][_0x150f('0x39')],function(_0x510bc8){return{'name':_0x510bc8[_0x150f('0x3a')],'type':_0x510bc8[_0x150f('0x3b')]['key']};});_0x4f8add[_0x150f('0x3c')]=_['map'](_0x5e3b89,_0x150f('0x34'));_0x4f8add[_0x150f('0x3d')]=_[_0x150f('0x3e')](_0x430568['query']);_0x4f8add[_0x150f('0x3f')]=_[_0x150f('0x40')](_0x4f8add['model'],_0x4f8add[_0x150f('0x3d')]);_0x44dc74[_0x150f('0x41')]=_[_0x150f('0x40')](_0x4f8add[_0x150f('0x3c')],qs[_0x150f('0x42')](_0x430568[_0x150f('0x3d')][_0x150f('0x42')]));_0x44dc74[_0x150f('0x41')]=_0x44dc74['attributes'][_0x150f('0x43')]?_0x44dc74[_0x150f('0x41')]:_0x4f8add[_0x150f('0x3c')];if(!_0x430568[_0x150f('0x3d')][_0x150f('0x44')]('nolimit')){_0x44dc74[_0x150f('0x2c')]=qs[_0x150f('0x2c')](_0x430568[_0x150f('0x3d')][_0x150f('0x2c')]);_0x44dc74['offset']=qs[_0x150f('0x2a')](_0x430568[_0x150f('0x3d')][_0x150f('0x2a')]);}_0x44dc74['order']=qs[_0x150f('0x45')](_0x430568[_0x150f('0x3d')][_0x150f('0x45')]);_0x44dc74[_0x150f('0x46')]=qs[_0x150f('0x3f')](_[_0x150f('0x47')](_0x430568[_0x150f('0x3d')],_0x4f8add[_0x150f('0x3f')]),_0x5e3b89);if(_0x430568['query']['filter']){_0x44dc74['where']=_['merge'](_0x44dc74['where'],{'$or':_['map'](_0x5e3b89,function(_0x5eb04b){if(_0x5eb04b[_0x150f('0x3b')]!==_0x150f('0x48')){var _0x2ed3dc={};_0x2ed3dc[_0x5eb04b['name']]={'$like':'%'+_0x430568[_0x150f('0x3d')][_0x150f('0x49')]+'%'};return _0x2ed3dc;}})});}_0x44dc74=_[_0x150f('0x4a')]({},_0x44dc74,_0x430568[_0x150f('0x4b')]);var _0x13eccf={'where':_0x44dc74[_0x150f('0x46')]};return db['SmsMessage'][_0x150f('0x2d')](_0x13eccf)[_0x150f('0x1e')](function(_0x55af48){_0x2a297d[_0x150f('0x2d')]=_0x55af48;if(_0x430568[_0x150f('0x3d')][_0x150f('0x4c')]){_0x44dc74[_0x150f('0x4d')]=[{'all':!![]}];}return db['SmsMessage'][_0x150f('0x4e')](_0x44dc74);})[_0x150f('0x1e')](function(_0x5b1b36){_0x2a297d[_0x150f('0x4f')]=_0x5b1b36;return _0x2a297d;})[_0x150f('0x1e')](respondWithFilteredResult(_0x1a2c47,_0x44dc74))[_0x150f('0x27')](handleError(_0x1a2c47,null));};exports[_0x150f('0x50')]=function(_0x2472a4,_0x4e3294){var _0x546f97={'raw':!![],'where':{'id':_0x2472a4[_0x150f('0x51')]['id']}},_0x140e50={};_0x140e50[_0x150f('0x3c')]=_[_0x150f('0x3e')](db[_0x150f('0x38')][_0x150f('0x39')]);_0x140e50['query']=_[_0x150f('0x3e')](_0x2472a4['query']);_0x140e50[_0x150f('0x3f')]=_[_0x150f('0x40')](_0x140e50[_0x150f('0x3c')],_0x140e50[_0x150f('0x3d')]);_0x546f97[_0x150f('0x41')]=_['intersection'](_0x140e50[_0x150f('0x3c')],qs[_0x150f('0x42')](_0x2472a4[_0x150f('0x3d')][_0x150f('0x42')]));_0x546f97[_0x150f('0x41')]=_0x546f97['attributes'][_0x150f('0x43')]?_0x546f97[_0x150f('0x41')]:_0x140e50[_0x150f('0x3c')];if(_0x2472a4[_0x150f('0x3d')][_0x150f('0x4c')]){_0x546f97[_0x150f('0x4d')]=[{'all':!![]}];}_0x546f97=_[_0x150f('0x4a')]({},_0x546f97,_0x2472a4[_0x150f('0x4b')]);return db['SmsMessage'][_0x150f('0x52')](_0x546f97)[_0x150f('0x1e')](handleEntityNotFound(_0x4e3294,null))['then'](respondWithResult(_0x4e3294,null))[_0x150f('0x27')](handleError(_0x4e3294,null));};exports[_0x150f('0x53')]=function(_0x2dbebb,_0x1f015d){return db[_0x150f('0x38')][_0x150f('0x53')](_0x2dbebb[_0x150f('0x54')],{})['then'](respondWithResult(_0x1f015d,0xc9))[_0x150f('0x27')](handleError(_0x1f015d,null));};exports[_0x150f('0x55')]=function(_0x47f4eb,_0xc6905f){if(_0x47f4eb[_0x150f('0x54')]['id']){delete _0x47f4eb[_0x150f('0x54')]['id'];}return db['SmsMessage'][_0x150f('0x52')]({'where':{'id':_0x47f4eb['params']['id']}})[_0x150f('0x1e')](handleEntityNotFound(_0xc6905f,null))['then'](saveUpdates(_0x47f4eb[_0x150f('0x54')],null))[_0x150f('0x1e')](respondWithResult(_0xc6905f,null))[_0x150f('0x27')](handleError(_0xc6905f,null));};exports['destroy']=function(_0x21c52e,_0x4aca38){return db['SmsMessage'][_0x150f('0x52')]({'where':{'id':_0x21c52e[_0x150f('0x51')]['id']}})[_0x150f('0x1e')](handleEntityNotFound(_0x4aca38,null))[_0x150f('0x1e')](removeEntity(_0x4aca38,null))[_0x150f('0x27')](handleError(_0x4aca38,null));};exports[_0x150f('0x56')]=function(_0x4235e4,_0x11df32){return db[_0x150f('0x38')][_0x150f('0x56')]()[_0x150f('0x1e')](respondWithResult(_0x11df32,null))[_0x150f('0x27')](handleError(_0x11df32,null));};var interaction_log=require(_0x150f('0x12'))(_0x150f('0x57'));exports[_0x150f('0x58')]=function(_0x479799,_0x2ea6db,_0x5a77d8){var _0x4c3f48={'agent':{},'channel':'sms'};if(_0x479799[_0x150f('0x54')]['id']){delete _0x479799[_0x150f('0x54')]['id'];}_0x479799[_0x150f('0x54')][_0x150f('0x59')]=!![];_0x479799[_0x150f('0x54')]['readAt']=moment()[_0x150f('0x5a')](_0x150f('0x5b'));_0x479799['body']['UserId']=_0x479799[_0x150f('0x54')]['UserId']||_0x479799[_0x150f('0x5c')]['id'];_0x4c3f48['agent']['id']=_0x479799[_0x150f('0x54')]['UserId'];return db[_0x150f('0x38')]['find']({'where':{'id':_0x479799[_0x150f('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ea6db,null))[_0x150f('0x1e')](saveUpdates(_0x479799['body'],null))[_0x150f('0x1e')](function(_0x125505){if(_0x125505){_0x4c3f48[_0x150f('0x25')]=_0x125505['get']({'plain':!![]});return db[_0x150f('0x5d')][_0x150f('0x52')]({'where':{'id':_0x125505[_0x150f('0x5e')]}});}return null;})[_0x150f('0x1e')](handleEntityNotFound(_0x2ea6db,null))[_0x150f('0x1e')](function(_0xa2710e){if(_0xa2710e){return _0xa2710e[_0x150f('0x55')]({'UserId':_0x479799[_0x150f('0x54')][_0x150f('0x5f')],'read1stAt':_[_0x150f('0x60')](_0xa2710e[_0x150f('0x61')])?moment()[_0x150f('0x5a')](_0x150f('0x5b')):undefined});}return null;})[_0x150f('0x1e')](function(_0x41c9c5){if(_0x41c9c5){_0x4c3f48[_0x150f('0x62')]=_0x41c9c5['get']({'plain':!![]});interaction_log[_0x150f('0x1f')](_0x150f('0x63'),_0x479799[_0x150f('0x5c')]['id'],_0x479799[_0x150f('0x5c')][_0x150f('0x34')],_0x479799[_0x150f('0x5c')]['role'],_0x4c3f48[_0x150f('0x62')]['id'],_0x479799['body']?JSON['stringify'](_0x479799['body']):_0x150f('0x64'));return respondWithRpcPromise(_0x150f('0x65'),'acceptMessage',_0x4c3f48);}return null;})[_0x150f('0x1e')](function(_0x1ec5d8){var _0x345a2c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ec5d8[_0x150f('0x25')][_0x150f('0x66')];return db[_0x150f('0x67')][_0x150f('0x3d')](_0x345a2c,{'type':db[_0x150f('0x68')][_0x150f('0x69')]['SELECT'],'raw':!![]})[_0x150f('0x1e')](function(_0x8500de){return _0x8500de;});})[_0x150f('0x1e')](function(_0x1c6cd2){if(_0x1c6cd2){_0x4c3f48[_0x150f('0x25')]['contact']=_0x1c6cd2[0x0];if(!_0x479799['body'][_0x150f('0x5f')])return;return db['User'][_0x150f('0x52')]({'where':{'id':_0x479799[_0x150f('0x54')][_0x150f('0x5f')],'role':_0x150f('0x6a')},'attributes':['id',_0x150f('0x34'),_0x150f('0x6b'),'email',_0x150f('0x6c')],'raw':!![]});}return null;})[_0x150f('0x1e')](function(_0x303e7e){if(!_0x303e7e)return null;_0x4c3f48[_0x150f('0x25')][_0x150f('0x6a')]=_0x303e7e;return _0x4c3f48;})[_0x150f('0x1e')](function(_0x341631){if(_0x341631){if(_0x479799[_0x150f('0x54')][_0x150f('0x6d')]){_0x4c3f48[_0x150f('0x25')][_0x150f('0x6e')]=util[_0x150f('0x5a')](_0x150f('0x6f'),_0x479799[_0x150f('0x5c')]['name']);_0x4c3f48[_0x150f('0x25')][_0x150f('0x70')]=_0x4c3f48[_0x150f('0x70')];_0x4c3f48['message'][_0x150f('0x71')]='accept';return respondWithRpcPromise(_0x150f('0x72'),_0x150f('0x72'),{'event':'acceptmessage','message':_0x4c3f48[_0x150f('0x25')]},client9002)[_0x150f('0x1e')](function(){return _0x4c3f48;});}return _0x4c3f48;}return null;})[_0x150f('0x1e')](respondWithResult(_0x2ea6db,null))[_0x150f('0x27')](handleError(_0x2ea6db,null));};var interaction_log=require(_0x150f('0x12'))('sms-interactions');exports[_0x150f('0x73')]=function(_0x41f0f6,_0x296dae,_0x3d5285){var _0x336add={'agent':{},'channel':_0x150f('0x74')};if(_0x41f0f6[_0x150f('0x54')]['id']){delete _0x41f0f6[_0x150f('0x54')]['id'];}_0x41f0f6['body'][_0x150f('0x5f')]=_0x41f0f6[_0x150f('0x54')][_0x150f('0x5f')]||_0x41f0f6[_0x150f('0x5c')]['id'];_0x336add['agent']['id']=_0x41f0f6[_0x150f('0x54')][_0x150f('0x5f')];return db[_0x150f('0x38')][_0x150f('0x52')]({'where':{'id':_0x41f0f6[_0x150f('0x51')]['id'],'UserId':null}})[_0x150f('0x1e')](handleEntityNotFound(_0x296dae,null))[_0x150f('0x1e')](function(_0x389595){if(_0x389595){_0x336add[_0x150f('0x25')]=_0x389595[_0x150f('0x75')]({'plain':!![]});return db[_0x150f('0x5d')][_0x150f('0x52')]({'where':{'id':_0x389595[_0x150f('0x5e')]}});}return null;})[_0x150f('0x1e')](handleEntityNotFound(_0x296dae,null))[_0x150f('0x1e')](function(_0x2e65e9){if(_0x2e65e9){_0x336add['interaction']=_0x2e65e9[_0x150f('0x75')]({'plain':!![]});interaction_log[_0x150f('0x1f')](_0x150f('0x76'),_0x41f0f6[_0x150f('0x5c')]['id'],_0x41f0f6[_0x150f('0x5c')]['name'],_0x41f0f6[_0x150f('0x5c')][_0x150f('0x77')],_0x336add[_0x150f('0x62')]['id'],_0x41f0f6[_0x150f('0x54')]?JSON[_0x150f('0x78')](_0x41f0f6['body']):_0x150f('0x64'));return respondWithRpcPromise(_0x150f('0x79'),_0x150f('0x7a'),_0x336add);}return null;})[_0x150f('0x1e')](function(_0x3422e8){var _0x15b0ab=_0x150f('0x7b')+_0x3422e8[_0x150f('0x25')][_0x150f('0x66')];return db[_0x150f('0x67')][_0x150f('0x3d')](_0x15b0ab,{'type':db[_0x150f('0x68')][_0x150f('0x69')][_0x150f('0x7c')],'raw':!![]})[_0x150f('0x1e')](function(_0x5326a1){return _0x5326a1;});})[_0x150f('0x1e')](function(_0x1e3920){if(_0x1e3920){_0x336add['message'][_0x150f('0x7d')]=_0x1e3920[0x0];if(!_0x41f0f6[_0x150f('0x54')][_0x150f('0x5f')])return;return db['User'][_0x150f('0x52')]({'where':{'id':_0x41f0f6[_0x150f('0x54')][_0x150f('0x5f')],'role':_0x150f('0x6a')},'attributes':['id',_0x150f('0x34'),_0x150f('0x6b'),_0x150f('0x7e'),_0x150f('0x6c')],'raw':!![]});}return null;})['then'](function(_0x530d15){if(!_0x530d15)return null;_0x336add[_0x150f('0x25')]['agent']=_0x530d15;return _0x336add;})[_0x150f('0x1e')](function(_0x134bd0){if(_0x134bd0){_0x134bd0[_0x150f('0x25')][_0x150f('0x6e')]=util['format']('SIP/%s',_0x41f0f6[_0x150f('0x5c')][_0x150f('0x34')]);_0x134bd0[_0x150f('0x25')][_0x150f('0x70')]=_0x336add['channel'];_0x134bd0['message'][_0x150f('0x71')]=_0x150f('0x73');respondWithRpcPromise(_0x150f('0x72'),_0x150f('0x72'),{'event':'rejectmessage','message':_0x134bd0[_0x150f('0x25')]},client9002);return _0x336add;}return null;})[_0x150f('0x1e')](respondWithResult(_0x296dae,null))[_0x150f('0x27')](handleError(_0x296dae,null));};exports[_0x150f('0x29')]=function(_0x42456a,_0x3421f1,_0x40f6c0){if(_0x42456a[_0x150f('0x54')]['id']){delete _0x42456a[_0x150f('0x54')]['id'];}var _0x1e27e2;return db[_0x150f('0x38')]['find']({'where':{'id':_0x42456a[_0x150f('0x51')]['id']}})['then'](handleEntityNotFound(_0x3421f1,null))['then'](function(_0xa16848){if(_0xa16848){_0x1e27e2=_0xa16848;return db[_0x150f('0x7f')][_0x150f('0x52')]({'where':{'id':_0xa16848[_0x150f('0x80')]}});}})[_0x150f('0x1e')](handleEntityNotFound(_0x3421f1,null))[_0x150f('0x1e')](function(_0x201f07){if(_0x201f07){logger[_0x150f('0x22')](_0x150f('0x81'),_0x150f('0x29'),_0x150f('0x82'),_0x201f07[_0x150f('0x3b')],util[_0x150f('0x83')](_0x42456a[_0x150f('0x54')],{'showHidden':![],'depth':null}));switch(_0x201f07[_0x150f('0x3b')]){case _0x150f('0x84'):if(_0x42456a[_0x150f('0x54')][_0x150f('0x85')]&&_0x42456a['body'][_0x150f('0x85')]===_0x1e27e2[_0x150f('0x86')]){return _0x1e27e2[_0x150f('0x55')]({'read':!![]});}else{logger[_0x150f('0x23')](_0x150f('0x87'),'status',_0x150f('0x84'),util[_0x150f('0x83')](_0x42456a[_0x150f('0x54')],{'showHidden':![],'depth':null}));}break;case _0x150f('0x88'):if(_0x42456a[_0x150f('0x54')][_0x150f('0x89')]&&_0x42456a[_0x150f('0x54')][_0x150f('0x89')]===_0x1e27e2['messageId']&&_[_0x150f('0x8a')]([_0x150f('0x8b'),_0x150f('0x8c')],_0x42456a[_0x150f('0x54')]['Status'])>=0x0){return _0x1e27e2[_0x150f('0x55')]({'read':!![]});}else{logger[_0x150f('0x23')](_0x150f('0x87'),_0x150f('0x29'),_0x150f('0x8d'),util['inspect'](_0x42456a[_0x150f('0x54')],{'showHidden':![],'depth':null}));}break;case _0x150f('0x8e'):var _0xc3c948=_0x42456a[_0x150f('0x54')][_0x150f('0x8f')][0x0];if(_0xc3c948[_0x150f('0x29')][_0x150f('0x90')]===_0x150f('0x91')){return _0x1e27e2[_0x150f('0x55')]({'read':!![]});}else{logger[_0x150f('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x150f('0x29'),'infobip',util[_0x150f('0x83')](_0x42456a[_0x150f('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x1e27e2;}})[_0x150f('0x1e')](respondWithResult(_0x3421f1,null))['catch'](handleError(_0x3421f1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f518654..fe0f589 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 _0x4f6a=['hook','events','../../mysqldb','save','remove','emit'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0x4f6a,0x1db));var _0xa4f6=function(_0x442ccd,_0x415d61){_0x442ccd=_0x442ccd-0x0;var _0x1a2c10=_0x4f6a[_0x442ccd];return _0x1a2c10;};'use strict';var EventEmitter=require(_0xa4f6('0x0'));var SmsMessage=require(_0xa4f6('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4f6('0x2'),'afterUpdate':'update','afterDestroy':_0xa4f6('0x3')};function emitEvent(_0x1b4b03){return function(_0x49b13c,_0x14ccee,_0x251b55){SmsMessageEvents[_0xa4f6('0x4')](_0x1b4b03+':'+_0x49b13c['id'],_0x49b13c);SmsMessageEvents[_0xa4f6('0x4')](_0x1b4b03,_0x49b13c);_0x251b55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xa4f6('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xce86=['update','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x4b3d12,_0x1d4133){var _0x104e8c=function(_0x55db69){while(--_0x55db69){_0x4b3d12['push'](_0x4b3d12['shift']());}};_0x104e8c(++_0x1d4133);}(_0xce86,0x1c6));var _0x6ce8=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xce86[_0x397cfb];return _0x15fed9;};'use strict';var EventEmitter=require(_0x6ce8('0x0'));var SmsMessage=require(_0x6ce8('0x1'))['db'][_0x6ce8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6ce8('0x3')](0x0);var events={'afterCreate':_0x6ce8('0x4'),'afterUpdate':_0x6ce8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2efe31){return function(_0x36b438,_0x2fcf1b,_0x592c6d){SmsMessageEvents[_0x6ce8('0x6')](_0x2efe31+':'+_0x36b438['id'],_0x36b438);SmsMessageEvents[_0x6ce8('0x6')](_0x2efe31,_0x36b438);_0x592c6d(null);};}for(var e in events){if(events[_0x6ce8('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x6ce8('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0697f59..f0448b5 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 _0xbdb7=['requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','IBSSO\x20','deliveryReport','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','sort','length','createHash','md5','digest','hex','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','define','messageId','FULLTEXT','models','get','toLowerCase','out','isNil','findOne','SmsInteractionId','createdAt','direction','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','create','body','phone','remote','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','POST','session_key','total_sent','update','Missing\x20parameters:\x20username,\x20password','connectel','senderString'];(function(_0x47f5ba,_0x5c6ccd){var _0x53c8f7=function(_0x3ad65a){while(--_0x3ad65a){_0x47f5ba['push'](_0x47f5ba['shift']());}};_0x53c8f7(++_0x5c6ccd);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0xbdb7[_0x885eff];return _0x17819f;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x7bdb('0xb'),'fields':[_0x7bdb('0xb')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x7bdb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a6b61,_0x2cb569,_0x2c328e){var _0x27297d=_0x4b5fff[_0x7bdb('0xd')];var _0x297724=_0x1a6b61[_0x7bdb('0xe')]({'plain':!![]});if(_0x297724['direction']['toLowerCase']()==='in'||_0x297724['direction'][_0x7bdb('0xf')]()===_0x7bdb('0x10')&&!_0x297724['secret']&&!_[_0x7bdb('0x11')](_0x297724['UserId'])){_0x27297d['SmsInteraction'][_0x7bdb('0x12')]({'where':{'id':_0x297724[_0x7bdb('0x13')]}})['then'](function(_0x50eeca){if(_0x50eeca){_0x50eeca['update']({'lastMsgAt':_0x297724[_0x7bdb('0x14')],'lastMsgDirection':_0x297724[_0x7bdb('0x15')][_0x7bdb('0xf')]()});}})[_0x7bdb('0x16')](function(_0x31c909){console[_0x7bdb('0x17')](_0x31c909);});}if(_0x297724[_0x7bdb('0x15')]===_0x7bdb('0x10')&&!_0x297724['secret']){var _0x1c5750;_0x27297d[_0x7bdb('0x18')][_0x7bdb('0x19')]({'where':{'id':_0x297724[_0x7bdb('0x1a')]},'raw':!![]})['then'](function(_0x41f540){_0x1c5750=_0x41f540;if(_0x1c5750&&_0x1c5750[_0x7bdb('0x1b')]){switch(_0x1c5750['type']){case _0x7bdb('0x1c'):var _0x31f78e=require(_0x7bdb('0x1c'));if(_0x1c5750[_0x7bdb('0x1d')]&&_0x1c5750[_0x7bdb('0x1e')]&&_0x1c5750['phone']){var _0x49f353=new _0x31f78e(_0x1c5750[_0x7bdb('0x1d')],_0x1c5750[_0x7bdb('0x1e')]);_0x49f353['messages'][_0x7bdb('0x1f')]({'body':_0x297724[_0x7bdb('0x20')],'to':_0x297724[_0x7bdb('0x21')],'from':_0x1c5750[_0x7bdb('0x21')],'statusCallback':_0x1c5750[_0x7bdb('0x22')]+'/api/sms/messages/'+_0x297724['id']+_0x7bdb('0x23')+_0x1c5750[_0x7bdb('0x24')]})[_0x7bdb('0x25')](function(_0x3a456f){if(_0x3a456f['sid']){return _0x1a6b61['update']({'messageId':_0x3a456f[_0x7bdb('0x26')]});}})['catch'](function(_0x47abaf){logger['error'](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x1c'),util[_0x7bdb('0x28')](_0x47abaf,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),'twilio',_0x7bdb('0x2a'));}break;case _0x7bdb('0x2b'):var _0x399b62=_0x7bdb('0x2c');if(_0x1c5750[_0x7bdb('0x2d')]&&_0x1c5750[_0x7bdb('0x2e')]){var _0x1e9996={'recipient':[_0x297724[_0x7bdb('0x21')]],'message':_0x297724[_0x7bdb('0x20')],'message_type':_0x1c5750[_0x7bdb('0x2f')]};if(_0x1c5750[_0x7bdb('0x2f')]&&_0x1c5750[_0x7bdb('0x2f')]!=='SI'){_0x1e9996['sender']=_0x1c5750[_0x7bdb('0x21')];}var _0x384383={'url':_0x399b62+_0x7bdb('0x30')+_0x1c5750[_0x7bdb('0x2d')]+_0x7bdb('0x31')+_0x1c5750['password'],'method':_0x7bdb('0x32')};rp(_0x384383)[_0x7bdb('0x25')](function(_0x9ac56){var _0x103585=_0x9ac56['split'](';');var _0x4f43b9={'user_key':_0x103585[0x0],'session_key':_0x103585[0x1]};_0x384383={'url':_0x399b62+'sms','method':_0x7bdb('0x33'),'headers':{'user_key':_0x4f43b9['user_key'],'Session_key':_0x4f43b9[_0x7bdb('0x34')]},'json':!![],'body':_0x1e9996};return rp(_0x384383);})['then'](function(_0x23e5b2){if(_0x23e5b2[_0x7bdb('0x35')]>=0x1){var _0x1cf75a={'messageId':_0x23e5b2['internal_order_id']};if(_0x1c5750[_0x7bdb('0x2f')]!=='GP'||!_0x1c5750['deliveryReport']){_0x1cf75a['read']=!![];}return _0x1a6b61[_0x7bdb('0x36')](_0x1cf75a);}else{return logger['error'](_0x7bdb('0x27'),'afterCreate','skebby',util[_0x7bdb('0x28')](_0x23e5b2,{'showHidden':![],'depth':null}));}})[_0x7bdb('0x16')](function(_0x3ddee4){return logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),'skebby',util[_0x7bdb('0x28')](_0x3ddee4,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x2b'),_0x7bdb('0x37'));}break;case _0x7bdb('0x38'):if(_0x1c5750[_0x7bdb('0x1e')]){var _0x4edd0d={'recipient':_0x297724['phone'],'message':_0x297724['body'],'sender':_0x1c5750[_0x7bdb('0x39')]||_0x1c5750[_0x7bdb('0x21')],'authorization':_0x1c5750[_0x7bdb('0x1e')]};var _0x2cb569={'method':_0x7bdb('0x33'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4edd0d,'json':!![]};rp(_0x2cb569)['then'](function(_0x27164f){var _0x5d7c1f={'messageId':_0x27164f[_0x7bdb('0x3a')]};if(!_0x1c5750['deliveryReport']){_0x5d7c1f[_0x7bdb('0x3b')]=!![];}return _0x1a6b61['update'](_0x5d7c1f);})['catch'](function(_0x21dae7){logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x38'),util[_0x7bdb('0x28')](_0x21dae7,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7bdb('0x38'),_0x7bdb('0x3c'));}break;case _0x7bdb('0x3d'):if(_0x1c5750[_0x7bdb('0x2d')]&&_0x1c5750[_0x7bdb('0x2e')]){var _0x4edd0d={'messages':[{'source':_0x7bdb('0x3e'),'to':_0x297724['phone'],'body':_0x297724['body'],'from':_0x1c5750[_0x7bdb('0x39')]||_0x1c5750[_0x7bdb('0x21')]}]};var _0x46cb59=util[_0x7bdb('0x3f')]('%s:%s',_0x1c5750[_0x7bdb('0x2d')],_0x1c5750['password']);var _0x2cb569={'method':_0x7bdb('0x33'),'uri':_0x7bdb('0x40'),'body':_0x4edd0d,'headers':{'Authorization':util[_0x7bdb('0x3f')](_0x7bdb('0x41'),new Buffer(_0x46cb59)[_0x7bdb('0x42')](_0x7bdb('0x43')))},'json':!![]};rp(_0x2cb569)[_0x7bdb('0x25')](function(_0x3d65e8){if(_0x3d65e8['http_code']>=0xc8&&_0x3d65e8[_0x7bdb('0x44')]<=0xce){if(_0x3d65e8[_0x7bdb('0x45')]&&_0x3d65e8['data'][_0x7bdb('0x46')]>0x0){var _0x48e97a=_[_0x7bdb('0x47')](_0x3d65e8[_0x7bdb('0x45')][_0x7bdb('0x48')]);var _0x3a8415={'messageId':_0x48e97a[_0x7bdb('0x49')]};if(!_0x1c5750['deliveryReport']){_0x3a8415[_0x7bdb('0x3b')]=!![];}return _0x1a6b61[_0x7bdb('0x36')](_0x3a8415);}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),'clickSend',util[_0x7bdb('0x28')](_0x3d65e8,{'showHidden':![],'depth':null}));}}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x4a'),util[_0x7bdb('0x28')](_0x3d65e8,{'showHidden':![],'depth':null}));}})[_0x7bdb('0x16')](function(_0x176508){logger[_0x7bdb('0x17')](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x4a'),util['inspect'](_0x176508,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7bdb('0x27'),_0x7bdb('0x29'),'clickSend',_0x7bdb('0x37'));}break;case _0x7bdb('0x4b'):if(_0x1c5750['authId']&&_0x1c5750['authToken']){var _0x4edd0d={'dst':_0x297724[_0x7bdb('0x21')],'text':_0x297724[_0x7bdb('0x20')],'src':_0x1c5750[_0x7bdb('0x39')]||_0x1c5750[_0x7bdb('0x21')],'url':_0x1c5750[_0x7bdb('0x22')]+_0x7bdb('0x4c')+_0x297724['id']+_0x7bdb('0x23')+_0x1c5750[_0x7bdb('0x24')]};var _0x46cb59=util[_0x7bdb('0x3f')]('%s:%s',_0x1c5750[_0x7bdb('0x4d')],_0x1c5750['authToken']);var _0x2cb569={'method':_0x7bdb('0x33'),'uri':util[_0x7bdb('0x3f')](_0x7bdb('0x4e'),_0x1c5750['authId']),'body':_0x4edd0d,'headers':{'Authorization':util[_0x7bdb('0x3f')]('Basic\x20%s',new Buffer(_0x46cb59)['toString'](_0x7bdb('0x43')))},'json':!![]};rp(_0x2cb569)[_0x7bdb('0x25')](function(_0x5065ae){var _0x4e17f3={'messageId':_0x5065ae['message_uuid'][0x0]};return _0x1a6b61[_0x7bdb('0x36')](_0x4e17f3);})['catch'](function(_0x517ebb){logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x4b'),util['inspect'](_0x517ebb,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bdb('0x29'),_0x7bdb('0x4b'),_0x7bdb('0x4f'));}break;case _0x7bdb('0x50'):if(_0x1c5750[_0x7bdb('0x2d')]&&_0x1c5750[_0x7bdb('0x2e')]){if(_0x1c5750['baseUrl']){var _0x40d3b5={'method':_0x7bdb('0x33'),'uri':_0x1c5750[_0x7bdb('0x51')]+'/auth/1/session','body':{'username':_0x1c5750[_0x7bdb('0x2d')],'password':_0x1c5750[_0x7bdb('0x2e')]},'json':!![]};return rp(_0x40d3b5)['then'](function(_0x2b1887){var _0x56e88f={'method':_0x7bdb('0x33'),'uri':_0x1c5750[_0x7bdb('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1c5750['phone'],'destinations':[{'to':_0x297724[_0x7bdb('0x21')]}],'text':_0x297724[_0x7bdb('0x20')],'notifyUrl':_0x1c5750['remote']+_0x7bdb('0x4c')+_0x297724['id']+'/status?token='+_0x1c5750[_0x7bdb('0x24')],'notifyContentType':'application/json','callbackData':_0x1c5750['phone']+';'+_0x297724[_0x7bdb('0x20')]}]},'headers':{'Authorization':_0x7bdb('0x52')+_0x2b1887[_0x7bdb('0x24')]},'json':!![]};return rp(_0x56e88f)[_0x7bdb('0x25')](function(_0xac859d){if(_0xac859d[_0x7bdb('0x48')]){var _0x3141c2={'messageId':_0xac859d[_0x7bdb('0x48')][0x0][_0x7bdb('0xb')]};if(!_0x1c5750[_0x7bdb('0x53')]){_0x3141c2[_0x7bdb('0x3b')]=!![];}return _0x1a6b61[_0x7bdb('0x36')](_0x3141c2);}else{return logger['error'](_0x7bdb('0x27'),_0x7bdb('0x29'),'infobip',util[_0x7bdb('0x28')](_0xac859d,{'showHidden':![],'depth':null}));}});})[_0x7bdb('0x16')](function(_0x465fa7){return logger[_0x7bdb('0x17')](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x50'),util[_0x7bdb('0x28')](_0x465fa7,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bdb('0x29'),_0x7bdb('0x50'),_0x7bdb('0x54'));}}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x50'),_0x7bdb('0x37'));}break;case _0x7bdb('0x55'):var _0x4fdec0=require(_0x7bdb('0x56'));if(_0x1c5750[_0x7bdb('0x57')]){var _0x1cf8b1={};_0x1cf8b1[_0x7bdb('0x58')]=_0x1c5750[_0x7bdb('0x2d')];_0x1cf8b1[_0x7bdb('0x21')]=_0x297724[_0x7bdb('0x21')];_0x1cf8b1[_0x7bdb('0x59')]=_0x1c5750[_0x7bdb('0x21')];_0x1cf8b1[_0x7bdb('0x5a')]=_0x297724[_0x7bdb('0x20')];_0x1cf8b1[_0x7bdb('0x5b')]=+new Date();var _0x8589c8='';var _0x4e483f='';var _0x519127=Object['keys'](_0x1cf8b1);_0x519127[_0x7bdb('0x5c')]();for(var _0x4030eb=0x0;_0x4030eb<_0x519127[_0x7bdb('0x5d')];_0x4030eb++){if(_0x8589c8!=''){_0x8589c8+='&';}_0x8589c8+=_0x519127[_0x4030eb]+'='+encodeURIComponent(_0x1cf8b1[_0x519127[_0x4030eb]]);_0x4e483f+=_0x1cf8b1[_0x519127[_0x4030eb]];}_0x4e483f+=_0x1c5750['apiKey'];_0x4e483f=_0x4fdec0[_0x7bdb('0x5e')](_0x7bdb('0x5f'))['update'](_0x4e483f)[_0x7bdb('0x60')](_0x7bdb('0x61'));if(_0x8589c8!==''){_0x8589c8+='&';}_0x8589c8+='signature='+_0x4e483f;var _0x384383={'method':_0x7bdb('0x32'),'uri':_0x1c5750['baseUrl']+_0x7bdb('0x62')+_0x8589c8,'json':!![]};return rp(_0x384383)[_0x7bdb('0x25')](function(_0x4fbb58){var _0x202f46=Object[_0x7bdb('0x63')](_0x4fbb58);if(_0x4fbb58[_0x202f46[0x0]]['error']&&parseInt(_0x4fbb58[_0x202f46[0x0]][_0x7bdb('0x17')])===0x0){var _0x5e8b59={'messageId':_0x4fbb58[_0x202f46[0x0]][_0x7bdb('0x64')]};if(!_0x1c5750[_0x7bdb('0x53')]){_0x5e8b59[_0x7bdb('0x3b')]=!![];}return _0x1a6b61[_0x7bdb('0x36')](_0x5e8b59);}else{return logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x7bdb('0x28')](_0x4fbb58['error'],{'showHidden':![],'depth':null}));}})[_0x7bdb('0x16')](function(_0x1a1979){return logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7bdb('0x55'),util[_0x7bdb('0x28')](_0x1a1979,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x55'),_0x7bdb('0x65'));}break;case _0x7bdb('0x66'):if(_0x1c5750[_0x7bdb('0x57')]){var _0x48ee68={'method':_0x7bdb('0x33'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1c5750[_0x7bdb('0x57')]},'body':{'content':_0x297724['body'],'to':[_0x297724[_0x7bdb('0x21')]],'from':_0x1c5750['phone'],'binary':![],'clientMessageId':_0x7bdb('0x67'),'charset':_0x7bdb('0x68')},'json':!![]};rp(_0x48ee68)[_0x7bdb('0x25')](function(_0x1e4a5a){if(!_0x1e4a5a[_0x7bdb('0x17')]){var _0x5a2d61={'messageId':_0x1e4a5a['messages'][0x0][_0x7bdb('0x69')]};if(!_0x1c5750[_0x7bdb('0x53')]){_0x5a2d61['read']=!![];}return _0x1a6b61[_0x7bdb('0x36')](_0x5a2d61);}else{return logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bdb('0x29'),_0x7bdb('0x66'),util['inspect'](_0x1e4a5a[_0x7bdb('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4d1a90){return logger[_0x7bdb('0x17')](_0x7bdb('0x27'),'afterCreate','clickatell',util[_0x7bdb('0x28')](_0x4d1a90,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x66'),_0x7bdb('0x65'));}break;case _0x7bdb('0x6a'):if(_0x1c5750[_0x7bdb('0x2d')]&&_0x1c5750['password']){var _0x46cb59=util[_0x7bdb('0x3f')]('%s:%s',_0x1c5750[_0x7bdb('0x2d')],_0x1c5750[_0x7bdb('0x2e')]);var _0x2cb569={'method':_0x7bdb('0x33'),'uri':_0x7bdb('0x6b')+_0x1c5750[_0x7bdb('0x6c')]+_0x7bdb('0x6d'),'body':{'to':[_0x297724['phone']],'text':_0x297724[_0x7bdb('0x20')],'from':_0x1c5750['phone'],'applicationId':_0x1c5750[_0x7bdb('0x6e')]},'headers':{'Authorization':util[_0x7bdb('0x3f')](_0x7bdb('0x41'),new Buffer(_0x46cb59)['toString'](_0x7bdb('0x43')))},'json':!![]};rp(_0x2cb569)[_0x7bdb('0x25')](function(_0x12bd09){if(_0x12bd09['id']){var _0x2ee856={'messageId':_0x12bd09['id']};return _0x1a6b61[_0x7bdb('0x36')](_0x2ee856);}else{logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x6a'),util[_0x7bdb('0x28')](_0x12bd09,{'showHidden':![],'depth':null}));}})[_0x7bdb('0x16')](function(_0x3b2731){logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),_0x7bdb('0x6a'),util[_0x7bdb('0x28')](_0x3b2731,{'showHidden':![],'depth':null}));});}else{logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bdb('0x29'),_0x7bdb('0x6a'),_0x7bdb('0x37'));}break;case _0x7bdb('0x6f'):if(_0x1c5750[_0x7bdb('0x57')]){var _0x7a0b00={};var _0x384383={'method':_0x7bdb('0x33'),'uri':_0x7bdb('0x70'),'headers':{'Authorization':_0x7bdb('0x71')+_0x1c5750[_0x7bdb('0x57')],'Content-Type':'application/json'},'body':{'from':_0x1c5750['phone'],'to':_0x297724['phone'],'text':_0x297724[_0x7bdb('0x20')]},'json':!![]};return rp(_0x384383)[_0x7bdb('0x25')](function(_0x4a9e78){if(_0x4a9e78[_0x7bdb('0x72')]==0xca){_0x7a0b00[_0x7bdb('0x73')]=_0x4a9e78;var _0x569fea={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x7bdb('0x71')+_0x1c5750['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x7a0b00['message'][_0x7bdb('0x74')]},'json':!![]};return rp(_0x569fea)[_0x7bdb('0x25')](function(_0x32ef5e){_0x7a0b00['status']=_0x32ef5e;var _0xe3826e={'messageId':_0x7a0b00[_0x7bdb('0x73')][_0x7bdb('0x74')],'read':!![]};return _0x1a6b61[_0x7bdb('0x36')](_0xe3826e);});}else{return logger['error'](_0x7bdb('0x27'),'afterCreate',_0x7bdb('0x6f'),util[_0x7bdb('0x28')](_0x4a9e78,{'showHidden':![],'depth':null}));}})[_0x7bdb('0x16')](function(_0x4c8d4a){return logger[_0x7bdb('0x17')](_0x7bdb('0x27'),_0x7bdb('0x29'),'intelepeer',util[_0x7bdb('0x28')](_0x4c8d4a,{'showHidden':![],'depth':null}));});}else{return logger[_0x7bdb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7bdb('0x29'),_0x7bdb('0x6f'),'Token\x20not\x20received');}break;}}})[_0x7bdb('0x75')](function(){_0x2c328e();});}else{_0x2c328e();}}},'charset':_0x7bdb('0x76'),'collate':_0x7bdb('0x77')});}; \ No newline at end of file +var _0x938c=['catch','plivo','remote','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','messages','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','finally','utf8mb4','lodash','util','api','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','createdAt','toLowerCase','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','create','body','/api/sms/messages/','token','then','update','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x938c,0x11f));var _0xc938=function(_0x2b3247,_0x1e43cb){_0x2b3247=_0x2b3247-0x0;var _0x38674b=_0x938c[_0x2b3247];return _0x38674b;};'use strict';var _=require(_0xc938('0x0'));var util=require(_0xc938('0x1'));var logger=require('../../config/logger')(_0xc938('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc938('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc938('0x4'));var config=require(_0xc938('0x5'));var attributes=require(_0xc938('0x6'));module[_0xc938('0x7')]=function(_0x235110,_0x8cfbb6){return _0x235110['define'](_0xc938('0x8'),attributes,{'tableName':_0xc938('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc938('0xa')]},{'name':_0xc938('0xb'),'fields':['body'],'type':_0xc938('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x525c9b,_0x5c4957,_0x7a17e4){var _0x47788a=_0x235110[_0xc938('0xd')];var _0x59f3f5=_0x525c9b[_0xc938('0xe')]({'plain':!![]});if(_0x59f3f5[_0xc938('0xf')]['toLowerCase']()==='in'||_0x59f3f5[_0xc938('0xf')]['toLowerCase']()===_0xc938('0x10')&&!_0x59f3f5[_0xc938('0x11')]&&!_[_0xc938('0x12')](_0x59f3f5['UserId'])){_0x47788a[_0xc938('0x13')][_0xc938('0x14')]({'where':{'id':_0x59f3f5[_0xc938('0x15')]}})['then'](function(_0x4bc776){if(_0x4bc776){_0x4bc776['update']({'lastMsgAt':_0x59f3f5[_0xc938('0x16')],'lastMsgDirection':_0x59f3f5[_0xc938('0xf')][_0xc938('0x17')]()});}})['catch'](function(_0x143c42){console['error'](_0x143c42);});}if(_0x59f3f5[_0xc938('0xf')]===_0xc938('0x10')&&!_0x59f3f5['secret']){var _0x278c2d;_0x47788a[_0xc938('0x18')]['find']({'where':{'id':_0x59f3f5[_0xc938('0x19')]},'raw':!![]})['then'](function(_0xe23b6b){_0x278c2d=_0xe23b6b;if(_0x278c2d&&_0x278c2d[_0xc938('0x1a')]){switch(_0x278c2d[_0xc938('0x1a')]){case'twilio':var _0x1d4e2e=require(_0xc938('0x1b'));if(_0x278c2d[_0xc938('0x1c')]&&_0x278c2d[_0xc938('0x1d')]&&_0x278c2d[_0xc938('0x1e')]){var _0x474d1b=new _0x1d4e2e(_0x278c2d[_0xc938('0x1c')],_0x278c2d[_0xc938('0x1d')]);_0x474d1b['messages'][_0xc938('0x1f')]({'body':_0x59f3f5[_0xc938('0x20')],'to':_0x59f3f5['phone'],'from':_0x278c2d[_0xc938('0x1e')],'statusCallback':_0x278c2d['remote']+_0xc938('0x21')+_0x59f3f5['id']+'/status?token='+_0x278c2d[_0xc938('0x22')]})[_0xc938('0x23')](function(_0x20734d){if(_0x20734d['sid']){return _0x525c9b[_0xc938('0x24')]({'messageId':_0x20734d[_0xc938('0x25')]});}})['catch'](function(_0x4902fa){logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x1b'),util[_0xc938('0x29')](_0x4902fa,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x1b'),_0xc938('0x2a'));}break;case _0xc938('0x2b'):var _0x3334cb=_0xc938('0x2c');if(_0x278c2d[_0xc938('0x2d')]&&_0x278c2d[_0xc938('0x2e')]){var _0x4c5278={'recipient':[_0x59f3f5[_0xc938('0x1e')]],'message':_0x59f3f5[_0xc938('0x20')],'message_type':_0x278c2d[_0xc938('0x2f')]};if(_0x278c2d[_0xc938('0x2f')]&&_0x278c2d['smsMethod']!=='SI'){_0x4c5278[_0xc938('0x30')]=_0x278c2d[_0xc938('0x1e')];}var _0x539446={'url':_0x3334cb+_0xc938('0x31')+_0x278c2d[_0xc938('0x2d')]+_0xc938('0x32')+_0x278c2d[_0xc938('0x2e')],'method':_0xc938('0x33')};rp(_0x539446)[_0xc938('0x23')](function(_0x5284ba){var _0x4300c0=_0x5284ba[_0xc938('0x34')](';');var _0x173561={'user_key':_0x4300c0[0x0],'session_key':_0x4300c0[0x1]};_0x539446={'url':_0x3334cb+_0xc938('0x35'),'method':_0xc938('0x36'),'headers':{'user_key':_0x173561[_0xc938('0x37')],'Session_key':_0x173561[_0xc938('0x38')]},'json':!![],'body':_0x4c5278};return rp(_0x539446);})[_0xc938('0x23')](function(_0x17bfee){if(_0x17bfee[_0xc938('0x39')]>=0x1){var _0x3334c7={'messageId':_0x17bfee[_0xc938('0x3a')]};if(_0x278c2d['smsMethod']!=='GP'||!_0x278c2d[_0xc938('0x3b')]){_0x3334c7[_0xc938('0x3c')]=!![];}return _0x525c9b[_0xc938('0x24')](_0x3334c7);}else{return logger['error'](_0xc938('0x27'),_0xc938('0x28'),'skebby',util[_0xc938('0x29')](_0x17bfee,{'showHidden':![],'depth':null}));}})['catch'](function(_0x51583c){return logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x2b'),util[_0xc938('0x29')](_0x51583c,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),'skebby',_0xc938('0x3d'));}break;case _0xc938('0x3e'):if(_0x278c2d['authToken']){var _0x3af56d={'recipient':_0x59f3f5['phone'],'message':_0x59f3f5[_0xc938('0x20')],'sender':_0x278c2d[_0xc938('0x3f')]||_0x278c2d[_0xc938('0x1e')],'authorization':_0x278c2d[_0xc938('0x1d')]};var _0x5c4957={'method':_0xc938('0x36'),'uri':_0xc938('0x40'),'body':_0x3af56d,'json':!![]};rp(_0x5c4957)[_0xc938('0x23')](function(_0x4a89c5){var _0x12aa77={'messageId':_0x4a89c5[_0xc938('0x41')]};if(!_0x278c2d[_0xc938('0x3b')]){_0x12aa77[_0xc938('0x3c')]=!![];}return _0x525c9b['update'](_0x12aa77);})['catch'](function(_0x5683ff){logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x3e'),util[_0xc938('0x29')](_0x5683ff,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x3e'),_0xc938('0x42'));}break;case _0xc938('0x43'):if(_0x278c2d[_0xc938('0x2d')]&&_0x278c2d['password']){var _0x3af56d={'messages':[{'source':'xCALLY\x20Motion','to':_0x59f3f5[_0xc938('0x1e')],'body':_0x59f3f5['body'],'from':_0x278c2d[_0xc938('0x3f')]||_0x278c2d[_0xc938('0x1e')]}]};var _0x2ee417=util[_0xc938('0x44')](_0xc938('0x45'),_0x278c2d[_0xc938('0x2d')],_0x278c2d[_0xc938('0x2e')]);var _0x5c4957={'method':_0xc938('0x36'),'uri':_0xc938('0x46'),'body':_0x3af56d,'headers':{'Authorization':util[_0xc938('0x44')](_0xc938('0x47'),new Buffer(_0x2ee417)[_0xc938('0x48')](_0xc938('0x49')))},'json':!![]};rp(_0x5c4957)[_0xc938('0x23')](function(_0x2f4e36){if(_0x2f4e36[_0xc938('0x4a')]>=0xc8&&_0x2f4e36[_0xc938('0x4a')]<=0xce){if(_0x2f4e36[_0xc938('0x4b')]&&_0x2f4e36[_0xc938('0x4b')][_0xc938('0x4c')]>0x0){var _0x5d09dd=_['head'](_0x2f4e36['data']['messages']);var _0x32e8d4={'messageId':_0x5d09dd[_0xc938('0x4d')]};if(!_0x278c2d[_0xc938('0x3b')]){_0x32e8d4[_0xc938('0x3c')]=!![];}return _0x525c9b[_0xc938('0x24')](_0x32e8d4);}else{logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),'clickSend',util['inspect'](_0x2f4e36,{'showHidden':![],'depth':null}));}}else{logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x4e'),util[_0xc938('0x29')](_0x2f4e36,{'showHidden':![],'depth':null}));}})[_0xc938('0x4f')](function(_0x5d5f71){logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x4e'),util[_0xc938('0x29')](_0x5d5f71,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),'clickSend',_0xc938('0x3d'));}break;case _0xc938('0x50'):if(_0x278c2d['authId']&&_0x278c2d[_0xc938('0x1d')]){var _0x3af56d={'dst':_0x59f3f5['phone'],'text':_0x59f3f5[_0xc938('0x20')],'src':_0x278c2d[_0xc938('0x3f')]||_0x278c2d['phone'],'url':_0x278c2d[_0xc938('0x51')]+'/api/sms/messages/'+_0x59f3f5['id']+_0xc938('0x52')+_0x278c2d[_0xc938('0x22')]};var _0x2ee417=util[_0xc938('0x44')](_0xc938('0x45'),_0x278c2d[_0xc938('0x53')],_0x278c2d[_0xc938('0x1d')]);var _0x5c4957={'method':_0xc938('0x36'),'uri':util['format'](_0xc938('0x54'),_0x278c2d[_0xc938('0x53')]),'body':_0x3af56d,'headers':{'Authorization':util[_0xc938('0x44')]('Basic\x20%s',new Buffer(_0x2ee417)['toString']('base64'))},'json':!![]};rp(_0x5c4957)[_0xc938('0x23')](function(_0x272dd3){var _0x43af75={'messageId':_0x272dd3[_0xc938('0x55')][0x0]};return _0x525c9b[_0xc938('0x24')](_0x43af75);})[_0xc938('0x4f')](function(_0x379d6d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),_0xc938('0x50'),util[_0xc938('0x29')](_0x379d6d,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc938('0x56'):if(_0x278c2d[_0xc938('0x2d')]&&_0x278c2d[_0xc938('0x2e')]){if(_0x278c2d[_0xc938('0x57')]){var _0x2c0d20={'method':_0xc938('0x36'),'uri':_0x278c2d[_0xc938('0x57')]+'/auth/1/session','body':{'username':_0x278c2d[_0xc938('0x2d')],'password':_0x278c2d[_0xc938('0x2e')]},'json':!![]};return rp(_0x2c0d20)['then'](function(_0x3b2354){var _0x41f0f0={'method':_0xc938('0x36'),'uri':_0x278c2d[_0xc938('0x57')]+_0xc938('0x58'),'body':{'messages':[{'from':_0x278c2d['phone'],'destinations':[{'to':_0x59f3f5[_0xc938('0x1e')]}],'text':_0x59f3f5['body'],'notifyUrl':_0x278c2d[_0xc938('0x51')]+_0xc938('0x21')+_0x59f3f5['id']+_0xc938('0x52')+_0x278c2d[_0xc938('0x22')],'notifyContentType':_0xc938('0x59'),'callbackData':_0x278c2d[_0xc938('0x1e')]+';'+_0x59f3f5[_0xc938('0x20')]}]},'headers':{'Authorization':_0xc938('0x5a')+_0x3b2354['token']},'json':!![]};return rp(_0x41f0f0)[_0xc938('0x23')](function(_0x1476ce){if(_0x1476ce[_0xc938('0x5b')]){var _0x467ca0={'messageId':_0x1476ce[_0xc938('0x5b')][0x0][_0xc938('0xa')]};if(!_0x278c2d[_0xc938('0x3b')]){_0x467ca0[_0xc938('0x3c')]=!![];}return _0x525c9b['update'](_0x467ca0);}else{return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),'infobip',util[_0xc938('0x29')](_0x1476ce,{'showHidden':![],'depth':null}));}});})[_0xc938('0x4f')](function(_0x3de157){return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x56'),util[_0xc938('0x29')](_0x3de157,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x56'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xc938('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),_0xc938('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc938('0x5c'):var _0x426208=require(_0xc938('0x5d'));if(_0x278c2d[_0xc938('0x5e')]){var _0x20262d={};_0x20262d['login']=_0x278c2d[_0xc938('0x2d')];_0x20262d[_0xc938('0x1e')]=_0x59f3f5[_0xc938('0x1e')];_0x20262d[_0xc938('0x30')]=_0x278c2d[_0xc938('0x1e')];_0x20262d[_0xc938('0x5f')]=_0x59f3f5[_0xc938('0x20')];_0x20262d[_0xc938('0x60')]=+new Date();var _0x390b78='';var _0x23dc0f='';var _0xa1c77e=Object[_0xc938('0x61')](_0x20262d);_0xa1c77e[_0xc938('0x62')]();for(var _0x237e62=0x0;_0x237e62<_0xa1c77e[_0xc938('0x63')];_0x237e62++){if(_0x390b78!=''){_0x390b78+='&';}_0x390b78+=_0xa1c77e[_0x237e62]+'='+encodeURIComponent(_0x20262d[_0xa1c77e[_0x237e62]]);_0x23dc0f+=_0x20262d[_0xa1c77e[_0x237e62]];}_0x23dc0f+=_0x278c2d[_0xc938('0x5e')];_0x23dc0f=_0x426208[_0xc938('0x64')](_0xc938('0x65'))[_0xc938('0x24')](_0x23dc0f)[_0xc938('0x66')]('hex');if(_0x390b78!==''){_0x390b78+='&';}_0x390b78+=_0xc938('0x67')+_0x23dc0f;var _0x539446={'method':'GET','uri':_0x278c2d[_0xc938('0x57')]+'/external/get/send.php?'+_0x390b78,'json':!![]};return rp(_0x539446)[_0xc938('0x23')](function(_0x4885ea){var _0x3db351=Object['keys'](_0x4885ea);if(_0x4885ea[_0x3db351[0x0]][_0xc938('0x26')]&&parseInt(_0x4885ea[_0x3db351[0x0]][_0xc938('0x26')])===0x0){var _0x2502f7={'messageId':_0x4885ea[_0x3db351[0x0]][_0xc938('0x68')]};if(!_0x278c2d[_0xc938('0x3b')]){_0x2502f7[_0xc938('0x3c')]=!![];}return _0x525c9b[_0xc938('0x24')](_0x2502f7);}else{return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),'csc',util[_0xc938('0x29')](_0x4885ea['error'],{'showHidden':![],'depth':null}));}})[_0xc938('0x4f')](function(_0x28c393){return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),'csc',util[_0xc938('0x29')](_0x28c393,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x5c'),_0xc938('0x69'));}break;case'clickatell':if(_0x278c2d['apiKey']){var _0x690c86={'method':_0xc938('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x278c2d[_0xc938('0x5e')]},'body':{'content':_0x59f3f5['body'],'to':[_0x59f3f5['phone']],'from':_0x278c2d['phone'],'binary':![],'clientMessageId':_0xc938('0x6a'),'charset':_0xc938('0x6b')},'json':!![]};rp(_0x690c86)[_0xc938('0x23')](function(_0x3cf9c9){if(!_0x3cf9c9['error']){var _0x88d66={'messageId':_0x3cf9c9[_0xc938('0x5b')][0x0][_0xc938('0x6c')]};if(!_0x278c2d['deliveryReport']){_0x88d66[_0xc938('0x3c')]=!![];}return _0x525c9b[_0xc938('0x24')](_0x88d66);}else{return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x6d'),util['inspect'](_0x3cf9c9[_0xc938('0x26')],{'showHidden':![],'depth':null}));}})[_0xc938('0x4f')](function(_0x5ad2d2){return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x6d'),util[_0xc938('0x29')](_0x5ad2d2,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),'clickatell',_0xc938('0x69'));}break;case _0xc938('0x6e'):if(_0x278c2d[_0xc938('0x2d')]&&_0x278c2d[_0xc938('0x2e')]){var _0x2ee417=util[_0xc938('0x44')](_0xc938('0x45'),_0x278c2d['username'],_0x278c2d['password']);var _0x5c4957={'method':_0xc938('0x36'),'uri':_0xc938('0x6f')+_0x278c2d[_0xc938('0x70')]+'/messages','body':{'to':[_0x59f3f5[_0xc938('0x1e')]],'text':_0x59f3f5[_0xc938('0x20')],'from':_0x278c2d[_0xc938('0x1e')],'applicationId':_0x278c2d['applicationId']},'headers':{'Authorization':util[_0xc938('0x44')](_0xc938('0x47'),new Buffer(_0x2ee417)[_0xc938('0x48')](_0xc938('0x49')))},'json':!![]};rp(_0x5c4957)['then'](function(_0x572c8e){if(_0x572c8e['id']){var _0x26df24={'messageId':_0x572c8e['id']};return _0x525c9b[_0xc938('0x24')](_0x26df24);}else{logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x6e'),util[_0xc938('0x29')](_0x572c8e,{'showHidden':![],'depth':null}));}})['catch'](function(_0xb2a356){logger[_0xc938('0x26')](_0xc938('0x27'),'afterCreate',_0xc938('0x6e'),util[_0xc938('0x29')](_0xb2a356,{'showHidden':![],'depth':null}));});}else{logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x6e'),_0xc938('0x3d'));}break;case _0xc938('0x71'):if(_0x278c2d[_0xc938('0x5e')]){var _0x2a80aa={};var _0x539446={'method':_0xc938('0x36'),'uri':_0xc938('0x72'),'headers':{'Authorization':_0xc938('0x73')+_0x278c2d[_0xc938('0x5e')],'Content-Type':_0xc938('0x59')},'body':{'from':_0x278c2d[_0xc938('0x1e')],'to':_0x59f3f5[_0xc938('0x1e')],'text':_0x59f3f5[_0xc938('0x20')]},'json':!![]};return rp(_0x539446)[_0xc938('0x23')](function(_0x5632ec){if(_0x5632ec[_0xc938('0x74')]==0xca){_0x2a80aa[_0xc938('0x75')]=_0x5632ec;var _0x1f0e05={'method':_0xc938('0x36'),'uri':_0xc938('0x76'),'headers':{'Authorization':_0xc938('0x73')+_0x278c2d['apiKey'],'Content-Type':_0xc938('0x59')},'body':{'refid':_0x2a80aa[_0xc938('0x75')]['refid']},'json':!![]};return rp(_0x1f0e05)[_0xc938('0x23')](function(_0x96b9f0){_0x2a80aa[_0xc938('0x77')]=_0x96b9f0;var _0x3e9cf6={'messageId':_0x2a80aa[_0xc938('0x75')]['refid'],'read':!![]};return _0x525c9b[_0xc938('0x24')](_0x3e9cf6);});}else{return logger['error'](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x71'),util['inspect'](_0x5632ec,{'showHidden':![],'depth':null}));}})[_0xc938('0x4f')](function(_0x3e3f65){return logger[_0xc938('0x26')](_0xc938('0x27'),_0xc938('0x28'),_0xc938('0x71'),util[_0xc938('0x29')](_0x3e3f65,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc938('0x28'),'intelepeer','Token\x20not\x20received');}break;}}})[_0xc938('0x78')](function(){_0x7a17e4();});}else{_0x7a17e4();}}},'charset':_0xc938('0x79'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 87af709..9d3a8c5 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 _0x8c40=['SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info'];(function(_0x5604aa,_0x20eadc){var _0x4d4f1f=function(_0x4e07b9){while(--_0x4e07b9){_0x5604aa['push'](_0x5604aa['shift']());}};_0x4d4f1f(++_0x20eadc);}(_0x8c40,0x143));var _0x08c4=function(_0x1e2c44,_0x338517){_0x1e2c44=_0x1e2c44-0x0;var _0x54d129=_0x8c40[_0x1e2c44];return _0x54d129;};'use strict';var _=require(_0x08c4('0x0'));var util=require(_0x08c4('0x1'));var moment=require(_0x08c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x08c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08c4('0x4'))['db'];var utils=require(_0x08c4('0x5'));var logger=require('../../config/logger')(_0x08c4('0x6'));var config=require(_0x08c4('0x7'));var jayson=require(_0x08c4('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x08c4('0x9')]=_[_0x08c4('0xa')](config[_0x08c4('0x9')],{'host':_0x08c4('0xb'),'port':0x18eb});var socket=require(_0x08c4('0xc'))(new Redis(config['redis']));require(_0x08c4('0xd'))[_0x08c4('0xe')](socket);function respondWithRpcPromise(_0x32be12,_0x40e01d,_0x5acb10){return new BPromise(function(_0x721cc2,_0x45c77e){return client[_0x08c4('0xf')](_0x32be12,_0x5acb10)[_0x08c4('0x10')](function(_0x211c94){logger[_0x08c4('0x11')](_0x08c4('0x12'),_0x40e01d,'request\x20sent');logger[_0x08c4('0x13')](_0x08c4('0x14'),_0x40e01d,_0x08c4('0x15'),JSON[_0x08c4('0x16')](_0x211c94));if(_0x211c94[_0x08c4('0x17')]){if(_0x211c94['error']['code']===0x1f4){logger['error'](_0x08c4('0x12'),_0x40e01d,_0x211c94['error'][_0x08c4('0x18')]);return _0x45c77e(_0x211c94['error'][_0x08c4('0x18')]);}logger['error'](_0x08c4('0x12'),_0x40e01d,_0x211c94[_0x08c4('0x17')][_0x08c4('0x18')]);return _0x721cc2(_0x211c94['error'][_0x08c4('0x18')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x40e01d,_0x08c4('0x15'));_0x721cc2(_0x211c94[_0x08c4('0x19')]['message']);}})[_0x08c4('0x1a')](function(_0x40a3f2){logger['error']('SmsMessage,\x20%s,\x20%s',_0x40e01d,_0x40a3f2);_0x45c77e(_0x40a3f2);});});}exports[_0x08c4('0x1b')]=function(_0x2b057a){var _0x45ee6f=this;return new Promise(function(_0x2923c7,_0x1b4f5a){return db[_0x08c4('0x1c')]['create'](_0x2b057a['body'],{'raw':_0x2b057a[_0x08c4('0x1d')]?_0x2b057a[_0x08c4('0x1d')][_0x08c4('0x1e')]===undefined?!![]:![]:!![]})[_0x08c4('0x10')](function(_0x2cc521){logger[_0x08c4('0x11')](_0x08c4('0x1b'),_0x2b057a);logger[_0x08c4('0x13')](_0x08c4('0x1b'),_0x2b057a,JSON[_0x08c4('0x16')](_0x2cc521));_0x2923c7(_0x2cc521);})[_0x08c4('0x1a')](function(_0xa235a2){logger['error']('CreateSmsMessage',_0xa235a2[_0x08c4('0x18')],_0x2b057a);_0x1b4f5a(_0x45ee6f[_0x08c4('0x17')](0x1f4,_0xa235a2[_0x08c4('0x18')]));});});}; \ No newline at end of file +var _0x49d3=['SmsMessage','options','CreateSmsMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2f03d8,_0xe734b2){var _0x3e66d5=function(_0x6bc94a){while(--_0x6bc94a){_0x2f03d8['push'](_0x2f03d8['shift']());}};_0x3e66d5(++_0xe734b2);}(_0x49d3,0xfb));var _0x349d=function(_0x3134f3,_0x5f5086){_0x3134f3=_0x3134f3-0x0;var _0x180661=_0x49d3[_0x3134f3];return _0x180661;};'use strict';var _=require(_0x349d('0x0'));var util=require(_0x349d('0x1'));var moment=require(_0x349d('0x2'));var BPromise=require(_0x349d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x349d('0x4'));var db=require(_0x349d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x349d('0x6'))(_0x349d('0x7'));var config=require('../../config/environment');var jayson=require(_0x349d('0x8'));var client=jayson[_0x349d('0x9')][_0x349d('0xa')]({'port':0x232a});config[_0x349d('0xb')]=_[_0x349d('0xc')](config[_0x349d('0xb')],{'host':_0x349d('0xd'),'port':0x18eb});var socket=require(_0x349d('0xe'))(new Redis(config[_0x349d('0xb')]));require(_0x349d('0xf'))['register'](socket);function respondWithRpcPromise(_0x246993,_0xf08d34,_0x412dca){return new BPromise(function(_0x5a0009,_0x3eebd4){return client[_0x349d('0x10')](_0x246993,_0x412dca)[_0x349d('0x11')](function(_0x249267){logger[_0x349d('0x12')](_0x349d('0x13'),_0xf08d34,'request\x20sent');logger[_0x349d('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf08d34,_0x349d('0x15'),JSON[_0x349d('0x16')](_0x249267));if(_0x249267['error']){if(_0x249267[_0x349d('0x17')][_0x349d('0x18')]===0x1f4){logger[_0x349d('0x17')](_0x349d('0x13'),_0xf08d34,_0x249267['error']['message']);return _0x3eebd4(_0x249267[_0x349d('0x17')][_0x349d('0x19')]);}logger['error'](_0x349d('0x13'),_0xf08d34,_0x249267[_0x349d('0x17')][_0x349d('0x19')]);return _0x5a0009(_0x249267['error'][_0x349d('0x19')]);}else{logger[_0x349d('0x12')](_0x349d('0x13'),_0xf08d34,_0x349d('0x15'));_0x5a0009(_0x249267[_0x349d('0x1a')][_0x349d('0x19')]);}})[_0x349d('0x1b')](function(_0x3f680f){logger[_0x349d('0x17')](_0x349d('0x13'),_0xf08d34,_0x3f680f);_0x3eebd4(_0x3f680f);});});}exports['CreateSmsMessage']=function(_0x417054){var _0x4c6bcb=this;return new Promise(function(_0x50cbc1,_0x477132){return db[_0x349d('0x1c')]['create'](_0x417054['body'],{'raw':_0x417054['options']?_0x417054[_0x349d('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x349d('0x11')](function(_0x4239c9){logger[_0x349d('0x12')](_0x349d('0x1e'),_0x417054);logger[_0x349d('0x14')](_0x349d('0x1e'),_0x417054,JSON[_0x349d('0x16')](_0x4239c9));_0x50cbc1(_0x4239c9);})['catch'](function(_0x26f380){logger[_0x349d('0x17')]('CreateSmsMessage',_0x26f380[_0x349d('0x19')],_0x417054);_0x477132(_0x4c6bcb['error'](0x1f4,_0x26f380['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 103d51d..413e6c5 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 _0xefa4=['register','length','smsMessage:','remove','update','removeListener'];(function(_0x263629,_0x1fb8f8){var _0x2d7fd6=function(_0x5a391e){while(--_0x5a391e){_0x263629['push'](_0x263629['shift']());}};_0x2d7fd6(++_0x1fb8f8);}(_0xefa4,0xab));var _0x4efa=function(_0x25c46d,_0x5579c5){_0x25c46d=_0x25c46d-0x0;var _0x3220e2=_0xefa4[_0x25c46d];return _0x3220e2;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x4efa('0x0'),_0x4efa('0x1')];function createListener(_0x401ca5,_0x346f47){return function(_0x52c280){_0x346f47['emit'](_0x401ca5,_0x52c280);};}function removeListener(_0x13f6c9,_0xe8557f){return function(){SmsMessageEvents[_0x4efa('0x2')](_0x13f6c9,_0xe8557f);};}exports[_0x4efa('0x3')]=function(_0x9b913c){for(var _0x3dc3d2=0x0,_0x5bf5e4=events[_0x4efa('0x4')];_0x3dc3d2<_0x5bf5e4;_0x3dc3d2++){var _0x324c11=events[_0x3dc3d2];var _0x3ae577=createListener(_0x4efa('0x5')+_0x324c11,_0x9b913c);SmsMessageEvents['on'](_0x324c11,_0x3ae577);}}; \ No newline at end of file +var _0x9761=['register','smsMessage:','./smsMessage.events','save','update','emit','removeListener'];(function(_0x5eb8fe,_0x374779){var _0x43b85d=function(_0x2454fc){while(--_0x2454fc){_0x5eb8fe['push'](_0x5eb8fe['shift']());}};_0x43b85d(++_0x374779);}(_0x9761,0x175));var _0x1976=function(_0x3be436,_0x39dad8){_0x3be436=_0x3be436-0x0;var _0x568073=_0x9761[_0x3be436];return _0x568073;};'use strict';var SmsMessageEvents=require(_0x1976('0x0'));var events=[_0x1976('0x1'),'remove',_0x1976('0x2')];function createListener(_0x5f4577,_0x1ebe29){return function(_0x3d1c0e){_0x1ebe29[_0x1976('0x3')](_0x5f4577,_0x3d1c0e);};}function removeListener(_0x828103,_0x11cd57){return function(){SmsMessageEvents[_0x1976('0x4')](_0x828103,_0x11cd57);};}exports[_0x1976('0x5')]=function(_0x4a39b0){for(var _0x308217=0x0,_0x5aa3f6=events['length'];_0x308217<_0x5aa3f6;_0x308217++){var _0x55376e=events[_0x308217];var _0x2d5d26=createListener(_0x1976('0x6')+_0x55376e,_0x4a39b0);SmsMessageEvents['on'](_0x55376e,_0x2d5d26);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0754605..ea0243c 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 _0xd289=['removeTeams','/:id/users','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd289,0x73));var _0x9d28=function(_0xd5f3ac,_0x5a575a){_0xd5f3ac=_0xd5f3ac-0x0;var _0x38aed8=_0xd289[_0xd5f3ac];return _0x38aed8;};'use strict';var multer=require('multer');var util=require(_0x9d28('0x0'));var path=require(_0x9d28('0x1'));var timeout=require(_0x9d28('0x2'));var express=require('express');var router=express[_0x9d28('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d28('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d28('0x5'));var controller=require('./smsQueue.controller');router[_0x9d28('0x6')]('/',auth[_0x9d28('0x7')](),controller[_0x9d28('0x8')]);router[_0x9d28('0x6')](_0x9d28('0x9'),auth[_0x9d28('0x7')](),controller[_0x9d28('0xa')]);router[_0x9d28('0x6')](_0x9d28('0xb'),auth[_0x9d28('0x7')](),controller[_0x9d28('0xc')]);router[_0x9d28('0x6')](_0x9d28('0xd'),auth[_0x9d28('0x7')](),controller[_0x9d28('0xe')]);router[_0x9d28('0x6')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9d28('0xf')]);router[_0x9d28('0x6')]('/:id/users',auth[_0x9d28('0x7')](),controller[_0x9d28('0x10')]);router['post']('/',auth[_0x9d28('0x7')](),controller['create']);router[_0x9d28('0x11')]('/:id/teams',auth[_0x9d28('0x7')](),controller[_0x9d28('0x12')]);router[_0x9d28('0x11')]('/:id/users',auth[_0x9d28('0x7')](),controller[_0x9d28('0x13')]);router[_0x9d28('0x14')]('/:id',auth[_0x9d28('0x7')](),controller[_0x9d28('0x15')]);router[_0x9d28('0x16')](_0x9d28('0xb'),auth[_0x9d28('0x7')](),controller[_0x9d28('0x17')]);router['delete'](_0x9d28('0x18'),auth[_0x9d28('0x7')](),controller[_0x9d28('0x19')]);router[_0x9d28('0x16')](_0x9d28('0x1a'),auth[_0x9d28('0x7')](),controller['removeAgents']);module[_0x9d28('0x1b')]=router; \ No newline at end of file +var _0x993b=['/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xea737,_0x275a1c){var _0x3cbe01=function(_0x1451b8){while(--_0x1451b8){_0xea737['push'](_0xea737['shift']());}};_0x3cbe01(++_0x275a1c);}(_0x993b,0x1b0));var _0xb993=function(_0x242b34,_0x208311){_0x242b34=_0x242b34-0x0;var _0x122769=_0x993b[_0x242b34];return _0x122769;};'use strict';var multer=require(_0xb993('0x0'));var util=require(_0xb993('0x1'));var path=require(_0xb993('0x2'));var timeout=require('connect-timeout');var express=require(_0xb993('0x3'));var router=express[_0xb993('0x4')]();var fs_extra=require(_0xb993('0x5'));var auth=require(_0xb993('0x6'));var interaction=require(_0xb993('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xb993('0x8')]('/',auth[_0xb993('0x9')](),controller['index']);router[_0xb993('0x8')](_0xb993('0xa'),auth[_0xb993('0x9')](),controller[_0xb993('0xb')]);router['get'](_0xb993('0xc'),auth[_0xb993('0x9')](),controller[_0xb993('0xd')]);router[_0xb993('0x8')]('/:id/members',auth[_0xb993('0x9')](),controller[_0xb993('0xe')]);router[_0xb993('0x8')](_0xb993('0xf'),auth[_0xb993('0x9')](),controller[_0xb993('0x10')]);router[_0xb993('0x8')](_0xb993('0x11'),auth[_0xb993('0x9')](),controller[_0xb993('0x12')]);router[_0xb993('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb993('0x13')](_0xb993('0xf'),auth[_0xb993('0x9')](),controller['addTeams']);router[_0xb993('0x13')](_0xb993('0x11'),auth[_0xb993('0x9')](),controller['addAgents']);router[_0xb993('0x14')](_0xb993('0xc'),auth[_0xb993('0x9')](),controller[_0xb993('0x15')]);router[_0xb993('0x16')](_0xb993('0xc'),auth[_0xb993('0x9')](),controller['destroy']);router[_0xb993('0x16')](_0xb993('0xf'),auth['isAuthenticated'](),controller[_0xb993('0x17')]);router['delete'](_0xb993('0x11'),auth[_0xb993('0x9')](),controller[_0xb993('0x18')]);module[_0xb993('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index df3d9d5..fd9831b 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 _0xf58b=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x2a2894,_0x503e27){var _0x17d53d=function(_0x6c9c76){while(--_0x6c9c76){_0x2a2894['push'](_0x2a2894['shift']());}};_0x17d53d(++_0x503e27);}(_0xf58b,0x109));var _0xbf58=function(_0x549e49,_0x94ee2f){_0x549e49=_0x549e49-0x0;var _0x53fdd3=_0xf58b[_0x549e49];return _0x53fdd3;};'use strict';var Sequelize=require('sequelize');module[_0xbf58('0x0')]={'name':{'type':Sequelize[_0xbf58('0x1')],'unique':_0xbf58('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbf58('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf58('0x4')]('rrmemory',_0xbf58('0x5'),_0xbf58('0x6'))}}; \ No newline at end of file +var _0xd092=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2eca94,_0x501bbd){var _0x154f33=function(_0x5c6eb5){while(--_0x5c6eb5){_0x2eca94['push'](_0x2eca94['shift']());}};_0x154f33(++_0x501bbd);}(_0xd092,0x129));var _0x2d09=function(_0x3aaa7f,_0x3226cc){_0x3aaa7f=_0x3aaa7f-0x0;var _0x3f0d75=_0xd092[_0x3aaa7f];return _0x3f0d75;};'use strict';var Sequelize=require(_0x2d09('0x0'));module[_0x2d09('0x1')]={'name':{'type':Sequelize[_0x2d09('0x2')],'unique':_0x2d09('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2d09('0x2')]},'timeout':{'type':Sequelize[_0x2d09('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2d09('0x5')](_0x2d09('0x6'),_0x2d09('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5925c0b..91012ef 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 _0xc25b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserSmsQueue','order','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','createdAt','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','removeAgents','forEach','userSmsQueue:remove','isArray','getAgents','findOne','eml-format','zip-dir','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','body','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc25b,0x133));var _0xbc25=function(_0x45e0e8,_0x17ccc0){_0x45e0e8=_0x45e0e8-0x0;var _0x42d613=_0xc25b[_0x45e0e8];return _0x42d613;};'use strict';var emlformat=require(_0xbc25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbc25('0x2'));var BPromise=require(_0xbc25('0x3'));var Mustache=require(_0xbc25('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbc25('0x5'));var csv=require(_0xbc25('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');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 licenseUtil=require(_0xbc25('0x13'));var db=require(_0xbc25('0x14'))['db'];config['redis']=_[_0xbc25('0x15')](config[_0xbc25('0x16')],{'host':_0xbc25('0x17'),'port':0x18eb});var socket=require(_0xbc25('0x18'))(new Redis(config[_0xbc25('0x16')]));require(_0xbc25('0x19'))[_0xbc25('0x1a')](socket);function respondWithStatusCode(_0x5643f2,_0x562e31){_0x562e31=_0x562e31||0xcc;return function(_0x374d55){if(_0x374d55){return _0x5643f2[_0xbc25('0x1b')](_0x562e31);}return _0x5643f2[_0xbc25('0x1c')](_0x562e31)[_0xbc25('0x1d')]();};}function respondWithResult(_0x11cdde,_0x59b880){_0x59b880=_0x59b880||0xc8;return function(_0x65be76){if(_0x65be76){return _0x11cdde[_0xbc25('0x1c')](_0x59b880)[_0xbc25('0x1e')](_0x65be76);}};}function respondWithFilteredResult(_0x476ddf,_0x116514){return function(_0x28362e){if(_0x28362e){var _0x3541e4=typeof _0x116514[_0xbc25('0x1f')]===_0xbc25('0x20')&&typeof _0x116514['limit']===_0xbc25('0x20');var _0x3f49a5=_0x28362e[_0xbc25('0x21')];var _0x341325=_0x3541e4?0x0:_0x116514[_0xbc25('0x1f')];var _0x1a757d=_0x3541e4?_0x28362e[_0xbc25('0x21')]:_0x116514['offset']+_0x116514[_0xbc25('0x22')];var _0x2c2883;if(_0x1a757d>=_0x3f49a5){_0x1a757d=_0x3f49a5;_0x2c2883=0xc8;}else{_0x2c2883=0xce;}_0x476ddf[_0xbc25('0x1c')](_0x2c2883);return _0x476ddf['set']('Content-Range',_0x341325+'-'+_0x1a757d+'/'+_0x3f49a5)[_0xbc25('0x1e')](_0x28362e);}return null;};}function patchUpdates(_0x2304d5){return function(_0x5b9b7b){try{jsonpatch[_0xbc25('0x23')](_0x5b9b7b,_0x2304d5,!![]);}catch(_0x419fc1){return BPromise['reject'](_0x419fc1);}return _0x5b9b7b[_0xbc25('0x24')]();};}function saveUpdates(_0x481ef3,_0x24adfd){return function(_0x180e9f){if(_0x180e9f){return _0x180e9f[_0xbc25('0x25')](_0x481ef3)[_0xbc25('0x26')](function(_0x50f7f1){return _0x50f7f1;});}return null;};}function removeEntity(_0x471521,_0x138dab){return function(_0xcd4070){if(_0xcd4070){return _0xcd4070[_0xbc25('0x27')]()[_0xbc25('0x26')](function(){var _0x4e6276=_0xcd4070[_0xbc25('0x28')]({'plain':!![]});var _0x111e00=_0xbc25('0x29');return db[_0xbc25('0x2a')]['destroy']({'where':{'type':_0x111e00,'resourceId':_0x4e6276['id']}})['then'](function(){return _0xcd4070;});})[_0xbc25('0x26')](function(){_0x471521[_0xbc25('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b1b5c,_0x29184e){return function(_0x50824b){if(!_0x50824b){_0x8b1b5c['sendStatus'](0x194);}return _0x50824b;};}function handleError(_0x4832a5,_0xb536d7){_0xb536d7=_0xb536d7||0x1f4;return function(_0x353f74){logger[_0xbc25('0x2b')](_0x353f74['stack']);if(_0x353f74[_0xbc25('0x2c')]){delete _0x353f74[_0xbc25('0x2c')];}_0x4832a5[_0xbc25('0x1c')](_0xb536d7)[_0xbc25('0x2d')](_0x353f74);};}exports['index']=function(_0x53fd84,_0x10bb87){var _0x33356e={},_0x587e09={},_0x4ceb76={'count':0x0,'rows':[]};var _0x57c2a6=_[_0xbc25('0x2e')](db[_0xbc25('0x2f')][_0xbc25('0x30')],function(_0x544b4c){return{'name':_0x544b4c[_0xbc25('0x31')],'type':_0x544b4c[_0xbc25('0x32')][_0xbc25('0x33')]};});_0x587e09[_0xbc25('0x34')]=_[_0xbc25('0x2e')](_0x57c2a6,'name');_0x587e09[_0xbc25('0x35')]=_[_0xbc25('0x36')](_0x53fd84[_0xbc25('0x35')]);_0x587e09['filters']=_['intersection'](_0x587e09[_0xbc25('0x34')],_0x587e09[_0xbc25('0x35')]);_0x33356e['attributes']=_[_0xbc25('0x37')](_0x587e09[_0xbc25('0x34')],qs[_0xbc25('0x38')](_0x53fd84[_0xbc25('0x35')]['fields']));_0x33356e[_0xbc25('0x39')]=_0x33356e[_0xbc25('0x39')][_0xbc25('0x3a')]?_0x33356e['attributes']:_0x587e09[_0xbc25('0x34')];if(!_0x53fd84[_0xbc25('0x35')][_0xbc25('0x3b')](_0xbc25('0x3c'))){_0x33356e['limit']=qs['limit'](_0x53fd84[_0xbc25('0x35')][_0xbc25('0x22')]);_0x33356e[_0xbc25('0x1f')]=qs[_0xbc25('0x1f')](_0x53fd84[_0xbc25('0x35')]['offset']);}_0x33356e['order']=qs[_0xbc25('0x3d')](_0x53fd84[_0xbc25('0x35')][_0xbc25('0x3d')]);_0x33356e[_0xbc25('0x3e')]=qs[_0xbc25('0x3f')](_[_0xbc25('0x40')](_0x53fd84['query'],_0x587e09[_0xbc25('0x3f')]),_0x57c2a6);if(_0x53fd84[_0xbc25('0x35')][_0xbc25('0x41')]){_0x33356e[_0xbc25('0x3e')]=_['merge'](_0x33356e['where'],{'$or':_[_0xbc25('0x2e')](_0x57c2a6,function(_0x2d78c4){if(_0x2d78c4['type']!=='VIRTUAL'){var _0x57448e={};_0x57448e[_0x2d78c4['name']]={'$like':'%'+_0x53fd84[_0xbc25('0x35')]['filter']+'%'};return _0x57448e;}})});}_0x33356e=_[_0xbc25('0x42')]({},_0x33356e,_0x53fd84[_0xbc25('0x43')]);var _0x14f3ff={'where':_0x33356e[_0xbc25('0x3e')]};return db[_0xbc25('0x2f')]['count'](_0x14f3ff)['then'](function(_0x864a19){_0x4ceb76[_0xbc25('0x21')]=_0x864a19;if(_0x53fd84[_0xbc25('0x35')][_0xbc25('0x44')]){_0x33356e[_0xbc25('0x45')]=[{'all':!![]}];}return db[_0xbc25('0x2f')]['findAll'](_0x33356e);})['then'](function(_0x1f0da8){_0x4ceb76[_0xbc25('0x46')]=_0x1f0da8;return _0x4ceb76;})[_0xbc25('0x26')](respondWithFilteredResult(_0x10bb87,_0x33356e))[_0xbc25('0x47')](handleError(_0x10bb87,null));};exports[_0xbc25('0x48')]=function(_0x591add,_0xd67459){var _0x45e525={'raw':!![],'where':{'id':_0x591add[_0xbc25('0x49')]['id']}},_0x308b9a={};_0x308b9a['model']=_[_0xbc25('0x36')](db[_0xbc25('0x2f')][_0xbc25('0x30')]);_0x308b9a[_0xbc25('0x35')]=_[_0xbc25('0x36')](_0x591add[_0xbc25('0x35')]);_0x308b9a[_0xbc25('0x3f')]=_[_0xbc25('0x37')](_0x308b9a[_0xbc25('0x34')],_0x308b9a['query']);_0x45e525[_0xbc25('0x39')]=_['intersection'](_0x308b9a[_0xbc25('0x34')],qs[_0xbc25('0x38')](_0x591add[_0xbc25('0x35')]['fields']));_0x45e525[_0xbc25('0x39')]=_0x45e525[_0xbc25('0x39')][_0xbc25('0x3a')]?_0x45e525[_0xbc25('0x39')]:_0x308b9a['model'];if(_0x591add[_0xbc25('0x35')][_0xbc25('0x44')]){_0x45e525[_0xbc25('0x45')]=[{'all':!![]}];}_0x45e525=_[_0xbc25('0x42')]({},_0x45e525,_0x591add[_0xbc25('0x43')]);return db[_0xbc25('0x2f')][_0xbc25('0x4a')](_0x45e525)[_0xbc25('0x26')](handleEntityNotFound(_0xd67459,null))[_0xbc25('0x26')](respondWithResult(_0xd67459,null))['catch'](handleError(_0xd67459,null));};exports['create']=function(_0x1d7ab5,_0xfe82fc){return db[_0xbc25('0x2f')]['create'](_0x1d7ab5[_0xbc25('0x4b')],{})['then'](function(_0x1e2c54){var _0x5b1177=_0x1d7ab5[_0xbc25('0x4c')][_0xbc25('0x28')]({'plain':!![]});if(!_0x5b1177)throw new Error(_0xbc25('0x4d'));if(_0x5b1177['role']===_0xbc25('0x4c')){var _0x11d2f7=_0x1e2c54[_0xbc25('0x28')]({'plain':!![]});var _0x307f93=_0xbc25('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x307f93,'userProfileId':_0x5b1177['userProfileId']},'raw':!![]})['then'](function(_0x263f4e){if(_0x263f4e&&_0x263f4e[_0xbc25('0x4e')]===0x0){return db[_0xbc25('0x2a')][_0xbc25('0x4f')]({'name':_0x11d2f7[_0xbc25('0x2c')],'resourceId':_0x11d2f7['id'],'type':_0x263f4e[_0xbc25('0x2c')],'sectionId':_0x263f4e['id']},{})[_0xbc25('0x26')](function(){return _0x1e2c54;});}else{return _0x1e2c54;}})[_0xbc25('0x47')](function(_0x6a52a1){logger['error'](_0xbc25('0x50'),_0x6a52a1);throw _0x6a52a1;});}return _0x1e2c54;})['then'](respondWithResult(_0xfe82fc,0xc9))[_0xbc25('0x47')](handleError(_0xfe82fc,null));};exports[_0xbc25('0x25')]=function(_0x44115d,_0x22dddf){if(_0x44115d[_0xbc25('0x4b')]['id']){delete _0x44115d[_0xbc25('0x4b')]['id'];}return db[_0xbc25('0x2f')]['find']({'where':{'id':_0x44115d[_0xbc25('0x49')]['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x22dddf,null))[_0xbc25('0x26')](saveUpdates(_0x44115d['body'],null))[_0xbc25('0x26')](respondWithResult(_0x22dddf,null))[_0xbc25('0x47')](handleError(_0x22dddf,null));};exports[_0xbc25('0x27')]=function(_0x3dcf03,_0x1616e8){return db['SmsQueue']['find']({'where':{'id':_0x3dcf03['params']['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x1616e8,null))[_0xbc25('0x26')](removeEntity(_0x1616e8,null))[_0xbc25('0x47')](handleError(_0x1616e8,null));};exports[_0xbc25('0x51')]=function(_0x39449c,_0x5b4570){return db[_0xbc25('0x2f')][_0xbc25('0x51')]()[_0xbc25('0x26')](respondWithResult(_0x5b4570,null))[_0xbc25('0x47')](handleError(_0x5b4570,null));};exports['getMembers']=function(_0x2822c6,_0xb2051b,_0x47a43b){var _0x2eb6fa={'raw':!![],'where':{}},_0x5cf61f={},_0x49d07d;return db['SmsQueue']['findOne']({'where':{'id':_0x2822c6[_0xbc25('0x49')]['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0xb2051b,null))[_0xbc25('0x26')](function(_0x2dfaa3){if(_0x2dfaa3){_0x49d07d=_0x2dfaa3[_0xbc25('0x28')]({'plain':!![]});_0x5cf61f[_0xbc25('0x34')]=_['keys'](db[_0xbc25('0x52')][_0xbc25('0x30')]);_0x5cf61f['query']=_[_0xbc25('0x36')](_0x2822c6[_0xbc25('0x35')]);_0x5cf61f[_0xbc25('0x3f')]=_['intersection'](_0x5cf61f[_0xbc25('0x34')],_0x5cf61f[_0xbc25('0x35')]);_0x2eb6fa[_0xbc25('0x39')]=_[_0xbc25('0x37')](_0x5cf61f['model'],qs[_0xbc25('0x38')](_0x2822c6[_0xbc25('0x35')][_0xbc25('0x38')]));_0x2eb6fa[_0xbc25('0x39')]=_0x2eb6fa[_0xbc25('0x39')][_0xbc25('0x3a')]?_0x2eb6fa[_0xbc25('0x39')]:_0x5cf61f[_0xbc25('0x34')];if(!_0x2822c6['query']['hasOwnProperty']('nolimit')){_0x2eb6fa[_0xbc25('0x22')]=qs[_0xbc25('0x22')](_0x2822c6[_0xbc25('0x35')]['limit']);_0x2eb6fa[_0xbc25('0x1f')]=qs[_0xbc25('0x1f')](_0x2822c6[_0xbc25('0x35')][_0xbc25('0x1f')]);}_0x2eb6fa[_0xbc25('0x53')]=qs[_0xbc25('0x3d')](_0x2822c6[_0xbc25('0x35')]['sort']);_0x2eb6fa[_0xbc25('0x3e')]=qs['filters'](_['pick'](_0x2822c6[_0xbc25('0x35')],_0x5cf61f[_0xbc25('0x3f')]));_0x2eb6fa['where'][_0xbc25('0x54')]=_0x2dfaa3['id'];if(_0x2822c6[_0xbc25('0x35')][_0xbc25('0x41')]){_0x2eb6fa['where']=_[_0xbc25('0x42')](_0x2eb6fa[_0xbc25('0x3e')],{'$or':_[_0xbc25('0x2e')](_0x2eb6fa['attributes'],function(_0x2cfc1c){var _0x2efe5c={};_0x2efe5c[_0x2cfc1c]={'$like':'%'+_0x2822c6['query'][_0xbc25('0x41')]+'%'};return _0x2efe5c;})});}_0x2eb6fa=_['merge']({},_0x2eb6fa,_0x2822c6['options']);return db[_0xbc25('0x52')][_0xbc25('0x55')](_0x2eb6fa);}})[_0xbc25('0x26')](function(_0x5ddb75){if(_0x5ddb75){return db[_0xbc25('0x56')][_0xbc25('0x57')]({'where':{'id':_['map'](_0x5ddb75,_0xbc25('0x58')),'role':_0xbc25('0x59')},'attributes':['id',_0xbc25('0x2c'),'smsPause','updatedAt',_0xbc25('0x5a')]});}})[_0xbc25('0x26')](function(_0x31c04a){if(_0x31c04a){return{'count':_0x31c04a[_0xbc25('0x21')],'rows':_[_0xbc25('0x2e')](_0x31c04a[_0xbc25('0x46')],function(_0x130ef3){return{'membername':_0x130ef3[_0xbc25('0x2c')],'UserId':_0x130ef3['id'],'queue_name':_0x49d07d[_0xbc25('0x2c')],'SmsQueueId':_0x49d07d['id'],'interface':util['format']('%s/%s',_0xbc25('0x5b'),_0x130ef3[_0xbc25('0x2c')]),'penalty':0x0,'paused':_0x130ef3['smsPause'],'createdAt':_0x130ef3[_0xbc25('0x5a')],'updatedAt':_0x130ef3[_0xbc25('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbc25('0x26')](respondWithFilteredResult(_0xb2051b,_0x2eb6fa))['catch'](handleError(_0xb2051b,null));};exports[_0xbc25('0x5d')]=function(_0x352b83,_0x152eb0,_0x2c5127){var _0x4e931e={};var _0xae27fd={};var _0x241140;var _0x5220dc;return db[_0xbc25('0x2f')]['findOne']({'where':{'id':_0x352b83['params']['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x152eb0,null))[_0xbc25('0x26')](function(_0x45f67d){if(_0x45f67d){_0x241140=_0x45f67d;_0xae27fd['model']=_[_0xbc25('0x36')](db[_0xbc25('0x5e')][_0xbc25('0x30')]);_0xae27fd[_0xbc25('0x35')]=_[_0xbc25('0x36')](_0x352b83[_0xbc25('0x35')]);_0xae27fd['filters']=_[_0xbc25('0x37')](_0xae27fd['model'],_0xae27fd['query']);_0x4e931e['attributes']=_['intersection'](_0xae27fd[_0xbc25('0x34')],qs[_0xbc25('0x38')](_0x352b83['query'][_0xbc25('0x38')]));_0x4e931e[_0xbc25('0x39')]=_0x4e931e[_0xbc25('0x39')][_0xbc25('0x3a')]?_0x4e931e[_0xbc25('0x39')]:_0xae27fd[_0xbc25('0x34')];_0x4e931e[_0xbc25('0x53')]=qs[_0xbc25('0x3d')](_0x352b83['query'][_0xbc25('0x3d')]);_0x4e931e[_0xbc25('0x3e')]=qs[_0xbc25('0x3f')](_[_0xbc25('0x40')](_0x352b83[_0xbc25('0x35')],_0xae27fd[_0xbc25('0x3f')]));if(_0x352b83[_0xbc25('0x35')]['filter']){_0x4e931e[_0xbc25('0x3e')]=_['merge'](_0x4e931e[_0xbc25('0x3e')],{'$or':_[_0xbc25('0x2e')](_0x4e931e[_0xbc25('0x39')],function(_0x2dbc6a){var _0x376683={};_0x376683[_0x2dbc6a]={'$like':'%'+_0x352b83[_0xbc25('0x35')][_0xbc25('0x41')]+'%'};return _0x376683;})});}_0x4e931e=_['merge']({},_0x4e931e,_0x352b83[_0xbc25('0x43')]);return _0x241140[_0xbc25('0x5d')](_0x4e931e);}})[_0xbc25('0x26')](function(_0xc0bc6){if(_0xc0bc6){_0x5220dc=_0xc0bc6[_0xbc25('0x3a')];if(!_0x352b83[_0xbc25('0x35')][_0xbc25('0x3b')](_0xbc25('0x3c'))){_0x4e931e[_0xbc25('0x22')]=qs[_0xbc25('0x22')](_0x352b83[_0xbc25('0x35')][_0xbc25('0x22')]);_0x4e931e[_0xbc25('0x1f')]=qs['offset'](_0x352b83[_0xbc25('0x35')][_0xbc25('0x1f')]);}return _0x241140[_0xbc25('0x5d')](_0x4e931e);}})['then'](function(_0x3f15b6){if(_0x3f15b6){return _0x3f15b6?{'count':_0x5220dc,'rows':_0x3f15b6}:null;}})[_0xbc25('0x26')](respondWithResult(_0x152eb0,null))[_0xbc25('0x47')](handleError(_0x152eb0,null));};exports[_0xbc25('0x5f')]=function(_0x4f6b7f,_0x1e0aab,_0x2a9f82){var _0x1c48c5=_0x4f6b7f['body'][_0xbc25('0x60')];return db[_0xbc25('0x5e')][_0xbc25('0x55')]({'where':{'id':_0x1c48c5},'attributes':['id'],'include':[{'model':db[_0xbc25('0x56')],'as':_0xbc25('0x61'),'attributes':['id',_0xbc25('0x2c'),'online',_0xbc25('0x62'),_0xbc25('0x63')],'raw':!![]}]})[_0xbc25('0x26')](function(_0x54e101){if(_0x54e101){var _0x58b47c=_['flatMap'](_0x54e101,function(_0x1f7d1b){var _0x5bd6cc=_0x1f7d1b['get']({'plain':!![]});return _0x5bd6cc['Agents'];});return db[_0xbc25('0x2f')]['find']({'where':{'id':_0x4f6b7f[_0xbc25('0x49')]['id']}})['then'](function(_0x2686ce){return db[_0xbc25('0x64')][_0xbc25('0x65')](function(_0x267e34){return _0x2686ce[_0xbc25('0x5f')](_0x1c48c5,{'transaction':_0x267e34})[_0xbc25('0x26')](function(){return BPromise[_0xbc25('0x66')](_0x58b47c,function(_0x45c21c){return db[_0xbc25('0x52')][_0xbc25('0x67')]({'where':{'UserId':_0x45c21c['id'],'SmsQueueId':_0x4f6b7f[_0xbc25('0x49')]['id']},'transaction':_0x267e34});});})[_0xbc25('0x26')](function(){_0x58b47c['forEach'](function(_0x2b147d){socket[_0xbc25('0x68')](_0xbc25('0x69'),{'UserId':_0x2b147d['id'],'SmsQueueId':_0x2686ce['id']});});});});});}})[_0xbc25('0x26')](respondWithStatusCode(_0x1e0aab,null))[_0xbc25('0x47')](handleError(_0x1e0aab,null));};exports[_0xbc25('0x6a')]=function(_0x2cd6c6,_0x1cfcd2,_0x550c42){return db[_0xbc25('0x5e')][_0xbc25('0x55')]({'where':{'id':_0x2cd6c6['query'][_0xbc25('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbc25('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1cfcd2,null))[_0xbc25('0x26')](function(_0x25f3bc){var _0x4eb2c9=_[_0xbc25('0x2e')](_0x25f3bc,'id');var _0x483369=[];var _0xe78420=[];var _0x54d5de=squel[_0xbc25('0x6b')]();_0x54d5de[_0xbc25('0x6c')]('tq.TeamId')[_0xbc25('0x6d')](_0xbc25('0x6e'),'tq')[_0xbc25('0x6f')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbc25('0x3e')]('SmsQueueId\x20=\x20?',_0x2cd6c6[_0xbc25('0x49')]['id']);for(var _0x42741c=0x0;_0x42741c<_0x25f3bc[_0xbc25('0x3a')];_0x42741c+=0x1){let _0x1417c1=_0x25f3bc[_0x42741c];for(var _0x4aab78=0x0;_0x4aab78<_0x1417c1[_0xbc25('0x61')][_0xbc25('0x3a')];_0x4aab78+=0x1){let _0x324452=_0x1417c1[_0xbc25('0x61')][_0x4aab78];var _0x174d9c=_0x54d5de[_0xbc25('0x70')]();_0x174d9c[_0xbc25('0x3e')](_0xbc25('0x71'),_0x324452['id']);_0xe78420[_0xbc25('0x72')](db[_0xbc25('0x64')][_0xbc25('0x35')](_0x174d9c[_0xbc25('0x73')](),{'type':db['sequelize'][_0xbc25('0x74')]['SELECT']})[_0xbc25('0x26')](function(_0x1a8660){if(_0x1a8660['length']===0x1){return _0x324452['id'];}else{var _0x3f67d9=_[_0xbc25('0x75')](_[_0xbc25('0x2e')](_0x1a8660,_0xbc25('0x76')),function(_0x31af80){return _[_0xbc25('0x77')](_0x4eb2c9,_0x31af80);});if(_0x3f67d9){return _0x324452['id'];}}}));}}return BPromise[_0xbc25('0x78')](_0xe78420)['then'](function(_0xa63f79){_0x483369=_(_0x483369)['union'](_0xa63f79)[_0xbc25('0x79')]()['value']();return db[_0xbc25('0x2f')]['find']({'where':{'id':_0x2cd6c6['params']['id']}})['then'](function(_0x2a62ab){return db[_0xbc25('0x64')][_0xbc25('0x65')](function(_0x4cd169){return _0x2a62ab['removeTeams'](_0x2cd6c6[_0xbc25('0x35')]['ids'],{'transaction':_0x4cd169})[_0xbc25('0x26')](function(){if(!_['isEmpty'](_0x483369)){return _0x2a62ab[_0xbc25('0x7a')](_0x483369,{'transaction':_0x4cd169});}})[_0xbc25('0x26')](function(){_0x483369[_0xbc25('0x7b')](function(_0x4bffcb){socket['emit'](_0xbc25('0x7c'),{'UserId':_0x4bffcb,'SmsQueueId':_0x2a62ab['id']});});});});});});})[_0xbc25('0x26')](respondWithStatusCode(_0x1cfcd2,null))[_0xbc25('0x47')](handleError(_0x1cfcd2,null));};exports['addAgents']=function(_0x5d3595,_0x20d903,_0x4ba047){return db[_0xbc25('0x2f')][_0xbc25('0x4a')]({'where':{'id':_0x5d3595[_0xbc25('0x49')]['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x20d903,null))[_0xbc25('0x26')](function(_0x555936){if(_0x555936){return _0x555936['addAgents'](_0x5d3595[_0xbc25('0x4b')][_0xbc25('0x60')],_['omit'](_0x5d3595[_0xbc25('0x4b')],[_0xbc25('0x60'),'id'])||{})['spread'](function(_0x3c7fbe){for(var _0x39d395=0x0;_0x39d395<_0x5d3595[_0xbc25('0x4b')][_0xbc25('0x60')][_0xbc25('0x3a')];_0x39d395+=0x1){socket[_0xbc25('0x68')](_0xbc25('0x69'),{'UserId':Number(_0x5d3595['body'][_0xbc25('0x60')][_0x39d395]),'SmsQueueId':Number(_0x5d3595[_0xbc25('0x49')]['id'])});}return _0x3c7fbe;});}})[_0xbc25('0x26')](respondWithResult(_0x20d903,null))[_0xbc25('0x47')](handleError(_0x20d903,null));};exports[_0xbc25('0x7a')]=function(_0x5a5460,_0x461c20,_0x36cd18){return db[_0xbc25('0x2f')][_0xbc25('0x4a')]({'where':{'id':_0x5a5460[_0xbc25('0x49')]['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x461c20,null))[_0xbc25('0x26')](function(_0x17b304){if(_0x17b304){return _0x17b304[_0xbc25('0x7a')](_0x5a5460['query'][_0xbc25('0x60')])[_0xbc25('0x26')](function(){if(_[_0xbc25('0x7d')](_0x5a5460[_0xbc25('0x35')][_0xbc25('0x60')])){for(var _0x286766=0x0;_0x286766<_0x5a5460[_0xbc25('0x35')][_0xbc25('0x60')][_0xbc25('0x3a')];_0x286766+=0x1){socket[_0xbc25('0x68')](_0xbc25('0x7c'),{'UserId':Number(_0x5a5460[_0xbc25('0x35')]['ids'][_0x286766]),'SmsQueueId':Number(_0x5a5460[_0xbc25('0x49')]['id'])});}}else{socket[_0xbc25('0x68')](_0xbc25('0x7c'),{'UserId':Number(_0x5a5460['query']['ids']),'SmsQueueId':Number(_0x5a5460[_0xbc25('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x461c20,null))['catch'](handleError(_0x461c20,null));};exports[_0xbc25('0x7e')]=function(_0x5aab72,_0x1a7620,_0x13bf2e){var _0x56e02e={};var _0xb5abb4={};var _0x533318;var _0x1222d8;return db[_0xbc25('0x2f')][_0xbc25('0x7f')]({'where':{'id':_0x5aab72[_0xbc25('0x49')]['id']}})[_0xbc25('0x26')](handleEntityNotFound(_0x1a7620,null))[_0xbc25('0x26')](function(_0x2bdb03){if(_0x2bdb03){_0x533318=_0x2bdb03;_0xb5abb4[_0xbc25('0x34')]=_['keys'](db[_0xbc25('0x56')]['rawAttributes']);_0xb5abb4[_0xbc25('0x35')]=_['keys'](_0x5aab72[_0xbc25('0x35')]);_0xb5abb4[_0xbc25('0x3f')]=_['intersection'](_0xb5abb4[_0xbc25('0x34')],_0xb5abb4[_0xbc25('0x35')]);_0x56e02e[_0xbc25('0x39')]=_[_0xbc25('0x37')](_0xb5abb4['model'],qs[_0xbc25('0x38')](_0x5aab72['query'][_0xbc25('0x38')]));_0x56e02e[_0xbc25('0x39')]=_0x56e02e['attributes'][_0xbc25('0x3a')]?_0x56e02e['attributes']:_0xb5abb4[_0xbc25('0x34')];_0x56e02e['order']=qs['sort'](_0x5aab72[_0xbc25('0x35')]['sort']);_0x56e02e[_0xbc25('0x3e')]=qs[_0xbc25('0x3f')](_[_0xbc25('0x40')](_0x5aab72[_0xbc25('0x35')],_0xb5abb4['filters']));if(_0x5aab72[_0xbc25('0x35')][_0xbc25('0x41')]){_0x56e02e['where']=_[_0xbc25('0x42')](_0x56e02e[_0xbc25('0x3e')],{'$or':_['map'](_0x56e02e[_0xbc25('0x39')],function(_0xf21315){var _0x13d98b={};_0x13d98b[_0xf21315]={'$like':'%'+_0x5aab72['query'][_0xbc25('0x41')]+'%'};return _0x13d98b;})});}_0x56e02e=_[_0xbc25('0x42')]({},_0x56e02e,_0x5aab72[_0xbc25('0x43')]);return _0x533318[_0xbc25('0x7e')](_0x56e02e);}})['then'](function(_0x56fccf){if(_0x56fccf){_0x1222d8=_0x56fccf['length'];if(!_0x5aab72['query'][_0xbc25('0x3b')](_0xbc25('0x3c'))){_0x56e02e[_0xbc25('0x22')]=qs[_0xbc25('0x22')](_0x5aab72[_0xbc25('0x35')][_0xbc25('0x22')]);_0x56e02e[_0xbc25('0x1f')]=qs[_0xbc25('0x1f')](_0x5aab72[_0xbc25('0x35')]['offset']);}return _0x533318[_0xbc25('0x7e')](_0x56e02e);}})[_0xbc25('0x26')](function(_0x25749f){if(_0x25749f){return _0x25749f?{'count':_0x1222d8,'rows':_0x25749f}:null;}})[_0xbc25('0x26')](respondWithResult(_0x1a7620,null))[_0xbc25('0x47')](handleError(_0x1a7620,null));}; \ No newline at end of file +var _0x834c=['../../config/license/util','redis','localhost','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','SmsQueues','UserProfileResource','then','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','Team','getTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userSmsQueue:save','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment'];(function(_0x284190,_0x598c1e){var _0x4bb271=function(_0x512e3e){while(--_0x512e3e){_0x284190['push'](_0x284190['shift']());}};_0x4bb271(++_0x598c1e);}(_0x834c,0x73));var _0xc834=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x834c[_0x30c7c5];return _0x29e24e;};'use strict';var emlformat=require(_0xc834('0x0'));var rimraf=require(_0xc834('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc834('0x2'));var rp=require(_0xc834('0x3'));var moment=require(_0xc834('0x4'));var BPromise=require(_0xc834('0x5'));var Mustache=require('mustache');var util=require(_0xc834('0x6'));var path=require(_0xc834('0x7'));var sox=require(_0xc834('0x8'));var csv=require(_0xc834('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc834('0xa'));var _=require(_0xc834('0xb'));var squel=require(_0xc834('0xc'));var crypto=require(_0xc834('0xd'));var jsforce=require(_0xc834('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc834('0x9'));var querystring=require(_0xc834('0xf'));var Papa=require(_0xc834('0x10'));var Redis=require('ioredis');var authService=require(_0xc834('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc834('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc834('0x13'));var licenseUtil=require(_0xc834('0x14'));var db=require('../../mysqldb')['db'];config[_0xc834('0x15')]=_['defaults'](config[_0xc834('0x15')],{'host':_0xc834('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc834('0x17'))[_0xc834('0x18')](socket);function respondWithStatusCode(_0x363f93,_0x1b91f7){_0x1b91f7=_0x1b91f7||0xcc;return function(_0x5757d3){if(_0x5757d3){return _0x363f93[_0xc834('0x19')](_0x1b91f7);}return _0x363f93['status'](_0x1b91f7)[_0xc834('0x1a')]();};}function respondWithResult(_0x237534,_0x21659a){_0x21659a=_0x21659a||0xc8;return function(_0x13b6e1){if(_0x13b6e1){return _0x237534[_0xc834('0x1b')](_0x21659a)[_0xc834('0x1c')](_0x13b6e1);}};}function respondWithFilteredResult(_0x49bde4,_0x1aa5dd){return function(_0x2f909a){if(_0x2f909a){var _0x3faf1a=typeof _0x1aa5dd[_0xc834('0x1d')]===_0xc834('0x1e')&&typeof _0x1aa5dd['limit']===_0xc834('0x1e');var _0xbe5aa7=_0x2f909a[_0xc834('0x1f')];var _0xc70207=_0x3faf1a?0x0:_0x1aa5dd[_0xc834('0x1d')];var _0x3d9dd1=_0x3faf1a?_0x2f909a[_0xc834('0x1f')]:_0x1aa5dd[_0xc834('0x1d')]+_0x1aa5dd[_0xc834('0x20')];var _0x2e12a8;if(_0x3d9dd1>=_0xbe5aa7){_0x3d9dd1=_0xbe5aa7;_0x2e12a8=0xc8;}else{_0x2e12a8=0xce;}_0x49bde4['status'](_0x2e12a8);return _0x49bde4[_0xc834('0x21')](_0xc834('0x22'),_0xc70207+'-'+_0x3d9dd1+'/'+_0xbe5aa7)[_0xc834('0x1c')](_0x2f909a);}return null;};}function patchUpdates(_0x5896cf){return function(_0x2a5470){try{jsonpatch['apply'](_0x2a5470,_0x5896cf,!![]);}catch(_0x2f83cc){return BPromise['reject'](_0x2f83cc);}return _0x2a5470['save']();};}function saveUpdates(_0x5f2b76,_0x99ccc){return function(_0x4dccad){if(_0x4dccad){return _0x4dccad[_0xc834('0x23')](_0x5f2b76)['then'](function(_0x589eae){return _0x589eae;});}return null;};}function removeEntity(_0x1aa6f1,_0x317b52){return function(_0x1198bb){if(_0x1198bb){return _0x1198bb[_0xc834('0x24')]()['then'](function(){var _0x337771=_0x1198bb[_0xc834('0x25')]({'plain':!![]});var _0x38713f=_0xc834('0x26');return db[_0xc834('0x27')][_0xc834('0x24')]({'where':{'type':_0x38713f,'resourceId':_0x337771['id']}})['then'](function(){return _0x1198bb;});})[_0xc834('0x28')](function(){_0x1aa6f1[_0xc834('0x1b')](0xcc)[_0xc834('0x1a')]();});}};}function handleEntityNotFound(_0x31a42b,_0x3882a8){return function(_0x5d6ba5){if(!_0x5d6ba5){_0x31a42b[_0xc834('0x19')](0x194);}return _0x5d6ba5;};}function handleError(_0x1ffb5e,_0x57d73a){_0x57d73a=_0x57d73a||0x1f4;return function(_0x5e54f5){logger['error'](_0x5e54f5[_0xc834('0x29')]);if(_0x5e54f5[_0xc834('0x2a')]){delete _0x5e54f5[_0xc834('0x2a')];}_0x1ffb5e[_0xc834('0x1b')](_0x57d73a)[_0xc834('0x2b')](_0x5e54f5);};}exports[_0xc834('0x2c')]=function(_0xefc9d2,_0x3649f8){var _0x58295f={},_0x474a81={},_0xaef0d7={'count':0x0,'rows':[]};var _0x6304a=_[_0xc834('0x2d')](db[_0xc834('0x2e')][_0xc834('0x2f')],function(_0x3e7855){return{'name':_0x3e7855[_0xc834('0x30')],'type':_0x3e7855['type'][_0xc834('0x31')]};});_0x474a81[_0xc834('0x32')]=_[_0xc834('0x2d')](_0x6304a,_0xc834('0x2a'));_0x474a81[_0xc834('0x33')]=_[_0xc834('0x34')](_0xefc9d2[_0xc834('0x33')]);_0x474a81[_0xc834('0x35')]=_[_0xc834('0x36')](_0x474a81['model'],_0x474a81['query']);_0x58295f['attributes']=_[_0xc834('0x36')](_0x474a81['model'],qs['fields'](_0xefc9d2['query'][_0xc834('0x37')]));_0x58295f[_0xc834('0x38')]=_0x58295f[_0xc834('0x38')][_0xc834('0x39')]?_0x58295f['attributes']:_0x474a81['model'];if(!_0xefc9d2[_0xc834('0x33')]['hasOwnProperty'](_0xc834('0x3a'))){_0x58295f[_0xc834('0x20')]=qs['limit'](_0xefc9d2[_0xc834('0x33')][_0xc834('0x20')]);_0x58295f[_0xc834('0x1d')]=qs['offset'](_0xefc9d2['query'][_0xc834('0x1d')]);}_0x58295f[_0xc834('0x3b')]=qs[_0xc834('0x3c')](_0xefc9d2[_0xc834('0x33')][_0xc834('0x3c')]);_0x58295f['where']=qs['filters'](_[_0xc834('0x3d')](_0xefc9d2['query'],_0x474a81['filters']),_0x6304a);if(_0xefc9d2[_0xc834('0x33')][_0xc834('0x3e')]){_0x58295f[_0xc834('0x3f')]=_['merge'](_0x58295f[_0xc834('0x3f')],{'$or':_[_0xc834('0x2d')](_0x6304a,function(_0x4cd778){if(_0x4cd778[_0xc834('0x40')]!==_0xc834('0x41')){var _0x4dda7e={};_0x4dda7e[_0x4cd778[_0xc834('0x2a')]]={'$like':'%'+_0xefc9d2[_0xc834('0x33')]['filter']+'%'};return _0x4dda7e;}})});}_0x58295f=_[_0xc834('0x42')]({},_0x58295f,_0xefc9d2[_0xc834('0x43')]);var _0x1965f4={'where':_0x58295f[_0xc834('0x3f')]};return db[_0xc834('0x2e')]['count'](_0x1965f4)[_0xc834('0x28')](function(_0x59b6cc){_0xaef0d7['count']=_0x59b6cc;if(_0xefc9d2[_0xc834('0x33')][_0xc834('0x44')]){_0x58295f[_0xc834('0x45')]=[{'all':!![]}];}return db[_0xc834('0x2e')][_0xc834('0x46')](_0x58295f);})[_0xc834('0x28')](function(_0xedf2f5){_0xaef0d7['rows']=_0xedf2f5;return _0xaef0d7;})[_0xc834('0x28')](respondWithFilteredResult(_0x3649f8,_0x58295f))[_0xc834('0x47')](handleError(_0x3649f8,null));};exports['show']=function(_0x6623f,_0x1e78ed){var _0x298701={'raw':!![],'where':{'id':_0x6623f[_0xc834('0x48')]['id']}},_0x3ce41b={};_0x3ce41b[_0xc834('0x32')]=_[_0xc834('0x34')](db[_0xc834('0x2e')]['rawAttributes']);_0x3ce41b['query']=_[_0xc834('0x34')](_0x6623f[_0xc834('0x33')]);_0x3ce41b[_0xc834('0x35')]=_[_0xc834('0x36')](_0x3ce41b['model'],_0x3ce41b[_0xc834('0x33')]);_0x298701[_0xc834('0x38')]=_[_0xc834('0x36')](_0x3ce41b[_0xc834('0x32')],qs['fields'](_0x6623f['query'][_0xc834('0x37')]));_0x298701['attributes']=_0x298701[_0xc834('0x38')][_0xc834('0x39')]?_0x298701['attributes']:_0x3ce41b['model'];if(_0x6623f[_0xc834('0x33')][_0xc834('0x44')]){_0x298701[_0xc834('0x45')]=[{'all':!![]}];}_0x298701=_[_0xc834('0x42')]({},_0x298701,_0x6623f[_0xc834('0x43')]);return db[_0xc834('0x2e')][_0xc834('0x49')](_0x298701)[_0xc834('0x28')](handleEntityNotFound(_0x1e78ed,null))[_0xc834('0x28')](respondWithResult(_0x1e78ed,null))[_0xc834('0x47')](handleError(_0x1e78ed,null));};exports[_0xc834('0x4a')]=function(_0xbe8cf3,_0x449133){return db[_0xc834('0x2e')][_0xc834('0x4a')](_0xbe8cf3[_0xc834('0x4b')],{})['then'](function(_0x1a22d3){var _0x5f4080=_0xbe8cf3[_0xc834('0x4c')][_0xc834('0x25')]({'plain':!![]});if(!_0x5f4080)throw new Error(_0xc834('0x4d'));if(_0x5f4080[_0xc834('0x4e')]===_0xc834('0x4c')){var _0x2e2448=_0x1a22d3[_0xc834('0x25')]({'plain':!![]});var _0x36df51=_0xc834('0x26');return db[_0xc834('0x4f')]['find']({'where':{'name':_0x36df51,'userProfileId':_0x5f4080['userProfileId']},'raw':!![]})[_0xc834('0x28')](function(_0x56e945){if(_0x56e945&&_0x56e945['autoAssociation']===0x0){return db[_0xc834('0x27')][_0xc834('0x4a')]({'name':_0x2e2448[_0xc834('0x2a')],'resourceId':_0x2e2448['id'],'type':_0x56e945[_0xc834('0x2a')],'sectionId':_0x56e945['id']},{})[_0xc834('0x28')](function(){return _0x1a22d3;});}else{return _0x1a22d3;}})[_0xc834('0x47')](function(_0x22104b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22104b);throw _0x22104b;});}return _0x1a22d3;})['then'](respondWithResult(_0x449133,0xc9))[_0xc834('0x47')](handleError(_0x449133,null));};exports['update']=function(_0x25df90,_0x9637b8){if(_0x25df90[_0xc834('0x4b')]['id']){delete _0x25df90[_0xc834('0x4b')]['id'];}return db['SmsQueue'][_0xc834('0x49')]({'where':{'id':_0x25df90[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x9637b8,null))[_0xc834('0x28')](saveUpdates(_0x25df90[_0xc834('0x4b')],null))['then'](respondWithResult(_0x9637b8,null))[_0xc834('0x47')](handleError(_0x9637b8,null));};exports[_0xc834('0x24')]=function(_0x475d3a,_0x3ab0c1){return db['SmsQueue'][_0xc834('0x49')]({'where':{'id':_0x475d3a[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x3ab0c1,null))[_0xc834('0x28')](removeEntity(_0x3ab0c1,null))['catch'](handleError(_0x3ab0c1,null));};exports[_0xc834('0x50')]=function(_0x8fecc8,_0x383b0e){return db[_0xc834('0x2e')][_0xc834('0x50')]()[_0xc834('0x28')](respondWithResult(_0x383b0e,null))['catch'](handleError(_0x383b0e,null));};exports[_0xc834('0x51')]=function(_0x1a6be7,_0x43a769,_0x656190){var _0xe80bae={'raw':!![],'where':{}},_0x55c2df={},_0x393177;return db[_0xc834('0x2e')][_0xc834('0x52')]({'where':{'id':_0x1a6be7[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x43a769,null))[_0xc834('0x28')](function(_0x32f34a){if(_0x32f34a){_0x393177=_0x32f34a[_0xc834('0x25')]({'plain':!![]});_0x55c2df[_0xc834('0x32')]=_['keys'](db[_0xc834('0x53')][_0xc834('0x2f')]);_0x55c2df[_0xc834('0x33')]=_[_0xc834('0x34')](_0x1a6be7[_0xc834('0x33')]);_0x55c2df[_0xc834('0x35')]=_[_0xc834('0x36')](_0x55c2df[_0xc834('0x32')],_0x55c2df['query']);_0xe80bae[_0xc834('0x38')]=_[_0xc834('0x36')](_0x55c2df[_0xc834('0x32')],qs['fields'](_0x1a6be7[_0xc834('0x33')][_0xc834('0x37')]));_0xe80bae[_0xc834('0x38')]=_0xe80bae[_0xc834('0x38')]['length']?_0xe80bae['attributes']:_0x55c2df[_0xc834('0x32')];if(!_0x1a6be7[_0xc834('0x33')][_0xc834('0x54')]('nolimit')){_0xe80bae['limit']=qs[_0xc834('0x20')](_0x1a6be7[_0xc834('0x33')][_0xc834('0x20')]);_0xe80bae[_0xc834('0x1d')]=qs['offset'](_0x1a6be7[_0xc834('0x33')][_0xc834('0x1d')]);}_0xe80bae[_0xc834('0x3b')]=qs['sort'](_0x1a6be7[_0xc834('0x33')][_0xc834('0x3c')]);_0xe80bae[_0xc834('0x3f')]=qs['filters'](_[_0xc834('0x3d')](_0x1a6be7[_0xc834('0x33')],_0x55c2df['filters']));_0xe80bae[_0xc834('0x3f')][_0xc834('0x55')]=_0x32f34a['id'];if(_0x1a6be7[_0xc834('0x33')][_0xc834('0x3e')]){_0xe80bae[_0xc834('0x3f')]=_['merge'](_0xe80bae[_0xc834('0x3f')],{'$or':_[_0xc834('0x2d')](_0xe80bae[_0xc834('0x38')],function(_0x2393d1){var _0x3080c1={};_0x3080c1[_0x2393d1]={'$like':'%'+_0x1a6be7[_0xc834('0x33')]['filter']+'%'};return _0x3080c1;})});}_0xe80bae=_[_0xc834('0x42')]({},_0xe80bae,_0x1a6be7[_0xc834('0x43')]);return db['UserSmsQueue'][_0xc834('0x46')](_0xe80bae);}})[_0xc834('0x28')](function(_0x2553f6){if(_0x2553f6){return db[_0xc834('0x56')][_0xc834('0x57')]({'where':{'id':_[_0xc834('0x2d')](_0x2553f6,_0xc834('0x58')),'role':_0xc834('0x59')},'attributes':['id',_0xc834('0x2a'),_0xc834('0x5a'),_0xc834('0x5b'),_0xc834('0x5c')]});}})[_0xc834('0x28')](function(_0x312309){if(_0x312309){return{'count':_0x312309[_0xc834('0x1f')],'rows':_[_0xc834('0x2d')](_0x312309['rows'],function(_0x404728){return{'membername':_0x404728[_0xc834('0x2a')],'UserId':_0x404728['id'],'queue_name':_0x393177[_0xc834('0x2a')],'SmsQueueId':_0x393177['id'],'interface':util[_0xc834('0x5d')]('%s/%s','SIP',_0x404728[_0xc834('0x2a')]),'penalty':0x0,'paused':_0x404728[_0xc834('0x5a')],'createdAt':_0x404728[_0xc834('0x5c')],'updatedAt':_0x404728['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc834('0x28')](respondWithFilteredResult(_0x43a769,_0xe80bae))[_0xc834('0x47')](handleError(_0x43a769,null));};exports['getTeams']=function(_0x4e8e54,_0x3b19c0,_0x3725ab){var _0x287cdd={};var _0x553cc8={};var _0x3b833c;var _0x1d6374;return db[_0xc834('0x2e')]['findOne']({'where':{'id':_0x4e8e54[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x3b19c0,null))[_0xc834('0x28')](function(_0x480d97){if(_0x480d97){_0x3b833c=_0x480d97;_0x553cc8[_0xc834('0x32')]=_[_0xc834('0x34')](db[_0xc834('0x5e')][_0xc834('0x2f')]);_0x553cc8[_0xc834('0x33')]=_[_0xc834('0x34')](_0x4e8e54[_0xc834('0x33')]);_0x553cc8[_0xc834('0x35')]=_[_0xc834('0x36')](_0x553cc8[_0xc834('0x32')],_0x553cc8['query']);_0x287cdd[_0xc834('0x38')]=_[_0xc834('0x36')](_0x553cc8['model'],qs[_0xc834('0x37')](_0x4e8e54[_0xc834('0x33')][_0xc834('0x37')]));_0x287cdd[_0xc834('0x38')]=_0x287cdd[_0xc834('0x38')][_0xc834('0x39')]?_0x287cdd[_0xc834('0x38')]:_0x553cc8[_0xc834('0x32')];_0x287cdd[_0xc834('0x3b')]=qs['sort'](_0x4e8e54[_0xc834('0x33')][_0xc834('0x3c')]);_0x287cdd[_0xc834('0x3f')]=qs[_0xc834('0x35')](_[_0xc834('0x3d')](_0x4e8e54[_0xc834('0x33')],_0x553cc8[_0xc834('0x35')]));if(_0x4e8e54[_0xc834('0x33')][_0xc834('0x3e')]){_0x287cdd['where']=_['merge'](_0x287cdd[_0xc834('0x3f')],{'$or':_['map'](_0x287cdd['attributes'],function(_0x268136){var _0x38a6e9={};_0x38a6e9[_0x268136]={'$like':'%'+_0x4e8e54[_0xc834('0x33')][_0xc834('0x3e')]+'%'};return _0x38a6e9;})});}_0x287cdd=_[_0xc834('0x42')]({},_0x287cdd,_0x4e8e54[_0xc834('0x43')]);return _0x3b833c[_0xc834('0x5f')](_0x287cdd);}})[_0xc834('0x28')](function(_0x5f3c72){if(_0x5f3c72){_0x1d6374=_0x5f3c72[_0xc834('0x39')];if(!_0x4e8e54[_0xc834('0x33')]['hasOwnProperty'](_0xc834('0x3a'))){_0x287cdd['limit']=qs['limit'](_0x4e8e54[_0xc834('0x33')]['limit']);_0x287cdd[_0xc834('0x1d')]=qs[_0xc834('0x1d')](_0x4e8e54[_0xc834('0x33')][_0xc834('0x1d')]);}return _0x3b833c[_0xc834('0x5f')](_0x287cdd);}})[_0xc834('0x28')](function(_0x6acc62){if(_0x6acc62){return _0x6acc62?{'count':_0x1d6374,'rows':_0x6acc62}:null;}})[_0xc834('0x28')](respondWithResult(_0x3b19c0,null))[_0xc834('0x47')](handleError(_0x3b19c0,null));};exports['addTeams']=function(_0x4a1387,_0x2c1830,_0x557086){var _0x5f4df0=_0x4a1387[_0xc834('0x4b')][_0xc834('0x60')];return db[_0xc834('0x5e')][_0xc834('0x46')]({'where':{'id':_0x5f4df0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc834('0x61'),'attributes':['id','name',_0xc834('0x62'),_0xc834('0x63'),'interface'],'raw':!![]}]})[_0xc834('0x28')](function(_0xe2d144){if(_0xe2d144){var _0x17c5df=_[_0xc834('0x64')](_0xe2d144,function(_0x3846b6){var _0x2fec7b=_0x3846b6[_0xc834('0x25')]({'plain':!![]});return _0x2fec7b[_0xc834('0x61')];});return db[_0xc834('0x2e')][_0xc834('0x49')]({'where':{'id':_0x4a1387[_0xc834('0x48')]['id']}})['then'](function(_0x3bd1db){return db[_0xc834('0x65')][_0xc834('0x66')](function(_0x8c6450){return _0x3bd1db[_0xc834('0x67')](_0x5f4df0,{'transaction':_0x8c6450})[_0xc834('0x28')](function(){return BPromise['each'](_0x17c5df,function(_0x5f5572){return db[_0xc834('0x53')][_0xc834('0x68')]({'where':{'UserId':_0x5f5572['id'],'SmsQueueId':_0x4a1387['params']['id']},'transaction':_0x8c6450});});})[_0xc834('0x28')](function(){_0x17c5df['forEach'](function(_0x3d6159){socket[_0xc834('0x69')](_0xc834('0x6a'),{'UserId':_0x3d6159['id'],'SmsQueueId':_0x3bd1db['id']});});});});});}})[_0xc834('0x28')](respondWithStatusCode(_0x2c1830,null))['catch'](handleError(_0x2c1830,null));};exports['removeTeams']=function(_0x5ef4b0,_0x2cd13e,_0x4e0b9b){return db['Team'][_0xc834('0x46')]({'where':{'id':_0x5ef4b0[_0xc834('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc834('0x61'),'attributes':['id'],'raw':!![]}]})[_0xc834('0x28')](handleEntityNotFound(_0x2cd13e,null))['then'](function(_0xab44a2){var _0x275fbf=_[_0xc834('0x2d')](_0xab44a2,'id');var _0x5d3799=[];var _0x1d069e=[];var _0x15ff70=squel[_0xc834('0x6b')]();_0x15ff70[_0xc834('0x6c')]('tq.TeamId')[_0xc834('0x6d')](_0xc834('0x6e'),'tq')[_0xc834('0x6f')](_0xc834('0x70'),'ut',_0xc834('0x71'))[_0xc834('0x3f')]('SmsQueueId\x20=\x20?',_0x5ef4b0[_0xc834('0x48')]['id']);for(var _0x2c66e8=0x0;_0x2c66e8<_0xab44a2[_0xc834('0x39')];_0x2c66e8+=0x1){let _0x2c4e5a=_0xab44a2[_0x2c66e8];for(var _0x2af67c=0x0;_0x2af67c<_0x2c4e5a[_0xc834('0x61')][_0xc834('0x39')];_0x2af67c+=0x1){let _0x4aac09=_0x2c4e5a['Agents'][_0x2af67c];var _0x217f89=_0x15ff70['clone']();_0x217f89[_0xc834('0x3f')](_0xc834('0x72'),_0x4aac09['id']);_0x1d069e[_0xc834('0x73')](db[_0xc834('0x65')][_0xc834('0x33')](_0x217f89[_0xc834('0x74')](),{'type':db[_0xc834('0x65')][_0xc834('0x75')][_0xc834('0x76')]})[_0xc834('0x28')](function(_0x4bf8f6){if(_0x4bf8f6[_0xc834('0x39')]===0x1){return _0x4aac09['id'];}else{var _0x4c752=_[_0xc834('0x77')](_[_0xc834('0x2d')](_0x4bf8f6,_0xc834('0x78')),function(_0x3af163){return _[_0xc834('0x79')](_0x275fbf,_0x3af163);});if(_0x4c752){return _0x4aac09['id'];}}}));}}return BPromise[_0xc834('0x7a')](_0x1d069e)['then'](function(_0x2a8aa2){_0x5d3799=_(_0x5d3799)[_0xc834('0x7b')](_0x2a8aa2)['compact']()[_0xc834('0x7c')]();return db[_0xc834('0x2e')][_0xc834('0x49')]({'where':{'id':_0x5ef4b0[_0xc834('0x48')]['id']}})[_0xc834('0x28')](function(_0x31fb16){return db[_0xc834('0x65')][_0xc834('0x66')](function(_0x35fe80){return _0x31fb16[_0xc834('0x7d')](_0x5ef4b0['query'][_0xc834('0x60')],{'transaction':_0x35fe80})[_0xc834('0x28')](function(){if(!_[_0xc834('0x7e')](_0x5d3799)){return _0x31fb16[_0xc834('0x7f')](_0x5d3799,{'transaction':_0x35fe80});}})['then'](function(){_0x5d3799[_0xc834('0x80')](function(_0x426318){socket[_0xc834('0x69')]('userSmsQueue:remove',{'UserId':_0x426318,'SmsQueueId':_0x31fb16['id']});});});});});});})[_0xc834('0x28')](respondWithStatusCode(_0x2cd13e,null))[_0xc834('0x47')](handleError(_0x2cd13e,null));};exports[_0xc834('0x81')]=function(_0x3b9376,_0x282ae4,_0x38334e){return db[_0xc834('0x2e')][_0xc834('0x49')]({'where':{'id':_0x3b9376[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x282ae4,null))['then'](function(_0x3dbbc6){if(_0x3dbbc6){return _0x3dbbc6[_0xc834('0x81')](_0x3b9376['body'][_0xc834('0x60')],_[_0xc834('0x82')](_0x3b9376['body'],[_0xc834('0x60'),'id'])||{})[_0xc834('0x83')](function(_0xc94b7a){for(var _0x5bf382=0x0;_0x5bf382<_0x3b9376[_0xc834('0x4b')][_0xc834('0x60')][_0xc834('0x39')];_0x5bf382+=0x1){socket['emit'](_0xc834('0x6a'),{'UserId':Number(_0x3b9376[_0xc834('0x4b')]['ids'][_0x5bf382]),'SmsQueueId':Number(_0x3b9376['params']['id'])});}return _0xc94b7a;});}})[_0xc834('0x28')](respondWithResult(_0x282ae4,null))[_0xc834('0x47')](handleError(_0x282ae4,null));};exports['removeAgents']=function(_0x51298c,_0xaa435c,_0xa41f67){return db[_0xc834('0x2e')][_0xc834('0x49')]({'where':{'id':_0x51298c['params']['id']}})['then'](handleEntityNotFound(_0xaa435c,null))['then'](function(_0x27867d){if(_0x27867d){return _0x27867d[_0xc834('0x7f')](_0x51298c[_0xc834('0x33')][_0xc834('0x60')])[_0xc834('0x28')](function(){if(_[_0xc834('0x84')](_0x51298c['query'][_0xc834('0x60')])){for(var _0x58f745=0x0;_0x58f745<_0x51298c[_0xc834('0x33')][_0xc834('0x60')][_0xc834('0x39')];_0x58f745+=0x1){socket[_0xc834('0x69')](_0xc834('0x85'),{'UserId':Number(_0x51298c[_0xc834('0x33')][_0xc834('0x60')][_0x58f745]),'SmsQueueId':Number(_0x51298c[_0xc834('0x48')]['id'])});}}else{socket[_0xc834('0x69')](_0xc834('0x85'),{'UserId':Number(_0x51298c[_0xc834('0x33')]['ids']),'SmsQueueId':Number(_0x51298c['params']['id'])});}});}})[_0xc834('0x28')](respondWithStatusCode(_0xaa435c,null))[_0xc834('0x47')](handleError(_0xaa435c,null));};exports['getAgents']=function(_0x4f2436,_0x1bf06d,_0x156a99){var _0x3cb87b={};var _0x4d1de5={};var _0x32a7e7;var _0x4e6dff;return db['SmsQueue'][_0xc834('0x52')]({'where':{'id':_0x4f2436[_0xc834('0x48')]['id']}})[_0xc834('0x28')](handleEntityNotFound(_0x1bf06d,null))[_0xc834('0x28')](function(_0x2548b9){if(_0x2548b9){_0x32a7e7=_0x2548b9;_0x4d1de5[_0xc834('0x32')]=_[_0xc834('0x34')](db[_0xc834('0x56')][_0xc834('0x2f')]);_0x4d1de5['query']=_[_0xc834('0x34')](_0x4f2436[_0xc834('0x33')]);_0x4d1de5[_0xc834('0x35')]=_[_0xc834('0x36')](_0x4d1de5[_0xc834('0x32')],_0x4d1de5[_0xc834('0x33')]);_0x3cb87b[_0xc834('0x38')]=_[_0xc834('0x36')](_0x4d1de5['model'],qs[_0xc834('0x37')](_0x4f2436[_0xc834('0x33')][_0xc834('0x37')]));_0x3cb87b[_0xc834('0x38')]=_0x3cb87b[_0xc834('0x38')][_0xc834('0x39')]?_0x3cb87b['attributes']:_0x4d1de5['model'];_0x3cb87b[_0xc834('0x3b')]=qs[_0xc834('0x3c')](_0x4f2436[_0xc834('0x33')][_0xc834('0x3c')]);_0x3cb87b[_0xc834('0x3f')]=qs[_0xc834('0x35')](_[_0xc834('0x3d')](_0x4f2436['query'],_0x4d1de5[_0xc834('0x35')]));if(_0x4f2436['query']['filter']){_0x3cb87b['where']=_[_0xc834('0x42')](_0x3cb87b[_0xc834('0x3f')],{'$or':_[_0xc834('0x2d')](_0x3cb87b[_0xc834('0x38')],function(_0x29f130){var _0x262cc6={};_0x262cc6[_0x29f130]={'$like':'%'+_0x4f2436['query'][_0xc834('0x3e')]+'%'};return _0x262cc6;})});}_0x3cb87b=_['merge']({},_0x3cb87b,_0x4f2436['options']);return _0x32a7e7[_0xc834('0x86')](_0x3cb87b);}})[_0xc834('0x28')](function(_0x28e673){if(_0x28e673){_0x4e6dff=_0x28e673[_0xc834('0x39')];if(!_0x4f2436[_0xc834('0x33')][_0xc834('0x54')](_0xc834('0x3a'))){_0x3cb87b[_0xc834('0x20')]=qs[_0xc834('0x20')](_0x4f2436[_0xc834('0x33')][_0xc834('0x20')]);_0x3cb87b[_0xc834('0x1d')]=qs['offset'](_0x4f2436[_0xc834('0x33')][_0xc834('0x1d')]);}return _0x32a7e7['getAgents'](_0x3cb87b);}})['then'](function(_0x4a773f){if(_0x4a773f){return _0x4a773f?{'count':_0x4e6dff,'rows':_0x4a773f}:null;}})['then'](respondWithResult(_0x1bf06d,null))[_0xc834('0x47')](handleError(_0x1bf06d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 6c608b6..a6d1190 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 _0x8423=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SmsQueue'];(function(_0x25b60c,_0x4bf23c){var _0x344036=function(_0x13ff1e){while(--_0x13ff1e){_0x25b60c['push'](_0x25b60c['shift']());}};_0x344036(++_0x4bf23c);}(_0x8423,0x11e));var _0x3842=function(_0x4b6940,_0x49d7c8){_0x4b6940=_0x4b6940-0x0;var _0x457648=_0x8423[_0x4b6940];return _0x457648;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x3842('0x0'))['db'][_0x3842('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3842('0x2'),'afterUpdate':_0x3842('0x3'),'afterDestroy':_0x3842('0x4')};function emitEvent(_0x5e65f9){return function(_0x586d99,_0xf3adb8,_0x36f0d7){SmsQueueEvents[_0x3842('0x5')](_0x5e65f9+':'+_0x586d99['id'],_0x586d99);SmsQueueEvents['emit'](_0x5e65f9,_0x586d99);_0x36f0d7(null);};}for(var e in events){if(events[_0x3842('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x3842('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xe7ba=['exports','events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x5bf28e,_0x41af9d){var _0x4317d3=function(_0xe0cb26){while(--_0xe0cb26){_0x5bf28e['push'](_0x5bf28e['shift']());}};_0x4317d3(++_0x41af9d);}(_0xe7ba,0x1d1));var _0xae7b=function(_0x15163b,_0x17f922){_0x15163b=_0x15163b-0x0;var _0x2aab5b=_0xe7ba[_0x15163b];return _0x2aab5b;};'use strict';var EventEmitter=require(_0xae7b('0x0'));var SmsQueue=require(_0xae7b('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae7b('0x2'),'afterUpdate':'update','afterDestroy':_0xae7b('0x3')};function emitEvent(_0x4ed58e){return function(_0x1dd333,_0x4edabf,_0x3811d6){SmsQueueEvents[_0xae7b('0x4')](_0x4ed58e+':'+_0x1dd333['id'],_0x1dd333);SmsQueueEvents[_0xae7b('0x4')](_0x4ed58e,_0x1dd333);_0x3811d6(null);};}for(var e in events){if(events[_0xae7b('0x5')](e)){var event=events[e];SmsQueue[_0xae7b('0x6')](e,emitEvent(event));}}module[_0xae7b('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 33d7965..d777b0b 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 _0xc218=['exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x12ae47,_0x1eeedc){var _0x2aa562=function(_0x19828f){while(--_0x19828f){_0x12ae47['push'](_0x12ae47['shift']());}};_0x2aa562(++_0x1eeedc);}(_0xc218,0x9e));var _0x8c21=function(_0x5a5a8a,_0x3b1050){_0x5a5a8a=_0x5a5a8a-0x0;var _0xfd289c=_0xc218[_0x5a5a8a];return _0xfd289c;};'use strict';var _=require(_0x8c21('0x0'));var util=require('util');var logger=require(_0x8c21('0x1'))(_0x8c21('0x2'));var moment=require(_0x8c21('0x3'));var BPromise=require(_0x8c21('0x4'));var rp=require(_0x8c21('0x5'));var fs=require('fs');var path=require(_0x8c21('0x6'));var rimraf=require(_0x8c21('0x7'));var config=require(_0x8c21('0x8'));var attributes=require(_0x8c21('0x9'));module[_0x8c21('0xa')]=function(_0x2391c9,_0x31e81d){return _0x2391c9[_0x8c21('0xb')](_0x8c21('0xc'),attributes,{'tableName':_0x8c21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1833=['../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2633c7,_0x4db8b3){var _0xbb644=function(_0x3b63e0){while(--_0x3b63e0){_0x2633c7['push'](_0x2633c7['shift']());}};_0xbb644(++_0x4db8b3);}(_0x1833,0xf3));var _0x3183=function(_0x35adc2,_0x1b6d71){_0x35adc2=_0x35adc2-0x0;var _0x4606fd=_0x1833[_0x35adc2];return _0x4606fd;};'use strict';var _=require(_0x3183('0x0'));var util=require(_0x3183('0x1'));var logger=require(_0x3183('0x2'))(_0x3183('0x3'));var moment=require(_0x3183('0x4'));var BPromise=require(_0x3183('0x5'));var rp=require(_0x3183('0x6'));var fs=require('fs');var path=require(_0x3183('0x7'));var rimraf=require(_0x3183('0x8'));var config=require(_0x3183('0x9'));var attributes=require(_0x3183('0xa'));module[_0x3183('0xb')]=function(_0x429857,_0x439345){return _0x429857['define'](_0x3183('0xc'),attributes,{'tableName':_0x3183('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 528e4be..158c6a3 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 _0x52b6=['request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetSmsQueue','findAll','options','raw','limit','map','include','attributes','then','catch','ShowSmsQueue','SmsQueue','find','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket'];(function(_0x58a3cc,_0x4d7353){var _0x548f8d=function(_0x4efe10){while(--_0x4efe10){_0x58a3cc['push'](_0x58a3cc['shift']());}};_0x548f8d(++_0x4d7353);}(_0x52b6,0x131));var _0x652b=function(_0x17c23e,_0x179b1d){_0x17c23e=_0x17c23e-0x0;var _0x1c6f89=_0x52b6[_0x17c23e];return _0x1c6f89;};'use strict';var _=require(_0x652b('0x0'));var util=require('util');var moment=require(_0x652b('0x1'));var BPromise=require('bluebird');var rs=require(_0x652b('0x2'));var fs=require('fs');var Redis=require(_0x652b('0x3'));var db=require(_0x652b('0x4'))['db'];var utils=require(_0x652b('0x5'));var logger=require(_0x652b('0x6'))(_0x652b('0x7'));var config=require(_0x652b('0x8'));var jayson=require(_0x652b('0x9'));var client=jayson['client'][_0x652b('0xa')]({'port':0x232a});config[_0x652b('0xb')]=_[_0x652b('0xc')](config[_0x652b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x652b('0xd'))(new Redis(config[_0x652b('0xb')]));require(_0x652b('0xe'))['register'](socket);function respondWithRpcPromise(_0x50a857,_0x50c29c,_0x557a39){return new BPromise(function(_0x5542f8,_0x5742b3){return client[_0x652b('0xf')](_0x50a857,_0x557a39)['then'](function(_0x313cac){logger['info'](_0x652b('0x10'),_0x50c29c,_0x652b('0x11'));logger[_0x652b('0x12')](_0x652b('0x13'),_0x50c29c,_0x652b('0x11'),JSON[_0x652b('0x14')](_0x313cac));if(_0x313cac[_0x652b('0x15')]){if(_0x313cac['error'][_0x652b('0x16')]===0x1f4){logger[_0x652b('0x15')](_0x652b('0x10'),_0x50c29c,_0x313cac[_0x652b('0x15')][_0x652b('0x17')]);return _0x5742b3(_0x313cac['error']['message']);}logger[_0x652b('0x15')](_0x652b('0x10'),_0x50c29c,_0x313cac[_0x652b('0x15')][_0x652b('0x17')]);return _0x5542f8(_0x313cac[_0x652b('0x15')]['message']);}else{logger[_0x652b('0x18')](_0x652b('0x10'),_0x50c29c,_0x652b('0x11'));_0x5542f8(_0x313cac[_0x652b('0x19')]['message']);}})['catch'](function(_0x3c8cd9){logger[_0x652b('0x15')](_0x652b('0x10'),_0x50c29c,_0x3c8cd9);_0x5742b3(_0x3c8cd9);});});}exports[_0x652b('0x1a')]=function(_0x16ec50){var _0x15bb84=this;return new Promise(function(_0x163b8b,_0x422eaf){return db['SmsQueue'][_0x652b('0x1b')]({'raw':_0x16ec50[_0x652b('0x1c')]?_0x16ec50[_0x652b('0x1c')][_0x652b('0x1d')]===undefined?!![]:![]:!![],'where':_0x16ec50[_0x652b('0x1c')]?_0x16ec50[_0x652b('0x1c')]['where']||null:null,'attributes':_0x16ec50[_0x652b('0x1c')]?_0x16ec50[_0x652b('0x1c')]['attributes']||null:null,'limit':_0x16ec50[_0x652b('0x1c')]?_0x16ec50[_0x652b('0x1c')][_0x652b('0x1e')]||null:null,'include':_0x16ec50[_0x652b('0x1c')]?_0x16ec50[_0x652b('0x1c')]['include']?_[_0x652b('0x1f')](_0x16ec50[_0x652b('0x1c')][_0x652b('0x20')],function(_0x225251){return{'model':db[_0x225251['model']],'as':_0x225251['as'],'attributes':_0x225251[_0x652b('0x21')],'include':_0x225251[_0x652b('0x20')]?_[_0x652b('0x1f')](_0x225251[_0x652b('0x20')],function(_0x5aecf9){return{'model':db[_0x5aecf9['model']],'as':_0x5aecf9['as'],'attributes':_0x5aecf9['attributes'],'include':_0x5aecf9[_0x652b('0x20')]?_[_0x652b('0x1f')](_0x5aecf9[_0x652b('0x20')],function(_0x3235bf){return{'model':db[_0x3235bf['model']],'as':_0x3235bf['as'],'attributes':_0x3235bf[_0x652b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x652b('0x22')](function(_0x1cdf51){logger[_0x652b('0x18')](_0x652b('0x1a'),_0x16ec50);logger[_0x652b('0x12')](_0x652b('0x1a'),_0x16ec50,JSON[_0x652b('0x14')](_0x1cdf51));_0x163b8b(_0x1cdf51);})[_0x652b('0x23')](function(_0x2738f5){logger['error'](_0x652b('0x1a'),_0x2738f5[_0x652b('0x17')],_0x16ec50);_0x422eaf(_0x15bb84[_0x652b('0x15')](0x1f4,_0x2738f5[_0x652b('0x17')]));});});};exports[_0x652b('0x24')]=function(_0x24d70e){var _0x48b4d8=this;return new Promise(function(_0x38a5ab,_0x14112b){return db[_0x652b('0x25')][_0x652b('0x26')]({'raw':_0x24d70e['options']?_0x24d70e[_0x652b('0x1c')][_0x652b('0x1d')]===undefined?!![]:![]:!![],'where':_0x24d70e[_0x652b('0x1c')]?_0x24d70e[_0x652b('0x1c')]['where']||null:null,'attributes':_0x24d70e['options']?_0x24d70e[_0x652b('0x1c')][_0x652b('0x21')]||null:null,'include':_0x24d70e[_0x652b('0x1c')]?_0x24d70e[_0x652b('0x1c')][_0x652b('0x20')]?_[_0x652b('0x1f')](_0x24d70e[_0x652b('0x1c')]['include'],function(_0x20f71d){return{'model':db[_0x20f71d['model']],'as':_0x20f71d['as'],'attributes':_0x20f71d[_0x652b('0x21')],'include':_0x20f71d[_0x652b('0x20')]?_[_0x652b('0x1f')](_0x20f71d[_0x652b('0x20')],function(_0x4d253f){return{'model':db[_0x4d253f['model']],'as':_0x4d253f['as'],'attributes':_0x4d253f[_0x652b('0x21')],'include':_0x4d253f[_0x652b('0x20')]?_[_0x652b('0x1f')](_0x4d253f[_0x652b('0x20')],function(_0x138239){return{'model':db[_0x138239[_0x652b('0x27')]],'as':_0x138239['as'],'attributes':_0x138239[_0x652b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x652b('0x22')](function(_0x5bb396){logger[_0x652b('0x18')]('ShowSmsQueue',_0x24d70e);logger['debug'](_0x652b('0x24'),_0x24d70e,JSON['stringify'](_0x5bb396));_0x38a5ab(_0x5bb396);})[_0x652b('0x23')](function(_0x3d3ec3){logger[_0x652b('0x15')](_0x652b('0x24'),_0x3d3ec3[_0x652b('0x17')],_0x24d70e);_0x14112b(_0x48b4d8['error'](0x1f4,_0x3d3ec3[_0x652b('0x17')]));});});}; \ No newline at end of file +var _0x552b=['message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','map','model','include','find','raw','ShowSmsQueue','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x395a03,_0x362943){var _0x8de6f=function(_0x56ae29){while(--_0x56ae29){_0x395a03['push'](_0x395a03['shift']());}};_0x8de6f(++_0x362943);}(_0x552b,0xf9));var _0xb552=function(_0x4c3ff4,_0x5f0e80){_0x4c3ff4=_0x4c3ff4-0x0;var _0x4bc29e=_0x552b[_0x4c3ff4];return _0x4bc29e;};'use strict';var _=require(_0xb552('0x0'));var util=require(_0xb552('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb552('0x2'));var fs=require('fs');var Redis=require(_0xb552('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb552('0x4'));var logger=require(_0xb552('0x5'))(_0xb552('0x6'));var config=require(_0xb552('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb552('0x8')][_0xb552('0x9')]({'port':0x232a});config[_0xb552('0xa')]=_['defaults'](config[_0xb552('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb552('0xb'))(new Redis(config[_0xb552('0xa')]));require(_0xb552('0xc'))[_0xb552('0xd')](socket);function respondWithRpcPromise(_0x107438,_0x9a502,_0x5222e5){return new BPromise(function(_0x480d73,_0x5727e9){return client[_0xb552('0xe')](_0x107438,_0x5222e5)[_0xb552('0xf')](function(_0x216372){logger[_0xb552('0x10')](_0xb552('0x11'),_0x9a502,_0xb552('0x12'));logger[_0xb552('0x13')](_0xb552('0x14'),_0x9a502,_0xb552('0x12'),JSON[_0xb552('0x15')](_0x216372));if(_0x216372[_0xb552('0x16')]){if(_0x216372['error'][_0xb552('0x17')]===0x1f4){logger[_0xb552('0x16')](_0xb552('0x11'),_0x9a502,_0x216372['error'][_0xb552('0x18')]);return _0x5727e9(_0x216372[_0xb552('0x16')][_0xb552('0x18')]);}logger['error'](_0xb552('0x11'),_0x9a502,_0x216372[_0xb552('0x16')][_0xb552('0x18')]);return _0x480d73(_0x216372['error'][_0xb552('0x18')]);}else{logger[_0xb552('0x10')]('SmsQueue,\x20%s,\x20%s',_0x9a502,_0xb552('0x12'));_0x480d73(_0x216372[_0xb552('0x19')]['message']);}})[_0xb552('0x1a')](function(_0x4187f3){logger['error'](_0xb552('0x11'),_0x9a502,_0x4187f3);_0x5727e9(_0x4187f3);});});}exports[_0xb552('0x1b')]=function(_0x24ec8d){var _0x24e9a8=this;return new Promise(function(_0x1a3de,_0x488b0f){return db[_0xb552('0x1c')][_0xb552('0x1d')]({'raw':_0x24ec8d['options']?_0x24ec8d[_0xb552('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x24ec8d[_0xb552('0x1e')]?_0x24ec8d[_0xb552('0x1e')][_0xb552('0x1f')]||null:null,'attributes':_0x24ec8d[_0xb552('0x1e')]?_0x24ec8d[_0xb552('0x1e')][_0xb552('0x20')]||null:null,'limit':_0x24ec8d['options']?_0x24ec8d['options']['limit']||null:null,'include':_0x24ec8d[_0xb552('0x1e')]?_0x24ec8d[_0xb552('0x1e')]['include']?_[_0xb552('0x21')](_0x24ec8d[_0xb552('0x1e')]['include'],function(_0xabf079){return{'model':db[_0xabf079[_0xb552('0x22')]],'as':_0xabf079['as'],'attributes':_0xabf079['attributes'],'include':_0xabf079['include']?_[_0xb552('0x21')](_0xabf079[_0xb552('0x23')],function(_0x8643d1){return{'model':db[_0x8643d1['model']],'as':_0x8643d1['as'],'attributes':_0x8643d1[_0xb552('0x20')],'include':_0x8643d1[_0xb552('0x23')]?_[_0xb552('0x21')](_0x8643d1[_0xb552('0x23')],function(_0x5a6b94){return{'model':db[_0x5a6b94[_0xb552('0x22')]],'as':_0x5a6b94['as'],'attributes':_0x5a6b94[_0xb552('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c84ad){logger[_0xb552('0x10')](_0xb552('0x1b'),_0x24ec8d);logger[_0xb552('0x13')](_0xb552('0x1b'),_0x24ec8d,JSON[_0xb552('0x15')](_0x2c84ad));_0x1a3de(_0x2c84ad);})[_0xb552('0x1a')](function(_0x58df98){logger['error']('GetSmsQueue',_0x58df98['message'],_0x24ec8d);_0x488b0f(_0x24e9a8[_0xb552('0x16')](0x1f4,_0x58df98[_0xb552('0x18')]));});});};exports['ShowSmsQueue']=function(_0x175ff7){var _0x17471a=this;return new Promise(function(_0x160840,_0x2ae908){return db[_0xb552('0x1c')][_0xb552('0x24')]({'raw':_0x175ff7[_0xb552('0x1e')]?_0x175ff7[_0xb552('0x1e')][_0xb552('0x25')]===undefined?!![]:![]:!![],'where':_0x175ff7[_0xb552('0x1e')]?_0x175ff7[_0xb552('0x1e')][_0xb552('0x1f')]||null:null,'attributes':_0x175ff7['options']?_0x175ff7[_0xb552('0x1e')][_0xb552('0x20')]||null:null,'include':_0x175ff7[_0xb552('0x1e')]?_0x175ff7[_0xb552('0x1e')]['include']?_[_0xb552('0x21')](_0x175ff7['options'][_0xb552('0x23')],function(_0x31d9da){return{'model':db[_0x31d9da[_0xb552('0x22')]],'as':_0x31d9da['as'],'attributes':_0x31d9da[_0xb552('0x20')],'include':_0x31d9da[_0xb552('0x23')]?_[_0xb552('0x21')](_0x31d9da[_0xb552('0x23')],function(_0x2d107f){return{'model':db[_0x2d107f[_0xb552('0x22')]],'as':_0x2d107f['as'],'attributes':_0x2d107f[_0xb552('0x20')],'include':_0x2d107f[_0xb552('0x23')]?_['map'](_0x2d107f[_0xb552('0x23')],function(_0x525b8b){return{'model':db[_0x525b8b[_0xb552('0x22')]],'as':_0x525b8b['as'],'attributes':_0x525b8b['attributes']};}):[]};}):[]};}):[]:[]})[_0xb552('0xf')](function(_0x2902f3){logger[_0xb552('0x10')](_0xb552('0x26'),_0x175ff7);logger[_0xb552('0x13')](_0xb552('0x26'),_0x175ff7,JSON[_0xb552('0x15')](_0x2902f3));_0x160840(_0x2902f3);})[_0xb552('0x1a')](function(_0x1e1c00){logger['error'](_0xb552('0x26'),_0x1e1c00[_0xb552('0x18')],_0x175ff7);_0x2ae908(_0x17471a[_0xb552('0x16')](0x1f4,_0x1e1c00[_0xb552('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fc45f1c..8cf63b5 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 _0xdb44=['./smsQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5dfa4f,_0x3f8e0e){var _0x599c22=function(_0x3f022e){while(--_0x3f022e){_0x5dfa4f['push'](_0x5dfa4f['shift']());}};_0x599c22(++_0x3f8e0e);}(_0xdb44,0x140));var _0x4db4=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xdb44[_0x1ccdf7];return _0x52a0ae;};'use strict';var SmsQueueEvents=require(_0x4db4('0x0'));var events=[_0x4db4('0x1'),_0x4db4('0x2'),_0x4db4('0x3')];function createListener(_0x12209b,_0x40dba2){return function(_0x522c1e){_0x40dba2[_0x4db4('0x4')](_0x12209b,_0x522c1e);};}function removeListener(_0x3e66e4,_0x3e75db){return function(){SmsQueueEvents[_0x4db4('0x5')](_0x3e66e4,_0x3e75db);};}exports[_0x4db4('0x6')]=function(_0x2cf73b){for(var _0x363924=0x0,_0x17d1bb=events[_0x4db4('0x7')];_0x363924<_0x17d1bb;_0x363924++){var _0x5f32d1=events[_0x363924];var _0x27f678=createListener('smsQueue:'+_0x5f32d1,_0x2cf73b);SmsQueueEvents['on'](_0x5f32d1,_0x27f678);}}; \ No newline at end of file +var _0x69c8=['save','remove','update','emit','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x3ebce5,_0x54d504){var _0x5d1de4=function(_0x2709bc){while(--_0x2709bc){_0x3ebce5['push'](_0x3ebce5['shift']());}};_0x5d1de4(++_0x54d504);}(_0x69c8,0x147));var _0x869c=function(_0x409582,_0x1f0415){_0x409582=_0x409582-0x0;var _0xc9369d=_0x69c8[_0x409582];return _0xc9369d;};'use strict';var SmsQueueEvents=require(_0x869c('0x0'));var events=[_0x869c('0x1'),_0x869c('0x2'),_0x869c('0x3')];function createListener(_0x5cbdc9,_0x47f04a){return function(_0x50a865){_0x47f04a[_0x869c('0x4')](_0x5cbdc9,_0x50a865);};}function removeListener(_0x57c209,_0x4b0862){return function(){SmsQueueEvents[_0x869c('0x5')](_0x57c209,_0x4b0862);};}exports['register']=function(_0xeb4d1b){for(var _0x23ee3b=0x0,_0x35b034=events[_0x869c('0x6')];_0x23ee3b<_0x35b034;_0x23ee3b++){var _0x393b36=events[_0x23ee3b];var _0x4a7402=createListener(_0x869c('0x7')+_0x393b36,_0xeb4d1b);SmsQueueEvents['on'](_0x393b36,_0x4a7402);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a3ac2ab..2041566 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 _0x7dee=['put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x4a5137,_0xce6f6a){var _0x2749f4=function(_0x594bf4){while(--_0x594bf4){_0x4a5137['push'](_0x4a5137['shift']());}};_0x2749f4(++_0xce6f6a);}(_0x7dee,0xb0));var _0xe7de=function(_0x3d7d6e,_0x4c6560){_0x3d7d6e=_0x3d7d6e-0x0;var _0x1e4550=_0x7dee[_0x3d7d6e];return _0x1e4550;};'use strict';var multer=require(_0xe7de('0x0'));var util=require('util');var path=require(_0xe7de('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7de('0x2'));var router=express[_0xe7de('0x3')]();var fs_extra=require(_0xe7de('0x4'));var auth=require(_0xe7de('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe7de('0x6'));var controller=require('./smsQueueReport.controller');router[_0xe7de('0x7')]('/',auth[_0xe7de('0x8')](),controller[_0xe7de('0x9')]);router[_0xe7de('0x7')](_0xe7de('0xa'),auth[_0xe7de('0x8')](),controller['describe']);router[_0xe7de('0x7')](_0xe7de('0xb'),auth[_0xe7de('0x8')](),controller[_0xe7de('0xc')]);router['post']('/',auth[_0xe7de('0x8')](),controller[_0xe7de('0xd')]);router[_0xe7de('0xe')](_0xe7de('0xb'),auth[_0xe7de('0x8')](),controller[_0xe7de('0xf')]);router[_0xe7de('0x10')]('/:id',auth[_0xe7de('0x8')](),controller[_0xe7de('0x11')]);module[_0xe7de('0x12')]=router; \ No newline at end of file +var _0x9789=['create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9789,0x1bc));var _0x9978=function(_0x23c991,_0x566312){_0x23c991=_0x23c991-0x0;var _0x323d32=_0x9789[_0x23c991];return _0x323d32;};'use strict';var multer=require(_0x9978('0x0'));var util=require(_0x9978('0x1'));var path=require(_0x9978('0x2'));var timeout=require(_0x9978('0x3'));var express=require(_0x9978('0x4'));var router=express[_0x9978('0x5')]();var fs_extra=require(_0x9978('0x6'));var auth=require(_0x9978('0x7'));var interaction=require(_0x9978('0x8'));var config=require(_0x9978('0x9'));var controller=require(_0x9978('0xa'));router[_0x9978('0xb')]('/',auth[_0x9978('0xc')](),controller[_0x9978('0xd')]);router[_0x9978('0xb')](_0x9978('0xe'),auth[_0x9978('0xc')](),controller[_0x9978('0xf')]);router[_0x9978('0xb')](_0x9978('0x10'),auth[_0x9978('0xc')](),controller['show']);router[_0x9978('0x11')]('/',auth['isAuthenticated'](),controller[_0x9978('0x12')]);router['put'](_0x9978('0x10'),auth[_0x9978('0xc')](),controller[_0x9978('0x13')]);router['delete'](_0x9978('0x10'),auth['isAuthenticated'](),controller[_0x9978('0x14')]);module[_0x9978('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index f629bce..24b2470 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 _0xb293=['sequelize','exports','STRING','DATE','moment'];(function(_0x16828e,_0x3f5fb0){var _0x3a6bb1=function(_0x5f3dcd){while(--_0x5f3dcd){_0x16828e['push'](_0x16828e['shift']());}};_0x3a6bb1(++_0x3f5fb0);}(_0xb293,0x77));var _0x3b29=function(_0x2b8a31,_0x4457a4){_0x2b8a31=_0x2b8a31-0x0;var _0x117ee4=_0xb293[_0x2b8a31];return _0x117ee4;};'use strict';var moment=require(_0x3b29('0x0'));var Sequelize=require(_0x3b29('0x1'));module[_0x3b29('0x2')]={'uniqueid':{'type':Sequelize[_0x3b29('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3b29('0x3')]},'joinAt':{'type':Sequelize[_0x3b29('0x4')]},'leaveAt':{'type':Sequelize[_0x3b29('0x4')]},'acceptAt':{'type':Sequelize[_0x3b29('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3b29('0x3')]}}; \ No newline at end of file +var _0x687d=['DATE','sequelize','exports','STRING'];(function(_0x2dfc49,_0x16d7a3){var _0x1324e3=function(_0x14292c){while(--_0x14292c){_0x2dfc49['push'](_0x2dfc49['shift']());}};_0x1324e3(++_0x16d7a3);}(_0x687d,0x191));var _0xd687=function(_0x1cbff5,_0x4d5c69){_0x1cbff5=_0x1cbff5-0x0;var _0x5fcda9=_0x687d[_0x1cbff5];return _0x5fcda9;};'use strict';var moment=require('moment');var Sequelize=require(_0xd687('0x0'));module[_0xd687('0x1')]={'uniqueid':{'type':Sequelize[_0xd687('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd687('0x2')]},'joinAt':{'type':Sequelize[_0xd687('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd687('0x3')]},'exitAt':{'type':Sequelize[_0xd687('0x3')]},'reason':{'type':Sequelize[_0xd687('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 07068c2..57fa34d 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 _0x3faf=['find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','then','destroy','stack','name','send','index','map','rawAttributes','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','SmsQueueReport','includeAll','rows','catch','show'];(function(_0x1e3a73,_0x41abb5){var _0x4fad5d=function(_0x2e17f2){while(--_0x2e17f2){_0x1e3a73['push'](_0x1e3a73['shift']());}};_0x4fad5d(++_0x41abb5);}(_0x3faf,0xe4));var _0xf3fa=function(_0x34a20c,_0x14a54f){_0x34a20c=_0x34a20c-0x0;var _0x2e33e4=_0x3faf[_0x34a20c];return _0x2e33e4;};'use strict';var emlformat=require(_0xf3fa('0x0'));var rimraf=require(_0xf3fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3fa('0x2'));var rp=require(_0xf3fa('0x3'));var moment=require(_0xf3fa('0x4'));var BPromise=require(_0xf3fa('0x5'));var Mustache=require(_0xf3fa('0x6'));var util=require('util');var path=require(_0xf3fa('0x7'));var sox=require(_0xf3fa('0x8'));var csv=require(_0xf3fa('0x9'));var ejs=require(_0xf3fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3fa('0xb'));var squel=require('squel');var crypto=require(_0xf3fa('0xc'));var jsforce=require(_0xf3fa('0xd'));var deskjs=require(_0xf3fa('0xe'));var toCsv=require(_0xf3fa('0x9'));var querystring=require(_0xf3fa('0xf'));var Papa=require(_0xf3fa('0x10'));var Redis=require(_0xf3fa('0x11'));var authService=require(_0xf3fa('0x12'));var qs=require(_0xf3fa('0x13'));var as=require(_0xf3fa('0x14'));var hardwareService=require(_0xf3fa('0x15'));var logger=require(_0xf3fa('0x16'))(_0xf3fa('0x17'));var utils=require(_0xf3fa('0x18'));var config=require(_0xf3fa('0x19'));var licenseUtil=require(_0xf3fa('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f19d2,_0x2d0b80){_0x2d0b80=_0x2d0b80||0xcc;return function(_0x583c13){if(_0x583c13){return _0x2f19d2[_0xf3fa('0x1b')](_0x2d0b80);}return _0x2f19d2[_0xf3fa('0x1c')](_0x2d0b80)[_0xf3fa('0x1d')]();};}function respondWithResult(_0x4b6d95,_0x1c05c8){_0x1c05c8=_0x1c05c8||0xc8;return function(_0x1334f0){if(_0x1334f0){return _0x4b6d95[_0xf3fa('0x1c')](_0x1c05c8)[_0xf3fa('0x1e')](_0x1334f0);}};}function respondWithFilteredResult(_0x5975b0,_0x45ff1c){return function(_0xfafa2){if(_0xfafa2){var _0x246018=typeof _0x45ff1c[_0xf3fa('0x1f')]==='undefined'&&typeof _0x45ff1c[_0xf3fa('0x20')]===_0xf3fa('0x21');var _0x127c7b=_0xfafa2[_0xf3fa('0x22')];var _0x21ee4c=_0x246018?0x0:_0x45ff1c[_0xf3fa('0x1f')];var _0x3ea093=_0x246018?_0xfafa2[_0xf3fa('0x22')]:_0x45ff1c[_0xf3fa('0x1f')]+_0x45ff1c['limit'];var _0x38b1ab;if(_0x3ea093>=_0x127c7b){_0x3ea093=_0x127c7b;_0x38b1ab=0xc8;}else{_0x38b1ab=0xce;}_0x5975b0[_0xf3fa('0x1c')](_0x38b1ab);return _0x5975b0[_0xf3fa('0x23')]('Content-Range',_0x21ee4c+'-'+_0x3ea093+'/'+_0x127c7b)[_0xf3fa('0x1e')](_0xfafa2);}return null;};}function patchUpdates(_0x468d7e){return function(_0xa3f929){try{jsonpatch[_0xf3fa('0x24')](_0xa3f929,_0x468d7e,!![]);}catch(_0x4c7085){return BPromise['reject'](_0x4c7085);}return _0xa3f929['save']();};}function saveUpdates(_0x20ff69,_0x2ba2fd){return function(_0x4e966b){if(_0x4e966b){return _0x4e966b['update'](_0x20ff69)[_0xf3fa('0x25')](function(_0x895dd1){return _0x895dd1;});}return null;};}function removeEntity(_0xce80ef,_0x3b6df7){return function(_0x3d5db7){if(_0x3d5db7){return _0x3d5db7[_0xf3fa('0x26')]()[_0xf3fa('0x25')](function(){_0xce80ef[_0xf3fa('0x1c')](0xcc)[_0xf3fa('0x1d')]();});}};}function handleEntityNotFound(_0x29e2fe,_0x27d500){return function(_0x410fe5){if(!_0x410fe5){_0x29e2fe[_0xf3fa('0x1b')](0x194);}return _0x410fe5;};}function handleError(_0x9e6a21,_0x241bf5){_0x241bf5=_0x241bf5||0x1f4;return function(_0x199c93){logger['error'](_0x199c93[_0xf3fa('0x27')]);if(_0x199c93[_0xf3fa('0x28')]){delete _0x199c93[_0xf3fa('0x28')];}_0x9e6a21[_0xf3fa('0x1c')](_0x241bf5)[_0xf3fa('0x29')](_0x199c93);};}exports[_0xf3fa('0x2a')]=function(_0x492a92,_0x99598d){var _0x5980c5={},_0x246ca7={},_0x2c9482={'count':0x0,'rows':[]};var _0x43ce41=_[_0xf3fa('0x2b')](db['SmsQueueReport'][_0xf3fa('0x2c')],function(_0x1ff5b2){return{'name':_0x1ff5b2['fieldName'],'type':_0x1ff5b2['type'][_0xf3fa('0x2d')]};});_0x246ca7['model']=_[_0xf3fa('0x2b')](_0x43ce41,_0xf3fa('0x28'));_0x246ca7['query']=_[_0xf3fa('0x2e')](_0x492a92[_0xf3fa('0x2f')]);_0x246ca7[_0xf3fa('0x30')]=_['intersection'](_0x246ca7['model'],_0x246ca7['query']);_0x5980c5['attributes']=_[_0xf3fa('0x31')](_0x246ca7[_0xf3fa('0x32')],qs[_0xf3fa('0x33')](_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x33')]));_0x5980c5[_0xf3fa('0x34')]=_0x5980c5[_0xf3fa('0x34')][_0xf3fa('0x35')]?_0x5980c5['attributes']:_0x246ca7[_0xf3fa('0x32')];if(!_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x36')](_0xf3fa('0x37'))){_0x5980c5['limit']=qs[_0xf3fa('0x20')](_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x20')]);_0x5980c5[_0xf3fa('0x1f')]=qs['offset'](_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x1f')]);}_0x5980c5['order']=qs[_0xf3fa('0x38')](_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x38')]);_0x5980c5[_0xf3fa('0x39')]=qs[_0xf3fa('0x30')](_[_0xf3fa('0x3a')](_0x492a92[_0xf3fa('0x2f')],_0x246ca7[_0xf3fa('0x30')]),_0x43ce41);if(_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x3b')]){_0x5980c5['where']=_[_0xf3fa('0x3c')](_0x5980c5[_0xf3fa('0x39')],{'$or':_[_0xf3fa('0x2b')](_0x43ce41,function(_0x588681){if(_0x588681[_0xf3fa('0x3d')]!=='VIRTUAL'){var _0x54b1c8={};_0x54b1c8[_0x588681['name']]={'$like':'%'+_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x3b')]+'%'};return _0x54b1c8;}})});}_0x5980c5=_[_0xf3fa('0x3c')]({},_0x5980c5,_0x492a92[_0xf3fa('0x3e')]);var _0x336786={'where':_0x5980c5[_0xf3fa('0x39')]};return db[_0xf3fa('0x3f')][_0xf3fa('0x22')](_0x336786)[_0xf3fa('0x25')](function(_0x29ee3b){_0x2c9482[_0xf3fa('0x22')]=_0x29ee3b;if(_0x492a92[_0xf3fa('0x2f')][_0xf3fa('0x40')]){_0x5980c5['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x5980c5);})[_0xf3fa('0x25')](function(_0x2a99bc){_0x2c9482[_0xf3fa('0x41')]=_0x2a99bc;return _0x2c9482;})[_0xf3fa('0x25')](respondWithFilteredResult(_0x99598d,_0x5980c5))[_0xf3fa('0x42')](handleError(_0x99598d,null));};exports[_0xf3fa('0x43')]=function(_0x2a1f9a,_0x1f54fd){var _0x850f0={'raw':!![],'where':{'id':_0x2a1f9a['params']['id']}},_0x580fac={};_0x580fac['model']=_[_0xf3fa('0x2e')](db[_0xf3fa('0x3f')][_0xf3fa('0x2c')]);_0x580fac[_0xf3fa('0x2f')]=_[_0xf3fa('0x2e')](_0x2a1f9a[_0xf3fa('0x2f')]);_0x580fac[_0xf3fa('0x30')]=_[_0xf3fa('0x31')](_0x580fac[_0xf3fa('0x32')],_0x580fac[_0xf3fa('0x2f')]);_0x850f0[_0xf3fa('0x34')]=_[_0xf3fa('0x31')](_0x580fac['model'],qs['fields'](_0x2a1f9a[_0xf3fa('0x2f')][_0xf3fa('0x33')]));_0x850f0[_0xf3fa('0x34')]=_0x850f0[_0xf3fa('0x34')][_0xf3fa('0x35')]?_0x850f0[_0xf3fa('0x34')]:_0x580fac[_0xf3fa('0x32')];if(_0x2a1f9a[_0xf3fa('0x2f')][_0xf3fa('0x40')]){_0x850f0['include']=[{'all':!![]}];}_0x850f0=_[_0xf3fa('0x3c')]({},_0x850f0,_0x2a1f9a['options']);return db[_0xf3fa('0x3f')][_0xf3fa('0x44')](_0x850f0)[_0xf3fa('0x25')](handleEntityNotFound(_0x1f54fd,null))[_0xf3fa('0x25')](respondWithResult(_0x1f54fd,null))[_0xf3fa('0x42')](handleError(_0x1f54fd,null));};exports[_0xf3fa('0x45')]=function(_0x423213,_0x222569){return db[_0xf3fa('0x3f')][_0xf3fa('0x45')](_0x423213[_0xf3fa('0x46')],{})['then'](respondWithResult(_0x222569,0xc9))[_0xf3fa('0x42')](handleError(_0x222569,null));};exports[_0xf3fa('0x47')]=function(_0x34f7f0,_0x530301){if(_0x34f7f0['body']['id']){delete _0x34f7f0['body']['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x34f7f0['params']['id']}})[_0xf3fa('0x25')](handleEntityNotFound(_0x530301,null))[_0xf3fa('0x25')](saveUpdates(_0x34f7f0[_0xf3fa('0x46')],null))['then'](respondWithResult(_0x530301,null))[_0xf3fa('0x42')](handleError(_0x530301,null));};exports[_0xf3fa('0x26')]=function(_0x187e00,_0x3bb2e1){return db['SmsQueueReport'][_0xf3fa('0x44')]({'where':{'id':_0x187e00[_0xf3fa('0x48')]['id']}})[_0xf3fa('0x25')](handleEntityNotFound(_0x3bb2e1,null))['then'](removeEntity(_0x3bb2e1,null))[_0xf3fa('0x42')](handleError(_0x3bb2e1,null));};exports['describe']=function(_0x1130ee,_0x22c1b2){return db['SmsQueueReport'][_0xf3fa('0x49')]()[_0xf3fa('0x25')](respondWithResult(_0x22c1b2,null))[_0xf3fa('0x42')](handleError(_0x22c1b2,null));}; \ No newline at end of file +var _0x10b4=['crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','includeAll','include','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x10b4,0xd1));var _0x410b=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x10b4[_0x454165];return _0x56db53;};'use strict';var emlformat=require(_0x410b('0x0'));var rimraf=require(_0x410b('0x1'));var zipdir=require(_0x410b('0x2'));var jsonpatch=require(_0x410b('0x3'));var rp=require(_0x410b('0x4'));var moment=require(_0x410b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x410b('0x6'));var path=require(_0x410b('0x7'));var sox=require(_0x410b('0x8'));var csv=require('to-csv');var ejs=require(_0x410b('0x9'));var fs=require('fs');var fs_extra=require(_0x410b('0xa'));var _=require(_0x410b('0xb'));var squel=require(_0x410b('0xc'));var crypto=require(_0x410b('0xd'));var jsforce=require(_0x410b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x410b('0xf'));var querystring=require(_0x410b('0x10'));var Papa=require(_0x410b('0x11'));var Redis=require('ioredis');var authService=require(_0x410b('0x12'));var qs=require(_0x410b('0x13'));var as=require(_0x410b('0x14'));var hardwareService=require(_0x410b('0x15'));var logger=require('../../config/logger')(_0x410b('0x16'));var utils=require('../../config/utils');var config=require(_0x410b('0x17'));var licenseUtil=require(_0x410b('0x18'));var db=require(_0x410b('0x19'))['db'];function respondWithStatusCode(_0x30418e,_0x5993ce){_0x5993ce=_0x5993ce||0xcc;return function(_0x1107de){if(_0x1107de){return _0x30418e['sendStatus'](_0x5993ce);}return _0x30418e[_0x410b('0x1a')](_0x5993ce)[_0x410b('0x1b')]();};}function respondWithResult(_0x268ae4,_0x3a5879){_0x3a5879=_0x3a5879||0xc8;return function(_0x41a793){if(_0x41a793){return _0x268ae4[_0x410b('0x1a')](_0x3a5879)[_0x410b('0x1c')](_0x41a793);}};}function respondWithFilteredResult(_0x4ecfb1,_0x39b34e){return function(_0x3e31ea){if(_0x3e31ea){var _0x2f82fa=typeof _0x39b34e[_0x410b('0x1d')]===_0x410b('0x1e')&&typeof _0x39b34e[_0x410b('0x1f')]===_0x410b('0x1e');var _0x28db41=_0x3e31ea[_0x410b('0x20')];var _0x72c556=_0x2f82fa?0x0:_0x39b34e[_0x410b('0x1d')];var _0x20dc75=_0x2f82fa?_0x3e31ea['count']:_0x39b34e[_0x410b('0x1d')]+_0x39b34e['limit'];var _0x41c2c4;if(_0x20dc75>=_0x28db41){_0x20dc75=_0x28db41;_0x41c2c4=0xc8;}else{_0x41c2c4=0xce;}_0x4ecfb1[_0x410b('0x1a')](_0x41c2c4);return _0x4ecfb1[_0x410b('0x21')]('Content-Range',_0x72c556+'-'+_0x20dc75+'/'+_0x28db41)['json'](_0x3e31ea);}return null;};}function patchUpdates(_0x394120){return function(_0x491499){try{jsonpatch['apply'](_0x491499,_0x394120,!![]);}catch(_0x244649){return BPromise[_0x410b('0x22')](_0x244649);}return _0x491499['save']();};}function saveUpdates(_0x23b2b2,_0x5e3f6a){return function(_0x417eb4){if(_0x417eb4){return _0x417eb4[_0x410b('0x23')](_0x23b2b2)[_0x410b('0x24')](function(_0x192369){return _0x192369;});}return null;};}function removeEntity(_0x4d77e7,_0x5447f1){return function(_0x15a69f){if(_0x15a69f){return _0x15a69f[_0x410b('0x25')]()['then'](function(){_0x4d77e7[_0x410b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d38e7,_0x14f6f0){return function(_0x4bef31){if(!_0x4bef31){_0x3d38e7[_0x410b('0x26')](0x194);}return _0x4bef31;};}function handleError(_0x41e26b,_0x328cc8){_0x328cc8=_0x328cc8||0x1f4;return function(_0x26649c){logger[_0x410b('0x27')](_0x26649c[_0x410b('0x28')]);if(_0x26649c[_0x410b('0x29')]){delete _0x26649c['name'];}_0x41e26b[_0x410b('0x1a')](_0x328cc8)[_0x410b('0x2a')](_0x26649c);};}exports[_0x410b('0x2b')]=function(_0x148fbc,_0x433114){var _0x3da39a={},_0x53a0d0={},_0x2a03e1={'count':0x0,'rows':[]};var _0x45dd7e=_[_0x410b('0x2c')](db[_0x410b('0x2d')][_0x410b('0x2e')],function(_0x233a64){return{'name':_0x233a64[_0x410b('0x2f')],'type':_0x233a64['type'][_0x410b('0x30')]};});_0x53a0d0['model']=_[_0x410b('0x2c')](_0x45dd7e,_0x410b('0x29'));_0x53a0d0[_0x410b('0x31')]=_[_0x410b('0x32')](_0x148fbc[_0x410b('0x31')]);_0x53a0d0['filters']=_['intersection'](_0x53a0d0[_0x410b('0x33')],_0x53a0d0[_0x410b('0x31')]);_0x3da39a[_0x410b('0x34')]=_[_0x410b('0x35')](_0x53a0d0[_0x410b('0x33')],qs[_0x410b('0x36')](_0x148fbc[_0x410b('0x31')][_0x410b('0x36')]));_0x3da39a['attributes']=_0x3da39a['attributes']['length']?_0x3da39a[_0x410b('0x34')]:_0x53a0d0[_0x410b('0x33')];if(!_0x148fbc['query'][_0x410b('0x37')](_0x410b('0x38'))){_0x3da39a['limit']=qs[_0x410b('0x1f')](_0x148fbc[_0x410b('0x31')]['limit']);_0x3da39a['offset']=qs[_0x410b('0x1d')](_0x148fbc[_0x410b('0x31')][_0x410b('0x1d')]);}_0x3da39a[_0x410b('0x39')]=qs[_0x410b('0x3a')](_0x148fbc[_0x410b('0x31')][_0x410b('0x3a')]);_0x3da39a[_0x410b('0x3b')]=qs['filters'](_['pick'](_0x148fbc[_0x410b('0x31')],_0x53a0d0[_0x410b('0x3c')]),_0x45dd7e);if(_0x148fbc['query'][_0x410b('0x3d')]){_0x3da39a[_0x410b('0x3b')]=_['merge'](_0x3da39a[_0x410b('0x3b')],{'$or':_[_0x410b('0x2c')](_0x45dd7e,function(_0x32fb57){if(_0x32fb57[_0x410b('0x3e')]!==_0x410b('0x3f')){var _0x590b74={};_0x590b74[_0x32fb57[_0x410b('0x29')]]={'$like':'%'+_0x148fbc[_0x410b('0x31')]['filter']+'%'};return _0x590b74;}})});}_0x3da39a=_[_0x410b('0x40')]({},_0x3da39a,_0x148fbc['options']);var _0x3aaf16={'where':_0x3da39a[_0x410b('0x3b')]};return db[_0x410b('0x2d')][_0x410b('0x20')](_0x3aaf16)[_0x410b('0x24')](function(_0x512b4b){_0x2a03e1['count']=_0x512b4b;if(_0x148fbc[_0x410b('0x31')][_0x410b('0x41')]){_0x3da39a[_0x410b('0x42')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x3da39a);})[_0x410b('0x24')](function(_0x2ceafd){_0x2a03e1[_0x410b('0x43')]=_0x2ceafd;return _0x2a03e1;})[_0x410b('0x24')](respondWithFilteredResult(_0x433114,_0x3da39a))['catch'](handleError(_0x433114,null));};exports['show']=function(_0x4d013a,_0x55b801){var _0x10db9b={'raw':!![],'where':{'id':_0x4d013a[_0x410b('0x44')]['id']}},_0x5607c8={};_0x5607c8['model']=_[_0x410b('0x32')](db['SmsQueueReport'][_0x410b('0x2e')]);_0x5607c8['query']=_[_0x410b('0x32')](_0x4d013a['query']);_0x5607c8[_0x410b('0x3c')]=_['intersection'](_0x5607c8[_0x410b('0x33')],_0x5607c8['query']);_0x10db9b['attributes']=_[_0x410b('0x35')](_0x5607c8[_0x410b('0x33')],qs[_0x410b('0x36')](_0x4d013a[_0x410b('0x31')]['fields']));_0x10db9b[_0x410b('0x34')]=_0x10db9b[_0x410b('0x34')]['length']?_0x10db9b[_0x410b('0x34')]:_0x5607c8[_0x410b('0x33')];if(_0x4d013a[_0x410b('0x31')][_0x410b('0x41')]){_0x10db9b[_0x410b('0x42')]=[{'all':!![]}];}_0x10db9b=_[_0x410b('0x40')]({},_0x10db9b,_0x4d013a['options']);return db[_0x410b('0x2d')][_0x410b('0x45')](_0x10db9b)['then'](handleEntityNotFound(_0x55b801,null))['then'](respondWithResult(_0x55b801,null))[_0x410b('0x46')](handleError(_0x55b801,null));};exports['create']=function(_0x1cae7c,_0x366e5b){return db['SmsQueueReport'][_0x410b('0x47')](_0x1cae7c[_0x410b('0x48')],{})[_0x410b('0x24')](respondWithResult(_0x366e5b,0xc9))[_0x410b('0x46')](handleError(_0x366e5b,null));};exports[_0x410b('0x23')]=function(_0x134268,_0x52c180){if(_0x134268[_0x410b('0x48')]['id']){delete _0x134268['body']['id'];}return db[_0x410b('0x2d')]['find']({'where':{'id':_0x134268[_0x410b('0x44')]['id']}})[_0x410b('0x24')](handleEntityNotFound(_0x52c180,null))[_0x410b('0x24')](saveUpdates(_0x134268[_0x410b('0x48')],null))[_0x410b('0x24')](respondWithResult(_0x52c180,null))['catch'](handleError(_0x52c180,null));};exports[_0x410b('0x25')]=function(_0x51259a,_0x24fd9f){return db[_0x410b('0x2d')][_0x410b('0x45')]({'where':{'id':_0x51259a[_0x410b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24fd9f,null))[_0x410b('0x24')](removeEntity(_0x24fd9f,null))[_0x410b('0x46')](handleError(_0x24fd9f,null));};exports[_0x410b('0x49')]=function(_0x4bb9d4,_0xda926a){return db[_0x410b('0x2d')][_0x410b('0x49')]()['then'](respondWithResult(_0xda926a,null))[_0x410b('0x46')](handleError(_0xda926a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 45c1d95..cc22b6c 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x4f4dd5,_0x5a57c0){var _0x84817a=function(_0x2d4174){while(--_0x2d4174){_0x4f4dd5['push'](_0x4f4dd5['shift']());}};_0x84817a(++_0x5a57c0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xb7e7[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ffbc377..f759d96 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 _0x8036=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','CreateSmsQueueReport','SmsQueueReport','create','options','stringify','update','body','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','bluebird'];(function(_0x186188,_0x15eb11){var _0x4ce4cc=function(_0x2d7931){while(--_0x2d7931){_0x186188['push'](_0x186188['shift']());}};_0x4ce4cc(++_0x15eb11);}(_0x8036,0xc2));var _0x6803=function(_0x431d3f,_0x50548c){_0x431d3f=_0x431d3f-0x0;var _0x1e15eb=_0x8036[_0x431d3f];return _0x1e15eb;};'use strict';var _=require(_0x6803('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6803('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6803('0x2'))['db'];var utils=require(_0x6803('0x3'));var logger=require(_0x6803('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6803('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x598d41,_0x53ea6e,_0x35b7fd){return new BPromise(function(_0x32ace1,_0x2cb500){return client['request'](_0x598d41,_0x35b7fd)[_0x6803('0x6')](function(_0x180da5){logger[_0x6803('0x7')](_0x6803('0x8'),_0x53ea6e,'request\x20sent');logger[_0x6803('0x9')](_0x6803('0xa'),_0x53ea6e,'request\x20sent',JSON['stringify'](_0x180da5));if(_0x180da5[_0x6803('0xb')]){if(_0x180da5[_0x6803('0xb')][_0x6803('0xc')]===0x1f4){logger[_0x6803('0xb')](_0x6803('0x8'),_0x53ea6e,_0x180da5[_0x6803('0xb')][_0x6803('0xd')]);return _0x2cb500(_0x180da5[_0x6803('0xb')]['message']);}logger[_0x6803('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x53ea6e,_0x180da5[_0x6803('0xb')][_0x6803('0xd')]);return _0x32ace1(_0x180da5[_0x6803('0xb')][_0x6803('0xd')]);}else{logger['info'](_0x6803('0x8'),_0x53ea6e,_0x6803('0xe'));_0x32ace1(_0x180da5['result']['message']);}})[_0x6803('0xf')](function(_0x6de535){logger[_0x6803('0xb')](_0x6803('0x8'),_0x53ea6e,_0x6de535);_0x2cb500(_0x6de535);});});}exports[_0x6803('0x10')]=function(_0x5d3e1a){var _0x29dfa8=this;return new Promise(function(_0x570cf3,_0x5b12b3){return db[_0x6803('0x11')][_0x6803('0x12')](_0x5d3e1a['body'],{'raw':_0x5d3e1a[_0x6803('0x13')]?_0x5d3e1a[_0x6803('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x6803('0x6')](function(_0x2b3455){logger[_0x6803('0x7')](_0x6803('0x10'),_0x5d3e1a);logger[_0x6803('0x9')](_0x6803('0x10'),_0x5d3e1a,JSON[_0x6803('0x14')](_0x2b3455));_0x570cf3(_0x2b3455);})[_0x6803('0xf')](function(_0x33768c){logger[_0x6803('0xb')](_0x6803('0x10'),_0x33768c[_0x6803('0xd')],_0x5d3e1a);_0x5b12b3(_0x29dfa8[_0x6803('0xb')](0x1f4,_0x33768c[_0x6803('0xd')]));});});};exports['UpdateSmsQueueReport']=function(_0xeecb){var _0x183f4e=this;return new Promise(function(_0x53adb8,_0x43e302){return db[_0x6803('0x11')][_0x6803('0x15')](_0xeecb[_0x6803('0x16')],{'raw':_0xeecb[_0x6803('0x13')]?_0xeecb[_0x6803('0x13')][_0x6803('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeecb['options']?_0xeecb[_0x6803('0x13')][_0x6803('0x18')]||null:null,'attributes':_0xeecb[_0x6803('0x13')]?_0xeecb[_0x6803('0x13')][_0x6803('0x19')]||null:null,'limit':_0xeecb[_0x6803('0x13')]?_0xeecb[_0x6803('0x13')][_0x6803('0x1a')]||null:null})[_0x6803('0x6')](function(_0xa7cf75){logger[_0x6803('0x7')](_0x6803('0x1b'),_0xeecb);logger[_0x6803('0x9')](_0x6803('0x1b'),_0xeecb,JSON[_0x6803('0x14')](_0xa7cf75));_0x53adb8(_0xa7cf75);})[_0x6803('0xf')](function(_0x3ec5c4){logger[_0x6803('0xb')](_0x6803('0x1b'),_0x3ec5c4[_0x6803('0xd')],_0xeecb);_0x43e302(_0x183f4e[_0x6803('0xb')](0x1f4,_0x3ec5c4[_0x6803('0xd')]));});});}; \ No newline at end of file +var _0x5ce7=['options','raw','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ce7,0x19f));var _0x75ce=function(_0xd2a568,_0x4e8606){_0xd2a568=_0xd2a568-0x0;var _0x4cf0ba=_0x5ce7[_0xd2a568];return _0x4cf0ba;};'use strict';var _=require('lodash');var util=require(_0x75ce('0x0'));var moment=require(_0x75ce('0x1'));var BPromise=require('bluebird');var rs=require(_0x75ce('0x2'));var fs=require('fs');var Redis=require(_0x75ce('0x3'));var db=require(_0x75ce('0x4'))['db'];var utils=require(_0x75ce('0x5'));var logger=require(_0x75ce('0x6'))(_0x75ce('0x7'));var config=require(_0x75ce('0x8'));var jayson=require(_0x75ce('0x9'));var client=jayson[_0x75ce('0xa')][_0x75ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35fbd7,_0x4b0003,_0x2a3951){return new BPromise(function(_0x29ef3f,_0x39dc64){return client['request'](_0x35fbd7,_0x2a3951)[_0x75ce('0xc')](function(_0x2dc952){logger[_0x75ce('0xd')](_0x75ce('0xe'),_0x4b0003,'request\x20sent');logger[_0x75ce('0xf')](_0x75ce('0x10'),_0x4b0003,_0x75ce('0x11'),JSON[_0x75ce('0x12')](_0x2dc952));if(_0x2dc952[_0x75ce('0x13')]){if(_0x2dc952['error'][_0x75ce('0x14')]===0x1f4){logger[_0x75ce('0x13')](_0x75ce('0xe'),_0x4b0003,_0x2dc952[_0x75ce('0x13')][_0x75ce('0x15')]);return _0x39dc64(_0x2dc952[_0x75ce('0x13')][_0x75ce('0x15')]);}logger[_0x75ce('0x13')](_0x75ce('0xe'),_0x4b0003,_0x2dc952[_0x75ce('0x13')][_0x75ce('0x15')]);return _0x29ef3f(_0x2dc952['error'][_0x75ce('0x15')]);}else{logger[_0x75ce('0xd')](_0x75ce('0xe'),_0x4b0003,_0x75ce('0x11'));_0x29ef3f(_0x2dc952[_0x75ce('0x16')][_0x75ce('0x15')]);}})[_0x75ce('0x17')](function(_0x3dc1b1){logger[_0x75ce('0x13')](_0x75ce('0xe'),_0x4b0003,_0x3dc1b1);_0x39dc64(_0x3dc1b1);});});}exports[_0x75ce('0x18')]=function(_0x41d375){var _0x3a4f0e=this;return new Promise(function(_0x377e4d,_0x5d1724){return db['SmsQueueReport'][_0x75ce('0x19')](_0x41d375[_0x75ce('0x1a')],{'raw':_0x41d375[_0x75ce('0x1b')]?_0x41d375['options'][_0x75ce('0x1c')]===undefined?!![]:![]:!![]})[_0x75ce('0xc')](function(_0x590995){logger['info'](_0x75ce('0x18'),_0x41d375);logger[_0x75ce('0xf')](_0x75ce('0x18'),_0x41d375,JSON[_0x75ce('0x12')](_0x590995));_0x377e4d(_0x590995);})[_0x75ce('0x17')](function(_0x1a1883){logger[_0x75ce('0x13')](_0x75ce('0x18'),_0x1a1883[_0x75ce('0x15')],_0x41d375);_0x5d1724(_0x3a4f0e['error'](0x1f4,_0x1a1883[_0x75ce('0x15')]));});});};exports[_0x75ce('0x1d')]=function(_0x5ee259){var _0x80194a=this;return new Promise(function(_0x536e55,_0x126437){return db[_0x75ce('0x1e')][_0x75ce('0x1f')](_0x5ee259['body'],{'raw':_0x5ee259['options']?_0x5ee259[_0x75ce('0x1b')][_0x75ce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ee259['options']?_0x5ee259[_0x75ce('0x1b')][_0x75ce('0x20')]||null:null,'attributes':_0x5ee259['options']?_0x5ee259[_0x75ce('0x1b')][_0x75ce('0x21')]||null:null,'limit':_0x5ee259[_0x75ce('0x1b')]?_0x5ee259[_0x75ce('0x1b')]['limit']||null:null})[_0x75ce('0xc')](function(_0x132514){logger[_0x75ce('0xd')](_0x75ce('0x1d'),_0x5ee259);logger['debug'](_0x75ce('0x1d'),_0x5ee259,JSON['stringify'](_0x132514));_0x536e55(_0x132514);})[_0x75ce('0x17')](function(_0x4f8d42){logger['error']('UpdateSmsQueueReport',_0x4f8d42[_0x75ce('0x15')],_0x5ee259);_0x126437(_0x80194a[_0x75ce('0x13')](0x1f4,_0x4f8d42[_0x75ce('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 15d7e1e..b1e6ef6 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 _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1b7796,_0x49409b){_0x1b7796=_0x1b7796-0x0;var _0x1f03ef=_0xcca7[_0x1b7796];return _0x1f03ef;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file +var _0x3baf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4fa614,_0x30a1ab){var _0x35b8e3=function(_0x22b315){while(--_0x22b315){_0x4fa614['push'](_0x4fa614['shift']());}};_0x35b8e3(++_0x30a1ab);}(_0x3baf,0xf7));var _0xf3ba=function(_0x3db71e,_0x275086){_0x3db71e=_0x3db71e-0x0;var _0x4240a1=_0x3baf[_0x3db71e];return _0x4240a1;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var fs_extra=require(_0xf3ba('0x6'));var auth=require(_0xf3ba('0x7'));var interaction=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var controller=require(_0xf3ba('0xa'));router[_0xf3ba('0xb')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xd')]);router[_0xf3ba('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf3ba('0xb')]('/:id',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0xe')]);router[_0xf3ba('0xf')]('/',auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x10')]);router[_0xf3ba('0x11')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x14')](_0xf3ba('0x12'),auth[_0xf3ba('0xc')](),controller[_0xf3ba('0x15')]);module[_0xf3ba('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c508dd9..da84697 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x501e6d,_0x43ce8e){var _0x545ff9=function(_0x5e0bf2){while(--_0x5e0bf2){_0x501e6d['push'](_0x501e6d['shift']());}};_0x545ff9(++_0x43ce8e);}(_0x008c,0x188));var _0xc008=function(_0x465a2f,_0x473c48){_0x465a2f=_0x465a2f-0x0;var _0x329622=_0x008c[_0x465a2f];return _0x329622;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2fd36b,_0x4f9475){var _0x5a024b=function(_0x5efe48){while(--_0x5efe48){_0x2fd36b['push'](_0x2fd36b['shift']());}};_0x5a024b(++_0x4f9475);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xcb91[_0xc82d1a];return _0x32fad2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 38d7378..b39254a 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 _0x0273=['../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','catch','create','body','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3d6907,_0x2f08fb){var _0x2ab3aa=function(_0x5f2f01){while(--_0x5f2f01){_0x3d6907['push'](_0x3d6907['shift']());}};_0x2ab3aa(++_0x2f08fb);}(_0x0273,0x159));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3027('0x0'));var rimraf=require(_0x3027('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3027('0x2'));var rp=require(_0x3027('0x3'));var moment=require(_0x3027('0x4'));var BPromise=require(_0x3027('0x5'));var Mustache=require(_0x3027('0x6'));var util=require(_0x3027('0x7'));var path=require('path');var sox=require(_0x3027('0x8'));var csv=require(_0x3027('0x9'));var ejs=require(_0x3027('0xa'));var fs=require('fs');var fs_extra=require(_0x3027('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3027('0xc'));var toCsv=require(_0x3027('0x9'));var querystring=require(_0x3027('0xd'));var Papa=require('papaparse');var Redis=require(_0x3027('0xe'));var authService=require(_0x3027('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3027('0x10'));var hardwareService=require(_0x3027('0x11'));var logger=require(_0x3027('0x12'))(_0x3027('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3027('0x14'));var db=require(_0x3027('0x15'))['db'];function respondWithStatusCode(_0xc79ba1,_0x593208){_0x593208=_0x593208||0xcc;return function(_0xb1f8b){if(_0xb1f8b){return _0xc79ba1[_0x3027('0x16')](_0x593208);}return _0xc79ba1['status'](_0x593208)['end']();};}function respondWithResult(_0x44bcda,_0x464340){_0x464340=_0x464340||0xc8;return function(_0x148129){if(_0x148129){return _0x44bcda[_0x3027('0x17')](_0x464340)['json'](_0x148129);}};}function respondWithFilteredResult(_0x1c56da,_0x3a9276){return function(_0x1cc9c1){if(_0x1cc9c1){var _0x2845ab=typeof _0x3a9276[_0x3027('0x18')]==='undefined'&&typeof _0x3a9276[_0x3027('0x19')]===_0x3027('0x1a');var _0x31819e=_0x1cc9c1[_0x3027('0x1b')];var _0x1a2714=_0x2845ab?0x0:_0x3a9276['offset'];var _0x3f1938=_0x2845ab?_0x1cc9c1[_0x3027('0x1b')]:_0x3a9276[_0x3027('0x18')]+_0x3a9276[_0x3027('0x19')];var _0x1729a4;if(_0x3f1938>=_0x31819e){_0x3f1938=_0x31819e;_0x1729a4=0xc8;}else{_0x1729a4=0xce;}_0x1c56da[_0x3027('0x17')](_0x1729a4);return _0x1c56da[_0x3027('0x1c')](_0x3027('0x1d'),_0x1a2714+'-'+_0x3f1938+'/'+_0x31819e)[_0x3027('0x1e')](_0x1cc9c1);}return null;};}function patchUpdates(_0x19f861){return function(_0xc4f80f){try{jsonpatch[_0x3027('0x1f')](_0xc4f80f,_0x19f861,!![]);}catch(_0x17b46c){return BPromise[_0x3027('0x20')](_0x17b46c);}return _0xc4f80f[_0x3027('0x21')]();};}function saveUpdates(_0x4a4d41,_0x340d1a){return function(_0x573292){if(_0x573292){return _0x573292[_0x3027('0x22')](_0x4a4d41)[_0x3027('0x23')](function(_0x1e5e66){return _0x1e5e66;});}return null;};}function removeEntity(_0x325ff3,_0x6f4ff7){return function(_0x50434d){if(_0x50434d){return _0x50434d['destroy']()[_0x3027('0x23')](function(){_0x325ff3[_0x3027('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48fbd2,_0x10e9f1){return function(_0x3c0006){if(!_0x3c0006){_0x48fbd2[_0x3027('0x16')](0x194);}return _0x3c0006;};}function handleError(_0x290c55,_0x39e57e){_0x39e57e=_0x39e57e||0x1f4;return function(_0x5d1214){logger[_0x3027('0x24')](_0x5d1214[_0x3027('0x25')]);if(_0x5d1214[_0x3027('0x26')]){delete _0x5d1214[_0x3027('0x26')];}_0x290c55[_0x3027('0x17')](_0x39e57e)[_0x3027('0x27')](_0x5d1214);};}exports['index']=function(_0x19c287,_0x35e62c){var _0x3e365b={},_0x49639e={},_0x31586a={'count':0x0,'rows':[]};var _0x47994c=_[_0x3027('0x28')](db[_0x3027('0x29')][_0x3027('0x2a')],function(_0x437c7c){return{'name':_0x437c7c[_0x3027('0x2b')],'type':_0x437c7c['type'][_0x3027('0x2c')]};});_0x49639e['model']=_['map'](_0x47994c,_0x3027('0x26'));_0x49639e['query']=_[_0x3027('0x2d')](_0x19c287[_0x3027('0x2e')]);_0x49639e[_0x3027('0x2f')]=_[_0x3027('0x30')](_0x49639e[_0x3027('0x31')],_0x49639e[_0x3027('0x2e')]);_0x3e365b[_0x3027('0x32')]=_[_0x3027('0x30')](_0x49639e[_0x3027('0x31')],qs['fields'](_0x19c287[_0x3027('0x2e')][_0x3027('0x33')]));_0x3e365b[_0x3027('0x32')]=_0x3e365b[_0x3027('0x32')][_0x3027('0x34')]?_0x3e365b[_0x3027('0x32')]:_0x49639e['model'];if(!_0x19c287[_0x3027('0x2e')][_0x3027('0x35')]('nolimit')){_0x3e365b['limit']=qs[_0x3027('0x19')](_0x19c287[_0x3027('0x2e')]['limit']);_0x3e365b[_0x3027('0x18')]=qs[_0x3027('0x18')](_0x19c287[_0x3027('0x2e')][_0x3027('0x18')]);}_0x3e365b[_0x3027('0x36')]=qs[_0x3027('0x37')](_0x19c287[_0x3027('0x2e')][_0x3027('0x37')]);_0x3e365b['where']=qs[_0x3027('0x2f')](_[_0x3027('0x38')](_0x19c287['query'],_0x49639e[_0x3027('0x2f')]),_0x47994c);if(_0x19c287['query']['filter']){_0x3e365b[_0x3027('0x39')]=_[_0x3027('0x3a')](_0x3e365b[_0x3027('0x39')],{'$or':_[_0x3027('0x28')](_0x47994c,function(_0x3b5456){if(_0x3b5456['type']!==_0x3027('0x3b')){var _0x42f57f={};_0x42f57f[_0x3b5456[_0x3027('0x26')]]={'$like':'%'+_0x19c287[_0x3027('0x2e')][_0x3027('0x3c')]+'%'};return _0x42f57f;}})});}_0x3e365b=_[_0x3027('0x3a')]({},_0x3e365b,_0x19c287[_0x3027('0x3d')]);var _0x42a002={'where':_0x3e365b[_0x3027('0x39')]};return db[_0x3027('0x29')][_0x3027('0x1b')](_0x42a002)['then'](function(_0x3c47b9){_0x31586a[_0x3027('0x1b')]=_0x3c47b9;if(_0x19c287[_0x3027('0x2e')][_0x3027('0x3e')]){_0x3e365b['include']=[{'all':!![]}];}return db[_0x3027('0x29')][_0x3027('0x3f')](_0x3e365b);})[_0x3027('0x23')](function(_0x2ef625){_0x31586a[_0x3027('0x40')]=_0x2ef625;return _0x31586a;})[_0x3027('0x23')](respondWithFilteredResult(_0x35e62c,_0x3e365b))['catch'](handleError(_0x35e62c,null));};exports[_0x3027('0x41')]=function(_0x353a7e,_0x452f2e){var _0x4d6276={'raw':!![],'where':{'id':_0x353a7e[_0x3027('0x42')]['id']}},_0x12ded1={};_0x12ded1['model']=_[_0x3027('0x2d')](db['SmsTransferReport'][_0x3027('0x2a')]);_0x12ded1[_0x3027('0x2e')]=_[_0x3027('0x2d')](_0x353a7e[_0x3027('0x2e')]);_0x12ded1[_0x3027('0x2f')]=_[_0x3027('0x30')](_0x12ded1[_0x3027('0x31')],_0x12ded1[_0x3027('0x2e')]);_0x4d6276[_0x3027('0x32')]=_['intersection'](_0x12ded1[_0x3027('0x31')],qs[_0x3027('0x33')](_0x353a7e[_0x3027('0x2e')]['fields']));_0x4d6276['attributes']=_0x4d6276[_0x3027('0x32')][_0x3027('0x34')]?_0x4d6276['attributes']:_0x12ded1[_0x3027('0x31')];if(_0x353a7e[_0x3027('0x2e')]['includeAll']){_0x4d6276['include']=[{'all':!![]}];}_0x4d6276=_[_0x3027('0x3a')]({},_0x4d6276,_0x353a7e[_0x3027('0x3d')]);return db[_0x3027('0x29')]['find'](_0x4d6276)[_0x3027('0x23')](handleEntityNotFound(_0x452f2e,null))['then'](respondWithResult(_0x452f2e,null))[_0x3027('0x43')](handleError(_0x452f2e,null));};exports[_0x3027('0x44')]=function(_0x293b61,_0xf8efb0){return db[_0x3027('0x29')][_0x3027('0x44')](_0x293b61['body'],{})[_0x3027('0x23')](respondWithResult(_0xf8efb0,0xc9))['catch'](handleError(_0xf8efb0,null));};exports[_0x3027('0x22')]=function(_0x32b4f8,_0x31e29a){if(_0x32b4f8[_0x3027('0x45')]['id']){delete _0x32b4f8[_0x3027('0x45')]['id'];}return db[_0x3027('0x29')]['find']({'where':{'id':_0x32b4f8[_0x3027('0x42')]['id']}})[_0x3027('0x23')](handleEntityNotFound(_0x31e29a,null))[_0x3027('0x23')](saveUpdates(_0x32b4f8[_0x3027('0x45')],null))[_0x3027('0x23')](respondWithResult(_0x31e29a,null))['catch'](handleError(_0x31e29a,null));};exports[_0x3027('0x46')]=function(_0x5c3ed4,_0x1fbbc9){return db[_0x3027('0x29')][_0x3027('0x47')]({'where':{'id':_0x5c3ed4['params']['id']}})[_0x3027('0x23')](handleEntityNotFound(_0x1fbbc9,null))[_0x3027('0x23')](removeEntity(_0x1fbbc9,null))[_0x3027('0x43')](handleError(_0x1fbbc9,null));};exports[_0x3027('0x48')]=function(_0x2ba189,_0x4acd13){return db['SmsTransferReport'][_0x3027('0x48')]()[_0x3027('0x23')](respondWithResult(_0x4acd13,null))[_0x3027('0x43')](handleError(_0x4acd13,null));}; \ No newline at end of file +var _0xf748=['moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsTransferReport','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','type','filter','options','where','count','includeAll','findAll','rows','params','keys','rawAttributes','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xf748,0x1dc));var _0x8f74=function(_0x53cd33,_0x597082){_0x53cd33=_0x53cd33-0x0;var _0x302e2c=_0xf748[_0x53cd33];return _0x302e2c;};'use strict';var emlformat=require(_0x8f74('0x0'));var rimraf=require(_0x8f74('0x1'));var zipdir=require(_0x8f74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f74('0x3'));var moment=require(_0x8f74('0x4'));var BPromise=require(_0x8f74('0x5'));var Mustache=require(_0x8f74('0x6'));var util=require(_0x8f74('0x7'));var path=require('path');var sox=require(_0x8f74('0x8'));var csv=require('to-csv');var ejs=require(_0x8f74('0x9'));var fs=require('fs');var fs_extra=require(_0x8f74('0xa'));var _=require(_0x8f74('0xb'));var squel=require(_0x8f74('0xc'));var crypto=require(_0x8f74('0xd'));var jsforce=require(_0x8f74('0xe'));var deskjs=require(_0x8f74('0xf'));var toCsv=require(_0x8f74('0x10'));var querystring=require(_0x8f74('0x11'));var Papa=require(_0x8f74('0x12'));var Redis=require(_0x8f74('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8f74('0x14'));var as=require(_0x8f74('0x15'));var hardwareService=require(_0x8f74('0x16'));var logger=require(_0x8f74('0x17'))(_0x8f74('0x18'));var utils=require(_0x8f74('0x19'));var config=require(_0x8f74('0x1a'));var licenseUtil=require(_0x8f74('0x1b'));var db=require(_0x8f74('0x1c'))['db'];function respondWithStatusCode(_0x531214,_0x404af8){_0x404af8=_0x404af8||0xcc;return function(_0x2c610b){if(_0x2c610b){return _0x531214[_0x8f74('0x1d')](_0x404af8);}return _0x531214[_0x8f74('0x1e')](_0x404af8)[_0x8f74('0x1f')]();};}function respondWithResult(_0x1f290f,_0x1e36b6){_0x1e36b6=_0x1e36b6||0xc8;return function(_0x559f4d){if(_0x559f4d){return _0x1f290f[_0x8f74('0x1e')](_0x1e36b6)[_0x8f74('0x20')](_0x559f4d);}};}function respondWithFilteredResult(_0x54b5d6,_0x2eff98){return function(_0x541a73){if(_0x541a73){var _0xd3ccfa=typeof _0x2eff98[_0x8f74('0x21')]===_0x8f74('0x22')&&typeof _0x2eff98[_0x8f74('0x23')]==='undefined';var _0x25e8e5=_0x541a73['count'];var _0x1d3aaf=_0xd3ccfa?0x0:_0x2eff98['offset'];var _0x5600aa=_0xd3ccfa?_0x541a73['count']:_0x2eff98[_0x8f74('0x21')]+_0x2eff98[_0x8f74('0x23')];var _0x4b3ba6;if(_0x5600aa>=_0x25e8e5){_0x5600aa=_0x25e8e5;_0x4b3ba6=0xc8;}else{_0x4b3ba6=0xce;}_0x54b5d6[_0x8f74('0x1e')](_0x4b3ba6);return _0x54b5d6[_0x8f74('0x24')](_0x8f74('0x25'),_0x1d3aaf+'-'+_0x5600aa+'/'+_0x25e8e5)['json'](_0x541a73);}return null;};}function patchUpdates(_0x5c5925){return function(_0x5298fb){try{jsonpatch[_0x8f74('0x26')](_0x5298fb,_0x5c5925,!![]);}catch(_0x57e9fc){return BPromise[_0x8f74('0x27')](_0x57e9fc);}return _0x5298fb[_0x8f74('0x28')]();};}function saveUpdates(_0x1baf7d,_0x5e1785){return function(_0x542312){if(_0x542312){return _0x542312[_0x8f74('0x29')](_0x1baf7d)[_0x8f74('0x2a')](function(_0xece02c){return _0xece02c;});}return null;};}function removeEntity(_0x114b27,_0x21671c){return function(_0x96ecff){if(_0x96ecff){return _0x96ecff[_0x8f74('0x2b')]()['then'](function(){_0x114b27[_0x8f74('0x1e')](0xcc)[_0x8f74('0x1f')]();});}};}function handleEntityNotFound(_0x5007fc,_0x46e614){return function(_0x1ba2d3){if(!_0x1ba2d3){_0x5007fc['sendStatus'](0x194);}return _0x1ba2d3;};}function handleError(_0x38da23,_0x9c05d5){_0x9c05d5=_0x9c05d5||0x1f4;return function(_0x8b43f9){logger[_0x8f74('0x2c')](_0x8b43f9[_0x8f74('0x2d')]);if(_0x8b43f9[_0x8f74('0x2e')]){delete _0x8b43f9[_0x8f74('0x2e')];}_0x38da23['status'](_0x9c05d5)[_0x8f74('0x2f')](_0x8b43f9);};}exports['index']=function(_0x386298,_0x55d861){var _0x5b976f={},_0x5151ab={},_0x1cd3bc={'count':0x0,'rows':[]};var _0x469c38=_[_0x8f74('0x30')](db[_0x8f74('0x31')]['rawAttributes'],function(_0x4ef747){return{'name':_0x4ef747['fieldName'],'type':_0x4ef747['type'][_0x8f74('0x32')]};});_0x5151ab[_0x8f74('0x33')]=_[_0x8f74('0x30')](_0x469c38,'name');_0x5151ab[_0x8f74('0x34')]=_['keys'](_0x386298[_0x8f74('0x34')]);_0x5151ab[_0x8f74('0x35')]=_[_0x8f74('0x36')](_0x5151ab[_0x8f74('0x33')],_0x5151ab[_0x8f74('0x34')]);_0x5b976f[_0x8f74('0x37')]=_[_0x8f74('0x36')](_0x5151ab[_0x8f74('0x33')],qs[_0x8f74('0x38')](_0x386298[_0x8f74('0x34')][_0x8f74('0x38')]));_0x5b976f[_0x8f74('0x37')]=_0x5b976f[_0x8f74('0x37')][_0x8f74('0x39')]?_0x5b976f['attributes']:_0x5151ab['model'];if(!_0x386298['query'][_0x8f74('0x3a')](_0x8f74('0x3b'))){_0x5b976f[_0x8f74('0x23')]=qs['limit'](_0x386298[_0x8f74('0x34')][_0x8f74('0x23')]);_0x5b976f['offset']=qs['offset'](_0x386298['query'][_0x8f74('0x21')]);}_0x5b976f['order']=qs['sort'](_0x386298[_0x8f74('0x34')][_0x8f74('0x3c')]);_0x5b976f['where']=qs[_0x8f74('0x35')](_[_0x8f74('0x3d')](_0x386298[_0x8f74('0x34')],_0x5151ab[_0x8f74('0x35')]),_0x469c38);if(_0x386298['query']['filter']){_0x5b976f['where']=_[_0x8f74('0x3e')](_0x5b976f['where'],{'$or':_['map'](_0x469c38,function(_0x53d1d0){if(_0x53d1d0[_0x8f74('0x3f')]!=='VIRTUAL'){var _0x5a1d0a={};_0x5a1d0a[_0x53d1d0[_0x8f74('0x2e')]]={'$like':'%'+_0x386298['query'][_0x8f74('0x40')]+'%'};return _0x5a1d0a;}})});}_0x5b976f=_['merge']({},_0x5b976f,_0x386298[_0x8f74('0x41')]);var _0x43d8c6={'where':_0x5b976f[_0x8f74('0x42')]};return db[_0x8f74('0x31')][_0x8f74('0x43')](_0x43d8c6)['then'](function(_0x19888b){_0x1cd3bc[_0x8f74('0x43')]=_0x19888b;if(_0x386298[_0x8f74('0x34')][_0x8f74('0x44')]){_0x5b976f['include']=[{'all':!![]}];}return db[_0x8f74('0x31')][_0x8f74('0x45')](_0x5b976f);})[_0x8f74('0x2a')](function(_0x1ad5b3){_0x1cd3bc[_0x8f74('0x46')]=_0x1ad5b3;return _0x1cd3bc;})[_0x8f74('0x2a')](respondWithFilteredResult(_0x55d861,_0x5b976f))['catch'](handleError(_0x55d861,null));};exports['show']=function(_0x5bdf28,_0x1eed17){var _0x146f1c={'raw':!![],'where':{'id':_0x5bdf28[_0x8f74('0x47')]['id']}},_0x53ccc3={};_0x53ccc3['model']=_[_0x8f74('0x48')](db[_0x8f74('0x31')][_0x8f74('0x49')]);_0x53ccc3[_0x8f74('0x34')]=_[_0x8f74('0x48')](_0x5bdf28['query']);_0x53ccc3['filters']=_['intersection'](_0x53ccc3[_0x8f74('0x33')],_0x53ccc3[_0x8f74('0x34')]);_0x146f1c['attributes']=_[_0x8f74('0x36')](_0x53ccc3[_0x8f74('0x33')],qs['fields'](_0x5bdf28[_0x8f74('0x34')][_0x8f74('0x38')]));_0x146f1c[_0x8f74('0x37')]=_0x146f1c[_0x8f74('0x37')][_0x8f74('0x39')]?_0x146f1c[_0x8f74('0x37')]:_0x53ccc3[_0x8f74('0x33')];if(_0x5bdf28['query']['includeAll']){_0x146f1c[_0x8f74('0x4a')]=[{'all':!![]}];}_0x146f1c=_['merge']({},_0x146f1c,_0x5bdf28[_0x8f74('0x41')]);return db[_0x8f74('0x31')][_0x8f74('0x4b')](_0x146f1c)['then'](handleEntityNotFound(_0x1eed17,null))[_0x8f74('0x2a')](respondWithResult(_0x1eed17,null))[_0x8f74('0x4c')](handleError(_0x1eed17,null));};exports[_0x8f74('0x4d')]=function(_0x218da6,_0x5bd438){return db[_0x8f74('0x31')][_0x8f74('0x4d')](_0x218da6['body'],{})[_0x8f74('0x2a')](respondWithResult(_0x5bd438,0xc9))[_0x8f74('0x4c')](handleError(_0x5bd438,null));};exports[_0x8f74('0x29')]=function(_0x1d3899,_0x4bfe5d){if(_0x1d3899[_0x8f74('0x4e')]['id']){delete _0x1d3899[_0x8f74('0x4e')]['id'];}return db[_0x8f74('0x31')][_0x8f74('0x4b')]({'where':{'id':_0x1d3899[_0x8f74('0x47')]['id']}})[_0x8f74('0x2a')](handleEntityNotFound(_0x4bfe5d,null))[_0x8f74('0x2a')](saveUpdates(_0x1d3899[_0x8f74('0x4e')],null))['then'](respondWithResult(_0x4bfe5d,null))[_0x8f74('0x4c')](handleError(_0x4bfe5d,null));};exports['destroy']=function(_0x155258,_0xeac003){return db[_0x8f74('0x31')][_0x8f74('0x4b')]({'where':{'id':_0x155258['params']['id']}})['then'](handleEntityNotFound(_0xeac003,null))[_0x8f74('0x2a')](removeEntity(_0xeac003,null))['catch'](handleError(_0xeac003,null));};exports[_0x8f74('0x4f')]=function(_0x14d409,_0x484444){return db[_0x8f74('0x31')]['describe']()[_0x8f74('0x2a')](respondWithResult(_0x484444,null))[_0x8f74('0x4c')](handleError(_0x484444,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e31271b..6cb3512 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 _0x4ab0=['moment','bluebird','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api'];(function(_0x4ac119,_0xb24618){var _0x3bfacf=function(_0x5db762){while(--_0x5db762){_0x4ac119['push'](_0x4ac119['shift']());}};_0x3bfacf(++_0xb24618);}(_0x4ab0,0xd5));var _0x04ab=function(_0x495f8c,_0x3ef40b){_0x495f8c=_0x495f8c-0x0;var _0x30a48d=_0x4ab0[_0x495f8c];return _0x30a48d;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var logger=require(_0x04ab('0x1'))(_0x04ab('0x2'));var moment=require(_0x04ab('0x3'));var BPromise=require(_0x04ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x04ab('0x5'));var config=require(_0x04ab('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x04ab('0x7')]=function(_0x2c5730,_0x4edd2e){return _0x2c5730[_0x04ab('0x8')](_0x04ab('0x9'),attributes,{'tableName':_0x04ab('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x04ab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d0c=['uniqueid','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x2d0c,0xc1));var _0xc2d0=function(_0x150599,_0x3bdfb0){_0x150599=_0x150599-0x0;var _0x12c65f=_0x2d0c[_0x150599];return _0x12c65f;};'use strict';var _=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var logger=require('../../config/logger')(_0xc2d0('0x2'));var moment=require(_0xc2d0('0x3'));var BPromise=require(_0xc2d0('0x4'));var rp=require(_0xc2d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2d0('0x6'));var attributes=require(_0xc2d0('0x7'));module[_0xc2d0('0x8')]=function(_0x1184b9,_0x4eef93){return _0x1184b9['define'](_0xc2d0('0x9'),attributes,{'tableName':_0xc2d0('0xa'),'paranoid':![],'indexes':[{'name':_0xc2d0('0xb'),'fields':[_0xc2d0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 044ed14..d1a68a5 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 _0xbc17=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xbc17[_0x221ba2];return _0x47d08e;};'use strict';var _=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var moment=require('moment');var BPromise=require(_0x7bc1('0x2'));var rs=require(_0x7bc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7bc1('0x4'));var logger=require(_0x7bc1('0x5'))('rpc');var config=require(_0x7bc1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bc1('0x7')][_0x7bc1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b720f,_0x3aed05,_0x3fdce7){return new BPromise(function(_0x351340,_0x3c08dc){return client[_0x7bc1('0x9')](_0x1b720f,_0x3fdce7)['then'](function(_0x48454c){logger[_0x7bc1('0xa')](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));logger['debug'](_0x7bc1('0xd'),_0x3aed05,_0x7bc1('0xc'),JSON[_0x7bc1('0xe')](_0x48454c));if(_0x48454c[_0x7bc1('0xf')]){if(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x10')]===0x1f4){logger[_0x7bc1('0xf')](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x3c08dc(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}logger['error'](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x351340(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}else{logger['info'](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));_0x351340(_0x48454c[_0x7bc1('0x12')][_0x7bc1('0x11')]);}})[_0x7bc1('0x13')](function(_0x5a5a59){logger[_0x7bc1('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x3aed05,_0x5a5a59);_0x3c08dc(_0x5a5a59);});});} \ No newline at end of file +var _0x9fc5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x9fc5,0xb6));var _0x59fc=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x9fc5[_0x38a7ac];return _0x53061a;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var moment=require(_0x59fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x59fc('0x2'));var fs=require('fs');var Redis=require(_0x59fc('0x3'));var db=require(_0x59fc('0x4'))['db'];var utils=require(_0x59fc('0x5'));var logger=require(_0x59fc('0x6'))(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var jayson=require(_0x59fc('0x9'));var client=jayson['client'][_0x59fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13897f,_0x2c47fb,_0x55fa6d){return new BPromise(function(_0xdd2bb9,_0x313063){return client[_0x59fc('0xb')](_0x13897f,_0x55fa6d)[_0x59fc('0xc')](function(_0x39bc72){logger[_0x59fc('0xd')](_0x59fc('0xe'),_0x2c47fb,'request\x20sent');logger[_0x59fc('0xf')](_0x59fc('0x10'),_0x2c47fb,_0x59fc('0x11'),JSON[_0x59fc('0x12')](_0x39bc72));if(_0x39bc72[_0x59fc('0x13')]){if(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x14')]===0x1f4){logger['error'](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0x313063(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0xdd2bb9(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}else{logger['info'](_0x59fc('0xe'),_0x2c47fb,_0x59fc('0x11'));_0xdd2bb9(_0x39bc72['result'][_0x59fc('0x15')]);}})[_0x59fc('0x16')](function(_0x4162c4){logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x4162c4);_0x313063(_0x4162c4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 89adc20..09d77a1 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 _0xc7ee=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x30225a,_0x233ad6){var _0x3551ef=function(_0x1a32d5){while(--_0x1a32d5){_0x30225a['push'](_0x30225a['shift']());}};_0x3551ef(++_0x233ad6);}(_0xc7ee,0xa7));var _0xec7e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc7ee[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0xec7e('0x0'));var path=require(_0xec7e('0x1'));var timeout=require(_0xec7e('0x2'));var express=require(_0xec7e('0x3'));var router=express[_0xec7e('0x4')]();var fs_extra=require(_0xec7e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec7e('0x6'));var config=require(_0xec7e('0x7'));var controller=require(_0xec7e('0x8'));router[_0xec7e('0x9')]('/',auth[_0xec7e('0xa')](),controller[_0xec7e('0xb')]);router[_0xec7e('0x9')](_0xec7e('0xc'),auth['isAuthenticated'](),controller[_0xec7e('0xd')]);router[_0xec7e('0x9')](_0xec7e('0xe'),auth[_0xec7e('0xa')](),controller[_0xec7e('0xf')]);var upload=multer({'storage':multer[_0xec7e('0x10')]({'destination':function(_0x4f0fbc,_0x46690e,_0x5652e8){_0x5652e8(null,path[_0xec7e('0x11')](config['root'],_0xec7e('0x12')));},'filename':function(_0x3410bf,_0x33a5a2,_0x124fa9){_0x33a5a2[_0xec7e('0x13')]=_0x33a5a2[_0xec7e('0x13')][_0xec7e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x124fa9(null,util[_0xec7e('0x15')](_0xec7e('0x16'),path[_0xec7e('0x17')](_0x33a5a2[_0xec7e('0x13')],path[_0xec7e('0x18')](_0x33a5a2[_0xec7e('0x13')])),Date[_0xec7e('0x19')](),path[_0xec7e('0x18')](_0x33a5a2[_0xec7e('0x13')])));}})});router[_0xec7e('0x1a')]('/',upload[_0xec7e('0x1b')](_0xec7e('0x1c')),controller[_0xec7e('0x1d')]);router[_0xec7e('0x1e')]('/:id',auth[_0xec7e('0xa')](),controller[_0xec7e('0x1f')]);router[_0xec7e('0x20')]('/:id',auth[_0xec7e('0xa')](),controller[_0xec7e('0x20')]);module[_0xec7e('0x21')]=router; \ No newline at end of file +var _0x112d=['server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','create','update','delete','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id','show','download','diskStorage','join'];(function(_0xca2488,_0x14de01){var _0xa77bb9=function(_0x2b820c){while(--_0x2b820c){_0xca2488['push'](_0xca2488['shift']());}};_0xa77bb9(++_0x14de01);}(_0x112d,0x1a3));var _0xd112=function(_0x2a972b,_0x175baa){_0x2a972b=_0x2a972b-0x0;var _0x3ba90e=_0x112d[_0x2a972b];return _0x3ba90e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd112('0x0')]();var fs_extra=require(_0xd112('0x1'));var auth=require(_0xd112('0x2'));var interaction=require(_0xd112('0x3'));var config=require(_0xd112('0x4'));var controller=require(_0xd112('0x5'));router['get']('/',auth[_0xd112('0x6')](),controller['index']);router[_0xd112('0x7')](_0xd112('0x8'),auth[_0xd112('0x6')](),controller[_0xd112('0x9')]);router[_0xd112('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xd112('0xa')]);var upload=multer({'storage':multer[_0xd112('0xb')]({'destination':function(_0xf18b53,_0x14d53b,_0x118a4a){_0x118a4a(null,path[_0xd112('0xc')](config['root'],_0xd112('0xd')));},'filename':function(_0x4514d0,_0x210674,_0xbc4bb6){_0x210674[_0xd112('0xe')]=_0x210674[_0xd112('0xe')][_0xd112('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xbc4bb6(null,util[_0xd112('0x10')](_0xd112('0x11'),path[_0xd112('0x12')](_0x210674[_0xd112('0xe')],path[_0xd112('0x13')](_0x210674[_0xd112('0xe')])),Date[_0xd112('0x14')](),path[_0xd112('0x13')](_0x210674[_0xd112('0xe')])));}})});router[_0xd112('0x15')]('/',upload['single'](_0xd112('0x16')),controller[_0xd112('0x17')]);router['put']('/:id',auth[_0xd112('0x6')](),controller[_0xd112('0x18')]);router[_0xd112('0x19')](_0xd112('0x8'),auth[_0xd112('0x6')](),controller[_0xd112('0x19')]);module[_0xd112('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 668f50e..7257529 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 _0xadea=['FLOAT','exports','STRING','BIGINT','INTEGER'];(function(_0xf2a695,_0x403c2a){var _0x1f0b54=function(_0x5eff9d){while(--_0x5eff9d){_0xf2a695['push'](_0xf2a695['shift']());}};_0x1f0b54(++_0x403c2a);}(_0xadea,0x83));var _0xaade=function(_0x4cf765,_0xc7a6bf){_0x4cf765=_0x4cf765-0x0;var _0x473760=_0xadea[_0x4cf765];return _0x473760;};'use strict';var Sequelize=require('sequelize');module[_0xaade('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xaade('0x1')]},'display_name':{'type':Sequelize[_0xaade('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xaade('0x1')]},'original_format':{'type':Sequelize[_0xaade('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xaade('0x2')]},'original_channelCount':{'type':Sequelize[_0xaade('0x3')]},'original_bitRate':{'type':Sequelize[_0xaade('0x2')]},'original_sampleRate':{'type':Sequelize[_0xaade('0x3')]},'converted_format':{'type':Sequelize[_0xaade('0x1')]},'converted_duration':{'type':Sequelize[_0xaade('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xaade('0x3')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xaade('0x3')]}}; \ No newline at end of file +var _0x3d12=['name','STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x132671,_0x26760e){var _0x4a3b55=function(_0xf011ca){while(--_0xf011ca){_0x132671['push'](_0x132671['shift']());}};_0x4a3b55(++_0x26760e);}(_0x3d12,0x101));var _0x23d1=function(_0x65e4ce,_0x2fae4a){_0x65e4ce=_0x65e4ce-0x0;var _0x50f4e9=_0x3d12[_0x65e4ce];return _0x50f4e9;};'use strict';var Sequelize=require('sequelize');module[_0x23d1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x23d1('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x23d1('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x23d1('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x23d1('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x23d1('0x4')]},'original_bitRate':{'type':Sequelize[_0x23d1('0x5')]},'original_sampleRate':{'type':Sequelize[_0x23d1('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x23d1('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x23d1('0x4')]},'converted_bitRate':{'type':Sequelize[_0x23d1('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x23d1('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7ea46ac..65df7d6 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 _0x397a=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Sounds','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Sound','includeAll','include','rows','catch','params','length','find','download','save_name','existsSync','join','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','basename','file','originalname','extname','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_channelCount','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3d134e,_0x451e2f){var _0x3e5871=function(_0x13f37d){while(--_0x13f37d){_0x3d134e['push'](_0x3d134e['shift']());}};_0x3e5871(++_0x451e2f);}(_0x397a,0x1f3));var _0xa397=function(_0x39e9f4,_0x7da7be){_0x39e9f4=_0x39e9f4-0x0;var _0x16b495=_0x397a[_0x39e9f4];return _0x16b495;};'use strict';var emlformat=require(_0xa397('0x0'));var rimraf=require(_0xa397('0x1'));var zipdir=require(_0xa397('0x2'));var jsonpatch=require(_0xa397('0x3'));var rp=require(_0xa397('0x4'));var moment=require(_0xa397('0x5'));var BPromise=require(_0xa397('0x6'));var Mustache=require(_0xa397('0x7'));var util=require(_0xa397('0x8'));var path=require(_0xa397('0x9'));var sox=require(_0xa397('0xa'));var csv=require(_0xa397('0xb'));var ejs=require(_0xa397('0xc'));var fs=require('fs');var fs_extra=require(_0xa397('0xd'));var _=require('lodash');var squel=require(_0xa397('0xe'));var crypto=require(_0xa397('0xf'));var jsforce=require(_0xa397('0x10'));var deskjs=require(_0xa397('0x11'));var toCsv=require(_0xa397('0xb'));var querystring=require(_0xa397('0x12'));var Papa=require(_0xa397('0x13'));var Redis=require(_0xa397('0x14'));var authService=require(_0xa397('0x15'));var qs=require(_0xa397('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa397('0x17'));var logger=require(_0xa397('0x18'))(_0xa397('0x19'));var utils=require(_0xa397('0x1a'));var config=require(_0xa397('0x1b'));var licenseUtil=require(_0xa397('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e21b1,_0x531346){_0x531346=_0x531346||0xcc;return function(_0x39e22b){if(_0x39e22b){return _0x4e21b1[_0xa397('0x1d')](_0x531346);}return _0x4e21b1[_0xa397('0x1e')](_0x531346)['end']();};}function respondWithResult(_0x142a68,_0x2057ad){_0x2057ad=_0x2057ad||0xc8;return function(_0x43063d){if(_0x43063d){return _0x142a68[_0xa397('0x1e')](_0x2057ad)[_0xa397('0x1f')](_0x43063d);}};}function respondWithFilteredResult(_0x19a6ba,_0x283f9b){return function(_0xac9b83){if(_0xac9b83){var _0x324a0d=typeof _0x283f9b[_0xa397('0x20')]===_0xa397('0x21')&&typeof _0x283f9b[_0xa397('0x22')]===_0xa397('0x21');var _0x1b8b09=_0xac9b83[_0xa397('0x23')];var _0x5dfff8=_0x324a0d?0x0:_0x283f9b[_0xa397('0x20')];var _0x1ceff6=_0x324a0d?_0xac9b83[_0xa397('0x23')]:_0x283f9b[_0xa397('0x20')]+_0x283f9b[_0xa397('0x22')];var _0x24f79e;if(_0x1ceff6>=_0x1b8b09){_0x1ceff6=_0x1b8b09;_0x24f79e=0xc8;}else{_0x24f79e=0xce;}_0x19a6ba[_0xa397('0x1e')](_0x24f79e);return _0x19a6ba['set'](_0xa397('0x24'),_0x5dfff8+'-'+_0x1ceff6+'/'+_0x1b8b09)[_0xa397('0x1f')](_0xac9b83);}return null;};}function patchUpdates(_0x373f6e){return function(_0x1fe49e){try{jsonpatch[_0xa397('0x25')](_0x1fe49e,_0x373f6e,!![]);}catch(_0x4beeda){return BPromise[_0xa397('0x26')](_0x4beeda);}return _0x1fe49e[_0xa397('0x27')]();};}function saveUpdates(_0x2e4005,_0xbed837){return function(_0x51a6ba){if(_0x51a6ba){return _0x51a6ba['update'](_0x2e4005)['then'](function(_0x2af6d6){return _0x2af6d6;});}return null;};}function removeEntity(_0x162da7,_0x574d86){return function(_0x3865e9){if(_0x3865e9){return _0x3865e9['destroy']()[_0xa397('0x28')](function(){var _0x5d07ee=_0x3865e9[_0xa397('0x29')]({'plain':!![]});var _0x1a49e9=_0xa397('0x2a');return db['UserProfileResource'][_0xa397('0x2b')]({'where':{'type':_0x1a49e9,'resourceId':_0x5d07ee['id']}})['then'](function(){return _0x3865e9;});})['then'](function(){_0x162da7[_0xa397('0x1e')](0xcc)[_0xa397('0x2c')]();});}};}function handleEntityNotFound(_0x43724f,_0x567650){return function(_0x5e1a6e){if(!_0x5e1a6e){_0x43724f['sendStatus'](0x194);}return _0x5e1a6e;};}function handleError(_0x41f16a,_0x5b3018){_0x5b3018=_0x5b3018||0x1f4;return function(_0x1f84be){logger[_0xa397('0x2d')](_0x1f84be[_0xa397('0x2e')]);if(_0x1f84be[_0xa397('0x2f')]){delete _0x1f84be[_0xa397('0x2f')];}_0x41f16a['status'](_0x5b3018)['send'](_0x1f84be);};}exports[_0xa397('0x30')]=function(_0x52c6bf,_0x4ecd74){var _0x4ffa81={},_0x5f1d1f={},_0x14b0a2={'count':0x0,'rows':[]};var _0x55d2fb=_[_0xa397('0x31')](db['Sound'][_0xa397('0x32')],function(_0x712816){return{'name':_0x712816[_0xa397('0x33')],'type':_0x712816[_0xa397('0x34')][_0xa397('0x35')]};});_0x5f1d1f[_0xa397('0x36')]=_[_0xa397('0x31')](_0x55d2fb,'name');_0x5f1d1f[_0xa397('0x37')]=_[_0xa397('0x38')](_0x52c6bf[_0xa397('0x37')]);_0x5f1d1f['filters']=_['intersection'](_0x5f1d1f['model'],_0x5f1d1f[_0xa397('0x37')]);_0x4ffa81[_0xa397('0x39')]=_[_0xa397('0x3a')](_0x5f1d1f[_0xa397('0x36')],qs[_0xa397('0x3b')](_0x52c6bf['query'][_0xa397('0x3b')]));_0x4ffa81[_0xa397('0x39')]=_0x4ffa81['attributes']['length']?_0x4ffa81['attributes']:_0x5f1d1f[_0xa397('0x36')];if(!_0x52c6bf[_0xa397('0x37')]['hasOwnProperty'](_0xa397('0x3c'))){_0x4ffa81[_0xa397('0x22')]=qs[_0xa397('0x22')](_0x52c6bf[_0xa397('0x37')][_0xa397('0x22')]);_0x4ffa81[_0xa397('0x20')]=qs['offset'](_0x52c6bf['query'][_0xa397('0x20')]);}_0x4ffa81[_0xa397('0x3d')]=qs[_0xa397('0x3e')](_0x52c6bf[_0xa397('0x37')][_0xa397('0x3e')]);_0x4ffa81[_0xa397('0x3f')]=qs[_0xa397('0x40')](_['pick'](_0x52c6bf['query'],_0x5f1d1f[_0xa397('0x40')]),_0x55d2fb);if(_0x52c6bf[_0xa397('0x37')][_0xa397('0x41')]){_0x4ffa81['where']=_[_0xa397('0x42')](_0x4ffa81[_0xa397('0x3f')],{'$or':_[_0xa397('0x31')](_0x55d2fb,function(_0x493063){if(_0x493063[_0xa397('0x34')]!==_0xa397('0x43')){var _0x1ab53c={};_0x1ab53c[_0x493063[_0xa397('0x2f')]]={'$like':'%'+_0x52c6bf[_0xa397('0x37')][_0xa397('0x41')]+'%'};return _0x1ab53c;}})});}_0x4ffa81=_[_0xa397('0x42')]({},_0x4ffa81,_0x52c6bf[_0xa397('0x44')]);var _0x34249e={'where':_0x4ffa81[_0xa397('0x3f')]};return db[_0xa397('0x45')][_0xa397('0x23')](_0x34249e)[_0xa397('0x28')](function(_0x5bec21){_0x14b0a2[_0xa397('0x23')]=_0x5bec21;if(_0x52c6bf[_0xa397('0x37')][_0xa397('0x46')]){_0x4ffa81[_0xa397('0x47')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x4ffa81);})[_0xa397('0x28')](function(_0x3b22b9){_0x14b0a2[_0xa397('0x48')]=_0x3b22b9;return _0x14b0a2;})[_0xa397('0x28')](respondWithFilteredResult(_0x4ecd74,_0x4ffa81))[_0xa397('0x49')](handleError(_0x4ecd74,null));};exports['show']=function(_0xb415b2,_0x4a13dd){var _0x10e8b4={'raw':!![],'where':{'id':_0xb415b2[_0xa397('0x4a')]['id']}},_0xa6e118={};_0xa6e118[_0xa397('0x36')]=_[_0xa397('0x38')](db[_0xa397('0x45')]['rawAttributes']);_0xa6e118[_0xa397('0x37')]=_['keys'](_0xb415b2[_0xa397('0x37')]);_0xa6e118[_0xa397('0x40')]=_['intersection'](_0xa6e118['model'],_0xa6e118[_0xa397('0x37')]);_0x10e8b4['attributes']=_[_0xa397('0x3a')](_0xa6e118[_0xa397('0x36')],qs[_0xa397('0x3b')](_0xb415b2[_0xa397('0x37')]['fields']));_0x10e8b4[_0xa397('0x39')]=_0x10e8b4[_0xa397('0x39')][_0xa397('0x4b')]?_0x10e8b4['attributes']:_0xa6e118['model'];if(_0xb415b2['query']['includeAll']){_0x10e8b4['include']=[{'all':!![]}];}_0x10e8b4=_['merge']({},_0x10e8b4,_0xb415b2['options']);return db[_0xa397('0x45')][_0xa397('0x4c')](_0x10e8b4)[_0xa397('0x28')](handleEntityNotFound(_0x4a13dd,null))[_0xa397('0x28')](respondWithResult(_0x4a13dd,null))[_0xa397('0x49')](handleError(_0x4a13dd,null));};exports[_0xa397('0x4d')]=function(_0x36a614,_0x3df7d4,_0x209008){return db[_0xa397('0x45')][_0xa397('0x4c')]({'where':{'id':_0x36a614[_0xa397('0x4a')]['id']},'attributes':['name',_0xa397('0x4e'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x3df7d4,null))[_0xa397('0x28')](function(_0x37f4dc){if(_0x37f4dc){if(!fs[_0xa397('0x4f')](path[_0xa397('0x50')](config['root'],_0xa397('0x51'),_0x37f4dc['save_name']+'.'+_0x37f4dc[_0xa397('0x52')]))){throw new db[(_0xa397('0x53'))][(_0xa397('0x54'))](_0xa397('0x55'));}return _0x3df7d4[_0xa397('0x4d')](path['join'](config[_0xa397('0x56')],_0xa397('0x51'),util[_0xa397('0x57')]('%s.%s',_0x37f4dc['save_name'],_0x37f4dc[_0xa397('0x52')])),util[_0xa397('0x57')](_0xa397('0x58'),_0x37f4dc[_0xa397('0x2f')],_0x37f4dc[_0xa397('0x52')]));}return null;})[_0xa397('0x49')](handleError(_0x3df7d4,null));};exports['create']=function(_0x561ef5,_0x3cac18,_0x25a0a4){var _0x357df0={'name':path[_0xa397('0x59')](_0x561ef5[_0xa397('0x5a')][_0xa397('0x5b')],path[_0xa397('0x5c')](_0x561ef5['file'][_0xa397('0x5b')])),'save_name':path[_0xa397('0x59')](_0x561ef5['file']['filename'],path[_0xa397('0x5c')](_0x561ef5[_0xa397('0x5a')]['filename'])),'original_format':path['extname'](_0x561ef5[_0xa397('0x5a')][_0xa397('0x5b')])['substring'](0x1),'converted_format':'wav'};var _0x1cfd7f=path['join'](config[_0xa397('0x56')],_0xa397('0x5d'),_0x561ef5['file'][_0xa397('0x5e')]);var _0x5253aa=path[_0xa397('0x50')](config[_0xa397('0x56')],_0xa397('0x51'),util['format'](_0xa397('0x58'),path['basename'](_0x561ef5[_0xa397('0x5a')][_0xa397('0x5e')],path['extname'](_0x561ef5[_0xa397('0x5a')]['filename'])),_0x357df0[_0xa397('0x52')]));logger[_0xa397('0x5f')](_0xa397('0x60'),_0x1cfd7f);logger['info'](_0xa397('0x61'),_0x5253aa);try{fs[_0xa397('0x62')](_0x1cfd7f,parseInt(_0xa397('0x63'),0x8));var _0x2cea77=sox[_0xa397('0x64')](_0x1cfd7f,_0x5253aa,{'sampleRate':0x1f40,'format':_0xa397('0x65'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2cea77['on']('error',function(_0xed3f4){fs[_0xa397('0x66')](_0x1cfd7f);_0x3cac18['status'](0x1f4)[_0xa397('0x67')](_0xed3f4);});_0x2cea77['on'](_0xa397('0x68'),function(_0x52d78c){_0x357df0[_0xa397('0x69')]=isNaN(_0x52d78c[_0xa397('0x6a')])?null:_0x52d78c['duration']*0x3e8;_0x357df0[_0xa397('0x6b')]=isNaN(_0x52d78c[_0xa397('0x6c')])?null:_0x52d78c[_0xa397('0x6c')];_0x357df0[_0xa397('0x6d')]=isNaN(_0x52d78c[_0xa397('0x6e')])?null:_0x52d78c[_0xa397('0x6e')];_0x357df0[_0xa397('0x6f')]=isNaN(_0x52d78c[_0xa397('0x70')])?null:_0x52d78c[_0xa397('0x70')];_0x357df0['original_sampleRate']=isNaN(_0x52d78c[_0xa397('0x71')])?null:_0x52d78c['sampleRate'];});_0x2cea77['on']('dest',function(_0xd9b544){_0x357df0[_0xa397('0x72')]=isNaN(_0xd9b544[_0xa397('0x6a')])?null:_0xd9b544['duration']*0x3e8;_0x357df0['converted_sampleCount']=isNaN(_0xd9b544[_0xa397('0x6c')])?null:_0xd9b544[_0xa397('0x6c')];_0x357df0[_0xa397('0x73')]=isNaN(_0xd9b544[_0xa397('0x6e')])?null:_0xd9b544[_0xa397('0x6e')];_0x357df0['converted_bitRate']=isNaN(_0xd9b544['bitRate'])?null:_0xd9b544[_0xa397('0x70')];_0x357df0['converted_sampleRate']=isNaN(_0xd9b544['sampleRate'])?null:_0xd9b544[_0xa397('0x71')];});_0x2cea77['on'](_0xa397('0x2c'),function(){fs[_0xa397('0x62')](_0x5253aa,parseInt(_0xa397('0x63'),0x8));return db[_0xa397('0x45')][_0xa397('0x74')](_0x357df0)['then'](function(_0x2c2873){var _0x27f86d={'role':_0x561ef5[_0xa397('0x75')][_0xa397('0x76')],'userProfileId':_0x561ef5[_0xa397('0x75')][_0xa397('0x77')]};if(!_0x27f86d)throw new Error(_0xa397('0x78'));if(_0x27f86d['role']==='user'){var _0xdcdec1=_0x2c2873[_0xa397('0x29')]({'plain':!![]});return db[_0xa397('0x79')][_0xa397('0x4c')]({'where':{'name':_0xa397('0x2a'),'userProfileId':_0x27f86d[_0xa397('0x77')]},'raw':!![]})[_0xa397('0x28')](function(_0x84a0ea){if(_0x84a0ea&&_0x84a0ea[_0xa397('0x7a')]===0x0){return db['UserProfileResource'][_0xa397('0x74')]({'name':_0xdcdec1[_0xa397('0x2f')],'resourceId':_0xdcdec1['id'],'type':_0x84a0ea[_0xa397('0x2f')],'sectionId':_0x84a0ea['id']},{})[_0xa397('0x28')](function(){return _0x2c2873;});}else{return _0x2c2873;}})[_0xa397('0x49')](function(_0x8aac8c){logger[_0xa397('0x2d')](_0xa397('0x7b'),_0x8aac8c);throw _0x8aac8c;});}return _0x2c2873;})['then'](respondWithResult(_0x3cac18,null))[_0xa397('0x49')](handleError(_0x3cac18,null));});_0x2cea77[_0xa397('0x7c')]();}catch(_0xcb1750){_0x3cac18['status'](0x1f4)[_0xa397('0x67')](_0xcb1750);}};exports[_0xa397('0x7d')]=function(_0x56f04a,_0x55f00e,_0x28a3cf){return db[_0xa397('0x45')]['find']({'where':{'id':_0x56f04a[_0xa397('0x4a')]['id']}})['then'](handleEntityNotFound(_0x55f00e,null))[_0xa397('0x28')](saveUpdates(_[_0xa397('0x7e')](_0x56f04a[_0xa397('0x75')],[_0xa397('0x2f'),'description']),null))['then'](respondWithResult(_0x55f00e,null))['catch'](handleError(_0x55f00e,null));};exports['delete']=function(_0x4f2898,_0xd40775,_0x2ca664){return db[_0xa397('0x45')][_0xa397('0x4c')]({'where':{'id':_0x4f2898[_0xa397('0x4a')]['id']}})[_0xa397('0x28')](function(_0x3b7c3e){if(_0x3b7c3e){return _0x3b7c3e[_0xa397('0x2b')]();}})[_0xa397('0x28')](function(_0x139470){var _0x4fb630=path[_0xa397('0x50')](config['root'],_0xa397('0x5d'),util[_0xa397('0x57')](_0xa397('0x58'),_0x139470[_0xa397('0x4e')],_0x139470[_0xa397('0x7f')]));var _0x5c5f1b=path[_0xa397('0x50')](config['root'],'server/files/sounds/converted',util[_0xa397('0x57')](_0xa397('0x58'),_0x139470[_0xa397('0x4e')],_0x139470[_0xa397('0x52')]));fs[_0xa397('0x66')](_0x4fb630);fs[_0xa397('0x66')](_0x5c5f1b);return _0x139470;})['then'](function(_0x1232e9){if(_0x1232e9){return _0xd40775[_0xa397('0x1e')](0xcc)[_0xa397('0x2c')]();}})[_0xa397('0x28')](handleEntityNotFound(_0xd40775,null))[_0xa397('0x49')](handleError(_0xd40775,null));}; \ No newline at end of file +var _0x6b57=['original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','UserProfileResource','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','send','src'];(function(_0x367753,_0x413c8d){var _0x4e5321=function(_0x21699f){while(--_0x21699f){_0x367753['push'](_0x367753['shift']());}};_0x4e5321(++_0x413c8d);}(_0x6b57,0x93));var _0x76b5=function(_0x1e65bf,_0x1fdc3c){_0x1e65bf=_0x1e65bf-0x0;var _0x852b7a=_0x6b57[_0x1e65bf];return _0x852b7a;};'use strict';var emlformat=require(_0x76b5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x76b5('0x1'));var moment=require('moment');var BPromise=require(_0x76b5('0x2'));var Mustache=require(_0x76b5('0x3'));var util=require(_0x76b5('0x4'));var path=require(_0x76b5('0x5'));var sox=require(_0x76b5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76b5('0x7'));var _=require('lodash');var squel=require(_0x76b5('0x8'));var crypto=require('crypto');var jsforce=require(_0x76b5('0x9'));var deskjs=require(_0x76b5('0xa'));var toCsv=require('to-csv');var querystring=require(_0x76b5('0xb'));var Papa=require(_0x76b5('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76b5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x76b5('0xe'))(_0x76b5('0xf'));var utils=require(_0x76b5('0x10'));var config=require(_0x76b5('0x11'));var licenseUtil=require(_0x76b5('0x12'));var db=require(_0x76b5('0x13'))['db'];function respondWithStatusCode(_0x619bab,_0x4c2817){_0x4c2817=_0x4c2817||0xcc;return function(_0x67c892){if(_0x67c892){return _0x619bab['sendStatus'](_0x4c2817);}return _0x619bab[_0x76b5('0x14')](_0x4c2817)[_0x76b5('0x15')]();};}function respondWithResult(_0x2f3d67,_0x3a4b79){_0x3a4b79=_0x3a4b79||0xc8;return function(_0x563299){if(_0x563299){return _0x2f3d67['status'](_0x3a4b79)[_0x76b5('0x16')](_0x563299);}};}function respondWithFilteredResult(_0x2536b6,_0x26d800){return function(_0x5e03fa){if(_0x5e03fa){var _0x21519e=typeof _0x26d800['offset']===_0x76b5('0x17')&&typeof _0x26d800[_0x76b5('0x18')]===_0x76b5('0x17');var _0x49627a=_0x5e03fa[_0x76b5('0x19')];var _0x1aa35e=_0x21519e?0x0:_0x26d800[_0x76b5('0x1a')];var _0x567ebf=_0x21519e?_0x5e03fa[_0x76b5('0x19')]:_0x26d800['offset']+_0x26d800[_0x76b5('0x18')];var _0x32f42c;if(_0x567ebf>=_0x49627a){_0x567ebf=_0x49627a;_0x32f42c=0xc8;}else{_0x32f42c=0xce;}_0x2536b6[_0x76b5('0x14')](_0x32f42c);return _0x2536b6[_0x76b5('0x1b')](_0x76b5('0x1c'),_0x1aa35e+'-'+_0x567ebf+'/'+_0x49627a)[_0x76b5('0x16')](_0x5e03fa);}return null;};}function patchUpdates(_0x362ab4){return function(_0x2346ed){try{jsonpatch[_0x76b5('0x1d')](_0x2346ed,_0x362ab4,!![]);}catch(_0x22d58a){return BPromise[_0x76b5('0x1e')](_0x22d58a);}return _0x2346ed['save']();};}function saveUpdates(_0x1a2aef,_0xdc9163){return function(_0x75b8e5){if(_0x75b8e5){return _0x75b8e5[_0x76b5('0x1f')](_0x1a2aef)[_0x76b5('0x20')](function(_0x51501a){return _0x51501a;});}return null;};}function removeEntity(_0x28450d,_0x476851){return function(_0x43bc50){if(_0x43bc50){return _0x43bc50[_0x76b5('0x21')]()['then'](function(){var _0x18eebe=_0x43bc50[_0x76b5('0x22')]({'plain':!![]});var _0x2aa2b2='Sounds';return db['UserProfileResource'][_0x76b5('0x21')]({'where':{'type':_0x2aa2b2,'resourceId':_0x18eebe['id']}})[_0x76b5('0x20')](function(){return _0x43bc50;});})[_0x76b5('0x20')](function(){_0x28450d[_0x76b5('0x14')](0xcc)[_0x76b5('0x15')]();});}};}function handleEntityNotFound(_0x56415b,_0x3cc915){return function(_0x359800){if(!_0x359800){_0x56415b['sendStatus'](0x194);}return _0x359800;};}function handleError(_0x4f4afb,_0x4aec6c){_0x4aec6c=_0x4aec6c||0x1f4;return function(_0x210a45){logger[_0x76b5('0x23')](_0x210a45[_0x76b5('0x24')]);if(_0x210a45[_0x76b5('0x25')]){delete _0x210a45[_0x76b5('0x25')];}_0x4f4afb[_0x76b5('0x14')](_0x4aec6c)['send'](_0x210a45);};}exports['index']=function(_0x3bcf44,_0x22f9c3){var _0x871cd5={},_0x25637c={},_0x5d0a1a={'count':0x0,'rows':[]};var _0x4a7104=_[_0x76b5('0x26')](db[_0x76b5('0x27')][_0x76b5('0x28')],function(_0x277a9f){return{'name':_0x277a9f[_0x76b5('0x29')],'type':_0x277a9f[_0x76b5('0x2a')][_0x76b5('0x2b')]};});_0x25637c[_0x76b5('0x2c')]=_[_0x76b5('0x26')](_0x4a7104,_0x76b5('0x25'));_0x25637c['query']=_[_0x76b5('0x2d')](_0x3bcf44[_0x76b5('0x2e')]);_0x25637c[_0x76b5('0x2f')]=_[_0x76b5('0x30')](_0x25637c[_0x76b5('0x2c')],_0x25637c[_0x76b5('0x2e')]);_0x871cd5[_0x76b5('0x31')]=_[_0x76b5('0x30')](_0x25637c[_0x76b5('0x2c')],qs[_0x76b5('0x32')](_0x3bcf44[_0x76b5('0x2e')][_0x76b5('0x32')]));_0x871cd5['attributes']=_0x871cd5[_0x76b5('0x31')][_0x76b5('0x33')]?_0x871cd5[_0x76b5('0x31')]:_0x25637c[_0x76b5('0x2c')];if(!_0x3bcf44['query'][_0x76b5('0x34')]('nolimit')){_0x871cd5['limit']=qs[_0x76b5('0x18')](_0x3bcf44[_0x76b5('0x2e')][_0x76b5('0x18')]);_0x871cd5[_0x76b5('0x1a')]=qs[_0x76b5('0x1a')](_0x3bcf44['query']['offset']);}_0x871cd5[_0x76b5('0x35')]=qs['sort'](_0x3bcf44[_0x76b5('0x2e')][_0x76b5('0x36')]);_0x871cd5[_0x76b5('0x37')]=qs[_0x76b5('0x2f')](_[_0x76b5('0x38')](_0x3bcf44[_0x76b5('0x2e')],_0x25637c[_0x76b5('0x2f')]),_0x4a7104);if(_0x3bcf44[_0x76b5('0x2e')]['filter']){_0x871cd5[_0x76b5('0x37')]=_[_0x76b5('0x39')](_0x871cd5[_0x76b5('0x37')],{'$or':_[_0x76b5('0x26')](_0x4a7104,function(_0x30ab7b){if(_0x30ab7b[_0x76b5('0x2a')]!==_0x76b5('0x3a')){var _0x394c46={};_0x394c46[_0x30ab7b[_0x76b5('0x25')]]={'$like':'%'+_0x3bcf44[_0x76b5('0x2e')]['filter']+'%'};return _0x394c46;}})});}_0x871cd5=_['merge']({},_0x871cd5,_0x3bcf44[_0x76b5('0x3b')]);var _0x5520b3={'where':_0x871cd5[_0x76b5('0x37')]};return db[_0x76b5('0x27')][_0x76b5('0x19')](_0x5520b3)[_0x76b5('0x20')](function(_0x20d5b3){_0x5d0a1a['count']=_0x20d5b3;if(_0x3bcf44['query'][_0x76b5('0x3c')]){_0x871cd5['include']=[{'all':!![]}];}return db[_0x76b5('0x27')][_0x76b5('0x3d')](_0x871cd5);})[_0x76b5('0x20')](function(_0x43c12a){_0x5d0a1a[_0x76b5('0x3e')]=_0x43c12a;return _0x5d0a1a;})[_0x76b5('0x20')](respondWithFilteredResult(_0x22f9c3,_0x871cd5))[_0x76b5('0x3f')](handleError(_0x22f9c3,null));};exports['show']=function(_0x4bf9f5,_0x1d76d8){var _0x1732fc={'raw':!![],'where':{'id':_0x4bf9f5[_0x76b5('0x40')]['id']}},_0x20a2f8={};_0x20a2f8[_0x76b5('0x2c')]=_[_0x76b5('0x2d')](db[_0x76b5('0x27')][_0x76b5('0x28')]);_0x20a2f8[_0x76b5('0x2e')]=_['keys'](_0x4bf9f5['query']);_0x20a2f8[_0x76b5('0x2f')]=_['intersection'](_0x20a2f8[_0x76b5('0x2c')],_0x20a2f8[_0x76b5('0x2e')]);_0x1732fc[_0x76b5('0x31')]=_[_0x76b5('0x30')](_0x20a2f8[_0x76b5('0x2c')],qs[_0x76b5('0x32')](_0x4bf9f5['query'][_0x76b5('0x32')]));_0x1732fc[_0x76b5('0x31')]=_0x1732fc[_0x76b5('0x31')][_0x76b5('0x33')]?_0x1732fc[_0x76b5('0x31')]:_0x20a2f8[_0x76b5('0x2c')];if(_0x4bf9f5['query'][_0x76b5('0x3c')]){_0x1732fc[_0x76b5('0x41')]=[{'all':!![]}];}_0x1732fc=_[_0x76b5('0x39')]({},_0x1732fc,_0x4bf9f5[_0x76b5('0x3b')]);return db[_0x76b5('0x27')]['find'](_0x1732fc)['then'](handleEntityNotFound(_0x1d76d8,null))[_0x76b5('0x20')](respondWithResult(_0x1d76d8,null))[_0x76b5('0x3f')](handleError(_0x1d76d8,null));};exports[_0x76b5('0x42')]=function(_0x40961e,_0x2fc417,_0x5a604b){return db[_0x76b5('0x27')]['find']({'where':{'id':_0x40961e[_0x76b5('0x40')]['id']},'attributes':[_0x76b5('0x25'),_0x76b5('0x43'),_0x76b5('0x44')],'raw':!![]})['then'](handleEntityNotFound(_0x2fc417,null))[_0x76b5('0x20')](function(_0x8febf9){if(_0x8febf9){if(!fs['existsSync'](path[_0x76b5('0x45')](config[_0x76b5('0x46')],_0x76b5('0x47'),_0x8febf9['save_name']+'.'+_0x8febf9[_0x76b5('0x44')]))){throw new db[(_0x76b5('0x48'))][(_0x76b5('0x49'))](_0x76b5('0x4a'));}return _0x2fc417['download'](path['join'](config[_0x76b5('0x46')],_0x76b5('0x47'),util[_0x76b5('0x4b')]('%s.%s',_0x8febf9[_0x76b5('0x43')],_0x8febf9[_0x76b5('0x44')])),util[_0x76b5('0x4b')](_0x76b5('0x4c'),_0x8febf9['name'],_0x8febf9[_0x76b5('0x44')]));}return null;})[_0x76b5('0x3f')](handleError(_0x2fc417,null));};exports[_0x76b5('0x4d')]=function(_0x5cc404,_0x159fe3,_0x15be49){var _0x36027d={'name':path[_0x76b5('0x4e')](_0x5cc404[_0x76b5('0x4f')][_0x76b5('0x50')],path['extname'](_0x5cc404[_0x76b5('0x4f')][_0x76b5('0x50')])),'save_name':path['basename'](_0x5cc404[_0x76b5('0x4f')][_0x76b5('0x51')],path[_0x76b5('0x52')](_0x5cc404['file'][_0x76b5('0x51')])),'original_format':path['extname'](_0x5cc404['file'][_0x76b5('0x50')])[_0x76b5('0x53')](0x1),'converted_format':_0x76b5('0x54')};var _0x458778=path[_0x76b5('0x45')](config['root'],'server/files/sounds/original',_0x5cc404['file'][_0x76b5('0x51')]);var _0xeedd89=path[_0x76b5('0x45')](config['root'],_0x76b5('0x47'),util[_0x76b5('0x4b')](_0x76b5('0x4c'),path[_0x76b5('0x4e')](_0x5cc404[_0x76b5('0x4f')]['filename'],path[_0x76b5('0x52')](_0x5cc404[_0x76b5('0x4f')][_0x76b5('0x51')])),_0x36027d['converted_format']));logger[_0x76b5('0x55')](_0x76b5('0x56'),_0x458778);logger['info'](_0x76b5('0x57'),_0xeedd89);try{fs['chmodSync'](_0x458778,parseInt('0777',0x8));var _0x2fcf9e=sox[_0x76b5('0x58')](_0x458778,_0xeedd89,{'sampleRate':0x1f40,'format':_0x76b5('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fcf9e['on'](_0x76b5('0x23'),function(_0x298a1){fs['unlinkSync'](_0x458778);_0x159fe3['status'](0x1f4)[_0x76b5('0x59')](_0x298a1);});_0x2fcf9e['on'](_0x76b5('0x5a'),function(_0x492bf3){_0x36027d[_0x76b5('0x5b')]=isNaN(_0x492bf3[_0x76b5('0x5c')])?null:_0x492bf3['duration']*0x3e8;_0x36027d['original_sampleCount']=isNaN(_0x492bf3[_0x76b5('0x5d')])?null:_0x492bf3[_0x76b5('0x5d')];_0x36027d[_0x76b5('0x5e')]=isNaN(_0x492bf3[_0x76b5('0x5f')])?null:_0x492bf3[_0x76b5('0x5f')];_0x36027d['original_bitRate']=isNaN(_0x492bf3[_0x76b5('0x60')])?null:_0x492bf3[_0x76b5('0x60')];_0x36027d[_0x76b5('0x61')]=isNaN(_0x492bf3[_0x76b5('0x62')])?null:_0x492bf3[_0x76b5('0x62')];});_0x2fcf9e['on'](_0x76b5('0x63'),function(_0x7faa64){_0x36027d[_0x76b5('0x64')]=isNaN(_0x7faa64[_0x76b5('0x5c')])?null:_0x7faa64[_0x76b5('0x5c')]*0x3e8;_0x36027d[_0x76b5('0x65')]=isNaN(_0x7faa64['sampleCount'])?null:_0x7faa64[_0x76b5('0x5d')];_0x36027d[_0x76b5('0x66')]=isNaN(_0x7faa64['channelCount'])?null:_0x7faa64[_0x76b5('0x5f')];_0x36027d[_0x76b5('0x67')]=isNaN(_0x7faa64[_0x76b5('0x60')])?null:_0x7faa64[_0x76b5('0x60')];_0x36027d[_0x76b5('0x68')]=isNaN(_0x7faa64['sampleRate'])?null:_0x7faa64[_0x76b5('0x62')];});_0x2fcf9e['on'](_0x76b5('0x15'),function(){fs['chmodSync'](_0xeedd89,parseInt(_0x76b5('0x69'),0x8));return db[_0x76b5('0x27')][_0x76b5('0x4d')](_0x36027d)[_0x76b5('0x20')](function(_0x2deb5a){var _0x7cc8ae={'role':_0x5cc404[_0x76b5('0x6a')][_0x76b5('0x6b')],'userProfileId':_0x5cc404[_0x76b5('0x6a')][_0x76b5('0x6c')]};if(!_0x7cc8ae)throw new Error(_0x76b5('0x6d'));if(_0x7cc8ae['role']===_0x76b5('0x6e')){var _0x6f150=_0x2deb5a[_0x76b5('0x22')]({'plain':!![]});return db[_0x76b5('0x6f')][_0x76b5('0x70')]({'where':{'name':'Sounds','userProfileId':_0x7cc8ae['userProfileId']},'raw':!![]})[_0x76b5('0x20')](function(_0x88f834){if(_0x88f834&&_0x88f834[_0x76b5('0x71')]===0x0){return db[_0x76b5('0x72')][_0x76b5('0x4d')]({'name':_0x6f150['name'],'resourceId':_0x6f150['id'],'type':_0x88f834[_0x76b5('0x25')],'sectionId':_0x88f834['id']},{})[_0x76b5('0x20')](function(){return _0x2deb5a;});}else{return _0x2deb5a;}})[_0x76b5('0x3f')](function(_0x272015){logger[_0x76b5('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x272015);throw _0x272015;});}return _0x2deb5a;})['then'](respondWithResult(_0x159fe3,null))['catch'](handleError(_0x159fe3,null));});_0x2fcf9e['start']();}catch(_0x446053){_0x159fe3['status'](0x1f4)[_0x76b5('0x59')](_0x446053);}};exports[_0x76b5('0x1f')]=function(_0x4c663f,_0xcc214a,_0x1abacd){return db[_0x76b5('0x27')][_0x76b5('0x70')]({'where':{'id':_0x4c663f['params']['id']}})[_0x76b5('0x20')](handleEntityNotFound(_0xcc214a,null))['then'](saveUpdates(_['pick'](_0x4c663f[_0x76b5('0x6a')],[_0x76b5('0x25'),'description']),null))['then'](respondWithResult(_0xcc214a,null))[_0x76b5('0x3f')](handleError(_0xcc214a,null));};exports[_0x76b5('0x73')]=function(_0x5c0dcb,_0x95f7c4,_0x456147){return db[_0x76b5('0x27')][_0x76b5('0x70')]({'where':{'id':_0x5c0dcb[_0x76b5('0x40')]['id']}})[_0x76b5('0x20')](function(_0xa9ee9a){if(_0xa9ee9a){return _0xa9ee9a['destroy']();}})[_0x76b5('0x20')](function(_0x5c8913){var _0x438d84=path[_0x76b5('0x45')](config[_0x76b5('0x46')],_0x76b5('0x74'),util[_0x76b5('0x4b')](_0x76b5('0x4c'),_0x5c8913[_0x76b5('0x43')],_0x5c8913[_0x76b5('0x75')]));var _0x1ce658=path[_0x76b5('0x45')](config[_0x76b5('0x46')],_0x76b5('0x47'),util['format'](_0x76b5('0x4c'),_0x5c8913['save_name'],_0x5c8913[_0x76b5('0x44')]));fs['unlinkSync'](_0x438d84);fs[_0x76b5('0x76')](_0x1ce658);return _0x5c8913;})[_0x76b5('0x20')](function(_0x15b892){if(_0x15b892){return _0x95f7c4['status'](0xcc)['end']();}})[_0x76b5('0x20')](handleEntityNotFound(_0x95f7c4,null))[_0x76b5('0x3f')](handleError(_0x95f7c4,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2f445ba..9aedd80 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 _0x94a9=['define','Sound','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x94a9,0x1b2));var _0x994a=function(_0x18af55,_0x4b98aa){_0x18af55=_0x18af55-0x0;var _0x3d547e=_0x94a9[_0x18af55];return _0x3d547e;};'use strict';var _=require(_0x994a('0x0'));var util=require('util');var logger=require(_0x994a('0x1'))(_0x994a('0x2'));var moment=require('moment');var BPromise=require(_0x994a('0x3'));var rp=require(_0x994a('0x4'));var fs=require('fs');var path=require(_0x994a('0x5'));var rimraf=require(_0x994a('0x6'));var config=require(_0x994a('0x7'));var attributes=require(_0x994a('0x8'));module[_0x994a('0x9')]=function(_0x3cb9e5,_0x1985c7){return _0x3cb9e5[_0x994a('0xa')](_0x994a('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12d=['./sound.attributes','exports','define','tools_sounds','lodash','util','moment','bluebird','path','rimraf'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xa12d,0x180));var _0xda12=function(_0x1a0d00,_0x2a353a){_0x1a0d00=_0x1a0d00-0x0;var _0x44d3bd=_0xa12d[_0x1a0d00];return _0x44d3bd;};'use strict';var _=require(_0xda12('0x0'));var util=require(_0xda12('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xda12('0x2'));var BPromise=require(_0xda12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda12('0x4'));var rimraf=require(_0xda12('0x5'));var config=require('../../config/environment');var attributes=require(_0xda12('0x6'));module[_0xda12('0x7')]=function(_0xcd758d,_0x31f113){return _0xcd758d[_0xda12('0x8')]('Sound',attributes,{'tableName':_0xda12('0x9'),'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 2878ff2..28432d3 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 _0xe757=['lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','request\x20sent','result','catch','find','options','raw','where','attributes','include','map','model','ShowSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe757,0x1c2));var _0x7e75=function(_0x2ed88f,_0x5bc5ae){_0x2ed88f=_0x2ed88f-0x0;var _0x17ca96=_0xe757[_0x2ed88f];return _0x17ca96;};'use strict';var _=require(_0x7e75('0x0'));var util=require(_0x7e75('0x1'));var moment=require(_0x7e75('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e75('0x3'));var fs=require('fs');var Redis=require(_0x7e75('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e75('0x5'))(_0x7e75('0x6'));var config=require(_0x7e75('0x7'));var jayson=require(_0x7e75('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50ad5a,_0x4a39c5,_0x1b9551){return new BPromise(function(_0x1bfe6a,_0x3c2fce){return client[_0x7e75('0x9')](_0x50ad5a,_0x1b9551)[_0x7e75('0xa')](function(_0x2ca52f){logger[_0x7e75('0xb')]('Sound,\x20%s,\x20%s',_0x4a39c5,'request\x20sent');logger[_0x7e75('0xc')](_0x7e75('0xd'),_0x4a39c5,'request\x20sent',JSON['stringify'](_0x2ca52f));if(_0x2ca52f['error']){if(_0x2ca52f[_0x7e75('0xe')][_0x7e75('0xf')]===0x1f4){logger['error'](_0x7e75('0x10'),_0x4a39c5,_0x2ca52f[_0x7e75('0xe')][_0x7e75('0x11')]);return _0x3c2fce(_0x2ca52f[_0x7e75('0xe')]['message']);}logger['error'](_0x7e75('0x10'),_0x4a39c5,_0x2ca52f['error'][_0x7e75('0x11')]);return _0x1bfe6a(_0x2ca52f[_0x7e75('0xe')]['message']);}else{logger[_0x7e75('0xb')](_0x7e75('0x10'),_0x4a39c5,_0x7e75('0x12'));_0x1bfe6a(_0x2ca52f[_0x7e75('0x13')]['message']);}})[_0x7e75('0x14')](function(_0x58d571){logger[_0x7e75('0xe')](_0x7e75('0x10'),_0x4a39c5,_0x58d571);_0x3c2fce(_0x58d571);});});}exports['ShowSound']=function(_0x40c803){var _0xd62e60=this;return new Promise(function(_0xc105e4,_0x4cb775){return db['Sound'][_0x7e75('0x15')]({'raw':_0x40c803[_0x7e75('0x16')]?_0x40c803[_0x7e75('0x16')][_0x7e75('0x17')]===undefined?!![]:![]:!![],'where':_0x40c803[_0x7e75('0x16')]?_0x40c803['options'][_0x7e75('0x18')]||null:null,'attributes':_0x40c803['options']?_0x40c803[_0x7e75('0x16')][_0x7e75('0x19')]||null:null,'include':_0x40c803[_0x7e75('0x16')]?_0x40c803[_0x7e75('0x16')][_0x7e75('0x1a')]?_[_0x7e75('0x1b')](_0x40c803[_0x7e75('0x16')][_0x7e75('0x1a')],function(_0x2448d4){return{'model':db[_0x2448d4[_0x7e75('0x1c')]],'as':_0x2448d4['as'],'attributes':_0x2448d4[_0x7e75('0x19')],'include':_0x2448d4[_0x7e75('0x1a')]?_[_0x7e75('0x1b')](_0x2448d4[_0x7e75('0x1a')],function(_0x398b2c){return{'model':db[_0x398b2c['model']],'as':_0x398b2c['as'],'attributes':_0x398b2c['attributes'],'include':_0x398b2c[_0x7e75('0x1a')]?_[_0x7e75('0x1b')](_0x398b2c[_0x7e75('0x1a')],function(_0x278323){return{'model':db[_0x278323[_0x7e75('0x1c')]],'as':_0x278323['as'],'attributes':_0x278323[_0x7e75('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7e75('0xa')](function(_0x10ba60){logger[_0x7e75('0xb')](_0x7e75('0x1d'),_0x40c803);logger[_0x7e75('0xc')](_0x7e75('0x1d'),_0x40c803,JSON['stringify'](_0x10ba60));_0xc105e4(_0x10ba60);})[_0x7e75('0x14')](function(_0x110943){logger[_0x7e75('0xe')](_0x7e75('0x1d'),_0x110943['message'],_0x40c803);_0x4cb775(_0xd62e60[_0x7e75('0xe')](0x1f4,_0x110943[_0x7e75('0x11')]));});});}; \ No newline at end of file +var _0xcc5b=['catch','Sound','options','raw','where','attributes','include','map','model','ShowSound','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0xcc5b,0x1cc));var _0xbcc5=function(_0x40ec29,_0x167db0){_0x40ec29=_0x40ec29-0x0;var _0x470a81=_0xcc5b[_0x40ec29];return _0x470a81;};'use strict';var _=require('lodash');var util=require(_0xbcc5('0x0'));var moment=require(_0xbcc5('0x1'));var BPromise=require(_0xbcc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcc5('0x4'));var logger=require(_0xbcc5('0x5'))(_0xbcc5('0x6'));var config=require('../../config/environment');var jayson=require(_0xbcc5('0x7'));var client=jayson[_0xbcc5('0x8')][_0xbcc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x322a08,_0x359491,_0x37d750){return new BPromise(function(_0x2881f6,_0x4eb2a0){return client['request'](_0x322a08,_0x37d750)[_0xbcc5('0xa')](function(_0x386b0a){logger[_0xbcc5('0xb')](_0xbcc5('0xc'),_0x359491,_0xbcc5('0xd'));logger[_0xbcc5('0xe')](_0xbcc5('0xf'),_0x359491,_0xbcc5('0xd'),JSON[_0xbcc5('0x10')](_0x386b0a));if(_0x386b0a[_0xbcc5('0x11')]){if(_0x386b0a[_0xbcc5('0x11')][_0xbcc5('0x12')]===0x1f4){logger[_0xbcc5('0x11')](_0xbcc5('0xc'),_0x359491,_0x386b0a['error'][_0xbcc5('0x13')]);return _0x4eb2a0(_0x386b0a['error']['message']);}logger[_0xbcc5('0x11')]('Sound,\x20%s,\x20%s',_0x359491,_0x386b0a[_0xbcc5('0x11')][_0xbcc5('0x13')]);return _0x2881f6(_0x386b0a[_0xbcc5('0x11')][_0xbcc5('0x13')]);}else{logger[_0xbcc5('0xb')]('Sound,\x20%s,\x20%s',_0x359491,_0xbcc5('0xd'));_0x2881f6(_0x386b0a['result']['message']);}})[_0xbcc5('0x14')](function(_0x427972){logger[_0xbcc5('0x11')](_0xbcc5('0xc'),_0x359491,_0x427972);_0x4eb2a0(_0x427972);});});}exports['ShowSound']=function(_0x173a00){var _0x58f172=this;return new Promise(function(_0x142e3c,_0x2552a6){return db[_0xbcc5('0x15')]['find']({'raw':_0x173a00['options']?_0x173a00[_0xbcc5('0x16')][_0xbcc5('0x17')]===undefined?!![]:![]:!![],'where':_0x173a00[_0xbcc5('0x16')]?_0x173a00[_0xbcc5('0x16')][_0xbcc5('0x18')]||null:null,'attributes':_0x173a00[_0xbcc5('0x16')]?_0x173a00[_0xbcc5('0x16')][_0xbcc5('0x19')]||null:null,'include':_0x173a00['options']?_0x173a00[_0xbcc5('0x16')][_0xbcc5('0x1a')]?_[_0xbcc5('0x1b')](_0x173a00[_0xbcc5('0x16')]['include'],function(_0x2dd369){return{'model':db[_0x2dd369['model']],'as':_0x2dd369['as'],'attributes':_0x2dd369['attributes'],'include':_0x2dd369[_0xbcc5('0x1a')]?_[_0xbcc5('0x1b')](_0x2dd369[_0xbcc5('0x1a')],function(_0x563140){return{'model':db[_0x563140[_0xbcc5('0x1c')]],'as':_0x563140['as'],'attributes':_0x563140[_0xbcc5('0x19')],'include':_0x563140[_0xbcc5('0x1a')]?_[_0xbcc5('0x1b')](_0x563140[_0xbcc5('0x1a')],function(_0x354f52){return{'model':db[_0x354f52['model']],'as':_0x354f52['as'],'attributes':_0x354f52[_0xbcc5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbcc5('0xa')](function(_0x1b10ac){logger[_0xbcc5('0xb')](_0xbcc5('0x1d'),_0x173a00);logger[_0xbcc5('0xe')](_0xbcc5('0x1d'),_0x173a00,JSON[_0xbcc5('0x10')](_0x1b10ac));_0x142e3c(_0x1b10ac);})[_0xbcc5('0x14')](function(_0x244b22){logger['error'](_0xbcc5('0x1d'),_0x244b22['message'],_0x173a00);_0x2552a6(_0x58f172[_0xbcc5('0x11')](0x1f4,_0x244b22[_0xbcc5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ae8aac8..0429a40 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5041c9,_0x3bc1a5){_0x5041c9=_0x5041c9-0x0;var _0x409feb=_0x9ffd[_0x5041c9];return _0x409feb;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x166e33,_0x127e77){var _0x1a2409=function(_0x48edd3){while(--_0x48edd3){_0x166e33['push'](_0x166e33['shift']());}};_0x1a2409(++_0x127e77);}(_0x2032,0xd9));var _0x2203=function(_0x5316b1,_0x158ec6){_0x5316b1=_0x5316b1-0x0;var _0x4081ad=_0x2032[_0x5316b1];return _0x4081ad;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 373b659..06a12c1 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 _0xa569=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0xe02346,_0x5e4eb7){var _0x4a6a6e=function(_0x28cbf1){while(--_0x28cbf1){_0xe02346['push'](_0xe02346['shift']());}};_0x4a6a6e(++_0x5e4eb7);}(_0xa569,0x15e));var _0x9a56=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xa569[_0x5beda8];return _0x2aa042;};'use strict';var Sequelize=require(_0x9a56('0x0'));module[_0x9a56('0x1')]={'uniqueid':{'type':Sequelize[_0x9a56('0x2')]},'body':{'type':Sequelize[_0x9a56('0x3')](_0x9a56('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9a56('0x5')]('in',_0x9a56('0x6')),'defaultValue':_0x9a56('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9a56('0x3')]}}; \ No newline at end of file +var _0x89d3=['ENUM','out','sequelize','STRING','TEXT','medium'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x89d3,0x17c));var _0x389d=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x89d3[_0x49052b];return _0x48c045;};'use strict';var Sequelize=require(_0x389d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x389d('0x1')]},'body':{'type':Sequelize[_0x389d('0x2')](_0x389d('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x389d('0x4')]('in','out'),'defaultValue':_0x389d('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x389d('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 192c55b..7b7b4d2 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 _0xf99a=['filter','options','where','catch','show','keys','includeAll','include','create','body','destroy','find','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','VIRTUAL'];(function(_0x59d723,_0x36f2ea){var _0x12b532=function(_0x5621f7){while(--_0x5621f7){_0x59d723['push'](_0x59d723['shift']());}};_0x12b532(++_0x36f2ea);}(_0xf99a,0x166));var _0xaf99=function(_0x238ce0,_0x40bdc7){_0x238ce0=_0x238ce0-0x0;var _0x5bf41e=_0xf99a[_0x238ce0];return _0x5bf41e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf99('0x0'));var jsonpatch=require(_0xaf99('0x1'));var rp=require('request-promise');var moment=require(_0xaf99('0x2'));var BPromise=require(_0xaf99('0x3'));var Mustache=require(_0xaf99('0x4'));var util=require(_0xaf99('0x5'));var path=require(_0xaf99('0x6'));var sox=require('sox');var csv=require(_0xaf99('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf99('0x8'));var _=require(_0xaf99('0x9'));var squel=require(_0xaf99('0xa'));var crypto=require(_0xaf99('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaf99('0xc'));var toCsv=require(_0xaf99('0x7'));var querystring=require(_0xaf99('0xd'));var Papa=require(_0xaf99('0xe'));var Redis=require('ioredis');var authService=require(_0xaf99('0xf'));var qs=require(_0xaf99('0x10'));var as=require(_0xaf99('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaf99('0x12'));var utils=require(_0xaf99('0x13'));var config=require(_0xaf99('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf99('0x15'))['db'];function respondWithStatusCode(_0x3edd06,_0x1eebaa){_0x1eebaa=_0x1eebaa||0xcc;return function(_0x511d1b){if(_0x511d1b){return _0x3edd06[_0xaf99('0x16')](_0x1eebaa);}return _0x3edd06[_0xaf99('0x17')](_0x1eebaa)[_0xaf99('0x18')]();};}function respondWithResult(_0x26ed70,_0x31280d){_0x31280d=_0x31280d||0xc8;return function(_0x154b00){if(_0x154b00){return _0x26ed70[_0xaf99('0x17')](_0x31280d)['json'](_0x154b00);}};}function respondWithFilteredResult(_0x531bb8,_0x5c23ab){return function(_0x39cfd8){if(_0x39cfd8){var _0x2b9171=typeof _0x5c23ab[_0xaf99('0x19')]===_0xaf99('0x1a')&&typeof _0x5c23ab['limit']===_0xaf99('0x1a');var _0x1fe34a=_0x39cfd8[_0xaf99('0x1b')];var _0x1a1e71=_0x2b9171?0x0:_0x5c23ab[_0xaf99('0x19')];var _0x1b34a4=_0x2b9171?_0x39cfd8[_0xaf99('0x1b')]:_0x5c23ab[_0xaf99('0x19')]+_0x5c23ab[_0xaf99('0x1c')];var _0x579812;if(_0x1b34a4>=_0x1fe34a){_0x1b34a4=_0x1fe34a;_0x579812=0xc8;}else{_0x579812=0xce;}_0x531bb8[_0xaf99('0x17')](_0x579812);return _0x531bb8[_0xaf99('0x1d')](_0xaf99('0x1e'),_0x1a1e71+'-'+_0x1b34a4+'/'+_0x1fe34a)[_0xaf99('0x1f')](_0x39cfd8);}return null;};}function patchUpdates(_0x36cfda){return function(_0xc8cf7d){try{jsonpatch[_0xaf99('0x20')](_0xc8cf7d,_0x36cfda,!![]);}catch(_0x51a183){return BPromise[_0xaf99('0x21')](_0x51a183);}return _0xc8cf7d[_0xaf99('0x22')]();};}function saveUpdates(_0x4fd25b,_0x3d19e7){return function(_0x4831b2){if(_0x4831b2){return _0x4831b2[_0xaf99('0x23')](_0x4fd25b)[_0xaf99('0x24')](function(_0x8b664e){return _0x8b664e;});}return null;};}function removeEntity(_0x3f92e3,_0x247ea4){return function(_0x22c63c){if(_0x22c63c){return _0x22c63c['destroy']()[_0xaf99('0x24')](function(){_0x3f92e3[_0xaf99('0x17')](0xcc)[_0xaf99('0x18')]();});}};}function handleEntityNotFound(_0x238224,_0x32e053){return function(_0x358564){if(!_0x358564){_0x238224[_0xaf99('0x16')](0x194);}return _0x358564;};}function handleError(_0xf6fe07,_0x852cf1){_0x852cf1=_0x852cf1||0x1f4;return function(_0x205e34){logger[_0xaf99('0x25')](_0x205e34['stack']);if(_0x205e34[_0xaf99('0x26')]){delete _0x205e34['name'];}_0xf6fe07[_0xaf99('0x17')](_0x852cf1)[_0xaf99('0x27')](_0x205e34);};}exports['index']=function(_0x25c79c,_0x2112dd){var _0x57548c={},_0x4f65ee={},_0xb32560={'count':0x0,'rows':[]};var _0x34c8b7=_[_0xaf99('0x28')](db[_0xaf99('0x29')][_0xaf99('0x2a')],function(_0x39a97c){return{'name':_0x39a97c[_0xaf99('0x2b')],'type':_0x39a97c['type']['key']};});_0x4f65ee[_0xaf99('0x2c')]=_[_0xaf99('0x28')](_0x34c8b7,_0xaf99('0x26'));_0x4f65ee[_0xaf99('0x2d')]=_['keys'](_0x25c79c['query']);_0x4f65ee['filters']=_[_0xaf99('0x2e')](_0x4f65ee[_0xaf99('0x2c')],_0x4f65ee[_0xaf99('0x2d')]);_0x57548c[_0xaf99('0x2f')]=_[_0xaf99('0x2e')](_0x4f65ee[_0xaf99('0x2c')],qs[_0xaf99('0x30')](_0x25c79c[_0xaf99('0x2d')][_0xaf99('0x30')]));_0x57548c[_0xaf99('0x2f')]=_0x57548c[_0xaf99('0x2f')][_0xaf99('0x31')]?_0x57548c['attributes']:_0x4f65ee['model'];if(!_0x25c79c['query'][_0xaf99('0x32')]('nolimit')){_0x57548c[_0xaf99('0x1c')]=qs[_0xaf99('0x1c')](_0x25c79c[_0xaf99('0x2d')]['limit']);_0x57548c[_0xaf99('0x19')]=qs[_0xaf99('0x19')](_0x25c79c[_0xaf99('0x2d')]['offset']);}_0x57548c['order']=qs[_0xaf99('0x33')](_0x25c79c['query'][_0xaf99('0x33')]);_0x57548c['where']=qs[_0xaf99('0x34')](_[_0xaf99('0x35')](_0x25c79c[_0xaf99('0x2d')],_0x4f65ee[_0xaf99('0x34')]),_0x34c8b7);if(_0x25c79c[_0xaf99('0x2d')]['filter']){_0x57548c['where']=_[_0xaf99('0x36')](_0x57548c['where'],{'$or':_[_0xaf99('0x28')](_0x34c8b7,function(_0x38881d){if(_0x38881d['type']!==_0xaf99('0x37')){var _0x44f52b={};_0x44f52b[_0x38881d['name']]={'$like':'%'+_0x25c79c[_0xaf99('0x2d')][_0xaf99('0x38')]+'%'};return _0x44f52b;}})});}_0x57548c=_[_0xaf99('0x36')]({},_0x57548c,_0x25c79c[_0xaf99('0x39')]);var _0xdc6049={'where':_0x57548c[_0xaf99('0x3a')]};return db[_0xaf99('0x29')][_0xaf99('0x1b')](_0xdc6049)[_0xaf99('0x24')](function(_0x217851){_0xb32560[_0xaf99('0x1b')]=_0x217851;if(_0x25c79c['query']['includeAll']){_0x57548c['include']=[{'all':!![]}];}return db[_0xaf99('0x29')]['findAll'](_0x57548c);})[_0xaf99('0x24')](function(_0x3b2449){_0xb32560['rows']=_0x3b2449;return _0xb32560;})['then'](respondWithFilteredResult(_0x2112dd,_0x57548c))[_0xaf99('0x3b')](handleError(_0x2112dd,null));};exports[_0xaf99('0x3c')]=function(_0x599a7e,_0x7ff42b){var _0x275236={'raw':!![],'where':{'id':_0x599a7e['params']['id']}},_0xc4db59={};_0xc4db59[_0xaf99('0x2c')]=_[_0xaf99('0x3d')](db[_0xaf99('0x29')]['rawAttributes']);_0xc4db59[_0xaf99('0x2d')]=_[_0xaf99('0x3d')](_0x599a7e[_0xaf99('0x2d')]);_0xc4db59[_0xaf99('0x34')]=_[_0xaf99('0x2e')](_0xc4db59['model'],_0xc4db59[_0xaf99('0x2d')]);_0x275236['attributes']=_[_0xaf99('0x2e')](_0xc4db59[_0xaf99('0x2c')],qs['fields'](_0x599a7e['query'][_0xaf99('0x30')]));_0x275236[_0xaf99('0x2f')]=_0x275236[_0xaf99('0x2f')][_0xaf99('0x31')]?_0x275236[_0xaf99('0x2f')]:_0xc4db59[_0xaf99('0x2c')];if(_0x599a7e[_0xaf99('0x2d')][_0xaf99('0x3e')]){_0x275236[_0xaf99('0x3f')]=[{'all':!![]}];}_0x275236=_[_0xaf99('0x36')]({},_0x275236,_0x599a7e[_0xaf99('0x39')]);return db[_0xaf99('0x29')]['find'](_0x275236)[_0xaf99('0x24')](handleEntityNotFound(_0x7ff42b,null))[_0xaf99('0x24')](respondWithResult(_0x7ff42b,null))[_0xaf99('0x3b')](handleError(_0x7ff42b,null));};exports[_0xaf99('0x40')]=function(_0x56e8ce,_0x4d8bb8){return db[_0xaf99('0x29')][_0xaf99('0x40')](_0x56e8ce[_0xaf99('0x41')],{})[_0xaf99('0x24')](respondWithResult(_0x4d8bb8,0xc9))[_0xaf99('0x3b')](handleError(_0x4d8bb8,null));};exports[_0xaf99('0x23')]=function(_0x356a34,_0x16df18){if(_0x356a34[_0xaf99('0x41')]['id']){delete _0x356a34[_0xaf99('0x41')]['id'];}return db[_0xaf99('0x29')]['find']({'where':{'id':_0x356a34['params']['id']}})[_0xaf99('0x24')](handleEntityNotFound(_0x16df18,null))[_0xaf99('0x24')](saveUpdates(_0x356a34[_0xaf99('0x41')],null))[_0xaf99('0x24')](respondWithResult(_0x16df18,null))[_0xaf99('0x3b')](handleError(_0x16df18,null));};exports[_0xaf99('0x42')]=function(_0xa10985,_0x2450a7){return db[_0xaf99('0x29')][_0xaf99('0x43')]({'where':{'id':_0xa10985[_0xaf99('0x44')]['id']}})['then'](handleEntityNotFound(_0x2450a7,null))[_0xaf99('0x24')](removeEntity(_0x2450a7,null))[_0xaf99('0x3b')](handleError(_0x2450a7,null));}; \ No newline at end of file +var _0xbd89=['pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x4b7300,_0x1e1306){var _0x100db8=function(_0x46c69b){while(--_0x46c69b){_0x4b7300['push'](_0x4b7300['shift']());}};_0x100db8(++_0x1e1306);}(_0xbd89,0x9e));var _0x9bd8=function(_0x285481,_0x4b5da2){_0x285481=_0x285481-0x0;var _0x4c88df=_0xbd89[_0x285481];return _0x4c88df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9bd8('0x0'));var rp=require('request-promise');var moment=require(_0x9bd8('0x1'));var BPromise=require(_0x9bd8('0x2'));var Mustache=require(_0x9bd8('0x3'));var util=require(_0x9bd8('0x4'));var path=require(_0x9bd8('0x5'));var sox=require('sox');var csv=require(_0x9bd8('0x6'));var ejs=require(_0x9bd8('0x7'));var fs=require('fs');var fs_extra=require(_0x9bd8('0x8'));var _=require(_0x9bd8('0x9'));var squel=require(_0x9bd8('0xa'));var crypto=require(_0x9bd8('0xb'));var jsforce=require(_0x9bd8('0xc'));var deskjs=require(_0x9bd8('0xd'));var toCsv=require(_0x9bd8('0x6'));var querystring=require(_0x9bd8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9bd8('0xf'));var qs=require(_0x9bd8('0x10'));var as=require(_0x9bd8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bd8('0x12'))('api');var utils=require(_0x9bd8('0x13'));var config=require(_0x9bd8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9bd8('0x15'))['db'];function respondWithStatusCode(_0x48887a,_0x1a9ffb){_0x1a9ffb=_0x1a9ffb||0xcc;return function(_0x16ebfa){if(_0x16ebfa){return _0x48887a[_0x9bd8('0x16')](_0x1a9ffb);}return _0x48887a['status'](_0x1a9ffb)[_0x9bd8('0x17')]();};}function respondWithResult(_0x373680,_0x1628be){_0x1628be=_0x1628be||0xc8;return function(_0x15fdc5){if(_0x15fdc5){return _0x373680[_0x9bd8('0x18')](_0x1628be)[_0x9bd8('0x19')](_0x15fdc5);}};}function respondWithFilteredResult(_0x52a719,_0x14d7aa){return function(_0x19d291){if(_0x19d291){var _0x672177=typeof _0x14d7aa[_0x9bd8('0x1a')]==='undefined'&&typeof _0x14d7aa['limit']==='undefined';var _0x1147fe=_0x19d291[_0x9bd8('0x1b')];var _0x46dd2b=_0x672177?0x0:_0x14d7aa['offset'];var _0x2f5658=_0x672177?_0x19d291[_0x9bd8('0x1b')]:_0x14d7aa[_0x9bd8('0x1a')]+_0x14d7aa[_0x9bd8('0x1c')];var _0x50b1cb;if(_0x2f5658>=_0x1147fe){_0x2f5658=_0x1147fe;_0x50b1cb=0xc8;}else{_0x50b1cb=0xce;}_0x52a719['status'](_0x50b1cb);return _0x52a719['set'](_0x9bd8('0x1d'),_0x46dd2b+'-'+_0x2f5658+'/'+_0x1147fe)[_0x9bd8('0x19')](_0x19d291);}return null;};}function patchUpdates(_0x44b0d3){return function(_0x29b074){try{jsonpatch[_0x9bd8('0x1e')](_0x29b074,_0x44b0d3,!![]);}catch(_0x56036c){return BPromise[_0x9bd8('0x1f')](_0x56036c);}return _0x29b074['save']();};}function saveUpdates(_0x35d654,_0x1d3f5b){return function(_0x4cb941){if(_0x4cb941){return _0x4cb941[_0x9bd8('0x20')](_0x35d654)[_0x9bd8('0x21')](function(_0x5c0b12){return _0x5c0b12;});}return null;};}function removeEntity(_0x51397d,_0x150ec2){return function(_0x2f25e6){if(_0x2f25e6){return _0x2f25e6[_0x9bd8('0x22')]()['then'](function(){_0x51397d[_0x9bd8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1467,_0x3df052){return function(_0x5789c4){if(!_0x5789c4){_0x4e1467[_0x9bd8('0x16')](0x194);}return _0x5789c4;};}function handleError(_0x181a94,_0x6211f3){_0x6211f3=_0x6211f3||0x1f4;return function(_0x1a63c8){logger[_0x9bd8('0x23')](_0x1a63c8[_0x9bd8('0x24')]);if(_0x1a63c8[_0x9bd8('0x25')]){delete _0x1a63c8[_0x9bd8('0x25')];}_0x181a94[_0x9bd8('0x18')](_0x6211f3)[_0x9bd8('0x26')](_0x1a63c8);};}exports[_0x9bd8('0x27')]=function(_0x413c68,_0x4c39a7){var _0x4bbcfc={},_0x5ba530={},_0x3945ca={'count':0x0,'rows':[]};var _0x1ccd9e=_[_0x9bd8('0x28')](db[_0x9bd8('0x29')][_0x9bd8('0x2a')],function(_0x5f50b7){return{'name':_0x5f50b7['fieldName'],'type':_0x5f50b7['type'][_0x9bd8('0x2b')]};});_0x5ba530[_0x9bd8('0x2c')]=_[_0x9bd8('0x28')](_0x1ccd9e,_0x9bd8('0x25'));_0x5ba530[_0x9bd8('0x2d')]=_['keys'](_0x413c68['query']);_0x5ba530[_0x9bd8('0x2e')]=_[_0x9bd8('0x2f')](_0x5ba530[_0x9bd8('0x2c')],_0x5ba530[_0x9bd8('0x2d')]);_0x4bbcfc[_0x9bd8('0x30')]=_[_0x9bd8('0x2f')](_0x5ba530['model'],qs[_0x9bd8('0x31')](_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x31')]));_0x4bbcfc[_0x9bd8('0x30')]=_0x4bbcfc[_0x9bd8('0x30')][_0x9bd8('0x32')]?_0x4bbcfc[_0x9bd8('0x30')]:_0x5ba530['model'];if(!_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x33')]('nolimit')){_0x4bbcfc[_0x9bd8('0x1c')]=qs[_0x9bd8('0x1c')](_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x1c')]);_0x4bbcfc[_0x9bd8('0x1a')]=qs['offset'](_0x413c68[_0x9bd8('0x2d')]['offset']);}_0x4bbcfc[_0x9bd8('0x34')]=qs[_0x9bd8('0x35')](_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x35')]);_0x4bbcfc[_0x9bd8('0x36')]=qs[_0x9bd8('0x2e')](_[_0x9bd8('0x37')](_0x413c68[_0x9bd8('0x2d')],_0x5ba530[_0x9bd8('0x2e')]),_0x1ccd9e);if(_0x413c68['query'][_0x9bd8('0x38')]){_0x4bbcfc[_0x9bd8('0x36')]=_['merge'](_0x4bbcfc['where'],{'$or':_[_0x9bd8('0x28')](_0x1ccd9e,function(_0x469a39){if(_0x469a39[_0x9bd8('0x39')]!=='VIRTUAL'){var _0x56b97f={};_0x56b97f[_0x469a39[_0x9bd8('0x25')]]={'$like':'%'+_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x38')]+'%'};return _0x56b97f;}})});}_0x4bbcfc=_[_0x9bd8('0x3a')]({},_0x4bbcfc,_0x413c68[_0x9bd8('0x3b')]);var _0x1362a3={'where':_0x4bbcfc[_0x9bd8('0x36')]};return db[_0x9bd8('0x29')][_0x9bd8('0x1b')](_0x1362a3)['then'](function(_0x19500f){_0x3945ca[_0x9bd8('0x1b')]=_0x19500f;if(_0x413c68[_0x9bd8('0x2d')][_0x9bd8('0x3c')]){_0x4bbcfc[_0x9bd8('0x3d')]=[{'all':!![]}];}return db[_0x9bd8('0x29')][_0x9bd8('0x3e')](_0x4bbcfc);})['then'](function(_0x113893){_0x3945ca[_0x9bd8('0x3f')]=_0x113893;return _0x3945ca;})['then'](respondWithFilteredResult(_0x4c39a7,_0x4bbcfc))[_0x9bd8('0x40')](handleError(_0x4c39a7,null));};exports[_0x9bd8('0x41')]=function(_0x254397,_0x1325d4){var _0xd9b758={'raw':!![],'where':{'id':_0x254397[_0x9bd8('0x42')]['id']}},_0x24d6e3={};_0x24d6e3[_0x9bd8('0x2c')]=_['keys'](db['SquareMessage'][_0x9bd8('0x2a')]);_0x24d6e3[_0x9bd8('0x2d')]=_[_0x9bd8('0x43')](_0x254397[_0x9bd8('0x2d')]);_0x24d6e3['filters']=_[_0x9bd8('0x2f')](_0x24d6e3['model'],_0x24d6e3[_0x9bd8('0x2d')]);_0xd9b758[_0x9bd8('0x30')]=_[_0x9bd8('0x2f')](_0x24d6e3[_0x9bd8('0x2c')],qs[_0x9bd8('0x31')](_0x254397['query'][_0x9bd8('0x31')]));_0xd9b758[_0x9bd8('0x30')]=_0xd9b758[_0x9bd8('0x30')]['length']?_0xd9b758[_0x9bd8('0x30')]:_0x24d6e3['model'];if(_0x254397['query'][_0x9bd8('0x3c')]){_0xd9b758[_0x9bd8('0x3d')]=[{'all':!![]}];}_0xd9b758=_[_0x9bd8('0x3a')]({},_0xd9b758,_0x254397[_0x9bd8('0x3b')]);return db['SquareMessage'][_0x9bd8('0x44')](_0xd9b758)[_0x9bd8('0x21')](handleEntityNotFound(_0x1325d4,null))[_0x9bd8('0x21')](respondWithResult(_0x1325d4,null))[_0x9bd8('0x40')](handleError(_0x1325d4,null));};exports[_0x9bd8('0x45')]=function(_0x37bd94,_0x56766a){return db[_0x9bd8('0x29')][_0x9bd8('0x45')](_0x37bd94[_0x9bd8('0x46')],{})[_0x9bd8('0x21')](respondWithResult(_0x56766a,0xc9))['catch'](handleError(_0x56766a,null));};exports[_0x9bd8('0x20')]=function(_0x2f476d,_0x4524d5){if(_0x2f476d[_0x9bd8('0x46')]['id']){delete _0x2f476d[_0x9bd8('0x46')]['id'];}return db[_0x9bd8('0x29')][_0x9bd8('0x44')]({'where':{'id':_0x2f476d[_0x9bd8('0x42')]['id']}})['then'](handleEntityNotFound(_0x4524d5,null))[_0x9bd8('0x21')](saveUpdates(_0x2f476d[_0x9bd8('0x46')],null))[_0x9bd8('0x21')](respondWithResult(_0x4524d5,null))[_0x9bd8('0x40')](handleError(_0x4524d5,null));};exports['destroy']=function(_0x29af39,_0x35cf7c){return db['SquareMessage'][_0x9bd8('0x44')]({'where':{'id':_0x29af39[_0x9bd8('0x42')]['id']}})[_0x9bd8('0x21')](handleEntityNotFound(_0x35cf7c,null))[_0x9bd8('0x21')](removeEntity(_0x35cf7c,null))['catch'](handleError(_0x35cf7c,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index adf8c11..1013f1c 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 _0x5ffd=['util','../../config/logger','api','bluebird','request-promise','rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','lodash'];(function(_0x15dfc5,_0x39488f){var _0x3ce0ca=function(_0x5d67ab){while(--_0x5d67ab){_0x15dfc5['push'](_0x15dfc5['shift']());}};_0x3ce0ca(++_0x39488f);}(_0x5ffd,0x13e));var _0xd5ff=function(_0x42c4e7,_0x236307){_0x42c4e7=_0x42c4e7-0x0;var _0x4a93b0=_0x5ffd[_0x42c4e7];return _0x4a93b0;};'use strict';var _=require(_0xd5ff('0x0'));var util=require(_0xd5ff('0x1'));var logger=require(_0xd5ff('0x2'))(_0xd5ff('0x3'));var moment=require('moment');var BPromise=require(_0xd5ff('0x4'));var rp=require(_0xd5ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5ff('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5ff('0x7'));module['exports']=function(_0x12550c,_0x39d0b6){return _0x12550c[_0xd5ff('0x8')](_0xd5ff('0x9'),attributes,{'tableName':_0xd5ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc302=['./squareMessage.attributes','exports','SquareMessage','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x625be3,_0x2b0971){var _0x497144=function(_0x3b6fe3){while(--_0x3b6fe3){_0x625be3['push'](_0x625be3['shift']());}};_0x497144(++_0x2b0971);}(_0xc302,0x71));var _0x2c30=function(_0x35c730,_0x55caba){_0x35c730=_0x35c730-0x0;var _0xb9790d=_0xc302[_0x35c730];return _0xb9790d;};'use strict';var _=require(_0x2c30('0x0'));var util=require(_0x2c30('0x1'));var logger=require(_0x2c30('0x2'))('api');var moment=require(_0x2c30('0x3'));var BPromise=require(_0x2c30('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c30('0x5'));var rimraf=require(_0x2c30('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c30('0x7'));module[_0x2c30('0x8')]=function(_0x4d32cc,_0x1aae3a){return _0x4d32cc['define'](_0x2c30('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 349abb5..d3a8099 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 _0x23c2=['stringify','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','create','options','raw','CreateSquareMessage','debug'];(function(_0x13ceaa,_0x4ca543){var _0x591e4b=function(_0x2a6d73){while(--_0x2a6d73){_0x13ceaa['push'](_0x13ceaa['shift']());}};_0x591e4b(++_0x4ca543);}(_0x23c2,0x146));var _0x223c=function(_0xbf3f74,_0x1ae4bf){_0xbf3f74=_0xbf3f74-0x0;var _0xd26ead=_0x23c2[_0xbf3f74];return _0xd26ead;};'use strict';var _=require(_0x223c('0x0'));var util=require(_0x223c('0x1'));var moment=require('moment');var BPromise=require(_0x223c('0x2'));var rs=require(_0x223c('0x3'));var fs=require('fs');var Redis=require(_0x223c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x223c('0x5'))(_0x223c('0x6'));var config=require(_0x223c('0x7'));var jayson=require(_0x223c('0x8'));var client=jayson[_0x223c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5840a1,_0x2f1fd5,_0x381273){return new BPromise(function(_0x4d0403,_0x31feaf){return client[_0x223c('0xa')](_0x5840a1,_0x381273)[_0x223c('0xb')](function(_0x32fc0b){logger[_0x223c('0xc')](_0x223c('0xd'),_0x2f1fd5,_0x223c('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2f1fd5,_0x223c('0xe'),JSON['stringify'](_0x32fc0b));if(_0x32fc0b['error']){if(_0x32fc0b[_0x223c('0xf')]['code']===0x1f4){logger[_0x223c('0xf')](_0x223c('0xd'),_0x2f1fd5,_0x32fc0b['error'][_0x223c('0x10')]);return _0x31feaf(_0x32fc0b[_0x223c('0xf')]['message']);}logger['error'](_0x223c('0xd'),_0x2f1fd5,_0x32fc0b[_0x223c('0xf')][_0x223c('0x10')]);return _0x4d0403(_0x32fc0b[_0x223c('0xf')][_0x223c('0x10')]);}else{logger['info'](_0x223c('0xd'),_0x2f1fd5,_0x223c('0xe'));_0x4d0403(_0x32fc0b[_0x223c('0x11')][_0x223c('0x10')]);}})[_0x223c('0x12')](function(_0x3ea560){logger[_0x223c('0xf')](_0x223c('0xd'),_0x2f1fd5,_0x3ea560);_0x31feaf(_0x3ea560);});});}exports['CreateSquareMessage']=function(_0x26b660){var _0xc005c6=this;return new Promise(function(_0x676773,_0xa9554f){return db['SquareMessage'][_0x223c('0x13')](_0x26b660['body'],{'raw':_0x26b660[_0x223c('0x14')]?_0x26b660[_0x223c('0x14')][_0x223c('0x15')]===undefined?!![]:![]:!![]})[_0x223c('0xb')](function(_0x175b3b){logger['info'](_0x223c('0x16'),_0x26b660);logger[_0x223c('0x17')]('CreateSquareMessage',_0x26b660,JSON[_0x223c('0x18')](_0x175b3b));_0x676773(_0x175b3b);})['catch'](function(_0x537573){logger[_0x223c('0xf')](_0x223c('0x16'),_0x537573[_0x223c('0x10')],_0x26b660);_0xa9554f(_0xc005c6[_0x223c('0xf')](0x1f4,_0x537573['message']));});});}; \ No newline at end of file +var _0xb73b=['message','info','result','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','stringify','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1eddc3,_0x446d53){var _0x1dcf0e=function(_0x4944b3){while(--_0x4944b3){_0x1eddc3['push'](_0x1eddc3['shift']());}};_0x1dcf0e(++_0x446d53);}(_0xb73b,0xe4));var _0xbb73=function(_0x37f498,_0x5662b6){_0x37f498=_0x37f498-0x0;var _0x6de650=_0xb73b[_0x37f498];return _0x6de650;};'use strict';var _=require(_0xbb73('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbb73('0x1'));var fs=require('fs');var Redis=require(_0xbb73('0x2'));var db=require(_0xbb73('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb73('0x4'))(_0xbb73('0x5'));var config=require('../../config/environment');var jayson=require(_0xbb73('0x6'));var client=jayson[_0xbb73('0x7')][_0xbb73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2872d1,_0x3ece43,_0x2834f2){return new BPromise(function(_0x8ef02,_0x194d9c){return client[_0xbb73('0x9')](_0x2872d1,_0x2834f2)[_0xbb73('0xa')](function(_0xb9cada){logger['info'](_0xbb73('0xb'),_0x3ece43,_0xbb73('0xc'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3ece43,_0xbb73('0xc'),JSON['stringify'](_0xb9cada));if(_0xb9cada[_0xbb73('0xd')]){if(_0xb9cada[_0xbb73('0xd')][_0xbb73('0xe')]===0x1f4){logger[_0xbb73('0xd')](_0xbb73('0xb'),_0x3ece43,_0xb9cada['error'][_0xbb73('0xf')]);return _0x194d9c(_0xb9cada[_0xbb73('0xd')]['message']);}logger[_0xbb73('0xd')](_0xbb73('0xb'),_0x3ece43,_0xb9cada['error'][_0xbb73('0xf')]);return _0x8ef02(_0xb9cada[_0xbb73('0xd')][_0xbb73('0xf')]);}else{logger[_0xbb73('0x10')](_0xbb73('0xb'),_0x3ece43,'request\x20sent');_0x8ef02(_0xb9cada[_0xbb73('0x11')][_0xbb73('0xf')]);}})['catch'](function(_0x1a49fd){logger[_0xbb73('0xd')]('SquareMessage,\x20%s,\x20%s',_0x3ece43,_0x1a49fd);_0x194d9c(_0x1a49fd);});});}exports[_0xbb73('0x12')]=function(_0x55b259){var _0x4d13c2=this;return new Promise(function(_0x133b3c,_0x3370f7){return db[_0xbb73('0x13')][_0xbb73('0x14')](_0x55b259[_0xbb73('0x15')],{'raw':_0x55b259[_0xbb73('0x16')]?_0x55b259[_0xbb73('0x16')][_0xbb73('0x17')]===undefined?!![]:![]:!![]})[_0xbb73('0xa')](function(_0x5b6436){logger[_0xbb73('0x10')](_0xbb73('0x12'),_0x55b259);logger[_0xbb73('0x18')](_0xbb73('0x12'),_0x55b259,JSON[_0xbb73('0x19')](_0x5b6436));_0x133b3c(_0x5b6436);})[_0xbb73('0x1a')](function(_0x3b326b){logger[_0xbb73('0xd')](_0xbb73('0x12'),_0x3b326b[_0xbb73('0xf')],_0x55b259);_0x3370f7(_0x4d13c2['error'](0x1f4,_0x3b326b[_0xbb73('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ce0f5c5..cb0556c 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 _0x7be5=['Router','fs-extra','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','15s','test','post','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x7be5,0x18b));var _0x57be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7be5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x57be('0x0'));var util=require('util');var path=require(_0x57be('0x1'));var timeout=require(_0x57be('0x2'));var express=require(_0x57be('0x3'));var router=express[_0x57be('0x4')]();var fs_extra=require(_0x57be('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x57be('0x6'));var controller=require(_0x57be('0x7'));router['get']('/',auth[_0x57be('0x8')](),controller[_0x57be('0x9')]);router[_0x57be('0xa')](_0x57be('0xb'),auth['isAuthenticated'](),controller[_0x57be('0xc')]);router['get']('/:id/test',auth[_0x57be('0x8')](),timeout(_0x57be('0xd')),controller[_0x57be('0xe')]);router[_0x57be('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x57be('0xb'),auth[_0x57be('0x8')](),controller[_0x57be('0x10')]);router['delete']('/:id',auth[_0x57be('0x8')](),controller[_0x57be('0x11')]);module[_0x57be('0x12')]=router; \ No newline at end of file +var _0x0934=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post'];(function(_0x2ada69,_0x3e1ec5){var _0x5d51ce=function(_0x352123){while(--_0x352123){_0x2ada69['push'](_0x2ada69['shift']());}};_0x5d51ce(++_0x3e1ec5);}(_0x0934,0x144));var _0x4093=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0934[_0x93942f];return _0x23fcd8;};'use strict';var multer=require(_0x4093('0x0'));var util=require(_0x4093('0x1'));var path=require(_0x4093('0x2'));var timeout=require('connect-timeout');var express=require(_0x4093('0x3'));var router=express[_0x4093('0x4')]();var fs_extra=require(_0x4093('0x5'));var auth=require(_0x4093('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4093('0x7'));var controller=require(_0x4093('0x8'));router[_0x4093('0x9')]('/',auth[_0x4093('0xa')](),controller[_0x4093('0xb')]);router[_0x4093('0x9')](_0x4093('0xc'),auth['isAuthenticated'](),controller[_0x4093('0xd')]);router['get'](_0x4093('0xe'),auth[_0x4093('0xa')](),timeout(_0x4093('0xf')),controller[_0x4093('0x10')]);router[_0x4093('0x11')]('/',auth[_0x4093('0xa')](),controller['create']);router['put']('/:id',auth[_0x4093('0xa')](),controller['update']);router['delete'](_0x4093('0xc'),auth[_0x4093('0xa')](),controller['destroy']);module[_0x4093('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index a12c778..de789fc 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 _0xa5ea=['sequelize','exports','STRING'];(function(_0x5a9720,_0x1191ee){var _0x105c5c=function(_0x2ba552){while(--_0x2ba552){_0x5a9720['push'](_0x5a9720['shift']());}};_0x105c5c(++_0x1191ee);}(_0xa5ea,0x1e3));var _0xaa5e=function(_0x45db5e,_0x163f90){_0x45db5e=_0x45db5e-0x0;var _0x2d64c5=_0xa5ea[_0x45db5e];return _0x2d64c5;};'use strict';var Sequelize=require(_0xaa5e('0x0'));module[_0xaa5e('0x1')]={'name':{'type':Sequelize[_0xaa5e('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xaa5e('0x2')]},'description':{'type':Sequelize[_0xaa5e('0x2')]}}; \ No newline at end of file +var _0xc261=['STRING','exports','name'];(function(_0x42bedd,_0x157a71){var _0x1a2b17=function(_0x2c112a){while(--_0x2c112a){_0x42bedd['push'](_0x42bedd['shift']());}};_0x1a2b17(++_0x157a71);}(_0xc261,0xa6));var _0x1c26=function(_0x659a2e,_0x307730){_0x659a2e=_0x659a2e-0x0;var _0xdb06e8=_0xc261[_0x659a2e];return _0xdb06e8;};'use strict';var Sequelize=require('sequelize');module[_0x1c26('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1c26('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1c26('0x2')]},'description':{'type':Sequelize[_0x1c26('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index aa55684..ce040f5 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 _0x1186=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','ODBC','error','stack','name','send','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','find','dsn','odbc','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch'];(function(_0x3a1d65,_0x4c772a){var _0x451c79=function(_0x5a8c19){while(--_0x5a8c19){_0x3a1d65['push'](_0x3a1d65['shift']());}};_0x451c79(++_0x4c772a);}(_0x1186,0x19b));var _0x6118=function(_0x4f3f1a,_0x582bcb){_0x4f3f1a=_0x4f3f1a-0x0;var _0x856d63=_0x1186[_0x4f3f1a];return _0x856d63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6118('0x0'));var zipdir=require(_0x6118('0x1'));var jsonpatch=require(_0x6118('0x2'));var rp=require(_0x6118('0x3'));var moment=require(_0x6118('0x4'));var BPromise=require(_0x6118('0x5'));var Mustache=require(_0x6118('0x6'));var util=require(_0x6118('0x7'));var path=require(_0x6118('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6118('0x9'));var fs=require('fs');var fs_extra=require(_0x6118('0xa'));var _=require(_0x6118('0xb'));var squel=require(_0x6118('0xc'));var crypto=require(_0x6118('0xd'));var jsforce=require(_0x6118('0xe'));var deskjs=require(_0x6118('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6118('0x10'));var Papa=require('papaparse');var Redis=require(_0x6118('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6118('0x12'));var hardwareService=require(_0x6118('0x13'));var logger=require(_0x6118('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6118('0x15'));var db=require(_0x6118('0x16'))['db'];function respondWithStatusCode(_0x418410,_0x1d379d){_0x1d379d=_0x1d379d||0xcc;return function(_0x2c3997){if(_0x2c3997){return _0x418410[_0x6118('0x17')](_0x1d379d);}return _0x418410[_0x6118('0x18')](_0x1d379d)[_0x6118('0x19')]();};}function respondWithResult(_0x396e85,_0x9d838b){_0x9d838b=_0x9d838b||0xc8;return function(_0x19d6a9){if(_0x19d6a9){return _0x396e85[_0x6118('0x18')](_0x9d838b)[_0x6118('0x1a')](_0x19d6a9);}};}function respondWithFilteredResult(_0x16d58f,_0x4b1f91){return function(_0x17a717){if(_0x17a717){var _0x468739=typeof _0x4b1f91[_0x6118('0x1b')]===_0x6118('0x1c')&&typeof _0x4b1f91[_0x6118('0x1d')]===_0x6118('0x1c');var _0x247f1a=_0x17a717['count'];var _0x73bf2c=_0x468739?0x0:_0x4b1f91['offset'];var _0x58806a=_0x468739?_0x17a717[_0x6118('0x1e')]:_0x4b1f91['offset']+_0x4b1f91['limit'];var _0x52b0e4;if(_0x58806a>=_0x247f1a){_0x58806a=_0x247f1a;_0x52b0e4=0xc8;}else{_0x52b0e4=0xce;}_0x16d58f[_0x6118('0x18')](_0x52b0e4);return _0x16d58f[_0x6118('0x1f')](_0x6118('0x20'),_0x73bf2c+'-'+_0x58806a+'/'+_0x247f1a)['json'](_0x17a717);}return null;};}function patchUpdates(_0x10389e){return function(_0x181194){try{jsonpatch['apply'](_0x181194,_0x10389e,!![]);}catch(_0x5d6077){return BPromise['reject'](_0x5d6077);}return _0x181194[_0x6118('0x21')]();};}function saveUpdates(_0x35aace,_0x1e5540){return function(_0x5ebe0d){if(_0x5ebe0d){return _0x5ebe0d['update'](_0x35aace)[_0x6118('0x22')](function(_0x49d909){return _0x49d909;});}return null;};}function removeEntity(_0x4f9621,_0x573e18){return function(_0x53f032){if(_0x53f032){return _0x53f032[_0x6118('0x23')]()[_0x6118('0x22')](function(){var _0x1d38cd=_0x53f032[_0x6118('0x24')]({'plain':!![]});var _0x53ea84=_0x6118('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x53ea84,'resourceId':_0x1d38cd['id']}})['then'](function(){return _0x53f032;});})[_0x6118('0x22')](function(){_0x4f9621['status'](0xcc)[_0x6118('0x19')]();});}};}function handleEntityNotFound(_0x160796,_0x3cbc6a){return function(_0x30cfbb){if(!_0x30cfbb){_0x160796[_0x6118('0x17')](0x194);}return _0x30cfbb;};}function handleError(_0x13a221,_0x1ad639){_0x1ad639=_0x1ad639||0x1f4;return function(_0x6bebf4){logger[_0x6118('0x26')](_0x6bebf4[_0x6118('0x27')]);if(_0x6bebf4[_0x6118('0x28')]){delete _0x6bebf4[_0x6118('0x28')];}_0x13a221['status'](_0x1ad639)[_0x6118('0x29')](_0x6bebf4);};}exports['index']=function(_0x24c5df,_0x21eff9){var _0x48e3a0={},_0x38c5ff={},_0x67aa4f={'count':0x0,'rows':[]};var _0x133b81=_[_0x6118('0x2a')](db[_0x6118('0x2b')]['rawAttributes'],function(_0x12baab){return{'name':_0x12baab[_0x6118('0x2c')],'type':_0x12baab[_0x6118('0x2d')][_0x6118('0x2e')]};});_0x38c5ff[_0x6118('0x2f')]=_[_0x6118('0x2a')](_0x133b81,'name');_0x38c5ff[_0x6118('0x30')]=_[_0x6118('0x31')](_0x24c5df['query']);_0x38c5ff[_0x6118('0x32')]=_['intersection'](_0x38c5ff[_0x6118('0x2f')],_0x38c5ff['query']);_0x48e3a0['attributes']=_[_0x6118('0x33')](_0x38c5ff[_0x6118('0x2f')],qs[_0x6118('0x34')](_0x24c5df['query']['fields']));_0x48e3a0[_0x6118('0x35')]=_0x48e3a0[_0x6118('0x35')][_0x6118('0x36')]?_0x48e3a0[_0x6118('0x35')]:_0x38c5ff['model'];if(!_0x24c5df[_0x6118('0x30')][_0x6118('0x37')](_0x6118('0x38'))){_0x48e3a0[_0x6118('0x1d')]=qs[_0x6118('0x1d')](_0x24c5df[_0x6118('0x30')][_0x6118('0x1d')]);_0x48e3a0[_0x6118('0x1b')]=qs[_0x6118('0x1b')](_0x24c5df[_0x6118('0x30')]['offset']);}_0x48e3a0[_0x6118('0x39')]=qs[_0x6118('0x3a')](_0x24c5df[_0x6118('0x30')][_0x6118('0x3a')]);_0x48e3a0[_0x6118('0x3b')]=qs[_0x6118('0x32')](_[_0x6118('0x3c')](_0x24c5df['query'],_0x38c5ff[_0x6118('0x32')]),_0x133b81);if(_0x24c5df[_0x6118('0x30')]['filter']){_0x48e3a0[_0x6118('0x3b')]=_['merge'](_0x48e3a0[_0x6118('0x3b')],{'$or':_['map'](_0x133b81,function(_0x4f42af){if(_0x4f42af[_0x6118('0x2d')]!==_0x6118('0x3d')){var _0x5e76f7={};_0x5e76f7[_0x4f42af[_0x6118('0x28')]]={'$like':'%'+_0x24c5df[_0x6118('0x30')][_0x6118('0x3e')]+'%'};return _0x5e76f7;}})});}_0x48e3a0=_['merge']({},_0x48e3a0,_0x24c5df[_0x6118('0x3f')]);var _0x4872d1={'where':_0x48e3a0[_0x6118('0x3b')]};return db[_0x6118('0x2b')]['count'](_0x4872d1)['then'](function(_0x282b74){_0x67aa4f[_0x6118('0x1e')]=_0x282b74;if(_0x24c5df['query'][_0x6118('0x40')]){_0x48e3a0[_0x6118('0x41')]=[{'all':!![]}];}return db[_0x6118('0x2b')][_0x6118('0x42')](_0x48e3a0);})['then'](function(_0x41d392){_0x67aa4f[_0x6118('0x43')]=_0x41d392;return _0x67aa4f;})[_0x6118('0x22')](respondWithFilteredResult(_0x21eff9,_0x48e3a0))[_0x6118('0x44')](handleError(_0x21eff9,null));};exports[_0x6118('0x45')]=function(_0x36f45e,_0x1c4efe){var _0x4ac59b={'raw':!![],'where':{'id':_0x36f45e[_0x6118('0x46')]['id']}},_0x14a412={};_0x14a412[_0x6118('0x2f')]=_[_0x6118('0x31')](db['SquareOdbc']['rawAttributes']);_0x14a412[_0x6118('0x30')]=_[_0x6118('0x31')](_0x36f45e[_0x6118('0x30')]);_0x14a412[_0x6118('0x32')]=_[_0x6118('0x33')](_0x14a412[_0x6118('0x2f')],_0x14a412[_0x6118('0x30')]);_0x4ac59b[_0x6118('0x35')]=_[_0x6118('0x33')](_0x14a412['model'],qs[_0x6118('0x34')](_0x36f45e['query']['fields']));_0x4ac59b['attributes']=_0x4ac59b[_0x6118('0x35')]['length']?_0x4ac59b['attributes']:_0x14a412[_0x6118('0x2f')];if(_0x36f45e['query']['includeAll']){_0x4ac59b[_0x6118('0x41')]=[{'all':!![]}];}_0x4ac59b=_[_0x6118('0x47')]({},_0x4ac59b,_0x36f45e['options']);return db[_0x6118('0x2b')]['find'](_0x4ac59b)[_0x6118('0x22')](handleEntityNotFound(_0x1c4efe,null))['then'](respondWithResult(_0x1c4efe,null))['catch'](handleError(_0x1c4efe,null));};exports[_0x6118('0x48')]=function(_0x3abe74,_0x552c4f){return db[_0x6118('0x2b')][_0x6118('0x48')](_0x3abe74['body'],{})[_0x6118('0x22')](function(_0x90fe10){var _0x4d2d84=_0x3abe74[_0x6118('0x49')][_0x6118('0x24')]({'plain':!![]});if(!_0x4d2d84)throw new Error(_0x6118('0x4a'));if(_0x4d2d84[_0x6118('0x4b')]==='user'){var _0x36a5ae=_0x90fe10[_0x6118('0x24')]({'plain':!![]});var _0x295d48=_0x6118('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x295d48,'userProfileId':_0x4d2d84[_0x6118('0x4c')]},'raw':!![]})[_0x6118('0x22')](function(_0x134cbc){if(_0x134cbc&&_0x134cbc[_0x6118('0x4d')]===0x0){return db[_0x6118('0x4e')][_0x6118('0x48')]({'name':_0x36a5ae[_0x6118('0x28')],'resourceId':_0x36a5ae['id'],'type':_0x134cbc['name'],'sectionId':_0x134cbc['id']},{})[_0x6118('0x22')](function(){return _0x90fe10;});}else{return _0x90fe10;}})[_0x6118('0x44')](function(_0x1e253e){logger[_0x6118('0x26')](_0x6118('0x4f'),_0x1e253e);throw _0x1e253e;});}return _0x90fe10;})[_0x6118('0x22')](respondWithResult(_0x552c4f,0xc9))[_0x6118('0x44')](handleError(_0x552c4f,null));};exports[_0x6118('0x50')]=function(_0x59e721,_0x3ac3db){if(_0x59e721[_0x6118('0x51')]['id']){delete _0x59e721['body']['id'];}return db[_0x6118('0x2b')]['find']({'where':{'id':_0x59e721[_0x6118('0x46')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x3ac3db,null))[_0x6118('0x22')](saveUpdates(_0x59e721['body'],null))[_0x6118('0x22')](respondWithResult(_0x3ac3db,null))['catch'](handleError(_0x3ac3db,null));};exports[_0x6118('0x23')]=function(_0x52b399,_0x319df3){return db[_0x6118('0x2b')]['find']({'where':{'id':_0x52b399[_0x6118('0x46')]['id']}})[_0x6118('0x22')](handleEntityNotFound(_0x319df3,null))[_0x6118('0x22')](removeEntity(_0x319df3,null))[_0x6118('0x44')](handleError(_0x319df3,null));};exports[_0x6118('0x52')]=function(_0x477a89,_0x4eb8ef,_0x38250d){var _0x5a180b;return db[_0x6118('0x2b')][_0x6118('0x53')]({'where':{'id':_0x477a89[_0x6118('0x46')]['id']},'attributes':['id',_0x6118('0x54')]})[_0x6118('0x22')](handleEntityNotFound(_0x4eb8ef,null))['then'](function(_0x19656b){if(_0x19656b){var _0x20e3ec=require(_0x6118('0x55'))();_0x20e3ec['openSync'](_0x19656b['dsn']);_0x20e3ec['closeSync']();return _0x19656b;}})['then'](respondWithResult(_0x4eb8ef,null))[_0x6118('0x44')](handleError(_0x4eb8ef,null));}; \ No newline at end of file +var _0x72e4=['options','SquareOdbc','include','rows','catch','show','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','dsn','odbc','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','end','sendStatus','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x72e4,0x11b));var _0x472e=function(_0x3183de,_0x2742b0){_0x3183de=_0x3183de-0x0;var _0x1fdd9f=_0x72e4[_0x3183de];return _0x1fdd9f;};'use strict';var emlformat=require(_0x472e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x472e('0x1'));var jsonpatch=require(_0x472e('0x2'));var rp=require(_0x472e('0x3'));var moment=require(_0x472e('0x4'));var BPromise=require(_0x472e('0x5'));var Mustache=require(_0x472e('0x6'));var util=require(_0x472e('0x7'));var path=require('path');var sox=require(_0x472e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x472e('0x9'));var _=require(_0x472e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x472e('0xb'));var deskjs=require(_0x472e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x472e('0xd'));var Papa=require('papaparse');var Redis=require(_0x472e('0xe'));var authService=require(_0x472e('0xf'));var qs=require(_0x472e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x472e('0x11'));var logger=require(_0x472e('0x12'))(_0x472e('0x13'));var utils=require(_0x472e('0x14'));var config=require(_0x472e('0x15'));var licenseUtil=require(_0x472e('0x16'));var db=require(_0x472e('0x17'))['db'];function respondWithStatusCode(_0x374502,_0x4a1b55){_0x4a1b55=_0x4a1b55||0xcc;return function(_0x32782b){if(_0x32782b){return _0x374502['sendStatus'](_0x4a1b55);}return _0x374502[_0x472e('0x18')](_0x4a1b55)['end']();};}function respondWithResult(_0x2f3e85,_0xec7b9a){_0xec7b9a=_0xec7b9a||0xc8;return function(_0xe1f0a9){if(_0xe1f0a9){return _0x2f3e85[_0x472e('0x18')](_0xec7b9a)[_0x472e('0x19')](_0xe1f0a9);}};}function respondWithFilteredResult(_0x1e0659,_0x3e131e){return function(_0x56ad2d){if(_0x56ad2d){var _0x406cec=typeof _0x3e131e[_0x472e('0x1a')]===_0x472e('0x1b')&&typeof _0x3e131e[_0x472e('0x1c')]==='undefined';var _0x571c6f=_0x56ad2d[_0x472e('0x1d')];var _0x57bdba=_0x406cec?0x0:_0x3e131e[_0x472e('0x1a')];var _0x5276db=_0x406cec?_0x56ad2d[_0x472e('0x1d')]:_0x3e131e[_0x472e('0x1a')]+_0x3e131e[_0x472e('0x1c')];var _0x187646;if(_0x5276db>=_0x571c6f){_0x5276db=_0x571c6f;_0x187646=0xc8;}else{_0x187646=0xce;}_0x1e0659[_0x472e('0x18')](_0x187646);return _0x1e0659[_0x472e('0x1e')](_0x472e('0x1f'),_0x57bdba+'-'+_0x5276db+'/'+_0x571c6f)['json'](_0x56ad2d);}return null;};}function patchUpdates(_0x58c377){return function(_0x8d45a5){try{jsonpatch[_0x472e('0x20')](_0x8d45a5,_0x58c377,!![]);}catch(_0x38ee2d){return BPromise[_0x472e('0x21')](_0x38ee2d);}return _0x8d45a5[_0x472e('0x22')]();};}function saveUpdates(_0x19585f,_0x3d9f53){return function(_0x13574d){if(_0x13574d){return _0x13574d[_0x472e('0x23')](_0x19585f)[_0x472e('0x24')](function(_0x4a7f70){return _0x4a7f70;});}return null;};}function removeEntity(_0x15d6c4,_0x1b23e7){return function(_0x406a03){if(_0x406a03){return _0x406a03[_0x472e('0x25')]()[_0x472e('0x24')](function(){var _0x6b6e5f=_0x406a03['get']({'plain':!![]});var _0x1da098=_0x472e('0x26');return db[_0x472e('0x27')][_0x472e('0x25')]({'where':{'type':_0x1da098,'resourceId':_0x6b6e5f['id']}})[_0x472e('0x24')](function(){return _0x406a03;});})['then'](function(){_0x15d6c4[_0x472e('0x18')](0xcc)[_0x472e('0x28')]();});}};}function handleEntityNotFound(_0x570cf9,_0xbbbf1f){return function(_0x42a253){if(!_0x42a253){_0x570cf9[_0x472e('0x29')](0x194);}return _0x42a253;};}function handleError(_0x3b9e2f,_0x561385){_0x561385=_0x561385||0x1f4;return function(_0x1a78b6){logger[_0x472e('0x2a')](_0x1a78b6['stack']);if(_0x1a78b6[_0x472e('0x2b')]){delete _0x1a78b6[_0x472e('0x2b')];}_0x3b9e2f[_0x472e('0x18')](_0x561385)['send'](_0x1a78b6);};}exports[_0x472e('0x2c')]=function(_0x2ed450,_0x449daf){var _0x302b95={},_0xff75d8={},_0x490fab={'count':0x0,'rows':[]};var _0x4fc507=_['map'](db['SquareOdbc'][_0x472e('0x2d')],function(_0x219761){return{'name':_0x219761[_0x472e('0x2e')],'type':_0x219761[_0x472e('0x2f')][_0x472e('0x30')]};});_0xff75d8[_0x472e('0x31')]=_[_0x472e('0x32')](_0x4fc507,'name');_0xff75d8[_0x472e('0x33')]=_[_0x472e('0x34')](_0x2ed450[_0x472e('0x33')]);_0xff75d8[_0x472e('0x35')]=_['intersection'](_0xff75d8[_0x472e('0x31')],_0xff75d8[_0x472e('0x33')]);_0x302b95[_0x472e('0x36')]=_[_0x472e('0x37')](_0xff75d8[_0x472e('0x31')],qs['fields'](_0x2ed450[_0x472e('0x33')][_0x472e('0x38')]));_0x302b95[_0x472e('0x36')]=_0x302b95[_0x472e('0x36')]['length']?_0x302b95[_0x472e('0x36')]:_0xff75d8[_0x472e('0x31')];if(!_0x2ed450['query'][_0x472e('0x39')](_0x472e('0x3a'))){_0x302b95[_0x472e('0x1c')]=qs[_0x472e('0x1c')](_0x2ed450[_0x472e('0x33')][_0x472e('0x1c')]);_0x302b95[_0x472e('0x1a')]=qs[_0x472e('0x1a')](_0x2ed450['query'][_0x472e('0x1a')]);}_0x302b95['order']=qs[_0x472e('0x3b')](_0x2ed450[_0x472e('0x33')]['sort']);_0x302b95[_0x472e('0x3c')]=qs['filters'](_[_0x472e('0x3d')](_0x2ed450['query'],_0xff75d8[_0x472e('0x35')]),_0x4fc507);if(_0x2ed450[_0x472e('0x33')]['filter']){_0x302b95[_0x472e('0x3c')]=_[_0x472e('0x3e')](_0x302b95[_0x472e('0x3c')],{'$or':_['map'](_0x4fc507,function(_0x285bfc){if(_0x285bfc[_0x472e('0x2f')]!==_0x472e('0x3f')){var _0x158b99={};_0x158b99[_0x285bfc[_0x472e('0x2b')]]={'$like':'%'+_0x2ed450[_0x472e('0x33')][_0x472e('0x40')]+'%'};return _0x158b99;}})});}_0x302b95=_[_0x472e('0x3e')]({},_0x302b95,_0x2ed450[_0x472e('0x41')]);var _0xfb1e77={'where':_0x302b95[_0x472e('0x3c')]};return db[_0x472e('0x42')][_0x472e('0x1d')](_0xfb1e77)[_0x472e('0x24')](function(_0x5f15bb){_0x490fab[_0x472e('0x1d')]=_0x5f15bb;if(_0x2ed450[_0x472e('0x33')]['includeAll']){_0x302b95[_0x472e('0x43')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x302b95);})[_0x472e('0x24')](function(_0x202ac5){_0x490fab[_0x472e('0x44')]=_0x202ac5;return _0x490fab;})['then'](respondWithFilteredResult(_0x449daf,_0x302b95))[_0x472e('0x45')](handleError(_0x449daf,null));};exports[_0x472e('0x46')]=function(_0x4449ee,_0x488873){var _0x32d984={'raw':!![],'where':{'id':_0x4449ee['params']['id']}},_0x4f8c9e={};_0x4f8c9e[_0x472e('0x31')]=_[_0x472e('0x34')](db['SquareOdbc'][_0x472e('0x2d')]);_0x4f8c9e[_0x472e('0x33')]=_[_0x472e('0x34')](_0x4449ee[_0x472e('0x33')]);_0x4f8c9e[_0x472e('0x35')]=_['intersection'](_0x4f8c9e['model'],_0x4f8c9e['query']);_0x32d984[_0x472e('0x36')]=_[_0x472e('0x37')](_0x4f8c9e['model'],qs['fields'](_0x4449ee[_0x472e('0x33')][_0x472e('0x38')]));_0x32d984['attributes']=_0x32d984[_0x472e('0x36')]['length']?_0x32d984['attributes']:_0x4f8c9e[_0x472e('0x31')];if(_0x4449ee[_0x472e('0x33')][_0x472e('0x47')]){_0x32d984[_0x472e('0x43')]=[{'all':!![]}];}_0x32d984=_[_0x472e('0x3e')]({},_0x32d984,_0x4449ee[_0x472e('0x41')]);return db['SquareOdbc'][_0x472e('0x48')](_0x32d984)['then'](handleEntityNotFound(_0x488873,null))['then'](respondWithResult(_0x488873,null))[_0x472e('0x45')](handleError(_0x488873,null));};exports[_0x472e('0x49')]=function(_0x2cd116,_0x5ef488){return db[_0x472e('0x42')][_0x472e('0x49')](_0x2cd116[_0x472e('0x4a')],{})[_0x472e('0x24')](function(_0x4591ab){var _0x5a034a=_0x2cd116[_0x472e('0x4b')][_0x472e('0x4c')]({'plain':!![]});if(!_0x5a034a)throw new Error(_0x472e('0x4d'));if(_0x5a034a[_0x472e('0x4e')]===_0x472e('0x4b')){var _0x53ebec=_0x4591ab[_0x472e('0x4c')]({'plain':!![]});var _0x277378=_0x472e('0x26');return db[_0x472e('0x4f')][_0x472e('0x48')]({'where':{'name':_0x277378,'userProfileId':_0x5a034a[_0x472e('0x50')]},'raw':!![]})['then'](function(_0x16f2a6){if(_0x16f2a6&&_0x16f2a6[_0x472e('0x51')]===0x0){return db[_0x472e('0x27')][_0x472e('0x49')]({'name':_0x53ebec[_0x472e('0x2b')],'resourceId':_0x53ebec['id'],'type':_0x16f2a6[_0x472e('0x2b')],'sectionId':_0x16f2a6['id']},{})[_0x472e('0x24')](function(){return _0x4591ab;});}else{return _0x4591ab;}})[_0x472e('0x45')](function(_0x4d2c85){logger[_0x472e('0x2a')](_0x472e('0x52'),_0x4d2c85);throw _0x4d2c85;});}return _0x4591ab;})['then'](respondWithResult(_0x5ef488,0xc9))['catch'](handleError(_0x5ef488,null));};exports['update']=function(_0x4bda69,_0x4a9724){if(_0x4bda69[_0x472e('0x4a')]['id']){delete _0x4bda69['body']['id'];}return db[_0x472e('0x42')][_0x472e('0x48')]({'where':{'id':_0x4bda69[_0x472e('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a9724,null))[_0x472e('0x24')](saveUpdates(_0x4bda69[_0x472e('0x4a')],null))[_0x472e('0x24')](respondWithResult(_0x4a9724,null))[_0x472e('0x45')](handleError(_0x4a9724,null));};exports[_0x472e('0x25')]=function(_0x396fe7,_0x403770){return db[_0x472e('0x42')][_0x472e('0x48')]({'where':{'id':_0x396fe7['params']['id']}})[_0x472e('0x24')](handleEntityNotFound(_0x403770,null))['then'](removeEntity(_0x403770,null))[_0x472e('0x45')](handleError(_0x403770,null));};exports['test']=function(_0x160d6b,_0x454a49,_0xc52ea6){var _0x33a108;return db[_0x472e('0x42')]['find']({'where':{'id':_0x160d6b['params']['id']},'attributes':['id',_0x472e('0x54')]})[_0x472e('0x24')](handleEntityNotFound(_0x454a49,null))[_0x472e('0x24')](function(_0xc05111){if(_0xc05111){var _0x508a04=require(_0x472e('0x55'))();_0x508a04[_0x472e('0x56')](_0xc05111[_0x472e('0x54')]);_0x508a04['closeSync']();return _0xc05111;}})[_0x472e('0x24')](respondWithResult(_0x454a49,null))[_0x472e('0x45')](handleError(_0x454a49,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0afff80..d860bab 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 _0xc790=['../../config/logger','api','moment','bluebird','request-promise','define','SquareOdbc','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc790,0x97));var _0x0c79=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xc790[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x0c79('0x0'));var logger=require(_0x0c79('0x1'))(_0x0c79('0x2'));var moment=require(_0x0c79('0x3'));var BPromise=require(_0x0c79('0x4'));var rp=require(_0x0c79('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x86544f,_0x2654d1){return _0x86544f[_0x0c79('0x6')](_0x0c79('0x7'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2929=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash'];(function(_0x135c17,_0x1188b2){var _0x2546b0=function(_0x23a1f9){while(--_0x23a1f9){_0x135c17['push'](_0x135c17['shift']());}};_0x2546b0(++_0x1188b2);}(_0x2929,0x77));var _0x9292=function(_0x11abdc,_0x33c870){_0x11abdc=_0x11abdc-0x0;var _0x3992e2=_0x2929[_0x11abdc];return _0x3992e2;};'use strict';var _=require(_0x9292('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9292('0x1'));var moment=require(_0x9292('0x2'));var BPromise=require(_0x9292('0x3'));var rp=require(_0x9292('0x4'));var fs=require('fs');var path=require(_0x9292('0x5'));var rimraf=require(_0x9292('0x6'));var config=require(_0x9292('0x7'));var attributes=require(_0x9292('0x8'));module[_0x9292('0x9')]=function(_0x9d32a1,_0x1f16cd){return _0x9d32a1[_0x9292('0xa')]('SquareOdbc',attributes,{'tableName':_0x9292('0xb'),'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 9cb4878..b0664ad 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 _0xf3b3=['find','options','raw','where','attributes','include','model','map','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSquareOdbc','SquareOdbc'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0xf3b3,0x15d));var _0x3f3b=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xf3b3[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x3f3b('0x0'));var util=require(_0x3f3b('0x1'));var moment=require(_0x3f3b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f3b('0x3'));var db=require(_0x3f3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f3b('0x5'))('rpc');var config=require(_0x3f3b('0x6'));var jayson=require(_0x3f3b('0x7'));var client=jayson[_0x3f3b('0x8')][_0x3f3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd92767,_0x79f948,_0x2f65b3){return new BPromise(function(_0x2a63c1,_0x26e1ea){return client[_0x3f3b('0xa')](_0xd92767,_0x2f65b3)[_0x3f3b('0xb')](function(_0x46ecc9){logger[_0x3f3b('0xc')](_0x3f3b('0xd'),_0x79f948,'request\x20sent');logger[_0x3f3b('0xe')](_0x3f3b('0xf'),_0x79f948,_0x3f3b('0x10'),JSON['stringify'](_0x46ecc9));if(_0x46ecc9[_0x3f3b('0x11')]){if(_0x46ecc9[_0x3f3b('0x11')]['code']===0x1f4){logger['error'](_0x3f3b('0xd'),_0x79f948,_0x46ecc9[_0x3f3b('0x11')][_0x3f3b('0x12')]);return _0x26e1ea(_0x46ecc9[_0x3f3b('0x11')][_0x3f3b('0x12')]);}logger[_0x3f3b('0x11')](_0x3f3b('0xd'),_0x79f948,_0x46ecc9[_0x3f3b('0x11')][_0x3f3b('0x12')]);return _0x2a63c1(_0x46ecc9['error']['message']);}else{logger[_0x3f3b('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x79f948,_0x3f3b('0x10'));_0x2a63c1(_0x46ecc9[_0x3f3b('0x13')]['message']);}})[_0x3f3b('0x14')](function(_0x932518){logger[_0x3f3b('0x11')](_0x3f3b('0xd'),_0x79f948,_0x932518);_0x26e1ea(_0x932518);});});}exports[_0x3f3b('0x15')]=function(_0x1ded64){var _0x486d73=this;return new Promise(function(_0x3c14d5,_0x273f26){return db[_0x3f3b('0x16')][_0x3f3b('0x17')]({'raw':_0x1ded64[_0x3f3b('0x18')]?_0x1ded64[_0x3f3b('0x18')][_0x3f3b('0x19')]===undefined?!![]:![]:!![],'where':_0x1ded64[_0x3f3b('0x18')]?_0x1ded64[_0x3f3b('0x18')][_0x3f3b('0x1a')]||null:null,'attributes':_0x1ded64[_0x3f3b('0x18')]?_0x1ded64[_0x3f3b('0x18')][_0x3f3b('0x1b')]||null:null,'include':_0x1ded64['options']?_0x1ded64['options'][_0x3f3b('0x1c')]?_['map'](_0x1ded64[_0x3f3b('0x18')][_0x3f3b('0x1c')],function(_0x1e92ca){return{'model':db[_0x1e92ca[_0x3f3b('0x1d')]],'as':_0x1e92ca['as'],'attributes':_0x1e92ca[_0x3f3b('0x1b')],'include':_0x1e92ca[_0x3f3b('0x1c')]?_[_0x3f3b('0x1e')](_0x1e92ca[_0x3f3b('0x1c')],function(_0x44adb6){return{'model':db[_0x44adb6[_0x3f3b('0x1d')]],'as':_0x44adb6['as'],'attributes':_0x44adb6[_0x3f3b('0x1b')],'include':_0x44adb6[_0x3f3b('0x1c')]?_[_0x3f3b('0x1e')](_0x44adb6[_0x3f3b('0x1c')],function(_0x202a4e){return{'model':db[_0x202a4e[_0x3f3b('0x1d')]],'as':_0x202a4e['as'],'attributes':_0x202a4e[_0x3f3b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f3b('0xb')](function(_0xaed978){logger[_0x3f3b('0xc')](_0x3f3b('0x15'),_0x1ded64);logger[_0x3f3b('0xe')](_0x3f3b('0x15'),_0x1ded64,JSON['stringify'](_0xaed978));_0x3c14d5(_0xaed978);})['catch'](function(_0x3f070c){logger[_0x3f3b('0x11')](_0x3f3b('0x15'),_0x3f070c[_0x3f3b('0x12')],_0x1ded64);_0x273f26(_0x486d73['error'](0x1f4,_0x3f070c[_0x3f3b('0x12')]));});});}; \ No newline at end of file +var _0x614b=['error','message','result','catch','ShowSquareOdbc','options','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0xbc17b4,_0x4a79e7){var _0x547956=function(_0x43dfd5){while(--_0x43dfd5){_0xbc17b4['push'](_0xbc17b4['shift']());}};_0x547956(++_0x4a79e7);}(_0x614b,0xaa));var _0xb614=function(_0x53bf6d,_0x4fb349){_0x53bf6d=_0x53bf6d-0x0;var _0x341fc2=_0x614b[_0x53bf6d];return _0x341fc2;};'use strict';var _=require('lodash');var util=require(_0xb614('0x0'));var moment=require(_0xb614('0x1'));var BPromise=require(_0xb614('0x2'));var rs=require(_0xb614('0x3'));var fs=require('fs');var Redis=require(_0xb614('0x4'));var db=require(_0xb614('0x5'))['db'];var utils=require(_0xb614('0x6'));var logger=require(_0xb614('0x7'))(_0xb614('0x8'));var config=require(_0xb614('0x9'));var jayson=require(_0xb614('0xa'));var client=jayson[_0xb614('0xb')][_0xb614('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40f91d,_0xa9fcbc,_0x8e0404){return new BPromise(function(_0x254838,_0x3af451){return client[_0xb614('0xd')](_0x40f91d,_0x8e0404)[_0xb614('0xe')](function(_0x14640c){logger[_0xb614('0xf')](_0xb614('0x10'),_0xa9fcbc,_0xb614('0x11'));logger[_0xb614('0x12')](_0xb614('0x13'),_0xa9fcbc,'request\x20sent',JSON[_0xb614('0x14')](_0x14640c));if(_0x14640c['error']){if(_0x14640c['error'][_0xb614('0x15')]===0x1f4){logger[_0xb614('0x16')](_0xb614('0x10'),_0xa9fcbc,_0x14640c[_0xb614('0x16')][_0xb614('0x17')]);return _0x3af451(_0x14640c[_0xb614('0x16')][_0xb614('0x17')]);}logger[_0xb614('0x16')](_0xb614('0x10'),_0xa9fcbc,_0x14640c[_0xb614('0x16')]['message']);return _0x254838(_0x14640c[_0xb614('0x16')][_0xb614('0x17')]);}else{logger[_0xb614('0xf')](_0xb614('0x10'),_0xa9fcbc,_0xb614('0x11'));_0x254838(_0x14640c[_0xb614('0x18')][_0xb614('0x17')]);}})[_0xb614('0x19')](function(_0x38f908){logger[_0xb614('0x16')]('SquareOdbc,\x20%s,\x20%s',_0xa9fcbc,_0x38f908);_0x3af451(_0x38f908);});});}exports[_0xb614('0x1a')]=function(_0x3f6ae2){var _0x577bed=this;return new Promise(function(_0x25b1b0,_0x463846){return db['SquareOdbc']['find']({'raw':_0x3f6ae2[_0xb614('0x1b')]?_0x3f6ae2[_0xb614('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f6ae2[_0xb614('0x1b')]?_0x3f6ae2[_0xb614('0x1b')]['where']||null:null,'attributes':_0x3f6ae2[_0xb614('0x1b')]?_0x3f6ae2[_0xb614('0x1b')][_0xb614('0x1c')]||null:null,'include':_0x3f6ae2[_0xb614('0x1b')]?_0x3f6ae2[_0xb614('0x1b')][_0xb614('0x1d')]?_[_0xb614('0x1e')](_0x3f6ae2[_0xb614('0x1b')][_0xb614('0x1d')],function(_0x5cb0a2){return{'model':db[_0x5cb0a2['model']],'as':_0x5cb0a2['as'],'attributes':_0x5cb0a2[_0xb614('0x1c')],'include':_0x5cb0a2[_0xb614('0x1d')]?_['map'](_0x5cb0a2[_0xb614('0x1d')],function(_0x2c717e){return{'model':db[_0x2c717e[_0xb614('0x1f')]],'as':_0x2c717e['as'],'attributes':_0x2c717e[_0xb614('0x1c')],'include':_0x2c717e[_0xb614('0x1d')]?_['map'](_0x2c717e[_0xb614('0x1d')],function(_0x16100f){return{'model':db[_0x16100f[_0xb614('0x1f')]],'as':_0x16100f['as'],'attributes':_0x16100f[_0xb614('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb614('0xe')](function(_0x130179){logger[_0xb614('0xf')]('ShowSquareOdbc',_0x3f6ae2);logger[_0xb614('0x12')](_0xb614('0x1a'),_0x3f6ae2,JSON[_0xb614('0x14')](_0x130179));_0x25b1b0(_0x130179);})[_0xb614('0x19')](function(_0x595063){logger[_0xb614('0x16')](_0xb614('0x1a'),_0x595063[_0xb614('0x17')],_0x3f6ae2);_0x463846(_0x577bed[_0xb614('0x16')](0x1f4,_0x595063['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 92daf7a..703763b 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 _0xccbf=['exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users','getUsers','post','create','put','update','delete','removeUsers'];(function(_0x4fc991,_0x20c42d){var _0x168544=function(_0x315302){while(--_0x315302){_0x4fc991['push'](_0x4fc991['shift']());}};_0x168544(++_0x20c42d);}(_0xccbf,0x1ef));var _0xfccb=function(_0x272107,_0x2887c9){_0x272107=_0x272107-0x0;var _0x1eb599=_0xccbf[_0x272107];return _0x1eb599;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfccb('0x0'));var timeout=require(_0xfccb('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfccb('0x2'));var interaction=require(_0xfccb('0x3'));var config=require(_0xfccb('0x4'));var controller=require(_0xfccb('0x5'));router[_0xfccb('0x6')]('/',auth[_0xfccb('0x7')](),controller[_0xfccb('0x8')]);router[_0xfccb('0x6')](_0xfccb('0x9'),auth[_0xfccb('0x7')](),controller['show']);router['get'](_0xfccb('0xa'),auth['isAuthenticated'](),controller[_0xfccb('0xb')]);router[_0xfccb('0xc')]('/',auth[_0xfccb('0x7')](),controller[_0xfccb('0xd')]);router[_0xfccb('0xc')](_0xfccb('0xa'),auth[_0xfccb('0x7')](),controller['addUsers']);router[_0xfccb('0xe')]('/:id',auth[_0xfccb('0x7')](),controller[_0xfccb('0xf')]);router[_0xfccb('0x10')](_0xfccb('0x9'),auth[_0xfccb('0x7')](),controller['destroy']);router[_0xfccb('0x10')](_0xfccb('0xa'),auth['isAuthenticated'](),controller[_0xfccb('0x11')]);module[_0xfccb('0x12')]=router; \ No newline at end of file +var _0x99d1=['show','/:id/users','getUsers','create','addUsers','destroy','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id'];(function(_0x9eeac2,_0x435226){var _0x84362e=function(_0x1b0ee5){while(--_0x1b0ee5){_0x9eeac2['push'](_0x9eeac2['shift']());}};_0x84362e(++_0x435226);}(_0x99d1,0x104));var _0x199d=function(_0x36a156,_0x45b6e6){_0x36a156=_0x36a156-0x0;var _0x13dddb=_0x99d1[_0x36a156];return _0x13dddb;};'use strict';var multer=require(_0x199d('0x0'));var util=require('util');var path=require(_0x199d('0x1'));var timeout=require(_0x199d('0x2'));var express=require(_0x199d('0x3'));var router=express[_0x199d('0x4')]();var fs_extra=require(_0x199d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x199d('0x6'));var config=require(_0x199d('0x7'));var controller=require(_0x199d('0x8'));router[_0x199d('0x9')]('/',auth[_0x199d('0xa')](),controller[_0x199d('0xb')]);router[_0x199d('0x9')](_0x199d('0xc'),auth[_0x199d('0xa')](),controller[_0x199d('0xd')]);router[_0x199d('0x9')](_0x199d('0xe'),auth[_0x199d('0xa')](),controller[_0x199d('0xf')]);router['post']('/',auth[_0x199d('0xa')](),controller[_0x199d('0x10')]);router['post'](_0x199d('0xe'),auth[_0x199d('0xa')](),controller[_0x199d('0x11')]);router['put'](_0x199d('0xc'),auth[_0x199d('0xa')](),controller['update']);router['delete'](_0x199d('0xc'),auth[_0x199d('0xa')](),controller[_0x199d('0x12')]);router[_0x199d('0x13')](_0x199d('0xe'),auth[_0x199d('0xa')](),controller['removeUsers']);module[_0x199d('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 54a6fc6..9181e20 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 _0x9d68=['name','STRING','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x9d68,0xaf));var _0x89d6=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x9d68[_0xef8146];return _0x5a6cb0;};'use strict';var Sequelize=require('sequelize');module[_0x89d6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x89d6('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x89d6('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x89d6('0x3')]('long'),'get':function(){if(this[_0x89d6('0x4')](_0x89d6('0x5'))){return this[_0x89d6('0x4')](_0x89d6('0x5'))[_0x89d6('0x6')](_0x89d6('0x7'));}}},'production':{'type':Sequelize[_0x89d6('0x3')](_0x89d6('0x8')),'get':function(){if(this['getDataValue'](_0x89d6('0x9'))){return this[_0x89d6('0x4')](_0x89d6('0x9'))[_0x89d6('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0x89d6('0xa')]},'publishedAt':{'type':Sequelize[_0x89d6('0xa')]}}; \ No newline at end of file +var _0x71f3=['STRING','name','TEXT','BLOB','long','preproduction','getDataValue','utf8','DATE','sequelize'];(function(_0x4a3c43,_0x31aff7){var _0x3f04b8=function(_0x18df55){while(--_0x18df55){_0x4a3c43['push'](_0x4a3c43['shift']());}};_0x3f04b8(++_0x31aff7);}(_0x71f3,0x13f));var _0x371f=function(_0x344110,_0x373ee3){_0x344110=_0x344110-0x0;var _0x14a81e=_0x71f3[_0x344110];return _0x14a81e;};'use strict';var Sequelize=require(_0x371f('0x0'));module['exports']={'name':{'type':Sequelize[_0x371f('0x1')],'unique':_0x371f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x371f('0x1')]},'notes':{'type':Sequelize[_0x371f('0x3')]},'preproduction':{'type':Sequelize[_0x371f('0x4')](_0x371f('0x5')),'get':function(){if(this['getDataValue'](_0x371f('0x6'))){return this[_0x371f('0x7')](_0x371f('0x6'))['toString'](_0x371f('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x371f('0x7')]('production')){return this['getDataValue']('production')['toString'](_0x371f('0x8'));}}},'savedAt':{'type':Sequelize[_0x371f('0x9')]},'publishedAt':{'type':Sequelize[_0x371f('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ef2b69b..5ec6bd5 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 _0xd107=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','include','findAll','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','findOne','pick','options','getUsers','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','get','SquareProjects','destroy','sendStatus','error','stack','name','index','SquareProject','rawAttributes','fieldName','model','map','query','keys','intersection'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0xd107,0x146));var _0x7d10=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd107[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x7d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d10('0x1'));var jsonpatch=require(_0x7d10('0x2'));var rp=require('request-promise');var moment=require(_0x7d10('0x3'));var BPromise=require(_0x7d10('0x4'));var Mustache=require(_0x7d10('0x5'));var util=require(_0x7d10('0x6'));var path=require('path');var sox=require(_0x7d10('0x7'));var csv=require('to-csv');var ejs=require(_0x7d10('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d10('0x9'));var squel=require('squel');var crypto=require(_0x7d10('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7d10('0xb'));var toCsv=require(_0x7d10('0xc'));var querystring=require(_0x7d10('0xd'));var Papa=require('papaparse');var Redis=require(_0x7d10('0xe'));var authService=require(_0x7d10('0xf'));var qs=require(_0x7d10('0x10'));var as=require(_0x7d10('0x11'));var hardwareService=require(_0x7d10('0x12'));var logger=require(_0x7d10('0x13'))(_0x7d10('0x14'));var utils=require(_0x7d10('0x15'));var config=require(_0x7d10('0x16'));var licenseUtil=require(_0x7d10('0x17'));var db=require(_0x7d10('0x18'))['db'];config[_0x7d10('0x19')]=_['defaults'](config[_0x7d10('0x19')],{'host':_0x7d10('0x1a'),'port':0x18eb});var socket=require(_0x7d10('0x1b'))(new Redis(config[_0x7d10('0x19')]));require(_0x7d10('0x1c'))[_0x7d10('0x1d')](socket);function respondWithStatusCode(_0x386198,_0x3e69f2){_0x3e69f2=_0x3e69f2||0xcc;return function(_0x648f87){if(_0x648f87){return _0x386198['sendStatus'](_0x3e69f2);}return _0x386198['status'](_0x3e69f2)[_0x7d10('0x1e')]();};}function respondWithResult(_0x544a66,_0x15a38f){_0x15a38f=_0x15a38f||0xc8;return function(_0x287d3c){if(_0x287d3c){return _0x544a66[_0x7d10('0x1f')](_0x15a38f)['json'](_0x287d3c);}};}function respondWithFilteredResult(_0x123136,_0x3f7408){return function(_0x4b28d6){if(_0x4b28d6){var _0x397a3f=typeof _0x3f7408[_0x7d10('0x20')]===_0x7d10('0x21')&&typeof _0x3f7408[_0x7d10('0x22')]===_0x7d10('0x21');var _0x50a128=_0x4b28d6['count'];var _0x1e8dde=_0x397a3f?0x0:_0x3f7408[_0x7d10('0x20')];var _0x121aa3=_0x397a3f?_0x4b28d6[_0x7d10('0x23')]:_0x3f7408[_0x7d10('0x20')]+_0x3f7408[_0x7d10('0x22')];var _0x3a7d73;if(_0x121aa3>=_0x50a128){_0x121aa3=_0x50a128;_0x3a7d73=0xc8;}else{_0x3a7d73=0xce;}_0x123136[_0x7d10('0x1f')](_0x3a7d73);return _0x123136[_0x7d10('0x24')](_0x7d10('0x25'),_0x1e8dde+'-'+_0x121aa3+'/'+_0x50a128)[_0x7d10('0x26')](_0x4b28d6);}return null;};}function patchUpdates(_0x162522){return function(_0x51b049){try{jsonpatch[_0x7d10('0x27')](_0x51b049,_0x162522,!![]);}catch(_0x2d2818){return BPromise[_0x7d10('0x28')](_0x2d2818);}return _0x51b049['save']();};}function saveUpdates(_0x5118b4,_0x20d279){return function(_0x6b06e5){if(_0x6b06e5){return _0x6b06e5['update'](_0x5118b4)[_0x7d10('0x29')](function(_0x4f7d5e){return _0x4f7d5e;});}return null;};}function removeEntity(_0xc50691,_0x2ced9){return function(_0x24bb92){if(_0x24bb92){return _0x24bb92['destroy']()['then'](function(){var _0x3ec5b1=_0x24bb92[_0x7d10('0x2a')]({'plain':!![]});var _0x3681ea=_0x7d10('0x2b');return db['UserProfileResource'][_0x7d10('0x2c')]({'where':{'type':_0x3681ea,'resourceId':_0x3ec5b1['id']}})['then'](function(){return _0x24bb92;});})[_0x7d10('0x29')](function(){_0xc50691[_0x7d10('0x1f')](0xcc)[_0x7d10('0x1e')]();});}};}function handleEntityNotFound(_0x28631d,_0x39ac02){return function(_0x3fbc21){if(!_0x3fbc21){_0x28631d[_0x7d10('0x2d')](0x194);}return _0x3fbc21;};}function handleError(_0x5baac8,_0x2ed443){_0x2ed443=_0x2ed443||0x1f4;return function(_0x51850f){logger[_0x7d10('0x2e')](_0x51850f[_0x7d10('0x2f')]);if(_0x51850f[_0x7d10('0x30')]){delete _0x51850f[_0x7d10('0x30')];}_0x5baac8['status'](_0x2ed443)['send'](_0x51850f);};}exports[_0x7d10('0x31')]=function(_0x528a90,_0x156346){var _0x4c3c1a={},_0x3bbc8c={},_0x53dffc={'count':0x0,'rows':[]};var _0x34fbd3=_['map'](db[_0x7d10('0x32')][_0x7d10('0x33')],function(_0x490e61){return{'name':_0x490e61[_0x7d10('0x34')],'type':_0x490e61['type']['key']};});_0x3bbc8c[_0x7d10('0x35')]=_[_0x7d10('0x36')](_0x34fbd3,'name');_0x3bbc8c[_0x7d10('0x37')]=_[_0x7d10('0x38')](_0x528a90['query']);_0x3bbc8c['filters']=_[_0x7d10('0x39')](_0x3bbc8c[_0x7d10('0x35')],_0x3bbc8c['query']);_0x4c3c1a[_0x7d10('0x3a')]=_[_0x7d10('0x39')](_0x3bbc8c[_0x7d10('0x35')],qs[_0x7d10('0x3b')](_0x528a90[_0x7d10('0x37')][_0x7d10('0x3b')]));_0x4c3c1a[_0x7d10('0x3a')]=_0x4c3c1a[_0x7d10('0x3a')][_0x7d10('0x3c')]?_0x4c3c1a[_0x7d10('0x3a')]:_0x3bbc8c['model'];if(!_0x528a90[_0x7d10('0x37')][_0x7d10('0x3d')](_0x7d10('0x3e'))){_0x4c3c1a['limit']=qs[_0x7d10('0x22')](_0x528a90[_0x7d10('0x37')]['limit']);_0x4c3c1a['offset']=qs[_0x7d10('0x20')](_0x528a90[_0x7d10('0x37')][_0x7d10('0x20')]);}_0x4c3c1a[_0x7d10('0x3f')]=qs[_0x7d10('0x40')](_0x528a90['query']['sort']);_0x4c3c1a[_0x7d10('0x41')]=qs['filters'](_['pick'](_0x528a90[_0x7d10('0x37')],_0x3bbc8c[_0x7d10('0x42')]),_0x34fbd3);if(_0x528a90['query']['filter']){_0x4c3c1a['where']=_[_0x7d10('0x43')](_0x4c3c1a[_0x7d10('0x41')],{'$or':_[_0x7d10('0x36')](_0x34fbd3,function(_0x637811){if(_0x637811[_0x7d10('0x44')]!=='VIRTUAL'){var _0xc6db25={};_0xc6db25[_0x637811[_0x7d10('0x30')]]={'$like':'%'+_0x528a90['query'][_0x7d10('0x45')]+'%'};return _0xc6db25;}})});}_0x4c3c1a=_['merge']({},_0x4c3c1a,_0x528a90['options']);var _0x2c820c={'where':_0x4c3c1a['where']};return db[_0x7d10('0x32')]['count'](_0x2c820c)[_0x7d10('0x29')](function(_0x2bc9e8){_0x53dffc[_0x7d10('0x23')]=_0x2bc9e8;if(_0x528a90['query']['includeAll']){_0x4c3c1a[_0x7d10('0x46')]=[{'all':!![]}];}return db[_0x7d10('0x32')][_0x7d10('0x47')](_0x4c3c1a);})[_0x7d10('0x29')](function(_0x37de03){_0x53dffc['rows']=_0x37de03;return _0x53dffc;})[_0x7d10('0x29')](respondWithFilteredResult(_0x156346,_0x4c3c1a))['catch'](handleError(_0x156346,null));};exports['show']=function(_0x4b0b2a,_0x162dd5){var _0x4d3124={'raw':![],'where':{'id':_0x4b0b2a[_0x7d10('0x48')]['id']}},_0x533a72={};_0x533a72[_0x7d10('0x35')]=_[_0x7d10('0x38')](db['SquareProject']['rawAttributes']);_0x533a72[_0x7d10('0x37')]=_[_0x7d10('0x38')](_0x4b0b2a[_0x7d10('0x37')]);_0x533a72['filters']=_['intersection'](_0x533a72['model'],_0x533a72[_0x7d10('0x37')]);_0x4d3124[_0x7d10('0x3a')]=_[_0x7d10('0x39')](_0x533a72['model'],qs[_0x7d10('0x3b')](_0x4b0b2a[_0x7d10('0x37')][_0x7d10('0x3b')]));_0x4d3124[_0x7d10('0x3a')]=_0x4d3124[_0x7d10('0x3a')][_0x7d10('0x3c')]?_0x4d3124[_0x7d10('0x3a')]:_0x533a72[_0x7d10('0x35')];if(_0x4b0b2a[_0x7d10('0x37')]['includeAll']){_0x4d3124[_0x7d10('0x46')]=[{'all':!![]}];}_0x4d3124=_['merge']({},_0x4d3124,_0x4b0b2a['options']);return db['SquareProject'][_0x7d10('0x49')](_0x4d3124)[_0x7d10('0x29')](handleEntityNotFound(_0x162dd5,null))[_0x7d10('0x29')](respondWithResult(_0x162dd5,null))['catch'](handleError(_0x162dd5,null));};exports[_0x7d10('0x4a')]=function(_0x3ab0b5,_0x332eb0){return db['SquareProject'][_0x7d10('0x4a')](_0x3ab0b5[_0x7d10('0x4b')],{})['then'](function(_0x166689){var _0x3bdeed=_0x3ab0b5[_0x7d10('0x4c')][_0x7d10('0x2a')]({'plain':!![]});if(!_0x3bdeed)throw new Error(_0x7d10('0x4d'));if(_0x3bdeed[_0x7d10('0x4e')]===_0x7d10('0x4c')){var _0x275c4c=_0x166689[_0x7d10('0x2a')]({'plain':!![]});var _0x5d97f9=_0x7d10('0x2b');return db[_0x7d10('0x4f')][_0x7d10('0x49')]({'where':{'name':_0x5d97f9,'userProfileId':_0x3bdeed[_0x7d10('0x50')]},'raw':!![]})[_0x7d10('0x29')](function(_0x589a13){if(_0x589a13&&_0x589a13[_0x7d10('0x51')]===0x0){return db[_0x7d10('0x52')]['create']({'name':_0x275c4c[_0x7d10('0x30')],'resourceId':_0x275c4c['id'],'type':_0x589a13['name'],'sectionId':_0x589a13['id']},{})[_0x7d10('0x29')](function(){return _0x166689;});}else{return _0x166689;}})[_0x7d10('0x53')](function(_0x49b12e){logger[_0x7d10('0x2e')](_0x7d10('0x54'),_0x49b12e);throw _0x49b12e;});}return _0x166689;})[_0x7d10('0x29')](respondWithResult(_0x332eb0,0xc9))[_0x7d10('0x53')](handleError(_0x332eb0,null));};exports[_0x7d10('0x55')]=function(_0x10c2af,_0x5ede16){if(_0x10c2af[_0x7d10('0x4b')]['id']){delete _0x10c2af[_0x7d10('0x4b')]['id'];}return db[_0x7d10('0x32')][_0x7d10('0x49')]({'where':{'id':_0x10c2af[_0x7d10('0x48')]['id']}})[_0x7d10('0x29')](handleEntityNotFound(_0x5ede16,null))[_0x7d10('0x29')](saveUpdates(_0x10c2af[_0x7d10('0x4b')],null))[_0x7d10('0x29')](respondWithResult(_0x5ede16,null))[_0x7d10('0x53')](handleError(_0x5ede16,null));};exports['destroy']=function(_0x1d8f5c,_0x37f48a){return db['SquareProject'][_0x7d10('0x49')]({'where':{'id':_0x1d8f5c[_0x7d10('0x48')]['id']}})[_0x7d10('0x29')](handleEntityNotFound(_0x37f48a,null))[_0x7d10('0x29')](removeEntity(_0x37f48a,null))['catch'](handleError(_0x37f48a,null));};exports[_0x7d10('0x56')]=function(_0x1167e7,_0x4a4c1a,_0x331931){return db[_0x7d10('0x32')][_0x7d10('0x49')]({'where':{'id':_0x1167e7[_0x7d10('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a4c1a,null))['then'](function(_0x1912d5){if(_0x1912d5){return _0x1912d5[_0x7d10('0x56')](_0x1167e7['body'][_0x7d10('0x57')],_[_0x7d10('0x58')](_0x1167e7[_0x7d10('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x4a4c1a,null))['catch'](handleError(_0x4a4c1a,null));};exports[_0x7d10('0x59')]=function(_0xc4da5f,_0x12cdd5,_0x380e63){return db['SquareProject'][_0x7d10('0x49')]({'where':{'id':_0xc4da5f['params']['id']}})[_0x7d10('0x29')](handleEntityNotFound(_0x12cdd5,null))['then'](function(_0x23a96f){if(_0x23a96f){return _0x23a96f['removeUsers'](_0xc4da5f[_0x7d10('0x37')]['ids'])[_0x7d10('0x29')](function(){if(_[_0x7d10('0x5a')](_0xc4da5f[_0x7d10('0x37')][_0x7d10('0x57')])){for(var _0x173227=0x0;_0x173227<_0xc4da5f[_0x7d10('0x37')][_0x7d10('0x57')][_0x7d10('0x3c')];_0x173227+=0x1){socket[_0x7d10('0x5b')]('userSquareProject:remove',{'UserId':Number(_0xc4da5f[_0x7d10('0x37')]['ids'][_0x173227]),'SquareProjectId':Number(_0xc4da5f[_0x7d10('0x48')]['id'])});}}else{socket[_0x7d10('0x5b')]('userSquareProject:remove',{'UserId':Number(_0xc4da5f[_0x7d10('0x37')][_0x7d10('0x57')]),'SquareProjectId':Number(_0xc4da5f[_0x7d10('0x48')]['id'])});}});}})[_0x7d10('0x29')](respondWithStatusCode(_0x12cdd5,null))[_0x7d10('0x53')](handleError(_0x12cdd5,null));};exports['getUsers']=function(_0x3bc556,_0x340c03,_0x534d7e){var _0xa47dbc={};var _0x5d4687={};var _0x142877;var _0x2644bb;return db[_0x7d10('0x32')][_0x7d10('0x5c')]({'where':{'id':_0x3bc556[_0x7d10('0x48')]['id']}})[_0x7d10('0x29')](handleEntityNotFound(_0x340c03,null))[_0x7d10('0x29')](function(_0x11cb1f){if(_0x11cb1f){_0x142877=_0x11cb1f;_0x5d4687[_0x7d10('0x35')]=_['keys'](db['User'][_0x7d10('0x33')]);_0x5d4687['query']=_[_0x7d10('0x38')](_0x3bc556['query']);_0x5d4687[_0x7d10('0x42')]=_[_0x7d10('0x39')](_0x5d4687[_0x7d10('0x35')],_0x5d4687[_0x7d10('0x37')]);_0xa47dbc[_0x7d10('0x3a')]=_[_0x7d10('0x39')](_0x5d4687[_0x7d10('0x35')],qs[_0x7d10('0x3b')](_0x3bc556['query'][_0x7d10('0x3b')]));_0xa47dbc[_0x7d10('0x3a')]=_0xa47dbc['attributes'][_0x7d10('0x3c')]?_0xa47dbc['attributes']:_0x5d4687[_0x7d10('0x35')];_0xa47dbc['order']=qs[_0x7d10('0x40')](_0x3bc556[_0x7d10('0x37')][_0x7d10('0x40')]);_0xa47dbc[_0x7d10('0x41')]=qs['filters'](_[_0x7d10('0x5d')](_0x3bc556[_0x7d10('0x37')],_0x5d4687[_0x7d10('0x42')]));if(_0x3bc556[_0x7d10('0x37')][_0x7d10('0x45')]){_0xa47dbc[_0x7d10('0x41')]=_[_0x7d10('0x43')](_0xa47dbc['where'],{'$or':_[_0x7d10('0x36')](_0xa47dbc[_0x7d10('0x3a')],function(_0xd0b038){var _0x20b2ee={};_0x20b2ee[_0xd0b038]={'$like':'%'+_0x3bc556[_0x7d10('0x37')][_0x7d10('0x45')]+'%'};return _0x20b2ee;})});}_0xa47dbc=_[_0x7d10('0x43')]({},_0xa47dbc,_0x3bc556[_0x7d10('0x5e')]);return _0x142877[_0x7d10('0x5f')](_0xa47dbc);}})[_0x7d10('0x29')](function(_0x3f59df){if(_0x3f59df){_0x2644bb=_0x3f59df['length'];if(!_0x3bc556[_0x7d10('0x37')][_0x7d10('0x3d')](_0x7d10('0x3e'))){_0xa47dbc[_0x7d10('0x22')]=qs['limit'](_0x3bc556[_0x7d10('0x37')][_0x7d10('0x22')]);_0xa47dbc['offset']=qs[_0x7d10('0x20')](_0x3bc556[_0x7d10('0x37')]['offset']);}return _0x142877[_0x7d10('0x5f')](_0xa47dbc);}})['then'](function(_0x3d1d9e){if(_0x3d1d9e){return _0x3d1d9e?{'count':_0x2644bb,'rows':_0x3d1d9e}:null;}})[_0x7d10('0x29')](respondWithResult(_0x340c03,null))[_0x7d10('0x53')](handleError(_0x340c03,null));}; \ No newline at end of file +var _0xad63=['offset','undefined','limit','count','status','reject','update','destroy','then','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','getUsers','User','order','options','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','end','json'];(function(_0x5c82ef,_0xefa9c4){var _0xb68f2c=function(_0x3a1cf3){while(--_0x3a1cf3){_0x5c82ef['push'](_0x5c82ef['shift']());}};_0xb68f2c(++_0xefa9c4);}(_0xad63,0xa1));var _0x3ad6=function(_0x221fcc,_0x4b3d0e){_0x221fcc=_0x221fcc-0x0;var _0x42f9a2=_0xad63[_0x221fcc];return _0x42f9a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ad6('0x0'));var zipdir=require(_0x3ad6('0x1'));var jsonpatch=require(_0x3ad6('0x2'));var rp=require(_0x3ad6('0x3'));var moment=require(_0x3ad6('0x4'));var BPromise=require(_0x3ad6('0x5'));var Mustache=require(_0x3ad6('0x6'));var util=require(_0x3ad6('0x7'));var path=require(_0x3ad6('0x8'));var sox=require(_0x3ad6('0x9'));var csv=require(_0x3ad6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ad6('0xb'));var _=require(_0x3ad6('0xc'));var squel=require(_0x3ad6('0xd'));var crypto=require(_0x3ad6('0xe'));var jsforce=require(_0x3ad6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3ad6('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ad6('0x10'));var authService=require(_0x3ad6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad6('0x12'));var hardwareService=require(_0x3ad6('0x13'));var logger=require(_0x3ad6('0x14'))(_0x3ad6('0x15'));var utils=require(_0x3ad6('0x16'));var config=require(_0x3ad6('0x17'));var licenseUtil=require(_0x3ad6('0x18'));var db=require(_0x3ad6('0x19'))['db'];config[_0x3ad6('0x1a')]=_[_0x3ad6('0x1b')](config[_0x3ad6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ad6('0x1a')]));require(_0x3ad6('0x1c'))[_0x3ad6('0x1d')](socket);function respondWithStatusCode(_0x13b091,_0x5196ac){_0x5196ac=_0x5196ac||0xcc;return function(_0x71431d){if(_0x71431d){return _0x13b091[_0x3ad6('0x1e')](_0x5196ac);}return _0x13b091['status'](_0x5196ac)[_0x3ad6('0x1f')]();};}function respondWithResult(_0x2046b2,_0x25970d){_0x25970d=_0x25970d||0xc8;return function(_0x52a499){if(_0x52a499){return _0x2046b2['status'](_0x25970d)[_0x3ad6('0x20')](_0x52a499);}};}function respondWithFilteredResult(_0x53e03c,_0x548c8d){return function(_0xf19e69){if(_0xf19e69){var _0x37b861=typeof _0x548c8d[_0x3ad6('0x21')]===_0x3ad6('0x22')&&typeof _0x548c8d[_0x3ad6('0x23')]===_0x3ad6('0x22');var _0x142ee8=_0xf19e69[_0x3ad6('0x24')];var _0x515f8d=_0x37b861?0x0:_0x548c8d[_0x3ad6('0x21')];var _0x4540c6=_0x37b861?_0xf19e69[_0x3ad6('0x24')]:_0x548c8d[_0x3ad6('0x21')]+_0x548c8d['limit'];var _0x4b71d2;if(_0x4540c6>=_0x142ee8){_0x4540c6=_0x142ee8;_0x4b71d2=0xc8;}else{_0x4b71d2=0xce;}_0x53e03c[_0x3ad6('0x25')](_0x4b71d2);return _0x53e03c['set']('Content-Range',_0x515f8d+'-'+_0x4540c6+'/'+_0x142ee8)[_0x3ad6('0x20')](_0xf19e69);}return null;};}function patchUpdates(_0xd554bc){return function(_0x26ab75){try{jsonpatch['apply'](_0x26ab75,_0xd554bc,!![]);}catch(_0x2d2ecc){return BPromise[_0x3ad6('0x26')](_0x2d2ecc);}return _0x26ab75['save']();};}function saveUpdates(_0x3ae71f,_0x60a387){return function(_0x11caec){if(_0x11caec){return _0x11caec[_0x3ad6('0x27')](_0x3ae71f)['then'](function(_0x264fbb){return _0x264fbb;});}return null;};}function removeEntity(_0x43b1f1,_0xba4edf){return function(_0x378e17){if(_0x378e17){return _0x378e17[_0x3ad6('0x28')]()[_0x3ad6('0x29')](function(){var _0x1ab4d7=_0x378e17['get']({'plain':!![]});var _0x40a68f='SquareProjects';return db['UserProfileResource'][_0x3ad6('0x28')]({'where':{'type':_0x40a68f,'resourceId':_0x1ab4d7['id']}})['then'](function(){return _0x378e17;});})[_0x3ad6('0x29')](function(){_0x43b1f1[_0x3ad6('0x25')](0xcc)[_0x3ad6('0x1f')]();});}};}function handleEntityNotFound(_0x573802,_0x491832){return function(_0x8bfc97){if(!_0x8bfc97){_0x573802['sendStatus'](0x194);}return _0x8bfc97;};}function handleError(_0xf2abd6,_0x157304){_0x157304=_0x157304||0x1f4;return function(_0x5bcc62){logger[_0x3ad6('0x2a')](_0x5bcc62[_0x3ad6('0x2b')]);if(_0x5bcc62[_0x3ad6('0x2c')]){delete _0x5bcc62['name'];}_0xf2abd6[_0x3ad6('0x25')](_0x157304)[_0x3ad6('0x2d')](_0x5bcc62);};}exports[_0x3ad6('0x2e')]=function(_0x185dc0,_0x1c7992){var _0x2d97f2={},_0x3dd150={},_0x570e0d={'count':0x0,'rows':[]};var _0x5a86f2=_[_0x3ad6('0x2f')](db[_0x3ad6('0x30')][_0x3ad6('0x31')],function(_0x1d9572){return{'name':_0x1d9572[_0x3ad6('0x32')],'type':_0x1d9572['type'][_0x3ad6('0x33')]};});_0x3dd150[_0x3ad6('0x34')]=_['map'](_0x5a86f2,_0x3ad6('0x2c'));_0x3dd150[_0x3ad6('0x35')]=_['keys'](_0x185dc0[_0x3ad6('0x35')]);_0x3dd150['filters']=_[_0x3ad6('0x36')](_0x3dd150[_0x3ad6('0x34')],_0x3dd150[_0x3ad6('0x35')]);_0x2d97f2['attributes']=_[_0x3ad6('0x36')](_0x3dd150['model'],qs[_0x3ad6('0x37')](_0x185dc0[_0x3ad6('0x35')][_0x3ad6('0x37')]));_0x2d97f2[_0x3ad6('0x38')]=_0x2d97f2[_0x3ad6('0x38')][_0x3ad6('0x39')]?_0x2d97f2[_0x3ad6('0x38')]:_0x3dd150[_0x3ad6('0x34')];if(!_0x185dc0['query'][_0x3ad6('0x3a')](_0x3ad6('0x3b'))){_0x2d97f2['limit']=qs[_0x3ad6('0x23')](_0x185dc0[_0x3ad6('0x35')][_0x3ad6('0x23')]);_0x2d97f2['offset']=qs[_0x3ad6('0x21')](_0x185dc0['query'][_0x3ad6('0x21')]);}_0x2d97f2['order']=qs[_0x3ad6('0x3c')](_0x185dc0[_0x3ad6('0x35')][_0x3ad6('0x3c')]);_0x2d97f2['where']=qs['filters'](_[_0x3ad6('0x3d')](_0x185dc0[_0x3ad6('0x35')],_0x3dd150[_0x3ad6('0x3e')]),_0x5a86f2);if(_0x185dc0[_0x3ad6('0x35')][_0x3ad6('0x3f')]){_0x2d97f2[_0x3ad6('0x40')]=_[_0x3ad6('0x41')](_0x2d97f2[_0x3ad6('0x40')],{'$or':_['map'](_0x5a86f2,function(_0x1decb6){if(_0x1decb6[_0x3ad6('0x42')]!==_0x3ad6('0x43')){var _0x5ffb2f={};_0x5ffb2f[_0x1decb6['name']]={'$like':'%'+_0x185dc0['query'][_0x3ad6('0x3f')]+'%'};return _0x5ffb2f;}})});}_0x2d97f2=_[_0x3ad6('0x41')]({},_0x2d97f2,_0x185dc0['options']);var _0x5eaf22={'where':_0x2d97f2['where']};return db[_0x3ad6('0x30')][_0x3ad6('0x24')](_0x5eaf22)[_0x3ad6('0x29')](function(_0x261775){_0x570e0d['count']=_0x261775;if(_0x185dc0[_0x3ad6('0x35')][_0x3ad6('0x44')]){_0x2d97f2[_0x3ad6('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x3ad6('0x46')](_0x2d97f2);})[_0x3ad6('0x29')](function(_0x176b69){_0x570e0d['rows']=_0x176b69;return _0x570e0d;})[_0x3ad6('0x29')](respondWithFilteredResult(_0x1c7992,_0x2d97f2))[_0x3ad6('0x47')](handleError(_0x1c7992,null));};exports[_0x3ad6('0x48')]=function(_0x54c9f1,_0x572e33){var _0x5e4ec2={'raw':![],'where':{'id':_0x54c9f1[_0x3ad6('0x49')]['id']}},_0x3790f3={};_0x3790f3[_0x3ad6('0x34')]=_[_0x3ad6('0x4a')](db[_0x3ad6('0x30')]['rawAttributes']);_0x3790f3[_0x3ad6('0x35')]=_[_0x3ad6('0x4a')](_0x54c9f1[_0x3ad6('0x35')]);_0x3790f3[_0x3ad6('0x3e')]=_[_0x3ad6('0x36')](_0x3790f3[_0x3ad6('0x34')],_0x3790f3[_0x3ad6('0x35')]);_0x5e4ec2[_0x3ad6('0x38')]=_['intersection'](_0x3790f3[_0x3ad6('0x34')],qs[_0x3ad6('0x37')](_0x54c9f1[_0x3ad6('0x35')][_0x3ad6('0x37')]));_0x5e4ec2[_0x3ad6('0x38')]=_0x5e4ec2['attributes'][_0x3ad6('0x39')]?_0x5e4ec2[_0x3ad6('0x38')]:_0x3790f3[_0x3ad6('0x34')];if(_0x54c9f1['query'][_0x3ad6('0x44')]){_0x5e4ec2[_0x3ad6('0x45')]=[{'all':!![]}];}_0x5e4ec2=_[_0x3ad6('0x41')]({},_0x5e4ec2,_0x54c9f1['options']);return db[_0x3ad6('0x30')][_0x3ad6('0x4b')](_0x5e4ec2)[_0x3ad6('0x29')](handleEntityNotFound(_0x572e33,null))[_0x3ad6('0x29')](respondWithResult(_0x572e33,null))[_0x3ad6('0x47')](handleError(_0x572e33,null));};exports[_0x3ad6('0x4c')]=function(_0x15b871,_0x36004f){return db['SquareProject'][_0x3ad6('0x4c')](_0x15b871[_0x3ad6('0x4d')],{})['then'](function(_0x3c7e1c){var _0x1c2a40=_0x15b871['user'][_0x3ad6('0x4e')]({'plain':!![]});if(!_0x1c2a40)throw new Error(_0x3ad6('0x4f'));if(_0x1c2a40[_0x3ad6('0x50')]==='user'){var _0x460efe=_0x3c7e1c[_0x3ad6('0x4e')]({'plain':!![]});var _0x179499=_0x3ad6('0x51');return db[_0x3ad6('0x52')][_0x3ad6('0x4b')]({'where':{'name':_0x179499,'userProfileId':_0x1c2a40[_0x3ad6('0x53')]},'raw':!![]})[_0x3ad6('0x29')](function(_0x567539){if(_0x567539&&_0x567539[_0x3ad6('0x54')]===0x0){return db[_0x3ad6('0x55')][_0x3ad6('0x4c')]({'name':_0x460efe[_0x3ad6('0x2c')],'resourceId':_0x460efe['id'],'type':_0x567539[_0x3ad6('0x2c')],'sectionId':_0x567539['id']},{})['then'](function(){return _0x3c7e1c;});}else{return _0x3c7e1c;}})['catch'](function(_0x32dfa0){logger['error'](_0x3ad6('0x56'),_0x32dfa0);throw _0x32dfa0;});}return _0x3c7e1c;})[_0x3ad6('0x29')](respondWithResult(_0x36004f,0xc9))['catch'](handleError(_0x36004f,null));};exports['update']=function(_0x35ed30,_0x2dfb0b){if(_0x35ed30['body']['id']){delete _0x35ed30['body']['id'];}return db['SquareProject'][_0x3ad6('0x4b')]({'where':{'id':_0x35ed30[_0x3ad6('0x49')]['id']}})[_0x3ad6('0x29')](handleEntityNotFound(_0x2dfb0b,null))[_0x3ad6('0x29')](saveUpdates(_0x35ed30[_0x3ad6('0x4d')],null))[_0x3ad6('0x29')](respondWithResult(_0x2dfb0b,null))[_0x3ad6('0x47')](handleError(_0x2dfb0b,null));};exports[_0x3ad6('0x28')]=function(_0x4fb33a,_0x1a87d1){return db[_0x3ad6('0x30')][_0x3ad6('0x4b')]({'where':{'id':_0x4fb33a['params']['id']}})['then'](handleEntityNotFound(_0x1a87d1,null))['then'](removeEntity(_0x1a87d1,null))[_0x3ad6('0x47')](handleError(_0x1a87d1,null));};exports['addUsers']=function(_0x3c4de4,_0x40d329,_0x5bac9f){return db[_0x3ad6('0x30')]['find']({'where':{'id':_0x3c4de4['params']['id']}})[_0x3ad6('0x29')](handleEntityNotFound(_0x40d329,null))[_0x3ad6('0x29')](function(_0x55bdc8){if(_0x55bdc8){return _0x55bdc8[_0x3ad6('0x57')](_0x3c4de4[_0x3ad6('0x4d')][_0x3ad6('0x58')],_[_0x3ad6('0x59')](_0x3c4de4[_0x3ad6('0x4d')],[_0x3ad6('0x58'),'id'])||{});}})[_0x3ad6('0x29')](respondWithResult(_0x40d329,null))[_0x3ad6('0x47')](handleError(_0x40d329,null));};exports[_0x3ad6('0x5a')]=function(_0x5458fc,_0x3c5e7f,_0x1b98e3){return db[_0x3ad6('0x30')][_0x3ad6('0x4b')]({'where':{'id':_0x5458fc['params']['id']}})[_0x3ad6('0x29')](handleEntityNotFound(_0x3c5e7f,null))[_0x3ad6('0x29')](function(_0x40c69e){if(_0x40c69e){return _0x40c69e[_0x3ad6('0x5a')](_0x5458fc[_0x3ad6('0x35')][_0x3ad6('0x58')])[_0x3ad6('0x29')](function(){if(_[_0x3ad6('0x5b')](_0x5458fc[_0x3ad6('0x35')][_0x3ad6('0x58')])){for(var _0x1d4de0=0x0;_0x1d4de0<_0x5458fc[_0x3ad6('0x35')][_0x3ad6('0x58')]['length'];_0x1d4de0+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x5458fc[_0x3ad6('0x35')][_0x3ad6('0x58')][_0x1d4de0]),'SquareProjectId':Number(_0x5458fc[_0x3ad6('0x49')]['id'])});}}else{socket['emit'](_0x3ad6('0x5c'),{'UserId':Number(_0x5458fc[_0x3ad6('0x35')][_0x3ad6('0x58')]),'SquareProjectId':Number(_0x5458fc[_0x3ad6('0x49')]['id'])});}});}})[_0x3ad6('0x29')](respondWithStatusCode(_0x3c5e7f,null))[_0x3ad6('0x47')](handleError(_0x3c5e7f,null));};exports[_0x3ad6('0x5d')]=function(_0x5b14df,_0xd6505b,_0x3eac99){var _0x426a34={};var _0xee841d={};var _0x3c02a6;var _0x1d928e;return db['SquareProject']['findOne']({'where':{'id':_0x5b14df['params']['id']}})[_0x3ad6('0x29')](handleEntityNotFound(_0xd6505b,null))[_0x3ad6('0x29')](function(_0x587e53){if(_0x587e53){_0x3c02a6=_0x587e53;_0xee841d[_0x3ad6('0x34')]=_[_0x3ad6('0x4a')](db[_0x3ad6('0x5e')]['rawAttributes']);_0xee841d[_0x3ad6('0x35')]=_[_0x3ad6('0x4a')](_0x5b14df[_0x3ad6('0x35')]);_0xee841d[_0x3ad6('0x3e')]=_[_0x3ad6('0x36')](_0xee841d[_0x3ad6('0x34')],_0xee841d[_0x3ad6('0x35')]);_0x426a34[_0x3ad6('0x38')]=_[_0x3ad6('0x36')](_0xee841d[_0x3ad6('0x34')],qs[_0x3ad6('0x37')](_0x5b14df[_0x3ad6('0x35')][_0x3ad6('0x37')]));_0x426a34['attributes']=_0x426a34[_0x3ad6('0x38')][_0x3ad6('0x39')]?_0x426a34[_0x3ad6('0x38')]:_0xee841d[_0x3ad6('0x34')];_0x426a34[_0x3ad6('0x5f')]=qs[_0x3ad6('0x3c')](_0x5b14df[_0x3ad6('0x35')][_0x3ad6('0x3c')]);_0x426a34['where']=qs[_0x3ad6('0x3e')](_[_0x3ad6('0x3d')](_0x5b14df[_0x3ad6('0x35')],_0xee841d[_0x3ad6('0x3e')]));if(_0x5b14df[_0x3ad6('0x35')][_0x3ad6('0x3f')]){_0x426a34[_0x3ad6('0x40')]=_[_0x3ad6('0x41')](_0x426a34[_0x3ad6('0x40')],{'$or':_[_0x3ad6('0x2f')](_0x426a34[_0x3ad6('0x38')],function(_0x461ded){var _0x576d85={};_0x576d85[_0x461ded]={'$like':'%'+_0x5b14df['query']['filter']+'%'};return _0x576d85;})});}_0x426a34=_['merge']({},_0x426a34,_0x5b14df[_0x3ad6('0x60')]);return _0x3c02a6[_0x3ad6('0x5d')](_0x426a34);}})[_0x3ad6('0x29')](function(_0x422a59){if(_0x422a59){_0x1d928e=_0x422a59[_0x3ad6('0x39')];if(!_0x5b14df['query'][_0x3ad6('0x3a')](_0x3ad6('0x3b'))){_0x426a34[_0x3ad6('0x23')]=qs['limit'](_0x5b14df[_0x3ad6('0x35')]['limit']);_0x426a34['offset']=qs['offset'](_0x5b14df[_0x3ad6('0x35')][_0x3ad6('0x21')]);}return _0x3c02a6['getUsers'](_0x426a34);}})[_0x3ad6('0x29')](function(_0x2b4705){if(_0x2b4705){return _0x2b4705?{'count':_0x1d928e,'rows':_0x2b4705}:null;}})[_0x3ad6('0x29')](respondWithResult(_0xd6505b,null))['catch'](handleError(_0xd6505b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1d558ba..d0a35e9 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 _0x2d6f=['../../mysqldb','SquareProject','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x2d6f,0x110));var _0xf2d6=function(_0x58208a,_0x2bf6ed){_0x58208a=_0x58208a-0x0;var _0x19d967=_0x2d6f[_0x58208a];return _0x19d967;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xf2d6('0x0'))['db'][_0xf2d6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf2d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2d6('0x3'),'afterDestroy':_0xf2d6('0x4')};function emitEvent(_0x370810){return function(_0x327a7f,_0x409560,_0x1c995a){SquareProjectEvents[_0xf2d6('0x5')](_0x370810+':'+_0x327a7f['id'],_0x327a7f);SquareProjectEvents[_0xf2d6('0x5')](_0x370810,_0x327a7f);_0x1c995a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xf2d6('0x6')](e,emitEvent(event));}}module[_0xf2d6('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x35e0=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0xa32738,_0xc3f4d){var _0x27e80f=function(_0x413cfd){while(--_0x413cfd){_0xa32738['push'](_0xa32738['shift']());}};_0x27e80f(++_0xc3f4d);}(_0x35e0,0xf9));var _0x035e=function(_0x5dee87,_0x320064){_0x5dee87=_0x5dee87-0x0;var _0x5483f0=_0x35e0[_0x5dee87];return _0x5483f0;};'use strict';var EventEmitter=require(_0x035e('0x0'));var SquareProject=require(_0x035e('0x1'))['db'][_0x035e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x035e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x035e('0x4'),'afterDestroy':_0x035e('0x5')};function emitEvent(_0x320b14){return function(_0x22b51e,_0x793970,_0x29a012){SquareProjectEvents['emit'](_0x320b14+':'+_0x22b51e['id'],_0x22b51e);SquareProjectEvents['emit'](_0x320b14,_0x22b51e);_0x29a012(null);};}for(var e in events){if(events[_0x035e('0x6')](e)){var event=events[e];SquareProject[_0x035e('0x7')](e,emitEvent(event));}}module[_0x035e('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 34345b4..ec84f97 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 _0xab74=['bluebird','request-promise','path','rimraf','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x2574fe,_0x5bd648){var _0x1a93bf=function(_0x48520f){while(--_0x48520f){_0x2574fe['push'](_0x2574fe['shift']());}};_0x1a93bf(++_0x5bd648);}(_0xab74,0x151));var _0x4ab7=function(_0x2f656c,_0x52065d){_0x2f656c=_0x2f656c-0x0;var _0x13be55=_0xab74[_0x2f656c];return _0x13be55;};'use strict';var _=require(_0x4ab7('0x0'));var util=require(_0x4ab7('0x1'));var logger=require(_0x4ab7('0x2'))(_0x4ab7('0x3'));var moment=require(_0x4ab7('0x4'));var BPromise=require(_0x4ab7('0x5'));var rp=require(_0x4ab7('0x6'));var fs=require('fs');var path=require(_0x4ab7('0x7'));var rimraf=require(_0x4ab7('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ab7('0x9'));module['exports']=function(_0x3ff869,_0x34033b){return _0x3ff869[_0x4ab7('0xa')](_0x4ab7('0xb'),attributes,{'tableName':_0x4ab7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4bf097,_0x142a52,_0x33fb2a){if(_0x4bf097[_0x4ab7('0xd')](_0x4ab7('0xe'))){_0x4bf097['savedAt']=moment()[_0x4ab7('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4bf097['changed']('production')){_0x4bf097[_0x4ab7('0x10')]=moment()[_0x4ab7('0xf')](_0x4ab7('0x11'));}_0x33fb2a(null,_0x4bf097);}}});}; \ No newline at end of file +var _0xd70e=['rimraf','./squareProject.attributes','exports','define','SquareProject','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9ef4e0,_0x53d007){var _0xa9dd55=function(_0x6e0720){while(--_0x6e0720){_0x9ef4e0['push'](_0x9ef4e0['shift']());}};_0xa9dd55(++_0x53d007);}(_0xd70e,0x199));var _0xed70=function(_0x221e48,_0x442db9){_0x221e48=_0x221e48-0x0;var _0x284b6e=_0xd70e[_0x221e48];return _0x284b6e;};'use strict';var _=require(_0xed70('0x0'));var util=require(_0xed70('0x1'));var logger=require(_0xed70('0x2'))(_0xed70('0x3'));var moment=require(_0xed70('0x4'));var BPromise=require(_0xed70('0x5'));var rp=require(_0xed70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed70('0x7'));var config=require('../../config/environment');var attributes=require(_0xed70('0x8'));module[_0xed70('0x9')]=function(_0x5b6bb0,_0x377800){return _0x5b6bb0[_0xed70('0xa')](_0xed70('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4614ea,_0x4cdff2,_0x36eb05){if(_0x4614ea['changed']('preproduction')){_0x4614ea['savedAt']=moment()['format'](_0xed70('0xc'));}if(_0x4614ea[_0xed70('0xd')](_0xed70('0xe'))){_0x4614ea[_0xed70('0xf')]=moment()['format'](_0xed70('0xc'));}_0x36eb05(null,_0x4614ea);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 97b42ab..0e0de12 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 _0x456c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','raw','options','attributes','include','model','map','then','ShowSquareProject','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x293ec5,_0x507b62){var _0x38c44e=function(_0x150a3a){while(--_0x150a3a){_0x293ec5['push'](_0x293ec5['shift']());}};_0x38c44e(++_0x507b62);}(_0x456c,0xcd));var _0xc456=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x456c[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0xc456('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc456('0x1'));var rs=require(_0xc456('0x2'));var fs=require('fs');var Redis=require(_0xc456('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc456('0x4'));var logger=require(_0xc456('0x5'))(_0xc456('0x6'));var config=require(_0xc456('0x7'));var jayson=require(_0xc456('0x8'));var client=jayson[_0xc456('0x9')]['http']({'port':0x232a});config[_0xc456('0xa')]=_['defaults'](config[_0xc456('0xa')],{'host':_0xc456('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc456('0xa')]));require(_0xc456('0xc'))[_0xc456('0xd')](socket);function respondWithRpcPromise(_0x5d2fa3,_0x5576ba,_0x5c92c3){return new BPromise(function(_0x51765c,_0x540b15){return client[_0xc456('0xe')](_0x5d2fa3,_0x5c92c3)['then'](function(_0x17c7a0){logger[_0xc456('0xf')](_0xc456('0x10'),_0x5576ba,_0xc456('0x11'));logger[_0xc456('0x12')](_0xc456('0x13'),_0x5576ba,_0xc456('0x11'),JSON[_0xc456('0x14')](_0x17c7a0));if(_0x17c7a0[_0xc456('0x15')]){if(_0x17c7a0[_0xc456('0x15')][_0xc456('0x16')]===0x1f4){logger[_0xc456('0x15')](_0xc456('0x10'),_0x5576ba,_0x17c7a0[_0xc456('0x15')][_0xc456('0x17')]);return _0x540b15(_0x17c7a0[_0xc456('0x15')][_0xc456('0x17')]);}logger[_0xc456('0x15')](_0xc456('0x10'),_0x5576ba,_0x17c7a0[_0xc456('0x15')][_0xc456('0x17')]);return _0x51765c(_0x17c7a0['error']['message']);}else{logger[_0xc456('0xf')](_0xc456('0x10'),_0x5576ba,_0xc456('0x11'));_0x51765c(_0x17c7a0[_0xc456('0x18')][_0xc456('0x17')]);}})['catch'](function(_0x35a44e){logger[_0xc456('0x15')](_0xc456('0x10'),_0x5576ba,_0x35a44e);_0x540b15(_0x35a44e);});});}exports['ShowSquareProject']=function(_0xed649a){var _0x140cc0=this;return new Promise(function(_0x42bbe2,_0x3373b3){return db['SquareProject'][_0xc456('0x19')]({'raw':_0xed649a['options']?_0xed649a['options'][_0xc456('0x1a')]===undefined?!![]:![]:!![],'where':_0xed649a[_0xc456('0x1b')]?_0xed649a[_0xc456('0x1b')]['where']||null:null,'attributes':_0xed649a[_0xc456('0x1b')]?_0xed649a[_0xc456('0x1b')][_0xc456('0x1c')]||null:null,'include':_0xed649a[_0xc456('0x1b')]?_0xed649a['options'][_0xc456('0x1d')]?_['map'](_0xed649a[_0xc456('0x1b')]['include'],function(_0x4c0b89){return{'model':db[_0x4c0b89[_0xc456('0x1e')]],'as':_0x4c0b89['as'],'attributes':_0x4c0b89[_0xc456('0x1c')],'include':_0x4c0b89[_0xc456('0x1d')]?_[_0xc456('0x1f')](_0x4c0b89[_0xc456('0x1d')],function(_0x25cff1){return{'model':db[_0x25cff1[_0xc456('0x1e')]],'as':_0x25cff1['as'],'attributes':_0x25cff1['attributes'],'include':_0x25cff1[_0xc456('0x1d')]?_[_0xc456('0x1f')](_0x25cff1[_0xc456('0x1d')],function(_0x4b12ad){return{'model':db[_0x4b12ad[_0xc456('0x1e')]],'as':_0x4b12ad['as'],'attributes':_0x4b12ad[_0xc456('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc456('0x20')](function(_0x17285a){logger[_0xc456('0xf')](_0xc456('0x21'),_0xed649a);logger[_0xc456('0x12')](_0xc456('0x21'),_0xed649a,JSON[_0xc456('0x14')](_0x17285a));_0x42bbe2(_0x17285a);})[_0xc456('0x22')](function(_0x279006){logger[_0xc456('0x15')](_0xc456('0x21'),_0x279006[_0xc456('0x17')],_0xed649a);_0x3373b3(_0x140cc0[_0xc456('0x15')](0x1f4,_0x279006[_0xc456('0x17')]));});});}; \ No newline at end of file +var _0xff30=['raw','where','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options'];(function(_0x262c39,_0x14b574){var _0x371d00=function(_0x2fc39e){while(--_0x2fc39e){_0x262c39['push'](_0x262c39['shift']());}};_0x371d00(++_0x14b574);}(_0xff30,0xa2));var _0x0ff3=function(_0x9aca1d,_0x1974dc){_0x9aca1d=_0x9aca1d-0x0;var _0x408754=_0xff30[_0x9aca1d];return _0x408754;};'use strict';var _=require(_0x0ff3('0x0'));var util=require(_0x0ff3('0x1'));var moment=require(_0x0ff3('0x2'));var BPromise=require(_0x0ff3('0x3'));var rs=require(_0x0ff3('0x4'));var fs=require('fs');var Redis=require(_0x0ff3('0x5'));var db=require(_0x0ff3('0x6'))['db'];var utils=require(_0x0ff3('0x7'));var logger=require(_0x0ff3('0x8'))(_0x0ff3('0x9'));var config=require(_0x0ff3('0xa'));var jayson=require(_0x0ff3('0xb'));var client=jayson[_0x0ff3('0xc')]['http']({'port':0x232a});config['redis']=_[_0x0ff3('0xd')](config[_0x0ff3('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ff3('0xe')]));require(_0x0ff3('0xf'))[_0x0ff3('0x10')](socket);function respondWithRpcPromise(_0x157d77,_0x4b24ce,_0x1c3abb){return new BPromise(function(_0x306567,_0x28e2fb){return client[_0x0ff3('0x11')](_0x157d77,_0x1c3abb)[_0x0ff3('0x12')](function(_0x4565d3){logger[_0x0ff3('0x13')](_0x0ff3('0x14'),_0x4b24ce,'request\x20sent');logger[_0x0ff3('0x15')](_0x0ff3('0x16'),_0x4b24ce,'request\x20sent',JSON[_0x0ff3('0x17')](_0x4565d3));if(_0x4565d3[_0x0ff3('0x18')]){if(_0x4565d3[_0x0ff3('0x18')][_0x0ff3('0x19')]===0x1f4){logger[_0x0ff3('0x18')]('SquareProject,\x20%s,\x20%s',_0x4b24ce,_0x4565d3[_0x0ff3('0x18')][_0x0ff3('0x1a')]);return _0x28e2fb(_0x4565d3[_0x0ff3('0x18')][_0x0ff3('0x1a')]);}logger[_0x0ff3('0x18')](_0x0ff3('0x14'),_0x4b24ce,_0x4565d3[_0x0ff3('0x18')][_0x0ff3('0x1a')]);return _0x306567(_0x4565d3[_0x0ff3('0x18')][_0x0ff3('0x1a')]);}else{logger[_0x0ff3('0x13')](_0x0ff3('0x14'),_0x4b24ce,'request\x20sent');_0x306567(_0x4565d3[_0x0ff3('0x1b')]['message']);}})[_0x0ff3('0x1c')](function(_0x566268){logger[_0x0ff3('0x18')](_0x0ff3('0x14'),_0x4b24ce,_0x566268);_0x28e2fb(_0x566268);});});}exports[_0x0ff3('0x1d')]=function(_0xc62c07){var _0x4919b7=this;return new Promise(function(_0xf40e3c,_0x8ae969){return db[_0x0ff3('0x1e')][_0x0ff3('0x1f')]({'raw':_0xc62c07[_0x0ff3('0x20')]?_0xc62c07[_0x0ff3('0x20')][_0x0ff3('0x21')]===undefined?!![]:![]:!![],'where':_0xc62c07[_0x0ff3('0x20')]?_0xc62c07[_0x0ff3('0x20')][_0x0ff3('0x22')]||null:null,'attributes':_0xc62c07['options']?_0xc62c07['options']['attributes']||null:null,'include':_0xc62c07[_0x0ff3('0x20')]?_0xc62c07[_0x0ff3('0x20')]['include']?_[_0x0ff3('0x23')](_0xc62c07[_0x0ff3('0x20')][_0x0ff3('0x24')],function(_0x196c68){return{'model':db[_0x196c68[_0x0ff3('0x25')]],'as':_0x196c68['as'],'attributes':_0x196c68[_0x0ff3('0x26')],'include':_0x196c68['include']?_['map'](_0x196c68[_0x0ff3('0x24')],function(_0x91537b){return{'model':db[_0x91537b[_0x0ff3('0x25')]],'as':_0x91537b['as'],'attributes':_0x91537b['attributes'],'include':_0x91537b[_0x0ff3('0x24')]?_[_0x0ff3('0x23')](_0x91537b[_0x0ff3('0x24')],function(_0xbf8153){return{'model':db[_0xbf8153['model']],'as':_0xbf8153['as'],'attributes':_0xbf8153[_0x0ff3('0x26')]};}):[]};}):[]};}):[]:[]})[_0x0ff3('0x12')](function(_0x4c77ec){logger['info'](_0x0ff3('0x1d'),_0xc62c07);logger[_0x0ff3('0x15')](_0x0ff3('0x1d'),_0xc62c07,JSON['stringify'](_0x4c77ec));_0xf40e3c(_0x4c77ec);})[_0x0ff3('0x1c')](function(_0x237b90){logger[_0x0ff3('0x18')](_0x0ff3('0x1d'),_0x237b90[_0x0ff3('0x1a')],_0xc62c07);_0x8ae969(_0x4919b7[_0x0ff3('0x18')](0x1f4,_0x237b90[_0x0ff3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index edc701c..32cf483 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 _0xa1c9=['save','removeListener','register','length','./squareProject.events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa1c9,0x16c));var _0x9a1c=function(_0x3eaa42,_0x340128){_0x3eaa42=_0x3eaa42-0x0;var _0x2fb1bd=_0xa1c9[_0x3eaa42];return _0x2fb1bd;};'use strict';var SquareProjectEvents=require(_0x9a1c('0x0'));var events=[_0x9a1c('0x1'),'remove','update'];function createListener(_0xe1161e,_0x5d2fb0){return function(_0x378b2e){_0x5d2fb0['emit'](_0xe1161e,_0x378b2e);};}function removeListener(_0x48a641,_0x55e9fe){return function(){SquareProjectEvents[_0x9a1c('0x2')](_0x48a641,_0x55e9fe);};}exports[_0x9a1c('0x3')]=function(_0xffe748){for(var _0x558971=0x0,_0xe96382=events[_0x9a1c('0x4')];_0x558971<_0xe96382;_0x558971++){var _0x1c4b37=events[_0x558971];var _0x517cf9=createListener('squareProject:'+_0x1c4b37,_0xffe748);SquareProjectEvents['on'](_0x1c4b37,_0x517cf9);}}; \ No newline at end of file +var _0xc63e=['length','squareProject:','./squareProject.events','save','update','emit','register'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xc63e,0x113));var _0xec63=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xc63e[_0x34021d];return _0x16597b;};'use strict';var SquareProjectEvents=require(_0xec63('0x0'));var events=[_0xec63('0x1'),'remove',_0xec63('0x2')];function createListener(_0x570c6b,_0x4ced7b){return function(_0x222b4d){_0x4ced7b[_0xec63('0x3')](_0x570c6b,_0x222b4d);};}function removeListener(_0x50dd53,_0x3d6707){return function(){SquareProjectEvents['removeListener'](_0x50dd53,_0x3d6707);};}exports[_0xec63('0x4')]=function(_0x51d394){for(var _0x120f36=0x0,_0x192a86=events[_0xec63('0x5')];_0x120f36<_0x192a86;_0x120f36++){var _0x521446=events[_0x120f36];var _0x494d11=createListener(_0xec63('0x6')+_0x521446,_0x51d394);SquareProjectEvents['on'](_0x521446,_0x494d11);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 6accdc5..b3c3fdb 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x4106be,_0x2c9af4){var _0x4542f7=function(_0x1a74ec){while(--_0x1a74ec){_0x4106be['push'](_0x4106be['shift']());}};_0x4542f7(++_0x2c9af4);}(_0x53ec,0x192));var _0xc53e=function(_0x40d79b,_0x22a83d){_0x40d79b=_0x40d79b-0x0;var _0x3ff7a7=_0x53ec[_0x40d79b];return _0x3ff7a7;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x65f9e8,_0x47e2c9){var _0x3f9379=function(_0x29746f){while(--_0x29746f){_0x65f9e8['push'](_0x65f9e8['shift']());}};_0x3f9379(++_0x47e2c9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 76f48b2..72d47bf 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 _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x3b0b07,_0xc927c6){var _0x198e38=function(_0x19377d){while(--_0x19377d){_0x3b0b07['push'](_0x3b0b07['shift']());}};_0x198e38(++_0xc927c6);}(_0x2675,0x75));var _0x5267=function(_0x33f5cb,_0x1db1af){_0x33f5cb=_0x33f5cb-0x0;var _0x307e31=_0x2675[_0x33f5cb];return _0x307e31;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x5fc3[_0x4cd21c];return _0x5d8e5e;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'context':{'type':Sequelize[_0x35fc('0x2')]},'extension':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x35fc('0x2')]},'projectName':{'type':Sequelize[_0x35fc('0x2')]},'saveName':{'type':Sequelize[_0x35fc('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x35fc('0x3')],'get':function(){var _0x508b32='';var _0x16e153=this[_0x35fc('0x4')](_0x35fc('0x5'));if(_0x16e153){_0x508b32=_0x16e153[_0x35fc('0x6')](_0x16e153[_0x35fc('0x7')]('.'));}return _0x508b32;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a8faa44..386eba3 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 _0x8797=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher'];(function(_0x39f375,_0x3aa8ec){var _0x463f93=function(_0x290215){while(--_0x290215){_0x39f375['push'](_0x39f375['shift']());}};_0x463f93(++_0x3aa8ec);}(_0x8797,0xbe));var _0x7879=function(_0x13c44d,_0x5e268a){_0x13c44d=_0x13c44d-0x0;var _0x41bbe5=_0x8797[_0x13c44d];return _0x41bbe5;};'use strict';var emlformat=require(_0x7879('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7879('0x1'));var jsonpatch=require(_0x7879('0x2'));var rp=require('request-promise');var moment=require(_0x7879('0x3'));var BPromise=require(_0x7879('0x4'));var Mustache=require(_0x7879('0x5'));var util=require(_0x7879('0x6'));var path=require(_0x7879('0x7'));var sox=require(_0x7879('0x8'));var csv=require('to-csv');var ejs=require(_0x7879('0x9'));var fs=require('fs');var fs_extra=require(_0x7879('0xa'));var _=require(_0x7879('0xb'));var squel=require(_0x7879('0xc'));var crypto=require(_0x7879('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7879('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7879('0xf'));var qs=require(_0x7879('0x10'));var as=require(_0x7879('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7879('0x12'))('api');var utils=require(_0x7879('0x13'));var config=require(_0x7879('0x14'));var licenseUtil=require(_0x7879('0x15'));var db=require(_0x7879('0x16'))['db'];function respondWithStatusCode(_0x12585e,_0xd1e8ee){_0xd1e8ee=_0xd1e8ee||0xcc;return function(_0x3e9921){if(_0x3e9921){return _0x12585e[_0x7879('0x17')](_0xd1e8ee);}return _0x12585e[_0x7879('0x18')](_0xd1e8ee)[_0x7879('0x19')]();};}function respondWithResult(_0xa8017e,_0x4b5765){_0x4b5765=_0x4b5765||0xc8;return function(_0x38937f){if(_0x38937f){return _0xa8017e[_0x7879('0x18')](_0x4b5765)[_0x7879('0x1a')](_0x38937f);}};}function respondWithFilteredResult(_0xa3b3c1,_0x3a53e5){return function(_0x307404){if(_0x307404){var _0x5d6e47=typeof _0x3a53e5['offset']===_0x7879('0x1b')&&typeof _0x3a53e5['limit']===_0x7879('0x1b');var _0x41408f=_0x307404['count'];var _0x239a92=_0x5d6e47?0x0:_0x3a53e5[_0x7879('0x1c')];var _0x89d6dd=_0x5d6e47?_0x307404[_0x7879('0x1d')]:_0x3a53e5[_0x7879('0x1c')]+_0x3a53e5[_0x7879('0x1e')];var _0x1ce3bb;if(_0x89d6dd>=_0x41408f){_0x89d6dd=_0x41408f;_0x1ce3bb=0xc8;}else{_0x1ce3bb=0xce;}_0xa3b3c1[_0x7879('0x18')](_0x1ce3bb);return _0xa3b3c1[_0x7879('0x1f')]('Content-Range',_0x239a92+'-'+_0x89d6dd+'/'+_0x41408f)[_0x7879('0x1a')](_0x307404);}return null;};}function patchUpdates(_0x500a1f){return function(_0x26dc5f){try{jsonpatch['apply'](_0x26dc5f,_0x500a1f,!![]);}catch(_0x941aef){return BPromise[_0x7879('0x20')](_0x941aef);}return _0x26dc5f['save']();};}function saveUpdates(_0x3f9e73,_0xcbe7db){return function(_0x576a05){if(_0x576a05){return _0x576a05['update'](_0x3f9e73)[_0x7879('0x21')](function(_0x1fc997){return _0x1fc997;});}return null;};}function removeEntity(_0x289fa6,_0x20b9d3){return function(_0x21e2ca){if(_0x21e2ca){return _0x21e2ca[_0x7879('0x22')]()['then'](function(){_0x289fa6[_0x7879('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c29d7,_0x2c1c6d){return function(_0x4b836d){if(!_0x4b836d){_0x3c29d7[_0x7879('0x17')](0x194);}return _0x4b836d;};}function handleError(_0x4516fc,_0x5ba6ab){_0x5ba6ab=_0x5ba6ab||0x1f4;return function(_0x4bd535){logger[_0x7879('0x23')](_0x4bd535[_0x7879('0x24')]);if(_0x4bd535[_0x7879('0x25')]){delete _0x4bd535[_0x7879('0x25')];}_0x4516fc[_0x7879('0x18')](_0x5ba6ab)[_0x7879('0x26')](_0x4bd535);};}exports[_0x7879('0x27')]=function(_0x484a16,_0x3ab1a5){var _0x41b6f2={},_0x3cad66={},_0x347a53={'count':0x0,'rows':[]};var _0x1d8c38=_[_0x7879('0x28')](db['SquareRecording']['rawAttributes'],function(_0x44f6ab){return{'name':_0x44f6ab[_0x7879('0x29')],'type':_0x44f6ab[_0x7879('0x2a')][_0x7879('0x2b')]};});_0x3cad66[_0x7879('0x2c')]=_['map'](_0x1d8c38,_0x7879('0x25'));_0x3cad66[_0x7879('0x2d')]=_['keys'](_0x484a16[_0x7879('0x2d')]);_0x3cad66[_0x7879('0x2e')]=_[_0x7879('0x2f')](_0x3cad66[_0x7879('0x2c')],_0x3cad66[_0x7879('0x2d')]);_0x41b6f2['attributes']=_[_0x7879('0x2f')](_0x3cad66[_0x7879('0x2c')],qs[_0x7879('0x30')](_0x484a16[_0x7879('0x2d')][_0x7879('0x30')]));_0x41b6f2['attributes']=_0x41b6f2[_0x7879('0x31')][_0x7879('0x32')]?_0x41b6f2[_0x7879('0x31')]:_0x3cad66[_0x7879('0x2c')];if(!_0x484a16[_0x7879('0x2d')][_0x7879('0x33')](_0x7879('0x34'))){_0x41b6f2['limit']=qs[_0x7879('0x1e')](_0x484a16[_0x7879('0x2d')][_0x7879('0x1e')]);_0x41b6f2[_0x7879('0x1c')]=qs[_0x7879('0x1c')](_0x484a16['query'][_0x7879('0x1c')]);}_0x41b6f2[_0x7879('0x35')]=qs[_0x7879('0x36')](_0x484a16['query'][_0x7879('0x36')]);_0x41b6f2[_0x7879('0x37')]=qs[_0x7879('0x2e')](_[_0x7879('0x38')](_0x484a16['query'],_0x3cad66[_0x7879('0x2e')]),_0x1d8c38);if(_0x484a16[_0x7879('0x2d')][_0x7879('0x39')]){_0x41b6f2[_0x7879('0x37')]=_[_0x7879('0x3a')](_0x41b6f2[_0x7879('0x37')],{'$or':_[_0x7879('0x28')](_0x1d8c38,function(_0x2bdd4b){if(_0x2bdd4b[_0x7879('0x2a')]!=='VIRTUAL'){var _0x221f44={};_0x221f44[_0x2bdd4b['name']]={'$like':'%'+_0x484a16[_0x7879('0x2d')][_0x7879('0x39')]+'%'};return _0x221f44;}})});}_0x41b6f2=_[_0x7879('0x3a')]({},_0x41b6f2,_0x484a16[_0x7879('0x3b')]);var _0x1dfe15={'where':_0x41b6f2['where']};return db[_0x7879('0x3c')][_0x7879('0x1d')](_0x1dfe15)[_0x7879('0x21')](function(_0x507c0b){_0x347a53[_0x7879('0x1d')]=_0x507c0b;if(_0x484a16[_0x7879('0x2d')][_0x7879('0x3d')]){_0x41b6f2[_0x7879('0x3e')]=[{'all':!![]}];}return db[_0x7879('0x3c')][_0x7879('0x3f')](_0x41b6f2);})[_0x7879('0x21')](function(_0xa22fb5){_0x347a53[_0x7879('0x40')]=_0xa22fb5;return _0x347a53;})['then'](respondWithFilteredResult(_0x3ab1a5,_0x41b6f2))[_0x7879('0x41')](handleError(_0x3ab1a5,null));};exports[_0x7879('0x42')]=function(_0x47ea0b,_0x488b9a){var _0x3ca7ec={'raw':!![],'where':{'id':_0x47ea0b[_0x7879('0x43')]['id']}},_0x1b3f84={};_0x1b3f84[_0x7879('0x2c')]=_[_0x7879('0x44')](db['SquareRecording'][_0x7879('0x45')]);_0x1b3f84['query']=_[_0x7879('0x44')](_0x47ea0b[_0x7879('0x2d')]);_0x1b3f84[_0x7879('0x2e')]=_[_0x7879('0x2f')](_0x1b3f84[_0x7879('0x2c')],_0x1b3f84[_0x7879('0x2d')]);_0x3ca7ec[_0x7879('0x31')]=_[_0x7879('0x2f')](_0x1b3f84[_0x7879('0x2c')],qs[_0x7879('0x30')](_0x47ea0b[_0x7879('0x2d')]['fields']));_0x3ca7ec[_0x7879('0x31')]=_0x3ca7ec[_0x7879('0x31')][_0x7879('0x32')]?_0x3ca7ec['attributes']:_0x1b3f84[_0x7879('0x2c')];if(_0x47ea0b[_0x7879('0x2d')][_0x7879('0x3d')]){_0x3ca7ec[_0x7879('0x3e')]=[{'all':!![]}];}_0x3ca7ec=_[_0x7879('0x3a')]({},_0x3ca7ec,_0x47ea0b[_0x7879('0x3b')]);return db[_0x7879('0x3c')][_0x7879('0x46')](_0x3ca7ec)['then'](handleEntityNotFound(_0x488b9a,null))[_0x7879('0x21')](respondWithResult(_0x488b9a,null))[_0x7879('0x41')](handleError(_0x488b9a,null));};exports[_0x7879('0x47')]=function(_0x3043db,_0x3776c0){return db[_0x7879('0x3c')][_0x7879('0x47')](_0x3043db['body'],{})['then'](respondWithResult(_0x3776c0,0xc9))[_0x7879('0x41')](handleError(_0x3776c0,null));};exports['update']=function(_0x43f5ab,_0x2013b0){if(_0x43f5ab[_0x7879('0x48')]['id']){delete _0x43f5ab['body']['id'];}return db[_0x7879('0x3c')][_0x7879('0x46')]({'where':{'id':_0x43f5ab[_0x7879('0x43')]['id']}})[_0x7879('0x21')](handleEntityNotFound(_0x2013b0,null))[_0x7879('0x21')](saveUpdates(_0x43f5ab[_0x7879('0x48')],null))[_0x7879('0x21')](respondWithResult(_0x2013b0,null))[_0x7879('0x41')](handleError(_0x2013b0,null));};exports[_0x7879('0x49')]=function(_0x332130,_0x35c048,_0x558729){var _0x1e5036=require(_0x7879('0x4a'));var _0x434379=![];var _0x593f45={};if(_0x332130[_0x7879('0x2d')]['type']&&_0x332130[_0x7879('0x2d')][_0x7879('0x2a')]==='uniqueid'){_0x593f45[_0x7879('0x4b')]=_0x332130[_0x7879('0x43')]['id'];}else{_0x593f45['id']=_0x332130[_0x7879('0x43')]['id'];}return db[_0x7879('0x3c')]['find']({'where':_0x593f45,'attributes':['id',_0x7879('0x4c'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x35c048,null))[_0x7879('0x21')](function(_0x1534c2){if(_0x1534c2){var _0x15ab87=_0x1534c2[_0x7879('0x4c')];var _0x3e388c=util['format'](_0x7879('0x4d'),_0x15ab87);if(fs[_0x7879('0x4e')](_0x3e388c)){_0x434379=!![];return _0x1e5036[_0x7879('0x4f')](_0x3e388c,_0x15ab87,config[_0x7879('0x50')][_0x7879('0x51')])[_0x7879('0x21')](function(){return _0x1534c2;});}return _0x1534c2;}})['then'](function(_0xf1b28f){if(_0xf1b28f){var _0x6dd875=_0xf1b28f['savePath'];if(!fs[_0x7879('0x4e')](_0x6dd875)){throw new db[(_0x7879('0x52'))]['ValidationError'](_0x7879('0x53'));}if(_0xf1b28f['filename']){return _0x35c048[_0x7879('0x49')](_0x6dd875,_0xf1b28f[_0x7879('0x54')]+path['extname'](_0x6dd875),function(){if(_0x434379){fs['unlink'](_0x6dd875);}});}else{return _0x35c048[_0x7879('0x49')](_0x6dd875,function(_0x5cccb4){if(_0x434379){fs[_0x7879('0x55')](_0x6dd875);}});}}})[_0x7879('0x41')](function(_0x13b558){if(_0x13b558[_0x7879('0x56')]===_0x7879('0x53')){_0x35c048['status'](0x194)['send'](_0x7879('0x57'));}else{return handleError(_0x35c048,null);}});};exports[_0x7879('0x22')]=function(_0x197f37,_0x52919e){return db[_0x7879('0x3c')]['find']({'where':{'id':_0x197f37['params']['id']}})[_0x7879('0x21')](function(_0x4492cc){if(_['isNil'](_0x4492cc)){throw new ReferenceError(_0x7879('0x58'));}return _0x4492cc;})[_0x7879('0x21')](function(_0x41a8b4){var _0x10c329=_0x41a8b4[_0x7879('0x4c')];logger[_0x7879('0x59')](_0x7879('0x5a'),_0x10c329);if(!_[_0x7879('0x5b')](_0x41a8b4[_0x7879('0x4c')])&&fs['existsSync'](_0x10c329)){logger[_0x7879('0x59')](_0x7879('0x5c')+_0x10c329+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7879('0x5d')](_0x10c329);}_0x10c329=_0x10c329+_0x7879('0x5e');if(!_[_0x7879('0x5b')](_0x41a8b4['savePath'])&&fs[_0x7879('0x4e')](_0x10c329)){logger[_0x7879('0x59')](_0x7879('0x5c')+_0x10c329+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7879('0x5d')](_0x10c329);}return _0x41a8b4;})[_0x7879('0x21')](function(_0x3f5a1a){if(!_0x3f5a1a)throw new InternalError();return _0x3f5a1a['destroy']();})[_0x7879('0x21')](function(){_0x52919e['status'](0xcc)[_0x7879('0x19')]();})[_0x7879('0x41')](handleError(_0x52919e,null));}; \ No newline at end of file +var _0xe8c5=['Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','reject','then','end','error','name','index','SquareRecording','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','offset','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','length','options','find','create','body','download','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','send'];(function(_0x38488c,_0x46dc06){var _0x4ab3dc=function(_0x8f3c31){while(--_0x8f3c31){_0x38488c['push'](_0x38488c['shift']());}};_0x4ab3dc(++_0x46dc06);}(_0xe8c5,0x186));var _0x5e8c=function(_0x18b026,_0x3064a0){_0x18b026=_0x18b026-0x0;var _0x6f4134=_0xe8c5[_0x18b026];return _0x6f4134;};'use strict';var emlformat=require(_0x5e8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e8c('0x1'));var jsonpatch=require(_0x5e8c('0x2'));var rp=require(_0x5e8c('0x3'));var moment=require(_0x5e8c('0x4'));var BPromise=require(_0x5e8c('0x5'));var Mustache=require(_0x5e8c('0x6'));var util=require(_0x5e8c('0x7'));var path=require(_0x5e8c('0x8'));var sox=require(_0x5e8c('0x9'));var csv=require(_0x5e8c('0xa'));var ejs=require(_0x5e8c('0xb'));var fs=require('fs');var fs_extra=require(_0x5e8c('0xc'));var _=require(_0x5e8c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5e8c('0xe'));var deskjs=require(_0x5e8c('0xf'));var toCsv=require(_0x5e8c('0xa'));var querystring=require('querystring');var Papa=require(_0x5e8c('0x10'));var Redis=require(_0x5e8c('0x11'));var authService=require(_0x5e8c('0x12'));var qs=require(_0x5e8c('0x13'));var as=require(_0x5e8c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e8c('0x15'));var db=require(_0x5e8c('0x16'))['db'];function respondWithStatusCode(_0x3692c0,_0x64baef){_0x64baef=_0x64baef||0xcc;return function(_0x489da3){if(_0x489da3){return _0x3692c0[_0x5e8c('0x17')](_0x64baef);}return _0x3692c0[_0x5e8c('0x18')](_0x64baef)['end']();};}function respondWithResult(_0x42023f,_0x5813d9){_0x5813d9=_0x5813d9||0xc8;return function(_0x1c8465){if(_0x1c8465){return _0x42023f[_0x5e8c('0x18')](_0x5813d9)[_0x5e8c('0x19')](_0x1c8465);}};}function respondWithFilteredResult(_0x37f480,_0x1a9b9a){return function(_0x564ada){if(_0x564ada){var _0x217a34=typeof _0x1a9b9a['offset']===_0x5e8c('0x1a')&&typeof _0x1a9b9a['limit']===_0x5e8c('0x1a');var _0x49bbc2=_0x564ada[_0x5e8c('0x1b')];var _0x103053=_0x217a34?0x0:_0x1a9b9a['offset'];var _0x527789=_0x217a34?_0x564ada['count']:_0x1a9b9a['offset']+_0x1a9b9a[_0x5e8c('0x1c')];var _0x1927fe;if(_0x527789>=_0x49bbc2){_0x527789=_0x49bbc2;_0x1927fe=0xc8;}else{_0x1927fe=0xce;}_0x37f480[_0x5e8c('0x18')](_0x1927fe);return _0x37f480[_0x5e8c('0x1d')](_0x5e8c('0x1e'),_0x103053+'-'+_0x527789+'/'+_0x49bbc2)[_0x5e8c('0x19')](_0x564ada);}return null;};}function patchUpdates(_0x2ac641){return function(_0x59613b){try{jsonpatch[_0x5e8c('0x1f')](_0x59613b,_0x2ac641,!![]);}catch(_0x5cf721){return BPromise[_0x5e8c('0x20')](_0x5cf721);}return _0x59613b['save']();};}function saveUpdates(_0x20ae3e,_0x57159b){return function(_0x198321){if(_0x198321){return _0x198321['update'](_0x20ae3e)[_0x5e8c('0x21')](function(_0x46b6e6){return _0x46b6e6;});}return null;};}function removeEntity(_0x3aad59,_0x5528cc){return function(_0x5688d2){if(_0x5688d2){return _0x5688d2['destroy']()['then'](function(){_0x3aad59[_0x5e8c('0x18')](0xcc)[_0x5e8c('0x22')]();});}};}function handleEntityNotFound(_0xc8e862,_0x2829a9){return function(_0x2ca107){if(!_0x2ca107){_0xc8e862[_0x5e8c('0x17')](0x194);}return _0x2ca107;};}function handleError(_0x1809c9,_0x1d3cec){_0x1d3cec=_0x1d3cec||0x1f4;return function(_0x13ad57){logger[_0x5e8c('0x23')](_0x13ad57['stack']);if(_0x13ad57[_0x5e8c('0x24')]){delete _0x13ad57[_0x5e8c('0x24')];}_0x1809c9['status'](_0x1d3cec)['send'](_0x13ad57);};}exports[_0x5e8c('0x25')]=function(_0x217c08,_0x587a71){var _0x24e0b9={},_0x3443be={},_0x3b4237={'count':0x0,'rows':[]};var _0x209bb4=_['map'](db[_0x5e8c('0x26')][_0x5e8c('0x27')],function(_0x580d0c){return{'name':_0x580d0c[_0x5e8c('0x28')],'type':_0x580d0c['type'][_0x5e8c('0x29')]};});_0x3443be[_0x5e8c('0x2a')]=_[_0x5e8c('0x2b')](_0x209bb4,_0x5e8c('0x24'));_0x3443be[_0x5e8c('0x2c')]=_[_0x5e8c('0x2d')](_0x217c08['query']);_0x3443be[_0x5e8c('0x2e')]=_[_0x5e8c('0x2f')](_0x3443be[_0x5e8c('0x2a')],_0x3443be[_0x5e8c('0x2c')]);_0x24e0b9[_0x5e8c('0x30')]=_[_0x5e8c('0x2f')](_0x3443be['model'],qs[_0x5e8c('0x31')](_0x217c08[_0x5e8c('0x2c')]['fields']));_0x24e0b9['attributes']=_0x24e0b9[_0x5e8c('0x30')]['length']?_0x24e0b9['attributes']:_0x3443be['model'];if(!_0x217c08[_0x5e8c('0x2c')]['hasOwnProperty'](_0x5e8c('0x32'))){_0x24e0b9[_0x5e8c('0x1c')]=qs[_0x5e8c('0x1c')](_0x217c08['query'][_0x5e8c('0x1c')]);_0x24e0b9['offset']=qs[_0x5e8c('0x33')](_0x217c08[_0x5e8c('0x2c')][_0x5e8c('0x33')]);}_0x24e0b9['order']=qs[_0x5e8c('0x34')](_0x217c08[_0x5e8c('0x2c')][_0x5e8c('0x34')]);_0x24e0b9['where']=qs[_0x5e8c('0x2e')](_[_0x5e8c('0x35')](_0x217c08[_0x5e8c('0x2c')],_0x3443be[_0x5e8c('0x2e')]),_0x209bb4);if(_0x217c08[_0x5e8c('0x2c')][_0x5e8c('0x36')]){_0x24e0b9[_0x5e8c('0x37')]=_['merge'](_0x24e0b9[_0x5e8c('0x37')],{'$or':_['map'](_0x209bb4,function(_0x22da94){if(_0x22da94['type']!==_0x5e8c('0x38')){var _0x53db92={};_0x53db92[_0x22da94[_0x5e8c('0x24')]]={'$like':'%'+_0x217c08[_0x5e8c('0x2c')]['filter']+'%'};return _0x53db92;}})});}_0x24e0b9=_[_0x5e8c('0x39')]({},_0x24e0b9,_0x217c08['options']);var _0x3b3f4c={'where':_0x24e0b9[_0x5e8c('0x37')]};return db[_0x5e8c('0x26')][_0x5e8c('0x1b')](_0x3b3f4c)[_0x5e8c('0x21')](function(_0xf929df){_0x3b4237[_0x5e8c('0x1b')]=_0xf929df;if(_0x217c08[_0x5e8c('0x2c')]['includeAll']){_0x24e0b9[_0x5e8c('0x3a')]=[{'all':!![]}];}return db[_0x5e8c('0x26')][_0x5e8c('0x3b')](_0x24e0b9);})[_0x5e8c('0x21')](function(_0x4123c2){_0x3b4237[_0x5e8c('0x3c')]=_0x4123c2;return _0x3b4237;})['then'](respondWithFilteredResult(_0x587a71,_0x24e0b9))[_0x5e8c('0x3d')](handleError(_0x587a71,null));};exports[_0x5e8c('0x3e')]=function(_0x48e3ad,_0x2eb847){var _0x3978c3={'raw':!![],'where':{'id':_0x48e3ad[_0x5e8c('0x3f')]['id']}},_0x731160={};_0x731160['model']=_[_0x5e8c('0x2d')](db[_0x5e8c('0x26')]['rawAttributes']);_0x731160[_0x5e8c('0x2c')]=_[_0x5e8c('0x2d')](_0x48e3ad[_0x5e8c('0x2c')]);_0x731160[_0x5e8c('0x2e')]=_[_0x5e8c('0x2f')](_0x731160[_0x5e8c('0x2a')],_0x731160[_0x5e8c('0x2c')]);_0x3978c3['attributes']=_[_0x5e8c('0x2f')](_0x731160[_0x5e8c('0x2a')],qs[_0x5e8c('0x31')](_0x48e3ad[_0x5e8c('0x2c')][_0x5e8c('0x31')]));_0x3978c3[_0x5e8c('0x30')]=_0x3978c3[_0x5e8c('0x30')][_0x5e8c('0x40')]?_0x3978c3[_0x5e8c('0x30')]:_0x731160[_0x5e8c('0x2a')];if(_0x48e3ad[_0x5e8c('0x2c')]['includeAll']){_0x3978c3[_0x5e8c('0x3a')]=[{'all':!![]}];}_0x3978c3=_[_0x5e8c('0x39')]({},_0x3978c3,_0x48e3ad[_0x5e8c('0x41')]);return db[_0x5e8c('0x26')][_0x5e8c('0x42')](_0x3978c3)['then'](handleEntityNotFound(_0x2eb847,null))['then'](respondWithResult(_0x2eb847,null))[_0x5e8c('0x3d')](handleError(_0x2eb847,null));};exports[_0x5e8c('0x43')]=function(_0x5e12d0,_0x1fd198){return db[_0x5e8c('0x26')][_0x5e8c('0x43')](_0x5e12d0['body'],{})[_0x5e8c('0x21')](respondWithResult(_0x1fd198,0xc9))[_0x5e8c('0x3d')](handleError(_0x1fd198,null));};exports['update']=function(_0x4493ab,_0x31b365){if(_0x4493ab[_0x5e8c('0x44')]['id']){delete _0x4493ab['body']['id'];}return db[_0x5e8c('0x26')][_0x5e8c('0x42')]({'where':{'id':_0x4493ab['params']['id']}})[_0x5e8c('0x21')](handleEntityNotFound(_0x31b365,null))['then'](saveUpdates(_0x4493ab[_0x5e8c('0x44')],null))['then'](respondWithResult(_0x31b365,null))[_0x5e8c('0x3d')](handleError(_0x31b365,null));};exports[_0x5e8c('0x45')]=function(_0xf4393,_0x2c2e47,_0x5be5d4){var _0x3a494a=require(_0x5e8c('0x46'));var _0x59f7c5=![];var _0x5bb326={};if(_0xf4393['query'][_0x5e8c('0x47')]&&_0xf4393[_0x5e8c('0x2c')][_0x5e8c('0x47')]===_0x5e8c('0x48')){_0x5bb326['uniqueid']=_0xf4393['params']['id'];}else{_0x5bb326['id']=_0xf4393[_0x5e8c('0x3f')]['id'];}return db[_0x5e8c('0x26')]['find']({'where':_0x5bb326,'attributes':['id',_0x5e8c('0x49'),_0x5e8c('0x4a')],'raw':!![]})[_0x5e8c('0x21')](handleEntityNotFound(_0x2c2e47,null))[_0x5e8c('0x21')](function(_0x1fd2a6){if(_0x1fd2a6){var _0x5dc33e=_0x1fd2a6['savePath'];var _0x4a7bb4=util[_0x5e8c('0x4b')](_0x5e8c('0x4c'),_0x5dc33e);if(fs[_0x5e8c('0x4d')](_0x4a7bb4)){_0x59f7c5=!![];return _0x3a494a['decryptFile'](_0x4a7bb4,_0x5dc33e,config[_0x5e8c('0x4e')][_0x5e8c('0x4f')])['then'](function(){return _0x1fd2a6;});}return _0x1fd2a6;}})[_0x5e8c('0x21')](function(_0x2e24f3){if(_0x2e24f3){var _0x472897=_0x2e24f3[_0x5e8c('0x49')];if(!fs[_0x5e8c('0x4d')](_0x472897)){throw new db[(_0x5e8c('0x50'))][(_0x5e8c('0x51'))](_0x5e8c('0x52'));}if(_0x2e24f3[_0x5e8c('0x4a')]){return _0x2c2e47[_0x5e8c('0x45')](_0x472897,_0x2e24f3[_0x5e8c('0x4a')]+path['extname'](_0x472897),function(){if(_0x59f7c5){fs['unlink'](_0x472897);}});}else{return _0x2c2e47['download'](_0x472897,function(_0x7ae7b6){if(_0x59f7c5){fs[_0x5e8c('0x53')](_0x472897);}});}}})[_0x5e8c('0x3d')](function(_0x229a67){if(_0x229a67['message']==='SquareRecording\x20not\x20found'){_0x2c2e47[_0x5e8c('0x18')](0x194)[_0x5e8c('0x54')](_0x5e8c('0x55'));}else{return handleError(_0x2c2e47,null);}});};exports[_0x5e8c('0x56')]=function(_0x2668e8,_0x4ddc70){return db[_0x5e8c('0x26')][_0x5e8c('0x42')]({'where':{'id':_0x2668e8['params']['id']}})[_0x5e8c('0x21')](function(_0x42d179){if(_[_0x5e8c('0x57')](_0x42d179)){throw new ReferenceError(_0x5e8c('0x58'));}return _0x42d179;})[_0x5e8c('0x21')](function(_0x236c0a){var _0x140fd8=_0x236c0a[_0x5e8c('0x49')];logger[_0x5e8c('0x59')](_0x5e8c('0x5a'),_0x140fd8);if(!_[_0x5e8c('0x57')](_0x236c0a[_0x5e8c('0x49')])&&fs[_0x5e8c('0x4d')](_0x140fd8)){logger[_0x5e8c('0x59')](_0x5e8c('0x5b')+_0x140fd8+_0x5e8c('0x5c'));fs[_0x5e8c('0x5d')](_0x140fd8);}_0x140fd8=_0x140fd8+_0x5e8c('0x5e');if(!_['isNil'](_0x236c0a[_0x5e8c('0x49')])&&fs[_0x5e8c('0x4d')](_0x140fd8)){logger['info'](_0x5e8c('0x5b')+_0x140fd8+_0x5e8c('0x5c'));fs['unlinkSync'](_0x140fd8);}return _0x236c0a;})['then'](function(_0x2ae1b5){if(!_0x2ae1b5)throw new InternalError();return _0x2ae1b5[_0x5e8c('0x56')]();})['then'](function(){_0x4ddc70[_0x5e8c('0x18')](0xcc)[_0x5e8c('0x22')]();})[_0x5e8c('0x3d')](handleError(_0x4ddc70,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c33013e..04874da 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 _0x8325=['request-promise','path','rimraf','../../config/environment','define','SquareRecording','square_recordings','lodash','../../config/logger','moment'];(function(_0x20765e,_0x4ef104){var _0x4a6213=function(_0x18cf51){while(--_0x18cf51){_0x20765e['push'](_0x20765e['shift']());}};_0x4a6213(++_0x4ef104);}(_0x8325,0x1f1));var _0x5832=function(_0x33eeed,_0x384069){_0x33eeed=_0x33eeed-0x0;var _0x28702a=_0x8325[_0x33eeed];return _0x28702a;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var logger=require(_0x5832('0x1'))('api');var moment=require(_0x5832('0x2'));var BPromise=require('bluebird');var rp=require(_0x5832('0x3'));var fs=require('fs');var path=require(_0x5832('0x4'));var rimraf=require(_0x5832('0x5'));var config=require(_0x5832('0x6'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x1c40ca,_0x2c7977){return _0x1c40ca[_0x5832('0x7')](_0x5832('0x8'),attributes,{'tableName':_0x5832('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x761c=['api','bluebird','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','../../config/logger'];(function(_0x16da58,_0x4ffcd8){var _0x3e96c6=function(_0xab9a17){while(--_0xab9a17){_0x16da58['push'](_0x16da58['shift']());}};_0x3e96c6(++_0x4ffcd8);}(_0x761c,0x18a));var _0xc761=function(_0x198a81,_0x3463d8){_0x198a81=_0x198a81-0x0;var _0x1725da=_0x761c[_0x198a81];return _0x1725da;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var logger=require(_0xc761('0x1'))(_0xc761('0x2'));var moment=require('moment');var BPromise=require(_0xc761('0x3'));var rp=require(_0xc761('0x4'));var fs=require('fs');var path=require(_0xc761('0x5'));var rimraf=require('rimraf');var config=require(_0xc761('0x6'));var attributes=require('./squareRecording.attributes');module[_0xc761('0x7')]=function(_0x468f51,_0x23ba0b){return _0x468f51[_0xc761('0x8')](_0xc761('0x9'),attributes,{'tableName':_0xc761('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 2866e3e..c11a7ea 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 _0x806b=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','body','options','raw','CreateSquareRecording','catch'];(function(_0x1da289,_0x417651){var _0x41c889=function(_0x2cea8c){while(--_0x2cea8c){_0x1da289['push'](_0x1da289['shift']());}};_0x41c889(++_0x417651);}(_0x806b,0x12c));var _0xb806=function(_0x5eb318,_0x5126fb){_0x5eb318=_0x5eb318-0x0;var _0x18c405=_0x806b[_0x5eb318];return _0x18c405;};'use strict';var _=require(_0xb806('0x0'));var util=require('util');var moment=require(_0xb806('0x1'));var BPromise=require('bluebird');var rs=require(_0xb806('0x2'));var fs=require('fs');var Redis=require(_0xb806('0x3'));var db=require(_0xb806('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb806('0x5'))(_0xb806('0x6'));var config=require(_0xb806('0x7'));var jayson=require(_0xb806('0x8'));var client=jayson[_0xb806('0x9')][_0xb806('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x121144,_0x31cc11,_0x3a4b00){return new BPromise(function(_0x3c0284,_0x4b621e){return client['request'](_0x121144,_0x3a4b00)[_0xb806('0xb')](function(_0x5cb92a){logger[_0xb806('0xc')](_0xb806('0xd'),_0x31cc11,'request\x20sent');logger[_0xb806('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x31cc11,_0xb806('0xf'),JSON[_0xb806('0x10')](_0x5cb92a));if(_0x5cb92a[_0xb806('0x11')]){if(_0x5cb92a[_0xb806('0x11')]['code']===0x1f4){logger[_0xb806('0x11')](_0xb806('0xd'),_0x31cc11,_0x5cb92a['error']['message']);return _0x4b621e(_0x5cb92a['error']['message']);}logger[_0xb806('0x11')](_0xb806('0xd'),_0x31cc11,_0x5cb92a[_0xb806('0x11')][_0xb806('0x12')]);return _0x3c0284(_0x5cb92a['error']['message']);}else{logger[_0xb806('0xc')](_0xb806('0xd'),_0x31cc11,'request\x20sent');_0x3c0284(_0x5cb92a[_0xb806('0x13')][_0xb806('0x12')]);}})['catch'](function(_0x57c2ad){logger[_0xb806('0x11')](_0xb806('0xd'),_0x31cc11,_0x57c2ad);_0x4b621e(_0x57c2ad);});});}exports['CreateSquareRecording']=function(_0x3897b6){var _0xe4aea0=this;return new Promise(function(_0x2c922f,_0x52faf3){return db['SquareRecording']['create'](_0x3897b6[_0xb806('0x14')],{'raw':_0x3897b6[_0xb806('0x15')]?_0x3897b6[_0xb806('0x15')][_0xb806('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x509e2a){logger[_0xb806('0xc')](_0xb806('0x17'),_0x3897b6);logger['debug'](_0xb806('0x17'),_0x3897b6,JSON[_0xb806('0x10')](_0x509e2a));_0x2c922f(_0x509e2a);})[_0xb806('0x18')](function(_0x47de7f){logger['error']('CreateSquareRecording',_0x47de7f['message'],_0x3897b6);_0x52faf3(_0xe4aea0[_0xb806('0x11')](0x1f4,_0x47de7f[_0xb806('0x12')]));});});}; \ No newline at end of file +var _0xc432=['result','catch','CreateSquareRecording','SquareRecording','options','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','SquareRecording,\x20%s,\x20%s','message'];(function(_0x5bd652,_0xc8688a){var _0x1cec89=function(_0x4766b1){while(--_0x4766b1){_0x5bd652['push'](_0x5bd652['shift']());}};_0x1cec89(++_0xc8688a);}(_0xc432,0x11f));var _0x2c43=function(_0x1edc98,_0x183815){_0x1edc98=_0x1edc98-0x0;var _0xa462da=_0xc432[_0x1edc98];return _0xa462da;};'use strict';var _=require(_0x2c43('0x0'));var util=require(_0x2c43('0x1'));var moment=require(_0x2c43('0x2'));var BPromise=require(_0x2c43('0x3'));var rs=require(_0x2c43('0x4'));var fs=require('fs');var Redis=require(_0x2c43('0x5'));var db=require(_0x2c43('0x6'))['db'];var utils=require(_0x2c43('0x7'));var logger=require(_0x2c43('0x8'))(_0x2c43('0x9'));var config=require(_0x2c43('0xa'));var jayson=require(_0x2c43('0xb'));var client=jayson['client'][_0x2c43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c8b52,_0x2a9196,_0x51d991){return new BPromise(function(_0x5254d5,_0x3be6c9){return client[_0x2c43('0xd')](_0x4c8b52,_0x51d991)[_0x2c43('0xe')](function(_0x467cb5){logger[_0x2c43('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2a9196,_0x2c43('0x10'));logger['debug'](_0x2c43('0x11'),_0x2a9196,_0x2c43('0x10'),JSON['stringify'](_0x467cb5));if(_0x467cb5['error']){if(_0x467cb5[_0x2c43('0x12')]['code']===0x1f4){logger[_0x2c43('0x12')](_0x2c43('0x13'),_0x2a9196,_0x467cb5[_0x2c43('0x12')][_0x2c43('0x14')]);return _0x3be6c9(_0x467cb5['error'][_0x2c43('0x14')]);}logger[_0x2c43('0x12')](_0x2c43('0x13'),_0x2a9196,_0x467cb5[_0x2c43('0x12')][_0x2c43('0x14')]);return _0x5254d5(_0x467cb5[_0x2c43('0x12')][_0x2c43('0x14')]);}else{logger[_0x2c43('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2a9196,_0x2c43('0x10'));_0x5254d5(_0x467cb5[_0x2c43('0x15')]['message']);}})[_0x2c43('0x16')](function(_0x594854){logger[_0x2c43('0x12')]('SquareRecording,\x20%s,\x20%s',_0x2a9196,_0x594854);_0x3be6c9(_0x594854);});});}exports[_0x2c43('0x17')]=function(_0x57cd93){var _0x59d73c=this;return new Promise(function(_0x67be14,_0x36ee90){return db[_0x2c43('0x18')]['create'](_0x57cd93['body'],{'raw':_0x57cd93[_0x2c43('0x19')]?_0x57cd93['options']['raw']===undefined?!![]:![]:!![]})[_0x2c43('0xe')](function(_0x521d43){logger[_0x2c43('0xf')](_0x2c43('0x17'),_0x57cd93);logger[_0x2c43('0x1a')](_0x2c43('0x17'),_0x57cd93,JSON[_0x2c43('0x1b')](_0x521d43));_0x67be14(_0x521d43);})['catch'](function(_0xce5572){logger[_0x2c43('0x12')](_0x2c43('0x17'),_0xce5572[_0x2c43('0x14')],_0x57cd93);_0x36ee90(_0x59d73c[_0x2c43('0x12')](0x1f4,_0xce5572[_0x2c43('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index dd21b08..3341242 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0xda54b1,_0x281f8a){var _0x590204=function(_0x4d16a4){while(--_0x4d16a4){_0xda54b1['push'](_0xda54b1['shift']());}};_0x590204(++_0x281f8a);}(_0xe706,0xa3));var _0x6e70=function(_0x3fe280,_0x1d8260){_0x3fe280=_0x3fe280-0x0;var _0x2e833f=_0xe706[_0x3fe280];return _0x2e833f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index bc1a3b5..3a1f5b2 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 _0x1573=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x435763,_0x1e91ff){var _0x317cee=function(_0x369fbe){while(--_0x369fbe){_0x435763['push'](_0x435763['shift']());}};_0x317cee(++_0x1e91ff);}(_0x1573,0x193));var _0x3157=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x1573[_0x5f1cf8];return _0x27d0fa;};'use strict';var Sequelize=require(_0x3157('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x3157('0x1')]},'request':{'type':Sequelize[_0x3157('0x1')]},'channel':{'type':Sequelize[_0x3157('0x1')]},'language':{'type':Sequelize[_0x3157('0x1')]},'type':{'type':Sequelize[_0x3157('0x1')]},'uniqueid':{'type':Sequelize[_0x3157('0x1')]},'version':{'type':Sequelize[_0x3157('0x1')]},'callerid':{'type':Sequelize[_0x3157('0x1')]},'calleridname':{'type':Sequelize[_0x3157('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x3157('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x3157('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3157('0x1')]},'extension':{'type':Sequelize[_0x3157('0x1')]},'priority':{'type':Sequelize[_0x3157('0x1')]},'enhanced':{'type':Sequelize[_0x3157('0x1')]},'accountcode':{'type':Sequelize[_0x3157('0x1')]},'threadid':{'type':Sequelize[_0x3157('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3157('0x2')]},'leaveAt':{'type':Sequelize[_0x3157('0x2')]},'bot':{'type':Sequelize[_0x3157('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc77d=['exports','STRING','DATE','sequelize'];(function(_0x5639c2,_0x177c4f){var _0x1bc250=function(_0x15acfe){while(--_0x15acfe){_0x5639c2['push'](_0x5639c2['shift']());}};_0x1bc250(++_0x177c4f);}(_0xc77d,0x1e3));var _0xdc77=function(_0x426e12,_0x2b547d){_0x426e12=_0x426e12-0x0;var _0x202fcf=_0xc77d[_0x426e12];return _0x202fcf;};'use strict';var Sequelize=require(_0xdc77('0x0'));module[_0xdc77('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xdc77('0x2')]},'channel':{'type':Sequelize[_0xdc77('0x2')]},'language':{'type':Sequelize[_0xdc77('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdc77('0x2')]},'calleridname':{'type':Sequelize[_0xdc77('0x2')]},'callingpres':{'type':Sequelize[_0xdc77('0x2')]},'callingani2':{'type':Sequelize[_0xdc77('0x2')]},'callington':{'type':Sequelize[_0xdc77('0x2')]},'callingtns':{'type':Sequelize[_0xdc77('0x2')]},'dnid':{'type':Sequelize[_0xdc77('0x2')]},'rdnis':{'type':Sequelize[_0xdc77('0x2')]},'context':{'type':Sequelize[_0xdc77('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdc77('0x2')]},'enhanced':{'type':Sequelize[_0xdc77('0x2')]},'accountcode':{'type':Sequelize[_0xdc77('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xdc77('0x2')]},'joinAt':{'type':Sequelize[_0xdc77('0x3')]},'leaveAt':{'type':Sequelize[_0xdc77('0x3')]},'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 a830a89..d19d2f0 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 _0x6fbe=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x176d50,_0x25621c){var _0x4b0a21=function(_0x402fb8){while(--_0x402fb8){_0x176d50['push'](_0x176d50['shift']());}};_0x4b0a21(++_0x25621c);}(_0x6fbe,0x1ad));var _0xe6fb=function(_0x453304,_0x1b41a2){_0x453304=_0x453304-0x0;var _0x159843=_0x6fbe[_0x453304];return _0x159843;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe6fb('0x0'));var jsonpatch=require(_0xe6fb('0x1'));var rp=require(_0xe6fb('0x2'));var moment=require(_0xe6fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe6fb('0x4'));var util=require('util');var path=require(_0xe6fb('0x5'));var sox=require('sox');var csv=require(_0xe6fb('0x6'));var ejs=require(_0xe6fb('0x7'));var fs=require('fs');var fs_extra=require(_0xe6fb('0x8'));var _=require(_0xe6fb('0x9'));var squel=require(_0xe6fb('0xa'));var crypto=require('crypto');var jsforce=require(_0xe6fb('0xb'));var deskjs=require(_0xe6fb('0xc'));var toCsv=require(_0xe6fb('0x6'));var querystring=require(_0xe6fb('0xd'));var Papa=require(_0xe6fb('0xe'));var Redis=require(_0xe6fb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe6fb('0x10'));var as=require(_0xe6fb('0x11'));var hardwareService=require(_0xe6fb('0x12'));var logger=require(_0xe6fb('0x13'))('api');var utils=require(_0xe6fb('0x14'));var config=require(_0xe6fb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6fb('0x16'))['db'];function respondWithStatusCode(_0x3bcb78,_0x1b4a98){_0x1b4a98=_0x1b4a98||0xcc;return function(_0x548a43){if(_0x548a43){return _0x3bcb78[_0xe6fb('0x17')](_0x1b4a98);}return _0x3bcb78[_0xe6fb('0x18')](_0x1b4a98)[_0xe6fb('0x19')]();};}function respondWithResult(_0xe5c8c3,_0x4db44e){_0x4db44e=_0x4db44e||0xc8;return function(_0x19d8f0){if(_0x19d8f0){return _0xe5c8c3[_0xe6fb('0x18')](_0x4db44e)[_0xe6fb('0x1a')](_0x19d8f0);}};}function respondWithFilteredResult(_0x51cc4f,_0x33d0c9){return function(_0x194d34){if(_0x194d34){var _0x11e730=typeof _0x33d0c9[_0xe6fb('0x1b')]===_0xe6fb('0x1c')&&typeof _0x33d0c9[_0xe6fb('0x1d')]===_0xe6fb('0x1c');var _0x26ce85=_0x194d34['count'];var _0x5c9994=_0x11e730?0x0:_0x33d0c9[_0xe6fb('0x1b')];var _0x4787c4=_0x11e730?_0x194d34[_0xe6fb('0x1e')]:_0x33d0c9['offset']+_0x33d0c9[_0xe6fb('0x1d')];var _0x4facbd;if(_0x4787c4>=_0x26ce85){_0x4787c4=_0x26ce85;_0x4facbd=0xc8;}else{_0x4facbd=0xce;}_0x51cc4f[_0xe6fb('0x18')](_0x4facbd);return _0x51cc4f[_0xe6fb('0x1f')](_0xe6fb('0x20'),_0x5c9994+'-'+_0x4787c4+'/'+_0x26ce85)['json'](_0x194d34);}return null;};}function patchUpdates(_0x5f00f8){return function(_0x1b7f0e){try{jsonpatch[_0xe6fb('0x21')](_0x1b7f0e,_0x5f00f8,!![]);}catch(_0x391266){return BPromise[_0xe6fb('0x22')](_0x391266);}return _0x1b7f0e[_0xe6fb('0x23')]();};}function saveUpdates(_0x5e2732,_0xce36bd){return function(_0x2ae3d2){if(_0x2ae3d2){return _0x2ae3d2[_0xe6fb('0x24')](_0x5e2732)[_0xe6fb('0x25')](function(_0x553408){return _0x553408;});}return null;};}function removeEntity(_0x2f70d1,_0x3b09f6){return function(_0x3e4dfe){if(_0x3e4dfe){return _0x3e4dfe[_0xe6fb('0x26')]()['then'](function(){_0x2f70d1[_0xe6fb('0x18')](0xcc)[_0xe6fb('0x19')]();});}};}function handleEntityNotFound(_0x4b70b6,_0x486363){return function(_0x97a240){if(!_0x97a240){_0x4b70b6['sendStatus'](0x194);}return _0x97a240;};}function handleError(_0x2a3536,_0x2bd5fc){_0x2bd5fc=_0x2bd5fc||0x1f4;return function(_0x50281e){logger['error'](_0x50281e[_0xe6fb('0x27')]);if(_0x50281e[_0xe6fb('0x28')]){delete _0x50281e[_0xe6fb('0x28')];}_0x2a3536[_0xe6fb('0x18')](_0x2bd5fc)[_0xe6fb('0x29')](_0x50281e);};}exports[_0xe6fb('0x2a')]=function(_0x2e4798,_0x1fa884){var _0x4887ba={},_0x4663c9={},_0x4123af={'count':0x0,'rows':[]};var _0x17a9c7=_[_0xe6fb('0x2b')](db[_0xe6fb('0x2c')][_0xe6fb('0x2d')],function(_0x4cfd4){return{'name':_0x4cfd4[_0xe6fb('0x2e')],'type':_0x4cfd4[_0xe6fb('0x2f')]['key']};});_0x4663c9['model']=_[_0xe6fb('0x2b')](_0x17a9c7,'name');_0x4663c9[_0xe6fb('0x30')]=_['keys'](_0x2e4798[_0xe6fb('0x30')]);_0x4663c9[_0xe6fb('0x31')]=_['intersection'](_0x4663c9[_0xe6fb('0x32')],_0x4663c9['query']);_0x4887ba[_0xe6fb('0x33')]=_[_0xe6fb('0x34')](_0x4663c9[_0xe6fb('0x32')],qs['fields'](_0x2e4798['query'][_0xe6fb('0x35')]));_0x4887ba[_0xe6fb('0x33')]=_0x4887ba[_0xe6fb('0x33')][_0xe6fb('0x36')]?_0x4887ba[_0xe6fb('0x33')]:_0x4663c9[_0xe6fb('0x32')];if(!_0x2e4798['query'][_0xe6fb('0x37')](_0xe6fb('0x38'))){_0x4887ba[_0xe6fb('0x1d')]=qs['limit'](_0x2e4798['query'][_0xe6fb('0x1d')]);_0x4887ba[_0xe6fb('0x1b')]=qs[_0xe6fb('0x1b')](_0x2e4798[_0xe6fb('0x30')]['offset']);}_0x4887ba[_0xe6fb('0x39')]=qs[_0xe6fb('0x3a')](_0x2e4798[_0xe6fb('0x30')]['sort']);_0x4887ba[_0xe6fb('0x3b')]=qs[_0xe6fb('0x31')](_[_0xe6fb('0x3c')](_0x2e4798[_0xe6fb('0x30')],_0x4663c9[_0xe6fb('0x31')]),_0x17a9c7);if(_0x2e4798['query'][_0xe6fb('0x3d')]){_0x4887ba['where']=_[_0xe6fb('0x3e')](_0x4887ba[_0xe6fb('0x3b')],{'$or':_[_0xe6fb('0x2b')](_0x17a9c7,function(_0x354dcb){if(_0x354dcb['type']!==_0xe6fb('0x3f')){var _0x42d551={};_0x42d551[_0x354dcb[_0xe6fb('0x28')]]={'$like':'%'+_0x2e4798['query'][_0xe6fb('0x3d')]+'%'};return _0x42d551;}})});}_0x4887ba=_[_0xe6fb('0x3e')]({},_0x4887ba,_0x2e4798[_0xe6fb('0x40')]);var _0x37c6f4={'where':_0x4887ba['where']};return db['SquareReport']['count'](_0x37c6f4)[_0xe6fb('0x25')](function(_0x4d130e){_0x4123af['count']=_0x4d130e;if(_0x2e4798[_0xe6fb('0x30')]['includeAll']){_0x4887ba[_0xe6fb('0x41')]=[{'all':!![]}];}return db[_0xe6fb('0x2c')][_0xe6fb('0x42')](_0x4887ba);})[_0xe6fb('0x25')](function(_0x312830){_0x4123af[_0xe6fb('0x43')]=_0x312830;return _0x4123af;})['then'](respondWithFilteredResult(_0x1fa884,_0x4887ba))[_0xe6fb('0x44')](handleError(_0x1fa884,null));};exports[_0xe6fb('0x45')]=function(_0x253465,_0x2fd0d3){var _0x2ff97d={'raw':!![],'where':{'id':_0x253465[_0xe6fb('0x46')]['id']}},_0x2dd891={};_0x2dd891['model']=_[_0xe6fb('0x47')](db[_0xe6fb('0x2c')][_0xe6fb('0x2d')]);_0x2dd891['query']=_[_0xe6fb('0x47')](_0x253465['query']);_0x2dd891[_0xe6fb('0x31')]=_[_0xe6fb('0x34')](_0x2dd891['model'],_0x2dd891[_0xe6fb('0x30')]);_0x2ff97d['attributes']=_[_0xe6fb('0x34')](_0x2dd891[_0xe6fb('0x32')],qs['fields'](_0x253465['query']['fields']));_0x2ff97d['attributes']=_0x2ff97d['attributes'][_0xe6fb('0x36')]?_0x2ff97d['attributes']:_0x2dd891[_0xe6fb('0x32')];if(_0x253465[_0xe6fb('0x30')]['includeAll']){_0x2ff97d[_0xe6fb('0x41')]=[{'all':!![]}];}_0x2ff97d=_['merge']({},_0x2ff97d,_0x253465[_0xe6fb('0x40')]);return db['SquareReport'][_0xe6fb('0x48')](_0x2ff97d)[_0xe6fb('0x25')](handleEntityNotFound(_0x2fd0d3,null))[_0xe6fb('0x25')](respondWithResult(_0x2fd0d3,null))['catch'](handleError(_0x2fd0d3,null));};exports[_0xe6fb('0x49')]=function(_0xec1ab1,_0x801c9f){return db[_0xe6fb('0x2c')]['create'](_0xec1ab1['body'],{})[_0xe6fb('0x25')](respondWithResult(_0x801c9f,0xc9))[_0xe6fb('0x44')](handleError(_0x801c9f,null));};exports[_0xe6fb('0x24')]=function(_0x24412e,_0x2aacce){if(_0x24412e['body']['id']){delete _0x24412e['body']['id'];}return db['SquareReport'][_0xe6fb('0x48')]({'where':{'id':_0x24412e['params']['id']}})[_0xe6fb('0x25')](handleEntityNotFound(_0x2aacce,null))['then'](saveUpdates(_0x24412e[_0xe6fb('0x4a')],null))[_0xe6fb('0x25')](respondWithResult(_0x2aacce,null))[_0xe6fb('0x44')](handleError(_0x2aacce,null));};exports[_0xe6fb('0x26')]=function(_0x4aa0d2,_0xce152b){return db[_0xe6fb('0x2c')]['find']({'where':{'id':_0x4aa0d2[_0xe6fb('0x46')]['id']}})['then'](handleEntityNotFound(_0xce152b,null))[_0xe6fb('0x25')](removeEntity(_0xce152b,null))[_0xe6fb('0x44')](handleError(_0xce152b,null));};exports[_0xe6fb('0x4b')]=function(_0x4aa69b,_0x182d86){return db[_0xe6fb('0x2c')][_0xe6fb('0x4b')]()[_0xe6fb('0x25')](respondWithResult(_0x182d86,null))['catch'](handleError(_0x182d86,null));}; \ No newline at end of file +var _0xc794=['fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send'];(function(_0x54285a,_0x48d40e){var _0x1c6754=function(_0xfead39){while(--_0xfead39){_0x54285a['push'](_0x54285a['shift']());}};_0x1c6754(++_0x48d40e);}(_0xc794,0x100));var _0x4c79=function(_0x483755,_0x4450dc){_0x483755=_0x483755-0x0;var _0x362c2d=_0xc794[_0x483755];return _0x362c2d;};'use strict';var emlformat=require(_0x4c79('0x0'));var rimraf=require(_0x4c79('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4c79('0x2'));var moment=require(_0x4c79('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c79('0x4'));var util=require(_0x4c79('0x5'));var path=require(_0x4c79('0x6'));var sox=require(_0x4c79('0x7'));var csv=require('to-csv');var ejs=require(_0x4c79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c79('0x9'));var squel=require(_0x4c79('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c79('0xb'));var toCsv=require(_0x4c79('0xc'));var querystring=require(_0x4c79('0xd'));var Papa=require(_0x4c79('0xe'));var Redis=require(_0x4c79('0xf'));var authService=require(_0x4c79('0x10'));var qs=require(_0x4c79('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c79('0x12'));var logger=require(_0x4c79('0x13'))(_0x4c79('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4c79('0x15'));var db=require(_0x4c79('0x16'))['db'];function respondWithStatusCode(_0x27764f,_0x34b92e){_0x34b92e=_0x34b92e||0xcc;return function(_0x4893a9){if(_0x4893a9){return _0x27764f[_0x4c79('0x17')](_0x34b92e);}return _0x27764f[_0x4c79('0x18')](_0x34b92e)['end']();};}function respondWithResult(_0x2a5f13,_0x137710){_0x137710=_0x137710||0xc8;return function(_0x11366e){if(_0x11366e){return _0x2a5f13['status'](_0x137710)['json'](_0x11366e);}};}function respondWithFilteredResult(_0x2e1302,_0x4fa639){return function(_0x2b7610){if(_0x2b7610){var _0x5cefe7=typeof _0x4fa639[_0x4c79('0x19')]===_0x4c79('0x1a')&&typeof _0x4fa639[_0x4c79('0x1b')]===_0x4c79('0x1a');var _0x2f7a69=_0x2b7610[_0x4c79('0x1c')];var _0xf719ae=_0x5cefe7?0x0:_0x4fa639['offset'];var _0x163555=_0x5cefe7?_0x2b7610[_0x4c79('0x1c')]:_0x4fa639['offset']+_0x4fa639['limit'];var _0x2352fc;if(_0x163555>=_0x2f7a69){_0x163555=_0x2f7a69;_0x2352fc=0xc8;}else{_0x2352fc=0xce;}_0x2e1302[_0x4c79('0x18')](_0x2352fc);return _0x2e1302[_0x4c79('0x1d')](_0x4c79('0x1e'),_0xf719ae+'-'+_0x163555+'/'+_0x2f7a69)['json'](_0x2b7610);}return null;};}function patchUpdates(_0x5ad1cc){return function(_0x3a292a){try{jsonpatch[_0x4c79('0x1f')](_0x3a292a,_0x5ad1cc,!![]);}catch(_0x326f3a){return BPromise[_0x4c79('0x20')](_0x326f3a);}return _0x3a292a[_0x4c79('0x21')]();};}function saveUpdates(_0x5b28fd,_0x569d72){return function(_0x237ac4){if(_0x237ac4){return _0x237ac4[_0x4c79('0x22')](_0x5b28fd)[_0x4c79('0x23')](function(_0xef1269){return _0xef1269;});}return null;};}function removeEntity(_0x569456,_0x49a194){return function(_0x295659){if(_0x295659){return _0x295659['destroy']()[_0x4c79('0x23')](function(){_0x569456[_0x4c79('0x18')](0xcc)[_0x4c79('0x24')]();});}};}function handleEntityNotFound(_0x1278d2,_0x339dc1){return function(_0x22ea02){if(!_0x22ea02){_0x1278d2[_0x4c79('0x17')](0x194);}return _0x22ea02;};}function handleError(_0x377293,_0x4e3d7f){_0x4e3d7f=_0x4e3d7f||0x1f4;return function(_0x53433f){logger['error'](_0x53433f[_0x4c79('0x25')]);if(_0x53433f[_0x4c79('0x26')]){delete _0x53433f[_0x4c79('0x26')];}_0x377293['status'](_0x4e3d7f)[_0x4c79('0x27')](_0x53433f);};}exports['index']=function(_0x350978,_0x227882){var _0x5dee86={},_0xf6810={},_0xf5e7e={'count':0x0,'rows':[]};var _0x4e13ce=_['map'](db['SquareReport']['rawAttributes'],function(_0x38f0d6){return{'name':_0x38f0d6[_0x4c79('0x28')],'type':_0x38f0d6[_0x4c79('0x29')]['key']};});_0xf6810[_0x4c79('0x2a')]=_['map'](_0x4e13ce,'name');_0xf6810[_0x4c79('0x2b')]=_['keys'](_0x350978['query']);_0xf6810[_0x4c79('0x2c')]=_[_0x4c79('0x2d')](_0xf6810['model'],_0xf6810[_0x4c79('0x2b')]);_0x5dee86[_0x4c79('0x2e')]=_[_0x4c79('0x2d')](_0xf6810[_0x4c79('0x2a')],qs['fields'](_0x350978[_0x4c79('0x2b')][_0x4c79('0x2f')]));_0x5dee86[_0x4c79('0x2e')]=_0x5dee86[_0x4c79('0x2e')][_0x4c79('0x30')]?_0x5dee86[_0x4c79('0x2e')]:_0xf6810[_0x4c79('0x2a')];if(!_0x350978[_0x4c79('0x2b')][_0x4c79('0x31')](_0x4c79('0x32'))){_0x5dee86[_0x4c79('0x1b')]=qs[_0x4c79('0x1b')](_0x350978[_0x4c79('0x2b')][_0x4c79('0x1b')]);_0x5dee86[_0x4c79('0x19')]=qs[_0x4c79('0x19')](_0x350978[_0x4c79('0x2b')]['offset']);}_0x5dee86[_0x4c79('0x33')]=qs['sort'](_0x350978[_0x4c79('0x2b')][_0x4c79('0x34')]);_0x5dee86['where']=qs[_0x4c79('0x2c')](_[_0x4c79('0x35')](_0x350978[_0x4c79('0x2b')],_0xf6810[_0x4c79('0x2c')]),_0x4e13ce);if(_0x350978['query'][_0x4c79('0x36')]){_0x5dee86[_0x4c79('0x37')]=_[_0x4c79('0x38')](_0x5dee86[_0x4c79('0x37')],{'$or':_['map'](_0x4e13ce,function(_0x209431){if(_0x209431[_0x4c79('0x29')]!==_0x4c79('0x39')){var _0xc9b6cc={};_0xc9b6cc[_0x209431[_0x4c79('0x26')]]={'$like':'%'+_0x350978['query'][_0x4c79('0x36')]+'%'};return _0xc9b6cc;}})});}_0x5dee86=_[_0x4c79('0x38')]({},_0x5dee86,_0x350978[_0x4c79('0x3a')]);var _0x872b6c={'where':_0x5dee86['where']};return db[_0x4c79('0x3b')][_0x4c79('0x1c')](_0x872b6c)[_0x4c79('0x23')](function(_0x47e8e0){_0xf5e7e[_0x4c79('0x1c')]=_0x47e8e0;if(_0x350978['query'][_0x4c79('0x3c')]){_0x5dee86[_0x4c79('0x3d')]=[{'all':!![]}];}return db[_0x4c79('0x3b')][_0x4c79('0x3e')](_0x5dee86);})[_0x4c79('0x23')](function(_0x40909d){_0xf5e7e[_0x4c79('0x3f')]=_0x40909d;return _0xf5e7e;})[_0x4c79('0x23')](respondWithFilteredResult(_0x227882,_0x5dee86))['catch'](handleError(_0x227882,null));};exports[_0x4c79('0x40')]=function(_0x47b819,_0x7482db){var _0x4b96c2={'raw':!![],'where':{'id':_0x47b819[_0x4c79('0x41')]['id']}},_0x18c9e6={};_0x18c9e6[_0x4c79('0x2a')]=_[_0x4c79('0x42')](db[_0x4c79('0x3b')][_0x4c79('0x43')]);_0x18c9e6[_0x4c79('0x2b')]=_[_0x4c79('0x42')](_0x47b819['query']);_0x18c9e6[_0x4c79('0x2c')]=_[_0x4c79('0x2d')](_0x18c9e6[_0x4c79('0x2a')],_0x18c9e6[_0x4c79('0x2b')]);_0x4b96c2[_0x4c79('0x2e')]=_['intersection'](_0x18c9e6[_0x4c79('0x2a')],qs[_0x4c79('0x2f')](_0x47b819[_0x4c79('0x2b')][_0x4c79('0x2f')]));_0x4b96c2[_0x4c79('0x2e')]=_0x4b96c2[_0x4c79('0x2e')][_0x4c79('0x30')]?_0x4b96c2[_0x4c79('0x2e')]:_0x18c9e6[_0x4c79('0x2a')];if(_0x47b819[_0x4c79('0x2b')]['includeAll']){_0x4b96c2[_0x4c79('0x3d')]=[{'all':!![]}];}_0x4b96c2=_[_0x4c79('0x38')]({},_0x4b96c2,_0x47b819[_0x4c79('0x3a')]);return db[_0x4c79('0x3b')][_0x4c79('0x44')](_0x4b96c2)['then'](handleEntityNotFound(_0x7482db,null))[_0x4c79('0x23')](respondWithResult(_0x7482db,null))[_0x4c79('0x45')](handleError(_0x7482db,null));};exports['create']=function(_0x5a39e1,_0x3cf980){return db['SquareReport'][_0x4c79('0x46')](_0x5a39e1['body'],{})[_0x4c79('0x23')](respondWithResult(_0x3cf980,0xc9))[_0x4c79('0x45')](handleError(_0x3cf980,null));};exports[_0x4c79('0x22')]=function(_0x47623d,_0x43018b){if(_0x47623d[_0x4c79('0x47')]['id']){delete _0x47623d[_0x4c79('0x47')]['id'];}return db[_0x4c79('0x3b')]['find']({'where':{'id':_0x47623d['params']['id']}})[_0x4c79('0x23')](handleEntityNotFound(_0x43018b,null))[_0x4c79('0x23')](saveUpdates(_0x47623d[_0x4c79('0x47')],null))[_0x4c79('0x23')](respondWithResult(_0x43018b,null))[_0x4c79('0x45')](handleError(_0x43018b,null));};exports[_0x4c79('0x48')]=function(_0x38a047,_0xd37acf){return db[_0x4c79('0x3b')]['find']({'where':{'id':_0x38a047[_0x4c79('0x41')]['id']}})['then'](handleEntityNotFound(_0xd37acf,null))[_0x4c79('0x23')](removeEntity(_0xd37acf,null))[_0x4c79('0x45')](handleError(_0xd37acf,null));};exports['describe']=function(_0x56b161,_0x11827b){return db[_0x4c79('0x3b')][_0x4c79('0x49')]()[_0x4c79('0x23')](respondWithResult(_0x11827b,null))[_0x4c79('0x45')](handleError(_0x11827b,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 91be04f..039194d 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 _0xc8d3=['define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2a43e5,_0x4ad894){var _0x28301d=function(_0x3a8828){while(--_0x3a8828){_0x2a43e5['push'](_0x2a43e5['shift']());}};_0x28301d(++_0x4ad894);}(_0xc8d3,0x16b));var _0x3c8d=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xc8d3[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x3c8d('0x0'));var util=require(_0x3c8d('0x1'));var logger=require(_0x3c8d('0x2'))(_0x3c8d('0x3'));var moment=require(_0x3c8d('0x4'));var BPromise=require(_0x3c8d('0x5'));var rp=require(_0x3c8d('0x6'));var fs=require('fs');var path=require(_0x3c8d('0x7'));var rimraf=require(_0x3c8d('0x8'));var config=require(_0x3c8d('0x9'));var attributes=require('./squareReport.attributes');module[_0x3c8d('0xa')]=function(_0x490ff6,_0x3cf478){return _0x490ff6[_0x3c8d('0xb')](_0x3c8d('0xc'),attributes,{'tableName':_0x3c8d('0xd'),'paranoid':![],'indexes':[{'name':_0x3c8d('0xe'),'fields':[_0x3c8d('0xf'),'project_name']},{'name':_0x3c8d('0x10'),'fields':[_0x3c8d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c8d=['rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4f1193,_0x3b3794){var _0x276d2b=function(_0x550542){while(--_0x550542){_0x4f1193['push'](_0x4f1193['shift']());}};_0x276d2b(++_0x3b3794);}(_0x9c8d,0xba));var _0xd9c8=function(_0x57f925,_0x398edb){_0x57f925=_0x57f925-0x0;var _0xdfcd6c=_0x9c8d[_0x57f925];return _0xdfcd6c;};'use strict';var _=require(_0xd9c8('0x0'));var util=require(_0xd9c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd9c8('0x2'));var BPromise=require(_0xd9c8('0x3'));var rp=require(_0xd9c8('0x4'));var fs=require('fs');var path=require(_0xd9c8('0x5'));var rimraf=require(_0xd9c8('0x6'));var config=require(_0xd9c8('0x7'));var attributes=require(_0xd9c8('0x8'));module[_0xd9c8('0x9')]=function(_0x2dc33a,_0x17f49c){return _0x2dc33a[_0xd9c8('0xa')](_0xd9c8('0xb'),attributes,{'tableName':_0xd9c8('0xc'),'paranoid':![],'indexes':[{'name':_0xd9c8('0xd'),'fields':['uniqueid',_0xd9c8('0xe')]},{'name':_0xd9c8('0xf'),'fields':[_0xd9c8('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index fc7412f..8beb8cb 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 _0x7cbd=['stringify','UpdateSquareReport','update','where','limit','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cbd,0x7d));var _0xd7cb=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x7cbd[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0xd7cb('0x0'));var util=require('util');var moment=require(_0xd7cb('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7cb('0x2'));var fs=require('fs');var Redis=require(_0xd7cb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7cb('0x4'));var logger=require(_0xd7cb('0x5'))(_0xd7cb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd7cb('0x7')][_0xd7cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x650ba1,_0x57650e,_0x12616b){return new BPromise(function(_0x50244f,_0x5d35f3){return client['request'](_0x650ba1,_0x12616b)[_0xd7cb('0x9')](function(_0x2ca489){logger[_0xd7cb('0xa')](_0xd7cb('0xb'),_0x57650e,'request\x20sent');logger['debug'](_0xd7cb('0xc'),_0x57650e,_0xd7cb('0xd'),JSON['stringify'](_0x2ca489));if(_0x2ca489[_0xd7cb('0xe')]){if(_0x2ca489[_0xd7cb('0xe')]['code']===0x1f4){logger['error'](_0xd7cb('0xb'),_0x57650e,_0x2ca489[_0xd7cb('0xe')][_0xd7cb('0xf')]);return _0x5d35f3(_0x2ca489[_0xd7cb('0xe')][_0xd7cb('0xf')]);}logger[_0xd7cb('0xe')](_0xd7cb('0xb'),_0x57650e,_0x2ca489[_0xd7cb('0xe')][_0xd7cb('0xf')]);return _0x50244f(_0x2ca489[_0xd7cb('0xe')][_0xd7cb('0xf')]);}else{logger[_0xd7cb('0xa')](_0xd7cb('0xb'),_0x57650e,'request\x20sent');_0x50244f(_0x2ca489[_0xd7cb('0x10')][_0xd7cb('0xf')]);}})[_0xd7cb('0x11')](function(_0x165f5b){logger['error'](_0xd7cb('0xb'),_0x57650e,_0x165f5b);_0x5d35f3(_0x165f5b);});});}exports[_0xd7cb('0x12')]=function(_0x59fc0a){var _0x3a106c=this;return new Promise(function(_0x1b063d,_0x2d4a7b){return db[_0xd7cb('0x13')][_0xd7cb('0x14')](_0x59fc0a[_0xd7cb('0x15')],{'raw':_0x59fc0a[_0xd7cb('0x16')]?_0x59fc0a[_0xd7cb('0x16')][_0xd7cb('0x17')]===undefined?!![]:![]:!![]})[_0xd7cb('0x9')](function(_0x8f7db6){logger[_0xd7cb('0xa')](_0xd7cb('0x12'),_0x59fc0a);logger[_0xd7cb('0x18')](_0xd7cb('0x12'),_0x59fc0a,JSON[_0xd7cb('0x19')](_0x8f7db6));_0x1b063d(_0x8f7db6);})[_0xd7cb('0x11')](function(_0x5efc1e){logger['error'](_0xd7cb('0x12'),_0x5efc1e['message'],_0x59fc0a);_0x2d4a7b(_0x3a106c[_0xd7cb('0xe')](0x1f4,_0x5efc1e[_0xd7cb('0xf')]));});});};exports[_0xd7cb('0x1a')]=function(_0x58d607){var _0x36ebb8=this;return new Promise(function(_0xa37c35,_0x14c735){return db[_0xd7cb('0x13')][_0xd7cb('0x1b')](_0x58d607['body'],{'raw':_0x58d607[_0xd7cb('0x16')]?_0x58d607[_0xd7cb('0x16')][_0xd7cb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58d607['options']?_0x58d607[_0xd7cb('0x16')][_0xd7cb('0x1c')]||null:null,'attributes':_0x58d607[_0xd7cb('0x16')]?_0x58d607[_0xd7cb('0x16')]['attributes']||null:null,'limit':_0x58d607[_0xd7cb('0x16')]?_0x58d607[_0xd7cb('0x16')][_0xd7cb('0x1d')]||null:null})[_0xd7cb('0x9')](function(_0x55ddf4){logger[_0xd7cb('0xa')](_0xd7cb('0x1a'),_0x58d607);logger['debug']('UpdateSquareReport',_0x58d607,JSON[_0xd7cb('0x19')](_0x55ddf4));_0xa37c35(_0x55ddf4);})['catch'](function(_0x5003b1){logger['error'](_0xd7cb('0x1a'),_0x5003b1['message'],_0x58d607);_0x14c735(_0x36ebb8[_0xd7cb('0xe')](0x1f4,_0x5003b1[_0xd7cb('0xf')]));});});}; \ No newline at end of file +var _0xfbd2=['attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareReport','SquareReport','create','body','raw','stringify','UpdateSquareReport','update','options','where'];(function(_0x35e8bb,_0x3fdad0){var _0x3b887f=function(_0x2184f6){while(--_0x2184f6){_0x35e8bb['push'](_0x35e8bb['shift']());}};_0x3b887f(++_0x3fdad0);}(_0xfbd2,0x162));var _0x2fbd=function(_0x2ff401,_0x26a1a9){_0x2ff401=_0x2ff401-0x0;var _0x25cfda=_0xfbd2[_0x2ff401];return _0x25cfda;};'use strict';var _=require(_0x2fbd('0x0'));var util=require('util');var moment=require(_0x2fbd('0x1'));var BPromise=require('bluebird');var rs=require(_0x2fbd('0x2'));var fs=require('fs');var Redis=require(_0x2fbd('0x3'));var db=require(_0x2fbd('0x4'))['db'];var utils=require(_0x2fbd('0x5'));var logger=require(_0x2fbd('0x6'))(_0x2fbd('0x7'));var config=require('../../config/environment');var jayson=require(_0x2fbd('0x8'));var client=jayson['client'][_0x2fbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d1202,_0x195ac9,_0x360fb6){return new BPromise(function(_0x25e556,_0x46bdc2){return client['request'](_0x2d1202,_0x360fb6)[_0x2fbd('0xa')](function(_0x466fdd){logger[_0x2fbd('0xb')](_0x2fbd('0xc'),_0x195ac9,_0x2fbd('0xd'));logger[_0x2fbd('0xe')](_0x2fbd('0xf'),_0x195ac9,'request\x20sent',JSON['stringify'](_0x466fdd));if(_0x466fdd['error']){if(_0x466fdd[_0x2fbd('0x10')][_0x2fbd('0x11')]===0x1f4){logger[_0x2fbd('0x10')](_0x2fbd('0xc'),_0x195ac9,_0x466fdd[_0x2fbd('0x10')][_0x2fbd('0x12')]);return _0x46bdc2(_0x466fdd[_0x2fbd('0x10')][_0x2fbd('0x12')]);}logger[_0x2fbd('0x10')](_0x2fbd('0xc'),_0x195ac9,_0x466fdd[_0x2fbd('0x10')][_0x2fbd('0x12')]);return _0x25e556(_0x466fdd[_0x2fbd('0x10')][_0x2fbd('0x12')]);}else{logger[_0x2fbd('0xb')](_0x2fbd('0xc'),_0x195ac9,_0x2fbd('0xd'));_0x25e556(_0x466fdd['result'][_0x2fbd('0x12')]);}})[_0x2fbd('0x13')](function(_0x2abf58){logger[_0x2fbd('0x10')](_0x2fbd('0xc'),_0x195ac9,_0x2abf58);_0x46bdc2(_0x2abf58);});});}exports[_0x2fbd('0x14')]=function(_0x4399c9){var _0x4dba01=this;return new Promise(function(_0x20196f,_0x3892d4){return db[_0x2fbd('0x15')][_0x2fbd('0x16')](_0x4399c9[_0x2fbd('0x17')],{'raw':_0x4399c9['options']?_0x4399c9['options'][_0x2fbd('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4f54ac){logger[_0x2fbd('0xb')](_0x2fbd('0x14'),_0x4399c9);logger[_0x2fbd('0xe')](_0x2fbd('0x14'),_0x4399c9,JSON[_0x2fbd('0x19')](_0x4f54ac));_0x20196f(_0x4f54ac);})[_0x2fbd('0x13')](function(_0x3a3bf0){logger['error'](_0x2fbd('0x14'),_0x3a3bf0[_0x2fbd('0x12')],_0x4399c9);_0x3892d4(_0x4dba01[_0x2fbd('0x10')](0x1f4,_0x3a3bf0[_0x2fbd('0x12')]));});});};exports[_0x2fbd('0x1a')]=function(_0x382db9){var _0x219219=this;return new Promise(function(_0x34d9ec,_0x22560c){return db[_0x2fbd('0x15')][_0x2fbd('0x1b')](_0x382db9[_0x2fbd('0x17')],{'raw':_0x382db9[_0x2fbd('0x1c')]?_0x382db9[_0x2fbd('0x1c')][_0x2fbd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382db9[_0x2fbd('0x1c')]?_0x382db9['options'][_0x2fbd('0x1d')]||null:null,'attributes':_0x382db9[_0x2fbd('0x1c')]?_0x382db9[_0x2fbd('0x1c')][_0x2fbd('0x1e')]||null:null,'limit':_0x382db9[_0x2fbd('0x1c')]?_0x382db9[_0x2fbd('0x1c')][_0x2fbd('0x1f')]||null:null})[_0x2fbd('0xa')](function(_0x56166e){logger['info']('UpdateSquareReport',_0x382db9);logger[_0x2fbd('0xe')](_0x2fbd('0x1a'),_0x382db9,JSON['stringify'](_0x56166e));_0x34d9ec(_0x56166e);})[_0x2fbd('0x13')](function(_0x180943){logger[_0x2fbd('0x10')](_0x2fbd('0x1a'),_0x180943['message'],_0x382db9);_0x22560c(_0x219219[_0x2fbd('0x10')](0x1f4,_0x180943[_0x2fbd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d931577..c1db32a 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 _0x1448=['create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','/describe','isAuthenticated','describe','get','/:id','post'];(function(_0x32d00,_0x5d58b9){var _0x48086f=function(_0x29aaa9){while(--_0x29aaa9){_0x32d00['push'](_0x32d00['shift']());}};_0x48086f(++_0x5d58b9);}(_0x1448,0x7c));var _0x8144=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1448[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8144('0x0'));var util=require(_0x8144('0x1'));var path=require(_0x8144('0x2'));var timeout=require(_0x8144('0x3'));var express=require(_0x8144('0x4'));var router=express[_0x8144('0x5')]();var fs_extra=require(_0x8144('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8144('0x7'));var config=require(_0x8144('0x8'));var controller=require(_0x8144('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8144('0xa'),auth[_0x8144('0xb')](),controller[_0x8144('0xc')]);router[_0x8144('0xd')](_0x8144('0xe'),auth[_0x8144('0xb')](),controller['show']);router[_0x8144('0xf')]('/',auth[_0x8144('0xb')](),controller[_0x8144('0x10')]);router['put'](_0x8144('0xe'),auth[_0x8144('0xb')](),controller[_0x8144('0x11')]);router[_0x8144('0x12')](_0x8144('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8144('0x13')]=router; \ No newline at end of file +var _0xfb49=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x401c26,_0x3ffb63){var _0x42797b=function(_0x20658b){while(--_0x20658b){_0x401c26['push'](_0x401c26['shift']());}};_0x42797b(++_0x3ffb63);}(_0xfb49,0xc4));var _0x9fb4=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0xfb49[_0xff659d];return _0x19c170;};'use strict';var multer=require(_0x9fb4('0x0'));var util=require(_0x9fb4('0x1'));var path=require(_0x9fb4('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fb4('0x3'));var router=express[_0x9fb4('0x4')]();var fs_extra=require(_0x9fb4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9fb4('0x6'));var config=require(_0x9fb4('0x7'));var controller=require(_0x9fb4('0x8'));router[_0x9fb4('0x9')]('/',auth[_0x9fb4('0xa')](),controller[_0x9fb4('0xb')]);router['get'](_0x9fb4('0xc'),auth[_0x9fb4('0xa')](),controller[_0x9fb4('0xd')]);router[_0x9fb4('0x9')](_0x9fb4('0xe'),auth[_0x9fb4('0xa')](),controller[_0x9fb4('0xf')]);router[_0x9fb4('0x10')]('/',auth[_0x9fb4('0xa')](),controller[_0x9fb4('0x11')]);router[_0x9fb4('0x12')](_0x9fb4('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x9fb4('0x13')]('/:id',auth[_0x9fb4('0xa')](),controller[_0x9fb4('0x14')]);module[_0x9fb4('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f726d17..a4a07c1 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 _0x1b12=['exports','STRING','TEXT'];(function(_0x40db5a,_0x2506e8){var _0x50a620=function(_0x5d1886){while(--_0x5d1886){_0x40db5a['push'](_0x40db5a['shift']());}};_0x50a620(++_0x2506e8);}(_0x1b12,0x1bf));var _0x21b1=function(_0x5d67b9,_0x490e22){_0x5d67b9=_0x5d67b9-0x0;var _0x5d0368=_0x1b12[_0x5d67b9];return _0x5d0368;};'use strict';var Sequelize=require('sequelize');module[_0x21b1('0x0')]={'uniqueid':{'type':Sequelize[_0x21b1('0x1')]},'node':{'type':Sequelize[_0x21b1('0x1')]},'application':{'type':Sequelize[_0x21b1('0x1')]},'data':{'type':Sequelize[_0x21b1('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x21b1('0x1')]}}; \ No newline at end of file +var _0xf066=['sequelize','exports','STRING','TEXT'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0xf066,0xf4));var _0x6f06=function(_0x59026b,_0x12ace5){_0x59026b=_0x59026b-0x0;var _0x2c6152=_0xf066[_0x59026b];return _0x2c6152;};'use strict';var Sequelize=require(_0x6f06('0x0'));module[_0x6f06('0x1')]={'uniqueid':{'type':Sequelize[_0x6f06('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x6f06('0x3')]},'project_name':{'type':Sequelize[_0x6f06('0x2')]},'callerid':{'type':Sequelize[_0x6f06('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2c338b2..0ed5bec 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 _0x58e7=['rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','name','options','includeAll','include','rows','catch','show','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','SquareDetailsReport'];(function(_0xf1da90,_0x17a4f0){var _0x24fae3=function(_0x419131){while(--_0x419131){_0xf1da90['push'](_0xf1da90['shift']());}};_0x24fae3(++_0x17a4f0);}(_0x58e7,0x1ec));var _0x758e=function(_0x2662ec,_0x139883){_0x2662ec=_0x2662ec-0x0;var _0xcf1130=_0x58e7[_0x2662ec];return _0xcf1130;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x758e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x758e('0x1'));var rp=require(_0x758e('0x2'));var moment=require(_0x758e('0x3'));var BPromise=require(_0x758e('0x4'));var Mustache=require(_0x758e('0x5'));var util=require(_0x758e('0x6'));var path=require(_0x758e('0x7'));var sox=require(_0x758e('0x8'));var csv=require(_0x758e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x758e('0xa'));var squel=require(_0x758e('0xb'));var crypto=require(_0x758e('0xc'));var jsforce=require(_0x758e('0xd'));var deskjs=require(_0x758e('0xe'));var toCsv=require(_0x758e('0x9'));var querystring=require(_0x758e('0xf'));var Papa=require('papaparse');var Redis=require(_0x758e('0x10'));var authService=require(_0x758e('0x11'));var qs=require(_0x758e('0x12'));var as=require(_0x758e('0x13'));var hardwareService=require(_0x758e('0x14'));var logger=require(_0x758e('0x15'))(_0x758e('0x16'));var utils=require(_0x758e('0x17'));var config=require(_0x758e('0x18'));var licenseUtil=require(_0x758e('0x19'));var db=require(_0x758e('0x1a'))['db'];function respondWithStatusCode(_0x5a48b8,_0x434388){_0x434388=_0x434388||0xcc;return function(_0x5c3b13){if(_0x5c3b13){return _0x5a48b8['sendStatus'](_0x434388);}return _0x5a48b8[_0x758e('0x1b')](_0x434388)[_0x758e('0x1c')]();};}function respondWithResult(_0x57a050,_0x1e3589){_0x1e3589=_0x1e3589||0xc8;return function(_0x15943b){if(_0x15943b){return _0x57a050[_0x758e('0x1b')](_0x1e3589)['json'](_0x15943b);}};}function respondWithFilteredResult(_0x49b623,_0x16c2cc){return function(_0x55b21b){if(_0x55b21b){var _0x41fefd=typeof _0x16c2cc[_0x758e('0x1d')]===_0x758e('0x1e')&&typeof _0x16c2cc['limit']==='undefined';var _0x5bb71b=_0x55b21b[_0x758e('0x1f')];var _0x16871f=_0x41fefd?0x0:_0x16c2cc['offset'];var _0x599330=_0x41fefd?_0x55b21b['count']:_0x16c2cc[_0x758e('0x1d')]+_0x16c2cc[_0x758e('0x20')];var _0x529fbb;if(_0x599330>=_0x5bb71b){_0x599330=_0x5bb71b;_0x529fbb=0xc8;}else{_0x529fbb=0xce;}_0x49b623[_0x758e('0x1b')](_0x529fbb);return _0x49b623['set'](_0x758e('0x21'),_0x16871f+'-'+_0x599330+'/'+_0x5bb71b)['json'](_0x55b21b);}return null;};}function patchUpdates(_0x432181){return function(_0x1c3c9b){try{jsonpatch[_0x758e('0x22')](_0x1c3c9b,_0x432181,!![]);}catch(_0x15483f){return BPromise[_0x758e('0x23')](_0x15483f);}return _0x1c3c9b[_0x758e('0x24')]();};}function saveUpdates(_0x415b3a,_0x33c655){return function(_0x15cd2f){if(_0x15cd2f){return _0x15cd2f[_0x758e('0x25')](_0x415b3a)[_0x758e('0x26')](function(_0x58be9d){return _0x58be9d;});}return null;};}function removeEntity(_0x56e46c,_0x29b626){return function(_0x24fbd3){if(_0x24fbd3){return _0x24fbd3[_0x758e('0x27')]()[_0x758e('0x26')](function(){_0x56e46c[_0x758e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65c166,_0x146d70){return function(_0x389634){if(!_0x389634){_0x65c166[_0x758e('0x28')](0x194);}return _0x389634;};}function handleError(_0x3efb28,_0x52ed73){_0x52ed73=_0x52ed73||0x1f4;return function(_0x566bf1){logger[_0x758e('0x29')](_0x566bf1[_0x758e('0x2a')]);if(_0x566bf1['name']){delete _0x566bf1['name'];}_0x3efb28[_0x758e('0x1b')](_0x52ed73)[_0x758e('0x2b')](_0x566bf1);};}exports[_0x758e('0x2c')]=function(_0x50f210,_0xf42227){var _0x1a0fab={},_0x987fa4={},_0x530c40={'count':0x0,'rows':[]};var _0x916e8d=_[_0x758e('0x2d')](db[_0x758e('0x2e')][_0x758e('0x2f')],function(_0x481d86){return{'name':_0x481d86['fieldName'],'type':_0x481d86[_0x758e('0x30')][_0x758e('0x31')]};});_0x987fa4[_0x758e('0x32')]=_[_0x758e('0x2d')](_0x916e8d,'name');_0x987fa4[_0x758e('0x33')]=_[_0x758e('0x34')](_0x50f210[_0x758e('0x33')]);_0x987fa4[_0x758e('0x35')]=_[_0x758e('0x36')](_0x987fa4[_0x758e('0x32')],_0x987fa4[_0x758e('0x33')]);_0x1a0fab['attributes']=_[_0x758e('0x36')](_0x987fa4[_0x758e('0x32')],qs[_0x758e('0x37')](_0x50f210[_0x758e('0x33')][_0x758e('0x37')]));_0x1a0fab[_0x758e('0x38')]=_0x1a0fab[_0x758e('0x38')][_0x758e('0x39')]?_0x1a0fab[_0x758e('0x38')]:_0x987fa4['model'];if(!_0x50f210[_0x758e('0x33')][_0x758e('0x3a')](_0x758e('0x3b'))){_0x1a0fab[_0x758e('0x20')]=qs[_0x758e('0x20')](_0x50f210[_0x758e('0x33')][_0x758e('0x20')]);_0x1a0fab[_0x758e('0x1d')]=qs[_0x758e('0x1d')](_0x50f210[_0x758e('0x33')][_0x758e('0x1d')]);}_0x1a0fab[_0x758e('0x3c')]=qs[_0x758e('0x3d')](_0x50f210[_0x758e('0x33')][_0x758e('0x3d')]);_0x1a0fab['where']=qs[_0x758e('0x35')](_['pick'](_0x50f210[_0x758e('0x33')],_0x987fa4[_0x758e('0x35')]),_0x916e8d);if(_0x50f210[_0x758e('0x33')][_0x758e('0x3e')]){_0x1a0fab['where']=_[_0x758e('0x3f')](_0x1a0fab[_0x758e('0x40')],{'$or':_[_0x758e('0x2d')](_0x916e8d,function(_0x1c88cd){if(_0x1c88cd[_0x758e('0x30')]!=='VIRTUAL'){var _0x112a6f={};_0x112a6f[_0x1c88cd[_0x758e('0x41')]]={'$like':'%'+_0x50f210['query'][_0x758e('0x3e')]+'%'};return _0x112a6f;}})});}_0x1a0fab=_[_0x758e('0x3f')]({},_0x1a0fab,_0x50f210[_0x758e('0x42')]);var _0x3bacb8={'where':_0x1a0fab[_0x758e('0x40')]};return db[_0x758e('0x2e')][_0x758e('0x1f')](_0x3bacb8)[_0x758e('0x26')](function(_0xaf6258){_0x530c40[_0x758e('0x1f')]=_0xaf6258;if(_0x50f210[_0x758e('0x33')][_0x758e('0x43')]){_0x1a0fab[_0x758e('0x44')]=[{'all':!![]}];}return db[_0x758e('0x2e')]['findAll'](_0x1a0fab);})[_0x758e('0x26')](function(_0x28081e){_0x530c40[_0x758e('0x45')]=_0x28081e;return _0x530c40;})[_0x758e('0x26')](respondWithFilteredResult(_0xf42227,_0x1a0fab))[_0x758e('0x46')](handleError(_0xf42227,null));};exports[_0x758e('0x47')]=function(_0x51576f,_0x220bb0){var _0x2ade3b={'raw':!![],'where':{'id':_0x51576f[_0x758e('0x48')]['id']}},_0x4c7bae={};_0x4c7bae[_0x758e('0x32')]=_[_0x758e('0x34')](db['SquareDetailsReport'][_0x758e('0x2f')]);_0x4c7bae['query']=_[_0x758e('0x34')](_0x51576f['query']);_0x4c7bae['filters']=_[_0x758e('0x36')](_0x4c7bae[_0x758e('0x32')],_0x4c7bae[_0x758e('0x33')]);_0x2ade3b[_0x758e('0x38')]=_[_0x758e('0x36')](_0x4c7bae['model'],qs[_0x758e('0x37')](_0x51576f['query']['fields']));_0x2ade3b[_0x758e('0x38')]=_0x2ade3b[_0x758e('0x38')][_0x758e('0x39')]?_0x2ade3b['attributes']:_0x4c7bae[_0x758e('0x32')];if(_0x51576f[_0x758e('0x33')][_0x758e('0x43')]){_0x2ade3b[_0x758e('0x44')]=[{'all':!![]}];}_0x2ade3b=_['merge']({},_0x2ade3b,_0x51576f[_0x758e('0x42')]);return db[_0x758e('0x2e')]['find'](_0x2ade3b)['then'](handleEntityNotFound(_0x220bb0,null))[_0x758e('0x26')](respondWithResult(_0x220bb0,null))[_0x758e('0x46')](handleError(_0x220bb0,null));};exports[_0x758e('0x49')]=function(_0x269008,_0x7609bc){return db[_0x758e('0x2e')][_0x758e('0x49')](_0x269008['body'],{})[_0x758e('0x26')](respondWithResult(_0x7609bc,0xc9))['catch'](handleError(_0x7609bc,null));};exports[_0x758e('0x25')]=function(_0x421d40,_0x3af1a8){if(_0x421d40[_0x758e('0x4a')]['id']){delete _0x421d40['body']['id'];}return db[_0x758e('0x2e')][_0x758e('0x4b')]({'where':{'id':_0x421d40[_0x758e('0x48')]['id']}})[_0x758e('0x26')](handleEntityNotFound(_0x3af1a8,null))[_0x758e('0x26')](saveUpdates(_0x421d40[_0x758e('0x4a')],null))[_0x758e('0x26')](respondWithResult(_0x3af1a8,null))[_0x758e('0x46')](handleError(_0x3af1a8,null));};exports[_0x758e('0x27')]=function(_0x23845f,_0x329361){return db[_0x758e('0x2e')][_0x758e('0x4b')]({'where':{'id':_0x23845f['params']['id']}})[_0x758e('0x26')](handleEntityNotFound(_0x329361,null))['then'](removeEntity(_0x329361,null))['catch'](handleError(_0x329361,null));};exports[_0x758e('0x4c')]=function(_0x48beff,_0x49f5b8){return db['SquareDetailsReport']['describe']()[_0x758e('0x26')](respondWithResult(_0x49f5b8,null))[_0x758e('0x46')](handleError(_0x49f5b8,null));}; \ No newline at end of file +var _0x36f9=['json','offset','undefined','limit','count','Content-Range','save','then','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x36f9,0x7f));var _0x936f=function(_0x16af89,_0x1155e5){_0x16af89=_0x16af89-0x0;var _0x13931a=_0x36f9[_0x16af89];return _0x13931a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x936f('0x0'));var zipdir=require(_0x936f('0x1'));var jsonpatch=require(_0x936f('0x2'));var rp=require(_0x936f('0x3'));var moment=require(_0x936f('0x4'));var BPromise=require(_0x936f('0x5'));var Mustache=require(_0x936f('0x6'));var util=require(_0x936f('0x7'));var path=require(_0x936f('0x8'));var sox=require(_0x936f('0x9'));var csv=require(_0x936f('0xa'));var ejs=require(_0x936f('0xb'));var fs=require('fs');var fs_extra=require(_0x936f('0xc'));var _=require(_0x936f('0xd'));var squel=require(_0x936f('0xe'));var crypto=require(_0x936f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x936f('0x10'));var toCsv=require(_0x936f('0xa'));var querystring=require(_0x936f('0x11'));var Papa=require(_0x936f('0x12'));var Redis=require(_0x936f('0x13'));var authService=require(_0x936f('0x14'));var qs=require(_0x936f('0x15'));var as=require(_0x936f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x936f('0x17'))('api');var utils=require(_0x936f('0x18'));var config=require(_0x936f('0x19'));var licenseUtil=require(_0x936f('0x1a'));var db=require(_0x936f('0x1b'))['db'];function respondWithStatusCode(_0x231189,_0xd3a5ff){_0xd3a5ff=_0xd3a5ff||0xcc;return function(_0x4da165){if(_0x4da165){return _0x231189[_0x936f('0x1c')](_0xd3a5ff);}return _0x231189[_0x936f('0x1d')](_0xd3a5ff)[_0x936f('0x1e')]();};}function respondWithResult(_0x2214a7,_0x443245){_0x443245=_0x443245||0xc8;return function(_0x120bd0){if(_0x120bd0){return _0x2214a7[_0x936f('0x1d')](_0x443245)[_0x936f('0x1f')](_0x120bd0);}};}function respondWithFilteredResult(_0x929784,_0x3a1e7d){return function(_0x1d59b3){if(_0x1d59b3){var _0x47ef4a=typeof _0x3a1e7d[_0x936f('0x20')]===_0x936f('0x21')&&typeof _0x3a1e7d[_0x936f('0x22')]==='undefined';var _0x3fa12c=_0x1d59b3[_0x936f('0x23')];var _0xd19909=_0x47ef4a?0x0:_0x3a1e7d[_0x936f('0x20')];var _0x112412=_0x47ef4a?_0x1d59b3[_0x936f('0x23')]:_0x3a1e7d[_0x936f('0x20')]+_0x3a1e7d['limit'];var _0x2f2ce0;if(_0x112412>=_0x3fa12c){_0x112412=_0x3fa12c;_0x2f2ce0=0xc8;}else{_0x2f2ce0=0xce;}_0x929784[_0x936f('0x1d')](_0x2f2ce0);return _0x929784['set'](_0x936f('0x24'),_0xd19909+'-'+_0x112412+'/'+_0x3fa12c)[_0x936f('0x1f')](_0x1d59b3);}return null;};}function patchUpdates(_0x156f60){return function(_0x2ebc5b){try{jsonpatch['apply'](_0x2ebc5b,_0x156f60,!![]);}catch(_0x3a2b62){return BPromise['reject'](_0x3a2b62);}return _0x2ebc5b[_0x936f('0x25')]();};}function saveUpdates(_0x330cde,_0x3e90c0){return function(_0x434d15){if(_0x434d15){return _0x434d15['update'](_0x330cde)[_0x936f('0x26')](function(_0x581e3e){return _0x581e3e;});}return null;};}function removeEntity(_0x156ee8,_0x1f9d79){return function(_0xdcbda7){if(_0xdcbda7){return _0xdcbda7['destroy']()[_0x936f('0x26')](function(){_0x156ee8[_0x936f('0x1d')](0xcc)[_0x936f('0x1e')]();});}};}function handleEntityNotFound(_0x3e1e02,_0x36e07e){return function(_0x248fe6){if(!_0x248fe6){_0x3e1e02[_0x936f('0x1c')](0x194);}return _0x248fe6;};}function handleError(_0x1a5f8f,_0x4242ea){_0x4242ea=_0x4242ea||0x1f4;return function(_0x50d2df){logger[_0x936f('0x27')](_0x50d2df[_0x936f('0x28')]);if(_0x50d2df[_0x936f('0x29')]){delete _0x50d2df[_0x936f('0x29')];}_0x1a5f8f[_0x936f('0x1d')](_0x4242ea)[_0x936f('0x2a')](_0x50d2df);};}exports[_0x936f('0x2b')]=function(_0x54f32d,_0x87606d){var _0x467323={},_0x2c185b={},_0x258047={'count':0x0,'rows':[]};var _0x44b1d5=_['map'](db[_0x936f('0x2c')][_0x936f('0x2d')],function(_0x15a04b){return{'name':_0x15a04b[_0x936f('0x2e')],'type':_0x15a04b[_0x936f('0x2f')][_0x936f('0x30')]};});_0x2c185b[_0x936f('0x31')]=_[_0x936f('0x32')](_0x44b1d5,_0x936f('0x29'));_0x2c185b[_0x936f('0x33')]=_[_0x936f('0x34')](_0x54f32d[_0x936f('0x33')]);_0x2c185b['filters']=_['intersection'](_0x2c185b[_0x936f('0x31')],_0x2c185b['query']);_0x467323['attributes']=_[_0x936f('0x35')](_0x2c185b['model'],qs[_0x936f('0x36')](_0x54f32d[_0x936f('0x33')][_0x936f('0x36')]));_0x467323[_0x936f('0x37')]=_0x467323['attributes']['length']?_0x467323[_0x936f('0x37')]:_0x2c185b[_0x936f('0x31')];if(!_0x54f32d[_0x936f('0x33')][_0x936f('0x38')]('nolimit')){_0x467323[_0x936f('0x22')]=qs[_0x936f('0x22')](_0x54f32d[_0x936f('0x33')][_0x936f('0x22')]);_0x467323[_0x936f('0x20')]=qs['offset'](_0x54f32d['query'][_0x936f('0x20')]);}_0x467323[_0x936f('0x39')]=qs[_0x936f('0x3a')](_0x54f32d[_0x936f('0x33')][_0x936f('0x3a')]);_0x467323[_0x936f('0x3b')]=qs[_0x936f('0x3c')](_[_0x936f('0x3d')](_0x54f32d['query'],_0x2c185b[_0x936f('0x3c')]),_0x44b1d5);if(_0x54f32d['query'][_0x936f('0x3e')]){_0x467323[_0x936f('0x3b')]=_[_0x936f('0x3f')](_0x467323[_0x936f('0x3b')],{'$or':_[_0x936f('0x32')](_0x44b1d5,function(_0x41fd9d){if(_0x41fd9d[_0x936f('0x2f')]!=='VIRTUAL'){var _0x2f1275={};_0x2f1275[_0x41fd9d[_0x936f('0x29')]]={'$like':'%'+_0x54f32d[_0x936f('0x33')]['filter']+'%'};return _0x2f1275;}})});}_0x467323=_[_0x936f('0x3f')]({},_0x467323,_0x54f32d[_0x936f('0x40')]);var _0x6092dd={'where':_0x467323[_0x936f('0x3b')]};return db['SquareDetailsReport'][_0x936f('0x23')](_0x6092dd)[_0x936f('0x26')](function(_0x1f8312){_0x258047['count']=_0x1f8312;if(_0x54f32d[_0x936f('0x33')][_0x936f('0x41')]){_0x467323[_0x936f('0x42')]=[{'all':!![]}];}return db[_0x936f('0x2c')][_0x936f('0x43')](_0x467323);})['then'](function(_0x43db90){_0x258047[_0x936f('0x44')]=_0x43db90;return _0x258047;})['then'](respondWithFilteredResult(_0x87606d,_0x467323))['catch'](handleError(_0x87606d,null));};exports[_0x936f('0x45')]=function(_0x46eb50,_0x495563){var _0x55f05c={'raw':!![],'where':{'id':_0x46eb50[_0x936f('0x46')]['id']}},_0x18ed84={};_0x18ed84['model']=_[_0x936f('0x34')](db[_0x936f('0x2c')][_0x936f('0x2d')]);_0x18ed84[_0x936f('0x33')]=_['keys'](_0x46eb50[_0x936f('0x33')]);_0x18ed84[_0x936f('0x3c')]=_[_0x936f('0x35')](_0x18ed84[_0x936f('0x31')],_0x18ed84['query']);_0x55f05c['attributes']=_[_0x936f('0x35')](_0x18ed84[_0x936f('0x31')],qs[_0x936f('0x36')](_0x46eb50[_0x936f('0x33')][_0x936f('0x36')]));_0x55f05c[_0x936f('0x37')]=_0x55f05c[_0x936f('0x37')][_0x936f('0x47')]?_0x55f05c[_0x936f('0x37')]:_0x18ed84['model'];if(_0x46eb50['query']['includeAll']){_0x55f05c[_0x936f('0x42')]=[{'all':!![]}];}_0x55f05c=_[_0x936f('0x3f')]({},_0x55f05c,_0x46eb50['options']);return db['SquareDetailsReport'][_0x936f('0x48')](_0x55f05c)[_0x936f('0x26')](handleEntityNotFound(_0x495563,null))[_0x936f('0x26')](respondWithResult(_0x495563,null))[_0x936f('0x49')](handleError(_0x495563,null));};exports['create']=function(_0x2a7870,_0x53248b){return db[_0x936f('0x2c')][_0x936f('0x4a')](_0x2a7870[_0x936f('0x4b')],{})[_0x936f('0x26')](respondWithResult(_0x53248b,0xc9))[_0x936f('0x49')](handleError(_0x53248b,null));};exports[_0x936f('0x4c')]=function(_0x245b2b,_0x22d0ee){if(_0x245b2b[_0x936f('0x4b')]['id']){delete _0x245b2b[_0x936f('0x4b')]['id'];}return db[_0x936f('0x2c')][_0x936f('0x48')]({'where':{'id':_0x245b2b['params']['id']}})[_0x936f('0x26')](handleEntityNotFound(_0x22d0ee,null))[_0x936f('0x26')](saveUpdates(_0x245b2b[_0x936f('0x4b')],null))[_0x936f('0x26')](respondWithResult(_0x22d0ee,null))['catch'](handleError(_0x22d0ee,null));};exports[_0x936f('0x4d')]=function(_0xf97e58,_0x4f4550){return db[_0x936f('0x2c')][_0x936f('0x48')]({'where':{'id':_0xf97e58[_0x936f('0x46')]['id']}})[_0x936f('0x26')](handleEntityNotFound(_0x4f4550,null))[_0x936f('0x26')](removeEntity(_0x4f4550,null))[_0x936f('0x49')](handleError(_0x4f4550,null));};exports[_0x936f('0x4e')]=function(_0x5ed6d1,_0x4110ca){return db['SquareDetailsReport'][_0x936f('0x4e')]()[_0x936f('0x26')](respondWithResult(_0x4110ca,null))[_0x936f('0x49')](handleError(_0x4110ca,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b483bbe..550a5d9 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 _0xfd9c=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','api','bluebird'];(function(_0x1028d5,_0x202a78){var _0x12934a=function(_0x507027){while(--_0x507027){_0x1028d5['push'](_0x1028d5['shift']());}};_0x12934a(++_0x202a78);}(_0xfd9c,0x154));var _0xcfd9=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xfd9c[_0x3c4a7c];return _0xf13d1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xcfd9('0x0'));var moment=require('moment');var BPromise=require(_0xcfd9('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfd9('0x2'));var config=require(_0xcfd9('0x3'));var attributes=require(_0xcfd9('0x4'));module[_0xcfd9('0x5')]=function(_0x4a357b,_0x3badeb){return _0x4a357b[_0xcfd9('0x6')](_0xcfd9('0x7'),attributes,{'tableName':_0xcfd9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb78d=['util','../../config/logger','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x24c451,_0x15cea2){var _0x4b174c=function(_0x553c42){while(--_0x553c42){_0x24c451['push'](_0x24c451['shift']());}};_0x4b174c(++_0x15cea2);}(_0xb78d,0x103));var _0xdb78=function(_0x172407,_0x252fd0){_0x172407=_0x172407-0x0;var _0x4402a7=_0xb78d[_0x172407];return _0x4402a7;};'use strict';var _=require(_0xdb78('0x0'));var util=require(_0xdb78('0x1'));var logger=require(_0xdb78('0x2'))(_0xdb78('0x3'));var moment=require(_0xdb78('0x4'));var BPromise=require(_0xdb78('0x5'));var rp=require(_0xdb78('0x6'));var fs=require('fs');var path=require(_0xdb78('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdb78('0x8'));module[_0xdb78('0x9')]=function(_0x280cd4,_0x43b1dd){return _0x280cd4[_0xdb78('0xa')](_0xdb78('0xb'),attributes,{'tableName':_0xdb78('0xc'),'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 1bda613..ec9bf96 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 _0xa7fa=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2df413,_0x5303ae){var _0x1f5133=function(_0xb2347c){while(--_0xb2347c){_0x2df413['push'](_0x2df413['shift']());}};_0x1f5133(++_0x5303ae);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa7f('0x1'));var rs=require(_0xaa7f('0x2'));var fs=require('fs');var Redis=require(_0xaa7f('0x3'));var db=require(_0xaa7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa7f('0x5'))(_0xaa7f('0x6'));var config=require(_0xaa7f('0x7'));var jayson=require(_0xaa7f('0x8'));var client=jayson['client'][_0xaa7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48105b,_0x50bab6,_0x3898a3){return new BPromise(function(_0x506a91,_0x3ac236){return client[_0xaa7f('0xa')](_0x48105b,_0x3898a3)[_0xaa7f('0xb')](function(_0x2dbcb6){logger['info'](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));logger['debug'](_0xaa7f('0xe'),_0x50bab6,_0xaa7f('0xd'),JSON[_0xaa7f('0xf')](_0x2dbcb6));if(_0x2dbcb6[_0xaa7f('0x10')]){if(_0x2dbcb6['error']['code']===0x1f4){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);return _0x3ac236(_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);}logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')]['message']);return _0x506a91(_0x2dbcb6[_0xaa7f('0x10')]['message']);}else{logger[_0xaa7f('0x12')](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));_0x506a91(_0x2dbcb6['result'][_0xaa7f('0x11')]);}})[_0xaa7f('0x13')](function(_0x1bd3f9){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x1bd3f9);_0x3ac236(_0x1bd3f9);});});}exports[_0xaa7f('0x14')]=function(_0x2c17c4){var _0x4fbd09=this;return new Promise(function(_0x90863a,_0x1e18a6){return db[_0xaa7f('0x15')][_0xaa7f('0x16')](_0x2c17c4['body'],{'raw':_0x2c17c4['options']?_0x2c17c4[_0xaa7f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaa7f('0xb')](function(_0x21e870){logger['info'](_0xaa7f('0x14'),_0x2c17c4);logger['debug'](_0xaa7f('0x14'),_0x2c17c4,JSON[_0xaa7f('0xf')](_0x21e870));_0x90863a(_0x21e870);})[_0xaa7f('0x13')](function(_0x516d7e){logger[_0xaa7f('0x10')](_0xaa7f('0x14'),_0x516d7e[_0xaa7f('0x11')],_0x2c17c4);_0x1e18a6(_0x4fbd09[_0xaa7f('0x10')](0x1f4,_0x516d7e['message']));});});}; \ No newline at end of file +var _0x09df=['util','bluebird','../../mysqldb','rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','SquareDetailsReport,\x20%s,\x20%s','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','catch','lodash'];(function(_0x2c2fa1,_0x1fd9d1){var _0x4c2de3=function(_0x4fef39){while(--_0x4fef39){_0x2c2fa1['push'](_0x2c2fa1['shift']());}};_0x4c2de3(++_0x1fd9d1);}(_0x09df,0x164));var _0xf09d=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x09df[_0x189305];return _0xea3406;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('SquareDetailsReport,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});}exports[_0xf09d('0xf')]=function(_0x57e3f8){var _0x38083e=this;return new Promise(function(_0xc4b380,_0x106fb0){return db[_0xf09d('0x10')][_0xf09d('0x11')](_0x57e3f8[_0xf09d('0x12')],{'raw':_0x57e3f8['options']?_0x57e3f8[_0xf09d('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xf09d('0x7')](function(_0x342e14){logger[_0xf09d('0x8')](_0xf09d('0xf'),_0x57e3f8);logger[_0xf09d('0xa')](_0xf09d('0xf'),_0x57e3f8,JSON['stringify'](_0x342e14));_0xc4b380(_0x342e14);})[_0xf09d('0x14')](function(_0x2ab436){logger[_0xf09d('0xb')](_0xf09d('0xf'),_0x2ab436[_0xf09d('0xe')],_0x57e3f8);_0x106fb0(_0x38083e[_0xf09d('0xb')](0x1f4,_0x2ab436[_0xf09d('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b6f2248..f4b16ba 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 _0xbc1b=['Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','express'];(function(_0x1f4acc,_0x5d1fb8){var _0x44643b=function(_0x546902){while(--_0x546902){_0x1f4acc['push'](_0x1f4acc['shift']());}};_0x44643b(++_0x5d1fb8);}(_0xbc1b,0x14f));var _0xbbc1=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xbc1b[_0x32b993];return _0x482780;};'use strict';var express=require(_0xbbc1('0x0'));var router=express[_0xbbc1('0x1')]();var auth=require(_0xbbc1('0x2'));var controller=require('./system.controller');router[_0xbbc1('0x3')]('/',auth[_0xbbc1('0x4')](),controller[_0xbbc1('0x5')]);router[_0xbbc1('0x3')](_0xbbc1('0x6'),auth[_0xbbc1('0x4')](),controller[_0xbbc1('0x7')]);module['exports']=router; \ No newline at end of file +var _0x41b9=['isAuthenticated','index','/process/:pid/kill','exports','express','Router','../../components/auth/service','./system.controller','get'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x41b9,0x17e));var _0x941b=function(_0x2b1452,_0x59b005){_0x2b1452=_0x2b1452-0x0;var _0x177bad=_0x41b9[_0x2b1452];return _0x177bad;};'use strict';var express=require(_0x941b('0x0'));var router=express[_0x941b('0x1')]();var auth=require(_0x941b('0x2'));var controller=require(_0x941b('0x3'));router[_0x941b('0x4')]('/',auth[_0x941b('0x5')](),controller[_0x941b('0x6')]);router[_0x941b('0x4')](_0x941b('0x7'),auth[_0x941b('0x5')](),controller['killProcess']);module[_0x941b('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 3d6e18e..d56f58d 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 _0xb76e=['ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','status','systeminformation','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','catch','json','killProcess','format'];(function(_0x4dad35,_0x4391d3){var _0x2df32c=function(_0xe6109c){while(--_0xe6109c){_0x4dad35['push'](_0x4dad35['shift']());}};_0x2df32c(++_0x4391d3);}(_0xb76e,0x1ae));var _0xeb76=function(_0x57b386,_0x5727f7){_0x57b386=_0x57b386-0x0;var _0x3ad682=_0xb76e[_0x57b386];return _0x3ad682;};'use strict';var info=require(_0xeb76('0x0'));var exec=require('child_process')[_0xeb76('0x1')];var logger=require(_0xeb76('0x2'))(_0xeb76('0x3'));var util=require(_0xeb76('0x4'));var BPromise=require(_0xeb76('0x5'));var _=require(_0xeb76('0x6'));function handleError(_0x2e8252,_0x16e7be,_0x25e9cc){_0x16e7be=_0x16e7be||0x1f4;return function(_0x19c93f){logger['error'](_0xeb76('0x7'),_0x25e9cc,_0x16e7be,util[_0xeb76('0x8')](_0x19c93f,{'showHidden':![],'depth':null}));delete _0x19c93f[_0xeb76('0x9')];_0x2e8252['status'](_0x16e7be)[_0xeb76('0xa')](_0x19c93f);};}exports[_0xeb76('0xb')]=function(_0x5c1ab4,_0x32ab2f){return info[_0xeb76('0xc')]()[_0xeb76('0xd')](function(_0x3cec3c){return _0x32ab2f['status'](0xc8)['json'](_0x3cec3c);})[_0xeb76('0xe')](function(_0x29eaf9){return _0x32ab2f['status'](0x1f4)[_0xeb76('0xf')](_0x29eaf9);});};exports[_0xeb76('0x10')]=function(_0x5dc911,_0x419513){var _0x368e2c=['components/import/cm'];return new BPromise(function(_0x12fa5c,_0x3a436b){return exec(util[_0xeb76('0x11')](_0xeb76('0x12'),_0x5dc911[_0xeb76('0x13')][_0xeb76('0x14')]),function(_0x38a6af,_0x75a11,_0x48e126){if(_0x38a6af){return _0x3a436b(_0x38a6af);}return _0x12fa5c(_0x75a11);});})[_0xeb76('0xd')](function(_0x5062be){var _0x4d89e5=![];var _0x186307=_0x5062be[_0xeb76('0x15')](/\n/);for(var _0x4fe441=0x0,_0x375efd=_0x368e2c[_0xeb76('0x16')];_0x4fe441<_0x375efd,_0x4d89e5===![];_0x4fe441+=0x1){if(_0x5062be[_0xeb76('0x17')](_0x368e2c[_0x4fe441])>=0x0){_0x4d89e5=!![];}}if(!_0x4d89e5){throw new Error(util[_0xeb76('0x11')](_0xeb76('0x18'),_0x5dc911[_0xeb76('0x13')][_0xeb76('0x14')]));}process[_0xeb76('0x19')](_0x5dc911[_0xeb76('0x13')][_0xeb76('0x14')],_0xeb76('0x1a'));return _0x419513[_0xeb76('0x1b')](0xc8)[_0xeb76('0xf')]({'message':util[_0xeb76('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5dc911[_0xeb76('0x13')][_0xeb76('0x14')])});})['catch'](handleError(_0x419513,null,_0xeb76('0x10')));}; \ No newline at end of file +var _0x98c6=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','killProcess','format','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','json'];(function(_0x55d1e5,_0x17176f){var _0x498855=function(_0xb51390){while(--_0xb51390){_0x55d1e5['push'](_0x55d1e5['shift']());}};_0x498855(++_0x17176f);}(_0x98c6,0xe1));var _0x698c=function(_0x30d81f,_0xfcfe2d){_0x30d81f=_0x30d81f-0x0;var _0x2e58ab=_0x98c6[_0x30d81f];return _0x2e58ab;};'use strict';var info=require(_0x698c('0x0'));var exec=require(_0x698c('0x1'))[_0x698c('0x2')];var logger=require('../../config/logger')(_0x698c('0x3'));var util=require(_0x698c('0x4'));var BPromise=require(_0x698c('0x5'));var _=require(_0x698c('0x6'));function handleError(_0x353f1,_0xe18f28,_0x2b9d18){_0xe18f28=_0xe18f28||0x1f4;return function(_0x4cb64d){logger['error'](_0x698c('0x7'),_0x2b9d18,_0xe18f28,util[_0x698c('0x8')](_0x4cb64d,{'showHidden':![],'depth':null}));delete _0x4cb64d[_0x698c('0x9')];_0x353f1[_0x698c('0xa')](_0xe18f28)[_0x698c('0xb')](_0x4cb64d);};}exports[_0x698c('0xc')]=function(_0x23fd0d,_0x4f883a){return info[_0x698c('0xd')]()[_0x698c('0xe')](function(_0x25997e){return _0x4f883a[_0x698c('0xa')](0xc8)['json'](_0x25997e);})[_0x698c('0xf')](function(_0x3b655b){return _0x4f883a['status'](0x1f4)['json'](_0x3b655b);});};exports[_0x698c('0x10')]=function(_0x1a75df,_0x3847ee){var _0x28a8ac=['components/import/cm'];return new BPromise(function(_0x5ef50d,_0x5846d8){return exec(util[_0x698c('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1a75df[_0x698c('0x12')]['pid']),function(_0x1d9e76,_0x29cfda,_0x3ba61b){if(_0x1d9e76){return _0x5846d8(_0x1d9e76);}return _0x5ef50d(_0x29cfda);});})[_0x698c('0xe')](function(_0x3cdf02){var _0x533817=![];var _0x43dc16=_0x3cdf02[_0x698c('0x13')](/\n/);for(var _0x304dde=0x0,_0xcbffa5=_0x28a8ac[_0x698c('0x14')];_0x304dde<_0xcbffa5,_0x533817===![];_0x304dde+=0x1){if(_0x3cdf02[_0x698c('0x15')](_0x28a8ac[_0x304dde])>=0x0){_0x533817=!![];}}if(!_0x533817){throw new Error(util[_0x698c('0x11')](_0x698c('0x16'),_0x1a75df[_0x698c('0x12')][_0x698c('0x17')]));}process[_0x698c('0x18')](_0x1a75df[_0x698c('0x12')]['pid'],_0x698c('0x19'));return _0x3847ee[_0x698c('0xa')](0xc8)[_0x698c('0x1a')]({'message':util[_0x698c('0x11')](_0x698c('0x1b'),_0x1a75df[_0x698c('0x12')][_0x698c('0x17')])});})[_0x698c('0xf')](handleError(_0x3847ee,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4ea1673..d16d733 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 _0x78bd=['isAuthenticated','get','show','post','create','put','/:id','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller'];(function(_0x681bb7,_0x343675){var _0x5e2a57=function(_0x33fe83){while(--_0x33fe83){_0x681bb7['push'](_0x681bb7['shift']());}};_0x5e2a57(++_0x343675);}(_0x78bd,0x1f0));var _0xd78b=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x78bd[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xd78b('0x0'));var util=require(_0xd78b('0x1'));var path=require(_0xd78b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd78b('0x3')]();var fs_extra=require(_0xd78b('0x4'));var auth=require(_0xd78b('0x5'));var interaction=require(_0xd78b('0x6'));var config=require('../../config/environment');var controller=require(_0xd78b('0x7'));router['get']('/',auth[_0xd78b('0x8')](),controller['index']);router[_0xd78b('0x9')]('/:id',auth[_0xd78b('0x8')](),controller[_0xd78b('0xa')]);router[_0xd78b('0xb')]('/',auth[_0xd78b('0x8')](),controller[_0xd78b('0xc')]);router[_0xd78b('0xd')](_0xd78b('0xe'),auth[_0xd78b('0x8')](),controller[_0xd78b('0xf')]);router['delete']('/:id',auth[_0xd78b('0x8')](),controller[_0xd78b('0x10')]);module[_0xd78b('0x11')]=router; \ No newline at end of file +var _0x56be=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x42cc5f,_0x4806cd){var _0x152bb6=function(_0xbaf7e7){while(--_0xbaf7e7){_0x42cc5f['push'](_0x42cc5f['shift']());}};_0x152bb6(++_0x4806cd);}(_0x56be,0x1d7));var _0xe56b=function(_0x2ae150,_0x120016){_0x2ae150=_0x2ae150-0x0;var _0x54bb7c=_0x56be[_0x2ae150];return _0x54bb7c;};'use strict';var multer=require(_0xe56b('0x0'));var util=require(_0xe56b('0x1'));var path=require(_0xe56b('0x2'));var timeout=require(_0xe56b('0x3'));var express=require(_0xe56b('0x4'));var router=express[_0xe56b('0x5')]();var fs_extra=require(_0xe56b('0x6'));var auth=require(_0xe56b('0x7'));var interaction=require(_0xe56b('0x8'));var config=require(_0xe56b('0x9'));var controller=require('./tag.controller');router[_0xe56b('0xa')]('/',auth['isAuthenticated'](),controller[_0xe56b('0xb')]);router[_0xe56b('0xa')]('/:id',auth[_0xe56b('0xc')](),controller[_0xe56b('0xd')]);router['post']('/',auth[_0xe56b('0xc')](),controller['create']);router[_0xe56b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe56b('0xf')]);router[_0xe56b('0x10')]('/:id',auth[_0xe56b('0xc')](),controller[_0xe56b('0x11')]);module[_0xe56b('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index fcd61ba..c50467c 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 _0x13cc=['name','#0091EA','STRING'];(function(_0x20ab51,_0x246894){var _0x51a966=function(_0x40d2fd){while(--_0x40d2fd){_0x20ab51['push'](_0x20ab51['shift']());}};_0x51a966(++_0x246894);}(_0x13cc,0x161));var _0xc13c=function(_0x5296ee,_0x1c060f){_0x5296ee=_0x5296ee-0x0;var _0x374767=_0x13cc[_0x5296ee];return _0x374767;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc13c('0x0')],'unique':_0xc13c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xc13c('0x2')},'description':{'type':Sequelize[_0xc13c('0x0')]}}; \ No newline at end of file +var _0x2b4f=['STRING','#0091EA','exports','name'];(function(_0xb89931,_0x461b9e){var _0x324b86=function(_0x4be23d){while(--_0x4be23d){_0xb89931['push'](_0xb89931['shift']());}};_0x324b86(++_0x461b9e);}(_0x2b4f,0x142));var _0xf2b4=function(_0x33a48b,_0x52a654){_0x33a48b=_0x33a48b-0x0;var _0x140e83=_0x2b4f[_0x33a48b];return _0x140e83;};'use strict';var Sequelize=require('sequelize');module[_0xf2b4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf2b4('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf2b4('0x2')],'defaultValue':_0xf2b4('0x3')},'description':{'type':Sequelize[_0xf2b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 0a99b03..ac37335 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 _0x867f=['../../config/logger','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Tags','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x71cef2,_0x149fc5){var _0x4b825a=function(_0xb723ec){while(--_0xb723ec){_0x71cef2['push'](_0x71cef2['shift']());}};_0x4b825a(++_0x149fc5);}(_0x867f,0xe6));var _0xf867=function(_0x310a23,_0x49f6b5){_0x310a23=_0x310a23-0x0;var _0x50fe57=_0x867f[_0x310a23];return _0x50fe57;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require(_0xf867('0x3'));var rp=require(_0xf867('0x4'));var moment=require(_0xf867('0x5'));var BPromise=require(_0xf867('0x6'));var Mustache=require(_0xf867('0x7'));var util=require(_0xf867('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf867('0x9'));var ejs=require(_0xf867('0xa'));var fs=require('fs');var fs_extra=require(_0xf867('0xb'));var _=require(_0xf867('0xc'));var squel=require(_0xf867('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf867('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf867('0xf'));var Papa=require(_0xf867('0x10'));var Redis=require(_0xf867('0x11'));var authService=require(_0xf867('0x12'));var qs=require(_0xf867('0x13'));var as=require(_0xf867('0x14'));var hardwareService=require(_0xf867('0x15'));var logger=require(_0xf867('0x16'))('api');var utils=require(_0xf867('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf867('0x18'))['db'];function respondWithStatusCode(_0x1792ae,_0x20fe34){_0x20fe34=_0x20fe34||0xcc;return function(_0x56740c){if(_0x56740c){return _0x1792ae['sendStatus'](_0x20fe34);}return _0x1792ae[_0xf867('0x19')](_0x20fe34)['end']();};}function respondWithResult(_0x352f0b,_0x49ff40){_0x49ff40=_0x49ff40||0xc8;return function(_0x48ff28){if(_0x48ff28){return _0x352f0b[_0xf867('0x19')](_0x49ff40)[_0xf867('0x1a')](_0x48ff28);}};}function respondWithFilteredResult(_0x7a143e,_0x13973b){return function(_0x38fed9){if(_0x38fed9){var _0x1e5161=typeof _0x13973b[_0xf867('0x1b')]===_0xf867('0x1c')&&typeof _0x13973b[_0xf867('0x1d')]==='undefined';var _0x44f6f1=_0x38fed9['count'];var _0x39f9e8=_0x1e5161?0x0:_0x13973b['offset'];var _0x51bdb3=_0x1e5161?_0x38fed9[_0xf867('0x1e')]:_0x13973b['offset']+_0x13973b['limit'];var _0x2092af;if(_0x51bdb3>=_0x44f6f1){_0x51bdb3=_0x44f6f1;_0x2092af=0xc8;}else{_0x2092af=0xce;}_0x7a143e[_0xf867('0x19')](_0x2092af);return _0x7a143e['set']('Content-Range',_0x39f9e8+'-'+_0x51bdb3+'/'+_0x44f6f1)[_0xf867('0x1a')](_0x38fed9);}return null;};}function patchUpdates(_0x23e7dd){return function(_0x1456ce){try{jsonpatch[_0xf867('0x1f')](_0x1456ce,_0x23e7dd,!![]);}catch(_0x419f75){return BPromise[_0xf867('0x20')](_0x419f75);}return _0x1456ce[_0xf867('0x21')]();};}function saveUpdates(_0x34db74,_0x586a25){return function(_0x568aba){if(_0x568aba){return _0x568aba[_0xf867('0x22')](_0x34db74)['then'](function(_0x3072b7){return _0x3072b7;});}return null;};}function removeEntity(_0x3fc971,_0x4da34b){return function(_0x419b6f){if(_0x419b6f){return _0x419b6f[_0xf867('0x23')]()['then'](function(){var _0x231076=_0x419b6f[_0xf867('0x24')]({'plain':!![]});var _0x167e70=_0xf867('0x25');return db[_0xf867('0x26')][_0xf867('0x23')]({'where':{'type':_0x167e70,'resourceId':_0x231076['id']}})[_0xf867('0x27')](function(){return _0x419b6f;});})[_0xf867('0x27')](function(){_0x3fc971[_0xf867('0x19')](0xcc)[_0xf867('0x28')]();});}};}function handleEntityNotFound(_0x28b44a,_0x1f8aa1){return function(_0xa40271){if(!_0xa40271){_0x28b44a[_0xf867('0x29')](0x194);}return _0xa40271;};}function handleError(_0x327a13,_0x3ed616){_0x3ed616=_0x3ed616||0x1f4;return function(_0x57bf28){logger[_0xf867('0x2a')](_0x57bf28[_0xf867('0x2b')]);if(_0x57bf28[_0xf867('0x2c')]){delete _0x57bf28[_0xf867('0x2c')];}_0x327a13[_0xf867('0x19')](_0x3ed616)[_0xf867('0x2d')](_0x57bf28);};}exports[_0xf867('0x2e')]=function(_0x517b9c,_0x44ddd4){var _0x3e076c={},_0x216716={},_0x36ed62={'count':0x0,'rows':[]};var _0x40517f=_[_0xf867('0x2f')](db[_0xf867('0x30')][_0xf867('0x31')],function(_0x4ffce9){return{'name':_0x4ffce9[_0xf867('0x32')],'type':_0x4ffce9['type'][_0xf867('0x33')]};});_0x216716['model']=_[_0xf867('0x2f')](_0x40517f,_0xf867('0x2c'));_0x216716[_0xf867('0x34')]=_['keys'](_0x517b9c[_0xf867('0x34')]);_0x216716[_0xf867('0x35')]=_['intersection'](_0x216716['model'],_0x216716[_0xf867('0x34')]);_0x3e076c['attributes']=_[_0xf867('0x36')](_0x216716[_0xf867('0x37')],qs[_0xf867('0x38')](_0x517b9c[_0xf867('0x34')]['fields']));_0x3e076c['attributes']=_0x3e076c[_0xf867('0x39')][_0xf867('0x3a')]?_0x3e076c[_0xf867('0x39')]:_0x216716['model'];if(!_0x517b9c[_0xf867('0x34')][_0xf867('0x3b')]('nolimit')){_0x3e076c[_0xf867('0x1d')]=qs['limit'](_0x517b9c[_0xf867('0x34')][_0xf867('0x1d')]);_0x3e076c[_0xf867('0x1b')]=qs['offset'](_0x517b9c[_0xf867('0x34')]['offset']);}_0x3e076c[_0xf867('0x3c')]=qs[_0xf867('0x3d')](_0x517b9c[_0xf867('0x34')][_0xf867('0x3d')]);_0x3e076c[_0xf867('0x3e')]=qs[_0xf867('0x35')](_[_0xf867('0x3f')](_0x517b9c[_0xf867('0x34')],_0x216716['filters']),_0x40517f);if(_0x517b9c['query'][_0xf867('0x40')]){_0x3e076c[_0xf867('0x3e')]=_[_0xf867('0x41')](_0x3e076c[_0xf867('0x3e')],{'$or':_[_0xf867('0x2f')](_0x40517f,function(_0x462df6){if(_0x462df6[_0xf867('0x42')]!=='VIRTUAL'){var _0x4513e1={};_0x4513e1[_0x462df6[_0xf867('0x2c')]]={'$like':'%'+_0x517b9c[_0xf867('0x34')][_0xf867('0x40')]+'%'};return _0x4513e1;}})});}_0x3e076c=_[_0xf867('0x41')]({},_0x3e076c,_0x517b9c[_0xf867('0x43')]);var _0x419b34={'where':_0x3e076c[_0xf867('0x3e')]};return db[_0xf867('0x30')]['count'](_0x419b34)[_0xf867('0x27')](function(_0x4e31d8){_0x36ed62[_0xf867('0x1e')]=_0x4e31d8;if(_0x517b9c[_0xf867('0x34')][_0xf867('0x44')]){_0x3e076c['include']=[{'all':!![]}];}return db[_0xf867('0x30')][_0xf867('0x45')](_0x3e076c);})[_0xf867('0x27')](function(_0xed868d){_0x36ed62[_0xf867('0x46')]=_0xed868d;return _0x36ed62;})[_0xf867('0x27')](respondWithFilteredResult(_0x44ddd4,_0x3e076c))['catch'](handleError(_0x44ddd4,null));};exports[_0xf867('0x47')]=function(_0x2d02f8,_0x1d5dad){var _0x20ec01={'raw':!![],'where':{'id':_0x2d02f8['params']['id']}},_0x3b8929={};_0x3b8929[_0xf867('0x37')]=_['keys'](db[_0xf867('0x30')][_0xf867('0x31')]);_0x3b8929['query']=_[_0xf867('0x48')](_0x2d02f8[_0xf867('0x34')]);_0x3b8929[_0xf867('0x35')]=_[_0xf867('0x36')](_0x3b8929[_0xf867('0x37')],_0x3b8929[_0xf867('0x34')]);_0x20ec01['attributes']=_[_0xf867('0x36')](_0x3b8929['model'],qs[_0xf867('0x38')](_0x2d02f8[_0xf867('0x34')][_0xf867('0x38')]));_0x20ec01[_0xf867('0x39')]=_0x20ec01[_0xf867('0x39')][_0xf867('0x3a')]?_0x20ec01[_0xf867('0x39')]:_0x3b8929['model'];if(_0x2d02f8['query'][_0xf867('0x44')]){_0x20ec01[_0xf867('0x49')]=[{'all':!![]}];}_0x20ec01=_[_0xf867('0x41')]({},_0x20ec01,_0x2d02f8['options']);return db[_0xf867('0x30')][_0xf867('0x4a')](_0x20ec01)[_0xf867('0x27')](handleEntityNotFound(_0x1d5dad,null))['then'](respondWithResult(_0x1d5dad,null))[_0xf867('0x4b')](handleError(_0x1d5dad,null));};exports['create']=function(_0xc01c03,_0x2d56c0){return db[_0xf867('0x30')][_0xf867('0x4c')](_0xc01c03[_0xf867('0x4d')],{})[_0xf867('0x27')](function(_0x422b28){var _0x1b6253=_0xc01c03['user']['get']({'plain':!![]});if(!_0x1b6253)throw new Error(_0xf867('0x4e'));if(_0x1b6253[_0xf867('0x4f')]===_0xf867('0x50')){var _0x199ce0=_0x422b28[_0xf867('0x24')]({'plain':!![]});var _0x42990f=_0xf867('0x25');return db['UserProfileSection'][_0xf867('0x4a')]({'where':{'name':_0x42990f,'userProfileId':_0x1b6253[_0xf867('0x51')]},'raw':!![]})[_0xf867('0x27')](function(_0x357bc4){if(_0x357bc4&&_0x357bc4['autoAssociation']===0x0){return db[_0xf867('0x26')][_0xf867('0x4c')]({'name':_0x199ce0['name'],'resourceId':_0x199ce0['id'],'type':_0x357bc4['name'],'sectionId':_0x357bc4['id']},{})['then'](function(){return _0x422b28;});}else{return _0x422b28;}})[_0xf867('0x4b')](function(_0x347273){logger['error'](_0xf867('0x52'),_0x347273);throw _0x347273;});}return _0x422b28;})[_0xf867('0x27')](respondWithResult(_0x2d56c0,0xc9))['catch'](handleError(_0x2d56c0,null));};exports[_0xf867('0x22')]=function(_0x3041cf,_0x59d460){if(_0x3041cf[_0xf867('0x4d')]['id']){delete _0x3041cf[_0xf867('0x4d')]['id'];}return db[_0xf867('0x30')][_0xf867('0x4a')]({'where':{'id':_0x3041cf[_0xf867('0x53')]['id']}})['then'](handleEntityNotFound(_0x59d460,null))['then'](saveUpdates(_0x3041cf[_0xf867('0x4d')],null))[_0xf867('0x27')](respondWithResult(_0x59d460,null))[_0xf867('0x4b')](handleError(_0x59d460,null));};exports[_0xf867('0x23')]=function(_0x3afdc9,_0x44229e){return db['Tag'][_0xf867('0x4a')]({'where':{'id':_0x3afdc9[_0xf867('0x53')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x44229e,null))[_0xf867('0x27')](removeEntity(_0x44229e,null))[_0xf867('0x4b')](handleError(_0x44229e,null));}; \ No newline at end of file +var _0xaa7c=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','Tag','includeAll','include','findAll','rows','catch','show','params','options','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','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xf52342,_0x2e9017){var _0x120899=function(_0x486ad2){while(--_0x486ad2){_0xf52342['push'](_0xf52342['shift']());}};_0x120899(++_0x2e9017);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x55ec70,_0x49a0ce){_0x55ec70=_0x55ec70-0x0;var _0x5b2ece=_0xaa7c[_0x55ec70];return _0x5b2ece;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];function respondWithStatusCode(_0x563f57,_0x24d3b0){_0x24d3b0=_0x24d3b0||0xcc;return function(_0x128cfb){if(_0x128cfb){return _0x563f57[_0xcaa7('0x16')](_0x24d3b0);}return _0x563f57[_0xcaa7('0x17')](_0x24d3b0)[_0xcaa7('0x18')]();};}function respondWithResult(_0x2eb4ff,_0x299490){_0x299490=_0x299490||0xc8;return function(_0x4a1d5a){if(_0x4a1d5a){return _0x2eb4ff['status'](_0x299490)[_0xcaa7('0x19')](_0x4a1d5a);}};}function respondWithFilteredResult(_0x1c1286,_0x1155fb){return function(_0x1b2c4f){if(_0x1b2c4f){var _0x49a218=typeof _0x1155fb[_0xcaa7('0x1a')]===_0xcaa7('0x1b')&&typeof _0x1155fb[_0xcaa7('0x1c')]===_0xcaa7('0x1b');var _0x46d9b4=_0x1b2c4f[_0xcaa7('0x1d')];var _0x20ede0=_0x49a218?0x0:_0x1155fb['offset'];var _0x53e1cb=_0x49a218?_0x1b2c4f[_0xcaa7('0x1d')]:_0x1155fb[_0xcaa7('0x1a')]+_0x1155fb[_0xcaa7('0x1c')];var _0x3bc53b;if(_0x53e1cb>=_0x46d9b4){_0x53e1cb=_0x46d9b4;_0x3bc53b=0xc8;}else{_0x3bc53b=0xce;}_0x1c1286[_0xcaa7('0x17')](_0x3bc53b);return _0x1c1286[_0xcaa7('0x1e')](_0xcaa7('0x1f'),_0x20ede0+'-'+_0x53e1cb+'/'+_0x46d9b4)['json'](_0x1b2c4f);}return null;};}function patchUpdates(_0x89e8a0){return function(_0x3650ac){try{jsonpatch[_0xcaa7('0x20')](_0x3650ac,_0x89e8a0,!![]);}catch(_0x11cbbf){return BPromise[_0xcaa7('0x21')](_0x11cbbf);}return _0x3650ac[_0xcaa7('0x22')]();};}function saveUpdates(_0x3119d5,_0x4259b7){return function(_0x2a9a79){if(_0x2a9a79){return _0x2a9a79[_0xcaa7('0x23')](_0x3119d5)[_0xcaa7('0x24')](function(_0x140c5a){return _0x140c5a;});}return null;};}function removeEntity(_0x24a18c,_0x56ee3a){return function(_0x97a507){if(_0x97a507){return _0x97a507[_0xcaa7('0x25')]()['then'](function(){var _0x3f0eb2=_0x97a507[_0xcaa7('0x26')]({'plain':!![]});var _0x146e6f=_0xcaa7('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x146e6f,'resourceId':_0x3f0eb2['id']}})[_0xcaa7('0x24')](function(){return _0x97a507;});})[_0xcaa7('0x24')](function(){_0x24a18c[_0xcaa7('0x17')](0xcc)[_0xcaa7('0x18')]();});}};}function handleEntityNotFound(_0x4391a9,_0x4ec9e9){return function(_0x1a2577){if(!_0x1a2577){_0x4391a9['sendStatus'](0x194);}return _0x1a2577;};}function handleError(_0x5b4914,_0x3f9833){_0x3f9833=_0x3f9833||0x1f4;return function(_0x492362){logger[_0xcaa7('0x28')](_0x492362[_0xcaa7('0x29')]);if(_0x492362[_0xcaa7('0x2a')]){delete _0x492362[_0xcaa7('0x2a')];}_0x5b4914[_0xcaa7('0x17')](_0x3f9833)[_0xcaa7('0x2b')](_0x492362);};}exports[_0xcaa7('0x2c')]=function(_0x3b9cea,_0x492843){var _0x19d02c={},_0x27cfd0={},_0x24b192={'count':0x0,'rows':[]};var _0x3b2c4c=_[_0xcaa7('0x2d')](db['Tag'][_0xcaa7('0x2e')],function(_0x394da5){return{'name':_0x394da5[_0xcaa7('0x2f')],'type':_0x394da5[_0xcaa7('0x30')][_0xcaa7('0x31')]};});_0x27cfd0['model']=_[_0xcaa7('0x2d')](_0x3b2c4c,'name');_0x27cfd0[_0xcaa7('0x32')]=_[_0xcaa7('0x33')](_0x3b9cea[_0xcaa7('0x32')]);_0x27cfd0['filters']=_[_0xcaa7('0x34')](_0x27cfd0[_0xcaa7('0x35')],_0x27cfd0[_0xcaa7('0x32')]);_0x19d02c[_0xcaa7('0x36')]=_[_0xcaa7('0x34')](_0x27cfd0[_0xcaa7('0x35')],qs['fields'](_0x3b9cea[_0xcaa7('0x32')][_0xcaa7('0x37')]));_0x19d02c['attributes']=_0x19d02c[_0xcaa7('0x36')][_0xcaa7('0x38')]?_0x19d02c[_0xcaa7('0x36')]:_0x27cfd0[_0xcaa7('0x35')];if(!_0x3b9cea['query'][_0xcaa7('0x39')](_0xcaa7('0x3a'))){_0x19d02c[_0xcaa7('0x1c')]=qs[_0xcaa7('0x1c')](_0x3b9cea[_0xcaa7('0x32')][_0xcaa7('0x1c')]);_0x19d02c[_0xcaa7('0x1a')]=qs[_0xcaa7('0x1a')](_0x3b9cea[_0xcaa7('0x32')][_0xcaa7('0x1a')]);}_0x19d02c[_0xcaa7('0x3b')]=qs[_0xcaa7('0x3c')](_0x3b9cea['query'][_0xcaa7('0x3c')]);_0x19d02c[_0xcaa7('0x3d')]=qs[_0xcaa7('0x3e')](_[_0xcaa7('0x3f')](_0x3b9cea[_0xcaa7('0x32')],_0x27cfd0['filters']),_0x3b2c4c);if(_0x3b9cea[_0xcaa7('0x32')][_0xcaa7('0x40')]){_0x19d02c[_0xcaa7('0x3d')]=_['merge'](_0x19d02c[_0xcaa7('0x3d')],{'$or':_[_0xcaa7('0x2d')](_0x3b2c4c,function(_0x320b46){if(_0x320b46[_0xcaa7('0x30')]!=='VIRTUAL'){var _0x3b7884={};_0x3b7884[_0x320b46['name']]={'$like':'%'+_0x3b9cea[_0xcaa7('0x32')]['filter']+'%'};return _0x3b7884;}})});}_0x19d02c=_[_0xcaa7('0x41')]({},_0x19d02c,_0x3b9cea['options']);var _0x4b03de={'where':_0x19d02c[_0xcaa7('0x3d')]};return db[_0xcaa7('0x42')]['count'](_0x4b03de)[_0xcaa7('0x24')](function(_0xce58ab){_0x24b192[_0xcaa7('0x1d')]=_0xce58ab;if(_0x3b9cea[_0xcaa7('0x32')][_0xcaa7('0x43')]){_0x19d02c[_0xcaa7('0x44')]=[{'all':!![]}];}return db[_0xcaa7('0x42')][_0xcaa7('0x45')](_0x19d02c);})['then'](function(_0x23aa22){_0x24b192[_0xcaa7('0x46')]=_0x23aa22;return _0x24b192;})[_0xcaa7('0x24')](respondWithFilteredResult(_0x492843,_0x19d02c))[_0xcaa7('0x47')](handleError(_0x492843,null));};exports[_0xcaa7('0x48')]=function(_0x3d6c26,_0x571bf8){var _0xe39729={'raw':!![],'where':{'id':_0x3d6c26[_0xcaa7('0x49')]['id']}},_0x3da46d={};_0x3da46d[_0xcaa7('0x35')]=_[_0xcaa7('0x33')](db['Tag'][_0xcaa7('0x2e')]);_0x3da46d[_0xcaa7('0x32')]=_[_0xcaa7('0x33')](_0x3d6c26['query']);_0x3da46d[_0xcaa7('0x3e')]=_['intersection'](_0x3da46d[_0xcaa7('0x35')],_0x3da46d[_0xcaa7('0x32')]);_0xe39729[_0xcaa7('0x36')]=_[_0xcaa7('0x34')](_0x3da46d[_0xcaa7('0x35')],qs[_0xcaa7('0x37')](_0x3d6c26[_0xcaa7('0x32')]['fields']));_0xe39729['attributes']=_0xe39729[_0xcaa7('0x36')]['length']?_0xe39729[_0xcaa7('0x36')]:_0x3da46d['model'];if(_0x3d6c26[_0xcaa7('0x32')]['includeAll']){_0xe39729[_0xcaa7('0x44')]=[{'all':!![]}];}_0xe39729=_[_0xcaa7('0x41')]({},_0xe39729,_0x3d6c26[_0xcaa7('0x4a')]);return db[_0xcaa7('0x42')][_0xcaa7('0x4b')](_0xe39729)[_0xcaa7('0x24')](handleEntityNotFound(_0x571bf8,null))['then'](respondWithResult(_0x571bf8,null))['catch'](handleError(_0x571bf8,null));};exports[_0xcaa7('0x4c')]=function(_0x3a5f1f,_0x4f162c){return db[_0xcaa7('0x42')][_0xcaa7('0x4c')](_0x3a5f1f[_0xcaa7('0x4d')],{})[_0xcaa7('0x24')](function(_0x14da9e){var _0x2ca644=_0x3a5f1f[_0xcaa7('0x4e')][_0xcaa7('0x26')]({'plain':!![]});if(!_0x2ca644)throw new Error(_0xcaa7('0x4f'));if(_0x2ca644[_0xcaa7('0x50')]===_0xcaa7('0x4e')){var _0x3cc7ae=_0x14da9e[_0xcaa7('0x26')]({'plain':!![]});var _0x3e77a9=_0xcaa7('0x27');return db[_0xcaa7('0x51')]['find']({'where':{'name':_0x3e77a9,'userProfileId':_0x2ca644[_0xcaa7('0x52')]},'raw':!![]})['then'](function(_0x3e1828){if(_0x3e1828&&_0x3e1828[_0xcaa7('0x53')]===0x0){return db[_0xcaa7('0x54')][_0xcaa7('0x4c')]({'name':_0x3cc7ae[_0xcaa7('0x2a')],'resourceId':_0x3cc7ae['id'],'type':_0x3e1828[_0xcaa7('0x2a')],'sectionId':_0x3e1828['id']},{})[_0xcaa7('0x24')](function(){return _0x14da9e;});}else{return _0x14da9e;}})[_0xcaa7('0x47')](function(_0x8a27a7){logger[_0xcaa7('0x28')](_0xcaa7('0x55'),_0x8a27a7);throw _0x8a27a7;});}return _0x14da9e;})['then'](respondWithResult(_0x4f162c,0xc9))[_0xcaa7('0x47')](handleError(_0x4f162c,null));};exports[_0xcaa7('0x23')]=function(_0x467fb5,_0x50e918){if(_0x467fb5[_0xcaa7('0x4d')]['id']){delete _0x467fb5['body']['id'];}return db[_0xcaa7('0x42')][_0xcaa7('0x4b')]({'where':{'id':_0x467fb5[_0xcaa7('0x49')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x50e918,null))['then'](saveUpdates(_0x467fb5[_0xcaa7('0x4d')],null))[_0xcaa7('0x24')](respondWithResult(_0x50e918,null))[_0xcaa7('0x47')](handleError(_0x50e918,null));};exports[_0xcaa7('0x25')]=function(_0x1300c3,_0x2d219a){return db[_0xcaa7('0x42')][_0xcaa7('0x4b')]({'where':{'id':_0x1300c3['params']['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x2d219a,null))[_0xcaa7('0x24')](removeEntity(_0x2d219a,null))[_0xcaa7('0x47')](handleError(_0x2d219a,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index cd02b63..324615e 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 _0x3930=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','util','api'];(function(_0x353abb,_0x194c80){var _0x43c9c5=function(_0x456b74){while(--_0x456b74){_0x353abb['push'](_0x353abb['shift']());}};_0x43c9c5(++_0x194c80);}(_0x3930,0x148));var _0x0393=function(_0x3ce571,_0x52e126){_0x3ce571=_0x3ce571-0x0;var _0xcef624=_0x3930[_0x3ce571];return _0xcef624;};'use strict';var _=require('lodash');var util=require(_0x0393('0x0'));var logger=require('../../config/logger')(_0x0393('0x1'));var moment=require(_0x0393('0x2'));var BPromise=require(_0x0393('0x3'));var rp=require(_0x0393('0x4'));var fs=require('fs');var path=require(_0x0393('0x5'));var rimraf=require(_0x0393('0x6'));var config=require(_0x0393('0x7'));var attributes=require(_0x0393('0x8'));module[_0x0393('0x9')]=function(_0x28d4a1,_0x47008e){return _0x28d4a1['define']('Tag',attributes,{'tableName':_0x0393('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe142=['../../config/environment','exports','define','Tag','tools_tags','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x172725,_0x5bd46d){var _0x531ad1=function(_0x257821){while(--_0x257821){_0x172725['push'](_0x172725['shift']());}};_0x531ad1(++_0x5bd46d);}(_0xe142,0xaa));var _0x2e14=function(_0x4b5368,_0x1e62bc){_0x4b5368=_0x4b5368-0x0;var _0x36da89=_0xe142[_0x4b5368];return _0x36da89;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e14('0x0'))('api');var moment=require(_0x2e14('0x1'));var BPromise=require(_0x2e14('0x2'));var rp=require(_0x2e14('0x3'));var fs=require('fs');var path=require(_0x2e14('0x4'));var rimraf=require(_0x2e14('0x5'));var config=require(_0x2e14('0x6'));var attributes=require('./tag.attributes');module[_0x2e14('0x7')]=function(_0x33e99b,_0x1bfd45){return _0x33e99b[_0x2e14('0x8')](_0x2e14('0x9'),attributes,{'tableName':_0x2e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 9797375..a4871af 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 _0x50a6=['../../config/environment','http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x14b736,_0x3ff6e5){var _0x149636=function(_0x309679){while(--_0x309679){_0x14b736['push'](_0x14b736['shift']());}};_0x149636(++_0x3ff6e5);}(_0x50a6,0xa4));var _0x650a=function(_0x3ee952,_0x565e0f){_0x3ee952=_0x3ee952-0x0;var _0xc0c8b1=_0x50a6[_0x3ee952];return _0xc0c8b1;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Tag,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Tag,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});} \ No newline at end of file +var _0xf8b2=['code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x4cf414,_0x47ee95){var _0x376c45=function(_0x342ee7){while(--_0x342ee7){_0x4cf414['push'](_0x4cf414['shift']());}};_0x376c45(++_0x47ee95);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x6e29c6,_0x4fbf79){_0x6e29c6=_0x6e29c6-0x0;var _0xcae3b6=_0xf8b2[_0x6e29c6];return _0xcae3b6;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('Tag,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('Tag,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c9561c2..69ab0cc 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 6fa2852..2b684b1 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 _0x0713=['STRING','name'];(function(_0x1bed11,_0x32a62e){var _0x4c324d=function(_0x26dfc0){while(--_0x26dfc0){_0x1bed11['push'](_0x1bed11['shift']());}};_0x4c324d(++_0x32a62e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb7e7[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 13cd193..6545d6e 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 _0xb082=['voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Sms','Fax','sequelize','parse','Queue:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./team.socket','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','destroy','then','get','UserProfileResource','name','index','Team','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','catch','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','pick','Queues','addQueues','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online'];(function(_0x5449c0,_0x335921){var _0x41ebe5=function(_0x1a21ff){while(--_0x1a21ff){_0x5449c0['push'](_0x5449c0['shift']());}};_0x41ebe5(++_0x335921);}(_0xb082,0x110));var _0x2b08=function(_0x221ff4,_0x248b8e){_0x221ff4=_0x221ff4-0x0;var _0x1ac098=_0xb082[_0x221ff4];return _0x1ac098;};'use strict';var emlformat=require(_0x2b08('0x0'));var rimraf=require(_0x2b08('0x1'));var zipdir=require(_0x2b08('0x2'));var jsonpatch=require(_0x2b08('0x3'));var rp=require(_0x2b08('0x4'));var moment=require(_0x2b08('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2b08('0x6'));var util=require(_0x2b08('0x7'));var path=require(_0x2b08('0x8'));var sox=require('sox');var csv=require(_0x2b08('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2b08('0xa'));var crypto=require(_0x2b08('0xb'));var jsforce=require(_0x2b08('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2b08('0x9'));var querystring=require('querystring');var Papa=require(_0x2b08('0xd'));var Redis=require('ioredis');var authService=require(_0x2b08('0xe'));var qs=require(_0x2b08('0xf'));var as=require(_0x2b08('0x10'));var hardwareService=require(_0x2b08('0x11'));var logger=require(_0x2b08('0x12'))('api');var utils=require(_0x2b08('0x13'));var config=require(_0x2b08('0x14'));var licenseUtil=require(_0x2b08('0x15'));var db=require(_0x2b08('0x16'))['db'];config[_0x2b08('0x17')]=_[_0x2b08('0x18')](config[_0x2b08('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2b08('0x19'))['register'](socket);function respondWithStatusCode(_0xaa1192,_0x918176){_0x918176=_0x918176||0xcc;return function(_0x28c1fd){if(_0x28c1fd){return _0xaa1192[_0x2b08('0x1a')](_0x918176);}return _0xaa1192[_0x2b08('0x1b')](_0x918176)[_0x2b08('0x1c')]();};}function respondWithResult(_0x44e3cc,_0x106360){_0x106360=_0x106360||0xc8;return function(_0xf95b27){if(_0xf95b27){return _0x44e3cc[_0x2b08('0x1b')](_0x106360)['json'](_0xf95b27);}};}function respondWithFilteredResult(_0x1e7e4f,_0x16a5c9){return function(_0x3ec8f1){if(_0x3ec8f1){var _0x320e56=typeof _0x16a5c9['offset']==='undefined'&&typeof _0x16a5c9[_0x2b08('0x1d')]===_0x2b08('0x1e');var _0x48de29=_0x3ec8f1['count'];var _0x4c3a67=_0x320e56?0x0:_0x16a5c9[_0x2b08('0x1f')];var _0x319b9b=_0x320e56?_0x3ec8f1[_0x2b08('0x20')]:_0x16a5c9[_0x2b08('0x1f')]+_0x16a5c9[_0x2b08('0x1d')];var _0x22c673;if(_0x319b9b>=_0x48de29){_0x319b9b=_0x48de29;_0x22c673=0xc8;}else{_0x22c673=0xce;}_0x1e7e4f[_0x2b08('0x1b')](_0x22c673);return _0x1e7e4f[_0x2b08('0x21')](_0x2b08('0x22'),_0x4c3a67+'-'+_0x319b9b+'/'+_0x48de29)[_0x2b08('0x23')](_0x3ec8f1);}return null;};}function patchUpdates(_0x581088){return function(_0x3e5697){try{jsonpatch[_0x2b08('0x24')](_0x3e5697,_0x581088,!![]);}catch(_0x4a1036){return BPromise[_0x2b08('0x25')](_0x4a1036);}return _0x3e5697['save']();};}function saveUpdates(_0x403544,_0xbceba4){return function(_0x185d6b){if(_0x185d6b){return _0x185d6b['update'](_0x403544)['then'](function(_0x21d256){return _0x21d256;});}return null;};}function removeEntity(_0x3bc82c,_0x2bf0a7){return function(_0x1c38c5){if(_0x1c38c5){return _0x1c38c5[_0x2b08('0x26')]()[_0x2b08('0x27')](function(){var _0x3e1fd7=_0x1c38c5[_0x2b08('0x28')]({'plain':!![]});var _0x1e1f81='Teams';return db[_0x2b08('0x29')]['destroy']({'where':{'type':_0x1e1f81,'resourceId':_0x3e1fd7['id']}})[_0x2b08('0x27')](function(){return _0x1c38c5;});})[_0x2b08('0x27')](function(){_0x3bc82c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55561b,_0x5db3b4){return function(_0x4f686e){if(!_0x4f686e){_0x55561b['sendStatus'](0x194);}return _0x4f686e;};}function handleError(_0x274408,_0x2cf226){_0x2cf226=_0x2cf226||0x1f4;return function(_0x419733){logger['error'](_0x419733['stack']);if(_0x419733[_0x2b08('0x2a')]){delete _0x419733[_0x2b08('0x2a')];}_0x274408[_0x2b08('0x1b')](_0x2cf226)['send'](_0x419733);};}exports[_0x2b08('0x2b')]=function(_0x53dae0,_0x16bfb3){var _0x16a478={},_0xe69fd1={},_0x1792a8={'count':0x0,'rows':[]};var _0x1d0f49=_['map'](db[_0x2b08('0x2c')][_0x2b08('0x2d')],function(_0x7b5e0a){return{'name':_0x7b5e0a['fieldName'],'type':_0x7b5e0a[_0x2b08('0x2e')][_0x2b08('0x2f')]};});_0xe69fd1[_0x2b08('0x30')]=_[_0x2b08('0x31')](_0x1d0f49,_0x2b08('0x2a'));_0xe69fd1['query']=_['keys'](_0x53dae0[_0x2b08('0x32')]);_0xe69fd1[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0xe69fd1['model'],_0xe69fd1[_0x2b08('0x32')]);_0x16a478[_0x2b08('0x35')]=_[_0x2b08('0x34')](_0xe69fd1[_0x2b08('0x30')],qs[_0x2b08('0x36')](_0x53dae0['query']['fields']));_0x16a478[_0x2b08('0x35')]=_0x16a478[_0x2b08('0x35')][_0x2b08('0x37')]?_0x16a478['attributes']:_0xe69fd1[_0x2b08('0x30')];if(!_0x53dae0[_0x2b08('0x32')][_0x2b08('0x38')]('nolimit')){_0x16a478[_0x2b08('0x1d')]=qs[_0x2b08('0x1d')](_0x53dae0[_0x2b08('0x32')][_0x2b08('0x1d')]);_0x16a478[_0x2b08('0x1f')]=qs[_0x2b08('0x1f')](_0x53dae0[_0x2b08('0x32')][_0x2b08('0x1f')]);}_0x16a478['order']=qs[_0x2b08('0x39')](_0x53dae0['query'][_0x2b08('0x39')]);_0x16a478[_0x2b08('0x3a')]=qs[_0x2b08('0x33')](_['pick'](_0x53dae0['query'],_0xe69fd1[_0x2b08('0x33')]),_0x1d0f49);if(_0x53dae0[_0x2b08('0x32')][_0x2b08('0x3b')]){_0x16a478[_0x2b08('0x3a')]=_[_0x2b08('0x3c')](_0x16a478[_0x2b08('0x3a')],{'$or':_[_0x2b08('0x31')](_0x1d0f49,function(_0xa05884){if(_0xa05884[_0x2b08('0x2e')]!==_0x2b08('0x3d')){var _0x364a5e={};_0x364a5e[_0xa05884[_0x2b08('0x2a')]]={'$like':'%'+_0x53dae0[_0x2b08('0x32')][_0x2b08('0x3b')]+'%'};return _0x364a5e;}})});}_0x16a478=_['merge']({},_0x16a478,_0x53dae0['options']);var _0x4e150c={'where':_0x16a478[_0x2b08('0x3a')]};return db[_0x2b08('0x2c')][_0x2b08('0x20')](_0x4e150c)[_0x2b08('0x27')](function(_0x1524f5){_0x1792a8['count']=_0x1524f5;if(_0x53dae0['query'][_0x2b08('0x3e')]){_0x16a478[_0x2b08('0x3f')]=[{'all':!![]}];}return db[_0x2b08('0x2c')][_0x2b08('0x40')](_0x16a478);})['then'](function(_0x1b7360){_0x1792a8[_0x2b08('0x41')]=_0x1b7360;return _0x1792a8;})[_0x2b08('0x27')](respondWithFilteredResult(_0x16bfb3,_0x16a478))['catch'](handleError(_0x16bfb3,null));};exports['show']=function(_0x5284a7,_0x44bf38){var _0x14adcf={'raw':![],'where':{'id':_0x5284a7[_0x2b08('0x42')]['id']}},_0x5bc668={};_0x5bc668[_0x2b08('0x30')]=_[_0x2b08('0x43')](db[_0x2b08('0x2c')]['rawAttributes']);_0x5bc668[_0x2b08('0x32')]=_[_0x2b08('0x43')](_0x5284a7[_0x2b08('0x32')]);_0x5bc668[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0x5bc668['model'],_0x5bc668['query']);_0x14adcf['attributes']=_[_0x2b08('0x34')](_0x5bc668[_0x2b08('0x30')],qs['fields'](_0x5284a7['query'][_0x2b08('0x36')]));_0x14adcf[_0x2b08('0x35')]=_0x14adcf['attributes'][_0x2b08('0x37')]?_0x14adcf[_0x2b08('0x35')]:_0x5bc668[_0x2b08('0x30')];if(_0x5284a7['query'][_0x2b08('0x3e')]){_0x14adcf[_0x2b08('0x3f')]=[{'all':!![]}];}_0x14adcf=_['merge']({},_0x14adcf,_0x5284a7[_0x2b08('0x44')]);return db[_0x2b08('0x2c')]['find'](_0x14adcf)[_0x2b08('0x27')](handleEntityNotFound(_0x44bf38,null))[_0x2b08('0x27')](respondWithResult(_0x44bf38,null))[_0x2b08('0x45')](handleError(_0x44bf38,null));};exports[_0x2b08('0x46')]=function(_0x6c9ff,_0x5d5ced){return db[_0x2b08('0x2c')][_0x2b08('0x46')](_0x6c9ff[_0x2b08('0x47')],{})[_0x2b08('0x27')](function(_0x4cc70f){var _0x9fc484=_0x6c9ff[_0x2b08('0x48')][_0x2b08('0x28')]({'plain':!![]});if(!_0x9fc484)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9fc484[_0x2b08('0x49')]===_0x2b08('0x48')){var _0x1982f0=_0x4cc70f[_0x2b08('0x28')]({'plain':!![]});var _0x5dc561='Teams';return db[_0x2b08('0x4a')]['find']({'where':{'name':_0x5dc561,'userProfileId':_0x9fc484['userProfileId']},'raw':!![]})['then'](function(_0x576612){if(_0x576612&&_0x576612[_0x2b08('0x4b')]===0x0){return db['UserProfileResource'][_0x2b08('0x46')]({'name':_0x1982f0['name'],'resourceId':_0x1982f0['id'],'type':_0x576612[_0x2b08('0x2a')],'sectionId':_0x576612['id']},{})['then'](function(){return _0x4cc70f;});}else{return _0x4cc70f;}})['catch'](function(_0xd00b60){logger[_0x2b08('0x4c')](_0x2b08('0x4d'),_0xd00b60);throw _0xd00b60;});}return _0x4cc70f;})[_0x2b08('0x27')](respondWithResult(_0x5d5ced,0xc9))[_0x2b08('0x45')](handleError(_0x5d5ced,null));};exports['update']=function(_0x45d47b,_0x50768d){if(_0x45d47b[_0x2b08('0x47')]['id']){delete _0x45d47b[_0x2b08('0x47')]['id'];}return db[_0x2b08('0x2c')][_0x2b08('0x4e')]({'where':{'id':_0x45d47b[_0x2b08('0x42')]['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x50768d,null))['then'](saveUpdates(_0x45d47b[_0x2b08('0x47')],null))[_0x2b08('0x27')](respondWithResult(_0x50768d,null))['catch'](handleError(_0x50768d,null));};exports[_0x2b08('0x26')]=function(_0x231174,_0x261ede){return db[_0x2b08('0x2c')][_0x2b08('0x4e')]({'where':{'id':_0x231174[_0x2b08('0x42')]['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x261ede,null))['then'](removeEntity(_0x261ede,null))['catch'](handleError(_0x261ede,null));};exports[_0x2b08('0x4f')]=function(_0x3882b8,_0x1f0a94,_0x58e3b8){return db['Team'][_0x2b08('0x50')]({'where':{'id':_0x3882b8[_0x2b08('0x42')]['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x1f0a94,null))[_0x2b08('0x27')](function(_0x9d3587){if(!_0x3882b8[_0x2b08('0x32')][_0x2b08('0x51')]||!utils[_0x2b08('0x52')](_0x3882b8[_0x2b08('0x32')]['channel'])){throw new db[(_0x2b08('0x53'))][(_0x2b08('0x54'))](_0x2b08('0x55'));}var _0x4b9834={};var _0x56adca={};_0x56adca['model']=_[_0x2b08('0x43')](db[_[_0x2b08('0x56')](_0x3882b8[_0x2b08('0x32')][_0x2b08('0x51')][_0x2b08('0x57')]())+_0x2b08('0x58')]['rawAttributes']);_0x56adca[_0x2b08('0x32')]=_[_0x2b08('0x43')](_0x3882b8[_0x2b08('0x32')]);_0x56adca[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0x56adca[_0x2b08('0x30')],_0x56adca['query']);_0x4b9834[_0x2b08('0x35')]=_['intersection'](_0x56adca[_0x2b08('0x30')],qs[_0x2b08('0x36')](_0x3882b8[_0x2b08('0x32')][_0x2b08('0x36')]));_0x4b9834[_0x2b08('0x35')]=_0x4b9834[_0x2b08('0x35')][_0x2b08('0x37')]?_0x4b9834[_0x2b08('0x35')]:_0x56adca['model'];_0x4b9834[_0x2b08('0x1d')]=qs['limit'](_0x3882b8[_0x2b08('0x32')]['limit']);_0x4b9834[_0x2b08('0x1f')]=qs['offset'](_0x3882b8[_0x2b08('0x32')]['offset']);_0x4b9834[_0x2b08('0x59')]=qs[_0x2b08('0x39')](_0x3882b8[_0x2b08('0x32')][_0x2b08('0x39')]);_0x4b9834[_0x2b08('0x3a')]=qs['filters'](_[_0x2b08('0x5a')](_0x3882b8[_0x2b08('0x32')],_0x56adca[_0x2b08('0x33')]));_0x4b9834=_['merge']({},_0x4b9834,_0x3882b8[_0x2b08('0x44')]);return _0x9d3587['get'+_[_0x2b08('0x56')](_0x3882b8[_0x2b08('0x32')][_0x2b08('0x51')][_0x2b08('0x57')]())+_0x2b08('0x5b')](_0x4b9834);})[_0x2b08('0x27')](respondWithResult(_0x1f0a94,null))['catch'](handleError(_0x1f0a94,null));};exports[_0x2b08('0x5c')]=function(_0x3a00b3,_0x201194,_0x1aaba8){return db[_0x2b08('0x2c')][_0x2b08('0x50')]({'where':{'id':_0x3a00b3[_0x2b08('0x42')]['id']}})[_0x2b08('0x27')](function(_0x8a5b58){if(_0x8a5b58){if(!_0x3a00b3[_0x2b08('0x47')][_0x2b08('0x51')]||!utils[_0x2b08('0x52')](_0x3a00b3[_0x2b08('0x47')][_0x2b08('0x51')])){throw new db[(_0x2b08('0x53'))][(_0x2b08('0x54'))](_0x2b08('0x55'));}return _0x8a5b58[_0x2b08('0x5d')+_['capitalize'](_0x3a00b3[_0x2b08('0x47')][_0x2b08('0x51')][_0x2b08('0x57')]())+_0x2b08('0x5b')](_0x3a00b3[_0x2b08('0x47')][_0x2b08('0x5e')]);}return null;})[_0x2b08('0x27')](handleEntityNotFound(_0x201194,null))['then'](respondWithStatusCode(_0x201194,null))['catch'](handleError(_0x201194,null));};exports[_0x2b08('0x5f')]=function(_0x47a6e6,_0x6b0d89,_0x3779a1){return db[_0x2b08('0x2c')][_0x2b08('0x50')]({'where':{'id':_0x47a6e6[_0x2b08('0x42')]['id']}})['then'](function(_0x4ada6b){if(_0x4ada6b){if(!_0x47a6e6['query'][_0x2b08('0x51')]||!utils[_0x2b08('0x52')](_0x47a6e6[_0x2b08('0x32')][_0x2b08('0x51')])){throw new db[(_0x2b08('0x53'))][(_0x2b08('0x54'))](_0x2b08('0x55'));}return _0x4ada6b['remove'+_[_0x2b08('0x56')](_0x47a6e6[_0x2b08('0x32')][_0x2b08('0x51')][_0x2b08('0x57')]())+'Queues'](_0x47a6e6[_0x2b08('0x32')][_0x2b08('0x5e')]);}return null;})['then'](handleEntityNotFound(_0x6b0d89,null))[_0x2b08('0x27')](respondWithStatusCode(_0x6b0d89,null))[_0x2b08('0x45')](handleError(_0x6b0d89,null));};exports[_0x2b08('0x60')]=function(_0x1658a1,_0x504772){return db[_0x2b08('0x2c')][_0x2b08('0x4e')]({'where':{'id':_0x1658a1[_0x2b08('0x42')]['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x504772,null))[_0x2b08('0x27')](function(_0x37d4e1){if(_0x37d4e1){var _0x120984=[_0x2b08('0x61'),_0x2b08('0x62'),_0x2b08('0x63'),'Sms','Fax',_0x2b08('0x64'),_0x2b08('0x65')];return db['sequelize'][_0x2b08('0x66')](function(_0x194b94){var _0x15ffbf=_[_0x2b08('0x31')](_0x120984,function(_0x1e1be7){var _0x589e42={'attributes':['id',_0x2b08('0x2a')]};if(_0x1e1be7===_0x2b08('0x61')){_0x589e42[_0x2b08('0x67')]={'attributes':[_0x2b08('0x68')]};}return _0x37d4e1[_0x2b08('0x28')+_0x1e1be7+_0x2b08('0x5b')](_0x589e42)[_0x2b08('0x27')](function(_0x4d03dc){var _0x328f8f=_[_0x2b08('0x31')](_0x4d03dc,function(_0x578e60){var _0x59cd72=_[_0x2b08('0x31')](_0x1658a1[_0x2b08('0x47')][_0x2b08('0x5e')],function(_0x461355){var _0x5580c1={'where':{'UserId':_0x461355,[_0x1e1be7+_0x2b08('0x69')]:_0x578e60['id']},'transaction':_0x194b94};if(_0x1e1be7===_0x2b08('0x61')){_0x5580c1[_0x2b08('0x18')]={'penalty':_0x578e60[_0x2b08('0x6a')][_0x2b08('0x68')]};}return db[_0x2b08('0x6b')+_0x1e1be7+_0x2b08('0x58')][_0x2b08('0x6c')](_0x5580c1)[_0x2b08('0x27')](function(){socket[_0x2b08('0x6d')](_0x2b08('0x48')+_0x1e1be7+_0x2b08('0x6e'),{'UserId':_0x461355,[_0x1e1be7+_0x2b08('0x69')]:_0x578e60['id']});if(_0x1e1be7!==_0x2b08('0x61'))return;return db['User'][_0x2b08('0x40')]({'where':{'id':_0x1658a1[_0x2b08('0x47')][_0x2b08('0x5e')],'online':0x1},'attributes':['id',_0x2b08('0x2a'),_0x2b08('0x6f'),_0x2b08('0x70'),_0x2b08('0x71')],'raw':!![]})['then'](function(_0x503544){var _0x371c03=_[_0x2b08('0x31')](_0x503544,function(_0x2acfc6){return db[_0x2b08('0x72')][_0x2b08('0x73')]({'membername':_0x2acfc6[_0x2b08('0x2a')],'UserId':_0x2acfc6['id'],'queue_name':_0x578e60[_0x2b08('0x2a')],'VoiceQueueId':_0x578e60['id'],'interface':_[_0x2b08('0x74')](_0x2acfc6[_0x2b08('0x71')])?util[_0x2b08('0x75')](_0x2b08('0x76'),_0x2acfc6['name']):_0x2acfc6['interface'],'paused':_0x2acfc6['voicePause']||![],'penalty':_0x578e60['TeamVoiceQueue'][_0x2b08('0x68')]},{'transaction':_0x194b94});});return Promise['all'](_0x371c03);});});});return Promise[_0x2b08('0x77')](_0x59cd72);});return Promise[_0x2b08('0x77')](_0x328f8f);});});return Promise[_0x2b08('0x77')](_0x15ffbf)['then'](function(){return _0x37d4e1['addAgents'](_0x1658a1[_0x2b08('0x47')][_0x2b08('0x5e')],{'transaction':_0x194b94})['spread'](function(_0x4b6e35){return _0x4b6e35;});});});}})[_0x2b08('0x27')](respondWithResult(_0x504772,null))[_0x2b08('0x45')](handleError(_0x504772,null));};exports[_0x2b08('0x78')]=function(_0x29227b,_0x3227ff){return db['Team'][_0x2b08('0x4e')]({'where':{'id':_0x29227b['params']['id']}})['then'](handleEntityNotFound(_0x3227ff,null))[_0x2b08('0x27')](function(_0x1e0392){if(_0x1e0392){var _0xae3b6d=[_0x2b08('0x61'),_0x2b08('0x62'),'Mail',_0x2b08('0x79'),_0x2b08('0x7a'),_0x2b08('0x64'),_0x2b08('0x65')];return db[_0x2b08('0x7b')]['transaction'](function(_0x5ecb7e){var _0x1f66b6=_[_0x2b08('0x31')](_0xae3b6d,function(_0x5c86a9){var _0x3f4835={'attributes':['id',_0x2b08('0x2a')]};return _0x1e0392['get'+_0x5c86a9+_0x2b08('0x5b')](_0x3f4835)['then'](function(_0x23c574){var _0x23056e=_[_0x2b08('0x31')](_0x23c574,function(_0x1f1dbb){return _0x1f1dbb['removeAgents'](_0x29227b[_0x2b08('0x32')][_0x2b08('0x5e')],{'transaction':_0x5ecb7e})[_0x2b08('0x27')](function(){var _0x5a48fb=JSON[_0x2b08('0x7c')]('['+_0x29227b[_0x2b08('0x32')][_0x2b08('0x5e')]+']');var _0x3c1143=_[_0x2b08('0x31')](_0x5a48fb,function(_0x3ba500){socket[_0x2b08('0x6d')](_0x2b08('0x48')+_0x5c86a9+_0x2b08('0x7d'),{'UserId':Number(_0x3ba500),[_0x5c86a9+_0x2b08('0x69')]:_0x1f1dbb['id']});if(_0x5c86a9!==_0x2b08('0x61'))return;return db['UserVoiceQueueRt'][_0x2b08('0x26')]({'where':{'VoiceQueueId':_0x1f1dbb['id'],'UserId':_0x3ba500},'transaction':_0x5ecb7e});});return Promise[_0x2b08('0x77')](_0x3c1143);});});return Promise[_0x2b08('0x77')](_0x23056e);});});return Promise[_0x2b08('0x77')](_0x1f66b6)[_0x2b08('0x27')](function(){return _0x1e0392[_0x2b08('0x78')](_0x29227b[_0x2b08('0x32')]['ids'],{'transaction':_0x5ecb7e});});});}})[_0x2b08('0x27')](respondWithStatusCode(_0x3227ff,null))['catch'](handleError(_0x3227ff,null));};exports[_0x2b08('0x7e')]=function(_0x3019e4,_0x482e4c,_0x28969f){var _0x19e1a3={};var _0x575c9f={};var _0x2f4035;var _0x2184b9;return db[_0x2b08('0x2c')][_0x2b08('0x50')]({'where':{'id':_0x3019e4['params']['id']}})[_0x2b08('0x27')](handleEntityNotFound(_0x482e4c,null))[_0x2b08('0x27')](function(_0x4f62d4){if(_0x4f62d4){_0x2f4035=_0x4f62d4;_0x575c9f[_0x2b08('0x30')]=_['keys'](db[_0x2b08('0x6b')][_0x2b08('0x2d')]);_0x575c9f[_0x2b08('0x32')]=_[_0x2b08('0x43')](_0x3019e4[_0x2b08('0x32')]);_0x575c9f[_0x2b08('0x33')]=_[_0x2b08('0x34')](_0x575c9f[_0x2b08('0x30')],_0x575c9f[_0x2b08('0x32')]);_0x19e1a3[_0x2b08('0x35')]=_['intersection'](_0x575c9f[_0x2b08('0x30')],qs[_0x2b08('0x36')](_0x3019e4[_0x2b08('0x32')][_0x2b08('0x36')]));_0x19e1a3[_0x2b08('0x35')]=_0x19e1a3[_0x2b08('0x35')][_0x2b08('0x37')]?_0x19e1a3[_0x2b08('0x35')]:_0x575c9f[_0x2b08('0x30')];_0x19e1a3[_0x2b08('0x59')]=qs[_0x2b08('0x39')](_0x3019e4[_0x2b08('0x32')][_0x2b08('0x39')]);_0x19e1a3['where']=qs[_0x2b08('0x33')](_['pick'](_0x3019e4[_0x2b08('0x32')],_0x575c9f[_0x2b08('0x33')]));if(_0x3019e4[_0x2b08('0x32')][_0x2b08('0x3b')]){_0x19e1a3[_0x2b08('0x3a')]=_[_0x2b08('0x3c')](_0x19e1a3['where'],{'$or':_['map'](_0x19e1a3[_0x2b08('0x35')],function(_0x32b418){var _0x5b3b19={};_0x5b3b19[_0x32b418]={'$like':'%'+_0x3019e4['query'][_0x2b08('0x3b')]+'%'};return _0x5b3b19;})});}_0x19e1a3=_[_0x2b08('0x3c')]({},_0x19e1a3,_0x3019e4[_0x2b08('0x44')]);return _0x2f4035[_0x2b08('0x7e')](_0x19e1a3);}})[_0x2b08('0x27')](function(_0x123f2d){if(_0x123f2d){_0x2184b9=_0x123f2d[_0x2b08('0x37')];if(!_0x3019e4[_0x2b08('0x32')]['hasOwnProperty'](_0x2b08('0x7f'))){_0x19e1a3['limit']=qs[_0x2b08('0x1d')](_0x3019e4[_0x2b08('0x32')][_0x2b08('0x1d')]);_0x19e1a3[_0x2b08('0x1f')]=qs[_0x2b08('0x1f')](_0x3019e4['query'][_0x2b08('0x1f')]);}return _0x2f4035[_0x2b08('0x7e')](_0x19e1a3);}})[_0x2b08('0x27')](function(_0x4f37bc){if(_0x4f37bc){return _0x4f37bc?{'count':_0x2184b9,'rows':_0x4f37bc}:null;}})[_0x2b08('0x27')](respondWithResult(_0x482e4c,null))[_0x2b08('0x45')](handleError(_0x482e4c,null));}; \ No newline at end of file +var _0x1b7b=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','UserProfileResource','destroy','error','send','index','Team','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','include','catch','show','params','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','order','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Sms','Fax','Openchannel','through','penalty','QueueId','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','TeamVoiceQueue','all','spread','Chat','Mail','Whatsapp','sequelize','transaction','parse','removeAgents','getAgents','hasOwnProperty'];(function(_0x52eb25,_0x2db05a){var _0x50d99d=function(_0x204dcc){while(--_0x204dcc){_0x52eb25['push'](_0x52eb25['shift']());}};_0x50d99d(++_0x2db05a);}(_0x1b7b,0x104));var _0xb1b7=function(_0x28ba91,_0xf43ba2){_0x28ba91=_0x28ba91-0x0;var _0x2f1262=_0x1b7b[_0x28ba91];return _0x2f1262;};'use strict';var emlformat=require(_0xb1b7('0x0'));var rimraf=require(_0xb1b7('0x1'));var zipdir=require(_0xb1b7('0x2'));var jsonpatch=require(_0xb1b7('0x3'));var rp=require('request-promise');var moment=require(_0xb1b7('0x4'));var BPromise=require(_0xb1b7('0x5'));var Mustache=require(_0xb1b7('0x6'));var util=require(_0xb1b7('0x7'));var path=require(_0xb1b7('0x8'));var sox=require('sox');var csv=require(_0xb1b7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1b7('0xa'));var _=require('lodash');var squel=require(_0xb1b7('0xb'));var crypto=require('crypto');var jsforce=require(_0xb1b7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb1b7('0xd'));var Papa=require('papaparse');var Redis=require(_0xb1b7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1b7('0xf'));var hardwareService=require(_0xb1b7('0x10'));var logger=require(_0xb1b7('0x11'))(_0xb1b7('0x12'));var utils=require(_0xb1b7('0x13'));var config=require(_0xb1b7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1b7('0x15'))['db'];config[_0xb1b7('0x16')]=_[_0xb1b7('0x17')](config['redis'],{'host':_0xb1b7('0x18'),'port':0x18eb});var socket=require(_0xb1b7('0x19'))(new Redis(config[_0xb1b7('0x16')]));require('./team.socket')[_0xb1b7('0x1a')](socket);function respondWithStatusCode(_0x1bc610,_0x1d66c3){_0x1d66c3=_0x1d66c3||0xcc;return function(_0x1a8359){if(_0x1a8359){return _0x1bc610[_0xb1b7('0x1b')](_0x1d66c3);}return _0x1bc610[_0xb1b7('0x1c')](_0x1d66c3)[_0xb1b7('0x1d')]();};}function respondWithResult(_0x5fcf0a,_0x15ddf2){_0x15ddf2=_0x15ddf2||0xc8;return function(_0x124598){if(_0x124598){return _0x5fcf0a[_0xb1b7('0x1c')](_0x15ddf2)[_0xb1b7('0x1e')](_0x124598);}};}function respondWithFilteredResult(_0x2a8bcc,_0x4761e3){return function(_0x27b30b){if(_0x27b30b){var _0x2d724b=typeof _0x4761e3[_0xb1b7('0x1f')]===_0xb1b7('0x20')&&typeof _0x4761e3[_0xb1b7('0x21')]===_0xb1b7('0x20');var _0x34bb2b=_0x27b30b[_0xb1b7('0x22')];var _0x21232a=_0x2d724b?0x0:_0x4761e3[_0xb1b7('0x1f')];var _0x4aa8c5=_0x2d724b?_0x27b30b[_0xb1b7('0x22')]:_0x4761e3[_0xb1b7('0x1f')]+_0x4761e3[_0xb1b7('0x21')];var _0x21943b;if(_0x4aa8c5>=_0x34bb2b){_0x4aa8c5=_0x34bb2b;_0x21943b=0xc8;}else{_0x21943b=0xce;}_0x2a8bcc[_0xb1b7('0x1c')](_0x21943b);return _0x2a8bcc[_0xb1b7('0x23')]('Content-Range',_0x21232a+'-'+_0x4aa8c5+'/'+_0x34bb2b)['json'](_0x27b30b);}return null;};}function patchUpdates(_0x263191){return function(_0xe85f31){try{jsonpatch[_0xb1b7('0x24')](_0xe85f31,_0x263191,!![]);}catch(_0x53b66c){return BPromise[_0xb1b7('0x25')](_0x53b66c);}return _0xe85f31[_0xb1b7('0x26')]();};}function saveUpdates(_0x3137e1,_0x34cc89){return function(_0xa06a99){if(_0xa06a99){return _0xa06a99[_0xb1b7('0x27')](_0x3137e1)[_0xb1b7('0x28')](function(_0x491aea){return _0x491aea;});}return null;};}function removeEntity(_0x11454c,_0x3d1bf5){return function(_0x171462){if(_0x171462){return _0x171462['destroy']()[_0xb1b7('0x28')](function(){var _0x252da3=_0x171462['get']({'plain':!![]});var _0x1fbcf6='Teams';return db[_0xb1b7('0x29')][_0xb1b7('0x2a')]({'where':{'type':_0x1fbcf6,'resourceId':_0x252da3['id']}})['then'](function(){return _0x171462;});})[_0xb1b7('0x28')](function(){_0x11454c[_0xb1b7('0x1c')](0xcc)[_0xb1b7('0x1d')]();});}};}function handleEntityNotFound(_0x560df9,_0xce3269){return function(_0x54c2c0){if(!_0x54c2c0){_0x560df9[_0xb1b7('0x1b')](0x194);}return _0x54c2c0;};}function handleError(_0x9281b1,_0x12fe8a){_0x12fe8a=_0x12fe8a||0x1f4;return function(_0x1d4980){logger[_0xb1b7('0x2b')](_0x1d4980['stack']);if(_0x1d4980['name']){delete _0x1d4980['name'];}_0x9281b1[_0xb1b7('0x1c')](_0x12fe8a)[_0xb1b7('0x2c')](_0x1d4980);};}exports[_0xb1b7('0x2d')]=function(_0x4c0a22,_0x41a65c){var _0x1d4dea={},_0x40668a={},_0x1a1886={'count':0x0,'rows':[]};var _0x46cbac=_['map'](db[_0xb1b7('0x2e')]['rawAttributes'],function(_0x494ab7){return{'name':_0x494ab7[_0xb1b7('0x2f')],'type':_0x494ab7[_0xb1b7('0x30')][_0xb1b7('0x31')]};});_0x40668a[_0xb1b7('0x32')]=_[_0xb1b7('0x33')](_0x46cbac,_0xb1b7('0x34'));_0x40668a[_0xb1b7('0x35')]=_[_0xb1b7('0x36')](_0x4c0a22[_0xb1b7('0x35')]);_0x40668a[_0xb1b7('0x37')]=_[_0xb1b7('0x38')](_0x40668a[_0xb1b7('0x32')],_0x40668a[_0xb1b7('0x35')]);_0x1d4dea[_0xb1b7('0x39')]=_[_0xb1b7('0x38')](_0x40668a['model'],qs['fields'](_0x4c0a22['query'][_0xb1b7('0x3a')]));_0x1d4dea[_0xb1b7('0x39')]=_0x1d4dea['attributes'][_0xb1b7('0x3b')]?_0x1d4dea[_0xb1b7('0x39')]:_0x40668a[_0xb1b7('0x32')];if(!_0x4c0a22[_0xb1b7('0x35')]['hasOwnProperty'](_0xb1b7('0x3c'))){_0x1d4dea[_0xb1b7('0x21')]=qs[_0xb1b7('0x21')](_0x4c0a22['query'][_0xb1b7('0x21')]);_0x1d4dea[_0xb1b7('0x1f')]=qs[_0xb1b7('0x1f')](_0x4c0a22[_0xb1b7('0x35')][_0xb1b7('0x1f')]);}_0x1d4dea['order']=qs[_0xb1b7('0x3d')](_0x4c0a22[_0xb1b7('0x35')]['sort']);_0x1d4dea[_0xb1b7('0x3e')]=qs[_0xb1b7('0x37')](_[_0xb1b7('0x3f')](_0x4c0a22['query'],_0x40668a[_0xb1b7('0x37')]),_0x46cbac);if(_0x4c0a22[_0xb1b7('0x35')]['filter']){_0x1d4dea[_0xb1b7('0x3e')]=_[_0xb1b7('0x40')](_0x1d4dea['where'],{'$or':_[_0xb1b7('0x33')](_0x46cbac,function(_0xcfd029){if(_0xcfd029['type']!=='VIRTUAL'){var _0xa8bb80={};_0xa8bb80[_0xcfd029[_0xb1b7('0x34')]]={'$like':'%'+_0x4c0a22[_0xb1b7('0x35')][_0xb1b7('0x41')]+'%'};return _0xa8bb80;}})});}_0x1d4dea=_[_0xb1b7('0x40')]({},_0x1d4dea,_0x4c0a22[_0xb1b7('0x42')]);var _0x4157c2={'where':_0x1d4dea[_0xb1b7('0x3e')]};return db['Team'][_0xb1b7('0x22')](_0x4157c2)[_0xb1b7('0x28')](function(_0x2ca75f){_0x1a1886[_0xb1b7('0x22')]=_0x2ca75f;if(_0x4c0a22[_0xb1b7('0x35')]['includeAll']){_0x1d4dea[_0xb1b7('0x43')]=[{'all':!![]}];}return db[_0xb1b7('0x2e')]['findAll'](_0x1d4dea);})[_0xb1b7('0x28')](function(_0xe62344){_0x1a1886['rows']=_0xe62344;return _0x1a1886;})[_0xb1b7('0x28')](respondWithFilteredResult(_0x41a65c,_0x1d4dea))[_0xb1b7('0x44')](handleError(_0x41a65c,null));};exports[_0xb1b7('0x45')]=function(_0x157751,_0x3dfad3){var _0x535096={'raw':![],'where':{'id':_0x157751[_0xb1b7('0x46')]['id']}},_0x121f94={};_0x121f94['model']=_[_0xb1b7('0x36')](db[_0xb1b7('0x2e')]['rawAttributes']);_0x121f94[_0xb1b7('0x35')]=_[_0xb1b7('0x36')](_0x157751['query']);_0x121f94['filters']=_[_0xb1b7('0x38')](_0x121f94['model'],_0x121f94[_0xb1b7('0x35')]);_0x535096[_0xb1b7('0x39')]=_[_0xb1b7('0x38')](_0x121f94[_0xb1b7('0x32')],qs['fields'](_0x157751[_0xb1b7('0x35')]['fields']));_0x535096[_0xb1b7('0x39')]=_0x535096[_0xb1b7('0x39')][_0xb1b7('0x3b')]?_0x535096[_0xb1b7('0x39')]:_0x121f94[_0xb1b7('0x32')];if(_0x157751['query'][_0xb1b7('0x47')]){_0x535096['include']=[{'all':!![]}];}_0x535096=_['merge']({},_0x535096,_0x157751['options']);return db[_0xb1b7('0x2e')]['find'](_0x535096)[_0xb1b7('0x28')](handleEntityNotFound(_0x3dfad3,null))['then'](respondWithResult(_0x3dfad3,null))[_0xb1b7('0x44')](handleError(_0x3dfad3,null));};exports['create']=function(_0x206fbd,_0x3ad104){return db['Team'][_0xb1b7('0x48')](_0x206fbd['body'],{})[_0xb1b7('0x28')](function(_0x528ee6){var _0x6b3b38=_0x206fbd[_0xb1b7('0x49')][_0xb1b7('0x4a')]({'plain':!![]});if(!_0x6b3b38)throw new Error(_0xb1b7('0x4b'));if(_0x6b3b38[_0xb1b7('0x4c')]===_0xb1b7('0x49')){var _0x37f8da=_0x528ee6[_0xb1b7('0x4a')]({'plain':!![]});var _0x59cf37=_0xb1b7('0x4d');return db[_0xb1b7('0x4e')][_0xb1b7('0x4f')]({'where':{'name':_0x59cf37,'userProfileId':_0x6b3b38['userProfileId']},'raw':!![]})[_0xb1b7('0x28')](function(_0x485c11){if(_0x485c11&&_0x485c11['autoAssociation']===0x0){return db[_0xb1b7('0x29')][_0xb1b7('0x48')]({'name':_0x37f8da[_0xb1b7('0x34')],'resourceId':_0x37f8da['id'],'type':_0x485c11[_0xb1b7('0x34')],'sectionId':_0x485c11['id']},{})['then'](function(){return _0x528ee6;});}else{return _0x528ee6;}})[_0xb1b7('0x44')](function(_0x5c5a69){logger[_0xb1b7('0x2b')](_0xb1b7('0x50'),_0x5c5a69);throw _0x5c5a69;});}return _0x528ee6;})[_0xb1b7('0x28')](respondWithResult(_0x3ad104,0xc9))[_0xb1b7('0x44')](handleError(_0x3ad104,null));};exports[_0xb1b7('0x27')]=function(_0x5a31f8,_0x2952eb){if(_0x5a31f8['body']['id']){delete _0x5a31f8[_0xb1b7('0x51')]['id'];}return db['Team'][_0xb1b7('0x4f')]({'where':{'id':_0x5a31f8[_0xb1b7('0x46')]['id']}})[_0xb1b7('0x28')](handleEntityNotFound(_0x2952eb,null))[_0xb1b7('0x28')](saveUpdates(_0x5a31f8[_0xb1b7('0x51')],null))[_0xb1b7('0x28')](respondWithResult(_0x2952eb,null))[_0xb1b7('0x44')](handleError(_0x2952eb,null));};exports[_0xb1b7('0x2a')]=function(_0x4c03ce,_0x377210){return db['Team'][_0xb1b7('0x4f')]({'where':{'id':_0x4c03ce[_0xb1b7('0x46')]['id']}})[_0xb1b7('0x28')](handleEntityNotFound(_0x377210,null))[_0xb1b7('0x28')](removeEntity(_0x377210,null))[_0xb1b7('0x44')](handleError(_0x377210,null));};exports[_0xb1b7('0x52')]=function(_0x562e76,_0x354de9,_0x21938c){return db['Team'][_0xb1b7('0x53')]({'where':{'id':_0x562e76[_0xb1b7('0x46')]['id']}})['then'](handleEntityNotFound(_0x354de9,null))[_0xb1b7('0x28')](function(_0x2b38db){if(!_0x562e76[_0xb1b7('0x35')][_0xb1b7('0x54')]||!utils[_0xb1b7('0x55')](_0x562e76[_0xb1b7('0x35')][_0xb1b7('0x54')])){throw new db[(_0xb1b7('0x56'))][(_0xb1b7('0x57'))](_0xb1b7('0x58'));}var _0x20acdd={};var _0x136070={};_0x136070[_0xb1b7('0x32')]=_['keys'](db[_[_0xb1b7('0x59')](_0x562e76[_0xb1b7('0x35')][_0xb1b7('0x54')][_0xb1b7('0x5a')]())+_0xb1b7('0x5b')][_0xb1b7('0x5c')]);_0x136070['query']=_[_0xb1b7('0x36')](_0x562e76[_0xb1b7('0x35')]);_0x136070[_0xb1b7('0x37')]=_['intersection'](_0x136070['model'],_0x136070[_0xb1b7('0x35')]);_0x20acdd[_0xb1b7('0x39')]=_['intersection'](_0x136070['model'],qs['fields'](_0x562e76[_0xb1b7('0x35')]['fields']));_0x20acdd[_0xb1b7('0x39')]=_0x20acdd[_0xb1b7('0x39')][_0xb1b7('0x3b')]?_0x20acdd['attributes']:_0x136070['model'];_0x20acdd[_0xb1b7('0x21')]=qs[_0xb1b7('0x21')](_0x562e76[_0xb1b7('0x35')][_0xb1b7('0x21')]);_0x20acdd[_0xb1b7('0x1f')]=qs['offset'](_0x562e76[_0xb1b7('0x35')]['offset']);_0x20acdd[_0xb1b7('0x5d')]=qs[_0xb1b7('0x3d')](_0x562e76[_0xb1b7('0x35')][_0xb1b7('0x3d')]);_0x20acdd[_0xb1b7('0x3e')]=qs[_0xb1b7('0x37')](_[_0xb1b7('0x3f')](_0x562e76[_0xb1b7('0x35')],_0x136070['filters']));_0x20acdd=_['merge']({},_0x20acdd,_0x562e76['options']);return _0x2b38db[_0xb1b7('0x4a')+_['capitalize'](_0x562e76['query'][_0xb1b7('0x54')][_0xb1b7('0x5a')]())+_0xb1b7('0x5e')](_0x20acdd);})['then'](respondWithResult(_0x354de9,null))['catch'](handleError(_0x354de9,null));};exports[_0xb1b7('0x5f')]=function(_0x18f110,_0xd5675f,_0xe45b97){return db[_0xb1b7('0x2e')][_0xb1b7('0x53')]({'where':{'id':_0x18f110[_0xb1b7('0x46')]['id']}})[_0xb1b7('0x28')](function(_0x4f3af2){if(_0x4f3af2){if(!_0x18f110[_0xb1b7('0x51')][_0xb1b7('0x54')]||!utils[_0xb1b7('0x55')](_0x18f110[_0xb1b7('0x51')][_0xb1b7('0x54')])){throw new db[(_0xb1b7('0x56'))]['ValidationError'](_0xb1b7('0x58'));}return _0x4f3af2[_0xb1b7('0x60')+_[_0xb1b7('0x59')](_0x18f110[_0xb1b7('0x51')][_0xb1b7('0x54')][_0xb1b7('0x5a')]())+_0xb1b7('0x5e')](_0x18f110['body'][_0xb1b7('0x61')]);}return null;})['then'](handleEntityNotFound(_0xd5675f,null))[_0xb1b7('0x28')](respondWithStatusCode(_0xd5675f,null))[_0xb1b7('0x44')](handleError(_0xd5675f,null));};exports[_0xb1b7('0x62')]=function(_0x515f4c,_0x4d0562,_0x4a6d87){return db[_0xb1b7('0x2e')][_0xb1b7('0x53')]({'where':{'id':_0x515f4c[_0xb1b7('0x46')]['id']}})['then'](function(_0x5eea3a){if(_0x5eea3a){if(!_0x515f4c[_0xb1b7('0x35')]['channel']||!utils[_0xb1b7('0x55')](_0x515f4c[_0xb1b7('0x35')][_0xb1b7('0x54')])){throw new db[(_0xb1b7('0x56'))][(_0xb1b7('0x57'))](_0xb1b7('0x58'));}return _0x5eea3a[_0xb1b7('0x63')+_['capitalize'](_0x515f4c[_0xb1b7('0x35')][_0xb1b7('0x54')]['toLowerCase']())+_0xb1b7('0x5e')](_0x515f4c['query'][_0xb1b7('0x61')]);}return null;})[_0xb1b7('0x28')](handleEntityNotFound(_0x4d0562,null))[_0xb1b7('0x28')](respondWithStatusCode(_0x4d0562,null))['catch'](handleError(_0x4d0562,null));};exports[_0xb1b7('0x64')]=function(_0x3fc8f0,_0x3ec5bc){return db[_0xb1b7('0x2e')][_0xb1b7('0x4f')]({'where':{'id':_0x3fc8f0['params']['id']}})[_0xb1b7('0x28')](handleEntityNotFound(_0x3ec5bc,null))[_0xb1b7('0x28')](function(_0x2623e3){if(_0x2623e3){var _0x57fcee=[_0xb1b7('0x65'),'Chat','Mail',_0xb1b7('0x66'),_0xb1b7('0x67'),_0xb1b7('0x68'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x4f6ecb){var _0x4ac098=_[_0xb1b7('0x33')](_0x57fcee,function(_0x4f2453){var _0x3d421f={'attributes':['id',_0xb1b7('0x34')]};if(_0x4f2453===_0xb1b7('0x65')){_0x3d421f[_0xb1b7('0x69')]={'attributes':[_0xb1b7('0x6a')]};}return _0x2623e3[_0xb1b7('0x4a')+_0x4f2453+'Queues'](_0x3d421f)[_0xb1b7('0x28')](function(_0x305cee){var _0x490125=_['map'](_0x305cee,function(_0x193cc5){var _0x59a79a=_[_0xb1b7('0x33')](_0x3fc8f0[_0xb1b7('0x51')][_0xb1b7('0x61')],function(_0x5a655e){var _0xdc1075={'where':{'UserId':_0x5a655e,[_0x4f2453+_0xb1b7('0x6b')]:_0x193cc5['id']},'transaction':_0x4f6ecb};if(_0x4f2453===_0xb1b7('0x65')){_0xdc1075[_0xb1b7('0x17')]={'penalty':_0x193cc5['TeamVoiceQueue'][_0xb1b7('0x6a')]};}return db[_0xb1b7('0x6c')+_0x4f2453+_0xb1b7('0x5b')]['findOrCreate'](_0xdc1075)[_0xb1b7('0x28')](function(){socket[_0xb1b7('0x6d')]('user'+_0x4f2453+_0xb1b7('0x6e'),{'UserId':_0x5a655e,[_0x4f2453+_0xb1b7('0x6b')]:_0x193cc5['id']});if(_0x4f2453!==_0xb1b7('0x65'))return;return db[_0xb1b7('0x6c')]['findAll']({'where':{'id':_0x3fc8f0[_0xb1b7('0x51')][_0xb1b7('0x61')],'online':0x1},'attributes':['id',_0xb1b7('0x34'),_0xb1b7('0x6f'),_0xb1b7('0x70'),_0xb1b7('0x71')],'raw':!![]})[_0xb1b7('0x28')](function(_0x4009e5){var _0x19246d=_[_0xb1b7('0x33')](_0x4009e5,function(_0x30b67f){return db[_0xb1b7('0x72')][_0xb1b7('0x73')]({'membername':_0x30b67f[_0xb1b7('0x34')],'UserId':_0x30b67f['id'],'queue_name':_0x193cc5[_0xb1b7('0x34')],'VoiceQueueId':_0x193cc5['id'],'interface':_[_0xb1b7('0x74')](_0x30b67f[_0xb1b7('0x71')])?util['format'](_0xb1b7('0x75'),_0x30b67f[_0xb1b7('0x34')]):_0x30b67f[_0xb1b7('0x71')],'paused':_0x30b67f['voicePause']||![],'penalty':_0x193cc5[_0xb1b7('0x76')][_0xb1b7('0x6a')]},{'transaction':_0x4f6ecb});});return Promise[_0xb1b7('0x77')](_0x19246d);});});});return Promise['all'](_0x59a79a);});return Promise[_0xb1b7('0x77')](_0x490125);});});return Promise['all'](_0x4ac098)[_0xb1b7('0x28')](function(){return _0x2623e3[_0xb1b7('0x64')](_0x3fc8f0[_0xb1b7('0x51')][_0xb1b7('0x61')],{'transaction':_0x4f6ecb})[_0xb1b7('0x78')](function(_0x4ac790){return _0x4ac790;});});});}})['then'](respondWithResult(_0x3ec5bc,null))['catch'](handleError(_0x3ec5bc,null));};exports['removeAgents']=function(_0x33fcc2,_0x5834f1){return db['Team'][_0xb1b7('0x4f')]({'where':{'id':_0x33fcc2[_0xb1b7('0x46')]['id']}})[_0xb1b7('0x28')](handleEntityNotFound(_0x5834f1,null))[_0xb1b7('0x28')](function(_0xaba985){if(_0xaba985){var _0x12b2a1=[_0xb1b7('0x65'),_0xb1b7('0x79'),_0xb1b7('0x7a'),_0xb1b7('0x66'),_0xb1b7('0x67'),_0xb1b7('0x68'),_0xb1b7('0x7b')];return db[_0xb1b7('0x7c')][_0xb1b7('0x7d')](function(_0x2f342e){var _0x45e00b=_[_0xb1b7('0x33')](_0x12b2a1,function(_0x570f91){var _0x34bc11={'attributes':['id',_0xb1b7('0x34')]};return _0xaba985[_0xb1b7('0x4a')+_0x570f91+'Queues'](_0x34bc11)['then'](function(_0x117b39){var _0x6e7516=_[_0xb1b7('0x33')](_0x117b39,function(_0x358224){return _0x358224['removeAgents'](_0x33fcc2[_0xb1b7('0x35')][_0xb1b7('0x61')],{'transaction':_0x2f342e})[_0xb1b7('0x28')](function(){var _0x296ee7=JSON[_0xb1b7('0x7e')]('['+_0x33fcc2['query'][_0xb1b7('0x61')]+']');var _0xcd4491=_['map'](_0x296ee7,function(_0x20b33c){socket[_0xb1b7('0x6d')]('user'+_0x570f91+'Queue:remove',{'UserId':Number(_0x20b33c),[_0x570f91+'QueueId']:_0x358224['id']});if(_0x570f91!==_0xb1b7('0x65'))return;return db['UserVoiceQueueRt'][_0xb1b7('0x2a')]({'where':{'VoiceQueueId':_0x358224['id'],'UserId':_0x20b33c},'transaction':_0x2f342e});});return Promise[_0xb1b7('0x77')](_0xcd4491);});});return Promise[_0xb1b7('0x77')](_0x6e7516);});});return Promise[_0xb1b7('0x77')](_0x45e00b)['then'](function(){return _0xaba985[_0xb1b7('0x7f')](_0x33fcc2['query'][_0xb1b7('0x61')],{'transaction':_0x2f342e});});});}})[_0xb1b7('0x28')](respondWithStatusCode(_0x5834f1,null))['catch'](handleError(_0x5834f1,null));};exports[_0xb1b7('0x80')]=function(_0x359b9b,_0xf20030,_0x54880d){var _0x5361b5={};var _0x2d95da={};var _0x1af006;var _0x3855bb;return db['Team'][_0xb1b7('0x53')]({'where':{'id':_0x359b9b[_0xb1b7('0x46')]['id']}})['then'](handleEntityNotFound(_0xf20030,null))[_0xb1b7('0x28')](function(_0x25c9b3){if(_0x25c9b3){_0x1af006=_0x25c9b3;_0x2d95da['model']=_[_0xb1b7('0x36')](db[_0xb1b7('0x6c')][_0xb1b7('0x5c')]);_0x2d95da[_0xb1b7('0x35')]=_[_0xb1b7('0x36')](_0x359b9b[_0xb1b7('0x35')]);_0x2d95da[_0xb1b7('0x37')]=_[_0xb1b7('0x38')](_0x2d95da[_0xb1b7('0x32')],_0x2d95da[_0xb1b7('0x35')]);_0x5361b5[_0xb1b7('0x39')]=_[_0xb1b7('0x38')](_0x2d95da[_0xb1b7('0x32')],qs[_0xb1b7('0x3a')](_0x359b9b['query'][_0xb1b7('0x3a')]));_0x5361b5[_0xb1b7('0x39')]=_0x5361b5[_0xb1b7('0x39')][_0xb1b7('0x3b')]?_0x5361b5[_0xb1b7('0x39')]:_0x2d95da[_0xb1b7('0x32')];_0x5361b5[_0xb1b7('0x5d')]=qs[_0xb1b7('0x3d')](_0x359b9b[_0xb1b7('0x35')][_0xb1b7('0x3d')]);_0x5361b5[_0xb1b7('0x3e')]=qs[_0xb1b7('0x37')](_[_0xb1b7('0x3f')](_0x359b9b['query'],_0x2d95da[_0xb1b7('0x37')]));if(_0x359b9b['query']['filter']){_0x5361b5[_0xb1b7('0x3e')]=_[_0xb1b7('0x40')](_0x5361b5[_0xb1b7('0x3e')],{'$or':_[_0xb1b7('0x33')](_0x5361b5[_0xb1b7('0x39')],function(_0x37bab2){var _0x45caed={};_0x45caed[_0x37bab2]={'$like':'%'+_0x359b9b[_0xb1b7('0x35')][_0xb1b7('0x41')]+'%'};return _0x45caed;})});}_0x5361b5=_[_0xb1b7('0x40')]({},_0x5361b5,_0x359b9b[_0xb1b7('0x42')]);return _0x1af006[_0xb1b7('0x80')](_0x5361b5);}})[_0xb1b7('0x28')](function(_0xebd86d){if(_0xebd86d){_0x3855bb=_0xebd86d[_0xb1b7('0x3b')];if(!_0x359b9b[_0xb1b7('0x35')][_0xb1b7('0x81')](_0xb1b7('0x3c'))){_0x5361b5['limit']=qs['limit'](_0x359b9b[_0xb1b7('0x35')][_0xb1b7('0x21')]);_0x5361b5[_0xb1b7('0x1f')]=qs['offset'](_0x359b9b[_0xb1b7('0x35')][_0xb1b7('0x1f')]);}return _0x1af006[_0xb1b7('0x80')](_0x5361b5);}})[_0xb1b7('0x28')](function(_0x1295ca){if(_0x1295ca){return _0x1295ca?{'count':_0x3855bb,'rows':_0x1295ca}:null;}})[_0xb1b7('0x28')](respondWithResult(_0xf20030,null))[_0xb1b7('0x44')](handleError(_0xf20030,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 9f0b037..6a67b9c 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 _0xafdb=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x1ca6fb,_0x4687a2){var _0x2316c5=function(_0x369609){while(--_0x369609){_0x1ca6fb['push'](_0x1ca6fb['shift']());}};_0x2316c5(++_0x4687a2);}(_0xafdb,0x177));var _0xbafd=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0xafdb[_0x5ee3d3];return _0x4b272f;};'use strict';var EventEmitter=require('events');var Team=require(_0xbafd('0x0'))['db'][_0xbafd('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xbafd('0x2')](0x0);var events={'afterCreate':_0xbafd('0x3'),'afterUpdate':_0xbafd('0x4'),'afterDestroy':_0xbafd('0x5')};function emitEvent(_0xd08bcd){return function(_0x278fc0,_0xbec3e9,_0x10c35d){TeamEvents['emit'](_0xd08bcd+':'+_0x278fc0['id'],_0x278fc0);TeamEvents[_0xbafd('0x6')](_0xd08bcd,_0x278fc0);_0x10c35d(null);};}for(var e in events){if(events[_0xbafd('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x7a73=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x27e6d4,_0x3673e4){var _0x5d4467=function(_0x2b9f0b){while(--_0x2b9f0b){_0x27e6d4['push'](_0x27e6d4['shift']());}};_0x5d4467(++_0x3673e4);}(_0x7a73,0x112));var _0x37a7=function(_0x1be7fe,_0x2bc4ae){_0x1be7fe=_0x1be7fe-0x0;var _0x585cfd=_0x7a73[_0x1be7fe];return _0x585cfd;};'use strict';var EventEmitter=require(_0x37a7('0x0'));var Team=require(_0x37a7('0x1'))['db'][_0x37a7('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x37a7('0x3')](0x0);var events={'afterCreate':_0x37a7('0x4'),'afterUpdate':_0x37a7('0x5'),'afterDestroy':_0x37a7('0x6')};function emitEvent(_0xfad900){return function(_0x42531a,_0x62721f,_0x51fb1e){TeamEvents['emit'](_0xfad900+':'+_0x42531a['id'],_0x42531a);TeamEvents[_0x37a7('0x7')](_0xfad900,_0x42531a);_0x51fb1e(null);};}for(var e in events){if(events[_0x37a7('0x8')](e)){var event=events[e];Team[_0x37a7('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b2fd1ff..8154b84 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 _0x293e=['request-promise','path','rimraf','./team.attributes','exports','Team','teams','lodash','util','api','moment'];(function(_0x15c927,_0x137e73){var _0x348553=function(_0x411d4b){while(--_0x411d4b){_0x15c927['push'](_0x15c927['shift']());}};_0x348553(++_0x137e73);}(_0x293e,0x188));var _0xe293=function(_0x425c62,_0x41eb91){_0x425c62=_0x425c62-0x0;var _0x20b356=_0x293e[_0x425c62];return _0x20b356;};'use strict';var _=require(_0xe293('0x0'));var util=require(_0xe293('0x1'));var logger=require('../../config/logger')(_0xe293('0x2'));var moment=require(_0xe293('0x3'));var BPromise=require('bluebird');var rp=require(_0xe293('0x4'));var fs=require('fs');var path=require(_0xe293('0x5'));var rimraf=require(_0xe293('0x6'));var config=require('../../config/environment');var attributes=require(_0xe293('0x7'));module[_0xe293('0x8')]=function(_0x1c7987,_0x2da01c){return _0x1c7987['define'](_0xe293('0x9'),attributes,{'tableName':_0xe293('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fab=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','Team','lodash'];(function(_0x1a5c6b,_0x5c9eef){var _0x29d72f=function(_0x456236){while(--_0x456236){_0x1a5c6b['push'](_0x1a5c6b['shift']());}};_0x29d72f(++_0x5c9eef);}(_0x9fab,0x18b));var _0xb9fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fab[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb9fa('0x0'));var util=require(_0xb9fa('0x1'));var logger=require(_0xb9fa('0x2'))(_0xb9fa('0x3'));var moment=require(_0xb9fa('0x4'));var BPromise=require(_0xb9fa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9fa('0x6'));var rimraf=require(_0xb9fa('0x7'));var config=require(_0xb9fa('0x8'));var attributes=require(_0xb9fa('0x9'));module[_0xb9fa('0xa')]=function(_0x3187ea,_0x861ade){return _0x3187ea['define'](_0xb9fa('0xb'),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 7950eb9..c7090d0 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 _0x6e7d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','Team,\x20%s,\x20%s','result'];(function(_0x482591,_0x2f2cf6){var _0x16a9fe=function(_0x4d215c){while(--_0x4d215c){_0x482591['push'](_0x482591['shift']());}};_0x16a9fe(++_0x2f2cf6);}(_0x6e7d,0x120));var _0xd6e7=function(_0x585e1a,_0x3f3279){_0x585e1a=_0x585e1a-0x0;var _0x19e94e=_0x6e7d[_0x585e1a];return _0x19e94e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6e7('0x0'));var BPromise=require(_0xd6e7('0x1'));var rs=require(_0xd6e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6e7('0x3'))['db'];var utils=require(_0xd6e7('0x4'));var logger=require(_0xd6e7('0x5'))(_0xd6e7('0x6'));var config=require(_0xd6e7('0x7'));var jayson=require(_0xd6e7('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd6e7('0x9')]=_[_0xd6e7('0xa')](config[_0xd6e7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd6e7('0xb'))(new Redis(config[_0xd6e7('0x9')]));require(_0xd6e7('0xc'))[_0xd6e7('0xd')](socket);function respondWithRpcPromise(_0xf99987,_0x13efba,_0x583942){return new BPromise(function(_0x302042,_0xa2605e){return client[_0xd6e7('0xe')](_0xf99987,_0x583942)[_0xd6e7('0xf')](function(_0x432b09){logger[_0xd6e7('0x10')]('Team,\x20%s,\x20%s',_0x13efba,_0xd6e7('0x11'));logger[_0xd6e7('0x12')](_0xd6e7('0x13'),_0x13efba,_0xd6e7('0x11'),JSON['stringify'](_0x432b09));if(_0x432b09[_0xd6e7('0x14')]){if(_0x432b09[_0xd6e7('0x14')]['code']===0x1f4){logger[_0xd6e7('0x14')]('Team,\x20%s,\x20%s',_0x13efba,_0x432b09[_0xd6e7('0x14')]['message']);return _0xa2605e(_0x432b09[_0xd6e7('0x14')][_0xd6e7('0x15')]);}logger['error'](_0xd6e7('0x16'),_0x13efba,_0x432b09[_0xd6e7('0x14')]['message']);return _0x302042(_0x432b09[_0xd6e7('0x14')]['message']);}else{logger[_0xd6e7('0x10')](_0xd6e7('0x16'),_0x13efba,_0xd6e7('0x11'));_0x302042(_0x432b09[_0xd6e7('0x17')]['message']);}})['catch'](function(_0x5ac5cc){logger[_0xd6e7('0x14')]('Team,\x20%s,\x20%s',_0x13efba,_0x5ac5cc);_0xa2605e(_0x5ac5cc);});});} \ No newline at end of file +var _0xd56f=['stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x189b3b,_0x484de8){var _0x7c4721=function(_0x1ca32b){while(--_0x1ca32b){_0x189b3b['push'](_0x189b3b['shift']());}};_0x7c4721(++_0x484de8);}(_0xd56f,0xe8));var _0xfd56=function(_0x27d6c5,_0x4c0e92){_0x27d6c5=_0x27d6c5-0x0;var _0x51fba6=_0xd56f[_0x27d6c5];return _0x51fba6;};'use strict';var _=require(_0xfd56('0x0'));var util=require(_0xfd56('0x1'));var moment=require(_0xfd56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd56('0x4'))['db'];var utils=require(_0xfd56('0x5'));var logger=require('../../config/logger')(_0xfd56('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfd56('0x7')][_0xfd56('0x8')]({'port':0x232a});config[_0xfd56('0x9')]=_[_0xfd56('0xa')](config[_0xfd56('0x9')],{'host':_0xfd56('0xb'),'port':0x18eb});var socket=require(_0xfd56('0xc'))(new Redis(config[_0xfd56('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x28da4f,_0x200d2b,_0x74559d){return new BPromise(function(_0x2a1bc1,_0x169ced){return client[_0xfd56('0xd')](_0x28da4f,_0x74559d)[_0xfd56('0xe')](function(_0x15f359){logger['info']('Team,\x20%s,\x20%s',_0x200d2b,'request\x20sent');logger[_0xfd56('0xf')](_0xfd56('0x10'),_0x200d2b,_0xfd56('0x11'),JSON[_0xfd56('0x12')](_0x15f359));if(_0x15f359[_0xfd56('0x13')]){if(_0x15f359[_0xfd56('0x13')][_0xfd56('0x14')]===0x1f4){logger[_0xfd56('0x13')](_0xfd56('0x15'),_0x200d2b,_0x15f359[_0xfd56('0x13')]['message']);return _0x169ced(_0x15f359[_0xfd56('0x13')][_0xfd56('0x16')]);}logger[_0xfd56('0x13')](_0xfd56('0x15'),_0x200d2b,_0x15f359['error'][_0xfd56('0x16')]);return _0x2a1bc1(_0x15f359[_0xfd56('0x13')][_0xfd56('0x16')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x200d2b,_0xfd56('0x11'));_0x2a1bc1(_0x15f359[_0xfd56('0x17')][_0xfd56('0x16')]);}})[_0xfd56('0x18')](function(_0x4e63f8){logger[_0xfd56('0x13')]('Team,\x20%s,\x20%s',_0x200d2b,_0x4e63f8);_0x169ced(_0x4e63f8);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index ae852ca..7259cbe 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 _0x1ab1=['register','length','team:','save','remove','update','emit','removeListener'];(function(_0x735a8e,_0x50d58a){var _0x51070f=function(_0x4419c7){while(--_0x4419c7){_0x735a8e['push'](_0x735a8e['shift']());}};_0x51070f(++_0x50d58a);}(_0x1ab1,0x83));var _0x11ab=function(_0x5a20f0,_0x50862f){_0x5a20f0=_0x5a20f0-0x0;var _0x215b15=_0x1ab1[_0x5a20f0];return _0x215b15;};'use strict';var TeamEvents=require('./team.events');var events=[_0x11ab('0x0'),_0x11ab('0x1'),_0x11ab('0x2')];function createListener(_0x1ef542,_0x3886bf){return function(_0x2562ac){_0x3886bf[_0x11ab('0x3')](_0x1ef542,_0x2562ac);};}function removeListener(_0x5729b9,_0xded89b){return function(){TeamEvents[_0x11ab('0x4')](_0x5729b9,_0xded89b);};}exports[_0x11ab('0x5')]=function(_0x173e17){for(var _0x643c32=0x0,_0x531999=events[_0x11ab('0x6')];_0x643c32<_0x531999;_0x643c32++){var _0x26c091=events[_0x643c32];var _0x4702b2=createListener(_0x11ab('0x7')+_0x26c091,_0x173e17);TeamEvents['on'](_0x26c091,_0x4702b2);}}; \ No newline at end of file +var _0xcf76=['emit','removeListener','register','length','team:','./team.events','remove','update'];(function(_0x4986a9,_0x311d65){var _0x2d31fe=function(_0x369848){while(--_0x369848){_0x4986a9['push'](_0x4986a9['shift']());}};_0x2d31fe(++_0x311d65);}(_0xcf76,0x10d));var _0x6cf7=function(_0x2fcfb0,_0x3fd58a){_0x2fcfb0=_0x2fcfb0-0x0;var _0xa04623=_0xcf76[_0x2fcfb0];return _0xa04623;};'use strict';var TeamEvents=require(_0x6cf7('0x0'));var events=['save',_0x6cf7('0x1'),_0x6cf7('0x2')];function createListener(_0x31cb0a,_0x3947d4){return function(_0x24b98b){_0x3947d4[_0x6cf7('0x3')](_0x31cb0a,_0x24b98b);};}function removeListener(_0x355c44,_0xaed6e3){return function(){TeamEvents[_0x6cf7('0x4')](_0x355c44,_0xaed6e3);};}exports[_0x6cf7('0x5')]=function(_0x58b692){for(var _0x1ffe30=0x0,_0x198a49=events[_0x6cf7('0x6')];_0x1ffe30<_0x198a49;_0x1ffe30++){var _0x5ea5c7=events[_0x1ffe30];var _0xcb4683=createListener(_0x6cf7('0x7')+_0x5ea5c7,_0x58b692);TeamEvents['on'](_0x5ea5c7,_0xcb4683);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 667d46c..dce1c68 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3f9735,_0x5cfe98){var _0x57fc08=function(_0x229d01){while(--_0x229d01){_0x3f9735['push'](_0x3f9735['shift']());}};_0x57fc08(++_0x5cfe98);}(_0xedd9,0xfc));var _0x9edd=function(_0x33fe81,_0x27b0e2){_0x33fe81=_0x33fe81-0x0;var _0x68a576=_0xedd9[_0x33fe81];return _0x68a576;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4e3ffc,_0x570704){var _0x543119=function(_0x396abb){while(--_0x396abb){_0x4e3ffc['push'](_0x4e3ffc['shift']());}};_0x543119(++_0x570704);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 8e20776..a09568f 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15a0=['INTEGER','sequelize'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x15a0,0x8d));var _0x015a=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x15a0[_0x3a7a9c];return _0x59156e;};'use strict';var Sequelize=require(_0x015a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x015a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe53c=['sequelize','exports'];(function(_0x3b0976,_0x2fd807){var _0x2cdda7=function(_0x1e96d2){while(--_0x1e96d2){_0x3b0976['push'](_0x3b0976['shift']());}};_0x2cdda7(++_0x2fd807);}(_0xe53c,0xbc));var _0xce53=function(_0x31f5ce,_0x379d01){_0x31f5ce=_0x31f5ce-0x0;var _0x156662=_0xe53c[_0x31f5ce];return _0x156662;};'use strict';var Sequelize=require(_0xce53('0x0'));module[_0xce53('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index f3329a4..0e9e3e9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cfd=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0x8cfd[_0x2e53e1];return _0x3a23de;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var logger=require(_0xd8cf('0x2'))(_0xd8cf('0x3'));var moment=require(_0xd8cf('0x4'));var BPromise=require(_0xd8cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8cf('0x6'));var rimraf=require(_0xd8cf('0x7'));var config=require(_0xd8cf('0x8'));var attributes=require(_0xd8cf('0x9'));module[_0xd8cf('0xa')]=function(_0x318a72,_0x305768){return _0x318a72['define']('TeamVoiceQueue',attributes,{'tableName':_0xd8cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38df=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x38df,0x144));var _0xf38d=function(_0x2980de,_0x1426a4){_0x2980de=_0x2980de-0x0;var _0x81a4ca=_0x38df[_0x2980de];return _0x81a4ca;};'use strict';var _=require(_0xf38d('0x0'));var util=require(_0xf38d('0x1'));var logger=require(_0xf38d('0x2'))(_0xf38d('0x3'));var moment=require(_0xf38d('0x4'));var BPromise=require(_0xf38d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf38d('0x6'));var config=require(_0xf38d('0x7'));var attributes=require(_0xf38d('0x8'));module['exports']=function(_0x42c0bc,_0x3b7646){return _0x42c0bc[_0xf38d('0x9')](_0xf38d('0xa'),attributes,{'tableName':_0xf38d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 8b48987..6b1d0b8 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe20e=['TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c3064,_0x3f4f72){var _0xba5392=function(_0x18387a){while(--_0x18387a){_0x2c3064['push'](_0x2c3064['shift']());}};_0xba5392(++_0x3f4f72);}(_0xe20e,0x195));var _0xee20=function(_0x34145e,_0x689e31){_0x34145e=_0x34145e-0x0;var _0x27ed04=_0xe20e[_0x34145e];return _0x27ed04;};'use strict';var _=require(_0xee20('0x0'));var util=require(_0xee20('0x1'));var moment=require('moment');var BPromise=require(_0xee20('0x2'));var rs=require(_0xee20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee20('0x4'));var logger=require('../../config/logger')(_0xee20('0x5'));var config=require(_0xee20('0x6'));var jayson=require(_0xee20('0x7'));var client=jayson[_0xee20('0x8')][_0xee20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd8d1e,_0x3ba270,_0x15f380){return new BPromise(function(_0x34f82d,_0x120622){return client[_0xee20('0xa')](_0xd8d1e,_0x15f380)[_0xee20('0xb')](function(_0x50ed9b){logger[_0xee20('0xc')](_0xee20('0xd'),_0x3ba270,'request\x20sent');logger['debug'](_0xee20('0xe'),_0x3ba270,_0xee20('0xf'),JSON[_0xee20('0x10')](_0x50ed9b));if(_0x50ed9b[_0xee20('0x11')]){if(_0x50ed9b['error'][_0xee20('0x12')]===0x1f4){logger[_0xee20('0x11')](_0xee20('0xd'),_0x3ba270,_0x50ed9b[_0xee20('0x11')][_0xee20('0x13')]);return _0x120622(_0x50ed9b[_0xee20('0x11')][_0xee20('0x13')]);}logger['error'](_0xee20('0xd'),_0x3ba270,_0x50ed9b['error'][_0xee20('0x13')]);return _0x34f82d(_0x50ed9b[_0xee20('0x11')][_0xee20('0x13')]);}else{logger['info'](_0xee20('0xd'),_0x3ba270,_0xee20('0xf'));_0x34f82d(_0x50ed9b[_0xee20('0x14')][_0xee20('0x13')]);}})[_0xee20('0x15')](function(_0x5bc2a0){logger[_0xee20('0x11')](_0xee20('0xd'),_0x3ba270,_0x5bc2a0);_0x120622(_0x5bc2a0);});});} \ No newline at end of file +var _0x91a7=['message','TeamVoiceQueue,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x355f9b,_0x278068){var _0x3f426b=function(_0x2c1474){while(--_0x2c1474){_0x355f9b['push'](_0x355f9b['shift']());}};_0x3f426b(++_0x278068);}(_0x91a7,0xe7));var _0x791a=function(_0x1a8c36,_0x3b525a){_0x1a8c36=_0x1a8c36-0x0;var _0xef572f=_0x91a7[_0x1a8c36];return _0xef572f;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 0d2e1f7..9cc5696 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 _0xaec5=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var path=require(_0x5aec('0x2'));var timeout=require(_0x5aec('0x3'));var express=require(_0x5aec('0x4'));var router=express[_0x5aec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5aec('0x6'));var interaction=require(_0x5aec('0x7'));var config=require(_0x5aec('0x8'));var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5aec('0x9')](_0x5aec('0xa'),auth[_0x5aec('0xb')](),controller[_0x5aec('0xc')]);router['post']('/',auth[_0x5aec('0xb')](),controller[_0x5aec('0xd')]);router['put'](_0x5aec('0xa'),auth[_0x5aec('0xb')](),controller[_0x5aec('0xe')]);router[_0x5aec('0xf')](_0x5aec('0xa'),auth[_0x5aec('0xb')](),controller[_0x5aec('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6faf=['./template.controller','isAuthenticated','index','get','/:id','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26f5e4,_0x4efb0f){var _0x1a107c=function(_0x6ef88d){while(--_0x6ef88d){_0x26f5e4['push'](_0x26f5e4['shift']());}};_0x1a107c(++_0x4efb0f);}(_0x6faf,0xf9));var _0xf6fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6faf[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xf6fa('0x0'));var path=require(_0xf6fa('0x1'));var timeout=require(_0xf6fa('0x2'));var express=require(_0xf6fa('0x3'));var router=express[_0xf6fa('0x4')]();var fs_extra=require(_0xf6fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf6fa('0x6'));var config=require('../../config/environment');var controller=require(_0xf6fa('0x7'));router['get']('/',auth[_0xf6fa('0x8')](),controller[_0xf6fa('0x9')]);router[_0xf6fa('0xa')](_0xf6fa('0xb'),auth[_0xf6fa('0x8')](),controller['show']);router[_0xf6fa('0xc')]('/',auth[_0xf6fa('0x8')](),controller[_0xf6fa('0xd')]);router['put']('/:id',auth[_0xf6fa('0x8')](),controller['update']);router[_0xf6fa('0xe')](_0xf6fa('0xb'),auth['isAuthenticated'](),controller[_0xf6fa('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 35f5dd0..2136eaa 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 _0x8f10=['sequelize','exports','STRING','TEXT'];(function(_0x5e6a53,_0x318ce4){var _0x4d33a3=function(_0x30f6dd){while(--_0x30f6dd){_0x5e6a53['push'](_0x5e6a53['shift']());}};_0x4d33a3(++_0x318ce4);}(_0x8f10,0xdc));var _0x08f1=function(_0x33f71a,_0x163ee3){_0x33f71a=_0x33f71a-0x0;var _0x5d75a4=_0x8f10[_0x33f71a];return _0x5d75a4;};'use strict';var Sequelize=require(_0x08f1('0x0'));module[_0x08f1('0x1')]={'name':{'type':Sequelize[_0x08f1('0x2')]},'description':{'type':Sequelize[_0x08f1('0x2')]},'html':{'type':Sequelize[_0x08f1('0x3')]}}; \ No newline at end of file +var _0xc967=['sequelize','STRING'];(function(_0x581c55,_0x5b74d7){var _0x57b8a9=function(_0xc9efc4){while(--_0xc9efc4){_0x581c55['push'](_0x581c55['shift']());}};_0x57b8a9(++_0x5b74d7);}(_0xc967,0x150));var _0x7c96=function(_0x4fbb7a,_0x5a7788){_0x4fbb7a=_0x4fbb7a-0x0;var _0xd885fc=_0xc967[_0x4fbb7a];return _0xd885fc;};'use strict';var Sequelize=require(_0x7c96('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c96('0x1')]},'description':{'type':Sequelize['STRING']},'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 154f96e..d2776c3 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 _0x79cd=['index','map','Template','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','catch','error','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Templates','UserProfileResource','end','name','send'];(function(_0x3b4496,_0x1e975d){var _0x378449=function(_0x4f5a36){while(--_0x4f5a36){_0x3b4496['push'](_0x3b4496['shift']());}};_0x378449(++_0x1e975d);}(_0x79cd,0xc8));var _0xd79c=function(_0x179e8f,_0x1ef21c){_0x179e8f=_0x179e8f-0x0;var _0x621e87=_0x79cd[_0x179e8f];return _0x621e87;};'use strict';var emlformat=require(_0xd79c('0x0'));var rimraf=require(_0xd79c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd79c('0x2'));var rp=require(_0xd79c('0x3'));var moment=require(_0xd79c('0x4'));var BPromise=require(_0xd79c('0x5'));var Mustache=require(_0xd79c('0x6'));var util=require(_0xd79c('0x7'));var path=require(_0xd79c('0x8'));var sox=require('sox');var csv=require(_0xd79c('0x9'));var ejs=require(_0xd79c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd79c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd79c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd79c('0xd'));var Papa=require(_0xd79c('0xe'));var Redis=require(_0xd79c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd79c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd79c('0x11'));var logger=require(_0xd79c('0x12'))(_0xd79c('0x13'));var utils=require('../../config/utils');var config=require(_0xd79c('0x14'));var licenseUtil=require(_0xd79c('0x15'));var db=require(_0xd79c('0x16'))['db'];function respondWithStatusCode(_0x2be78a,_0xa5483c){_0xa5483c=_0xa5483c||0xcc;return function(_0x14d8cf){if(_0x14d8cf){return _0x2be78a[_0xd79c('0x17')](_0xa5483c);}return _0x2be78a[_0xd79c('0x18')](_0xa5483c)['end']();};}function respondWithResult(_0x15e5ba,_0x4225ef){_0x4225ef=_0x4225ef||0xc8;return function(_0x42cd5a){if(_0x42cd5a){return _0x15e5ba['status'](_0x4225ef)[_0xd79c('0x19')](_0x42cd5a);}};}function respondWithFilteredResult(_0x48730c,_0x40ee87){return function(_0x28fd63){if(_0x28fd63){var _0x4791d0=typeof _0x40ee87[_0xd79c('0x1a')]===_0xd79c('0x1b')&&typeof _0x40ee87[_0xd79c('0x1c')]===_0xd79c('0x1b');var _0x3c87ed=_0x28fd63[_0xd79c('0x1d')];var _0x19a81e=_0x4791d0?0x0:_0x40ee87[_0xd79c('0x1a')];var _0x42478f=_0x4791d0?_0x28fd63[_0xd79c('0x1d')]:_0x40ee87[_0xd79c('0x1a')]+_0x40ee87[_0xd79c('0x1c')];var _0x2fae66;if(_0x42478f>=_0x3c87ed){_0x42478f=_0x3c87ed;_0x2fae66=0xc8;}else{_0x2fae66=0xce;}_0x48730c[_0xd79c('0x18')](_0x2fae66);return _0x48730c[_0xd79c('0x1e')](_0xd79c('0x1f'),_0x19a81e+'-'+_0x42478f+'/'+_0x3c87ed)[_0xd79c('0x19')](_0x28fd63);}return null;};}function patchUpdates(_0x4fc77e){return function(_0x2d8a0e){try{jsonpatch[_0xd79c('0x20')](_0x2d8a0e,_0x4fc77e,!![]);}catch(_0x12d126){return BPromise['reject'](_0x12d126);}return _0x2d8a0e[_0xd79c('0x21')]();};}function saveUpdates(_0x1ca883,_0x4eb349){return function(_0x133a8e){if(_0x133a8e){return _0x133a8e[_0xd79c('0x22')](_0x1ca883)['then'](function(_0x1858e5){return _0x1858e5;});}return null;};}function removeEntity(_0xe3db1c,_0x301bb2){return function(_0x3bf6e0){if(_0x3bf6e0){return _0x3bf6e0[_0xd79c('0x23')]()[_0xd79c('0x24')](function(){var _0x1785b7=_0x3bf6e0[_0xd79c('0x25')]({'plain':!![]});var _0x3023b4=_0xd79c('0x26');return db[_0xd79c('0x27')][_0xd79c('0x23')]({'where':{'type':_0x3023b4,'resourceId':_0x1785b7['id']}})[_0xd79c('0x24')](function(){return _0x3bf6e0;});})[_0xd79c('0x24')](function(){_0xe3db1c[_0xd79c('0x18')](0xcc)[_0xd79c('0x28')]();});}};}function handleEntityNotFound(_0x1c0764,_0x148c59){return function(_0x6709f1){if(!_0x6709f1){_0x1c0764[_0xd79c('0x17')](0x194);}return _0x6709f1;};}function handleError(_0x4d4d7d,_0x31adc4){_0x31adc4=_0x31adc4||0x1f4;return function(_0x90657e){logger['error'](_0x90657e['stack']);if(_0x90657e[_0xd79c('0x29')]){delete _0x90657e[_0xd79c('0x29')];}_0x4d4d7d[_0xd79c('0x18')](_0x31adc4)[_0xd79c('0x2a')](_0x90657e);};}exports[_0xd79c('0x2b')]=function(_0x38e492,_0x4587fe){var _0x272941={},_0x117070={},_0x28d2c3={'count':0x0,'rows':[]};var _0x5c2599=_[_0xd79c('0x2c')](db[_0xd79c('0x2d')][_0xd79c('0x2e')],function(_0x36b356){return{'name':_0x36b356[_0xd79c('0x2f')],'type':_0x36b356[_0xd79c('0x30')][_0xd79c('0x31')]};});_0x117070[_0xd79c('0x32')]=_[_0xd79c('0x2c')](_0x5c2599,_0xd79c('0x29'));_0x117070['query']=_[_0xd79c('0x33')](_0x38e492[_0xd79c('0x34')]);_0x117070[_0xd79c('0x35')]=_[_0xd79c('0x36')](_0x117070[_0xd79c('0x32')],_0x117070[_0xd79c('0x34')]);_0x272941['attributes']=_[_0xd79c('0x36')](_0x117070[_0xd79c('0x32')],qs[_0xd79c('0x37')](_0x38e492['query']['fields']));_0x272941['attributes']=_0x272941[_0xd79c('0x38')][_0xd79c('0x39')]?_0x272941['attributes']:_0x117070['model'];if(!_0x38e492[_0xd79c('0x34')][_0xd79c('0x3a')](_0xd79c('0x3b'))){_0x272941[_0xd79c('0x1c')]=qs[_0xd79c('0x1c')](_0x38e492[_0xd79c('0x34')][_0xd79c('0x1c')]);_0x272941[_0xd79c('0x1a')]=qs[_0xd79c('0x1a')](_0x38e492[_0xd79c('0x34')][_0xd79c('0x1a')]);}_0x272941['order']=qs['sort'](_0x38e492[_0xd79c('0x34')]['sort']);_0x272941[_0xd79c('0x3c')]=qs['filters'](_[_0xd79c('0x3d')](_0x38e492['query'],_0x117070[_0xd79c('0x35')]),_0x5c2599);if(_0x38e492[_0xd79c('0x34')][_0xd79c('0x3e')]){_0x272941[_0xd79c('0x3c')]=_['merge'](_0x272941[_0xd79c('0x3c')],{'$or':_[_0xd79c('0x2c')](_0x5c2599,function(_0x3d777a){if(_0x3d777a[_0xd79c('0x30')]!==_0xd79c('0x3f')){var _0xaa999e={};_0xaa999e[_0x3d777a[_0xd79c('0x29')]]={'$like':'%'+_0x38e492['query']['filter']+'%'};return _0xaa999e;}})});}_0x272941=_[_0xd79c('0x40')]({},_0x272941,_0x38e492[_0xd79c('0x41')]);var _0x18def0={'where':_0x272941[_0xd79c('0x3c')]};return db['Template'][_0xd79c('0x1d')](_0x18def0)[_0xd79c('0x24')](function(_0x47d5b6){_0x28d2c3[_0xd79c('0x1d')]=_0x47d5b6;if(_0x38e492[_0xd79c('0x34')][_0xd79c('0x42')]){_0x272941[_0xd79c('0x43')]=[{'all':!![]}];}return db[_0xd79c('0x2d')][_0xd79c('0x44')](_0x272941);})[_0xd79c('0x24')](function(_0x4080a3){_0x28d2c3[_0xd79c('0x45')]=_0x4080a3;return _0x28d2c3;})[_0xd79c('0x24')](respondWithFilteredResult(_0x4587fe,_0x272941))['catch'](handleError(_0x4587fe,null));};exports['show']=function(_0x3ad21c,_0x1ed296){var _0x45c586={'raw':!![],'where':{'id':_0x3ad21c[_0xd79c('0x46')]['id']}},_0x41bd6d={};_0x41bd6d['model']=_[_0xd79c('0x33')](db[_0xd79c('0x2d')][_0xd79c('0x2e')]);_0x41bd6d['query']=_['keys'](_0x3ad21c[_0xd79c('0x34')]);_0x41bd6d[_0xd79c('0x35')]=_['intersection'](_0x41bd6d['model'],_0x41bd6d[_0xd79c('0x34')]);_0x45c586[_0xd79c('0x38')]=_[_0xd79c('0x36')](_0x41bd6d['model'],qs[_0xd79c('0x37')](_0x3ad21c['query'][_0xd79c('0x37')]));_0x45c586['attributes']=_0x45c586[_0xd79c('0x38')]['length']?_0x45c586[_0xd79c('0x38')]:_0x41bd6d[_0xd79c('0x32')];if(_0x3ad21c['query'][_0xd79c('0x42')]){_0x45c586[_0xd79c('0x43')]=[{'all':!![]}];}_0x45c586=_[_0xd79c('0x40')]({},_0x45c586,_0x3ad21c[_0xd79c('0x41')]);return db[_0xd79c('0x2d')][_0xd79c('0x47')](_0x45c586)['then'](handleEntityNotFound(_0x1ed296,null))['then'](respondWithResult(_0x1ed296,null))['catch'](handleError(_0x1ed296,null));};exports[_0xd79c('0x48')]=function(_0xf7d394,_0x1140c6){return db[_0xd79c('0x2d')][_0xd79c('0x48')](_0xf7d394[_0xd79c('0x49')],{})[_0xd79c('0x24')](function(_0x5127da){var _0x49b972=_0xf7d394['user']['get']({'plain':!![]});if(!_0x49b972)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b972[_0xd79c('0x4a')]===_0xd79c('0x4b')){var _0x410cff=_0x5127da['get']({'plain':!![]});var _0x493c2f=_0xd79c('0x26');return db[_0xd79c('0x4c')][_0xd79c('0x47')]({'where':{'name':_0x493c2f,'userProfileId':_0x49b972[_0xd79c('0x4d')]},'raw':!![]})['then'](function(_0x299b47){if(_0x299b47&&_0x299b47[_0xd79c('0x4e')]===0x0){return db['UserProfileResource'][_0xd79c('0x48')]({'name':_0x410cff['name'],'resourceId':_0x410cff['id'],'type':_0x299b47['name'],'sectionId':_0x299b47['id']},{})[_0xd79c('0x24')](function(){return _0x5127da;});}else{return _0x5127da;}})[_0xd79c('0x4f')](function(_0x3e43e1){logger[_0xd79c('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e43e1);throw _0x3e43e1;});}return _0x5127da;})[_0xd79c('0x24')](respondWithResult(_0x1140c6,0xc9))[_0xd79c('0x4f')](handleError(_0x1140c6,null));};exports['update']=function(_0x590af9,_0x5adbb6){if(_0x590af9[_0xd79c('0x49')]['id']){delete _0x590af9['body']['id'];}return db[_0xd79c('0x2d')]['find']({'where':{'id':_0x590af9['params']['id']}})[_0xd79c('0x24')](handleEntityNotFound(_0x5adbb6,null))[_0xd79c('0x24')](saveUpdates(_0x590af9[_0xd79c('0x49')],null))[_0xd79c('0x24')](respondWithResult(_0x5adbb6,null))[_0xd79c('0x4f')](handleError(_0x5adbb6,null));};exports['destroy']=function(_0x27cee3,_0x3d9deb){return db[_0xd79c('0x2d')]['find']({'where':{'id':_0x27cee3[_0xd79c('0x46')]['id']}})[_0xd79c('0x24')](handleEntityNotFound(_0x3d9deb,null))[_0xd79c('0x24')](removeEntity(_0x3d9deb,null))[_0xd79c('0x4f')](handleError(_0x3d9deb,null));}; \ No newline at end of file +var _0xa4a6=['where','type','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','map','Template','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','merge'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa4a6,0x66));var _0x6a4a=function(_0x23f066,_0x886f4d){_0x23f066=_0x23f066-0x0;var _0x5732e0=_0xa4a6[_0x23f066];return _0x5732e0;};'use strict';var emlformat=require(_0x6a4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a4a('0x1'));var jsonpatch=require(_0x6a4a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6a4a('0x3'));var Mustache=require(_0x6a4a('0x4'));var util=require(_0x6a4a('0x5'));var path=require(_0x6a4a('0x6'));var sox=require(_0x6a4a('0x7'));var csv=require('to-csv');var ejs=require(_0x6a4a('0x8'));var fs=require('fs');var fs_extra=require(_0x6a4a('0x9'));var _=require(_0x6a4a('0xa'));var squel=require('squel');var crypto=require(_0x6a4a('0xb'));var jsforce=require(_0x6a4a('0xc'));var deskjs=require(_0x6a4a('0xd'));var toCsv=require(_0x6a4a('0xe'));var querystring=require(_0x6a4a('0xf'));var Papa=require(_0x6a4a('0x10'));var Redis=require(_0x6a4a('0x11'));var authService=require(_0x6a4a('0x12'));var qs=require(_0x6a4a('0x13'));var as=require(_0x6a4a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a4a('0x15'))(_0x6a4a('0x16'));var utils=require(_0x6a4a('0x17'));var config=require(_0x6a4a('0x18'));var licenseUtil=require(_0x6a4a('0x19'));var db=require(_0x6a4a('0x1a'))['db'];function respondWithStatusCode(_0xe961a1,_0x3f6ffd){_0x3f6ffd=_0x3f6ffd||0xcc;return function(_0x374482){if(_0x374482){return _0xe961a1[_0x6a4a('0x1b')](_0x3f6ffd);}return _0xe961a1['status'](_0x3f6ffd)[_0x6a4a('0x1c')]();};}function respondWithResult(_0x557c08,_0xc5c4c5){_0xc5c4c5=_0xc5c4c5||0xc8;return function(_0x3dad75){if(_0x3dad75){return _0x557c08[_0x6a4a('0x1d')](_0xc5c4c5)[_0x6a4a('0x1e')](_0x3dad75);}};}function respondWithFilteredResult(_0x4cba66,_0x53ab80){return function(_0x387862){if(_0x387862){var _0x1d7a2b=typeof _0x53ab80[_0x6a4a('0x1f')]==='undefined'&&typeof _0x53ab80[_0x6a4a('0x20')]==='undefined';var _0x1b1eee=_0x387862['count'];var _0x476961=_0x1d7a2b?0x0:_0x53ab80[_0x6a4a('0x1f')];var _0x142fd3=_0x1d7a2b?_0x387862[_0x6a4a('0x21')]:_0x53ab80[_0x6a4a('0x1f')]+_0x53ab80[_0x6a4a('0x20')];var _0x2a539a;if(_0x142fd3>=_0x1b1eee){_0x142fd3=_0x1b1eee;_0x2a539a=0xc8;}else{_0x2a539a=0xce;}_0x4cba66[_0x6a4a('0x1d')](_0x2a539a);return _0x4cba66['set'](_0x6a4a('0x22'),_0x476961+'-'+_0x142fd3+'/'+_0x1b1eee)[_0x6a4a('0x1e')](_0x387862);}return null;};}function patchUpdates(_0x59574f){return function(_0x49dc23){try{jsonpatch[_0x6a4a('0x23')](_0x49dc23,_0x59574f,!![]);}catch(_0x37ce27){return BPromise['reject'](_0x37ce27);}return _0x49dc23['save']();};}function saveUpdates(_0x267a51,_0x39dc1a){return function(_0x251b11){if(_0x251b11){return _0x251b11[_0x6a4a('0x24')](_0x267a51)[_0x6a4a('0x25')](function(_0x4468dd){return _0x4468dd;});}return null;};}function removeEntity(_0x4894fd,_0x4aa38e){return function(_0x231788){if(_0x231788){return _0x231788[_0x6a4a('0x26')]()[_0x6a4a('0x25')](function(){var _0xa83365=_0x231788[_0x6a4a('0x27')]({'plain':!![]});var _0x1bae64=_0x6a4a('0x28');return db[_0x6a4a('0x29')][_0x6a4a('0x26')]({'where':{'type':_0x1bae64,'resourceId':_0xa83365['id']}})[_0x6a4a('0x25')](function(){return _0x231788;});})[_0x6a4a('0x25')](function(){_0x4894fd[_0x6a4a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5081c1,_0x2aa600){return function(_0x5be65d){if(!_0x5be65d){_0x5081c1['sendStatus'](0x194);}return _0x5be65d;};}function handleError(_0x1ede32,_0x566c4f){_0x566c4f=_0x566c4f||0x1f4;return function(_0x36bf46){logger[_0x6a4a('0x2a')](_0x36bf46[_0x6a4a('0x2b')]);if(_0x36bf46[_0x6a4a('0x2c')]){delete _0x36bf46['name'];}_0x1ede32[_0x6a4a('0x1d')](_0x566c4f)[_0x6a4a('0x2d')](_0x36bf46);};}exports['index']=function(_0x4581d9,_0x598b07){var _0x5b8d2b={},_0x1474a0={},_0x40c9fa={'count':0x0,'rows':[]};var _0x30dddb=_[_0x6a4a('0x2e')](db[_0x6a4a('0x2f')]['rawAttributes'],function(_0x10f67c){return{'name':_0x10f67c['fieldName'],'type':_0x10f67c['type']['key']};});_0x1474a0[_0x6a4a('0x30')]=_[_0x6a4a('0x2e')](_0x30dddb,_0x6a4a('0x2c'));_0x1474a0[_0x6a4a('0x31')]=_[_0x6a4a('0x32')](_0x4581d9[_0x6a4a('0x31')]);_0x1474a0[_0x6a4a('0x33')]=_['intersection'](_0x1474a0[_0x6a4a('0x30')],_0x1474a0['query']);_0x5b8d2b['attributes']=_[_0x6a4a('0x34')](_0x1474a0[_0x6a4a('0x30')],qs[_0x6a4a('0x35')](_0x4581d9[_0x6a4a('0x31')]['fields']));_0x5b8d2b[_0x6a4a('0x36')]=_0x5b8d2b[_0x6a4a('0x36')]['length']?_0x5b8d2b[_0x6a4a('0x36')]:_0x1474a0[_0x6a4a('0x30')];if(!_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x37')]('nolimit')){_0x5b8d2b[_0x6a4a('0x20')]=qs['limit'](_0x4581d9['query']['limit']);_0x5b8d2b[_0x6a4a('0x1f')]=qs[_0x6a4a('0x1f')](_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x1f')]);}_0x5b8d2b['order']=qs['sort'](_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x38')]);_0x5b8d2b['where']=qs['filters'](_[_0x6a4a('0x39')](_0x4581d9[_0x6a4a('0x31')],_0x1474a0['filters']),_0x30dddb);if(_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x3a')]){_0x5b8d2b['where']=_[_0x6a4a('0x3b')](_0x5b8d2b[_0x6a4a('0x3c')],{'$or':_[_0x6a4a('0x2e')](_0x30dddb,function(_0x278f4f){if(_0x278f4f[_0x6a4a('0x3d')]!=='VIRTUAL'){var _0x377d12={};_0x377d12[_0x278f4f[_0x6a4a('0x2c')]]={'$like':'%'+_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x3a')]+'%'};return _0x377d12;}})});}_0x5b8d2b=_['merge']({},_0x5b8d2b,_0x4581d9['options']);var _0xb6d164={'where':_0x5b8d2b[_0x6a4a('0x3c')]};return db[_0x6a4a('0x2f')][_0x6a4a('0x21')](_0xb6d164)[_0x6a4a('0x25')](function(_0x56fc65){_0x40c9fa[_0x6a4a('0x21')]=_0x56fc65;if(_0x4581d9[_0x6a4a('0x31')][_0x6a4a('0x3e')]){_0x5b8d2b[_0x6a4a('0x3f')]=[{'all':!![]}];}return db[_0x6a4a('0x2f')][_0x6a4a('0x40')](_0x5b8d2b);})[_0x6a4a('0x25')](function(_0x26b54e){_0x40c9fa[_0x6a4a('0x41')]=_0x26b54e;return _0x40c9fa;})[_0x6a4a('0x25')](respondWithFilteredResult(_0x598b07,_0x5b8d2b))[_0x6a4a('0x42')](handleError(_0x598b07,null));};exports[_0x6a4a('0x43')]=function(_0xbb85f0,_0x538416){var _0x53b374={'raw':!![],'where':{'id':_0xbb85f0['params']['id']}},_0x15432e={};_0x15432e[_0x6a4a('0x30')]=_['keys'](db[_0x6a4a('0x2f')][_0x6a4a('0x44')]);_0x15432e[_0x6a4a('0x31')]=_[_0x6a4a('0x32')](_0xbb85f0['query']);_0x15432e[_0x6a4a('0x33')]=_['intersection'](_0x15432e[_0x6a4a('0x30')],_0x15432e[_0x6a4a('0x31')]);_0x53b374['attributes']=_[_0x6a4a('0x34')](_0x15432e[_0x6a4a('0x30')],qs['fields'](_0xbb85f0[_0x6a4a('0x31')][_0x6a4a('0x35')]));_0x53b374[_0x6a4a('0x36')]=_0x53b374[_0x6a4a('0x36')][_0x6a4a('0x45')]?_0x53b374[_0x6a4a('0x36')]:_0x15432e[_0x6a4a('0x30')];if(_0xbb85f0[_0x6a4a('0x31')][_0x6a4a('0x3e')]){_0x53b374[_0x6a4a('0x3f')]=[{'all':!![]}];}_0x53b374=_[_0x6a4a('0x3b')]({},_0x53b374,_0xbb85f0[_0x6a4a('0x46')]);return db[_0x6a4a('0x2f')]['find'](_0x53b374)[_0x6a4a('0x25')](handleEntityNotFound(_0x538416,null))[_0x6a4a('0x25')](respondWithResult(_0x538416,null))[_0x6a4a('0x42')](handleError(_0x538416,null));};exports[_0x6a4a('0x47')]=function(_0x18ac34,_0x5253b3){return db['Template'][_0x6a4a('0x47')](_0x18ac34[_0x6a4a('0x48')],{})[_0x6a4a('0x25')](function(_0x512e14){var _0x268ece=_0x18ac34[_0x6a4a('0x49')][_0x6a4a('0x27')]({'plain':!![]});if(!_0x268ece)throw new Error(_0x6a4a('0x4a'));if(_0x268ece[_0x6a4a('0x4b')]==='user'){var _0x30e3d6=_0x512e14[_0x6a4a('0x27')]({'plain':!![]});var _0xb11858=_0x6a4a('0x28');return db[_0x6a4a('0x4c')][_0x6a4a('0x4d')]({'where':{'name':_0xb11858,'userProfileId':_0x268ece[_0x6a4a('0x4e')]},'raw':!![]})[_0x6a4a('0x25')](function(_0x38d289){if(_0x38d289&&_0x38d289['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x30e3d6[_0x6a4a('0x2c')],'resourceId':_0x30e3d6['id'],'type':_0x38d289[_0x6a4a('0x2c')],'sectionId':_0x38d289['id']},{})[_0x6a4a('0x25')](function(){return _0x512e14;});}else{return _0x512e14;}})[_0x6a4a('0x42')](function(_0x365d53){logger[_0x6a4a('0x2a')](_0x6a4a('0x4f'),_0x365d53);throw _0x365d53;});}return _0x512e14;})[_0x6a4a('0x25')](respondWithResult(_0x5253b3,0xc9))[_0x6a4a('0x42')](handleError(_0x5253b3,null));};exports[_0x6a4a('0x24')]=function(_0x427819,_0x38beab){if(_0x427819['body']['id']){delete _0x427819[_0x6a4a('0x48')]['id'];}return db[_0x6a4a('0x2f')][_0x6a4a('0x4d')]({'where':{'id':_0x427819[_0x6a4a('0x50')]['id']}})[_0x6a4a('0x25')](handleEntityNotFound(_0x38beab,null))[_0x6a4a('0x25')](saveUpdates(_0x427819[_0x6a4a('0x48')],null))[_0x6a4a('0x25')](respondWithResult(_0x38beab,null))['catch'](handleError(_0x38beab,null));};exports[_0x6a4a('0x26')]=function(_0x5e4742,_0x540398){return db[_0x6a4a('0x2f')][_0x6a4a('0x4d')]({'where':{'id':_0x5e4742['params']['id']}})[_0x6a4a('0x25')](handleEntityNotFound(_0x540398,null))[_0x6a4a('0x25')](removeEntity(_0x540398,null))[_0x6a4a('0x42')](handleError(_0x540398,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2983595..e1d9b1d 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 _0xd049=['Template','util','../../config/logger','api','path','rimraf','../../config/environment','exports'];(function(_0x48b41d,_0x2f433f){var _0x10732e=function(_0x506329){while(--_0x506329){_0x48b41d['push'](_0x48b41d['shift']());}};_0x10732e(++_0x2f433f);}(_0xd049,0xb9));var _0x9d04=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd049[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x9d04('0x0'));var logger=require(_0x9d04('0x1'))(_0x9d04('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d04('0x3'));var rimraf=require(_0x9d04('0x4'));var config=require(_0x9d04('0x5'));var attributes=require('./template.attributes');module[_0x9d04('0x6')]=function(_0xb2ebbb,_0x24ea1a){return _0xb2ebbb['define'](_0x9d04('0x7'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x732d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','tools_templates','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x732d,0x135));var _0xd732=function(_0x275e61,_0x54771a){_0x275e61=_0x275e61-0x0;var _0x4bcff0=_0x732d[_0x275e61];return _0x4bcff0;};'use strict';var _=require('lodash');var util=require(_0xd732('0x0'));var logger=require(_0xd732('0x1'))(_0xd732('0x2'));var moment=require(_0xd732('0x3'));var BPromise=require(_0xd732('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd732('0x5'));var rimraf=require(_0xd732('0x6'));var config=require(_0xd732('0x7'));var attributes=require(_0xd732('0x8'));module['exports']=function(_0x438c91,_0x5411ef){return _0x438c91['define']('Template',attributes,{'tableName':_0xd732('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 217e22f..4486c2c 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 _0x3fbe=['info','result','catch','GetTemplate','findAll','options','raw','attributes','include','map','model','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x3fbe,0x176));var _0xe3fb=function(_0x1071fa,_0x5e535c){_0x1071fa=_0x1071fa-0x0;var _0x34abbe=_0x3fbe[_0x1071fa];return _0x34abbe;};'use strict';var _=require(_0xe3fb('0x0'));var util=require(_0xe3fb('0x1'));var moment=require(_0xe3fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3fb('0x4'))['db'];var utils=require(_0xe3fb('0x5'));var logger=require(_0xe3fb('0x6'))(_0xe3fb('0x7'));var config=require(_0xe3fb('0x8'));var jayson=require(_0xe3fb('0x9'));var client=jayson[_0xe3fb('0xa')][_0xe3fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51f690,_0x24c1f6,_0x303c8e){return new BPromise(function(_0x3d58ba,_0x1af9ec){return client[_0xe3fb('0xc')](_0x51f690,_0x303c8e)[_0xe3fb('0xd')](function(_0x1d2db4){logger['info']('Template,\x20%s,\x20%s',_0x24c1f6,_0xe3fb('0xe'));logger[_0xe3fb('0xf')](_0xe3fb('0x10'),_0x24c1f6,_0xe3fb('0xe'),JSON[_0xe3fb('0x11')](_0x1d2db4));if(_0x1d2db4['error']){if(_0x1d2db4[_0xe3fb('0x12')][_0xe3fb('0x13')]===0x1f4){logger['error'](_0xe3fb('0x14'),_0x24c1f6,_0x1d2db4[_0xe3fb('0x12')]['message']);return _0x1af9ec(_0x1d2db4[_0xe3fb('0x12')][_0xe3fb('0x15')]);}logger[_0xe3fb('0x12')](_0xe3fb('0x14'),_0x24c1f6,_0x1d2db4[_0xe3fb('0x12')][_0xe3fb('0x15')]);return _0x3d58ba(_0x1d2db4[_0xe3fb('0x12')][_0xe3fb('0x15')]);}else{logger[_0xe3fb('0x16')](_0xe3fb('0x14'),_0x24c1f6,'request\x20sent');_0x3d58ba(_0x1d2db4[_0xe3fb('0x17')][_0xe3fb('0x15')]);}})[_0xe3fb('0x18')](function(_0x468d3a){logger['error'](_0xe3fb('0x14'),_0x24c1f6,_0x468d3a);_0x1af9ec(_0x468d3a);});});}exports[_0xe3fb('0x19')]=function(_0x2b005f){var _0x22f7d4=this;return new Promise(function(_0x44067d,_0x54dfa4){return db['Template'][_0xe3fb('0x1a')]({'raw':_0x2b005f[_0xe3fb('0x1b')]?_0x2b005f[_0xe3fb('0x1b')][_0xe3fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b005f['options']?_0x2b005f[_0xe3fb('0x1b')]['where']||null:null,'attributes':_0x2b005f[_0xe3fb('0x1b')]?_0x2b005f['options'][_0xe3fb('0x1d')]||null:null,'limit':_0x2b005f['options']?_0x2b005f[_0xe3fb('0x1b')]['limit']||null:null,'include':_0x2b005f['options']?_0x2b005f[_0xe3fb('0x1b')][_0xe3fb('0x1e')]?_[_0xe3fb('0x1f')](_0x2b005f[_0xe3fb('0x1b')][_0xe3fb('0x1e')],function(_0x22fae4){return{'model':db[_0x22fae4[_0xe3fb('0x20')]],'as':_0x22fae4['as'],'attributes':_0x22fae4[_0xe3fb('0x1d')],'include':_0x22fae4[_0xe3fb('0x1e')]?_[_0xe3fb('0x1f')](_0x22fae4[_0xe3fb('0x1e')],function(_0x746f12){return{'model':db[_0x746f12[_0xe3fb('0x20')]],'as':_0x746f12['as'],'attributes':_0x746f12[_0xe3fb('0x1d')],'include':_0x746f12['include']?_[_0xe3fb('0x1f')](_0x746f12[_0xe3fb('0x1e')],function(_0x1e8a41){return{'model':db[_0x1e8a41[_0xe3fb('0x20')]],'as':_0x1e8a41['as'],'attributes':_0x1e8a41[_0xe3fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3fb('0xd')](function(_0x46f9b3){logger[_0xe3fb('0x16')](_0xe3fb('0x19'),_0x2b005f);logger[_0xe3fb('0xf')](_0xe3fb('0x19'),_0x2b005f,JSON[_0xe3fb('0x11')](_0x46f9b3));_0x44067d(_0x46f9b3);})[_0xe3fb('0x18')](function(_0x5e2b10){logger[_0xe3fb('0x12')](_0xe3fb('0x19'),_0x5e2b10[_0xe3fb('0x15')],_0x2b005f);_0x54dfa4(_0x22f7d4[_0xe3fb('0x12')](0x1f4,_0x5e2b10[_0xe3fb('0x15')]));});});}; \ No newline at end of file +var _0x1e2e=['../../config/environment','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetTemplate','findAll','options','where','attributes','limit','include','model','map','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a09d7,_0x7f26e6){var _0x4bd07e=function(_0x239e0f){while(--_0x239e0f){_0x5a09d7['push'](_0x5a09d7['shift']());}};_0x4bd07e(++_0x7f26e6);}(_0x1e2e,0x110));var _0xe1e2=function(_0xe72729,_0x503951){_0xe72729=_0xe72729-0x0;var _0x3f679b=_0x1e2e[_0xe72729];return _0x3f679b;};'use strict';var _=require('lodash');var util=require(_0xe1e2('0x0'));var moment=require(_0xe1e2('0x1'));var BPromise=require(_0xe1e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1e2('0x3'));var db=require(_0xe1e2('0x4'))['db'];var utils=require(_0xe1e2('0x5'));var logger=require(_0xe1e2('0x6'))(_0xe1e2('0x7'));var config=require(_0xe1e2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe1e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x150f7e,_0x768aa5,_0x4e72a0){return new BPromise(function(_0x5dbb45,_0xf5ee2f){return client['request'](_0x150f7e,_0x4e72a0)[_0xe1e2('0xa')](function(_0x306bd9){logger[_0xe1e2('0xb')](_0xe1e2('0xc'),_0x768aa5,_0xe1e2('0xd'));logger[_0xe1e2('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x768aa5,_0xe1e2('0xd'),JSON['stringify'](_0x306bd9));if(_0x306bd9[_0xe1e2('0xf')]){if(_0x306bd9['error']['code']===0x1f4){logger[_0xe1e2('0xf')](_0xe1e2('0xc'),_0x768aa5,_0x306bd9[_0xe1e2('0xf')][_0xe1e2('0x10')]);return _0xf5ee2f(_0x306bd9[_0xe1e2('0xf')][_0xe1e2('0x10')]);}logger['error'](_0xe1e2('0xc'),_0x768aa5,_0x306bd9[_0xe1e2('0xf')][_0xe1e2('0x10')]);return _0x5dbb45(_0x306bd9[_0xe1e2('0xf')][_0xe1e2('0x10')]);}else{logger[_0xe1e2('0xb')](_0xe1e2('0xc'),_0x768aa5,_0xe1e2('0xd'));_0x5dbb45(_0x306bd9[_0xe1e2('0x11')]['message']);}})[_0xe1e2('0x12')](function(_0x3b78fb){logger[_0xe1e2('0xf')](_0xe1e2('0xc'),_0x768aa5,_0x3b78fb);_0xf5ee2f(_0x3b78fb);});});}exports[_0xe1e2('0x13')]=function(_0x334400){var _0x2f5c60=this;return new Promise(function(_0x26380f,_0x1964e3){return db['Template'][_0xe1e2('0x14')]({'raw':_0x334400[_0xe1e2('0x15')]?_0x334400[_0xe1e2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x334400[_0xe1e2('0x15')]?_0x334400[_0xe1e2('0x15')][_0xe1e2('0x16')]||null:null,'attributes':_0x334400['options']?_0x334400[_0xe1e2('0x15')][_0xe1e2('0x17')]||null:null,'limit':_0x334400[_0xe1e2('0x15')]?_0x334400[_0xe1e2('0x15')][_0xe1e2('0x18')]||null:null,'include':_0x334400['options']?_0x334400[_0xe1e2('0x15')][_0xe1e2('0x19')]?_['map'](_0x334400[_0xe1e2('0x15')][_0xe1e2('0x19')],function(_0x1092a4){return{'model':db[_0x1092a4[_0xe1e2('0x1a')]],'as':_0x1092a4['as'],'attributes':_0x1092a4[_0xe1e2('0x17')],'include':_0x1092a4[_0xe1e2('0x19')]?_[_0xe1e2('0x1b')](_0x1092a4[_0xe1e2('0x19')],function(_0x57cd3a){return{'model':db[_0x57cd3a[_0xe1e2('0x1a')]],'as':_0x57cd3a['as'],'attributes':_0x57cd3a['attributes'],'include':_0x57cd3a['include']?_[_0xe1e2('0x1b')](_0x57cd3a['include'],function(_0x19b0e4){return{'model':db[_0x19b0e4['model']],'as':_0x19b0e4['as'],'attributes':_0x19b0e4[_0xe1e2('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe1e2('0xa')](function(_0x2246df){logger[_0xe1e2('0xb')](_0xe1e2('0x13'),_0x334400);logger[_0xe1e2('0xe')]('GetTemplate',_0x334400,JSON['stringify'](_0x2246df));_0x26380f(_0x2246df);})['catch'](function(_0x2f1f18){logger[_0xe1e2('0xf')](_0xe1e2('0x13'),_0x2f1f18['message'],_0x334400);_0x1964e3(_0x2f5c60[_0xe1e2('0xf')](0x1f4,_0x2f1f18[_0xe1e2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 58893f7..09c89aa 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 _0xc217=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','/:id','update','destroy'];(function(_0x9a7777,_0x4857db){var _0x251f70=function(_0xf02e8f){while(--_0xf02e8f){_0x9a7777['push'](_0x9a7777['shift']());}};_0x251f70(++_0x4857db);}(_0xc217,0x15d));var _0x7c21=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xc217[_0x5c4f6b];return _0x104c4e;};'use strict';var multer=require(_0x7c21('0x0'));var util=require('util');var path=require(_0x7c21('0x1'));var timeout=require(_0x7c21('0x2'));var express=require(_0x7c21('0x3'));var router=express[_0x7c21('0x4')]();var fs_extra=require(_0x7c21('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c21('0x6'));var config=require(_0x7c21('0x7'));var controller=require(_0x7c21('0x8'));router[_0x7c21('0x9')]('/',auth[_0x7c21('0xa')](),controller[_0x7c21('0xb')]);router[_0x7c21('0x9')]('/:id',auth[_0x7c21('0xa')](),controller[_0x7c21('0xc')]);router['get'](_0x7c21('0xd'),auth[_0x7c21('0xa')](),controller[_0x7c21('0xe')]);router[_0x7c21('0x9')](_0x7c21('0xf'),auth[_0x7c21('0xa')](),controller[_0x7c21('0x10')]);router['get'](_0x7c21('0x11'),auth['isAuthenticated'](),controller[_0x7c21('0x12')]);router['post']('/',auth[_0x7c21('0xa')](),controller[_0x7c21('0x13')]);router[_0x7c21('0x14')](_0x7c21('0xd'),auth[_0x7c21('0xa')](),controller[_0x7c21('0x15')]);router[_0x7c21('0x14')](_0x7c21('0xf'),auth[_0x7c21('0xa')](),controller[_0x7c21('0x16')]);router[_0x7c21('0x14')]('/:id/actions',auth[_0x7c21('0xa')](),controller[_0x7c21('0x17')]);router[_0x7c21('0x18')](_0x7c21('0x19'),auth[_0x7c21('0xa')](),controller[_0x7c21('0x1a')]);router['delete'](_0x7c21('0x19'),auth['isAuthenticated'](),controller[_0x7c21('0x1b')]);module[_0x7c21('0x1c')]=router; \ No newline at end of file +var _0x7497=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','/:id/all_conditions','addAnyCondition','addAction','put','/:id','update','delete','exports','multer','util','path'];(function(_0xedf42f,_0x3b7ed1){var _0xacd061=function(_0x538123){while(--_0x538123){_0xedf42f['push'](_0xedf42f['shift']());}};_0xacd061(++_0x3b7ed1);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var path=require(_0x7749('0x2'));var timeout=require(_0x7749('0x3'));var express=require(_0x7749('0x4'));var router=express[_0x7749('0x5')]();var fs_extra=require(_0x7749('0x6'));var auth=require(_0x7749('0x7'));var interaction=require(_0x7749('0x8'));var config=require(_0x7749('0x9'));var controller=require(_0x7749('0xa'));router[_0x7749('0xb')]('/',auth[_0x7749('0xc')](),controller[_0x7749('0xd')]);router[_0x7749('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7749('0xe')]);router[_0x7749('0xb')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x7749('0xf')]);router[_0x7749('0xb')](_0x7749('0x10'),auth[_0x7749('0xc')](),controller['getAnyConditions']);router['get'](_0x7749('0x11'),auth['isAuthenticated'](),controller[_0x7749('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7749('0x13')]);router[_0x7749('0x14')](_0x7749('0x15'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0x7749('0x14')](_0x7749('0x10'),auth[_0x7749('0xc')](),controller[_0x7749('0x16')]);router[_0x7749('0x14')]('/:id/actions',auth[_0x7749('0xc')](),controller[_0x7749('0x17')]);router[_0x7749('0x18')](_0x7749('0x19'),auth['isAuthenticated'](),controller[_0x7749('0x1a')]);router[_0x7749('0x1b')](_0x7749('0x19'),auth[_0x7749('0xc')](),controller['destroy']);module[_0x7749('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f6656ac..2c73739 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 _0x27c0=['exports','STRING','sequelize'];(function(_0x491ff0,_0x277637){var _0x2ded36=function(_0x17e378){while(--_0x17e378){_0x491ff0['push'](_0x491ff0['shift']());}};_0x2ded36(++_0x277637);}(_0x27c0,0x1bb));var _0x027c=function(_0xea8f80,_0x16469f){_0xea8f80=_0xea8f80-0x0;var _0x1dfafe=_0x27c0[_0xea8f80];return _0x1dfafe;};'use strict';var Sequelize=require(_0x027c('0x0'));module[_0x027c('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x027c('0x2')]},'description':{'type':Sequelize[_0x027c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa822=['exports','STRING','sequelize'];(function(_0x435e90,_0x58eb7d){var _0x31c168=function(_0x42c646){while(--_0x42c646){_0x435e90['push'](_0x435e90['shift']());}};_0x31c168(++_0x58eb7d);}(_0xa822,0x1c1));var _0x2a82=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xa822[_0x35d4e9];return _0x5c2770;};'use strict';var Sequelize=require(_0x2a82('0x0'));module[_0x2a82('0x1')]={'name':{'type':Sequelize[_0x2a82('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a3c7d2b..d978ac2 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 _0x5db1=['index','map','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Trigger','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','find','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','getActions','findOne','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Triggers','error','name','send'];(function(_0x3bd4e5,_0x33854f){var _0x2d1522=function(_0x37e6df){while(--_0x37e6df){_0x3bd4e5['push'](_0x3bd4e5['shift']());}};_0x2d1522(++_0x33854f);}(_0x5db1,0x149));var _0x15db=function(_0x1bb6d3,_0x4e9cbc){_0x1bb6d3=_0x1bb6d3-0x0;var _0x9cc2e0=_0x5db1[_0x1bb6d3];return _0x9cc2e0;};'use strict';var emlformat=require(_0x15db('0x0'));var rimraf=require(_0x15db('0x1'));var zipdir=require(_0x15db('0x2'));var jsonpatch=require(_0x15db('0x3'));var rp=require('request-promise');var moment=require(_0x15db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15db('0x5'));var util=require(_0x15db('0x6'));var path=require(_0x15db('0x7'));var sox=require(_0x15db('0x8'));var csv=require(_0x15db('0x9'));var ejs=require(_0x15db('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15db('0xb'));var squel=require(_0x15db('0xc'));var crypto=require('crypto');var jsforce=require(_0x15db('0xd'));var deskjs=require(_0x15db('0xe'));var toCsv=require(_0x15db('0x9'));var querystring=require(_0x15db('0xf'));var Papa=require(_0x15db('0x10'));var Redis=require(_0x15db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x15db('0x12'));var as=require(_0x15db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15db('0x14'))(_0x15db('0x15'));var utils=require(_0x15db('0x16'));var config=require(_0x15db('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x15db('0x18'))['db'];function respondWithStatusCode(_0x2d2281,_0xd5cd4e){_0xd5cd4e=_0xd5cd4e||0xcc;return function(_0x2f9ca4){if(_0x2f9ca4){return _0x2d2281[_0x15db('0x19')](_0xd5cd4e);}return _0x2d2281[_0x15db('0x1a')](_0xd5cd4e)[_0x15db('0x1b')]();};}function respondWithResult(_0x475b7b,_0x137389){_0x137389=_0x137389||0xc8;return function(_0x5581a7){if(_0x5581a7){return _0x475b7b['status'](_0x137389)[_0x15db('0x1c')](_0x5581a7);}};}function respondWithFilteredResult(_0x5cb9a1,_0x147e7a){return function(_0x9ef3a9){if(_0x9ef3a9){var _0x37471c=typeof _0x147e7a[_0x15db('0x1d')]===_0x15db('0x1e')&&typeof _0x147e7a[_0x15db('0x1f')]===_0x15db('0x1e');var _0xa89bf2=_0x9ef3a9[_0x15db('0x20')];var _0x5a6617=_0x37471c?0x0:_0x147e7a[_0x15db('0x1d')];var _0x4620dd=_0x37471c?_0x9ef3a9[_0x15db('0x20')]:_0x147e7a[_0x15db('0x1d')]+_0x147e7a[_0x15db('0x1f')];var _0x47fa3e;if(_0x4620dd>=_0xa89bf2){_0x4620dd=_0xa89bf2;_0x47fa3e=0xc8;}else{_0x47fa3e=0xce;}_0x5cb9a1[_0x15db('0x1a')](_0x47fa3e);return _0x5cb9a1[_0x15db('0x21')]('Content-Range',_0x5a6617+'-'+_0x4620dd+'/'+_0xa89bf2)[_0x15db('0x1c')](_0x9ef3a9);}return null;};}function patchUpdates(_0x29438b){return function(_0x410199){try{jsonpatch[_0x15db('0x22')](_0x410199,_0x29438b,!![]);}catch(_0x202b49){return BPromise[_0x15db('0x23')](_0x202b49);}return _0x410199['save']();};}function saveUpdates(_0x3602c4,_0x4ede32){return function(_0xb11a36){if(_0xb11a36){return _0xb11a36['update'](_0x3602c4)[_0x15db('0x24')](function(_0x4d87e9){return _0x4d87e9;});}return null;};}function removeEntity(_0x32430f,_0x1ab669){return function(_0xbb7972){if(_0xbb7972){return _0xbb7972[_0x15db('0x25')]()[_0x15db('0x24')](function(){var _0x5570d5=_0xbb7972[_0x15db('0x26')]({'plain':!![]});var _0x1b9c3b=_0x15db('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b9c3b,'resourceId':_0x5570d5['id']}})[_0x15db('0x24')](function(){return _0xbb7972;});})[_0x15db('0x24')](function(){_0x32430f[_0x15db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7562,_0x112290){return function(_0x7fb6c1){if(!_0x7fb6c1){_0x3a7562[_0x15db('0x19')](0x194);}return _0x7fb6c1;};}function handleError(_0x56351f,_0x13a680){_0x13a680=_0x13a680||0x1f4;return function(_0x1b2eaa){logger[_0x15db('0x28')](_0x1b2eaa['stack']);if(_0x1b2eaa['name']){delete _0x1b2eaa[_0x15db('0x29')];}_0x56351f[_0x15db('0x1a')](_0x13a680)[_0x15db('0x2a')](_0x1b2eaa);};}exports[_0x15db('0x2b')]=function(_0xe317b1,_0x4f1df9){var _0x3359f2={},_0x101e23={},_0x5ddd2e={'count':0x0,'rows':[]};var _0x170571=_[_0x15db('0x2c')](db['Trigger'][_0x15db('0x2d')],function(_0x53fa97){return{'name':_0x53fa97['fieldName'],'type':_0x53fa97[_0x15db('0x2e')][_0x15db('0x2f')]};});_0x101e23['model']=_[_0x15db('0x2c')](_0x170571,_0x15db('0x29'));_0x101e23['query']=_[_0x15db('0x30')](_0xe317b1[_0x15db('0x31')]);_0x101e23[_0x15db('0x32')]=_['intersection'](_0x101e23[_0x15db('0x33')],_0x101e23[_0x15db('0x31')]);_0x3359f2[_0x15db('0x34')]=_[_0x15db('0x35')](_0x101e23[_0x15db('0x33')],qs[_0x15db('0x36')](_0xe317b1[_0x15db('0x31')][_0x15db('0x36')]));_0x3359f2['attributes']=_0x3359f2[_0x15db('0x34')][_0x15db('0x37')]?_0x3359f2[_0x15db('0x34')]:_0x101e23[_0x15db('0x33')];if(!_0xe317b1['query'][_0x15db('0x38')](_0x15db('0x39'))){_0x3359f2['limit']=qs[_0x15db('0x1f')](_0xe317b1['query'][_0x15db('0x1f')]);_0x3359f2['offset']=qs['offset'](_0xe317b1['query'][_0x15db('0x1d')]);}_0x3359f2[_0x15db('0x3a')]=qs[_0x15db('0x3b')](_0xe317b1[_0x15db('0x31')][_0x15db('0x3b')]);_0x3359f2[_0x15db('0x3c')]=qs[_0x15db('0x32')](_[_0x15db('0x3d')](_0xe317b1['query'],_0x101e23[_0x15db('0x32')]),_0x170571);if(_0xe317b1['query'][_0x15db('0x3e')]){_0x3359f2[_0x15db('0x3c')]=_['merge'](_0x3359f2['where'],{'$or':_[_0x15db('0x2c')](_0x170571,function(_0x3a3c45){if(_0x3a3c45['type']!==_0x15db('0x3f')){var _0x46d553={};_0x46d553[_0x3a3c45[_0x15db('0x29')]]={'$like':'%'+_0xe317b1[_0x15db('0x31')][_0x15db('0x3e')]+'%'};return _0x46d553;}})});}_0x3359f2=_[_0x15db('0x40')]({},_0x3359f2,_0xe317b1[_0x15db('0x41')]);var _0x4a0334={'where':_0x3359f2['where']};return db[_0x15db('0x42')]['count'](_0x4a0334)['then'](function(_0x430cae){_0x5ddd2e[_0x15db('0x20')]=_0x430cae;if(_0xe317b1['query'][_0x15db('0x43')]){_0x3359f2[_0x15db('0x44')]=[{'all':!![]}];}return db[_0x15db('0x42')][_0x15db('0x45')](_0x3359f2);})['then'](function(_0x1c30e2){_0x5ddd2e[_0x15db('0x46')]=_0x1c30e2;return _0x5ddd2e;})['then'](respondWithFilteredResult(_0x4f1df9,_0x3359f2))[_0x15db('0x47')](handleError(_0x4f1df9,null));};exports[_0x15db('0x48')]=function(_0x451d40,_0x2690bf){var _0xf9396a={'raw':![],'where':{'id':_0x451d40[_0x15db('0x49')]['id']}},_0x49c5fb={};_0x49c5fb[_0x15db('0x33')]=_[_0x15db('0x30')](db['Trigger']['rawAttributes']);_0x49c5fb[_0x15db('0x31')]=_[_0x15db('0x30')](_0x451d40[_0x15db('0x31')]);_0x49c5fb[_0x15db('0x32')]=_[_0x15db('0x35')](_0x49c5fb[_0x15db('0x33')],_0x49c5fb[_0x15db('0x31')]);_0xf9396a[_0x15db('0x34')]=_[_0x15db('0x35')](_0x49c5fb[_0x15db('0x33')],qs[_0x15db('0x36')](_0x451d40[_0x15db('0x31')]['fields']));_0xf9396a['attributes']=_0xf9396a[_0x15db('0x34')]['length']?_0xf9396a[_0x15db('0x34')]:_0x49c5fb[_0x15db('0x33')];if(_0x451d40[_0x15db('0x31')][_0x15db('0x43')]){_0xf9396a[_0x15db('0x44')]=[{'all':!![]}];}_0xf9396a=_[_0x15db('0x40')]({},_0xf9396a,_0x451d40[_0x15db('0x41')]);return db[_0x15db('0x42')]['find'](_0xf9396a)['then'](handleEntityNotFound(_0x2690bf,null))[_0x15db('0x24')](respondWithResult(_0x2690bf,null))[_0x15db('0x47')](handleError(_0x2690bf,null));};exports[_0x15db('0x4a')]=function(_0x547a83,_0x41f985){return db[_0x15db('0x42')][_0x15db('0x4a')](_0x547a83[_0x15db('0x4b')],{})[_0x15db('0x24')](function(_0x3337d0){var _0x16e02f=_0x547a83[_0x15db('0x4c')][_0x15db('0x26')]({'plain':!![]});if(!_0x16e02f)throw new Error(_0x15db('0x4d'));if(_0x16e02f[_0x15db('0x4e')]===_0x15db('0x4c')){var _0x1c98bc=_0x3337d0[_0x15db('0x26')]({'plain':!![]});var _0x299eaf=_0x15db('0x27');return db[_0x15db('0x4f')]['find']({'where':{'name':_0x299eaf,'userProfileId':_0x16e02f[_0x15db('0x50')]},'raw':!![]})[_0x15db('0x24')](function(_0x3fdf41){if(_0x3fdf41&&_0x3fdf41[_0x15db('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c98bc[_0x15db('0x29')],'resourceId':_0x1c98bc['id'],'type':_0x3fdf41[_0x15db('0x29')],'sectionId':_0x3fdf41['id']},{})[_0x15db('0x24')](function(){return _0x3337d0;});}else{return _0x3337d0;}})['catch'](function(_0x3392f3){logger[_0x15db('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3392f3);throw _0x3392f3;});}return _0x3337d0;})['then'](respondWithResult(_0x41f985,0xc9))['catch'](handleError(_0x41f985,null));};exports[_0x15db('0x52')]=function(_0x331d5f,_0x152891){if(_0x331d5f[_0x15db('0x4b')]['id']){delete _0x331d5f[_0x15db('0x4b')]['id'];}return db[_0x15db('0x42')][_0x15db('0x53')]({'where':{'id':_0x331d5f[_0x15db('0x49')]['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x152891,null))['then'](saveUpdates(_0x331d5f[_0x15db('0x4b')],null))[_0x15db('0x24')](respondWithResult(_0x152891,null))[_0x15db('0x47')](handleError(_0x152891,null));};exports[_0x15db('0x25')]=function(_0x3a01f5,_0x148c34){return db[_0x15db('0x42')][_0x15db('0x53')]({'where':{'id':_0x3a01f5[_0x15db('0x49')]['id']}})['then'](handleEntityNotFound(_0x148c34,null))['then'](removeEntity(_0x148c34,null))[_0x15db('0x47')](handleError(_0x148c34,null));};exports[_0x15db('0x54')]=function(_0xb43fbf,_0x4c80a9,_0x162827){if(_0xb43fbf[_0x15db('0x4b')]['id']){delete _0xb43fbf[_0x15db('0x4b')]['id'];}return db[_0x15db('0x42')][_0x15db('0x53')]({'where':{'id':_0xb43fbf[_0x15db('0x49')]['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x4c80a9,null))[_0x15db('0x24')](function(_0x452a2e){if(_0x452a2e){_0xb43fbf['body']['TriggerAllId']=_0x452a2e['id'];return db[_0x15db('0x55')]['create'](_0xb43fbf[_0x15db('0x4b')]);}})['then'](respondWithResult(_0x4c80a9,null))[_0x15db('0x47')](handleError(_0x4c80a9,null));};exports[_0x15db('0x56')]=function(_0x1ebb22,_0x14e9ce,_0x503d63){if(_0x1ebb22[_0x15db('0x4b')]['id']){delete _0x1ebb22[_0x15db('0x4b')]['id'];}return db['Trigger'][_0x15db('0x53')]({'where':{'id':_0x1ebb22[_0x15db('0x49')]['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x14e9ce,null))[_0x15db('0x24')](function(_0x46ca9f){if(_0x46ca9f){_0x1ebb22[_0x15db('0x4b')][_0x15db('0x57')]=_0x46ca9f['id'];return db[_0x15db('0x55')]['create'](_0x1ebb22[_0x15db('0x4b')]);}})[_0x15db('0x24')](respondWithResult(_0x14e9ce,null))[_0x15db('0x47')](handleError(_0x14e9ce,null));};exports[_0x15db('0x58')]=function(_0x48adf7,_0x228ca1,_0x24fb2d){var _0x1ae767={};var _0x2825d8={};var _0x25f5a0;var _0x225563;return db[_0x15db('0x42')]['findOne']({'where':{'id':_0x48adf7['params']['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x228ca1,null))[_0x15db('0x24')](function(_0x5a30aa){if(_0x5a30aa){_0x25f5a0=_0x5a30aa;_0x2825d8[_0x15db('0x33')]=_[_0x15db('0x30')](db[_0x15db('0x55')][_0x15db('0x2d')]);_0x2825d8[_0x15db('0x31')]=_[_0x15db('0x30')](_0x48adf7[_0x15db('0x31')]);_0x2825d8['filters']=_[_0x15db('0x35')](_0x2825d8[_0x15db('0x33')],_0x2825d8[_0x15db('0x31')]);_0x1ae767['attributes']=_[_0x15db('0x35')](_0x2825d8[_0x15db('0x33')],qs[_0x15db('0x36')](_0x48adf7[_0x15db('0x31')][_0x15db('0x36')]));_0x1ae767[_0x15db('0x34')]=_0x1ae767['attributes'][_0x15db('0x37')]?_0x1ae767[_0x15db('0x34')]:_0x2825d8[_0x15db('0x33')];_0x1ae767[_0x15db('0x3a')]=qs[_0x15db('0x3b')](_0x48adf7['query'][_0x15db('0x3b')]);_0x1ae767[_0x15db('0x3c')]=qs[_0x15db('0x32')](_[_0x15db('0x3d')](_0x48adf7['query'],_0x2825d8[_0x15db('0x32')]));if(_0x48adf7[_0x15db('0x31')][_0x15db('0x3e')]){_0x1ae767['where']=_[_0x15db('0x40')](_0x1ae767[_0x15db('0x3c')],{'$or':_[_0x15db('0x2c')](_0x1ae767['attributes'],function(_0x1d5721){var _0x2a46b3={};_0x2a46b3[_0x1d5721]={'$like':'%'+_0x48adf7[_0x15db('0x31')][_0x15db('0x3e')]+'%'};return _0x2a46b3;})});}_0x1ae767=_[_0x15db('0x40')]({},_0x1ae767,_0x48adf7[_0x15db('0x41')]);return _0x25f5a0[_0x15db('0x58')](_0x1ae767);}})[_0x15db('0x24')](function(_0xbc159d){if(_0xbc159d){_0x225563=_0xbc159d[_0x15db('0x37')];if(!_0x48adf7[_0x15db('0x31')]['hasOwnProperty'](_0x15db('0x39'))){_0x1ae767['limit']=qs[_0x15db('0x1f')](_0x48adf7[_0x15db('0x31')][_0x15db('0x1f')]);_0x1ae767[_0x15db('0x1d')]=qs[_0x15db('0x1d')](_0x48adf7[_0x15db('0x31')][_0x15db('0x1d')]);}return _0x25f5a0[_0x15db('0x58')](_0x1ae767);}})[_0x15db('0x24')](function(_0x5697b1){if(_0x5697b1){return _0x5697b1?{'count':_0x225563,'rows':_0x5697b1}:null;}})[_0x15db('0x24')](respondWithResult(_0x228ca1,null))['catch'](handleError(_0x228ca1,null));};exports[_0x15db('0x59')]=function(_0x1e6fca,_0x59738f,_0x3a25b7){var _0x753cc2={};var _0x25496d={};var _0x4daba5;var _0x398afd;return db['Trigger']['findOne']({'where':{'id':_0x1e6fca['params']['id']}})['then'](handleEntityNotFound(_0x59738f,null))[_0x15db('0x24')](function(_0x2876b1){if(_0x2876b1){_0x4daba5=_0x2876b1;_0x25496d[_0x15db('0x33')]=_['keys'](db[_0x15db('0x55')]['rawAttributes']);_0x25496d[_0x15db('0x31')]=_[_0x15db('0x30')](_0x1e6fca[_0x15db('0x31')]);_0x25496d[_0x15db('0x32')]=_[_0x15db('0x35')](_0x25496d[_0x15db('0x33')],_0x25496d[_0x15db('0x31')]);_0x753cc2[_0x15db('0x34')]=_[_0x15db('0x35')](_0x25496d[_0x15db('0x33')],qs[_0x15db('0x36')](_0x1e6fca[_0x15db('0x31')][_0x15db('0x36')]));_0x753cc2[_0x15db('0x34')]=_0x753cc2[_0x15db('0x34')][_0x15db('0x37')]?_0x753cc2[_0x15db('0x34')]:_0x25496d[_0x15db('0x33')];_0x753cc2[_0x15db('0x3a')]=qs['sort'](_0x1e6fca[_0x15db('0x31')][_0x15db('0x3b')]);_0x753cc2[_0x15db('0x3c')]=qs[_0x15db('0x32')](_[_0x15db('0x3d')](_0x1e6fca[_0x15db('0x31')],_0x25496d[_0x15db('0x32')]));if(_0x1e6fca[_0x15db('0x31')][_0x15db('0x3e')]){_0x753cc2[_0x15db('0x3c')]=_[_0x15db('0x40')](_0x753cc2[_0x15db('0x3c')],{'$or':_[_0x15db('0x2c')](_0x753cc2[_0x15db('0x34')],function(_0x55d8e1){var _0x3e4e3e={};_0x3e4e3e[_0x55d8e1]={'$like':'%'+_0x1e6fca[_0x15db('0x31')][_0x15db('0x3e')]+'%'};return _0x3e4e3e;})});}_0x753cc2=_[_0x15db('0x40')]({},_0x753cc2,_0x1e6fca[_0x15db('0x41')]);return _0x4daba5[_0x15db('0x59')](_0x753cc2);}})[_0x15db('0x24')](function(_0x39bc32){if(_0x39bc32){_0x398afd=_0x39bc32[_0x15db('0x37')];if(!_0x1e6fca[_0x15db('0x31')][_0x15db('0x38')](_0x15db('0x39'))){_0x753cc2[_0x15db('0x1f')]=qs[_0x15db('0x1f')](_0x1e6fca[_0x15db('0x31')]['limit']);_0x753cc2[_0x15db('0x1d')]=qs[_0x15db('0x1d')](_0x1e6fca[_0x15db('0x31')]['offset']);}return _0x4daba5[_0x15db('0x59')](_0x753cc2);}})[_0x15db('0x24')](function(_0x28532e){if(_0x28532e){return _0x28532e?{'count':_0x398afd,'rows':_0x28532e}:null;}})[_0x15db('0x24')](respondWithResult(_0x59738f,null))[_0x15db('0x47')](handleError(_0x59738f,null));};exports['addAction']=function(_0xbaa667,_0x3cb7de,_0x3f1a0e){if(_0xbaa667[_0x15db('0x4b')]['id']){delete _0xbaa667[_0x15db('0x4b')]['id'];}return db[_0x15db('0x42')][_0x15db('0x53')]({'where':{'id':_0xbaa667[_0x15db('0x49')]['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x3cb7de,null))['then'](function(_0xe99bb4){if(_0xe99bb4){_0xbaa667[_0x15db('0x4b')]['TriggerId']=_0xe99bb4['id'];return db['Action']['create'](_0xbaa667[_0x15db('0x4b')]);}})[_0x15db('0x24')](respondWithResult(_0x3cb7de,null))['catch'](handleError(_0x3cb7de,null));};exports[_0x15db('0x5a')]=function(_0x3c305f,_0x18da3e,_0x4056e6){var _0x5e4eda={};var _0x3c5c5e={};var _0x5dedbd;var _0x1312ff;return db['Trigger'][_0x15db('0x5b')]({'where':{'id':_0x3c305f['params']['id']}})[_0x15db('0x24')](handleEntityNotFound(_0x18da3e,null))[_0x15db('0x24')](function(_0x4c90cd){if(_0x4c90cd){_0x5dedbd=_0x4c90cd;_0x3c5c5e['model']=_['keys'](db[_0x15db('0x5c')][_0x15db('0x2d')]);_0x3c5c5e[_0x15db('0x31')]=_[_0x15db('0x30')](_0x3c305f['query']);_0x3c5c5e[_0x15db('0x32')]=_[_0x15db('0x35')](_0x3c5c5e[_0x15db('0x33')],_0x3c5c5e[_0x15db('0x31')]);_0x5e4eda['attributes']=_[_0x15db('0x35')](_0x3c5c5e['model'],qs[_0x15db('0x36')](_0x3c305f[_0x15db('0x31')][_0x15db('0x36')]));_0x5e4eda[_0x15db('0x34')]=_0x5e4eda[_0x15db('0x34')][_0x15db('0x37')]?_0x5e4eda[_0x15db('0x34')]:_0x3c5c5e[_0x15db('0x33')];_0x5e4eda['order']=qs['sort'](_0x3c305f[_0x15db('0x31')][_0x15db('0x3b')]);_0x5e4eda[_0x15db('0x3c')]=qs[_0x15db('0x32')](_['pick'](_0x3c305f['query'],_0x3c5c5e[_0x15db('0x32')]));if(_0x3c305f['query'][_0x15db('0x3e')]){_0x5e4eda[_0x15db('0x3c')]=_[_0x15db('0x40')](_0x5e4eda[_0x15db('0x3c')],{'$or':_[_0x15db('0x2c')](_0x5e4eda[_0x15db('0x34')],function(_0x54d07e){var _0x5f147d={};_0x5f147d[_0x54d07e]={'$like':'%'+_0x3c305f[_0x15db('0x31')][_0x15db('0x3e')]+'%'};return _0x5f147d;})});}_0x5e4eda=_[_0x15db('0x40')]({},_0x5e4eda,_0x3c305f['options']);return _0x5dedbd[_0x15db('0x5a')](_0x5e4eda);}})[_0x15db('0x24')](function(_0x3247b9){if(_0x3247b9){_0x1312ff=_0x3247b9['length'];if(!_0x3c305f[_0x15db('0x31')][_0x15db('0x38')](_0x15db('0x39'))){_0x5e4eda[_0x15db('0x1f')]=qs[_0x15db('0x1f')](_0x3c305f[_0x15db('0x31')][_0x15db('0x1f')]);_0x5e4eda[_0x15db('0x1d')]=qs[_0x15db('0x1d')](_0x3c305f['query'][_0x15db('0x1d')]);}return _0x5dedbd['getActions'](_0x5e4eda);}})[_0x15db('0x24')](function(_0x4342b5){if(_0x4342b5){return _0x4342b5?{'count':_0x1312ff,'rows':_0x4342b5}:null;}})[_0x15db('0x24')](respondWithResult(_0x18da3e,null))[_0x15db('0x47')](handleError(_0x18da3e,null));}; \ No newline at end of file +var _0x7dd8=['findOne','nolimit','getAnyConditions','addAction','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','get','Triggers','destroy','error','name','index','map','Trigger','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions'];(function(_0x12efa0,_0x579590){var _0x158c02=function(_0x311422){while(--_0x311422){_0x12efa0['push'](_0x12efa0['shift']());}};_0x158c02(++_0x579590);}(_0x7dd8,0x17a));var _0x87dd=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x7dd8[_0x515afd];return _0x536d53;};'use strict';var emlformat=require(_0x87dd('0x0'));var rimraf=require(_0x87dd('0x1'));var zipdir=require(_0x87dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87dd('0x3'));var moment=require(_0x87dd('0x4'));var BPromise=require(_0x87dd('0x5'));var Mustache=require(_0x87dd('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x87dd('0x7'));var ejs=require(_0x87dd('0x8'));var fs=require('fs');var fs_extra=require(_0x87dd('0x9'));var _=require(_0x87dd('0xa'));var squel=require('squel');var crypto=require(_0x87dd('0xb'));var jsforce=require(_0x87dd('0xc'));var deskjs=require(_0x87dd('0xd'));var toCsv=require(_0x87dd('0x7'));var querystring=require(_0x87dd('0xe'));var Papa=require(_0x87dd('0xf'));var Redis=require(_0x87dd('0x10'));var authService=require(_0x87dd('0x11'));var qs=require(_0x87dd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87dd('0x13'));var logger=require(_0x87dd('0x14'))(_0x87dd('0x15'));var utils=require(_0x87dd('0x16'));var config=require(_0x87dd('0x17'));var licenseUtil=require(_0x87dd('0x18'));var db=require(_0x87dd('0x19'))['db'];function respondWithStatusCode(_0x4c8979,_0x3f8290){_0x3f8290=_0x3f8290||0xcc;return function(_0x4fc466){if(_0x4fc466){return _0x4c8979[_0x87dd('0x1a')](_0x3f8290);}return _0x4c8979[_0x87dd('0x1b')](_0x3f8290)['end']();};}function respondWithResult(_0x481e7f,_0x2eaf7c){_0x2eaf7c=_0x2eaf7c||0xc8;return function(_0xc11396){if(_0xc11396){return _0x481e7f[_0x87dd('0x1b')](_0x2eaf7c)['json'](_0xc11396);}};}function respondWithFilteredResult(_0x495b66,_0x2a2fbd){return function(_0x25c8af){if(_0x25c8af){var _0x499cf5=typeof _0x2a2fbd[_0x87dd('0x1c')]===_0x87dd('0x1d')&&typeof _0x2a2fbd[_0x87dd('0x1e')]===_0x87dd('0x1d');var _0x1a47a7=_0x25c8af['count'];var _0x2ad270=_0x499cf5?0x0:_0x2a2fbd['offset'];var _0xdbcdaa=_0x499cf5?_0x25c8af[_0x87dd('0x1f')]:_0x2a2fbd[_0x87dd('0x1c')]+_0x2a2fbd[_0x87dd('0x1e')];var _0x27a71b;if(_0xdbcdaa>=_0x1a47a7){_0xdbcdaa=_0x1a47a7;_0x27a71b=0xc8;}else{_0x27a71b=0xce;}_0x495b66[_0x87dd('0x1b')](_0x27a71b);return _0x495b66[_0x87dd('0x20')]('Content-Range',_0x2ad270+'-'+_0xdbcdaa+'/'+_0x1a47a7)[_0x87dd('0x21')](_0x25c8af);}return null;};}function patchUpdates(_0x1dfb03){return function(_0x1b14c0){try{jsonpatch['apply'](_0x1b14c0,_0x1dfb03,!![]);}catch(_0x4b251c){return BPromise[_0x87dd('0x22')](_0x4b251c);}return _0x1b14c0[_0x87dd('0x23')]();};}function saveUpdates(_0x40ca8a,_0xcf6547){return function(_0x2e5855){if(_0x2e5855){return _0x2e5855[_0x87dd('0x24')](_0x40ca8a)['then'](function(_0x2e3a47){return _0x2e3a47;});}return null;};}function removeEntity(_0x56b32f,_0x4b5de3){return function(_0xf8c991){if(_0xf8c991){return _0xf8c991['destroy']()[_0x87dd('0x25')](function(){var _0x68515=_0xf8c991[_0x87dd('0x26')]({'plain':!![]});var _0x307ba4=_0x87dd('0x27');return db['UserProfileResource'][_0x87dd('0x28')]({'where':{'type':_0x307ba4,'resourceId':_0x68515['id']}})[_0x87dd('0x25')](function(){return _0xf8c991;});})['then'](function(){_0x56b32f[_0x87dd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150529,_0x3f0586){return function(_0x1d6bb6){if(!_0x1d6bb6){_0x150529[_0x87dd('0x1a')](0x194);}return _0x1d6bb6;};}function handleError(_0x2621c0,_0x42a44d){_0x42a44d=_0x42a44d||0x1f4;return function(_0xf7437e){logger[_0x87dd('0x29')](_0xf7437e['stack']);if(_0xf7437e[_0x87dd('0x2a')]){delete _0xf7437e[_0x87dd('0x2a')];}_0x2621c0[_0x87dd('0x1b')](_0x42a44d)['send'](_0xf7437e);};}exports[_0x87dd('0x2b')]=function(_0x1c1492,_0x1cdfe9){var _0x2673f2={},_0x5874c6={},_0x31f27b={'count':0x0,'rows':[]};var _0x4bb513=_[_0x87dd('0x2c')](db[_0x87dd('0x2d')][_0x87dd('0x2e')],function(_0x56de83){return{'name':_0x56de83[_0x87dd('0x2f')],'type':_0x56de83[_0x87dd('0x30')]['key']};});_0x5874c6['model']=_[_0x87dd('0x2c')](_0x4bb513,'name');_0x5874c6[_0x87dd('0x31')]=_[_0x87dd('0x32')](_0x1c1492[_0x87dd('0x31')]);_0x5874c6[_0x87dd('0x33')]=_[_0x87dd('0x34')](_0x5874c6[_0x87dd('0x35')],_0x5874c6[_0x87dd('0x31')]);_0x2673f2[_0x87dd('0x36')]=_[_0x87dd('0x34')](_0x5874c6[_0x87dd('0x35')],qs[_0x87dd('0x37')](_0x1c1492['query']['fields']));_0x2673f2['attributes']=_0x2673f2[_0x87dd('0x36')][_0x87dd('0x38')]?_0x2673f2[_0x87dd('0x36')]:_0x5874c6[_0x87dd('0x35')];if(!_0x1c1492[_0x87dd('0x31')][_0x87dd('0x39')]('nolimit')){_0x2673f2['limit']=qs[_0x87dd('0x1e')](_0x1c1492[_0x87dd('0x31')][_0x87dd('0x1e')]);_0x2673f2['offset']=qs[_0x87dd('0x1c')](_0x1c1492[_0x87dd('0x31')][_0x87dd('0x1c')]);}_0x2673f2[_0x87dd('0x3a')]=qs['sort'](_0x1c1492['query'][_0x87dd('0x3b')]);_0x2673f2[_0x87dd('0x3c')]=qs[_0x87dd('0x33')](_[_0x87dd('0x3d')](_0x1c1492[_0x87dd('0x31')],_0x5874c6[_0x87dd('0x33')]),_0x4bb513);if(_0x1c1492[_0x87dd('0x31')][_0x87dd('0x3e')]){_0x2673f2[_0x87dd('0x3c')]=_[_0x87dd('0x3f')](_0x2673f2[_0x87dd('0x3c')],{'$or':_['map'](_0x4bb513,function(_0x2c5d31){if(_0x2c5d31[_0x87dd('0x30')]!==_0x87dd('0x40')){var _0xcca45={};_0xcca45[_0x2c5d31['name']]={'$like':'%'+_0x1c1492[_0x87dd('0x31')]['filter']+'%'};return _0xcca45;}})});}_0x2673f2=_['merge']({},_0x2673f2,_0x1c1492[_0x87dd('0x41')]);var _0x39beb9={'where':_0x2673f2[_0x87dd('0x3c')]};return db[_0x87dd('0x2d')][_0x87dd('0x1f')](_0x39beb9)['then'](function(_0x4e5e75){_0x31f27b['count']=_0x4e5e75;if(_0x1c1492[_0x87dd('0x31')][_0x87dd('0x42')]){_0x2673f2['include']=[{'all':!![]}];}return db[_0x87dd('0x2d')][_0x87dd('0x43')](_0x2673f2);})[_0x87dd('0x25')](function(_0x55a40b){_0x31f27b[_0x87dd('0x44')]=_0x55a40b;return _0x31f27b;})[_0x87dd('0x25')](respondWithFilteredResult(_0x1cdfe9,_0x2673f2))[_0x87dd('0x45')](handleError(_0x1cdfe9,null));};exports[_0x87dd('0x46')]=function(_0x17a9a5,_0x9c5731){var _0x319860={'raw':![],'where':{'id':_0x17a9a5[_0x87dd('0x47')]['id']}},_0x1b3a3c={};_0x1b3a3c[_0x87dd('0x35')]=_[_0x87dd('0x32')](db[_0x87dd('0x2d')]['rawAttributes']);_0x1b3a3c[_0x87dd('0x31')]=_[_0x87dd('0x32')](_0x17a9a5[_0x87dd('0x31')]);_0x1b3a3c[_0x87dd('0x33')]=_[_0x87dd('0x34')](_0x1b3a3c[_0x87dd('0x35')],_0x1b3a3c[_0x87dd('0x31')]);_0x319860[_0x87dd('0x36')]=_[_0x87dd('0x34')](_0x1b3a3c['model'],qs[_0x87dd('0x37')](_0x17a9a5[_0x87dd('0x31')]['fields']));_0x319860[_0x87dd('0x36')]=_0x319860[_0x87dd('0x36')][_0x87dd('0x38')]?_0x319860['attributes']:_0x1b3a3c['model'];if(_0x17a9a5['query'][_0x87dd('0x42')]){_0x319860['include']=[{'all':!![]}];}_0x319860=_['merge']({},_0x319860,_0x17a9a5[_0x87dd('0x41')]);return db['Trigger'][_0x87dd('0x48')](_0x319860)[_0x87dd('0x25')](handleEntityNotFound(_0x9c5731,null))[_0x87dd('0x25')](respondWithResult(_0x9c5731,null))['catch'](handleError(_0x9c5731,null));};exports[_0x87dd('0x49')]=function(_0x26ca17,_0x594cd5){return db['Trigger'][_0x87dd('0x49')](_0x26ca17[_0x87dd('0x4a')],{})[_0x87dd('0x25')](function(_0x4114f1){var _0x25f9c1=_0x26ca17[_0x87dd('0x4b')][_0x87dd('0x26')]({'plain':!![]});if(!_0x25f9c1)throw new Error(_0x87dd('0x4c'));if(_0x25f9c1[_0x87dd('0x4d')]===_0x87dd('0x4b')){var _0x55d0c6=_0x4114f1[_0x87dd('0x26')]({'plain':!![]});var _0x1c7ebd=_0x87dd('0x27');return db['UserProfileSection'][_0x87dd('0x48')]({'where':{'name':_0x1c7ebd,'userProfileId':_0x25f9c1[_0x87dd('0x4e')]},'raw':!![]})[_0x87dd('0x25')](function(_0x4d136e){if(_0x4d136e&&_0x4d136e[_0x87dd('0x4f')]===0x0){return db[_0x87dd('0x50')]['create']({'name':_0x55d0c6[_0x87dd('0x2a')],'resourceId':_0x55d0c6['id'],'type':_0x4d136e[_0x87dd('0x2a')],'sectionId':_0x4d136e['id']},{})[_0x87dd('0x25')](function(){return _0x4114f1;});}else{return _0x4114f1;}})[_0x87dd('0x45')](function(_0x5d3fcf){logger[_0x87dd('0x29')](_0x87dd('0x51'),_0x5d3fcf);throw _0x5d3fcf;});}return _0x4114f1;})[_0x87dd('0x25')](respondWithResult(_0x594cd5,0xc9))[_0x87dd('0x45')](handleError(_0x594cd5,null));};exports[_0x87dd('0x24')]=function(_0x1d83b8,_0x52f693){if(_0x1d83b8['body']['id']){delete _0x1d83b8['body']['id'];}return db[_0x87dd('0x2d')]['find']({'where':{'id':_0x1d83b8[_0x87dd('0x47')]['id']}})[_0x87dd('0x25')](handleEntityNotFound(_0x52f693,null))[_0x87dd('0x25')](saveUpdates(_0x1d83b8[_0x87dd('0x4a')],null))['then'](respondWithResult(_0x52f693,null))[_0x87dd('0x45')](handleError(_0x52f693,null));};exports['destroy']=function(_0x45a0d9,_0x43f45c){return db[_0x87dd('0x2d')][_0x87dd('0x48')]({'where':{'id':_0x45a0d9['params']['id']}})[_0x87dd('0x25')](handleEntityNotFound(_0x43f45c,null))['then'](removeEntity(_0x43f45c,null))['catch'](handleError(_0x43f45c,null));};exports[_0x87dd('0x52')]=function(_0x4a3436,_0x3bb46d,_0x17edb6){if(_0x4a3436['body']['id']){delete _0x4a3436[_0x87dd('0x4a')]['id'];}return db['Trigger'][_0x87dd('0x48')]({'where':{'id':_0x4a3436['params']['id']}})[_0x87dd('0x25')](handleEntityNotFound(_0x3bb46d,null))[_0x87dd('0x25')](function(_0xdbfe7d){if(_0xdbfe7d){_0x4a3436['body']['TriggerAllId']=_0xdbfe7d['id'];return db[_0x87dd('0x53')]['create'](_0x4a3436[_0x87dd('0x4a')]);}})[_0x87dd('0x25')](respondWithResult(_0x3bb46d,null))[_0x87dd('0x45')](handleError(_0x3bb46d,null));};exports[_0x87dd('0x54')]=function(_0x4bbacc,_0x20ec21,_0x3f526f){if(_0x4bbacc[_0x87dd('0x4a')]['id']){delete _0x4bbacc[_0x87dd('0x4a')]['id'];}return db[_0x87dd('0x2d')][_0x87dd('0x48')]({'where':{'id':_0x4bbacc[_0x87dd('0x47')]['id']}})[_0x87dd('0x25')](handleEntityNotFound(_0x20ec21,null))['then'](function(_0x1eec82){if(_0x1eec82){_0x4bbacc[_0x87dd('0x4a')][_0x87dd('0x55')]=_0x1eec82['id'];return db[_0x87dd('0x53')][_0x87dd('0x49')](_0x4bbacc[_0x87dd('0x4a')]);}})['then'](respondWithResult(_0x20ec21,null))['catch'](handleError(_0x20ec21,null));};exports[_0x87dd('0x56')]=function(_0x15df71,_0x532eb2,_0x506057){var _0x237439={};var _0x12e1e9={};var _0x22201a;var _0x223c23;return db[_0x87dd('0x2d')][_0x87dd('0x57')]({'where':{'id':_0x15df71['params']['id']}})['then'](handleEntityNotFound(_0x532eb2,null))['then'](function(_0x35ded3){if(_0x35ded3){_0x22201a=_0x35ded3;_0x12e1e9['model']=_[_0x87dd('0x32')](db[_0x87dd('0x53')][_0x87dd('0x2e')]);_0x12e1e9[_0x87dd('0x31')]=_[_0x87dd('0x32')](_0x15df71[_0x87dd('0x31')]);_0x12e1e9[_0x87dd('0x33')]=_[_0x87dd('0x34')](_0x12e1e9[_0x87dd('0x35')],_0x12e1e9[_0x87dd('0x31')]);_0x237439[_0x87dd('0x36')]=_[_0x87dd('0x34')](_0x12e1e9['model'],qs['fields'](_0x15df71[_0x87dd('0x31')][_0x87dd('0x37')]));_0x237439['attributes']=_0x237439[_0x87dd('0x36')][_0x87dd('0x38')]?_0x237439['attributes']:_0x12e1e9['model'];_0x237439[_0x87dd('0x3a')]=qs[_0x87dd('0x3b')](_0x15df71[_0x87dd('0x31')][_0x87dd('0x3b')]);_0x237439[_0x87dd('0x3c')]=qs[_0x87dd('0x33')](_['pick'](_0x15df71[_0x87dd('0x31')],_0x12e1e9[_0x87dd('0x33')]));if(_0x15df71[_0x87dd('0x31')][_0x87dd('0x3e')]){_0x237439[_0x87dd('0x3c')]=_[_0x87dd('0x3f')](_0x237439[_0x87dd('0x3c')],{'$or':_[_0x87dd('0x2c')](_0x237439['attributes'],function(_0x4b9982){var _0x5e285e={};_0x5e285e[_0x4b9982]={'$like':'%'+_0x15df71[_0x87dd('0x31')][_0x87dd('0x3e')]+'%'};return _0x5e285e;})});}_0x237439=_[_0x87dd('0x3f')]({},_0x237439,_0x15df71[_0x87dd('0x41')]);return _0x22201a['getAllConditions'](_0x237439);}})['then'](function(_0x52aeae){if(_0x52aeae){_0x223c23=_0x52aeae['length'];if(!_0x15df71['query'][_0x87dd('0x39')](_0x87dd('0x58'))){_0x237439['limit']=qs[_0x87dd('0x1e')](_0x15df71[_0x87dd('0x31')]['limit']);_0x237439[_0x87dd('0x1c')]=qs[_0x87dd('0x1c')](_0x15df71['query'][_0x87dd('0x1c')]);}return _0x22201a['getAllConditions'](_0x237439);}})[_0x87dd('0x25')](function(_0x5c5fdb){if(_0x5c5fdb){return _0x5c5fdb?{'count':_0x223c23,'rows':_0x5c5fdb}:null;}})[_0x87dd('0x25')](respondWithResult(_0x532eb2,null))[_0x87dd('0x45')](handleError(_0x532eb2,null));};exports['getAnyConditions']=function(_0x138d21,_0x297005,_0x3a687d){var _0x134206={};var _0x24a50d={};var _0x5d26e4;var _0x285efb;return db[_0x87dd('0x2d')][_0x87dd('0x57')]({'where':{'id':_0x138d21[_0x87dd('0x47')]['id']}})['then'](handleEntityNotFound(_0x297005,null))[_0x87dd('0x25')](function(_0xf83170){if(_0xf83170){_0x5d26e4=_0xf83170;_0x24a50d[_0x87dd('0x35')]=_[_0x87dd('0x32')](db['Condition'][_0x87dd('0x2e')]);_0x24a50d[_0x87dd('0x31')]=_[_0x87dd('0x32')](_0x138d21[_0x87dd('0x31')]);_0x24a50d['filters']=_[_0x87dd('0x34')](_0x24a50d[_0x87dd('0x35')],_0x24a50d['query']);_0x134206[_0x87dd('0x36')]=_[_0x87dd('0x34')](_0x24a50d[_0x87dd('0x35')],qs[_0x87dd('0x37')](_0x138d21[_0x87dd('0x31')]['fields']));_0x134206[_0x87dd('0x36')]=_0x134206['attributes']['length']?_0x134206[_0x87dd('0x36')]:_0x24a50d[_0x87dd('0x35')];_0x134206[_0x87dd('0x3a')]=qs[_0x87dd('0x3b')](_0x138d21['query'][_0x87dd('0x3b')]);_0x134206[_0x87dd('0x3c')]=qs[_0x87dd('0x33')](_[_0x87dd('0x3d')](_0x138d21[_0x87dd('0x31')],_0x24a50d['filters']));if(_0x138d21[_0x87dd('0x31')]['filter']){_0x134206[_0x87dd('0x3c')]=_[_0x87dd('0x3f')](_0x134206[_0x87dd('0x3c')],{'$or':_[_0x87dd('0x2c')](_0x134206[_0x87dd('0x36')],function(_0x2c0f6d){var _0x1f11cc={};_0x1f11cc[_0x2c0f6d]={'$like':'%'+_0x138d21[_0x87dd('0x31')]['filter']+'%'};return _0x1f11cc;})});}_0x134206=_[_0x87dd('0x3f')]({},_0x134206,_0x138d21['options']);return _0x5d26e4[_0x87dd('0x59')](_0x134206);}})[_0x87dd('0x25')](function(_0xcbf707){if(_0xcbf707){_0x285efb=_0xcbf707['length'];if(!_0x138d21[_0x87dd('0x31')][_0x87dd('0x39')](_0x87dd('0x58'))){_0x134206['limit']=qs[_0x87dd('0x1e')](_0x138d21[_0x87dd('0x31')]['limit']);_0x134206[_0x87dd('0x1c')]=qs['offset'](_0x138d21[_0x87dd('0x31')]['offset']);}return _0x5d26e4[_0x87dd('0x59')](_0x134206);}})['then'](function(_0x4fceb7){if(_0x4fceb7){return _0x4fceb7?{'count':_0x285efb,'rows':_0x4fceb7}:null;}})[_0x87dd('0x25')](respondWithResult(_0x297005,null))[_0x87dd('0x45')](handleError(_0x297005,null));};exports[_0x87dd('0x5a')]=function(_0x14ea77,_0x2797ac,_0x2612d5){if(_0x14ea77[_0x87dd('0x4a')]['id']){delete _0x14ea77[_0x87dd('0x4a')]['id'];}return db['Trigger'][_0x87dd('0x48')]({'where':{'id':_0x14ea77[_0x87dd('0x47')]['id']}})[_0x87dd('0x25')](handleEntityNotFound(_0x2797ac,null))[_0x87dd('0x25')](function(_0x4b3b4d){if(_0x4b3b4d){_0x14ea77['body']['TriggerId']=_0x4b3b4d['id'];return db['Action'][_0x87dd('0x49')](_0x14ea77[_0x87dd('0x4a')]);}})[_0x87dd('0x25')](respondWithResult(_0x2797ac,null))[_0x87dd('0x45')](handleError(_0x2797ac,null));};exports[_0x87dd('0x5b')]=function(_0xbe8f3b,_0x3a69d4,_0x46b342){var _0x696805={};var _0x48e7a1={};var _0x240479;var _0x2a989a;return db[_0x87dd('0x2d')][_0x87dd('0x57')]({'where':{'id':_0xbe8f3b[_0x87dd('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a69d4,null))[_0x87dd('0x25')](function(_0x4c611d){if(_0x4c611d){_0x240479=_0x4c611d;_0x48e7a1[_0x87dd('0x35')]=_[_0x87dd('0x32')](db[_0x87dd('0x5c')]['rawAttributes']);_0x48e7a1['query']=_[_0x87dd('0x32')](_0xbe8f3b['query']);_0x48e7a1['filters']=_['intersection'](_0x48e7a1[_0x87dd('0x35')],_0x48e7a1[_0x87dd('0x31')]);_0x696805[_0x87dd('0x36')]=_[_0x87dd('0x34')](_0x48e7a1['model'],qs[_0x87dd('0x37')](_0xbe8f3b[_0x87dd('0x31')]['fields']));_0x696805[_0x87dd('0x36')]=_0x696805['attributes'][_0x87dd('0x38')]?_0x696805[_0x87dd('0x36')]:_0x48e7a1['model'];_0x696805[_0x87dd('0x3a')]=qs['sort'](_0xbe8f3b[_0x87dd('0x31')][_0x87dd('0x3b')]);_0x696805[_0x87dd('0x3c')]=qs[_0x87dd('0x33')](_[_0x87dd('0x3d')](_0xbe8f3b[_0x87dd('0x31')],_0x48e7a1[_0x87dd('0x33')]));if(_0xbe8f3b[_0x87dd('0x31')]['filter']){_0x696805[_0x87dd('0x3c')]=_[_0x87dd('0x3f')](_0x696805[_0x87dd('0x3c')],{'$or':_['map'](_0x696805[_0x87dd('0x36')],function(_0x3046e4){var _0x101d49={};_0x101d49[_0x3046e4]={'$like':'%'+_0xbe8f3b[_0x87dd('0x31')][_0x87dd('0x3e')]+'%'};return _0x101d49;})});}_0x696805=_[_0x87dd('0x3f')]({},_0x696805,_0xbe8f3b[_0x87dd('0x41')]);return _0x240479[_0x87dd('0x5b')](_0x696805);}})[_0x87dd('0x25')](function(_0x1fe722){if(_0x1fe722){_0x2a989a=_0x1fe722[_0x87dd('0x38')];if(!_0xbe8f3b[_0x87dd('0x31')][_0x87dd('0x39')]('nolimit')){_0x696805[_0x87dd('0x1e')]=qs['limit'](_0xbe8f3b['query'][_0x87dd('0x1e')]);_0x696805[_0x87dd('0x1c')]=qs[_0x87dd('0x1c')](_0xbe8f3b[_0x87dd('0x31')]['offset']);}return _0x240479['getActions'](_0x696805);}})[_0x87dd('0x25')](function(_0xb0d71a){if(_0xb0d71a){return _0xb0d71a?{'count':_0x2a989a,'rows':_0xb0d71a}:null;}})[_0x87dd('0x25')](respondWithResult(_0x3a69d4,null))[_0x87dd('0x45')](handleError(_0x3a69d4,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7ff0786..8c7b4de 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 _0x308a=['./trigger.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x101ee4,_0x1354a3){var _0x35b163=function(_0x494681){while(--_0x494681){_0x101ee4['push'](_0x101ee4['shift']());}};_0x35b163(++_0x1354a3);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa308('0x0'));var util=require('util');var logger=require(_0xa308('0x1'))(_0xa308('0x2'));var moment=require(_0xa308('0x3'));var BPromise=require(_0xa308('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa308('0x5'));var config=require(_0xa308('0x6'));var attributes=require(_0xa308('0x7'));module[_0xa308('0x8')]=function(_0x26d8a4,_0x322331){return _0x26d8a4[_0xa308('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb07f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x27150a,_0x33f51f){var _0x29597d=function(_0x1021a6){while(--_0x1021a6){_0x27150a['push'](_0x27150a['shift']());}};_0x29597d(++_0x33f51f);}(_0xb07f,0x109));var _0xfb07=function(_0x5d81a9,_0x5aaedd){_0x5d81a9=_0x5d81a9-0x0;var _0x1ceac5=_0xb07f[_0x5d81a9];return _0x1ceac5;};'use strict';var _=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var logger=require(_0xfb07('0x2'))(_0xfb07('0x3'));var moment=require(_0xfb07('0x4'));var BPromise=require(_0xfb07('0x5'));var rp=require(_0xfb07('0x6'));var fs=require('fs');var path=require(_0xfb07('0x7'));var rimraf=require(_0xfb07('0x8'));var config=require(_0xfb07('0x9'));var attributes=require(_0xfb07('0xa'));module['exports']=function(_0x3c79a9,_0x934f98){return _0x3c79a9[_0xfb07('0xb')](_0xfb07('0xc'),attributes,{'tableName':_0xfb07('0xd'),'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 602b6b2..727a96a 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 _0x012a=['code','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','ShowTrigger','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error'];(function(_0x543735,_0x28eda6){var _0x548a66=function(_0x4014d1){while(--_0x4014d1){_0x543735['push'](_0x543735['shift']());}};_0x548a66(++_0x28eda6);}(_0x012a,0x159));var _0xa012=function(_0x39972b,_0x17ceec){_0x39972b=_0x39972b-0x0;var _0x2c4d39=_0x012a[_0x39972b];return _0x2c4d39;};'use strict';var _=require('lodash');var util=require(_0xa012('0x0'));var moment=require('moment');var BPromise=require(_0xa012('0x1'));var rs=require(_0xa012('0x2'));var fs=require('fs');var Redis=require(_0xa012('0x3'));var db=require(_0xa012('0x4'))['db'];var utils=require(_0xa012('0x5'));var logger=require('../../config/logger')(_0xa012('0x6'));var config=require(_0xa012('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa012('0x8')][_0xa012('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56fb4b,_0x2a50ed,_0x3ebdd2){return new BPromise(function(_0x246692,_0x5bcacc){return client[_0xa012('0xa')](_0x56fb4b,_0x3ebdd2)[_0xa012('0xb')](function(_0x2dd9e3){logger['info']('Trigger,\x20%s,\x20%s',_0x2a50ed,_0xa012('0xc'));logger['debug'](_0xa012('0xd'),_0x2a50ed,_0xa012('0xc'),JSON['stringify'](_0x2dd9e3));if(_0x2dd9e3['error']){if(_0x2dd9e3[_0xa012('0xe')][_0xa012('0xf')]===0x1f4){logger[_0xa012('0xe')](_0xa012('0x10'),_0x2a50ed,_0x2dd9e3['error']['message']);return _0x5bcacc(_0x2dd9e3[_0xa012('0xe')]['message']);}logger[_0xa012('0xe')](_0xa012('0x10'),_0x2a50ed,_0x2dd9e3['error'][_0xa012('0x11')]);return _0x246692(_0x2dd9e3['error'][_0xa012('0x11')]);}else{logger[_0xa012('0x12')](_0xa012('0x10'),_0x2a50ed,_0xa012('0xc'));_0x246692(_0x2dd9e3[_0xa012('0x13')][_0xa012('0x11')]);}})[_0xa012('0x14')](function(_0x35f3a3){logger[_0xa012('0xe')]('Trigger,\x20%s,\x20%s',_0x2a50ed,_0x35f3a3);_0x5bcacc(_0x35f3a3);});});}exports[_0xa012('0x15')]=function(_0x2f8bfa){var _0x53c7be=this;return new Promise(function(_0x49438a,_0x4864e5){return db[_0xa012('0x16')][_0xa012('0x17')]({'raw':_0x2f8bfa['options']?_0x2f8bfa[_0xa012('0x18')][_0xa012('0x19')]===undefined?!![]:![]:!![],'where':_0x2f8bfa[_0xa012('0x18')]?_0x2f8bfa[_0xa012('0x18')][_0xa012('0x1a')]||null:null,'attributes':_0x2f8bfa['options']?_0x2f8bfa['options'][_0xa012('0x1b')]||null:null,'limit':_0x2f8bfa[_0xa012('0x18')]?_0x2f8bfa[_0xa012('0x18')][_0xa012('0x1c')]||null:null,'include':_0x2f8bfa[_0xa012('0x18')]?_0x2f8bfa[_0xa012('0x18')][_0xa012('0x1d')]?_['map'](_0x2f8bfa[_0xa012('0x18')][_0xa012('0x1d')],function(_0x459941){return{'model':db[_0x459941[_0xa012('0x1e')]],'as':_0x459941['as'],'attributes':_0x459941[_0xa012('0x1b')],'include':_0x459941['include']?_[_0xa012('0x1f')](_0x459941[_0xa012('0x1d')],function(_0x5acccd){return{'model':db[_0x5acccd['model']],'as':_0x5acccd['as'],'attributes':_0x5acccd[_0xa012('0x1b')],'include':_0x5acccd[_0xa012('0x1d')]?_[_0xa012('0x1f')](_0x5acccd[_0xa012('0x1d')],function(_0x37ec18){return{'model':db[_0x37ec18[_0xa012('0x1e')]],'as':_0x37ec18['as'],'attributes':_0x37ec18['attributes']};}):[]};}):[]};}):[]:[]})[_0xa012('0xb')](function(_0x25af0b){logger[_0xa012('0x12')](_0xa012('0x15'),_0x2f8bfa);logger[_0xa012('0x20')]('GetTrigger',_0x2f8bfa,JSON[_0xa012('0x21')](_0x25af0b));_0x49438a(_0x25af0b);})['catch'](function(_0x3c30f0){logger[_0xa012('0xe')]('GetTrigger',_0x3c30f0[_0xa012('0x11')],_0x2f8bfa);_0x4864e5(_0x53c7be[_0xa012('0xe')](0x1f4,_0x3c30f0[_0xa012('0x11')]));});});};exports[_0xa012('0x22')]=function(_0x3322c6){var _0x2609c9=this;return new Promise(function(_0x612b93,_0x490345){return db[_0xa012('0x16')][_0xa012('0x23')]({'raw':_0x3322c6[_0xa012('0x18')]?_0x3322c6[_0xa012('0x18')][_0xa012('0x19')]===undefined?!![]:![]:!![],'where':_0x3322c6[_0xa012('0x18')]?_0x3322c6['options'][_0xa012('0x1a')]||null:null,'attributes':_0x3322c6['options']?_0x3322c6[_0xa012('0x18')][_0xa012('0x1b')]||null:null,'include':_0x3322c6['options']?_0x3322c6[_0xa012('0x18')][_0xa012('0x1d')]?_['map'](_0x3322c6[_0xa012('0x18')][_0xa012('0x1d')],function(_0x5bd245){return{'model':db[_0x5bd245[_0xa012('0x1e')]],'as':_0x5bd245['as'],'attributes':_0x5bd245['attributes'],'include':_0x5bd245[_0xa012('0x1d')]?_[_0xa012('0x1f')](_0x5bd245['include'],function(_0x3884f2){return{'model':db[_0x3884f2[_0xa012('0x1e')]],'as':_0x3884f2['as'],'attributes':_0x3884f2[_0xa012('0x1b')],'include':_0x3884f2['include']?_[_0xa012('0x1f')](_0x3884f2[_0xa012('0x1d')],function(_0xa3b7a0){return{'model':db[_0xa3b7a0[_0xa012('0x1e')]],'as':_0xa3b7a0['as'],'attributes':_0xa3b7a0['attributes']};}):[]};}):[]};}):[]:[]})[_0xa012('0xb')](function(_0x53d7e6){logger['info'](_0xa012('0x22'),_0x3322c6);logger[_0xa012('0x20')](_0xa012('0x22'),_0x3322c6,JSON[_0xa012('0x21')](_0x53d7e6));_0x612b93(_0x53d7e6);})[_0xa012('0x14')](function(_0xf28fd3){logger[_0xa012('0xe')](_0xa012('0x22'),_0xf28fd3[_0xa012('0x11')],_0x3322c6);_0x490345(_0x2609c9[_0xa012('0xe')](0x1f4,_0xf28fd3[_0xa012('0x11')]));});});}; \ No newline at end of file +var _0x29bb=['stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','error','code','Trigger,\x20%s,\x20%s','message','info','result','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowTrigger'];(function(_0xe353aa,_0x5c10ea){var _0x36692f=function(_0x2d0851){while(--_0x2d0851){_0xe353aa['push'](_0xe353aa['shift']());}};_0x36692f(++_0x5c10ea);}(_0x29bb,0x13d));var _0xb29b=function(_0x336c9a,_0x381e4c){_0x336c9a=_0x336c9a-0x0;var _0x559b89=_0x29bb[_0x336c9a];return _0x559b89;};'use strict';var _=require('lodash');var util=require(_0xb29b('0x0'));var moment=require(_0xb29b('0x1'));var BPromise=require(_0xb29b('0x2'));var rs=require(_0xb29b('0x3'));var fs=require('fs');var Redis=require(_0xb29b('0x4'));var db=require(_0xb29b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb29b('0x6'))(_0xb29b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb29b('0x8'));var client=jayson[_0xb29b('0x9')][_0xb29b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44c053,_0x487ae3,_0x1560f2){return new BPromise(function(_0x5e04f6,_0x100db1){return client['request'](_0x44c053,_0x1560f2)[_0xb29b('0xb')](function(_0x4eb9d6){logger['info']('Trigger,\x20%s,\x20%s',_0x487ae3,_0xb29b('0xc'));logger[_0xb29b('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x487ae3,_0xb29b('0xc'),JSON['stringify'](_0x4eb9d6));if(_0x4eb9d6[_0xb29b('0xe')]){if(_0x4eb9d6[_0xb29b('0xe')][_0xb29b('0xf')]===0x1f4){logger[_0xb29b('0xe')](_0xb29b('0x10'),_0x487ae3,_0x4eb9d6['error'][_0xb29b('0x11')]);return _0x100db1(_0x4eb9d6[_0xb29b('0xe')]['message']);}logger[_0xb29b('0xe')]('Trigger,\x20%s,\x20%s',_0x487ae3,_0x4eb9d6[_0xb29b('0xe')]['message']);return _0x5e04f6(_0x4eb9d6[_0xb29b('0xe')][_0xb29b('0x11')]);}else{logger[_0xb29b('0x12')](_0xb29b('0x10'),_0x487ae3,'request\x20sent');_0x5e04f6(_0x4eb9d6[_0xb29b('0x13')][_0xb29b('0x11')]);}})['catch'](function(_0x2f2873){logger['error']('Trigger,\x20%s,\x20%s',_0x487ae3,_0x2f2873);_0x100db1(_0x2f2873);});});}exports[_0xb29b('0x14')]=function(_0xd27442){var _0x3df4f7=this;return new Promise(function(_0x2fefa5,_0x4197ea){return db[_0xb29b('0x15')][_0xb29b('0x16')]({'raw':_0xd27442[_0xb29b('0x17')]?_0xd27442[_0xb29b('0x17')][_0xb29b('0x18')]===undefined?!![]:![]:!![],'where':_0xd27442['options']?_0xd27442[_0xb29b('0x17')]['where']||null:null,'attributes':_0xd27442[_0xb29b('0x17')]?_0xd27442['options'][_0xb29b('0x19')]||null:null,'limit':_0xd27442[_0xb29b('0x17')]?_0xd27442[_0xb29b('0x17')][_0xb29b('0x1a')]||null:null,'include':_0xd27442[_0xb29b('0x17')]?_0xd27442[_0xb29b('0x17')][_0xb29b('0x1b')]?_[_0xb29b('0x1c')](_0xd27442[_0xb29b('0x17')][_0xb29b('0x1b')],function(_0x2b21b0){return{'model':db[_0x2b21b0[_0xb29b('0x1d')]],'as':_0x2b21b0['as'],'attributes':_0x2b21b0[_0xb29b('0x19')],'include':_0x2b21b0[_0xb29b('0x1b')]?_[_0xb29b('0x1c')](_0x2b21b0['include'],function(_0x15af89){return{'model':db[_0x15af89['model']],'as':_0x15af89['as'],'attributes':_0x15af89[_0xb29b('0x19')],'include':_0x15af89[_0xb29b('0x1b')]?_[_0xb29b('0x1c')](_0x15af89[_0xb29b('0x1b')],function(_0x37151c){return{'model':db[_0x37151c[_0xb29b('0x1d')]],'as':_0x37151c['as'],'attributes':_0x37151c[_0xb29b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3352de){logger['info'](_0xb29b('0x14'),_0xd27442);logger['debug']('GetTrigger',_0xd27442,JSON['stringify'](_0x3352de));_0x2fefa5(_0x3352de);})['catch'](function(_0x3418ee){logger[_0xb29b('0xe')](_0xb29b('0x14'),_0x3418ee['message'],_0xd27442);_0x4197ea(_0x3df4f7[_0xb29b('0xe')](0x1f4,_0x3418ee[_0xb29b('0x11')]));});});};exports['ShowTrigger']=function(_0x2963b2){var _0x5a5d56=this;return new Promise(function(_0x2f8014,_0x7ca1cf){return db[_0xb29b('0x15')][_0xb29b('0x1e')]({'raw':_0x2963b2[_0xb29b('0x17')]?_0x2963b2[_0xb29b('0x17')][_0xb29b('0x18')]===undefined?!![]:![]:!![],'where':_0x2963b2[_0xb29b('0x17')]?_0x2963b2[_0xb29b('0x17')][_0xb29b('0x1f')]||null:null,'attributes':_0x2963b2[_0xb29b('0x17')]?_0x2963b2[_0xb29b('0x17')]['attributes']||null:null,'include':_0x2963b2[_0xb29b('0x17')]?_0x2963b2[_0xb29b('0x17')]['include']?_[_0xb29b('0x1c')](_0x2963b2[_0xb29b('0x17')][_0xb29b('0x1b')],function(_0x5611cd){return{'model':db[_0x5611cd[_0xb29b('0x1d')]],'as':_0x5611cd['as'],'attributes':_0x5611cd[_0xb29b('0x19')],'include':_0x5611cd[_0xb29b('0x1b')]?_[_0xb29b('0x1c')](_0x5611cd[_0xb29b('0x1b')],function(_0x2346ef){return{'model':db[_0x2346ef[_0xb29b('0x1d')]],'as':_0x2346ef['as'],'attributes':_0x2346ef['attributes'],'include':_0x2346ef[_0xb29b('0x1b')]?_[_0xb29b('0x1c')](_0x2346ef[_0xb29b('0x1b')],function(_0x2d1ff1){return{'model':db[_0x2d1ff1[_0xb29b('0x1d')]],'as':_0x2d1ff1['as'],'attributes':_0x2d1ff1[_0xb29b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb29b('0xb')](function(_0x287448){logger[_0xb29b('0x12')](_0xb29b('0x20'),_0x2963b2);logger[_0xb29b('0xd')](_0xb29b('0x20'),_0x2963b2,JSON[_0xb29b('0x21')](_0x287448));_0x2f8014(_0x287448);})[_0xb29b('0x22')](function(_0x437487){logger[_0xb29b('0xe')]('ShowTrigger',_0x437487[_0xb29b('0x11')],_0x2963b2);_0x7ca1cf(_0x5a5d56[_0xb29b('0xe')](0x1f4,_0x437487[_0xb29b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f7ac92e..4d65952 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 _0x87c0=['clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','show','post','/:id/clone','isAuthenticated'];(function(_0x14aa25,_0x17b9a2){var _0xcc0ca8=function(_0x4d827d){while(--_0x4d827d){_0x14aa25['push'](_0x14aa25['shift']());}};_0xcc0ca8(++_0x17b9a2);}(_0x87c0,0x9d));var _0x087c=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x87c0[_0x44a64f];return _0x52024b;};'use strict';var multer=require(_0x087c('0x0'));var util=require(_0x087c('0x1'));var path=require(_0x087c('0x2'));var timeout=require(_0x087c('0x3'));var express=require(_0x087c('0x4'));var router=express[_0x087c('0x5')]();var fs_extra=require(_0x087c('0x6'));var auth=require(_0x087c('0x7'));var interaction=require(_0x087c('0x8'));var config=require(_0x087c('0x9'));var controller=require(_0x087c('0xa'));router[_0x087c('0xb')]('/',auth['isAuthenticated'](),controller[_0x087c('0xc')]);router[_0x087c('0xb')](_0x087c('0xd'),auth['isAuthenticated'](),controller[_0x087c('0xe')]);router[_0x087c('0xf')](_0x087c('0x10'),auth[_0x087c('0x11')](),controller[_0x087c('0x12')]);router['post']('/',auth[_0x087c('0x11')](),controller[_0x087c('0x13')]);router[_0x087c('0x14')]('/:id',auth[_0x087c('0x11')](),controller[_0x087c('0x15')]);router[_0x087c('0x16')](_0x087c('0xd'),auth[_0x087c('0x11')](),controller[_0x087c('0x17')]);module[_0x087c('0x18')]=router; \ No newline at end of file +var _0x11e3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id/clone','create','put','/:id','multer'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x11e3,0x131));var _0x311e=function(_0x5efe13,_0x2615c6){_0x5efe13=_0x5efe13-0x0;var _0x19d50c=_0x11e3[_0x5efe13];return _0x19d50c;};'use strict';var multer=require(_0x311e('0x0'));var util=require(_0x311e('0x1'));var path=require(_0x311e('0x2'));var timeout=require(_0x311e('0x3'));var express=require(_0x311e('0x4'));var router=express[_0x311e('0x5')]();var fs_extra=require(_0x311e('0x6'));var auth=require(_0x311e('0x7'));var interaction=require(_0x311e('0x8'));var config=require('../../config/environment');var controller=require(_0x311e('0x9'));router[_0x311e('0xa')]('/',auth[_0x311e('0xb')](),controller[_0x311e('0xc')]);router[_0x311e('0xa')]('/:id',auth[_0x311e('0xb')](),controller['show']);router['post'](_0x311e('0xd'),auth[_0x311e('0xb')](),controller['clone']);router['post']('/',auth[_0x311e('0xb')](),controller[_0x311e('0xe')]);router[_0x311e('0xf')](_0x311e('0x10'),auth[_0x311e('0xb')](),controller['update']);router['delete'](_0x311e('0x10'),auth[_0x311e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 94e1164..0662244 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 _0x4076=['name','friend','user','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','getDataValue','split','info','inband','auto','ENUM','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING'];(function(_0x410bb9,_0x2b99b6){var _0x5792df=function(_0x90ece8){while(--_0x90ece8){_0x410bb9['push'](_0x410bb9['shift']());}};_0x5792df(++_0x2b99b6);}(_0x4076,0x195));var _0x6407=function(_0x323f0b,_0x4808c1){_0x323f0b=_0x323f0b-0x0;var _0x3f4570=_0x4076[_0x323f0b];return _0x3f4570;};'use strict';var Sequelize=require(_0x6407('0x0'));module[_0x6407('0x1')]={'name':{'type':Sequelize[_0x6407('0x2')],'allowNull':![],'unique':_0x6407('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6407('0x4'),_0x6407('0x5'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x6407('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x6407('0x6'),'ALLOWED_FAILED_SCREEN',_0x6407('0x7'),_0x6407('0x8'),_0x6407('0x9'),_0x6407('0xa'),_0x6407('0xb'))},'deny':{'type':Sequelize[_0x6407('0x2')]},'permit':{'type':Sequelize[_0x6407('0x2')]},'secret':{'type':Sequelize[_0x6407('0x2')]},'md5secret':{'type':Sequelize[_0x6407('0x2')]},'remotesecret':{'type':Sequelize[_0x6407('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6407('0xc'),'set':function(_0x5bc4dc){this['setDataValue'](_0x6407('0xd'),_0x5bc4dc?_0x5bc4dc['join'](','):null);},'get':function(){return this[_0x6407('0xe')](_0x6407('0xd'))?this[_0x6407('0xe')](_0x6407('0xd'))[_0x6407('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x6407('0x10'),'shortinfo',_0x6407('0x11'),_0x6407('0x12')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no',_0x6407('0x15'),'update',_0x6407('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x6407('0x2')]},'nat':{'type':Sequelize[_0x6407('0x2')],'defaultValue':_0x6407('0x17'),'set':function(_0x3eb648){this[_0x6407('0x18')](_0x6407('0x19'),_0x3eb648?_0x3eb648[_0x6407('0x1a')](','):null);},'get':function(){return this[_0x6407('0xe')](_0x6407('0x19'))?this[_0x6407('0xe')]('nat')[_0x6407('0xf')](','):null;},'comment':_0x6407('0x1b')},'callgroup':{'type':Sequelize[_0x6407('0x2')]},'namedcallgroup':{'type':Sequelize[_0x6407('0x2')]},'pickupgroup':{'type':Sequelize[_0x6407('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6407('0x2')]},'language':{'type':Sequelize[_0x6407('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6407('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6407('0x2')],'defaultValue':_0x6407('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6407('0x1d'),'set':function(_0x3ad8f5){this['setDataValue'](_0x6407('0x1e'),_0x3ad8f5?_0x3ad8f5['join'](';'):_0x6407('0x1d'));},'get':function(){return this[_0x6407('0xe')](_0x6407('0x1e'))?this['getDataValue'](_0x6407('0x1e'))[_0x6407('0xf')](';'):null;},'comment':_0x6407('0x1f')},'autoframing':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x6407('0x20'),'set':function(_0x217b2a){this[_0x6407('0x18')](_0x6407('0x21'),_0x217b2a?_0x217b2a[_0x6407('0x1a')](','):null);},'get':function(){return this[_0x6407('0xe')](_0x6407('0x21'))?this['getDataValue'](_0x6407('0x21'))[_0x6407('0xf')](','):null;},'comment':_0x6407('0x22')},'trustrpid':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6407('0x13')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no','never')},'promiscredir':{'type':Sequelize[_0x6407('0x13')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x6407('0x14'),'no')},'accountcode':{'type':Sequelize[_0x6407('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x6407('0x24')},'amaflags':{'type':Sequelize[_0x6407('0x2')]},'callcounter':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no'),'defaultValue':_0x6407('0x14')},'busylevel':{'type':Sequelize[_0x6407('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x6407('0x13')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x6407('0x2')]},'template':{'type':Sequelize[_0x6407('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x6407('0x14'),'no',_0x6407('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6407('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'mailbox':{'type':Sequelize[_0x6407('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x6407('0x26'),_0x6407('0x27'),'originate')},'session_expires':{'type':Sequelize[_0x6407('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x6407('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x28'),_0x6407('0x29')),'defaultValue':_0x6407('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x6407('0x2')]},'regexten':{'type':Sequelize[_0x6407('0x2')]},'fromdomain':{'type':Sequelize[_0x6407('0x2')]},'fromuser':{'type':Sequelize[_0x6407('0x2')]},'port':{'type':Sequelize[_0x6407('0x23')](0x5)},'qualify':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x6407('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x6407('0x2')]},'defaultuser':{'type':Sequelize[_0x6407('0x2')]},'rtptimeout':{'type':Sequelize[_0x6407('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no',_0x6407('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6407('0x2')]},'callbackextension':{'type':Sequelize[_0x6407('0x2')]},'timert1':{'type':Sequelize[_0x6407('0x23')](0xb)},'timerb':{'type':Sequelize[_0x6407('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x6407('0x2')]},'contactdeny':{'type':Sequelize[_0x6407('0x2')]},'contactacl':{'type':Sequelize[_0x6407('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x6407('0x2')]},'use_q850_reason':{'type':Sequelize[_0x6407('0x2')]},'maxforwards':{'type':Sequelize[_0x6407('0x23')](0xb)},'encryption':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6407('0x13')]('yes','no')},'force_avp':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'icesupport':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x6407('0x13')]('yes','no',_0x6407('0x2b'),_0x6407('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x6407('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6407('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x6407('0x2')]},'dtlscipher':{'type':Sequelize[_0x6407('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x6407('0x2')]},'dtlssetup':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x2d'),_0x6407('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x6407('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6407('0x2')]},'recordofffeature':{'type':Sequelize[_0x6407('0x2')]},'call_limit':{'type':Sequelize[_0x6407('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x6407('0x2')]},'mohinterpret':{'type':Sequelize[_0x6407('0x2')]},'mohsuggest':{'type':Sequelize[_0x6407('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6407('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x6407('0x2f')},'canreinvite':{'type':Sequelize[_0x6407('0x13')](_0x6407('0x14'),'no','nonat',_0x6407('0x30'),_0x6407('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6407('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6407('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6407('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc64d=['PROHIB_PASSED_SCREEN','udp','transport','join','getDataValue','split','rfc2833','inband','auto','yes','nonat','outgoing','force_rport,comedia','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]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','peer','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x353c3e,_0x365567){var _0x2dfb7d=function(_0x4f8ef6){while(--_0x4f8ef6){_0x353c3e['push'](_0x353c3e['shift']());}};_0x2dfb7d(++_0x365567);}(_0xc64d,0x1b0));var _0xdc64=function(_0x3223f3,_0x56c42d){_0x3223f3=_0x3223f3-0x0;var _0x1195ad=_0xc64d[_0x3223f3];return _0x1195ad;};'use strict';var Sequelize=require(_0xdc64('0x0'));module[_0xdc64('0x1')]={'name':{'type':Sequelize[_0xdc64('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdc64('0x3')]('friend','user',_0xdc64('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xdc64('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xdc64('0x5'),'ALLOWED_PASSED_SCREEN',_0xdc64('0x6'),_0xdc64('0x7'),_0xdc64('0x8'),_0xdc64('0x9'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0xdc64('0x2')]},'permit':{'type':Sequelize[_0xdc64('0x2')]},'secret':{'type':Sequelize[_0xdc64('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xdc64('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xdc64('0xa'),'set':function(_0x385635){this['setDataValue'](_0xdc64('0xb'),_0x385635?_0x385635[_0xdc64('0xc')](','):null);},'get':function(){return this[_0xdc64('0xd')]('transport')?this[_0xdc64('0xd')]('transport')[_0xdc64('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0xf'),'info','shortinfo',_0xdc64('0x10'),_0xdc64('0x11')),'defaultValue':_0xdc64('0xf')},'directmedia':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no',_0xdc64('0x13'),'update',_0xdc64('0x14')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdc64('0x2')]},'directmediadeny':{'type':Sequelize[_0xdc64('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xdc64('0x15'),'set':function(_0x5809e8){this['setDataValue'](_0xdc64('0x16'),_0x5809e8?_0x5809e8[_0xdc64('0xc')](','):null);},'get':function(){return this[_0xdc64('0xd')](_0xdc64('0x16'))?this[_0xdc64('0xd')](_0xdc64('0x16'))[_0xdc64('0xe')](','):null;},'comment':_0xdc64('0x17')},'callgroup':{'type':Sequelize[_0xdc64('0x2')]},'namedcallgroup':{'type':Sequelize[_0xdc64('0x2')]},'pickupgroup':{'type':Sequelize[_0xdc64('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xdc64('0x2')]},'language':{'type':Sequelize[_0xdc64('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xdc64('0x2')],'defaultValue':_0xdc64('0x18')},'allow':{'type':Sequelize[_0xdc64('0x2')],'allowNull':![],'defaultValue':_0xdc64('0x19'),'set':function(_0x3710a5){this[_0xdc64('0x1a')](_0xdc64('0x1b'),_0x3710a5?_0x3710a5['join'](';'):_0xdc64('0x19'));},'get':function(){return this[_0xdc64('0xd')](_0xdc64('0x1b'))?this[_0xdc64('0xd')](_0xdc64('0x1b'))[_0xdc64('0xe')](';'):null;},'comment':_0xdc64('0x1c')},'autoframing':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xdc64('0x1d'),'set':function(_0xe7239c){this['setDataValue'](_0xdc64('0x1e'),_0xe7239c?_0xe7239c['join'](','):null);},'get':function(){return this[_0xdc64('0xd')](_0xdc64('0x1e'))?this[_0xdc64('0xd')](_0xdc64('0x1e'))[_0xdc64('0xe')](','):null;},'comment':_0xdc64('0x1f')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xdc64('0x12'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no',_0xdc64('0x20'))},'promiscredir':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'useclientcode':{'type':Sequelize[_0xdc64('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0xdc64('0x21')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdc64('0x2')],'defaultValue':_0xdc64('0x22')},'amaflags':{'type':Sequelize[_0xdc64('0x2')]},'callcounter':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no'),'defaultValue':_0xdc64('0x12')},'busylevel':{'type':Sequelize[_0xdc64('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'allowsubscribe':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'allowtransfer':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'ignoresdpversion':{'type':Sequelize[_0xdc64('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xdc64('0x2')]},'template':{'type':Sequelize[_0xdc64('0x2')]},'videosupport':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdc64('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xdc64('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xdc64('0x2')]},'session_timers':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x23'),_0xdc64('0x24'),_0xdc64('0x25'))},'session_expires':{'type':Sequelize[_0xdc64('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xdc64('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x26'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xdc64('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xdc64('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdc64('0x21')](0x5)},'qualify':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xdc64('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xdc64('0x2')]},'defaultuser':{'type':Sequelize[_0xdc64('0x2')]},'rtptimeout':{'type':Sequelize[_0xdc64('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xdc64('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdc64('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no',_0xdc64('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdc64('0x2')]},'callbackextension':{'type':Sequelize[_0xdc64('0x2')]},'timert1':{'type':Sequelize[_0xdc64('0x21')](0xb)},'timerb':{'type':Sequelize[_0xdc64('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xdc64('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xdc64('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xdc64('0x2')]},'use_q850_reason':{'type':Sequelize[_0xdc64('0x2')]},'maxforwards':{'type':Sequelize[_0xdc64('0x21')](0xb)},'encryption':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xdc64('0x12'),'no')},'icesupport':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'dtlsenable':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'dtlsverify':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no',_0xdc64('0x28'),_0xdc64('0x29'))},'dtlsrekey':{'type':Sequelize[_0xdc64('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xdc64('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xdc64('0x2')]},'dtlscafile':{'type':Sequelize[_0xdc64('0x2')]},'dtlscapath':{'type':Sequelize[_0xdc64('0x2')]},'dtlssetup':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x2a'),_0xdc64('0x2b'),_0xdc64('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdc64('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xdc64('0x12'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xdc64('0x2')]},'call_limit':{'type':Sequelize[_0xdc64('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no')},'subscribemwi':{'type':Sequelize[_0xdc64('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xdc64('0x2')]},'mohinterpret':{'type':Sequelize[_0xdc64('0x2')]},'mohsuggest':{'type':Sequelize[_0xdc64('0x2')]},'parkinglot':{'type':Sequelize[_0xdc64('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdc64('0x2')],'defaultValue':_0xdc64('0x2d')},'canreinvite':{'type':Sequelize[_0xdc64('0x3')](_0xdc64('0x12'),'no',_0xdc64('0x13'),_0xdc64('0x2e'),_0xdc64('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xdc64('0x2')]},'otherFields':{'type':Sequelize[_0xdc64('0x2')]},'active':{'type':Sequelize[_0xdc64('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index e3a0d87..9797eb7 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 _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x311e39,_0x21f955){var _0x40687b=function(_0x28e44b){while(--_0x28e44b){_0x311e39['push'](_0x311e39['shift']());}};_0x40687b(++_0x21f955);}(_0xb821,0xa7));var _0x1b82=function(_0x12eea0,_0x45b4a7){_0x12eea0=_0x12eea0-0x0;var _0x458104=_0xb821[_0x12eea0];return _0x458104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e72682d..fdafc56 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 _0x0204=['rimraf','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x11e174,_0x4425ae){var _0x211bbb=function(_0x2c6844){while(--_0x2c6844){_0x11e174['push'](_0x11e174['shift']());}};_0x211bbb(++_0x4425ae);}(_0x0204,0x16d));var _0x4020=function(_0x39aa51,_0x3459f4){_0x39aa51=_0x39aa51-0x0;var _0x250320=_0x0204[_0x39aa51];return _0x250320;};'use strict';var _=require(_0x4020('0x0'));var util=require(_0x4020('0x1'));var logger=require('../../config/logger')(_0x4020('0x2'));var moment=require(_0x4020('0x3'));var BPromise=require(_0x4020('0x4'));var rp=require(_0x4020('0x5'));var fs=require('fs');var path=require(_0x4020('0x6'));var rimraf=require(_0x4020('0x7'));var config=require('../../config/environment');var attributes=require(_0x4020('0x8'));module[_0x4020('0x9')]=function(_0x1f3f1a,_0x5df87f){return _0x1f3f1a['define'](_0x4020('0xa'),attributes,{'tableName':_0x4020('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0437=['request-promise','rimraf','../../config/environment','./trunk.attributes','lodash','../../config/logger'];(function(_0x31ece6,_0x20769d){var _0x248c2b=function(_0x22bbc3){while(--_0x22bbc3){_0x31ece6['push'](_0x31ece6['shift']());}};_0x248c2b(++_0x20769d);}(_0x0437,0xc4));var _0x7043=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x0437[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x7043('0x0'));var util=require('util');var logger=require(_0x7043('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7043('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7043('0x3'));var config=require(_0x7043('0x4'));var attributes=require(_0x7043('0x5'));module['exports']=function(_0x12fe19,_0xb9f927){return _0x12fe19['define']('Trunk',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 bad55ea..f905fd2 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 _0xc9cc=['where','attributes','limit','include','map','then','stringify','ShowTrunk','raw','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','code','error','Trunk,\x20%s,\x20%s','message','catch','GetTrunk','Trunk','findAll','options'];(function(_0x2dda31,_0x41f900){var _0x10735a=function(_0x147685){while(--_0x147685){_0x2dda31['push'](_0x2dda31['shift']());}};_0x10735a(++_0x41f900);}(_0xc9cc,0xb0));var _0xcc9c=function(_0x481302,_0x11d85d){_0x481302=_0x481302-0x0;var _0x23fd89=_0xc9cc[_0x481302];return _0x23fd89;};'use strict';var _=require(_0xcc9c('0x0'));var util=require(_0xcc9c('0x1'));var moment=require(_0xcc9c('0x2'));var BPromise=require(_0xcc9c('0x3'));var rs=require(_0xcc9c('0x4'));var fs=require('fs');var Redis=require(_0xcc9c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc9c('0x6'))('rpc');var config=require(_0xcc9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f8aed,_0x239bac,_0xc03f83){return new BPromise(function(_0x3f087e,_0x3b53cc){return client[_0xcc9c('0x9')](_0x2f8aed,_0xc03f83)['then'](function(_0x514543){logger[_0xcc9c('0xa')]('Trunk,\x20%s,\x20%s',_0x239bac,_0xcc9c('0xb'));logger['debug'](_0xcc9c('0xc'),_0x239bac,_0xcc9c('0xb'),JSON['stringify'](_0x514543));if(_0x514543['error']){if(_0x514543['error'][_0xcc9c('0xd')]===0x1f4){logger[_0xcc9c('0xe')](_0xcc9c('0xf'),_0x239bac,_0x514543[_0xcc9c('0xe')][_0xcc9c('0x10')]);return _0x3b53cc(_0x514543[_0xcc9c('0xe')][_0xcc9c('0x10')]);}logger['error'](_0xcc9c('0xf'),_0x239bac,_0x514543[_0xcc9c('0xe')][_0xcc9c('0x10')]);return _0x3f087e(_0x514543[_0xcc9c('0xe')][_0xcc9c('0x10')]);}else{logger[_0xcc9c('0xa')](_0xcc9c('0xf'),_0x239bac,_0xcc9c('0xb'));_0x3f087e(_0x514543['result'][_0xcc9c('0x10')]);}})[_0xcc9c('0x11')](function(_0x21c836){logger[_0xcc9c('0xe')](_0xcc9c('0xf'),_0x239bac,_0x21c836);_0x3b53cc(_0x21c836);});});}exports[_0xcc9c('0x12')]=function(_0x332582){var _0x3977e7=this;return new Promise(function(_0x564661,_0x2d0f1c){return db[_0xcc9c('0x13')][_0xcc9c('0x14')]({'raw':_0x332582[_0xcc9c('0x15')]?_0x332582[_0xcc9c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x332582[_0xcc9c('0x15')]?_0x332582['options'][_0xcc9c('0x16')]||null:null,'attributes':_0x332582[_0xcc9c('0x15')]?_0x332582[_0xcc9c('0x15')][_0xcc9c('0x17')]||null:null,'limit':_0x332582[_0xcc9c('0x15')]?_0x332582[_0xcc9c('0x15')][_0xcc9c('0x18')]||null:null,'include':_0x332582[_0xcc9c('0x15')]?_0x332582[_0xcc9c('0x15')][_0xcc9c('0x19')]?_[_0xcc9c('0x1a')](_0x332582[_0xcc9c('0x15')][_0xcc9c('0x19')],function(_0x2fd3e3){return{'model':db[_0x2fd3e3['model']],'as':_0x2fd3e3['as'],'attributes':_0x2fd3e3[_0xcc9c('0x17')],'include':_0x2fd3e3[_0xcc9c('0x19')]?_['map'](_0x2fd3e3[_0xcc9c('0x19')],function(_0x13df75){return{'model':db[_0x13df75['model']],'as':_0x13df75['as'],'attributes':_0x13df75[_0xcc9c('0x17')],'include':_0x13df75[_0xcc9c('0x19')]?_['map'](_0x13df75[_0xcc9c('0x19')],function(_0x9b172a){return{'model':db[_0x9b172a['model']],'as':_0x9b172a['as'],'attributes':_0x9b172a[_0xcc9c('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcc9c('0x1b')](function(_0x5aa33c){logger[_0xcc9c('0xa')]('GetTrunk',_0x332582);logger['debug'](_0xcc9c('0x12'),_0x332582,JSON[_0xcc9c('0x1c')](_0x5aa33c));_0x564661(_0x5aa33c);})[_0xcc9c('0x11')](function(_0x422637){logger[_0xcc9c('0xe')]('GetTrunk',_0x422637[_0xcc9c('0x10')],_0x332582);_0x2d0f1c(_0x3977e7[_0xcc9c('0xe')](0x1f4,_0x422637[_0xcc9c('0x10')]));});});};exports[_0xcc9c('0x1d')]=function(_0x3e4da6){var _0x4f8e42=this;return new Promise(function(_0x1f472d,_0x3e4aeb){return db[_0xcc9c('0x13')]['find']({'raw':_0x3e4da6[_0xcc9c('0x15')]?_0x3e4da6[_0xcc9c('0x15')][_0xcc9c('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e4da6[_0xcc9c('0x15')]?_0x3e4da6[_0xcc9c('0x15')][_0xcc9c('0x16')]||null:null,'attributes':_0x3e4da6['options']?_0x3e4da6['options'][_0xcc9c('0x17')]||null:null,'include':_0x3e4da6['options']?_0x3e4da6[_0xcc9c('0x15')][_0xcc9c('0x19')]?_[_0xcc9c('0x1a')](_0x3e4da6['options'][_0xcc9c('0x19')],function(_0xdd7d47){return{'model':db[_0xdd7d47[_0xcc9c('0x1f')]],'as':_0xdd7d47['as'],'attributes':_0xdd7d47[_0xcc9c('0x17')],'include':_0xdd7d47[_0xcc9c('0x19')]?_[_0xcc9c('0x1a')](_0xdd7d47[_0xcc9c('0x19')],function(_0x4e10e0){return{'model':db[_0x4e10e0[_0xcc9c('0x1f')]],'as':_0x4e10e0['as'],'attributes':_0x4e10e0[_0xcc9c('0x17')],'include':_0x4e10e0[_0xcc9c('0x19')]?_['map'](_0x4e10e0[_0xcc9c('0x19')],function(_0x337afb){return{'model':db[_0x337afb['model']],'as':_0x337afb['as'],'attributes':_0x337afb[_0xcc9c('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcc9c('0x1b')](function(_0x42bf1a){logger[_0xcc9c('0xa')](_0xcc9c('0x1d'),_0x3e4da6);logger[_0xcc9c('0x20')](_0xcc9c('0x1d'),_0x3e4da6,JSON['stringify'](_0x42bf1a));_0x1f472d(_0x42bf1a);})[_0xcc9c('0x11')](function(_0x122a30){logger[_0xcc9c('0xe')](_0xcc9c('0x1d'),_0x122a30['message'],_0x3e4da6);_0x3e4aeb(_0x4f8e42[_0xcc9c('0xe')](0x1f4,_0x122a30[_0xcc9c('0x10')]));});});}; \ No newline at end of file +var _0x4409=['then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','limit','map','include','model','GetTrunk','Trunk','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x4409,0xf0));var _0x9440=function(_0x144452,_0xe68c7d){_0x144452=_0x144452-0x0;var _0x1de835=_0x4409[_0x144452];return _0x1de835;};'use strict';var _=require(_0x9440('0x0'));var util=require(_0x9440('0x1'));var moment=require(_0x9440('0x2'));var BPromise=require('bluebird');var rs=require(_0x9440('0x3'));var fs=require('fs');var Redis=require(_0x9440('0x4'));var db=require(_0x9440('0x5'))['db'];var utils=require(_0x9440('0x6'));var logger=require(_0x9440('0x7'))(_0x9440('0x8'));var config=require(_0x9440('0x9'));var jayson=require(_0x9440('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a9a19,_0x470aca,_0x31171e){return new BPromise(function(_0x177c62,_0x520cb4){return client[_0x9440('0xb')](_0x3a9a19,_0x31171e)[_0x9440('0xc')](function(_0x1b0676){logger[_0x9440('0xd')]('Trunk,\x20%s,\x20%s',_0x470aca,_0x9440('0xe'));logger[_0x9440('0xf')](_0x9440('0x10'),_0x470aca,_0x9440('0xe'),JSON[_0x9440('0x11')](_0x1b0676));if(_0x1b0676[_0x9440('0x12')]){if(_0x1b0676[_0x9440('0x12')][_0x9440('0x13')]===0x1f4){logger[_0x9440('0x12')](_0x9440('0x14'),_0x470aca,_0x1b0676[_0x9440('0x12')][_0x9440('0x15')]);return _0x520cb4(_0x1b0676[_0x9440('0x12')][_0x9440('0x15')]);}logger[_0x9440('0x12')]('Trunk,\x20%s,\x20%s',_0x470aca,_0x1b0676[_0x9440('0x12')]['message']);return _0x177c62(_0x1b0676['error'][_0x9440('0x15')]);}else{logger[_0x9440('0xd')]('Trunk,\x20%s,\x20%s',_0x470aca,'request\x20sent');_0x177c62(_0x1b0676[_0x9440('0x16')][_0x9440('0x15')]);}})[_0x9440('0x17')](function(_0x35d8ce){logger[_0x9440('0x12')](_0x9440('0x14'),_0x470aca,_0x35d8ce);_0x520cb4(_0x35d8ce);});});}exports['GetTrunk']=function(_0x14146e){var _0x9d2c9=this;return new Promise(function(_0x534703,_0x53a74f){return db['Trunk']['findAll']({'raw':_0x14146e[_0x9440('0x18')]?_0x14146e[_0x9440('0x18')][_0x9440('0x19')]===undefined?!![]:![]:!![],'where':_0x14146e[_0x9440('0x18')]?_0x14146e[_0x9440('0x18')][_0x9440('0x1a')]||null:null,'attributes':_0x14146e[_0x9440('0x18')]?_0x14146e[_0x9440('0x18')][_0x9440('0x1b')]||null:null,'limit':_0x14146e[_0x9440('0x18')]?_0x14146e[_0x9440('0x18')][_0x9440('0x1c')]||null:null,'include':_0x14146e['options']?_0x14146e['options']['include']?_[_0x9440('0x1d')](_0x14146e[_0x9440('0x18')][_0x9440('0x1e')],function(_0x396ed5){return{'model':db[_0x396ed5[_0x9440('0x1f')]],'as':_0x396ed5['as'],'attributes':_0x396ed5[_0x9440('0x1b')],'include':_0x396ed5[_0x9440('0x1e')]?_[_0x9440('0x1d')](_0x396ed5[_0x9440('0x1e')],function(_0x57b35f){return{'model':db[_0x57b35f[_0x9440('0x1f')]],'as':_0x57b35f['as'],'attributes':_0x57b35f[_0x9440('0x1b')],'include':_0x57b35f[_0x9440('0x1e')]?_[_0x9440('0x1d')](_0x57b35f[_0x9440('0x1e')],function(_0x4cd50e){return{'model':db[_0x4cd50e[_0x9440('0x1f')]],'as':_0x4cd50e['as'],'attributes':_0x4cd50e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9440('0xc')](function(_0x4d352d){logger[_0x9440('0xd')](_0x9440('0x20'),_0x14146e);logger['debug'](_0x9440('0x20'),_0x14146e,JSON[_0x9440('0x11')](_0x4d352d));_0x534703(_0x4d352d);})[_0x9440('0x17')](function(_0x5a6bcf){logger[_0x9440('0x12')](_0x9440('0x20'),_0x5a6bcf['message'],_0x14146e);_0x53a74f(_0x9d2c9[_0x9440('0x12')](0x1f4,_0x5a6bcf[_0x9440('0x15')]));});});};exports['ShowTrunk']=function(_0xccfab4){var _0x5bea2e=this;return new Promise(function(_0x4f8b3e,_0x2140da){return db[_0x9440('0x21')][_0x9440('0x22')]({'raw':_0xccfab4[_0x9440('0x18')]?_0xccfab4[_0x9440('0x18')][_0x9440('0x19')]===undefined?!![]:![]:!![],'where':_0xccfab4[_0x9440('0x18')]?_0xccfab4[_0x9440('0x18')]['where']||null:null,'attributes':_0xccfab4[_0x9440('0x18')]?_0xccfab4[_0x9440('0x18')][_0x9440('0x1b')]||null:null,'include':_0xccfab4[_0x9440('0x18')]?_0xccfab4[_0x9440('0x18')][_0x9440('0x1e')]?_[_0x9440('0x1d')](_0xccfab4[_0x9440('0x18')][_0x9440('0x1e')],function(_0x570e71){return{'model':db[_0x570e71[_0x9440('0x1f')]],'as':_0x570e71['as'],'attributes':_0x570e71['attributes'],'include':_0x570e71['include']?_[_0x9440('0x1d')](_0x570e71[_0x9440('0x1e')],function(_0x2a2f51){return{'model':db[_0x2a2f51[_0x9440('0x1f')]],'as':_0x2a2f51['as'],'attributes':_0x2a2f51['attributes'],'include':_0x2a2f51[_0x9440('0x1e')]?_[_0x9440('0x1d')](_0x2a2f51[_0x9440('0x1e')],function(_0x4eeb8f){return{'model':db[_0x4eeb8f[_0x9440('0x1f')]],'as':_0x4eeb8f['as'],'attributes':_0x4eeb8f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33e907){logger[_0x9440('0xd')]('ShowTrunk',_0xccfab4);logger['debug']('ShowTrunk',_0xccfab4,JSON['stringify'](_0x33e907));_0x4f8b3e(_0x33e907);})[_0x9440('0x17')](function(_0x76997d){logger[_0x9440('0x12')](_0x9440('0x23'),_0x76997d[_0x9440('0x15')],_0xccfab4);_0x2140da(_0x5bea2e[_0x9440('0x12')](0x1f4,_0x76997d['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 86d7aa6..70a5df5 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 _0xfd86=['whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami'];(function(_0x10ca09,_0x3a726a){var _0x272317=function(_0xc7f03f){while(--_0xc7f03f){_0x10ca09['push'](_0x10ca09['shift']());}};_0x272317(++_0x3a726a);}(_0xfd86,0x15c));var _0x6fd8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xfd86[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x6fd8('0x0'));var util=require(_0x6fd8('0x1'));var path=require('path');var timeout=require(_0x6fd8('0x2'));var express=require('express');var router=express[_0x6fd8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6fd8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6fd8('0x5'));var controller=require(_0x6fd8('0x6'));router[_0x6fd8('0x7')]('/',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x9')]);router[_0x6fd8('0x7')](_0x6fd8('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x6fd8('0x7')](_0x6fd8('0xb'),auth['isAuthenticated'](),controller[_0x6fd8('0xc')]);router[_0x6fd8('0x7')](_0x6fd8('0xd'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0xe')]);router['get'](_0x6fd8('0xf'),auth['isAuthenticated'](),controller[_0x6fd8('0x10')]);router[_0x6fd8('0x7')]('/:id/avatar',controller[_0x6fd8('0x11')]);router[_0x6fd8('0x7')](_0x6fd8('0x12'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x6fd8('0x7')](_0x6fd8('0x13'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x14')]);router['get'](_0x6fd8('0x15'),auth['isAuthenticated'](),controller[_0x6fd8('0x16')]);router['get'](_0x6fd8('0x17'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x18')]);router['get'](_0x6fd8('0x19'),auth['isAuthenticated'](),controller['getGroups']);router['get']('/:id/recordings',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x1a')]);router['get']('/:id/screen_recordings',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x1b')]);router[_0x6fd8('0x7')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x6fd8('0x1c')]);router['get']('/:id/openchannel/interactions',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x1d')]);router[_0x6fd8('0x7')](_0x6fd8('0x1e'),auth['isAuthenticated'](),controller[_0x6fd8('0x1f')]);router[_0x6fd8('0x7')](_0x6fd8('0x20'),auth['isAuthenticated'](),controller[_0x6fd8('0x21')]);router['get'](_0x6fd8('0x22'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x23')]);router['get'](_0x6fd8('0x24'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x25')]);router['get'](_0x6fd8('0x26'),auth[_0x6fd8('0x8')](),controller['getTeams']);router['get'](_0x6fd8('0x27'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x28')]);router['get'](_0x6fd8('0x29'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x2a')]);router[_0x6fd8('0x7')](_0x6fd8('0x2b'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x2c')]);router[_0x6fd8('0x7')]('/:id/fax_accounts',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x2d')]);router[_0x6fd8('0x7')](_0x6fd8('0x2e'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x2f')]);router[_0x6fd8('0x7')](_0x6fd8('0x30'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x31')]);router[_0x6fd8('0x7')](_0x6fd8('0x32'),auth['isAuthenticated'](),controller[_0x6fd8('0x33')]);router[_0x6fd8('0x7')]('/:id/chat_websites',auth[_0x6fd8('0x8')](),controller['getChatWebsites']);router[_0x6fd8('0x7')](_0x6fd8('0x34'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x35')]);router[_0x6fd8('0x7')](_0x6fd8('0x36'),auth[_0x6fd8('0x8')](),controller['getSquareProjects']);router['get'](_0x6fd8('0x37'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x38')]);router[_0x6fd8('0x7')]('/:id/api_key',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x39')]);router[_0x6fd8('0x3a')]('/:id/contacts',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x3b')]);router[_0x6fd8('0x3a')]('/',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x3c')]);router[_0x6fd8('0x3a')]('/create_many',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x3d')]);router[_0x6fd8('0x3a')](_0x6fd8('0x15'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x3e')]);var upload=multer({'storage':multer[_0x6fd8('0x3f')]({'destination':function(_0x11a307,_0x44ccd9,_0xde79ac){_0xde79ac(null,path[_0x6fd8('0x40')](config[_0x6fd8('0x41')],'server/files/images/'));},'filename':function(_0x3660a9,_0x199c7e,_0x16b42f){_0x16b42f(null,util[_0x6fd8('0x42')](_0x6fd8('0x43'),Date['now'](),_0x199c7e[_0x6fd8('0x44')]));}})});router[_0x6fd8('0x3a')](_0x6fd8('0x45'),upload[_0x6fd8('0x46')](_0x6fd8('0x47')),controller[_0x6fd8('0x48')]);router[_0x6fd8('0x3a')](_0x6fd8('0x49'),auth[_0x6fd8('0x8')](),controller['login']);router[_0x6fd8('0x3a')](_0x6fd8('0x4a'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x4b')]);router[_0x6fd8('0x3a')](_0x6fd8('0x4c'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x4d')]);router[_0x6fd8('0x3a')](_0x6fd8('0x4e'),auth['isAuthenticated'](),controller[_0x6fd8('0x4f')]);router[_0x6fd8('0x3a')](_0x6fd8('0x26'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x50')]);router[_0x6fd8('0x3a')](_0x6fd8('0x51'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x52')]);router[_0x6fd8('0x3a')](_0x6fd8('0x53'),auth['isAuthenticated'](),controller[_0x6fd8('0x54')]);router[_0x6fd8('0x3a')](_0x6fd8('0x55'),auth[_0x6fd8('0x8')](),controller['addFaxInteractions']);router[_0x6fd8('0x3a')](_0x6fd8('0x56'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x57')]);router['post'](_0x6fd8('0x58'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x59')]);router[_0x6fd8('0x3a')](_0x6fd8('0x5a'),auth['isAuthenticated'](),controller[_0x6fd8('0x5b')]);router[_0x6fd8('0x3a')](_0x6fd8('0x5c'),auth['isAuthenticated'](),controller[_0x6fd8('0x5d')]);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x6fd8('0x5e')]);router[_0x6fd8('0x3a')](_0x6fd8('0x30'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x5f')]);router[_0x6fd8('0x3a')](_0x6fd8('0x32'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x60')]);router[_0x6fd8('0x3a')](_0x6fd8('0x61'),auth['isAuthenticated'](),controller[_0x6fd8('0x62')]);router[_0x6fd8('0x3a')]('/:id/whatsapp_accounts',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x63')]);router[_0x6fd8('0x3a')](_0x6fd8('0x36'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x64')]);router[_0x6fd8('0x3a')](_0x6fd8('0x65'),auth[_0x6fd8('0x8')](),controller['createApiKey']);router[_0x6fd8('0x66')]('/:id',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x67')]);router[_0x6fd8('0x66')](_0x6fd8('0x68'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x69')]);router[_0x6fd8('0x6a')](_0x6fd8('0x15'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x6b')]);router['delete']('/:id/teams',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x6c')]);router['delete']('/:id',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x6d')]);router[_0x6fd8('0x6a')](_0x6fd8('0x51'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x6e')]);router[_0x6fd8('0x6a')](_0x6fd8('0x53'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x6f')]);router['delete'](_0x6fd8('0x55'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x70')]);router['delete'](_0x6fd8('0x56'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x6fd8('0x6a')](_0x6fd8('0x58'),auth[_0x6fd8('0x8')](),controller['removeOpenchannelInteractions']);router[_0x6fd8('0x6a')]('/:id/whatsapp_interactions',auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x71')]);router['delete'](_0x6fd8('0x5c'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x72')]);router[_0x6fd8('0x6a')]('/:id/mail_accounts',auth[_0x6fd8('0x8')](),controller['removeMailAccounts']);router[_0x6fd8('0x6a')]('/:id/openchannel_accounts',auth[_0x6fd8('0x8')](),controller['removeOpenchannelAccounts']);router[_0x6fd8('0x6a')](_0x6fd8('0x32'),auth['isAuthenticated'](),controller[_0x6fd8('0x73')]);router[_0x6fd8('0x6a')](_0x6fd8('0x61'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x74')]);router[_0x6fd8('0x6a')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x6fd8('0x75')]);router[_0x6fd8('0x6a')](_0x6fd8('0x36'),auth[_0x6fd8('0x8')](),controller[_0x6fd8('0x76')]);router[_0x6fd8('0x6a')]('/:id/api_key',auth[_0x6fd8('0x8')](),controller['removeApiKey']);module[_0x6fd8('0x77')]=router; \ No newline at end of file +var _0xe1dd=['bulkCreate','/:id/queues','addQueues','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id','put','/:id/password','changePassword','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many'];(function(_0x5f52a4,_0x5706d9){var _0xde1bce=function(_0x16ef65){while(--_0x16ef65){_0x5f52a4['push'](_0x5f52a4['shift']());}};_0xde1bce(++_0x5706d9);}(_0xe1dd,0x1e5));var _0xde1d=function(_0x505a71,_0x1bb20a){_0x505a71=_0x505a71-0x0;var _0x17a6fc=_0xe1dd[_0x505a71];return _0x17a6fc;};'use strict';var multer=require('multer');var util=require(_0xde1d('0x0'));var path=require(_0xde1d('0x1'));var timeout=require('connect-timeout');var express=require(_0xde1d('0x2'));var router=express[_0xde1d('0x3')]();var fs_extra=require(_0xde1d('0x4'));var auth=require(_0xde1d('0x5'));var interaction=require(_0xde1d('0x6'));var config=require(_0xde1d('0x7'));var controller=require(_0xde1d('0x8'));router[_0xde1d('0x9')]('/',auth[_0xde1d('0xa')](),controller['index']);router[_0xde1d('0x9')](_0xde1d('0xb'),auth['isAuthenticated'](),controller[_0xde1d('0xc')]);router[_0xde1d('0x9')](_0xde1d('0xd'),auth[_0xde1d('0xa')](),controller[_0xde1d('0xe')]);router[_0xde1d('0x9')](_0xde1d('0xf'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x10')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xde1d('0x11')]);router[_0xde1d('0x9')](_0xde1d('0x12'),controller[_0xde1d('0x13')]);router[_0xde1d('0x9')](_0xde1d('0x14'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x15')]);router[_0xde1d('0x9')]('/:id/contacts',auth[_0xde1d('0xa')](),controller[_0xde1d('0x16')]);router[_0xde1d('0x9')]('/:id/queues',auth[_0xde1d('0xa')](),controller['getQueues']);router[_0xde1d('0x9')](_0xde1d('0x17'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x18')]);router[_0xde1d('0x9')](_0xde1d('0x19'),auth[_0xde1d('0xa')](),controller['getGroups']);router[_0xde1d('0x9')](_0xde1d('0x1a'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x1b')]);router[_0xde1d('0x9')]('/:id/screen_recordings',auth[_0xde1d('0xa')](),controller[_0xde1d('0x1c')]);router[_0xde1d('0x9')](_0xde1d('0x1d'),auth['isAuthenticated'](),controller[_0xde1d('0x1e')]);router['get'](_0xde1d('0x1f'),auth['isAuthenticated'](),controller[_0xde1d('0x20')]);router['get'](_0xde1d('0x21'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x22')]);router['get'](_0xde1d('0x23'),auth[_0xde1d('0xa')](),controller['getSmsInteractions']);router[_0xde1d('0x9')](_0xde1d('0x24'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x25')]);router[_0xde1d('0x9')](_0xde1d('0x26'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x27')]);router['get'](_0xde1d('0x28'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x29')]);router[_0xde1d('0x9')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xde1d('0x9')](_0xde1d('0x2a'),auth['isAuthenticated'](),controller[_0xde1d('0x2b')]);router[_0xde1d('0x9')](_0xde1d('0x2c'),auth['isAuthenticated'](),controller[_0xde1d('0x2d')]);router[_0xde1d('0x9')](_0xde1d('0x2e'),auth['isAuthenticated'](),controller[_0xde1d('0x2f')]);router['get'](_0xde1d('0x30'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x31')]);router[_0xde1d('0x9')]('/:id/openchannel_accounts',auth[_0xde1d('0xa')](),controller[_0xde1d('0x32')]);router['get'](_0xde1d('0x33'),auth[_0xde1d('0xa')](),controller['getSmsAccounts']);router[_0xde1d('0x9')](_0xde1d('0x34'),auth[_0xde1d('0xa')](),controller['getChatWebsites']);router[_0xde1d('0x9')](_0xde1d('0x35'),auth['isAuthenticated'](),controller[_0xde1d('0x36')]);router[_0xde1d('0x9')](_0xde1d('0x37'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x38')]);router[_0xde1d('0x9')](_0xde1d('0x39'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x3a')]);router[_0xde1d('0x9')](_0xde1d('0x3b'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x3c')]);router[_0xde1d('0x3d')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xde1d('0x3e')]);router[_0xde1d('0x3d')]('/',auth[_0xde1d('0xa')](),controller[_0xde1d('0x3f')]);router[_0xde1d('0x3d')](_0xde1d('0x40'),auth['isAuthenticated'](),controller[_0xde1d('0x41')]);router[_0xde1d('0x3d')](_0xde1d('0x42'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x43')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3250b3,_0x3c3066,_0x217dc6){_0x217dc6(null,path[_0xde1d('0x44')](config['root'],_0xde1d('0x45')));},'filename':function(_0x3b9b79,_0x386b37,_0x1a7215){_0x1a7215(null,util[_0xde1d('0x46')](_0xde1d('0x47'),Date[_0xde1d('0x48')](),_0x386b37[_0xde1d('0x49')]));}})});router[_0xde1d('0x3d')](_0xde1d('0x12'),upload[_0xde1d('0x4a')](_0xde1d('0x4b')),controller[_0xde1d('0x4c')]);router[_0xde1d('0x3d')](_0xde1d('0x4d'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x4e')]);router[_0xde1d('0x3d')]('/:id/logout',auth[_0xde1d('0xa')](),controller[_0xde1d('0x4f')]);router[_0xde1d('0x3d')](_0xde1d('0x50'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x51')]);router[_0xde1d('0x3d')](_0xde1d('0x52'),auth[_0xde1d('0xa')](),controller['unpause']);router['post'](_0xde1d('0x28'),auth[_0xde1d('0xa')](),controller['addTeams']);router['post']('/:id/chat_interactions',auth[_0xde1d('0xa')](),controller['addChatInteractions']);router['post'](_0xde1d('0x53'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x54')]);router[_0xde1d('0x3d')]('/:id/fax_interactions',auth[_0xde1d('0xa')](),controller[_0xde1d('0x55')]);router[_0xde1d('0x3d')](_0xde1d('0x56'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x57')]);router[_0xde1d('0x3d')]('/:id/openchannel_interactions',auth[_0xde1d('0xa')](),controller['addOpenchannelInteractions']);router[_0xde1d('0x3d')](_0xde1d('0x58'),auth[_0xde1d('0xa')](),controller['addWhatsappInteractions']);router['post'](_0xde1d('0x2e'),auth[_0xde1d('0xa')](),controller['addFaxAccounts']);router[_0xde1d('0x3d')](_0xde1d('0x30'),auth[_0xde1d('0xa')](),controller['addMailAccounts']);router[_0xde1d('0x3d')](_0xde1d('0x59'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x5a')]);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xde1d('0x5b')]);router[_0xde1d('0x3d')](_0xde1d('0x34'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x5c')]);router[_0xde1d('0x3d')]('/:id/whatsapp_accounts',auth[_0xde1d('0xa')](),controller[_0xde1d('0x5d')]);router['post'](_0xde1d('0x37'),auth[_0xde1d('0xa')](),controller['addSquareProjects']);router[_0xde1d('0x3d')](_0xde1d('0x3b'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0xde1d('0x5e'),auth[_0xde1d('0xa')](),controller['update']);router[_0xde1d('0x5f')](_0xde1d('0x60'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x61')]);router[_0xde1d('0x62')]('/:id/queues',auth[_0xde1d('0xa')](),controller['removeQueues']);router['delete'](_0xde1d('0x28'),auth[_0xde1d('0xa')](),controller['removeTeams']);router['delete'](_0xde1d('0x5e'),auth[_0xde1d('0xa')](),controller['destroy']);router[_0xde1d('0x62')](_0xde1d('0x63'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x64')]);router[_0xde1d('0x62')](_0xde1d('0x53'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x65')]);router[_0xde1d('0x62')]('/:id/fax_interactions',auth[_0xde1d('0xa')](),controller[_0xde1d('0x66')]);router[_0xde1d('0x62')](_0xde1d('0x56'),auth[_0xde1d('0xa')](),controller['removeSmsInteractions']);router[_0xde1d('0x62')](_0xde1d('0x67'),auth[_0xde1d('0xa')](),controller['removeOpenchannelInteractions']);router[_0xde1d('0x62')](_0xde1d('0x58'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x68')]);router['delete']('/:id/fax_accounts',auth[_0xde1d('0xa')](),controller['removeFaxAccounts']);router[_0xde1d('0x62')](_0xde1d('0x30'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x69')]);router['delete'](_0xde1d('0x59'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x6a')]);router[_0xde1d('0x62')](_0xde1d('0x33'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x6b')]);router[_0xde1d('0x62')](_0xde1d('0x34'),auth[_0xde1d('0xa')](),controller[_0xde1d('0x6c')]);router[_0xde1d('0x62')](_0xde1d('0x35'),auth[_0xde1d('0xa')](),controller['removeWhatsappAccounts']);router[_0xde1d('0x62')](_0xde1d('0x37'),auth[_0xde1d('0xa')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth['isAuthenticated'](),controller[_0xde1d('0x6d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 0a6b6de..3d8cfeb 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 _0xaf5a=['dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','rtcp_mux','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','screenrecording','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','agent','telephone','INTEGER','accountcode','getDataValue','DATE','BOOLEAN','DEFAULT\x20PAUSE','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uas','fingerprint','active','passive','actpass','nonat','update,nonat','TEXT','showWebBar','get','isArray','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsenable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf5a,0x116));var _0xaaf5=function(_0x405aeb,_0x5ee732){_0x405aeb=_0x405aeb-0x0;var _0x50e76a=_0xaf5a[_0x405aeb];return _0x50e76a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaaf5('0x0'));var util=require(_0xaaf5('0x1'));var _=require(_0xaaf5('0x2'));module[_0xaaf5('0x3')]={'name':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':![],'unique':_0xaaf5('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5c55af){this[_0xaaf5('0x6')]('name',_0x5c55af);this[_0xaaf5('0x6')](_0xaaf5('0x7'),_0x5c55af);},'comment':_0xaaf5('0x8')},'fullname':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':![],'set':function(_0x5890d2){this['setDataValue'](_0xaaf5('0x9'),_0x5890d2);this[_0xaaf5('0x6')](_0xaaf5('0xa'),util[_0xaaf5('0xb')](_0xaaf5('0xc'),_0x5890d2,this['getDataValue'](_0xaaf5('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaaf5('0xe'),'validate':{'isEmail':!![]},'set':function(_0x46e850){if(_0x46e850){this['setDataValue'](_0xaaf5('0xe'),_0x46e850[_0xaaf5('0xf')]());}}},'role':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x11'),'user',_0xaaf5('0x12'),_0xaaf5('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xaaf5('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':![],'unique':_0xaaf5('0xd'),'set':function(_0x35d891){this[_0xaaf5('0x6')]('internal',_0x35d891);this[_0xaaf5('0x6')](_0xaaf5('0x15'),_0x35d891);this[_0xaaf5('0x6')](_0xaaf5('0xa'),util[_0xaaf5('0xb')](_0xaaf5('0xc'),this[_0xaaf5('0x16')]('fullname'),_0x35d891));}},'salt':{'type':Sequelize[_0xaaf5('0x4')]},'phone':{'type':Sequelize[_0xaaf5('0x4')]},'mobile':{'type':Sequelize[_0xaaf5('0x4')]},'address':{'type':Sequelize[_0xaaf5('0x4')]},'zipcode':{'type':Sequelize[_0xaaf5('0x4')]},'userpic':{'type':Sequelize[_0xaaf5('0x4')]},'city':{'type':Sequelize[_0xaaf5('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xaaf5('0x17')]},'voicePause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xaaf5('0x4')],'defaultValue':_0xaaf5('0x19')},'lastPauseAt':{'type':Sequelize[_0xaaf5('0x17')]},'chatCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xaaf5('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xaaf5('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xaaf5('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xaaf5('0x10')]('friend','user',_0xaaf5('0x1a')),'allowNull':!![],'defaultValue':_0xaaf5('0x1b')},'context':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![],'defaultValue':_0xaaf5('0x1c')},'callingpres':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x1d'),'ALLOWED_PASSED_SCREEN',_0xaaf5('0x1e'),'ALLOWED',_0xaaf5('0x1f'),_0xaaf5('0x20'),'PROHIB_FAILED_SCREEN',_0xaaf5('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xaaf5('0x22'),'set':function(_0x326cb8){this['setDataValue'](_0xaaf5('0x23'),_0x326cb8?_0x326cb8['join'](','):null);},'get':function(){return this[_0xaaf5('0x16')](_0xaaf5('0x23'))?this['getDataValue'](_0xaaf5('0x23'))['split'](','):null;},'comment':_0xaaf5('0x24')},'dtmfmode':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x25'),_0xaaf5('0x26'),_0xaaf5('0x27'),_0xaaf5('0x28'),_0xaaf5('0x29')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no','nonat',_0xaaf5('0x2b'),_0xaaf5('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![],'defaultValue':_0xaaf5('0x2d'),'set':function(_0x94b582){this[_0xaaf5('0x6')](_0xaaf5('0x2e'),_0x94b582?_0x94b582['join'](','):null);},'get':function(){return this[_0xaaf5('0x16')](_0xaaf5('0x2e'))?this['getDataValue'](_0xaaf5('0x2e'))[_0xaaf5('0x2f')](','):null;},'comment':_0xaaf5('0x30')},'callgroup':{'type':Sequelize[_0xaaf5('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xaaf5('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaaf5('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaaf5('0x4')]},'disallow':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':![],'defaultValue':_0xaaf5('0x31')},'allow':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':![],'defaultValue':_0xaaf5('0x32'),'set':function(_0x43a126){this[_0xaaf5('0x6')](_0xaaf5('0x33'),_0x43a126?_0x43a126[_0xaaf5('0x34')](';'):_0xaaf5('0x32'));},'get':function(){return this[_0xaaf5('0x16')]('allow')?this[_0xaaf5('0x16')](_0xaaf5('0x33'))[_0xaaf5('0x2f')](';'):null;},'comment':_0xaaf5('0x35')},'autoframing':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![],'set':function(_0x4ac627){this[_0xaaf5('0x6')](_0xaaf5('0x36'),_0x4ac627?_0x4ac627[_0xaaf5('0x34')](','):null);},'get':function(){return this[_0xaaf5('0x16')](_0xaaf5('0x36'))?this[_0xaaf5('0x16')](_0xaaf5('0x36'))[_0xaaf5('0x2f')](','):null;},'comment':_0xaaf5('0x37')},'trustrpid':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xaaf5('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no',_0xaaf5('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xaaf5('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0xaaf5('0x2a')},'busylevel':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xaaf5('0x10')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xaaf5('0x39'),_0xaaf5('0x3a'),_0xaaf5('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xaaf5('0x10')]('uac',_0xaaf5('0x3c')),'allowNull':!![],'defaultValue':_0xaaf5('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xaaf5('0x2a')},'keepalive':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xaaf5('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xaaf5('0x2a'),'no',_0xaaf5('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xaaf5('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x3e'),_0xaaf5('0x3f'),_0xaaf5('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no',_0xaaf5('0x41'),'update',_0xaaf5('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xaaf5('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xaaf5('0x17')]},'passwordResetAt':{'type':Sequelize[_0xaaf5('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xaaf5('0x43')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x41b9c2){this[_0xaaf5('0x6')](_0xaaf5('0x44'),_0x41b9c2);var _0x36b20d=this[_0xaaf5('0x45')]({'plain':!![]});switch(_0x41b9c2){case 0x0:case 0x1:var _0x3bba18=_0x36b20d[_0xaaf5('0x23')]?_[_0xaaf5('0x46')](_0x36b20d[_0xaaf5('0x23')])?_0x36b20d[_0xaaf5('0x23')][_0xaaf5('0x34')]():_0x36b20d[_0xaaf5('0x23')]:_0xaaf5('0x22');if(_0x3bba18==='wss'){_0x3bba18=_0xaaf5('0x22');}this[_0xaaf5('0x6')](_0xaaf5('0x23'),_0x3bba18);this[_0xaaf5('0x6')](_0xaaf5('0x47'),'no');this[_0xaaf5('0x6')](_0xaaf5('0x48'),null);this[_0xaaf5('0x6')](_0xaaf5('0x49'),null);this['setDataValue'](_0xaaf5('0x4a'),null);this['setDataValue']('dtlsenable',null);this[_0xaaf5('0x6')](_0xaaf5('0x4b'),null);this[_0xaaf5('0x6')]('dtlssetup',null);this['setDataValue'](_0xaaf5('0x4c'),null);this['setDataValue']('dtlsprivatekey',null);this[_0xaaf5('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xaaf5('0x6')](_0xaaf5('0x23'),'wss');this[_0xaaf5('0x6')]('encryption',_0xaaf5('0x2a'));this['setDataValue'](_0xaaf5('0x48'),'yes');this[_0xaaf5('0x6')](_0xaaf5('0x49'),_0xaaf5('0x2a'));this[_0xaaf5('0x6')]('icesupport',_0xaaf5('0x2a'));this[_0xaaf5('0x6')](_0xaaf5('0x4d'),_0xaaf5('0x2a'));this[_0xaaf5('0x6')](_0xaaf5('0x4b'),'no');this[_0xaaf5('0x6')](_0xaaf5('0x4e'),_0xaaf5('0x40'));this[_0xaaf5('0x6')](_0xaaf5('0x4c'),_0x36b20d[_0xaaf5('0x4c')]||_0xaaf5('0x4f'));this['setDataValue'](_0xaaf5('0x50'),_0x36b20d['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xaaf5('0x6')](_0xaaf5('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x59ed95){this[_0xaaf5('0x6')]('permissions',_0x59ed95?_0x59ed95['join'](','):[]);},'get':function(){return this[_0xaaf5('0x16')]('permissions')?_[_0xaaf5('0x52')](this[_0xaaf5('0x16')](_0xaaf5('0x53'))[_0xaaf5('0x2f')](','),function(_0x57ae08){return parseInt(_0x57ae08,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xaaf5('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xaaf5('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xaaf5('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xaaf5('0x10')](_0xaaf5('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xaaf5('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xaaf5('0x54')],'get':function(){return this[_0xaaf5('0x16')](_0xaaf5('0x55'))?this[_0xaaf5('0x16')](_0xaaf5('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xaaf5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![],'set':function(_0x220aeb){if(typeof _0x220aeb==='string'){var _0x238b4e=_0x220aeb==='1'?!![]:_0x220aeb==='0'?![]:_0x220aeb==='true'?!![]:_0x220aeb==='false'?![]:![];this['setDataValue'](_0xaaf5('0x56'),_0x238b4e);}else{this[_0xaaf5('0x6')](_0xaaf5('0x56'),_0x220aeb);}}},'blocked':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![],'set':function(_0xbfbeeb){this[_0xaaf5('0x6')]('blocked',_0xbfbeeb);if(_0xbfbeeb===!![]){this['setDataValue'](_0xaaf5('0x57'),moment());this[_0xaaf5('0x6')]('loginAttempts',0x0);}else{this[_0xaaf5('0x6')](_0xaaf5('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xaaf5('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xaaf5('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xaaf5('0x14')](0x5)[_0xaaf5('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xaaf5('0x18')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc6c0=['join','transport','split','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','active','passive','update,nonat','TEXT','get','wss','encryption','force_avp','icesupport','dtlssetup','dtlscertfile','dtlsprivatekey','dtlsenable','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','agent','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp'];(function(_0x5a494c,_0x245a02){var _0x128c0c=function(_0x5694bf){while(--_0x5694bf){_0x5a494c['push'](_0x5a494c['shift']());}};_0x128c0c(++_0x245a02);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc6c0[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x0c6c('0x0'));var moment=require('moment');var util=require(_0x0c6c('0x1'));var _=require(_0x0c6c('0x2'));module[_0x0c6c('0x3')]={'name':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':![],'unique':_0x0c6c('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1d9169){this[_0x0c6c('0x6')](_0x0c6c('0x5'),_0x1d9169);this[_0x0c6c('0x6')](_0x0c6c('0x7'),_0x1d9169);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1791cb){this[_0x0c6c('0x6')](_0x0c6c('0x8'),_0x1791cb);this[_0x0c6c('0x6')](_0x0c6c('0x9'),util[_0x0c6c('0xa')](_0x0c6c('0xb'),_0x1791cb,this[_0x0c6c('0xc')](_0x0c6c('0xd'))));}},'alias':{'type':Sequelize[_0x0c6c('0x4')]},'email':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':![],'unique':_0x0c6c('0xe'),'validate':{'isEmail':!![]},'set':function(_0x238229){if(_0x238229){this[_0x0c6c('0x6')](_0x0c6c('0xe'),_0x238229['toLowerCase']());}}},'role':{'type':Sequelize[_0x0c6c('0xf')]('admin',_0x0c6c('0x10'),_0x0c6c('0x11'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0c6c('0x4')],'defaultValue':_0x0c6c('0x12')},'internal':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':![],'unique':_0x0c6c('0xd'),'set':function(_0x538b89){this[_0x0c6c('0x6')](_0x0c6c('0xd'),_0x538b89);this[_0x0c6c('0x6')](_0x0c6c('0x14'),_0x538b89);this[_0x0c6c('0x6')](_0x0c6c('0x9'),util[_0x0c6c('0xa')]('\x22%s\x22\x20<%s>',this[_0x0c6c('0xc')]('fullname'),_0x538b89));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0c6c('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x0c6c('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0c6c('0x4')]},'country':{'type':Sequelize[_0x0c6c('0x4')]},'online':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0c6c('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0c6c('0x4')],'defaultValue':_0x0c6c('0x17')},'lastPauseAt':{'type':Sequelize[_0x0c6c('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0c6c('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0c6c('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![],'defaultValue':_0x0c6c('0x18')},'ipaddr':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x0c6c('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x0c6c('0x19'),_0x0c6c('0x10'),_0x0c6c('0x1a')),'allowNull':!![],'defaultValue':_0x0c6c('0x19')},'context':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![],'defaultValue':_0x0c6c('0x1b')},'callingpres':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x1c'),'ALLOWED_PASSED_SCREEN',_0x0c6c('0x1d'),_0x0c6c('0x1e'),'PROHIB_NOT_SCREENED',_0x0c6c('0x1f'),'PROHIB_FAILED_SCREEN',_0x0c6c('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![],'defaultValue':_0x0c6c('0x21'),'set':function(_0x391308){this['setDataValue']('transport',_0x391308?_0x391308[_0x0c6c('0x22')](','):null);},'get':function(){return this[_0x0c6c('0xc')](_0x0c6c('0x23'))?this[_0x0c6c('0xc')](_0x0c6c('0x23'))[_0x0c6c('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0c6c('0xf')]('rfc2833',_0x0c6c('0x25'),'shortinfo',_0x0c6c('0x26'),_0x0c6c('0x27')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no',_0x0c6c('0x29'),_0x0c6c('0x2a'),_0x0c6c('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![],'defaultValue':_0x0c6c('0x2c'),'set':function(_0x3829e8){this['setDataValue'](_0x0c6c('0x2d'),_0x3829e8?_0x3829e8[_0x0c6c('0x22')](','):null);},'get':function(){return this[_0x0c6c('0xc')](_0x0c6c('0x2d'))?this[_0x0c6c('0xc')](_0x0c6c('0x2d'))[_0x0c6c('0x24')](','):null;},'comment':_0x0c6c('0x2e')},'callgroup':{'type':Sequelize[_0x0c6c('0x4')]},'namedcallgroup':{'type':Sequelize[_0x0c6c('0x4')]},'pickupgroup':{'type':Sequelize[_0x0c6c('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x0c6c('0x4')]},'language':{'type':Sequelize[_0x0c6c('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0c6c('0x4')]},'disallow':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':![],'defaultValue':_0x0c6c('0x2f')},'allow':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':![],'defaultValue':_0x0c6c('0x30'),'set':function(_0x42ce5c){this[_0x0c6c('0x6')](_0x0c6c('0x31'),_0x42ce5c?_0x42ce5c[_0x0c6c('0x22')](';'):_0x0c6c('0x30'));},'get':function(){return this[_0x0c6c('0xc')](_0x0c6c('0x31'))?this[_0x0c6c('0xc')]('allow')[_0x0c6c('0x24')](';'):null;},'comment':_0x0c6c('0x32')},'autoframing':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![],'set':function(_0x3685e1){this[_0x0c6c('0x6')](_0x0c6c('0x33'),_0x3685e1?_0x3685e1[_0x0c6c('0x22')](','):null);},'get':function(){return this[_0x0c6c('0xc')]('insecure')?this['getDataValue'](_0x0c6c('0x33'))[_0x0c6c('0x24')](','):null;},'comment':_0x0c6c('0x34')},'trustrpid':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no',_0x0c6c('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0c6c('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0c6c('0x36')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0c6c('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no',_0x0c6c('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0c6c('0xf')]('accept',_0x0c6c('0x38'),_0x0c6c('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x3a'),_0x0c6c('0x3b')),'allowNull':!![],'defaultValue':_0x0c6c('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0c6c('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no',_0x0c6c('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x3d'),_0x0c6c('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0c6c('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0c6c('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0c6c('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no',_0x0c6c('0x29'),_0x0c6c('0x2a'),_0x0c6c('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0c6c('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x0c6c('0x16')]},'passwordResetAt':{'type':Sequelize[_0x0c6c('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0c6c('0x40')]},'showWebBar':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0,'set':function(_0x54dc3d){this[_0x0c6c('0x6')]('showWebBar',_0x54dc3d);var _0x420d8e=this[_0x0c6c('0x41')]({'plain':!![]});switch(_0x54dc3d){case 0x0:case 0x1:var _0x4dfea9=_0x420d8e[_0x0c6c('0x23')]?_['isArray'](_0x420d8e[_0x0c6c('0x23')])?_0x420d8e[_0x0c6c('0x23')][_0x0c6c('0x22')]():_0x420d8e[_0x0c6c('0x23')]:_0x0c6c('0x21');if(_0x4dfea9===_0x0c6c('0x42')){_0x4dfea9=_0x0c6c('0x21');}this[_0x0c6c('0x6')](_0x0c6c('0x23'),_0x4dfea9);this['setDataValue'](_0x0c6c('0x43'),'no');this[_0x0c6c('0x6')]('avpf',null);this[_0x0c6c('0x6')](_0x0c6c('0x44'),null);this[_0x0c6c('0x6')](_0x0c6c('0x45'),null);this[_0x0c6c('0x6')]('dtlsenable',null);this[_0x0c6c('0x6')]('dtlsverify',null);this[_0x0c6c('0x6')](_0x0c6c('0x46'),null);this[_0x0c6c('0x6')](_0x0c6c('0x47'),null);this['setDataValue'](_0x0c6c('0x48'),null);this[_0x0c6c('0x6')]('rtcp_mux','no');break;case 0x2:this[_0x0c6c('0x6')](_0x0c6c('0x23'),'wss');this[_0x0c6c('0x6')](_0x0c6c('0x43'),_0x0c6c('0x28'));this['setDataValue']('avpf',_0x0c6c('0x28'));this[_0x0c6c('0x6')](_0x0c6c('0x44'),'yes');this['setDataValue'](_0x0c6c('0x45'),'yes');this[_0x0c6c('0x6')](_0x0c6c('0x49'),_0x0c6c('0x28'));this[_0x0c6c('0x6')](_0x0c6c('0x4a'),'no');this['setDataValue']('dtlssetup',_0x0c6c('0x4b'));this[_0x0c6c('0x6')](_0x0c6c('0x47'),_0x420d8e['dtlscertfile']||_0x0c6c('0x4c'));this[_0x0c6c('0x6')](_0x0c6c('0x48'),_0x420d8e[_0x0c6c('0x48')]||_0x0c6c('0x4d'));this['setDataValue'](_0x0c6c('0x4e'),_0x0c6c('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0c6c('0x40')],'set':function(_0x44a08b){this[_0x0c6c('0x6')](_0x0c6c('0x4f'),_0x44a08b?_0x44a08b['join'](','):[]);},'get':function(){return this['getDataValue'](_0x0c6c('0x4f'))?_[_0x0c6c('0x50')](this[_0x0c6c('0xc')](_0x0c6c('0x4f'))[_0x0c6c('0x24')](','),function(_0x423ac8){return parseInt(_0x423ac8,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0c6c('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0c6c('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0c6c('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0c6c('0xf')](_0x0c6c('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0c6c('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0c6c('0x51')],'get':function(){return this[_0x0c6c('0xc')](_0x0c6c('0x52'))?this['getDataValue'](_0x0c6c('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0c6c('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0c6c('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![],'set':function(_0x1766cd){if(typeof _0x1766cd==='string'){var _0x58e8ff=_0x1766cd==='1'?!![]:_0x1766cd==='0'?![]:_0x1766cd===_0x0c6c('0x53')?!![]:_0x1766cd===_0x0c6c('0x54')?![]:![];this[_0x0c6c('0x6')]('screenrecording',_0x58e8ff);}else{this[_0x0c6c('0x6')](_0x0c6c('0x55'),_0x1766cd);}}},'blocked':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![],'set':function(_0x43e2c3){this['setDataValue']('blocked',_0x43e2c3);if(_0x43e2c3===!![]){this[_0x0c6c('0x6')](_0x0c6c('0x56'),moment());this[_0x0c6c('0x6')]('loginAttempts',0x0);}else{this['setDataValue'](_0x0c6c('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0c6c('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0c6c('0x13')](0x5)[_0x0c6c('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0c6c('0x15')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index ee56836..441a9c4 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 _0x7df3=['$lt','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','dialActive','VoiceQueue','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','toUpperCase','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','path','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','./user.socket','register','redis','defaults','localhost','client','http','request','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','offset','undefined','count','limit','set','json','destroy','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','role','find','end','name','send','index','rawAttributes','type','salt','getOptions','where','User','query','include','attributes','rows','true','length','push','chat','sms','dataValues','fax','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','password','filters','fields','merge','options','all','update','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','fullname','email','permissions','101','102','113','104','105','106','100','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','VoiceMail','UserProfileSection','findAll','isEmpty','compact','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','voicePause','interface','add','capitalize','penalty','spread','toLowerCase','QueueId','emit','Queue:save','voice','get','format','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','Queues','isArray','Queue:remove','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','findOne','CmContact','intersection','order','pick','getContacts','hasOwnProperty','includeAll','CmList','Tag','Tags','color','tag','nolimit','sort','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','loginInPause','PAUSE','LOGININPAUSE','concat','resolve','logout','forEach','QueuePause','pause','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','Fax','flatten','transaction','addAgent','online','getDataValue','removeTeams','Mail','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte'];(function(_0x5444a0,_0x4e2c3b){var _0x2c2aaf=function(_0x7da2c6){while(--_0x7da2c6){_0x5444a0['push'](_0x5444a0['shift']());}};_0x2c2aaf(++_0x4e2c3b);}(_0x7df3,0x1cc));var _0x37df=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7df3[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x37df('0x0'));var BPromise=require(_0x37df('0x1'));var util=require('util');var path=require(_0x37df('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x37df('0x3'));var jayson=require('jayson/promise');var Redis=require(_0x37df('0x4'));var authService=require('../../components/auth/service');var qs=require(_0x37df('0x5'));var logger=require(_0x37df('0x6'))(_0x37df('0x7'));var utils=require(_0x37df('0x8'));var config=require(_0x37df('0x9'));var licenseUtil=require(_0x37df('0xa'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x37df('0xb'))[_0x37df('0xc')](socket);config[_0x37df('0xd')]=_[_0x37df('0xe')](config['redis'],{'host':_0x37df('0xf'),'port':0x18eb});var client=jayson[_0x37df('0x10')][_0x37df('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4b3fcb,_0x1270ff,_0x1153c7,_0x2f8b08){return new BPromise(function(_0x49f730,_0x8af5b9){var _0x31957f=_0x2f8b08||client;return _0x31957f[_0x37df('0x12')](_0x4b3fcb,_0x1153c7)[_0x37df('0x13')](function(_0x116796){logger['info'](_0x37df('0x14'),_0x1270ff,_0x37df('0x15'));logger[_0x37df('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x1270ff,_0x37df('0x15'),JSON[_0x37df('0x17')](_0x116796));if(_0x116796['error']){if(_0x116796['error']['code']===0x1f4){logger[_0x37df('0x18')](_0x37df('0x14'),_0x1270ff,_0x116796[_0x37df('0x18')][_0x37df('0x19')]);return _0x8af5b9(_0x116796[_0x37df('0x18')][_0x37df('0x19')]);}logger[_0x37df('0x18')](_0x37df('0x14'),_0x1270ff,_0x116796[_0x37df('0x18')][_0x37df('0x19')]);return _0x49f730(_0x116796[_0x37df('0x18')][_0x37df('0x19')]);}else{logger[_0x37df('0x1a')](_0x37df('0x14'),_0x1270ff,'request\x20sent');_0x49f730(_0x116796[_0x37df('0x1b')]['message']);}})[_0x37df('0x1c')](function(_0x315777){logger['error'](_0x37df('0x14'),_0x1270ff,_0x315777);_0x8af5b9(_0x315777);});});}function respondWithStatusCode(_0x3ab324,_0x128594){_0x128594=_0x128594||0xcc;return function(_0x34508a){if(_0x34508a){return _0x3ab324[_0x37df('0x1d')](_0x128594);}return _0x3ab324[_0x37df('0x1e')](_0x128594)['end']();};}function respondWithResult(_0x365a76,_0x515f61){_0x515f61=_0x515f61||0xc8;return function(_0x2f12a2){if(_0x2f12a2){return _0x365a76['status'](_0x515f61)['json'](_0x2f12a2);}};}function respondWithFilteredResult(_0x4827ef,_0x20f991){return function(_0x4c32b8){if(_0x4c32b8){var _0x1a24f6=typeof _0x20f991[_0x37df('0x1f')]===_0x37df('0x20')&&typeof _0x20f991['limit']==='undefined';var _0x62555c=_0x4c32b8[_0x37df('0x21')];var _0x5849eb=_0x1a24f6?0x0:_0x20f991[_0x37df('0x1f')];var _0x43cd7e=_0x1a24f6?_0x4c32b8[_0x37df('0x21')]:_0x20f991['offset']+_0x20f991[_0x37df('0x22')];var _0x43ef2a;if(_0x43cd7e>=_0x62555c){_0x43cd7e=_0x62555c;_0x43ef2a=0xc8;}else{_0x43ef2a=0xce;}_0x4827ef[_0x37df('0x1e')](_0x43ef2a);return _0x4827ef[_0x37df('0x23')]('Content-Range',_0x5849eb+'-'+_0x43cd7e+'/'+_0x62555c)[_0x37df('0x24')](_0x4c32b8);}return null;};}function saveUpdates(_0x325870){return function(_0xf1b154){if(_0xf1b154){return _0xf1b154['update'](_0x325870)['then'](function(_0x5d6d8c){return _0x5d6d8c;});}return null;};}function removeEntity(_0x4fac49){return function(_0xafdccc){if(_0xafdccc){return _0xafdccc[_0x37df('0x25')]()[_0x37df('0x13')](function(){var _0x220740=_0xafdccc['get']({'plain':!![]});if(_0x220740['role']===_0x37df('0x26'))return;var _0xd0c72c=[{'name':_0x37df('0x27'),'value':_0x37df('0x28'),'ignore':!![]},{'name':_0x37df('0x29'),'value':_0x37df('0x2a'),'ignore':![]},{'name':_0x37df('0x2b'),'value':_0x37df('0x2c'),'ignore':![]}];var _0x17e5fd=_(_0xd0c72c)[_0x37df('0x2d')](_0x37df('0x2e'))[_0x37df('0x2f')](_0x37df('0x30'))['value']();if(_[_0x37df('0x31')](_0x17e5fd,_0x220740[_0x37df('0x32')])){return;}var _0x447dd4=_[_0x37df('0x33')](_0xd0c72c,['value',_0x220740[_0x37df('0x32')]])['name'];return db['UserProfileResource'][_0x37df('0x25')]({'where':{'type':_0x447dd4,'resourceId':_0x220740['id']}})['then'](function(){return _0xafdccc;});})[_0x37df('0x13')](function(){_0x4fac49[_0x37df('0x1e')](0xcc)[_0x37df('0x34')]();});}};}function handleEntityNotFound(_0x4a06cc){return function(_0x1cfd29){if(!_0x1cfd29){_0x4a06cc[_0x37df('0x1d')](0x194);}return _0x1cfd29;};}function handleError(_0x18f260,_0x1ccc95){_0x1ccc95=_0x1ccc95||0x1f4;return function(_0x186f63){logger[_0x37df('0x18')](_0x186f63['stack']);if(_0x186f63[_0x37df('0x35')]){delete _0x186f63['name'];}_0x18f260['status'](_0x1ccc95)[_0x37df('0x36')](_0x186f63);};}exports[_0x37df('0x37')]=function(_0x49e120,_0x1180a1){var _0x2385ef={},_0x43d2b6={'count':0x0,'rows':[]};var _0xb0d0a8=_(db['User'][_0x37df('0x38')])[_0x37df('0x2f')](function(_0x526e55){return{'name':_0x526e55['fieldName'],'type':_0x526e55[_0x37df('0x39')]['key']};})[_0x37df('0x2d')](function(_0x50b50a){return!_[_0x37df('0x31')](['password',_0x37df('0x3a')],_0x50b50a[_0x37df('0x35')]);})[_0x37df('0x30')]();_0x2385ef=qs[_0x37df('0x3b')](_0xb0d0a8,_0x49e120);var _0x5c9c64={'where':_0x2385ef[_0x37df('0x3c')]};return db[_0x37df('0x3d')]['count'](_0x5c9c64)['then'](function(_0x56300c){_0x43d2b6['count']=_0x56300c;if(_0x49e120[_0x37df('0x3e')]['includeAll']){_0x2385ef[_0x37df('0x3f')]=[{'all':!![]}];}if(!_[_0x37df('0x31')](_0x2385ef[_0x37df('0x40')],'id')){_0x2385ef[_0x37df('0x40')]['push']('id');}return db[_0x37df('0x3d')]['findAll'](_0x2385ef);})['then'](function(_0x2b4f12){_0x43d2b6[_0x37df('0x41')]=_0x2b4f12;if(_0x49e120['query']['openTabs']===_0x37df('0x42')){var _0x196d07=[];for(var _0x4efc1a=0x0;_0x4efc1a<_0x43d2b6[_0x37df('0x41')][_0x37df('0x43')];_0x4efc1a++){_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x45'),_0x43d2b6[_0x37df('0x41')][_0x4efc1a]['dataValues']));_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x46'),_0x43d2b6['rows'][_0x4efc1a][_0x37df('0x47')]));_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x48'),_0x43d2b6[_0x37df('0x41')][_0x4efc1a][_0x37df('0x47')]));_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x49'),_0x43d2b6['rows'][_0x4efc1a][_0x37df('0x47')]));_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x4a'),_0x43d2b6['rows'][_0x4efc1a][_0x37df('0x47')]));_0x196d07[_0x37df('0x44')](get_open_tabs(_0x37df('0x4b'),_0x43d2b6['rows'][_0x4efc1a]['dataValues']));}return BPromise['all'](_0x196d07)['then'](function(_0x31d6f9){return _0x43d2b6;});}else{return _0x43d2b6;}})[_0x37df('0x13')](respondWithFilteredResult(_0x1180a1,_0x2385ef))['catch'](handleError(_0x1180a1,null));};exports[_0x37df('0x4c')]=function(_0x41a45d,_0x21fc38){var _0x38ba81={'raw':![],'where':{'id':_0x41a45d[_0x37df('0x4d')]['id']}},_0x4e696e={};_0x4e696e[_0x37df('0x4e')]=_[_0x37df('0x4f')](_[_0x37df('0x50')](db[_0x37df('0x3d')]['rawAttributes']),[_0x37df('0x51'),_0x37df('0x3a')]);_0x4e696e[_0x37df('0x3e')]=_['keys'](_0x41a45d[_0x37df('0x3e')]);_0x4e696e[_0x37df('0x52')]=_['intersection'](_0x4e696e['model'],_0x4e696e[_0x37df('0x3e')]);_0x38ba81['attributes']=_['intersection'](_0x4e696e[_0x37df('0x4e')],qs[_0x37df('0x53')](_0x41a45d[_0x37df('0x3e')][_0x37df('0x53')]));_0x38ba81[_0x37df('0x40')]=_0x38ba81['attributes'][_0x37df('0x43')]?_0x38ba81[_0x37df('0x40')]:_0x4e696e[_0x37df('0x4e')];if(_0x41a45d['query']['includeAll']){_0x38ba81[_0x37df('0x3f')]=[{'all':!![]}];}_0x38ba81=_[_0x37df('0x54')]({},_0x38ba81,_0x41a45d[_0x37df('0x55')]);if(!_['includes'](_0x38ba81[_0x37df('0x40')],'id')){_0x38ba81[_0x37df('0x40')]['push']('id');}return db['User'][_0x37df('0x33')](_0x38ba81)[_0x37df('0x13')](handleEntityNotFound(_0x21fc38,null))[_0x37df('0x13')](function(_0x226ef7){var _0x1ea460=[];values=_0x226ef7;if(_0x41a45d[_0x37df('0x3e')]['openTabs']===_0x37df('0x42')){_0x1ea460[_0x37df('0x44')](get_open_tabs(_0x37df('0x45'),_0x226ef7[_0x37df('0x47')]));_0x1ea460[_0x37df('0x44')](get_open_tabs(_0x37df('0x46'),_0x226ef7[_0x37df('0x47')]));_0x1ea460[_0x37df('0x44')](get_open_tabs(_0x37df('0x4a'),_0x226ef7['dataValues']));_0x1ea460[_0x37df('0x44')](get_open_tabs('whatsapp',_0x226ef7[_0x37df('0x47')]));_0x1ea460[_0x37df('0x44')](get_open_tabs(_0x37df('0x48'),_0x226ef7[_0x37df('0x47')]));_0x1ea460[_0x37df('0x44')](get_open_tabs(_0x37df('0x49'),_0x226ef7[_0x37df('0x47')]));return BPromise[_0x37df('0x56')](_0x1ea460);}else{return values;}})[_0x37df('0x13')](function(_0xec29bd){return values;})[_0x37df('0x13')](respondWithResult(_0x21fc38,null))[_0x37df('0x1c')](handleError(_0x21fc38,null));};exports[_0x37df('0x57')]=function(_0x5d1ddf,_0x163206){if(_0x5d1ddf[_0x37df('0x58')]['id']){delete _0x5d1ddf[_0x37df('0x58')]['id'];}delete _0x5d1ddf[_0x37df('0x58')]['role'];return db[_0x37df('0x3d')][_0x37df('0x33')]({'where':{'id':_0x5d1ddf['params']['id']}})[_0x37df('0x13')](handleEntityNotFound(_0x163206,null))[_0x37df('0x13')](saveUpdates(_0x5d1ddf[_0x37df('0x58')],null))['then'](respondWithResult(_0x163206,null))['catch'](handleError(_0x163206,null));};exports[_0x37df('0x59')]=function(_0x15b55e,_0x2b2993){return db['User'][_0x37df('0x59')]()[_0x37df('0x13')](respondWithResult(_0x2b2993,null))[_0x37df('0x1c')](handleError(_0x2b2993,null));};exports[_0x37df('0x5a')]=function(_0x1d6e10,_0x29616e){return db[_0x37df('0x3d')][_0x37df('0x33')]({'where':{'id':_0x1d6e10[_0x37df('0x4d')]['id']}})[_0x37df('0x13')](handleEntityNotFound(_0x29616e,null))['then'](function(_0x18ae00){if(_0x18ae00){return _0x18ae00[_0x37df('0x5a')](_0x1d6e10[_0x37df('0x58')][_0x37df('0x5b')],_['omit'](_0x1d6e10[_0x37df('0x58')],[_0x37df('0x5b'),'id'])||{});}})[_0x37df('0x13')](respondWithResult(_0x29616e,null))[_0x37df('0x1c')](handleError(_0x29616e,null));};function validateUser(_0x1c762b){return new BPromise(function(_0x29ff34,_0x174278){if(_0x1c762b[_0x37df('0x5c')])return _0x29ff34(_0x1c762b);return db[_0x37df('0x5d')][_0x37df('0x5e')](0x1)[_0x37df('0x13')](function(_0x15023d){if(_0x15023d[_0x37df('0x5f')])authService[_0x37df('0x60')](_0x1c762b[_0x37df('0x51')]);db[_0x37df('0x3d')]['max']('internal')[_0x37df('0x13')](function(_0x399629){if(_[_0x37df('0x61')](_0x399629)){_0x1c762b[_0x37df('0x5c')]=_0x15023d['min_internal']||0x1;return;}if(_['isNil'](_0x15023d[_0x37df('0x62')])||_0x15023d[_0x37df('0x62')]===_0x399629){_0x1c762b[_0x37df('0x5c')]=_0x399629+0x1;return;}if(_0x15023d[_0x37df('0x62')]>_0x399629){_0x1c762b[_0x37df('0x5c')]=_0x15023d[_0x37df('0x62')];return;}return db[_0x37df('0x63')][_0x37df('0x3e')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0x37df('0x64')][_0x37df('0x65')]})[_0x37df('0x13')](function(_0x5dcbc0){if(_0x5dcbc0&&_0x5dcbc0['length']){for(var _0x3e8328=0x0,_0x32f728=_0x5dcbc0[_0x37df('0x43')];_0x3e8328<_0x32f728&&_[_0x37df('0x61')](_0x1c762b['internal']);_0x3e8328++){if(_0x15023d[_0x37df('0x62')]<=_0x5dcbc0[_0x3e8328]['from']){_0x1c762b[_0x37df('0x5c')]=_0x5dcbc0[_0x3e8328][_0x37df('0x66')];}else if(_0x15023d['min_internal']>_0x5dcbc0[_0x3e8328][_0x37df('0x66')]&&_0x15023d[_0x37df('0x62')]<=_0x5dcbc0[_0x3e8328]['to']){_0x1c762b['internal']=_0x15023d[_0x37df('0x62')];}}}if(_[_0x37df('0x61')](_0x1c762b[_0x37df('0x5c')])){_0x1c762b[_0x37df('0x5c')]=_0x399629+0x1;}return _0x29ff34(_0x1c762b);});});})['catch'](function(_0x3d984a){_0x174278(_0x3d984a);});});}function updateUser(_0x11f8b2){return new BPromise(function(_0x1f0c2d,_0x3c3110){try{if(_0x11f8b2[_0x37df('0x67')]){_0x11f8b2['mailbox']=_0x11f8b2['internal'];_0x11f8b2['VoiceMail']={'mailbox':_0x11f8b2[_0x37df('0x5c')],'password':_0x11f8b2[_0x37df('0x51')],'fullname':_0x11f8b2[_0x37df('0x68')],'email':_0x11f8b2[_0x37df('0x69')]};}if(_0x11f8b2[_0x37df('0x32')]===_0x37df('0x2a')){if(!_0x11f8b2[_0x37df('0x6a')])_0x11f8b2[_0x37df('0x6a')]=[_0x37df('0x6b'),_0x37df('0x6c'),'103',_0x37df('0x6d'),'110',_0x37df('0x6e'),_0x37df('0x6f'),_0x37df('0x70'),'107','108','109',_0x37df('0x71'),'111','114',_0x37df('0x72')];}_0x1f0c2d(_0x11f8b2);}catch(_0x4fcb4d){_0x3c3110(_0x4fcb4d);}});}exports['create']=function(_0x18fc05,_0x296133){if(_0x18fc05[_0x37df('0x28')][_0x37df('0x32')]===_0x37df('0x2a'))throw new Error(_0x37df('0x73'));if(_0x18fc05[_0x37df('0x58')][_0x37df('0x32')]===_0x37df('0x28')&&_0x18fc05['user']['role']!=='admin'){throw new Error(_0x37df('0x74'));}if(_0x18fc05[_0x37df('0x58')]['role']===_0x37df('0x26')&&_0x18fc05[_0x37df('0x28')][_0x37df('0x32')]!=='admin'){throw new Error(_0x37df('0x75'));}return licenseUtil[_0x37df('0x76')]([_0x18fc05['body']])[_0x37df('0x13')](function(){return validateUser(_0x18fc05[_0x37df('0x58')]);})[_0x37df('0x13')](function(_0x3ba427){return updateUser(_0x3ba427)[_0x37df('0x13')](function(_0x3e878f){if(_0x3e878f['role']===_0x37df('0x26')){_0x3e878f[_0x37df('0x77')]=_0x18fc05['user']['settingsEnabled'];delete _0x3e878f[_0x37df('0x78')];}return _0x3e878f;});})['then'](function(_0x48f726){return db[_0x37df('0x3d')][_0x37df('0x79')](_0x48f726,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x37df('0x13')](function(_0x2c123a){if(_0x18fc05[_0x37df('0x58')][_0x37df('0x32')]===_0x37df('0x28'))return _0x2c123a;if(_0x18fc05[_0x37df('0x28')][_0x37df('0x32')]!==_0x37df('0x28'))return _0x2c123a;return db['UserProfileSection'][_0x37df('0x33')]({'where':{'name':_0x2c123a['role']===_0x37df('0x2a')?_0x37df('0x29'):'Telephones','userProfileId':_0x18fc05[_0x37df('0x28')][_0x37df('0x78')]},'raw':!![]})[_0x37df('0x13')](function(_0x2f9c74){if(!_0x2f9c74||_0x2f9c74[_0x37df('0x7a')]!=0x0)return _0x2c123a;return db['UserProfileResource'][_0x37df('0x79')]({'name':_0x2c123a[_0x37df('0x35')],'resourceId':_0x2c123a['id'],'type':_0x2f9c74[_0x37df('0x35')],'sectionId':_0x2f9c74['id']},{})['then'](function(){return _0x2c123a;});})['catch'](function(_0x38f6a8){logger[_0x37df('0x18')](_0x37df('0x7b'),_0x38f6a8);throw _0x38f6a8;});})['then'](respondWithResult(_0x296133,0xc9))['catch'](handleError(_0x296133,null));};exports[_0x37df('0x7c')]=function(_0x1c723f,_0x1d9770){var _0x4edac9=_0x1c723f['body'];var _0x23a80f=[];if(_0x1c723f[_0x37df('0x28')][_0x37df('0x32')]===_0x37df('0x2a'))throw new Error(_0x37df('0x73'));if(_[_0x37df('0x7d')](_0x4edac9,[_0x37df('0x32'),_0x37df('0x28')])&&_0x1c723f[_0x37df('0x28')]['role']!==_0x37df('0x26')){throw new Error(_0x37df('0x74'));}if(_[_0x37df('0x7d')](_0x4edac9,[_0x37df('0x32'),_0x37df('0x26')])&&_0x1c723f[_0x37df('0x28')]['role']!==_0x37df('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x37df('0x76')](_0x4edac9)[_0x37df('0x13')](function(){return validateUser(_0x4edac9[0x0]);})[_0x37df('0x13')](function(){for(var _0x5b1980=0x1;_0x5b1980<_0x4edac9[_0x37df('0x43')];_0x5b1980++){var _0x2a2e01=_0x4edac9[_0x5b1980-0x1][_0x37df('0x5c')];if(!_0x4edac9[_0x5b1980][_0x37df('0x5c')])_0x4edac9[_0x5b1980]['internal']=_0x2a2e01+0x1;_0x23a80f['push'](validateUser(_0x4edac9[_0x5b1980]));}return BPromise[_0x37df('0x56')](_0x23a80f);})[_0x37df('0x13')](function(){_0x23a80f=[];for(var _0x11159a=0x0;_0x11159a<_0x4edac9['length'];_0x11159a++){_0x23a80f[_0x37df('0x44')](updateUser(_0x4edac9[_0x11159a]));}return BPromise[_0x37df('0x56')](_0x23a80f);})[_0x37df('0x13')](function(){return BPromise[_0x37df('0x7e')](_0x4edac9,function(_0x7ae388){return db[_0x37df('0x3d')][_0x37df('0x79')](_0x7ae388,{'include':[{'model':db[_0x37df('0x7f')],'as':_0x37df('0x7f')}]})[_0x37df('0x13')](function(_0xd287cd){_0x7ae388['id']=_0xd287cd['id'];return _0x7ae388;});});})[_0x37df('0x13')](function(_0x24e831){if(_0x1c723f[_0x37df('0x58')][_0x37df('0x32')]===_0x37df('0x28'))return _0x24e831;if(_0x1c723f[_0x37df('0x28')][_0x37df('0x32')]!==_0x37df('0x28'))return _0x24e831;var _0x1402a2=_[_0x37df('0x7d')](_0x24e831,function(_0x46d26d){return _0x46d26d[_0x37df('0x32')]===_0x37df('0x2a')||_0x46d26d[_0x37df('0x32')]===_0x37df('0x2c');});if(!_0x1402a2)return _0x24e831;return db[_0x37df('0x80')][_0x37df('0x81')]({'where':{'name':{'$or':[_0x37df('0x29'),_0x37df('0x2b')]},'userProfileId':_0x1c723f[_0x37df('0x28')][_0x37df('0x78')]},'raw':!![]})[_0x37df('0x13')](function(_0x3ee820){if(_[_0x37df('0x82')](_0x3ee820)||!_['some'](_0x3ee820,[_0x37df('0x7a'),0x0]))return _0x24e831;_0x23a80f=[];var _0x4fd106=_(_0x3ee820)[_0x37df('0x2f')](function(_0x2e58ac){if(_0x2e58ac[_0x37df('0x7a')]===0x1)return;return _0x2e58ac[_0x37df('0x35')]===_0x37df('0x29')?_0x37df('0x2a'):'telephone';})[_0x37df('0x83')]()[_0x37df('0x30')]();for(var _0x3534c4=0x0;_0x3534c4<_0x24e831['length'];_0x3534c4++){if(!_[_0x37df('0x31')](_0x4fd106,_0x24e831[_0x3534c4][_0x37df('0x32')]))return;var _0x172fbe=_0x24e831[_0x3534c4][_0x37df('0x32')]==='agent'?'Agents':'Telephones';_0x23a80f[_0x37df('0x44')](db['UserProfileResource'][_0x37df('0x79')]({'name':_0x24e831[_0x3534c4][_0x37df('0x35')],'resourceId':_0x24e831[_0x3534c4]['id'],'type':_0x172fbe,'sectionId':_[_0x37df('0x33')](_0x3ee820,['name',_0x172fbe])['id']},{}));}return BPromise['all'](_0x23a80f);});})[_0x37df('0x13')](respondWithResult(_0x1d9770,0xc9))[_0x37df('0x1c')](handleError(_0x1d9770,null));};exports['changePassword']=function(_0x5ebca8,_0x1b2c75){if(_0x5ebca8[_0x37df('0x58')]['id']){delete _0x5ebca8[_0x37df('0x58')]['id'];}return db['User']['find']({'where':{'id':_0x5ebca8['params']['id']}})[_0x37df('0x13')](function(_0x4fe0a0){if(!_0x4fe0a0)return null;if(_0x4fe0a0['id']===_0x5ebca8['user']['id']){if(!_0x5ebca8[_0x37df('0x58')][_0x37df('0x84')]||!_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')]){throw new db[(_0x37df('0x86'))]['ValidationError'](_0x37df('0x87'));}if(!_0x4fe0a0[_0x37df('0x88')](_0x5ebca8[_0x37df('0x58')][_0x37df('0x84')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x5ebca8[_0x37df('0x58')][_0x37df('0x84')]===_0x5ebca8[_0x37df('0x58')]['newPassword']){throw new db[(_0x37df('0x86'))][(_0x37df('0x89'))](_0x37df('0x8a'));}}else if(_0x5ebca8['user'][_0x37df('0x32')]===_0x37df('0x26')){if(!_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')]){throw new db[(_0x37df('0x86'))][(_0x37df('0x89'))](_0x37df('0x8b'));}}else if(_0x5ebca8['user'][_0x37df('0x32')]===_0x37df('0x28')){if(!_0x5ebca8['body']['newPassword']){throw new db[(_0x37df('0x86'))]['ValidationError'](_0x37df('0x8b'));}if(_0x4fe0a0[_0x37df('0x32')]!==_0x37df('0x2a')){throw new db[(_0x37df('0x86'))][(_0x37df('0x89'))](_0x37df('0x73'));}}else{throw new db[(_0x37df('0x86'))][(_0x37df('0x89'))]('Unauthorized');}return _0x4fe0a0;})[_0x37df('0x13')](handleEntityNotFound(_0x1b2c75,null))['then'](function(_0x8188df){return db[_0x37df('0x5d')]['findOne']({'attributes':['id',_0x37df('0x5f'),'enforcePasswordHistory',_0x37df('0x8c')]})[_0x37df('0x13')](function(_0x1a8b0b){if(_0x1a8b0b[_0x37df('0x5f')])authService[_0x37df('0x60')](_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')]);if(!_0x1a8b0b['enforcePasswordHistory']||!_0x8188df[_0x37df('0x8d')])return _0x8188df;authService[_0x37df('0x8e')](_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')],_0x8188df[_0x37df('0x8d')],_0x1a8b0b[_0x37df('0x8c')]);return _0x8188df;})[_0x37df('0x13')](saveUpdates({'password':_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')],'passwordResetAt':_0x5ebca8[_0x37df('0x28')]['id']==_0x5ebca8['params']['id']?moment():null,'previousPasswords':authService[_0x37df('0x8f')](_0x5ebca8[_0x37df('0x58')][_0x37df('0x85')],_0x8188df['previousPasswords'])},null));})[_0x37df('0x13')](respondWithResult(_0x1b2c75,null))['catch'](handleError(_0x1b2c75,null));};exports[_0x37df('0x90')]=function(_0x33277b,_0x489965){var _0x11dde3=_0x33277b[_0x37df('0x58')][_0x37df('0x91')];return db[_0x37df('0x3d')][_0x37df('0x33')]({'where':{'id':_0x33277b[_0x37df('0x4d')]['id']},'attributes':['id',_0x37df('0x35'),_0x37df('0x32'),'online','loginInPause',_0x37df('0x92'),_0x37df('0x93')]})['then'](handleEntityNotFound(_0x489965,null))[_0x37df('0x13')](function(_0x93191){if(_0x93191){if(!utils['isValidChannel'](_0x11dde3)){throw new db[(_0x37df('0x86'))][(_0x37df('0x89'))]('Unknown\x20channel');}return _0x93191[_0x37df('0x94')+_[_0x37df('0x95')](_0x11dde3['toLowerCase']())+'Queues'](_0x33277b[_0x37df('0x58')][_0x37df('0x5b')],{'penalty':_0x33277b[_0x37df('0x58')][_0x37df('0x96')]||0x0})[_0x37df('0x97')](function(_0x16f0bb){for(var _0x5b0cdb=0x0;_0x5b0cdb<_0x33277b['body'][_0x37df('0x5b')][_0x37df('0x43')];_0x5b0cdb+=0x1){var _0x198889={'UserId':Number(_0x33277b[_0x37df('0x4d')]['id'])};_0x198889[_[_0x37df('0x95')](_0x11dde3[_0x37df('0x98')]())+_0x37df('0x99')]=Number(_0x33277b[_0x37df('0x58')][_0x37df('0x5b')][_0x5b0cdb]);socket[_0x37df('0x9a')](_0x37df('0x28')+_[_0x37df('0x95')](_0x11dde3[_0x37df('0x98')]())+_0x37df('0x9b'),_0x198889);}return _0x16f0bb;})['then'](function(){if(_0x11dde3===_0x37df('0x9c')){return db['VoiceQueue'][_0x37df('0x81')]({'where':{'id':_0x33277b[_0x37df('0x58')][_0x37df('0x5b')]||[]},'raw':!![],'attributes':['id',_0x37df('0x35')]});}})[_0x37df('0x13')](function(_0xbc2dbd){var _0x5eda26=_0x93191[_0x37df('0x9d')]({'plain':!![]});var _0x18bb59=[];if(_0x11dde3===_0x37df('0x9c')&&_0x5eda26[_0x37df('0x32')]===_0x37df('0x2a')&&_0x5eda26['online']){for(var _0x431751=0x0;_0x431751<_0xbc2dbd[_0x37df('0x43')];_0x431751+=0x1){_0x18bb59[_0x37df('0x44')]({'membername':_0x5eda26[_0x37df('0x35')],'UserId':_0x5eda26['id'],'queue_name':_0xbc2dbd[_0x431751][_0x37df('0x35')],'VoiceQueueId':_0xbc2dbd[_0x431751]['id'],'interface':_[_0x37df('0x61')](_0x5eda26['interface'])?util[_0x37df('0x9e')]('SIP/%s',_0x5eda26[_0x37df('0x35')]):_0x5eda26[_0x37df('0x93')],'paused':_0x5eda26['voicePause']||![],'penalty':_0x33277b['body'][_0x37df('0x96')]||0x0});}return BPromise[_0x37df('0x7e')](_0x18bb59,function(_0x336ece){return db[_0x37df('0x9f')][_0x37df('0xa0')](_0x336ece);});}return _0x93191;});}})[_0x37df('0x13')](respondWithStatusCode(_0x489965,null))[_0x37df('0x1c')](handleError(_0x489965,null));};exports[_0x37df('0xa1')]=function(_0x161e1,_0x4c0ed0){var _0x5bf818;return db[_0x37df('0x3d')]['find']({'where':{'id':_0x161e1['params']['id']},'attributes':['id',_0x37df('0x35'),'role']})['then'](handleEntityNotFound(_0x4c0ed0,null))[_0x37df('0x13')](function(_0x3496a9){if(_0x3496a9){_0x5bf818=_0x3496a9;if(!_0x161e1['query'][_0x37df('0x91')]||!utils[_0x37df('0xa2')](_0x161e1['query'][_0x37df('0x91')])){throw new db[(_0x37df('0x86'))]['ValidationError'](_0x37df('0xa3'));}return _0x3496a9['remove'+_[_0x37df('0x95')](_0x161e1['query']['channel']['toLowerCase']())+_0x37df('0xa4')](_0x161e1[_0x37df('0x3e')][_0x37df('0x5b')]);}})[_0x37df('0x13')](function(_0x43c241){if(_[_0x37df('0xa5')](_0x161e1[_0x37df('0x3e')][_0x37df('0x5b')])){for(var _0x3b0e17=0x0;_0x3b0e17<_0x161e1[_0x37df('0x3e')][_0x37df('0x5b')][_0x37df('0x43')];_0x3b0e17+=0x1){var _0x229fbd={'UserId':Number(_0x161e1[_0x37df('0x4d')]['id'])};_0x229fbd[_[_0x37df('0x95')](_0x161e1[_0x37df('0x3e')][_0x37df('0x91')]['toLowerCase']())+_0x37df('0x99')]=Number(_0x161e1[_0x37df('0x3e')][_0x37df('0x5b')][_0x3b0e17]);socket[_0x37df('0x9a')](_0x37df('0x28')+_[_0x37df('0x95')](_0x161e1[_0x37df('0x3e')][_0x37df('0x91')][_0x37df('0x98')]())+_0x37df('0xa6'),_0x229fbd);}}else{var _0x229fbd={'UserId':Number(_0x161e1[_0x37df('0x4d')]['id'])};_0x229fbd[_[_0x37df('0x95')](_0x161e1['query'][_0x37df('0x91')][_0x37df('0x98')]())+_0x37df('0x99')]=Number(_0x161e1[_0x37df('0x3e')][_0x37df('0x5b')]);socket[_0x37df('0x9a')](_0x37df('0x28')+_[_0x37df('0x95')](_0x161e1['query'][_0x37df('0x91')]['toLowerCase']())+_0x37df('0xa6'),_0x229fbd);}return _0x43c241;})[_0x37df('0x13')](function(){if(_0x161e1['query']['channel']==='voice'){return db[_0x37df('0x9f')]['destroy']({'where':{'UserId':_0x161e1[_0x37df('0x4d')]['id'],'VoiceQueueId':_0x161e1['query'][_0x37df('0x5b')]},'individualHooks':!![]})[_0x37df('0x13')](function(){return _0x5bf818;});}return _0x5bf818;})['then'](respondWithStatusCode(_0x4c0ed0,null))[_0x37df('0x1c')](handleError(_0x4c0ed0,null));};exports['addAvatar']=function(_0x5ea982,_0x103883){_0x5ea982['body'][_0x37df('0xa7')]=_0x5ea982[_0x37df('0xa8')]['filename'];return db[_0x37df('0x3d')][_0x37df('0x33')]({'where':{'id':_0x5ea982['params']['id']}})[_0x37df('0x13')](handleEntityNotFound(_0x103883,null))[_0x37df('0x13')](saveUpdates(_0x5ea982[_0x37df('0x58')],null))[_0x37df('0x13')](respondWithResult(_0x103883,null))[_0x37df('0x1c')](handleError(_0x103883,null));};exports[_0x37df('0xa9')]=function(_0x1ead84,_0x57f283){var _0x2e31db=path[_0x37df('0xaa')](config[_0x37df('0xab')],_0x37df('0xac'));return db[_0x37df('0x3d')]['find']({'where':{'id':_0x1ead84[_0x37df('0x4d')]['id']},'attributes':['id',_0x37df('0xa7')],'raw':!![]})[_0x37df('0x13')](handleEntityNotFound(_0x57f283,null))[_0x37df('0x13')](function(_0x18a2aa){if(_0x18a2aa){if(_[_0x37df('0x61')](_0x18a2aa[_0x37df('0xa7')])){return _0x57f283[_0x37df('0xad')](_0x2e31db);}else{if(!fs[_0x37df('0xae')](path['join'](config['root'],'server/files/images/',_0x18a2aa['userpic']))){return _0x57f283[_0x37df('0xad')](_0x2e31db);}return _0x57f283[_0x37df('0xad')](path[_0x37df('0xaa')](config[_0x37df('0xab')],_0x37df('0xaf'),_0x18a2aa[_0x37df('0xa7')]));}}})[_0x37df('0x1c')](handleError(_0x57f283,null));};exports[_0x37df('0xb0')]=function(_0x34a4bf,_0x2ba3f0){return db[_0x37df('0x3d')][_0x37df('0x33')]({'where':{'id':_0x34a4bf[_0x37df('0x4d')]['id']},'attributes':['id']})[_0x37df('0x13')](handleEntityNotFound(_0x2ba3f0,null))[_0x37df('0x13')](function(_0x8dd64f){var _0x3312b6=[];values=_0x8dd64f[_0x37df('0x47')];_0x3312b6[_0x37df('0x44')](get_open_tabs(_0x37df('0x45'),_0x8dd64f[_0x37df('0x47')]));_0x3312b6[_0x37df('0x44')](get_open_tabs(_0x37df('0x46'),_0x8dd64f[_0x37df('0x47')]));_0x3312b6[_0x37df('0x44')](get_open_tabs(_0x37df('0x4a'),_0x8dd64f[_0x37df('0x47')]));_0x3312b6[_0x37df('0x44')](get_open_tabs(_0x37df('0x4b'),_0x8dd64f[_0x37df('0x47')]));_0x3312b6[_0x37df('0x44')](get_open_tabs(_0x37df('0x48'),_0x8dd64f['dataValues']));_0x3312b6[_0x37df('0x44')](get_open_tabs('mail',_0x8dd64f['dataValues']));return BPromise[_0x37df('0x56')](_0x3312b6);})[_0x37df('0x13')](function(_0x5d6d20){var _0x376437=[];if(_0x5d6d20){for(var _0x2f7543=0x0;_0x2f7543=_0x58069e){_0x3c5997=_0x58069e;_0x463d6e=0xc8;}else{_0x463d6e=0xce;}_0x209519[_0x46b2('0x1a')](_0x463d6e);return _0x209519[_0x46b2('0x20')](_0x46b2('0x21'),_0x138f6c+'-'+_0x3c5997+'/'+_0x58069e)[_0x46b2('0x22')](_0x5ae029);}return null;};}function saveUpdates(_0x1a6caf){return function(_0x429496){if(_0x429496){return _0x429496[_0x46b2('0x23')](_0x1a6caf)['then'](function(_0x4e2a9b){return _0x4e2a9b;});}return null;};}function removeEntity(_0x4dcee5){return function(_0x2c619b){if(_0x2c619b){return _0x2c619b[_0x46b2('0x24')]()[_0x46b2('0xe')](function(){var _0x58fd96=_0x2c619b[_0x46b2('0x25')]({'plain':!![]});if(_0x58fd96[_0x46b2('0x26')]==='admin')return;var _0x37282e=[{'name':_0x46b2('0x27'),'value':_0x46b2('0x28'),'ignore':!![]},{'name':_0x46b2('0x29'),'value':_0x46b2('0x2a'),'ignore':![]},{'name':_0x46b2('0x2b'),'value':_0x46b2('0x2c'),'ignore':![]}];var _0x15eabd=_(_0x37282e)[_0x46b2('0x2d')]('ignore')[_0x46b2('0x2e')](_0x46b2('0x2f'))[_0x46b2('0x2f')]();if(_['includes'](_0x15eabd,_0x58fd96[_0x46b2('0x26')])){return;}var _0x2bee45=_[_0x46b2('0x30')](_0x37282e,[_0x46b2('0x2f'),_0x58fd96['role']])[_0x46b2('0x31')];return db['UserProfileResource'][_0x46b2('0x24')]({'where':{'type':_0x2bee45,'resourceId':_0x58fd96['id']}})[_0x46b2('0xe')](function(){return _0x2c619b;});})[_0x46b2('0xe')](function(){_0x4dcee5[_0x46b2('0x1a')](0xcc)[_0x46b2('0x1b')]();});}};}function handleEntityNotFound(_0x10e094){return function(_0x1724c7){if(!_0x1724c7){_0x10e094['sendStatus'](0x194);}return _0x1724c7;};}function handleError(_0x32ebcb,_0x3f6269){_0x3f6269=_0x3f6269||0x1f4;return function(_0x205ac8){logger[_0x46b2('0x15')](_0x205ac8[_0x46b2('0x32')]);if(_0x205ac8[_0x46b2('0x31')]){delete _0x205ac8[_0x46b2('0x31')];}_0x32ebcb['status'](_0x3f6269)['send'](_0x205ac8);};}exports['index']=function(_0x407b51,_0x420e48){var _0x4c46db={},_0x424c67={'count':0x0,'rows':[]};var _0x589bd7=_(db['User'][_0x46b2('0x33')])[_0x46b2('0x2e')](function(_0x214c77){return{'name':_0x214c77[_0x46b2('0x34')],'type':_0x214c77['type'][_0x46b2('0x35')]};})['filter'](function(_0x4c422b){return!_['includes']([_0x46b2('0x36'),_0x46b2('0x37')],_0x4c422b[_0x46b2('0x31')]);})['value']();_0x4c46db=qs[_0x46b2('0x38')](_0x589bd7,_0x407b51);var _0x528b8f={'where':_0x4c46db[_0x46b2('0x39')]};return db[_0x46b2('0x3a')]['count'](_0x528b8f)[_0x46b2('0xe')](function(_0x557df0){_0x424c67['count']=_0x557df0;if(_0x407b51[_0x46b2('0x3b')]['includeAll']){_0x4c46db[_0x46b2('0x3c')]=[{'all':!![]}];}if(!_[_0x46b2('0x3d')](_0x4c46db[_0x46b2('0x3e')],'id')){_0x4c46db[_0x46b2('0x3e')]['push']('id');}return db[_0x46b2('0x3a')][_0x46b2('0x3f')](_0x4c46db);})[_0x46b2('0xe')](function(_0x4fdfeb){_0x424c67['rows']=_0x4fdfeb;if(_0x407b51[_0x46b2('0x3b')][_0x46b2('0x40')]===_0x46b2('0x41')){var _0x8fcec3=[];for(var _0x4e6424=0x0;_0x4e6424<_0x424c67['rows'][_0x46b2('0x42')];_0x4e6424++){_0x8fcec3[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x44'),_0x424c67[_0x46b2('0x45')][_0x4e6424][_0x46b2('0x46')]));_0x8fcec3[_0x46b2('0x43')](get_open_tabs('sms',_0x424c67['rows'][_0x4e6424][_0x46b2('0x46')]));_0x8fcec3[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x47'),_0x424c67[_0x46b2('0x45')][_0x4e6424]['dataValues']));_0x8fcec3[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x48'),_0x424c67[_0x46b2('0x45')][_0x4e6424][_0x46b2('0x46')]));_0x8fcec3['push'](get_open_tabs(_0x46b2('0x49'),_0x424c67[_0x46b2('0x45')][_0x4e6424][_0x46b2('0x46')]));_0x8fcec3[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x4a'),_0x424c67[_0x46b2('0x45')][_0x4e6424][_0x46b2('0x46')]));}return BPromise['all'](_0x8fcec3)[_0x46b2('0xe')](function(_0x14cdc9){return _0x424c67;});}else{return _0x424c67;}})['then'](respondWithFilteredResult(_0x420e48,_0x4c46db))[_0x46b2('0x18')](handleError(_0x420e48,null));};exports['show']=function(_0x67b87e,_0x544f49){var _0x44f782={'raw':![],'where':{'id':_0x67b87e['params']['id']}},_0xf9d644={};_0xf9d644[_0x46b2('0x4b')]=_[_0x46b2('0x4c')](_['keys'](db['User'][_0x46b2('0x33')]),['password',_0x46b2('0x37')]);_0xf9d644['query']=_[_0x46b2('0x4d')](_0x67b87e[_0x46b2('0x3b')]);_0xf9d644[_0x46b2('0x4e')]=_[_0x46b2('0x4f')](_0xf9d644[_0x46b2('0x4b')],_0xf9d644[_0x46b2('0x3b')]);_0x44f782[_0x46b2('0x3e')]=_[_0x46b2('0x4f')](_0xf9d644[_0x46b2('0x4b')],qs[_0x46b2('0x50')](_0x67b87e[_0x46b2('0x3b')][_0x46b2('0x50')]));_0x44f782['attributes']=_0x44f782[_0x46b2('0x3e')][_0x46b2('0x42')]?_0x44f782['attributes']:_0xf9d644[_0x46b2('0x4b')];if(_0x67b87e['query'][_0x46b2('0x51')]){_0x44f782[_0x46b2('0x3c')]=[{'all':!![]}];}_0x44f782=_[_0x46b2('0x52')]({},_0x44f782,_0x67b87e[_0x46b2('0x53')]);if(!_[_0x46b2('0x3d')](_0x44f782[_0x46b2('0x3e')],'id')){_0x44f782[_0x46b2('0x3e')][_0x46b2('0x43')]('id');}return db[_0x46b2('0x3a')][_0x46b2('0x30')](_0x44f782)['then'](handleEntityNotFound(_0x544f49,null))[_0x46b2('0xe')](function(_0x4ed58c){var _0x4eda21=[];values=_0x4ed58c;if(_0x67b87e[_0x46b2('0x3b')][_0x46b2('0x40')]==='true'){_0x4eda21[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x44'),_0x4ed58c[_0x46b2('0x46')]));_0x4eda21[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x54'),_0x4ed58c[_0x46b2('0x46')]));_0x4eda21[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x49'),_0x4ed58c[_0x46b2('0x46')]));_0x4eda21['push'](get_open_tabs(_0x46b2('0x4a'),_0x4ed58c[_0x46b2('0x46')]));_0x4eda21[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x47'),_0x4ed58c[_0x46b2('0x46')]));_0x4eda21[_0x46b2('0x43')](get_open_tabs('mail',_0x4ed58c[_0x46b2('0x46')]));return BPromise[_0x46b2('0x55')](_0x4eda21);}else{return values;}})['then'](function(_0x20aae0){return values;})[_0x46b2('0xe')](respondWithResult(_0x544f49,null))['catch'](handleError(_0x544f49,null));};exports['update']=function(_0x36ea5a,_0x2b2632){if(_0x36ea5a[_0x46b2('0x56')]['id']){delete _0x36ea5a['body']['id'];}delete _0x36ea5a['body'][_0x46b2('0x26')];return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x36ea5a['params']['id']}})[_0x46b2('0xe')](handleEntityNotFound(_0x2b2632,null))[_0x46b2('0xe')](saveUpdates(_0x36ea5a[_0x46b2('0x56')],null))[_0x46b2('0xe')](respondWithResult(_0x2b2632,null))[_0x46b2('0x18')](handleError(_0x2b2632,null));};exports[_0x46b2('0x57')]=function(_0x49d2d7,_0x4ed26d){return db[_0x46b2('0x3a')]['describe']()[_0x46b2('0xe')](respondWithResult(_0x4ed26d,null))[_0x46b2('0x18')](handleError(_0x4ed26d,null));};exports[_0x46b2('0x58')]=function(_0x108f25,_0x149acc){return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x108f25[_0x46b2('0x59')]['id']}})[_0x46b2('0xe')](handleEntityNotFound(_0x149acc,null))[_0x46b2('0xe')](function(_0x41df32){if(_0x41df32){return _0x41df32['addContacts'](_0x108f25[_0x46b2('0x56')][_0x46b2('0x5a')],_[_0x46b2('0x5b')](_0x108f25['body'],['ids','id'])||{});}})[_0x46b2('0xe')](respondWithResult(_0x149acc,null))[_0x46b2('0x18')](handleError(_0x149acc,null));};function validateUser(_0x54ea11){return new BPromise(function(_0x26109f,_0x18322c){if(_0x54ea11['internal'])return _0x26109f(_0x54ea11);return db[_0x46b2('0x5c')]['findById'](0x1)[_0x46b2('0xe')](function(_0xb40ed4){if(_0xb40ed4[_0x46b2('0x5d')])authService[_0x46b2('0x5e')](_0x54ea11[_0x46b2('0x36')]);db[_0x46b2('0x3a')]['max'](_0x46b2('0x5f'))[_0x46b2('0xe')](function(_0x44abff){if(_[_0x46b2('0x60')](_0x44abff)){_0x54ea11[_0x46b2('0x5f')]=_0xb40ed4[_0x46b2('0x61')]||0x1;return;}if(_[_0x46b2('0x60')](_0xb40ed4[_0x46b2('0x61')])||_0xb40ed4['min_internal']===_0x44abff){_0x54ea11[_0x46b2('0x5f')]=_0x44abff+0x1;return;}if(_0xb40ed4['min_internal']>_0x44abff){_0x54ea11['internal']=_0xb40ed4['min_internal'];return;}return db[_0x46b2('0x62')][_0x46b2('0x3b')](_0x46b2('0x63'),{'type':db['sequelize'][_0x46b2('0x64')][_0x46b2('0x65')]})['then'](function(_0x10e060){if(_0x10e060&&_0x10e060[_0x46b2('0x42')]){for(var _0xd2bb80=0x0,_0x5a98af=_0x10e060['length'];_0xd2bb80<_0x5a98af&&_['isNil'](_0x54ea11['internal']);_0xd2bb80++){if(_0xb40ed4[_0x46b2('0x61')]<=_0x10e060[_0xd2bb80]['from']){_0x54ea11[_0x46b2('0x5f')]=_0x10e060[_0xd2bb80][_0x46b2('0x66')];}else if(_0xb40ed4[_0x46b2('0x61')]>_0x10e060[_0xd2bb80]['from']&&_0xb40ed4[_0x46b2('0x61')]<=_0x10e060[_0xd2bb80]['to']){_0x54ea11[_0x46b2('0x5f')]=_0xb40ed4[_0x46b2('0x61')];}}}if(_[_0x46b2('0x60')](_0x54ea11['internal'])){_0x54ea11['internal']=_0x44abff+0x1;}return _0x26109f(_0x54ea11);});});})[_0x46b2('0x18')](function(_0x7e80bc){_0x18322c(_0x7e80bc);});});}function updateUser(_0x5a701e){return new BPromise(function(_0x3c09ac,_0x2c7817){try{if(_0x5a701e['voicemail']){_0x5a701e[_0x46b2('0x67')]=_0x5a701e['internal'];_0x5a701e['VoiceMail']={'mailbox':_0x5a701e[_0x46b2('0x5f')],'password':_0x5a701e[_0x46b2('0x36')],'fullname':_0x5a701e['fullname'],'email':_0x5a701e[_0x46b2('0x68')]};}if(_0x5a701e[_0x46b2('0x26')]===_0x46b2('0x2a')){if(!_0x5a701e[_0x46b2('0x69')])_0x5a701e[_0x46b2('0x69')]=[_0x46b2('0x6a'),_0x46b2('0x6b'),_0x46b2('0x6c'),_0x46b2('0x6d'),_0x46b2('0x6e'),_0x46b2('0x6f'),_0x46b2('0x70'),'106',_0x46b2('0x71'),_0x46b2('0x72'),'109',_0x46b2('0x73'),_0x46b2('0x74'),_0x46b2('0x75'),_0x46b2('0x76')];}_0x3c09ac(_0x5a701e);}catch(_0x30e14c){_0x2c7817(_0x30e14c);}});}exports[_0x46b2('0x77')]=function(_0x53bb15,_0x151dc6){if(_0x53bb15[_0x46b2('0x28')][_0x46b2('0x26')]===_0x46b2('0x2a'))throw new Error('Unauthorized');if(_0x53bb15[_0x46b2('0x56')]['role']===_0x46b2('0x28')&&_0x53bb15[_0x46b2('0x28')]['role']!==_0x46b2('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x53bb15['body'][_0x46b2('0x26')]===_0x46b2('0x78')&&_0x53bb15['user'][_0x46b2('0x26')]!==_0x46b2('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x46b2('0x79')]([_0x53bb15[_0x46b2('0x56')]])['then'](function(){return validateUser(_0x53bb15[_0x46b2('0x56')]);})[_0x46b2('0xe')](function(_0xb60fa8){return updateUser(_0xb60fa8)[_0x46b2('0xe')](function(_0x3851d6){if(_0x3851d6[_0x46b2('0x26')]===_0x46b2('0x78')){_0x3851d6[_0x46b2('0x7a')]=_0x53bb15[_0x46b2('0x28')]['settingsEnabled'];delete _0x3851d6[_0x46b2('0x7b')];}return _0x3851d6;});})[_0x46b2('0xe')](function(_0x2b459a){return db['User'][_0x46b2('0x77')](_0x2b459a,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x46b2('0xe')](function(_0x311ecb){if(_0x53bb15[_0x46b2('0x56')][_0x46b2('0x26')]===_0x46b2('0x28'))return _0x311ecb;if(_0x53bb15[_0x46b2('0x28')][_0x46b2('0x26')]!==_0x46b2('0x28'))return _0x311ecb;return db[_0x46b2('0x7c')][_0x46b2('0x30')]({'where':{'name':_0x311ecb[_0x46b2('0x26')]===_0x46b2('0x2a')?_0x46b2('0x29'):_0x46b2('0x2b'),'userProfileId':_0x53bb15[_0x46b2('0x28')][_0x46b2('0x7b')]},'raw':!![]})[_0x46b2('0xe')](function(_0x406f83){if(!_0x406f83||_0x406f83[_0x46b2('0x7d')]!=0x0)return _0x311ecb;return db['UserProfileResource'][_0x46b2('0x77')]({'name':_0x311ecb[_0x46b2('0x31')],'resourceId':_0x311ecb['id'],'type':_0x406f83['name'],'sectionId':_0x406f83['id']},{})[_0x46b2('0xe')](function(){return _0x311ecb;});})[_0x46b2('0x18')](function(_0x5cff91){logger['error'](_0x46b2('0x7e'),_0x5cff91);throw _0x5cff91;});})[_0x46b2('0xe')](respondWithResult(_0x151dc6,0xc9))[_0x46b2('0x18')](handleError(_0x151dc6,null));};exports['bulkCreate']=function(_0x153fb1,_0x2c09a2){var _0x32fad3=_0x153fb1[_0x46b2('0x56')];var _0x4e066d=[];if(_0x153fb1[_0x46b2('0x28')]['role']==='agent')throw new Error(_0x46b2('0x7f'));if(_['some'](_0x32fad3,['role','user'])&&_0x153fb1['user']['role']!==_0x46b2('0x78')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x46b2('0x80')](_0x32fad3,['role',_0x46b2('0x78')])&&_0x153fb1['user'][_0x46b2('0x26')]!==_0x46b2('0x78')){throw new Error(_0x46b2('0x81'));}return licenseUtil['checkUserLimits'](_0x32fad3)['then'](function(){return validateUser(_0x32fad3[0x0]);})[_0x46b2('0xe')](function(){for(var _0x10b136=0x1;_0x10b136<_0x32fad3[_0x46b2('0x42')];_0x10b136++){var _0x427b4d=_0x32fad3[_0x10b136-0x1][_0x46b2('0x5f')];if(!_0x32fad3[_0x10b136][_0x46b2('0x5f')])_0x32fad3[_0x10b136][_0x46b2('0x5f')]=_0x427b4d+0x1;_0x4e066d[_0x46b2('0x43')](validateUser(_0x32fad3[_0x10b136]));}return BPromise[_0x46b2('0x55')](_0x4e066d);})[_0x46b2('0xe')](function(){_0x4e066d=[];for(var _0x11b643=0x0;_0x11b643<_0x32fad3[_0x46b2('0x42')];_0x11b643++){_0x4e066d[_0x46b2('0x43')](updateUser(_0x32fad3[_0x11b643]));}return BPromise[_0x46b2('0x55')](_0x4e066d);})[_0x46b2('0xe')](function(){return BPromise[_0x46b2('0x82')](_0x32fad3,function(_0x356764){return db['User'][_0x46b2('0x77')](_0x356764,{'include':[{'model':db[_0x46b2('0x83')],'as':_0x46b2('0x83')}]})[_0x46b2('0xe')](function(_0x4d82b4){_0x356764['id']=_0x4d82b4['id'];return _0x356764;});});})[_0x46b2('0xe')](function(_0x1c84e4){if(_0x153fb1['body']['role']===_0x46b2('0x28'))return _0x1c84e4;if(_0x153fb1[_0x46b2('0x28')][_0x46b2('0x26')]!==_0x46b2('0x28'))return _0x1c84e4;var _0x526b8a=_[_0x46b2('0x80')](_0x1c84e4,function(_0x22aa93){return _0x22aa93[_0x46b2('0x26')]===_0x46b2('0x2a')||_0x22aa93[_0x46b2('0x26')]===_0x46b2('0x2c');});if(!_0x526b8a)return _0x1c84e4;return db[_0x46b2('0x7c')][_0x46b2('0x3f')]({'where':{'name':{'$or':[_0x46b2('0x29'),_0x46b2('0x2b')]},'userProfileId':_0x153fb1[_0x46b2('0x28')]['userProfileId']},'raw':!![]})[_0x46b2('0xe')](function(_0x31bca6){if(_[_0x46b2('0x84')](_0x31bca6)||!_['some'](_0x31bca6,['autoAssociation',0x0]))return _0x1c84e4;_0x4e066d=[];var _0x5ca3cc=_(_0x31bca6)[_0x46b2('0x2e')](function(_0x95f001){if(_0x95f001['autoAssociation']===0x1)return;return _0x95f001[_0x46b2('0x31')]===_0x46b2('0x29')?_0x46b2('0x2a'):'telephone';})['compact']()[_0x46b2('0x2f')]();for(var _0x548b75=0x0;_0x548b75<_0x1c84e4[_0x46b2('0x42')];_0x548b75++){if(!_[_0x46b2('0x3d')](_0x5ca3cc,_0x1c84e4[_0x548b75]['role']))return;var _0x531dce=_0x1c84e4[_0x548b75][_0x46b2('0x26')]===_0x46b2('0x2a')?_0x46b2('0x29'):_0x46b2('0x2b');_0x4e066d['push'](db[_0x46b2('0x85')][_0x46b2('0x77')]({'name':_0x1c84e4[_0x548b75][_0x46b2('0x31')],'resourceId':_0x1c84e4[_0x548b75]['id'],'type':_0x531dce,'sectionId':_['find'](_0x31bca6,[_0x46b2('0x31'),_0x531dce])['id']},{}));}return BPromise['all'](_0x4e066d);});})[_0x46b2('0xe')](respondWithResult(_0x2c09a2,0xc9))[_0x46b2('0x18')](handleError(_0x2c09a2,null));};exports[_0x46b2('0x86')]=function(_0x248d47,_0x1b7fe0){if(_0x248d47[_0x46b2('0x56')]['id']){delete _0x248d47[_0x46b2('0x56')]['id'];}return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x248d47[_0x46b2('0x59')]['id']}})['then'](function(_0x46ce1e){if(!_0x46ce1e)return null;if(_0x46ce1e['id']===_0x248d47[_0x46b2('0x28')]['id']){if(!_0x248d47[_0x46b2('0x56')][_0x46b2('0x87')]||!_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')]){throw new db[(_0x46b2('0x89'))][(_0x46b2('0x8a'))](_0x46b2('0x8b'));}if(!_0x46ce1e[_0x46b2('0x8c')](_0x248d47[_0x46b2('0x56')]['oldPassword'])){throw new db[(_0x46b2('0x89'))][(_0x46b2('0x8a'))]('Wrong\x20credentials');}if(_0x248d47[_0x46b2('0x56')]['oldPassword']===_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')]){throw new db[(_0x46b2('0x89'))][(_0x46b2('0x8a'))](_0x46b2('0x8d'));}}else if(_0x248d47[_0x46b2('0x28')]['role']==='admin'){if(!_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')]){throw new db[(_0x46b2('0x89'))][(_0x46b2('0x8a'))](_0x46b2('0x8e'));}}else if(_0x248d47['user'][_0x46b2('0x26')]===_0x46b2('0x28')){if(!_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')]){throw new db['Sequelize'][(_0x46b2('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x46ce1e[_0x46b2('0x26')]!==_0x46b2('0x2a')){throw new db['Sequelize'][(_0x46b2('0x8a'))](_0x46b2('0x7f'));}}else{throw new db['Sequelize']['ValidationError'](_0x46b2('0x7f'));}return _0x46ce1e;})[_0x46b2('0xe')](handleEntityNotFound(_0x1b7fe0,null))[_0x46b2('0xe')](function(_0x2ff241){return db[_0x46b2('0x5c')]['findOne']({'attributes':['id',_0x46b2('0x5d'),'enforcePasswordHistory',_0x46b2('0x8f')]})[_0x46b2('0xe')](function(_0x519bda){if(_0x519bda[_0x46b2('0x5d')])authService[_0x46b2('0x5e')](_0x248d47['body'][_0x46b2('0x88')]);if(!_0x519bda[_0x46b2('0x90')]||!_0x2ff241[_0x46b2('0x91')])return _0x2ff241;authService[_0x46b2('0x92')](_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')],_0x2ff241['previousPasswords'],_0x519bda[_0x46b2('0x8f')]);return _0x2ff241;})[_0x46b2('0xe')](saveUpdates({'password':_0x248d47[_0x46b2('0x56')][_0x46b2('0x88')],'passwordResetAt':_0x248d47[_0x46b2('0x28')]['id']==_0x248d47['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x248d47['body'][_0x46b2('0x88')],_0x2ff241[_0x46b2('0x91')])},null));})[_0x46b2('0xe')](respondWithResult(_0x1b7fe0,null))[_0x46b2('0x18')](handleError(_0x1b7fe0,null));};exports[_0x46b2('0x93')]=function(_0x1720b1,_0x45ae7b){var _0x50bc2a=_0x1720b1[_0x46b2('0x56')][_0x46b2('0x94')];return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x1720b1[_0x46b2('0x59')]['id']},'attributes':['id','name',_0x46b2('0x26'),_0x46b2('0x95'),_0x46b2('0x96'),_0x46b2('0x97'),_0x46b2('0x98')]})['then'](handleEntityNotFound(_0x45ae7b,null))['then'](function(_0x4f460d){if(_0x4f460d){if(!utils[_0x46b2('0x99')](_0x50bc2a)){throw new db['Sequelize'][(_0x46b2('0x8a'))](_0x46b2('0x9a'));}return _0x4f460d['add'+_['capitalize'](_0x50bc2a[_0x46b2('0x9b')]())+'Queues'](_0x1720b1[_0x46b2('0x56')]['ids'],{'penalty':_0x1720b1[_0x46b2('0x56')][_0x46b2('0x9c')]||0x0})[_0x46b2('0x9d')](function(_0x4a98af){for(var _0x22d99a=0x0;_0x22d99a<_0x1720b1['body'][_0x46b2('0x5a')][_0x46b2('0x42')];_0x22d99a+=0x1){var _0x100f55={'UserId':Number(_0x1720b1[_0x46b2('0x59')]['id'])};_0x100f55[_[_0x46b2('0x9e')](_0x50bc2a['toLowerCase']())+'QueueId']=Number(_0x1720b1[_0x46b2('0x56')][_0x46b2('0x5a')][_0x22d99a]);socket[_0x46b2('0x9f')](_0x46b2('0x28')+_[_0x46b2('0x9e')](_0x50bc2a['toLowerCase']())+_0x46b2('0xa0'),_0x100f55);}return _0x4a98af;})['then'](function(){if(_0x50bc2a===_0x46b2('0xa1')){return db[_0x46b2('0xa2')][_0x46b2('0x3f')]({'where':{'id':_0x1720b1[_0x46b2('0x56')][_0x46b2('0x5a')]||[]},'raw':!![],'attributes':['id',_0x46b2('0x31')]});}})[_0x46b2('0xe')](function(_0x95ed6){var _0x4ea4d2=_0x4f460d[_0x46b2('0x25')]({'plain':!![]});var _0x4eeca1=[];if(_0x50bc2a===_0x46b2('0xa1')&&_0x4ea4d2['role']===_0x46b2('0x2a')&&_0x4ea4d2['online']){for(var _0x2cf272=0x0;_0x2cf272<_0x95ed6[_0x46b2('0x42')];_0x2cf272+=0x1){_0x4eeca1[_0x46b2('0x43')]({'membername':_0x4ea4d2[_0x46b2('0x31')],'UserId':_0x4ea4d2['id'],'queue_name':_0x95ed6[_0x2cf272][_0x46b2('0x31')],'VoiceQueueId':_0x95ed6[_0x2cf272]['id'],'interface':_[_0x46b2('0x60')](_0x4ea4d2[_0x46b2('0x98')])?util[_0x46b2('0xa3')](_0x46b2('0xa4'),_0x4ea4d2[_0x46b2('0x31')]):_0x4ea4d2[_0x46b2('0x98')],'paused':_0x4ea4d2[_0x46b2('0x97')]||![],'penalty':_0x1720b1[_0x46b2('0x56')][_0x46b2('0x9c')]||0x0});}return BPromise['each'](_0x4eeca1,function(_0x1e69c3){return db[_0x46b2('0xa5')][_0x46b2('0xa6')](_0x1e69c3);});}return _0x4f460d;});}})[_0x46b2('0xe')](respondWithStatusCode(_0x45ae7b,null))['catch'](handleError(_0x45ae7b,null));};exports[_0x46b2('0xa7')]=function(_0x12815f,_0x5cb24a){var _0x4f88cd;return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x12815f['params']['id']},'attributes':['id',_0x46b2('0x31'),_0x46b2('0x26')]})[_0x46b2('0xe')](handleEntityNotFound(_0x5cb24a,null))['then'](function(_0x34fc12){if(_0x34fc12){_0x4f88cd=_0x34fc12;if(!_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')]||!utils[_0x46b2('0x99')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')])){throw new db[(_0x46b2('0x89'))][(_0x46b2('0x8a'))](_0x46b2('0x9a'));}return _0x34fc12[_0x46b2('0xa8')+_[_0x46b2('0x9e')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')][_0x46b2('0x9b')]())+_0x46b2('0xa9')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x5a')]);}})['then'](function(_0x47a286){if(_[_0x46b2('0xaa')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x5a')])){for(var _0x396a1d=0x0;_0x396a1d<_0x12815f['query'][_0x46b2('0x5a')][_0x46b2('0x42')];_0x396a1d+=0x1){var _0x49c7a0={'UserId':Number(_0x12815f[_0x46b2('0x59')]['id'])};_0x49c7a0[_[_0x46b2('0x9e')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')][_0x46b2('0x9b')]())+'QueueId']=Number(_0x12815f[_0x46b2('0x3b')][_0x46b2('0x5a')][_0x396a1d]);socket[_0x46b2('0x9f')]('user'+_[_0x46b2('0x9e')](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')][_0x46b2('0x9b')]())+_0x46b2('0xab'),_0x49c7a0);}}else{var _0x49c7a0={'UserId':Number(_0x12815f[_0x46b2('0x59')]['id'])};_0x49c7a0[_[_0x46b2('0x9e')](_0x12815f['query'][_0x46b2('0x94')][_0x46b2('0x9b')]())+'QueueId']=Number(_0x12815f['query'][_0x46b2('0x5a')]);socket[_0x46b2('0x9f')](_0x46b2('0x28')+_['capitalize'](_0x12815f[_0x46b2('0x3b')][_0x46b2('0x94')][_0x46b2('0x9b')]())+_0x46b2('0xab'),_0x49c7a0);}return _0x47a286;})['then'](function(){if(_0x12815f['query'][_0x46b2('0x94')]==='voice'){return db[_0x46b2('0xa5')][_0x46b2('0x24')]({'where':{'UserId':_0x12815f['params']['id'],'VoiceQueueId':_0x12815f[_0x46b2('0x3b')][_0x46b2('0x5a')]},'individualHooks':!![]})[_0x46b2('0xe')](function(){return _0x4f88cd;});}return _0x4f88cd;})[_0x46b2('0xe')](respondWithStatusCode(_0x5cb24a,null))[_0x46b2('0x18')](handleError(_0x5cb24a,null));};exports[_0x46b2('0xac')]=function(_0x3999a0,_0x5c73c0){_0x3999a0['body'][_0x46b2('0xad')]=_0x3999a0[_0x46b2('0xae')][_0x46b2('0xaf')];return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x3999a0[_0x46b2('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c73c0,null))[_0x46b2('0xe')](saveUpdates(_0x3999a0[_0x46b2('0x56')],null))['then'](respondWithResult(_0x5c73c0,null))['catch'](handleError(_0x5c73c0,null));};exports[_0x46b2('0xb0')]=function(_0x44d92c,_0x54c588){var _0x2c563e=path['join'](config['root'],_0x46b2('0xb1'));return db['User'][_0x46b2('0x30')]({'where':{'id':_0x44d92c[_0x46b2('0x59')]['id']},'attributes':['id',_0x46b2('0xad')],'raw':!![]})[_0x46b2('0xe')](handleEntityNotFound(_0x54c588,null))[_0x46b2('0xe')](function(_0x43b419){if(_0x43b419){if(_[_0x46b2('0x60')](_0x43b419[_0x46b2('0xad')])){return _0x54c588[_0x46b2('0xb2')](_0x2c563e);}else{if(!fs[_0x46b2('0xb3')](path[_0x46b2('0xb4')](config['root'],_0x46b2('0xb5'),_0x43b419[_0x46b2('0xad')]))){return _0x54c588[_0x46b2('0xb2')](_0x2c563e);}return _0x54c588[_0x46b2('0xb2')](path[_0x46b2('0xb4')](config[_0x46b2('0xb6')],_0x46b2('0xb5'),_0x43b419[_0x46b2('0xad')]));}}})[_0x46b2('0x18')](handleError(_0x54c588,null));};exports[_0x46b2('0xb7')]=function(_0x7dbc76,_0x1757f9){return db[_0x46b2('0x3a')][_0x46b2('0x30')]({'where':{'id':_0x7dbc76[_0x46b2('0x59')]['id']},'attributes':['id']})[_0x46b2('0xe')](handleEntityNotFound(_0x1757f9,null))[_0x46b2('0xe')](function(_0x165b31){var _0x1ff53e=[];values=_0x165b31[_0x46b2('0x46')];_0x1ff53e['push'](get_open_tabs('chat',_0x165b31[_0x46b2('0x46')]));_0x1ff53e[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x54'),_0x165b31[_0x46b2('0x46')]));_0x1ff53e['push'](get_open_tabs('openchannel',_0x165b31['dataValues']));_0x1ff53e[_0x46b2('0x43')](get_open_tabs('whatsapp',_0x165b31[_0x46b2('0x46')]));_0x1ff53e[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x47'),_0x165b31[_0x46b2('0x46')]));_0x1ff53e[_0x46b2('0x43')](get_open_tabs(_0x46b2('0x48'),_0x165b31['dataValues']));return BPromise[_0x46b2('0x55')](_0x1ff53e);})[_0x46b2('0xe')](function(_0x5f5ad6){var _0x2dab4b=[];if(_0x5f5ad6){for(var _0x15db49=0x0;_0x15db49=_0x1f7055[_0xbaa6('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xbaa6('0x27')](function(){if(_0x217826){return db[_0xbaa6('0x2f')]['destroy']({'where':{'membername':_0x217826[_0xbaa6('0x2c')]},'individualHooks':!![]});}})['then'](function(){if(_0x217826){return _0x217826[_0xbaa6('0x55')]({'raw':!![]});}})[_0xbaa6('0x27')](function(_0x220b23){if(_0x217826){if(_0x220b23){var _0x1386e1=[];_0x4680a7=_0x220b23;if(_0x4680a7['length']){for(var _0x947a23=0x0;_0x947a23<_0x4680a7[_0xbaa6('0x32')];_0x947a23++){_0x1386e1[_0xbaa6('0x37')](db[_0xbaa6('0x2f')][_0xbaa6('0x56')]({'membername':_0x217826['name'],'UserId':_0x217826['id'],'queue_name':_0x4680a7[_0x947a23][_0xbaa6('0x2c')],'VoiceQueueId':_0x4680a7[_0x947a23]['id'],'interface':_0x2fd8a6,'paused':_0x217826[_0xbaa6('0x50')]||![],'penalty':_0x4680a7[_0x947a23][_0xbaa6('0x57')]||0x0}));}return BPromise[_0xbaa6('0x4b')](_0x1386e1);}}}})[_0xbaa6('0x27')](function(){if(_0x217826){return db['MemberReport'][_0xbaa6('0x1e')]({'where':{'membername':_0x217826[_0xbaa6('0x2c')],'exitAt':null}});}})[_0xbaa6('0x27')](function(_0x38bf84){if(_0x217826){if(_0x38bf84&&_0x38bf84[_0xbaa6('0x32')]){var _0x4901ab=[];_0x38bf84[_0xbaa6('0x4e')](function(_0x5b3a8d){_0x4901ab['push'](_0x5b3a8d[_0xbaa6('0x3f')]({'exitAt':moment()[_0xbaa6('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xbaa6('0x4b')](_0x4901ab);}}})[_0xbaa6('0x27')](function(_0x291e44){if(_0x217826){var _0x3a0d6f=[];var _0x79f1b=[];var _0x3def05=utils[_0xbaa6('0x36')]();var _0x305a0a={'membername':_0x217826['name'],'interface':_0x2fd8a6,'enterAt':moment()[_0xbaa6('0x33')](_0xbaa6('0x34')),'role':_0x217826['role'],'internal':_0x217826[_0xbaa6('0x2d')]};_0x3def05[_0xbaa6('0x4e')](function(_0x1f709b){_0x3a0d6f[_0xbaa6('0x37')](_[_0xbaa6('0x58')]({'channel':_0x1f709b,'type':_0xbaa6('0x59'),'data1':_0xbaa6('0x5a'),'data2':_0x2fd8a6},_0x305a0a));if(_0x217826[_0xbaa6('0x50')]){_0x79f1b[_0xbaa6('0x37')](_['merge']({'channel':_0x1f709b,'type':'PAUSE','data1':_0xbaa6('0x5b')},_0x305a0a));}});return db[_0xbaa6('0x30')]['bulkCreate'](_0x3a0d6f[_0xbaa6('0x5c')](_0x79f1b),{'individualHooks':!![]});}})[_0xbaa6('0x27')](function(){if(_0x217826){return _0x217826[_0xbaa6('0x3f')]({'online':!![],'lastLoginAt':moment()[_0xbaa6('0x33')](_0xbaa6('0x34')),'voicePause':_0x217826['loginInPause']||![],'mailPause':_0x217826['loginInPause']||![],'chatPause':_0x217826[_0xbaa6('0x50')]||![],'faxPause':_0x217826[_0xbaa6('0x50')]||![],'smsPause':_0x217826['loginInPause']||![],'openchannelPause':_0x217826[_0xbaa6('0x50')]||![],'pauseType':_0x217826[_0xbaa6('0x50')]?_0xbaa6('0x5b'):null,'lastPauseAt':moment()[_0xbaa6('0x33')](_0xbaa6('0x34')),'interface':_0x2fd8a6});}})[_0xbaa6('0x27')](function(_0x149d88){_0x156d1a(_0x149d88);})[_0xbaa6('0x1b')](function(_0x4e138e){_0x3925eb(_0x5bb532[_0xbaa6('0x18')](0x1f4,_0x4e138e['message']));});});}; \ No newline at end of file +var _0x69e2=['attributes','limit','map','include','model','ShowUser','User','find','PauseUser','where','role','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','updateAttributes','forEach','push','isNil','interface','SIP/%s','name','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','fax','sms','openchannel','set','Pause','system','all','LogoutUser','destroy','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetUser','findAll','options','raw'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x69e2,0x19b));var _0x269e=function(_0x1bcc31,_0x247156){_0x1bcc31=_0x1bcc31-0x0;var _0x3c2ff6=_0x69e2[_0x1bcc31];return _0x3c2ff6;};'use strict';var _=require(_0x269e('0x0'));var util=require('util');var moment=require(_0x269e('0x1'));var BPromise=require(_0x269e('0x2'));var rs=require(_0x269e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x269e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x269e('0x5'));var config=require(_0x269e('0x6'));var jayson=require(_0x269e('0x7'));var client=jayson[_0x269e('0x8')]['http']({'port':0x232a});config[_0x269e('0x9')]=_[_0x269e('0xa')](config[_0x269e('0x9')],{'host':_0x269e('0xb'),'port':0x18eb});var socket=require(_0x269e('0xc'))(new Redis(config[_0x269e('0x9')]));require(_0x269e('0xd'))[_0x269e('0xe')](socket);function respondWithRpcPromise(_0x282a56,_0x4d933c,_0x33251d){return new BPromise(function(_0xadafae,_0x1d164f){return client[_0x269e('0xf')](_0x282a56,_0x33251d)[_0x269e('0x10')](function(_0x36752d){logger[_0x269e('0x11')](_0x269e('0x12'),_0x4d933c,_0x269e('0x13'));logger[_0x269e('0x14')]('User,\x20%s,\x20%s,\x20%s',_0x4d933c,_0x269e('0x13'),JSON[_0x269e('0x15')](_0x36752d));if(_0x36752d['error']){if(_0x36752d[_0x269e('0x16')]['code']===0x1f4){logger['error'](_0x269e('0x12'),_0x4d933c,_0x36752d[_0x269e('0x16')]['message']);return _0x1d164f(_0x36752d[_0x269e('0x16')][_0x269e('0x17')]);}logger[_0x269e('0x16')]('User,\x20%s,\x20%s',_0x4d933c,_0x36752d[_0x269e('0x16')][_0x269e('0x17')]);return _0xadafae(_0x36752d['error'][_0x269e('0x17')]);}else{logger[_0x269e('0x11')](_0x269e('0x12'),_0x4d933c,'request\x20sent');_0xadafae(_0x36752d['result'][_0x269e('0x17')]);}})[_0x269e('0x18')](function(_0x789c55){logger[_0x269e('0x16')]('User,\x20%s,\x20%s',_0x4d933c,_0x789c55);_0x1d164f(_0x789c55);});});}exports[_0x269e('0x19')]=function(_0x44e85e){var _0x1c7352=this;return new Promise(function(_0x1a0fce,_0x564eea){return db['User'][_0x269e('0x1a')]({'raw':_0x44e85e[_0x269e('0x1b')]?_0x44e85e[_0x269e('0x1b')][_0x269e('0x1c')]===undefined?!![]:![]:!![],'where':_0x44e85e['options']?_0x44e85e[_0x269e('0x1b')]['where']||null:null,'attributes':_0x44e85e[_0x269e('0x1b')]?_0x44e85e[_0x269e('0x1b')][_0x269e('0x1d')]||null:null,'limit':_0x44e85e[_0x269e('0x1b')]?_0x44e85e[_0x269e('0x1b')][_0x269e('0x1e')]||null:null,'include':_0x44e85e[_0x269e('0x1b')]?_0x44e85e[_0x269e('0x1b')]['include']?_[_0x269e('0x1f')](_0x44e85e[_0x269e('0x1b')][_0x269e('0x20')],function(_0x149580){return{'model':db[_0x149580[_0x269e('0x21')]],'as':_0x149580['as'],'attributes':_0x149580[_0x269e('0x1d')],'include':_0x149580[_0x269e('0x20')]?_[_0x269e('0x1f')](_0x149580[_0x269e('0x20')],function(_0x2237a8){return{'model':db[_0x2237a8['model']],'as':_0x2237a8['as'],'attributes':_0x2237a8[_0x269e('0x1d')],'include':_0x2237a8[_0x269e('0x20')]?_['map'](_0x2237a8[_0x269e('0x20')],function(_0x41cac6){return{'model':db[_0x41cac6[_0x269e('0x21')]],'as':_0x41cac6['as'],'attributes':_0x41cac6[_0x269e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x269e('0x10')](function(_0x324975){logger[_0x269e('0x11')](_0x269e('0x19'),_0x44e85e);logger[_0x269e('0x14')](_0x269e('0x19'),_0x44e85e,JSON[_0x269e('0x15')](_0x324975));_0x1a0fce(_0x324975);})[_0x269e('0x18')](function(_0x4085b0){logger[_0x269e('0x16')](_0x269e('0x19'),_0x4085b0[_0x269e('0x17')],_0x44e85e);_0x564eea(_0x1c7352[_0x269e('0x16')](0x1f4,_0x4085b0[_0x269e('0x17')]));});});};exports[_0x269e('0x22')]=function(_0x57eb6e){var _0x481937=this;return new Promise(function(_0x245f9e,_0x399475){return db[_0x269e('0x23')][_0x269e('0x24')]({'raw':_0x57eb6e['options']?_0x57eb6e[_0x269e('0x1b')][_0x269e('0x1c')]===undefined?!![]:![]:!![],'where':_0x57eb6e[_0x269e('0x1b')]?_0x57eb6e[_0x269e('0x1b')]['where']||null:null,'attributes':_0x57eb6e[_0x269e('0x1b')]?_0x57eb6e['options'][_0x269e('0x1d')]||null:null,'include':_0x57eb6e['options']?_0x57eb6e['options'][_0x269e('0x20')]?_['map'](_0x57eb6e[_0x269e('0x1b')]['include'],function(_0x14e2d1){return{'model':db[_0x14e2d1['model']],'as':_0x14e2d1['as'],'attributes':_0x14e2d1[_0x269e('0x1d')],'include':_0x14e2d1[_0x269e('0x20')]?_[_0x269e('0x1f')](_0x14e2d1[_0x269e('0x20')],function(_0x2e607e){return{'model':db[_0x2e607e['model']],'as':_0x2e607e['as'],'attributes':_0x2e607e[_0x269e('0x1d')],'include':_0x2e607e[_0x269e('0x20')]?_[_0x269e('0x1f')](_0x2e607e[_0x269e('0x20')],function(_0x1f4cb3){return{'model':db[_0x1f4cb3[_0x269e('0x21')]],'as':_0x1f4cb3['as'],'attributes':_0x1f4cb3[_0x269e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x269e('0x10')](function(_0x1ce0a5){logger[_0x269e('0x11')]('ShowUser',_0x57eb6e);logger['debug'](_0x269e('0x22'),_0x57eb6e,JSON[_0x269e('0x15')](_0x1ce0a5));_0x245f9e(_0x1ce0a5);})['catch'](function(_0x107b2f){logger[_0x269e('0x16')](_0x269e('0x22'),_0x107b2f[_0x269e('0x17')],_0x57eb6e);_0x399475(_0x481937[_0x269e('0x16')](0x1f4,_0x107b2f[_0x269e('0x17')]));});});};exports[_0x269e('0x25')]=function(_0x528d31){var _0x3da49a=this;return new Promise(function(_0x390ba0,_0x3d9195){var _0x25019c;return db[_0x269e('0x23')][_0x269e('0x24')]({'where':_0x528d31[_0x269e('0x1b')][_0x269e('0x26')]||{},'attributes':['id','name',_0x269e('0x27'),'internal','interface']})[_0x269e('0x10')](function(_0x6c841d){if(_0x6c841d){_0x25019c=_0x6c841d;return db[_0x269e('0x28')][_0x269e('0x29')]({'paused':0x1},{'where':{'UserId':_0x25019c['id']},'individualHooks':!![]});}})['then'](function(){if(_0x25019c){return db[_0x269e('0x2a')][_0x269e('0x1a')]({'where':{'membername':_0x25019c['name'],'type':_0x269e('0x2b'),'exitAt':null}});}})[_0x269e('0x10')](function(_0x3af32f){if(_0x25019c){if(_0x3af32f&&_0x3af32f[_0x269e('0x2c')]){var _0x241ba0=moment()[_0x269e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4d65a3=0x0,_0x4e812f=_0x3af32f['length'];_0x4d65a3<_0x4e812f;_0x4d65a3++){_0x3af32f[_0x4d65a3][_0x269e('0x2e')]({'exitAt':_0x241ba0});}}}})[_0x269e('0x10')](function(){if(_0x25019c){var _0x18110b=[];var _0x2095f6=utils['getChannels']();_0x2095f6[_0x269e('0x2f')](function(_0x18b666){_0x18110b[_0x269e('0x30')]({'channel':_0x18b666,'membername':_0x25019c['name'],'interface':_[_0x269e('0x31')](_0x25019c[_0x269e('0x32')])?util['format'](_0x269e('0x33'),_0x25019c[_0x269e('0x34')]):_0x25019c[_0x269e('0x32')],'type':_0x269e('0x2b'),'enterAt':moment()[_0x269e('0x2d')](_0x269e('0x35')),'data1':_0x528d31[_0x269e('0x36')][_0x269e('0x37')]||_0x269e('0x38'),'role':_0x25019c[_0x269e('0x27')],'internal':_0x25019c[_0x269e('0x39')],'uniqueid':_0x528d31[_0x269e('0x36')][_0x269e('0x3a')]||null});});return db[_0x269e('0x2a')][_0x269e('0x3b')](_0x18110b,{'individualHooks':!![]});}})[_0x269e('0x10')](function(){if(_0x25019c){return _0x25019c[_0x269e('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x528d31[_0x269e('0x36')][_0x269e('0x37')]||_0x269e('0x38'),'lastPauseAt':moment()[_0x269e('0x2d')](_0x269e('0x35'))});}})['then'](function(_0x4b2f06){_0x390ba0(_0x4b2f06);})[_0x269e('0x18')](function(_0x212c47){_0x3d9195(_0x3da49a[_0x269e('0x16')](0x1f4,_0x212c47[_0x269e('0x17')]));});});};exports[_0x269e('0x3c')]=function(_0x2a2cc0){var _0x4d35cc=this;return new Promise(function(_0x8235b7,_0x46e89b){var _0x5d1dd6;return db[_0x269e('0x23')][_0x269e('0x3d')]({'where':_0x2a2cc0[_0x269e('0x1b')]['where']||{},'attributes':['id',_0x269e('0x34')]})[_0x269e('0x10')](function(_0x2954ef){if(_0x2954ef){_0x5d1dd6=_0x2954ef;if(_0x2a2cc0[_0x269e('0x36')][_0x269e('0x3e')]&&!utils[_0x269e('0x3f')](_0x2a2cc0[_0x269e('0x36')][_0x269e('0x3e')])){throw new Error('Unknown\x20channel');}switch(_0x2a2cc0[_0x269e('0x36')]['channel']){case _0x269e('0x40'):return db[_0x269e('0x28')][_0x269e('0x29')]({'paused':0x0},{'where':{'UserId':_0x5d1dd6['id']}})[_0x269e('0x10')](function(){return db[_0x269e('0x2a')][_0x269e('0x24')]({'where':{'channel':_0x2a2cc0[_0x269e('0x36')][_0x269e('0x3e')],'membername':_0x5d1dd6[_0x269e('0x34')],'type':_0x269e('0x2b'),'exitAt':null}});})[_0x269e('0x10')](function(_0x52bd10){if(_0x52bd10){return _0x52bd10['update']({'exitAt':moment()[_0x269e('0x2d')](_0x269e('0x35')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5d1dd6[_0x269e('0x29')]({'voicePause':![]});});case'mail':case'chat':case _0x269e('0x41'):case _0x269e('0x42'):case _0x269e('0x43'):case'whatsapp':return db['MemberReport'][_0x269e('0x24')]({'where':{'channel':_0x2a2cc0[_0x269e('0x36')][_0x269e('0x3e')],'membername':_0x5d1dd6[_0x269e('0x34')],'type':_0x269e('0x2b'),'exitAt':null}})[_0x269e('0x10')](function(_0x52e034){return _0x52e034[_0x269e('0x29')]({'exitAt':moment()[_0x269e('0x2d')](_0x269e('0x35')),'data2':'system'},{'individualHooks':!![]});})['then'](function(){var _0x2b616d={};_[_0x269e('0x44')](_0x2b616d,util['format']('%s%s',_0x2a2cc0[_0x269e('0x36')][_0x269e('0x3e')],_0x269e('0x45')),![]);return _0x5d1dd6[_0x269e('0x29')](_0x2b616d);});default:return db['UserVoiceQueueRt'][_0x269e('0x29')]({'paused':0x0},{'where':{'UserId':_0x5d1dd6['id']}})[_0x269e('0x10')](function(){return db[_0x269e('0x2a')][_0x269e('0x1a')]({'where':{'membername':_0x5d1dd6[_0x269e('0x34')],'type':_0x269e('0x2b'),'exitAt':null}});})[_0x269e('0x10')](function(_0x3cff15){var _0x1f002d=[];_0x3cff15[_0x269e('0x2f')](function(_0x30d858){_0x1f002d[_0x269e('0x30')](_0x30d858[_0x269e('0x29')]({'exitAt':moment()[_0x269e('0x2d')](_0x269e('0x35')),'data2':_0x269e('0x46')}));});return BPromise[_0x269e('0x47')](_0x1f002d);})[_0x269e('0x10')](function(){return _0x5d1dd6[_0x269e('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x269e('0x10')](function(_0x4e9833){_0x8235b7(_0x4e9833);})[_0x269e('0x18')](function(_0x514aaa){_0x46e89b(_0x4d35cc[_0x269e('0x16')](0x1f4,_0x514aaa['message']));});});};exports[_0x269e('0x48')]=function(_0x441e37){var _0x4cb1b9=this;return new Promise(function(_0x30fb75,_0x5d41cf){var _0x515187;return db[_0x269e('0x23')][_0x269e('0x3d')]({'where':_0x441e37[_0x269e('0x1b')][_0x269e('0x26')]||{},'attributes':['id',_0x269e('0x34')]})[_0x269e('0x10')](function(_0x389f42){if(_0x389f42){_0x515187=_0x389f42;return db['UserVoiceQueueRt'][_0x269e('0x49')]({'where':{'membername':_0x515187[_0x269e('0x34')]},'individualHooks':!![]});}})[_0x269e('0x10')](function(){if(_0x515187){return db[_0x269e('0x2a')]['findAll']({'where':{'membername':_0x515187[_0x269e('0x34')],'exitAt':null}});}})[_0x269e('0x10')](function(_0x334f82){if(_0x515187){if(_0x334f82&&_0x334f82['length']){var _0x2803d0=[];_0x334f82[_0x269e('0x2f')](function(_0x308996){_0x2803d0[_0x269e('0x30')](_0x308996[_0x269e('0x29')]({'exitAt':moment()[_0x269e('0x2d')](_0x269e('0x35'))}));});return BPromise['all'](_0x2803d0);}}})[_0x269e('0x10')](function(){if(_0x515187){return _0x515187['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x545f3b){_0x30fb75(_0x545f3b);})[_0x269e('0x18')](function(_0x2e0291){_0x5d41cf(_0x4cb1b9[_0x269e('0x16')](0x1f4,_0x2e0291['message']));});});};exports['LoginUser']=function(_0x256499){var _0x16b38b=this;return new Promise(function(_0x595ee7,_0x49bcd0){var _0x2d6dca;var _0x276fe5;var _0x452dff;var _0x37ce4e;return db[_0x269e('0x23')]['findOne']({'where':_0x256499[_0x269e('0x1b')]['where']||{},'attributes':['id',_0x269e('0x34'),_0x269e('0x27'),'mobile',_0x269e('0x4a'),_0x269e('0x39'),_0x269e('0x4b'),_0x269e('0x32')]})['then'](function(_0x28d966){if(_0x28d966){_0x2d6dca=_0x28d966;_0x37ce4e=_0x256499[_0x269e('0x36')][_0x269e('0x32')]?_0x256499[_0x269e('0x36')][_0x269e('0x32')]:util[_0x269e('0x2d')](_0x269e('0x33'),_0x2d6dca['name']);return db[_0x269e('0x23')][_0x269e('0x4c')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2d6dca['id']}}});}})[_0x269e('0x10')](function(_0x3739ee){if(_0x3739ee){_0x452dff=_0x3739ee;return require(_0x269e('0x4d'))[_0x269e('0x4e')]();}})['then'](function(_0x59c24f){if(_0x59c24f&&_0x59c24f[_0x269e('0x4f')]&&_0x452dff>=_0x59c24f[_0x269e('0x4f')]){throw new Error(_0x269e('0x50'));}})[_0x269e('0x10')](function(){if(_0x2d6dca){return db['UserVoiceQueueRt'][_0x269e('0x49')]({'where':{'membername':_0x2d6dca[_0x269e('0x34')]},'individualHooks':!![]});}})[_0x269e('0x10')](function(){if(_0x2d6dca){return _0x2d6dca[_0x269e('0x51')]({'raw':!![]});}})[_0x269e('0x10')](function(_0x2051b8){if(_0x2d6dca){if(_0x2051b8){var _0x4379a8=[];_0x276fe5=_0x2051b8;if(_0x276fe5[_0x269e('0x2c')]){for(var _0x45f3ae=0x0;_0x45f3ae<_0x276fe5[_0x269e('0x2c')];_0x45f3ae++){_0x4379a8[_0x269e('0x30')](db[_0x269e('0x28')][_0x269e('0x52')]({'membername':_0x2d6dca[_0x269e('0x34')],'UserId':_0x2d6dca['id'],'queue_name':_0x276fe5[_0x45f3ae][_0x269e('0x34')],'VoiceQueueId':_0x276fe5[_0x45f3ae]['id'],'interface':_0x37ce4e,'paused':_0x2d6dca[_0x269e('0x4b')]||![],'penalty':_0x276fe5[_0x45f3ae][_0x269e('0x53')]||0x0}));}return BPromise[_0x269e('0x47')](_0x4379a8);}}}})[_0x269e('0x10')](function(){if(_0x2d6dca){return db[_0x269e('0x2a')][_0x269e('0x1a')]({'where':{'membername':_0x2d6dca['name'],'exitAt':null}});}})[_0x269e('0x10')](function(_0x552d2c){if(_0x2d6dca){if(_0x552d2c&&_0x552d2c['length']){var _0x2db983=[];_0x552d2c[_0x269e('0x2f')](function(_0x44456f){_0x2db983['push'](_0x44456f['update']({'exitAt':moment()['format'](_0x269e('0x35'))}));});return BPromise[_0x269e('0x47')](_0x2db983);}}})[_0x269e('0x10')](function(_0x401512){if(_0x2d6dca){var _0x50c7f3=[];var _0x35e557=[];var _0xcc0282=utils['getChannels']();var _0x54a759={'membername':_0x2d6dca[_0x269e('0x34')],'interface':_0x37ce4e,'enterAt':moment()['format'](_0x269e('0x35')),'role':_0x2d6dca[_0x269e('0x27')],'internal':_0x2d6dca['internal']};_0xcc0282[_0x269e('0x2f')](function(_0x4f9f97){_0x50c7f3['push'](_['merge']({'channel':_0x4f9f97,'type':_0x269e('0x54'),'data1':_0x269e('0x55'),'data2':_0x37ce4e},_0x54a759));if(_0x2d6dca[_0x269e('0x4b')]){_0x35e557[_0x269e('0x30')](_['merge']({'channel':_0x4f9f97,'type':'PAUSE','data1':_0x269e('0x56')},_0x54a759));}});return db['MemberReport'][_0x269e('0x3b')](_0x50c7f3[_0x269e('0x57')](_0x35e557),{'individualHooks':!![]});}})[_0x269e('0x10')](function(){if(_0x2d6dca){return _0x2d6dca[_0x269e('0x29')]({'online':!![],'lastLoginAt':moment()[_0x269e('0x2d')](_0x269e('0x35')),'voicePause':_0x2d6dca[_0x269e('0x4b')]||![],'mailPause':_0x2d6dca[_0x269e('0x4b')]||![],'chatPause':_0x2d6dca[_0x269e('0x4b')]||![],'faxPause':_0x2d6dca[_0x269e('0x4b')]||![],'smsPause':_0x2d6dca[_0x269e('0x4b')]||![],'openchannelPause':_0x2d6dca[_0x269e('0x4b')]||![],'pauseType':_0x2d6dca[_0x269e('0x4b')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x269e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x37ce4e});}})[_0x269e('0x10')](function(_0x415db2){_0x595ee7(_0x415db2);})[_0x269e('0x18')](function(_0x1116c2){_0x49bcd0(_0x16b38b['error'](0x1f4,_0x1116c2[_0x269e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a628dda..03de9d2 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 _0x8075=['remove','register','length','user:','./user.events','save'];(function(_0x14f427,_0x140e33){var _0x3735e4=function(_0x3f780f){while(--_0x3f780f){_0x14f427['push'](_0x14f427['shift']());}};_0x3735e4(++_0x140e33);}(_0x8075,0x1d8));var _0x5807=function(_0x482f97,_0x19e6a8){_0x482f97=_0x482f97-0x0;var _0x4dfd64=_0x8075[_0x482f97];return _0x4dfd64;};'use strict';var UserEvents=require(_0x5807('0x0'));var events=[_0x5807('0x1'),_0x5807('0x2'),'update'];function createListener(_0x592a78,_0x1ecf84){return function(_0x513652){_0x1ecf84['emit'](_0x592a78,_0x513652);};}function removeListener(_0x2b7342,_0x1c5b38){return function(){UserEvents['removeListener'](_0x2b7342,_0x1c5b38);};}exports[_0x5807('0x3')]=function(_0xb82198){for(var _0x5e9767=0x0,_0x277b00=events[_0x5807('0x4')];_0x5e9767<_0x277b00;_0x5e9767++){var _0x2234a5=events[_0x5e9767];var _0x3db53c=createListener(_0x5807('0x5')+_0x2234a5,_0xb82198);UserEvents['on'](_0x2234a5,_0x3db53c);}}; \ No newline at end of file +var _0xe6ec=['save','emit','removeListener','register','length','user:'];(function(_0x43887b,_0xbd2fde){var _0x489b76=function(_0x1b21e6){while(--_0x1b21e6){_0x43887b['push'](_0x43887b['shift']());}};_0x489b76(++_0xbd2fde);}(_0xe6ec,0x15c));var _0xce6e=function(_0x359473,_0x4682bb){_0x359473=_0x359473-0x0;var _0x3aa1fa=_0xe6ec[_0x359473];return _0x3aa1fa;};'use strict';var UserEvents=require('./user.events');var events=[_0xce6e('0x0'),'remove','update'];function createListener(_0x323e5e,_0x423de9){return function(_0x11721c){_0x423de9[_0xce6e('0x1')](_0x323e5e,_0x11721c);};}function removeListener(_0x4f3f2a,_0x21af49){return function(){UserEvents[_0xce6e('0x2')](_0x4f3f2a,_0x21af49);};}exports[_0xce6e('0x3')]=function(_0xfd3501){for(var _0x43714e=0x0,_0x3e1fd1=events[_0xce6e('0x4')];_0x43714e<_0x3e1fd1;_0x43714e++){var _0x3690ea=events[_0x43714e];var _0x39cd62=createListener(_0xce6e('0x5')+_0x3690ea,_0xfd3501);UserEvents['on'](_0x3690ea,_0x39cd62);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 3dd983e..697b9cc 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x478863,_0xc290f5){var _0xb38d5b=function(_0x4d9ea7){while(--_0x4d9ea7){_0x478863['push'](_0x478863['shift']());}};_0xb38d5b(++_0xc290f5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3768ae,_0x49255a){var _0x20f818=function(_0x114690){while(--_0x114690){_0x3768ae['push'](_0x3768ae['shift']());}};_0x20f818(++_0x49255a);}(_0x70e0,0x17b));var _0x070e=function(_0x2a2d6b,_0x5b0b9f){_0x2a2d6b=_0x2a2d6b-0x0;var _0x2771ac=_0x70e0[_0x2a2d6b];return _0x2771ac;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 7037df1..928ae8b 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 _0xc99b=['sequelize','INTEGER'];(function(_0x362e4f,_0x4ff795){var _0x72fd6f=function(_0x5a3993){while(--_0x5a3993){_0x362e4f['push'](_0x362e4f['shift']());}};_0x72fd6f(++_0x4ff795);}(_0xc99b,0x192));var _0xbc99=function(_0x1113dc,_0x188e4b){_0x1113dc=_0x1113dc-0x0;var _0x1ebf6e=_0xc99b[_0x1113dc];return _0x1ebf6e;};'use strict';var Sequelize=require(_0xbc99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbc99('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x00e1=['INTEGER','exports'];(function(_0x4df4d5,_0x8c698f){var _0x4f6c2a=function(_0x39a456){while(--_0x39a456){_0x4df4d5['push'](_0x4df4d5['shift']());}};_0x4f6c2a(++_0x8c698f);}(_0x00e1,0x151));var _0x100e=function(_0x48d845,_0x5b5eb2){_0x48d845=_0x48d845-0x0;var _0x4cc640=_0x00e1[_0x48d845];return _0x4cc640;};'use strict';var Sequelize=require('sequelize');module[_0x100e('0x0')]={'penalty':{'type':Sequelize[_0x100e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 83cea76..c3dd301 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 _0x4414=['UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x58572d,_0xea7663){var _0x4378e2=function(_0xa70e7f){while(--_0xa70e7f){_0x58572d['push'](_0x58572d['shift']());}};_0x4378e2(++_0xea7663);}(_0x4414,0x1b5));var _0x4441=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x4414[_0x333798];return _0x389f4e;};'use strict';var _=require(_0x4441('0x0'));var util=require(_0x4441('0x1'));var logger=require(_0x4441('0x2'))(_0x4441('0x3'));var moment=require(_0x4441('0x4'));var BPromise=require(_0x4441('0x5'));var rp=require(_0x4441('0x6'));var fs=require('fs');var path=require(_0x4441('0x7'));var rimraf=require(_0x4441('0x8'));var config=require(_0x4441('0x9'));var attributes=require(_0x4441('0xa'));module[_0x4441('0xb')]=function(_0x139f70,_0x5a348a){return _0x139f70[_0x4441('0xc')](_0x4441('0xd'),attributes,{'tableName':_0x4441('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9d8=['bluebird','request-promise','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa9d8,0x151));var _0x8a9d=function(_0x499e56,_0xfa7df9){_0x499e56=_0x499e56-0x0;var _0x45861d=_0xa9d8[_0x499e56];return _0x45861d;};'use strict';var _=require(_0x8a9d('0x0'));var util=require('util');var logger=require(_0x8a9d('0x1'))(_0x8a9d('0x2'));var moment=require('moment');var BPromise=require(_0x8a9d('0x3'));var rp=require(_0x8a9d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a9d('0x5'));module[_0x8a9d('0x6')]=function(_0x5c01fe,_0x2dee68){return _0x5c01fe[_0x8a9d('0x7')](_0x8a9d('0x8'),attributes,{'tableName':_0x8a9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 452f26e..a77a3e9 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 _0xebc4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','request\x20sent','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x130e71,_0x1a2b93){var _0x3683f9=function(_0x16dc3c){while(--_0x16dc3c){_0x130e71['push'](_0x130e71['shift']());}};_0x3683f9(++_0x1a2b93);}(_0xebc4,0xfa));var _0x4ebc=function(_0x2c0dbd,_0x2bacba){_0x2c0dbd=_0x2c0dbd-0x0;var _0x928c14=_0xebc4[_0x2c0dbd];return _0x928c14;};'use strict';var _=require(_0x4ebc('0x0'));var util=require(_0x4ebc('0x1'));var moment=require(_0x4ebc('0x2'));var BPromise=require(_0x4ebc('0x3'));var rs=require(_0x4ebc('0x4'));var fs=require('fs');var Redis=require(_0x4ebc('0x5'));var db=require(_0x4ebc('0x6'))['db'];var utils=require(_0x4ebc('0x7'));var logger=require(_0x4ebc('0x8'))(_0x4ebc('0x9'));var config=require(_0x4ebc('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4ebc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13d805,_0x4d93d0,_0x33eb14){return new BPromise(function(_0x4fc7ad,_0x5eb982){return client[_0x4ebc('0xc')](_0x13d805,_0x33eb14)['then'](function(_0xca6cbd){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4d93d0,_0x4ebc('0xd'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4d93d0,_0x4ebc('0xd'),JSON['stringify'](_0xca6cbd));if(_0xca6cbd['error']){if(_0xca6cbd[_0x4ebc('0xe')][_0x4ebc('0xf')]===0x1f4){logger[_0x4ebc('0xe')](_0x4ebc('0x10'),_0x4d93d0,_0xca6cbd[_0x4ebc('0xe')][_0x4ebc('0x11')]);return _0x5eb982(_0xca6cbd[_0x4ebc('0xe')][_0x4ebc('0x11')]);}logger[_0x4ebc('0xe')](_0x4ebc('0x10'),_0x4d93d0,_0xca6cbd[_0x4ebc('0xe')][_0x4ebc('0x11')]);return _0x4fc7ad(_0xca6cbd['error']['message']);}else{logger[_0x4ebc('0x12')](_0x4ebc('0x10'),_0x4d93d0,_0x4ebc('0xd'));_0x4fc7ad(_0xca6cbd[_0x4ebc('0x13')][_0x4ebc('0x11')]);}})[_0x4ebc('0x14')](function(_0x55c1f3){logger[_0x4ebc('0xe')](_0x4ebc('0x10'),_0x4d93d0,_0x55c1f3);_0x5eb982(_0x55c1f3);});});} \ No newline at end of file +var _0xa45c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa45c,0xda));var _0xca45=function(_0x10679e,_0x1e05f6){_0x10679e=_0x10679e-0x0;var _0x5da915=_0xa45c[_0x10679e];return _0x5da915;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var moment=require(_0xca45('0x2'));var BPromise=require(_0xca45('0x3'));var rs=require(_0xca45('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca45('0x5'))['db'];var utils=require(_0xca45('0x6'));var logger=require(_0xca45('0x7'))(_0xca45('0x8'));var config=require(_0xca45('0x9'));var jayson=require(_0xca45('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca0ca,_0x539857,_0x429fff){return new BPromise(function(_0x18e2fe,_0x2009d4){return client[_0xca45('0xb')](_0x3ca0ca,_0x429fff)[_0xca45('0xc')](function(_0x37e3a9){logger[_0xca45('0xd')](_0xca45('0xe'),_0x539857,_0xca45('0xf'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x539857,_0xca45('0xf'),JSON[_0xca45('0x10')](_0x37e3a9));if(_0x37e3a9['error']){if(_0x37e3a9[_0xca45('0x11')][_0xca45('0x12')]===0x1f4){logger['error'](_0xca45('0xe'),_0x539857,_0x37e3a9[_0xca45('0x11')]['message']);return _0x2009d4(_0x37e3a9[_0xca45('0x11')][_0xca45('0x13')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x539857,_0x37e3a9['error'][_0xca45('0x13')]);return _0x18e2fe(_0x37e3a9[_0xca45('0x11')][_0xca45('0x13')]);}else{logger[_0xca45('0xd')](_0xca45('0xe'),_0x539857,_0xca45('0xf'));_0x18e2fe(_0x37e3a9[_0xca45('0x14')][_0xca45('0x13')]);}})[_0xca45('0x15')](function(_0x3f677c){logger[_0xca45('0x11')](_0xca45('0xe'),_0x539857,_0x3f677c);_0x2009d4(_0x3f677c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9b0f904..a85c87d 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3ccf14,_0x393360){var _0xb9145b=function(_0x3b396b){while(--_0x3b396b){_0x3ccf14['push'](_0x3ccf14['shift']());}};_0xb9145b(++_0x393360);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2313a8,_0x10c4ca){var _0x1a7712=function(_0xa8c9cf){while(--_0xa8c9cf){_0x2313a8['push'](_0x2313a8['shift']());}};_0x1a7712(++_0x10c4ca);}(_0x70e0,0x17b));var _0x070e=function(_0xc7b8bc,_0x12a679){_0xc7b8bc=_0xc7b8bc-0x0;var _0x20f901=_0x70e0[_0xc7b8bc];return _0x20f901;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 81a7581..69cc3c5 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 _0x5612=['sequelize','INTEGER'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0x5612,0x170));var _0x2561=function(_0x1646a2,_0x18e6de){_0x1646a2=_0x1646a2-0x0;var _0x2ee4b9=_0x5612[_0x1646a2];return _0x2ee4b9;};'use strict';var Sequelize=require(_0x2561('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2561('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2561('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0548=['INTEGER','sequelize'];(function(_0x2764c6,_0x30f22e){var _0x2984ab=function(_0x4c2459){while(--_0x4c2459){_0x2764c6['push'](_0x2764c6['shift']());}};_0x2984ab(++_0x30f22e);}(_0x0548,0x1e1));var _0x8054=function(_0x430a5c,_0x127b8e){_0x430a5c=_0x430a5c-0x0;var _0xcf237=_0x0548[_0x430a5c];return _0xcf237;};'use strict';var Sequelize=require(_0x8054('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8054('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8054('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 401e328..8d47206 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 _0x99b9=['util','../../config/logger','api','moment','bluebird','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0x99b9,0x10e));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x999b('0x0'));var logger=require(_0x999b('0x1'))(_0x999b('0x2'));var moment=require(_0x999b('0x3'));var BPromise=require(_0x999b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x999b('0x5'));var config=require('../../config/environment');var attributes=require(_0x999b('0x6'));module[_0x999b('0x7')]=function(_0x48365d,_0x2b2830){return _0x48365d[_0x999b('0x8')](_0x999b('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2a5=['request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','user_has_fax_queues','util','../../config/logger','api','bluebird'];(function(_0x4d6c7c,_0x333413){var _0x2b23bc=function(_0x36da5c){while(--_0x36da5c){_0x4d6c7c['push'](_0x4d6c7c['shift']());}};_0x2b23bc(++_0x333413);}(_0xb2a5,0xcd));var _0x5b2a=function(_0x283624,_0x219876){_0x283624=_0x283624-0x0;var _0x32bbc5=_0xb2a5[_0x283624];return _0x32bbc5;};'use strict';var _=require('lodash');var util=require(_0x5b2a('0x0'));var logger=require(_0x5b2a('0x1'))(_0x5b2a('0x2'));var moment=require('moment');var BPromise=require(_0x5b2a('0x3'));var rp=require(_0x5b2a('0x4'));var fs=require('fs');var path=require(_0x5b2a('0x5'));var rimraf=require(_0x5b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b2a('0x7'));module[_0x5b2a('0x8')]=function(_0x4f106d,_0x3f8682){return _0x4f106d[_0x5b2a('0x9')]('UserFaxQueue',attributes,{'tableName':_0x5b2a('0xa'),'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 e200a0e..48768e9 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 _0xf299=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5721c4,_0x2ffbd4){var _0x597a5f=function(_0x2387a5){while(--_0x2387a5){_0x5721c4['push'](_0x5721c4['shift']());}};_0x597a5f(++_0x2ffbd4);}(_0xf299,0x19b));var _0x9f29=function(_0x29ad41,_0x155d8d){_0x29ad41=_0x29ad41-0x0;var _0x2f1a90=_0xf299[_0x29ad41];return _0x2f1a90;};'use strict';var _=require(_0x9f29('0x0'));var util=require(_0x9f29('0x1'));var moment=require('moment');var BPromise=require(_0x9f29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f29('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f29('0x4'))(_0x9f29('0x5'));var config=require('../../config/environment');var jayson=require(_0x9f29('0x6'));var client=jayson[_0x9f29('0x7')][_0x9f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x221cc6,_0x5c2f77,_0x3838fa){return new BPromise(function(_0x37e320,_0xb63cc0){return client[_0x9f29('0x9')](_0x221cc6,_0x3838fa)[_0x9f29('0xa')](function(_0x3232b6){logger[_0x9f29('0xb')](_0x9f29('0xc'),_0x5c2f77,_0x9f29('0xd'));logger[_0x9f29('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5c2f77,_0x9f29('0xd'),JSON[_0x9f29('0xf')](_0x3232b6));if(_0x3232b6[_0x9f29('0x10')]){if(_0x3232b6[_0x9f29('0x10')][_0x9f29('0x11')]===0x1f4){logger[_0x9f29('0x10')](_0x9f29('0xc'),_0x5c2f77,_0x3232b6['error'][_0x9f29('0x12')]);return _0xb63cc0(_0x3232b6[_0x9f29('0x10')]['message']);}logger[_0x9f29('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x5c2f77,_0x3232b6['error'][_0x9f29('0x12')]);return _0x37e320(_0x3232b6['error'][_0x9f29('0x12')]);}else{logger[_0x9f29('0xb')](_0x9f29('0xc'),_0x5c2f77,_0x9f29('0xd'));_0x37e320(_0x3232b6['result'][_0x9f29('0x12')]);}})[_0x9f29('0x13')](function(_0x3afc60){logger[_0x9f29('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x5c2f77,_0x3afc60);_0xb63cc0(_0x3afc60);});});} \ No newline at end of file +var _0x8529=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x10050d,_0x31ccb3){var _0x175b81=function(_0x5f3099){while(--_0x5f3099){_0x10050d['push'](_0x10050d['shift']());}};_0x175b81(++_0x31ccb3);}(_0x8529,0x171));var _0x9852=function(_0x5ac614,_0x11e79b){_0x5ac614=_0x5ac614-0x0;var _0x1b2195=_0x8529[_0x5ac614];return _0x1b2195;};'use strict';var _=require(_0x9852('0x0'));var util=require(_0x9852('0x1'));var moment=require(_0x9852('0x2'));var BPromise=require(_0x9852('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9852('0x4'))['db'];var utils=require(_0x9852('0x5'));var logger=require(_0x9852('0x6'))(_0x9852('0x7'));var config=require(_0x9852('0x8'));var jayson=require(_0x9852('0x9'));var client=jayson[_0x9852('0xa')][_0x9852('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25672a,_0xdb201f,_0x2708b0){return new BPromise(function(_0x2f5310,_0x1fafe1){return client[_0x9852('0xc')](_0x25672a,_0x2708b0)[_0x9852('0xd')](function(_0x472d87){logger[_0x9852('0xe')](_0x9852('0xf'),_0xdb201f,'request\x20sent');logger[_0x9852('0x10')](_0x9852('0x11'),_0xdb201f,'request\x20sent',JSON[_0x9852('0x12')](_0x472d87));if(_0x472d87[_0x9852('0x13')]){if(_0x472d87['error'][_0x9852('0x14')]===0x1f4){logger[_0x9852('0x13')](_0x9852('0xf'),_0xdb201f,_0x472d87[_0x9852('0x13')]['message']);return _0x1fafe1(_0x472d87[_0x9852('0x13')][_0x9852('0x15')]);}logger[_0x9852('0x13')](_0x9852('0xf'),_0xdb201f,_0x472d87[_0x9852('0x13')][_0x9852('0x15')]);return _0x2f5310(_0x472d87[_0x9852('0x13')]['message']);}else{logger[_0x9852('0xe')](_0x9852('0xf'),_0xdb201f,_0x9852('0x16'));_0x2f5310(_0x472d87[_0x9852('0x17')][_0x9852('0x15')]);}})[_0x9852('0x18')](function(_0x4bebee){logger[_0x9852('0x13')](_0x9852('0xf'),_0xdb201f,_0x4bebee);_0x1fafe1(_0x4bebee);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 54fe2ca..c948cec 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x24163e,_0x3e4951){var _0x41cf75=function(_0x1ebb25){while(--_0x1ebb25){_0x24163e['push'](_0x24163e['shift']());}};_0x41cf75(++_0x3e4951);}(_0xedd9,0xfc));var _0x9edd=function(_0x41f3c8,_0x5976b4){_0x41f3c8=_0x41f3c8-0x0;var _0x58d4f7=_0xedd9[_0x41f3c8];return _0x58d4f7;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 5e84d94..ad60888 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 _0xc997=['exports','INTEGER','sequelize'];(function(_0x431604,_0x5367a4){var _0x246cae=function(_0x275127){while(--_0x275127){_0x431604['push'](_0x431604['shift']());}};_0x246cae(++_0x5367a4);}(_0xc997,0x131));var _0x7c99=function(_0x218ecf,_0x26a3b1){_0x218ecf=_0x218ecf-0x0;var _0x2dd564=_0xc997[_0x218ecf];return _0x2dd564;};'use strict';var Sequelize=require(_0x7c99('0x0'));module[_0x7c99('0x1')]={'penalty':{'type':Sequelize[_0x7c99('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdfc3=['INTEGER','sequelize','exports'];(function(_0x3c47f8,_0xe872c9){var _0x4b0ebc=function(_0x38fe20){while(--_0x38fe20){_0x3c47f8['push'](_0x3c47f8['shift']());}};_0x4b0ebc(++_0xe872c9);}(_0xdfc3,0x1de));var _0x3dfc=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xdfc3[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require(_0x3dfc('0x0'));module[_0x3dfc('0x1')]={'penalty':{'type':Sequelize[_0x3dfc('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 853b389..57a54cd 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 _0xa56a=['../../config/logger','api','moment','request-promise','path','./userMailQueue.attributes','exports','define','util'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0xa56a,0x1ca));var _0xaa56=function(_0x49cee6,_0x3f67da){_0x49cee6=_0x49cee6-0x0;var _0x42306c=_0xa56a[_0x49cee6];return _0x42306c;};'use strict';var _=require('lodash');var util=require(_0xaa56('0x0'));var logger=require(_0xaa56('0x1'))(_0xaa56('0x2'));var moment=require(_0xaa56('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa56('0x4'));var fs=require('fs');var path=require(_0xaa56('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa56('0x6'));module[_0xaa56('0x7')]=function(_0x8ecef1,_0x55d959){return _0x8ecef1[_0xaa56('0x8')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x472e=['request-promise','path','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x2ca896,_0x1d4f0e){var _0xc3dcd8=function(_0x3225b7){while(--_0x3225b7){_0x2ca896['push'](_0x2ca896['shift']());}};_0xc3dcd8(++_0x1d4f0e);}(_0x472e,0xc7));var _0xe472=function(_0x505df9,_0x14138e){_0x505df9=_0x505df9-0x0;var _0x1cc025=_0x472e[_0x505df9];return _0x1cc025;};'use strict';var _=require(_0xe472('0x0'));var util=require(_0xe472('0x1'));var logger=require(_0xe472('0x2'))(_0xe472('0x3'));var moment=require('moment');var BPromise=require(_0xe472('0x4'));var rp=require(_0xe472('0x5'));var fs=require('fs');var path=require(_0xe472('0x6'));var rimraf=require(_0xe472('0x7'));var config=require('../../config/environment');var attributes=require(_0xe472('0x8'));module[_0xe472('0x9')]=function(_0x1a6e46,_0x551dee){return _0x1a6e46['define'](_0xe472('0xa'),attributes,{'tableName':_0xe472('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 35c2696..b5837e7 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4e22ce,_0x19f588){var _0x5475b2=function(_0x3a7984){while(--_0x3a7984){_0x4e22ce['push'](_0x4e22ce['shift']());}};_0x5475b2(++_0x19f588);}(_0x34e8,0x12c));var _0x834e=function(_0x52cb5c,_0x2ce83f){_0x52cb5c=_0x52cb5c-0x0;var _0x195ba0=_0x34e8[_0x52cb5c];return _0x195ba0;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5d7f40,_0x511153){var _0xbdb273=function(_0x2da374){while(--_0x2da374){_0x5d7f40['push'](_0x5d7f40['shift']());}};_0xbdb273(++_0x511153);}(_0xe14b,0x93));var _0xbe14=function(_0x5e705d,_0x3c07b9){_0x5e705d=_0x5e705d-0x0;var _0x37850c=_0xe14b[_0x5e705d];return _0x37850c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 8256f65..932bd07 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd730=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd730,0x18c));var _0x0d73=function(_0x1c053f,_0x2414dd){_0x1c053f=_0x1c053f-0x0;var _0x3d175a=_0xd730[_0x1c053f];return _0x3d175a;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require(_0x0d73('0x2'));var router=express['Router']();var fs_extra=require(_0x0d73('0x3'));var auth=require(_0x0d73('0x4'));var interaction=require(_0x0d73('0x5'));var config=require(_0x0d73('0x6'));var controller=require(_0x0d73('0x7'));router[_0x0d73('0x8')]('/',auth[_0x0d73('0x9')](),controller[_0x0d73('0xa')]);module[_0x0d73('0xb')]=router; \ No newline at end of file +var _0x8c21=['sendUserNotification','path','express','../../components/interaction/service','../../config/environment','post','isAuthenticated'];(function(_0xa29b5d,_0x1c7d9d){var _0x57632d=function(_0x3745cd){while(--_0x3745cd){_0xa29b5d['push'](_0xa29b5d['shift']());}};_0x57632d(++_0x1c7d9d);}(_0x8c21,0x13c));var _0x18c2=function(_0x4f4a6c,_0x4d3bda){_0x4f4a6c=_0x4f4a6c-0x0;var _0x5523eb=_0x8c21[_0x4f4a6c];return _0x5523eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x18c2('0x0'));var timeout=require('connect-timeout');var express=require(_0x18c2('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18c2('0x2'));var config=require(_0x18c2('0x3'));var controller=require('./userNotification.controller');router[_0x18c2('0x4')]('/',auth[_0x18c2('0x5')](),controller[_0x18c2('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2a8ab33..e717cef 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c85=['exports','TEXT','STRING','BOOLEAN'];(function(_0x50f9a4,_0x4f304f){var _0x4e2a84=function(_0x2ded5d){while(--_0x2ded5d){_0x50f9a4['push'](_0x50f9a4['shift']());}};_0x4e2a84(++_0x4f304f);}(_0x7c85,0xf8));var _0x57c8=function(_0x4eaa9c,_0x3a879a){_0x4eaa9c=_0x4eaa9c-0x0;var _0x46b796=_0x7c85[_0x4eaa9c];return _0x46b796;};'use strict';var Sequelize=require('sequelize');module[_0x57c8('0x0')]={'body':{'type':Sequelize[_0x57c8('0x1')]},'senderName':{'type':Sequelize[_0x57c8('0x2')]},'recipientsId':{'type':Sequelize[_0x57c8('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x57c8('0x3')]}}; \ No newline at end of file +var _0xadcb=['sequelize','TEXT','STRING'];(function(_0x104b26,_0x1cc8e9){var _0x437196=function(_0xf60bbe){while(--_0xf60bbe){_0x104b26['push'](_0x104b26['shift']());}};_0x437196(++_0x1cc8e9);}(_0xadcb,0x19e));var _0xbadc=function(_0x54a347,_0xe4db51){_0x54a347=_0x54a347-0x0;var _0x10c9c0=_0xadcb[_0x54a347];return _0x10c9c0;};'use strict';var Sequelize=require(_0xbadc('0x0'));module['exports']={'body':{'type':Sequelize[_0xbadc('0x1')]},'senderName':{'type':Sequelize[_0xbadc('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xbadc('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index b5d6a59..ddef469 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51bf=['queue','Queue','push','all','flatten','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','voicequeue','user','some','includes','model','senderName','fullname','recipientsDescription','beep','recipientsId','sortBy','join','UserNotification','create','recipient','emit','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','forEach','startCase','User','union','ids'];(function(_0x15d76d,_0x205522){var _0x43f829=function(_0x2571b2){while(--_0x2571b2){_0x15d76d['push'](_0x15d76d['shift']());}};_0x43f829(++_0x205522);}(_0x51bf,0x66));var _0xf51b=function(_0x1123d3,_0x37e5ba){_0x1123d3=_0x1123d3-0x0;var _0x455cc8=_0x51bf[_0x1123d3];return _0x455cc8;};'use strict';var emlformat=require(_0xf51b('0x0'));var rimraf=require(_0xf51b('0x1'));var zipdir=require(_0xf51b('0x2'));var jsonpatch=require(_0xf51b('0x3'));var rp=require(_0xf51b('0x4'));var moment=require(_0xf51b('0x5'));var BPromise=require(_0xf51b('0x6'));var Mustache=require(_0xf51b('0x7'));var util=require('util');var path=require(_0xf51b('0x8'));var sox=require(_0xf51b('0x9'));var csv=require('to-csv');var ejs=require(_0xf51b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf51b('0xb'));var squel=require('squel');var crypto=require(_0xf51b('0xc'));var jsforce=require(_0xf51b('0xd'));var deskjs=require(_0xf51b('0xe'));var toCsv=require(_0xf51b('0xf'));var querystring=require(_0xf51b('0x10'));var Papa=require('papaparse');var Redis=require(_0xf51b('0x11'));var authService=require(_0xf51b('0x12'));var qs=require(_0xf51b('0x13'));var as=require(_0xf51b('0x14'));var hardwareService=require(_0xf51b('0x15'));var logger=require(_0xf51b('0x16'))(_0xf51b('0x17'));var utils=require('../../config/utils');var config=require(_0xf51b('0x18'));var licenseUtil=require(_0xf51b('0x19'));var db=require(_0xf51b('0x1a'))['db'];config[_0xf51b('0x1b')]=_[_0xf51b('0x1c')](config[_0xf51b('0x1b')],{'host':_0xf51b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf51b('0x1b')]));require(_0xf51b('0x1e'))[_0xf51b('0x1f')](socket);function respondWithStatusCode(_0x30aaab,_0x20605b){_0x20605b=_0x20605b||0xcc;return function(_0x42896a){if(_0x42896a){return _0x30aaab[_0xf51b('0x20')](_0x20605b);}return _0x30aaab[_0xf51b('0x21')](_0x20605b)[_0xf51b('0x22')]();};}function respondWithResult(_0x5675ec,_0x1abe22){_0x1abe22=_0x1abe22||0xc8;return function(_0x1fd20f){if(_0x1fd20f){return _0x5675ec[_0xf51b('0x21')](_0x1abe22)[_0xf51b('0x23')](_0x1fd20f);}};}function respondWithFilteredResult(_0x5cf425,_0xa52d93){return function(_0x247fe5){if(_0x247fe5){var _0x106923=typeof _0xa52d93[_0xf51b('0x24')]==='undefined'&&typeof _0xa52d93[_0xf51b('0x25')]===_0xf51b('0x26');var _0x5e6e72=_0x247fe5[_0xf51b('0x27')];var _0x16aaf7=_0x106923?0x0:_0xa52d93[_0xf51b('0x24')];var _0x52776d=_0x106923?_0x247fe5['count']:_0xa52d93[_0xf51b('0x24')]+_0xa52d93['limit'];var _0x4a733e;if(_0x52776d>=_0x5e6e72){_0x52776d=_0x5e6e72;_0x4a733e=0xc8;}else{_0x4a733e=0xce;}_0x5cf425['status'](_0x4a733e);return _0x5cf425[_0xf51b('0x28')](_0xf51b('0x29'),_0x16aaf7+'-'+_0x52776d+'/'+_0x5e6e72)['json'](_0x247fe5);}return null;};}function patchUpdates(_0x16fc48){return function(_0xba66a){try{jsonpatch[_0xf51b('0x2a')](_0xba66a,_0x16fc48,!![]);}catch(_0x3e134f){return BPromise['reject'](_0x3e134f);}return _0xba66a[_0xf51b('0x2b')]();};}function saveUpdates(_0x1bd887,_0x550ef9){return function(_0x421a80){if(_0x421a80){return _0x421a80[_0xf51b('0x2c')](_0x1bd887)[_0xf51b('0x2d')](function(_0x576e3e){return _0x576e3e;});}return null;};}function removeEntity(_0x59de2b,_0x3702b4){return function(_0xec0226){if(_0xec0226){return _0xec0226[_0xf51b('0x2e')]()[_0xf51b('0x2d')](function(){_0x59de2b['status'](0xcc)[_0xf51b('0x22')]();});}};}function handleEntityNotFound(_0x28d4e4,_0x33b9c9){return function(_0x4cb960){if(!_0x4cb960){_0x28d4e4[_0xf51b('0x20')](0x194);}return _0x4cb960;};}function handleError(_0x538ccd,_0x1b4f4f){_0x1b4f4f=_0x1b4f4f||0x1f4;return function(_0x44a6a3){logger[_0xf51b('0x2f')](_0x44a6a3[_0xf51b('0x30')]);if(_0x44a6a3[_0xf51b('0x31')]){delete _0x44a6a3[_0xf51b('0x31')];}_0x538ccd[_0xf51b('0x21')](_0x1b4f4f)['send'](_0x44a6a3);};}exports[_0xf51b('0x32')]=function(_0x3737fd,_0x1cfcde,_0xb3fcee){if(!_0x3737fd[_0xf51b('0x33')][_0xf51b('0x34')](_0xf51b('0x35'))&&!_0x3737fd['body'][_0xf51b('0x34')](_0xf51b('0x36'))){throw new db['Sequelize'][(_0xf51b('0x37'))](_0xf51b('0x38'));}else{if(_0x3737fd[_0xf51b('0x33')][_0xf51b('0x34')](_0xf51b('0x36'))&&!_0x3737fd[_0xf51b('0x33')][_0xf51b('0x34')](_0xf51b('0x39'))){throw new db[(_0xf51b('0x3a'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x3737fd[_0xf51b('0x33')][_0xf51b('0x34')](_0xf51b('0x3b'))){throw new db['Sequelize']['ValidationError'](_0xf51b('0x3c'));}else{try{var _0x2799b0=JSON[_0xf51b('0x3d')](_0x3737fd['body'][_0xf51b('0x3b')]);}catch(_0x51e744){logger['error'](_0x51e744);throw new db[(_0xf51b('0x3a'))]['ValidationError'](_0xf51b('0x3e'));}var _0x1ab3a7=[_0xf51b('0x3f'),_0xf51b('0x40'),'mailqueue',_0xf51b('0x41'),'smsqueue',_0xf51b('0x42'),'whatsappqueue','team',_0xf51b('0x43')];if(_[_0xf51b('0x44')](_0x2799b0,function(_0x3ef3ff){return!_[_0xf51b('0x45')](_0x1ab3a7,_0x3ef3ff[_0xf51b('0x46')]['toLowerCase']());})){throw new db[(_0xf51b('0x3a'))][(_0xf51b('0x37'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x446152={};_0x446152[_0xf51b('0x47')]=_0x3737fd[_0xf51b('0x33')]['hasOwnProperty'](_0xf51b('0x47'))?_0x3737fd[_0xf51b('0x33')][_0xf51b('0x47')]:_0x3737fd[_0xf51b('0x43')][_0xf51b('0x48')];_0x446152['recipientsDescription']=_['isEmpty'](_0x3737fd[_0xf51b('0x33')][_0xf51b('0x49')])?null:_0x3737fd[_0xf51b('0x33')][_0xf51b('0x49')];_0x446152[_0xf51b('0x4a')]=_0x3737fd[_0xf51b('0x33')][_0xf51b('0x4a')]||![];_0x446152['SenderId']=_0x3737fd[_0xf51b('0x43')]['id'];return getContent(_0x3737fd[_0xf51b('0x33')])['then'](function(_0x7ac976){_0x446152[_0xf51b('0x33')]=_0x7ac976;return getRecipients(_0x2799b0);})[_0xf51b('0x2d')](function(_0x2cb1fc){_0x446152[_0xf51b('0x4b')]=_[_0xf51b('0x4c')](_0x2cb1fc)[_0xf51b('0x4d')](',');return db['sequelize']['transaction'](function(_0x198310){return db[_0xf51b('0x4e')][_0xf51b('0x4f')](_0x446152,{'raw':!![],'transaction':_0x198310})['then'](function(_0x87631f){var _0x376b0b={'sender':_0x446152[_0xf51b('0x47')],'description':_0x446152['recipientsDescription'],'content':_0x446152['body'],'beep':_0x446152['beep']};_0x2cb1fc['forEach'](function(_0x6e2eaa){_0x376b0b[_0xf51b('0x50')]=_0x6e2eaa;socket[_0xf51b('0x51')]('userNotification:send',_0x376b0b);});return _0x87631f;});});})['then'](respondWithResult(_0x1cfcde,0xc9))['catch'](handleError(_0x1cfcde,null));};function getContent(_0x3b8b30){return new BPromise(function(_0x63d0ca,_0xd0259d){if(_0x3b8b30['text']){_0x63d0ca(_0x3b8b30['text']);return;}return db['Template'][_0xf51b('0x52')]({'attributes':[_0xf51b('0x53')],'where':{'id':_0x3b8b30[_0xf51b('0x36')]},'raw':!![]})['then'](function(_0x315c3d){if(!_0x315c3d)throw new db[(_0xf51b('0x3a'))][(_0xf51b('0x37'))](_0xf51b('0x54'));var _0xb207ca=Mustache[_0xf51b('0x55')](_0x315c3d[_0xf51b('0x53')],_0x3b8b30[_0xf51b('0x39')]);_0x63d0ca(_0xb207ca);})[_0xf51b('0x56')](function(_0x5c33a7){_0xd0259d(_0x5c33a7);});});}function getRecipients(_0x1101eb){return new BPromise(function(_0x2bf2e1,_0x171548){var _0x8dd951=[];var _0x1b5cfa=[];_0x1101eb[_0xf51b('0x57')](function(_0x5c3906){var _0x1a0e5b=_[_0xf51b('0x58')](_0x5c3906[_0xf51b('0x46')]['toLowerCase']());if(_0x1a0e5b===_0xf51b('0x59')){_0x8dd951=_[_0xf51b('0x5a')](_0x8dd951,_0x5c3906[_0xf51b('0x5b')]);}else{if(_[_0xf51b('0x45')](_0x1a0e5b,_0xf51b('0x5c')))_0x1a0e5b=_0x1a0e5b['replace'](_0xf51b('0x5c'),_0xf51b('0x5d'));_0x5c3906[_0xf51b('0x5b')][_0xf51b('0x57')](function(_0xd7720){_0x1b5cfa[_0xf51b('0x5e')](getAgents(_0x1a0e5b,_0xd7720));});}});return BPromise[_0xf51b('0x5f')](_0x1b5cfa)['then'](function(_0x227ead){_0x8dd951=_[_0xf51b('0x5a')](_0x8dd951,_[_0xf51b('0x60')](_0x227ead));_0x2bf2e1(_0x8dd951);})[_0xf51b('0x56')](function(_0x45a3e8){_0x171548(_0x45a3e8);});});}function getAgents(_0x5c6dbe,_0x1b8f89){return new BPromise(function(_0x30307e,_0x4bd704){return db[_0x5c6dbe][_0xf51b('0x52')]({'where':{'id':_0x1b8f89}})[_0xf51b('0x2d')](function(_0x5a295b){return _0x5a295b['getAgents']({'attributes':['id'],'raw':!![]})[_0xf51b('0x2d')](function(_0x42b6b8){var _0xde3f85=_['map'](_0x42b6b8,'id');_0x30307e(_0xde3f85);});})[_0xf51b('0x56')](function(_0xde25c4){_0x4bd704(_0xde25c4);});});} \ No newline at end of file +var _0x8f33=['./userNotification.socket','register','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','transaction','UserNotification','beep','forEach','recipient','userNotification:send','catch','Template','findOne','html','render','view','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0x3b3827,_0x56023e){var _0x5326b2=function(_0x41e0fe){while(--_0x41e0fe){_0x3b3827['push'](_0x3b3827['shift']());}};_0x5326b2(++_0x56023e);}(_0x8f33,0xaf));var _0x38f3=function(_0xcc0273,_0x5d30d2){_0xcc0273=_0xcc0273-0x0;var _0x55a7ae=_0x8f33[_0xcc0273];return _0x55a7ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38f3('0x0'));var zipdir=require(_0x38f3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38f3('0x2'));var moment=require(_0x38f3('0x3'));var BPromise=require(_0x38f3('0x4'));var Mustache=require('mustache');var util=require(_0x38f3('0x5'));var path=require(_0x38f3('0x6'));var sox=require('sox');var csv=require(_0x38f3('0x7'));var ejs=require(_0x38f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38f3('0x9'));var squel=require(_0x38f3('0xa'));var crypto=require(_0x38f3('0xb'));var jsforce=require(_0x38f3('0xc'));var deskjs=require(_0x38f3('0xd'));var toCsv=require(_0x38f3('0x7'));var querystring=require(_0x38f3('0xe'));var Papa=require(_0x38f3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x38f3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38f3('0x11'));var logger=require(_0x38f3('0x12'))(_0x38f3('0x13'));var utils=require('../../config/utils');var config=require(_0x38f3('0x14'));var licenseUtil=require(_0x38f3('0x15'));var db=require(_0x38f3('0x16'))['db'];config['redis']=_[_0x38f3('0x17')](config[_0x38f3('0x18')],{'host':_0x38f3('0x19'),'port':0x18eb});var socket=require(_0x38f3('0x1a'))(new Redis(config['redis']));require(_0x38f3('0x1b'))[_0x38f3('0x1c')](socket);function respondWithStatusCode(_0x4cfc88,_0x31f215){_0x31f215=_0x31f215||0xcc;return function(_0x687f2){if(_0x687f2){return _0x4cfc88['sendStatus'](_0x31f215);}return _0x4cfc88[_0x38f3('0x1d')](_0x31f215)['end']();};}function respondWithResult(_0x3d9338,_0x166b06){_0x166b06=_0x166b06||0xc8;return function(_0x10d879){if(_0x10d879){return _0x3d9338[_0x38f3('0x1d')](_0x166b06)['json'](_0x10d879);}};}function respondWithFilteredResult(_0x442c15,_0x4185ed){return function(_0x49b071){if(_0x49b071){var _0x2902d5=typeof _0x4185ed[_0x38f3('0x1e')]===_0x38f3('0x1f')&&typeof _0x4185ed['limit']==='undefined';var _0x3f221b=_0x49b071[_0x38f3('0x20')];var _0x160503=_0x2902d5?0x0:_0x4185ed[_0x38f3('0x1e')];var _0x33495c=_0x2902d5?_0x49b071['count']:_0x4185ed[_0x38f3('0x1e')]+_0x4185ed[_0x38f3('0x21')];var _0x51da5e;if(_0x33495c>=_0x3f221b){_0x33495c=_0x3f221b;_0x51da5e=0xc8;}else{_0x51da5e=0xce;}_0x442c15[_0x38f3('0x1d')](_0x51da5e);return _0x442c15['set'](_0x38f3('0x22'),_0x160503+'-'+_0x33495c+'/'+_0x3f221b)[_0x38f3('0x23')](_0x49b071);}return null;};}function patchUpdates(_0x18ad5b){return function(_0x7d2d17){try{jsonpatch[_0x38f3('0x24')](_0x7d2d17,_0x18ad5b,!![]);}catch(_0x4b5689){return BPromise['reject'](_0x4b5689);}return _0x7d2d17[_0x38f3('0x25')]();};}function saveUpdates(_0x3d3d07,_0x2f2c57){return function(_0x4e0978){if(_0x4e0978){return _0x4e0978[_0x38f3('0x26')](_0x3d3d07)[_0x38f3('0x27')](function(_0x4b281c){return _0x4b281c;});}return null;};}function removeEntity(_0x3a164f,_0x15214c){return function(_0x4b95eb){if(_0x4b95eb){return _0x4b95eb[_0x38f3('0x28')]()[_0x38f3('0x27')](function(){_0x3a164f['status'](0xcc)[_0x38f3('0x29')]();});}};}function handleEntityNotFound(_0x4296b1,_0x3fd4a9){return function(_0x4eeba6){if(!_0x4eeba6){_0x4296b1[_0x38f3('0x2a')](0x194);}return _0x4eeba6;};}function handleError(_0x10cc12,_0x3d379e){_0x3d379e=_0x3d379e||0x1f4;return function(_0x98904c){logger[_0x38f3('0x2b')](_0x98904c['stack']);if(_0x98904c['name']){delete _0x98904c[_0x38f3('0x2c')];}_0x10cc12[_0x38f3('0x1d')](_0x3d379e)[_0x38f3('0x2d')](_0x98904c);};}exports[_0x38f3('0x2e')]=function(_0x2550b0,_0x5dce81,_0x218a15){if(!_0x2550b0[_0x38f3('0x2f')][_0x38f3('0x30')](_0x38f3('0x31'))&&!_0x2550b0[_0x38f3('0x2f')][_0x38f3('0x30')](_0x38f3('0x32'))){throw new db[(_0x38f3('0x33'))][(_0x38f3('0x34'))](_0x38f3('0x35'));}else{if(_0x2550b0['body'][_0x38f3('0x30')]('TemplateId')&&!_0x2550b0[_0x38f3('0x2f')]['hasOwnProperty']('view')){throw new db['Sequelize']['ValidationError'](_0x38f3('0x36'));}if(!_0x2550b0[_0x38f3('0x2f')][_0x38f3('0x30')](_0x38f3('0x37'))){throw new db['Sequelize'][(_0x38f3('0x34'))](_0x38f3('0x38'));}else{try{var _0x1c009e=JSON['parse'](_0x2550b0[_0x38f3('0x2f')][_0x38f3('0x37')]);}catch(_0x2aa877){logger[_0x38f3('0x2b')](_0x2aa877);throw new db[(_0x38f3('0x33'))][(_0x38f3('0x34'))](_0x38f3('0x39'));}var _0x5b388a=[_0x38f3('0x3a'),'faxqueue',_0x38f3('0x3b'),_0x38f3('0x3c'),'smsqueue',_0x38f3('0x3d'),_0x38f3('0x3e'),_0x38f3('0x3f'),_0x38f3('0x40')];if(_[_0x38f3('0x41')](_0x1c009e,function(_0x1bfa37){return!_[_0x38f3('0x42')](_0x5b388a,_0x1bfa37[_0x38f3('0x43')][_0x38f3('0x44')]());})){throw new db[(_0x38f3('0x33'))]['ValidationError'](_0x38f3('0x45'));}}}var _0x542a9b={};_0x542a9b[_0x38f3('0x46')]=_0x2550b0['body'][_0x38f3('0x30')](_0x38f3('0x46'))?_0x2550b0['body'][_0x38f3('0x46')]:_0x2550b0['user'][_0x38f3('0x47')];_0x542a9b[_0x38f3('0x48')]=_[_0x38f3('0x49')](_0x2550b0['body'][_0x38f3('0x48')])?null:_0x2550b0[_0x38f3('0x2f')][_0x38f3('0x48')];_0x542a9b['beep']=_0x2550b0[_0x38f3('0x2f')]['beep']||![];_0x542a9b[_0x38f3('0x4a')]=_0x2550b0['user']['id'];return getContent(_0x2550b0['body'])[_0x38f3('0x27')](function(_0x1a2048){_0x542a9b[_0x38f3('0x2f')]=_0x1a2048;return getRecipients(_0x1c009e);})[_0x38f3('0x27')](function(_0x121fc2){_0x542a9b[_0x38f3('0x4b')]=_[_0x38f3('0x4c')](_0x121fc2)[_0x38f3('0x4d')](',');return db['sequelize'][_0x38f3('0x4e')](function(_0x50ae4b){return db[_0x38f3('0x4f')]['create'](_0x542a9b,{'raw':!![],'transaction':_0x50ae4b})[_0x38f3('0x27')](function(_0x18ba46){var _0x2e7940={'sender':_0x542a9b[_0x38f3('0x46')],'description':_0x542a9b[_0x38f3('0x48')],'content':_0x542a9b[_0x38f3('0x2f')],'beep':_0x542a9b[_0x38f3('0x50')]};_0x121fc2[_0x38f3('0x51')](function(_0x4d936b){_0x2e7940[_0x38f3('0x52')]=_0x4d936b;socket['emit'](_0x38f3('0x53'),_0x2e7940);});return _0x18ba46;});});})[_0x38f3('0x27')](respondWithResult(_0x5dce81,0xc9))[_0x38f3('0x54')](handleError(_0x5dce81,null));};function getContent(_0x10934c){return new BPromise(function(_0x1d12c3,_0x49a522){if(_0x10934c[_0x38f3('0x31')]){_0x1d12c3(_0x10934c[_0x38f3('0x31')]);return;}return db[_0x38f3('0x55')][_0x38f3('0x56')]({'attributes':[_0x38f3('0x57')],'where':{'id':_0x10934c[_0x38f3('0x32')]},'raw':!![]})['then'](function(_0x28f7c1){if(!_0x28f7c1)throw new db[(_0x38f3('0x33'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x498b9b=Mustache[_0x38f3('0x58')](_0x28f7c1['html'],_0x10934c[_0x38f3('0x59')]);_0x1d12c3(_0x498b9b);})['catch'](function(_0x319866){_0x49a522(_0x319866);});});}function getRecipients(_0x230017){return new BPromise(function(_0x3928d1,_0x5bce4a){var _0x3aeb01=[];var _0xb38018=[];_0x230017[_0x38f3('0x51')](function(_0x341f4a){var _0x49e95a=_[_0x38f3('0x5a')](_0x341f4a[_0x38f3('0x43')][_0x38f3('0x44')]());if(_0x49e95a===_0x38f3('0x5b')){_0x3aeb01=_[_0x38f3('0x5c')](_0x3aeb01,_0x341f4a[_0x38f3('0x5d')]);}else{if(_[_0x38f3('0x42')](_0x49e95a,_0x38f3('0x5e')))_0x49e95a=_0x49e95a[_0x38f3('0x5f')](_0x38f3('0x5e'),_0x38f3('0x60'));_0x341f4a[_0x38f3('0x5d')][_0x38f3('0x51')](function(_0x150e85){_0xb38018[_0x38f3('0x61')](getAgents(_0x49e95a,_0x150e85));});}});return BPromise[_0x38f3('0x62')](_0xb38018)[_0x38f3('0x27')](function(_0x309a2d){_0x3aeb01=_['union'](_0x3aeb01,_['flatten'](_0x309a2d));_0x3928d1(_0x3aeb01);})[_0x38f3('0x54')](function(_0x48312e){_0x5bce4a(_0x48312e);});});}function getAgents(_0x155da3,_0x38c19c){return new BPromise(function(_0x137a4c,_0x124e0c){return db[_0x155da3][_0x38f3('0x56')]({'where':{'id':_0x38c19c}})[_0x38f3('0x27')](function(_0x5da1d1){return _0x5da1d1[_0x38f3('0x63')]({'attributes':['id'],'raw':!![]})['then'](function(_0x48be34){var _0x13c681=_[_0x38f3('0x64')](_0x48be34,'id');_0x137a4c(_0x13c681);});})[_0x38f3('0x54')](function(_0x28b220){_0x124e0c(_0x28b220);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 716ee74..100462e 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c6=['update','emit','hook','exports','events','setMaxListeners','save'];(function(_0x21831d,_0x154985){var _0x20a0e2=function(_0x22258e){while(--_0x22258e){_0x21831d['push'](_0x21831d['shift']());}};_0x20a0e2(++_0x154985);}(_0x50c6,0x12a));var _0x650c=function(_0x3ee11a,_0x5c6b18){_0x3ee11a=_0x3ee11a-0x0;var _0x285a8f=_0x50c6[_0x3ee11a];return _0x285a8f;};'use strict';var EventEmitter=require(_0x650c('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x650c('0x1')](0x0);var events={'afterCreate':_0x650c('0x2'),'afterUpdate':_0x650c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d74bd){return function(_0x2cff81,_0x57c202,_0x2d0f61){UserNotificationEvents[_0x650c('0x4')](_0x4d74bd+':'+_0x2cff81['id'],_0x2cff81);UserNotificationEvents[_0x650c('0x4')](_0x4d74bd,_0x2cff81);_0x2d0f61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x650c('0x5')](e,emitEvent(event));}}module[_0x650c('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x9d2a=['emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0x9d2a,0x1bb));var _0xa9d2=function(_0x437dbd,_0x2e5bb0){_0x437dbd=_0x437dbd-0x0;var _0x2fc4db=_0x9d2a[_0x437dbd];return _0x2fc4db;};'use strict';var EventEmitter=require(_0xa9d2('0x0'));var UserNotification=require(_0xa9d2('0x1'))['db'][_0xa9d2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa9d2('0x3')](0x0);var events={'afterCreate':_0xa9d2('0x4'),'afterUpdate':_0xa9d2('0x5'),'afterDestroy':_0xa9d2('0x6')};function emitEvent(_0x151e39){return function(_0x5cd2dd,_0x47e28c,_0x145238){UserNotificationEvents[_0xa9d2('0x7')](_0x151e39+':'+_0x5cd2dd['id'],_0x5cd2dd);UserNotificationEvents[_0xa9d2('0x7')](_0x151e39,_0x5cd2dd);_0x145238(null);};}for(var e in events){if(events[_0xa9d2('0x8')](e)){var event=events[e];UserNotification[_0xa9d2('0x9')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 571844b..e38153a 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa50d=['bluebird','request-promise','path','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x2cf9cd,_0x248d2c){var _0x5ec964=function(_0x3f38ee){while(--_0x3f38ee){_0x2cf9cd['push'](_0x2cf9cd['shift']());}};_0x5ec964(++_0x248d2c);}(_0xa50d,0xca));var _0xda50=function(_0x1f42c8,_0x1801de){_0x1f42c8=_0x1f42c8-0x0;var _0x1413b5=_0xa50d[_0x1f42c8];return _0x1413b5;};'use strict';var _=require(_0xda50('0x0'));var util=require('util');var logger=require(_0xda50('0x1'))('api');var moment=require('moment');var BPromise=require(_0xda50('0x2'));var rp=require(_0xda50('0x3'));var fs=require('fs');var path=require(_0xda50('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xda50('0x5'));module[_0xda50('0x6')]=function(_0x220482,_0x416076){return _0x220482[_0xda50('0x7')](_0xda50('0x8'),attributes,{'tableName':_0xda50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda50('0xa'),'collate':_0xda50('0xb')});}; \ No newline at end of file +var _0x7c07=['api','moment','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','define','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7c07,0x111));var _0x77c0=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7c07[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x77c0('0x0'));var logger=require(_0x77c0('0x1'))(_0x77c0('0x2'));var moment=require(_0x77c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x77c0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77c0('0x5'));var config=require(_0x77c0('0x6'));var attributes=require(_0x77c0('0x7'));module[_0x77c0('0x8')]=function(_0x37627c,_0x29c08b){return _0x37627c[_0x77c0('0x9')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x77c0('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 68f16ea..da7fd1a 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf443=['info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then'];(function(_0x47e6fc,_0x4d9e5d){var _0x144359=function(_0x226a2c){while(--_0x226a2c){_0x47e6fc['push'](_0x47e6fc['shift']());}};_0x144359(++_0x4d9e5d);}(_0xf443,0x154));var _0x3f44=function(_0x3591a1,_0x4a5a1a){_0x3591a1=_0x3591a1-0x0;var _0x229613=_0xf443[_0x3591a1];return _0x229613;};'use strict';var _=require('lodash');var util=require(_0x3f44('0x0'));var moment=require(_0x3f44('0x1'));var BPromise=require(_0x3f44('0x2'));var rs=require(_0x3f44('0x3'));var fs=require('fs');var Redis=require(_0x3f44('0x4'));var db=require(_0x3f44('0x5'))['db'];var utils=require(_0x3f44('0x6'));var logger=require(_0x3f44('0x7'))(_0x3f44('0x8'));var config=require(_0x3f44('0x9'));var jayson=require(_0x3f44('0xa'));var client=jayson[_0x3f44('0xb')][_0x3f44('0xc')]({'port':0x232a});config[_0x3f44('0xd')]=_[_0x3f44('0xe')](config['redis'],{'host':_0x3f44('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f44('0xd')]));require(_0x3f44('0x10'))[_0x3f44('0x11')](socket);function respondWithRpcPromise(_0x1c19dc,_0x469bf8,_0x2ba553){return new BPromise(function(_0x915f7,_0x4c315f){return client[_0x3f44('0x12')](_0x1c19dc,_0x2ba553)[_0x3f44('0x13')](function(_0x213272){logger[_0x3f44('0x14')](_0x3f44('0x15'),_0x469bf8,_0x3f44('0x16'));logger[_0x3f44('0x17')](_0x3f44('0x18'),_0x469bf8,_0x3f44('0x16'),JSON[_0x3f44('0x19')](_0x213272));if(_0x213272['error']){if(_0x213272[_0x3f44('0x1a')]['code']===0x1f4){logger[_0x3f44('0x1a')](_0x3f44('0x15'),_0x469bf8,_0x213272['error']['message']);return _0x4c315f(_0x213272[_0x3f44('0x1a')]['message']);}logger['error'](_0x3f44('0x15'),_0x469bf8,_0x213272['error'][_0x3f44('0x1b')]);return _0x915f7(_0x213272[_0x3f44('0x1a')]['message']);}else{logger[_0x3f44('0x14')](_0x3f44('0x15'),_0x469bf8,_0x3f44('0x16'));_0x915f7(_0x213272[_0x3f44('0x1c')]['message']);}})[_0x3f44('0x1d')](function(_0x1d8a83){logger[_0x3f44('0x1a')]('UserNotification,\x20%s,\x20%s',_0x469bf8,_0x1d8a83);_0x4c315f(_0x1d8a83);});});} \ No newline at end of file +var _0x7138=['./userNotification.socket','then','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5cd44c,_0x32f0e7){var _0x4a8197=function(_0x1c1777){while(--_0x1c1777){_0x5cd44c['push'](_0x5cd44c['shift']());}};_0x4a8197(++_0x32f0e7);}(_0x7138,0xff));var _0x8713=function(_0x106895,_0xf6b6be){_0x106895=_0x106895-0x0;var _0x3ee675=_0x7138[_0x106895];return _0x3ee675;};'use strict';var _=require(_0x8713('0x0'));var util=require(_0x8713('0x1'));var moment=require(_0x8713('0x2'));var BPromise=require(_0x8713('0x3'));var rs=require(_0x8713('0x4'));var fs=require('fs');var Redis=require(_0x8713('0x5'));var db=require(_0x8713('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8713('0x7'))('rpc');var config=require(_0x8713('0x8'));var jayson=require(_0x8713('0x9'));var client=jayson['client'][_0x8713('0xa')]({'port':0x232a});config[_0x8713('0xb')]=_[_0x8713('0xc')](config[_0x8713('0xb')],{'host':_0x8713('0xd'),'port':0x18eb});var socket=require(_0x8713('0xe'))(new Redis(config[_0x8713('0xb')]));require(_0x8713('0xf'))['register'](socket);function respondWithRpcPromise(_0x505b37,_0x5dd087,_0xa38e10){return new BPromise(function(_0x37a187,_0x5abfb7){return client['request'](_0x505b37,_0xa38e10)[_0x8713('0x10')](function(_0xe92d48){logger[_0x8713('0x11')]('UserNotification,\x20%s,\x20%s',_0x5dd087,_0x8713('0x12'));logger[_0x8713('0x13')](_0x8713('0x14'),_0x5dd087,'request\x20sent',JSON[_0x8713('0x15')](_0xe92d48));if(_0xe92d48[_0x8713('0x16')]){if(_0xe92d48[_0x8713('0x16')][_0x8713('0x17')]===0x1f4){logger[_0x8713('0x16')]('UserNotification,\x20%s,\x20%s',_0x5dd087,_0xe92d48[_0x8713('0x16')][_0x8713('0x18')]);return _0x5abfb7(_0xe92d48[_0x8713('0x16')][_0x8713('0x18')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x5dd087,_0xe92d48[_0x8713('0x16')][_0x8713('0x18')]);return _0x37a187(_0xe92d48[_0x8713('0x16')]['message']);}else{logger['info'](_0x8713('0x19'),_0x5dd087,_0x8713('0x12'));_0x37a187(_0xe92d48['result'][_0x8713('0x18')]);}})[_0x8713('0x1a')](function(_0x47d9b3){logger['error'](_0x8713('0x19'),_0x5dd087,_0x47d9b3);_0x5abfb7(_0x47d9b3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index df1b8de..4b38920 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc04c=['update','emit','removeListener','length','userNotification:','save'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xc04c,0x137));var _0xcc04=function(_0xe0d097,_0x137c33){_0xe0d097=_0xe0d097-0x0;var _0x83cd2e=_0xc04c[_0xe0d097];return _0x83cd2e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xcc04('0x0'),'remove',_0xcc04('0x1')];function createListener(_0x95b736,_0x128f5f){return function(_0x39a834){_0x128f5f[_0xcc04('0x2')](_0x95b736,_0x39a834);};}function removeListener(_0x45f349,_0x1406da){return function(){UserNotificationEvents[_0xcc04('0x3')](_0x45f349,_0x1406da);};}exports['register']=function(_0x331462){for(var _0x1396ac=0x0,_0x40d355=events[_0xcc04('0x4')];_0x1396ac<_0x40d355;_0x1396ac++){var _0x20721b=events[_0x1396ac];var _0x4fe713=createListener(_0xcc04('0x5')+_0x20721b,_0x331462);UserNotificationEvents['on'](_0x20721b,_0x4fe713);}}; \ No newline at end of file +var _0xd88e=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x15f972,_0x4a1fc7){var _0x3d916e=function(_0x4efd86){while(--_0x4efd86){_0x15f972['push'](_0x15f972['shift']());}};_0x3d916e(++_0x4a1fc7);}(_0xd88e,0x83));var _0xed88=function(_0x5b1e07,_0x20eaeb){_0x5b1e07=_0x5b1e07-0x0;var _0x533495=_0xd88e[_0x5b1e07];return _0x533495;};'use strict';var UserNotificationEvents=require(_0xed88('0x0'));var events=[_0xed88('0x1'),_0xed88('0x2'),_0xed88('0x3')];function createListener(_0x475706,_0x193330){return function(_0x3181ab){_0x193330[_0xed88('0x4')](_0x475706,_0x3181ab);};}function removeListener(_0x237a2e,_0x53244a){return function(){UserNotificationEvents[_0xed88('0x5')](_0x237a2e,_0x53244a);};}exports[_0xed88('0x6')]=function(_0x38a829){for(var _0x3fc708=0x0,_0x75b993=events[_0xed88('0x7')];_0x3fc708<_0x75b993;_0x3fc708++){var _0x9201a5=events[_0x3fc708];var _0x15bb30=createListener(_0xed88('0x8')+_0x9201a5,_0x38a829);UserNotificationEvents['on'](_0x9201a5,_0x15bb30);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8149612..8589e91 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3f2c38,_0x566aeb){var _0x2ac330=function(_0x755a1b){while(--_0x755a1b){_0x3f2c38['push'](_0x3f2c38['shift']());}};_0x2ac330(++_0x566aeb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x45081a,_0x3ae384){var _0x55bfe2=function(_0xdb8714){while(--_0xdb8714){_0x45081a['push'](_0x45081a['shift']());}};_0x55bfe2(++_0x3ae384);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 2b4af53..9006424 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 _0x340b=['sequelize','exports'];(function(_0x5cff13,_0x880c1a){var _0x429a45=function(_0x1f6014){while(--_0x1f6014){_0x5cff13['push'](_0x5cff13['shift']());}};_0x429a45(++_0x880c1a);}(_0x340b,0x15a));var _0xb340=function(_0x4c7c52,_0x16996d){_0x4c7c52=_0x4c7c52-0x0;var _0x21791c=_0x340b[_0x4c7c52];return _0x21791c;};'use strict';var Sequelize=require(_0xb340('0x0'));module[_0xb340('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'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 63dc575..b1a2620 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 _0xb1df=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x26269a,_0x341f28){var _0x8b6847=function(_0x156f63){while(--_0x156f63){_0x26269a['push'](_0x26269a['shift']());}};_0x8b6847(++_0x341f28);}(_0xb1df,0x1c9));var _0xfb1d=function(_0x414d0d,_0x35c3d4){_0x414d0d=_0x414d0d-0x0;var _0x39ae18=_0xb1df[_0x414d0d];return _0x39ae18;};'use strict';var _=require(_0xfb1d('0x0'));var util=require(_0xfb1d('0x1'));var logger=require(_0xfb1d('0x2'))(_0xfb1d('0x3'));var moment=require(_0xfb1d('0x4'));var BPromise=require(_0xfb1d('0x5'));var rp=require(_0xfb1d('0x6'));var fs=require('fs');var path=require(_0xfb1d('0x7'));var rimraf=require(_0xfb1d('0x8'));var config=require(_0xfb1d('0x9'));var attributes=require(_0xfb1d('0xa'));module[_0xfb1d('0xb')]=function(_0x48f533,_0x1a404f){return _0x48f533[_0xfb1d('0xc')](_0xfb1d('0xd'),attributes,{'tableName':_0xfb1d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1426=['../../config/logger','api','moment','path','rimraf','exports','define','lodash'];(function(_0x276f5b,_0x5cb495){var _0x4e6f40=function(_0x218f6c){while(--_0x218f6c){_0x276f5b['push'](_0x276f5b['shift']());}};_0x4e6f40(++_0x5cb495);}(_0x1426,0x8f));var _0x6142=function(_0xce76e9,_0x2661ce){_0xce76e9=_0xce76e9-0x0;var _0x29b6b1=_0x1426[_0xce76e9];return _0x29b6b1;};'use strict';var _=require(_0x6142('0x0'));var util=require('util');var logger=require(_0x6142('0x1'))(_0x6142('0x2'));var moment=require(_0x6142('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6142('0x4'));var rimraf=require(_0x6142('0x5'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x6142('0x6')]=function(_0x2f9fe3,_0x5aaab0){return _0x2f9fe3[_0x6142('0x7')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 7405084..76da631 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 _0x9b93=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0x9b93,0xe9));var _0x39b9=function(_0x44ff3a,_0x46f40d){_0x44ff3a=_0x44ff3a-0x0;var _0x333bc1=_0x9b93[_0x44ff3a];return _0x333bc1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39b9('0x0'));var BPromise=require(_0x39b9('0x1'));var rs=require(_0x39b9('0x2'));var fs=require('fs');var Redis=require(_0x39b9('0x3'));var db=require(_0x39b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39b9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x39b9('0x6')][_0x39b9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52adb6,_0x24369d,_0x3dc71a){return new BPromise(function(_0x3114fc,_0x4df3a5){return client[_0x39b9('0x8')](_0x52adb6,_0x3dc71a)[_0x39b9('0x9')](function(_0x3df69a){logger[_0x39b9('0xa')](_0x39b9('0xb'),_0x24369d,_0x39b9('0xc'));logger[_0x39b9('0xd')](_0x39b9('0xe'),_0x24369d,_0x39b9('0xc'),JSON[_0x39b9('0xf')](_0x3df69a));if(_0x3df69a[_0x39b9('0x10')]){if(_0x3df69a[_0x39b9('0x10')][_0x39b9('0x11')]===0x1f4){logger[_0x39b9('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x24369d,_0x3df69a[_0x39b9('0x10')]['message']);return _0x4df3a5(_0x3df69a[_0x39b9('0x10')][_0x39b9('0x12')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x24369d,_0x3df69a[_0x39b9('0x10')][_0x39b9('0x12')]);return _0x3114fc(_0x3df69a[_0x39b9('0x10')][_0x39b9('0x12')]);}else{logger['info'](_0x39b9('0xb'),_0x24369d,'request\x20sent');_0x3114fc(_0x3df69a[_0x39b9('0x13')][_0x39b9('0x12')]);}})[_0x39b9('0x14')](function(_0xb77aa1){logger[_0x39b9('0x10')](_0x39b9('0xb'),_0x24369d,_0xb77aa1);_0x4df3a5(_0xb77aa1);});});} \ No newline at end of file +var _0xfd11=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x116a7e,_0x3efc1d){var _0x213109=function(_0x53074c){while(--_0x53074c){_0x116a7e['push'](_0x116a7e['shift']());}};_0x213109(++_0x3efc1d);}(_0xfd11,0x1a1));var _0x1fd1=function(_0x24f862,_0x4b645a){_0x24f862=_0x24f862-0x0;var _0x198aa4=_0xfd11[_0x24f862];return _0x198aa4;};'use strict';var _=require('lodash');var util=require(_0x1fd1('0x0'));var moment=require('moment');var BPromise=require(_0x1fd1('0x1'));var rs=require(_0x1fd1('0x2'));var fs=require('fs');var Redis=require(_0x1fd1('0x3'));var db=require(_0x1fd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1fd1('0x5'));var config=require(_0x1fd1('0x6'));var jayson=require(_0x1fd1('0x7'));var client=jayson['client'][_0x1fd1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x319104,_0x27e73b,_0x2508fb){return new BPromise(function(_0x5548e3,_0x287973){return client[_0x1fd1('0x9')](_0x319104,_0x2508fb)[_0x1fd1('0xa')](function(_0x3448f8){logger[_0x1fd1('0xb')](_0x1fd1('0xc'),_0x27e73b,_0x1fd1('0xd'));logger[_0x1fd1('0xe')](_0x1fd1('0xf'),_0x27e73b,_0x1fd1('0xd'),JSON[_0x1fd1('0x10')](_0x3448f8));if(_0x3448f8[_0x1fd1('0x11')]){if(_0x3448f8[_0x1fd1('0x11')][_0x1fd1('0x12')]===0x1f4){logger[_0x1fd1('0x11')](_0x1fd1('0xc'),_0x27e73b,_0x3448f8['error'][_0x1fd1('0x13')]);return _0x287973(_0x3448f8[_0x1fd1('0x11')]['message']);}logger[_0x1fd1('0x11')](_0x1fd1('0xc'),_0x27e73b,_0x3448f8['error']['message']);return _0x5548e3(_0x3448f8[_0x1fd1('0x11')]['message']);}else{logger[_0x1fd1('0xb')](_0x1fd1('0xc'),_0x27e73b,_0x1fd1('0xd'));_0x5548e3(_0x3448f8[_0x1fd1('0x14')][_0x1fd1('0x13')]);}})[_0x1fd1('0x15')](function(_0x32e465){logger[_0x1fd1('0x11')](_0x1fd1('0xc'),_0x27e73b,_0x32e465);_0x287973(_0x32e465);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 659a86f..344b6ee 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 _0x059d=['./userProfile.controller','isAuthenticated','index','get','describe','/:id','show','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5032d5,_0x309879){var _0x101b49=function(_0x57262f){while(--_0x57262f){_0x5032d5['push'](_0x5032d5['shift']());}};_0x101b49(++_0x309879);}(_0x059d,0x1b9));var _0xd059=function(_0x923759,_0x354c76){_0x923759=_0x923759-0x0;var _0x5e0b65=_0x059d[_0x923759];return _0x5e0b65;};'use strict';var multer=require(_0xd059('0x0'));var util=require(_0xd059('0x1'));var path=require(_0xd059('0x2'));var timeout=require(_0xd059('0x3'));var express=require(_0xd059('0x4'));var router=express[_0xd059('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd059('0x6'));var interaction=require(_0xd059('0x7'));var config=require(_0xd059('0x8'));var controller=require(_0xd059('0x9'));router['get']('/',auth[_0xd059('0xa')](),controller[_0xd059('0xb')]);router[_0xd059('0xc')]('/describe',auth[_0xd059('0xa')](),controller[_0xd059('0xd')]);router[_0xd059('0xc')](_0xd059('0xe'),auth[_0xd059('0xa')](),controller[_0xd059('0xf')]);router['get']('/:id/sections',auth[_0xd059('0xa')](),controller['getSections']);router['get'](_0xd059('0x10'),auth['isAuthenticated'](),controller[_0xd059('0x11')]);router[_0xd059('0x12')]('/',auth[_0xd059('0xa')](),controller[_0xd059('0x13')]);router['post'](_0xd059('0x14'),auth[_0xd059('0xa')](),controller[_0xd059('0x15')]);router[_0xd059('0x12')](_0xd059('0x16'),auth[_0xd059('0xa')](),controller[_0xd059('0x17')]);router[_0xd059('0x12')](_0xd059('0x10'),auth[_0xd059('0xa')](),controller[_0xd059('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd059('0x19')]);router['delete'](_0xd059('0xe'),auth[_0xd059('0xa')](),controller['destroy']);router[_0xd059('0x1a')]('/:id/sections',auth[_0xd059('0xa')](),controller[_0xd059('0x1b')]);router[_0xd059('0x1a')](_0xd059('0x10'),auth[_0xd059('0xa')](),controller[_0xd059('0x1c')]);module[_0xd059('0x1d')]=router; \ No newline at end of file +var _0xeae4=['./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','clone','addSections','addResources','put','update','delete','destroy','removeSections','/:id/resources','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5b42e3,_0x2941eb){var _0x19af63=function(_0x4cbdfa){while(--_0x4cbdfa){_0x5b42e3['push'](_0x5b42e3['shift']());}};_0x19af63(++_0x2941eb);}(_0xeae4,0x78));var _0x4eae=function(_0x4e44a3,_0x11fec3){_0x4e44a3=_0x4e44a3-0x0;var _0x45401c=_0xeae4[_0x4e44a3];return _0x45401c;};'use strict';var multer=require(_0x4eae('0x0'));var util=require(_0x4eae('0x1'));var path=require('path');var timeout=require(_0x4eae('0x2'));var express=require(_0x4eae('0x3'));var router=express[_0x4eae('0x4')]();var fs_extra=require(_0x4eae('0x5'));var auth=require(_0x4eae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4eae('0x7'));var controller=require(_0x4eae('0x8'));router[_0x4eae('0x9')]('/',auth[_0x4eae('0xa')](),controller[_0x4eae('0xb')]);router[_0x4eae('0x9')](_0x4eae('0xc'),auth[_0x4eae('0xa')](),controller[_0x4eae('0xd')]);router['get'](_0x4eae('0xe'),auth[_0x4eae('0xa')](),controller[_0x4eae('0xf')]);router['get'](_0x4eae('0x10'),auth[_0x4eae('0xa')](),controller[_0x4eae('0x11')]);router['get']('/:id/resources',auth[_0x4eae('0xa')](),controller[_0x4eae('0x12')]);router[_0x4eae('0x13')]('/',auth[_0x4eae('0xa')](),controller[_0x4eae('0x14')]);router['post']('/:id/clone',auth[_0x4eae('0xa')](),controller[_0x4eae('0x15')]);router[_0x4eae('0x13')](_0x4eae('0x10'),auth['isAuthenticated'](),controller[_0x4eae('0x16')]);router[_0x4eae('0x13')]('/:id/resources',auth[_0x4eae('0xa')](),controller[_0x4eae('0x17')]);router[_0x4eae('0x18')]('/:id',auth[_0x4eae('0xa')](),controller[_0x4eae('0x19')]);router[_0x4eae('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x4eae('0x1b')]);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0x4eae('0x1c')]);router[_0x4eae('0x1a')](_0x4eae('0x1d'),auth[_0x4eae('0xa')](),controller[_0x4eae('0x1e')]);module[_0x4eae('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3f319bd..763f54b 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 _0xffc6=['setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x6c79c0,_0x12b571){var _0x4b96ca=function(_0x464948){while(--_0x464948){_0x6c79c0['push'](_0x6c79c0['shift']());}};_0x4b96ca(++_0x12b571);}(_0xffc6,0x11e));var _0x6ffc=function(_0x440237,_0x403080){_0x440237=_0x440237-0x0;var _0x59c5b8=_0xffc6[_0x440237];return _0x59c5b8;};'use strict';var Sequelize=require(_0x6ffc('0x0'));module[_0x6ffc('0x1')]={'name':{'type':Sequelize[_0x6ffc('0x2')],'allowNull':![],'unique':_0x6ffc('0x3')},'crudPermissions':{'type':Sequelize[_0x6ffc('0x2')],'set':function(_0x19046a){this[_0x6ffc('0x4')](_0x6ffc('0x5'),_0x19046a?_0x19046a[_0x6ffc('0x6')](''):[]);},'get':function(){return this[_0x6ffc('0x7')](_0x6ffc('0x5'))?this[_0x6ffc('0x7')](_0x6ffc('0x5'))[_0x6ffc('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6ffc('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfaaf=['STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports'];(function(_0x359968,_0x352a38){var _0xd10754=function(_0x4f1928){while(--_0x4f1928){_0x359968['push'](_0x359968['shift']());}};_0xd10754(++_0x352a38);}(_0xfaaf,0x1ae));var _0xffaa=function(_0x16e6fb,_0x4f9d99){_0x16e6fb=_0x16e6fb-0x0;var _0x5ea0e9=_0xfaaf[_0x16e6fb];return _0x5ea0e9;};'use strict';var Sequelize=require(_0xffaa('0x0'));module[_0xffaa('0x1')]={'name':{'type':Sequelize[_0xffaa('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xffaa('0x2')],'set':function(_0xa05539){this[_0xffaa('0x3')]('crudPermissions',_0xa05539?_0xa05539[_0xffaa('0x4')](''):[]);},'get':function(){return this[_0xffaa('0x5')](_0xffaa('0x6'))?this['getDataValue']('crudPermissions')[_0xffaa('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xffaa('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xffaa('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 47623ff..3bf31c2 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 _0x9148=['create','clone','params','get','omit','createdAt','updatedAt','body','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','sequelize','push','removeSections','getSections','enabled','includes','subsections','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','ids','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch','show','length','include','find'];(function(_0xfbac0b,_0x20b38b){var _0x14e054=function(_0x5ef004){while(--_0x5ef004){_0xfbac0b['push'](_0xfbac0b['shift']());}};_0x14e054(++_0x20b38b);}(_0x9148,0x10d));var _0x8914=function(_0x27b4c9,_0x4e57fa){_0x27b4c9=_0x27b4c9-0x0;var _0x5087c7=_0x9148[_0x27b4c9];return _0x5087c7;};'use strict';var emlformat=require(_0x8914('0x0'));var rimraf=require(_0x8914('0x1'));var zipdir=require(_0x8914('0x2'));var jsonpatch=require(_0x8914('0x3'));var rp=require(_0x8914('0x4'));var moment=require(_0x8914('0x5'));var BPromise=require(_0x8914('0x6'));var Mustache=require(_0x8914('0x7'));var util=require(_0x8914('0x8'));var path=require(_0x8914('0x9'));var sox=require(_0x8914('0xa'));var csv=require('to-csv');var ejs=require(_0x8914('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8914('0xc'));var squel=require('squel');var crypto=require(_0x8914('0xd'));var jsforce=require(_0x8914('0xe'));var deskjs=require(_0x8914('0xf'));var toCsv=require(_0x8914('0x10'));var querystring=require('querystring');var Papa=require(_0x8914('0x11'));var Redis=require(_0x8914('0x12'));var authService=require(_0x8914('0x13'));var qs=require(_0x8914('0x14'));var as=require(_0x8914('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8914('0x16'))(_0x8914('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8914('0x18'));var db=require(_0x8914('0x19'))['db'];config[_0x8914('0x1a')]=_[_0x8914('0x1b')](config[_0x8914('0x1a')],{'host':_0x8914('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8914('0x1a')]));require(_0x8914('0x1d'))['register'](socket);function respondWithStatusCode(_0x29fb26,_0x3f97dc){_0x3f97dc=_0x3f97dc||0xcc;return function(_0x792c5b){if(_0x792c5b){return _0x29fb26[_0x8914('0x1e')](_0x3f97dc);}return _0x29fb26[_0x8914('0x1f')](_0x3f97dc)[_0x8914('0x20')]();};}function respondWithResult(_0x24b027,_0x11f6aa){_0x11f6aa=_0x11f6aa||0xc8;return function(_0xc602e8){if(_0xc602e8){return _0x24b027['status'](_0x11f6aa)[_0x8914('0x21')](_0xc602e8);}};}function respondWithFilteredResult(_0x2caf47,_0x117457){return function(_0x249aac){if(_0x249aac){var _0x350cb2=typeof _0x117457[_0x8914('0x22')]===_0x8914('0x23')&&typeof _0x117457['limit']===_0x8914('0x23');var _0x404632=_0x249aac['count'];var _0x5de618=_0x350cb2?0x0:_0x117457[_0x8914('0x22')];var _0x564292=_0x350cb2?_0x249aac['count']:_0x117457[_0x8914('0x22')]+_0x117457[_0x8914('0x24')];var _0x2d60c2;if(_0x564292>=_0x404632){_0x564292=_0x404632;_0x2d60c2=0xc8;}else{_0x2d60c2=0xce;}_0x2caf47[_0x8914('0x1f')](_0x2d60c2);return _0x2caf47[_0x8914('0x25')](_0x8914('0x26'),_0x5de618+'-'+_0x564292+'/'+_0x404632)[_0x8914('0x21')](_0x249aac);}return null;};}function patchUpdates(_0x28ba81){return function(_0x40efd4){try{jsonpatch[_0x8914('0x27')](_0x40efd4,_0x28ba81,!![]);}catch(_0x179b66){return BPromise[_0x8914('0x28')](_0x179b66);}return _0x40efd4[_0x8914('0x29')]();};}function saveUpdates(_0x29fdae,_0x1398f9){return function(_0x4bcd05){if(_0x4bcd05){return _0x4bcd05['update'](_0x29fdae)[_0x8914('0x2a')](function(_0x549548){return _0x549548;});}return null;};}function removeEntity(_0x57f360,_0x47d5af){return function(_0x1615eb){if(_0x1615eb){return _0x1615eb[_0x8914('0x2b')]()[_0x8914('0x2a')](function(){_0x57f360[_0x8914('0x1f')](0xcc)[_0x8914('0x20')]();});}};}function handleEntityNotFound(_0x1585ee,_0x1548f6){return function(_0x13b325){if(!_0x13b325){_0x1585ee[_0x8914('0x1e')](0x194);}return _0x13b325;};}function handleError(_0x16600c,_0x3a53af){_0x3a53af=_0x3a53af||0x1f4;return function(_0x200a34){logger[_0x8914('0x2c')](_0x200a34[_0x8914('0x2d')]);if(_0x200a34[_0x8914('0x2e')]){delete _0x200a34[_0x8914('0x2e')];}_0x16600c[_0x8914('0x1f')](_0x3a53af)[_0x8914('0x2f')](_0x200a34);};}exports[_0x8914('0x30')]=function(_0x5443d9,_0x593a84){var _0x25eb76={},_0x4efa85={},_0x4d42eb={'count':0x0,'rows':[]};var _0x87c042=_['map'](db[_0x8914('0x31')][_0x8914('0x32')],function(_0x135142){return{'name':_0x135142[_0x8914('0x33')],'type':_0x135142[_0x8914('0x34')][_0x8914('0x35')]};});_0x4efa85[_0x8914('0x36')]=_[_0x8914('0x37')](_0x87c042,'name');_0x4efa85[_0x8914('0x38')]=_[_0x8914('0x39')](_0x5443d9[_0x8914('0x38')]);_0x4efa85[_0x8914('0x3a')]=_[_0x8914('0x3b')](_0x4efa85['model'],_0x4efa85['query']);_0x25eb76[_0x8914('0x3c')]=_[_0x8914('0x3b')](_0x4efa85[_0x8914('0x36')],qs['fields'](_0x5443d9['query'][_0x8914('0x3d')]));_0x25eb76[_0x8914('0x3c')]=_0x25eb76[_0x8914('0x3c')]['length']?_0x25eb76[_0x8914('0x3c')]:_0x4efa85[_0x8914('0x36')];if(!_0x5443d9['query']['hasOwnProperty'](_0x8914('0x3e'))){_0x25eb76[_0x8914('0x24')]=qs[_0x8914('0x24')](_0x5443d9[_0x8914('0x38')]['limit']);_0x25eb76['offset']=qs[_0x8914('0x22')](_0x5443d9[_0x8914('0x38')][_0x8914('0x22')]);}_0x25eb76['order']=qs[_0x8914('0x3f')](_0x5443d9['query'][_0x8914('0x3f')]);_0x25eb76['where']=qs[_0x8914('0x3a')](_[_0x8914('0x40')](_0x5443d9[_0x8914('0x38')],_0x4efa85[_0x8914('0x3a')]),_0x87c042);if(_0x5443d9[_0x8914('0x38')]['filter']){_0x25eb76[_0x8914('0x41')]=_[_0x8914('0x42')](_0x25eb76[_0x8914('0x41')],{'$or':_[_0x8914('0x37')](_0x87c042,function(_0x57d7b7){if(_0x57d7b7[_0x8914('0x34')]!==_0x8914('0x43')){var _0x5907e7={};_0x5907e7[_0x57d7b7[_0x8914('0x2e')]]={'$like':'%'+_0x5443d9[_0x8914('0x38')][_0x8914('0x44')]+'%'};return _0x5907e7;}})});}_0x25eb76=_[_0x8914('0x42')]({},_0x25eb76,_0x5443d9[_0x8914('0x45')]);var _0x83a6fd={'where':_0x25eb76[_0x8914('0x41')]};return db[_0x8914('0x31')][_0x8914('0x46')](_0x83a6fd)[_0x8914('0x2a')](function(_0x2de819){_0x4d42eb[_0x8914('0x46')]=_0x2de819;if(_0x5443d9['query'][_0x8914('0x47')]){_0x25eb76['include']=[{'all':!![]}];}return db[_0x8914('0x31')][_0x8914('0x48')](_0x25eb76);})[_0x8914('0x2a')](function(_0x273130){_0x4d42eb[_0x8914('0x49')]=_0x273130;return _0x4d42eb;})[_0x8914('0x2a')](respondWithFilteredResult(_0x593a84,_0x25eb76))[_0x8914('0x4a')](handleError(_0x593a84,null));};exports[_0x8914('0x4b')]=function(_0x481bfe,_0x1b352d){var _0x5007f5={'raw':![],'where':{'id':_0x481bfe['params']['id']}},_0xf8df03={};_0xf8df03[_0x8914('0x36')]=_[_0x8914('0x39')](db[_0x8914('0x31')][_0x8914('0x32')]);_0xf8df03[_0x8914('0x38')]=_[_0x8914('0x39')](_0x481bfe[_0x8914('0x38')]);_0xf8df03['filters']=_['intersection'](_0xf8df03[_0x8914('0x36')],_0xf8df03[_0x8914('0x38')]);_0x5007f5[_0x8914('0x3c')]=_['intersection'](_0xf8df03[_0x8914('0x36')],qs[_0x8914('0x3d')](_0x481bfe[_0x8914('0x38')][_0x8914('0x3d')]));_0x5007f5['attributes']=_0x5007f5[_0x8914('0x3c')][_0x8914('0x4c')]?_0x5007f5['attributes']:_0xf8df03['model'];if(_0x481bfe[_0x8914('0x38')][_0x8914('0x47')]){_0x5007f5[_0x8914('0x4d')]=[{'all':!![]}];}_0x5007f5=_['merge']({},_0x5007f5,_0x481bfe[_0x8914('0x45')]);return db[_0x8914('0x31')][_0x8914('0x4e')](_0x5007f5)['then'](handleEntityNotFound(_0x1b352d,null))[_0x8914('0x2a')](respondWithResult(_0x1b352d,null))[_0x8914('0x4a')](handleError(_0x1b352d,null));};exports[_0x8914('0x4f')]=function(_0x448d03,_0x428dbe){return db['UserProfile'][_0x8914('0x4f')](_0x448d03['body'],{})[_0x8914('0x2a')](respondWithResult(_0x428dbe,0xc9))['catch'](handleError(_0x428dbe,null));};exports[_0x8914('0x50')]=function(_0x455e70,_0x3c716a){var _0x525cc0={'where':{'id':_0x455e70[_0x8914('0x51')]['id']}},_0x260943={};_0x260943[_0x8914('0x36')]=_[_0x8914('0x39')](db['UserProfile'][_0x8914('0x32')]);_0x525cc0[_0x8914('0x3c')]=_[_0x8914('0x3b')](_0x260943[_0x8914('0x36')],qs[_0x8914('0x3d')](_0x455e70[_0x8914('0x38')][_0x8914('0x3d')]));_0x525cc0[_0x8914('0x3c')]=_0x525cc0[_0x8914('0x3c')]['length']?_0x525cc0['attributes']:_0x260943[_0x8914('0x36')];if(_0x455e70[_0x8914('0x38')][_0x8914('0x47')]){_0x525cc0[_0x8914('0x4d')]=[{'all':!![]}];}_0x525cc0=_['merge']({},_0x525cc0,_0x455e70[_0x8914('0x45')]);return db[_0x8914('0x31')]['find'](_0x525cc0)['then'](handleEntityNotFound(_0x3c716a,null))[_0x8914('0x2a')](function(_0x20ee77){if(_0x20ee77){var _0xd3f039=_0x20ee77[_0x8914('0x52')]({'plain':!![]});_0xd3f039=qs[_0x8914('0x53')](_0xd3f039,['id',_0x8914('0x54'),_0x8914('0x55'),'crudPermissions']);_0x455e70[_0x8914('0x56')]=_[_0x8914('0x53')](_0x455e70[_0x8914('0x56')],['id',_0x8914('0x54'),'updatedAt']);return db['sequelize'][_0x8914('0x57')](function(_0x42aca4){return db['UserProfile'][_0x8914('0x4f')](_[_0x8914('0x42')](_0xd3f039,_0x455e70['body']),{'include':_0x455e70[_0x8914('0x38')][_0x8914('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x42aca4})[_0x8914('0x2a')](function(_0xc9d6b3){var _0x466a8a=_0xc9d6b3['get']({'plain':!![]});return db[_0x8914('0x58')][_0x8914('0x48')]({'where':{'userProfileId':_0x455e70[_0x8914('0x51')]['id']},'raw':!![]})[_0x8914('0x2a')](function(_0x2afc76){if(_0x2afc76){return BPromise[_0x8914('0x59')](_0x2afc76,function(_0x27319e){return new BPromise(function(_0x3bd1d7,_0x23428f){if(_0x27319e[_0x8914('0x5a')]===null||_0x27319e[_0x8914('0x5a')]===0x1)_0x3bd1d7(null);return db[_0x8914('0x5b')]['findAll']({'where':{'sectionId':_0x27319e['id']},'raw':!![]})[_0x8914('0x2a')](function(_0x3608f0){var _0x213bd7=_[_0x8914('0x37')](_0x3608f0,function(_0x553a2b){return qs[_0x8914('0x53')](_0x553a2b,['id',_0x8914('0x54'),_0x8914('0x55'),_0x8914('0x5c')]);});_0x3bd1d7(_0x213bd7);})[_0x8914('0x4a')](function(_0xeeabd6){_0x23428f(_0xeeabd6);});})[_0x8914('0x2a')](function(_0x2f9e56){var _0x5bd26a=qs[_0x8914('0x53')](_0x27319e,['id',_0x8914('0x54'),_0x8914('0x55')]);_0x5bd26a[_0x8914('0x5d')]=_0x466a8a['id'];if(_0x2f9e56)_0x5bd26a[_0x8914('0x5e')]=_0x2f9e56;return _0x5bd26a;})[_0x8914('0x2a')](function(_0x49f2f4){return db[_0x8914('0x58')][_0x8914('0x4f')](_0x49f2f4,{'include':[{'model':db[_0x8914('0x5b')],'as':_0x8914('0x5e')}],'raw':!![],'transaction':_0x42aca4});});})[_0x8914('0x2a')](function(){return _0x466a8a;});}});});});}})[_0x8914('0x2a')](respondWithResult(_0x3c716a,0xc9))['catch'](handleError(_0x3c716a,null));};exports[_0x8914('0x5f')]=function(_0x5c32d6,_0x4bc1d1){if(_0x5c32d6[_0x8914('0x56')]['id']){delete _0x5c32d6[_0x8914('0x56')]['id'];}return db[_0x8914('0x31')]['find']({'where':{'id':_0x5c32d6['params']['id']}})[_0x8914('0x2a')](handleEntityNotFound(_0x4bc1d1,null))[_0x8914('0x2a')](saveUpdates(_0x5c32d6[_0x8914('0x56')],null))[_0x8914('0x2a')](respondWithResult(_0x4bc1d1,null))[_0x8914('0x4a')](handleError(_0x4bc1d1,null));};exports[_0x8914('0x2b')]=function(_0x14062e,_0x2fa5ef){return db[_0x8914('0x31')][_0x8914('0x4e')]({'where':{'id':_0x14062e[_0x8914('0x51')]['id']}})[_0x8914('0x2a')](handleEntityNotFound(_0x2fa5ef,null))['then'](removeEntity(_0x2fa5ef,null))[_0x8914('0x4a')](handleError(_0x2fa5ef,null));};exports['describe']=function(_0x3b4508,_0x410462){return db[_0x8914('0x31')][_0x8914('0x60')]()[_0x8914('0x2a')](respondWithResult(_0x410462,null))[_0x8914('0x4a')](handleError(_0x410462,null));};exports[_0x8914('0x61')]=function(_0x16c1c1,_0x4defa2){var _0x2b22c3=_0x16c1c1[_0x8914('0x56')];return db['UserProfile'][_0x8914('0x4e')]({'where':{'id':_0x16c1c1[_0x8914('0x51')]['id']}})[_0x8914('0x2a')](handleEntityNotFound(_0x4defa2,null))[_0x8914('0x2a')](function(_0x18f61e){if(_0x18f61e){return db[_0x8914('0x62')][_0x8914('0x57')](function(_0x175997){return db[_0x8914('0x58')][_0x8914('0x2b')]({'where':{'userProfileId':_0x16c1c1['params']['id'],'sectionId':_[_0x8914('0x37')](_0x2b22c3,function(_0x1f9072){return _0x1f9072[_0x8914('0x5c')];})},'transaction':_0x175997})[_0x8914('0x2a')](function(){var _0x346082=_[_0x8914('0x37')](_0x2b22c3,function(_0x347d29){_0x347d29[_0x8914('0x5d')]=_0x16c1c1[_0x8914('0x51')]['id'];return _0x347d29;});var _0x7c6e00=[];return BPromise[_0x8914('0x59')](_0x346082,function(_0x2cbdde){return db[_0x8914('0x58')][_0x8914('0x4f')](_0x2cbdde,{'include':[{'model':db[_0x8914('0x5b')],'as':_0x8914('0x5e')}],'raw':!![],'transaction':_0x175997})[_0x8914('0x2a')](function(_0x3a08ea){_0x7c6e00[_0x8914('0x63')](_0x3a08ea[_0x8914('0x52')]({'plain':!![]}));});})[_0x8914('0x2a')](function(){return _0x7c6e00;});});});}})['then'](function(_0x47aa3b){return _0x47aa3b;})[_0x8914('0x2a')](respondWithResult(_0x4defa2,null))[_0x8914('0x4a')](handleError(_0x4defa2,null));};exports[_0x8914('0x64')]=function(_0x341bc6,_0x2fa966){var _0x5eb008;return db[_0x8914('0x31')][_0x8914('0x4e')]({'where':{'id':_0x341bc6[_0x8914('0x51')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x2fa966,null))['then'](function(_0x4d0f0a){if(_0x4d0f0a){_0x5eb008=_0x4d0f0a;return db[_0x8914('0x58')][_0x8914('0x2b')]({'where':{'userProfileId':_0x341bc6[_0x8914('0x51')]['id'],'sectionId':_0x341bc6[_0x8914('0x38')]['ids']}});}})[_0x8914('0x2a')](function(){return _0x5eb008;})[_0x8914('0x2a')](respondWithStatusCode(_0x2fa966,null))['catch'](handleError(_0x2fa966,null));};exports[_0x8914('0x65')]=function(_0x109a5f,_0x426789){var _0x574896=[];var _0x107277=[];return db[_0x8914('0x58')][_0x8914('0x48')]({'where':{'userProfileId':_0x109a5f['params']['id']},'raw':!![]})['then'](function(_0x55a74a){_0x574896=_[_0x8914('0x44')](_0x55a74a,function(_0x4e0aa8){return _0x4e0aa8[_0x8914('0x66')]===0x1||_['includes']([0x3eb,0x709],_0x4e0aa8['sectionId']);});if(!_['isEmpty'](_0x574896)){return _['map'](_0x574896,function(_0x281765){return _0x281765[_0x8914('0x5c')];});}else{return;}})['then'](function(_0x1b98bb){if(_0x1b98bb)_0x107277=_0x1b98bb;if(_[_0x8914('0x67')](_0x107277,0x64)){var _0x4a3e31=_[_0x8914('0x4e')](_0x574896,{'sectionId':0x64});return hasDefaultDashboard(_0x4a3e31)[_0x8914('0x2a')](function(_0x573b41){return _[_0x8914('0x37')](_0x574896,function(_0x5ce7f2){if(_0x5ce7f2['sectionId']===0x64){_0x5ce7f2[_0x8914('0x68')]=_0x573b41;}return _0x5ce7f2;});});}else{return;}})[_0x8914('0x2a')](function(_0x28e1e6){if(_0x28e1e6)_0x574896=_0x28e1e6;if(_[_0x8914('0x67')](_0x107277,0x3eb)){var _0x1503a7=_[_0x8914('0x4e')](_0x574896,{'sectionId':0x3eb});return getCustomDashboards(_0x1503a7)[_0x8914('0x2a')](function(_0x3f9059){return _[_0x8914('0x37')](_0x574896,function(_0x67fddc){if(_0x1503a7[_0x8914('0x66')]){if(_0x67fddc[_0x8914('0x5c')]===0x3eb){_0x67fddc[_0x8914('0x68')]=_0x3f9059;}}else{if(_0x67fddc[_0x8914('0x5c')]===0x64){_0x67fddc[_0x8914('0x68')]=_0x3f9059;}}return _0x67fddc;});});}else{return;}})[_0x8914('0x2a')](function(_0x4e2cfc){if(_0x4e2cfc)_0x574896=_0x4e2cfc;if(_['includes'](_0x107277,0x709)){var _0x1ab2c8=_['find'](_0x574896,{'sectionId':0x709});return getPlugins(_0x1ab2c8)[_0x8914('0x2a')](function(_0x2cc0f2){if(_0x1ab2c8[_0x8914('0x66')]){return _[_0x8914('0x37')](_0x574896,function(_0x3d84c4){if(_0x3d84c4[_0x8914('0x5c')]===0x709){_0x3d84c4[_0x8914('0x68')]=_0x2cc0f2;}return _0x3d84c4;});}else{var _0x4e877c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2cc0f2};var _0x146ce8=_['map'](_0x574896);_0x146ce8[_0x8914('0x63')](_0x4e877c);return _0x146ce8;}});}else{return;}})[_0x8914('0x2a')](function(_0x4abdc0){if(_0x4abdc0)_0x574896=_0x4abdc0;return _[_0x8914('0x44')](_0x574896,[_0x8914('0x66'),0x1]);})[_0x8914('0x2a')](respondWithResult(_0x426789,null))[_0x8914('0x4a')](handleError(_0x426789,null));};function hasDefaultDashboard(_0x4e5fe5){var _0x21c761=[0x65];return new BPromise(function(_0x559c1f,_0x4987d3){try{if(_0x4e5fe5[_0x8914('0x5a')]){_0x559c1f(_0x21c761);}else{return db['UserProfileResource'][_0x8914('0x69')]({'where':{'sectionId':_0x4e5fe5['id']},'raw':!![]})[_0x8914('0x2a')](function(_0x2019b7){_0x2019b7?_0x559c1f(_0x21c761):_0x559c1f();});}}catch(_0x5c74c8){_0x4987d3(_0x5c74c8);}});}function getCustomDashboards(_0x1d9752){var _0xf4b525=[];return new BPromise(function(_0x5bc0e6,_0x3c46f1){try{if(_0x1d9752['autoAssociation']){return db['Dashboard'][_0x8914('0x48')]({'raw':!![]})[_0x8914('0x2a')](function(_0x594c80){_0x594c80[_0x8914('0x6a')](function(_0x49f025){_0xf4b525[_0x8914('0x63')](_0x49f025['id']+0x1869f);});_0x5bc0e6(_0xf4b525);});}else{return db[_0x8914('0x5b')][_0x8914('0x48')]({'where':{'sectionId':_0x1d9752['id']},'raw':!![]})[_0x8914('0x2a')](function(_0x52ad37){_0x52ad37[_0x8914('0x6a')](function(_0x50c6a6){_0xf4b525[_0x8914('0x63')](_0x50c6a6['resourceId']+0x1869f);});_0x5bc0e6(_0xf4b525);});}}catch(_0x58fca4){_0x3c46f1(_0x58fca4);}});}function getPlugins(_0x1aca38){var _0x1c2883=[];return new BPromise(function(_0x17243e,_0x488d9c){try{if(_0x1aca38['autoAssociation']){return db['Plugin'][_0x8914('0x48')]({'raw':!![]})[_0x8914('0x2a')](function(_0x527233){_0x527233['forEach'](function(_0x185dc3){_0x1c2883[_0x8914('0x63')](_0x185dc3['id']+0x15b38);});_0x17243e(_0x1c2883);});}else{return db[_0x8914('0x5b')]['findAll']({'where':{'sectionId':_0x1aca38['id']},'raw':!![]})[_0x8914('0x2a')](function(_0x4e3644){_0x4e3644[_0x8914('0x6a')](function(_0x1144b3){_0x1c2883[_0x8914('0x63')](_0x1144b3[_0x8914('0x6b')]+0x15b38);});_0x17243e(_0x1c2883);});}}catch(_0x2475c6){_0x488d9c(_0x2475c6);}});}exports[_0x8914('0x6c')]=function(_0x51d006,_0x14d3e6){return db[_0x8914('0x31')]['find']({'where':{'id':_0x51d006[_0x8914('0x51')]['id']}})['then'](handleEntityNotFound(_0x14d3e6,null))[_0x8914('0x2a')](function(_0x357a2f){if(_0x357a2f){return db[_0x8914('0x62')]['transaction'](function(_0x16dfc1){return db[_0x8914('0x58')]['findAll']({'where':{'userProfileId':_0x51d006['params']['id']},'attributes':['id'],'raw':!![]})[_0x8914('0x2a')](function(_0x837365){if(_0x837365){return db[_0x8914('0x58')]['destroy']({'where':{'userProfileId':_0x51d006[_0x8914('0x51')]['id'],'id':_[_0x8914('0x37')](_0x837365,function(_0x1f45bf){return _0x1f45bf['id'];})},'transaction':_0x16dfc1});}})[_0x8914('0x2a')](function(_0x15a599){var _0x2d3178=_[_0x8914('0x37')](_0x51d006['body'],function(_0xf26c7f){_0xf26c7f[_0x8914('0x5d')]=_0x51d006[_0x8914('0x51')]['id'];return _0xf26c7f;});return db[_0x8914('0x58')][_0x8914('0x6d')](_0x2d3178,{'raw':!![],'transaction':_0x16dfc1});})[_0x8914('0x2a')](function(_0x2b68cd){var _0xf1cd85=_['filter'](_['map'](_0x2b68cd,function(_0x1c05bc){return _0x1c05bc[_0x8914('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0xf1cd85){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x51d006[_0x8914('0x51')]['id'],'sectionId':_[_0x8914('0x37')](_0xf1cd85,function(_0x254cce){return _0x254cce[_0x8914('0x5c')];})},'attributes':['id',_0x8914('0x5c')],'raw':!![]})[_0x8914('0x2a')](function(_0x5f0a68){var _0x56181d=_['map'](_0x51d006['body'],function(_0x2af9dd){_0x2af9dd[_0x8914('0x5d')]=_0x51d006[_0x8914('0x51')]['id'];return _0x2af9dd;});return db[_0x8914('0x5b')][_0x8914('0x6d')](_0x56181d,{'raw':!![],'transaction':_0x16dfc1});});}})[_0x8914('0x4a')](handleError(_0x14d3e6,null));});}})['then'](function(_0x2b8f15){var _0x129811=_[_0x8914('0x37')](_0x2b8f15,function(_0x3c0abd){return _0x3c0abd[_0x8914('0x52')]({'plain':!![]});});})[_0x8914('0x2a')](respondWithResult(_0x14d3e6,null))['catch'](handleError(_0x14d3e6,null));};exports['removeResources']=function(_0x525bf0,_0xbd54c7,_0x3fe2ed){return db[_0x8914('0x31')][_0x8914('0x4e')]({'where':{'id':_0x525bf0[_0x8914('0x51')]['id']}})[_0x8914('0x2a')](handleEntityNotFound(_0xbd54c7,null))[_0x8914('0x2a')](function(_0x20a8c9){if(_0x20a8c9){return _0x20a8c9[_0x8914('0x6e')](_0x525bf0[_0x8914('0x38')][_0x8914('0x6f')]);}})[_0x8914('0x2a')](respondWithStatusCode(_0xbd54c7,null))['catch'](handleError(_0xbd54c7,null));};exports['getResources']=function(_0x93b115,_0x3f47ed){var _0x2269fa={};if(!_0x93b115[_0x8914('0x38')][_0x8914('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x93b115[_0x8914('0x38')][_0x8914('0x71')](_0x8914('0x3e'))){_0x2269fa[_0x8914('0x24')]=qs[_0x8914('0x24')](_0x93b115['query'][_0x8914('0x24')]);_0x2269fa[_0x8914('0x22')]=qs[_0x8914('0x22')](_0x93b115[_0x8914('0x38')][_0x8914('0x22')]);}return db[_0x8914('0x31')]['find']({'where':{'id':_0x93b115[_0x8914('0x51')]['id']}})[_0x8914('0x2a')](function(_0xe6fdeb){if(!_0xe6fdeb)throw new Error(_0x8914('0x72')+_0x93b115[_0x8914('0x51')]['id']);return db[_0x8914('0x31')][_0x8914('0x73')](_0x93b115);})['then'](respondWithFilteredResult(_0x3f47ed,_0x2269fa))['catch'](handleError(_0x3f47ed,null));}; \ No newline at end of file +var _0xe98f=['eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','catch','create','clone','options','get','createdAt','body','omit','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20'];(function(_0x342411,_0x2b57a7){var _0x1dc327=function(_0x460e15){while(--_0x460e15){_0x342411['push'](_0x342411['shift']());}};_0x1dc327(++_0x2b57a7);}(_0xe98f,0xde));var _0xfe98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];config[_0xfe98('0x16')]=_['defaults'](config[_0xfe98('0x16')],{'host':_0xfe98('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe98('0x16')]));require('./userProfile.socket')[_0xfe98('0x18')](socket);function respondWithStatusCode(_0x3386de,_0x1b2155){_0x1b2155=_0x1b2155||0xcc;return function(_0x15e6b7){if(_0x15e6b7){return _0x3386de['sendStatus'](_0x1b2155);}return _0x3386de[_0xfe98('0x19')](_0x1b2155)['end']();};}function respondWithResult(_0x416c4c,_0x8c527c){_0x8c527c=_0x8c527c||0xc8;return function(_0x20d565){if(_0x20d565){return _0x416c4c[_0xfe98('0x19')](_0x8c527c)['json'](_0x20d565);}};}function respondWithFilteredResult(_0x56c0f4,_0x41dca9){return function(_0x26ad78){if(_0x26ad78){var _0x31bb37=typeof _0x41dca9['offset']===_0xfe98('0x1a')&&typeof _0x41dca9[_0xfe98('0x1b')]===_0xfe98('0x1a');var _0x40f0b1=_0x26ad78[_0xfe98('0x1c')];var _0x6d2220=_0x31bb37?0x0:_0x41dca9[_0xfe98('0x1d')];var _0x5cbdb0=_0x31bb37?_0x26ad78[_0xfe98('0x1c')]:_0x41dca9['offset']+_0x41dca9[_0xfe98('0x1b')];var _0x51d257;if(_0x5cbdb0>=_0x40f0b1){_0x5cbdb0=_0x40f0b1;_0x51d257=0xc8;}else{_0x51d257=0xce;}_0x56c0f4['status'](_0x51d257);return _0x56c0f4[_0xfe98('0x1e')](_0xfe98('0x1f'),_0x6d2220+'-'+_0x5cbdb0+'/'+_0x40f0b1)[_0xfe98('0x20')](_0x26ad78);}return null;};}function patchUpdates(_0xc3c06a){return function(_0x59e3ff){try{jsonpatch[_0xfe98('0x21')](_0x59e3ff,_0xc3c06a,!![]);}catch(_0x4b808c){return BPromise[_0xfe98('0x22')](_0x4b808c);}return _0x59e3ff[_0xfe98('0x23')]();};}function saveUpdates(_0xb628ed,_0x59fbde){return function(_0x52a381){if(_0x52a381){return _0x52a381[_0xfe98('0x24')](_0xb628ed)['then'](function(_0x7b629e){return _0x7b629e;});}return null;};}function removeEntity(_0x2c9323,_0x4d17b7){return function(_0x3dc31d){if(_0x3dc31d){return _0x3dc31d[_0xfe98('0x25')]()[_0xfe98('0x26')](function(){_0x2c9323[_0xfe98('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e40f0,_0x5921f0){return function(_0x51da63){if(!_0x51da63){_0x4e40f0[_0xfe98('0x27')](0x194);}return _0x51da63;};}function handleError(_0x221d7c,_0x3e8723){_0x3e8723=_0x3e8723||0x1f4;return function(_0x21c730){logger[_0xfe98('0x28')](_0x21c730[_0xfe98('0x29')]);if(_0x21c730[_0xfe98('0x2a')]){delete _0x21c730[_0xfe98('0x2a')];}_0x221d7c[_0xfe98('0x19')](_0x3e8723)[_0xfe98('0x2b')](_0x21c730);};}exports['index']=function(_0x1bed97,_0x1c56e5){var _0x9eb9c9={},_0x4507be={},_0x3094df={'count':0x0,'rows':[]};var _0x20ae5d=_[_0xfe98('0x2c')](db[_0xfe98('0x2d')][_0xfe98('0x2e')],function(_0xaf782){return{'name':_0xaf782[_0xfe98('0x2f')],'type':_0xaf782[_0xfe98('0x30')][_0xfe98('0x31')]};});_0x4507be[_0xfe98('0x32')]=_[_0xfe98('0x2c')](_0x20ae5d,'name');_0x4507be['query']=_[_0xfe98('0x33')](_0x1bed97[_0xfe98('0x34')]);_0x4507be['filters']=_[_0xfe98('0x35')](_0x4507be[_0xfe98('0x32')],_0x4507be[_0xfe98('0x34')]);_0x9eb9c9[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0x4507be['model'],qs[_0xfe98('0x37')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x37')]));_0x9eb9c9[_0xfe98('0x36')]=_0x9eb9c9[_0xfe98('0x36')]['length']?_0x9eb9c9[_0xfe98('0x36')]:_0x4507be['model'];if(!_0x1bed97[_0xfe98('0x34')][_0xfe98('0x38')](_0xfe98('0x39'))){_0x9eb9c9[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x1b')]);_0x9eb9c9[_0xfe98('0x1d')]=qs['offset'](_0x1bed97['query'][_0xfe98('0x1d')]);}_0x9eb9c9[_0xfe98('0x3a')]=qs[_0xfe98('0x3b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3b')]);_0x9eb9c9['where']=qs[_0xfe98('0x3c')](_[_0xfe98('0x3d')](_0x1bed97[_0xfe98('0x34')],_0x4507be['filters']),_0x20ae5d);if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3e')]){_0x9eb9c9[_0xfe98('0x3f')]=_[_0xfe98('0x40')](_0x9eb9c9['where'],{'$or':_[_0xfe98('0x2c')](_0x20ae5d,function(_0x3abd5d){if(_0x3abd5d['type']!==_0xfe98('0x41')){var _0x14afbc={};_0x14afbc[_0x3abd5d[_0xfe98('0x2a')]]={'$like':'%'+_0x1bed97['query']['filter']+'%'};return _0x14afbc;}})});}_0x9eb9c9=_['merge']({},_0x9eb9c9,_0x1bed97['options']);var _0x2b796a={'where':_0x9eb9c9['where']};return db[_0xfe98('0x2d')][_0xfe98('0x1c')](_0x2b796a)['then'](function(_0x43b085){_0x3094df[_0xfe98('0x1c')]=_0x43b085;if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x42')]){_0x9eb9c9[_0xfe98('0x43')]=[{'all':!![]}];}return db[_0xfe98('0x2d')][_0xfe98('0x44')](_0x9eb9c9);})[_0xfe98('0x26')](function(_0x5dae05){_0x3094df[_0xfe98('0x45')]=_0x5dae05;return _0x3094df;})[_0xfe98('0x26')](respondWithFilteredResult(_0x1c56e5,_0x9eb9c9))['catch'](handleError(_0x1c56e5,null));};exports[_0xfe98('0x46')]=function(_0xd2cc2e,_0x575ff3){var _0x36643c={'raw':![],'where':{'id':_0xd2cc2e[_0xfe98('0x47')]['id']}},_0x50ccd7={};_0x50ccd7['model']=_[_0xfe98('0x33')](db[_0xfe98('0x2d')][_0xfe98('0x2e')]);_0x50ccd7[_0xfe98('0x34')]=_['keys'](_0xd2cc2e[_0xfe98('0x34')]);_0x50ccd7[_0xfe98('0x3c')]=_[_0xfe98('0x35')](_0x50ccd7[_0xfe98('0x32')],_0x50ccd7[_0xfe98('0x34')]);_0x36643c[_0xfe98('0x36')]=_['intersection'](_0x50ccd7[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x37')]));_0x36643c[_0xfe98('0x36')]=_0x36643c[_0xfe98('0x36')][_0xfe98('0x48')]?_0x36643c['attributes']:_0x50ccd7[_0xfe98('0x32')];if(_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x42')]){_0x36643c[_0xfe98('0x43')]=[{'all':!![]}];}_0x36643c=_[_0xfe98('0x40')]({},_0x36643c,_0xd2cc2e['options']);return db[_0xfe98('0x2d')]['find'](_0x36643c)[_0xfe98('0x26')](handleEntityNotFound(_0x575ff3,null))[_0xfe98('0x26')](respondWithResult(_0x575ff3,null))[_0xfe98('0x49')](handleError(_0x575ff3,null));};exports[_0xfe98('0x4a')]=function(_0x27b100,_0x475394){return db[_0xfe98('0x2d')][_0xfe98('0x4a')](_0x27b100['body'],{})[_0xfe98('0x26')](respondWithResult(_0x475394,0xc9))[_0xfe98('0x49')](handleError(_0x475394,null));};exports[_0xfe98('0x4b')]=function(_0x1720d3,_0x5ad61e){var _0x26cb3d={'where':{'id':_0x1720d3[_0xfe98('0x47')]['id']}},_0xc0573c={};_0xc0573c[_0xfe98('0x32')]=_[_0xfe98('0x33')](db[_0xfe98('0x2d')]['rawAttributes']);_0x26cb3d[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0xc0573c[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0x1720d3[_0xfe98('0x34')]['fields']));_0x26cb3d['attributes']=_0x26cb3d[_0xfe98('0x36')][_0xfe98('0x48')]?_0x26cb3d[_0xfe98('0x36')]:_0xc0573c[_0xfe98('0x32')];if(_0x1720d3[_0xfe98('0x34')][_0xfe98('0x42')]){_0x26cb3d[_0xfe98('0x43')]=[{'all':!![]}];}_0x26cb3d=_[_0xfe98('0x40')]({},_0x26cb3d,_0x1720d3[_0xfe98('0x4c')]);return db[_0xfe98('0x2d')]['find'](_0x26cb3d)[_0xfe98('0x26')](handleEntityNotFound(_0x5ad61e,null))['then'](function(_0x29eff4){if(_0x29eff4){var _0x278839=_0x29eff4[_0xfe98('0x4d')]({'plain':!![]});_0x278839=qs['omit'](_0x278839,['id',_0xfe98('0x4e'),'updatedAt','crudPermissions']);_0x1720d3[_0xfe98('0x4f')]=_[_0xfe98('0x50')](_0x1720d3[_0xfe98('0x4f')],['id',_0xfe98('0x4e'),_0xfe98('0x51')]);return db[_0xfe98('0x52')]['transaction'](function(_0x23e897){return db['UserProfile'][_0xfe98('0x4a')](_['merge'](_0x278839,_0x1720d3['body']),{'include':_0x1720d3['query'][_0xfe98('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x23e897})[_0xfe98('0x26')](function(_0x2b50c8){var _0x448025=_0x2b50c8['get']({'plain':!![]});return db[_0xfe98('0x53')]['findAll']({'where':{'userProfileId':_0x1720d3[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5b2132){if(_0x5b2132){return BPromise[_0xfe98('0x54')](_0x5b2132,function(_0x6299e9){return new BPromise(function(_0xc2cc1b,_0x4753d2){if(_0x6299e9['autoAssociation']===null||_0x6299e9[_0xfe98('0x55')]===0x1)_0xc2cc1b(null);return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x6299e9['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x4ab9c4){var _0x4192e0=_['map'](_0x4ab9c4,function(_0x7ca5b9){return qs[_0xfe98('0x50')](_0x7ca5b9,['id',_0xfe98('0x4e'),_0xfe98('0x51'),_0xfe98('0x57')]);});_0xc2cc1b(_0x4192e0);})[_0xfe98('0x49')](function(_0x4435d1){_0x4753d2(_0x4435d1);});})[_0xfe98('0x26')](function(_0x36a92f){var _0x3b8626=qs[_0xfe98('0x50')](_0x6299e9,['id',_0xfe98('0x4e'),_0xfe98('0x51')]);_0x3b8626['userProfileId']=_0x448025['id'];if(_0x36a92f)_0x3b8626[_0xfe98('0x58')]=_0x36a92f;return _0x3b8626;})['then'](function(_0x52befb){return db[_0xfe98('0x53')]['create'](_0x52befb,{'include':[{'model':db[_0xfe98('0x56')],'as':_0xfe98('0x58')}],'raw':!![],'transaction':_0x23e897});});})[_0xfe98('0x26')](function(){return _0x448025;});}});});});}})[_0xfe98('0x26')](respondWithResult(_0x5ad61e,0xc9))[_0xfe98('0x49')](handleError(_0x5ad61e,null));};exports[_0xfe98('0x24')]=function(_0x46a8fb,_0x1b5436){if(_0x46a8fb[_0xfe98('0x4f')]['id']){delete _0x46a8fb[_0xfe98('0x4f')]['id'];}return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x46a8fb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x1b5436,null))[_0xfe98('0x26')](saveUpdates(_0x46a8fb[_0xfe98('0x4f')],null))[_0xfe98('0x26')](respondWithResult(_0x1b5436,null))['catch'](handleError(_0x1b5436,null));};exports[_0xfe98('0x25')]=function(_0xaa3d51,_0x2b827d){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0xaa3d51[_0xfe98('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b827d,null))[_0xfe98('0x26')](removeEntity(_0x2b827d,null))[_0xfe98('0x49')](handleError(_0x2b827d,null));};exports[_0xfe98('0x5a')]=function(_0x363584,_0x2d195e){return db[_0xfe98('0x2d')][_0xfe98('0x5a')]()['then'](respondWithResult(_0x2d195e,null))[_0xfe98('0x49')](handleError(_0x2d195e,null));};exports[_0xfe98('0x5b')]=function(_0x1ecaeb,_0x351129){var _0x3d9113=_0x1ecaeb[_0xfe98('0x4f')];return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x1ecaeb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x351129,null))[_0xfe98('0x26')](function(_0x2516e5){if(_0x2516e5){return db[_0xfe98('0x52')][_0xfe98('0x5c')](function(_0x1f0bc3){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x1ecaeb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x3d9113,function(_0x3c14d9){return _0x3c14d9[_0xfe98('0x57')];})},'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(){var _0x25c207=_[_0xfe98('0x2c')](_0x3d9113,function(_0xa5c1a7){_0xa5c1a7[_0xfe98('0x5d')]=_0x1ecaeb[_0xfe98('0x47')]['id'];return _0xa5c1a7;});var _0x59bcb0=[];return BPromise['each'](_0x25c207,function(_0x2683f2){return db[_0xfe98('0x53')][_0xfe98('0x4a')](_0x2683f2,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(_0x539e83){_0x59bcb0[_0xfe98('0x5e')](_0x539e83[_0xfe98('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x59bcb0;});});});}})[_0xfe98('0x26')](function(_0x4418e8){return _0x4418e8;})[_0xfe98('0x26')](respondWithResult(_0x351129,null))[_0xfe98('0x49')](handleError(_0x351129,null));};exports[_0xfe98('0x5f')]=function(_0x308b99,_0x271c09){var _0xc89e3a;return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x308b99[_0xfe98('0x47')]['id']},'attributes':['id','name']})[_0xfe98('0x26')](handleEntityNotFound(_0x271c09,null))[_0xfe98('0x26')](function(_0x2bd663){if(_0x2bd663){_0xc89e3a=_0x2bd663;return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x308b99[_0xfe98('0x47')]['id'],'sectionId':_0x308b99[_0xfe98('0x34')][_0xfe98('0x60')]}});}})[_0xfe98('0x26')](function(){return _0xc89e3a;})[_0xfe98('0x26')](respondWithStatusCode(_0x271c09,null))[_0xfe98('0x49')](handleError(_0x271c09,null));};exports[_0xfe98('0x61')]=function(_0x471499,_0x5c8015){var _0x4b5be5=[];var _0x454a42=[];return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x471499[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x1921b4){_0x4b5be5=_[_0xfe98('0x3e')](_0x1921b4,function(_0x1b97bb){return _0x1b97bb[_0xfe98('0x62')]===0x1||_[_0xfe98('0x63')]([0x3eb,0x709],_0x1b97bb[_0xfe98('0x57')]);});if(!_[_0xfe98('0x64')](_0x4b5be5)){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x27f70e){return _0x27f70e[_0xfe98('0x57')];});}else{return;}})[_0xfe98('0x26')](function(_0x57756e){if(_0x57756e)_0x454a42=_0x57756e;if(_[_0xfe98('0x63')](_0x454a42,0x64)){var _0x9433b9=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x64});return hasDefaultDashboard(_0x9433b9)['then'](function(_0x180cff){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x1de511){if(_0x1de511[_0xfe98('0x57')]===0x64){_0x1de511[_0xfe98('0x65')]=_0x180cff;}return _0x1de511;});});}else{return;}})['then'](function(_0x548b82){if(_0x548b82)_0x4b5be5=_0x548b82;if(_[_0xfe98('0x63')](_0x454a42,0x3eb)){var _0x17141c=_['find'](_0x4b5be5,{'sectionId':0x3eb});return getCustomDashboards(_0x17141c)['then'](function(_0x4a686d){return _['map'](_0x4b5be5,function(_0x1382e2){if(_0x17141c[_0xfe98('0x62')]){if(_0x1382e2[_0xfe98('0x57')]===0x3eb){_0x1382e2['subsections']=_0x4a686d;}}else{if(_0x1382e2[_0xfe98('0x57')]===0x64){_0x1382e2[_0xfe98('0x65')]=_0x4a686d;}}return _0x1382e2;});});}else{return;}})[_0xfe98('0x26')](function(_0x2c039e){if(_0x2c039e)_0x4b5be5=_0x2c039e;if(_[_0xfe98('0x63')](_0x454a42,0x709)){var _0x131240=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x709});return getPlugins(_0x131240)['then'](function(_0x47b756){if(_0x131240['enabled']){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x35290b){if(_0x35290b[_0xfe98('0x57')]===0x709){_0x35290b[_0xfe98('0x65')]=_0x47b756;}return _0x35290b;});}else{var _0x425576={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47b756};var _0xfc79a1=_[_0xfe98('0x2c')](_0x4b5be5);_0xfc79a1[_0xfe98('0x5e')](_0x425576);return _0xfc79a1;}});}else{return;}})['then'](function(_0x5df11e){if(_0x5df11e)_0x4b5be5=_0x5df11e;return _['filter'](_0x4b5be5,['enabled',0x1]);})[_0xfe98('0x26')](respondWithResult(_0x5c8015,null))[_0xfe98('0x49')](handleError(_0x5c8015,null));};function hasDefaultDashboard(_0x14e2e4){var _0x3153f0=[0x65];return new BPromise(function(_0x2de027,_0x19385b){try{if(_0x14e2e4['autoAssociation']){_0x2de027(_0x3153f0);}else{return db[_0xfe98('0x56')][_0xfe98('0x66')]({'where':{'sectionId':_0x14e2e4['id']},'raw':!![]})['then'](function(_0x4a9028){_0x4a9028?_0x2de027(_0x3153f0):_0x2de027();});}}catch(_0xd5b171){_0x19385b(_0xd5b171);}});}function getCustomDashboards(_0x11ba08){var _0x573815=[];return new BPromise(function(_0x8223f1,_0xed4caa){try{if(_0x11ba08['autoAssociation']){return db[_0xfe98('0x67')]['findAll']({'raw':!![]})[_0xfe98('0x26')](function(_0x376c8f){_0x376c8f[_0xfe98('0x68')](function(_0x234b80){_0x573815['push'](_0x234b80['id']+0x1869f);});_0x8223f1(_0x573815);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x11ba08['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5919f1){_0x5919f1[_0xfe98('0x68')](function(_0x406758){_0x573815['push'](_0x406758[_0xfe98('0x69')]+0x1869f);});_0x8223f1(_0x573815);});}}catch(_0x4733d3){_0xed4caa(_0x4733d3);}});}function getPlugins(_0x51c65b){var _0xc6421f=[];return new BPromise(function(_0x4d9e98,_0x3e140f){try{if(_0x51c65b[_0xfe98('0x55')]){return db[_0xfe98('0x6a')][_0xfe98('0x44')]({'raw':!![]})['then'](function(_0x4f8099){_0x4f8099['forEach'](function(_0x10454b){_0xc6421f[_0xfe98('0x5e')](_0x10454b['id']+0x15b38);});_0x4d9e98(_0xc6421f);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x51c65b['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x147b1e){_0x147b1e[_0xfe98('0x68')](function(_0x4fe8cb){_0xc6421f[_0xfe98('0x5e')](_0x4fe8cb[_0xfe98('0x69')]+0x15b38);});_0x4d9e98(_0xc6421f);});}}catch(_0xd367d9){_0x3e140f(_0xd367d9);}});}exports['addResources']=function(_0x2ad8bb,_0x481789){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x2ad8bb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x481789,null))['then'](function(_0x5165bc){if(_0x5165bc){return db[_0xfe98('0x52')]['transaction'](function(_0x361c00){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xfe98('0x26')](function(_0x1a5d43){if(_0x1a5d43){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'id':_[_0xfe98('0x2c')](_0x1a5d43,function(_0x17470a){return _0x17470a['id'];})},'transaction':_0x361c00});}})['then'](function(_0xd58077){var _0x5b1421=_[_0xfe98('0x2c')](_0x2ad8bb['body'],function(_0x1d2873){_0x1d2873[_0xfe98('0x5d')]=_0x2ad8bb[_0xfe98('0x47')]['id'];return _0x1d2873;});return db[_0xfe98('0x53')][_0xfe98('0x6b')](_0x5b1421,{'raw':!![],'transaction':_0x361c00});})['then'](function(_0x1befdb){var _0x8ecf07=_['filter'](_[_0xfe98('0x2c')](_0x1befdb,function(_0x416705){return _0x416705[_0xfe98('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x8ecf07){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x8ecf07,function(_0x40714b){return _0x40714b['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xfe98('0x26')](function(_0x4d7a13){var _0x1be023=_[_0xfe98('0x2c')](_0x2ad8bb[_0xfe98('0x4f')],function(_0x11cf80){_0x11cf80['userProfileId']=_0x2ad8bb['params']['id'];return _0x11cf80;});return db[_0xfe98('0x56')]['bulkCreate'](_0x1be023,{'raw':!![],'transaction':_0x361c00});});}})['catch'](handleError(_0x481789,null));});}})[_0xfe98('0x26')](function(_0x5cd22f){var _0x3cf1a2=_[_0xfe98('0x2c')](_0x5cd22f,function(_0x2dc3ae){return _0x2dc3ae[_0xfe98('0x4d')]({'plain':!![]});});})[_0xfe98('0x26')](respondWithResult(_0x481789,null))['catch'](handleError(_0x481789,null));};exports[_0xfe98('0x6c')]=function(_0x3a53c1,_0x3f9b11,_0x1efc1a){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x3a53c1['params']['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x3f9b11,null))[_0xfe98('0x26')](function(_0x250eb2){if(_0x250eb2){return _0x250eb2[_0xfe98('0x6c')](_0x3a53c1[_0xfe98('0x34')][_0xfe98('0x60')]);}})[_0xfe98('0x26')](respondWithStatusCode(_0x3f9b11,null))['catch'](handleError(_0x3f9b11,null));};exports[_0xfe98('0x6d')]=function(_0x233182,_0x148e11){var _0x37f452={};if(!_0x233182['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x233182['query'][_0xfe98('0x38')](_0xfe98('0x39'))){_0x37f452[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x233182['query']['limit']);_0x37f452[_0xfe98('0x1d')]=qs[_0xfe98('0x1d')](_0x233182[_0xfe98('0x34')][_0xfe98('0x1d')]);}return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x233182[_0xfe98('0x47')]['id']}})['then'](function(_0x3bc6fb){if(!_0x3bc6fb)throw new Error(_0xfe98('0x6e')+_0x233182[_0xfe98('0x47')]['id']);return db[_0xfe98('0x2d')][_0xfe98('0x6d')](_0x233182);})[_0xfe98('0x26')](respondWithFilteredResult(_0x148e11,_0x37f452))['catch'](handleError(_0x148e11,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a7be7b5..469b642 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 _0x6db4=['emit','hasOwnProperty','hook','../../mysqldb','UserProfile','setMaxListeners','save','update','remove'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x6db4,0x111));var _0x46db=function(_0x3c7da9,_0x4bb209){_0x3c7da9=_0x3c7da9-0x0;var _0x5bcbae=_0x6db4[_0x3c7da9];return _0x5bcbae;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x46db('0x0'))['db'][_0x46db('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x46db('0x2')](0x0);var events={'afterCreate':_0x46db('0x3'),'afterUpdate':_0x46db('0x4'),'afterDestroy':_0x46db('0x5')};function emitEvent(_0x5a9b9c){return function(_0x476ef3,_0x8e4cd8,_0x2a762b){UserProfileEvents[_0x46db('0x6')](_0x5a9b9c+':'+_0x476ef3['id'],_0x476ef3);UserProfileEvents[_0x46db('0x6')](_0x5a9b9c,_0x476ef3);_0x2a762b(null);};}for(var e in events){if(events[_0x46db('0x7')](e)){var event=events[e];UserProfile[_0x46db('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xe2fe=['exports','events','setMaxListeners','update','remove','emit','hook'];(function(_0x4f08b0,_0x337546){var _0x10659b=function(_0x5a1e20){while(--_0x5a1e20){_0x4f08b0['push'](_0x4f08b0['shift']());}};_0x10659b(++_0x337546);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xee2f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xee2f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee2f('0x2'),'afterDestroy':_0xee2f('0x3')};function emitEvent(_0xe5ad8a){return function(_0x2d2b03,_0xcb45e6,_0x4ba89f){UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a+':'+_0x2d2b03['id'],_0x2d2b03);UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a,_0x2d2b03);_0x4ba89f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xee2f('0x5')](e,emitEvent(event));}}module[_0xee2f('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ed75c31..a9133c3 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 _0x781d=['resourceId','type','catch','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','parentSections','ListId','CmList','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','Pause','scheduler','Schedule','Sound','tags','templates','Template','Trigger','Trunk','variables','Variable','plugins','extractedreports','reportId','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','all','ignore','autoAssociation','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','reportType','count','rows','CmContact','Tag','Tags','color','tag','ThroughTags','include','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','exports','models','filter','field','value','then','associatedResources','map','model','findAll','name','resolve','UserProfileResource','AnalyticExtractedReport'];(function(_0x372002,_0xb10ad7){var _0x2fd6cf=function(_0x2755be){while(--_0x2755be){_0x372002['push'](_0x372002['shift']());}};_0x2fd6cf(++_0xb10ad7);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd781('0x0'));var attributes=require(_0xd781('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0xd781('0x2')]=function(_0x44a72d){var _0x3cd308=_0x44a72d[_0xd781('0x3')];function _0xfd915d(_0x42258e,_0x446534){return new Promise(function(_0x1d4f4e,_0x830b){if(!_0x446534)return _0x1d4f4e(null);var _0x2f98ee=_0x446534['filter']?{[_0x446534[_0xd781('0x4')][_0xd781('0x5')]]:_0x446534[_0xd781('0x4')][_0xd781('0x6')]}:undefined;return _0x3cd308[_0x42258e]['findAll']({'where':_0x2f98ee,'raw':!![]})[_0xd781('0x7')](function(_0x5c18c8){_0x446534[_0xd781('0x8')]=_[_0xd781('0x9')](_0x5c18c8,'id');_0x1d4f4e(_0x446534);})['catch'](function(_0x346756){_0x830b(_0x346756);});});}function _0x29c2a7(_0x4bf265,_0x4c2aab){return new Promise(function(_0x40a900,_0x28b74c){var _0x36f086=_0x4bf265[_0xd781('0x4')]?{[_0x4bf265[_0xd781('0x4')][_0xd781('0x5')]]:_0x4bf265[_0xd781('0x4')][_0xd781('0x6')]}:undefined;return _0x3cd308[_0x4bf265[_0xd781('0xa')]][_0xd781('0xb')]({'where':_0x36f086,'raw':!![]})[_0xd781('0x7')](function(_0x587953){_0x4c2aab[_0xd781('0x8')]=_[_0xd781('0x9')](_0x587953,function(_0x498674){return _0x498674[_0xd781('0xc')];});_0x40a900(_0x4c2aab);})['catch'](function(_0x294e5a){_0x28b74c(_0x294e5a);});});}function _0x22d787(_0x9f25f7,_0x1409dd,_0x42a9c1){if(!_0x1409dd)return Promise[_0xd781('0xd')](null);return new Promise(function(_0x501b0d,_0x5770b0){return _0x3cd308[_0xd781('0xe')][_0xd781('0xb')]({'where':{'sectionId':_0x1409dd['id']},'raw':!![]})[_0xd781('0x7')](function(_0x2f1273){if(_0x9f25f7[_0xd781('0x5')]&&_0x9f25f7[_0xd781('0x5')]!=='id'){_0x1409dd[_0xd781('0x8')]=_[_0xd781('0x9')](_0x2f1273,function(_0x5a5ff5){return _0x5a5ff5[_0x9f25f7[_0xd781('0x5')]];});}else{if(_0x42a9c1===_0xd781('0xf')){_0x1409dd[_0xd781('0x8')]=_[_0xd781('0x9')](_0x2f1273,function(_0x36d320){return{'id':_0x36d320[_0xd781('0x10')],'type':_0x36d320[_0xd781('0x11')]};});}else{_0x1409dd['associatedResources']=_[_0xd781('0x9')](_0x2f1273,function(_0x4e2c56){return _0x4e2c56['resourceId'];});}}_0x501b0d(_0x1409dd);})[_0xd781('0x12')](function(_0x568001){_0x5770b0(_0x568001);});});}function _0x175ba6(_0x101480,_0x395087){var _0x31bf57={'parentSections':[]};switch(_0x101480[_0xd781('0x13')]()){case _0xd781('0x14'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x16');break;case _0xd781('0x17'):_0x31bf57['childModel']='SquareOdbc';break;case _0xd781('0x18'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x19');_0x31bf57['parentSections']=[{'name':_0xd781('0x1a'),'field':'name','foreignKey':'projectName'}];break;case _0xd781('0x1b'):_0x31bf57['childModel']=_0xd781('0x1c');break;case _0xd781('0x1d'):_0x31bf57['childModel']='CmContact';_0x31bf57[_0xd781('0x1e')]=[{'name':'Lists','field':'id','foreignKey':_0xd781('0x1f')}];break;case'lists':_0x31bf57[_0xd781('0x15')]=_0xd781('0x20');break;case'companies':_0x31bf57['childModel']=_0xd781('0x21');break;case _0xd781('0x22'):_0x31bf57[_0xd781('0x15')]='CmCustomField';break;case'chatqueues':_0x31bf57[_0xd781('0x15')]=_0xd781('0x23');break;case _0xd781('0x24'):_0x31bf57['childModel']='ChatWebsite';break;case _0xd781('0x25'):_0x31bf57[_0xd781('0x15')]='FaxQueue';break;case _0xd781('0x26'):_0x31bf57[_0xd781('0x15')]='FaxAccount';break;case _0xd781('0x27'):case _0xd781('0x28'):case _0xd781('0x29'):_0x31bf57[_0xd781('0x15')]='VoiceExtension';break;case _0xd781('0x2a'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x2b');break;case _0xd781('0x2c'):_0x31bf57['childModel']=_0xd781('0x2d');break;case _0xd781('0x2e'):_0x31bf57['childModel']=_0xd781('0x2f');_0x31bf57['parentSections']=[{'name':_0xd781('0x30'),'field':_0xd781('0xc'),'foreignKey':'membername','model':_0xd781('0x31'),'filter':{'field':_0xd781('0x32'),'value':['agent']}},{'name':_0xd781('0x33'),'field':'name','foreignKey':_0xd781('0x34'),'model':_0xd781('0x31'),'filter':{'field':'role','value':[_0xd781('0x35')]}},{'name':_0xd781('0x36'),'field':'name','foreignKey':_0xd781('0x37'),'model':_0xd781('0x38'),'filter':{'field':_0xd781('0x11'),'value':['inbound']}},{'name':_0xd781('0x39'),'field':_0xd781('0xc'),'foreignKey':_0xd781('0x37'),'model':_0xd781('0x38'),'filter':{'field':_0xd781('0x11'),'value':[_0xd781('0x3a')]}}];break;case _0xd781('0x3b'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x3c');break;case'chanspies':_0x31bf57[_0xd781('0x15')]='VoiceChanSpy';break;case _0xd781('0x3d'):_0x31bf57[_0xd781('0x15')]='VoicePrefix';break;case _0xd781('0x3e'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x3f');break;case _0xd781('0x40'):_0x31bf57['childModel']=_0xd781('0x41');break;case'mailaccounts':_0x31bf57[_0xd781('0x15')]=_0xd781('0x42');break;case'mailsubstatuses':_0x31bf57['childModel']=_0xd781('0x43');break;case _0xd781('0x44'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x45');break;case'openchannelaccounts':_0x31bf57[_0xd781('0x15')]=_0xd781('0x46');break;case'smsqueues':_0x31bf57['childModel']=_0xd781('0x47');break;case _0xd781('0x48'):_0x31bf57[_0xd781('0x15')]='SmsAccount';break;case'whatsappqueues':_0x31bf57[_0xd781('0x15')]=_0xd781('0x49');break;case _0xd781('0x4a'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x4b');break;case _0xd781('0x4c'):_0x31bf57['childModel']='Team';break;case _0xd781('0x4d'):case _0xd781('0x4e'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x38');if(_0x395087){_0x31bf57[_0xd781('0x1e')]=[{'name':'VoiceQueues'},{'name':_0xd781('0x39')}];}break;case _0xd781('0x4f'):case _0xd781('0x50'):case'telephones':_0x31bf57[_0xd781('0x15')]=_0xd781('0x31');if(_0x395087){_0x31bf57[_0xd781('0x1e')]=[{'name':'Users','filter':{'field':_0xd781('0x32'),'value':[_0xd781('0x51'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xd781('0x33')}];}break;case _0xd781('0x52'):_0x31bf57[_0xd781('0x15')]='ZendeskAccount';break;case _0xd781('0x53'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x54');break;case _0xd781('0x55'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x56');break;case _0xd781('0x57'):_0x31bf57['childModel']=_0xd781('0x58');break;case _0xd781('0x59'):_0x31bf57[_0xd781('0x15')]='DeskAccount';break;case _0xd781('0x5a'):_0x31bf57[_0xd781('0x15')]='ZohoAccount';break;case _0xd781('0x5b'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x31');break;case _0xd781('0x5c'):_0x31bf57[_0xd781('0x15')]='CannedAnswer';break;case _0xd781('0x5d'):_0x31bf57['childModel']=_0xd781('0x5e');break;case'customdashboards':_0x31bf57[_0xd781('0x15')]=_0xd781('0x5f');break;case'intervals':_0x31bf57[_0xd781('0x15')]='Interval';break;case'pauses':_0x31bf57['childModel']=_0xd781('0x60');break;case _0xd781('0x61'):_0x31bf57['childModel']=_0xd781('0x62');break;case'sounds':_0x31bf57[_0xd781('0x15')]=_0xd781('0x63');break;case _0xd781('0x64'):_0x31bf57[_0xd781('0x15')]='Tag';break;case _0xd781('0x65'):_0x31bf57['childModel']=_0xd781('0x66');break;case'triggers':_0x31bf57[_0xd781('0x15')]=_0xd781('0x67');break;case'trunks':_0x31bf57[_0xd781('0x15')]=_0xd781('0x68');break;case _0xd781('0x69'):_0x31bf57[_0xd781('0x15')]=_0xd781('0x6a');break;case _0xd781('0x6b'):_0x31bf57['childModel']='Plugin';break;case _0xd781('0x6c'):_0x31bf57[_0xd781('0x15')]=_0xd781('0xf');_0x31bf57[_0xd781('0x1e')]=[{'name':'Reports','field':'id','foreignKey':_0xd781('0x6d')}];break;case'metrics':_0x31bf57[_0xd781('0x15')]=_0xd781('0x6e');break;}return _0x31bf57;}function _0x5e527c(_0x2385fb,_0x4c8c50){var _0x53dae6=_0x2385fb[_0xd781('0x6f')](0x0)['toUpperCase']()+_0x2385fb[_0xd781('0x70')](0x1);var _0x1c9caa={'type':_0x3cd308[_0xd781('0x71')][_0xd781('0x72')][_0xd781('0x73')],'raw':!![]};return new Promise(function(_0x49b84f,_0x34bdba){var _0x1c0023=squel['select']()[_0xd781('0x5')](_0xd781('0x74')+_0x53dae6+_0xd781('0x75'),'id')[_0xd781('0x5')](_0xd781('0x76'))[_0xd781('0x77')](_0xd781('0x78')+_0x2385fb+_0xd781('0x79'),'ui')[_0xd781('0x7a')](_0xd781('0x7b'),_0x4c8c50['id']);return _0x3cd308[_0xd781('0x7c')][_0xd781('0x7d')](_0x1c0023[_0xd781('0x7e')](),_0x1c9caa)[_0xd781('0x7')](function(_0x42adc4){_0x4c8c50[_0x53dae6+_0xd781('0x7f')]=_0x42adc4;_0x49b84f(_0x42adc4);})[_0xd781('0x12')](function(_0x5e0774){_0x34bdba(_0x5e0774);});});}return _0x44a72d[_0xd781('0x80')](_0xd781('0x81'),attributes,{'tableName':_0xd781('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xfc428d){var _0x2d0273={'raw':![],'where':{}};var _0x5efb2b={};var _0x4cd0ad={'count':0x0,'rows':[]};var _0x645c0c=_0xfc428d['query']['section'];var _0x59eae7=_0xfc428d['query'][_0xd781('0x83')]||![];var _0x4bdeaa=_0x175ba6(_0x645c0c,_0x59eae7);if(!_0x4bdeaa[_0xd781('0x15')])throw new Error(_0xd781('0x84')+_0x645c0c+'\x27');var _0x98ea88=[{'name':_0x645c0c}];if(!_[_0xd781('0x85')](_0x4bdeaa[_0xd781('0x1e')]))_0x98ea88=_0x4bdeaa['parentSections'];var _0x3c830b=[];for(var _0x455117=0x0;_0x455117<_0x98ea88[_0xd781('0x86')];_0x455117++){_0x3c830b[_0xd781('0x87')](_0x3cd308[_0xd781('0x88')][_0xd781('0x89')]({'where':{'userProfileId':_0xfc428d['params']['id'],'name':_0x98ea88[_0x455117]['name']},'raw':!![]}));}return Promise[_0xd781('0x8a')](_0x3c830b)['then'](function(_0x246d0a){var _0x8d285b=_[_0xd781('0x4')](_0x246d0a,function(_0x2fe890){return _0x2fe890?_0x2fe890:undefined;});var _0x489d31=_[_0xd781('0x4')](_0x98ea88,[_0xd781('0x8b'),!![]]);var _0x13f964=_[_0xd781('0x85')](_0x8d285b)&&_[_0xd781('0x85')](_0x489d31)?null:_['union'](_0x489d31,_0x8d285b);if(!_0x13f964)return null;var _0x21479f=[];for(var _0x56fd1b=0x0;_0x56fd1b<_0x13f964[_0xd781('0x86')];_0x56fd1b++){var _0x327109=_['find'](_0x98ea88,function(_0x4d5c37){return _0x13f964[_0x56fd1b]?_0x4d5c37[_0xd781('0xc')]===_0x13f964[_0x56fd1b][_0xd781('0xc')]:null;});if(_0x327109){if(_0x13f964[_0x56fd1b][_0xd781('0x8b')]){_0x21479f[_0xd781('0x87')](_0xfd915d(_0x4bdeaa[_0xd781('0x15')],_0x13f964[_0x56fd1b]));}else{if(!_0x13f964[_0x56fd1b][_0xd781('0x8c')]){_0x21479f[_0xd781('0x87')](_0x22d787(_0x327109,_0x13f964[_0x56fd1b],_0x4bdeaa[_0xd781('0x15')]));}else{if(_0x327109[_0xd781('0xa')]){_0x21479f['push'](_0x29c2a7(_0x327109,_0x13f964[_0x56fd1b]));}}}}}return Promise[_0xd781('0x8a')](_0x21479f);})[_0xd781('0x7')](function(_0x4c712f){var _0x24e3f5=_0x4c712f;var _0x5bba63=null;if(_0x24e3f5){_0x5bba63=_0x24e3f5[_0xd781('0x86')]===0x1?_0x24e3f5[0x0]:null;}if(!_0x5bba63&&!_0x24e3f5)return _0x4cd0ad;var _0x2c4a8b=_0x3cd308[_0x4bdeaa['childModel']]['rawAttributes'];_0x5efb2b[_0xd781('0xa')]=_[_0xd781('0x8d')](_0x2c4a8b);_0x5efb2b[_0xd781('0x7d')]=_[_0xd781('0x8d')](_0xfc428d[_0xd781('0x7d')]);_0x5efb2b[_0xd781('0x8e')]=_['intersection'](_0x5efb2b[_0xd781('0xa')],_0x5efb2b[_0xd781('0x7d')]);_0x2d0273[_0xd781('0x8f')]=_[_0xd781('0x90')](_0x5efb2b[_0xd781('0xa')],qs[_0xd781('0x91')](_0xfc428d[_0xd781('0x7d')][_0xd781('0x91')]));_0x2d0273[_0xd781('0x8f')]=_0x2d0273[_0xd781('0x8f')][_0xd781('0x86')]?_0x2d0273['attributes']:_0x5efb2b[_0xd781('0xa')];if(!_0xfc428d['query'][_0xd781('0x92')](_0xd781('0x93'))){_0x2d0273[_0xd781('0x94')]=qs[_0xd781('0x94')](_0xfc428d[_0xd781('0x7d')][_0xd781('0x94')]);_0x2d0273[_0xd781('0x95')]=qs[_0xd781('0x95')](_0xfc428d[_0xd781('0x7d')][_0xd781('0x95')]);}_0x2d0273['order']=qs[_0xd781('0x96')](_0xfc428d[_0xd781('0x7d')]['sort']);_0x2d0273[_0xd781('0x7a')]=qs[_0xd781('0x8e')](_[_0xd781('0x97')](_0xfc428d['query'],_0x5efb2b['filters']));if(_0xfc428d[_0xd781('0x7d')]['filter']){_0x2d0273[_0xd781('0x7a')]=_[_0xd781('0x98')](_0x2d0273[_0xd781('0x7a')],{'$or':_[_0xd781('0x9')](_0x2c4a8b,function(_0x27a828){if(_0x27a828['type'][_0xd781('0x99')]!==_0xd781('0x9a')){var _0xb07462={};_0xb07462[_0x27a828[_0xd781('0x5')]]={'$like':'%'+_0xfc428d[_0xd781('0x7d')][_0xd781('0x4')]+'%'};return _0xb07462;}})});}var _0x1b8ce0=[];var _0x32dc27=null;var _0x3665f0={};if(_0x5bba63){_0x32dc27=_[_0xd781('0x89')](_0x98ea88,[_0xd781('0xc'),_0x5bba63['name']]);if(_0x32dc27[_0xd781('0x5')]){_0x3665f0={};if(_0x4bdeaa[_0xd781('0x15')]==='AnalyticExtractedReport'){_0x3665f0[_0x32dc27[_0xd781('0x9b')]]=_[_0xd781('0x9')](_0x5bba63[_0xd781('0x8')],'id');}else{_0x3665f0[_0x32dc27['foreignKey']]=_0x5bba63[_0xd781('0x8')];}_0x1b8ce0[_0xd781('0x87')](_0x3665f0);}else{_0x2d0273['where']['id']=_0x5bba63[_0xd781('0x8')];}}else{for(var _0x549004=0x0;_0x549004<_0x24e3f5[_0xd781('0x86')];_0x549004++){_0x32dc27=_[_0xd781('0x89')](_0x98ea88,[_0xd781('0xc'),_0x24e3f5[_0x549004][_0xd781('0xc')]]);if(_0x32dc27[_0xd781('0x5')]){_0x3665f0={};_0x3665f0[_0x32dc27['foreignKey']]=_0x24e3f5[_0x549004][_0xd781('0x8')];_0x1b8ce0[_0xd781('0x87')](_0x3665f0);}else{if(!_0x2d0273[_0xd781('0x7a')]['id'])_0x2d0273[_0xd781('0x7a')]['id']=[];_0x24e3f5[_0x549004][_0xd781('0x8')][_0xd781('0x9c')](function(_0x5b87b0){_0x2d0273[_0xd781('0x7a')]['id'][_0xd781('0x87')](_0x5b87b0);});}}}if(!_['isEmpty'](_0x1b8ce0)){_0x2d0273[_0xd781('0x7a')]=_[_0xd781('0x98')](_0x2d0273['where'],{'$and':{'$or':_0x1b8ce0}});}_0x2d0273=_[_0xd781('0x98')]({},_0x2d0273,_0xfc428d[_0xd781('0x9d')]);if(_0x5bba63&&!_0x5bba63[_0xd781('0x8c')]&&_0x4bdeaa[_0xd781('0x15')]===_0xd781('0xf')){if(_0xfc428d['query']['includeAll']){_0x2d0273['include']=[{'all':!![]}];}return _0x3cd308[_0x4bdeaa[_0xd781('0x15')]][_0xd781('0xb')](_0x2d0273)[_0xd781('0x7')](function(_0x423334){var _0x367d80=[];_0x423334[_0xd781('0x9c')](function(_0x2c96c5){var _0x2da9fa;switch(_0x2c96c5[_0xd781('0x9e')]){case'default':_0x2da9fa=_[_0xd781('0x89')](_0x5bba63[_0xd781('0x8')],function(_0x196399){return _0x196399['id']===_0x2c96c5[_0xd781('0x6d')]&&_0x196399[_0xd781('0x11')]==='DefaultReports';});break;case'custom':_0x2da9fa=_['find'](_0x5bba63[_0xd781('0x8')],function(_0x5d9768){return _0x5d9768['id']===_0x2c96c5[_0xd781('0x6d')]&&_0x5d9768[_0xd781('0x11')]==='CustomReports';});break;}if(_0x2da9fa)_0x367d80['push'](_0x2c96c5);});_0x4cd0ad[_0xd781('0x9f')]=_0x367d80[_0xd781('0x86')];_0x4cd0ad[_0xd781('0xa0')]=_0x367d80;return _0x4cd0ad;});}else{return _0x3cd308[_0x4bdeaa[_0xd781('0x15')]]['count']({'where':_0x2d0273[_0xd781('0x7a')]})[_0xd781('0x7')](function(_0x11f220){_0x4cd0ad[_0xd781('0x9f')]=_0x11f220;if(_0xfc428d[_0xd781('0x7d')]['includeAll']){if(_0x4bdeaa[_0xd781('0x15')]===_0xd781('0xa1')){_0x2d0273['include']=[{'model':_0x3cd308[_0xd781('0xa2')],'as':_0xd781('0xa3'),'attributes':['id',_0xd781('0xc'),_0xd781('0xa4')],'required':_0xfc428d[_0xd781('0x7d')][_0xd781('0xa5')]?!![]:![]},{'model':_0x3cd308[_0xd781('0xa2')],'as':_0xd781('0xa6'),'attributes':['id','name','color'],'through':_0xfc428d[_0xd781('0x7d')][_0xd781('0xa5')]?{'attributes':[],'where':{'TagId':_0xfc428d['query'][_0xd781('0xa5')]||undefined}}:{},'required':_0xfc428d[_0xd781('0x7d')]['tag']?!![]:![]}];}else{_0x2d0273[_0xd781('0xa7')]=[{'all':!![]}];}}return _0x3cd308[_0x4bdeaa[_0xd781('0x15')]]['findAll'](_0x2d0273);})[_0xd781('0x7')](function(_0x5bd9bc){_0x4cd0ad[_0xd781('0xa0')]=_0x5bd9bc;if(_0x645c0c===_0xd781('0x30')&&_0xfc428d[_0xd781('0x7d')]['openTabs']==='true'){var _0x356c56=[];for(var _0x3d5db3=0x0;_0x3d5db3<_0x4cd0ad['rows'][_0xd781('0x86')];_0x3d5db3++){_0x356c56[_0xd781('0x87')](_0x5e527c(_0xd781('0xa8'),_0x4cd0ad[_0xd781('0xa0')][_0x3d5db3][_0xd781('0xa9')]));_0x356c56[_0xd781('0x87')](_0x5e527c(_0xd781('0xaa'),_0x4cd0ad[_0xd781('0xa0')][_0x3d5db3]['dataValues']));_0x356c56[_0xd781('0x87')](_0x5e527c(_0xd781('0xab'),_0x4cd0ad[_0xd781('0xa0')][_0x3d5db3][_0xd781('0xa9')]));_0x356c56[_0xd781('0x87')](_0x5e527c('mail',_0x4cd0ad[_0xd781('0xa0')][_0x3d5db3][_0xd781('0xa9')]));_0x356c56[_0xd781('0x87')](_0x5e527c(_0xd781('0xac'),_0x4cd0ad[_0xd781('0xa0')][_0x3d5db3][_0xd781('0xa9')]));_0x356c56[_0xd781('0x87')](_0x5e527c('whatsapp',_0x4cd0ad['rows'][_0x3d5db3]['dataValues']));}return Promise['all'](_0x356c56)[_0xd781('0x7')](function(){return _0x4cd0ad;});}return _0x4cd0ad;});}});}}});}; \ No newline at end of file +var _0x0adf=['Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Plugin','Reports','reportId','metrics','AnalyticMetric','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','intersection','attributes','fields','nolimit','limit','offset','sort','filters','merge','key','VIRTUAL','foreignKey','options','includeAll','forEach','reportType','default','DefaultReports','custom','count','rows','include','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','name','resolve','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','Users','role','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses'];(function(_0x3c5426,_0x4b9f99){var _0x824d43=function(_0x386128){while(--_0x386128){_0x3c5426['push'](_0x3c5426['shift']());}};_0x824d43(++_0x4b9f99);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1aa748,_0x194c4b){_0x1aa748=_0x1aa748-0x0;var _0x3ef41b=_0x0adf[_0x1aa748];return _0x3ef41b;};'use strict';var _=require(_0xf0ad('0x0'));var attributes=require(_0xf0ad('0x1'));var qs=require(_0xf0ad('0x2'));var squel=require('squel');module[_0xf0ad('0x3')]=function(_0x10cf5b){var _0x5d1191=_0x10cf5b[_0xf0ad('0x4')];function _0x27d666(_0x459e70,_0x719547){return new Promise(function(_0x59a588,_0x3bbf85){if(!_0x719547)return _0x59a588(null);var _0x53221f=_0x719547[_0xf0ad('0x5')]?{[_0x719547[_0xf0ad('0x5')][_0xf0ad('0x6')]]:_0x719547[_0xf0ad('0x5')][_0xf0ad('0x7')]}:undefined;return _0x5d1191[_0x459e70][_0xf0ad('0x8')]({'where':_0x53221f,'raw':!![]})[_0xf0ad('0x9')](function(_0x5bdf69){_0x719547[_0xf0ad('0xa')]=_['map'](_0x5bdf69,'id');_0x59a588(_0x719547);})[_0xf0ad('0xb')](function(_0x1f2952){_0x3bbf85(_0x1f2952);});});}function _0x43fb01(_0x2a5d0e,_0x3daf42){return new Promise(function(_0x4f2b79,_0x59b1a5){var _0x13ed94=_0x2a5d0e[_0xf0ad('0x5')]?{[_0x2a5d0e[_0xf0ad('0x5')][_0xf0ad('0x6')]]:_0x2a5d0e['filter'][_0xf0ad('0x7')]}:undefined;return _0x5d1191[_0x2a5d0e[_0xf0ad('0xc')]]['findAll']({'where':_0x13ed94,'raw':!![]})['then'](function(_0x5332e9){_0x3daf42[_0xf0ad('0xa')]=_['map'](_0x5332e9,function(_0x1dad7b){return _0x1dad7b[_0xf0ad('0xd')];});_0x4f2b79(_0x3daf42);})[_0xf0ad('0xb')](function(_0xfa829e){_0x59b1a5(_0xfa829e);});});}function _0x237dd9(_0x5c23ff,_0x1ad9e0,_0x285ab0){if(!_0x1ad9e0)return Promise[_0xf0ad('0xe')](null);return new Promise(function(_0x1c9fac,_0x47fa2b){return _0x5d1191['UserProfileResource'][_0xf0ad('0x8')]({'where':{'sectionId':_0x1ad9e0['id']},'raw':!![]})[_0xf0ad('0x9')](function(_0x49f2ec){if(_0x5c23ff[_0xf0ad('0x6')]&&_0x5c23ff[_0xf0ad('0x6')]!=='id'){_0x1ad9e0[_0xf0ad('0xa')]=_[_0xf0ad('0xf')](_0x49f2ec,function(_0x4cc08a){return _0x4cc08a[_0x5c23ff['field']];});}else{if(_0x285ab0===_0xf0ad('0x10')){_0x1ad9e0[_0xf0ad('0xa')]=_[_0xf0ad('0xf')](_0x49f2ec,function(_0x20c5f3){return{'id':_0x20c5f3[_0xf0ad('0x11')],'type':_0x20c5f3[_0xf0ad('0x12')]};});}else{_0x1ad9e0['associatedResources']=_[_0xf0ad('0xf')](_0x49f2ec,function(_0x16e62a){return _0x16e62a[_0xf0ad('0x11')];});}}_0x1c9fac(_0x1ad9e0);})[_0xf0ad('0xb')](function(_0x29d647){_0x47fa2b(_0x29d647);});});}function _0x88b47b(_0xb91769,_0x276322){var _0x3fc97e={'parentSections':[]};switch(_0xb91769[_0xf0ad('0x13')]()){case _0xf0ad('0x14'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x16');break;case _0xf0ad('0x17'):_0x3fc97e[_0xf0ad('0x15')]='SquareOdbc';break;case _0xf0ad('0x18'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x19');_0x3fc97e[_0xf0ad('0x1a')]=[{'name':_0xf0ad('0x1b'),'field':_0xf0ad('0xd'),'foreignKey':'projectName'}];break;case _0xf0ad('0x1c'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x1d');break;case _0xf0ad('0x1e'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x1f');_0x3fc97e[_0xf0ad('0x1a')]=[{'name':_0xf0ad('0x20'),'field':'id','foreignKey':_0xf0ad('0x21')}];break;case _0xf0ad('0x22'):_0x3fc97e[_0xf0ad('0x15')]='CmList';break;case _0xf0ad('0x23'):_0x3fc97e['childModel']=_0xf0ad('0x24');break;case'globalcustomfields':_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x25');break;case _0xf0ad('0x26'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x27');break;case _0xf0ad('0x28'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x29');break;case'faxqueues':_0x3fc97e['childModel']=_0xf0ad('0x2a');break;case _0xf0ad('0x2b'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x2c');break;case'inboundroutes':case _0xf0ad('0x2d'):case'outboundroutes':_0x3fc97e[_0xf0ad('0x15')]='VoiceExtension';break;case _0xf0ad('0x2e'):_0x3fc97e['childModel']=_0xf0ad('0x2f');break;case _0xf0ad('0x30'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x31');break;case _0xf0ad('0x32'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x33');_0x3fc97e[_0xf0ad('0x1a')]=[{'name':'Agents','field':_0xf0ad('0xd'),'foreignKey':'membername','model':_0xf0ad('0x34'),'filter':{'field':'role','value':[_0xf0ad('0x35')]}},{'name':_0xf0ad('0x36'),'field':_0xf0ad('0xd'),'foreignKey':_0xf0ad('0x37'),'model':_0xf0ad('0x34'),'filter':{'field':'role','value':[_0xf0ad('0x38')]}},{'name':_0xf0ad('0x39'),'field':_0xf0ad('0xd'),'foreignKey':_0xf0ad('0x3a'),'model':_0xf0ad('0x3b'),'filter':{'field':_0xf0ad('0x12'),'value':[_0xf0ad('0x3c')]}},{'name':'QueueCampaigns','field':_0xf0ad('0xd'),'foreignKey':_0xf0ad('0x3a'),'model':_0xf0ad('0x3b'),'filter':{'field':_0xf0ad('0x12'),'value':[_0xf0ad('0x3d')]}}];break;case _0xf0ad('0x3e'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x3f');break;case _0xf0ad('0x40'):_0x3fc97e['childModel']=_0xf0ad('0x41');break;case _0xf0ad('0x42'):_0x3fc97e[_0xf0ad('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x3fc97e['childModel']=_0xf0ad('0x43');break;case _0xf0ad('0x44'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x45');break;case _0xf0ad('0x46'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x47');break;case _0xf0ad('0x48'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x49');break;case _0xf0ad('0x4a'):_0x3fc97e['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x4b');break;case'smsqueues':_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x4c');break;case'smsaccounts':_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x4d');break;case _0xf0ad('0x4e'):_0x3fc97e[_0xf0ad('0x15')]='WhatsappQueue';break;case _0xf0ad('0x4f'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x50');break;case _0xf0ad('0x51'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x52');break;case _0xf0ad('0x53'):case _0xf0ad('0x54'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x3b');if(_0x276322){_0x3fc97e[_0xf0ad('0x1a')]=[{'name':'VoiceQueues'},{'name':_0xf0ad('0x55')}];}break;case _0xf0ad('0x56'):case _0xf0ad('0x57'):case'telephones':_0x3fc97e['childModel']=_0xf0ad('0x34');if(_0x276322){_0x3fc97e[_0xf0ad('0x1a')]=[{'name':_0xf0ad('0x58'),'filter':{'field':_0xf0ad('0x59'),'value':[_0xf0ad('0x5a'),_0xf0ad('0x5b')]},'ignore':!![]},{'name':_0xf0ad('0x5c')},{'name':'Telephones'}];}break;case _0xf0ad('0x5d'):_0x3fc97e['childModel']=_0xf0ad('0x5e');break;case _0xf0ad('0x5f'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x60');break;case _0xf0ad('0x61'):_0x3fc97e['childModel']='FreshdeskAccount';break;case _0xf0ad('0x62'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x63');break;case _0xf0ad('0x64'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x65');break;case _0xf0ad('0x66'):_0x3fc97e['childModel']=_0xf0ad('0x67');break;case _0xf0ad('0x68'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x34');break;case _0xf0ad('0x69'):_0x3fc97e['childModel']=_0xf0ad('0x6a');break;case _0xf0ad('0x6b'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x6c');break;case _0xf0ad('0x6d'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x6e');break;case'intervals':_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x6f');break;case _0xf0ad('0x70'):_0x3fc97e['childModel']=_0xf0ad('0x71');break;case _0xf0ad('0x72'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x73');break;case _0xf0ad('0x74'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x75');break;case _0xf0ad('0x76'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x77');break;case _0xf0ad('0x78'):_0x3fc97e['childModel']='Template';break;case _0xf0ad('0x79'):_0x3fc97e[_0xf0ad('0x15')]='Trigger';break;case _0xf0ad('0x7a'):_0x3fc97e[_0xf0ad('0x15')]='Trunk';break;case'variables':_0x3fc97e[_0xf0ad('0x15')]='Variable';break;case'plugins':_0x3fc97e['childModel']=_0xf0ad('0x7b');break;case'extractedreports':_0x3fc97e['childModel']=_0xf0ad('0x10');_0x3fc97e[_0xf0ad('0x1a')]=[{'name':_0xf0ad('0x7c'),'field':'id','foreignKey':_0xf0ad('0x7d')}];break;case _0xf0ad('0x7e'):_0x3fc97e[_0xf0ad('0x15')]=_0xf0ad('0x7f');break;}return _0x3fc97e;}function _0x52075c(_0x60fc33,_0x509efb){var _0x51a84a=_0x60fc33['charAt'](0x0)['toUpperCase']()+_0x60fc33[_0xf0ad('0x80')](0x1);var _0x1149a9={'type':_0x5d1191[_0xf0ad('0x81')][_0xf0ad('0x82')][_0xf0ad('0x83')],'raw':!![]};return new Promise(function(_0x32c1d5,_0x410988){var _0x45a96e=squel[_0xf0ad('0x84')]()[_0xf0ad('0x6')](_0xf0ad('0x85')+_0x51a84a+'InteractionId','id')['field'](_0xf0ad('0x86'))[_0xf0ad('0x87')]('user_has_'+_0x60fc33+_0xf0ad('0x88'),'ui')[_0xf0ad('0x89')]('ui.UserId\x20=\x20?',_0x509efb['id']);return _0x5d1191[_0xf0ad('0x8a')][_0xf0ad('0x8b')](_0x45a96e[_0xf0ad('0x8c')](),_0x1149a9)['then'](function(_0x1fe9df){_0x509efb[_0x51a84a+_0xf0ad('0x8d')]=_0x1fe9df;_0x32c1d5(_0x1fe9df);})[_0xf0ad('0xb')](function(_0x3ed619){_0x410988(_0x3ed619);});});}return _0x10cf5b[_0xf0ad('0x8e')](_0xf0ad('0x8f'),attributes,{'tableName':_0xf0ad('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x15739e){var _0x57e096={'raw':![],'where':{}};var _0x1a6664={};var _0x55bb24={'count':0x0,'rows':[]};var _0x2db8fe=_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0x91')];var _0x5e9a3c=_0x15739e[_0xf0ad('0x8b')]['mergeResources']||![];var _0x41a5ba=_0x88b47b(_0x2db8fe,_0x5e9a3c);if(!_0x41a5ba[_0xf0ad('0x15')])throw new Error(_0xf0ad('0x92')+_0x2db8fe+'\x27');var _0x187d76=[{'name':_0x2db8fe}];if(!_[_0xf0ad('0x93')](_0x41a5ba[_0xf0ad('0x1a')]))_0x187d76=_0x41a5ba[_0xf0ad('0x1a')];var _0x53d8e0=[];for(var _0x1ea760=0x0;_0x1ea760<_0x187d76[_0xf0ad('0x94')];_0x1ea760++){_0x53d8e0['push'](_0x5d1191[_0xf0ad('0x95')][_0xf0ad('0x96')]({'where':{'userProfileId':_0x15739e[_0xf0ad('0x97')]['id'],'name':_0x187d76[_0x1ea760][_0xf0ad('0xd')]},'raw':!![]}));}return Promise[_0xf0ad('0x98')](_0x53d8e0)[_0xf0ad('0x9')](function(_0x3d6f53){var _0x15152d=_[_0xf0ad('0x5')](_0x3d6f53,function(_0x3b56d3){return _0x3b56d3?_0x3b56d3:undefined;});var _0x2463cd=_[_0xf0ad('0x5')](_0x187d76,[_0xf0ad('0x99'),!![]]);var _0x51eb6d=_[_0xf0ad('0x93')](_0x15152d)&&_[_0xf0ad('0x93')](_0x2463cd)?null:_[_0xf0ad('0x9a')](_0x2463cd,_0x15152d);if(!_0x51eb6d)return null;var _0x232c6b=[];for(var _0x4e48df=0x0;_0x4e48df<_0x51eb6d[_0xf0ad('0x94')];_0x4e48df++){var _0x3afe0e=_[_0xf0ad('0x96')](_0x187d76,function(_0x4c3d0f){return _0x51eb6d[_0x4e48df]?_0x4c3d0f[_0xf0ad('0xd')]===_0x51eb6d[_0x4e48df]['name']:null;});if(_0x3afe0e){if(_0x51eb6d[_0x4e48df][_0xf0ad('0x99')]){_0x232c6b[_0xf0ad('0x9b')](_0x27d666(_0x41a5ba[_0xf0ad('0x15')],_0x51eb6d[_0x4e48df]));}else{if(!_0x51eb6d[_0x4e48df][_0xf0ad('0x9c')]){_0x232c6b['push'](_0x237dd9(_0x3afe0e,_0x51eb6d[_0x4e48df],_0x41a5ba[_0xf0ad('0x15')]));}else{if(_0x3afe0e['model']){_0x232c6b['push'](_0x43fb01(_0x3afe0e,_0x51eb6d[_0x4e48df]));}}}}}return Promise[_0xf0ad('0x98')](_0x232c6b);})[_0xf0ad('0x9')](function(_0x119b0d){var _0x33bc17=_0x119b0d;var _0x37b261=null;if(_0x33bc17){_0x37b261=_0x33bc17['length']===0x1?_0x33bc17[0x0]:null;}if(!_0x37b261&&!_0x33bc17)return _0x55bb24;var _0x540b2b=_0x5d1191[_0x41a5ba[_0xf0ad('0x15')]][_0xf0ad('0x9d')];_0x1a6664[_0xf0ad('0xc')]=_[_0xf0ad('0x9e')](_0x540b2b);_0x1a6664[_0xf0ad('0x8b')]=_[_0xf0ad('0x9e')](_0x15739e[_0xf0ad('0x8b')]);_0x1a6664['filters']=_[_0xf0ad('0x9f')](_0x1a6664[_0xf0ad('0xc')],_0x1a6664[_0xf0ad('0x8b')]);_0x57e096[_0xf0ad('0xa0')]=_[_0xf0ad('0x9f')](_0x1a6664[_0xf0ad('0xc')],qs['fields'](_0x15739e['query'][_0xf0ad('0xa1')]));_0x57e096[_0xf0ad('0xa0')]=_0x57e096[_0xf0ad('0xa0')][_0xf0ad('0x94')]?_0x57e096['attributes']:_0x1a6664[_0xf0ad('0xc')];if(!_0x15739e['query']['hasOwnProperty'](_0xf0ad('0xa2'))){_0x57e096['limit']=qs[_0xf0ad('0xa3')](_0x15739e['query']['limit']);_0x57e096[_0xf0ad('0xa4')]=qs[_0xf0ad('0xa4')](_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xa4')]);}_0x57e096['order']=qs[_0xf0ad('0xa5')](_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xa5')]);_0x57e096['where']=qs['filters'](_['pick'](_0x15739e[_0xf0ad('0x8b')],_0x1a6664[_0xf0ad('0xa6')]));if(_0x15739e['query'][_0xf0ad('0x5')]){_0x57e096[_0xf0ad('0x89')]=_[_0xf0ad('0xa7')](_0x57e096[_0xf0ad('0x89')],{'$or':_[_0xf0ad('0xf')](_0x540b2b,function(_0x29e70e){if(_0x29e70e[_0xf0ad('0x12')][_0xf0ad('0xa8')]!==_0xf0ad('0xa9')){var _0x56bda2={};_0x56bda2[_0x29e70e[_0xf0ad('0x6')]]={'$like':'%'+_0x15739e[_0xf0ad('0x8b')]['filter']+'%'};return _0x56bda2;}})});}var _0x2cd0ce=[];var _0x2ec429=null;var _0x13c804={};if(_0x37b261){_0x2ec429=_[_0xf0ad('0x96')](_0x187d76,[_0xf0ad('0xd'),_0x37b261[_0xf0ad('0xd')]]);if(_0x2ec429[_0xf0ad('0x6')]){_0x13c804={};if(_0x41a5ba[_0xf0ad('0x15')]===_0xf0ad('0x10')){_0x13c804[_0x2ec429[_0xf0ad('0xaa')]]=_['map'](_0x37b261[_0xf0ad('0xa')],'id');}else{_0x13c804[_0x2ec429[_0xf0ad('0xaa')]]=_0x37b261[_0xf0ad('0xa')];}_0x2cd0ce[_0xf0ad('0x9b')](_0x13c804);}else{_0x57e096['where']['id']=_0x37b261[_0xf0ad('0xa')];}}else{for(var _0x276a08=0x0;_0x276a08<_0x33bc17[_0xf0ad('0x94')];_0x276a08++){_0x2ec429=_[_0xf0ad('0x96')](_0x187d76,[_0xf0ad('0xd'),_0x33bc17[_0x276a08][_0xf0ad('0xd')]]);if(_0x2ec429[_0xf0ad('0x6')]){_0x13c804={};_0x13c804[_0x2ec429[_0xf0ad('0xaa')]]=_0x33bc17[_0x276a08][_0xf0ad('0xa')];_0x2cd0ce[_0xf0ad('0x9b')](_0x13c804);}else{if(!_0x57e096['where']['id'])_0x57e096[_0xf0ad('0x89')]['id']=[];_0x33bc17[_0x276a08][_0xf0ad('0xa')]['forEach'](function(_0x70e504){_0x57e096[_0xf0ad('0x89')]['id']['push'](_0x70e504);});}}}if(!_[_0xf0ad('0x93')](_0x2cd0ce)){_0x57e096[_0xf0ad('0x89')]=_[_0xf0ad('0xa7')](_0x57e096[_0xf0ad('0x89')],{'$and':{'$or':_0x2cd0ce}});}_0x57e096=_[_0xf0ad('0xa7')]({},_0x57e096,_0x15739e[_0xf0ad('0xab')]);if(_0x37b261&&!_0x37b261[_0xf0ad('0x9c')]&&_0x41a5ba[_0xf0ad('0x15')]==='AnalyticExtractedReport'){if(_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xac')]){_0x57e096['include']=[{'all':!![]}];}return _0x5d1191[_0x41a5ba[_0xf0ad('0x15')]][_0xf0ad('0x8')](_0x57e096)[_0xf0ad('0x9')](function(_0xa74339){var _0x347ec5=[];_0xa74339[_0xf0ad('0xad')](function(_0x15c25b){var _0x57205f;switch(_0x15c25b[_0xf0ad('0xae')]){case _0xf0ad('0xaf'):_0x57205f=_['find'](_0x37b261[_0xf0ad('0xa')],function(_0x1ff58e){return _0x1ff58e['id']===_0x15c25b[_0xf0ad('0x7d')]&&_0x1ff58e[_0xf0ad('0x12')]===_0xf0ad('0xb0');});break;case _0xf0ad('0xb1'):_0x57205f=_['find'](_0x37b261[_0xf0ad('0xa')],function(_0x284b96){return _0x284b96['id']===_0x15c25b[_0xf0ad('0x7d')]&&_0x284b96[_0xf0ad('0x12')]==='CustomReports';});break;}if(_0x57205f)_0x347ec5[_0xf0ad('0x9b')](_0x15c25b);});_0x55bb24[_0xf0ad('0xb2')]=_0x347ec5[_0xf0ad('0x94')];_0x55bb24[_0xf0ad('0xb3')]=_0x347ec5;return _0x55bb24;});}else{return _0x5d1191[_0x41a5ba[_0xf0ad('0x15')]][_0xf0ad('0xb2')]({'where':_0x57e096[_0xf0ad('0x89')]})[_0xf0ad('0x9')](function(_0x28a74e){_0x55bb24[_0xf0ad('0xb2')]=_0x28a74e;if(_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xac')]){if(_0x41a5ba[_0xf0ad('0x15')]===_0xf0ad('0x1f')){_0x57e096[_0xf0ad('0xb4')]=[{'model':_0x5d1191[_0xf0ad('0x77')],'as':_0xf0ad('0xb5'),'attributes':['id','name',_0xf0ad('0xb6')],'required':_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xb7')]?!![]:![]},{'model':_0x5d1191[_0xf0ad('0x77')],'as':_0xf0ad('0xb8'),'attributes':['id',_0xf0ad('0xd'),_0xf0ad('0xb6')],'through':_0x15739e['query']['tag']?{'attributes':[],'where':{'TagId':_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xb7')]||undefined}}:{},'required':_0x15739e[_0xf0ad('0x8b')]['tag']?!![]:![]}];}else{_0x57e096[_0xf0ad('0xb4')]=[{'all':!![]}];}}return _0x5d1191[_0x41a5ba['childModel']]['findAll'](_0x57e096);})['then'](function(_0x168523){_0x55bb24[_0xf0ad('0xb3')]=_0x168523;if(_0x2db8fe==='Agents'&&_0x15739e[_0xf0ad('0x8b')][_0xf0ad('0xb9')]===_0xf0ad('0xba')){var _0x25079f=[];for(var _0x4932c4=0x0;_0x4932c4<_0x55bb24[_0xf0ad('0xb3')]['length'];_0x4932c4++){_0x25079f['push'](_0x52075c(_0xf0ad('0xbb'),_0x55bb24[_0xf0ad('0xb3')][_0x4932c4][_0xf0ad('0xbc')]));_0x25079f[_0xf0ad('0x9b')](_0x52075c('sms',_0x55bb24['rows'][_0x4932c4][_0xf0ad('0xbc')]));_0x25079f['push'](_0x52075c(_0xf0ad('0xbd'),_0x55bb24['rows'][_0x4932c4][_0xf0ad('0xbc')]));_0x25079f['push'](_0x52075c(_0xf0ad('0xbe'),_0x55bb24['rows'][_0x4932c4][_0xf0ad('0xbc')]));_0x25079f[_0xf0ad('0x9b')](_0x52075c(_0xf0ad('0xbf'),_0x55bb24[_0xf0ad('0xb3')][_0x4932c4][_0xf0ad('0xbc')]));_0x25079f['push'](_0x52075c(_0xf0ad('0xc0'),_0x55bb24[_0xf0ad('0xb3')][_0x4932c4]['dataValues']));}return Promise[_0xf0ad('0x98')](_0x25079f)[_0xf0ad('0x9')](function(){return _0x55bb24;});}return _0x55bb24;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index daab6f6..24f69cd 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 _0x6ab9=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0xc6aebb,_0x58bcbb){var _0x2c5a3a=function(_0x5b637c){while(--_0x5b637c){_0xc6aebb['push'](_0xc6aebb['shift']());}};_0x2c5a3a(++_0x58bcbb);}(_0x6ab9,0x19a));var _0x96ab=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x6ab9[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});config[_0x96ab('0xa')]=_[_0x96ab('0xb')](config['redis'],{'host':_0x96ab('0xc'),'port':0x18eb});var socket=require(_0x96ab('0xd'))(new Redis(config[_0x96ab('0xa')]));require(_0x96ab('0xe'))[_0x96ab('0xf')](socket);function respondWithRpcPromise(_0x2dfc50,_0xdc00cb,_0x84fd1e){return new BPromise(function(_0x3ef79e,_0x9a19d7){return client[_0x96ab('0x10')](_0x2dfc50,_0x84fd1e)[_0x96ab('0x11')](function(_0x43658c){logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');logger[_0x96ab('0x13')](_0x96ab('0x14'),_0xdc00cb,_0x96ab('0x15'),JSON[_0x96ab('0x16')](_0x43658c));if(_0x43658c[_0x96ab('0x17')]){if(_0x43658c[_0x96ab('0x17')][_0x96ab('0x18')]===0x1f4){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);return _0x9a19d7(_0x43658c['error']['message']);}logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')]['message']);return _0x3ef79e(_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);}else{logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');_0x3ef79e(_0x43658c[_0x96ab('0x1a')][_0x96ab('0x19')]);}})[_0x96ab('0x1b')](function(_0x23f826){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x23f826);_0x9a19d7(_0x23f826);});});} \ No newline at end of file +var _0x18b2=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37c340,_0x563418){var _0x20add4=function(_0x2749f0){while(--_0x2749f0){_0x37c340['push'](_0x37c340['shift']());}};_0x20add4(++_0x563418);}(_0x18b2,0x85));var _0x218b=function(_0x290b48,_0x4938e6){_0x290b48=_0x290b48-0x0;var _0x2af174=_0x18b2[_0x290b48];return _0x2af174;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require(_0x218b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x3'));var db=require(_0x218b('0x4'))['db'];var utils=require(_0x218b('0x5'));var logger=require(_0x218b('0x6'))(_0x218b('0x7'));var config=require(_0x218b('0x8'));var jayson=require(_0x218b('0x9'));var client=jayson[_0x218b('0xa')][_0x218b('0xb')]({'port':0x232a});config[_0x218b('0xc')]=_[_0x218b('0xd')](config[_0x218b('0xc')],{'host':_0x218b('0xe'),'port':0x18eb});var socket=require(_0x218b('0xf'))(new Redis(config[_0x218b('0xc')]));require('./userProfile.socket')[_0x218b('0x10')](socket);function respondWithRpcPromise(_0xc5f1d7,_0x413da9,_0x161acf){return new BPromise(function(_0x421a0f,_0x4ee68f){return client[_0x218b('0x11')](_0xc5f1d7,_0x161acf)['then'](function(_0xfc01c1){logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,'request\x20sent');logger[_0x218b('0x14')](_0x218b('0x15'),_0x413da9,'request\x20sent',JSON[_0x218b('0x16')](_0xfc01c1));if(_0xfc01c1[_0x218b('0x17')]){if(_0xfc01c1['error'][_0x218b('0x18')]===0x1f4){logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x4ee68f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}logger[_0x218b('0x17')](_0x218b('0x13'),_0x413da9,_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);return _0x421a0f(_0xfc01c1[_0x218b('0x17')][_0x218b('0x19')]);}else{logger[_0x218b('0x12')](_0x218b('0x13'),_0x413da9,_0x218b('0x1a'));_0x421a0f(_0xfc01c1['result'][_0x218b('0x19')]);}})[_0x218b('0x1b')](function(_0x139ade){logger['error']('UserProfile,\x20%s,\x20%s',_0x413da9,_0x139ade);_0x4ee68f(_0x139ade);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index fb5d26d..15f6c5d 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 _0xa193=['length','userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x26ca97,_0x3940ca){var _0x2da3d5=function(_0x25cddd){while(--_0x25cddd){_0x26ca97['push'](_0x26ca97['shift']());}};_0x2da3d5(++_0x3940ca);}(_0xa193,0x1a9));var _0x3a19=function(_0xa0929f,_0x264a6d){_0xa0929f=_0xa0929f-0x0;var _0x368864=_0xa193[_0xa0929f];return _0x368864;};'use strict';var UserProfileEvents=require(_0x3a19('0x0'));var events=[_0x3a19('0x1'),_0x3a19('0x2'),_0x3a19('0x3')];function createListener(_0x481cd8,_0x123ff9){return function(_0x31986a){_0x123ff9[_0x3a19('0x4')](_0x481cd8,_0x31986a);};}function removeListener(_0xe3c911,_0x13d565){return function(){UserProfileEvents[_0x3a19('0x5')](_0xe3c911,_0x13d565);};}exports[_0x3a19('0x6')]=function(_0xefa9d4){for(var _0x34f3e8=0x0,_0xbe2145=events[_0x3a19('0x7')];_0x34f3e8<_0xbe2145;_0x34f3e8++){var _0x7057fa=events[_0x34f3e8];var _0x2d12d2=createListener(_0x3a19('0x8')+_0x7057fa,_0xefa9d4);UserProfileEvents['on'](_0x7057fa,_0x2d12d2);}}; \ No newline at end of file +var _0x9225=['update','emit','removeListener','userProfile:','./userProfile.events','save','remove'];(function(_0x5f485e,_0x2dd2dd){var _0x23cf49=function(_0xe3ae14){while(--_0xe3ae14){_0x5f485e['push'](_0x5f485e['shift']());}};_0x23cf49(++_0x2dd2dd);}(_0x9225,0x115));var _0x5922=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x9225[_0xaa1b3e];return _0x454d7d;};'use strict';var UserProfileEvents=require(_0x5922('0x0'));var events=[_0x5922('0x1'),_0x5922('0x2'),_0x5922('0x3')];function createListener(_0x4d4ad0,_0x21e5cd){return function(_0x1dd4c8){_0x21e5cd[_0x5922('0x4')](_0x4d4ad0,_0x1dd4c8);};}function removeListener(_0x4c4ee9,_0x1bd47f){return function(){UserProfileEvents[_0x5922('0x5')](_0x4c4ee9,_0x1bd47f);};}exports['register']=function(_0x5253cc){for(var _0x45fe37=0x0,_0x4e5600=events['length'];_0x45fe37<_0x4e5600;_0x45fe37++){var _0x202c0d=events[_0x45fe37];var _0x3802c5=createListener(_0x5922('0x6')+_0x202c0d,_0x5253cc);UserProfileEvents['on'](_0x202c0d,_0x3802c5);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a5729d3..7e9634a 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 _0xfa60=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x42e1ec,_0x19aacc){var _0xe8c124=function(_0x21fe3f){while(--_0x21fe3f){_0x42e1ec['push'](_0x42e1ec['shift']());}};_0xe8c124(++_0x19aacc);}(_0xfa60,0xae));var _0x0fa6=function(_0x2352c0,_0x74d3e5){_0x2352c0=_0x2352c0-0x0;var _0x5b8096=_0xfa60[_0x2352c0];return _0x5b8096;};'use strict';var multer=require('multer');var util=require(_0x0fa6('0x0'));var path=require(_0x0fa6('0x1'));var timeout=require(_0x0fa6('0x2'));var express=require('express');var router=express[_0x0fa6('0x3')]();var fs_extra=require(_0x0fa6('0x4'));var auth=require(_0x0fa6('0x5'));var interaction=require(_0x0fa6('0x6'));var config=require(_0x0fa6('0x7'));var controller=require(_0x0fa6('0x8'));router[_0x0fa6('0x9')]('/',auth['isAuthenticated'](),controller[_0x0fa6('0xa')]);router[_0x0fa6('0x9')](_0x0fa6('0xb'),auth['isAuthenticated'](),controller[_0x0fa6('0xc')]);router[_0x0fa6('0x9')](_0x0fa6('0xd'),auth[_0x0fa6('0xe')](),controller['show']);router[_0x0fa6('0xf')]('/',auth['isAuthenticated'](),controller[_0x0fa6('0x10')]);router[_0x0fa6('0x11')](_0x0fa6('0xd'),auth[_0x0fa6('0xe')](),controller[_0x0fa6('0x12')]);router[_0x0fa6('0x13')](_0x0fa6('0xd'),auth[_0x0fa6('0xe')](),controller[_0x0fa6('0x14')]);module[_0x0fa6('0x15')]=router; \ No newline at end of file +var _0x4be3=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy'];(function(_0x231745,_0x304c26){var _0x318978=function(_0x2db9dd){while(--_0x2db9dd){_0x231745['push'](_0x231745['shift']());}};_0x318978(++_0x304c26);}(_0x4be3,0x17d));var _0x34be=function(_0x2bbec1,_0x3d93ed){_0x2bbec1=_0x2bbec1-0x0;var _0x298066=_0x4be3[_0x2bbec1];return _0x298066;};'use strict';var multer=require(_0x34be('0x0'));var util=require(_0x34be('0x1'));var path=require('path');var timeout=require(_0x34be('0x2'));var express=require(_0x34be('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34be('0x4'));var interaction=require(_0x34be('0x5'));var config=require(_0x34be('0x6'));var controller=require(_0x34be('0x7'));router[_0x34be('0x8')]('/',auth['isAuthenticated'](),controller[_0x34be('0x9')]);router[_0x34be('0x8')](_0x34be('0xa'),auth[_0x34be('0xb')](),controller[_0x34be('0xc')]);router['get'](_0x34be('0xd'),auth[_0x34be('0xb')](),controller[_0x34be('0xe')]);router[_0x34be('0xf')]('/',auth['isAuthenticated'](),controller[_0x34be('0x10')]);router['put'](_0x34be('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x34be('0x11')](_0x34be('0xd'),auth[_0x34be('0xb')](),controller[_0x34be('0x12')]);module[_0x34be('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index ac3030a..20a3055 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 _0x9734=['sequelize','exports','STRING','INTEGER'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9734,0x98));var _0x4973=function(_0x3a12d3,_0x499e67){_0x3a12d3=_0x3a12d3-0x0;var _0x1dbb45=_0x9734[_0x3a12d3];return _0x1dbb45;};'use strict';var Sequelize=require(_0x4973('0x0'));module[_0x4973('0x1')]={'name':{'type':Sequelize[_0x4973('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4973('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4973('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf056=['STRING','INTEGER'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xf056,0x1ba));var _0x6f05=function(_0x478212,_0x88eac){_0x478212=_0x478212-0x0;var _0x518f48=_0xf056[_0x478212];return _0x518f48;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6f05('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6f05('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 28ee0ba..6669c7f 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 _0x01d9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','UserProfileResource'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['UserProfileResource'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['UserProfileResource'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};exports[_0x901d('0x4d')]=function(_0x52aa2d,_0x3a3ea6){return db[_0x901d('0x2f')][_0x901d('0x4d')]()[_0x901d('0x28')](respondWithResult(_0x3a3ea6,null))[_0x901d('0x46')](handleError(_0x3a3ea6,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1f61e2,_0x1b6e0f){var _0x2276fc=function(_0xc12024){while(--_0xc12024){_0x1f61e2['push'](_0x1f61e2['shift']());}};_0x2276fc(++_0x1b6e0f);}(_0x4975,0x86));var _0x5497=function(_0x1d1a82,_0x547f89){_0x1d1a82=_0x1d1a82-0x0;var _0x4f3117=_0x4975[_0x1d1a82];return _0x4f3117;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 57a7dc8..c267e22 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 _0x1512=['../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','bluebird','path','rimraf'];(function(_0x55abc7,_0x4da72b){var _0x2c186e=function(_0xe6f0c0){while(--_0xe6f0c0){_0x55abc7['push'](_0x55abc7['shift']());}};_0x2c186e(++_0x4da72b);}(_0x1512,0xd8));var _0x2151=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1512[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2151('0x0'));var util=require(_0x2151('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2151('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2151('0x3'));var rimraf=require(_0x2151('0x4'));var config=require(_0x2151('0x5'));var attributes=require(_0x2151('0x6'));module[_0x2151('0x7')]=function(_0x2b13b5,_0x312834){return _0x2b13b5['define'](_0x2151('0x8'),attributes,{'tableName':_0x2151('0x9'),'paranoid':![],'indexes':[{'name':_0x2151('0xa'),'fields':[_0x2151('0xb'),_0x2151('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27d9=['../../config/environment','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x48b70c,_0x1229bf){var _0x1601e2=function(_0x5b7564){while(--_0x5b7564){_0x48b70c['push'](_0x48b70c['shift']());}};_0x1601e2(++_0x1229bf);}(_0x27d9,0xbd));var _0x927d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x27d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x927d('0x0'));var util=require(_0x927d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x927d('0x2'));var BPromise=require(_0x927d('0x3'));var rp=require(_0x927d('0x4'));var fs=require('fs');var path=require(_0x927d('0x5'));var rimraf=require(_0x927d('0x6'));var config=require(_0x927d('0x7'));var attributes=require(_0x927d('0x8'));module['exports']=function(_0x48aa4e,_0x5d9218){return _0x48aa4e[_0x927d('0x9')]('UserProfileResource',attributes,{'tableName':_0x927d('0xa'),'paranoid':![],'indexes':[{'name':_0x927d('0xb'),'fields':[_0x927d('0xc'),_0x927d('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 1de286f..9408e91 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 _0x7d7d=['request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x7d7d,0x14b));var _0xd7d7=function(_0x1e0c9d,_0x4c8d50){_0x1e0c9d=_0x1e0c9d-0x0;var _0x331c9e=_0x7d7d[_0x1e0c9d];return _0x331c9e;};'use strict';var _=require(_0xd7d7('0x0'));var util=require('util');var moment=require(_0xd7d7('0x1'));var BPromise=require(_0xd7d7('0x2'));var rs=require(_0xd7d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7d7('0x4'));var logger=require(_0xd7d7('0x5'))(_0xd7d7('0x6'));var config=require(_0xd7d7('0x7'));var jayson=require(_0xd7d7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed7eb,_0x2d0b97,_0x2033c3){return new BPromise(function(_0x58a3bf,_0x444c2c){return client[_0xd7d7('0x9')](_0x4ed7eb,_0x2033c3)['then'](function(_0x26b168){logger[_0xd7d7('0xa')](_0xd7d7('0xb'),_0x2d0b97,_0xd7d7('0xc'));logger[_0xd7d7('0xd')](_0xd7d7('0xe'),_0x2d0b97,'request\x20sent',JSON[_0xd7d7('0xf')](_0x26b168));if(_0x26b168[_0xd7d7('0x10')]){if(_0x26b168[_0xd7d7('0x10')][_0xd7d7('0x11')]===0x1f4){logger[_0xd7d7('0x10')](_0xd7d7('0xb'),_0x2d0b97,_0x26b168[_0xd7d7('0x10')]['message']);return _0x444c2c(_0x26b168[_0xd7d7('0x10')][_0xd7d7('0x12')]);}logger[_0xd7d7('0x10')](_0xd7d7('0xb'),_0x2d0b97,_0x26b168[_0xd7d7('0x10')][_0xd7d7('0x12')]);return _0x58a3bf(_0x26b168['error'][_0xd7d7('0x12')]);}else{logger['info'](_0xd7d7('0xb'),_0x2d0b97,_0xd7d7('0xc'));_0x58a3bf(_0x26b168[_0xd7d7('0x13')][_0xd7d7('0x12')]);}})['catch'](function(_0x354b43){logger[_0xd7d7('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x2d0b97,_0x354b43);_0x444c2c(_0x354b43);});});} \ No newline at end of file +var _0x8e22=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x16452a,_0x3f9bdc){var _0x4b44c7=function(_0x3c6f71){while(--_0x3c6f71){_0x16452a['push'](_0x16452a['shift']());}};_0x4b44c7(++_0x3f9bdc);}(_0x8e22,0x11a));var _0x28e2=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x8e22[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x28e2('0x0'));var util=require(_0x28e2('0x1'));var moment=require(_0x28e2('0x2'));var BPromise=require(_0x28e2('0x3'));var rs=require(_0x28e2('0x4'));var fs=require('fs');var Redis=require(_0x28e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x28e2('0x6'));var logger=require(_0x28e2('0x7'))(_0x28e2('0x8'));var config=require('../../config/environment');var jayson=require(_0x28e2('0x9'));var client=jayson[_0x28e2('0xa')][_0x28e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x530d38,_0x2783d9,_0x5ee463){return new BPromise(function(_0x1f78a0,_0x234e4f){return client[_0x28e2('0xc')](_0x530d38,_0x5ee463)['then'](function(_0x20c9db){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x2783d9,_0x28e2('0xd'));logger[_0x28e2('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2783d9,_0x28e2('0xd'),JSON['stringify'](_0x20c9db));if(_0x20c9db[_0x28e2('0xf')]){if(_0x20c9db[_0x28e2('0xf')][_0x28e2('0x10')]===0x1f4){logger[_0x28e2('0xf')](_0x28e2('0x11'),_0x2783d9,_0x20c9db[_0x28e2('0xf')][_0x28e2('0x12')]);return _0x234e4f(_0x20c9db['error'][_0x28e2('0x12')]);}logger[_0x28e2('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x2783d9,_0x20c9db[_0x28e2('0xf')][_0x28e2('0x12')]);return _0x1f78a0(_0x20c9db[_0x28e2('0xf')][_0x28e2('0x12')]);}else{logger[_0x28e2('0x13')](_0x28e2('0x11'),_0x2783d9,_0x28e2('0xd'));_0x1f78a0(_0x20c9db[_0x28e2('0x14')][_0x28e2('0x12')]);}})[_0x28e2('0x15')](function(_0x989272){logger[_0x28e2('0xf')](_0x28e2('0x11'),_0x2783d9,_0x989272);_0x234e4f(_0x989272);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 949c707..38ed2df 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 _0x6fef=['../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x1ac617,_0x5254bb){var _0x1d3f1c=function(_0x2c45b4){while(--_0x2c45b4){_0x1ac617['push'](_0x1ac617['shift']());}};_0x1d3f1c(++_0x5254bb);}(_0x6fef,0x8d));var _0xf6fe=function(_0x2e7df6,_0x8da3b1){_0x2e7df6=_0x2e7df6-0x0;var _0x45ba4e=_0x6fef[_0x2e7df6];return _0x45ba4e;};'use strict';var multer=require(_0xf6fe('0x0'));var util=require(_0xf6fe('0x1'));var path=require(_0xf6fe('0x2'));var timeout=require(_0xf6fe('0x3'));var express=require(_0xf6fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf6fe('0x5'));var interaction=require(_0xf6fe('0x6'));var config=require(_0xf6fe('0x7'));var controller=require(_0xf6fe('0x8'));router[_0xf6fe('0x9')]('/',auth[_0xf6fe('0xa')](),controller[_0xf6fe('0xb')]);router[_0xf6fe('0x9')]('/describe',auth[_0xf6fe('0xa')](),controller[_0xf6fe('0xc')]);router[_0xf6fe('0x9')](_0xf6fe('0xd'),auth[_0xf6fe('0xa')](),controller[_0xf6fe('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf6fe('0xf')]);router[_0xf6fe('0x10')](_0xf6fe('0xd'),auth[_0xf6fe('0xa')](),controller[_0xf6fe('0x11')]);router[_0xf6fe('0x12')](_0xf6fe('0xd'),auth[_0xf6fe('0xa')](),controller[_0xf6fe('0x13')]);module[_0xf6fe('0x14')]=router; \ No newline at end of file +var _0x9b38=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9b38,0x116));var _0x89b3=function(_0x216861,_0x2cbafd){_0x216861=_0x216861-0x0;var _0x1d1419=_0x9b38[_0x216861];return _0x1d1419;};'use strict';var multer=require(_0x89b3('0x0'));var util=require(_0x89b3('0x1'));var path=require(_0x89b3('0x2'));var timeout=require(_0x89b3('0x3'));var express=require(_0x89b3('0x4'));var router=express[_0x89b3('0x5')]();var fs_extra=require(_0x89b3('0x6'));var auth=require(_0x89b3('0x7'));var interaction=require(_0x89b3('0x8'));var config=require('../../config/environment');var controller=require(_0x89b3('0x9'));router[_0x89b3('0xa')]('/',auth['isAuthenticated'](),controller[_0x89b3('0xb')]);router[_0x89b3('0xa')](_0x89b3('0xc'),auth[_0x89b3('0xd')](),controller[_0x89b3('0xe')]);router[_0x89b3('0xa')](_0x89b3('0xf'),auth[_0x89b3('0xd')](),controller[_0x89b3('0x10')]);router[_0x89b3('0x11')]('/',auth[_0x89b3('0xd')](),controller[_0x89b3('0x12')]);router[_0x89b3('0x13')](_0x89b3('0xf'),auth[_0x89b3('0xd')](),controller[_0x89b3('0x14')]);router[_0x89b3('0x15')]('/:id',auth[_0x89b3('0xd')](),controller['destroy']);module[_0x89b3('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dc7b934..ab8d62b 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 _0x0abf=['sequelize','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x1aec48,_0x4bd36e){var _0x1c4221=function(_0xe6f3bd){while(--_0xe6f3bd){_0x1aec48['push'](_0x1aec48['shift']());}};_0x1c4221(++_0x4bd36e);}(_0x0abf,0xe8));var _0xf0ab=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0abf[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0ab('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xf0ab('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xf0ab('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x7ea4e0){this[_0xf0ab('0x3')](_0xf0ab('0x4'),_0x7ea4e0?_0x7ea4e0[_0xf0ab('0x5')](''):[]);},'get':function(){return this[_0xf0ab('0x6')](_0xf0ab('0x4'))?this[_0xf0ab('0x6')]('crudPermissions')[_0xf0ab('0x7')](''):[];}}}; \ No newline at end of file +var _0xf7b4=['getDataValue','split','sequelize','STRING','INTEGER','setDataValue','crudPermissions','join'];(function(_0x5db264,_0x5d2fa7){var _0x1ea111=function(_0x4e9a39){while(--_0x4e9a39){_0x5db264['push'](_0x5db264['shift']());}};_0x1ea111(++_0x5d2fa7);}(_0xf7b4,0x152));var _0x4f7b=function(_0x25114a,_0x175ef2){_0x25114a=_0x25114a-0x0;var _0x4f139f=_0xf7b4[_0x25114a];return _0x4f139f;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f7b('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f7b('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f7b('0x1')],'set':function(_0x3e18fd){this[_0x4f7b('0x3')](_0x4f7b('0x4'),_0x3e18fd?_0x3e18fd[_0x4f7b('0x5')](''):[]);},'get':function(){return this[_0x4f7b('0x6')](_0x4f7b('0x4'))?this[_0x4f7b('0x6')](_0x4f7b('0x4'))[_0x4f7b('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 3c39b0b..a75fb95 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 _0xd8fe=['count','includeAll','include','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection'];(function(_0x5834c7,_0x596152){var _0x151d83=function(_0x14ec39){while(--_0x14ec39){_0x5834c7['push'](_0x5834c7['shift']());}};_0x151d83(++_0x596152);}(_0xd8fe,0xa4));var _0xed8f=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0xd8fe[_0x3f0b30];return _0x2748a5;};'use strict';var emlformat=require(_0xed8f('0x0'));var rimraf=require(_0xed8f('0x1'));var zipdir=require(_0xed8f('0x2'));var jsonpatch=require(_0xed8f('0x3'));var rp=require(_0xed8f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed8f('0x5'));var path=require(_0xed8f('0x6'));var sox=require(_0xed8f('0x7'));var csv=require(_0xed8f('0x8'));var ejs=require(_0xed8f('0x9'));var fs=require('fs');var fs_extra=require(_0xed8f('0xa'));var _=require(_0xed8f('0xb'));var squel=require(_0xed8f('0xc'));var crypto=require(_0xed8f('0xd'));var jsforce=require(_0xed8f('0xe'));var deskjs=require(_0xed8f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xed8f('0x10'));var Papa=require(_0xed8f('0x11'));var Redis=require(_0xed8f('0x12'));var authService=require(_0xed8f('0x13'));var qs=require(_0xed8f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed8f('0x15'));var logger=require('../../config/logger')(_0xed8f('0x16'));var utils=require(_0xed8f('0x17'));var config=require(_0xed8f('0x18'));var licenseUtil=require(_0xed8f('0x19'));var db=require(_0xed8f('0x1a'))['db'];function respondWithStatusCode(_0x43df75,_0x2b68d3){_0x2b68d3=_0x2b68d3||0xcc;return function(_0x38d553){if(_0x38d553){return _0x43df75[_0xed8f('0x1b')](_0x2b68d3);}return _0x43df75[_0xed8f('0x1c')](_0x2b68d3)[_0xed8f('0x1d')]();};}function respondWithResult(_0x52ff95,_0xb9a4bd){_0xb9a4bd=_0xb9a4bd||0xc8;return function(_0x221ca1){if(_0x221ca1){return _0x52ff95[_0xed8f('0x1c')](_0xb9a4bd)[_0xed8f('0x1e')](_0x221ca1);}};}function respondWithFilteredResult(_0x52d3ee,_0xec1852){return function(_0x2d7837){if(_0x2d7837){var _0x7a4494=typeof _0xec1852['offset']===_0xed8f('0x1f')&&typeof _0xec1852[_0xed8f('0x20')]===_0xed8f('0x1f');var _0x29e629=_0x2d7837['count'];var _0x319b96=_0x7a4494?0x0:_0xec1852[_0xed8f('0x21')];var _0x3a68af=_0x7a4494?_0x2d7837['count']:_0xec1852[_0xed8f('0x21')]+_0xec1852['limit'];var _0x2a6967;if(_0x3a68af>=_0x29e629){_0x3a68af=_0x29e629;_0x2a6967=0xc8;}else{_0x2a6967=0xce;}_0x52d3ee[_0xed8f('0x1c')](_0x2a6967);return _0x52d3ee[_0xed8f('0x22')](_0xed8f('0x23'),_0x319b96+'-'+_0x3a68af+'/'+_0x29e629)[_0xed8f('0x1e')](_0x2d7837);}return null;};}function patchUpdates(_0x44b44b){return function(_0x5376a0){try{jsonpatch[_0xed8f('0x24')](_0x5376a0,_0x44b44b,!![]);}catch(_0x2c2f39){return BPromise['reject'](_0x2c2f39);}return _0x5376a0[_0xed8f('0x25')]();};}function saveUpdates(_0x19a998,_0x932c3b){return function(_0x5258a1){if(_0x5258a1){return _0x5258a1[_0xed8f('0x26')](_0x19a998)[_0xed8f('0x27')](function(_0x4648aa){return _0x4648aa;});}return null;};}function removeEntity(_0x22d68d,_0x24970b){return function(_0x2a16f2){if(_0x2a16f2){return _0x2a16f2[_0xed8f('0x28')]()[_0xed8f('0x27')](function(){_0x22d68d[_0xed8f('0x1c')](0xcc)[_0xed8f('0x1d')]();});}};}function handleEntityNotFound(_0x51ab5d,_0x57ac70){return function(_0x345a93){if(!_0x345a93){_0x51ab5d['sendStatus'](0x194);}return _0x345a93;};}function handleError(_0x191174,_0x5e2547){_0x5e2547=_0x5e2547||0x1f4;return function(_0x728ac6){logger[_0xed8f('0x29')](_0x728ac6['stack']);if(_0x728ac6[_0xed8f('0x2a')]){delete _0x728ac6[_0xed8f('0x2a')];}_0x191174[_0xed8f('0x1c')](_0x5e2547)[_0xed8f('0x2b')](_0x728ac6);};}exports[_0xed8f('0x2c')]=function(_0xd6de62,_0x43b195){var _0x12b6ba={},_0x96d453={},_0x4e13f1={'count':0x0,'rows':[]};var _0x82c122=_['map'](db['UserProfileSection'][_0xed8f('0x2d')],function(_0x4e55c6){return{'name':_0x4e55c6['fieldName'],'type':_0x4e55c6[_0xed8f('0x2e')][_0xed8f('0x2f')]};});_0x96d453[_0xed8f('0x30')]=_[_0xed8f('0x31')](_0x82c122,_0xed8f('0x2a'));_0x96d453[_0xed8f('0x32')]=_[_0xed8f('0x33')](_0xd6de62[_0xed8f('0x32')]);_0x96d453[_0xed8f('0x34')]=_[_0xed8f('0x35')](_0x96d453[_0xed8f('0x30')],_0x96d453[_0xed8f('0x32')]);_0x12b6ba[_0xed8f('0x36')]=_[_0xed8f('0x35')](_0x96d453[_0xed8f('0x30')],qs[_0xed8f('0x37')](_0xd6de62['query'][_0xed8f('0x37')]));_0x12b6ba[_0xed8f('0x36')]=_0x12b6ba[_0xed8f('0x36')][_0xed8f('0x38')]?_0x12b6ba['attributes']:_0x96d453['model'];if(!_0xd6de62[_0xed8f('0x32')][_0xed8f('0x39')]('nolimit')){_0x12b6ba['limit']=qs[_0xed8f('0x20')](_0xd6de62['query'][_0xed8f('0x20')]);_0x12b6ba[_0xed8f('0x21')]=qs[_0xed8f('0x21')](_0xd6de62['query']['offset']);}_0x12b6ba[_0xed8f('0x3a')]=qs[_0xed8f('0x3b')](_0xd6de62[_0xed8f('0x32')][_0xed8f('0x3b')]);_0x12b6ba['where']=qs[_0xed8f('0x34')](_[_0xed8f('0x3c')](_0xd6de62[_0xed8f('0x32')],_0x96d453[_0xed8f('0x34')]),_0x82c122);if(_0xd6de62[_0xed8f('0x32')][_0xed8f('0x3d')]){_0x12b6ba[_0xed8f('0x3e')]=_[_0xed8f('0x3f')](_0x12b6ba[_0xed8f('0x3e')],{'$or':_['map'](_0x82c122,function(_0x160b23){if(_0x160b23['type']!==_0xed8f('0x40')){var _0x461eaa={};_0x461eaa[_0x160b23[_0xed8f('0x2a')]]={'$like':'%'+_0xd6de62['query'][_0xed8f('0x3d')]+'%'};return _0x461eaa;}})});}_0x12b6ba=_['merge']({},_0x12b6ba,_0xd6de62[_0xed8f('0x41')]);var _0x1fd263={'where':_0x12b6ba[_0xed8f('0x3e')]};return db[_0xed8f('0x42')][_0xed8f('0x43')](_0x1fd263)[_0xed8f('0x27')](function(_0x26fe2c){_0x4e13f1[_0xed8f('0x43')]=_0x26fe2c;if(_0xd6de62[_0xed8f('0x32')][_0xed8f('0x44')]){_0x12b6ba[_0xed8f('0x45')]=[{'all':!![]}];}return db[_0xed8f('0x42')]['findAll'](_0x12b6ba);})[_0xed8f('0x27')](function(_0x26ab89){_0x4e13f1['rows']=_0x26ab89;return _0x4e13f1;})['then'](respondWithFilteredResult(_0x43b195,_0x12b6ba))['catch'](handleError(_0x43b195,null));};exports[_0xed8f('0x46')]=function(_0x28d333,_0x59cae4){var _0x1ee53b={'raw':![],'where':{'id':_0x28d333[_0xed8f('0x47')]['id']}},_0x278e73={};_0x278e73[_0xed8f('0x30')]=_[_0xed8f('0x33')](db[_0xed8f('0x42')][_0xed8f('0x2d')]);_0x278e73['query']=_['keys'](_0x28d333[_0xed8f('0x32')]);_0x278e73['filters']=_['intersection'](_0x278e73['model'],_0x278e73[_0xed8f('0x32')]);_0x1ee53b['attributes']=_['intersection'](_0x278e73[_0xed8f('0x30')],qs[_0xed8f('0x37')](_0x28d333[_0xed8f('0x32')]['fields']));_0x1ee53b['attributes']=_0x1ee53b[_0xed8f('0x36')][_0xed8f('0x38')]?_0x1ee53b[_0xed8f('0x36')]:_0x278e73[_0xed8f('0x30')];if(_0x28d333[_0xed8f('0x32')][_0xed8f('0x44')]){_0x1ee53b[_0xed8f('0x45')]=[{'all':!![]}];}_0x1ee53b=_['merge']({},_0x1ee53b,_0x28d333[_0xed8f('0x41')]);return db['UserProfileSection'][_0xed8f('0x48')](_0x1ee53b)[_0xed8f('0x27')](handleEntityNotFound(_0x59cae4,null))['then'](respondWithResult(_0x59cae4,null))[_0xed8f('0x49')](handleError(_0x59cae4,null));};exports[_0xed8f('0x4a')]=function(_0x11a0ef,_0x1fbe14){return db[_0xed8f('0x42')][_0xed8f('0x4a')](_0x11a0ef[_0xed8f('0x4b')],{})[_0xed8f('0x27')](respondWithResult(_0x1fbe14,0xc9))[_0xed8f('0x49')](handleError(_0x1fbe14,null));};exports[_0xed8f('0x26')]=function(_0x5c9c79,_0x1b52d5){if(_0x5c9c79[_0xed8f('0x4b')]['id']){delete _0x5c9c79[_0xed8f('0x4b')]['id'];}return db[_0xed8f('0x42')][_0xed8f('0x48')]({'where':{'id':_0x5c9c79[_0xed8f('0x47')]['id']}})[_0xed8f('0x27')](handleEntityNotFound(_0x1b52d5,null))['then'](saveUpdates(_0x5c9c79['body'],null))[_0xed8f('0x27')](respondWithResult(_0x1b52d5,null))['catch'](handleError(_0x1b52d5,null));};exports[_0xed8f('0x28')]=function(_0x5146cd,_0x10f586){return db[_0xed8f('0x42')][_0xed8f('0x48')]({'where':{'id':_0x5146cd['params']['id']}})[_0xed8f('0x27')](handleEntityNotFound(_0x10f586,null))[_0xed8f('0x27')](removeEntity(_0x10f586,null))['catch'](handleError(_0x10f586,null));};exports[_0xed8f('0x4c')]=function(_0x298bc4,_0x1dd5df){return db[_0xed8f('0x42')]['describe']()['then'](respondWithResult(_0x1dd5df,null))[_0xed8f('0x49')](handleError(_0x1dd5df,null));}; \ No newline at end of file +var _0x872b=['where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort'];(function(_0x11c45e,_0x1f1d0a){var _0x59bc5e=function(_0x580e4d){while(--_0x580e4d){_0x11c45e['push'](_0x11c45e['shift']());}};_0x59bc5e(++_0x1f1d0a);}(_0x872b,0xdd));var _0xb872=function(_0x1de8a3,_0xf77081){_0x1de8a3=_0x1de8a3-0x0;var _0x106436=_0x872b[_0x1de8a3];return _0x106436;};'use strict';var emlformat=require(_0xb872('0x0'));var rimraf=require(_0xb872('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb872('0x2'));var rp=require('request-promise');var moment=require(_0xb872('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb872('0x4'));var util=require('util');var path=require(_0xb872('0x5'));var sox=require('sox');var csv=require(_0xb872('0x6'));var ejs=require(_0xb872('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb872('0x8'));var deskjs=require(_0xb872('0x9'));var toCsv=require(_0xb872('0x6'));var querystring=require(_0xb872('0xa'));var Papa=require(_0xb872('0xb'));var Redis=require('ioredis');var authService=require(_0xb872('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb872('0xd'));var utils=require(_0xb872('0xe'));var config=require(_0xb872('0xf'));var licenseUtil=require(_0xb872('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fed9d,_0x2f1f3e){_0x2f1f3e=_0x2f1f3e||0xcc;return function(_0x140fe1){if(_0x140fe1){return _0x2fed9d['sendStatus'](_0x2f1f3e);}return _0x2fed9d[_0xb872('0x11')](_0x2f1f3e)[_0xb872('0x12')]();};}function respondWithResult(_0x568f7d,_0x256bd1){_0x256bd1=_0x256bd1||0xc8;return function(_0x2d0c46){if(_0x2d0c46){return _0x568f7d[_0xb872('0x11')](_0x256bd1)[_0xb872('0x13')](_0x2d0c46);}};}function respondWithFilteredResult(_0x430940,_0x42287a){return function(_0x544aab){if(_0x544aab){var _0x2c7307=typeof _0x42287a[_0xb872('0x14')]===_0xb872('0x15')&&typeof _0x42287a[_0xb872('0x16')]===_0xb872('0x15');var _0x554846=_0x544aab[_0xb872('0x17')];var _0x20be1a=_0x2c7307?0x0:_0x42287a[_0xb872('0x14')];var _0x53b598=_0x2c7307?_0x544aab[_0xb872('0x17')]:_0x42287a[_0xb872('0x14')]+_0x42287a[_0xb872('0x16')];var _0x3b8a94;if(_0x53b598>=_0x554846){_0x53b598=_0x554846;_0x3b8a94=0xc8;}else{_0x3b8a94=0xce;}_0x430940['status'](_0x3b8a94);return _0x430940[_0xb872('0x18')](_0xb872('0x19'),_0x20be1a+'-'+_0x53b598+'/'+_0x554846)[_0xb872('0x13')](_0x544aab);}return null;};}function patchUpdates(_0x30ce66){return function(_0x424094){try{jsonpatch[_0xb872('0x1a')](_0x424094,_0x30ce66,!![]);}catch(_0x13736d){return BPromise[_0xb872('0x1b')](_0x13736d);}return _0x424094[_0xb872('0x1c')]();};}function saveUpdates(_0x33d3ef,_0x594f75){return function(_0x395279){if(_0x395279){return _0x395279[_0xb872('0x1d')](_0x33d3ef)[_0xb872('0x1e')](function(_0x197bd6){return _0x197bd6;});}return null;};}function removeEntity(_0x27f184,_0x49ed2b){return function(_0x14627a){if(_0x14627a){return _0x14627a[_0xb872('0x1f')]()[_0xb872('0x1e')](function(){_0x27f184[_0xb872('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498b5f,_0x3dd2c9){return function(_0x306c56){if(!_0x306c56){_0x498b5f[_0xb872('0x20')](0x194);}return _0x306c56;};}function handleError(_0x6fbd73,_0x2bcfe9){_0x2bcfe9=_0x2bcfe9||0x1f4;return function(_0x3826a5){logger[_0xb872('0x21')](_0x3826a5['stack']);if(_0x3826a5['name']){delete _0x3826a5[_0xb872('0x22')];}_0x6fbd73[_0xb872('0x11')](_0x2bcfe9)['send'](_0x3826a5);};}exports[_0xb872('0x23')]=function(_0x3270fc,_0x1736db){var _0x32ba73={},_0xf7d614={},_0x100c70={'count':0x0,'rows':[]};var _0x59e591=_[_0xb872('0x24')](db[_0xb872('0x25')][_0xb872('0x26')],function(_0xcfe4a0){return{'name':_0xcfe4a0[_0xb872('0x27')],'type':_0xcfe4a0[_0xb872('0x28')]['key']};});_0xf7d614[_0xb872('0x29')]=_[_0xb872('0x24')](_0x59e591,_0xb872('0x22'));_0xf7d614[_0xb872('0x2a')]=_[_0xb872('0x2b')](_0x3270fc[_0xb872('0x2a')]);_0xf7d614[_0xb872('0x2c')]=_[_0xb872('0x2d')](_0xf7d614[_0xb872('0x29')],_0xf7d614[_0xb872('0x2a')]);_0x32ba73[_0xb872('0x2e')]=_['intersection'](_0xf7d614[_0xb872('0x29')],qs[_0xb872('0x2f')](_0x3270fc['query'][_0xb872('0x2f')]));_0x32ba73[_0xb872('0x2e')]=_0x32ba73[_0xb872('0x2e')][_0xb872('0x30')]?_0x32ba73['attributes']:_0xf7d614[_0xb872('0x29')];if(!_0x3270fc['query']['hasOwnProperty'](_0xb872('0x31'))){_0x32ba73[_0xb872('0x16')]=qs[_0xb872('0x16')](_0x3270fc[_0xb872('0x2a')][_0xb872('0x16')]);_0x32ba73[_0xb872('0x14')]=qs[_0xb872('0x14')](_0x3270fc[_0xb872('0x2a')][_0xb872('0x14')]);}_0x32ba73['order']=qs[_0xb872('0x32')](_0x3270fc[_0xb872('0x2a')]['sort']);_0x32ba73[_0xb872('0x33')]=qs['filters'](_[_0xb872('0x34')](_0x3270fc[_0xb872('0x2a')],_0xf7d614[_0xb872('0x2c')]),_0x59e591);if(_0x3270fc[_0xb872('0x2a')]['filter']){_0x32ba73[_0xb872('0x33')]=_['merge'](_0x32ba73[_0xb872('0x33')],{'$or':_[_0xb872('0x24')](_0x59e591,function(_0x4d74a5){if(_0x4d74a5[_0xb872('0x28')]!==_0xb872('0x35')){var _0x321600={};_0x321600[_0x4d74a5[_0xb872('0x22')]]={'$like':'%'+_0x3270fc[_0xb872('0x2a')][_0xb872('0x36')]+'%'};return _0x321600;}})});}_0x32ba73=_[_0xb872('0x37')]({},_0x32ba73,_0x3270fc[_0xb872('0x38')]);var _0xd0226f={'where':_0x32ba73['where']};return db['UserProfileSection']['count'](_0xd0226f)[_0xb872('0x1e')](function(_0x1e440c){_0x100c70[_0xb872('0x17')]=_0x1e440c;if(_0x3270fc[_0xb872('0x2a')][_0xb872('0x39')]){_0x32ba73[_0xb872('0x3a')]=[{'all':!![]}];}return db[_0xb872('0x25')][_0xb872('0x3b')](_0x32ba73);})[_0xb872('0x1e')](function(_0x5d82f7){_0x100c70[_0xb872('0x3c')]=_0x5d82f7;return _0x100c70;})[_0xb872('0x1e')](respondWithFilteredResult(_0x1736db,_0x32ba73))[_0xb872('0x3d')](handleError(_0x1736db,null));};exports[_0xb872('0x3e')]=function(_0x370389,_0x461d26){var _0x257972={'raw':![],'where':{'id':_0x370389[_0xb872('0x3f')]['id']}},_0x10d821={};_0x10d821[_0xb872('0x29')]=_[_0xb872('0x2b')](db[_0xb872('0x25')][_0xb872('0x26')]);_0x10d821[_0xb872('0x2a')]=_[_0xb872('0x2b')](_0x370389['query']);_0x10d821[_0xb872('0x2c')]=_['intersection'](_0x10d821['model'],_0x10d821[_0xb872('0x2a')]);_0x257972[_0xb872('0x2e')]=_[_0xb872('0x2d')](_0x10d821[_0xb872('0x29')],qs[_0xb872('0x2f')](_0x370389[_0xb872('0x2a')]['fields']));_0x257972['attributes']=_0x257972[_0xb872('0x2e')]['length']?_0x257972[_0xb872('0x2e')]:_0x10d821[_0xb872('0x29')];if(_0x370389[_0xb872('0x2a')]['includeAll']){_0x257972['include']=[{'all':!![]}];}_0x257972=_['merge']({},_0x257972,_0x370389['options']);return db[_0xb872('0x25')][_0xb872('0x40')](_0x257972)[_0xb872('0x1e')](handleEntityNotFound(_0x461d26,null))[_0xb872('0x1e')](respondWithResult(_0x461d26,null))[_0xb872('0x3d')](handleError(_0x461d26,null));};exports[_0xb872('0x41')]=function(_0x1525c9,_0x2483ad){return db[_0xb872('0x25')][_0xb872('0x41')](_0x1525c9['body'],{})[_0xb872('0x1e')](respondWithResult(_0x2483ad,0xc9))[_0xb872('0x3d')](handleError(_0x2483ad,null));};exports[_0xb872('0x1d')]=function(_0x3ebeaa,_0xd9e99c){if(_0x3ebeaa[_0xb872('0x42')]['id']){delete _0x3ebeaa[_0xb872('0x42')]['id'];}return db[_0xb872('0x25')]['find']({'where':{'id':_0x3ebeaa[_0xb872('0x3f')]['id']}})[_0xb872('0x1e')](handleEntityNotFound(_0xd9e99c,null))['then'](saveUpdates(_0x3ebeaa['body'],null))['then'](respondWithResult(_0xd9e99c,null))[_0xb872('0x3d')](handleError(_0xd9e99c,null));};exports[_0xb872('0x1f')]=function(_0x57341c,_0x1944e6){return db[_0xb872('0x25')][_0xb872('0x40')]({'where':{'id':_0x57341c[_0xb872('0x3f')]['id']}})[_0xb872('0x1e')](handleEntityNotFound(_0x1944e6,null))[_0xb872('0x1e')](removeEntity(_0x1944e6,null))[_0xb872('0x3d')](handleError(_0x1944e6,null));};exports[_0xb872('0x43')]=function(_0x585dc6,_0x3e9ba1){return db[_0xb872('0x25')][_0xb872('0x43')]()['then'](respondWithResult(_0x3e9ba1,null))[_0xb872('0x3d')](handleError(_0x3e9ba1,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 4f49db2..4dafc79 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 _0x1eab=['sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','UserProfileSection','user_profile_has_sections'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1eab,0xfe));var _0xb1ea=function(_0x3ad958,_0x384d0d){_0x3ad958=_0x3ad958-0x0;var _0x20d53c=_0x1eab[_0x3ad958];return _0x20d53c;};'use strict';var _=require('lodash');var util=require(_0xb1ea('0x0'));var logger=require(_0xb1ea('0x1'))(_0xb1ea('0x2'));var moment=require(_0xb1ea('0x3'));var BPromise=require(_0xb1ea('0x4'));var rp=require(_0xb1ea('0x5'));var fs=require('fs');var path=require(_0xb1ea('0x6'));var rimraf=require(_0xb1ea('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x286ae1,_0x2803e3){return _0x286ae1['define'](_0xb1ea('0x8'),attributes,{'tableName':_0xb1ea('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb1ea('0xa'),_0xb1ea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91ba=['moment','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x23ca3d,_0x491677){var _0x4b4ba0=function(_0x42c804){while(--_0x42c804){_0x23ca3d['push'](_0x23ca3d['shift']());}};_0x4b4ba0(++_0x491677);}(_0x91ba,0x74));var _0xa91b=function(_0x50ca95,_0x160d06){_0x50ca95=_0x50ca95-0x0;var _0x41ea76=_0x91ba[_0x50ca95];return _0x41ea76;};'use strict';var _=require(_0xa91b('0x0'));var util=require(_0xa91b('0x1'));var logger=require(_0xa91b('0x2'))(_0xa91b('0x3'));var moment=require(_0xa91b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa91b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa91b('0x6'));var attributes=require(_0xa91b('0x7'));module[_0xa91b('0x8')]=function(_0xec73fc,_0x4d3b7d){return _0xec73fc[_0xa91b('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xa91b('0xa'),_0xa91b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 738ecb4..c8eb04b 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 _0x6a35=['UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x6a35,0xeb));var _0x56a3=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x6a35[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x56a3('0x0'));var util=require(_0x56a3('0x1'));var moment=require(_0x56a3('0x2'));var BPromise=require(_0x56a3('0x3'));var rs=require(_0x56a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x56a3('0x6'))(_0x56a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x56a3('0x8'));var client=jayson['client'][_0x56a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x498916,_0x3cb85a,_0x418501){return new BPromise(function(_0x17a1b1,_0x228503){return client[_0x56a3('0xa')](_0x498916,_0x418501)['then'](function(_0x5a6539){logger[_0x56a3('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x3cb85a,_0x56a3('0xc'));logger[_0x56a3('0xd')](_0x56a3('0xe'),_0x3cb85a,_0x56a3('0xc'),JSON[_0x56a3('0xf')](_0x5a6539));if(_0x5a6539['error']){if(_0x5a6539[_0x56a3('0x10')]['code']===0x1f4){logger['error'](_0x56a3('0x11'),_0x3cb85a,_0x5a6539[_0x56a3('0x10')][_0x56a3('0x12')]);return _0x228503(_0x5a6539[_0x56a3('0x10')][_0x56a3('0x12')]);}logger['error'](_0x56a3('0x11'),_0x3cb85a,_0x5a6539[_0x56a3('0x10')][_0x56a3('0x12')]);return _0x17a1b1(_0x5a6539[_0x56a3('0x10')][_0x56a3('0x12')]);}else{logger['info'](_0x56a3('0x11'),_0x3cb85a,_0x56a3('0xc'));_0x17a1b1(_0x5a6539[_0x56a3('0x13')]['message']);}})[_0x56a3('0x14')](function(_0x550a3e){logger[_0x56a3('0x10')](_0x56a3('0x11'),_0x3cb85a,_0x550a3e);_0x228503(_0x550a3e);});});} \ No newline at end of file +var _0x7263=['rpc','../../config/environment','jayson/promise','client','http','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x5d11ac,_0x1934f8){var _0x2a9c01=function(_0x51d47e){while(--_0x51d47e){_0x5d11ac['push'](_0x5d11ac['shift']());}};_0x2a9c01(++_0x1934f8);}(_0x7263,0xd8));var _0x3726=function(_0xc9373b,_0x5a2474){_0xc9373b=_0xc9373b-0x0;var _0x34180a=_0x7263[_0xc9373b];return _0x34180a;};'use strict';var _=require(_0x3726('0x0'));var util=require(_0x3726('0x1'));var moment=require(_0x3726('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3726('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3726('0x4'));var config=require(_0x3726('0x5'));var jayson=require(_0x3726('0x6'));var client=jayson[_0x3726('0x7')][_0x3726('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x115422,_0x4692b8,_0x280f3b){return new BPromise(function(_0x7d72b1,_0x13ee12){return client['request'](_0x115422,_0x280f3b)['then'](function(_0x3914e4){logger[_0x3726('0x9')](_0x3726('0xa'),_0x4692b8,'request\x20sent');logger[_0x3726('0xb')](_0x3726('0xc'),_0x4692b8,_0x3726('0xd'),JSON[_0x3726('0xe')](_0x3914e4));if(_0x3914e4['error']){if(_0x3914e4['error'][_0x3726('0xf')]===0x1f4){logger['error'](_0x3726('0xa'),_0x4692b8,_0x3914e4[_0x3726('0x10')][_0x3726('0x11')]);return _0x13ee12(_0x3914e4[_0x3726('0x10')]['message']);}logger[_0x3726('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x4692b8,_0x3914e4[_0x3726('0x10')]['message']);return _0x7d72b1(_0x3914e4[_0x3726('0x10')]['message']);}else{logger[_0x3726('0x9')](_0x3726('0xa'),_0x4692b8,_0x3726('0xd'));_0x7d72b1(_0x3914e4[_0x3726('0x12')][_0x3726('0x11')]);}})[_0x3726('0x13')](function(_0x1ae204){logger[_0x3726('0x10')](_0x3726('0xa'),_0x4692b8,_0x1ae204);_0x13ee12(_0x1ae204);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a820aa4..b859d5f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e3cbd,_0x2fd5cd){var _0x1ed1ce=function(_0x4bae94){while(--_0x4bae94){_0x5e3cbd['push'](_0x5e3cbd['shift']());}};_0x1ed1ce(++_0x2fd5cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x181113,_0x1ac92a){var _0x3595f2=function(_0x162373){while(--_0x162373){_0x181113['push'](_0x181113['shift']());}};_0x3595f2(++_0x1ac92a);}(_0x70e0,0x17b));var _0x070e=function(_0xf295e2,_0x2cfac4){_0xf295e2=_0xf295e2-0x0;var _0x5c08da=_0x70e0[_0xf295e2];return _0x5c08da;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 0492df4..8a6f9a3 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 _0x9a28=['exports','INTEGER','sequelize'];(function(_0x50984f,_0x599172){var _0x510af7=function(_0x2d27d2){while(--_0x2d27d2){_0x50984f['push'](_0x50984f['shift']());}};_0x510af7(++_0x599172);}(_0x9a28,0x1bb));var _0x89a2=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x9a28[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0x89a2('0x0'));module[_0x89a2('0x1')]={'penalty':{'type':Sequelize[_0x89a2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1c17=['exports','INTEGER','sequelize'];(function(_0x3f333d,_0x1ab93e){var _0x29b117=function(_0x15a03a){while(--_0x15a03a){_0x3f333d['push'](_0x3f333d['shift']());}};_0x29b117(++_0x1ab93e);}(_0x1c17,0x158));var _0x71c1=function(_0x23ca3c,_0x129bd8){_0x23ca3c=_0x23ca3c-0x0;var _0x3e8d8a=_0x1c17[_0x23ca3c];return _0x3e8d8a;};'use strict';var Sequelize=require(_0x71c1('0x0'));module[_0x71c1('0x1')]={'penalty':{'type':Sequelize[_0x71c1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b5a3a77..18d6dcc 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 _0xdec3=['../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x42e44f,_0x5b6c31){var _0x5e3992=function(_0x39f26b){while(--_0x39f26b){_0x42e44f['push'](_0x42e44f['shift']());}};_0x5e3992(++_0x5b6c31);}(_0xdec3,0x89));var _0x3dec=function(_0x317d78,_0x148b50){_0x317d78=_0x317d78-0x0;var _0x39cd0a=_0xdec3[_0x317d78];return _0x39cd0a;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var logger=require(_0x3dec('0x1'))(_0x3dec('0x2'));var moment=require(_0x3dec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dec('0x4'));var fs=require('fs');var path=require(_0x3dec('0x5'));var rimraf=require(_0x3dec('0x6'));var config=require(_0x3dec('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x3dec('0x8')]=function(_0x2894eb,_0x347c06){return _0x2894eb[_0x3dec('0x9')](_0x3dec('0xa'),attributes,{'tableName':_0x3dec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','api','moment','bluebird'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x33af,0xec));var _0xf33a=function(_0x159eab,_0x22d972){_0x159eab=_0x159eab-0x0;var _0x47e933=_0x33af[_0x159eab];return _0x47e933;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('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 cd6a012..06b739d 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 _0x08fa=['jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x13ce63,_0x154e0e){var _0xe8745e=function(_0x5da0c1){while(--_0x5da0c1){_0x13ce63['push'](_0x13ce63['shift']());}};_0xe8745e(++_0x154e0e);}(_0x08fa,0x116));var _0xa08f=function(_0x20ab68,_0x22c2c4){_0x20ab68=_0x20ab68-0x0;var _0x17cd71=_0x08fa[_0x20ab68];return _0x17cd71;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa08f('0x0'));var BPromise=require('bluebird');var rs=require(_0xa08f('0x1'));var fs=require('fs');var Redis=require(_0xa08f('0x2'));var db=require(_0xa08f('0x3'))['db'];var utils=require(_0xa08f('0x4'));var logger=require(_0xa08f('0x5'))(_0xa08f('0x6'));var config=require('../../config/environment');var jayson=require(_0xa08f('0x7'));var client=jayson[_0xa08f('0x8')][_0xa08f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f5a9e,_0x4483e1,_0x1378fc){return new BPromise(function(_0x571b1e,_0x5e6e75){return client['request'](_0x5f5a9e,_0x1378fc)[_0xa08f('0xa')](function(_0x4ffbf0){logger['info'](_0xa08f('0xb'),_0x4483e1,_0xa08f('0xc'));logger[_0xa08f('0xd')](_0xa08f('0xe'),_0x4483e1,_0xa08f('0xc'),JSON[_0xa08f('0xf')](_0x4ffbf0));if(_0x4ffbf0[_0xa08f('0x10')]){if(_0x4ffbf0[_0xa08f('0x10')]['code']===0x1f4){logger[_0xa08f('0x10')](_0xa08f('0xb'),_0x4483e1,_0x4ffbf0[_0xa08f('0x10')]['message']);return _0x5e6e75(_0x4ffbf0[_0xa08f('0x10')]['message']);}logger[_0xa08f('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4483e1,_0x4ffbf0['error'][_0xa08f('0x11')]);return _0x571b1e(_0x4ffbf0[_0xa08f('0x10')][_0xa08f('0x11')]);}else{logger['info'](_0xa08f('0xb'),_0x4483e1,_0xa08f('0xc'));_0x571b1e(_0x4ffbf0['result']['message']);}})[_0xa08f('0x12')](function(_0x585761){logger[_0xa08f('0x10')](_0xa08f('0xb'),_0x4483e1,_0x585761);_0x5e6e75(_0x585761);});});} \ No newline at end of file +var _0x04b9=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49637f,_0x102fa1){var _0x2fd347=function(_0x4288b7){while(--_0x4288b7){_0x49637f['push'](_0x49637f['shift']());}};_0x2fd347(++_0x102fa1);}(_0x04b9,0x98));var _0x904b=function(_0x5d05a3,_0x4f9e94){_0x5d05a3=_0x5d05a3-0x0;var _0x23fb8c=_0x04b9[_0x5d05a3];return _0x23fb8c;};'use strict';var _=require('lodash');var util=require(_0x904b('0x0'));var moment=require(_0x904b('0x1'));var BPromise=require(_0x904b('0x2'));var rs=require(_0x904b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x904b('0x4'));var logger=require(_0x904b('0x5'))(_0x904b('0x6'));var config=require(_0x904b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x904b('0x8')][_0x904b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248985,_0x5cec,_0x20e9d8){return new BPromise(function(_0x392ec7,_0xe0f64a){return client[_0x904b('0xa')](_0x248985,_0x20e9d8)[_0x904b('0xb')](function(_0x42372d){logger[_0x904b('0xc')](_0x904b('0xd'),_0x5cec,'request\x20sent');logger['debug'](_0x904b('0xe'),_0x5cec,'request\x20sent',JSON['stringify'](_0x42372d));if(_0x42372d[_0x904b('0xf')]){if(_0x42372d[_0x904b('0xf')][_0x904b('0x10')]===0x1f4){logger['error'](_0x904b('0xd'),_0x5cec,_0x42372d['error'][_0x904b('0x11')]);return _0xe0f64a(_0x42372d[_0x904b('0xf')][_0x904b('0x11')]);}logger[_0x904b('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5cec,_0x42372d[_0x904b('0xf')][_0x904b('0x11')]);return _0x392ec7(_0x42372d[_0x904b('0xf')][_0x904b('0x11')]);}else{logger[_0x904b('0xc')](_0x904b('0xd'),_0x5cec,_0x904b('0x12'));_0x392ec7(_0x42372d['result'][_0x904b('0x11')]);}})[_0x904b('0x13')](function(_0x4b47a0){logger[_0x904b('0xf')](_0x904b('0xd'),_0x5cec,_0x4b47a0);_0xe0f64a(_0x4b47a0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 4b46726..2a57276 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4c136b,_0x45615f){var _0x30b1f7=function(_0xeca1b7){while(--_0xeca1b7){_0x4c136b['push'](_0x4c136b['shift']());}};_0x30b1f7(++_0x45615f);}(_0xedd9,0xfc));var _0x9edd=function(_0x289c1e,_0x1b3421){_0x289c1e=_0x289c1e-0x0;var _0x58555c=_0xedd9[_0x289c1e];return _0x58555c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xcdf37f,_0x5a64c5){var _0x3d2488=function(_0x8b85bb){while(--_0x8b85bb){_0xcdf37f['push'](_0xcdf37f['shift']());}};_0x3d2488(++_0x5a64c5);}(_0x70e0,0x17b));var _0x070e=function(_0x4f7f6a,_0xbf4d3f){_0x4f7f6a=_0x4f7f6a-0x0;var _0x4a3d09=_0x70e0[_0x4f7f6a];return _0x4a3d09;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 38a9f97..e3570d9 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 _0x492e=['exports','INTEGER','sequelize'];(function(_0x3f5c7a,_0x28a535){var _0x33d8ed=function(_0x932d39){while(--_0x932d39){_0x3f5c7a['push'](_0x3f5c7a['shift']());}};_0x33d8ed(++_0x28a535);}(_0x492e,0xce));var _0xe492=function(_0x570993,_0x409f61){_0x570993=_0x570993-0x0;var _0x172ca0=_0x492e[_0x570993];return _0x172ca0;};'use strict';var Sequelize=require(_0xe492('0x0'));module[_0xe492('0x1')]={'penalty':{'type':Sequelize[_0xe492('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x27e4=['INTEGER','sequelize','exports'];(function(_0x148a0f,_0x540269){var _0x5ab27e=function(_0x1d2960){while(--_0x1d2960){_0x148a0f['push'](_0x148a0f['shift']());}};_0x5ab27e(++_0x540269);}(_0x27e4,0x1ae));var _0x427e=function(_0x36c726,_0xc44ddb){_0x36c726=_0x36c726-0x0;var _0x58b1a9=_0x27e4[_0x36c726];return _0x58b1a9;};'use strict';var Sequelize=require(_0x427e('0x0'));module[_0x427e('0x1')]={'penalty':{'type':Sequelize[_0x427e('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 872b68f..ca398a1 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 _0xe809=['./userVoiceQueue.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x24696b,_0x12de19){var _0x3f86b0=function(_0x11f2eb){while(--_0x11f2eb){_0x24696b['push'](_0x24696b['shift']());}};_0x3f86b0(++_0x12de19);}(_0xe809,0x19a));var _0x9e80=function(_0x5ed573,_0x291161){_0x5ed573=_0x5ed573-0x0;var _0x1aab1c=_0xe809[_0x5ed573];return _0x1aab1c;};'use strict';var _=require(_0x9e80('0x0'));var util=require('util');var logger=require(_0x9e80('0x1'))(_0x9e80('0x2'));var moment=require(_0x9e80('0x3'));var BPromise=require(_0x9e80('0x4'));var rp=require(_0x9e80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e80('0x6'));var config=require(_0x9e80('0x7'));var attributes=require(_0x9e80('0x8'));module[_0x9e80('0x9')]=function(_0x204b8f,_0xf7d281){return _0x204b8f[_0x9e80('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3078=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x3078,0x1c5));var _0x8307=function(_0x580409,_0x11a6e8){_0x580409=_0x580409-0x0;var _0x126a85=_0x3078[_0x580409];return _0x126a85;};'use strict';var _=require(_0x8307('0x0'));var util=require(_0x8307('0x1'));var logger=require(_0x8307('0x2'))(_0x8307('0x3'));var moment=require(_0x8307('0x4'));var BPromise=require(_0x8307('0x5'));var rp=require(_0x8307('0x6'));var fs=require('fs');var path=require(_0x8307('0x7'));var rimraf=require(_0x8307('0x8'));var config=require('../../config/environment');var attributes=require(_0x8307('0x9'));module[_0x8307('0xa')]=function(_0x4d40a9,_0x41bef2){return _0x4d40a9[_0x8307('0xb')](_0x8307('0xc'),attributes,{'tableName':_0x8307('0xd'),'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 d594a84..076b170 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 _0x8191=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info'];(function(_0x33ddb0,_0x18c1c3){var _0x12cee3=function(_0xa44ef5){while(--_0xa44ef5){_0x33ddb0['push'](_0x33ddb0['shift']());}};_0x12cee3(++_0x18c1c3);}(_0x8191,0x1d7));var _0x1819=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0x8191[_0x4a96d2];return _0x38af04;};'use strict';var _=require(_0x1819('0x0'));var util=require(_0x1819('0x1'));var moment=require(_0x1819('0x2'));var BPromise=require(_0x1819('0x3'));var rs=require(_0x1819('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1819('0x5'))['db'];var utils=require(_0x1819('0x6'));var logger=require('../../config/logger')(_0x1819('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1819('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x71da92,_0x31a516,_0xe4b931){return new BPromise(function(_0x53d7ba,_0x325d8f){return client[_0x1819('0x9')](_0x71da92,_0xe4b931)[_0x1819('0xa')](function(_0x350a21){logger[_0x1819('0xb')](_0x1819('0xc'),_0x31a516,_0x1819('0xd'));logger[_0x1819('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x31a516,_0x1819('0xd'),JSON[_0x1819('0xf')](_0x350a21));if(_0x350a21[_0x1819('0x10')]){if(_0x350a21[_0x1819('0x10')][_0x1819('0x11')]===0x1f4){logger['error'](_0x1819('0xc'),_0x31a516,_0x350a21[_0x1819('0x10')][_0x1819('0x12')]);return _0x325d8f(_0x350a21[_0x1819('0x10')][_0x1819('0x12')]);}logger[_0x1819('0x10')](_0x1819('0xc'),_0x31a516,_0x350a21[_0x1819('0x10')][_0x1819('0x12')]);return _0x53d7ba(_0x350a21[_0x1819('0x10')][_0x1819('0x12')]);}else{logger[_0x1819('0xb')](_0x1819('0xc'),_0x31a516,_0x1819('0xd'));_0x53d7ba(_0x350a21[_0x1819('0x13')][_0x1819('0x12')]);}})[_0x1819('0x14')](function(_0x4f7bbd){logger['error'](_0x1819('0xc'),_0x31a516,_0x4f7bbd);_0x325d8f(_0x4f7bbd);});});} \ No newline at end of file +var _0x66f0=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xef5d52,_0x43cce5){var _0x3c31b5=function(_0xd0bd3f){while(--_0xd0bd3f){_0xef5d52['push'](_0xef5d52['shift']());}};_0x3c31b5(++_0x43cce5);}(_0x66f0,0xa3));var _0x066f=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0x66f0[_0x4d05a0];return _0x4c999c;};'use strict';var _=require(_0x066f('0x0'));var util=require('util');var moment=require(_0x066f('0x1'));var BPromise=require(_0x066f('0x2'));var rs=require(_0x066f('0x3'));var fs=require('fs');var Redis=require(_0x066f('0x4'));var db=require(_0x066f('0x5'))['db'];var utils=require(_0x066f('0x6'));var logger=require(_0x066f('0x7'))(_0x066f('0x8'));var config=require(_0x066f('0x9'));var jayson=require(_0x066f('0xa'));var client=jayson[_0x066f('0xb')][_0x066f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x346987,_0x4c98d6,_0x3b3dd4){return new BPromise(function(_0x250e50,_0x2f0180){return client[_0x066f('0xd')](_0x346987,_0x3b3dd4)[_0x066f('0xe')](function(_0x986117){logger[_0x066f('0xf')](_0x066f('0x10'),_0x4c98d6,_0x066f('0x11'));logger[_0x066f('0x12')](_0x066f('0x13'),_0x4c98d6,_0x066f('0x11'),JSON[_0x066f('0x14')](_0x986117));if(_0x986117[_0x066f('0x15')]){if(_0x986117[_0x066f('0x15')][_0x066f('0x16')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4c98d6,_0x986117[_0x066f('0x15')][_0x066f('0x17')]);return _0x2f0180(_0x986117['error'][_0x066f('0x17')]);}logger['error'](_0x066f('0x10'),_0x4c98d6,_0x986117[_0x066f('0x15')][_0x066f('0x17')]);return _0x250e50(_0x986117['error'][_0x066f('0x17')]);}else{logger[_0x066f('0xf')](_0x066f('0x10'),_0x4c98d6,_0x066f('0x11'));_0x250e50(_0x986117[_0x066f('0x18')][_0x066f('0x17')]);}})['catch'](function(_0x58aff1){logger[_0x066f('0x15')](_0x066f('0x10'),_0x4c98d6,_0x58aff1);_0x2f0180(_0x58aff1);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9b792dc..d0c94d9 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19a874,_0x442a65){var _0x54edf5=function(_0x368189){while(--_0x368189){_0x19a874['push'](_0x19a874['shift']());}};_0x54edf5(++_0x442a65);}(_0xe706,0xa3));var _0x6e70=function(_0x1a209f,_0x1b35e6){_0x1a209f=_0x1a209f-0x0;var _0x376b56=_0xe706[_0x1a209f];return _0x376b56;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x233f1d,_0xaab166){var _0x26e951=function(_0x225d81){while(--_0x225d81){_0x233f1d['push'](_0x233f1d['shift']());}};_0x26e951(++_0xaab166);}(_0xe706,0xa3));var _0x6e70=function(_0x3572cb,_0x4149d3){_0x3572cb=_0x3572cb-0x0;var _0x33a398=_0xe706[_0x3572cb];return _0x33a398;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c9e6f69..aadbc0e 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 _0x662a=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x662a,0xae));var _0xa662=function(_0xc5ea2,_0x459fbe){_0xc5ea2=_0xc5ea2-0x0;var _0x47c33d=_0x662a[_0xc5ea2];return _0x47c33d;};'use strict';var Sequelize=require('sequelize');module[_0xa662('0x0')]={'uniqueid':{'type':Sequelize[_0xa662('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa662('0x2')},'membername':{'type':Sequelize[_0xa662('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa662('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa662('0x3')],'allowNull':![],'unique':_0xa662('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xa662('0x3')],'allowNull':![],'unique':_0xa662('0x4'),'comment':_0xa662('0x2')},'penalty':{'type':Sequelize[_0xa662('0x1')](0xb),'defaultValue':0x0,'comment':_0xa662('0x2')},'paused':{'type':Sequelize[_0xa662('0x1')](0xb),'defaultValue':0x0,'comment':_0xa662('0x2')}}; \ No newline at end of file +var _0xc4ad=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x5aca86,_0x95b9cc){var _0x281863=function(_0x2bff3a){while(--_0x2bff3a){_0x5aca86['push'](_0x5aca86['shift']());}};_0x281863(++_0x95b9cc);}(_0xc4ad,0xd2));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdc4a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdc4a('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdc4a('0x2')},'membername':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xdc4a('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xdc4a('0x2')},'VoiceQueueId':{'type':Sequelize[_0xdc4a('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xdc4a('0x3')],'allowNull':![],'unique':_0xdc4a('0x4'),'comment':_0xdc4a('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xdc4a('0x2')},'paused':{'type':Sequelize[_0xdc4a('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1caef2a..c462226 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 _0x0d85=['remove','emit','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x2d6d0f,_0x3cf2a5){var _0xd2bee6=function(_0x2fc9cd){while(--_0x2fc9cd){_0x2d6d0f['push'](_0x2d6d0f['shift']());}};_0xd2bee6(++_0x3cf2a5);}(_0x0d85,0xc9));var _0x50d8=function(_0x14d344,_0x28b4d6){_0x14d344=_0x14d344-0x0;var _0x11a4c3=_0x0d85[_0x14d344];return _0x11a4c3;};'use strict';var EventEmitter=require(_0x50d8('0x0'));var UserVoiceQueueRt=require(_0x50d8('0x1'))['db'][_0x50d8('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x50d8('0x3')](0x0);var events={'afterCreate':_0x50d8('0x4'),'afterUpdate':_0x50d8('0x5'),'afterDestroy':_0x50d8('0x6')};function emitEvent(_0x3cb19f){return function(_0x3b5a7b,_0xea419c,_0x5df1d7){UserVoiceQueueRtEvents[_0x50d8('0x7')](_0x3cb19f+':'+_0x3b5a7b['id'],_0x3b5a7b);UserVoiceQueueRtEvents[_0x50d8('0x7')](_0x3cb19f,_0x3b5a7b);_0x5df1d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x50d8('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa137=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt','save'];(function(_0x2f3d35,_0x32e2c4){var _0x1d2327=function(_0x586880){while(--_0x586880){_0x2f3d35['push'](_0x2f3d35['shift']());}};_0x1d2327(++_0x32e2c4);}(_0xa137,0xd5));var _0x7a13=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xa137[_0xbd08b4];return _0x314f1e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x7a13('0x0'))['db'][_0x7a13('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7a13('0x2'),'afterUpdate':_0x7a13('0x3'),'afterDestroy':_0x7a13('0x4')};function emitEvent(_0x634adb){return function(_0x1c3538,_0x410533,_0x18d2e2){UserVoiceQueueRtEvents[_0x7a13('0x5')](_0x634adb+':'+_0x1c3538['id'],_0x1c3538);UserVoiceQueueRtEvents[_0x7a13('0x5')](_0x634adb,_0x1c3538);_0x18d2e2(null);};}for(var e in events){if(events[_0x7a13('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x7a13('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index bdb7c29..13aa4b5 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 _0xee21=['../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x378830,_0xb532d7){var _0x4e4348=function(_0x496bc4){while(--_0x496bc4){_0x378830['push'](_0x378830['shift']());}};_0x4e4348(++_0xb532d7);}(_0xee21,0x13d));var _0x1ee2=function(_0x54bf55,_0x11ed8c){_0x54bf55=_0x54bf55-0x0;var _0x151675=_0xee21[_0x54bf55];return _0x151675;};'use strict';var _=require(_0x1ee2('0x0'));var util=require(_0x1ee2('0x1'));var logger=require(_0x1ee2('0x2'))(_0x1ee2('0x3'));var moment=require(_0x1ee2('0x4'));var BPromise=require(_0x1ee2('0x5'));var rp=require(_0x1ee2('0x6'));var fs=require('fs');var path=require(_0x1ee2('0x7'));var rimraf=require('rimraf');var config=require(_0x1ee2('0x8'));var attributes=require(_0x1ee2('0x9'));module[_0x1ee2('0xa')]=function(_0x431a04,_0x5caa2c){return _0x431a04['define'](_0x1ee2('0xb'),attributes,{'tableName':_0x1ee2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2416=['user_has_voice_queues_rt','lodash','util','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x232be5,_0x1d7ae4){var _0x3ef8b9=function(_0x3389f5){while(--_0x3389f5){_0x232be5['push'](_0x232be5['shift']());}};_0x3ef8b9(++_0x1d7ae4);}(_0x2416,0x91));var _0x6241=function(_0x1cf3ec,_0x2e7628){_0x1cf3ec=_0x1cf3ec-0x0;var _0x3d9def=_0x2416[_0x1cf3ec];return _0x3d9def;};'use strict';var _=require(_0x6241('0x0'));var util=require(_0x6241('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6241('0x2'));var BPromise=require(_0x6241('0x3'));var rp=require(_0x6241('0x4'));var fs=require('fs');var path=require(_0x6241('0x5'));var rimraf=require('rimraf');var config=require(_0x6241('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x6d0fc6,_0x242987){return _0x6d0fc6[_0x6241('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0x6241('0x8'),'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 a0573ad..22e6197 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 _0xfb2d=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x263b14,_0x2391ad){var _0x434143=function(_0x231681){while(--_0x231681){_0x263b14['push'](_0x263b14['shift']());}};_0x434143(++_0x2391ad);}(_0xfb2d,0x1e0));var _0xdfb2=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0xfb2d[_0x2ae8ce];return _0x4bf686;};'use strict';var _=require(_0xdfb2('0x0'));var util=require(_0xdfb2('0x1'));var moment=require(_0xdfb2('0x2'));var BPromise=require(_0xdfb2('0x3'));var rs=require(_0xdfb2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfb2('0x5'))['db'];var utils=require(_0xdfb2('0x6'));var logger=require(_0xdfb2('0x7'))(_0xdfb2('0x8'));var config=require(_0xdfb2('0x9'));var jayson=require(_0xdfb2('0xa'));var client=jayson['client'][_0xdfb2('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdfb2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdfb2('0xd'))(new Redis(config['redis']));require(_0xdfb2('0xe'))[_0xdfb2('0xf')](socket);function respondWithRpcPromise(_0x59d8c8,_0x29c72d,_0x1cf409){return new BPromise(function(_0x53ee89,_0x3e90c8){return client[_0xdfb2('0x10')](_0x59d8c8,_0x1cf409)[_0xdfb2('0x11')](function(_0x5b1ef1){logger[_0xdfb2('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x29c72d,_0xdfb2('0x13'));logger[_0xdfb2('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x29c72d,_0xdfb2('0x13'),JSON[_0xdfb2('0x15')](_0x5b1ef1));if(_0x5b1ef1[_0xdfb2('0x16')]){if(_0x5b1ef1[_0xdfb2('0x16')][_0xdfb2('0x17')]===0x1f4){logger[_0xdfb2('0x16')](_0xdfb2('0x18'),_0x29c72d,_0x5b1ef1[_0xdfb2('0x16')][_0xdfb2('0x19')]);return _0x3e90c8(_0x5b1ef1['error'][_0xdfb2('0x19')]);}logger[_0xdfb2('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x29c72d,_0x5b1ef1[_0xdfb2('0x16')][_0xdfb2('0x19')]);return _0x53ee89(_0x5b1ef1[_0xdfb2('0x16')]['message']);}else{logger['info'](_0xdfb2('0x18'),_0x29c72d,_0xdfb2('0x13'));_0x53ee89(_0x5b1ef1[_0xdfb2('0x1a')][_0xdfb2('0x19')]);}})[_0xdfb2('0x1b')](function(_0x116d3c){logger[_0xdfb2('0x16')](_0xdfb2('0x18'),_0x29c72d,_0x116d3c);_0x3e90c8(_0x116d3c);});});}exports[_0xdfb2('0x1c')]=function(_0x3dfb96){var _0x48ff79=this;return new Promise(function(_0x3def63,_0x1d2f00){return db['UserVoiceQueueRt'][_0xdfb2('0x1d')]({'raw':_0x3dfb96[_0xdfb2('0x1e')]?_0x3dfb96[_0xdfb2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3dfb96[_0xdfb2('0x1e')]?_0x3dfb96[_0xdfb2('0x1e')][_0xdfb2('0x1f')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xdfb2('0x20')]['fn']('IF',db[_0xdfb2('0x20')][_0xdfb2('0x21')](_0xdfb2('0x22')))),_0xdfb2('0x23')]]})[_0xdfb2('0x11')](function(_0x13f066){logger['info'](_0xdfb2('0x1c'),_0x3dfb96);logger[_0xdfb2('0x14')]('GetVoiceQueueRtPauses',_0x3dfb96,JSON[_0xdfb2('0x15')](_0x13f066));_0x3def63(_0x13f066);})['catch'](function(_0x135f5a){logger[_0xdfb2('0x16')]('GetVoiceQueueRtPauses',_0x135f5a[_0xdfb2('0x19')],_0x3dfb96);_0x1d2f00(_0x48ff79[_0xdfb2('0x16')](0x1f4,_0x135f5a[_0xdfb2('0x19')]));});});}; \ No newline at end of file +var _0x091e=['options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll'];(function(_0xa31c74,_0x5ec8b1){var _0x2c80eb=function(_0x56a050){while(--_0x56a050){_0xa31c74['push'](_0xa31c74['shift']());}};_0x2c80eb(++_0x5ec8b1);}(_0x091e,0xf6));var _0xe091=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x091e[_0xac151d];return _0x111dba;};'use strict';var _=require(_0xe091('0x0'));var util=require('util');var moment=require(_0xe091('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe091('0x2'));var db=require(_0xe091('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe091('0x4'));var config=require(_0xe091('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe091('0x6')][_0xe091('0x7')]({'port':0x232a});config[_0xe091('0x8')]=_[_0xe091('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe091('0xa'))[_0xe091('0xb')](socket);function respondWithRpcPromise(_0x1de97f,_0x5e19ea,_0x55cdf4){return new BPromise(function(_0x100e13,_0x5f22e5){return client['request'](_0x1de97f,_0x55cdf4)[_0xe091('0xc')](function(_0x477241){logger[_0xe091('0xd')](_0xe091('0xe'),_0x5e19ea,_0xe091('0xf'));logger[_0xe091('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5e19ea,_0xe091('0xf'),JSON[_0xe091('0x11')](_0x477241));if(_0x477241['error']){if(_0x477241['error'][_0xe091('0x12')]===0x1f4){logger[_0xe091('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5e19ea,_0x477241[_0xe091('0x13')][_0xe091('0x14')]);return _0x5f22e5(_0x477241[_0xe091('0x13')]['message']);}logger['error'](_0xe091('0xe'),_0x5e19ea,_0x477241[_0xe091('0x13')][_0xe091('0x14')]);return _0x100e13(_0x477241[_0xe091('0x13')][_0xe091('0x14')]);}else{logger['info'](_0xe091('0xe'),_0x5e19ea,'request\x20sent');_0x100e13(_0x477241[_0xe091('0x15')]['message']);}})[_0xe091('0x16')](function(_0x330674){logger['error'](_0xe091('0xe'),_0x5e19ea,_0x330674);_0x5f22e5(_0x330674);});});}exports[_0xe091('0x17')]=function(_0xc6f47f){var _0x3dd08e=this;return new Promise(function(_0x113d02,_0x393feb){return db[_0xe091('0x18')][_0xe091('0x19')]({'raw':_0xc6f47f[_0xe091('0x1a')]?_0xc6f47f[_0xe091('0x1a')][_0xe091('0x1b')]===undefined?!![]:![]:!![],'where':_0xc6f47f[_0xe091('0x1a')]?_0xc6f47f[_0xe091('0x1a')][_0xe091('0x1c')]||null:null,'attributes':[[db[_0xe091('0x1d')]['fn'](_0xe091('0x1e'),db[_0xe091('0x1d')]['fn']('IF',db['sequelize'][_0xe091('0x1f')](_0xe091('0x20')))),_0xe091('0x21')]]})[_0xe091('0xc')](function(_0x408618){logger[_0xe091('0xd')](_0xe091('0x17'),_0xc6f47f);logger[_0xe091('0x10')](_0xe091('0x17'),_0xc6f47f,JSON[_0xe091('0x11')](_0x408618));_0x113d02(_0x408618);})[_0xe091('0x16')](function(_0x381e45){logger[_0xe091('0x13')](_0xe091('0x17'),_0x381e45['message'],_0xc6f47f);_0x393feb(_0x3dd08e['error'](0x1f4,_0x381e45['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6f2b262..d404d7c 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 _0xfd87=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x7fd8('0x0'));var events=[_0x7fd8('0x1'),_0x7fd8('0x2'),_0x7fd8('0x3')];function createListener(_0x11b128,_0x15d25f){return function(_0x2631d9){_0x15d25f[_0x7fd8('0x4')](_0x11b128,_0x2631d9);};}function removeListener(_0x4429f2,_0x43b442){return function(){UserVoiceQueueRtEvents[_0x7fd8('0x5')](_0x4429f2,_0x43b442);};}exports['register']=function(_0x1395b6){for(var _0x10a778=0x0,_0x55681d=events[_0x7fd8('0x6')];_0x10a778<_0x55681d;_0x10a778++){var _0x6eaf96=events[_0x10a778];var _0x2e2d74=createListener(_0x7fd8('0x7')+_0x6eaf96,_0x1395b6);UserVoiceQueueRtEvents['on'](_0x6eaf96,_0x2e2d74);}}; \ No newline at end of file +var _0x4975=['length','./userVoiceQueueRt.events','remove','update','emit','removeListener','register'];(function(_0x271c80,_0x424372){var _0x51f8f9=function(_0x3cd6c8){while(--_0x3cd6c8){_0x271c80['push'](_0x271c80['shift']());}};_0x51f8f9(++_0x424372);}(_0x4975,0x86));var _0x5497=function(_0x1c420e,_0xc6b6f4){_0x1c420e=_0x1c420e-0x0;var _0x402908=_0x4975[_0x1c420e];return _0x402908;};'use strict';var UserVoiceQueueRtEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){UserVoiceQueueRtEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('userVoiceQueueRt:'+_0x674a2a,_0x539a27);UserVoiceQueueRtEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 81ed2c7..807326a 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x438527,_0x282c83){var _0x493b6d=function(_0xc021e){while(--_0xc021e){_0x438527['push'](_0x438527['shift']());}};_0x493b6d(++_0x282c83);}(_0xedd9,0xfc));var _0x9edd=function(_0x578088,_0x1e67af){_0x578088=_0x578088-0x0;var _0xaeef84=_0xedd9[_0x578088];return _0xaeef84;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x22a3bc,_0x4da94e){var _0x4dcc97=function(_0x3408da){while(--_0x3408da){_0x22a3bc['push'](_0x22a3bc['shift']());}};_0x4dcc97(++_0x4da94e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index defea28..7ae376c 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb28=['INTEGER'];(function(_0x3caf8c,_0x3c2d97){var _0x36de31=function(_0x23a64f){while(--_0x23a64f){_0x3caf8c['push'](_0x3caf8c['shift']());}};_0x36de31(++_0x3c2d97);}(_0xeb28,0x1d0));var _0x8eb2=function(_0x512b21,_0x41708c){_0x512b21=_0x512b21-0x0;var _0x34fbe2=_0xeb28[_0x512b21];return _0x34fbe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8eb2('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4840=['INTEGER','sequelize','exports'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x4840,0x6d));var _0x0484=function(_0x5d9856,_0x53e191){_0x5d9856=_0x5d9856-0x0;var _0xfe9441=_0x4840[_0x5d9856];return _0xfe9441;};'use strict';var Sequelize=require(_0x0484('0x0'));module[_0x0484('0x1')]={'penalty':{'type':Sequelize[_0x0484('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 7b34245..dc46091 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4ee=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x54bb41,_0x2c57b8){var _0x15393d=function(_0x53c4ec){while(--_0x53c4ec){_0x54bb41['push'](_0x54bb41['shift']());}};_0x15393d(++_0x2c57b8);}(_0xf4ee,0x1ef));var _0xef4e=function(_0x3d1f29,_0x36e7d5){_0x3d1f29=_0x3d1f29-0x0;var _0x458cb5=_0xf4ee[_0x3d1f29];return _0x458cb5;};'use strict';var _=require(_0xef4e('0x0'));var util=require('util');var logger=require(_0xef4e('0x1'))(_0xef4e('0x2'));var moment=require('moment');var BPromise=require(_0xef4e('0x3'));var rp=require(_0xef4e('0x4'));var fs=require('fs');var path=require(_0xef4e('0x5'));var rimraf=require('rimraf');var config=require(_0xef4e('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xef4e('0x7')]=function(_0x5a57f7,_0x3d8a6b){return _0x5a57f7[_0xef4e('0x8')](_0xef4e('0x9'),attributes,{'tableName':_0xef4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15d7=['../../config/environment','./userWhatsappQueue.attributes','exports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x15d7,0x121));var _0x715d=function(_0x482466,_0x3e14c9){_0x482466=_0x482466-0x0;var _0xeadb96=_0x15d7[_0x482466];return _0xeadb96;};'use strict';var _=require(_0x715d('0x0'));var util=require(_0x715d('0x1'));var logger=require(_0x715d('0x2'))(_0x715d('0x3'));var moment=require(_0x715d('0x4'));var BPromise=require('bluebird');var rp=require(_0x715d('0x5'));var fs=require('fs');var path=require(_0x715d('0x6'));var rimraf=require(_0x715d('0x7'));var config=require(_0x715d('0x8'));var attributes=require(_0x715d('0x9'));module[_0x715d('0xa')]=function(_0x267213,_0xb704bd){return _0x267213['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 41cc79b..92d98c3 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dfd=['../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UserWhatsappQueue,\x20%s,\x20%s','result','util','ioredis','../../mysqldb'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x8dfd,0x82));var _0xd8df=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x8dfd[_0x2bc1fe];return _0x1a47a5;};'use strict';var _=require('lodash');var util=require(_0xd8df('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8df('0x1'));var db=require(_0xd8df('0x2'))['db'];var utils=require(_0xd8df('0x3'));var logger=require('../../config/logger')(_0xd8df('0x4'));var config=require('../../config/environment');var jayson=require(_0xd8df('0x5'));var client=jayson[_0xd8df('0x6')][_0xd8df('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c4901,_0x24dba5,_0x176ee6){return new BPromise(function(_0x123b0c,_0x2c4c3f){return client[_0xd8df('0x8')](_0x3c4901,_0x176ee6)['then'](function(_0x18026f){logger[_0xd8df('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x24dba5,_0xd8df('0xa'));logger[_0xd8df('0xb')](_0xd8df('0xc'),_0x24dba5,'request\x20sent',JSON[_0xd8df('0xd')](_0x18026f));if(_0x18026f['error']){if(_0x18026f['error'][_0xd8df('0xe')]===0x1f4){logger[_0xd8df('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x24dba5,_0x18026f[_0xd8df('0xf')][_0xd8df('0x10')]);return _0x2c4c3f(_0x18026f[_0xd8df('0xf')][_0xd8df('0x10')]);}logger[_0xd8df('0xf')](_0xd8df('0x11'),_0x24dba5,_0x18026f[_0xd8df('0xf')][_0xd8df('0x10')]);return _0x123b0c(_0x18026f[_0xd8df('0xf')][_0xd8df('0x10')]);}else{logger[_0xd8df('0x9')](_0xd8df('0x11'),_0x24dba5,'request\x20sent');_0x123b0c(_0x18026f[_0xd8df('0x12')][_0xd8df('0x10')]);}})['catch'](function(_0xb75f71){logger[_0xd8df('0xf')](_0xd8df('0x11'),_0x24dba5,_0xb75f71);_0x2c4c3f(_0xb75f71);});});} \ No newline at end of file +var _0xcf2d=['request\x20sent','stringify','code','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3150d7,_0x3d217e){var _0x501f49=function(_0x4f012a){while(--_0x4f012a){_0x3150d7['push'](_0x3150d7['shift']());}};_0x501f49(++_0x3d217e);}(_0xcf2d,0x143));var _0xdcf2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdcf2('0x0'));var moment=require(_0xdcf2('0x1'));var BPromise=require('bluebird');var rs=require(_0xdcf2('0x2'));var fs=require('fs');var Redis=require(_0xdcf2('0x3'));var db=require(_0xdcf2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcf2('0x5'));var config=require('../../config/environment');var jayson=require(_0xdcf2('0x6'));var client=jayson[_0xdcf2('0x7')][_0xdcf2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa3960c,_0x434dbf,_0x5def0b){return new BPromise(function(_0x19fffa,_0x96c40b){return client[_0xdcf2('0x9')](_0xa3960c,_0x5def0b)[_0xdcf2('0xa')](function(_0x1cdd89){logger['info'](_0xdcf2('0xb'),_0x434dbf,'request\x20sent');logger['debug'](_0xdcf2('0xc'),_0x434dbf,_0xdcf2('0xd'),JSON[_0xdcf2('0xe')](_0x1cdd89));if(_0x1cdd89['error']){if(_0x1cdd89['error'][_0xdcf2('0xf')]===0x1f4){logger['error'](_0xdcf2('0xb'),_0x434dbf,_0x1cdd89[_0xdcf2('0x10')][_0xdcf2('0x11')]);return _0x96c40b(_0x1cdd89['error'][_0xdcf2('0x11')]);}logger[_0xdcf2('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x434dbf,_0x1cdd89[_0xdcf2('0x10')][_0xdcf2('0x11')]);return _0x19fffa(_0x1cdd89[_0xdcf2('0x10')][_0xdcf2('0x11')]);}else{logger[_0xdcf2('0x12')](_0xdcf2('0xb'),_0x434dbf,_0xdcf2('0xd'));_0x19fffa(_0x1cdd89[_0xdcf2('0x13')][_0xdcf2('0x11')]);}})[_0xdcf2('0x14')](function(_0x4dacaf){logger[_0xdcf2('0x10')](_0xdcf2('0xb'),_0x434dbf,_0x4dacaf);_0x96c40b(_0x4dacaf);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 1fa1d37..0e5b88d 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 _0x740a=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x419550,_0x15cdf1){var _0x55f9ef=function(_0x44f707){while(--_0x44f707){_0x419550['push'](_0x419550['shift']());}};_0x55f9ef(++_0x15cdf1);}(_0x740a,0x175));var _0xa740=function(_0x4cc05b,_0x1ce43b){_0x4cc05b=_0x4cc05b-0x0;var _0x19d7b9=_0x740a[_0x4cc05b];return _0x19d7b9;};'use strict';var multer=require(_0xa740('0x0'));var util=require(_0xa740('0x1'));var path=require(_0xa740('0x2'));var timeout=require(_0xa740('0x3'));var express=require(_0xa740('0x4'));var router=express[_0xa740('0x5')]();var fs_extra=require(_0xa740('0x6'));var auth=require(_0xa740('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa740('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0xa740('0x9')](),controller[_0xa740('0xa')]);router[_0xa740('0xb')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0xd')]);router[_0xa740('0xe')]('/',auth['isAuthenticated'](),controller[_0xa740('0xf')]);router[_0xa740('0x10')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa740('0x12')]=router; \ No newline at end of file +var _0xe198=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get'];(function(_0x4583f6,_0x3dae7e){var _0x10c5a1=function(_0x4ec77b){while(--_0x4ec77b){_0x4583f6['push'](_0x4583f6['shift']());}};_0x10c5a1(++_0x3dae7e);}(_0xe198,0x6f));var _0x8e19=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe198[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0xd')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0xf')](_0x8e19('0xb'),auth['isAuthenticated'](),controller[_0x8e19('0x10')]);router[_0x8e19('0x11')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x12')]);module[_0x8e19('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index e47cbb8..15fd1a0 100644 --- a/server/api/variable/variable.attributes.js +++ b/server/api/variable/variable.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2ed=['name','sequelize','exports','STRING'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xa2ed,0x95));var _0xda2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xda2e('0x0'));module[_0xda2e('0x1')]={'name':{'type':Sequelize[_0xda2e('0x2')],'unique':_0xda2e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x21d1=['name','sequelize','exports','STRING'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x21d1,0x1c9));var _0x121d=function(_0x292744,_0x5cf2ac){_0x292744=_0x292744-0x0;var _0x3fafb7=_0x21d1[_0x292744];return _0x3fafb7;};'use strict';var Sequelize=require(_0x121d('0x0'));module[_0x121d('0x1')]={'name':{'type':Sequelize[_0x121d('0x2')],'unique':_0x121d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x121d('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 80e180e..d1f609d 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 _0xb68d=['count','set','apply','reject','save','then','destroy','get','Variables','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','json','offset','limit','undefined'];(function(_0xd5fa8a,_0x12f001){var _0x1bfaed=function(_0xb9fc44){while(--_0xb9fc44){_0xd5fa8a['push'](_0xd5fa8a['shift']());}};_0x1bfaed(++_0x12f001);}(_0xb68d,0xcf));var _0xdb68=function(_0x231f54,_0x171543){_0x231f54=_0x231f54-0x0;var _0x1f5d4d=_0xb68d[_0x231f54];return _0x1f5d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdb68('0x0'));var rp=require(_0xdb68('0x1'));var moment=require(_0xdb68('0x2'));var BPromise=require(_0xdb68('0x3'));var Mustache=require(_0xdb68('0x4'));var util=require(_0xdb68('0x5'));var path=require('path');var sox=require(_0xdb68('0x6'));var csv=require(_0xdb68('0x7'));var ejs=require(_0xdb68('0x8'));var fs=require('fs');var fs_extra=require(_0xdb68('0x9'));var _=require(_0xdb68('0xa'));var squel=require('squel');var crypto=require(_0xdb68('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdb68('0xc'));var toCsv=require(_0xdb68('0x7'));var querystring=require('querystring');var Papa=require(_0xdb68('0xd'));var Redis=require(_0xdb68('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb68('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb68('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xdb68('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71b547,_0x481af9){_0x481af9=_0x481af9||0xcc;return function(_0x784e66){if(_0x784e66){return _0x71b547[_0xdb68('0x12')](_0x481af9);}return _0x71b547[_0xdb68('0x13')](_0x481af9)['end']();};}function respondWithResult(_0x5e5b20,_0x466315){_0x466315=_0x466315||0xc8;return function(_0x37f478){if(_0x37f478){return _0x5e5b20[_0xdb68('0x13')](_0x466315)[_0xdb68('0x14')](_0x37f478);}};}function respondWithFilteredResult(_0x4ba9c2,_0x599087){return function(_0x4d23c0){if(_0x4d23c0){var _0x2a18b5=typeof _0x599087[_0xdb68('0x15')]==='undefined'&&typeof _0x599087[_0xdb68('0x16')]===_0xdb68('0x17');var _0x446c98=_0x4d23c0[_0xdb68('0x18')];var _0x34a015=_0x2a18b5?0x0:_0x599087[_0xdb68('0x15')];var _0x3e1a1e=_0x2a18b5?_0x4d23c0[_0xdb68('0x18')]:_0x599087[_0xdb68('0x15')]+_0x599087[_0xdb68('0x16')];var _0x315355;if(_0x3e1a1e>=_0x446c98){_0x3e1a1e=_0x446c98;_0x315355=0xc8;}else{_0x315355=0xce;}_0x4ba9c2[_0xdb68('0x13')](_0x315355);return _0x4ba9c2[_0xdb68('0x19')]('Content-Range',_0x34a015+'-'+_0x3e1a1e+'/'+_0x446c98)[_0xdb68('0x14')](_0x4d23c0);}return null;};}function patchUpdates(_0x580601){return function(_0x25516b){try{jsonpatch[_0xdb68('0x1a')](_0x25516b,_0x580601,!![]);}catch(_0x4b4ee5){return BPromise[_0xdb68('0x1b')](_0x4b4ee5);}return _0x25516b[_0xdb68('0x1c')]();};}function saveUpdates(_0x4aa5d3,_0xe34f4d){return function(_0x584db3){if(_0x584db3){return _0x584db3['update'](_0x4aa5d3)[_0xdb68('0x1d')](function(_0x30776d){return _0x30776d;});}return null;};}function removeEntity(_0x461ce7,_0x2fc147){return function(_0x3296e9){if(_0x3296e9){return _0x3296e9[_0xdb68('0x1e')]()['then'](function(){var _0x5152bd=_0x3296e9[_0xdb68('0x1f')]({'plain':!![]});var _0x26cb47=_0xdb68('0x20');return db['UserProfileResource'][_0xdb68('0x1e')]({'where':{'type':_0x26cb47,'resourceId':_0x5152bd['id']}})[_0xdb68('0x1d')](function(){return _0x3296e9;});})[_0xdb68('0x1d')](function(){_0x461ce7[_0xdb68('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e2ef,_0x2bfd04){return function(_0x15d120){if(!_0x15d120){_0x52e2ef[_0xdb68('0x12')](0x194);}return _0x15d120;};}function handleError(_0x792140,_0x2b3ef7){_0x2b3ef7=_0x2b3ef7||0x1f4;return function(_0x277da7){logger[_0xdb68('0x21')](_0x277da7[_0xdb68('0x22')]);if(_0x277da7[_0xdb68('0x23')]){delete _0x277da7[_0xdb68('0x23')];}_0x792140[_0xdb68('0x13')](_0x2b3ef7)[_0xdb68('0x24')](_0x277da7);};}exports[_0xdb68('0x25')]=function(_0x3097c9,_0x990689){var _0x248bca={},_0xc2eb23={},_0x174baf={'count':0x0,'rows':[]};var _0x59739d=_[_0xdb68('0x26')](db[_0xdb68('0x27')][_0xdb68('0x28')],function(_0x57af64){return{'name':_0x57af64[_0xdb68('0x29')],'type':_0x57af64[_0xdb68('0x2a')][_0xdb68('0x2b')]};});_0xc2eb23[_0xdb68('0x2c')]=_[_0xdb68('0x26')](_0x59739d,'name');_0xc2eb23['query']=_['keys'](_0x3097c9[_0xdb68('0x2d')]);_0xc2eb23[_0xdb68('0x2e')]=_[_0xdb68('0x2f')](_0xc2eb23[_0xdb68('0x2c')],_0xc2eb23[_0xdb68('0x2d')]);_0x248bca['attributes']=_['intersection'](_0xc2eb23[_0xdb68('0x2c')],qs[_0xdb68('0x30')](_0x3097c9['query']['fields']));_0x248bca[_0xdb68('0x31')]=_0x248bca[_0xdb68('0x31')]['length']?_0x248bca[_0xdb68('0x31')]:_0xc2eb23['model'];if(!_0x3097c9[_0xdb68('0x2d')]['hasOwnProperty'](_0xdb68('0x32'))){_0x248bca[_0xdb68('0x16')]=qs[_0xdb68('0x16')](_0x3097c9[_0xdb68('0x2d')][_0xdb68('0x16')]);_0x248bca[_0xdb68('0x15')]=qs['offset'](_0x3097c9['query'][_0xdb68('0x15')]);}_0x248bca[_0xdb68('0x33')]=qs['sort'](_0x3097c9[_0xdb68('0x2d')][_0xdb68('0x34')]);_0x248bca[_0xdb68('0x35')]=qs[_0xdb68('0x2e')](_[_0xdb68('0x36')](_0x3097c9[_0xdb68('0x2d')],_0xc2eb23[_0xdb68('0x2e')]),_0x59739d);if(_0x3097c9[_0xdb68('0x2d')][_0xdb68('0x37')]){_0x248bca[_0xdb68('0x35')]=_[_0xdb68('0x38')](_0x248bca['where'],{'$or':_['map'](_0x59739d,function(_0x1f0b9f){if(_0x1f0b9f[_0xdb68('0x2a')]!==_0xdb68('0x39')){var _0x50ade6={};_0x50ade6[_0x1f0b9f[_0xdb68('0x23')]]={'$like':'%'+_0x3097c9[_0xdb68('0x2d')][_0xdb68('0x37')]+'%'};return _0x50ade6;}})});}_0x248bca=_[_0xdb68('0x38')]({},_0x248bca,_0x3097c9[_0xdb68('0x3a')]);var _0xbda4e9={'where':_0x248bca['where']};return db[_0xdb68('0x27')]['count'](_0xbda4e9)[_0xdb68('0x1d')](function(_0x4be57c){_0x174baf[_0xdb68('0x18')]=_0x4be57c;if(_0x3097c9['query'][_0xdb68('0x3b')]){_0x248bca[_0xdb68('0x3c')]=[{'all':!![]}];}return db[_0xdb68('0x27')][_0xdb68('0x3d')](_0x248bca);})[_0xdb68('0x1d')](function(_0x7c1c4){_0x174baf['rows']=_0x7c1c4;return _0x174baf;})[_0xdb68('0x1d')](respondWithFilteredResult(_0x990689,_0x248bca))[_0xdb68('0x3e')](handleError(_0x990689,null));};exports['show']=function(_0xa91d8a,_0x1191f1){var _0x3a7870={'raw':!![],'where':{'id':_0xa91d8a[_0xdb68('0x3f')]['id']}},_0x9fce9a={};_0x9fce9a['model']=_[_0xdb68('0x40')](db['Variable'][_0xdb68('0x28')]);_0x9fce9a[_0xdb68('0x2d')]=_[_0xdb68('0x40')](_0xa91d8a[_0xdb68('0x2d')]);_0x9fce9a['filters']=_[_0xdb68('0x2f')](_0x9fce9a[_0xdb68('0x2c')],_0x9fce9a[_0xdb68('0x2d')]);_0x3a7870[_0xdb68('0x31')]=_['intersection'](_0x9fce9a['model'],qs['fields'](_0xa91d8a['query'][_0xdb68('0x30')]));_0x3a7870[_0xdb68('0x31')]=_0x3a7870[_0xdb68('0x31')][_0xdb68('0x41')]?_0x3a7870[_0xdb68('0x31')]:_0x9fce9a[_0xdb68('0x2c')];if(_0xa91d8a['query'][_0xdb68('0x3b')]){_0x3a7870['include']=[{'all':!![]}];}_0x3a7870=_['merge']({},_0x3a7870,_0xa91d8a[_0xdb68('0x3a')]);return db[_0xdb68('0x27')][_0xdb68('0x42')](_0x3a7870)['then'](handleEntityNotFound(_0x1191f1,null))['then'](respondWithResult(_0x1191f1,null))[_0xdb68('0x3e')](handleError(_0x1191f1,null));};exports[_0xdb68('0x43')]=function(_0x230708,_0x285ee9){return db[_0xdb68('0x27')][_0xdb68('0x43')](_0x230708[_0xdb68('0x44')],{})[_0xdb68('0x1d')](function(_0x3f37e1){var _0x327d4e=_0x230708[_0xdb68('0x45')][_0xdb68('0x1f')]({'plain':!![]});if(!_0x327d4e)throw new Error(_0xdb68('0x46'));if(_0x327d4e[_0xdb68('0x47')]==='user'){var _0x38a91f=_0x3f37e1[_0xdb68('0x1f')]({'plain':!![]});var _0x4d3c7f=_0xdb68('0x20');return db[_0xdb68('0x48')][_0xdb68('0x42')]({'where':{'name':_0x4d3c7f,'userProfileId':_0x327d4e[_0xdb68('0x49')]},'raw':!![]})[_0xdb68('0x1d')](function(_0x15220c){if(_0x15220c&&_0x15220c['autoAssociation']===0x0){return db[_0xdb68('0x4a')][_0xdb68('0x43')]({'name':_0x38a91f[_0xdb68('0x23')],'resourceId':_0x38a91f['id'],'type':_0x15220c[_0xdb68('0x23')],'sectionId':_0x15220c['id']},{})[_0xdb68('0x1d')](function(){return _0x3f37e1;});}else{return _0x3f37e1;}})['catch'](function(_0x5d6548){logger[_0xdb68('0x21')](_0xdb68('0x4b'),_0x5d6548);throw _0x5d6548;});}return _0x3f37e1;})['then'](respondWithResult(_0x285ee9,0xc9))['catch'](handleError(_0x285ee9,null));};exports[_0xdb68('0x4c')]=function(_0x492bb1,_0x36d312){if(_0x492bb1[_0xdb68('0x44')]['id']){delete _0x492bb1[_0xdb68('0x44')]['id'];}return db['Variable'][_0xdb68('0x42')]({'where':{'id':_0x492bb1['params']['id']}})['then'](handleEntityNotFound(_0x36d312,null))['then'](saveUpdates(_0x492bb1[_0xdb68('0x44')],null))[_0xdb68('0x1d')](respondWithResult(_0x36d312,null))[_0xdb68('0x3e')](handleError(_0x36d312,null));};exports[_0xdb68('0x1e')]=function(_0x439a59,_0x394630){return db['Variable'][_0xdb68('0x42')]({'where':{'id':_0x439a59[_0xdb68('0x3f')]['id']}})[_0xdb68('0x1d')](handleEntityNotFound(_0x394630,null))[_0xdb68('0x1d')](removeEntity(_0x394630,null))[_0xdb68('0x3e')](handleError(_0x394630,null));}; \ No newline at end of file +var _0xae0b=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','Variable','find','create','body','role','user','Variables','userProfileId','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xae0b,0xac));var _0xbae0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae0b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbae0('0x0'));var rimraf=require(_0xbae0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbae0('0x2'));var Mustache=require(_0xbae0('0x3'));var util=require(_0xbae0('0x4'));var path=require(_0xbae0('0x5'));var sox=require(_0xbae0('0x6'));var csv=require(_0xbae0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbae0('0x8'));var _=require('lodash');var squel=require(_0xbae0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbae0('0xa'));var Papa=require(_0xbae0('0xb'));var Redis=require(_0xbae0('0xc'));var authService=require(_0xbae0('0xd'));var qs=require(_0xbae0('0xe'));var as=require(_0xbae0('0xf'));var hardwareService=require(_0xbae0('0x10'));var logger=require(_0xbae0('0x11'))('api');var utils=require(_0xbae0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbae0('0x13'));var db=require(_0xbae0('0x14'))['db'];function respondWithStatusCode(_0x4b65c7,_0x1e7c55){_0x1e7c55=_0x1e7c55||0xcc;return function(_0x5ed7f8){if(_0x5ed7f8){return _0x4b65c7['sendStatus'](_0x1e7c55);}return _0x4b65c7[_0xbae0('0x15')](_0x1e7c55)[_0xbae0('0x16')]();};}function respondWithResult(_0x4f3205,_0x3c0894){_0x3c0894=_0x3c0894||0xc8;return function(_0x45c951){if(_0x45c951){return _0x4f3205[_0xbae0('0x15')](_0x3c0894)[_0xbae0('0x17')](_0x45c951);}};}function respondWithFilteredResult(_0x5bd5c7,_0x59586c){return function(_0x57ee65){if(_0x57ee65){var _0x27233f=typeof _0x59586c['offset']===_0xbae0('0x18')&&typeof _0x59586c[_0xbae0('0x19')]===_0xbae0('0x18');var _0x5c8c49=_0x57ee65[_0xbae0('0x1a')];var _0xeab61e=_0x27233f?0x0:_0x59586c[_0xbae0('0x1b')];var _0x4c4f93=_0x27233f?_0x57ee65[_0xbae0('0x1a')]:_0x59586c[_0xbae0('0x1b')]+_0x59586c['limit'];var _0x3d1767;if(_0x4c4f93>=_0x5c8c49){_0x4c4f93=_0x5c8c49;_0x3d1767=0xc8;}else{_0x3d1767=0xce;}_0x5bd5c7[_0xbae0('0x15')](_0x3d1767);return _0x5bd5c7[_0xbae0('0x1c')]('Content-Range',_0xeab61e+'-'+_0x4c4f93+'/'+_0x5c8c49)[_0xbae0('0x17')](_0x57ee65);}return null;};}function patchUpdates(_0x184bb3){return function(_0x249488){try{jsonpatch['apply'](_0x249488,_0x184bb3,!![]);}catch(_0x35d472){return BPromise[_0xbae0('0x1d')](_0x35d472);}return _0x249488[_0xbae0('0x1e')]();};}function saveUpdates(_0x37450a,_0x2e72f5){return function(_0x3f398f){if(_0x3f398f){return _0x3f398f[_0xbae0('0x1f')](_0x37450a)[_0xbae0('0x20')](function(_0x4ffdfb){return _0x4ffdfb;});}return null;};}function removeEntity(_0x38bf5f,_0x1c6227){return function(_0x319f7f){if(_0x319f7f){return _0x319f7f[_0xbae0('0x21')]()[_0xbae0('0x20')](function(){var _0x2d4063=_0x319f7f[_0xbae0('0x22')]({'plain':!![]});var _0x3a57ae='Variables';return db[_0xbae0('0x23')]['destroy']({'where':{'type':_0x3a57ae,'resourceId':_0x2d4063['id']}})[_0xbae0('0x20')](function(){return _0x319f7f;});})[_0xbae0('0x20')](function(){_0x38bf5f[_0xbae0('0x15')](0xcc)[_0xbae0('0x16')]();});}};}function handleEntityNotFound(_0x48d1cf,_0x3e30ed){return function(_0x187d9b){if(!_0x187d9b){_0x48d1cf[_0xbae0('0x24')](0x194);}return _0x187d9b;};}function handleError(_0x5e585b,_0x5b7a96){_0x5b7a96=_0x5b7a96||0x1f4;return function(_0x101dcd){logger[_0xbae0('0x25')](_0x101dcd['stack']);if(_0x101dcd['name']){delete _0x101dcd['name'];}_0x5e585b[_0xbae0('0x15')](_0x5b7a96)['send'](_0x101dcd);};}exports[_0xbae0('0x26')]=function(_0x500c97,_0x55d524){var _0x49c673={},_0x1fb0af={},_0x55776c={'count':0x0,'rows':[]};var _0x269bf5=_[_0xbae0('0x27')](db['Variable'][_0xbae0('0x28')],function(_0x10f921){return{'name':_0x10f921[_0xbae0('0x29')],'type':_0x10f921[_0xbae0('0x2a')][_0xbae0('0x2b')]};});_0x1fb0af[_0xbae0('0x2c')]=_['map'](_0x269bf5,_0xbae0('0x2d'));_0x1fb0af[_0xbae0('0x2e')]=_[_0xbae0('0x2f')](_0x500c97[_0xbae0('0x2e')]);_0x1fb0af[_0xbae0('0x30')]=_[_0xbae0('0x31')](_0x1fb0af[_0xbae0('0x2c')],_0x1fb0af['query']);_0x49c673[_0xbae0('0x32')]=_[_0xbae0('0x31')](_0x1fb0af[_0xbae0('0x2c')],qs[_0xbae0('0x33')](_0x500c97[_0xbae0('0x2e')][_0xbae0('0x33')]));_0x49c673[_0xbae0('0x32')]=_0x49c673[_0xbae0('0x32')][_0xbae0('0x34')]?_0x49c673[_0xbae0('0x32')]:_0x1fb0af[_0xbae0('0x2c')];if(!_0x500c97[_0xbae0('0x2e')][_0xbae0('0x35')]('nolimit')){_0x49c673[_0xbae0('0x19')]=qs[_0xbae0('0x19')](_0x500c97[_0xbae0('0x2e')]['limit']);_0x49c673[_0xbae0('0x1b')]=qs[_0xbae0('0x1b')](_0x500c97[_0xbae0('0x2e')][_0xbae0('0x1b')]);}_0x49c673[_0xbae0('0x36')]=qs[_0xbae0('0x37')](_0x500c97[_0xbae0('0x2e')]['sort']);_0x49c673[_0xbae0('0x38')]=qs[_0xbae0('0x30')](_[_0xbae0('0x39')](_0x500c97[_0xbae0('0x2e')],_0x1fb0af[_0xbae0('0x30')]),_0x269bf5);if(_0x500c97[_0xbae0('0x2e')]['filter']){_0x49c673['where']=_[_0xbae0('0x3a')](_0x49c673[_0xbae0('0x38')],{'$or':_['map'](_0x269bf5,function(_0x23a90b){if(_0x23a90b[_0xbae0('0x2a')]!=='VIRTUAL'){var _0x21cba7={};_0x21cba7[_0x23a90b[_0xbae0('0x2d')]]={'$like':'%'+_0x500c97[_0xbae0('0x2e')][_0xbae0('0x3b')]+'%'};return _0x21cba7;}})});}_0x49c673=_[_0xbae0('0x3a')]({},_0x49c673,_0x500c97[_0xbae0('0x3c')]);var _0x57f9c3={'where':_0x49c673[_0xbae0('0x38')]};return db['Variable'][_0xbae0('0x1a')](_0x57f9c3)['then'](function(_0x7a18c2){_0x55776c[_0xbae0('0x1a')]=_0x7a18c2;if(_0x500c97[_0xbae0('0x2e')][_0xbae0('0x3d')]){_0x49c673[_0xbae0('0x3e')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x49c673);})[_0xbae0('0x20')](function(_0x8435fc){_0x55776c['rows']=_0x8435fc;return _0x55776c;})[_0xbae0('0x20')](respondWithFilteredResult(_0x55d524,_0x49c673))[_0xbae0('0x3f')](handleError(_0x55d524,null));};exports[_0xbae0('0x40')]=function(_0x1659fb,_0x58af7b){var _0x3ecd55={'raw':!![],'where':{'id':_0x1659fb[_0xbae0('0x41')]['id']}},_0x397093={};_0x397093[_0xbae0('0x2c')]=_['keys'](db[_0xbae0('0x42')][_0xbae0('0x28')]);_0x397093[_0xbae0('0x2e')]=_[_0xbae0('0x2f')](_0x1659fb[_0xbae0('0x2e')]);_0x397093[_0xbae0('0x30')]=_['intersection'](_0x397093[_0xbae0('0x2c')],_0x397093[_0xbae0('0x2e')]);_0x3ecd55[_0xbae0('0x32')]=_[_0xbae0('0x31')](_0x397093[_0xbae0('0x2c')],qs[_0xbae0('0x33')](_0x1659fb[_0xbae0('0x2e')]['fields']));_0x3ecd55[_0xbae0('0x32')]=_0x3ecd55[_0xbae0('0x32')]['length']?_0x3ecd55['attributes']:_0x397093[_0xbae0('0x2c')];if(_0x1659fb[_0xbae0('0x2e')][_0xbae0('0x3d')]){_0x3ecd55['include']=[{'all':!![]}];}_0x3ecd55=_[_0xbae0('0x3a')]({},_0x3ecd55,_0x1659fb[_0xbae0('0x3c')]);return db['Variable'][_0xbae0('0x43')](_0x3ecd55)[_0xbae0('0x20')](handleEntityNotFound(_0x58af7b,null))['then'](respondWithResult(_0x58af7b,null))[_0xbae0('0x3f')](handleError(_0x58af7b,null));};exports[_0xbae0('0x44')]=function(_0x2cf320,_0x324347){return db['Variable']['create'](_0x2cf320[_0xbae0('0x45')],{})['then'](function(_0x39a4b0){var _0x23eb0c=_0x2cf320['user'][_0xbae0('0x22')]({'plain':!![]});if(!_0x23eb0c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23eb0c[_0xbae0('0x46')]===_0xbae0('0x47')){var _0x4ee48d=_0x39a4b0['get']({'plain':!![]});var _0x3aa67a=_0xbae0('0x48');return db['UserProfileSection'][_0xbae0('0x43')]({'where':{'name':_0x3aa67a,'userProfileId':_0x23eb0c[_0xbae0('0x49')]},'raw':!![]})[_0xbae0('0x20')](function(_0x252b63){if(_0x252b63&&_0x252b63['autoAssociation']===0x0){return db[_0xbae0('0x23')][_0xbae0('0x44')]({'name':_0x4ee48d[_0xbae0('0x2d')],'resourceId':_0x4ee48d['id'],'type':_0x252b63['name'],'sectionId':_0x252b63['id']},{})[_0xbae0('0x20')](function(){return _0x39a4b0;});}else{return _0x39a4b0;}})[_0xbae0('0x3f')](function(_0x27f5d9){logger[_0xbae0('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f5d9);throw _0x27f5d9;});}return _0x39a4b0;})[_0xbae0('0x20')](respondWithResult(_0x324347,0xc9))[_0xbae0('0x3f')](handleError(_0x324347,null));};exports[_0xbae0('0x1f')]=function(_0x1cbb91,_0x5261f9){if(_0x1cbb91['body']['id']){delete _0x1cbb91[_0xbae0('0x45')]['id'];}return db[_0xbae0('0x42')][_0xbae0('0x43')]({'where':{'id':_0x1cbb91[_0xbae0('0x41')]['id']}})[_0xbae0('0x20')](handleEntityNotFound(_0x5261f9,null))['then'](saveUpdates(_0x1cbb91[_0xbae0('0x45')],null))[_0xbae0('0x20')](respondWithResult(_0x5261f9,null))[_0xbae0('0x3f')](handleError(_0x5261f9,null));};exports[_0xbae0('0x21')]=function(_0x553bc7,_0x5f18ca){return db['Variable']['find']({'where':{'id':_0x553bc7[_0xbae0('0x41')]['id']}})[_0xbae0('0x20')](handleEntityNotFound(_0x5f18ca,null))[_0xbae0('0x20')](removeEntity(_0x5f18ca,null))['catch'](handleError(_0x5f18ca,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d67f3a7..37359a6 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 _0x1131=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','tools_variables'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1131,0x1e0));var _0x1113=function(_0x511cc6,_0x231f87){_0x511cc6=_0x511cc6-0x0;var _0x54cc45=_0x1131[_0x511cc6];return _0x54cc45;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var logger=require(_0x1113('0x1'))(_0x1113('0x2'));var moment=require(_0x1113('0x3'));var BPromise=require(_0x1113('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1113('0x5'));var rimraf=require(_0x1113('0x6'));var config=require(_0x1113('0x7'));var attributes=require(_0x1113('0x8'));module['exports']=function(_0x208a33,_0x15e020){return _0x208a33['define']('Variable',attributes,{'tableName':_0x1113('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c67=['bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','lodash','api','moment'];(function(_0x1ac8c1,_0x1af773){var _0xf820b=function(_0x31d982){while(--_0x31d982){_0x1ac8c1['push'](_0x1ac8c1['shift']());}};_0xf820b(++_0x1af773);}(_0x7c67,0x1ec));var _0x77c6=function(_0x51cec1,_0x5505d8){_0x51cec1=_0x51cec1-0x0;var _0x373e51=_0x7c67[_0x51cec1];return _0x373e51;};'use strict';var _=require(_0x77c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77c6('0x1'));var moment=require(_0x77c6('0x2'));var BPromise=require(_0x77c6('0x3'));var rp=require(_0x77c6('0x4'));var fs=require('fs');var path=require(_0x77c6('0x5'));var rimraf=require('rimraf');var config=require(_0x77c6('0x6'));var attributes=require(_0x77c6('0x7'));module[_0x77c6('0x8')]=function(_0x431366,_0x37dbc6){return _0x431366['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 336221b..babfa13 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x4a92ff,_0x215eea){var _0x3cd15=function(_0x9f7a44){while(--_0x9f7a44){_0x4a92ff['push'](_0x4a92ff['shift']());}};_0x3cd15(++_0x215eea);}(_0x55ca,0x126));var _0xa55c=function(_0x305c93,_0x3421dc){_0x305c93=_0x305c93-0x0;var _0x5bae39=_0x55ca[_0x305c93];return _0x5bae39;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x515a41,_0x4c631c){var _0x5a435b=function(_0x5dc9b4){while(--_0x5dc9b4){_0x515a41['push'](_0x515a41['shift']());}};_0x5a435b(++_0x4c631c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x5fc3[_0x2706da];return _0x3ba87e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index af6e9a5..7f1023c 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 _0x4111=['./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','/migrations','migrations','exports','Router'];(function(_0x367995,_0x129ae2){var _0x22daa8=function(_0x4a2ceb){while(--_0x4a2ceb){_0x367995['push'](_0x367995['shift']());}};_0x22daa8(++_0x129ae2);}(_0x4111,0x141));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0x1411('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x1411('0x1'));router['get']('/',controller['index']);router[_0x1411('0x2')](_0x1411('0x3'),auth[_0x1411('0x4')](),auth[_0x1411('0x5')](),controller[_0x1411('0x6')]);router[_0x1411('0x2')](_0x1411('0x7'),auth['isAuthenticated'](),auth[_0x1411('0x5')](),controller['reset']);router[_0x1411('0x2')](_0x1411('0x8'),auth[_0x1411('0x4')](),auth[_0x1411('0x5')](),controller[_0x1411('0x9')]);router[_0x1411('0x2')](_0x1411('0xa'),auth['isAuthenticated'](),controller['restart']);router[_0x1411('0x2')](_0x1411('0xb'),controller[_0x1411('0xc')]);module[_0x1411('0xd')]=router; \ No newline at end of file +var _0x9c22=['isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9c22,0xb5));var _0x29c2=function(_0x4634f8,_0x1ac5ec){_0x4634f8=_0x4634f8-0x0;var _0x2374f1=_0x9c22[_0x4634f8];return _0x2374f1;};'use strict';var express=require(_0x29c2('0x0'));var router=express[_0x29c2('0x1')]();var auth=require(_0x29c2('0x2'));var controller=require('./version.controller');router[_0x29c2('0x3')]('/',controller[_0x29c2('0x4')]);router[_0x29c2('0x3')](_0x29c2('0x5'),auth[_0x29c2('0x6')](),auth[_0x29c2('0x7')](),controller[_0x29c2('0x8')]);router['get']('/reset',auth[_0x29c2('0x6')](),auth[_0x29c2('0x7')](),controller[_0x29c2('0x9')]);router['get'](_0x29c2('0xa'),auth['isAuthenticated'](),auth[_0x29c2('0x7')](),controller[_0x29c2('0xb')]);router[_0x29c2('0x3')](_0x29c2('0xc'),auth['isAuthenticated'](),controller[_0x29c2('0xd')]);router['get'](_0x29c2('0xe'),controller[_0x29c2('0xf')]);module[_0x29c2('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e17064f..16b6a53 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 _0x804a=['UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last'];(function(_0x5c1396,_0x5618dd){var _0x2d3391=function(_0x5e1944){while(--_0x5e1944){_0x5c1396['push'](_0x5c1396['shift']());}};_0x2d3391(++_0x5618dd);}(_0x804a,0x10b));var _0xa804=function(_0x513872,_0x150c53){_0x513872=_0x513872-0x0;var _0x318ed7=_0x804a[_0x513872];return _0x318ed7;};'use strict';var Umzug=require(_0xa804('0x0'));var path=require(_0xa804('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xa804('0x2'));var compareVersions=require(_0xa804('0x3'));var exec=require(_0xa804('0x4'))[_0xa804('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xa804('0x6'));var pm2=require(_0xa804('0x7'));var logger=require('../../config/logger')('update');var git=require(_0xa804('0x8'))(config[_0xa804('0x9')]);exports[_0xa804('0xa')]=function(_0x10fd78,_0x5d711c){var _0x1907cb={'current':module[_0xa804('0xb')]['version'],'phonebar':0x2};if(_0x10fd78['query']&&_0x10fd78[_0xa804('0xc')][_0xa804('0xd')]){return git[_0xa804('0xe')]()[_0xa804('0xf')](function(_0x2c904a,_0x293f49){_0x1907cb['latest']=(_0x2c904a?module[_0xa804('0xb')]['version']:_0x293f49['latest'])||_0xa804('0x10');return _0x5d711c[_0xa804('0x11')](0xc8)[_0xa804('0x12')](_0x1907cb);});}else{return _0x5d711c[_0xa804('0x11')](0xc8)[_0xa804('0x12')](_0x1907cb);}};exports[_0xa804('0xe')]=function(_0xcbe981,_0x4cf2f9){return git['fetch']([_0xa804('0x13'),_0xa804('0x14')],function(_0x185f23){if(_0x185f23){logger[_0xa804('0x15')](_0x185f23);return _0x4cf2f9[_0xa804('0x11')](0x1f4)[_0xa804('0x12')](_0x185f23);}logger[_0xa804('0x16')](_0xa804('0x17'));return _0x4cf2f9['status'](0xc8)['json']({'output':_0xa804('0x18')});});};exports[_0xa804('0x19')]=function(_0x589847,_0x4df786){return git['reset']([_0xa804('0x1a'),'FETCH_HEAD'],function(_0x1273bd){if(_0x1273bd){logger[_0xa804('0x15')](_0x1273bd);return _0x4df786[_0xa804('0x11')](0x1f4)[_0xa804('0x12')](_0x1273bd);}logger['info'](_0xa804('0x1b'));return _0x4df786[_0xa804('0x11')](0xc8)[_0xa804('0x12')]({'output':_0xa804('0x1c')});});};exports[_0xa804('0x1d')]=function(_0x377f0b,_0x11b9e4){exec('npm\x20install\x20--production',function(_0x131046,_0x18e857,_0x566e1c){logger['info'](_0x18e857);logger[_0xa804('0x16')](_0x566e1c);if(_0x131046){logger['error'](_0x131046);return _0x11b9e4['status'](0x1f4)[_0xa804('0x12')](_0x131046);}return _0x11b9e4['status'](0xc8)['json']({'output':_0x18e857});});};exports[_0xa804('0x1e')]=function(_0x18aa66,_0x49175e){return pm2[_0xa804('0x1e')](_0xa804('0x1f'))['then'](function(_0x266f13){logger[_0xa804('0x16')]('pm2\x20restart\x20motion\x20%s',_0x266f13);return _0x49175e[_0xa804('0x11')](0xc8)[_0xa804('0x12')]({'output':_0xa804('0x20')});})[_0xa804('0x21')](function(_0x4c7c81){logger[_0xa804('0x15')](_0x4c7c81);return _0x49175e[_0xa804('0x11')](0x1f4)[_0xa804('0x12')](_0x4c7c81);});};exports[_0xa804('0x22')]=function(_0x2dee65,_0x112a18){var _0x5f73db=fs[_0xa804('0x23')](path[_0xa804('0x24')](config[_0xa804('0x9')],_0xa804('0x25'),_0xa804('0x22')));var _0x478b34=[];for(var _0x38be4c=0x0;_0x38be4c<_0x5f73db[_0xa804('0x26')];_0x38be4c++){var _0xed4591=_0x5f73db[_0x38be4c][_0xa804('0x27')](_0xa804('0x28'),'');if(compareVersions(module[_0xa804('0xb')][_0xa804('0x2')],_0xed4591)===-0x1){_0x478b34[_0xa804('0x29')](_0xed4591);}}if(_0x478b34[_0xa804('0x26')]){var _0x4d2d99=_0x478b34[_0xa804('0x2a')](compareVersions);var _0x5103e5=new Umzug({'storage':_0xa804('0x2b'),'storageOptions':{'model':db[_0xa804('0x2c')],'modelName':'Migration','columnName':_0xa804('0x2')},'migrations':{'params':[db[_0xa804('0x2b')][_0xa804('0x2d')](),db[_0xa804('0x2b')]['constructor'],function(){throw new Error(_0xa804('0x2e'));}],'path':path['join'](config[_0xa804('0x9')],'server',_0xa804('0x22')),'pattern':/\.js$/}});_0x5103e5['up']({'migrations':_[_0xa804('0x2f')](_0x4d2d99,function(_0x240779){return _0x240779+_0xa804('0x28');})})[_0xa804('0x30')](function(){return _0x112a18[_0xa804('0x11')](0xc8)[_0xa804('0x12')]({'output':_0xa804('0x31')+module[_0xa804('0xb')]['version']+'\x20to\x20'+_[_0xa804('0x32')](_0x4d2d99),'migrations':_[_0xa804('0x24')](_0x4d2d99)});})[_0xa804('0x21')](function(_0x38f58b){if(_0x38f58b instanceof db['sequelize'][_0xa804('0x33')]){return _0x112a18[_0xa804('0x11')](0xc8)[_0xa804('0x12')]({'output':_0xa804('0x34')});}else{return _0x112a18[_0xa804('0x11')](0x1f4)[_0xa804('0x12')](_0x38f58b);}});}else{return _0x112a18[_0xa804('0x11')](0xc8)['json']({'output':_0xa804('0x34')});}}; \ No newline at end of file +var _0xb808=['git\x20fetch\x20origin\x20master','reset','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','query','fetch','tags','latest','2.0.0','status','json','master','info','git\x20fetch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb808,0x189));var _0x8b80=function(_0x3b274f,_0x5cdae2){_0x3b274f=_0x3b274f-0x0;var _0x558ee7=_0xb808[_0x3b274f];return _0x558ee7;};'use strict';var Umzug=require(_0x8b80('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x8b80('0x1'))(module,_0x8b80('0x2'));var compareVersions=require(_0x8b80('0x3'));var exec=require(_0x8b80('0x4'))[_0x8b80('0x5')];var db=require(_0x8b80('0x6'))['db'];var config=require(_0x8b80('0x7'));var pm2=require(_0x8b80('0x8'));var logger=require('../../config/logger')(_0x8b80('0x9'));var git=require(_0x8b80('0xa'))(config[_0x8b80('0xb')]);exports['index']=function(_0x2b9316,_0x54b918){var _0x18173c={'current':module[_0x8b80('0xc')][_0x8b80('0x2')],'phonebar':0x2};if(_0x2b9316[_0x8b80('0xd')]&&_0x2b9316[_0x8b80('0xd')]['latest']){return git[_0x8b80('0xe')]()[_0x8b80('0xf')](function(_0x3c625a,_0x433cc8){_0x18173c[_0x8b80('0x10')]=(_0x3c625a?module[_0x8b80('0xc')][_0x8b80('0x2')]:_0x433cc8['latest'])||_0x8b80('0x11');return _0x54b918[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')](_0x18173c);});}else{return _0x54b918[_0x8b80('0x12')](0xc8)['json'](_0x18173c);}};exports[_0x8b80('0xe')]=function(_0x533b0c,_0x4837fd){return git[_0x8b80('0xe')](['origin',_0x8b80('0x14')],function(_0xbbab84){if(_0xbbab84){logger['error'](_0xbbab84);return _0x4837fd['status'](0x1f4)[_0x8b80('0x13')](_0xbbab84);}logger[_0x8b80('0x15')](_0x8b80('0x16'));return _0x4837fd[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')]({'output':_0x8b80('0x17')});});};exports[_0x8b80('0x18')]=function(_0x52f5a1,_0x5efd6d){return git[_0x8b80('0x18')](['--hard','FETCH_HEAD'],function(_0x39ca41){if(_0x39ca41){logger[_0x8b80('0x19')](_0x39ca41);return _0x5efd6d[_0x8b80('0x12')](0x1f4)[_0x8b80('0x13')](_0x39ca41);}logger['info'](_0x8b80('0x1a'));return _0x5efd6d[_0x8b80('0x12')](0xc8)['json']({'output':_0x8b80('0x1b')});});};exports[_0x8b80('0x1c')]=function(_0x458d23,_0x26c405){exec(_0x8b80('0x1d'),function(_0x1470e4,_0x358791,_0x1c9cb8){logger[_0x8b80('0x15')](_0x358791);logger['info'](_0x1c9cb8);if(_0x1470e4){logger[_0x8b80('0x19')](_0x1470e4);return _0x26c405[_0x8b80('0x12')](0x1f4)['json'](_0x1470e4);}return _0x26c405[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')]({'output':_0x358791});});};exports['restart']=function(_0x3bdd36,_0x4f1655){return pm2[_0x8b80('0x1e')]('motion2')[_0x8b80('0x1f')](function(_0x4cedda){logger[_0x8b80('0x15')](_0x8b80('0x20'),_0x4cedda);return _0x4f1655['status'](0xc8)['json']({'output':_0x8b80('0x21')});})[_0x8b80('0x22')](function(_0x44ea62){logger[_0x8b80('0x19')](_0x44ea62);return _0x4f1655[_0x8b80('0x12')](0x1f4)[_0x8b80('0x13')](_0x44ea62);});};exports[_0x8b80('0x23')]=function(_0x5be92d,_0x55caf5){var _0x116673=fs[_0x8b80('0x24')](path['join'](config[_0x8b80('0xb')],_0x8b80('0x25'),_0x8b80('0x23')));var _0x375bd2=[];for(var _0x339787=0x0;_0x339787<_0x116673['length'];_0x339787++){var _0x248a8e=_0x116673[_0x339787][_0x8b80('0x26')](_0x8b80('0x27'),'');if(compareVersions(module[_0x8b80('0xc')][_0x8b80('0x2')],_0x248a8e)===-0x1){_0x375bd2[_0x8b80('0x28')](_0x248a8e);}}if(_0x375bd2[_0x8b80('0x29')]){var _0x1fd02d=_0x375bd2[_0x8b80('0x2a')](compareVersions);var _0xe3d570=new Umzug({'storage':_0x8b80('0x2b'),'storageOptions':{'model':db[_0x8b80('0x2c')],'modelName':_0x8b80('0x2c'),'columnName':_0x8b80('0x2')},'migrations':{'params':[db[_0x8b80('0x2b')][_0x8b80('0x2d')](),db[_0x8b80('0x2b')]['constructor'],function(){throw new Error(_0x8b80('0x2e'));}],'path':path[_0x8b80('0x2f')](config['root'],_0x8b80('0x25'),'migrations'),'pattern':/\.js$/}});_0xe3d570['up']({'migrations':_['map'](_0x1fd02d,function(_0x26949a){return _0x26949a+_0x8b80('0x27');})})[_0x8b80('0x1f')](function(){return _0x55caf5[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')]({'output':_0x8b80('0x30')+module[_0x8b80('0xc')][_0x8b80('0x2')]+'\x20to\x20'+_[_0x8b80('0x31')](_0x1fd02d),'migrations':_['join'](_0x1fd02d)});})[_0x8b80('0x22')](function(_0x1a5ef8){if(_0x1a5ef8 instanceof db[_0x8b80('0x2b')][_0x8b80('0x32')]){return _0x55caf5[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')]({'output':_0x8b80('0x33')});}else{return _0x55caf5['status'](0x1f4)[_0x8b80('0x13')](_0x1a5ef8);}});}else{return _0x55caf5[_0x8b80('0x12')](0xc8)[_0x8b80('0x13')]({'output':_0x8b80('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e8a331b..3e9ede0 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 _0x8935=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x2ff8d2,_0x4768fd){var _0x3168a7=function(_0x45fe2c){while(--_0x45fe2c){_0x2ff8d2['push'](_0x2ff8d2['shift']());}};_0x3168a7(++_0x4768fd);}(_0x8935,0x150));var _0x5893=function(_0x4e33c0,_0x555fda){_0x4e33c0=_0x4e33c0-0x0;var _0x1f7aa3=_0x8935[_0x4e33c0];return _0x1f7aa3;};'use strict';var multer=require(_0x5893('0x0'));var util=require(_0x5893('0x1'));var path=require('path');var timeout=require(_0x5893('0x2'));var express=require(_0x5893('0x3'));var router=express[_0x5893('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5893('0x5'));var interaction=require(_0x5893('0x6'));var config=require(_0x5893('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x5893('0x8')]('/',auth[_0x5893('0x9')](),controller[_0x5893('0xa')]);router[_0x5893('0x8')](_0x5893('0xb'),auth[_0x5893('0x9')](),controller['describe']);router[_0x5893('0x8')](_0x5893('0xc'),auth['isAuthenticated'](),controller[_0x5893('0xd')]);router[_0x5893('0xe')]('/',auth[_0x5893('0x9')](),controller[_0x5893('0xf')]);router[_0x5893('0x10')](_0x5893('0xc'),auth[_0x5893('0x9')](),controller[_0x5893('0x11')]);router[_0x5893('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5893('0x13')]=router; \ No newline at end of file +var _0x5517=['/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index'];(function(_0x2a5bf5,_0xd3a737){var _0x303ba2=function(_0x41c644){while(--_0x41c644){_0x2a5bf5['push'](_0x2a5bf5['shift']());}};_0x303ba2(++_0xd3a737);}(_0x5517,0xe4));var _0x7551=function(_0x2f55b8,_0x31980d){_0x2f55b8=_0x2f55b8-0x0;var _0x15fea4=_0x5517[_0x2f55b8];return _0x15fea4;};'use strict';var multer=require(_0x7551('0x0'));var util=require(_0x7551('0x1'));var path=require(_0x7551('0x2'));var timeout=require(_0x7551('0x3'));var express=require(_0x7551('0x4'));var router=express[_0x7551('0x5')]();var fs_extra=require(_0x7551('0x6'));var auth=require(_0x7551('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7551('0x8'));var controller=require(_0x7551('0x9'));router[_0x7551('0xa')]('/',auth['isAuthenticated'](),controller[_0x7551('0xb')]);router[_0x7551('0xa')](_0x7551('0xc'),auth['isAuthenticated'](),controller[_0x7551('0xd')]);router[_0x7551('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7551('0xe')]);router[_0x7551('0xf')]('/',auth[_0x7551('0x10')](),controller[_0x7551('0x11')]);router[_0x7551('0x12')](_0x7551('0x13'),auth['isAuthenticated'](),controller[_0x7551('0x14')]);router[_0x7551('0x15')](_0x7551('0x13'),auth['isAuthenticated'](),controller[_0x7551('0x16')]);module[_0x7551('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b6dbafc..6394d35 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 _0xdac7=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xdac7,0x180));var _0x7dac=function(_0x275147,_0xe78ed3){_0x275147=_0x275147-0x0;var _0x15f2cf=_0xdac7[_0x275147];return _0x15f2cf;};'use strict';var Sequelize=require(_0x7dac('0x0'));module[_0x7dac('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7dac('0x2')]},'queue':{'type':Sequelize[_0x7dac('0x2')]},'interface':{'type':Sequelize[_0x7dac('0x2')]},'membername':{'type':Sequelize[_0x7dac('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7dac('0x3')]},'agentdumpAt':{'type':Sequelize[_0x7dac('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7dac('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7dac('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7dac('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7dac('0x5')]},'reason':{'type':Sequelize[_0x7dac('0x2')]},'lastevent':{'type':Sequelize[_0x7dac('0x2')]},'channel':{'type':Sequelize[_0x7dac('0x2')]},'channelstate':{'type':Sequelize[_0x7dac('0x5')]},'channelstatedesc':{'type':Sequelize[_0x7dac('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7dac('0x2')]},'connectedlinename':{'type':Sequelize[_0x7dac('0x2')]},'language':{'type':Sequelize[_0x7dac('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7dac('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7dac('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7dac('0x2')]},'destcalleridname':{'type':Sequelize[_0x7dac('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7dac('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7dac('0x2')]},'destlanguage':{'type':Sequelize[_0x7dac('0x2')]},'destaccountcode':{'type':Sequelize[_0x7dac('0x2')]},'destcontext':{'type':Sequelize[_0x7dac('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7dac('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7dac('0x2')]},'transfer':{'type':Sequelize[_0x7dac('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7dac('0x2')],'comment':_0x7dac('0x6')},'transferexten':{'type':Sequelize[_0x7dac('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x7dac('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9be=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x551203,_0x4d5f0b){var _0x3c613a=function(_0x56f773){while(--_0x56f773){_0x551203['push'](_0x551203['shift']());}};_0x3c613a(++_0x4d5f0b);}(_0xb9be,0xc5));var _0xeb9b=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb9be[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'type':{'type':Sequelize[_0xeb9b('0x2')]},'uniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'calleridnum':{'type':Sequelize[_0xeb9b('0x2')]},'calleridname':{'type':Sequelize[_0xeb9b('0x2')]},'queue':{'type':Sequelize[_0xeb9b('0x2')]},'interface':{'type':Sequelize[_0xeb9b('0x2')]},'membername':{'type':Sequelize[_0xeb9b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xeb9b('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xeb9b('0x3')]},'agentdumpAt':{'type':Sequelize[_0xeb9b('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xeb9b('0x5')]},'agentacw':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeb9b('0x5')]},'reason':{'type':Sequelize[_0xeb9b('0x2')]},'lastevent':{'type':Sequelize[_0xeb9b('0x2')]},'channel':{'type':Sequelize[_0xeb9b('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xeb9b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xeb9b('0x2')]},'accountcode':{'type':Sequelize[_0xeb9b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xeb9b('0x2')]},'priority':{'type':Sequelize[_0xeb9b('0x2')]},'destchannel':{'type':Sequelize[_0xeb9b('0x2')]},'destchannelstate':{'type':Sequelize[_0xeb9b('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xeb9b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb9b('0x2')]},'destlanguage':{'type':Sequelize[_0xeb9b('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xeb9b('0x2')]},'destuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xeb9b('0x2')]},'transfer':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb9b('0x2')],'comment':_0xeb9b('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xeb9b('0x2')]},'agententerreason':{'type':Sequelize[_0xeb9b('0x5')],'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 955d8ff..8553acc 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 158e49b..dc34ce6 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 _0xdad2=['uniqueid','destuniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xdad2,0x14c));var _0x2dad=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xdad2[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var logger=require(_0x2dad('0x1'))('api');var moment=require(_0x2dad('0x2'));var BPromise=require(_0x2dad('0x3'));var rp=require(_0x2dad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dad('0x5'));var config=require(_0x2dad('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0x2dad('0x7')]=function(_0x36a054,_0x27ca04){return _0x36a054[_0x2dad('0x8')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x2dad('0x9'),_0x2dad('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb91a=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','lodash','util','../../config/logger'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xb91a,0xf4));var _0xab91=function(_0x5ef6be,_0x2988c9){_0x5ef6be=_0x5ef6be-0x0;var _0x396883=_0xb91a[_0x5ef6be];return _0x396883;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab91('0x3'));var rp=require(_0xab91('0x4'));var fs=require('fs');var path=require(_0xab91('0x5'));var rimraf=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var attributes=require(_0xab91('0x8'));module[_0xab91('0x9')]=function(_0x429933,_0x290af9){return _0x429933[_0xab91('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xab91('0xb'),'paranoid':![],'indexes':[{'fields':[_0xab91('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index ad92b2c..c80d4cb 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 _0x4816=['where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport'];(function(_0xf40ca5,_0x166787){var _0x1d6cae=function(_0x5cc976){while(--_0x5cc976){_0xf40ca5['push'](_0xf40ca5['shift']());}};_0x1d6cae(++_0x166787);}(_0x4816,0x1e3));var _0x6481=function(_0x3f02a3,_0x3fa603){_0x3f02a3=_0x3f02a3-0x0;var _0x2aa265=_0x4816[_0x3f02a3];return _0x2aa265;};'use strict';var _=require(_0x6481('0x0'));var util=require(_0x6481('0x1'));var moment=require('moment');var BPromise=require(_0x6481('0x2'));var rs=require(_0x6481('0x3'));var fs=require('fs');var Redis=require(_0x6481('0x4'));var db=require(_0x6481('0x5'))['db'];var utils=require(_0x6481('0x6'));var logger=require(_0x6481('0x7'))(_0x6481('0x8'));var config=require('../../config/environment');var jayson=require(_0x6481('0x9'));var client=jayson[_0x6481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xff8c86,_0x3a2531,_0x164fa0){return new BPromise(function(_0x35de7b,_0x2905ec){return client[_0x6481('0xb')](_0xff8c86,_0x164fa0)[_0x6481('0xc')](function(_0x19d94f){logger[_0x6481('0xd')](_0x6481('0xe'),_0x3a2531,'request\x20sent');logger[_0x6481('0xf')](_0x6481('0x10'),_0x3a2531,'request\x20sent',JSON[_0x6481('0x11')](_0x19d94f));if(_0x19d94f['error']){if(_0x19d94f[_0x6481('0x12')]['code']===0x1f4){logger[_0x6481('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x3a2531,_0x19d94f['error'][_0x6481('0x13')]);return _0x2905ec(_0x19d94f['error'][_0x6481('0x13')]);}logger[_0x6481('0x12')](_0x6481('0xe'),_0x3a2531,_0x19d94f['error'][_0x6481('0x13')]);return _0x35de7b(_0x19d94f[_0x6481('0x12')][_0x6481('0x13')]);}else{logger[_0x6481('0xd')](_0x6481('0xe'),_0x3a2531,'request\x20sent');_0x35de7b(_0x19d94f[_0x6481('0x14')]['message']);}})[_0x6481('0x15')](function(_0x513d0c){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x3a2531,_0x513d0c);_0x2905ec(_0x513d0c);});});}exports[_0x6481('0x16')]=function(_0x570a01){var _0x242435=this;return new Promise(function(_0x482f95,_0x2dafa7){return db[_0x6481('0x17')][_0x6481('0x18')](_0x570a01[_0x6481('0x19')],{'raw':_0x570a01[_0x6481('0x1a')]?_0x570a01['options'][_0x6481('0x1b')]===undefined?!![]:![]:!![]})[_0x6481('0xc')](function(_0x3b2e66){logger['info'](_0x6481('0x16'),_0x570a01);logger[_0x6481('0xf')](_0x6481('0x16'),_0x570a01,JSON[_0x6481('0x11')](_0x3b2e66));_0x482f95(_0x3b2e66);})[_0x6481('0x15')](function(_0x147189){logger['error'](_0x6481('0x16'),_0x147189[_0x6481('0x13')],_0x570a01);_0x2dafa7(_0x242435[_0x6481('0x12')](0x1f4,_0x147189[_0x6481('0x13')]));});});};exports[_0x6481('0x1c')]=function(_0x120cbe){var _0x378951=this;return new Promise(function(_0x53de1f,_0x516f71){return db['VoiceAgentReport']['update'](_0x120cbe[_0x6481('0x19')],{'raw':_0x120cbe[_0x6481('0x1a')]?_0x120cbe[_0x6481('0x1a')][_0x6481('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120cbe['options']?_0x120cbe[_0x6481('0x1a')][_0x6481('0x1d')]||null:null,'attributes':_0x120cbe[_0x6481('0x1a')]?_0x120cbe[_0x6481('0x1a')][_0x6481('0x1e')]||null:null,'limit':_0x120cbe[_0x6481('0x1a')]?_0x120cbe[_0x6481('0x1a')][_0x6481('0x1f')]||null:null})[_0x6481('0xc')](function(_0x118811){logger[_0x6481('0xd')](_0x6481('0x1c'),_0x120cbe);logger[_0x6481('0xf')]('UpdateVoiceAgentReport',_0x120cbe,JSON['stringify'](_0x118811));_0x53de1f(_0x118811);})[_0x6481('0x15')](function(_0x4f5a20){logger['error'](_0x6481('0x1c'),_0x4f5a20[_0x6481('0x13')],_0x120cbe);_0x516f71(_0x378951['error'](0x1f4,_0x4f5a20[_0x6481('0x13')]));});});}; \ No newline at end of file +var _0xee17=['UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','create','options','catch','VoiceAgentReport','update','raw','where','attributes'];(function(_0x45418a,_0x4a99ab){var _0x34ac4e=function(_0x3e38d7){while(--_0x3e38d7){_0x45418a['push'](_0x45418a['shift']());}};_0x34ac4e(++_0x4a99ab);}(_0xee17,0x16c));var _0x7ee1=function(_0xcc3ad4,_0x1de430){_0xcc3ad4=_0xcc3ad4-0x0;var _0x5180ec=_0xee17[_0xcc3ad4];return _0x5180ec;};'use strict';var _=require(_0x7ee1('0x0'));var util=require(_0x7ee1('0x1'));var moment=require('moment');var BPromise=require(_0x7ee1('0x2'));var rs=require(_0x7ee1('0x3'));var fs=require('fs');var Redis=require(_0x7ee1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ee1('0x5'));var logger=require(_0x7ee1('0x6'))(_0x7ee1('0x7'));var config=require(_0x7ee1('0x8'));var jayson=require(_0x7ee1('0x9'));var client=jayson['client'][_0x7ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27cf4a,_0x319b44,_0x3509ad){return new BPromise(function(_0x394191,_0x47865b){return client[_0x7ee1('0xb')](_0x27cf4a,_0x3509ad)[_0x7ee1('0xc')](function(_0x2a2b91){logger[_0x7ee1('0xd')](_0x7ee1('0xe'),_0x319b44,_0x7ee1('0xf'));logger[_0x7ee1('0x10')](_0x7ee1('0x11'),_0x319b44,_0x7ee1('0xf'),JSON[_0x7ee1('0x12')](_0x2a2b91));if(_0x2a2b91[_0x7ee1('0x13')]){if(_0x2a2b91['error'][_0x7ee1('0x14')]===0x1f4){logger[_0x7ee1('0x13')](_0x7ee1('0xe'),_0x319b44,_0x2a2b91['error']['message']);return _0x47865b(_0x2a2b91[_0x7ee1('0x13')]['message']);}logger[_0x7ee1('0x13')](_0x7ee1('0xe'),_0x319b44,_0x2a2b91[_0x7ee1('0x13')]['message']);return _0x394191(_0x2a2b91[_0x7ee1('0x13')][_0x7ee1('0x15')]);}else{logger[_0x7ee1('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x319b44,'request\x20sent');_0x394191(_0x2a2b91[_0x7ee1('0x16')][_0x7ee1('0x15')]);}})['catch'](function(_0xf1297d){logger[_0x7ee1('0x13')](_0x7ee1('0xe'),_0x319b44,_0xf1297d);_0x47865b(_0xf1297d);});});}exports[_0x7ee1('0x17')]=function(_0x3d925d){var _0xc64abf=this;return new Promise(function(_0x2c9b6e,_0x3ba95f){return db['VoiceAgentReport'][_0x7ee1('0x18')](_0x3d925d['body'],{'raw':_0x3d925d['options']?_0x3d925d[_0x7ee1('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x245f49){logger['info']('CreateVoiceAgentReport',_0x3d925d);logger[_0x7ee1('0x10')](_0x7ee1('0x17'),_0x3d925d,JSON[_0x7ee1('0x12')](_0x245f49));_0x2c9b6e(_0x245f49);})[_0x7ee1('0x1a')](function(_0x17af24){logger['error'](_0x7ee1('0x17'),_0x17af24['message'],_0x3d925d);_0x3ba95f(_0xc64abf[_0x7ee1('0x13')](0x1f4,_0x17af24[_0x7ee1('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x54c471){var _0x16c136=this;return new Promise(function(_0x4ae566,_0xc8a65f){return db[_0x7ee1('0x1b')][_0x7ee1('0x1c')](_0x54c471['body'],{'raw':_0x54c471['options']?_0x54c471[_0x7ee1('0x19')][_0x7ee1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c471['options']?_0x54c471[_0x7ee1('0x19')][_0x7ee1('0x1e')]||null:null,'attributes':_0x54c471[_0x7ee1('0x19')]?_0x54c471[_0x7ee1('0x19')][_0x7ee1('0x1f')]||null:null,'limit':_0x54c471[_0x7ee1('0x19')]?_0x54c471['options']['limit']||null:null})[_0x7ee1('0xc')](function(_0x4e53ef){logger[_0x7ee1('0xd')](_0x7ee1('0x20'),_0x54c471);logger[_0x7ee1('0x10')](_0x7ee1('0x20'),_0x54c471,JSON[_0x7ee1('0x12')](_0x4e53ef));_0x4ae566(_0x4e53ef);})[_0x7ee1('0x1a')](function(_0x181b8c){logger[_0x7ee1('0x13')](_0x7ee1('0x20'),_0x181b8c[_0x7ee1('0x15')],_0x54c471);_0xc8a65f(_0x16c136[_0x7ee1('0x13')](0x1f4,_0x181b8c[_0x7ee1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9b100eb..7bc96fe 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 _0x34e8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x3b81f5,_0x270b1a){var _0x2abbcc=function(_0x1c8ed5){while(--_0x1c8ed5){_0x3b81f5['push'](_0x3b81f5['shift']());}};_0x2abbcc(++_0x270b1a);}(_0x34e8,0x12c));var _0x834e=function(_0x358ddd,_0x56dc5c){_0x358ddd=_0x358ddd-0x0;var _0x216175=_0x34e8[_0x358ddd];return _0x216175;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0x15')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x16')]=router; \ No newline at end of file +var _0xc3b5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','exports','path','connect-timeout','express'];(function(_0x41abb9,_0x41d5f4){var _0x4bcae5=function(_0x371705){while(--_0x371705){_0x41abb9['push'](_0x41abb9['shift']());}};_0x4bcae5(++_0x41d5f4);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1db70d,_0x46f556){_0x1db70d=_0x1db70d-0x0;var _0x52e02f=_0xc3b5[_0x1db70d];return _0x52e02f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var fs_extra=require(_0x5c3b('0x4'));var auth=require(_0x5c3b('0x5'));var interaction=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var controller=require('./voiceCallReport.controller');router[_0x5c3b('0x8')]('/',auth[_0x5c3b('0x9')](),controller['index']);router[_0x5c3b('0x8')](_0x5c3b('0xa'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xb')]);router['get'](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xd')]);router[_0x5c3b('0xe')]('/',auth['isAuthenticated'](),controller[_0x5c3b('0xf')]);router[_0x5c3b('0x10')](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0x11')]);router['delete'](_0x5c3b('0xc'),auth[_0x5c3b('0x9')](),controller['destroy']);module[_0x5c3b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b34a7fa..5e60317 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 _0x8c9c=['STRING','ENUM','outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','exports'];(function(_0x5b3719,_0xf0db61){var _0x41669c=function(_0xf597e6){while(--_0xf597e6){_0x5b3719['push'](_0x5b3719['shift']());}};_0x41669c(++_0xf0db61);}(_0x8c9c,0x131));var _0xc8c9=function(_0x425e81,_0x1874e9){_0x425e81=_0x425e81-0x0;var _0x53047f=_0x8c9c[_0x425e81];return _0x53047f;};'use strict';var Sequelize=require('sequelize');module[_0xc8c9('0x0')]={'uniqueid':{'type':Sequelize[_0xc8c9('0x1')]},'type':{'type':Sequelize[_0xc8c9('0x2')]('inbound','internal',_0xc8c9('0x3'),_0xc8c9('0x4'),_0xc8c9('0x5'),'dialer')},'tag':{'type':Sequelize[_0xc8c9('0x1')]},'accountcode':{'type':Sequelize[_0xc8c9('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xc8c9('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc8c9('0x1')]},'channel':{'type':Sequelize[_0xc8c9('0x1')]},'destinationchannel':{'type':Sequelize[_0xc8c9('0x1')]},'lastapplication':{'type':Sequelize[_0xc8c9('0x1')]},'lastdata':{'type':Sequelize[_0xc8c9('0x6')]},'starttime':{'type':Sequelize[_0xc8c9('0x7')]},'systemanswertime':{'type':Sequelize[_0xc8c9('0x7')]},'answertime':{'type':Sequelize[_0xc8c9('0x7')]},'endtime':{'type':Sequelize[_0xc8c9('0x7')]},'duration':{'type':Sequelize[_0xc8c9('0x8')]},'billableseconds':{'type':Sequelize[_0xc8c9('0x8')]},'mohtime':{'type':Sequelize[_0xc8c9('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc8c9('0x1')]},'amaflags':{'type':Sequelize[_0xc8c9('0x1')]},'userfield':{'type':Sequelize[_0xc8c9('0x1')]},'userDisposition':{'type':Sequelize[_0xc8c9('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xc8c9('0x1')]},'note':{'type':Sequelize[_0xc8c9('0x1')]},'prefix':{'type':Sequelize[_0xc8c9('0x1')]},'routeid':{'type':Sequelize[_0xc8c9('0x8')]},'sipcallid':{'type':Sequelize[_0xc8c9('0x1')]}}; \ No newline at end of file +var _0x6b72=['STRING','ENUM','internal','outbound','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x6b72,0x19d));var _0x26b7=function(_0x679431,_0x15c5cc){_0x679431=_0x679431-0x0;var _0x403154=_0x6b72[_0x679431];return _0x403154;};'use strict';var Sequelize=require(_0x26b7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x26b7('0x1')]},'type':{'type':Sequelize[_0x26b7('0x2')]('inbound',_0x26b7('0x3'),_0x26b7('0x4'),'inbound-fax','outbound-fax',_0x26b7('0x5'))},'tag':{'type':Sequelize[_0x26b7('0x1')]},'accountcode':{'type':Sequelize[_0x26b7('0x1')]},'source':{'type':Sequelize[_0x26b7('0x1')]},'destination':{'type':Sequelize[_0x26b7('0x1')]},'destinationcontext':{'type':Sequelize[_0x26b7('0x1')]},'callerid':{'type':Sequelize[_0x26b7('0x1')]},'channel':{'type':Sequelize[_0x26b7('0x1')]},'destinationchannel':{'type':Sequelize[_0x26b7('0x1')]},'lastapplication':{'type':Sequelize[_0x26b7('0x1')]},'lastdata':{'type':Sequelize[_0x26b7('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x26b7('0x7')]},'answertime':{'type':Sequelize[_0x26b7('0x7')]},'endtime':{'type':Sequelize[_0x26b7('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x26b7('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x26b7('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x26b7('0x1')]},'userDisposition':{'type':Sequelize[_0x26b7('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x26b7('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x26b7('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x26b7('0x1')]},'routeid':{'type':Sequelize[_0x26b7('0x8')]},'sipcallid':{'type':Sequelize[_0x26b7('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9e8dfa9..d0011b4 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x464499,_0x41ce5f){var _0x492925=function(_0x112c14){while(--_0x112c14){_0x464499['push'](_0x464499['shift']());}};_0x492925(++_0x41ce5f);}(_0xb10b,0x12a));var _0xbb10=function(_0x4cb322,_0x505daf){_0x4cb322=_0x4cb322-0x0;var _0x25be4b=_0xb10b[_0x4cb322];return _0x25be4b;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e9d94e6..c4e9541 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 _0x7433=['lodash','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x420f31,_0x2008c9){var _0x425b07=function(_0x4495bb){while(--_0x4495bb){_0x420f31['push'](_0x420f31['shift']());}};_0x425b07(++_0x2008c9);}(_0x7433,0x140));var _0x3743=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x7433[_0x1ba43c];return _0x2f60eb;};'use strict';var _=require(_0x3743('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3743('0x1'));var fs=require('fs');var path=require(_0x3743('0x2'));var rimraf=require('rimraf');var config=require(_0x3743('0x3'));var attributes=require(_0x3743('0x4'));module[_0x3743('0x5')]=function(_0x52ebf8,_0x1daaef){return _0x52ebf8[_0x3743('0x6')](_0x3743('0x7'),attributes,{'tableName':_0x3743('0x8'),'paranoid':![],'indexes':[{'fields':[_0x3743('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57c0=['define','VoiceCallReport','report_call','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x42668f,_0x2d8da3){var _0x2626ac=function(_0x2e7d4f){while(--_0x2e7d4f){_0x42668f['push'](_0x42668f['shift']());}};_0x2626ac(++_0x2d8da3);}(_0x57c0,0xba));var _0x057c=function(_0x497694,_0x45a883){_0x497694=_0x497694-0x0;var _0x522d39=_0x57c0[_0x497694];return _0x522d39;};'use strict';var _=require(_0x057c('0x0'));var util=require(_0x057c('0x1'));var logger=require('../../config/logger')(_0x057c('0x2'));var moment=require('moment');var BPromise=require(_0x057c('0x3'));var rp=require(_0x057c('0x4'));var fs=require('fs');var path=require(_0x057c('0x5'));var rimraf=require(_0x057c('0x6'));var config=require(_0x057c('0x7'));var attributes=require(_0x057c('0x8'));module[_0x057c('0x9')]=function(_0x446902,_0x5a1286){return _0x446902[_0x057c('0xa')](_0x057c('0xb'),attributes,{'tableName':_0x057c('0xc'),'paranoid':![],'indexes':[{'fields':[_0x057c('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 54e69d5..e3c02ea 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 _0xaf2d=['message','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','catch','CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x38e697,_0x59c988){var _0xe2bda2=function(_0xfa32fd){while(--_0xfa32fd){_0x38e697['push'](_0x38e697['shift']());}};_0xe2bda2(++_0x59c988);}(_0xaf2d,0xab));var _0xdaf2=function(_0x497e4c,_0x44bf61){_0x497e4c=_0x497e4c-0x0;var _0x265f0a=_0xaf2d[_0x497e4c];return _0x265f0a;};'use strict';var _=require(_0xdaf2('0x0'));var util=require(_0xdaf2('0x1'));var moment=require(_0xdaf2('0x2'));var BPromise=require('bluebird');var rs=require(_0xdaf2('0x3'));var fs=require('fs');var Redis=require(_0xdaf2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdaf2('0x5'));var logger=require(_0xdaf2('0x6'))(_0xdaf2('0x7'));var config=require(_0xdaf2('0x8'));var jayson=require(_0xdaf2('0x9'));var client=jayson[_0xdaf2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b86e2,_0x149aaf,_0x28722b){return new BPromise(function(_0x13eed3,_0x10198c){return client[_0xdaf2('0xb')](_0x2b86e2,_0x28722b)['then'](function(_0x57b000){logger[_0xdaf2('0xc')](_0xdaf2('0xd'),_0x149aaf,'request\x20sent');logger[_0xdaf2('0xe')](_0xdaf2('0xf'),_0x149aaf,_0xdaf2('0x10'),JSON[_0xdaf2('0x11')](_0x57b000));if(_0x57b000[_0xdaf2('0x12')]){if(_0x57b000['error']['code']===0x1f4){logger[_0xdaf2('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x149aaf,_0x57b000[_0xdaf2('0x12')]['message']);return _0x10198c(_0x57b000[_0xdaf2('0x12')][_0xdaf2('0x13')]);}logger[_0xdaf2('0x12')](_0xdaf2('0xd'),_0x149aaf,_0x57b000[_0xdaf2('0x12')]['message']);return _0x13eed3(_0x57b000[_0xdaf2('0x12')][_0xdaf2('0x13')]);}else{logger[_0xdaf2('0xc')](_0xdaf2('0xd'),_0x149aaf,_0xdaf2('0x10'));_0x13eed3(_0x57b000['result'][_0xdaf2('0x13')]);}})['catch'](function(_0x3366b9){logger[_0xdaf2('0x12')](_0xdaf2('0xd'),_0x149aaf,_0x3366b9);_0x10198c(_0x3366b9);});});}exports['GetVoiceCallReport']=function(_0x336c5e){var _0x5d1242=this;return new Promise(function(_0x2d486f,_0x2f8745){return db[_0xdaf2('0x14')][_0xdaf2('0x15')]({'raw':_0x336c5e[_0xdaf2('0x16')]?_0x336c5e[_0xdaf2('0x16')][_0xdaf2('0x17')]===undefined?!![]:![]:!![],'where':_0x336c5e[_0xdaf2('0x16')]?_0x336c5e[_0xdaf2('0x16')][_0xdaf2('0x18')]||null:null,'attributes':_0x336c5e[_0xdaf2('0x16')]?_0x336c5e[_0xdaf2('0x16')]['attributes']||null:null,'limit':_0x336c5e[_0xdaf2('0x16')]?_0x336c5e[_0xdaf2('0x16')][_0xdaf2('0x19')]||null:null,'include':_0x336c5e[_0xdaf2('0x16')]?_0x336c5e['options'][_0xdaf2('0x1a')]?_[_0xdaf2('0x1b')](_0x336c5e['options']['include'],function(_0x298d5f){return{'model':db[_0x298d5f[_0xdaf2('0x1c')]],'as':_0x298d5f['as'],'attributes':_0x298d5f[_0xdaf2('0x1d')],'include':_0x298d5f[_0xdaf2('0x1a')]?_[_0xdaf2('0x1b')](_0x298d5f[_0xdaf2('0x1a')],function(_0xf28d10){return{'model':db[_0xf28d10['model']],'as':_0xf28d10['as'],'attributes':_0xf28d10['attributes'],'include':_0xf28d10[_0xdaf2('0x1a')]?_[_0xdaf2('0x1b')](_0xf28d10[_0xdaf2('0x1a')],function(_0x21b66c){return{'model':db[_0x21b66c[_0xdaf2('0x1c')]],'as':_0x21b66c['as'],'attributes':_0x21b66c[_0xdaf2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bc866){logger['info'](_0xdaf2('0x1e'),_0x336c5e);logger[_0xdaf2('0xe')](_0xdaf2('0x1e'),_0x336c5e,JSON[_0xdaf2('0x11')](_0x3bc866));_0x2d486f(_0x3bc866);})[_0xdaf2('0x1f')](function(_0x44e618){logger['error'](_0xdaf2('0x1e'),_0x44e618[_0xdaf2('0x13')],_0x336c5e);_0x2f8745(_0x5d1242['error'](0x1f4,_0x44e618[_0xdaf2('0x13')]));});});};exports[_0xdaf2('0x20')]=function(_0x5da9e8){var _0x1b9c6b=this;return new Promise(function(_0x6528a7,_0x336564){return db[_0xdaf2('0x14')][_0xdaf2('0x21')](_0x5da9e8[_0xdaf2('0x22')],{'raw':_0x5da9e8['options']?_0x5da9e8['options'][_0xdaf2('0x17')]===undefined?!![]:![]:!![]})[_0xdaf2('0x23')](function(_0x55e950){logger[_0xdaf2('0xc')](_0xdaf2('0x20'),_0x5da9e8);logger['debug']('CreateVoiceCallReport',_0x5da9e8,JSON['stringify'](_0x55e950));_0x6528a7(_0x55e950);})[_0xdaf2('0x1f')](function(_0x586681){logger[_0xdaf2('0x12')](_0xdaf2('0x20'),_0x586681[_0xdaf2('0x13')],_0x5da9e8);_0x336564(_0x1b9c6b[_0xdaf2('0x12')](0x1f4,_0x586681['message']));});});};exports[_0xdaf2('0x24')]=function(_0x19b5ab){var _0x3dbb06=this;return new Promise(function(_0x20b17f,_0x2a8c25){return db[_0xdaf2('0x14')][_0xdaf2('0x25')](_0x19b5ab[_0xdaf2('0x22')],{'raw':_0x19b5ab['options']?_0x19b5ab[_0xdaf2('0x16')][_0xdaf2('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19b5ab['options']?_0x19b5ab['options']['where']||null:null,'attributes':_0x19b5ab[_0xdaf2('0x16')]?_0x19b5ab['options'][_0xdaf2('0x1d')]||null:null,'limit':_0x19b5ab['options']?_0x19b5ab[_0xdaf2('0x16')][_0xdaf2('0x19')]||null:null})[_0xdaf2('0x23')](function(_0xdc46d2){logger['info'](_0xdaf2('0x24'),_0x19b5ab);logger[_0xdaf2('0xe')](_0xdaf2('0x24'),_0x19b5ab,JSON['stringify'](_0xdc46d2));_0x20b17f(_0xdc46d2);})['catch'](function(_0x3a75c5){logger[_0xdaf2('0x12')](_0xdaf2('0x24'),_0x3a75c5[_0xdaf2('0x13')],_0x19b5ab);_0x2a8c25(_0x3dbb06['error'](0x1f4,_0x3a75c5[_0xdaf2('0x13')]));});});}; \ No newline at end of file +var _0xfb56=['stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','limit','map','model','include','attributes','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b8bb3,_0x29136d){var _0x420eb8=function(_0x36379c){while(--_0x36379c){_0x3b8bb3['push'](_0x3b8bb3['shift']());}};_0x420eb8(++_0x29136d);}(_0xfb56,0x16c));var _0x6fb5=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0xfb56[_0x242a4f];return _0x122117;};'use strict';var _=require('lodash');var util=require(_0x6fb5('0x0'));var moment=require(_0x6fb5('0x1'));var BPromise=require('bluebird');var rs=require(_0x6fb5('0x2'));var fs=require('fs');var Redis=require(_0x6fb5('0x3'));var db=require(_0x6fb5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6fb5('0x5'));var config=require('../../config/environment');var jayson=require(_0x6fb5('0x6'));var client=jayson[_0x6fb5('0x7')][_0x6fb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd8e387,_0x418dd8,_0x14cd71){return new BPromise(function(_0x342405,_0x662f9b){return client[_0x6fb5('0x9')](_0xd8e387,_0x14cd71)[_0x6fb5('0xa')](function(_0x20d7b7){logger[_0x6fb5('0xb')](_0x6fb5('0xc'),_0x418dd8,_0x6fb5('0xd'));logger[_0x6fb5('0xe')](_0x6fb5('0xf'),_0x418dd8,_0x6fb5('0xd'),JSON[_0x6fb5('0x10')](_0x20d7b7));if(_0x20d7b7[_0x6fb5('0x11')]){if(_0x20d7b7[_0x6fb5('0x11')][_0x6fb5('0x12')]===0x1f4){logger[_0x6fb5('0x11')](_0x6fb5('0xc'),_0x418dd8,_0x20d7b7[_0x6fb5('0x11')][_0x6fb5('0x13')]);return _0x662f9b(_0x20d7b7[_0x6fb5('0x11')][_0x6fb5('0x13')]);}logger['error'](_0x6fb5('0xc'),_0x418dd8,_0x20d7b7[_0x6fb5('0x11')][_0x6fb5('0x13')]);return _0x342405(_0x20d7b7[_0x6fb5('0x11')]['message']);}else{logger[_0x6fb5('0xb')](_0x6fb5('0xc'),_0x418dd8,_0x6fb5('0xd'));_0x342405(_0x20d7b7[_0x6fb5('0x14')]['message']);}})['catch'](function(_0x154baf){logger[_0x6fb5('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x418dd8,_0x154baf);_0x662f9b(_0x154baf);});});}exports[_0x6fb5('0x15')]=function(_0x3fadcc){var _0x194809=this;return new Promise(function(_0x20bfa5,_0x4cf045){return db[_0x6fb5('0x16')][_0x6fb5('0x17')]({'raw':_0x3fadcc['options']?_0x3fadcc[_0x6fb5('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3fadcc[_0x6fb5('0x18')]?_0x3fadcc[_0x6fb5('0x18')][_0x6fb5('0x19')]||null:null,'attributes':_0x3fadcc[_0x6fb5('0x18')]?_0x3fadcc[_0x6fb5('0x18')]['attributes']||null:null,'limit':_0x3fadcc[_0x6fb5('0x18')]?_0x3fadcc['options'][_0x6fb5('0x1a')]||null:null,'include':_0x3fadcc['options']?_0x3fadcc['options']['include']?_[_0x6fb5('0x1b')](_0x3fadcc[_0x6fb5('0x18')]['include'],function(_0x2daf1a){return{'model':db[_0x2daf1a[_0x6fb5('0x1c')]],'as':_0x2daf1a['as'],'attributes':_0x2daf1a['attributes'],'include':_0x2daf1a[_0x6fb5('0x1d')]?_[_0x6fb5('0x1b')](_0x2daf1a[_0x6fb5('0x1d')],function(_0x262ca5){return{'model':db[_0x262ca5[_0x6fb5('0x1c')]],'as':_0x262ca5['as'],'attributes':_0x262ca5[_0x6fb5('0x1e')],'include':_0x262ca5[_0x6fb5('0x1d')]?_[_0x6fb5('0x1b')](_0x262ca5[_0x6fb5('0x1d')],function(_0x28ef12){return{'model':db[_0x28ef12['model']],'as':_0x28ef12['as'],'attributes':_0x28ef12[_0x6fb5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6fb5('0xa')](function(_0x3a5f85){logger[_0x6fb5('0xb')](_0x6fb5('0x15'),_0x3fadcc);logger['debug'](_0x6fb5('0x15'),_0x3fadcc,JSON['stringify'](_0x3a5f85));_0x20bfa5(_0x3a5f85);})[_0x6fb5('0x1f')](function(_0x4619a9){logger[_0x6fb5('0x11')](_0x6fb5('0x15'),_0x4619a9[_0x6fb5('0x13')],_0x3fadcc);_0x4cf045(_0x194809[_0x6fb5('0x11')](0x1f4,_0x4619a9[_0x6fb5('0x13')]));});});};exports[_0x6fb5('0x20')]=function(_0x941f8e){var _0x9b9bf3=this;return new Promise(function(_0x506381,_0xe90209){return db['VoiceCallReport'][_0x6fb5('0x21')](_0x941f8e[_0x6fb5('0x22')],{'raw':_0x941f8e[_0x6fb5('0x18')]?_0x941f8e[_0x6fb5('0x18')][_0x6fb5('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x195b8e){logger[_0x6fb5('0xb')]('CreateVoiceCallReport',_0x941f8e);logger[_0x6fb5('0xe')]('CreateVoiceCallReport',_0x941f8e,JSON[_0x6fb5('0x10')](_0x195b8e));_0x506381(_0x195b8e);})[_0x6fb5('0x1f')](function(_0x305404){logger[_0x6fb5('0x11')]('CreateVoiceCallReport',_0x305404[_0x6fb5('0x13')],_0x941f8e);_0xe90209(_0x9b9bf3[_0x6fb5('0x11')](0x1f4,_0x305404[_0x6fb5('0x13')]));});});};exports[_0x6fb5('0x24')]=function(_0x187296){var _0x48175e=this;return new Promise(function(_0x16e475,_0x352496){return db[_0x6fb5('0x16')][_0x6fb5('0x25')](_0x187296['body'],{'raw':_0x187296[_0x6fb5('0x18')]?_0x187296[_0x6fb5('0x18')][_0x6fb5('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x187296[_0x6fb5('0x18')]?_0x187296['options'][_0x6fb5('0x19')]||null:null,'attributes':_0x187296[_0x6fb5('0x18')]?_0x187296['options'][_0x6fb5('0x1e')]||null:null,'limit':_0x187296[_0x6fb5('0x18')]?_0x187296['options'][_0x6fb5('0x1a')]||null:null})['then'](function(_0x1b4cb1){logger[_0x6fb5('0xb')](_0x6fb5('0x24'),_0x187296);logger[_0x6fb5('0xe')](_0x6fb5('0x24'),_0x187296,JSON[_0x6fb5('0x10')](_0x1b4cb1));_0x16e475(_0x1b4cb1);})[_0x6fb5('0x1f')](function(_0x9b7f3f){logger[_0x6fb5('0x11')](_0x6fb5('0x24'),_0x9b7f3f['message'],_0x187296);_0x352496(_0x48175e['error'](0x1f4,_0x9b7f3f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6228e06..adf78a0 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 _0xb64c=['connect-timeout','express','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0xb02717,_0x498775){var _0x1d4c4e=function(_0x567f16){while(--_0x567f16){_0xb02717['push'](_0xb02717['shift']());}};_0x1d4c4e(++_0x498775);}(_0xb64c,0x1dd));var _0xcb64=function(_0x1e4635,_0x589a9b){_0x1e4635=_0x1e4635-0x0;var _0x4a6dae=_0xb64c[_0x1e4635];return _0x4a6dae;};'use strict';var multer=require(_0xcb64('0x0'));var util=require(_0xcb64('0x1'));var path=require(_0xcb64('0x2'));var timeout=require(_0xcb64('0x3'));var express=require(_0xcb64('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcb64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcb64('0x6'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcb64('0x7')]);router['get'](_0xcb64('0x8'),auth[_0xcb64('0x9')](),controller[_0xcb64('0xa')]);router[_0xcb64('0xb')]('/',auth[_0xcb64('0x9')](),controller['create']);router[_0xcb64('0xc')](_0xcb64('0x8'),auth[_0xcb64('0x9')](),controller['update']);router[_0xcb64('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcb64('0xe')]);module[_0xcb64('0xf')]=router; \ No newline at end of file +var _0x2e12=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','create','/:id','delete','exports','multer'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x2e12,0xff));var _0x22e1=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x2e12[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0x22e1('0x0'));var util=require(_0x22e1('0x1'));var path=require('path');var timeout=require(_0x22e1('0x2'));var express=require(_0x22e1('0x3'));var router=express[_0x22e1('0x4')]();var fs_extra=require(_0x22e1('0x5'));var auth=require(_0x22e1('0x6'));var interaction=require(_0x22e1('0x7'));var config=require(_0x22e1('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x22e1('0x9')]('/',auth['isAuthenticated'](),controller[_0x22e1('0xa')]);router[_0x22e1('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x22e1('0xb')](),controller[_0x22e1('0xc')]);router['put'](_0x22e1('0xd'),auth[_0x22e1('0xb')](),controller['update']);router[_0x22e1('0xe')](_0x22e1('0xd'),auth[_0x22e1('0xb')](),controller['destroy']);module[_0x22e1('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4e50812..15e62b0 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 _0xd216=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue','options','join'];(function(_0xf94131,_0x58b63d){var _0xdf5c19=function(_0xa00801){while(--_0xa00801){_0xf94131['push'](_0xf94131['shift']());}};_0xdf5c19(++_0x58b63d);}(_0xd216,0x1bc));var _0x6d21=function(_0x31fe2b,_0x3b0253){_0x31fe2b=_0x31fe2b-0x0;var _0x200bce=_0xd216[_0x31fe2b];return _0x200bce;};'use strict';var Sequelize=require(_0x6d21('0x0'));module[_0x6d21('0x1')]={'name':{'type':Sequelize[_0x6d21('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x6d21('0x2')],'set':function(_0x26ba68){this[_0x6d21('0x3')](_0x6d21('0x4'),_0x26ba68?_0x26ba68[_0x6d21('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x6d21('0x4'))?this[_0x6d21('0x6')](_0x6d21('0x4'))[_0x6d21('0x7')](''):[];}},'auth':{'type':Sequelize[_0x6d21('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x6d21('0x2')]},'record':{'type':Sequelize[_0x6d21('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d21('0x2')]}}; \ No newline at end of file +var _0xc9a4=['sequelize','STRING','name','setDataValue','options','getDataValue','split','BOOLEAN'];(function(_0x7b9c5f,_0x4a0758){var _0x1deed3=function(_0x1663c5){while(--_0x1663c5){_0x7b9c5f['push'](_0x7b9c5f['shift']());}};_0x1deed3(++_0x4a0758);}(_0xc9a4,0x188));var _0x4c9a=function(_0x5082af,_0x669e2d){_0x5082af=_0x5082af-0x0;var _0xfb192a=_0xc9a4[_0x5082af];return _0xfb192a;};'use strict';var Sequelize=require(_0x4c9a('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c9a('0x1')]},'prefix':{'type':Sequelize[_0x4c9a('0x1')],'unique':_0x4c9a('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x4c9a('0x1')],'set':function(_0x35aaec){this[_0x4c9a('0x3')](_0x4c9a('0x4'),_0x35aaec?_0x35aaec['join'](''):[]);},'get':function(){return this[_0x4c9a('0x5')](_0x4c9a('0x4'))?this[_0x4c9a('0x5')](_0x4c9a('0x4'))[_0x4c9a('0x6')](''):[];}},'auth':{'type':Sequelize[_0x4c9a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x4c9a('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4c9a('0x1')]},'description':{'type':Sequelize[_0x4c9a('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index ec5f173..1564399 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 _0x4746=['error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','intersection','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource'];(function(_0xcbfa6d,_0x3fd46d){var _0x156e91=function(_0x9fae67){while(--_0x9fae67){_0xcbfa6d['push'](_0xcbfa6d['shift']());}};_0x156e91(++_0x3fd46d);}(_0x4746,0xc6));var _0x6474=function(_0x2f5075,_0x45e223){_0x2f5075=_0x2f5075-0x0;var _0x4d88b8=_0x4746[_0x2f5075];return _0x4d88b8;};'use strict';var emlformat=require(_0x6474('0x0'));var rimraf=require(_0x6474('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6474('0x2'));var rp=require('request-promise');var moment=require(_0x6474('0x3'));var BPromise=require(_0x6474('0x4'));var Mustache=require(_0x6474('0x5'));var util=require(_0x6474('0x6'));var path=require(_0x6474('0x7'));var sox=require('sox');var csv=require(_0x6474('0x8'));var ejs=require(_0x6474('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6474('0xa'));var squel=require(_0x6474('0xb'));var crypto=require(_0x6474('0xc'));var jsforce=require(_0x6474('0xd'));var deskjs=require(_0x6474('0xe'));var toCsv=require(_0x6474('0x8'));var querystring=require('querystring');var Papa=require(_0x6474('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6474('0x10'));var as=require(_0x6474('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6474('0x12'))('api');var utils=require(_0x6474('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6474('0x14'));var db=require(_0x6474('0x15'))['db'];function respondWithStatusCode(_0x5509d2,_0x4936c2){_0x4936c2=_0x4936c2||0xcc;return function(_0x5cf0de){if(_0x5cf0de){return _0x5509d2[_0x6474('0x16')](_0x4936c2);}return _0x5509d2[_0x6474('0x17')](_0x4936c2)[_0x6474('0x18')]();};}function respondWithResult(_0xad1ebe,_0x113aba){_0x113aba=_0x113aba||0xc8;return function(_0x37fe08){if(_0x37fe08){return _0xad1ebe[_0x6474('0x17')](_0x113aba)[_0x6474('0x19')](_0x37fe08);}};}function respondWithFilteredResult(_0x29b935,_0x5cf8fa){return function(_0x5ee279){if(_0x5ee279){var _0x583afa=typeof _0x5cf8fa[_0x6474('0x1a')]===_0x6474('0x1b')&&typeof _0x5cf8fa[_0x6474('0x1c')]===_0x6474('0x1b');var _0x195465=_0x5ee279['count'];var _0x1505fc=_0x583afa?0x0:_0x5cf8fa[_0x6474('0x1a')];var _0xb6ecb6=_0x583afa?_0x5ee279[_0x6474('0x1d')]:_0x5cf8fa[_0x6474('0x1a')]+_0x5cf8fa[_0x6474('0x1c')];var _0x2e33f0;if(_0xb6ecb6>=_0x195465){_0xb6ecb6=_0x195465;_0x2e33f0=0xc8;}else{_0x2e33f0=0xce;}_0x29b935[_0x6474('0x17')](_0x2e33f0);return _0x29b935['set'](_0x6474('0x1e'),_0x1505fc+'-'+_0xb6ecb6+'/'+_0x195465)['json'](_0x5ee279);}return null;};}function patchUpdates(_0xd23b18){return function(_0x1df53c){try{jsonpatch[_0x6474('0x1f')](_0x1df53c,_0xd23b18,!![]);}catch(_0x185760){return BPromise[_0x6474('0x20')](_0x185760);}return _0x1df53c[_0x6474('0x21')]();};}function saveUpdates(_0x382ebf,_0x5d0e5c){return function(_0xf3cd65){if(_0xf3cd65){return _0xf3cd65['update'](_0x382ebf)[_0x6474('0x22')](function(_0x4dc277){return _0x4dc277;});}return null;};}function removeEntity(_0x4ba645,_0x58e024){return function(_0xb67896){if(_0xb67896){return _0xb67896[_0x6474('0x23')]()[_0x6474('0x22')](function(){var _0x18c1b3=_0xb67896[_0x6474('0x24')]({'plain':!![]});var _0x4a9cb6=_0x6474('0x25');return db[_0x6474('0x26')][_0x6474('0x23')]({'where':{'type':_0x4a9cb6,'resourceId':_0x18c1b3['id']}})[_0x6474('0x22')](function(){return _0xb67896;});})['then'](function(){_0x4ba645['status'](0xcc)[_0x6474('0x18')]();});}};}function handleEntityNotFound(_0x12d05f,_0xca66ba){return function(_0x39a591){if(!_0x39a591){_0x12d05f['sendStatus'](0x194);}return _0x39a591;};}function handleError(_0x4dc02b,_0x542265){_0x542265=_0x542265||0x1f4;return function(_0x4b81f3){logger[_0x6474('0x27')](_0x4b81f3[_0x6474('0x28')]);if(_0x4b81f3[_0x6474('0x29')]){delete _0x4b81f3[_0x6474('0x29')];}_0x4dc02b['status'](_0x542265)[_0x6474('0x2a')](_0x4b81f3);};}exports[_0x6474('0x2b')]=function(_0xe24477,_0x2e01fa){var _0x2a3ad0={},_0x443f8c={},_0xeb1f90={'count':0x0,'rows':[]};var _0x5f2926=_[_0x6474('0x2c')](db[_0x6474('0x2d')][_0x6474('0x2e')],function(_0x34fea6){return{'name':_0x34fea6['fieldName'],'type':_0x34fea6['type']['key']};});_0x443f8c[_0x6474('0x2f')]=_[_0x6474('0x2c')](_0x5f2926,_0x6474('0x29'));_0x443f8c['query']=_[_0x6474('0x30')](_0xe24477[_0x6474('0x31')]);_0x443f8c[_0x6474('0x32')]=_['intersection'](_0x443f8c[_0x6474('0x2f')],_0x443f8c[_0x6474('0x31')]);_0x2a3ad0[_0x6474('0x33')]=_['intersection'](_0x443f8c[_0x6474('0x2f')],qs[_0x6474('0x34')](_0xe24477['query'][_0x6474('0x34')]));_0x2a3ad0[_0x6474('0x33')]=_0x2a3ad0[_0x6474('0x33')][_0x6474('0x35')]?_0x2a3ad0[_0x6474('0x33')]:_0x443f8c['model'];if(!_0xe24477[_0x6474('0x31')][_0x6474('0x36')]('nolimit')){_0x2a3ad0['limit']=qs[_0x6474('0x1c')](_0xe24477['query'][_0x6474('0x1c')]);_0x2a3ad0[_0x6474('0x1a')]=qs[_0x6474('0x1a')](_0xe24477[_0x6474('0x31')][_0x6474('0x1a')]);}_0x2a3ad0['order']=qs['sort'](_0xe24477[_0x6474('0x31')][_0x6474('0x37')]);_0x2a3ad0[_0x6474('0x38')]=qs['filters'](_[_0x6474('0x39')](_0xe24477['query'],_0x443f8c[_0x6474('0x32')]),_0x5f2926);if(_0xe24477['query']['filter']){_0x2a3ad0['where']=_[_0x6474('0x3a')](_0x2a3ad0[_0x6474('0x38')],{'$or':_[_0x6474('0x2c')](_0x5f2926,function(_0xe2a64c){if(_0xe2a64c[_0x6474('0x3b')]!==_0x6474('0x3c')){var _0x52497f={};_0x52497f[_0xe2a64c[_0x6474('0x29')]]={'$like':'%'+_0xe24477[_0x6474('0x31')]['filter']+'%'};return _0x52497f;}})});}_0x2a3ad0=_[_0x6474('0x3a')]({},_0x2a3ad0,_0xe24477[_0x6474('0x3d')]);var _0x462908={'where':_0x2a3ad0['where']};return db[_0x6474('0x2d')][_0x6474('0x1d')](_0x462908)[_0x6474('0x22')](function(_0x47fa33){_0xeb1f90['count']=_0x47fa33;if(_0xe24477[_0x6474('0x31')][_0x6474('0x3e')]){_0x2a3ad0['include']=[{'all':!![]}];}return db[_0x6474('0x2d')][_0x6474('0x3f')](_0x2a3ad0);})[_0x6474('0x22')](function(_0x1a4bde){_0xeb1f90['rows']=_0x1a4bde;return _0xeb1f90;})['then'](respondWithFilteredResult(_0x2e01fa,_0x2a3ad0))[_0x6474('0x40')](handleError(_0x2e01fa,null));};exports['show']=function(_0x391be9,_0x25cb5b){var _0x1ff044={'raw':![],'where':{'id':_0x391be9[_0x6474('0x41')]['id']}},_0x54e797={};_0x54e797[_0x6474('0x2f')]=_['keys'](db[_0x6474('0x2d')][_0x6474('0x2e')]);_0x54e797[_0x6474('0x31')]=_[_0x6474('0x30')](_0x391be9[_0x6474('0x31')]);_0x54e797[_0x6474('0x32')]=_[_0x6474('0x42')](_0x54e797['model'],_0x54e797[_0x6474('0x31')]);_0x1ff044[_0x6474('0x33')]=_['intersection'](_0x54e797[_0x6474('0x2f')],qs[_0x6474('0x34')](_0x391be9['query']['fields']));_0x1ff044['attributes']=_0x1ff044['attributes'][_0x6474('0x35')]?_0x1ff044[_0x6474('0x33')]:_0x54e797[_0x6474('0x2f')];if(_0x391be9[_0x6474('0x31')]['includeAll']){_0x1ff044[_0x6474('0x43')]=[{'all':!![]}];}_0x1ff044=_[_0x6474('0x3a')]({},_0x1ff044,_0x391be9[_0x6474('0x3d')]);return db[_0x6474('0x2d')][_0x6474('0x44')](_0x1ff044)[_0x6474('0x22')](handleEntityNotFound(_0x25cb5b,null))['then'](respondWithResult(_0x25cb5b,null))[_0x6474('0x40')](handleError(_0x25cb5b,null));};exports[_0x6474('0x45')]=function(_0x394ff9,_0x495666){return db[_0x6474('0x2d')][_0x6474('0x45')](_0x394ff9['body'],{})[_0x6474('0x22')](function(_0xfc538f){var _0x228a16=_0x394ff9[_0x6474('0x46')][_0x6474('0x24')]({'plain':!![]});if(!_0x228a16)throw new Error(_0x6474('0x47'));if(_0x228a16[_0x6474('0x48')]==='user'){var _0x27ebf9=_0xfc538f[_0x6474('0x24')]({'plain':!![]});var _0x231a02='ChanSpies';return db[_0x6474('0x49')][_0x6474('0x44')]({'where':{'name':_0x231a02,'userProfileId':_0x228a16[_0x6474('0x4a')]},'raw':!![]})['then'](function(_0x5d2c92){if(_0x5d2c92&&_0x5d2c92[_0x6474('0x4b')]===0x0){return db[_0x6474('0x26')]['create']({'name':_0x27ebf9['name'],'resourceId':_0x27ebf9['id'],'type':_0x5d2c92[_0x6474('0x29')],'sectionId':_0x5d2c92['id']},{})['then'](function(){return _0xfc538f;});}else{return _0xfc538f;}})[_0x6474('0x40')](function(_0x409e55){logger[_0x6474('0x27')](_0x6474('0x4c'),_0x409e55);throw _0x409e55;});}return _0xfc538f;})[_0x6474('0x22')](respondWithResult(_0x495666,0xc9))[_0x6474('0x40')](handleError(_0x495666,null));};exports[_0x6474('0x4d')]=function(_0x451080,_0x471372){if(_0x451080[_0x6474('0x4e')]['id']){delete _0x451080[_0x6474('0x4e')]['id'];}return db[_0x6474('0x2d')][_0x6474('0x44')]({'where':{'id':_0x451080['params']['id']}})[_0x6474('0x22')](handleEntityNotFound(_0x471372,null))['then'](saveUpdates(_0x451080['body'],null))[_0x6474('0x22')](respondWithResult(_0x471372,null))[_0x6474('0x40')](handleError(_0x471372,null));};exports[_0x6474('0x23')]=function(_0x2a79d4,_0x5c245d){return db[_0x6474('0x2d')][_0x6474('0x44')]({'where':{'id':_0x2a79d4[_0x6474('0x41')]['id']}})[_0x6474('0x22')](handleEntityNotFound(_0x5c245d,null))[_0x6474('0x22')](removeEntity(_0x5c245d,null))[_0x6474('0x40')](handleError(_0x5c245d,null));}; \ No newline at end of file +var _0x3140=['filter','options','count','include','findAll','catch','show','keys','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','get','ChanSpies','UserProfileResource','error','stack','send','map','VoiceChanSpy','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','name'];(function(_0x296ed8,_0x1ab53c){var _0x88990e=function(_0x57aa2e){while(--_0x57aa2e){_0x296ed8['push'](_0x296ed8['shift']());}};_0x88990e(++_0x1ab53c);}(_0x3140,0xaf));var _0x0314=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x3140[_0x51b1a5];return _0x15c738;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];function respondWithStatusCode(_0xd85ddf,_0x4602ec){_0x4602ec=_0x4602ec||0xcc;return function(_0x153077){if(_0x153077){return _0xd85ddf[_0x0314('0x19')](_0x4602ec);}return _0xd85ddf[_0x0314('0x1a')](_0x4602ec)['end']();};}function respondWithResult(_0x1c26ff,_0xbe0b07){_0xbe0b07=_0xbe0b07||0xc8;return function(_0x1316a0){if(_0x1316a0){return _0x1c26ff[_0x0314('0x1a')](_0xbe0b07)[_0x0314('0x1b')](_0x1316a0);}};}function respondWithFilteredResult(_0x398c91,_0x413bfa){return function(_0x3ea356){if(_0x3ea356){var _0x5e460f=typeof _0x413bfa[_0x0314('0x1c')]===_0x0314('0x1d')&&typeof _0x413bfa[_0x0314('0x1e')]==='undefined';var _0x6c48cb=_0x3ea356['count'];var _0x575b68=_0x5e460f?0x0:_0x413bfa[_0x0314('0x1c')];var _0x329679=_0x5e460f?_0x3ea356['count']:_0x413bfa[_0x0314('0x1c')]+_0x413bfa[_0x0314('0x1e')];var _0x583ffa;if(_0x329679>=_0x6c48cb){_0x329679=_0x6c48cb;_0x583ffa=0xc8;}else{_0x583ffa=0xce;}_0x398c91[_0x0314('0x1a')](_0x583ffa);return _0x398c91['set'](_0x0314('0x1f'),_0x575b68+'-'+_0x329679+'/'+_0x6c48cb)[_0x0314('0x1b')](_0x3ea356);}return null;};}function patchUpdates(_0x16d273){return function(_0x77ddfd){try{jsonpatch[_0x0314('0x20')](_0x77ddfd,_0x16d273,!![]);}catch(_0xdfad84){return BPromise['reject'](_0xdfad84);}return _0x77ddfd['save']();};}function saveUpdates(_0x20305b,_0xbd3ad0){return function(_0x1945f8){if(_0x1945f8){return _0x1945f8[_0x0314('0x21')](_0x20305b)[_0x0314('0x22')](function(_0xd7638b){return _0xd7638b;});}return null;};}function removeEntity(_0x58a1c9,_0x3c743e){return function(_0x43fb0e){if(_0x43fb0e){return _0x43fb0e['destroy']()[_0x0314('0x22')](function(){var _0xfc4893=_0x43fb0e[_0x0314('0x23')]({'plain':!![]});var _0x26c6a4=_0x0314('0x24');return db[_0x0314('0x25')]['destroy']({'where':{'type':_0x26c6a4,'resourceId':_0xfc4893['id']}})[_0x0314('0x22')](function(){return _0x43fb0e;});})[_0x0314('0x22')](function(){_0x58a1c9[_0x0314('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b4b5,_0x5e3eba){return function(_0x47c102){if(!_0x47c102){_0x29b4b5['sendStatus'](0x194);}return _0x47c102;};}function handleError(_0x2fc520,_0x21d6a5){_0x21d6a5=_0x21d6a5||0x1f4;return function(_0x550dc4){logger[_0x0314('0x26')](_0x550dc4[_0x0314('0x27')]);if(_0x550dc4['name']){delete _0x550dc4['name'];}_0x2fc520[_0x0314('0x1a')](_0x21d6a5)[_0x0314('0x28')](_0x550dc4);};}exports['index']=function(_0x44adb3,_0x16e74a){var _0x3d6652={},_0x4da71c={},_0x5b82b2={'count':0x0,'rows':[]};var _0x37ab90=_[_0x0314('0x29')](db[_0x0314('0x2a')]['rawAttributes'],function(_0x1d01b5){return{'name':_0x1d01b5['fieldName'],'type':_0x1d01b5['type'][_0x0314('0x2b')]};});_0x4da71c[_0x0314('0x2c')]=_[_0x0314('0x29')](_0x37ab90,'name');_0x4da71c[_0x0314('0x2d')]=_['keys'](_0x44adb3[_0x0314('0x2d')]);_0x4da71c['filters']=_['intersection'](_0x4da71c[_0x0314('0x2c')],_0x4da71c['query']);_0x3d6652[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x4da71c[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x30')]));_0x3d6652[_0x0314('0x2e')]=_0x3d6652['attributes'][_0x0314('0x31')]?_0x3d6652[_0x0314('0x2e')]:_0x4da71c[_0x0314('0x2c')];if(!_0x44adb3[_0x0314('0x2d')][_0x0314('0x32')](_0x0314('0x33'))){_0x3d6652['limit']=qs[_0x0314('0x1e')](_0x44adb3['query'][_0x0314('0x1e')]);_0x3d6652['offset']=qs[_0x0314('0x1c')](_0x44adb3['query']['offset']);}_0x3d6652['order']=qs[_0x0314('0x34')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x34')]);_0x3d6652[_0x0314('0x35')]=qs[_0x0314('0x36')](_['pick'](_0x44adb3[_0x0314('0x2d')],_0x4da71c[_0x0314('0x36')]),_0x37ab90);if(_0x44adb3[_0x0314('0x2d')]['filter']){_0x3d6652[_0x0314('0x35')]=_['merge'](_0x3d6652[_0x0314('0x35')],{'$or':_['map'](_0x37ab90,function(_0x24fe65){if(_0x24fe65['type']!=='VIRTUAL'){var _0x370539={};_0x370539[_0x24fe65[_0x0314('0x37')]]={'$like':'%'+_0x44adb3['query'][_0x0314('0x38')]+'%'};return _0x370539;}})});}_0x3d6652=_['merge']({},_0x3d6652,_0x44adb3[_0x0314('0x39')]);var _0x438ddd={'where':_0x3d6652[_0x0314('0x35')]};return db[_0x0314('0x2a')][_0x0314('0x3a')](_0x438ddd)['then'](function(_0x52a71c){_0x5b82b2[_0x0314('0x3a')]=_0x52a71c;if(_0x44adb3[_0x0314('0x2d')]['includeAll']){_0x3d6652[_0x0314('0x3b')]=[{'all':!![]}];}return db[_0x0314('0x2a')][_0x0314('0x3c')](_0x3d6652);})['then'](function(_0x2b328c){_0x5b82b2['rows']=_0x2b328c;return _0x5b82b2;})[_0x0314('0x22')](respondWithFilteredResult(_0x16e74a,_0x3d6652))[_0x0314('0x3d')](handleError(_0x16e74a,null));};exports[_0x0314('0x3e')]=function(_0x583aba,_0xcafd05){var _0xf4c4a1={'raw':![],'where':{'id':_0x583aba['params']['id']}},_0x588e65={};_0x588e65['model']=_[_0x0314('0x3f')](db[_0x0314('0x2a')][_0x0314('0x40')]);_0x588e65['query']=_[_0x0314('0x3f')](_0x583aba[_0x0314('0x2d')]);_0x588e65[_0x0314('0x36')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],_0x588e65['query']);_0xf4c4a1[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x583aba[_0x0314('0x2d')][_0x0314('0x30')]));_0xf4c4a1[_0x0314('0x2e')]=_0xf4c4a1['attributes'][_0x0314('0x31')]?_0xf4c4a1[_0x0314('0x2e')]:_0x588e65['model'];if(_0x583aba[_0x0314('0x2d')][_0x0314('0x41')]){_0xf4c4a1[_0x0314('0x3b')]=[{'all':!![]}];}_0xf4c4a1=_['merge']({},_0xf4c4a1,_0x583aba['options']);return db[_0x0314('0x2a')][_0x0314('0x42')](_0xf4c4a1)[_0x0314('0x22')](handleEntityNotFound(_0xcafd05,null))[_0x0314('0x22')](respondWithResult(_0xcafd05,null))[_0x0314('0x3d')](handleError(_0xcafd05,null));};exports[_0x0314('0x43')]=function(_0x36a72a,_0x478b8b){return db[_0x0314('0x2a')]['create'](_0x36a72a[_0x0314('0x44')],{})[_0x0314('0x22')](function(_0x3003dd){var _0x362b60=_0x36a72a[_0x0314('0x45')]['get']({'plain':!![]});if(!_0x362b60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x362b60[_0x0314('0x46')]===_0x0314('0x45')){var _0x20070c=_0x3003dd[_0x0314('0x23')]({'plain':!![]});var _0x5b3c49=_0x0314('0x24');return db[_0x0314('0x47')][_0x0314('0x42')]({'where':{'name':_0x5b3c49,'userProfileId':_0x362b60[_0x0314('0x48')]},'raw':!![]})[_0x0314('0x22')](function(_0x458bd8){if(_0x458bd8&&_0x458bd8[_0x0314('0x49')]===0x0){return db['UserProfileResource'][_0x0314('0x43')]({'name':_0x20070c[_0x0314('0x37')],'resourceId':_0x20070c['id'],'type':_0x458bd8[_0x0314('0x37')],'sectionId':_0x458bd8['id']},{})['then'](function(){return _0x3003dd;});}else{return _0x3003dd;}})[_0x0314('0x3d')](function(_0x11695d){logger['error'](_0x0314('0x4a'),_0x11695d);throw _0x11695d;});}return _0x3003dd;})[_0x0314('0x22')](respondWithResult(_0x478b8b,0xc9))[_0x0314('0x3d')](handleError(_0x478b8b,null));};exports[_0x0314('0x21')]=function(_0x544a03,_0x39b4c1){if(_0x544a03[_0x0314('0x44')]['id']){delete _0x544a03[_0x0314('0x44')]['id'];}return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x544a03[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0x39b4c1,null))[_0x0314('0x22')](saveUpdates(_0x544a03[_0x0314('0x44')],null))[_0x0314('0x22')](respondWithResult(_0x39b4c1,null))['catch'](handleError(_0x39b4c1,null));};exports[_0x0314('0x4c')]=function(_0x305568,_0xf29a33){return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x305568[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0xf29a33,null))['then'](removeEntity(_0xf29a33,null))['catch'](handleError(_0xf29a33,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 922bbe8..5a17b7b 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 _0xfe9d=['findAll','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','join','record','StopMixMonitor','length','concat','internal','name','User'];(function(_0x18c835,_0x1aaa8d){var _0x226e19=function(_0x4a1e3d){while(--_0x4a1e3d){_0x18c835['push'](_0x18c835['shift']());}};_0x226e19(++_0x1aaa8d);}(_0xfe9d,0x18a));var _0xdfe9=function(_0x203431,_0x55cd8f){_0x203431=_0x203431-0x0;var _0x2d47f8=_0xfe9d[_0x203431];return _0x2d47f8;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xdfe9('0x0'));var attributes=require(_0xdfe9('0x1'));var getUserApplications=function(_0x5f3681,_0x3fb452,_0x29f3d3){var _0x47f1d9=0x1;var _0x4a8499=[];var _0x41f058={'context':_0x3fb452['context']||'from-sip','exten':util['format'](_0xdfe9('0x2'),_0x5f3681[_0xdfe9('0x3')],_0x29f3d3),'type':'system','isApp':![],'ChanSpyId':_0x5f3681['id'],'UserId':_0x3fb452['id']};_0x4a8499[_0xdfe9('0x4')](_[_0xdfe9('0x5')]({'app':_0xdfe9('0x6'),'appdata':util[_0xdfe9('0x7')](_0xdfe9('0x8'),_0xdfe9('0x9')),'priority':_0x47f1d9++},_0x41f058));if(_0x5f3681['record']){_0x4a8499['push'](_['merge']({'app':_0xdfe9('0xa'),'appdata':util['format'](_0xdfe9('0xb'),_0x5f3681[_0xdfe9('0xc')]),'priority':_0x47f1d9++},_0x41f058));}if(_0x5f3681[_0xdfe9('0xd')]){_0x4a8499[_0xdfe9('0x4')](_[_0xdfe9('0x5')]({'app':_0xdfe9('0xe'),'appdata':_0x5f3681[_0xdfe9('0xf')],'priority':_0x47f1d9++},_0x41f058));}_0x4a8499['push'](_[_0xdfe9('0x5')]({'app':'ChanSpy','appdata':util[_0xdfe9('0x7')](_0xdfe9('0x10'),_0x3fb452['name'],_0x5f3681['options']?_0x5f3681[_0xdfe9('0x11')][_0xdfe9('0x12')](''):''),'priority':_0x47f1d9++},_0x41f058));if(_0x5f3681[_0xdfe9('0x13')]){_0x4a8499[_0xdfe9('0x4')](_[_0xdfe9('0x5')]({'app':_0xdfe9('0x14'),'priority':_0x47f1d9++},_0x41f058));}return _0x4a8499;};var getChanSpyApplications=function(_0x4ad849,_0x24b662){var _0x2abd3b=[];for(var _0x286c69=0x0,_0x178a4a=0x1;_0x286c69<_0x24b662[_0xdfe9('0x15')];_0x286c69++,_0x178a4a=0x1){_0x2abd3b=_0x2abd3b[_0xdfe9('0x16')](getUserApplications(_0x4ad849,_0x24b662[_0x286c69],_0x24b662[_0x286c69][_0xdfe9('0x17')]));if(_0x24b662[_0x286c69][_0xdfe9('0x17')]!=_0x24b662[_0x286c69][_0xdfe9('0x18')]){_0x2abd3b=_0x2abd3b[_0xdfe9('0x16')](getUserApplications(_0x4ad849,_0x24b662[_0x286c69],_0x24b662[_0x286c69][_0xdfe9('0x18')]));}}return _0x2abd3b;};var getChanSpyPromise=function(_0x247f42,_0x12459a){return new BPromise(function(_0x319167,_0x130e67){return _0x247f42[_0xdfe9('0x19')][_0xdfe9('0x1a')]({'attributes':['id','name',_0xdfe9('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xdfe9('0x1b')](function(_0x376b67){if(_0x376b67){return _0x319167(getChanSpyApplications(_0x12459a,_0x376b67));}return _0x319167([]);})[_0xdfe9('0x1c')](function(_0x149a96){_0x130e67(_0x149a96);});});};module[_0xdfe9('0x1d')]=function(_0x13a264,_0x5a6bec){var _0x12f9b1=_0x13a264['models'];return _0x13a264[_0xdfe9('0x1e')](_0xdfe9('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x145a05,_0x23948b,_0x2a163d){return getChanSpyPromise(_0x12f9b1,_0x145a05)[_0xdfe9('0x1b')](function(_0xed4fa0){if(_0xed4fa0&&_0xed4fa0['length']){return _0x12f9b1[_0xdfe9('0x20')][_0xdfe9('0x21')](_0xed4fa0);}})[_0xdfe9('0x1b')](function(){_0x2a163d();})[_0xdfe9('0x1c')](function(_0x1d344d){_0x2a163d(_0x1d344d);});},'afterUpdate':function(_0x55a944,_0x4fc209,_0x2ac0d9){return _0x12f9b1[_0xdfe9('0x20')][_0xdfe9('0x22')]({'where':{'ChanSpyId':_0x55a944['id']}})[_0xdfe9('0x1b')](function(){return getChanSpyPromise(_0x12f9b1,_0x55a944);})[_0xdfe9('0x1b')](function(_0x1337c7){if(_0x1337c7&&_0x1337c7[_0xdfe9('0x15')]){return _0x12f9b1['VoiceExtension'][_0xdfe9('0x21')](_0x1337c7);}})[_0xdfe9('0x1b')](function(){_0x2ac0d9();})['catch'](function(_0x3f5bb9){_0x2ac0d9(_0x3f5bb9);});},'afterDestroy':function(_0x3df33e,_0x40fdf0,_0x5557a5){return _0x12f9b1[_0xdfe9('0x20')][_0xdfe9('0x22')]({'where':{'ChanSpyId':_0x3df33e['id']}})[_0xdfe9('0x1b')](function(){_0x5557a5();})['catch'](function(_0x2fa52c){_0x5557a5(_0x2fa52c);});}}});}; \ No newline at end of file +var _0x2c31=['%s%s','prefix','merge','CDR(type)=%s','chanspy','record','push','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','findAll','then','catch','models','define','VoiceChanSpy','voice_chanspy','length','destroy','VoiceExtension','bulkCreate','util','bluebird','./voiceChanSpy.attributes','from-sip','format'];(function(_0x2d2ae4,_0xfaf544){var _0x51fd7f=function(_0x6c7d9f){while(--_0x6c7d9f){_0x2d2ae4['push'](_0x2d2ae4['shift']());}};_0x51fd7f(++_0xfaf544);}(_0x2c31,0x10b));var _0x12c3=function(_0x4b4d51,_0x34d829){_0x4b4d51=_0x4b4d51-0x0;var _0x21467d=_0x2c31[_0x4b4d51];return _0x21467d;};'use strict';var _=require('lodash');var util=require(_0x12c3('0x0'));var BPromise=require(_0x12c3('0x1'));var attributes=require(_0x12c3('0x2'));var getUserApplications=function(_0x2bcddc,_0x55b297,_0x36e3d3){var _0x478bec=0x1;var _0x1dafaf=[];var _0x4b41bf={'context':_0x55b297['context']||_0x12c3('0x3'),'exten':util[_0x12c3('0x4')](_0x12c3('0x5'),_0x2bcddc[_0x12c3('0x6')],_0x36e3d3),'type':'system','isApp':![],'ChanSpyId':_0x2bcddc['id'],'UserId':_0x55b297['id']};_0x1dafaf['push'](_[_0x12c3('0x7')]({'app':'Set','appdata':util[_0x12c3('0x4')](_0x12c3('0x8'),_0x12c3('0x9')),'priority':_0x478bec++},_0x4b41bf));if(_0x2bcddc[_0x12c3('0xa')]){_0x1dafaf[_0x12c3('0xb')](_['merge']({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x2bcddc['recordingFormat']),'priority':_0x478bec++},_0x4b41bf));}if(_0x2bcddc[_0x12c3('0xc')]){_0x1dafaf[_0x12c3('0xb')](_[_0x12c3('0x7')]({'app':_0x12c3('0xd'),'appdata':_0x2bcddc['password'],'priority':_0x478bec++},_0x4b41bf));}_0x1dafaf[_0x12c3('0xb')](_[_0x12c3('0x7')]({'app':_0x12c3('0xe'),'appdata':util[_0x12c3('0x4')](_0x12c3('0xf'),_0x55b297[_0x12c3('0x10')],_0x2bcddc['options']?_0x2bcddc[_0x12c3('0x11')][_0x12c3('0x12')](''):''),'priority':_0x478bec++},_0x4b41bf));if(_0x2bcddc[_0x12c3('0xa')]){_0x1dafaf[_0x12c3('0xb')](_[_0x12c3('0x7')]({'app':_0x12c3('0x13'),'priority':_0x478bec++},_0x4b41bf));}return _0x1dafaf;};var getChanSpyApplications=function(_0x596f87,_0x443da1){var _0x4fcae8=[];for(var _0x340c46=0x0,_0x2cf95d=0x1;_0x340c46<_0x443da1['length'];_0x340c46++,_0x2cf95d=0x1){_0x4fcae8=_0x4fcae8[_0x12c3('0x14')](getUserApplications(_0x596f87,_0x443da1[_0x340c46],_0x443da1[_0x340c46][_0x12c3('0x15')]));if(_0x443da1[_0x340c46][_0x12c3('0x15')]!=_0x443da1[_0x340c46][_0x12c3('0x10')]){_0x4fcae8=_0x4fcae8['concat'](getUserApplications(_0x596f87,_0x443da1[_0x340c46],_0x443da1[_0x340c46]['name']));}}return _0x4fcae8;};var getChanSpyPromise=function(_0x2a6378,_0xcc515c){return new BPromise(function(_0x539e76,_0x45f6b0){return _0x2a6378[_0x12c3('0x16')][_0x12c3('0x17')]({'attributes':['id',_0x12c3('0x10'),_0x12c3('0x15')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x12c3('0x18')](function(_0x4ad762){if(_0x4ad762){return _0x539e76(getChanSpyApplications(_0xcc515c,_0x4ad762));}return _0x539e76([]);})[_0x12c3('0x19')](function(_0x45d920){_0x45f6b0(_0x45d920);});});};module['exports']=function(_0x297238,_0x42149b){var _0x24dd47=_0x297238[_0x12c3('0x1a')];return _0x297238[_0x12c3('0x1b')](_0x12c3('0x1c'),attributes,{'tableName':_0x12c3('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x352d75,_0x50304c,_0x3e6e33){return getChanSpyPromise(_0x24dd47,_0x352d75)[_0x12c3('0x18')](function(_0x178157){if(_0x178157&&_0x178157[_0x12c3('0x1e')]){return _0x24dd47['VoiceExtension']['bulkCreate'](_0x178157);}})[_0x12c3('0x18')](function(){_0x3e6e33();})[_0x12c3('0x19')](function(_0x568dba){_0x3e6e33(_0x568dba);});},'afterUpdate':function(_0x2d6fbf,_0x14dc4b,_0x39071e){return _0x24dd47['VoiceExtension'][_0x12c3('0x1f')]({'where':{'ChanSpyId':_0x2d6fbf['id']}})[_0x12c3('0x18')](function(){return getChanSpyPromise(_0x24dd47,_0x2d6fbf);})['then'](function(_0x2a4fcd){if(_0x2a4fcd&&_0x2a4fcd[_0x12c3('0x1e')]){return _0x24dd47[_0x12c3('0x20')][_0x12c3('0x21')](_0x2a4fcd);}})['then'](function(){_0x39071e();})['catch'](function(_0xf048c6){_0x39071e(_0xf048c6);});},'afterDestroy':function(_0x337ada,_0xe08c10,_0x27cf99){return _0x24dd47['VoiceExtension'][_0x12c3('0x1f')]({'where':{'ChanSpyId':_0x337ada['id']}})[_0x12c3('0x18')](function(){_0x27cf99();})[_0x12c3('0x19')](function(_0x5b8ca8){_0x27cf99(_0x5b8ca8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a020f4b..7236c9c 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 _0xb332=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xb332,0xd9));var _0x2b33=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0xb332[_0x14476b];return _0x24e2e8;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')][_0x2b33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461d44,_0x5a7a3f,_0x5ccf2d){return new BPromise(function(_0x4302b7,_0x5f29ab){return client[_0x2b33('0x9')](_0x461d44,_0x5ccf2d)[_0x2b33('0xa')](function(_0x2f2cb3){logger[_0x2b33('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a7a3f,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x5a7a3f,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2f2cb3));if(_0x2f2cb3[_0x2b33('0x10')]){if(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')](_0x2b33('0x12'),_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x5f29ab(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}logger[_0x2b33('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x4302b7(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}else{logger[_0x2b33('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a7a3f,'request\x20sent');_0x4302b7(_0x2f2cb3[_0x2b33('0x14')][_0x2b33('0x13')]);}})[_0x2b33('0x15')](function(_0x2f5119){logger[_0x2b33('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a7a3f,_0x2f5119);_0x5f29ab(_0x2f5119);});});} \ No newline at end of file +var _0xdb94=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x30bda2,_0x546b58){var _0x511033=function(_0x310827){while(--_0x310827){_0x30bda2['push'](_0x30bda2['shift']());}};_0x511033(++_0x546b58);}(_0xdb94,0xab));var _0x4db9=function(_0x4397cb,_0x3771ca){_0x4397cb=_0x4397cb-0x0;var _0x36faaf=_0xdb94[_0x4397cb];return _0x36faaf;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 96c4a77..3d193c3 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 _0x1863=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2b166c,_0x1c5974){var _0x63e30=function(_0x4c31a3){while(--_0x4c31a3){_0x2b166c['push'](_0x2b166c['shift']());}};_0x63e30(++_0x1c5974);}(_0x1863,0x1cb));var _0x3186=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x1863[_0x4907de];return _0x482054;};'use strict';var multer=require(_0x3186('0x0'));var util=require(_0x3186('0x1'));var path=require(_0x3186('0x2'));var timeout=require(_0x3186('0x3'));var express=require(_0x3186('0x4'));var router=express[_0x3186('0x5')]();var fs_extra=require(_0x3186('0x6'));var auth=require(_0x3186('0x7'));var interaction=require(_0x3186('0x8'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x3186('0x9')]('/',auth[_0x3186('0xa')](),controller['index']);router['get'](_0x3186('0xb'),auth['isAuthenticated'](),controller[_0x3186('0xc')]);router[_0x3186('0xd')]('/',auth['isAuthenticated'](),controller[_0x3186('0xe')]);router[_0x3186('0xf')](_0x3186('0xb'),auth[_0x3186('0xa')](),controller[_0x3186('0x10')]);router[_0x3186('0x11')]('/:id',auth[_0x3186('0xa')](),controller[_0x3186('0x12')]);module[_0x3186('0x13')]=router; \ No newline at end of file +var _0x15fb=['./voiceContext.controller','get','/:id','isAuthenticated','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x15fb,0xed));var _0xb15f=function(_0x3f2929,_0x2a0e1e){_0x3f2929=_0x3f2929-0x0;var _0x3ace4f=_0x15fb[_0x3f2929];return _0x3ace4f;};'use strict';var multer=require(_0xb15f('0x0'));var util=require(_0xb15f('0x1'));var path=require(_0xb15f('0x2'));var timeout=require(_0xb15f('0x3'));var express=require(_0xb15f('0x4'));var router=express[_0xb15f('0x5')]();var fs_extra=require(_0xb15f('0x6'));var auth=require(_0xb15f('0x7'));var interaction=require(_0xb15f('0x8'));var config=require(_0xb15f('0x9'));var controller=require(_0xb15f('0xa'));router[_0xb15f('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb15f('0xb')](_0xb15f('0xc'),auth[_0xb15f('0xd')](),controller['show']);router[_0xb15f('0xe')]('/',auth[_0xb15f('0xd')](),controller[_0xb15f('0xf')]);router['put'](_0xb15f('0xc'),auth['isAuthenticated'](),controller[_0xb15f('0x10')]);router[_0xb15f('0x11')](_0xb15f('0xc'),auth[_0xb15f('0xd')](),controller['destroy']);module[_0xb15f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index bc3b159..e026efc 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 _0xe9ff=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2fd873,_0x51262f){var _0x23e544=function(_0x107c74){while(--_0x107c74){_0x2fd873['push'](_0x2fd873['shift']());}};_0x23e544(++_0x51262f);}(_0xe9ff,0xc4));var _0xfe9f=function(_0x86f8aa,_0x4df6c9){_0x86f8aa=_0x86f8aa-0x0;var _0x105eea=_0xe9ff[_0x86f8aa];return _0x105eea;};'use strict';var Sequelize=require(_0xfe9f('0x0'));module[_0xfe9f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xfe9f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xfe9f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xea6b=['name'];(function(_0x301265,_0x413980){var _0x1db7e6=function(_0x324ca7){while(--_0x324ca7){_0x301265['push'](_0x301265['shift']());}};_0x1db7e6(++_0x413980);}(_0xea6b,0xc5));var _0xbea6=function(_0x2fc85a,_0x3c973e){_0x2fc85a=_0x2fc85a-0x0;var _0x11d760=_0xea6b[_0x2fc85a];return _0x11d760;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xbea6('0x0')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 e05935f..560ab68 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 _0xbbe3=['then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','json','limit','offset','count','set','Content-Range','reject','save','update','destroy','get','Contexts','end','sendStatus','stack','name','index','map','VoiceContext','rawAttributes','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','fields','includeAll','create','body','join','root','utf8','render','writeFileSync','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','readFileSync','Reload','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','request'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0xbbe3,0xaa));var _0x3bbe=function(_0x1bdfbf,_0x40ac71){_0x1bdfbf=_0x1bdfbf-0x0;var _0x4f89de=_0xbbe3[_0x1bdfbf];return _0x4f89de;};'use strict';var emlformat=require(_0x3bbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bbe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bbe('0x2'));var moment=require(_0x3bbe('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3bbe('0x4'));var path=require(_0x3bbe('0x5'));var sox=require(_0x3bbe('0x6'));var csv=require(_0x3bbe('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bbe('0x8'));var _=require(_0x3bbe('0x9'));var squel=require(_0x3bbe('0xa'));var crypto=require('crypto');var jsforce=require(_0x3bbe('0xb'));var deskjs=require(_0x3bbe('0xc'));var toCsv=require(_0x3bbe('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3bbe('0xd'));var qs=require(_0x3bbe('0xe'));var as=require(_0x3bbe('0xf'));var hardwareService=require(_0x3bbe('0x10'));var logger=require(_0x3bbe('0x11'))('api');var utils=require(_0x3bbe('0x12'));var config=require(_0x3bbe('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x3bbe('0x14'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xece659,_0x226b68,_0x73bd41,_0x1ae3ce){return new BPromise(function(_0x4f2943,_0x1b44aa){var _0x447976=_0x1ae3ce||client;return _0x447976[_0x3bbe('0x15')](_0xece659,_0x73bd41)[_0x3bbe('0x16')](function(_0x34aeca){logger['info'](_0x3bbe('0x17'),_0x226b68,_0x3bbe('0x18'));logger[_0x3bbe('0x19')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x226b68,_0x3bbe('0x18'),JSON[_0x3bbe('0x1a')](_0x34aeca));if(_0x34aeca[_0x3bbe('0x1b')]){if(_0x34aeca[_0x3bbe('0x1b')][_0x3bbe('0x1c')]===0x1f4){logger[_0x3bbe('0x1b')](_0x3bbe('0x17'),_0x226b68,_0x34aeca[_0x3bbe('0x1b')][_0x3bbe('0x1d')]);return _0x1b44aa(_0x34aeca[_0x3bbe('0x1b')][_0x3bbe('0x1d')]);}logger['error'](_0x3bbe('0x17'),_0x226b68,_0x34aeca['error'][_0x3bbe('0x1d')]);return _0x4f2943(_0x34aeca[_0x3bbe('0x1b')][_0x3bbe('0x1d')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x226b68,'request\x20sent');_0x4f2943(_0x34aeca[_0x3bbe('0x1e')][_0x3bbe('0x1d')]);}})['catch'](function(_0xe82483){logger[_0x3bbe('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x226b68,_0xe82483);_0x1b44aa(_0xe82483);});});}function respondWithStatusCode(_0x3786c8,_0x574aa5){_0x574aa5=_0x574aa5||0xcc;return function(_0x32edd1){if(_0x32edd1){return _0x3786c8['sendStatus'](_0x574aa5);}return _0x3786c8[_0x3bbe('0x1f')](_0x574aa5)['end']();};}function respondWithResult(_0x449de9,_0x4aade8){_0x4aade8=_0x4aade8||0xc8;return function(_0x4007ad){if(_0x4007ad){return _0x449de9[_0x3bbe('0x1f')](_0x4aade8)[_0x3bbe('0x20')](_0x4007ad);}};}function respondWithFilteredResult(_0x44fb09,_0x1f2043){return function(_0x56a41c){if(_0x56a41c){var _0x3d399a=typeof _0x1f2043['offset']==='undefined'&&typeof _0x1f2043[_0x3bbe('0x21')]==='undefined';var _0x46b5a2=_0x56a41c['count'];var _0x42d860=_0x3d399a?0x0:_0x1f2043[_0x3bbe('0x22')];var _0x5d6611=_0x3d399a?_0x56a41c[_0x3bbe('0x23')]:_0x1f2043[_0x3bbe('0x22')]+_0x1f2043[_0x3bbe('0x21')];var _0x58aa08;if(_0x5d6611>=_0x46b5a2){_0x5d6611=_0x46b5a2;_0x58aa08=0xc8;}else{_0x58aa08=0xce;}_0x44fb09[_0x3bbe('0x1f')](_0x58aa08);return _0x44fb09[_0x3bbe('0x24')](_0x3bbe('0x25'),_0x42d860+'-'+_0x5d6611+'/'+_0x46b5a2)['json'](_0x56a41c);}return null;};}function patchUpdates(_0x49f741){return function(_0x1d5092){try{jsonpatch['apply'](_0x1d5092,_0x49f741,!![]);}catch(_0x8a6f09){return BPromise[_0x3bbe('0x26')](_0x8a6f09);}return _0x1d5092[_0x3bbe('0x27')]();};}function saveUpdates(_0x44d78f,_0x12e339){return function(_0x544336){if(_0x544336){return _0x544336[_0x3bbe('0x28')](_0x44d78f)[_0x3bbe('0x16')](function(_0x47eea1){return _0x47eea1;});}return null;};}function removeEntity(_0xb64dbe,_0x3842a6){return function(_0x1afd41){if(_0x1afd41){return _0x1afd41[_0x3bbe('0x29')]()[_0x3bbe('0x16')](function(){var _0x5bc1da=_0x1afd41[_0x3bbe('0x2a')]({'plain':!![]});var _0x32c12f=_0x3bbe('0x2b');return db['UserProfileResource'][_0x3bbe('0x29')]({'where':{'type':_0x32c12f,'resourceId':_0x5bc1da['id']}})[_0x3bbe('0x16')](function(){return _0x1afd41;});})[_0x3bbe('0x16')](function(){_0xb64dbe[_0x3bbe('0x1f')](0xcc)[_0x3bbe('0x2c')]();});}};}function handleEntityNotFound(_0x28d4f3,_0x39e7c4){return function(_0x3c723f){if(!_0x3c723f){_0x28d4f3[_0x3bbe('0x2d')](0x194);}return _0x3c723f;};}function handleError(_0x456d03,_0x11587e){_0x11587e=_0x11587e||0x1f4;return function(_0x371f18){logger[_0x3bbe('0x1b')](_0x371f18[_0x3bbe('0x2e')]);if(_0x371f18[_0x3bbe('0x2f')]){delete _0x371f18['name'];}_0x456d03[_0x3bbe('0x1f')](_0x11587e)['send'](_0x371f18);};}exports[_0x3bbe('0x30')]=function(_0x2c242d,_0xbb3ecd){var _0x13a116={},_0x449bc7={},_0x5ef014={'count':0x0,'rows':[]};var _0x4a05c3=_[_0x3bbe('0x31')](db[_0x3bbe('0x32')][_0x3bbe('0x33')],function(_0x1fd25c){return{'name':_0x1fd25c['fieldName'],'type':_0x1fd25c['type']['key']};});_0x449bc7[_0x3bbe('0x34')]=_[_0x3bbe('0x31')](_0x4a05c3,_0x3bbe('0x2f'));_0x449bc7[_0x3bbe('0x35')]=_[_0x3bbe('0x36')](_0x2c242d[_0x3bbe('0x35')]);_0x449bc7['filters']=_[_0x3bbe('0x37')](_0x449bc7[_0x3bbe('0x34')],_0x449bc7[_0x3bbe('0x35')]);_0x13a116['attributes']=_['intersection'](_0x449bc7[_0x3bbe('0x34')],qs['fields'](_0x2c242d['query']['fields']));_0x13a116[_0x3bbe('0x38')]=_0x13a116['attributes'][_0x3bbe('0x39')]?_0x13a116['attributes']:_0x449bc7[_0x3bbe('0x34')];if(!_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x3a')]('nolimit')){_0x13a116[_0x3bbe('0x21')]=qs[_0x3bbe('0x21')](_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x21')]);_0x13a116[_0x3bbe('0x22')]=qs[_0x3bbe('0x22')](_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x22')]);}_0x13a116[_0x3bbe('0x3b')]=qs[_0x3bbe('0x3c')](_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x3c')]);_0x13a116[_0x3bbe('0x3d')]=qs[_0x3bbe('0x3e')](_[_0x3bbe('0x3f')](_0x2c242d[_0x3bbe('0x35')],_0x449bc7[_0x3bbe('0x3e')]),_0x4a05c3);if(_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x40')]){_0x13a116[_0x3bbe('0x3d')]=_[_0x3bbe('0x41')](_0x13a116[_0x3bbe('0x3d')],{'$or':_[_0x3bbe('0x31')](_0x4a05c3,function(_0x166d8c){if(_0x166d8c[_0x3bbe('0x42')]!==_0x3bbe('0x43')){var _0x182261={};_0x182261[_0x166d8c[_0x3bbe('0x2f')]]={'$like':'%'+_0x2c242d[_0x3bbe('0x35')][_0x3bbe('0x40')]+'%'};return _0x182261;}})});}_0x13a116=_[_0x3bbe('0x41')]({},_0x13a116,_0x2c242d[_0x3bbe('0x44')]);var _0xf44a33={'where':_0x13a116[_0x3bbe('0x3d')]};return db[_0x3bbe('0x32')]['count'](_0xf44a33)['then'](function(_0x5b326e){_0x5ef014[_0x3bbe('0x23')]=_0x5b326e;if(_0x2c242d[_0x3bbe('0x35')]['includeAll']){_0x13a116['include']=[{'all':!![]}];}return db[_0x3bbe('0x32')][_0x3bbe('0x45')](_0x13a116);})[_0x3bbe('0x16')](function(_0x1a30cd){_0x5ef014['rows']=_0x1a30cd;return _0x5ef014;})['then'](respondWithFilteredResult(_0xbb3ecd,_0x13a116))[_0x3bbe('0x46')](handleError(_0xbb3ecd,null));};exports[_0x3bbe('0x47')]=function(_0x403d72,_0x2c3b62){var _0x40bd09={'raw':![],'where':{'id':_0x403d72[_0x3bbe('0x48')]['id']}},_0x26a121={};_0x26a121[_0x3bbe('0x34')]=_[_0x3bbe('0x36')](db[_0x3bbe('0x32')][_0x3bbe('0x33')]);_0x26a121[_0x3bbe('0x35')]=_[_0x3bbe('0x36')](_0x403d72[_0x3bbe('0x35')]);_0x26a121[_0x3bbe('0x3e')]=_[_0x3bbe('0x37')](_0x26a121[_0x3bbe('0x34')],_0x26a121[_0x3bbe('0x35')]);_0x40bd09[_0x3bbe('0x38')]=_[_0x3bbe('0x37')](_0x26a121[_0x3bbe('0x34')],qs[_0x3bbe('0x49')](_0x403d72[_0x3bbe('0x35')]['fields']));_0x40bd09[_0x3bbe('0x38')]=_0x40bd09['attributes'][_0x3bbe('0x39')]?_0x40bd09[_0x3bbe('0x38')]:_0x26a121[_0x3bbe('0x34')];if(_0x403d72[_0x3bbe('0x35')][_0x3bbe('0x4a')]){_0x40bd09['include']=[{'all':!![]}];}_0x40bd09=_['merge']({},_0x40bd09,_0x403d72['options']);return db['VoiceContext']['find'](_0x40bd09)[_0x3bbe('0x16')](handleEntityNotFound(_0x2c3b62,null))['then'](respondWithResult(_0x2c3b62,null))[_0x3bbe('0x46')](handleError(_0x2c3b62,null));};exports[_0x3bbe('0x4b')]=function(_0xee8001,_0x5bc5be,_0x9d4495){var _0x3a7c38;return db[_0x3bbe('0x32')][_0x3bbe('0x4b')](_0xee8001[_0x3bbe('0x4c')],{'raw':!![]})[_0x3bbe('0x16')](function(_0x51c24b){_0x3a7c38=_0x51c24b;return db['VoiceContext'][_0x3bbe('0x45')]({'raw':!![]});})[_0x3bbe('0x16')](function(_0x4a2d5f){var _0x42e5a9=fs['readFileSync'](path[_0x3bbe('0x4d')](config[_0x3bbe('0x4e')],'server/files/templates/context.ejs'),_0x3bbe('0x4f'));var _0x3247ab=ejs[_0x3bbe('0x50')](_0x42e5a9,{'contexts':_0x4a2d5f||[]});fs[_0x3bbe('0x51')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3247ab);})[_0x3bbe('0x16')](function(){return respondWithRpcPromise('Reload','create',{'module':_0x3bbe('0x52')});})[_0x3bbe('0x16')](function(){var _0xe0ac3a=_0xee8001[_0x3bbe('0x53')]['get']({'plain':!![]});if(!_0xe0ac3a)throw new Error(_0x3bbe('0x54'));if(_0xe0ac3a[_0x3bbe('0x55')]===_0x3bbe('0x53')){var _0x57017e=_0x3a7c38[_0x3bbe('0x2a')]({'plain':!![]});return db[_0x3bbe('0x56')][_0x3bbe('0x57')]({'where':{'name':_0x3bbe('0x2b'),'userProfileId':_0xe0ac3a[_0x3bbe('0x58')]},'raw':!![]})[_0x3bbe('0x16')](function(_0x385530){if(_0x385530&&_0x385530[_0x3bbe('0x59')]===0x0){return db[_0x3bbe('0x5a')][_0x3bbe('0x4b')]({'name':_0x57017e[_0x3bbe('0x2f')],'resourceId':_0x57017e['id'],'type':_0x385530[_0x3bbe('0x2f')],'sectionId':_0x385530['id']},{})[_0x3bbe('0x16')](function(){return _0x3a7c38;});}else{return _0x3a7c38;}})[_0x3bbe('0x46')](function(_0x54021c){logger[_0x3bbe('0x1b')](_0x3bbe('0x5b'),_0x54021c);throw _0x54021c;});}return _0x3a7c38;})['then'](respondWithResult(_0x5bc5be,0xc9))[_0x3bbe('0x46')](handleError(_0x5bc5be,null));};exports[_0x3bbe('0x28')]=function(_0x223a07,_0x47cc36,_0x43207b){var _0x1fc574;return db[_0x3bbe('0x32')][_0x3bbe('0x57')]({'where':{'id':_0x223a07['params']['id']}})['then'](handleEntityNotFound(_0x47cc36,null))[_0x3bbe('0x16')](saveUpdates(_0x223a07['body'],null))['then'](function(_0x2458fc){if(_0x2458fc){_0x1fc574=_0x2458fc;return db[_0x3bbe('0x32')][_0x3bbe('0x45')]({'raw':!![]});}})['then'](function(_0x322411){var _0x3bdb52=fs['readFileSync'](path[_0x3bbe('0x4d')](config[_0x3bbe('0x4e')],_0x3bbe('0x5c')),_0x3bbe('0x4f'));var _0x55fe32=ejs[_0x3bbe('0x50')](_0x3bdb52,{'contexts':_0x322411||[]});fs[_0x3bbe('0x51')](_0x3bbe('0x5d'),_0x55fe32);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x3bbe('0x52')});})[_0x3bbe('0x16')](function(){return _0x1fc574;})[_0x3bbe('0x16')](respondWithResult(_0x47cc36,null))['catch'](handleError(_0x47cc36,null));};exports[_0x3bbe('0x29')]=function(_0x5ed536,_0x4dd71c,_0x171be0){var _0x5185bc;return db[_0x3bbe('0x32')][_0x3bbe('0x57')]({'where':{'id':_0x5ed536[_0x3bbe('0x48')]['id']}})[_0x3bbe('0x16')](handleEntityNotFound(_0x4dd71c,null))[_0x3bbe('0x16')](removeEntity(_0x4dd71c,null))[_0x3bbe('0x16')](function(){return db['VoiceContext'][_0x3bbe('0x45')]({'raw':!![]});})[_0x3bbe('0x16')](function(_0x3c402f){var _0x4bc4e3=fs[_0x3bbe('0x5e')](path[_0x3bbe('0x4d')](config['root'],_0x3bbe('0x5c')),'utf8');var _0x2965d6=ejs[_0x3bbe('0x50')](_0x4bc4e3,{'contexts':_0x3c402f});fs['writeFileSync'](_0x3bbe('0x5d'),_0x2965d6);return respondWithRpcPromise(_0x3bbe('0x5f'),_0x3bbe('0x29'),{'module':_0x3bbe('0x52')});})[_0x3bbe('0x46')](handleError(_0x4dd71c,null));}; \ No newline at end of file +var _0x3936=['send','index','map','VoiceContext','rawAttributes','fieldName','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','rows','params','includeAll','create','body','findAll','readFileSync','join','root','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','utf8','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','stack'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3936,0x117));var _0x6393=function(_0x1d6960,_0x11a48a){_0x1d6960=_0x1d6960-0x0;var _0x278934=_0x3936[_0x1d6960];return _0x278934;};'use strict';var emlformat=require(_0x6393('0x0'));var rimraf=require(_0x6393('0x1'));var zipdir=require(_0x6393('0x2'));var jsonpatch=require(_0x6393('0x3'));var rp=require(_0x6393('0x4'));var moment=require(_0x6393('0x5'));var BPromise=require(_0x6393('0x6'));var Mustache=require(_0x6393('0x7'));var util=require('util');var path=require(_0x6393('0x8'));var sox=require(_0x6393('0x9'));var csv=require(_0x6393('0xa'));var ejs=require(_0x6393('0xb'));var fs=require('fs');var fs_extra=require(_0x6393('0xc'));var _=require(_0x6393('0xd'));var squel=require(_0x6393('0xe'));var crypto=require(_0x6393('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6393('0xa'));var querystring=require(_0x6393('0x10'));var Papa=require(_0x6393('0x11'));var Redis=require(_0x6393('0x12'));var authService=require(_0x6393('0x13'));var qs=require(_0x6393('0x14'));var as=require(_0x6393('0x15'));var hardwareService=require(_0x6393('0x16'));var logger=require('../../config/logger')(_0x6393('0x17'));var utils=require(_0x6393('0x18'));var config=require(_0x6393('0x19'));var licenseUtil=require(_0x6393('0x1a'));var db=require(_0x6393('0x1b'))['db'];var jayson=require(_0x6393('0x1c'));var client=jayson[_0x6393('0x1d')][_0x6393('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x20745e,_0x1c6b1b,_0x547347,_0x1802a4){return new BPromise(function(_0x1662b6,_0x30911a){var _0x3b0fce=_0x1802a4||client;return _0x3b0fce[_0x6393('0x1f')](_0x20745e,_0x547347)[_0x6393('0x20')](function(_0x38783b){logger[_0x6393('0x21')](_0x6393('0x22'),_0x1c6b1b,_0x6393('0x23'));logger['debug'](_0x6393('0x24'),_0x1c6b1b,_0x6393('0x23'),JSON[_0x6393('0x25')](_0x38783b));if(_0x38783b[_0x6393('0x26')]){if(_0x38783b['error'][_0x6393('0x27')]===0x1f4){logger[_0x6393('0x26')](_0x6393('0x22'),_0x1c6b1b,_0x38783b['error'][_0x6393('0x28')]);return _0x30911a(_0x38783b[_0x6393('0x26')][_0x6393('0x28')]);}logger[_0x6393('0x26')](_0x6393('0x22'),_0x1c6b1b,_0x38783b[_0x6393('0x26')][_0x6393('0x28')]);return _0x1662b6(_0x38783b[_0x6393('0x26')][_0x6393('0x28')]);}else{logger[_0x6393('0x21')]('VoiceContext,\x20%s,\x20%s',_0x1c6b1b,'request\x20sent');_0x1662b6(_0x38783b[_0x6393('0x29')][_0x6393('0x28')]);}})[_0x6393('0x2a')](function(_0x4f0101){logger[_0x6393('0x26')](_0x6393('0x22'),_0x1c6b1b,_0x4f0101);_0x30911a(_0x4f0101);});});}function respondWithStatusCode(_0x2e726a,_0x3db5e3){_0x3db5e3=_0x3db5e3||0xcc;return function(_0x4487d0){if(_0x4487d0){return _0x2e726a[_0x6393('0x2b')](_0x3db5e3);}return _0x2e726a[_0x6393('0x2c')](_0x3db5e3)[_0x6393('0x2d')]();};}function respondWithResult(_0x410abf,_0x43213c){_0x43213c=_0x43213c||0xc8;return function(_0x1ed69c){if(_0x1ed69c){return _0x410abf[_0x6393('0x2c')](_0x43213c)[_0x6393('0x2e')](_0x1ed69c);}};}function respondWithFilteredResult(_0x420934,_0x251f3c){return function(_0x427dfc){if(_0x427dfc){var _0xcabda4=typeof _0x251f3c['offset']==='undefined'&&typeof _0x251f3c['limit']===_0x6393('0x2f');var _0x416a2b=_0x427dfc[_0x6393('0x30')];var _0x185ea5=_0xcabda4?0x0:_0x251f3c[_0x6393('0x31')];var _0x3fc002=_0xcabda4?_0x427dfc['count']:_0x251f3c[_0x6393('0x31')]+_0x251f3c['limit'];var _0x22a536;if(_0x3fc002>=_0x416a2b){_0x3fc002=_0x416a2b;_0x22a536=0xc8;}else{_0x22a536=0xce;}_0x420934[_0x6393('0x2c')](_0x22a536);return _0x420934[_0x6393('0x32')](_0x6393('0x33'),_0x185ea5+'-'+_0x3fc002+'/'+_0x416a2b)[_0x6393('0x2e')](_0x427dfc);}return null;};}function patchUpdates(_0x55123c){return function(_0x37b5a9){try{jsonpatch[_0x6393('0x34')](_0x37b5a9,_0x55123c,!![]);}catch(_0x56d5ca){return BPromise[_0x6393('0x35')](_0x56d5ca);}return _0x37b5a9[_0x6393('0x36')]();};}function saveUpdates(_0xf5dbee,_0x210203){return function(_0x52cd90){if(_0x52cd90){return _0x52cd90[_0x6393('0x37')](_0xf5dbee)[_0x6393('0x20')](function(_0x15ed28){return _0x15ed28;});}return null;};}function removeEntity(_0x10b70d,_0x516429){return function(_0x21027d){if(_0x21027d){return _0x21027d[_0x6393('0x38')]()[_0x6393('0x20')](function(){var _0x3e7f1e=_0x21027d[_0x6393('0x39')]({'plain':!![]});var _0x22dcda=_0x6393('0x3a');return db['UserProfileResource'][_0x6393('0x38')]({'where':{'type':_0x22dcda,'resourceId':_0x3e7f1e['id']}})['then'](function(){return _0x21027d;});})[_0x6393('0x20')](function(){_0x10b70d[_0x6393('0x2c')](0xcc)[_0x6393('0x2d')]();});}};}function handleEntityNotFound(_0xc1f33,_0x3f9de6){return function(_0x5b634a){if(!_0x5b634a){_0xc1f33[_0x6393('0x2b')](0x194);}return _0x5b634a;};}function handleError(_0x170726,_0x3d47cb){_0x3d47cb=_0x3d47cb||0x1f4;return function(_0x29e9d7){logger[_0x6393('0x26')](_0x29e9d7[_0x6393('0x3b')]);if(_0x29e9d7['name']){delete _0x29e9d7['name'];}_0x170726['status'](_0x3d47cb)[_0x6393('0x3c')](_0x29e9d7);};}exports[_0x6393('0x3d')]=function(_0x5c04fb,_0xe6ef6f){var _0x1112be={},_0x264447={},_0x482cf9={'count':0x0,'rows':[]};var _0x1269f0=_[_0x6393('0x3e')](db[_0x6393('0x3f')][_0x6393('0x40')],function(_0x26727d){return{'name':_0x26727d[_0x6393('0x41')],'type':_0x26727d['type'][_0x6393('0x42')]};});_0x264447['model']=_[_0x6393('0x3e')](_0x1269f0,_0x6393('0x43'));_0x264447[_0x6393('0x44')]=_[_0x6393('0x45')](_0x5c04fb['query']);_0x264447['filters']=_[_0x6393('0x46')](_0x264447[_0x6393('0x47')],_0x264447[_0x6393('0x44')]);_0x1112be[_0x6393('0x48')]=_[_0x6393('0x46')](_0x264447[_0x6393('0x47')],qs[_0x6393('0x49')](_0x5c04fb[_0x6393('0x44')][_0x6393('0x49')]));_0x1112be['attributes']=_0x1112be[_0x6393('0x48')][_0x6393('0x4a')]?_0x1112be[_0x6393('0x48')]:_0x264447[_0x6393('0x47')];if(!_0x5c04fb[_0x6393('0x44')][_0x6393('0x4b')](_0x6393('0x4c'))){_0x1112be[_0x6393('0x4d')]=qs[_0x6393('0x4d')](_0x5c04fb['query'][_0x6393('0x4d')]);_0x1112be[_0x6393('0x31')]=qs[_0x6393('0x31')](_0x5c04fb[_0x6393('0x44')][_0x6393('0x31')]);}_0x1112be[_0x6393('0x4e')]=qs[_0x6393('0x4f')](_0x5c04fb[_0x6393('0x44')][_0x6393('0x4f')]);_0x1112be[_0x6393('0x50')]=qs[_0x6393('0x51')](_[_0x6393('0x52')](_0x5c04fb[_0x6393('0x44')],_0x264447[_0x6393('0x51')]),_0x1269f0);if(_0x5c04fb['query']['filter']){_0x1112be[_0x6393('0x50')]=_[_0x6393('0x53')](_0x1112be[_0x6393('0x50')],{'$or':_[_0x6393('0x3e')](_0x1269f0,function(_0x179747){if(_0x179747[_0x6393('0x54')]!==_0x6393('0x55')){var _0x217884={};_0x217884[_0x179747['name']]={'$like':'%'+_0x5c04fb[_0x6393('0x44')][_0x6393('0x56')]+'%'};return _0x217884;}})});}_0x1112be=_[_0x6393('0x53')]({},_0x1112be,_0x5c04fb[_0x6393('0x57')]);var _0x53c49b={'where':_0x1112be[_0x6393('0x50')]};return db[_0x6393('0x3f')][_0x6393('0x30')](_0x53c49b)[_0x6393('0x20')](function(_0x43e317){_0x482cf9['count']=_0x43e317;if(_0x5c04fb[_0x6393('0x44')]['includeAll']){_0x1112be[_0x6393('0x58')]=[{'all':!![]}];}return db[_0x6393('0x3f')]['findAll'](_0x1112be);})[_0x6393('0x20')](function(_0x3290e0){_0x482cf9[_0x6393('0x59')]=_0x3290e0;return _0x482cf9;})[_0x6393('0x20')](respondWithFilteredResult(_0xe6ef6f,_0x1112be))[_0x6393('0x2a')](handleError(_0xe6ef6f,null));};exports['show']=function(_0x3c8c13,_0xf7ffdd){var _0x202251={'raw':![],'where':{'id':_0x3c8c13[_0x6393('0x5a')]['id']}},_0x47fd00={};_0x47fd00[_0x6393('0x47')]=_[_0x6393('0x45')](db['VoiceContext'][_0x6393('0x40')]);_0x47fd00[_0x6393('0x44')]=_[_0x6393('0x45')](_0x3c8c13['query']);_0x47fd00[_0x6393('0x51')]=_[_0x6393('0x46')](_0x47fd00[_0x6393('0x47')],_0x47fd00[_0x6393('0x44')]);_0x202251[_0x6393('0x48')]=_[_0x6393('0x46')](_0x47fd00['model'],qs['fields'](_0x3c8c13[_0x6393('0x44')]['fields']));_0x202251['attributes']=_0x202251[_0x6393('0x48')][_0x6393('0x4a')]?_0x202251[_0x6393('0x48')]:_0x47fd00[_0x6393('0x47')];if(_0x3c8c13[_0x6393('0x44')][_0x6393('0x5b')]){_0x202251[_0x6393('0x58')]=[{'all':!![]}];}_0x202251=_['merge']({},_0x202251,_0x3c8c13[_0x6393('0x57')]);return db[_0x6393('0x3f')]['find'](_0x202251)[_0x6393('0x20')](handleEntityNotFound(_0xf7ffdd,null))[_0x6393('0x20')](respondWithResult(_0xf7ffdd,null))[_0x6393('0x2a')](handleError(_0xf7ffdd,null));};exports[_0x6393('0x5c')]=function(_0x1cf98d,_0x5c0f1d,_0x1e4df4){var _0x45b7ea;return db[_0x6393('0x3f')][_0x6393('0x5c')](_0x1cf98d[_0x6393('0x5d')],{'raw':!![]})['then'](function(_0x2e6f4b){_0x45b7ea=_0x2e6f4b;return db['VoiceContext'][_0x6393('0x5e')]({'raw':!![]});})[_0x6393('0x20')](function(_0x5e8e3d){var _0x3cfabd=fs[_0x6393('0x5f')](path[_0x6393('0x60')](config[_0x6393('0x61')],'server/files/templates/context.ejs'),'utf8');var _0xd5874c=ejs[_0x6393('0x62')](_0x3cfabd,{'contexts':_0x5e8e3d||[]});fs[_0x6393('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xd5874c);})['then'](function(){return respondWithRpcPromise(_0x6393('0x64'),'create',{'module':_0x6393('0x65')});})['then'](function(){var _0x34cb9f=_0x1cf98d['user'][_0x6393('0x39')]({'plain':!![]});if(!_0x34cb9f)throw new Error(_0x6393('0x66'));if(_0x34cb9f[_0x6393('0x67')]===_0x6393('0x68')){var _0x5b2312=_0x45b7ea[_0x6393('0x39')]({'plain':!![]});return db[_0x6393('0x69')][_0x6393('0x6a')]({'where':{'name':'Contexts','userProfileId':_0x34cb9f[_0x6393('0x6b')]},'raw':!![]})[_0x6393('0x20')](function(_0x16f6d3){if(_0x16f6d3&&_0x16f6d3[_0x6393('0x6c')]===0x0){return db['UserProfileResource'][_0x6393('0x5c')]({'name':_0x5b2312[_0x6393('0x43')],'resourceId':_0x5b2312['id'],'type':_0x16f6d3[_0x6393('0x43')],'sectionId':_0x16f6d3['id']},{})['then'](function(){return _0x45b7ea;});}else{return _0x45b7ea;}})[_0x6393('0x2a')](function(_0x1d6be7){logger[_0x6393('0x26')](_0x6393('0x6d'),_0x1d6be7);throw _0x1d6be7;});}return _0x45b7ea;})[_0x6393('0x20')](respondWithResult(_0x5c0f1d,0xc9))[_0x6393('0x2a')](handleError(_0x5c0f1d,null));};exports[_0x6393('0x37')]=function(_0x5ed414,_0x195a82,_0x5c52d2){var _0x49aaa7;return db[_0x6393('0x3f')][_0x6393('0x6a')]({'where':{'id':_0x5ed414[_0x6393('0x5a')]['id']}})[_0x6393('0x20')](handleEntityNotFound(_0x195a82,null))[_0x6393('0x20')](saveUpdates(_0x5ed414[_0x6393('0x5d')],null))['then'](function(_0x15574a){if(_0x15574a){_0x49aaa7=_0x15574a;return db[_0x6393('0x3f')][_0x6393('0x5e')]({'raw':!![]});}})[_0x6393('0x20')](function(_0x3c30a2){var _0x38b4ef=fs[_0x6393('0x5f')](path['join'](config['root'],_0x6393('0x6e')),'utf8');var _0x4126cb=ejs['render'](_0x38b4ef,{'contexts':_0x3c30a2||[]});fs[_0x6393('0x63')](_0x6393('0x6f'),_0x4126cb);})[_0x6393('0x20')](function(){return respondWithRpcPromise(_0x6393('0x64'),'update',{'module':'chan_sip.so'});})[_0x6393('0x20')](function(){return _0x49aaa7;})['then'](respondWithResult(_0x195a82,null))[_0x6393('0x2a')](handleError(_0x195a82,null));};exports['destroy']=function(_0x2ae9fe,_0x2a6c30,_0x781393){var _0x5ca122;return db[_0x6393('0x3f')][_0x6393('0x6a')]({'where':{'id':_0x2ae9fe[_0x6393('0x5a')]['id']}})[_0x6393('0x20')](handleEntityNotFound(_0x2a6c30,null))[_0x6393('0x20')](removeEntity(_0x2a6c30,null))[_0x6393('0x20')](function(){return db[_0x6393('0x3f')][_0x6393('0x5e')]({'raw':!![]});})['then'](function(_0x9bb5e5){var _0x94ce85=fs['readFileSync'](path['join'](config['root'],_0x6393('0x6e')),_0x6393('0x70'));var _0x717ed6=ejs[_0x6393('0x62')](_0x94ce85,{'contexts':_0x9bb5e5});fs[_0x6393('0x63')](_0x6393('0x6f'),_0x717ed6);return respondWithRpcPromise('Reload',_0x6393('0x38'),{'module':_0x6393('0x65')});})[_0x6393('0x2a')](handleError(_0x2a6c30,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c4fd9e4..8f7dd58 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 _0x3af7=['VoiceContext','voice_contexts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3af7,0x1a6));var _0x73af=function(_0x26ef14,_0x54606f){_0x26ef14=_0x26ef14-0x0;var _0x209847=_0x3af7[_0x26ef14];return _0x209847;};'use strict';var _=require(_0x73af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x73af('0x1'));var moment=require(_0x73af('0x2'));var BPromise=require(_0x73af('0x3'));var rp=require(_0x73af('0x4'));var fs=require('fs');var path=require(_0x73af('0x5'));var rimraf=require(_0x73af('0x6'));var config=require(_0x73af('0x7'));var attributes=require(_0x73af('0x8'));module['exports']=function(_0x3bfa8f,_0x38ed8b){return _0x3bfa8f[_0x73af('0x9')](_0x73af('0xa'),attributes,{'tableName':_0x73af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa72f=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4bd8ec,_0x114640){var _0x50b294=function(_0x5dc6f0){while(--_0x5dc6f0){_0x4bd8ec['push'](_0x4bd8ec['shift']());}};_0x50b294(++_0x114640);}(_0xa72f,0x116));var _0xfa72=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xa72f[_0x101802];return _0x5d61ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa72('0x0'))(_0xfa72('0x1'));var moment=require(_0xfa72('0x2'));var BPromise=require(_0xfa72('0x3'));var rp=require(_0xfa72('0x4'));var fs=require('fs');var path=require(_0xfa72('0x5'));var rimraf=require(_0xfa72('0x6'));var config=require(_0xfa72('0x7'));var attributes=require(_0xfa72('0x8'));module[_0xfa72('0x9')]=function(_0x37e22b,_0x597660){return _0x37e22b[_0xfa72('0xa')](_0xfa72('0xb'),attributes,{'tableName':_0xfa72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index d5db003..9ddf8ea 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 _0x9a2a=['request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x117ff6,_0x49a8c6){var _0x5d2565=function(_0x4f8e16){while(--_0x4f8e16){_0x117ff6['push'](_0x117ff6['shift']());}};_0x5d2565(++_0x49a8c6);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x272a88,_0x57e586){_0x272a88=_0x272a88-0x0;var _0x5c71c4=_0x9a2a[_0x272a88];return _0x5c71c4;};'use strict';var _=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var moment=require(_0xa9a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a2('0x3'))['db'];var utils=require(_0xa9a2('0x4'));var logger=require(_0xa9a2('0x5'))(_0xa9a2('0x6'));var config=require(_0xa9a2('0x7'));var jayson=require(_0xa9a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x388689,_0xb51739,_0xedae90){return new BPromise(function(_0x287343,_0xcd2750){return client[_0xa9a2('0x9')](_0x388689,_0xedae90)[_0xa9a2('0xa')](function(_0x26f1ce){logger[_0xa9a2('0xb')]('VoiceContext,\x20%s,\x20%s',_0xb51739,_0xa9a2('0xc'));logger[_0xa9a2('0xd')](_0xa9a2('0xe'),_0xb51739,_0xa9a2('0xc'),JSON[_0xa9a2('0xf')](_0x26f1ce));if(_0x26f1ce[_0xa9a2('0x10')]){if(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x11')]===0x1f4){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce['error'][_0xa9a2('0x13')]);return _0xcd2750(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);return _0x287343(_0x26f1ce[_0xa9a2('0x10')][_0xa9a2('0x13')]);}else{logger[_0xa9a2('0xb')](_0xa9a2('0x12'),_0xb51739,_0xa9a2('0xc'));_0x287343(_0x26f1ce[_0xa9a2('0x14')]['message']);}})[_0xa9a2('0x15')](function(_0xbb6546){logger[_0xa9a2('0x10')](_0xa9a2('0x12'),_0xb51739,_0xbb6546);_0xcd2750(_0xbb6546);});});} \ No newline at end of file +var _0x2c1b=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x368992,_0x3d8d56){var _0xd95310=function(_0x76f3c1){while(--_0x76f3c1){_0x368992['push'](_0x368992['shift']());}};_0xd95310(++_0x3d8d56);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x2c1b[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0xb2c1('0x0'));var util=require(_0xb2c1('0x1'));var moment=require(_0xb2c1('0x2'));var BPromise=require(_0xb2c1('0x3'));var rs=require(_0xb2c1('0x4'));var fs=require('fs');var Redis=require(_0xb2c1('0x5'));var db=require(_0xb2c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2c1('0x7'))(_0xb2c1('0x8'));var config=require(_0xb2c1('0x9'));var jayson=require(_0xb2c1('0xa'));var client=jayson[_0xb2c1('0xb')][_0xb2c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37214d,_0x42308a,_0x25c22f){return new BPromise(function(_0x390ba2,_0x5987f0){return client['request'](_0x37214d,_0x25c22f)[_0xb2c1('0xd')](function(_0x1445f8){logger[_0xb2c1('0xe')](_0xb2c1('0xf'),_0x42308a,_0xb2c1('0x10'));logger[_0xb2c1('0x11')](_0xb2c1('0x12'),_0x42308a,_0xb2c1('0x10'),JSON['stringify'](_0x1445f8));if(_0x1445f8[_0xb2c1('0x13')]){if(_0x1445f8[_0xb2c1('0x13')][_0xb2c1('0x14')]===0x1f4){logger[_0xb2c1('0x13')](_0xb2c1('0xf'),_0x42308a,_0x1445f8['error'][_0xb2c1('0x15')]);return _0x5987f0(_0x1445f8[_0xb2c1('0x13')][_0xb2c1('0x15')]);}logger['error'](_0xb2c1('0xf'),_0x42308a,_0x1445f8[_0xb2c1('0x13')][_0xb2c1('0x15')]);return _0x390ba2(_0x1445f8[_0xb2c1('0x13')][_0xb2c1('0x15')]);}else{logger[_0xb2c1('0xe')](_0xb2c1('0xf'),_0x42308a,_0xb2c1('0x10'));_0x390ba2(_0x1445f8[_0xb2c1('0x16')]['message']);}})[_0xb2c1('0x17')](function(_0x4ad428){logger['error']('VoiceContext,\x20%s,\x20%s',_0x42308a,_0x4ad428);_0x5987f0(_0x4ad428);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 43ae5ae..c6c6467 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 _0xb9fd=['../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x493670,_0x45d9cf){var _0x331252=function(_0xadbba4){while(--_0xadbba4){_0x493670['push'](_0x493670['shift']());}};_0x331252(++_0x45d9cf);}(_0xb9fd,0x149));var _0xdb9f=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xb9fd[_0x16dbfd];return _0x382254;};'use strict';var multer=require(_0xdb9f('0x0'));var util=require(_0xdb9f('0x1'));var path=require('path');var timeout=require(_0xdb9f('0x2'));var express=require(_0xdb9f('0x3'));var router=express[_0xdb9f('0x4')]();var fs_extra=require(_0xdb9f('0x5'));var auth=require(_0xdb9f('0x6'));var interaction=require(_0xdb9f('0x7'));var config=require(_0xdb9f('0x8'));var controller=require(_0xdb9f('0x9'));router[_0xdb9f('0xa')]('/',auth[_0xdb9f('0xb')](),controller[_0xdb9f('0xc')]);router[_0xdb9f('0xa')](_0xdb9f('0xd'),auth['isAuthenticated'](),controller[_0xdb9f('0xe')]);router['get']('/:id',auth[_0xdb9f('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdb9f('0xf')]);router[_0xdb9f('0x10')](_0xdb9f('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xdb9f('0x12')](_0xdb9f('0x11'),auth[_0xdb9f('0xb')](),controller[_0xdb9f('0x13')]);module[_0xdb9f('0x14')]=router; \ No newline at end of file +var _0x3fb1=['update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x3fb1,0x15a));var _0x13fb=function(_0x41ece3,_0x3a298a){_0x41ece3=_0x41ece3-0x0;var _0x34b232=_0x3fb1[_0x41ece3];return _0x34b232;};'use strict';var multer=require('multer');var util=require(_0x13fb('0x0'));var path=require('path');var timeout=require(_0x13fb('0x1'));var express=require(_0x13fb('0x2'));var router=express['Router']();var fs_extra=require(_0x13fb('0x3'));var auth=require(_0x13fb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13fb('0x5'));router[_0x13fb('0x6')]('/',auth[_0x13fb('0x7')](),controller[_0x13fb('0x8')]);router[_0x13fb('0x6')](_0x13fb('0x9'),auth[_0x13fb('0x7')](),controller[_0x13fb('0xa')]);router[_0x13fb('0x6')](_0x13fb('0xb'),auth[_0x13fb('0x7')](),controller[_0x13fb('0xc')]);router['post']('/',auth[_0x13fb('0x7')](),controller[_0x13fb('0xd')]);router[_0x13fb('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x13fb('0xf')]);router[_0x13fb('0x10')](_0x13fb('0xb'),auth[_0x13fb('0x7')](),controller[_0x13fb('0x11')]);module[_0x13fb('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 ad3de0b..c1ed955 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 _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x28fd11,_0xb7b5ca){var _0x51caa0=function(_0x39ffeb){while(--_0x39ffeb){_0x28fd11['push'](_0x28fd11['shift']());}};_0x51caa0(++_0xb7b5ca);}(_0x8ef6,0xf2));var _0x68ef=function(_0xa33ed6,_0x37c76a){_0xa33ed6=_0xa33ed6-0x0;var _0x4e2c70=_0x8ef6[_0xa33ed6];return _0x4e2c70;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x1bd623,_0x4be123){var _0x4e7de0=function(_0x127dc2){while(--_0x127dc2){_0x1bd623['push'](_0x1bd623['shift']());}};_0x4e7de0(++_0x4be123);}(_0x55ca,0x126));var _0xa55c=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0x55ca[_0x26cd05];return _0x3e13b9;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ff125d3..3b301ee 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 _0x3420=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','status','index','map','VoiceDialReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','fields','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse'];(function(_0x2685b2,_0x513f32){var _0x54b54e=function(_0x57ff7e){while(--_0x57ff7e){_0x2685b2['push'](_0x2685b2['shift']());}};_0x54b54e(++_0x513f32);}(_0x3420,0x1e7));var _0x0342=function(_0x9d9797,_0xe3ebe8){_0x9d9797=_0x9d9797-0x0;var _0x3c16ca=_0x3420[_0x9d9797];return _0x3c16ca;};'use strict';var emlformat=require(_0x0342('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0342('0x1'));var jsonpatch=require(_0x0342('0x2'));var rp=require(_0x0342('0x3'));var moment=require(_0x0342('0x4'));var BPromise=require(_0x0342('0x5'));var Mustache=require(_0x0342('0x6'));var util=require(_0x0342('0x7'));var path=require(_0x0342('0x8'));var sox=require(_0x0342('0x9'));var csv=require(_0x0342('0xa'));var ejs=require(_0x0342('0xb'));var fs=require('fs');var fs_extra=require(_0x0342('0xc'));var _=require(_0x0342('0xd'));var squel=require('squel');var crypto=require(_0x0342('0xe'));var jsforce=require(_0x0342('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0342('0x10'));var Redis=require(_0x0342('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0342('0x12'));var hardwareService=require(_0x0342('0x13'));var logger=require('../../config/logger')(_0x0342('0x14'));var utils=require(_0x0342('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0342('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec5c,_0x709826){_0x709826=_0x709826||0xcc;return function(_0x59c7d6){if(_0x59c7d6){return _0x24ec5c[_0x0342('0x17')](_0x709826);}return _0x24ec5c['status'](_0x709826)[_0x0342('0x18')]();};}function respondWithResult(_0x42bdc1,_0x4b6159){_0x4b6159=_0x4b6159||0xc8;return function(_0x4de204){if(_0x4de204){return _0x42bdc1['status'](_0x4b6159)[_0x0342('0x19')](_0x4de204);}};}function respondWithFilteredResult(_0x480e87,_0x3ee955){return function(_0x22bf0b){if(_0x22bf0b){var _0xa25d6=typeof _0x3ee955[_0x0342('0x1a')]==='undefined'&&typeof _0x3ee955[_0x0342('0x1b')]===_0x0342('0x1c');var _0xdb5b25=_0x22bf0b[_0x0342('0x1d')];var _0x3fc5dd=_0xa25d6?0x0:_0x3ee955[_0x0342('0x1a')];var _0x28958b=_0xa25d6?_0x22bf0b['count']:_0x3ee955[_0x0342('0x1a')]+_0x3ee955[_0x0342('0x1b')];var _0x3032f6;if(_0x28958b>=_0xdb5b25){_0x28958b=_0xdb5b25;_0x3032f6=0xc8;}else{_0x3032f6=0xce;}_0x480e87['status'](_0x3032f6);return _0x480e87['set'](_0x0342('0x1e'),_0x3fc5dd+'-'+_0x28958b+'/'+_0xdb5b25)[_0x0342('0x19')](_0x22bf0b);}return null;};}function patchUpdates(_0x30c881){return function(_0xaca1b3){try{jsonpatch[_0x0342('0x1f')](_0xaca1b3,_0x30c881,!![]);}catch(_0x1b3f1d){return BPromise[_0x0342('0x20')](_0x1b3f1d);}return _0xaca1b3[_0x0342('0x21')]();};}function saveUpdates(_0x5051aa,_0x2159ea){return function(_0x4a1a73){if(_0x4a1a73){return _0x4a1a73[_0x0342('0x22')](_0x5051aa)[_0x0342('0x23')](function(_0x59346c){return _0x59346c;});}return null;};}function removeEntity(_0x3be96d,_0x32f66c){return function(_0x102e4f){if(_0x102e4f){return _0x102e4f[_0x0342('0x24')]()[_0x0342('0x23')](function(){_0x3be96d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ab4d,_0x8a33e2){return function(_0x293e2f){if(!_0x293e2f){_0x38ab4d[_0x0342('0x17')](0x194);}return _0x293e2f;};}function handleError(_0x1208fd,_0x3ef941){_0x3ef941=_0x3ef941||0x1f4;return function(_0x41dc4e){logger['error'](_0x41dc4e[_0x0342('0x25')]);if(_0x41dc4e[_0x0342('0x26')]){delete _0x41dc4e[_0x0342('0x26')];}_0x1208fd[_0x0342('0x27')](_0x3ef941)['send'](_0x41dc4e);};}exports[_0x0342('0x28')]=function(_0x130432,_0x55412d){var _0x225514={},_0x5f4f1b={},_0x4e907e={'count':0x0,'rows':[]};var _0x31b676=_[_0x0342('0x29')](db[_0x0342('0x2a')][_0x0342('0x2b')],function(_0x510a6d){return{'name':_0x510a6d[_0x0342('0x2c')],'type':_0x510a6d[_0x0342('0x2d')]['key']};});_0x5f4f1b['model']=_[_0x0342('0x29')](_0x31b676,_0x0342('0x26'));_0x5f4f1b[_0x0342('0x2e')]=_[_0x0342('0x2f')](_0x130432['query']);_0x5f4f1b[_0x0342('0x30')]=_[_0x0342('0x31')](_0x5f4f1b[_0x0342('0x32')],_0x5f4f1b[_0x0342('0x2e')]);_0x225514[_0x0342('0x33')]=_[_0x0342('0x31')](_0x5f4f1b[_0x0342('0x32')],qs['fields'](_0x130432[_0x0342('0x2e')]['fields']));_0x225514[_0x0342('0x33')]=_0x225514['attributes'][_0x0342('0x34')]?_0x225514['attributes']:_0x5f4f1b[_0x0342('0x32')];if(!_0x130432['query'][_0x0342('0x35')](_0x0342('0x36'))){_0x225514[_0x0342('0x1b')]=qs[_0x0342('0x1b')](_0x130432['query'][_0x0342('0x1b')]);_0x225514[_0x0342('0x1a')]=qs[_0x0342('0x1a')](_0x130432[_0x0342('0x2e')]['offset']);}_0x225514[_0x0342('0x37')]=qs['sort'](_0x130432[_0x0342('0x2e')][_0x0342('0x38')]);_0x225514[_0x0342('0x39')]=qs[_0x0342('0x30')](_['pick'](_0x130432[_0x0342('0x2e')],_0x5f4f1b['filters']),_0x31b676);if(_0x130432[_0x0342('0x2e')][_0x0342('0x3a')]){_0x225514[_0x0342('0x39')]=_['merge'](_0x225514[_0x0342('0x39')],{'$or':_[_0x0342('0x29')](_0x31b676,function(_0x422a11){if(_0x422a11[_0x0342('0x2d')]!==_0x0342('0x3b')){var _0x1bbd03={};_0x1bbd03[_0x422a11[_0x0342('0x26')]]={'$like':'%'+_0x130432[_0x0342('0x2e')][_0x0342('0x3a')]+'%'};return _0x1bbd03;}})});}_0x225514=_[_0x0342('0x3c')]({},_0x225514,_0x130432[_0x0342('0x3d')]);var _0x4d265d={'where':_0x225514['where']};return db[_0x0342('0x2a')][_0x0342('0x1d')](_0x4d265d)['then'](function(_0x53c52b){_0x4e907e[_0x0342('0x1d')]=_0x53c52b;if(_0x130432[_0x0342('0x2e')][_0x0342('0x3e')]){_0x225514[_0x0342('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x225514);})['then'](function(_0x1279bf){_0x4e907e['rows']=_0x1279bf;return _0x4e907e;})[_0x0342('0x23')](respondWithFilteredResult(_0x55412d,_0x225514))[_0x0342('0x40')](handleError(_0x55412d,null));};exports[_0x0342('0x41')]=function(_0x57c67f,_0x49f1a4){var _0x15b92d={'raw':!![],'where':{'id':_0x57c67f['params']['id']}},_0x3ed32f={};_0x3ed32f[_0x0342('0x32')]=_[_0x0342('0x2f')](db[_0x0342('0x2a')]['rawAttributes']);_0x3ed32f[_0x0342('0x2e')]=_[_0x0342('0x2f')](_0x57c67f[_0x0342('0x2e')]);_0x3ed32f[_0x0342('0x30')]=_[_0x0342('0x31')](_0x3ed32f[_0x0342('0x32')],_0x3ed32f['query']);_0x15b92d[_0x0342('0x33')]=_[_0x0342('0x31')](_0x3ed32f[_0x0342('0x32')],qs[_0x0342('0x42')](_0x57c67f[_0x0342('0x2e')][_0x0342('0x42')]));_0x15b92d[_0x0342('0x33')]=_0x15b92d[_0x0342('0x33')][_0x0342('0x34')]?_0x15b92d[_0x0342('0x33')]:_0x3ed32f['model'];if(_0x57c67f[_0x0342('0x2e')][_0x0342('0x3e')]){_0x15b92d[_0x0342('0x3f')]=[{'all':!![]}];}_0x15b92d=_[_0x0342('0x3c')]({},_0x15b92d,_0x57c67f[_0x0342('0x3d')]);return db['VoiceDialReport'][_0x0342('0x43')](_0x15b92d)['then'](handleEntityNotFound(_0x49f1a4,null))[_0x0342('0x23')](respondWithResult(_0x49f1a4,null))[_0x0342('0x40')](handleError(_0x49f1a4,null));};exports[_0x0342('0x44')]=function(_0x5564a1,_0x17c43d){return db[_0x0342('0x2a')][_0x0342('0x44')](_0x5564a1[_0x0342('0x45')],{})[_0x0342('0x23')](respondWithResult(_0x17c43d,0xc9))[_0x0342('0x40')](handleError(_0x17c43d,null));};exports[_0x0342('0x22')]=function(_0x4a32f6,_0x3eb70c){if(_0x4a32f6[_0x0342('0x45')]['id']){delete _0x4a32f6[_0x0342('0x45')]['id'];}return db['VoiceDialReport'][_0x0342('0x43')]({'where':{'id':_0x4a32f6[_0x0342('0x46')]['id']}})[_0x0342('0x23')](handleEntityNotFound(_0x3eb70c,null))[_0x0342('0x23')](saveUpdates(_0x4a32f6[_0x0342('0x45')],null))[_0x0342('0x23')](respondWithResult(_0x3eb70c,null))['catch'](handleError(_0x3eb70c,null));};exports[_0x0342('0x24')]=function(_0x2dfb1a,_0x3fc8fd){return db['VoiceDialReport'][_0x0342('0x43')]({'where':{'id':_0x2dfb1a['params']['id']}})[_0x0342('0x23')](handleEntityNotFound(_0x3fc8fd,null))[_0x0342('0x23')](removeEntity(_0x3fc8fd,null))['catch'](handleError(_0x3fc8fd,null));};exports[_0x0342('0x47')]=function(_0x38850,_0x9c229){return db[_0x0342('0x2a')][_0x0342('0x47')]()[_0x0342('0x23')](respondWithResult(_0x9c229,null))[_0x0342('0x40')](handleError(_0x9c229,null));}; \ No newline at end of file +var _0x840c=['undefined','count','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','VoiceDialReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','findAll','rows','show','rawAttributes','includeAll','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x589994,_0xfa763){var _0x3faf9=function(_0x3b3466){while(--_0x3b3466){_0x589994['push'](_0x589994['shift']());}};_0x3faf9(++_0xfa763);}(_0x840c,0xc0));var _0xc840=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x840c[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xc840('0x0'));var rimraf=require(_0xc840('0x1'));var zipdir=require(_0xc840('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc840('0x3'));var moment=require(_0xc840('0x4'));var BPromise=require(_0xc840('0x5'));var Mustache=require(_0xc840('0x6'));var util=require(_0xc840('0x7'));var path=require(_0xc840('0x8'));var sox=require(_0xc840('0x9'));var csv=require(_0xc840('0xa'));var ejs=require(_0xc840('0xb'));var fs=require('fs');var fs_extra=require(_0xc840('0xc'));var _=require(_0xc840('0xd'));var squel=require(_0xc840('0xe'));var crypto=require(_0xc840('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc840('0xa'));var querystring=require(_0xc840('0x10'));var Papa=require(_0xc840('0x11'));var Redis=require('ioredis');var authService=require(_0xc840('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc840('0x13'));var hardwareService=require(_0xc840('0x14'));var logger=require(_0xc840('0x15'))(_0xc840('0x16'));var utils=require(_0xc840('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc840('0x18'))['db'];function respondWithStatusCode(_0x2168cb,_0x55afa3){_0x55afa3=_0x55afa3||0xcc;return function(_0x1dd8f5){if(_0x1dd8f5){return _0x2168cb[_0xc840('0x19')](_0x55afa3);}return _0x2168cb[_0xc840('0x1a')](_0x55afa3)[_0xc840('0x1b')]();};}function respondWithResult(_0x4c3519,_0x5a6762){_0x5a6762=_0x5a6762||0xc8;return function(_0x32d644){if(_0x32d644){return _0x4c3519[_0xc840('0x1a')](_0x5a6762)[_0xc840('0x1c')](_0x32d644);}};}function respondWithFilteredResult(_0x11b0c9,_0x34a7fe){return function(_0x2cff0d){if(_0x2cff0d){var _0xefe505=typeof _0x34a7fe[_0xc840('0x1d')]===_0xc840('0x1e')&&typeof _0x34a7fe['limit']===_0xc840('0x1e');var _0x1ff0b9=_0x2cff0d[_0xc840('0x1f')];var _0x41c80f=_0xefe505?0x0:_0x34a7fe[_0xc840('0x1d')];var _0x19a794=_0xefe505?_0x2cff0d['count']:_0x34a7fe[_0xc840('0x1d')]+_0x34a7fe[_0xc840('0x20')];var _0x268f83;if(_0x19a794>=_0x1ff0b9){_0x19a794=_0x1ff0b9;_0x268f83=0xc8;}else{_0x268f83=0xce;}_0x11b0c9[_0xc840('0x1a')](_0x268f83);return _0x11b0c9[_0xc840('0x21')](_0xc840('0x22'),_0x41c80f+'-'+_0x19a794+'/'+_0x1ff0b9)['json'](_0x2cff0d);}return null;};}function patchUpdates(_0x30b9a5){return function(_0x3599ee){try{jsonpatch[_0xc840('0x23')](_0x3599ee,_0x30b9a5,!![]);}catch(_0x4e8ff0){return BPromise[_0xc840('0x24')](_0x4e8ff0);}return _0x3599ee['save']();};}function saveUpdates(_0x5672a4,_0x59126c){return function(_0x1ee411){if(_0x1ee411){return _0x1ee411['update'](_0x5672a4)[_0xc840('0x25')](function(_0x1742dd){return _0x1742dd;});}return null;};}function removeEntity(_0x43adca,_0x334cf5){return function(_0x3c66e7){if(_0x3c66e7){return _0x3c66e7[_0xc840('0x26')]()[_0xc840('0x25')](function(){_0x43adca[_0xc840('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a9138,_0x52e7ba){return function(_0x2a894b){if(!_0x2a894b){_0x5a9138[_0xc840('0x19')](0x194);}return _0x2a894b;};}function handleError(_0xa2f545,_0x5817a9){_0x5817a9=_0x5817a9||0x1f4;return function(_0x17c3ad){logger['error'](_0x17c3ad[_0xc840('0x27')]);if(_0x17c3ad[_0xc840('0x28')]){delete _0x17c3ad['name'];}_0xa2f545[_0xc840('0x1a')](_0x5817a9)[_0xc840('0x29')](_0x17c3ad);};}exports['index']=function(_0x24ffcc,_0x50bac1){var _0x198203={},_0x1c5787={},_0x5374ee={'count':0x0,'rows':[]};var _0x4c825e=_[_0xc840('0x2a')](db[_0xc840('0x2b')]['rawAttributes'],function(_0x4403ae){return{'name':_0x4403ae[_0xc840('0x2c')],'type':_0x4403ae[_0xc840('0x2d')]['key']};});_0x1c5787[_0xc840('0x2e')]=_[_0xc840('0x2a')](_0x4c825e,_0xc840('0x28'));_0x1c5787[_0xc840('0x2f')]=_[_0xc840('0x30')](_0x24ffcc[_0xc840('0x2f')]);_0x1c5787[_0xc840('0x31')]=_[_0xc840('0x32')](_0x1c5787[_0xc840('0x2e')],_0x1c5787[_0xc840('0x2f')]);_0x198203['attributes']=_[_0xc840('0x32')](_0x1c5787[_0xc840('0x2e')],qs[_0xc840('0x33')](_0x24ffcc[_0xc840('0x2f')]['fields']));_0x198203[_0xc840('0x34')]=_0x198203['attributes'][_0xc840('0x35')]?_0x198203[_0xc840('0x34')]:_0x1c5787['model'];if(!_0x24ffcc[_0xc840('0x2f')][_0xc840('0x36')]('nolimit')){_0x198203[_0xc840('0x20')]=qs[_0xc840('0x20')](_0x24ffcc[_0xc840('0x2f')]['limit']);_0x198203['offset']=qs[_0xc840('0x1d')](_0x24ffcc[_0xc840('0x2f')][_0xc840('0x1d')]);}_0x198203[_0xc840('0x37')]=qs['sort'](_0x24ffcc['query'][_0xc840('0x38')]);_0x198203['where']=qs[_0xc840('0x31')](_[_0xc840('0x39')](_0x24ffcc[_0xc840('0x2f')],_0x1c5787[_0xc840('0x31')]),_0x4c825e);if(_0x24ffcc[_0xc840('0x2f')]['filter']){_0x198203[_0xc840('0x3a')]=_[_0xc840('0x3b')](_0x198203[_0xc840('0x3a')],{'$or':_[_0xc840('0x2a')](_0x4c825e,function(_0x4f4ddf){if(_0x4f4ddf[_0xc840('0x2d')]!==_0xc840('0x3c')){var _0x49fb78={};_0x49fb78[_0x4f4ddf[_0xc840('0x28')]]={'$like':'%'+_0x24ffcc['query']['filter']+'%'};return _0x49fb78;}})});}_0x198203=_[_0xc840('0x3b')]({},_0x198203,_0x24ffcc[_0xc840('0x3d')]);var _0x277011={'where':_0x198203['where']};return db[_0xc840('0x2b')]['count'](_0x277011)[_0xc840('0x25')](function(_0xab3887){_0x5374ee[_0xc840('0x1f')]=_0xab3887;if(_0x24ffcc[_0xc840('0x2f')]['includeAll']){_0x198203['include']=[{'all':!![]}];}return db[_0xc840('0x2b')][_0xc840('0x3e')](_0x198203);})[_0xc840('0x25')](function(_0x138d1f){_0x5374ee[_0xc840('0x3f')]=_0x138d1f;return _0x5374ee;})[_0xc840('0x25')](respondWithFilteredResult(_0x50bac1,_0x198203))['catch'](handleError(_0x50bac1,null));};exports[_0xc840('0x40')]=function(_0x3627a3,_0x39b552){var _0x39a213={'raw':!![],'where':{'id':_0x3627a3['params']['id']}},_0x542ee4={};_0x542ee4[_0xc840('0x2e')]=_[_0xc840('0x30')](db[_0xc840('0x2b')][_0xc840('0x41')]);_0x542ee4[_0xc840('0x2f')]=_['keys'](_0x3627a3['query']);_0x542ee4[_0xc840('0x31')]=_['intersection'](_0x542ee4[_0xc840('0x2e')],_0x542ee4[_0xc840('0x2f')]);_0x39a213[_0xc840('0x34')]=_[_0xc840('0x32')](_0x542ee4['model'],qs[_0xc840('0x33')](_0x3627a3[_0xc840('0x2f')][_0xc840('0x33')]));_0x39a213[_0xc840('0x34')]=_0x39a213[_0xc840('0x34')][_0xc840('0x35')]?_0x39a213[_0xc840('0x34')]:_0x542ee4['model'];if(_0x3627a3[_0xc840('0x2f')][_0xc840('0x42')]){_0x39a213['include']=[{'all':!![]}];}_0x39a213=_['merge']({},_0x39a213,_0x3627a3[_0xc840('0x3d')]);return db[_0xc840('0x2b')][_0xc840('0x43')](_0x39a213)[_0xc840('0x25')](handleEntityNotFound(_0x39b552,null))[_0xc840('0x25')](respondWithResult(_0x39b552,null))['catch'](handleError(_0x39b552,null));};exports[_0xc840('0x44')]=function(_0x1d3dd2,_0x5296eb){return db[_0xc840('0x2b')][_0xc840('0x44')](_0x1d3dd2[_0xc840('0x45')],{})[_0xc840('0x25')](respondWithResult(_0x5296eb,0xc9))[_0xc840('0x46')](handleError(_0x5296eb,null));};exports[_0xc840('0x47')]=function(_0x4d5653,_0x1d7bef){if(_0x4d5653[_0xc840('0x45')]['id']){delete _0x4d5653[_0xc840('0x45')]['id'];}return db[_0xc840('0x2b')][_0xc840('0x43')]({'where':{'id':_0x4d5653[_0xc840('0x48')]['id']}})[_0xc840('0x25')](handleEntityNotFound(_0x1d7bef,null))[_0xc840('0x25')](saveUpdates(_0x4d5653[_0xc840('0x45')],null))[_0xc840('0x25')](respondWithResult(_0x1d7bef,null))[_0xc840('0x46')](handleError(_0x1d7bef,null));};exports[_0xc840('0x26')]=function(_0x4cdf8c,_0x1f743e){return db[_0xc840('0x2b')][_0xc840('0x43')]({'where':{'id':_0x4cdf8c['params']['id']}})['then'](handleEntityNotFound(_0x1f743e,null))[_0xc840('0x25')](removeEntity(_0x1f743e,null))[_0xc840('0x46')](handleError(_0x1f743e,null));};exports[_0xc840('0x49')]=function(_0x5ad40d,_0x19e352){return db['VoiceDialReport'][_0xc840('0x49')]()['then'](respondWithResult(_0x19e352,null))[_0xc840('0x46')](handleError(_0x19e352,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1b81b05..d9a737a 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 _0x3c40=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x3c40,0xf4));var _0x03c4=function(_0x5837d1,_0x4661e0){_0x5837d1=_0x5837d1-0x0;var _0x43b3b7=_0x3c40[_0x5837d1];return _0x43b3b7;};'use strict';var _=require(_0x03c4('0x0'));var util=require(_0x03c4('0x1'));var logger=require('../../config/logger')(_0x03c4('0x2'));var moment=require(_0x03c4('0x3'));var BPromise=require(_0x03c4('0x4'));var rp=require(_0x03c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03c4('0x6'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x03c4('0x7')]=function(_0x59fe19,_0x580fcd){return _0x59fe19[_0x03c4('0x8')](_0x03c4('0x9'),attributes,{'tableName':_0x03c4('0xa'),'paranoid':![],'indexes':[{'fields':[_0x03c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64c4=['rimraf','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','util','api','moment','request-promise','path'];(function(_0x37f9ad,_0x4e664e){var _0x1862e9=function(_0x58e8cb){while(--_0x58e8cb){_0x37f9ad['push'](_0x37f9ad['shift']());}};_0x1862e9(++_0x4e664e);}(_0x64c4,0x13a));var _0x464c=function(_0x49c57e,_0x299e2c){_0x49c57e=_0x49c57e-0x0;var _0x377aef=_0x64c4[_0x49c57e];return _0x377aef;};'use strict';var _=require('lodash');var util=require(_0x464c('0x0'));var logger=require('../../config/logger')(_0x464c('0x1'));var moment=require(_0x464c('0x2'));var BPromise=require('bluebird');var rp=require(_0x464c('0x3'));var fs=require('fs');var path=require(_0x464c('0x4'));var rimraf=require(_0x464c('0x5'));var config=require('../../config/environment');var attributes=require(_0x464c('0x6'));module[_0x464c('0x7')]=function(_0x1495fd,_0x42270c){return _0x1495fd[_0x464c('0x8')]('VoiceDialReport',attributes,{'tableName':_0x464c('0x9'),'paranoid':![],'indexes':[{'fields':[_0x464c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a0d87ae..be35159 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 _0xdcc5=['error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','VoiceDialReport','where','attributes','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1eb5a9,_0x279b38){var _0x495ea3=function(_0x36a834){while(--_0x36a834){_0x1eb5a9['push'](_0x1eb5a9['shift']());}};_0x495ea3(++_0x279b38);}(_0xdcc5,0x114));var _0x5dcc=function(_0x2dc580,_0x12b710){_0x2dc580=_0x2dc580-0x0;var _0x486ddf=_0xdcc5[_0x2dc580];return _0x486ddf;};'use strict';var _=require(_0x5dcc('0x0'));var util=require(_0x5dcc('0x1'));var moment=require(_0x5dcc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dcc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dcc('0x4'));var logger=require('../../config/logger')(_0x5dcc('0x5'));var config=require(_0x5dcc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5dcc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x295773,_0x336e0e,_0x4eb7c2){return new BPromise(function(_0x3dfb79,_0x5b40a2){return client['request'](_0x295773,_0x4eb7c2)[_0x5dcc('0x8')](function(_0x2346d0){logger[_0x5dcc('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x336e0e,_0x5dcc('0xa'));logger[_0x5dcc('0xb')](_0x5dcc('0xc'),_0x336e0e,_0x5dcc('0xa'),JSON[_0x5dcc('0xd')](_0x2346d0));if(_0x2346d0['error']){if(_0x2346d0[_0x5dcc('0xe')][_0x5dcc('0xf')]===0x1f4){logger[_0x5dcc('0xe')](_0x5dcc('0x10'),_0x336e0e,_0x2346d0[_0x5dcc('0xe')]['message']);return _0x5b40a2(_0x2346d0['error']['message']);}logger[_0x5dcc('0xe')](_0x5dcc('0x10'),_0x336e0e,_0x2346d0[_0x5dcc('0xe')][_0x5dcc('0x11')]);return _0x3dfb79(_0x2346d0[_0x5dcc('0xe')]['message']);}else{logger[_0x5dcc('0x9')](_0x5dcc('0x10'),_0x336e0e,_0x5dcc('0xa'));_0x3dfb79(_0x2346d0[_0x5dcc('0x12')]['message']);}})['catch'](function(_0x277a7a){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x336e0e,_0x277a7a);_0x5b40a2(_0x277a7a);});});}exports[_0x5dcc('0x13')]=function(_0x519356){var _0x45ac5e=this;return new Promise(function(_0x184ca9,_0x1f292d){return db['VoiceDialReport'][_0x5dcc('0x14')](_0x519356[_0x5dcc('0x15')],{'raw':_0x519356[_0x5dcc('0x16')]?_0x519356[_0x5dcc('0x16')][_0x5dcc('0x17')]===undefined?!![]:![]:!![]})[_0x5dcc('0x8')](function(_0x3c4028){logger[_0x5dcc('0x9')](_0x5dcc('0x13'),_0x519356);logger[_0x5dcc('0xb')]('CreateVoiceDialReport',_0x519356,JSON[_0x5dcc('0xd')](_0x3c4028));_0x184ca9(_0x3c4028);})[_0x5dcc('0x18')](function(_0x5d69a5){logger[_0x5dcc('0xe')]('CreateVoiceDialReport',_0x5d69a5[_0x5dcc('0x11')],_0x519356);_0x1f292d(_0x45ac5e[_0x5dcc('0xe')](0x1f4,_0x5d69a5[_0x5dcc('0x11')]));});});};exports[_0x5dcc('0x19')]=function(_0x1c19d1){var _0x292c29=this;return new Promise(function(_0x1bfcec,_0x4ff8eb){return db[_0x5dcc('0x1a')]['update'](_0x1c19d1['body'],{'raw':_0x1c19d1['options']?_0x1c19d1['options'][_0x5dcc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c19d1['options']?_0x1c19d1['options'][_0x5dcc('0x1b')]||null:null,'attributes':_0x1c19d1[_0x5dcc('0x16')]?_0x1c19d1[_0x5dcc('0x16')][_0x5dcc('0x1c')]||null:null,'limit':_0x1c19d1[_0x5dcc('0x16')]?_0x1c19d1['options']['limit']||null:null})[_0x5dcc('0x8')](function(_0x47a951){logger[_0x5dcc('0x9')](_0x5dcc('0x19'),_0x1c19d1);logger[_0x5dcc('0xb')](_0x5dcc('0x19'),_0x1c19d1,JSON[_0x5dcc('0xd')](_0x47a951));_0x1bfcec(_0x47a951);})[_0x5dcc('0x18')](function(_0x5d91e6){logger[_0x5dcc('0xe')](_0x5dcc('0x19'),_0x5d91e6[_0x5dcc('0x11')],_0x1c19d1);_0x4ff8eb(_0x292c29['error'](0x1f4,_0x5d91e6['message']));});});}; \ No newline at end of file +var _0xd1b3=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xd1b3,0x168));var _0x3d1b=function(_0x34a77d,_0x1edfd1){_0x34a77d=_0x34a77d-0x0;var _0x404dd8=_0xd1b3[_0x34a77d];return _0x404dd8;};'use strict';var _=require(_0x3d1b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3d1b('0x1'));var fs=require('fs');var Redis=require(_0x3d1b('0x2'));var db=require(_0x3d1b('0x3'))['db'];var utils=require(_0x3d1b('0x4'));var logger=require(_0x3d1b('0x5'))('rpc');var config=require(_0x3d1b('0x6'));var jayson=require(_0x3d1b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3921,_0x5efadb,_0x43d316){return new BPromise(function(_0x1622a1,_0x4c1883){return client[_0x3d1b('0x8')](_0x2f3921,_0x43d316)[_0x3d1b('0x9')](function(_0x2dabea){logger[_0x3d1b('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x5efadb,'request\x20sent');logger[_0x3d1b('0xb')](_0x3d1b('0xc'),_0x5efadb,_0x3d1b('0xd'),JSON[_0x3d1b('0xe')](_0x2dabea));if(_0x2dabea[_0x3d1b('0xf')]){if(_0x2dabea[_0x3d1b('0xf')][_0x3d1b('0x10')]===0x1f4){logger[_0x3d1b('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x5efadb,_0x2dabea[_0x3d1b('0xf')][_0x3d1b('0x11')]);return _0x4c1883(_0x2dabea[_0x3d1b('0xf')][_0x3d1b('0x11')]);}logger[_0x3d1b('0xf')](_0x3d1b('0x12'),_0x5efadb,_0x2dabea[_0x3d1b('0xf')][_0x3d1b('0x11')]);return _0x1622a1(_0x2dabea[_0x3d1b('0xf')][_0x3d1b('0x11')]);}else{logger[_0x3d1b('0xa')](_0x3d1b('0x12'),_0x5efadb,_0x3d1b('0xd'));_0x1622a1(_0x2dabea['result'][_0x3d1b('0x11')]);}})[_0x3d1b('0x13')](function(_0x2727c3){logger[_0x3d1b('0xf')](_0x3d1b('0x12'),_0x5efadb,_0x2727c3);_0x4c1883(_0x2727c3);});});}exports['CreateVoiceDialReport']=function(_0x2dec73){var _0x41750f=this;return new Promise(function(_0x21e5f8,_0x57707a){return db[_0x3d1b('0x14')][_0x3d1b('0x15')](_0x2dec73['body'],{'raw':_0x2dec73[_0x3d1b('0x16')]?_0x2dec73[_0x3d1b('0x16')][_0x3d1b('0x17')]===undefined?!![]:![]:!![]})[_0x3d1b('0x9')](function(_0x1df9f2){logger[_0x3d1b('0xa')](_0x3d1b('0x18'),_0x2dec73);logger['debug'](_0x3d1b('0x18'),_0x2dec73,JSON[_0x3d1b('0xe')](_0x1df9f2));_0x21e5f8(_0x1df9f2);})[_0x3d1b('0x13')](function(_0x1414a3){logger[_0x3d1b('0xf')](_0x3d1b('0x18'),_0x1414a3[_0x3d1b('0x11')],_0x2dec73);_0x57707a(_0x41750f[_0x3d1b('0xf')](0x1f4,_0x1414a3['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4f18d3){var _0x3f65f3=this;return new Promise(function(_0x21f4ff,_0x1078d6){return db[_0x3d1b('0x14')][_0x3d1b('0x19')](_0x4f18d3['body'],{'raw':_0x4f18d3['options']?_0x4f18d3[_0x3d1b('0x16')][_0x3d1b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f18d3[_0x3d1b('0x16')]?_0x4f18d3[_0x3d1b('0x16')][_0x3d1b('0x1a')]||null:null,'attributes':_0x4f18d3[_0x3d1b('0x16')]?_0x4f18d3[_0x3d1b('0x16')][_0x3d1b('0x1b')]||null:null,'limit':_0x4f18d3[_0x3d1b('0x16')]?_0x4f18d3['options'][_0x3d1b('0x1c')]||null:null})[_0x3d1b('0x9')](function(_0x285564){logger[_0x3d1b('0xa')](_0x3d1b('0x1d'),_0x4f18d3);logger[_0x3d1b('0xb')](_0x3d1b('0x1d'),_0x4f18d3,JSON[_0x3d1b('0xe')](_0x285564));_0x21f4ff(_0x285564);})[_0x3d1b('0x13')](function(_0x3701ea){logger[_0x3d1b('0xf')](_0x3d1b('0x1d'),_0x3701ea[_0x3d1b('0x11')],_0x4f18d3);_0x1078d6(_0x3f65f3[_0x3d1b('0xf')](0x1f4,_0x3701ea[_0x3d1b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 8970815..939d017 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 _0x07a3=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','/:id/applications','addApplications'];(function(_0x1baef6,_0x104b34){var _0x5f34a6=function(_0x4db449){while(--_0x4db449){_0x1baef6['push'](_0x1baef6['shift']());}};_0x5f34a6(++_0x104b34);}(_0x07a3,0x7b));var _0x307a=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x07a3[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x307a('0x0'));var util=require(_0x307a('0x1'));var path=require(_0x307a('0x2'));var timeout=require(_0x307a('0x3'));var express=require(_0x307a('0x4'));var router=express[_0x307a('0x5')]();var fs_extra=require(_0x307a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x307a('0x7'));var config=require(_0x307a('0x8'));var controller=require(_0x307a('0x9'));router[_0x307a('0xa')]('/',auth[_0x307a('0xb')](),controller[_0x307a('0xc')]);router[_0x307a('0xa')](_0x307a('0xd'),auth[_0x307a('0xb')](),controller[_0x307a('0xe')]);router['post']('/',auth[_0x307a('0xb')](),controller['create']);router['post'](_0x307a('0xf'),auth[_0x307a('0xb')](),controller[_0x307a('0x10')]);router[_0x307a('0x11')](_0x307a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x307a('0x12')](_0x307a('0xd'),auth[_0x307a('0xb')](),controller[_0x307a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5ce8=['./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5ea816,_0x1f7788){var _0x150b55=function(_0x55760e){while(--_0x55760e){_0x5ea816['push'](_0x5ea816['shift']());}};_0x150b55(++_0x1f7788);}(_0x5ce8,0xcb));var _0x85ce=function(_0x3b6b60,_0xcc40c0){_0x3b6b60=_0x3b6b60-0x0;var _0x175322=_0x5ce8[_0x3b6b60];return _0x175322;};'use strict';var multer=require(_0x85ce('0x0'));var util=require(_0x85ce('0x1'));var path=require(_0x85ce('0x2'));var timeout=require(_0x85ce('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x85ce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x85ce('0x5'));var config=require(_0x85ce('0x6'));var controller=require(_0x85ce('0x7'));router[_0x85ce('0x8')]('/',auth[_0x85ce('0x9')](),controller['index']);router[_0x85ce('0x8')](_0x85ce('0xa'),auth[_0x85ce('0x9')](),controller[_0x85ce('0xb')]);router[_0x85ce('0xc')]('/',auth[_0x85ce('0x9')](),controller[_0x85ce('0xd')]);router[_0x85ce('0xc')](_0x85ce('0xe'),auth[_0x85ce('0x9')](),controller[_0x85ce('0xf')]);router[_0x85ce('0x10')]('/:id',auth[_0x85ce('0x9')](),controller[_0x85ce('0x11')]);router[_0x85ce('0x12')](_0x85ce('0xa'),auth[_0x85ce('0x9')](),controller[_0x85ce('0x13')]);module[_0x85ce('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 1731868..47544ae 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 _0xda9c=['compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','exports','STRING'];(function(_0xb260f8,_0xc008c5){var _0x63096d=function(_0x27fb13){while(--_0x27fb13){_0xb260f8['push'](_0xb260f8['shift']());}};_0x63096d(++_0xc008c5);}(_0xda9c,0x19e));var _0xcda9=function(_0x5b4cdb,_0x3d7f33){_0x5b4cdb=_0x5b4cdb-0x0;var _0x5d83c7=_0xda9c[_0x5b4cdb];return _0x5d83c7;};'use strict';var Sequelize=require('sequelize');module[_0xcda9('0x0')]={'context':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'unique':_0xcda9('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xcda9('0x2')},'tag':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'defaultValue':_0xcda9('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xcda9('0x4')](_0xcda9('0x5'),'outbound',_0xcda9('0x6'),_0xcda9('0x7'),_0xcda9('0x8'),_0xcda9('0x9'),_0xcda9('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xcda9('0x1')]},'interval':{'type':Sequelize[_0xcda9('0x1')],'allowNull':![],'defaultValue':_0xcda9('0xb')},'IntervalId':{'type':Sequelize[_0xcda9('0xc')]},'isApp':{'type':Sequelize[_0xcda9('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xcda9('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xcda9('0xc')]},'recordingFormat':{'type':Sequelize[_0xcda9('0x1')],'defaultValue':_0xcda9('0xe')},'answer':{'type':Sequelize[_0xcda9('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x283a10){return this['getDataValue'](_0xcda9('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd141=['compositeIndex','NoOp','inbound','internal','outbound-fax','system','any','BOOLEAN','INTEGER','wav','getDataValue','exten','sequelize','STRING'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xd141,0xb4));var _0x1d14=function(_0x4a1d4b,_0x25c990){_0x4a1d4b=_0x4a1d4b-0x0;var _0x2bad72=_0xd141[_0x4a1d4b];return _0x2bad72;};'use strict';var Sequelize=require(_0x1d14('0x0'));module['exports']={'context':{'type':Sequelize[_0x1d14('0x1')],'allowNull':![],'unique':_0x1d14('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1d14('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x1d14('0x2')},'tag':{'type':Sequelize[_0x1d14('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x1d14('0x1')],'allowNull':![],'defaultValue':_0x1d14('0x3')},'appdata':{'type':Sequelize[_0x1d14('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x1d14('0x4'),'outbound',_0x1d14('0x5'),'inbound-fax',_0x1d14('0x6'),_0x1d14('0x7'),_0x1d14('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x1d14('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x1d14('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1d14('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x1d14('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1d14('0xa')]},'recordingFormat':{'type':Sequelize[_0x1d14('0x1')],'defaultValue':_0x1d14('0xb')},'answer':{'type':Sequelize[_0x1d14('0x9')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x242a61){return this[_0x1d14('0xc')](_0x1d14('0xd'));}},'alias':{'type':Sequelize[_0x1d14('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 244d8e6..48bcb6d 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 _0xb7ce=['key','query','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','options','include','findAll','catch','show','params','keys','intersection','includeAll','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','find','type','name','destroy','end','send','VoiceExtension','rawAttributes','fieldName'];(function(_0x491b97,_0x362b95){var _0x388d5a=function(_0x418c69){while(--_0x418c69){_0x491b97['push'](_0x491b97['shift']());}};_0x388d5a(++_0x362b95);}(_0xb7ce,0x99));var _0xeb7c=function(_0x32fd0f,_0x43ae17){_0x32fd0f=_0x32fd0f-0x0;var _0x9815d8=_0xb7ce[_0x32fd0f];return _0x9815d8;};'use strict';var emlformat=require(_0xeb7c('0x0'));var rimraf=require(_0xeb7c('0x1'));var zipdir=require(_0xeb7c('0x2'));var jsonpatch=require(_0xeb7c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb7c('0x4'));var util=require(_0xeb7c('0x5'));var path=require(_0xeb7c('0x6'));var sox=require(_0xeb7c('0x7'));var csv=require(_0xeb7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb7c('0x9'));var _=require(_0xeb7c('0xa'));var squel=require('squel');var crypto=require(_0xeb7c('0xb'));var jsforce=require(_0xeb7c('0xc'));var deskjs=require(_0xeb7c('0xd'));var toCsv=require(_0xeb7c('0x8'));var querystring=require(_0xeb7c('0xe'));var Papa=require(_0xeb7c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb7c('0x10'));var hardwareService=require(_0xeb7c('0x11'));var logger=require(_0xeb7c('0x12'))(_0xeb7c('0x13'));var utils=require(_0xeb7c('0x14'));var config=require(_0xeb7c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb7c('0x16'))['db'];config[_0xeb7c('0x17')]=_[_0xeb7c('0x18')](config['redis'],{'host':_0xeb7c('0x19'),'port':0x18eb});var socket=require(_0xeb7c('0x1a'))(new Redis(config[_0xeb7c('0x17')]));require(_0xeb7c('0x1b'))[_0xeb7c('0x1c')](socket);function respondWithStatusCode(_0x13b11b,_0x19b049){_0x19b049=_0x19b049||0xcc;return function(_0x4c3c11){if(_0x4c3c11){return _0x13b11b['sendStatus'](_0x19b049);}return _0x13b11b[_0xeb7c('0x1d')](_0x19b049)['end']();};}function respondWithResult(_0x49ee16,_0x13a82e){_0x13a82e=_0x13a82e||0xc8;return function(_0x3eae84){if(_0x3eae84){return _0x49ee16[_0xeb7c('0x1d')](_0x13a82e)[_0xeb7c('0x1e')](_0x3eae84);}};}function respondWithFilteredResult(_0x2657c0,_0xfa0f1f){return function(_0x4b92a2){if(_0x4b92a2){var _0x250044=typeof _0xfa0f1f[_0xeb7c('0x1f')]===_0xeb7c('0x20')&&typeof _0xfa0f1f['limit']==='undefined';var _0x472274=_0x4b92a2[_0xeb7c('0x21')];var _0x4d0ed9=_0x250044?0x0:_0xfa0f1f[_0xeb7c('0x1f')];var _0x1741c7=_0x250044?_0x4b92a2[_0xeb7c('0x21')]:_0xfa0f1f[_0xeb7c('0x1f')]+_0xfa0f1f[_0xeb7c('0x22')];var _0x1e1ad1;if(_0x1741c7>=_0x472274){_0x1741c7=_0x472274;_0x1e1ad1=0xc8;}else{_0x1e1ad1=0xce;}_0x2657c0[_0xeb7c('0x1d')](_0x1e1ad1);return _0x2657c0[_0xeb7c('0x23')](_0xeb7c('0x24'),_0x4d0ed9+'-'+_0x1741c7+'/'+_0x472274)[_0xeb7c('0x1e')](_0x4b92a2);}return null;};}function patchUpdates(_0x2182c1){return function(_0xa65976){try{jsonpatch[_0xeb7c('0x25')](_0xa65976,_0x2182c1,!![]);}catch(_0x5de053){return BPromise[_0xeb7c('0x26')](_0x5de053);}return _0xa65976[_0xeb7c('0x27')]();};}function saveUpdates(_0x31747f,_0xbcf019){return function(_0x58f02e){if(_0x58f02e){return _0x58f02e[_0xeb7c('0x28')](_0x31747f)[_0xeb7c('0x29')](function(_0x50c234){return _0x50c234;});}return null;};}function removeEntity(_0x5789c0,_0x271d6b){return function(_0x32c651){if(_0x32c651){return _0x32c651['destroy']()['then'](function(){var _0x54b0c5=_0x32c651[_0xeb7c('0x2a')]({'plain':!![]});var _0x18e300=[{'name':'InboundRoutes','value':_0xeb7c('0x2b'),'ignore':![]},{'name':_0xeb7c('0x2c'),'value':_0xeb7c('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0xeb7c('0x2e'),'ignore':![]}];var _0x9551ca=_(_0x18e300)[_0xeb7c('0x2f')](_0xeb7c('0x30'))[_0xeb7c('0x31')](_0xeb7c('0x32'))['value']();if(_[_0xeb7c('0x33')](_0x9551ca,_0x54b0c5['type'])){return;}var _0x187305=_[_0xeb7c('0x34')](_0x18e300,[_0xeb7c('0x32'),_0x54b0c5[_0xeb7c('0x35')]])[_0xeb7c('0x36')];return db['UserProfileResource'][_0xeb7c('0x37')]({'where':{'type':_0x187305,'resourceId':_0x54b0c5['id']}})[_0xeb7c('0x29')](function(){return _0x32c651;});})[_0xeb7c('0x29')](function(){_0x5789c0[_0xeb7c('0x1d')](0xcc)[_0xeb7c('0x38')]();});}};}function handleEntityNotFound(_0x1adc44,_0x1c2ad7){return function(_0x2904c3){if(!_0x2904c3){_0x1adc44['sendStatus'](0x194);}return _0x2904c3;};}function handleError(_0x2ba82d,_0x3bb240){_0x3bb240=_0x3bb240||0x1f4;return function(_0x36b26d){logger['error'](_0x36b26d['stack']);if(_0x36b26d[_0xeb7c('0x36')]){delete _0x36b26d[_0xeb7c('0x36')];}_0x2ba82d[_0xeb7c('0x1d')](_0x3bb240)[_0xeb7c('0x39')](_0x36b26d);};}exports['index']=function(_0x110759,_0x2eb493){var _0x54651f={},_0x399cef={},_0x1a0ce5={'count':0x0,'rows':[]};var _0x3349fe=_['map'](db[_0xeb7c('0x3a')][_0xeb7c('0x3b')],function(_0x51d975){return{'name':_0x51d975[_0xeb7c('0x3c')],'type':_0x51d975[_0xeb7c('0x35')][_0xeb7c('0x3d')]};});_0x399cef['model']=_[_0xeb7c('0x31')](_0x3349fe,_0xeb7c('0x36'));_0x399cef[_0xeb7c('0x3e')]=_['keys'](_0x110759[_0xeb7c('0x3e')]);_0x399cef['filters']=_['intersection'](_0x399cef[_0xeb7c('0x3f')],_0x399cef['query']);_0x54651f[_0xeb7c('0x40')]=_['intersection'](_0x399cef['model'],qs[_0xeb7c('0x41')](_0x110759[_0xeb7c('0x3e')][_0xeb7c('0x41')]));_0x54651f[_0xeb7c('0x40')]=_0x54651f['attributes'][_0xeb7c('0x42')]?_0x54651f[_0xeb7c('0x40')]:_0x399cef[_0xeb7c('0x3f')];if(!_0x110759[_0xeb7c('0x3e')][_0xeb7c('0x43')](_0xeb7c('0x44'))){_0x54651f[_0xeb7c('0x22')]=qs[_0xeb7c('0x22')](_0x110759[_0xeb7c('0x3e')][_0xeb7c('0x22')]);_0x54651f[_0xeb7c('0x1f')]=qs[_0xeb7c('0x1f')](_0x110759[_0xeb7c('0x3e')]['offset']);}_0x54651f['order']=qs[_0xeb7c('0x45')](_0x110759[_0xeb7c('0x3e')][_0xeb7c('0x45')]);_0x54651f[_0xeb7c('0x46')]=qs[_0xeb7c('0x47')](_['pick'](_0x110759[_0xeb7c('0x3e')],_0x399cef[_0xeb7c('0x47')]),_0x3349fe);if(_0x110759['query'][_0xeb7c('0x2f')]){_0x54651f[_0xeb7c('0x46')]=_[_0xeb7c('0x48')](_0x54651f['where'],{'$or':_[_0xeb7c('0x31')](_0x3349fe,function(_0x5383dc){if(_0x5383dc[_0xeb7c('0x35')]!=='VIRTUAL'){var _0xa5ae80={};_0xa5ae80[_0x5383dc['name']]={'$like':'%'+_0x110759[_0xeb7c('0x3e')][_0xeb7c('0x2f')]+'%'};return _0xa5ae80;}})});}_0x54651f=_[_0xeb7c('0x48')]({},_0x54651f,_0x110759[_0xeb7c('0x49')]);var _0x5b8c8e={'where':_0x54651f['where']};return db[_0xeb7c('0x3a')][_0xeb7c('0x21')](_0x5b8c8e)[_0xeb7c('0x29')](function(_0x34f238){_0x1a0ce5[_0xeb7c('0x21')]=_0x34f238;if(_0x110759[_0xeb7c('0x3e')]['includeAll']){_0x54651f[_0xeb7c('0x4a')]=[{'all':!![]}];}return db[_0xeb7c('0x3a')][_0xeb7c('0x4b')](_0x54651f);})[_0xeb7c('0x29')](function(_0x14f14c){_0x1a0ce5['rows']=_0x14f14c;return _0x1a0ce5;})[_0xeb7c('0x29')](respondWithFilteredResult(_0x2eb493,_0x54651f))[_0xeb7c('0x4c')](handleError(_0x2eb493,null));};exports[_0xeb7c('0x4d')]=function(_0x2af494,_0x4a1bd4){var _0x161669={'raw':![],'where':{'id':_0x2af494[_0xeb7c('0x4e')]['id']}},_0x4efba8={};_0x4efba8[_0xeb7c('0x3f')]=_[_0xeb7c('0x4f')](db[_0xeb7c('0x3a')][_0xeb7c('0x3b')]);_0x4efba8[_0xeb7c('0x3e')]=_[_0xeb7c('0x4f')](_0x2af494[_0xeb7c('0x3e')]);_0x4efba8[_0xeb7c('0x47')]=_[_0xeb7c('0x50')](_0x4efba8[_0xeb7c('0x3f')],_0x4efba8[_0xeb7c('0x3e')]);_0x161669[_0xeb7c('0x40')]=_[_0xeb7c('0x50')](_0x4efba8['model'],qs[_0xeb7c('0x41')](_0x2af494['query']['fields']));_0x161669[_0xeb7c('0x40')]=_0x161669[_0xeb7c('0x40')][_0xeb7c('0x42')]?_0x161669[_0xeb7c('0x40')]:_0x4efba8[_0xeb7c('0x3f')];if(_0x2af494[_0xeb7c('0x3e')][_0xeb7c('0x51')]){_0x161669[_0xeb7c('0x4a')]=[{'all':!![]}];}_0x161669=_[_0xeb7c('0x48')]({},_0x161669,_0x2af494[_0xeb7c('0x49')]);return db[_0xeb7c('0x3a')][_0xeb7c('0x34')](_0x161669)[_0xeb7c('0x29')](handleEntityNotFound(_0x4a1bd4,null))[_0xeb7c('0x29')](respondWithResult(_0x4a1bd4,null))[_0xeb7c('0x4c')](handleError(_0x4a1bd4,null));};exports[_0xeb7c('0x37')]=function(_0x590650,_0x1aa925){return db[_0xeb7c('0x3a')]['find']({'where':{'id':_0x590650[_0xeb7c('0x4e')]['id']}})[_0xeb7c('0x29')](handleEntityNotFound(_0x1aa925,null))['then'](removeEntity(_0x1aa925,null))[_0xeb7c('0x4c')](handleError(_0x1aa925,null));};exports[_0xeb7c('0x52')]=function(_0x50c239,_0x1848c3){if(_0x50c239[_0xeb7c('0x53')][_0xeb7c('0x35')]===_0xeb7c('0x2d')&&!_[_0xeb7c('0x54')](_0x50c239['body'][_0xeb7c('0x55')],'_')){_0x50c239[_0xeb7c('0x53')]['exten']='_'[_0xeb7c('0x56')](_0x50c239[_0xeb7c('0x53')][_0xeb7c('0x55')]);}return db[_0xeb7c('0x3a')][_0xeb7c('0x52')](_0x50c239[_0xeb7c('0x53')],{'raw':![]})['then'](function(_0x25b90c){var _0x21b376=_0x50c239['user'][_0xeb7c('0x2a')]({'plain':!![]});if(!_0x21b376)throw new Error(_0xeb7c('0x57'));if(_0x21b376['role']==='user'){var _0x41cc21=_0x25b90c[_0xeb7c('0x2a')]({'plain':!![]});var _0x358fe1=[{'name':_0xeb7c('0x58'),'value':_0xeb7c('0x2b')},{'name':_0xeb7c('0x2c'),'value':_0xeb7c('0x2d')},{'name':_0xeb7c('0x59'),'value':_0xeb7c('0x2e')}];var _0x23728d=_[_0xeb7c('0x34')](_0x358fe1,[_0xeb7c('0x32'),_0x41cc21[_0xeb7c('0x35')]])[_0xeb7c('0x36')];return db[_0xeb7c('0x5a')][_0xeb7c('0x34')]({'where':{'name':_0x23728d,'userProfileId':_0x21b376[_0xeb7c('0x5b')]},'raw':!![]})['then'](function(_0xd29aac){if(_0xd29aac&&_0xd29aac['autoAssociation']===0x0){return db['UserProfileResource'][_0xeb7c('0x52')]({'name':_0x41cc21[_0xeb7c('0x36')],'resourceId':_0x41cc21['id'],'type':_0xd29aac['name'],'sectionId':_0xd29aac['id']},{})[_0xeb7c('0x29')](function(){return _0x25b90c;});}else{return _0x25b90c;}})[_0xeb7c('0x4c')](function(_0xa037d1){logger[_0xeb7c('0x5c')](_0xeb7c('0x5d'),_0xa037d1);throw _0xa037d1;});}return _0x25b90c;})[_0xeb7c('0x29')](respondWithResult(_0x1848c3,0xc9))[_0xeb7c('0x4c')](handleError(_0x1848c3,null));};exports['update']=function(_0x45a8f2,_0x39e39f){if(_0x45a8f2[_0xeb7c('0x53')]['id']){delete _0x45a8f2[_0xeb7c('0x53')]['id'];}return db[_0xeb7c('0x3a')][_0xeb7c('0x34')]({'where':{'id':_0x45a8f2[_0xeb7c('0x4e')]['id']}})[_0xeb7c('0x29')](handleEntityNotFound(_0x39e39f,null))[_0xeb7c('0x29')](function(_0xecaefd){if(_0xecaefd){return db[_0xeb7c('0x3a')]['update'](_['pick'](_0x45a8f2[_0xeb7c('0x53')],['exten',_0xeb7c('0x5e'),_0xeb7c('0x5f'),'recordingFormat','cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0xecaefd[_0xeb7c('0x5e')],'exten':_0xecaefd[_0xeb7c('0x55')]},'individualHooks':!![]})[_0xeb7c('0x29')](function(_0x138d67){return _0x138d67;});}return null;})[_0xeb7c('0x29')](respondWithStatusCode(_0x39e39f,null))[_0xeb7c('0x4c')](handleError(_0x39e39f,null));};exports['addApplications']=function(_0x2b7320,_0x49f50a){return db[_0xeb7c('0x3a')][_0xeb7c('0x60')]({'where':{'id':_0x2b7320[_0xeb7c('0x4e')]['id']}})['then'](function(_0x4c8d0c){if(_0x4c8d0c){return db[_0xeb7c('0x61')][_0xeb7c('0x62')](function(_0x367022){return db[_0xeb7c('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x2b7320[_0xeb7c('0x4e')]['id']},'transaction':_0x367022})['then'](function(){var _0x108a65=_[_0xeb7c('0x31')](_0x2b7320['body'],function(_0x1c4681){_0x1c4681[_0xeb7c('0x63')]=_0x2b7320[_0xeb7c('0x4e')]['id'];_0x1c4681[_0xeb7c('0x64')]=!![];return _0x1c4681;});var _0x250422=_0x2b7320[_0xeb7c('0x3e')][_0xeb7c('0x65')]&&_0x2b7320[_0xeb7c('0x3e')][_0xeb7c('0x65')]['toLowerCase']()===_0xeb7c('0x66')?!![]:![];return _0x4c8d0c[_0xeb7c('0x67')](_0x108a65,_0x250422);})['then'](function(_0x412937){return db[_0xeb7c('0x3a')][_0xeb7c('0x68')](_0x412937,{'transaction':_0x367022});});})['then'](function(){return db[_0xeb7c('0x3a')][_0xeb7c('0x69')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2b7320[_0xeb7c('0x4e')]['id']},'order':_0xeb7c('0x6a')});});}})['then'](respondWithResult(_0x49f50a,null))[_0xeb7c('0x4c')](handleError(_0x49f50a,null));}; \ No newline at end of file +var _0x1e0b=['count','status','set','Content-Range','reject','save','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','type','find','value','name','UserProfileResource','end','stack','send','index','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','body','exten','concat','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','alias','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','json','offset','undefined','limit'];(function(_0x25b44b,_0x424310){var _0x31a576=function(_0x13176d){while(--_0x13176d){_0x25b44b['push'](_0x25b44b['shift']());}};_0x31a576(++_0x424310);}(_0x1e0b,0x120));var _0xb1e0=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x1e0b[_0x3fe393];return _0x534d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1e0('0x0'));var zipdir=require(_0xb1e0('0x1'));var jsonpatch=require(_0xb1e0('0x2'));var rp=require(_0xb1e0('0x3'));var moment=require(_0xb1e0('0x4'));var BPromise=require(_0xb1e0('0x5'));var Mustache=require(_0xb1e0('0x6'));var util=require(_0xb1e0('0x7'));var path=require(_0xb1e0('0x8'));var sox=require('sox');var csv=require(_0xb1e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb1e0('0xb'));var toCsv=require(_0xb1e0('0x9'));var querystring=require(_0xb1e0('0xc'));var Papa=require(_0xb1e0('0xd'));var Redis=require('ioredis');var authService=require(_0xb1e0('0xe'));var qs=require(_0xb1e0('0xf'));var as=require(_0xb1e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb1e0('0x11'));var utils=require(_0xb1e0('0x12'));var config=require(_0xb1e0('0x13'));var licenseUtil=require(_0xb1e0('0x14'));var db=require(_0xb1e0('0x15'))['db'];config[_0xb1e0('0x16')]=_[_0xb1e0('0x17')](config[_0xb1e0('0x16')],{'host':_0xb1e0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb1e0('0x16')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x2c6583,_0x413032){_0x413032=_0x413032||0xcc;return function(_0x3dd5d1){if(_0x3dd5d1){return _0x2c6583[_0xb1e0('0x19')](_0x413032);}return _0x2c6583['status'](_0x413032)['end']();};}function respondWithResult(_0x30ca36,_0x36484d){_0x36484d=_0x36484d||0xc8;return function(_0x4bac51){if(_0x4bac51){return _0x30ca36['status'](_0x36484d)[_0xb1e0('0x1a')](_0x4bac51);}};}function respondWithFilteredResult(_0x33b6c8,_0xb65fc0){return function(_0x32a3e2){if(_0x32a3e2){var _0x206323=typeof _0xb65fc0[_0xb1e0('0x1b')]===_0xb1e0('0x1c')&&typeof _0xb65fc0[_0xb1e0('0x1d')]==='undefined';var _0x146a0f=_0x32a3e2[_0xb1e0('0x1e')];var _0x2f91b1=_0x206323?0x0:_0xb65fc0[_0xb1e0('0x1b')];var _0x3ec328=_0x206323?_0x32a3e2[_0xb1e0('0x1e')]:_0xb65fc0[_0xb1e0('0x1b')]+_0xb65fc0[_0xb1e0('0x1d')];var _0x481a44;if(_0x3ec328>=_0x146a0f){_0x3ec328=_0x146a0f;_0x481a44=0xc8;}else{_0x481a44=0xce;}_0x33b6c8[_0xb1e0('0x1f')](_0x481a44);return _0x33b6c8[_0xb1e0('0x20')](_0xb1e0('0x21'),_0x2f91b1+'-'+_0x3ec328+'/'+_0x146a0f)['json'](_0x32a3e2);}return null;};}function patchUpdates(_0x1ea0fb){return function(_0x11d431){try{jsonpatch['apply'](_0x11d431,_0x1ea0fb,!![]);}catch(_0x5a1c9b){return BPromise[_0xb1e0('0x22')](_0x5a1c9b);}return _0x11d431[_0xb1e0('0x23')]();};}function saveUpdates(_0x1f2723,_0x2d0c32){return function(_0x8d8360){if(_0x8d8360){return _0x8d8360['update'](_0x1f2723)['then'](function(_0xca92be){return _0xca92be;});}return null;};}function removeEntity(_0x531025,_0x18e948){return function(_0x12218c){if(_0x12218c){return _0x12218c[_0xb1e0('0x24')]()[_0xb1e0('0x25')](function(){var _0x5c9d81=_0x12218c[_0xb1e0('0x26')]({'plain':!![]});var _0xdf5360=[{'name':_0xb1e0('0x27'),'value':_0xb1e0('0x28'),'ignore':![]},{'name':_0xb1e0('0x29'),'value':_0xb1e0('0x2a'),'ignore':![]},{'name':_0xb1e0('0x2b'),'value':_0xb1e0('0x2c'),'ignore':![]}];var _0x38540b=_(_0xdf5360)['filter'](_0xb1e0('0x2d'))[_0xb1e0('0x2e')]('value')['value']();if(_['includes'](_0x38540b,_0x5c9d81[_0xb1e0('0x2f')])){return;}var _0x29e3f5=_[_0xb1e0('0x30')](_0xdf5360,[_0xb1e0('0x31'),_0x5c9d81[_0xb1e0('0x2f')]])[_0xb1e0('0x32')];return db[_0xb1e0('0x33')][_0xb1e0('0x24')]({'where':{'type':_0x29e3f5,'resourceId':_0x5c9d81['id']}})['then'](function(){return _0x12218c;});})[_0xb1e0('0x25')](function(){_0x531025[_0xb1e0('0x1f')](0xcc)[_0xb1e0('0x34')]();});}};}function handleEntityNotFound(_0x22f55f,_0x2ea840){return function(_0x1ce323){if(!_0x1ce323){_0x22f55f[_0xb1e0('0x19')](0x194);}return _0x1ce323;};}function handleError(_0x191a9c,_0x5cfe04){_0x5cfe04=_0x5cfe04||0x1f4;return function(_0x1c2646){logger['error'](_0x1c2646[_0xb1e0('0x35')]);if(_0x1c2646[_0xb1e0('0x32')]){delete _0x1c2646[_0xb1e0('0x32')];}_0x191a9c[_0xb1e0('0x1f')](_0x5cfe04)[_0xb1e0('0x36')](_0x1c2646);};}exports[_0xb1e0('0x37')]=function(_0xce7fb9,_0x301dc6){var _0x48cdad={},_0x100248={},_0x1add36={'count':0x0,'rows':[]};var _0x1a0bb2=_[_0xb1e0('0x2e')](db['VoiceExtension'][_0xb1e0('0x38')],function(_0x3fa358){return{'name':_0x3fa358[_0xb1e0('0x39')],'type':_0x3fa358[_0xb1e0('0x2f')][_0xb1e0('0x3a')]};});_0x100248[_0xb1e0('0x3b')]=_[_0xb1e0('0x2e')](_0x1a0bb2,_0xb1e0('0x32'));_0x100248[_0xb1e0('0x3c')]=_[_0xb1e0('0x3d')](_0xce7fb9[_0xb1e0('0x3c')]);_0x100248['filters']=_['intersection'](_0x100248[_0xb1e0('0x3b')],_0x100248[_0xb1e0('0x3c')]);_0x48cdad[_0xb1e0('0x3e')]=_['intersection'](_0x100248[_0xb1e0('0x3b')],qs[_0xb1e0('0x3f')](_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x3f')]));_0x48cdad[_0xb1e0('0x3e')]=_0x48cdad['attributes'][_0xb1e0('0x40')]?_0x48cdad[_0xb1e0('0x3e')]:_0x100248['model'];if(!_0xce7fb9['query'][_0xb1e0('0x41')](_0xb1e0('0x42'))){_0x48cdad[_0xb1e0('0x1d')]=qs['limit'](_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x1d')]);_0x48cdad['offset']=qs[_0xb1e0('0x1b')](_0xce7fb9[_0xb1e0('0x3c')]['offset']);}_0x48cdad['order']=qs['sort'](_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x43')]);_0x48cdad[_0xb1e0('0x44')]=qs[_0xb1e0('0x45')](_[_0xb1e0('0x46')](_0xce7fb9[_0xb1e0('0x3c')],_0x100248['filters']),_0x1a0bb2);if(_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x47')]){_0x48cdad['where']=_['merge'](_0x48cdad['where'],{'$or':_['map'](_0x1a0bb2,function(_0x58a832){if(_0x58a832[_0xb1e0('0x2f')]!==_0xb1e0('0x48')){var _0x526113={};_0x526113[_0x58a832['name']]={'$like':'%'+_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x47')]+'%'};return _0x526113;}})});}_0x48cdad=_[_0xb1e0('0x49')]({},_0x48cdad,_0xce7fb9[_0xb1e0('0x4a')]);var _0x40df02={'where':_0x48cdad[_0xb1e0('0x44')]};return db[_0xb1e0('0x4b')][_0xb1e0('0x1e')](_0x40df02)[_0xb1e0('0x25')](function(_0x48e961){_0x1add36[_0xb1e0('0x1e')]=_0x48e961;if(_0xce7fb9[_0xb1e0('0x3c')][_0xb1e0('0x4c')]){_0x48cdad[_0xb1e0('0x4d')]=[{'all':!![]}];}return db[_0xb1e0('0x4b')][_0xb1e0('0x4e')](_0x48cdad);})['then'](function(_0x41995b){_0x1add36[_0xb1e0('0x4f')]=_0x41995b;return _0x1add36;})[_0xb1e0('0x25')](respondWithFilteredResult(_0x301dc6,_0x48cdad))[_0xb1e0('0x50')](handleError(_0x301dc6,null));};exports[_0xb1e0('0x51')]=function(_0x2cb22a,_0xf81a43){var _0x3575f6={'raw':![],'where':{'id':_0x2cb22a[_0xb1e0('0x52')]['id']}},_0x239a89={};_0x239a89[_0xb1e0('0x3b')]=_[_0xb1e0('0x3d')](db[_0xb1e0('0x4b')][_0xb1e0('0x38')]);_0x239a89['query']=_['keys'](_0x2cb22a[_0xb1e0('0x3c')]);_0x239a89[_0xb1e0('0x45')]=_['intersection'](_0x239a89['model'],_0x239a89[_0xb1e0('0x3c')]);_0x3575f6['attributes']=_['intersection'](_0x239a89['model'],qs[_0xb1e0('0x3f')](_0x2cb22a[_0xb1e0('0x3c')]['fields']));_0x3575f6[_0xb1e0('0x3e')]=_0x3575f6[_0xb1e0('0x3e')][_0xb1e0('0x40')]?_0x3575f6[_0xb1e0('0x3e')]:_0x239a89[_0xb1e0('0x3b')];if(_0x2cb22a[_0xb1e0('0x3c')][_0xb1e0('0x4c')]){_0x3575f6['include']=[{'all':!![]}];}_0x3575f6=_[_0xb1e0('0x49')]({},_0x3575f6,_0x2cb22a[_0xb1e0('0x4a')]);return db['VoiceExtension']['find'](_0x3575f6)['then'](handleEntityNotFound(_0xf81a43,null))[_0xb1e0('0x25')](respondWithResult(_0xf81a43,null))[_0xb1e0('0x50')](handleError(_0xf81a43,null));};exports[_0xb1e0('0x24')]=function(_0x438d3a,_0x76c7f7){return db[_0xb1e0('0x4b')]['find']({'where':{'id':_0x438d3a['params']['id']}})[_0xb1e0('0x25')](handleEntityNotFound(_0x76c7f7,null))[_0xb1e0('0x25')](removeEntity(_0x76c7f7,null))[_0xb1e0('0x50')](handleError(_0x76c7f7,null));};exports['create']=function(_0x22a73b,_0x353d64){if(_0x22a73b[_0xb1e0('0x53')][_0xb1e0('0x2f')]===_0xb1e0('0x2a')&&!_['startsWith'](_0x22a73b['body'][_0xb1e0('0x54')],'_')){_0x22a73b['body'][_0xb1e0('0x54')]='_'[_0xb1e0('0x55')](_0x22a73b[_0xb1e0('0x53')][_0xb1e0('0x54')]);}return db[_0xb1e0('0x4b')]['create'](_0x22a73b[_0xb1e0('0x53')],{'raw':![]})[_0xb1e0('0x25')](function(_0x5cb26f){var _0x529dd9=_0x22a73b[_0xb1e0('0x56')][_0xb1e0('0x26')]({'plain':!![]});if(!_0x529dd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x529dd9[_0xb1e0('0x57')]===_0xb1e0('0x56')){var _0x103d4d=_0x5cb26f['get']({'plain':!![]});var _0x31a21a=[{'name':_0xb1e0('0x27'),'value':_0xb1e0('0x28')},{'name':_0xb1e0('0x29'),'value':'outbound'},{'name':_0xb1e0('0x2b'),'value':_0xb1e0('0x2c')}];var _0x4894b2=_['find'](_0x31a21a,['value',_0x103d4d[_0xb1e0('0x2f')]])['name'];return db[_0xb1e0('0x58')][_0xb1e0('0x30')]({'where':{'name':_0x4894b2,'userProfileId':_0x529dd9[_0xb1e0('0x59')]},'raw':!![]})[_0xb1e0('0x25')](function(_0x3572e0){if(_0x3572e0&&_0x3572e0['autoAssociation']===0x0){return db[_0xb1e0('0x33')][_0xb1e0('0x5a')]({'name':_0x103d4d['name'],'resourceId':_0x103d4d['id'],'type':_0x3572e0[_0xb1e0('0x32')],'sectionId':_0x3572e0['id']},{})[_0xb1e0('0x25')](function(){return _0x5cb26f;});}else{return _0x5cb26f;}})[_0xb1e0('0x50')](function(_0x5a5ff7){logger['error'](_0xb1e0('0x5b'),_0x5a5ff7);throw _0x5a5ff7;});}return _0x5cb26f;})[_0xb1e0('0x25')](respondWithResult(_0x353d64,0xc9))[_0xb1e0('0x50')](handleError(_0x353d64,null));};exports[_0xb1e0('0x5c')]=function(_0x4bd1f4,_0x48098e){if(_0x4bd1f4[_0xb1e0('0x53')]['id']){delete _0x4bd1f4['body']['id'];}return db['VoiceExtension'][_0xb1e0('0x30')]({'where':{'id':_0x4bd1f4[_0xb1e0('0x52')]['id']}})[_0xb1e0('0x25')](handleEntityNotFound(_0x48098e,null))[_0xb1e0('0x25')](function(_0x58ba70){if(_0x58ba70){return db[_0xb1e0('0x4b')][_0xb1e0('0x5c')](_['pick'](_0x4bd1f4['body'],[_0xb1e0('0x54'),_0xb1e0('0x5d'),'description',_0xb1e0('0x5e'),'cutdigits','mandatoryDisposition',_0xb1e0('0x5f')]),{'where':{'context':_0x58ba70['context'],'exten':_0x58ba70['exten']},'individualHooks':!![]})[_0xb1e0('0x25')](function(_0x56efb4){return _0x56efb4;});}return null;})[_0xb1e0('0x25')](respondWithStatusCode(_0x48098e,null))[_0xb1e0('0x50')](handleError(_0x48098e,null));};exports['addApplications']=function(_0xc3070,_0x11e64e){return db['VoiceExtension'][_0xb1e0('0x60')]({'where':{'id':_0xc3070[_0xb1e0('0x52')]['id']}})['then'](function(_0x3b9bdb){if(_0x3b9bdb){return db[_0xb1e0('0x61')][_0xb1e0('0x62')](function(_0x58dfcf){return db[_0xb1e0('0x4b')][_0xb1e0('0x24')]({'where':{'VoiceExtensionId':_0xc3070[_0xb1e0('0x52')]['id']},'transaction':_0x58dfcf})['then'](function(){var _0x17b4c4=_[_0xb1e0('0x2e')](_0xc3070[_0xb1e0('0x53')],function(_0x476830){_0x476830[_0xb1e0('0x63')]=_0xc3070[_0xb1e0('0x52')]['id'];_0x476830['isApp']=!![];return _0x476830;});var _0x288bec=_0xc3070[_0xb1e0('0x3c')][_0xb1e0('0x64')]&&_0xc3070[_0xb1e0('0x3c')][_0xb1e0('0x64')]['toLowerCase']()===_0xb1e0('0x65')?!![]:![];return _0x3b9bdb[_0xb1e0('0x66')](_0x17b4c4,_0x288bec);})[_0xb1e0('0x25')](function(_0x56efc7){return db[_0xb1e0('0x4b')][_0xb1e0('0x67')](_0x56efc7,{'transaction':_0x58dfcf});});})['then'](function(){return db[_0xb1e0('0x4b')][_0xb1e0('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0xc3070[_0xb1e0('0x52')]['id']},'order':_0xb1e0('0x69')});});}})['then'](respondWithResult(_0x11e64e,null))[_0xb1e0('0x50')](handleError(_0x11e64e,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a579b50..7ab897a 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 _0x3c73=['exports','events','VoiceExtension','save','update','emit','hasOwnProperty'];(function(_0x48ebde,_0x5fd9ad){var _0x5723e1=function(_0x29ca1b){while(--_0x29ca1b){_0x48ebde['push'](_0x48ebde['shift']());}};_0x5723e1(++_0x5fd9ad);}(_0x3c73,0xd3));var _0x33c7=function(_0x508a8a,_0x372931){_0x508a8a=_0x508a8a-0x0;var _0x13e09a=_0x3c73[_0x508a8a];return _0x13e09a;};'use strict';var EventEmitter=require(_0x33c7('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x33c7('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x33c7('0x2'),'afterUpdate':_0x33c7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5182d8){return function(_0xe18603,_0x4667e0,_0x2cb914){VoiceExtensionEvents['emit'](_0x5182d8+':'+_0xe18603['id'],_0xe18603);VoiceExtensionEvents[_0x33c7('0x4')](_0x5182d8,_0xe18603);_0x2cb914(null);};}for(var e in events){if(events[_0x33c7('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x33c7('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xac49=['hasOwnProperty','hook','exports','events','VoiceExtension','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac49,0x133));var _0x9ac4=function(_0x4c89b3,_0xe78b59){_0x4c89b3=_0x4c89b3-0x0;var _0x5eaa7a=_0xac49[_0x4c89b3];return _0x5eaa7a;};'use strict';var EventEmitter=require(_0x9ac4('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x9ac4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ac4('0x2'),'afterUpdate':_0x9ac4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x52cc1e){return function(_0x4b5c0c,_0x28e59a,_0xcac00e){VoiceExtensionEvents[_0x9ac4('0x4')](_0x52cc1e+':'+_0x4b5c0c['id'],_0x4b5c0c);VoiceExtensionEvents[_0x9ac4('0x4')](_0x52cc1e,_0x4b5c0c);_0xcac00e(null);};}for(var e in events){if(events[_0x9ac4('0x5')](e)){var event=events[e];VoiceExtension[_0x9ac4('0x6')](e,emitEvent(event));}}module[_0x9ac4('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f09c7de..9abd903 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 _0x7b72=['priority','last','VoiceExtension','concat','Hangup','util','lodash','models','type','Set','CDR(type)=','exten','NoOp','alias','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','split','name','param','phone','prefix','SIP','join','none','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','length','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7b72,0xfe));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x27b7('0x0'));var _=require(_0x27b7('0x1'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x80c95f){var _0x18cd1b=_0x80c95f[_0x27b7('0x2')];function _0xa6c632(_0x2933ef){var _0x4d4a53=0x2;var _0xfa0377=[{'type':_0x2933ef[_0x27b7('0x3')],'app':_0x27b7('0x4'),'appdata':_0x27b7('0x5')+_0x2933ef['type'],'context':_0x2933ef['context'],'exten':_0x2933ef[_0x27b7('0x6')],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']},{'type':_0x2933ef[_0x27b7('0x3')],'app':_0x2933ef['alias']?_0x27b7('0x4'):_0x27b7('0x7'),'appdata':_0x2933ef[_0x27b7('0x8')]?'CDR(routeAlias)='+_0x2933ef['alias']:_0x27b7('0x9'),'context':_0x2933ef[_0x27b7('0xa')],'exten':_0x2933ef[_0x27b7('0x6')],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']}];if(_0x2933ef[_0x27b7('0x3')]===_0x27b7('0xb')){_0xfa0377[_0x27b7('0xc')]({'type':'inbound','app':'Set','appdata':_0x27b7('0xd')+_0x2933ef['id'],'context':_0x2933ef['context'],'exten':_0x2933ef[_0x27b7('0x6')],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']});}_0xfa0377['push']({'type':_0x2933ef[_0x27b7('0x3')],'app':'Set','appdata':_0x27b7('0xe'),'context':_0x2933ef['context'],'exten':_0x2933ef[_0x27b7('0x6')],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']},{'type':_0x2933ef['type'],'app':_0x27b7('0x4'),'appdata':_0x27b7('0xf'),'context':_0x2933ef[_0x27b7('0xa')],'exten':_0x2933ef['exten'],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']},{'type':_0x2933ef[_0x27b7('0x3')],'app':_0x27b7('0x4'),'appdata':_0x27b7('0x10'),'context':_0x2933ef[_0x27b7('0xa')],'exten':_0x2933ef[_0x27b7('0x6')],'priority':_0x4d4a53++,'VoiceExtensionId':_0x2933ef['id']});return _0xfa0377;}function _0x50aad4(_0xfb376){var _0x1e5919=0x2;var _0xd7fafd=[{'type':_0x27b7('0x11'),'app':'Set','appdata':_0x27b7('0x12'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0xfb376[_0x27b7('0x8')]?_0x27b7('0x4'):'NoOp','appdata':_0xfb376['alias']?_0x27b7('0x13')+_0xfb376['alias']:_0x27b7('0x9'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x14')+(_0xfb376['cutdigits']?_0x27b7('0x15')+_0xfb376[_0x27b7('0x16')]+'}':_0x27b7('0x17')),'context':_0xfb376['context'],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0xd')+_0xfb376['id'],'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':'outbound','app':_0x27b7('0x18'),'appdata':_0x27b7('0x19')+(_0x1e5919+0x2)+_0x27b7('0x1a')+(_0x1e5919+0x1)+')','context':_0xfb376['context'],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0xfb376[_0x27b7('0x16')]?'CDR(prefix)=${EXTEN:0:'+_0xfb376[_0x27b7('0x16')]+'}':_0x27b7('0x1b'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0xe'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0xf'),'context':_0xfb376['context'],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x10'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x1c')+_0xfb376['id'],'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']}];if(_0xfb376[_0x27b7('0x1d')]('recordingFormat')&&_0xfb376['recordingFormat']!=='none'){_0xd7fafd[_0x27b7('0xc')]({'type':'outbound','app':_0x27b7('0x4'),'appdata':_0x27b7('0x1e'),'context':_0xfb376['context'],'exten':_0xfb376[_0x27b7('0x6')],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']},{'type':_0x27b7('0x11'),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x1f')+_0xfb376[_0x27b7('0x20')]||_0x27b7('0x21'),'context':_0xfb376[_0x27b7('0xa')],'exten':_0xfb376['exten'],'priority':_0x1e5919++,'VoiceExtensionId':_0xfb376['id']});}return _0xd7fafd;}function _0x532d09(_0x1ecc0c){var _0x3bdd34=[{'name':_0x27b7('0x22'),'param':0x0},{'name':_0x27b7('0x23'),'param':0x1},{'name':_0x27b7('0x24'),'param':0x2},{'name':'url','param':0x3}];var _0x512b89={};var _0x2716b9=_0x1ecc0c[_0x27b7('0x25')](',');var _0x13e63b=[];for(var _0x525f3f=0x0;_0x525f3f<_0x3bdd34['length'];_0x525f3f++){switch(_0x3bdd34[_0x525f3f][_0x27b7('0x26')]){case _0x27b7('0x22'):_0x512b89[_0x27b7('0x22')]=_0x2716b9[_0x3bdd34[_0x525f3f][_0x27b7('0x27')]][_0x27b7('0x25')]('/')[0x1];_0x512b89[_0x27b7('0x28')]=_0x2716b9[_0x3bdd34[_0x525f3f][_0x27b7('0x27')]]['split']('/')[0x2];_0x512b89[_0x27b7('0x29')]=_0x512b89['phone']?_0x512b89['phone'][_0x27b7('0x25')]('$')[0x0]:undefined;_0x512b89[_0x27b7('0x28')]=route[_0x27b7('0x16')]?(_0x512b89[_0x27b7('0x29')]||'')+_0x27b7('0x15')+route[_0x27b7('0x16')]+'}':(_0x512b89[_0x27b7('0x29')]||'')+'${EXTEN}';_0x13e63b[_0x3bdd34[_0x525f3f][_0x27b7('0x27')]]=[_0x27b7('0x2a'),_0x512b89[_0x27b7('0x22')],_0x512b89['phone']][_0x27b7('0x2b')]('/');break;case _0x27b7('0x24'):_0x512b89[_0x27b7('0x24')]=_0x2716b9[_0x3bdd34[_0x525f3f]['param']];if(route['recordingFormat']!==_0x27b7('0x2c')){if(_0x512b89[_0x27b7('0x24')]['indexOf'](_0x27b7('0x2d'))<0x0){_0x512b89[_0x27b7('0x24')]+=_0x27b7('0x2d');}}else{_0x512b89[_0x27b7('0x24')]=_0x512b89[_0x27b7('0x24')][_0x27b7('0x2e')](_0x27b7('0x2d'),'');}_0x13e63b[_0x3bdd34[_0x525f3f][_0x27b7('0x27')]]=_0x512b89[_0x27b7('0x24')];break;default:_0x13e63b[_0x3bdd34[_0x525f3f]['param']]=_0x2716b9[_0x3bdd34[_0x525f3f][_0x27b7('0x27')]];}}return _0x13e63b[_0x27b7('0x2b')](',');}function _0x172704(_0x460409,_0x3bff03,_0x20d595,_0x3796f7){return new Promise(function(_0x5e1eed,_0x2b40e5){var _0x2f59e5=[];if(_[_0x27b7('0x2f')](_0x3bff03))return _0x5e1eed(_0x2f59e5);_0x18cd1b[_0x27b7('0x30')][_0x27b7('0x31')]({'attributes':['id',_0x27b7('0x32'),_0x27b7('0x33')],'raw':!![]})[_0x27b7('0x34')](function(_0x3de8bd){for(var _0x1b8243=0x0,_0x2950fd=0x0;_0x1b8243<_0x3bff03[_0x27b7('0x35')];_0x1b8243++,_0x2950fd=0x0){var _0x576080=_0x3bff03[_0x1b8243];var _0x42a8b7=[];var _0x1cbc6c=[];if(_0x576080[_0x27b7('0x32')]!=='*,*,*,*'){_0x576080[_0x27b7('0x36')]=[_0x576080[_0x27b7('0x32')]];}else{_0x576080[_0x27b7('0x36')]=_0x576080[_0x27b7('0x33')]?_[_0x27b7('0x37')](_['filter'](_0x3de8bd,{'IntervalId':_0x576080[_0x27b7('0x33')]}),_0x27b7('0x32')):[];}_0x576080[_0x27b7('0xa')]=_0x460409[_0x27b7('0xa')];_0x576080[_0x27b7('0x6')]=_0x460409[_0x27b7('0x6')];if(_0x576080[_0x27b7('0x3')])_0x576080[_0x27b7('0x3')]=_0x576080[_0x27b7('0x3')][_0x27b7('0x38')]();if(_0x460409[_0x27b7('0x3')]===_0x27b7('0x11')){if(_0x576080['hasOwnProperty'](_0x27b7('0x39'))&&_0x576080['tag']&&_0x576080['tag']!=='--'){_0x42a8b7[_0x27b7('0xc')]({'type':_0x576080[_0x27b7('0x3')][_0x27b7('0x38')](),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x3a')+_0x576080['tag'],'context':_0x460409[_0x27b7('0xa')],'exten':_0x460409[_0x27b7('0x6')],'priority':_0x576080['intervals'][_0x27b7('0x35')]+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});}_0x42a8b7['push']({'type':_0x576080[_0x27b7('0x3')]['toLowerCase'](),'app':_0x27b7('0x18'),'appdata':_0x27b7('0x3b')+(_0x576080[_0x27b7('0x3c')]?_0x27b7('0x3d')+_0x576080[_0x27b7('0x3c')]+')':_0x27b7('0x3e')),'context':_0x460409[_0x27b7('0xa')],'exten':_0x460409[_0x27b7('0x6')],'priority':_0x576080[_0x27b7('0x36')][_0x27b7('0x35')]+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});}else{if(_0x576080[_0x27b7('0x1d')]('answer')){if([_0x27b7('0x3f'),_0x27b7('0x40')][_0x27b7('0x41')](_0x576080[_0x27b7('0x42')][_0x27b7('0x38')]())&&_0x576080[_0x27b7('0x43')]!==_0x27b7('0x44')){if(_0x576080[_0x27b7('0x45')]){_0x42a8b7[_0x27b7('0xc')]({'type':_0x576080['type'][_0x27b7('0x38')](),'app':_0x27b7('0x18'),'appdata':_0x27b7('0x46'),'context':_0x460409['context'],'exten':_0x460409[_0x27b7('0x6')],'priority':_0x576080[_0x27b7('0x36')][_0x27b7('0x35')]+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});_0x42a8b7[_0x27b7('0xc')]({'type':_0x576080[_0x27b7('0x3')][_0x27b7('0x38')](),'app':'Set','appdata':_0x27b7('0x47'),'context':_0x460409['context'],'exten':_0x460409['exten'],'priority':_0x576080[_0x27b7('0x36')]['length']+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});}else{_0x42a8b7[_0x27b7('0xc')]({'type':_0x576080['type']['toLowerCase'](),'app':_0x27b7('0x18'),'appdata':_0x27b7('0x48'),'context':_0x460409[_0x27b7('0xa')],'exten':_0x460409[_0x27b7('0x6')],'priority':_0x576080[_0x27b7('0x36')][_0x27b7('0x35')]+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});_0x42a8b7[_0x27b7('0xc')]({'type':_0x576080[_0x27b7('0x3')][_0x27b7('0x38')](),'app':_0x27b7('0x4'),'appdata':_0x27b7('0x49'),'context':_0x460409[_0x27b7('0xa')],'exten':_0x460409[_0x27b7('0x6')],'priority':_0x576080['intervals'][_0x27b7('0x35')]+_0x20d595+_0x2950fd++,'VoiceExtensionId':_0x460409['id']});}}}}for(var _0x55178b=0x0;_0x55178b<_0x576080[_0x27b7('0x36')]['length'];_0x55178b++){var _0x2e19cb=_0x20d595+_0x576080['intervals'][_0x27b7('0x35')];var _0x4d65ae=_0x55178b===_0x576080[_0x27b7('0x36')][_0x27b7('0x35')]-0x1?_0x20d595+_0x42a8b7['length']+_0x1cbc6c[_0x27b7('0x35')]+0x2:_0x20d595+_0x55178b+0x1;_0x42a8b7['splice'](_0x55178b,0x0,{'type':_0x460409['type'],'app':_0x27b7('0x4a'),'appdata':_0x576080['intervals'][_0x55178b]+'?'+_0x460409[_0x27b7('0xa')]+_0x27b7('0x4b')+_0x2e19cb+':'+_0x460409[_0x27b7('0xa')]+',${EXTEN},'+_0x4d65ae,'exten':_0x460409[_0x27b7('0x6')],'context':_0x460409[_0x27b7('0xa')],'priority':_0x20d595+_0x55178b,'VoiceExtensionId':_0x460409['id']});}if(_0x3796f7&&_0x576080[_0x27b7('0x43')]===_0x27b7('0x4c'))_0x576080[_0x27b7('0x4d')]=_0x532d09(_0x576080[_0x27b7('0x4d')]);_0x576080[_0x27b7('0x4e')]=_0x42a8b7[_0x27b7('0x35')]?_['last'](_0x42a8b7)[_0x27b7('0x4e')]+0x1:_0x20d595;_0x2f59e5=_['concat'](_0x2f59e5,_0x42a8b7,[_0x576080],_0x1cbc6c);_0x20d595=_[_0x27b7('0x4f')](_0x2f59e5)[_0x27b7('0x4e')]+0x1;}return _0x5e1eed(_0x2f59e5);})['catch'](function(_0x2116da){_0x2b40e5(_0x2116da);});});}return _0x80c95f['define'](_0x27b7('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x434818,_0xaa5eb3){var _0x2ce710=this;var _0x1087af=_0x2ce710['type']===_0x27b7('0x11')?_0x50aad4(_0x2ce710):_0xa6c632(_0x2ce710);return _0x172704(_0x2ce710,_0x434818,_[_0x27b7('0x4f')](_0x1087af)[_0x27b7('0x4e')]+0x1,_0xaa5eb3)[_0x27b7('0x34')](function(_0x24c9d4){var _0x1e6eb5=_[_0x27b7('0x51')](_0x1087af,_0x24c9d4);_0x1e6eb5[_0x27b7('0xc')]({'type':_0x2ce710[_0x27b7('0x3')],'app':_0x27b7('0x52'),'exten':_0x2ce710[_0x27b7('0x6')],'context':_0x2ce710[_0x27b7('0xa')],'priority':_['last'](_0x1e6eb5)[_0x27b7('0x4e')]+0x1,'VoiceExtensionId':_0x2ce710['id']});return _0x1e6eb5;});}}});}; \ No newline at end of file +var _0xeb76=[',${EXTEN},','appType','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','concat','Hangup','util','exports','models','Set','type','context','exten','NoOp','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','url','split','length','param','phone','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb76,0x1f1));var _0x6eb7=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xeb76[_0x2cf2e9];return _0xd3670d;};'use strict';var util=require(_0x6eb7('0x0'));var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x6eb7('0x1')]=function(_0x3a1b53){var _0x479dad=_0x3a1b53[_0x6eb7('0x2')];function _0xd2bccb(_0x395578){var _0x133a0d=0x2;var _0x2cb29d=[{'type':_0x395578['type'],'app':_0x6eb7('0x3'),'appdata':'CDR(type)='+_0x395578[_0x6eb7('0x4')],'context':_0x395578[_0x6eb7('0x5')],'exten':_0x395578[_0x6eb7('0x6')],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']},{'type':_0x395578[_0x6eb7('0x4')],'app':_0x395578['alias']?_0x6eb7('0x3'):_0x6eb7('0x7'),'appdata':_0x395578[_0x6eb7('0x8')]?'CDR(routeAlias)='+_0x395578['alias']:_0x6eb7('0x9'),'context':_0x395578[_0x6eb7('0x5')],'exten':_0x395578['exten'],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']}];if(_0x395578[_0x6eb7('0x4')]===_0x6eb7('0xa')){_0x2cb29d[_0x6eb7('0xb')]({'type':_0x6eb7('0xa'),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0xc')+_0x395578['id'],'context':_0x395578['context'],'exten':_0x395578['exten'],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']});}_0x2cb29d[_0x6eb7('0xb')]({'type':_0x395578[_0x6eb7('0x4')],'app':'Set','appdata':_0x6eb7('0xd'),'context':_0x395578[_0x6eb7('0x5')],'exten':_0x395578[_0x6eb7('0x6')],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']},{'type':_0x395578['type'],'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0xe'),'context':_0x395578[_0x6eb7('0x5')],'exten':_0x395578[_0x6eb7('0x6')],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']},{'type':_0x395578[_0x6eb7('0x4')],'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0xf'),'context':_0x395578['context'],'exten':_0x395578['exten'],'priority':_0x133a0d++,'VoiceExtensionId':_0x395578['id']});return _0x2cb29d;}function _0x520910(_0x52bc2f){var _0x47fdbd=0x2;var _0x393fe4=[{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x3'),'appdata':'CDR(type)=outbound','context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x52bc2f[_0x6eb7('0x8')]?_0x6eb7('0x3'):_0x6eb7('0x7'),'appdata':_0x52bc2f[_0x6eb7('0x8')]?_0x6eb7('0x11')+_0x52bc2f[_0x6eb7('0x8')]:_0x6eb7('0x9'),'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0x12')+(_0x52bc2f[_0x6eb7('0x13')]?_0x6eb7('0x14')+_0x52bc2f[_0x6eb7('0x13')]+'}':'${EXTEN}'),'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0xc')+_0x52bc2f['id'],'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x15'),'appdata':_0x6eb7('0x16')+(_0x47fdbd+0x2)+_0x6eb7('0x17')+(_0x47fdbd+0x1)+')','context':_0x52bc2f['context'],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':'Set','appdata':_0x52bc2f[_0x6eb7('0x13')]?_0x6eb7('0x18')+_0x52bc2f[_0x6eb7('0x13')]+'}':_0x6eb7('0x19'),'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':'Set','appdata':_0x6eb7('0xd'),'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':'Set','appdata':_0x6eb7('0xe'),'context':_0x52bc2f['context'],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':'outbound','app':_0x6eb7('0x3'),'appdata':_0x6eb7('0xf'),'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f['exten'],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0x1a')+_0x52bc2f['id'],'context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']}];if(_0x52bc2f['hasOwnProperty']('recordingFormat')&&_0x52bc2f[_0x6eb7('0x1b')]!==_0x6eb7('0x1c')){_0x393fe4['push']({'type':_0x6eb7('0x10'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']},{'type':_0x6eb7('0x10'),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0x1d')+_0x52bc2f[_0x6eb7('0x1b')]||'wav','context':_0x52bc2f[_0x6eb7('0x5')],'exten':_0x52bc2f[_0x6eb7('0x6')],'priority':_0x47fdbd++,'VoiceExtensionId':_0x52bc2f['id']});}return _0x393fe4;}function _0x46ac78(_0x10a0b3){var _0x3717bd=[{'name':_0x6eb7('0x1e'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x6eb7('0x1f'),'param':0x2},{'name':_0x6eb7('0x20'),'param':0x3}];var _0x5efef6={};var _0x13122a=_0x10a0b3[_0x6eb7('0x21')](',');var _0x35878a=[];for(var _0x34da5e=0x0;_0x34da5e<_0x3717bd[_0x6eb7('0x22')];_0x34da5e++){switch(_0x3717bd[_0x34da5e]['name']){case _0x6eb7('0x1e'):_0x5efef6[_0x6eb7('0x1e')]=_0x13122a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]]['split']('/')[0x1];_0x5efef6[_0x6eb7('0x24')]=_0x13122a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]][_0x6eb7('0x21')]('/')[0x2];_0x5efef6[_0x6eb7('0x25')]=_0x5efef6['phone']?_0x5efef6[_0x6eb7('0x24')]['split']('$')[0x0]:undefined;_0x5efef6[_0x6eb7('0x24')]=route[_0x6eb7('0x13')]?(_0x5efef6[_0x6eb7('0x25')]||'')+'${EXTEN:'+route[_0x6eb7('0x13')]+'}':(_0x5efef6[_0x6eb7('0x25')]||'')+_0x6eb7('0x26');_0x35878a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]]=[_0x6eb7('0x27'),_0x5efef6[_0x6eb7('0x1e')],_0x5efef6[_0x6eb7('0x24')]][_0x6eb7('0x28')]('/');break;case'options':_0x5efef6[_0x6eb7('0x1f')]=_0x13122a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]];if(route['recordingFormat']!=='none'){if(_0x5efef6[_0x6eb7('0x1f')][_0x6eb7('0x29')](_0x6eb7('0x2a'))<0x0){_0x5efef6[_0x6eb7('0x1f')]+=_0x6eb7('0x2a');}}else{_0x5efef6['options']=_0x5efef6[_0x6eb7('0x1f')]['replace']('U(xcally-mixmonitor-context)','');}_0x35878a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]]=_0x5efef6[_0x6eb7('0x1f')];break;default:_0x35878a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]]=_0x13122a[_0x3717bd[_0x34da5e][_0x6eb7('0x23')]];}}return _0x35878a['join'](',');}function _0x42d6a1(_0x81affd,_0x3fa08f,_0x5469c8,_0x3daf78){return new Promise(function(_0x140424,_0x5d1afa){var _0x43cab0=[];if(_[_0x6eb7('0x2b')](_0x3fa08f))return _0x140424(_0x43cab0);_0x479dad[_0x6eb7('0x2c')][_0x6eb7('0x2d')]({'attributes':['id',_0x6eb7('0x2e'),_0x6eb7('0x2f')],'raw':!![]})[_0x6eb7('0x30')](function(_0x2fcc38){for(var _0x120f55=0x0,_0x458825=0x0;_0x120f55<_0x3fa08f[_0x6eb7('0x22')];_0x120f55++,_0x458825=0x0){var _0x389f56=_0x3fa08f[_0x120f55];var _0x5027e5=[];var _0x3bd8f6=[];if(_0x389f56['interval']!==_0x6eb7('0x31')){_0x389f56[_0x6eb7('0x32')]=[_0x389f56[_0x6eb7('0x2e')]];}else{_0x389f56['intervals']=_0x389f56['IntervalId']?_['map'](_[_0x6eb7('0x33')](_0x2fcc38,{'IntervalId':_0x389f56[_0x6eb7('0x2f')]}),_0x6eb7('0x2e')):[];}_0x389f56['context']=_0x81affd['context'];_0x389f56[_0x6eb7('0x6')]=_0x81affd['exten'];if(_0x389f56[_0x6eb7('0x4')])_0x389f56['type']=_0x389f56[_0x6eb7('0x4')]['toLowerCase']();if(_0x81affd[_0x6eb7('0x4')]===_0x6eb7('0x10')){if(_0x389f56['hasOwnProperty']('tag')&&_0x389f56['tag']&&_0x389f56[_0x6eb7('0x34')]!=='--'){_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56[_0x6eb7('0x4')]['toLowerCase'](),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0x35')+_0x389f56[_0x6eb7('0x34')],'context':_0x81affd[_0x6eb7('0x5')],'exten':_0x81affd[_0x6eb7('0x6')],'priority':_0x389f56['intervals'][_0x6eb7('0x22')]+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});}_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56[_0x6eb7('0x4')][_0x6eb7('0x36')](),'app':'ExecIf','appdata':_0x6eb7('0x37')+(_0x389f56['callerID']?_0x6eb7('0x38')+_0x389f56[_0x6eb7('0x39')]+')':_0x6eb7('0x3a')),'context':_0x81affd[_0x6eb7('0x5')],'exten':_0x81affd[_0x6eb7('0x6')],'priority':_0x389f56['intervals']['length']+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});}else{if(_0x389f56[_0x6eb7('0x3b')](_0x6eb7('0x3c'))){if(['queue','playback'][_0x6eb7('0x3d')](_0x389f56[_0x6eb7('0x3e')][_0x6eb7('0x36')]())&&_0x389f56['appType']!==_0x6eb7('0x3f')){if(_0x389f56[_0x6eb7('0x3c')]){_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56[_0x6eb7('0x4')]['toLowerCase'](),'app':_0x6eb7('0x15'),'appdata':_0x6eb7('0x40'),'context':_0x81affd['context'],'exten':_0x81affd['exten'],'priority':_0x389f56['intervals'][_0x6eb7('0x22')]+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56[_0x6eb7('0x4')]['toLowerCase'](),'app':'Set','appdata':_0x6eb7('0x41'),'context':_0x81affd['context'],'exten':_0x81affd[_0x6eb7('0x6')],'priority':_0x389f56['intervals'][_0x6eb7('0x22')]+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});}else{_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56['type'][_0x6eb7('0x36')](),'app':'ExecIf','appdata':_0x6eb7('0x42'),'context':_0x81affd['context'],'exten':_0x81affd[_0x6eb7('0x6')],'priority':_0x389f56[_0x6eb7('0x32')][_0x6eb7('0x22')]+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});_0x5027e5[_0x6eb7('0xb')]({'type':_0x389f56[_0x6eb7('0x4')]['toLowerCase'](),'app':_0x6eb7('0x3'),'appdata':_0x6eb7('0x43'),'context':_0x81affd[_0x6eb7('0x5')],'exten':_0x81affd['exten'],'priority':_0x389f56['intervals'][_0x6eb7('0x22')]+_0x5469c8+_0x458825++,'VoiceExtensionId':_0x81affd['id']});}}}}for(var _0x42eeb2=0x0;_0x42eeb2<_0x389f56[_0x6eb7('0x32')][_0x6eb7('0x22')];_0x42eeb2++){var _0x197553=_0x5469c8+_0x389f56['intervals']['length'];var _0x2e500c=_0x42eeb2===_0x389f56[_0x6eb7('0x32')]['length']-0x1?_0x5469c8+_0x5027e5[_0x6eb7('0x22')]+_0x3bd8f6[_0x6eb7('0x22')]+0x2:_0x5469c8+_0x42eeb2+0x1;_0x5027e5[_0x6eb7('0x44')](_0x42eeb2,0x0,{'type':_0x81affd['type'],'app':_0x6eb7('0x45'),'appdata':_0x389f56[_0x6eb7('0x32')][_0x42eeb2]+'?'+_0x81affd[_0x6eb7('0x5')]+',${EXTEN},'+_0x197553+':'+_0x81affd[_0x6eb7('0x5')]+_0x6eb7('0x46')+_0x2e500c,'exten':_0x81affd[_0x6eb7('0x6')],'context':_0x81affd[_0x6eb7('0x5')],'priority':_0x5469c8+_0x42eeb2,'VoiceExtensionId':_0x81affd['id']});}if(_0x3daf78&&_0x389f56[_0x6eb7('0x47')]==='outboundDial')_0x389f56['appdata']=_0x46ac78(_0x389f56[_0x6eb7('0x48')]);_0x389f56[_0x6eb7('0x49')]=_0x5027e5['length']?_[_0x6eb7('0x4a')](_0x5027e5)[_0x6eb7('0x49')]+0x1:_0x5469c8;_0x43cab0=_['concat'](_0x43cab0,_0x5027e5,[_0x389f56],_0x3bd8f6);_0x5469c8=_[_0x6eb7('0x4a')](_0x43cab0)[_0x6eb7('0x49')]+0x1;}return _0x140424(_0x43cab0);})[_0x6eb7('0x4b')](function(_0x4fa75d){_0x5d1afa(_0x4fa75d);});});}return _0x3a1b53[_0x6eb7('0x4c')](_0x6eb7('0x4d'),attributes,{'tableName':_0x6eb7('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x12be4b,_0x51c6de){var _0x17203c=this;var _0x54b44e=_0x17203c['type']===_0x6eb7('0x10')?_0x520910(_0x17203c):_0xd2bccb(_0x17203c);return _0x42d6a1(_0x17203c,_0x12be4b,_[_0x6eb7('0x4a')](_0x54b44e)[_0x6eb7('0x49')]+0x1,_0x51c6de)[_0x6eb7('0x30')](function(_0x4ebe83){var _0x183063=_[_0x6eb7('0x4f')](_0x54b44e,_0x4ebe83);_0x183063[_0x6eb7('0xb')]({'type':_0x17203c[_0x6eb7('0x4')],'app':_0x6eb7('0x50'),'exten':_0x17203c[_0x6eb7('0x6')],'context':_0x17203c['context'],'priority':_[_0x6eb7('0x4a')](_0x183063)[_0x6eb7('0x49')]+0x1,'VoiceExtensionId':_0x17203c['id']});return _0x183063;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c053a9a..9dfc883 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 _0x2706=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','request\x20sent','debug','error','code','message','info','VoiceExtension,\x20%s,\x20%s','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','include','model','stringify','catch','util','moment','bluebird'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x2706,0x107));var _0x6270=function(_0x1bf264,_0x10da61){_0x1bf264=_0x1bf264-0x0;var _0x36bc4b=_0x2706[_0x1bf264];return _0x36bc4b;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var moment=require(_0x6270('0x1'));var BPromise=require(_0x6270('0x2'));var rs=require(_0x6270('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6270('0x4'))['db'];var utils=require(_0x6270('0x5'));var logger=require(_0x6270('0x6'))(_0x6270('0x7'));var config=require(_0x6270('0x8'));var jayson=require(_0x6270('0x9'));var client=jayson[_0x6270('0xa')][_0x6270('0xb')]({'port':0x232a});config['redis']=_[_0x6270('0xc')](config[_0x6270('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6270('0xe'))(new Redis(config[_0x6270('0xd')]));require(_0x6270('0xf'))[_0x6270('0x10')](socket);function respondWithRpcPromise(_0x11f3a8,_0x2764de,_0x5d2e8e){return new BPromise(function(_0x97ee0d,_0x37ebc9){return client[_0x6270('0x11')](_0x11f3a8,_0x5d2e8e)[_0x6270('0x12')](function(_0x25537b){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x6270('0x13'));logger[_0x6270('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2764de,'request\x20sent',JSON['stringify'](_0x25537b));if(_0x25537b[_0x6270('0x15')]){if(_0x25537b['error'][_0x6270('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x25537b['error'][_0x6270('0x17')]);return _0x37ebc9(_0x25537b[_0x6270('0x15')][_0x6270('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x25537b[_0x6270('0x15')]['message']);return _0x97ee0d(_0x25537b[_0x6270('0x15')][_0x6270('0x17')]);}else{logger[_0x6270('0x18')](_0x6270('0x19'),_0x2764de,_0x6270('0x13'));_0x97ee0d(_0x25537b['result'][_0x6270('0x17')]);}})['catch'](function(_0x273478){logger[_0x6270('0x15')](_0x6270('0x19'),_0x2764de,_0x273478);_0x37ebc9(_0x273478);});});}exports[_0x6270('0x1a')]=function(_0x184d69){var _0x1991d1=this;return new Promise(function(_0x1cb956,_0x3c1c02){return db[_0x6270('0x1b')][_0x6270('0x1c')]({'raw':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')][_0x6270('0x1e')]||null:null,'attributes':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')][_0x6270('0x1f')]||null:null,'limit':_0x184d69[_0x6270('0x1d')]?_0x184d69['options'][_0x6270('0x20')]||null:null,'include':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')]['include']?_[_0x6270('0x21')](_0x184d69[_0x6270('0x1d')][_0x6270('0x22')],function(_0x42267c){return{'model':db[_0x42267c[_0x6270('0x23')]],'as':_0x42267c['as'],'attributes':_0x42267c[_0x6270('0x1f')],'include':_0x42267c['include']?_[_0x6270('0x21')](_0x42267c[_0x6270('0x22')],function(_0x247a4d){return{'model':db[_0x247a4d[_0x6270('0x23')]],'as':_0x247a4d['as'],'attributes':_0x247a4d[_0x6270('0x1f')],'include':_0x247a4d['include']?_['map'](_0x247a4d[_0x6270('0x22')],function(_0x4dfc58){return{'model':db[_0x4dfc58[_0x6270('0x23')]],'as':_0x4dfc58['as'],'attributes':_0x4dfc58[_0x6270('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4ee0){logger[_0x6270('0x18')]('GetVoiceExtension',_0x184d69);logger[_0x6270('0x14')](_0x6270('0x1a'),_0x184d69,JSON[_0x6270('0x24')](_0x4f4ee0));_0x1cb956(_0x4f4ee0);})[_0x6270('0x25')](function(_0x2a0164){logger['error'](_0x6270('0x1a'),_0x2a0164[_0x6270('0x17')],_0x184d69);_0x3c1c02(_0x1991d1[_0x6270('0x15')](0x1f4,_0x2a0164[_0x6270('0x17')]));});});}; \ No newline at end of file +var _0x5f71=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceExtension','findAll','options','where','limit','map','attributes','include','GetVoiceExtension','lodash','moment','randomstring'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5f71,0xc9));var _0x15f7=function(_0x2e3cfc,_0x170051){_0x2e3cfc=_0x2e3cfc-0x0;var _0x3f9904=_0x5f71[_0x2e3cfc];return _0x3f9904;};'use strict';var _=require(_0x15f7('0x0'));var util=require('util');var moment=require(_0x15f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x15f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x15f7('0x3'))(_0x15f7('0x4'));var config=require('../../config/environment');var jayson=require(_0x15f7('0x5'));var client=jayson[_0x15f7('0x6')][_0x15f7('0x7')]({'port':0x232a});config[_0x15f7('0x8')]=_[_0x15f7('0x9')](config[_0x15f7('0x8')],{'host':_0x15f7('0xa'),'port':0x18eb});var socket=require(_0x15f7('0xb'))(new Redis(config[_0x15f7('0x8')]));require(_0x15f7('0xc'))[_0x15f7('0xd')](socket);function respondWithRpcPromise(_0x40dbfa,_0x4b53ab,_0x4f09e7){return new BPromise(function(_0x4fddfc,_0x121607){return client['request'](_0x40dbfa,_0x4f09e7)[_0x15f7('0xe')](function(_0x9cbf6){logger[_0x15f7('0xf')](_0x15f7('0x10'),_0x4b53ab,_0x15f7('0x11'));logger[_0x15f7('0x12')](_0x15f7('0x13'),_0x4b53ab,'request\x20sent',JSON[_0x15f7('0x14')](_0x9cbf6));if(_0x9cbf6[_0x15f7('0x15')]){if(_0x9cbf6[_0x15f7('0x15')]['code']===0x1f4){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6['error'][_0x15f7('0x16')]);return _0x121607(_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);}logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x9cbf6[_0x15f7('0x15')][_0x15f7('0x16')]);return _0x4fddfc(_0x9cbf6['error'][_0x15f7('0x16')]);}else{logger[_0x15f7('0xf')]('VoiceExtension,\x20%s,\x20%s',_0x4b53ab,_0x15f7('0x11'));_0x4fddfc(_0x9cbf6[_0x15f7('0x17')][_0x15f7('0x16')]);}})[_0x15f7('0x18')](function(_0x26627b){logger[_0x15f7('0x15')](_0x15f7('0x10'),_0x4b53ab,_0x26627b);_0x121607(_0x26627b);});});}exports['GetVoiceExtension']=function(_0x299fcf){var _0xb6ea4f=this;return new Promise(function(_0x1362e1,_0x422c6e){return db[_0x15f7('0x19')][_0x15f7('0x1a')]({'raw':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options']['raw']===undefined?!![]:![]:!![],'where':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf[_0x15f7('0x1b')][_0x15f7('0x1c')]||null:null,'attributes':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf[_0x15f7('0x1b')]['attributes']||null:null,'limit':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options'][_0x15f7('0x1d')]||null:null,'include':_0x299fcf[_0x15f7('0x1b')]?_0x299fcf['options']['include']?_[_0x15f7('0x1e')](_0x299fcf['options']['include'],function(_0x2928fa){return{'model':db[_0x2928fa['model']],'as':_0x2928fa['as'],'attributes':_0x2928fa[_0x15f7('0x1f')],'include':_0x2928fa[_0x15f7('0x20')]?_[_0x15f7('0x1e')](_0x2928fa[_0x15f7('0x20')],function(_0x2d4d2d){return{'model':db[_0x2d4d2d['model']],'as':_0x2d4d2d['as'],'attributes':_0x2d4d2d[_0x15f7('0x1f')],'include':_0x2d4d2d[_0x15f7('0x20')]?_[_0x15f7('0x1e')](_0x2d4d2d['include'],function(_0x4dd3d6){return{'model':db[_0x4dd3d6['model']],'as':_0x4dd3d6['as'],'attributes':_0x4dd3d6['attributes']};}):[]};}):[]};}):[]:[]})[_0x15f7('0xe')](function(_0x432384){logger[_0x15f7('0xf')](_0x15f7('0x21'),_0x299fcf);logger[_0x15f7('0x12')](_0x15f7('0x21'),_0x299fcf,JSON['stringify'](_0x432384));_0x1362e1(_0x432384);})['catch'](function(_0x31bf43){logger[_0x15f7('0x15')](_0x15f7('0x21'),_0x31bf43['message'],_0x299fcf);_0x422c6e(_0xb6ea4f[_0x15f7('0x15')](0x1f4,_0x31bf43['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6ab603c..a80fa48 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x470c2b,_0xc7a5ca){var _0x23b490=function(_0x28dbd7){while(--_0x28dbd7){_0x470c2b['push'](_0x470c2b['shift']());}};_0x23b490(++_0xc7a5ca);}(_0x4975,0x86));var _0x5497=function(_0x113d22,_0x377be){_0x113d22=_0x113d22-0x0;var _0x3960ec=_0x4975[_0x113d22];return _0x3960ec;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x35f4b6,_0x58e9c9){var _0x28e9e4=function(_0x1af0bf){while(--_0x1af0bf){_0x35f4b6['push'](_0x35f4b6['shift']());}};_0x28e9e4(++_0x58e9c9);}(_0x5fab,0x177));var _0xb5fa=function(_0x55448c,_0x174be9){_0x55448c=_0x55448c-0x0;var _0x3b6b3a=_0x5fab[_0x55448c];return _0x3b6b3a;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 920bd64..a815ec9 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 _0x958a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x16cb50,_0x195e64){var _0x12025f=function(_0x5c9b56){while(--_0x5c9b56){_0x16cb50['push'](_0x16cb50['shift']());}};_0x12025f(++_0x195e64);}(_0x958a,0x128));var _0xa958=function(_0x9d0d06,_0x2e5deb){_0x9d0d06=_0x9d0d06-0x0;var _0x2a69c7=_0x958a[_0x9d0d06];return _0x2a69c7;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./voiceMail.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id/messages',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0xe')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x12')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7096=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3f1385,_0x3620ff){var _0x5e13d0=function(_0x13680a){while(--_0x13680a){_0x3f1385['push'](_0x3f1385['shift']());}};_0x5e13d0(++_0x3620ff);}(_0x7096,0x10c));var _0x6709=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7096[_0x433a86];return _0x23000c;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id/messages',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0x11')]);router[_0x6709('0x12')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0x13')]);module[_0x6709('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 50434a5..6825e05 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 _0x8c49=['TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x3de886,_0x2d36cb){var _0x51039f=function(_0x421a55){while(--_0x421a55){_0x3de886['push'](_0x3de886['shift']());}};_0x51039f(++_0x2d36cb);}(_0x8c49,0xb0));var _0x98c4=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x8c49[_0x3358ba];return _0x296e73;};'use strict';var Sequelize=require(_0x98c4('0x0'));module[_0x98c4('0x1')]={'customer_id':{'type':Sequelize[_0x98c4('0x2')]},'context':{'type':Sequelize[_0x98c4('0x2')],'defaultValue':_0x98c4('0x3'),'unique':_0x98c4('0x4')},'mailbox':{'type':Sequelize[_0x98c4('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x98c4('0x2')]},'fullname':{'type':Sequelize[_0x98c4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2f434d){this['setDataValue'](_0x98c4('0x5'),typeof _0x2f434d==='string'&&_0x2f434d[_0x98c4('0x6')]()?_0x2f434d['trim']():null);}},'pager':{'type':Sequelize[_0x98c4('0x2')]},'tz':{'type':Sequelize[_0x98c4('0x2')],'defaultValue':_0x98c4('0x7')},'attach':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x98c4('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x98c4('0x2')]},'callback':{'type':Sequelize[_0x98c4('0x2')]},'review':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x98c4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x98c4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':_0x98c4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x98c4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x98c4('0x8')](_0x98c4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x98c4('0x8')]('yes','no'),'defaultValue':_0x98c4('0x9'),'allowNull':![]},'stamp':{'type':_0x98c4('0xb')},'emailsubject':{'type':Sequelize[_0x98c4('0x2')]},'emailbody':{'type':Sequelize[_0x98c4('0x2')]},'maxsecs':{'type':Sequelize[_0x98c4('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x98c4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x98c4('0xd')](_0x98c4('0xe'))+_0x98c4('0xf')+this[_0x98c4('0xd')](_0x98c4('0x10'));}}}; \ No newline at end of file +var _0x00f5=['trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','\x20-\x20','mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x00f5,0x1cb));var _0x500f=function(_0x1d19d3,_0x3078a9){_0x1d19d3=_0x1d19d3-0x0;var _0x62e1da=_0x00f5[_0x1d19d3];return _0x62e1da;};'use strict';var Sequelize=require(_0x500f('0x0'));module[_0x500f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x500f('0x2'),'unique':_0x500f('0x3')},'mailbox':{'type':Sequelize[_0x500f('0x4')],'defaultValue':'','allowNull':![],'unique':_0x500f('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x500f('0x4')]},'email':{'type':Sequelize[_0x500f('0x4')],'validate':{'isEmail':!![]},'set':function(_0x2c0961){this[_0x500f('0x5')]('email',typeof _0x2c0961==='string'&&_0x2c0961[_0x500f('0x6')]()?_0x2c0961[_0x500f('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':_0x500f('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x500f('0x4')]},'callback':{'type':Sequelize[_0x500f('0x4')]},'review':{'type':Sequelize[_0x500f('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x500f('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x500f('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x500f('0x8'),'no'),'defaultValue':_0x500f('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x500f('0x7')](_0x500f('0x8'),'no'),'defaultValue':_0x500f('0x8'),'allowNull':![]},'stamp':{'type':_0x500f('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x500f('0x4')]},'maxsecs':{'type':Sequelize[_0x500f('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x500f('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x500f('0xc'))+_0x500f('0xd')+this['getDataValue'](_0x500f('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1981308..56f3198 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 _0xd87e=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','sort','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Voicemails','UserProfileResource','error','name','map','VoiceMail','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x4580c4,_0x3c3d4e){var _0x46c5ce=function(_0x4a54fc){while(--_0x4a54fc){_0x4580c4['push'](_0x4580c4['shift']());}};_0x46c5ce(++_0x3c3d4e);}(_0xd87e,0x1bf));var _0xed87=function(_0x1b24eb,_0x39029e){_0x1b24eb=_0x1b24eb-0x0;var _0x157b17=_0xd87e[_0x1b24eb];return _0x157b17;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){var _0x5d15b3=_0x27799a[_0xed87('0x25')]({'plain':!![]});var _0x3c22b7=_0xed87('0x26');return db[_0xed87('0x27')][_0xed87('0x24')]({'where':{'type':_0x3c22b7,'resourceId':_0x5d15b3['id']}})[_0xed87('0x23')](function(){return _0x27799a;});})[_0xed87('0x23')](function(){_0x3d1641[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x38f5c,_0x469181){return function(_0x341a35){if(!_0x341a35){_0x38f5c[_0xed87('0x18')](0x194);}return _0x341a35;};}function handleError(_0x2b86e2,_0x4dfaf2){_0x4dfaf2=_0x4dfaf2||0x1f4;return function(_0xb32b1c){logger[_0xed87('0x28')](_0xb32b1c['stack']);if(_0xb32b1c[_0xed87('0x29')]){delete _0xb32b1c[_0xed87('0x29')];}_0x2b86e2[_0xed87('0x19')](_0x4dfaf2)['send'](_0xb32b1c);};}exports['index']=function(_0xd0efba,_0x428b75){var _0x21ab8a={},_0x549a19={},_0x37d45a={'count':0x0,'rows':[]};var _0x3b87e3=_[_0xed87('0x2a')](db[_0xed87('0x2b')][_0xed87('0x2c')],function(_0x46b9f9){return{'name':_0x46b9f9[_0xed87('0x2d')],'type':_0x46b9f9[_0xed87('0x2e')][_0xed87('0x2f')]};});_0x549a19['model']=_[_0xed87('0x2a')](_0x3b87e3,_0xed87('0x29'));_0x549a19['query']=_[_0xed87('0x30')](_0xd0efba['query']);_0x549a19[_0xed87('0x31')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],_0x549a19[_0xed87('0x34')]);_0x21ab8a[_0xed87('0x35')]=_[_0xed87('0x32')](_0x549a19[_0xed87('0x33')],qs[_0xed87('0x36')](_0xd0efba[_0xed87('0x34')][_0xed87('0x36')]));_0x21ab8a[_0xed87('0x35')]=_0x21ab8a['attributes'][_0xed87('0x37')]?_0x21ab8a[_0xed87('0x35')]:_0x549a19['model'];if(!_0xd0efba[_0xed87('0x34')]['hasOwnProperty'](_0xed87('0x38'))){_0x21ab8a[_0xed87('0x1e')]=qs['limit'](_0xd0efba[_0xed87('0x34')][_0xed87('0x1e')]);_0x21ab8a[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0xd0efba[_0xed87('0x34')]['offset']);}_0x21ab8a[_0xed87('0x39')]=qs['sort'](_0xd0efba[_0xed87('0x34')]['sort']);_0x21ab8a[_0xed87('0x3a')]=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0xd0efba[_0xed87('0x34')],_0x549a19[_0xed87('0x31')]),_0x3b87e3);if(_0xd0efba[_0xed87('0x34')][_0xed87('0x3c')]){_0x21ab8a[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0x21ab8a['where'],{'$or':_['map'](_0x3b87e3,function(_0xa6714a){if(_0xa6714a[_0xed87('0x2e')]!==_0xed87('0x3e')){var _0x325112={};_0x325112[_0xa6714a[_0xed87('0x29')]]={'$like':'%'+_0xd0efba[_0xed87('0x34')]['filter']+'%'};return _0x325112;}})});}_0x21ab8a=_[_0xed87('0x3d')]({},_0x21ab8a,_0xd0efba[_0xed87('0x3f')]);var _0x1c49b0={'where':_0x21ab8a['where']};return db[_0xed87('0x2b')][_0xed87('0x1f')](_0x1c49b0)[_0xed87('0x23')](function(_0x1b0092){_0x37d45a[_0xed87('0x1f')]=_0x1b0092;if(_0xd0efba[_0xed87('0x34')][_0xed87('0x40')]){_0x21ab8a[_0xed87('0x41')]=[{'all':!![]}];}return db[_0xed87('0x2b')][_0xed87('0x42')](_0x21ab8a);})['then'](function(_0x7e6cbb){_0x37d45a[_0xed87('0x43')]=_0x7e6cbb;return _0x37d45a;})[_0xed87('0x23')](respondWithFilteredResult(_0x428b75,_0x21ab8a))['catch'](handleError(_0x428b75,null));};exports['show']=function(_0xa31eec,_0x7aa7fa){var _0x40cd98={'raw':!![],'where':{'id':_0xa31eec['params']['id']}},_0x41a658={};_0x41a658[_0xed87('0x33')]=_[_0xed87('0x30')](db['VoiceMail'][_0xed87('0x2c')]);_0x41a658[_0xed87('0x34')]=_[_0xed87('0x30')](_0xa31eec[_0xed87('0x34')]);_0x41a658[_0xed87('0x31')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],_0x41a658[_0xed87('0x34')]);_0x40cd98[_0xed87('0x35')]=_[_0xed87('0x32')](_0x41a658[_0xed87('0x33')],qs['fields'](_0xa31eec[_0xed87('0x34')][_0xed87('0x36')]));_0x40cd98[_0xed87('0x35')]=_0x40cd98[_0xed87('0x35')][_0xed87('0x37')]?_0x40cd98[_0xed87('0x35')]:_0x41a658[_0xed87('0x33')];if(_0xa31eec[_0xed87('0x34')][_0xed87('0x40')]){_0x40cd98[_0xed87('0x41')]=[{'all':!![]}];}_0x40cd98=_[_0xed87('0x3d')]({},_0x40cd98,_0xa31eec[_0xed87('0x3f')]);return db[_0xed87('0x2b')][_0xed87('0x44')](_0x40cd98)[_0xed87('0x23')](handleEntityNotFound(_0x7aa7fa,null))[_0xed87('0x23')](respondWithResult(_0x7aa7fa,null))[_0xed87('0x45')](handleError(_0x7aa7fa,null));};exports['create']=function(_0x2c7bef,_0x1a68a7){return db[_0xed87('0x2b')]['create'](_0x2c7bef[_0xed87('0x46')],{})[_0xed87('0x23')](function(_0x54bc95){var _0x33e736=_0x2c7bef[_0xed87('0x47')][_0xed87('0x25')]({'plain':!![]});if(!_0x33e736)throw new Error(_0xed87('0x48'));if(_0x33e736['role']===_0xed87('0x47')){var _0x436e15=_0x54bc95[_0xed87('0x25')]({'plain':!![]});var _0x272a07=_0xed87('0x26');return db[_0xed87('0x49')][_0xed87('0x44')]({'where':{'name':_0x272a07,'userProfileId':_0x33e736[_0xed87('0x4a')]},'raw':!![]})[_0xed87('0x23')](function(_0x251d4e){if(_0x251d4e&&_0x251d4e[_0xed87('0x4b')]===0x0){return db[_0xed87('0x27')][_0xed87('0x4c')]({'name':_0x436e15['name'],'resourceId':_0x436e15['id'],'type':_0x251d4e[_0xed87('0x29')],'sectionId':_0x251d4e['id']},{})['then'](function(){return _0x54bc95;});}else{return _0x54bc95;}})[_0xed87('0x45')](function(_0x329973){logger[_0xed87('0x28')](_0xed87('0x4d'),_0x329973);throw _0x329973;});}return _0x54bc95;})[_0xed87('0x23')](respondWithResult(_0x1a68a7,0xc9))[_0xed87('0x45')](handleError(_0x1a68a7,null));};exports[_0xed87('0x4e')]=function(_0xccdbb6,_0x3b413d){if(_0xccdbb6[_0xed87('0x46')]['id']){delete _0xccdbb6['body']['id'];}return db[_0xed87('0x2b')][_0xed87('0x44')]({'where':{'id':_0xccdbb6[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3b413d,null))[_0xed87('0x23')](saveUpdates(_0xccdbb6[_0xed87('0x46')],null))[_0xed87('0x23')](respondWithResult(_0x3b413d,null))[_0xed87('0x45')](handleError(_0x3b413d,null));};exports[_0xed87('0x24')]=function(_0x367ff4,_0x32db1f){return db['VoiceMail']['find']({'where':{'id':_0x367ff4[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x32db1f,null))[_0xed87('0x23')](removeEntity(_0x32db1f,null))[_0xed87('0x45')](handleError(_0x32db1f,null));};exports[_0xed87('0x50')]=function(_0x4dd840,_0x7e6738,_0x1ddd72){return db[_0xed87('0x2b')][_0xed87('0x51')]({'where':{'id':_0x4dd840[_0xed87('0x4f')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x7e6738,null))[_0xed87('0x23')](function(_0x1391a2){var _0x2ffffa;var _0xf4ec55={},_0x3feebb={};_0x3feebb[_0xed87('0x33')]=_[_0xed87('0x30')](db[_0xed87('0x52')]['rawAttributes']);_0x3feebb[_0xed87('0x34')]=_[_0xed87('0x30')](_0x4dd840[_0xed87('0x34')]);_0x3feebb[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3feebb[_0xed87('0x33')],_0x3feebb[_0xed87('0x34')]);_0xf4ec55[_0xed87('0x35')]=_['intersection'](_0x3feebb[_0xed87('0x33')],qs[_0xed87('0x36')](_0x4dd840[_0xed87('0x34')][_0xed87('0x36')]));_0xf4ec55[_0xed87('0x35')]=_0xf4ec55[_0xed87('0x35')]['length']?_0xf4ec55['attributes']:_0x3feebb[_0xed87('0x33')];if(!_0x4dd840[_0xed87('0x34')][_0xed87('0x53')](_0xed87('0x38'))){_0xf4ec55[_0xed87('0x1e')]=qs[_0xed87('0x1e')](_0x4dd840[_0xed87('0x34')][_0xed87('0x1e')]);_0xf4ec55['offset']=qs[_0xed87('0x1c')](_0x4dd840['query'][_0xed87('0x1c')]);}_0xf4ec55[_0xed87('0x39')]=qs['sort'](_0x4dd840[_0xed87('0x34')][_0xed87('0x54')]);_0xf4ec55['where']=qs[_0xed87('0x31')](_[_0xed87('0x3b')](_0x4dd840[_0xed87('0x34')],_0x3feebb[_0xed87('0x31')]));if(_0x4dd840[_0xed87('0x34')]['filter']){_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'$or':_[_0xed87('0x2a')](_0xf4ec55['attributes'],function(_0x58279a){var _0x3a6ab6={};_0x3a6ab6[_0x58279a]={'$like':'%'+_0x4dd840[_0xed87('0x34')]['filter']+'%'};return _0x3a6ab6;})});}_0xf4ec55[_0xed87('0x3a')]=_[_0xed87('0x3d')](_0xf4ec55[_0xed87('0x3a')],{'mailboxuser':_0x1391a2[_0xed87('0x55')]});_0xf4ec55=_[_0xed87('0x3d')]({},_0xf4ec55,_0x4dd840[_0xed87('0x3f')]);return db[_0xed87('0x52')][_0xed87('0x56')](_0xf4ec55)[_0xed87('0x23')](respondWithFilteredResult(_0x7e6738,_0xf4ec55));})[_0xed87('0x45')](handleError(_0x7e6738,null));}; \ No newline at end of file +var _0x351d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','limit','count','offset','apply','reject','save','update','destroy','then','get','Voicemails','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis'];(function(_0x4f894e,_0x167e65){var _0x527f36=function(_0x3c64b8){while(--_0x3c64b8){_0x4f894e['push'](_0x4f894e['shift']());}};_0x527f36(++_0x167e65);}(_0x351d,0x90));var _0xd351=function(_0x2a7cd4,_0x22810c){_0x2a7cd4=_0x2a7cd4-0x0;var _0x5a9ed0=_0x351d[_0x2a7cd4];return _0x5a9ed0;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb40c,_0x15549a){_0x15549a=_0x15549a||0xcc;return function(_0x23445f){if(_0x23445f){return _0x3eb40c[_0xd351('0x13')](_0x15549a);}return _0x3eb40c['status'](_0x15549a)[_0xd351('0x14')]();};}function respondWithResult(_0x316cf6,_0x597d7c){_0x597d7c=_0x597d7c||0xc8;return function(_0xc5a145){if(_0xc5a145){return _0x316cf6[_0xd351('0x15')](_0x597d7c)[_0xd351('0x16')](_0xc5a145);}};}function respondWithFilteredResult(_0xf1c285,_0x3867fb){return function(_0x4d238c){if(_0x4d238c){var _0x9f790f=typeof _0x3867fb['offset']==='undefined'&&typeof _0x3867fb[_0xd351('0x17')]==='undefined';var _0x21e591=_0x4d238c[_0xd351('0x18')];var _0x4e0164=_0x9f790f?0x0:_0x3867fb['offset'];var _0x1e1a3c=_0x9f790f?_0x4d238c[_0xd351('0x18')]:_0x3867fb[_0xd351('0x19')]+_0x3867fb[_0xd351('0x17')];var _0x51f265;if(_0x1e1a3c>=_0x21e591){_0x1e1a3c=_0x21e591;_0x51f265=0xc8;}else{_0x51f265=0xce;}_0xf1c285[_0xd351('0x15')](_0x51f265);return _0xf1c285['set']('Content-Range',_0x4e0164+'-'+_0x1e1a3c+'/'+_0x21e591)[_0xd351('0x16')](_0x4d238c);}return null;};}function patchUpdates(_0x4a427b){return function(_0x33b1e5){try{jsonpatch[_0xd351('0x1a')](_0x33b1e5,_0x4a427b,!![]);}catch(_0x3634c9){return BPromise[_0xd351('0x1b')](_0x3634c9);}return _0x33b1e5[_0xd351('0x1c')]();};}function saveUpdates(_0x53e729,_0x18625b){return function(_0xbbc58){if(_0xbbc58){return _0xbbc58[_0xd351('0x1d')](_0x53e729)['then'](function(_0x1ce7f7){return _0x1ce7f7;});}return null;};}function removeEntity(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(_0x59fb6d){return _0x59fb6d[_0xd351('0x1e')]()[_0xd351('0x1f')](function(){var _0x4626c4=_0x59fb6d[_0xd351('0x20')]({'plain':!![]});var _0x489c9a=_0xd351('0x21');return db['UserProfileResource'][_0xd351('0x1e')]({'where':{'type':_0x489c9a,'resourceId':_0x4626c4['id']}})[_0xd351('0x1f')](function(){return _0x59fb6d;});})['then'](function(){_0x2d9aa0[_0xd351('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d67e,_0x1d0cb1){return function(_0x560be9){if(!_0x560be9){_0x50d67e['sendStatus'](0x194);}return _0x560be9;};}function handleError(_0x134580,_0x555a50){_0x555a50=_0x555a50||0x1f4;return function(_0x38471c){logger[_0xd351('0x22')](_0x38471c[_0xd351('0x23')]);if(_0x38471c['name']){delete _0x38471c[_0xd351('0x24')];}_0x134580['status'](_0x555a50)[_0xd351('0x25')](_0x38471c);};}exports['index']=function(_0x5f07b1,_0xeb4da9){var _0x38c82f={},_0x3f9ef3={},_0x33b43d={'count':0x0,'rows':[]};var _0x48aa96=_[_0xd351('0x26')](db[_0xd351('0x27')][_0xd351('0x28')],function(_0x41da60){return{'name':_0x41da60[_0xd351('0x29')],'type':_0x41da60[_0xd351('0x2a')][_0xd351('0x2b')]};});_0x3f9ef3[_0xd351('0x2c')]=_[_0xd351('0x26')](_0x48aa96,'name');_0x3f9ef3[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x5f07b1[_0xd351('0x2d')]);_0x3f9ef3[_0xd351('0x2f')]=_['intersection'](_0x3f9ef3[_0xd351('0x2c')],_0x3f9ef3[_0xd351('0x2d')]);_0x38c82f[_0xd351('0x30')]=_[_0xd351('0x31')](_0x3f9ef3[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x32')]));_0x38c82f[_0xd351('0x30')]=_0x38c82f['attributes']['length']?_0x38c82f[_0xd351('0x30')]:_0x3f9ef3[_0xd351('0x2c')];if(!_0x5f07b1[_0xd351('0x2d')][_0xd351('0x33')](_0xd351('0x34'))){_0x38c82f[_0xd351('0x17')]=qs['limit'](_0x5f07b1['query'][_0xd351('0x17')]);_0x38c82f['offset']=qs[_0xd351('0x19')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x38c82f[_0xd351('0x35')]=qs[_0xd351('0x36')](_0x5f07b1[_0xd351('0x2d')][_0xd351('0x36')]);_0x38c82f[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x5f07b1[_0xd351('0x2d')],_0x3f9ef3['filters']),_0x48aa96);if(_0x5f07b1[_0xd351('0x2d')]['filter']){_0x38c82f[_0xd351('0x37')]=_[_0xd351('0x39')](_0x38c82f[_0xd351('0x37')],{'$or':_[_0xd351('0x26')](_0x48aa96,function(_0x3b42e7){if(_0x3b42e7[_0xd351('0x2a')]!=='VIRTUAL'){var _0x3ad98e={};_0x3ad98e[_0x3b42e7[_0xd351('0x24')]]={'$like':'%'+_0x5f07b1['query'][_0xd351('0x3a')]+'%'};return _0x3ad98e;}})});}_0x38c82f=_[_0xd351('0x39')]({},_0x38c82f,_0x5f07b1[_0xd351('0x3b')]);var _0x1fc216={'where':_0x38c82f[_0xd351('0x37')]};return db['VoiceMail']['count'](_0x1fc216)[_0xd351('0x1f')](function(_0x3935aa){_0x33b43d['count']=_0x3935aa;if(_0x5f07b1['query'][_0xd351('0x3c')]){_0x38c82f[_0xd351('0x3d')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x38c82f);})[_0xd351('0x1f')](function(_0x18f9d1){_0x33b43d[_0xd351('0x3e')]=_0x18f9d1;return _0x33b43d;})[_0xd351('0x1f')](respondWithFilteredResult(_0xeb4da9,_0x38c82f))[_0xd351('0x3f')](handleError(_0xeb4da9,null));};exports[_0xd351('0x40')]=function(_0x6192c3,_0x110458){var _0x129605={'raw':!![],'where':{'id':_0x6192c3['params']['id']}},_0x553360={};_0x553360[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x27')][_0xd351('0x28')]);_0x553360[_0xd351('0x2d')]=_[_0xd351('0x2e')](_0x6192c3[_0xd351('0x2d')]);_0x553360[_0xd351('0x2f')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],_0x553360[_0xd351('0x2d')]);_0x129605[_0xd351('0x30')]=_[_0xd351('0x31')](_0x553360[_0xd351('0x2c')],qs[_0xd351('0x32')](_0x6192c3[_0xd351('0x2d')]['fields']));_0x129605[_0xd351('0x30')]=_0x129605[_0xd351('0x30')][_0xd351('0x41')]?_0x129605['attributes']:_0x553360[_0xd351('0x2c')];if(_0x6192c3[_0xd351('0x2d')][_0xd351('0x3c')]){_0x129605[_0xd351('0x3d')]=[{'all':!![]}];}_0x129605=_[_0xd351('0x39')]({},_0x129605,_0x6192c3['options']);return db[_0xd351('0x27')]['find'](_0x129605)[_0xd351('0x1f')](handleEntityNotFound(_0x110458,null))[_0xd351('0x1f')](respondWithResult(_0x110458,null))['catch'](handleError(_0x110458,null));};exports['create']=function(_0x1bd727,_0x444206){return db[_0xd351('0x27')]['create'](_0x1bd727[_0xd351('0x42')],{})[_0xd351('0x1f')](function(_0x548d90){var _0xf3ce5=_0x1bd727['user'][_0xd351('0x20')]({'plain':!![]});if(!_0xf3ce5)throw new Error(_0xd351('0x43'));if(_0xf3ce5['role']==='user'){var _0x25ea1e=_0x548d90['get']({'plain':!![]});var _0xf9f375=_0xd351('0x21');return db[_0xd351('0x44')]['find']({'where':{'name':_0xf9f375,'userProfileId':_0xf3ce5[_0xd351('0x45')]},'raw':!![]})['then'](function(_0x5527da){if(_0x5527da&&_0x5527da['autoAssociation']===0x0){return db[_0xd351('0x46')][_0xd351('0x47')]({'name':_0x25ea1e[_0xd351('0x24')],'resourceId':_0x25ea1e['id'],'type':_0x5527da['name'],'sectionId':_0x5527da['id']},{})['then'](function(){return _0x548d90;});}else{return _0x548d90;}})[_0xd351('0x3f')](function(_0x42f248){logger['error'](_0xd351('0x48'),_0x42f248);throw _0x42f248;});}return _0x548d90;})[_0xd351('0x1f')](respondWithResult(_0x444206,0xc9))['catch'](handleError(_0x444206,null));};exports[_0xd351('0x1d')]=function(_0x59ab0f,_0x22394e){if(_0x59ab0f['body']['id']){delete _0x59ab0f[_0xd351('0x42')]['id'];}return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x59ab0f[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x22394e,null))[_0xd351('0x1f')](saveUpdates(_0x59ab0f[_0xd351('0x42')],null))['then'](respondWithResult(_0x22394e,null))['catch'](handleError(_0x22394e,null));};exports[_0xd351('0x1e')]=function(_0x624224,_0x53a9da){return db[_0xd351('0x27')][_0xd351('0x49')]({'where':{'id':_0x624224[_0xd351('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53a9da,null))[_0xd351('0x1f')](removeEntity(_0x53a9da,null))['catch'](handleError(_0x53a9da,null));};exports['getMessages']=function(_0x2c0cb1,_0x434465,_0x4d5a60){return db[_0xd351('0x27')][_0xd351('0x4b')]({'where':{'id':_0x2c0cb1[_0xd351('0x4a')]['id']}})[_0xd351('0x1f')](handleEntityNotFound(_0x434465,null))[_0xd351('0x1f')](function(_0x2dc745){var _0x505622;var _0x1e1173={},_0x2a7390={};_0x2a7390[_0xd351('0x2c')]=_[_0xd351('0x2e')](db[_0xd351('0x4c')][_0xd351('0x28')]);_0x2a7390[_0xd351('0x2d')]=_['keys'](_0x2c0cb1[_0xd351('0x2d')]);_0x2a7390['filters']=_[_0xd351('0x31')](_0x2a7390[_0xd351('0x2c')],_0x2a7390[_0xd351('0x2d')]);_0x1e1173[_0xd351('0x30')]=_[_0xd351('0x31')](_0x2a7390['model'],qs[_0xd351('0x32')](_0x2c0cb1['query'][_0xd351('0x32')]));_0x1e1173[_0xd351('0x30')]=_0x1e1173[_0xd351('0x30')][_0xd351('0x41')]?_0x1e1173[_0xd351('0x30')]:_0x2a7390['model'];if(!_0x2c0cb1['query'][_0xd351('0x33')](_0xd351('0x34'))){_0x1e1173['limit']=qs[_0xd351('0x17')](_0x2c0cb1[_0xd351('0x2d')][_0xd351('0x17')]);_0x1e1173['offset']=qs[_0xd351('0x19')](_0x2c0cb1[_0xd351('0x2d')][_0xd351('0x19')]);}_0x1e1173[_0xd351('0x35')]=qs['sort'](_0x2c0cb1['query'][_0xd351('0x36')]);_0x1e1173[_0xd351('0x37')]=qs[_0xd351('0x2f')](_[_0xd351('0x38')](_0x2c0cb1[_0xd351('0x2d')],_0x2a7390[_0xd351('0x2f')]));if(_0x2c0cb1[_0xd351('0x2d')]['filter']){_0x1e1173[_0xd351('0x37')]=_['merge'](_0x1e1173['where'],{'$or':_[_0xd351('0x26')](_0x1e1173[_0xd351('0x30')],function(_0x4799ae){var _0x182bdc={};_0x182bdc[_0x4799ae]={'$like':'%'+_0x2c0cb1['query']['filter']+'%'};return _0x182bdc;})});}_0x1e1173['where']=_[_0xd351('0x39')](_0x1e1173[_0xd351('0x37')],{'mailboxuser':_0x2dc745[_0xd351('0x4d')]});_0x1e1173=_['merge']({},_0x1e1173,_0x2c0cb1[_0xd351('0x3b')]);return db[_0xd351('0x4c')][_0xd351('0x4e')](_0x1e1173)[_0xd351('0x1f')](respondWithFilteredResult(_0x434465,_0x1e1173));})[_0xd351('0x3f')](handleError(_0x434465,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 275e01d..1b497d8 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 _0x5dcc=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x376dee,_0x51043b){var _0x907c58=function(_0x581447){while(--_0x581447){_0x376dee['push'](_0x376dee['shift']());}};_0x907c58(++_0x51043b);}(_0x5dcc,0x12b));var _0xc5dc=function(_0x7b3287,_0x49dc4f){_0x7b3287=_0x7b3287-0x0;var _0x5d4f1f=_0x5dcc[_0x7b3287];return _0x5d4f1f;};'use strict';var _=require(_0xc5dc('0x0'));var util=require(_0xc5dc('0x1'));var logger=require(_0xc5dc('0x2'))('api');var moment=require(_0xc5dc('0x3'));var BPromise=require(_0xc5dc('0x4'));var rp=require(_0xc5dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5dc('0x6'));var config=require(_0xc5dc('0x7'));var attributes=require('./voiceMail.attributes');module[_0xc5dc('0x8')]=function(_0x592cd7,_0x4e5f79){return _0x592cd7['define'](_0xc5dc('0x9'),attributes,{'tableName':_0xc5dc('0xa'),'paranoid':![],'indexes':[{'name':_0xc5dc('0xb'),'fields':[_0xc5dc('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x68b7=['mailbox','context','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports','VoiceMail','voice_voicemail'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0x68b7,0x1f0));var _0x768b=function(_0x428cb3,_0x3a57ba){_0x428cb3=_0x428cb3-0x0;var _0x4691ae=_0x68b7[_0x428cb3];return _0x4691ae;};'use strict';var _=require('lodash');var util=require(_0x768b('0x0'));var logger=require(_0x768b('0x1'))(_0x768b('0x2'));var moment=require(_0x768b('0x3'));var BPromise=require(_0x768b('0x4'));var rp=require(_0x768b('0x5'));var fs=require('fs');var path=require(_0x768b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x768b('0x7'));module[_0x768b('0x8')]=function(_0x5646dd,_0x4b3588){return _0x5646dd['define'](_0x768b('0x9'),attributes,{'tableName':_0x768b('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x768b('0xb'),_0x768b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 338b1d8..8e4a88c 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 _0x015e=['debug','stringify','error','VoiceMail,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x015e,0x1cf));var _0xe015=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x015e[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require(_0xe015('0x0'));var moment=require(_0xe015('0x1'));var BPromise=require(_0xe015('0x2'));var rs=require(_0xe015('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe015('0x4'));var logger=require('../../config/logger')(_0xe015('0x5'));var config=require(_0xe015('0x6'));var jayson=require(_0xe015('0x7'));var client=jayson[_0xe015('0x8')][_0xe015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dd504,_0x1fae09,_0x4c379d){return new BPromise(function(_0x2286c5,_0x592456){return client[_0xe015('0xa')](_0x4dd504,_0x4c379d)['then'](function(_0x26f51a){logger['info']('VoiceMail,\x20%s,\x20%s',_0x1fae09,_0xe015('0xb'));logger[_0xe015('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1fae09,_0xe015('0xb'),JSON[_0xe015('0xd')](_0x26f51a));if(_0x26f51a['error']){if(_0x26f51a['error']['code']===0x1f4){logger[_0xe015('0xe')](_0xe015('0xf'),_0x1fae09,_0x26f51a[_0xe015('0xe')]['message']);return _0x592456(_0x26f51a[_0xe015('0xe')][_0xe015('0x10')]);}logger[_0xe015('0xe')](_0xe015('0xf'),_0x1fae09,_0x26f51a[_0xe015('0xe')][_0xe015('0x10')]);return _0x2286c5(_0x26f51a['error'][_0xe015('0x10')]);}else{logger[_0xe015('0x11')]('VoiceMail,\x20%s,\x20%s',_0x1fae09,_0xe015('0xb'));_0x2286c5(_0x26f51a['result'][_0xe015('0x10')]);}})[_0xe015('0x12')](function(_0x5d1aac){logger['error'](_0xe015('0xf'),_0x1fae09,_0x5d1aac);_0x592456(_0x5d1aac);});});} \ No newline at end of file +var _0x67ed=['../../config/logger','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x130dcf,_0x4e8489){var _0x3f9c0a=function(_0x45336d){while(--_0x45336d){_0x130dcf['push'](_0x130dcf['shift']());}};_0x3f9c0a(++_0x4e8489);}(_0x67ed,0xcc));var _0xd67e=function(_0x24e500,_0x3482e5){_0x24e500=_0x24e500-0x0;var _0x4d5733=_0x67ed[_0x24e500];return _0x4d5733;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd67e('0x0'));var BPromise=require(_0xd67e('0x1'));var rs=require(_0xd67e('0x2'));var fs=require('fs');var Redis=require(_0xd67e('0x3'));var db=require(_0xd67e('0x4'))['db'];var utils=require(_0xd67e('0x5'));var logger=require(_0xd67e('0x6'))('rpc');var config=require(_0xd67e('0x7'));var jayson=require(_0xd67e('0x8'));var client=jayson[_0xd67e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7e2f,_0x503a30,_0x3a0d86){return new BPromise(function(_0x4ffd39,_0x6c26af){return client[_0xd67e('0xa')](_0x2e7e2f,_0x3a0d86)['then'](function(_0x3e26b9){logger[_0xd67e('0xb')](_0xd67e('0xc'),_0x503a30,_0xd67e('0xd'));logger[_0xd67e('0xe')](_0xd67e('0xf'),_0x503a30,_0xd67e('0xd'),JSON[_0xd67e('0x10')](_0x3e26b9));if(_0x3e26b9[_0xd67e('0x11')]){if(_0x3e26b9['error'][_0xd67e('0x12')]===0x1f4){logger[_0xd67e('0x11')](_0xd67e('0xc'),_0x503a30,_0x3e26b9['error'][_0xd67e('0x13')]);return _0x6c26af(_0x3e26b9['error']['message']);}logger['error'](_0xd67e('0xc'),_0x503a30,_0x3e26b9[_0xd67e('0x11')][_0xd67e('0x13')]);return _0x4ffd39(_0x3e26b9[_0xd67e('0x11')][_0xd67e('0x13')]);}else{logger['info'](_0xd67e('0xc'),_0x503a30,'request\x20sent');_0x4ffd39(_0x3e26b9[_0xd67e('0x14')][_0xd67e('0x13')]);}})['catch'](function(_0x27e8ba){logger['error'](_0xd67e('0xc'),_0x503a30,_0x27e8ba);_0x6c26af(_0x27e8ba);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c0a118c..3dd29f4 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 _0xf7c3=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','/:id','/:id/download','isAuthenticated','post','create','put','delete','destroy','multer','util','path'];(function(_0x39b1a4,_0x1fcb37){var _0x2d6437=function(_0x245b8b){while(--_0x245b8b){_0x39b1a4['push'](_0x39b1a4['shift']());}};_0x2d6437(++_0x1fcb37);}(_0xf7c3,0x96));var _0x3f7c=function(_0xba19af,_0x3febc7){_0xba19af=_0xba19af-0x0;var _0x55d927=_0xf7c3[_0xba19af];return _0x55d927;};'use strict';var multer=require(_0x3f7c('0x0'));var util=require(_0x3f7c('0x1'));var path=require(_0x3f7c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3f7c('0x3'));var router=express['Router']();var fs_extra=require(_0x3f7c('0x4'));var auth=require(_0x3f7c('0x5'));var interaction=require(_0x3f7c('0x6'));var config=require('../../config/environment');var controller=require(_0x3f7c('0x7'));router[_0x3f7c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3f7c('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3f7c('0x8')](_0x3f7c('0xa'),auth[_0x3f7c('0xb')](),controller['download']);router[_0x3f7c('0xc')]('/',auth[_0x3f7c('0xb')](),controller[_0x3f7c('0xd')]);router[_0x3f7c('0xe')](_0x3f7c('0x9'),auth[_0x3f7c('0xb')](),controller['update']);router[_0x3f7c('0xf')](_0x3f7c('0x9'),auth['isAuthenticated'](),controller[_0x3f7c('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0331=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show','get','download'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x0331,0x155));var _0x1033=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x0331[_0x1e175d];return _0x3a3ce5;};'use strict';var multer=require(_0x1033('0x0'));var util=require(_0x1033('0x1'));var path=require(_0x1033('0x2'));var timeout=require(_0x1033('0x3'));var express=require(_0x1033('0x4'));var router=express[_0x1033('0x5')]();var fs_extra=require(_0x1033('0x6'));var auth=require(_0x1033('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1033('0x8'));var controller=require(_0x1033('0x9'));router['get']('/',auth[_0x1033('0xa')](),controller[_0x1033('0xb')]);router['get'](_0x1033('0xc'),auth['isAuthenticated'](),controller[_0x1033('0xd')]);router[_0x1033('0xe')]('/:id/download',auth['isAuthenticated'](),controller[_0x1033('0xf')]);router[_0x1033('0x10')]('/',auth[_0x1033('0xa')](),controller[_0x1033('0x11')]);router[_0x1033('0x12')](_0x1033('0xc'),auth[_0x1033('0xa')](),controller[_0x1033('0x13')]);router[_0x1033('0x14')](_0x1033('0xc'),auth[_0x1033('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index c426fb8..285acbb 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 _0xa3c9=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xa3c9,0x18f));var _0x9a3c=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xa3c9[_0x372515];return _0xa3bf4e;};'use strict';var Sequelize=require(_0x9a3c('0x0'));module[_0x9a3c('0x1')]={'name':{'type':Sequelize[_0x9a3c('0x2')],'get':function(_0x4c3a93){return this[_0x9a3c('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x9a3c('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9a3c('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x9a3c('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x9a3c('0x6')](_0x9a3c('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x9a3c('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9a3c('0x5')],'defaultValue':''},'stamp':{'type':_0x9a3c('0x8'),'defaultValue':Sequelize[_0x9a3c('0x9')](_0x9a3c('0xa'))}}; \ No newline at end of file +var _0x01cd=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','exports','VIRTUAL'];(function(_0x3a93b7,_0x658183){var _0x2ed891=function(_0x1a60de){while(--_0x1a60de){_0x3a93b7['push'](_0x3a93b7['shift']());}};_0x2ed891(++_0x658183);}(_0x01cd,0x1d2));var _0xd01c=function(_0x56d3a5,_0x3db322){_0x56d3a5=_0x56d3a5-0x0;var _0x462cda=_0x01cd[_0x56d3a5];return _0x462cda;};'use strict';var Sequelize=require('sequelize');module[_0xd01c('0x0')]={'name':{'type':Sequelize[_0xd01c('0x1')],'get':function(_0x3d078e){return this[_0xd01c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd01c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xd01c('0x5')](_0xd01c('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd01c('0x4')],'defaultValue':''},'stamp':{'type':_0xd01c('0x7'),'defaultValue':Sequelize[_0xd01c('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 65956d6..a2e2596 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 _0x7e08=['fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','Content-Disposition','.wav\x22','set','eml-format','rimraf','zip-dir'];(function(_0xce2d7e,_0x56dac4){var _0x3143d9=function(_0x52633b){while(--_0x52633b){_0xce2d7e['push'](_0xce2d7e['shift']());}};_0x3143d9(++_0x56dac4);}(_0x7e08,0x161));var _0x87e0=function(_0x3d42c2,_0x4f46a7){_0x3d42c2=_0x3d42c2-0x0;var _0x31ac19=_0x7e08[_0x3d42c2];return _0x31ac19;};'use strict';var emlformat=require(_0x87e0('0x0'));var rimraf=require(_0x87e0('0x1'));var zipdir=require(_0x87e0('0x2'));var jsonpatch=require(_0x87e0('0x3'));var rp=require('request-promise');var moment=require(_0x87e0('0x4'));var BPromise=require(_0x87e0('0x5'));var Mustache=require(_0x87e0('0x6'));var util=require(_0x87e0('0x7'));var path=require(_0x87e0('0x8'));var sox=require('sox');var csv=require(_0x87e0('0x9'));var ejs=require(_0x87e0('0xa'));var fs=require('fs');var fs_extra=require(_0x87e0('0xb'));var _=require(_0x87e0('0xc'));var squel=require('squel');var crypto=require(_0x87e0('0xd'));var jsforce=require(_0x87e0('0xe'));var deskjs=require(_0x87e0('0xf'));var toCsv=require(_0x87e0('0x9'));var querystring=require(_0x87e0('0x10'));var Papa=require(_0x87e0('0x11'));var Redis=require(_0x87e0('0x12'));var authService=require(_0x87e0('0x13'));var qs=require(_0x87e0('0x14'));var as=require(_0x87e0('0x15'));var hardwareService=require(_0x87e0('0x16'));var logger=require(_0x87e0('0x17'))(_0x87e0('0x18'));var utils=require(_0x87e0('0x19'));var config=require(_0x87e0('0x1a'));var licenseUtil=require(_0x87e0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4accb1,_0xc0605c){_0xc0605c=_0xc0605c||0xcc;return function(_0x398ba2){if(_0x398ba2){return _0x4accb1['sendStatus'](_0xc0605c);}return _0x4accb1[_0x87e0('0x1c')](_0xc0605c)['end']();};}function respondWithResult(_0x41c50c,_0x1e0823){_0x1e0823=_0x1e0823||0xc8;return function(_0x19f81d){if(_0x19f81d){return _0x41c50c[_0x87e0('0x1c')](_0x1e0823)[_0x87e0('0x1d')](_0x19f81d);}};}function respondWithFilteredResult(_0x3bb320,_0x3788e1){return function(_0xccfcb6){if(_0xccfcb6){var _0x53bff7=typeof _0x3788e1[_0x87e0('0x1e')]==='undefined'&&typeof _0x3788e1['limit']===_0x87e0('0x1f');var _0x347c83=_0xccfcb6[_0x87e0('0x20')];var _0x21e259=_0x53bff7?0x0:_0x3788e1[_0x87e0('0x1e')];var _0x40ef3a=_0x53bff7?_0xccfcb6[_0x87e0('0x20')]:_0x3788e1[_0x87e0('0x1e')]+_0x3788e1['limit'];var _0x4c5790;if(_0x40ef3a>=_0x347c83){_0x40ef3a=_0x347c83;_0x4c5790=0xc8;}else{_0x4c5790=0xce;}_0x3bb320['status'](_0x4c5790);return _0x3bb320['set'](_0x87e0('0x21'),_0x21e259+'-'+_0x40ef3a+'/'+_0x347c83)[_0x87e0('0x1d')](_0xccfcb6);}return null;};}function patchUpdates(_0x427700){return function(_0x152f04){try{jsonpatch[_0x87e0('0x22')](_0x152f04,_0x427700,!![]);}catch(_0x5eeec4){return BPromise[_0x87e0('0x23')](_0x5eeec4);}return _0x152f04[_0x87e0('0x24')]();};}function saveUpdates(_0x33b906,_0x57291a){return function(_0x191752){if(_0x191752){return _0x191752[_0x87e0('0x25')](_0x33b906)[_0x87e0('0x26')](function(_0x408607){return _0x408607;});}return null;};}function removeEntity(_0x3c4a56,_0x27721a){return function(_0x107761){if(_0x107761){return _0x107761[_0x87e0('0x27')]()['then'](function(){_0x3c4a56['status'](0xcc)[_0x87e0('0x28')]();});}};}function handleEntityNotFound(_0x5e5a8b,_0x283ff5){return function(_0x2af3c4){if(!_0x2af3c4){_0x5e5a8b['sendStatus'](0x194);}return _0x2af3c4;};}function handleError(_0x477c42,_0x3cf789){_0x3cf789=_0x3cf789||0x1f4;return function(_0xe6c6c9){logger[_0x87e0('0x29')](_0xe6c6c9['stack']);if(_0xe6c6c9[_0x87e0('0x2a')]){delete _0xe6c6c9[_0x87e0('0x2a')];}_0x477c42[_0x87e0('0x1c')](_0x3cf789)[_0x87e0('0x2b')](_0xe6c6c9);};}exports[_0x87e0('0x2c')]=function(_0x555a01,_0x468ae9){var _0x47981d={},_0x796bba={},_0x34e837={'count':0x0,'rows':[]};var _0x469126=_[_0x87e0('0x2d')](db[_0x87e0('0x2e')][_0x87e0('0x2f')],function(_0x2af302){return{'name':_0x2af302[_0x87e0('0x30')],'type':_0x2af302[_0x87e0('0x31')][_0x87e0('0x32')]};});_0x796bba[_0x87e0('0x33')]=_[_0x87e0('0x34')](_[_0x87e0('0x2d')](_0x469126,_0x87e0('0x2a')),[_0x87e0('0x2a')]);_0x796bba[_0x87e0('0x35')]=_[_0x87e0('0x36')](_0x555a01[_0x87e0('0x35')]);_0x796bba[_0x87e0('0x37')]=_[_0x87e0('0x38')](_0x796bba[_0x87e0('0x33')],_0x796bba[_0x87e0('0x35')]);_0x47981d[_0x87e0('0x39')]=_[_0x87e0('0x38')](_0x796bba['model'],qs['fields'](_0x555a01[_0x87e0('0x35')][_0x87e0('0x3a')]));_0x47981d[_0x87e0('0x39')]=_0x47981d[_0x87e0('0x39')]['length']?_0x47981d[_0x87e0('0x39')]:_0x796bba[_0x87e0('0x33')];if(!_0x555a01['query'][_0x87e0('0x3b')](_0x87e0('0x3c'))){_0x47981d['limit']=qs[_0x87e0('0x3d')](_0x555a01[_0x87e0('0x35')][_0x87e0('0x3d')]);_0x47981d[_0x87e0('0x1e')]=qs['offset'](_0x555a01[_0x87e0('0x35')]['offset']);}_0x47981d[_0x87e0('0x3e')]=qs[_0x87e0('0x3f')](_0x555a01['query'][_0x87e0('0x3f')]);_0x47981d[_0x87e0('0x40')]=qs[_0x87e0('0x37')](_[_0x87e0('0x41')](_0x555a01[_0x87e0('0x35')],_0x796bba[_0x87e0('0x37')]),_0x469126);if(_0x555a01[_0x87e0('0x35')][_0x87e0('0x42')]){_0x47981d['where']=_[_0x87e0('0x43')](_0x47981d[_0x87e0('0x40')],{'$or':_[_0x87e0('0x2d')](_0x469126,function(_0x4aa176){if(_0x4aa176['type']!==_0x87e0('0x44')){var _0x4af9e0={};_0x4af9e0[_0x4aa176[_0x87e0('0x2a')]]={'$like':'%'+_0x555a01[_0x87e0('0x35')][_0x87e0('0x42')]+'%'};return _0x4af9e0;}})});}_0x47981d=_['merge']({},_0x47981d,_0x555a01[_0x87e0('0x45')]);var _0x22c87a={'where':_0x47981d[_0x87e0('0x40')]};return db[_0x87e0('0x2e')][_0x87e0('0x20')](_0x22c87a)[_0x87e0('0x26')](function(_0x19b1a2){_0x34e837[_0x87e0('0x20')]=_0x19b1a2;if(_0x555a01[_0x87e0('0x35')]['includeAll']){_0x47981d[_0x87e0('0x46')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x87e0('0x47')](_0x47981d);})[_0x87e0('0x26')](function(_0x37a771){_0x34e837[_0x87e0('0x48')]=_0x37a771;return _0x34e837;})[_0x87e0('0x26')](respondWithFilteredResult(_0x468ae9,_0x47981d))[_0x87e0('0x49')](handleError(_0x468ae9,null));};exports[_0x87e0('0x4a')]=function(_0x2572ec,_0x52d657){var _0x3cb299={'raw':!![],'where':{'id':_0x2572ec[_0x87e0('0x4b')]['id']}},_0x14d2d8={};_0x14d2d8['model']=_[_0x87e0('0x36')](db[_0x87e0('0x2e')][_0x87e0('0x2f')]);_0x14d2d8['query']=_[_0x87e0('0x36')](_0x2572ec[_0x87e0('0x35')]);_0x14d2d8[_0x87e0('0x37')]=_[_0x87e0('0x38')](_0x14d2d8[_0x87e0('0x33')],_0x14d2d8[_0x87e0('0x35')]);_0x3cb299[_0x87e0('0x39')]=_[_0x87e0('0x38')](_0x14d2d8['model'],qs[_0x87e0('0x3a')](_0x2572ec['query'][_0x87e0('0x3a')]));_0x3cb299[_0x87e0('0x39')]=_0x3cb299[_0x87e0('0x39')][_0x87e0('0x4c')]?_0x3cb299[_0x87e0('0x39')]:_0x14d2d8[_0x87e0('0x33')];if(_0x2572ec[_0x87e0('0x35')][_0x87e0('0x4d')]){_0x3cb299[_0x87e0('0x46')]=[{'all':!![]}];}_0x3cb299=_['merge']({},_0x3cb299,_0x2572ec[_0x87e0('0x45')]);return db[_0x87e0('0x2e')][_0x87e0('0x4e')](_0x3cb299)[_0x87e0('0x26')](handleEntityNotFound(_0x52d657,null))[_0x87e0('0x26')](respondWithResult(_0x52d657,null))[_0x87e0('0x49')](handleError(_0x52d657,null));};exports[_0x87e0('0x4f')]=function(_0x306348,_0x1449ac){return db[_0x87e0('0x2e')][_0x87e0('0x4f')](_0x306348[_0x87e0('0x50')],{})[_0x87e0('0x26')](respondWithResult(_0x1449ac,0xc9))['catch'](handleError(_0x1449ac,null));};exports[_0x87e0('0x25')]=function(_0x2e1987,_0x19ad72){if(_0x2e1987['body']['id']){delete _0x2e1987[_0x87e0('0x50')]['id'];}return db[_0x87e0('0x2e')][_0x87e0('0x4e')]({'where':{'id':_0x2e1987['params']['id']}})['then'](handleEntityNotFound(_0x19ad72,null))['then'](saveUpdates(_0x2e1987[_0x87e0('0x50')],null))[_0x87e0('0x26')](respondWithResult(_0x19ad72,null))[_0x87e0('0x49')](handleError(_0x19ad72,null));};exports[_0x87e0('0x27')]=function(_0x364438,_0x424f39){return db[_0x87e0('0x2e')][_0x87e0('0x4e')]({'where':{'id':_0x364438[_0x87e0('0x4b')]['id']}})[_0x87e0('0x26')](handleEntityNotFound(_0x424f39,null))[_0x87e0('0x26')](removeEntity(_0x424f39,null))[_0x87e0('0x49')](handleError(_0x424f39,null));};exports[_0x87e0('0x51')]=function(_0x4b6287,_0x5bd8d2,_0x2edc34){return db['VoiceMailMessage'][_0x87e0('0x4e')]({'where':{'id':_0x4b6287['params']['id']},'attributes':['id',_0x87e0('0x52'),_0x87e0('0x53')]})[_0x87e0('0x26')](handleEntityNotFound(_0x5bd8d2,null))[_0x87e0('0x26')](function(_0x49400f){if(_0x49400f){if(!_0x49400f['recording']){throw new db['Sequelize'][(_0x87e0('0x54'))](_0x87e0('0x55'));}var _0x2dfad5={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x49400f['msg_id']){_0x2dfad5[_0x87e0('0x56')]='attachment;\x20filename=\x22'+_0x49400f['msg_id']+_0x87e0('0x57');}_0x5bd8d2[_0x87e0('0x58')](_0x2dfad5);return _0x5bd8d2[_0x87e0('0x2b')](new Buffer(_0x49400f[_0x87e0('0x52')]));}})[_0x87e0('0x49')](handleError(_0x5bd8d2,null));}; \ No newline at end of file +var _0x0aba=['model','differenceBy','keys','query','filters','intersection','fields','length','attributes','order','sort','pick','where','VIRTUAL','filter','merge','VoiceMailMessage','include','findAll','rows','catch','show','params','includeAll','create','body','find','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','msg_id','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x0aba,0x123));var _0xa0ab=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0aba[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa0ab('0x0'));var rimraf=require(_0xa0ab('0x1'));var zipdir=require(_0xa0ab('0x2'));var jsonpatch=require(_0xa0ab('0x3'));var rp=require(_0xa0ab('0x4'));var moment=require(_0xa0ab('0x5'));var BPromise=require(_0xa0ab('0x6'));var Mustache=require(_0xa0ab('0x7'));var util=require(_0xa0ab('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa0ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0ab('0xa'));var squel=require(_0xa0ab('0xb'));var crypto=require(_0xa0ab('0xc'));var jsforce=require(_0xa0ab('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0ab('0xe'));var Papa=require('papaparse');var Redis=require(_0xa0ab('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa0ab('0x10'));var as=require(_0xa0ab('0x11'));var hardwareService=require(_0xa0ab('0x12'));var logger=require(_0xa0ab('0x13'))(_0xa0ab('0x14'));var utils=require(_0xa0ab('0x15'));var config=require(_0xa0ab('0x16'));var licenseUtil=require(_0xa0ab('0x17'));var db=require(_0xa0ab('0x18'))['db'];function respondWithStatusCode(_0x4c257d,_0x432ff8){_0x432ff8=_0x432ff8||0xcc;return function(_0xa72d48){if(_0xa72d48){return _0x4c257d[_0xa0ab('0x19')](_0x432ff8);}return _0x4c257d['status'](_0x432ff8)['end']();};}function respondWithResult(_0x4785d9,_0x53baed){_0x53baed=_0x53baed||0xc8;return function(_0x2a69e4){if(_0x2a69e4){return _0x4785d9['status'](_0x53baed)[_0xa0ab('0x1a')](_0x2a69e4);}};}function respondWithFilteredResult(_0x4df940,_0x212c8d){return function(_0x2387d0){if(_0x2387d0){var _0x48e015=typeof _0x212c8d[_0xa0ab('0x1b')]==='undefined'&&typeof _0x212c8d[_0xa0ab('0x1c')]===_0xa0ab('0x1d');var _0x352e31=_0x2387d0[_0xa0ab('0x1e')];var _0x42105e=_0x48e015?0x0:_0x212c8d['offset'];var _0xa1ccae=_0x48e015?_0x2387d0[_0xa0ab('0x1e')]:_0x212c8d['offset']+_0x212c8d[_0xa0ab('0x1c')];var _0x312a51;if(_0xa1ccae>=_0x352e31){_0xa1ccae=_0x352e31;_0x312a51=0xc8;}else{_0x312a51=0xce;}_0x4df940[_0xa0ab('0x1f')](_0x312a51);return _0x4df940[_0xa0ab('0x20')](_0xa0ab('0x21'),_0x42105e+'-'+_0xa1ccae+'/'+_0x352e31)[_0xa0ab('0x1a')](_0x2387d0);}return null;};}function patchUpdates(_0x4bb825){return function(_0x1f9277){try{jsonpatch[_0xa0ab('0x22')](_0x1f9277,_0x4bb825,!![]);}catch(_0x3a52a6){return BPromise[_0xa0ab('0x23')](_0x3a52a6);}return _0x1f9277['save']();};}function saveUpdates(_0x1b6042,_0x488081){return function(_0x3522b0){if(_0x3522b0){return _0x3522b0[_0xa0ab('0x24')](_0x1b6042)['then'](function(_0x37eac1){return _0x37eac1;});}return null;};}function removeEntity(_0x45ee2f,_0x352a62){return function(_0x14ec28){if(_0x14ec28){return _0x14ec28[_0xa0ab('0x25')]()[_0xa0ab('0x26')](function(){_0x45ee2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x148064,_0x2e3051){return function(_0x52acaa){if(!_0x52acaa){_0x148064['sendStatus'](0x194);}return _0x52acaa;};}function handleError(_0x32b7d9,_0x4ef763){_0x4ef763=_0x4ef763||0x1f4;return function(_0xdd7ff9){logger[_0xa0ab('0x27')](_0xdd7ff9[_0xa0ab('0x28')]);if(_0xdd7ff9['name']){delete _0xdd7ff9[_0xa0ab('0x29')];}_0x32b7d9[_0xa0ab('0x1f')](_0x4ef763)[_0xa0ab('0x2a')](_0xdd7ff9);};}exports[_0xa0ab('0x2b')]=function(_0x479fc1,_0x552748){var _0x558e2b={},_0x4fc588={},_0x24a934={'count':0x0,'rows':[]};var _0x2a07e6=_[_0xa0ab('0x2c')](db['VoiceMailMessage'][_0xa0ab('0x2d')],function(_0x38fa1f){return{'name':_0x38fa1f[_0xa0ab('0x2e')],'type':_0x38fa1f[_0xa0ab('0x2f')][_0xa0ab('0x30')]};});_0x4fc588[_0xa0ab('0x31')]=_[_0xa0ab('0x32')](_[_0xa0ab('0x2c')](_0x2a07e6,_0xa0ab('0x29')),[_0xa0ab('0x29')]);_0x4fc588['query']=_[_0xa0ab('0x33')](_0x479fc1[_0xa0ab('0x34')]);_0x4fc588[_0xa0ab('0x35')]=_[_0xa0ab('0x36')](_0x4fc588[_0xa0ab('0x31')],_0x4fc588['query']);_0x558e2b['attributes']=_[_0xa0ab('0x36')](_0x4fc588[_0xa0ab('0x31')],qs['fields'](_0x479fc1['query'][_0xa0ab('0x37')]));_0x558e2b['attributes']=_0x558e2b['attributes'][_0xa0ab('0x38')]?_0x558e2b[_0xa0ab('0x39')]:_0x4fc588[_0xa0ab('0x31')];if(!_0x479fc1[_0xa0ab('0x34')]['hasOwnProperty']('nolimit')){_0x558e2b[_0xa0ab('0x1c')]=qs['limit'](_0x479fc1['query'][_0xa0ab('0x1c')]);_0x558e2b[_0xa0ab('0x1b')]=qs['offset'](_0x479fc1[_0xa0ab('0x34')]['offset']);}_0x558e2b[_0xa0ab('0x3a')]=qs[_0xa0ab('0x3b')](_0x479fc1[_0xa0ab('0x34')][_0xa0ab('0x3b')]);_0x558e2b['where']=qs[_0xa0ab('0x35')](_[_0xa0ab('0x3c')](_0x479fc1[_0xa0ab('0x34')],_0x4fc588[_0xa0ab('0x35')]),_0x2a07e6);if(_0x479fc1[_0xa0ab('0x34')]['filter']){_0x558e2b[_0xa0ab('0x3d')]=_['merge'](_0x558e2b[_0xa0ab('0x3d')],{'$or':_[_0xa0ab('0x2c')](_0x2a07e6,function(_0x535037){if(_0x535037[_0xa0ab('0x2f')]!==_0xa0ab('0x3e')){var _0x1b2f5f={};_0x1b2f5f[_0x535037[_0xa0ab('0x29')]]={'$like':'%'+_0x479fc1[_0xa0ab('0x34')][_0xa0ab('0x3f')]+'%'};return _0x1b2f5f;}})});}_0x558e2b=_[_0xa0ab('0x40')]({},_0x558e2b,_0x479fc1['options']);var _0x5d7345={'where':_0x558e2b[_0xa0ab('0x3d')]};return db[_0xa0ab('0x41')][_0xa0ab('0x1e')](_0x5d7345)[_0xa0ab('0x26')](function(_0x186f10){_0x24a934[_0xa0ab('0x1e')]=_0x186f10;if(_0x479fc1['query']['includeAll']){_0x558e2b[_0xa0ab('0x42')]=[{'all':!![]}];}return db[_0xa0ab('0x41')][_0xa0ab('0x43')](_0x558e2b);})['then'](function(_0x1b2a67){_0x24a934[_0xa0ab('0x44')]=_0x1b2a67;return _0x24a934;})[_0xa0ab('0x26')](respondWithFilteredResult(_0x552748,_0x558e2b))[_0xa0ab('0x45')](handleError(_0x552748,null));};exports[_0xa0ab('0x46')]=function(_0x5e072e,_0x24d86b){var _0x455479={'raw':!![],'where':{'id':_0x5e072e[_0xa0ab('0x47')]['id']}},_0x39dd09={};_0x39dd09[_0xa0ab('0x31')]=_[_0xa0ab('0x33')](db[_0xa0ab('0x41')][_0xa0ab('0x2d')]);_0x39dd09[_0xa0ab('0x34')]=_[_0xa0ab('0x33')](_0x5e072e[_0xa0ab('0x34')]);_0x39dd09[_0xa0ab('0x35')]=_[_0xa0ab('0x36')](_0x39dd09['model'],_0x39dd09['query']);_0x455479[_0xa0ab('0x39')]=_['intersection'](_0x39dd09[_0xa0ab('0x31')],qs[_0xa0ab('0x37')](_0x5e072e[_0xa0ab('0x34')][_0xa0ab('0x37')]));_0x455479[_0xa0ab('0x39')]=_0x455479[_0xa0ab('0x39')]['length']?_0x455479[_0xa0ab('0x39')]:_0x39dd09[_0xa0ab('0x31')];if(_0x5e072e[_0xa0ab('0x34')][_0xa0ab('0x48')]){_0x455479[_0xa0ab('0x42')]=[{'all':!![]}];}_0x455479=_[_0xa0ab('0x40')]({},_0x455479,_0x5e072e['options']);return db[_0xa0ab('0x41')]['find'](_0x455479)['then'](handleEntityNotFound(_0x24d86b,null))[_0xa0ab('0x26')](respondWithResult(_0x24d86b,null))[_0xa0ab('0x45')](handleError(_0x24d86b,null));};exports['create']=function(_0x17617d,_0x25b286){return db['VoiceMailMessage'][_0xa0ab('0x49')](_0x17617d['body'],{})[_0xa0ab('0x26')](respondWithResult(_0x25b286,0xc9))[_0xa0ab('0x45')](handleError(_0x25b286,null));};exports[_0xa0ab('0x24')]=function(_0x41d512,_0x113243){if(_0x41d512[_0xa0ab('0x4a')]['id']){delete _0x41d512[_0xa0ab('0x4a')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x41d512[_0xa0ab('0x47')]['id']}})[_0xa0ab('0x26')](handleEntityNotFound(_0x113243,null))[_0xa0ab('0x26')](saveUpdates(_0x41d512['body'],null))['then'](respondWithResult(_0x113243,null))[_0xa0ab('0x45')](handleError(_0x113243,null));};exports['destroy']=function(_0x2eacc9,_0xa331cf){return db['VoiceMailMessage'][_0xa0ab('0x4b')]({'where':{'id':_0x2eacc9[_0xa0ab('0x47')]['id']}})[_0xa0ab('0x26')](handleEntityNotFound(_0xa331cf,null))['then'](removeEntity(_0xa331cf,null))['catch'](handleError(_0xa331cf,null));};exports[_0xa0ab('0x4c')]=function(_0x4fce4e,_0x5b58ad,_0x44bd40){return db['VoiceMailMessage'][_0xa0ab('0x4b')]({'where':{'id':_0x4fce4e[_0xa0ab('0x47')]['id']},'attributes':['id','recording','msg_id']})[_0xa0ab('0x26')](handleEntityNotFound(_0x5b58ad,null))['then'](function(_0x1e5695){if(_0x1e5695){if(!_0x1e5695[_0xa0ab('0x4d')]){throw new db['Sequelize'][(_0xa0ab('0x4e'))](_0xa0ab('0x4f'));}var _0x41e9f2={'Content-Type':_0xa0ab('0x50'),'Content-Disposition':_0xa0ab('0x51')};if(_0x1e5695['msg_id']){_0x41e9f2['Content-Disposition']=_0xa0ab('0x52')+_0x1e5695[_0xa0ab('0x53')]+_0xa0ab('0x54');}_0x5b58ad[_0xa0ab('0x20')](_0x41e9f2);return _0x5b58ad[_0xa0ab('0x2a')](new Buffer(_0x1e5695['recording']));}})['catch'](handleError(_0x5b58ad,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 33b2b32..09e5cb9 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 _0xa656=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','moment','bluebird'];(function(_0x31e0ed,_0x3383a0){var _0x532add=function(_0x4460cb){while(--_0x4460cb){_0x31e0ed['push'](_0x31e0ed['shift']());}};_0x532add(++_0x3383a0);}(_0xa656,0x1e5));var _0x6a65=function(_0x3b19d5,_0x3d5bc5){_0x3b19d5=_0x3b19d5-0x0;var _0x37557e=_0xa656[_0x3b19d5];return _0x37557e;};'use strict';var _=require(_0x6a65('0x0'));var util=require(_0x6a65('0x1'));var logger=require('../../config/logger')(_0x6a65('0x2'));var moment=require(_0x6a65('0x3'));var BPromise=require(_0x6a65('0x4'));var rp=require(_0x6a65('0x5'));var fs=require('fs');var path=require(_0x6a65('0x6'));var rimraf=require(_0x6a65('0x7'));var config=require(_0x6a65('0x8'));var attributes=require(_0x6a65('0x9'));module[_0x6a65('0xa')]=function(_0x24efa3,_0x1c8cb2){return _0x24efa3['define'](_0x6a65('0xb'),attributes,{'tableName':_0x6a65('0xc'),'paranoid':![],'indexes':[{'name':_0x6a65('0xd'),'fields':[_0x6a65('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2972=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages'];(function(_0xcfd814,_0x18e8dc){var _0x156de7=function(_0x2670bd){while(--_0x2670bd){_0xcfd814['push'](_0xcfd814['shift']());}};_0x156de7(++_0x18e8dc);}(_0x2972,0xa6));var _0x2297=function(_0x131c5f,_0x5239b8){_0x131c5f=_0x131c5f-0x0;var _0x10d992=_0x2972[_0x131c5f];return _0x10d992;};'use strict';var _=require(_0x2297('0x0'));var util=require(_0x2297('0x1'));var logger=require(_0x2297('0x2'))(_0x2297('0x3'));var moment=require(_0x2297('0x4'));var BPromise=require(_0x2297('0x5'));var rp=require(_0x2297('0x6'));var fs=require('fs');var path=require(_0x2297('0x7'));var rimraf=require(_0x2297('0x8'));var config=require(_0x2297('0x9'));var attributes=require(_0x2297('0xa'));module[_0x2297('0xb')]=function(_0xbf62d7,_0x4a0e35){return _0xbf62d7[_0x2297('0xc')]('VoiceMailMessage',attributes,{'tableName':_0x2297('0xd'),'paranoid':![],'indexes':[{'name':_0x2297('0xe'),'fields':[_0x2297('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 75da5c5..f2f7670 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 _0xf088=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xf088,0x15f));var _0x8f08=function(_0x4eeeda,_0x548a37){_0x4eeeda=_0x4eeeda-0x0;var _0x4dc065=_0xf088[_0x4eeeda];return _0x4dc065;};'use strict';var _=require(_0x8f08('0x0'));var util=require(_0x8f08('0x1'));var moment=require('moment');var BPromise=require(_0x8f08('0x2'));var rs=require(_0x8f08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f08('0x4'))['db'];var utils=require(_0x8f08('0x5'));var logger=require(_0x8f08('0x6'))(_0x8f08('0x7'));var config=require(_0x8f08('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8f08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277b4f,_0x379cff,_0xc34479){return new BPromise(function(_0x3820b5,_0x392e3a){return client[_0x8f08('0xa')](_0x277b4f,_0xc34479)[_0x8f08('0xb')](function(_0x390e31){logger[_0x8f08('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x379cff,_0x8f08('0xd'));logger[_0x8f08('0xe')](_0x8f08('0xf'),_0x379cff,'request\x20sent',JSON['stringify'](_0x390e31));if(_0x390e31[_0x8f08('0x10')]){if(_0x390e31[_0x8f08('0x10')][_0x8f08('0x11')]===0x1f4){logger[_0x8f08('0x10')](_0x8f08('0x12'),_0x379cff,_0x390e31[_0x8f08('0x10')]['message']);return _0x392e3a(_0x390e31[_0x8f08('0x10')]['message']);}logger[_0x8f08('0x10')](_0x8f08('0x12'),_0x379cff,_0x390e31[_0x8f08('0x10')][_0x8f08('0x13')]);return _0x3820b5(_0x390e31['error'][_0x8f08('0x13')]);}else{logger[_0x8f08('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x379cff,_0x8f08('0xd'));_0x3820b5(_0x390e31[_0x8f08('0x14')]['message']);}})[_0x8f08('0x15')](function(_0x3ad23e){logger[_0x8f08('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x379cff,_0x3ad23e);_0x392e3a(_0x3ad23e);});});} \ No newline at end of file +var _0xc005=['rpc','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1df922,_0x20bf04){var _0x5807ee=function(_0xd57bfd){while(--_0xd57bfd){_0x1df922['push'](_0x1df922['shift']());}};_0x5807ee(++_0x20bf04);}(_0xc005,0x1ec));var _0x5c00=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0xc005[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0x5c00('0x0'));var util=require(_0x5c00('0x1'));var moment=require(_0x5c00('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c00('0x3'));var fs=require('fs');var Redis=require(_0x5c00('0x4'));var db=require(_0x5c00('0x5'))['db'];var utils=require(_0x5c00('0x6'));var logger=require(_0x5c00('0x7'))(_0x5c00('0x8'));var config=require(_0x5c00('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c00('0xa')][_0x5c00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d641b,_0x15316e,_0x485de4){return new BPromise(function(_0x4d92a2,_0x11104f){return client[_0x5c00('0xc')](_0x1d641b,_0x485de4)[_0x5c00('0xd')](function(_0x453cc4){logger['info'](_0x5c00('0xe'),_0x15316e,_0x5c00('0xf'));logger[_0x5c00('0x10')](_0x5c00('0x11'),_0x15316e,_0x5c00('0xf'),JSON[_0x5c00('0x12')](_0x453cc4));if(_0x453cc4['error']){if(_0x453cc4['error'][_0x5c00('0x13')]===0x1f4){logger[_0x5c00('0x14')](_0x5c00('0xe'),_0x15316e,_0x453cc4[_0x5c00('0x14')][_0x5c00('0x15')]);return _0x11104f(_0x453cc4['error'][_0x5c00('0x15')]);}logger[_0x5c00('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x15316e,_0x453cc4[_0x5c00('0x14')][_0x5c00('0x15')]);return _0x4d92a2(_0x453cc4[_0x5c00('0x14')][_0x5c00('0x15')]);}else{logger[_0x5c00('0x16')](_0x5c00('0xe'),_0x15316e,_0x5c00('0xf'));_0x4d92a2(_0x453cc4[_0x5c00('0x17')]['message']);}})[_0x5c00('0x18')](function(_0x4f2314){logger[_0x5c00('0x14')](_0x5c00('0xe'),_0x15316e,_0x4f2314);_0x11104f(_0x4f2314);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c2bb019..073a02d 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 _0xf268=['get','/:id','show','create','post','update','delete','/:id/sounds/:id2','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index'];(function(_0x2903fa,_0x2c635f){var _0xc3dd38=function(_0xe17073){while(--_0xe17073){_0x2903fa['push'](_0x2903fa['shift']());}};_0xc3dd38(++_0x2c635f);}(_0xf268,0x148));var _0x8f26=function(_0x470651,_0x2774a5){_0x470651=_0x470651-0x0;var _0x4c3597=_0xf268[_0x470651];return _0x4c3597;};'use strict';var multer=require(_0x8f26('0x0'));var util=require(_0x8f26('0x1'));var path=require(_0x8f26('0x2'));var timeout=require(_0x8f26('0x3'));var express=require(_0x8f26('0x4'));var router=express['Router']();var fs_extra=require(_0x8f26('0x5'));var auth=require(_0x8f26('0x6'));var interaction=require(_0x8f26('0x7'));var config=require(_0x8f26('0x8'));var controller=require(_0x8f26('0x9'));router['get']('/',auth[_0x8f26('0xa')](),controller[_0x8f26('0xb')]);router[_0x8f26('0xc')](_0x8f26('0xd'),auth[_0x8f26('0xa')](),controller[_0x8f26('0xe')]);router[_0x8f26('0xc')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller[_0x8f26('0xf')]);router[_0x8f26('0x10')]('/:id/sounds',auth[_0x8f26('0xa')](),controller['addSound']);router['put']('/:id',auth[_0x8f26('0xa')](),controller[_0x8f26('0x11')]);router[_0x8f26('0x12')](_0x8f26('0xd'),auth[_0x8f26('0xa')](),controller['destroy']);router[_0x8f26('0x12')](_0x8f26('0x13'),auth[_0x8f26('0xa')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x7ad1=['update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getSounds','post','/:id/sounds','put','/:id'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0x7ad1,0x16a));var _0x17ad=function(_0x12cca9,_0x20c6e9){_0x12cca9=_0x12cca9-0x0;var _0x1a7654=_0x7ad1[_0x12cca9];return _0x1a7654;};'use strict';var multer=require(_0x17ad('0x0'));var util=require(_0x17ad('0x1'));var path=require(_0x17ad('0x2'));var timeout=require(_0x17ad('0x3'));var express=require(_0x17ad('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x17ad('0x5'));var config=require(_0x17ad('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x17ad('0x7')]('/',auth[_0x17ad('0x8')](),controller[_0x17ad('0x9')]);router['get']('/:id',auth[_0x17ad('0x8')](),controller[_0x17ad('0xa')]);router[_0x17ad('0x7')]('/:id/sounds',auth[_0x17ad('0x8')](),controller[_0x17ad('0xb')]);router[_0x17ad('0xc')]('/',auth[_0x17ad('0x8')](),controller['create']);router['post'](_0x17ad('0xd'),auth['isAuthenticated'](),controller['addSound']);router[_0x17ad('0xe')](_0x17ad('0xf'),auth['isAuthenticated'](),controller[_0x17ad('0x10')]);router[_0x17ad('0x11')](_0x17ad('0xf'),auth['isAuthenticated'](),controller[_0x17ad('0x12')]);router[_0x17ad('0x11')](_0x17ad('0x13'),auth['isAuthenticated'](),controller[_0x17ad('0x14')]);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 d234a48..0c19e79 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 _0xd8b7=['STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xd8b7,0x1c5));var _0x7d8b=function(_0xb642c1,_0x441c20){_0xb642c1=_0xb642c1-0x0;var _0x2a2171=_0xd8b7[_0xb642c1];return _0x2a2171;};'use strict';var Sequelize=require(_0x7d8b('0x0'));module[_0x7d8b('0x1')]={'name':{'type':Sequelize[_0x7d8b('0x2')],'allowNull':![],'unique':_0x7d8b('0x3')},'mode':{'type':Sequelize[_0x7d8b('0x4')](_0x7d8b('0x5'),_0x7d8b('0x6'),_0x7d8b('0x7'),_0x7d8b('0x8'),_0x7d8b('0x9'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x7d8b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7d8b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7d8b('0xa')},'format':{'type':Sequelize[_0x7d8b('0x2')],'allowNull':!![]},'stamp':{'type':_0x7d8b('0xb')},'defaultEntry':{'type':Sequelize[_0x7d8b('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0044=['sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN'];(function(_0x28d54c,_0x53d9ba){var _0x32ab5c=function(_0x18959b){while(--_0x18959b){_0x28d54c['push'](_0x28d54c['shift']());}};_0x32ab5c(++_0x53d9ba);}(_0x0044,0x197));var _0x4004=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x0044[_0x382a62];return _0x490a25;};'use strict';var Sequelize=require(_0x4004('0x0'));module[_0x4004('0x1')]={'name':{'type':Sequelize[_0x4004('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x4004('0x3')]('custom',_0x4004('0x4'),_0x4004('0x5'),_0x4004('0x6'),_0x4004('0x7'),_0x4004('0x8')),'allowNull':!![],'defaultValue':_0x4004('0x4')},'directory':{'type':Sequelize[_0x4004('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4004('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4004('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4004('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x4004('0x2')],'allowNull':!![]},'stamp':{'type':_0x4004('0x9')},'defaultEntry':{'type':Sequelize[_0x4004('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 90abddb..faee5dc 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 _0x5dc6=['name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceMusicOnHold','includeAll','include','findAll','body','find','params','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','%s.%s','basename','extname','symlinkSync','id2','createdAt','format','getSounds','rawAttributes','length','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','MusicOnHolds','error'];(function(_0x3af704,_0x58486b){var _0x4ac16c=function(_0x1a49b8){while(--_0x1a49b8){_0x3af704['push'](_0x3af704['shift']());}};_0x4ac16c(++_0x58486b);}(_0x5dc6,0x18b));var _0x65dc=function(_0x582589,_0x2cf070){_0x582589=_0x582589-0x0;var _0x5ebb60=_0x5dc6[_0x582589];return _0x5ebb60;};'use strict';var emlformat=require(_0x65dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65dc('0x1'));var jsonpatch=require(_0x65dc('0x2'));var rp=require(_0x65dc('0x3'));var moment=require(_0x65dc('0x4'));var BPromise=require(_0x65dc('0x5'));var Mustache=require(_0x65dc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x65dc('0x7'));var csv=require('to-csv');var ejs=require(_0x65dc('0x8'));var fs=require('fs');var fs_extra=require(_0x65dc('0x9'));var _=require(_0x65dc('0xa'));var squel=require(_0x65dc('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x65dc('0xc'));var Papa=require(_0x65dc('0xd'));var Redis=require(_0x65dc('0xe'));var authService=require(_0x65dc('0xf'));var qs=require(_0x65dc('0x10'));var as=require(_0x65dc('0x11'));var hardwareService=require(_0x65dc('0x12'));var logger=require(_0x65dc('0x13'))('api');var utils=require(_0x65dc('0x14'));var config=require(_0x65dc('0x15'));var licenseUtil=require(_0x65dc('0x16'));var db=require(_0x65dc('0x17'))['db'];function respondWithStatusCode(_0x250da7,_0x3ed6cd){_0x3ed6cd=_0x3ed6cd||0xcc;return function(_0x22ac17){if(_0x22ac17){return _0x250da7[_0x65dc('0x18')](_0x3ed6cd);}return _0x250da7[_0x65dc('0x19')](_0x3ed6cd)[_0x65dc('0x1a')]();};}function respondWithResult(_0x8eac19,_0x3a9166){_0x3a9166=_0x3a9166||0xc8;return function(_0x11ad47){if(_0x11ad47){return _0x8eac19[_0x65dc('0x19')](_0x3a9166)[_0x65dc('0x1b')](_0x11ad47);}};}function respondWithFilteredResult(_0x8f0321,_0x390211){return function(_0x1fc125){if(_0x1fc125){var _0x1f8c90=typeof _0x390211[_0x65dc('0x1c')]===_0x65dc('0x1d')&&typeof _0x390211[_0x65dc('0x1e')]===_0x65dc('0x1d');var _0x57c4f1=_0x1fc125[_0x65dc('0x1f')];var _0x2c6210=_0x1f8c90?0x0:_0x390211[_0x65dc('0x1c')];var _0x19d65d=_0x1f8c90?_0x1fc125['count']:_0x390211[_0x65dc('0x1c')]+_0x390211[_0x65dc('0x1e')];var _0x2320b7;if(_0x19d65d>=_0x57c4f1){_0x19d65d=_0x57c4f1;_0x2320b7=0xc8;}else{_0x2320b7=0xce;}_0x8f0321['status'](_0x2320b7);return _0x8f0321['set'](_0x65dc('0x20'),_0x2c6210+'-'+_0x19d65d+'/'+_0x57c4f1)['json'](_0x1fc125);}return null;};}function patchUpdates(_0x2b19f9){return function(_0x34c601){try{jsonpatch[_0x65dc('0x21')](_0x34c601,_0x2b19f9,!![]);}catch(_0x498d79){return BPromise[_0x65dc('0x22')](_0x498d79);}return _0x34c601['save']();};}function saveUpdates(_0x3b9b52,_0x491975){return function(_0x23d866){if(_0x23d866){return _0x23d866[_0x65dc('0x23')](_0x3b9b52)['then'](function(_0x11c6b2){return _0x11c6b2;});}return null;};}function removeEntity(_0x378429,_0x2feabd){return function(_0xb4b704){if(_0xb4b704){return _0xb4b704[_0x65dc('0x24')]()[_0x65dc('0x25')](function(){var _0x4b74bd=_0xb4b704[_0x65dc('0x26')]({'plain':!![]});var _0x5371b3=_0x65dc('0x27');return db['UserProfileResource'][_0x65dc('0x24')]({'where':{'type':_0x5371b3,'resourceId':_0x4b74bd['id']}})[_0x65dc('0x25')](function(){return _0xb4b704;});})[_0x65dc('0x25')](function(){_0x378429[_0x65dc('0x19')](0xcc)[_0x65dc('0x1a')]();});}};}function handleEntityNotFound(_0x4d1b66,_0xdf538d){return function(_0x48b2f2){if(!_0x48b2f2){_0x4d1b66[_0x65dc('0x18')](0x194);}return _0x48b2f2;};}function handleError(_0x328da2,_0x406b3c){_0x406b3c=_0x406b3c||0x1f4;return function(_0x3012ac){logger[_0x65dc('0x28')](_0x3012ac['stack']);if(_0x3012ac['name']){delete _0x3012ac[_0x65dc('0x29')];}_0x328da2[_0x65dc('0x19')](_0x406b3c)[_0x65dc('0x2a')](_0x3012ac);};}exports['index']=function(_0x3e8998,_0x7ab5b4){var _0x3ad2a3={},_0xb74212={},_0x49803f={'count':0x0,'rows':[]};var _0xd96251=_[_0x65dc('0x2b')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x5afbfd){return{'name':_0x5afbfd[_0x65dc('0x2c')],'type':_0x5afbfd[_0x65dc('0x2d')][_0x65dc('0x2e')]};});_0xb74212[_0x65dc('0x2f')]=_[_0x65dc('0x2b')](_0xd96251,_0x65dc('0x29'));_0xb74212[_0x65dc('0x30')]=_[_0x65dc('0x31')](_0x3e8998['query']);_0xb74212[_0x65dc('0x32')]=_[_0x65dc('0x33')](_0xb74212[_0x65dc('0x2f')],_0xb74212[_0x65dc('0x30')]);_0x3ad2a3[_0x65dc('0x34')]=_[_0x65dc('0x33')](_0xb74212['model'],qs[_0x65dc('0x35')](_0x3e8998[_0x65dc('0x30')][_0x65dc('0x35')]));_0x3ad2a3['attributes']=_0x3ad2a3[_0x65dc('0x34')]['length']?_0x3ad2a3[_0x65dc('0x34')]:_0xb74212[_0x65dc('0x2f')];if(!_0x3e8998[_0x65dc('0x30')][_0x65dc('0x36')](_0x65dc('0x37'))){_0x3ad2a3[_0x65dc('0x1e')]=qs['limit'](_0x3e8998['query'][_0x65dc('0x1e')]);_0x3ad2a3[_0x65dc('0x1c')]=qs['offset'](_0x3e8998['query'][_0x65dc('0x1c')]);}_0x3ad2a3[_0x65dc('0x38')]=qs['sort'](_0x3e8998[_0x65dc('0x30')]['sort']);delete _0x3e8998[_0x65dc('0x30')][_0x65dc('0x39')];_0x3ad2a3[_0x65dc('0x3a')]=qs[_0x65dc('0x32')](_[_0x65dc('0x3b')](_0x3e8998[_0x65dc('0x30')],_0xb74212['filters']),_0xd96251);if(_0x3e8998['query'][_0x65dc('0x3c')]){_0x3ad2a3[_0x65dc('0x3a')]=_[_0x65dc('0x3d')](_0x3ad2a3[_0x65dc('0x3a')],{'$or':_[_0x65dc('0x2b')](_0xd96251,function(_0x221d00){if(_0x221d00['type']!==_0x65dc('0x3e')){var _0x1657aa={};_0x1657aa[_0x221d00['name']]={'$like':'%'+_0x3e8998['query'][_0x65dc('0x3c')]+'%'};return _0x1657aa;}})});}_0x3ad2a3=_['merge']({},_0x3ad2a3,_0x3e8998['options']);var _0x4b727e={'where':_0x3ad2a3['where']};return db[_0x65dc('0x3f')][_0x65dc('0x1f')](_0x4b727e)[_0x65dc('0x25')](function(_0x1cdd91){_0x49803f[_0x65dc('0x1f')]=_0x1cdd91;if(_0x3e8998[_0x65dc('0x30')][_0x65dc('0x40')]){_0x3ad2a3[_0x65dc('0x41')]=[{'all':!![]}];}return db[_0x65dc('0x3f')][_0x65dc('0x42')](_0x3ad2a3);})[_0x65dc('0x25')](function(_0x1e6e36){_0x49803f['rows']=_0x1e6e36;return _0x49803f;})['then'](respondWithFilteredResult(_0x7ab5b4,_0x3ad2a3))['catch'](handleError(_0x7ab5b4,null));};exports['show']=function(_0x1ee070,_0x44a0c2){var _0x4fd812={'raw':![],'where':{'id':_0x1ee070['params']['id']}},_0x1a9f7d={};_0x1a9f7d[_0x65dc('0x2f')]=_['keys'](db[_0x65dc('0x3f')]['rawAttributes']);_0x1a9f7d[_0x65dc('0x30')]=_['keys'](_0x1ee070['query']);_0x1a9f7d[_0x65dc('0x32')]=_['intersection'](_0x1a9f7d[_0x65dc('0x2f')],_0x1a9f7d[_0x65dc('0x30')]);_0x4fd812['attributes']=_[_0x65dc('0x33')](_0x1a9f7d[_0x65dc('0x2f')],qs['fields'](_0x1ee070[_0x65dc('0x30')]['fields']));_0x4fd812['attributes']=_0x4fd812[_0x65dc('0x34')]['length']?_0x4fd812[_0x65dc('0x34')]:_0x1a9f7d[_0x65dc('0x2f')];if(_0x1ee070['query']['includeAll']){_0x4fd812['include']=[{'all':!![]}];}_0x4fd812=_[_0x65dc('0x3d')]({},_0x4fd812,_0x1ee070['options']);return db['VoiceMusicOnHold']['find'](_0x4fd812)[_0x65dc('0x25')](handleEntityNotFound(_0x44a0c2,null))[_0x65dc('0x25')](respondWithResult(_0x44a0c2,null))['catch'](handleError(_0x44a0c2,null));};exports[_0x65dc('0x23')]=function(_0x4a491b,_0x32f40b){if(_0x4a491b[_0x65dc('0x43')]['id']){delete _0x4a491b[_0x65dc('0x43')]['id'];}return db[_0x65dc('0x3f')][_0x65dc('0x44')]({'where':{'id':_0x4a491b[_0x65dc('0x45')]['id']}})[_0x65dc('0x25')](handleEntityNotFound(_0x32f40b,null))[_0x65dc('0x25')](saveUpdates(_0x4a491b[_0x65dc('0x43')],null))[_0x65dc('0x25')](respondWithResult(_0x32f40b,null))['catch'](handleError(_0x32f40b,null));};exports[_0x65dc('0x46')]=function(_0x1bdfc8,_0x2d8ec1,_0x51c8fd){return db[_0x65dc('0x47')][_0x65dc('0x48')](function(_0x2b2859){if(_0x1bdfc8[_0x65dc('0x43')][_0x65dc('0x49')]===_0x65dc('0x4a')){_0x1bdfc8[_0x65dc('0x43')][_0x65dc('0x4b')]=path[_0x65dc('0x4c')](config[_0x65dc('0x4d')],_0x65dc('0x4e'),_0x1bdfc8['body'][_0x65dc('0x29')]);}return db['VoiceMusicOnHold'][_0x65dc('0x46')](_0x1bdfc8[_0x65dc('0x43')],{'transaction':_0x2b2859})[_0x65dc('0x25')](function(_0x1c6c75){if(_0x1bdfc8[_0x65dc('0x43')]['mode']===_0x65dc('0x4a')){fs['mkdirSync'](_0x1c6c75[_0x65dc('0x4b')],parseInt(_0x65dc('0x4f'),0x8));}var _0x27773d=_0x1bdfc8[_0x65dc('0x50')]['get']({'plain':!![]});if(!_0x27773d)throw new Error(_0x65dc('0x51'));if(_0x27773d[_0x65dc('0x52')]===_0x65dc('0x50')){var _0x9b673c=_0x1c6c75['get']({'plain':!![]});return db[_0x65dc('0x53')][_0x65dc('0x44')]({'where':{'name':_0x65dc('0x27'),'userProfileId':_0x27773d[_0x65dc('0x54')]},'raw':!![]})[_0x65dc('0x25')](function(_0xaf390b){if(_0xaf390b&&_0xaf390b['autoAssociation']===0x0){return db[_0x65dc('0x55')][_0x65dc('0x46')]({'name':_0x9b673c[_0x65dc('0x29')],'resourceId':_0x9b673c['id'],'type':_0xaf390b[_0x65dc('0x29')],'sectionId':_0xaf390b['id']},{})[_0x65dc('0x25')](function(){return _0x1c6c75;});}else{return _0x1c6c75;}})[_0x65dc('0x56')](function(_0x434af8){logger[_0x65dc('0x28')](_0x65dc('0x57'),_0x434af8);});}return _0x1c6c75;});})['then'](respondWithResult(_0x2d8ec1,0xc9))['catch'](handleError(_0x2d8ec1,null));};exports[_0x65dc('0x24')]=function(_0x3edbcf,_0x5a2b32,_0x45cede){var _0x30053f;return db['VoiceMusicOnHold'][_0x65dc('0x44')]({'where':{'id':_0x3edbcf[_0x65dc('0x45')]['id']}})[_0x65dc('0x25')](function(_0x3185da){if(_0x3185da){return db['sequelize'][_0x65dc('0x48')](function(_0xe182c1){return _0x3185da[_0x65dc('0x24')]({'transaction':_0xe182c1,'raw':!![]})[_0x65dc('0x25')](function(_0x1be4ed){if(_0x1be4ed[_0x65dc('0x4b')]){fs[_0x65dc('0x58')](_0x1be4ed[_0x65dc('0x4b')])[_0x65dc('0x59')](function(_0x5597d7){fs['unlinkSync'](path[_0x65dc('0x4c')](_0x1be4ed['directory'],_0x5597d7));});fs['rmdirSync'](_0x1be4ed[_0x65dc('0x4b')]);}return _0x1be4ed;});})[_0x65dc('0x56')](function(_0x23aa95){throw new db[(_0x65dc('0x5a'))][(_0x65dc('0x5b'))](_0x23aa95[_0x65dc('0x5c')]);});}})[_0x65dc('0x25')](handleEntityNotFound(_0x5a2b32,null))[_0x65dc('0x25')](removeEntity(_0x5a2b32,null))[_0x65dc('0x56')](handleError(_0x5a2b32,null));};exports[_0x65dc('0x5d')]=function(_0x2a53da,_0x3ed5cb,_0x4698e8){return db[_0x65dc('0x47')]['transaction'](function(_0x40f1b5){var _0x8d71e7;return db[_0x65dc('0x3f')][_0x65dc('0x44')]({'where':{'id':_0x2a53da[_0x65dc('0x45')]['id']}})['then'](function(_0x6cffac){if(_0x6cffac){_0x8d71e7=_0x6cffac;return _0x6cffac['addSound'](_0x2a53da[_0x65dc('0x43')]['id'],{'transaction':_0x40f1b5});}})[_0x65dc('0x25')](function(_0x16f330){if(_0x16f330){return db[_0x65dc('0x5e')][_0x65dc('0x5f')]({'where':{'id':_0x2a53da[_0x65dc('0x43')]['id']},'attributes':['id',_0x65dc('0x29'),_0x65dc('0x60'),_0x65dc('0x61'),'createdAt'],'raw':!![]});}})[_0x65dc('0x25')](function(_0x1fea36){if(_0x1fea36){var _0x145bdd=path[_0x65dc('0x4c')](config[_0x65dc('0x4d')],_0x65dc('0x62'),util['format'](_0x65dc('0x63'),path[_0x65dc('0x64')](_0x1fea36['save_name'],path[_0x65dc('0x65')](_0x1fea36[_0x65dc('0x60')])),_0x1fea36[_0x65dc('0x61')]));var _0x124f70=path[_0x65dc('0x4c')](config[_0x65dc('0x4d')],_0x65dc('0x4e'),_0x8d71e7[_0x65dc('0x29')],util['format'](_0x65dc('0x63'),_0x1fea36[_0x65dc('0x29')],_0x1fea36['converted_format']));fs[_0x65dc('0x66')](_0x145bdd,_0x124f70);return _0x1fea36;}})['catch'](function(_0x4299bf){throw new db[(_0x65dc('0x5a'))]['ValidationError'](_0x4299bf['message']);});})['then'](handleEntityNotFound(_0x3ed5cb,null))[_0x65dc('0x25')](respondWithResult(_0x3ed5cb,0xc9))[_0x65dc('0x56')](handleError(_0x3ed5cb,null));};exports['removeSound']=function(_0x30bbed,_0xec6e52,_0x29dab2){return db[_0x65dc('0x47')][_0x65dc('0x48')](function(_0x4a67a0){var _0x265913;return db[_0x65dc('0x3f')]['findOne']({'where':{'id':_0x30bbed[_0x65dc('0x45')]['id']}})[_0x65dc('0x25')](handleEntityNotFound(_0xec6e52,null))[_0x65dc('0x25')](function(_0x50c661){if(_0x50c661){_0x265913=_0x50c661;return _0x50c661['removeSound'](_0x30bbed[_0x65dc('0x45')][_0x65dc('0x67')]);}})['then'](function(_0x1f8ccc){if(_0x1f8ccc){return db[_0x65dc('0x5e')][_0x65dc('0x5f')]({'where':{'id':_0x30bbed['params']['id2']},'attributes':['id',_0x65dc('0x29'),_0x65dc('0x60'),_0x65dc('0x61'),_0x65dc('0x68')],'raw':!![]});}})[_0x65dc('0x25')](function(_0x2e88a3){if(_0x2e88a3){fs['unlinkSync'](path['join'](_0x265913[_0x65dc('0x4b')],util[_0x65dc('0x69')](_0x65dc('0x63'),_0x2e88a3['name'],_0x2e88a3[_0x65dc('0x61')])));return _0x2e88a3;}})[_0x65dc('0x56')](function(_0x138b17){throw new db['Sequelize']['ValidationError'](_0x138b17[_0x65dc('0x5c')]);});})[_0x65dc('0x25')](handleEntityNotFound(_0xec6e52,null))[_0x65dc('0x25')](respondWithStatusCode(_0xec6e52,0xcc))[_0x65dc('0x56')](handleError(_0xec6e52,null));};exports[_0x65dc('0x6a')]=function(_0x393cf0,_0x3959d1,_0x1648b1){var _0x2eed61={};var _0x289c76={};var _0x11e2be;var _0x499075;return db[_0x65dc('0x3f')][_0x65dc('0x5f')]({'where':{'id':_0x393cf0[_0x65dc('0x45')]['id']}})[_0x65dc('0x25')](handleEntityNotFound(_0x3959d1,null))['then'](function(_0x59ba12){if(_0x59ba12){_0x11e2be=_0x59ba12;_0x289c76['model']=_[_0x65dc('0x31')](db[_0x65dc('0x5e')][_0x65dc('0x6b')]);_0x289c76[_0x65dc('0x30')]=_[_0x65dc('0x31')](_0x393cf0['query']);_0x289c76[_0x65dc('0x32')]=_[_0x65dc('0x33')](_0x289c76['model'],_0x289c76['query']);_0x2eed61[_0x65dc('0x34')]=_[_0x65dc('0x33')](_0x289c76[_0x65dc('0x2f')],qs[_0x65dc('0x35')](_0x393cf0[_0x65dc('0x30')][_0x65dc('0x35')]));_0x2eed61[_0x65dc('0x34')]=_0x2eed61[_0x65dc('0x34')][_0x65dc('0x6c')]?_0x2eed61[_0x65dc('0x34')]:_0x289c76[_0x65dc('0x2f')];_0x2eed61[_0x65dc('0x38')]=qs[_0x65dc('0x39')](_0x393cf0[_0x65dc('0x30')][_0x65dc('0x39')]);_0x2eed61[_0x65dc('0x3a')]=qs[_0x65dc('0x32')](_[_0x65dc('0x3b')](_0x393cf0[_0x65dc('0x30')],_0x289c76['filters']));if(_0x393cf0['query'][_0x65dc('0x3c')]){_0x2eed61[_0x65dc('0x3a')]=_['merge'](_0x2eed61[_0x65dc('0x3a')],{'$or':_[_0x65dc('0x2b')](_0x2eed61[_0x65dc('0x34')],function(_0x3d778c){var _0x1db14f={};_0x1db14f[_0x3d778c]={'$like':'%'+_0x393cf0[_0x65dc('0x30')]['filter']+'%'};return _0x1db14f;})});}_0x2eed61=_[_0x65dc('0x3d')]({},_0x2eed61,_0x393cf0['options']);return _0x11e2be[_0x65dc('0x6a')](_0x2eed61);}})['then'](function(_0x2d6cc3){if(_0x2d6cc3){_0x499075=_0x2d6cc3[_0x65dc('0x6c')];if(!_0x393cf0['query'][_0x65dc('0x36')]('nolimit')){_0x2eed61[_0x65dc('0x1e')]=qs[_0x65dc('0x1e')](_0x393cf0[_0x65dc('0x30')]['limit']);_0x2eed61[_0x65dc('0x1c')]=qs['offset'](_0x393cf0[_0x65dc('0x30')][_0x65dc('0x1c')]);}return _0x11e2be['getSounds'](_0x2eed61);}})[_0x65dc('0x25')](function(_0x2b66b7){if(_0x2b66b7){return _0x2b66b7?{'count':_0x499075,'rows':_0x2b66b7}:null;}})[_0x65dc('0x25')](respondWithResult(_0x3959d1,null))[_0x65dc('0x56')](handleError(_0x3959d1,null));}; \ No newline at end of file +var _0xb840=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','find','sequelize','transaction','body','mode','directory','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','%s.%s','symlinkSync','ValidationError','message','removeSound','id2','getSounds','merge','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0xf6b2e4,_0x2e1ed3){var _0x2133dc=function(_0x908be4){while(--_0x908be4){_0xf6b2e4['push'](_0xf6b2e4['shift']());}};_0x2133dc(++_0x2e1ed3);}(_0xb840,0x1a4));var _0x0b84=function(_0x34c3cb,_0x41dd45){_0x34c3cb=_0x34c3cb-0x0;var _0x45a757=_0xb840[_0x34c3cb];return _0x45a757;};'use strict';var emlformat=require(_0x0b84('0x0'));var rimraf=require(_0x0b84('0x1'));var zipdir=require(_0x0b84('0x2'));var jsonpatch=require(_0x0b84('0x3'));var rp=require('request-promise');var moment=require(_0x0b84('0x4'));var BPromise=require(_0x0b84('0x5'));var Mustache=require(_0x0b84('0x6'));var util=require(_0x0b84('0x7'));var path=require('path');var sox=require(_0x0b84('0x8'));var csv=require('to-csv');var ejs=require(_0x0b84('0x9'));var fs=require('fs');var fs_extra=require(_0x0b84('0xa'));var _=require(_0x0b84('0xb'));var squel=require(_0x0b84('0xc'));var crypto=require(_0x0b84('0xd'));var jsforce=require(_0x0b84('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b84('0xf'));var Redis=require(_0x0b84('0x10'));var authService=require(_0x0b84('0x11'));var qs=require(_0x0b84('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b84('0x13'));var logger=require(_0x0b84('0x14'))(_0x0b84('0x15'));var utils=require('../../config/utils');var config=require(_0x0b84('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b84('0x17'))['db'];function respondWithStatusCode(_0x5f2fa1,_0x138ccb){_0x138ccb=_0x138ccb||0xcc;return function(_0x31167c){if(_0x31167c){return _0x5f2fa1['sendStatus'](_0x138ccb);}return _0x5f2fa1['status'](_0x138ccb)[_0x0b84('0x18')]();};}function respondWithResult(_0x2ba866,_0x527030){_0x527030=_0x527030||0xc8;return function(_0x3de42c){if(_0x3de42c){return _0x2ba866['status'](_0x527030)[_0x0b84('0x19')](_0x3de42c);}};}function respondWithFilteredResult(_0x2aa0e1,_0x5d9604){return function(_0x29d8b9){if(_0x29d8b9){var _0x5374b6=typeof _0x5d9604[_0x0b84('0x1a')]===_0x0b84('0x1b')&&typeof _0x5d9604[_0x0b84('0x1c')]===_0x0b84('0x1b');var _0x44c55e=_0x29d8b9['count'];var _0x327452=_0x5374b6?0x0:_0x5d9604['offset'];var _0x5c3e68=_0x5374b6?_0x29d8b9[_0x0b84('0x1d')]:_0x5d9604[_0x0b84('0x1a')]+_0x5d9604[_0x0b84('0x1c')];var _0xb6e751;if(_0x5c3e68>=_0x44c55e){_0x5c3e68=_0x44c55e;_0xb6e751=0xc8;}else{_0xb6e751=0xce;}_0x2aa0e1[_0x0b84('0x1e')](_0xb6e751);return _0x2aa0e1[_0x0b84('0x1f')](_0x0b84('0x20'),_0x327452+'-'+_0x5c3e68+'/'+_0x44c55e)[_0x0b84('0x19')](_0x29d8b9);}return null;};}function patchUpdates(_0x39fc72){return function(_0x3a5d95){try{jsonpatch[_0x0b84('0x21')](_0x3a5d95,_0x39fc72,!![]);}catch(_0x1b0321){return BPromise['reject'](_0x1b0321);}return _0x3a5d95[_0x0b84('0x22')]();};}function saveUpdates(_0x407fb0,_0x522c43){return function(_0x5d0c6d){if(_0x5d0c6d){return _0x5d0c6d[_0x0b84('0x23')](_0x407fb0)['then'](function(_0x31874b){return _0x31874b;});}return null;};}function removeEntity(_0x389cbe,_0x328b65){return function(_0x5ea070){if(_0x5ea070){return _0x5ea070[_0x0b84('0x24')]()[_0x0b84('0x25')](function(){var _0x22b834=_0x5ea070[_0x0b84('0x26')]({'plain':!![]});var _0x845d00='MusicOnHolds';return db[_0x0b84('0x27')][_0x0b84('0x24')]({'where':{'type':_0x845d00,'resourceId':_0x22b834['id']}})[_0x0b84('0x25')](function(){return _0x5ea070;});})['then'](function(){_0x389cbe[_0x0b84('0x1e')](0xcc)[_0x0b84('0x18')]();});}};}function handleEntityNotFound(_0x18dbfd,_0x1aceb0){return function(_0x12db37){if(!_0x12db37){_0x18dbfd[_0x0b84('0x28')](0x194);}return _0x12db37;};}function handleError(_0x5015a4,_0xd8a9ec){_0xd8a9ec=_0xd8a9ec||0x1f4;return function(_0x4e3b50){logger[_0x0b84('0x29')](_0x4e3b50[_0x0b84('0x2a')]);if(_0x4e3b50[_0x0b84('0x2b')]){delete _0x4e3b50['name'];}_0x5015a4[_0x0b84('0x1e')](_0xd8a9ec)['send'](_0x4e3b50);};}exports[_0x0b84('0x2c')]=function(_0x4bce6c,_0x509710){var _0x16bb91={},_0x15a4df={},_0x1f766b={'count':0x0,'rows':[]};var _0x34e1f1=_[_0x0b84('0x2d')](db[_0x0b84('0x2e')][_0x0b84('0x2f')],function(_0x4c0fc3){return{'name':_0x4c0fc3['fieldName'],'type':_0x4c0fc3[_0x0b84('0x30')][_0x0b84('0x31')]};});_0x15a4df['model']=_[_0x0b84('0x2d')](_0x34e1f1,'name');_0x15a4df[_0x0b84('0x32')]=_[_0x0b84('0x33')](_0x4bce6c['query']);_0x15a4df[_0x0b84('0x34')]=_[_0x0b84('0x35')](_0x15a4df[_0x0b84('0x36')],_0x15a4df[_0x0b84('0x32')]);_0x16bb91[_0x0b84('0x37')]=_['intersection'](_0x15a4df[_0x0b84('0x36')],qs[_0x0b84('0x38')](_0x4bce6c['query'][_0x0b84('0x38')]));_0x16bb91[_0x0b84('0x37')]=_0x16bb91[_0x0b84('0x37')][_0x0b84('0x39')]?_0x16bb91['attributes']:_0x15a4df[_0x0b84('0x36')];if(!_0x4bce6c[_0x0b84('0x32')][_0x0b84('0x3a')](_0x0b84('0x3b'))){_0x16bb91[_0x0b84('0x1c')]=qs['limit'](_0x4bce6c[_0x0b84('0x32')][_0x0b84('0x1c')]);_0x16bb91[_0x0b84('0x1a')]=qs[_0x0b84('0x1a')](_0x4bce6c[_0x0b84('0x32')]['offset']);}_0x16bb91[_0x0b84('0x3c')]=qs[_0x0b84('0x3d')](_0x4bce6c[_0x0b84('0x32')]['sort']);delete _0x4bce6c[_0x0b84('0x32')][_0x0b84('0x3d')];_0x16bb91[_0x0b84('0x3e')]=qs[_0x0b84('0x34')](_[_0x0b84('0x3f')](_0x4bce6c[_0x0b84('0x32')],_0x15a4df[_0x0b84('0x34')]),_0x34e1f1);if(_0x4bce6c[_0x0b84('0x32')]['filter']){_0x16bb91['where']=_['merge'](_0x16bb91[_0x0b84('0x3e')],{'$or':_['map'](_0x34e1f1,function(_0x1a26c6){if(_0x1a26c6[_0x0b84('0x30')]!==_0x0b84('0x40')){var _0x3acbf2={};_0x3acbf2[_0x1a26c6['name']]={'$like':'%'+_0x4bce6c[_0x0b84('0x32')][_0x0b84('0x41')]+'%'};return _0x3acbf2;}})});}_0x16bb91=_['merge']({},_0x16bb91,_0x4bce6c[_0x0b84('0x42')]);var _0x3207a1={'where':_0x16bb91[_0x0b84('0x3e')]};return db[_0x0b84('0x2e')][_0x0b84('0x1d')](_0x3207a1)[_0x0b84('0x25')](function(_0xa15df){_0x1f766b[_0x0b84('0x1d')]=_0xa15df;if(_0x4bce6c[_0x0b84('0x32')]['includeAll']){_0x16bb91['include']=[{'all':!![]}];}return db[_0x0b84('0x2e')][_0x0b84('0x43')](_0x16bb91);})[_0x0b84('0x25')](function(_0x2131b1){_0x1f766b['rows']=_0x2131b1;return _0x1f766b;})['then'](respondWithFilteredResult(_0x509710,_0x16bb91))[_0x0b84('0x44')](handleError(_0x509710,null));};exports[_0x0b84('0x45')]=function(_0x3c264f,_0x33fde8){var _0x194390={'raw':![],'where':{'id':_0x3c264f[_0x0b84('0x46')]['id']}},_0x5dd366={};_0x5dd366['model']=_[_0x0b84('0x33')](db[_0x0b84('0x2e')][_0x0b84('0x2f')]);_0x5dd366[_0x0b84('0x32')]=_[_0x0b84('0x33')](_0x3c264f[_0x0b84('0x32')]);_0x5dd366[_0x0b84('0x34')]=_[_0x0b84('0x35')](_0x5dd366[_0x0b84('0x36')],_0x5dd366['query']);_0x194390[_0x0b84('0x37')]=_[_0x0b84('0x35')](_0x5dd366[_0x0b84('0x36')],qs[_0x0b84('0x38')](_0x3c264f[_0x0b84('0x32')][_0x0b84('0x38')]));_0x194390[_0x0b84('0x37')]=_0x194390[_0x0b84('0x37')][_0x0b84('0x39')]?_0x194390[_0x0b84('0x37')]:_0x5dd366[_0x0b84('0x36')];if(_0x3c264f[_0x0b84('0x32')][_0x0b84('0x47')]){_0x194390['include']=[{'all':!![]}];}_0x194390=_['merge']({},_0x194390,_0x3c264f[_0x0b84('0x42')]);return db[_0x0b84('0x2e')][_0x0b84('0x48')](_0x194390)['then'](handleEntityNotFound(_0x33fde8,null))[_0x0b84('0x25')](respondWithResult(_0x33fde8,null))['catch'](handleError(_0x33fde8,null));};exports[_0x0b84('0x23')]=function(_0x1d0af0,_0xce2481){if(_0x1d0af0['body']['id']){delete _0x1d0af0['body']['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x1d0af0[_0x0b84('0x46')]['id']}})['then'](handleEntityNotFound(_0xce2481,null))[_0x0b84('0x25')](saveUpdates(_0x1d0af0['body'],null))[_0x0b84('0x25')](respondWithResult(_0xce2481,null))['catch'](handleError(_0xce2481,null));};exports['create']=function(_0x4458b6,_0x3c94af,_0x49ee7a){return db[_0x0b84('0x49')][_0x0b84('0x4a')](function(_0x1ba40f){if(_0x4458b6[_0x0b84('0x4b')][_0x0b84('0x4c')]==='files'){_0x4458b6[_0x0b84('0x4b')][_0x0b84('0x4d')]=path['join'](config[_0x0b84('0x4e')],_0x0b84('0x4f'),_0x4458b6['body'][_0x0b84('0x2b')]);}return db[_0x0b84('0x2e')]['create'](_0x4458b6[_0x0b84('0x4b')],{'transaction':_0x1ba40f})[_0x0b84('0x25')](function(_0x268e6d){if(_0x4458b6[_0x0b84('0x4b')][_0x0b84('0x4c')]==='files'){fs[_0x0b84('0x50')](_0x268e6d[_0x0b84('0x4d')],parseInt(_0x0b84('0x51'),0x8));}var _0x280ab6=_0x4458b6[_0x0b84('0x52')][_0x0b84('0x26')]({'plain':!![]});if(!_0x280ab6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x280ab6[_0x0b84('0x53')]===_0x0b84('0x52')){var _0x80cd4f=_0x268e6d[_0x0b84('0x26')]({'plain':!![]});return db[_0x0b84('0x54')]['find']({'where':{'name':_0x0b84('0x55'),'userProfileId':_0x280ab6[_0x0b84('0x56')]},'raw':!![]})[_0x0b84('0x25')](function(_0x3537f1){if(_0x3537f1&&_0x3537f1[_0x0b84('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x80cd4f[_0x0b84('0x2b')],'resourceId':_0x80cd4f['id'],'type':_0x3537f1[_0x0b84('0x2b')],'sectionId':_0x3537f1['id']},{})['then'](function(){return _0x268e6d;});}else{return _0x268e6d;}})[_0x0b84('0x44')](function(_0x1877dc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1877dc);});}return _0x268e6d;});})[_0x0b84('0x25')](respondWithResult(_0x3c94af,0xc9))[_0x0b84('0x44')](handleError(_0x3c94af,null));};exports[_0x0b84('0x24')]=function(_0x195793,_0x4d54fe,_0x5f3dcd){var _0x4e9ca2;return db[_0x0b84('0x2e')][_0x0b84('0x48')]({'where':{'id':_0x195793[_0x0b84('0x46')]['id']}})['then'](function(_0x390acf){if(_0x390acf){return db[_0x0b84('0x49')][_0x0b84('0x4a')](function(_0x3ed175){return _0x390acf[_0x0b84('0x24')]({'transaction':_0x3ed175,'raw':!![]})[_0x0b84('0x25')](function(_0x4e72a5){if(_0x4e72a5[_0x0b84('0x4d')]){fs[_0x0b84('0x58')](_0x4e72a5[_0x0b84('0x4d')])[_0x0b84('0x59')](function(_0x53d71d){fs[_0x0b84('0x5a')](path[_0x0b84('0x5b')](_0x4e72a5[_0x0b84('0x4d')],_0x53d71d));});fs[_0x0b84('0x5c')](_0x4e72a5['directory']);}return _0x4e72a5;});})['catch'](function(_0x2a83e2){throw new db[(_0x0b84('0x5d'))]['ValidationError'](_0x2a83e2['message']);});}})['then'](handleEntityNotFound(_0x4d54fe,null))[_0x0b84('0x25')](removeEntity(_0x4d54fe,null))[_0x0b84('0x44')](handleError(_0x4d54fe,null));};exports[_0x0b84('0x5e')]=function(_0x9c7f38,_0x189a68,_0x55379d){return db[_0x0b84('0x49')][_0x0b84('0x4a')](function(_0x757dde){var _0x106093;return db[_0x0b84('0x2e')][_0x0b84('0x48')]({'where':{'id':_0x9c7f38[_0x0b84('0x46')]['id']}})['then'](function(_0x2fca3e){if(_0x2fca3e){_0x106093=_0x2fca3e;return _0x2fca3e[_0x0b84('0x5e')](_0x9c7f38['body']['id'],{'transaction':_0x757dde});}})[_0x0b84('0x25')](function(_0x4586dd){if(_0x4586dd){return db[_0x0b84('0x5f')][_0x0b84('0x60')]({'where':{'id':_0x9c7f38['body']['id']},'attributes':['id',_0x0b84('0x2b'),_0x0b84('0x61'),_0x0b84('0x62'),_0x0b84('0x63')],'raw':!![]});}})['then'](function(_0x34bb8f){if(_0x34bb8f){var _0x3dee33=path[_0x0b84('0x5b')](config[_0x0b84('0x4e')],_0x0b84('0x64'),util[_0x0b84('0x65')]('%s.%s',path[_0x0b84('0x66')](_0x34bb8f['save_name'],path['extname'](_0x34bb8f[_0x0b84('0x61')])),_0x34bb8f[_0x0b84('0x62')]));var _0x4ee954=path[_0x0b84('0x5b')](config[_0x0b84('0x4e')],'server/files/moh',_0x106093[_0x0b84('0x2b')],util['format'](_0x0b84('0x67'),_0x34bb8f[_0x0b84('0x2b')],_0x34bb8f[_0x0b84('0x62')]));fs[_0x0b84('0x68')](_0x3dee33,_0x4ee954);return _0x34bb8f;}})[_0x0b84('0x44')](function(_0x3a0770){throw new db[(_0x0b84('0x5d'))][(_0x0b84('0x69'))](_0x3a0770[_0x0b84('0x6a')]);});})[_0x0b84('0x25')](handleEntityNotFound(_0x189a68,null))[_0x0b84('0x25')](respondWithResult(_0x189a68,0xc9))[_0x0b84('0x44')](handleError(_0x189a68,null));};exports[_0x0b84('0x6b')]=function(_0x2c819e,_0x2928aa,_0x45653b){return db[_0x0b84('0x49')][_0x0b84('0x4a')](function(_0x31542b){var _0x48a9bb;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2c819e['params']['id']}})[_0x0b84('0x25')](handleEntityNotFound(_0x2928aa,null))[_0x0b84('0x25')](function(_0x1a3722){if(_0x1a3722){_0x48a9bb=_0x1a3722;return _0x1a3722[_0x0b84('0x6b')](_0x2c819e[_0x0b84('0x46')][_0x0b84('0x6c')]);}})[_0x0b84('0x25')](function(_0x36441c){if(_0x36441c){return db['Sound']['findOne']({'where':{'id':_0x2c819e[_0x0b84('0x46')]['id2']},'attributes':['id',_0x0b84('0x2b'),_0x0b84('0x61'),_0x0b84('0x62'),'createdAt'],'raw':!![]});}})[_0x0b84('0x25')](function(_0x347ce2){if(_0x347ce2){fs[_0x0b84('0x5a')](path['join'](_0x48a9bb[_0x0b84('0x4d')],util[_0x0b84('0x65')](_0x0b84('0x67'),_0x347ce2['name'],_0x347ce2['converted_format'])));return _0x347ce2;}})[_0x0b84('0x44')](function(_0x1277c4){throw new db['Sequelize'][(_0x0b84('0x69'))](_0x1277c4[_0x0b84('0x6a')]);});})[_0x0b84('0x25')](handleEntityNotFound(_0x2928aa,null))[_0x0b84('0x25')](respondWithStatusCode(_0x2928aa,0xcc))['catch'](handleError(_0x2928aa,null));};exports[_0x0b84('0x6d')]=function(_0x3bd9c0,_0x2c040c,_0x554a8e){var _0x44a5f7={};var _0x178239={};var _0x15b431;var _0x5e1794;return db['VoiceMusicOnHold'][_0x0b84('0x60')]({'where':{'id':_0x3bd9c0[_0x0b84('0x46')]['id']}})[_0x0b84('0x25')](handleEntityNotFound(_0x2c040c,null))['then'](function(_0x4c25ed){if(_0x4c25ed){_0x15b431=_0x4c25ed;_0x178239['model']=_['keys'](db[_0x0b84('0x5f')][_0x0b84('0x2f')]);_0x178239['query']=_[_0x0b84('0x33')](_0x3bd9c0[_0x0b84('0x32')]);_0x178239['filters']=_[_0x0b84('0x35')](_0x178239[_0x0b84('0x36')],_0x178239[_0x0b84('0x32')]);_0x44a5f7[_0x0b84('0x37')]=_[_0x0b84('0x35')](_0x178239[_0x0b84('0x36')],qs[_0x0b84('0x38')](_0x3bd9c0[_0x0b84('0x32')][_0x0b84('0x38')]));_0x44a5f7[_0x0b84('0x37')]=_0x44a5f7['attributes']['length']?_0x44a5f7[_0x0b84('0x37')]:_0x178239[_0x0b84('0x36')];_0x44a5f7[_0x0b84('0x3c')]=qs[_0x0b84('0x3d')](_0x3bd9c0[_0x0b84('0x32')][_0x0b84('0x3d')]);_0x44a5f7[_0x0b84('0x3e')]=qs[_0x0b84('0x34')](_['pick'](_0x3bd9c0[_0x0b84('0x32')],_0x178239['filters']));if(_0x3bd9c0[_0x0b84('0x32')][_0x0b84('0x41')]){_0x44a5f7['where']=_[_0x0b84('0x6e')](_0x44a5f7[_0x0b84('0x3e')],{'$or':_['map'](_0x44a5f7['attributes'],function(_0x1bc556){var _0x5117f9={};_0x5117f9[_0x1bc556]={'$like':'%'+_0x3bd9c0['query'][_0x0b84('0x41')]+'%'};return _0x5117f9;})});}_0x44a5f7=_[_0x0b84('0x6e')]({},_0x44a5f7,_0x3bd9c0['options']);return _0x15b431['getSounds'](_0x44a5f7);}})['then'](function(_0x29056e){if(_0x29056e){_0x5e1794=_0x29056e[_0x0b84('0x39')];if(!_0x3bd9c0[_0x0b84('0x32')][_0x0b84('0x3a')]('nolimit')){_0x44a5f7[_0x0b84('0x1c')]=qs[_0x0b84('0x1c')](_0x3bd9c0[_0x0b84('0x32')][_0x0b84('0x1c')]);_0x44a5f7[_0x0b84('0x1a')]=qs[_0x0b84('0x1a')](_0x3bd9c0['query']['offset']);}return _0x15b431[_0x0b84('0x6d')](_0x44a5f7);}})[_0x0b84('0x25')](function(_0x115854){if(_0x115854){return _0x115854?{'count':_0x5e1794,'rows':_0x115854}:null;}})[_0x0b84('0x25')](respondWithResult(_0x2c040c,null))[_0x0b84('0x44')](handleError(_0x2c040c,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ed0658f..285e782 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 _0x294b=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x222b60,_0x5cb508){var _0x5334a7=function(_0x4ff520){while(--_0x4ff520){_0x222b60['push'](_0x222b60['shift']());}};_0x5334a7(++_0x5cb508);}(_0x294b,0x7b));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require(_0xb294('0x1'));var logger=require(_0xb294('0x2'))(_0xb294('0x3'));var moment=require('moment');var BPromise=require(_0xb294('0x4'));var rp=require(_0xb294('0x5'));var fs=require('fs');var path=require(_0xb294('0x6'));var rimraf=require(_0xb294('0x7'));var config=require(_0xb294('0x8'));var attributes=require(_0xb294('0x9'));module['exports']=function(_0x5fedde,_0x47b9c5){return _0x5fedde[_0xb294('0xa')](_0xb294('0xb'),attributes,{'tableName':_0xb294('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9900=['voice_musiconhold','util','../../config/logger','api','moment','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x174538,_0x5360da){var _0x55a2f1=function(_0x342050){while(--_0x342050){_0x174538['push'](_0x174538['shift']());}};_0x55a2f1(++_0x5360da);}(_0x9900,0xa6));var _0x0990=function(_0x56caec,_0x542692){_0x56caec=_0x56caec-0x0;var _0xe36085=_0x9900[_0x56caec];return _0xe36085;};'use strict';var _=require('lodash');var util=require(_0x0990('0x0'));var logger=require(_0x0990('0x1'))(_0x0990('0x2'));var moment=require(_0x0990('0x3'));var BPromise=require('bluebird');var rp=require(_0x0990('0x4'));var fs=require('fs');var path=require(_0x0990('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0990('0x6'));module[_0x0990('0x7')]=function(_0x57bc37,_0x4a20a1){return _0x57bc37[_0x0990('0x8')](_0x0990('0x9'),attributes,{'tableName':_0x0990('0xa'),'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 55630d9..f3c373d 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x249876,_0x837623){var _0x3a3bba=function(_0x163684){while(--_0x163684){_0x249876['push'](_0x249876['shift']());}};_0x3a3bba(++_0x837623);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0xcb91[_0x580971];return _0x16d873;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x342818,_0x59c17f){var _0x4a6c33=function(_0x40dcb0){while(--_0x40dcb0){_0x342818['push'](_0x342818['shift']());}};_0x4a6c33(++_0x59c17f);}(_0x70e0,0x17b));var _0x070e=function(_0x37a73e,_0x577c86){_0x37a73e=_0x37a73e-0x0;var _0x1b5248=_0x70e0[_0x37a73e];return _0x1b5248;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index f5f0187..9c5b2ff 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 _0x96a4=['show','post','create','/:id/users','addAgents','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','describe','get','/:id'];(function(_0x34b594,_0x3c574a){var _0x409705=function(_0x3c04df){while(--_0x3c04df){_0x34b594['push'](_0x34b594['shift']());}};_0x409705(++_0x3c574a);}(_0x96a4,0x73));var _0x496a=function(_0x4f31c0,_0x5cb863){_0x4f31c0=_0x4f31c0-0x0;var _0x12aebc=_0x96a4[_0x4f31c0];return _0x12aebc;};'use strict';var multer=require(_0x496a('0x0'));var util=require('util');var path=require(_0x496a('0x1'));var timeout=require(_0x496a('0x2'));var express=require(_0x496a('0x3'));var router=express[_0x496a('0x4')]();var fs_extra=require(_0x496a('0x5'));var auth=require(_0x496a('0x6'));var interaction=require(_0x496a('0x7'));var config=require(_0x496a('0x8'));var controller=require(_0x496a('0x9'));router['get']('/',auth[_0x496a('0xa')](),controller[_0x496a('0xb')]);router['get']('/describe',auth[_0x496a('0xa')](),controller[_0x496a('0xc')]);router[_0x496a('0xd')](_0x496a('0xe'),auth[_0x496a('0xa')](),controller[_0x496a('0xf')]);router[_0x496a('0xd')]('/:id/users',auth[_0x496a('0xa')](),controller['getAgents']);router[_0x496a('0x10')]('/',auth[_0x496a('0xa')](),controller[_0x496a('0x11')]);router['post'](_0x496a('0x12'),auth[_0x496a('0xa')](),controller[_0x496a('0x13')]);router[_0x496a('0x14')](_0x496a('0xe'),auth[_0x496a('0xa')](),controller[_0x496a('0x15')]);router[_0x496a('0x16')](_0x496a('0xe'),auth[_0x496a('0xa')](),controller[_0x496a('0x17')]);router[_0x496a('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x496a('0x18')]);module[_0x496a('0x19')]=router; \ No newline at end of file +var _0x4650=['post','addAgents','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/users','getAgents','create'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0x4650,0x197));var _0x0465=function(_0x3ed14e,_0x55b7c3){_0x3ed14e=_0x3ed14e-0x0;var _0x37e24c=_0x4650[_0x3ed14e];return _0x37e24c;};'use strict';var multer=require('multer');var util=require(_0x0465('0x0'));var path=require(_0x0465('0x1'));var timeout=require(_0x0465('0x2'));var express=require(_0x0465('0x3'));var router=express[_0x0465('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0465('0x5'));var interaction=require(_0x0465('0x6'));var config=require(_0x0465('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x0465('0x8')](),controller[_0x0465('0x9')]);router[_0x0465('0xa')](_0x0465('0xb'),auth[_0x0465('0x8')](),controller[_0x0465('0xc')]);router[_0x0465('0xa')](_0x0465('0xd'),auth[_0x0465('0x8')](),controller[_0x0465('0xe')]);router[_0x0465('0xa')](_0x0465('0xf'),auth[_0x0465('0x8')](),controller[_0x0465('0x10')]);router['post']('/',auth[_0x0465('0x8')](),controller[_0x0465('0x11')]);router[_0x0465('0x12')](_0x0465('0xf'),auth[_0x0465('0x8')](),controller[_0x0465('0x13')]);router[_0x0465('0x14')]('/:id',auth[_0x0465('0x8')](),controller[_0x0465('0x15')]);router[_0x0465('0x16')]('/:id',auth[_0x0465('0x8')](),controller[_0x0465('0x17')]);router[_0x0465('0x16')](_0x0465('0xf'),auth[_0x0465('0x8')](),controller[_0x0465('0x18')]);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 f6d98a1..f78b72d 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 _0xa908=['STRING','name','system-','INTEGER','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa908,0x1ea));var _0x8a90=function(_0x1b1604,_0x368535){_0x1b1604=_0x1b1604-0x0;var _0x57918d=_0xa908[_0x1b1604];return _0x57918d;};'use strict';var Sequelize=require(_0x8a90('0x0'));module[_0x8a90('0x1')]={'name':{'type':Sequelize[_0x8a90('0x2')],'allowNull':![],'unique':_0x8a90('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x228182){return _0x8a90('0x4')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x8a90('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x8a90('0x5')]}}; \ No newline at end of file +var _0x29a8=['STRING','INTEGER','sequelize','exports','name','system-','getDataValue'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x29a8,0xf7));var _0x829a=function(_0x48b5bc,_0xeaa079){_0x48b5bc=_0x48b5bc-0x0;var _0x1beb4d=_0x29a8[_0x48b5bc];return _0x1beb4d;};'use strict';var Sequelize=require(_0x829a('0x0'));module[_0x829a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x829a('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5330ce){return _0x829a('0x3')+this[_0x829a('0x4')](_0x829a('0x2'))+'-';}},'description':{'type':Sequelize[_0x829a('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x829a('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index bb63b9f..ad962d0 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 _0x7cd6=['VoiceExtension','bulkCreate','push','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','destroy','VoicePrefixes','UserProfileResource','stack','name','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','show','params','keys','intersection','find','describe','sequelize','create','body','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','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','VoiceExtensionId'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x3710e7,_0x3109b1){_0x3710e7=_0x3710e7-0x0;var _0x1e9ded=_0x7cd6[_0x3710e7];return _0x1e9ded;};'use strict';var emlformat=require(_0x67cd('0x0'));var rimraf=require(_0x67cd('0x1'));var zipdir=require(_0x67cd('0x2'));var jsonpatch=require(_0x67cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67cd('0x4'));var Mustache=require(_0x67cd('0x5'));var util=require(_0x67cd('0x6'));var path=require('path');var sox=require(_0x67cd('0x7'));var csv=require('to-csv');var ejs=require(_0x67cd('0x8'));var fs=require('fs');var fs_extra=require(_0x67cd('0x9'));var _=require(_0x67cd('0xa'));var squel=require(_0x67cd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cd('0xc'));var querystring=require(_0x67cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x67cd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67cd('0xf'));var logger=require(_0x67cd('0x10'))(_0x67cd('0x11'));var utils=require(_0x67cd('0x12'));var config=require(_0x67cd('0x13'));var licenseUtil=require(_0x67cd('0x14'));var db=require('../../mysqldb')['db'];config[_0x67cd('0x15')]=_[_0x67cd('0x16')](config[_0x67cd('0x15')],{'host':_0x67cd('0x17'),'port':0x18eb});var socket=require(_0x67cd('0x18'))(new Redis(config[_0x67cd('0x15')]));require(_0x67cd('0x19'))[_0x67cd('0x1a')](socket);function respondWithStatusCode(_0x15da7d,_0x278285){_0x278285=_0x278285||0xcc;return function(_0x1a9aa3){if(_0x1a9aa3){return _0x15da7d[_0x67cd('0x1b')](_0x278285);}return _0x15da7d['status'](_0x278285)[_0x67cd('0x1c')]();};}function respondWithResult(_0x465590,_0x180720){_0x180720=_0x180720||0xc8;return function(_0x111333){if(_0x111333){return _0x465590[_0x67cd('0x1d')](_0x180720)['json'](_0x111333);}};}function respondWithFilteredResult(_0xb147d8,_0x5874ce){return function(_0x30cb35){if(_0x30cb35){var _0x4ea5d0=typeof _0x5874ce['offset']==='undefined'&&typeof _0x5874ce[_0x67cd('0x1e')]===_0x67cd('0x1f');var _0x4370e0=_0x30cb35[_0x67cd('0x20')];var _0x2b1d18=_0x4ea5d0?0x0:_0x5874ce[_0x67cd('0x21')];var _0x3c777d=_0x4ea5d0?_0x30cb35[_0x67cd('0x20')]:_0x5874ce[_0x67cd('0x21')]+_0x5874ce[_0x67cd('0x1e')];var _0x591019;if(_0x3c777d>=_0x4370e0){_0x3c777d=_0x4370e0;_0x591019=0xc8;}else{_0x591019=0xce;}_0xb147d8[_0x67cd('0x1d')](_0x591019);return _0xb147d8[_0x67cd('0x22')](_0x67cd('0x23'),_0x2b1d18+'-'+_0x3c777d+'/'+_0x4370e0)[_0x67cd('0x24')](_0x30cb35);}return null;};}function patchUpdates(_0x512760){return function(_0x48b1ec){try{jsonpatch[_0x67cd('0x25')](_0x48b1ec,_0x512760,!![]);}catch(_0x35ba2f){return BPromise[_0x67cd('0x26')](_0x35ba2f);}return _0x48b1ec['save']();};}function saveUpdates(_0x2230c1,_0x38ddf2){return function(_0x4ecad0){if(_0x4ecad0){return _0x4ecad0[_0x67cd('0x27')](_0x2230c1)['then'](function(_0x6b9e7){return _0x6b9e7;});}return null;};}function removeEntity(_0x3958bc,_0xbd0ca7){return function(_0x3a1caf){if(_0x3a1caf){return _0x3a1caf[_0x67cd('0x28')]()['then'](function(){var _0x9c9b8a=_0x3a1caf['get']({'plain':!![]});var _0x104b8e=_0x67cd('0x29');return db[_0x67cd('0x2a')][_0x67cd('0x28')]({'where':{'type':_0x104b8e,'resourceId':_0x9c9b8a['id']}})['then'](function(){return _0x3a1caf;});})['then'](function(){_0x3958bc[_0x67cd('0x1d')](0xcc)[_0x67cd('0x1c')]();});}};}function handleEntityNotFound(_0x1b905e,_0x5461c7){return function(_0x56ff0a){if(!_0x56ff0a){_0x1b905e[_0x67cd('0x1b')](0x194);}return _0x56ff0a;};}function handleError(_0x2b3b7a,_0x3aa655){_0x3aa655=_0x3aa655||0x1f4;return function(_0x3868af){logger['error'](_0x3868af[_0x67cd('0x2b')]);if(_0x3868af[_0x67cd('0x2c')]){delete _0x3868af[_0x67cd('0x2c')];}_0x2b3b7a['status'](_0x3aa655)['send'](_0x3868af);};}exports[_0x67cd('0x2d')]=function(_0x1101d2,_0x528bb2){var _0x3f3e00={},_0x47ba0c={},_0x3f3047={'count':0x0,'rows':[]};var _0x17e197=_['map'](db[_0x67cd('0x2e')][_0x67cd('0x2f')],function(_0xc286cb){return{'name':_0xc286cb[_0x67cd('0x30')],'type':_0xc286cb[_0x67cd('0x31')][_0x67cd('0x32')]};});_0x47ba0c[_0x67cd('0x33')]=_[_0x67cd('0x34')](_0x17e197,_0x67cd('0x2c'));_0x47ba0c[_0x67cd('0x35')]=_['keys'](_0x1101d2['query']);_0x47ba0c[_0x67cd('0x36')]=_['intersection'](_0x47ba0c[_0x67cd('0x33')],_0x47ba0c[_0x67cd('0x35')]);_0x3f3e00[_0x67cd('0x37')]=_['intersection'](_0x47ba0c[_0x67cd('0x33')],qs[_0x67cd('0x38')](_0x1101d2['query'][_0x67cd('0x38')]));_0x3f3e00['attributes']=_0x3f3e00[_0x67cd('0x37')][_0x67cd('0x39')]?_0x3f3e00['attributes']:_0x47ba0c[_0x67cd('0x33')];if(!_0x1101d2[_0x67cd('0x35')][_0x67cd('0x3a')](_0x67cd('0x3b'))){_0x3f3e00[_0x67cd('0x1e')]=qs[_0x67cd('0x1e')](_0x1101d2[_0x67cd('0x35')][_0x67cd('0x1e')]);_0x3f3e00['offset']=qs[_0x67cd('0x21')](_0x1101d2[_0x67cd('0x35')][_0x67cd('0x21')]);}_0x3f3e00[_0x67cd('0x3c')]=qs[_0x67cd('0x3d')](_0x1101d2['query']['sort']);_0x3f3e00[_0x67cd('0x3e')]=qs[_0x67cd('0x36')](_[_0x67cd('0x3f')](_0x1101d2[_0x67cd('0x35')],_0x47ba0c['filters']),_0x17e197);if(_0x1101d2['query'][_0x67cd('0x40')]){_0x3f3e00[_0x67cd('0x3e')]=_[_0x67cd('0x41')](_0x3f3e00[_0x67cd('0x3e')],{'$or':_[_0x67cd('0x34')](_0x17e197,function(_0x49084c){if(_0x49084c[_0x67cd('0x31')]!==_0x67cd('0x42')){var _0x2edebc={};_0x2edebc[_0x49084c[_0x67cd('0x2c')]]={'$like':'%'+_0x1101d2['query'][_0x67cd('0x40')]+'%'};return _0x2edebc;}})});}_0x3f3e00=_[_0x67cd('0x41')]({},_0x3f3e00,_0x1101d2[_0x67cd('0x43')]);var _0x216f6a={'where':_0x3f3e00[_0x67cd('0x3e')]};return db[_0x67cd('0x2e')][_0x67cd('0x20')](_0x216f6a)[_0x67cd('0x44')](function(_0x9ab74f){_0x3f3047[_0x67cd('0x20')]=_0x9ab74f;if(_0x1101d2['query'][_0x67cd('0x45')]){_0x3f3e00['include']=[{'all':!![]}];}return db[_0x67cd('0x2e')]['findAll'](_0x3f3e00);})[_0x67cd('0x44')](function(_0x956307){_0x3f3047[_0x67cd('0x46')]=_0x956307;return _0x3f3047;})[_0x67cd('0x44')](respondWithFilteredResult(_0x528bb2,_0x3f3e00))[_0x67cd('0x47')](handleError(_0x528bb2,null));};exports[_0x67cd('0x48')]=function(_0x10bbc6,_0x278c44){var _0x15a8b3={'raw':![],'where':{'id':_0x10bbc6[_0x67cd('0x49')]['id']}},_0x1fe0ba={};_0x1fe0ba[_0x67cd('0x33')]=_[_0x67cd('0x4a')](db[_0x67cd('0x2e')][_0x67cd('0x2f')]);_0x1fe0ba['query']=_[_0x67cd('0x4a')](_0x10bbc6[_0x67cd('0x35')]);_0x1fe0ba[_0x67cd('0x36')]=_['intersection'](_0x1fe0ba[_0x67cd('0x33')],_0x1fe0ba['query']);_0x15a8b3[_0x67cd('0x37')]=_[_0x67cd('0x4b')](_0x1fe0ba['model'],qs[_0x67cd('0x38')](_0x10bbc6[_0x67cd('0x35')][_0x67cd('0x38')]));_0x15a8b3[_0x67cd('0x37')]=_0x15a8b3[_0x67cd('0x37')][_0x67cd('0x39')]?_0x15a8b3[_0x67cd('0x37')]:_0x1fe0ba[_0x67cd('0x33')];if(_0x10bbc6[_0x67cd('0x35')][_0x67cd('0x45')]){_0x15a8b3['include']=[{'all':!![]}];}_0x15a8b3=_[_0x67cd('0x41')]({},_0x15a8b3,_0x10bbc6['options']);return db[_0x67cd('0x2e')][_0x67cd('0x4c')](_0x15a8b3)['then'](handleEntityNotFound(_0x278c44,null))['then'](respondWithResult(_0x278c44,null))['catch'](handleError(_0x278c44,null));};exports[_0x67cd('0x28')]=function(_0x5cb39b,_0x564846){return db[_0x67cd('0x2e')][_0x67cd('0x4c')]({'where':{'id':_0x5cb39b['params']['id']}})['then'](handleEntityNotFound(_0x564846,null))[_0x67cd('0x44')](removeEntity(_0x564846,null))[_0x67cd('0x47')](handleError(_0x564846,null));};exports['describe']=function(_0x43e191,_0x3c7460){return db[_0x67cd('0x2e')][_0x67cd('0x4d')]()['then'](respondWithResult(_0x3c7460,null))[_0x67cd('0x47')](handleError(_0x3c7460,null));};exports['create']=function(_0x58ed76,_0x596027){var _0x2177d7;return db[_0x67cd('0x4e')]['transaction'](function(_0x4f357f){return db[_0x67cd('0x2e')][_0x67cd('0x4f')](_0x58ed76[_0x67cd('0x50')],{'transaction':_0x4f357f})[_0x67cd('0x44')](function(_0x314537){_0x2177d7=_0x314537[_0x67cd('0x51')]({'plain':!![]});return db['VoiceExtension'][_0x67cd('0x4c')]({'where':{'id':_0x2177d7['VoiceExtensionId']},'raw':!![]})[_0x67cd('0x44')](function(_0x31fb6b){return createVoicePrefixExtensions(_0x2177d7,_0x31fb6b,_0x4f357f);});});})[_0x67cd('0x44')](function(){var _0x29a2b1=_0x58ed76[_0x67cd('0x52')][_0x67cd('0x51')]({'plain':!![]});if(!_0x29a2b1)throw new Error(_0x67cd('0x53'));if(_0x29a2b1[_0x67cd('0x54')]===_0x67cd('0x52')){var _0x546186=_0x2177d7;return db['UserProfileSection'][_0x67cd('0x4c')]({'where':{'name':_0x67cd('0x29'),'userProfileId':_0x29a2b1[_0x67cd('0x55')]},'raw':!![]})[_0x67cd('0x44')](function(_0x415e74){if(_0x415e74&&_0x415e74['autoAssociation']===0x0){return db[_0x67cd('0x2a')][_0x67cd('0x4f')]({'name':_0x546186[_0x67cd('0x2c')],'resourceId':_0x546186['id'],'type':_0x415e74['name'],'sectionId':_0x415e74['id']},{})[_0x67cd('0x44')](function(){return _0x2177d7;});}else{return _0x2177d7;}})['catch'](function(_0x4d6f7a){logger[_0x67cd('0x56')](_0x67cd('0x57'),_0x4d6f7a);throw _0x4d6f7a;});}return _0x2177d7;})[_0x67cd('0x44')](respondWithResult(_0x596027,null))[_0x67cd('0x47')](handleError(_0x596027,null));};function Extension(_0x501d1c,_0x195f25,_0xf1c080,_0x22fa5e){this[_0x67cd('0x58')]=_0x67cd('0x59');this[_0x67cd('0x5a')]=_0x501d1c;this[_0x67cd('0x5b')]=_0xf1c080;this['type']=_0x67cd('0x5c');this[_0x67cd('0x5d')]=_0x67cd('0x5e');this[_0x67cd('0x5f')]=_0x195f25;this['appdata']=_0x22fa5e;}function createVoicePrefixExtensions(_0x34c43c,_0x149a39,_0x391558){return new BPromise(function(_0x49df8b,_0x3c4cda){var _0x381a75=new Extension(formatPrefixName(_0x34c43c[_0x67cd('0x60')]),0x1,_0x67cd('0x61'),'Voice\x20Prefix');_0x381a75[_0x67cd('0x62')]=_0x34c43c['id'];return db['VoiceExtension'][_0x67cd('0x4f')](_0x381a75,{'transaction':_0x391558})['then'](function(_0x10ee10){var _0x336615=_0x10ee10[_0x67cd('0x51')]({'plain':!![]});var _0x506cdb=_[_0x67cd('0x34')](addVoicePrefixExtensions(_0x34c43c,_0x149a39),function(_0x369094){_0x369094[_0x67cd('0x63')]=_0x336615['id'];_0x369094['VoicePrefixId']=_0x34c43c['id'];return _0x369094;});return db[_0x67cd('0x64')][_0x67cd('0x65')](_0x506cdb,{'transaction':_0x391558})['then'](function(_0x30b6b1){if(!_0x30b6b1){return _0x3c4cda('Extensions\x20creation\x20failed');}else{return _0x49df8b(_0x30b6b1);}})[_0x67cd('0x47')](function(_0x36838e){return _0x3c4cda(_0x36838e);});});;});};function addVoicePrefixExtensions(_0x296fc3,_0x31cb01){var _0x52fdbe=[];var _0x2745b0=formatPrefixName(_0x296fc3[_0x67cd('0x60')]);_0x52fdbe[_0x67cd('0x66')](new Extension(_0x2745b0,0x2,'Set','CDR(prefix)='+_0x296fc3[_0x67cd('0x2c')]));if(_0x296fc3[_0x67cd('0x67')]){_0x52fdbe[_0x67cd('0x66')](new Extension(_0x2745b0,0x3,'Set',_0x67cd('0x68')+_0x296fc3['callerIdAll']));}else{_0x52fdbe[_0x67cd('0x66')](new Extension(_0x2745b0,0x3,_0x67cd('0x61'),_0x67cd('0x69')));}_0x52fdbe['push'](new Extension(_0x2745b0,0x4,'goto',_0x31cb01[_0x67cd('0x58')]+','+'${EXTEN:'+(0x8+_0x296fc3[_0x67cd('0x2c')]['length'])+'}'+','+0x1));return _0x52fdbe;}function formatPrefixName(_0x760096){var _0x238ea9='_';for(var _0x168124=0x0;_0x168124<_0x760096[_0x67cd('0x39')];_0x168124++){if(_0x760096['charAt'](_0x168124)=='-'){_0x238ea9+=_0x760096[_0x67cd('0x6a')](_0x168124);}else{_0x238ea9+='['+_0x760096[_0x67cd('0x6a')](_0x168124)+']';}}_0x238ea9+='.';return _0x238ea9;}exports[_0x67cd('0x27')]=function(_0x271090,_0x3527b0,_0x282f3c){var _0x631683=_0x271090[_0x67cd('0x50')];_0x631683[_0x67cd('0x60')]=_0x67cd('0x6b')+_0x631683[_0x67cd('0x2c')]+'-';return db[_0x67cd('0x4e')]['transaction'](function(_0x203ce9){return db[_0x67cd('0x2e')][_0x67cd('0x27')](_0x631683,{'where':{'id':_0x631683['id']},'transaction':_0x203ce9})[_0x67cd('0x44')](function(){return db[_0x67cd('0x64')][_0x67cd('0x28')]({'where':{'VoicePrefixId':_0x631683['id']},'transaction':_0x203ce9})[_0x67cd('0x44')](function(){return db[_0x67cd('0x64')][_0x67cd('0x4c')]({'where':{'id':_0x631683[_0x67cd('0x63')]},'raw':!![]})['then'](function(_0x36947a){return createVoicePrefixExtensions(_0x631683,_0x36947a,_0x203ce9);});});});})[_0x67cd('0x44')](function(){return db[_0x67cd('0x2e')][_0x67cd('0x6c')](_0x631683['id']);})['then'](respondWithResult(_0x3527b0,null))[_0x67cd('0x47')](handleError(_0x3527b0,null));};exports[_0x67cd('0x6d')]=function(_0x28d776,_0x5bac3a,_0x2971e3){return db[_0x67cd('0x2e')][_0x67cd('0x4c')]({'where':{'id':_0x28d776[_0x67cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5bac3a,null))[_0x67cd('0x44')](function(_0x25da39){if(_0x25da39){return _0x25da39[_0x67cd('0x6d')](_0x28d776[_0x67cd('0x50')][_0x67cd('0x6e')],_[_0x67cd('0x6f')](_0x28d776[_0x67cd('0x50')],[_0x67cd('0x6e'),'id'])||{})[_0x67cd('0x70')](function(_0x4b0367){for(var _0xe3e434=0x0;_0xe3e434<_0x28d776[_0x67cd('0x50')][_0x67cd('0x6e')][_0x67cd('0x39')];_0xe3e434+=0x1){socket[_0x67cd('0x71')](_0x67cd('0x72'),{'UserId':Number(_0x28d776[_0x67cd('0x50')][_0x67cd('0x6e')][_0xe3e434]),'VoicePrefixId':Number(_0x28d776[_0x67cd('0x49')]['id'])});}return _0x4b0367;});}})[_0x67cd('0x44')](respondWithResult(_0x5bac3a,null))[_0x67cd('0x47')](handleError(_0x5bac3a,null));};exports[_0x67cd('0x73')]=function(_0x11e473,_0x1f0b54,_0x466943){return db[_0x67cd('0x2e')][_0x67cd('0x4c')]({'where':{'id':_0x11e473[_0x67cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f0b54,null))[_0x67cd('0x44')](function(_0x56d065){if(_0x56d065){return _0x56d065[_0x67cd('0x73')](_0x11e473['query'][_0x67cd('0x6e')])[_0x67cd('0x44')](function(){if(_['isArray'](_0x11e473[_0x67cd('0x35')][_0x67cd('0x6e')])){for(var _0x287c8e=0x0;_0x287c8e<_0x11e473['query']['ids'][_0x67cd('0x39')];_0x287c8e+=0x1){socket[_0x67cd('0x71')](_0x67cd('0x74'),{'UserId':Number(_0x11e473[_0x67cd('0x35')][_0x67cd('0x6e')][_0x287c8e]),'VoicePrefixId':Number(_0x11e473[_0x67cd('0x49')]['id'])});}}else{socket[_0x67cd('0x71')](_0x67cd('0x74'),{'UserId':Number(_0x11e473['query'][_0x67cd('0x6e')]),'VoicePrefixId':Number(_0x11e473[_0x67cd('0x49')]['id'])});}});}})[_0x67cd('0x44')](respondWithStatusCode(_0x1f0b54,null))['catch'](handleError(_0x1f0b54,null));};exports[_0x67cd('0x75')]=function(_0x23fab3,_0x4d1d96,_0x239847){var _0x299ce0={};var _0x497e6b={};var _0x4c2ea2;var _0x904541;return db['VoicePrefix'][_0x67cd('0x76')]({'where':{'id':_0x23fab3[_0x67cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d1d96,null))[_0x67cd('0x44')](function(_0x288bb6){if(_0x288bb6){_0x4c2ea2=_0x288bb6;_0x497e6b[_0x67cd('0x33')]=_[_0x67cd('0x4a')](db[_0x67cd('0x77')][_0x67cd('0x2f')]);_0x497e6b[_0x67cd('0x35')]=_[_0x67cd('0x4a')](_0x23fab3['query']);_0x497e6b[_0x67cd('0x36')]=_['intersection'](_0x497e6b['model'],_0x497e6b[_0x67cd('0x35')]);_0x299ce0[_0x67cd('0x37')]=_[_0x67cd('0x4b')](_0x497e6b[_0x67cd('0x33')],qs['fields'](_0x23fab3[_0x67cd('0x35')][_0x67cd('0x38')]));_0x299ce0[_0x67cd('0x37')]=_0x299ce0['attributes'][_0x67cd('0x39')]?_0x299ce0[_0x67cd('0x37')]:_0x497e6b[_0x67cd('0x33')];_0x299ce0['order']=qs[_0x67cd('0x3d')](_0x23fab3[_0x67cd('0x35')]['sort']);_0x299ce0[_0x67cd('0x3e')]=qs['filters'](_['pick'](_0x23fab3[_0x67cd('0x35')],_0x497e6b[_0x67cd('0x36')]));if(_0x23fab3[_0x67cd('0x35')][_0x67cd('0x40')]){_0x299ce0[_0x67cd('0x3e')]=_['merge'](_0x299ce0[_0x67cd('0x3e')],{'$or':_[_0x67cd('0x34')](_0x299ce0['attributes'],function(_0x513e55){var _0x4f9060={};_0x4f9060[_0x513e55]={'$like':'%'+_0x23fab3['query']['filter']+'%'};return _0x4f9060;})});}_0x299ce0=_[_0x67cd('0x41')]({},_0x299ce0,_0x23fab3[_0x67cd('0x43')]);return _0x4c2ea2[_0x67cd('0x75')](_0x299ce0);}})[_0x67cd('0x44')](function(_0xee028e){if(_0xee028e){_0x904541=_0xee028e[_0x67cd('0x39')];if(!_0x23fab3[_0x67cd('0x35')][_0x67cd('0x3a')]('nolimit')){_0x299ce0[_0x67cd('0x1e')]=qs[_0x67cd('0x1e')](_0x23fab3['query'][_0x67cd('0x1e')]);_0x299ce0[_0x67cd('0x21')]=qs['offset'](_0x23fab3[_0x67cd('0x35')][_0x67cd('0x21')]);}return _0x4c2ea2['getAgents'](_0x299ce0);}})[_0x67cd('0x44')](function(_0x36019a){if(_0x36019a){return _0x36019a?{'count':_0x904541,'rows':_0x36019a}:null;}})[_0x67cd('0x44')](respondWithResult(_0x4d1d96,null))[_0x67cd('0x47')](handleError(_0x4d1d96,null));}; \ No newline at end of file +var _0x48b2=['userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','order','filter','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','json','offset','limit','count','Content-Range','apply','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','describe','create','sequelize','transaction','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','body','findById','addAgents','ids','omit'];(function(_0x3b0e27,_0x4def59){var _0x575e3f=function(_0x4ef3df){while(--_0x4ef3df){_0x3b0e27['push'](_0x3b0e27['shift']());}};_0x575e3f(++_0x4def59);}(_0x48b2,0x176));var _0x248b=function(_0x58b112,_0x479a81){_0x58b112=_0x58b112-0x0;var _0x28bc7d=_0x48b2[_0x58b112];return _0x28bc7d;};'use strict';var emlformat=require(_0x248b('0x0'));var rimraf=require(_0x248b('0x1'));var zipdir=require(_0x248b('0x2'));var jsonpatch=require(_0x248b('0x3'));var rp=require(_0x248b('0x4'));var moment=require(_0x248b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x248b('0x6'));var util=require('util');var path=require(_0x248b('0x7'));var sox=require(_0x248b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x248b('0x9'));var _=require('lodash');var squel=require(_0x248b('0xa'));var crypto=require(_0x248b('0xb'));var jsforce=require(_0x248b('0xc'));var deskjs=require(_0x248b('0xd'));var toCsv=require(_0x248b('0xe'));var querystring=require(_0x248b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x248b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x248b('0x11'));var hardwareService=require(_0x248b('0x12'));var logger=require('../../config/logger')(_0x248b('0x13'));var utils=require(_0x248b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x248b('0x15'));var db=require(_0x248b('0x16'))['db'];config[_0x248b('0x17')]=_['defaults'](config['redis'],{'host':_0x248b('0x18'),'port':0x18eb});var socket=require(_0x248b('0x19'))(new Redis(config[_0x248b('0x17')]));require(_0x248b('0x1a'))[_0x248b('0x1b')](socket);function respondWithStatusCode(_0x6cd69c,_0x25ec98){_0x25ec98=_0x25ec98||0xcc;return function(_0x538567){if(_0x538567){return _0x6cd69c['sendStatus'](_0x25ec98);}return _0x6cd69c[_0x248b('0x1c')](_0x25ec98)[_0x248b('0x1d')]();};}function respondWithResult(_0x4ed6c2,_0x12c976){_0x12c976=_0x12c976||0xc8;return function(_0x28f0bf){if(_0x28f0bf){return _0x4ed6c2[_0x248b('0x1c')](_0x12c976)[_0x248b('0x1e')](_0x28f0bf);}};}function respondWithFilteredResult(_0x4de747,_0x1ec7b1){return function(_0x146300){if(_0x146300){var _0xaa8232=typeof _0x1ec7b1[_0x248b('0x1f')]==='undefined'&&typeof _0x1ec7b1[_0x248b('0x20')]==='undefined';var _0x1a8e3f=_0x146300[_0x248b('0x21')];var _0x94c25e=_0xaa8232?0x0:_0x1ec7b1['offset'];var _0x41aa66=_0xaa8232?_0x146300[_0x248b('0x21')]:_0x1ec7b1[_0x248b('0x1f')]+_0x1ec7b1[_0x248b('0x20')];var _0x3c87d0;if(_0x41aa66>=_0x1a8e3f){_0x41aa66=_0x1a8e3f;_0x3c87d0=0xc8;}else{_0x3c87d0=0xce;}_0x4de747[_0x248b('0x1c')](_0x3c87d0);return _0x4de747['set'](_0x248b('0x22'),_0x94c25e+'-'+_0x41aa66+'/'+_0x1a8e3f)[_0x248b('0x1e')](_0x146300);}return null;};}function patchUpdates(_0x175f51){return function(_0x543b46){try{jsonpatch[_0x248b('0x23')](_0x543b46,_0x175f51,!![]);}catch(_0x2cb0a8){return BPromise['reject'](_0x2cb0a8);}return _0x543b46['save']();};}function saveUpdates(_0x20123f,_0x25ad0d){return function(_0x2657e3){if(_0x2657e3){return _0x2657e3['update'](_0x20123f)[_0x248b('0x24')](function(_0x3b6ce9){return _0x3b6ce9;});}return null;};}function removeEntity(_0x3844a4,_0x4b0a51){return function(_0x4eeb4c){if(_0x4eeb4c){return _0x4eeb4c['destroy']()['then'](function(){var _0x2d6bcd=_0x4eeb4c[_0x248b('0x25')]({'plain':!![]});var _0x4262c9='VoicePrefixes';return db[_0x248b('0x26')][_0x248b('0x27')]({'where':{'type':_0x4262c9,'resourceId':_0x2d6bcd['id']}})[_0x248b('0x24')](function(){return _0x4eeb4c;});})['then'](function(){_0x3844a4[_0x248b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26951b,_0x30a9ec){return function(_0x51689e){if(!_0x51689e){_0x26951b[_0x248b('0x28')](0x194);}return _0x51689e;};}function handleError(_0x27d24d,_0x47b7f8){_0x47b7f8=_0x47b7f8||0x1f4;return function(_0x5e8fe7){logger['error'](_0x5e8fe7[_0x248b('0x29')]);if(_0x5e8fe7[_0x248b('0x2a')]){delete _0x5e8fe7[_0x248b('0x2a')];}_0x27d24d[_0x248b('0x1c')](_0x47b7f8)[_0x248b('0x2b')](_0x5e8fe7);};}exports[_0x248b('0x2c')]=function(_0x117f12,_0x5dd1c1){var _0x161d8f={},_0x16a0ad={},_0xd388a4={'count':0x0,'rows':[]};var _0x5aaf1b=_[_0x248b('0x2d')](db[_0x248b('0x2e')][_0x248b('0x2f')],function(_0x1eaf79){return{'name':_0x1eaf79[_0x248b('0x30')],'type':_0x1eaf79['type'][_0x248b('0x31')]};});_0x16a0ad[_0x248b('0x32')]=_[_0x248b('0x2d')](_0x5aaf1b,_0x248b('0x2a'));_0x16a0ad[_0x248b('0x33')]=_[_0x248b('0x34')](_0x117f12[_0x248b('0x33')]);_0x16a0ad[_0x248b('0x35')]=_['intersection'](_0x16a0ad[_0x248b('0x32')],_0x16a0ad[_0x248b('0x33')]);_0x161d8f[_0x248b('0x36')]=_['intersection'](_0x16a0ad[_0x248b('0x32')],qs['fields'](_0x117f12[_0x248b('0x33')][_0x248b('0x37')]));_0x161d8f[_0x248b('0x36')]=_0x161d8f[_0x248b('0x36')][_0x248b('0x38')]?_0x161d8f[_0x248b('0x36')]:_0x16a0ad[_0x248b('0x32')];if(!_0x117f12[_0x248b('0x33')]['hasOwnProperty'](_0x248b('0x39'))){_0x161d8f[_0x248b('0x20')]=qs[_0x248b('0x20')](_0x117f12['query']['limit']);_0x161d8f['offset']=qs['offset'](_0x117f12['query'][_0x248b('0x1f')]);}_0x161d8f['order']=qs[_0x248b('0x3a')](_0x117f12[_0x248b('0x33')][_0x248b('0x3a')]);_0x161d8f[_0x248b('0x3b')]=qs[_0x248b('0x35')](_[_0x248b('0x3c')](_0x117f12[_0x248b('0x33')],_0x16a0ad[_0x248b('0x35')]),_0x5aaf1b);if(_0x117f12['query']['filter']){_0x161d8f[_0x248b('0x3b')]=_[_0x248b('0x3d')](_0x161d8f[_0x248b('0x3b')],{'$or':_[_0x248b('0x2d')](_0x5aaf1b,function(_0x8a700b){if(_0x8a700b['type']!=='VIRTUAL'){var _0x37ec1b={};_0x37ec1b[_0x8a700b[_0x248b('0x2a')]]={'$like':'%'+_0x117f12[_0x248b('0x33')]['filter']+'%'};return _0x37ec1b;}})});}_0x161d8f=_['merge']({},_0x161d8f,_0x117f12[_0x248b('0x3e')]);var _0x31e557={'where':_0x161d8f['where']};return db[_0x248b('0x2e')]['count'](_0x31e557)[_0x248b('0x24')](function(_0x4c47df){_0xd388a4['count']=_0x4c47df;if(_0x117f12[_0x248b('0x33')][_0x248b('0x3f')]){_0x161d8f[_0x248b('0x40')]=[{'all':!![]}];}return db['VoicePrefix'][_0x248b('0x41')](_0x161d8f);})[_0x248b('0x24')](function(_0x3f2bf8){_0xd388a4[_0x248b('0x42')]=_0x3f2bf8;return _0xd388a4;})[_0x248b('0x24')](respondWithFilteredResult(_0x5dd1c1,_0x161d8f))['catch'](handleError(_0x5dd1c1,null));};exports[_0x248b('0x43')]=function(_0x51c7e5,_0x1e8a2d){var _0x18e2c7={'raw':![],'where':{'id':_0x51c7e5[_0x248b('0x44')]['id']}},_0x111afc={};_0x111afc[_0x248b('0x32')]=_[_0x248b('0x34')](db[_0x248b('0x2e')][_0x248b('0x2f')]);_0x111afc[_0x248b('0x33')]=_[_0x248b('0x34')](_0x51c7e5['query']);_0x111afc[_0x248b('0x35')]=_[_0x248b('0x45')](_0x111afc[_0x248b('0x32')],_0x111afc[_0x248b('0x33')]);_0x18e2c7[_0x248b('0x36')]=_[_0x248b('0x45')](_0x111afc['model'],qs[_0x248b('0x37')](_0x51c7e5[_0x248b('0x33')][_0x248b('0x37')]));_0x18e2c7[_0x248b('0x36')]=_0x18e2c7[_0x248b('0x36')]['length']?_0x18e2c7[_0x248b('0x36')]:_0x111afc['model'];if(_0x51c7e5[_0x248b('0x33')][_0x248b('0x3f')]){_0x18e2c7[_0x248b('0x40')]=[{'all':!![]}];}_0x18e2c7=_[_0x248b('0x3d')]({},_0x18e2c7,_0x51c7e5[_0x248b('0x3e')]);return db['VoicePrefix'][_0x248b('0x46')](_0x18e2c7)['then'](handleEntityNotFound(_0x1e8a2d,null))[_0x248b('0x24')](respondWithResult(_0x1e8a2d,null))[_0x248b('0x47')](handleError(_0x1e8a2d,null));};exports['destroy']=function(_0x2ab471,_0x499fca){return db[_0x248b('0x2e')][_0x248b('0x46')]({'where':{'id':_0x2ab471[_0x248b('0x44')]['id']}})[_0x248b('0x24')](handleEntityNotFound(_0x499fca,null))[_0x248b('0x24')](removeEntity(_0x499fca,null))[_0x248b('0x47')](handleError(_0x499fca,null));};exports[_0x248b('0x48')]=function(_0x4c9132,_0x1fa162){return db[_0x248b('0x2e')][_0x248b('0x48')]()['then'](respondWithResult(_0x1fa162,null))[_0x248b('0x47')](handleError(_0x1fa162,null));};exports[_0x248b('0x49')]=function(_0xbf6f05,_0x3f0dcc){var _0x3339d4;return db[_0x248b('0x4a')][_0x248b('0x4b')](function(_0x39c0b5){return db[_0x248b('0x2e')][_0x248b('0x49')](_0xbf6f05['body'],{'transaction':_0x39c0b5})[_0x248b('0x24')](function(_0x8d4f27){_0x3339d4=_0x8d4f27[_0x248b('0x25')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x3339d4[_0x248b('0x4c')]},'raw':!![]})[_0x248b('0x24')](function(_0x46b39c){return createVoicePrefixExtensions(_0x3339d4,_0x46b39c,_0x39c0b5);});});})[_0x248b('0x24')](function(){var _0x281958=_0xbf6f05[_0x248b('0x4d')]['get']({'plain':!![]});if(!_0x281958)throw new Error(_0x248b('0x4e'));if(_0x281958[_0x248b('0x4f')]===_0x248b('0x4d')){var _0x43f443=_0x3339d4;return db['UserProfileSection'][_0x248b('0x46')]({'where':{'name':'VoicePrefixes','userProfileId':_0x281958['userProfileId']},'raw':!![]})[_0x248b('0x24')](function(_0x1aec13){if(_0x1aec13&&_0x1aec13['autoAssociation']===0x0){return db[_0x248b('0x26')][_0x248b('0x49')]({'name':_0x43f443[_0x248b('0x2a')],'resourceId':_0x43f443['id'],'type':_0x1aec13['name'],'sectionId':_0x1aec13['id']},{})[_0x248b('0x24')](function(){return _0x3339d4;});}else{return _0x3339d4;}})[_0x248b('0x47')](function(_0x63d938){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63d938);throw _0x63d938;});}return _0x3339d4;})[_0x248b('0x24')](respondWithResult(_0x3f0dcc,null))['catch'](handleError(_0x3f0dcc,null));};function Extension(_0x516924,_0x524969,_0xeecef6,_0x46e5ff){this[_0x248b('0x50')]=_0x248b('0x51');this[_0x248b('0x52')]=_0x516924;this[_0x248b('0x53')]=_0xeecef6;this[_0x248b('0x54')]=_0x248b('0x55');this[_0x248b('0x56')]=_0x248b('0x57');this[_0x248b('0x58')]=_0x524969;this[_0x248b('0x59')]=_0x46e5ff;}function createVoicePrefixExtensions(_0x12efeb,_0x7879cd,_0x4ea1a4){return new BPromise(function(_0x421742,_0x5e2e14){var _0x5a4b86=new Extension(formatPrefixName(_0x12efeb['prefix']),0x1,'NoOp',_0x248b('0x5a'));_0x5a4b86[_0x248b('0x5b')]=_0x12efeb['id'];return db[_0x248b('0x5c')][_0x248b('0x49')](_0x5a4b86,{'transaction':_0x4ea1a4})[_0x248b('0x24')](function(_0x50888a){var _0x25eb8e=_0x50888a['get']({'plain':!![]});var _0x429732=_[_0x248b('0x2d')](addVoicePrefixExtensions(_0x12efeb,_0x7879cd),function(_0x9b632d){_0x9b632d[_0x248b('0x4c')]=_0x25eb8e['id'];_0x9b632d[_0x248b('0x5b')]=_0x12efeb['id'];return _0x9b632d;});return db[_0x248b('0x5c')][_0x248b('0x5d')](_0x429732,{'transaction':_0x4ea1a4})[_0x248b('0x24')](function(_0x41b35a){if(!_0x41b35a){return _0x5e2e14(_0x248b('0x5e'));}else{return _0x421742(_0x41b35a);}})[_0x248b('0x47')](function(_0x503fb0){return _0x5e2e14(_0x503fb0);});});;});};function addVoicePrefixExtensions(_0x225fff,_0x5dc035){var _0x1389da=[];var _0x2e919b=formatPrefixName(_0x225fff[_0x248b('0x5f')]);_0x1389da['push'](new Extension(_0x2e919b,0x2,_0x248b('0x60'),'CDR(prefix)='+_0x225fff[_0x248b('0x2a')]));if(_0x225fff[_0x248b('0x61')]){_0x1389da['push'](new Extension(_0x2e919b,0x3,'Set',_0x248b('0x62')+_0x225fff[_0x248b('0x61')]));}else{_0x1389da[_0x248b('0x63')](new Extension(_0x2e919b,0x3,'NoOp',_0x248b('0x64')));}_0x1389da[_0x248b('0x63')](new Extension(_0x2e919b,0x4,_0x248b('0x65'),_0x5dc035[_0x248b('0x50')]+','+_0x248b('0x66')+(0x8+_0x225fff['name'][_0x248b('0x38')])+'}'+','+0x1));return _0x1389da;}function formatPrefixName(_0x3fd978){var _0x3eb6f1='_';for(var _0xf76394=0x0;_0xf76394<_0x3fd978['length'];_0xf76394++){if(_0x3fd978['charAt'](_0xf76394)=='-'){_0x3eb6f1+=_0x3fd978[_0x248b('0x67')](_0xf76394);}else{_0x3eb6f1+='['+_0x3fd978['charAt'](_0xf76394)+']';}}_0x3eb6f1+='.';return _0x3eb6f1;}exports[_0x248b('0x68')]=function(_0x401b7a,_0x28921f,_0x53c4ad){var _0x16b252=_0x401b7a[_0x248b('0x69')];_0x16b252[_0x248b('0x5f')]='system-'+_0x16b252[_0x248b('0x2a')]+'-';return db[_0x248b('0x4a')]['transaction'](function(_0x57660d){return db['VoicePrefix']['update'](_0x16b252,{'where':{'id':_0x16b252['id']},'transaction':_0x57660d})[_0x248b('0x24')](function(){return db[_0x248b('0x5c')][_0x248b('0x27')]({'where':{'VoicePrefixId':_0x16b252['id']},'transaction':_0x57660d})[_0x248b('0x24')](function(){return db['VoiceExtension'][_0x248b('0x46')]({'where':{'id':_0x16b252[_0x248b('0x4c')]},'raw':!![]})['then'](function(_0x3cc107){return createVoicePrefixExtensions(_0x16b252,_0x3cc107,_0x57660d);});});});})['then'](function(){return db[_0x248b('0x2e')][_0x248b('0x6a')](_0x16b252['id']);})['then'](respondWithResult(_0x28921f,null))[_0x248b('0x47')](handleError(_0x28921f,null));};exports['addAgents']=function(_0x4c3dbc,_0x20b0f8,_0x32c0e4){return db['VoicePrefix']['find']({'where':{'id':_0x4c3dbc['params']['id']}})[_0x248b('0x24')](handleEntityNotFound(_0x20b0f8,null))[_0x248b('0x24')](function(_0x2df41e){if(_0x2df41e){return _0x2df41e[_0x248b('0x6b')](_0x4c3dbc[_0x248b('0x69')][_0x248b('0x6c')],_[_0x248b('0x6d')](_0x4c3dbc[_0x248b('0x69')],[_0x248b('0x6c'),'id'])||{})['spread'](function(_0x4a4b13){for(var _0x2dac46=0x0;_0x2dac46<_0x4c3dbc[_0x248b('0x69')][_0x248b('0x6c')]['length'];_0x2dac46+=0x1){socket['emit'](_0x248b('0x6e'),{'UserId':Number(_0x4c3dbc[_0x248b('0x69')][_0x248b('0x6c')][_0x2dac46]),'VoicePrefixId':Number(_0x4c3dbc[_0x248b('0x44')]['id'])});}return _0x4a4b13;});}})['then'](respondWithResult(_0x20b0f8,null))[_0x248b('0x47')](handleError(_0x20b0f8,null));};exports[_0x248b('0x6f')]=function(_0x717572,_0x387a92,_0x31dcb0){return db['VoicePrefix'][_0x248b('0x46')]({'where':{'id':_0x717572[_0x248b('0x44')]['id']}})['then'](handleEntityNotFound(_0x387a92,null))['then'](function(_0x57cd4a){if(_0x57cd4a){return _0x57cd4a['removeAgents'](_0x717572[_0x248b('0x33')]['ids'])[_0x248b('0x24')](function(){if(_[_0x248b('0x70')](_0x717572[_0x248b('0x33')][_0x248b('0x6c')])){for(var _0x33d3a8=0x0;_0x33d3a8<_0x717572[_0x248b('0x33')][_0x248b('0x6c')][_0x248b('0x38')];_0x33d3a8+=0x1){socket[_0x248b('0x71')](_0x248b('0x72'),{'UserId':Number(_0x717572['query'][_0x248b('0x6c')][_0x33d3a8]),'VoicePrefixId':Number(_0x717572[_0x248b('0x44')]['id'])});}}else{socket[_0x248b('0x71')](_0x248b('0x72'),{'UserId':Number(_0x717572['query'][_0x248b('0x6c')]),'VoicePrefixId':Number(_0x717572[_0x248b('0x44')]['id'])});}});}})[_0x248b('0x24')](respondWithStatusCode(_0x387a92,null))[_0x248b('0x47')](handleError(_0x387a92,null));};exports[_0x248b('0x73')]=function(_0x42f4d7,_0x5935e8,_0x4f37a8){var _0x5deefa={};var _0x120a05={};var _0x25a57b;var _0x5b827e;return db[_0x248b('0x2e')][_0x248b('0x74')]({'where':{'id':_0x42f4d7['params']['id']}})[_0x248b('0x24')](handleEntityNotFound(_0x5935e8,null))['then'](function(_0x10b6df){if(_0x10b6df){_0x25a57b=_0x10b6df;_0x120a05[_0x248b('0x32')]=_['keys'](db[_0x248b('0x75')][_0x248b('0x2f')]);_0x120a05[_0x248b('0x33')]=_[_0x248b('0x34')](_0x42f4d7[_0x248b('0x33')]);_0x120a05[_0x248b('0x35')]=_[_0x248b('0x45')](_0x120a05[_0x248b('0x32')],_0x120a05['query']);_0x5deefa[_0x248b('0x36')]=_[_0x248b('0x45')](_0x120a05[_0x248b('0x32')],qs[_0x248b('0x37')](_0x42f4d7['query']['fields']));_0x5deefa[_0x248b('0x36')]=_0x5deefa[_0x248b('0x36')][_0x248b('0x38')]?_0x5deefa[_0x248b('0x36')]:_0x120a05['model'];_0x5deefa[_0x248b('0x76')]=qs[_0x248b('0x3a')](_0x42f4d7[_0x248b('0x33')][_0x248b('0x3a')]);_0x5deefa[_0x248b('0x3b')]=qs['filters'](_[_0x248b('0x3c')](_0x42f4d7[_0x248b('0x33')],_0x120a05[_0x248b('0x35')]));if(_0x42f4d7[_0x248b('0x33')][_0x248b('0x77')]){_0x5deefa[_0x248b('0x3b')]=_[_0x248b('0x3d')](_0x5deefa[_0x248b('0x3b')],{'$or':_['map'](_0x5deefa['attributes'],function(_0x14c641){var _0x4e8e85={};_0x4e8e85[_0x14c641]={'$like':'%'+_0x42f4d7['query'][_0x248b('0x77')]+'%'};return _0x4e8e85;})});}_0x5deefa=_['merge']({},_0x5deefa,_0x42f4d7[_0x248b('0x3e')]);return _0x25a57b[_0x248b('0x73')](_0x5deefa);}})[_0x248b('0x24')](function(_0x3779e1){if(_0x3779e1){_0x5b827e=_0x3779e1[_0x248b('0x38')];if(!_0x42f4d7['query'][_0x248b('0x78')](_0x248b('0x39'))){_0x5deefa[_0x248b('0x20')]=qs[_0x248b('0x20')](_0x42f4d7[_0x248b('0x33')][_0x248b('0x20')]);_0x5deefa['offset']=qs[_0x248b('0x1f')](_0x42f4d7['query'][_0x248b('0x1f')]);}return _0x25a57b['getAgents'](_0x5deefa);}})[_0x248b('0x24')](function(_0x394d0e){if(_0x394d0e){return _0x394d0e?{'count':_0x5b827e,'rows':_0x394d0e}:null;}})[_0x248b('0x24')](respondWithResult(_0x5935e8,null))[_0x248b('0x47')](handleError(_0x5935e8,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 7b8751c..85aa46d 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 _0x3075=['exports','events','save','remove','emit','hasOwnProperty'];(function(_0x9f4802,_0x16d5a1){var _0x2c1094=function(_0x2b68f0){while(--_0x2b68f0){_0x9f4802['push'](_0x9f4802['shift']());}};_0x2c1094(++_0x16d5a1);}(_0x3075,0xdf));var _0x5307=function(_0xac28d3,_0x56b0cb){_0xac28d3=_0xac28d3-0x0;var _0x5b9b46=_0x3075[_0xac28d3];return _0x5b9b46;};'use strict';var EventEmitter=require(_0x5307('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5307('0x1'),'afterUpdate':'update','afterDestroy':_0x5307('0x2')};function emitEvent(_0x299098){return function(_0xe8478,_0x1bcd74,_0x31c72f){VoicePrefixEvents[_0x5307('0x3')](_0x299098+':'+_0xe8478['id'],_0xe8478);VoicePrefixEvents[_0x5307('0x3')](_0x299098,_0xe8478);_0x31c72f(null);};}for(var e in events){if(events[_0x5307('0x4')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x5307('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0x36d4=['hook','exports','events','VoicePrefix','save','update','emit','hasOwnProperty'];(function(_0x42fc95,_0x491dd5){var _0xf07729=function(_0x3e40cf){while(--_0x3e40cf){_0x42fc95['push'](_0x42fc95['shift']());}};_0xf07729(++_0x491dd5);}(_0x36d4,0x152));var _0x436d=function(_0x2f1cab,_0x22bfb5){_0x2f1cab=_0x2f1cab-0x0;var _0x368201=_0x36d4[_0x2f1cab];return _0x368201;};'use strict';var EventEmitter=require(_0x436d('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x436d('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x436d('0x2'),'afterUpdate':_0x436d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6a2dcb){return function(_0x3d97fe,_0xa34864,_0x5b66e9){VoicePrefixEvents['emit'](_0x6a2dcb+':'+_0x3d97fe['id'],_0x3d97fe);VoicePrefixEvents[_0x436d('0x4')](_0x6a2dcb,_0x3d97fe);_0x5b66e9(null);};}for(var e in events){if(events[_0x436d('0x5')](e)){var event=events[e];VoicePrefix[_0x436d('0x6')](e,emitEvent(event));}}module[_0x436d('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 6e68b13..49308fe 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 _0xc52d=['voice_prefixes','util','api','moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc52d,0x161));var _0xdc52=function(_0x3265b5,_0x446ded){_0x3265b5=_0x3265b5-0x0;var _0x1f2c40=_0xc52d[_0x3265b5];return _0x1f2c40;};'use strict';var _=require('lodash');var util=require(_0xdc52('0x0'));var logger=require('../../config/logger')(_0xdc52('0x1'));var moment=require(_0xdc52('0x2'));var BPromise=require(_0xdc52('0x3'));var rp=require(_0xdc52('0x4'));var fs=require('fs');var path=require(_0xdc52('0x5'));var rimraf=require(_0xdc52('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc52('0x7'));module[_0xdc52('0x8')]=function(_0x3a0bb9,_0x3af8b){return _0x3a0bb9['define'](_0xdc52('0x9'),attributes,{'tableName':_0xdc52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x968f=['define','VoicePrefix','voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports'];(function(_0x5de48d,_0x500e8e){var _0x322d18=function(_0x26efff){while(--_0x26efff){_0x5de48d['push'](_0x5de48d['shift']());}};_0x322d18(++_0x500e8e);}(_0x968f,0x148));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf968('0x0'));var util=require(_0xf968('0x1'));var logger=require('../../config/logger')(_0xf968('0x2'));var moment=require(_0xf968('0x3'));var BPromise=require(_0xf968('0x4'));var rp=require(_0xf968('0x5'));var fs=require('fs');var path=require(_0xf968('0x6'));var rimraf=require(_0xf968('0x7'));var config=require('../../config/environment');var attributes=require(_0xf968('0x8'));module[_0xf968('0x9')]=function(_0x28a212,_0x53ef18){return _0x28a212[_0xf968('0xa')](_0xf968('0xb'),attributes,{'tableName':_0xf968('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index a76883d..5057897 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 _0xcd05=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request'];(function(_0x262118,_0x5ee5bd){var _0xc6fddd=function(_0x410eef){while(--_0x410eef){_0x262118['push'](_0x262118['shift']());}};_0xc6fddd(++_0x5ee5bd);}(_0xcd05,0x163));var _0x5cd0=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xcd05[_0x259d17];return _0x407535;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5cd0('0x1'));var fs=require('fs');var Redis=require(_0x5cd0('0x2'));var db=require(_0x5cd0('0x3'))['db'];var utils=require(_0x5cd0('0x4'));var logger=require('../../config/logger')(_0x5cd0('0x5'));var config=require(_0x5cd0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5cd0('0x7')]=_[_0x5cd0('0x8')](config[_0x5cd0('0x7')],{'host':_0x5cd0('0x9'),'port':0x18eb});var socket=require(_0x5cd0('0xa'))(new Redis(config[_0x5cd0('0x7')]));require(_0x5cd0('0xb'))['register'](socket);function respondWithRpcPromise(_0xaea974,_0xf5eda1,_0x22f769){return new BPromise(function(_0x368f0c,_0x512903){return client[_0x5cd0('0xc')](_0xaea974,_0x22f769)[_0x5cd0('0xd')](function(_0x447b29){logger[_0x5cd0('0xe')](_0x5cd0('0xf'),_0xf5eda1,_0x5cd0('0x10'));logger[_0x5cd0('0x11')](_0x5cd0('0x12'),_0xf5eda1,_0x5cd0('0x10'),JSON[_0x5cd0('0x13')](_0x447b29));if(_0x447b29['error']){if(_0x447b29['error']['code']===0x1f4){logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x447b29['error'][_0x5cd0('0x15')]);return _0x512903(_0x447b29['error'][_0x5cd0('0x15')]);}logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x447b29['error']['message']);return _0x368f0c(_0x447b29[_0x5cd0('0x14')][_0x5cd0('0x15')]);}else{logger[_0x5cd0('0xe')]('VoicePrefix,\x20%s,\x20%s',_0xf5eda1,'request\x20sent');_0x368f0c(_0x447b29['result'][_0x5cd0('0x15')]);}})[_0x5cd0('0x16')](function(_0x48ede8){logger[_0x5cd0('0x14')](_0x5cd0('0xf'),_0xf5eda1,_0x48ede8);_0x512903(_0x48ede8);});});} \ No newline at end of file +var _0x86b8=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x30b547,_0x5b89e9){var _0xab9618=function(_0x2259f2){while(--_0x2259f2){_0x30b547['push'](_0x30b547['shift']());}};_0xab9618(++_0x5b89e9);}(_0x86b8,0x15d));var _0x886b=function(_0x203f67,_0x2b1758){_0x203f67=_0x203f67-0x0;var _0x316186=_0x86b8[_0x203f67];return _0x316186;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var moment=require(_0x886b('0x2'));var BPromise=require('bluebird');var rs=require(_0x886b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x886b('0x4'))['db'];var utils=require(_0x886b('0x5'));var logger=require(_0x886b('0x6'))('rpc');var config=require(_0x886b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x886b('0x8')]({'port':0x232a});config[_0x886b('0x9')]=_[_0x886b('0xa')](config[_0x886b('0x9')],{'host':_0x886b('0xb'),'port':0x18eb});var socket=require(_0x886b('0xc'))(new Redis(config[_0x886b('0x9')]));require(_0x886b('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b2df9,_0x3b62c2,_0x1ce588){return new BPromise(function(_0x419e26,_0x25d98a){return client[_0x886b('0xe')](_0x2b2df9,_0x1ce588)[_0x886b('0xf')](function(_0x1c954f){logger['info'](_0x886b('0x10'),_0x3b62c2,_0x886b('0x11'));logger['debug'](_0x886b('0x12'),_0x3b62c2,_0x886b('0x11'),JSON[_0x886b('0x13')](_0x1c954f));if(_0x1c954f[_0x886b('0x14')]){if(_0x1c954f['error']['code']===0x1f4){logger[_0x886b('0x14')](_0x886b('0x10'),_0x3b62c2,_0x1c954f[_0x886b('0x14')][_0x886b('0x15')]);return _0x25d98a(_0x1c954f[_0x886b('0x14')][_0x886b('0x15')]);}logger[_0x886b('0x14')](_0x886b('0x10'),_0x3b62c2,_0x1c954f['error'][_0x886b('0x15')]);return _0x419e26(_0x1c954f[_0x886b('0x14')]['message']);}else{logger[_0x886b('0x16')](_0x886b('0x10'),_0x3b62c2,_0x886b('0x11'));_0x419e26(_0x1c954f[_0x886b('0x17')][_0x886b('0x15')]);}})[_0x886b('0x18')](function(_0x5a6696){logger['error'](_0x886b('0x10'),_0x3b62c2,_0x5a6696);_0x25d98a(_0x5a6696);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index de8d868..444888d 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 _0xd5b6=['removeListener','register','length','./voicePrefix.events','save','remove','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd5b6,0x73));var _0x6d5b=function(_0x44642c,_0x4e7e25){_0x44642c=_0x44642c-0x0;var _0x42cf00=_0xd5b6[_0x44642c];return _0x42cf00;};'use strict';var VoicePrefixEvents=require(_0x6d5b('0x0'));var events=[_0x6d5b('0x1'),_0x6d5b('0x2'),_0x6d5b('0x3')];function createListener(_0x406106,_0x3d9bc9){return function(_0x162442){_0x3d9bc9[_0x6d5b('0x4')](_0x406106,_0x162442);};}function removeListener(_0x558202,_0x2735ab){return function(){VoicePrefixEvents[_0x6d5b('0x5')](_0x558202,_0x2735ab);};}exports[_0x6d5b('0x6')]=function(_0x4935ef){for(var _0x1c2490=0x0,_0x3e722d=events[_0x6d5b('0x7')];_0x1c2490<_0x3e722d;_0x1c2490++){var _0x3cdc91=events[_0x1c2490];var _0x5b57cb=createListener('voicePrefix:'+_0x3cdc91,_0x4935ef);VoicePrefixEvents['on'](_0x3cdc91,_0x5b57cb);}}; \ No newline at end of file +var _0xe7b9=['length','voicePrefix:','./voicePrefix.events','save','remove','register'];(function(_0x2feda9,_0x400eb6){var _0x4a7a95=function(_0x19c142){while(--_0x19c142){_0x2feda9['push'](_0x2feda9['shift']());}};_0x4a7a95(++_0x400eb6);}(_0xe7b9,0x170));var _0x9e7b=function(_0x24bb24,_0x9186fa){_0x24bb24=_0x24bb24-0x0;var _0x2c17ee=_0xe7b9[_0x24bb24];return _0x2c17ee;};'use strict';var VoicePrefixEvents=require(_0x9e7b('0x0'));var events=[_0x9e7b('0x1'),_0x9e7b('0x2'),'update'];function createListener(_0x4d18fe,_0x1de4b2){return function(_0x95234f){_0x1de4b2['emit'](_0x4d18fe,_0x95234f);};}function removeListener(_0x48b654,_0xc8f709){return function(){VoicePrefixEvents['removeListener'](_0x48b654,_0xc8f709);};}exports[_0x9e7b('0x3')]=function(_0x543b7e){for(var _0x4dda21=0x0,_0x1e2f86=events[_0x9e7b('0x4')];_0x4dda21<_0x1e2f86;_0x4dda21++){var _0x13a37d=events[_0x4dda21];var _0x5ed982=createListener(_0x9e7b('0x5')+_0x13a37d,_0x543b7e);VoicePrefixEvents['on'](_0x13a37d,_0x5ed982);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 42b689a..92df7fd 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 _0x55d0=['/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addAgents','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index'];(function(_0x11dd8e,_0x5dc767){var _0x2f3af9=function(_0xf3a0a3){while(--_0xf3a0a3){_0x11dd8e['push'](_0x11dd8e['shift']());}};_0x2f3af9(++_0x5dc767);}(_0x55d0,0xfd));var _0x055d=function(_0x10eb6b,_0x3fe155){_0x10eb6b=_0x10eb6b-0x0;var _0x3a3ab1=_0x55d0[_0x10eb6b];return _0x3a3ab1;};'use strict';var multer=require('multer');var util=require(_0x055d('0x0'));var path=require(_0x055d('0x1'));var timeout=require(_0x055d('0x2'));var express=require(_0x055d('0x3'));var router=express[_0x055d('0x4')]();var fs_extra=require(_0x055d('0x5'));var auth=require(_0x055d('0x6'));var interaction=require(_0x055d('0x7'));var config=require(_0x055d('0x8'));var controller=require(_0x055d('0x9'));router[_0x055d('0xa')]('/',auth[_0x055d('0xb')](),controller[_0x055d('0xc')]);router[_0x055d('0xa')](_0x055d('0xd'),auth[_0x055d('0xb')](),controller[_0x055d('0xe')]);router[_0x055d('0xa')](_0x055d('0xf'),auth[_0x055d('0xb')](),controller['getHoppers']);router[_0x055d('0xa')](_0x055d('0x10'),auth[_0x055d('0xb')](),controller[_0x055d('0x11')]);router[_0x055d('0xa')](_0x055d('0x12'),auth[_0x055d('0xb')](),controller[_0x055d('0x13')]);router[_0x055d('0xa')]('/:id/hopper_black',auth[_0x055d('0xb')](),controller[_0x055d('0x14')]);router[_0x055d('0xa')](_0x055d('0x15'),auth[_0x055d('0xb')](),controller['getTeams']);router[_0x055d('0xa')](_0x055d('0x16'),auth['isAuthenticated'](),controller[_0x055d('0x17')]);router[_0x055d('0xa')](_0x055d('0x18'),auth['isAuthenticated'](),controller[_0x055d('0x19')]);router[_0x055d('0xa')](_0x055d('0x1a'),auth[_0x055d('0xb')](),controller[_0x055d('0x1b')]);router[_0x055d('0xa')](_0x055d('0x1c'),auth[_0x055d('0xb')](),controller[_0x055d('0x1d')]);router[_0x055d('0x1e')]('/',auth[_0x055d('0xb')](),controller['create']);router[_0x055d('0x1e')]('/:id/clone',auth[_0x055d('0xb')](),controller[_0x055d('0x1f')]);router[_0x055d('0x1e')](_0x055d('0x15'),auth[_0x055d('0xb')](),controller['addTeams']);router[_0x055d('0x1e')](_0x055d('0x16'),auth[_0x055d('0xb')](),controller[_0x055d('0x20')]);router[_0x055d('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router['post'](_0x055d('0x1c'),auth[_0x055d('0xb')](),controller['addBlackLists']);router['put'](_0x055d('0xd'),auth[_0x055d('0xb')](),controller[_0x055d('0x21')]);router[_0x055d('0x22')](_0x055d('0xd'),auth[_0x055d('0xb')](),controller[_0x055d('0x23')]);router[_0x055d('0x22')](_0x055d('0x15'),auth[_0x055d('0xb')](),controller['removeTeams']);router[_0x055d('0x22')](_0x055d('0x16'),auth[_0x055d('0xb')](),controller[_0x055d('0x24')]);router[_0x055d('0x22')](_0x055d('0x1a'),auth[_0x055d('0xb')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x055d('0xb')](),controller['removeBlackLists']);module[_0x055d('0x25')]=router; \ No newline at end of file +var _0xf686=['addBlackLists','put','update','delete','removeTeams','removeAgents','removeBlackLists','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','./voiceQueue.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/lists','addLists','/:id/blacklists'];(function(_0x1cd352,_0x550d18){var _0x32b5a3=function(_0x178de3){while(--_0x178de3){_0x1cd352['push'](_0x1cd352['shift']());}};_0x32b5a3(++_0x550d18);}(_0xf686,0x1f4));var _0x6f68=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf686[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x6f68('0x0'));var path=require(_0x6f68('0x1'));var timeout=require(_0x6f68('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f68('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6f68('0x4'));var config=require('../../config/environment');var controller=require(_0x6f68('0x5'));router['get']('/',auth[_0x6f68('0x6')](),controller[_0x6f68('0x7')]);router[_0x6f68('0x8')](_0x6f68('0x9'),auth[_0x6f68('0x6')](),controller[_0x6f68('0xa')]);router[_0x6f68('0x8')](_0x6f68('0xb'),auth[_0x6f68('0x6')](),controller[_0x6f68('0xc')]);router[_0x6f68('0x8')](_0x6f68('0xd'),auth[_0x6f68('0x6')](),controller[_0x6f68('0xe')]);router[_0x6f68('0x8')](_0x6f68('0xf'),auth[_0x6f68('0x6')](),controller['getHopperFinals']);router[_0x6f68('0x8')](_0x6f68('0x10'),auth['isAuthenticated'](),controller[_0x6f68('0x11')]);router[_0x6f68('0x8')](_0x6f68('0x12'),auth['isAuthenticated'](),controller[_0x6f68('0x13')]);router[_0x6f68('0x8')](_0x6f68('0x14'),auth[_0x6f68('0x6')](),controller['getAgents']);router[_0x6f68('0x8')](_0x6f68('0x15'),auth[_0x6f68('0x6')](),controller[_0x6f68('0x16')]);router[_0x6f68('0x8')]('/:id/lists',auth[_0x6f68('0x6')](),controller[_0x6f68('0x17')]);router[_0x6f68('0x8')]('/:id/blacklists',auth[_0x6f68('0x6')](),controller[_0x6f68('0x18')]);router[_0x6f68('0x19')]('/',auth[_0x6f68('0x6')](),controller[_0x6f68('0x1a')]);router[_0x6f68('0x19')](_0x6f68('0x1b'),auth[_0x6f68('0x6')](),controller[_0x6f68('0x1c')]);router[_0x6f68('0x19')](_0x6f68('0x12'),auth[_0x6f68('0x6')](),controller[_0x6f68('0x1d')]);router[_0x6f68('0x19')](_0x6f68('0x14'),auth[_0x6f68('0x6')](),controller['addAgents']);router[_0x6f68('0x19')](_0x6f68('0x1e'),auth['isAuthenticated'](),controller[_0x6f68('0x1f')]);router['post'](_0x6f68('0x20'),auth[_0x6f68('0x6')](),controller[_0x6f68('0x21')]);router[_0x6f68('0x22')](_0x6f68('0x9'),auth['isAuthenticated'](),controller[_0x6f68('0x23')]);router[_0x6f68('0x24')]('/:id',auth[_0x6f68('0x6')](),controller['destroy']);router[_0x6f68('0x24')]('/:id/teams',auth[_0x6f68('0x6')](),controller[_0x6f68('0x25')]);router['delete']('/:id/users',auth[_0x6f68('0x6')](),controller[_0x6f68('0x26')]);router['delete']('/:id/lists',auth[_0x6f68('0x6')](),controller['removeLists']);router['delete'](_0x6f68('0x20'),auth[_0x6f68('0x6')](),controller[_0x6f68('0x27')]);module[_0x6f68('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 9228bdf..7d65f69 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 _0xd1bd=['all','once','TEXT','periodic_announce','split','setDataValue','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','inbound','outbound','ENUM','leastrecent','fewestcalls','random','wrandom','rrordered','strategy','rrmemory','type','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xd1bd,0x8a));var _0xdd1b=function(_0x2420c8,_0x59cdcc){_0x2420c8=_0x2420c8-0x0;var _0x46e13d=_0xd1bd[_0x2420c8];return _0x46e13d;};'use strict';var Sequelize=require(_0xdd1b('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd1b('0x1')],'allowNull':![],'unique':_0xdd1b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xdd1b('0x3'),_0xdd1b('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xdd1b('0x5')]('rr','ringall',_0xdd1b('0x6'),_0xdd1b('0x7'),_0xdd1b('0x8'),'rrmemory','linear',_0xdd1b('0x9'),_0xdd1b('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2ee879){this['setDataValue'](_0xdd1b('0xb'),_0x2ee879?_0x2ee879:_0xdd1b('0xc'));},'get':function(){var _0x1f82bd=this['getDataValue'](_0xdd1b('0xd'));var _0x3e0080=this[_0xdd1b('0xe')](_0xdd1b('0xf'));var _0x124593=this['getDataValue']('strategy');if(_0x1f82bd===_0xdd1b('0x3')){return _0x124593;}if(_0x3e0080===_0xdd1b('0x10')&&_0x124593===_0xdd1b('0xc')||_0x3e0080===_0xdd1b('0x10')&&_0x124593===_0xdd1b('0x11')){return _0x124593;}if(_0x3e0080==='progressive'||_0x3e0080===_0xdd1b('0x12')||_0x3e0080===_0xdd1b('0x13')){return _0x124593;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdd1b('0x14')](0xb)},'timeout':{'type':Sequelize[_0xdd1b('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xdd1b('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdd1b('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':_0xdd1b('0x15')},'autopause':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no',_0xdd1b('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdd1b('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xdd1b('0x5')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xdd1b('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdd1b('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdd1b('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdd1b('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':_0xdd1b('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xdd1b('0x15'),'no',_0xdd1b('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xdd1b('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdd1b('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdd1b('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdd1b('0x1')]},'queue_quantity1':{'type':Sequelize[_0xdd1b('0x1')]},'queue_quantity2':{'type':Sequelize[_0xdd1b('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xdd1b('0x1')]},'periodic_announce':{'type':Sequelize[_0xdd1b('0x18')],'set':function(_0x75ce65){this['setDataValue'](_0xdd1b('0x19'),_0x75ce65?_0x75ce65['join'](','):[]);},'get':function(){return this['getDataValue'](_0xdd1b('0x19'))?this[_0xdd1b('0xe')](_0xdd1b('0x19'))[_0xdd1b('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':_0xdd1b('0x15'),'set':function(_0x225245){this[_0xdd1b('0x1b')](_0xdd1b('0x1c'),_0x225245?_0x225245[_0xdd1b('0x1d')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this['getDataValue'](_0xdd1b('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':'no','set':function(_0x36df60){this['setDataValue']('leavewhenempty',_0x36df60?_0x36df60['join'](','):undefined);},'get':function(){return this[_0xdd1b('0xe')](_0xdd1b('0x1e'))?this[_0xdd1b('0xe')](_0xdd1b('0x1e'))[_0xdd1b('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdd1b('0x5')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xdd1b('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdd1b('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':0x0,'set':function(_0x57f052){this[_0xdd1b('0x1b')](_0xdd1b('0x20'),_0x57f052);if(_0x57f052){if(this[_0xdd1b('0xe')](_0xdd1b('0x21'))<0x2){this[_0xdd1b('0x1b')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdd1b('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':0x0,'comment':_0xdd1b('0x22')},'dialMethod':{'type':Sequelize['ENUM'](_0xdd1b('0x23'),_0xdd1b('0x24'),_0xdd1b('0x13'),_0xdd1b('0x12'),_0xdd1b('0x10')),'defaultValue':'progressive','comment':_0xdd1b('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xdd1b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdd1b('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xdd1b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdd1b('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xdd1b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdd1b('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x2a'),_0xdd1b('0x2b')),'defaultValue':_0xdd1b('0x2b'),'comment':_0xdd1b('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdd1b('0x2d')](0x2)[_0xdd1b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdd1b('0x2e')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xdd1b('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdd1b('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdd1b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdd1b('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':'tTxX','comment':_0xdd1b('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xdd1b('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd1b('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd1b('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdd1b('0x37')},'dialTimezone':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':_0xdd1b('0x38')},'dialPrefix':{'type':Sequelize[_0xdd1b('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x39'),_0xdd1b('0x3a'),_0xdd1b('0x3b')),'defaultValue':_0xdd1b('0x39')},'dialAMDActive':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xdd1b('0x14')](0x9)[_0xdd1b('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdd1b('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xdd1b('0x14')](0x9)[_0xdd1b('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdd1b('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdd1b('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdd1b('0x14')](0x9)[_0xdd1b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdd1b('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xdd1b('0x14')](0x9)[_0xdd1b('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdd1b('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdd1b('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdd1b('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xdd1b('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdd1b('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdd1b('0x14')](0x9)[_0xdd1b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xdd1b('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':0x0,'comment':_0xdd1b('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdd1b('0x5')](_0xdd1b('0x44'),'ASC'),'defaultValue':_0xdd1b('0x44')},'dialQueueProject2':{'type':Sequelize[_0xdd1b('0x1')],'comment':_0xdd1b('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd1b('0x45')},'dialCutDigit':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdd1b('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd1b('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x48')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd1b('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdd1b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdd1b('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd1b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdd1b('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdd1b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdd1b('0x14')](0x5)[_0xdd1b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xdd1b('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xdd1b('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3317de){if(!_0x3317de)this[_0xdd1b('0x1b')](_0xdd1b('0x4e'),null);this['setDataValue'](_0xdd1b('0x4f'),_0x3317de);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xdd1b('0x14')](0x3)[_0xdd1b('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x97f6=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','INTEGER','yes','once','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x2c66f6,_0x2dae26){var _0x1e5894=function(_0x1da1ab){while(--_0x1da1ab){_0x2c66f6['push'](_0x2c66f6['shift']());}};_0x1e5894(++_0x2dae26);}(_0x97f6,0x199));var _0x697f=function(_0x1e06ad,_0x1f7310){_0x1e06ad=_0x1e06ad-0x0;var _0x5a01b3=_0x97f6[_0x1e06ad];return _0x5a01b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x697f('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x2'),_0x697f('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x697f('0x4')],'defaultValue':_0x697f('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x697f('0x1')]('rr',_0x697f('0x6'),_0x697f('0x7'),_0x697f('0x8'),'random',_0x697f('0x9'),'linear',_0x697f('0xa'),_0x697f('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0xf0c82b){this[_0x697f('0xc')](_0x697f('0xd'),_0xf0c82b?_0xf0c82b:'rrmemory');},'get':function(){var _0x116d30=this['getDataValue']('type');var _0x4ec77c=this[_0x697f('0xe')](_0x697f('0xf'));var _0x1b499a=this[_0x697f('0xe')](_0x697f('0xd'));if(_0x116d30==='inbound'){return _0x1b499a;}if(_0x4ec77c===_0x697f('0x10')&&_0x1b499a==='rrmemory'||_0x4ec77c===_0x697f('0x10')&&_0x1b499a===_0x697f('0x11')){return _0x1b499a;}if(_0x4ec77c===_0x697f('0x12')||_0x4ec77c==='predictive'||_0x4ec77c==='power'){return _0x1b499a;}return null;}},'servicelevel':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x697f('0x13')](0xb)},'timeout':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x697f('0x4')]},'weight':{'type':Sequelize[_0x697f('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x697f('0x14'),'no'),'defaultValue':_0x697f('0x14')},'autopause':{'type':Sequelize[_0x697f('0x1')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x697f('0x1')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x697f('0x1')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x697f('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x697f('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x697f('0x1')]('yes','no'),'defaultValue':_0x697f('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x697f('0x14'),'no',_0x697f('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x697f('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x697f('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x697f('0x4')]},'queue_youarenext':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x697f('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x697f('0x4')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x697f('0x4')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x697f('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xb5e992){this[_0x697f('0xc')](_0x697f('0x16'),_0xb5e992?_0xb5e992[_0x697f('0x17')](','):[]);},'get':function(){return this[_0x697f('0xe')](_0x697f('0x16'))?this['getDataValue'](_0x697f('0x16'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x697f('0x4')],'defaultValue':_0x697f('0x14'),'set':function(_0x1dc4e7){this[_0x697f('0xc')](_0x697f('0x18'),_0x1dc4e7?_0x1dc4e7[_0x697f('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0x697f('0x18'))?this[_0x697f('0xe')](_0x697f('0x18'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x697f('0x4')],'defaultValue':'no','set':function(_0x36dfc3){this['setDataValue'](_0x697f('0x19'),_0x36dfc3?_0x36dfc3['join'](','):undefined);},'get':function(){return this[_0x697f('0xe')](_0x697f('0x19'))?this[_0x697f('0xe')](_0x697f('0x19'))[_0x697f('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x697f('0x1')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x697f('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x697f('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x697f('0x4')]},'description':{'type':Sequelize[_0x697f('0x4')]},'acw':{'type':Sequelize[_0x697f('0x1b')],'defaultValue':0x0,'set':function(_0x482006){this[_0x697f('0xc')](_0x697f('0x1c'),_0x482006);if(_0x482006){if(this['getDataValue'](_0x697f('0x1d'))<0x2){this[_0x697f('0xc')](_0x697f('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x697f('0x1b')],'defaultValue':0x0,'comment':_0x697f('0x1e')},'dialMethod':{'type':Sequelize[_0x697f('0x1')]('preview','progressive','power','predictive',_0x697f('0x10')),'defaultValue':_0x697f('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x697f('0x1f')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x697f('0x20')},'dialLimitQueue':{'type':Sequelize[_0x697f('0x13')](0x4)[_0x697f('0x1f')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x697f('0x1f')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x697f('0x21')},'dialPredictiveOptimization':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x22'),_0x697f('0x23')),'defaultValue':_0x697f('0x23'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x697f('0x24')](0x2)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x697f('0x25')},'dialPredictiveInterval':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x697f('0x26')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x27')},'dialQueueOptions':{'type':Sequelize[_0x697f('0x4')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x28')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x29')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x2a')},'dialBusyMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x2b')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x697f('0x2c')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x2d')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x697f('0x2e')},'dialTimezone':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x697f('0x4')],'defaultValue':_0x697f('0x2f')},'dialPrefix':{'type':Sequelize[_0x697f('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x30'),_0x697f('0x31'),_0x697f('0x32')),'defaultValue':_0x697f('0x30')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x697f('0x33')},'dialAMDInitialSilence':{'type':Sequelize[_0x697f('0x13')](0x9)[_0x697f('0x1f')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x697f('0x34')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x697f('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x697f('0x13')](0x9)[_0x697f('0x1f')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x697f('0x1f')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x697f('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0x697f('0x13')](0x9)[_0x697f('0x1f')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x697f('0x37')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x697f('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x697f('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x697f('0x13')](0x9)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x697f('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x697f('0x13')](0x9)[_0x697f('0x1f')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x697f('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x697f('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x697f('0x1b')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x697f('0x1')](_0x697f('0x3c'),_0x697f('0x3d')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x697f('0x4')],'comment':_0x697f('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x697f('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x697f('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x3f')},'dialDropMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x40')},'dialDropRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x41')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x42')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x43')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x44')},'dialMachineRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x697f('0x46')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x697f('0x13')](0x5)[_0x697f('0x1f')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x697f('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x697f('0x13')],'allowNull':!![],'comment':_0x697f('0x48')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3eeede){if(!_0x3eeede)this[_0x697f('0xc')](_0x697f('0x49'),null);this[_0x697f('0xc')](_0x697f('0x4a'),_0x3eeede);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x697f('0x13')](0x3)[_0x697f('0x1f')],'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 07dcab4..dd682f8 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 _0x3c04=['count','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','find','type','name','destroy','error','stack','send','index','VoiceQueue','rawAttributes','key','query','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','keys','intersection','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','user','UserProfileSection','findOne','pick','VoiceQueueId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','spread','push','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','into','scheduledAt','ContactId','ListId','phone','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','insert','fromQuery','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','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','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x3c04,0x95));var _0x43c0=function(_0x40a995,_0x34642e){_0x40a995=_0x40a995-0x0;var _0x2a600c=_0x3c04[_0x40a995];return _0x2a600c;};'use strict';var emlformat=require(_0x43c0('0x0'));var rimraf=require(_0x43c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x43c0('0x2'));var rp=require(_0x43c0('0x3'));var moment=require(_0x43c0('0x4'));var BPromise=require(_0x43c0('0x5'));var Mustache=require(_0x43c0('0x6'));var util=require(_0x43c0('0x7'));var path=require(_0x43c0('0x8'));var sox=require(_0x43c0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43c0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x43c0('0xb'));var toCsv=require(_0x43c0('0xc'));var querystring=require('querystring');var Papa=require(_0x43c0('0xd'));var Redis=require(_0x43c0('0xe'));var authService=require(_0x43c0('0xf'));var qs=require(_0x43c0('0x10'));var as=require(_0x43c0('0x11'));var hardwareService=require(_0x43c0('0x12'));var logger=require(_0x43c0('0x13'))(_0x43c0('0x14'));var utils=require(_0x43c0('0x15'));var config=require(_0x43c0('0x16'));var licenseUtil=require(_0x43c0('0x17'));var db=require(_0x43c0('0x18'))['db'];config[_0x43c0('0x19')]=_[_0x43c0('0x1a')](config[_0x43c0('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43c0('0x19')]));require('./voiceQueue.socket')[_0x43c0('0x1b')](socket);function respondWithStatusCode(_0x284f1c,_0x13443d){_0x13443d=_0x13443d||0xcc;return function(_0x19fccf){if(_0x19fccf){return _0x284f1c[_0x43c0('0x1c')](_0x13443d);}return _0x284f1c[_0x43c0('0x1d')](_0x13443d)[_0x43c0('0x1e')]();};}function respondWithResult(_0x4b1994,_0x30bbe4){_0x30bbe4=_0x30bbe4||0xc8;return function(_0x2135c9){if(_0x2135c9){return _0x4b1994['status'](_0x30bbe4)[_0x43c0('0x1f')](_0x2135c9);}};}function respondWithFilteredResult(_0x33728e,_0x19c209){return function(_0x10d404){if(_0x10d404){var _0x45bca6=typeof _0x19c209[_0x43c0('0x20')]===_0x43c0('0x21')&&typeof _0x19c209[_0x43c0('0x22')]===_0x43c0('0x21');var _0x275045=_0x10d404['count'];var _0xc9503=_0x45bca6?0x0:_0x19c209['offset'];var _0x361d0c=_0x45bca6?_0x10d404[_0x43c0('0x23')]:_0x19c209['offset']+_0x19c209[_0x43c0('0x22')];var _0x15f36b;if(_0x361d0c>=_0x275045){_0x361d0c=_0x275045;_0x15f36b=0xc8;}else{_0x15f36b=0xce;}_0x33728e['status'](_0x15f36b);return _0x33728e['set'](_0x43c0('0x24'),_0xc9503+'-'+_0x361d0c+'/'+_0x275045)[_0x43c0('0x1f')](_0x10d404);}return null;};}function patchUpdates(_0xfcca13){return function(_0x5324fc){try{jsonpatch[_0x43c0('0x25')](_0x5324fc,_0xfcca13,!![]);}catch(_0x200e7f){return BPromise[_0x43c0('0x26')](_0x200e7f);}return _0x5324fc[_0x43c0('0x27')]();};}function saveUpdates(_0x48c67c,_0x3cb286){return function(_0xa119c6){if(_0xa119c6){return _0xa119c6[_0x43c0('0x28')](_0x48c67c)[_0x43c0('0x29')](function(_0x528d64){return _0x528d64;});}return null;};}function removeEntity(_0x32ff30,_0x46d376){return function(_0x3f21c8){if(_0x3f21c8){return _0x3f21c8['destroy']()[_0x43c0('0x29')](function(){var _0x1b4678=_0x3f21c8[_0x43c0('0x2a')]({'plain':!![]});var _0x26fb9a=[{'name':_0x43c0('0x2b'),'value':_0x43c0('0x2c'),'ignore':![]},{'name':_0x43c0('0x2d'),'value':_0x43c0('0x2e'),'ignore':![]}];var _0xc4a7b7=_(_0x26fb9a)['filter'](_0x43c0('0x2f'))[_0x43c0('0x30')](_0x43c0('0x31'))['value']();if(_[_0x43c0('0x32')](_0xc4a7b7,_0x1b4678['type'])){return;}var _0x2f34b4=_[_0x43c0('0x33')](_0x26fb9a,[_0x43c0('0x31'),_0x1b4678[_0x43c0('0x34')]])[_0x43c0('0x35')];return db['UserProfileResource'][_0x43c0('0x36')]({'where':{'type':_0x2f34b4,'resourceId':_0x1b4678['id']}})[_0x43c0('0x29')](function(){return _0x3f21c8;});})[_0x43c0('0x29')](function(){_0x32ff30[_0x43c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x371c5b,_0x2a45c1){return function(_0x928678){if(!_0x928678){_0x371c5b[_0x43c0('0x1c')](0x194);}return _0x928678;};}function handleError(_0x3785fd,_0x5a56c5){_0x5a56c5=_0x5a56c5||0x1f4;return function(_0x92bb0c){logger[_0x43c0('0x37')](_0x92bb0c[_0x43c0('0x38')]);if(_0x92bb0c['name']){delete _0x92bb0c[_0x43c0('0x35')];}_0x3785fd[_0x43c0('0x1d')](_0x5a56c5)[_0x43c0('0x39')](_0x92bb0c);};}exports[_0x43c0('0x3a')]=function(_0x430da8,_0x4c4837){var _0x4b7442={},_0x183f43={},_0x195273={'count':0x0,'rows':[]};var _0x48ea7f=_['map'](db[_0x43c0('0x3b')][_0x43c0('0x3c')],function(_0x200b9e){return{'name':_0x200b9e['fieldName'],'type':_0x200b9e[_0x43c0('0x34')][_0x43c0('0x3d')]};});_0x183f43['model']=_[_0x43c0('0x30')](_0x48ea7f,_0x43c0('0x35'));_0x183f43[_0x43c0('0x3e')]=_['keys'](_0x430da8[_0x43c0('0x3e')]);_0x183f43[_0x43c0('0x3f')]=_['intersection'](_0x183f43[_0x43c0('0x40')],_0x183f43[_0x43c0('0x3e')]);_0x4b7442[_0x43c0('0x41')]=_['intersection'](_0x183f43['model'],qs['fields'](_0x430da8[_0x43c0('0x3e')]['fields']));_0x4b7442[_0x43c0('0x41')]=_0x4b7442[_0x43c0('0x41')][_0x43c0('0x42')]?_0x4b7442[_0x43c0('0x41')]:_0x183f43[_0x43c0('0x40')];if(!_0x430da8[_0x43c0('0x3e')][_0x43c0('0x43')](_0x43c0('0x44'))){_0x4b7442[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x430da8[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x4b7442[_0x43c0('0x20')]=qs['offset'](_0x430da8[_0x43c0('0x3e')]['offset']);}_0x4b7442[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x430da8[_0x43c0('0x3e')][_0x43c0('0x46')]);_0x4b7442[_0x43c0('0x47')]=qs[_0x43c0('0x3f')](_['pick'](_0x430da8[_0x43c0('0x3e')],_0x183f43[_0x43c0('0x3f')]),_0x48ea7f);if(_0x430da8['query'][_0x43c0('0x48')]){_0x4b7442[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x4b7442[_0x43c0('0x47')],{'$or':_['map'](_0x48ea7f,function(_0x331d90){if(_0x331d90[_0x43c0('0x34')]!=='VIRTUAL'){var _0x3db31e={};_0x3db31e[_0x331d90[_0x43c0('0x35')]]={'$like':'%'+_0x430da8[_0x43c0('0x3e')][_0x43c0('0x48')]+'%'};return _0x3db31e;}})});}_0x4b7442=_[_0x43c0('0x49')]({},_0x4b7442,_0x430da8[_0x43c0('0x4a')]);var _0x55a08a={'where':_0x4b7442[_0x43c0('0x47')]};return db['VoiceQueue'][_0x43c0('0x23')](_0x55a08a)[_0x43c0('0x29')](function(_0x2c51d6){_0x195273['count']=_0x2c51d6;if(_0x430da8[_0x43c0('0x3e')][_0x43c0('0x4b')]){_0x4b7442[_0x43c0('0x4c')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x4b7442);})['then'](function(_0x17cb7f){_0x195273[_0x43c0('0x4d')]=_0x17cb7f;return _0x195273;})[_0x43c0('0x29')](respondWithFilteredResult(_0x4c4837,_0x4b7442))['catch'](handleError(_0x4c4837,null));};exports[_0x43c0('0x4e')]=function(_0xe03869,_0xd02d37){var _0x2d38f9={'raw':![],'where':{'id':_0xe03869[_0x43c0('0x4f')]['id']}},_0x8d7997={};_0x8d7997['model']=_[_0x43c0('0x50')](db[_0x43c0('0x3b')][_0x43c0('0x3c')]);_0x8d7997[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0xe03869[_0x43c0('0x3e')]);_0x8d7997[_0x43c0('0x3f')]=_['intersection'](_0x8d7997['model'],_0x8d7997[_0x43c0('0x3e')]);_0x2d38f9['attributes']=_[_0x43c0('0x51')](_0x8d7997[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0xe03869['query'][_0x43c0('0x52')]));_0x2d38f9[_0x43c0('0x41')]=_0x2d38f9['attributes'][_0x43c0('0x42')]?_0x2d38f9['attributes']:_0x8d7997[_0x43c0('0x40')];if(_0xe03869[_0x43c0('0x3e')]['includeAll']){_0x2d38f9[_0x43c0('0x4c')]=[{'all':!![]}];}_0x2d38f9=_[_0x43c0('0x49')]({},_0x2d38f9,_0xe03869['options']);return db[_0x43c0('0x3b')][_0x43c0('0x33')](_0x2d38f9)['then'](handleEntityNotFound(_0xd02d37,null))[_0x43c0('0x29')](respondWithResult(_0xd02d37,null))[_0x43c0('0x53')](handleError(_0xd02d37,null));};exports[_0x43c0('0x54')]=function(_0x491743,_0x3feed9){return db[_0x43c0('0x3b')][_0x43c0('0x54')](_0x491743[_0x43c0('0x55')],{})['then'](function(_0x2f61ac){var _0x44ccc9=_0x491743['user'][_0x43c0('0x2a')]({'plain':!![]});if(!_0x44ccc9)throw new Error(_0x43c0('0x56'));if(_0x44ccc9['role']==='user'){var _0xfbbd63=_0x2f61ac[_0x43c0('0x2a')]({'plain':!![]});var _0x32a5db=[{'name':_0x43c0('0x2b'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43c0('0x2e')}];var _0x1feca8=_[_0x43c0('0x33')](_0x32a5db,[_0x43c0('0x31'),_0xfbbd63[_0x43c0('0x34')]])[_0x43c0('0x35')];return db['UserProfileSection'][_0x43c0('0x33')]({'where':{'name':_0x1feca8,'userProfileId':_0x44ccc9[_0x43c0('0x57')]},'raw':!![]})[_0x43c0('0x29')](function(_0x314e0f){if(_0x314e0f&&_0x314e0f[_0x43c0('0x58')]===0x0){return db[_0x43c0('0x59')][_0x43c0('0x54')]({'name':_0xfbbd63[_0x43c0('0x35')],'resourceId':_0xfbbd63['id'],'type':_0x314e0f[_0x43c0('0x35')],'sectionId':_0x314e0f['id']},{})[_0x43c0('0x29')](function(){return _0x2f61ac;});}else{return _0x2f61ac;}})['catch'](function(_0x36ef23){logger[_0x43c0('0x37')](_0x43c0('0x5a'),_0x36ef23);throw _0x36ef23;});}return _0x2f61ac;})[_0x43c0('0x29')](respondWithResult(_0x3feed9,0xc9))[_0x43c0('0x53')](handleError(_0x3feed9,null));};exports[_0x43c0('0x5b')]=function(_0x31ef6c,_0x37200f){var _0x566a08={'where':{'id':_0x31ef6c[_0x43c0('0x4f')]['id']}},_0x1b5b29={};_0x1b5b29[_0x43c0('0x40')]=_[_0x43c0('0x50')](db[_0x43c0('0x3b')]['rawAttributes']);_0x566a08['attributes']=_[_0x43c0('0x51')](_0x1b5b29[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x31ef6c['query'][_0x43c0('0x52')]));_0x566a08[_0x43c0('0x41')]=_0x566a08[_0x43c0('0x41')][_0x43c0('0x42')]?_0x566a08[_0x43c0('0x41')]:_0x1b5b29['model'];if(_0x31ef6c[_0x43c0('0x3e')]['includeAll']){_0x566a08[_0x43c0('0x4c')]=[{'all':!![]}];}_0x566a08=_[_0x43c0('0x49')]({},_0x566a08,_0x31ef6c[_0x43c0('0x4a')]);return db[_0x43c0('0x3b')]['find'](_0x566a08)['then'](handleEntityNotFound(_0x37200f,null))[_0x43c0('0x29')](function(_0x23e37f){if(_0x23e37f){var _0x4c0735=_0x23e37f[_0x43c0('0x2a')]({'plain':!![]});_0x4c0735=qs[_0x43c0('0x5c')](_0x4c0735,['id',_0x43c0('0x5d'),_0x43c0('0x5e')]);_0x31ef6c[_0x43c0('0x55')]=_[_0x43c0('0x5c')](_0x31ef6c['body'],['id','createdAt',_0x43c0('0x5e')]);return db[_0x43c0('0x3b')][_0x43c0('0x54')](_[_0x43c0('0x49')](_0x4c0735,_0x31ef6c['body']),{'include':_0x31ef6c['query'][_0x43c0('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x59861d){var _0x5e8235=_0x31ef6c['user'][_0x43c0('0x2a')]({'plain':!![]});if(!_0x5e8235)throw new Error(_0x43c0('0x56'));if(_0x5e8235[_0x43c0('0x5f')]===_0x43c0('0x60')){var _0x28d023=_0x59861d[_0x43c0('0x2a')]({'plain':!![]});var _0x1ed04d=[{'name':_0x43c0('0x2b'),'value':_0x43c0('0x2c')},{'name':_0x43c0('0x2d'),'value':_0x43c0('0x2e')}];var _0x5b91b0=_[_0x43c0('0x33')](_0x1ed04d,[_0x43c0('0x31'),_0x28d023[_0x43c0('0x34')]])[_0x43c0('0x35')];return db[_0x43c0('0x61')][_0x43c0('0x33')]({'where':{'name':_0x5b91b0,'userProfileId':_0x5e8235[_0x43c0('0x57')]},'raw':!![]})[_0x43c0('0x29')](function(_0x5e8307){if(_0x5e8307&&_0x5e8307[_0x43c0('0x58')]===0x0){return db[_0x43c0('0x59')]['create']({'name':_0x28d023['name'],'resourceId':_0x28d023['id'],'type':_0x5e8307[_0x43c0('0x35')],'sectionId':_0x5e8307['id']},{})['then'](function(){return _0x59861d;});}else{return _0x59861d;}})[_0x43c0('0x53')](function(_0x5539de){logger['error'](_0x43c0('0x5a'),_0x5539de);throw _0x5539de;});}return _0x59861d;});}})[_0x43c0('0x29')](respondWithResult(_0x37200f,0xc9))[_0x43c0('0x53')](handleError(_0x37200f,null));};exports[_0x43c0('0x28')]=function(_0x4303dc,_0x5d9fd2){if(_0x4303dc[_0x43c0('0x55')]['id']){delete _0x4303dc[_0x43c0('0x55')]['id'];}return db['VoiceQueue'][_0x43c0('0x33')]({'where':{'id':_0x4303dc[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x5d9fd2,null))[_0x43c0('0x29')](saveUpdates(_0x4303dc[_0x43c0('0x55')],null))[_0x43c0('0x29')](respondWithResult(_0x5d9fd2,null))[_0x43c0('0x53')](handleError(_0x5d9fd2,null));};exports[_0x43c0('0x36')]=function(_0x4c9d05,_0x5990ea){return db['VoiceQueue'][_0x43c0('0x33')]({'where':{'id':_0x4c9d05[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x5990ea,null))[_0x43c0('0x29')](removeEntity(_0x5990ea,null))['catch'](handleError(_0x5990ea,null));};exports['getHoppers']=function(_0x2076f4,_0x2e1531,_0x58ca36){var _0x32b9fc={'raw':![],'where':{}};var _0xebac42={};var _0x3245ec={'count':0x0,'rows':[]};return db[_0x43c0('0x3b')][_0x43c0('0x62')]({'where':{'id':_0x2076f4[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x2e1531,null))[_0x43c0('0x29')](function(_0x955e75){if(_0x955e75){_0xebac42[_0x43c0('0x40')]=_['keys'](db['CmHopper'][_0x43c0('0x3c')]);_0xebac42[_0x43c0('0x3e')]=_['keys'](_0x2076f4[_0x43c0('0x3e')]);_0xebac42[_0x43c0('0x3f')]=_[_0x43c0('0x51')](_0xebac42[_0x43c0('0x40')],_0xebac42[_0x43c0('0x3e')]);_0x32b9fc[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0xebac42['model'],qs[_0x43c0('0x52')](_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x52')]));_0x32b9fc[_0x43c0('0x41')]=_0x32b9fc[_0x43c0('0x41')][_0x43c0('0x42')]?_0x32b9fc[_0x43c0('0x41')]:_0xebac42[_0x43c0('0x40')];if(!_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x43')]('nolimit')){_0x32b9fc[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x32b9fc[_0x43c0('0x20')]=qs[_0x43c0('0x20')](_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x20')]);}_0x32b9fc['order']=qs[_0x43c0('0x46')](_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x46')]);_0x32b9fc[_0x43c0('0x47')]=qs[_0x43c0('0x3f')](_[_0x43c0('0x63')](_0x2076f4[_0x43c0('0x3e')],_0xebac42[_0x43c0('0x3f')]));_0x32b9fc[_0x43c0('0x47')][_0x43c0('0x64')]=_0x955e75['id'];if(_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x48')]){_0x32b9fc[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x32b9fc[_0x43c0('0x47')],{'$or':_[_0x43c0('0x30')](_0x32b9fc[_0x43c0('0x41')],function(_0x3c9da3){var _0x20f181={};_0x20f181[_0x3c9da3]={'$like':'%'+_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x48')]+'%'};return _0x20f181;})});}_0x32b9fc=_[_0x43c0('0x49')]({},_0x32b9fc,_0x2076f4[_0x43c0('0x4a')]);return db[_0x43c0('0x65')][_0x43c0('0x23')]({'where':_0x32b9fc[_0x43c0('0x47')]})[_0x43c0('0x29')](function(_0x28920b){_0x3245ec[_0x43c0('0x23')]=_0x28920b;if(_0x2076f4[_0x43c0('0x3e')][_0x43c0('0x4b')]){_0x32b9fc[_0x43c0('0x4c')]=[{'all':!![]}];}return db[_0x43c0('0x65')][_0x43c0('0x66')](_0x32b9fc);})[_0x43c0('0x29')](function(_0x4a5b6b){_0x3245ec[_0x43c0('0x4d')]=_0x4a5b6b;return _0x3245ec;});}})['then'](respondWithFilteredResult(_0x2e1531,_0x32b9fc))[_0x43c0('0x53')](handleError(_0x2e1531,null));};exports[_0x43c0('0x67')]=function(_0x10e96d,_0x3f967f,_0xb29789){var _0x150416={'raw':!![],'where':{}};var _0x50263b={};var _0x176f9a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43c0('0x62')]({'where':{'id':_0x10e96d['params']['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x3f967f,null))['then'](function(_0x131f46){if(_0x131f46){_0x50263b[_0x43c0('0x40')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x50263b[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x10e96d[_0x43c0('0x3e')]);_0x50263b[_0x43c0('0x3f')]=_['intersection'](_0x50263b['model'],_0x50263b[_0x43c0('0x3e')]);_0x150416[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x50263b['model'],qs[_0x43c0('0x52')](_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x52')]));_0x150416[_0x43c0('0x41')]=_0x150416[_0x43c0('0x41')][_0x43c0('0x42')]?_0x150416[_0x43c0('0x41')]:_0x50263b[_0x43c0('0x40')];if(!_0x10e96d['query'][_0x43c0('0x43')](_0x43c0('0x44'))){_0x150416[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x150416[_0x43c0('0x20')]=qs[_0x43c0('0x20')](_0x10e96d['query'][_0x43c0('0x20')]);}_0x150416[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x46')]);_0x150416[_0x43c0('0x47')]=qs[_0x43c0('0x3f')](_['pick'](_0x10e96d['query'],_0x50263b[_0x43c0('0x3f')]));_0x150416['where'][_0x43c0('0x64')]=_0x131f46['id'];if(_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x48')]){_0x150416[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x150416[_0x43c0('0x47')],{'$or':_['map'](_0x150416['attributes'],function(_0x40b957){var _0x15bcfc={};_0x15bcfc[_0x40b957]={'$like':'%'+_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x48')]+'%'};return _0x15bcfc;})});}_0x150416=_[_0x43c0('0x49')]({},_0x150416,_0x10e96d[_0x43c0('0x4a')]);return db[_0x43c0('0x68')][_0x43c0('0x23')]({'where':_0x150416['where']})[_0x43c0('0x29')](function(_0x24e1c1){_0x176f9a['count']=_0x24e1c1;if(_0x10e96d[_0x43c0('0x3e')][_0x43c0('0x4b')]){_0x150416['include']=[{'all':!![]}];}return db[_0x43c0('0x68')]['findAll'](_0x150416);})[_0x43c0('0x29')](function(_0x42745a){_0x176f9a[_0x43c0('0x4d')]=_0x42745a;return _0x176f9a;});}})[_0x43c0('0x29')](respondWithFilteredResult(_0x3f967f,_0x150416))[_0x43c0('0x53')](handleError(_0x3f967f,null));};exports[_0x43c0('0x69')]=function(_0x375573,_0x19be42,_0xb2a6ea){var _0x4a7dfa={'raw':!![],'where':{}};var _0x4d98b9={};var _0x2a2e87={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43c0('0x62')]({'where':{'id':_0x375573[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x19be42,null))['then'](function(_0x4b447d){if(_0x4b447d){_0x4d98b9[_0x43c0('0x40')]=_[_0x43c0('0x50')](db[_0x43c0('0x6a')][_0x43c0('0x3c')]);_0x4d98b9[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x375573[_0x43c0('0x3e')]);_0x4d98b9[_0x43c0('0x3f')]=_[_0x43c0('0x51')](_0x4d98b9['model'],_0x4d98b9[_0x43c0('0x3e')]);_0x4a7dfa[_0x43c0('0x41')]=_['intersection'](_0x4d98b9[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x375573[_0x43c0('0x3e')][_0x43c0('0x52')]));_0x4a7dfa[_0x43c0('0x41')]=_0x4a7dfa[_0x43c0('0x41')][_0x43c0('0x42')]?_0x4a7dfa['attributes']:_0x4d98b9[_0x43c0('0x40')];if(!_0x375573[_0x43c0('0x3e')]['hasOwnProperty'](_0x43c0('0x44'))){_0x4a7dfa[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x375573[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x4a7dfa[_0x43c0('0x20')]=qs['offset'](_0x375573[_0x43c0('0x3e')][_0x43c0('0x20')]);}_0x4a7dfa[_0x43c0('0x45')]=qs['sort'](_0x375573['query'][_0x43c0('0x46')]);_0x4a7dfa[_0x43c0('0x47')]=qs['filters'](_[_0x43c0('0x63')](_0x375573[_0x43c0('0x3e')],_0x4d98b9['filters']));_0x4a7dfa[_0x43c0('0x47')][_0x43c0('0x64')]=_0x4b447d['id'];if(_0x375573[_0x43c0('0x3e')][_0x43c0('0x48')]){_0x4a7dfa[_0x43c0('0x47')]=_['merge'](_0x4a7dfa['where'],{'$or':_[_0x43c0('0x30')](_0x4a7dfa[_0x43c0('0x41')],function(_0x19375d){var _0x159f81={};_0x159f81[_0x19375d]={'$like':'%'+_0x375573[_0x43c0('0x3e')]['filter']+'%'};return _0x159f81;})});}_0x4a7dfa=_['merge']({},_0x4a7dfa,_0x375573['options']);return db[_0x43c0('0x6a')]['count']({'where':_0x4a7dfa[_0x43c0('0x47')]})[_0x43c0('0x29')](function(_0xbc5f02){_0x2a2e87[_0x43c0('0x23')]=_0xbc5f02;if(_0x375573[_0x43c0('0x3e')]['includeAll']){_0x4a7dfa[_0x43c0('0x4c')]=[{'all':!![]}];}return db[_0x43c0('0x6a')][_0x43c0('0x66')](_0x4a7dfa);})[_0x43c0('0x29')](function(_0xb6dc0){_0x2a2e87[_0x43c0('0x4d')]=_0xb6dc0;return _0x2a2e87;});}})[_0x43c0('0x29')](respondWithFilteredResult(_0x19be42,_0x4a7dfa))['catch'](handleError(_0x19be42,null));};exports['getHopperBlacks']=function(_0x527de4,_0x177946,_0x3e290d){var _0xa9fdd0={'raw':!![],'where':{}};var _0x3574d5={};var _0x2c9f1d={'count':0x0,'rows':[]};return db[_0x43c0('0x3b')][_0x43c0('0x62')]({'where':{'id':_0x527de4['params']['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x177946,null))['then'](function(_0x44d51d){if(_0x44d51d){_0x3574d5[_0x43c0('0x40')]=_[_0x43c0('0x50')](db['CmHopperBlack'][_0x43c0('0x3c')]);_0x3574d5[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x527de4[_0x43c0('0x3e')]);_0x3574d5['filters']=_['intersection'](_0x3574d5['model'],_0x3574d5[_0x43c0('0x3e')]);_0xa9fdd0[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x3574d5[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x527de4['query'][_0x43c0('0x52')]));_0xa9fdd0[_0x43c0('0x41')]=_0xa9fdd0[_0x43c0('0x41')][_0x43c0('0x42')]?_0xa9fdd0[_0x43c0('0x41')]:_0x3574d5[_0x43c0('0x40')];if(!_0x527de4['query'][_0x43c0('0x43')](_0x43c0('0x44'))){_0xa9fdd0[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x527de4[_0x43c0('0x3e')][_0x43c0('0x22')]);_0xa9fdd0[_0x43c0('0x20')]=qs[_0x43c0('0x20')](_0x527de4[_0x43c0('0x3e')][_0x43c0('0x20')]);}_0xa9fdd0[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x527de4['query'][_0x43c0('0x46')]);_0xa9fdd0['where']=qs[_0x43c0('0x3f')](_[_0x43c0('0x63')](_0x527de4[_0x43c0('0x3e')],_0x3574d5[_0x43c0('0x3f')]));_0xa9fdd0[_0x43c0('0x47')]['VoiceQueueId']=_0x44d51d['id'];if(_0x527de4[_0x43c0('0x3e')]['filter']){_0xa9fdd0['where']=_[_0x43c0('0x49')](_0xa9fdd0['where'],{'$or':_[_0x43c0('0x30')](_0xa9fdd0[_0x43c0('0x41')],function(_0x2ece66){var _0x82b9a9={};_0x82b9a9[_0x2ece66]={'$like':'%'+_0x527de4['query'][_0x43c0('0x48')]+'%'};return _0x82b9a9;})});}_0xa9fdd0=_[_0x43c0('0x49')]({},_0xa9fdd0,_0x527de4['options']);return db['CmHopperBlack'][_0x43c0('0x23')]({'where':_0xa9fdd0['where']})['then'](function(_0x5d22ee){_0x2c9f1d[_0x43c0('0x23')]=_0x5d22ee;if(_0x527de4['query'][_0x43c0('0x4b')]){_0xa9fdd0['include']=[{'all':!![]}];}return db[_0x43c0('0x6b')]['findAll'](_0xa9fdd0);})[_0x43c0('0x29')](function(_0x21f7f7){_0x2c9f1d[_0x43c0('0x4d')]=_0x21f7f7;return _0x2c9f1d;});}})[_0x43c0('0x29')](respondWithFilteredResult(_0x177946,_0xa9fdd0))[_0x43c0('0x53')](handleError(_0x177946,null));};exports[_0x43c0('0x6c')]=function(_0x16ffa1,_0x1d3724,_0x1c5021){var _0x8e7c9d={};var _0x33281a={};var _0x270c8d;var _0x111efd;return db['VoiceQueue'][_0x43c0('0x62')]({'where':{'id':_0x16ffa1[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x1d3724,null))[_0x43c0('0x29')](function(_0x2dd1ec){if(_0x2dd1ec){_0x270c8d=_0x2dd1ec;_0x33281a[_0x43c0('0x40')]=_[_0x43c0('0x50')](db[_0x43c0('0x6d')]['rawAttributes']);_0x33281a[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x16ffa1['query']);_0x33281a[_0x43c0('0x3f')]=_[_0x43c0('0x51')](_0x33281a['model'],_0x33281a[_0x43c0('0x3e')]);_0x8e7c9d[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x33281a[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x16ffa1['query'][_0x43c0('0x52')]));_0x8e7c9d[_0x43c0('0x41')]=_0x8e7c9d[_0x43c0('0x41')]['length']?_0x8e7c9d['attributes']:_0x33281a[_0x43c0('0x40')];_0x8e7c9d[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x16ffa1[_0x43c0('0x3e')]['sort']);_0x8e7c9d[_0x43c0('0x47')]=qs[_0x43c0('0x3f')](_['pick'](_0x16ffa1[_0x43c0('0x3e')],_0x33281a[_0x43c0('0x3f')]));if(_0x16ffa1[_0x43c0('0x3e')][_0x43c0('0x48')]){_0x8e7c9d[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x8e7c9d['where'],{'$or':_[_0x43c0('0x30')](_0x8e7c9d[_0x43c0('0x41')],function(_0xdcecc4){var _0x22a942={};_0x22a942[_0xdcecc4]={'$like':'%'+_0x16ffa1['query'][_0x43c0('0x48')]+'%'};return _0x22a942;})});}_0x8e7c9d=_[_0x43c0('0x49')]({},_0x8e7c9d,_0x16ffa1[_0x43c0('0x4a')]);return _0x270c8d[_0x43c0('0x6c')](_0x8e7c9d);}})[_0x43c0('0x29')](function(_0x22e63f){if(_0x22e63f){_0x111efd=_0x22e63f[_0x43c0('0x42')];if(!_0x16ffa1[_0x43c0('0x3e')][_0x43c0('0x43')](_0x43c0('0x44'))){_0x8e7c9d['limit']=qs['limit'](_0x16ffa1[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x8e7c9d[_0x43c0('0x20')]=qs['offset'](_0x16ffa1[_0x43c0('0x3e')]['offset']);}return _0x270c8d[_0x43c0('0x6c')](_0x8e7c9d);}})['then'](function(_0x45fec7){if(_0x45fec7){return _0x45fec7?{'count':_0x111efd,'rows':_0x45fec7}:null;}})['then'](respondWithResult(_0x1d3724,null))[_0x43c0('0x53')](handleError(_0x1d3724,null));};exports[_0x43c0('0x6e')]=function(_0xd440e1,_0xfa4bc8,_0x122417){var _0x34e15d=_0xd440e1[_0x43c0('0x55')][_0x43c0('0x6f')];var _0x47d9c4=_['map'](_0x34e15d,'id');return db['Team'][_0x43c0('0x66')]({'where':{'id':_0x47d9c4},'attributes':['id'],'include':[{'model':db[_0x43c0('0x70')],'as':_0x43c0('0x71'),'attributes':['id',_0x43c0('0x35'),_0x43c0('0x72'),_0x43c0('0x73'),'interface'],'raw':!![]}]})[_0x43c0('0x29')](function(_0x1d2eb2){if(_0x1d2eb2){var _0x269216=_[_0x43c0('0x74')](_0x1d2eb2,function(_0x50f3eb){var _0x1c9ed3=_0x50f3eb[_0x43c0('0x2a')]({'plain':!![]});_0x1c9ed3[_0x43c0('0x71')][_0x43c0('0x75')](function(_0x2c4483){_0x2c4483[_0x43c0('0x76')]=_[_0x43c0('0x33')](_0x34e15d,{'id':_0x1c9ed3['id']})['penalty'];});return _0x1c9ed3[_0x43c0('0x71')];});return db[_0x43c0('0x3b')][_0x43c0('0x33')]({'where':{'id':_0xd440e1['params']['id']}})[_0x43c0('0x29')](function(_0x3ac15e){return db[_0x43c0('0x77')]['transaction'](function(_0x64cc56){return _0x3ac15e[_0x43c0('0x6e')](_0x47d9c4,{'transaction':_0x64cc56})[_0x43c0('0x29')](function(){return BPromise[_0x43c0('0x78')](_0x34e15d,function(_0x9601fb){return db[_0x43c0('0x79')][_0x43c0('0x7a')]({'TeamId':_0x9601fb['id'],'VoiceQueueId':_0xd440e1[_0x43c0('0x4f')]['id'],'penalty':_0x9601fb['penalty']},{'transaction':_0x64cc56});});})['then'](function(){return BPromise['each'](_0x269216,function(_0x5747ef){return db[_0x43c0('0x7b')][_0x43c0('0x7c')]({'where':{'UserId':_0x5747ef['id'],'VoiceQueueId':_0xd440e1[_0x43c0('0x4f')]['id']},'defaults':{'penalty':_0x5747ef['penalty']},'transaction':_0x64cc56});});})['then'](function(){return BPromise['each'](_[_0x43c0('0x48')](_0x269216,{'online':!![]}),function(_0x1bf3c6){return db[_0x43c0('0x7d')]['upsert']({'membername':_0x1bf3c6[_0x43c0('0x35')],'UserId':_0x1bf3c6['id'],'queue_name':_0x3ac15e[_0x43c0('0x35')],'VoiceQueueId':_0x3ac15e['id'],'interface':_['isNil'](_0x1bf3c6[_0x43c0('0x7e')])?util[_0x43c0('0x7f')](_0x43c0('0x80'),_0x1bf3c6[_0x43c0('0x35')]):_0x1bf3c6[_0x43c0('0x7e')],'paused':_0x1bf3c6[_0x43c0('0x73')]||![],'penalty':_0x1bf3c6[_0x43c0('0x76')]},{'transaction':_0x64cc56});});})[_0x43c0('0x29')](function(){_0x269216[_0x43c0('0x75')](function(_0x1ec9ff){socket[_0x43c0('0x81')](_0x43c0('0x82'),{'UserId':_0x1ec9ff['id'],'VoiceQueueId':_0x3ac15e['id']});});});});});}})[_0x43c0('0x29')](respondWithStatusCode(_0xfa4bc8,null))[_0x43c0('0x53')](handleError(_0xfa4bc8,null));};exports[_0x43c0('0x83')]=function(_0x2335f1,_0x4b343c,_0x4c5efa){return db[_0x43c0('0x6d')][_0x43c0('0x66')]({'where':{'id':_0x2335f1[_0x43c0('0x3e')][_0x43c0('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x43c0('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b343c,null))[_0x43c0('0x29')](function(_0x407b5c){var _0x102c22=_['map'](_0x407b5c,'id');var _0x23cce6=[];var _0x505040=[];var _0xd71226=squel[_0x43c0('0x85')]();_0xd71226[_0x43c0('0x86')](_0x43c0('0x87'))['from'](_0x43c0('0x88'),'tq')['join'](_0x43c0('0x89'),'ut',_0x43c0('0x8a'))['where'](_0x43c0('0x8b'),_0x2335f1['params']['id']);for(var _0x4f9ee0=0x0;_0x4f9ee0<_0x407b5c['length'];_0x4f9ee0+=0x1){let _0x4128f3=_0x407b5c[_0x4f9ee0];for(var _0x579a49=0x0;_0x579a49<_0x4128f3['Agents'][_0x43c0('0x42')];_0x579a49+=0x1){let _0x378131=_0x4128f3[_0x43c0('0x71')][_0x579a49];var _0x28995d=_0xd71226[_0x43c0('0x5b')]();_0x28995d[_0x43c0('0x47')](_0x43c0('0x8c'),_0x378131['id']);_0x505040['push'](db['sequelize'][_0x43c0('0x3e')](_0x28995d[_0x43c0('0x8d')](),{'type':db[_0x43c0('0x77')][_0x43c0('0x8e')]['SELECT']})[_0x43c0('0x29')](function(_0x452bed){if(_0x452bed[_0x43c0('0x42')]===0x1){return _0x378131['id'];}else{var _0xddcffe=_[_0x43c0('0x8f')](_['map'](_0x452bed,'TeamId'),function(_0x37e446){return _[_0x43c0('0x32')](_0x102c22,_0x37e446);});if(_0xddcffe){return _0x378131['id'];}}}));}}return BPromise[_0x43c0('0x90')](_0x505040)['then'](function(_0x988c3a){_0x23cce6=_(_0x23cce6)[_0x43c0('0x91')](_0x988c3a)['compact']()[_0x43c0('0x31')]();return db[_0x43c0('0x3b')][_0x43c0('0x33')]({'where':{'id':_0x2335f1[_0x43c0('0x4f')]['id']}})['then'](function(_0x4a5286){return db[_0x43c0('0x77')][_0x43c0('0x92')](function(_0x313598){return _0x4a5286[_0x43c0('0x83')](_0x2335f1[_0x43c0('0x3e')][_0x43c0('0x84')],{'transaction':_0x313598})[_0x43c0('0x29')](function(){if(!_[_0x43c0('0x93')](_0x23cce6)){return _0x4a5286['removeAgents'](_0x23cce6,{'transaction':_0x313598})[_0x43c0('0x29')](function(){return db['UserVoiceQueueRt'][_0x43c0('0x36')]({'where':{'VoiceQueueId':_0x2335f1[_0x43c0('0x4f')]['id'],'UserId':_0x23cce6},'transaction':_0x313598});});}})[_0x43c0('0x29')](function(){_0x23cce6[_0x43c0('0x75')](function(_0x3a6c83){socket[_0x43c0('0x81')](_0x43c0('0x94'),{'UserId':_0x3a6c83,'VoiceQueueId':_0x4a5286['id']});});});});});});})[_0x43c0('0x29')](respondWithStatusCode(_0x4b343c,null))[_0x43c0('0x53')](handleError(_0x4b343c,null));};exports[_0x43c0('0x95')]=function(_0x3356d0,_0x243a07,_0x2c27f9){var _0x3e9881,_0x15d560;return db['VoiceQueue'][_0x43c0('0x33')]({'where':{'id':_0x3356d0[_0x43c0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x243a07,null))['then'](function(_0x301df2){if(_0x301df2){_0x15d560=_0x301df2;return _0x301df2[_0x43c0('0x95')](_0x3356d0['body'][_0x43c0('0x84')],_[_0x43c0('0x5c')](_0x3356d0['body'],['ids','id'])||{})[_0x43c0('0x96')](function(_0x45603c){for(var _0x39ea48=0x0;_0x39ea48<_0x3356d0['body'][_0x43c0('0x84')][_0x43c0('0x42')];_0x39ea48+=0x1){socket[_0x43c0('0x81')](_0x43c0('0x82'),{'UserId':Number(_0x3356d0['body']['ids'][_0x39ea48]),'VoiceQueueId':Number(_0x3356d0['params']['id'])});}return _0x45603c;});}})[_0x43c0('0x29')](function(_0x5b969a){_0x3e9881=_0x5b969a||[];if(_0x15d560){return db[_0x43c0('0x70')][_0x43c0('0x66')]({'where':{'id':_0x3356d0[_0x43c0('0x55')][_0x43c0('0x84')]},'attributes':['id',_0x43c0('0x35'),'online','voicePause',_0x43c0('0x7e')],'raw':!![]});}})[_0x43c0('0x29')](function(_0x3a623a){if(!_['isEmpty'](_0x3a623a)){var _0x4d7e3c=[];for(var _0x4c51a0=0x0;_0x4c51a0<_0x3a623a['length'];_0x4c51a0++){if(_0x3a623a[_0x4c51a0]['online']){_0x4d7e3c[_0x43c0('0x97')](db[_0x43c0('0x7d')][_0x43c0('0x7a')]({'membername':_0x3a623a[_0x4c51a0][_0x43c0('0x35')],'UserId':_0x3a623a[_0x4c51a0]['id'],'queue_name':_0x15d560[_0x43c0('0x35')],'VoiceQueueId':_0x15d560['id'],'interface':_['isNil'](_0x3a623a[_0x4c51a0][_0x43c0('0x7e')])?util['format'](_0x43c0('0x80'),_0x3a623a[_0x4c51a0][_0x43c0('0x35')]):_0x3a623a[_0x4c51a0][_0x43c0('0x7e')],'paused':_0x3a623a[_0x4c51a0][_0x43c0('0x73')]||![],'penalty':_0x3356d0[_0x43c0('0x55')][_0x43c0('0x76')]||0x0}));}}return BPromise[_0x43c0('0x90')](_0x4d7e3c);}})['then'](function(){return _0x3e9881;})[_0x43c0('0x29')](respondWithResult(_0x243a07,null))[_0x43c0('0x53')](handleError(_0x243a07,null));};exports[_0x43c0('0x98')]=function(_0x35d4d5,_0x3299ae,_0x1a5a5d){return db[_0x43c0('0x3b')]['find']({'where':{'id':_0x35d4d5[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x3299ae,null))['then'](function(_0x959ba9){if(_0x959ba9){return _0x959ba9[_0x43c0('0x98')](_0x35d4d5['query'][_0x43c0('0x84')])[_0x43c0('0x29')](function(){if(_[_0x43c0('0x99')](_0x35d4d5[_0x43c0('0x3e')][_0x43c0('0x84')])){for(var _0x24ef3a=0x0;_0x24ef3a<_0x35d4d5[_0x43c0('0x3e')]['ids'][_0x43c0('0x42')];_0x24ef3a+=0x1){socket[_0x43c0('0x81')](_0x43c0('0x94'),{'UserId':Number(_0x35d4d5[_0x43c0('0x3e')][_0x43c0('0x84')][_0x24ef3a]),'VoiceQueueId':Number(_0x35d4d5[_0x43c0('0x4f')]['id'])});}}else{socket[_0x43c0('0x81')](_0x43c0('0x94'),{'UserId':Number(_0x35d4d5['query'][_0x43c0('0x84')]),'VoiceQueueId':Number(_0x35d4d5[_0x43c0('0x4f')]['id'])});}});}})[_0x43c0('0x29')](function(_0x19c21e){return db['UserVoiceQueueRt'][_0x43c0('0x36')]({'where':{'VoiceQueueId':_0x35d4d5[_0x43c0('0x4f')]['id'],'UserId':_0x35d4d5['query'][_0x43c0('0x84')]}})[_0x43c0('0x29')](function(){return _0x19c21e;});})[_0x43c0('0x29')](respondWithStatusCode(_0x3299ae,null))[_0x43c0('0x53')](handleError(_0x3299ae,null));};exports[_0x43c0('0x9a')]=function(_0x45498c,_0x5e6818,_0x2be46b){var _0x4a40c4={};var _0x5cff37={};var _0x27e8b5;var _0x558fdd;return db[_0x43c0('0x3b')]['findOne']({'where':{'id':_0x45498c[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x5e6818,null))[_0x43c0('0x29')](function(_0x525887){if(_0x525887){_0x27e8b5=_0x525887;_0x5cff37['model']=_[_0x43c0('0x50')](db[_0x43c0('0x70')]['rawAttributes']);_0x5cff37[_0x43c0('0x3e')]=_['keys'](_0x45498c['query']);_0x5cff37['filters']=_[_0x43c0('0x51')](_0x5cff37[_0x43c0('0x40')],_0x5cff37[_0x43c0('0x3e')]);_0x4a40c4[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x5cff37[_0x43c0('0x40')],qs['fields'](_0x45498c[_0x43c0('0x3e')]['fields']));_0x4a40c4[_0x43c0('0x41')]=_0x4a40c4['attributes']['length']?_0x4a40c4['attributes']:_0x5cff37[_0x43c0('0x40')];_0x4a40c4[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x45498c['query'][_0x43c0('0x46')]);_0x4a40c4[_0x43c0('0x47')]=qs[_0x43c0('0x3f')](_[_0x43c0('0x63')](_0x45498c[_0x43c0('0x3e')],_0x5cff37['filters']));if(_0x45498c['query'][_0x43c0('0x48')]){_0x4a40c4[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x4a40c4[_0x43c0('0x47')],{'$or':_[_0x43c0('0x30')](_0x4a40c4[_0x43c0('0x41')],function(_0x2ba202){var _0x2dc169={};_0x2dc169[_0x2ba202]={'$like':'%'+_0x45498c['query'][_0x43c0('0x48')]+'%'};return _0x2dc169;})});}_0x4a40c4=_[_0x43c0('0x49')]({},_0x4a40c4,_0x45498c[_0x43c0('0x4a')]);return _0x27e8b5['getAgents'](_0x4a40c4);}})[_0x43c0('0x29')](function(_0x402ef9){if(_0x402ef9){_0x558fdd=_0x402ef9[_0x43c0('0x42')];if(!_0x45498c['query']['hasOwnProperty']('nolimit')){_0x4a40c4['limit']=qs['limit'](_0x45498c[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x4a40c4[_0x43c0('0x20')]=qs[_0x43c0('0x20')](_0x45498c[_0x43c0('0x3e')][_0x43c0('0x20')]);}return _0x27e8b5[_0x43c0('0x9a')](_0x4a40c4);}})[_0x43c0('0x29')](function(_0x2539b0){if(_0x2539b0){return _0x2539b0?{'count':_0x558fdd,'rows':_0x2539b0}:null;}})['then'](respondWithResult(_0x5e6818,null))[_0x43c0('0x53')](handleError(_0x5e6818,null));};exports[_0x43c0('0x9b')]=function(_0x31496e,_0x5696a4,_0x496b6b){var _0xc36587={};var _0x3b7b57={};var _0x38af63;var _0x5714fe;return db[_0x43c0('0x3b')][_0x43c0('0x62')]({'where':{'id':_0x31496e[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x5696a4,null))[_0x43c0('0x29')](function(_0x4c2037){if(_0x4c2037){_0x38af63=_0x4c2037;_0x3b7b57[_0x43c0('0x40')]=_[_0x43c0('0x50')](db[_0x43c0('0x7d')][_0x43c0('0x3c')]);_0x3b7b57[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x31496e[_0x43c0('0x3e')]);_0x3b7b57[_0x43c0('0x3f')]=_[_0x43c0('0x51')](_0x3b7b57[_0x43c0('0x40')],_0x3b7b57[_0x43c0('0x3e')]);_0xc36587[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x3b7b57['model'],qs[_0x43c0('0x52')](_0x31496e[_0x43c0('0x3e')][_0x43c0('0x52')]));_0xc36587['attributes']=_0xc36587[_0x43c0('0x41')][_0x43c0('0x42')]?_0xc36587[_0x43c0('0x41')]:_0x3b7b57[_0x43c0('0x40')];_0xc36587[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x31496e[_0x43c0('0x3e')]['sort']);_0xc36587['where']=qs['filters'](_[_0x43c0('0x63')](_0x31496e['query'],_0x3b7b57['filters']));if(_0x31496e[_0x43c0('0x3e')][_0x43c0('0x48')]){_0xc36587[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0xc36587[_0x43c0('0x47')],{'$or':_[_0x43c0('0x30')](_0xc36587['attributes'],function(_0x3f16b0){var _0xcd781e={};_0xcd781e[_0x3f16b0]={'$like':'%'+_0x31496e['query'][_0x43c0('0x48')]+'%'};return _0xcd781e;})});}_0xc36587=_['merge']({},_0xc36587,_0x31496e[_0x43c0('0x4a')]);return _0x38af63[_0x43c0('0x9b')](_0xc36587);}})['then'](function(_0x4166bc){if(_0x4166bc){_0x5714fe=_0x4166bc[_0x43c0('0x42')];if(!_0x31496e[_0x43c0('0x3e')][_0x43c0('0x43')](_0x43c0('0x44'))){_0xc36587[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x31496e['query']['limit']);_0xc36587[_0x43c0('0x20')]=qs[_0x43c0('0x20')](_0x31496e[_0x43c0('0x3e')][_0x43c0('0x20')]);}return _0x38af63['getMembers'](_0xc36587);}})[_0x43c0('0x29')](function(_0x1c15ca){return _0x1c15ca?{'count':_0x5714fe,'rows':_0x1c15ca}:null;})[_0x43c0('0x29')](respondWithResult(_0x5696a4,null))['catch'](handleError(_0x5696a4,null));};exports['getLists']=function(_0x21dbbe,_0x1c8c08,_0x4e4345){var _0xcd5a0f={};var _0xfa116={};var _0x52640c;var _0x52264a;return db[_0x43c0('0x3b')]['findOne']({'where':{'id':_0x21dbbe[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x1c8c08,null))[_0x43c0('0x29')](function(_0x350368){if(_0x350368){_0x52640c=_0x350368;_0xfa116[_0x43c0('0x40')]=_['keys'](db[_0x43c0('0x9c')][_0x43c0('0x3c')]);_0xfa116[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x21dbbe[_0x43c0('0x3e')]);_0xfa116[_0x43c0('0x3f')]=_[_0x43c0('0x51')](_0xfa116['model'],_0xfa116[_0x43c0('0x3e')]);_0xcd5a0f['attributes']=_[_0x43c0('0x51')](_0xfa116[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x21dbbe['query']['fields']));_0xcd5a0f[_0x43c0('0x41')]=_0xcd5a0f['attributes']['length']?_0xcd5a0f[_0x43c0('0x41')]:_0xfa116[_0x43c0('0x40')];_0xcd5a0f[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x21dbbe[_0x43c0('0x3e')]['sort']);_0xcd5a0f[_0x43c0('0x47')]=qs['filters'](_['pick'](_0x21dbbe[_0x43c0('0x3e')],_0xfa116[_0x43c0('0x3f')]));if(_0x21dbbe[_0x43c0('0x3e')][_0x43c0('0x48')]){_0xcd5a0f[_0x43c0('0x47')]=_['merge'](_0xcd5a0f[_0x43c0('0x47')],{'$or':_['map'](_0xcd5a0f['attributes'],function(_0x1baf17){var _0x53ac7f={};_0x53ac7f[_0x1baf17]={'$like':'%'+_0x21dbbe['query'][_0x43c0('0x48')]+'%'};return _0x53ac7f;})});}_0xcd5a0f=_['merge']({},_0xcd5a0f,_0x21dbbe[_0x43c0('0x4a')]);return _0x52640c['getLists'](_0xcd5a0f);}})[_0x43c0('0x29')](function(_0x1feeee){if(_0x1feeee){_0x52264a=_0x1feeee[_0x43c0('0x42')];if(!_0x21dbbe[_0x43c0('0x3e')]['hasOwnProperty'](_0x43c0('0x44'))){_0xcd5a0f[_0x43c0('0x22')]=qs[_0x43c0('0x22')](_0x21dbbe[_0x43c0('0x3e')][_0x43c0('0x22')]);_0xcd5a0f[_0x43c0('0x20')]=qs['offset'](_0x21dbbe[_0x43c0('0x3e')][_0x43c0('0x20')]);}return _0x52640c[_0x43c0('0x9d')](_0xcd5a0f);}})['then'](function(_0x558146){if(_0x558146){return _0x558146?{'count':_0x52264a,'rows':_0x558146}:null;}})[_0x43c0('0x29')](respondWithResult(_0x1c8c08,null))[_0x43c0('0x53')](handleError(_0x1c8c08,null));};exports[_0x43c0('0x9e')]=function(_0x19704d,_0x3e036f,_0x35fcb4){var _0x50cd47,_0x3ab243;return db['VoiceQueue'][_0x43c0('0x33')]({'where':{'id':_0x19704d[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x3e036f,null))[_0x43c0('0x29')](function(_0x4461e3){if(_0x4461e3){_0x3ab243=_0x4461e3;return _0x4461e3[_0x43c0('0x9e')](_0x19704d[_0x43c0('0x55')][_0x43c0('0x84')],_['omit'](_0x19704d[_0x43c0('0x55')],[_0x43c0('0x84'),'id'])||{});}return null;})['spread'](function(_0x932b94){var _0x1f74ad;_0x50cd47=_0x932b94||[];var _0x2af96b=[];if(_0x932b94){for(var _0x496a47=0x0;_0x496a47<_0x932b94['length'];_0x496a47+=0x1){var _0x37be1e=_0x932b94[_0x496a47][_0x43c0('0x2a')]({'plain':!![]});_0x3ab243[_0x43c0('0x9f')]=_0x19704d[_0x43c0('0x55')][_0x43c0('0x9f')]?_0x19704d['body'][_0x43c0('0x9f')]:_0x3ab243[_0x43c0('0x9f')];switch(_0x3ab243[_0x43c0('0x9f')]){case'always':_0x1f74ad=squel['insert']()[_0x43c0('0xa0')]('cm_hopper')['fromQuery'](['phone',_0x43c0('0xa1'),_0x43c0('0xa2'),_0x43c0('0xa3'),_0x43c0('0x64'),_0x43c0('0x5d'),_0x43c0('0x5e')],squel[_0x43c0('0x85')]()[_0x43c0('0x86')](_0x43c0('0xa4'),'phone')[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0xa1'))[_0x43c0('0x86')]('id',_0x43c0('0xa2'))[_0x43c0('0x86')](_0x37be1e['CmListId']['toString'](),_0x43c0('0xa3'))[_0x43c0('0x86')](_0x19704d['params']['id'][_0x43c0('0x8d')](),_0x43c0('0x64'))['field'](_0x43c0('0xa5'),_0x43c0('0x5d'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0x5e'))[_0x43c0('0xa6')](_0x43c0('0xa7'))[_0x43c0('0x47')](_0x43c0('0xa8'))[_0x43c0('0x47')]('ListId\x20=\x20?',_0x37be1e[_0x43c0('0xa9')][_0x43c0('0x8d')]())[_0x43c0('0x47')](_0x43c0('0xaa'))[_0x43c0('0x47')](_0x43c0('0xab'),squel[_0x43c0('0x85')]()['field'](_0x43c0('0xac'))[_0x43c0('0xa6')](_0x43c0('0xad'))[_0x43c0('0x47')]('VoiceQueueId\x20=\x20?',_0x19704d[_0x43c0('0x4f')]['id'][_0x43c0('0x8d')]()))[_0x43c0('0x47')](_0x43c0('0xab'),squel[_0x43c0('0x85')]()[_0x43c0('0x86')](_0x43c0('0xae'))[_0x43c0('0xa6')](_0x43c0('0xaf'))[_0x43c0('0x47')](_0x43c0('0x8b'),_0x19704d['params']['id'][_0x43c0('0x8d')]())))[_0x43c0('0x8d')]();break;case'onlyIfOpen':_0x1f74ad=squel[_0x43c0('0xb0')]()['into']('cm_hopper')[_0x43c0('0xb1')]([_0x43c0('0xa4'),'scheduledAt',_0x43c0('0xa2'),_0x43c0('0xa3'),_0x43c0('0x64'),_0x43c0('0x5d'),_0x43c0('0x5e')],squel['select']()[_0x43c0('0x86')](_0x43c0('0xa4'),_0x43c0('0xa4'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0xa1'))[_0x43c0('0x86')]('id','ContactId')[_0x43c0('0x86')](_0x37be1e[_0x43c0('0xa9')][_0x43c0('0x8d')](),_0x43c0('0xa3'))[_0x43c0('0x86')](_0x19704d[_0x43c0('0x4f')]['id']['toString'](),'VoiceQueueId')[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0x5d'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0x5e'))[_0x43c0('0xa6')](_0x43c0('0xa7'))[_0x43c0('0x47')](_0x43c0('0xa8'))[_0x43c0('0x47')](_0x43c0('0xb2'),_0x37be1e['CmListId'][_0x43c0('0x8d')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x43c0('0xab'),squel[_0x43c0('0x85')]()['field']('COALESCE(phone,\x27\x27)')[_0x43c0('0xa6')](_0x43c0('0xaf'))[_0x43c0('0x47')](_0x43c0('0x8b'),_0x19704d[_0x43c0('0x4f')]['id'][_0x43c0('0x8d')]())))['toString']();break;default:_0x1f74ad=squel[_0x43c0('0xb0')]()[_0x43c0('0xa0')](_0x43c0('0xaf'))[_0x43c0('0xb1')]([_0x43c0('0xa4'),_0x43c0('0xa1'),_0x43c0('0xa2'),'ListId',_0x43c0('0x64'),'createdAt','updatedAt'],squel[_0x43c0('0x85')]()['field'](_0x43c0('0xa4'),_0x43c0('0xa4'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0xa1'))[_0x43c0('0x86')]('id',_0x43c0('0xa2'))[_0x43c0('0x86')](_0x37be1e[_0x43c0('0xa9')][_0x43c0('0x8d')](),_0x43c0('0xa3'))[_0x43c0('0x86')](_0x19704d[_0x43c0('0x4f')]['id'][_0x43c0('0x8d')](),_0x43c0('0x64'))['field'](_0x43c0('0xa5'),_0x43c0('0x5d'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0x5e'))[_0x43c0('0xa6')]('cm_contacts')[_0x43c0('0x47')](_0x43c0('0xa8'))[_0x43c0('0x47')](_0x43c0('0xb2'),_0x37be1e[_0x43c0('0xa9')]['toString']())[_0x43c0('0x47')](_0x43c0('0xaa')))['toString']();}_0x2af96b['push'](db[_0x43c0('0x77')][_0x43c0('0x3e')](_0x1f74ad));}return BPromise['all'](_0x2af96b);}})[_0x43c0('0x29')](function(){return _0x50cd47;})[_0x43c0('0x29')](respondWithResult(_0x3e036f,null))[_0x43c0('0x53')](handleError(_0x3e036f,null));};exports[_0x43c0('0xb3')]=function(_0x10ba1e,_0x2326a8,_0x47c8a0){return db[_0x43c0('0x3b')][_0x43c0('0x33')]({'where':{'id':_0x10ba1e['params']['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x2326a8,null))[_0x43c0('0x29')](function(_0x4c9ce6){if(_0x4c9ce6){return _0x4c9ce6['removeLists'](_0x10ba1e['query'][_0x43c0('0x84')]);}})[_0x43c0('0x29')](function(_0x104b12){if(_0x104b12){return db[_0x43c0('0x65')][_0x43c0('0x36')]({'where':{'ListId':_0x10ba1e['query'][_0x43c0('0x84')],'VoiceQueueId':_0x10ba1e['params']['id']}})['then'](function(){return _0x104b12;});}})[_0x43c0('0x29')](respondWithStatusCode(_0x2326a8,null))['catch'](handleError(_0x2326a8,null));};exports[_0x43c0('0xb4')]=function(_0x3f7ad2,_0x1383a7,_0x89b73){var _0x224af0={};var _0x5090e2={};var _0xfd625e;var _0x4b45e9;return db[_0x43c0('0x3b')][_0x43c0('0x62')]({'where':{'id':_0x3f7ad2[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x1383a7,null))[_0x43c0('0x29')](function(_0xb36012){if(_0xb36012){_0xfd625e=_0xb36012;_0x5090e2[_0x43c0('0x40')]=_[_0x43c0('0x50')](db['CmList']['rawAttributes']);_0x5090e2[_0x43c0('0x3e')]=_[_0x43c0('0x50')](_0x3f7ad2[_0x43c0('0x3e')]);_0x5090e2['filters']=_[_0x43c0('0x51')](_0x5090e2[_0x43c0('0x40')],_0x5090e2['query']);_0x224af0[_0x43c0('0x41')]=_[_0x43c0('0x51')](_0x5090e2[_0x43c0('0x40')],qs[_0x43c0('0x52')](_0x3f7ad2[_0x43c0('0x3e')][_0x43c0('0x52')]));_0x224af0[_0x43c0('0x41')]=_0x224af0[_0x43c0('0x41')][_0x43c0('0x42')]?_0x224af0['attributes']:_0x5090e2[_0x43c0('0x40')];_0x224af0[_0x43c0('0x45')]=qs[_0x43c0('0x46')](_0x3f7ad2[_0x43c0('0x3e')][_0x43c0('0x46')]);_0x224af0['where']=qs['filters'](_['pick'](_0x3f7ad2[_0x43c0('0x3e')],_0x5090e2['filters']));if(_0x3f7ad2['query'][_0x43c0('0x48')]){_0x224af0[_0x43c0('0x47')]=_[_0x43c0('0x49')](_0x224af0[_0x43c0('0x47')],{'$or':_[_0x43c0('0x30')](_0x224af0['attributes'],function(_0x22e549){var _0x520e49={};_0x520e49[_0x22e549]={'$like':'%'+_0x3f7ad2[_0x43c0('0x3e')][_0x43c0('0x48')]+'%'};return _0x520e49;})});}_0x224af0=_[_0x43c0('0x49')]({},_0x224af0,_0x3f7ad2[_0x43c0('0x4a')]);return _0xfd625e['getBlackLists'](_0x224af0);}})['then'](function(_0xb8561a){if(_0xb8561a){_0x4b45e9=_0xb8561a[_0x43c0('0x42')];if(!_0x3f7ad2['query']['hasOwnProperty'](_0x43c0('0x44'))){_0x224af0['limit']=qs[_0x43c0('0x22')](_0x3f7ad2[_0x43c0('0x3e')][_0x43c0('0x22')]);_0x224af0[_0x43c0('0x20')]=qs['offset'](_0x3f7ad2[_0x43c0('0x3e')][_0x43c0('0x20')]);}return _0xfd625e['getBlackLists'](_0x224af0);}})[_0x43c0('0x29')](function(_0x5d241e){if(_0x5d241e){return _0x5d241e?{'count':_0x4b45e9,'rows':_0x5d241e}:null;}})['then'](respondWithResult(_0x1383a7,null))[_0x43c0('0x53')](handleError(_0x1383a7,null));};exports[_0x43c0('0xb5')]=function(_0x14fe4f,_0x2223b0,_0x32602e){var _0x5e99cc,_0x2eba0e;return db[_0x43c0('0x3b')]['find']({'where':{'id':_0x14fe4f['params']['id']}})['then'](handleEntityNotFound(_0x2223b0,null))[_0x43c0('0x29')](function(_0x59ed56){if(_0x59ed56){_0x2eba0e=_0x59ed56;return _0x59ed56[_0x43c0('0xb5')](_0x14fe4f['body'][_0x43c0('0x84')],_[_0x43c0('0x5c')](_0x14fe4f[_0x43c0('0x55')],['ids','id'])||{});}return null;})['spread'](function(_0x7262a0){var _0x217518;_0x5e99cc=_0x7262a0||[];var _0x356d9d=[];if(_0x7262a0){for(var _0x1047eb=0x0;_0x1047eb<_0x7262a0[_0x43c0('0x42')];_0x1047eb+=0x1){var _0x3844a8=_0x7262a0[_0x1047eb][_0x43c0('0x2a')]({'plain':!![]});_0x217518=squel[_0x43c0('0xb0')]()[_0x43c0('0xa0')](_0x43c0('0xb6'))['fromQuery']([_0x43c0('0xa4'),'ContactId','ListId',_0x43c0('0x64'),_0x43c0('0x5d'),'updatedAt'],squel[_0x43c0('0x85')]()['field'](_0x43c0('0xa4'),'phone')['field']('id',_0x43c0('0xa2'))[_0x43c0('0x86')](_0x3844a8[_0x43c0('0xa9')]['toString'](),_0x43c0('0xa3'))['field'](_0x14fe4f['params']['id'][_0x43c0('0x8d')](),_0x43c0('0x64'))[_0x43c0('0x86')](_0x43c0('0xa5'),_0x43c0('0x5d'))['field'](_0x43c0('0xa5'),'updatedAt')[_0x43c0('0xa6')](_0x43c0('0xa7'))[_0x43c0('0x47')](_0x43c0('0xa8'))[_0x43c0('0x47')]('ListId\x20=\x20?',_0x3844a8[_0x43c0('0xa9')][_0x43c0('0x8d')]())[_0x43c0('0x47')](_0x43c0('0xaa')))[_0x43c0('0x8d')]();_0x356d9d['push'](db[_0x43c0('0x77')][_0x43c0('0x3e')](_0x217518));}return BPromise['all'](_0x356d9d);}})[_0x43c0('0x29')](function(){return _0x5e99cc;})[_0x43c0('0x29')](respondWithResult(_0x2223b0,null))['catch'](handleError(_0x2223b0,null));};exports[_0x43c0('0xb7')]=function(_0x73f336,_0x53e398,_0x67a8c3){return db[_0x43c0('0x3b')][_0x43c0('0x33')]({'where':{'id':_0x73f336[_0x43c0('0x4f')]['id']}})[_0x43c0('0x29')](handleEntityNotFound(_0x53e398,null))[_0x43c0('0x29')](function(_0x23d509){if(_0x23d509){return _0x23d509[_0x43c0('0xb7')](_0x73f336[_0x43c0('0x3e')][_0x43c0('0x84')]);}})['then'](function(_0xaec06c){if(_0xaec06c){return db[_0x43c0('0x6b')]['destroy']({'where':{'ListId':_0x73f336['query'][_0x43c0('0x84')],'VoiceQueueId':_0x73f336[_0x43c0('0x4f')]['id']}})['then'](function(){return _0xaec06c;});}})['then'](respondWithStatusCode(_0x53e398,null))[_0x43c0('0x53')](handleError(_0x53e398,null));}; \ No newline at end of file +var _0xaeb9=['each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','all','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','interface','push','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','then','end','error','stack','send','index','rawAttributes','key','model','filters','attributes','fields','length','nolimit','query','order','sort','where','pick','merge','options','VoiceQueue','include','rows','catch','show','params','keys','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','createdAt','updatedAt','omit','autoAssociation','update','getHoppers','CmHopper','hasOwnProperty','findAll','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','VoiceQueueId','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','forEach','penalty','TeamVoiceQueue','UserVoiceQueue','findOrCreate'];(function(_0x33cfc5,_0x53ed7a){var _0x1fdef6=function(_0x1ca1a8){while(--_0x1ca1a8){_0x33cfc5['push'](_0x33cfc5['shift']());}};_0x1fdef6(++_0x53ed7a);}(_0xaeb9,0x1b6));var _0x9aeb=function(_0x12effe,_0xb5f345){_0x12effe=_0x12effe-0x0;var _0x2ff9df=_0xaeb9[_0x12effe];return _0x2ff9df;};'use strict';var emlformat=require(_0x9aeb('0x0'));var rimraf=require(_0x9aeb('0x1'));var zipdir=require(_0x9aeb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9aeb('0x3'));var moment=require(_0x9aeb('0x4'));var BPromise=require(_0x9aeb('0x5'));var Mustache=require(_0x9aeb('0x6'));var util=require(_0x9aeb('0x7'));var path=require('path');var sox=require(_0x9aeb('0x8'));var csv=require(_0x9aeb('0x9'));var ejs=require(_0x9aeb('0xa'));var fs=require('fs');var fs_extra=require(_0x9aeb('0xb'));var _=require(_0x9aeb('0xc'));var squel=require(_0x9aeb('0xd'));var crypto=require(_0x9aeb('0xe'));var jsforce=require(_0x9aeb('0xf'));var deskjs=require(_0x9aeb('0x10'));var toCsv=require(_0x9aeb('0x9'));var querystring=require(_0x9aeb('0x11'));var Papa=require('papaparse');var Redis=require(_0x9aeb('0x12'));var authService=require(_0x9aeb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9aeb('0x14'));var hardwareService=require(_0x9aeb('0x15'));var logger=require(_0x9aeb('0x16'))(_0x9aeb('0x17'));var utils=require(_0x9aeb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9aeb('0x19'));var db=require('../../mysqldb')['db'];config[_0x9aeb('0x1a')]=_[_0x9aeb('0x1b')](config[_0x9aeb('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9aeb('0x1c'))(new Redis(config[_0x9aeb('0x1a')]));require('./voiceQueue.socket')[_0x9aeb('0x1d')](socket);function respondWithStatusCode(_0x52254a,_0x3a966d){_0x3a966d=_0x3a966d||0xcc;return function(_0x40b37e){if(_0x40b37e){return _0x52254a[_0x9aeb('0x1e')](_0x3a966d);}return _0x52254a[_0x9aeb('0x1f')](_0x3a966d)['end']();};}function respondWithResult(_0x5d6c00,_0x3e3991){_0x3e3991=_0x3e3991||0xc8;return function(_0x46390a){if(_0x46390a){return _0x5d6c00[_0x9aeb('0x1f')](_0x3e3991)[_0x9aeb('0x20')](_0x46390a);}};}function respondWithFilteredResult(_0x442db6,_0x511630){return function(_0x47cef1){if(_0x47cef1){var _0x56ac96=typeof _0x511630[_0x9aeb('0x21')]===_0x9aeb('0x22')&&typeof _0x511630[_0x9aeb('0x23')]===_0x9aeb('0x22');var _0x4fb9ff=_0x47cef1[_0x9aeb('0x24')];var _0x4741f1=_0x56ac96?0x0:_0x511630['offset'];var _0x4c26a9=_0x56ac96?_0x47cef1[_0x9aeb('0x24')]:_0x511630['offset']+_0x511630[_0x9aeb('0x23')];var _0x5539d2;if(_0x4c26a9>=_0x4fb9ff){_0x4c26a9=_0x4fb9ff;_0x5539d2=0xc8;}else{_0x5539d2=0xce;}_0x442db6[_0x9aeb('0x1f')](_0x5539d2);return _0x442db6[_0x9aeb('0x25')](_0x9aeb('0x26'),_0x4741f1+'-'+_0x4c26a9+'/'+_0x4fb9ff)[_0x9aeb('0x20')](_0x47cef1);}return null;};}function patchUpdates(_0x1e695d){return function(_0x5aee96){try{jsonpatch[_0x9aeb('0x27')](_0x5aee96,_0x1e695d,!![]);}catch(_0x54a0b0){return BPromise[_0x9aeb('0x28')](_0x54a0b0);}return _0x5aee96[_0x9aeb('0x29')]();};}function saveUpdates(_0x295951,_0xb0dcfa){return function(_0x119ed4){if(_0x119ed4){return _0x119ed4['update'](_0x295951)['then'](function(_0x299c05){return _0x299c05;});}return null;};}function removeEntity(_0x558029,_0x3316d8){return function(_0x45f4e3){if(_0x45f4e3){return _0x45f4e3[_0x9aeb('0x2a')]()['then'](function(){var _0x4b1407=_0x45f4e3[_0x9aeb('0x2b')]({'plain':!![]});var _0xcfed89=[{'name':_0x9aeb('0x2c'),'value':'inbound','ignore':![]},{'name':_0x9aeb('0x2d'),'value':_0x9aeb('0x2e'),'ignore':![]}];var _0x23a5fb=_(_0xcfed89)[_0x9aeb('0x2f')](_0x9aeb('0x30'))[_0x9aeb('0x31')](_0x9aeb('0x32'))['value']();if(_[_0x9aeb('0x33')](_0x23a5fb,_0x4b1407[_0x9aeb('0x34')])){return;}var _0x38e502=_[_0x9aeb('0x35')](_0xcfed89,[_0x9aeb('0x32'),_0x4b1407['type']])[_0x9aeb('0x36')];return db['UserProfileResource'][_0x9aeb('0x2a')]({'where':{'type':_0x38e502,'resourceId':_0x4b1407['id']}})[_0x9aeb('0x37')](function(){return _0x45f4e3;});})[_0x9aeb('0x37')](function(){_0x558029[_0x9aeb('0x1f')](0xcc)[_0x9aeb('0x38')]();});}};}function handleEntityNotFound(_0x2ae516,_0x4adced){return function(_0x5805b5){if(!_0x5805b5){_0x2ae516[_0x9aeb('0x1e')](0x194);}return _0x5805b5;};}function handleError(_0x207da9,_0x1ccaf7){_0x1ccaf7=_0x1ccaf7||0x1f4;return function(_0x140085){logger[_0x9aeb('0x39')](_0x140085[_0x9aeb('0x3a')]);if(_0x140085[_0x9aeb('0x36')]){delete _0x140085[_0x9aeb('0x36')];}_0x207da9[_0x9aeb('0x1f')](_0x1ccaf7)[_0x9aeb('0x3b')](_0x140085);};}exports[_0x9aeb('0x3c')]=function(_0x88a8fc,_0x1080be){var _0x4f45d2={},_0x1441ac={},_0x3bf3cb={'count':0x0,'rows':[]};var _0xba4087=_[_0x9aeb('0x31')](db['VoiceQueue'][_0x9aeb('0x3d')],function(_0x446ad2){return{'name':_0x446ad2['fieldName'],'type':_0x446ad2[_0x9aeb('0x34')][_0x9aeb('0x3e')]};});_0x1441ac[_0x9aeb('0x3f')]=_[_0x9aeb('0x31')](_0xba4087,'name');_0x1441ac['query']=_['keys'](_0x88a8fc['query']);_0x1441ac[_0x9aeb('0x40')]=_['intersection'](_0x1441ac[_0x9aeb('0x3f')],_0x1441ac['query']);_0x4f45d2[_0x9aeb('0x41')]=_['intersection'](_0x1441ac['model'],qs[_0x9aeb('0x42')](_0x88a8fc['query'][_0x9aeb('0x42')]));_0x4f45d2[_0x9aeb('0x41')]=_0x4f45d2[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x4f45d2['attributes']:_0x1441ac['model'];if(!_0x88a8fc['query']['hasOwnProperty'](_0x9aeb('0x44'))){_0x4f45d2['limit']=qs[_0x9aeb('0x23')](_0x88a8fc[_0x9aeb('0x45')][_0x9aeb('0x23')]);_0x4f45d2['offset']=qs[_0x9aeb('0x21')](_0x88a8fc['query'][_0x9aeb('0x21')]);}_0x4f45d2[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x88a8fc[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x4f45d2[_0x9aeb('0x48')]=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x88a8fc['query'],_0x1441ac['filters']),_0xba4087);if(_0x88a8fc[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x4f45d2[_0x9aeb('0x48')]=_['merge'](_0x4f45d2['where'],{'$or':_[_0x9aeb('0x31')](_0xba4087,function(_0x50a954){if(_0x50a954[_0x9aeb('0x34')]!=='VIRTUAL'){var _0x51e3b2={};_0x51e3b2[_0x50a954[_0x9aeb('0x36')]]={'$like':'%'+_0x88a8fc[_0x9aeb('0x45')][_0x9aeb('0x2f')]+'%'};return _0x51e3b2;}})});}_0x4f45d2=_[_0x9aeb('0x4a')]({},_0x4f45d2,_0x88a8fc[_0x9aeb('0x4b')]);var _0xc1a16={'where':_0x4f45d2['where']};return db[_0x9aeb('0x4c')][_0x9aeb('0x24')](_0xc1a16)[_0x9aeb('0x37')](function(_0x4022eb){_0x3bf3cb[_0x9aeb('0x24')]=_0x4022eb;if(_0x88a8fc[_0x9aeb('0x45')]['includeAll']){_0x4f45d2[_0x9aeb('0x4d')]=[{'all':!![]}];}return db[_0x9aeb('0x4c')]['findAll'](_0x4f45d2);})['then'](function(_0x4093c0){_0x3bf3cb[_0x9aeb('0x4e')]=_0x4093c0;return _0x3bf3cb;})[_0x9aeb('0x37')](respondWithFilteredResult(_0x1080be,_0x4f45d2))[_0x9aeb('0x4f')](handleError(_0x1080be,null));};exports[_0x9aeb('0x50')]=function(_0x80304d,_0x3e0688){var _0x454d12={'raw':![],'where':{'id':_0x80304d[_0x9aeb('0x51')]['id']}},_0x5d01ba={};_0x5d01ba[_0x9aeb('0x3f')]=_['keys'](db['VoiceQueue'][_0x9aeb('0x3d')]);_0x5d01ba['query']=_[_0x9aeb('0x52')](_0x80304d[_0x9aeb('0x45')]);_0x5d01ba[_0x9aeb('0x40')]=_[_0x9aeb('0x53')](_0x5d01ba[_0x9aeb('0x3f')],_0x5d01ba['query']);_0x454d12[_0x9aeb('0x41')]=_['intersection'](_0x5d01ba['model'],qs[_0x9aeb('0x42')](_0x80304d[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x454d12[_0x9aeb('0x41')]=_0x454d12[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x454d12[_0x9aeb('0x41')]:_0x5d01ba[_0x9aeb('0x3f')];if(_0x80304d[_0x9aeb('0x45')]['includeAll']){_0x454d12[_0x9aeb('0x4d')]=[{'all':!![]}];}_0x454d12=_[_0x9aeb('0x4a')]({},_0x454d12,_0x80304d[_0x9aeb('0x4b')]);return db[_0x9aeb('0x4c')][_0x9aeb('0x35')](_0x454d12)[_0x9aeb('0x37')](handleEntityNotFound(_0x3e0688,null))['then'](respondWithResult(_0x3e0688,null))[_0x9aeb('0x4f')](handleError(_0x3e0688,null));};exports['create']=function(_0x19d627,_0x22ff9d){return db[_0x9aeb('0x4c')][_0x9aeb('0x54')](_0x19d627[_0x9aeb('0x55')],{})[_0x9aeb('0x37')](function(_0x34d726){var _0x47275a=_0x19d627[_0x9aeb('0x56')][_0x9aeb('0x2b')]({'plain':!![]});if(!_0x47275a)throw new Error(_0x9aeb('0x57'));if(_0x47275a[_0x9aeb('0x58')]===_0x9aeb('0x56')){var _0x4173c6=_0x34d726['get']({'plain':!![]});var _0x95640e=[{'name':_0x9aeb('0x2c'),'value':_0x9aeb('0x59')},{'name':_0x9aeb('0x2d'),'value':'outbound'}];var _0x1ed065=_[_0x9aeb('0x35')](_0x95640e,[_0x9aeb('0x32'),_0x4173c6[_0x9aeb('0x34')]])[_0x9aeb('0x36')];return db[_0x9aeb('0x5a')][_0x9aeb('0x35')]({'where':{'name':_0x1ed065,'userProfileId':_0x47275a[_0x9aeb('0x5b')]},'raw':!![]})['then'](function(_0x4c8469){if(_0x4c8469&&_0x4c8469['autoAssociation']===0x0){return db[_0x9aeb('0x5c')][_0x9aeb('0x54')]({'name':_0x4173c6[_0x9aeb('0x36')],'resourceId':_0x4173c6['id'],'type':_0x4c8469['name'],'sectionId':_0x4c8469['id']},{})[_0x9aeb('0x37')](function(){return _0x34d726;});}else{return _0x34d726;}})[_0x9aeb('0x4f')](function(_0x55f664){logger[_0x9aeb('0x39')](_0x9aeb('0x5d'),_0x55f664);throw _0x55f664;});}return _0x34d726;})[_0x9aeb('0x37')](respondWithResult(_0x22ff9d,0xc9))[_0x9aeb('0x4f')](handleError(_0x22ff9d,null));};exports[_0x9aeb('0x5e')]=function(_0x141efa,_0x2d218b){var _0x5d3298={'where':{'id':_0x141efa[_0x9aeb('0x51')]['id']}},_0x1659f7={};_0x1659f7[_0x9aeb('0x3f')]=_[_0x9aeb('0x52')](db['VoiceQueue'][_0x9aeb('0x3d')]);_0x5d3298[_0x9aeb('0x41')]=_['intersection'](_0x1659f7['model'],qs[_0x9aeb('0x42')](_0x141efa[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x5d3298['attributes']=_0x5d3298[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x5d3298[_0x9aeb('0x41')]:_0x1659f7[_0x9aeb('0x3f')];if(_0x141efa[_0x9aeb('0x45')][_0x9aeb('0x5f')]){_0x5d3298['include']=[{'all':!![]}];}_0x5d3298=_['merge']({},_0x5d3298,_0x141efa[_0x9aeb('0x4b')]);return db[_0x9aeb('0x4c')][_0x9aeb('0x35')](_0x5d3298)[_0x9aeb('0x37')](handleEntityNotFound(_0x2d218b,null))['then'](function(_0x2a5c55){if(_0x2a5c55){var _0x22c2f2=_0x2a5c55[_0x9aeb('0x2b')]({'plain':!![]});_0x22c2f2=qs['omit'](_0x22c2f2,['id',_0x9aeb('0x60'),_0x9aeb('0x61')]);_0x141efa[_0x9aeb('0x55')]=_[_0x9aeb('0x62')](_0x141efa['body'],['id',_0x9aeb('0x60'),_0x9aeb('0x61')]);return db['VoiceQueue'][_0x9aeb('0x54')](_[_0x9aeb('0x4a')](_0x22c2f2,_0x141efa[_0x9aeb('0x55')]),{'include':_0x141efa[_0x9aeb('0x45')][_0x9aeb('0x5f')]?[{'all':!![]}]:undefined})['then'](function(_0x50b52d){var _0x30eab2=_0x141efa['user'][_0x9aeb('0x2b')]({'plain':!![]});if(!_0x30eab2)throw new Error(_0x9aeb('0x57'));if(_0x30eab2[_0x9aeb('0x58')]===_0x9aeb('0x56')){var _0x3106f9=_0x50b52d[_0x9aeb('0x2b')]({'plain':!![]});var _0x54bd84=[{'name':'VoiceQueues','value':_0x9aeb('0x59')},{'name':'QueueCampaigns','value':_0x9aeb('0x2e')}];var _0x3b1557=_[_0x9aeb('0x35')](_0x54bd84,[_0x9aeb('0x32'),_0x3106f9['type']])['name'];return db[_0x9aeb('0x5a')][_0x9aeb('0x35')]({'where':{'name':_0x3b1557,'userProfileId':_0x30eab2[_0x9aeb('0x5b')]},'raw':!![]})[_0x9aeb('0x37')](function(_0x636cdc){if(_0x636cdc&&_0x636cdc[_0x9aeb('0x63')]===0x0){return db[_0x9aeb('0x5c')][_0x9aeb('0x54')]({'name':_0x3106f9[_0x9aeb('0x36')],'resourceId':_0x3106f9['id'],'type':_0x636cdc[_0x9aeb('0x36')],'sectionId':_0x636cdc['id']},{})['then'](function(){return _0x50b52d;});}else{return _0x50b52d;}})[_0x9aeb('0x4f')](function(_0x57b612){logger[_0x9aeb('0x39')](_0x9aeb('0x5d'),_0x57b612);throw _0x57b612;});}return _0x50b52d;});}})[_0x9aeb('0x37')](respondWithResult(_0x2d218b,0xc9))[_0x9aeb('0x4f')](handleError(_0x2d218b,null));};exports[_0x9aeb('0x64')]=function(_0x353064,_0x1a9259){if(_0x353064[_0x9aeb('0x55')]['id']){delete _0x353064[_0x9aeb('0x55')]['id'];}return db[_0x9aeb('0x4c')]['find']({'where':{'id':_0x353064[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x1a9259,null))[_0x9aeb('0x37')](saveUpdates(_0x353064['body'],null))[_0x9aeb('0x37')](respondWithResult(_0x1a9259,null))['catch'](handleError(_0x1a9259,null));};exports[_0x9aeb('0x2a')]=function(_0x2aa641,_0x3fe890){return db['VoiceQueue'][_0x9aeb('0x35')]({'where':{'id':_0x2aa641[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x3fe890,null))[_0x9aeb('0x37')](removeEntity(_0x3fe890,null))[_0x9aeb('0x4f')](handleError(_0x3fe890,null));};exports[_0x9aeb('0x65')]=function(_0x32ee64,_0x5708d1,_0x23c390){var _0x636832={'raw':![],'where':{}};var _0x2d25da={};var _0x8f43c6={'count':0x0,'rows':[]};return db[_0x9aeb('0x4c')]['findOne']({'where':{'id':_0x32ee64[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x5708d1,null))[_0x9aeb('0x37')](function(_0x2a2ca9){if(_0x2a2ca9){_0x2d25da['model']=_[_0x9aeb('0x52')](db[_0x9aeb('0x66')][_0x9aeb('0x3d')]);_0x2d25da[_0x9aeb('0x45')]=_['keys'](_0x32ee64['query']);_0x2d25da['filters']=_[_0x9aeb('0x53')](_0x2d25da[_0x9aeb('0x3f')],_0x2d25da[_0x9aeb('0x45')]);_0x636832[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x2d25da[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x32ee64['query'][_0x9aeb('0x42')]));_0x636832[_0x9aeb('0x41')]=_0x636832[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x636832[_0x9aeb('0x41')]:_0x2d25da[_0x9aeb('0x3f')];if(!_0x32ee64['query'][_0x9aeb('0x67')](_0x9aeb('0x44'))){_0x636832['limit']=qs[_0x9aeb('0x23')](_0x32ee64[_0x9aeb('0x45')][_0x9aeb('0x23')]);_0x636832['offset']=qs[_0x9aeb('0x21')](_0x32ee64['query']['offset']);}_0x636832[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x32ee64[_0x9aeb('0x45')]['sort']);_0x636832[_0x9aeb('0x48')]=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x32ee64[_0x9aeb('0x45')],_0x2d25da[_0x9aeb('0x40')]));_0x636832[_0x9aeb('0x48')]['VoiceQueueId']=_0x2a2ca9['id'];if(_0x32ee64[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x636832[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x636832[_0x9aeb('0x48')],{'$or':_[_0x9aeb('0x31')](_0x636832[_0x9aeb('0x41')],function(_0x355dd3){var _0x58b289={};_0x58b289[_0x355dd3]={'$like':'%'+_0x32ee64[_0x9aeb('0x45')]['filter']+'%'};return _0x58b289;})});}_0x636832=_[_0x9aeb('0x4a')]({},_0x636832,_0x32ee64[_0x9aeb('0x4b')]);return db['CmHopper'][_0x9aeb('0x24')]({'where':_0x636832[_0x9aeb('0x48')]})[_0x9aeb('0x37')](function(_0x169021){_0x8f43c6['count']=_0x169021;if(_0x32ee64[_0x9aeb('0x45')]['includeAll']){_0x636832[_0x9aeb('0x4d')]=[{'all':!![]}];}return db[_0x9aeb('0x66')][_0x9aeb('0x68')](_0x636832);})[_0x9aeb('0x37')](function(_0x567e3e){_0x8f43c6[_0x9aeb('0x4e')]=_0x567e3e;return _0x8f43c6;});}})[_0x9aeb('0x37')](respondWithFilteredResult(_0x5708d1,_0x636832))[_0x9aeb('0x4f')](handleError(_0x5708d1,null));};exports['getHopperHistories']=function(_0x39310e,_0x5279fd,_0x1432e4){var _0x4c7844={'raw':!![],'where':{}};var _0x1d1b25={};var _0x2edb8e={'count':0x0,'rows':[]};return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x39310e['params']['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x5279fd,null))[_0x9aeb('0x37')](function(_0x257ffd){if(_0x257ffd){_0x1d1b25['model']=_['keys'](db[_0x9aeb('0x6a')][_0x9aeb('0x3d')]);_0x1d1b25[_0x9aeb('0x45')]=_[_0x9aeb('0x52')](_0x39310e[_0x9aeb('0x45')]);_0x1d1b25[_0x9aeb('0x40')]=_[_0x9aeb('0x53')](_0x1d1b25['model'],_0x1d1b25[_0x9aeb('0x45')]);_0x4c7844[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x1d1b25[_0x9aeb('0x3f')],qs['fields'](_0x39310e[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x4c7844[_0x9aeb('0x41')]=_0x4c7844[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x4c7844[_0x9aeb('0x41')]:_0x1d1b25[_0x9aeb('0x3f')];if(!_0x39310e['query'][_0x9aeb('0x67')]('nolimit')){_0x4c7844[_0x9aeb('0x23')]=qs[_0x9aeb('0x23')](_0x39310e[_0x9aeb('0x45')]['limit']);_0x4c7844['offset']=qs['offset'](_0x39310e[_0x9aeb('0x45')][_0x9aeb('0x21')]);}_0x4c7844[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x39310e[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x4c7844['where']=qs['filters'](_['pick'](_0x39310e[_0x9aeb('0x45')],_0x1d1b25['filters']));_0x4c7844[_0x9aeb('0x48')]['VoiceQueueId']=_0x257ffd['id'];if(_0x39310e[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x4c7844[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x4c7844[_0x9aeb('0x48')],{'$or':_[_0x9aeb('0x31')](_0x4c7844[_0x9aeb('0x41')],function(_0x194c76){var _0x1ec771={};_0x1ec771[_0x194c76]={'$like':'%'+_0x39310e[_0x9aeb('0x45')]['filter']+'%'};return _0x1ec771;})});}_0x4c7844=_[_0x9aeb('0x4a')]({},_0x4c7844,_0x39310e[_0x9aeb('0x4b')]);return db[_0x9aeb('0x6a')][_0x9aeb('0x24')]({'where':_0x4c7844[_0x9aeb('0x48')]})[_0x9aeb('0x37')](function(_0x5ce097){_0x2edb8e[_0x9aeb('0x24')]=_0x5ce097;if(_0x39310e[_0x9aeb('0x45')][_0x9aeb('0x5f')]){_0x4c7844['include']=[{'all':!![]}];}return db[_0x9aeb('0x6a')][_0x9aeb('0x68')](_0x4c7844);})['then'](function(_0x45e722){_0x2edb8e[_0x9aeb('0x4e')]=_0x45e722;return _0x2edb8e;});}})[_0x9aeb('0x37')](respondWithFilteredResult(_0x5279fd,_0x4c7844))[_0x9aeb('0x4f')](handleError(_0x5279fd,null));};exports['getHopperFinals']=function(_0x1f2750,_0x3933a3,_0x3b4c65){var _0x1c4a85={'raw':!![],'where':{}};var _0x5ba62f={};var _0x277164={'count':0x0,'rows':[]};return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x1f2750[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x3933a3,null))[_0x9aeb('0x37')](function(_0x2a4e5c){if(_0x2a4e5c){_0x5ba62f[_0x9aeb('0x3f')]=_[_0x9aeb('0x52')](db[_0x9aeb('0x6b')][_0x9aeb('0x3d')]);_0x5ba62f['query']=_[_0x9aeb('0x52')](_0x1f2750['query']);_0x5ba62f['filters']=_[_0x9aeb('0x53')](_0x5ba62f[_0x9aeb('0x3f')],_0x5ba62f[_0x9aeb('0x45')]);_0x1c4a85['attributes']=_[_0x9aeb('0x53')](_0x5ba62f[_0x9aeb('0x3f')],qs['fields'](_0x1f2750[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x1c4a85['attributes']=_0x1c4a85[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x1c4a85['attributes']:_0x5ba62f[_0x9aeb('0x3f')];if(!_0x1f2750[_0x9aeb('0x45')][_0x9aeb('0x67')](_0x9aeb('0x44'))){_0x1c4a85[_0x9aeb('0x23')]=qs[_0x9aeb('0x23')](_0x1f2750[_0x9aeb('0x45')]['limit']);_0x1c4a85[_0x9aeb('0x21')]=qs[_0x9aeb('0x21')](_0x1f2750['query'][_0x9aeb('0x21')]);}_0x1c4a85[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x1f2750[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x1c4a85[_0x9aeb('0x48')]=qs['filters'](_[_0x9aeb('0x49')](_0x1f2750['query'],_0x5ba62f[_0x9aeb('0x40')]));_0x1c4a85['where']['VoiceQueueId']=_0x2a4e5c['id'];if(_0x1f2750[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x1c4a85[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x1c4a85['where'],{'$or':_[_0x9aeb('0x31')](_0x1c4a85['attributes'],function(_0x258815){var _0x517951={};_0x517951[_0x258815]={'$like':'%'+_0x1f2750['query'][_0x9aeb('0x2f')]+'%'};return _0x517951;})});}_0x1c4a85=_[_0x9aeb('0x4a')]({},_0x1c4a85,_0x1f2750[_0x9aeb('0x4b')]);return db[_0x9aeb('0x6b')]['count']({'where':_0x1c4a85['where']})[_0x9aeb('0x37')](function(_0x18f4d3){_0x277164[_0x9aeb('0x24')]=_0x18f4d3;if(_0x1f2750[_0x9aeb('0x45')]['includeAll']){_0x1c4a85[_0x9aeb('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9aeb('0x68')](_0x1c4a85);})[_0x9aeb('0x37')](function(_0x21abf7){_0x277164[_0x9aeb('0x4e')]=_0x21abf7;return _0x277164;});}})[_0x9aeb('0x37')](respondWithFilteredResult(_0x3933a3,_0x1c4a85))[_0x9aeb('0x4f')](handleError(_0x3933a3,null));};exports[_0x9aeb('0x6c')]=function(_0x451397,_0x514780,_0x1c22d9){var _0x21fec9={'raw':!![],'where':{}};var _0xaa7148={};var _0x517c6e={'count':0x0,'rows':[]};return db[_0x9aeb('0x4c')]['findOne']({'where':{'id':_0x451397[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x514780,null))[_0x9aeb('0x37')](function(_0x4446e0){if(_0x4446e0){_0xaa7148[_0x9aeb('0x3f')]=_[_0x9aeb('0x52')](db[_0x9aeb('0x6d')][_0x9aeb('0x3d')]);_0xaa7148['query']=_[_0x9aeb('0x52')](_0x451397[_0x9aeb('0x45')]);_0xaa7148[_0x9aeb('0x40')]=_[_0x9aeb('0x53')](_0xaa7148[_0x9aeb('0x3f')],_0xaa7148['query']);_0x21fec9['attributes']=_[_0x9aeb('0x53')](_0xaa7148[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x451397['query'][_0x9aeb('0x42')]));_0x21fec9[_0x9aeb('0x41')]=_0x21fec9[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x21fec9[_0x9aeb('0x41')]:_0xaa7148[_0x9aeb('0x3f')];if(!_0x451397[_0x9aeb('0x45')][_0x9aeb('0x67')]('nolimit')){_0x21fec9['limit']=qs[_0x9aeb('0x23')](_0x451397['query'][_0x9aeb('0x23')]);_0x21fec9[_0x9aeb('0x21')]=qs[_0x9aeb('0x21')](_0x451397[_0x9aeb('0x45')]['offset']);}_0x21fec9[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x451397[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x21fec9[_0x9aeb('0x48')]=qs['filters'](_[_0x9aeb('0x49')](_0x451397[_0x9aeb('0x45')],_0xaa7148['filters']));_0x21fec9[_0x9aeb('0x48')][_0x9aeb('0x6e')]=_0x4446e0['id'];if(_0x451397[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x21fec9['where']=_[_0x9aeb('0x4a')](_0x21fec9[_0x9aeb('0x48')],{'$or':_['map'](_0x21fec9[_0x9aeb('0x41')],function(_0x512fc7){var _0x19a37={};_0x19a37[_0x512fc7]={'$like':'%'+_0x451397['query'][_0x9aeb('0x2f')]+'%'};return _0x19a37;})});}_0x21fec9=_[_0x9aeb('0x4a')]({},_0x21fec9,_0x451397[_0x9aeb('0x4b')]);return db['CmHopperBlack']['count']({'where':_0x21fec9[_0x9aeb('0x48')]})['then'](function(_0x402d64){_0x517c6e[_0x9aeb('0x24')]=_0x402d64;if(_0x451397[_0x9aeb('0x45')][_0x9aeb('0x5f')]){_0x21fec9[_0x9aeb('0x4d')]=[{'all':!![]}];}return db[_0x9aeb('0x6d')]['findAll'](_0x21fec9);})[_0x9aeb('0x37')](function(_0x3ee786){_0x517c6e[_0x9aeb('0x4e')]=_0x3ee786;return _0x517c6e;});}})[_0x9aeb('0x37')](respondWithFilteredResult(_0x514780,_0x21fec9))[_0x9aeb('0x4f')](handleError(_0x514780,null));};exports[_0x9aeb('0x6f')]=function(_0x349434,_0x30bc81,_0x6fadeb){var _0x450e59={};var _0x2f9026={};var _0x5e46f3;var _0x3be3a3;return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x349434['params']['id']}})['then'](handleEntityNotFound(_0x30bc81,null))[_0x9aeb('0x37')](function(_0x396b00){if(_0x396b00){_0x5e46f3=_0x396b00;_0x2f9026[_0x9aeb('0x3f')]=_['keys'](db[_0x9aeb('0x70')][_0x9aeb('0x3d')]);_0x2f9026[_0x9aeb('0x45')]=_[_0x9aeb('0x52')](_0x349434[_0x9aeb('0x45')]);_0x2f9026[_0x9aeb('0x40')]=_['intersection'](_0x2f9026[_0x9aeb('0x3f')],_0x2f9026[_0x9aeb('0x45')]);_0x450e59[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x2f9026[_0x9aeb('0x3f')],qs['fields'](_0x349434[_0x9aeb('0x45')]['fields']));_0x450e59[_0x9aeb('0x41')]=_0x450e59[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x450e59['attributes']:_0x2f9026[_0x9aeb('0x3f')];_0x450e59['order']=qs[_0x9aeb('0x47')](_0x349434[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x450e59[_0x9aeb('0x48')]=qs['filters'](_[_0x9aeb('0x49')](_0x349434[_0x9aeb('0x45')],_0x2f9026[_0x9aeb('0x40')]));if(_0x349434[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x450e59[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x450e59['where'],{'$or':_[_0x9aeb('0x31')](_0x450e59['attributes'],function(_0x1e8aec){var _0x18a927={};_0x18a927[_0x1e8aec]={'$like':'%'+_0x349434[_0x9aeb('0x45')][_0x9aeb('0x2f')]+'%'};return _0x18a927;})});}_0x450e59=_['merge']({},_0x450e59,_0x349434['options']);return _0x5e46f3['getTeams'](_0x450e59);}})[_0x9aeb('0x37')](function(_0x360dc4){if(_0x360dc4){_0x3be3a3=_0x360dc4[_0x9aeb('0x43')];if(!_0x349434[_0x9aeb('0x45')]['hasOwnProperty'](_0x9aeb('0x44'))){_0x450e59['limit']=qs[_0x9aeb('0x23')](_0x349434['query']['limit']);_0x450e59[_0x9aeb('0x21')]=qs[_0x9aeb('0x21')](_0x349434['query']['offset']);}return _0x5e46f3[_0x9aeb('0x6f')](_0x450e59);}})[_0x9aeb('0x37')](function(_0x3080b4){if(_0x3080b4){return _0x3080b4?{'count':_0x3be3a3,'rows':_0x3080b4}:null;}})[_0x9aeb('0x37')](respondWithResult(_0x30bc81,null))[_0x9aeb('0x4f')](handleError(_0x30bc81,null));};exports[_0x9aeb('0x71')]=function(_0x503059,_0x12347a,_0x2b9fde){var _0x53873f=_0x503059[_0x9aeb('0x55')]['teams'];var _0x3ede98=_['map'](_0x53873f,'id');return db[_0x9aeb('0x70')][_0x9aeb('0x68')]({'where':{'id':_0x3ede98},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9aeb('0x72'),'attributes':['id',_0x9aeb('0x36'),_0x9aeb('0x73'),_0x9aeb('0x74'),'interface'],'raw':!![]}]})[_0x9aeb('0x37')](function(_0x2a717a){if(_0x2a717a){var _0x581f76=_[_0x9aeb('0x75')](_0x2a717a,function(_0x29b71d){var _0x4011d3=_0x29b71d[_0x9aeb('0x2b')]({'plain':!![]});_0x4011d3[_0x9aeb('0x72')][_0x9aeb('0x76')](function(_0x4dbdf1){_0x4dbdf1[_0x9aeb('0x77')]=_['find'](_0x53873f,{'id':_0x4011d3['id']})[_0x9aeb('0x77')];});return _0x4011d3['Agents'];});return db[_0x9aeb('0x4c')][_0x9aeb('0x35')]({'where':{'id':_0x503059[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](function(_0x13c549){return db['sequelize']['transaction'](function(_0x3d0489){return _0x13c549[_0x9aeb('0x71')](_0x3ede98,{'transaction':_0x3d0489})['then'](function(){return BPromise['each'](_0x53873f,function(_0x74d94a){return db[_0x9aeb('0x78')]['upsert']({'TeamId':_0x74d94a['id'],'VoiceQueueId':_0x503059[_0x9aeb('0x51')]['id'],'penalty':_0x74d94a[_0x9aeb('0x77')]},{'transaction':_0x3d0489});});})['then'](function(){return BPromise['each'](_0x581f76,function(_0x2b2e36){return db[_0x9aeb('0x79')][_0x9aeb('0x7a')]({'where':{'UserId':_0x2b2e36['id'],'VoiceQueueId':_0x503059[_0x9aeb('0x51')]['id']},'defaults':{'penalty':_0x2b2e36[_0x9aeb('0x77')]},'transaction':_0x3d0489});});})[_0x9aeb('0x37')](function(){return BPromise[_0x9aeb('0x7b')](_[_0x9aeb('0x2f')](_0x581f76,{'online':!![]}),function(_0x46c03a){return db[_0x9aeb('0x7c')][_0x9aeb('0x7d')]({'membername':_0x46c03a[_0x9aeb('0x36')],'UserId':_0x46c03a['id'],'queue_name':_0x13c549[_0x9aeb('0x36')],'VoiceQueueId':_0x13c549['id'],'interface':_[_0x9aeb('0x7e')](_0x46c03a['interface'])?util[_0x9aeb('0x7f')](_0x9aeb('0x80'),_0x46c03a[_0x9aeb('0x36')]):_0x46c03a['interface'],'paused':_0x46c03a[_0x9aeb('0x74')]||![],'penalty':_0x46c03a['penalty']},{'transaction':_0x3d0489});});})[_0x9aeb('0x37')](function(){_0x581f76[_0x9aeb('0x76')](function(_0x3477c7){socket[_0x9aeb('0x81')](_0x9aeb('0x82'),{'UserId':_0x3477c7['id'],'VoiceQueueId':_0x13c549['id']});});});});});}})[_0x9aeb('0x37')](respondWithStatusCode(_0x12347a,null))[_0x9aeb('0x4f')](handleError(_0x12347a,null));};exports[_0x9aeb('0x83')]=function(_0x21f06c,_0x69f45e,_0x38eb44){return db['Team']['findAll']({'where':{'id':_0x21f06c[_0x9aeb('0x45')][_0x9aeb('0x84')]},'attributes':['id'],'include':[{'model':db[_0x9aeb('0x85')],'as':_0x9aeb('0x72'),'attributes':['id'],'raw':!![]}]})[_0x9aeb('0x37')](handleEntityNotFound(_0x69f45e,null))[_0x9aeb('0x37')](function(_0x3a5aad){var _0x41686e=_[_0x9aeb('0x31')](_0x3a5aad,'id');var _0x107e78=[];var _0x47edd0=[];var _0x370e06=squel[_0x9aeb('0x86')]();_0x370e06['field'](_0x9aeb('0x87'))[_0x9aeb('0x88')](_0x9aeb('0x89'),'tq')[_0x9aeb('0x8a')](_0x9aeb('0x8b'),'ut',_0x9aeb('0x8c'))['where'](_0x9aeb('0x8d'),_0x21f06c['params']['id']);for(var _0x21d7af=0x0;_0x21d7af<_0x3a5aad['length'];_0x21d7af+=0x1){let _0x216204=_0x3a5aad[_0x21d7af];for(var _0x29ac76=0x0;_0x29ac76<_0x216204['Agents'][_0x9aeb('0x43')];_0x29ac76+=0x1){let _0x27a40d=_0x216204[_0x9aeb('0x72')][_0x29ac76];var _0x1bc73a=_0x370e06[_0x9aeb('0x5e')]();_0x1bc73a[_0x9aeb('0x48')](_0x9aeb('0x8e'),_0x27a40d['id']);_0x47edd0['push'](db[_0x9aeb('0x8f')][_0x9aeb('0x45')](_0x1bc73a['toString'](),{'type':db[_0x9aeb('0x8f')][_0x9aeb('0x90')][_0x9aeb('0x91')]})[_0x9aeb('0x37')](function(_0x4c72b8){if(_0x4c72b8[_0x9aeb('0x43')]===0x1){return _0x27a40d['id'];}else{var _0x14551c=_[_0x9aeb('0x92')](_['map'](_0x4c72b8,'TeamId'),function(_0xc1b955){return _['includes'](_0x41686e,_0xc1b955);});if(_0x14551c){return _0x27a40d['id'];}}}));}}return BPromise[_0x9aeb('0x93')](_0x47edd0)[_0x9aeb('0x37')](function(_0x5955e5){_0x107e78=_(_0x107e78)[_0x9aeb('0x94')](_0x5955e5)['compact']()[_0x9aeb('0x32')]();return db['VoiceQueue'][_0x9aeb('0x35')]({'where':{'id':_0x21f06c[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](function(_0x250e2e){return db['sequelize']['transaction'](function(_0x3f9f11){return _0x250e2e['removeTeams'](_0x21f06c['query'][_0x9aeb('0x84')],{'transaction':_0x3f9f11})[_0x9aeb('0x37')](function(){if(!_[_0x9aeb('0x95')](_0x107e78)){return _0x250e2e[_0x9aeb('0x96')](_0x107e78,{'transaction':_0x3f9f11})[_0x9aeb('0x37')](function(){return db['UserVoiceQueueRt'][_0x9aeb('0x2a')]({'where':{'VoiceQueueId':_0x21f06c[_0x9aeb('0x51')]['id'],'UserId':_0x107e78},'transaction':_0x3f9f11});});}})[_0x9aeb('0x37')](function(){_0x107e78[_0x9aeb('0x76')](function(_0x4cb399){socket[_0x9aeb('0x81')](_0x9aeb('0x97'),{'UserId':_0x4cb399,'VoiceQueueId':_0x250e2e['id']});});});});});});})[_0x9aeb('0x37')](respondWithStatusCode(_0x69f45e,null))[_0x9aeb('0x4f')](handleError(_0x69f45e,null));};exports[_0x9aeb('0x98')]=function(_0x55bbbe,_0x389a0a,_0x3f26e3){var _0x97e913,_0x3ca3d1;return db[_0x9aeb('0x4c')][_0x9aeb('0x35')]({'where':{'id':_0x55bbbe[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x389a0a,null))[_0x9aeb('0x37')](function(_0x52f324){if(_0x52f324){_0x3ca3d1=_0x52f324;return _0x52f324[_0x9aeb('0x98')](_0x55bbbe[_0x9aeb('0x55')][_0x9aeb('0x84')],_[_0x9aeb('0x62')](_0x55bbbe['body'],[_0x9aeb('0x84'),'id'])||{})[_0x9aeb('0x99')](function(_0x27710f){for(var _0x196efd=0x0;_0x196efd<_0x55bbbe[_0x9aeb('0x55')]['ids'][_0x9aeb('0x43')];_0x196efd+=0x1){socket[_0x9aeb('0x81')]('userVoiceQueue:save',{'UserId':Number(_0x55bbbe['body'][_0x9aeb('0x84')][_0x196efd]),'VoiceQueueId':Number(_0x55bbbe[_0x9aeb('0x51')]['id'])});}return _0x27710f;});}})[_0x9aeb('0x37')](function(_0x46b78d){_0x97e913=_0x46b78d||[];if(_0x3ca3d1){return db[_0x9aeb('0x85')][_0x9aeb('0x68')]({'where':{'id':_0x55bbbe[_0x9aeb('0x55')][_0x9aeb('0x84')]},'attributes':['id',_0x9aeb('0x36'),_0x9aeb('0x73'),_0x9aeb('0x74'),_0x9aeb('0x9a')],'raw':!![]});}})['then'](function(_0x49f1b7){if(!_[_0x9aeb('0x95')](_0x49f1b7)){var _0x26c7ce=[];for(var _0x2595f8=0x0;_0x2595f8<_0x49f1b7[_0x9aeb('0x43')];_0x2595f8++){if(_0x49f1b7[_0x2595f8]['online']){_0x26c7ce[_0x9aeb('0x9b')](db[_0x9aeb('0x7c')][_0x9aeb('0x7d')]({'membername':_0x49f1b7[_0x2595f8][_0x9aeb('0x36')],'UserId':_0x49f1b7[_0x2595f8]['id'],'queue_name':_0x3ca3d1[_0x9aeb('0x36')],'VoiceQueueId':_0x3ca3d1['id'],'interface':_[_0x9aeb('0x7e')](_0x49f1b7[_0x2595f8][_0x9aeb('0x9a')])?util[_0x9aeb('0x7f')](_0x9aeb('0x80'),_0x49f1b7[_0x2595f8][_0x9aeb('0x36')]):_0x49f1b7[_0x2595f8][_0x9aeb('0x9a')],'paused':_0x49f1b7[_0x2595f8][_0x9aeb('0x74')]||![],'penalty':_0x55bbbe[_0x9aeb('0x55')][_0x9aeb('0x77')]||0x0}));}}return BPromise[_0x9aeb('0x93')](_0x26c7ce);}})[_0x9aeb('0x37')](function(){return _0x97e913;})[_0x9aeb('0x37')](respondWithResult(_0x389a0a,null))['catch'](handleError(_0x389a0a,null));};exports['removeAgents']=function(_0x181d37,_0x5a8b01,_0x33de98){return db[_0x9aeb('0x4c')][_0x9aeb('0x35')]({'where':{'id':_0x181d37[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x5a8b01,null))['then'](function(_0x6c730c){if(_0x6c730c){return _0x6c730c[_0x9aeb('0x96')](_0x181d37[_0x9aeb('0x45')][_0x9aeb('0x84')])[_0x9aeb('0x37')](function(){if(_[_0x9aeb('0x9c')](_0x181d37[_0x9aeb('0x45')]['ids'])){for(var _0x47610a=0x0;_0x47610a<_0x181d37[_0x9aeb('0x45')][_0x9aeb('0x84')][_0x9aeb('0x43')];_0x47610a+=0x1){socket[_0x9aeb('0x81')](_0x9aeb('0x97'),{'UserId':Number(_0x181d37[_0x9aeb('0x45')][_0x9aeb('0x84')][_0x47610a]),'VoiceQueueId':Number(_0x181d37[_0x9aeb('0x51')]['id'])});}}else{socket[_0x9aeb('0x81')](_0x9aeb('0x97'),{'UserId':Number(_0x181d37[_0x9aeb('0x45')][_0x9aeb('0x84')]),'VoiceQueueId':Number(_0x181d37['params']['id'])});}});}})[_0x9aeb('0x37')](function(_0x45c222){return db['UserVoiceQueueRt'][_0x9aeb('0x2a')]({'where':{'VoiceQueueId':_0x181d37[_0x9aeb('0x51')]['id'],'UserId':_0x181d37[_0x9aeb('0x45')][_0x9aeb('0x84')]}})[_0x9aeb('0x37')](function(){return _0x45c222;});})['then'](respondWithStatusCode(_0x5a8b01,null))[_0x9aeb('0x4f')](handleError(_0x5a8b01,null));};exports[_0x9aeb('0x9d')]=function(_0x292e48,_0x24f876,_0x3e6cba){var _0x237585={};var _0x2dcc9b={};var _0x24a3de;var _0x54167e;return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x292e48['params']['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x24f876,null))['then'](function(_0x547f65){if(_0x547f65){_0x24a3de=_0x547f65;_0x2dcc9b[_0x9aeb('0x3f')]=_[_0x9aeb('0x52')](db[_0x9aeb('0x85')][_0x9aeb('0x3d')]);_0x2dcc9b[_0x9aeb('0x45')]=_[_0x9aeb('0x52')](_0x292e48[_0x9aeb('0x45')]);_0x2dcc9b[_0x9aeb('0x40')]=_[_0x9aeb('0x53')](_0x2dcc9b[_0x9aeb('0x3f')],_0x2dcc9b[_0x9aeb('0x45')]);_0x237585[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x2dcc9b[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x292e48[_0x9aeb('0x45')]['fields']));_0x237585[_0x9aeb('0x41')]=_0x237585[_0x9aeb('0x41')]['length']?_0x237585[_0x9aeb('0x41')]:_0x2dcc9b[_0x9aeb('0x3f')];_0x237585[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x292e48['query']['sort']);_0x237585[_0x9aeb('0x48')]=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x292e48[_0x9aeb('0x45')],_0x2dcc9b[_0x9aeb('0x40')]));if(_0x292e48[_0x9aeb('0x45')]['filter']){_0x237585[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x237585[_0x9aeb('0x48')],{'$or':_['map'](_0x237585[_0x9aeb('0x41')],function(_0x1a1c43){var _0x3386a8={};_0x3386a8[_0x1a1c43]={'$like':'%'+_0x292e48[_0x9aeb('0x45')]['filter']+'%'};return _0x3386a8;})});}_0x237585=_[_0x9aeb('0x4a')]({},_0x237585,_0x292e48['options']);return _0x24a3de[_0x9aeb('0x9d')](_0x237585);}})[_0x9aeb('0x37')](function(_0x4c8e66){if(_0x4c8e66){_0x54167e=_0x4c8e66[_0x9aeb('0x43')];if(!_0x292e48[_0x9aeb('0x45')][_0x9aeb('0x67')](_0x9aeb('0x44'))){_0x237585[_0x9aeb('0x23')]=qs[_0x9aeb('0x23')](_0x292e48[_0x9aeb('0x45')][_0x9aeb('0x23')]);_0x237585['offset']=qs[_0x9aeb('0x21')](_0x292e48[_0x9aeb('0x45')]['offset']);}return _0x24a3de[_0x9aeb('0x9d')](_0x237585);}})['then'](function(_0x48d544){if(_0x48d544){return _0x48d544?{'count':_0x54167e,'rows':_0x48d544}:null;}})[_0x9aeb('0x37')](respondWithResult(_0x24f876,null))[_0x9aeb('0x4f')](handleError(_0x24f876,null));};exports[_0x9aeb('0x9e')]=function(_0x4bdb9d,_0x570230,_0x42e117){var _0x5cb007={};var _0x131f63={};var _0x28d704;var _0x271951;return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x4bdb9d[_0x9aeb('0x51')]['id']}})['then'](handleEntityNotFound(_0x570230,null))[_0x9aeb('0x37')](function(_0x5cb632){if(_0x5cb632){_0x28d704=_0x5cb632;_0x131f63[_0x9aeb('0x3f')]=_[_0x9aeb('0x52')](db[_0x9aeb('0x7c')][_0x9aeb('0x3d')]);_0x131f63[_0x9aeb('0x45')]=_[_0x9aeb('0x52')](_0x4bdb9d[_0x9aeb('0x45')]);_0x131f63[_0x9aeb('0x40')]=_[_0x9aeb('0x53')](_0x131f63[_0x9aeb('0x3f')],_0x131f63[_0x9aeb('0x45')]);_0x5cb007[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x131f63[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x4bdb9d[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x5cb007[_0x9aeb('0x41')]=_0x5cb007[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x5cb007['attributes']:_0x131f63['model'];_0x5cb007[_0x9aeb('0x46')]=qs[_0x9aeb('0x47')](_0x4bdb9d[_0x9aeb('0x45')]['sort']);_0x5cb007[_0x9aeb('0x48')]=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x4bdb9d[_0x9aeb('0x45')],_0x131f63[_0x9aeb('0x40')]));if(_0x4bdb9d[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x5cb007[_0x9aeb('0x48')]=_[_0x9aeb('0x4a')](_0x5cb007[_0x9aeb('0x48')],{'$or':_[_0x9aeb('0x31')](_0x5cb007[_0x9aeb('0x41')],function(_0x12c4e7){var _0x5848aa={};_0x5848aa[_0x12c4e7]={'$like':'%'+_0x4bdb9d[_0x9aeb('0x45')][_0x9aeb('0x2f')]+'%'};return _0x5848aa;})});}_0x5cb007=_[_0x9aeb('0x4a')]({},_0x5cb007,_0x4bdb9d['options']);return _0x28d704[_0x9aeb('0x9e')](_0x5cb007);}})[_0x9aeb('0x37')](function(_0x394ab1){if(_0x394ab1){_0x271951=_0x394ab1['length'];if(!_0x4bdb9d[_0x9aeb('0x45')]['hasOwnProperty'](_0x9aeb('0x44'))){_0x5cb007['limit']=qs[_0x9aeb('0x23')](_0x4bdb9d[_0x9aeb('0x45')]['limit']);_0x5cb007[_0x9aeb('0x21')]=qs['offset'](_0x4bdb9d[_0x9aeb('0x45')]['offset']);}return _0x28d704[_0x9aeb('0x9e')](_0x5cb007);}})['then'](function(_0x1a6bb1){return _0x1a6bb1?{'count':_0x271951,'rows':_0x1a6bb1}:null;})[_0x9aeb('0x37')](respondWithResult(_0x570230,null))[_0x9aeb('0x4f')](handleError(_0x570230,null));};exports[_0x9aeb('0x9f')]=function(_0x4ed0ab,_0x46b5d2,_0x281f9d){var _0x22ac54={};var _0x478ef9={};var _0x59511f;var _0x54bcee;return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x4ed0ab['params']['id']}})['then'](handleEntityNotFound(_0x46b5d2,null))['then'](function(_0x369cc2){if(_0x369cc2){_0x59511f=_0x369cc2;_0x478ef9[_0x9aeb('0x3f')]=_['keys'](db['CmList']['rawAttributes']);_0x478ef9['query']=_[_0x9aeb('0x52')](_0x4ed0ab['query']);_0x478ef9[_0x9aeb('0x40')]=_['intersection'](_0x478ef9[_0x9aeb('0x3f')],_0x478ef9[_0x9aeb('0x45')]);_0x22ac54[_0x9aeb('0x41')]=_['intersection'](_0x478ef9[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x4ed0ab['query']['fields']));_0x22ac54[_0x9aeb('0x41')]=_0x22ac54['attributes'][_0x9aeb('0x43')]?_0x22ac54['attributes']:_0x478ef9[_0x9aeb('0x3f')];_0x22ac54['order']=qs[_0x9aeb('0x47')](_0x4ed0ab[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x22ac54[_0x9aeb('0x48')]=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x4ed0ab[_0x9aeb('0x45')],_0x478ef9[_0x9aeb('0x40')]));if(_0x4ed0ab[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x22ac54['where']=_[_0x9aeb('0x4a')](_0x22ac54[_0x9aeb('0x48')],{'$or':_['map'](_0x22ac54[_0x9aeb('0x41')],function(_0x4b8ecd){var _0x558c10={};_0x558c10[_0x4b8ecd]={'$like':'%'+_0x4ed0ab[_0x9aeb('0x45')][_0x9aeb('0x2f')]+'%'};return _0x558c10;})});}_0x22ac54=_[_0x9aeb('0x4a')]({},_0x22ac54,_0x4ed0ab[_0x9aeb('0x4b')]);return _0x59511f[_0x9aeb('0x9f')](_0x22ac54);}})['then'](function(_0x59b337){if(_0x59b337){_0x54bcee=_0x59b337[_0x9aeb('0x43')];if(!_0x4ed0ab[_0x9aeb('0x45')]['hasOwnProperty'](_0x9aeb('0x44'))){_0x22ac54[_0x9aeb('0x23')]=qs[_0x9aeb('0x23')](_0x4ed0ab[_0x9aeb('0x45')][_0x9aeb('0x23')]);_0x22ac54['offset']=qs['offset'](_0x4ed0ab[_0x9aeb('0x45')][_0x9aeb('0x21')]);}return _0x59511f[_0x9aeb('0x9f')](_0x22ac54);}})[_0x9aeb('0x37')](function(_0x2ecfd2){if(_0x2ecfd2){return _0x2ecfd2?{'count':_0x54bcee,'rows':_0x2ecfd2}:null;}})[_0x9aeb('0x37')](respondWithResult(_0x46b5d2,null))[_0x9aeb('0x4f')](handleError(_0x46b5d2,null));};exports['addLists']=function(_0x415e1d,_0x103868,_0x2b9684){var _0x2f39b5,_0x398640;return db[_0x9aeb('0x4c')][_0x9aeb('0x35')]({'where':{'id':_0x415e1d[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x103868,null))[_0x9aeb('0x37')](function(_0x1986bf){if(_0x1986bf){_0x398640=_0x1986bf;return _0x1986bf[_0x9aeb('0xa0')](_0x415e1d[_0x9aeb('0x55')][_0x9aeb('0x84')],_['omit'](_0x415e1d[_0x9aeb('0x55')],[_0x9aeb('0x84'),'id'])||{});}return null;})['spread'](function(_0x435459){var _0x44aecf;_0x2f39b5=_0x435459||[];var _0x56171a=[];if(_0x435459){for(var _0x4f2e27=0x0;_0x4f2e27<_0x435459[_0x9aeb('0x43')];_0x4f2e27+=0x1){var _0x5f5682=_0x435459[_0x4f2e27]['get']({'plain':!![]});_0x398640[_0x9aeb('0xa1')]=_0x415e1d[_0x9aeb('0x55')][_0x9aeb('0xa1')]?_0x415e1d[_0x9aeb('0x55')][_0x9aeb('0xa1')]:_0x398640['dialCheckDuplicateType'];switch(_0x398640[_0x9aeb('0xa1')]){case'always':_0x44aecf=squel[_0x9aeb('0xa2')]()[_0x9aeb('0xa3')]('cm_hopper')[_0x9aeb('0xa4')]([_0x9aeb('0xa5'),_0x9aeb('0xa6'),_0x9aeb('0xa7'),_0x9aeb('0xa8'),_0x9aeb('0x6e'),_0x9aeb('0x60'),'updatedAt'],squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')](_0x9aeb('0xa5'),_0x9aeb('0xa5'))[_0x9aeb('0xa9')](_0x9aeb('0xaa'),_0x9aeb('0xa6'))[_0x9aeb('0xa9')]('id',_0x9aeb('0xa7'))[_0x9aeb('0xa9')](_0x5f5682[_0x9aeb('0xab')][_0x9aeb('0xac')](),_0x9aeb('0xa8'))[_0x9aeb('0xa9')](_0x415e1d['params']['id'][_0x9aeb('0xac')](),'VoiceQueueId')[_0x9aeb('0xa9')](_0x9aeb('0xaa'),_0x9aeb('0x60'))['field'](_0x9aeb('0xaa'),_0x9aeb('0x61'))[_0x9aeb('0x88')](_0x9aeb('0xad'))[_0x9aeb('0x48')]('deletedAt\x20IS\x20NULL')[_0x9aeb('0x48')](_0x9aeb('0xae'),_0x5f5682[_0x9aeb('0xab')][_0x9aeb('0xac')]())['where'](_0x9aeb('0xaf'))[_0x9aeb('0x48')](_0x9aeb('0xb0'),squel[_0x9aeb('0x86')]()['field'](_0x9aeb('0xb1'))[_0x9aeb('0x88')](_0x9aeb('0xb2'))[_0x9aeb('0x48')]('VoiceQueueId\x20=\x20?',_0x415e1d[_0x9aeb('0x51')]['id'][_0x9aeb('0xac')]()))[_0x9aeb('0x48')](_0x9aeb('0xb0'),squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')](_0x9aeb('0xb3'))[_0x9aeb('0x88')](_0x9aeb('0xb4'))['where'](_0x9aeb('0x8d'),_0x415e1d[_0x9aeb('0x51')]['id']['toString']())))[_0x9aeb('0xac')]();break;case'onlyIfOpen':_0x44aecf=squel[_0x9aeb('0xa2')]()[_0x9aeb('0xa3')]('cm_hopper')[_0x9aeb('0xa4')]([_0x9aeb('0xa5'),_0x9aeb('0xa6'),'ContactId',_0x9aeb('0xa8'),'VoiceQueueId',_0x9aeb('0x60'),_0x9aeb('0x61')],squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')](_0x9aeb('0xa5'),'phone')['field'](_0x9aeb('0xaa'),_0x9aeb('0xa6'))[_0x9aeb('0xa9')]('id',_0x9aeb('0xa7'))[_0x9aeb('0xa9')](_0x5f5682[_0x9aeb('0xab')][_0x9aeb('0xac')](),'ListId')['field'](_0x415e1d[_0x9aeb('0x51')]['id'][_0x9aeb('0xac')](),'VoiceQueueId')['field'](_0x9aeb('0xaa'),_0x9aeb('0x60'))[_0x9aeb('0xa9')](_0x9aeb('0xaa'),_0x9aeb('0x61'))[_0x9aeb('0x88')](_0x9aeb('0xad'))['where'](_0x9aeb('0xb5'))[_0x9aeb('0x48')](_0x9aeb('0xae'),_0x5f5682[_0x9aeb('0xab')][_0x9aeb('0xac')]())[_0x9aeb('0x48')](_0x9aeb('0xaf'))[_0x9aeb('0x48')](_0x9aeb('0xb0'),squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')]('COALESCE(phone,\x27\x27)')[_0x9aeb('0x88')]('cm_hopper')[_0x9aeb('0x48')](_0x9aeb('0x8d'),_0x415e1d[_0x9aeb('0x51')]['id'][_0x9aeb('0xac')]())))[_0x9aeb('0xac')]();break;default:_0x44aecf=squel['insert']()[_0x9aeb('0xa3')](_0x9aeb('0xb4'))['fromQuery']([_0x9aeb('0xa5'),'scheduledAt',_0x9aeb('0xa7'),_0x9aeb('0xa8'),_0x9aeb('0x6e'),_0x9aeb('0x60'),_0x9aeb('0x61')],squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')](_0x9aeb('0xa5'),_0x9aeb('0xa5'))['field'](_0x9aeb('0xaa'),_0x9aeb('0xa6'))[_0x9aeb('0xa9')]('id',_0x9aeb('0xa7'))[_0x9aeb('0xa9')](_0x5f5682[_0x9aeb('0xab')][_0x9aeb('0xac')](),_0x9aeb('0xa8'))[_0x9aeb('0xa9')](_0x415e1d[_0x9aeb('0x51')]['id'][_0x9aeb('0xac')](),_0x9aeb('0x6e'))[_0x9aeb('0xa9')](_0x9aeb('0xaa'),_0x9aeb('0x60'))[_0x9aeb('0xa9')]('NOW()',_0x9aeb('0x61'))[_0x9aeb('0x88')](_0x9aeb('0xad'))[_0x9aeb('0x48')]('deletedAt\x20IS\x20NULL')[_0x9aeb('0x48')](_0x9aeb('0xae'),_0x5f5682['CmListId'][_0x9aeb('0xac')]())[_0x9aeb('0x48')](_0x9aeb('0xaf')))[_0x9aeb('0xac')]();}_0x56171a[_0x9aeb('0x9b')](db['sequelize'][_0x9aeb('0x45')](_0x44aecf));}return BPromise[_0x9aeb('0x93')](_0x56171a);}})[_0x9aeb('0x37')](function(){return _0x2f39b5;})[_0x9aeb('0x37')](respondWithResult(_0x103868,null))[_0x9aeb('0x4f')](handleError(_0x103868,null));};exports[_0x9aeb('0xb6')]=function(_0x43d89c,_0x1dd85c,_0x4b9737){return db[_0x9aeb('0x4c')]['find']({'where':{'id':_0x43d89c[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x1dd85c,null))[_0x9aeb('0x37')](function(_0x17c379){if(_0x17c379){return _0x17c379['removeLists'](_0x43d89c['query']['ids']);}})['then'](function(_0x38dbfd){if(_0x38dbfd){return db[_0x9aeb('0x66')][_0x9aeb('0x2a')]({'where':{'ListId':_0x43d89c['query'][_0x9aeb('0x84')],'VoiceQueueId':_0x43d89c[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](function(){return _0x38dbfd;});}})[_0x9aeb('0x37')](respondWithStatusCode(_0x1dd85c,null))['catch'](handleError(_0x1dd85c,null));};exports[_0x9aeb('0xb7')]=function(_0x4f66e6,_0x4c5b44,_0x89c811){var _0x512b9e={};var _0x4d1fcc={};var _0x47df18;var _0x40dc35;return db[_0x9aeb('0x4c')][_0x9aeb('0x69')]({'where':{'id':_0x4f66e6[_0x9aeb('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c5b44,null))[_0x9aeb('0x37')](function(_0x18d5f4){if(_0x18d5f4){_0x47df18=_0x18d5f4;_0x4d1fcc['model']=_['keys'](db[_0x9aeb('0xb8')][_0x9aeb('0x3d')]);_0x4d1fcc[_0x9aeb('0x45')]=_['keys'](_0x4f66e6[_0x9aeb('0x45')]);_0x4d1fcc[_0x9aeb('0x40')]=_['intersection'](_0x4d1fcc[_0x9aeb('0x3f')],_0x4d1fcc['query']);_0x512b9e[_0x9aeb('0x41')]=_[_0x9aeb('0x53')](_0x4d1fcc[_0x9aeb('0x3f')],qs[_0x9aeb('0x42')](_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x42')]));_0x512b9e[_0x9aeb('0x41')]=_0x512b9e[_0x9aeb('0x41')][_0x9aeb('0x43')]?_0x512b9e[_0x9aeb('0x41')]:_0x4d1fcc['model'];_0x512b9e['order']=qs['sort'](_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x47')]);_0x512b9e['where']=qs[_0x9aeb('0x40')](_[_0x9aeb('0x49')](_0x4f66e6[_0x9aeb('0x45')],_0x4d1fcc[_0x9aeb('0x40')]));if(_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x2f')]){_0x512b9e['where']=_[_0x9aeb('0x4a')](_0x512b9e[_0x9aeb('0x48')],{'$or':_['map'](_0x512b9e[_0x9aeb('0x41')],function(_0x57c9ea){var _0x47c921={};_0x47c921[_0x57c9ea]={'$like':'%'+_0x4f66e6['query'][_0x9aeb('0x2f')]+'%'};return _0x47c921;})});}_0x512b9e=_['merge']({},_0x512b9e,_0x4f66e6[_0x9aeb('0x4b')]);return _0x47df18[_0x9aeb('0xb7')](_0x512b9e);}})[_0x9aeb('0x37')](function(_0x4305d6){if(_0x4305d6){_0x40dc35=_0x4305d6[_0x9aeb('0x43')];if(!_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x67')]('nolimit')){_0x512b9e[_0x9aeb('0x23')]=qs['limit'](_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x23')]);_0x512b9e['offset']=qs[_0x9aeb('0x21')](_0x4f66e6[_0x9aeb('0x45')][_0x9aeb('0x21')]);}return _0x47df18[_0x9aeb('0xb7')](_0x512b9e);}})[_0x9aeb('0x37')](function(_0x5a761f){if(_0x5a761f){return _0x5a761f?{'count':_0x40dc35,'rows':_0x5a761f}:null;}})[_0x9aeb('0x37')](respondWithResult(_0x4c5b44,null))[_0x9aeb('0x4f')](handleError(_0x4c5b44,null));};exports[_0x9aeb('0xb9')]=function(_0x52687f,_0x3b94fb,_0x46cad9){var _0x1f08d2,_0x2493d9;return db['VoiceQueue'][_0x9aeb('0x35')]({'where':{'id':_0x52687f[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x3b94fb,null))[_0x9aeb('0x37')](function(_0x463225){if(_0x463225){_0x2493d9=_0x463225;return _0x463225[_0x9aeb('0xb9')](_0x52687f[_0x9aeb('0x55')][_0x9aeb('0x84')],_[_0x9aeb('0x62')](_0x52687f[_0x9aeb('0x55')],[_0x9aeb('0x84'),'id'])||{});}return null;})['spread'](function(_0x526586){var _0x3bde00;_0x1f08d2=_0x526586||[];var _0x3f74cd=[];if(_0x526586){for(var _0x58da3c=0x0;_0x58da3c<_0x526586[_0x9aeb('0x43')];_0x58da3c+=0x1){var _0xad2d4a=_0x526586[_0x58da3c]['get']({'plain':!![]});_0x3bde00=squel[_0x9aeb('0xa2')]()[_0x9aeb('0xa3')]('cm_hopper_black')[_0x9aeb('0xa4')]([_0x9aeb('0xa5'),_0x9aeb('0xa7'),'ListId','VoiceQueueId',_0x9aeb('0x60'),_0x9aeb('0x61')],squel[_0x9aeb('0x86')]()[_0x9aeb('0xa9')](_0x9aeb('0xa5'),_0x9aeb('0xa5'))[_0x9aeb('0xa9')]('id','ContactId')['field'](_0xad2d4a[_0x9aeb('0xab')][_0x9aeb('0xac')](),_0x9aeb('0xa8'))[_0x9aeb('0xa9')](_0x52687f[_0x9aeb('0x51')]['id'][_0x9aeb('0xac')](),'VoiceQueueId')[_0x9aeb('0xa9')](_0x9aeb('0xaa'),_0x9aeb('0x60'))[_0x9aeb('0xa9')]('NOW()','updatedAt')[_0x9aeb('0x88')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x9aeb('0x48')](_0x9aeb('0xae'),_0xad2d4a[_0x9aeb('0xab')][_0x9aeb('0xac')]())[_0x9aeb('0x48')](_0x9aeb('0xaf')))[_0x9aeb('0xac')]();_0x3f74cd['push'](db['sequelize'][_0x9aeb('0x45')](_0x3bde00));}return BPromise['all'](_0x3f74cd);}})[_0x9aeb('0x37')](function(){return _0x1f08d2;})[_0x9aeb('0x37')](respondWithResult(_0x3b94fb,null))[_0x9aeb('0x4f')](handleError(_0x3b94fb,null));};exports[_0x9aeb('0xba')]=function(_0x5c1f6b,_0x2938bc,_0x16cda3){return db[_0x9aeb('0x4c')][_0x9aeb('0x35')]({'where':{'id':_0x5c1f6b[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](handleEntityNotFound(_0x2938bc,null))[_0x9aeb('0x37')](function(_0x1adf8b){if(_0x1adf8b){return _0x1adf8b[_0x9aeb('0xba')](_0x5c1f6b['query'][_0x9aeb('0x84')]);}})[_0x9aeb('0x37')](function(_0x2d8ae1){if(_0x2d8ae1){return db[_0x9aeb('0x6d')][_0x9aeb('0x2a')]({'where':{'ListId':_0x5c1f6b[_0x9aeb('0x45')]['ids'],'VoiceQueueId':_0x5c1f6b[_0x9aeb('0x51')]['id']}})[_0x9aeb('0x37')](function(){return _0x2d8ae1;});}})[_0x9aeb('0x37')](respondWithStatusCode(_0x2938bc,null))[_0x9aeb('0x4f')](handleError(_0x2938bc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 565dbaa..a2c7fc2 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 _0xf7de=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue'];(function(_0x425be1,_0x1a6dc3){var _0x311d0a=function(_0x21310d){while(--_0x21310d){_0x425be1['push'](_0x425be1['shift']());}};_0x311d0a(++_0x1a6dc3);}(_0xf7de,0x14d));var _0xef7d=function(_0x4e8f8b,_0x5c7b1d){_0x4e8f8b=_0x4e8f8b-0x0;var _0x7f6ee8=_0xf7de[_0x4e8f8b];return _0x7f6ee8;};'use strict';var EventEmitter=require(_0xef7d('0x0'));var VoiceQueue=require(_0xef7d('0x1'))['db'][_0xef7d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xef7d('0x3')};function emitEvent(_0x2ed9cd){return function(_0x253b7b,_0x2a2e69,_0x9cd684){VoiceQueueEvents[_0xef7d('0x4')](_0x2ed9cd+':'+_0x253b7b['id'],_0x253b7b);VoiceQueueEvents[_0xef7d('0x4')](_0x2ed9cd,_0x253b7b);_0x9cd684(null);};}for(var e in events){if(events[_0xef7d('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xef7d('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xfec1=['../../mysqldb','VoiceQueue','setMaxListeners','hook','exports','events'];(function(_0x3f1f55,_0x1b5248){var _0xf396a2=function(_0x33fea6){while(--_0x33fea6){_0x3f1f55['push'](_0x3f1f55['shift']());}};_0xf396a2(++_0x1b5248);}(_0xfec1,0xe3));var _0x1fec=function(_0x5c55dd,_0x3cd260){_0x5c55dd=_0x5c55dd-0x0;var _0x3521fc=_0xfec1[_0x5c55dd];return _0x3521fc;};'use strict';var EventEmitter=require(_0x1fec('0x0'));var VoiceQueue=require(_0x1fec('0x1'))['db'][_0x1fec('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1fec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1873a4){return function(_0x13b493,_0x387e2d,_0x4f8e4e){VoiceQueueEvents['emit'](_0x1873a4+':'+_0x13b493['id'],_0x13b493);VoiceQueueEvents['emit'](_0x1873a4,_0x13b493);_0x4f8e4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1fec('0x4')](e,emitEvent(event));}}module[_0x1fec('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3d06321..f824dbb 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x55ca,0x126));var _0xa55c=function(_0xc2e46e,_0x3b979c){_0xc2e46e=_0xc2e46e-0x0;var _0x1a355d=_0x55ca[_0xc2e46e];return _0x1a355d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x245160,_0x579698){var _0x10d003=function(_0x264f2e){while(--_0x264f2e){_0x245160['push'](_0x245160['shift']());}};_0x10d003(++_0x579698);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 93d284d..76e3485 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 _0xb2aa=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','GetVoiceQueue','debug','find','ShowVoiceQueue','lodash','util','bluebird'];(function(_0x256605,_0x1ac03d){var _0x4fac8a=function(_0xe6a1f2){while(--_0xe6a1f2){_0x256605['push'](_0x256605['shift']());}};_0x4fac8a(++_0x1ac03d);}(_0xb2aa,0x197));var _0xab2a=function(_0xfc1591,_0x4db45e){_0xfc1591=_0xfc1591-0x0;var _0x55c8e5=_0xb2aa[_0xfc1591];return _0x55c8e5;};'use strict';var _=require(_0xab2a('0x0'));var util=require(_0xab2a('0x1'));var moment=require('moment');var BPromise=require(_0xab2a('0x2'));var rs=require(_0xab2a('0x3'));var fs=require('fs');var Redis=require(_0xab2a('0x4'));var db=require(_0xab2a('0x5'))['db'];var utils=require(_0xab2a('0x6'));var logger=require(_0xab2a('0x7'))(_0xab2a('0x8'));var config=require(_0xab2a('0x9'));var jayson=require(_0xab2a('0xa'));var client=jayson['client'][_0xab2a('0xb')]({'port':0x232a});config[_0xab2a('0xc')]=_[_0xab2a('0xd')](config[_0xab2a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab2a('0xc')]));require(_0xab2a('0xe'))[_0xab2a('0xf')](socket);function respondWithRpcPromise(_0x9981c8,_0x2cdfa7,_0x2ccd1c){return new BPromise(function(_0x2181b0,_0x8cacc7){return client[_0xab2a('0x10')](_0x9981c8,_0x2ccd1c)[_0xab2a('0x11')](function(_0x14fa47){logger['info'](_0xab2a('0x12'),_0x2cdfa7,_0xab2a('0x13'));logger['debug'](_0xab2a('0x14'),_0x2cdfa7,_0xab2a('0x13'),JSON[_0xab2a('0x15')](_0x14fa47));if(_0x14fa47['error']){if(_0x14fa47[_0xab2a('0x16')]['code']===0x1f4){logger['error'](_0xab2a('0x12'),_0x2cdfa7,_0x14fa47[_0xab2a('0x16')]['message']);return _0x8cacc7(_0x14fa47[_0xab2a('0x16')][_0xab2a('0x17')]);}logger[_0xab2a('0x16')](_0xab2a('0x12'),_0x2cdfa7,_0x14fa47['error']['message']);return _0x2181b0(_0x14fa47['error'][_0xab2a('0x17')]);}else{logger['info'](_0xab2a('0x12'),_0x2cdfa7,_0xab2a('0x13'));_0x2181b0(_0x14fa47[_0xab2a('0x18')]['message']);}})[_0xab2a('0x19')](function(_0x194309){logger[_0xab2a('0x16')](_0xab2a('0x12'),_0x2cdfa7,_0x194309);_0x8cacc7(_0x194309);});});}exports['GetVoiceQueue']=function(_0x2504dc){var _0x51ab65=this;return new Promise(function(_0x4e0ae7,_0x2814fc){return db[_0xab2a('0x1a')][_0xab2a('0x1b')]({'raw':_0x2504dc['options']?_0x2504dc[_0xab2a('0x1c')][_0xab2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x2504dc[_0xab2a('0x1c')]?_0x2504dc[_0xab2a('0x1c')][_0xab2a('0x1e')]||null:null,'attributes':_0x2504dc[_0xab2a('0x1c')]?_0x2504dc[_0xab2a('0x1c')][_0xab2a('0x1f')]||null:null,'limit':_0x2504dc[_0xab2a('0x1c')]?_0x2504dc['options'][_0xab2a('0x20')]||null:null,'include':_0x2504dc[_0xab2a('0x1c')]?_0x2504dc[_0xab2a('0x1c')][_0xab2a('0x21')]?_[_0xab2a('0x22')](_0x2504dc['options'][_0xab2a('0x21')],function(_0x582339){return{'model':db[_0x582339[_0xab2a('0x23')]],'as':_0x582339['as'],'attributes':_0x582339[_0xab2a('0x1f')],'include':_0x582339['include']?_[_0xab2a('0x22')](_0x582339[_0xab2a('0x21')],function(_0x36fca3){return{'model':db[_0x36fca3['model']],'as':_0x36fca3['as'],'attributes':_0x36fca3[_0xab2a('0x1f')],'include':_0x36fca3['include']?_[_0xab2a('0x22')](_0x36fca3[_0xab2a('0x21')],function(_0x8d4e93){return{'model':db[_0x8d4e93[_0xab2a('0x23')]],'as':_0x8d4e93['as'],'attributes':_0x8d4e93[_0xab2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xab2a('0x11')](function(_0x19b572){logger[_0xab2a('0x24')](_0xab2a('0x25'),_0x2504dc);logger[_0xab2a('0x26')](_0xab2a('0x25'),_0x2504dc,JSON['stringify'](_0x19b572));_0x4e0ae7(_0x19b572);})[_0xab2a('0x19')](function(_0x233aee){logger[_0xab2a('0x16')](_0xab2a('0x25'),_0x233aee[_0xab2a('0x17')],_0x2504dc);_0x2814fc(_0x51ab65[_0xab2a('0x16')](0x1f4,_0x233aee[_0xab2a('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x109b3d){var _0x2f1e91=this;return new Promise(function(_0x15dcef,_0x4b96c1){return db[_0xab2a('0x1a')][_0xab2a('0x27')]({'raw':_0x109b3d[_0xab2a('0x1c')]?_0x109b3d[_0xab2a('0x1c')][_0xab2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x109b3d[_0xab2a('0x1c')]?_0x109b3d[_0xab2a('0x1c')][_0xab2a('0x1e')]||null:null,'attributes':_0x109b3d[_0xab2a('0x1c')]?_0x109b3d['options'][_0xab2a('0x1f')]||null:null,'include':_0x109b3d[_0xab2a('0x1c')]?_0x109b3d[_0xab2a('0x1c')][_0xab2a('0x21')]?_['map'](_0x109b3d['options'][_0xab2a('0x21')],function(_0x53f6b2){return{'model':db[_0x53f6b2[_0xab2a('0x23')]],'as':_0x53f6b2['as'],'attributes':_0x53f6b2[_0xab2a('0x1f')],'include':_0x53f6b2[_0xab2a('0x21')]?_[_0xab2a('0x22')](_0x53f6b2[_0xab2a('0x21')],function(_0x1f5026){return{'model':db[_0x1f5026[_0xab2a('0x23')]],'as':_0x1f5026['as'],'attributes':_0x1f5026['attributes'],'include':_0x1f5026[_0xab2a('0x21')]?_[_0xab2a('0x22')](_0x1f5026['include'],function(_0x59be5e){return{'model':db[_0x59be5e[_0xab2a('0x23')]],'as':_0x59be5e['as'],'attributes':_0x59be5e['attributes']};}):[]};}):[]};}):[]:[]})[_0xab2a('0x11')](function(_0x438127){logger[_0xab2a('0x24')](_0xab2a('0x28'),_0x109b3d);logger[_0xab2a('0x26')](_0xab2a('0x28'),_0x109b3d,JSON[_0xab2a('0x15')](_0x438127));_0x15dcef(_0x438127);})[_0xab2a('0x19')](function(_0x56b1db){logger[_0xab2a('0x16')](_0xab2a('0x28'),_0x56b1db[_0xab2a('0x17')],_0x109b3d);_0x4b96c1(_0x2f1e91['error'](0x1f4,_0x56b1db[_0xab2a('0x17')]));});});}; \ No newline at end of file +var _0x6af6=['raw','where','attributes','limit','map','include','model','info','ShowVoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x5d6bd7,_0x48aae8){var _0x3c3610=function(_0xb4272c){while(--_0xb4272c){_0x5d6bd7['push'](_0x5d6bd7['shift']());}};_0x3c3610(++_0x48aae8);}(_0x6af6,0xa6));var _0x66af=function(_0x4c70c8,_0x2d14b1){_0x4c70c8=_0x4c70c8-0x0;var _0x15c171=_0x6af6[_0x4c70c8];return _0x15c171;};'use strict';var _=require(_0x66af('0x0'));var util=require(_0x66af('0x1'));var moment=require(_0x66af('0x2'));var BPromise=require(_0x66af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66af('0x4'));var db=require(_0x66af('0x5'))['db'];var utils=require(_0x66af('0x6'));var logger=require('../../config/logger')(_0x66af('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x66af('0x8')][_0x66af('0x9')]({'port':0x232a});config[_0x66af('0xa')]=_['defaults'](config['redis'],{'host':_0x66af('0xb'),'port':0x18eb});var socket=require(_0x66af('0xc'))(new Redis(config[_0x66af('0xa')]));require(_0x66af('0xd'))[_0x66af('0xe')](socket);function respondWithRpcPromise(_0x1aafbd,_0x321450,_0x22a0ae){return new BPromise(function(_0x15f492,_0x570968){return client['request'](_0x1aafbd,_0x22a0ae)[_0x66af('0xf')](function(_0x64cb3a){logger['info'](_0x66af('0x10'),_0x321450,_0x66af('0x11'));logger[_0x66af('0x12')](_0x66af('0x13'),_0x321450,'request\x20sent',JSON[_0x66af('0x14')](_0x64cb3a));if(_0x64cb3a['error']){if(_0x64cb3a[_0x66af('0x15')]['code']===0x1f4){logger[_0x66af('0x15')](_0x66af('0x10'),_0x321450,_0x64cb3a[_0x66af('0x15')]['message']);return _0x570968(_0x64cb3a[_0x66af('0x15')][_0x66af('0x16')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x321450,_0x64cb3a[_0x66af('0x15')][_0x66af('0x16')]);return _0x15f492(_0x64cb3a[_0x66af('0x15')][_0x66af('0x16')]);}else{logger['info'](_0x66af('0x10'),_0x321450,_0x66af('0x11'));_0x15f492(_0x64cb3a[_0x66af('0x17')][_0x66af('0x16')]);}})[_0x66af('0x18')](function(_0x596593){logger['error'](_0x66af('0x10'),_0x321450,_0x596593);_0x570968(_0x596593);});});}exports[_0x66af('0x19')]=function(_0x4b72ed){var _0x2b7182=this;return new Promise(function(_0x5baa7f,_0x41bc4f){return db[_0x66af('0x1a')][_0x66af('0x1b')]({'raw':_0x4b72ed[_0x66af('0x1c')]?_0x4b72ed['options'][_0x66af('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b72ed[_0x66af('0x1c')]?_0x4b72ed[_0x66af('0x1c')][_0x66af('0x1e')]||null:null,'attributes':_0x4b72ed[_0x66af('0x1c')]?_0x4b72ed[_0x66af('0x1c')][_0x66af('0x1f')]||null:null,'limit':_0x4b72ed['options']?_0x4b72ed[_0x66af('0x1c')][_0x66af('0x20')]||null:null,'include':_0x4b72ed['options']?_0x4b72ed[_0x66af('0x1c')]['include']?_[_0x66af('0x21')](_0x4b72ed['options'][_0x66af('0x22')],function(_0x53ea07){return{'model':db[_0x53ea07[_0x66af('0x23')]],'as':_0x53ea07['as'],'attributes':_0x53ea07['attributes'],'include':_0x53ea07[_0x66af('0x22')]?_['map'](_0x53ea07[_0x66af('0x22')],function(_0x4342c1){return{'model':db[_0x4342c1[_0x66af('0x23')]],'as':_0x4342c1['as'],'attributes':_0x4342c1['attributes'],'include':_0x4342c1[_0x66af('0x22')]?_['map'](_0x4342c1[_0x66af('0x22')],function(_0x84e9c){return{'model':db[_0x84e9c['model']],'as':_0x84e9c['as'],'attributes':_0x84e9c[_0x66af('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x66af('0xf')](function(_0x3e02fa){logger[_0x66af('0x24')](_0x66af('0x19'),_0x4b72ed);logger[_0x66af('0x12')](_0x66af('0x19'),_0x4b72ed,JSON[_0x66af('0x14')](_0x3e02fa));_0x5baa7f(_0x3e02fa);})[_0x66af('0x18')](function(_0x59cb5e){logger[_0x66af('0x15')](_0x66af('0x19'),_0x59cb5e[_0x66af('0x16')],_0x4b72ed);_0x41bc4f(_0x2b7182[_0x66af('0x15')](0x1f4,_0x59cb5e[_0x66af('0x16')]));});});};exports[_0x66af('0x25')]=function(_0x181cb1){var _0x2869d1=this;return new Promise(function(_0x3c5cc7,_0x458e8f){return db[_0x66af('0x1a')][_0x66af('0x26')]({'raw':_0x181cb1['options']?_0x181cb1[_0x66af('0x1c')][_0x66af('0x1d')]===undefined?!![]:![]:!![],'where':_0x181cb1[_0x66af('0x1c')]?_0x181cb1[_0x66af('0x1c')][_0x66af('0x1e')]||null:null,'attributes':_0x181cb1[_0x66af('0x1c')]?_0x181cb1['options']['attributes']||null:null,'include':_0x181cb1[_0x66af('0x1c')]?_0x181cb1[_0x66af('0x1c')]['include']?_[_0x66af('0x21')](_0x181cb1[_0x66af('0x1c')]['include'],function(_0x191f44){return{'model':db[_0x191f44[_0x66af('0x23')]],'as':_0x191f44['as'],'attributes':_0x191f44[_0x66af('0x1f')],'include':_0x191f44[_0x66af('0x22')]?_[_0x66af('0x21')](_0x191f44['include'],function(_0x55c2ca){return{'model':db[_0x55c2ca['model']],'as':_0x55c2ca['as'],'attributes':_0x55c2ca[_0x66af('0x1f')],'include':_0x55c2ca[_0x66af('0x22')]?_[_0x66af('0x21')](_0x55c2ca[_0x66af('0x22')],function(_0x157e4e){return{'model':db[_0x157e4e['model']],'as':_0x157e4e['as'],'attributes':_0x157e4e[_0x66af('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x66af('0xf')](function(_0x73383c){logger[_0x66af('0x24')](_0x66af('0x25'),_0x181cb1);logger[_0x66af('0x12')](_0x66af('0x25'),_0x181cb1,JSON['stringify'](_0x73383c));_0x3c5cc7(_0x73383c);})[_0x66af('0x18')](function(_0x57d66c){logger[_0x66af('0x15')](_0x66af('0x25'),_0x57d66c['message'],_0x181cb1);_0x458e8f(_0x2869d1[_0x66af('0x15')](0x1f4,_0x57d66c[_0x66af('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 3871895..1d86815 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 _0xe2b2=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xe2b2,0x177));var _0x2e2b=function(_0x159cc0,_0x21d3a3){_0x159cc0=_0x159cc0-0x0;var _0x1adf28=_0xe2b2[_0x159cc0];return _0x1adf28;};'use strict';var VoiceQueueEvents=require(_0x2e2b('0x0'));var events=['save',_0x2e2b('0x1'),_0x2e2b('0x2')];function createListener(_0x27d2a5,_0x3910cc){return function(_0x389d56){_0x3910cc[_0x2e2b('0x3')](_0x27d2a5,_0x389d56);};}function removeListener(_0x109902,_0x16e71c){return function(){VoiceQueueEvents[_0x2e2b('0x4')](_0x109902,_0x16e71c);};}exports[_0x2e2b('0x5')]=function(_0x1a5ae2){for(var _0x317d79=0x0,_0x11c685=events[_0x2e2b('0x6')];_0x317d79<_0x11c685;_0x317d79++){var _0x45db70=events[_0x317d79];var _0x2fee45=createListener(_0x2e2b('0x7')+_0x45db70,_0x1a5ae2);VoiceQueueEvents['on'](_0x45db70,_0x2fee45);}}; \ No newline at end of file +var _0xe49f=['voiceQueue:','./voiceQueue.events','remove','update','emit','removeListener','length'];(function(_0x1cac95,_0x2bf3e3){var _0x2698cb=function(_0x29cc12){while(--_0x29cc12){_0x1cac95['push'](_0x1cac95['shift']());}};_0x2698cb(++_0x2bf3e3);}(_0xe49f,0x135));var _0xfe49=function(_0x595c6d,_0x57a235){_0x595c6d=_0x595c6d-0x0;var _0x16ec5c=_0xe49f[_0x595c6d];return _0x16ec5c;};'use strict';var VoiceQueueEvents=require(_0xfe49('0x0'));var events=['save',_0xfe49('0x1'),_0xfe49('0x2')];function createListener(_0x43c5e8,_0x44e347){return function(_0xeca306){_0x44e347[_0xfe49('0x3')](_0x43c5e8,_0xeca306);};}function removeListener(_0x38ce49,_0x43946d){return function(){VoiceQueueEvents[_0xfe49('0x4')](_0x38ce49,_0x43946d);};}exports['register']=function(_0x3c0e7b){for(var _0x519cc7=0x0,_0x144d2f=events[_0xfe49('0x5')];_0x519cc7<_0x144d2f;_0x519cc7++){var _0x4ae387=events[_0x519cc7];var _0x12f664=createListener(_0xfe49('0x6')+_0x4ae387,_0x3c0e7b);VoiceQueueEvents['on'](_0x4ae387,_0x12f664);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 936af2c..a7801e4 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 _0x04fc=['index','describe','/index','isAuthenticated','getVoiceQueuesReport','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x187ee1,_0x486fdd){var _0x174752=function(_0xd96a00){while(--_0xd96a00){_0x187ee1['push'](_0x187ee1['shift']());}};_0x174752(++_0x486fdd);}(_0x04fc,0x65));var _0xc04f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x04fc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var path=require(_0xc04f('0x2'));var timeout=require(_0xc04f('0x3'));var express=require('express');var router=express[_0xc04f('0x4')]();var fs_extra=require(_0xc04f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc04f('0x6'));var controller=require(_0xc04f('0x7'));router[_0xc04f('0x8')]('/',auth['isAuthenticated'](),controller[_0xc04f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc04f('0xa')]);router[_0xc04f('0x8')](_0xc04f('0xb'),auth[_0xc04f('0xc')](),controller[_0xc04f('0xd')]);router[_0xc04f('0x8')]('/:id',auth[_0xc04f('0xc')](),controller['show']);router[_0xc04f('0xe')]('/',auth['isAuthenticated'](),controller[_0xc04f('0xf')]);router[_0xc04f('0x10')]('/:id',auth[_0xc04f('0xc')](),controller[_0xc04f('0x11')]);router[_0xc04f('0x12')](_0xc04f('0x13'),auth['isAuthenticated'](),controller[_0xc04f('0x14')]);module[_0xc04f('0x15')]=router; \ No newline at end of file +var _0xed32=['get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../config/environment','./voiceQueueReport.controller'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xed32,0x8e));var _0x2ed3=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xed32[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x2ed3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2ed3('0x1')]();var fs_extra=require(_0x2ed3('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2ed3('0x3'));var controller=require(_0x2ed3('0x4'));router[_0x2ed3('0x5')]('/',auth[_0x2ed3('0x6')](),controller[_0x2ed3('0x7')]);router[_0x2ed3('0x5')](_0x2ed3('0x8'),auth[_0x2ed3('0x6')](),controller[_0x2ed3('0x9')]);router['get'](_0x2ed3('0xa'),auth[_0x2ed3('0x6')](),controller[_0x2ed3('0xb')]);router[_0x2ed3('0x5')](_0x2ed3('0xc'),auth[_0x2ed3('0x6')](),controller[_0x2ed3('0xd')]);router[_0x2ed3('0xe')]('/',auth[_0x2ed3('0x6')](),controller[_0x2ed3('0xf')]);router[_0x2ed3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2ed3('0x11')]);router[_0x2ed3('0x12')]('/:id',auth[_0x2ed3('0x6')](),controller[_0x2ed3('0x13')]);module[_0x2ed3('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b41ce40..2f9e8b2 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 _0x7228=['moment','exports','STRING','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x2843fe,_0xcf349b){var _0x416645=function(_0x4deff7){while(--_0x4deff7){_0x2843fe['push'](_0x2843fe['shift']());}};_0x416645(++_0xcf349b);}(_0x7228,0x1b2));var _0x8722=function(_0x56eafe,_0x517064){_0x56eafe=_0x56eafe-0x0;var _0x464c94=_0x7228[_0x56eafe];return _0x464c94;};'use strict';var Sequelize=require(_0x8722('0x0'));var moment=require(_0x8722('0x1'));module[_0x8722('0x2')]={'type':{'type':Sequelize[_0x8722('0x3')]},'uniqueid':{'type':Sequelize[_0x8722('0x3')]},'calleridnum':{'type':Sequelize[_0x8722('0x3')]},'calleridname':{'type':Sequelize[_0x8722('0x3')]},'queue':{'type':Sequelize[_0x8722('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x544d1b){var _0x4ed643=moment(_0x544d1b);var _0x11bae2=moment(this[_0x8722('0x4')]('queuecallerjoinAt'))[_0x8722('0x5')](_0x8722('0x6'));var _0x25a151=_0x4ed643['diff'](_0x11bae2,_0x8722('0x7'));this[_0x8722('0x8')](_0x8722('0x9'),_0x544d1b);this[_0x8722('0x8')]('holdtime',_0x25a151||null);}},'position':{'type':Sequelize[_0x8722('0xa')]},'count':{'type':Sequelize[_0x8722('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x8722('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8722('0xc')]},'queuecallercomplete':{'type':Sequelize[_0x8722('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x8722('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x8722('0x3')],'comment':_0x8722('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x8722('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8722('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8722('0x3')]},'context':{'type':Sequelize[_0x8722('0x3')]},'exten':{'type':Sequelize[_0x8722('0x3')]},'priority':{'type':Sequelize[_0x8722('0x3')]},'holdtime':{'type':Sequelize[_0x8722('0xa')]},'mohtime':{'type':Sequelize[_0x8722('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8722('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8722('0x3')]},'transfer':{'type':Sequelize[_0x8722('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8722('0x3')],'comment':_0x8722('0xe')},'transferexten':{'type':Sequelize[_0x8722('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8722('0x3')]},'disposition':{'type':Sequelize[_0x8722('0x3')]},'secondDisposition':{'type':Sequelize[_0x8722('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5ffe=['STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x5ffe,0xb3));var _0xe5ff=function(_0x34fc6e,_0x562f03){_0x34fc6e=_0x34fc6e-0x0;var _0x243a35=_0x5ffe[_0x34fc6e];return _0x243a35;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe5ff('0x0'));module['exports']={'type':{'type':Sequelize[_0xe5ff('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe5ff('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xe5ff('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xe5ff('0x2')],'set':function(_0x479f38){var _0x52987a=moment(_0x479f38);var _0x3a494d=moment(this['getDataValue'](_0xe5ff('0x3')))['format'](_0xe5ff('0x4'));var _0x57c623=_0x52987a['diff'](_0x3a494d,_0xe5ff('0x5'));this['setDataValue']('queuecallerleaveAt',_0x479f38);this[_0xe5ff('0x6')](_0xe5ff('0x7'),_0x57c623||null);}},'position':{'type':Sequelize[_0xe5ff('0x8')]},'count':{'type':Sequelize[_0xe5ff('0x8')]},'queuecallerabandon':{'type':Sequelize[_0xe5ff('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe5ff('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xe5ff('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe5ff('0x2')]},'queuecallerexit':{'type':Sequelize[_0xe5ff('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xe5ff('0x1')],'comment':_0xe5ff('0xa')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe5ff('0x1')]},'connectedlinename':{'type':Sequelize[_0xe5ff('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe5ff('0x1')]},'exten':{'type':Sequelize[_0xe5ff('0x1')]},'priority':{'type':Sequelize[_0xe5ff('0x1')]},'holdtime':{'type':Sequelize[_0xe5ff('0x8')]},'mohtime':{'type':Sequelize[_0xe5ff('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe5ff('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe5ff('0x1')]},'transfer':{'type':Sequelize[_0xe5ff('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xe5ff('0xb')},'transferexten':{'type':Sequelize[_0xe5ff('0x1')]},'transferuniqueid':{'type':Sequelize[_0xe5ff('0x1')]},'disposition':{'type':Sequelize[_0xe5ff('0x1')]},'secondDisposition':{'type':Sequelize[_0xe5ff('0x1')]},'thirdDisposition':{'type':Sequelize[_0xe5ff('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xe5ff('0x8')],'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 5c55495..06c6444 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 _0xcf69=['catch','create','update','body','describe','getVoiceQueuesReport','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','index','map','VoiceQueueReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','include','findAll','rows','show','params','keys','rawAttributes'];(function(_0xf844f9,_0xe346){var _0x28df69=function(_0x2b723c){while(--_0x2b723c){_0xf844f9['push'](_0xf844f9['shift']());}};_0x28df69(++_0xe346);}(_0xcf69,0x1a1));var _0x9cf6=function(_0x49f42e,_0x4a370d){_0x49f42e=_0x49f42e-0x0;var _0xbb9128=_0xcf69[_0x49f42e];return _0xbb9128;};'use strict';var emlformat=require(_0x9cf6('0x0'));var rimraf=require(_0x9cf6('0x1'));var zipdir=require(_0x9cf6('0x2'));var jsonpatch=require(_0x9cf6('0x3'));var rp=require(_0x9cf6('0x4'));var moment=require(_0x9cf6('0x5'));var BPromise=require(_0x9cf6('0x6'));var Mustache=require(_0x9cf6('0x7'));var util=require(_0x9cf6('0x8'));var path=require(_0x9cf6('0x9'));var sox=require(_0x9cf6('0xa'));var csv=require('to-csv');var ejs=require(_0x9cf6('0xb'));var fs=require('fs');var fs_extra=require(_0x9cf6('0xc'));var _=require(_0x9cf6('0xd'));var squel=require('squel');var crypto=require(_0x9cf6('0xe'));var jsforce=require(_0x9cf6('0xf'));var deskjs=require(_0x9cf6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cf6('0x11'));var Redis=require(_0x9cf6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9cf6('0x13'));var as=require(_0x9cf6('0x14'));var hardwareService=require(_0x9cf6('0x15'));var logger=require(_0x9cf6('0x16'))(_0x9cf6('0x17'));var utils=require(_0x9cf6('0x18'));var config=require(_0x9cf6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9cf6('0x1a'))['db'];config[_0x9cf6('0x1b')]=_[_0x9cf6('0x1c')](config[_0x9cf6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9cf6('0x1d'))[_0x9cf6('0x1e')](socket);function respondWithStatusCode(_0x161b9c,_0xeb35fb){_0xeb35fb=_0xeb35fb||0xcc;return function(_0x2a11b9){if(_0x2a11b9){return _0x161b9c[_0x9cf6('0x1f')](_0xeb35fb);}return _0x161b9c['status'](_0xeb35fb)[_0x9cf6('0x20')]();};}function respondWithResult(_0x5e144c,_0x47ff03){_0x47ff03=_0x47ff03||0xc8;return function(_0x33ac71){if(_0x33ac71){return _0x5e144c[_0x9cf6('0x21')](_0x47ff03)[_0x9cf6('0x22')](_0x33ac71);}};}function respondWithFilteredResult(_0x39cccf,_0x30c58a){return function(_0x41618e){if(_0x41618e){var _0x52c14c=typeof _0x30c58a[_0x9cf6('0x23')]==='undefined'&&typeof _0x30c58a[_0x9cf6('0x24')]===_0x9cf6('0x25');var _0x2bb503=_0x41618e[_0x9cf6('0x26')];var _0x468b62=_0x52c14c?0x0:_0x30c58a[_0x9cf6('0x23')];var _0x2ad363=_0x52c14c?_0x41618e['count']:_0x30c58a[_0x9cf6('0x23')]+_0x30c58a['limit'];var _0x38ace4;if(_0x2ad363>=_0x2bb503){_0x2ad363=_0x2bb503;_0x38ace4=0xc8;}else{_0x38ace4=0xce;}_0x39cccf[_0x9cf6('0x21')](_0x38ace4);return _0x39cccf[_0x9cf6('0x27')](_0x9cf6('0x28'),_0x468b62+'-'+_0x2ad363+'/'+_0x2bb503)['json'](_0x41618e);}return null;};}function patchUpdates(_0x280664){return function(_0x472a16){try{jsonpatch['apply'](_0x472a16,_0x280664,!![]);}catch(_0x2fa433){return BPromise[_0x9cf6('0x29')](_0x2fa433);}return _0x472a16[_0x9cf6('0x2a')]();};}function saveUpdates(_0x1ee1d6,_0x4e016b){return function(_0x284149){if(_0x284149){return _0x284149['update'](_0x1ee1d6)[_0x9cf6('0x2b')](function(_0xe3f2fa){return _0xe3f2fa;});}return null;};}function removeEntity(_0x50acdd,_0x5a69d7){return function(_0x57b3b3){if(_0x57b3b3){return _0x57b3b3[_0x9cf6('0x2c')]()['then'](function(){_0x50acdd['status'](0xcc)[_0x9cf6('0x20')]();});}};}function handleEntityNotFound(_0x17528a,_0x4e1884){return function(_0xd5e315){if(!_0xd5e315){_0x17528a[_0x9cf6('0x1f')](0x194);}return _0xd5e315;};}function handleError(_0xefad9b,_0x32fbf6){_0x32fbf6=_0x32fbf6||0x1f4;return function(_0x144e06){logger[_0x9cf6('0x2d')](_0x144e06['stack']);if(_0x144e06[_0x9cf6('0x2e')]){delete _0x144e06[_0x9cf6('0x2e')];}_0xefad9b[_0x9cf6('0x21')](_0x32fbf6)['send'](_0x144e06);};}exports[_0x9cf6('0x2f')]=function(_0x1a13b1,_0x46e6c4){var _0x4c966d={},_0x3e9023={},_0x3c41df={'count':0x0,'rows':[]};var _0x102f20=_[_0x9cf6('0x30')](db[_0x9cf6('0x31')]['rawAttributes'],function(_0x378a5d){return{'name':_0x378a5d[_0x9cf6('0x32')],'type':_0x378a5d['type'][_0x9cf6('0x33')]};});_0x3e9023[_0x9cf6('0x34')]=_[_0x9cf6('0x30')](_0x102f20,_0x9cf6('0x2e'));_0x3e9023['query']=_['keys'](_0x1a13b1[_0x9cf6('0x35')]);_0x3e9023[_0x9cf6('0x36')]=_[_0x9cf6('0x37')](_0x3e9023[_0x9cf6('0x34')],_0x3e9023['query']);_0x4c966d[_0x9cf6('0x38')]=_[_0x9cf6('0x37')](_0x3e9023[_0x9cf6('0x34')],qs[_0x9cf6('0x39')](_0x1a13b1[_0x9cf6('0x35')][_0x9cf6('0x39')]));_0x4c966d[_0x9cf6('0x38')]=_0x4c966d['attributes'][_0x9cf6('0x3a')]?_0x4c966d[_0x9cf6('0x38')]:_0x3e9023[_0x9cf6('0x34')];if(!_0x1a13b1[_0x9cf6('0x35')][_0x9cf6('0x3b')](_0x9cf6('0x3c'))){_0x4c966d[_0x9cf6('0x24')]=qs[_0x9cf6('0x24')](_0x1a13b1['query'][_0x9cf6('0x24')]);_0x4c966d['offset']=qs['offset'](_0x1a13b1[_0x9cf6('0x35')][_0x9cf6('0x23')]);}_0x4c966d[_0x9cf6('0x3d')]=qs[_0x9cf6('0x3e')](_0x1a13b1['query'][_0x9cf6('0x3e')]);_0x4c966d[_0x9cf6('0x3f')]=qs[_0x9cf6('0x36')](_['pick'](_0x1a13b1['query'],_0x3e9023[_0x9cf6('0x36')]),_0x102f20);if(_0x1a13b1['query']['filter']){_0x4c966d[_0x9cf6('0x3f')]=_[_0x9cf6('0x40')](_0x4c966d[_0x9cf6('0x3f')],{'$or':_['map'](_0x102f20,function(_0x3d764f){if(_0x3d764f[_0x9cf6('0x41')]!=='VIRTUAL'){var _0x42c33f={};_0x42c33f[_0x3d764f[_0x9cf6('0x2e')]]={'$like':'%'+_0x1a13b1[_0x9cf6('0x35')][_0x9cf6('0x42')]+'%'};return _0x42c33f;}})});}_0x4c966d=_[_0x9cf6('0x40')]({},_0x4c966d,_0x1a13b1[_0x9cf6('0x43')]);var _0xe619c9={'where':_0x4c966d[_0x9cf6('0x3f')]};return db[_0x9cf6('0x31')]['count'](_0xe619c9)['then'](function(_0x17505c){_0x3c41df['count']=_0x17505c;if(_0x1a13b1[_0x9cf6('0x35')]['includeAll']){_0x4c966d[_0x9cf6('0x44')]=[{'all':!![]}];}return db[_0x9cf6('0x31')][_0x9cf6('0x45')](_0x4c966d);})[_0x9cf6('0x2b')](function(_0x31e31d){_0x3c41df[_0x9cf6('0x46')]=_0x31e31d;return _0x3c41df;})[_0x9cf6('0x2b')](respondWithFilteredResult(_0x46e6c4,_0x4c966d))['catch'](handleError(_0x46e6c4,null));};exports[_0x9cf6('0x47')]=function(_0x2b3bec,_0x4e67bb){var _0x3808eb={'raw':![],'where':{'id':_0x2b3bec[_0x9cf6('0x48')]['id']}},_0x1a114c={};_0x1a114c[_0x9cf6('0x34')]=_[_0x9cf6('0x49')](db[_0x9cf6('0x31')][_0x9cf6('0x4a')]);_0x1a114c[_0x9cf6('0x35')]=_['keys'](_0x2b3bec[_0x9cf6('0x35')]);_0x1a114c[_0x9cf6('0x36')]=_[_0x9cf6('0x37')](_0x1a114c[_0x9cf6('0x34')],_0x1a114c['query']);_0x3808eb[_0x9cf6('0x38')]=_[_0x9cf6('0x37')](_0x1a114c['model'],qs[_0x9cf6('0x39')](_0x2b3bec['query'][_0x9cf6('0x39')]));_0x3808eb[_0x9cf6('0x38')]=_0x3808eb['attributes'][_0x9cf6('0x3a')]?_0x3808eb[_0x9cf6('0x38')]:_0x1a114c[_0x9cf6('0x34')];if(_0x2b3bec[_0x9cf6('0x35')]['includeAll']){_0x3808eb[_0x9cf6('0x44')]=[{'all':!![]}];}_0x3808eb=_['merge']({},_0x3808eb,_0x2b3bec[_0x9cf6('0x43')]);return db[_0x9cf6('0x31')]['find'](_0x3808eb)['then'](handleEntityNotFound(_0x4e67bb,null))[_0x9cf6('0x2b')](respondWithResult(_0x4e67bb,null))[_0x9cf6('0x4b')](handleError(_0x4e67bb,null));};exports['create']=function(_0x207341,_0x3c035e){return db[_0x9cf6('0x31')][_0x9cf6('0x4c')](_0x207341['body'],{})[_0x9cf6('0x2b')](respondWithResult(_0x3c035e,0xc9))[_0x9cf6('0x4b')](handleError(_0x3c035e,null));};exports[_0x9cf6('0x4d')]=function(_0x34388b,_0x59ddfa){if(_0x34388b[_0x9cf6('0x4e')]['id']){delete _0x34388b['body']['id'];}return db[_0x9cf6('0x31')]['find']({'where':{'id':_0x34388b[_0x9cf6('0x48')]['id']}})[_0x9cf6('0x2b')](handleEntityNotFound(_0x59ddfa,null))[_0x9cf6('0x2b')](saveUpdates(_0x34388b[_0x9cf6('0x4e')],null))[_0x9cf6('0x2b')](respondWithResult(_0x59ddfa,null))[_0x9cf6('0x4b')](handleError(_0x59ddfa,null));};exports[_0x9cf6('0x2c')]=function(_0x2e3f33,_0x108811){return db[_0x9cf6('0x31')]['find']({'where':{'id':_0x2e3f33['params']['id']}})[_0x9cf6('0x2b')](handleEntityNotFound(_0x108811,null))['then'](removeEntity(_0x108811,null))[_0x9cf6('0x4b')](handleError(_0x108811,null));};exports[_0x9cf6('0x4f')]=function(_0x333132,_0x503f3c){return db[_0x9cf6('0x31')][_0x9cf6('0x4f')]()[_0x9cf6('0x2b')](respondWithResult(_0x503f3c,null))[_0x9cf6('0x4b')](handleError(_0x503f3c,null));};exports[_0x9cf6('0x50')]=function(_0x5d1eb5,_0x1327f3){var _0x628cd={},_0x4ff5b4={},_0x5137ad={'count':0x0,'rows':[]};_0x4ff5b4[_0x9cf6('0x34')]=_[_0x9cf6('0x49')](db[_0x9cf6('0x31')][_0x9cf6('0x4a')]);_0x4ff5b4[_0x9cf6('0x35')]=_[_0x9cf6('0x49')](_0x5d1eb5['query']);_0x4ff5b4[_0x9cf6('0x36')]=_[_0x9cf6('0x37')](_0x4ff5b4[_0x9cf6('0x34')],_0x4ff5b4[_0x9cf6('0x35')]);_0x628cd[_0x9cf6('0x38')]=_[_0x9cf6('0x37')](_0x4ff5b4[_0x9cf6('0x34')],qs[_0x9cf6('0x39')](_0x5d1eb5['query'][_0x9cf6('0x39')]));_0x628cd[_0x9cf6('0x38')]=_0x628cd['attributes']['length']?_0x628cd['attributes']:_0x4ff5b4[_0x9cf6('0x34')];if(!_0x5d1eb5[_0x9cf6('0x35')][_0x9cf6('0x3b')](_0x9cf6('0x3c'))){_0x628cd[_0x9cf6('0x24')]=qs[_0x9cf6('0x24')](_0x5d1eb5[_0x9cf6('0x35')][_0x9cf6('0x24')]);_0x628cd['offset']=qs[_0x9cf6('0x23')](_0x5d1eb5[_0x9cf6('0x35')][_0x9cf6('0x23')]);}_0x628cd[_0x9cf6('0x3d')]=qs[_0x9cf6('0x3e')](_0x5d1eb5['query'][_0x9cf6('0x3e')]);_0x628cd[_0x9cf6('0x3f')]=qs['filters'](_['pick'](_0x5d1eb5['query'],_0x4ff5b4['filters']));if(_0x5d1eb5['query'][_0x9cf6('0x42')]){_0x628cd[_0x9cf6('0x3f')]=_[_0x9cf6('0x40')](_0x628cd[_0x9cf6('0x3f')],{'$or':_['map'](_0x628cd['attributes'],function(_0x4edd12){var _0x5b5631={};_0x5b5631[_0x4edd12]={'$like':'%'+_0x5d1eb5[_0x9cf6('0x35')][_0x9cf6('0x42')]+'%'};return _0x5b5631;})});}_0x628cd=_[_0x9cf6('0x40')]({},_0x628cd,_0x5d1eb5['options']);var _0x3db9cd={'where':_0x628cd[_0x9cf6('0x3f')]};return db[_0x9cf6('0x31')][_0x9cf6('0x26')](_0x3db9cd)[_0x9cf6('0x2b')](function(_0x1ed88a){_0x5137ad[_0x9cf6('0x26')]=_0x1ed88a;if(_0x5d1eb5['query'][_0x9cf6('0x51')]){_0x628cd[_0x9cf6('0x44')]=[{'all':!![]}];}return db[_0x9cf6('0x31')][_0x9cf6('0x45')](_0x628cd);})[_0x9cf6('0x2b')](function(_0x12fe94){_0x5137ad[_0x9cf6('0x46')]=_0x12fe94;return _0x5137ad;})['then'](respondWithFilteredResult(_0x1327f3,_0x628cd,_0x9cf6('0x50')))[_0x9cf6('0x4b')](handleError(_0x1327f3,null,_0x9cf6('0x50')));}; \ No newline at end of file +var _0x9d3b=['squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','status','json','offset','undefined','count','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','index','map','VoiceQueueReport','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','body','find','describe','getVoiceQueuesReport','hasOwnProperty','order','options','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xc28f7b,_0x50d58e){var _0x6347d8=function(_0x3f412d){while(--_0x3f412d){_0xc28f7b['push'](_0xc28f7b['shift']());}};_0x6347d8(++_0x50d58e);}(_0x9d3b,0x90));var _0xb9d3=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x9d3b[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0xb9d3('0x0'));var rimraf=require(_0xb9d3('0x1'));var zipdir=require(_0xb9d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d3('0x3'));var moment=require('moment');var BPromise=require(_0xb9d3('0x4'));var Mustache=require(_0xb9d3('0x5'));var util=require(_0xb9d3('0x6'));var path=require('path');var sox=require(_0xb9d3('0x7'));var csv=require(_0xb9d3('0x8'));var ejs=require(_0xb9d3('0x9'));var fs=require('fs');var fs_extra=require(_0xb9d3('0xa'));var _=require(_0xb9d3('0xb'));var squel=require(_0xb9d3('0xc'));var crypto=require(_0xb9d3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb9d3('0x8'));var querystring=require(_0xb9d3('0xe'));var Papa=require(_0xb9d3('0xf'));var Redis=require('ioredis');var authService=require(_0xb9d3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb9d3('0x11'));var hardwareService=require(_0xb9d3('0x12'));var logger=require('../../config/logger')(_0xb9d3('0x13'));var utils=require(_0xb9d3('0x14'));var config=require(_0xb9d3('0x15'));var licenseUtil=require(_0xb9d3('0x16'));var db=require(_0xb9d3('0x17'))['db'];config[_0xb9d3('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9d3('0x18')]));require('./voiceQueueReport.socket')[_0xb9d3('0x19')](socket);function respondWithStatusCode(_0xf88c75,_0x2ebb42){_0x2ebb42=_0x2ebb42||0xcc;return function(_0x2be8f4){if(_0x2be8f4){return _0xf88c75['sendStatus'](_0x2ebb42);}return _0xf88c75[_0xb9d3('0x1a')](_0x2ebb42)['end']();};}function respondWithResult(_0x1b1bbb,_0x43d9ae){_0x43d9ae=_0x43d9ae||0xc8;return function(_0x406dda){if(_0x406dda){return _0x1b1bbb[_0xb9d3('0x1a')](_0x43d9ae)[_0xb9d3('0x1b')](_0x406dda);}};}function respondWithFilteredResult(_0x4ebdf7,_0x43baa3){return function(_0x2ea688){if(_0x2ea688){var _0x55bc83=typeof _0x43baa3[_0xb9d3('0x1c')]===_0xb9d3('0x1d')&&typeof _0x43baa3['limit']===_0xb9d3('0x1d');var _0x440e8f=_0x2ea688[_0xb9d3('0x1e')];var _0x161efe=_0x55bc83?0x0:_0x43baa3[_0xb9d3('0x1c')];var _0x5945d1=_0x55bc83?_0x2ea688[_0xb9d3('0x1e')]:_0x43baa3['offset']+_0x43baa3['limit'];var _0x4e862c;if(_0x5945d1>=_0x440e8f){_0x5945d1=_0x440e8f;_0x4e862c=0xc8;}else{_0x4e862c=0xce;}_0x4ebdf7[_0xb9d3('0x1a')](_0x4e862c);return _0x4ebdf7[_0xb9d3('0x1f')]('Content-Range',_0x161efe+'-'+_0x5945d1+'/'+_0x440e8f)[_0xb9d3('0x1b')](_0x2ea688);}return null;};}function patchUpdates(_0x1a0ea5){return function(_0x2468de){try{jsonpatch[_0xb9d3('0x20')](_0x2468de,_0x1a0ea5,!![]);}catch(_0x3e8223){return BPromise[_0xb9d3('0x21')](_0x3e8223);}return _0x2468de[_0xb9d3('0x22')]();};}function saveUpdates(_0x3aca7a,_0xa6228c){return function(_0x2ba58e){if(_0x2ba58e){return _0x2ba58e[_0xb9d3('0x23')](_0x3aca7a)[_0xb9d3('0x24')](function(_0x126a0e){return _0x126a0e;});}return null;};}function removeEntity(_0xec08d2,_0xbbfaed){return function(_0x5fd64){if(_0x5fd64){return _0x5fd64['destroy']()[_0xb9d3('0x24')](function(){_0xec08d2['status'](0xcc)[_0xb9d3('0x25')]();});}};}function handleEntityNotFound(_0x5d3cea,_0x2710b7){return function(_0x78c226){if(!_0x78c226){_0x5d3cea[_0xb9d3('0x26')](0x194);}return _0x78c226;};}function handleError(_0x3373d5,_0x17e18f){_0x17e18f=_0x17e18f||0x1f4;return function(_0x298462){logger[_0xb9d3('0x27')](_0x298462[_0xb9d3('0x28')]);if(_0x298462[_0xb9d3('0x29')]){delete _0x298462[_0xb9d3('0x29')];}_0x3373d5['status'](_0x17e18f)['send'](_0x298462);};}exports[_0xb9d3('0x2a')]=function(_0x5bcf49,_0x4b672f){var _0x8a19b={},_0x223d6d={},_0x4f5581={'count':0x0,'rows':[]};var _0x21e0c1=_[_0xb9d3('0x2b')](db[_0xb9d3('0x2c')]['rawAttributes'],function(_0x4973fe){return{'name':_0x4973fe[_0xb9d3('0x2d')],'type':_0x4973fe[_0xb9d3('0x2e')][_0xb9d3('0x2f')]};});_0x223d6d['model']=_[_0xb9d3('0x2b')](_0x21e0c1,_0xb9d3('0x29'));_0x223d6d[_0xb9d3('0x30')]=_[_0xb9d3('0x31')](_0x5bcf49[_0xb9d3('0x30')]);_0x223d6d['filters']=_[_0xb9d3('0x32')](_0x223d6d[_0xb9d3('0x33')],_0x223d6d[_0xb9d3('0x30')]);_0x8a19b[_0xb9d3('0x34')]=_[_0xb9d3('0x32')](_0x223d6d[_0xb9d3('0x33')],qs['fields'](_0x5bcf49[_0xb9d3('0x30')]['fields']));_0x8a19b[_0xb9d3('0x34')]=_0x8a19b[_0xb9d3('0x34')][_0xb9d3('0x35')]?_0x8a19b['attributes']:_0x223d6d['model'];if(!_0x5bcf49[_0xb9d3('0x30')]['hasOwnProperty'](_0xb9d3('0x36'))){_0x8a19b[_0xb9d3('0x37')]=qs[_0xb9d3('0x37')](_0x5bcf49['query'][_0xb9d3('0x37')]);_0x8a19b[_0xb9d3('0x1c')]=qs[_0xb9d3('0x1c')](_0x5bcf49[_0xb9d3('0x30')][_0xb9d3('0x1c')]);}_0x8a19b['order']=qs[_0xb9d3('0x38')](_0x5bcf49[_0xb9d3('0x30')][_0xb9d3('0x38')]);_0x8a19b[_0xb9d3('0x39')]=qs[_0xb9d3('0x3a')](_[_0xb9d3('0x3b')](_0x5bcf49[_0xb9d3('0x30')],_0x223d6d[_0xb9d3('0x3a')]),_0x21e0c1);if(_0x5bcf49['query'][_0xb9d3('0x3c')]){_0x8a19b[_0xb9d3('0x39')]=_[_0xb9d3('0x3d')](_0x8a19b[_0xb9d3('0x39')],{'$or':_[_0xb9d3('0x2b')](_0x21e0c1,function(_0x2983ee){if(_0x2983ee[_0xb9d3('0x2e')]!==_0xb9d3('0x3e')){var _0x5ba850={};_0x5ba850[_0x2983ee[_0xb9d3('0x29')]]={'$like':'%'+_0x5bcf49[_0xb9d3('0x30')]['filter']+'%'};return _0x5ba850;}})});}_0x8a19b=_[_0xb9d3('0x3d')]({},_0x8a19b,_0x5bcf49['options']);var _0x367a27={'where':_0x8a19b[_0xb9d3('0x39')]};return db[_0xb9d3('0x2c')][_0xb9d3('0x1e')](_0x367a27)[_0xb9d3('0x24')](function(_0x48e671){_0x4f5581[_0xb9d3('0x1e')]=_0x48e671;if(_0x5bcf49[_0xb9d3('0x30')]['includeAll']){_0x8a19b['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xb9d3('0x3f')](_0x8a19b);})['then'](function(_0x2041d0){_0x4f5581[_0xb9d3('0x40')]=_0x2041d0;return _0x4f5581;})['then'](respondWithFilteredResult(_0x4b672f,_0x8a19b))[_0xb9d3('0x41')](handleError(_0x4b672f,null));};exports[_0xb9d3('0x42')]=function(_0x38adb1,_0x563ed9){var _0xde93b6={'raw':![],'where':{'id':_0x38adb1[_0xb9d3('0x43')]['id']}},_0x2dca37={};_0x2dca37[_0xb9d3('0x33')]=_[_0xb9d3('0x31')](db['VoiceQueueReport'][_0xb9d3('0x44')]);_0x2dca37[_0xb9d3('0x30')]=_['keys'](_0x38adb1['query']);_0x2dca37[_0xb9d3('0x3a')]=_[_0xb9d3('0x32')](_0x2dca37[_0xb9d3('0x33')],_0x2dca37[_0xb9d3('0x30')]);_0xde93b6[_0xb9d3('0x34')]=_[_0xb9d3('0x32')](_0x2dca37[_0xb9d3('0x33')],qs[_0xb9d3('0x45')](_0x38adb1['query'][_0xb9d3('0x45')]));_0xde93b6[_0xb9d3('0x34')]=_0xde93b6[_0xb9d3('0x34')][_0xb9d3('0x35')]?_0xde93b6['attributes']:_0x2dca37[_0xb9d3('0x33')];if(_0x38adb1[_0xb9d3('0x30')][_0xb9d3('0x46')]){_0xde93b6['include']=[{'all':!![]}];}_0xde93b6=_[_0xb9d3('0x3d')]({},_0xde93b6,_0x38adb1['options']);return db['VoiceQueueReport']['find'](_0xde93b6)[_0xb9d3('0x24')](handleEntityNotFound(_0x563ed9,null))[_0xb9d3('0x24')](respondWithResult(_0x563ed9,null))['catch'](handleError(_0x563ed9,null));};exports['create']=function(_0x53c057,_0x557811){return db[_0xb9d3('0x2c')]['create'](_0x53c057[_0xb9d3('0x47')],{})[_0xb9d3('0x24')](respondWithResult(_0x557811,0xc9))['catch'](handleError(_0x557811,null));};exports[_0xb9d3('0x23')]=function(_0x4afdbc,_0x3983f9){if(_0x4afdbc['body']['id']){delete _0x4afdbc[_0xb9d3('0x47')]['id'];}return db[_0xb9d3('0x2c')]['find']({'where':{'id':_0x4afdbc[_0xb9d3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3983f9,null))['then'](saveUpdates(_0x4afdbc[_0xb9d3('0x47')],null))[_0xb9d3('0x24')](respondWithResult(_0x3983f9,null))['catch'](handleError(_0x3983f9,null));};exports['destroy']=function(_0x1cd5c5,_0x203f78){return db[_0xb9d3('0x2c')][_0xb9d3('0x48')]({'where':{'id':_0x1cd5c5['params']['id']}})[_0xb9d3('0x24')](handleEntityNotFound(_0x203f78,null))[_0xb9d3('0x24')](removeEntity(_0x203f78,null))['catch'](handleError(_0x203f78,null));};exports[_0xb9d3('0x49')]=function(_0x5906f6,_0x31b683){return db[_0xb9d3('0x2c')][_0xb9d3('0x49')]()[_0xb9d3('0x24')](respondWithResult(_0x31b683,null))[_0xb9d3('0x41')](handleError(_0x31b683,null));};exports[_0xb9d3('0x4a')]=function(_0x5228f6,_0x5ee090){var _0x593162={},_0x3b0f6e={},_0x139934={'count':0x0,'rows':[]};_0x3b0f6e['model']=_[_0xb9d3('0x31')](db['VoiceQueueReport'][_0xb9d3('0x44')]);_0x3b0f6e['query']=_['keys'](_0x5228f6[_0xb9d3('0x30')]);_0x3b0f6e[_0xb9d3('0x3a')]=_[_0xb9d3('0x32')](_0x3b0f6e[_0xb9d3('0x33')],_0x3b0f6e[_0xb9d3('0x30')]);_0x593162[_0xb9d3('0x34')]=_[_0xb9d3('0x32')](_0x3b0f6e[_0xb9d3('0x33')],qs['fields'](_0x5228f6[_0xb9d3('0x30')][_0xb9d3('0x45')]));_0x593162[_0xb9d3('0x34')]=_0x593162[_0xb9d3('0x34')][_0xb9d3('0x35')]?_0x593162['attributes']:_0x3b0f6e['model'];if(!_0x5228f6[_0xb9d3('0x30')][_0xb9d3('0x4b')](_0xb9d3('0x36'))){_0x593162[_0xb9d3('0x37')]=qs['limit'](_0x5228f6[_0xb9d3('0x30')][_0xb9d3('0x37')]);_0x593162[_0xb9d3('0x1c')]=qs['offset'](_0x5228f6[_0xb9d3('0x30')]['offset']);}_0x593162[_0xb9d3('0x4c')]=qs[_0xb9d3('0x38')](_0x5228f6[_0xb9d3('0x30')][_0xb9d3('0x38')]);_0x593162[_0xb9d3('0x39')]=qs[_0xb9d3('0x3a')](_[_0xb9d3('0x3b')](_0x5228f6['query'],_0x3b0f6e['filters']));if(_0x5228f6['query']['filter']){_0x593162['where']=_[_0xb9d3('0x3d')](_0x593162['where'],{'$or':_['map'](_0x593162[_0xb9d3('0x34')],function(_0x26f04c){var _0xa8dd18={};_0xa8dd18[_0x26f04c]={'$like':'%'+_0x5228f6[_0xb9d3('0x30')][_0xb9d3('0x3c')]+'%'};return _0xa8dd18;})});}_0x593162=_[_0xb9d3('0x3d')]({},_0x593162,_0x5228f6[_0xb9d3('0x4d')]);var _0x2378ac={'where':_0x593162[_0xb9d3('0x39')]};return db[_0xb9d3('0x2c')]['count'](_0x2378ac)[_0xb9d3('0x24')](function(_0x4cf52f){_0x139934[_0xb9d3('0x1e')]=_0x4cf52f;if(_0x5228f6[_0xb9d3('0x30')]['includeAll']){_0x593162['include']=[{'all':!![]}];}return db[_0xb9d3('0x2c')][_0xb9d3('0x3f')](_0x593162);})[_0xb9d3('0x24')](function(_0x253877){_0x139934['rows']=_0x253877;return _0x139934;})[_0xb9d3('0x24')](respondWithFilteredResult(_0x5ee090,_0x593162,_0xb9d3('0x4a')))[_0xb9d3('0x41')](handleError(_0x5ee090,null,_0xb9d3('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 7589c6b..55d0eca 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 _0xeea2=['events','../../mysqldb','VoiceQueueReport','save','update','remove','emit','hook','exports'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0xeea2,0xcf));var _0x2eea=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xeea2[_0x599f41];return _0x2e4d58;};'use strict';var EventEmitter=require(_0x2eea('0x0'));var VoiceQueueReport=require(_0x2eea('0x1'))['db'][_0x2eea('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2eea('0x3'),'afterUpdate':_0x2eea('0x4'),'afterDestroy':_0x2eea('0x5')};function emitEvent(_0x382e9b){return function(_0x170178,_0x2099d1,_0x2f005a){VoiceQueueReportEvents[_0x2eea('0x6')](_0x382e9b+':'+_0x170178['id'],_0x170178);VoiceQueueReportEvents['emit'](_0x382e9b,_0x170178);_0x2f005a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x2eea('0x7')](e,emitEvent(event));}}module[_0x2eea('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf43a=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x13d3b4,_0x8ee680){var _0x496979=function(_0x55f6b0){while(--_0x55f6b0){_0x13d3b4['push'](_0x13d3b4['shift']());}};_0x496979(++_0x8ee680);}(_0xf43a,0x13d));var _0xaf43=function(_0x35d0d8,_0x4355e5){_0x35d0d8=_0x35d0d8-0x0;var _0x50383c=_0xf43a[_0x35d0d8];return _0x50383c;};'use strict';var EventEmitter=require(_0xaf43('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf43('0x1'),'afterUpdate':_0xaf43('0x2'),'afterDestroy':_0xaf43('0x3')};function emitEvent(_0x34504a){return function(_0x3ff651,_0x37d990,_0xc021b4){VoiceQueueReportEvents[_0xaf43('0x4')](_0x34504a+':'+_0x3ff651['id'],_0x3ff651);VoiceQueueReportEvents[_0xaf43('0x4')](_0x34504a,_0x3ff651);_0xc021b4(null);};}for(var e in events){if(events[_0xaf43('0x5')](e)){var event=events[e];VoiceQueueReport[_0xaf43('0x6')](e,emitEvent(event));}}module[_0xaf43('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 95ccfea..41c0cc6 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 _0xfa5d=['lodash','moment','bluebird','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','calleridnum'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xfa5d,0x19e));var _0xdfa5=function(_0x4c14bf,_0x1c2537){_0x4c14bf=_0x4c14bf-0x0;var _0x5a68d6=_0xfa5d[_0x4c14bf];return _0x5a68d6;};'use strict';var _=require(_0xdfa5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdfa5('0x1'));var BPromise=require(_0xdfa5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdfa5('0x3'));var config=require('../../config/environment');var attributes=require(_0xdfa5('0x4'));module[_0xdfa5('0x5')]=function(_0x48cdfb,_0x2529e5){return _0x48cdfb['define'](_0xdfa5('0x6'),attributes,{'tableName':_0xdfa5('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xdfa5('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7c4=['api','moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','uniqueid','lodash','../../config/logger'];(function(_0x49f4fe,_0x559a74){var _0x110806=function(_0x4fc9d5){while(--_0x4fc9d5){_0x49f4fe['push'](_0x49f4fe['shift']());}};_0x110806(++_0x559a74);}(_0xc7c4,0x198));var _0x4c7c=function(_0x3c5205,_0x26c72e){_0x3c5205=_0x3c5205-0x0;var _0x3fcea1=_0xc7c4[_0x3c5205];return _0x3fcea1;};'use strict';var _=require(_0x4c7c('0x0'));var util=require('util');var logger=require(_0x4c7c('0x1'))(_0x4c7c('0x2'));var moment=require(_0x4c7c('0x3'));var BPromise=require(_0x4c7c('0x4'));var rp=require(_0x4c7c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c7c('0x6'));var attributes=require(_0x4c7c('0x7'));module[_0x4c7c('0x8')]=function(_0x3597f3,_0xa29af8){return _0x3597f3['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x4c7c('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index a060024..36a500d 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 _0xec8f=['socket.io-emitter','./voiceQueueReport.socket','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','update','UpdateVoiceQueueReport','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost'];(function(_0x391d3b,_0x54e649){var _0x4412cf=function(_0x4b60c2){while(--_0x4b60c2){_0x391d3b['push'](_0x391d3b['shift']());}};_0x4412cf(++_0x54e649);}(_0xec8f,0x1b1));var _0xfec8=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xec8f[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfec8('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfec8('0x1'));var db=require(_0xfec8('0x2'))['db'];var utils=require(_0xfec8('0x3'));var logger=require('../../config/logger')(_0xfec8('0x4'));var config=require(_0xfec8('0x5'));var jayson=require(_0xfec8('0x6'));var client=jayson['client'][_0xfec8('0x7')]({'port':0x232a});config['redis']=_[_0xfec8('0x8')](config[_0xfec8('0x9')],{'host':_0xfec8('0xa'),'port':0x18eb});var socket=require(_0xfec8('0xb'))(new Redis(config['redis']));require(_0xfec8('0xc'))['register'](socket);function respondWithRpcPromise(_0x3776b1,_0x3a5871,_0xff743b){return new BPromise(function(_0x2e6fff,_0xb5b31f){return client['request'](_0x3776b1,_0xff743b)[_0xfec8('0xd')](function(_0x251d31){logger[_0xfec8('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x3a5871,_0xfec8('0xf'));logger[_0xfec8('0x10')](_0xfec8('0x11'),_0x3a5871,_0xfec8('0xf'),JSON[_0xfec8('0x12')](_0x251d31));if(_0x251d31[_0xfec8('0x13')]){if(_0x251d31[_0xfec8('0x13')]['code']===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3a5871,_0x251d31['error']['message']);return _0xb5b31f(_0x251d31[_0xfec8('0x13')]['message']);}logger[_0xfec8('0x13')](_0xfec8('0x14'),_0x3a5871,_0x251d31[_0xfec8('0x13')][_0xfec8('0x15')]);return _0x2e6fff(_0x251d31[_0xfec8('0x13')][_0xfec8('0x15')]);}else{logger[_0xfec8('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x3a5871,_0xfec8('0xf'));_0x2e6fff(_0x251d31['result']['message']);}})[_0xfec8('0x16')](function(_0x55d01b){logger[_0xfec8('0x13')](_0xfec8('0x14'),_0x3a5871,_0x55d01b);_0xb5b31f(_0x55d01b);});});}exports['GetVoiceQueueReport']=function(_0x59467e){var _0x4dcf98=this;return new Promise(function(_0x36143e,_0x4768b4){return db[_0xfec8('0x17')][_0xfec8('0x18')]({'raw':_0x59467e[_0xfec8('0x19')]?_0x59467e[_0xfec8('0x19')][_0xfec8('0x1a')]===undefined?!![]:![]:!![],'where':_0x59467e[_0xfec8('0x19')]?_0x59467e[_0xfec8('0x19')][_0xfec8('0x1b')]||null:null,'attributes':_0x59467e[_0xfec8('0x19')]?_0x59467e[_0xfec8('0x19')][_0xfec8('0x1c')]||null:null,'limit':_0x59467e[_0xfec8('0x19')]?_0x59467e[_0xfec8('0x19')]['limit']||null:null,'include':_0x59467e['options']?_0x59467e['options'][_0xfec8('0x1d')]?_[_0xfec8('0x1e')](_0x59467e[_0xfec8('0x19')]['include'],function(_0x2b5105){return{'model':db[_0x2b5105[_0xfec8('0x1f')]],'as':_0x2b5105['as'],'attributes':_0x2b5105[_0xfec8('0x1c')],'include':_0x2b5105[_0xfec8('0x1d')]?_[_0xfec8('0x1e')](_0x2b5105[_0xfec8('0x1d')],function(_0x452d83){return{'model':db[_0x452d83[_0xfec8('0x1f')]],'as':_0x452d83['as'],'attributes':_0x452d83[_0xfec8('0x1c')],'include':_0x452d83[_0xfec8('0x1d')]?_[_0xfec8('0x1e')](_0x452d83['include'],function(_0x5147d1){return{'model':db[_0x5147d1[_0xfec8('0x1f')]],'as':_0x5147d1['as'],'attributes':_0x5147d1[_0xfec8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfec8('0xd')](function(_0x551eac){logger['info'](_0xfec8('0x20'),_0x59467e);logger[_0xfec8('0x10')](_0xfec8('0x20'),_0x59467e,JSON[_0xfec8('0x12')](_0x551eac));_0x36143e(_0x551eac);})[_0xfec8('0x16')](function(_0x585dc0){logger[_0xfec8('0x13')](_0xfec8('0x20'),_0x585dc0[_0xfec8('0x15')],_0x59467e);_0x4768b4(_0x4dcf98[_0xfec8('0x13')](0x1f4,_0x585dc0[_0xfec8('0x15')]));});});};exports[_0xfec8('0x21')]=function(_0x135cab){var _0x48c506=this;return new Promise(function(_0x3d78b5,_0x3f3007){return db[_0xfec8('0x17')][_0xfec8('0x22')](_0x135cab['body'],{'raw':_0x135cab[_0xfec8('0x19')]?_0x135cab[_0xfec8('0x19')][_0xfec8('0x1a')]===undefined?!![]:![]:!![]})[_0xfec8('0xd')](function(_0x433f0f){logger[_0xfec8('0xe')](_0xfec8('0x21'),_0x135cab);logger[_0xfec8('0x10')]('CreateVoiceQueueReport',_0x135cab,JSON[_0xfec8('0x12')](_0x433f0f));_0x3d78b5(_0x433f0f);})[_0xfec8('0x16')](function(_0x2355ff){logger['error']('CreateVoiceQueueReport',_0x2355ff['message'],_0x135cab);_0x3f3007(_0x48c506[_0xfec8('0x13')](0x1f4,_0x2355ff[_0xfec8('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0xe8b95f){var _0x33e574=this;return new Promise(function(_0x5eb64d,_0x233ada){return db['VoiceQueueReport'][_0xfec8('0x23')](_0xe8b95f['body'],{'raw':_0xe8b95f[_0xfec8('0x19')]?_0xe8b95f[_0xfec8('0x19')][_0xfec8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe8b95f[_0xfec8('0x19')]?_0xe8b95f[_0xfec8('0x19')][_0xfec8('0x1b')]||null:null,'attributes':_0xe8b95f['options']?_0xe8b95f[_0xfec8('0x19')][_0xfec8('0x1c')]||null:null,'limit':_0xe8b95f[_0xfec8('0x19')]?_0xe8b95f[_0xfec8('0x19')]['limit']||null:null})['then'](function(_0x4fbae6){logger['info'](_0xfec8('0x24'),_0xe8b95f);logger[_0xfec8('0x10')](_0xfec8('0x24'),_0xe8b95f,JSON[_0xfec8('0x12')](_0x4fbae6));_0x5eb64d(_0x4fbae6);})['catch'](function(_0x6fa7fe){logger[_0xfec8('0x13')]('UpdateVoiceQueueReport',_0x6fa7fe[_0xfec8('0x15')],_0xe8b95f);_0x233ada(_0x33e574[_0xfec8('0x13')](0x1f4,_0x6fa7fe[_0xfec8('0x15')]));});});}; \ No newline at end of file +var _0xc5f4=['VoiceQueueReport','findAll','options','raw','where','include','attributes','map','model','catch','CreateVoiceQueueReport','create','debug','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport'];(function(_0x205ef8,_0x21dd3a){var _0x6f359e=function(_0x1d8b73){while(--_0x1d8b73){_0x205ef8['push'](_0x205ef8['shift']());}};_0x6f359e(++_0x21dd3a);}(_0xc5f4,0x160));var _0x4c5f=function(_0x14da33,_0x26fa55){_0x14da33=_0x14da33-0x0;var _0x4a009d=_0xc5f4[_0x14da33];return _0x4a009d;};'use strict';var _=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var moment=require(_0x4c5f('0x2'));var BPromise=require(_0x4c5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c5f('0x4'));var db=require(_0x4c5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4c5f('0x6'));var config=require(_0x4c5f('0x7'));var jayson=require(_0x4c5f('0x8'));var client=jayson[_0x4c5f('0x9')]['http']({'port':0x232a});config['redis']=_[_0x4c5f('0xa')](config[_0x4c5f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c5f('0xc'))(new Redis(config[_0x4c5f('0xb')]));require('./voiceQueueReport.socket')[_0x4c5f('0xd')](socket);function respondWithRpcPromise(_0x221209,_0x526330,_0x25e6c0){return new BPromise(function(_0x58e51f,_0x4117b7){return client[_0x4c5f('0xe')](_0x221209,_0x25e6c0)[_0x4c5f('0xf')](function(_0x5d6ff6){logger[_0x4c5f('0x10')](_0x4c5f('0x11'),_0x526330,_0x4c5f('0x12'));logger['debug'](_0x4c5f('0x13'),_0x526330,_0x4c5f('0x12'),JSON[_0x4c5f('0x14')](_0x5d6ff6));if(_0x5d6ff6[_0x4c5f('0x15')]){if(_0x5d6ff6['error'][_0x4c5f('0x16')]===0x1f4){logger[_0x4c5f('0x15')](_0x4c5f('0x11'),_0x526330,_0x5d6ff6[_0x4c5f('0x15')]['message']);return _0x4117b7(_0x5d6ff6[_0x4c5f('0x15')][_0x4c5f('0x17')]);}logger[_0x4c5f('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x526330,_0x5d6ff6[_0x4c5f('0x15')][_0x4c5f('0x17')]);return _0x58e51f(_0x5d6ff6[_0x4c5f('0x15')][_0x4c5f('0x17')]);}else{logger[_0x4c5f('0x10')](_0x4c5f('0x11'),_0x526330,_0x4c5f('0x12'));_0x58e51f(_0x5d6ff6[_0x4c5f('0x18')][_0x4c5f('0x17')]);}})['catch'](function(_0x4bbce5){logger[_0x4c5f('0x15')](_0x4c5f('0x11'),_0x526330,_0x4bbce5);_0x4117b7(_0x4bbce5);});});}exports[_0x4c5f('0x19')]=function(_0x2a20ec){var _0xf77d55=this;return new Promise(function(_0x49db54,_0x345ca4){return db[_0x4c5f('0x1a')][_0x4c5f('0x1b')]({'raw':_0x2a20ec[_0x4c5f('0x1c')]?_0x2a20ec['options'][_0x4c5f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a20ec['options']?_0x2a20ec[_0x4c5f('0x1c')][_0x4c5f('0x1e')]||null:null,'attributes':_0x2a20ec[_0x4c5f('0x1c')]?_0x2a20ec[_0x4c5f('0x1c')]['attributes']||null:null,'limit':_0x2a20ec[_0x4c5f('0x1c')]?_0x2a20ec[_0x4c5f('0x1c')]['limit']||null:null,'include':_0x2a20ec[_0x4c5f('0x1c')]?_0x2a20ec[_0x4c5f('0x1c')][_0x4c5f('0x1f')]?_['map'](_0x2a20ec[_0x4c5f('0x1c')][_0x4c5f('0x1f')],function(_0x1018cd){return{'model':db[_0x1018cd['model']],'as':_0x1018cd['as'],'attributes':_0x1018cd[_0x4c5f('0x20')],'include':_0x1018cd['include']?_[_0x4c5f('0x21')](_0x1018cd[_0x4c5f('0x1f')],function(_0x48f102){return{'model':db[_0x48f102[_0x4c5f('0x22')]],'as':_0x48f102['as'],'attributes':_0x48f102['attributes'],'include':_0x48f102[_0x4c5f('0x1f')]?_[_0x4c5f('0x21')](_0x48f102[_0x4c5f('0x1f')],function(_0x3a5907){return{'model':db[_0x3a5907[_0x4c5f('0x22')]],'as':_0x3a5907['as'],'attributes':_0x3a5907[_0x4c5f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26d7f6){logger['info']('GetVoiceQueueReport',_0x2a20ec);logger['debug']('GetVoiceQueueReport',_0x2a20ec,JSON['stringify'](_0x26d7f6));_0x49db54(_0x26d7f6);})[_0x4c5f('0x23')](function(_0x1470d3){logger[_0x4c5f('0x15')]('GetVoiceQueueReport',_0x1470d3[_0x4c5f('0x17')],_0x2a20ec);_0x345ca4(_0xf77d55[_0x4c5f('0x15')](0x1f4,_0x1470d3[_0x4c5f('0x17')]));});});};exports[_0x4c5f('0x24')]=function(_0x572eae){var _0x22c2d4=this;return new Promise(function(_0x328588,_0x32cc4e){return db[_0x4c5f('0x1a')][_0x4c5f('0x25')](_0x572eae['body'],{'raw':_0x572eae['options']?_0x572eae[_0x4c5f('0x1c')][_0x4c5f('0x1d')]===undefined?!![]:![]:!![]})[_0x4c5f('0xf')](function(_0x12432c){logger[_0x4c5f('0x10')]('CreateVoiceQueueReport',_0x572eae);logger[_0x4c5f('0x26')](_0x4c5f('0x24'),_0x572eae,JSON[_0x4c5f('0x14')](_0x12432c));_0x328588(_0x12432c);})[_0x4c5f('0x23')](function(_0x17453){logger['error'](_0x4c5f('0x24'),_0x17453[_0x4c5f('0x17')],_0x572eae);_0x32cc4e(_0x22c2d4['error'](0x1f4,_0x17453[_0x4c5f('0x17')]));});});};exports[_0x4c5f('0x27')]=function(_0x5b29c4){var _0x5d1bf0=this;return new Promise(function(_0x1d1b16,_0x3032a9){return db[_0x4c5f('0x1a')][_0x4c5f('0x28')](_0x5b29c4[_0x4c5f('0x29')],{'raw':_0x5b29c4[_0x4c5f('0x1c')]?_0x5b29c4[_0x4c5f('0x1c')][_0x4c5f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b29c4[_0x4c5f('0x1c')]?_0x5b29c4['options']['where']||null:null,'attributes':_0x5b29c4[_0x4c5f('0x1c')]?_0x5b29c4[_0x4c5f('0x1c')]['attributes']||null:null,'limit':_0x5b29c4['options']?_0x5b29c4['options']['limit']||null:null})['then'](function(_0xa5e3f6){logger[_0x4c5f('0x10')](_0x4c5f('0x27'),_0x5b29c4);logger[_0x4c5f('0x26')](_0x4c5f('0x27'),_0x5b29c4,JSON[_0x4c5f('0x14')](_0xa5e3f6));_0x1d1b16(_0xa5e3f6);})[_0x4c5f('0x23')](function(_0x9bb6f0){logger['error']('UpdateVoiceQueueReport',_0x9bb6f0[_0x4c5f('0x17')],_0x5b29c4);_0x3032a9(_0x5d1bf0['error'](0x1f4,_0x9bb6f0[_0x4c5f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index cf396bc..9c27595 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 _0xafca=['update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','remove'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueReportEvents=require(_0xaafc('0x0'));var events=['save',_0xaafc('0x1'),_0xaafc('0x2')];function createListener(_0x494c61,_0x484f85){return function(_0x1769ab){_0x484f85[_0xaafc('0x3')](_0x494c61,_0x1769ab);};}function removeListener(_0x379add,_0xd5021b){return function(){VoiceQueueReportEvents[_0xaafc('0x4')](_0x379add,_0xd5021b);};}exports['register']=function(_0x3db4ed){for(var _0x418fca=0x0,_0x978cf0=events[_0xaafc('0x5')];_0x418fca<_0x978cf0;_0x418fca++){var _0x83ea82=events[_0x418fca];var _0x2cf865=createListener(_0xaafc('0x6')+_0x83ea82,_0x3db4ed);VoiceQueueReportEvents['on'](_0x83ea82,_0x2cf865);}}; \ No newline at end of file +var _0x302c=['remove','update','emit','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x52d82c,_0x2b885a){var _0x2ae485=function(_0x5f08ef){while(--_0x5f08ef){_0x52d82c['push'](_0x52d82c['shift']());}};_0x2ae485(++_0x2b885a);}(_0x302c,0x15c));var _0xc302=function(_0x3d4bce,_0xc7c729){_0x3d4bce=_0x3d4bce-0x0;var _0x3749e0=_0x302c[_0x3d4bce];return _0x3749e0;};'use strict';var VoiceQueueReportEvents=require(_0xc302('0x0'));var events=[_0xc302('0x1'),_0xc302('0x2'),_0xc302('0x3')];function createListener(_0x1b4ee0,_0x4d2268){return function(_0x5d732b){_0x4d2268[_0xc302('0x4')](_0x1b4ee0,_0x5d732b);};}function removeListener(_0xdc61f1,_0x3ed277){return function(){VoiceQueueReportEvents['removeListener'](_0xdc61f1,_0x3ed277);};}exports['register']=function(_0x13139e){for(var _0x59ba1e=0x0,_0x13c4aa=events[_0xc302('0x5')];_0x59ba1e<_0x13c4aa;_0x59ba1e++){var _0x33c314=events[_0x59ba1e];var _0x232e75=createListener(_0xc302('0x6')+_0x33c314,_0x13139e);VoiceQueueReportEvents['on'](_0x33c314,_0x232e75);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 1975191..aa2c1eb 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 _0xf031=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express'];(function(_0x562573,_0x52442e){var _0x35b427=function(_0x18ed06){while(--_0x18ed06){_0x562573['push'](_0x562573['shift']());}};_0x35b427(++_0x52442e);}(_0xf031,0xfc));var _0x1f03=function(_0x470efc,_0x3d97d4){_0x470efc=_0x470efc-0x0;var _0x4adbd8=_0xf031[_0x470efc];return _0x4adbd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f03('0x0'));var timeout=require(_0x1f03('0x1'));var express=require(_0x1f03('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f03('0x3'));var interaction=require(_0x1f03('0x4'));var config=require(_0x1f03('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x1f03('0x6')]('/',auth[_0x1f03('0x7')](),controller[_0x1f03('0x8')]);router[_0x1f03('0x6')](_0x1f03('0x9'),auth['isAuthenticated'](),controller[_0x1f03('0xa')]);router[_0x1f03('0xb')]('/',auth[_0x1f03('0x7')](),controller[_0x1f03('0xc')]);router[_0x1f03('0xd')](_0x1f03('0x9'),auth[_0x1f03('0x7')](),controller[_0x1f03('0xe')]);router[_0x1f03('0xf')](_0x1f03('0x9'),auth[_0x1f03('0x7')](),controller[_0x1f03('0x10')]);module['exports']=router; \ No newline at end of file +var _0x40ca=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','put','update'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x40ca,0x1a1));var _0xa40c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x40ca[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xa40c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa40c('0x1'));var express=require(_0xa40c('0x2'));var router=express[_0xa40c('0x3')]();var fs_extra=require(_0xa40c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa40c('0x5'));var config=require('../../config/environment');var controller=require(_0xa40c('0x6'));router['get']('/',auth[_0xa40c('0x7')](),controller['index']);router[_0xa40c('0x8')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0xa')]);router[_0xa40c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa40c('0xc')]);router[_0xa40c('0xd')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0xe')]);router[_0xa40c('0xf')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0x10')]);module[_0xa40c('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5fc7434..fa048de 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 _0x36bb=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x4df9db,_0x209ae6){var _0x360b4d=function(_0x25530c){while(--_0x25530c){_0x4df9db['push'](_0x4df9db['shift']());}};_0x360b4d(++_0x209ae6);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb36b('0x0'));var moment=require(_0xb36b('0x1'));module[_0xb36b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb36b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb36b('0x4')],'allowNull':![],'defaultValue':moment()[_0xb36b('0x5')](_0xb36b('0x6'))}}; \ No newline at end of file +var _0x53ba=['exports','STRING','DATE','format','sequelize','moment'];(function(_0x524899,_0x4a1b81){var _0x5e2554=function(_0x5cd91c){while(--_0x5cd91c){_0x524899['push'](_0x524899['shift']());}};_0x5e2554(++_0x4a1b81);}(_0x53ba,0x18a));var _0xa53b=function(_0x245932,_0x89c7b7){_0x245932=_0x245932-0x0;var _0x2f135f=_0x53ba[_0x245932];return _0x2f135f;};'use strict';var Sequelize=require(_0xa53b('0x0'));var moment=require(_0xa53b('0x1'));module[_0xa53b('0x2')]={'time':{'type':Sequelize[_0xa53b('0x3')]},'callid':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa53b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa53b('0x4')],'allowNull':![],'defaultValue':moment()[_0xa53b('0x5')]('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 8000911..7bc7e02 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 _0x6599=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy'];(function(_0x1e21a9,_0x1e5528){var _0x282550=function(_0x4c23a1){while(--_0x4c23a1){_0x1e21a9['push'](_0x1e21a9['shift']());}};_0x282550(++_0x1e5528);}(_0x6599,0x120));var _0x9659=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x6599[_0x55d8c5];return _0x225ae5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9659('0x0'));var zipdir=require(_0x9659('0x1'));var jsonpatch=require(_0x9659('0x2'));var rp=require('request-promise');var moment=require(_0x9659('0x3'));var BPromise=require(_0x9659('0x4'));var Mustache=require(_0x9659('0x5'));var util=require(_0x9659('0x6'));var path=require(_0x9659('0x7'));var sox=require(_0x9659('0x8'));var csv=require('to-csv');var ejs=require(_0x9659('0x9'));var fs=require('fs');var fs_extra=require(_0x9659('0xa'));var _=require(_0x9659('0xb'));var squel=require(_0x9659('0xc'));var crypto=require('crypto');var jsforce=require(_0x9659('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9659('0xe'));var querystring=require(_0x9659('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9659('0x10'));var qs=require(_0x9659('0x11'));var as=require(_0x9659('0x12'));var hardwareService=require(_0x9659('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9659('0x14'));var config=require(_0x9659('0x15'));var licenseUtil=require(_0x9659('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d604b,_0x3c9165){_0x3c9165=_0x3c9165||0xcc;return function(_0x1e64bb){if(_0x1e64bb){return _0x3d604b[_0x9659('0x17')](_0x3c9165);}return _0x3d604b['status'](_0x3c9165)[_0x9659('0x18')]();};}function respondWithResult(_0xeefc1c,_0x387914){_0x387914=_0x387914||0xc8;return function(_0x504471){if(_0x504471){return _0xeefc1c[_0x9659('0x19')](_0x387914)['json'](_0x504471);}};}function respondWithFilteredResult(_0x59a2e7,_0x169247){return function(_0x10c96d){if(_0x10c96d){var _0x180135=typeof _0x169247['offset']===_0x9659('0x1a')&&typeof _0x169247[_0x9659('0x1b')]===_0x9659('0x1a');var _0x3c7513=_0x10c96d[_0x9659('0x1c')];var _0x409e44=_0x180135?0x0:_0x169247[_0x9659('0x1d')];var _0x5d81a8=_0x180135?_0x10c96d[_0x9659('0x1c')]:_0x169247[_0x9659('0x1d')]+_0x169247[_0x9659('0x1b')];var _0x39a0eb;if(_0x5d81a8>=_0x3c7513){_0x5d81a8=_0x3c7513;_0x39a0eb=0xc8;}else{_0x39a0eb=0xce;}_0x59a2e7[_0x9659('0x19')](_0x39a0eb);return _0x59a2e7[_0x9659('0x1e')](_0x9659('0x1f'),_0x409e44+'-'+_0x5d81a8+'/'+_0x3c7513)['json'](_0x10c96d);}return null;};}function patchUpdates(_0x25bf02){return function(_0x2d93ab){try{jsonpatch['apply'](_0x2d93ab,_0x25bf02,!![]);}catch(_0x341c5e){return BPromise[_0x9659('0x20')](_0x341c5e);}return _0x2d93ab[_0x9659('0x21')]();};}function saveUpdates(_0x45855e,_0x193fe7){return function(_0x215b9b){if(_0x215b9b){return _0x215b9b[_0x9659('0x22')](_0x45855e)[_0x9659('0x23')](function(_0xe154bf){return _0xe154bf;});}return null;};}function removeEntity(_0x42df01,_0x2b8aaa){return function(_0x5808c3){if(_0x5808c3){return _0x5808c3['destroy']()[_0x9659('0x23')](function(){_0x42df01[_0x9659('0x19')](0xcc)[_0x9659('0x18')]();});}};}function handleEntityNotFound(_0x39057c,_0x5800b3){return function(_0x2d855b){if(!_0x2d855b){_0x39057c['sendStatus'](0x194);}return _0x2d855b;};}function handleError(_0x558cef,_0x1ff339){_0x1ff339=_0x1ff339||0x1f4;return function(_0x9c8cf1){logger[_0x9659('0x24')](_0x9c8cf1[_0x9659('0x25')]);if(_0x9c8cf1['name']){delete _0x9c8cf1[_0x9659('0x26')];}_0x558cef['status'](_0x1ff339)['send'](_0x9c8cf1);};}exports[_0x9659('0x27')]=function(_0x482ee5,_0x566b5e){var _0x5770e7={},_0x54652d={},_0x365aa2={'count':0x0,'rows':[]};var _0x36f1ca=_[_0x9659('0x28')](db[_0x9659('0x29')][_0x9659('0x2a')],function(_0x12b142){return{'name':_0x12b142[_0x9659('0x2b')],'type':_0x12b142[_0x9659('0x2c')][_0x9659('0x2d')]};});_0x54652d[_0x9659('0x2e')]=_[_0x9659('0x28')](_0x36f1ca,_0x9659('0x26'));_0x54652d[_0x9659('0x2f')]=_['keys'](_0x482ee5[_0x9659('0x2f')]);_0x54652d[_0x9659('0x30')]=_['intersection'](_0x54652d['model'],_0x54652d[_0x9659('0x2f')]);_0x5770e7[_0x9659('0x31')]=_[_0x9659('0x32')](_0x54652d['model'],qs[_0x9659('0x33')](_0x482ee5['query'][_0x9659('0x33')]));_0x5770e7[_0x9659('0x31')]=_0x5770e7['attributes'][_0x9659('0x34')]?_0x5770e7[_0x9659('0x31')]:_0x54652d[_0x9659('0x2e')];if(!_0x482ee5[_0x9659('0x2f')]['hasOwnProperty'](_0x9659('0x35'))){_0x5770e7['limit']=qs[_0x9659('0x1b')](_0x482ee5[_0x9659('0x2f')][_0x9659('0x1b')]);_0x5770e7[_0x9659('0x1d')]=qs['offset'](_0x482ee5[_0x9659('0x2f')][_0x9659('0x1d')]);}_0x5770e7['order']=qs['sort'](_0x482ee5['query'][_0x9659('0x36')]);_0x5770e7[_0x9659('0x37')]=qs['filters'](_['pick'](_0x482ee5[_0x9659('0x2f')],_0x54652d[_0x9659('0x30')]),_0x36f1ca);if(_0x482ee5['query'][_0x9659('0x38')]){_0x5770e7['where']=_[_0x9659('0x39')](_0x5770e7[_0x9659('0x37')],{'$or':_[_0x9659('0x28')](_0x36f1ca,function(_0x22dc04){if(_0x22dc04[_0x9659('0x2c')]!==_0x9659('0x3a')){var _0x1f107c={};_0x1f107c[_0x22dc04[_0x9659('0x26')]]={'$like':'%'+_0x482ee5[_0x9659('0x2f')]['filter']+'%'};return _0x1f107c;}})});}_0x5770e7=_[_0x9659('0x39')]({},_0x5770e7,_0x482ee5[_0x9659('0x3b')]);var _0x1933ff={'where':_0x5770e7[_0x9659('0x37')]};return db['VoiceQueuesLog'][_0x9659('0x1c')](_0x1933ff)[_0x9659('0x23')](function(_0x52fbea){_0x365aa2[_0x9659('0x1c')]=_0x52fbea;if(_0x482ee5['query'][_0x9659('0x3c')]){_0x5770e7[_0x9659('0x3d')]=[{'all':!![]}];}return db[_0x9659('0x29')][_0x9659('0x3e')](_0x5770e7);})[_0x9659('0x23')](function(_0x23fc18){_0x365aa2[_0x9659('0x3f')]=_0x23fc18;return _0x365aa2;})[_0x9659('0x23')](respondWithFilteredResult(_0x566b5e,_0x5770e7))[_0x9659('0x40')](handleError(_0x566b5e,null));};exports[_0x9659('0x41')]=function(_0x53a866,_0x1a8284){var _0x2207a5={'raw':!![],'where':{'id':_0x53a866['params']['id']}},_0x4d8e17={};_0x4d8e17[_0x9659('0x2e')]=_[_0x9659('0x42')](db[_0x9659('0x29')][_0x9659('0x2a')]);_0x4d8e17[_0x9659('0x2f')]=_[_0x9659('0x42')](_0x53a866[_0x9659('0x2f')]);_0x4d8e17[_0x9659('0x30')]=_[_0x9659('0x32')](_0x4d8e17[_0x9659('0x2e')],_0x4d8e17[_0x9659('0x2f')]);_0x2207a5[_0x9659('0x31')]=_['intersection'](_0x4d8e17[_0x9659('0x2e')],qs['fields'](_0x53a866[_0x9659('0x2f')][_0x9659('0x33')]));_0x2207a5[_0x9659('0x31')]=_0x2207a5['attributes']['length']?_0x2207a5['attributes']:_0x4d8e17[_0x9659('0x2e')];if(_0x53a866[_0x9659('0x2f')][_0x9659('0x3c')]){_0x2207a5[_0x9659('0x3d')]=[{'all':!![]}];}_0x2207a5=_[_0x9659('0x39')]({},_0x2207a5,_0x53a866[_0x9659('0x3b')]);return db[_0x9659('0x29')][_0x9659('0x43')](_0x2207a5)[_0x9659('0x23')](handleEntityNotFound(_0x1a8284,null))[_0x9659('0x23')](respondWithResult(_0x1a8284,null))[_0x9659('0x40')](handleError(_0x1a8284,null));};exports[_0x9659('0x44')]=function(_0x1e5e58,_0x1555fb){return db['VoiceQueuesLog'][_0x9659('0x44')](_0x1e5e58['body'],{})[_0x9659('0x23')](respondWithResult(_0x1555fb,0xc9))[_0x9659('0x40')](handleError(_0x1555fb,null));};exports[_0x9659('0x22')]=function(_0x2c646b,_0x3c04f6){if(_0x2c646b[_0x9659('0x45')]['id']){delete _0x2c646b[_0x9659('0x45')]['id'];}return db[_0x9659('0x29')]['find']({'where':{'id':_0x2c646b[_0x9659('0x46')]['id']}})[_0x9659('0x23')](handleEntityNotFound(_0x3c04f6,null))[_0x9659('0x23')](saveUpdates(_0x2c646b[_0x9659('0x45')],null))[_0x9659('0x23')](respondWithResult(_0x3c04f6,null))[_0x9659('0x40')](handleError(_0x3c04f6,null));};exports[_0x9659('0x47')]=function(_0x3ea267,_0x605f1f){return db[_0x9659('0x29')][_0x9659('0x43')]({'where':{'id':_0x3ea267[_0x9659('0x46')]['id']}})[_0x9659('0x23')](handleEntityNotFound(_0x605f1f,null))[_0x9659('0x23')](removeEntity(_0x605f1f,null))[_0x9659('0x40')](handleError(_0x605f1f,null));}; \ No newline at end of file +var _0xacba=['filters','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','VoiceQueuesLog','fieldName','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x549d16,_0x4d069a){var _0x344ccc=function(_0x1d992a){while(--_0x1d992a){_0x549d16['push'](_0x549d16['shift']());}};_0x344ccc(++_0x4d069a);}(_0xacba,0x1da));var _0xaacb=function(_0x3b05f6,_0x37484c){_0x3b05f6=_0x3b05f6-0x0;var _0x199106=_0xacba[_0x3b05f6];return _0x199106;};'use strict';var emlformat=require(_0xaacb('0x0'));var rimraf=require(_0xaacb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaacb('0x2'));var rp=require(_0xaacb('0x3'));var moment=require(_0xaacb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaacb('0x5'));var util=require(_0xaacb('0x6'));var path=require(_0xaacb('0x7'));var sox=require(_0xaacb('0x8'));var csv=require(_0xaacb('0x9'));var ejs=require(_0xaacb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaacb('0xb'));var squel=require(_0xaacb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaacb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaacb('0xe'));var authService=require(_0xaacb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xaacb('0x10'));var hardwareService=require(_0xaacb('0x11'));var logger=require(_0xaacb('0x12'))(_0xaacb('0x13'));var utils=require(_0xaacb('0x14'));var config=require(_0xaacb('0x15'));var licenseUtil=require(_0xaacb('0x16'));var db=require(_0xaacb('0x17'))['db'];function respondWithStatusCode(_0x2d59f1,_0x5af11c){_0x5af11c=_0x5af11c||0xcc;return function(_0x3e7490){if(_0x3e7490){return _0x2d59f1[_0xaacb('0x18')](_0x5af11c);}return _0x2d59f1[_0xaacb('0x19')](_0x5af11c)[_0xaacb('0x1a')]();};}function respondWithResult(_0x15ac29,_0x235ec9){_0x235ec9=_0x235ec9||0xc8;return function(_0x1b445b){if(_0x1b445b){return _0x15ac29[_0xaacb('0x19')](_0x235ec9)['json'](_0x1b445b);}};}function respondWithFilteredResult(_0x3a48ab,_0x14f6cc){return function(_0x3dfe1f){if(_0x3dfe1f){var _0x44ee63=typeof _0x14f6cc[_0xaacb('0x1b')]===_0xaacb('0x1c')&&typeof _0x14f6cc['limit']===_0xaacb('0x1c');var _0x462a8b=_0x3dfe1f['count'];var _0x1b88b9=_0x44ee63?0x0:_0x14f6cc[_0xaacb('0x1b')];var _0x1004cd=_0x44ee63?_0x3dfe1f[_0xaacb('0x1d')]:_0x14f6cc[_0xaacb('0x1b')]+_0x14f6cc[_0xaacb('0x1e')];var _0x505eaa;if(_0x1004cd>=_0x462a8b){_0x1004cd=_0x462a8b;_0x505eaa=0xc8;}else{_0x505eaa=0xce;}_0x3a48ab[_0xaacb('0x19')](_0x505eaa);return _0x3a48ab[_0xaacb('0x1f')](_0xaacb('0x20'),_0x1b88b9+'-'+_0x1004cd+'/'+_0x462a8b)[_0xaacb('0x21')](_0x3dfe1f);}return null;};}function patchUpdates(_0x31d8e4){return function(_0x5cff18){try{jsonpatch[_0xaacb('0x22')](_0x5cff18,_0x31d8e4,!![]);}catch(_0x42f69){return BPromise[_0xaacb('0x23')](_0x42f69);}return _0x5cff18[_0xaacb('0x24')]();};}function saveUpdates(_0x3840f0,_0x31fe46){return function(_0x3d4574){if(_0x3d4574){return _0x3d4574[_0xaacb('0x25')](_0x3840f0)[_0xaacb('0x26')](function(_0x2f42d6){return _0x2f42d6;});}return null;};}function removeEntity(_0x546d17,_0x2534dd){return function(_0x240a23){if(_0x240a23){return _0x240a23['destroy']()[_0xaacb('0x26')](function(){_0x546d17[_0xaacb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa4df,_0x1f4432){return function(_0xd7af7b){if(!_0xd7af7b){_0x4aa4df[_0xaacb('0x18')](0x194);}return _0xd7af7b;};}function handleError(_0x500b9a,_0xbaa478){_0xbaa478=_0xbaa478||0x1f4;return function(_0x4b5815){logger[_0xaacb('0x27')](_0x4b5815[_0xaacb('0x28')]);if(_0x4b5815[_0xaacb('0x29')]){delete _0x4b5815['name'];}_0x500b9a[_0xaacb('0x19')](_0xbaa478)[_0xaacb('0x2a')](_0x4b5815);};}exports[_0xaacb('0x2b')]=function(_0x1696ee,_0x395bfd){var _0x43122c={},_0xcc9316={},_0x5ee4b6={'count':0x0,'rows':[]};var _0x160b3b=_['map'](db[_0xaacb('0x2c')]['rawAttributes'],function(_0x34f332){return{'name':_0x34f332[_0xaacb('0x2d')],'type':_0x34f332['type']['key']};});_0xcc9316[_0xaacb('0x2e')]=_[_0xaacb('0x2f')](_0x160b3b,_0xaacb('0x29'));_0xcc9316['query']=_[_0xaacb('0x30')](_0x1696ee[_0xaacb('0x31')]);_0xcc9316['filters']=_[_0xaacb('0x32')](_0xcc9316[_0xaacb('0x2e')],_0xcc9316['query']);_0x43122c['attributes']=_['intersection'](_0xcc9316[_0xaacb('0x2e')],qs[_0xaacb('0x33')](_0x1696ee[_0xaacb('0x31')]['fields']));_0x43122c[_0xaacb('0x34')]=_0x43122c[_0xaacb('0x34')][_0xaacb('0x35')]?_0x43122c[_0xaacb('0x34')]:_0xcc9316['model'];if(!_0x1696ee['query'][_0xaacb('0x36')](_0xaacb('0x37'))){_0x43122c['limit']=qs[_0xaacb('0x1e')](_0x1696ee['query'][_0xaacb('0x1e')]);_0x43122c['offset']=qs[_0xaacb('0x1b')](_0x1696ee[_0xaacb('0x31')][_0xaacb('0x1b')]);}_0x43122c['order']=qs[_0xaacb('0x38')](_0x1696ee[_0xaacb('0x31')][_0xaacb('0x38')]);_0x43122c[_0xaacb('0x39')]=qs[_0xaacb('0x3a')](_[_0xaacb('0x3b')](_0x1696ee[_0xaacb('0x31')],_0xcc9316[_0xaacb('0x3a')]),_0x160b3b);if(_0x1696ee[_0xaacb('0x31')]['filter']){_0x43122c[_0xaacb('0x39')]=_[_0xaacb('0x3c')](_0x43122c[_0xaacb('0x39')],{'$or':_[_0xaacb('0x2f')](_0x160b3b,function(_0x9b3137){if(_0x9b3137[_0xaacb('0x3d')]!==_0xaacb('0x3e')){var _0x30142b={};_0x30142b[_0x9b3137['name']]={'$like':'%'+_0x1696ee['query'][_0xaacb('0x3f')]+'%'};return _0x30142b;}})});}_0x43122c=_[_0xaacb('0x3c')]({},_0x43122c,_0x1696ee['options']);var _0x18c608={'where':_0x43122c[_0xaacb('0x39')]};return db[_0xaacb('0x2c')]['count'](_0x18c608)['then'](function(_0x225c73){_0x5ee4b6[_0xaacb('0x1d')]=_0x225c73;if(_0x1696ee[_0xaacb('0x31')][_0xaacb('0x40')]){_0x43122c[_0xaacb('0x41')]=[{'all':!![]}];}return db[_0xaacb('0x2c')]['findAll'](_0x43122c);})['then'](function(_0x4a30c8){_0x5ee4b6[_0xaacb('0x42')]=_0x4a30c8;return _0x5ee4b6;})[_0xaacb('0x26')](respondWithFilteredResult(_0x395bfd,_0x43122c))[_0xaacb('0x43')](handleError(_0x395bfd,null));};exports[_0xaacb('0x44')]=function(_0x556859,_0x35ac28){var _0x18ce7a={'raw':!![],'where':{'id':_0x556859[_0xaacb('0x45')]['id']}},_0x4427ff={};_0x4427ff['model']=_['keys'](db['VoiceQueuesLog'][_0xaacb('0x46')]);_0x4427ff[_0xaacb('0x31')]=_[_0xaacb('0x30')](_0x556859[_0xaacb('0x31')]);_0x4427ff['filters']=_['intersection'](_0x4427ff['model'],_0x4427ff[_0xaacb('0x31')]);_0x18ce7a[_0xaacb('0x34')]=_['intersection'](_0x4427ff['model'],qs[_0xaacb('0x33')](_0x556859['query']['fields']));_0x18ce7a[_0xaacb('0x34')]=_0x18ce7a['attributes'][_0xaacb('0x35')]?_0x18ce7a[_0xaacb('0x34')]:_0x4427ff['model'];if(_0x556859[_0xaacb('0x31')]['includeAll']){_0x18ce7a[_0xaacb('0x41')]=[{'all':!![]}];}_0x18ce7a=_[_0xaacb('0x3c')]({},_0x18ce7a,_0x556859[_0xaacb('0x47')]);return db['VoiceQueuesLog']['find'](_0x18ce7a)[_0xaacb('0x26')](handleEntityNotFound(_0x35ac28,null))[_0xaacb('0x26')](respondWithResult(_0x35ac28,null))[_0xaacb('0x43')](handleError(_0x35ac28,null));};exports[_0xaacb('0x48')]=function(_0x3a4109,_0x3b88aa){return db[_0xaacb('0x2c')]['create'](_0x3a4109[_0xaacb('0x49')],{})[_0xaacb('0x26')](respondWithResult(_0x3b88aa,0xc9))[_0xaacb('0x43')](handleError(_0x3b88aa,null));};exports[_0xaacb('0x25')]=function(_0x29fabd,_0x4fa473){if(_0x29fabd[_0xaacb('0x49')]['id']){delete _0x29fabd[_0xaacb('0x49')]['id'];}return db['VoiceQueuesLog'][_0xaacb('0x4a')]({'where':{'id':_0x29fabd[_0xaacb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4fa473,null))['then'](saveUpdates(_0x29fabd[_0xaacb('0x49')],null))[_0xaacb('0x26')](respondWithResult(_0x4fa473,null))['catch'](handleError(_0x4fa473,null));};exports[_0xaacb('0x4b')]=function(_0x42fb8e,_0x16e21e){return db[_0xaacb('0x2c')]['find']({'where':{'id':_0x42fb8e[_0xaacb('0x45')]['id']}})[_0xaacb('0x26')](handleEntityNotFound(_0x16e21e,null))[_0xaacb('0x26')](removeEntity(_0x16e21e,null))[_0xaacb('0x43')](handleError(_0x16e21e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e7004cf..8a14b7e 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 _0xfe60=['define','VoiceQueuesLog','voice_queues_log','event','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3c04d7,_0x472801){var _0x2fb24=function(_0x335b91){while(--_0x335b91){_0x3c04d7['push'](_0x3c04d7['shift']());}};_0x2fb24(++_0x472801);}(_0xfe60,0x1cb));var _0x0fe6=function(_0xc6d35b,_0xab81f3){_0xc6d35b=_0xc6d35b-0x0;var _0x257e01=_0xfe60[_0xc6d35b];return _0x257e01;};'use strict';var _=require('lodash');var util=require(_0x0fe6('0x0'));var logger=require('../../config/logger')(_0x0fe6('0x1'));var moment=require(_0x0fe6('0x2'));var BPromise=require(_0x0fe6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fe6('0x4'));var rimraf=require(_0x0fe6('0x5'));var config=require(_0x0fe6('0x6'));var attributes=require(_0x0fe6('0x7'));module[_0x0fe6('0x8')]=function(_0x1281fc,_0x13b947){return _0x1281fc[_0x0fe6('0x9')](_0x0fe6('0xa'),attributes,{'tableName':_0x0fe6('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x0fe6('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xeed7=['rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event','dtm','../../config/logger','api','bluebird','request-promise','path'];(function(_0x36c4b7,_0x10dfc9){var _0x524f2c=function(_0x50ceeb){while(--_0x50ceeb){_0x36c4b7['push'](_0x36c4b7['shift']());}};_0x524f2c(++_0x10dfc9);}(_0xeed7,0xdf));var _0x7eed=function(_0x3cb134,_0x3ba10c){_0x3cb134=_0x3cb134-0x0;var _0x45e5da=_0xeed7[_0x3cb134];return _0x45e5da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7eed('0x0'))(_0x7eed('0x1'));var moment=require('moment');var BPromise=require(_0x7eed('0x2'));var rp=require(_0x7eed('0x3'));var fs=require('fs');var path=require(_0x7eed('0x4'));var rimraf=require(_0x7eed('0x5'));var config=require('../../config/environment');var attributes=require(_0x7eed('0x6'));module[_0x7eed('0x7')]=function(_0x5975af,_0x307a00){return _0x5975af[_0x7eed('0x8')](_0x7eed('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x7eed('0xa'),_0x7eed('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index fb4b62a..b0ecf91 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 _0xfbb0=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x572d72,_0x4b1b97){var _0x3fc379=function(_0x3c5562){while(--_0x3c5562){_0x572d72['push'](_0x572d72['shift']());}};_0x3fc379(++_0x4b1b97);}(_0xfbb0,0x1d1));var _0x0fbb=function(_0x2a68ce,_0x7f9d9d){_0x2a68ce=_0x2a68ce-0x0;var _0x5d20f2=_0xfbb0[_0x2a68ce];return _0x5d20f2;};'use strict';var _=require(_0x0fbb('0x0'));var util=require(_0x0fbb('0x1'));var moment=require('moment');var BPromise=require(_0x0fbb('0x2'));var rs=require(_0x0fbb('0x3'));var fs=require('fs');var Redis=require(_0x0fbb('0x4'));var db=require(_0x0fbb('0x5'))['db'];var utils=require(_0x0fbb('0x6'));var logger=require(_0x0fbb('0x7'))(_0x0fbb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x427f4a,_0x534a79,_0x297029){return new BPromise(function(_0xead4d4,_0x2a1c36){return client[_0x0fbb('0x9')](_0x427f4a,_0x297029)[_0x0fbb('0xa')](function(_0x1898c5){logger[_0x0fbb('0xb')](_0x0fbb('0xc'),_0x534a79,_0x0fbb('0xd'));logger['debug'](_0x0fbb('0xe'),_0x534a79,'request\x20sent',JSON[_0x0fbb('0xf')](_0x1898c5));if(_0x1898c5[_0x0fbb('0x10')]){if(_0x1898c5[_0x0fbb('0x10')][_0x0fbb('0x11')]===0x1f4){logger[_0x0fbb('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x534a79,_0x1898c5[_0x0fbb('0x10')][_0x0fbb('0x12')]);return _0x2a1c36(_0x1898c5[_0x0fbb('0x10')][_0x0fbb('0x12')]);}logger[_0x0fbb('0x10')](_0x0fbb('0xc'),_0x534a79,_0x1898c5[_0x0fbb('0x10')][_0x0fbb('0x12')]);return _0xead4d4(_0x1898c5[_0x0fbb('0x10')][_0x0fbb('0x12')]);}else{logger[_0x0fbb('0xb')](_0x0fbb('0xc'),_0x534a79,'request\x20sent');_0xead4d4(_0x1898c5[_0x0fbb('0x13')][_0x0fbb('0x12')]);}})[_0x0fbb('0x14')](function(_0x554b19){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x534a79,_0x554b19);_0x2a1c36(_0x554b19);});});} \ No newline at end of file +var _0x26ab=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x472260,_0x55e796){var _0x5c890b=function(_0x533801){while(--_0x533801){_0x472260['push'](_0x472260['shift']());}};_0x5c890b(++_0x55e796);}(_0x26ab,0x117));var _0xb26a=function(_0x3c8eea,_0x1edebd){_0x3c8eea=_0x3c8eea-0x0;var _0x17898e=_0x26ab[_0x3c8eea];return _0x17898e;};'use strict';var _=require('lodash');var util=require(_0xb26a('0x0'));var moment=require(_0xb26a('0x1'));var BPromise=require('bluebird');var rs=require(_0xb26a('0x2'));var fs=require('fs');var Redis=require(_0xb26a('0x3'));var db=require(_0xb26a('0x4'))['db'];var utils=require(_0xb26a('0x5'));var logger=require(_0xb26a('0x6'))(_0xb26a('0x7'));var config=require(_0xb26a('0x8'));var jayson=require(_0xb26a('0x9'));var client=jayson['client'][_0xb26a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb94904,_0x4d02f7,_0x211ff9){return new BPromise(function(_0x470a67,_0x1bacc3){return client[_0xb26a('0xb')](_0xb94904,_0x211ff9)[_0xb26a('0xc')](function(_0x173db8){logger[_0xb26a('0xd')](_0xb26a('0xe'),_0x4d02f7,_0xb26a('0xf'));logger['debug'](_0xb26a('0x10'),_0x4d02f7,_0xb26a('0xf'),JSON[_0xb26a('0x11')](_0x173db8));if(_0x173db8['error']){if(_0x173db8[_0xb26a('0x12')][_0xb26a('0x13')]===0x1f4){logger[_0xb26a('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4d02f7,_0x173db8['error'][_0xb26a('0x14')]);return _0x1bacc3(_0x173db8['error']['message']);}logger['error'](_0xb26a('0xe'),_0x4d02f7,_0x173db8[_0xb26a('0x12')]['message']);return _0x470a67(_0x173db8['error'][_0xb26a('0x14')]);}else{logger[_0xb26a('0xd')](_0xb26a('0xe'),_0x4d02f7,_0xb26a('0xf'));_0x470a67(_0x173db8['result']['message']);}})[_0xb26a('0x15')](function(_0x49d824){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4d02f7,_0x49d824);_0x1bacc3(_0x49d824);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 49f0476..ef2d857 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 _0x5ca7=['/describe','describe','/:id','isAuthenticated','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x2e2af7,_0x55040b){var _0x2aabdb=function(_0x1fd546){while(--_0x1fd546){_0x2e2af7['push'](_0x2e2af7['shift']());}};_0x2aabdb(++_0x55040b);}(_0x5ca7,0xd0));var _0x75ca=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x5ca7[_0x28947d];return _0x12d2ee;};'use strict';var multer=require('multer');var util=require(_0x75ca('0x0'));var path=require('path');var timeout=require(_0x75ca('0x1'));var express=require('express');var router=express[_0x75ca('0x2')]();var fs_extra=require(_0x75ca('0x3'));var auth=require(_0x75ca('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75ca('0x5'));var controller=require(_0x75ca('0x6'));router[_0x75ca('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75ca('0x7')](_0x75ca('0x8'),auth['isAuthenticated'](),controller[_0x75ca('0x9')]);router['get'](_0x75ca('0xa'),auth[_0x75ca('0xb')](),controller[_0x75ca('0xc')]);router['get']('/:id/download',auth[_0x75ca('0xb')](),controller[_0x75ca('0xd')]);router['get'](_0x75ca('0xe'),controller[_0x75ca('0xf')]);router[_0x75ca('0x7')](_0x75ca('0x10'),auth[_0x75ca('0xb')](),controller[_0x75ca('0x11')]);router[_0x75ca('0x12')]('/',auth[_0x75ca('0xb')](),controller[_0x75ca('0x13')]);router['post']('/:id/transcribe',auth[_0x75ca('0xb')](),controller['runTranscribe']);router[_0x75ca('0x14')]('/:id',auth[_0x75ca('0xb')](),controller[_0x75ca('0x15')]);router[_0x75ca('0x16')](_0x75ca('0xa'),auth[_0x75ca('0xb')](),controller['destroy']);module[_0x75ca('0x17')]=router; \ No newline at end of file +var _0x8702=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/:id','isAuthenticated','show','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x479ab,_0x568c3d){var _0x425af4=function(_0x17a307){while(--_0x17a307){_0x479ab['push'](_0x479ab['shift']());}};_0x425af4(++_0x568c3d);}(_0x8702,0x17b));var _0x2870=function(_0x5bcffe,_0x4e0b0c){_0x5bcffe=_0x5bcffe-0x0;var _0x2fa0ce=_0x8702[_0x5bcffe];return _0x2fa0ce;};'use strict';var multer=require('multer');var util=require(_0x2870('0x0'));var path=require(_0x2870('0x1'));var timeout=require(_0x2870('0x2'));var express=require(_0x2870('0x3'));var router=express[_0x2870('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2870('0x5'));var interaction=require(_0x2870('0x6'));var config=require(_0x2870('0x7'));var controller=require(_0x2870('0x8'));router[_0x2870('0x9')]('/',auth['isAuthenticated'](),controller[_0x2870('0xa')]);router[_0x2870('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2870('0x9')](_0x2870('0xb'),auth[_0x2870('0xc')](),controller[_0x2870('0xd')]);router[_0x2870('0x9')]('/:id/download',auth[_0x2870('0xc')](),controller['download']);router[_0x2870('0x9')](_0x2870('0xe'),controller[_0x2870('0xf')]);router[_0x2870('0x9')](_0x2870('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x2870('0x11')]('/',auth[_0x2870('0xc')](),controller['create']);router[_0x2870('0x11')]('/:id/transcribe',auth[_0x2870('0xc')](),controller[_0x2870('0x12')]);router[_0x2870('0x13')](_0x2870('0xb'),auth[_0x2870('0xc')](),controller[_0x2870('0x14')]);router[_0x2870('0x15')](_0x2870('0xb'),auth[_0x2870('0xc')](),controller[_0x2870('0x16')]);module[_0x2870('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index d8ee221..2a8d56f 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index aba4b70..db6742f 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 _0x9500=['updateAttributes','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','destroy','then','error','stack','name','index','map','VoiceRecording','type','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','keys','rawAttributes','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','sequelize','col','token','push','$and','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','unlinkSync','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment'];(function(_0x4f0863,_0xfaf310){var _0x3d3fe8=function(_0x11aa1e){while(--_0x11aa1e){_0x4f0863['push'](_0x4f0863['shift']());}};_0x3d3fe8(++_0xfaf310);}(_0x9500,0x9a));var _0x0950=function(_0x59301f,_0x1e49a3){_0x59301f=_0x59301f-0x0;var _0x24f4de=_0x9500[_0x59301f];return _0x24f4de;};'use strict';var emlformat=require(_0x0950('0x0'));var rimraf=require(_0x0950('0x1'));var zipdir=require(_0x0950('0x2'));var jsonpatch=require(_0x0950('0x3'));var rp=require(_0x0950('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0950('0x5'));var sox=require(_0x0950('0x6'));var csv=require('to-csv');var ejs=require(_0x0950('0x7'));var fs=require('fs');var fs_extra=require(_0x0950('0x8'));var _=require(_0x0950('0x9'));var squel=require(_0x0950('0xa'));var crypto=require(_0x0950('0xb'));var jsforce=require(_0x0950('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0950('0xd'));var querystring=require(_0x0950('0xe'));var Papa=require(_0x0950('0xf'));var AWS=require(_0x0950('0x10'));var uuidv4=require(_0x0950('0x11'));var Redis=require('ioredis');var authService=require(_0x0950('0x12'));var qs=require(_0x0950('0x13'));var as=require(_0x0950('0x14'));var hardwareService=require(_0x0950('0x15'));var logger=require(_0x0950('0x16'))('api');var utils=require(_0x0950('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0950('0x18'))['db'];function respondWithStatusCode(_0x25f4de,_0x122cf7){_0x122cf7=_0x122cf7||0xcc;return function(_0x264750){if(_0x264750){return _0x25f4de[_0x0950('0x19')](_0x122cf7);}return _0x25f4de[_0x0950('0x1a')](_0x122cf7)[_0x0950('0x1b')]();};}function respondWithResult(_0x39af30,_0xc9b109){_0xc9b109=_0xc9b109||0xc8;return function(_0x6edb89){if(_0x6edb89){return _0x39af30[_0x0950('0x1a')](_0xc9b109)[_0x0950('0x1c')](_0x6edb89);}};}function respondWithFilteredResult(_0xe6cadd,_0x3b62a2){return function(_0x1ad94f){if(_0x1ad94f){var _0x518f49=typeof _0x3b62a2['offset']===_0x0950('0x1d')&&typeof _0x3b62a2[_0x0950('0x1e')]===_0x0950('0x1d');var _0x27080e=_0x1ad94f['count'];var _0x514437=_0x518f49?0x0:_0x3b62a2[_0x0950('0x1f')];var _0x438bb0=_0x518f49?_0x1ad94f[_0x0950('0x20')]:_0x3b62a2[_0x0950('0x1f')]+_0x3b62a2[_0x0950('0x1e')];var _0x784768;if(_0x438bb0>=_0x27080e){_0x438bb0=_0x27080e;_0x784768=0xc8;}else{_0x784768=0xce;}_0xe6cadd[_0x0950('0x1a')](_0x784768);return _0xe6cadd[_0x0950('0x21')]('Content-Range',_0x514437+'-'+_0x438bb0+'/'+_0x27080e)[_0x0950('0x1c')](_0x1ad94f);}return null;};}function patchUpdates(_0x3da508){return function(_0x58b72c){try{jsonpatch['apply'](_0x58b72c,_0x3da508,!![]);}catch(_0x566941){return BPromise[_0x0950('0x22')](_0x566941);}return _0x58b72c[_0x0950('0x23')]();};}function saveUpdates(_0x5e58a7,_0x94adeb){return function(_0x44e592){if(_0x44e592){return _0x44e592[_0x0950('0x24')](_0x5e58a7)['then'](function(_0x2b42f7){return _0x2b42f7;});}return null;};}function removeEntity(_0x28d29d,_0x43af80){return function(_0x57cb73){if(_0x57cb73){return _0x57cb73[_0x0950('0x25')]()[_0x0950('0x26')](function(){_0x28d29d[_0x0950('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x448e52,_0x44827b){return function(_0x43a242){if(!_0x43a242){_0x448e52[_0x0950('0x19')](0x194);}return _0x43a242;};}function handleError(_0x2cc747,_0x2bf728){_0x2bf728=_0x2bf728||0x1f4;return function(_0x2571dd){logger[_0x0950('0x27')](_0x2571dd[_0x0950('0x28')]);if(_0x2571dd[_0x0950('0x29')]){delete _0x2571dd[_0x0950('0x29')];}_0x2cc747[_0x0950('0x1a')](_0x2bf728)['send'](_0x2571dd);};}exports[_0x0950('0x2a')]=function(_0x58731c,_0x592753){var _0xd75f59={},_0x421026={},_0x39d57a={'count':0x0,'rows':[]};var _0xb94a6f=_[_0x0950('0x2b')](db[_0x0950('0x2c')]['rawAttributes'],function(_0x3e2345){return{'name':_0x3e2345['fieldName'],'type':_0x3e2345[_0x0950('0x2d')]['key']};});_0x421026[_0x0950('0x2e')]=_[_0x0950('0x2f')](_[_0x0950('0x2b')](_0xb94a6f,'name'),['format']);_0x421026[_0x0950('0x30')]=_['keys'](_0x58731c[_0x0950('0x30')]);_0x421026['filters']=_[_0x0950('0x31')](_0x421026[_0x0950('0x2e')],_0x421026[_0x0950('0x30')]);_0xd75f59[_0x0950('0x32')]=_[_0x0950('0x31')](_0x421026[_0x0950('0x2e')],qs[_0x0950('0x33')](_0x58731c[_0x0950('0x30')][_0x0950('0x33')]));_0xd75f59[_0x0950('0x32')]=_0xd75f59[_0x0950('0x32')][_0x0950('0x34')]?_0xd75f59[_0x0950('0x32')]:_0x421026[_0x0950('0x2e')];if(!_0x58731c[_0x0950('0x30')][_0x0950('0x35')](_0x0950('0x36'))){_0xd75f59['limit']=qs[_0x0950('0x1e')](_0x58731c['query'][_0x0950('0x1e')]);_0xd75f59[_0x0950('0x1f')]=qs['offset'](_0x58731c[_0x0950('0x30')][_0x0950('0x1f')]);}_0xd75f59[_0x0950('0x37')]=qs[_0x0950('0x38')](_0x58731c['query'][_0x0950('0x38')]);_0xd75f59[_0x0950('0x39')]=qs[_0x0950('0x3a')](_[_0x0950('0x3b')](_0x58731c[_0x0950('0x30')],_0x421026['filters']),_0xb94a6f);if(_0x58731c[_0x0950('0x30')][_0x0950('0x3c')]){_0xd75f59[_0x0950('0x39')]=_['merge'](_0xd75f59[_0x0950('0x39')],{'$or':_['map'](_0xb94a6f,function(_0x32705a){if(_0x32705a[_0x0950('0x2d')]!==_0x0950('0x3d')){var _0x5519fe={};_0x5519fe[_0x32705a[_0x0950('0x29')]]={'$like':'%'+_0x58731c[_0x0950('0x30')][_0x0950('0x3c')]+'%'};return _0x5519fe;}})});}_0xd75f59=_[_0x0950('0x3e')]({},_0xd75f59,_0x58731c[_0x0950('0x3f')]);var _0x483cdd={'where':_0xd75f59['where']};return db[_0x0950('0x2c')]['count'](_0x483cdd)[_0x0950('0x26')](function(_0x426903){_0x39d57a[_0x0950('0x20')]=_0x426903;if(_0x58731c['query'][_0x0950('0x40')]){_0xd75f59['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x0950('0x41')](_0xd75f59);})[_0x0950('0x26')](function(_0x29d7a7){_0x39d57a[_0x0950('0x42')]=_0x29d7a7;return _0x39d57a;})[_0x0950('0x26')](respondWithFilteredResult(_0x592753,_0xd75f59))['catch'](handleError(_0x592753,null));};exports['show']=function(_0x10f890,_0x2a816b){var _0x17c631={'raw':![],'where':{'id':_0x10f890[_0x0950('0x43')]['id']}},_0x317bec={};_0x317bec[_0x0950('0x2e')]=_[_0x0950('0x44')](db[_0x0950('0x2c')][_0x0950('0x45')]);_0x317bec[_0x0950('0x30')]=_[_0x0950('0x44')](_0x10f890[_0x0950('0x30')]);_0x317bec[_0x0950('0x3a')]=_[_0x0950('0x31')](_0x317bec[_0x0950('0x2e')],_0x317bec[_0x0950('0x30')]);_0x17c631[_0x0950('0x32')]=_['intersection'](_0x317bec['model'],qs[_0x0950('0x33')](_0x10f890['query'][_0x0950('0x33')]));_0x17c631['attributes']=_0x17c631['attributes'][_0x0950('0x34')]?_0x17c631[_0x0950('0x32')]:_0x317bec[_0x0950('0x2e')];if(_0x10f890[_0x0950('0x30')][_0x0950('0x40')]){_0x17c631['include']=[{'all':!![]}];}_0x17c631=_[_0x0950('0x3e')]({},_0x17c631,_0x10f890['options']);return db[_0x0950('0x2c')][_0x0950('0x46')](_0x17c631)['then'](handleEntityNotFound(_0x2a816b,null))[_0x0950('0x26')](respondWithResult(_0x2a816b,null))[_0x0950('0x47')](handleError(_0x2a816b,null));};exports[_0x0950('0x48')]=function(_0x3e054e,_0x4899ae){return db[_0x0950('0x2c')][_0x0950('0x48')](_0x3e054e['body'],{})[_0x0950('0x26')](respondWithResult(_0x4899ae,0xc9))[_0x0950('0x47')](handleError(_0x4899ae,null));};exports[_0x0950('0x24')]=function(_0x4bcd1a,_0x1e3f63){if(_0x4bcd1a[_0x0950('0x49')]['id']){delete _0x4bcd1a['body']['id'];}return db[_0x0950('0x2c')][_0x0950('0x46')]({'where':{'id':_0x4bcd1a[_0x0950('0x43')]['id']}})[_0x0950('0x26')](handleEntityNotFound(_0x1e3f63,null))[_0x0950('0x26')](saveUpdates(_0x4bcd1a[_0x0950('0x49')],null))[_0x0950('0x26')](respondWithResult(_0x1e3f63,null))['catch'](handleError(_0x1e3f63,null));};exports['describe']=function(_0x27ff95,_0x3f641f){return db[_0x0950('0x2c')][_0x0950('0x4a')]()[_0x0950('0x26')](respondWithResult(_0x3f641f,null))[_0x0950('0x47')](handleError(_0x3f641f,null));};exports[_0x0950('0x4b')]=function(_0x1d9a94,_0x509913,_0x38cc43){var _0x5996d6=require(_0x0950('0x4c'));var _0x523108=![];var _0x22dba3={};if(_0x1d9a94[_0x0950('0x30')][_0x0950('0x2d')]&&_0x1d9a94[_0x0950('0x30')][_0x0950('0x2d')]===_0x0950('0x4d')){_0x22dba3['uniqueid']=_0x1d9a94[_0x0950('0x43')]['id'];}else{_0x22dba3['id']=_0x1d9a94['params']['id'];}return db[_0x0950('0x2c')]['find']({'where':_0x22dba3,'attributes':['id',_0x0950('0x4e')],'raw':!![]})[_0x0950('0x26')](handleEntityNotFound(_0x509913,null))[_0x0950('0x26')](function(_0x3a7465){if(_0x3a7465){var _0x2081a3=_0x3a7465[_0x0950('0x4e')];var _0x4c6a32=util[_0x0950('0x4f')](_0x0950('0x50'),_0x2081a3);if(fs['existsSync'](_0x4c6a32)){_0x523108=!![];return _0x5996d6[_0x0950('0x51')](_0x4c6a32,_0x2081a3,config[_0x0950('0x52')][_0x0950('0x53')])[_0x0950('0x26')](function(){return _0x3a7465;});}return _0x3a7465;}})['then'](function(_0x50f79e){if(_0x50f79e){var _0x54d521=_0x50f79e['value'];if(!fs[_0x0950('0x54')](_0x54d521)){throw new db[(_0x0950('0x55'))][(_0x0950('0x56'))](_0x0950('0x57'));}if(_0x50f79e[_0x0950('0x58')]){return _0x509913[_0x0950('0x4b')](_0x54d521,_0x50f79e[_0x0950('0x58')]+path[_0x0950('0x59')](_0x54d521),function(){if(_0x523108){fs['unlink'](_0x54d521);}});}else{return _0x509913[_0x0950('0x4b')](_0x54d521,function(_0x47395b){if(_0x523108){fs[_0x0950('0x5a')](_0x54d521);}});}}})['catch'](function(_0x94a16e){if(_0x94a16e[_0x0950('0x5b')]==='VoiceRecording\x20not\x20found'){_0x509913[_0x0950('0x1a')](0x194)[_0x0950('0x5c')](_0x0950('0x5d'));}else{return handleError(_0x509913,null);}});};exports['downloads']=function(_0x475b0d,_0x443ef4,_0x266671){var _0x4f540b=require(_0x0950('0x4c'));var _0x5719c0=![];var _0x1fed57={'$and':[db[_0x0950('0x5e')][_0x0950('0x39')](db['sequelize']['fn']('MD5',db[_0x0950('0x5e')][_0x0950('0x5f')](_0x0950('0x4d'))),_0x475b0d[_0x0950('0x30')][_0x0950('0x60')])]};if(_0x475b0d[_0x0950('0x30')][_0x0950('0x2d')]&&_0x475b0d[_0x0950('0x30')][_0x0950('0x2d')]==='uniqueid'){_0x1fed57['$and'][_0x0950('0x61')]({'uniqueid':_0x475b0d['params']['id']});}else{_0x1fed57[_0x0950('0x62')][_0x0950('0x61')]({'id':_0x475b0d[_0x0950('0x43')]['id']});}return db[_0x0950('0x2c')][_0x0950('0x46')]({'where':_0x1fed57,'attributes':['id',_0x0950('0x4e')],'raw':!![]})[_0x0950('0x26')](handleEntityNotFound(_0x443ef4,null))[_0x0950('0x26')](function(_0x50a3f2){if(_0x50a3f2){var _0x56ae44=util['format'](_0x0950('0x50'),_0x50a3f2[_0x0950('0x4e')]);if(fs[_0x0950('0x54')](_0x56ae44)){_0x5719c0=!![];return _0x4f540b[_0x0950('0x51')](_0x56ae44,_0x50a3f2[_0x0950('0x4e')],config[_0x0950('0x52')][_0x0950('0x53')])[_0x0950('0x26')](function(){return _0x50a3f2;});}return _0x50a3f2;}})['then'](function(_0x30fc58){if(_0x30fc58){if(!fs[_0x0950('0x54')](_0x30fc58[_0x0950('0x4e')])){throw new db['Sequelize']['ValidationError'](_0x0950('0x57'));}if(_0x30fc58[_0x0950('0x58')]){return _0x443ef4['download'](_0x30fc58[_0x0950('0x4e')],_0x30fc58[_0x0950('0x58')]+path[_0x0950('0x59')](_0x30fc58[_0x0950('0x4e')]),function(){if(_0x5719c0){fs['unlink'](_0x30fc58[_0x0950('0x4e')]);}});}else{return _0x443ef4['download'](_0x30fc58[_0x0950('0x4e')],function(_0x4394ff){if(_0x5719c0){fs['unlink'](_0x30fc58['value']);}});}}})[_0x0950('0x47')](handleError(_0x443ef4,null));};exports['destroy']=function(_0x307d8a,_0x29493a){return db[_0x0950('0x2c')][_0x0950('0x46')]({'where':{'id':_0x307d8a[_0x0950('0x43')]['id']}})['then'](function(_0x1f02d9){if(_['isNil'](_0x1f02d9)){throw new ReferenceError(_0x0950('0x63'));}return _0x1f02d9;})[_0x0950('0x26')](function(_0x384836){var _0x85c02f=_0x384836['value'];logger[_0x0950('0x64')](_0x0950('0x65'),_0x85c02f);if(!_[_0x0950('0x66')](_0x384836['value'])&&fs[_0x0950('0x54')](_0x85c02f)){logger[_0x0950('0x64')]('File:\x20\x22'+_0x85c02f+_0x0950('0x67'));fs['unlinkSync'](_0x85c02f);}_0x85c02f=_0x85c02f+'.cypher';if(!_[_0x0950('0x66')](_0x384836[_0x0950('0x4e')])&&fs[_0x0950('0x54')](_0x85c02f)){logger['info'](_0x0950('0x68')+_0x85c02f+_0x0950('0x67'));fs[_0x0950('0x69')](_0x85c02f);}return _0x384836;})[_0x0950('0x26')](function(_0x3b7a72){if(!_0x3b7a72)throw new InternalError();return _0x3b7a72[_0x0950('0x25')]();})[_0x0950('0x26')](function(){_0x29493a['status'](0xcc)[_0x0950('0x1b')]();})[_0x0950('0x47')](handleError(_0x29493a,null));};function getBucketslist(_0x3907ae,_0x345333,_0xc6988e){return new Promise(function(_0x67c510,_0x4ca6b7){var _0x242f67=new AWS['S3']({'accessKeyId':_0x345333,'secretAccessKey':_0x3907ae,'region':_0xc6988e});_0x242f67[_0x0950('0x6a')]({},function(_0x309506,_0x43ea50){if(_0x309506){return _0x4ca6b7(_0x309506);}else{return _0x67c510(_0x43ea50);}});});}function createBucket(_0x8d4e08,_0x42fb1f,_0x56db40,_0x3d78e4){return new Promise(function(_0x3f3c87,_0x21dfb8){var _0x16f795=new AWS['S3']({'accessKeyId':_0x42fb1f,'secretAccessKey':_0x8d4e08,'region':_0x56db40});_0x16f795[_0x0950('0x6b')]({'Bucket':_0x3d78e4},function(_0x3b0270,_0x70732a){if(_0x3b0270){return _0x21dfb8(_0x3b0270);}else{return _0x3f3c87(_0x70732a);}});});}function uploadFile(_0x6487a1,_0x55a015,_0x304ec6,_0x2a4733,_0x505115,_0xfb7a5b){return new Promise(function(_0x26824c,_0x153d70){var _0x549637=new AWS['S3']({'accessKeyId':_0x55a015,'secretAccessKey':_0x6487a1,'region':_0x304ec6});_0x549637['upload']({'Bucket':_0x2a4733,'Key':_0x505115,'Body':_0xfb7a5b},function(_0x82e519,_0x4dab80){if(_0x82e519){return _0x153d70(_0x82e519);}else{return _0x26824c(_0x4dab80);}});});}function startTranscribe(_0x1c6233,_0x492bad,_0x4a8642,_0x45d085,_0x3d0401,_0x560f60){return new Promise(function(_0xb62be5,_0x537884){var _0x58d3b3=new AWS[(_0x0950('0x6c'))]({'accessKeyId':_0x492bad,'secretAccessKey':_0x1c6233,'region':_0x4a8642});_0x58d3b3['startTranscriptionJob']({'TranscriptionJobName':_0x45d085,'LanguageCode':_0x3d0401,'Media':{'MediaFileUri':_0x560f60}},function(_0x5cdfd2,_0x1a219e){if(_0x5cdfd2){return _0x537884(_0x5cdfd2);}else{return _0xb62be5(_0x1a219e);}});});}function transcribe(_0x552464,_0x261605,_0xe724fd,_0x5762d7,_0x126ff7,_0x25a6b8,_0x594c7b){return new Promise(function(_0x1dfc2c,_0x57541e){var _0x25cf7c={};logger['info'](util[_0x0950('0x4f')](_0x0950('0x6d'),_0x552464,_0x126ff7));return uploadFile(_0x261605,_0xe724fd,_0x5762d7,_0x126ff7,path['basename'](_0x25a6b8),fs['readFileSync'](_0x25a6b8))[_0x0950('0x26')](function(_0x151f76){logger[_0x0950('0x64')](util[_0x0950('0x4f')](_0x0950('0x6e'),_0x552464,_0x126ff7,_0x151f76['Location']));_0x25cf7c[_0x0950('0x6f')]=_0x151f76[_0x0950('0x70')];_0x25cf7c['location']=_0x151f76[_0x0950('0x71')];logger[_0x0950('0x64')](util[_0x0950('0x4f')](_0x0950('0x72'),_0x552464));return startTranscribe(_0x261605,_0xe724fd,_0x5762d7,uuidv4(),_0x594c7b,_0x151f76['Location']);})[_0x0950('0x26')](function(_0x455305){logger['info'](util[_0x0950('0x4f')](_0x0950('0x73'),_0x552464,_0x455305[_0x0950('0x74')]['TranscriptionJobName']));_0x25cf7c['transcribeName']=_0x455305['TranscriptionJob'][_0x0950('0x75')];_0x25cf7c[_0x0950('0x76')]=_0x455305[_0x0950('0x74')][_0x0950('0x77')];return _0x1dfc2c(_0x25cf7c);})[_0x0950('0x47')](function(_0x4eb094){return _0x57541e(_0x4eb094);});});}exports['runTranscribe']=function(_0x268ffb,_0xe552b5,_0x5b257a){var _0x387423;var _0x27cca8;var _0x1a452a;var _0x583710=require(_0x0950('0x4c'));return db['VoiceRecording'][_0x0950('0x78')]({'where':{'id':_0x268ffb[_0x0950('0x43')]['id']}})[_0x0950('0x26')](function(_0x40f553){if(_0x40f553){var _0x29e0d1=util['format'](_0x0950('0x50'),_0x40f553['value']);if(fs[_0x0950('0x54')](_0x29e0d1)){cypher=!![];return _0x583710[_0x0950('0x51')](_0x29e0d1,_0x40f553['value'],config[_0x0950('0x52')]['recording'])[_0x0950('0x26')](function(){return _0x40f553;});}return _0x40f553;}})[_0x0950('0x26')](function(_0x1d3a8b){if(!_0x1d3a8b){throw new db['Sequelize'][(_0x0950('0x56'))](_0x0950('0x79'));}_0x27cca8=_0x1d3a8b;return db['Setting'][_0x0950('0x78')]({'where':{'id':0x1}});})[_0x0950('0x26')](handleEntityNotFound(_0xe552b5,null))[_0x0950('0x26')](function(_0x2b9483){if(_0x2b9483){_0x387423=_0x2b9483;if(!_0x387423[_0x0950('0x7a')]||!_0x387423[_0x0950('0x7b')]||!_0x387423['transcribeRegion']||!_0x387423['language']||!_0x387423[_0x0950('0x6f')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x268ffb[_0x0950('0x49')][_0x0950('0x7c')]&&(!_0x387423[_0x0950('0x7d')]||!_0x387423[_0x0950('0x7e')]||!_0x387423['sentimentRegion']||!_0x387423[_0x0950('0x7f')]||!_0x387423['bucket'])){throw new db['Sequelize']['ValidationError'](_0x0950('0x80'));}return db[_0x0950('0x81')][_0x0950('0x78')]({'where':{'id':_0x387423[_0x0950('0x7b')]}});}})[_0x0950('0x26')](function(_0x2bd11f){if(!_0x2bd11f){throw new db[(_0x0950('0x55'))][(_0x0950('0x56'))](_0x0950('0x82'));}if(!_0x2bd11f[_0x0950('0x83')]||!_0x2bd11f[_0x0950('0x84')]){throw new db[(_0x0950('0x55'))]['ValidationError'](_0x0950('0x85'));}_0x1a452a=_0x2bd11f;return getBucketslist(_0x1a452a[_0x0950('0x83')],_0x1a452a[_0x0950('0x84')],_0x387423[_0x0950('0x86')]);})['then'](function(_0x3941b3){if(_0x3941b3&&_0x3941b3[_0x0950('0x87')]){var _0xb4efa0=_['find'](_0x3941b3['Buckets'],function(_0xe0ce8e){return _0xe0ce8e[_0x0950('0x88')]===_0x387423[_0x0950('0x6f')];});if(!_0xb4efa0){logger['info'](util[_0x0950('0x4f')](_0x0950('0x89'),_0x268ffb['params']['id'],_0x387423[_0x0950('0x6f')]));return createBucket(_0x1a452a['data1'],_0x1a452a[_0x0950('0x84')],_0x387423['transcribeRegion'],_0x387423[_0x0950('0x6f')]);}logger[_0x0950('0x64')](util[_0x0950('0x4f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x268ffb[_0x0950('0x43')]['id'],_0x387423['bucket']));return;}})[_0x0950('0x26')](function(_0x1bab44){if(_0x27cca8[_0x0950('0x76')]===_0x0950('0x8a')){return transcribe(_0x268ffb['params']['id'],_0x1a452a[_0x0950('0x83')],_0x1a452a['data2'],_0x387423[_0x0950('0x86')],_0x387423[_0x0950('0x6f')],_0x27cca8[_0x0950('0x4e')],_0x387423[_0x0950('0x7f')]);}else{logger[_0x0950('0x64')](util['format'](_0x0950('0x8b'),_0x268ffb[_0x0950('0x43')]['id']));return{'transcribeStatus':_0x0950('0x8c')};}})[_0x0950('0x26')](function(_0x4460c3){if(_0x4460c3){_0x4460c3[_0x0950('0x8d')]=_0x268ffb[_0x0950('0x49')][_0x0950('0x7c')];return _0x27cca8[_0x0950('0x8e')](_0x4460c3);}})[_0x0950('0x26')](respondWithResult(_0xe552b5,null))[_0x0950('0x47')](handleError(_0xe552b5,null));};function writeFile(_0x3a228a,_0x552675){return new Promise(function(_0x81db23,_0x755e32){fs['writeFile'](_0x552675,_0x3a228a,function(_0x350d37,_0x42a69b){if(_0x350d37){return _0x755e32(_0x350d37);}else{return _0x81db23(_0x42a69b);}});});}exports[_0x0950('0x8f')]=function(_0x1e4a6c,_0x52218a,_0x3c5cac){return db['VoiceRecording'][_0x0950('0x78')]({'where':{'id':_0x1e4a6c[_0x0950('0x43')]['id']}})[_0x0950('0x26')](handleEntityNotFound(_0x52218a))['then'](function(_0x2e60c1){if(_0x2e60c1&&_0x2e60c1['fileText']){var _0x21c29a=_0x2e60c1[_0x0950('0x90')];var _0x178762=config[_0x0950('0x91')]+'/server/files/transcribes/transcribe_'+_0x2e60c1['id']+_0x0950('0x92');if(fs[_0x0950('0x54')](_0x178762)){return _0x178762;}return writeFile(_0x21c29a,_0x178762)['then'](function(){return _0x178762;});}else{throw new db['Sequelize']['ValidationError'](_0x0950('0x93'));}})[_0x0950('0x26')](function(_0x2749d5){return _0x52218a[_0x0950('0x4b')](_0x2749d5);})['catch'](handleError(_0x52218a));}; \ No newline at end of file +var _0x1f87=['../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','include','findAll','rows','show','params','intersection','merge','options','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','sequelize','MD5','col','token','$and','push','%s.cypher','decryptFile','secrets','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','upload','startTranscriptionJob','basename','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','Setting','findOne','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','bucket','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x7c7a41,_0x11a170){var _0x5c09d3=function(_0x5dec92){while(--_0x5dec92){_0x7c7a41['push'](_0x7c7a41['shift']());}};_0x5c09d3(++_0x11a170);}(_0x1f87,0x1a6));var _0x71f8=function(_0x269a6f,_0x4c43c5){_0x269a6f=_0x269a6f-0x0;var _0x29e1e6=_0x1f87[_0x269a6f];return _0x29e1e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71f8('0x0'));var zipdir=require(_0x71f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71f8('0x2'));var moment=require(_0x71f8('0x3'));var BPromise=require(_0x71f8('0x4'));var Mustache=require(_0x71f8('0x5'));var util=require(_0x71f8('0x6'));var path=require(_0x71f8('0x7'));var sox=require(_0x71f8('0x8'));var csv=require(_0x71f8('0x9'));var ejs=require(_0x71f8('0xa'));var fs=require('fs');var fs_extra=require(_0x71f8('0xb'));var _=require(_0x71f8('0xc'));var squel=require(_0x71f8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x71f8('0xe'));var toCsv=require(_0x71f8('0x9'));var querystring=require(_0x71f8('0xf'));var Papa=require(_0x71f8('0x10'));var AWS=require(_0x71f8('0x11'));var uuidv4=require(_0x71f8('0x12'));var Redis=require('ioredis');var authService=require(_0x71f8('0x13'));var qs=require(_0x71f8('0x14'));var as=require(_0x71f8('0x15'));var hardwareService=require(_0x71f8('0x16'));var logger=require('../../config/logger')(_0x71f8('0x17'));var utils=require(_0x71f8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x71f8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d498c,_0x9248d5){_0x9248d5=_0x9248d5||0xcc;return function(_0x5268e9){if(_0x5268e9){return _0x5d498c[_0x71f8('0x1a')](_0x9248d5);}return _0x5d498c[_0x71f8('0x1b')](_0x9248d5)[_0x71f8('0x1c')]();};}function respondWithResult(_0x10d0ed,_0x314e13){_0x314e13=_0x314e13||0xc8;return function(_0x26783e){if(_0x26783e){return _0x10d0ed[_0x71f8('0x1b')](_0x314e13)[_0x71f8('0x1d')](_0x26783e);}};}function respondWithFilteredResult(_0x1b4b47,_0x346811){return function(_0x3308ab){if(_0x3308ab){var _0x28ebe7=typeof _0x346811[_0x71f8('0x1e')]===_0x71f8('0x1f')&&typeof _0x346811['limit']===_0x71f8('0x1f');var _0xf50bf5=_0x3308ab[_0x71f8('0x20')];var _0x110c80=_0x28ebe7?0x0:_0x346811['offset'];var _0x595d4e=_0x28ebe7?_0x3308ab[_0x71f8('0x20')]:_0x346811[_0x71f8('0x1e')]+_0x346811[_0x71f8('0x21')];var _0x361758;if(_0x595d4e>=_0xf50bf5){_0x595d4e=_0xf50bf5;_0x361758=0xc8;}else{_0x361758=0xce;}_0x1b4b47[_0x71f8('0x1b')](_0x361758);return _0x1b4b47[_0x71f8('0x22')](_0x71f8('0x23'),_0x110c80+'-'+_0x595d4e+'/'+_0xf50bf5)['json'](_0x3308ab);}return null;};}function patchUpdates(_0x24bace){return function(_0x31562e){try{jsonpatch[_0x71f8('0x24')](_0x31562e,_0x24bace,!![]);}catch(_0x349cfb){return BPromise[_0x71f8('0x25')](_0x349cfb);}return _0x31562e['save']();};}function saveUpdates(_0x175ab5,_0x53c73f){return function(_0x3d9465){if(_0x3d9465){return _0x3d9465['update'](_0x175ab5)[_0x71f8('0x26')](function(_0x44301f){return _0x44301f;});}return null;};}function removeEntity(_0x53d370,_0x226332){return function(_0x3d15f7){if(_0x3d15f7){return _0x3d15f7[_0x71f8('0x27')]()['then'](function(){_0x53d370['status'](0xcc)[_0x71f8('0x1c')]();});}};}function handleEntityNotFound(_0x2c9414,_0x10075b){return function(_0x57e164){if(!_0x57e164){_0x2c9414['sendStatus'](0x194);}return _0x57e164;};}function handleError(_0x15ff67,_0x222d3d){_0x222d3d=_0x222d3d||0x1f4;return function(_0x4ec6b6){logger['error'](_0x4ec6b6[_0x71f8('0x28')]);if(_0x4ec6b6['name']){delete _0x4ec6b6[_0x71f8('0x29')];}_0x15ff67[_0x71f8('0x1b')](_0x222d3d)['send'](_0x4ec6b6);};}exports[_0x71f8('0x2a')]=function(_0x30cb1e,_0x74e496){var _0x4bf77b={},_0x3b36b0={},_0x48001b={'count':0x0,'rows':[]};var _0x5162a8=_[_0x71f8('0x2b')](db[_0x71f8('0x2c')][_0x71f8('0x2d')],function(_0x8a5de8){return{'name':_0x8a5de8[_0x71f8('0x2e')],'type':_0x8a5de8[_0x71f8('0x2f')][_0x71f8('0x30')]};});_0x3b36b0['model']=_['differenceBy'](_['map'](_0x5162a8,'name'),['format']);_0x3b36b0[_0x71f8('0x31')]=_[_0x71f8('0x32')](_0x30cb1e[_0x71f8('0x31')]);_0x3b36b0[_0x71f8('0x33')]=_['intersection'](_0x3b36b0[_0x71f8('0x34')],_0x3b36b0[_0x71f8('0x31')]);_0x4bf77b[_0x71f8('0x35')]=_['intersection'](_0x3b36b0[_0x71f8('0x34')],qs[_0x71f8('0x36')](_0x30cb1e[_0x71f8('0x31')][_0x71f8('0x36')]));_0x4bf77b['attributes']=_0x4bf77b[_0x71f8('0x35')][_0x71f8('0x37')]?_0x4bf77b[_0x71f8('0x35')]:_0x3b36b0['model'];if(!_0x30cb1e[_0x71f8('0x31')]['hasOwnProperty']('nolimit')){_0x4bf77b[_0x71f8('0x21')]=qs[_0x71f8('0x21')](_0x30cb1e[_0x71f8('0x31')]['limit']);_0x4bf77b[_0x71f8('0x1e')]=qs['offset'](_0x30cb1e[_0x71f8('0x31')][_0x71f8('0x1e')]);}_0x4bf77b[_0x71f8('0x38')]=qs['sort'](_0x30cb1e[_0x71f8('0x31')][_0x71f8('0x39')]);_0x4bf77b[_0x71f8('0x3a')]=qs[_0x71f8('0x33')](_[_0x71f8('0x3b')](_0x30cb1e[_0x71f8('0x31')],_0x3b36b0['filters']),_0x5162a8);if(_0x30cb1e['query'][_0x71f8('0x3c')]){_0x4bf77b[_0x71f8('0x3a')]=_['merge'](_0x4bf77b[_0x71f8('0x3a')],{'$or':_[_0x71f8('0x2b')](_0x5162a8,function(_0x48ed3a){if(_0x48ed3a[_0x71f8('0x2f')]!==_0x71f8('0x3d')){var _0x478d25={};_0x478d25[_0x48ed3a[_0x71f8('0x29')]]={'$like':'%'+_0x30cb1e['query'][_0x71f8('0x3c')]+'%'};return _0x478d25;}})});}_0x4bf77b=_['merge']({},_0x4bf77b,_0x30cb1e['options']);var _0x3ba783={'where':_0x4bf77b[_0x71f8('0x3a')]};return db[_0x71f8('0x2c')][_0x71f8('0x20')](_0x3ba783)[_0x71f8('0x26')](function(_0x796d24){_0x48001b[_0x71f8('0x20')]=_0x796d24;if(_0x30cb1e['query']['includeAll']){_0x4bf77b[_0x71f8('0x3e')]=[{'all':!![]}];}return db[_0x71f8('0x2c')][_0x71f8('0x3f')](_0x4bf77b);})[_0x71f8('0x26')](function(_0x5056ad){_0x48001b[_0x71f8('0x40')]=_0x5056ad;return _0x48001b;})[_0x71f8('0x26')](respondWithFilteredResult(_0x74e496,_0x4bf77b))['catch'](handleError(_0x74e496,null));};exports[_0x71f8('0x41')]=function(_0x358311,_0x2b264b){var _0x1bc661={'raw':![],'where':{'id':_0x358311[_0x71f8('0x42')]['id']}},_0xff69fa={};_0xff69fa[_0x71f8('0x34')]=_[_0x71f8('0x32')](db[_0x71f8('0x2c')][_0x71f8('0x2d')]);_0xff69fa[_0x71f8('0x31')]=_[_0x71f8('0x32')](_0x358311['query']);_0xff69fa[_0x71f8('0x33')]=_[_0x71f8('0x43')](_0xff69fa[_0x71f8('0x34')],_0xff69fa[_0x71f8('0x31')]);_0x1bc661[_0x71f8('0x35')]=_[_0x71f8('0x43')](_0xff69fa[_0x71f8('0x34')],qs[_0x71f8('0x36')](_0x358311[_0x71f8('0x31')][_0x71f8('0x36')]));_0x1bc661[_0x71f8('0x35')]=_0x1bc661[_0x71f8('0x35')]['length']?_0x1bc661[_0x71f8('0x35')]:_0xff69fa[_0x71f8('0x34')];if(_0x358311['query']['includeAll']){_0x1bc661[_0x71f8('0x3e')]=[{'all':!![]}];}_0x1bc661=_[_0x71f8('0x44')]({},_0x1bc661,_0x358311[_0x71f8('0x45')]);return db[_0x71f8('0x2c')][_0x71f8('0x46')](_0x1bc661)['then'](handleEntityNotFound(_0x2b264b,null))[_0x71f8('0x26')](respondWithResult(_0x2b264b,null))[_0x71f8('0x47')](handleError(_0x2b264b,null));};exports[_0x71f8('0x48')]=function(_0x1ffa78,_0xab1cb5){return db[_0x71f8('0x2c')][_0x71f8('0x48')](_0x1ffa78[_0x71f8('0x49')],{})[_0x71f8('0x26')](respondWithResult(_0xab1cb5,0xc9))['catch'](handleError(_0xab1cb5,null));};exports['update']=function(_0x10b6d4,_0xfa2cd3){if(_0x10b6d4[_0x71f8('0x49')]['id']){delete _0x10b6d4[_0x71f8('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x10b6d4[_0x71f8('0x42')]['id']}})[_0x71f8('0x26')](handleEntityNotFound(_0xfa2cd3,null))[_0x71f8('0x26')](saveUpdates(_0x10b6d4['body'],null))[_0x71f8('0x26')](respondWithResult(_0xfa2cd3,null))[_0x71f8('0x47')](handleError(_0xfa2cd3,null));};exports[_0x71f8('0x4a')]=function(_0x847d08,_0x24fbf8){return db[_0x71f8('0x2c')][_0x71f8('0x4a')]()[_0x71f8('0x26')](respondWithResult(_0x24fbf8,null))[_0x71f8('0x47')](handleError(_0x24fbf8,null));};exports[_0x71f8('0x4b')]=function(_0x3666ce,_0x3760c5,_0x4502a9){var _0x38a740=require(_0x71f8('0x4c'));var _0x8740c=![];var _0x46d27e={};if(_0x3666ce['query'][_0x71f8('0x2f')]&&_0x3666ce[_0x71f8('0x31')][_0x71f8('0x2f')]===_0x71f8('0x4d')){_0x46d27e[_0x71f8('0x4d')]=_0x3666ce[_0x71f8('0x42')]['id'];}else{_0x46d27e['id']=_0x3666ce['params']['id'];}return db[_0x71f8('0x2c')][_0x71f8('0x46')]({'where':_0x46d27e,'attributes':['id',_0x71f8('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x3760c5,null))[_0x71f8('0x26')](function(_0x1a9fde){if(_0x1a9fde){var _0x5c1e6e=_0x1a9fde[_0x71f8('0x4e')];var _0x587856=util[_0x71f8('0x4f')]('%s.cypher',_0x5c1e6e);if(fs[_0x71f8('0x50')](_0x587856)){_0x8740c=!![];return _0x38a740['decryptFile'](_0x587856,_0x5c1e6e,config['secrets'][_0x71f8('0x51')])[_0x71f8('0x26')](function(){return _0x1a9fde;});}return _0x1a9fde;}})[_0x71f8('0x26')](function(_0x4682f8){if(_0x4682f8){var _0x3f20ae=_0x4682f8[_0x71f8('0x4e')];if(!fs[_0x71f8('0x50')](_0x3f20ae)){throw new db[(_0x71f8('0x52'))][(_0x71f8('0x53'))](_0x71f8('0x54'));}if(_0x4682f8[_0x71f8('0x55')]){return _0x3760c5[_0x71f8('0x4b')](_0x3f20ae,_0x4682f8[_0x71f8('0x55')]+path[_0x71f8('0x56')](_0x3f20ae),function(){if(_0x8740c){fs['unlink'](_0x3f20ae);}});}else{return _0x3760c5[_0x71f8('0x4b')](_0x3f20ae,function(_0x5a20ea){if(_0x8740c){fs[_0x71f8('0x57')](_0x3f20ae);}});}}})[_0x71f8('0x47')](function(_0x26a545){if(_0x26a545['message']==='VoiceRecording\x20not\x20found'){_0x3760c5[_0x71f8('0x1b')](0x194)[_0x71f8('0x58')](_0x71f8('0x59'));}else{return handleError(_0x3760c5,null);}});};exports['downloads']=function(_0xd68b88,_0xbceb2,_0x2f9832){var _0x21b05e=require(_0x71f8('0x4c'));var _0x373a0d=![];var _0x219168={'$and':[db['sequelize']['where'](db[_0x71f8('0x5a')]['fn'](_0x71f8('0x5b'),db[_0x71f8('0x5a')][_0x71f8('0x5c')](_0x71f8('0x4d'))),_0xd68b88[_0x71f8('0x31')][_0x71f8('0x5d')])]};if(_0xd68b88[_0x71f8('0x31')]['type']&&_0xd68b88[_0x71f8('0x31')]['type']===_0x71f8('0x4d')){_0x219168['$and']['push']({'uniqueid':_0xd68b88[_0x71f8('0x42')]['id']});}else{_0x219168[_0x71f8('0x5e')][_0x71f8('0x5f')]({'id':_0xd68b88['params']['id']});}return db[_0x71f8('0x2c')][_0x71f8('0x46')]({'where':_0x219168,'attributes':['id',_0x71f8('0x4e')],'raw':!![]})[_0x71f8('0x26')](handleEntityNotFound(_0xbceb2,null))['then'](function(_0x5b3306){if(_0x5b3306){var _0x4df8a0=util[_0x71f8('0x4f')](_0x71f8('0x60'),_0x5b3306['value']);if(fs['existsSync'](_0x4df8a0)){_0x373a0d=!![];return _0x21b05e[_0x71f8('0x61')](_0x4df8a0,_0x5b3306[_0x71f8('0x4e')],config[_0x71f8('0x62')][_0x71f8('0x51')])[_0x71f8('0x26')](function(){return _0x5b3306;});}return _0x5b3306;}})[_0x71f8('0x26')](function(_0x1d07f6){if(_0x1d07f6){if(!fs[_0x71f8('0x50')](_0x1d07f6['value'])){throw new db[(_0x71f8('0x52'))][(_0x71f8('0x53'))](_0x71f8('0x54'));}if(_0x1d07f6[_0x71f8('0x55')]){return _0xbceb2['download'](_0x1d07f6['value'],_0x1d07f6[_0x71f8('0x55')]+path[_0x71f8('0x56')](_0x1d07f6[_0x71f8('0x4e')]),function(){if(_0x373a0d){fs['unlink'](_0x1d07f6[_0x71f8('0x4e')]);}});}else{return _0xbceb2['download'](_0x1d07f6[_0x71f8('0x4e')],function(_0x3740cc){if(_0x373a0d){fs[_0x71f8('0x57')](_0x1d07f6[_0x71f8('0x4e')]);}});}}})[_0x71f8('0x47')](handleError(_0xbceb2,null));};exports['destroy']=function(_0x26b75f,_0x28e123){return db['VoiceRecording'][_0x71f8('0x46')]({'where':{'id':_0x26b75f[_0x71f8('0x42')]['id']}})['then'](function(_0x44e700){if(_[_0x71f8('0x63')](_0x44e700)){throw new ReferenceError(_0x71f8('0x64'));}return _0x44e700;})['then'](function(_0x2f2e95){var _0x3dc534=_0x2f2e95[_0x71f8('0x4e')];logger['info'](_0x71f8('0x65'),_0x3dc534);if(!_[_0x71f8('0x63')](_0x2f2e95[_0x71f8('0x4e')])&&fs[_0x71f8('0x50')](_0x3dc534)){logger[_0x71f8('0x66')](_0x71f8('0x67')+_0x3dc534+_0x71f8('0x68'));fs[_0x71f8('0x69')](_0x3dc534);}_0x3dc534=_0x3dc534+'.cypher';if(!_[_0x71f8('0x63')](_0x2f2e95[_0x71f8('0x4e')])&&fs[_0x71f8('0x50')](_0x3dc534)){logger['info'](_0x71f8('0x67')+_0x3dc534+_0x71f8('0x68'));fs[_0x71f8('0x69')](_0x3dc534);}return _0x2f2e95;})[_0x71f8('0x26')](function(_0x273073){if(!_0x273073)throw new InternalError();return _0x273073[_0x71f8('0x27')]();})[_0x71f8('0x26')](function(){_0x28e123['status'](0xcc)[_0x71f8('0x1c')]();})[_0x71f8('0x47')](handleError(_0x28e123,null));};function getBucketslist(_0x5017d7,_0x2a233f,_0xb29e90){return new Promise(function(_0x2d96b2,_0x272b1c){var _0x54ba6e=new AWS['S3']({'accessKeyId':_0x2a233f,'secretAccessKey':_0x5017d7,'region':_0xb29e90});_0x54ba6e['listBuckets']({},function(_0x1926fa,_0x3f6031){if(_0x1926fa){return _0x272b1c(_0x1926fa);}else{return _0x2d96b2(_0x3f6031);}});});}function createBucket(_0x399d21,_0xa0c4e3,_0x442f88,_0x3a4575){return new Promise(function(_0x5f2f2c,_0x21bfe7){var _0xa1a298=new AWS['S3']({'accessKeyId':_0xa0c4e3,'secretAccessKey':_0x399d21,'region':_0x442f88});_0xa1a298['createBucket']({'Bucket':_0x3a4575},function(_0x3f69ff,_0xd1a38e){if(_0x3f69ff){return _0x21bfe7(_0x3f69ff);}else{return _0x5f2f2c(_0xd1a38e);}});});}function uploadFile(_0x5464ec,_0x3582e6,_0x598af1,_0x495d09,_0x378261,_0x1203d9){return new Promise(function(_0x1384f3,_0x34902e){var _0x1a1c2a=new AWS['S3']({'accessKeyId':_0x3582e6,'secretAccessKey':_0x5464ec,'region':_0x598af1});_0x1a1c2a[_0x71f8('0x6a')]({'Bucket':_0x495d09,'Key':_0x378261,'Body':_0x1203d9},function(_0x36f1d9,_0x2d2b6e){if(_0x36f1d9){return _0x34902e(_0x36f1d9);}else{return _0x1384f3(_0x2d2b6e);}});});}function startTranscribe(_0x299e1c,_0x3cef16,_0x30bf0e,_0x5d8891,_0x5e4356,_0x2381ec){return new Promise(function(_0x15cdfa,_0x550004){var _0x1860e1=new AWS['TranscribeService']({'accessKeyId':_0x3cef16,'secretAccessKey':_0x299e1c,'region':_0x30bf0e});_0x1860e1[_0x71f8('0x6b')]({'TranscriptionJobName':_0x5d8891,'LanguageCode':_0x5e4356,'Media':{'MediaFileUri':_0x2381ec}},function(_0x248643,_0x546e04){if(_0x248643){return _0x550004(_0x248643);}else{return _0x15cdfa(_0x546e04);}});});}function transcribe(_0x5691e4,_0x44ce0c,_0x3bdd71,_0x21cd31,_0x100c46,_0x527534,_0x301459){return new Promise(function(_0x180c36,_0x5c782e){var _0x18fc52={};logger[_0x71f8('0x66')](util[_0x71f8('0x4f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5691e4,_0x100c46));return uploadFile(_0x44ce0c,_0x3bdd71,_0x21cd31,_0x100c46,path[_0x71f8('0x6c')](_0x527534),fs['readFileSync'](_0x527534))[_0x71f8('0x26')](function(_0x552649){logger['info'](util[_0x71f8('0x4f')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x5691e4,_0x100c46,_0x552649['Location']));_0x18fc52['bucket']=_0x552649[_0x71f8('0x6d')];_0x18fc52[_0x71f8('0x6e')]=_0x552649['Location'];logger[_0x71f8('0x66')](util[_0x71f8('0x4f')](_0x71f8('0x6f'),_0x5691e4));return startTranscribe(_0x44ce0c,_0x3bdd71,_0x21cd31,uuidv4(),_0x301459,_0x552649['Location']);})[_0x71f8('0x26')](function(_0x2c0cda){logger[_0x71f8('0x66')](util[_0x71f8('0x4f')](_0x71f8('0x70'),_0x5691e4,_0x2c0cda[_0x71f8('0x71')]['TranscriptionJobName']));_0x18fc52[_0x71f8('0x72')]=_0x2c0cda[_0x71f8('0x71')][_0x71f8('0x73')];_0x18fc52[_0x71f8('0x74')]=_0x2c0cda[_0x71f8('0x71')][_0x71f8('0x75')];return _0x180c36(_0x18fc52);})[_0x71f8('0x47')](function(_0x1574c8){return _0x5c782e(_0x1574c8);});});}exports['runTranscribe']=function(_0x22c890,_0x198667,_0x20de48){var _0x1790e4;var _0x2fe928;var _0x77c7be;var _0x611671=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x22c890[_0x71f8('0x42')]['id']}})['then'](function(_0x1b83ef){if(_0x1b83ef){var _0x33db57=util[_0x71f8('0x4f')](_0x71f8('0x60'),_0x1b83ef[_0x71f8('0x4e')]);if(fs['existsSync'](_0x33db57)){cypher=!![];return _0x611671[_0x71f8('0x61')](_0x33db57,_0x1b83ef[_0x71f8('0x4e')],config[_0x71f8('0x62')]['recording'])[_0x71f8('0x26')](function(){return _0x1b83ef;});}return _0x1b83ef;}})[_0x71f8('0x26')](function(_0xf39bd){if(!_0xf39bd){throw new db[(_0x71f8('0x52'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x2fe928=_0xf39bd;return db[_0x71f8('0x76')][_0x71f8('0x77')]({'where':{'id':0x1}});})[_0x71f8('0x26')](handleEntityNotFound(_0x198667,null))[_0x71f8('0x26')](function(_0x309301){if(_0x309301){_0x1790e4=_0x309301;if(!_0x1790e4['transcribe']||!_0x1790e4['transcribeAccountId']||!_0x1790e4['transcribeRegion']||!_0x1790e4[_0x71f8('0x78')]||!_0x1790e4['bucket']){throw new db['Sequelize'][(_0x71f8('0x53'))](_0x71f8('0x79'));}if(_0x22c890[_0x71f8('0x49')]['runSentiment']&&(!_0x1790e4[_0x71f8('0x7a')]||!_0x1790e4[_0x71f8('0x7b')]||!_0x1790e4[_0x71f8('0x7c')]||!_0x1790e4[_0x71f8('0x78')]||!_0x1790e4['bucket'])){throw new db[(_0x71f8('0x52'))][(_0x71f8('0x53'))](_0x71f8('0x7d'));}return db[_0x71f8('0x7e')]['findOne']({'where':{'id':_0x1790e4[_0x71f8('0x7f')]}});}})[_0x71f8('0x26')](function(_0x35f604){if(!_0x35f604){throw new db[(_0x71f8('0x52'))][(_0x71f8('0x53'))](_0x71f8('0x80'));}if(!_0x35f604['data1']||!_0x35f604['data2']){throw new db[(_0x71f8('0x52'))][(_0x71f8('0x53'))](_0x71f8('0x81'));}_0x77c7be=_0x35f604;return getBucketslist(_0x77c7be['data1'],_0x77c7be[_0x71f8('0x82')],_0x1790e4['transcribeRegion']);})['then'](function(_0x5d7f4d){if(_0x5d7f4d&&_0x5d7f4d[_0x71f8('0x83')]){var _0x4cb66e=_[_0x71f8('0x46')](_0x5d7f4d[_0x71f8('0x83')],function(_0x27b6f0){return _0x27b6f0[_0x71f8('0x84')]===_0x1790e4[_0x71f8('0x85')];});if(!_0x4cb66e){logger[_0x71f8('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x22c890[_0x71f8('0x42')]['id'],_0x1790e4[_0x71f8('0x85')]));return createBucket(_0x77c7be['data1'],_0x77c7be[_0x71f8('0x82')],_0x1790e4[_0x71f8('0x86')],_0x1790e4[_0x71f8('0x85')]);}logger['info'](util[_0x71f8('0x4f')](_0x71f8('0x87'),_0x22c890[_0x71f8('0x42')]['id'],_0x1790e4['bucket']));return;}})[_0x71f8('0x26')](function(_0x4a23c2){if(_0x2fe928[_0x71f8('0x74')]==='NEW'){return transcribe(_0x22c890[_0x71f8('0x42')]['id'],_0x77c7be['data1'],_0x77c7be['data2'],_0x1790e4[_0x71f8('0x86')],_0x1790e4[_0x71f8('0x85')],_0x2fe928['value'],_0x1790e4['language']);}else{logger[_0x71f8('0x66')](util[_0x71f8('0x4f')](_0x71f8('0x88'),_0x22c890[_0x71f8('0x42')]['id']));return{'transcribeStatus':_0x71f8('0x89')};}})[_0x71f8('0x26')](function(_0x2883b0){if(_0x2883b0){_0x2883b0[_0x71f8('0x8a')]=_0x22c890[_0x71f8('0x49')][_0x71f8('0x8b')];return _0x2fe928[_0x71f8('0x8c')](_0x2883b0);}})['then'](respondWithResult(_0x198667,null))[_0x71f8('0x47')](handleError(_0x198667,null));};function writeFile(_0x4eaf52,_0x1647f5){return new Promise(function(_0x268578,_0x4d0113){fs[_0x71f8('0x8d')](_0x1647f5,_0x4eaf52,function(_0x1e8b8f,_0x42204d){if(_0x1e8b8f){return _0x4d0113(_0x1e8b8f);}else{return _0x268578(_0x42204d);}});});}exports[_0x71f8('0x8e')]=function(_0x1d5c25,_0x2a890f,_0x3537c5){return db[_0x71f8('0x2c')]['findOne']({'where':{'id':_0x1d5c25[_0x71f8('0x42')]['id']}})[_0x71f8('0x26')](handleEntityNotFound(_0x2a890f))[_0x71f8('0x26')](function(_0x26d904){if(_0x26d904&&_0x26d904[_0x71f8('0x8f')]){var _0x2689c2=_0x26d904['fileText'];var _0x12cbeb=config[_0x71f8('0x90')]+_0x71f8('0x91')+_0x26d904['id']+_0x71f8('0x92');if(fs[_0x71f8('0x50')](_0x12cbeb)){return _0x12cbeb;}return writeFile(_0x2689c2,_0x12cbeb)['then'](function(){return _0x12cbeb;});}else{throw new db[(_0x71f8('0x52'))]['ValidationError'](_0x71f8('0x93'));}})['then'](function(_0x2d5403){return _0x2a890f[_0x71f8('0x4b')](_0x2d5403);})[_0x71f8('0x47')](handleError(_0x2a890f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8c52571..236c0bf 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 _0x15a5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util'];(function(_0x472225,_0xe23a10){var _0x2d9770=function(_0x4e0c31){while(--_0x4e0c31){_0x472225['push'](_0x472225['shift']());}};_0x2d9770(++_0xe23a10);}(_0x15a5,0x148));var _0x515a=function(_0x5184d1,_0x267a9a){_0x5184d1=_0x5184d1-0x0;var _0x5b8950=_0x15a5[_0x5184d1];return _0x5b8950;};'use strict';var _=require(_0x515a('0x0'));var util=require(_0x515a('0x1'));var logger=require('../../config/logger')(_0x515a('0x2'));var moment=require(_0x515a('0x3'));var BPromise=require(_0x515a('0x4'));var rp=require(_0x515a('0x5'));var fs=require('fs');var path=require(_0x515a('0x6'));var rimraf=require(_0x515a('0x7'));var config=require(_0x515a('0x8'));var attributes=require(_0x515a('0x9'));module[_0x515a('0xa')]=function(_0x58da7d,_0xeec4a4){return _0x58da7d[_0x515a('0xb')](_0x515a('0xc'),attributes,{'tableName':_0x515a('0xd'),'paranoid':![],'indexes':[{'name':_0x515a('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xca83=['./voiceRecording.attributes','VoiceRecording','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x92c90b,_0x365e19){var _0x2ecc92=function(_0x5c16de){while(--_0x5c16de){_0x92c90b['push'](_0x92c90b['shift']());}};_0x2ecc92(++_0x365e19);}(_0xca83,0x99));var _0x3ca8=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xca83[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x3ca8('0x0'));var util=require('util');var logger=require(_0x3ca8('0x1'))(_0x3ca8('0x2'));var moment=require(_0x3ca8('0x3'));var BPromise=require(_0x3ca8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ca8('0x5'));var rimraf=require('rimraf');var config=require(_0x3ca8('0x6'));var attributes=require(_0x3ca8('0x7'));module['exports']=function(_0x3ac695,_0x2a2c0b){return _0x3ac695['define'](_0x3ca8('0x8'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3ca8('0x9'),'fields':[_0x3ca8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 92b4b2e..1afdc4d 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 _0x8952=['message','result','catch','UpdateVoiceRecording','VoiceRecording','update','raw','options','attributes','debug','../../components/encryptor','Setting','create','callRecordingEncryption','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','VoiceRecording,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8952,0x17e));var _0x2895=function(_0x122625,_0x9ece2d){_0x122625=_0x122625-0x0;var _0x21df49=_0x8952[_0x122625];return _0x21df49;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')](_0xbf8b63['body'],{'raw':_0xbf8b63['options']?_0xbf8b63['options'][_0x2895('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbf8b63[_0x2895('0x19')]?_0xbf8b63[_0x2895('0x19')]['where']||null:null,'attributes':_0xbf8b63[_0x2895('0x19')]?_0xbf8b63[_0x2895('0x19')][_0x2895('0x1a')]||null:null,'limit':_0xbf8b63[_0x2895('0x19')]?_0xbf8b63[_0x2895('0x19')]['limit']||null:null})[_0x2895('0xc')](function(_0x5e93a4){logger['info'](_0x2895('0x15'),_0xbf8b63);logger[_0x2895('0x1b')](_0x2895('0x15'),_0xbf8b63,JSON['stringify'](_0x5e93a4));_0x155124(_0x5e93a4);})['catch'](function(_0x3a72fa){logger[_0x2895('0x10')](_0x2895('0x15'),_0x3a72fa['message'],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x3a72fa[_0x2895('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x293ad3){var _0x127540=this;return new Promise(function(_0x2cd4df,_0x5c6c21){var _0x320661=require(_0x2895('0x1c'));var _0x5eedfc;return db[_0x2895('0x1d')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x2895('0xc')](function(_0x4ee2cc){_0x5eedfc=_0x4ee2cc;return db[_0x2895('0x16')][_0x2895('0x1e')](_0x293ad3['body']);})['then'](function(_0x32db49){if(_0x5eedfc[_0x2895('0x1f')]&&fs[_0x2895('0x20')](_0x32db49[_0x2895('0x21')])){var _0x14d150=util[_0x2895('0x22')](_0x2895('0x23'),_0x32db49['value']);return _0x320661[_0x2895('0x24')](_0x32db49[_0x2895('0x21')],_0x14d150,config[_0x2895('0x25')]['recording'])[_0x2895('0xc')](function(){fs[_0x2895('0x26')](_0x32db49[_0x2895('0x21')]);logger[_0x2895('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x32db49;});}return _0x32db49;})[_0x2895('0xc')](function(_0xe594ff){logger[_0x2895('0xd')](_0x2895('0x27'),_0x293ad3);logger[_0x2895('0x1b')]('CreateVoiceRecording',_0x293ad3,JSON['stringify'](_0xe594ff));_0x2cd4df(_0xe594ff);})[_0x2895('0x14')](function(_0xf3c8f7){logger['error'](_0x2895('0x27'),_0xf3c8f7['message'],_0x293ad3);_0x5c6c21(_0x127540[_0x2895('0x10')](0x1f4,_0xf3c8f7[_0x2895('0x12')]));});});}; \ No newline at end of file +var _0x8f4c=['../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording'];(function(_0x5a597d,_0x33a327){var _0x3dbdf0=function(_0x2feeb5){while(--_0x2feeb5){_0x5a597d['push'](_0x5a597d['shift']());}};_0x3dbdf0(++_0x33a327);}(_0x8f4c,0x113));var _0xc8f4=function(_0x3f698c,_0x355469){_0x3f698c=_0x3f698c-0x0;var _0x286279=_0x8f4c[_0x3f698c];return _0x286279;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x108076[_0xc8f4('0x1b')]?_0x108076['options'][_0xc8f4('0x1d')]||null:null,'attributes':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1e')]||null:null,'limit':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1f')]||null:null})[_0xc8f4('0xb')](function(_0x5e62aa){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON['stringify'](_0x5e62aa));_0x4763c1(_0x5e62aa);})[_0xc8f4('0x16')](function(_0x4a44e0){logger[_0xc8f4('0x11')]('UpdateVoiceRecording',_0x4a44e0[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0x4a44e0['message']));});});};exports[_0xc8f4('0x20')]=function(_0x21062f){var _0x11f766=this;return new Promise(function(_0x2fa052,_0x4ce586){var _0x3db490=require(_0xc8f4('0x21'));var _0x5db666;return db[_0xc8f4('0x22')][_0xc8f4('0x23')]({'attributes':['id',_0xc8f4('0x24')],'where':{'id':0x1},'raw':!![]})[_0xc8f4('0xb')](function(_0x24bef0){_0x5db666=_0x24bef0;return db[_0xc8f4('0x18')]['create'](_0x21062f[_0xc8f4('0x1a')]);})[_0xc8f4('0xb')](function(_0x1ea3d9){if(_0x5db666['callRecordingEncryption']&&fs[_0xc8f4('0x25')](_0x1ea3d9[_0xc8f4('0x26')])){var _0x5ab6cb=util['format']('%s.cypher',_0x1ea3d9[_0xc8f4('0x26')]);return _0x3db490[_0xc8f4('0x27')](_0x1ea3d9[_0xc8f4('0x26')],_0x5ab6cb,config[_0xc8f4('0x28')][_0xc8f4('0x29')])[_0xc8f4('0xb')](function(){fs[_0xc8f4('0x2a')](_0x1ea3d9[_0xc8f4('0x26')]);logger['info'](_0xc8f4('0x2b'));return _0x1ea3d9;});}return _0x1ea3d9;})[_0xc8f4('0xb')](function(_0x3910f3){logger['info'](_0xc8f4('0x20'),_0x21062f);logger[_0xc8f4('0xe')]('CreateVoiceRecording',_0x21062f,JSON[_0xc8f4('0x10')](_0x3910f3));_0x2fa052(_0x3910f3);})[_0xc8f4('0x16')](function(_0x36f24f){logger['error'](_0xc8f4('0x20'),_0x36f24f[_0xc8f4('0x13')],_0x21062f);_0x4ce586(_0x11f766[_0xc8f4('0x11')](0x1f4,_0x36f24f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 61a41e6..94dde59 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 _0xce14=['/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get'];(function(_0x1acfb9,_0x52bc80){var _0x1416e3=function(_0x1909d1){while(--_0x1909d1){_0x1acfb9['push'](_0x1acfb9['shift']());}};_0x1416e3(++_0x52bc80);}(_0xce14,0x1ad));var _0x4ce1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xce14[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x4ce1('0x0'));var util=require('util');var path=require(_0x4ce1('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ce1('0x2'));var router=express[_0x4ce1('0x3')]();var fs_extra=require(_0x4ce1('0x4'));var auth=require(_0x4ce1('0x5'));var interaction=require(_0x4ce1('0x6'));var config=require(_0x4ce1('0x7'));var controller=require(_0x4ce1('0x8'));router['get']('/',auth[_0x4ce1('0x9')](),controller[_0x4ce1('0xa')]);router[_0x4ce1('0xb')](_0x4ce1('0xc'),auth[_0x4ce1('0x9')](),controller[_0x4ce1('0xd')]);router[_0x4ce1('0xb')](_0x4ce1('0xe'),auth[_0x4ce1('0x9')](),controller['show']);router[_0x4ce1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ce1('0x10')](_0x4ce1('0xe'),auth[_0x4ce1('0x9')](),controller[_0x4ce1('0x11')]);router[_0x4ce1('0x12')](_0x4ce1('0xe'),auth[_0x4ce1('0x9')](),controller[_0x4ce1('0x13')]);module[_0x4ce1('0x14')]=router; \ No newline at end of file +var _0x8bae=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0xf37b8d,_0x42ce54){var _0x3b0b62=function(_0x41a7cc){while(--_0x41a7cc){_0xf37b8d['push'](_0xf37b8d['shift']());}};_0x3b0b62(++_0x42ce54);}(_0x8bae,0x1de));var _0xe8ba=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x8bae[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0xe8ba('0x0'));var util=require(_0xe8ba('0x1'));var path=require(_0xe8ba('0x2'));var timeout=require(_0xe8ba('0x3'));var express=require(_0xe8ba('0x4'));var router=express[_0xe8ba('0x5')]();var fs_extra=require(_0xe8ba('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe8ba('0x7'));var controller=require(_0xe8ba('0x8'));router[_0xe8ba('0x9')]('/',auth[_0xe8ba('0xa')](),controller[_0xe8ba('0xb')]);router[_0xe8ba('0x9')](_0xe8ba('0xc'),auth['isAuthenticated'](),controller[_0xe8ba('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe8ba('0xe')]);router['post']('/',auth[_0xe8ba('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe8ba('0xf')]);router['delete']('/:id',auth[_0xe8ba('0xa')](),controller[_0xe8ba('0x10')]);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 5fbfe83..7aca197 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 _0xcc36=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x364b79,_0x25d78b){var _0x4d83bb=function(_0x28b3ad){while(--_0x28b3ad){_0x364b79['push'](_0x364b79['shift']());}};_0x4d83bb(++_0x25d78b);}(_0xcc36,0x1a4));var _0x6cc3=function(_0x743467,_0x3c5088){_0x743467=_0x743467-0x0;var _0x4e7041=_0xcc36[_0x743467];return _0x4e7041;};'use strict';var Sequelize=require(_0x6cc3('0x0'));var moment=require(_0x6cc3('0x1'));module[_0x6cc3('0x2')]={'type':{'type':Sequelize[_0x6cc3('0x3')](_0x6cc3('0x4'),_0x6cc3('0x5'))},'result':{'type':Sequelize[_0x6cc3('0x6')]},'transfererchannel':{'type':Sequelize[_0x6cc3('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x6cc3('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x6cc3('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x6cc3('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x6cc3('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x6cc3('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x6cc3('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x6cc3('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x6cc3('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x6cc3('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x6cc3('0x6')]},'isexternal':{'type':Sequelize[_0x6cc3('0x3')](_0x6cc3('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1b13=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x490ba9,_0x2b1e85){var _0x58ae20=function(_0x57df14){while(--_0x57df14){_0x490ba9['push'](_0x490ba9['shift']());}};_0x58ae20(++_0x2b1e85);}(_0x1b13,0x1d6));var _0x31b1=function(_0x2403db,_0x3e00af){_0x2403db=_0x2403db-0x0;var _0x2a4ec4=_0x1b13[_0x2403db];return _0x2a4ec4;};'use strict';var Sequelize=require(_0x31b1('0x0'));var moment=require(_0x31b1('0x1'));module[_0x31b1('0x2')]={'type':{'type':Sequelize[_0x31b1('0x3')](_0x31b1('0x4'),_0x31b1('0x5'))},'result':{'type':Sequelize[_0x31b1('0x6')]},'transfererchannel':{'type':Sequelize[_0x31b1('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x31b1('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x31b1('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x31b1('0x6')]},'transferercontext':{'type':Sequelize[_0x31b1('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x31b1('0x6')]},'transfereechannel':{'type':Sequelize[_0x31b1('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x31b1('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x31b1('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x31b1('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x31b1('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x31b1('0x6')]},'isexternal':{'type':Sequelize[_0x31b1('0x3')](_0x31b1('0x7'),'No')},'context':{'type':Sequelize[_0x31b1('0x6')]},'extension':{'type':Sequelize[_0x31b1('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3d7fb83..24790ee 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 _0xf283=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','VoiceTransferReport','includeAll','include','rows','show','params','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xf283,0x1b8));var _0x3f28=function(_0x3f16e3,_0x328481){_0x3f16e3=_0x3f16e3-0x0;var _0x4fa79b=_0xf283[_0x3f16e3];return _0x4fa79b;};'use strict';var emlformat=require(_0x3f28('0x0'));var rimraf=require(_0x3f28('0x1'));var zipdir=require(_0x3f28('0x2'));var jsonpatch=require(_0x3f28('0x3'));var rp=require(_0x3f28('0x4'));var moment=require('moment');var BPromise=require(_0x3f28('0x5'));var Mustache=require(_0x3f28('0x6'));var util=require(_0x3f28('0x7'));var path=require(_0x3f28('0x8'));var sox=require(_0x3f28('0x9'));var csv=require(_0x3f28('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f28('0xb'));var squel=require(_0x3f28('0xc'));var crypto=require(_0x3f28('0xd'));var jsforce=require(_0x3f28('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f28('0xf'));var Papa=require(_0x3f28('0x10'));var Redis=require(_0x3f28('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3f28('0x12'));var as=require(_0x3f28('0x13'));var hardwareService=require(_0x3f28('0x14'));var logger=require('../../config/logger')(_0x3f28('0x15'));var utils=require(_0x3f28('0x16'));var config=require(_0x3f28('0x17'));var licenseUtil=require(_0x3f28('0x18'));var db=require(_0x3f28('0x19'))['db'];function respondWithStatusCode(_0x2c02fe,_0x3c6566){_0x3c6566=_0x3c6566||0xcc;return function(_0x13267c){if(_0x13267c){return _0x2c02fe['sendStatus'](_0x3c6566);}return _0x2c02fe[_0x3f28('0x1a')](_0x3c6566)[_0x3f28('0x1b')]();};}function respondWithResult(_0x2a3d70,_0x5e80a4){_0x5e80a4=_0x5e80a4||0xc8;return function(_0x1b76bf){if(_0x1b76bf){return _0x2a3d70['status'](_0x5e80a4)[_0x3f28('0x1c')](_0x1b76bf);}};}function respondWithFilteredResult(_0x1ea80c,_0x4eea9f){return function(_0xb5f8ee){if(_0xb5f8ee){var _0x2a0b31=typeof _0x4eea9f[_0x3f28('0x1d')]==='undefined'&&typeof _0x4eea9f['limit']===_0x3f28('0x1e');var _0x2634ff=_0xb5f8ee[_0x3f28('0x1f')];var _0x1de093=_0x2a0b31?0x0:_0x4eea9f['offset'];var _0x76ded0=_0x2a0b31?_0xb5f8ee[_0x3f28('0x1f')]:_0x4eea9f[_0x3f28('0x1d')]+_0x4eea9f[_0x3f28('0x20')];var _0x3c95c0;if(_0x76ded0>=_0x2634ff){_0x76ded0=_0x2634ff;_0x3c95c0=0xc8;}else{_0x3c95c0=0xce;}_0x1ea80c[_0x3f28('0x1a')](_0x3c95c0);return _0x1ea80c[_0x3f28('0x21')](_0x3f28('0x22'),_0x1de093+'-'+_0x76ded0+'/'+_0x2634ff)[_0x3f28('0x1c')](_0xb5f8ee);}return null;};}function patchUpdates(_0x569323){return function(_0x1cf975){try{jsonpatch[_0x3f28('0x23')](_0x1cf975,_0x569323,!![]);}catch(_0x262e14){return BPromise[_0x3f28('0x24')](_0x262e14);}return _0x1cf975[_0x3f28('0x25')]();};}function saveUpdates(_0xa56a5f,_0x36a6ff){return function(_0x34d0c6){if(_0x34d0c6){return _0x34d0c6[_0x3f28('0x26')](_0xa56a5f)[_0x3f28('0x27')](function(_0x34b6dd){return _0x34b6dd;});}return null;};}function removeEntity(_0x3d5766,_0x537278){return function(_0x21757){if(_0x21757){return _0x21757[_0x3f28('0x28')]()[_0x3f28('0x27')](function(){_0x3d5766['status'](0xcc)[_0x3f28('0x1b')]();});}};}function handleEntityNotFound(_0x3e817e,_0x38ee72){return function(_0x505e3b){if(!_0x505e3b){_0x3e817e[_0x3f28('0x29')](0x194);}return _0x505e3b;};}function handleError(_0x4d54ba,_0xc5d797){_0xc5d797=_0xc5d797||0x1f4;return function(_0x28926e){logger[_0x3f28('0x2a')](_0x28926e['stack']);if(_0x28926e[_0x3f28('0x2b')]){delete _0x28926e[_0x3f28('0x2b')];}_0x4d54ba[_0x3f28('0x1a')](_0xc5d797)['send'](_0x28926e);};}exports[_0x3f28('0x2c')]=function(_0x491ebd,_0x22c8f4){var _0x48b46e={},_0x2110b8={},_0x5b71fb={'count':0x0,'rows':[]};var _0x3eb6df=_[_0x3f28('0x2d')](db['VoiceTransferReport'][_0x3f28('0x2e')],function(_0x431b55){return{'name':_0x431b55[_0x3f28('0x2f')],'type':_0x431b55['type'][_0x3f28('0x30')]};});_0x2110b8[_0x3f28('0x31')]=_[_0x3f28('0x2d')](_0x3eb6df,_0x3f28('0x2b'));_0x2110b8[_0x3f28('0x32')]=_[_0x3f28('0x33')](_0x491ebd[_0x3f28('0x32')]);_0x2110b8[_0x3f28('0x34')]=_[_0x3f28('0x35')](_0x2110b8[_0x3f28('0x31')],_0x2110b8['query']);_0x48b46e[_0x3f28('0x36')]=_['intersection'](_0x2110b8[_0x3f28('0x31')],qs[_0x3f28('0x37')](_0x491ebd[_0x3f28('0x32')][_0x3f28('0x37')]));_0x48b46e['attributes']=_0x48b46e[_0x3f28('0x36')][_0x3f28('0x38')]?_0x48b46e[_0x3f28('0x36')]:_0x2110b8[_0x3f28('0x31')];if(!_0x491ebd[_0x3f28('0x32')][_0x3f28('0x39')](_0x3f28('0x3a'))){_0x48b46e['limit']=qs[_0x3f28('0x20')](_0x491ebd[_0x3f28('0x32')][_0x3f28('0x20')]);_0x48b46e[_0x3f28('0x1d')]=qs['offset'](_0x491ebd[_0x3f28('0x32')]['offset']);}_0x48b46e[_0x3f28('0x3b')]=qs[_0x3f28('0x3c')](_0x491ebd['query'][_0x3f28('0x3c')]);_0x48b46e['where']=qs['filters'](_[_0x3f28('0x3d')](_0x491ebd[_0x3f28('0x32')],_0x2110b8[_0x3f28('0x34')]),_0x3eb6df);if(_0x491ebd[_0x3f28('0x32')][_0x3f28('0x3e')]){_0x48b46e['where']=_[_0x3f28('0x3f')](_0x48b46e[_0x3f28('0x40')],{'$or':_[_0x3f28('0x2d')](_0x3eb6df,function(_0xa9197){if(_0xa9197['type']!=='VIRTUAL'){var _0x42cc88={};_0x42cc88[_0xa9197[_0x3f28('0x2b')]]={'$like':'%'+_0x491ebd['query']['filter']+'%'};return _0x42cc88;}})});}_0x48b46e=_[_0x3f28('0x3f')]({},_0x48b46e,_0x491ebd[_0x3f28('0x41')]);var _0x1c2bf6={'where':_0x48b46e[_0x3f28('0x40')]};return db[_0x3f28('0x42')][_0x3f28('0x1f')](_0x1c2bf6)[_0x3f28('0x27')](function(_0x468846){_0x5b71fb['count']=_0x468846;if(_0x491ebd[_0x3f28('0x32')][_0x3f28('0x43')]){_0x48b46e[_0x3f28('0x44')]=[{'all':!![]}];}return db[_0x3f28('0x42')]['findAll'](_0x48b46e);})[_0x3f28('0x27')](function(_0x2c5628){_0x5b71fb[_0x3f28('0x45')]=_0x2c5628;return _0x5b71fb;})[_0x3f28('0x27')](respondWithFilteredResult(_0x22c8f4,_0x48b46e))['catch'](handleError(_0x22c8f4,null));};exports[_0x3f28('0x46')]=function(_0x247f64,_0x513d21){var _0x1fdf6c={'raw':!![],'where':{'id':_0x247f64[_0x3f28('0x47')]['id']}},_0x58838d={};_0x58838d[_0x3f28('0x31')]=_[_0x3f28('0x33')](db[_0x3f28('0x42')][_0x3f28('0x2e')]);_0x58838d[_0x3f28('0x32')]=_[_0x3f28('0x33')](_0x247f64['query']);_0x58838d[_0x3f28('0x34')]=_['intersection'](_0x58838d[_0x3f28('0x31')],_0x58838d[_0x3f28('0x32')]);_0x1fdf6c[_0x3f28('0x36')]=_[_0x3f28('0x35')](_0x58838d[_0x3f28('0x31')],qs[_0x3f28('0x37')](_0x247f64['query']['fields']));_0x1fdf6c[_0x3f28('0x36')]=_0x1fdf6c['attributes']['length']?_0x1fdf6c['attributes']:_0x58838d[_0x3f28('0x31')];if(_0x247f64[_0x3f28('0x32')][_0x3f28('0x43')]){_0x1fdf6c[_0x3f28('0x44')]=[{'all':!![]}];}_0x1fdf6c=_[_0x3f28('0x3f')]({},_0x1fdf6c,_0x247f64['options']);return db[_0x3f28('0x42')]['find'](_0x1fdf6c)[_0x3f28('0x27')](handleEntityNotFound(_0x513d21,null))[_0x3f28('0x27')](respondWithResult(_0x513d21,null))['catch'](handleError(_0x513d21,null));};exports[_0x3f28('0x48')]=function(_0x506207,_0xbd5c23){return db[_0x3f28('0x42')][_0x3f28('0x48')](_0x506207[_0x3f28('0x49')],{})['then'](respondWithResult(_0xbd5c23,0xc9))[_0x3f28('0x4a')](handleError(_0xbd5c23,null));};exports['update']=function(_0x1317a4,_0x5b63ce){if(_0x1317a4[_0x3f28('0x49')]['id']){delete _0x1317a4[_0x3f28('0x49')]['id'];}return db[_0x3f28('0x42')]['find']({'where':{'id':_0x1317a4['params']['id']}})[_0x3f28('0x27')](handleEntityNotFound(_0x5b63ce,null))[_0x3f28('0x27')](saveUpdates(_0x1317a4[_0x3f28('0x49')],null))['then'](respondWithResult(_0x5b63ce,null))[_0x3f28('0x4a')](handleError(_0x5b63ce,null));};exports[_0x3f28('0x28')]=function(_0x33350b,_0x2f9c01){return db[_0x3f28('0x42')]['find']({'where':{'id':_0x33350b[_0x3f28('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f9c01,null))['then'](removeEntity(_0x2f9c01,null))['catch'](handleError(_0x2f9c01,null));};exports['describe']=function(_0x1ee5d9,_0x1fcab1){return db[_0x3f28('0x42')][_0x3f28('0x4b')]()[_0x3f28('0x27')](respondWithResult(_0x1fcab1,null))[_0x3f28('0x4a')](handleError(_0x1fcab1,null));}; \ No newline at end of file +var _0x10c7=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find'];(function(_0x25146b,_0x535a07){var _0x1ed164=function(_0x452bae){while(--_0x452bae){_0x25146b['push'](_0x25146b['shift']());}};_0x1ed164(++_0x535a07);}(_0x10c7,0x9f));var _0x710c=function(_0xf1a005,_0x361fee){_0xf1a005=_0xf1a005-0x0;var _0x5313f6=_0x10c7[_0xf1a005];return _0x5313f6;};'use strict';var emlformat=require(_0x710c('0x0'));var rimraf=require(_0x710c('0x1'));var zipdir=require(_0x710c('0x2'));var jsonpatch=require(_0x710c('0x3'));var rp=require(_0x710c('0x4'));var moment=require(_0x710c('0x5'));var BPromise=require(_0x710c('0x6'));var Mustache=require(_0x710c('0x7'));var util=require(_0x710c('0x8'));var path=require(_0x710c('0x9'));var sox=require(_0x710c('0xa'));var csv=require(_0x710c('0xb'));var ejs=require(_0x710c('0xc'));var fs=require('fs');var fs_extra=require(_0x710c('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x710c('0xe'));var jsforce=require(_0x710c('0xf'));var deskjs=require(_0x710c('0x10'));var toCsv=require(_0x710c('0xb'));var querystring=require(_0x710c('0x11'));var Papa=require(_0x710c('0x12'));var Redis=require('ioredis');var authService=require(_0x710c('0x13'));var qs=require(_0x710c('0x14'));var as=require(_0x710c('0x15'));var hardwareService=require(_0x710c('0x16'));var logger=require('../../config/logger')(_0x710c('0x17'));var utils=require(_0x710c('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x710c('0x19'))['db'];function respondWithStatusCode(_0xc0f8b1,_0xe88727){_0xe88727=_0xe88727||0xcc;return function(_0xff24f8){if(_0xff24f8){return _0xc0f8b1[_0x710c('0x1a')](_0xe88727);}return _0xc0f8b1[_0x710c('0x1b')](_0xe88727)[_0x710c('0x1c')]();};}function respondWithResult(_0x4df153,_0x8392d3){_0x8392d3=_0x8392d3||0xc8;return function(_0x3b7196){if(_0x3b7196){return _0x4df153[_0x710c('0x1b')](_0x8392d3)[_0x710c('0x1d')](_0x3b7196);}};}function respondWithFilteredResult(_0x5b0f20,_0x5bcaf0){return function(_0x5bac9c){if(_0x5bac9c){var _0x44c748=typeof _0x5bcaf0[_0x710c('0x1e')]===_0x710c('0x1f')&&typeof _0x5bcaf0[_0x710c('0x20')]===_0x710c('0x1f');var _0x13cc42=_0x5bac9c[_0x710c('0x21')];var _0x243acf=_0x44c748?0x0:_0x5bcaf0[_0x710c('0x1e')];var _0x2aea39=_0x44c748?_0x5bac9c[_0x710c('0x21')]:_0x5bcaf0[_0x710c('0x1e')]+_0x5bcaf0[_0x710c('0x20')];var _0x3cd6b2;if(_0x2aea39>=_0x13cc42){_0x2aea39=_0x13cc42;_0x3cd6b2=0xc8;}else{_0x3cd6b2=0xce;}_0x5b0f20['status'](_0x3cd6b2);return _0x5b0f20['set']('Content-Range',_0x243acf+'-'+_0x2aea39+'/'+_0x13cc42)[_0x710c('0x1d')](_0x5bac9c);}return null;};}function patchUpdates(_0x46dc78){return function(_0x1a6edf){try{jsonpatch[_0x710c('0x22')](_0x1a6edf,_0x46dc78,!![]);}catch(_0x3dad0b){return BPromise[_0x710c('0x23')](_0x3dad0b);}return _0x1a6edf[_0x710c('0x24')]();};}function saveUpdates(_0xaff690,_0x5cfb43){return function(_0x4e1368){if(_0x4e1368){return _0x4e1368[_0x710c('0x25')](_0xaff690)[_0x710c('0x26')](function(_0x15462d){return _0x15462d;});}return null;};}function removeEntity(_0x445829,_0x1a7676){return function(_0x4a7a4a){if(_0x4a7a4a){return _0x4a7a4a[_0x710c('0x27')]()[_0x710c('0x26')](function(){_0x445829[_0x710c('0x1b')](0xcc)[_0x710c('0x1c')]();});}};}function handleEntityNotFound(_0x37f8c0,_0x362b5c){return function(_0x2a268e){if(!_0x2a268e){_0x37f8c0[_0x710c('0x1a')](0x194);}return _0x2a268e;};}function handleError(_0x402a6a,_0x258194){_0x258194=_0x258194||0x1f4;return function(_0x17d4ad){logger['error'](_0x17d4ad[_0x710c('0x28')]);if(_0x17d4ad[_0x710c('0x29')]){delete _0x17d4ad[_0x710c('0x29')];}_0x402a6a[_0x710c('0x1b')](_0x258194)[_0x710c('0x2a')](_0x17d4ad);};}exports[_0x710c('0x2b')]=function(_0xaee222,_0x3b468e){var _0xb7f12a={},_0x16b1b3={},_0x53ddc7={'count':0x0,'rows':[]};var _0x39117b=_[_0x710c('0x2c')](db[_0x710c('0x2d')][_0x710c('0x2e')],function(_0x2cbb37){return{'name':_0x2cbb37[_0x710c('0x2f')],'type':_0x2cbb37[_0x710c('0x30')][_0x710c('0x31')]};});_0x16b1b3[_0x710c('0x32')]=_[_0x710c('0x2c')](_0x39117b,_0x710c('0x29'));_0x16b1b3[_0x710c('0x33')]=_[_0x710c('0x34')](_0xaee222[_0x710c('0x33')]);_0x16b1b3[_0x710c('0x35')]=_['intersection'](_0x16b1b3[_0x710c('0x32')],_0x16b1b3[_0x710c('0x33')]);_0xb7f12a['attributes']=_[_0x710c('0x36')](_0x16b1b3[_0x710c('0x32')],qs['fields'](_0xaee222[_0x710c('0x33')][_0x710c('0x37')]));_0xb7f12a['attributes']=_0xb7f12a[_0x710c('0x38')][_0x710c('0x39')]?_0xb7f12a['attributes']:_0x16b1b3['model'];if(!_0xaee222[_0x710c('0x33')][_0x710c('0x3a')](_0x710c('0x3b'))){_0xb7f12a['limit']=qs[_0x710c('0x20')](_0xaee222[_0x710c('0x33')]['limit']);_0xb7f12a[_0x710c('0x1e')]=qs[_0x710c('0x1e')](_0xaee222[_0x710c('0x33')][_0x710c('0x1e')]);}_0xb7f12a[_0x710c('0x3c')]=qs[_0x710c('0x3d')](_0xaee222[_0x710c('0x33')]['sort']);_0xb7f12a[_0x710c('0x3e')]=qs[_0x710c('0x35')](_[_0x710c('0x3f')](_0xaee222[_0x710c('0x33')],_0x16b1b3[_0x710c('0x35')]),_0x39117b);if(_0xaee222[_0x710c('0x33')][_0x710c('0x40')]){_0xb7f12a[_0x710c('0x3e')]=_['merge'](_0xb7f12a[_0x710c('0x3e')],{'$or':_[_0x710c('0x2c')](_0x39117b,function(_0x4bd694){if(_0x4bd694[_0x710c('0x30')]!==_0x710c('0x41')){var _0x3881aa={};_0x3881aa[_0x4bd694[_0x710c('0x29')]]={'$like':'%'+_0xaee222['query'][_0x710c('0x40')]+'%'};return _0x3881aa;}})});}_0xb7f12a=_[_0x710c('0x42')]({},_0xb7f12a,_0xaee222[_0x710c('0x43')]);var _0x3cc5b6={'where':_0xb7f12a['where']};return db['VoiceTransferReport'][_0x710c('0x21')](_0x3cc5b6)[_0x710c('0x26')](function(_0x2ea2b7){_0x53ddc7[_0x710c('0x21')]=_0x2ea2b7;if(_0xaee222[_0x710c('0x33')][_0x710c('0x44')]){_0xb7f12a[_0x710c('0x45')]=[{'all':!![]}];}return db[_0x710c('0x2d')][_0x710c('0x46')](_0xb7f12a);})['then'](function(_0x13d14c){_0x53ddc7[_0x710c('0x47')]=_0x13d14c;return _0x53ddc7;})[_0x710c('0x26')](respondWithFilteredResult(_0x3b468e,_0xb7f12a))[_0x710c('0x48')](handleError(_0x3b468e,null));};exports['show']=function(_0x25866a,_0x4dfda1){var _0x1a6d47={'raw':!![],'where':{'id':_0x25866a[_0x710c('0x49')]['id']}},_0x2461c4={};_0x2461c4[_0x710c('0x32')]=_[_0x710c('0x34')](db[_0x710c('0x2d')][_0x710c('0x2e')]);_0x2461c4[_0x710c('0x33')]=_[_0x710c('0x34')](_0x25866a['query']);_0x2461c4[_0x710c('0x35')]=_[_0x710c('0x36')](_0x2461c4['model'],_0x2461c4[_0x710c('0x33')]);_0x1a6d47[_0x710c('0x38')]=_['intersection'](_0x2461c4['model'],qs['fields'](_0x25866a[_0x710c('0x33')][_0x710c('0x37')]));_0x1a6d47[_0x710c('0x38')]=_0x1a6d47[_0x710c('0x38')][_0x710c('0x39')]?_0x1a6d47['attributes']:_0x2461c4[_0x710c('0x32')];if(_0x25866a[_0x710c('0x33')][_0x710c('0x44')]){_0x1a6d47[_0x710c('0x45')]=[{'all':!![]}];}_0x1a6d47=_[_0x710c('0x42')]({},_0x1a6d47,_0x25866a['options']);return db[_0x710c('0x2d')][_0x710c('0x4a')](_0x1a6d47)[_0x710c('0x26')](handleEntityNotFound(_0x4dfda1,null))['then'](respondWithResult(_0x4dfda1,null))['catch'](handleError(_0x4dfda1,null));};exports[_0x710c('0x4b')]=function(_0x12512c,_0x1aa2aa){return db[_0x710c('0x2d')][_0x710c('0x4b')](_0x12512c['body'],{})[_0x710c('0x26')](respondWithResult(_0x1aa2aa,0xc9))[_0x710c('0x48')](handleError(_0x1aa2aa,null));};exports[_0x710c('0x25')]=function(_0x4b765a,_0x1f75f3){if(_0x4b765a[_0x710c('0x4c')]['id']){delete _0x4b765a[_0x710c('0x4c')]['id'];}return db[_0x710c('0x2d')]['find']({'where':{'id':_0x4b765a[_0x710c('0x49')]['id']}})[_0x710c('0x26')](handleEntityNotFound(_0x1f75f3,null))[_0x710c('0x26')](saveUpdates(_0x4b765a[_0x710c('0x4c')],null))[_0x710c('0x26')](respondWithResult(_0x1f75f3,null))['catch'](handleError(_0x1f75f3,null));};exports[_0x710c('0x27')]=function(_0x10d0d1,_0x3eb66c){return db[_0x710c('0x2d')][_0x710c('0x4a')]({'where':{'id':_0x10d0d1['params']['id']}})[_0x710c('0x26')](handleEntityNotFound(_0x3eb66c,null))[_0x710c('0x26')](removeEntity(_0x3eb66c,null))['catch'](handleError(_0x3eb66c,null));};exports[_0x710c('0x4d')]=function(_0x219b90,_0x1fe6ad){return db['VoiceTransferReport'][_0x710c('0x4d')]()[_0x710c('0x26')](respondWithResult(_0x1fe6ad,null))[_0x710c('0x48')](handleError(_0x1fe6ad,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index f2377bc..a613715 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 _0xbb3b=['rimraf','../../config/environment','VoiceTransferReport','report_call_transfer','api','moment','bluebird','request-promise','path'];(function(_0x8eb58d,_0x2a5b3e){var _0x4225b3=function(_0x490124){while(--_0x490124){_0x8eb58d['push'](_0x8eb58d['shift']());}};_0x4225b3(++_0x2a5b3e);}(_0xbb3b,0xaf));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbb3('0x0'));var moment=require(_0xbbb3('0x1'));var BPromise=require(_0xbbb3('0x2'));var rp=require(_0xbbb3('0x3'));var fs=require('fs');var path=require(_0xbbb3('0x4'));var rimraf=require(_0xbbb3('0x5'));var config=require(_0xbbb3('0x6'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0xde273d,_0x345522){return _0xde273d['define'](_0xbbb3('0x7'),attributes,{'tableName':_0xbbb3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x840d=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x5573e4,_0x814cd8){var _0x25d9ae=function(_0x4e10be){while(--_0x4e10be){_0x5573e4['push'](_0x5573e4['shift']());}};_0x25d9ae(++_0x814cd8);}(_0x840d,0x8a));var _0xd840=function(_0x255824,_0x4ddc22){_0x255824=_0x255824-0x0;var _0x155842=_0x840d[_0x255824];return _0x155842;};'use strict';var _=require(_0xd840('0x0'));var util=require(_0xd840('0x1'));var logger=require(_0xd840('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd840('0x3'));var rp=require(_0xd840('0x4'));var fs=require('fs');var path=require(_0xd840('0x5'));var rimraf=require(_0xd840('0x6'));var config=require(_0xd840('0x7'));var attributes=require(_0xd840('0x8'));module['exports']=function(_0x5bbc33,_0x552074){return _0x5bbc33[_0xd840('0x9')](_0xd840('0xa'),attributes,{'tableName':_0xd840('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 3797b25..5c71883 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 _0xb4c1=['message','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x16dbfc,_0x3c8a94){var _0x6346cc=function(_0xa6050b){while(--_0xa6050b){_0x16dbfc['push'](_0x16dbfc['shift']());}};_0x6346cc(++_0x3c8a94);}(_0xb4c1,0x1e5));var _0x1b4c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb4c1[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x1b4c('0x0'));var moment=require(_0x1b4c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b4c('0x2'))['db'];var utils=require(_0x1b4c('0x3'));var logger=require(_0x1b4c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1b4c('0x5'));var client=jayson[_0x1b4c('0x6')][_0x1b4c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ce1ed,_0x37b21a,_0x1925b1){return new BPromise(function(_0x225925,_0x257301){return client['request'](_0x4ce1ed,_0x1925b1)[_0x1b4c('0x8')](function(_0x564822){logger[_0x1b4c('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x37b21a,'request\x20sent');logger[_0x1b4c('0xa')](_0x1b4c('0xb'),_0x37b21a,'request\x20sent',JSON[_0x1b4c('0xc')](_0x564822));if(_0x564822[_0x1b4c('0xd')]){if(_0x564822['error'][_0x1b4c('0xe')]===0x1f4){logger[_0x1b4c('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x37b21a,_0x564822[_0x1b4c('0xd')][_0x1b4c('0xf')]);return _0x257301(_0x564822['error'][_0x1b4c('0xf')]);}logger['error'](_0x1b4c('0x10'),_0x37b21a,_0x564822[_0x1b4c('0xd')][_0x1b4c('0xf')]);return _0x225925(_0x564822[_0x1b4c('0xd')][_0x1b4c('0xf')]);}else{logger[_0x1b4c('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x37b21a,_0x1b4c('0x11'));_0x225925(_0x564822[_0x1b4c('0x12')][_0x1b4c('0xf')]);}})[_0x1b4c('0x13')](function(_0x4293ff){logger[_0x1b4c('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x37b21a,_0x4293ff);_0x257301(_0x4293ff);});});}exports[_0x1b4c('0x14')]=function(_0x1258f9){var _0xe3b5e4=this;return new Promise(function(_0x287ab2,_0x318a32){return db[_0x1b4c('0x15')][_0x1b4c('0x16')](_0x1258f9[_0x1b4c('0x17')],{'raw':_0x1258f9[_0x1b4c('0x18')]?_0x1258f9[_0x1b4c('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1b4c('0x8')](function(_0x3b3bce){logger[_0x1b4c('0x9')](_0x1b4c('0x14'),_0x1258f9);logger['debug'](_0x1b4c('0x14'),_0x1258f9,JSON['stringify'](_0x3b3bce));_0x287ab2(_0x3b3bce);})['catch'](function(_0xbd6c5d){logger[_0x1b4c('0xd')](_0x1b4c('0x14'),_0xbd6c5d[_0x1b4c('0xf')],_0x1258f9);_0x318a32(_0xe3b5e4[_0x1b4c('0xd')](0x1f4,_0xbd6c5d[_0x1b4c('0xf')]));});});}; \ No newline at end of file +var _0xde07=['../../config/environment','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','stringify','lodash','util','moment','../../mysqldb','../../config/utils','rpc'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xde07,0x17a));var _0x7de0=function(_0x4ebc8e,_0x28e984){_0x4ebc8e=_0x4ebc8e-0x0;var _0x5f2041=_0xde07[_0x4ebc8e];return _0x5f2041;};'use strict';var _=require(_0x7de0('0x0'));var util=require(_0x7de0('0x1'));var moment=require(_0x7de0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7de0('0x3'))['db'];var utils=require(_0x7de0('0x4'));var logger=require('../../config/logger')(_0x7de0('0x5'));var config=require(_0x7de0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4540f5,_0x306c4f,_0x4ccb44){return new BPromise(function(_0x2daef1,_0xda5c43){return client[_0x7de0('0x7')](_0x4540f5,_0x4ccb44)['then'](function(_0x564d5f){logger[_0x7de0('0x8')](_0x7de0('0x9'),_0x306c4f,'request\x20sent');logger[_0x7de0('0xa')](_0x7de0('0xb'),_0x306c4f,_0x7de0('0xc'),JSON['stringify'](_0x564d5f));if(_0x564d5f[_0x7de0('0xd')]){if(_0x564d5f[_0x7de0('0xd')][_0x7de0('0xe')]===0x1f4){logger[_0x7de0('0xd')](_0x7de0('0x9'),_0x306c4f,_0x564d5f[_0x7de0('0xd')]['message']);return _0xda5c43(_0x564d5f[_0x7de0('0xd')][_0x7de0('0xf')]);}logger[_0x7de0('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x306c4f,_0x564d5f[_0x7de0('0xd')][_0x7de0('0xf')]);return _0x2daef1(_0x564d5f[_0x7de0('0xd')][_0x7de0('0xf')]);}else{logger[_0x7de0('0x8')](_0x7de0('0x9'),_0x306c4f,'request\x20sent');_0x2daef1(_0x564d5f['result'][_0x7de0('0xf')]);}})['catch'](function(_0x19fe2e){logger[_0x7de0('0xd')](_0x7de0('0x9'),_0x306c4f,_0x19fe2e);_0xda5c43(_0x19fe2e);});});}exports['CreateVoiceTransferReport']=function(_0x13cd65){var _0x43ebd0=this;return new Promise(function(_0x8c5f97,_0x4df958){return db[_0x7de0('0x10')][_0x7de0('0x11')](_0x13cd65[_0x7de0('0x12')],{'raw':_0x13cd65[_0x7de0('0x13')]?_0x13cd65[_0x7de0('0x13')][_0x7de0('0x14')]===undefined?!![]:![]:!![]})[_0x7de0('0x15')](function(_0x56ab8c){logger[_0x7de0('0x8')](_0x7de0('0x16'),_0x13cd65);logger[_0x7de0('0xa')](_0x7de0('0x16'),_0x13cd65,JSON[_0x7de0('0x17')](_0x56ab8c));_0x8c5f97(_0x56ab8c);})['catch'](function(_0x433d5d){logger[_0x7de0('0xd')]('CreateVoiceTransferReport',_0x433d5d[_0x7de0('0xf')],_0x13cd65);_0x4df958(_0x43ebd0[_0x7de0('0xd')](0x1f4,_0x433d5d[_0x7de0('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7e1e824..fd66854 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe386=['post','/originate','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','/hold','hold','/unhold','/transfer','exports','express','../../components/auth/service'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0xe386,0xfd));var _0x6e38=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe386[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x6e38('0x0'));var router=express['Router']();var auth=require(_0x6e38('0x1'));var controller=require('./webbar.controller');router[_0x6e38('0x2')](_0x6e38('0x3'),auth[_0x6e38('0x4')](),auth['canUpdate'](),controller[_0x6e38('0x5')]);router[_0x6e38('0x2')](_0x6e38('0x6'),auth['isAuthenticated'](),auth[_0x6e38('0x7')](),controller[_0x6e38('0x8')]);router[_0x6e38('0x2')](_0x6e38('0x9'),auth[_0x6e38('0x4')](),auth[_0x6e38('0x7')](),controller['answer']);router[_0x6e38('0x2')](_0x6e38('0xa'),auth[_0x6e38('0x4')](),auth[_0x6e38('0x7')](),controller[_0x6e38('0xb')]);router[_0x6e38('0x2')](_0x6e38('0xc'),auth[_0x6e38('0x4')](),auth[_0x6e38('0x7')](),controller['unhold']);router[_0x6e38('0x2')]('/calls',auth[_0x6e38('0x4')](),auth[_0x6e38('0x7')](),controller['calls']);router['post'](_0x6e38('0xd'),auth['isAuthenticated'](),auth[_0x6e38('0x7')](),controller['transfer']);module[_0x6e38('0xe')]=router; \ No newline at end of file +var _0x20e5=['express','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','answer','/hold','hold','/unhold','unhold','calls','transfer','exports'];(function(_0x3f3152,_0x2bbfcb){var _0x2e41e8=function(_0x4aaae5){while(--_0x4aaae5){_0x3f3152['push'](_0x3f3152['shift']());}};_0x2e41e8(++_0x2bbfcb);}(_0x20e5,0x19e));var _0x520e=function(_0x316a53,_0x8d7b69){_0x316a53=_0x316a53-0x0;var _0x29d9d5=_0x20e5[_0x316a53];return _0x29d9d5;};'use strict';var express=require(_0x520e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x520e('0x1'));router[_0x520e('0x2')](_0x520e('0x3'),auth[_0x520e('0x4')](),auth['canUpdate'](),controller[_0x520e('0x5')]);router[_0x520e('0x2')](_0x520e('0x6'),auth['isAuthenticated'](),auth[_0x520e('0x7')](),controller[_0x520e('0x8')]);router[_0x520e('0x2')](_0x520e('0x9'),auth['isAuthenticated'](),auth[_0x520e('0x7')](),controller[_0x520e('0xa')]);router[_0x520e('0x2')](_0x520e('0xb'),auth['isAuthenticated'](),auth[_0x520e('0x7')](),controller[_0x520e('0xc')]);router[_0x520e('0x2')](_0x520e('0xd'),auth[_0x520e('0x4')](),auth['canUpdate'](),controller[_0x520e('0xe')]);router[_0x520e('0x2')]('/calls',auth['isAuthenticated'](),auth[_0x520e('0x7')](),controller[_0x520e('0xf')]);router[_0x520e('0x2')]('/transfer',auth[_0x520e('0x4')](),auth[_0x520e('0x7')](),controller[_0x520e('0x10')]);module[_0x520e('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 912af08..dfcaebd 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae79=['number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','name','status','send','then','error','message','catch','User','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','body','json','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','userId','webbar:hangup','answer','answer\x20fired:','webbar:answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate'];(function(_0x2ca534,_0x5f4dd5){var _0x41d5e1=function(_0x2d3b40){while(--_0x2d3b40){_0x2ca534['push'](_0x2ca534['shift']());}};_0x41d5e1(++_0x5f4dd5);}(_0xae79,0x1d3));var _0x9ae7=function(_0x1dbc4d,_0x5179c0){_0x1dbc4d=_0x1dbc4d-0x0;var _0x5d555c=_0xae79[_0x1dbc4d];return _0x5d555c;};'use strict';var path=require(_0x9ae7('0x0'));var fs=require('fs');var _=require(_0x9ae7('0x1'));var db=require(_0x9ae7('0x2'))['db'];var config=require(_0x9ae7('0x3'));var util=require(_0x9ae7('0x4'));var BPromise=require(_0x9ae7('0x5'));var jayson=require(_0x9ae7('0x6'));var amiClient=jayson[_0x9ae7('0x7')][_0x9ae7('0x8')]({'port':0x232a});var logger=require(_0x9ae7('0x9'))(_0x9ae7('0xa'));var Redis=require(_0x9ae7('0xb'));config[_0x9ae7('0xc')]=_[_0x9ae7('0xd')](config[_0x9ae7('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x9ae7('0xe'))(new Redis(config[_0x9ae7('0xc')]));var Schema=require(_0x9ae7('0xf'));var originateValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]},'callNumber':{'type':_0x9ae7('0x12'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x9ae7('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]},'sessionId':{'type':_0x9ae7('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]},'sessionId':{'type':_0x9ae7('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9ae7('0x12'),'required':[!![],_0x9ae7('0x13')]},'transferNumber':{'type':'string','required':[!![],_0x9ae7('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]},'sessionId':{'type':_0x9ae7('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]},'sessionId':{'type':_0x9ae7('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9ae7('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9ae7('0x10'),'required':[!![],_0x9ae7('0x11')]}});function emit(_0x44c0bc,_0x533481,_0x109526){logger[_0x9ae7('0x15')](_0x44c0bc,_0x533481,JSON[_0x9ae7('0x16')](_0x109526));io['to'](_0x44c0bc)['emit'](_0x533481,_0x109526);}function handleError(_0x47c740){return function(_0x2c7643){console['log']('handleError:',_0x2c7643,_0x2c7643 instanceof RangeError);logger['error'](_0x2c7643['stack']);if(_0x2c7643 instanceof RangeError){if(_0x2c7643[_0x9ae7('0x17')]){delete _0x2c7643[_0x9ae7('0x17')];}_0x47c740[_0x9ae7('0x18')](0x194)[_0x9ae7('0x19')](_0x2c7643);}else{if(_0x2c7643['name']){delete _0x2c7643[_0x9ae7('0x17')];}_0x47c740[_0x9ae7('0x18')](0x1f4)['send'](_0x2c7643);}};}function checkError(){return function(_0x20fd14){if(!_0x20fd14){throw new RangeError('NotFound');}return _0x20fd14;};}function respondWithRpcPromise(_0x284961,_0x272936){return new BPromise(function(_0x583937,_0x356559){var _0x550e52=amiClient;return _0x550e52['request'](_0x284961,_0x272936)[_0x9ae7('0x1a')](function(_0x1abf16){if(_0x1abf16[_0x9ae7('0x1b')]){if(_0x1abf16[_0x9ae7('0x1b')]['code']===0x1f4){return _0x356559(_0x1abf16[_0x9ae7('0x1b')][_0x9ae7('0x1c')]);}return _0x583937(_0x1abf16[_0x9ae7('0x1b')][_0x9ae7('0x1c')]);}else{_0x583937(_0x1abf16['result']);}})[_0x9ae7('0x1d')](function(_0x557030){_0x356559(_0x557030);});});}function getAgent(_0x2db31b){return db[_0x9ae7('0x1e')]['findOne']({'where':{'id':_0x2db31b,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x49123b,_0x43f2c9){return new BPromise(function(_0x26680c,_0x58f130){var _0x23cca8=respondWithRpcPromise(_0x9ae7('0x1f'));var _0x41e4a8=getAgent(_0x49123b);Promise[_0x9ae7('0x20')]([_0x23cca8,_0x41e4a8])[_0x9ae7('0x1a')](function(_0x51527d){var _0x543861=_0x51527d[0x0];var _0x33548a=_0x51527d[0x1];var _0x5a4e2d=_[_0x9ae7('0x21')](_0x543861[_0x9ae7('0x22')],function(_0x51dcc4){return _0x51dcc4[_0x9ae7('0x23')]==_0x33548a['id']&&_0x51dcc4[_0x9ae7('0x24')]==_0x43f2c9;});if(_0x5a4e2d[_0x9ae7('0x25')]==0x1){_0x26680c(_0x33548a);}else{_0x58f130(new RangeError('sessionId\x20'+_0x43f2c9+_0x9ae7('0x26')));}});});}exports[_0x9ae7('0x27')]=function(_0x168409,_0x801b9e){logger['info']('originate\x20fired:',_0x168409[_0x9ae7('0x28')]);var _0x1cb825=originateValidation[_0x9ae7('0xf')](_0x168409[_0x9ae7('0x28')]);if(_0x1cb825[_0x9ae7('0x25')]>0x0){return _0x801b9e[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x1cb825);}var _0x3369d3=_0x168409[_0x9ae7('0x28')]['userId'];var _0x3e9231=_0x168409[_0x9ae7('0x28')]['callNumber'];var _0x2537c9=_0x168409[_0x9ae7('0x28')]['callerId'];var _0x4f5c8b=_0x168409['body'][_0x9ae7('0x2a')];return getAgent(_0x3369d3)['then'](function(_0x1fa394){logger[_0x9ae7('0x15')](_0x9ae7('0x2b'),_0x1fa394[_0x9ae7('0x17')]);emit(util[_0x9ae7('0x2c')](_0x9ae7('0x2d'),_0x1fa394[_0x9ae7('0x17')]),_0x9ae7('0x2e'),{'callNumber':_0x3e9231,'callerId':_0x2537c9,'callbackUrl':_0x4f5c8b});return _0x801b9e[_0x9ae7('0x18')](0xc8)['json']({'error':![],'message':_0x9ae7('0x2f')});})[_0x9ae7('0x1d')](handleError(_0x801b9e));};exports['hangup']=function(_0x24bcf2,_0x4a5239){logger[_0x9ae7('0x15')](_0x9ae7('0x30'),_0x24bcf2[_0x9ae7('0x28')]);var _0x177e20=hangupValidation[_0x9ae7('0xf')](_0x24bcf2['body']);if(_0x177e20[_0x9ae7('0x25')]>0x0){return _0x4a5239[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x177e20);}var _0xe6d447=_0x24bcf2['body'][_0x9ae7('0x31')];var _0x296df5=_0x24bcf2[_0x9ae7('0x28')]['sessionId'];return getAgent(_0xe6d447)[_0x9ae7('0x1a')](function(_0x4b36ad){logger[_0x9ae7('0x15')](_0x9ae7('0x2b'),_0x4b36ad[_0x9ae7('0x17')]);emit(util[_0x9ae7('0x2c')](_0x9ae7('0x2d'),_0x4b36ad[_0x9ae7('0x17')]),_0x9ae7('0x32'),{'sessionId':_0x296df5});return _0x4a5239[_0x9ae7('0x18')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x9ae7('0x1d')](handleError(_0x4a5239));};exports[_0x9ae7('0x33')]=function(_0x221a08,_0x231f03){logger['info'](_0x9ae7('0x34'),_0x221a08['body']);var _0xeaf6bd=answerValidation[_0x9ae7('0xf')](_0x221a08[_0x9ae7('0x28')]);if(_0xeaf6bd[_0x9ae7('0x25')]>0x0){return _0x231f03[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0xeaf6bd);}var _0x3ed5b3=_0x221a08[_0x9ae7('0x28')][_0x9ae7('0x31')];var _0x525185=_0x221a08[_0x9ae7('0x28')][_0x9ae7('0x24')];return getAgent(_0x3ed5b3)['then'](function(_0x375945){logger['info'](_0x9ae7('0x2b'),_0x375945['name']);emit(util[_0x9ae7('0x2c')](_0x9ae7('0x2d'),_0x375945[_0x9ae7('0x17')]),_0x9ae7('0x35'),{'sessionId':_0x525185});return _0x231f03[_0x9ae7('0x18')](0xc8)[_0x9ae7('0x29')]({'error':![],'message':'answer\x20executed!'});})[_0x9ae7('0x1d')](handleError(_0x231f03));};exports['hold']=function(_0xf63e2b,_0x1a2036){logger[_0x9ae7('0x15')](_0x9ae7('0x36'),_0xf63e2b[_0x9ae7('0x28')]);var _0x3a196f=holdValidation['validate'](_0xf63e2b[_0x9ae7('0x28')]);if(_0x3a196f[_0x9ae7('0x25')]>0x0){return _0x1a2036[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x3a196f);}var _0x231c7a=_0xf63e2b[_0x9ae7('0x28')][_0x9ae7('0x31')];var _0x4ee301=_0xf63e2b[_0x9ae7('0x28')][_0x9ae7('0x24')];return getAgent(_0x231c7a)['then'](function(_0x59bd8b){logger['info'](_0x9ae7('0x2b'),_0x59bd8b[_0x9ae7('0x17')]);emit(util[_0x9ae7('0x2c')](_0x9ae7('0x2d'),_0x59bd8b[_0x9ae7('0x17')]),_0x9ae7('0x37'),{'sessionId':_0x4ee301});return _0x1a2036[_0x9ae7('0x18')](0xc8)[_0x9ae7('0x29')]({'error':![],'message':_0x9ae7('0x38')});})[_0x9ae7('0x1d')](handleError(_0x1a2036));};exports['unhold']=function(_0x54dc5d,_0x1739e7){logger[_0x9ae7('0x15')](_0x9ae7('0x39'),_0x54dc5d[_0x9ae7('0x28')]);var _0x431099=unholdValidation[_0x9ae7('0xf')](_0x54dc5d[_0x9ae7('0x28')]);if(_0x431099['length']>0x0){return _0x1739e7[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x431099);}var _0x28ebf2=_0x54dc5d[_0x9ae7('0x28')][_0x9ae7('0x31')];var _0x3aee89=_0x54dc5d[_0x9ae7('0x28')]['sessionId'];return getAgent(_0x28ebf2)[_0x9ae7('0x1a')](function(_0x5eeac6){logger['info']('entityFound:',_0x5eeac6[_0x9ae7('0x17')]);emit(util['format'](_0x9ae7('0x2d'),_0x5eeac6[_0x9ae7('0x17')]),_0x9ae7('0x3a'),{'sessionId':_0x3aee89});return _0x1739e7['status'](0xc8)['json']({'error':![],'message':_0x9ae7('0x3b')});})[_0x9ae7('0x1d')](handleError(_0x1739e7));};exports[_0x9ae7('0x3c')]=function(_0x124784,_0xdced3b){logger[_0x9ae7('0x15')](_0x9ae7('0x3d'),_0xdced3b[_0x9ae7('0x28')]);var _0x45296f=callsValidation['validate'](_0x124784['body']);if(_0x45296f[_0x9ae7('0x25')]>0x0){return _0xdced3b[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x45296f);}var _0x129b3d=_0x124784[_0x9ae7('0x28')][_0x9ae7('0x31')];var _0x5ae3f6=respondWithRpcPromise(_0x9ae7('0x1f'));var _0x325f1f=getAgent(_0x129b3d);return Promise['all']([_0x5ae3f6,_0x325f1f])[_0x9ae7('0x1a')](function(_0x446f5b){var _0x2a9778=_0x446f5b[0x0];var _0x2c8cd7=_0x446f5b[0x1];var _0x112475=_[_0x9ae7('0x21')](_0x2a9778['rows'],function(_0x30da4f){return _0x30da4f[_0x9ae7('0x23')]==_0x2c8cd7['id'];});return _0xdced3b[_0x9ae7('0x18')](0xc8)['json']({'count':_0x112475[_0x9ae7('0x25')],'rows':_0x112475});})[_0x9ae7('0x1d')](handleError(_0xdced3b));};exports[_0x9ae7('0x3e')]=function(_0x30da93,_0x41a5b7){logger[_0x9ae7('0x15')](_0x9ae7('0x3f'),_0x30da93[_0x9ae7('0x28')]);var _0x12af95=conferenceValidation[_0x9ae7('0xf')](_0x30da93[_0x9ae7('0x28')]);if(_0x12af95[_0x9ae7('0x25')]>0x0){return _0x41a5b7[_0x9ae7('0x18')](0x190)[_0x9ae7('0x29')](_0x12af95);}var _0x50b2d7=_0x30da93[_0x9ae7('0x28')][_0x9ae7('0x31')];return getAgent(_0x50b2d7)[_0x9ae7('0x1a')](function(_0x5451b4){logger['info'](_0x9ae7('0x2b'),_0x5451b4['name']);emit(util['format']('user:%s',_0x5451b4[_0x9ae7('0x17')]),_0x9ae7('0x40'));return _0x41a5b7['status'](0xc8)[_0x9ae7('0x29')]({'error':![],'message':'conference\x20executed!'});})[_0x9ae7('0x1d')](handleError(_0x41a5b7));};exports[_0x9ae7('0x41')]=function(_0x52e099,_0x380424){logger[_0x9ae7('0x15')](_0x9ae7('0x42'),_0x52e099['body']);var _0x2c3f39=transferValidation[_0x9ae7('0xf')](_0x52e099[_0x9ae7('0x28')]);if(_0x2c3f39[_0x9ae7('0x25')]>0x0){return _0x380424['status'](0x190)[_0x9ae7('0x29')](_0x2c3f39);}var _0x33fbcf=_0x52e099['body'][_0x9ae7('0x31')];var _0x50edd5=_0x52e099[_0x9ae7('0x28')][_0x9ae7('0x24')];var _0x2a518e=_0x52e099[_0x9ae7('0x28')][_0x9ae7('0x43')];return getAgent(_0x33fbcf)[_0x9ae7('0x1a')](function(_0x14268a){logger[_0x9ae7('0x15')](_0x9ae7('0x2b'),_0x14268a[_0x9ae7('0x17')]);emit(util['format'](_0x9ae7('0x2d'),_0x14268a[_0x9ae7('0x17')]),'webbar:transfer',{'sessionId':_0x50edd5,'transferNumber':_0x2a518e});return _0x380424[_0x9ae7('0x18')](0xc8)[_0x9ae7('0x29')]({'error':![],'message':_0x9ae7('0x44')});})[_0x9ae7('0x1d')](handleError(_0x380424));}; \ No newline at end of file +var _0xe205=['hold\x20fired:','hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','hangup','hangup\x20fired:','userId','format','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold'];(function(_0x42a08a,_0x3579a2){var _0x12ed50=function(_0x16863e){while(--_0x16863e){_0x42a08a['push'](_0x42a08a['shift']());}};_0x12ed50(++_0x3579a2);}(_0xe205,0xa7));var _0x5e20=function(_0x5be360,_0x40115a){_0x5be360=_0x5be360-0x0;var _0xb0340c=_0xe205[_0x5be360];return _0xb0340c;};'use strict';var path=require(_0x5e20('0x0'));var fs=require('fs');var _=require(_0x5e20('0x1'));var db=require(_0x5e20('0x2'))['db'];var config=require(_0x5e20('0x3'));var util=require(_0x5e20('0x4'));var BPromise=require(_0x5e20('0x5'));var jayson=require(_0x5e20('0x6'));var amiClient=jayson[_0x5e20('0x7')][_0x5e20('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x5e20('0x9'));var Redis=require(_0x5e20('0xa'));config[_0x5e20('0xb')]=_[_0x5e20('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5e20('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'callNumber':{'type':'string','required':[!![],_0x5e20('0x10')]},'callerId':{'type':_0x5e20('0x11')},'callbackUrl':{'type':_0x5e20('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':[!![],_0x5e20('0x12')]},'transferNumber':{'type':_0x5e20('0x11'),'required':[!![],_0x5e20('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5e20('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5e20('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5e20('0xe'),'required':[!![],_0x5e20('0xf')]}});function emit(_0x542b3c,_0xeaeb77,_0x9a59ce){logger[_0x5e20('0x14')](_0x542b3c,_0xeaeb77,JSON[_0x5e20('0x15')](_0x9a59ce));io['to'](_0x542b3c)[_0x5e20('0x16')](_0xeaeb77,_0x9a59ce);}function handleError(_0x3b353f){return function(_0x1cc706){console[_0x5e20('0x17')]('handleError:',_0x1cc706,_0x1cc706 instanceof RangeError);logger[_0x5e20('0x18')](_0x1cc706[_0x5e20('0x19')]);if(_0x1cc706 instanceof RangeError){if(_0x1cc706['name']){delete _0x1cc706[_0x5e20('0x1a')];}_0x3b353f[_0x5e20('0x1b')](0x194)[_0x5e20('0x1c')](_0x1cc706);}else{if(_0x1cc706[_0x5e20('0x1a')]){delete _0x1cc706['name'];}_0x3b353f[_0x5e20('0x1b')](0x1f4)['send'](_0x1cc706);}};}function checkError(){return function(_0x4a3587){if(!_0x4a3587){throw new RangeError('NotFound');}return _0x4a3587;};}function respondWithRpcPromise(_0x5d0d1a,_0xe562ba){return new BPromise(function(_0x5cca90,_0x3d89e4){var _0x29b111=amiClient;return _0x29b111[_0x5e20('0x1d')](_0x5d0d1a,_0xe562ba)[_0x5e20('0x1e')](function(_0x3ef7fa){if(_0x3ef7fa[_0x5e20('0x18')]){if(_0x3ef7fa['error'][_0x5e20('0x1f')]===0x1f4){return _0x3d89e4(_0x3ef7fa['error']['message']);}return _0x5cca90(_0x3ef7fa[_0x5e20('0x18')][_0x5e20('0x20')]);}else{_0x5cca90(_0x3ef7fa[_0x5e20('0x21')]);}})[_0x5e20('0x22')](function(_0xbf7a24){_0x3d89e4(_0xbf7a24);});});}function getAgent(_0x200774){return db[_0x5e20('0x23')]['findOne']({'where':{'id':_0x200774,'role':_0x5e20('0x24')}})[_0x5e20('0x1e')](checkError());}function getAgentCheckSession(_0x238758,_0x3032ef){return new BPromise(function(_0x4c799d,_0x3a0f06){var _0x2c5d80=respondWithRpcPromise(_0x5e20('0x25'));var _0x222e7a=getAgent(_0x238758);Promise[_0x5e20('0x26')]([_0x2c5d80,_0x222e7a])[_0x5e20('0x1e')](function(_0x5ec45b){var _0xbc2b0e=_0x5ec45b[0x0];var _0x34a3d6=_0x5ec45b[0x1];var _0x543c29=_[_0x5e20('0x27')](_0xbc2b0e[_0x5e20('0x28')],function(_0x335f1e){return _0x335f1e[_0x5e20('0x29')]==_0x34a3d6['id']&&_0x335f1e[_0x5e20('0x2a')]==_0x3032ef;});if(_0x543c29[_0x5e20('0x2b')]==0x1){_0x4c799d(_0x34a3d6);}else{_0x3a0f06(new RangeError('sessionId\x20'+_0x3032ef+_0x5e20('0x2c')));}});});}exports[_0x5e20('0x2d')]=function(_0x330341,_0x5f2f1d){logger[_0x5e20('0x14')](_0x5e20('0x2e'),_0x330341[_0x5e20('0x2f')]);var _0x1ed59d=originateValidation[_0x5e20('0x30')](_0x330341[_0x5e20('0x2f')]);if(_0x1ed59d[_0x5e20('0x2b')]>0x0){return _0x5f2f1d['status'](0x190)[_0x5e20('0x31')](_0x1ed59d);}var _0x1a9fff=_0x330341[_0x5e20('0x2f')]['userId'];var _0x9469cd=_0x330341[_0x5e20('0x2f')][_0x5e20('0x32')];var _0x2e367e=_0x330341[_0x5e20('0x2f')][_0x5e20('0x33')];var _0x1114ae=_0x330341[_0x5e20('0x2f')][_0x5e20('0x34')];return getAgent(_0x1a9fff)[_0x5e20('0x1e')](function(_0x36e825){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x36e825[_0x5e20('0x1a')]);emit(util['format'](_0x5e20('0x36'),_0x36e825['name']),'webbar:originate',{'callNumber':_0x9469cd,'callerId':_0x2e367e,'callbackUrl':_0x1114ae});return _0x5f2f1d[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0x5e20('0x22')](handleError(_0x5f2f1d));};exports[_0x5e20('0x37')]=function(_0x4f34c0,_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x38'),_0x4f34c0[_0x5e20('0x2f')]);var _0x15ce1d=hangupValidation[_0x5e20('0x30')](_0x4f34c0[_0x5e20('0x2f')]);if(_0x15ce1d[_0x5e20('0x2b')]>0x0){return _0x3f3908[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x15ce1d);}var _0x473b69=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x1cb3f0=_0x4f34c0[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x473b69)[_0x5e20('0x1e')](function(_0x17feb4){logger['info'](_0x5e20('0x35'),_0x17feb4[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x17feb4[_0x5e20('0x1a')]),'webbar:hangup',{'sessionId':_0x1cb3f0});return _0x3f3908[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x3b')});})[_0x5e20('0x22')](handleError(_0x3f3908));};exports[_0x5e20('0x3c')]=function(_0x30d3ef,_0x5c7ae8){logger[_0x5e20('0x14')](_0x5e20('0x3d'),_0x30d3ef[_0x5e20('0x2f')]);var _0x5a21f0=answerValidation[_0x5e20('0x30')](_0x30d3ef[_0x5e20('0x2f')]);if(_0x5a21f0[_0x5e20('0x2b')]>0x0){return _0x5c7ae8[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5a21f0);}var _0x336d61=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x5c9504=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x336d61)[_0x5e20('0x1e')](function(_0x503cb6){logger[_0x5e20('0x14')]('entityFound:',_0x503cb6[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x503cb6[_0x5e20('0x1a')]),_0x5e20('0x3e'),{'sessionId':_0x5c9504});return _0x5c7ae8['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x5c7ae8));};exports[_0x5e20('0x3f')]=function(_0x28f155,_0x9d9d62){logger[_0x5e20('0x14')](_0x5e20('0x40'),_0x28f155[_0x5e20('0x2f')]);var _0x57c794=holdValidation['validate'](_0x28f155['body']);if(_0x57c794[_0x5e20('0x2b')]>0x0){return _0x9d9d62[_0x5e20('0x1b')](0x190)['json'](_0x57c794);}var _0x22b84e=_0x28f155[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x3bd5b8=_0x28f155[_0x5e20('0x2f')]['sessionId'];return getAgent(_0x22b84e)[_0x5e20('0x1e')](function(_0x245b52){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x245b52[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x245b52[_0x5e20('0x1a')]),'webbar:hold',{'sessionId':_0x3bd5b8});return _0x9d9d62['status'](0xc8)['json']({'error':![],'message':_0x5e20('0x41')});})[_0x5e20('0x22')](handleError(_0x9d9d62));};exports['unhold']=function(_0x4392ca,_0x4bfea7){logger[_0x5e20('0x14')]('unhold\x20fired:',_0x4392ca[_0x5e20('0x2f')]);var _0x59372c=unholdValidation[_0x5e20('0x30')](_0x4392ca[_0x5e20('0x2f')]);if(_0x59372c[_0x5e20('0x2b')]>0x0){return _0x4bfea7[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59372c);}var _0x200094=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x39')];var _0x19c128=_0x4392ca[_0x5e20('0x2f')][_0x5e20('0x2a')];return getAgent(_0x200094)[_0x5e20('0x1e')](function(_0x278b0e){logger[_0x5e20('0x14')](_0x5e20('0x35'),_0x278b0e[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')](_0x5e20('0x36'),_0x278b0e['name']),'webbar:unhold',{'sessionId':_0x19c128});return _0x4bfea7[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x42')});})[_0x5e20('0x22')](handleError(_0x4bfea7));};exports[_0x5e20('0x43')]=function(_0x596971,_0x457552){logger[_0x5e20('0x14')](_0x5e20('0x44'),_0x457552['body']);var _0x5d2aa2=callsValidation['validate'](_0x596971[_0x5e20('0x2f')]);if(_0x5d2aa2[_0x5e20('0x2b')]>0x0){return _0x457552[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x5d2aa2);}var _0xbacc1f=_0x596971[_0x5e20('0x2f')]['userId'];var _0x393724=respondWithRpcPromise('VoiceChannels');var _0x2913e7=getAgent(_0xbacc1f);return Promise['all']([_0x393724,_0x2913e7])[_0x5e20('0x1e')](function(_0x2eff14){var _0x141743=_0x2eff14[0x0];var _0x5f025b=_0x2eff14[0x1];var _0x1f6a32=_[_0x5e20('0x27')](_0x141743[_0x5e20('0x28')],function(_0x4309b8){return _0x4309b8[_0x5e20('0x29')]==_0x5f025b['id'];});return _0x457552[_0x5e20('0x1b')](0xc8)[_0x5e20('0x31')]({'count':_0x1f6a32['length'],'rows':_0x1f6a32});})[_0x5e20('0x22')](handleError(_0x457552));};exports[_0x5e20('0x45')]=function(_0x1a03e4,_0x2f9089){logger['info'](_0x5e20('0x46'),_0x1a03e4[_0x5e20('0x2f')]);var _0x23f07d=conferenceValidation[_0x5e20('0x30')](_0x1a03e4['body']);if(_0x23f07d[_0x5e20('0x2b')]>0x0){return _0x2f9089[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x23f07d);}var _0x53ddd4=_0x1a03e4['body']['userId'];return getAgent(_0x53ddd4)[_0x5e20('0x1e')](function(_0x1eb84c){logger['info'](_0x5e20('0x35'),_0x1eb84c[_0x5e20('0x1a')]);emit(util[_0x5e20('0x3a')]('user:%s',_0x1eb84c[_0x5e20('0x1a')]),_0x5e20('0x47'));return _0x2f9089['status'](0xc8)[_0x5e20('0x31')]({'error':![],'message':_0x5e20('0x48')});})['catch'](handleError(_0x2f9089));};exports[_0x5e20('0x49')]=function(_0x9993ae,_0x1e531d){logger[_0x5e20('0x14')]('transfer\x20fired:',_0x9993ae[_0x5e20('0x2f')]);var _0x59bff7=transferValidation['validate'](_0x9993ae[_0x5e20('0x2f')]);if(_0x59bff7[_0x5e20('0x2b')]>0x0){return _0x1e531d[_0x5e20('0x1b')](0x190)[_0x5e20('0x31')](_0x59bff7);}var _0x54cd1=_0x9993ae[_0x5e20('0x2f')]['userId'];var _0x4bccbe=_0x9993ae[_0x5e20('0x2f')][_0x5e20('0x2a')];var _0x17f248=_0x9993ae['body'][_0x5e20('0x4a')];return getAgent(_0x54cd1)[_0x5e20('0x1e')](function(_0x52f8ef){logger[_0x5e20('0x14')]('entityFound:',_0x52f8ef['name']);emit(util[_0x5e20('0x3a')]('user:%s',_0x52f8ef[_0x5e20('0x1a')]),_0x5e20('0x4b'),{'sessionId':_0x4bccbe,'transferNumber':_0x17f248});return _0x1e531d[_0x5e20('0x1b')](0xc8)['json']({'error':![],'message':_0x5e20('0x4c')});})[_0x5e20('0x22')](handleError(_0x1e531d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9e8582c..5c27aa0 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x47c5,0x165));var _0x547c=function(_0x12a17c,_0x54d2c1){_0x12a17c=_0x12a17c-0x0;var _0x2b5648=_0x47c5[_0x12a17c];return _0x2b5648;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file +var _0xd943=['show','get','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','send','put','/:id','destroy','/:id/dispositions','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x524508,_0x4f807d){var _0x3dfba8=function(_0x2c6077){while(--_0x2c6077){_0x524508['push'](_0x524508['shift']());}};_0x3dfba8(++_0x4f807d);}(_0xd943,0x15d));var _0x3d94=function(_0x5e8bf1,_0x32447f){_0x5e8bf1=_0x5e8bf1-0x0;var _0x3ad7c3=_0xd943[_0x5e8bf1];return _0x3ad7c3;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller['getDispositions']);router[_0x3d94('0xc')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router[_0x3d94('0xc')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);router['get'](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x12')]);router['post']('/',auth[_0x3d94('0x9')](),controller[_0x3d94('0x13')]);router[_0x3d94('0x14')]('/:id/dispositions',auth[_0x3d94('0x9')](),controller[_0x3d94('0x15')]);router[_0x3d94('0x14')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x16')]);router[_0x3d94('0x14')](_0x3d94('0xf'),auth['isAuthenticated'](),controller[_0x3d94('0x17')]);router[_0x3d94('0x14')](_0x3d94('0x11'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x18')]);router[_0x3d94('0x14')](_0x3d94('0x19'),controller['notify']);router[_0x3d94('0x14')]('/:id/send',auth[_0x3d94('0x9')](),controller[_0x3d94('0x1a')]);router[_0x3d94('0x1b')](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller['update']);router['delete'](_0x3d94('0x1c'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1d')]);router['delete'](_0x3d94('0x1e'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x1f')]);router[_0x3d94('0x20')](_0x3d94('0xd'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x21')]);router[_0x3d94('0x20')](_0x3d94('0xf'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x22')]);module[_0x3d94('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b3cb336..92522f5 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15c4=['randomstring','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x5b679a,_0x2efd8d){var _0x2ff17d=function(_0x18300a){while(--_0x18300a){_0x5b679a['push'](_0x5b679a['shift']());}};_0x2ff17d(++_0x2efd8d);}(_0x15c4,0x176));var _0x415c=function(_0x44230d,_0x330fb6){_0x44230d=_0x44230d-0x0;var _0x4e4673=_0x15c4[_0x44230d];return _0x4e4673;};'use strict';var Sequelize=require(_0x415c('0x0'));var rs=require(_0x415c('0x1'));module['exports']={'name':{'type':Sequelize[_0x415c('0x2')],'unique':_0x415c('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x415c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x415c('0x2')],'defaultValue':function(){return rs[_0x415c('0x4')]();}},'phone':{'type':Sequelize[_0x415c('0x2')]},'type':{'type':Sequelize[_0x415c('0x5')](_0x415c('0x6'))},'accountSid':{'type':Sequelize[_0x415c('0x2')]},'authToken':{'type':Sequelize[_0x415c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x415c('0x7')],'defaultValue':function(){return _0x415c('0x8');}},'notificationSound':{'type':Sequelize[_0x415c('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x415c('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x415c('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x415c('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x415c('0xa')],'comment':_0x415c('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x415c('0x9')],'defaultValue':![],'comment':_0x415c('0xc'),'set':function(_0x4962c8){if(!_0x4962c8){this[_0x415c('0xd')](_0x415c('0xe'),null);}this[_0x415c('0xd')]('mandatoryDisposition',_0x4962c8);}},'description':{'type':Sequelize[_0x415c('0x2')]}}; \ No newline at end of file +var _0x01a3=['ENUM','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','randomstring','exports','STRING','generate'];(function(_0x245da8,_0x5ae0cc){var _0x168b13=function(_0x32b608){while(--_0x32b608){_0x245da8['push'](_0x245da8['shift']());}};_0x168b13(++_0x5ae0cc);}(_0x01a3,0x109));var _0x301a=function(_0xd69b55,_0x14d143){_0xd69b55=_0xd69b55-0x0;var _0x37c370=_0x01a3[_0xd69b55];return _0x37c370;};'use strict';var Sequelize=require(_0x301a('0x0'));var rs=require(_0x301a('0x1'));module[_0x301a('0x2')]={'name':{'type':Sequelize[_0x301a('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x301a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x301a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x301a('0x3')],'defaultValue':function(){return rs[_0x301a('0x4')]();}},'phone':{'type':Sequelize[_0x301a('0x3')]},'type':{'type':Sequelize[_0x301a('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0x301a('0x3')]},'authToken':{'type':Sequelize[_0x301a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x301a('0x6')],'defaultValue':function(){return _0x301a('0x7');}},'notificationSound':{'type':Sequelize[_0x301a('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x301a('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x301a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x301a('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x301a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x301a('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x301a('0xb'),'set':function(_0x3a731e){if(!_0x3a731e){this[_0x301a('0xc')](_0x301a('0xd'),null);}this[_0x301a('0xc')](_0x301a('0xe'),_0x3a731e);}},'description':{'type':Sequelize[_0x301a('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 30e965d..26c1c3d 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b55=['Content-Type','text/xml','\x0a','json','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','order','findAll','removeDispositions','ids','CannedAnswer','getAnswers','includeAll','rows','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','emit','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','isNil','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','Contacts','DESC','list','contact','interaction','autoclose','push','close','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8b55,0x180));var _0x58b5=function(_0x58d014,_0x464722){_0x58d014=_0x58d014-0x0;var _0xdd3a4e=_0x8b55[_0x58d014];return _0xdd3a4e;};'use strict';var emlformat=require(_0x58b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58b5('0x1'));var jsonpatch=require(_0x58b5('0x2'));var rp=require(_0x58b5('0x3'));var moment=require(_0x58b5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x58b5('0x5'));var sox=require('sox');var csv=require(_0x58b5('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58b5('0x7'));var _=require('lodash');var squel=require(_0x58b5('0x8'));var crypto=require(_0x58b5('0x9'));var jsforce=require(_0x58b5('0xa'));var deskjs=require(_0x58b5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x58b5('0xc'));var Papa=require(_0x58b5('0xd'));var Redis=require(_0x58b5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x58b5('0xf'));var as=require(_0x58b5('0x10'));var hardwareService=require(_0x58b5('0x11'));var logger=require('../../config/logger')(_0x58b5('0x12'));var utils=require(_0x58b5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x58b5('0x14'));var db=require(_0x58b5('0x15'))['db'];config[_0x58b5('0x16')]=_[_0x58b5('0x17')](config[_0x58b5('0x16')],{'host':_0x58b5('0x18'),'port':0x18eb});var socket=require(_0x58b5('0x19'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x58b5('0x1a')](socket);var jayson=require(_0x58b5('0x1b'));var client=jayson[_0x58b5('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5016ca,_0x26d08d,_0x2ed642,_0x17a2be){return new BPromise(function(_0x4224b9,_0x50749a){var _0x4a931b=_0x17a2be||client;return _0x4a931b[_0x58b5('0x1d')](_0x5016ca,_0x2ed642)[_0x58b5('0x1e')](function(_0x16f849){logger[_0x58b5('0x1f')](_0x58b5('0x20'),_0x26d08d,_0x58b5('0x21'));logger[_0x58b5('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x26d08d,'request\x20sent',JSON[_0x58b5('0x23')](_0x16f849));if(_0x16f849[_0x58b5('0x24')]){if(_0x16f849[_0x58b5('0x24')][_0x58b5('0x25')]===0x1f4){logger[_0x58b5('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x26d08d,_0x16f849[_0x58b5('0x24')][_0x58b5('0x26')]);return _0x50749a(_0x16f849[_0x58b5('0x24')][_0x58b5('0x26')]);}logger['error'](_0x58b5('0x20'),_0x26d08d,_0x16f849[_0x58b5('0x24')][_0x58b5('0x26')]);return _0x4224b9(_0x16f849['error']['message']);}else{logger[_0x58b5('0x1f')](_0x58b5('0x20'),_0x26d08d,_0x58b5('0x21'));_0x4224b9(_0x16f849[_0x58b5('0x27')][_0x58b5('0x26')]);}})[_0x58b5('0x28')](function(_0x484e85){logger[_0x58b5('0x24')](_0x58b5('0x20'),_0x26d08d,_0x484e85);_0x50749a(_0x484e85);});});}function respondWithStatusCode(_0x223d30,_0x38b905){_0x38b905=_0x38b905||0xcc;return function(_0x26a87b){if(_0x26a87b){return _0x223d30[_0x58b5('0x29')](_0x38b905);}return _0x223d30[_0x58b5('0x2a')](_0x38b905)[_0x58b5('0x2b')]();};}function respondWithResult(_0x33ec81,_0x1efbcc){_0x1efbcc=_0x1efbcc||0xc8;return function(_0x47bd42){if(_0x47bd42){return _0x33ec81[_0x58b5('0x2a')](_0x1efbcc)['json'](_0x47bd42);}};}function respondWithFilteredResult(_0x1a60ac,_0x13e1f0){return function(_0x2aa06f){if(_0x2aa06f){var _0x32cc0f=typeof _0x13e1f0[_0x58b5('0x2c')]===_0x58b5('0x2d')&&typeof _0x13e1f0[_0x58b5('0x2e')]===_0x58b5('0x2d');var _0x274d02=_0x2aa06f[_0x58b5('0x2f')];var _0x48a4e5=_0x32cc0f?0x0:_0x13e1f0[_0x58b5('0x2c')];var _0x5385c4=_0x32cc0f?_0x2aa06f[_0x58b5('0x2f')]:_0x13e1f0[_0x58b5('0x2c')]+_0x13e1f0[_0x58b5('0x2e')];var _0x26e5e1;if(_0x5385c4>=_0x274d02){_0x5385c4=_0x274d02;_0x26e5e1=0xc8;}else{_0x26e5e1=0xce;}_0x1a60ac['status'](_0x26e5e1);return _0x1a60ac[_0x58b5('0x30')](_0x58b5('0x31'),_0x48a4e5+'-'+_0x5385c4+'/'+_0x274d02)['json'](_0x2aa06f);}return null;};}function patchUpdates(_0x5ab3ec){return function(_0x39b4bd){try{jsonpatch[_0x58b5('0x32')](_0x39b4bd,_0x5ab3ec,!![]);}catch(_0x153183){return BPromise[_0x58b5('0x33')](_0x153183);}return _0x39b4bd[_0x58b5('0x34')]();};}function saveUpdates(_0x14cd7b,_0x1efe51){return function(_0x3f564d){if(_0x3f564d){return _0x3f564d['update'](_0x14cd7b)[_0x58b5('0x1e')](function(_0x4f8344){return _0x4f8344;});}return null;};}function removeEntity(_0x591c1e,_0x5c70cb){return function(_0x11802c){if(_0x11802c){return _0x11802c[_0x58b5('0x35')]()[_0x58b5('0x1e')](function(){var _0x29d8bc=_0x11802c[_0x58b5('0x36')]({'plain':!![]});var _0x8c012e=_0x58b5('0x37');return db[_0x58b5('0x38')][_0x58b5('0x35')]({'where':{'type':_0x8c012e,'resourceId':_0x29d8bc['id']}})['then'](function(){return _0x11802c;});})['then'](function(){_0x591c1e[_0x58b5('0x2a')](0xcc)[_0x58b5('0x2b')]();});}};}function handleEntityNotFound(_0x475b83,_0x3008aa){return function(_0xa8649c){if(!_0xa8649c){_0x475b83[_0x58b5('0x29')](0x194);}return _0xa8649c;};}function handleError(_0x561ea3,_0x212075){_0x212075=_0x212075||0x1f4;return function(_0x5944d3){logger[_0x58b5('0x24')](_0x5944d3[_0x58b5('0x39')]);if(_0x5944d3[_0x58b5('0x3a')]){delete _0x5944d3[_0x58b5('0x3a')];}_0x561ea3[_0x58b5('0x2a')](_0x212075)[_0x58b5('0x3b')](_0x5944d3);};}exports[_0x58b5('0x3c')]=function(_0x5d5a43,_0x440bd2){var _0x333040={'include':[{'model':db[_0x58b5('0x3d')],'as':_0x58b5('0x3e')}]},_0x2a3387={},_0x20b914={'count':0x0,'rows':[]};var _0x12ed27=_[_0x58b5('0x3f')](db[_0x58b5('0x40')]['rawAttributes'],function(_0x5c2d46){return{'name':_0x5c2d46['fieldName'],'type':_0x5c2d46[_0x58b5('0x41')][_0x58b5('0x42')]};});_0x2a3387[_0x58b5('0x43')]=_[_0x58b5('0x3f')](_0x12ed27,_0x58b5('0x3a'));_0x2a3387[_0x58b5('0x44')]=_[_0x58b5('0x45')](_0x5d5a43[_0x58b5('0x44')]);_0x2a3387['filters']=_[_0x58b5('0x46')](_0x2a3387['model'],_0x2a3387[_0x58b5('0x44')]);_0x333040['attributes']=_[_0x58b5('0x46')](_0x2a3387[_0x58b5('0x43')],qs[_0x58b5('0x47')](_0x5d5a43[_0x58b5('0x44')]['fields']));_0x333040[_0x58b5('0x48')]=_0x333040[_0x58b5('0x48')][_0x58b5('0x49')]?_0x333040[_0x58b5('0x48')]:_0x2a3387[_0x58b5('0x43')];if(!_0x5d5a43[_0x58b5('0x44')][_0x58b5('0x4a')]('nolimit')){_0x333040['limit']=qs['limit'](_0x5d5a43[_0x58b5('0x44')]['limit']);_0x333040[_0x58b5('0x2c')]=qs[_0x58b5('0x2c')](_0x5d5a43[_0x58b5('0x44')][_0x58b5('0x2c')]);}_0x333040['order']=qs[_0x58b5('0x4b')](_0x5d5a43['query']['sort']);_0x333040[_0x58b5('0x4c')]=qs[_0x58b5('0x4d')](_[_0x58b5('0x4e')](_0x5d5a43[_0x58b5('0x44')],_0x2a3387['filters']),_0x12ed27);if(_0x5d5a43['query'][_0x58b5('0x4f')]){_0x333040[_0x58b5('0x4c')]=_[_0x58b5('0x50')](_0x333040[_0x58b5('0x4c')],{'$or':_[_0x58b5('0x3f')](_0x12ed27,function(_0x213c98){if(_0x213c98[_0x58b5('0x41')]!==_0x58b5('0x51')){var _0x58518f={};_0x58518f[_0x213c98['name']]={'$like':'%'+_0x5d5a43[_0x58b5('0x44')][_0x58b5('0x4f')]+'%'};return _0x58518f;}})});}_0x333040=_[_0x58b5('0x50')]({},_0x333040,_0x5d5a43[_0x58b5('0x52')]);var _0x3cefe3={'where':_0x333040['where']};return db['WhatsappAccount'][_0x58b5('0x2f')](_0x3cefe3)[_0x58b5('0x1e')](function(_0x2aad3a){_0x20b914[_0x58b5('0x2f')]=_0x2aad3a;if(_0x5d5a43[_0x58b5('0x44')]['includeAll']){_0x333040[_0x58b5('0x53')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x333040);})[_0x58b5('0x1e')](function(_0x3db9f6){_0x20b914['rows']=_0x3db9f6;return _0x20b914;})[_0x58b5('0x1e')](respondWithFilteredResult(_0x440bd2,_0x333040))['catch'](handleError(_0x440bd2,null));};exports[_0x58b5('0x54')]=function(_0x482502,_0x38e883){var _0x3f03d4={'raw':![],'where':{'id':_0x482502[_0x58b5('0x55')]['id']},'include':[{'model':db[_0x58b5('0x3d')],'as':_0x58b5('0x3e')}]},_0x4d2501={};_0x4d2501[_0x58b5('0x43')]=_[_0x58b5('0x45')](db[_0x58b5('0x40')][_0x58b5('0x56')]);_0x4d2501[_0x58b5('0x44')]=_['keys'](_0x482502[_0x58b5('0x44')]);_0x4d2501[_0x58b5('0x4d')]=_[_0x58b5('0x46')](_0x4d2501[_0x58b5('0x43')],_0x4d2501[_0x58b5('0x44')]);_0x3f03d4[_0x58b5('0x48')]=_[_0x58b5('0x46')](_0x4d2501[_0x58b5('0x43')],qs[_0x58b5('0x47')](_0x482502[_0x58b5('0x44')]['fields']));_0x3f03d4[_0x58b5('0x48')]=_0x3f03d4[_0x58b5('0x48')]['length']?_0x3f03d4[_0x58b5('0x48')]:_0x4d2501[_0x58b5('0x43')];if(_0x482502['query']['includeAll']){_0x3f03d4[_0x58b5('0x53')]=[{'all':!![]}];}_0x3f03d4=_[_0x58b5('0x50')]({},_0x3f03d4,_0x482502[_0x58b5('0x52')]);return db['WhatsappAccount'][_0x58b5('0x57')](_0x3f03d4)['then'](handleEntityNotFound(_0x38e883,null))[_0x58b5('0x1e')](respondWithResult(_0x38e883,null))[_0x58b5('0x28')](handleError(_0x38e883,null));};exports['create']=function(_0x2a5a88,_0x3b0a7c){return db[_0x58b5('0x40')][_0x58b5('0x58')](_0x2a5a88[_0x58b5('0x59')],{})[_0x58b5('0x1e')](function(_0x42a6d4){var _0x1f3634=_0x2a5a88[_0x58b5('0x5a')][_0x58b5('0x36')]({'plain':!![]});if(!_0x1f3634)throw new Error(_0x58b5('0x5b'));if(_0x1f3634[_0x58b5('0x5c')]===_0x58b5('0x5a')){var _0x2c3782=_0x42a6d4[_0x58b5('0x36')]({'plain':!![]});var _0x309d0c='WhatsappAccounts';return db[_0x58b5('0x5d')][_0x58b5('0x57')]({'where':{'name':_0x309d0c,'userProfileId':_0x1f3634[_0x58b5('0x5e')]},'raw':!![]})[_0x58b5('0x1e')](function(_0x2d484c){if(_0x2d484c&&_0x2d484c[_0x58b5('0x5f')]===0x0){return db[_0x58b5('0x38')][_0x58b5('0x58')]({'name':_0x2c3782[_0x58b5('0x3a')],'resourceId':_0x2c3782['id'],'type':_0x2d484c[_0x58b5('0x3a')],'sectionId':_0x2d484c['id']},{})[_0x58b5('0x1e')](function(){return _0x42a6d4;});}else{return _0x42a6d4;}})['catch'](function(_0x550e2d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x550e2d);throw _0x550e2d;});}return _0x42a6d4;})[_0x58b5('0x1e')](respondWithResult(_0x3b0a7c,0xc9))[_0x58b5('0x28')](handleError(_0x3b0a7c,null));};exports[_0x58b5('0x60')]=function(_0x8bcdaa,_0xd0b501){if(_0x8bcdaa[_0x58b5('0x59')]['id']){delete _0x8bcdaa[_0x58b5('0x59')]['id'];}return db[_0x58b5('0x40')]['find']({'where':{'id':_0x8bcdaa[_0x58b5('0x55')]['id']},'include':[{'model':db[_0x58b5('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x58b5('0x1e')](handleEntityNotFound(_0xd0b501,null))[_0x58b5('0x1e')](saveUpdates(_0x8bcdaa[_0x58b5('0x59')],null))[_0x58b5('0x1e')](respondWithResult(_0xd0b501,null))[_0x58b5('0x28')](handleError(_0xd0b501,null));};exports[_0x58b5('0x35')]=function(_0xa8d328,_0x208032){return db['WhatsappAccount']['find']({'where':{'id':_0xa8d328['params']['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x208032,null))[_0x58b5('0x1e')](removeEntity(_0x208032,null))[_0x58b5('0x28')](handleError(_0x208032,null));};exports['describe']=function(_0x6e29b1,_0x3c6827){return db[_0x58b5('0x40')][_0x58b5('0x61')]()[_0x58b5('0x1e')](respondWithResult(_0x3c6827,null))[_0x58b5('0x28')](handleError(_0x3c6827,null));};exports['addDisposition']=function(_0x550a51,_0x4f8741,_0x323a12){if(_0x550a51[_0x58b5('0x59')]['id']){delete _0x550a51[_0x58b5('0x59')]['id'];}return db[_0x58b5('0x40')]['find']({'where':{'id':_0x550a51[_0x58b5('0x55')]['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x4f8741,null))[_0x58b5('0x1e')](function(_0x36577e){if(_0x36577e){_0x550a51[_0x58b5('0x59')][_0x58b5('0x62')]=_0x36577e['id'];return db[_0x58b5('0x63')][_0x58b5('0x58')](_0x550a51[_0x58b5('0x59')]);}})[_0x58b5('0x1e')](respondWithResult(_0x4f8741,null))['catch'](handleError(_0x4f8741,null));};exports[_0x58b5('0x64')]=function(_0x350e2a,_0x20afd4,_0x22bf43){var _0x417440={'raw':![],'where':{}};var _0x1f2dee={};var _0x393149={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x58b5('0x65')]({'where':{'id':_0x350e2a['params']['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x20afd4,null))[_0x58b5('0x1e')](function(_0x5f0018){if(_0x5f0018){_0x1f2dee[_0x58b5('0x43')]=_[_0x58b5('0x45')](db[_0x58b5('0x63')][_0x58b5('0x56')]);_0x1f2dee[_0x58b5('0x44')]=_['keys'](_0x350e2a[_0x58b5('0x44')]);_0x1f2dee[_0x58b5('0x4d')]=_[_0x58b5('0x46')](_0x1f2dee['model'],_0x1f2dee[_0x58b5('0x44')]);_0x417440[_0x58b5('0x48')]=_[_0x58b5('0x46')](_0x1f2dee['model'],qs[_0x58b5('0x47')](_0x350e2a[_0x58b5('0x44')][_0x58b5('0x47')]));_0x417440[_0x58b5('0x48')]=_0x417440[_0x58b5('0x48')][_0x58b5('0x49')]?_0x417440[_0x58b5('0x48')]:_0x1f2dee[_0x58b5('0x43')];if(!_0x350e2a[_0x58b5('0x44')][_0x58b5('0x4a')](_0x58b5('0x66'))){_0x417440[_0x58b5('0x2e')]=qs[_0x58b5('0x2e')](_0x350e2a[_0x58b5('0x44')]['limit']);_0x417440['offset']=qs[_0x58b5('0x2c')](_0x350e2a[_0x58b5('0x44')][_0x58b5('0x2c')]);}_0x417440[_0x58b5('0x67')]=qs[_0x58b5('0x4b')](_0x350e2a[_0x58b5('0x44')]['sort']);_0x417440[_0x58b5('0x4c')]=qs[_0x58b5('0x4d')](_[_0x58b5('0x4e')](_0x350e2a[_0x58b5('0x44')],_0x1f2dee[_0x58b5('0x4d')]));_0x417440[_0x58b5('0x4c')]['WhatsappAccountId']=_0x5f0018['id'];if(_0x350e2a['query']['filter']){_0x417440[_0x58b5('0x4c')]=_[_0x58b5('0x50')](_0x417440[_0x58b5('0x4c')],{'$or':_[_0x58b5('0x3f')](_0x417440['attributes'],function(_0x355e5b){var _0x48718b={};_0x48718b[_0x355e5b]={'$like':'%'+_0x350e2a[_0x58b5('0x44')][_0x58b5('0x4f')]+'%'};return _0x48718b;})});}_0x417440=_['merge']({},_0x417440,_0x350e2a[_0x58b5('0x52')]);return db[_0x58b5('0x63')][_0x58b5('0x2f')]({'where':_0x417440[_0x58b5('0x4c')]})[_0x58b5('0x1e')](function(_0x1d257e){_0x393149[_0x58b5('0x2f')]=_0x1d257e;if(_0x350e2a['query']['includeAll']){_0x417440[_0x58b5('0x53')]=[{'all':!![]}];}return db[_0x58b5('0x63')][_0x58b5('0x68')](_0x417440);})['then'](function(_0x5a769a){_0x393149['rows']=_0x5a769a;return _0x393149;});}})[_0x58b5('0x1e')](respondWithFilteredResult(_0x20afd4,_0x417440))[_0x58b5('0x28')](handleError(_0x20afd4,null));};exports[_0x58b5('0x69')]=function(_0x4a6854,_0x5d2a88,_0x30eab3){return db[_0x58b5('0x40')][_0x58b5('0x57')]({'where':{'id':_0x4a6854['params']['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x5d2a88,null))[_0x58b5('0x1e')](function(_0x550af5){if(_0x550af5){return _0x550af5['removeDispositions'](_0x4a6854[_0x58b5('0x44')][_0x58b5('0x6a')]);}})['then'](respondWithStatusCode(_0x5d2a88,null))['catch'](handleError(_0x5d2a88,null));};exports['addAnswer']=function(_0x32b0c4,_0x9a0c4e,_0x51515f){if(_0x32b0c4[_0x58b5('0x59')]['id']){delete _0x32b0c4[_0x58b5('0x59')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x32b0c4[_0x58b5('0x55')]['id']}})['then'](handleEntityNotFound(_0x9a0c4e,null))[_0x58b5('0x1e')](function(_0x358e58){if(_0x358e58){_0x32b0c4[_0x58b5('0x59')]['WhatsappAccountId']=_0x358e58['id'];return db[_0x58b5('0x6b')][_0x58b5('0x58')](_0x32b0c4[_0x58b5('0x59')]);}})[_0x58b5('0x1e')](respondWithResult(_0x9a0c4e,null))['catch'](handleError(_0x9a0c4e,null));};exports[_0x58b5('0x6c')]=function(_0x28c796,_0x4ca9c0,_0x48c8ca){var _0x3c41d8={'raw':![],'where':{}};var _0x93e9fe={};var _0x42dd6a={'count':0x0,'rows':[]};return db[_0x58b5('0x40')][_0x58b5('0x65')]({'where':{'id':_0x28c796['params']['id']}})['then'](handleEntityNotFound(_0x4ca9c0,null))[_0x58b5('0x1e')](function(_0x3df7de){if(_0x3df7de){_0x93e9fe[_0x58b5('0x43')]=_['keys'](db[_0x58b5('0x6b')]['rawAttributes']);_0x93e9fe['query']=_[_0x58b5('0x45')](_0x28c796[_0x58b5('0x44')]);_0x93e9fe['filters']=_['intersection'](_0x93e9fe['model'],_0x93e9fe[_0x58b5('0x44')]);_0x3c41d8[_0x58b5('0x48')]=_[_0x58b5('0x46')](_0x93e9fe[_0x58b5('0x43')],qs['fields'](_0x28c796[_0x58b5('0x44')]['fields']));_0x3c41d8[_0x58b5('0x48')]=_0x3c41d8[_0x58b5('0x48')][_0x58b5('0x49')]?_0x3c41d8[_0x58b5('0x48')]:_0x93e9fe['model'];if(!_0x28c796[_0x58b5('0x44')]['hasOwnProperty'](_0x58b5('0x66'))){_0x3c41d8['limit']=qs[_0x58b5('0x2e')](_0x28c796[_0x58b5('0x44')][_0x58b5('0x2e')]);_0x3c41d8['offset']=qs['offset'](_0x28c796['query'][_0x58b5('0x2c')]);}_0x3c41d8[_0x58b5('0x67')]=qs[_0x58b5('0x4b')](_0x28c796[_0x58b5('0x44')][_0x58b5('0x4b')]);_0x3c41d8[_0x58b5('0x4c')]=qs['filters'](_[_0x58b5('0x4e')](_0x28c796['query'],_0x93e9fe[_0x58b5('0x4d')]));_0x3c41d8[_0x58b5('0x4c')][_0x58b5('0x62')]=_0x3df7de['id'];if(_0x28c796[_0x58b5('0x44')][_0x58b5('0x4f')]){_0x3c41d8['where']=_[_0x58b5('0x50')](_0x3c41d8[_0x58b5('0x4c')],{'$or':_['map'](_0x3c41d8['attributes'],function(_0x508126){var _0x22d466={};_0x22d466[_0x508126]={'$like':'%'+_0x28c796[_0x58b5('0x44')]['filter']+'%'};return _0x22d466;})});}_0x3c41d8=_[_0x58b5('0x50')]({},_0x3c41d8,_0x28c796['options']);return db[_0x58b5('0x6b')]['count']({'where':_0x3c41d8[_0x58b5('0x4c')]})['then'](function(_0x3d6600){_0x42dd6a[_0x58b5('0x2f')]=_0x3d6600;if(_0x28c796[_0x58b5('0x44')][_0x58b5('0x6d')]){_0x3c41d8[_0x58b5('0x53')]=[{'all':!![]}];}return db[_0x58b5('0x6b')][_0x58b5('0x68')](_0x3c41d8);})[_0x58b5('0x1e')](function(_0x23a78f){_0x42dd6a[_0x58b5('0x6e')]=_0x23a78f;return _0x42dd6a;});}})['then'](respondWithFilteredResult(_0x4ca9c0,_0x3c41d8))[_0x58b5('0x28')](handleError(_0x4ca9c0,null));};exports[_0x58b5('0x6f')]=function(_0x2b7ca2,_0x405071,_0x3b4cf0){return db[_0x58b5('0x40')][_0x58b5('0x57')]({'where':{'id':_0x2b7ca2[_0x58b5('0x55')]['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x405071,null))['then'](function(_0x2f7966){if(_0x2f7966){return _0x2f7966[_0x58b5('0x6f')](_0x2b7ca2[_0x58b5('0x44')][_0x58b5('0x6a')]);}})['then'](respondWithStatusCode(_0x405071,null))['catch'](handleError(_0x405071,null));};exports[_0x58b5('0x70')]=function(_0x1781df,_0x3d188c,_0x3db2f7){return db[_0x58b5('0x40')][_0x58b5('0x57')]({'where':{'id':_0x1781df['params']['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x3d188c,null))['then'](function(_0x544b08){if(_0x544b08){return _0x544b08['addAgents'](_0x1781df['body'][_0x58b5('0x6a')],_[_0x58b5('0x71')](_0x1781df[_0x58b5('0x59')],['ids','id'])||{})[_0x58b5('0x72')](function(_0x44a0ef){for(var _0x2f4101=0x0;_0x2f4101<_0x1781df['body'][_0x58b5('0x6a')]['length'];_0x2f4101+=0x1){socket['emit'](_0x58b5('0x73'),{'UserId':Number(_0x1781df[_0x58b5('0x59')][_0x58b5('0x6a')][_0x2f4101]),'WhatsappAccountId':Number(_0x1781df[_0x58b5('0x55')]['id'])});}return _0x44a0ef;});}})['then'](respondWithResult(_0x3d188c,null))[_0x58b5('0x28')](handleError(_0x3d188c,null));};exports[_0x58b5('0x74')]=function(_0x23d9c4,_0xc363b8,_0x230475){return db[_0x58b5('0x40')][_0x58b5('0x57')]({'where':{'id':_0x23d9c4[_0x58b5('0x55')]['id']}})['then'](handleEntityNotFound(_0xc363b8,null))['then'](function(_0x3d2f7a){if(_0x3d2f7a){return _0x3d2f7a[_0x58b5('0x74')](_0x23d9c4['query'][_0x58b5('0x6a')])['then'](function(){if(_['isArray'](_0x23d9c4[_0x58b5('0x44')][_0x58b5('0x6a')])){for(var _0xb56f84=0x0;_0xb56f84<_0x23d9c4[_0x58b5('0x44')]['ids'][_0x58b5('0x49')];_0xb56f84+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x23d9c4[_0x58b5('0x44')]['ids'][_0xb56f84]),'WhatsappAccountId':Number(_0x23d9c4['params']['id'])});}}else{socket[_0x58b5('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x23d9c4['query'][_0x58b5('0x6a')]),'WhatsappAccountId':Number(_0x23d9c4[_0x58b5('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xc363b8,null))[_0x58b5('0x28')](handleError(_0xc363b8,null));};exports[_0x58b5('0x76')]=function(_0x3268a5,_0x22c5f6,_0x2a9a91){var _0x16c57d={};var _0x345333={};var _0x23ae13;var _0x15774c;return db[_0x58b5('0x40')][_0x58b5('0x65')]({'where':{'id':_0x3268a5['params']['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x22c5f6,null))[_0x58b5('0x1e')](function(_0x42069e){if(_0x42069e){_0x23ae13=_0x42069e;_0x345333[_0x58b5('0x43')]=_[_0x58b5('0x45')](db['User'][_0x58b5('0x56')]);_0x345333[_0x58b5('0x44')]=_[_0x58b5('0x45')](_0x3268a5[_0x58b5('0x44')]);_0x345333[_0x58b5('0x4d')]=_[_0x58b5('0x46')](_0x345333[_0x58b5('0x43')],_0x345333[_0x58b5('0x44')]);_0x16c57d[_0x58b5('0x48')]=_['intersection'](_0x345333[_0x58b5('0x43')],qs[_0x58b5('0x47')](_0x3268a5['query'][_0x58b5('0x47')]));_0x16c57d[_0x58b5('0x48')]=_0x16c57d['attributes']['length']?_0x16c57d['attributes']:_0x345333[_0x58b5('0x43')];_0x16c57d[_0x58b5('0x67')]=qs[_0x58b5('0x4b')](_0x3268a5['query'][_0x58b5('0x4b')]);_0x16c57d['where']=qs[_0x58b5('0x4d')](_[_0x58b5('0x4e')](_0x3268a5[_0x58b5('0x44')],_0x345333[_0x58b5('0x4d')]));if(_0x3268a5[_0x58b5('0x44')]['filter']){_0x16c57d[_0x58b5('0x4c')]=_[_0x58b5('0x50')](_0x16c57d[_0x58b5('0x4c')],{'$or':_[_0x58b5('0x3f')](_0x16c57d[_0x58b5('0x48')],function(_0x321ff3){var _0x489369={};_0x489369[_0x321ff3]={'$like':'%'+_0x3268a5[_0x58b5('0x44')][_0x58b5('0x4f')]+'%'};return _0x489369;})});}_0x16c57d=_[_0x58b5('0x50')]({},_0x16c57d,_0x3268a5[_0x58b5('0x52')]);return _0x23ae13[_0x58b5('0x76')](_0x16c57d);}})[_0x58b5('0x1e')](function(_0x1355c6){if(_0x1355c6){_0x15774c=_0x1355c6[_0x58b5('0x49')];if(!_0x3268a5[_0x58b5('0x44')][_0x58b5('0x4a')](_0x58b5('0x66'))){_0x16c57d[_0x58b5('0x2e')]=qs['limit'](_0x3268a5['query'][_0x58b5('0x2e')]);_0x16c57d[_0x58b5('0x2c')]=qs['offset'](_0x3268a5[_0x58b5('0x44')][_0x58b5('0x2c')]);}return _0x23ae13[_0x58b5('0x76')](_0x16c57d);}})[_0x58b5('0x1e')](function(_0x163d38){if(_0x163d38){return _0x163d38?{'count':_0x15774c,'rows':_0x163d38}:null;}})['then'](respondWithResult(_0x22c5f6,null))['catch'](handleError(_0x22c5f6,null));};exports[_0x58b5('0x77')]=function(_0x38a680,_0x562d84,_0xc5f4bc){return db['WhatsappAccount'][_0x58b5('0x65')]({'where':{'id':_0x38a680[_0x58b5('0x55')]['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x562d84,null))['then'](function(_0x171a99){if(_0x171a99){return db[_0x58b5('0x78')][_0x58b5('0x79')](function(_0x29b1de){return db[_0x58b5('0x7a')][_0x58b5('0x35')]({'where':{'WhatsappAccountId':_0x38a680[_0x58b5('0x55')]['id']},'transaction':_0x29b1de})[_0x58b5('0x1e')](function(_0x247c8a){var _0x2de677=_[_0x58b5('0x3f')](_0x38a680[_0x58b5('0x59')],function(_0x2545ce){_0x2545ce[_0x58b5('0x62')]=_0x38a680['params']['id'];return _0x2545ce;});return db[_0x58b5('0x7a')][_0x58b5('0x7b')](_0x2de677,{'transaction':_0x29b1de});});})['then'](function(){return db['WhatsappApplication'][_0x58b5('0x7c')]({'where':{'WhatsappAccountId':_0x38a680['params']['id']},'order':_0x58b5('0x7d')});});}})[_0x58b5('0x1e')](respondWithResult(_0x562d84,null))[_0x58b5('0x28')](handleError(_0x562d84,null));};exports[_0x58b5('0x7e')]=function(_0x2bd46e,_0x2d50da,_0x44a5fb){var _0x414a37={};var _0x169174={};var _0x13e409;var _0x5a500e;return db['WhatsappAccount'][_0x58b5('0x65')]({'where':{'id':_0x2bd46e[_0x58b5('0x55')]['id']}})[_0x58b5('0x1e')](handleEntityNotFound(_0x2d50da,null))[_0x58b5('0x1e')](function(_0x21389a){if(_0x21389a){_0x13e409=_0x21389a;_0x169174[_0x58b5('0x43')]=_[_0x58b5('0x45')](db['WhatsappApplication'][_0x58b5('0x56')]);_0x169174[_0x58b5('0x44')]=_['keys'](_0x2bd46e[_0x58b5('0x44')]);_0x169174[_0x58b5('0x4d')]=_[_0x58b5('0x46')](_0x169174[_0x58b5('0x43')],_0x169174[_0x58b5('0x44')]);_0x414a37[_0x58b5('0x48')]=_[_0x58b5('0x46')](_0x169174[_0x58b5('0x43')],qs[_0x58b5('0x47')](_0x2bd46e[_0x58b5('0x44')]['fields']));_0x414a37[_0x58b5('0x48')]=_0x414a37[_0x58b5('0x48')][_0x58b5('0x49')]?_0x414a37['attributes']:_0x169174['model'];_0x414a37[_0x58b5('0x67')]=qs[_0x58b5('0x4b')](_0x2bd46e['query'][_0x58b5('0x4b')]);_0x414a37[_0x58b5('0x4c')]=qs[_0x58b5('0x4d')](_[_0x58b5('0x4e')](_0x2bd46e[_0x58b5('0x44')],_0x169174['filters']));if(_0x2bd46e[_0x58b5('0x44')]['filter']){_0x414a37[_0x58b5('0x4c')]=_[_0x58b5('0x50')](_0x414a37[_0x58b5('0x4c')],{'$or':_[_0x58b5('0x3f')](_0x414a37[_0x58b5('0x48')],function(_0x23b5b5){var _0x50ffa2={};_0x50ffa2[_0x23b5b5]={'$like':'%'+_0x2bd46e[_0x58b5('0x44')][_0x58b5('0x4f')]+'%'};return _0x50ffa2;})});}_0x414a37=_[_0x58b5('0x50')]({},_0x414a37,_0x2bd46e['options']);return _0x13e409[_0x58b5('0x7e')](_0x414a37);}})[_0x58b5('0x1e')](function(_0x15df2a){if(_0x15df2a){_0x5a500e=_0x15df2a[_0x58b5('0x49')];if(!_0x2bd46e[_0x58b5('0x44')]['hasOwnProperty']('nolimit')){_0x414a37[_0x58b5('0x2e')]=qs[_0x58b5('0x2e')](_0x2bd46e[_0x58b5('0x44')]['limit']);_0x414a37['offset']=qs[_0x58b5('0x2c')](_0x2bd46e['query'][_0x58b5('0x2c')]);}return _0x13e409[_0x58b5('0x7e')](_0x414a37);}})['then'](function(_0xdebb2c){if(_0xdebb2c){return _0xdebb2c?{'count':_0x5a500e,'rows':_0xdebb2c}:null;}})[_0x58b5('0x1e')](respondWithResult(_0x2d50da,null))[_0x58b5('0x28')](handleError(_0x2d50da,null));};exports['notify']=function(_0x4e726b,_0x580e5e,_0x3a70bc){var _0x4d1adb={'channel':_0x58b5('0x7f')};var _0x3cfdc2=[];var _0x41095e=[];var _0x56711d={};return db['WhatsappAccount'][_0x58b5('0x57')]({'where':{'id':_0x4e726b[_0x58b5('0x55')]['id']},'include':[{'model':db[_0x58b5('0x7a')],'as':_0x58b5('0x80')}]})[_0x58b5('0x1e')](handleEntityNotFound(_0x580e5e,null))[_0x58b5('0x1e')](function(_0x3e229a){_0x4d1adb['account']=_0x3e229a;_0x4d1adb[_0x58b5('0x81')]=_[_0x58b5('0x82')](_0x3e229a[_0x58b5('0x80')],[_0x58b5('0x7d')],[_0x58b5('0x83')]);if(_0x4d1adb['account']['Applications']){delete _0x4d1adb[_0x58b5('0x84')]['Applications'];}return db[_0x58b5('0x85')][_0x58b5('0x61')]();})['then'](function(_0x360fcd){if(!_0x360fcd){throw new db[(_0x58b5('0x86'))][(_0x58b5('0x87'))](_0x58b5('0x88'));}_0x3cfdc2=_['difference'](_['keys'](_0x360fcd),[_0x58b5('0x89'),_0x58b5('0x8a')]);_0x41095e=_['difference'](_[_0x58b5('0x45')](_0x360fcd),['createdAt',_0x58b5('0x8a'),_0x58b5('0x8b'),_0x58b5('0x8c')]);_0x4d1adb[_0x58b5('0x59')]={'mapKey':_0x58b5('0x8d')};if(_0x4d1adb[_0x58b5('0x84')][_0x58b5('0x41')]&&_0x4d1adb[_0x58b5('0x84')]['type']===_0x58b5('0x8e')){_0x4d1adb['body'][_0x58b5('0x8f')]=_0x4e726b['body'][_0x58b5('0x90')][_0x58b5('0x91')](_0x58b5('0x92'),'');_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x59')]=_0x4e726b[_0x58b5('0x59')]['Body'];_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x93')]=_0x4e726b[_0x58b5('0x59')]['MessageSid'];}if(_0x4d1adb[_0x58b5('0x59')]['id']){delete _0x4d1adb[_0x58b5('0x59')]['id'];}if(_[_0x58b5('0x94')](_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x8f')])){throw new db[(_0x58b5('0x86'))][(_0x58b5('0x87'))](_0x58b5('0x95'));}if(_[_0x58b5('0x94')](_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x59')])||_0x4d1adb[_0x58b5('0x59')]['body']===''){throw new db[(_0x58b5('0x86'))][(_0x58b5('0x87'))](_0x58b5('0x96'));}if(_[_0x58b5('0x94')](_0x4d1adb['body'][_0x58b5('0x97')])){throw new db[(_0x58b5('0x86'))][(_0x58b5('0x87'))](_0x58b5('0x98')+_0x41095e);}if(!_[_0x58b5('0x99')](_0x41095e,_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x97')])){throw new db[(_0x58b5('0x86'))]['ValidationError'](_0x58b5('0x9a')+_0x41095e);}_0x56711d[_0x4d1adb[_0x58b5('0x59')]['mapKey']]=_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x8f')];return db[_0x58b5('0x9b')][_0x58b5('0x57')]({'where':{'id':_0x4d1adb['account'][_0x58b5('0x8c')]},'include':[{'model':db[_0x58b5('0x85')],'as':_0x58b5('0x9c'),'where':_0x56711d,'limit':0x1,'order':[[_0x58b5('0x8a'),_0x58b5('0x9d')]]}]});})[_0x58b5('0x1e')](handleEntityNotFound(_0x580e5e,null))[_0x58b5('0x1e')](function(_0x44e405){if(_0x44e405){_0x4d1adb[_0x58b5('0x9e')]=_[_0x58b5('0x71')](_0x44e405,[_0x58b5('0x9c')]);if(_0x44e405['Contacts']['length']){return _0x44e405['Contacts'][0x0];}var _0x1ac143=_['defaults'](_0x4d1adb[_0x58b5('0x59')],{'firstName':_0x4d1adb['body'][_0x58b5('0x8f')],'ListId':_0x44e405['id']});_0x1ac143[_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x97')]]=_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x8f')];return db[_0x58b5('0x85')][_0x58b5('0x58')](_0x1ac143,{'fields':_0x3cfdc2,'raw':!![]});}})[_0x58b5('0x1e')](handleEntityNotFound(_0x580e5e,null))[_0x58b5('0x1e')](function(_0x2f6b81){if(_0x2f6b81){_0x4d1adb[_0x58b5('0x9f')]=_0x2f6b81;var _0x16bcd0={'ContactId':_0x2f6b81['id'],'phone':_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x8f')],'WhatsappAccountId':_0x4e726b[_0x58b5('0x55')]['id']};var _0x2149c5={'ContactId':_0x2f6b81['id'],'WhatsappAccountId':_0x4e726b['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x2149c5})[_0x58b5('0x1e')](function(_0x1a3897){if(_0x1a3897){return[_0x1a3897,![]];}return db['WhatsappInteraction'][_0x58b5('0x58')](_0x16bcd0)[_0x58b5('0x1e')](function(_0x4a4a66){return[_0x4a4a66,!![]];});});}})['spread'](function(_0x778051,_0x4383e2){_0x4d1adb['interaction']=_0x778051[_0x58b5('0x36')]({'plain':!![]});_0x4d1adb[_0x58b5('0xa0')]['created']=![];if(_0x4383e2){if(_0x4d1adb[_0x58b5('0x84')][_0x58b5('0xa1')]){_0x4d1adb[_0x58b5('0x81')][_0x58b5('0xa2')]({'id':0x0,'priority':_0x4d1adb[_0x58b5('0x81')]['length']+0x1,'app':_0x58b5('0xa3'),'appdata':'unmanaged','interval':_0x58b5('0xa4')});}_0x4d1adb['interaction'][_0x58b5('0xa5')]=!![];}return db[_0x58b5('0xa6')][_0x58b5('0x58')]({'phone':_0x4d1adb['body'][_0x58b5('0x8f')],'messageId':_0x4d1adb[_0x58b5('0x59')][_0x58b5('0x93')],'body':_0x4d1adb['body']['body'],'WhatsappAccountId':_0x4e726b[_0x58b5('0x55')]['id'],'WhatsappInteractionId':_0x778051['id'],'direction':'in','ContactId':_0x778051[_0x58b5('0xa7')],'AttachmentId':_0x4d1adb['body'][_0x58b5('0xa8')]});})[_0x58b5('0x1e')](function(_0x18e478){_0x4d1adb[_0x58b5('0x26')]=_0x18e478;if(_0x4d1adb[_0x58b5('0xa0')][_0x58b5('0xa9')]){return db['User']['find']({'attributes':['id',_0x58b5('0x3a')],'where':{'id':_0x4d1adb[_0x58b5('0xa0')][_0x58b5('0xa9')]}})['then'](function(_0x1ba42d){if(_0x1ba42d){_0x4d1adb['applications'][_0x58b5('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1ba42d[_0x58b5('0x3a')]+','+(_0x4d1adb['account'][_0x58b5('0xab')]||0xa),'interval':_0x58b5('0xa4')});}return respondWithRpcPromise(_0x58b5('0xac'),_0x58b5('0xad'),_0x4d1adb);});}return respondWithRpcPromise('Start','startRouting',_0x4d1adb);})[_0x58b5('0x1e')](function(_0x1e2577){if(_0x1e2577){var _0x5851ed=0xc8;var _0x49e917=_0x58b5('0xae');logger['info'](_0x58b5('0xaf'),_0x49e917,_0x5851ed,_0x58b5('0xb0'));logger[_0x58b5('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x49e917,_0x5851ed,'entity\x20found',JSON[_0x58b5('0x23')](_0x1e2577));if(_0x4d1adb[_0x58b5('0x84')]['type']===_0x58b5('0x8e')){return _0x580e5e['status'](_0x5851ed)[_0x58b5('0x30')](_0x58b5('0xb1'),_0x58b5('0xb2'))['send'](_0x58b5('0xb3'));}else{return _0x580e5e[_0x58b5('0x2a')](_0x5851ed)[_0x58b5('0xb4')](_0x1e2577);}}})['catch'](handleError(_0x580e5e,null));};exports[_0x58b5('0x3b')]=function(_0x15b8b6,_0x310a59,_0x385957){var _0x3da4e3,_0x15107d,_0x3153e2;if(_[_0x58b5('0x94')](_0x15b8b6['body']['body'])||_0x15b8b6[_0x58b5('0x59')][_0x58b5('0x59')]===''){throw new db['Sequelize']['ValidationError'](_0x58b5('0x96'));}if(_['isNil'](_0x15b8b6[_0x58b5('0x59')]['to'])){throw new db['Sequelize'][(_0x58b5('0x87'))](_0x58b5('0xb5'));}_0x3da4e3=_0x15b8b6[_0x58b5('0x59')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x15b8b6[_0x58b5('0x55')]['id']},'include':[{'model':db[_0x58b5('0x9b')],'as':'List','include':[{'model':db[_0x58b5('0x85')],'as':_0x58b5('0x9c'),'where':{'mobile':_0x3da4e3},'limit':0x1,'order':[[_0x58b5('0x8a'),_0x58b5('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x310a59,null))[_0x58b5('0x1e')](function(_0x1f4192){if(_0x1f4192&&_0x1f4192[_0x58b5('0xb6')]){_0x15107d=_0x1f4192[_0x58b5('0x36')]({'plain':!![]});if(_0x15107d['List']&&_0x15107d[_0x58b5('0xb6')]['Contacts'][_0x58b5('0x49')]){return _0x15107d[_0x58b5('0xb6')][_0x58b5('0x9c')][0x0];}return db['CmContact']['create'](_['defaults'](_0x15b8b6[_0x58b5('0x59')],{'firstName':_0x3da4e3,'mobile':_0x3da4e3,'phone':_0x3da4e3,'ListId':_0x15107d[_0x58b5('0x8c')]}));}})['then'](handleEntityNotFound(_0x310a59,null))['then'](function(_0x297cd3){if(_0x297cd3){_0x3153e2=_0x297cd3;return db[_0x58b5('0xb7')][_0x58b5('0x57')]({'where':{'ContactId':_0x3153e2['id'],'closed':![],'WhatsappAccountId':_0x15107d['id']}})[_0x58b5('0x1e')](function(_0x527904){if(_0x527904){return[_0x527904,![]];}return db[_0x58b5('0xb7')][_0x58b5('0x58')]({'UserId':_0x15b8b6[_0x58b5('0x5a')]['id'],'ContactId':_0x3153e2['id'],'WhatsappAccountId':_0x15107d['id'],'phone':_0x3da4e3,'firstMsgDirection':_0x58b5('0xb8'),'Messages':[_[_0x58b5('0x50')](_0x15b8b6[_0x58b5('0x59')],{'read':![],'body':_0x15b8b6[_0x58b5('0x59')]['body'],'phone':_0x3da4e3,'WhatsappAccountId':_0x15107d['id'],'UserId':_0x15b8b6[_0x58b5('0x5a')]['id'],'ContactId':_0x3153e2['id']})]},{'include':[{'model':db[_0x58b5('0xa6')],'as':_0x58b5('0xb9')}]})[_0x58b5('0x1e')](function(_0x5c3ab7){return[_0x5c3ab7,!![]];});});}})[_0x58b5('0x72')](function(_0x4d2165,_0x6d2b6f){if(_0x6d2b6f){return _0x4d2165;}return db[_0x58b5('0xa6')][_0x58b5('0x58')](_[_0x58b5('0x50')](_0x15b8b6[_0x58b5('0x59')],{'read':![],'body':_0x15b8b6['body']['body'],'phone':_0x3da4e3,'WhatsappAccountId':_0x15107d['id'],'WhatsappInteractionId':_0x4d2165['id'],'UserId':_0x15b8b6[_0x58b5('0x5a')]['id'],'ContactId':_0x3153e2['id']}))[_0x58b5('0x1e')](function(_0x3ecb21){_0x4d2165[_0x58b5('0xba')]['Messages']=[];_0x4d2165[_0x58b5('0xba')]['Messages'][_0x58b5('0xa2')](_0x3ecb21[_0x58b5('0xba')]);return _0x4d2165;});})[_0x58b5('0x1e')](respondWithResult(_0x310a59,null))[_0x58b5('0x28')](handleError(_0x310a59,null));}; \ No newline at end of file +var _0x82ce=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','stack','send','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','params','Pause','includeAll','options','find','create','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','getDispositions','nolimit','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','WhatsappApplication','findAndCountAll','priority','notify','Applications','applications','orderBy','asc','account','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','From','whatsapp:','Body','messageId','MessageSid','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis'];(function(_0x1ccad2,_0x18301b){var _0x11b223=function(_0x3f2776){while(--_0x3f2776){_0x1ccad2['push'](_0x1ccad2['shift']());}};_0x11b223(++_0x18301b);}(_0x82ce,0xa6));var _0xe82c=function(_0x13e0e2,_0xb543b4){_0x13e0e2=_0x13e0e2-0x0;var _0x14f2b8=_0x82ce[_0x13e0e2];return _0x14f2b8;};'use strict';var emlformat=require(_0xe82c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe82c('0x1'));var jsonpatch=require(_0xe82c('0x2'));var rp=require(_0xe82c('0x3'));var moment=require(_0xe82c('0x4'));var BPromise=require(_0xe82c('0x5'));var Mustache=require(_0xe82c('0x6'));var util=require(_0xe82c('0x7'));var path=require(_0xe82c('0x8'));var sox=require('sox');var csv=require(_0xe82c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe82c('0xa'));var squel=require(_0xe82c('0xb'));var crypto=require(_0xe82c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe82c('0xd'));var toCsv=require(_0xe82c('0x9'));var querystring=require('querystring');var Papa=require(_0xe82c('0xe'));var Redis=require(_0xe82c('0xf'));var authService=require(_0xe82c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe82c('0x11'));var hardwareService=require(_0xe82c('0x12'));var logger=require(_0xe82c('0x13'))(_0xe82c('0x14'));var utils=require(_0xe82c('0x15'));var config=require(_0xe82c('0x16'));var licenseUtil=require(_0xe82c('0x17'));var db=require(_0xe82c('0x18'))['db'];config[_0xe82c('0x19')]=_[_0xe82c('0x1a')](config[_0xe82c('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe82c('0x1b'))(new Redis(config['redis']));require(_0xe82c('0x1c'))['register'](socket);var jayson=require(_0xe82c('0x1d'));var client=jayson[_0xe82c('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4ac428,_0x4d6736,_0x1050e2,_0x73f8df){return new BPromise(function(_0x4a31c5,_0x5f4ea1){var _0x548e85=_0x73f8df||client;return _0x548e85['request'](_0x4ac428,_0x1050e2)['then'](function(_0x46af60){logger['info'](_0xe82c('0x1f'),_0x4d6736,'request\x20sent');logger[_0xe82c('0x20')](_0xe82c('0x21'),_0x4d6736,_0xe82c('0x22'),JSON[_0xe82c('0x23')](_0x46af60));if(_0x46af60[_0xe82c('0x24')]){if(_0x46af60[_0xe82c('0x24')][_0xe82c('0x25')]===0x1f4){logger['error'](_0xe82c('0x1f'),_0x4d6736,_0x46af60[_0xe82c('0x24')]['message']);return _0x5f4ea1(_0x46af60[_0xe82c('0x24')][_0xe82c('0x26')]);}logger[_0xe82c('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x4d6736,_0x46af60['error'][_0xe82c('0x26')]);return _0x4a31c5(_0x46af60[_0xe82c('0x24')][_0xe82c('0x26')]);}else{logger['info'](_0xe82c('0x1f'),_0x4d6736,_0xe82c('0x22'));_0x4a31c5(_0x46af60['result'][_0xe82c('0x26')]);}})[_0xe82c('0x27')](function(_0x1b4244){logger[_0xe82c('0x24')](_0xe82c('0x1f'),_0x4d6736,_0x1b4244);_0x5f4ea1(_0x1b4244);});});}function respondWithStatusCode(_0x2c95ea,_0x1a97b4){_0x1a97b4=_0x1a97b4||0xcc;return function(_0x173469){if(_0x173469){return _0x2c95ea[_0xe82c('0x28')](_0x1a97b4);}return _0x2c95ea[_0xe82c('0x29')](_0x1a97b4)[_0xe82c('0x2a')]();};}function respondWithResult(_0x3b4d9b,_0x405fdb){_0x405fdb=_0x405fdb||0xc8;return function(_0x287cdf){if(_0x287cdf){return _0x3b4d9b[_0xe82c('0x29')](_0x405fdb)[_0xe82c('0x2b')](_0x287cdf);}};}function respondWithFilteredResult(_0x4e66cb,_0x12f2a0){return function(_0x129522){if(_0x129522){var _0x3b48b1=typeof _0x12f2a0[_0xe82c('0x2c')]==='undefined'&&typeof _0x12f2a0[_0xe82c('0x2d')]===_0xe82c('0x2e');var _0x43dbf9=_0x129522['count'];var _0x5305d6=_0x3b48b1?0x0:_0x12f2a0[_0xe82c('0x2c')];var _0xa2ad32=_0x3b48b1?_0x129522[_0xe82c('0x2f')]:_0x12f2a0[_0xe82c('0x2c')]+_0x12f2a0[_0xe82c('0x2d')];var _0x999ce;if(_0xa2ad32>=_0x43dbf9){_0xa2ad32=_0x43dbf9;_0x999ce=0xc8;}else{_0x999ce=0xce;}_0x4e66cb[_0xe82c('0x29')](_0x999ce);return _0x4e66cb[_0xe82c('0x30')](_0xe82c('0x31'),_0x5305d6+'-'+_0xa2ad32+'/'+_0x43dbf9)[_0xe82c('0x2b')](_0x129522);}return null;};}function patchUpdates(_0x260552){return function(_0x1b0768){try{jsonpatch[_0xe82c('0x32')](_0x1b0768,_0x260552,!![]);}catch(_0x28d0f3){return BPromise[_0xe82c('0x33')](_0x28d0f3);}return _0x1b0768['save']();};}function saveUpdates(_0x44e3d,_0x450115){return function(_0x4fa045){if(_0x4fa045){return _0x4fa045[_0xe82c('0x34')](_0x44e3d)[_0xe82c('0x35')](function(_0x2245a5){return _0x2245a5;});}return null;};}function removeEntity(_0x57e0d6,_0x5f2b7d){return function(_0x262307){if(_0x262307){return _0x262307[_0xe82c('0x36')]()['then'](function(){var _0x3b32e0=_0x262307[_0xe82c('0x37')]({'plain':!![]});var _0x5f2543='WhatsappAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x5f2543,'resourceId':_0x3b32e0['id']}})[_0xe82c('0x35')](function(){return _0x262307;});})[_0xe82c('0x35')](function(){_0x57e0d6[_0xe82c('0x29')](0xcc)[_0xe82c('0x2a')]();});}};}function handleEntityNotFound(_0x1808e8,_0xd0da85){return function(_0x3c1927){if(!_0x3c1927){_0x1808e8[_0xe82c('0x28')](0x194);}return _0x3c1927;};}function handleError(_0x5cb50e,_0x43adb6){_0x43adb6=_0x43adb6||0x1f4;return function(_0x41cc3f){logger['error'](_0x41cc3f[_0xe82c('0x38')]);if(_0x41cc3f['name']){delete _0x41cc3f['name'];}_0x5cb50e[_0xe82c('0x29')](_0x43adb6)[_0xe82c('0x39')](_0x41cc3f);};}exports['index']=function(_0x5380da,_0x3af883){var _0x1d18b9={'include':[{'model':db['Pause'],'as':_0xe82c('0x3a')}]},_0x3dfc88={},_0x5b15c7={'count':0x0,'rows':[]};var _0x585e30=_[_0xe82c('0x3b')](db[_0xe82c('0x3c')][_0xe82c('0x3d')],function(_0x586f47){return{'name':_0x586f47[_0xe82c('0x3e')],'type':_0x586f47['type']['key']};});_0x3dfc88[_0xe82c('0x3f')]=_[_0xe82c('0x3b')](_0x585e30,_0xe82c('0x40'));_0x3dfc88['query']=_[_0xe82c('0x41')](_0x5380da[_0xe82c('0x42')]);_0x3dfc88[_0xe82c('0x43')]=_[_0xe82c('0x44')](_0x3dfc88[_0xe82c('0x3f')],_0x3dfc88['query']);_0x1d18b9['attributes']=_[_0xe82c('0x44')](_0x3dfc88[_0xe82c('0x3f')],qs[_0xe82c('0x45')](_0x5380da[_0xe82c('0x42')][_0xe82c('0x45')]));_0x1d18b9['attributes']=_0x1d18b9[_0xe82c('0x46')][_0xe82c('0x47')]?_0x1d18b9[_0xe82c('0x46')]:_0x3dfc88[_0xe82c('0x3f')];if(!_0x5380da[_0xe82c('0x42')][_0xe82c('0x48')]('nolimit')){_0x1d18b9['limit']=qs[_0xe82c('0x2d')](_0x5380da['query'][_0xe82c('0x2d')]);_0x1d18b9['offset']=qs[_0xe82c('0x2c')](_0x5380da['query'][_0xe82c('0x2c')]);}_0x1d18b9[_0xe82c('0x49')]=qs['sort'](_0x5380da[_0xe82c('0x42')][_0xe82c('0x4a')]);_0x1d18b9[_0xe82c('0x4b')]=qs[_0xe82c('0x43')](_[_0xe82c('0x4c')](_0x5380da[_0xe82c('0x42')],_0x3dfc88[_0xe82c('0x43')]),_0x585e30);if(_0x5380da[_0xe82c('0x42')]['filter']){_0x1d18b9[_0xe82c('0x4b')]=_['merge'](_0x1d18b9[_0xe82c('0x4b')],{'$or':_[_0xe82c('0x3b')](_0x585e30,function(_0x3048c7){if(_0x3048c7['type']!=='VIRTUAL'){var _0x5e14b2={};_0x5e14b2[_0x3048c7[_0xe82c('0x40')]]={'$like':'%'+_0x5380da['query'][_0xe82c('0x4d')]+'%'};return _0x5e14b2;}})});}_0x1d18b9=_[_0xe82c('0x4e')]({},_0x1d18b9,_0x5380da['options']);var _0x49188b={'where':_0x1d18b9[_0xe82c('0x4b')]};return db[_0xe82c('0x3c')][_0xe82c('0x2f')](_0x49188b)[_0xe82c('0x35')](function(_0x55bf35){_0x5b15c7[_0xe82c('0x2f')]=_0x55bf35;if(_0x5380da[_0xe82c('0x42')]['includeAll']){_0x1d18b9[_0xe82c('0x4f')]=[{'all':!![]}];}return db[_0xe82c('0x3c')][_0xe82c('0x50')](_0x1d18b9);})[_0xe82c('0x35')](function(_0x43150f){_0x5b15c7[_0xe82c('0x51')]=_0x43150f;return _0x5b15c7;})[_0xe82c('0x35')](respondWithFilteredResult(_0x3af883,_0x1d18b9))[_0xe82c('0x27')](handleError(_0x3af883,null));};exports['show']=function(_0x56dcd1,_0x3216ca){var _0x70c32f={'raw':![],'where':{'id':_0x56dcd1[_0xe82c('0x52')]['id']},'include':[{'model':db[_0xe82c('0x53')],'as':_0xe82c('0x3a')}]},_0x5f1baa={};_0x5f1baa['model']=_['keys'](db[_0xe82c('0x3c')][_0xe82c('0x3d')]);_0x5f1baa['query']=_[_0xe82c('0x41')](_0x56dcd1[_0xe82c('0x42')]);_0x5f1baa[_0xe82c('0x43')]=_['intersection'](_0x5f1baa['model'],_0x5f1baa[_0xe82c('0x42')]);_0x70c32f[_0xe82c('0x46')]=_[_0xe82c('0x44')](_0x5f1baa[_0xe82c('0x3f')],qs[_0xe82c('0x45')](_0x56dcd1[_0xe82c('0x42')]['fields']));_0x70c32f[_0xe82c('0x46')]=_0x70c32f[_0xe82c('0x46')][_0xe82c('0x47')]?_0x70c32f[_0xe82c('0x46')]:_0x5f1baa[_0xe82c('0x3f')];if(_0x56dcd1[_0xe82c('0x42')][_0xe82c('0x54')]){_0x70c32f[_0xe82c('0x4f')]=[{'all':!![]}];}_0x70c32f=_['merge']({},_0x70c32f,_0x56dcd1[_0xe82c('0x55')]);return db[_0xe82c('0x3c')][_0xe82c('0x56')](_0x70c32f)['then'](handleEntityNotFound(_0x3216ca,null))[_0xe82c('0x35')](respondWithResult(_0x3216ca,null))[_0xe82c('0x27')](handleError(_0x3216ca,null));};exports[_0xe82c('0x57')]=function(_0x4e4e31,_0x39e901){return db[_0xe82c('0x3c')]['create'](_0x4e4e31['body'],{})[_0xe82c('0x35')](function(_0x2740ab){var _0x3fd29b=_0x4e4e31[_0xe82c('0x58')][_0xe82c('0x37')]({'plain':!![]});if(!_0x3fd29b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fd29b[_0xe82c('0x59')]==='user'){var _0x2b4a09=_0x2740ab['get']({'plain':!![]});var _0x1f72ef='WhatsappAccounts';return db['UserProfileSection'][_0xe82c('0x56')]({'where':{'name':_0x1f72ef,'userProfileId':_0x3fd29b['userProfileId']},'raw':!![]})[_0xe82c('0x35')](function(_0x3d1185){if(_0x3d1185&&_0x3d1185[_0xe82c('0x5a')]===0x0){return db[_0xe82c('0x5b')][_0xe82c('0x57')]({'name':_0x2b4a09[_0xe82c('0x40')],'resourceId':_0x2b4a09['id'],'type':_0x3d1185[_0xe82c('0x40')],'sectionId':_0x3d1185['id']},{})[_0xe82c('0x35')](function(){return _0x2740ab;});}else{return _0x2740ab;}})['catch'](function(_0x4d3b9c){logger[_0xe82c('0x24')](_0xe82c('0x5c'),_0x4d3b9c);throw _0x4d3b9c;});}return _0x2740ab;})[_0xe82c('0x35')](respondWithResult(_0x39e901,0xc9))[_0xe82c('0x27')](handleError(_0x39e901,null));};exports[_0xe82c('0x34')]=function(_0x447441,_0x45a4ed){if(_0x447441[_0xe82c('0x5d')]['id']){delete _0x447441[_0xe82c('0x5d')]['id'];}return db[_0xe82c('0x3c')]['find']({'where':{'id':_0x447441[_0xe82c('0x52')]['id']},'include':[{'model':db[_0xe82c('0x53')],'as':'mandatoryDispositionPause'}]})[_0xe82c('0x35')](handleEntityNotFound(_0x45a4ed,null))[_0xe82c('0x35')](saveUpdates(_0x447441[_0xe82c('0x5d')],null))[_0xe82c('0x35')](respondWithResult(_0x45a4ed,null))['catch'](handleError(_0x45a4ed,null));};exports[_0xe82c('0x36')]=function(_0x52bb6f,_0x5886e9){return db[_0xe82c('0x3c')]['find']({'where':{'id':_0x52bb6f[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x5886e9,null))[_0xe82c('0x35')](removeEntity(_0x5886e9,null))[_0xe82c('0x27')](handleError(_0x5886e9,null));};exports['describe']=function(_0x28dce1,_0x3d00fc){return db['WhatsappAccount'][_0xe82c('0x5e')]()[_0xe82c('0x35')](respondWithResult(_0x3d00fc,null))[_0xe82c('0x27')](handleError(_0x3d00fc,null));};exports[_0xe82c('0x5f')]=function(_0x4588d0,_0xc51828,_0x4d320d){if(_0x4588d0[_0xe82c('0x5d')]['id']){delete _0x4588d0[_0xe82c('0x5d')]['id'];}return db[_0xe82c('0x3c')][_0xe82c('0x56')]({'where':{'id':_0x4588d0[_0xe82c('0x52')]['id']}})['then'](handleEntityNotFound(_0xc51828,null))[_0xe82c('0x35')](function(_0x1d74e1){if(_0x1d74e1){_0x4588d0[_0xe82c('0x5d')][_0xe82c('0x60')]=_0x1d74e1['id'];return db['Disposition'][_0xe82c('0x57')](_0x4588d0[_0xe82c('0x5d')]);}})[_0xe82c('0x35')](respondWithResult(_0xc51828,null))[_0xe82c('0x27')](handleError(_0xc51828,null));};exports[_0xe82c('0x61')]=function(_0x3d4aa1,_0x29a0b9,_0x2a741d){var _0x4e3311={'raw':![],'where':{}};var _0x3625c4={};var _0x4d5ca5={'count':0x0,'rows':[]};return db[_0xe82c('0x3c')]['findOne']({'where':{'id':_0x3d4aa1[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x29a0b9,null))[_0xe82c('0x35')](function(_0x1fd48e){if(_0x1fd48e){_0x3625c4[_0xe82c('0x3f')]=_[_0xe82c('0x41')](db['Disposition'][_0xe82c('0x3d')]);_0x3625c4[_0xe82c('0x42')]=_[_0xe82c('0x41')](_0x3d4aa1[_0xe82c('0x42')]);_0x3625c4[_0xe82c('0x43')]=_[_0xe82c('0x44')](_0x3625c4['model'],_0x3625c4[_0xe82c('0x42')]);_0x4e3311[_0xe82c('0x46')]=_[_0xe82c('0x44')](_0x3625c4[_0xe82c('0x3f')],qs['fields'](_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x45')]));_0x4e3311[_0xe82c('0x46')]=_0x4e3311[_0xe82c('0x46')][_0xe82c('0x47')]?_0x4e3311[_0xe82c('0x46')]:_0x3625c4['model'];if(!_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x48')](_0xe82c('0x62'))){_0x4e3311[_0xe82c('0x2d')]=qs['limit'](_0x3d4aa1['query'][_0xe82c('0x2d')]);_0x4e3311[_0xe82c('0x2c')]=qs['offset'](_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x2c')]);}_0x4e3311[_0xe82c('0x49')]=qs[_0xe82c('0x4a')](_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x4a')]);_0x4e3311[_0xe82c('0x4b')]=qs[_0xe82c('0x43')](_[_0xe82c('0x4c')](_0x3d4aa1[_0xe82c('0x42')],_0x3625c4['filters']));_0x4e3311[_0xe82c('0x4b')][_0xe82c('0x60')]=_0x1fd48e['id'];if(_0x3d4aa1[_0xe82c('0x42')]['filter']){_0x4e3311[_0xe82c('0x4b')]=_[_0xe82c('0x4e')](_0x4e3311[_0xe82c('0x4b')],{'$or':_['map'](_0x4e3311[_0xe82c('0x46')],function(_0x5ce3fa){var _0x25c848={};_0x25c848[_0x5ce3fa]={'$like':'%'+_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x4d')]+'%'};return _0x25c848;})});}_0x4e3311=_[_0xe82c('0x4e')]({},_0x4e3311,_0x3d4aa1[_0xe82c('0x55')]);return db['Disposition'][_0xe82c('0x2f')]({'where':_0x4e3311[_0xe82c('0x4b')]})[_0xe82c('0x35')](function(_0x16c915){_0x4d5ca5[_0xe82c('0x2f')]=_0x16c915;if(_0x3d4aa1[_0xe82c('0x42')][_0xe82c('0x54')]){_0x4e3311['include']=[{'all':!![]}];}return db[_0xe82c('0x63')][_0xe82c('0x50')](_0x4e3311);})['then'](function(_0x3f60ce){_0x4d5ca5['rows']=_0x3f60ce;return _0x4d5ca5;});}})[_0xe82c('0x35')](respondWithFilteredResult(_0x29a0b9,_0x4e3311))[_0xe82c('0x27')](handleError(_0x29a0b9,null));};exports[_0xe82c('0x64')]=function(_0x40114a,_0x5064bb,_0x5c17ea){return db[_0xe82c('0x3c')][_0xe82c('0x56')]({'where':{'id':_0x40114a[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x5064bb,null))[_0xe82c('0x35')](function(_0x444bc4){if(_0x444bc4){return _0x444bc4[_0xe82c('0x64')](_0x40114a['query'][_0xe82c('0x65')]);}})['then'](respondWithStatusCode(_0x5064bb,null))[_0xe82c('0x27')](handleError(_0x5064bb,null));};exports[_0xe82c('0x66')]=function(_0x49ad83,_0x4c5fed,_0x25d347){if(_0x49ad83[_0xe82c('0x5d')]['id']){delete _0x49ad83[_0xe82c('0x5d')]['id'];}return db[_0xe82c('0x3c')]['find']({'where':{'id':_0x49ad83[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x4c5fed,null))['then'](function(_0x5de791){if(_0x5de791){_0x49ad83[_0xe82c('0x5d')][_0xe82c('0x60')]=_0x5de791['id'];return db[_0xe82c('0x67')]['create'](_0x49ad83[_0xe82c('0x5d')]);}})[_0xe82c('0x35')](respondWithResult(_0x4c5fed,null))['catch'](handleError(_0x4c5fed,null));};exports[_0xe82c('0x68')]=function(_0x370a76,_0x5f35d9,_0x3146a3){var _0x2549e8={'raw':![],'where':{}};var _0x31cd1d={};var _0x1bf0ca={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x370a76[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x5f35d9,null))[_0xe82c('0x35')](function(_0x121e81){if(_0x121e81){_0x31cd1d[_0xe82c('0x3f')]=_['keys'](db['CannedAnswer'][_0xe82c('0x3d')]);_0x31cd1d[_0xe82c('0x42')]=_[_0xe82c('0x41')](_0x370a76[_0xe82c('0x42')]);_0x31cd1d[_0xe82c('0x43')]=_[_0xe82c('0x44')](_0x31cd1d['model'],_0x31cd1d[_0xe82c('0x42')]);_0x2549e8[_0xe82c('0x46')]=_[_0xe82c('0x44')](_0x31cd1d[_0xe82c('0x3f')],qs['fields'](_0x370a76[_0xe82c('0x42')][_0xe82c('0x45')]));_0x2549e8[_0xe82c('0x46')]=_0x2549e8[_0xe82c('0x46')][_0xe82c('0x47')]?_0x2549e8[_0xe82c('0x46')]:_0x31cd1d['model'];if(!_0x370a76['query'][_0xe82c('0x48')](_0xe82c('0x62'))){_0x2549e8[_0xe82c('0x2d')]=qs[_0xe82c('0x2d')](_0x370a76['query']['limit']);_0x2549e8[_0xe82c('0x2c')]=qs[_0xe82c('0x2c')](_0x370a76[_0xe82c('0x42')][_0xe82c('0x2c')]);}_0x2549e8[_0xe82c('0x49')]=qs[_0xe82c('0x4a')](_0x370a76[_0xe82c('0x42')]['sort']);_0x2549e8['where']=qs['filters'](_[_0xe82c('0x4c')](_0x370a76[_0xe82c('0x42')],_0x31cd1d[_0xe82c('0x43')]));_0x2549e8['where'][_0xe82c('0x60')]=_0x121e81['id'];if(_0x370a76[_0xe82c('0x42')][_0xe82c('0x4d')]){_0x2549e8['where']=_[_0xe82c('0x4e')](_0x2549e8['where'],{'$or':_[_0xe82c('0x3b')](_0x2549e8[_0xe82c('0x46')],function(_0x43f7c0){var _0x199b51={};_0x199b51[_0x43f7c0]={'$like':'%'+_0x370a76[_0xe82c('0x42')]['filter']+'%'};return _0x199b51;})});}_0x2549e8=_['merge']({},_0x2549e8,_0x370a76['options']);return db[_0xe82c('0x67')]['count']({'where':_0x2549e8['where']})[_0xe82c('0x35')](function(_0xd4a11a){_0x1bf0ca[_0xe82c('0x2f')]=_0xd4a11a;if(_0x370a76[_0xe82c('0x42')][_0xe82c('0x54')]){_0x2549e8['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2549e8);})[_0xe82c('0x35')](function(_0xc54d53){_0x1bf0ca[_0xe82c('0x51')]=_0xc54d53;return _0x1bf0ca;});}})[_0xe82c('0x35')](respondWithFilteredResult(_0x5f35d9,_0x2549e8))[_0xe82c('0x27')](handleError(_0x5f35d9,null));};exports[_0xe82c('0x69')]=function(_0x214a1c,_0x134d0e,_0xef6f21){return db['WhatsappAccount'][_0xe82c('0x56')]({'where':{'id':_0x214a1c[_0xe82c('0x52')]['id']}})['then'](handleEntityNotFound(_0x134d0e,null))[_0xe82c('0x35')](function(_0x2f3a3b){if(_0x2f3a3b){return _0x2f3a3b[_0xe82c('0x69')](_0x214a1c[_0xe82c('0x42')][_0xe82c('0x65')]);}})[_0xe82c('0x35')](respondWithStatusCode(_0x134d0e,null))['catch'](handleError(_0x134d0e,null));};exports[_0xe82c('0x6a')]=function(_0x59efd7,_0x1ceb8d,_0x192720){return db[_0xe82c('0x3c')][_0xe82c('0x56')]({'where':{'id':_0x59efd7[_0xe82c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ceb8d,null))['then'](function(_0x1bbdf5){if(_0x1bbdf5){return _0x1bbdf5['addAgents'](_0x59efd7[_0xe82c('0x5d')][_0xe82c('0x65')],_[_0xe82c('0x6b')](_0x59efd7[_0xe82c('0x5d')],[_0xe82c('0x65'),'id'])||{})[_0xe82c('0x6c')](function(_0x59c5d8){for(var _0x3f45f5=0x0;_0x3f45f5<_0x59efd7[_0xe82c('0x5d')][_0xe82c('0x65')]['length'];_0x3f45f5+=0x1){socket[_0xe82c('0x6d')](_0xe82c('0x6e'),{'UserId':Number(_0x59efd7[_0xe82c('0x5d')][_0xe82c('0x65')][_0x3f45f5]),'WhatsappAccountId':Number(_0x59efd7[_0xe82c('0x52')]['id'])});}return _0x59c5d8;});}})[_0xe82c('0x35')](respondWithResult(_0x1ceb8d,null))['catch'](handleError(_0x1ceb8d,null));};exports[_0xe82c('0x6f')]=function(_0x2e46ce,_0x15ddc2,_0x23f12c){return db[_0xe82c('0x3c')]['find']({'where':{'id':_0x2e46ce[_0xe82c('0x52')]['id']}})['then'](handleEntityNotFound(_0x15ddc2,null))[_0xe82c('0x35')](function(_0x52a284){if(_0x52a284){return _0x52a284[_0xe82c('0x6f')](_0x2e46ce[_0xe82c('0x42')]['ids'])[_0xe82c('0x35')](function(){if(_[_0xe82c('0x70')](_0x2e46ce[_0xe82c('0x42')][_0xe82c('0x65')])){for(var _0x408c5d=0x0;_0x408c5d<_0x2e46ce[_0xe82c('0x42')][_0xe82c('0x65')][_0xe82c('0x47')];_0x408c5d+=0x1){socket[_0xe82c('0x6d')](_0xe82c('0x71'),{'UserId':Number(_0x2e46ce[_0xe82c('0x42')][_0xe82c('0x65')][_0x408c5d]),'WhatsappAccountId':Number(_0x2e46ce['params']['id'])});}}else{socket[_0xe82c('0x6d')](_0xe82c('0x71'),{'UserId':Number(_0x2e46ce['query'][_0xe82c('0x65')]),'WhatsappAccountId':Number(_0x2e46ce[_0xe82c('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x15ddc2,null))[_0xe82c('0x27')](handleError(_0x15ddc2,null));};exports[_0xe82c('0x72')]=function(_0x177baf,_0x4de17f,_0x4c340e){var _0x2bec8c={};var _0x477dea={};var _0x41e50b;var _0x479e3f;return db[_0xe82c('0x3c')][_0xe82c('0x73')]({'where':{'id':_0x177baf[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x4de17f,null))[_0xe82c('0x35')](function(_0x9ed06a){if(_0x9ed06a){_0x41e50b=_0x9ed06a;_0x477dea['model']=_[_0xe82c('0x41')](db[_0xe82c('0x74')]['rawAttributes']);_0x477dea['query']=_[_0xe82c('0x41')](_0x177baf['query']);_0x477dea[_0xe82c('0x43')]=_[_0xe82c('0x44')](_0x477dea[_0xe82c('0x3f')],_0x477dea[_0xe82c('0x42')]);_0x2bec8c['attributes']=_[_0xe82c('0x44')](_0x477dea[_0xe82c('0x3f')],qs[_0xe82c('0x45')](_0x177baf[_0xe82c('0x42')][_0xe82c('0x45')]));_0x2bec8c['attributes']=_0x2bec8c[_0xe82c('0x46')][_0xe82c('0x47')]?_0x2bec8c[_0xe82c('0x46')]:_0x477dea[_0xe82c('0x3f')];_0x2bec8c['order']=qs[_0xe82c('0x4a')](_0x177baf[_0xe82c('0x42')][_0xe82c('0x4a')]);_0x2bec8c['where']=qs['filters'](_[_0xe82c('0x4c')](_0x177baf[_0xe82c('0x42')],_0x477dea[_0xe82c('0x43')]));if(_0x177baf[_0xe82c('0x42')][_0xe82c('0x4d')]){_0x2bec8c['where']=_['merge'](_0x2bec8c['where'],{'$or':_['map'](_0x2bec8c[_0xe82c('0x46')],function(_0x5dc0c3){var _0x49c954={};_0x49c954[_0x5dc0c3]={'$like':'%'+_0x177baf[_0xe82c('0x42')][_0xe82c('0x4d')]+'%'};return _0x49c954;})});}_0x2bec8c=_['merge']({},_0x2bec8c,_0x177baf['options']);return _0x41e50b[_0xe82c('0x72')](_0x2bec8c);}})[_0xe82c('0x35')](function(_0x16c878){if(_0x16c878){_0x479e3f=_0x16c878[_0xe82c('0x47')];if(!_0x177baf[_0xe82c('0x42')][_0xe82c('0x48')]('nolimit')){_0x2bec8c['limit']=qs[_0xe82c('0x2d')](_0x177baf[_0xe82c('0x42')][_0xe82c('0x2d')]);_0x2bec8c[_0xe82c('0x2c')]=qs['offset'](_0x177baf[_0xe82c('0x42')][_0xe82c('0x2c')]);}return _0x41e50b[_0xe82c('0x72')](_0x2bec8c);}})[_0xe82c('0x35')](function(_0x16a3ba){if(_0x16a3ba){return _0x16a3ba?{'count':_0x479e3f,'rows':_0x16a3ba}:null;}})[_0xe82c('0x35')](respondWithResult(_0x4de17f,null))['catch'](handleError(_0x4de17f,null));};exports[_0xe82c('0x75')]=function(_0xb727c9,_0x369610,_0x514ffa){return db[_0xe82c('0x3c')]['findOne']({'where':{'id':_0xb727c9[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x369610,null))[_0xe82c('0x35')](function(_0x3731d0){if(_0x3731d0){return db[_0xe82c('0x76')]['transaction'](function(_0x498916){return db['WhatsappApplication'][_0xe82c('0x36')]({'where':{'WhatsappAccountId':_0xb727c9[_0xe82c('0x52')]['id']},'transaction':_0x498916})[_0xe82c('0x35')](function(_0x2ad29b){var _0x3df6fd=_[_0xe82c('0x3b')](_0xb727c9[_0xe82c('0x5d')],function(_0x43a0c0){_0x43a0c0[_0xe82c('0x60')]=_0xb727c9[_0xe82c('0x52')]['id'];return _0x43a0c0;});return db[_0xe82c('0x77')]['bulkCreate'](_0x3df6fd,{'transaction':_0x498916});});})[_0xe82c('0x35')](function(){return db[_0xe82c('0x77')][_0xe82c('0x78')]({'where':{'WhatsappAccountId':_0xb727c9[_0xe82c('0x52')]['id']},'order':_0xe82c('0x79')});});}})[_0xe82c('0x35')](respondWithResult(_0x369610,null))[_0xe82c('0x27')](handleError(_0x369610,null));};exports['getApplications']=function(_0x54f4f1,_0x4dccf4,_0x2441a5){var _0x171414={};var _0xa45604={};var _0x5d32ba;var _0x1e8e8d;return db[_0xe82c('0x3c')][_0xe82c('0x73')]({'where':{'id':_0x54f4f1[_0xe82c('0x52')]['id']}})[_0xe82c('0x35')](handleEntityNotFound(_0x4dccf4,null))['then'](function(_0x5af3b1){if(_0x5af3b1){_0x5d32ba=_0x5af3b1;_0xa45604['model']=_[_0xe82c('0x41')](db[_0xe82c('0x77')][_0xe82c('0x3d')]);_0xa45604['query']=_[_0xe82c('0x41')](_0x54f4f1[_0xe82c('0x42')]);_0xa45604[_0xe82c('0x43')]=_[_0xe82c('0x44')](_0xa45604[_0xe82c('0x3f')],_0xa45604[_0xe82c('0x42')]);_0x171414[_0xe82c('0x46')]=_[_0xe82c('0x44')](_0xa45604[_0xe82c('0x3f')],qs[_0xe82c('0x45')](_0x54f4f1[_0xe82c('0x42')]['fields']));_0x171414['attributes']=_0x171414[_0xe82c('0x46')]['length']?_0x171414['attributes']:_0xa45604[_0xe82c('0x3f')];_0x171414[_0xe82c('0x49')]=qs['sort'](_0x54f4f1[_0xe82c('0x42')][_0xe82c('0x4a')]);_0x171414['where']=qs['filters'](_['pick'](_0x54f4f1[_0xe82c('0x42')],_0xa45604[_0xe82c('0x43')]));if(_0x54f4f1[_0xe82c('0x42')]['filter']){_0x171414['where']=_[_0xe82c('0x4e')](_0x171414[_0xe82c('0x4b')],{'$or':_[_0xe82c('0x3b')](_0x171414['attributes'],function(_0x4a38bf){var _0x2eb949={};_0x2eb949[_0x4a38bf]={'$like':'%'+_0x54f4f1[_0xe82c('0x42')][_0xe82c('0x4d')]+'%'};return _0x2eb949;})});}_0x171414=_[_0xe82c('0x4e')]({},_0x171414,_0x54f4f1[_0xe82c('0x55')]);return _0x5d32ba['getApplications'](_0x171414);}})[_0xe82c('0x35')](function(_0x19f8c4){if(_0x19f8c4){_0x1e8e8d=_0x19f8c4[_0xe82c('0x47')];if(!_0x54f4f1[_0xe82c('0x42')][_0xe82c('0x48')]('nolimit')){_0x171414[_0xe82c('0x2d')]=qs[_0xe82c('0x2d')](_0x54f4f1[_0xe82c('0x42')][_0xe82c('0x2d')]);_0x171414[_0xe82c('0x2c')]=qs[_0xe82c('0x2c')](_0x54f4f1[_0xe82c('0x42')][_0xe82c('0x2c')]);}return _0x5d32ba['getApplications'](_0x171414);}})[_0xe82c('0x35')](function(_0x5f8081){if(_0x5f8081){return _0x5f8081?{'count':_0x1e8e8d,'rows':_0x5f8081}:null;}})[_0xe82c('0x35')](respondWithResult(_0x4dccf4,null))[_0xe82c('0x27')](handleError(_0x4dccf4,null));};exports[_0xe82c('0x7a')]=function(_0x17bafe,_0x119597,_0x599783){var _0xaf843b={'channel':'whatsapp'};var _0x409d1b=[];var _0x55698b=[];var _0x48f0ee={};return db[_0xe82c('0x3c')][_0xe82c('0x56')]({'where':{'id':_0x17bafe['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xe82c('0x7b')}]})[_0xe82c('0x35')](handleEntityNotFound(_0x119597,null))['then'](function(_0x3923bc){_0xaf843b['account']=_0x3923bc;_0xaf843b[_0xe82c('0x7c')]=_[_0xe82c('0x7d')](_0x3923bc[_0xe82c('0x7b')],[_0xe82c('0x79')],[_0xe82c('0x7e')]);if(_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x7b')]){delete _0xaf843b[_0xe82c('0x7f')][_0xe82c('0x7b')];}return db['CmContact']['describe']();})['then'](function(_0x16f8aa){if(!_0x16f8aa){throw new db['Sequelize'][(_0xe82c('0x80'))](_0xe82c('0x81'));}_0x409d1b=_[_0xe82c('0x82')](_[_0xe82c('0x41')](_0x16f8aa),[_0xe82c('0x83'),'updatedAt']);_0x55698b=_[_0xe82c('0x82')](_[_0xe82c('0x41')](_0x16f8aa),[_0xe82c('0x83'),_0xe82c('0x84'),_0xe82c('0x85'),_0xe82c('0x86')]);_0xaf843b['body']={'mapKey':_0xe82c('0x87')};if(_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x88')]&&_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x88')]===_0xe82c('0x89')){_0xaf843b[_0xe82c('0x5d')]['from']=_0x17bafe[_0xe82c('0x5d')][_0xe82c('0x8a')]['replace'](_0xe82c('0x8b'),'');_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x5d')]=_0x17bafe[_0xe82c('0x5d')][_0xe82c('0x8c')];_0xaf843b['body'][_0xe82c('0x8d')]=_0x17bafe[_0xe82c('0x5d')][_0xe82c('0x8e')];}if(_0xaf843b[_0xe82c('0x5d')]['id']){delete _0xaf843b[_0xe82c('0x5d')]['id'];}if(_[_0xe82c('0x8f')](_0xaf843b['body'][_0xe82c('0x90')])){throw new db[(_0xe82c('0x91'))]['ValidationError'](_0xe82c('0x92'));}if(_['isNil'](_0xaf843b['body'][_0xe82c('0x5d')])||_0xaf843b['body']['body']===''){throw new db[(_0xe82c('0x91'))][(_0xe82c('0x80'))](_0xe82c('0x93'));}if(_['isNil'](_0xaf843b[_0xe82c('0x5d')]['mapKey'])){throw new db[(_0xe82c('0x91'))][(_0xe82c('0x80'))](_0xe82c('0x94')+_0x55698b);}if(!_['includes'](_0x55698b,_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x95')])){throw new db[(_0xe82c('0x91'))][(_0xe82c('0x80'))](_0xe82c('0x96')+_0x55698b);}_0x48f0ee[_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x95')]]=_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x90')];return db['CmList'][_0xe82c('0x56')]({'where':{'id':_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x86')]},'include':[{'model':db[_0xe82c('0x97')],'as':_0xe82c('0x98'),'where':_0x48f0ee,'limit':0x1,'order':[['updatedAt',_0xe82c('0x99')]]}]});})[_0xe82c('0x35')](handleEntityNotFound(_0x119597,null))[_0xe82c('0x35')](function(_0x2ecffa){if(_0x2ecffa){_0xaf843b[_0xe82c('0x9a')]=_[_0xe82c('0x6b')](_0x2ecffa,[_0xe82c('0x98')]);if(_0x2ecffa[_0xe82c('0x98')][_0xe82c('0x47')]){return _0x2ecffa['Contacts'][0x0];}var _0x353f00=_[_0xe82c('0x1a')](_0xaf843b[_0xe82c('0x5d')],{'firstName':_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x90')],'ListId':_0x2ecffa['id']});_0x353f00[_0xaf843b['body'][_0xe82c('0x95')]]=_0xaf843b[_0xe82c('0x5d')]['from'];return db[_0xe82c('0x97')][_0xe82c('0x57')](_0x353f00,{'fields':_0x409d1b,'raw':!![]});}})['then'](handleEntityNotFound(_0x119597,null))[_0xe82c('0x35')](function(_0x2864db){if(_0x2864db){_0xaf843b[_0xe82c('0x9b')]=_0x2864db;var _0x179729={'ContactId':_0x2864db['id'],'phone':_0xaf843b['body'][_0xe82c('0x90')],'WhatsappAccountId':_0x17bafe[_0xe82c('0x52')]['id']};var _0xf3dd46={'ContactId':_0x2864db['id'],'WhatsappAccountId':_0x17bafe[_0xe82c('0x52')]['id'],'closed':![]};return db[_0xe82c('0x9c')][_0xe82c('0x56')]({'where':_0xf3dd46})[_0xe82c('0x35')](function(_0x4c2a8a){if(_0x4c2a8a){return[_0x4c2a8a,![]];}return db[_0xe82c('0x9c')][_0xe82c('0x57')](_0x179729)[_0xe82c('0x35')](function(_0x136a59){return[_0x136a59,!![]];});});}})[_0xe82c('0x6c')](function(_0xfda77c,_0x2d417c){_0xaf843b[_0xe82c('0x9d')]=_0xfda77c[_0xe82c('0x37')]({'plain':!![]});_0xaf843b[_0xe82c('0x9d')][_0xe82c('0x9e')]=![];if(_0x2d417c){if(_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x9f')]){_0xaf843b['applications'][_0xe82c('0xa0')]({'id':0x0,'priority':_0xaf843b[_0xe82c('0x7c')]['length']+0x1,'app':_0xe82c('0xa1'),'appdata':_0xe82c('0xa2'),'interval':_0xe82c('0xa3')});}_0xaf843b[_0xe82c('0x9d')]['created']=!![];}return db[_0xe82c('0xa4')][_0xe82c('0x57')]({'phone':_0xaf843b['body'][_0xe82c('0x90')],'messageId':_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x8d')],'body':_0xaf843b[_0xe82c('0x5d')][_0xe82c('0x5d')],'WhatsappAccountId':_0x17bafe[_0xe82c('0x52')]['id'],'WhatsappInteractionId':_0xfda77c['id'],'direction':'in','ContactId':_0xfda77c['ContactId'],'AttachmentId':_0xaf843b['body'][_0xe82c('0xa5')]});})[_0xe82c('0x35')](function(_0xc709a){_0xaf843b[_0xe82c('0x26')]=_0xc709a;if(_0xaf843b['interaction'][_0xe82c('0xa6')]){return db[_0xe82c('0x74')][_0xe82c('0x56')]({'attributes':['id','name'],'where':{'id':_0xaf843b[_0xe82c('0x9d')][_0xe82c('0xa6')]}})[_0xe82c('0x35')](function(_0x5966f0){if(_0x5966f0){_0xaf843b[_0xe82c('0x7c')][_0xe82c('0xa7')]({'id':0x0,'priority':0x0,'app':_0xe82c('0xa8'),'appdata':_0x5966f0[_0xe82c('0x40')]+','+(_0xaf843b['account'][_0xe82c('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe82c('0xaa'),_0xe82c('0xab'),_0xaf843b);});}return respondWithRpcPromise('Start','startRouting',_0xaf843b);})['then'](function(_0x298654){if(_0x298654){var _0x47c3f3=0xc8;var _0x3ca14a=_0xe82c('0xac');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3ca14a,_0x47c3f3,_0xe82c('0xad'));logger[_0xe82c('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3ca14a,_0x47c3f3,_0xe82c('0xad'),JSON['stringify'](_0x298654));if(_0xaf843b[_0xe82c('0x7f')][_0xe82c('0x88')]===_0xe82c('0x89')){return _0x119597['status'](_0x47c3f3)[_0xe82c('0x30')](_0xe82c('0xae'),_0xe82c('0xaf'))[_0xe82c('0x39')]('\x0a');}else{return _0x119597[_0xe82c('0x29')](_0x47c3f3)[_0xe82c('0x2b')](_0x298654);}}})[_0xe82c('0x27')](handleError(_0x119597,null));};exports[_0xe82c('0x39')]=function(_0x1e519a,_0x5ed22d,_0x11b685){var _0x8d6092,_0x15b913,_0xae6086;if(_['isNil'](_0x1e519a[_0xe82c('0x5d')]['body'])||_0x1e519a[_0xe82c('0x5d')][_0xe82c('0x5d')]===''){throw new db['Sequelize'][(_0xe82c('0x80'))](_0xe82c('0x93'));}if(_[_0xe82c('0x8f')](_0x1e519a[_0xe82c('0x5d')]['to'])){throw new db[(_0xe82c('0x91'))][(_0xe82c('0x80'))](_0xe82c('0xb0'));}_0x8d6092=_0x1e519a[_0xe82c('0x5d')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x1e519a[_0xe82c('0x52')]['id']},'include':[{'model':db[_0xe82c('0xb1')],'as':_0xe82c('0xb2'),'include':[{'model':db[_0xe82c('0x97')],'as':_0xe82c('0x98'),'where':{'mobile':_0x8d6092},'limit':0x1,'order':[[_0xe82c('0x84'),'DESC']]}]}]})[_0xe82c('0x35')](handleEntityNotFound(_0x5ed22d,null))[_0xe82c('0x35')](function(_0x58302b){if(_0x58302b&&_0x58302b[_0xe82c('0xb2')]){_0x15b913=_0x58302b['get']({'plain':!![]});if(_0x15b913[_0xe82c('0xb2')]&&_0x15b913[_0xe82c('0xb2')][_0xe82c('0x98')][_0xe82c('0x47')]){return _0x15b913[_0xe82c('0xb2')][_0xe82c('0x98')][0x0];}return db[_0xe82c('0x97')][_0xe82c('0x57')](_[_0xe82c('0x1a')](_0x1e519a[_0xe82c('0x5d')],{'firstName':_0x8d6092,'mobile':_0x8d6092,'phone':_0x8d6092,'ListId':_0x15b913[_0xe82c('0x86')]}));}})[_0xe82c('0x35')](handleEntityNotFound(_0x5ed22d,null))['then'](function(_0x4b154f){if(_0x4b154f){_0xae6086=_0x4b154f;return db[_0xe82c('0x9c')][_0xe82c('0x56')]({'where':{'ContactId':_0xae6086['id'],'closed':![],'WhatsappAccountId':_0x15b913['id']}})[_0xe82c('0x35')](function(_0x283fcf){if(_0x283fcf){return[_0x283fcf,![]];}return db[_0xe82c('0x9c')][_0xe82c('0x57')]({'UserId':_0x1e519a[_0xe82c('0x58')]['id'],'ContactId':_0xae6086['id'],'WhatsappAccountId':_0x15b913['id'],'phone':_0x8d6092,'firstMsgDirection':_0xe82c('0xb3'),'Messages':[_[_0xe82c('0x4e')](_0x1e519a[_0xe82c('0x5d')],{'read':![],'body':_0x1e519a[_0xe82c('0x5d')][_0xe82c('0x5d')],'phone':_0x8d6092,'WhatsappAccountId':_0x15b913['id'],'UserId':_0x1e519a['user']['id'],'ContactId':_0xae6086['id']})]},{'include':[{'model':db[_0xe82c('0xa4')],'as':_0xe82c('0xb4')}]})[_0xe82c('0x35')](function(_0x3adf87){return[_0x3adf87,!![]];});});}})[_0xe82c('0x6c')](function(_0x4cbb7a,_0x24521b){if(_0x24521b){return _0x4cbb7a;}return db[_0xe82c('0xa4')]['create'](_[_0xe82c('0x4e')](_0x1e519a[_0xe82c('0x5d')],{'read':![],'body':_0x1e519a[_0xe82c('0x5d')][_0xe82c('0x5d')],'phone':_0x8d6092,'WhatsappAccountId':_0x15b913['id'],'WhatsappInteractionId':_0x4cbb7a['id'],'UserId':_0x1e519a[_0xe82c('0x58')]['id'],'ContactId':_0xae6086['id']}))['then'](function(_0x38c15c){_0x4cbb7a[_0xe82c('0xb5')][_0xe82c('0xb4')]=[];_0x4cbb7a[_0xe82c('0xb5')][_0xe82c('0xb4')][_0xe82c('0xa0')](_0x38c15c['dataValues']);return _0x4cbb7a;});})[_0xe82c('0x35')](respondWithResult(_0x5ed22d,null))[_0xe82c('0x27')](handleError(_0x5ed22d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index cccee3e..de645e8 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbf3=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0xcbf3,0x9e));var _0x3cbf=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xcbf3[_0x2f45ea];return _0x485a84;};'use strict';var EventEmitter=require(_0x3cbf('0x0'));var WhatsappAccount=require(_0x3cbf('0x1'))['db'][_0x3cbf('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x3cbf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3cbf('0x4'),'afterDestroy':_0x3cbf('0x5')};function emitEvent(_0x43d3df){return function(_0xf1ccfe,_0x1f4399,_0x4d0a76){WhatsappAccountEvents[_0x3cbf('0x6')](_0x43d3df+':'+_0xf1ccfe['id'],_0xf1ccfe);WhatsappAccountEvents[_0x3cbf('0x6')](_0x43d3df,_0xf1ccfe);_0x4d0a76(null);};}for(var e in events){if(events[_0x3cbf('0x7')](e)){var event=events[e];WhatsappAccount[_0x3cbf('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x637c=['hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','remove','emit'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x637c,0x7a));var _0xc637=function(_0x2cb8ba,_0x4f0a01){_0x2cb8ba=_0x2cb8ba-0x0;var _0x5ac396=_0x637c[_0x2cb8ba];return _0x5ac396;};'use strict';var EventEmitter=require(_0xc637('0x0'));var WhatsappAccount=require(_0xc637('0x1'))['db'][_0xc637('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc637('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc637('0x4')};function emitEvent(_0x485e05){return function(_0x341a7a,_0x2764be,_0x4f374d){WhatsappAccountEvents['emit'](_0x485e05+':'+_0x341a7a['id'],_0x341a7a);WhatsappAccountEvents[_0xc637('0x5')](_0x485e05,_0x341a7a);_0x4f374d(null);};}for(var e in events){if(events[_0xc637('0x6')](e)){var event=events[e];WhatsappAccount[_0xc637('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index dce0770..d2d31de 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7b4=['api','bluebird','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7b4,0x13e));var _0x4e7b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xe7b4[_0x42bdad];return _0x122626;};'use strict';var _=require(_0x4e7b('0x0'));var util=require(_0x4e7b('0x1'));var logger=require('../../config/logger')(_0x4e7b('0x2'));var moment=require('moment');var BPromise=require(_0x4e7b('0x3'));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(_0x4e7b('0x4'));module[_0x4e7b('0x5')]=function(_0x4afdb5,_0x236b87){return _0x4afdb5['define'](_0x4e7b('0x6'),attributes,{'tableName':_0x4e7b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5302=['define','whatsapp_accounts','lodash','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x1fbe59,_0x45dd45){var _0x315b32=function(_0x403fe){while(--_0x403fe){_0x1fbe59['push'](_0x1fbe59['shift']());}};_0x315b32(++_0x45dd45);}(_0x5302,0x119));var _0x2530=function(_0x397d31,_0x48c9e9){_0x397d31=_0x397d31-0x0;var _0x256bfc=_0x5302[_0x397d31];return _0x256bfc;};'use strict';var _=require(_0x2530('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2530('0x1'));var moment=require('moment');var BPromise=require(_0x2530('0x2'));var rp=require(_0x2530('0x3'));var fs=require('fs');var path=require(_0x2530('0x4'));var rimraf=require(_0x2530('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x2530('0x6')]=function(_0x1249cc,_0x5a1bdd){return _0x1249cc[_0x2530('0x7')]('WhatsappAccount',attributes,{'tableName':_0x2530('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 66dec07..ed6ea05 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c7=['raw','where','attributes','map','include','model','then','debug','ShowWhatsappAccount','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','WhatsappAccount','find','options'];(function(_0x365949,_0x33d3b1){var _0x2a00d9=function(_0x49753d){while(--_0x49753d){_0x365949['push'](_0x365949['shift']());}};_0x2a00d9(++_0x33d3b1);}(_0x47c7,0x1f3));var _0x747c=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x47c7[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x747c('0x0'));var moment=require(_0x747c('0x1'));var BPromise=require(_0x747c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x747c('0x3'))['db'];var utils=require(_0x747c('0x4'));var logger=require(_0x747c('0x5'))(_0x747c('0x6'));var config=require('../../config/environment');var jayson=require(_0x747c('0x7'));var client=jayson['client'][_0x747c('0x8')]({'port':0x232a});config[_0x747c('0x9')]=_[_0x747c('0xa')](config[_0x747c('0x9')],{'host':_0x747c('0xb'),'port':0x18eb});var socket=require(_0x747c('0xc'))(new Redis(config[_0x747c('0x9')]));require(_0x747c('0xd'))[_0x747c('0xe')](socket);function respondWithRpcPromise(_0x14ffb6,_0x28039c,_0x97bb40){return new BPromise(function(_0x2b8f46,_0x20e289){return client['request'](_0x14ffb6,_0x97bb40)['then'](function(_0xd87e08){logger[_0x747c('0xf')](_0x747c('0x10'),_0x28039c,_0x747c('0x11'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x28039c,_0x747c('0x11'),JSON[_0x747c('0x12')](_0xd87e08));if(_0xd87e08[_0x747c('0x13')]){if(_0xd87e08[_0x747c('0x13')][_0x747c('0x14')]===0x1f4){logger[_0x747c('0x13')](_0x747c('0x10'),_0x28039c,_0xd87e08[_0x747c('0x13')]['message']);return _0x20e289(_0xd87e08[_0x747c('0x13')][_0x747c('0x15')]);}logger[_0x747c('0x13')](_0x747c('0x10'),_0x28039c,_0xd87e08['error'][_0x747c('0x15')]);return _0x2b8f46(_0xd87e08[_0x747c('0x13')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x28039c,_0x747c('0x11'));_0x2b8f46(_0xd87e08['result'][_0x747c('0x15')]);}})[_0x747c('0x16')](function(_0x23b705){logger[_0x747c('0x13')](_0x747c('0x10'),_0x28039c,_0x23b705);_0x20e289(_0x23b705);});});}exports['ShowWhatsappAccount']=function(_0x46a24d){var _0x49bcfe=this;return new Promise(function(_0x250488,_0x516fbb){return db[_0x747c('0x17')][_0x747c('0x18')]({'raw':_0x46a24d[_0x747c('0x19')]?_0x46a24d['options'][_0x747c('0x1a')]===undefined?!![]:![]:!![],'where':_0x46a24d[_0x747c('0x19')]?_0x46a24d['options'][_0x747c('0x1b')]||null:null,'attributes':_0x46a24d[_0x747c('0x19')]?_0x46a24d[_0x747c('0x19')][_0x747c('0x1c')]||null:null,'include':_0x46a24d[_0x747c('0x19')]?_0x46a24d['options']['include']?_[_0x747c('0x1d')](_0x46a24d['options'][_0x747c('0x1e')],function(_0x5e74c1){return{'model':db[_0x5e74c1['model']],'as':_0x5e74c1['as'],'attributes':_0x5e74c1[_0x747c('0x1c')],'include':_0x5e74c1['include']?_['map'](_0x5e74c1[_0x747c('0x1e')],function(_0x55dc07){return{'model':db[_0x55dc07['model']],'as':_0x55dc07['as'],'attributes':_0x55dc07[_0x747c('0x1c')],'include':_0x55dc07[_0x747c('0x1e')]?_[_0x747c('0x1d')](_0x55dc07[_0x747c('0x1e')],function(_0x3085d0){return{'model':db[_0x3085d0[_0x747c('0x1f')]],'as':_0x3085d0['as'],'attributes':_0x3085d0[_0x747c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x747c('0x20')](function(_0x462976){logger['info']('ShowWhatsappAccount',_0x46a24d);logger[_0x747c('0x21')](_0x747c('0x22'),_0x46a24d,JSON['stringify'](_0x462976));_0x250488(_0x462976);})[_0x747c('0x16')](function(_0x4e4b2d){logger[_0x747c('0x13')](_0x747c('0x22'),_0x4e4b2d['message'],_0x46a24d);_0x516fbb(_0x49bcfe[_0x747c('0x13')](0x1f4,_0x4e4b2d[_0x747c('0x15')]));});});}; \ No newline at end of file +var _0x0a68=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','options','raw','where','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47ff46,_0xfea8d9){var _0x544757=function(_0x590ab4){while(--_0x590ab4){_0x47ff46['push'](_0x47ff46['shift']());}};_0x544757(++_0xfea8d9);}(_0x0a68,0xd2));var _0x80a6=function(_0xc21e8,_0x4f211b){_0xc21e8=_0xc21e8-0x0;var _0x4c8769=_0x0a68[_0xc21e8];return _0x4c8769;};'use strict';var _=require(_0x80a6('0x0'));var util=require(_0x80a6('0x1'));var moment=require('moment');var BPromise=require(_0x80a6('0x2'));var rs=require(_0x80a6('0x3'));var fs=require('fs');var Redis=require(_0x80a6('0x4'));var db=require(_0x80a6('0x5'))['db'];var utils=require(_0x80a6('0x6'));var logger=require(_0x80a6('0x7'))(_0x80a6('0x8'));var config=require(_0x80a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x80a6('0xa')][_0x80a6('0xb')]({'port':0x232a});config[_0x80a6('0xc')]=_['defaults'](config['redis'],{'host':_0x80a6('0xd'),'port':0x18eb});var socket=require(_0x80a6('0xe'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x80a6('0xf')](socket);function respondWithRpcPromise(_0x588a77,_0x366ef8,_0x13d7a4){return new BPromise(function(_0x893efe,_0x570de2){return client[_0x80a6('0x10')](_0x588a77,_0x13d7a4)[_0x80a6('0x11')](function(_0x2cd3e8){logger[_0x80a6('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x366ef8,'request\x20sent');logger['debug'](_0x80a6('0x13'),_0x366ef8,_0x80a6('0x14'),JSON[_0x80a6('0x15')](_0x2cd3e8));if(_0x2cd3e8['error']){if(_0x2cd3e8[_0x80a6('0x16')]['code']===0x1f4){logger[_0x80a6('0x16')](_0x80a6('0x17'),_0x366ef8,_0x2cd3e8[_0x80a6('0x16')][_0x80a6('0x18')]);return _0x570de2(_0x2cd3e8['error'][_0x80a6('0x18')]);}logger[_0x80a6('0x16')](_0x80a6('0x17'),_0x366ef8,_0x2cd3e8[_0x80a6('0x16')][_0x80a6('0x18')]);return _0x893efe(_0x2cd3e8[_0x80a6('0x16')]['message']);}else{logger[_0x80a6('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x366ef8,'request\x20sent');_0x893efe(_0x2cd3e8[_0x80a6('0x19')][_0x80a6('0x18')]);}})[_0x80a6('0x1a')](function(_0xbcf696){logger['error'](_0x80a6('0x17'),_0x366ef8,_0xbcf696);_0x570de2(_0xbcf696);});});}exports[_0x80a6('0x1b')]=function(_0x4c25e2){var _0x167fe1=this;return new Promise(function(_0x111e27,_0x226362){return db['WhatsappAccount']['find']({'raw':_0x4c25e2['options']?_0x4c25e2[_0x80a6('0x1c')][_0x80a6('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c25e2['options']?_0x4c25e2[_0x80a6('0x1c')][_0x80a6('0x1e')]||null:null,'attributes':_0x4c25e2['options']?_0x4c25e2[_0x80a6('0x1c')][_0x80a6('0x1f')]||null:null,'include':_0x4c25e2[_0x80a6('0x1c')]?_0x4c25e2[_0x80a6('0x1c')][_0x80a6('0x20')]?_[_0x80a6('0x21')](_0x4c25e2[_0x80a6('0x1c')][_0x80a6('0x20')],function(_0x399189){return{'model':db[_0x399189[_0x80a6('0x22')]],'as':_0x399189['as'],'attributes':_0x399189[_0x80a6('0x1f')],'include':_0x399189[_0x80a6('0x20')]?_[_0x80a6('0x21')](_0x399189[_0x80a6('0x20')],function(_0x4c27fa){return{'model':db[_0x4c27fa[_0x80a6('0x22')]],'as':_0x4c27fa['as'],'attributes':_0x4c27fa[_0x80a6('0x1f')],'include':_0x4c27fa['include']?_[_0x80a6('0x21')](_0x4c27fa['include'],function(_0x249fc0){return{'model':db[_0x249fc0[_0x80a6('0x22')]],'as':_0x249fc0['as'],'attributes':_0x249fc0[_0x80a6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x80a6('0x11')](function(_0x1fbe96){logger[_0x80a6('0x12')](_0x80a6('0x1b'),_0x4c25e2);logger[_0x80a6('0x23')](_0x80a6('0x1b'),_0x4c25e2,JSON['stringify'](_0x1fbe96));_0x111e27(_0x1fbe96);})['catch'](function(_0x24ae64){logger[_0x80a6('0x16')](_0x80a6('0x1b'),_0x24ae64[_0x80a6('0x18')],_0x4c25e2);_0x226362(_0x167fe1['error'](0x1f4,_0x24ae64[_0x80a6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 914b778..9e5bd2b 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cfd=['emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x2cfd,0xdd));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappAccountEvents=require(_0xd2cf('0x0'));var events=[_0xd2cf('0x1'),_0xd2cf('0x2'),_0xd2cf('0x3')];function createListener(_0x502235,_0x330eca){return function(_0x38acf6){_0x330eca[_0xd2cf('0x4')](_0x502235,_0x38acf6);};}function removeListener(_0x4a34e3,_0x2cce78){return function(){WhatsappAccountEvents[_0xd2cf('0x5')](_0x4a34e3,_0x2cce78);};}exports[_0xd2cf('0x6')]=function(_0x284cd5){for(var _0x4476a9=0x0,_0x4ff60f=events[_0xd2cf('0x7')];_0x4476a9<_0x4ff60f;_0x4476a9++){var _0x58f06b=events[_0x4476a9];var _0x1a9354=createListener(_0xd2cf('0x8')+_0x58f06b,_0x284cd5);WhatsappAccountEvents['on'](_0x58f06b,_0x1a9354);}}; \ No newline at end of file +var _0xd9cc=['./whatsappAccount.events','save','remove','update','removeListener','register','length'];(function(_0xba70b2,_0x484081){var _0x3364da=function(_0x481452){while(--_0x481452){_0xba70b2['push'](_0xba70b2['shift']());}};_0x3364da(++_0x484081);}(_0xd9cc,0xd9));var _0xcd9c=function(_0x188f25,_0x16028d){_0x188f25=_0x188f25-0x0;var _0x2b1d20=_0xd9cc[_0x188f25];return _0x2b1d20;};'use strict';var WhatsappAccountEvents=require(_0xcd9c('0x0'));var events=[_0xcd9c('0x1'),_0xcd9c('0x2'),_0xcd9c('0x3')];function createListener(_0x2327b6,_0x357168){return function(_0x31e917){_0x357168['emit'](_0x2327b6,_0x31e917);};}function removeListener(_0x3af098,_0x24c2c9){return function(){WhatsappAccountEvents[_0xcd9c('0x4')](_0x3af098,_0x24c2c9);};}exports[_0xcd9c('0x5')]=function(_0x1a4c35){for(var _0x4040b6=0x0,_0x2617f5=events[_0xcd9c('0x6')];_0x4040b6<_0x2617f5;_0x4040b6++){var _0x4674d6=events[_0x4040b6];var _0x3b0453=createListener('whatsappAccount:'+_0x4674d6,_0x1a4c35);WhatsappAccountEvents['on'](_0x4674d6,_0x3b0453);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 658f6f2..bdac8bd 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacd7=['get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller'];(function(_0x536839,_0x5b6604){var _0x1a1899=function(_0x56fea6){while(--_0x56fea6){_0x536839['push'](_0x536839['shift']());}};_0x1a1899(++_0x5b6604);}(_0xacd7,0x15e));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7acd('0x0'));var util=require(_0x7acd('0x1'));var path=require(_0x7acd('0x2'));var timeout=require(_0x7acd('0x3'));var express=require(_0x7acd('0x4'));var router=express[_0x7acd('0x5')]();var fs_extra=require(_0x7acd('0x6'));var auth=require(_0x7acd('0x7'));var interaction=require(_0x7acd('0x8'));var config=require('../../config/environment');var controller=require(_0x7acd('0x9'));router[_0x7acd('0xa')]('/',auth[_0x7acd('0xb')](),controller[_0x7acd('0xc')]);router[_0x7acd('0xa')](_0x7acd('0xd'),auth[_0x7acd('0xb')](),controller['show']);router[_0x7acd('0xe')]('/',auth[_0x7acd('0xb')](),controller[_0x7acd('0xf')]);router[_0x7acd('0x10')]('/:id',auth[_0x7acd('0xb')](),controller['update']);router[_0x7acd('0x11')](_0x7acd('0xd'),auth[_0x7acd('0xb')](),controller[_0x7acd('0x12')]);module[_0x7acd('0x13')]=router; \ No newline at end of file +var _0x0a84=['./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d390b,_0x19aeaf){var _0x446dee=function(_0x45731){while(--_0x45731){_0x1d390b['push'](_0x1d390b['shift']());}};_0x446dee(++_0x19aeaf);}(_0x0a84,0x192));var _0x40a8=function(_0x33a92b,_0x5667d2){_0x33a92b=_0x33a92b-0x0;var _0x313796=_0x0a84[_0x33a92b];return _0x313796;};'use strict';var multer=require(_0x40a8('0x0'));var util=require('util');var path=require(_0x40a8('0x1'));var timeout=require('connect-timeout');var express=require(_0x40a8('0x2'));var router=express[_0x40a8('0x3')]();var fs_extra=require(_0x40a8('0x4'));var auth=require(_0x40a8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x40a8('0x6'));router['get']('/',auth[_0x40a8('0x7')](),controller[_0x40a8('0x8')]);router[_0x40a8('0x9')](_0x40a8('0xa'),auth['isAuthenticated'](),controller[_0x40a8('0xb')]);router[_0x40a8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x40a8('0xd')](_0x40a8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x40a8('0xe')]('/:id',auth[_0x40a8('0x7')](),controller[_0x40a8('0xf')]);module[_0x40a8('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index aca8a4c..9206df5 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f41=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0x8f41,0xb8));var _0x18f4=function(_0x1730d2,_0x4a8a91){_0x1730d2=_0x1730d2-0x0;var _0x2a63d9=_0x8f41[_0x1730d2];return _0x2a63d9;};'use strict';var Sequelize=require(_0x18f4('0x0'));module[_0x18f4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x18f4('0x2')],'allowNull':![],'defaultValue':_0x18f4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x18f4('0x2')],'defaultValue':_0x18f4('0x4')}}; \ No newline at end of file +var _0xb503=['STRING','TEXT','sequelize','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb503,0x162));var _0x3b50=function(_0x1c99c7,_0x580a5d){_0x1c99c7=_0x1c99c7-0x0;var _0xb2e949=_0xb503[_0x1c99c7];return _0xb2e949;};'use strict';var Sequelize=require(_0x3b50('0x0'));module[_0x3b50('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3b50('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3b50('0x3')]()},'description':{'type':Sequelize[_0x3b50('0x2')]},'interval':{'type':Sequelize[_0x3b50('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index ce00c7c..6d87faa 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6f=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','WhatsappApplication','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x52d6f5,_0x71f680){var _0x2089d9=function(_0x13a185){while(--_0x13a185){_0x52d6f5['push'](_0x52d6f5['shift']());}};_0x2089d9(++_0x71f680);}(_0xba6f,0x1d0));var _0xfba6=function(_0x79ef34,_0x42d1a1){_0x79ef34=_0x79ef34-0x0;var _0x43d708=_0xba6f[_0x79ef34];return _0x43d708;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba6('0x1'));var jsonpatch=require(_0xfba6('0x2'));var rp=require(_0xfba6('0x3'));var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require(_0xfba6('0x7'));var path=require(_0xfba6('0x8'));var sox=require(_0xfba6('0x9'));var csv=require(_0xfba6('0xa'));var ejs=require(_0xfba6('0xb'));var fs=require('fs');var fs_extra=require(_0xfba6('0xc'));var _=require(_0xfba6('0xd'));var squel=require('squel');var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfba6('0x10'));var Redis=require(_0xfba6('0x11'));var authService=require(_0xfba6('0x12'));var qs=require(_0xfba6('0x13'));var as=require(_0xfba6('0x14'));var hardwareService=require(_0xfba6('0x15'));var logger=require(_0xfba6('0x16'))(_0xfba6('0x17'));var utils=require(_0xfba6('0x18'));var config=require(_0xfba6('0x19'));var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcfafdb,_0xd34d87){_0xd34d87=_0xd34d87||0xcc;return function(_0x315faf){if(_0x315faf){return _0xcfafdb[_0xfba6('0x1b')](_0xd34d87);}return _0xcfafdb['status'](_0xd34d87)[_0xfba6('0x1c')]();};}function respondWithResult(_0x5dc9e1,_0x4f465f){_0x4f465f=_0x4f465f||0xc8;return function(_0x184169){if(_0x184169){return _0x5dc9e1[_0xfba6('0x1d')](_0x4f465f)[_0xfba6('0x1e')](_0x184169);}};}function respondWithFilteredResult(_0x1d76de,_0x38055e){return function(_0x2c4692){if(_0x2c4692){var _0x24b6a0=typeof _0x38055e[_0xfba6('0x1f')]===_0xfba6('0x20')&&typeof _0x38055e[_0xfba6('0x21')]===_0xfba6('0x20');var _0xf3dbbc=_0x2c4692[_0xfba6('0x22')];var _0x5a29a4=_0x24b6a0?0x0:_0x38055e[_0xfba6('0x1f')];var _0x267c09=_0x24b6a0?_0x2c4692['count']:_0x38055e['offset']+_0x38055e[_0xfba6('0x21')];var _0x204784;if(_0x267c09>=_0xf3dbbc){_0x267c09=_0xf3dbbc;_0x204784=0xc8;}else{_0x204784=0xce;}_0x1d76de['status'](_0x204784);return _0x1d76de[_0xfba6('0x23')](_0xfba6('0x24'),_0x5a29a4+'-'+_0x267c09+'/'+_0xf3dbbc)[_0xfba6('0x1e')](_0x2c4692);}return null;};}function patchUpdates(_0x4f1d15){return function(_0x167528){try{jsonpatch[_0xfba6('0x25')](_0x167528,_0x4f1d15,!![]);}catch(_0xa16868){return BPromise['reject'](_0xa16868);}return _0x167528[_0xfba6('0x26')]();};}function saveUpdates(_0x12f000,_0x25e0ff){return function(_0x2afd26){if(_0x2afd26){return _0x2afd26[_0xfba6('0x27')](_0x12f000)[_0xfba6('0x28')](function(_0x203a4e){return _0x203a4e;});}return null;};}function removeEntity(_0x56b427,_0x5e09ff){return function(_0x41b356){if(_0x41b356){return _0x41b356[_0xfba6('0x29')]()[_0xfba6('0x28')](function(){_0x56b427[_0xfba6('0x1d')](0xcc)[_0xfba6('0x1c')]();});}};}function handleEntityNotFound(_0x53c99a,_0x408ccc){return function(_0x4114bc){if(!_0x4114bc){_0x53c99a[_0xfba6('0x1b')](0x194);}return _0x4114bc;};}function handleError(_0x11bde3,_0x3af399){_0x3af399=_0x3af399||0x1f4;return function(_0x7c7f6a){logger['error'](_0x7c7f6a[_0xfba6('0x2a')]);if(_0x7c7f6a[_0xfba6('0x2b')]){delete _0x7c7f6a['name'];}_0x11bde3[_0xfba6('0x1d')](_0x3af399)[_0xfba6('0x2c')](_0x7c7f6a);};}exports['index']=function(_0x2d703e,_0x3da118){var _0x5f31af={},_0x47973f={},_0x56e8e6={'count':0x0,'rows':[]};var _0xf8134a=_[_0xfba6('0x2d')](db[_0xfba6('0x2e')]['rawAttributes'],function(_0x17440e){return{'name':_0x17440e[_0xfba6('0x2f')],'type':_0x17440e[_0xfba6('0x30')][_0xfba6('0x31')]};});_0x47973f['model']=_[_0xfba6('0x2d')](_0xf8134a,'name');_0x47973f[_0xfba6('0x32')]=_[_0xfba6('0x33')](_0x2d703e[_0xfba6('0x32')]);_0x47973f[_0xfba6('0x34')]=_[_0xfba6('0x35')](_0x47973f['model'],_0x47973f[_0xfba6('0x32')]);_0x5f31af[_0xfba6('0x36')]=_['intersection'](_0x47973f[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x38')]));_0x5f31af[_0xfba6('0x36')]=_0x5f31af[_0xfba6('0x36')][_0xfba6('0x39')]?_0x5f31af[_0xfba6('0x36')]:_0x47973f[_0xfba6('0x37')];if(!_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3a')](_0xfba6('0x3b'))){_0x5f31af['limit']=qs[_0xfba6('0x21')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x21')]);_0x5f31af[_0xfba6('0x1f')]=qs[_0xfba6('0x1f')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x1f')]);}_0x5f31af[_0xfba6('0x3c')]=qs[_0xfba6('0x3d')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3d')]);_0x5f31af['where']=qs[_0xfba6('0x34')](_['pick'](_0x2d703e[_0xfba6('0x32')],_0x47973f[_0xfba6('0x34')]),_0xf8134a);if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3e')]){_0x5f31af[_0xfba6('0x3f')]=_[_0xfba6('0x40')](_0x5f31af[_0xfba6('0x3f')],{'$or':_[_0xfba6('0x2d')](_0xf8134a,function(_0x5bad10){if(_0x5bad10[_0xfba6('0x30')]!==_0xfba6('0x41')){var _0x4807f5={};_0x4807f5[_0x5bad10[_0xfba6('0x2b')]]={'$like':'%'+_0x2d703e['query'][_0xfba6('0x3e')]+'%'};return _0x4807f5;}})});}_0x5f31af=_[_0xfba6('0x40')]({},_0x5f31af,_0x2d703e['options']);var _0x203c67={'where':_0x5f31af[_0xfba6('0x3f')]};return db[_0xfba6('0x2e')]['count'](_0x203c67)[_0xfba6('0x28')](function(_0x18d17c){_0x56e8e6[_0xfba6('0x22')]=_0x18d17c;if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x42')]){_0x5f31af[_0xfba6('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xfba6('0x44')](_0x5f31af);})[_0xfba6('0x28')](function(_0x27a493){_0x56e8e6[_0xfba6('0x45')]=_0x27a493;return _0x56e8e6;})[_0xfba6('0x28')](respondWithFilteredResult(_0x3da118,_0x5f31af))[_0xfba6('0x46')](handleError(_0x3da118,null));};exports[_0xfba6('0x47')]=function(_0x28a9d6,_0x51ee39){var _0x47ca82={'raw':!![],'where':{'id':_0x28a9d6['params']['id']}},_0x18b81d={};_0x18b81d[_0xfba6('0x37')]=_[_0xfba6('0x33')](db[_0xfba6('0x2e')][_0xfba6('0x48')]);_0x18b81d['query']=_[_0xfba6('0x33')](_0x28a9d6['query']);_0x18b81d[_0xfba6('0x34')]=_['intersection'](_0x18b81d[_0xfba6('0x37')],_0x18b81d[_0xfba6('0x32')]);_0x47ca82[_0xfba6('0x36')]=_[_0xfba6('0x35')](_0x18b81d[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x38')]));_0x47ca82[_0xfba6('0x36')]=_0x47ca82['attributes'][_0xfba6('0x39')]?_0x47ca82[_0xfba6('0x36')]:_0x18b81d[_0xfba6('0x37')];if(_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x42')]){_0x47ca82[_0xfba6('0x43')]=[{'all':!![]}];}_0x47ca82=_[_0xfba6('0x40')]({},_0x47ca82,_0x28a9d6[_0xfba6('0x49')]);return db[_0xfba6('0x2e')][_0xfba6('0x4a')](_0x47ca82)[_0xfba6('0x28')](handleEntityNotFound(_0x51ee39,null))[_0xfba6('0x28')](respondWithResult(_0x51ee39,null))[_0xfba6('0x46')](handleError(_0x51ee39,null));};exports[_0xfba6('0x4b')]=function(_0x2c3e90,_0x56900e){return db[_0xfba6('0x2e')][_0xfba6('0x4b')](_0x2c3e90[_0xfba6('0x4c')],{})[_0xfba6('0x28')](respondWithResult(_0x56900e,0xc9))[_0xfba6('0x46')](handleError(_0x56900e,null));};exports[_0xfba6('0x27')]=function(_0x26c050,_0xb637ca){if(_0x26c050['body']['id']){delete _0x26c050['body']['id'];}return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x26c050[_0xfba6('0x4d')]['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0xb637ca,null))[_0xfba6('0x28')](saveUpdates(_0x26c050['body'],null))['then'](respondWithResult(_0xb637ca,null))[_0xfba6('0x46')](handleError(_0xb637ca,null));};exports[_0xfba6('0x29')]=function(_0x4f78ff,_0x4c150){return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x4f78ff['params']['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0x4c150,null))['then'](removeEntity(_0x4c150,null))[_0xfba6('0x46')](handleError(_0x4c150,null));}; \ No newline at end of file +var _0xaaee=['fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','intersection','catch','create','body','find','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','WhatsappApplication','rawAttributes','type','key','keys','query','filters','attributes','model'];(function(_0x55054f,_0x4b8a06){var _0x204df1=function(_0x513bb7){while(--_0x513bb7){_0x55054f['push'](_0x55054f['shift']());}};_0x204df1(++_0x4b8a06);}(_0xaaee,0xa9));var _0xeaae=function(_0xff7b15,_0xfc1cb6){_0xff7b15=_0xff7b15-0x0;var _0x373123=_0xaaee[_0xff7b15];return _0x373123;};'use strict';var emlformat=require(_0xeaae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeaae('0x1'));var jsonpatch=require(_0xeaae('0x2'));var rp=require('request-promise');var moment=require(_0xeaae('0x3'));var BPromise=require(_0xeaae('0x4'));var Mustache=require(_0xeaae('0x5'));var util=require(_0xeaae('0x6'));var path=require('path');var sox=require(_0xeaae('0x7'));var csv=require(_0xeaae('0x8'));var ejs=require(_0xeaae('0x9'));var fs=require('fs');var fs_extra=require(_0xeaae('0xa'));var _=require(_0xeaae('0xb'));var squel=require(_0xeaae('0xc'));var crypto=require('crypto');var jsforce=require(_0xeaae('0xd'));var deskjs=require(_0xeaae('0xe'));var toCsv=require(_0xeaae('0x8'));var querystring=require(_0xeaae('0xf'));var Papa=require(_0xeaae('0x10'));var Redis=require(_0xeaae('0x11'));var authService=require(_0xeaae('0x12'));var qs=require(_0xeaae('0x13'));var as=require(_0xeaae('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaae('0x15'))(_0xeaae('0x16'));var utils=require(_0xeaae('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeaae('0x18'))['db'];function respondWithStatusCode(_0xf4e6b7,_0x16c851){_0x16c851=_0x16c851||0xcc;return function(_0x564b56){if(_0x564b56){return _0xf4e6b7[_0xeaae('0x19')](_0x16c851);}return _0xf4e6b7[_0xeaae('0x1a')](_0x16c851)[_0xeaae('0x1b')]();};}function respondWithResult(_0x3f46ff,_0x4f3501){_0x4f3501=_0x4f3501||0xc8;return function(_0x4d3766){if(_0x4d3766){return _0x3f46ff[_0xeaae('0x1a')](_0x4f3501)[_0xeaae('0x1c')](_0x4d3766);}};}function respondWithFilteredResult(_0x8dc1ac,_0x25b974){return function(_0x49741a){if(_0x49741a){var _0x1dd48f=typeof _0x25b974['offset']===_0xeaae('0x1d')&&typeof _0x25b974[_0xeaae('0x1e')]===_0xeaae('0x1d');var _0x355f39=_0x49741a['count'];var _0x538e3d=_0x1dd48f?0x0:_0x25b974['offset'];var _0x5b44f5=_0x1dd48f?_0x49741a[_0xeaae('0x1f')]:_0x25b974[_0xeaae('0x20')]+_0x25b974['limit'];var _0x4667ff;if(_0x5b44f5>=_0x355f39){_0x5b44f5=_0x355f39;_0x4667ff=0xc8;}else{_0x4667ff=0xce;}_0x8dc1ac['status'](_0x4667ff);return _0x8dc1ac[_0xeaae('0x21')](_0xeaae('0x22'),_0x538e3d+'-'+_0x5b44f5+'/'+_0x355f39)[_0xeaae('0x1c')](_0x49741a);}return null;};}function patchUpdates(_0x52de90){return function(_0x3be7cf){try{jsonpatch[_0xeaae('0x23')](_0x3be7cf,_0x52de90,!![]);}catch(_0x4c925a){return BPromise['reject'](_0x4c925a);}return _0x3be7cf[_0xeaae('0x24')]();};}function saveUpdates(_0x5ee523,_0x48f4a9){return function(_0x12f1b0){if(_0x12f1b0){return _0x12f1b0[_0xeaae('0x25')](_0x5ee523)[_0xeaae('0x26')](function(_0x25945c){return _0x25945c;});}return null;};}function removeEntity(_0xefe74b,_0x41739e){return function(_0x2a961c){if(_0x2a961c){return _0x2a961c[_0xeaae('0x27')]()[_0xeaae('0x26')](function(){_0xefe74b[_0xeaae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7fa13,_0x124b21){return function(_0x10a0f2){if(!_0x10a0f2){_0xa7fa13[_0xeaae('0x19')](0x194);}return _0x10a0f2;};}function handleError(_0x98ec5a,_0x45a6df){_0x45a6df=_0x45a6df||0x1f4;return function(_0x145b46){logger[_0xeaae('0x28')](_0x145b46['stack']);if(_0x145b46['name']){delete _0x145b46[_0xeaae('0x29')];}_0x98ec5a[_0xeaae('0x1a')](_0x45a6df)[_0xeaae('0x2a')](_0x145b46);};}exports['index']=function(_0x294938,_0x30e777){var _0xa334c8={},_0x14a68a={},_0x24d86a={'count':0x0,'rows':[]};var _0x1c7175=_[_0xeaae('0x2b')](db[_0xeaae('0x2c')][_0xeaae('0x2d')],function(_0x24f0f2){return{'name':_0x24f0f2['fieldName'],'type':_0x24f0f2[_0xeaae('0x2e')][_0xeaae('0x2f')]};});_0x14a68a['model']=_['map'](_0x1c7175,_0xeaae('0x29'));_0x14a68a['query']=_[_0xeaae('0x30')](_0x294938[_0xeaae('0x31')]);_0x14a68a[_0xeaae('0x32')]=_['intersection'](_0x14a68a['model'],_0x14a68a['query']);_0xa334c8[_0xeaae('0x33')]=_['intersection'](_0x14a68a[_0xeaae('0x34')],qs[_0xeaae('0x35')](_0x294938[_0xeaae('0x31')]['fields']));_0xa334c8[_0xeaae('0x33')]=_0xa334c8[_0xeaae('0x33')][_0xeaae('0x36')]?_0xa334c8[_0xeaae('0x33')]:_0x14a68a[_0xeaae('0x34')];if(!_0x294938['query'][_0xeaae('0x37')](_0xeaae('0x38'))){_0xa334c8[_0xeaae('0x1e')]=qs[_0xeaae('0x1e')](_0x294938[_0xeaae('0x31')][_0xeaae('0x1e')]);_0xa334c8[_0xeaae('0x20')]=qs[_0xeaae('0x20')](_0x294938[_0xeaae('0x31')][_0xeaae('0x20')]);}_0xa334c8[_0xeaae('0x39')]=qs['sort'](_0x294938['query']['sort']);_0xa334c8['where']=qs['filters'](_[_0xeaae('0x3a')](_0x294938['query'],_0x14a68a[_0xeaae('0x32')]),_0x1c7175);if(_0x294938['query'][_0xeaae('0x3b')]){_0xa334c8['where']=_['merge'](_0xa334c8[_0xeaae('0x3c')],{'$or':_[_0xeaae('0x2b')](_0x1c7175,function(_0x58089f){if(_0x58089f[_0xeaae('0x2e')]!==_0xeaae('0x3d')){var _0x4af203={};_0x4af203[_0x58089f[_0xeaae('0x29')]]={'$like':'%'+_0x294938[_0xeaae('0x31')][_0xeaae('0x3b')]+'%'};return _0x4af203;}})});}_0xa334c8=_[_0xeaae('0x3e')]({},_0xa334c8,_0x294938[_0xeaae('0x3f')]);var _0x5a97a8={'where':_0xa334c8[_0xeaae('0x3c')]};return db['WhatsappApplication'][_0xeaae('0x1f')](_0x5a97a8)[_0xeaae('0x26')](function(_0x4b47db){_0x24d86a[_0xeaae('0x1f')]=_0x4b47db;if(_0x294938[_0xeaae('0x31')][_0xeaae('0x40')]){_0xa334c8['include']=[{'all':!![]}];}return db[_0xeaae('0x2c')][_0xeaae('0x41')](_0xa334c8);})[_0xeaae('0x26')](function(_0x40d844){_0x24d86a[_0xeaae('0x42')]=_0x40d844;return _0x24d86a;})['then'](respondWithFilteredResult(_0x30e777,_0xa334c8))['catch'](handleError(_0x30e777,null));};exports[_0xeaae('0x43')]=function(_0x2b97c9,_0x2d81b5){var _0x47d796={'raw':!![],'where':{'id':_0x2b97c9['params']['id']}},_0x467a65={};_0x467a65[_0xeaae('0x34')]=_['keys'](db[_0xeaae('0x2c')][_0xeaae('0x2d')]);_0x467a65[_0xeaae('0x31')]=_['keys'](_0x2b97c9[_0xeaae('0x31')]);_0x467a65['filters']=_[_0xeaae('0x44')](_0x467a65['model'],_0x467a65['query']);_0x47d796[_0xeaae('0x33')]=_[_0xeaae('0x44')](_0x467a65['model'],qs[_0xeaae('0x35')](_0x2b97c9[_0xeaae('0x31')][_0xeaae('0x35')]));_0x47d796[_0xeaae('0x33')]=_0x47d796[_0xeaae('0x33')][_0xeaae('0x36')]?_0x47d796['attributes']:_0x467a65[_0xeaae('0x34')];if(_0x2b97c9[_0xeaae('0x31')][_0xeaae('0x40')]){_0x47d796['include']=[{'all':!![]}];}_0x47d796=_['merge']({},_0x47d796,_0x2b97c9[_0xeaae('0x3f')]);return db[_0xeaae('0x2c')]['find'](_0x47d796)[_0xeaae('0x26')](handleEntityNotFound(_0x2d81b5,null))[_0xeaae('0x26')](respondWithResult(_0x2d81b5,null))[_0xeaae('0x45')](handleError(_0x2d81b5,null));};exports[_0xeaae('0x46')]=function(_0x29121a,_0x57a5ff){return db[_0xeaae('0x2c')]['create'](_0x29121a['body'],{})[_0xeaae('0x26')](respondWithResult(_0x57a5ff,0xc9))[_0xeaae('0x45')](handleError(_0x57a5ff,null));};exports[_0xeaae('0x25')]=function(_0x285dfe,_0x235b0d){if(_0x285dfe[_0xeaae('0x47')]['id']){delete _0x285dfe[_0xeaae('0x47')]['id'];}return db[_0xeaae('0x2c')][_0xeaae('0x48')]({'where':{'id':_0x285dfe[_0xeaae('0x49')]['id']}})[_0xeaae('0x26')](handleEntityNotFound(_0x235b0d,null))[_0xeaae('0x26')](saveUpdates(_0x285dfe[_0xeaae('0x47')],null))[_0xeaae('0x26')](respondWithResult(_0x235b0d,null))['catch'](handleError(_0x235b0d,null));};exports[_0xeaae('0x27')]=function(_0x506341,_0x1e6af9){return db[_0xeaae('0x2c')][_0xeaae('0x48')]({'where':{'id':_0x506341[_0xeaae('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e6af9,null))[_0xeaae('0x26')](removeEntity(_0x1e6af9,null))['catch'](handleError(_0x1e6af9,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6650610..496c573 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe57e=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xe57e,0xf2));var _0xee57=function(_0x5db058,_0x231e65){_0x5db058=_0x5db058-0x0;var _0x1baa9c=_0xe57e[_0x5db058];return _0x1baa9c;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee57('0xb'),'collate':_0xee57('0xc')});}; \ No newline at end of file +var _0x089f=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4','util'];(function(_0x1ce67b,_0x5d1e9f){var _0xc64cb0=function(_0x376ce4){while(--_0x376ce4){_0x1ce67b['push'](_0x1ce67b['shift']());}};_0xc64cb0(++_0x5d1e9f);}(_0x089f,0x1c7));var _0xf089=function(_0x4a1707,_0x131b01){_0x4a1707=_0x4a1707-0x0;var _0x2dcb18=_0x089f[_0x4a1707];return _0x2dcb18;};'use strict';var _=require('lodash');var util=require(_0xf089('0x0'));var logger=require(_0xf089('0x1'))(_0xf089('0x2'));var moment=require(_0xf089('0x3'));var BPromise=require(_0xf089('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf089('0x5'));var rimraf=require(_0xf089('0x6'));var config=require(_0xf089('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xf089('0x8')]=function(_0x126d3d,_0x21bce2){return _0x126d3d['define'](_0xf089('0x9'),attributes,{'tableName':_0xf089('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf089('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 929b3c9..e461f75 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x285b48,_0x41b4c6){var _0x5020e9=function(_0x537f18){while(--_0x537f18){_0x285b48['push'](_0x285b48['shift']());}};_0x5020e9(++_0x41b4c6);}(_0xbec5,0xe5));var _0x5bec=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbec5[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a427,_0x38456e,_0x406e65){return new BPromise(function(_0x43d96e,_0x302aae){return client[_0x5bec('0xb')](_0x28a427,_0x406e65)[_0x5bec('0xc')](function(_0x4d0d29){logger[_0x5bec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x38456e,_0x5bec('0xe'));logger[_0x5bec('0xf')](_0x5bec('0x10'),_0x38456e,'request\x20sent',JSON[_0x5bec('0x11')](_0x4d0d29));if(_0x4d0d29[_0x5bec('0x12')]){if(_0x4d0d29[_0x5bec('0x12')]['code']===0x1f4){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29['error'][_0x5bec('0x14')]);return _0x302aae(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);return _0x43d96e(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}else{logger[_0x5bec('0xd')](_0x5bec('0x13'),_0x38456e,_0x5bec('0xe'));_0x43d96e(_0x4d0d29[_0x5bec('0x15')]['message']);}})['catch'](function(_0x15af9b){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x15af9b);_0x302aae(_0x15af9b);});});} \ No newline at end of file +var _0xb903=['http','request','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bcaf3,_0x6a9db2){var _0x5d06d5=function(_0x41f5cc){while(--_0x41f5cc){_0x3bcaf3['push'](_0x3bcaf3['shift']());}};_0x5d06d5(++_0x6a9db2);}(_0xb903,0x185));var _0x3b90=function(_0x2dafb2,_0x140ce1){_0x2dafb2=_0x2dafb2-0x0;var _0x5d4125=_0xb903[_0x2dafb2];return _0x5d4125;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 4c0bca6..7490e4f 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa37=['describe','show','/:id/messages','getMessages','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated'];(function(_0x55ce32,_0x3bd640){var _0x1a610d=function(_0x529c65){while(--_0x529c65){_0x55ce32['push'](_0x55ce32['shift']());}};_0x1a610d(++_0x3bd640);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xaa37[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/describe',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0xa')](_0x7aa3('0xf'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x10')]);router['get']('/:id/download',auth[_0x7aa3('0xc')](),controller['download']);router[_0x7aa3('0x11')]('/',auth[_0x7aa3('0xc')](),controller['create']);router[_0x7aa3('0x11')](_0x7aa3('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x7aa3('0x12'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')](_0x7aa3('0x14'),_0x7aa3('0x15')),controller['addTags']);router[_0x7aa3('0x16')](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction[_0x7aa3('0x13')]('whatsapp','whatsappinteraction:update'),controller[_0x7aa3('0x18')]);router['delete'](_0x7aa3('0x17'),auth[_0x7aa3('0xc')](),interaction['tracked'](_0x7aa3('0x14'),_0x7aa3('0x19')),controller[_0x7aa3('0x1a')]);router[_0x7aa3('0x1b')](_0x7aa3('0x12'),auth['isAuthenticated'](),controller[_0x7aa3('0x1c')]);module[_0x7aa3('0x1d')]=router; \ No newline at end of file +var _0x6455=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','update','delete','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6455,0x97));var _0x5645=function(_0x220dda,_0x55e778){_0x220dda=_0x220dda-0x0;var _0x562d0a=_0x6455[_0x220dda];return _0x562d0a;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['describe']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0x9')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller['getMessages']);router[_0x5645('0x9')](_0x5645('0x10'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router['post']('/',auth[_0x5645('0xa')](),controller['create']);router[_0x5645('0x12')](_0x5645('0xf'),auth[_0x5645('0xa')](),controller[_0x5645('0x13')]);router[_0x5645('0x12')](_0x5645('0x14'),auth[_0x5645('0xa')](),interaction[_0x5645('0x15')]('whatsapp',_0x5645('0x16')),controller[_0x5645('0x17')]);router[_0x5645('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),'whatsappinteraction:update'),controller[_0x5645('0x1a')]);router[_0x5645('0x1b')](_0x5645('0xd'),auth['isAuthenticated'](),interaction[_0x5645('0x15')](_0x5645('0x19'),_0x5645('0x1c')),controller[_0x5645('0x1d')]);router['delete'](_0x5645('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x5645('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index cb7f23d..25995af 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5075=['DATE','STRING','ENUM','sequelize','moment','exports','BOOLEAN'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5075,0x73));var _0x5507=function(_0x15af84,_0x7a5b4d){_0x15af84=_0x15af84-0x0;var _0x5ac0a4=_0x5075[_0x15af84];return _0x5ac0a4;};'use strict';var Sequelize=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));module[_0x5507('0x2')]={'closed':{'type':Sequelize[_0x5507('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5507('0x4')]},'disposition':{'type':Sequelize[_0x5507('0x5')]},'secondDisposition':{'type':Sequelize[_0x5507('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5507('0x5')]},'phone':{'type':Sequelize[_0x5507('0x5')]},'read1stAt':{'type':Sequelize[_0x5507('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5507('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5507('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5507('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbf4e=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x31943a,_0x6d56c0){var _0x1475f6=function(_0x56a428){while(--_0x56a428){_0x31943a['push'](_0x31943a['shift']());}};_0x1475f6(++_0x6d56c0);}(_0xbf4e,0x172));var _0xebf4=function(_0x116935,_0x2dd197){_0x116935=_0x116935-0x0;var _0x3f2e3f=_0xbf4e[_0x116935];return _0x3f2e3f;};'use strict';var Sequelize=require(_0xebf4('0x0'));var moment=require(_0xebf4('0x1'));module[_0xebf4('0x2')]={'closed':{'type':Sequelize[_0xebf4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebf4('0x4')]},'disposition':{'type':Sequelize[_0xebf4('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xebf4('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xebf4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xebf4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xebf4('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xebf4('0x6')]('in',_0xebf4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 7314aca..e0368c6 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47d6=['unlinkSync','sendStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','Users','map','TagIds','Tags','forEach','catch','index','WhatsappInteraction','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','left_join','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','rawAttributes','includeAll','include','create','body','params','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','format','options','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','fullname','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','existsSync','out','System','renderFile','views','transcript-','createPdfFromHTML','log','err'];(function(_0x11b24e,_0x5df491){var _0x2e3acc=function(_0x564803){while(--_0x564803){_0x11b24e['push'](_0x11b24e['shift']());}};_0x2e3acc(++_0x5df491);}(_0x47d6,0x1de));var _0x647d=function(_0x838a31,_0x1fe6ab){_0x838a31=_0x838a31-0x0;var _0x567f61=_0x47d6[_0x838a31];return _0x567f61;};'use strict';var emlformat=require(_0x647d('0x0'));var rimraf=require(_0x647d('0x1'));var zipdir=require(_0x647d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x647d('0x3'));var BPromise=require(_0x647d('0x4'));var Mustache=require(_0x647d('0x5'));var util=require('util');var path=require(_0x647d('0x6'));var sox=require(_0x647d('0x7'));var csv=require(_0x647d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x647d('0x9'));var _=require(_0x647d('0xa'));var squel=require(_0x647d('0xb'));var crypto=require(_0x647d('0xc'));var jsforce=require(_0x647d('0xd'));var deskjs=require(_0x647d('0xe'));var toCsv=require(_0x647d('0x8'));var querystring=require(_0x647d('0xf'));var Papa=require(_0x647d('0x10'));var Redis=require(_0x647d('0x11'));var authService=require(_0x647d('0x12'));var qs=require(_0x647d('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x647d('0x14'));var hardwareService=require(_0x647d('0x15'));var logger=require(_0x647d('0x16'))(_0x647d('0x17'));var utils=require(_0x647d('0x18'));var config=require(_0x647d('0x19'));var licenseUtil=require(_0x647d('0x1a'));var db=require(_0x647d('0x1b'))['db'];config[_0x647d('0x1c')]=_[_0x647d('0x1d')](config[_0x647d('0x1c')],{'host':_0x647d('0x1e'),'port':0x18eb});var socket=require(_0x647d('0x1f'))(new Redis(config['redis']));require(_0x647d('0x20'))[_0x647d('0x21')](socket);function respondWithStatusCode(_0x3adcb0,_0x5e1789){_0x5e1789=_0x5e1789||0xcc;return function(_0x25fa4a){if(_0x25fa4a){return _0x3adcb0['sendStatus'](_0x5e1789);}return _0x3adcb0[_0x647d('0x22')](_0x5e1789)['end']();};}function respondWithResult(_0xb14b1e,_0x3e6af2){_0x3e6af2=_0x3e6af2||0xc8;return function(_0x598186){if(_0x598186){return _0xb14b1e[_0x647d('0x22')](_0x3e6af2)['json'](_0x598186);}};}function respondWithFilteredResult(_0x128b62,_0x30a107){return function(_0x15aa16){if(_0x15aa16){var _0x407788=typeof _0x30a107[_0x647d('0x23')]===_0x647d('0x24')&&typeof _0x30a107[_0x647d('0x25')]===_0x647d('0x24');var _0x1a68e8=_0x15aa16[_0x647d('0x26')];var _0x46a8e1=_0x407788?0x0:_0x30a107[_0x647d('0x23')];var _0x33145c=_0x407788?_0x15aa16[_0x647d('0x26')]:_0x30a107[_0x647d('0x23')]+_0x30a107[_0x647d('0x25')];var _0xfe1fdb;if(_0x33145c>=_0x1a68e8){_0x33145c=_0x1a68e8;_0xfe1fdb=0xc8;}else{_0xfe1fdb=0xce;}_0x128b62[_0x647d('0x22')](_0xfe1fdb);return _0x128b62[_0x647d('0x27')]('Content-Range',_0x46a8e1+'-'+_0x33145c+'/'+_0x1a68e8)[_0x647d('0x28')](_0x15aa16);}return null;};}function patchUpdates(_0x162fb5){return function(_0x5ced3c){try{jsonpatch[_0x647d('0x29')](_0x5ced3c,_0x162fb5,!![]);}catch(_0x3d8e69){return BPromise[_0x647d('0x2a')](_0x3d8e69);}return _0x5ced3c[_0x647d('0x2b')]();};}function saveUpdates(_0x5019c2,_0xbdd427){return function(_0x3112f3){if(_0x3112f3){return _0x3112f3[_0x647d('0x2c')](_0x5019c2)[_0x647d('0x2d')](function(_0x141b25){return _0x141b25;});}return null;};}function removeEntity(_0x5db555,_0x3c2ca6){return function(_0x248ab7){if(_0x248ab7){return _0x248ab7[_0x647d('0x2e')]()[_0x647d('0x2d')](function(){_0x5db555[_0x647d('0x22')](0xcc)[_0x647d('0x2f')]();});}};}function handleEntityNotFound(_0xb67921,_0x26086e){return function(_0x5f18d7){if(!_0x5f18d7){_0xb67921['sendStatus'](0x194);}return _0x5f18d7;};}function handleError(_0x1107d3,_0x20d08d){_0x20d08d=_0x20d08d||0x1f4;return function(_0x1a0360){logger[_0x647d('0x30')](_0x1a0360[_0x647d('0x31')]);if(_0x1a0360[_0x647d('0x32')]){delete _0x1a0360[_0x647d('0x32')];}_0x1107d3[_0x647d('0x22')](_0x20d08d)[_0x647d('0x33')](_0x1a0360);};}function getInteractionUsers(_0xe3983e,_0x4591c9){return new BPromise(function(_0x1c13bc,_0x213ce1){try{if(_0x4591c9[_0xe3983e['id']]){_0xe3983e[_0x647d('0x34')]=_[_0x647d('0x35')](_0x4591c9[_0xe3983e['id']],function(_0x25591f){return{'id':_0x25591f['id'],'fullname':_0x25591f['fullname']};});}}catch(_0x16e563){_0x213ce1(_0x16e563);}_0x1c13bc(_0xe3983e);});}function getInteractionTags(_0x2197b6,_0x3ae6d2){return new BPromise(function(_0x2a5095,_0x405ef8){try{if(_0x2197b6[_0x647d('0x36')]){_0x2197b6[_0x647d('0x37')]=[];_0x2197b6[_0x647d('0x36')]['split'](',')[_0x647d('0x38')](function(_0x8666e6){_0x2197b6[_0x647d('0x37')]['push'](_0x3ae6d2[_0x8666e6]);});}delete _0x2197b6[_0x647d('0x36')];}catch(_0x32aba7){_0x405ef8(_0x32aba7);}_0x2a5095(_0x2197b6);});}function updateWhatsappInteraction(_0x5eb301,_0x75421d,_0x3d3745){return new BPromise(function(_0x12d45e,_0x3f804c){return getInteractionUsers(_0x5eb301,_0x3d3745)[_0x647d('0x2d')](function(_0x71dc81){return getInteractionTags(_0x71dc81,_0x75421d);})[_0x647d('0x2d')](function(_0x156844){_0x12d45e(_0x156844);})[_0x647d('0x39')](function(_0x1a064e){_0x3f804c(_0x1a064e);});});}exports[_0x647d('0x3a')]=function(_0x324a1c,_0x2d480d){var _0x4e5801={},_0x3c4cbc={},_0x5da608={'count':0x0,'rows':[]};var _0xf67aa4=_[_0x647d('0x35')](db[_0x647d('0x3b')]['rawAttributes'],function(_0x27e920){return{'name':_0x27e920[_0x647d('0x3c')],'type':_0x27e920[_0x647d('0x3d')]['key']};});_0x3c4cbc[_0x647d('0x3e')]=_['map'](_0xf67aa4,_0x647d('0x32'));_0x3c4cbc['query']=_[_0x647d('0x3f')](_0x324a1c[_0x647d('0x40')]);_0x3c4cbc[_0x647d('0x41')]=_[_0x647d('0x42')](_0x3c4cbc[_0x647d('0x3e')],_0x3c4cbc[_0x647d('0x40')]);_0x4e5801[_0x647d('0x43')]=_['intersection'](_0x3c4cbc['model'],qs[_0x647d('0x44')](_0x324a1c[_0x647d('0x40')][_0x647d('0x44')]));_0x4e5801['attributes']=_0x4e5801[_0x647d('0x43')][_0x647d('0x45')]?_0x4e5801[_0x647d('0x43')]:_0x3c4cbc[_0x647d('0x3e')];if(!_0x324a1c[_0x647d('0x40')][_0x647d('0x46')](_0x647d('0x47'))){_0x4e5801[_0x647d('0x25')]=qs[_0x647d('0x25')](_0x324a1c[_0x647d('0x40')]['limit']);_0x4e5801['offset']=qs[_0x647d('0x23')](_0x324a1c[_0x647d('0x40')][_0x647d('0x23')]);}_0x4e5801[_0x647d('0x48')]=qs[_0x647d('0x49')](_0x324a1c['query'][_0x647d('0x49')]);_0x4e5801[_0x647d('0x4a')]=qs[_0x647d('0x41')](_[_0x647d('0x4b')](_0x324a1c[_0x647d('0x40')],_0x3c4cbc['filters']),_0xf67aa4);var _0x314d18=[];var _0x5936fa=squel[_0x647d('0x4c')]()[_0x647d('0x4d')]('id')[_0x647d('0x4d')](_0x647d('0x32'))[_0x647d('0x4d')](_0x647d('0x4e'))[_0x647d('0x4f')](_0x647d('0x50'));var _0x446a86=squel['select']()[_0x647d('0x4d')](_0x647d('0x51'))['field'](_0x647d('0x52'))[_0x647d('0x4d')](_0x647d('0x53'))[_0x647d('0x4f')](_0x647d('0x54'),'ui')['left_join'](_0x647d('0x55'),'u',_0x647d('0x56'));var _0x360b2e=squel[_0x647d('0x4c')]()[_0x647d('0x4f')](_0x647d('0x57'),'i')['left_join'](_0x647d('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x647d('0x55'),'o','o.id\x20=\x20i.UserId')[_0x647d('0x59')](_0x647d('0x5a'),'a',_0x647d('0x5b'))[_0x647d('0x59')]('whatsapp_messages','me',_0x647d('0x5c'))['left_join'](_0x647d('0x5d'),'it',_0x647d('0x5e'))[_0x647d('0x59')](_0x647d('0x50'),'t',_0x647d('0x5f'));var _0x54b9ef=squel[_0x647d('0x60')]();var _0x32b76b=[];var _0x3fdd65=squel['expr']();var _0x46e349;if(_0x324a1c[_0x647d('0x40')][_0x647d('0x61')]){_0x46e349=as['parseSearch'](_0x324a1c[_0x647d('0x40')][_0x647d('0x61')]);var _0x2b7e2a=_0x46e349[_0x647d('0x62')];for(var _0x4ffe75=0x0;_0x4ffe75<_0x46e349['conditions']['length'];_0x4ffe75++){var _0xf0f740=_0x46e349['conditions'][_0x4ffe75];var _0xf7aadf='i';var _0x2ec41f=_[_0x647d('0x63')](_0xf67aa4,[_0x647d('0x32'),_0xf0f740['field']]);if(!_0x2ec41f){switch(_0xf0f740[_0x647d('0x4d')]){case _0x647d('0x64'):if(_0xf0f740[_0x647d('0x65')]==0x1){_0x360b2e[_0x647d('0x66')]('`'+_0xf0f740[_0x647d('0x4d')]+_0x647d('0x67'));}else{_0x360b2e[_0x647d('0x66')]('`'+_0xf0f740['field']+_0x647d('0x68'));}break;case _0x647d('0x69'):if(_0xf0f740[_0x647d('0x6a')]==='$substring'){if(_0xf0f740[_0x647d('0x65')][_0x647d('0x6b')]('\x20')[_0x647d('0x45')]>0x1){_0x54b9ef[_0x2b7e2a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xf0f740[_0x647d('0x65')]),null);}else{var _0x1d7956='%'+_0xf0f740[_0x647d('0x65')]+'%';_0x54b9ef[_0x2b7e2a](_0x647d('0x6c'),_0x1d7956,_0x1d7956,_0x1d7956);}}else{_0x2ec41f=_[_0x647d('0x63')](_0xf67aa4,[_0x647d('0x32'),_0x647d('0x6d')]);_0xf0f740['field']=_0x647d('0x6d');_0x8de50a=as[_0x647d('0x6e')](_0xf7aadf,_0x2ec41f[_0x647d('0x3d')],_0xf0f740);_0x54b9ef[_0x2b7e2a](_0x8de50a[_0x647d('0x6f')],_0x8de50a[_0x647d('0x65')][_0x647d('0x70')],_0x8de50a[_0x647d('0x65')][_0x647d('0x2f')]);}break;case _0x647d('0x71'):var _0x56fef0=_0xf0f740[_0x647d('0x65')][_0x647d('0x6b')](',')[_0x647d('0x35')](function(_0x4df238){return Number(_0x4df238);});_0x56fef0[_0x647d('0x38')](function(_0x13a258){_0x3fdd65['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x13a258+',%');});_0x32b76b=_['union'](_0x32b76b,_0x56fef0);break;case _0x647d('0x72'):if(_0xf0f740[_0x647d('0x6a')]===_0x647d('0x73')){_0x54b9ef[_0x2b7e2a](_0x647d('0x74'),'%'+_0xf0f740['value']+'%',null);}else{_0x2ec41f=_[_0x647d('0x63')](_0xf67aa4,[_0x647d('0x32'),'UserId']);_0xf0f740[_0x647d('0x4d')]='UserId';_0x8de50a=as[_0x647d('0x6e')](_0xf7aadf,_0x2ec41f['type'],_0xf0f740);_0x54b9ef[_0x2b7e2a](_0x8de50a[_0x647d('0x6f')],_0x8de50a[_0x647d('0x65')][_0x647d('0x70')],_0x8de50a[_0x647d('0x65')][_0x647d('0x2f')]);}break;case'body':_0x8de50a=as[_0x647d('0x6e')]('me',null,_0xf0f740);_0x54b9ef[_0x2b7e2a](_0x8de50a[_0x647d('0x6f')],_0x8de50a['value']['start'],_0x8de50a[_0x647d('0x65')][_0x647d('0x2f')]);break;}}else{var _0x8de50a=as[_0x647d('0x6e')](_0xf7aadf,_0x2ec41f[_0x647d('0x3d')],_0xf0f740);_0x54b9ef[_0x2b7e2a](_0x8de50a['text'],_0x8de50a['value']['start'],_0x8de50a[_0x647d('0x65')][_0x647d('0x2f')]);}}}else{var _0x37f944=_(_0x324a1c[_0x647d('0x40')])[_0x647d('0x3f')]()['map'](function(_0x2661ba){return _[_0x647d('0x75')](_0xf67aa4,[_0x647d('0x32'),_0x2661ba])?_0x2661ba:undefined;})[_0x647d('0x76')]()[_0x647d('0x65')]();if(!_[_0x647d('0x77')](_0x37f944)){_0x37f944[_0x647d('0x38')](function(_0x3114fc){if(_0x3114fc===_0x647d('0x78')){_0x360b2e[_0x647d('0x4a')](_0x647d('0x79'),[][_0x647d('0x7a')](_0x324a1c[_0x647d('0x40')][_0x3114fc]));}else if(_0x3114fc===_0x647d('0x7b')){var _0x135610=JSON[_0x647d('0x7c')](_0x324a1c[_0x647d('0x40')][_0x3114fc])[_0x647d('0x7d')];var _0x2f2c36=JSON['parse'](_0x324a1c[_0x647d('0x40')][_0x3114fc])['$lte'];_0x360b2e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x135610,_0x2f2c36);}else{if(_0x324a1c['query'][_0x3114fc]===_0x647d('0x7e')){_0x360b2e[_0x647d('0x4a')]('i.'+_0x3114fc+_0x647d('0x7f'));}else{_0x360b2e['where']('i.'+_0x3114fc+_0x647d('0x80'),_0x324a1c[_0x647d('0x40')][_0x3114fc]);}}});}if(_0x324a1c['query']['read']){if(_0x324a1c[_0x647d('0x40')][_0x647d('0x81')]==0x1){_0x360b2e['having'](_0x647d('0x82'));}else{_0x360b2e[_0x647d('0x66')](_0x647d('0x83'));}}if(_0x324a1c[_0x647d('0x40')][_0x647d('0x84')]){_0x32b76b=_[_0x647d('0x85')](_0x324a1c[_0x647d('0x40')][_0x647d('0x84')])?_0x324a1c[_0x647d('0x40')][_0x647d('0x84')]:new Array(_0x324a1c[_0x647d('0x40')][_0x647d('0x84')]);_0x32b76b[_0x647d('0x38')](function(_0x4cb09d){_0x3fdd65['or'](_0x647d('0x86'),'%,'+_0x4cb09d+',%');});}if(_0x324a1c[_0x647d('0x40')][_0x647d('0x87')]){var _0x2bdd68=_0x324a1c['query'][_0x647d('0x87')]['replace']('\x5c','\x5c\x5c')[_0x647d('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2bdd68)){_0x54b9ef['or'](_0x647d('0x89'),_0x2bdd68+'%')['or'](_0x647d('0x8a'),_0x2bdd68+'%');}else{_0x54b9ef['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x647d('0x8b')](_0x2bdd68))['or'](_0x647d('0x8c'),_0x2bdd68+'%');}}}_0x360b2e[_0x647d('0x4a')](_0x54b9ef);_0x360b2e[_0x647d('0x8d')](_0x647d('0x8e'));var _0x1555f2={'type':db[_0x647d('0x8f')]['QueryTypes'][_0x647d('0x90')],'raw':!![]};var _0x51ce28=_0x360b2e[_0x647d('0x91')]();_0x51ce28[_0x647d('0x4d')](_0x647d('0x8e'));_0x51ce28['field'](_0x647d('0x92'),_0x647d('0x64'));if(_0x4e5801[_0x647d('0x48')]){_0x4e5801[_0x647d('0x48')]['forEach'](function(_0x52c3b2){var _0x1aa9f8=_0x52c3b2[0x0]==='contactName'?_0x52c3b2[0x0]:'i.'+_0x52c3b2[0x0];_0x360b2e[_0x647d('0x48')](_0x1aa9f8,_0x52c3b2[0x1]===_0x647d('0x93')?![]:!![]);});}if(!_[_0x647d('0x77')](_0x32b76b)){_0x360b2e[_0x647d('0x66')](_0x3fdd65);_0x51ce28[_0x647d('0x4a')]('t.id\x20IN\x20?',_0x32b76b);}BPromise[_0x647d('0x94')]()[_0x647d('0x2d')](function(){if(!_0x46e349){if(_0x324a1c['query']['WhatsappAccountId'])return;_0x51ce28[_0x647d('0x4a')](_0x647d('0x95'));_0x360b2e[_0x647d('0x4a')](_0x647d('0x95'));return;}if(_0x324a1c[_0x647d('0x96')][_0x647d('0x97')]!==_0x647d('0x98'))return;return _0x324a1c[_0x647d('0x96')][_0x647d('0x99')]({'attributes':['id'],'raw':!![]})[_0x647d('0x2d')](function(_0x452ca6){if(_[_0x647d('0x77')](_0x452ca6)){_0x51ce28[_0x647d('0x4a')]('i.WhatsappAccountId\x20IS\x20NULL');_0x360b2e[_0x647d('0x4a')](_0x647d('0x9a'));}else{_0x51ce28[_0x647d('0x4a')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x452ca6,'id'));_0x360b2e['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x647d('0x35')](_0x452ca6,'id'));}});})[_0x647d('0x2d')](function(){if(_0x324a1c[_0x647d('0x96')][_0x647d('0x97')]==='agent'&&!_0x46e349&&!_0x324a1c[_0x647d('0x40')][_0x647d('0x78')])return[];return db['sequelize']['query'](_0x51ce28[_0x647d('0x9b')](),_0x1555f2);})[_0x647d('0x2d')](function(_0x55a066){_0x5da608[_0x647d('0x26')]=_0x55a066['length'];if(_0x5da608[_0x647d('0x26')]===0x0)return[];return db[_0x647d('0x9c')][_0x647d('0x40')](_0x5936fa['toString'](),_0x1555f2)[_0x647d('0x2d')](function(_0x3f53ca){_0x314d18=_[_0x647d('0x9d')](_0x3f53ca,'id');_0x1555f2=_[_0x647d('0x9e')](_0x1555f2,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x324a1c[_0x647d('0x40')][_0x647d('0x44')]){_0x4e5801[_0x647d('0x43')][_0x647d('0x38')](function(_0x47f13e){_0x360b2e[_0x647d('0x4d')]('i.'+_0x47f13e);});}else{_0x360b2e['field'](_0x647d('0x92'),_0x647d('0x64'));_0x360b2e[_0x647d('0x4d')](_0x647d('0x9f'),_0x647d('0xa0'));_0x360b2e['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x360b2e[_0x647d('0x4d')](_0x647d('0xa1'),_0x647d('0xa2'));_0x360b2e[_0x647d('0x4d')]('i.*');_0x360b2e['field'](_0x647d('0xa3'),_0x647d('0xa4'));_0x360b2e[_0x647d('0x4d')]('c.lastName',_0x647d('0xa5'));_0x360b2e['field'](_0x647d('0xa6'),'Contact.email');_0x360b2e[_0x647d('0x4d')]('c.phone',_0x647d('0xa7'));_0x360b2e[_0x647d('0x4d')]('c.mobile','Contact.mobile');_0x360b2e[_0x647d('0x4d')](_0x647d('0xa8'),_0x647d('0xa9'));_0x360b2e['field'](_0x647d('0xaa'),_0x647d('0xab'));_0x360b2e[_0x647d('0x4d')]('o.internal',_0x647d('0xac'));_0x360b2e['field'](_0x647d('0xad'),_0x647d('0x36'));}if(_0x4e5801[_0x647d('0x25')])_0x360b2e[_0x647d('0x25')](_0x4e5801[_0x647d('0x25')]);if(_0x4e5801['offset'])_0x360b2e[_0x647d('0x23')](_0x4e5801[_0x647d('0x23')]);return db[_0x647d('0x9c')]['query'](_0x360b2e[_0x647d('0x9b')](),_0x1555f2);})[_0x647d('0x2d')](function(_0x46b932){if(_0x46b932[_0x647d('0x45')]>0x0)_0x446a86[_0x647d('0x4a')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x647d('0x35')](_0x46b932,'id'));return db[_0x647d('0x9c')][_0x647d('0x40')](_0x446a86[_0x647d('0x9b')](),_0x1555f2)[_0x647d('0x2d')](function(_0x4f019a){var _0x63a074=_[_0x647d('0xae')](_0x4f019a,'WhatsappInteractionId');var _0x53566b=[];_0x46b932[_0x647d('0x38')](function(_0x5487e6){_0x53566b[_0x647d('0xaf')](updateWhatsappInteraction(_0x5487e6,_0x314d18,_0x63a074));});return BPromise[_0x647d('0xb0')](_0x53566b);});});})['then'](function(_0x3db17f){_0x5da608[_0x647d('0xb1')]=_0x3db17f;return _0x5da608;})['then'](respondWithFilteredResult(_0x2d480d,_0x4e5801))[_0x647d('0x39')](handleError(_0x2d480d,null));};exports[_0x647d('0xb2')]=function(_0x20ec8b,_0x29d450){var _0x8f83a7={'raw':![],'where':{'id':_0x20ec8b['params']['id']}},_0x208633={};_0x208633[_0x647d('0x3e')]=_[_0x647d('0x3f')](db['WhatsappInteraction'][_0x647d('0xb3')]);_0x208633[_0x647d('0x40')]=_[_0x647d('0x3f')](_0x20ec8b['query']);_0x208633[_0x647d('0x41')]=_[_0x647d('0x42')](_0x208633[_0x647d('0x3e')],_0x208633[_0x647d('0x40')]);_0x8f83a7['attributes']=_[_0x647d('0x42')](_0x208633[_0x647d('0x3e')],qs[_0x647d('0x44')](_0x20ec8b[_0x647d('0x40')][_0x647d('0x44')]));_0x8f83a7[_0x647d('0x43')]=_0x8f83a7[_0x647d('0x43')]['length']?_0x8f83a7['attributes']:_0x208633[_0x647d('0x3e')];if(_0x20ec8b[_0x647d('0x40')][_0x647d('0xb4')]){_0x8f83a7[_0x647d('0xb5')]=[{'all':!![]}];}_0x8f83a7=_['merge']({},_0x8f83a7,_0x20ec8b['options']);return db[_0x647d('0x3b')][_0x647d('0x63')](_0x8f83a7)['then'](handleEntityNotFound(_0x29d450,null))[_0x647d('0x2d')](respondWithResult(_0x29d450,null))['catch'](handleError(_0x29d450,null));};exports[_0x647d('0xb6')]=function(_0x363582,_0x39af09){return db[_0x647d('0x3b')][_0x647d('0xb6')](_0x363582[_0x647d('0xb7')],{})[_0x647d('0x2d')](respondWithResult(_0x39af09,0xc9))[_0x647d('0x39')](handleError(_0x39af09,null));};exports[_0x647d('0x2c')]=function(_0x54cec0,_0x4b8e86){if(_0x54cec0[_0x647d('0xb7')]['id']){delete _0x54cec0[_0x647d('0xb7')]['id'];}return db[_0x647d('0x3b')][_0x647d('0x63')]({'where':{'id':_0x54cec0[_0x647d('0xb8')]['id']}})[_0x647d('0x2d')](handleEntityNotFound(_0x4b8e86,null))[_0x647d('0x2d')](saveUpdates(_0x54cec0[_0x647d('0xb7')],null))[_0x647d('0x2d')](respondWithResult(_0x4b8e86,null))[_0x647d('0x39')](handleError(_0x4b8e86,null));};exports[_0x647d('0x2e')]=function(_0x8dd32d,_0x34f6b9){return db['WhatsappInteraction'][_0x647d('0x63')]({'where':{'id':_0x8dd32d['params']['id']}})[_0x647d('0x2d')](handleEntityNotFound(_0x34f6b9,null))[_0x647d('0x2d')](removeEntity(_0x34f6b9,null))[_0x647d('0x39')](handleError(_0x34f6b9,null));};exports['describe']=function(_0x2cd1f3,_0x6b4e6b){return db[_0x647d('0x3b')][_0x647d('0xb9')]()[_0x647d('0x2d')](respondWithResult(_0x6b4e6b,null))[_0x647d('0x39')](handleError(_0x6b4e6b,null));};exports['addMessage']=function(_0x43517d,_0x300e4f,_0x5012ef){return db[_0x647d('0xba')]['find']({'where':{'id':_0x43517d['params']['id']}})[_0x647d('0x2d')](handleEntityNotFound(_0x300e4f,null))['then'](function(_0x36b55e){if(_0x36b55e){return _0x36b55e[_0x647d('0xbb')](_0x43517d['body'][_0x647d('0xbc')],_[_0x647d('0xbd')](_0x43517d['body'],[_0x647d('0xbc'),'id'])||{});}})[_0x647d('0x2d')](respondWithResult(_0x300e4f,null))['catch'](handleError(_0x300e4f,null));};exports[_0x647d('0xbe')]=function(_0xb72d3a,_0x48537a,_0x3024e8){var _0x4ca918={'raw':![],'where':{}};var _0xa16d10={};var _0x2f95d3={'count':0x0,'rows':[]};return db[_0x647d('0x3b')][_0x647d('0xbf')]({'where':{'id':_0xb72d3a['params']['id']}})[_0x647d('0x2d')](handleEntityNotFound(_0x48537a,null))['then'](function(_0x12546f){if(_0x12546f){_0xa16d10[_0x647d('0x3e')]=_[_0x647d('0x3f')](db[_0x647d('0xba')][_0x647d('0xb3')]);_0xa16d10[_0x647d('0x40')]=_[_0x647d('0x3f')](_0xb72d3a['query']);_0xa16d10['filters']=_[_0x647d('0x42')](_0xa16d10[_0x647d('0x3e')],_0xa16d10['query']);_0x4ca918[_0x647d('0x43')]=_[_0x647d('0x42')](_0xa16d10['model'],qs[_0x647d('0x44')](_0xb72d3a[_0x647d('0x40')][_0x647d('0x44')]));_0x4ca918[_0x647d('0x43')]=_0x4ca918[_0x647d('0x43')]['length']?_0x4ca918[_0x647d('0x43')]:_0xa16d10[_0x647d('0x3e')];if(!_0xb72d3a[_0x647d('0x40')][_0x647d('0x46')](_0x647d('0x47'))){_0x4ca918[_0x647d('0x25')]=qs[_0x647d('0x25')](_0xb72d3a['query'][_0x647d('0x25')]);_0x4ca918['offset']=qs['offset'](_0xb72d3a[_0x647d('0x40')][_0x647d('0x23')]);}_0x4ca918['order']=qs[_0x647d('0x49')](_0xb72d3a['query'][_0x647d('0x49')]);_0x4ca918[_0x647d('0x4a')]=qs[_0x647d('0x41')](_[_0x647d('0x4b')](_0xb72d3a[_0x647d('0x40')],_0xa16d10[_0x647d('0x41')]));_0x4ca918[_0x647d('0x4a')][_0x647d('0xc0')]=_0x12546f['id'];if(_0xb72d3a[_0x647d('0x40')][_0x647d('0x87')]){_0x4ca918['where']=_[_0x647d('0x9e')](_0x4ca918[_0x647d('0x4a')],{'$or':_[_0x647d('0x35')](_0x4ca918[_0x647d('0x43')],function(_0xa3df34){var _0x246910={};_0x246910[_0xa3df34]={'$like':'%'+_0xb72d3a[_0x647d('0x40')][_0x647d('0x87')]+'%'};return _0x246910;})});}if(_0xb72d3a[_0x647d('0x40')][_0x647d('0x7d')]){var _0x7ecb71=_0xb72d3a[_0x647d('0x40')][_0x647d('0x7d')][_0x647d('0x6b')](',');var _0x5c5af7={};_0x5c5af7[_0x7ecb71[0x0]]={'$gte':moment(_0x7ecb71[0x1])[_0x647d('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ca918[_0x647d('0x4a')]=_['merge'](_0x4ca918[_0x647d('0x4a')],_0x5c5af7);}_0x4ca918=_['merge']({},_0x4ca918,_0xb72d3a[_0x647d('0xc2')]);return db[_0x647d('0xba')][_0x647d('0x26')]({'where':_0x4ca918[_0x647d('0x4a')]})['then'](function(_0x3b1858){_0x2f95d3[_0x647d('0x26')]=_0x3b1858;if(_0xb72d3a[_0x647d('0x40')][_0x647d('0xb4')]){_0x4ca918['include']=[{'all':!![]}];}return db[_0x647d('0xba')][_0x647d('0xc3')](_0x4ca918);})[_0x647d('0x2d')](function(_0x1137d1){_0x2f95d3[_0x647d('0xb1')]=_0x1137d1;return _0x2f95d3;});}})[_0x647d('0x2d')](respondWithFilteredResult(_0x48537a,_0x4ca918))[_0x647d('0x39')](handleError(_0x48537a,null));};exports[_0x647d('0xc4')]=function(_0x14f88f,_0x35e3bd,_0x3715a9){return db['WhatsappInteraction'][_0x647d('0x63')]({'where':{'id':_0x14f88f[_0x647d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x35e3bd,null))[_0x647d('0x2d')](function(_0x4e3ef4){if(_0x4e3ef4){return _0x4e3ef4[_0x647d('0xc5')](_0x14f88f[_0x647d('0xb7')][_0x647d('0xbc')],_[_0x647d('0xbd')](_0x14f88f[_0x647d('0xb7')],[_0x647d('0xbc'),'id'])||{})[_0x647d('0xc6')](function(){return db['Tag'][_0x647d('0xc3')]({'attributes':['id',_0x647d('0x32'),_0x647d('0x4e')],'where':{'id':_0x14f88f[_0x647d('0xb7')][_0x647d('0xbc')]}});})['then'](function(_0x140209){socket[_0x647d('0xc7')](_0x647d('0xc8'),{'id':Number(_0x14f88f[_0x647d('0xb8')]['id']),'tags':_0x140209||[]});return{'id':Number(_0x14f88f[_0x647d('0xb8')]['id']),'tags':_0x140209||[]};});}})[_0x647d('0x2d')](respondWithResult(_0x35e3bd,null))[_0x647d('0x39')](handleError(_0x35e3bd,null));};exports[_0x647d('0xc9')]=function(_0x41f8c3,_0x1b04ca,_0x208d0f){return db[_0x647d('0x3b')][_0x647d('0x63')]({'where':{'id':_0x41f8c3[_0x647d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1b04ca,null))[_0x647d('0x2d')](function(_0x3ab677){if(_0x3ab677){return _0x3ab677[_0x647d('0xc9')](_0x41f8c3[_0x647d('0x40')][_0x647d('0xbc')]);}})[_0x647d('0x2d')](respondWithStatusCode(_0x1b04ca,null))[_0x647d('0x39')](handleError(_0x1b04ca,null));};exports[_0x647d('0xca')]=function(_0xa21f12,_0x158a16){var _0x3759c5=moment()[_0x647d('0xcb')]()[_0x647d('0x9b')]();var _0x5e9ded=path[_0x647d('0xcc')](config['root'],_0x647d('0xcd'),'files',_0x647d('0xce'));var _0x259050=path['join'](config[_0x647d('0xcf')],_0x647d('0xcd'),_0x647d('0xd0'),_0x647d('0xd1'));var _0x29bfee=path[_0x647d('0xcc')](_0x5e9ded,_0x3759c5);var _0x46b99d=util[_0x647d('0xc1')](_0x647d('0xd2'),_0xa21f12[_0x647d('0xb8')]['id'],_0x3759c5);var _0x5c9947=path[_0x647d('0xcc')](_0x5e9ded,_0x46b99d);var _0x1ee888=[];_0x1ee888['push']({'model':db[_0x647d('0x72')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1ee888[_0x647d('0xaf')]({'model':db[_0x647d('0xd3')],'as':'Contact','attributes':['id',_0x647d('0xd4'),_0x647d('0xd5')],'raw':!![]});if(_0xa21f12[_0x647d('0x40')][_0x647d('0xd1')]){_0x1ee888[_0x647d('0xaf')]({'model':db['Attachment'],'as':_0x647d('0xd6'),'raw':!![]});}var _0x358d8d=[{'model':db[_0x647d('0xba')],'as':_0x647d('0xd7'),'attributes':['id','body',_0x647d('0x7b'),_0x647d('0xd8'),_0x647d('0xd9'),_0x647d('0x81')],'include':_0x1ee888}];_0x358d8d[_0x647d('0xaf')]({'model':db[_0x647d('0xda')],'as':_0x647d('0xdb'),'attributes':['id',_0x647d('0x32')]});_0x358d8d[_0x647d('0xaf')]({'model':db[_0x647d('0x72')],'as':'Owner','attributes':['id','fullname']});return db[_0x647d('0x3b')]['find']({'where':{'id':_0xa21f12[_0x647d('0xb8')]['id']},'include':_0x358d8d})[_0x647d('0x2d')](handleEntityNotFound(_0x158a16,null))[_0x647d('0x2d')](function(_0x230c66){if(_0x230c66){var _0x18e818=_0x230c66['get']({'plain':!![]});fs['mkdirSync'](_0x29bfee);var _0x198329={'channel':'Whatsapp','account':_0x18e818[_0x647d('0xdb')][_0x647d('0x32')],'agent':_0x18e818[_0x647d('0xdc')]?_0x18e818[_0x647d('0xdc')][_0x647d('0xdd')]:'N.A.','createdAt':moment(_0x18e818[_0x647d('0x7b')])[_0x647d('0xc1')](_0x647d('0xde'))[_0x647d('0x9b')](),'closedAt':_0x18e818[_0x647d('0xdf')]?moment(_0x18e818[_0x647d('0xe0')])['format'](_0x647d('0xde'))[_0x647d('0x9b')]():'','disposition':_0x18e818[_0x647d('0xe1')],'messages':_(_0x18e818[_0x647d('0xd7')])[_0x647d('0x87')]({'secret':![]})[_0x647d('0x35')](function(_0x5dae01){if(_0x5dae01[_0x647d('0xd6')]){var _0x5832a5=path[_0x647d('0xcc')](_0x259050,_0x5dae01[_0x647d('0xd6')][_0x647d('0xe2')]);if(fs[_0x647d('0xe3')](_0x5832a5)){fs['createReadStream'](_0x5832a5)['pipe'](fs['createWriteStream'](path[_0x647d('0xcc')](_0x29bfee,_0x5dae01['Attachment'][_0x647d('0xe2')])));}}return{'date':moment(_0x5dae01[_0x647d('0x7b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x647d('0x9b')](),'sender':_0x5dae01[_0x647d('0xd8')]===_0x647d('0xe4')?_0x5dae01[_0x647d('0x72')]?_0x5dae01[_0x647d('0x72')][_0x647d('0xdd')]:_0x647d('0xe5'):_0x5dae01[_0x647d('0x69')][_0x647d('0xd4')]+(_0x5dae01['Contact'][_0x647d('0xd5')]?'\x20'+_0x5dae01[_0x647d('0x69')][_0x647d('0xd5')]:''),'body':_0x5dae01[_0x647d('0xd6')]?_0x5dae01['Attachment'][_0x647d('0xe2')]:_0x5dae01['body'],'direction':_0x5dae01[_0x647d('0xd8')]===_0x647d('0xe4')?'A':'C','secret':_0x5dae01[_0x647d('0xd9')],'read':_0x5dae01['read'],'attachment':_0x5dae01[_0x647d('0xd6')]};})['value']()};return ejs[_0x647d('0xe6')](path[_0x647d('0xcc')](config['root'],_0x647d('0xcd'),_0x647d('0xe7'),'downloadInteraction.ejs'),{'interaction':_0x198329})[_0x647d('0x2d')](function(_0x3346af){var _0x49824e=path['join'](_0x29bfee,_0x647d('0xe8')+_0x18e818['id']+'-'+_0x3759c5+'.pdf');var _0x5a8f8d={'path':_0x49824e,'channel':'Whatsapp','interactionId':_0x18e818['id']};return pdf[_0x647d('0xe9')](_0x3346af,_0x5a8f8d);})[_0x647d('0x2d')](function(){return new BPromise(function(_0x138db0,_0x349df8){zipdir(_0x29bfee,{'saveTo':_0x5c9947},function(_0x263399,_0x127e14){if(_0x263399)return _0x349df8(_0x263399);return _0x138db0(_0x127e14);});})[_0x647d('0x2d')](function(){return new BPromise(function(_0x14ce72,_0x4e7154){rimraf(_0x29bfee,function(_0x19907f){if(_0x19907f)_0x4e7154(_0x19907f);return _0x14ce72();});});})[_0x647d('0x2d')](function(){return _0x158a16[_0x647d('0xca')](_0x5c9947,_0x46b99d,function(_0x300743){if(_0x300743){console[_0x647d('0xea')](_0x647d('0xeb'),_0x300743);}else{fs[_0x647d('0xec')](_0x5c9947);}});});});}else{return _0x158a16[_0x647d('0xed')](0xc8);}})[_0x647d('0x39')](handleError(_0x158a16,null));}; \ No newline at end of file +var _0x99e9=['push','catch','map','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','tools_tags','expr','parseSearch','search','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','count','toString','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','all','rows','show','params','WhatsappInteraction','rawAttributes','includeAll','include','options','create','describe','addMessage','ids','getMessages','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','omit','color','emit','whatsappInteractionTags:save','removeTags','unix','root','server','join','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','createPdfFromHTML','download','log','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','forEach'];(function(_0x3af031,_0x4f1f80){var _0x5bc233=function(_0x852e2a){while(--_0x852e2a){_0x3af031['push'](_0x3af031['shift']());}};_0x5bc233(++_0x4f1f80);}(_0x99e9,0xb4));var _0x999e=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x99e9[_0xe45118];return _0x15e15d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999e('0x0'));var zipdir=require(_0x999e('0x1'));var jsonpatch=require(_0x999e('0x2'));var rp=require(_0x999e('0x3'));var moment=require('moment');var BPromise=require(_0x999e('0x4'));var Mustache=require(_0x999e('0x5'));var util=require(_0x999e('0x6'));var path=require('path');var sox=require(_0x999e('0x7'));var csv=require('to-csv');var ejs=require(_0x999e('0x8'));var fs=require('fs');var fs_extra=require(_0x999e('0x9'));var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0xe'));var querystring=require(_0x999e('0xf'));var Papa=require(_0x999e('0x10'));var Redis=require(_0x999e('0x11'));var authService=require(_0x999e('0x12'));var qs=require(_0x999e('0x13'));var as=require(_0x999e('0x14'));var pdf=require(_0x999e('0x15'));var hardwareService=require(_0x999e('0x16'));var logger=require(_0x999e('0x17'))(_0x999e('0x18'));var utils=require(_0x999e('0x19'));var config=require(_0x999e('0x1a'));var licenseUtil=require(_0x999e('0x1b'));var db=require(_0x999e('0x1c'))['db'];config['redis']=_[_0x999e('0x1d')](config['redis'],{'host':_0x999e('0x1e'),'port':0x18eb});var socket=require(_0x999e('0x1f'))(new Redis(config[_0x999e('0x20')]));require('./whatsappInteraction.socket')[_0x999e('0x21')](socket);function respondWithStatusCode(_0x4d1716,_0xa44e4c){_0xa44e4c=_0xa44e4c||0xcc;return function(_0x539598){if(_0x539598){return _0x4d1716['sendStatus'](_0xa44e4c);}return _0x4d1716[_0x999e('0x22')](_0xa44e4c)[_0x999e('0x23')]();};}function respondWithResult(_0x2dd5f4,_0x289e0e){_0x289e0e=_0x289e0e||0xc8;return function(_0x1e9bff){if(_0x1e9bff){return _0x2dd5f4[_0x999e('0x22')](_0x289e0e)['json'](_0x1e9bff);}};}function respondWithFilteredResult(_0x5bb27e,_0x4fcdfb){return function(_0x3153ce){if(_0x3153ce){var _0x43b09e=typeof _0x4fcdfb[_0x999e('0x24')]===_0x999e('0x25')&&typeof _0x4fcdfb[_0x999e('0x26')]===_0x999e('0x25');var _0x5af4c3=_0x3153ce['count'];var _0xc20d3e=_0x43b09e?0x0:_0x4fcdfb[_0x999e('0x24')];var _0x3b3642=_0x43b09e?_0x3153ce['count']:_0x4fcdfb[_0x999e('0x24')]+_0x4fcdfb[_0x999e('0x26')];var _0x3b73f0;if(_0x3b3642>=_0x5af4c3){_0x3b3642=_0x5af4c3;_0x3b73f0=0xc8;}else{_0x3b73f0=0xce;}_0x5bb27e[_0x999e('0x22')](_0x3b73f0);return _0x5bb27e[_0x999e('0x27')](_0x999e('0x28'),_0xc20d3e+'-'+_0x3b3642+'/'+_0x5af4c3)[_0x999e('0x29')](_0x3153ce);}return null;};}function patchUpdates(_0x4d4474){return function(_0x54ad83){try{jsonpatch[_0x999e('0x2a')](_0x54ad83,_0x4d4474,!![]);}catch(_0x4f0091){return BPromise['reject'](_0x4f0091);}return _0x54ad83[_0x999e('0x2b')]();};}function saveUpdates(_0xe324d8,_0x3f548e){return function(_0x13027c){if(_0x13027c){return _0x13027c[_0x999e('0x2c')](_0xe324d8)[_0x999e('0x2d')](function(_0x4f8406){return _0x4f8406;});}return null;};}function removeEntity(_0x2e1cc5,_0x4199ff){return function(_0x11068e){if(_0x11068e){return _0x11068e[_0x999e('0x2e')]()[_0x999e('0x2d')](function(){_0x2e1cc5[_0x999e('0x22')](0xcc)[_0x999e('0x23')]();});}};}function handleEntityNotFound(_0x5798f3,_0x28f803){return function(_0x5ba8b0){if(!_0x5ba8b0){_0x5798f3['sendStatus'](0x194);}return _0x5ba8b0;};}function handleError(_0x3dff6b,_0x1059bd){_0x1059bd=_0x1059bd||0x1f4;return function(_0x1f89f2){logger['error'](_0x1f89f2[_0x999e('0x2f')]);if(_0x1f89f2[_0x999e('0x30')]){delete _0x1f89f2[_0x999e('0x30')];}_0x3dff6b[_0x999e('0x22')](_0x1059bd)[_0x999e('0x31')](_0x1f89f2);};}function getInteractionUsers(_0x327079,_0x82e067){return new BPromise(function(_0x2e9b0e,_0x27102b){try{if(_0x82e067[_0x327079['id']]){_0x327079[_0x999e('0x32')]=_['map'](_0x82e067[_0x327079['id']],function(_0x1c8feb){return{'id':_0x1c8feb['id'],'fullname':_0x1c8feb[_0x999e('0x33')]};});}}catch(_0x371613){_0x27102b(_0x371613);}_0x2e9b0e(_0x327079);});}function getInteractionTags(_0x4c2ce8,_0x2ca5b8){return new BPromise(function(_0x5af72c,_0x5dce40){try{if(_0x4c2ce8[_0x999e('0x34')]){_0x4c2ce8[_0x999e('0x35')]=[];_0x4c2ce8['TagIds']['split'](',')[_0x999e('0x36')](function(_0x12eb93){_0x4c2ce8[_0x999e('0x35')][_0x999e('0x37')](_0x2ca5b8[_0x12eb93]);});}delete _0x4c2ce8['TagIds'];}catch(_0x2724be){_0x5dce40(_0x2724be);}_0x5af72c(_0x4c2ce8);});}function updateWhatsappInteraction(_0x41d6f1,_0x37f662,_0x30247a){return new BPromise(function(_0x4f861f,_0x4ebcb7){return getInteractionUsers(_0x41d6f1,_0x30247a)[_0x999e('0x2d')](function(_0x490694){return getInteractionTags(_0x490694,_0x37f662);})[_0x999e('0x2d')](function(_0x2fda68){_0x4f861f(_0x2fda68);})[_0x999e('0x38')](function(_0x14c9e0){_0x4ebcb7(_0x14c9e0);});});}exports['index']=function(_0xebda67,_0x28df26){var _0x5bd468={},_0x4808d1={},_0x327866={'count':0x0,'rows':[]};var _0x4aa98c=_[_0x999e('0x39')](db['WhatsappInteraction']['rawAttributes'],function(_0x504ac1){return{'name':_0x504ac1['fieldName'],'type':_0x504ac1[_0x999e('0x3a')]['key']};});_0x4808d1[_0x999e('0x3b')]=_['map'](_0x4aa98c,'name');_0x4808d1['query']=_[_0x999e('0x3c')](_0xebda67[_0x999e('0x3d')]);_0x4808d1[_0x999e('0x3e')]=_[_0x999e('0x3f')](_0x4808d1[_0x999e('0x3b')],_0x4808d1[_0x999e('0x3d')]);_0x5bd468[_0x999e('0x40')]=_[_0x999e('0x3f')](_0x4808d1['model'],qs[_0x999e('0x41')](_0xebda67[_0x999e('0x3d')][_0x999e('0x41')]));_0x5bd468[_0x999e('0x40')]=_0x5bd468['attributes'][_0x999e('0x42')]?_0x5bd468['attributes']:_0x4808d1[_0x999e('0x3b')];if(!_0xebda67[_0x999e('0x3d')][_0x999e('0x43')](_0x999e('0x44'))){_0x5bd468['limit']=qs[_0x999e('0x26')](_0xebda67[_0x999e('0x3d')][_0x999e('0x26')]);_0x5bd468['offset']=qs['offset'](_0xebda67[_0x999e('0x3d')][_0x999e('0x24')]);}_0x5bd468[_0x999e('0x45')]=qs[_0x999e('0x46')](_0xebda67[_0x999e('0x3d')][_0x999e('0x46')]);_0x5bd468[_0x999e('0x47')]=qs[_0x999e('0x3e')](_[_0x999e('0x48')](_0xebda67[_0x999e('0x3d')],_0x4808d1['filters']),_0x4aa98c);var _0x4c8b36=[];var _0xa5742d=squel[_0x999e('0x49')]()[_0x999e('0x4a')]('id')[_0x999e('0x4a')](_0x999e('0x30'))[_0x999e('0x4a')]('color')[_0x999e('0x4b')]('tools_tags');var _0x4caf56=squel[_0x999e('0x49')]()['field']('u.id')['field']('u.fullname')[_0x999e('0x4a')](_0x999e('0x4c'))['from'](_0x999e('0x4d'),'ui')[_0x999e('0x4e')](_0x999e('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x4b230d=squel[_0x999e('0x49')]()[_0x999e('0x4b')](_0x999e('0x50'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x999e('0x4f'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x999e('0x51'),'a',_0x999e('0x52'))['left_join'](_0x999e('0x53'),'me',_0x999e('0x54'))['left_join'](_0x999e('0x55'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x999e('0x4e')](_0x999e('0x56'),'t','t.id\x20=\x20it.TagId');var _0x210f1e=squel[_0x999e('0x57')]();var _0x4d5d16=[];var _0x56c6b2=squel[_0x999e('0x57')]();var _0x561fb4;if(_0xebda67['query']['search']){_0x561fb4=as[_0x999e('0x58')](_0xebda67[_0x999e('0x3d')][_0x999e('0x59')]);var _0x365d95=_0x561fb4[_0x999e('0x5a')];for(var _0x14c01c=0x0;_0x14c01c<_0x561fb4['conditions'][_0x999e('0x42')];_0x14c01c++){var _0x2317c5=_0x561fb4['conditions'][_0x14c01c];var _0x1e506f='i';var _0x384893=_[_0x999e('0x5b')](_0x4aa98c,[_0x999e('0x30'),_0x2317c5[_0x999e('0x4a')]]);if(!_0x384893){switch(_0x2317c5[_0x999e('0x4a')]){case _0x999e('0x5c'):if(_0x2317c5[_0x999e('0x5d')]==0x1){_0x4b230d[_0x999e('0x5e')]('`'+_0x2317c5['field']+_0x999e('0x5f'));}else{_0x4b230d[_0x999e('0x5e')]('`'+_0x2317c5[_0x999e('0x4a')]+_0x999e('0x60'));}break;case'Contact':if(_0x2317c5[_0x999e('0x61')]===_0x999e('0x62')){if(_0x2317c5[_0x999e('0x5d')][_0x999e('0x63')]('\x20')[_0x999e('0x42')]>0x1){_0x210f1e[_0x365d95](_0x999e('0x64'),qs[_0x999e('0x65')](_0x2317c5[_0x999e('0x5d')]),null);}else{var _0x4ecb26='%'+_0x2317c5['value']+'%';_0x210f1e[_0x365d95](_0x999e('0x66'),_0x4ecb26,_0x4ecb26,_0x4ecb26);}}else{_0x384893=_[_0x999e('0x5b')](_0x4aa98c,[_0x999e('0x30'),_0x999e('0x67')]);_0x2317c5[_0x999e('0x4a')]=_0x999e('0x67');_0x591c0f=as[_0x999e('0x68')](_0x1e506f,_0x384893['type'],_0x2317c5);_0x210f1e[_0x365d95](_0x591c0f['text'],_0x591c0f[_0x999e('0x5d')][_0x999e('0x69')],_0x591c0f[_0x999e('0x5d')][_0x999e('0x23')]);}break;case _0x999e('0x6a'):var _0x51b329=_0x2317c5[_0x999e('0x5d')][_0x999e('0x63')](',')[_0x999e('0x39')](function(_0x3c8ecf){return Number(_0x3c8ecf);});_0x51b329[_0x999e('0x36')](function(_0x434e13){_0x56c6b2['or'](_0x999e('0x6b'),'%,'+_0x434e13+',%');});_0x4d5d16=_['union'](_0x4d5d16,_0x51b329);break;case _0x999e('0x6c'):if(_0x2317c5['operator']===_0x999e('0x62')){_0x210f1e[_0x365d95](_0x999e('0x6d'),'%'+_0x2317c5[_0x999e('0x5d')]+'%',null);}else{_0x384893=_[_0x999e('0x5b')](_0x4aa98c,[_0x999e('0x30'),_0x999e('0x6e')]);_0x2317c5['field']=_0x999e('0x6e');_0x591c0f=as[_0x999e('0x68')](_0x1e506f,_0x384893[_0x999e('0x3a')],_0x2317c5);_0x210f1e[_0x365d95](_0x591c0f[_0x999e('0x6f')],_0x591c0f[_0x999e('0x5d')][_0x999e('0x69')],_0x591c0f[_0x999e('0x5d')][_0x999e('0x23')]);}break;case _0x999e('0x70'):_0x591c0f=as[_0x999e('0x68')]('me',null,_0x2317c5);_0x210f1e[_0x365d95](_0x591c0f[_0x999e('0x6f')],_0x591c0f[_0x999e('0x5d')][_0x999e('0x69')],_0x591c0f[_0x999e('0x5d')][_0x999e('0x23')]);break;}}else{var _0x591c0f=as[_0x999e('0x68')](_0x1e506f,_0x384893[_0x999e('0x3a')],_0x2317c5);_0x210f1e[_0x365d95](_0x591c0f[_0x999e('0x6f')],_0x591c0f[_0x999e('0x5d')]['start'],_0x591c0f['value'][_0x999e('0x23')]);}}}else{var _0x2d398f=_(_0xebda67[_0x999e('0x3d')])[_0x999e('0x3c')]()[_0x999e('0x39')](function(_0x19d934){return _[_0x999e('0x71')](_0x4aa98c,[_0x999e('0x30'),_0x19d934])?_0x19d934:undefined;})[_0x999e('0x72')]()['value']();if(!_[_0x999e('0x73')](_0x2d398f)){_0x2d398f['forEach'](function(_0x184b3e){if(_0x184b3e===_0x999e('0x74')){_0x4b230d['where'](_0x999e('0x75'),[][_0x999e('0x76')](_0xebda67[_0x999e('0x3d')][_0x184b3e]));}else if(_0x184b3e===_0x999e('0x77')){var _0x17beed=JSON['parse'](_0xebda67[_0x999e('0x3d')][_0x184b3e])[_0x999e('0x78')];var _0x56bc8c=JSON['parse'](_0xebda67['query'][_0x184b3e])[_0x999e('0x79')];_0x4b230d[_0x999e('0x47')](_0x999e('0x7a'),_0x17beed,_0x56bc8c);}else{if(_0xebda67[_0x999e('0x3d')][_0x184b3e]===_0x999e('0x7b')){_0x4b230d['where']('i.'+_0x184b3e+'\x20IS\x20NULL');}else{_0x4b230d['where']('i.'+_0x184b3e+_0x999e('0x7c'),_0xebda67['query'][_0x184b3e]);}}});}if(_0xebda67['query'][_0x999e('0x7d')]){if(_0xebda67['query'][_0x999e('0x7d')]==0x1){_0x4b230d[_0x999e('0x5e')](_0x999e('0x7e'));}else{_0x4b230d['having'](_0x999e('0x7f'));}}if(_0xebda67[_0x999e('0x3d')][_0x999e('0x80')]){_0x4d5d16=_[_0x999e('0x81')](_0xebda67[_0x999e('0x3d')][_0x999e('0x80')])?_0xebda67[_0x999e('0x3d')]['tag']:new Array(_0xebda67[_0x999e('0x3d')][_0x999e('0x80')]);_0x4d5d16[_0x999e('0x36')](function(_0x5781d2){_0x56c6b2['or'](_0x999e('0x6b'),'%,'+_0x5781d2+',%');});}if(_0xebda67[_0x999e('0x3d')]['filter']){var _0x2f893b=_0xebda67[_0x999e('0x3d')][_0x999e('0x82')][_0x999e('0x83')]('\x5c','\x5c\x5c')[_0x999e('0x83')](/'/g,'\x27\x27');if(qs[_0x999e('0x84')](_0x2f893b)){_0x210f1e['or'](_0x999e('0x85'),_0x2f893b+'%')['or'](_0x999e('0x86'),_0x2f893b+'%');}else{_0x210f1e['or'](_0x999e('0x87'),qs['getFullTextValue'](_0x2f893b))['or'](_0x999e('0x88'),_0x2f893b+'%');}}}_0x4b230d[_0x999e('0x47')](_0x210f1e);_0x4b230d[_0x999e('0x89')]('i.id');var _0x46365a={'type':db['Sequelize'][_0x999e('0x8a')][_0x999e('0x8b')],'raw':!![]};var _0x3a7596=_0x4b230d['clone']();_0x3a7596[_0x999e('0x4a')](_0x999e('0x8c'));_0x3a7596[_0x999e('0x4a')](_0x999e('0x8d'),_0x999e('0x5c'));if(_0x5bd468[_0x999e('0x45')]){_0x5bd468['order'][_0x999e('0x36')](function(_0x498e70){var _0x34f25c=_0x498e70[0x0]==='contactName'?_0x498e70[0x0]:'i.'+_0x498e70[0x0];_0x4b230d['order'](_0x34f25c,_0x498e70[0x1]===_0x999e('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x4d5d16)){_0x4b230d[_0x999e('0x5e')](_0x56c6b2);_0x3a7596[_0x999e('0x47')]('t.id\x20IN\x20?',_0x4d5d16);}BPromise[_0x999e('0x8f')]()[_0x999e('0x2d')](function(){if(!_0x561fb4){if(_0xebda67['query'][_0x999e('0x74')])return;_0x3a7596[_0x999e('0x47')](_0x999e('0x90'));_0x4b230d[_0x999e('0x47')](_0x999e('0x90'));return;}if(_0xebda67[_0x999e('0x91')][_0x999e('0x92')]!==_0x999e('0x93'))return;return _0xebda67['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x999e('0x2d')](function(_0x20da28){if(_[_0x999e('0x73')](_0x20da28)){_0x3a7596[_0x999e('0x47')](_0x999e('0x94'));_0x4b230d[_0x999e('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3a7596[_0x999e('0x47')](_0x999e('0x75'),_['map'](_0x20da28,'id'));_0x4b230d[_0x999e('0x47')](_0x999e('0x75'),_[_0x999e('0x39')](_0x20da28,'id'));}});})['then'](function(){if(_0xebda67[_0x999e('0x91')][_0x999e('0x92')]===_0x999e('0x93')&&!_0x561fb4&&!_0xebda67['query'][_0x999e('0x74')])return[];return db[_0x999e('0x95')][_0x999e('0x3d')](_0x3a7596['toString'](),_0x46365a);})['then'](function(_0x10a6f1){_0x327866['count']=_0x10a6f1[_0x999e('0x42')];if(_0x327866[_0x999e('0x96')]===0x0)return[];return db[_0x999e('0x95')][_0x999e('0x3d')](_0xa5742d[_0x999e('0x97')](),_0x46365a)[_0x999e('0x2d')](function(_0x43043a){_0x4c8b36=_['keyBy'](_0x43043a,'id');_0x46365a=_[_0x999e('0x98')](_0x46365a,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xebda67['query'][_0x999e('0x41')]){_0x5bd468[_0x999e('0x40')][_0x999e('0x36')](function(_0x302e73){_0x4b230d[_0x999e('0x4a')]('i.'+_0x302e73);});}else{_0x4b230d[_0x999e('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x999e('0x5c'));_0x4b230d['field'](_0x999e('0x99'),_0x999e('0x9a'));_0x4b230d[_0x999e('0x4a')]('a.mandatoryDisposition',_0x999e('0x9b'));_0x4b230d['field'](_0x999e('0x9c'),_0x999e('0x9d'));_0x4b230d[_0x999e('0x4a')](_0x999e('0x9e'));_0x4b230d[_0x999e('0x4a')]('c.firstName','Contact.firstName');_0x4b230d[_0x999e('0x4a')](_0x999e('0x9f'),_0x999e('0xa0'));_0x4b230d[_0x999e('0x4a')](_0x999e('0xa1'),_0x999e('0xa2'));_0x4b230d[_0x999e('0x4a')](_0x999e('0xa3'),'Contact.phone');_0x4b230d[_0x999e('0x4a')](_0x999e('0xa4'),_0x999e('0xa5'));_0x4b230d[_0x999e('0x4a')](_0x999e('0xa6'),_0x999e('0xa7'));_0x4b230d[_0x999e('0x4a')](_0x999e('0xa8'),'Owner.fullname');_0x4b230d[_0x999e('0x4a')](_0x999e('0xa9'),_0x999e('0xaa'));_0x4b230d[_0x999e('0x4a')](_0x999e('0xab'),_0x999e('0x34'));}if(_0x5bd468[_0x999e('0x26')])_0x4b230d[_0x999e('0x26')](_0x5bd468['limit']);if(_0x5bd468[_0x999e('0x24')])_0x4b230d[_0x999e('0x24')](_0x5bd468[_0x999e('0x24')]);return db['sequelize'][_0x999e('0x3d')](_0x4b230d[_0x999e('0x97')](),_0x46365a);})[_0x999e('0x2d')](function(_0x2cd575){if(_0x2cd575[_0x999e('0x42')]>0x0)_0x4caf56[_0x999e('0x47')](_0x999e('0xac'),_[_0x999e('0x39')](_0x2cd575,'id'));return db[_0x999e('0x95')]['query'](_0x4caf56[_0x999e('0x97')](),_0x46365a)[_0x999e('0x2d')](function(_0x412d20){var _0x4a827a=_['groupBy'](_0x412d20,_0x999e('0xad'));var _0xd2178f=[];_0x2cd575[_0x999e('0x36')](function(_0x544755){_0xd2178f[_0x999e('0x37')](updateWhatsappInteraction(_0x544755,_0x4c8b36,_0x4a827a));});return BPromise[_0x999e('0xae')](_0xd2178f);});});})[_0x999e('0x2d')](function(_0x47fbb8){_0x327866[_0x999e('0xaf')]=_0x47fbb8;return _0x327866;})[_0x999e('0x2d')](respondWithFilteredResult(_0x28df26,_0x5bd468))['catch'](handleError(_0x28df26,null));};exports[_0x999e('0xb0')]=function(_0x5ac17e,_0x4cbe1d){var _0xddffa3={'raw':![],'where':{'id':_0x5ac17e[_0x999e('0xb1')]['id']}},_0x7026bb={};_0x7026bb[_0x999e('0x3b')]=_['keys'](db[_0x999e('0xb2')][_0x999e('0xb3')]);_0x7026bb[_0x999e('0x3d')]=_[_0x999e('0x3c')](_0x5ac17e[_0x999e('0x3d')]);_0x7026bb['filters']=_[_0x999e('0x3f')](_0x7026bb[_0x999e('0x3b')],_0x7026bb[_0x999e('0x3d')]);_0xddffa3['attributes']=_[_0x999e('0x3f')](_0x7026bb[_0x999e('0x3b')],qs[_0x999e('0x41')](_0x5ac17e[_0x999e('0x3d')][_0x999e('0x41')]));_0xddffa3[_0x999e('0x40')]=_0xddffa3[_0x999e('0x40')][_0x999e('0x42')]?_0xddffa3['attributes']:_0x7026bb[_0x999e('0x3b')];if(_0x5ac17e[_0x999e('0x3d')][_0x999e('0xb4')]){_0xddffa3[_0x999e('0xb5')]=[{'all':!![]}];}_0xddffa3=_['merge']({},_0xddffa3,_0x5ac17e[_0x999e('0xb6')]);return db[_0x999e('0xb2')][_0x999e('0x5b')](_0xddffa3)[_0x999e('0x2d')](handleEntityNotFound(_0x4cbe1d,null))[_0x999e('0x2d')](respondWithResult(_0x4cbe1d,null))['catch'](handleError(_0x4cbe1d,null));};exports[_0x999e('0xb7')]=function(_0x158137,_0x1e7bbf){return db[_0x999e('0xb2')][_0x999e('0xb7')](_0x158137[_0x999e('0x70')],{})['then'](respondWithResult(_0x1e7bbf,0xc9))['catch'](handleError(_0x1e7bbf,null));};exports[_0x999e('0x2c')]=function(_0x1bbb83,_0x57a547){if(_0x1bbb83[_0x999e('0x70')]['id']){delete _0x1bbb83[_0x999e('0x70')]['id'];}return db['WhatsappInteraction'][_0x999e('0x5b')]({'where':{'id':_0x1bbb83[_0x999e('0xb1')]['id']}})[_0x999e('0x2d')](handleEntityNotFound(_0x57a547,null))[_0x999e('0x2d')](saveUpdates(_0x1bbb83[_0x999e('0x70')],null))['then'](respondWithResult(_0x57a547,null))[_0x999e('0x38')](handleError(_0x57a547,null));};exports[_0x999e('0x2e')]=function(_0x2e86ac,_0xc4a2f1){return db[_0x999e('0xb2')][_0x999e('0x5b')]({'where':{'id':_0x2e86ac[_0x999e('0xb1')]['id']}})['then'](handleEntityNotFound(_0xc4a2f1,null))[_0x999e('0x2d')](removeEntity(_0xc4a2f1,null))['catch'](handleError(_0xc4a2f1,null));};exports[_0x999e('0xb8')]=function(_0xd93cfb,_0x2c9520){return db[_0x999e('0xb2')][_0x999e('0xb8')]()[_0x999e('0x2d')](respondWithResult(_0x2c9520,null))[_0x999e('0x38')](handleError(_0x2c9520,null));};exports[_0x999e('0xb9')]=function(_0x38238b,_0x5a0e84,_0x1bbe31){return db['WhatsappMessage'][_0x999e('0x5b')]({'where':{'id':_0x38238b['params']['id']}})[_0x999e('0x2d')](handleEntityNotFound(_0x5a0e84,null))['then'](function(_0x578c6b){if(_0x578c6b){return _0x578c6b[_0x999e('0xb9')](_0x38238b[_0x999e('0x70')]['ids'],_['omit'](_0x38238b[_0x999e('0x70')],[_0x999e('0xba'),'id'])||{});}})[_0x999e('0x2d')](respondWithResult(_0x5a0e84,null))[_0x999e('0x38')](handleError(_0x5a0e84,null));};exports[_0x999e('0xbb')]=function(_0x5911b1,_0x40d209,_0x509521){var _0x1c290f={'raw':![],'where':{}};var _0x6664f7={};var _0x2f96e2={'count':0x0,'rows':[]};return db[_0x999e('0xb2')]['findOne']({'where':{'id':_0x5911b1[_0x999e('0xb1')]['id']}})[_0x999e('0x2d')](handleEntityNotFound(_0x40d209,null))[_0x999e('0x2d')](function(_0x44ad79){if(_0x44ad79){_0x6664f7[_0x999e('0x3b')]=_[_0x999e('0x3c')](db[_0x999e('0xbc')][_0x999e('0xb3')]);_0x6664f7[_0x999e('0x3d')]=_['keys'](_0x5911b1[_0x999e('0x3d')]);_0x6664f7[_0x999e('0x3e')]=_[_0x999e('0x3f')](_0x6664f7[_0x999e('0x3b')],_0x6664f7[_0x999e('0x3d')]);_0x1c290f[_0x999e('0x40')]=_[_0x999e('0x3f')](_0x6664f7[_0x999e('0x3b')],qs['fields'](_0x5911b1[_0x999e('0x3d')]['fields']));_0x1c290f[_0x999e('0x40')]=_0x1c290f[_0x999e('0x40')]['length']?_0x1c290f[_0x999e('0x40')]:_0x6664f7[_0x999e('0x3b')];if(!_0x5911b1[_0x999e('0x3d')][_0x999e('0x43')](_0x999e('0x44'))){_0x1c290f['limit']=qs[_0x999e('0x26')](_0x5911b1['query']['limit']);_0x1c290f[_0x999e('0x24')]=qs[_0x999e('0x24')](_0x5911b1[_0x999e('0x3d')]['offset']);}_0x1c290f[_0x999e('0x45')]=qs[_0x999e('0x46')](_0x5911b1[_0x999e('0x3d')][_0x999e('0x46')]);_0x1c290f[_0x999e('0x47')]=qs[_0x999e('0x3e')](_[_0x999e('0x48')](_0x5911b1['query'],_0x6664f7[_0x999e('0x3e')]));_0x1c290f[_0x999e('0x47')]['WhatsappInteractionId']=_0x44ad79['id'];if(_0x5911b1[_0x999e('0x3d')]['filter']){_0x1c290f[_0x999e('0x47')]=_[_0x999e('0x98')](_0x1c290f['where'],{'$or':_['map'](_0x1c290f['attributes'],function(_0x4ef767){var _0x48d217={};_0x48d217[_0x4ef767]={'$like':'%'+_0x5911b1['query'][_0x999e('0x82')]+'%'};return _0x48d217;})});}if(_0x5911b1[_0x999e('0x3d')][_0x999e('0x78')]){var _0x1b1716=_0x5911b1[_0x999e('0x3d')][_0x999e('0x78')][_0x999e('0x63')](',');var _0x308833={};_0x308833[_0x1b1716[0x0]]={'$gte':moment(_0x1b1716[0x1])[_0x999e('0xbd')](_0x999e('0xbe'))};_0x1c290f['where']=_[_0x999e('0x98')](_0x1c290f[_0x999e('0x47')],_0x308833);}_0x1c290f=_[_0x999e('0x98')]({},_0x1c290f,_0x5911b1[_0x999e('0xb6')]);return db[_0x999e('0xbc')][_0x999e('0x96')]({'where':_0x1c290f[_0x999e('0x47')]})[_0x999e('0x2d')](function(_0x3ba75b){_0x2f96e2[_0x999e('0x96')]=_0x3ba75b;if(_0x5911b1[_0x999e('0x3d')][_0x999e('0xb4')]){_0x1c290f[_0x999e('0xb5')]=[{'all':!![]}];}return db[_0x999e('0xbc')][_0x999e('0xbf')](_0x1c290f);})[_0x999e('0x2d')](function(_0x513bae){_0x2f96e2[_0x999e('0xaf')]=_0x513bae;return _0x2f96e2;});}})['then'](respondWithFilteredResult(_0x40d209,_0x1c290f))['catch'](handleError(_0x40d209,null));};exports[_0x999e('0xc0')]=function(_0x57b0a4,_0x459142,_0x4a5905){return db[_0x999e('0xb2')]['find']({'where':{'id':_0x57b0a4[_0x999e('0xb1')]['id']}})['then'](handleEntityNotFound(_0x459142,null))[_0x999e('0x2d')](function(_0x26849d){if(_0x26849d){return _0x26849d['setTags'](_0x57b0a4['body']['ids'],_[_0x999e('0xc1')](_0x57b0a4[_0x999e('0x70')],[_0x999e('0xba'),'id'])||{})['spread'](function(){return db['Tag'][_0x999e('0xbf')]({'attributes':['id','name',_0x999e('0xc2')],'where':{'id':_0x57b0a4[_0x999e('0x70')][_0x999e('0xba')]}});})[_0x999e('0x2d')](function(_0xbd5ef4){socket[_0x999e('0xc3')](_0x999e('0xc4'),{'id':Number(_0x57b0a4[_0x999e('0xb1')]['id']),'tags':_0xbd5ef4||[]});return{'id':Number(_0x57b0a4[_0x999e('0xb1')]['id']),'tags':_0xbd5ef4||[]};});}})[_0x999e('0x2d')](respondWithResult(_0x459142,null))['catch'](handleError(_0x459142,null));};exports[_0x999e('0xc5')]=function(_0x50c1f2,_0x916b94,_0x3109ac){return db['WhatsappInteraction'][_0x999e('0x5b')]({'where':{'id':_0x50c1f2[_0x999e('0xb1')]['id']}})[_0x999e('0x2d')](handleEntityNotFound(_0x916b94,null))[_0x999e('0x2d')](function(_0x5ddc92){if(_0x5ddc92){return _0x5ddc92[_0x999e('0xc5')](_0x50c1f2[_0x999e('0x3d')][_0x999e('0xba')]);}})[_0x999e('0x2d')](respondWithStatusCode(_0x916b94,null))['catch'](handleError(_0x916b94,null));};exports['download']=function(_0x319e16,_0xf06a7e){var _0x45ee5f=moment()[_0x999e('0xc6')]()[_0x999e('0x97')]();var _0x2e9dd0=path['join'](config[_0x999e('0xc7')],_0x999e('0xc8'),'files','tmp');var _0x1aefcc=path[_0x999e('0xc9')](config[_0x999e('0xc7')],'server',_0x999e('0xca'),_0x999e('0xcb'));var _0x3aa0f5=path[_0x999e('0xc9')](_0x2e9dd0,_0x45ee5f);var _0x53274d=util[_0x999e('0xbd')](_0x999e('0xcc'),_0x319e16[_0x999e('0xb1')]['id'],_0x45ee5f);var _0x5a04d3=path['join'](_0x2e9dd0,_0x53274d);var _0x5bddbe=[];_0x5bddbe[_0x999e('0x37')]({'model':db['User'],'as':_0x999e('0x6c'),'attributes':['id',_0x999e('0x33')],'raw':!![]});_0x5bddbe[_0x999e('0x37')]({'model':db[_0x999e('0xcd')],'as':_0x999e('0xce'),'attributes':['id',_0x999e('0xcf'),_0x999e('0xd0')],'raw':!![]});if(_0x319e16[_0x999e('0x3d')]['attachments']){_0x5bddbe['push']({'model':db[_0x999e('0xd1')],'as':_0x999e('0xd1'),'raw':!![]});}var _0x56c388=[{'model':db[_0x999e('0xbc')],'as':'Messages','attributes':['id','body',_0x999e('0x77'),_0x999e('0xd2'),_0x999e('0xd3'),_0x999e('0x7d')],'include':_0x5bddbe}];_0x56c388[_0x999e('0x37')]({'model':db[_0x999e('0xd4')],'as':_0x999e('0xd5'),'attributes':['id',_0x999e('0x30')]});_0x56c388[_0x999e('0x37')]({'model':db[_0x999e('0x6c')],'as':_0x999e('0xd6'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x999e('0x5b')]({'where':{'id':_0x319e16[_0x999e('0xb1')]['id']},'include':_0x56c388})['then'](handleEntityNotFound(_0xf06a7e,null))[_0x999e('0x2d')](function(_0x4db96d){if(_0x4db96d){var _0x437a8a=_0x4db96d[_0x999e('0xd7')]({'plain':!![]});fs[_0x999e('0xd8')](_0x3aa0f5);var _0x4f8de5={'channel':_0x999e('0xd9'),'account':_0x437a8a[_0x999e('0xd5')][_0x999e('0x30')],'agent':_0x437a8a[_0x999e('0xd6')]?_0x437a8a[_0x999e('0xd6')]['fullname']:'N.A.','createdAt':moment(_0x437a8a[_0x999e('0x77')])[_0x999e('0xbd')](_0x999e('0xbe'))[_0x999e('0x97')](),'closedAt':_0x437a8a[_0x999e('0xda')]?moment(_0x437a8a[_0x999e('0xdb')])[_0x999e('0xbd')](_0x999e('0xbe'))['toString']():'','disposition':_0x437a8a[_0x999e('0xdc')],'messages':_(_0x437a8a[_0x999e('0xdd')])[_0x999e('0x82')]({'secret':![]})[_0x999e('0x39')](function(_0x24bfd1){if(_0x24bfd1[_0x999e('0xd1')]){var _0x57529d=path['join'](_0x1aefcc,_0x24bfd1[_0x999e('0xd1')][_0x999e('0xde')]);if(fs[_0x999e('0xdf')](_0x57529d)){fs[_0x999e('0xe0')](_0x57529d)[_0x999e('0xe1')](fs[_0x999e('0xe2')](path[_0x999e('0xc9')](_0x3aa0f5,_0x24bfd1[_0x999e('0xd1')][_0x999e('0xde')])));}}return{'date':moment(_0x24bfd1[_0x999e('0x77')])[_0x999e('0xbd')](_0x999e('0xbe'))[_0x999e('0x97')](),'sender':_0x24bfd1['direction']===_0x999e('0xe3')?_0x24bfd1[_0x999e('0x6c')]?_0x24bfd1['User'][_0x999e('0x33')]:_0x999e('0xe4'):_0x24bfd1[_0x999e('0xce')][_0x999e('0xcf')]+(_0x24bfd1[_0x999e('0xce')][_0x999e('0xd0')]?'\x20'+_0x24bfd1[_0x999e('0xce')][_0x999e('0xd0')]:''),'body':_0x24bfd1['Attachment']?_0x24bfd1[_0x999e('0xd1')][_0x999e('0xde')]:_0x24bfd1['body'],'direction':_0x24bfd1[_0x999e('0xd2')]===_0x999e('0xe3')?'A':'C','secret':_0x24bfd1[_0x999e('0xd3')],'read':_0x24bfd1[_0x999e('0x7d')],'attachment':_0x24bfd1['Attachment']};})['value']()};return ejs[_0x999e('0xe5')](path[_0x999e('0xc9')](config[_0x999e('0xc7')],_0x999e('0xc8'),'views','downloadInteraction.ejs'),{'interaction':_0x4f8de5})[_0x999e('0x2d')](function(_0x4ac5df){var _0x5ce3ae=path[_0x999e('0xc9')](_0x3aa0f5,'transcript-'+_0x437a8a['id']+'-'+_0x45ee5f+'.pdf');var _0x828ac8={'path':_0x5ce3ae,'channel':'Whatsapp','interactionId':_0x437a8a['id']};return pdf[_0x999e('0xe6')](_0x4ac5df,_0x828ac8);})[_0x999e('0x2d')](function(){return new BPromise(function(_0x21d7be,_0x4431e3){zipdir(_0x3aa0f5,{'saveTo':_0x5a04d3},function(_0x160d1e,_0x5796dd){if(_0x160d1e)return _0x4431e3(_0x160d1e);return _0x21d7be(_0x5796dd);});})[_0x999e('0x2d')](function(){return new BPromise(function(_0x512c7d,_0xc86148){rimraf(_0x3aa0f5,function(_0xcd43be){if(_0xcd43be)_0xc86148(_0xcd43be);return _0x512c7d();});});})[_0x999e('0x2d')](function(){return _0xf06a7e[_0x999e('0xe7')](_0x5a04d3,_0x53274d,function(_0x368df0){if(_0x368df0){console[_0x999e('0xe8')]('err',_0x368df0);}else{fs[_0x999e('0xe9')](_0x5a04d3);}});});});}else{return _0xf06a7e[_0x999e('0xea')](0xc8);}})[_0x999e('0x38')](handleError(_0xf06a7e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 58357b5..b6c80e2 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1094=['catch','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','length','emit'];(function(_0x891c55,_0x233fe8){var _0x260823=function(_0x1e3f67){while(--_0x1e3f67){_0x891c55['push'](_0x891c55['shift']());}};_0x260823(++_0x233fe8);}(_0x1094,0x143));var _0x4109=function(_0x87d3ec,_0x387888){_0x87d3ec=_0x87d3ec-0x0;var _0x5f3f6f=_0x1094[_0x87d3ec];return _0x5f3f6f;};'use strict';var EventEmitter=require(_0x4109('0x0'));var WhatsappInteraction=require(_0x4109('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x4109('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4109('0x2')](0x0);var events={'afterCreate':_0x4109('0x3'),'afterUpdate':_0x4109('0x4'),'afterDestroy':_0x4109('0x5')};function emitEvent(_0x36e917){return function(_0x5684ce,_0x1cf079,_0x12fdda){_0x5684ce[_0x4109('0x6')]({'attributes':['id'],'raw':!![]})[_0x4109('0x7')](function(_0xd2df16){_0x5684ce[_0x4109('0x8')]('Users',_0xd2df16[_0x4109('0x9')](function(_0x175d5e){return{'id':_0x175d5e['id']};}));return WhatsappMessage[_0x4109('0xa')]({'where':{'WhatsappInteractionId':_0x5684ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4109('0x7')](function(_0x1b7798){_0x5684ce['setDataValue']('unreadMessages',_0x1b7798[_0x4109('0xb')]);WhatsappInteractionEvents['emit'](_0x36e917+':'+_0x5684ce['id'],_0x5684ce);WhatsappInteractionEvents[_0x4109('0xc')](_0x36e917,_0x5684ce);_0x12fdda(null);})[_0x4109('0xd')](_0x12fdda(null));};}for(var e in events){if(events[_0x4109('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x4109('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x22dd=['Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x5487a0,_0x1500b5){var _0x132bb6=function(_0x34bf9f){while(--_0x34bf9f){_0x5487a0['push'](_0x5487a0['shift']());}};_0x132bb6(++_0x1500b5);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd22d('0x0'));var WhatsappInteraction=require(_0xd22d('0x1'))['db'][_0xd22d('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd22d('0x3')](0x0);var events={'afterCreate':_0xd22d('0x4'),'afterUpdate':_0xd22d('0x5'),'afterDestroy':_0xd22d('0x6')};function emitEvent(_0x26e4ba){return function(_0x1c5cb2,_0x135142,_0x2df700){_0x1c5cb2[_0xd22d('0x7')]({'attributes':['id'],'raw':!![]})[_0xd22d('0x8')](function(_0x4de374){_0x1c5cb2[_0xd22d('0x9')](_0xd22d('0xa'),_0x4de374['map'](function(_0xa5b71a){return{'id':_0xa5b71a['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1c5cb2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd22d('0x8')](function(_0x570b8e){_0x1c5cb2[_0xd22d('0x9')](_0xd22d('0xb'),_0x570b8e[_0xd22d('0xc')]);WhatsappInteractionEvents[_0xd22d('0xd')](_0x26e4ba+':'+_0x1c5cb2['id'],_0x1c5cb2);WhatsappInteractionEvents[_0xd22d('0xd')](_0x26e4ba,_0x1c5cb2);_0x2df700(null);})[_0xd22d('0xe')](_0x2df700(null));};}for(var e in events){if(events[_0xd22d('0xf')](e)){var event=events[e];WhatsappInteraction[_0xd22d('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8c7febd..c37bdb0 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27c4=['changed','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','whatsapp_interactions'];(function(_0x1b52fa,_0x20c6f6){var _0x533054=function(_0xbf7694){while(--_0xbf7694){_0x1b52fa['push'](_0x1b52fa['shift']());}};_0x533054(++_0x20c6f6);}(_0x27c4,0x189));var _0x427c=function(_0x548434,_0x146f6f){_0x548434=_0x548434-0x0;var _0x433948=_0x27c4[_0x548434];return _0x433948;};'use strict';var _=require('lodash');var util=require(_0x427c('0x0'));var logger=require('../../config/logger')(_0x427c('0x1'));var moment=require(_0x427c('0x2'));var BPromise=require(_0x427c('0x3'));var rp=require(_0x427c('0x4'));var fs=require('fs');var path=require(_0x427c('0x5'));var rimraf=require(_0x427c('0x6'));var config=require(_0x427c('0x7'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x7b7914,_0x4b0f93){return _0x7b7914[_0x427c('0x8')]('WhatsappInteraction',attributes,{'tableName':_0x427c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x388629,_0x50a200,_0x2ee123){if(_0x388629[_0x427c('0xa')]('closed')){_0x388629['closedAt']=moment()[_0x427c('0xb')](_0x427c('0xc'));}_0x2ee123(null,_0x388629);}}});}; \ No newline at end of file +var _0xcff3=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xb0e555,_0x4826df){var _0x1ffc25=function(_0x56a555){while(--_0x56a555){_0xb0e555['push'](_0xb0e555['shift']());}};_0x1ffc25(++_0x4826df);}(_0xcff3,0x126));var _0x3cff=function(_0x5a77fb,_0x2d2d59){_0x5a77fb=_0x5a77fb-0x0;var _0x6ca4fb=_0xcff3[_0x5a77fb];return _0x6ca4fb;};'use strict';var _=require(_0x3cff('0x0'));var util=require(_0x3cff('0x1'));var logger=require(_0x3cff('0x2'))(_0x3cff('0x3'));var moment=require(_0x3cff('0x4'));var BPromise=require('bluebird');var rp=require(_0x3cff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3cff('0x6'));var attributes=require(_0x3cff('0x7'));module[_0x3cff('0x8')]=function(_0x56c9f2,_0x5535ee){return _0x56c9f2[_0x3cff('0x9')](_0x3cff('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e4a11,_0x16381b,_0x12e1f2){if(_0x1e4a11['changed'](_0x3cff('0xb'))){_0x1e4a11[_0x3cff('0xc')]=moment()['format'](_0x3cff('0xd'));}_0x12e1f2(null,_0x1e4a11);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4717ef2..1766ee5 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5a7=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','body','options','raw','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','where','ids','spread','AddTags','lodash'];(function(_0x579121,_0x27e9e2){var _0x38a4ae=function(_0x53e154){while(--_0x53e154){_0x579121['push'](_0x579121['shift']());}};_0x38a4ae(++_0x27e9e2);}(_0xb5a7,0x18f));var _0x7b5a=function(_0x3401d8,_0x4aca97){_0x3401d8=_0x3401d8-0x0;var _0x5791b4=_0xb5a7[_0x3401d8];return _0x5791b4;};'use strict';var _=require(_0x7b5a('0x0'));var util=require(_0x7b5a('0x1'));var moment=require('moment');var BPromise=require(_0x7b5a('0x2'));var rs=require(_0x7b5a('0x3'));var fs=require('fs');var Redis=require(_0x7b5a('0x4'));var db=require(_0x7b5a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b5a('0x6'))(_0x7b5a('0x7'));var config=require(_0x7b5a('0x8'));var jayson=require(_0x7b5a('0x9'));var client=jayson[_0x7b5a('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7b5a('0xb')](config[_0x7b5a('0xc')],{'host':_0x7b5a('0xd'),'port':0x18eb});var socket=require(_0x7b5a('0xe'))(new Redis(config[_0x7b5a('0xc')]));require(_0x7b5a('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d0a11,_0x52e47f,_0x2c73c4){return new BPromise(function(_0x25d246,_0x23fdd9){return client['request'](_0x5d0a11,_0x2c73c4)[_0x7b5a('0x10')](function(_0x5790f3){logger[_0x7b5a('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x52e47f,_0x7b5a('0x12'));logger[_0x7b5a('0x13')](_0x7b5a('0x14'),_0x52e47f,_0x7b5a('0x12'),JSON[_0x7b5a('0x15')](_0x5790f3));if(_0x5790f3[_0x7b5a('0x16')]){if(_0x5790f3['error'][_0x7b5a('0x17')]===0x1f4){logger[_0x7b5a('0x16')](_0x7b5a('0x18'),_0x52e47f,_0x5790f3['error'][_0x7b5a('0x19')]);return _0x23fdd9(_0x5790f3[_0x7b5a('0x16')][_0x7b5a('0x19')]);}logger[_0x7b5a('0x16')](_0x7b5a('0x18'),_0x52e47f,_0x5790f3[_0x7b5a('0x16')][_0x7b5a('0x19')]);return _0x25d246(_0x5790f3['error'][_0x7b5a('0x19')]);}else{logger[_0x7b5a('0x11')](_0x7b5a('0x18'),_0x52e47f,_0x7b5a('0x12'));_0x25d246(_0x5790f3[_0x7b5a('0x1a')]['message']);}})[_0x7b5a('0x1b')](function(_0x1a6e5f){logger[_0x7b5a('0x16')](_0x7b5a('0x18'),_0x52e47f,_0x1a6e5f);_0x23fdd9(_0x1a6e5f);});});}exports['UpdateWhatsappInteraction']=function(_0xfbc04a){var _0x4baa07=this;return new Promise(function(_0x3ecea8,_0x56e98b){return db['WhatsappInteraction']['update'](_0xfbc04a[_0x7b5a('0x1c')],{'raw':_0xfbc04a[_0x7b5a('0x1d')]?_0xfbc04a[_0x7b5a('0x1d')][_0x7b5a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfbc04a[_0x7b5a('0x1d')]?_0xfbc04a[_0x7b5a('0x1d')]['where']||null:null,'attributes':_0xfbc04a['options']?_0xfbc04a['options'][_0x7b5a('0x1f')]||null:null,'limit':_0xfbc04a[_0x7b5a('0x1d')]?_0xfbc04a[_0x7b5a('0x1d')][_0x7b5a('0x20')]||null:null})['then'](function(_0x1fb9da){logger[_0x7b5a('0x11')]('UpdateWhatsappInteraction',_0xfbc04a);logger[_0x7b5a('0x13')]('UpdateWhatsappInteraction',_0xfbc04a,JSON[_0x7b5a('0x15')](_0x1fb9da));_0x3ecea8(_0x1fb9da);})['catch'](function(_0x44e740){logger[_0x7b5a('0x16')](_0x7b5a('0x21'),_0x44e740[_0x7b5a('0x19')],_0xfbc04a);_0x56e98b(_0x4baa07['error'](0x1f4,_0x44e740['message']));});});};exports[_0x7b5a('0x22')]=function(_0x47ae30){return new Promise(function(_0x162eba,_0x570e38){return db[_0x7b5a('0x23')]['find']({'where':_0x47ae30['options']?_0x47ae30[_0x7b5a('0x1d')][_0x7b5a('0x24')]||null:null})[_0x7b5a('0x10')](function(_0x24436a){if(_0x24436a){return _0x24436a['addTags'](_0x47ae30[_0x7b5a('0x1c')][_0x7b5a('0x25')],_['omit'](_0x47ae30['body'],['ids','id'])||{});}})[_0x7b5a('0x26')](function(_0x34184b){logger[_0x7b5a('0x11')](_0x7b5a('0x27'),_0x47ae30);logger['debug']('AddTags',_0x47ae30,JSON[_0x7b5a('0x15')](_0x34184b));_0x162eba(_0x34184b);})['catch'](function(_0x461714){logger[_0x7b5a('0x16')](_0x7b5a('0x27'),_0x461714[_0x7b5a('0x19')],_0x47ae30);_0x570e38(_this[_0x7b5a('0x16')](0x1f4,_0x461714[_0x7b5a('0x19')]));});});}; \ No newline at end of file +var _0x624a=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','debug','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x2ee7e1,_0x519111){var _0x587ea7=function(_0xd2e098){while(--_0xd2e098){_0x2ee7e1['push'](_0x2ee7e1['shift']());}};_0x587ea7(++_0x519111);}(_0x624a,0x1e6));var _0xa624=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0x624a[_0x3ea022];return _0x3b97a2;};'use strict';var _=require(_0xa624('0x0'));var util=require('util');var moment=require(_0xa624('0x1'));var BPromise=require('bluebird');var rs=require(_0xa624('0x2'));var fs=require('fs');var Redis=require(_0xa624('0x3'));var db=require(_0xa624('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa624('0x5'))(_0xa624('0x6'));var config=require(_0xa624('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa624('0x8')][_0xa624('0x9')]({'port':0x232a});config['redis']=_[_0xa624('0xa')](config[_0xa624('0xb')],{'host':_0xa624('0xc'),'port':0x18eb});var socket=require(_0xa624('0xd'))(new Redis(config[_0xa624('0xb')]));require('./whatsappInteraction.socket')[_0xa624('0xe')](socket);function respondWithRpcPromise(_0x4ede51,_0x2f5e8c,_0x50200d){return new BPromise(function(_0x2b1c07,_0x49deab){return client[_0xa624('0xf')](_0x4ede51,_0x50200d)[_0xa624('0x10')](function(_0x98a872){logger[_0xa624('0x11')](_0xa624('0x12'),_0x2f5e8c,_0xa624('0x13'));logger['debug'](_0xa624('0x14'),_0x2f5e8c,_0xa624('0x13'),JSON[_0xa624('0x15')](_0x98a872));if(_0x98a872['error']){if(_0x98a872[_0xa624('0x16')][_0xa624('0x17')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x2f5e8c,_0x98a872[_0xa624('0x16')][_0xa624('0x18')]);return _0x49deab(_0x98a872[_0xa624('0x16')][_0xa624('0x18')]);}logger[_0xa624('0x16')](_0xa624('0x12'),_0x2f5e8c,_0x98a872['error'][_0xa624('0x18')]);return _0x2b1c07(_0x98a872[_0xa624('0x16')]['message']);}else{logger[_0xa624('0x11')](_0xa624('0x12'),_0x2f5e8c,'request\x20sent');_0x2b1c07(_0x98a872[_0xa624('0x19')][_0xa624('0x18')]);}})[_0xa624('0x1a')](function(_0x36eb67){logger[_0xa624('0x16')](_0xa624('0x12'),_0x2f5e8c,_0x36eb67);_0x49deab(_0x36eb67);});});}exports[_0xa624('0x1b')]=function(_0x49f94c){var _0x2c18c5=this;return new Promise(function(_0x2b797e,_0x504e27){return db[_0xa624('0x1c')]['update'](_0x49f94c[_0xa624('0x1d')],{'raw':_0x49f94c[_0xa624('0x1e')]?_0x49f94c['options'][_0xa624('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49f94c[_0xa624('0x1e')]?_0x49f94c[_0xa624('0x1e')][_0xa624('0x20')]||null:null,'attributes':_0x49f94c['options']?_0x49f94c[_0xa624('0x1e')][_0xa624('0x21')]||null:null,'limit':_0x49f94c['options']?_0x49f94c[_0xa624('0x1e')]['limit']||null:null})['then'](function(_0x2c023b){logger['info']('UpdateWhatsappInteraction',_0x49f94c);logger[_0xa624('0x22')](_0xa624('0x1b'),_0x49f94c,JSON[_0xa624('0x15')](_0x2c023b));_0x2b797e(_0x2c023b);})['catch'](function(_0x1b7a45){logger[_0xa624('0x16')](_0xa624('0x1b'),_0x1b7a45['message'],_0x49f94c);_0x504e27(_0x2c18c5[_0xa624('0x16')](0x1f4,_0x1b7a45[_0xa624('0x18')]));});});};exports[_0xa624('0x23')]=function(_0x1dbe1d){return new Promise(function(_0x3dc138,_0x487247){return db['WhatsappInteraction'][_0xa624('0x24')]({'where':_0x1dbe1d['options']?_0x1dbe1d[_0xa624('0x1e')][_0xa624('0x20')]||null:null})[_0xa624('0x10')](function(_0x5321f2){if(_0x5321f2){return _0x5321f2[_0xa624('0x25')](_0x1dbe1d[_0xa624('0x1d')][_0xa624('0x26')],_[_0xa624('0x27')](_0x1dbe1d[_0xa624('0x1d')],[_0xa624('0x26'),'id'])||{});}})[_0xa624('0x28')](function(_0x5d19ad){logger['info'](_0xa624('0x29'),_0x1dbe1d);logger[_0xa624('0x22')](_0xa624('0x29'),_0x1dbe1d,JSON[_0xa624('0x15')](_0x5d19ad));_0x3dc138(_0x5d19ad);})[_0xa624('0x1a')](function(_0x10dab4){logger[_0xa624('0x16')](_0xa624('0x29'),_0x10dab4['message'],_0x1dbe1d);_0x487247(_this[_0xa624('0x16')](0x1f4,_0x10dab4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index d44ae66..ece28fa 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc84=['./whatsappInteraction.events','remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x2d7f2d,_0x31e790){var _0x3587e6=function(_0xa285db){while(--_0xa285db){_0x2d7f2d['push'](_0x2d7f2d['shift']());}};_0x3587e6(++_0x31e790);}(_0xfc84,0xc8));var _0x4fc8=function(_0xef8f83,_0xd64c0d){_0xef8f83=_0xef8f83-0x0;var _0x417ee8=_0xfc84[_0xef8f83];return _0x417ee8;};'use strict';var WhatsappInteractionEvents=require(_0x4fc8('0x0'));var events=['save',_0x4fc8('0x1'),_0x4fc8('0x2')];function createListener(_0x763175,_0x3e2efa){return function(_0x516e2c){_0x3e2efa[_0x4fc8('0x3')](_0x763175,_0x516e2c);};}function removeListener(_0x1a1e85,_0x18bf54){return function(){WhatsappInteractionEvents[_0x4fc8('0x4')](_0x1a1e85,_0x18bf54);};}exports[_0x4fc8('0x5')]=function(_0x4e11cf){for(var _0x2e8177=0x0,_0x23e081=events[_0x4fc8('0x6')];_0x2e8177<_0x23e081;_0x2e8177++){var _0x10e8ab=events[_0x2e8177];var _0x11b9d1=createListener(_0x4fc8('0x7')+_0x10e8ab,_0x4e11cf);WhatsappInteractionEvents['on'](_0x10e8ab,_0x11b9d1);}}; \ No newline at end of file +var _0x9743=['length','whatsappInteraction:','save','remove','update','emit','removeListener'];(function(_0x2f560d,_0x4ac81d){var _0x1eeb2f=function(_0xde342b){while(--_0xde342b){_0x2f560d['push'](_0x2f560d['shift']());}};_0x1eeb2f(++_0x4ac81d);}(_0x9743,0x1f3));var _0x3974=function(_0xdbabfa,_0x19339c){_0xdbabfa=_0xdbabfa-0x0;var _0x4b3e74=_0x9743[_0xdbabfa];return _0x4b3e74;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x3974('0x0'),_0x3974('0x1'),_0x3974('0x2')];function createListener(_0x4c57cb,_0x2ec583){return function(_0xf3a155){_0x2ec583[_0x3974('0x3')](_0x4c57cb,_0xf3a155);};}function removeListener(_0x17a2ce,_0x395963){return function(){WhatsappInteractionEvents[_0x3974('0x4')](_0x17a2ce,_0x395963);};}exports['register']=function(_0x37a62c){for(var _0x34f4fa=0x0,_0x4da0f6=events[_0x3974('0x5')];_0x34f4fa<_0x4da0f6;_0x34f4fa++){var _0x25ab34=events[_0x34f4fa];var _0x1ca436=createListener(_0x3974('0x6')+_0x25ab34,_0x37a62c);WhatsappInteractionEvents['on'](_0x25ab34,_0x1ca436);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 584d9c4..1ba8dc8 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad68=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','/describe','describe','get','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0xad68,0x6e));var _0x8ad6=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xad68[_0x32a81f];return _0x5b67a2;};'use strict';var multer=require(_0x8ad6('0x0'));var util=require(_0x8ad6('0x1'));var path=require(_0x8ad6('0x2'));var timeout=require(_0x8ad6('0x3'));var express=require(_0x8ad6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ad6('0x5'));var interaction=require(_0x8ad6('0x6'));var config=require('../../config/environment');var controller=require(_0x8ad6('0x7'));router['get']('/',auth[_0x8ad6('0x8')](),controller[_0x8ad6('0x9')]);router['get'](_0x8ad6('0xa'),auth['isAuthenticated'](),controller[_0x8ad6('0xb')]);router[_0x8ad6('0xc')]('/:id',auth[_0x8ad6('0x8')](),controller['show']);router[_0x8ad6('0xd')]('/',auth[_0x8ad6('0x8')](),interaction[_0x8ad6('0xe')](_0x8ad6('0xf'),_0x8ad6('0x10')),controller['create']);router[_0x8ad6('0xd')](_0x8ad6('0x11'),controller[_0x8ad6('0x12')]);router[_0x8ad6('0x13')](_0x8ad6('0x14'),auth[_0x8ad6('0x8')](),controller[_0x8ad6('0x15')]);router[_0x8ad6('0x13')](_0x8ad6('0x16'),auth[_0x8ad6('0x8')](),controller['accept']);router[_0x8ad6('0x13')](_0x8ad6('0x17'),auth[_0x8ad6('0x8')](),controller[_0x8ad6('0x18')]);router[_0x8ad6('0x19')](_0x8ad6('0x14'),auth[_0x8ad6('0x8')](),controller[_0x8ad6('0x1a')]);module[_0x8ad6('0x1b')]=router; \ No newline at end of file +var _0x6a4a=['index','/describe','/:id','show','tracked','whatsappmessage:create','create','post','/:id/status','status','/:id/accept','accept','put','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x23a608,_0x554d43){var _0x64e20b=function(_0x22b5a6){while(--_0x22b5a6){_0x23a608['push'](_0x23a608['shift']());}};_0x64e20b(++_0x554d43);}(_0x6a4a,0xe6));var _0xa6a4=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x6a4a[_0x3cb3ca];return _0x214366;};'use strict';var multer=require(_0xa6a4('0x0'));var util=require(_0xa6a4('0x1'));var path=require('path');var timeout=require(_0xa6a4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa6a4('0x3'));var auth=require(_0xa6a4('0x4'));var interaction=require(_0xa6a4('0x5'));var config=require(_0xa6a4('0x6'));var controller=require(_0xa6a4('0x7'));router[_0xa6a4('0x8')]('/',auth[_0xa6a4('0x9')](),controller[_0xa6a4('0xa')]);router[_0xa6a4('0x8')](_0xa6a4('0xb'),auth[_0xa6a4('0x9')](),controller['describe']);router[_0xa6a4('0x8')](_0xa6a4('0xc'),auth[_0xa6a4('0x9')](),controller[_0xa6a4('0xd')]);router['post']('/',auth[_0xa6a4('0x9')](),interaction[_0xa6a4('0xe')]('whatsapp',_0xa6a4('0xf')),controller[_0xa6a4('0x10')]);router[_0xa6a4('0x11')](_0xa6a4('0x12'),controller[_0xa6a4('0x13')]);router['put'](_0xa6a4('0xc'),auth[_0xa6a4('0x9')](),controller['update']);router['put'](_0xa6a4('0x14'),auth[_0xa6a4('0x9')](),controller[_0xa6a4('0x15')]);router[_0xa6a4('0x16')]('/:id/reject',auth[_0xa6a4('0x9')](),controller['reject']);router[_0xa6a4('0x17')]('/:id',auth[_0xa6a4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index d504b8a..a825d20 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1003=['out','STRING','DATE','TEXT','sequelize','exports','BOOLEAN','ENUM'];(function(_0x11e1c8,_0x48b832){var _0x180705=function(_0x1b5c9a){while(--_0x1b5c9a){_0x11e1c8['push'](_0x11e1c8['shift']());}};_0x180705(++_0x48b832);}(_0x1003,0x84));var _0x3100=function(_0x81e32b,_0x56a512){_0x81e32b=_0x81e32b-0x0;var _0x53f2e1=_0x1003[_0x81e32b];return _0x53f2e1;};'use strict';var Sequelize=require(_0x3100('0x0'));module[_0x3100('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3100('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3100('0x3')]('in','out'),'defaultValue':_0x3100('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3100('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3100('0x6')]},'secret':{'type':Sequelize[_0x3100('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3100('0x5')]},'providerResponse':{'type':Sequelize[_0x3100('0x7')]}}; \ No newline at end of file +var _0xbd51=['BOOLEAN','ENUM','DATE','STRING','sequelize','TEXT','medium'];(function(_0x1b285b,_0x289d02){var _0x1dd05e=function(_0x10df7a){while(--_0x10df7a){_0x1b285b['push'](_0x1b285b['shift']());}};_0x1dd05e(++_0x289d02);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x49f7db,_0x2a1f1e){_0x49f7db=_0x49f7db-0x0;var _0x2c1551=_0xbd51[_0x49f7db];return _0x2c1551;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'body':{'type':Sequelize[_0x1bd5('0x1')](_0x1bd5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1bd5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1bd5('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1bd5('0x5')]},'secret':{'type':Sequelize[_0x1bd5('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1bd5('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 71b21bf..cf9773b 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd0d=['request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','WhatsappMessage','includeAll','include','rows','params','filters','length','options','find','create','body','describe','whatsapp-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','AcceptMessage','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1acf21,_0x3058df){var _0x299bc9=function(_0x27abf0){while(--_0x27abf0){_0x1acf21['push'](_0x1acf21['shift']());}};_0x299bc9(++_0x3058df);}(_0xcd0d,0x10a));var _0xdcd0=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0xcd0d[_0x5b87ce];return _0x597aa7;};'use strict';var emlformat=require(_0xdcd0('0x0'));var rimraf=require(_0xdcd0('0x1'));var zipdir=require(_0xdcd0('0x2'));var jsonpatch=require(_0xdcd0('0x3'));var rp=require(_0xdcd0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdcd0('0x5'));var path=require('path');var sox=require(_0xdcd0('0x6'));var csv=require(_0xdcd0('0x7'));var ejs=require(_0xdcd0('0x8'));var fs=require('fs');var fs_extra=require(_0xdcd0('0x9'));var _=require(_0xdcd0('0xa'));var squel=require(_0xdcd0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdcd0('0x7'));var querystring=require(_0xdcd0('0xc'));var Papa=require(_0xdcd0('0xd'));var Redis=require('ioredis');var authService=require(_0xdcd0('0xe'));var qs=require(_0xdcd0('0xf'));var as=require(_0xdcd0('0x10'));var hardwareService=require(_0xdcd0('0x11'));var logger=require(_0xdcd0('0x12'))(_0xdcd0('0x13'));var utils=require(_0xdcd0('0x14'));var config=require(_0xdcd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcd0('0x16'))['db'];config[_0xdcd0('0x17')]=_[_0xdcd0('0x18')](config[_0xdcd0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xdcd0('0x19'))(new Redis(config['redis']));require(_0xdcd0('0x1a'))['register'](socket);var jayson=require(_0xdcd0('0x1b'));var client=jayson['client'][_0xdcd0('0x1c')]({'port':0x232c});var client9002=jayson[_0xdcd0('0x1d')][_0xdcd0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5a4584,_0x488387,_0x50db21,_0x5557c4){return new BPromise(function(_0x55d72b,_0x4a221e){var _0x261c23=_0x5557c4||client;return _0x261c23['request'](_0x5a4584,_0x50db21)[_0xdcd0('0x1e')](function(_0x1172bc){logger[_0xdcd0('0x1f')](_0xdcd0('0x20'),_0x488387,_0xdcd0('0x21'));logger[_0xdcd0('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x488387,_0xdcd0('0x21'),JSON[_0xdcd0('0x23')](_0x1172bc));if(_0x1172bc[_0xdcd0('0x24')]){if(_0x1172bc[_0xdcd0('0x24')][_0xdcd0('0x25')]===0x1f4){logger[_0xdcd0('0x24')](_0xdcd0('0x20'),_0x488387,_0x1172bc[_0xdcd0('0x24')][_0xdcd0('0x26')]);return _0x4a221e(_0x1172bc[_0xdcd0('0x24')][_0xdcd0('0x26')]);}logger['error'](_0xdcd0('0x20'),_0x488387,_0x1172bc[_0xdcd0('0x24')][_0xdcd0('0x26')]);return _0x55d72b(_0x1172bc['error'][_0xdcd0('0x26')]);}else{logger['info'](_0xdcd0('0x20'),_0x488387,_0xdcd0('0x21'));_0x55d72b(_0x1172bc[_0xdcd0('0x27')][_0xdcd0('0x26')]);}})[_0xdcd0('0x28')](function(_0x13697d){logger[_0xdcd0('0x24')](_0xdcd0('0x20'),_0x488387,_0x13697d);_0x4a221e(_0x13697d);});});}function respondWithStatusCode(_0x21642a,_0x3f3013){_0x3f3013=_0x3f3013||0xcc;return function(_0x535e9f){if(_0x535e9f){return _0x21642a[_0xdcd0('0x29')](_0x3f3013);}return _0x21642a[_0xdcd0('0x2a')](_0x3f3013)[_0xdcd0('0x2b')]();};}function respondWithResult(_0xbccffb,_0x3fe7c9){_0x3fe7c9=_0x3fe7c9||0xc8;return function(_0x14687e){if(_0x14687e){return _0xbccffb[_0xdcd0('0x2a')](_0x3fe7c9)[_0xdcd0('0x2c')](_0x14687e);}};}function respondWithFilteredResult(_0x4f75f8,_0x4ac778){return function(_0x6bd7d){if(_0x6bd7d){var _0x2c5334=typeof _0x4ac778[_0xdcd0('0x2d')]===_0xdcd0('0x2e')&&typeof _0x4ac778[_0xdcd0('0x2f')]===_0xdcd0('0x2e');var _0x2d2c76=_0x6bd7d[_0xdcd0('0x30')];var _0xe90cb2=_0x2c5334?0x0:_0x4ac778[_0xdcd0('0x2d')];var _0x2b2468=_0x2c5334?_0x6bd7d[_0xdcd0('0x30')]:_0x4ac778[_0xdcd0('0x2d')]+_0x4ac778[_0xdcd0('0x2f')];var _0x13f377;if(_0x2b2468>=_0x2d2c76){_0x2b2468=_0x2d2c76;_0x13f377=0xc8;}else{_0x13f377=0xce;}_0x4f75f8[_0xdcd0('0x2a')](_0x13f377);return _0x4f75f8[_0xdcd0('0x31')]('Content-Range',_0xe90cb2+'-'+_0x2b2468+'/'+_0x2d2c76)[_0xdcd0('0x2c')](_0x6bd7d);}return null;};}function patchUpdates(_0x581a19){return function(_0x3dfb85){try{jsonpatch[_0xdcd0('0x32')](_0x3dfb85,_0x581a19,!![]);}catch(_0x28b8f1){return BPromise[_0xdcd0('0x33')](_0x28b8f1);}return _0x3dfb85[_0xdcd0('0x34')]();};}function saveUpdates(_0x4aa06f,_0x38a6d2){return function(_0x2591bb){if(_0x2591bb){return _0x2591bb[_0xdcd0('0x35')](_0x4aa06f)['then'](function(_0x58452){return _0x58452;});}return null;};}function removeEntity(_0x41fa27,_0x5b06a1){return function(_0x1e1613){if(_0x1e1613){return _0x1e1613[_0xdcd0('0x36')]()['then'](function(){_0x41fa27[_0xdcd0('0x2a')](0xcc)[_0xdcd0('0x2b')]();});}};}function handleEntityNotFound(_0x4b438a,_0x154513){return function(_0x460ac6){if(!_0x460ac6){_0x4b438a[_0xdcd0('0x29')](0x194);}return _0x460ac6;};}function handleError(_0xb6084f,_0x3d3821){_0x3d3821=_0x3d3821||0x1f4;return function(_0x41d1e9){logger[_0xdcd0('0x24')](_0x41d1e9[_0xdcd0('0x37')]);if(_0x41d1e9['name']){delete _0x41d1e9['name'];}_0xb6084f[_0xdcd0('0x2a')](_0x3d3821)[_0xdcd0('0x38')](_0x41d1e9);};}exports[_0xdcd0('0x39')]=function(_0x4118da,_0x37cd15){var _0x2087e3={},_0x269e03={},_0x78274d={'count':0x0,'rows':[]};var _0x2fa119=_[_0xdcd0('0x3a')](db['WhatsappMessage'][_0xdcd0('0x3b')],function(_0x5476bb){return{'name':_0x5476bb['fieldName'],'type':_0x5476bb[_0xdcd0('0x3c')][_0xdcd0('0x3d')]};});_0x269e03[_0xdcd0('0x3e')]=_[_0xdcd0('0x3a')](_0x2fa119,_0xdcd0('0x3f'));_0x269e03[_0xdcd0('0x40')]=_[_0xdcd0('0x41')](_0x4118da['query']);_0x269e03['filters']=_[_0xdcd0('0x42')](_0x269e03[_0xdcd0('0x3e')],_0x269e03[_0xdcd0('0x40')]);_0x2087e3['attributes']=_['intersection'](_0x269e03[_0xdcd0('0x3e')],qs[_0xdcd0('0x43')](_0x4118da[_0xdcd0('0x40')]['fields']));_0x2087e3[_0xdcd0('0x44')]=_0x2087e3[_0xdcd0('0x44')]['length']?_0x2087e3[_0xdcd0('0x44')]:_0x269e03['model'];if(!_0x4118da[_0xdcd0('0x40')][_0xdcd0('0x45')](_0xdcd0('0x46'))){_0x2087e3[_0xdcd0('0x2f')]=qs[_0xdcd0('0x2f')](_0x4118da['query'][_0xdcd0('0x2f')]);_0x2087e3[_0xdcd0('0x2d')]=qs[_0xdcd0('0x2d')](_0x4118da[_0xdcd0('0x40')]['offset']);}_0x2087e3[_0xdcd0('0x47')]=qs[_0xdcd0('0x48')](_0x4118da['query']['sort']);_0x2087e3[_0xdcd0('0x49')]=qs['filters'](_['pick'](_0x4118da['query'],_0x269e03['filters']),_0x2fa119);if(_0x4118da[_0xdcd0('0x40')]['filter']){_0x2087e3[_0xdcd0('0x49')]=_[_0xdcd0('0x4a')](_0x2087e3[_0xdcd0('0x49')],{'$or':_[_0xdcd0('0x3a')](_0x2fa119,function(_0x4e7638){if(_0x4e7638[_0xdcd0('0x3c')]!=='VIRTUAL'){var _0x278228={};_0x278228[_0x4e7638[_0xdcd0('0x3f')]]={'$like':'%'+_0x4118da[_0xdcd0('0x40')][_0xdcd0('0x4b')]+'%'};return _0x278228;}})});}_0x2087e3=_[_0xdcd0('0x4a')]({},_0x2087e3,_0x4118da['options']);var _0x327771={'where':_0x2087e3[_0xdcd0('0x49')]};return db[_0xdcd0('0x4c')][_0xdcd0('0x30')](_0x327771)[_0xdcd0('0x1e')](function(_0x3b6bcd){_0x78274d['count']=_0x3b6bcd;if(_0x4118da['query'][_0xdcd0('0x4d')]){_0x2087e3[_0xdcd0('0x4e')]=[{'all':!![]}];}return db[_0xdcd0('0x4c')]['findAll'](_0x2087e3);})['then'](function(_0x4fed25){_0x78274d[_0xdcd0('0x4f')]=_0x4fed25;return _0x78274d;})[_0xdcd0('0x1e')](respondWithFilteredResult(_0x37cd15,_0x2087e3))[_0xdcd0('0x28')](handleError(_0x37cd15,null));};exports['show']=function(_0xb79f7a,_0x35e97a){var _0x583eb0={'raw':!![],'where':{'id':_0xb79f7a[_0xdcd0('0x50')]['id']}},_0x5d196e={};_0x5d196e[_0xdcd0('0x3e')]=_[_0xdcd0('0x41')](db[_0xdcd0('0x4c')]['rawAttributes']);_0x5d196e[_0xdcd0('0x40')]=_[_0xdcd0('0x41')](_0xb79f7a[_0xdcd0('0x40')]);_0x5d196e[_0xdcd0('0x51')]=_['intersection'](_0x5d196e[_0xdcd0('0x3e')],_0x5d196e['query']);_0x583eb0['attributes']=_[_0xdcd0('0x42')](_0x5d196e['model'],qs[_0xdcd0('0x43')](_0xb79f7a[_0xdcd0('0x40')]['fields']));_0x583eb0[_0xdcd0('0x44')]=_0x583eb0[_0xdcd0('0x44')][_0xdcd0('0x52')]?_0x583eb0[_0xdcd0('0x44')]:_0x5d196e[_0xdcd0('0x3e')];if(_0xb79f7a[_0xdcd0('0x40')][_0xdcd0('0x4d')]){_0x583eb0[_0xdcd0('0x4e')]=[{'all':!![]}];}_0x583eb0=_[_0xdcd0('0x4a')]({},_0x583eb0,_0xb79f7a[_0xdcd0('0x53')]);return db[_0xdcd0('0x4c')][_0xdcd0('0x54')](_0x583eb0)['then'](handleEntityNotFound(_0x35e97a,null))[_0xdcd0('0x1e')](respondWithResult(_0x35e97a,null))[_0xdcd0('0x28')](handleError(_0x35e97a,null));};exports[_0xdcd0('0x55')]=function(_0x4aacdc,_0x329a0d){return db['WhatsappMessage']['create'](_0x4aacdc[_0xdcd0('0x56')],{})[_0xdcd0('0x1e')](respondWithResult(_0x329a0d,0xc9))[_0xdcd0('0x28')](handleError(_0x329a0d,null));};exports[_0xdcd0('0x35')]=function(_0x56cf49,_0x398555){if(_0x56cf49[_0xdcd0('0x56')]['id']){delete _0x56cf49[_0xdcd0('0x56')]['id'];}return db[_0xdcd0('0x4c')]['find']({'where':{'id':_0x56cf49['params']['id']}})[_0xdcd0('0x1e')](handleEntityNotFound(_0x398555,null))[_0xdcd0('0x1e')](saveUpdates(_0x56cf49[_0xdcd0('0x56')],null))[_0xdcd0('0x1e')](respondWithResult(_0x398555,null))['catch'](handleError(_0x398555,null));};exports['destroy']=function(_0x24bdd0,_0x54f921){return db['WhatsappMessage'][_0xdcd0('0x54')]({'where':{'id':_0x24bdd0[_0xdcd0('0x50')]['id']}})[_0xdcd0('0x1e')](handleEntityNotFound(_0x54f921,null))[_0xdcd0('0x1e')](removeEntity(_0x54f921,null))['catch'](handleError(_0x54f921,null));};exports['describe']=function(_0x521072,_0x3c5b62){return db[_0xdcd0('0x4c')][_0xdcd0('0x57')]()[_0xdcd0('0x1e')](respondWithResult(_0x3c5b62,null))[_0xdcd0('0x28')](handleError(_0x3c5b62,null));};var interaction_log=require(_0xdcd0('0x12'))(_0xdcd0('0x58'));exports[_0xdcd0('0x59')]=function(_0x108eef,_0x212a4a,_0x1d6786){var _0x2dca03={'agent':{},'channel':'whatsapp'};if(_0x108eef[_0xdcd0('0x56')]['id']){delete _0x108eef['body']['id'];}_0x108eef['body']['read']=!![];_0x108eef[_0xdcd0('0x56')][_0xdcd0('0x5a')]=moment()[_0xdcd0('0x5b')](_0xdcd0('0x5c'));_0x108eef[_0xdcd0('0x56')][_0xdcd0('0x5d')]=_0x108eef[_0xdcd0('0x56')]['UserId']||_0x108eef[_0xdcd0('0x5e')]['id'];_0x2dca03[_0xdcd0('0x5f')]['id']=_0x108eef[_0xdcd0('0x56')][_0xdcd0('0x5d')];return db['WhatsappMessage'][_0xdcd0('0x54')]({'where':{'id':_0x108eef[_0xdcd0('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x212a4a,null))[_0xdcd0('0x1e')](saveUpdates(_0x108eef['body'],null))['then'](function(_0x9a5887){if(_0x9a5887){_0x2dca03[_0xdcd0('0x26')]=_0x9a5887[_0xdcd0('0x60')]({'plain':!![]});return db[_0xdcd0('0x61')][_0xdcd0('0x54')]({'where':{'id':_0x9a5887[_0xdcd0('0x62')]}});}return null;})[_0xdcd0('0x1e')](handleEntityNotFound(_0x212a4a,null))['then'](function(_0x212e8d){if(_0x212e8d){return _0x212e8d[_0xdcd0('0x35')]({'UserId':_0x108eef['body']['UserId'],'read1stAt':_[_0xdcd0('0x63')](_0x212e8d['read1stAt'])?moment()[_0xdcd0('0x5b')](_0xdcd0('0x5c')):undefined});}return null;})[_0xdcd0('0x1e')](function(_0x17cf0e){if(_0x17cf0e){_0x2dca03[_0xdcd0('0x64')]=_0x17cf0e[_0xdcd0('0x60')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x108eef['user']['id'],_0x108eef[_0xdcd0('0x5e')][_0xdcd0('0x3f')],_0x108eef['user']['role'],_0x2dca03['interaction']['id'],_0x108eef[_0xdcd0('0x56')]?JSON['stringify'](_0x108eef[_0xdcd0('0x56')]):'null');return respondWithRpcPromise(_0xdcd0('0x65'),'acceptMessage',_0x2dca03);}return null;})[_0xdcd0('0x1e')](function(_0x5f2c5f){var _0x96b846='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f2c5f[_0xdcd0('0x26')]['ContactId'];return db['sequelize'][_0xdcd0('0x40')](_0x96b846,{'type':db[_0xdcd0('0x66')][_0xdcd0('0x67')][_0xdcd0('0x68')],'raw':!![]})['then'](function(_0x611029){return _0x611029;});})[_0xdcd0('0x1e')](function(_0xe4585c){if(_0xe4585c){_0x2dca03['message']['contact']=_0xe4585c[0x0];if(!_0x108eef[_0xdcd0('0x56')][_0xdcd0('0x5d')])return;return db[_0xdcd0('0x69')][_0xdcd0('0x54')]({'where':{'id':_0x108eef[_0xdcd0('0x56')][_0xdcd0('0x5d')],'role':'agent'},'attributes':['id','name',_0xdcd0('0x6a'),_0xdcd0('0x6b'),_0xdcd0('0x6c')],'raw':!![]});}return null;})['then'](function(_0x48057f){if(!_0x48057f)return null;_0x2dca03[_0xdcd0('0x26')]['agent']=_0x48057f;return _0x2dca03;})[_0xdcd0('0x1e')](function(_0x17ea7a){if(_0x17ea7a){if(_0x108eef[_0xdcd0('0x56')]['manual']){_0x2dca03[_0xdcd0('0x26')][_0xdcd0('0x6d')]=util[_0xdcd0('0x5b')](_0xdcd0('0x6e'),_0x108eef[_0xdcd0('0x5e')][_0xdcd0('0x3f')]);_0x2dca03[_0xdcd0('0x26')][_0xdcd0('0x6f')]=_0x2dca03['channel'];_0x2dca03['message'][_0xdcd0('0x70')]=_0xdcd0('0x59');return respondWithRpcPromise(_0xdcd0('0x71'),_0xdcd0('0x71'),{'event':'acceptmessage','message':_0x2dca03[_0xdcd0('0x26')]},client9002)[_0xdcd0('0x1e')](function(){return _0x2dca03;});}return _0x2dca03;}return null;})[_0xdcd0('0x1e')](respondWithResult(_0x212a4a,null))[_0xdcd0('0x28')](handleError(_0x212a4a,null));};var interaction_log=require(_0xdcd0('0x12'))(_0xdcd0('0x58'));exports[_0xdcd0('0x33')]=function(_0x1cc1c2,_0x5c2d77,_0x5ceb58){var _0x30865e={'agent':{},'channel':_0xdcd0('0x72')};if(_0x1cc1c2[_0xdcd0('0x56')]['id']){delete _0x1cc1c2['body']['id'];}_0x1cc1c2['body'][_0xdcd0('0x5d')]=_0x1cc1c2[_0xdcd0('0x56')][_0xdcd0('0x5d')]||_0x1cc1c2[_0xdcd0('0x5e')]['id'];_0x30865e[_0xdcd0('0x5f')]['id']=_0x1cc1c2[_0xdcd0('0x56')][_0xdcd0('0x5d')];return db[_0xdcd0('0x4c')][_0xdcd0('0x54')]({'where':{'id':_0x1cc1c2[_0xdcd0('0x50')]['id'],'UserId':null}})[_0xdcd0('0x1e')](handleEntityNotFound(_0x5c2d77,null))['then'](function(_0x272549){if(_0x272549){_0x30865e['message']=_0x272549['get']({'plain':!![]});return db[_0xdcd0('0x61')][_0xdcd0('0x54')]({'where':{'id':_0x272549['WhatsappInteractionId']}});}return null;})[_0xdcd0('0x1e')](handleEntityNotFound(_0x5c2d77,null))[_0xdcd0('0x1e')](function(_0x271a2b){if(_0x271a2b){_0x30865e['interaction']=_0x271a2b[_0xdcd0('0x60')]({'plain':!![]});interaction_log[_0xdcd0('0x1f')](_0xdcd0('0x73'),_0x1cc1c2[_0xdcd0('0x5e')]['id'],_0x1cc1c2[_0xdcd0('0x5e')][_0xdcd0('0x3f')],_0x1cc1c2[_0xdcd0('0x5e')][_0xdcd0('0x74')],_0x30865e['interaction']['id'],_0x1cc1c2[_0xdcd0('0x56')]?JSON[_0xdcd0('0x23')](_0x1cc1c2[_0xdcd0('0x56')]):_0xdcd0('0x75'));return respondWithRpcPromise(_0xdcd0('0x76'),_0xdcd0('0x77'),_0x30865e);}return null;})[_0xdcd0('0x1e')](function(_0x4aaa50){var _0x116bbd=_0xdcd0('0x78')+_0x4aaa50[_0xdcd0('0x26')][_0xdcd0('0x79')];return db[_0xdcd0('0x7a')][_0xdcd0('0x40')](_0x116bbd,{'type':db[_0xdcd0('0x66')][_0xdcd0('0x67')]['SELECT'],'raw':!![]})[_0xdcd0('0x1e')](function(_0x3d5a18){return _0x3d5a18;});})[_0xdcd0('0x1e')](function(_0x338475){if(_0x338475){_0x30865e['message'][_0xdcd0('0x7b')]=_0x338475[0x0];if(!_0x1cc1c2['body'][_0xdcd0('0x5d')])return;return db[_0xdcd0('0x69')][_0xdcd0('0x54')]({'where':{'id':_0x1cc1c2[_0xdcd0('0x56')][_0xdcd0('0x5d')],'role':_0xdcd0('0x5f')},'attributes':['id',_0xdcd0('0x3f'),_0xdcd0('0x6a'),'email',_0xdcd0('0x6c')],'raw':!![]});}return null;})[_0xdcd0('0x1e')](function(_0xdb6bd9){if(!_0xdb6bd9)return null;_0x30865e[_0xdcd0('0x26')][_0xdcd0('0x5f')]=_0xdb6bd9;return _0x30865e;})[_0xdcd0('0x1e')](function(_0x161287){if(_0x161287){_0x161287[_0xdcd0('0x26')]['interface']=util[_0xdcd0('0x5b')]('SIP/%s',_0x1cc1c2[_0xdcd0('0x5e')][_0xdcd0('0x3f')]);_0x161287[_0xdcd0('0x26')][_0xdcd0('0x6f')]=_0x30865e[_0xdcd0('0x6f')];_0x161287['message'][_0xdcd0('0x70')]=_0xdcd0('0x33');respondWithRpcPromise(_0xdcd0('0x71'),_0xdcd0('0x71'),{'event':_0xdcd0('0x7c'),'message':_0x161287['message']},client9002);return _0x30865e;}return null;})[_0xdcd0('0x1e')](respondWithResult(_0x5c2d77,null))[_0xdcd0('0x28')](handleError(_0x5c2d77,null));};exports[_0xdcd0('0x2a')]=function(_0x34243a,_0x20f6fb,_0x157b00){if(_0x34243a[_0xdcd0('0x56')]['id']){delete _0x34243a[_0xdcd0('0x56')]['id'];}var _0x390a9a;return db[_0xdcd0('0x4c')][_0xdcd0('0x54')]({'where':{'id':_0x34243a[_0xdcd0('0x50')]['id']}})[_0xdcd0('0x1e')](handleEntityNotFound(_0x20f6fb,null))[_0xdcd0('0x1e')](function(_0x3607e0){if(_0x3607e0){_0x390a9a=_0x3607e0;return db[_0xdcd0('0x7d')][_0xdcd0('0x54')]({'where':{'id':_0x3607e0[_0xdcd0('0x7e')]}});}})[_0xdcd0('0x1e')](handleEntityNotFound(_0x20f6fb,null))['then'](function(_0x59c84e){if(_0x59c84e){logger[_0xdcd0('0x22')](_0xdcd0('0x7f'),_0xdcd0('0x2a'),_0xdcd0('0x80'),_0x59c84e[_0xdcd0('0x3c')],util[_0xdcd0('0x81')](_0x34243a['body'],{'showHidden':![],'depth':null}));switch(_0x59c84e['type']){case _0xdcd0('0x82'):if(_0x34243a[_0xdcd0('0x56')]['MessageSid']&&_0x34243a[_0xdcd0('0x56')]['MessageSid']===_0x390a9a[_0xdcd0('0x83')]&&_0x34243a[_0xdcd0('0x56')][_0xdcd0('0x84')]&&_0x34243a[_0xdcd0('0x56')][_0xdcd0('0x84')]===_0xdcd0('0x85')){return _0x390a9a[_0xdcd0('0x35')]({'read':!![]});}else{logger['error'](_0xdcd0('0x86'),_0xdcd0('0x2a'),_0xdcd0('0x82'),util[_0xdcd0('0x81')](_0x34243a['body'],{'showHidden':![],'depth':null}));}break;}return _0x390a9a;}})[_0xdcd0('0x1e')](respondWithResult(_0x20f6fb,null))[_0xdcd0('0x28')](handleError(_0x20f6fb,null));}; \ No newline at end of file +var _0xbacd=['acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','SIP/%s','event','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','WhatsappMessage','rows','show','params','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','UserId','user','agent','get','WhatsappInteractionId','isNil','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','interface','channel','EventManager'];(function(_0x10beb1,_0x1dcab5){var _0x57537f=function(_0x2991cb){while(--_0x2991cb){_0x10beb1['push'](_0x10beb1['shift']());}};_0x57537f(++_0x1dcab5);}(_0xbacd,0x1c5));var _0xdbac=function(_0x563ecb,_0x38544e){_0x563ecb=_0x563ecb-0x0;var _0x32630f=_0xbacd[_0x563ecb];return _0x32630f;};'use strict';var emlformat=require(_0xdbac('0x0'));var rimraf=require(_0xdbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbac('0x2'));var rp=require(_0xdbac('0x3'));var moment=require(_0xdbac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbac('0x5'));var util=require(_0xdbac('0x6'));var path=require(_0xdbac('0x7'));var sox=require(_0xdbac('0x8'));var csv=require(_0xdbac('0x9'));var ejs=require(_0xdbac('0xa'));var fs=require('fs');var fs_extra=require(_0xdbac('0xb'));var _=require(_0xdbac('0xc'));var squel=require(_0xdbac('0xd'));var crypto=require(_0xdbac('0xe'));var jsforce=require(_0xdbac('0xf'));var deskjs=require(_0xdbac('0x10'));var toCsv=require(_0xdbac('0x9'));var querystring=require(_0xdbac('0x11'));var Papa=require(_0xdbac('0x12'));var Redis=require('ioredis');var authService=require(_0xdbac('0x13'));var qs=require(_0xdbac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbac('0x15'));var logger=require('../../config/logger')(_0xdbac('0x16'));var utils=require(_0xdbac('0x17'));var config=require(_0xdbac('0x18'));var licenseUtil=require(_0xdbac('0x19'));var db=require(_0xdbac('0x1a'))['db'];config[_0xdbac('0x1b')]=_[_0xdbac('0x1c')](config[_0xdbac('0x1b')],{'host':_0xdbac('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbac('0x1b')]));require(_0xdbac('0x1e'))[_0xdbac('0x1f')](socket);var jayson=require(_0xdbac('0x20'));var client=jayson[_0xdbac('0x21')][_0xdbac('0x22')]({'port':0x232c});var client9002=jayson[_0xdbac('0x21')][_0xdbac('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x574e58,_0x2694ef,_0x1c1f30,_0x1a2b18){return new BPromise(function(_0x4a0d28,_0x3e1463){var _0x36e0de=_0x1a2b18||client;return _0x36e0de[_0xdbac('0x23')](_0x574e58,_0x1c1f30)[_0xdbac('0x24')](function(_0x50206a){logger[_0xdbac('0x25')](_0xdbac('0x26'),_0x2694ef,_0xdbac('0x27'));logger[_0xdbac('0x28')](_0xdbac('0x29'),_0x2694ef,_0xdbac('0x27'),JSON[_0xdbac('0x2a')](_0x50206a));if(_0x50206a['error']){if(_0x50206a[_0xdbac('0x2b')][_0xdbac('0x2c')]===0x1f4){logger['error'](_0xdbac('0x26'),_0x2694ef,_0x50206a['error'][_0xdbac('0x2d')]);return _0x3e1463(_0x50206a['error'][_0xdbac('0x2d')]);}logger[_0xdbac('0x2b')](_0xdbac('0x26'),_0x2694ef,_0x50206a[_0xdbac('0x2b')][_0xdbac('0x2d')]);return _0x4a0d28(_0x50206a[_0xdbac('0x2b')][_0xdbac('0x2d')]);}else{logger['info'](_0xdbac('0x26'),_0x2694ef,_0xdbac('0x27'));_0x4a0d28(_0x50206a[_0xdbac('0x2e')][_0xdbac('0x2d')]);}})[_0xdbac('0x2f')](function(_0x2b4cda){logger[_0xdbac('0x2b')](_0xdbac('0x26'),_0x2694ef,_0x2b4cda);_0x3e1463(_0x2b4cda);});});}function respondWithStatusCode(_0x1a8e46,_0x175ebc){_0x175ebc=_0x175ebc||0xcc;return function(_0x2cb8b4){if(_0x2cb8b4){return _0x1a8e46[_0xdbac('0x30')](_0x175ebc);}return _0x1a8e46[_0xdbac('0x31')](_0x175ebc)[_0xdbac('0x32')]();};}function respondWithResult(_0x35a7f0,_0x31361d){_0x31361d=_0x31361d||0xc8;return function(_0x16d4b8){if(_0x16d4b8){return _0x35a7f0[_0xdbac('0x31')](_0x31361d)[_0xdbac('0x33')](_0x16d4b8);}};}function respondWithFilteredResult(_0xe744cc,_0x1caa18){return function(_0x4e7ef9){if(_0x4e7ef9){var _0x446a32=typeof _0x1caa18[_0xdbac('0x34')]===_0xdbac('0x35')&&typeof _0x1caa18[_0xdbac('0x36')]==='undefined';var _0x505321=_0x4e7ef9[_0xdbac('0x37')];var _0x267d70=_0x446a32?0x0:_0x1caa18[_0xdbac('0x34')];var _0x413428=_0x446a32?_0x4e7ef9['count']:_0x1caa18[_0xdbac('0x34')]+_0x1caa18[_0xdbac('0x36')];var _0x1659e4;if(_0x413428>=_0x505321){_0x413428=_0x505321;_0x1659e4=0xc8;}else{_0x1659e4=0xce;}_0xe744cc[_0xdbac('0x31')](_0x1659e4);return _0xe744cc[_0xdbac('0x38')](_0xdbac('0x39'),_0x267d70+'-'+_0x413428+'/'+_0x505321)[_0xdbac('0x33')](_0x4e7ef9);}return null;};}function patchUpdates(_0x300b28){return function(_0x4a40ca){try{jsonpatch['apply'](_0x4a40ca,_0x300b28,!![]);}catch(_0x119d62){return BPromise[_0xdbac('0x3a')](_0x119d62);}return _0x4a40ca[_0xdbac('0x3b')]();};}function saveUpdates(_0x2cdda1,_0x4fad9c){return function(_0x5d74b9){if(_0x5d74b9){return _0x5d74b9[_0xdbac('0x3c')](_0x2cdda1)[_0xdbac('0x24')](function(_0x24740c){return _0x24740c;});}return null;};}function removeEntity(_0x3a543e,_0x33dd6a){return function(_0xa05855){if(_0xa05855){return _0xa05855[_0xdbac('0x3d')]()[_0xdbac('0x24')](function(){_0x3a543e[_0xdbac('0x31')](0xcc)[_0xdbac('0x32')]();});}};}function handleEntityNotFound(_0xa38149,_0x2eae05){return function(_0x1a21a2){if(!_0x1a21a2){_0xa38149['sendStatus'](0x194);}return _0x1a21a2;};}function handleError(_0x322834,_0x4ffb9a){_0x4ffb9a=_0x4ffb9a||0x1f4;return function(_0x2d8c71){logger[_0xdbac('0x2b')](_0x2d8c71[_0xdbac('0x3e')]);if(_0x2d8c71[_0xdbac('0x3f')]){delete _0x2d8c71['name'];}_0x322834[_0xdbac('0x31')](_0x4ffb9a)[_0xdbac('0x40')](_0x2d8c71);};}exports['index']=function(_0x5bb1bc,_0x647b2d){var _0x516923={},_0x49d295={},_0x1ce518={'count':0x0,'rows':[]};var _0xab3d23=_[_0xdbac('0x41')](db['WhatsappMessage'][_0xdbac('0x42')],function(_0x35f8b7){return{'name':_0x35f8b7[_0xdbac('0x43')],'type':_0x35f8b7[_0xdbac('0x44')]['key']};});_0x49d295['model']=_[_0xdbac('0x41')](_0xab3d23,_0xdbac('0x3f'));_0x49d295[_0xdbac('0x45')]=_[_0xdbac('0x46')](_0x5bb1bc[_0xdbac('0x45')]);_0x49d295['filters']=_[_0xdbac('0x47')](_0x49d295[_0xdbac('0x48')],_0x49d295['query']);_0x516923[_0xdbac('0x49')]=_[_0xdbac('0x47')](_0x49d295[_0xdbac('0x48')],qs[_0xdbac('0x4a')](_0x5bb1bc[_0xdbac('0x45')]['fields']));_0x516923[_0xdbac('0x49')]=_0x516923[_0xdbac('0x49')][_0xdbac('0x4b')]?_0x516923[_0xdbac('0x49')]:_0x49d295[_0xdbac('0x48')];if(!_0x5bb1bc[_0xdbac('0x45')][_0xdbac('0x4c')](_0xdbac('0x4d'))){_0x516923[_0xdbac('0x36')]=qs[_0xdbac('0x36')](_0x5bb1bc[_0xdbac('0x45')][_0xdbac('0x36')]);_0x516923['offset']=qs['offset'](_0x5bb1bc['query']['offset']);}_0x516923[_0xdbac('0x4e')]=qs[_0xdbac('0x4f')](_0x5bb1bc[_0xdbac('0x45')][_0xdbac('0x4f')]);_0x516923[_0xdbac('0x50')]=qs[_0xdbac('0x51')](_[_0xdbac('0x52')](_0x5bb1bc[_0xdbac('0x45')],_0x49d295[_0xdbac('0x51')]),_0xab3d23);if(_0x5bb1bc['query']['filter']){_0x516923['where']=_[_0xdbac('0x53')](_0x516923[_0xdbac('0x50')],{'$or':_['map'](_0xab3d23,function(_0x5383d9){if(_0x5383d9['type']!==_0xdbac('0x54')){var _0x34ecd2={};_0x34ecd2[_0x5383d9[_0xdbac('0x3f')]]={'$like':'%'+_0x5bb1bc['query'][_0xdbac('0x55')]+'%'};return _0x34ecd2;}})});}_0x516923=_[_0xdbac('0x53')]({},_0x516923,_0x5bb1bc[_0xdbac('0x56')]);var _0xa12004={'where':_0x516923[_0xdbac('0x50')]};return db['WhatsappMessage'][_0xdbac('0x37')](_0xa12004)[_0xdbac('0x24')](function(_0x2132b1){_0x1ce518[_0xdbac('0x37')]=_0x2132b1;if(_0x5bb1bc['query'][_0xdbac('0x57')]){_0x516923[_0xdbac('0x58')]=[{'all':!![]}];}return db[_0xdbac('0x59')]['findAll'](_0x516923);})[_0xdbac('0x24')](function(_0x5ce39){_0x1ce518[_0xdbac('0x5a')]=_0x5ce39;return _0x1ce518;})[_0xdbac('0x24')](respondWithFilteredResult(_0x647b2d,_0x516923))[_0xdbac('0x2f')](handleError(_0x647b2d,null));};exports[_0xdbac('0x5b')]=function(_0x5563e4,_0x357c03){var _0x99f381={'raw':!![],'where':{'id':_0x5563e4[_0xdbac('0x5c')]['id']}},_0x4e2dc6={};_0x4e2dc6[_0xdbac('0x48')]=_[_0xdbac('0x46')](db[_0xdbac('0x59')]['rawAttributes']);_0x4e2dc6['query']=_[_0xdbac('0x46')](_0x5563e4[_0xdbac('0x45')]);_0x4e2dc6['filters']=_['intersection'](_0x4e2dc6[_0xdbac('0x48')],_0x4e2dc6['query']);_0x99f381[_0xdbac('0x49')]=_[_0xdbac('0x47')](_0x4e2dc6[_0xdbac('0x48')],qs['fields'](_0x5563e4['query'][_0xdbac('0x4a')]));_0x99f381[_0xdbac('0x49')]=_0x99f381[_0xdbac('0x49')][_0xdbac('0x4b')]?_0x99f381[_0xdbac('0x49')]:_0x4e2dc6[_0xdbac('0x48')];if(_0x5563e4[_0xdbac('0x45')]['includeAll']){_0x99f381['include']=[{'all':!![]}];}_0x99f381=_[_0xdbac('0x53')]({},_0x99f381,_0x5563e4[_0xdbac('0x56')]);return db[_0xdbac('0x59')][_0xdbac('0x5d')](_0x99f381)[_0xdbac('0x24')](handleEntityNotFound(_0x357c03,null))[_0xdbac('0x24')](respondWithResult(_0x357c03,null))['catch'](handleError(_0x357c03,null));};exports[_0xdbac('0x5e')]=function(_0x2861e8,_0x381eba){return db[_0xdbac('0x59')][_0xdbac('0x5e')](_0x2861e8['body'],{})['then'](respondWithResult(_0x381eba,0xc9))[_0xdbac('0x2f')](handleError(_0x381eba,null));};exports['update']=function(_0x476863,_0x35d2f5){if(_0x476863['body']['id']){delete _0x476863[_0xdbac('0x5f')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x476863[_0xdbac('0x5c')]['id']}})[_0xdbac('0x24')](handleEntityNotFound(_0x35d2f5,null))['then'](saveUpdates(_0x476863['body'],null))[_0xdbac('0x24')](respondWithResult(_0x35d2f5,null))['catch'](handleError(_0x35d2f5,null));};exports[_0xdbac('0x3d')]=function(_0x404724,_0x21e1a5){return db['WhatsappMessage']['find']({'where':{'id':_0x404724[_0xdbac('0x5c')]['id']}})[_0xdbac('0x24')](handleEntityNotFound(_0x21e1a5,null))[_0xdbac('0x24')](removeEntity(_0x21e1a5,null))['catch'](handleError(_0x21e1a5,null));};exports[_0xdbac('0x60')]=function(_0x205843,_0x53331a){return db[_0xdbac('0x59')]['describe']()['then'](respondWithResult(_0x53331a,null))[_0xdbac('0x2f')](handleError(_0x53331a,null));};var interaction_log=require(_0xdbac('0x61'))(_0xdbac('0x62'));exports[_0xdbac('0x63')]=function(_0x1baf4b,_0x9e474d,_0x373dad){var _0x3d2c09={'agent':{},'channel':_0xdbac('0x64')};if(_0x1baf4b['body']['id']){delete _0x1baf4b[_0xdbac('0x5f')]['id'];}_0x1baf4b[_0xdbac('0x5f')][_0xdbac('0x65')]=!![];_0x1baf4b[_0xdbac('0x5f')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1baf4b['body'][_0xdbac('0x66')]=_0x1baf4b['body'][_0xdbac('0x66')]||_0x1baf4b[_0xdbac('0x67')]['id'];_0x3d2c09[_0xdbac('0x68')]['id']=_0x1baf4b[_0xdbac('0x5f')][_0xdbac('0x66')];return db[_0xdbac('0x59')][_0xdbac('0x5d')]({'where':{'id':_0x1baf4b[_0xdbac('0x5c')]['id'],'UserId':null}})[_0xdbac('0x24')](handleEntityNotFound(_0x9e474d,null))['then'](saveUpdates(_0x1baf4b[_0xdbac('0x5f')],null))[_0xdbac('0x24')](function(_0x34e713){if(_0x34e713){_0x3d2c09[_0xdbac('0x2d')]=_0x34e713[_0xdbac('0x69')]({'plain':!![]});return db['WhatsappInteraction'][_0xdbac('0x5d')]({'where':{'id':_0x34e713[_0xdbac('0x6a')]}});}return null;})[_0xdbac('0x24')](handleEntityNotFound(_0x9e474d,null))[_0xdbac('0x24')](function(_0x3f6846){if(_0x3f6846){return _0x3f6846[_0xdbac('0x3c')]({'UserId':_0x1baf4b[_0xdbac('0x5f')][_0xdbac('0x66')],'read1stAt':_[_0xdbac('0x6b')](_0x3f6846['read1stAt'])?moment()[_0xdbac('0x6c')](_0xdbac('0x6d')):undefined});}return null;})['then'](function(_0x4b3249){if(_0x4b3249){_0x3d2c09['interaction']=_0x4b3249[_0xdbac('0x69')]({'plain':!![]});interaction_log[_0xdbac('0x25')](_0xdbac('0x6e'),_0x1baf4b[_0xdbac('0x67')]['id'],_0x1baf4b[_0xdbac('0x67')][_0xdbac('0x3f')],_0x1baf4b[_0xdbac('0x67')][_0xdbac('0x6f')],_0x3d2c09[_0xdbac('0x70')]['id'],_0x1baf4b[_0xdbac('0x5f')]?JSON['stringify'](_0x1baf4b[_0xdbac('0x5f')]):'null');return respondWithRpcPromise(_0xdbac('0x71'),'acceptMessage',_0x3d2c09);}return null;})[_0xdbac('0x24')](function(_0x248feb){var _0x2d2edd=_0xdbac('0x72')+_0x248feb['message'][_0xdbac('0x73')];return db[_0xdbac('0x74')][_0xdbac('0x45')](_0x2d2edd,{'type':db[_0xdbac('0x75')][_0xdbac('0x76')]['SELECT'],'raw':!![]})[_0xdbac('0x24')](function(_0x8b7124){return _0x8b7124;});})[_0xdbac('0x24')](function(_0x297334){if(_0x297334){_0x3d2c09[_0xdbac('0x2d')][_0xdbac('0x77')]=_0x297334[0x0];if(!_0x1baf4b[_0xdbac('0x5f')][_0xdbac('0x66')])return;return db[_0xdbac('0x78')][_0xdbac('0x5d')]({'where':{'id':_0x1baf4b[_0xdbac('0x5f')][_0xdbac('0x66')],'role':_0xdbac('0x68')},'attributes':['id',_0xdbac('0x3f'),_0xdbac('0x79'),_0xdbac('0x7a'),_0xdbac('0x7b')],'raw':!![]});}return null;})['then'](function(_0x2a8a66){if(!_0x2a8a66)return null;_0x3d2c09[_0xdbac('0x2d')][_0xdbac('0x68')]=_0x2a8a66;return _0x3d2c09;})['then'](function(_0x3f543e){if(_0x3f543e){if(_0x1baf4b[_0xdbac('0x5f')]['manual']){_0x3d2c09['message'][_0xdbac('0x7c')]=util[_0xdbac('0x6c')]('SIP/%s',_0x1baf4b[_0xdbac('0x67')][_0xdbac('0x3f')]);_0x3d2c09[_0xdbac('0x2d')][_0xdbac('0x7d')]=_0x3d2c09[_0xdbac('0x7d')];_0x3d2c09['message']['event']=_0xdbac('0x63');return respondWithRpcPromise(_0xdbac('0x7e'),'EventManager',{'event':_0xdbac('0x7f'),'message':_0x3d2c09[_0xdbac('0x2d')]},client9002)[_0xdbac('0x24')](function(){return _0x3d2c09;});}return _0x3d2c09;}return null;})[_0xdbac('0x24')](respondWithResult(_0x9e474d,null))[_0xdbac('0x2f')](handleError(_0x9e474d,null));};var interaction_log=require(_0xdbac('0x61'))(_0xdbac('0x62'));exports['reject']=function(_0x296c86,_0x52de25,_0x47cc7f){var _0x5e53fd={'agent':{},'channel':_0xdbac('0x64')};if(_0x296c86[_0xdbac('0x5f')]['id']){delete _0x296c86[_0xdbac('0x5f')]['id'];}_0x296c86['body'][_0xdbac('0x66')]=_0x296c86[_0xdbac('0x5f')][_0xdbac('0x66')]||_0x296c86[_0xdbac('0x67')]['id'];_0x5e53fd[_0xdbac('0x68')]['id']=_0x296c86[_0xdbac('0x5f')][_0xdbac('0x66')];return db[_0xdbac('0x59')]['find']({'where':{'id':_0x296c86[_0xdbac('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52de25,null))['then'](function(_0x449ee1){if(_0x449ee1){_0x5e53fd[_0xdbac('0x2d')]=_0x449ee1[_0xdbac('0x69')]({'plain':!![]});return db[_0xdbac('0x80')][_0xdbac('0x5d')]({'where':{'id':_0x449ee1[_0xdbac('0x6a')]}});}return null;})[_0xdbac('0x24')](handleEntityNotFound(_0x52de25,null))[_0xdbac('0x24')](function(_0x56780c){if(_0x56780c){_0x5e53fd['interaction']=_0x56780c[_0xdbac('0x69')]({'plain':!![]});interaction_log[_0xdbac('0x25')](_0xdbac('0x81'),_0x296c86[_0xdbac('0x67')]['id'],_0x296c86[_0xdbac('0x67')][_0xdbac('0x3f')],_0x296c86[_0xdbac('0x67')]['role'],_0x5e53fd[_0xdbac('0x70')]['id'],_0x296c86[_0xdbac('0x5f')]?JSON[_0xdbac('0x2a')](_0x296c86[_0xdbac('0x5f')]):_0xdbac('0x82'));return respondWithRpcPromise(_0xdbac('0x83'),_0xdbac('0x84'),_0x5e53fd);}return null;})[_0xdbac('0x24')](function(_0x71106a){var _0x277a13=_0xdbac('0x72')+_0x71106a[_0xdbac('0x2d')][_0xdbac('0x73')];return db[_0xdbac('0x74')][_0xdbac('0x45')](_0x277a13,{'type':db[_0xdbac('0x75')][_0xdbac('0x76')][_0xdbac('0x85')],'raw':!![]})[_0xdbac('0x24')](function(_0x28f492){return _0x28f492;});})[_0xdbac('0x24')](function(_0x21bcb2){if(_0x21bcb2){_0x5e53fd[_0xdbac('0x2d')][_0xdbac('0x77')]=_0x21bcb2[0x0];if(!_0x296c86[_0xdbac('0x5f')][_0xdbac('0x66')])return;return db[_0xdbac('0x78')][_0xdbac('0x5d')]({'where':{'id':_0x296c86[_0xdbac('0x5f')][_0xdbac('0x66')],'role':_0xdbac('0x68')},'attributes':['id','name','fullname',_0xdbac('0x7a'),_0xdbac('0x7b')],'raw':!![]});}return null;})[_0xdbac('0x24')](function(_0x246f87){if(!_0x246f87)return null;_0x5e53fd['message']['agent']=_0x246f87;return _0x5e53fd;})[_0xdbac('0x24')](function(_0x510559){if(_0x510559){_0x510559[_0xdbac('0x2d')]['interface']=util[_0xdbac('0x6c')](_0xdbac('0x86'),_0x296c86[_0xdbac('0x67')][_0xdbac('0x3f')]);_0x510559[_0xdbac('0x2d')][_0xdbac('0x7d')]=_0x5e53fd[_0xdbac('0x7d')];_0x510559[_0xdbac('0x2d')][_0xdbac('0x87')]=_0xdbac('0x3a');respondWithRpcPromise(_0xdbac('0x7e'),_0xdbac('0x7e'),{'event':_0xdbac('0x88'),'message':_0x510559[_0xdbac('0x2d')]},client9002);return _0x5e53fd;}return null;})[_0xdbac('0x24')](respondWithResult(_0x52de25,null))[_0xdbac('0x2f')](handleError(_0x52de25,null));};exports[_0xdbac('0x31')]=function(_0x2e1384,_0x2ac51c,_0x37a5be){if(_0x2e1384[_0xdbac('0x5f')]['id']){delete _0x2e1384[_0xdbac('0x5f')]['id'];}var _0x5dafb2;return db['WhatsappMessage'][_0xdbac('0x5d')]({'where':{'id':_0x2e1384[_0xdbac('0x5c')]['id']}})[_0xdbac('0x24')](handleEntityNotFound(_0x2ac51c,null))[_0xdbac('0x24')](function(_0x344212){if(_0x344212){_0x5dafb2=_0x344212;return db[_0xdbac('0x89')][_0xdbac('0x5d')]({'where':{'id':_0x344212[_0xdbac('0x8a')]}});}})[_0xdbac('0x24')](handleEntityNotFound(_0x2ac51c,null))[_0xdbac('0x24')](function(_0x16dc4d){if(_0x16dc4d){logger[_0xdbac('0x28')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xdbac('0x31'),_0xdbac('0x8b'),_0x16dc4d['type'],util[_0xdbac('0x8c')](_0x2e1384[_0xdbac('0x5f')],{'showHidden':![],'depth':null}));switch(_0x16dc4d[_0xdbac('0x44')]){case _0xdbac('0x8d'):if(_0x2e1384[_0xdbac('0x5f')][_0xdbac('0x8e')]&&_0x2e1384[_0xdbac('0x5f')][_0xdbac('0x8e')]===_0x5dafb2['messageId']&&_0x2e1384['body'][_0xdbac('0x8f')]&&_0x2e1384['body'][_0xdbac('0x8f')]==='read'){return _0x5dafb2[_0xdbac('0x3c')]({'read':!![]});}else{logger['error'](_0xdbac('0x90'),_0xdbac('0x31'),'twilio',util[_0xdbac('0x8c')](_0x2e1384[_0xdbac('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x5dafb2;}})[_0xdbac('0x24')](respondWithResult(_0x2ac51c,null))[_0xdbac('0x2f')](handleError(_0x2ac51c,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 52a3fbd..55fef1d 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f4=['update','remove','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4b7a82,_0x4240e7){_0x4b7a82=_0x4b7a82-0x0;var _0xd6dcd4=_0xd4f4[_0x4b7a82];return _0xd6dcd4;};'use strict';var EventEmitter=require(_0x4d4f('0x0'));var WhatsappMessage=require(_0x4d4f('0x1'))['db'][_0x4d4f('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4d4f('0x3')](0x0);var events={'afterCreate':_0x4d4f('0x4'),'afterUpdate':_0x4d4f('0x5'),'afterDestroy':_0x4d4f('0x6')};function emitEvent(_0x2c43da){return function(_0x25087a,_0xa53cb8,_0x15585){WhatsappMessageEvents['emit'](_0x2c43da+':'+_0x25087a['id'],_0x25087a);WhatsappMessageEvents['emit'](_0x2c43da,_0x25087a);_0x15585(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x4d4f('0x7')](e,emitEvent(event));}}module[_0x4d4f('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb9be=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xb9be[_0x3a1ea5];return _0xfac9b2;};'use strict';var EventEmitter=require(_0xeb9b('0x0'));var WhatsappMessage=require(_0xeb9b('0x1'))['db'][_0xeb9b('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xeb9b('0x3')](0x0);var events={'afterCreate':_0xeb9b('0x4'),'afterUpdate':_0xeb9b('0x5'),'afterDestroy':_0xeb9b('0x6')};function emitEvent(_0x2003d4){return function(_0x288aaa,_0x579a7e,_0x5006b8){WhatsappMessageEvents[_0xeb9b('0x7')](_0x2003d4+':'+_0x288aaa['id'],_0x288aaa);WhatsappMessageEvents[_0xeb9b('0x7')](_0x2003d4,_0x288aaa);_0x5006b8(null);};}for(var e in events){if(events[_0xeb9b('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xeb9b('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 2aac70f..27a090c 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5862=['./whatsappMessage.attributes','exports','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','findOne','WhatsappInteractionId','update','catch','error','out','WhatsappAccount','find','then','type','twilio','authToken','phone','accountSid','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2948ba,_0x119762){var _0x39859e=function(_0x5cb1cc){while(--_0x5cb1cc){_0x2948ba['push'](_0x2948ba['shift']());}};_0x39859e(++_0x119762);}(_0x5862,0x17f));var _0x2586=function(_0x47b262,_0x45a382){_0x47b262=_0x47b262-0x0;var _0x223475=_0x5862[_0x47b262];return _0x223475;};'use strict';var _=require(_0x2586('0x0'));var util=require(_0x2586('0x1'));var logger=require('../../config/logger')(_0x2586('0x2'));var moment=require(_0x2586('0x3'));var BPromise=require(_0x2586('0x4'));var rp=require(_0x2586('0x5'));var fs=require('fs');var path=require(_0x2586('0x6'));var rimraf=require(_0x2586('0x7'));var config=require(_0x2586('0x8'));var attributes=require(_0x2586('0x9'));module[_0x2586('0xa')]=function(_0x1134f5,_0x26f7af){return _0x1134f5['define']('WhatsappMessage',attributes,{'tableName':_0x2586('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2586('0xc')]},{'name':_0x2586('0xd'),'fields':[_0x2586('0xe')],'type':_0x2586('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x487c6a,_0x47c1e1,_0x115899){var _0x35bc5b=_0x1134f5[_0x2586('0x10')];var _0xdb43e=_0x487c6a[_0x2586('0x11')]({'plain':!![]});if(_0xdb43e['direction'][_0x2586('0x12')]()==='in'||_0xdb43e[_0x2586('0x13')][_0x2586('0x12')]()==='out'&&!_0xdb43e[_0x2586('0x14')]&&!_[_0x2586('0x15')](_0xdb43e['UserId'])){_0x35bc5b['WhatsappInteraction'][_0x2586('0x16')]({'where':{'id':_0xdb43e[_0x2586('0x17')]}})['then'](function(_0x3f1118){if(_0x3f1118){_0x3f1118[_0x2586('0x18')]({'lastMsgAt':_0xdb43e['createdAt'],'lastMsgDirection':_0xdb43e[_0x2586('0x13')][_0x2586('0x12')]()});}})[_0x2586('0x19')](function(_0x5a36d4){console[_0x2586('0x1a')](_0x5a36d4);});}if(_0xdb43e[_0x2586('0x13')]===_0x2586('0x1b')&&!_0xdb43e[_0x2586('0x14')]){var _0x3cc65a;_0x35bc5b[_0x2586('0x1c')][_0x2586('0x1d')]({'where':{'id':_0xdb43e['WhatsappAccountId']},'raw':!![]})[_0x2586('0x1e')](function(_0x3f5b74){_0x3cc65a=_0x3f5b74;if(_0x3cc65a&&_0x3cc65a[_0x2586('0x1f')]){switch(_0x3cc65a[_0x2586('0x1f')]){case'twilio':var _0x3e8099=require(_0x2586('0x20'));if(_0x3cc65a['accountSid']&&_0x3cc65a[_0x2586('0x21')]&&_0x3cc65a[_0x2586('0x22')]){var _0x28a84e=new _0x3e8099(_0x3cc65a[_0x2586('0x23')],_0x3cc65a[_0x2586('0x21')]);_0x28a84e[_0x2586('0x24')]['create']({'body':_0xdb43e[_0x2586('0xe')],'to':_0x2586('0x25')+_0xdb43e['phone'],'from':_0x2586('0x25')+_0x3cc65a[_0x2586('0x22')],'statusCallback':_0x3cc65a[_0x2586('0x26')]+_0x2586('0x27')+_0xdb43e['id']+_0x2586('0x28')+_0x3cc65a['token']})[_0x2586('0x1e')](function(_0x708355){if(_0x708355[_0x2586('0x29')]){return _0x487c6a[_0x2586('0x18')]({'messageId':_0x708355[_0x2586('0x29')]});}})[_0x2586('0x19')](function(_0x20b50c){logger['error'](_0x2586('0x2a'),_0x2586('0x2b'),'twilio',util[_0x2586('0x2c')](_0x20b50c,{'showHidden':![],'depth':null}));});}else{logger[_0x2586('0x1a')](_0x2586('0x2a'),'afterCreate',_0x2586('0x20'),_0x2586('0x2d'));}break;}}})[_0x2586('0x2e')](function(){_0x115899();});}else{_0x115899();}}},'charset':_0x2586('0x2f'),'collate':_0x2586('0x30')});}; \ No newline at end of file +var _0xce1d=['UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0xce1d,0x10d));var _0xdce1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdce1('0x0'));var util=require('util');var logger=require(_0xdce1('0x1'))(_0xdce1('0x2'));var moment=require('moment');var BPromise=require(_0xdce1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdce1('0x4'));var rimraf=require(_0xdce1('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xdce1('0x6')]=function(_0x3210fc,_0x4d2d2a){return _0x3210fc[_0xdce1('0x7')]('WhatsappMessage',attributes,{'tableName':_0xdce1('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdce1('0x9')]},{'name':_0xdce1('0xa'),'fields':[_0xdce1('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a57fb,_0x453f1d,_0x4ec604){var _0x143434=_0x3210fc[_0xdce1('0xc')];var _0x15e12c=_0x2a57fb[_0xdce1('0xd')]({'plain':!![]});if(_0x15e12c[_0xdce1('0xe')][_0xdce1('0xf')]()==='in'||_0x15e12c[_0xdce1('0xe')][_0xdce1('0xf')]()===_0xdce1('0x10')&&!_0x15e12c[_0xdce1('0x11')]&&!_[_0xdce1('0x12')](_0x15e12c[_0xdce1('0x13')])){_0x143434[_0xdce1('0x14')]['findOne']({'where':{'id':_0x15e12c[_0xdce1('0x15')]}})[_0xdce1('0x16')](function(_0x4c594a){if(_0x4c594a){_0x4c594a[_0xdce1('0x17')]({'lastMsgAt':_0x15e12c[_0xdce1('0x18')],'lastMsgDirection':_0x15e12c['direction']['toLowerCase']()});}})[_0xdce1('0x19')](function(_0x648cfa){console[_0xdce1('0x1a')](_0x648cfa);});}if(_0x15e12c['direction']===_0xdce1('0x10')&&!_0x15e12c[_0xdce1('0x11')]){var _0x3ed998;_0x143434['WhatsappAccount'][_0xdce1('0x1b')]({'where':{'id':_0x15e12c[_0xdce1('0x1c')]},'raw':!![]})[_0xdce1('0x16')](function(_0x371906){_0x3ed998=_0x371906;if(_0x3ed998&&_0x3ed998['type']){switch(_0x3ed998[_0xdce1('0x1d')]){case _0xdce1('0x1e'):var _0x8ebf5=require('twilio');if(_0x3ed998[_0xdce1('0x1f')]&&_0x3ed998[_0xdce1('0x20')]&&_0x3ed998[_0xdce1('0x21')]){var _0xb07e6c=new _0x8ebf5(_0x3ed998[_0xdce1('0x1f')],_0x3ed998[_0xdce1('0x20')]);_0xb07e6c[_0xdce1('0x22')][_0xdce1('0x23')]({'body':_0x15e12c[_0xdce1('0xb')],'to':'whatsapp:'+_0x15e12c['phone'],'from':_0xdce1('0x24')+_0x3ed998['phone'],'statusCallback':_0x3ed998[_0xdce1('0x25')]+_0xdce1('0x26')+_0x15e12c['id']+_0xdce1('0x27')+_0x3ed998[_0xdce1('0x28')]})['then'](function(_0xc7670e){if(_0xc7670e['sid']){return _0x2a57fb[_0xdce1('0x17')]({'messageId':_0xc7670e[_0xdce1('0x29')]});}})[_0xdce1('0x19')](function(_0x26e2c7){logger[_0xdce1('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xdce1('0x2a'),_0xdce1('0x1e'),util[_0xdce1('0x2b')](_0x26e2c7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdce1('0x2c'),_0xdce1('0x2a'),_0xdce1('0x1e'),_0xdce1('0x2d'));}break;}}})['finally'](function(){_0x4ec604();});}else{_0x4ec604();}}},'charset':_0xdce1('0x2e'),'collate':_0xdce1('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 40bff39..d033ad4 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a62=['code','message','create','body','options','CreateWhatsappMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21f1f0,_0x82f8c8){var _0x56871b=function(_0x18bbe7){while(--_0x18bbe7){_0x21f1f0['push'](_0x21f1f0['shift']());}};_0x56871b(++_0x82f8c8);}(_0x9a62,0xca));var _0x29a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9a62[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x29a6('0x0'));var moment=require(_0x29a6('0x1'));var BPromise=require(_0x29a6('0x2'));var rs=require(_0x29a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29a6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x29a6('0x5'))(_0x29a6('0x6'));var config=require('../../config/environment');var jayson=require(_0x29a6('0x7'));var client=jayson[_0x29a6('0x8')]['http']({'port':0x232a});config[_0x29a6('0x9')]=_[_0x29a6('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29a6('0x9')]));require(_0x29a6('0xb'))[_0x29a6('0xc')](socket);function respondWithRpcPromise(_0x16ac82,_0x11ede6,_0x5339fa){return new BPromise(function(_0x446077,_0x3846f0){return client[_0x29a6('0xd')](_0x16ac82,_0x5339fa)[_0x29a6('0xe')](function(_0x42ec6b){logger[_0x29a6('0xf')](_0x29a6('0x10'),_0x11ede6,_0x29a6('0x11'));logger[_0x29a6('0x12')](_0x29a6('0x13'),_0x11ede6,_0x29a6('0x11'),JSON[_0x29a6('0x14')](_0x42ec6b));if(_0x42ec6b[_0x29a6('0x15')]){if(_0x42ec6b['error'][_0x29a6('0x16')]===0x1f4){logger['error'](_0x29a6('0x10'),_0x11ede6,_0x42ec6b[_0x29a6('0x15')][_0x29a6('0x17')]);return _0x3846f0(_0x42ec6b[_0x29a6('0x15')]['message']);}logger[_0x29a6('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x11ede6,_0x42ec6b[_0x29a6('0x15')]['message']);return _0x446077(_0x42ec6b['error'][_0x29a6('0x17')]);}else{logger[_0x29a6('0xf')](_0x29a6('0x10'),_0x11ede6,_0x29a6('0x11'));_0x446077(_0x42ec6b['result'][_0x29a6('0x17')]);}})['catch'](function(_0x30e7ee){logger[_0x29a6('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x11ede6,_0x30e7ee);_0x3846f0(_0x30e7ee);});});}exports['CreateWhatsappMessage']=function(_0x4e648b){var _0x2eefe0=this;return new Promise(function(_0x25107a,_0x199205){return db['WhatsappMessage'][_0x29a6('0x18')](_0x4e648b[_0x29a6('0x19')],{'raw':_0x4e648b[_0x29a6('0x1a')]?_0x4e648b[_0x29a6('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x29a6('0xe')](function(_0x3658fa){logger[_0x29a6('0xf')]('CreateWhatsappMessage',_0x4e648b);logger[_0x29a6('0x12')]('CreateWhatsappMessage',_0x4e648b,JSON['stringify'](_0x3658fa));_0x25107a(_0x3658fa);})['catch'](function(_0x307a4a){logger[_0x29a6('0x15')](_0x29a6('0x1b'),_0x307a4a[_0x29a6('0x17')],_0x4e648b);_0x199205(_0x2eefe0[_0x29a6('0x15')](0x1f4,_0x307a4a[_0x29a6('0x17')]));});});}; \ No newline at end of file +var _0x5f44=['http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappMessage','create','body','options','CreateWhatsappMessage','lodash','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f44,0x12e));var _0x45f4=function(_0x1c7417,_0x558a3f){_0x1c7417=_0x1c7417-0x0;var _0x24c5a6=_0x5f44[_0x1c7417];return _0x24c5a6;};'use strict';var _=require(_0x45f4('0x0'));var util=require('util');var moment=require(_0x45f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x45f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x45f4('0x3'))(_0x45f4('0x4'));var config=require(_0x45f4('0x5'));var jayson=require(_0x45f4('0x6'));var client=jayson[_0x45f4('0x7')][_0x45f4('0x8')]({'port':0x232a});config[_0x45f4('0x9')]=_[_0x45f4('0xa')](config[_0x45f4('0x9')],{'host':_0x45f4('0xb'),'port':0x18eb});var socket=require(_0x45f4('0xc'))(new Redis(config[_0x45f4('0x9')]));require(_0x45f4('0xd'))['register'](socket);function respondWithRpcPromise(_0x36b340,_0x4de624,_0x2b3784){return new BPromise(function(_0x32e263,_0x19e1dc){return client[_0x45f4('0xe')](_0x36b340,_0x2b3784)[_0x45f4('0xf')](function(_0x3b5a45){logger[_0x45f4('0x10')](_0x45f4('0x11'),_0x4de624,_0x45f4('0x12'));logger[_0x45f4('0x13')](_0x45f4('0x14'),_0x4de624,_0x45f4('0x12'),JSON[_0x45f4('0x15')](_0x3b5a45));if(_0x3b5a45[_0x45f4('0x16')]){if(_0x3b5a45['error']['code']===0x1f4){logger[_0x45f4('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4de624,_0x3b5a45['error'][_0x45f4('0x17')]);return _0x19e1dc(_0x3b5a45[_0x45f4('0x16')]['message']);}logger[_0x45f4('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4de624,_0x3b5a45[_0x45f4('0x16')][_0x45f4('0x17')]);return _0x32e263(_0x3b5a45['error']['message']);}else{logger[_0x45f4('0x10')](_0x45f4('0x11'),_0x4de624,'request\x20sent');_0x32e263(_0x3b5a45[_0x45f4('0x18')]['message']);}})[_0x45f4('0x19')](function(_0x2c211d){logger[_0x45f4('0x16')](_0x45f4('0x11'),_0x4de624,_0x2c211d);_0x19e1dc(_0x2c211d);});});}exports['CreateWhatsappMessage']=function(_0x460772){var _0x1d6a20=this;return new Promise(function(_0x4e4a57,_0x10ed10){return db[_0x45f4('0x1a')][_0x45f4('0x1b')](_0x460772[_0x45f4('0x1c')],{'raw':_0x460772[_0x45f4('0x1d')]?_0x460772[_0x45f4('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x45f4('0xf')](function(_0x4b1d2a){logger[_0x45f4('0x10')](_0x45f4('0x1e'),_0x460772);logger[_0x45f4('0x13')](_0x45f4('0x1e'),_0x460772,JSON[_0x45f4('0x15')](_0x4b1d2a));_0x4e4a57(_0x4b1d2a);})['catch'](function(_0x3ef302){logger[_0x45f4('0x16')](_0x45f4('0x1e'),_0x3ef302[_0x45f4('0x17')],_0x460772);_0x10ed10(_0x1d6a20[_0x45f4('0x16')](0x1f4,_0x3ef302[_0x45f4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index cf70d9a..cdd8d34 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe015=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit'];(function(_0xc320f6,_0x4190d5){var _0x2427ab=function(_0x429b86){while(--_0x429b86){_0xc320f6['push'](_0xc320f6['shift']());}};_0x2427ab(++_0x4190d5);}(_0xe015,0x16c));var _0x5e01=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe015[_0x4565bf];return _0x5610ba;};'use strict';var WhatsappMessageEvents=require(_0x5e01('0x0'));var events=[_0x5e01('0x1'),_0x5e01('0x2'),'update'];function createListener(_0x52dd77,_0x39ff24){return function(_0x45373d){_0x39ff24[_0x5e01('0x3')](_0x52dd77,_0x45373d);};}function removeListener(_0x35266b,_0x14b344){return function(){WhatsappMessageEvents[_0x5e01('0x4')](_0x35266b,_0x14b344);};}exports[_0x5e01('0x5')]=function(_0x2f6302){for(var _0x5733d2=0x0,_0x484d88=events[_0x5e01('0x6')];_0x5733d2<_0x484d88;_0x5733d2++){var _0x1703a3=events[_0x5733d2];var _0x143f6e=createListener(_0x5e01('0x7')+_0x1703a3,_0x2f6302);WhatsappMessageEvents['on'](_0x1703a3,_0x143f6e);}}; \ No newline at end of file +var _0x55c1=['update','register','length','whatsappMessage:','save','remove'];(function(_0x2a39dc,_0x4a66f1){var _0x1466dd=function(_0x5bb544){while(--_0x5bb544){_0x2a39dc['push'](_0x2a39dc['shift']());}};_0x1466dd(++_0x4a66f1);}(_0x55c1,0x1ea));var _0x155c=function(_0x32bff9,_0x3f27d5){_0x32bff9=_0x32bff9-0x0;var _0xbab93=_0x55c1[_0x32bff9];return _0xbab93;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x155c('0x0'),_0x155c('0x1'),_0x155c('0x2')];function createListener(_0x6a81ac,_0x232f4d){return function(_0x449d4a){_0x232f4d['emit'](_0x6a81ac,_0x449d4a);};}function removeListener(_0x10de16,_0x54a146){return function(){WhatsappMessageEvents['removeListener'](_0x10de16,_0x54a146);};}exports[_0x155c('0x3')]=function(_0x54af0a){for(var _0xf9dadb=0x0,_0x12d718=events[_0x155c('0x4')];_0xf9dadb<_0x12d718;_0xf9dadb++){var _0x39a468=events[_0xf9dadb];var _0x32fdb2=createListener(_0x155c('0x5')+_0x39a468,_0x54af0a);WhatsappMessageEvents['on'](_0x39a468,_0x32fdb2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index fc2a938..b301892 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1ac=['delete','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy'];(function(_0x4e44c7,_0x2b42a9){var _0x1eb05c=function(_0x16931b){while(--_0x16931b){_0x4e44c7['push'](_0x4e44c7['shift']());}};_0x1eb05c(++_0x2b42a9);}(_0xd1ac,0xe3));var _0xcd1a=function(_0x31e982,_0x521c6a){_0x31e982=_0x31e982-0x0;var _0x3efb59=_0xd1ac[_0x31e982];return _0x3efb59;};'use strict';var multer=require(_0xcd1a('0x0'));var util=require('util');var path=require(_0xcd1a('0x1'));var timeout=require(_0xcd1a('0x2'));var express=require(_0xcd1a('0x3'));var router=express[_0xcd1a('0x4')]();var fs_extra=require(_0xcd1a('0x5'));var auth=require(_0xcd1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd1a('0x7'));var controller=require(_0xcd1a('0x8'));router[_0xcd1a('0x9')]('/',auth[_0xcd1a('0xa')](),controller['index']);router[_0xcd1a('0x9')]('/describe',auth[_0xcd1a('0xa')](),controller[_0xcd1a('0xb')]);router[_0xcd1a('0x9')](_0xcd1a('0xc'),auth[_0xcd1a('0xa')](),controller['show']);router[_0xcd1a('0x9')]('/:id/members',auth[_0xcd1a('0xa')](),controller[_0xcd1a('0xd')]);router[_0xcd1a('0x9')](_0xcd1a('0xe'),auth[_0xcd1a('0xa')](),controller[_0xcd1a('0xf')]);router['get'](_0xcd1a('0x10'),auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x11')]);router[_0xcd1a('0x12')]('/',auth['isAuthenticated'](),controller[_0xcd1a('0x13')]);router[_0xcd1a('0x12')](_0xcd1a('0xe'),auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x14')]);router['post']('/:id/users',auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x15')]);router[_0xcd1a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xcd1a('0x17')]);router['delete']('/:id',auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x18')]);router[_0xcd1a('0x19')]('/:id/teams',auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x1a')]);router['delete'](_0xcd1a('0x10'),auth[_0xcd1a('0xa')](),controller[_0xcd1a('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xcfba=['removeTeams','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy'];(function(_0xcd9797,_0x206c17){var _0x210da0=function(_0x30ff0a){while(--_0x30ff0a){_0xcd9797['push'](_0xcd9797['shift']());}};_0x210da0(++_0x206c17);}(_0xcfba,0x160));var _0xacfb=function(_0x44c0bc,_0x2bdcf8){_0x44c0bc=_0x44c0bc-0x0;var _0x3d1f38=_0xcfba[_0x44c0bc];return _0x3d1f38;};'use strict';var multer=require(_0xacfb('0x0'));var util=require('util');var path=require(_0xacfb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xacfb('0x2')]();var fs_extra=require(_0xacfb('0x3'));var auth=require(_0xacfb('0x4'));var interaction=require(_0xacfb('0x5'));var config=require(_0xacfb('0x6'));var controller=require(_0xacfb('0x7'));router[_0xacfb('0x8')]('/',auth['isAuthenticated'](),controller[_0xacfb('0x9')]);router[_0xacfb('0x8')](_0xacfb('0xa'),auth[_0xacfb('0xb')](),controller[_0xacfb('0xc')]);router[_0xacfb('0x8')](_0xacfb('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xacfb('0x8')](_0xacfb('0xe'),auth[_0xacfb('0xb')](),controller[_0xacfb('0xf')]);router['get'](_0xacfb('0x10'),auth[_0xacfb('0xb')](),controller[_0xacfb('0x11')]);router['get'](_0xacfb('0x12'),auth[_0xacfb('0xb')](),controller['getAgents']);router[_0xacfb('0x13')]('/',auth[_0xacfb('0xb')](),controller[_0xacfb('0x14')]);router[_0xacfb('0x13')](_0xacfb('0x10'),auth['isAuthenticated'](),controller[_0xacfb('0x15')]);router[_0xacfb('0x13')](_0xacfb('0x12'),auth[_0xacfb('0xb')](),controller[_0xacfb('0x16')]);router['put'](_0xacfb('0xd'),auth[_0xacfb('0xb')](),controller[_0xacfb('0x17')]);router[_0xacfb('0x18')](_0xacfb('0xd'),auth[_0xacfb('0xb')](),controller[_0xacfb('0x19')]);router['delete']('/:id/teams',auth[_0xacfb('0xb')](),controller[_0xacfb('0x1a')]);router[_0xacfb('0x18')](_0xacfb('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4f6d050..8a31608 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x83f1=['STRING','name','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x4710f7,_0x1525a5){var _0x3634b5=function(_0x29a05a){while(--_0x29a05a){_0x4710f7['push'](_0x4710f7['shift']());}};_0x3634b5(++_0x1525a5);}(_0x83f1,0x1cc));var _0x183f=function(_0x554a02,_0x4af687){_0x554a02=_0x554a02-0x0;var _0x1bfc7d=_0x83f1[_0x554a02];return _0x1bfc7d;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')],'unique':_0x183f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x183f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x183f('0x5'),_0x183f('0x6'))},'description':{'type':Sequelize[_0x183f('0x2')]}}; \ No newline at end of file +var _0xde56=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x48afd5,_0x4b1267){var _0x17cdad=function(_0x41f3a9){while(--_0x41f3a9){_0x48afd5['push'](_0x48afd5['shift']());}};_0x17cdad(++_0x4b1267);}(_0xde56,0x144));var _0x6de5=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0xde56[_0x45ae0d];return _0x371826;};'use strict';var Sequelize=require(_0x6de5('0x0'));module['exports']={'name':{'type':Sequelize[_0x6de5('0x1')],'unique':_0x6de5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x6de5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6de5('0x4')](_0x6de5('0x5'),_0x6de5('0x6'),_0x6de5('0x7'))},'description':{'type':Sequelize[_0x6de5('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 70602f5..3e56109 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3e8=['User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','pick','addTeams','ids','Team','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','describe','getMembers','findOne','UserWhatsappQueue','order','WhatsappQueueId'];(function(_0x4170c6,_0x2d0151){var _0x1f550b=function(_0x48ca50){while(--_0x48ca50){_0x4170c6['push'](_0x4170c6['shift']());}};_0x1f550b(++_0x2d0151);}(_0xd3e8,0x1d9));var _0x8d3e=function(_0x3c8677,_0x298777){_0x3c8677=_0x3c8677-0x0;var _0x4bc230=_0xd3e8[_0x3c8677];return _0x4bc230;};'use strict';var emlformat=require(_0x8d3e('0x0'));var rimraf=require(_0x8d3e('0x1'));var zipdir=require(_0x8d3e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d3e('0x3'));var Mustache=require(_0x8d3e('0x4'));var util=require(_0x8d3e('0x5'));var path=require(_0x8d3e('0x6'));var sox=require(_0x8d3e('0x7'));var csv=require(_0x8d3e('0x8'));var ejs=require(_0x8d3e('0x9'));var fs=require('fs');var fs_extra=require(_0x8d3e('0xa'));var _=require(_0x8d3e('0xb'));var squel=require(_0x8d3e('0xc'));var crypto=require('crypto');var jsforce=require(_0x8d3e('0xd'));var deskjs=require(_0x8d3e('0xe'));var toCsv=require(_0x8d3e('0x8'));var querystring=require(_0x8d3e('0xf'));var Papa=require('papaparse');var Redis=require(_0x8d3e('0x10'));var authService=require(_0x8d3e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d3e('0x12'));var logger=require(_0x8d3e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8d3e('0x14'));var licenseUtil=require(_0x8d3e('0x15'));var db=require(_0x8d3e('0x16'))['db'];config[_0x8d3e('0x17')]=_[_0x8d3e('0x18')](config[_0x8d3e('0x17')],{'host':_0x8d3e('0x19'),'port':0x18eb});var socket=require(_0x8d3e('0x1a'))(new Redis(config[_0x8d3e('0x17')]));require(_0x8d3e('0x1b'))['register'](socket);function respondWithStatusCode(_0x5c046b,_0xbf0c92){_0xbf0c92=_0xbf0c92||0xcc;return function(_0x48877d){if(_0x48877d){return _0x5c046b[_0x8d3e('0x1c')](_0xbf0c92);}return _0x5c046b[_0x8d3e('0x1d')](_0xbf0c92)['end']();};}function respondWithResult(_0x1edd4c,_0x1732c7){_0x1732c7=_0x1732c7||0xc8;return function(_0x2035ef){if(_0x2035ef){return _0x1edd4c[_0x8d3e('0x1d')](_0x1732c7)[_0x8d3e('0x1e')](_0x2035ef);}};}function respondWithFilteredResult(_0x5f5bf5,_0x1ba6d5){return function(_0x461e06){if(_0x461e06){var _0x27332b=typeof _0x1ba6d5[_0x8d3e('0x1f')]===_0x8d3e('0x20')&&typeof _0x1ba6d5[_0x8d3e('0x21')]===_0x8d3e('0x20');var _0x9b3679=_0x461e06[_0x8d3e('0x22')];var _0x26f552=_0x27332b?0x0:_0x1ba6d5[_0x8d3e('0x1f')];var _0x5914ce=_0x27332b?_0x461e06[_0x8d3e('0x22')]:_0x1ba6d5['offset']+_0x1ba6d5[_0x8d3e('0x21')];var _0x4849e5;if(_0x5914ce>=_0x9b3679){_0x5914ce=_0x9b3679;_0x4849e5=0xc8;}else{_0x4849e5=0xce;}_0x5f5bf5[_0x8d3e('0x1d')](_0x4849e5);return _0x5f5bf5[_0x8d3e('0x23')](_0x8d3e('0x24'),_0x26f552+'-'+_0x5914ce+'/'+_0x9b3679)['json'](_0x461e06);}return null;};}function patchUpdates(_0x3efe10){return function(_0x1ffb84){try{jsonpatch['apply'](_0x1ffb84,_0x3efe10,!![]);}catch(_0x4bd80a){return BPromise[_0x8d3e('0x25')](_0x4bd80a);}return _0x1ffb84[_0x8d3e('0x26')]();};}function saveUpdates(_0x2a19ba,_0x2fe9d2){return function(_0x24bb1d){if(_0x24bb1d){return _0x24bb1d[_0x8d3e('0x27')](_0x2a19ba)[_0x8d3e('0x28')](function(_0x2f2876){return _0x2f2876;});}return null;};}function removeEntity(_0x44c13e,_0x397f26){return function(_0x1a9562){if(_0x1a9562){return _0x1a9562[_0x8d3e('0x29')]()[_0x8d3e('0x28')](function(){var _0x48f645=_0x1a9562[_0x8d3e('0x2a')]({'plain':!![]});var _0x4facac=_0x8d3e('0x2b');return db[_0x8d3e('0x2c')]['destroy']({'where':{'type':_0x4facac,'resourceId':_0x48f645['id']}})[_0x8d3e('0x28')](function(){return _0x1a9562;});})[_0x8d3e('0x28')](function(){_0x44c13e[_0x8d3e('0x1d')](0xcc)[_0x8d3e('0x2d')]();});}};}function handleEntityNotFound(_0x385ad8,_0x4fbf99){return function(_0xf3d741){if(!_0xf3d741){_0x385ad8[_0x8d3e('0x1c')](0x194);}return _0xf3d741;};}function handleError(_0x25ae8e,_0x17cd1a){_0x17cd1a=_0x17cd1a||0x1f4;return function(_0x57e69d){logger[_0x8d3e('0x2e')](_0x57e69d[_0x8d3e('0x2f')]);if(_0x57e69d[_0x8d3e('0x30')]){delete _0x57e69d[_0x8d3e('0x30')];}_0x25ae8e[_0x8d3e('0x1d')](_0x17cd1a)[_0x8d3e('0x31')](_0x57e69d);};}exports[_0x8d3e('0x32')]=function(_0x57f00a,_0x37ffb1){var _0x2eba00={},_0x519254={},_0x5c2f95={'count':0x0,'rows':[]};var _0x242b10=_[_0x8d3e('0x33')](db[_0x8d3e('0x34')][_0x8d3e('0x35')],function(_0x4212ec){return{'name':_0x4212ec[_0x8d3e('0x36')],'type':_0x4212ec[_0x8d3e('0x37')]['key']};});_0x519254['model']=_[_0x8d3e('0x33')](_0x242b10,_0x8d3e('0x30'));_0x519254['query']=_[_0x8d3e('0x38')](_0x57f00a[_0x8d3e('0x39')]);_0x519254[_0x8d3e('0x3a')]=_[_0x8d3e('0x3b')](_0x519254['model'],_0x519254[_0x8d3e('0x39')]);_0x2eba00[_0x8d3e('0x3c')]=_[_0x8d3e('0x3b')](_0x519254[_0x8d3e('0x3d')],qs[_0x8d3e('0x3e')](_0x57f00a['query'][_0x8d3e('0x3e')]));_0x2eba00['attributes']=_0x2eba00['attributes'][_0x8d3e('0x3f')]?_0x2eba00['attributes']:_0x519254[_0x8d3e('0x3d')];if(!_0x57f00a[_0x8d3e('0x39')][_0x8d3e('0x40')](_0x8d3e('0x41'))){_0x2eba00[_0x8d3e('0x21')]=qs[_0x8d3e('0x21')](_0x57f00a[_0x8d3e('0x39')][_0x8d3e('0x21')]);_0x2eba00[_0x8d3e('0x1f')]=qs[_0x8d3e('0x1f')](_0x57f00a[_0x8d3e('0x39')]['offset']);}_0x2eba00['order']=qs['sort'](_0x57f00a['query'][_0x8d3e('0x42')]);_0x2eba00[_0x8d3e('0x43')]=qs[_0x8d3e('0x3a')](_['pick'](_0x57f00a[_0x8d3e('0x39')],_0x519254[_0x8d3e('0x3a')]),_0x242b10);if(_0x57f00a[_0x8d3e('0x39')][_0x8d3e('0x44')]){_0x2eba00[_0x8d3e('0x43')]=_[_0x8d3e('0x45')](_0x2eba00[_0x8d3e('0x43')],{'$or':_[_0x8d3e('0x33')](_0x242b10,function(_0x4e3afe){if(_0x4e3afe[_0x8d3e('0x37')]!=='VIRTUAL'){var _0x4be76b={};_0x4be76b[_0x4e3afe[_0x8d3e('0x30')]]={'$like':'%'+_0x57f00a[_0x8d3e('0x39')][_0x8d3e('0x44')]+'%'};return _0x4be76b;}})});}_0x2eba00=_['merge']({},_0x2eba00,_0x57f00a[_0x8d3e('0x46')]);var _0x56439d={'where':_0x2eba00['where']};return db[_0x8d3e('0x34')]['count'](_0x56439d)[_0x8d3e('0x28')](function(_0x480b4f){_0x5c2f95['count']=_0x480b4f;if(_0x57f00a[_0x8d3e('0x39')][_0x8d3e('0x47')]){_0x2eba00[_0x8d3e('0x48')]=[{'all':!![]}];}return db[_0x8d3e('0x34')][_0x8d3e('0x49')](_0x2eba00);})['then'](function(_0x4f47c4){_0x5c2f95['rows']=_0x4f47c4;return _0x5c2f95;})['then'](respondWithFilteredResult(_0x37ffb1,_0x2eba00))[_0x8d3e('0x4a')](handleError(_0x37ffb1,null));};exports[_0x8d3e('0x4b')]=function(_0x522af8,_0x3a4513){var _0x1fc5bc={'raw':!![],'where':{'id':_0x522af8[_0x8d3e('0x4c')]['id']}},_0x24824a={};_0x24824a['model']=_[_0x8d3e('0x38')](db[_0x8d3e('0x34')][_0x8d3e('0x35')]);_0x24824a[_0x8d3e('0x39')]=_['keys'](_0x522af8['query']);_0x24824a[_0x8d3e('0x3a')]=_['intersection'](_0x24824a[_0x8d3e('0x3d')],_0x24824a[_0x8d3e('0x39')]);_0x1fc5bc[_0x8d3e('0x3c')]=_['intersection'](_0x24824a[_0x8d3e('0x3d')],qs[_0x8d3e('0x3e')](_0x522af8[_0x8d3e('0x39')][_0x8d3e('0x3e')]));_0x1fc5bc[_0x8d3e('0x3c')]=_0x1fc5bc['attributes'][_0x8d3e('0x3f')]?_0x1fc5bc[_0x8d3e('0x3c')]:_0x24824a['model'];if(_0x522af8[_0x8d3e('0x39')][_0x8d3e('0x47')]){_0x1fc5bc['include']=[{'all':!![]}];}_0x1fc5bc=_[_0x8d3e('0x45')]({},_0x1fc5bc,_0x522af8[_0x8d3e('0x46')]);return db[_0x8d3e('0x34')][_0x8d3e('0x4d')](_0x1fc5bc)['then'](handleEntityNotFound(_0x3a4513,null))[_0x8d3e('0x28')](respondWithResult(_0x3a4513,null))[_0x8d3e('0x4a')](handleError(_0x3a4513,null));};exports['create']=function(_0x2e6a46,_0x36d312){return db[_0x8d3e('0x34')]['create'](_0x2e6a46[_0x8d3e('0x4e')],{})['then'](function(_0x4c4fce){var _0x5ae6e7=_0x2e6a46[_0x8d3e('0x4f')][_0x8d3e('0x2a')]({'plain':!![]});if(!_0x5ae6e7)throw new Error(_0x8d3e('0x50'));if(_0x5ae6e7[_0x8d3e('0x51')]===_0x8d3e('0x4f')){var _0x214c13=_0x4c4fce['get']({'plain':!![]});var _0xf04bfc=_0x8d3e('0x2b');return db[_0x8d3e('0x52')][_0x8d3e('0x4d')]({'where':{'name':_0xf04bfc,'userProfileId':_0x5ae6e7['userProfileId']},'raw':!![]})[_0x8d3e('0x28')](function(_0x5aaab5){if(_0x5aaab5&&_0x5aaab5[_0x8d3e('0x53')]===0x0){return db['UserProfileResource'][_0x8d3e('0x54')]({'name':_0x214c13[_0x8d3e('0x30')],'resourceId':_0x214c13['id'],'type':_0x5aaab5[_0x8d3e('0x30')],'sectionId':_0x5aaab5['id']},{})[_0x8d3e('0x28')](function(){return _0x4c4fce;});}else{return _0x4c4fce;}})[_0x8d3e('0x4a')](function(_0x10eb47){logger[_0x8d3e('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10eb47);throw _0x10eb47;});}return _0x4c4fce;})[_0x8d3e('0x28')](respondWithResult(_0x36d312,0xc9))[_0x8d3e('0x4a')](handleError(_0x36d312,null));};exports[_0x8d3e('0x27')]=function(_0x4533e9,_0x105efe){if(_0x4533e9[_0x8d3e('0x4e')]['id']){delete _0x4533e9[_0x8d3e('0x4e')]['id'];}return db['WhatsappQueue'][_0x8d3e('0x4d')]({'where':{'id':_0x4533e9[_0x8d3e('0x4c')]['id']}})[_0x8d3e('0x28')](handleEntityNotFound(_0x105efe,null))[_0x8d3e('0x28')](saveUpdates(_0x4533e9[_0x8d3e('0x4e')],null))['then'](respondWithResult(_0x105efe,null))['catch'](handleError(_0x105efe,null));};exports[_0x8d3e('0x29')]=function(_0x5b55d3,_0x28660f){return db['WhatsappQueue']['find']({'where':{'id':_0x5b55d3['params']['id']}})['then'](handleEntityNotFound(_0x28660f,null))['then'](removeEntity(_0x28660f,null))[_0x8d3e('0x4a')](handleError(_0x28660f,null));};exports['describe']=function(_0x368dda,_0xb1c18){return db['WhatsappQueue'][_0x8d3e('0x55')]()[_0x8d3e('0x28')](respondWithResult(_0xb1c18,null))[_0x8d3e('0x4a')](handleError(_0xb1c18,null));};exports[_0x8d3e('0x56')]=function(_0x44bbd6,_0x458d38,_0x284f8e){var _0xed06e7={'raw':!![],'where':{}},_0x40e8b0={},_0x334743;return db[_0x8d3e('0x34')][_0x8d3e('0x57')]({'where':{'id':_0x44bbd6['params']['id']}})[_0x8d3e('0x28')](handleEntityNotFound(_0x458d38,null))['then'](function(_0x3f8700){if(_0x3f8700){_0x334743=_0x3f8700[_0x8d3e('0x2a')]({'plain':!![]});_0x40e8b0[_0x8d3e('0x3d')]=_[_0x8d3e('0x38')](db[_0x8d3e('0x58')][_0x8d3e('0x35')]);_0x40e8b0[_0x8d3e('0x39')]=_[_0x8d3e('0x38')](_0x44bbd6[_0x8d3e('0x39')]);_0x40e8b0[_0x8d3e('0x3a')]=_[_0x8d3e('0x3b')](_0x40e8b0[_0x8d3e('0x3d')],_0x40e8b0[_0x8d3e('0x39')]);_0xed06e7['attributes']=_[_0x8d3e('0x3b')](_0x40e8b0[_0x8d3e('0x3d')],qs[_0x8d3e('0x3e')](_0x44bbd6['query'][_0x8d3e('0x3e')]));_0xed06e7[_0x8d3e('0x3c')]=_0xed06e7['attributes']['length']?_0xed06e7[_0x8d3e('0x3c')]:_0x40e8b0['model'];if(!_0x44bbd6['query'][_0x8d3e('0x40')]('nolimit')){_0xed06e7[_0x8d3e('0x21')]=qs[_0x8d3e('0x21')](_0x44bbd6['query'][_0x8d3e('0x21')]);_0xed06e7[_0x8d3e('0x1f')]=qs[_0x8d3e('0x1f')](_0x44bbd6[_0x8d3e('0x39')]['offset']);}_0xed06e7[_0x8d3e('0x59')]=qs['sort'](_0x44bbd6[_0x8d3e('0x39')]['sort']);_0xed06e7[_0x8d3e('0x43')]=qs[_0x8d3e('0x3a')](_['pick'](_0x44bbd6[_0x8d3e('0x39')],_0x40e8b0['filters']));_0xed06e7[_0x8d3e('0x43')][_0x8d3e('0x5a')]=_0x3f8700['id'];if(_0x44bbd6[_0x8d3e('0x39')][_0x8d3e('0x44')]){_0xed06e7['where']=_[_0x8d3e('0x45')](_0xed06e7['where'],{'$or':_[_0x8d3e('0x33')](_0xed06e7['attributes'],function(_0x4b328e){var _0x53d2af={};_0x53d2af[_0x4b328e]={'$like':'%'+_0x44bbd6[_0x8d3e('0x39')][_0x8d3e('0x44')]+'%'};return _0x53d2af;})});}_0xed06e7=_['merge']({},_0xed06e7,_0x44bbd6[_0x8d3e('0x46')]);return db['UserWhatsappQueue'][_0x8d3e('0x49')](_0xed06e7);}})[_0x8d3e('0x28')](function(_0x20d86a){if(_0x20d86a){return db[_0x8d3e('0x5b')][_0x8d3e('0x5c')]({'where':{'id':_[_0x8d3e('0x33')](_0x20d86a,_0x8d3e('0x5d')),'role':_0x8d3e('0x5e')},'attributes':['id',_0x8d3e('0x30'),_0x8d3e('0x5f'),_0x8d3e('0x60'),_0x8d3e('0x61')]});}})['then'](function(_0x27208b){if(_0x27208b){return{'count':_0x27208b[_0x8d3e('0x22')],'rows':_[_0x8d3e('0x33')](_0x27208b[_0x8d3e('0x62')],function(_0x405f8c){return{'membername':_0x405f8c['name'],'UserId':_0x405f8c['id'],'queue_name':_0x334743[_0x8d3e('0x30')],'WhatsappQueueId':_0x334743['id'],'interface':util['format'](_0x8d3e('0x63'),_0x8d3e('0x64'),_0x405f8c[_0x8d3e('0x30')]),'penalty':0x0,'paused':_0x405f8c[_0x8d3e('0x5f')],'createdAt':_0x405f8c[_0x8d3e('0x61')],'updatedAt':_0x405f8c[_0x8d3e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d3e('0x28')](respondWithFilteredResult(_0x458d38,_0xed06e7))['catch'](handleError(_0x458d38,null));};exports[_0x8d3e('0x65')]=function(_0x5029b6,_0x220e3e,_0x559dfd){var _0xde0338={};var _0x7eee6e={};var _0x27ade7;var _0x27af63;return db[_0x8d3e('0x34')]['findOne']({'where':{'id':_0x5029b6[_0x8d3e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x220e3e,null))[_0x8d3e('0x28')](function(_0x384f07){if(_0x384f07){_0x27ade7=_0x384f07;_0x7eee6e[_0x8d3e('0x3d')]=_[_0x8d3e('0x38')](db['Team'][_0x8d3e('0x35')]);_0x7eee6e[_0x8d3e('0x39')]=_[_0x8d3e('0x38')](_0x5029b6[_0x8d3e('0x39')]);_0x7eee6e[_0x8d3e('0x3a')]=_[_0x8d3e('0x3b')](_0x7eee6e[_0x8d3e('0x3d')],_0x7eee6e[_0x8d3e('0x39')]);_0xde0338[_0x8d3e('0x3c')]=_[_0x8d3e('0x3b')](_0x7eee6e['model'],qs['fields'](_0x5029b6[_0x8d3e('0x39')][_0x8d3e('0x3e')]));_0xde0338[_0x8d3e('0x3c')]=_0xde0338['attributes'][_0x8d3e('0x3f')]?_0xde0338[_0x8d3e('0x3c')]:_0x7eee6e[_0x8d3e('0x3d')];_0xde0338[_0x8d3e('0x59')]=qs[_0x8d3e('0x42')](_0x5029b6[_0x8d3e('0x39')]['sort']);_0xde0338[_0x8d3e('0x43')]=qs[_0x8d3e('0x3a')](_[_0x8d3e('0x66')](_0x5029b6['query'],_0x7eee6e[_0x8d3e('0x3a')]));if(_0x5029b6['query'][_0x8d3e('0x44')]){_0xde0338[_0x8d3e('0x43')]=_[_0x8d3e('0x45')](_0xde0338[_0x8d3e('0x43')],{'$or':_[_0x8d3e('0x33')](_0xde0338[_0x8d3e('0x3c')],function(_0x3f5fb1){var _0x19aa88={};_0x19aa88[_0x3f5fb1]={'$like':'%'+_0x5029b6['query'][_0x8d3e('0x44')]+'%'};return _0x19aa88;})});}_0xde0338=_[_0x8d3e('0x45')]({},_0xde0338,_0x5029b6['options']);return _0x27ade7[_0x8d3e('0x65')](_0xde0338);}})[_0x8d3e('0x28')](function(_0xd7cb23){if(_0xd7cb23){_0x27af63=_0xd7cb23[_0x8d3e('0x3f')];if(!_0x5029b6[_0x8d3e('0x39')][_0x8d3e('0x40')]('nolimit')){_0xde0338['limit']=qs[_0x8d3e('0x21')](_0x5029b6[_0x8d3e('0x39')][_0x8d3e('0x21')]);_0xde0338['offset']=qs[_0x8d3e('0x1f')](_0x5029b6[_0x8d3e('0x39')][_0x8d3e('0x1f')]);}return _0x27ade7[_0x8d3e('0x65')](_0xde0338);}})[_0x8d3e('0x28')](function(_0x1ceac3){if(_0x1ceac3){return _0x1ceac3?{'count':_0x27af63,'rows':_0x1ceac3}:null;}})[_0x8d3e('0x28')](respondWithResult(_0x220e3e,null))[_0x8d3e('0x4a')](handleError(_0x220e3e,null));};exports[_0x8d3e('0x67')]=function(_0x2220bd,_0x39185f,_0x595930){var _0x17a14f=_0x2220bd[_0x8d3e('0x4e')][_0x8d3e('0x68')];return db[_0x8d3e('0x69')][_0x8d3e('0x49')]({'where':{'id':_0x17a14f},'attributes':['id'],'include':[{'model':db[_0x8d3e('0x5b')],'as':'Agents','attributes':['id',_0x8d3e('0x30'),'online','voicePause',_0x8d3e('0x6a')],'raw':!![]}]})[_0x8d3e('0x28')](function(_0x3d1591){if(_0x3d1591){var _0x16156e=_[_0x8d3e('0x6b')](_0x3d1591,function(_0x12c155){var _0x3e4535=_0x12c155['get']({'plain':!![]});return _0x3e4535[_0x8d3e('0x6c')];});return db['WhatsappQueue'][_0x8d3e('0x4d')]({'where':{'id':_0x2220bd[_0x8d3e('0x4c')]['id']}})[_0x8d3e('0x28')](function(_0x2ac719){return db[_0x8d3e('0x6d')][_0x8d3e('0x6e')](function(_0x5b6d91){return _0x2ac719['addTeams'](_0x17a14f,{'transaction':_0x5b6d91})['then'](function(){return BPromise[_0x8d3e('0x6f')](_0x16156e,function(_0x209a43){return db['UserWhatsappQueue'][_0x8d3e('0x70')]({'where':{'UserId':_0x209a43['id'],'WhatsappQueueId':_0x2220bd[_0x8d3e('0x4c')]['id']},'transaction':_0x5b6d91});});})[_0x8d3e('0x28')](function(){_0x16156e['forEach'](function(_0xde9dc7){socket[_0x8d3e('0x71')](_0x8d3e('0x72'),{'UserId':_0xde9dc7['id'],'WhatsappQueueId':_0x2ac719['id']});});});});});}})['then'](respondWithStatusCode(_0x39185f,null))['catch'](handleError(_0x39185f,null));};exports[_0x8d3e('0x73')]=function(_0x4b7e01,_0x715ed9,_0x40c1ea){return db[_0x8d3e('0x69')][_0x8d3e('0x49')]({'where':{'id':_0x4b7e01[_0x8d3e('0x39')][_0x8d3e('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d3e('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x8d3e('0x28')](handleEntityNotFound(_0x715ed9,null))[_0x8d3e('0x28')](function(_0x2668df){var _0x3150a9=_[_0x8d3e('0x33')](_0x2668df,'id');var _0x26de09=[];var _0x32b925=[];var _0x555502=squel[_0x8d3e('0x74')]();_0x555502[_0x8d3e('0x75')](_0x8d3e('0x76'))[_0x8d3e('0x77')](_0x8d3e('0x78'),'tq')[_0x8d3e('0x79')](_0x8d3e('0x7a'),'ut',_0x8d3e('0x7b'))[_0x8d3e('0x43')]('WhatsappQueueId\x20=\x20?',_0x4b7e01[_0x8d3e('0x4c')]['id']);for(var _0x45f574=0x0;_0x45f574<_0x2668df[_0x8d3e('0x3f')];_0x45f574+=0x1){let _0x51396a=_0x2668df[_0x45f574];for(var _0x266668=0x0;_0x266668<_0x51396a[_0x8d3e('0x6c')][_0x8d3e('0x3f')];_0x266668+=0x1){let _0x61a835=_0x51396a[_0x8d3e('0x6c')][_0x266668];var _0x5a947d=_0x555502[_0x8d3e('0x7c')]();_0x5a947d[_0x8d3e('0x43')](_0x8d3e('0x7d'),_0x61a835['id']);_0x32b925['push'](db[_0x8d3e('0x6d')][_0x8d3e('0x39')](_0x5a947d[_0x8d3e('0x7e')](),{'type':db['sequelize'][_0x8d3e('0x7f')][_0x8d3e('0x80')]})[_0x8d3e('0x28')](function(_0x761221){if(_0x761221[_0x8d3e('0x3f')]===0x1){return _0x61a835['id'];}else{var _0x3f3f6f=_['every'](_[_0x8d3e('0x33')](_0x761221,'TeamId'),function(_0x59a963){return _[_0x8d3e('0x81')](_0x3150a9,_0x59a963);});if(_0x3f3f6f){return _0x61a835['id'];}}}));}}return BPromise[_0x8d3e('0x82')](_0x32b925)[_0x8d3e('0x28')](function(_0x302b2c){_0x26de09=_(_0x26de09)[_0x8d3e('0x83')](_0x302b2c)[_0x8d3e('0x84')]()[_0x8d3e('0x85')]();return db['WhatsappQueue'][_0x8d3e('0x4d')]({'where':{'id':_0x4b7e01['params']['id']}})[_0x8d3e('0x28')](function(_0x452ec3){return db['sequelize']['transaction'](function(_0x200026){return _0x452ec3['removeTeams'](_0x4b7e01[_0x8d3e('0x39')][_0x8d3e('0x68')],{'transaction':_0x200026})[_0x8d3e('0x28')](function(){if(!_['isEmpty'](_0x26de09)){return _0x452ec3[_0x8d3e('0x86')](_0x26de09,{'transaction':_0x200026});}})['then'](function(){_0x26de09[_0x8d3e('0x87')](function(_0x2e0f26){socket[_0x8d3e('0x71')](_0x8d3e('0x88'),{'UserId':_0x2e0f26,'WhatsappQueueId':_0x452ec3['id']});});});});});});})[_0x8d3e('0x28')](respondWithStatusCode(_0x715ed9,null))['catch'](handleError(_0x715ed9,null));};exports[_0x8d3e('0x89')]=function(_0x54dee0,_0x516e7d,_0x3db924){return db[_0x8d3e('0x34')]['find']({'where':{'id':_0x54dee0[_0x8d3e('0x4c')]['id']}})[_0x8d3e('0x28')](handleEntityNotFound(_0x516e7d,null))[_0x8d3e('0x28')](function(_0x69c4a9){if(_0x69c4a9){return _0x69c4a9[_0x8d3e('0x89')](_0x54dee0['body'][_0x8d3e('0x68')],_[_0x8d3e('0x8a')](_0x54dee0[_0x8d3e('0x4e')],[_0x8d3e('0x68'),'id'])||{})[_0x8d3e('0x8b')](function(_0x58aaa2){for(var _0x313033=0x0;_0x313033<_0x54dee0['body']['ids'][_0x8d3e('0x3f')];_0x313033+=0x1){socket[_0x8d3e('0x71')](_0x8d3e('0x72'),{'UserId':Number(_0x54dee0['body'][_0x8d3e('0x68')][_0x313033]),'WhatsappQueueId':Number(_0x54dee0['params']['id'])});}return _0x58aaa2;});}})[_0x8d3e('0x28')](respondWithResult(_0x516e7d,null))[_0x8d3e('0x4a')](handleError(_0x516e7d,null));};exports['removeAgents']=function(_0x4588c7,_0x12a579,_0x55bc75){return db[_0x8d3e('0x34')]['find']({'where':{'id':_0x4588c7[_0x8d3e('0x4c')]['id']}})[_0x8d3e('0x28')](handleEntityNotFound(_0x12a579,null))[_0x8d3e('0x28')](function(_0x24626e){if(_0x24626e){return _0x24626e[_0x8d3e('0x86')](_0x4588c7[_0x8d3e('0x39')][_0x8d3e('0x68')])[_0x8d3e('0x28')](function(){if(_['isArray'](_0x4588c7['query'][_0x8d3e('0x68')])){for(var _0x2cdd67=0x0;_0x2cdd67<_0x4588c7[_0x8d3e('0x39')][_0x8d3e('0x68')]['length'];_0x2cdd67+=0x1){socket['emit'](_0x8d3e('0x88'),{'UserId':Number(_0x4588c7['query'][_0x8d3e('0x68')][_0x2cdd67]),'WhatsappQueueId':Number(_0x4588c7[_0x8d3e('0x4c')]['id'])});}}else{socket[_0x8d3e('0x71')](_0x8d3e('0x88'),{'UserId':Number(_0x4588c7[_0x8d3e('0x39')][_0x8d3e('0x68')]),'WhatsappQueueId':Number(_0x4588c7[_0x8d3e('0x4c')]['id'])});}});}})[_0x8d3e('0x28')](respondWithStatusCode(_0x12a579,null))[_0x8d3e('0x4a')](handleError(_0x12a579,null));};exports[_0x8d3e('0x8c')]=function(_0x484008,_0x4a0156,_0x3fa576){var _0x281563={};var _0x44e520={};var _0xe30ce9;var _0xaaf276;return db[_0x8d3e('0x34')][_0x8d3e('0x57')]({'where':{'id':_0x484008['params']['id']}})[_0x8d3e('0x28')](handleEntityNotFound(_0x4a0156,null))[_0x8d3e('0x28')](function(_0x520976){if(_0x520976){_0xe30ce9=_0x520976;_0x44e520[_0x8d3e('0x3d')]=_[_0x8d3e('0x38')](db[_0x8d3e('0x5b')][_0x8d3e('0x35')]);_0x44e520[_0x8d3e('0x39')]=_[_0x8d3e('0x38')](_0x484008[_0x8d3e('0x39')]);_0x44e520[_0x8d3e('0x3a')]=_[_0x8d3e('0x3b')](_0x44e520[_0x8d3e('0x3d')],_0x44e520[_0x8d3e('0x39')]);_0x281563['attributes']=_[_0x8d3e('0x3b')](_0x44e520[_0x8d3e('0x3d')],qs[_0x8d3e('0x3e')](_0x484008[_0x8d3e('0x39')][_0x8d3e('0x3e')]));_0x281563[_0x8d3e('0x3c')]=_0x281563[_0x8d3e('0x3c')][_0x8d3e('0x3f')]?_0x281563[_0x8d3e('0x3c')]:_0x44e520['model'];_0x281563[_0x8d3e('0x59')]=qs[_0x8d3e('0x42')](_0x484008['query'][_0x8d3e('0x42')]);_0x281563[_0x8d3e('0x43')]=qs[_0x8d3e('0x3a')](_[_0x8d3e('0x66')](_0x484008[_0x8d3e('0x39')],_0x44e520[_0x8d3e('0x3a')]));if(_0x484008['query'][_0x8d3e('0x44')]){_0x281563['where']=_['merge'](_0x281563[_0x8d3e('0x43')],{'$or':_[_0x8d3e('0x33')](_0x281563[_0x8d3e('0x3c')],function(_0x46094e){var _0x43bab4={};_0x43bab4[_0x46094e]={'$like':'%'+_0x484008[_0x8d3e('0x39')][_0x8d3e('0x44')]+'%'};return _0x43bab4;})});}_0x281563=_[_0x8d3e('0x45')]({},_0x281563,_0x484008['options']);return _0xe30ce9['getAgents'](_0x281563);}})[_0x8d3e('0x28')](function(_0x4736b1){if(_0x4736b1){_0xaaf276=_0x4736b1['length'];if(!_0x484008[_0x8d3e('0x39')][_0x8d3e('0x40')](_0x8d3e('0x41'))){_0x281563[_0x8d3e('0x21')]=qs['limit'](_0x484008[_0x8d3e('0x39')]['limit']);_0x281563['offset']=qs[_0x8d3e('0x1f')](_0x484008[_0x8d3e('0x39')][_0x8d3e('0x1f')]);}return _0xe30ce9['getAgents'](_0x281563);}})[_0x8d3e('0x28')](function(_0x3547bf){if(_0x3547bf){return _0x3547bf?{'count':_0xaaf276,'rows':_0x3547bf}:null;}})[_0x8d3e('0x28')](respondWithResult(_0x4a0156,null))[_0x8d3e('0x4a')](handleError(_0x4a0156,null));}; \ No newline at end of file +var _0x1afd=['length','options','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserWhatsappQueue','pick','WhatsappQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','whatsappPause','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','name','send','index','WhatsappQueue','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','include','findAll','catch','show','params'];(function(_0x4a848a,_0x2e09e1){var _0x396f47=function(_0x51bd0a){while(--_0x51bd0a){_0x4a848a['push'](_0x4a848a['shift']());}};_0x396f47(++_0x2e09e1);}(_0x1afd,0xca));var _0xd1af=function(_0x202b8e,_0xd9f859){_0x202b8e=_0x202b8e-0x0;var _0x3beb83=_0x1afd[_0x202b8e];return _0x3beb83;};'use strict';var emlformat=require(_0xd1af('0x0'));var rimraf=require(_0xd1af('0x1'));var zipdir=require(_0xd1af('0x2'));var jsonpatch=require(_0xd1af('0x3'));var rp=require(_0xd1af('0x4'));var moment=require(_0xd1af('0x5'));var BPromise=require(_0xd1af('0x6'));var Mustache=require('mustache');var util=require(_0xd1af('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd1af('0x8'));var fs=require('fs');var fs_extra=require(_0xd1af('0x9'));var _=require(_0xd1af('0xa'));var squel=require(_0xd1af('0xb'));var crypto=require(_0xd1af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1af('0xd'));var toCsv=require(_0xd1af('0xe'));var querystring=require(_0xd1af('0xf'));var Papa=require(_0xd1af('0x10'));var Redis=require(_0xd1af('0x11'));var authService=require(_0xd1af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1af('0x13'));var hardwareService=require(_0xd1af('0x14'));var logger=require(_0xd1af('0x15'))(_0xd1af('0x16'));var utils=require(_0xd1af('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd1af('0x18'));var db=require(_0xd1af('0x19'))['db'];config[_0xd1af('0x1a')]=_['defaults'](config[_0xd1af('0x1a')],{'host':_0xd1af('0x1b'),'port':0x18eb});var socket=require(_0xd1af('0x1c'))(new Redis(config['redis']));require(_0xd1af('0x1d'))[_0xd1af('0x1e')](socket);function respondWithStatusCode(_0x46c54d,_0xb121de){_0xb121de=_0xb121de||0xcc;return function(_0x116585){if(_0x116585){return _0x46c54d[_0xd1af('0x1f')](_0xb121de);}return _0x46c54d[_0xd1af('0x20')](_0xb121de)['end']();};}function respondWithResult(_0x51fcac,_0x3ce996){_0x3ce996=_0x3ce996||0xc8;return function(_0x10d8f6){if(_0x10d8f6){return _0x51fcac[_0xd1af('0x20')](_0x3ce996)[_0xd1af('0x21')](_0x10d8f6);}};}function respondWithFilteredResult(_0x24b8dd,_0x3c7939){return function(_0x49302){if(_0x49302){var _0x280200=typeof _0x3c7939['offset']===_0xd1af('0x22')&&typeof _0x3c7939[_0xd1af('0x23')]===_0xd1af('0x22');var _0x3b9423=_0x49302[_0xd1af('0x24')];var _0x5de732=_0x280200?0x0:_0x3c7939[_0xd1af('0x25')];var _0x42eb37=_0x280200?_0x49302[_0xd1af('0x24')]:_0x3c7939['offset']+_0x3c7939[_0xd1af('0x23')];var _0x28b4b6;if(_0x42eb37>=_0x3b9423){_0x42eb37=_0x3b9423;_0x28b4b6=0xc8;}else{_0x28b4b6=0xce;}_0x24b8dd[_0xd1af('0x20')](_0x28b4b6);return _0x24b8dd['set'](_0xd1af('0x26'),_0x5de732+'-'+_0x42eb37+'/'+_0x3b9423)[_0xd1af('0x21')](_0x49302);}return null;};}function patchUpdates(_0x25ff47){return function(_0x8ad36f){try{jsonpatch['apply'](_0x8ad36f,_0x25ff47,!![]);}catch(_0x3e2af6){return BPromise[_0xd1af('0x27')](_0x3e2af6);}return _0x8ad36f[_0xd1af('0x28')]();};}function saveUpdates(_0x3a4ead,_0x4f9ded){return function(_0x532339){if(_0x532339){return _0x532339[_0xd1af('0x29')](_0x3a4ead)[_0xd1af('0x2a')](function(_0x122a3e){return _0x122a3e;});}return null;};}function removeEntity(_0x22bd1d,_0x49c5e7){return function(_0x311b36){if(_0x311b36){return _0x311b36[_0xd1af('0x2b')]()['then'](function(){var _0x1c38e1=_0x311b36[_0xd1af('0x2c')]({'plain':!![]});var _0x11ed33=_0xd1af('0x2d');return db[_0xd1af('0x2e')][_0xd1af('0x2b')]({'where':{'type':_0x11ed33,'resourceId':_0x1c38e1['id']}})['then'](function(){return _0x311b36;});})[_0xd1af('0x2a')](function(){_0x22bd1d[_0xd1af('0x20')](0xcc)[_0xd1af('0x2f')]();});}};}function handleEntityNotFound(_0x8b2f3b,_0x15ddab){return function(_0x49dc03){if(!_0x49dc03){_0x8b2f3b[_0xd1af('0x1f')](0x194);}return _0x49dc03;};}function handleError(_0x405db3,_0x4084c0){_0x4084c0=_0x4084c0||0x1f4;return function(_0x4f072f){logger[_0xd1af('0x30')](_0x4f072f['stack']);if(_0x4f072f[_0xd1af('0x31')]){delete _0x4f072f[_0xd1af('0x31')];}_0x405db3[_0xd1af('0x20')](_0x4084c0)[_0xd1af('0x32')](_0x4f072f);};}exports[_0xd1af('0x33')]=function(_0x22fbca,_0x56f5fa){var _0x49ff4e={},_0x454f41={},_0x3a74ca={'count':0x0,'rows':[]};var _0x4267bb=_['map'](db[_0xd1af('0x34')][_0xd1af('0x35')],function(_0x46de46){return{'name':_0x46de46[_0xd1af('0x36')],'type':_0x46de46['type'][_0xd1af('0x37')]};});_0x454f41['model']=_[_0xd1af('0x38')](_0x4267bb,'name');_0x454f41[_0xd1af('0x39')]=_[_0xd1af('0x3a')](_0x22fbca[_0xd1af('0x39')]);_0x454f41[_0xd1af('0x3b')]=_[_0xd1af('0x3c')](_0x454f41[_0xd1af('0x3d')],_0x454f41[_0xd1af('0x39')]);_0x49ff4e['attributes']=_[_0xd1af('0x3c')](_0x454f41[_0xd1af('0x3d')],qs[_0xd1af('0x3e')](_0x22fbca['query'][_0xd1af('0x3e')]));_0x49ff4e['attributes']=_0x49ff4e['attributes']['length']?_0x49ff4e[_0xd1af('0x3f')]:_0x454f41[_0xd1af('0x3d')];if(!_0x22fbca[_0xd1af('0x39')][_0xd1af('0x40')](_0xd1af('0x41'))){_0x49ff4e[_0xd1af('0x23')]=qs[_0xd1af('0x23')](_0x22fbca[_0xd1af('0x39')][_0xd1af('0x23')]);_0x49ff4e[_0xd1af('0x25')]=qs[_0xd1af('0x25')](_0x22fbca['query'][_0xd1af('0x25')]);}_0x49ff4e[_0xd1af('0x42')]=qs[_0xd1af('0x43')](_0x22fbca[_0xd1af('0x39')][_0xd1af('0x43')]);_0x49ff4e[_0xd1af('0x44')]=qs['filters'](_['pick'](_0x22fbca[_0xd1af('0x39')],_0x454f41[_0xd1af('0x3b')]),_0x4267bb);if(_0x22fbca[_0xd1af('0x39')]['filter']){_0x49ff4e[_0xd1af('0x44')]=_[_0xd1af('0x45')](_0x49ff4e[_0xd1af('0x44')],{'$or':_[_0xd1af('0x38')](_0x4267bb,function(_0x1fcb04){if(_0x1fcb04[_0xd1af('0x46')]!==_0xd1af('0x47')){var _0x5781a8={};_0x5781a8[_0x1fcb04[_0xd1af('0x31')]]={'$like':'%'+_0x22fbca[_0xd1af('0x39')][_0xd1af('0x48')]+'%'};return _0x5781a8;}})});}_0x49ff4e=_[_0xd1af('0x45')]({},_0x49ff4e,_0x22fbca['options']);var _0x354bfd={'where':_0x49ff4e[_0xd1af('0x44')]};return db['WhatsappQueue']['count'](_0x354bfd)[_0xd1af('0x2a')](function(_0x17e8a6){_0x3a74ca[_0xd1af('0x24')]=_0x17e8a6;if(_0x22fbca[_0xd1af('0x39')]['includeAll']){_0x49ff4e[_0xd1af('0x49')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xd1af('0x4a')](_0x49ff4e);})[_0xd1af('0x2a')](function(_0x312ce2){_0x3a74ca['rows']=_0x312ce2;return _0x3a74ca;})[_0xd1af('0x2a')](respondWithFilteredResult(_0x56f5fa,_0x49ff4e))[_0xd1af('0x4b')](handleError(_0x56f5fa,null));};exports[_0xd1af('0x4c')]=function(_0x14a652,_0x5c1c5d){var _0x3217ee={'raw':!![],'where':{'id':_0x14a652[_0xd1af('0x4d')]['id']}},_0x9fb1a3={};_0x9fb1a3['model']=_['keys'](db[_0xd1af('0x34')][_0xd1af('0x35')]);_0x9fb1a3[_0xd1af('0x39')]=_[_0xd1af('0x3a')](_0x14a652['query']);_0x9fb1a3[_0xd1af('0x3b')]=_['intersection'](_0x9fb1a3['model'],_0x9fb1a3[_0xd1af('0x39')]);_0x3217ee[_0xd1af('0x3f')]=_[_0xd1af('0x3c')](_0x9fb1a3[_0xd1af('0x3d')],qs[_0xd1af('0x3e')](_0x14a652[_0xd1af('0x39')][_0xd1af('0x3e')]));_0x3217ee[_0xd1af('0x3f')]=_0x3217ee[_0xd1af('0x3f')][_0xd1af('0x4e')]?_0x3217ee[_0xd1af('0x3f')]:_0x9fb1a3['model'];if(_0x14a652['query']['includeAll']){_0x3217ee['include']=[{'all':!![]}];}_0x3217ee=_[_0xd1af('0x45')]({},_0x3217ee,_0x14a652[_0xd1af('0x4f')]);return db[_0xd1af('0x34')][_0xd1af('0x50')](_0x3217ee)['then'](handleEntityNotFound(_0x5c1c5d,null))[_0xd1af('0x2a')](respondWithResult(_0x5c1c5d,null))[_0xd1af('0x4b')](handleError(_0x5c1c5d,null));};exports['create']=function(_0x1f86a3,_0x50e020){return db['WhatsappQueue'][_0xd1af('0x51')](_0x1f86a3['body'],{})[_0xd1af('0x2a')](function(_0x5bc5f5){var _0x10ec48=_0x1f86a3[_0xd1af('0x52')][_0xd1af('0x2c')]({'plain':!![]});if(!_0x10ec48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10ec48['role']===_0xd1af('0x52')){var _0x277e42=_0x5bc5f5['get']({'plain':!![]});var _0x2c30f2=_0xd1af('0x2d');return db['UserProfileSection'][_0xd1af('0x50')]({'where':{'name':_0x2c30f2,'userProfileId':_0x10ec48[_0xd1af('0x53')]},'raw':!![]})[_0xd1af('0x2a')](function(_0x4d979d){if(_0x4d979d&&_0x4d979d[_0xd1af('0x54')]===0x0){return db[_0xd1af('0x2e')][_0xd1af('0x51')]({'name':_0x277e42[_0xd1af('0x31')],'resourceId':_0x277e42['id'],'type':_0x4d979d[_0xd1af('0x31')],'sectionId':_0x4d979d['id']},{})[_0xd1af('0x2a')](function(){return _0x5bc5f5;});}else{return _0x5bc5f5;}})['catch'](function(_0x9fc1af){logger[_0xd1af('0x30')](_0xd1af('0x55'),_0x9fc1af);throw _0x9fc1af;});}return _0x5bc5f5;})['then'](respondWithResult(_0x50e020,0xc9))['catch'](handleError(_0x50e020,null));};exports[_0xd1af('0x29')]=function(_0x2490cc,_0x18325c){if(_0x2490cc[_0xd1af('0x56')]['id']){delete _0x2490cc[_0xd1af('0x56')]['id'];}return db[_0xd1af('0x34')][_0xd1af('0x50')]({'where':{'id':_0x2490cc[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x18325c,null))[_0xd1af('0x2a')](saveUpdates(_0x2490cc[_0xd1af('0x56')],null))[_0xd1af('0x2a')](respondWithResult(_0x18325c,null))[_0xd1af('0x4b')](handleError(_0x18325c,null));};exports[_0xd1af('0x2b')]=function(_0x53b0a4,_0x4e4202){return db[_0xd1af('0x34')]['find']({'where':{'id':_0x53b0a4[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x4e4202,null))['then'](removeEntity(_0x4e4202,null))[_0xd1af('0x4b')](handleError(_0x4e4202,null));};exports[_0xd1af('0x57')]=function(_0xcf8fd4,_0x731c0c){return db[_0xd1af('0x34')]['describe']()[_0xd1af('0x2a')](respondWithResult(_0x731c0c,null))[_0xd1af('0x4b')](handleError(_0x731c0c,null));};exports['getMembers']=function(_0xf3288e,_0x3cc539,_0x260358){var _0x2eb91e={'raw':!![],'where':{}},_0x4305bd={},_0x4f7a70;return db[_0xd1af('0x34')][_0xd1af('0x58')]({'where':{'id':_0xf3288e[_0xd1af('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3cc539,null))[_0xd1af('0x2a')](function(_0x1636be){if(_0x1636be){_0x4f7a70=_0x1636be['get']({'plain':!![]});_0x4305bd['model']=_['keys'](db[_0xd1af('0x59')][_0xd1af('0x35')]);_0x4305bd[_0xd1af('0x39')]=_[_0xd1af('0x3a')](_0xf3288e[_0xd1af('0x39')]);_0x4305bd['filters']=_[_0xd1af('0x3c')](_0x4305bd[_0xd1af('0x3d')],_0x4305bd['query']);_0x2eb91e[_0xd1af('0x3f')]=_[_0xd1af('0x3c')](_0x4305bd['model'],qs['fields'](_0xf3288e['query'][_0xd1af('0x3e')]));_0x2eb91e['attributes']=_0x2eb91e[_0xd1af('0x3f')][_0xd1af('0x4e')]?_0x2eb91e[_0xd1af('0x3f')]:_0x4305bd[_0xd1af('0x3d')];if(!_0xf3288e[_0xd1af('0x39')][_0xd1af('0x40')](_0xd1af('0x41'))){_0x2eb91e[_0xd1af('0x23')]=qs[_0xd1af('0x23')](_0xf3288e[_0xd1af('0x39')][_0xd1af('0x23')]);_0x2eb91e[_0xd1af('0x25')]=qs[_0xd1af('0x25')](_0xf3288e[_0xd1af('0x39')][_0xd1af('0x25')]);}_0x2eb91e['order']=qs['sort'](_0xf3288e[_0xd1af('0x39')][_0xd1af('0x43')]);_0x2eb91e[_0xd1af('0x44')]=qs['filters'](_[_0xd1af('0x5a')](_0xf3288e[_0xd1af('0x39')],_0x4305bd[_0xd1af('0x3b')]));_0x2eb91e[_0xd1af('0x44')][_0xd1af('0x5b')]=_0x1636be['id'];if(_0xf3288e[_0xd1af('0x39')][_0xd1af('0x48')]){_0x2eb91e[_0xd1af('0x44')]=_[_0xd1af('0x45')](_0x2eb91e[_0xd1af('0x44')],{'$or':_[_0xd1af('0x38')](_0x2eb91e['attributes'],function(_0x4e2414){var _0x40fddd={};_0x40fddd[_0x4e2414]={'$like':'%'+_0xf3288e[_0xd1af('0x39')][_0xd1af('0x48')]+'%'};return _0x40fddd;})});}_0x2eb91e=_[_0xd1af('0x45')]({},_0x2eb91e,_0xf3288e[_0xd1af('0x4f')]);return db['UserWhatsappQueue'][_0xd1af('0x4a')](_0x2eb91e);}})[_0xd1af('0x2a')](function(_0x4c2b8a){if(_0x4c2b8a){return db['User'][_0xd1af('0x5c')]({'where':{'id':_['map'](_0x4c2b8a,_0xd1af('0x5d')),'role':_0xd1af('0x5e')},'attributes':['id',_0xd1af('0x31'),'whatsappPause',_0xd1af('0x5f'),_0xd1af('0x60')]});}})['then'](function(_0x179a50){if(_0x179a50){return{'count':_0x179a50['count'],'rows':_['map'](_0x179a50[_0xd1af('0x61')],function(_0x587522){return{'membername':_0x587522[_0xd1af('0x31')],'UserId':_0x587522['id'],'queue_name':_0x4f7a70[_0xd1af('0x31')],'WhatsappQueueId':_0x4f7a70['id'],'interface':util['format'](_0xd1af('0x62'),_0xd1af('0x63'),_0x587522[_0xd1af('0x31')]),'penalty':0x0,'paused':_0x587522[_0xd1af('0x64')],'createdAt':_0x587522['createdAt'],'updatedAt':_0x587522[_0xd1af('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd1af('0x2a')](respondWithFilteredResult(_0x3cc539,_0x2eb91e))[_0xd1af('0x4b')](handleError(_0x3cc539,null));};exports[_0xd1af('0x65')]=function(_0x586a30,_0x37df70,_0xc6c97){var _0x2fa19a={};var _0xc1d5b2={};var _0x3dd191;var _0x42d5bd;return db[_0xd1af('0x34')][_0xd1af('0x58')]({'where':{'id':_0x586a30[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x37df70,null))[_0xd1af('0x2a')](function(_0x5bb895){if(_0x5bb895){_0x3dd191=_0x5bb895;_0xc1d5b2[_0xd1af('0x3d')]=_[_0xd1af('0x3a')](db[_0xd1af('0x66')]['rawAttributes']);_0xc1d5b2['query']=_[_0xd1af('0x3a')](_0x586a30['query']);_0xc1d5b2[_0xd1af('0x3b')]=_['intersection'](_0xc1d5b2['model'],_0xc1d5b2['query']);_0x2fa19a['attributes']=_['intersection'](_0xc1d5b2['model'],qs[_0xd1af('0x3e')](_0x586a30[_0xd1af('0x39')]['fields']));_0x2fa19a[_0xd1af('0x3f')]=_0x2fa19a[_0xd1af('0x3f')]['length']?_0x2fa19a[_0xd1af('0x3f')]:_0xc1d5b2['model'];_0x2fa19a[_0xd1af('0x42')]=qs[_0xd1af('0x43')](_0x586a30[_0xd1af('0x39')][_0xd1af('0x43')]);_0x2fa19a['where']=qs[_0xd1af('0x3b')](_[_0xd1af('0x5a')](_0x586a30[_0xd1af('0x39')],_0xc1d5b2[_0xd1af('0x3b')]));if(_0x586a30[_0xd1af('0x39')][_0xd1af('0x48')]){_0x2fa19a[_0xd1af('0x44')]=_[_0xd1af('0x45')](_0x2fa19a[_0xd1af('0x44')],{'$or':_['map'](_0x2fa19a[_0xd1af('0x3f')],function(_0x1c0324){var _0x1d4da9={};_0x1d4da9[_0x1c0324]={'$like':'%'+_0x586a30[_0xd1af('0x39')][_0xd1af('0x48')]+'%'};return _0x1d4da9;})});}_0x2fa19a=_[_0xd1af('0x45')]({},_0x2fa19a,_0x586a30[_0xd1af('0x4f')]);return _0x3dd191[_0xd1af('0x65')](_0x2fa19a);}})[_0xd1af('0x2a')](function(_0x661718){if(_0x661718){_0x42d5bd=_0x661718[_0xd1af('0x4e')];if(!_0x586a30[_0xd1af('0x39')][_0xd1af('0x40')]('nolimit')){_0x2fa19a[_0xd1af('0x23')]=qs[_0xd1af('0x23')](_0x586a30['query'][_0xd1af('0x23')]);_0x2fa19a[_0xd1af('0x25')]=qs[_0xd1af('0x25')](_0x586a30[_0xd1af('0x39')][_0xd1af('0x25')]);}return _0x3dd191[_0xd1af('0x65')](_0x2fa19a);}})[_0xd1af('0x2a')](function(_0x43be86){if(_0x43be86){return _0x43be86?{'count':_0x42d5bd,'rows':_0x43be86}:null;}})[_0xd1af('0x2a')](respondWithResult(_0x37df70,null))[_0xd1af('0x4b')](handleError(_0x37df70,null));};exports[_0xd1af('0x67')]=function(_0x22d944,_0x37ad38,_0x1d1b1a){var _0x4a61c6=_0x22d944[_0xd1af('0x56')][_0xd1af('0x68')];return db['Team']['findAll']({'where':{'id':_0x4a61c6},'attributes':['id'],'include':[{'model':db[_0xd1af('0x69')],'as':_0xd1af('0x6a'),'attributes':['id','name',_0xd1af('0x6b'),_0xd1af('0x6c'),'interface'],'raw':!![]}]})[_0xd1af('0x2a')](function(_0x4a37bf){if(_0x4a37bf){var _0x3ad242=_[_0xd1af('0x6d')](_0x4a37bf,function(_0x215935){var _0x65543c=_0x215935[_0xd1af('0x2c')]({'plain':!![]});return _0x65543c[_0xd1af('0x6a')];});return db[_0xd1af('0x34')][_0xd1af('0x50')]({'where':{'id':_0x22d944[_0xd1af('0x4d')]['id']}})['then'](function(_0x204b9b){return db[_0xd1af('0x6e')][_0xd1af('0x6f')](function(_0x2c57d0){return _0x204b9b[_0xd1af('0x67')](_0x4a61c6,{'transaction':_0x2c57d0})['then'](function(){return BPromise[_0xd1af('0x70')](_0x3ad242,function(_0x53a7c6){return db[_0xd1af('0x59')][_0xd1af('0x71')]({'where':{'UserId':_0x53a7c6['id'],'WhatsappQueueId':_0x22d944[_0xd1af('0x4d')]['id']},'transaction':_0x2c57d0});});})['then'](function(){_0x3ad242[_0xd1af('0x72')](function(_0x569b16){socket[_0xd1af('0x73')]('userWhatsappQueue:save',{'UserId':_0x569b16['id'],'WhatsappQueueId':_0x204b9b['id']});});});});});}})[_0xd1af('0x2a')](respondWithStatusCode(_0x37ad38,null))[_0xd1af('0x4b')](handleError(_0x37ad38,null));};exports[_0xd1af('0x74')]=function(_0x7806e7,_0x576b51,_0x5bd342){return db['Team']['findAll']({'where':{'id':_0x7806e7[_0xd1af('0x39')][_0xd1af('0x68')]},'attributes':['id'],'include':[{'model':db[_0xd1af('0x69')],'as':_0xd1af('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x576b51,null))[_0xd1af('0x2a')](function(_0x67f1e3){var _0x28ccde=_['map'](_0x67f1e3,'id');var _0x977d79=[];var _0x46e3fe=[];var _0x24bf5a=squel['select']();_0x24bf5a[_0xd1af('0x75')](_0xd1af('0x76'))[_0xd1af('0x77')](_0xd1af('0x78'),'tq')[_0xd1af('0x79')](_0xd1af('0x7a'),'ut',_0xd1af('0x7b'))[_0xd1af('0x44')]('WhatsappQueueId\x20=\x20?',_0x7806e7['params']['id']);for(var _0xe6ad11=0x0;_0xe6ad11<_0x67f1e3[_0xd1af('0x4e')];_0xe6ad11+=0x1){let _0x11392a=_0x67f1e3[_0xe6ad11];for(var _0x2de296=0x0;_0x2de296<_0x11392a[_0xd1af('0x6a')]['length'];_0x2de296+=0x1){let _0x32dbd9=_0x11392a[_0xd1af('0x6a')][_0x2de296];var _0xf5ee19=_0x24bf5a['clone']();_0xf5ee19[_0xd1af('0x44')]('ut.UserId\x20=\x20?',_0x32dbd9['id']);_0x46e3fe[_0xd1af('0x7c')](db[_0xd1af('0x6e')][_0xd1af('0x39')](_0xf5ee19[_0xd1af('0x7d')](),{'type':db[_0xd1af('0x6e')]['QueryTypes'][_0xd1af('0x7e')]})[_0xd1af('0x2a')](function(_0x398f4b){if(_0x398f4b[_0xd1af('0x4e')]===0x1){return _0x32dbd9['id'];}else{var _0x5a1131=_[_0xd1af('0x7f')](_[_0xd1af('0x38')](_0x398f4b,_0xd1af('0x80')),function(_0x5dd360){return _[_0xd1af('0x81')](_0x28ccde,_0x5dd360);});if(_0x5a1131){return _0x32dbd9['id'];}}}));}}return BPromise[_0xd1af('0x82')](_0x46e3fe)[_0xd1af('0x2a')](function(_0x322f62){_0x977d79=_(_0x977d79)[_0xd1af('0x83')](_0x322f62)[_0xd1af('0x84')]()['value']();return db[_0xd1af('0x34')]['find']({'where':{'id':_0x7806e7[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](function(_0x264029){return db[_0xd1af('0x6e')][_0xd1af('0x6f')](function(_0x94298a){return _0x264029[_0xd1af('0x74')](_0x7806e7[_0xd1af('0x39')][_0xd1af('0x68')],{'transaction':_0x94298a})[_0xd1af('0x2a')](function(){if(!_[_0xd1af('0x85')](_0x977d79)){return _0x264029[_0xd1af('0x86')](_0x977d79,{'transaction':_0x94298a});}})[_0xd1af('0x2a')](function(){_0x977d79['forEach'](function(_0x2224e4){socket[_0xd1af('0x73')]('userWhatsappQueue:remove',{'UserId':_0x2224e4,'WhatsappQueueId':_0x264029['id']});});});});});});})[_0xd1af('0x2a')](respondWithStatusCode(_0x576b51,null))[_0xd1af('0x4b')](handleError(_0x576b51,null));};exports[_0xd1af('0x87')]=function(_0x148eee,_0x2856b6,_0x5dde75){return db['WhatsappQueue'][_0xd1af('0x50')]({'where':{'id':_0x148eee[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x2856b6,null))[_0xd1af('0x2a')](function(_0x9c567b){if(_0x9c567b){return _0x9c567b[_0xd1af('0x87')](_0x148eee[_0xd1af('0x56')][_0xd1af('0x68')],_['omit'](_0x148eee[_0xd1af('0x56')],['ids','id'])||{})[_0xd1af('0x88')](function(_0x2cc026){for(var _0xfecda7=0x0;_0xfecda7<_0x148eee[_0xd1af('0x56')][_0xd1af('0x68')][_0xd1af('0x4e')];_0xfecda7+=0x1){socket[_0xd1af('0x73')]('userWhatsappQueue:save',{'UserId':Number(_0x148eee[_0xd1af('0x56')][_0xd1af('0x68')][_0xfecda7]),'WhatsappQueueId':Number(_0x148eee[_0xd1af('0x4d')]['id'])});}return _0x2cc026;});}})['then'](respondWithResult(_0x2856b6,null))['catch'](handleError(_0x2856b6,null));};exports[_0xd1af('0x86')]=function(_0x1f4041,_0x461fcc,_0x360538){return db[_0xd1af('0x34')]['find']({'where':{'id':_0x1f4041[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x461fcc,null))[_0xd1af('0x2a')](function(_0x457724){if(_0x457724){return _0x457724[_0xd1af('0x86')](_0x1f4041[_0xd1af('0x39')][_0xd1af('0x68')])[_0xd1af('0x2a')](function(){if(_[_0xd1af('0x89')](_0x1f4041[_0xd1af('0x39')]['ids'])){for(var _0x4c6c18=0x0;_0x4c6c18<_0x1f4041[_0xd1af('0x39')][_0xd1af('0x68')]['length'];_0x4c6c18+=0x1){socket[_0xd1af('0x73')](_0xd1af('0x8a'),{'UserId':Number(_0x1f4041[_0xd1af('0x39')][_0xd1af('0x68')][_0x4c6c18]),'WhatsappQueueId':Number(_0x1f4041[_0xd1af('0x4d')]['id'])});}}else{socket['emit'](_0xd1af('0x8a'),{'UserId':Number(_0x1f4041[_0xd1af('0x39')][_0xd1af('0x68')]),'WhatsappQueueId':Number(_0x1f4041[_0xd1af('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x461fcc,null))[_0xd1af('0x4b')](handleError(_0x461fcc,null));};exports[_0xd1af('0x8b')]=function(_0x118137,_0x5be711,_0xa7e76e){var _0x4dc52a={};var _0x78927d={};var _0x3bfdf8;var _0x2c2dc1;return db['WhatsappQueue'][_0xd1af('0x58')]({'where':{'id':_0x118137[_0xd1af('0x4d')]['id']}})[_0xd1af('0x2a')](handleEntityNotFound(_0x5be711,null))[_0xd1af('0x2a')](function(_0xffc71b){if(_0xffc71b){_0x3bfdf8=_0xffc71b;_0x78927d[_0xd1af('0x3d')]=_['keys'](db[_0xd1af('0x69')]['rawAttributes']);_0x78927d[_0xd1af('0x39')]=_[_0xd1af('0x3a')](_0x118137[_0xd1af('0x39')]);_0x78927d[_0xd1af('0x3b')]=_[_0xd1af('0x3c')](_0x78927d[_0xd1af('0x3d')],_0x78927d['query']);_0x4dc52a['attributes']=_[_0xd1af('0x3c')](_0x78927d['model'],qs['fields'](_0x118137['query'][_0xd1af('0x3e')]));_0x4dc52a[_0xd1af('0x3f')]=_0x4dc52a['attributes'][_0xd1af('0x4e')]?_0x4dc52a['attributes']:_0x78927d[_0xd1af('0x3d')];_0x4dc52a['order']=qs['sort'](_0x118137[_0xd1af('0x39')][_0xd1af('0x43')]);_0x4dc52a[_0xd1af('0x44')]=qs['filters'](_[_0xd1af('0x5a')](_0x118137[_0xd1af('0x39')],_0x78927d[_0xd1af('0x3b')]));if(_0x118137[_0xd1af('0x39')]['filter']){_0x4dc52a['where']=_[_0xd1af('0x45')](_0x4dc52a[_0xd1af('0x44')],{'$or':_[_0xd1af('0x38')](_0x4dc52a[_0xd1af('0x3f')],function(_0xbc9ffd){var _0x4cccd9={};_0x4cccd9[_0xbc9ffd]={'$like':'%'+_0x118137['query'][_0xd1af('0x48')]+'%'};return _0x4cccd9;})});}_0x4dc52a=_['merge']({},_0x4dc52a,_0x118137[_0xd1af('0x4f')]);return _0x3bfdf8['getAgents'](_0x4dc52a);}})[_0xd1af('0x2a')](function(_0x58c350){if(_0x58c350){_0x2c2dc1=_0x58c350['length'];if(!_0x118137[_0xd1af('0x39')][_0xd1af('0x40')](_0xd1af('0x41'))){_0x4dc52a[_0xd1af('0x23')]=qs[_0xd1af('0x23')](_0x118137[_0xd1af('0x39')][_0xd1af('0x23')]);_0x4dc52a[_0xd1af('0x25')]=qs[_0xd1af('0x25')](_0x118137[_0xd1af('0x39')][_0xd1af('0x25')]);}return _0x3bfdf8[_0xd1af('0x8b')](_0x4dc52a);}})[_0xd1af('0x2a')](function(_0x5be93a){if(_0x5be93a){return _0x5be93a?{'count':_0x2c2dc1,'rows':_0x5be93a}:null;}})[_0xd1af('0x2a')](respondWithResult(_0x5be711,null))[_0xd1af('0x4b')](handleError(_0x5be711,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a3fa080..9010b86 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1383=['hasOwnProperty','hook','../../mysqldb','WhatsappQueue','update','emit'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x1383,0xb0));var _0x3138=function(_0x541a59,_0x37c22a){_0x541a59=_0x541a59-0x0;var _0x54168b=_0x1383[_0x541a59];return _0x54168b;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x3138('0x0'))['db'][_0x3138('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3138('0x2'),'afterDestroy':'remove'};function emitEvent(_0x86c8a){return function(_0x5ef07f,_0x1733a7,_0x25890a){WhatsappQueueEvents[_0x3138('0x3')](_0x86c8a+':'+_0x5ef07f['id'],_0x5ef07f);WhatsappQueueEvents['emit'](_0x86c8a,_0x5ef07f);_0x25890a(null);};}for(var e in events){if(events[_0x3138('0x4')](e)){var event=events[e];WhatsappQueue[_0x3138('0x5')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x7f04=['events','../../mysqldb','WhatsappQueue','save','emit','hasOwnProperty','exports'];(function(_0xeabcfc,_0x30b4ad){var _0xc6e588=function(_0x4cfb87){while(--_0x4cfb87){_0xeabcfc['push'](_0xeabcfc['shift']());}};_0xc6e588(++_0x30b4ad);}(_0x7f04,0x8c));var _0x47f0=function(_0x27250c,_0x3e6637){_0x27250c=_0x27250c-0x0;var _0x7e3095=_0x7f04[_0x27250c];return _0x7e3095;};'use strict';var EventEmitter=require(_0x47f0('0x0'));var WhatsappQueue=require(_0x47f0('0x1'))['db'][_0x47f0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47f0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1440de){return function(_0x36cf76,_0x4d5d9d,_0x34b6b1){WhatsappQueueEvents[_0x47f0('0x4')](_0x1440de+':'+_0x36cf76['id'],_0x36cf76);WhatsappQueueEvents[_0x47f0('0x4')](_0x1440de,_0x36cf76);_0x34b6b1(null);};}for(var e in events){if(events[_0x47f0('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x47f0('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 0e93734..d5a2ada 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b6b=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','bluebird','request-promise'];(function(_0x417570,_0x414ca3){var _0x11087e=function(_0x1cfec7){while(--_0x1cfec7){_0x417570['push'](_0x417570['shift']());}};_0x11087e(++_0x414ca3);}(_0x2b6b,0x1e0));var _0xb2b6=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b6b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xb2b6('0x0'));var util=require(_0xb2b6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb2b6('0x2'));var rp=require(_0xb2b6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2b6('0x4'));var config=require(_0xb2b6('0x5'));var attributes=require(_0xb2b6('0x6'));module[_0xb2b6('0x7')]=function(_0x4749cd,_0x4aff7d){return _0x4749cd[_0xb2b6('0x8')](_0xb2b6('0x9'),attributes,{'tableName':_0xb2b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa2a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappQueue','whatsapp_queues'];(function(_0x5938b1,_0x372992){var _0x3db178=function(_0x1c545d){while(--_0x1c545d){_0x5938b1['push'](_0x5938b1['shift']());}};_0x3db178(++_0x372992);}(_0xaa2a,0x168));var _0xaaa2=function(_0x5b2a32,_0x1322e0){_0x5b2a32=_0x5b2a32-0x0;var _0x32c8a8=_0xaa2a[_0x5b2a32];return _0x32c8a8;};'use strict';var _=require(_0xaaa2('0x0'));var util=require(_0xaaa2('0x1'));var logger=require(_0xaaa2('0x2'))(_0xaaa2('0x3'));var moment=require(_0xaaa2('0x4'));var BPromise=require(_0xaaa2('0x5'));var rp=require(_0xaaa2('0x6'));var fs=require('fs');var path=require(_0xaaa2('0x7'));var rimraf=require(_0xaaa2('0x8'));var config=require(_0xaaa2('0x9'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x41bfde,_0x3ef4e4){return _0x41bfde['define'](_0xaaa2('0xa'),attributes,{'tableName':_0xaaa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 90ef25c..e26e33b 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90a4=['redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','model','map','find','ShowWhatsappQueue','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x90a4,0xdb));var _0x490a=function(_0x156c39,_0x2f728d){_0x156c39=_0x156c39-0x0;var _0x16b7cd=_0x90a4[_0x156c39];return _0x16b7cd;};'use strict';var _=require(_0x490a('0x0'));var util=require('util');var moment=require(_0x490a('0x1'));var BPromise=require('bluebird');var rs=require(_0x490a('0x2'));var fs=require('fs');var Redis=require(_0x490a('0x3'));var db=require(_0x490a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x490a('0x5'));var config=require(_0x490a('0x6'));var jayson=require(_0x490a('0x7'));var client=jayson['client'][_0x490a('0x8')]({'port':0x232a});config[_0x490a('0x9')]=_[_0x490a('0xa')](config['redis'],{'host':_0x490a('0xb'),'port':0x18eb});var socket=require(_0x490a('0xc'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x490a('0xd')](socket);function respondWithRpcPromise(_0x34aa5d,_0x43f786,_0x4286c5){return new BPromise(function(_0x27e38f,_0x36891c){return client['request'](_0x34aa5d,_0x4286c5)[_0x490a('0xe')](function(_0x4d3935){logger[_0x490a('0xf')](_0x490a('0x10'),_0x43f786,'request\x20sent');logger[_0x490a('0x11')](_0x490a('0x12'),_0x43f786,_0x490a('0x13'),JSON[_0x490a('0x14')](_0x4d3935));if(_0x4d3935[_0x490a('0x15')]){if(_0x4d3935['error'][_0x490a('0x16')]===0x1f4){logger[_0x490a('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x43f786,_0x4d3935[_0x490a('0x15')]['message']);return _0x36891c(_0x4d3935[_0x490a('0x15')][_0x490a('0x17')]);}logger[_0x490a('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x43f786,_0x4d3935['error'][_0x490a('0x17')]);return _0x27e38f(_0x4d3935['error'][_0x490a('0x17')]);}else{logger[_0x490a('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x43f786,'request\x20sent');_0x27e38f(_0x4d3935[_0x490a('0x18')][_0x490a('0x17')]);}})[_0x490a('0x19')](function(_0x388b14){logger[_0x490a('0x15')](_0x490a('0x10'),_0x43f786,_0x388b14);_0x36891c(_0x388b14);});});}exports[_0x490a('0x1a')]=function(_0x109e7c){var _0xd4a3be=this;return new Promise(function(_0x4ba10d,_0x2ba2d5){return db[_0x490a('0x1b')]['findAll']({'raw':_0x109e7c[_0x490a('0x1c')]?_0x109e7c['options'][_0x490a('0x1d')]===undefined?!![]:![]:!![],'where':_0x109e7c[_0x490a('0x1c')]?_0x109e7c[_0x490a('0x1c')][_0x490a('0x1e')]||null:null,'attributes':_0x109e7c[_0x490a('0x1c')]?_0x109e7c['options'][_0x490a('0x1f')]||null:null,'limit':_0x109e7c[_0x490a('0x1c')]?_0x109e7c[_0x490a('0x1c')][_0x490a('0x20')]||null:null,'include':_0x109e7c[_0x490a('0x1c')]?_0x109e7c[_0x490a('0x1c')][_0x490a('0x21')]?_['map'](_0x109e7c[_0x490a('0x1c')][_0x490a('0x21')],function(_0x2ffc5a){return{'model':db[_0x2ffc5a[_0x490a('0x22')]],'as':_0x2ffc5a['as'],'attributes':_0x2ffc5a[_0x490a('0x1f')],'include':_0x2ffc5a[_0x490a('0x21')]?_[_0x490a('0x23')](_0x2ffc5a[_0x490a('0x21')],function(_0x434018){return{'model':db[_0x434018[_0x490a('0x22')]],'as':_0x434018['as'],'attributes':_0x434018[_0x490a('0x1f')],'include':_0x434018[_0x490a('0x21')]?_[_0x490a('0x23')](_0x434018[_0x490a('0x21')],function(_0x36ce71){return{'model':db[_0x36ce71[_0x490a('0x22')]],'as':_0x36ce71['as'],'attributes':_0x36ce71['attributes']};}):[]};}):[]};}):[]:[]})[_0x490a('0xe')](function(_0x1ee76c){logger[_0x490a('0xf')](_0x490a('0x1a'),_0x109e7c);logger[_0x490a('0x11')]('GetWhatsappQueue',_0x109e7c,JSON[_0x490a('0x14')](_0x1ee76c));_0x4ba10d(_0x1ee76c);})[_0x490a('0x19')](function(_0x39cc4b){logger[_0x490a('0x15')](_0x490a('0x1a'),_0x39cc4b[_0x490a('0x17')],_0x109e7c);_0x2ba2d5(_0xd4a3be['error'](0x1f4,_0x39cc4b[_0x490a('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x2a9d66){var _0x1c3170=this;return new Promise(function(_0x1d53c0,_0x54c211){return db['WhatsappQueue'][_0x490a('0x24')]({'raw':_0x2a9d66[_0x490a('0x1c')]?_0x2a9d66[_0x490a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2a9d66[_0x490a('0x1c')]?_0x2a9d66['options'][_0x490a('0x1e')]||null:null,'attributes':_0x2a9d66[_0x490a('0x1c')]?_0x2a9d66['options'][_0x490a('0x1f')]||null:null,'include':_0x2a9d66['options']?_0x2a9d66[_0x490a('0x1c')][_0x490a('0x21')]?_[_0x490a('0x23')](_0x2a9d66[_0x490a('0x1c')][_0x490a('0x21')],function(_0x324a9c){return{'model':db[_0x324a9c[_0x490a('0x22')]],'as':_0x324a9c['as'],'attributes':_0x324a9c[_0x490a('0x1f')],'include':_0x324a9c[_0x490a('0x21')]?_[_0x490a('0x23')](_0x324a9c[_0x490a('0x21')],function(_0xbe197d){return{'model':db[_0xbe197d[_0x490a('0x22')]],'as':_0xbe197d['as'],'attributes':_0xbe197d[_0x490a('0x1f')],'include':_0xbe197d['include']?_[_0x490a('0x23')](_0xbe197d[_0x490a('0x21')],function(_0x445a70){return{'model':db[_0x445a70[_0x490a('0x22')]],'as':_0x445a70['as'],'attributes':_0x445a70[_0x490a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x490a('0xe')](function(_0x4d839f){logger[_0x490a('0xf')](_0x490a('0x25'),_0x2a9d66);logger[_0x490a('0x11')](_0x490a('0x25'),_0x2a9d66,JSON[_0x490a('0x14')](_0x4d839f));_0x1d53c0(_0x4d839f);})[_0x490a('0x19')](function(_0x54133a){logger[_0x490a('0x15')](_0x490a('0x25'),_0x54133a[_0x490a('0x17')],_0x2a9d66);_0x54c211(_0x1c3170[_0x490a('0x15')](0x1f4,_0x54133a[_0x490a('0x17')]));});});}; \ No newline at end of file +var _0x0800=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowWhatsappQueue','bluebird','randomstring','ioredis'];(function(_0x21c662,_0x4cc5d0){var _0x3aaade=function(_0xc178d6){while(--_0xc178d6){_0x21c662['push'](_0x21c662['shift']());}};_0x3aaade(++_0x4cc5d0);}(_0x0800,0x183));var _0x0080=function(_0x807c60,_0x18cfc1){_0x807c60=_0x807c60-0x0;var _0x1fedbe=_0x0800[_0x807c60];return _0x1fedbe;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0080('0x0'));var rs=require(_0x0080('0x1'));var fs=require('fs');var Redis=require(_0x0080('0x2'));var db=require(_0x0080('0x3'))['db'];var utils=require(_0x0080('0x4'));var logger=require(_0x0080('0x5'))(_0x0080('0x6'));var config=require(_0x0080('0x7'));var jayson=require(_0x0080('0x8'));var client=jayson[_0x0080('0x9')][_0x0080('0xa')]({'port':0x232a});config['redis']=_[_0x0080('0xb')](config[_0x0080('0xc')],{'host':_0x0080('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0080('0xc')]));require(_0x0080('0xe'))[_0x0080('0xf')](socket);function respondWithRpcPromise(_0x167a9d,_0x3429d6,_0x3137fa){return new BPromise(function(_0x490c5b,_0x35b005){return client[_0x0080('0x10')](_0x167a9d,_0x3137fa)[_0x0080('0x11')](function(_0x442e9b){logger[_0x0080('0x12')](_0x0080('0x13'),_0x3429d6,'request\x20sent');logger['debug'](_0x0080('0x14'),_0x3429d6,_0x0080('0x15'),JSON['stringify'](_0x442e9b));if(_0x442e9b[_0x0080('0x16')]){if(_0x442e9b[_0x0080('0x16')][_0x0080('0x17')]===0x1f4){logger[_0x0080('0x16')](_0x0080('0x13'),_0x3429d6,_0x442e9b[_0x0080('0x16')][_0x0080('0x18')]);return _0x35b005(_0x442e9b['error'][_0x0080('0x18')]);}logger[_0x0080('0x16')](_0x0080('0x13'),_0x3429d6,_0x442e9b[_0x0080('0x16')][_0x0080('0x18')]);return _0x490c5b(_0x442e9b[_0x0080('0x16')]['message']);}else{logger[_0x0080('0x12')](_0x0080('0x13'),_0x3429d6,_0x0080('0x15'));_0x490c5b(_0x442e9b['result']['message']);}})[_0x0080('0x19')](function(_0x26dc7b){logger[_0x0080('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x3429d6,_0x26dc7b);_0x35b005(_0x26dc7b);});});}exports[_0x0080('0x1a')]=function(_0x10633b){var _0x230d2d=this;return new Promise(function(_0x2c5395,_0x2bbc86){return db[_0x0080('0x1b')][_0x0080('0x1c')]({'raw':_0x10633b[_0x0080('0x1d')]?_0x10633b[_0x0080('0x1d')][_0x0080('0x1e')]===undefined?!![]:![]:!![],'where':_0x10633b['options']?_0x10633b['options'][_0x0080('0x1f')]||null:null,'attributes':_0x10633b[_0x0080('0x1d')]?_0x10633b[_0x0080('0x1d')][_0x0080('0x20')]||null:null,'limit':_0x10633b[_0x0080('0x1d')]?_0x10633b[_0x0080('0x1d')][_0x0080('0x21')]||null:null,'include':_0x10633b[_0x0080('0x1d')]?_0x10633b[_0x0080('0x1d')][_0x0080('0x22')]?_[_0x0080('0x23')](_0x10633b['options'][_0x0080('0x22')],function(_0x5a5cce){return{'model':db[_0x5a5cce[_0x0080('0x24')]],'as':_0x5a5cce['as'],'attributes':_0x5a5cce[_0x0080('0x20')],'include':_0x5a5cce[_0x0080('0x22')]?_['map'](_0x5a5cce[_0x0080('0x22')],function(_0x4354e3){return{'model':db[_0x4354e3[_0x0080('0x24')]],'as':_0x4354e3['as'],'attributes':_0x4354e3[_0x0080('0x20')],'include':_0x4354e3[_0x0080('0x22')]?_[_0x0080('0x23')](_0x4354e3['include'],function(_0x1a65ed){return{'model':db[_0x1a65ed[_0x0080('0x24')]],'as':_0x1a65ed['as'],'attributes':_0x1a65ed[_0x0080('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0080('0x11')](function(_0x11a610){logger[_0x0080('0x12')](_0x0080('0x1a'),_0x10633b);logger['debug'](_0x0080('0x1a'),_0x10633b,JSON[_0x0080('0x25')](_0x11a610));_0x2c5395(_0x11a610);})['catch'](function(_0x402d1e){logger[_0x0080('0x16')]('GetWhatsappQueue',_0x402d1e[_0x0080('0x18')],_0x10633b);_0x2bbc86(_0x230d2d[_0x0080('0x16')](0x1f4,_0x402d1e[_0x0080('0x18')]));});});};exports[_0x0080('0x26')]=function(_0x4398f6){var _0x24fb33=this;return new Promise(function(_0x1e6422,_0x2613ef){return db['WhatsappQueue']['find']({'raw':_0x4398f6[_0x0080('0x1d')]?_0x4398f6['options'][_0x0080('0x1e')]===undefined?!![]:![]:!![],'where':_0x4398f6['options']?_0x4398f6[_0x0080('0x1d')]['where']||null:null,'attributes':_0x4398f6[_0x0080('0x1d')]?_0x4398f6[_0x0080('0x1d')][_0x0080('0x20')]||null:null,'include':_0x4398f6['options']?_0x4398f6['options'][_0x0080('0x22')]?_[_0x0080('0x23')](_0x4398f6[_0x0080('0x1d')][_0x0080('0x22')],function(_0x2c5f86){return{'model':db[_0x2c5f86[_0x0080('0x24')]],'as':_0x2c5f86['as'],'attributes':_0x2c5f86[_0x0080('0x20')],'include':_0x2c5f86['include']?_[_0x0080('0x23')](_0x2c5f86[_0x0080('0x22')],function(_0x44a81a){return{'model':db[_0x44a81a[_0x0080('0x24')]],'as':_0x44a81a['as'],'attributes':_0x44a81a[_0x0080('0x20')],'include':_0x44a81a[_0x0080('0x22')]?_[_0x0080('0x23')](_0x44a81a[_0x0080('0x22')],function(_0x408b56){return{'model':db[_0x408b56[_0x0080('0x24')]],'as':_0x408b56['as'],'attributes':_0x408b56[_0x0080('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0080('0x11')](function(_0x56e8af){logger[_0x0080('0x12')](_0x0080('0x26'),_0x4398f6);logger['debug']('ShowWhatsappQueue',_0x4398f6,JSON['stringify'](_0x56e8af));_0x1e6422(_0x56e8af);})[_0x0080('0x19')](function(_0x23c5d3){logger[_0x0080('0x16')](_0x0080('0x26'),_0x23c5d3['message'],_0x4398f6);_0x2613ef(_0x24fb33[_0x0080('0x16')](0x1f4,_0x23c5d3['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 2d250b8..4b1dbcb 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2755=['save','remove','emit','register','length','whatsappQueue:'];(function(_0x3a4be4,_0x5e2090){var _0x396cd3=function(_0x5639b7){while(--_0x5639b7){_0x3a4be4['push'](_0x3a4be4['shift']());}};_0x396cd3(++_0x5e2090);}(_0x2755,0x168));var _0x5275=function(_0x3e59ce,_0x35a0f6){_0x3e59ce=_0x3e59ce-0x0;var _0x53f4ca=_0x2755[_0x3e59ce];return _0x53f4ca;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x5275('0x0'),_0x5275('0x1'),'update'];function createListener(_0x22ba20,_0x47cde4){return function(_0x11bc3d){_0x47cde4[_0x5275('0x2')](_0x22ba20,_0x11bc3d);};}function removeListener(_0x8cbb18,_0x3cb75d){return function(){WhatsappQueueEvents['removeListener'](_0x8cbb18,_0x3cb75d);};}exports[_0x5275('0x3')]=function(_0x3fbe68){for(var _0x1a80e7=0x0,_0x1499db=events[_0x5275('0x4')];_0x1a80e7<_0x1499db;_0x1a80e7++){var _0x4f9b41=events[_0x1a80e7];var _0x3a509a=createListener(_0x5275('0x5')+_0x4f9b41,_0x3fbe68);WhatsappQueueEvents['on'](_0x4f9b41,_0x3a509a);}}; \ No newline at end of file +var _0x9dd3=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0xdf10cc,_0x407dd4){var _0x487392=function(_0x55c2ab){while(--_0x55c2ab){_0xdf10cc['push'](_0xdf10cc['shift']());}};_0x487392(++_0x407dd4);}(_0x9dd3,0x72));var _0x39dd=function(_0x23b5d2,_0x5676ae){_0x23b5d2=_0x23b5d2-0x0;var _0x444386=_0x9dd3[_0x23b5d2];return _0x444386;};'use strict';var WhatsappQueueEvents=require(_0x39dd('0x0'));var events=[_0x39dd('0x1'),_0x39dd('0x2'),_0x39dd('0x3')];function createListener(_0x1f2e01,_0x193dc8){return function(_0x29db2b){_0x193dc8[_0x39dd('0x4')](_0x1f2e01,_0x29db2b);};}function removeListener(_0x416603,_0x5f55c3){return function(){WhatsappQueueEvents[_0x39dd('0x5')](_0x416603,_0x5f55c3);};}exports[_0x39dd('0x6')]=function(_0x27279e){for(var _0x198a64=0x0,_0x3f9223=events[_0x39dd('0x7')];_0x198a64<_0x3f9223;_0x198a64++){var _0x38755e=events[_0x198a64];var _0x5970d4=createListener(_0x39dd('0x8')+_0x38755e,_0x27279e);WhatsappQueueEvents['on'](_0x38755e,_0x5970d4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index b1db03f..6f0f8b2 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e5f=['show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x3653c7,_0xadb356){var _0x58a021=function(_0x20b237){while(--_0x20b237){_0x3653c7['push'](_0x3653c7['shift']());}};_0x58a021(++_0xadb356);}(_0x7e5f,0x80));var _0xf7e5=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x7e5f[_0x2786ea];return _0x5c38e5;};'use strict';var multer=require(_0xf7e5('0x0'));var util=require(_0xf7e5('0x1'));var path=require('path');var timeout=require(_0xf7e5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf7e5('0x3'));var interaction=require(_0xf7e5('0x4'));var config=require(_0xf7e5('0x5'));var controller=require(_0xf7e5('0x6'));router['get']('/',auth[_0xf7e5('0x7')](),controller[_0xf7e5('0x8')]);router['get'](_0xf7e5('0x9'),auth[_0xf7e5('0x7')](),controller[_0xf7e5('0xa')]);router[_0xf7e5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf7e5('0xc')]);router[_0xf7e5('0xd')]('/',auth[_0xf7e5('0x7')](),controller[_0xf7e5('0xe')]);router[_0xf7e5('0xf')](_0xf7e5('0x10'),auth[_0xf7e5('0x7')](),controller[_0xf7e5('0x11')]);router['delete']('/:id',auth[_0xf7e5('0x7')](),controller[_0xf7e5('0x12')]);module[_0xf7e5('0x13')]=router; \ No newline at end of file +var _0x14f5=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports'];(function(_0x3c6f5d,_0x56840c){var _0x944044=function(_0x39ede7){while(--_0x39ede7){_0x3c6f5d['push'](_0x3c6f5d['shift']());}};_0x944044(++_0x56840c);}(_0x14f5,0x118));var _0x514f=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x14f5[_0x19dd7a];return _0x3feb6a;};'use strict';var multer=require(_0x514f('0x0'));var util=require(_0x514f('0x1'));var path=require('path');var timeout=require(_0x514f('0x2'));var express=require('express');var router=express[_0x514f('0x3')]();var fs_extra=require(_0x514f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x514f('0x5'));var config=require(_0x514f('0x6'));var controller=require(_0x514f('0x7'));router[_0x514f('0x8')]('/',auth[_0x514f('0x9')](),controller[_0x514f('0xa')]);router[_0x514f('0x8')](_0x514f('0xb'),auth[_0x514f('0x9')](),controller[_0x514f('0xc')]);router['get'](_0x514f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x514f('0xe')]('/',auth[_0x514f('0x9')](),controller['create']);router[_0x514f('0xf')](_0x514f('0xd'),auth[_0x514f('0x9')](),controller[_0x514f('0x10')]);router[_0x514f('0x11')]('/:id',auth[_0x514f('0x9')](),controller[_0x514f('0x12')]);module[_0x514f('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index e668101..5b05af9 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0xe30cd1,_0x486501){var _0x1e67f9=function(_0x57f47b){while(--_0x57f47b){_0xe30cd1['push'](_0xe30cd1['shift']());}};_0x1e67f9(++_0x486501);}(_0x7a54,0x106));var _0x47a5=function(_0x2cf4fb,_0x284f62){_0x2cf4fb=_0x2cf4fb-0x0;var _0x569017=_0x7a54[_0x2cf4fb];return _0x569017;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x520bb4,_0x284e3a){var _0xd2e6b2=function(_0x4a71cf){while(--_0x4a71cf){_0x520bb4['push'](_0x520bb4['shift']());}};_0xd2e6b2(++_0x284e3a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index c8120a8..977e486 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['fields','length','nolimit','offset','order','sort','pick','type','VIRTUAL','filter','options','where','then','include','findAll','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','query','filters','intersection','attributes'];(function(_0xb0f25,_0x9b7285){var _0xbf1500=function(_0x517642){while(--_0x517642){_0xb0f25['push'](_0xb0f25['shift']());}};_0xbf1500(++_0x9b7285);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0x9c00[_0x4990d5];return _0x275e25;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x56d883,_0x2c7202){return function(_0x163a59){if(!_0x163a59){_0x56d883[_0x09c0('0x1b')](0x194);}return _0x163a59;};}function handleError(_0x30c2a1,_0x1f8131){_0x1f8131=_0x1f8131||0x1f4;return function(_0x1d2d9d){logger[_0x09c0('0x27')](_0x1d2d9d[_0x09c0('0x28')]);if(_0x1d2d9d[_0x09c0('0x29')]){delete _0x1d2d9d[_0x09c0('0x29')];}_0x30c2a1[_0x09c0('0x1c')](_0x1f8131)['send'](_0x1d2d9d);};}exports[_0x09c0('0x2a')]=function(_0x1bdde9,_0x53a7b8){var _0x1d09e0={},_0x5aa0b9={},_0x3f5b10={'count':0x0,'rows':[]};var _0x4d6bdc=_[_0x09c0('0x2b')](db[_0x09c0('0x2c')][_0x09c0('0x2d')],function(_0x4159bc){return{'name':_0x4159bc['fieldName'],'type':_0x4159bc['type'][_0x09c0('0x2e')]};});_0x5aa0b9[_0x09c0('0x2f')]=_[_0x09c0('0x2b')](_0x4d6bdc,'name');_0x5aa0b9[_0x09c0('0x30')]=_['keys'](_0x1bdde9[_0x09c0('0x30')]);_0x5aa0b9[_0x09c0('0x31')]=_[_0x09c0('0x32')](_0x5aa0b9['model'],_0x5aa0b9[_0x09c0('0x30')]);_0x1d09e0[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x5aa0b9[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x34')]));_0x1d09e0['attributes']=_0x1d09e0[_0x09c0('0x33')][_0x09c0('0x35')]?_0x1d09e0[_0x09c0('0x33')]:_0x5aa0b9[_0x09c0('0x2f')];if(!_0x1bdde9[_0x09c0('0x30')]['hasOwnProperty'](_0x09c0('0x36'))){_0x1d09e0[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x20')]);_0x1d09e0['offset']=qs[_0x09c0('0x37')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x37')]);}_0x1d09e0[_0x09c0('0x38')]=qs[_0x09c0('0x39')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x39')]);_0x1d09e0['where']=qs[_0x09c0('0x31')](_[_0x09c0('0x3a')](_0x1bdde9[_0x09c0('0x30')],_0x5aa0b9[_0x09c0('0x31')]),_0x4d6bdc);if(_0x1bdde9[_0x09c0('0x30')]['filter']){_0x1d09e0['where']=_['merge'](_0x1d09e0['where'],{'$or':_[_0x09c0('0x2b')](_0x4d6bdc,function(_0x15c631){if(_0x15c631[_0x09c0('0x3b')]!==_0x09c0('0x3c')){var _0x1a8c0c={};_0x1a8c0c[_0x15c631['name']]={'$like':'%'+_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x3d')]+'%'};return _0x1a8c0c;}})});}_0x1d09e0=_['merge']({},_0x1d09e0,_0x1bdde9[_0x09c0('0x3e')]);var _0x5d50b9={'where':_0x1d09e0[_0x09c0('0x3f')]};return db['WhatsappQueueReport'][_0x09c0('0x21')](_0x5d50b9)[_0x09c0('0x40')](function(_0x56a511){_0x3f5b10[_0x09c0('0x21')]=_0x56a511;if(_0x1bdde9[_0x09c0('0x30')]['includeAll']){_0x1d09e0[_0x09c0('0x41')]=[{'all':!![]}];}return db[_0x09c0('0x2c')][_0x09c0('0x42')](_0x1d09e0);})[_0x09c0('0x40')](function(_0xeb8191){_0x3f5b10[_0x09c0('0x43')]=_0xeb8191;return _0x3f5b10;})['then'](respondWithFilteredResult(_0x53a7b8,_0x1d09e0))[_0x09c0('0x44')](handleError(_0x53a7b8,null));};exports[_0x09c0('0x45')]=function(_0x2d6344,_0x57835c){var _0x193ed2={'raw':!![],'where':{'id':_0x2d6344[_0x09c0('0x46')]['id']}},_0x30c0c5={};_0x30c0c5['model']=_[_0x09c0('0x47')](db[_0x09c0('0x2c')]['rawAttributes']);_0x30c0c5['query']=_[_0x09c0('0x47')](_0x2d6344[_0x09c0('0x30')]);_0x30c0c5['filters']=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],_0x30c0c5['query']);_0x193ed2[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x2d6344[_0x09c0('0x30')]['fields']));_0x193ed2[_0x09c0('0x33')]=_0x193ed2['attributes']['length']?_0x193ed2[_0x09c0('0x33')]:_0x30c0c5[_0x09c0('0x2f')];if(_0x2d6344[_0x09c0('0x30')][_0x09c0('0x48')]){_0x193ed2[_0x09c0('0x41')]=[{'all':!![]}];}_0x193ed2=_[_0x09c0('0x49')]({},_0x193ed2,_0x2d6344['options']);return db['WhatsappQueueReport']['find'](_0x193ed2)[_0x09c0('0x40')](handleEntityNotFound(_0x57835c,null))[_0x09c0('0x40')](respondWithResult(_0x57835c,null))[_0x09c0('0x44')](handleError(_0x57835c,null));};exports['create']=function(_0xdf1553,_0xff9650){return db[_0x09c0('0x2c')][_0x09c0('0x4a')](_0xdf1553[_0x09c0('0x4b')],{})[_0x09c0('0x40')](respondWithResult(_0xff9650,0xc9))[_0x09c0('0x44')](handleError(_0xff9650,null));};exports[_0x09c0('0x25')]=function(_0x3f6d14,_0x38085c){if(_0x3f6d14[_0x09c0('0x4b')]['id']){delete _0x3f6d14[_0x09c0('0x4b')]['id'];}return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x3f6d14[_0x09c0('0x46')]['id']}})[_0x09c0('0x40')](handleEntityNotFound(_0x38085c,null))[_0x09c0('0x40')](saveUpdates(_0x3f6d14[_0x09c0('0x4b')],null))[_0x09c0('0x40')](respondWithResult(_0x38085c,null))[_0x09c0('0x44')](handleError(_0x38085c,null));};exports['destroy']=function(_0x4acf54,_0x44befb){return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x4acf54[_0x09c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x44befb,null))[_0x09c0('0x40')](removeEntity(_0x44befb,null))[_0x09c0('0x44')](handleError(_0x44befb,null));};exports[_0x09c0('0x4d')]=function(_0x4a92c0,_0xe0b82a){return db[_0x09c0('0x2c')][_0x09c0('0x4d')]()[_0x09c0('0x40')](respondWithResult(_0xe0b82a,null))[_0x09c0('0x44')](handleError(_0xe0b82a,null));}; \ No newline at end of file +var _0xa478=['filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys'];(function(_0x1a89e3,_0x30a854){var _0x1ae1b1=function(_0x42068e){while(--_0x42068e){_0x1a89e3['push'](_0x1a89e3['shift']());}};_0x1ae1b1(++_0x30a854);}(_0xa478,0x136));var _0x8a47=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0xa478[_0x528497];return _0x392d59;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x5bed3e,_0x2bb0d4){return function(_0xb4590d){if(!_0xb4590d){_0x5bed3e[_0x8a47('0x1a')](0x194);}return _0xb4590d;};}function handleError(_0xfb9ae0,_0x44cf20){_0x44cf20=_0x44cf20||0x1f4;return function(_0xd06be6){logger[_0x8a47('0x28')](_0xd06be6['stack']);if(_0xd06be6[_0x8a47('0x29')]){delete _0xd06be6['name'];}_0xfb9ae0[_0x8a47('0x1c')](_0x44cf20)[_0x8a47('0x2a')](_0xd06be6);};}exports['index']=function(_0x1e89b1,_0x526571){var _0x4d5d32={},_0x12470a={},_0x9b51b8={'count':0x0,'rows':[]};var _0x1ddbcf=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')][_0x8a47('0x2d')],function(_0x58aa06){return{'name':_0x58aa06[_0x8a47('0x2e')],'type':_0x58aa06['type']['key']};});_0x12470a[_0x8a47('0x2f')]=_[_0x8a47('0x2b')](_0x1ddbcf,_0x8a47('0x29'));_0x12470a[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x1e89b1[_0x8a47('0x30')]);_0x12470a[_0x8a47('0x32')]=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],_0x12470a[_0x8a47('0x30')]);_0x4d5d32['attributes']=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],qs[_0x8a47('0x34')](_0x1e89b1['query'][_0x8a47('0x34')]));_0x4d5d32[_0x8a47('0x35')]=_0x4d5d32['attributes'][_0x8a47('0x36')]?_0x4d5d32[_0x8a47('0x35')]:_0x12470a[_0x8a47('0x2f')];if(!_0x1e89b1[_0x8a47('0x30')]['hasOwnProperty']('nolimit')){_0x4d5d32[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x20')]);_0x4d5d32[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x1e89b1[_0x8a47('0x30')]['offset']);}_0x4d5d32['order']=qs[_0x8a47('0x37')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x37')]);_0x4d5d32[_0x8a47('0x38')]=qs[_0x8a47('0x32')](_[_0x8a47('0x39')](_0x1e89b1[_0x8a47('0x30')],_0x12470a[_0x8a47('0x32')]),_0x1ddbcf);if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]){_0x4d5d32[_0x8a47('0x38')]=_['merge'](_0x4d5d32[_0x8a47('0x38')],{'$or':_['map'](_0x1ddbcf,function(_0x541832){if(_0x541832['type']!=='VIRTUAL'){var _0x57d38e={};_0x57d38e[_0x541832[_0x8a47('0x29')]]={'$like':'%'+_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]+'%'};return _0x57d38e;}})});}_0x4d5d32=_[_0x8a47('0x3b')]({},_0x4d5d32,_0x1e89b1[_0x8a47('0x3c')]);var _0x20ba1c={'where':_0x4d5d32[_0x8a47('0x38')]};return db[_0x8a47('0x2c')]['count'](_0x20ba1c)['then'](function(_0x442870){_0x9b51b8[_0x8a47('0x21')]=_0x442870;if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x4d5d32['include']=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3e')](_0x4d5d32);})[_0x8a47('0x27')](function(_0x369dd5){_0x9b51b8[_0x8a47('0x3f')]=_0x369dd5;return _0x9b51b8;})['then'](respondWithFilteredResult(_0x526571,_0x4d5d32))[_0x8a47('0x40')](handleError(_0x526571,null));};exports[_0x8a47('0x41')]=function(_0x3010af,_0x5d23ed){var _0x2b3874={'raw':!![],'where':{'id':_0x3010af[_0x8a47('0x42')]['id']}},_0x2c70ea={};_0x2c70ea[_0x8a47('0x2f')]=_['keys'](db[_0x8a47('0x2c')][_0x8a47('0x2d')]);_0x2c70ea[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x3010af[_0x8a47('0x30')]);_0x2c70ea[_0x8a47('0x32')]=_['intersection'](_0x2c70ea['model'],_0x2c70ea[_0x8a47('0x30')]);_0x2b3874[_0x8a47('0x35')]=_[_0x8a47('0x33')](_0x2c70ea['model'],qs[_0x8a47('0x34')](_0x3010af[_0x8a47('0x30')]['fields']));_0x2b3874['attributes']=_0x2b3874[_0x8a47('0x35')]['length']?_0x2b3874[_0x8a47('0x35')]:_0x2c70ea[_0x8a47('0x2f')];if(_0x3010af[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x2b3874[_0x8a47('0x43')]=[{'all':!![]}];}_0x2b3874=_[_0x8a47('0x3b')]({},_0x2b3874,_0x3010af['options']);return db['WhatsappQueueReport'][_0x8a47('0x44')](_0x2b3874)[_0x8a47('0x27')](handleEntityNotFound(_0x5d23ed,null))[_0x8a47('0x27')](respondWithResult(_0x5d23ed,null))[_0x8a47('0x40')](handleError(_0x5d23ed,null));};exports[_0x8a47('0x45')]=function(_0x55dd7c,_0x4898d0){return db[_0x8a47('0x2c')]['create'](_0x55dd7c[_0x8a47('0x46')],{})[_0x8a47('0x27')](respondWithResult(_0x4898d0,0xc9))['catch'](handleError(_0x4898d0,null));};exports[_0x8a47('0x26')]=function(_0x237ed1,_0x14e22c){if(_0x237ed1[_0x8a47('0x46')]['id']){delete _0x237ed1[_0x8a47('0x46')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x237ed1[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e22c,null))[_0x8a47('0x27')](saveUpdates(_0x237ed1[_0x8a47('0x46')],null))[_0x8a47('0x27')](respondWithResult(_0x14e22c,null))[_0x8a47('0x40')](handleError(_0x14e22c,null));};exports['destroy']=function(_0x11db4e,_0xa428dd){return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x11db4e[_0x8a47('0x42')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0xa428dd,null))['then'](removeEntity(_0xa428dd,null))['catch'](handleError(_0xa428dd,null));};exports[_0x8a47('0x47')]=function(_0x5db5d3,_0x1da8b7){return db[_0x8a47('0x2c')]['describe']()[_0x8a47('0x27')](respondWithResult(_0x1da8b7,null))['catch'](handleError(_0x1da8b7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f0ff8bd..697886f 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3599=['../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3a0737,_0x47fef6){var _0x1a1de8=function(_0x1242df){while(--_0x1242df){_0x3a0737['push'](_0x3a0737['shift']());}};_0x1a1de8(++_0x47fef6);}(_0x3599,0x1d5));var _0x9359=function(_0x3fc82d,_0x302d00){_0x3fc82d=_0x3fc82d-0x0;var _0x8449e5=_0x3599[_0x3fc82d];return _0x8449e5;};'use strict';var _=require('lodash');var util=require(_0x9359('0x0'));var logger=require(_0x9359('0x1'))(_0x9359('0x2'));var moment=require(_0x9359('0x3'));var BPromise=require(_0x9359('0x4'));var rp=require(_0x9359('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9359('0x6'));var config=require(_0x9359('0x7'));var attributes=require(_0x9359('0x8'));module[_0x9359('0x9')]=function(_0x5bb878,_0x4a4532){return _0x5bb878[_0x9359('0xa')](_0x9359('0xb'),attributes,{'tableName':_0x9359('0xc'),'paranoid':![],'indexes':[{'name':_0x9359('0xd'),'fields':[_0x9359('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x314a=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x9c0d3e,_0x59f229){var _0x1d059e=function(_0x5d39b5){while(--_0x5d39b5){_0x9c0d3e['push'](_0x9c0d3e['shift']());}};_0x1d059e(++_0x59f229);}(_0x314a,0x16c));var _0xa314=function(_0x5690a4,_0x572d64){_0x5690a4=_0x5690a4-0x0;var _0x170f91=_0x314a[_0x5690a4];return _0x170f91;};'use strict';var _=require(_0xa314('0x0'));var util=require(_0xa314('0x1'));var logger=require(_0xa314('0x2'))(_0xa314('0x3'));var moment=require('moment');var BPromise=require(_0xa314('0x4'));var rp=require(_0xa314('0x5'));var fs=require('fs');var path=require(_0xa314('0x6'));var rimraf=require(_0xa314('0x7'));var config=require(_0xa314('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xa314('0x9')]=function(_0x1c8c9c,_0x522937){return _0x1c8c9c['define'](_0xa314('0xa'),attributes,{'tableName':_0xa314('0xb'),'paranoid':![],'indexes':[{'name':_0xa314('0xc'),'fields':[_0xa314('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4653474..65e7a91 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf467=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','WhatsappQueueReport','create','body','options','then','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','raw','where','attributes','limit','lodash','util','moment'];(function(_0x48ae85,_0x4f6363){var _0x2257bc=function(_0x406d8f){while(--_0x406d8f){_0x48ae85['push'](_0x48ae85['shift']());}};_0x2257bc(++_0x4f6363);}(_0xf467,0x85));var _0x7f46=function(_0x1284c4,_0xe865e1){_0x1284c4=_0x1284c4-0x0;var _0x2caad6=_0xf467[_0x1284c4];return _0x2caad6;};'use strict';var _=require(_0x7f46('0x0'));var util=require(_0x7f46('0x1'));var moment=require(_0x7f46('0x2'));var BPromise=require(_0x7f46('0x3'));var rs=require(_0x7f46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f46('0x5'))['db'];var utils=require(_0x7f46('0x6'));var logger=require('../../config/logger')(_0x7f46('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f46('0x8'));var client=jayson[_0x7f46('0x9')][_0x7f46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x224e58,_0x5b55e6,_0x574dbc){return new BPromise(function(_0x3204cd,_0x3d0345){return client[_0x7f46('0xb')](_0x224e58,_0x574dbc)['then'](function(_0x4aed89){logger[_0x7f46('0xc')](_0x7f46('0xd'),_0x5b55e6,'request\x20sent');logger[_0x7f46('0xe')](_0x7f46('0xf'),_0x5b55e6,'request\x20sent',JSON[_0x7f46('0x10')](_0x4aed89));if(_0x4aed89[_0x7f46('0x11')]){if(_0x4aed89[_0x7f46('0x11')][_0x7f46('0x12')]===0x1f4){logger['error'](_0x7f46('0xd'),_0x5b55e6,_0x4aed89[_0x7f46('0x11')][_0x7f46('0x13')]);return _0x3d0345(_0x4aed89[_0x7f46('0x11')][_0x7f46('0x13')]);}logger[_0x7f46('0x11')](_0x7f46('0xd'),_0x5b55e6,_0x4aed89['error'][_0x7f46('0x13')]);return _0x3204cd(_0x4aed89[_0x7f46('0x11')]['message']);}else{logger[_0x7f46('0xc')](_0x7f46('0xd'),_0x5b55e6,_0x7f46('0x14'));_0x3204cd(_0x4aed89[_0x7f46('0x15')][_0x7f46('0x13')]);}})['catch'](function(_0x36ad5d){logger['error'](_0x7f46('0xd'),_0x5b55e6,_0x36ad5d);_0x3d0345(_0x36ad5d);});});}exports['CreateWhatsappQueueReport']=function(_0x40504a){var _0x2711cd=this;return new Promise(function(_0x181f64,_0x618f2){return db[_0x7f46('0x16')][_0x7f46('0x17')](_0x40504a[_0x7f46('0x18')],{'raw':_0x40504a[_0x7f46('0x19')]?_0x40504a[_0x7f46('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7f46('0x1a')](function(_0x3e49a6){logger['info']('CreateWhatsappQueueReport',_0x40504a);logger[_0x7f46('0xe')](_0x7f46('0x1b'),_0x40504a,JSON[_0x7f46('0x10')](_0x3e49a6));_0x181f64(_0x3e49a6);})[_0x7f46('0x1c')](function(_0x30d440){logger[_0x7f46('0x11')](_0x7f46('0x1b'),_0x30d440[_0x7f46('0x13')],_0x40504a);_0x618f2(_0x2711cd[_0x7f46('0x11')](0x1f4,_0x30d440[_0x7f46('0x13')]));});});};exports[_0x7f46('0x1d')]=function(_0x4e8fdd){var _0x1696da=this;return new Promise(function(_0x85dae2,_0x5cecf9){return db[_0x7f46('0x16')]['update'](_0x4e8fdd[_0x7f46('0x18')],{'raw':_0x4e8fdd[_0x7f46('0x19')]?_0x4e8fdd[_0x7f46('0x19')][_0x7f46('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8fdd[_0x7f46('0x19')]?_0x4e8fdd[_0x7f46('0x19')][_0x7f46('0x1f')]||null:null,'attributes':_0x4e8fdd['options']?_0x4e8fdd[_0x7f46('0x19')][_0x7f46('0x20')]||null:null,'limit':_0x4e8fdd['options']?_0x4e8fdd[_0x7f46('0x19')][_0x7f46('0x21')]||null:null})[_0x7f46('0x1a')](function(_0x2158ef){logger[_0x7f46('0xc')](_0x7f46('0x1d'),_0x4e8fdd);logger['debug'](_0x7f46('0x1d'),_0x4e8fdd,JSON['stringify'](_0x2158ef));_0x85dae2(_0x2158ef);})['catch'](function(_0x2a66b4){logger[_0x7f46('0x11')](_0x7f46('0x1d'),_0x2a66b4[_0x7f46('0x13')],_0x4e8fdd);_0x5cecf9(_0x1696da[_0x7f46('0x11')](0x1f4,_0x2a66b4[_0x7f46('0x13')]));});});}; \ No newline at end of file +var _0xb9a0=['update','where','attributes','limit','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport'];(function(_0x43c223,_0x2d61d9){var _0x2299a7=function(_0x4762ee){while(--_0x4762ee){_0x43c223['push'](_0x43c223['shift']());}};_0x2299a7(++_0x2d61d9);}(_0xb9a0,0x186));var _0x0b9a=function(_0x159912,_0x3d09b8){_0x159912=_0x159912-0x0;var _0x2e6bc0=_0xb9a0[_0x159912];return _0x2e6bc0;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var moment=require(_0x0b9a('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b9a('0x3'));var fs=require('fs');var Redis=require(_0x0b9a('0x4'));var db=require(_0x0b9a('0x5'))['db'];var utils=require(_0x0b9a('0x6'));var logger=require(_0x0b9a('0x7'))(_0x0b9a('0x8'));var config=require(_0x0b9a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0b9a('0xa')][_0x0b9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x131a2c,_0x457e80,_0xe430f6){return new BPromise(function(_0x33ce5a,_0x1cec71){return client[_0x0b9a('0xc')](_0x131a2c,_0xe430f6)[_0x0b9a('0xd')](function(_0x2f78b8){logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));logger['debug'](_0x0b9a('0x11'),_0x457e80,'request\x20sent',JSON[_0x0b9a('0x12')](_0x2f78b8));if(_0x2f78b8['error']){if(_0x2f78b8[_0x0b9a('0x13')]['code']===0x1f4){logger['error'](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x1cec71(_0x2f78b8[_0x0b9a('0x13')]['message']);}logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x33ce5a(_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);}else{logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));_0x33ce5a(_0x2f78b8[_0x0b9a('0x15')][_0x0b9a('0x14')]);}})['catch'](function(_0x102d2e){logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x102d2e);_0x1cec71(_0x102d2e);});});}exports['CreateWhatsappQueueReport']=function(_0x3fb823){var _0x5f0fd9=this;return new Promise(function(_0x47b9e1,_0x1df5d9){return db[_0x0b9a('0x16')][_0x0b9a('0x17')](_0x3fb823[_0x0b9a('0x18')],{'raw':_0x3fb823[_0x0b9a('0x19')]?_0x3fb823[_0x0b9a('0x19')][_0x0b9a('0x1a')]===undefined?!![]:![]:!![]})[_0x0b9a('0xd')](function(_0x4e5dfc){logger['info'](_0x0b9a('0x1b'),_0x3fb823);logger['debug'](_0x0b9a('0x1b'),_0x3fb823,JSON[_0x0b9a('0x12')](_0x4e5dfc));_0x47b9e1(_0x4e5dfc);})[_0x0b9a('0x1c')](function(_0x84470c){logger[_0x0b9a('0x13')](_0x0b9a('0x1b'),_0x84470c[_0x0b9a('0x14')],_0x3fb823);_0x1df5d9(_0x5f0fd9[_0x0b9a('0x13')](0x1f4,_0x84470c['message']));});});};exports[_0x0b9a('0x1d')]=function(_0xa5dd9e){var _0x2b37dd=this;return new Promise(function(_0x1f29ac,_0x2e1cde){return db[_0x0b9a('0x16')][_0x0b9a('0x1e')](_0xa5dd9e[_0x0b9a('0x18')],{'raw':_0xa5dd9e['options']?_0xa5dd9e['options'][_0x0b9a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5dd9e['options']?_0xa5dd9e[_0x0b9a('0x19')][_0x0b9a('0x1f')]||null:null,'attributes':_0xa5dd9e[_0x0b9a('0x19')]?_0xa5dd9e['options'][_0x0b9a('0x20')]||null:null,'limit':_0xa5dd9e[_0x0b9a('0x19')]?_0xa5dd9e[_0x0b9a('0x19')][_0x0b9a('0x21')]||null:null})[_0x0b9a('0xd')](function(_0x1f97ec){logger['info'](_0x0b9a('0x1d'),_0xa5dd9e);logger[_0x0b9a('0x22')](_0x0b9a('0x1d'),_0xa5dd9e,JSON[_0x0b9a('0x12')](_0x1f97ec));_0x1f29ac(_0x1f97ec);})[_0x0b9a('0x1c')](function(_0x890d1d){logger['error'](_0x0b9a('0x1d'),_0x890d1d[_0x0b9a('0x14')],_0xa5dd9e);_0x2e1cde(_0x2b37dd[_0x0b9a('0x13')](0x1f4,_0x890d1d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f75fb4f..4cba54b 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5389=['connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','index','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x1c4651,_0x404598){var _0x179f88=function(_0x2de0dd){while(--_0x2de0dd){_0x1c4651['push'](_0x1c4651['shift']());}};_0x179f88(++_0x404598);}(_0x5389,0x141));var _0x9538=function(_0xeed38,_0x45e18a){_0xeed38=_0xeed38-0x0;var _0x53533c=_0x5389[_0xeed38];return _0x53533c;};'use strict';var multer=require(_0x9538('0x0'));var util=require(_0x9538('0x1'));var path=require('path');var timeout=require(_0x9538('0x2'));var express=require(_0x9538('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9538('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9538('0x5'));var controller=require(_0x9538('0x6'));router[_0x9538('0x7')]('/',auth['isAuthenticated'](),controller[_0x9538('0x8')]);router[_0x9538('0x7')]('/describe',auth[_0x9538('0x9')](),controller[_0x9538('0xa')]);router[_0x9538('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9538('0xb')]);router[_0x9538('0xc')]('/',auth[_0x9538('0x9')](),controller[_0x9538('0xd')]);router[_0x9538('0xe')](_0x9538('0xf'),auth[_0x9538('0x9')](),controller['update']);router[_0x9538('0x10')]('/:id',auth[_0x9538('0x9')](),controller[_0x9538('0x11')]);module[_0x9538('0x12')]=router; \ No newline at end of file +var _0x5d20=['get','index','/describe','describe','/:id','isAuthenticated','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x159756,_0x4620e3){var _0x1c6c44=function(_0xec5aa9){while(--_0xec5aa9){_0x159756['push'](_0x159756['shift']());}};_0x1c6c44(++_0x4620e3);}(_0x5d20,0x1e9));var _0x05d2=function(_0x4cb015,_0x35509c){_0x4cb015=_0x4cb015-0x0;var _0x30ad7f=_0x5d20[_0x4cb015];return _0x30ad7f;};'use strict';var multer=require(_0x05d2('0x0'));var util=require(_0x05d2('0x1'));var path=require(_0x05d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x05d2('0x3'));var router=express[_0x05d2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x05d2('0x5'));var interaction=require(_0x05d2('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x05d2('0x7')]('/',auth['isAuthenticated'](),controller[_0x05d2('0x8')]);router[_0x05d2('0x7')](_0x05d2('0x9'),auth['isAuthenticated'](),controller[_0x05d2('0xa')]);router[_0x05d2('0x7')](_0x05d2('0xb'),auth[_0x05d2('0xc')](),controller['show']);router['post']('/',auth[_0x05d2('0xc')](),controller[_0x05d2('0xd')]);router[_0x05d2('0xe')](_0x05d2('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x05d2('0xb'),auth[_0x05d2('0xc')](),controller[_0x05d2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index f3dfce4..75467fb 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed3c=['queue','DATE','sequelize','exports','STRING','ENUM','agent'];(function(_0x5140ee,_0x122078){var _0x346c30=function(_0x4c95b6){while(--_0x4c95b6){_0x5140ee['push'](_0x5140ee['shift']());}};_0x346c30(++_0x122078);}(_0xed3c,0x1a6));var _0xced3=function(_0xc4f7c0,_0x3d731b){_0xc4f7c0=_0xc4f7c0-0x0;var _0x479501=_0xed3c[_0xc4f7c0];return _0x479501;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'uniqueid':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xced3('0x3')]('account',_0xced3('0x4'),_0xced3('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xced3('0x6')]}}; \ No newline at end of file +var _0x5276=['DATE','STRING','ENUM','account','agent','queue'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5276,0x163));var _0x6527=function(_0x50e4ef,_0x4f6739){_0x50e4ef=_0x50e4ef-0x0;var _0xd9168e=_0x5276[_0x50e4ef];return _0xd9168e;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6527('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6527('0x1')](_0x6527('0x2'),_0x6527('0x3'),_0x6527('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6527('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c069ea7..e54b454 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x281d=['rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','WhatsappTransferReport'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x281d,0x195));var _0xd281=function(_0x40f4a5,_0xe620){_0x40f4a5=_0x40f4a5-0x0;var _0x22d354=_0x281d[_0x40f4a5];return _0x22d354;};'use strict';var emlformat=require(_0xd281('0x0'));var rimraf=require(_0xd281('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd281('0x2'));var rp=require(_0xd281('0x3'));var moment=require(_0xd281('0x4'));var BPromise=require(_0xd281('0x5'));var Mustache=require(_0xd281('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd281('0x7'));var csv=require(_0xd281('0x8'));var ejs=require(_0xd281('0x9'));var fs=require('fs');var fs_extra=require(_0xd281('0xa'));var _=require('lodash');var squel=require(_0xd281('0xb'));var crypto=require('crypto');var jsforce=require(_0xd281('0xc'));var deskjs=require(_0xd281('0xd'));var toCsv=require(_0xd281('0x8'));var querystring=require(_0xd281('0xe'));var Papa=require(_0xd281('0xf'));var Redis=require(_0xd281('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd281('0x11'));var as=require(_0xd281('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd281('0x13'))(_0xd281('0x14'));var utils=require(_0xd281('0x15'));var config=require(_0xd281('0x16'));var licenseUtil=require(_0xd281('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9785,_0x34f63a){_0x34f63a=_0x34f63a||0xcc;return function(_0x1f3000){if(_0x1f3000){return _0x2f9785['sendStatus'](_0x34f63a);}return _0x2f9785[_0xd281('0x18')](_0x34f63a)[_0xd281('0x19')]();};}function respondWithResult(_0x14765e,_0x2e12f4){_0x2e12f4=_0x2e12f4||0xc8;return function(_0x4de9e9){if(_0x4de9e9){return _0x14765e[_0xd281('0x18')](_0x2e12f4)[_0xd281('0x1a')](_0x4de9e9);}};}function respondWithFilteredResult(_0x46f573,_0x2bd07c){return function(_0x22d167){if(_0x22d167){var _0x3a1609=typeof _0x2bd07c[_0xd281('0x1b')]===_0xd281('0x1c')&&typeof _0x2bd07c[_0xd281('0x1d')]===_0xd281('0x1c');var _0x4993fb=_0x22d167[_0xd281('0x1e')];var _0x537002=_0x3a1609?0x0:_0x2bd07c[_0xd281('0x1b')];var _0x3e9ee0=_0x3a1609?_0x22d167['count']:_0x2bd07c[_0xd281('0x1b')]+_0x2bd07c[_0xd281('0x1d')];var _0x2144b1;if(_0x3e9ee0>=_0x4993fb){_0x3e9ee0=_0x4993fb;_0x2144b1=0xc8;}else{_0x2144b1=0xce;}_0x46f573[_0xd281('0x18')](_0x2144b1);return _0x46f573[_0xd281('0x1f')](_0xd281('0x20'),_0x537002+'-'+_0x3e9ee0+'/'+_0x4993fb)['json'](_0x22d167);}return null;};}function patchUpdates(_0xcf20e6){return function(_0x13e796){try{jsonpatch[_0xd281('0x21')](_0x13e796,_0xcf20e6,!![]);}catch(_0x6f1f58){return BPromise[_0xd281('0x22')](_0x6f1f58);}return _0x13e796['save']();};}function saveUpdates(_0x1d6b91,_0x5a2416){return function(_0x1ec197){if(_0x1ec197){return _0x1ec197[_0xd281('0x23')](_0x1d6b91)[_0xd281('0x24')](function(_0x2e1798){return _0x2e1798;});}return null;};}function removeEntity(_0x67e9b6,_0x352c3b){return function(_0x3a15ce){if(_0x3a15ce){return _0x3a15ce[_0xd281('0x25')]()[_0xd281('0x24')](function(){_0x67e9b6[_0xd281('0x18')](0xcc)[_0xd281('0x19')]();});}};}function handleEntityNotFound(_0x4998b5,_0x46280e){return function(_0x3b91b2){if(!_0x3b91b2){_0x4998b5[_0xd281('0x26')](0x194);}return _0x3b91b2;};}function handleError(_0x21bb65,_0x56a8c7){_0x56a8c7=_0x56a8c7||0x1f4;return function(_0x22621c){logger[_0xd281('0x27')](_0x22621c[_0xd281('0x28')]);if(_0x22621c[_0xd281('0x29')]){delete _0x22621c[_0xd281('0x29')];}_0x21bb65['status'](_0x56a8c7)['send'](_0x22621c);};}exports[_0xd281('0x2a')]=function(_0x2172a4,_0x4449ef){var _0x12b23e={},_0x487828={},_0x7ff5fe={'count':0x0,'rows':[]};var _0x30a3a9=_[_0xd281('0x2b')](db[_0xd281('0x2c')][_0xd281('0x2d')],function(_0x5ef27d){return{'name':_0x5ef27d[_0xd281('0x2e')],'type':_0x5ef27d['type']['key']};});_0x487828[_0xd281('0x2f')]=_[_0xd281('0x2b')](_0x30a3a9,_0xd281('0x29'));_0x487828[_0xd281('0x30')]=_['keys'](_0x2172a4[_0xd281('0x30')]);_0x487828['filters']=_[_0xd281('0x31')](_0x487828[_0xd281('0x2f')],_0x487828['query']);_0x12b23e[_0xd281('0x32')]=_[_0xd281('0x31')](_0x487828[_0xd281('0x2f')],qs['fields'](_0x2172a4[_0xd281('0x30')][_0xd281('0x33')]));_0x12b23e[_0xd281('0x32')]=_0x12b23e[_0xd281('0x32')][_0xd281('0x34')]?_0x12b23e[_0xd281('0x32')]:_0x487828['model'];if(!_0x2172a4[_0xd281('0x30')][_0xd281('0x35')](_0xd281('0x36'))){_0x12b23e[_0xd281('0x1d')]=qs[_0xd281('0x1d')](_0x2172a4[_0xd281('0x30')]['limit']);_0x12b23e[_0xd281('0x1b')]=qs[_0xd281('0x1b')](_0x2172a4['query'][_0xd281('0x1b')]);}_0x12b23e[_0xd281('0x37')]=qs['sort'](_0x2172a4[_0xd281('0x30')][_0xd281('0x38')]);_0x12b23e['where']=qs[_0xd281('0x39')](_[_0xd281('0x3a')](_0x2172a4[_0xd281('0x30')],_0x487828['filters']),_0x30a3a9);if(_0x2172a4[_0xd281('0x30')]['filter']){_0x12b23e[_0xd281('0x3b')]=_[_0xd281('0x3c')](_0x12b23e['where'],{'$or':_[_0xd281('0x2b')](_0x30a3a9,function(_0x5c2b43){if(_0x5c2b43[_0xd281('0x3d')]!==_0xd281('0x3e')){var _0x1360c6={};_0x1360c6[_0x5c2b43[_0xd281('0x29')]]={'$like':'%'+_0x2172a4[_0xd281('0x30')][_0xd281('0x3f')]+'%'};return _0x1360c6;}})});}_0x12b23e=_[_0xd281('0x3c')]({},_0x12b23e,_0x2172a4[_0xd281('0x40')]);var _0x3d11e2={'where':_0x12b23e['where']};return db[_0xd281('0x2c')]['count'](_0x3d11e2)[_0xd281('0x24')](function(_0xd6620b){_0x7ff5fe['count']=_0xd6620b;if(_0x2172a4[_0xd281('0x30')][_0xd281('0x41')]){_0x12b23e[_0xd281('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xd281('0x43')](_0x12b23e);})[_0xd281('0x24')](function(_0xbc05a2){_0x7ff5fe[_0xd281('0x44')]=_0xbc05a2;return _0x7ff5fe;})[_0xd281('0x24')](respondWithFilteredResult(_0x4449ef,_0x12b23e))[_0xd281('0x45')](handleError(_0x4449ef,null));};exports['show']=function(_0x3130f,_0x4e966e){var _0x264542={'raw':!![],'where':{'id':_0x3130f[_0xd281('0x46')]['id']}},_0x33caaa={};_0x33caaa[_0xd281('0x2f')]=_['keys'](db[_0xd281('0x2c')][_0xd281('0x2d')]);_0x33caaa[_0xd281('0x30')]=_['keys'](_0x3130f['query']);_0x33caaa['filters']=_['intersection'](_0x33caaa[_0xd281('0x2f')],_0x33caaa[_0xd281('0x30')]);_0x264542[_0xd281('0x32')]=_[_0xd281('0x31')](_0x33caaa['model'],qs[_0xd281('0x33')](_0x3130f[_0xd281('0x30')][_0xd281('0x33')]));_0x264542['attributes']=_0x264542[_0xd281('0x32')][_0xd281('0x34')]?_0x264542[_0xd281('0x32')]:_0x33caaa[_0xd281('0x2f')];if(_0x3130f[_0xd281('0x30')][_0xd281('0x41')]){_0x264542[_0xd281('0x42')]=[{'all':!![]}];}_0x264542=_[_0xd281('0x3c')]({},_0x264542,_0x3130f[_0xd281('0x40')]);return db['WhatsappTransferReport'][_0xd281('0x47')](_0x264542)['then'](handleEntityNotFound(_0x4e966e,null))[_0xd281('0x24')](respondWithResult(_0x4e966e,null))[_0xd281('0x45')](handleError(_0x4e966e,null));};exports[_0xd281('0x48')]=function(_0xaf2952,_0x31cc2b){return db[_0xd281('0x2c')]['create'](_0xaf2952['body'],{})[_0xd281('0x24')](respondWithResult(_0x31cc2b,0xc9))[_0xd281('0x45')](handleError(_0x31cc2b,null));};exports[_0xd281('0x23')]=function(_0x257c7b,_0xa72d34){if(_0x257c7b['body']['id']){delete _0x257c7b[_0xd281('0x49')]['id'];}return db[_0xd281('0x2c')][_0xd281('0x47')]({'where':{'id':_0x257c7b[_0xd281('0x46')]['id']}})[_0xd281('0x24')](handleEntityNotFound(_0xa72d34,null))[_0xd281('0x24')](saveUpdates(_0x257c7b[_0xd281('0x49')],null))[_0xd281('0x24')](respondWithResult(_0xa72d34,null))[_0xd281('0x45')](handleError(_0xa72d34,null));};exports[_0xd281('0x25')]=function(_0x49f580,_0x5ace8f){return db['WhatsappTransferReport']['find']({'where':{'id':_0x49f580['params']['id']}})[_0xd281('0x24')](handleEntityNotFound(_0x5ace8f,null))[_0xd281('0x24')](removeEntity(_0x5ace8f,null))[_0xd281('0x45')](handleError(_0x5ace8f,null));};exports['describe']=function(_0x50de63,_0x4b9b2c){return db[_0xd281('0x2c')][_0xd281('0x4a')]()[_0xd281('0x24')](respondWithResult(_0x4b9b2c,null))[_0xd281('0x45')](handleError(_0x4b9b2c,null));}; \ No newline at end of file +var _0x52cb=['util','path','sox','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x34df47,_0x4d38ad){var _0x3c13d2=function(_0x53ae78){while(--_0x53ae78){_0x34df47['push'](_0x34df47['shift']());}};_0x3c13d2(++_0x4d38ad);}(_0x52cb,0x1ba));var _0xb52c=function(_0x45c033,_0x537135){_0x45c033=_0x45c033-0x0;var _0x332c13=_0x52cb[_0x45c033];return _0x332c13;};'use strict';var emlformat=require(_0xb52c('0x0'));var rimraf=require(_0xb52c('0x1'));var zipdir=require(_0xb52c('0x2'));var jsonpatch=require(_0xb52c('0x3'));var rp=require(_0xb52c('0x4'));var moment=require(_0xb52c('0x5'));var BPromise=require(_0xb52c('0x6'));var Mustache=require(_0xb52c('0x7'));var util=require(_0xb52c('0x8'));var path=require(_0xb52c('0x9'));var sox=require(_0xb52c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb52c('0xb'));var squel=require(_0xb52c('0xc'));var crypto=require('crypto');var jsforce=require(_0xb52c('0xd'));var deskjs=require(_0xb52c('0xe'));var toCsv=require(_0xb52c('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb52c('0x10'));var authService=require(_0xb52c('0x11'));var qs=require(_0xb52c('0x12'));var as=require(_0xb52c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb52c('0x14'))(_0xb52c('0x15'));var utils=require(_0xb52c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb52c('0x17'));var db=require(_0xb52c('0x18'))['db'];function respondWithStatusCode(_0x2c83d5,_0x2a2a9f){_0x2a2a9f=_0x2a2a9f||0xcc;return function(_0x352f27){if(_0x352f27){return _0x2c83d5[_0xb52c('0x19')](_0x2a2a9f);}return _0x2c83d5[_0xb52c('0x1a')](_0x2a2a9f)[_0xb52c('0x1b')]();};}function respondWithResult(_0x546d24,_0x2eed39){_0x2eed39=_0x2eed39||0xc8;return function(_0x57caad){if(_0x57caad){return _0x546d24[_0xb52c('0x1a')](_0x2eed39)['json'](_0x57caad);}};}function respondWithFilteredResult(_0x4455d0,_0xe53f05){return function(_0x347aa5){if(_0x347aa5){var _0x20cd41=typeof _0xe53f05[_0xb52c('0x1c')]===_0xb52c('0x1d')&&typeof _0xe53f05[_0xb52c('0x1e')]===_0xb52c('0x1d');var _0x1e59e6=_0x347aa5[_0xb52c('0x1f')];var _0x216f5f=_0x20cd41?0x0:_0xe53f05[_0xb52c('0x1c')];var _0xdfd6dd=_0x20cd41?_0x347aa5['count']:_0xe53f05[_0xb52c('0x1c')]+_0xe53f05[_0xb52c('0x1e')];var _0x1bcd06;if(_0xdfd6dd>=_0x1e59e6){_0xdfd6dd=_0x1e59e6;_0x1bcd06=0xc8;}else{_0x1bcd06=0xce;}_0x4455d0[_0xb52c('0x1a')](_0x1bcd06);return _0x4455d0[_0xb52c('0x20')](_0xb52c('0x21'),_0x216f5f+'-'+_0xdfd6dd+'/'+_0x1e59e6)['json'](_0x347aa5);}return null;};}function patchUpdates(_0x24979f){return function(_0x1cf316){try{jsonpatch[_0xb52c('0x22')](_0x1cf316,_0x24979f,!![]);}catch(_0x5452af){return BPromise[_0xb52c('0x23')](_0x5452af);}return _0x1cf316[_0xb52c('0x24')]();};}function saveUpdates(_0x38d2f4,_0x3c33b2){return function(_0x5baa86){if(_0x5baa86){return _0x5baa86['update'](_0x38d2f4)[_0xb52c('0x25')](function(_0x16d0e8){return _0x16d0e8;});}return null;};}function removeEntity(_0x1bf670,_0x545db7){return function(_0x26bece){if(_0x26bece){return _0x26bece[_0xb52c('0x26')]()[_0xb52c('0x25')](function(){_0x1bf670['status'](0xcc)[_0xb52c('0x1b')]();});}};}function handleEntityNotFound(_0xdba037,_0x1fbd2c){return function(_0x467d1c){if(!_0x467d1c){_0xdba037[_0xb52c('0x19')](0x194);}return _0x467d1c;};}function handleError(_0x3ba7c7,_0x4e36ed){_0x4e36ed=_0x4e36ed||0x1f4;return function(_0x54d034){logger['error'](_0x54d034[_0xb52c('0x27')]);if(_0x54d034[_0xb52c('0x28')]){delete _0x54d034['name'];}_0x3ba7c7[_0xb52c('0x1a')](_0x4e36ed)[_0xb52c('0x29')](_0x54d034);};}exports[_0xb52c('0x2a')]=function(_0xf614bf,_0x3616ea){var _0xe69d1f={},_0x5cd5f4={},_0x4ff348={'count':0x0,'rows':[]};var _0x23adb4=_[_0xb52c('0x2b')](db[_0xb52c('0x2c')][_0xb52c('0x2d')],function(_0x4ebbc1){return{'name':_0x4ebbc1['fieldName'],'type':_0x4ebbc1[_0xb52c('0x2e')][_0xb52c('0x2f')]};});_0x5cd5f4[_0xb52c('0x30')]=_[_0xb52c('0x2b')](_0x23adb4,_0xb52c('0x28'));_0x5cd5f4[_0xb52c('0x31')]=_['keys'](_0xf614bf[_0xb52c('0x31')]);_0x5cd5f4[_0xb52c('0x32')]=_[_0xb52c('0x33')](_0x5cd5f4[_0xb52c('0x30')],_0x5cd5f4[_0xb52c('0x31')]);_0xe69d1f['attributes']=_[_0xb52c('0x33')](_0x5cd5f4['model'],qs['fields'](_0xf614bf[_0xb52c('0x31')][_0xb52c('0x34')]));_0xe69d1f[_0xb52c('0x35')]=_0xe69d1f['attributes']['length']?_0xe69d1f['attributes']:_0x5cd5f4[_0xb52c('0x30')];if(!_0xf614bf[_0xb52c('0x31')][_0xb52c('0x36')]('nolimit')){_0xe69d1f[_0xb52c('0x1e')]=qs[_0xb52c('0x1e')](_0xf614bf[_0xb52c('0x31')][_0xb52c('0x1e')]);_0xe69d1f[_0xb52c('0x1c')]=qs[_0xb52c('0x1c')](_0xf614bf[_0xb52c('0x31')]['offset']);}_0xe69d1f['order']=qs[_0xb52c('0x37')](_0xf614bf[_0xb52c('0x31')][_0xb52c('0x37')]);_0xe69d1f[_0xb52c('0x38')]=qs['filters'](_[_0xb52c('0x39')](_0xf614bf['query'],_0x5cd5f4[_0xb52c('0x32')]),_0x23adb4);if(_0xf614bf['query'][_0xb52c('0x3a')]){_0xe69d1f[_0xb52c('0x38')]=_[_0xb52c('0x3b')](_0xe69d1f[_0xb52c('0x38')],{'$or':_['map'](_0x23adb4,function(_0x53670d){if(_0x53670d[_0xb52c('0x2e')]!==_0xb52c('0x3c')){var _0x335745={};_0x335745[_0x53670d[_0xb52c('0x28')]]={'$like':'%'+_0xf614bf[_0xb52c('0x31')]['filter']+'%'};return _0x335745;}})});}_0xe69d1f=_['merge']({},_0xe69d1f,_0xf614bf[_0xb52c('0x3d')]);var _0x31f608={'where':_0xe69d1f[_0xb52c('0x38')]};return db[_0xb52c('0x2c')][_0xb52c('0x1f')](_0x31f608)[_0xb52c('0x25')](function(_0x19b2f8){_0x4ff348[_0xb52c('0x1f')]=_0x19b2f8;if(_0xf614bf[_0xb52c('0x31')][_0xb52c('0x3e')]){_0xe69d1f['include']=[{'all':!![]}];}return db[_0xb52c('0x2c')]['findAll'](_0xe69d1f);})[_0xb52c('0x25')](function(_0x441d45){_0x4ff348[_0xb52c('0x3f')]=_0x441d45;return _0x4ff348;})[_0xb52c('0x25')](respondWithFilteredResult(_0x3616ea,_0xe69d1f))[_0xb52c('0x40')](handleError(_0x3616ea,null));};exports[_0xb52c('0x41')]=function(_0x59e7be,_0x4f0ea3){var _0x2abb60={'raw':!![],'where':{'id':_0x59e7be[_0xb52c('0x42')]['id']}},_0x1a40ef={};_0x1a40ef[_0xb52c('0x30')]=_[_0xb52c('0x43')](db[_0xb52c('0x2c')][_0xb52c('0x2d')]);_0x1a40ef[_0xb52c('0x31')]=_[_0xb52c('0x43')](_0x59e7be['query']);_0x1a40ef[_0xb52c('0x32')]=_[_0xb52c('0x33')](_0x1a40ef[_0xb52c('0x30')],_0x1a40ef[_0xb52c('0x31')]);_0x2abb60['attributes']=_[_0xb52c('0x33')](_0x1a40ef['model'],qs[_0xb52c('0x34')](_0x59e7be[_0xb52c('0x31')][_0xb52c('0x34')]));_0x2abb60[_0xb52c('0x35')]=_0x2abb60[_0xb52c('0x35')][_0xb52c('0x44')]?_0x2abb60['attributes']:_0x1a40ef[_0xb52c('0x30')];if(_0x59e7be[_0xb52c('0x31')][_0xb52c('0x3e')]){_0x2abb60[_0xb52c('0x45')]=[{'all':!![]}];}_0x2abb60=_[_0xb52c('0x3b')]({},_0x2abb60,_0x59e7be[_0xb52c('0x3d')]);return db[_0xb52c('0x2c')][_0xb52c('0x46')](_0x2abb60)[_0xb52c('0x25')](handleEntityNotFound(_0x4f0ea3,null))[_0xb52c('0x25')](respondWithResult(_0x4f0ea3,null))[_0xb52c('0x40')](handleError(_0x4f0ea3,null));};exports[_0xb52c('0x47')]=function(_0x20001d,_0xe4a356){return db[_0xb52c('0x2c')][_0xb52c('0x47')](_0x20001d[_0xb52c('0x48')],{})[_0xb52c('0x25')](respondWithResult(_0xe4a356,0xc9))[_0xb52c('0x40')](handleError(_0xe4a356,null));};exports[_0xb52c('0x49')]=function(_0x291116,_0x5ddaa1){if(_0x291116[_0xb52c('0x48')]['id']){delete _0x291116['body']['id'];}return db['WhatsappTransferReport'][_0xb52c('0x46')]({'where':{'id':_0x291116[_0xb52c('0x42')]['id']}})[_0xb52c('0x25')](handleEntityNotFound(_0x5ddaa1,null))[_0xb52c('0x25')](saveUpdates(_0x291116[_0xb52c('0x48')],null))['then'](respondWithResult(_0x5ddaa1,null))['catch'](handleError(_0x5ddaa1,null));};exports[_0xb52c('0x26')]=function(_0x19c7fb,_0x5de5d9){return db[_0xb52c('0x2c')][_0xb52c('0x46')]({'where':{'id':_0x19c7fb[_0xb52c('0x42')]['id']}})[_0xb52c('0x25')](handleEntityNotFound(_0x5de5d9,null))[_0xb52c('0x25')](removeEntity(_0x5de5d9,null))[_0xb52c('0x40')](handleError(_0x5de5d9,null));};exports[_0xb52c('0x4a')]=function(_0x9fc137,_0x2cace6){return db[_0xb52c('0x2c')][_0xb52c('0x4a')]()[_0xb52c('0x25')](respondWithResult(_0x2cace6,null))[_0xb52c('0x40')](handleError(_0x2cace6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 558f21b..225a5f7 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x056d=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x056d,0x157));var _0xd056=function(_0x3efd24,_0x307e53){_0x3efd24=_0x3efd24-0x0;var _0x5df6f2=_0x056d[_0x3efd24];return _0x5df6f2;};'use strict';var _=require('lodash');var util=require(_0xd056('0x0'));var logger=require(_0xd056('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd056('0x2'));var rp=require(_0xd056('0x3'));var fs=require('fs');var path=require(_0xd056('0x4'));var rimraf=require('rimraf');var config=require(_0xd056('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0xd056('0x6')]=function(_0x2b930e,_0x15869d){return _0x2b930e['define'](_0xd056('0x7'),attributes,{'tableName':_0xd056('0x8'),'paranoid':![],'indexes':[{'name':_0xd056('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c46=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x3b31bb,_0x2f4f7a){var _0x4ad228=function(_0x22dcff){while(--_0x22dcff){_0x3b31bb['push'](_0x3b31bb['shift']());}};_0x4ad228(++_0x2f4f7a);}(_0x8c46,0x126));var _0x68c4=function(_0x216586,_0x2e9346){_0x216586=_0x216586-0x0;var _0x2c0807=_0x8c46[_0x216586];return _0x2c0807;};'use strict';var _=require(_0x68c4('0x0'));var util=require(_0x68c4('0x1'));var logger=require(_0x68c4('0x2'))(_0x68c4('0x3'));var moment=require('moment');var BPromise=require(_0x68c4('0x4'));var rp=require(_0x68c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68c4('0x6'));var config=require(_0x68c4('0x7'));var attributes=require(_0x68c4('0x8'));module[_0x68c4('0x9')]=function(_0x53cddf,_0x5d4a4e){return _0x53cddf[_0x68c4('0xa')](_0x68c4('0xb'),attributes,{'tableName':_0x68c4('0xc'),'paranoid':![],'indexes':[{'name':_0x68c4('0xd'),'fields':[_0x68c4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b3ad450..b5b6e93 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f5f=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message'];(function(_0xd8be4e,_0x443708){var _0x2c3ec2=function(_0x263fad){while(--_0x263fad){_0xd8be4e['push'](_0xd8be4e['shift']());}};_0x2c3ec2(++_0x443708);}(_0x3f5f,0x181));var _0xf3f5=function(_0x55c307,_0x22b2ce){_0x55c307=_0x55c307-0x0;var _0xcca0a9=_0x3f5f[_0x55c307];return _0xcca0a9;};'use strict';var _=require(_0xf3f5('0x0'));var util=require(_0xf3f5('0x1'));var moment=require(_0xf3f5('0x2'));var BPromise=require(_0xf3f5('0x3'));var rs=require(_0xf3f5('0x4'));var fs=require('fs');var Redis=require(_0xf3f5('0x5'));var db=require(_0xf3f5('0x6'))['db'];var utils=require(_0xf3f5('0x7'));var logger=require(_0xf3f5('0x8'))(_0xf3f5('0x9'));var config=require('../../config/environment');var jayson=require(_0xf3f5('0xa'));var client=jayson[_0xf3f5('0xb')][_0xf3f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c62da,_0x261c16,_0x53d56b){return new BPromise(function(_0x339d43,_0x57b437){return client[_0xf3f5('0xd')](_0x2c62da,_0x53d56b)[_0xf3f5('0xe')](function(_0x48e3e9){logger[_0xf3f5('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x261c16,'request\x20sent');logger[_0xf3f5('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x261c16,_0xf3f5('0x11'),JSON[_0xf3f5('0x12')](_0x48e3e9));if(_0x48e3e9[_0xf3f5('0x13')]){if(_0x48e3e9[_0xf3f5('0x13')][_0xf3f5('0x14')]===0x1f4){logger[_0xf3f5('0x13')](_0xf3f5('0x15'),_0x261c16,_0x48e3e9[_0xf3f5('0x13')][_0xf3f5('0x16')]);return _0x57b437(_0x48e3e9[_0xf3f5('0x13')][_0xf3f5('0x16')]);}logger['error'](_0xf3f5('0x15'),_0x261c16,_0x48e3e9[_0xf3f5('0x13')][_0xf3f5('0x16')]);return _0x339d43(_0x48e3e9['error'][_0xf3f5('0x16')]);}else{logger[_0xf3f5('0xf')](_0xf3f5('0x15'),_0x261c16,_0xf3f5('0x11'));_0x339d43(_0x48e3e9[_0xf3f5('0x17')]['message']);}})['catch'](function(_0x5f3b0c){logger[_0xf3f5('0x13')](_0xf3f5('0x15'),_0x261c16,_0x5f3b0c);_0x57b437(_0x5f3b0c);});});} \ No newline at end of file +var _0xa9da=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x48921e,_0x381fe3){var _0x248665=function(_0xb651f1){while(--_0xb651f1){_0x48921e['push'](_0x48921e['shift']());}};_0x248665(++_0x381fe3);}(_0xa9da,0x193));var _0xaa9d=function(_0x381059,_0x288b52){_0x381059=_0x381059-0x0;var _0x2e53b9=_0xa9da[_0x381059];return _0x2e53b9;};'use strict';var _=require(_0xaa9d('0x0'));var util=require('util');var moment=require(_0xaa9d('0x1'));var BPromise=require(_0xaa9d('0x2'));var rs=require(_0xaa9d('0x3'));var fs=require('fs');var Redis=require(_0xaa9d('0x4'));var db=require(_0xaa9d('0x5'))['db'];var utils=require(_0xaa9d('0x6'));var logger=require(_0xaa9d('0x7'))('rpc');var config=require(_0xaa9d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ccb48,_0x10b290,_0x2bd0d6){return new BPromise(function(_0x4e9766,_0x353daa){return client[_0xaa9d('0xa')](_0x5ccb48,_0x2bd0d6)[_0xaa9d('0xb')](function(_0x27e7f3){logger[_0xaa9d('0xc')](_0xaa9d('0xd'),_0x10b290,_0xaa9d('0xe'));logger[_0xaa9d('0xf')](_0xaa9d('0x10'),_0x10b290,'request\x20sent',JSON[_0xaa9d('0x11')](_0x27e7f3));if(_0x27e7f3[_0xaa9d('0x12')]){if(_0x27e7f3['error'][_0xaa9d('0x13')]===0x1f4){logger[_0xaa9d('0x12')](_0xaa9d('0xd'),_0x10b290,_0x27e7f3[_0xaa9d('0x12')][_0xaa9d('0x14')]);return _0x353daa(_0x27e7f3[_0xaa9d('0x12')]['message']);}logger[_0xaa9d('0x12')](_0xaa9d('0xd'),_0x10b290,_0x27e7f3[_0xaa9d('0x12')][_0xaa9d('0x14')]);return _0x4e9766(_0x27e7f3['error']['message']);}else{logger[_0xaa9d('0xc')](_0xaa9d('0xd'),_0x10b290,_0xaa9d('0xe'));_0x4e9766(_0x27e7f3['result'][_0xaa9d('0x14')]);}})[_0xaa9d('0x15')](function(_0x35f13f){logger[_0xaa9d('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x10b290,_0x35f13f);_0x353daa(_0x35f13f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index ad77d46..d871ef3 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc101=['default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','online','join','Offline\x20apps:','filter','status','seedDB'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc101,0x17d));var _0x1c10=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0xc101[_0x39609a];return _0xecd92;};'use strict';var _=require(_0x1c10('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x1c10('0x1'));var config=require(_0x1c10('0x2'));var logger=require(_0x1c10('0x3'))(_0x1c10('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x1c10('0x5'));var schedule=require(_0x1c10('0x6'));var chat=require(_0x1c10('0x7'));var whatsapp=require(_0x1c10('0x8'));var transcribe=require(_0x1c10('0x9'));function main(){return mysqldb['db'][_0x1c10('0xa')][_0x1c10('0xb')]()[_0x1c10('0xc')](function(){return rpc[_0x1c10('0xd')]();})[_0x1c10('0xc')](function(_0x1e6501){logger[_0x1c10('0xe')](_0x1e6501);return chat[_0x1c10('0xf')]();})['then'](function(){return whatsapp[_0x1c10('0xf')]();})[_0x1c10('0xc')](function(){return schedule[_0x1c10('0xf')]();})[_0x1c10('0xc')](function(){return transcribe['start']();})[_0x1c10('0xc')](function(_0x37f56a){logger[_0x1c10('0xe')](_0x37f56a);return pm2[_0x1c10('0xf')](pm2Config);})[_0x1c10('0xc')](function(_0x1d6fa4){logger[_0x1c10('0xe')](_0x1c10('0x10'),_[_0x1c10('0x11')](_['filter'](_0x1d6fa4,{'status':_0x1c10('0x12')}),'name')[_0x1c10('0x13')]());logger[_0x1c10('0xe')](_0x1c10('0x14'),_[_0x1c10('0x11')](_[_0x1c10('0x15')](_0x1d6fa4,function(_0x7b98a9){return _0x7b98a9[_0x1c10('0x16')]!=='online';}),'name')[_0x1c10('0x13')]()||'None');config[_0x1c10('0x17')]&&require('./config/seedDB')[_0x1c10('0x18')]();require('./config/license')[_0x1c10('0x18')]();})[_0x1c10('0x19')](function(_0x278a9b){logger['error'](_0x1c10('0x1a'),_0x278a9b);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x98b8=['sync','then','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/whatsapp'];(function(_0x214470,_0x3223f1){var _0x2ab6e1=function(_0x566517){while(--_0x566517){_0x214470['push'](_0x214470['shift']());}};_0x2ab6e1(++_0x3223f1);}(_0x98b8,0x18d));var _0x898b=function(_0x588a79,_0x59fb05){_0x588a79=_0x588a79-0x0;var _0x51bb36=_0x98b8[_0x588a79];return _0x51bb36;};'use strict';var _=require(_0x898b('0x0'));var mysqldb=require(_0x898b('0x1'));var rpc=require(_0x898b('0x2'));var config=require(_0x898b('0x3'));var logger=require(_0x898b('0x4'))(_0x898b('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x898b('0x6'));var schedule=require(_0x898b('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x898b('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x898b('0x9')]()[_0x898b('0xa')](function(){return rpc['listen']();})[_0x898b('0xa')](function(_0x5404f8){logger[_0x898b('0xb')](_0x5404f8);return chat[_0x898b('0xc')]();})[_0x898b('0xa')](function(){return whatsapp[_0x898b('0xc')]();})[_0x898b('0xa')](function(){return schedule[_0x898b('0xc')]();})[_0x898b('0xa')](function(){return transcribe[_0x898b('0xc')]();})[_0x898b('0xa')](function(_0x4aaa38){logger[_0x898b('0xb')](_0x4aaa38);return pm2[_0x898b('0xc')](pm2Config);})[_0x898b('0xa')](function(_0x51c6f1){logger['info'](_0x898b('0xd'),_[_0x898b('0xe')](_[_0x898b('0xf')](_0x51c6f1,{'status':_0x898b('0x10')}),_0x898b('0x11'))[_0x898b('0x12')]());logger[_0x898b('0xb')](_0x898b('0x13'),_['map'](_[_0x898b('0xf')](_0x51c6f1,function(_0x47ad09){return _0x47ad09[_0x898b('0x14')]!==_0x898b('0x10');}),_0x898b('0x11'))[_0x898b('0x12')]()||_0x898b('0x15'));config[_0x898b('0x16')]&&require(_0x898b('0x17'))[_0x898b('0x18')]();require(_0x898b('0x19'))[_0x898b('0x18')]();})[_0x898b('0x1a')](function(_0xfa287c){logger[_0x898b('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xfa287c);process[_0x898b('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 67e89a9..7233790 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 _0xb3e4=['catch','headers','authorization','Basic','User','find','name','pass','Wrong\x20credentials.','Bearer','query','apikey','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','splice','encryptString','join','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','composable-middleware','basic-auth','util','moment','secrets','session','role','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','status','disposition','unmanaged','json','Unmanaged.','Forbidden.'];(function(_0x16068b,_0x3c2737){var _0x55fa62=function(_0x15bdc5){while(--_0x15bdc5){_0x16068b['push'](_0x16068b['shift']());}};_0x55fa62(++_0x3c2737);}(_0xb3e4,0x1cd));var _0x4b3e=function(_0x405940,_0x3581fc){_0x405940=_0x405940-0x0;var _0x1874cf=_0xb3e4[_0x405940];return _0x1874cf;};'use strict';var db=require(_0x4b3e('0x0'))['db'];var config=require(_0x4b3e('0x1'));var hardwareConf=require(_0x4b3e('0x2'));var licenseUtil=require(_0x4b3e('0x3'));var encryptor=require('../encryptor');var _=require(_0x4b3e('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x4b3e('0x5'));var basicAuth=require(_0x4b3e('0x6'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x4b3e('0x7'));var moment=require(_0x4b3e('0x8'));var validateJwt=expressJwt({'secret':config[_0x4b3e('0x9')][_0x4b3e('0xa')]});var userAttributes=['id',_0x4b3e('0xb'),'fullname','name',_0x4b3e('0xc'),_0x4b3e('0xd'),_0x4b3e('0xe'),'permissions',_0x4b3e('0xf'),_0x4b3e('0x10'),_0x4b3e('0x11'),_0x4b3e('0x12'),_0x4b3e('0x13'),_0x4b3e('0x14'),_0x4b3e('0x15'),_0x4b3e('0x16'),'showWebBar',_0x4b3e('0x17'),_0x4b3e('0x18'),_0x4b3e('0x19'),_0x4b3e('0x1a'),_0x4b3e('0x1b'),_0x4b3e('0x1c'),'phoneBarAutoAnswer',_0x4b3e('0x1d'),_0x4b3e('0x1e'),_0x4b3e('0x1f'),_0x4b3e('0x20'),_0x4b3e('0x21'),_0x4b3e('0x22'),_0x4b3e('0x23'),_0x4b3e('0x24'),'phoneBarRemoteControlPort',_0x4b3e('0x25'),_0x4b3e('0x26'),_0x4b3e('0x27'),_0x4b3e('0x28'),_0x4b3e('0x29'),_0x4b3e('0x2a'),_0x4b3e('0x2b'),_0x4b3e('0x2c'),_0x4b3e('0x2d')];exports[_0x4b3e('0x2e')]=function(){return this[_0x4b3e('0x2f')](!![])[_0x4b3e('0x30')](function(_0x106b06,_0x5946bc,_0x583610){if(_0x106b06[_0x4b3e('0x31')]){_0x583610();}else{return db[_0x4b3e('0x32')][_0x4b3e('0x33')]({'where':{'id':_0x106b06['params']['id']},'attributes':['id',_0x4b3e('0x34'),'disposition'],'raw':!![]})['then'](function(_0x42154c){if(_0x42154c&&_0x42154c[_0x4b3e('0x34')]){return _0x5946bc[_0x4b3e('0x35')](_0x42154c[_0x4b3e('0x36')]===_0x4b3e('0x37')?0x195:0x193)[_0x4b3e('0x38')]({'message':_0x42154c['disposition']===_0x4b3e('0x37')?_0x4b3e('0x39'):_0x4b3e('0x3a')});}else{_0x583610();}})[_0x4b3e('0x3b')](function(_0x252ce2){_0x583610(_0x252ce2);});}});};exports[_0x4b3e('0x2f')]=function isAuthenticated(_0xd997a7){return compose()[_0x4b3e('0x30')](function(_0x1e0102,_0x3cf924,_0x44793e){var _0x48c7d1;if(_0x1e0102[_0x4b3e('0x3c')][_0x4b3e('0x3d')]){if(_['startsWith'](_0x1e0102[_0x4b3e('0x3c')][_0x4b3e('0x3d')],_0x4b3e('0x3e'))){var _0x1f6157=basicAuth(_0x1e0102);db[_0x4b3e('0x3f')][_0x4b3e('0x40')]({'where':{'name':_0x1f6157[_0x4b3e('0x41')]}})['then'](function(_0x2aa997){if(!_0x2aa997||!_0x2aa997['authenticate'](_0x1f6157[_0x4b3e('0x42')])){return _0x3cf924[_0x4b3e('0x35')](0x191)[_0x4b3e('0x38')]({'message':_0x4b3e('0x43')});}_0x1e0102['user']={'id':_0x2aa997['id']};_0x44793e();})[_0x4b3e('0x3b')](function(_0x2e8988){_0x44793e(_0x2e8988);});}else if(_['startsWith'](_0x1e0102[_0x4b3e('0x3c')]['authorization'],_0x4b3e('0x44'))){validateJwt(_0x1e0102,_0x3cf924,_0x44793e);}else{if(_0xd997a7){_0x44793e();}else{return _0x3cf924['status'](0x193)[_0x4b3e('0x38')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1e0102[_0x4b3e('0x45')][_0x4b3e('0x46')]){try{var _0x2fcff9={'audience':hardwareConf[_0x4b3e('0x47')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1e0102[_0x4b3e('0x45')]['apikey'],_0x2fcff9)[_0x4b3e('0x48')](function(_0x24d8bf){return db[_0x4b3e('0x3f')][_0x4b3e('0x40')]({'where':{'id':_0x24d8bf[_0x4b3e('0x49')]}})['then'](function(_0x553af4){_0x48c7d1=_0x553af4;return db[_0x4b3e('0x4a')][_0x4b3e('0x33')]({'where':{'id':0x1},'attributes':[_0x4b3e('0x4b'),_0x4b3e('0x4c')],'raw':!![]});})['then'](function(_0x34dc31){if(!_0x48c7d1||!_[_0x4b3e('0x4d')](_0x48c7d1[_0x4b3e('0x4e')],_0x24d8bf[_0x4b3e('0x4f')])){return _0x3cf924['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x48c7d1[_0x4b3e('0x50')]){return _0x3cf924[_0x4b3e('0x35')](0x191)[_0x4b3e('0x38')]({'message':_0x4b3e('0x51')});}if(_0x48c7d1['blocked']){if(_0x34dc31[_0x4b3e('0x4c')]>0x0){if(moment(_0x48c7d1[_0x4b3e('0x52')])[_0x4b3e('0x53')](_0x34dc31[_0x4b3e('0x4c')],_0x4b3e('0x54'))>moment()){return _0x3cf924[_0x4b3e('0x35')](0x191)['json']({'message':_0x4b3e('0x51')});}}else{return _0x3cf924[_0x4b3e('0x35')](0x191)[_0x4b3e('0x38')]({'message':_0x4b3e('0x51')});}}_0x1e0102['user']={'id':_0x48c7d1['id']};_0x44793e();});})[_0x4b3e('0x3b')](function(){return _0x3cf924[_0x4b3e('0x35')](0x191)['json']({'message':_0x4b3e('0x51')});});}catch(_0x1e6c89){_0x44793e(_0x1e6c89);}}else if(_0xd997a7){_0x44793e();}else{return _0x3cf924[_0x4b3e('0x35')](0x193)['json']({'message':_0x4b3e('0x55')});}})[_0x4b3e('0x30')](function(_0x1f42cf,_0x1b1bf2,_0x9af2d8){if(_0x1f42cf[_0x4b3e('0x31')]){db[_0x4b3e('0x3f')][_0x4b3e('0x40')]({'where':{'id':_0x1f42cf[_0x4b3e('0x31')]['id']},'attributes':userAttributes})[_0x4b3e('0x48')](function(_0x58dc6c){if(!_0x58dc6c){return _0x1b1bf2[_0x4b3e('0x35')](0x194)[_0x4b3e('0x38')]({'message':_0x4b3e('0x56')});}_0x1f42cf[_0x4b3e('0x31')]=_0x58dc6c;_0x9af2d8();})[_0x4b3e('0x3b')](function(_0x47e1e0){_0x9af2d8(_0x47e1e0);});}else if(_0xd997a7){_0x9af2d8();}else{return _0x1b1bf2['status'](0x194)[_0x4b3e('0x38')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x4b3e('0x57')]=function canUpdate(){return compose()[_0x4b3e('0x30')](function(_0x2c6433,_0x1f06c0,_0x322263){return licenseUtil[_0x4b3e('0x58')]()[_0x4b3e('0x48')](function(_0x4ea09b){if(_0x4ea09b[_0x4b3e('0x59')]){_0x322263();}else{return _0x1f06c0['status'](0x193)[_0x4b3e('0x38')]({'message':'Forbidden'});}})['catch'](function(_0x17472b){_0x322263(_0x17472b);});});};exports[_0x4b3e('0x5a')]=function(_0x55b1d4,_0x43e1d0,_0x3c6228){_0x55b1d4[_0x4b3e('0x5a')]=!![];return _0x3c6228();};exports[_0x4b3e('0x5b')]=function signToken(_0x435c0a){return signJwt(_0x435c0a);};exports[_0x4b3e('0x5c')]=function(_0x460592,_0x49356a){if(!_0x460592[_0x4b3e('0x31')]){return _0x49356a['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x112c67={'payload':{'id':_0x460592[_0x4b3e('0x31')]['id'],'role':_0x460592[_0x4b3e('0x31')][_0x4b3e('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x112c67)['then'](function(_0x580d0d){_0x49356a[_0x4b3e('0x5d')](_0x4b3e('0x5e'),_0x580d0d);_0x49356a[_0x4b3e('0x5f')](_0x4b3e('0x60'));})['catch'](function(_0x434f23){return _0x49356a[_0x4b3e('0x35')](0x1f4)[_0x4b3e('0x61')](_0x434f23);});};exports['retrieveApiKey']=function(_0x164980){if(_[_0x4b3e('0x62')](_0x164980['apiKeyNonce'])||_[_0x4b3e('0x62')](_0x164980[_0x4b3e('0x63')])){return null;}else{return createJwt(_0x164980);}};exports[_0x4b3e('0x64')]=function(_0x5d1f1b){_0x5d1f1b[_0x4b3e('0x4e')]=generateNonce();_0x5d1f1b[_0x4b3e('0x63')]=generateIssuedAt();return createJwt(_0x5d1f1b);};exports['regenerateApiKey']=function(_0x4c4545,_0x2ffddc){var _0x3c7ece=_0x4c4545[_0x4b3e('0x45')]['apikey'];if(_0x3c7ece){var _0x22daee={'nonce':_0x2ffddc[_0x4b3e('0x4e')],'iat':_0x2ffddc[_0x4b3e('0x63')],'audience':hardwareConf[_0x4b3e('0x47')](),'issuer':hardwareConf[_0x4b3e('0x47')]()};return verifyJwt(_0x3c7ece,_0x22daee)[_0x4b3e('0x48')](function(){return generateApiKey(_0x2ffddc);});}else{throw{'message':_0x4b3e('0x65')};}};exports[_0x4b3e('0x66')]=function(_0x180f9f){var _0x21cd1f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21cd1f[_0x4b3e('0x67')](_0x180f9f))throw new db[(_0x4b3e('0x68'))][(_0x4b3e('0x69'))](_0x4b3e('0x6a'));return;};exports[_0x4b3e('0x6b')]=function(_0x17652e,_0x5a9e37,_0x25793e){var _0x239f01=encryptor[_0x4b3e('0x6c')](_0x5a9e37)['split'](',');for(var _0x2150ba=0x0;_0x2150ba<_0x25793e;_0x2150ba++){if(!_0x239f01[_0x2150ba])break;if(_0x17652e[_0x4b3e('0x6d')]()===_0x239f01[_0x2150ba][_0x4b3e('0x6d')]()){var _0x44e6c6=util[_0x4b3e('0x6e')](_0x4b3e('0x6f'),_0x25793e);if(_0x25793e===0x1){_0x44e6c6=_0x4b3e('0x70');}throw new db['Sequelize'][(_0x4b3e('0x69'))](_0x44e6c6);}}return;};exports[_0x4b3e('0x71')]=function(_0x1d24e0,_0x28062f){var _0x134c0e=_0x28062f?encryptor[_0x4b3e('0x6c')](_0x28062f)[_0x4b3e('0x72')](','):[];if(_0x134c0e[_0x4b3e('0x73')]===0x5){_0x134c0e[_0x4b3e('0x74')](-0x1,0x1);}_0x134c0e['unshift'](_0x1d24e0);return encryptor[_0x4b3e('0x75')](_0x134c0e[_0x4b3e('0x76')](','));};function signJwt(_0x2ab431){var _0x302f38=BPromise['promisify'](jwt[_0x4b3e('0x77')],{'context':jwt});var _0x2b0d3b=_0x2ab431[_0x4b3e('0x78')]||config[_0x4b3e('0x9')][_0x4b3e('0xa')];return new BPromise(function(_0xc8eff0,_0x3ff13c){_0x302f38(_0x2ab431[_0x4b3e('0x79')],_0x2b0d3b,_0x2ab431[_0x4b3e('0x7a')])['then'](function(_0x135855){_0xc8eff0(_0x135855);})['catch'](function(_0x2108f3){_0x3ff13c(_0x2108f3);});});}function verifyJwt(_0x5d628d,_0x5cabab,_0x95342b){var _0x2a8345=BPromise['promisify'](jwt[_0x4b3e('0x7b')],{'context':jwt});var _0x58b969=_0x95342b||config[_0x4b3e('0x9')][_0x4b3e('0xa')];return new BPromise(function(_0x57d01c,_0x47777a){_0x2a8345(_0x5d628d,_0x58b969,_0x5cabab)[_0x4b3e('0x48')](function(_0x5e5448){_0x57d01c(_0x5e5448);})['catch'](function(_0x299fae){_0x47777a(_0x299fae);});});}function generateNonce(){return crypto[_0x4b3e('0x7c')](0x10)[_0x4b3e('0x7d')](_0x4b3e('0x7e'));}function generateIssuedAt(){return Math[_0x4b3e('0x7f')](Date[_0x4b3e('0x80')]()/0x3e8)[_0x4b3e('0x7d')]();}function createJwt(_0x3e0cd2){var _0x1c4811={'payload':{'iat':_0x3e0cd2[_0x4b3e('0x63')],'nonce':_0x3e0cd2[_0x4b3e('0x4e')]},'options':{'algorithm':_0x4b3e('0x81'),'subject':_0x3e0cd2['id'][_0x4b3e('0x7d')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x4b3e('0x47')]()}};return signJwt(_0x1c4811)[_0x4b3e('0x48')](function(_0x429560){return{'iat':_0x3e0cd2[_0x4b3e('0x63')],'nonce':_0x3e0cd2[_0x4b3e('0x4e')],'token':_0x429560};});} \ No newline at end of file +var _0x5fdd=['phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','disposition','closed','status','unmanaged','json','Forbidden.','catch','headers','Basic','User','find','name','then','authenticate','pass','Wrong\x20credentials.','user','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','blockDuration','apiKeyNonce','nonce','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','getLicense','Forbidden','isMiddleware','signToken','motion.token','redirect','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','splice','unshift','encryptString','join','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','secrets','fullname','internal','userpic','md5secret','voicePause','chatPause','faxPause','smsPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5fdd,0x133));var _0xd5fd=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x5fdd[_0x43dc7e];return _0x21e12d;};'use strict';var db=require(_0xd5fd('0x0'))['db'];var config=require(_0xd5fd('0x1'));var hardwareConf=require(_0xd5fd('0x2'));var licenseUtil=require(_0xd5fd('0x3'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0xd5fd('0x4'));var expressJwt=require(_0xd5fd('0x5'));var compose=require(_0xd5fd('0x6'));var basicAuth=require(_0xd5fd('0x7'));var crypto=require('crypto');var BPromise=require(_0xd5fd('0x8'));var util=require(_0xd5fd('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xd5fd('0xa')]['session']});var userAttributes=['id','role',_0xd5fd('0xb'),'name',_0xd5fd('0xc'),'email',_0xd5fd('0xd'),'permissions',_0xd5fd('0xe'),_0xd5fd('0xf'),_0xd5fd('0x10'),'mailPause',_0xd5fd('0x11'),_0xd5fd('0x12'),'openchannelPause',_0xd5fd('0x13'),'showWebBar',_0xd5fd('0x14'),_0xd5fd('0x15'),_0xd5fd('0x16'),_0xd5fd('0x17'),_0xd5fd('0x18'),_0xd5fd('0x19'),_0xd5fd('0x1a'),_0xd5fd('0x1b'),'phoneBarDnd',_0xd5fd('0x1c'),'phoneBarEnableDtmfTone',_0xd5fd('0x1d'),_0xd5fd('0x1e'),'phoneBarPrefixRequired',_0xd5fd('0x1f'),_0xd5fd('0x20'),_0xd5fd('0x21'),_0xd5fd('0x22'),'userProfileId',_0xd5fd('0x23'),_0xd5fd('0x24'),_0xd5fd('0x25'),_0xd5fd('0x26'),'downloadOmnichannelInteractions','downloadAttachments'];exports[_0xd5fd('0x27')]=function(){return this[_0xd5fd('0x28')](!![])[_0xd5fd('0x29')](function(_0x262c57,_0x22f688,_0x2bc4e1){if(_0x262c57['user']){_0x2bc4e1();}else{return db[_0xd5fd('0x2a')][_0xd5fd('0x2b')]({'where':{'id':_0x262c57[_0xd5fd('0x2c')]['id']},'attributes':['id','closed',_0xd5fd('0x2d')],'raw':!![]})['then'](function(_0x585edd){if(_0x585edd&&_0x585edd[_0xd5fd('0x2e')]){return _0x22f688[_0xd5fd('0x2f')](_0x585edd[_0xd5fd('0x2d')]===_0xd5fd('0x30')?0x195:0x193)[_0xd5fd('0x31')]({'message':_0x585edd[_0xd5fd('0x2d')]===_0xd5fd('0x30')?'Unmanaged.':_0xd5fd('0x32')});}else{_0x2bc4e1();}})[_0xd5fd('0x33')](function(_0x55d008){_0x2bc4e1(_0x55d008);});}});};exports[_0xd5fd('0x28')]=function isAuthenticated(_0x4901d4){return compose()[_0xd5fd('0x29')](function(_0x45a762,_0x53f620,_0x2b5a12){var _0x3c5c73;if(_0x45a762[_0xd5fd('0x34')]['authorization']){if(_['startsWith'](_0x45a762[_0xd5fd('0x34')]['authorization'],_0xd5fd('0x35'))){var _0x85351a=basicAuth(_0x45a762);db[_0xd5fd('0x36')][_0xd5fd('0x37')]({'where':{'name':_0x85351a[_0xd5fd('0x38')]}})[_0xd5fd('0x39')](function(_0x41ceb2){if(!_0x41ceb2||!_0x41ceb2[_0xd5fd('0x3a')](_0x85351a[_0xd5fd('0x3b')])){return _0x53f620[_0xd5fd('0x2f')](0x191)['json']({'message':_0xd5fd('0x3c')});}_0x45a762[_0xd5fd('0x3d')]={'id':_0x41ceb2['id']};_0x2b5a12();})[_0xd5fd('0x33')](function(_0x95447c){_0x2b5a12(_0x95447c);});}else if(_[_0xd5fd('0x3e')](_0x45a762['headers']['authorization'],'Bearer')){validateJwt(_0x45a762,_0x53f620,_0x2b5a12);}else{if(_0x4901d4){_0x2b5a12();}else{return _0x53f620['status'](0x193)[_0xd5fd('0x31')]({'message':_0xd5fd('0x3f')});}}}else if(_0x45a762[_0xd5fd('0x40')][_0xd5fd('0x41')]){try{var _0x4fd6e4={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xd5fd('0x42')]()};verifyJwt(_0x45a762[_0xd5fd('0x40')][_0xd5fd('0x41')],_0x4fd6e4)[_0xd5fd('0x39')](function(_0x2dbae3){return db[_0xd5fd('0x36')][_0xd5fd('0x37')]({'where':{'id':_0x2dbae3['sub']}})[_0xd5fd('0x39')](function(_0x54e74a){_0x3c5c73=_0x54e74a;return db['Setting'][_0xd5fd('0x2b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd5fd('0x43')],'raw':!![]});})[_0xd5fd('0x39')](function(_0x5a7496){if(!_0x3c5c73||!_['isEqual'](_0x3c5c73[_0xd5fd('0x44')],_0x2dbae3[_0xd5fd('0x45')])){return _0x53f620[_0xd5fd('0x2f')](0x191)[_0xd5fd('0x31')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3c5c73[_0xd5fd('0x46')]){return _0x53f620[_0xd5fd('0x2f')](0x191)[_0xd5fd('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3c5c73[_0xd5fd('0x47')]){if(_0x5a7496['blockDuration']>0x0){if(moment(_0x3c5c73[_0xd5fd('0x48')])[_0xd5fd('0x49')](_0x5a7496[_0xd5fd('0x43')],_0xd5fd('0x4a'))>moment()){return _0x53f620[_0xd5fd('0x2f')](0x191)['json']({'message':_0xd5fd('0x4b')});}}else{return _0x53f620[_0xd5fd('0x2f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x45a762['user']={'id':_0x3c5c73['id']};_0x2b5a12();});})['catch'](function(){return _0x53f620['status'](0x191)['json']({'message':_0xd5fd('0x4b')});});}catch(_0xf10fae){_0x2b5a12(_0xf10fae);}}else if(_0x4901d4){_0x2b5a12();}else{return _0x53f620['status'](0x193)[_0xd5fd('0x31')]({'message':_0xd5fd('0x3f')});}})[_0xd5fd('0x29')](function(_0x51c3fd,_0x3d34d8,_0xfcbff){if(_0x51c3fd[_0xd5fd('0x3d')]){db[_0xd5fd('0x36')][_0xd5fd('0x37')]({'where':{'id':_0x51c3fd['user']['id']},'attributes':userAttributes})[_0xd5fd('0x39')](function(_0x1d4179){if(!_0x1d4179){return _0x3d34d8[_0xd5fd('0x2f')](0x194)[_0xd5fd('0x31')]({'message':'User\x20not\x20found.'});}_0x51c3fd[_0xd5fd('0x3d')]=_0x1d4179;_0xfcbff();})['catch'](function(_0x34827e){_0xfcbff(_0x34827e);});}else if(_0x4901d4){_0xfcbff();}else{return _0x3d34d8[_0xd5fd('0x2f')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xd5fd('0x29')](function(_0x43a80c,_0x17da51,_0xaf6aa8){return licenseUtil[_0xd5fd('0x4c')]()[_0xd5fd('0x39')](function(_0x5f455e){if(_0x5f455e['update']){_0xaf6aa8();}else{return _0x17da51[_0xd5fd('0x2f')](0x193)['json']({'message':_0xd5fd('0x4d')});}})[_0xd5fd('0x33')](function(_0x313912){_0xaf6aa8(_0x313912);});});};exports[_0xd5fd('0x4e')]=function(_0x320ad0,_0x115463,_0x499273){_0x320ad0['isMiddleware']=!![];return _0x499273();};exports[_0xd5fd('0x4f')]=function signToken(_0x41a0f6){return signJwt(_0x41a0f6);};exports['setTokenCookie']=function(_0x1a1a7a,_0x1b949e){if(!_0x1a1a7a[_0xd5fd('0x3d')]){return _0x1b949e[_0xd5fd('0x2f')](0x194)[_0xd5fd('0x31')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x770ef2={'payload':{'id':_0x1a1a7a['user']['id'],'role':_0x1a1a7a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x770ef2)[_0xd5fd('0x39')](function(_0x269db4){_0x1b949e['cookie'](_0xd5fd('0x50'),_0x269db4);_0x1b949e[_0xd5fd('0x51')]('/dashboards/general');})['catch'](function(_0x4c4641){return _0x1b949e['status'](0x1f4)['send'](_0x4c4641);});};exports['retrieveApiKey']=function(_0x2929e0){if(_[_0xd5fd('0x52')](_0x2929e0[_0xd5fd('0x44')])||_['isNil'](_0x2929e0[_0xd5fd('0x53')])){return null;}else{return createJwt(_0x2929e0);}};exports[_0xd5fd('0x54')]=function(_0x3ebb0d){_0x3ebb0d[_0xd5fd('0x44')]=generateNonce();_0x3ebb0d['apiKeyIat']=generateIssuedAt();return createJwt(_0x3ebb0d);};exports['regenerateApiKey']=function(_0x396587,_0x2724c5){var _0x3efaf2=_0x396587[_0xd5fd('0x40')][_0xd5fd('0x41')];if(_0x3efaf2){var _0x4c384a={'nonce':_0x2724c5[_0xd5fd('0x44')],'iat':_0x2724c5['apiKeyIat'],'audience':hardwareConf[_0xd5fd('0x42')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3efaf2,_0x4c384a)['then'](function(){return generateApiKey(_0x2724c5);});}else{throw{'message':_0xd5fd('0x55')};}};exports['validatePasswordPattern']=function(_0x3b2218){var _0x5db73e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5db73e[_0xd5fd('0x56')](_0x3b2218))throw new db[(_0xd5fd('0x57'))][(_0xd5fd('0x58'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5039aa,_0x4d0cf2,_0x5c5b28){var _0x3d6c06=encryptor[_0xd5fd('0x59')](_0x4d0cf2)['split'](',');for(var _0x3e6f66=0x0;_0x3e6f66<_0x5c5b28;_0x3e6f66++){if(!_0x3d6c06[_0x3e6f66])break;if(_0x5039aa[_0xd5fd('0x5a')]()===_0x3d6c06[_0x3e6f66]['toLowerCase']()){var _0x255527=util[_0xd5fd('0x5b')](_0xd5fd('0x5c'),_0x5c5b28);if(_0x5c5b28===0x1){_0x255527='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xd5fd('0x57'))]['ValidationError'](_0x255527);}}return;};exports[_0xd5fd('0x5d')]=function(_0x30eaf9,_0x338bee){var _0x454055=_0x338bee?encryptor[_0xd5fd('0x59')](_0x338bee)[_0xd5fd('0x5e')](','):[];if(_0x454055[_0xd5fd('0x5f')]===0x5){_0x454055[_0xd5fd('0x60')](-0x1,0x1);}_0x454055[_0xd5fd('0x61')](_0x30eaf9);return encryptor[_0xd5fd('0x62')](_0x454055[_0xd5fd('0x63')](','));};function signJwt(_0x4c7f99){var _0x5d3ebe=BPromise['promisify'](jwt[_0xd5fd('0x64')],{'context':jwt});var _0x523ad7=_0x4c7f99[_0xd5fd('0x65')]||config[_0xd5fd('0xa')][_0xd5fd('0x66')];return new BPromise(function(_0x5829d9,_0x1a66da){_0x5d3ebe(_0x4c7f99[_0xd5fd('0x67')],_0x523ad7,_0x4c7f99[_0xd5fd('0x68')])[_0xd5fd('0x39')](function(_0x411ec0){_0x5829d9(_0x411ec0);})[_0xd5fd('0x33')](function(_0x5efe2d){_0x1a66da(_0x5efe2d);});});}function verifyJwt(_0x280cc1,_0x47befc,_0x3c9f1d){var _0x576701=BPromise['promisify'](jwt[_0xd5fd('0x69')],{'context':jwt});var _0x18458d=_0x3c9f1d||config[_0xd5fd('0xa')][_0xd5fd('0x66')];return new BPromise(function(_0x31348c,_0x113377){_0x576701(_0x280cc1,_0x18458d,_0x47befc)[_0xd5fd('0x39')](function(_0x296273){_0x31348c(_0x296273);})[_0xd5fd('0x33')](function(_0x4f344a){_0x113377(_0x4f344a);});});}function generateNonce(){return crypto[_0xd5fd('0x6a')](0x10)[_0xd5fd('0x6b')](_0xd5fd('0x6c'));}function generateIssuedAt(){return Math[_0xd5fd('0x6d')](Date['now']()/0x3e8)[_0xd5fd('0x6b')]();}function createJwt(_0x30f494){var _0x39f856={'payload':{'iat':_0x30f494[_0xd5fd('0x53')],'nonce':_0x30f494[_0xd5fd('0x44')]},'options':{'algorithm':_0xd5fd('0x6e'),'subject':_0x30f494['id'][_0xd5fd('0x6b')](),'issuer':hardwareConf[_0xd5fd('0x42')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x39f856)[_0xd5fd('0x39')](function(_0x244514){return{'iat':_0x30f494[_0xd5fd('0x53')],'nonce':_0x30f494['apiKeyNonce'],'token':_0x244514};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 164d4b7..46a2384 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 _0x5555=['base64','decryptString','utf8','crypto','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','algorithm','encrypt','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','end','final','binary','close','decryptFile','createDecipher','write','unlink','secret','update'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x5555,0x113));var _0x5555=function(_0x40912b,_0x48107c){_0x40912b=_0x40912b-0x0;var _0x179a45=_0x5555[_0x40912b];return _0x179a45;};'use strict';var crypto=require(_0x5555('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x5555('0x1'));var logger=require(_0x5555('0x2'))(_0x5555('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x5555('0x4')};const fileOptions={'algorithm':_0x5555('0x5')};if(config['encrypt']&&config['encrypt'][_0x5555('0x6')]){var isSupported=isAlgorithmSupported(config[_0x5555('0x7')][_0x5555('0x6')]);if(isSupported){fileOptions[_0x5555('0x6')]=config['encrypt'][_0x5555('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5555('0x8')](',\x20');logger[_0x5555('0x9')](config[_0x5555('0x7')][_0x5555('0x6')],_0x5555('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x271d40){return AES_SUPPORTED_RX[_0x5555('0xb')](_0x271d40);}function getSupportedCiphers(){return crypto[_0x5555('0xc')]()[_0x5555('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x29e64e){return getSupportedCiphers()[_0x5555('0xe')](_0x29e64e)>-0x1;}function combineOptions(_0x5ec1b7){var _0x323642={};for(var _0x5e7e18 in fileOptions){if(fileOptions[_0x5555('0xf')](_0x5e7e18)){_0x323642[_0x5e7e18]=fileOptions[_0x5e7e18];}}if(_0x5ec1b7){for(var _0x1d27ef in _0x5ec1b7){if(_0x5ec1b7[_0x5555('0xf')](_0x1d27ef)){_0x323642[_0x1d27ef]=_0x5ec1b7[_0x1d27ef];}}}return _0x323642;}exports[_0x5555('0x10')]=function(_0x41140a,_0x96535d,_0xb7193f,_0x32a4b5){return new BPromise(function(_0x381e13,_0xdf4ec5){_0x32a4b5=combineOptions(_0x32a4b5);var _0x1ca144=new Buffer(_0xb7193f);var _0x5617c7=fs[_0x5555('0x11')](_0x41140a);var _0x564605=fs[_0x5555('0x12')](_0x96535d);var _0x399800=crypto[_0x5555('0x13')](_0x32a4b5[_0x5555('0x6')],_0x1ca144);_0x5617c7['on'](_0x5555('0x14'),function(_0x36339d){var _0x33b6e9=new Buffer(_0x399800['update'](_0x36339d),'binary');_0x564605['write'](_0x33b6e9);});_0x5617c7['on'](_0x5555('0x15'),function(){try{var _0x3cace6=new Buffer(_0x399800[_0x5555('0x16')](_0x5555('0x17')),_0x5555('0x17'));_0x564605['write'](_0x3cace6);_0x564605[_0x5555('0x15')]();_0x564605['on'](_0x5555('0x18'),function(){return _0x381e13(_0x96535d);});}catch(_0x5cd1f5){fs['unlink'](_0x96535d);return _0xdf4ec5(_0x5cd1f5);}});});};exports[_0x5555('0x19')]=function(_0x40282c,_0x46b4f8,_0x5e0f53,_0x386d09){return new BPromise(function(_0x165f91,_0x28be7d){_0x386d09=combineOptions(_0x386d09);var _0x463cb4=new Buffer(_0x5e0f53);var _0x41ea4e=fs[_0x5555('0x11')](_0x40282c);var _0x18b7ca=fs[_0x5555('0x12')](_0x46b4f8);var _0x132d06=crypto[_0x5555('0x1a')](_0x386d09[_0x5555('0x6')],_0x463cb4);_0x41ea4e['on'](_0x5555('0x14'),function(_0x120a5c){var _0x2e58b1=new Buffer(_0x132d06['update'](_0x120a5c),_0x5555('0x17'));_0x18b7ca['write'](_0x2e58b1);});_0x41ea4e['on'](_0x5555('0x15'),function(){try{var _0x3e15d7=new Buffer(_0x132d06[_0x5555('0x16')]('binary'),_0x5555('0x17'));_0x18b7ca[_0x5555('0x1b')](_0x3e15d7);_0x18b7ca[_0x5555('0x15')]();_0x18b7ca['on'](_0x5555('0x18'),function(){return _0x165f91(_0x46b4f8);});}catch(_0x159ed9){fs[_0x5555('0x1c')](_0x46b4f8);return _0x28be7d(_0x159ed9);}});});};exports['encryptString']=function(_0x554d89,_0x569719,_0x1f0340){var _0xd9df36=_0x1f0340||stringOptions[_0x5555('0x6')];var _0xcda5ba=_0x569719||stringOptions[_0x5555('0x1d')];var _0x171cfd=crypto[_0x5555('0x13')](_0xd9df36,_0xcda5ba);var _0x4d29a6=_0x171cfd[_0x5555('0x1e')](_0x554d89,'utf8','base64');_0x4d29a6+=_0x171cfd[_0x5555('0x16')](_0x5555('0x1f'));return _0x4d29a6;};exports[_0x5555('0x20')]=function(_0x17e983,_0x21311c,_0x38f7a6){var _0x12630d=_0x38f7a6||stringOptions['algorithm'];var _0x15d079=_0x21311c||stringOptions['secret'];var _0x1fe7ea=crypto[_0x5555('0x1a')](_0x12630d,_0x15d079);var _0x2a4e66=_0x1fe7ea['update'](_0x17e983,_0x5555('0x1f'),_0x5555('0x21'));_0x2a4e66+=_0x1fe7ea[_0x5555('0x16')](_0x5555('0x21'));return _0x2a4e66;}; \ No newline at end of file +var _0xd8a8=['decryptString','createDecipher','crypto','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','secret','utf8','base64'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd8a8,0xac));var _0x8d8a=function(_0x45d608,_0x3def2e){_0x45d608=_0x45d608-0x0;var _0x537086=_0xd8a8[_0x45d608];return _0x537086;};'use strict';var crypto=require(_0x8d8a('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x8d8a('0x1'));var logger=require(_0x8d8a('0x2'))(_0x8d8a('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8d8a('0x4')][_0x8d8a('0x5')],'algorithm':_0x8d8a('0x6')};const fileOptions={'algorithm':_0x8d8a('0x7')};if(config['encrypt']&&config[_0x8d8a('0x8')][_0x8d8a('0x9')]){var isSupported=isAlgorithmSupported(config[_0x8d8a('0x8')][_0x8d8a('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x8d8a('0x8')][_0x8d8a('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8d8a('0xa')](',\x20');logger[_0x8d8a('0xb')](config[_0x8d8a('0x8')][_0x8d8a('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x58c7b1){return AES_SUPPORTED_RX[_0x8d8a('0xc')](_0x58c7b1);}function getSupportedCiphers(){return crypto[_0x8d8a('0xd')]()[_0x8d8a('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2a8667){return getSupportedCiphers()['indexOf'](_0x2a8667)>-0x1;}function combineOptions(_0x53786a){var _0x15a0c9={};for(var _0x243e6f in fileOptions){if(fileOptions[_0x8d8a('0xf')](_0x243e6f)){_0x15a0c9[_0x243e6f]=fileOptions[_0x243e6f];}}if(_0x53786a){for(var _0x5200da in _0x53786a){if(_0x53786a[_0x8d8a('0xf')](_0x5200da)){_0x15a0c9[_0x5200da]=_0x53786a[_0x5200da];}}}return _0x15a0c9;}exports[_0x8d8a('0x10')]=function(_0x27cdf8,_0x26e3b5,_0x3b760f,_0x5dcff0){return new BPromise(function(_0x21d0b8,_0x13535c){_0x5dcff0=combineOptions(_0x5dcff0);var _0x1663ad=new Buffer(_0x3b760f);var _0x373bd6=fs[_0x8d8a('0x11')](_0x27cdf8);var _0x47e7e8=fs[_0x8d8a('0x12')](_0x26e3b5);var _0x3ccb70=crypto[_0x8d8a('0x13')](_0x5dcff0[_0x8d8a('0x9')],_0x1663ad);_0x373bd6['on'](_0x8d8a('0x14'),function(_0x46d2b1){var _0xf1388e=new Buffer(_0x3ccb70[_0x8d8a('0x15')](_0x46d2b1),_0x8d8a('0x16'));_0x47e7e8[_0x8d8a('0x17')](_0xf1388e);});_0x373bd6['on'](_0x8d8a('0x18'),function(){try{var _0x285832=new Buffer(_0x3ccb70[_0x8d8a('0x19')]('binary'),_0x8d8a('0x16'));_0x47e7e8[_0x8d8a('0x17')](_0x285832);_0x47e7e8[_0x8d8a('0x18')]();_0x47e7e8['on'](_0x8d8a('0x1a'),function(){return _0x21d0b8(_0x26e3b5);});}catch(_0x5b835f){fs[_0x8d8a('0x1b')](_0x26e3b5);return _0x13535c(_0x5b835f);}});});};exports[_0x8d8a('0x1c')]=function(_0x55ea79,_0x2819a4,_0x164723,_0x12bc5f){return new BPromise(function(_0x1d7251,_0x5ca1b3){_0x12bc5f=combineOptions(_0x12bc5f);var _0x5aeca7=new Buffer(_0x164723);var _0x7b59c7=fs[_0x8d8a('0x11')](_0x55ea79);var _0x2effbb=fs[_0x8d8a('0x12')](_0x2819a4);var _0x48ab53=crypto['createDecipher'](_0x12bc5f['algorithm'],_0x5aeca7);_0x7b59c7['on'](_0x8d8a('0x14'),function(_0xe03be){var _0x557371=new Buffer(_0x48ab53['update'](_0xe03be),_0x8d8a('0x16'));_0x2effbb[_0x8d8a('0x17')](_0x557371);});_0x7b59c7['on']('end',function(){try{var _0x3089fa=new Buffer(_0x48ab53[_0x8d8a('0x19')]('binary'),'binary');_0x2effbb[_0x8d8a('0x17')](_0x3089fa);_0x2effbb[_0x8d8a('0x18')]();_0x2effbb['on'](_0x8d8a('0x1a'),function(){return _0x1d7251(_0x2819a4);});}catch(_0x437014){fs[_0x8d8a('0x1b')](_0x2819a4);return _0x5ca1b3(_0x437014);}});});};exports['encryptString']=function(_0x25fa40,_0x427188,_0x2ee1bc){var _0x5170a1=_0x2ee1bc||stringOptions[_0x8d8a('0x9')];var _0x4bc0af=_0x427188||stringOptions[_0x8d8a('0x1d')];var _0x1615f0=crypto[_0x8d8a('0x13')](_0x5170a1,_0x4bc0af);var _0x33fe96=_0x1615f0[_0x8d8a('0x15')](_0x25fa40,_0x8d8a('0x1e'),'base64');_0x33fe96+=_0x1615f0[_0x8d8a('0x19')](_0x8d8a('0x1f'));return _0x33fe96;};exports[_0x8d8a('0x20')]=function(_0x39ddfb,_0x4f828e,_0x40bfac){var _0x1cc3d1=_0x40bfac||stringOptions[_0x8d8a('0x9')];var _0x39b7dd=_0x4f828e||stringOptions[_0x8d8a('0x1d')];var _0x47b67f=crypto[_0x8d8a('0x21')](_0x1cc3d1,_0x39b7dd);var _0x3d69af=_0x47b67f[_0x8d8a('0x15')](_0x39ddfb,_0x8d8a('0x1f'),_0x8d8a('0x1e'));_0x3d69af+=_0x47b67f['final'](_0x8d8a('0x1e'));return _0x3d69af;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index f853c19..94a60bb 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 _0x2f3a=['Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','dirname','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','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','finally','util','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','CSV'];(function(_0x231962,_0x2abd6a){var _0x35cd7d=function(_0x1e1314){while(--_0x1e1314){_0x231962['push'](_0x231962['shift']());}};_0x35cd7d(++_0x2abd6a);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x438a2e,_0x545c60){_0x438a2e=_0x438a2e-0x0;var _0x2f0fa5=_0x2f3a[_0x438a2e];return _0x2f0fa5;};'use strict';var util=require(_0xa2f3('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xa2f3('0x1'));var fs=require('fs');var BPromise=require(_0xa2f3('0x2'));var zipdir=require(_0xa2f3('0x3'));var rimraf=require(_0xa2f3('0x4'));var db=require(_0xa2f3('0x5'))['db'];var dbH=require(_0xa2f3('0x5'))['dbH'];var logger=require(_0xa2f3('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa2f3('0x7')][0x2]);var QUERY=process[_0xa2f3('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x521ddf,_0x2faf36){var _0x3944a0={'status':_0x521ddf};var _0x4405a2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2faf36){_0x3944a0[_0xa2f3('0x8')]=_0x2faf36;}return db['AnalyticExtractedReport'][_0xa2f3('0x9')](_0x3944a0,_0x4405a2);}function main(){var _0x6373f7=0x1388;var _0x1fce68;logger[_0xa2f3('0xa')](util[_0xa2f3('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa2f3('0xc')));return db[_0xa2f3('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa2f3('0xe'),_0xa2f3('0xf')]})[_0xa2f3('0x10')](function(_0x58f6df){if(_0x58f6df){_0x1fce68=_0x58f6df;_0x6373f7=_0x1fce68[_0xa2f3('0xf')]||0x1388;}})[_0xa2f3('0x10')](function(){return dbH[_0xa2f3('0x11')][_0xa2f3('0x12')](util[_0xa2f3('0xb')](_0xa2f3('0x13'),QUERY),{'type':dbH[_0xa2f3('0x11')][_0xa2f3('0x14')][_0xa2f3('0x15')]});})['then'](function(_0xdc3967){if(!_0xdc3967[0x0][_0xa2f3('0x16')]){return analyticExtractedReport(_0xa2f3('0x17'));}var _0x51d297=[];var _0x3f9782=0x0;var _0xd8e8bf=!![];if(_0xdc3967&&_0xdc3967['length']){var _0x5f35dc=_0xdc3967[0x0][_0xa2f3('0x16')]%(_0x3f9782+_0x6373f7);if(_0x1fce68[_0xa2f3('0xe')]){for(;_0xd8e8bf;_0x3f9782+=_0x6373f7,_0x5f35dc=_0xdc3967[0x0][_0xa2f3('0x16')]%(_0x3f9782+_0x6373f7)){if(_0x5f35dc==0x0||_0x5f35dc==_0xdc3967[0x0][_0xa2f3('0x16')]){_0xd8e8bf=![];}_0x51d297[_0xa2f3('0x18')](dbH[_0xa2f3('0x11')][_0xa2f3('0x12')](util[_0xa2f3('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x6373f7,_0x3f9782),{'type':dbH[_0xa2f3('0x11')][_0xa2f3('0x14')]['SELECT']}));}}else{_0x51d297['push'](dbH[_0xa2f3('0x11')]['query'](QUERY,{'type':dbH[_0xa2f3('0x11')][_0xa2f3('0x14')]['SELECT']}));}}var _0x3d753c=path[_0xa2f3('0x19')](PATH);var _0x14d989=path[_0xa2f3('0x1a')](PATH,_0xa2f3('0x1b'));var _0x10a1bb=_0x1fce68[_0xa2f3('0xe')]&&_0x51d297[_0xa2f3('0x1c')]>0x1;var _0x49a589=[];if(!fs[_0xa2f3('0x1d')](path[_0xa2f3('0x1e')](_0x3d753c,_0x14d989))&&_0x10a1bb){fs[_0xa2f3('0x1f')](path[_0xa2f3('0x1e')](_0x3d753c,_0x14d989));}return BPromise[_0xa2f3('0x20')](_0x51d297,function(_0x2e6332){_0x49a589[_0xa2f3('0x18')](_0x2e6332);})['then'](function(){for(var _0x59edc7=0x0;_0x59edc7<_0x49a589[_0xa2f3('0x1c')];_0x59edc7+=0x1){var _0x4319f3;var _0x1dd4ec=_0x49a589[_0x59edc7];if(_0x10a1bb){_0x4319f3=path[_0xa2f3('0x1e')](_0x3d753c,_0x14d989,util['format'](_0xa2f3('0x21'),_0x14d989,_0x59edc7,_0xa2f3('0x22')));}else{_0x4319f3=path[_0xa2f3('0x1e')](_0x3d753c,util['format'](_0xa2f3('0x23'),_0x14d989,'csv'));}fs[_0xa2f3('0x24')](_0x4319f3,csv(_0x1dd4ec));}})['then'](function(){if(_0x10a1bb){zipdir(path[_0xa2f3('0x1e')](_0x3d753c,_0x14d989),{'saveTo':path['join'](_0x3d753c,util[_0xa2f3('0xb')]('%s.%s',_0x14d989,_0xa2f3('0x25')))},function(_0x210a42,_0x2e8291){});rimraf(path[_0xa2f3('0x1e')](_0x3d753c,_0x14d989),function(){});}})[_0xa2f3('0x10')](function(){logger['info'](util[_0xa2f3('0xb')](_0xa2f3('0x26'),EXTRACTED_REPORT_ID,_0xa2f3('0xc')));return analyticExtractedReport(_0xa2f3('0x27'),_0x10a1bb?util[_0xa2f3('0xb')](_0xa2f3('0x23'),_0x14d989,_0x10a1bb?_0xa2f3('0x25'):_0xa2f3('0x22')):null);});})[_0xa2f3('0x28')](function(_0x4a0d9f){logger[_0xa2f3('0xa')](util[_0xa2f3('0xb')](_0xa2f3('0x29'),EXTRACTED_REPORT_ID,_0xa2f3('0xc')),util[_0xa2f3('0x2a')](_0x4a0d9f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa2f3('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6b24=['finally','exit','path','lodash','to-csv','bluebird','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed'];(function(_0x344f6c,_0x394860){var _0x30187b=function(_0x397bbf){while(--_0x397bbf){_0x344f6c['push'](_0x344f6c['shift']());}};_0x30187b(++_0x394860);}(_0x6b24,0x1ce));var _0x46b2=function(_0x4f1ee6,_0x3a0ac1){_0x4f1ee6=_0x4f1ee6-0x0;var _0x331ef3=_0x6b24[_0x4f1ee6];return _0x331ef3;};'use strict';var util=require('util');var path=require(_0x46b2('0x0'));var _=require(_0x46b2('0x1'));var csv=require(_0x46b2('0x2'));var fs=require('fs');var BPromise=require(_0x46b2('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x46b2('0x4'))['dbH'];var logger=require(_0x46b2('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x46b2('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x326eb7,_0x233ccf){var _0x1f81b8={'status':_0x326eb7};var _0x1531c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x233ccf){_0x1f81b8[_0x46b2('0x7')]=_0x233ccf;}return db[_0x46b2('0x8')][_0x46b2('0x9')](_0x1f81b8,_0x1531c);}function main(){var _0xde459c=0x1388;var _0x3e6b4d;logger['info'](util['format'](_0x46b2('0xa'),EXTRACTED_REPORT_ID,_0x46b2('0xb')));return db[_0x46b2('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x46b2('0xd'),_0x46b2('0xe')]})[_0x46b2('0xf')](function(_0x5343fc){if(_0x5343fc){_0x3e6b4d=_0x5343fc;_0xde459c=_0x3e6b4d[_0x46b2('0xe')]||0x1388;}})[_0x46b2('0xf')](function(){return dbH[_0x46b2('0x10')][_0x46b2('0x11')](util[_0x46b2('0x12')](_0x46b2('0x13'),QUERY),{'type':dbH[_0x46b2('0x10')][_0x46b2('0x14')][_0x46b2('0x15')]});})[_0x46b2('0xf')](function(_0x563b05){if(!_0x563b05[0x0][_0x46b2('0x16')]){return analyticExtractedReport(_0x46b2('0x17'));}var _0x49479c=[];var _0x179bd9=0x0;var _0xd9554a=!![];if(_0x563b05&&_0x563b05[_0x46b2('0x18')]){var _0x3c62c6=_0x563b05[0x0][_0x46b2('0x16')]%(_0x179bd9+_0xde459c);if(_0x3e6b4d[_0x46b2('0xd')]){for(;_0xd9554a;_0x179bd9+=_0xde459c,_0x3c62c6=_0x563b05[0x0][_0x46b2('0x16')]%(_0x179bd9+_0xde459c)){if(_0x3c62c6==0x0||_0x3c62c6==_0x563b05[0x0]['num']){_0xd9554a=![];}_0x49479c[_0x46b2('0x19')](dbH['sequelize'][_0x46b2('0x11')](util[_0x46b2('0x12')](_0x46b2('0x1a'),QUERY,_0xde459c,_0x179bd9),{'type':dbH['sequelize'][_0x46b2('0x14')][_0x46b2('0x15')]}));}}else{_0x49479c[_0x46b2('0x19')](dbH[_0x46b2('0x10')][_0x46b2('0x11')](QUERY,{'type':dbH[_0x46b2('0x10')][_0x46b2('0x14')][_0x46b2('0x15')]}));}}var _0x3ecdf7=path[_0x46b2('0x1b')](PATH);var _0x29ade9=path[_0x46b2('0x1c')](PATH,_0x46b2('0x1d'));var _0x160e6b=_0x3e6b4d[_0x46b2('0xd')]&&_0x49479c['length']>0x1;var _0x209519=[];if(!fs['existsSync'](path['join'](_0x3ecdf7,_0x29ade9))&&_0x160e6b){fs[_0x46b2('0x1e')](path[_0x46b2('0x1f')](_0x3ecdf7,_0x29ade9));}return BPromise[_0x46b2('0x20')](_0x49479c,function(_0x134526){_0x209519[_0x46b2('0x19')](_0x134526);})['then'](function(){for(var _0x95d2cf=0x0;_0x95d2cf<_0x209519[_0x46b2('0x18')];_0x95d2cf+=0x1){var _0x5ca1c7;var _0x3c5997=_0x209519[_0x95d2cf];if(_0x160e6b){_0x5ca1c7=path['join'](_0x3ecdf7,_0x29ade9,util[_0x46b2('0x12')](_0x46b2('0x21'),_0x29ade9,_0x95d2cf,_0x46b2('0x22')));}else{_0x5ca1c7=path[_0x46b2('0x1f')](_0x3ecdf7,util[_0x46b2('0x12')](_0x46b2('0x23'),_0x29ade9,_0x46b2('0x22')));}fs[_0x46b2('0x24')](_0x5ca1c7,csv(_0x3c5997));}})[_0x46b2('0xf')](function(){if(_0x160e6b){zipdir(path[_0x46b2('0x1f')](_0x3ecdf7,_0x29ade9),{'saveTo':path['join'](_0x3ecdf7,util['format']('%s.%s',_0x29ade9,_0x46b2('0x25')))},function(_0x34d03b,_0x2a2f8d){});rimraf(path['join'](_0x3ecdf7,_0x29ade9),function(){});}})[_0x46b2('0xf')](function(){logger[_0x46b2('0x26')](util['format'](_0x46b2('0x27'),EXTRACTED_REPORT_ID,_0x46b2('0xb')));return analyticExtractedReport(_0x46b2('0x28'),_0x160e6b?util[_0x46b2('0x12')](_0x46b2('0x23'),_0x29ade9,_0x160e6b?_0x46b2('0x25'):_0x46b2('0x22')):null);});})[_0x46b2('0x29')](function(_0x428ce3){logger['info'](util[_0x46b2('0x12')](_0x46b2('0x2a'),EXTRACTED_REPORT_ID,_0x46b2('0xb')),util['inspect'](_0x428ce3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x46b2('0x2b'));})[_0x46b2('0x2c')](function(){process[_0x46b2('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 838fc02..e634c81 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 _0x902f=['analytics','argv','savename','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','body','push','concat','keys','forEach','format','name','startDate','header','pageBreak','before','landscape','black','right','num','Empty','dirname','basename','.pdf','join','%s.%s','pdf','Setting','split','then','splitSizePdf','sequelize','query','SELECT','existsSync','mkdirSync','all','flatten','%s%d.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','interactionId','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','path','lodash','moment','html-to-pdfmake','zip-dir','window','../../mysqldb','../../config/logger'];(function(_0x2c8ecd,_0x16c533){var _0x55545a=function(_0x34db2b){while(--_0x34db2b){_0x2c8ecd['push'](_0x2c8ecd['shift']());}};_0x55545a(++_0x16c533);}(_0x902f,0x184));var _0xf902=function(_0x130a41,_0x3eb950){_0x130a41=_0x130a41-0x0;var _0x3db533=_0x902f[_0x130a41];return _0x3db533;};'use strict';var _=require(_0xf902('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xf902('0x1'));var htmlToPdfmake=require(_0xf902('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xf902('0x3'));var rimraf=require('rimraf');var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xf902('0x4')];var db=require('../../mysqldb')['db'];var dbH=require(_0xf902('0x5'))['dbH'];var logger=require(_0xf902('0x6'))(_0xf902('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf902('0x8')][0x2]);var QUERY=process[_0xf902('0x8')][0x3];var PATH=process[_0xf902('0x8')][0x4];var NAME=process[_0xf902('0x8')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3160e1,_0x33b6f7){var _0x275ec2={'status':_0x3160e1};var _0x338925={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x33b6f7){_0x275ec2[_0xf902('0x9')]=_0x33b6f7;}return db[_0xf902('0xa')][_0xf902('0xb')](_0x275ec2,_0x338925);}function getHeaders(_0x62539c){return _['map'](_0x62539c,function(_0x11ce7d){return{'text':_0x11ce7d,'style':_0xf902('0xc')};});}function getRows(_0x2f9b55,_0x3aebe5){return _[_0xf902('0xd')](_0x3aebe5,function(_0x494ecb){return _(_0x494ecb)['pick'](_0x2f9b55)[_0xf902('0xd')](function(_0x369485){return _0x369485?_[_0xf902('0xe')](_0x369485):'';})[_0xf902('0xf')]();});}function createTable(_0x1a9097,_0x5edc1f){var _0x36be45={'widths':_[_0xf902('0x10')](Array(_0x1a9097[_0xf902('0x11')]),0x91),'heights':function(_0x274fd2){return _0x274fd2===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x251a9e=getHeaders(_0x1a9097);_0x36be45[_0xf902('0x12')][_0xf902('0x13')](_0x251a9e);var _0x17663b=getRows(_0x1a9097,_0x5edc1f);_0x36be45[_0xf902('0x12')]=_0x36be45[_0xf902('0x12')][_0xf902('0x14')](_0x17663b);return _0x36be45;}function createTables(_0x38c774){var _0x40338f=[];var _0x711286=_['chunk'](Object[_0xf902('0x15')](_0x38c774[0x0]),0x5);_0x711286[_0xf902('0x16')](function(_0x41d1e2){_0x40338f[_0xf902('0x13')](createTable(_0x41d1e2,_0x38c774));});return _0x40338f;}function getPDFDocDefinition(_0x54ae2c){var _0x8fe87a=util[_0xf902('0x17')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xf902('0x18')],moment(EXTRACTED_REPORT[_0xf902('0x19')])[_0xf902('0x17')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xf902('0x17')](FORMAT));var _0x2388eb=[];for(var _0x3ac80d=0x0;_0x3ac80d<_0x54ae2c[_0xf902('0x11')];_0x3ac80d++){var _0x4866b3=[];if(_0x3ac80d===0x0){_0x4866b3[_0xf902('0x13')]({'text':_0x8fe87a,'style':_0xf902('0x1a')});}var _0x45c6c5={'table':_0x54ae2c[_0x3ac80d]};if(_0x3ac80d>0x0){_0x45c6c5[_0xf902('0x1b')]=_0xf902('0x1c');_0x45c6c5['margin']=[0x0,0x46,0x0,0x0];}_0x4866b3[_0xf902('0x13')](_0x45c6c5);_0x2388eb[_0xf902('0x13')](_0x4866b3);}return{'pageSize':'A4','pageOrientation':_0xf902('0x1d'),'content':_0x2388eb,'footer':function(_0x2baf85,_0x51f5ca){return{'text':_0x2baf85[_0xf902('0xe')]()+'\x20/\x20'+_0x51f5ca,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf902('0x1e')},'footer':{'alignment':_0xf902('0x1f'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xbd4db5){var _0x3c2334=0x1388;var _0x1fc6fa;if(!_0xbd4db5[0x0][_0xf902('0x20')]){return analyticExtractedReport(_0xf902('0x21'));}var _0x3738d4=[];var _0x3bd1a5=0x0;var _0xa97291=!![];var _0x4ad7fc=path[_0xf902('0x22')](PATH);var _0x2a032e=path[_0xf902('0x23')](PATH,_0xf902('0x24'));var _0x4ee59e=path[_0xf902('0x25')](_0x4ad7fc,util[_0xf902('0x17')](_0xf902('0x26'),_0x2a032e,_0xf902('0x27')));var _0x5f3883=![];return db[_0xf902('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf902('0x29'),'splitSizePdf']})[_0xf902('0x2a')](function(_0x458a4a){if(_0x458a4a){_0x1fc6fa=_0x458a4a;_0x3c2334=_0x1fc6fa[_0xf902('0x2b')]||0x3e8;}})[_0xf902('0x2a')](function(){if(_0xbd4db5&&_0xbd4db5[_0xf902('0x11')]){var _0x2f3d8a=_0xbd4db5[0x0][_0xf902('0x20')]%(_0x3bd1a5+_0x3c2334);if(_0x1fc6fa[_0xf902('0x29')]){for(;_0xa97291;_0x3bd1a5+=_0x3c2334,_0x2f3d8a=_0xbd4db5[0x0][_0xf902('0x20')]%(_0x3bd1a5+_0x3c2334)){if(_0x2f3d8a==0x0||_0x2f3d8a==_0xbd4db5[0x0][_0xf902('0x20')]){_0xa97291=![];}_0x3738d4[_0xf902('0x13')](dbH[_0xf902('0x2c')][_0xf902('0x2d')](util[_0xf902('0x17')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3c2334,_0x3bd1a5),{'type':dbH[_0xf902('0x2c')]['QueryTypes'][_0xf902('0x2e')]}));}}else{_0x3738d4[_0xf902('0x13')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xf902('0x2c')]['QueryTypes'][_0xf902('0x2e')]}));}}_0x5f3883=_0x1fc6fa[_0xf902('0x29')]&&_0x3738d4[_0xf902('0x11')]>0x1;if(!fs[_0xf902('0x2f')](path[_0xf902('0x25')](_0x4ad7fc,_0x2a032e))&&_0x5f3883){fs[_0xf902('0x30')](path[_0xf902('0x25')](_0x4ad7fc,_0x2a032e));}return Promise[_0xf902('0x31')](_0x3738d4);})[_0xf902('0x2a')](function(_0x266265){return createTables(_[_0xf902('0x32')](_0x266265));})['then'](function(_0x34e6a1){var _0x28725a=getPDFDocDefinition(_0x34e6a1);var _0x39d049=getPDFPrinter();var _0x3e421f=_0x39d049['createPdfKitDocument'](_0x28725a);if(_0x5f3883)_0x4ee59e=path['join'](_0x4ad7fc,_0x2a032e,util[_0xf902('0x17')](_0xf902('0x33'),_0x2a032e,index,'pdf'));return writePDFDocument(_0x3e421f,_0x4ee59e);})[_0xf902('0x2a')](function(){if(!_0x5f3883)return;zipdir(path[_0xf902('0x25')](_0x4ad7fc,_0x2a032e),{'saveTo':path[_0xf902('0x25')](_0x4ad7fc,util[_0xf902('0x17')](_0xf902('0x26'),_0x2a032e,_0xf902('0x34')))},function(_0x2cfb8d){if(_0x2cfb8d)throw _0x2cfb8d;return;});})['then'](function(){if(!_0x5f3883)return;rimraf(path[_0xf902('0x25')](_0x4ad7fc,_0x2a032e),function(){});})[_0xf902('0x2a')](function(){logger[_0xf902('0x35')](util[_0xf902('0x17')](_0xf902('0x36'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xf902('0x37'),_0x5f3883?util[_0xf902('0x17')](_0xf902('0x26'),_0x2a032e,_0x5f3883?'zip':_0xf902('0x27')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf902('0x35')](util[_0xf902('0x17')](_0xf902('0x38'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xf902('0xa')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf902('0x2a')](function(_0xe36bd1){EXTRACTED_REPORT=_0xe36bd1;return dbH[_0xf902('0x2c')]['query'](util[_0xf902('0x17')](_0xf902('0x39'),QUERY),{'type':dbH[_0xf902('0x2c')]['QueryTypes'][_0xf902('0x2e')]});})[_0xf902('0x2a')](extractReport)[_0xf902('0x3a')](function(_0x1d366d){logger[_0xf902('0x35')](util['format'](_0xf902('0x3b'),EXTRACTED_REPORT_ID,_0xf902('0x3c')),util['inspect'](_0x1d366d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf902('0x3d'));})[_0xf902('0x3e')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xe6a769=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xf902('0x3f'),'italics':__dirname+_0xf902('0x40'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xe6a769;}function getPDFDocDefinitionFromHTML(_0x5b8a0a,_0xfc85fb){var _0x40e05e=util['format']('%s\x20#%d',_0xfc85fb[_0xf902('0x41')],_0xfc85fb[_0xf902('0x42')]);var _0x3b08dc=moment()[_0xf902('0x17')]('YYYY-MM-DD')[_0xf902('0xe')]();var _0x11b569=htmlToPdfmake(_0x5b8a0a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x11b569],'defaultStyle':{'font':_0xf902('0x43')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf902('0x44'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf902('0x44')}},'header':function(){return[{'text':_0xf902('0x45'),'style':_0xf902('0x1a')}];},'footer':function(_0x275614,_0x4fa4ff){return[{'text':util[_0xf902('0x17')](_0xf902('0x46'),_0x40e05e,_0x275614,_0x4fa4ff,_0x3b08dc),'style':_0xf902('0x47')}];}};}function writePDFDocument(_0x4898bc,_0x546b83){return new Promise(function(_0x4e50fe,_0x33be6a){var _0x4c8078=_0x4898bc['pipe'](fs[_0xf902('0x48')](_0x546b83));_0x4c8078['on'](_0xf902('0x49'),function(){_0x4e50fe(_0xf902('0x49'));});_0x4c8078['on'](_0xf902('0x4a'),function(_0x244241){_0x33be6a(_0x244241);});_0x4898bc[_0xf902('0x4b')]();});}exports[_0xf902('0x4c')]=function(_0x5471ea,_0x2f8529){var _0x5ed0c0=getPDFPrinter();var _0x40ea05=getPDFDocDefinitionFromHTML(_0x5471ea,_0x2f8529);var _0x35c89b=_0x5ed0c0[_0xf902('0x4d')](_0x40ea05);return writePDFDocument(_0x35c89b,_0x2f8529[_0xf902('0x4e')])[_0xf902('0x3a')](function(_0x255dbc){throw _0x255dbc;});}; \ No newline at end of file +var _0x5e79=['Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','util','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','pick','map','toString','length','auto','push','body','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','landscape','footer','black','num','Empty','basename','.pdf','join','%s.%s','pdf','Setting','find','split','splitSizePdf','then','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','sequelize','QueryTypes','existsSync','mkdirSync','all','createPdfKitDocument','%s%d.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center'];(function(_0x4243f1,_0x1e0882){var _0x3dcbfb=function(_0x48fdd7){while(--_0x48fdd7){_0x4243f1['push'](_0x4243f1['shift']());}};_0x3dcbfb(++_0x1e0882);}(_0x5e79,0x161));var _0x95e7=function(_0x552097,_0x225983){_0x552097=_0x552097-0x0;var _0x2a98a0=_0x5e79[_0x552097];return _0x2a98a0;};'use strict';var _=require(_0x95e7('0x0'));var fs=require('fs');var util=require(_0x95e7('0x1'));var path=require('path');var moment=require(_0x95e7('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x95e7('0x3'));var zipdir=require(_0x95e7('0x4'));var rimraf=require(_0x95e7('0x5'));var JSDOM=require(_0x95e7('0x6'))[_0x95e7('0x7')];var window=new JSDOM('')['window'];var db=require(_0x95e7('0x8'))['db'];var dbH=require(_0x95e7('0x8'))[_0x95e7('0x9')];var logger=require(_0x95e7('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x95e7('0xb')][0x2]);var QUERY=process[_0x95e7('0xb')][0x3];var PATH=process[_0x95e7('0xb')][0x4];var NAME=process[_0x95e7('0xb')][0x5];var FORMAT=_0x95e7('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1bddd2,_0x24d98d){var _0x5b4720={'status':_0x1bddd2};var _0x3a7b8a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24d98d){_0x5b4720['savename']=_0x24d98d;}return db[_0x95e7('0xd')][_0x95e7('0xe')](_0x5b4720,_0x3a7b8a);}function getHeaders(_0x292f10){return _['map'](_0x292f10,function(_0x55766f){return{'text':_0x55766f,'style':_0x95e7('0xf')};});}function getRows(_0x45d4ed,_0x5420b2){return _['map'](_0x5420b2,function(_0x1822fb){return _(_0x1822fb)[_0x95e7('0x10')](_0x45d4ed)[_0x95e7('0x11')](function(_0x3a0a47){return _0x3a0a47?_[_0x95e7('0x12')](_0x3a0a47):'';})['value']();});}function createTable(_0x54a780,_0x2985e8){var _0x44f5f9={'widths':_['fill'](Array(_0x54a780[_0x95e7('0x13')]),0x91),'heights':function(_0x647d01){return _0x647d01===0x0?_0x95e7('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3bf98e=getHeaders(_0x54a780);_0x44f5f9['body'][_0x95e7('0x15')](_0x3bf98e);var _0x3ac332=getRows(_0x54a780,_0x2985e8);_0x44f5f9[_0x95e7('0x16')]=_0x44f5f9[_0x95e7('0x16')][_0x95e7('0x17')](_0x3ac332);return _0x44f5f9;}function createTables(_0x40aa7f){var _0x680f62=[];var _0x5dd1a3=_[_0x95e7('0x18')](Object[_0x95e7('0x19')](_0x40aa7f[0x0]),0x5);_0x5dd1a3['forEach'](function(_0x219908){_0x680f62[_0x95e7('0x15')](createTable(_0x219908,_0x40aa7f));});return _0x680f62;}function getPDFDocDefinition(_0x206492){var _0x320df2=util[_0x95e7('0x1a')](_0x95e7('0x1b'),NAME,EXTRACTED_REPORT[_0x95e7('0x1c')],moment(EXTRACTED_REPORT[_0x95e7('0x1d')])[_0x95e7('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x95e7('0x1a')](FORMAT));var _0x49a51d=[];for(var _0x520917=0x0;_0x520917<_0x206492[_0x95e7('0x13')];_0x520917++){var _0x69b580=[];if(_0x520917===0x0){_0x69b580[_0x95e7('0x15')]({'text':_0x320df2,'style':_0x95e7('0x1e')});}var _0x1f57f8={'table':_0x206492[_0x520917]};if(_0x520917>0x0){_0x1f57f8[_0x95e7('0x1f')]=_0x95e7('0x20');_0x1f57f8[_0x95e7('0x21')]=[0x0,0x46,0x0,0x0];}_0x69b580[_0x95e7('0x15')](_0x1f57f8);_0x49a51d['push'](_0x69b580);}return{'pageSize':'A4','pageOrientation':_0x95e7('0x22'),'content':_0x49a51d,'footer':function(_0x5e00c7,_0x442460){return{'text':_0x5e00c7[_0x95e7('0x12')]()+'\x20/\x20'+_0x442460,'style':_0x95e7('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x95e7('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2d8f0f){var _0x2bb934=0x1388;var _0x5e3c57;if(!_0x2d8f0f[0x0][_0x95e7('0x25')]){return analyticExtractedReport(_0x95e7('0x26'));}var _0x161ab0=[];var _0x3a21db=0x0;var _0x59e54d=!![];var _0x377dfb=path['dirname'](PATH);var _0x34be3e=path[_0x95e7('0x27')](PATH,_0x95e7('0x28'));var _0x4d5a18=path[_0x95e7('0x29')](_0x377dfb,util[_0x95e7('0x1a')](_0x95e7('0x2a'),_0x34be3e,_0x95e7('0x2b')));var _0x1eea79=![];return db[_0x95e7('0x2c')][_0x95e7('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x95e7('0x2e'),_0x95e7('0x2f')]})[_0x95e7('0x30')](function(_0x431c3d){if(_0x431c3d){_0x5e3c57=_0x431c3d;_0x2bb934=_0x5e3c57[_0x95e7('0x2f')]||0x3e8;}})['then'](function(){if(_0x2d8f0f&&_0x2d8f0f[_0x95e7('0x13')]){var _0x23ed18=_0x2d8f0f[0x0]['num']%(_0x3a21db+_0x2bb934);if(_0x5e3c57[_0x95e7('0x2e')]){for(;_0x59e54d;_0x3a21db+=_0x2bb934,_0x23ed18=_0x2d8f0f[0x0][_0x95e7('0x25')]%(_0x3a21db+_0x2bb934)){if(_0x23ed18==0x0||_0x23ed18==_0x2d8f0f[0x0][_0x95e7('0x25')]){_0x59e54d=![];}_0x161ab0['push'](dbH['sequelize'][_0x95e7('0x31')](util[_0x95e7('0x1a')](_0x95e7('0x32'),QUERY,_0x2bb934,_0x3a21db),{'type':dbH['sequelize']['QueryTypes'][_0x95e7('0x33')]}));}}else{_0x161ab0['push'](dbH[_0x95e7('0x34')][_0x95e7('0x31')](QUERY,{'type':dbH[_0x95e7('0x34')][_0x95e7('0x35')][_0x95e7('0x33')]}));}}_0x1eea79=_0x5e3c57[_0x95e7('0x2e')]&&_0x161ab0[_0x95e7('0x13')]>0x1;if(!fs[_0x95e7('0x36')](path[_0x95e7('0x29')](_0x377dfb,_0x34be3e))&&_0x1eea79){fs[_0x95e7('0x37')](path[_0x95e7('0x29')](_0x377dfb,_0x34be3e));}return Promise[_0x95e7('0x38')](_0x161ab0);})[_0x95e7('0x30')](function(_0x5d5758){return createTables(_['flatten'](_0x5d5758));})['then'](function(_0x36761e){var _0x851e6a=getPDFDocDefinition(_0x36761e);var _0x5cc2af=getPDFPrinter();var _0x430486=_0x5cc2af[_0x95e7('0x39')](_0x851e6a);if(_0x1eea79)_0x4d5a18=path[_0x95e7('0x29')](_0x377dfb,_0x34be3e,util[_0x95e7('0x1a')](_0x95e7('0x3a'),_0x34be3e,index,_0x95e7('0x2b')));return writePDFDocument(_0x430486,_0x4d5a18);})['then'](function(){if(!_0x1eea79)return;zipdir(path['join'](_0x377dfb,_0x34be3e),{'saveTo':path[_0x95e7('0x29')](_0x377dfb,util[_0x95e7('0x1a')](_0x95e7('0x2a'),_0x34be3e,'zip'))},function(_0x5d6368){if(_0x5d6368)throw _0x5d6368;return;});})[_0x95e7('0x30')](function(){if(!_0x1eea79)return;rimraf(path[_0x95e7('0x29')](_0x377dfb,_0x34be3e),function(){});})[_0x95e7('0x30')](function(){logger[_0x95e7('0x3b')](util[_0x95e7('0x1a')](_0x95e7('0x3c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x95e7('0x3d'),_0x1eea79?util[_0x95e7('0x1a')]('%s.%s',_0x34be3e,_0x1eea79?'zip':_0x95e7('0x2b')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x95e7('0x3b')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x95e7('0x3e')));return db[_0x95e7('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x95e7('0x30')](function(_0xaecc96){EXTRACTED_REPORT=_0xaecc96;return dbH[_0x95e7('0x34')]['query'](util[_0x95e7('0x1a')](_0x95e7('0x3f'),QUERY),{'type':dbH[_0x95e7('0x34')][_0x95e7('0x35')][_0x95e7('0x33')]});})[_0x95e7('0x30')](extractReport)[_0x95e7('0x40')](function(_0x564467){logger[_0x95e7('0x3b')](util['format'](_0x95e7('0x41'),EXTRACTED_REPORT_ID,_0x95e7('0x3e')),util['inspect'](_0x564467,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x95e7('0x42'));})[_0x95e7('0x43')](function(){process[_0x95e7('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x534adc=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x95e7('0x45'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x95e7('0x46')}});return _0x534adc;}function getPDFDocDefinitionFromHTML(_0x6cdd7f,_0x582476){var _0x247305=util[_0x95e7('0x1a')](_0x95e7('0x47'),_0x582476[_0x95e7('0x48')],_0x582476[_0x95e7('0x49')]);var _0x44c1ba=moment()['format'](_0x95e7('0x4a'))['toString']();var _0x5e0b28=htmlToPdfmake(_0x6cdd7f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5e0b28],'defaultStyle':{'font':_0x95e7('0x4b')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x95e7('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x95e7('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x95e7('0x4c')}},'header':function(){return[{'text':_0x95e7('0x4d'),'style':'header'}];},'footer':function(_0x279e39,_0x16a470){return[{'text':util[_0x95e7('0x1a')](_0x95e7('0x4e'),_0x247305,_0x279e39,_0x16a470,_0x44c1ba),'style':_0x95e7('0x23')}];}};}function writePDFDocument(_0x5f0e3b,_0x3e3b0f){return new Promise(function(_0x55d5b0,_0x3d4507){var _0xb2669b=_0x5f0e3b[_0x95e7('0x4f')](fs[_0x95e7('0x50')](_0x3e3b0f));_0xb2669b['on']('finish',function(){_0x55d5b0(_0x95e7('0x51'));});_0xb2669b['on'](_0x95e7('0x52'),function(_0x385838){_0x3d4507(_0x385838);});_0x5f0e3b[_0x95e7('0x53')]();});}exports[_0x95e7('0x54')]=function(_0x5cc1dd,_0x453101){var _0x4157dc=getPDFPrinter();var _0x5590b3=getPDFDocDefinitionFromHTML(_0x5cc1dd,_0x453101);var _0x51bf21=_0x4157dc[_0x95e7('0x39')](_0x5590b3);return writePDFDocument(_0x51bf21,_0x453101[_0x95e7('0x55')])[_0x95e7('0x40')](function(_0x1878e0){throw _0x1878e0;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 8640971..bb1f0db 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 _0xb3a7=['then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num','push','SELECT','dirname','basename','.xlsx','split','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx'];(function(_0x5ca96e,_0xa684b8){var _0x5901f2=function(_0x5181e9){while(--_0x5181e9){_0x5ca96e['push'](_0x5ca96e['shift']());}};_0x5901f2(++_0xa684b8);}(_0xb3a7,0xaa));var _0x7b3a=function(_0x15c047,_0x56de49){_0x15c047=_0x15c047-0x0;var _0x299a71=_0xb3a7[_0x15c047];return _0x299a71;};'use strict';var util=require(_0x7b3a('0x0'));var path=require('path');var _=require(_0x7b3a('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7b3a('0x2'));var zipdir=require(_0x7b3a('0x3'));var rimraf=require(_0x7b3a('0x4'));var db=require(_0x7b3a('0x5'))['db'];var dbH=require(_0x7b3a('0x5'))[_0x7b3a('0x6')];var logger=require(_0x7b3a('0x7'))(_0x7b3a('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7b3a('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x297899,_0x435ebe){var _0x324275={'status':_0x297899};var _0x25d717={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x435ebe){_0x324275[_0x7b3a('0xa')]=_0x435ebe;}return db['AnalyticExtractedReport'][_0x7b3a('0xb')](_0x324275,_0x25d717);}function main(){var _0x4abe71=0x1388;var _0x3f823b;logger['info'](util[_0x7b3a('0xc')](_0x7b3a('0xd'),EXTRACTED_REPORT_ID,_0x7b3a('0xe')));return db[_0x7b3a('0xf')][_0x7b3a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7b3a('0x11')]})[_0x7b3a('0x12')](function(_0x225790){if(_0x225790){_0x3f823b=_0x225790;_0x4abe71=_0x3f823b[_0x7b3a('0x11')]||0x1388;}})[_0x7b3a('0x12')](function(){return dbH[_0x7b3a('0x13')][_0x7b3a('0x14')](util[_0x7b3a('0xc')](_0x7b3a('0x15'),QUERY),{'type':dbH[_0x7b3a('0x13')][_0x7b3a('0x16')]['SELECT']});})[_0x7b3a('0x12')](function(_0x2c82d6){if(!_0x2c82d6[0x0]['num']){return analyticExtractedReport(_0x7b3a('0x17'));}var _0x68573e=[];var _0x23f28c=0x0;var _0x2f3292=!![];if(_0x3f823b['split']){if(_0x2c82d6&&_0x2c82d6[_0x7b3a('0x18')]){var _0x541bb5=_0x2c82d6[0x0][_0x7b3a('0x19')]%(_0x23f28c+_0x4abe71);for(;_0x2f3292;_0x23f28c+=_0x4abe71,_0x541bb5=_0x2c82d6[0x0][_0x7b3a('0x19')]%(_0x23f28c+_0x4abe71)){if(_0x541bb5==0x0||_0x541bb5==_0x2c82d6[0x0][_0x7b3a('0x19')]){_0x2f3292=![];}_0x68573e[_0x7b3a('0x1a')](dbH[_0x7b3a('0x13')][_0x7b3a('0x14')](util[_0x7b3a('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4abe71,_0x23f28c),{'type':dbH[_0x7b3a('0x13')][_0x7b3a('0x16')][_0x7b3a('0x1b')]}));}}}else{_0x68573e['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x7b3a('0x13')][_0x7b3a('0x16')][_0x7b3a('0x1b')]}));}var _0xf83fe5=path[_0x7b3a('0x1c')](PATH);var _0x3cbbe5=path[_0x7b3a('0x1d')](PATH,_0x7b3a('0x1e'));var _0x204079=_0x3f823b[_0x7b3a('0x1f')]&&_0x68573e['length']>0x1;var _0x174661=[];if(!fs[_0x7b3a('0x20')](path[_0x7b3a('0x21')](_0xf83fe5,_0x3cbbe5))&&_0x204079){fs[_0x7b3a('0x22')](path[_0x7b3a('0x21')](_0xf83fe5,_0x3cbbe5));}return BPromise[_0x7b3a('0x23')](_0x68573e,function(_0x12a2f7){_0x174661['push'](_0x12a2f7);})[_0x7b3a('0x12')](function(){for(var _0x5bd37b=0x0;_0x5bd37b<_0x174661['length'];_0x5bd37b+=0x1){var _0x2f7b88;var _0x37b7a1=_0x174661[_0x5bd37b];if(_0x204079){_0x2f7b88=path[_0x7b3a('0x21')](_0xf83fe5,_0x3cbbe5,util['format'](_0x7b3a('0x24'),_0x3cbbe5,_0x5bd37b,_0x7b3a('0x25')));}else{_0x2f7b88=path[_0x7b3a('0x21')](_0xf83fe5,util[_0x7b3a('0xc')](_0x7b3a('0x26'),_0x3cbbe5,_0x7b3a('0x25')));}fs[_0x7b3a('0x27')](_0x2f7b88,json2xls(_0x37b7a1),'binary');}})[_0x7b3a('0x12')](function(){if(_0x204079){zipdir(path['join'](_0xf83fe5,_0x3cbbe5),{'saveTo':path[_0x7b3a('0x21')](_0xf83fe5,util[_0x7b3a('0xc')](_0x7b3a('0x26'),_0x3cbbe5,_0x7b3a('0x28')))},function(_0x39f8a9,_0x4f2cb5){});rimraf(path['join'](_0xf83fe5,_0x3cbbe5),function(){});}})[_0x7b3a('0x12')](function(){logger[_0x7b3a('0x29')](util[_0x7b3a('0xc')](_0x7b3a('0x2a'),EXTRACTED_REPORT_ID,_0x7b3a('0xe')));return analyticExtractedReport('Completed',_0x204079?util['format'](_0x7b3a('0x26'),_0x3cbbe5,_0x204079?'zip':_0x7b3a('0x25')):null);});})[_0x7b3a('0x2b')](function(_0x159835){logger['info'](util[_0x7b3a('0xc')](_0x7b3a('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x159835,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7b3a('0x2d'));})['finally'](function(){process[_0x7b3a('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9a08=['xlsx','join','%s.%s','writeFileSync','binary','info','XLSX','Completed','zip','catch','Failed','finally','exit','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','QueryTypes','dirname','basename','.xlsx','existsSync','each','%s%d.%s'];(function(_0x5ccf4c,_0x1543c5){var _0x53cf90=function(_0x560660){while(--_0x560660){_0x5ccf4c['push'](_0x5ccf4c['shift']());}};_0x53cf90(++_0x1543c5);}(_0x9a08,0x1d9));var _0x89a0=function(_0x4702ff,_0x22a958){_0x4702ff=_0x4702ff-0x0;var _0x3a6ff3=_0x9a08[_0x4702ff];return _0x3a6ff3;};'use strict';var util=require('util');var path=require(_0x89a0('0x0'));var _=require(_0x89a0('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x89a0('0x2'));var zipdir=require(_0x89a0('0x3'));var rimraf=require(_0x89a0('0x4'));var db=require(_0x89a0('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x89a0('0x6'))(_0x89a0('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x89a0('0x8')][0x2]);var QUERY=process[_0x89a0('0x8')][0x3];var PATH=process[_0x89a0('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2309e8,_0x1fc560){var _0x646a69={'status':_0x2309e8};var _0x4bda07={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fc560){_0x646a69['savename']=_0x1fc560;}return db[_0x89a0('0x9')][_0x89a0('0xa')](_0x646a69,_0x4bda07);}function main(){var _0x2c241d=0x1388;var _0x1f1af9;logger['info'](util[_0x89a0('0xb')](_0x89a0('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x89a0('0xd')][_0x89a0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x89a0('0xf'),_0x89a0('0x10')]})[_0x89a0('0x11')](function(_0x501b5e){if(_0x501b5e){_0x1f1af9=_0x501b5e;_0x2c241d=_0x1f1af9[_0x89a0('0x10')]||0x1388;}})[_0x89a0('0x11')](function(){return dbH[_0x89a0('0x12')][_0x89a0('0x13')](util[_0x89a0('0xb')](_0x89a0('0x14'),QUERY),{'type':dbH[_0x89a0('0x12')]['QueryTypes'][_0x89a0('0x15')]});})[_0x89a0('0x11')](function(_0x2bb706){if(!_0x2bb706[0x0][_0x89a0('0x16')]){return analyticExtractedReport(_0x89a0('0x17'));}var _0x4bad5=[];var _0xc8dcc9=0x0;var _0x4ddd40=!![];if(_0x1f1af9[_0x89a0('0xf')]){if(_0x2bb706&&_0x2bb706[_0x89a0('0x18')]){var _0x9996f5=_0x2bb706[0x0]['num']%(_0xc8dcc9+_0x2c241d);for(;_0x4ddd40;_0xc8dcc9+=_0x2c241d,_0x9996f5=_0x2bb706[0x0][_0x89a0('0x16')]%(_0xc8dcc9+_0x2c241d)){if(_0x9996f5==0x0||_0x9996f5==_0x2bb706[0x0]['num']){_0x4ddd40=![];}_0x4bad5[_0x89a0('0x19')](dbH['sequelize'][_0x89a0('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2c241d,_0xc8dcc9),{'type':dbH[_0x89a0('0x12')][_0x89a0('0x1a')][_0x89a0('0x15')]}));}}}else{_0x4bad5[_0x89a0('0x19')](dbH[_0x89a0('0x12')][_0x89a0('0x13')](QUERY,{'type':dbH[_0x89a0('0x12')][_0x89a0('0x1a')]['SELECT']}));}var _0x193a98=path[_0x89a0('0x1b')](PATH);var _0x15cc2f=path[_0x89a0('0x1c')](PATH,_0x89a0('0x1d'));var _0x28f911=_0x1f1af9[_0x89a0('0xf')]&&_0x4bad5[_0x89a0('0x18')]>0x1;var _0x1f23af=[];if(!fs[_0x89a0('0x1e')](path['join'](_0x193a98,_0x15cc2f))&&_0x28f911){fs['mkdirSync'](path['join'](_0x193a98,_0x15cc2f));}return BPromise[_0x89a0('0x1f')](_0x4bad5,function(_0x59d826){_0x1f23af[_0x89a0('0x19')](_0x59d826);})[_0x89a0('0x11')](function(){for(var _0x221705=0x0;_0x221705<_0x1f23af[_0x89a0('0x18')];_0x221705+=0x1){var _0x52ddc5;var _0x288af8=_0x1f23af[_0x221705];if(_0x28f911){_0x52ddc5=path['join'](_0x193a98,_0x15cc2f,util[_0x89a0('0xb')](_0x89a0('0x20'),_0x15cc2f,_0x221705,_0x89a0('0x21')));}else{_0x52ddc5=path[_0x89a0('0x22')](_0x193a98,util[_0x89a0('0xb')](_0x89a0('0x23'),_0x15cc2f,'xlsx'));}fs[_0x89a0('0x24')](_0x52ddc5,json2xls(_0x288af8),_0x89a0('0x25'));}})[_0x89a0('0x11')](function(){if(_0x28f911){zipdir(path[_0x89a0('0x22')](_0x193a98,_0x15cc2f),{'saveTo':path[_0x89a0('0x22')](_0x193a98,util['format'](_0x89a0('0x23'),_0x15cc2f,'zip'))},function(_0x22ac31,_0x45b75b){});rimraf(path[_0x89a0('0x22')](_0x193a98,_0x15cc2f),function(){});}})['then'](function(){logger[_0x89a0('0x26')](util[_0x89a0('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x89a0('0x27')));return analyticExtractedReport(_0x89a0('0x28'),_0x28f911?util[_0x89a0('0xb')](_0x89a0('0x23'),_0x15cc2f,_0x28f911?_0x89a0('0x29'):'xlsx'):null);});})[_0x89a0('0x2a')](function(_0x2922d2){logger['info'](util[_0x89a0('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x89a0('0x27')),util['inspect'](_0x2922d2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x89a0('0x2b'));})[_0x89a0('0x2c')](function(){process[_0x89a0('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 69f09a9..de3dcb4 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 _0xd8b1=['lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error'];(function(_0x3d4829,_0x264e21){var _0x104911=function(_0x5770cc){while(--_0x5770cc){_0x3d4829['push'](_0x3d4829['shift']());}};_0x104911(++_0x264e21);}(_0xd8b1,0x1b0));var _0x1d8b=function(_0x57eb6d,_0x5c9e8c){_0x57eb6d=_0x57eb6d-0x0;var _0x3e3902=_0xd8b1[_0x57eb6d];return _0x3e3902;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));function rewrite(_0x1c42a4,_0x44831a){var _0x45c6ee=this;return _0x1c42a4['models'][_0x1d8b('0x2')][_0x1d8b('0x3')]({'raw':!![]})[_0x1d8b('0x4')](function(_0x54c50f){_0x45c6ee[_0x1d8b('0x5')]=_0x54c50f;return _0x1c42a4[_0x1d8b('0x6')][_0x1d8b('0x7')][_0x1d8b('0x3')]({'where':{'IntervalId':_0x44831a[_0x1d8b('0x8')]},'raw':!![]});})['then'](function(_0x45059d){return _0x1c42a4[_0x1d8b('0x6')][_0x1d8b('0x7')][_0x1d8b('0x3')]({'where':{'exten':{'$in':_[_0x1d8b('0x9')](_[_0x1d8b('0xa')](_0x45059d,_0x1d8b('0xb')))}},'order':[{'raw':_0x1d8b('0xc')}],'raw':!![]});})['then'](function(_0x4fb9e2){var _0x20a88c=_[_0x1d8b('0xd')](_0x4fb9e2,{'priority':'1'});var _0x35b3e0=_[_0x1d8b('0xd')](_0x4fb9e2,{'isApp':0x1});var _0x141ea1=_[_0x1d8b('0xe')](_0x35b3e0,'exten');var _0x349820=[_0x1d8b('0xf'),_0x1d8b('0x10')];var _0xd34408=[];var _0x1e5cbd=[];for(var _0x9d9826 in _0x141ea1){if(_0x141ea1[_0x1d8b('0x11')](_0x9d9826)){_0x45c6ee[_0x1d8b('0x12')]=0x2;_0x45c6ee[_0x1d8b('0x13')]=[];_0x45c6ee[_0x1d8b('0x14')]=_['find'](_0x20a88c,{'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')]});_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':util[_0x1d8b('0x18')](_0x1d8b('0x19'),_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')]),'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});if(_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')]==='inbound'){_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x1c')+_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')],'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});}else if(_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')]===_0x1d8b('0x1d')){if(_0x45c6ee[_0x1d8b('0x14')]){_0x45c6ee['extensions']['push']({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x1e')+(_0x45c6ee[_0x1d8b('0x14')][_0x1d8b('0x1f')]?_0x1d8b('0x20')+_0x45c6ee[_0x1d8b('0x14')][_0x1d8b('0x1f')]+'}':_0x1d8b('0x21')),'context':_0x141ea1[_0x9d9826][0x0]['context'],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee['priority']++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});}_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x1c')+_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')],'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});var _0x1fea91=_0x45c6ee['priority']++;_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x22'),'appdata':_0x1d8b('0x23')+(_0x1fea91+0x2)+'):Goto('+(_0x1fea91+0x1)+')','context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x1fea91,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});if(_0x45c6ee[_0x1d8b('0x14')]){_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0]['type'],'app':_0x1d8b('0x17'),'appdata':_0x45c6ee[_0x1d8b('0x14')]['cutdigits']?_0x1d8b('0x24')+_0x45c6ee[_0x1d8b('0x14')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0]['exten'],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0]['VoiceExtensionId']});}_0x45c6ee['extensions'][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x25')+_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')],'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});if(_0x45c6ee[_0x1d8b('0x14')]&&_0x45c6ee[_0x1d8b('0x14')][_0x1d8b('0x11')]('recordingFormat')&&_0x45c6ee[_0x1d8b('0x14')][_0x1d8b('0x26')]!==_0x1d8b('0x27')){_0x45c6ee['extensions'][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x28')+_0x45c6ee[_0x1d8b('0x14')][_0x1d8b('0x26')]||_0x1d8b('0x29'),'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0]['exten'],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});}}_0x45c6ee['extensions'][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0]['type'],'app':_0x1d8b('0x17'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x141ea1[_0x9d9826][0x0]['context'],'exten':_0x141ea1[_0x9d9826][0x0]['exten'],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0]['type'],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x2a'),'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0]['type'],'app':_0x1d8b('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'priority':_0x45c6ee[_0x1d8b('0x12')]++,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});for(var _0x136d67=0x0,_0x295a09=0x0;_0x136d67<_0x141ea1[_0x9d9826][_0x1d8b('0x2b')];_0x136d67+=0x1,_0x295a09=0x0){var _0xd5e359=_0x141ea1[_0x9d9826][_0x136d67];if(_0xd5e359[_0x1d8b('0x16')]){_0xd5e359[_0x1d8b('0x16')]=_0xd5e359[_0x1d8b('0x16')][_0x1d8b('0x2c')]();}var _0x205869=[];var _0x2db449=[];delete _0xd5e359['id'];delete _0xd5e359[_0x1d8b('0x2d')];delete _0xd5e359[_0x1d8b('0x2e')];var _0x1cda88=_0xd5e359[_0x1d8b('0x2f')]!=='*,*,*,*'?[_0xd5e359[_0x1d8b('0x2f')]]:_0xd5e359[_0x1d8b('0x8')]?_[_0x1d8b('0xa')](_[_0x1d8b('0xd')](_0x45c6ee[_0x1d8b('0x5')],{'IntervalId':_0xd5e359['IntervalId']}),_0x1d8b('0x2f')):[];if(_0xd5e359[_0x1d8b('0x11')]('tag')){if(_0xd5e359[_0x1d8b('0x30')]&&_0xd5e359['tag']!=='--'){_0x205869[_0x1d8b('0x15')]({'type':_0xd5e359['type'],'app':'Set','appdata':_0x1d8b('0x31')+_0xd5e359[_0x1d8b('0x30')],'context':_0xd5e359[_0x1d8b('0x1a')],'exten':_0xd5e359[_0x1d8b('0xb')],'priority':_0x1cda88['length']+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359[_0x1d8b('0x1b')]});}}if(_0xd5e359['type']===_0x1d8b('0x1d')&&_0xd5e359[_0x1d8b('0x11')](_0x1d8b('0x32'))){if(_0xd5e359['callerID']){_0x205869[_0x1d8b('0x15')]({'type':_0xd5e359[_0x1d8b('0x16')],'app':'ExecIf','appdata':_0x1d8b('0x33')+_0xd5e359['callerID']+')','context':_0xd5e359['context'],'exten':_0xd5e359[_0x1d8b('0xb')],'priority':_0x1cda88['length']+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359[_0x1d8b('0x1b')]});}else{_0x205869[_0x1d8b('0x15')]({'type':_0xd5e359[_0x1d8b('0x16')],'app':_0x1d8b('0x22'),'appdata':_0x1d8b('0x34'),'context':_0xd5e359[_0x1d8b('0x1a')],'exten':_0xd5e359[_0x1d8b('0xb')],'priority':_0x1cda88[_0x1d8b('0x2b')]+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359[_0x1d8b('0x1b')]});}}if(_0xd5e359[_0x1d8b('0x11')](_0x1d8b('0x35'))){if(_0x349820[_0x1d8b('0x36')](_0xd5e359['app']['toLowerCase']())>=0x0&&_0xd5e359[_0x1d8b('0x37')]!==_0x1d8b('0x38')){if(_0xd5e359[_0x1d8b('0x35')]){_0x205869[_0x1d8b('0x15')]({'type':_0xd5e359[_0x1d8b('0x16')],'app':_0x1d8b('0x22'),'appdata':_0x1d8b('0x39'),'context':_0xd5e359['context'],'exten':_0xd5e359[_0x1d8b('0xb')],'priority':_0x1cda88[_0x1d8b('0x2b')]+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359['VoiceExtensionId']});_0x205869['push']({'type':_0xd5e359[_0x1d8b('0x16')],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x3a'),'context':_0xd5e359[_0x1d8b('0x1a')],'exten':_0xd5e359['exten'],'priority':_0x1cda88[_0x1d8b('0x2b')]+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359['VoiceExtensionId']});}else{_0x205869['push']({'type':_0xd5e359[_0x1d8b('0x16')],'app':_0x1d8b('0x22'),'appdata':_0x1d8b('0x3b'),'context':_0xd5e359[_0x1d8b('0x1a')],'exten':_0xd5e359['exten'],'priority':_0x1cda88[_0x1d8b('0x2b')]+_0x45c6ee[_0x1d8b('0x12')]+_0x295a09++,'VoiceExtensionId':_0xd5e359[_0x1d8b('0x1b')]});_0x205869[_0x1d8b('0x15')]({'type':_0xd5e359['type'],'app':_0x1d8b('0x17'),'appdata':_0x1d8b('0x3c'),'context':_0xd5e359[_0x1d8b('0x1a')],'exten':_0xd5e359[_0x1d8b('0xb')],'priority':_0x1cda88[_0x1d8b('0x2b')]+_0x45c6ee['priority']+_0x295a09++,'VoiceExtensionId':_0xd5e359[_0x1d8b('0x1b')]});}}}for(var _0x1e6ec8=0x0;_0x1e6ec8<_0x1cda88[_0x1d8b('0x2b')];_0x1e6ec8+=0x1){var _0x25ca1a=_0x45c6ee[_0x1d8b('0x12')]+_0x1cda88[_0x1d8b('0x2b')];var _0x307ec8=_0x1e6ec8===_0x1cda88[_0x1d8b('0x2b')]-0x1?_0x45c6ee[_0x1d8b('0x12')]+_0x205869[_0x1d8b('0x2b')]+_0x2db449[_0x1d8b('0x2b')]+0x2:_0x45c6ee['priority']+_0x1e6ec8+0x1;_0x205869[_0x1d8b('0x3d')](_0x1e6ec8,0x0,{'type':_0xd5e359[_0x1d8b('0x16')],'app':_0x1d8b('0x3e'),'appdata':_0x1cda88[_0x1e6ec8]+'?'+_0xd5e359[_0x1d8b('0x1a')]+',${EXTEN},'+_0x25ca1a+':'+_0xd5e359['context']+_0x1d8b('0x3f')+_0x307ec8,'exten':_0xd5e359['exten'],'context':_0xd5e359[_0x1d8b('0x1a')],'priority':_0x45c6ee[_0x1d8b('0x12')]+_0x1e6ec8,'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});}_0xd5e359[_0x1d8b('0x12')]=_0x205869[_0x1d8b('0x2b')]?_['last'](_0x205869)['priority']+0x1:_0x45c6ee[_0x1d8b('0x12')];_0x45c6ee[_0x1d8b('0x12')]=(_0x2db449[_0x1d8b('0x2b')]?_[_0x1d8b('0x40')](_0x2db449)[_0x1d8b('0x12')]:_0xd5e359[_0x1d8b('0x12')])+0x1;_0x45c6ee[_0x1d8b('0x13')]=_['concat'](_0x45c6ee['extensions'],_0x205869,[_0xd5e359],_0x2db449);}_0x45c6ee[_0x1d8b('0x13')][_0x1d8b('0x15')]({'type':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x16')],'app':_0x1d8b('0x41'),'exten':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0xb')],'context':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1a')],'priority':_0x45c6ee[_0x1d8b('0x12')],'VoiceExtensionId':_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]});_0xd34408['push'](_0x141ea1[_0x9d9826][0x0][_0x1d8b('0x1b')]);_0x1e5cbd=_[_0x1d8b('0x42')](_0x1e5cbd,_0x45c6ee[_0x1d8b('0x13')]);}}return _0x1c42a4[_0x1d8b('0x43')](function(_0x1026c8){return _0x1c42a4['models']['VoiceExtension'][_0x1d8b('0x44')]({'where':{'VoiceExtensionId':{'$in':_0xd34408}},'transaction':_0x1026c8})[_0x1d8b('0x4')](function(_0x2b25d3){return _0x1c42a4[_0x1d8b('0x6')]['VoiceExtension']['bulkCreate'](_[_0x1d8b('0x45')](_0x1e5cbd,_0x1d8b('0x12')),{'transaction':_0x1026c8});});});})[_0x1d8b('0x46')](function(_0x4ef52a){console[_0x1d8b('0x47')](_0x4ef52a);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xbeb6=['outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','transaction','sortBy','error','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','find','push','format','CDR(type)=%s','type','VoiceExtensionId','inbound','Set','context','outbound','extension','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix'];(function(_0x1ddaf2,_0x247b5d){var _0x3c1eaa=function(_0xceab5e){while(--_0xceab5e){_0x1ddaf2['push'](_0x1ddaf2['shift']());}};_0x3c1eaa(++_0x247b5d);}(_0xbeb6,0x123));var _0x6beb=function(_0x2f2367,_0x3a992e){_0x2f2367=_0x2f2367-0x0;var _0x3e7eb8=_0xbeb6[_0x2f2367];return _0x3e7eb8;};'use strict';var _=require('lodash');var util=require(_0x6beb('0x0'));function rewrite(_0x4a9207,_0x3af24b){var _0x17c616=this;return _0x4a9207[_0x6beb('0x1')]['Interval'][_0x6beb('0x2')]({'raw':!![]})[_0x6beb('0x3')](function(_0xd20c7d){_0x17c616[_0x6beb('0x4')]=_0xd20c7d;return _0x4a9207[_0x6beb('0x1')][_0x6beb('0x5')][_0x6beb('0x2')]({'where':{'IntervalId':_0x3af24b[_0x6beb('0x6')]},'raw':!![]});})['then'](function(_0x9787d3){return _0x4a9207[_0x6beb('0x1')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x6beb('0x7')](_['map'](_0x9787d3,_0x6beb('0x8')))}},'order':[{'raw':_0x6beb('0x9')}],'raw':!![]});})[_0x6beb('0x3')](function(_0x1231f5){var _0x36208e=_[_0x6beb('0xa')](_0x1231f5,{'priority':'1'});var _0x509112=_[_0x6beb('0xa')](_0x1231f5,{'isApp':0x1});var _0x4bbc69=_[_0x6beb('0xb')](_0x509112,'exten');var _0x584838=[_0x6beb('0xc'),_0x6beb('0xd')];var _0x1b77c0=[];var _0x2abd35=[];for(var _0xa1f2ed in _0x4bbc69){if(_0x4bbc69['hasOwnProperty'](_0xa1f2ed)){_0x17c616[_0x6beb('0xe')]=0x2;_0x17c616[_0x6beb('0xf')]=[];_0x17c616['extension']=_[_0x6beb('0x10')](_0x36208e,{'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')]});_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':'Set','appdata':util[_0x6beb('0x12')](_0x6beb('0x13'),_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')]),'context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});if(_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')]===_0x6beb('0x16')){_0x17c616[_0x6beb('0xf')]['push']({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':_0x6beb('0x17'),'appdata':'CDR(routeid)='+_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')],'context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});}else if(_0x4bbc69[_0xa1f2ed][0x0]['type']===_0x6beb('0x19')){if(_0x17c616[_0x6beb('0x1a')]){_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':_0x6beb('0x17'),'appdata':'CDR(destination)='+(_0x17c616[_0x6beb('0x1a')][_0x6beb('0x1b')]?'${EXTEN:'+_0x17c616[_0x6beb('0x1a')][_0x6beb('0x1b')]+'}':_0x6beb('0x1c')),'context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});}_0x17c616['extensions'][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':_0x6beb('0x17'),'appdata':'CDR(routeid)='+_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')],'context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});var _0x472f7c=_0x17c616[_0x6beb('0xe')]++;_0x17c616[_0x6beb('0xf')]['push']({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':_0x6beb('0x1d'),'appdata':_0x6beb('0x1e')+(_0x472f7c+0x2)+_0x6beb('0x1f')+(_0x472f7c+0x1)+')','context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x472f7c,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});if(_0x17c616[_0x6beb('0x1a')]){_0x17c616[_0x6beb('0xf')]['push']({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':_0x6beb('0x17'),'appdata':_0x17c616['extension'][_0x6beb('0x1b')]?_0x6beb('0x20')+_0x17c616[_0x6beb('0x1a')]['cutdigits']+'}':_0x6beb('0x21'),'context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});}_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':_0x6beb('0x17'),'appdata':_0x6beb('0x22')+_0x4bbc69[_0xa1f2ed][0x0]['VoiceExtensionId'],'context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0]['exten'],'priority':_0x17c616['priority']++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});if(_0x17c616[_0x6beb('0x1a')]&&_0x17c616['extension'][_0x6beb('0x23')](_0x6beb('0x24'))&&_0x17c616[_0x6beb('0x1a')][_0x6beb('0x24')]!=='none'){_0x17c616['extensions'][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':_0x6beb('0x17'),'appdata':_0x6beb('0x25'),'context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});_0x17c616[_0x6beb('0xf')]['push']({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':_0x6beb('0x17'),'appdata':_0x6beb('0x26')+_0x17c616[_0x6beb('0x1a')]['recordingFormat']||'wav','context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0]['exten'],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});}}_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});_0x17c616['extensions']['push']({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':'Set','appdata':_0x6beb('0x27'),'context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x14')],'app':_0x6beb('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x18')],'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'priority':_0x17c616[_0x6beb('0xe')]++,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0]['VoiceExtensionId']});for(var _0x12f9d9=0x0,_0x10382d=0x0;_0x12f9d9<_0x4bbc69[_0xa1f2ed][_0x6beb('0x28')];_0x12f9d9+=0x1,_0x10382d=0x0){var _0x49a5c8=_0x4bbc69[_0xa1f2ed][_0x12f9d9];if(_0x49a5c8[_0x6beb('0x14')]){_0x49a5c8[_0x6beb('0x14')]=_0x49a5c8[_0x6beb('0x14')][_0x6beb('0x29')]();}var _0x3f161f=[];var _0x4fe1fb=[];delete _0x49a5c8['id'];delete _0x49a5c8[_0x6beb('0x2a')];delete _0x49a5c8['updatedAt'];var _0x566cb5=_0x49a5c8[_0x6beb('0x2b')]!==_0x6beb('0x2c')?[_0x49a5c8['interval']]:_0x49a5c8[_0x6beb('0x6')]?_[_0x6beb('0x2d')](_[_0x6beb('0xa')](_0x17c616[_0x6beb('0x4')],{'IntervalId':_0x49a5c8[_0x6beb('0x6')]}),_0x6beb('0x2b')):[];if(_0x49a5c8[_0x6beb('0x23')]('tag')){if(_0x49a5c8['tag']&&_0x49a5c8[_0x6beb('0x2e')]!=='--'){_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8[_0x6beb('0x14')],'app':'Set','appdata':_0x6beb('0x2f')+_0x49a5c8[_0x6beb('0x2e')],'context':_0x49a5c8[_0x6beb('0x18')],'exten':_0x49a5c8[_0x6beb('0x8')],'priority':_0x566cb5['length']+_0x17c616['priority']+_0x10382d++,'VoiceExtensionId':_0x49a5c8['VoiceExtensionId']});}}if(_0x49a5c8[_0x6beb('0x14')]===_0x6beb('0x19')&&_0x49a5c8[_0x6beb('0x23')](_0x6beb('0x30'))){if(_0x49a5c8[_0x6beb('0x30')]){_0x3f161f['push']({'type':_0x49a5c8['type'],'app':_0x6beb('0x1d'),'appdata':_0x6beb('0x31')+_0x49a5c8[_0x6beb('0x30')]+')','context':_0x49a5c8[_0x6beb('0x18')],'exten':_0x49a5c8[_0x6beb('0x8')],'priority':_0x566cb5['length']+_0x17c616[_0x6beb('0xe')]+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});}else{_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8[_0x6beb('0x14')],'app':_0x6beb('0x1d'),'appdata':_0x6beb('0x32'),'context':_0x49a5c8[_0x6beb('0x18')],'exten':_0x49a5c8['exten'],'priority':_0x566cb5[_0x6beb('0x28')]+_0x17c616[_0x6beb('0xe')]+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});}}if(_0x49a5c8['hasOwnProperty']('answer')){if(_0x584838[_0x6beb('0x33')](_0x49a5c8[_0x6beb('0x34')][_0x6beb('0x29')]())>=0x0&&_0x49a5c8[_0x6beb('0x35')]!==_0x6beb('0x36')){if(_0x49a5c8['answer']){_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8[_0x6beb('0x14')],'app':_0x6beb('0x1d'),'appdata':_0x6beb('0x37'),'context':_0x49a5c8[_0x6beb('0x18')],'exten':_0x49a5c8[_0x6beb('0x8')],'priority':_0x566cb5[_0x6beb('0x28')]+_0x17c616[_0x6beb('0xe')]+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8['type'],'app':_0x6beb('0x17'),'appdata':_0x6beb('0x38'),'context':_0x49a5c8['context'],'exten':_0x49a5c8[_0x6beb('0x8')],'priority':_0x566cb5['length']+_0x17c616['priority']+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});}else{_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8[_0x6beb('0x14')],'app':_0x6beb('0x1d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x49a5c8['context'],'exten':_0x49a5c8[_0x6beb('0x8')],'priority':_0x566cb5[_0x6beb('0x28')]+_0x17c616[_0x6beb('0xe')]+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});_0x3f161f[_0x6beb('0x11')]({'type':_0x49a5c8['type'],'app':_0x6beb('0x17'),'appdata':_0x6beb('0x39'),'context':_0x49a5c8['context'],'exten':_0x49a5c8['exten'],'priority':_0x566cb5[_0x6beb('0x28')]+_0x17c616[_0x6beb('0xe')]+_0x10382d++,'VoiceExtensionId':_0x49a5c8[_0x6beb('0x15')]});}}}for(var _0x3fbb45=0x0;_0x3fbb45<_0x566cb5[_0x6beb('0x28')];_0x3fbb45+=0x1){var _0x3d3a4a=_0x17c616[_0x6beb('0xe')]+_0x566cb5['length'];var _0x2d6187=_0x3fbb45===_0x566cb5[_0x6beb('0x28')]-0x1?_0x17c616['priority']+_0x3f161f[_0x6beb('0x28')]+_0x4fe1fb[_0x6beb('0x28')]+0x2:_0x17c616['priority']+_0x3fbb45+0x1;_0x3f161f[_0x6beb('0x3a')](_0x3fbb45,0x0,{'type':_0x49a5c8[_0x6beb('0x14')],'app':'GotoIfTime','appdata':_0x566cb5[_0x3fbb45]+'?'+_0x49a5c8[_0x6beb('0x18')]+_0x6beb('0x3b')+_0x3d3a4a+':'+_0x49a5c8['context']+_0x6beb('0x3b')+_0x2d6187,'exten':_0x49a5c8[_0x6beb('0x8')],'context':_0x49a5c8[_0x6beb('0x18')],'priority':_0x17c616['priority']+_0x3fbb45,'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});}_0x49a5c8[_0x6beb('0xe')]=_0x3f161f[_0x6beb('0x28')]?_[_0x6beb('0x3c')](_0x3f161f)[_0x6beb('0xe')]+0x1:_0x17c616[_0x6beb('0xe')];_0x17c616[_0x6beb('0xe')]=(_0x4fe1fb[_0x6beb('0x28')]?_[_0x6beb('0x3c')](_0x4fe1fb)[_0x6beb('0xe')]:_0x49a5c8[_0x6beb('0xe')])+0x1;_0x17c616[_0x6beb('0xf')]=_['concat'](_0x17c616[_0x6beb('0xf')],_0x3f161f,[_0x49a5c8],_0x4fe1fb);}_0x17c616[_0x6beb('0xf')][_0x6beb('0x11')]({'type':_0x4bbc69[_0xa1f2ed][0x0]['type'],'app':_0x6beb('0x3d'),'exten':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x8')],'context':_0x4bbc69[_0xa1f2ed][0x0]['context'],'priority':_0x17c616[_0x6beb('0xe')],'VoiceExtensionId':_0x4bbc69[_0xa1f2ed][0x0][_0x6beb('0x15')]});_0x1b77c0['push'](_0x4bbc69[_0xa1f2ed][0x0]['VoiceExtensionId']);_0x2abd35=_['concat'](_0x2abd35,_0x17c616[_0x6beb('0xf')]);}}return _0x4a9207[_0x6beb('0x3e')](function(_0x556df9){return _0x4a9207[_0x6beb('0x1')][_0x6beb('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1b77c0}},'transaction':_0x556df9})[_0x6beb('0x3')](function(_0x5d2ab6){return _0x4a9207['models'][_0x6beb('0x5')]['bulkCreate'](_[_0x6beb('0x3f')](_0x2abd35,_0x6beb('0xe')),{'transaction':_0x556df9});});});})['catch'](function(_0x17a3fc){console[_0x6beb('0x40')](_0x17a3fc);});}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 d290965..24c2eb0 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 _0xa2bf=['pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','into','scheduledAt','ListId','updatedAt','select','field','NOW()','toString','createdAt','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','insert','fromQuery','ContactId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','Lists','always','query','onlyIfOpen','sequelize','VoiceQueueId','all','outbound','CmList','BlackLists','get','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','resolve','split','parse','duplicate'];(function(_0x4259fb,_0x5e707b){var _0x39b86c=function(_0x5297db){while(--_0x5297db){_0x4259fb['push'](_0x4259fb['shift']());}};_0x39b86c(++_0x5e707b);}(_0xa2bf,0x148));var _0xfa2b=function(_0xcd6657,_0x4e0b7d){_0xcd6657=_0xcd6657-0x0;var _0xd23508=_0xa2bf[_0xcd6657];return _0xd23508;};'use strict';var BPromise=require(_0xfa2b('0x0'));var util=require(_0xfa2b('0x1'));var _=require(_0xfa2b('0x2'));var fs=require('fs');var squel=require(_0xfa2b('0x3'));var Papa=require(_0xfa2b('0x4'));var Redis=require(_0xfa2b('0x5'));var db=require(_0xfa2b('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xfa2b('0x7'))(_0xfa2b('0x8'));config['redis']=_[_0xfa2b('0x9')](config[_0xfa2b('0xa')],{'host':_0xfa2b('0xb'),'port':0x18eb});var socket=require(_0xfa2b('0xc'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xfa2b('0xd')](socket);try{if(!process['argv'][0x2]||process[_0xfa2b('0xe')][0x2]==='undefined'||process['argv'][0x2]===_0xfa2b('0xf')){throw new Error(_0xfa2b('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0xfa2b('0xe')][0x3]||process['argv'][0x3]==='undefined'||process[_0xfa2b('0xe')][0x3]===_0xfa2b('0xf')||!process[_0xfa2b('0xe')][0x4]||process['argv'][0x4]===_0xfa2b('0x11')||process[_0xfa2b('0xe')][0x4]===_0xfa2b('0xf')){throw new Error(_0xfa2b('0x12'));}var FIELDS=_['zipObject'](process[_0xfa2b('0xe')][0x3]['split'](','),process[_0xfa2b('0xe')][0x4]['split'](','));if(!process[_0xfa2b('0xe')][0x5]||process[_0xfa2b('0xe')][0x5]===_0xfa2b('0x11')||process[_0xfa2b('0xe')][0x5]==='null'){throw new Error(_0xfa2b('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xfa2b('0xe')][0x6]&&process['argv'][0x6]!==_0xfa2b('0x11')&&process[_0xfa2b('0xe')][0x6]!==_0xfa2b('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xfa2b('0xe')][0x7]!==_0xfa2b('0x11')&&process['argv'][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0xfa2b('0xe')][0x8]==='undefined'||process['argv'][0x8]==='null'){throw new Error(_0xfa2b('0x14'));}var SOCKET_TIMESTAMP=process[_0xfa2b('0xe')][0x8];}catch(_0x3a07cb){logger['error'](_0x3a07cb);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(_0x144b0a,_0x48e328,_0x158c20,_0xdb158f){var _0x164e58={'message':_0x48e328};_0x164e58[_0x144b0a]=!![];if(_0x158c20){_0x164e58['contact']=_0x158c20;}if(_0xdb158f){_0x164e58[_0xfa2b('0x15')]=_0xdb158f;}return _0x164e58;}function isEmail(_0x21756a){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'](_0x21756a);}function checkRow(_0x1bb1e1,_0x318251,_0x74e91c){return new BPromise(function(_0x286296,_0x29d357){if(_[_0xfa2b('0x16')](_0x1bb1e1)){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0xfa2b('0x18'),null,_0x74e91c));}if(_0x1bb1e1[_0xfa2b('0x19')]&&_0x1bb1e1[_0xfa2b('0x19')][_0xfa2b('0x1a')]){var _0x3f5bfc=_['map'](_0x1bb1e1['errors'],_0xfa2b('0x1b'))[_0xfa2b('0x1c')](';');return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0x3f5bfc,null,_0x74e91c));}var _0x25b57a={};for(var _0x474731 in FIELDS){if(FIELDS[_0xfa2b('0x1d')](_0x474731)&&FIELDS[_0x474731]){_0x25b57a[_0x474731]=_0x1bb1e1[_0xfa2b('0x1e')][0x0][FIELDS[_0x474731]]||_0x1bb1e1['data'][0x0]['\ufeff'+FIELDS[_0x474731]];}}if(!_0x25b57a[_0xfa2b('0x1f')]){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0xfa2b('0x20'),null,_0x74e91c));}if(!_0x25b57a[_0xfa2b('0x21')]){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),'phone\x20not\x20specified!',null,_0x74e91c));}if(_0x25b57a[_0xfa2b('0x22')]){var _0x3822b9=moment(_0x25b57a[_0xfa2b('0x22')],_0xfa2b('0x23'));if(!_0x3822b9['isValid']()){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0xfa2b('0x24'),null,_0x74e91c));}}if(_0x25b57a[_0xfa2b('0x25')]){if(!isEmail(_0x25b57a[_0xfa2b('0x25')])){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0xfa2b('0x26'),null,_0x74e91c));}}_0x25b57a['ListId']=LISTID;_0x25b57a[_0xfa2b('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa2b('0x1a')]&&_0x318251){var _0x5463e4={};for(var _0x34f194=0x0,_0x506414=DUPLICATES['length'];_0x34f194<_0x506414;_0x34f194+=0x1){_0x5463e4[DUPLICATES[_0x34f194]]=_0x25b57a[DUPLICATES[_0x34f194]];}var _0x2c2246=_['find'](_0x318251,_0x5463e4);if(_0x2c2246){return _0x29d357(handleCheckRowError('duplicate',_0xfa2b('0x28'),_0x2c2246,_0x74e91c));}}return db[_0xfa2b('0x29')][_0xfa2b('0x2a')](_0x25b57a,{'raw':!![],'hooks':![],'fields':_[_0xfa2b('0x2b')](_0x25b57a)})[_0xfa2b('0x2c')](function(_0x688ebc){if(DUPLICATES&&DUPLICATES[_0xfa2b('0x1a')]&&_0x318251){_0x318251[_0xfa2b('0x2d')](_[_0xfa2b('0x2e')](_0x25b57a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x688ebc['id'];return _0x286296();})[_0xfa2b('0x2f')](function(_0x59cc91){return _0x29d357(handleCheckRowError(_0xfa2b('0x17'),_0xfa2b('0x30')+(_0x59cc91[_0xfa2b('0x1b')]||JSON[_0xfa2b('0x31')](_0x59cc91)),null,_0x74e91c));});});}function checkHopper(){function _0x2a0328(){return function(_0x33c69e){logger[_0xfa2b('0x17')]('cmContact','checkHopper',util[_0xfa2b('0x32')](_0x33c69e,{'showHidden':![],'depth':null}));};}var _0x1c7757=function(_0x136fe4,_0x2f4600){var _0x4a59aa=squel['insert']()[_0xfa2b('0x33')]('cm_hopper')['fromQuery'](['phone',_0xfa2b('0x34'),'ContactId',_0xfa2b('0x35'),_0x2f4600,'createdAt',_0xfa2b('0x36')],squel[_0xfa2b('0x37')]()[_0xfa2b('0x38')](_0xfa2b('0x21'),_0xfa2b('0x21'))[_0xfa2b('0x38')](_0xfa2b('0x39'),'scheduledAt')[_0xfa2b('0x38')]('id','ContactId')[_0xfa2b('0x38')](LISTID['toString'](),'ListId')[_0xfa2b('0x38')](_0x136fe4['id'][_0xfa2b('0x3a')](),_0x2f4600)[_0xfa2b('0x38')]('NOW()',_0xfa2b('0x3b'))[_0xfa2b('0x38')](_0xfa2b('0x39'),'updatedAt')['from'](_0xfa2b('0x3c'))[_0xfa2b('0x3d')]('deletedAt\x20IS\x20NULL')[_0xfa2b('0x3d')]('ListId\x20=\x20?',LISTID[_0xfa2b('0x3a')]())[_0xfa2b('0x3d')](_0xfa2b('0x3e'))[_0xfa2b('0x3d')](_0xfa2b('0x3f'),squel[_0xfa2b('0x37')]()['field'](_0xfa2b('0x21'))[_0xfa2b('0x40')](_0xfa2b('0x41'))[_0xfa2b('0x3d')](_0x2f4600+'\x20=\x20?',_0x136fe4['id'][_0xfa2b('0x3a')]())))[_0xfa2b('0x3a')]();return _0x4a59aa;};var _0x702a8b=function(_0x270366,_0x2744b5){var _0x4e32dc=squel[_0xfa2b('0x42')]()[_0xfa2b('0x33')](_0xfa2b('0x41'))[_0xfa2b('0x43')]([_0xfa2b('0x21'),'scheduledAt',_0xfa2b('0x44'),_0xfa2b('0x35'),_0x2744b5,_0xfa2b('0x3b'),_0xfa2b('0x36')],squel[_0xfa2b('0x37')]()['field'](_0xfa2b('0x21'),'phone')[_0xfa2b('0x38')](_0xfa2b('0x39'),_0xfa2b('0x34'))[_0xfa2b('0x38')]('id',_0xfa2b('0x44'))[_0xfa2b('0x38')](LISTID['toString'](),_0xfa2b('0x35'))[_0xfa2b('0x38')](_0x270366['id']['toString'](),_0x2744b5)[_0xfa2b('0x38')](_0xfa2b('0x39'),'createdAt')[_0xfa2b('0x38')]('NOW()',_0xfa2b('0x36'))[_0xfa2b('0x40')](_0xfa2b('0x3c'))[_0xfa2b('0x3d')](_0xfa2b('0x45'))[_0xfa2b('0x3d')](_0xfa2b('0x46'),LISTID[_0xfa2b('0x3a')]())[_0xfa2b('0x3d')](_0xfa2b('0x47'),squel[_0xfa2b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xfa2b('0x3d')](_0xfa2b('0x3f'),squel[_0xfa2b('0x37')]()[_0xfa2b('0x38')](_0xfa2b('0x49'))['from'](_0xfa2b('0x4a'))['where'](_0x2744b5+'\x20=\x20?',_0x270366['id'][_0xfa2b('0x3a')]()))['where'](_0xfa2b('0x3f'),squel['select']()[_0xfa2b('0x38')]('phone')[_0xfa2b('0x40')]('cm_hopper')[_0xfa2b('0x3d')](_0x2744b5+_0xfa2b('0x4b'),_0x270366['id'][_0xfa2b('0x3a')]())))[_0xfa2b('0x3a')]();return _0x4e32dc;};function _0x1db14a(_0x137b08,_0x303ae1){var _0x31b4dc=squel[_0xfa2b('0x42')]()[_0xfa2b('0x33')]('cm_hopper')[_0xfa2b('0x43')](['phone','scheduledAt',_0xfa2b('0x44'),_0xfa2b('0x35'),_0x303ae1,'createdAt',_0xfa2b('0x36')],squel[_0xfa2b('0x37')]()[_0xfa2b('0x38')](_0xfa2b('0x21'),_0xfa2b('0x21'))[_0xfa2b('0x38')](_0xfa2b('0x39'),'scheduledAt')[_0xfa2b('0x38')]('id',_0xfa2b('0x44'))['field'](LISTID['toString'](),_0xfa2b('0x35'))[_0xfa2b('0x38')](_0x137b08['id'][_0xfa2b('0x3a')](),_0x303ae1)[_0xfa2b('0x38')](_0xfa2b('0x39'),'createdAt')[_0xfa2b('0x38')](_0xfa2b('0x39'),_0xfa2b('0x36'))[_0xfa2b('0x40')](_0xfa2b('0x3c'))['where'](_0xfa2b('0x45'))[_0xfa2b('0x3d')](_0xfa2b('0x46'),LISTID[_0xfa2b('0x3a')]())[_0xfa2b('0x3d')]('id\x20IN\x20?',squel[_0xfa2b('0x48')](hopperContacts))[_0xfa2b('0x3d')](_0xfa2b('0x3e')))[_0xfa2b('0x3a')]();return _0x31b4dc;}function _0x46054e(_0x35e615,_0x249e0f){var _0x42d67f=squel['insert']()[_0xfa2b('0x33')](_0xfa2b('0x4c'))[_0xfa2b('0x43')](['phone',_0xfa2b('0x44'),_0xfa2b('0x35'),_0x249e0f,_0xfa2b('0x3b'),_0xfa2b('0x36')],squel[_0xfa2b('0x37')]()['field'](_0xfa2b('0x21'),_0xfa2b('0x21'))[_0xfa2b('0x38')]('id',_0xfa2b('0x44'))['field'](LISTID[_0xfa2b('0x3a')](),_0xfa2b('0x35'))['field'](_0x35e615['id']['toString'](),_0x249e0f)[_0xfa2b('0x38')](_0xfa2b('0x39'),_0xfa2b('0x3b'))[_0xfa2b('0x38')](_0xfa2b('0x39'),_0xfa2b('0x36'))[_0xfa2b('0x40')](_0xfa2b('0x3c'))['where']('deletedAt\x20IS\x20NULL')[_0xfa2b('0x3d')](_0xfa2b('0x46'),LISTID[_0xfa2b('0x3a')]())[_0xfa2b('0x3d')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfa2b('0x3d')](_0xfa2b('0x3e')))[_0xfa2b('0x3a')]();return _0x42d67f;}return db[_0xfa2b('0x4d')][_0xfa2b('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0xfa2b('0x4f')],'include':[{'model':db['CmList'],'as':_0xfa2b('0x50'),'where':{'id':LISTID}}]})[_0xfa2b('0x2c')](function(_0xd295f3){var _0x4f305d=[];if(_0xd295f3){var _0x43698c;for(var _0x711030=0x0,_0x182847;_0x711030<_0xd295f3[_0xfa2b('0x1a')];_0x711030+=0x1){_0x182847=_0xd295f3[_0x711030]['get']({'plain':!![]});switch(_0x182847[_0xfa2b('0x4f')]){case _0xfa2b('0x51'):_0x4f305d[_0xfa2b('0x2d')](db['sequelize'][_0xfa2b('0x52')](_0x702a8b(_0x182847,'VoiceQueueId'))[_0xfa2b('0x2c')](function(){})[_0xfa2b('0x2f')](_0x2a0328()));break;case _0xfa2b('0x53'):_0x4f305d[_0xfa2b('0x2d')](db[_0xfa2b('0x54')][_0xfa2b('0x52')](_0x1c7757(_0x182847,_0xfa2b('0x55')))['then'](function(){})[_0xfa2b('0x2f')](_0x2a0328()));break;default:_0x4f305d[_0xfa2b('0x2d')](db[_0xfa2b('0x54')][_0xfa2b('0x52')](_0x1db14a(_0x182847,_0xfa2b('0x55')))['then'](function(){})[_0xfa2b('0x2f')](_0x2a0328()));}}}return _0x4f305d;})[_0xfa2b('0x56')]()[_0xfa2b('0x2c')](function(){return db[_0xfa2b('0x4d')][_0xfa2b('0x4e')]({'where':{'type':_0xfa2b('0x57')},'attributes':['id'],'include':[{'model':db[_0xfa2b('0x58')],'as':_0xfa2b('0x59'),'where':{'id':LISTID}}]})[_0xfa2b('0x2c')](function(_0x20a28f){var _0x32cbfe=[];if(_0x20a28f){var _0x168488;for(var _0x16ab41=0x0,_0x37bf05;_0x16ab41<_0x20a28f[_0xfa2b('0x1a')];_0x16ab41+=0x1){_0x37bf05=_0x20a28f[_0x16ab41][_0xfa2b('0x5a')]({'plain':!![]});_0x32cbfe[_0xfa2b('0x2d')](db[_0xfa2b('0x54')][_0xfa2b('0x52')](_0x46054e(_0x37bf05,_0xfa2b('0x55')))[_0xfa2b('0x2c')](function(){})[_0xfa2b('0x2f')](_0x2a0328()));}}return _0x32cbfe;})['all']();})['then'](function(){return db['Campaign'][_0xfa2b('0x4e')]({'attributes':['id',_0xfa2b('0x4f')],'include':[{'model':db[_0xfa2b('0x58')],'as':_0xfa2b('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x345cb2){var _0xdfa031=[];if(_0x345cb2){for(var _0x2e032f=0x0,_0xb96fd4;_0x2e032f<_0x345cb2['length'];_0x2e032f+=0x1){_0xb96fd4=_0x345cb2[_0x2e032f]['get']({'plain':!![]});switch(_0xb96fd4[_0xfa2b('0x4f')]){case _0xfa2b('0x51'):_0xdfa031[_0xfa2b('0x2d')](db[_0xfa2b('0x54')]['query'](_0x702a8b(_0xb96fd4,_0xfa2b('0x5b')))['then'](function(){})[_0xfa2b('0x2f')](_0x2a0328()));break;case _0xfa2b('0x53'):_0xdfa031[_0xfa2b('0x2d')](db[_0xfa2b('0x54')][_0xfa2b('0x52')](_0x1c7757(_0xb96fd4,_0xfa2b('0x5b')))[_0xfa2b('0x2c')](function(){})[_0xfa2b('0x2f')](_0x2a0328()));break;default:_0xdfa031[_0xfa2b('0x2d')](db['sequelize']['query'](_0x1db14a(_0xb96fd4,_0xfa2b('0x5b')))[_0xfa2b('0x2c')](function(){})[_0xfa2b('0x2f')](_0x2a0328()));}}}return _0xdfa031;})[_0xfa2b('0x56')]();})[_0xfa2b('0x2c')](function(){return db[_0xfa2b('0x5c')][_0xfa2b('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xfa2b('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xfa2b('0x2c')](function(_0x208876){var _0x33fb52=[];if(_0x208876){for(var _0x5e8f08=0x0,_0x345ae1;_0x5e8f08<_0x208876[_0xfa2b('0x1a')];_0x5e8f08+=0x1){_0x345ae1=_0x208876[_0x5e8f08][_0xfa2b('0x5a')]({'plain':!![]});_0x33fb52[_0xfa2b('0x2d')](db[_0xfa2b('0x54')][_0xfa2b('0x52')](_0x46054e(_0x345ae1,_0xfa2b('0x5b')))[_0xfa2b('0x2c')](function(){})[_0xfa2b('0x2f')](_0x2a0328()));}}return _0x33fb52;})[_0xfa2b('0x56')]();})[_0xfa2b('0x2f')](function(_0x40ad38){logger[_0xfa2b('0x17')](_0xfa2b('0x5d'),'generalCheckHopper',_0x40ad38[_0xfa2b('0x1b')]);});}var processPromises=function(_0x5bd2cc){return BPromise[_0xfa2b('0x56')](promises)['then'](function(_0x51fefc){})['catch'](function(_0x1b6e5a){logger[_0xfa2b('0x17')](_0xfa2b('0x5e'),JSON[_0xfa2b('0x31')](_0x1b6e5a));})['finally'](function(){socket[_0xfa2b('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5bd2cc){return _0x5bd2cc[_0xfa2b('0x60')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xfa2b('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfa2b('0x61')](FILEPATH);}catch(_0x172fa6){logger[_0xfa2b('0x17')](_0xfa2b('0x62'),JSON['stringify'](_0x172fa6));}finally{process['exit'](0x0);}});};process['on'](_0xfa2b('0x63'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xfa2b('0x64')]()[_0xfa2b('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa2b('0x65')](',');return db[_0xfa2b('0x29')][_0xfa2b('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfa2b('0x2c')](function(_0x56b8cb){var _0x169eab=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa2b('0x66')](_0x169eab,{'header':!![],'skipEmptyLines':!![],'step':function(_0x244633,_0x59ec92){total+=0x1;var _0x517b73=total;promises[_0xfa2b('0x2d')](checkRow(_0x244633,_0x56b8cb,_0x517b73)['then'](function(){success+=0x1;})[_0xfa2b('0x2f')](function(_0x3baa62){if(_0x3baa62['error']){errors+=0x1;delete _0x3baa62[_0xfa2b('0x17')];}else if(_0x3baa62[_0xfa2b('0x67')]){duplicates+=0x1;delete _0x3baa62['duplicate'];}rows['push'](_0x3baa62);}));if(total%0xc8===0x0){_0x59ec92[_0xfa2b('0x68')]();return processPromises(_0x59ec92);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xfa2b('0x69'));endCsv();});},'error':function(_0x299008,_0x12f972){logger['info'](_0xfa2b('0x6a'),JSON[_0xfa2b('0x31')](_0x299008));endCsv();}});})[_0xfa2b('0x2f')](function(_0x20fcbd){logger[_0xfa2b('0x17')](_0xfa2b('0x6b'),JSON[_0xfa2b('0x31')](_0x20fcbd));});}main(); \ No newline at end of file +var _0x45f0=['cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','updatedAt','field','NOW()','toString','createdAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','fromQuery','ContactId','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','onlyIfOpen','CampaignId'];(function(_0x231cd6,_0x449951){var _0x2c8da6=function(_0x203c92){while(--_0x203c92){_0x231cd6['push'](_0x231cd6['shift']());}};_0x2c8da6(++_0x449951);}(_0x45f0,0x7f));var _0x045f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45f0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x045f('0x0'));var util=require(_0x045f('0x1'));var _=require(_0x045f('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x045f('0x3'));var Redis=require(_0x045f('0x4'));var db=require(_0x045f('0x5'))['db'];var config=require(_0x045f('0x6'));var logger=require(_0x045f('0x7'))('api');config['redis']=_[_0x045f('0x8')](config[_0x045f('0x9')],{'host':_0x045f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x045f('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x045f('0xb')](socket);try{if(!process[_0x045f('0xc')][0x2]||process[_0x045f('0xc')][0x2]==='undefined'||process[_0x045f('0xc')][0x2]===_0x045f('0xd')){throw new Error(_0x045f('0xe'));}var FILEPATH=process[_0x045f('0xc')][0x2];if(!process['argv'][0x3]||process[_0x045f('0xc')][0x3]===_0x045f('0xf')||process[_0x045f('0xc')][0x3]==='null'||!process[_0x045f('0xc')][0x4]||process[_0x045f('0xc')][0x4]===_0x045f('0xf')||process[_0x045f('0xc')][0x4]===_0x045f('0xd')){throw new Error(_0x045f('0x10'));}var FIELDS=_[_0x045f('0x11')](process['argv'][0x3][_0x045f('0x12')](','),process['argv'][0x4][_0x045f('0x12')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x045f('0xf')||process[_0x045f('0xc')][0x5]===_0x045f('0xd')){throw new Error(_0x045f('0x13'));}var LISTID=process[_0x045f('0xc')][0x5];var COMPANYID=process[_0x045f('0xc')][0x6]&&process[_0x045f('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x045f('0xd')?process[_0x045f('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x045f('0xc')][0x7]!==_0x045f('0xf')&&process[_0x045f('0xc')][0x7]!==_0x045f('0xd')?process[_0x045f('0xc')][0x7]:null;if(!process[_0x045f('0xc')][0x8]||process[_0x045f('0xc')][0x8]==='undefined'||process[_0x045f('0xc')][0x8]===_0x045f('0xd')){throw new Error(_0x045f('0x14'));}var SOCKET_TIMESTAMP=process[_0x045f('0xc')][0x8];}catch(_0x2f18b6){logger['error'](_0x2f18b6);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(_0x46ed0a,_0x2a674a,_0xb428e8,_0x3ff78a){var _0x458c1f={'message':_0x2a674a};_0x458c1f[_0x46ed0a]=!![];if(_0xb428e8){_0x458c1f[_0x045f('0x15')]=_0xb428e8;}if(_0x3ff78a){_0x458c1f['index']=_0x3ff78a;}return _0x458c1f;}function isEmail(_0x2cc376){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'](_0x2cc376);}function checkRow(_0x1e13ba,_0x200060,_0x13bb03){return new BPromise(function(_0x587f86,_0x314549){if(_['isNil'](_0x1e13ba)){return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x045f('0x17'),null,_0x13bb03));}if(_0x1e13ba['errors']&&_0x1e13ba['errors'][_0x045f('0x18')]){var _0x5d4d23=_[_0x045f('0x19')](_0x1e13ba[_0x045f('0x1a')],_0x045f('0x1b'))[_0x045f('0x1c')](';');return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x5d4d23,null,_0x13bb03));}var _0x2a7d75={};for(var _0xbab11d in FIELDS){if(FIELDS[_0x045f('0x1d')](_0xbab11d)&&FIELDS[_0xbab11d]){_0x2a7d75[_0xbab11d]=_0x1e13ba['data'][0x0][FIELDS[_0xbab11d]]||_0x1e13ba[_0x045f('0x1e')][0x0]['\ufeff'+FIELDS[_0xbab11d]];}}if(!_0x2a7d75[_0x045f('0x1f')]){return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x045f('0x20'),null,_0x13bb03));}if(!_0x2a7d75[_0x045f('0x21')]){return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x045f('0x22'),null,_0x13bb03));}if(_0x2a7d75[_0x045f('0x23')]){var _0x46e195=moment(_0x2a7d75[_0x045f('0x23')],_0x045f('0x24'));if(!_0x46e195[_0x045f('0x25')]()){return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x045f('0x26'),null,_0x13bb03));}}if(_0x2a7d75[_0x045f('0x27')]){if(!isEmail(_0x2a7d75[_0x045f('0x27')])){return _0x314549(handleCheckRowError(_0x045f('0x16'),_0x045f('0x28'),null,_0x13bb03));}}_0x2a7d75[_0x045f('0x29')]=LISTID;_0x2a7d75[_0x045f('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x200060){var _0x1237e6={};for(var _0x4d1553=0x0,_0x518272=DUPLICATES[_0x045f('0x18')];_0x4d1553<_0x518272;_0x4d1553+=0x1){_0x1237e6[DUPLICATES[_0x4d1553]]=_0x2a7d75[DUPLICATES[_0x4d1553]];}var _0x379849=_['find'](_0x200060,_0x1237e6);if(_0x379849){return _0x314549(handleCheckRowError(_0x045f('0x2b'),_0x045f('0x2c'),_0x379849,_0x13bb03));}}return db['CmContact'][_0x045f('0x2d')](_0x2a7d75,{'raw':!![],'hooks':![],'fields':_[_0x045f('0x2e')](_0x2a7d75)})[_0x045f('0x2f')](function(_0x12e416){if(DUPLICATES&&DUPLICATES['length']&&_0x200060){_0x200060[_0x045f('0x30')](_[_0x045f('0x31')](_0x2a7d75,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x12e416['id'];return _0x587f86();})['catch'](function(_0x17ed40){return _0x314549(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x17ed40['message']||JSON[_0x045f('0x32')](_0x17ed40)),null,_0x13bb03));});});}function checkHopper(){function _0x5dad4d(){return function(_0x28e342){logger['error'](_0x045f('0x33'),_0x045f('0x34'),util[_0x045f('0x35')](_0x28e342,{'showHidden':![],'depth':null}));};}var _0x205362=function(_0x71f7d7,_0xadea39){var _0x4c4a2f=squel[_0x045f('0x36')]()[_0x045f('0x37')](_0x045f('0x38'))['fromQuery']([_0x045f('0x21'),_0x045f('0x39'),'ContactId',_0x045f('0x29'),_0xadea39,'createdAt',_0x045f('0x3a')],squel['select']()[_0x045f('0x3b')](_0x045f('0x21'),_0x045f('0x21'))['field'](_0x045f('0x3c'),_0x045f('0x39'))[_0x045f('0x3b')]('id','ContactId')[_0x045f('0x3b')](LISTID['toString'](),_0x045f('0x29'))['field'](_0x71f7d7['id'][_0x045f('0x3d')](),_0xadea39)[_0x045f('0x3b')]('NOW()',_0x045f('0x3e'))[_0x045f('0x3b')]('NOW()','updatedAt')['from'](_0x045f('0x3f'))[_0x045f('0x40')](_0x045f('0x41'))[_0x045f('0x40')](_0x045f('0x42'),LISTID[_0x045f('0x3d')]())[_0x045f('0x40')](_0x045f('0x43'))[_0x045f('0x40')](_0x045f('0x44'),squel[_0x045f('0x45')]()[_0x045f('0x3b')](_0x045f('0x21'))[_0x045f('0x46')]('cm_hopper')[_0x045f('0x40')](_0xadea39+'\x20=\x20?',_0x71f7d7['id'][_0x045f('0x3d')]())))[_0x045f('0x3d')]();return _0x4c4a2f;};var _0x3d7285=function(_0x31aed9,_0x2fc775){var _0x5c77c2=squel['insert']()[_0x045f('0x37')](_0x045f('0x38'))[_0x045f('0x47')]([_0x045f('0x21'),'scheduledAt',_0x045f('0x48'),_0x045f('0x29'),_0x2fc775,'createdAt','updatedAt'],squel['select']()[_0x045f('0x3b')](_0x045f('0x21'),_0x045f('0x21'))[_0x045f('0x3b')](_0x045f('0x3c'),_0x045f('0x39'))['field']('id',_0x045f('0x48'))['field'](LISTID[_0x045f('0x3d')](),_0x045f('0x29'))[_0x045f('0x3b')](_0x31aed9['id'][_0x045f('0x3d')](),_0x2fc775)['field']('NOW()',_0x045f('0x3e'))[_0x045f('0x3b')](_0x045f('0x3c'),'updatedAt')[_0x045f('0x46')](_0x045f('0x3f'))['where'](_0x045f('0x41'))[_0x045f('0x40')](_0x045f('0x42'),LISTID[_0x045f('0x3d')]())[_0x045f('0x40')](_0x045f('0x49'),squel[_0x045f('0x4a')](hopperContacts))[_0x045f('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x045f('0x40')](_0x045f('0x44'),squel['select']()['field'](_0x045f('0x4b'))[_0x045f('0x46')](_0x045f('0x4c'))[_0x045f('0x40')](_0x2fc775+'\x20=\x20?',_0x31aed9['id']['toString']()))['where'](_0x045f('0x44'),squel[_0x045f('0x45')]()[_0x045f('0x3b')](_0x045f('0x21'))['from'](_0x045f('0x38'))[_0x045f('0x40')](_0x2fc775+'\x20=\x20?',_0x31aed9['id']['toString']())))[_0x045f('0x3d')]();return _0x5c77c2;};function _0x542e6a(_0x344e1c,_0x47ee46){var _0x1f570e=squel[_0x045f('0x36')]()['into'](_0x045f('0x38'))['fromQuery']([_0x045f('0x21'),_0x045f('0x39'),'ContactId',_0x045f('0x29'),_0x47ee46,_0x045f('0x3e'),_0x045f('0x3a')],squel[_0x045f('0x45')]()[_0x045f('0x3b')](_0x045f('0x21'),_0x045f('0x21'))[_0x045f('0x3b')](_0x045f('0x3c'),_0x045f('0x39'))[_0x045f('0x3b')]('id',_0x045f('0x48'))[_0x045f('0x3b')](LISTID[_0x045f('0x3d')](),'ListId')[_0x045f('0x3b')](_0x344e1c['id']['toString'](),_0x47ee46)[_0x045f('0x3b')]('NOW()',_0x045f('0x3e'))[_0x045f('0x3b')](_0x045f('0x3c'),_0x045f('0x3a'))[_0x045f('0x46')]('cm_contacts')[_0x045f('0x40')]('deletedAt\x20IS\x20NULL')[_0x045f('0x40')](_0x045f('0x42'),LISTID[_0x045f('0x3d')]())[_0x045f('0x40')](_0x045f('0x49'),squel[_0x045f('0x4a')](hopperContacts))[_0x045f('0x40')](_0x045f('0x43')))[_0x045f('0x3d')]();return _0x1f570e;}function _0x2010fc(_0x8e9255,_0x271bb3){var _0x2efbb7=squel[_0x045f('0x36')]()['into'](_0x045f('0x4d'))[_0x045f('0x47')]([_0x045f('0x21'),_0x045f('0x48'),_0x045f('0x29'),_0x271bb3,_0x045f('0x3e'),_0x045f('0x3a')],squel[_0x045f('0x45')]()[_0x045f('0x3b')](_0x045f('0x21'),'phone')[_0x045f('0x3b')]('id','ContactId')[_0x045f('0x3b')](LISTID[_0x045f('0x3d')](),_0x045f('0x29'))[_0x045f('0x3b')](_0x8e9255['id'][_0x045f('0x3d')](),_0x271bb3)['field'](_0x045f('0x3c'),_0x045f('0x3e'))['field'](_0x045f('0x3c'),'updatedAt')[_0x045f('0x46')]('cm_contacts')[_0x045f('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x045f('0x3d')]())['where'](_0x045f('0x49'),squel[_0x045f('0x4a')](hopperContacts))['where'](_0x045f('0x43')))[_0x045f('0x3d')]();return _0x2efbb7;}return db[_0x045f('0x4e')][_0x045f('0x4f')]({'where':{'type':_0x045f('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x045f('0x51')],'as':_0x045f('0x52'),'where':{'id':LISTID}}]})[_0x045f('0x2f')](function(_0x2e4f1f){var _0x5bb85c=[];if(_0x2e4f1f){var _0x7ed979;for(var _0x3c320b=0x0,_0x560d05;_0x3c320b<_0x2e4f1f[_0x045f('0x18')];_0x3c320b+=0x1){_0x560d05=_0x2e4f1f[_0x3c320b][_0x045f('0x53')]({'plain':!![]});switch(_0x560d05[_0x045f('0x54')]){case _0x045f('0x55'):_0x5bb85c['push'](db[_0x045f('0x56')][_0x045f('0x57')](_0x3d7285(_0x560d05,_0x045f('0x58')))['then'](function(){})[_0x045f('0x59')](_0x5dad4d()));break;case'onlyIfOpen':_0x5bb85c['push'](db[_0x045f('0x56')]['query'](_0x205362(_0x560d05,_0x045f('0x58')))[_0x045f('0x2f')](function(){})[_0x045f('0x59')](_0x5dad4d()));break;default:_0x5bb85c[_0x045f('0x30')](db[_0x045f('0x56')][_0x045f('0x57')](_0x542e6a(_0x560d05,'VoiceQueueId'))['then'](function(){})[_0x045f('0x59')](_0x5dad4d()));}}}return _0x5bb85c;})[_0x045f('0x5a')]()['then'](function(){return db['VoiceQueue'][_0x045f('0x4f')]({'where':{'type':_0x045f('0x50')},'attributes':['id'],'include':[{'model':db[_0x045f('0x51')],'as':_0x045f('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x3a7d17){var _0x1dafb1=[];if(_0x3a7d17){var _0x51e464;for(var _0x2cc457=0x0,_0x43e855;_0x2cc457<_0x3a7d17[_0x045f('0x18')];_0x2cc457+=0x1){_0x43e855=_0x3a7d17[_0x2cc457][_0x045f('0x53')]({'plain':!![]});_0x1dafb1[_0x045f('0x30')](db[_0x045f('0x56')]['query'](_0x2010fc(_0x43e855,_0x045f('0x58')))[_0x045f('0x2f')](function(){})[_0x045f('0x59')](_0x5dad4d()));}}return _0x1dafb1;})[_0x045f('0x5a')]();})[_0x045f('0x2f')](function(){return db[_0x045f('0x5c')][_0x045f('0x4f')]({'attributes':['id',_0x045f('0x54')],'include':[{'model':db[_0x045f('0x51')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x3dcd46){var _0x936dab=[];if(_0x3dcd46){for(var _0x283e31=0x0,_0x476906;_0x283e31<_0x3dcd46[_0x045f('0x18')];_0x283e31+=0x1){_0x476906=_0x3dcd46[_0x283e31][_0x045f('0x53')]({'plain':!![]});switch(_0x476906[_0x045f('0x54')]){case _0x045f('0x55'):_0x936dab['push'](db[_0x045f('0x56')][_0x045f('0x57')](_0x3d7285(_0x476906,'CampaignId'))[_0x045f('0x2f')](function(){})[_0x045f('0x59')](_0x5dad4d()));break;case _0x045f('0x5d'):_0x936dab[_0x045f('0x30')](db[_0x045f('0x56')][_0x045f('0x57')](_0x205362(_0x476906,_0x045f('0x5e')))[_0x045f('0x2f')](function(){})[_0x045f('0x59')](_0x5dad4d()));break;default:_0x936dab[_0x045f('0x30')](db[_0x045f('0x56')]['query'](_0x542e6a(_0x476906,_0x045f('0x5e')))[_0x045f('0x2f')](function(){})['catch'](_0x5dad4d()));}}}return _0x936dab;})[_0x045f('0x5a')]();})[_0x045f('0x2f')](function(){return db[_0x045f('0x5c')][_0x045f('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x045f('0x5b'),'where':{'id':LISTID}}]})[_0x045f('0x2f')](function(_0x57e858){var _0x26acb4=[];if(_0x57e858){for(var _0x26c99d=0x0,_0x24d80a;_0x26c99d<_0x57e858[_0x045f('0x18')];_0x26c99d+=0x1){_0x24d80a=_0x57e858[_0x26c99d][_0x045f('0x53')]({'plain':!![]});_0x26acb4[_0x045f('0x30')](db['sequelize'][_0x045f('0x57')](_0x2010fc(_0x24d80a,_0x045f('0x5e')))['then'](function(){})[_0x045f('0x59')](_0x5dad4d()));}}return _0x26acb4;})[_0x045f('0x5a')]();})[_0x045f('0x59')](function(_0x264fcc){logger[_0x045f('0x16')](_0x045f('0x5f'),_0x045f('0x60'),_0x264fcc[_0x045f('0x1b')]);});}var processPromises=function(_0x42560d){return BPromise[_0x045f('0x5a')](promises)[_0x045f('0x2f')](function(_0x480e5d){})['catch'](function(_0x1f8018){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x045f('0x32')](_0x1f8018));})[_0x045f('0x61')](function(){socket[_0x045f('0x62')](_0x045f('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x42560d){return _0x42560d[_0x045f('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x045f('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x045f('0x2f')](function(){socket[_0x045f('0x62')](_0x045f('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x045f('0x65')](FILEPATH);}catch(_0x46df18){logger[_0x045f('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x045f('0x32')](_0x46df18));}finally{process[_0x045f('0x66')](0x0);}});};process['on']('SIGINT',function(){logger[_0x045f('0x67')](_0x045f('0x68'));endCsv();});function main(){return BPromise[_0x045f('0x69')]()[_0x045f('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x045f('0x12')](',');return db['CmContact'][_0x045f('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4ea7e2){var _0x2cc687=fs[_0x045f('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2cc687,{'header':!![],'skipEmptyLines':!![],'step':function(_0x558d02,_0x59db18){total+=0x1;var _0x118d96=total;promises[_0x045f('0x30')](checkRow(_0x558d02,_0x4ea7e2,_0x118d96)[_0x045f('0x2f')](function(){success+=0x1;})[_0x045f('0x59')](function(_0x4591d9){if(_0x4591d9[_0x045f('0x16')]){errors+=0x1;delete _0x4591d9[_0x045f('0x16')];}else if(_0x4591d9['duplicate']){duplicates+=0x1;delete _0x4591d9[_0x045f('0x2b')];}rows[_0x045f('0x30')](_0x4591d9);}));if(total%0xc8===0x0){_0x59db18[_0x045f('0x6b')]();return processPromises(_0x59db18);}},'complete':function(){return processPromises()[_0x045f('0x2f')](function(){logger[_0x045f('0x67')](_0x045f('0x6c'));endCsv();});},'error':function(_0x5eebe1,_0x5661bb){logger['info'](_0x045f('0x6d'),JSON[_0x045f('0x32')](_0x5eebe1));endCsv();}});})[_0x045f('0x59')](function(_0x3cfa8a){logger['error'](_0x045f('0x6e'),JSON['stringify'](_0x3cfa8a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c3d13e2..5dec8b9 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 _0x0636=['emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','length','cm_contacts_','\x20LIKE\x20cm_contacts;','format','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','CampaignId','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','parse','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','import','redis','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','UserId','recallme','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.updatedAt','createdAt','updatedAt','cm_contacts','.CmListId','.CmListId\x20=\x20?','concat','keys','CompanyId','fromQuery','fields',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','catch','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','createReadStream','rows','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x0636,0x1b3));var _0x6063=function(_0x2b0424,_0x4489b0){_0x2b0424=_0x2b0424-0x0;var _0x7538e4=_0x0636[_0x2b0424];return _0x7538e4;};'use strict';var fs=require('fs');var path=require(_0x6063('0x0'));var _=require(_0x6063('0x1'));var Papa=require(_0x6063('0x2'));var util=require('util');var BPromise=require(_0x6063('0x3'));var moment=require(_0x6063('0x4'));var squel=require('squel');var Redis=require(_0x6063('0x5'));var db=require(_0x6063('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x6063('0x7'))(_0x6063('0x8'));config[_0x6063('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6063('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x6063('0xb'));function isEmail(_0x20b420){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'](_0x20b420);}function selectNotIn(_0x290b66,_0xdcf775,_0x5baaae,_0x1d19f2,_0x4c698c){return squel[_0x6063('0xc')]()[_0x6063('0xd')](_0x6063('0xe'))[_0x6063('0xf')](_0x1d19f2)[_0x6063('0x10')](_0xdcf775,null,_0xdcf775+_0x6063('0x11')+_0x1d19f2+'.'+_0x5baaae)['where'](_0x1d19f2+'.'+_0x5baaae+_0x6063('0x12')+_0x290b66+'.'+_0x5baaae)[_0x6063('0x13')](_0xdcf775+_0x6063('0x14')+_0x4c698c[_0x6063('0x10')]()+')');}function insertCmHopper(_0x218334,_0x3bdc07,_0x4af436,_0xe3ca6a,_0x499f3a){var _0x52c9f3=[_0x6063('0x15'),_0x6063('0x16'),'cm_contacts.id',_0x6063('0x17'),_0x3bdc07+'.'+_0xe3ca6a,_0x6063('0x18'),'cm_contacts.updatedAt',_0x6063('0x19'),_0x6063('0x1a'),'\x22'+_0x499f3a+'\x22'];return squel[_0x6063('0x1b')]()[_0x6063('0x1c')](_0x6063('0x1d'))['fromQuery']([_0x6063('0xe'),_0x6063('0x1e'),'ContactId',_0x6063('0x1f'),_0xe3ca6a,'createdAt','updatedAt','priority',_0x6063('0x20'),_0x6063('0x21')],squel[_0x6063('0xc')]()['fields'](_0x52c9f3)[_0x6063('0xf')](_0x3bdc07)[_0x6063('0x10')]('cm_contacts',null,_0x6063('0x22')+_0x3bdc07+'.CmListId')['join'](_0x4af436,null,_0x4af436+_0x6063('0x11')+_0x3bdc07+'.'+_0xe3ca6a)[_0x6063('0x13')](_0x3bdc07+'.CmListId\x20=\x20?',_0x218334)['where'](_0x6063('0x23'),NOW)['where'](_0x6063('0x24'),selectNotIn(_0x3bdc07,_0x4af436,_0xe3ca6a,'cm_hopper',[_0x6063('0x25'),_0x6063('0x26')]))[_0x6063('0x13')](_0x6063('0x24'),selectNotIn(_0x3bdc07,_0x4af436,_0xe3ca6a,_0x6063('0x1d'),['\x22always\x22'])))[_0x6063('0x27')]();}function insertCmHopperBlack(_0x2abdd9,_0x5f5734,_0x624022,_0x45a446){var _0x13c600=[_0x6063('0x15'),_0x6063('0x28'),'cm_contacts.ListId',_0x5f5734+'.'+_0x45a446,_0x6063('0x18'),_0x6063('0x29')];return squel[_0x6063('0x1b')]()[_0x6063('0x1c')]('cm_hopper_black')['fromQuery']([_0x6063('0xe'),'ContactId',_0x6063('0x1f'),_0x45a446,_0x6063('0x2a'),_0x6063('0x2b')],squel['select']()['fields'](_0x13c600)[_0x6063('0xf')](_0x5f5734)[_0x6063('0x10')](_0x6063('0x2c'),null,_0x6063('0x22')+_0x5f5734+_0x6063('0x2d'))[_0x6063('0x10')](_0x624022,null,_0x624022+_0x6063('0x11')+_0x5f5734+'.'+_0x45a446)[_0x6063('0x13')](_0x5f5734+_0x6063('0x2e'),_0x2abdd9)[_0x6063('0x13')](_0x6063('0x23'),NOW)[_0x6063('0x13')](_0x6063('0x24'),squel[_0x6063('0xc')]()[_0x6063('0xd')](_0x6063('0xe'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x2abdd9)[_0x6063('0x13')](_0x45a446+'\x20=\x20?',_0x5f5734+'.'+_0x45a446)))[_0x6063('0x27')]();}function insertCmContact(_0x5a36c6,_0x5cb24e,_0x18f888,_0x503def){var _0x217a62=_[_0x6063('0x2f')](_[_0x6063('0x30')](_0x503def),['ListId',_0x6063('0x31'),'createdAt',_0x6063('0x2b')]);return squel[_0x6063('0x1b')]()[_0x6063('0x1c')]('cm_contacts')[_0x6063('0x32')](_0x217a62,squel[_0x6063('0xc')]()[_0x6063('0x33')](_0x217a62)[_0x6063('0xf')](_0x5cb24e)[_0x6063('0x13')]('('+_0x18f888[_0x6063('0x10')](',')+_0x6063('0x34'),squel[_0x6063('0xc')]()[_0x6063('0x33')](_0x18f888)[_0x6063('0xf')](_0x6063('0x2c'))[_0x6063('0x13')](_0x6063('0x35'),_0x5a36c6)[_0x6063('0x13')](_0x6063('0x36')))[_0x6063('0x13')](_0x6063('0x37'),squel[_0x6063('0xc')]()['field'](_0x6063('0x38'),_0x6063('0x39'))[_0x6063('0xf')](_0x5cb24e)[_0x6063('0x3a')](_0x18f888[_0x6063('0x10')](','))))[_0x6063('0x27')]();}function handleStop(){logger[_0x6063('0x3b')](_0x6063('0x3c'));stopped=!![];}function handleUncaughtException(_0x4e4166){logger[_0x6063('0x3d')](_0x4e4166[_0x6063('0x3e')]);process[_0x6063('0x3f')](0x1);}function handleError(_0x5dff91,_0x59521e){stats[_0x6063('0x40')][_0x6063('0x41')]({'name':_0x59521e[_0x6063('0x42')],'message':_0x59521e[_0x6063('0x3e')],'row':_0x5dff91});}function handleQuery(_0x4139b5){logger[_0x6063('0x3b')](_0x4139b5);return db[_0x6063('0x43')][_0x6063('0x44')](_0x4139b5)['spread'](function(_0x196bf1){results[_0x6063('0x41')](_0x196bf1);})[_0x6063('0x45')](function(_0x39caa8){logger[_0x6063('0x3d')](_0x39caa8[_0x6063('0x3e')]);});}function main(_0x41588f,_0x366ea6,_0x2b17bd,_0x2075b4){logger[_0x6063('0x3b')]('main',_0x41588f,JSON[_0x6063('0x46')](_0x366ea6));process[_0x6063('0x47')]('start');var _0x496725=_0x366ea6[_0x6063('0x48')];var _0x4f54d8=_0x366ea6[_0x6063('0x49')];var _0x31dd0b=path[_0x6063('0x10')](config[_0x6063('0x4a')],_0x6063('0x4b'),_0x4f54d8+_0x6063('0x4c'));var _0xee013b=_[_0x6063('0x30')](_0x496725)[_0x6063('0x10')]();logger['info']('header',_0xee013b);fs[_0x6063('0x4d')](_0x31dd0b,_0xee013b+'\x0a');Papa['parse'](fs[_0x6063('0x4e')](_0x41588f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x90c5df,_0x5551df){try{for(var _0x592caa=0x0,_0x16da38=[];_0x592caa<_0x90c5df['data']['length'];_0x592caa++){stats[_0x6063('0x4f')]+=0x1;if(_0x90c5df['errors'][_0x592caa]){handleError(_0x90c5df[_0x6063('0x50')][_0x592caa],_0x90c5df[_0x6063('0x40')][_0x592caa]);}else{var _0x3322f1=[];for(var _0x332b50 in _0x496725){if(_0x496725[_0x6063('0x51')](_0x332b50)){if(_0x90c5df['data'][_0x592caa][_0x496725[_0x332b50]]){var _0xb2b2d4=_[_0x6063('0x52')](_0x90c5df[_0x6063('0x50')][_0x592caa][_0x496725[_0x332b50]][_0x6063('0x53')](/"/g,'\x27'));switch(_0x332b50){case'scheduledat':var _0x3c0f63=moment(_0xb2b2d4,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3c0f63[_0x6063('0x54')]()){_0x16da38[_0x6063('0x41')]('\x22'+_0xb2b2d4+'\x22');}else{_0x3322f1['push'](_0x6063('0x55'));}break;case _0x6063('0x56'):var _0x46c536=parseInt(_0xb2b2d4);_0xb2b2d4=_[_0x6063('0x57')](_0x46c536)||_0x46c536<0x0||_0x46c536>0x4?_0x2075b4?0x3:0x2:_0x46c536;_0x16da38[_0x6063('0x41')]('\x22'+_0xb2b2d4+'\x22');break;case _0x6063('0x20'):var _0x59a270=parseInt(_0xb2b2d4);if(_[_0x6063('0x58')](_0x59a270)&&_[_0x6063('0x59')](_0x2b17bd,_0x59a270)){_0x16da38[_0x6063('0x41')]('\x22'+_0x59a270+'\x22');}else{_0x3322f1[_0x6063('0x41')](_0x6063('0x5a'));}break;case'email':if(isEmail(_0xb2b2d4)){_0x16da38[_0x6063('0x41')]('\x22'+_0xb2b2d4+'\x22');}else{_0x3322f1[_0x6063('0x41')](_0x6063('0x5b'));}break;case _0x6063('0x5c'):var _0x444acb=moment(_0xb2b2d4,'YYYY-MM-DD',!![]);if(_0x444acb['isValid']()){_0x16da38[_0x6063('0x41')]('\x22'+_0xb2b2d4+'\x22');}else{_0x3322f1[_0x6063('0x41')](_0x6063('0x5d'));}break;default:_0x16da38[_0x6063('0x41')]('\x22'+_0xb2b2d4+'\x22');}}else{switch(_0x332b50){case'firstName':case _0x6063('0xe'):_0x3322f1[_0x6063('0x41')](_0x332b50+_0x6063('0x5e'));break;default:_0x16da38[_0x6063('0x41')]('\x22\x22');}}}}if(_0x3322f1['length']){handleError(_0x90c5df[_0x6063('0x50')][_0x592caa],{'code':_0x6063('0x5f'),'message':_0x3322f1[_0x6063('0x10')]()});}else{fs[_0x6063('0x60')](_0x31dd0b,_0x16da38[_0x6063('0x10')]()+'\x0a');}_0x16da38=[];}if(!(stats['rows']%0xc8)){socket[_0x6063('0x61')](_0x6063('0x62')+_0x4f54d8,stats);stats['errors']=[];}}if(stopped){logger[_0x6063('0x3b')](_0x6063('0x63'));_0x5551df[_0x6063('0x64')]();}}catch(_0x469a9e){handleError(_0x90c5df['data'][_0x592caa],{'code':_0x6063('0x65'),'message':_0x469a9e[_0x6063('0x3e')]});logger['error']('step',_0x469a9e[_0x6063('0x3e')]);}},'complete':function(){try{var _0x3d2755=[];var _0x3c115f=_0x6063('0x2c');if(_0x366ea6['duplicates']&&_0x366ea6[_0x6063('0x66')][_0x6063('0x67')]){_0x3c115f=_0x6063('0x68')+_0x4f54d8;_0x3d2755[_0x6063('0x41')]('CREATE\x20TABLE\x20'+_0x3c115f+_0x6063('0x69'));}var _0x45d341=util[_0x6063('0x6a')]('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',_0x31dd0b,_0x3c115f,_0xee013b,_0x366ea6[_0x6063('0x1f')],_0x366ea6[_0x6063('0x31')]||null,NOW,NOW);if(_[_0x6063('0x6b')](_0x496725[_0x6063('0x1e')])){_0x45d341+=_0x6063('0x6c');}_0x3d2755[_0x6063('0x41')](_0x45d341);if(_0x366ea6[_0x6063('0x66')]&&_0x366ea6[_0x6063('0x66')]['length']){_0x3d2755[_0x6063('0x41')](insertCmContact(_0x366ea6[_0x6063('0x1f')],_0x3c115f,_0x366ea6[_0x6063('0x66')],_0x496725));_0x3d2755[_0x6063('0x41')](_0x6063('0x6d')+_0x3c115f+';');}_0x3d2755[_0x6063('0x41')](insertCmHopper(_0x366ea6[_0x6063('0x1f')],_0x6063('0x6e'),'voice_queues',_0x6063('0x6f'),_0x2075b4));_0x3d2755[_0x6063('0x41')](insertCmHopperBlack(_0x366ea6[_0x6063('0x1f')],_0x6063('0x70'),_0x6063('0x71'),_0x6063('0x6f')));_0x3d2755[_0x6063('0x41')](insertCmHopper(_0x366ea6['ListId'],_0x6063('0x72'),'campaigns',_0x6063('0x73'),_0x2075b4));_0x3d2755[_0x6063('0x41')](insertCmHopperBlack(_0x366ea6[_0x6063('0x1f')],'campaigns_has_cm_blacklists','campaigns',_0x6063('0x73')));BPromise[_0x6063('0x74')](_0x3d2755,handleQuery)[_0x6063('0x75')](function(_0x31609e){stats[_0x6063('0x76')]=!![];stats[_0x6063('0x77')]=_0x366ea6[_0x6063('0x66')]&&_0x366ea6[_0x6063('0x66')]['length']?results[0x2][_0x6063('0x77')]:results[0x0]['affectedRows'];socket[_0x6063('0x61')](_0x6063('0x62')+_0x4f54d8,stats);fs[_0x6063('0x78')](_0x41588f);fs[_0x6063('0x78')](_0x31dd0b);process['exit'](0x0);})[_0x6063('0x45')](function(_0x427cb1){logger[_0x6063('0x3d')](_0x427cb1['message']);process[_0x6063('0x3f')](0x1);});}catch(_0x58d7ea){logger['error'](_0x6063('0x79'),_0x58d7ea[_0x6063('0x3e')]);process[_0x6063('0x3f')](0x1);}},'error':function(_0x2637cd,_0x902b68,_0x2a6a5c,_0x2ab5b0){throw new Error(_0x2ab5b0);}});}function validate(){if(process[_0x6063('0x7a')]&&process[_0x6063('0x7a')]['length']<0x4){throw new Error(_0x6063('0x7b'));}var _0xab49be=path['join'](config[_0x6063('0x4a')],'server/files/tmp',process[_0x6063('0x7a')][0x2]);if(!fs['existsSync'](_0xab49be)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5547f1={};try{_0x5547f1=JSON[_0x6063('0x7c')](process[_0x6063('0x7a')][0x3]);if(!_0x5547f1[_0x6063('0x48')]){throw new Error(_0x6063('0x7d'));}if(!_0x5547f1[_0x6063('0x48')][_0x6063('0xe')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x5547f1[_0x6063('0x48')][_0x6063('0x7e')]){throw new Error(_0x6063('0x7f'));}var _0x2ab1a1=0x0;if(_0x5547f1['binding']['UserId']){_0x2ab1a1=0x1;}if(!_0x5547f1[_0x6063('0x1f')]){throw new Error(_0x6063('0x80'));}}catch(_0x1fa10b){throw new Error(_0x6063('0x81'));}var _0x71a57b=[];try{_0x71a57b=_['map'](JSON['parse'](process[_0x6063('0x7a')][0x4]),'id');}catch(_0x159f5f){logger['info'](_0x6063('0x82'));}main(_0xab49be,_0x5547f1,_0x71a57b,_0x2ab1a1);}validate();process['on'](_0x6063('0x83'),handleStop);process['on'](_0x6063('0x84'),handleUncaughtException); \ No newline at end of file +var _0x5f3c=['cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper','fromQuery','phone','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','into','ContactId','ListId','field','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','concat','CompanyId','insert',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','error','message','exit','errors','push','info','sequelize','query','spread','catch','send','start','socket_timestamp','root','server/files/tmp','.csv','header','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','appendFileSync','emit','contact:import:','Abort\x20parser','abort','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','scheduledat','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x5f3c,0xeb));var _0xc5f3=function(_0x49dd98,_0x8dc77f){_0x49dd98=_0x49dd98-0x0;var _0x590ce3=_0x5f3c[_0x49dd98];return _0x590ce3;};'use strict';var fs=require('fs');var path=require(_0xc5f3('0x0'));var _=require(_0xc5f3('0x1'));var Papa=require(_0xc5f3('0x2'));var util=require(_0xc5f3('0x3'));var BPromise=require(_0xc5f3('0x4'));var moment=require(_0xc5f3('0x5'));var squel=require(_0xc5f3('0x6'));var Redis=require(_0xc5f3('0x7'));var db=require(_0xc5f3('0x8'))['db'];var config=require('../../../config/environment');var logger=require(_0xc5f3('0x9'))(_0xc5f3('0xa'));config['redis']=_[_0xc5f3('0xb')](config['redis'],{'host':_0xc5f3('0xc'),'port':0x18eb});var socket=require(_0xc5f3('0xd'))(new Redis(config[_0xc5f3('0xe')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc5f3('0xf')](_0xc5f3('0x10'));function isEmail(_0xb0d597){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))*$/[_0xc5f3('0x11')](_0xb0d597);}function selectNotIn(_0x4e2ba9,_0x19b981,_0x366088,_0x1af7e8,_0x45188c){return squel[_0xc5f3('0x12')]()['field']('phone')['from'](_0x1af7e8)['join'](_0x19b981,null,_0x19b981+_0xc5f3('0x13')+_0x1af7e8+'.'+_0x366088)[_0xc5f3('0x14')](_0x1af7e8+'.'+_0x366088+_0xc5f3('0x15')+_0x4e2ba9+'.'+_0x366088)[_0xc5f3('0x14')](_0x19b981+'.dialCheckDuplicateType\x20IN\x20('+_0x45188c[_0xc5f3('0x16')]()+')');}function insertCmHopper(_0x4fe77c,_0x2b30f0,_0x58f08c,_0x4b5d92,_0x41778e){var _0xccab74=[_0xc5f3('0x17'),_0xc5f3('0x18'),_0xc5f3('0x19'),_0xc5f3('0x1a'),_0x2b30f0+'.'+_0x4b5d92,_0xc5f3('0x1b'),_0xc5f3('0x1c'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x41778e+'\x22'];return squel['insert']()['into'](_0xc5f3('0x1d'))[_0xc5f3('0x1e')]([_0xc5f3('0x1f'),'scheduledat','ContactId','ListId',_0x4b5d92,_0xc5f3('0x20'),_0xc5f3('0x21'),_0xc5f3('0x22'),_0xc5f3('0x23'),_0xc5f3('0x24')],squel[_0xc5f3('0x12')]()[_0xc5f3('0x25')](_0xccab74)[_0xc5f3('0x26')](_0x2b30f0)['join'](_0xc5f3('0x27'),null,_0xc5f3('0x28')+_0x2b30f0+_0xc5f3('0x29'))[_0xc5f3('0x16')](_0x58f08c,null,_0x58f08c+_0xc5f3('0x13')+_0x2b30f0+'.'+_0x4b5d92)[_0xc5f3('0x14')](_0x2b30f0+_0xc5f3('0x2a'),_0x4fe77c)[_0xc5f3('0x14')](_0xc5f3('0x2b'),NOW)['where'](_0xc5f3('0x2c'),selectNotIn(_0x2b30f0,_0x58f08c,_0x4b5d92,_0xc5f3('0x1d'),[_0xc5f3('0x2d'),_0xc5f3('0x2e')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2b30f0,_0x58f08c,_0x4b5d92,_0xc5f3('0x1d'),[_0xc5f3('0x2d')])))['toString']();}function insertCmHopperBlack(_0x5d6b3c,_0x2bf4c1,_0x57c871,_0x3eb63d){var _0x333ad3=[_0xc5f3('0x17'),'cm_contacts.id',_0xc5f3('0x1a'),_0x2bf4c1+'.'+_0x3eb63d,_0xc5f3('0x1b'),_0xc5f3('0x1c')];return squel['insert']()[_0xc5f3('0x2f')]('cm_hopper_black')[_0xc5f3('0x1e')]([_0xc5f3('0x1f'),_0xc5f3('0x30'),_0xc5f3('0x31'),_0x3eb63d,_0xc5f3('0x20'),_0xc5f3('0x21')],squel[_0xc5f3('0x12')]()['fields'](_0x333ad3)['from'](_0x2bf4c1)['join'](_0xc5f3('0x27'),null,_0xc5f3('0x28')+_0x2bf4c1+_0xc5f3('0x29'))[_0xc5f3('0x16')](_0x57c871,null,_0x57c871+'.id\x20=\x20'+_0x2bf4c1+'.'+_0x3eb63d)[_0xc5f3('0x14')](_0x2bf4c1+_0xc5f3('0x2a'),_0x5d6b3c)[_0xc5f3('0x14')](_0xc5f3('0x2b'),NOW)[_0xc5f3('0x14')](_0xc5f3('0x2c'),squel['select']()[_0xc5f3('0x32')](_0xc5f3('0x1f'))[_0xc5f3('0x26')](_0xc5f3('0x33'))[_0xc5f3('0x14')](_0xc5f3('0x34'),_0x5d6b3c)['where'](_0x3eb63d+_0xc5f3('0x35'),_0x2bf4c1+'.'+_0x3eb63d)))[_0xc5f3('0x36')]();}function insertCmContact(_0x2951d1,_0xb9e7fa,_0x2c27d3,_0x33c879){var _0x11758b=_[_0xc5f3('0x37')](_['keys'](_0x33c879),[_0xc5f3('0x31'),_0xc5f3('0x38'),'createdAt',_0xc5f3('0x21')]);return squel[_0xc5f3('0x39')]()[_0xc5f3('0x2f')](_0xc5f3('0x27'))[_0xc5f3('0x1e')](_0x11758b,squel[_0xc5f3('0x12')]()[_0xc5f3('0x25')](_0x11758b)['from'](_0xb9e7fa)['where']('('+_0x2c27d3['join'](',')+_0xc5f3('0x3a'),squel[_0xc5f3('0x12')]()[_0xc5f3('0x25')](_0x2c27d3)[_0xc5f3('0x26')](_0xc5f3('0x27'))[_0xc5f3('0x14')]('ListId\x20=\x20?',_0x2951d1)[_0xc5f3('0x14')]('deletedAt\x20IS\x20NULL'))['where'](_0xc5f3('0x3b'),squel[_0xc5f3('0x12')]()[_0xc5f3('0x32')](_0xc5f3('0x3c'),_0xc5f3('0x3d'))[_0xc5f3('0x26')](_0xb9e7fa)[_0xc5f3('0x3e')](_0x2c27d3[_0xc5f3('0x16')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x566be2){logger[_0xc5f3('0x3f')](_0x566be2[_0xc5f3('0x40')]);process[_0xc5f3('0x41')](0x1);}function handleError(_0x16838b,_0x54cd78){stats[_0xc5f3('0x42')][_0xc5f3('0x43')]({'name':_0x54cd78['code'],'message':_0x54cd78[_0xc5f3('0x40')],'row':_0x16838b});}function handleQuery(_0x562bea){logger[_0xc5f3('0x44')](_0x562bea);return db[_0xc5f3('0x45')][_0xc5f3('0x46')](_0x562bea)[_0xc5f3('0x47')](function(_0xbe2b1d){results[_0xc5f3('0x43')](_0xbe2b1d);})[_0xc5f3('0x48')](function(_0x3bd42b){logger['error'](_0x3bd42b[_0xc5f3('0x40')]);});}function main(_0x11ec1d,_0x439912,_0x54c769,_0x26a448){logger['info']('main',_0x11ec1d,JSON['stringify'](_0x439912));process[_0xc5f3('0x49')](_0xc5f3('0x4a'));var _0xc176e9=_0x439912['binding'];var _0x49e225=_0x439912[_0xc5f3('0x4b')];var _0x5bfae3=path[_0xc5f3('0x16')](config[_0xc5f3('0x4c')],_0xc5f3('0x4d'),_0x49e225+_0xc5f3('0x4e'));var _0x4f6459=_['keys'](_0xc176e9)[_0xc5f3('0x16')]();logger['info'](_0xc5f3('0x4f'),_0x4f6459);fs['writeFileSync'](_0x5bfae3,_0x4f6459+'\x0a');Papa[_0xc5f3('0x50')](fs[_0xc5f3('0x51')](_0x11ec1d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c1e8a,_0x453994){try{for(var _0x577603=0x0,_0x4261b9=[];_0x577603<_0x2c1e8a[_0xc5f3('0x52')][_0xc5f3('0x53')];_0x577603++){stats[_0xc5f3('0x54')]+=0x1;if(_0x2c1e8a[_0xc5f3('0x42')][_0x577603]){handleError(_0x2c1e8a[_0xc5f3('0x52')][_0x577603],_0x2c1e8a['errors'][_0x577603]);}else{var _0x3cb466=[];for(var _0x585540 in _0xc176e9){if(_0xc176e9[_0xc5f3('0x55')](_0x585540)){if(_0x2c1e8a['data'][_0x577603][_0xc176e9[_0x585540]]){var _0x5d3da8=_[_0xc5f3('0x56')](_0x2c1e8a['data'][_0x577603][_0xc176e9[_0x585540]][_0xc5f3('0x57')](/"/g,'\x27'));switch(_0x585540){case'scheduledat':var _0x1c85fe=moment(_0x5d3da8,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1c85fe[_0xc5f3('0x58')]()){_0x4261b9[_0xc5f3('0x43')]('\x22'+_0x5d3da8+'\x22');}else{_0x3cb466[_0xc5f3('0x43')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x465416=parseInt(_0x5d3da8);_0x5d3da8=_[_0xc5f3('0x59')](_0x465416)||_0x465416<0x0||_0x465416>0x4?_0x26a448?0x3:0x2:_0x465416;_0x4261b9[_0xc5f3('0x43')]('\x22'+_0x5d3da8+'\x22');break;case _0xc5f3('0x23'):var _0xbc1be0=parseInt(_0x5d3da8);if(_[_0xc5f3('0x5a')](_0xbc1be0)&&_[_0xc5f3('0x5b')](_0x54c769,_0xbc1be0)){_0x4261b9[_0xc5f3('0x43')]('\x22'+_0xbc1be0+'\x22');}else{_0x3cb466['push'](_0xc5f3('0x5c'));}break;case _0xc5f3('0x5d'):if(isEmail(_0x5d3da8)){_0x4261b9['push']('\x22'+_0x5d3da8+'\x22');}else{_0x3cb466['push'](_0xc5f3('0x5e'));}break;case'dateOfBirth':var _0x545139=moment(_0x5d3da8,'YYYY-MM-DD',!![]);if(_0x545139[_0xc5f3('0x58')]()){_0x4261b9['push']('\x22'+_0x5d3da8+'\x22');}else{_0x3cb466['push'](_0xc5f3('0x5f'));}break;default:_0x4261b9[_0xc5f3('0x43')]('\x22'+_0x5d3da8+'\x22');}}else{switch(_0x585540){case _0xc5f3('0x60'):case _0xc5f3('0x1f'):_0x3cb466['push'](_0x585540+'\x20not\x20specified');break;default:_0x4261b9['push']('\x22\x22');}}}}if(_0x3cb466[_0xc5f3('0x53')]){handleError(_0x2c1e8a[_0xc5f3('0x52')][_0x577603],{'code':'SystemRow','message':_0x3cb466[_0xc5f3('0x16')]()});}else{fs[_0xc5f3('0x61')](_0x5bfae3,_0x4261b9[_0xc5f3('0x16')]()+'\x0a');}_0x4261b9=[];}if(!(stats[_0xc5f3('0x54')]%0xc8)){socket[_0xc5f3('0x62')](_0xc5f3('0x63')+_0x49e225,stats);stats[_0xc5f3('0x42')]=[];}}if(stopped){logger[_0xc5f3('0x44')](_0xc5f3('0x64'));_0x453994[_0xc5f3('0x65')]();}}catch(_0x430152){handleError(_0x2c1e8a['data'][_0x577603],{'code':'SystemError','message':_0x430152[_0xc5f3('0x40')]});logger[_0xc5f3('0x3f')]('step',_0x430152[_0xc5f3('0x40')]);}},'complete':function(){try{var _0x260484=[];var _0x2f5691=_0xc5f3('0x27');if(_0x439912['duplicates']&&_0x439912[_0xc5f3('0x66')][_0xc5f3('0x53')]){_0x2f5691='cm_contacts_'+_0x49e225;_0x260484[_0xc5f3('0x43')](_0xc5f3('0x67')+_0x2f5691+_0xc5f3('0x68'));}var _0x1d1ee7=util[_0xc5f3('0xf')](_0xc5f3('0x69'),_0x5bfae3,_0x2f5691,_0x4f6459,_0x439912[_0xc5f3('0x31')],_0x439912[_0xc5f3('0x38')]||null,NOW,NOW);if(_[_0xc5f3('0x6a')](_0xc176e9[_0xc5f3('0x6b')])){_0x1d1ee7+=',\x20scheduledAt\x20=\x20NOW()';}_0x260484['push'](_0x1d1ee7);if(_0x439912[_0xc5f3('0x66')]&&_0x439912[_0xc5f3('0x66')][_0xc5f3('0x53')]){_0x260484['push'](insertCmContact(_0x439912[_0xc5f3('0x31')],_0x2f5691,_0x439912[_0xc5f3('0x66')],_0xc176e9));_0x260484[_0xc5f3('0x43')]('DROP\x20TABLE\x20'+_0x2f5691+';');}_0x260484['push'](insertCmHopper(_0x439912[_0xc5f3('0x31')],_0xc5f3('0x6c'),_0xc5f3('0x6d'),_0xc5f3('0x6e'),_0x26a448));_0x260484[_0xc5f3('0x43')](insertCmHopperBlack(_0x439912[_0xc5f3('0x31')],'voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId'));_0x260484[_0xc5f3('0x43')](insertCmHopper(_0x439912['ListId'],_0xc5f3('0x6f'),_0xc5f3('0x70'),'CampaignId',_0x26a448));_0x260484['push'](insertCmHopperBlack(_0x439912[_0xc5f3('0x31')],_0xc5f3('0x71'),'campaigns',_0xc5f3('0x72')));BPromise[_0xc5f3('0x73')](_0x260484,handleQuery)[_0xc5f3('0x74')](function(_0xdac82b){stats[_0xc5f3('0x75')]=!![];stats[_0xc5f3('0x76')]=_0x439912[_0xc5f3('0x66')]&&_0x439912[_0xc5f3('0x66')][_0xc5f3('0x53')]?results[0x2][_0xc5f3('0x76')]:results[0x0]['affectedRows'];socket[_0xc5f3('0x62')]('contact:import:'+_0x49e225,stats);fs[_0xc5f3('0x77')](_0x11ec1d);fs[_0xc5f3('0x77')](_0x5bfae3);process[_0xc5f3('0x41')](0x0);})[_0xc5f3('0x48')](function(_0x57afef){logger['error'](_0x57afef[_0xc5f3('0x40')]);process[_0xc5f3('0x41')](0x1);});}catch(_0xf7c214){logger[_0xc5f3('0x3f')]('complete',_0xf7c214[_0xc5f3('0x40')]);process[_0xc5f3('0x41')](0x1);}},'error':function(_0x4a11a7,_0x1a48cc,_0x6b96e3,_0xeacee2){throw new Error(_0xeacee2);}});}function validate(){if(process[_0xc5f3('0x78')]&&process['argv']['length']<0x4){throw new Error(_0xc5f3('0x79'));}var _0x3f4d10=path[_0xc5f3('0x16')](config['root'],_0xc5f3('0x4d'),process['argv'][0x2]);if(!fs['existsSync'](_0x3f4d10)){throw new Error(_0xc5f3('0x7a'));}var _0x1e0ee0={};try{_0x1e0ee0=JSON[_0xc5f3('0x50')](process['argv'][0x3]);if(!_0x1e0ee0[_0xc5f3('0x7b')]){throw new Error(_0xc5f3('0x7c'));}if(!_0x1e0ee0[_0xc5f3('0x7b')][_0xc5f3('0x1f')]){throw new Error(_0xc5f3('0x7d'));}if(!_0x1e0ee0['binding'][_0xc5f3('0x60')]){throw new Error(_0xc5f3('0x7e'));}var _0x2fc6ca=0x0;if(_0x1e0ee0[_0xc5f3('0x7b')]['UserId']){_0x2fc6ca=0x1;}if(!_0x1e0ee0[_0xc5f3('0x31')]){throw new Error(_0xc5f3('0x7f'));}}catch(_0x2cc750){throw new Error(_0xc5f3('0x80'));}var _0x13ce64=[];try{_0x13ce64=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0xb38d9c){logger[_0xc5f3('0x44')]('No\x20agent\x20available');}main(_0x3f4d10,_0x1e0ee0,_0x13ce64,_0x2fc6ca);}validate();process['on'](_0xc5f3('0x81'),handleStop);process['on'](_0xc5f3('0x82'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index b24885a..cf6e71e 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 _0xb090=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','destcalleridnum','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','inbound','push','variable','queue','Outbound\x20Call','toLowerCase','voice'];(function(_0x1d80ef,_0x434a30){var _0x41f77f=function(_0x5ace06){while(--_0x5ace06){_0x1d80ef['push'](_0x1d80ef['shift']());}};_0x41f77f(++_0x434a30);}(_0xb090,0xa6));var _0x0b09=function(_0x4f267a,_0x4d3149){_0x4f267a=_0x4f267a-0x0;var _0x3eafdf=_0xb090[_0x4f267a];return _0x3eafdf;};'use strict';exports[_0x0b09('0x0')]=function(_0x29a65a,_0x2a80c3){var _0x450878=[{'type':_0x0b09('0x1'),'content':_0x0b09('0x2'),'variableName':null}];switch(_0x29a65a['toLowerCase']()){case'voice':switch(_0x2a80c3['toLowerCase']()){case _0x0b09('0x3'):_0x450878[_0x0b09('0x4')]({'type':_0x0b09('0x5'),'content':'','variableName':_0x0b09('0x6')});_0x450878['push']({'type':_0x0b09('0x5'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x450878[_0x0b09('0x4')]({'type':'string','content':_0x0b09('0x7'),'variableName':null});_0x450878[_0x0b09('0x4')]({'type':_0x0b09('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x450878;};exports['getDescriptions']=function(_0x2fe7a1,_0xcd40f){var _0x410f5a=[];switch(_0x2fe7a1[_0x0b09('0x8')]()){case _0x0b09('0x9'):switch(_0xcd40f[_0x0b09('0x8')]()){case _0x0b09('0x3'):_0x410f5a=[{'type':_0x0b09('0x1'),'content':_0x0b09('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0xc'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0xd')},{'type':'keyValue','content':'','key':_0x0b09('0xe'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0xf')},{'type':'keyValue','content':'','key':_0x0b09('0x10'),'keyType':_0x0b09('0x5'),'variableName':'destexten'},{'type':_0x0b09('0xb'),'content':'','key':'Queue','keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x6')},{'type':'keyValue','content':'','key':_0x0b09('0x11'),'keyType':_0x0b09('0x5'),'variableName':'uniqueid'},{'type':_0x0b09('0xb'),'content':'','key':'Date','keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x12')},{'type':'string','content':_0x0b09('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x0b09('0x14'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x15')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x0b09('0x5'),'variableName':'destcalleridnum'},{'type':_0x0b09('0x1'),'content':_0x0b09('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x0b09('0xb'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0x0b09('0x12')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x17'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x18')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x19'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x1a')},{'type':'keyValue','content':'','key':_0x0b09('0x1b'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x1c')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x1d'),'keyType':_0x0b09('0x5'),'variableName':_0x0b09('0x1e')}];break;case'outbound':_0x410f5a=[{'type':_0x0b09('0x1'),'content':_0x0b09('0xa'),'variableName':null},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x1f'),'keyType':_0x0b09('0x5'),'keyContent':'','variableName':_0x0b09('0x20')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x21'),'keyType':_0x0b09('0x5'),'keyContent':'','variableName':_0x0b09('0x22')},{'type':'keyValue','content':'','key':_0x0b09('0x11'),'keyType':_0x0b09('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x23'),'keyType':'variable','keyContent':'','variableName':_0x0b09('0x24')},{'type':'string','content':_0x0b09('0x16')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x25'),'keyType':'variable','keyContent':'','variableName':_0x0b09('0x26')},{'type':'keyValue','content':'','key':_0x0b09('0x27'),'keyType':_0x0b09('0x5'),'keyContent':'','variableName':_0x0b09('0x28')},{'type':_0x0b09('0xb'),'content':'','key':'Duration','keyType':_0x0b09('0x5'),'keyContent':'','variableName':_0x0b09('0x29')},{'type':_0x0b09('0xb'),'content':'','key':_0x0b09('0x2a'),'keyType':_0x0b09('0x5'),'keyContent':'','variableName':_0x0b09('0x2b')}];break;}}return _0x410f5a;}; \ No newline at end of file +var _0xcf60=['uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','agentconnectAt','Agent\x20Complete','Hold\x20Time','talktime','Called\x20Number','destcalleridnum','membername','starttime','answertime','Complete\x20Time','Duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','string','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','variable','Caller\x20Name','calleridname','Queue','UniqueId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf60,0x125));var _0x0cf6=function(_0x6c8941,_0x58010b){_0x6c8941=_0x6c8941-0x0;var _0x41ded8=_0xcf60[_0x6c8941];return _0x41ded8;};'use strict';exports[_0x0cf6('0x0')]=function(_0x1de428,_0xd855ce){var _0x358c55=[{'type':'string','content':_0x0cf6('0x1'),'variableName':null}];switch(_0x1de428[_0x0cf6('0x2')]()){case _0x0cf6('0x3'):switch(_0xd855ce[_0x0cf6('0x2')]()){case _0x0cf6('0x4'):_0x358c55[_0x0cf6('0x5')]({'type':'variable','content':'','variableName':_0x0cf6('0x6')});_0x358c55[_0x0cf6('0x5')]({'type':'variable','content':'','variableName':_0x0cf6('0x7')});break;case _0x0cf6('0x8'):_0x358c55[_0x0cf6('0x5')]({'type':_0x0cf6('0x9'),'content':_0x0cf6('0xa'),'variableName':null});_0x358c55[_0x0cf6('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x358c55;};exports[_0x0cf6('0xb')]=function(_0x49d318,_0xe7c924){var _0x59ebf5=[];switch(_0x49d318[_0x0cf6('0x2')]()){case _0x0cf6('0x3'):switch(_0xe7c924['toLowerCase']()){case _0x0cf6('0x4'):_0x59ebf5=[{'type':_0x0cf6('0x9'),'content':_0x0cf6('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x0cf6('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x7')},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0xf'),'keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x10')},{'type':_0x0cf6('0xd'),'content':'','key':'Call\x20To','keyType':_0x0cf6('0xe'),'variableName':'destexten'},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x12'),'keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x13')},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x14'),'keyType':_0x0cf6('0xe'),'variableName':'agentcalledAt'},{'type':_0x0cf6('0x9'),'content':_0x0cf6('0x15'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x0cf6('0x16'),'keyType':_0x0cf6('0xe'),'variableName':'destcalleridname'},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x17'),'keyType':_0x0cf6('0xe'),'variableName':'destcalleridnum'},{'type':'string','content':_0x0cf6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x19'),'keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x1a')},{'type':_0x0cf6('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x1b')},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x1c'),'keyType':_0x0cf6('0xe'),'variableName':'agentcompleteAt'},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x1d'),'keyType':_0x0cf6('0xe'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x0cf6('0xe'),'variableName':_0x0cf6('0x1e')}];break;case _0x0cf6('0x8'):_0x59ebf5=[{'type':'string','content':_0x0cf6('0xc'),'variableName':null},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x1f'),'keyType':_0x0cf6('0xe'),'keyContent':'','variableName':_0x0cf6('0x20')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0x0cf6('0xe'),'keyContent':'','variableName':_0x0cf6('0x21')},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x12'),'keyType':_0x0cf6('0xe'),'keyContent':'','variableName':'uniqueid'},{'type':_0x0cf6('0xd'),'content':'','key':'Date','keyType':_0x0cf6('0xe'),'keyContent':'','variableName':_0x0cf6('0x22')},{'type':'string','content':_0x0cf6('0x18')},{'type':_0x0cf6('0xd'),'content':'','key':'Answer\x20Time','keyType':_0x0cf6('0xe'),'keyContent':'','variableName':_0x0cf6('0x23')},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x24'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0x0cf6('0xd'),'content':'','key':_0x0cf6('0x25'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x0cf6('0x26'),'keyType':_0x0cf6('0xe'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x59ebf5;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a6ee72a..8b4bb70 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 _0xc71b=['name','stringify','null','Interaction','findOne','then','info','tracked','body','omit','html','mobile','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase'];(function(_0x23e1ed,_0x58841d){var _0x321717=function(_0x5e16aa){while(--_0x5e16aa){_0x23e1ed['push'](_0x23e1ed['shift']());}};_0x321717(++_0x58841d);}(_0xc71b,0x6c));var _0xbc71=function(_0x6957f6,_0x3b6f06){_0x6957f6=_0x6957f6-0x0;var _0x364ff6=_0xc71b[_0x6957f6];return _0x364ff6;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xbc71('0x0'))(_0xbc71('0x1')),'mail':require(_0xbc71('0x0'))('mail-interactions'),'fax':require(_0xbc71('0x0'))(_0xbc71('0x2')),'sms':require(_0xbc71('0x0'))(_0xbc71('0x3')),'chat':require(_0xbc71('0x0'))(_0xbc71('0x4')),'whatsapp':require('../../config/logger')(_0xbc71('0x5'))};function getInteractionId(_0xd86612,_0x262ddd,_0x484c16){if(_0xd86612&&_0xd86612[_[_0xbc71('0x6')](_0x484c16)+_0xbc71('0x7')]){return _0xd86612[_['upperFirst'](_0x484c16)+_0xbc71('0x7')];}else if(_0xd86612&&_0xd86612['id']){return _0xd86612['id'];}else if(_0x262ddd&&_0x262ddd['id']){return _0x262ddd['id'];}else{return _0xbc71('0x8');}}function log(_0x373721,_0x50b9aa,_0x32b3a,_0x2189fc,_0x2dcf10,_0x3c7815){loggers[_0x2dcf10[_0xbc71('0x9')]()][_0x373721](_0xbc71('0xa'),_0x3c7815[_0xbc71('0xb')](),_0x50b9aa?_0x50b9aa['id']:null,_0x50b9aa?_0x50b9aa[_0xbc71('0xc')]:null,_0x50b9aa?_0x50b9aa['role']:null,getInteractionId(_0x32b3a,_0x2189fc,_0x2dcf10),_0x32b3a?JSON[_0xbc71('0xd')](_0x32b3a):_0xbc71('0xe'));}function updateUser(_0x1bf576,_0x2e02a7,_0x4692b1,_0x4a467e,_0x9198f3){db[_[_0xbc71('0x6')](_0x4a467e)+_0xbc71('0xf')][_0xbc71('0x10')]({'where':{'id':getInteractionId(_0x2e02a7,_0x4692b1,_0x4a467e)}})[_0xbc71('0x11')](function(_0x1ad76a){if(_0x1ad76a){return _0x1ad76a['update']({'UserId':_0x1bf576?_0x1bf576['id']:null});}})[_0xbc71('0x11')](function(_0x19ea6d){if(_0x19ea6d){log(_0xbc71('0x12'),_0x1bf576,_0x2e02a7,_0x4692b1,_0x4a467e,_0x9198f3);}})['catch'](function(){log('error',_0x1bf576,_0x2e02a7,_0x4692b1,_0x4a467e,_0x9198f3);});}exports[_0xbc71('0x13')]=function(_0x14806b,_0x183856){return function(_0x230cbb,_0x83f743,_0x1d2e7f){var _0x361aa0=_0x230cbb['user'];var _0x4bbcac={};var _0x2cad39=_0x230cbb['query'];if(_0x4bbcac){_0x4bbcac=_['clone'](_0x230cbb[_0xbc71('0x14')]);_0x4bbcac=_[_0xbc71('0x15')](_0x4bbcac,['body',_0xbc71('0x16'),'phone','fax',_0xbc71('0x17')]);}updateUser(_0x361aa0,_0x4bbcac,_0x2cad39,_0x14806b,_0x183856);_0x1d2e7f(null);};}; \ No newline at end of file +var _0xcc19=['then','catch','error','tracked','user','query','body','omit','html','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne'];(function(_0x301736,_0xdeac62){var _0x4927b0=function(_0x833bc4){while(--_0x833bc4){_0x301736['push'](_0x301736['shift']());}};_0x4927b0(++_0xdeac62);}(_0xcc19,0xea));var _0x9cc1=function(_0x5b6ffe,_0x280e9a){_0x5b6ffe=_0x5b6ffe-0x0;var _0x5f2d56=_0xcc19[_0x5b6ffe];return _0x5f2d56;};'use strict';var _=require(_0x9cc1('0x0'));var db=require(_0x9cc1('0x1'))['db'];var loggers={'openchannel':require(_0x9cc1('0x2'))(_0x9cc1('0x3')),'mail':require(_0x9cc1('0x2'))('mail-interactions'),'fax':require('../../config/logger')(_0x9cc1('0x4')),'sms':require(_0x9cc1('0x2'))(_0x9cc1('0x5')),'chat':require(_0x9cc1('0x2'))('chat-interactions'),'whatsapp':require(_0x9cc1('0x2'))(_0x9cc1('0x6'))};function getInteractionId(_0x3f64d2,_0x4208cd,_0x85731d){if(_0x3f64d2&&_0x3f64d2[_[_0x9cc1('0x7')](_0x85731d)+'InteractionId']){return _0x3f64d2[_[_0x9cc1('0x7')](_0x85731d)+_0x9cc1('0x8')];}else if(_0x3f64d2&&_0x3f64d2['id']){return _0x3f64d2['id'];}else if(_0x4208cd&&_0x4208cd['id']){return _0x4208cd['id'];}else{return _0x9cc1('0x9');}}function log(_0x44994c,_0x4fa96f,_0x1002c9,_0x71e31c,_0x20391c,_0x2bf3c0){loggers[_0x20391c['toLowerCase']()][_0x44994c](_0x9cc1('0xa'),_0x2bf3c0[_0x9cc1('0xb')](),_0x4fa96f?_0x4fa96f['id']:null,_0x4fa96f?_0x4fa96f[_0x9cc1('0xc')]:null,_0x4fa96f?_0x4fa96f[_0x9cc1('0xd')]:null,getInteractionId(_0x1002c9,_0x71e31c,_0x20391c),_0x1002c9?JSON[_0x9cc1('0xe')](_0x1002c9):_0x9cc1('0xf'));}function updateUser(_0x35a1bf,_0x5ab05d,_0xedcec0,_0x360206,_0x25f5ab){db[_[_0x9cc1('0x7')](_0x360206)+_0x9cc1('0x10')][_0x9cc1('0x11')]({'where':{'id':getInteractionId(_0x5ab05d,_0xedcec0,_0x360206)}})[_0x9cc1('0x12')](function(_0x31b7da){if(_0x31b7da){return _0x31b7da['update']({'UserId':_0x35a1bf?_0x35a1bf['id']:null});}})['then'](function(_0x3cd6bc){if(_0x3cd6bc){log('info',_0x35a1bf,_0x5ab05d,_0xedcec0,_0x360206,_0x25f5ab);}})[_0x9cc1('0x13')](function(){log(_0x9cc1('0x14'),_0x35a1bf,_0x5ab05d,_0xedcec0,_0x360206,_0x25f5ab);});}exports[_0x9cc1('0x15')]=function(_0x6dcbda,_0x51eb22){return function(_0x2399d4,_0x1f1a42,_0x55a7eb){var _0x21bb37=_0x2399d4[_0x9cc1('0x16')];var _0x4a1507={};var _0x2dc2a8=_0x2399d4[_0x9cc1('0x17')];if(_0x4a1507){_0x4a1507=_['clone'](_0x2399d4[_0x9cc1('0x18')]);_0x4a1507=_[_0x9cc1('0x19')](_0x4a1507,[_0x9cc1('0x18'),_0x9cc1('0x1a'),'phone','fax',_0x9cc1('0x1b')]);}updateUser(_0x21bb37,_0x4a1507,_0x2dc2a8,_0x6dcbda,_0x51eb22);_0x55a7eb(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c75725b..04dff6c 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 _0x96be=['../../mysqldb','../../config/environment','data1','license','createDecipher','update','base64','utf8','final','parse','License','findOne','then','count','status','format','catch','admin','user','isUserLimit','crypto','util','composable-middleware'];(function(_0x29406f,_0x4d8c4b){var _0x115480=function(_0x34c583){while(--_0x34c583){_0x29406f['push'](_0x29406f['shift']());}};_0x115480(++_0x4d8c4b);}(_0x96be,0x1c9));var _0xe96b=function(_0x277e57,_0x19d5e8){_0x277e57=_0x277e57-0x0;var _0x583b6a=_0x96be[_0x277e57];return _0x583b6a;};'use strict';var crypto=require(_0xe96b('0x0'));var util=require(_0xe96b('0x1'));var compose=require(_0xe96b('0x2'));var db=require(_0xe96b('0x3'))['db'];var config=require(_0xe96b('0x4'));function getValueFromLicense(_0x100565,_0xb80816){if(_0x100565&&_0xb80816){if(_0xb80816[_0xe96b('0x5')]&&_0xb80816[_0xe96b('0x6')]){var _0x38e199=_0xb80816[_0xe96b('0x5')];var _0x526108=_0xb80816[_0xe96b('0x6')];var _0x4ff793=_0x38e199['split']('-')[0x4];var _0x4ffa3b=_0x38e199['split']('-')[0x0];var _0x18e309=crypto[_0xe96b('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x4ff793,_0x38e199,_0x4ffa3b));var _0x2fdd54=_0x18e309[_0xe96b('0x8')](_0x526108,_0xe96b('0x9'),_0xe96b('0xa'));_0x2fdd54+=_0x18e309[_0xe96b('0xb')](_0xe96b('0xa'));var _0x1c692a=JSON[_0xe96b('0xc')](_0x2fdd54);return _0x1c692a['hasOwnProperty'](_0x100565)?_0x1c692a[_0x100565]:null;}}return null;}function isLimit(_0x31fb57,_0x3c2388,_0x23d1a9,_0x141618){var _0x167c39=_0x3c2388;return compose()['use'](function(_0x206751,_0x54b61e,_0x58caa4){return db[_0xe96b('0xd')][_0xe96b('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xe96b('0xf')](function(_0x29d8a6){var _0x29cf81=getValueFromLicense(_0x31fb57,_0x29d8a6);return _0x29cf81?_0x29cf81:_0x167c39;})[_0xe96b('0xf')](function(_0x5b454c){_0x167c39=_0x5b454c;return _0x23d1a9[_0xe96b('0x10')](_0x141618);})[_0xe96b('0xf')](function(_0x1fe92f){if(_0x1fe92f>=_0x167c39){return _0x54b61e[_0xe96b('0x11')](0x193)['json']({'message':util[_0xe96b('0x12')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x31fb57)});}_0x58caa4();})[_0xe96b('0x13')](function(_0x3216c5){_0x58caa4(_0x3216c5);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0xe96b('0x14')},{'role':_0xe96b('0x15')}]}});}exports[_0xe96b('0x16')]=isUserLimit; \ No newline at end of file +var _0x6462=['update','base64','utf8','parse','use','License','then','status','json','users','User','user','isUserLimit','crypto','util','composable-middleware','data1','license','split','aes-256-ctr','format','%s:%s:%s'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x6462,0x65));var _0x2646=function(_0x55decc,_0x112aa4){_0x55decc=_0x55decc-0x0;var _0x10ec8a=_0x6462[_0x55decc];return _0x10ec8a;};'use strict';var crypto=require(_0x2646('0x0'));var util=require(_0x2646('0x1'));var compose=require(_0x2646('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1fda6f,_0x15f379){if(_0x1fda6f&&_0x15f379){if(_0x15f379[_0x2646('0x3')]&&_0x15f379[_0x2646('0x4')]){var _0x1ca4e0=_0x15f379[_0x2646('0x3')];var _0x46272b=_0x15f379['license'];var _0x23457d=_0x1ca4e0['split']('-')[0x4];var _0x3280e4=_0x1ca4e0[_0x2646('0x5')]('-')[0x0];var _0x156b83=crypto['createDecipher'](_0x2646('0x6'),util[_0x2646('0x7')](_0x2646('0x8'),_0x23457d,_0x1ca4e0,_0x3280e4));var _0xc069ba=_0x156b83[_0x2646('0x9')](_0x46272b,_0x2646('0xa'),_0x2646('0xb'));_0xc069ba+=_0x156b83['final']('utf8');var _0xf42e72=JSON[_0x2646('0xc')](_0xc069ba);return _0xf42e72['hasOwnProperty'](_0x1fda6f)?_0xf42e72[_0x1fda6f]:null;}}return null;}function isLimit(_0x145b37,_0x293e5a,_0x4878a1,_0x2c53a1){var _0x337bb7=_0x293e5a;return compose()[_0x2646('0xd')](function(_0x3ff7ad,_0x1efb7d,_0x341ac7){return db[_0x2646('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x2646('0xf')](function(_0x212697){var _0x6ed4d3=getValueFromLicense(_0x145b37,_0x212697);return _0x6ed4d3?_0x6ed4d3:_0x337bb7;})[_0x2646('0xf')](function(_0x23d8e0){_0x337bb7=_0x23d8e0;return _0x4878a1['count'](_0x2c53a1);})[_0x2646('0xf')](function(_0x38a75c){if(_0x38a75c>=_0x337bb7){return _0x1efb7d[_0x2646('0x10')](0x193)[_0x2646('0x11')]({'message':util[_0x2646('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x145b37)});}_0x341ac7();})['catch'](function(_0x25b3aa){_0x341ac7(_0x25b3aa);});});}function isUserLimit(){return isLimit(_0x2646('0x12'),0x1,db[_0x2646('0x13')],{'where':{'$or':[{'role':'admin'},{'role':_0x2646('0x14')}]}});}exports[_0x2646('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index c92beed..3f3ebec 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 _0x6ac1=['<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','>=\x20?','$between','$in','start','$substring','pop','DATE','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','replace','split','shift','forEach','indexOf','conditions','push','buildExpression','operator','$eq','value','$gt','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?'];(function(_0x98e64f,_0x4f0e9a){var _0x4b7dab=function(_0x5e6789){while(--_0x5e6789){_0x98e64f['push'](_0x98e64f['shift']());}};_0x4b7dab(++_0x4f0e9a);}(_0x6ac1,0x140));var _0x16ac=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x6ac1[_0x319784];return _0x1917da;};'use strict';var _=require(_0x16ac('0x0'));var moment=require(_0x16ac('0x1'));exports[_0x16ac('0x2')]=function(_0x14d954){var _0x210dd6={'conditions':[]};_0x210dd6['sqlOperator']=_[_0x16ac('0x3')](_0x14d954,_0x16ac('0x4'))?'or':'and';var _0xcb04ce=_0x14d954[_0x16ac('0x5')]('[$and]','')[_0x16ac('0x5')]('[$or]','')[_0x16ac('0x6')]('||');for(var _0x4c760c=0x0;_0x4c760c<_0xcb04ce['length'];_0x4c760c++){var _0x578698=_0xcb04ce[_0x4c760c][_0x16ac('0x6')](':=');var _0x258b5c=_0x578698[0x0];var _0x1e8538=_0x578698['slice'](0x1);_0x1e8538['forEach'](function(_0x24925e){var _0x2f9b10=_0x24925e[_0x16ac('0x6')]('[')[_0x16ac('0x7')]();var _0x147d1d=_0x24925e['match'](/\[(.*?)\]/g);_0x147d1d[_0x16ac('0x8')](function(_0x4cd352){var _0x4ba194=_0x4cd352['split']('[')['filter'](function(_0xbaab2b){return _0xbaab2b[_0x16ac('0x9')](']')>-0x1;})['map'](function(_0x28e059){return _0x28e059['split'](']')[0x0];})[0x0];_0x210dd6[_0x16ac('0xa')][_0x16ac('0xb')]({'field':_0x258b5c,'operator':_0x2f9b10,'value':_0x4ba194});});});}return _0x210dd6;};exports[_0x16ac('0xc')]=function(_0x422488,_0x49e2ab,_0x12a162){var _0x68d454={};if(_0x49e2ab==='DATE'){if(_0x12a162[_0x16ac('0xd')]===_0x16ac('0xe')){_0x12a162[_0x16ac('0xd')]='$between';_0x12a162[_0x16ac('0xf')]+=','+_0x12a162['value'];}else if(_['includes']([_0x16ac('0x10'),'$lte'],_0x12a162[_0x16ac('0xd')])){_0x12a162[_0x16ac('0xf')]=moment(_0x12a162[_0x16ac('0xf')])['add'](0x1,_0x16ac('0x11'))[_0x16ac('0x12')](_0x16ac('0x13'));}}if(_0x12a162[_0x16ac('0x14')]){_0x49e2ab=_0x12a162[_0x16ac('0x14')];_0x68d454[_0x16ac('0x15')]='CAST('+_0x422488+'.'+_0x12a162[_0x16ac('0x16')]+_0x16ac('0x17')+_0x12a162[_0x16ac('0x14')]+')\x20'+parseOperator(_0x12a162[_0x16ac('0xd')]);}else{_0x68d454[_0x16ac('0x15')]=_0x422488+'.'+_0x12a162[_0x16ac('0x16')]+'\x20'+parseOperator(_0x12a162['operator']);}if(_[_0x16ac('0x18')]([_0x16ac('0x19'),_0x16ac('0x1a')],_0x12a162['operator']))_0x68d454[_0x16ac('0x15')]='('+_0x68d454[_0x16ac('0x15')]+_0x16ac('0x1b')+_0x422488+'.'+_0x12a162[_0x16ac('0x16')]+_0x16ac('0x1c');_0x68d454[_0x16ac('0xf')]=parseValue(_0x49e2ab,_0x12a162[_0x16ac('0xd')],_0x12a162[_0x16ac('0xf')]);return _0x68d454;};function parseOperator(_0x45735e){var _0x39cb56;switch(_0x45735e){case'$in':_0x39cb56=_0x16ac('0x1d');break;case _0x16ac('0x1a'):_0x39cb56='NOT\x20IN\x20?';break;case'$eq':_0x39cb56='=\x20?';break;case'$ne':_0x39cb56=_0x16ac('0x1e');break;case'$substring':case _0x16ac('0x1f'):case'$endsWith':_0x39cb56=_0x16ac('0x20');break;case _0x16ac('0x21'):_0x39cb56=_0x16ac('0x22');break;case _0x16ac('0x10'):_0x39cb56=_0x16ac('0x23');break;case _0x16ac('0x24'):_0x39cb56=_0x16ac('0x25');break;case'$gte':_0x39cb56=_0x16ac('0x26');break;case _0x16ac('0x27'):_0x39cb56='BETWEEN\x20?\x20AND\x20?';break;}return _0x39cb56;}function parseValue(_0x5bc632,_0x1eb815,_0x5baed3){var _0xedc4b2={'start':undefined,'end':undefined};switch(_0x1eb815){case _0x16ac('0x28'):case'$notIn':_0xedc4b2[_0x16ac('0x29')]=_0x5baed3[_0x16ac('0x6')](',');break;case _0x16ac('0x2a'):_0xedc4b2[_0x16ac('0x29')]='%'+_0x5baed3+'%';break;case'$startsWith':_0xedc4b2['start']=_0x5baed3+'%';break;case'$endsWith':_0xedc4b2[_0x16ac('0x29')]='%'+_0x5baed3;break;case _0x16ac('0x27'):var _0x13d2ee=_0x5baed3[_0x16ac('0x6')](',');var _0x5baed3=_0x13d2ee[_0x16ac('0x7')]();var _0x52794f=_0x13d2ee[_0x16ac('0x2b')]();if(_0x5bc632===_0x16ac('0x2c')){_0x5baed3=moment(_0x5baed3)[_0x16ac('0x2d')](0x0,!![])['format']();_0x52794f=moment(_0x52794f)['utcOffset'](0x0,!![])[_0x16ac('0x2e')](0x17,_0x16ac('0x2f'))[_0x16ac('0x2e')](0x3b,_0x16ac('0x30'))[_0x16ac('0x2e')](0x3b,_0x16ac('0x31'))[_0x16ac('0x12')]();}_0xedc4b2={'start':_0x5baed3,'end':_0x52794f};break;default:_0xedc4b2[_0x16ac('0x29')]=_0x5baed3;break;}return _0xedc4b2;} \ No newline at end of file +var _0x9262=['<=\x20?','$gte','>=\x20?','start','$endsWith','shift','pop','DATE','hours','seconds','lodash','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','map','push','buildExpression','$eq','$between','value','includes','$gt','$lte','operator','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','<\x20?'];(function(_0xe31196,_0x21cdbf){var _0x4517fc=function(_0x326820){while(--_0x326820){_0xe31196['push'](_0xe31196['shift']());}};_0x4517fc(++_0x21cdbf);}(_0x9262,0x1a2));var _0x2926=function(_0x3e7cdb,_0x5cc604){_0x3e7cdb=_0x3e7cdb-0x0;var _0x2a41c9=_0x9262[_0x3e7cdb];return _0x2a41c9;};'use strict';var _=require(_0x2926('0x0'));var moment=require('moment');exports[_0x2926('0x1')]=function(_0x7cc143){var _0x963dda={'conditions':[]};_0x963dda[_0x2926('0x2')]=_['startsWith'](_0x7cc143,_0x2926('0x3'))?'or':_0x2926('0x4');var _0xfaf781=_0x7cc143[_0x2926('0x5')](_0x2926('0x6'),'')['replace']('[$or]','')[_0x2926('0x7')]('||');for(var _0x3729fd=0x0;_0x3729fd<_0xfaf781['length'];_0x3729fd++){var _0x4805c5=_0xfaf781[_0x3729fd][_0x2926('0x7')](':=');var _0x4f3fc2=_0x4805c5[0x0];var _0x3460ee=_0x4805c5[_0x2926('0x8')](0x1);_0x3460ee[_0x2926('0x9')](function(_0x2540a7){var _0x5994c8=_0x2540a7[_0x2926('0x7')]('[')['shift']();var _0x427165=_0x2540a7[_0x2926('0xa')](/\[(.*?)\]/g);_0x427165[_0x2926('0x9')](function(_0x2bfb20){var _0x5ce80c=_0x2bfb20[_0x2926('0x7')]('[')[_0x2926('0xb')](function(_0x2b925a){return _0x2b925a[_0x2926('0xc')](']')>-0x1;})[_0x2926('0xd')](function(_0x34aeb7){return _0x34aeb7[_0x2926('0x7')](']')[0x0];})[0x0];_0x963dda['conditions'][_0x2926('0xe')]({'field':_0x4f3fc2,'operator':_0x5994c8,'value':_0x5ce80c});});});}return _0x963dda;};exports[_0x2926('0xf')]=function(_0x53ae6c,_0x4c14ba,_0x4d11be){var _0x45f269={};if(_0x4c14ba==='DATE'){if(_0x4d11be['operator']===_0x2926('0x10')){_0x4d11be['operator']=_0x2926('0x11');_0x4d11be[_0x2926('0x12')]+=','+_0x4d11be[_0x2926('0x12')];}else if(_[_0x2926('0x13')]([_0x2926('0x14'),_0x2926('0x15')],_0x4d11be[_0x2926('0x16')])){_0x4d11be[_0x2926('0x12')]=moment(_0x4d11be[_0x2926('0x12')])[_0x2926('0x17')](0x1,'days')[_0x2926('0x18')](_0x2926('0x19'));}}if(_0x4d11be['castTo']){_0x4c14ba=_0x4d11be[_0x2926('0x1a')];_0x45f269[_0x2926('0x1b')]=_0x2926('0x1c')+_0x53ae6c+'.'+_0x4d11be[_0x2926('0x1d')]+_0x2926('0x1e')+_0x4d11be[_0x2926('0x1a')]+')\x20'+parseOperator(_0x4d11be[_0x2926('0x16')]);}else{_0x45f269[_0x2926('0x1b')]=_0x53ae6c+'.'+_0x4d11be[_0x2926('0x1d')]+'\x20'+parseOperator(_0x4d11be['operator']);}if(_['includes']([_0x2926('0x1f'),_0x2926('0x20')],_0x4d11be['operator']))_0x45f269[_0x2926('0x1b')]='('+_0x45f269[_0x2926('0x1b')]+_0x2926('0x21')+_0x53ae6c+'.'+_0x4d11be[_0x2926('0x1d')]+'\x20IS\x20NULL)';_0x45f269[_0x2926('0x12')]=parseValue(_0x4c14ba,_0x4d11be['operator'],_0x4d11be['value']);return _0x45f269;};function parseOperator(_0x5d1d1b){var _0x3608b9;switch(_0x5d1d1b){case _0x2926('0x22'):_0x3608b9=_0x2926('0x23');break;case'$notIn':_0x3608b9='NOT\x20IN\x20?';break;case _0x2926('0x10'):_0x3608b9=_0x2926('0x24');break;case _0x2926('0x1f'):_0x3608b9=_0x2926('0x25');break;case _0x2926('0x26'):case _0x2926('0x27'):case'$endsWith':_0x3608b9='LIKE\x20?';break;case'$lt':_0x3608b9=_0x2926('0x28');break;case'$gt':_0x3608b9='>\x20?';break;case'$lte':_0x3608b9=_0x2926('0x29');break;case _0x2926('0x2a'):_0x3608b9=_0x2926('0x2b');break;case _0x2926('0x11'):_0x3608b9='BETWEEN\x20?\x20AND\x20?';break;}return _0x3608b9;}function parseValue(_0x1069a8,_0x4690ac,_0x2ee45e){var _0x5828ff={'start':undefined,'end':undefined};switch(_0x4690ac){case _0x2926('0x22'):case _0x2926('0x20'):_0x5828ff[_0x2926('0x2c')]=_0x2ee45e[_0x2926('0x7')](',');break;case'$substring':_0x5828ff[_0x2926('0x2c')]='%'+_0x2ee45e+'%';break;case _0x2926('0x27'):_0x5828ff['start']=_0x2ee45e+'%';break;case _0x2926('0x2d'):_0x5828ff[_0x2926('0x2c')]='%'+_0x2ee45e;break;case _0x2926('0x11'):var _0x4cefc4=_0x2ee45e[_0x2926('0x7')](',');var _0x2ee45e=_0x4cefc4[_0x2926('0x2e')]();var _0x5ade94=_0x4cefc4[_0x2926('0x2f')]();if(_0x1069a8===_0x2926('0x30')){_0x2ee45e=moment(_0x2ee45e)['utcOffset'](0x0,!![])[_0x2926('0x18')]();_0x5ade94=moment(_0x5ade94)['utcOffset'](0x0,!![])[_0x2926('0x17')](0x17,_0x2926('0x31'))['add'](0x3b,'minutes')['add'](0x3b,_0x2926('0x32'))[_0x2926('0x18')]();}_0x5828ff={'start':_0x2ee45e,'end':_0x5ade94};break;default:_0x5828ff[_0x2926('0x2c')]=_0x2ee45e;break;}return _0x5828ff;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dc3d247..56f5764 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 _0xa1d3=['intersection','attributes','nolimit','sort','where','filter','merge','lower','lodash','sequelize','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','name','uniqueid','isArray','limit','offset','indexOf','col','priority','substr','DESC','cast','unsigned','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','replace','push','join','getOptions','$id','query','model','map'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0xa1d3,0xf0));var _0x3a1d=function(_0x14f132,_0x4cf31e){_0x14f132=_0x14f132-0x0;var _0x24bf39=_0xa1d3[_0x14f132];return _0x24bf39;};'use strict';var _=require(_0x3a1d('0x0'));var sequelize=require(_0x3a1d('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xd956c5){var _0x122c31=['ne'];try{var _0x35f9a3=JSON[_0x3a1d('0x2')](_0xd956c5);var _0x1ffffe=Object[_0x3a1d('0x3')](_0x35f9a3)[0x0];return _0x122c31[_0x3a1d('0x4')](_0x1ffffe);}catch(_0x3be4aa){return![];}}function getOperatorValue(_0x576c2f){var _0x32770c=JSON[_0x3a1d('0x2')](_0x576c2f);var _0x593aa9=Object['keys'](_0x32770c)[0x0];var _0x3a03a1=_0x32770c[_0x593aa9];return{['$'+_0x593aa9]:_0x3a03a1};}exports[_0x3a1d('0x5')]=function(_0x3d8dd3){var _0x4d7a04=null;if(_0x3d8dd3){_0x4d7a04=_0x3d8dd3[_0x3a1d('0x6')](',');}return _0x4d7a04;};exports[_0x3a1d('0x7')]=function(_0x31b1c1,_0x3cbca6){var _0x3a7941={};if(!_[_0x3a1d('0x8')](_0x31b1c1)){_[_0x3a1d('0x9')](_0x31b1c1,function(_0x174e00,_0x58ef11){try{if(_0x3cbca6){var _0x3934f5=_[_0x3a1d('0xa')](_0x3cbca6,{'name':_0x58ef11})||{};if(hasSequelizeOperator(_0x174e00)){_0x3a7941[_0x58ef11]=getOperatorValue(_0x174e00);}else if(_0x3934f5[_0x3a1d('0xb')]===_0x3a1d('0xc')&&_[_0x3a1d('0xd')](_0x174e00)){var _0x4d143f=JSON[_0x3a1d('0x2')](_0x174e00);var _0x363827={'$gte':moment(moment(_0x4d143f[_0x3a1d('0xe')])[_0x3a1d('0xf')](_0x3a1d('0x10')))['utc']()[_0x3a1d('0xf')](),'$lte':moment(moment(_0x4d143f[_0x3a1d('0x11')])[_0x3a1d('0xf')](_0x3a1d('0x10')))[_0x3a1d('0x12')]()['subtract'](0x1,'s')[_0x3a1d('0xf')]()};_0x3a7941[_0x58ef11]=_0x363827;}else if(_0x3934f5[_0x3a1d('0x13')]===_0x3a1d('0x14')){_0x3a7941[_0x58ef11]=_0x174e00;}else{_0x3a7941[_0x58ef11]=_[_0x3a1d('0x15')](_0x174e00)?_0x174e00:JSON['parse'](_0x174e00);}}else{_0x3a7941[_0x58ef11]=_[_0x3a1d('0x15')](_0x174e00)?_0x174e00:JSON['parse'](_0x174e00);}}catch(_0x2976bd){_0x3a7941[_0x58ef11]=_0x174e00[_0x3a1d('0x6')](',');}});}return _0x3a7941;};exports[_0x3a1d('0x16')]=function(_0xa60704){_0xa60704=parseInt(_0xa60704,0xa);if(!_0xa60704||_0xa60704<0x0){_0xa60704=LIMIT_VALUE;}return _0xa60704;};exports[_0x3a1d('0x17')]=function(_0x6aaf16){_0x6aaf16=parseInt(_0x6aaf16,0xa);if(!_0x6aaf16||_0x6aaf16<0x0){_0x6aaf16=0x0;}return _0x6aaf16;};exports['sort']=function(_0x1dd2f4){var _0x4d81ed,_0x45d77c=null;if(_0x1dd2f4){_0x4d81ed=_0x1dd2f4[_0x3a1d('0x6')](',');_0x45d77c=_['map'](_0x4d81ed,function(_0x351728){if(_0x351728[_0x3a1d('0x18')]('-')===0x0){return[_0x351728==='priority'?sequelize['cast'](sequelize[_0x3a1d('0x19')](_0x3a1d('0x1a')),'unsigned'):_0x351728[_0x3a1d('0x1b')](0x1),_0x3a1d('0x1c')];}else{return[_0x351728==='priority'?sequelize[_0x3a1d('0x1d')](sequelize[_0x3a1d('0x19')](_0x3a1d('0x1a')),_0x3a1d('0x1e')):_0x351728,_0x3a1d('0x1f')];}});}return _0x45d77c;};exports[_0x3a1d('0x20')]=function(_0x785910,_0x1eada3){if(_[_0x3a1d('0x8')](_0x785910)){return _0x785910;}if(_['isArray'](_0x785910)){for(var _0x155008=0x0;_0x155008<_0x785910[_0x3a1d('0x21')];_0x155008+=0x1){_0x785910[_0x155008]=this[_0x3a1d('0x20')](_0x785910[_0x155008],_0x1eada3);}return _0x785910;}if(!_[_0x3a1d('0x22')](_0x785910)){return _0x785910;}if(_[_0x3a1d('0x23')](_0x1eada3)){_0x1eada3=[_0x1eada3];}if(!_[_0x3a1d('0x15')](_0x1eada3)){return _0x785910;}for(var _0x35ab3e=0x0;_0x35ab3e<_0x1eada3[_0x3a1d('0x21')];_0x35ab3e+=0x1){_[_0x3a1d('0x24')](_0x785910,_0x1eada3[_0x35ab3e]);}for(var _0x13009c in _0x785910){if(_0x785910[_0x3a1d('0x25')](_0x13009c)){_0x785910[_0x13009c]=this[_0x3a1d('0x20')](_0x785910[_0x13009c],_0x1eada3);}}return _0x785910;};exports[_0x3a1d('0x26')]=function(_0x238074){return _0x238074[_0x3a1d('0x27')](RegExp(_0x3a1d('0x28')))?!![]:![];};exports['isEmail']=function(_0x25bb62){return _0x25bb62[_0x3a1d('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x3a1d('0x29')]=function(_0x182b2e){var _0x59cc29=[];_0x182b2e[_0x3a1d('0x6')](/[ ,]+/)['forEach'](function(_0x55a29f){_0x55a29f=_0x55a29f[_0x3a1d('0x2a')](/([^:]")"+/g,'$1');_0x55a29f='+'+_0x55a29f+'*';if(_0x55a29f['includes']('@'))_0x55a29f='\x22'+_0x55a29f+'\x22';_0x59cc29[_0x3a1d('0x2b')](_0x55a29f);});return _0x59cc29[_0x3a1d('0x2c')]('\x20');};exports[_0x3a1d('0x2d')]=function(_0x11f5e1,_0x547760,_0x4f9af2){var _0x12c96b={},_0x26ede6={};if(_0x547760['query'][_0x3a1d('0x2e')]){_0x547760[_0x3a1d('0x2f')]['id']=_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x2e')];delete _0x547760[_0x3a1d('0x2f')][_0x3a1d('0x2e')];}_0x12c96b[_0x3a1d('0x30')]=_[_0x3a1d('0x31')](_0x11f5e1,_0x3a1d('0x13'));_0x12c96b[_0x3a1d('0x2f')]=_[_0x3a1d('0x3')](_0x547760[_0x3a1d('0x2f')]);_0x12c96b[_0x3a1d('0x7')]=_[_0x3a1d('0x32')](_0x12c96b[_0x3a1d('0x30')],_0x12c96b['query']);_0x26ede6[_0x3a1d('0x33')]=_[_0x3a1d('0x32')](_0x12c96b[_0x3a1d('0x30')],this[_0x3a1d('0x5')](_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x5')]));_0x26ede6[_0x3a1d('0x33')]=_0x26ede6[_0x3a1d('0x33')][_0x3a1d('0x21')]?_0x26ede6[_0x3a1d('0x33')]:_0x12c96b[_0x3a1d('0x30')];if(!_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x25')](_0x3a1d('0x34'))){_0x26ede6[_0x3a1d('0x16')]=this[_0x3a1d('0x16')](_0x547760[_0x3a1d('0x2f')]['limit']);_0x26ede6['offset']=this[_0x3a1d('0x17')](_0x547760[_0x3a1d('0x2f')]['offset']);}_0x26ede6['order']=this[_0x3a1d('0x35')](_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x35')]);_0x26ede6[_0x3a1d('0x36')]=this['filters'](_['pick'](_0x547760[_0x3a1d('0x2f')],_0x12c96b[_0x3a1d('0x7')]),_0x11f5e1);if(_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x37')]){_0x26ede6['where']=_[_0x3a1d('0x38')](_0x26ede6[_0x3a1d('0x36')],{'$or':_[_0x3a1d('0x31')](_0x11f5e1,function(_0x2b0154){if(_0x2b0154[_0x3a1d('0xb')]!=='VIRTUAL'){if(_0x4f9af2){return sequelize[_0x3a1d('0x36')](sequelize['fn'](_0x3a1d('0x39'),sequelize[_0x3a1d('0x19')](_0x2b0154[_0x3a1d('0x13')])),{'$like':sequelize['fn'](_0x3a1d('0x39'),'%'+_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x37')]+'%')});}else{var _0x3117ae={};_0x3117ae[_0x2b0154[_0x3a1d('0x13')]]={'$like':'%'+_0x547760[_0x3a1d('0x2f')][_0x3a1d('0x37')]+'%'};return _0x3117ae;}}})});}_0x26ede6=_[_0x3a1d('0x38')]({},_0x26ede6,_0x547760['options']);return _0x26ede6;}; \ No newline at end of file +var _0x2c50=['isPlainObject','format','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','omit','isEmpty','length','unset','hasOwnProperty','match','isEmail','getFullTextValue','includes','join','getOptions','query','$id','model','intersection','attributes','fields','offset','order','where','pick','filter','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','split','filters','forOwn','find','type','DATE'];(function(_0x2c4a12,_0x4382b8){var _0x22cfef=function(_0x306517){while(--_0x306517){_0x2c4a12['push'](_0x2c4a12['shift']());}};_0x22cfef(++_0x4382b8);}(_0x2c50,0x1ad));var _0x02c5=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x2c50[_0x571a17];return _0x3ef337;};'use strict';var _=require(_0x02c5('0x0'));var sequelize=require(_0x02c5('0x1'));var moment=require(_0x02c5('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x64ff83){var _0x15704e=['ne'];try{var _0x5c3dfa=JSON[_0x02c5('0x3')](_0x64ff83);var _0x2e4d93=Object[_0x02c5('0x4')](_0x5c3dfa)[0x0];return _0x15704e['includes'](_0x2e4d93);}catch(_0x24cdd1){return![];}}function getOperatorValue(_0x13ee09){var _0x5eece7=JSON[_0x02c5('0x3')](_0x13ee09);var _0x39c497=Object[_0x02c5('0x4')](_0x5eece7)[0x0];var _0x2d892a=_0x5eece7[_0x39c497];return{['$'+_0x39c497]:_0x2d892a};}exports['fields']=function(_0x247c12){var _0x379e33=null;if(_0x247c12){_0x379e33=_0x247c12[_0x02c5('0x5')](',');}return _0x379e33;};exports[_0x02c5('0x6')]=function(_0x9b33c6,_0x5d49f7){var _0x403456={};if(!_['isEmpty'](_0x9b33c6)){_[_0x02c5('0x7')](_0x9b33c6,function(_0x4c0cfd,_0xe1ae7e){try{if(_0x5d49f7){var _0xce3590=_[_0x02c5('0x8')](_0x5d49f7,{'name':_0xe1ae7e})||{};if(hasSequelizeOperator(_0x4c0cfd)){_0x403456[_0xe1ae7e]=getOperatorValue(_0x4c0cfd);}else if(_0xce3590[_0x02c5('0x9')]===_0x02c5('0xa')&&_[_0x02c5('0xb')](_0x4c0cfd)){var _0x5e54dd=JSON['parse'](_0x4c0cfd);var _0xd3075c={'$gte':moment(moment(_0x5e54dd['$gte'])[_0x02c5('0xc')]('YYYY-MM-DD'))[_0x02c5('0xd')]()[_0x02c5('0xc')](),'$lte':moment(moment(_0x5e54dd[_0x02c5('0xe')])[_0x02c5('0xc')]('YYYY-MM-DD'))[_0x02c5('0xd')]()[_0x02c5('0xf')](0x1,'s')[_0x02c5('0xc')]()};_0x403456[_0xe1ae7e]=_0xd3075c;}else if(_0xce3590[_0x02c5('0x10')]===_0x02c5('0x11')){_0x403456[_0xe1ae7e]=_0x4c0cfd;}else{_0x403456[_0xe1ae7e]=_[_0x02c5('0x12')](_0x4c0cfd)?_0x4c0cfd:JSON[_0x02c5('0x3')](_0x4c0cfd);}}else{_0x403456[_0xe1ae7e]=_[_0x02c5('0x12')](_0x4c0cfd)?_0x4c0cfd:JSON[_0x02c5('0x3')](_0x4c0cfd);}}catch(_0x316200){_0x403456[_0xe1ae7e]=_0x4c0cfd[_0x02c5('0x5')](',');}});}return _0x403456;};exports[_0x02c5('0x13')]=function(_0x363750){_0x363750=parseInt(_0x363750,0xa);if(!_0x363750||_0x363750<0x0){_0x363750=LIMIT_VALUE;}return _0x363750;};exports['offset']=function(_0x4a2fea){_0x4a2fea=parseInt(_0x4a2fea,0xa);if(!_0x4a2fea||_0x4a2fea<0x0){_0x4a2fea=0x0;}return _0x4a2fea;};exports[_0x02c5('0x14')]=function(_0x1c660d){var _0x5d0943,_0x14b814=null;if(_0x1c660d){_0x5d0943=_0x1c660d['split'](',');_0x14b814=_[_0x02c5('0x15')](_0x5d0943,function(_0x37cfb3){if(_0x37cfb3[_0x02c5('0x16')]('-')===0x0){return[_0x37cfb3===_0x02c5('0x17')?sequelize[_0x02c5('0x18')](sequelize['col'](_0x02c5('0x17')),_0x02c5('0x19')):_0x37cfb3[_0x02c5('0x1a')](0x1),_0x02c5('0x1b')];}else{return[_0x37cfb3===_0x02c5('0x17')?sequelize['cast'](sequelize[_0x02c5('0x1c')](_0x02c5('0x17')),'unsigned'):_0x37cfb3,_0x02c5('0x1d')];}});}return _0x14b814;};exports[_0x02c5('0x1e')]=function(_0x5273e5,_0xf6ba1e){if(_[_0x02c5('0x1f')](_0x5273e5)){return _0x5273e5;}if(_[_0x02c5('0x12')](_0x5273e5)){for(var _0x476680=0x0;_0x476680<_0x5273e5[_0x02c5('0x20')];_0x476680+=0x1){_0x5273e5[_0x476680]=this[_0x02c5('0x1e')](_0x5273e5[_0x476680],_0xf6ba1e);}return _0x5273e5;}if(!_['isObject'](_0x5273e5)){return _0x5273e5;}if(_['isString'](_0xf6ba1e)){_0xf6ba1e=[_0xf6ba1e];}if(!_['isArray'](_0xf6ba1e)){return _0x5273e5;}for(var _0x5170ff=0x0;_0x5170ff<_0xf6ba1e[_0x02c5('0x20')];_0x5170ff+=0x1){_[_0x02c5('0x21')](_0x5273e5,_0xf6ba1e[_0x5170ff]);}for(var _0x2053d4 in _0x5273e5){if(_0x5273e5[_0x02c5('0x22')](_0x2053d4)){_0x5273e5[_0x2053d4]=this[_0x02c5('0x1e')](_0x5273e5[_0x2053d4],_0xf6ba1e);}}return _0x5273e5;};exports['isNumeric']=function(_0x372621){return _0x372621[_0x02c5('0x23')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x02c5('0x24')]=function(_0x46648c){return _0x46648c[_0x02c5('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x02c5('0x25')]=function(_0x55f2ac){var _0x48b9a7=[];_0x55f2ac[_0x02c5('0x5')](/[ ,]+/)['forEach'](function(_0x362e02){_0x362e02=_0x362e02['replace'](/([^:]")"+/g,'$1');_0x362e02='+'+_0x362e02+'*';if(_0x362e02[_0x02c5('0x26')]('@'))_0x362e02='\x22'+_0x362e02+'\x22';_0x48b9a7['push'](_0x362e02);});return _0x48b9a7[_0x02c5('0x27')]('\x20');};exports[_0x02c5('0x28')]=function(_0x54dfad,_0x35b084,_0x1c59bf){var _0x369f73={},_0x28971c={};if(_0x35b084[_0x02c5('0x29')][_0x02c5('0x2a')]){_0x35b084[_0x02c5('0x29')]['id']=_0x35b084['query'][_0x02c5('0x2a')];delete _0x35b084[_0x02c5('0x29')][_0x02c5('0x2a')];}_0x369f73[_0x02c5('0x2b')]=_[_0x02c5('0x15')](_0x54dfad,_0x02c5('0x10'));_0x369f73[_0x02c5('0x29')]=_[_0x02c5('0x4')](_0x35b084[_0x02c5('0x29')]);_0x369f73['filters']=_[_0x02c5('0x2c')](_0x369f73['model'],_0x369f73[_0x02c5('0x29')]);_0x28971c[_0x02c5('0x2d')]=_[_0x02c5('0x2c')](_0x369f73[_0x02c5('0x2b')],this[_0x02c5('0x2e')](_0x35b084[_0x02c5('0x29')]['fields']));_0x28971c[_0x02c5('0x2d')]=_0x28971c[_0x02c5('0x2d')]['length']?_0x28971c[_0x02c5('0x2d')]:_0x369f73[_0x02c5('0x2b')];if(!_0x35b084['query'][_0x02c5('0x22')]('nolimit')){_0x28971c[_0x02c5('0x13')]=this[_0x02c5('0x13')](_0x35b084[_0x02c5('0x29')]['limit']);_0x28971c[_0x02c5('0x2f')]=this[_0x02c5('0x2f')](_0x35b084[_0x02c5('0x29')]['offset']);}_0x28971c[_0x02c5('0x30')]=this['sort'](_0x35b084[_0x02c5('0x29')][_0x02c5('0x14')]);_0x28971c[_0x02c5('0x31')]=this[_0x02c5('0x6')](_[_0x02c5('0x32')](_0x35b084[_0x02c5('0x29')],_0x369f73['filters']),_0x54dfad);if(_0x35b084[_0x02c5('0x29')][_0x02c5('0x33')]){_0x28971c[_0x02c5('0x31')]=_[_0x02c5('0x34')](_0x28971c[_0x02c5('0x31')],{'$or':_[_0x02c5('0x15')](_0x54dfad,function(_0x48ed84){if(_0x48ed84[_0x02c5('0x9')]!==_0x02c5('0x35')){if(_0x1c59bf){return sequelize[_0x02c5('0x31')](sequelize['fn'](_0x02c5('0x36'),sequelize['col'](_0x48ed84['name'])),{'$like':sequelize['fn']('lower','%'+_0x35b084[_0x02c5('0x29')][_0x02c5('0x33')]+'%')});}else{var _0x244815={};_0x244815[_0x48ed84['name']]={'$like':'%'+_0x35b084[_0x02c5('0x29')][_0x02c5('0x33')]+'%'};return _0x244815;}}})});}_0x28971c=_[_0x02c5('0x34')]({},_0x28971c,_0x35b084['options']);return _0x28971c;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 906c27e..f034530 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb65f=['root','client','use','json\x20replacer','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','serve-favicon','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','../mysqldb','get','env','production','set','join','public','development','test','appPath'];(function(_0x3f05d3,_0x2b2d9e){var _0x249dc7=function(_0x26f3d4){while(--_0x26f3d4){_0x3f05d3['push'](_0x3f05d3['shift']());}};_0x249dc7(++_0x2b2d9e);}(_0xb65f,0xb4));var _0xfb65=function(_0x91cfe2,_0x5302ed){_0x91cfe2=_0x91cfe2-0x0;var _0x5e3374=_0xb65f[_0x91cfe2];return _0x5e3374;};'use strict';var express=require('express');var favicon=require(_0xfb65('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0xfb65('0x1'));var cookieParser=require(_0xfb65('0x2'));var errorHandler=require(_0xfb65('0x3'));var path=require(_0xfb65('0x4'));var passport=require(_0xfb65('0x5'));var cors=require(_0xfb65('0x6'));var moment=require('moment');var config=require(_0xfb65('0x7'));var db=require(_0xfb65('0x8'))['db'];exports['default']=function(_0xebf714){var _0x3aa899=_0xebf714[_0xfb65('0x9')](_0xfb65('0xa'));if(_0x3aa899===_0xfb65('0xb')){_0xebf714[_0xfb65('0xc')]('appPath',path[_0xfb65('0xd')](config['root'],_0xfb65('0xe')));}if(_0x3aa899===_0xfb65('0xf')||_0x3aa899===_0xfb65('0x10')){_0xebf714[_0xfb65('0xc')](_0xfb65('0x11'),path['join'](config[_0xfb65('0x12')],_0xfb65('0x13')));_0xebf714[_0xfb65('0x14')](errorHandler());}_0xebf714[_0xfb65('0xc')](_0xfb65('0x15'),function(_0x4320ee,_0x21e16f){if(this[_0x4320ee]instanceof Date){_0x21e16f=this[_0x4320ee]['toISOString']()[_0xfb65('0x16')]('.')[0x0]+'Z';}return _0x21e16f;});_0xebf714[_0xfb65('0x14')](express[_0xfb65('0x17')](_0xebf714[_0xfb65('0x9')](_0xfb65('0x11'))));_0xebf714[_0xfb65('0xc')]('views',config['root']+_0xfb65('0x18'));_0xebf714[_0xfb65('0x19')](_0xfb65('0x1a'),require(_0xfb65('0x1b'))[_0xfb65('0x1c')]);_0xebf714['set'](_0xfb65('0x1d'),_0xfb65('0x1a'));_0xebf714[_0xfb65('0x14')](bodyParser[_0xfb65('0x1e')]({'limit':_0xfb65('0x1f'),'extended':!![]}));_0xebf714[_0xfb65('0x14')](bodyParser['json']({'limit':_0xfb65('0x1f')}));_0xebf714[_0xfb65('0x14')](cors());_0xebf714['use'](methodOverride());_0xebf714['use'](cookieParser());_0xebf714[_0xfb65('0x14')](passport[_0xfb65('0x20')]());}; \ No newline at end of file +var _0x7e27=['express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','production','set','appPath','join','root','public','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','initialize'];(function(_0x487e2d,_0x1fe8ba){var _0xe4457c=function(_0x394c39){while(--_0x394c39){_0x487e2d['push'](_0x487e2d['shift']());}};_0xe4457c(++_0x1fe8ba);}(_0x7e27,0xaa));var _0x77e2=function(_0x25217f,_0x3368bb){_0x25217f=_0x25217f-0x0;var _0x27bfbb=_0x7e27[_0x25217f];return _0x27bfbb;};'use strict';var express=require(_0x77e2('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x77e2('0x1'));var methodOverride=require(_0x77e2('0x2'));var cookieParser=require(_0x77e2('0x3'));var errorHandler=require(_0x77e2('0x4'));var path=require(_0x77e2('0x5'));var passport=require(_0x77e2('0x6'));var cors=require(_0x77e2('0x7'));var moment=require(_0x77e2('0x8'));var config=require(_0x77e2('0x9'));var db=require(_0x77e2('0xa'))['db'];exports[_0x77e2('0xb')]=function(_0x2a1fdb){var _0x3f453c=_0x2a1fdb['get'](_0x77e2('0xc'));if(_0x3f453c===_0x77e2('0xd')){_0x2a1fdb[_0x77e2('0xe')](_0x77e2('0xf'),path[_0x77e2('0x10')](config[_0x77e2('0x11')],_0x77e2('0x12')));}if(_0x3f453c==='development'||_0x3f453c==='test'){_0x2a1fdb[_0x77e2('0xe')](_0x77e2('0xf'),path[_0x77e2('0x10')](config[_0x77e2('0x11')],'client'));_0x2a1fdb[_0x77e2('0x13')](errorHandler());}_0x2a1fdb[_0x77e2('0xe')](_0x77e2('0x14'),function(_0x32b7ee,_0x34e812){if(this[_0x32b7ee]instanceof Date){_0x34e812=this[_0x32b7ee][_0x77e2('0x15')]()[_0x77e2('0x16')]('.')[0x0]+'Z';}return _0x34e812;});_0x2a1fdb[_0x77e2('0x13')](express[_0x77e2('0x17')](_0x2a1fdb['get']('appPath')));_0x2a1fdb[_0x77e2('0xe')](_0x77e2('0x18'),config[_0x77e2('0x11')]+_0x77e2('0x19'));_0x2a1fdb[_0x77e2('0x1a')](_0x77e2('0x1b'),require(_0x77e2('0x1c'))[_0x77e2('0x1d')]);_0x2a1fdb[_0x77e2('0xe')]('view\x20engine','html');_0x2a1fdb[_0x77e2('0x13')](bodyParser[_0x77e2('0x1e')]({'limit':_0x77e2('0x1f'),'extended':!![]}));_0x2a1fdb[_0x77e2('0x13')](bodyParser[_0x77e2('0x20')]({'limit':_0x77e2('0x1f')}));_0x2a1fdb['use'](cors());_0x2a1fdb[_0x77e2('0x13')](methodOverride());_0x2a1fdb['use'](cookieParser());_0x2a1fdb[_0x77e2('0x13')](passport[_0x77e2('0x21')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 7c986c9..21cfbde 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 _0xe2f4=['crypto','../environment','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','map','model','join','createHash','update','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','md5','substring','lodash'];(function(_0xf6aec0,_0x51ffd6){var _0x59a51b=function(_0x57adc6){while(--_0x57adc6){_0xf6aec0['push'](_0xf6aec0['shift']());}};_0x59a51b(++_0x51ffd6);}(_0xe2f4,0x175));var _0x4e2f=function(_0x4240c8,_0x4e2c4b){_0x4240c8=_0x4240c8-0x0;var _0x32932b=_0xe2f4[_0x4240c8];return _0x32932b;};'use strict';var _=require(_0x4e2f('0x0'));var os=require('os');var crypto=require(_0x4e2f('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0x4e2f('0x2'));function getInterfaces(){var _0x353642=[];var _0x407035=os['networkInterfaces']();var _0x5b9d3d=_['orderBy'](_[_0x4e2f('0x3')](_0x407035));for(var _0x13a95b=0x0;_0x13a95b<_0x5b9d3d[_0x4e2f('0x4')];_0x13a95b++){var _0x5cd92f=_0x407035[_0x5b9d3d[_0x13a95b]][_0x4e2f('0x5')](function(_0x3fd245){return _0x3fd245[_0x4e2f('0x6')]===_0x4e2f('0x7')&&_0x3fd245[_0x4e2f('0x8')]===![];});_0x353642=_0x353642[_0x4e2f('0x9')](_0x5cd92f);}return _0x353642;}function getFirstInterface(){var _0x281065=_[_0x4e2f('0xa')](getInterfaces());return{'macAddress':_0x281065&&_0x281065[_0x4e2f('0xb')]?_0x281065[_0x4e2f('0xb')]:_0x4e2f('0xc'),'ipAddress':_0x281065&&_0x281065[_0x4e2f('0xd')]?_0x281065[_0x4e2f('0xd')]:_0x4e2f('0xe')};}exports[_0x4e2f('0xf')]=getFirstInterface;function getCPUhash(){var _0x145ad2=_[_0x4e2f('0x10')](os['cpus']()[_0x4e2f('0x11')](function(_0xd7c544){return _0xd7c544[_0x4e2f('0x12')];}))[_0x4e2f('0x13')](':');return crypto[_0x4e2f('0x14')]('md5')[_0x4e2f('0x15')](_0x145ad2)[_0x4e2f('0x16')](_0x4e2f('0x17'));}exports[_0x4e2f('0x18')]=function(){var _0x26f5f5=os[_0x4e2f('0x19')]();var _0x42b62b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x42b62b['test'](config['licenseToken'])){return config[_0x4e2f('0x1a')];}else if(_0x26f5f5==='win32'){return exec(_0x4e2f('0x1b'),{'encoding':'utf8'})[_0x4e2f('0x1c')]('\x0d\x0a','');}else{var _0x5e61bb=getFirstInterface();var _0x405712=getCPUhash();var _0x231d92=_0x405712+'|'+os[_0x4e2f('0x1d')]()+'|'+_0x5e61bb[_0x4e2f('0x1e')]+'|'+_0x5e61bb[_0x4e2f('0x1f')];var _0x41a098=crypto[_0x4e2f('0x14')](_0x4e2f('0x20'))[_0x4e2f('0x15')](_0x231d92)[_0x4e2f('0x16')](_0x4e2f('0x17'));return _0x41a098[_0x4e2f('0x21')](0x0,0x8)+'-'+_0x41a098[_0x4e2f('0x21')](0x8,0xc)+'-'+_0x41a098[_0x4e2f('0x21')](0xc,0x10)+'-'+_0x41a098[_0x4e2f('0x21')](0x10,0x14)+'-'+_0x41a098['substring'](0x14);}}; \ No newline at end of file +var _0x4b33=['hostname','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','test','win32','utf8'];(function(_0x570e47,_0x5b75f4){var _0x107818=function(_0x5b4716){while(--_0x5b4716){_0x570e47['push'](_0x570e47['shift']());}};_0x107818(++_0x5b75f4);}(_0x4b33,0xf9));var _0x34b3=function(_0x34ffc6,_0x59596b){_0x34ffc6=_0x34ffc6-0x0;var _0x38b7c8=_0x4b33[_0x34ffc6];return _0x38b7c8;};'use strict';var _=require(_0x34b3('0x0'));var os=require('os');var crypto=require(_0x34b3('0x1'));var machine=require(_0x34b3('0x2'));var exec=require(_0x34b3('0x3'))[_0x34b3('0x4')];var config=require('../environment');function getInterfaces(){var _0x144f0b=[];var _0x4851a3=os[_0x34b3('0x5')]();var _0x19dc80=_[_0x34b3('0x6')](_[_0x34b3('0x7')](_0x4851a3));for(var _0xc9c9c=0x0;_0xc9c9c<_0x19dc80[_0x34b3('0x8')];_0xc9c9c++){var _0x3077a2=_0x4851a3[_0x19dc80[_0xc9c9c]][_0x34b3('0x9')](function(_0x5bae22){return _0x5bae22[_0x34b3('0xa')]===_0x34b3('0xb')&&_0x5bae22[_0x34b3('0xc')]===![];});_0x144f0b=_0x144f0b['concat'](_0x3077a2);}return _0x144f0b;}function getFirstInterface(){var _0x304797=_[_0x34b3('0xd')](getInterfaces());return{'macAddress':_0x304797&&_0x304797[_0x34b3('0xe')]?_0x304797[_0x34b3('0xe')]:_0x34b3('0xf'),'ipAddress':_0x304797&&_0x304797['address']?_0x304797[_0x34b3('0x10')]:_0x34b3('0x11')};}exports[_0x34b3('0x12')]=getFirstInterface;function getCPUhash(){var _0x2ffecc=_['orderBy'](os['cpus']()['map'](function(_0x49f7c5){return _0x49f7c5[_0x34b3('0x13')];}))[_0x34b3('0x14')](':');return crypto[_0x34b3('0x15')](_0x34b3('0x16'))[_0x34b3('0x17')](_0x2ffecc)['digest'](_0x34b3('0x18'));}exports[_0x34b3('0x19')]=function(){var _0xd47bb3=os[_0x34b3('0x1a')]();var _0x46876f=/[0-9a-f-]{36}/;if(config[_0x34b3('0x1b')]&&_0x46876f[_0x34b3('0x1c')](config[_0x34b3('0x1b')])){return config[_0x34b3('0x1b')];}else if(_0xd47bb3===_0x34b3('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x34b3('0x1e')})['replace']('\x0d\x0a','');}else{var _0x279fb9=getFirstInterface();var _0x52adc0=getCPUhash();var _0x1731ba=_0x52adc0+'|'+os[_0x34b3('0x1f')]()+'|'+_0x279fb9['macAddress']+'|'+_0x279fb9[_0x34b3('0x20')];var _0x1d6a88=crypto[_0x34b3('0x15')](_0x34b3('0x16'))[_0x34b3('0x17')](_0x1731ba)[_0x34b3('0x21')](_0x34b3('0x18'));return _0x1d6a88['substring'](0x0,0x8)+'-'+_0x1d6a88[_0x34b3('0x22')](0x8,0xc)+'-'+_0x1d6a88[_0x34b3('0x22')](0xc,0x10)+'-'+_0x1d6a88[_0x34b3('0x22')](0x10,0x14)+'-'+_0x1d6a88[_0x34b3('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1347e0c..6653a80 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 _0x7e24=['%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version'];(function(_0x5ed3db,_0x387aec){var _0x42975e=function(_0x30b82e){while(--_0x30b82e){_0x5ed3db['push'](_0x5ed3db['shift']());}};_0x42975e(++_0x387aec);}(_0x7e24,0x72));var _0x47e2=function(_0x3cdf8b,_0x50e6ff){_0x3cdf8b=_0x3cdf8b-0x0;var _0xa4f9f3=_0x7e24[_0x3cdf8b];return _0xa4f9f3;};'use strict';var util=require(_0x47e2('0x0'));var moment=require(_0x47e2('0x1'));var rp=require(_0x47e2('0x2'));var BPromise=require(_0x47e2('0x3'));var pkginfo=require(_0x47e2('0x4'))(module,'version');var db=require(_0x47e2('0x5'))['db'];var encryptor=require(_0x47e2('0x6'));var hardware=require(_0x47e2('0x7'));var logger=require(_0x47e2('0x8'))(_0x47e2('0x9'));var HOST=_0x47e2('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x41df73){return new BPromise(function(_0x120d3f,_0x565488){var _0x27486a=util[_0x47e2('0xb')](_0x47e2('0xc'),HOST,_0x41df73,module[_0x47e2('0xd')][_0x47e2('0xe')]);if(oldToken){_0x27486a=util[_0x47e2('0xb')](_0x47e2('0xf'),HOST,_0x41df73,module[_0x47e2('0xd')][_0x47e2('0xe')],oldToken);}var _0x5c137c={'uri':_0x27486a,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5c137c)[_0x47e2('0x10')](function(_0x4dd93c){_0x120d3f(_0x4dd93c);})[_0x47e2('0x11')](function(_0x6fab0){_0x565488(_0x6fab0);});});}function manageLicense(_0x9f3ca3,_0x4d96d4){var _0x24cd10=_0x4d96d4[_0x47e2('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x24cd10[_0x47e2('0x13')]!==_0x9f3ca3&&!_0x24cd10[_0x47e2('0x14')]){oldToken=_0x24cd10[_0x47e2('0x13')];}httpRequest(_0x9f3ca3)[_0x47e2('0x10')](function(_0x626e3f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x626e3f[_0x47e2('0x15')]){isOldTokenSent=![];if(!_0x24cd10[_0x47e2('0x9')]&&_0x24cd10[_0x47e2('0x9')]!=_0x626e3f[_0x47e2('0x9')]||_0x24cd10[_0x47e2('0x9')]&&_0x24cd10[_0x47e2('0x14')]){logger[_0x47e2('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x24cd10['license']&&!_0x24cd10[_0x47e2('0x14')]&&_0x24cd10[_0x47e2('0x9')]!=_0x626e3f[_0x47e2('0x9')]){logger['info'](_0x47e2('0x17'));}if(_0x24cd10[_0x47e2('0x9')]&&!_0x24cd10['data2']&&_0x24cd10[_0x47e2('0x9')]==_0x626e3f[_0x47e2('0x9')]){return _0x4d96d4;}return _0x4d96d4['update']({'data1':_0x9f3ca3,'data2':null,'license':_0x626e3f[_0x47e2('0x9')]});}else{if(_0x626e3f[_0x47e2('0x9')]||_0x24cd10[_0x47e2('0x9')]){if(!_0x24cd10['data2']){if(_0x24cd10[_0x47e2('0x13')]==_0x9f3ca3){GRAY_PERIOD_REASON=_0x47e2('0x18');logger[_0x47e2('0x16')](_0x47e2('0x19'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x47e2('0x16')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x24cd10['data1'],_0x9f3ca3);}logger[_0x47e2('0x16')](_0x47e2('0x1a'),GRAY_PERIOD_REASON[_0x47e2('0x1b')](),moment()[_0x47e2('0xb')](_0x47e2('0x1c')));return _0x4d96d4[_0x47e2('0x1d')]({'data2':encryptor[_0x47e2('0x1e')](moment()[_0x47e2('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x47e2('0x1f')](encryptor[_0x47e2('0x20')](_0x24cd10['data2']),_0x47e2('0x21'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x47e2('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4d96d4[_0x47e2('0x1d')]({'data1':_0x9f3ca3,'data2':null,'license':null});}}}else{if(_0x24cd10[_0x47e2('0x13')]!=_0x9f3ca3){logger[_0x47e2('0x16')](_0x47e2('0x22'),_0x24cd10['data1'],_0x9f3ca3);return _0x4d96d4[_0x47e2('0x1d')]({'data1':_0x9f3ca3,'data2':null,'license':null});}}}return _0x4d96d4;})[_0x47e2('0x10')](function(_0x275667){_0x4d96d4=_0x275667;})[_0x47e2('0x11')](function(_0x5a11f7){logger[_0x47e2('0x23')](_0x5a11f7[_0x47e2('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x47e2('0x25')](),_0x4d96d4);},TIME);});}function defaultLicense(){var _0x360884=hardware['getUuid']();if(_0x360884){return db[_0x47e2('0x26')][_0x47e2('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x360884}})[_0x47e2('0x28')](function(_0x8ea0d,_0x54ddc6){logger[_0x47e2('0x16')](_0x47e2('0x29'),_0x360884);manageLicense(_0x360884,_0x8ea0d);})['catch'](function(_0x55f20d){logger[_0x47e2('0x23')](_0x55f20d[_0x47e2('0x24')]);});}}exports[_0x47e2('0x2a')]=defaultLicense; \ No newline at end of file +var _0x1a46=['SERVICE\x20LICENSE\x20STARTED\x20%s','message','util','request-promise','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','then','error','finally','getUuid','License','findOrCreate'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x1a46,0x173));var _0x61a4=function(_0x2d0c87,_0x198721){_0x2d0c87=_0x2d0c87-0x0;var _0x44f83d=_0x1a46[_0x2d0c87];return _0x44f83d;};'use strict';var util=require(_0x61a4('0x0'));var moment=require('moment');var rp=require(_0x61a4('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x61a4('0x2'));var db=require(_0x61a4('0x3'))['db'];var encryptor=require(_0x61a4('0x4'));var hardware=require(_0x61a4('0x5'));var logger=require(_0x61a4('0x6'))(_0x61a4('0x7'));var HOST=_0x61a4('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5e85cc){return new BPromise(function(_0x591585,_0x3ed4ad){var _0x51dd4b=util[_0x61a4('0x9')](_0x61a4('0xa'),HOST,_0x5e85cc,module[_0x61a4('0xb')][_0x61a4('0x2')]);if(oldToken){_0x51dd4b=util[_0x61a4('0x9')](_0x61a4('0xc'),HOST,_0x5e85cc,module[_0x61a4('0xb')][_0x61a4('0x2')],oldToken);}var _0x2c2908={'uri':_0x51dd4b,'method':_0x61a4('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2c2908)['then'](function(_0x9527fe){_0x591585(_0x9527fe);})[_0x61a4('0xe')](function(_0x1793bb){_0x3ed4ad(_0x1793bb);});});}function manageLicense(_0x4cd5f9,_0x4b7304){var _0x2133cd=_0x4b7304[_0x61a4('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x2133cd[_0x61a4('0x10')]!==_0x4cd5f9&&!_0x2133cd[_0x61a4('0x11')]){oldToken=_0x2133cd['data1'];}httpRequest(_0x4cd5f9)['then'](function(_0x31cb97){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x31cb97['active']){isOldTokenSent=![];if(!_0x2133cd[_0x61a4('0x7')]&&_0x2133cd[_0x61a4('0x7')]!=_0x31cb97[_0x61a4('0x7')]||_0x2133cd['license']&&_0x2133cd[_0x61a4('0x11')]){logger['info'](_0x61a4('0x12'));}if(_0x2133cd[_0x61a4('0x7')]&&!_0x2133cd[_0x61a4('0x11')]&&_0x2133cd[_0x61a4('0x7')]!=_0x31cb97[_0x61a4('0x7')]){logger[_0x61a4('0x13')](_0x61a4('0x14'));}if(_0x2133cd[_0x61a4('0x7')]&&!_0x2133cd[_0x61a4('0x11')]&&_0x2133cd[_0x61a4('0x7')]==_0x31cb97[_0x61a4('0x7')]){return _0x4b7304;}return _0x4b7304[_0x61a4('0x15')]({'data1':_0x4cd5f9,'data2':null,'license':_0x31cb97[_0x61a4('0x7')]});}else{if(_0x31cb97[_0x61a4('0x7')]||_0x2133cd[_0x61a4('0x7')]){if(!_0x2133cd[_0x61a4('0x11')]){if(_0x2133cd[_0x61a4('0x10')]==_0x4cd5f9){GRAY_PERIOD_REASON=_0x61a4('0x16');logger[_0x61a4('0x13')](_0x61a4('0x17'));}else{GRAY_PERIOD_REASON=_0x61a4('0x18');logger[_0x61a4('0x13')](_0x61a4('0x19'),_0x2133cd[_0x61a4('0x10')],_0x4cd5f9);}logger[_0x61a4('0x13')](_0x61a4('0x1a'),GRAY_PERIOD_REASON[_0x61a4('0x1b')](),moment()[_0x61a4('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x4b7304[_0x61a4('0x15')]({'data2':encryptor[_0x61a4('0x1c')](moment()[_0x61a4('0x9')](_0x61a4('0x1d')))});}else{if(moment()[_0x61a4('0x1e')](encryptor['decryptString'](_0x2133cd[_0x61a4('0x11')]),_0x61a4('0x1f'))>DAYS){logger['info'](_0x61a4('0x20'),moment()[_0x61a4('0x9')](_0x61a4('0x1d')));isOldTokenSent=![];return _0x4b7304[_0x61a4('0x15')]({'data1':_0x4cd5f9,'data2':null,'license':null});}}}else{if(_0x2133cd[_0x61a4('0x10')]!=_0x4cd5f9){logger[_0x61a4('0x13')](_0x61a4('0x19'),_0x2133cd[_0x61a4('0x10')],_0x4cd5f9);return _0x4b7304[_0x61a4('0x15')]({'data1':_0x4cd5f9,'data2':null,'license':null});}}}return _0x4b7304;})[_0x61a4('0x21')](function(_0x5cc883){_0x4b7304=_0x5cc883;})[_0x61a4('0xe')](function(_0x532a14){logger[_0x61a4('0x22')](_0x532a14['message']);})[_0x61a4('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x61a4('0x24')](),_0x4b7304);},TIME);});}function defaultLicense(){var _0x26bb8b=hardware[_0x61a4('0x24')]();if(_0x26bb8b){return db[_0x61a4('0x25')][_0x61a4('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x26bb8b}})['spread'](function(_0x3f841b,_0x56c092){logger['info'](_0x61a4('0x27'),_0x26bb8b);manageLicense(_0x26bb8b,_0x3f841b);})[_0x61a4('0xe')](function(_0xd8555b){logger['error'](_0xd8555b[_0x61a4('0x28')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2b25d8c..fbcf54b 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 _0x2a0a=['data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','days','grayReason','changed','disabled','message','findAll','role','sequelize','col','count','admin','user','telephone','telephones','forEach','catch','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','defaults','then','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1'];(function(_0x29cc90,_0x6117c1){var _0x19a65f=function(_0x54a78d){while(--_0x54a78d){_0x29cc90['push'](_0x29cc90['shift']());}};_0x19a65f(++_0x6117c1);}(_0x2a0a,0x1dd));var _0xa2a0=function(_0x3e3a3f,_0x859cc6){_0x3e3a3f=_0x3e3a3f-0x0;var _0x4601eb=_0x2a0a[_0x3e3a3f];return _0x4601eb;};'use strict';var util=require(_0xa2a0('0x0'));var _=require(_0xa2a0('0x1'));var moment=require(_0xa2a0('0x2'));var BPromise=require(_0xa2a0('0x3'));var hardware=require(_0xa2a0('0x4'));var encryptor=require(_0xa2a0('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa2a0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa2a0('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa2a0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa2a0('0x8'),'machineUuid':hardware[_0xa2a0('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x462226){return new BPromise(function(_0x1a8d7e,_0x296c53){return db[_0xa2a0('0xa')]['find'](_[_0xa2a0('0xb')](_0x462226,{'raw':!![],'where':{'id':0x1}}))[_0xa2a0('0xc')](function(_0x436c8f){return checkLicense(_0x436c8f,null);})[_0xa2a0('0xc')](function(_0x4958eb){_0x1a8d7e(_0x4958eb);return;})['catch'](function(_0x5241dc){_0x296c53(_0x5241dc);});});}function checkLicense(_0x3278af,_0x1c819d){if(!_0x3278af){demoLicense[_0xa2a0('0xd')]=_0x3278af['data1'];return demoLicense;}try{var _0x211f03=_0x1c819d||_0x3278af[_0xa2a0('0xe')];if(_[_0xa2a0('0xf')](_0x211f03)){throw new Error(_0xa2a0('0x10'));}var _0x384b3f=_0x3278af[_0xa2a0('0x11')];var _0x1cd197=_0x3278af[_0xa2a0('0x12')];var _0x598747=_0x384b3f[_0xa2a0('0x13')]('-')[0x4];var _0x4a24f1=_0x384b3f[_0xa2a0('0x13')]('-')[0x0];var _0x439eeb=encryptor[_0xa2a0('0x14')](_0x211f03,util[_0xa2a0('0x15')](_0xa2a0('0x16'),_0x598747,_0x384b3f,_0x4a24f1));var _0x11977e=JSON[_0xa2a0('0x17')](_0x439eeb);_0x11977e[_0xa2a0('0x18')]=![];_0x11977e[_0xa2a0('0xd')]=_0x384b3f;_0x11977e[_0xa2a0('0x19')]=hardware[_0xa2a0('0x9')]();if(_0x1cd197){var _0x46392c=encryptor[_0xa2a0('0x14')](_0x1cd197);_0x11977e['gray']=_0x46392c;_0x11977e[_0xa2a0('0x1a')]=moment(_0x46392c)['add'](0x7,_0xa2a0('0x1b'))[_0xa2a0('0x15')]();_0x11977e[_0xa2a0('0x1c')]=_0x11977e[_0xa2a0('0xd')]!=_0x11977e['machineUuid']?_0xa2a0('0x1d'):_0xa2a0('0x1e');}return _0x11977e;}catch(_0x544c94){breakingLicense[_0xa2a0('0xd')]=_0x3278af[_0xa2a0('0x11')];breakingLicense[_0xa2a0('0x1f')]=_0x544c94[_0xa2a0('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1e32a6,_0x153037){getLicense()[_0xa2a0('0xc')](function(_0x43371b){return db['User'][_0xa2a0('0x20')]({'attributes':[_0xa2a0('0x21'),[db[_0xa2a0('0x22')]['fn']('COUNT',db[_0xa2a0('0x22')][_0xa2a0('0x23')](_0xa2a0('0x21'))),_0xa2a0('0x24')]],'group':'role','where':{'role':{'$or':[_0xa2a0('0x25'),_0xa2a0('0x26'),_0xa2a0('0x27')]}},'raw':!![]})[_0xa2a0('0xc')](function(_0x126435){var _0x4a1b13={'user':_0x43371b['users']||0x0,'telephone':_0x43371b[_0xa2a0('0x28')]||0x0};_0x126435[_0xa2a0('0x29')](function(_0x34f77e){var _0x8f9c52=_0x34f77e[_0xa2a0('0x21')]==='admin'?'user':_0x34f77e[_0xa2a0('0x21')];_0x4a1b13[_0x8f9c52]-=_0x34f77e[_0xa2a0('0x24')];if(_0x4a1b13[_0x8f9c52]<0x0)_0x4a1b13[_0x8f9c52]=0x0;});_0x1e32a6(_0x4a1b13);return;});})[_0xa2a0('0x2a')](function(_0x4abd58){_0x153037(_0x4abd58);});});}function checkUserLimits(_0x265a75){return new BPromise(function(_0x504b30,_0xd021f0){getLimits()[_0xa2a0('0xc')](function(_0x52abc0){var _0x3f4e9a=_['pick'](_['countBy'](_0x265a75,_0xa2a0('0x21')),[_0xa2a0('0x25'),_0xa2a0('0x26'),'telephone']);var _0x312b74=(_0x3f4e9a['admin']||0x0)+(_0x3f4e9a['user']||0x0);var _0x29f5b4=_0x3f4e9a[_0xa2a0('0x27')]||0x0;if(_0x312b74>_0x52abc0[_0xa2a0('0x26')])return _0xd021f0(_0xa2a0('0x2b'));if(_0x29f5b4>_0x52abc0[_0xa2a0('0x27')])return _0xd021f0('License\x20limit\x20reached\x20for\x20telephones');return _0x504b30();})[_0xa2a0('0x2a')](function(_0x6b5683){_0xd021f0(_0x6b5683);});});}module[_0xa2a0('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x210a=['getUuid','License','defaults','then','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','gray','add','days','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones','forEach','catch','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license'];(function(_0x5cb4f4,_0x10b186){var _0xac3306=function(_0x789921){while(--_0x789921){_0x5cb4f4['push'](_0x5cb4f4['shift']());}};_0xac3306(++_0x10b186);}(_0x210a,0x13b));var _0xa210=function(_0xf14418,_0x5a6d1f){_0xf14418=_0xf14418-0x0;var _0x27d34d=_0x210a[_0xf14418];return _0x27d34d;};'use strict';var util=require(_0xa210('0x0'));var _=require(_0xa210('0x1'));var moment=require(_0xa210('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0xa210('0x3'));var db=require(_0xa210('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa210('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa210('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa210('0x6'),'machineUuid':hardware[_0xa210('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5c1e3d){return new BPromise(function(_0x219428,_0x5cbe65){return db[_0xa210('0x8')]['find'](_[_0xa210('0x9')](_0x5c1e3d,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x4a7e42){return checkLicense(_0x4a7e42,null);})[_0xa210('0xa')](function(_0x4e7dad){_0x219428(_0x4e7dad);return;})['catch'](function(_0x1ef5b9){_0x5cbe65(_0x1ef5b9);});});}function checkLicense(_0x3d8d2f,_0x326b7){if(!_0x3d8d2f){demoLicense['uuid']=_0x3d8d2f[_0xa210('0xb')];return demoLicense;}try{var _0x56bb55=_0x326b7||_0x3d8d2f[_0xa210('0xc')];if(_[_0xa210('0xd')](_0x56bb55)){throw new Error(_0xa210('0xe'));}var _0x4953af=_0x3d8d2f['data1'];var _0x119356=_0x3d8d2f[_0xa210('0xf')];var _0x308e53=_0x4953af[_0xa210('0x10')]('-')[0x4];var _0x6e5a8d=_0x4953af['split']('-')[0x0];var _0x327794=encryptor[_0xa210('0x11')](_0x56bb55,util[_0xa210('0x12')](_0xa210('0x13'),_0x308e53,_0x4953af,_0x6e5a8d));var _0x210f3b=JSON[_0xa210('0x14')](_0x327794);_0x210f3b['demo']=![];_0x210f3b[_0xa210('0x15')]=_0x4953af;_0x210f3b[_0xa210('0x16')]=hardware['getUuid']();if(_0x119356){var _0x1bb603=encryptor[_0xa210('0x11')](_0x119356);_0x210f3b[_0xa210('0x17')]=_0x1bb603;_0x210f3b['deadline']=moment(_0x1bb603)[_0xa210('0x18')](0x7,_0xa210('0x19'))['format']();_0x210f3b[_0xa210('0x1a')]=_0x210f3b[_0xa210('0x15')]!=_0x210f3b[_0xa210('0x16')]?_0xa210('0x1b'):'disabled';}return _0x210f3b;}catch(_0x2a8247){breakingLicense[_0xa210('0x15')]=_0x3d8d2f[_0xa210('0xb')];breakingLicense[_0xa210('0x1c')]=_0x2a8247[_0xa210('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x225fed,_0x1802ee){getLicense()['then'](function(_0x2acbe7){return db[_0xa210('0x1d')][_0xa210('0x1e')]({'attributes':[_0xa210('0x1f'),[db[_0xa210('0x20')]['fn'](_0xa210('0x21'),db[_0xa210('0x20')][_0xa210('0x22')]('role')),_0xa210('0x23')]],'group':_0xa210('0x1f'),'where':{'role':{'$or':[_0xa210('0x24'),_0xa210('0x25'),_0xa210('0x26')]}},'raw':!![]})[_0xa210('0xa')](function(_0x1b5d49){var _0x1c37de={'user':_0x2acbe7[_0xa210('0x27')]||0x0,'telephone':_0x2acbe7[_0xa210('0x28')]||0x0};_0x1b5d49[_0xa210('0x29')](function(_0x386f70){var _0x181683=_0x386f70[_0xa210('0x1f')]===_0xa210('0x24')?_0xa210('0x25'):_0x386f70['role'];_0x1c37de[_0x181683]-=_0x386f70[_0xa210('0x23')];if(_0x1c37de[_0x181683]<0x0)_0x1c37de[_0x181683]=0x0;});_0x225fed(_0x1c37de);return;});})[_0xa210('0x2a')](function(_0x266111){_0x1802ee(_0x266111);});});}function checkUserLimits(_0x3b0fbc){return new BPromise(function(_0x412c0b,_0x1c9b32){getLimits()['then'](function(_0x250fc1){var _0x586157=_['pick'](_[_0xa210('0x2b')](_0x3b0fbc,_0xa210('0x1f')),[_0xa210('0x24'),_0xa210('0x25'),_0xa210('0x26')]);var _0x50d00f=(_0x586157['admin']||0x0)+(_0x586157[_0xa210('0x25')]||0x0);var _0x10e217=_0x586157[_0xa210('0x26')]||0x0;if(_0x50d00f>_0x250fc1[_0xa210('0x25')])return _0x1c9b32(_0xa210('0x2c'));if(_0x10e217>_0x250fc1[_0xa210('0x26')])return _0x1c9b32('License\x20limit\x20reached\x20for\x20telephones');return _0x412c0b();})[_0xa210('0x2a')](function(_0x4faca8){_0x1c9b32(_0x4faca8);});});}module[_0xa210('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 141f6a3..4cf8716 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 _0x0120=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x30f7c2,_0x416966){var _0x41d7ba=function(_0x5eb8d2){while(--_0x5eb8d2){_0x30f7c2['push'](_0x30f7c2['shift']());}};_0x41d7ba(++_0x416966);}(_0x0120,0x6f));var _0x0012=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x0120[_0x5b561d];return _0x431060;};'use strict';module[_0x0012('0x0')]={'DOMAIN':_0x0012('0x1'),'SESSION_SECRET':_0x0012('0x2'),'GOOGLE_ID':_0x0012('0x3'),'GOOGLE_SECRET':_0x0012('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x4fc2=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x587c13,_0x3edcde){var _0x3b4972=function(_0x8fec5b){while(--_0x8fec5b){_0x587c13['push'](_0x587c13['shift']());}};_0x3b4972(++_0x3edcde);}(_0x4fc2,0x111));var _0x24fc=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x4fc2[_0x4c2f17];return _0x20919e;};'use strict';module[_0x24fc('0x0')]={'DOMAIN':_0x24fc('0x1'),'SESSION_SECRET':_0x24fc('0x2'),'GOOGLE_ID':_0x24fc('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index dc494f7..24c2326 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8b9=['Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','File','%s-%s','error','transports','info'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0xf8b9,0x1de));var _0x9f8b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8b9[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9f8b('0x0'));var winston=require(_0x9f8b('0x1'));var util=require(_0x9f8b('0x2'));var path=require(_0x9f8b('0x3'));var debugLevel=_0x9f8b('0x4');function filename(_0x5b52fb,_0x42a090){return path[_0x9f8b('0x5')](_0x9f8b('0x6'),_0x9f8b('0x7'),_0x9f8b('0x8'),util[_0x9f8b('0x9')](_0x9f8b('0xa'),_0x5b52fb,_0x42a090));}function formatter(_0x5b1dcb,_0x4e43e9){_0x4e43e9[_0x9f8b('0xb')]=_0x4e43e9[_0x9f8b('0xb')][_0x9f8b('0xc')](/@@{/g,'{{{')[_0x9f8b('0xc')](/}@@/g,_0x9f8b('0xd'))['replace'](/@{/g,'{{')[_0x9f8b('0xc')](/}@/g,'}}');return util[_0x9f8b('0x9')](_0x9f8b('0xe'),moment()['format'](_0x9f8b('0xf')),_0x4e43e9['level']['toUpperCase'](),_0x5b1dcb,_0x4e43e9[_0x9f8b('0xb')]);}module['exports']=function(_0x1a8dae){return new winston[(_0x9f8b('0x10'))]({'transports':[new winston['transports'][(_0x9f8b('0x11'))]({'name':util['format'](_0x9f8b('0x12'),_0x1a8dae,_0x9f8b('0x13')),'filename':filename(_0x1a8dae,_0x9f8b('0x13')),'level':_0x9f8b('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fc8f2){return formatter(_0x1a8dae,_0x4fc8f2);}}),new winston[(_0x9f8b('0x14'))][(_0x9f8b('0x11'))]({'name':util[_0x9f8b('0x9')]('%s-%s',_0x1a8dae,_0x9f8b('0x15')),'filename':filename(_0x1a8dae,_0x9f8b('0x15')),'level':_0x9f8b('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x21fdce){return formatter(_0x1a8dae,_0x21fdce);}}),new winston[(_0x9f8b('0x14'))][(_0x9f8b('0x16'))]({'level':process[_0x9f8b('0x17')][_0x9f8b('0x18')]||debugLevel,'json':![],'formatter':function(_0x1cab73){return formatter(_0x1a8dae,_0x1cab73);}})]});}; \ No newline at end of file +var _0x4cba=['message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','File','%s-%s','error','info','transports','Console','env','debugLevel','moment','winston','util','path','INFO','/var','log','xcally'];(function(_0x148aa9,_0x421ae3){var _0x530a22=function(_0x458499){while(--_0x458499){_0x148aa9['push'](_0x148aa9['shift']());}};_0x530a22(++_0x421ae3);}(_0x4cba,0xf2));var _0xa4cb=function(_0x15e291,_0x448d46){_0x15e291=_0x15e291-0x0;var _0x12d8a0=_0x4cba[_0x15e291];return _0x12d8a0;};'use strict';var moment=require(_0xa4cb('0x0'));var winston=require(_0xa4cb('0x1'));var util=require(_0xa4cb('0x2'));var path=require(_0xa4cb('0x3'));var debugLevel=_0xa4cb('0x4');function filename(_0x162288,_0x162132){return path['join'](_0xa4cb('0x5'),_0xa4cb('0x6'),_0xa4cb('0x7'),util['format']('%s-%s.log',_0x162288,_0x162132));}function formatter(_0x46bf39,_0x16e284){_0x16e284[_0xa4cb('0x8')]=_0x16e284[_0xa4cb('0x8')][_0xa4cb('0x9')](/@@{/g,_0xa4cb('0xa'))[_0xa4cb('0x9')](/}@@/g,_0xa4cb('0xb'))[_0xa4cb('0x9')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0xa4cb('0xc'),moment()[_0xa4cb('0xd')](_0xa4cb('0xe')),_0x16e284['level'][_0xa4cb('0xf')](),_0x46bf39,_0x16e284['message']);}module['exports']=function(_0x5e0a18){return new winston[(_0xa4cb('0x10'))]({'transports':[new winston['transports'][(_0xa4cb('0x11'))]({'name':util[_0xa4cb('0xd')](_0xa4cb('0x12'),_0x5e0a18,_0xa4cb('0x13')),'filename':filename(_0x5e0a18,_0xa4cb('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3a66ec){return formatter(_0x5e0a18,_0x3a66ec);}}),new winston['transports']['File']({'name':util[_0xa4cb('0xd')]('%s-%s',_0x5e0a18,_0xa4cb('0x14')),'filename':filename(_0x5e0a18,_0xa4cb('0x14')),'level':_0xa4cb('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ea7af){return formatter(_0x5e0a18,_0x3ea7af);}}),new winston[(_0xa4cb('0x15'))][(_0xa4cb('0x16'))]({'level':process[_0xa4cb('0x17')][_0xa4cb('0x18')]||debugLevel,'json':![],'formatter':function(_0x174632){return formatter(_0x5e0a18,_0x174632);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index fc2cc4f..ee62b79 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 _0xd884=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0xe35564,_0x9fcbfb){var _0xe195f8=function(_0x294818){while(--_0x294818){_0xe35564['push'](_0xe35564['shift']());}};_0xe195f8(++_0x9fcbfb);}(_0xd884,0x19d));var _0x4d88=function(_0x352b43,_0x290f58){_0x352b43=_0x352b43-0x0;var _0x1fcad9=_0xd884[_0x352b43];return _0x1fcad9;};'use strict';var path=require(_0x4d88('0x0'));var os=require('os');var config={'apps':[{'name':_0x4d88('0x1'),'script':path[_0x4d88('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0x4d88('0x2')](__dirname,_0x4d88('0x3'))},{'name':'agi','script':path[_0x4d88('0x2')](__dirname,_0x4d88('0x4'))},{'name':_0x4d88('0x5'),'script':path[_0x4d88('0x2')](__dirname,_0x4d88('0x6'))},{'name':_0x4d88('0x7'),'script':path['join'](__dirname,_0x4d88('0x8'))},{'name':_0x4d88('0x9'),'script':path[_0x4d88('0x2')](__dirname,_0x4d88('0xa'))}]};module[_0x4d88('0xb')]=config; \ No newline at end of file +var _0x053e=['ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','join','../../services/express/index.js'];(function(_0x10fed5,_0x4073fd){var _0x53661e=function(_0xa3a8d8){while(--_0xa3a8d8){_0x10fed5['push'](_0x10fed5['shift']());}};_0x53661e(++_0x4073fd);}(_0x053e,0x1e9));var _0xe053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053e[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xe053('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xe053('0x1')](__dirname,_0xe053('0x2'))},{'name':_0xe053('0x3'),'script':path['join'](__dirname,_0xe053('0x4'))},{'name':_0xe053('0x5'),'script':path['join'](__dirname,_0xe053('0x6'))},{'name':'email','script':path[_0xe053('0x1')](__dirname,_0xe053('0x7'))},{'name':_0xe053('0x8'),'script':path[_0xe053('0x1')](__dirname,_0xe053('0x9'))},{'name':'xdr','script':path['join'](__dirname,_0xe053('0xa'))}]};module[_0xe053('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 057f94e..263c48c 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 _0x3c3a=['restart','list','describe','delete','dump','saved','connect','connected','start','then','disconnect','stop'];(function(_0x411222,_0x5840df){var _0x5d0693=function(_0x55965a){while(--_0x55965a){_0x411222['push'](_0x411222['shift']());}};_0x5d0693(++_0x5840df);}(_0x3c3a,0x1aa));var _0xa3c3=function(_0x15a7b1,_0x475909){_0x15a7b1=_0x15a7b1-0x0;var _0x2f8275=_0x3c3a[_0x15a7b1];return _0x2f8275;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3bb95e,_0x1954db){return pm2[_0xa3c3('0x0')](function(_0x4db2fe){if(_0x4db2fe){return _0x1954db(_0x4db2fe);}return _0x3bb95e(_0xa3c3('0x1'));});});};exports[_0xa3c3('0x2')]=function(_0x4577b2){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x46c9a5,_0x8e6f3a){return pm2['start'](_0x4577b2,function(_0x52378d,_0x32bd0b){if(_0x52378d){return _0x8e6f3a(_0x52378d);}pm2[_0xa3c3('0x4')]();return _0x46c9a5(_0x32bd0b);});});});};exports['stop']=function(_0x4a7fd2){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x430689,_0xca2f01){return pm2[_0xa3c3('0x5')](_0x4a7fd2,function(_0x4456fa,_0x40a2c0){if(_0x4456fa){return _0xca2f01(_0x4456fa);}pm2[_0xa3c3('0x4')]();return _0x430689(_0x40a2c0);});});});};exports[_0xa3c3('0x6')]=function(_0x3d1838){return connect()['then'](function(){return new BPromise(function(_0x5b90af,_0x4c53ba){return pm2[_0xa3c3('0x6')](_0x3d1838,function(_0x2a714a,_0x242b50){if(_0x2a714a){return _0x4c53ba(_0x2a714a);}pm2[_0xa3c3('0x4')]();return _0x5b90af(_0x242b50);});});});};exports[_0xa3c3('0x7')]=function(){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x1a5902,_0x224b7d){return pm2[_0xa3c3('0x7')](function(_0x289c88,_0xac3843){if(_0x289c88){return _0x224b7d(_0x289c88);}pm2[_0xa3c3('0x4')]();return _0x1a5902(_0xac3843);});});});};exports['describe']=function(_0x3b4191){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x1b3ccc,_0x179c89){return pm2[_0xa3c3('0x8')](_0x3b4191,function(_0x40063a,_0x283017){if(_0x40063a){return _0x179c89(_0x40063a);}pm2[_0xa3c3('0x4')]();return _0x1b3ccc(_0x283017);});});});};exports[_0xa3c3('0x9')]=function(_0x426c8c){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x194f29,_0x334368){return pm2[_0xa3c3('0x9')](_0x426c8c,function(_0x4c2a26,_0x12fc19){if(_0x4c2a26){return _0x334368(_0x4c2a26);}pm2[_0xa3c3('0x4')]();return _0x194f29(_0x12fc19);});});});};exports[_0xa3c3('0xa')]=function(){return connect()[_0xa3c3('0x3')](function(){return new BPromise(function(_0x46f7e4,_0x49d422){return pm2[_0xa3c3('0xa')](function(_0xa81bde){if(_0xa81bde){return _0x49d422(_0xa81bde);}return _0x46f7e4(_0xa3c3('0xb'));});});});}; \ No newline at end of file +var _0x34e0=['pm2','bluebird','./config','connect','connected','start','then','stop','disconnect','restart','list','describe','delete','dump','saved'];(function(_0x377576,_0x29f607){var _0x1ceacc=function(_0x275b6d){while(--_0x275b6d){_0x377576['push'](_0x377576['shift']());}};_0x1ceacc(++_0x29f607);}(_0x34e0,0xf0));var _0x034e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x34e0[_0x376b45];return _0x2341b3;};'use strict';var pm2=require(_0x034e('0x0'));var BPromise=require(_0x034e('0x1'));var config=require(_0x034e('0x2'));function connect(){return new BPromise(function(_0x5630a5,_0x29ba50){return pm2[_0x034e('0x3')](function(_0x389302){if(_0x389302){return _0x29ba50(_0x389302);}return _0x5630a5(_0x034e('0x4'));});});};exports[_0x034e('0x5')]=function(_0x561f21){return connect()[_0x034e('0x6')](function(){return new BPromise(function(_0x571bd1,_0x55c0b3){return pm2[_0x034e('0x5')](_0x561f21,function(_0x75d44c,_0x8bcc81){if(_0x75d44c){return _0x55c0b3(_0x75d44c);}pm2['disconnect']();return _0x571bd1(_0x8bcc81);});});});};exports[_0x034e('0x7')]=function(_0x2083b6){return connect()['then'](function(){return new BPromise(function(_0x24d8df,_0x51cc48){return pm2['stop'](_0x2083b6,function(_0x20a7b1,_0x2f16e7){if(_0x20a7b1){return _0x51cc48(_0x20a7b1);}pm2[_0x034e('0x8')]();return _0x24d8df(_0x2f16e7);});});});};exports[_0x034e('0x9')]=function(_0x402a86){return connect()[_0x034e('0x6')](function(){return new BPromise(function(_0x24cee0,_0x292e27){return pm2['restart'](_0x402a86,function(_0x5e495f,_0x37abd7){if(_0x5e495f){return _0x292e27(_0x5e495f);}pm2[_0x034e('0x8')]();return _0x24cee0(_0x37abd7);});});});};exports[_0x034e('0xa')]=function(){return connect()[_0x034e('0x6')](function(){return new BPromise(function(_0x3f97af,_0xd584fd){return pm2[_0x034e('0xa')](function(_0x154366,_0x3cc655){if(_0x154366){return _0xd584fd(_0x154366);}pm2['disconnect']();return _0x3f97af(_0x3cc655);});});});};exports[_0x034e('0xb')]=function(_0x3f6cbd){return connect()['then'](function(){return new BPromise(function(_0x342822,_0xdda28d){return pm2[_0x034e('0xb')](_0x3f6cbd,function(_0x4234db,_0x58cdb2){if(_0x4234db){return _0xdda28d(_0x4234db);}pm2[_0x034e('0x8')]();return _0x342822(_0x58cdb2);});});});};exports[_0x034e('0xc')]=function(_0x207c9b){return connect()[_0x034e('0x6')](function(){return new BPromise(function(_0x49a91a,_0x3c53de){return pm2[_0x034e('0xc')](_0x207c9b,function(_0x57c76e,_0x3a4924){if(_0x57c76e){return _0x3c53de(_0x57c76e);}pm2[_0x034e('0x8')]();return _0x49a91a(_0x3a4924);});});});};exports[_0x034e('0xd')]=function(){return connect()[_0x034e('0x6')](function(){return new BPromise(function(_0x2ba21,_0x58bedd){return pm2['dump'](function(_0x1e382f){if(_0x1e382f){return _0x58bedd(_0x1e382f);}return _0x2ba21(_0x034e('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 1ba1d5a..7eaf876 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 _0x1bc2=['[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','length','info'];(function(_0x42fc3e,_0xdc5885){var _0x52e1fa=function(_0x9e9274){while(--_0x9e9274){_0x42fc3e['push'](_0x42fc3e['shift']());}};_0x52e1fa(++_0xdc5885);}(_0x1bc2,0x133));var _0x21bc=function(_0x1807cd,_0x3a83d9){_0x1807cd=_0x1807cd-0x0;var _0x2e9042=_0x1bc2[_0x1807cd];return _0x2e9042;};'use strict';var _=require('lodash');var moment=require(_0x21bc('0x0'));var Redis=require(_0x21bc('0x1'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x21bc('0x2'))(_0x21bc('0x3'));config[_0x21bc('0x4')]=_[_0x21bc('0x5')](config[_0x21bc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x21bc('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0x4ef705=0x0;var _0x237bee=[];return db[_0x21bc('0x7')][_0x21bc('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x21bc('0x9')](function(_0x548528){_0x4ef705=_0x548528[_0x21bc('0xa')];if(_0x4ef705){return db[_0x21bc('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x21bc('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x21bc('0xd')](_0x548528['chatTimeout'],_0x21bc('0xe'))}}});}else{return[];}})[_0x21bc('0x9')](function(_0x56de79){if(_0x56de79&&_0x56de79[_0x21bc('0xf')]){_0x237bee=_['map'](_0x56de79||[],'id');logger[_0x21bc('0x10')](_0x21bc('0x11'),_0x237bee[_0x21bc('0x12')]());return db[_0x21bc('0xb')][_0x21bc('0x13')]({'closeReason':_0x21bc('0x14'),'disposition':_0x21bc('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x237bee}});}})[_0x21bc('0x9')](function(){if(_0x237bee&&_0x237bee[_0x21bc('0xf')]){logger[_0x21bc('0x10')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x237bee['join']());for(var _0x57f0f1=0x0;_0x57f0f1<_0x237bee[_0x21bc('0xf')];_0x57f0f1++){io[_0x21bc('0x16')](_0x21bc('0x17'),{'id':_0x237bee[_0x57f0f1],'closed':!![]});}}})[_0x21bc('0x18')](function(_0xc66846){logger['error'](_0x21bc('0x19'),_0xc66846?util[_0x21bc('0x1a')](_0xc66846,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x09ef=['inspect','start','lodash','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','subtract','then','length','map','info','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x4d38e1,_0x46eab2){var _0x18290c=function(_0x24df24){while(--_0x24df24){_0x4d38e1['push'](_0x4d38e1['shift']());}};_0x18290c(++_0x46eab2);}(_0x09ef,0xdb));var _0xf09e=function(_0x1ac6e4,_0xeaec3c){_0x1ac6e4=_0x1ac6e4-0x0;var _0x5b9e0f=_0x09ef[_0x1ac6e4];return _0x5b9e0f;};'use strict';var _=require(_0xf09e('0x0'));var moment=require('moment');var Redis=require(_0xf09e('0x1'));var util=require(_0xf09e('0x2'));var config=require(_0xf09e('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xf09e('0x4'))(_0xf09e('0x5'));config[_0xf09e('0x6')]=_[_0xf09e('0x7')](config['redis'],{'host':_0xf09e('0x8'),'port':0x18eb});var io=require(_0xf09e('0x9'))(new Redis(config[_0xf09e('0x6')]));function closeInteractions(){var _0x37a32f=0x0;var _0x3abc0f=[];return db['Setting'][_0xf09e('0xa')]({'raw':!![],'attributes':['id',_0xf09e('0xb')],'where':{'id':0x1}})['then'](function(_0x2261ee){_0x37a32f=_0x2261ee['chatTimeout'];if(_0x37a32f){return db[_0xf09e('0xc')][_0xf09e('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf09e('0xe')](_0x2261ee['chatTimeout'],'minutes')}}});}else{return[];}})[_0xf09e('0xf')](function(_0x537a28){if(_0x537a28&&_0x537a28[_0xf09e('0x10')]){_0x3abc0f=_[_0xf09e('0x11')](_0x537a28||[],'id');logger[_0xf09e('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3abc0f['join']());return db[_0xf09e('0xc')][_0xf09e('0x13')]({'closeReason':'system','disposition':_0xf09e('0x14'),'closed':!![],'closedAt':moment()[_0xf09e('0x15')](_0xf09e('0x16'))},{'where':{'id':_0x3abc0f}});}})['then'](function(){if(_0x3abc0f&&_0x3abc0f['length']){logger[_0xf09e('0x12')](_0xf09e('0x17'),_0x3abc0f['join']());for(var _0x5b0604=0x0;_0x5b0604<_0x3abc0f[_0xf09e('0x10')];_0x5b0604++){io[_0xf09e('0x18')](_0xf09e('0x19'),{'id':_0x3abc0f[_0x5b0604],'closed':!![]});}}})[_0xf09e('0x1a')](function(_0x274199){logger[_0xf09e('0x1b')](_0xf09e('0x1c'),_0x274199?util[_0xf09e('0x1d')](_0x274199,{'showHidden':![],'depth':null}):'');});}exports[_0xf09e('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e74828e..2708f1e 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 _0x1174=['no\x20report\x20id','keys','jobs','toString','difference','intersection','exists','toRun','length','index','resolve','cron','endAt','start','stop','deleteJob','stop\x20cron','isBetween','startAt','update','update\x20cron','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','email\x20sent','catch','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1174,0x108));var _0x4117=function(_0x425a1c,_0x3958f5){_0x425a1c=_0x425a1c-0x0;var _0x251383=_0x1174[_0x425a1c];return _0x251383;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require(_0x4117('0x0'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x4117('0x1'));var BPromise=require(_0x4117('0x2'));var logger=require(_0x4117('0x3'))(_0x4117('0x4'));var db=require(_0x4117('0x5'))['db'];var analyticCustomReportController=require(_0x4117('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x4117('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xd587f2,_0x37e910){return function(){logger[_0x4117('0x8')](_0x4117('0x9'),_0xd587f2['email']);var _0x5a41d5=!![];var _0x4c7bc1={'tls':{'rejectUnauthorized':![]}};if(_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0xc')]){_0x4c7bc1[_0x4117('0xc')]=_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0xc')];}else{_0x4c7bc1[_0x4117('0xd')]=_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0xd')];_0x4c7bc1[_0x4117('0xe')]=_0xd587f2['MailAccount'][_0x4117('0xb')][_0x4117('0xe')];_0x4c7bc1['secure']=_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0xf')];}if(_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0x10')]){_0x4c7bc1[_0x4117('0x11')]={'user':_0xd587f2['MailAccount']['Smtp'][_0x4117('0x12')],'pass':_0xd587f2[_0x4117('0xa')]['Smtp'][_0x4117('0x13')]};}var _0x2cc5f4={'account':_0x4c7bc1,'message':{'from':util[_0x4117('0x14')](_0x4117('0x15'),_0xd587f2[_0x4117('0xa')][_0x4117('0x16')],_0xd587f2[_0x4117('0xa')][_0x4117('0x17')]||_0xd587f2[_0x4117('0xa')][_0x4117('0xb')][_0x4117('0x12')]),'to':_0xd587f2['email'],'cc':_0xd587f2['cc'],'bcc':_0xd587f2['bcc'],'subject':util['format'](_0x4117('0x18'),_0x37e910[_0x4117('0x16')],_0xd587f2[_0x4117('0x19')],_0xd587f2[_0x4117('0x1a')])}};var _0x3d297d=path[_0x4117('0x1b')](__dirname,_0x4117('0x1c'));var _0x1244ed=_0x37e910[_0x4117('0x1d')];var _0x22c74d=util[_0x4117('0x14')](_0x4117('0x1e'),path['basename'](_0x37e910[_0x4117('0x1d')],path[_0x4117('0x1f')](_0x37e910[_0x4117('0x1d')])),_0x4117('0x20'));var _0x372a0a=path[_0x4117('0x1b')](_0x3d297d,_0x1244ed);var _0xe60bb6=path[_0x4117('0x1b')](_0x3d297d,_0x22c74d);if(fs[_0x4117('0x21')](_0x372a0a)){_0x37e910[_0x4117('0x22')]='Sent';_0x2cc5f4[_0x4117('0x23')][_0x4117('0x24')]=[{'filename':_0x1244ed,'path':_0x372a0a}];_0x2cc5f4[_0x4117('0x23')]['text']=util[_0x4117('0x14')](_0x4117('0x25'),JSON['stringify'](_0x37e910,null,0x2));}else if(fs[_0x4117('0x21')](_0xe60bb6)){_0x37e910[_0x4117('0x22')]='Sent';_0x2cc5f4[_0x4117('0x23')][_0x4117('0x24')]=[{'filename':_0x22c74d,'path':_0xe60bb6}];}else{_0x2cc5f4['message'][_0x4117('0x26')]=_0x4117('0x27');if(!_0xd587f2[_0x4117('0x28')]){_0x5a41d5=![];logger[_0x4117('0x8')](_0x4117('0x29'));}}if(_0x5a41d5){return client['request'](_0x4117('0x2a'),_0x2cc5f4)['then'](function(_0x4d9748){if(_0x4d9748[_0x4117('0x2b')]){return logger[_0x4117('0x2b')](_0x4117('0x2c'),JSON['stringify'](_0x4d9748));}return logger[_0x4117('0x8')](_0x4117('0x2d'));})[_0x4117('0x2e')](function(_0x34fc81){return logger[_0x4117('0x2b')](_0x4117('0x2c'),JSON[_0x4117('0x2f')](_0x34fc81));});}};}function handleError(){return function(_0x18a75e){return logger['error'](JSON[_0x4117('0x2f')](_0x18a75e));};}function handleResult(_0x372c8d){return function(_0x38b7a4){logger[_0x4117('0x8')](_0x4117('0x30'),JSON[_0x4117('0x2f')](_0x38b7a4));if(_0x372c8d['MailAccount']&&_0x372c8d[_0x4117('0xa')][_0x4117('0xb')]&&!_[_0x4117('0x31')](_0x372c8d[_0x4117('0x17')])){setTimeout(handleSendEmail(_0x372c8d,_0x38b7a4),0x3c*0x3e8);}};}function handleJob(_0x20be23){return function(){try{if(_['isNil'](_0x20be23['subtractNumber'])){return logger[_0x4117('0x8')](_0x4117('0x32'));}if(_['isNil'](_0x20be23[_0x4117('0x1a')])){return logger[_0x4117('0x8')](_0x4117('0x33'));}var _0x49d6a8={'startDate':moment()[_0x4117('0x34')](_0x20be23[_0x4117('0x19')],_0x20be23['subtractUnit'])['format'](_0x4117('0x35')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x20be23[_0x4117('0x36')],'name':_0x20be23[_0x4117('0x16')]};if(!_['isNil'](_0x20be23['DefaultReportId'])){logger[_0x4117('0x8')](_0x4117('0x37'),_0x20be23['DefaultReportId']);return analyticDefaultReportController[_0x4117('0x38')]({'id':_0x20be23['DefaultReportId']},_0x49d6a8)[_0x4117('0x39')](handleResult(_0x20be23))['catch'](handleError());}if(!_[_0x4117('0x31')](_0x20be23['CustomReportId'])){logger[_0x4117('0x8')](_0x4117('0x3a'),_0x20be23['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x20be23[_0x4117('0x3b')]},_0x49d6a8)[_0x4117('0x39')](handleResult(_0x20be23))[_0x4117('0x2e')](handleError());}}catch(_0x38f405){logger[_0x4117('0x2b')](JSON[_0x4117('0x2f')](_0x38f405));}return logger[_0x4117('0x8')](_0x4117('0x3c'));};}function getJobs(_0x594d76){var _0x20afab={};if(_0x594d76){_0x20afab['id']=_0x594d76;}return db['Schedule']['findAll']({'where':_0x20afab,'include':[{'model':db['MailAccount'],'attributes':['id',_0x4117('0x16'),_0x4117('0x17')],'include':[{'model':db['MailServerOut'],'as':_0x4117('0xb')}]}]})['then'](function(_0x4a8ee4){var _0x6a5b80=_[_0x4117('0x3d')](manager[_0x4117('0x3e')]);var _0x3e7800=_['map'](_0x4a8ee4,function(_0x34210f){return _0x34210f['id'][_0x4117('0x3f')]();});var _0x515c2d=_['keyBy'](_0x4a8ee4,function(_0x203979){return _0x203979['id'][_0x4117('0x3f')]();});var _0x2b3af7=_0x594d76?_0x3e7800:_[_0x4117('0x40')](_0x3e7800,_0x6a5b80);var _0x593e15=_[_0x4117('0x41')](_0x3e7800,_0x6a5b80);var _0x257a2a=_[_0x4117('0x40')](_0x6a5b80,_0x3e7800);var _0x17279a;var _0x8d8edb;for(_0x17279a=0x0;_0x17279a<_0x257a2a['length']&&!_0x594d76;_0x17279a+=0x1){_0x8d8edb=_0x257a2a[_0x17279a][_0x4117('0x3f')]();if(manager[_0x4117('0x42')](_0x8d8edb)){manager['stop'](_0x8d8edb);manager['deleteJob'](_0x8d8edb);logger['info']('delete\x20cron',_0x8d8edb);}}logger[_0x4117('0x8')](_0x4117('0x43'),JSON[_0x4117('0x2f')](_0x2b3af7));for(_0x17279a=0x0;_0x17279a<_0x2b3af7[_0x4117('0x44')];_0x17279a+=0x1){_0x8d8edb=_0x2b3af7[_0x17279a]['toString']();logger[_0x4117('0x8')](_0x4117('0x45'),_0x8d8edb);if(_0x594d76){logger[_0x4117('0x8')]('my\x20id',_0x594d76);logger[_0x4117('0x8')](JSON[_0x4117('0x2f')](_0x515c2d[_0x8d8edb]));BPromise[_0x4117('0x46')]()[_0x4117('0x39')](handleJob(_0x515c2d[_0x8d8edb]));logger['info']('run\x20job',_0x515c2d[_0x8d8edb][_0x4117('0x16')],_0x515c2d[_0x8d8edb][_0x4117('0x47')]);}else if(_0x515c2d[_0x8d8edb][_0x4117('0x47')]&&_0x515c2d[_0x8d8edb]['active']&&moment()['isBetween'](_0x515c2d[_0x8d8edb]['startAt'],_0x515c2d[_0x8d8edb][_0x4117('0x48')])){manager['add'](_0x8d8edb,_0x515c2d[_0x8d8edb][_0x4117('0x47')],handleJob(_0x515c2d[_0x8d8edb]));manager[_0x4117('0x49')](_0x8d8edb);logger[_0x4117('0x8')]('add\x20cron',_0x515c2d[_0x8d8edb]['name'],_0x515c2d[_0x8d8edb][_0x4117('0x47')]);}else if(manager[_0x4117('0x42')](_0x8d8edb)){manager[_0x4117('0x4a')](_0x8d8edb);manager[_0x4117('0x4b')](_0x8d8edb);logger[_0x4117('0x8')](_0x4117('0x4c'),_0x515c2d[_0x8d8edb]['name'],_0x515c2d[_0x8d8edb][_0x4117('0x47')]);}}for(_0x17279a=0x0,_0x8d8edb;_0x17279a<_0x593e15[_0x4117('0x44')]&&!_0x594d76;_0x17279a+=0x1){_0x8d8edb=_0x593e15[_0x17279a][_0x4117('0x3f')]();if(manager['exists'](_0x8d8edb)){if(_0x515c2d[_0x8d8edb][_0x4117('0x47')]&&_0x515c2d[_0x8d8edb]['active']&&moment()[_0x4117('0x4d')](_0x515c2d[_0x8d8edb][_0x4117('0x4e')],_0x515c2d[_0x8d8edb][_0x4117('0x48')])){manager[_0x4117('0x4f')](_0x8d8edb,_0x515c2d[_0x8d8edb][_0x4117('0x47')],handleJob(_0x515c2d[_0x8d8edb]));logger[_0x4117('0x8')](_0x4117('0x50'),_0x515c2d[_0x8d8edb][_0x4117('0x16')],_0x515c2d[_0x8d8edb][_0x4117('0x47')]);}else{manager[_0x4117('0x4a')](_0x8d8edb);manager[_0x4117('0x4b')](_0x8d8edb);logger['info'](_0x4117('0x4c'),_0x515c2d[_0x8d8edb]['name'],_0x515c2d[_0x8d8edb][_0x4117('0x47')]);}}}})['catch'](function(_0x4885e0){logger[_0x4117('0x2b')](JSON[_0x4117('0x2f')](_0x4885e0));});}exports['run']=function(_0x3c6f6e){return getJobs(_0x3c6f6e);};exports[_0x4117('0x49')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf084=['startAt','endAt','add','start','stop\x20cron','isBetween','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','user','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf084,0x175));var _0x4f08=function(_0x4c9bee,_0x154c09){_0x4c9bee=_0x4c9bee-0x0;var _0x1baca0=_0xf084[_0x4c9bee];return _0x1baca0;};'use strict';var fs=require('fs');var util=require(_0x4f08('0x0'));var path=require(_0x4f08('0x1'));var _=require(_0x4f08('0x2'));var moment=require(_0x4f08('0x3'));var CronJobManager=require(_0x4f08('0x4'));var jayson=require(_0x4f08('0x5'));var BPromise=require(_0x4f08('0x6'));var logger=require('../logger')('schedule');var db=require(_0x4f08('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x4f08('0x8')][_0x4f08('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24f618,_0x147fc5){return function(){logger[_0x4f08('0xa')](_0x4f08('0xb'),_0x24f618['email']);var _0x135f8e=!![];var _0x499869={'tls':{'rejectUnauthorized':![]}};if(_0x24f618[_0x4f08('0xc')][_0x4f08('0xd')]['service']){_0x499869[_0x4f08('0xe')]=_0x24f618[_0x4f08('0xc')]['Smtp']['service'];}else{_0x499869[_0x4f08('0xf')]=_0x24f618[_0x4f08('0xc')][_0x4f08('0xd')][_0x4f08('0xf')];_0x499869[_0x4f08('0x10')]=_0x24f618['MailAccount'][_0x4f08('0xd')]['port'];_0x499869[_0x4f08('0x11')]=_0x24f618[_0x4f08('0xc')]['Smtp'][_0x4f08('0x11')];}if(_0x24f618[_0x4f08('0xc')][_0x4f08('0xd')][_0x4f08('0x12')]){_0x499869[_0x4f08('0x13')]={'user':_0x24f618['MailAccount'][_0x4f08('0xd')]['user'],'pass':_0x24f618[_0x4f08('0xc')][_0x4f08('0xd')][_0x4f08('0x14')]};}var _0x57b735={'account':_0x499869,'message':{'from':util[_0x4f08('0x15')](_0x4f08('0x16'),_0x24f618['MailAccount'][_0x4f08('0x17')],_0x24f618[_0x4f08('0xc')]['email']||_0x24f618[_0x4f08('0xc')]['Smtp'][_0x4f08('0x18')]),'to':_0x24f618[_0x4f08('0x19')],'cc':_0x24f618['cc'],'bcc':_0x24f618['bcc'],'subject':util[_0x4f08('0x15')](_0x4f08('0x1a'),_0x147fc5[_0x4f08('0x17')],_0x24f618[_0x4f08('0x1b')],_0x24f618[_0x4f08('0x1c')])}};var _0x496178=path[_0x4f08('0x1d')](__dirname,_0x4f08('0x1e'));var _0x334c12=_0x147fc5['savename'];var _0x8a47de=util[_0x4f08('0x15')]('%s.%s',path['basename'](_0x147fc5[_0x4f08('0x1f')],path[_0x4f08('0x20')](_0x147fc5[_0x4f08('0x1f')])),_0x4f08('0x21'));var _0x4a0087=path[_0x4f08('0x1d')](_0x496178,_0x334c12);var _0x575e36=path[_0x4f08('0x1d')](_0x496178,_0x8a47de);if(fs[_0x4f08('0x22')](_0x4a0087)){_0x147fc5[_0x4f08('0x23')]=_0x4f08('0x24');_0x57b735[_0x4f08('0x25')]['attachments']=[{'filename':_0x334c12,'path':_0x4a0087}];_0x57b735[_0x4f08('0x25')][_0x4f08('0x26')]=util[_0x4f08('0x15')](_0x4f08('0x27'),JSON[_0x4f08('0x28')](_0x147fc5,null,0x2));}else if(fs[_0x4f08('0x22')](_0x575e36)){_0x147fc5[_0x4f08('0x23')]='Sent';_0x57b735[_0x4f08('0x25')][_0x4f08('0x29')]=[{'filename':_0x8a47de,'path':_0x575e36}];}else{_0x57b735[_0x4f08('0x25')][_0x4f08('0x26')]=_0x4f08('0x2a');if(!_0x24f618['sendIfEmpty']){_0x135f8e=![];logger[_0x4f08('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x135f8e){return client[_0x4f08('0x2b')](_0x4f08('0x2c'),_0x57b735)['then'](function(_0x10b649){if(_0x10b649[_0x4f08('0x2d')]){return logger[_0x4f08('0x2d')](_0x4f08('0x2e'),JSON[_0x4f08('0x28')](_0x10b649));}return logger[_0x4f08('0xa')](_0x4f08('0x2f'));})[_0x4f08('0x30')](function(_0x194353){return logger[_0x4f08('0x2d')](_0x4f08('0x2e'),JSON[_0x4f08('0x28')](_0x194353));});}};}function handleError(){return function(_0x2d3e05){return logger[_0x4f08('0x2d')](JSON[_0x4f08('0x28')](_0x2d3e05));};}function handleResult(_0x11c640){return function(_0x15bf31){logger['info'](_0x4f08('0x31'),JSON[_0x4f08('0x28')](_0x15bf31));if(_0x11c640[_0x4f08('0xc')]&&_0x11c640[_0x4f08('0xc')]['Smtp']&&!_[_0x4f08('0x32')](_0x11c640['email'])){setTimeout(handleSendEmail(_0x11c640,_0x15bf31),0x3c*0x3e8);}};}function handleJob(_0x4b25d1){return function(){try{if(_['isNil'](_0x4b25d1[_0x4f08('0x1b')])){return logger[_0x4f08('0xa')](_0x4f08('0x33'));}if(_[_0x4f08('0x32')](_0x4b25d1[_0x4f08('0x1c')])){return logger['info'](_0x4f08('0x34'));}var _0x513bdf={'startDate':moment()[_0x4f08('0x35')](_0x4b25d1[_0x4f08('0x1b')],_0x4b25d1['subtractUnit'])[_0x4f08('0x15')](_0x4f08('0x36')),'endDate':moment()[_0x4f08('0x15')](_0x4f08('0x36')),'type':_0x4f08('0x37'),'output':_0x4b25d1[_0x4f08('0x38')],'name':_0x4b25d1['name']};if(!_[_0x4f08('0x32')](_0x4b25d1[_0x4f08('0x39')])){logger[_0x4f08('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x4b25d1[_0x4f08('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x4b25d1[_0x4f08('0x39')]},_0x513bdf)[_0x4f08('0x3a')](handleResult(_0x4b25d1))[_0x4f08('0x30')](handleError());}if(!_[_0x4f08('0x32')](_0x4b25d1[_0x4f08('0x3b')])){logger[_0x4f08('0xa')](_0x4f08('0x3c'),_0x4b25d1['CustomReportId']);return analyticCustomReportController[_0x4f08('0x3d')]({'id':_0x4b25d1[_0x4f08('0x3b')]},_0x513bdf)['then'](handleResult(_0x4b25d1))[_0x4f08('0x30')](handleError());}}catch(_0xa6c22f){logger['error'](JSON['stringify'](_0xa6c22f));}return logger[_0x4f08('0xa')](_0x4f08('0x3e'));};}function getJobs(_0x542ecd){var _0x3098af={};if(_0x542ecd){_0x3098af['id']=_0x542ecd;}return db[_0x4f08('0x3f')][_0x4f08('0x40')]({'where':_0x3098af,'include':[{'model':db[_0x4f08('0xc')],'attributes':['id','name',_0x4f08('0x19')],'include':[{'model':db[_0x4f08('0x41')],'as':_0x4f08('0xd')}]}]})[_0x4f08('0x3a')](function(_0x534266){var _0x15382e=_['keys'](manager[_0x4f08('0x42')]);var _0x588fa8=_[_0x4f08('0x43')](_0x534266,function(_0x1676d2){return _0x1676d2['id'][_0x4f08('0x44')]();});var _0x4ec489=_[_0x4f08('0x45')](_0x534266,function(_0x56027e){return _0x56027e['id'][_0x4f08('0x44')]();});var _0x64c1fd=_0x542ecd?_0x588fa8:_[_0x4f08('0x46')](_0x588fa8,_0x15382e);var _0x42966c=_['intersection'](_0x588fa8,_0x15382e);var _0x11274a=_['difference'](_0x15382e,_0x588fa8);var _0x4298db;var _0x3a98f1;for(_0x4298db=0x0;_0x4298db<_0x11274a[_0x4f08('0x47')]&&!_0x542ecd;_0x4298db+=0x1){_0x3a98f1=_0x11274a[_0x4298db][_0x4f08('0x44')]();if(manager[_0x4f08('0x48')](_0x3a98f1)){manager[_0x4f08('0x49')](_0x3a98f1);manager[_0x4f08('0x4a')](_0x3a98f1);logger[_0x4f08('0xa')](_0x4f08('0x4b'),_0x3a98f1);}}logger[_0x4f08('0xa')](_0x4f08('0x4c'),JSON['stringify'](_0x64c1fd));for(_0x4298db=0x0;_0x4298db<_0x64c1fd[_0x4f08('0x47')];_0x4298db+=0x1){_0x3a98f1=_0x64c1fd[_0x4298db][_0x4f08('0x44')]();logger[_0x4f08('0xa')]('index',_0x3a98f1);if(_0x542ecd){logger[_0x4f08('0xa')](_0x4f08('0x4d'),_0x542ecd);logger['info'](JSON['stringify'](_0x4ec489[_0x3a98f1]));BPromise[_0x4f08('0x4e')]()[_0x4f08('0x3a')](handleJob(_0x4ec489[_0x3a98f1]));logger[_0x4f08('0xa')](_0x4f08('0x4f'),_0x4ec489[_0x3a98f1][_0x4f08('0x17')],_0x4ec489[_0x3a98f1][_0x4f08('0x50')]);}else if(_0x4ec489[_0x3a98f1][_0x4f08('0x50')]&&_0x4ec489[_0x3a98f1][_0x4f08('0x51')]&&moment()['isBetween'](_0x4ec489[_0x3a98f1][_0x4f08('0x52')],_0x4ec489[_0x3a98f1][_0x4f08('0x53')])){manager[_0x4f08('0x54')](_0x3a98f1,_0x4ec489[_0x3a98f1][_0x4f08('0x50')],handleJob(_0x4ec489[_0x3a98f1]));manager[_0x4f08('0x55')](_0x3a98f1);logger[_0x4f08('0xa')]('add\x20cron',_0x4ec489[_0x3a98f1][_0x4f08('0x17')],_0x4ec489[_0x3a98f1][_0x4f08('0x50')]);}else if(manager[_0x4f08('0x48')](_0x3a98f1)){manager[_0x4f08('0x49')](_0x3a98f1);manager[_0x4f08('0x4a')](_0x3a98f1);logger[_0x4f08('0xa')](_0x4f08('0x56'),_0x4ec489[_0x3a98f1]['name'],_0x4ec489[_0x3a98f1][_0x4f08('0x50')]);}}for(_0x4298db=0x0,_0x3a98f1;_0x4298db<_0x42966c['length']&&!_0x542ecd;_0x4298db+=0x1){_0x3a98f1=_0x42966c[_0x4298db][_0x4f08('0x44')]();if(manager['exists'](_0x3a98f1)){if(_0x4ec489[_0x3a98f1][_0x4f08('0x50')]&&_0x4ec489[_0x3a98f1][_0x4f08('0x51')]&&moment()[_0x4f08('0x57')](_0x4ec489[_0x3a98f1]['startAt'],_0x4ec489[_0x3a98f1]['endAt'])){manager[_0x4f08('0x58')](_0x3a98f1,_0x4ec489[_0x3a98f1][_0x4f08('0x50')],handleJob(_0x4ec489[_0x3a98f1]));logger[_0x4f08('0xa')](_0x4f08('0x59'),_0x4ec489[_0x3a98f1][_0x4f08('0x17')],_0x4ec489[_0x3a98f1][_0x4f08('0x50')]);}else{manager[_0x4f08('0x49')](_0x3a98f1);manager['deleteJob'](_0x3a98f1);logger[_0x4f08('0xa')](_0x4f08('0x56'),_0x4ec489[_0x3a98f1][_0x4f08('0x17')],_0x4ec489[_0x3a98f1]['cron']);}}}})[_0x4f08('0x30')](function(_0x559893){logger[_0x4f08('0x2d')](JSON['stringify'](_0x559893));});}exports[_0x4f08('0x5a')]=function(_0x1f640c){return getJobs(_0x1f640c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 53899db..97d12b1 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ea=['then','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sequelize','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion'];(function(_0xf8564f,_0x2db1b8){var _0x6065ad=function(_0x424150){while(--_0x424150){_0xf8564f['push'](_0xf8564f['shift']());}};_0x6065ad(++_0x2db1b8);}(_0x55ea,0xc9));var _0xa55e=function(_0x29a3b7,_0x18d6b6){_0x29a3b7=_0x29a3b7-0x0;var _0x4ab7b2=_0x55ea[_0x29a3b7];return _0x4ab7b2;};var _=require(_0xa55e('0x0'));var AWS=require(_0xa55e('0x1'));var rp=require(_0xa55e('0x2'));var util=require('util');var BPromise=require(_0xa55e('0x3'));var db=require(_0xa55e('0x4'))['db'];var logger=require(_0xa55e('0x5'))(_0xa55e('0x6'));function getTranscriptionJob(_0x95af3d,_0x54f178,_0x2d1040,_0x56ca45){return new Promise(function(_0x515646,_0x588751){var _0x5a009c=new AWS[(_0xa55e('0x7'))]({'accessKeyId':_0x54f178,'secretAccessKey':_0x95af3d,'region':_0x2d1040});_0x5a009c[_0xa55e('0x8')]({'TranscriptionJobName':_0x56ca45},function(_0x30b885,_0xca9526){if(_0x30b885){return _0x588751(_0x30b885);}else{return _0x515646(_0xca9526);}});});}function sentiment(_0x37b797,_0xeedd77,_0x32f6f7,_0x3020cc,_0xe58ede){return new Promise(function(_0x5da3d0,_0x5e38fa){var _0x13f6d7=new AWS[(_0xa55e('0x9'))]({'accessKeyId':_0xeedd77,'secretAccessKey':_0x37b797,'region':_0x32f6f7});_0x13f6d7[_0xa55e('0xa')]({'Text':_0x3020cc,'LanguageCode':_0xe58ede[_0xa55e('0xb')](0x0,0x2)},function(_0x2593b7,_0x5e38dd){if(_0x2593b7){return _0x5e38fa(_0x2593b7);}else{return _0x5da3d0(_0x5e38dd);}});});}function checkTranscribeJob(_0x1c1ca3,_0x5b69cc,_0x3f5178){var _0x1d45c1;return new BPromise(function(_0x153f71,_0x2d2280){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0xe'),_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')]));return getTranscriptionJob(_0x3f5178[_0xa55e('0x10')],_0x3f5178['data2'],_0x5b69cc[_0xa55e('0x11')],_0x1c1ca3[_0xa55e('0xf')])[_0xa55e('0x12')](function(_0x12895e){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')],_0x12895e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x1c1ca3[_0xa55e('0x13')]){switch(_0x12895e[_0xa55e('0x14')][_0xa55e('0x15')]){case _0xa55e('0x16'):var _0x3980b4={'transcribeStatus':_0x12895e['TranscriptionJob'][_0xa55e('0x15')],'fileUri':_0x12895e['TranscriptionJob']['Transcript'][_0xa55e('0x17')]};logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x18'),_0x1c1ca3['id']));return rp({'uri':_0x12895e[_0xa55e('0x14')][_0xa55e('0x19')][_0xa55e('0x17')],'json':!![]})[_0xa55e('0x12')](function(_0x9594a3){logger['info'](util['format'](_0xa55e('0x1a'),_0x1c1ca3['id']));if(_0x9594a3&&_0x9594a3['results']&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')]&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')]){_0x3980b4[_0xa55e('0x13')]='';for(var _0x129762=0x0;_0x129762<_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')];_0x129762++){_0x3980b4[_0xa55e('0x13')]+=_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0x129762][_0xa55e('0x1e')]+'';}}return _0x1c1ca3[_0xa55e('0x1f')](_0x3980b4);})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));if(!_0x1c1ca3['tempSentiment']){throw new db['Sequelize'][(_0xa55e('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5b69cc[_0xa55e('0x22')]||!_0x5b69cc['sentimentAccountId']||!_0x5b69cc[_0xa55e('0x23')]||!_0x5b69cc['language']||!_0x5b69cc[_0xa55e('0x24')]){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x3980b4['fileText']){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc[_0xa55e('0x27')]===_0x3f5178['id']){return _0x3f5178;}else{return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa55e('0x12')](function(_0x25ecb3){if(!_0x25ecb3){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x25ecb3[_0xa55e('0x10')]||!_0x25ecb3[_0xa55e('0x2b')]){throw new db['Sequelize'][(_0xa55e('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d45c1=_0x25ecb3;logger[_0xa55e('0xc')](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x3980b4['fileText'],_0x5b69cc[_0xa55e('0x2d')]);})['then'](function(_0x15e6e2){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1c1ca3['id']));return _0x1c1ca3[_0xa55e('0x1f')]({'sentiment':_0x15e6e2[_0xa55e('0x2e')],'sPositive':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x30')],'sNegative':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0x15e6e2['SentimentScore']['Mixed'],'sNeutral':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x32')]});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});case _0xa55e('0x33'):return _0x1c1ca3['update']({'transcribeStatus':'FAILED','failureReason':_0x12895e[_0xa55e('0x14')][_0xa55e('0x34')]})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});default:logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x35'),_0x1c1ca3['id']));break;}}else{return BPromise[_0xa55e('0x36')]()[_0xa55e('0x12')](function(){if(!_0x1c1ca3['tempSentiment']){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x38'));}if(!_0x5b69cc['sentiment']||!_0x5b69cc[_0xa55e('0x27')]||!_0x5b69cc['sentimentRegion']||!_0x5b69cc[_0xa55e('0x2d')]||!_0x5b69cc[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x1c1ca3[_0xa55e('0x13')]){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc['sentimentAccountId']===_0x3f5178['id']){return _0x3f5178;}else{return db['CloudProvider'][_0xa55e('0x29')]({'where':{'id':_settings[_0xa55e('0x27')]}});}})[_0xa55e('0x12')](function(_0x518e06){if(!_0x518e06){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x518e06[_0xa55e('0x10')]||!_0x518e06[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1d45c1=_0x518e06;logger['info'](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x1c1ca3[_0xa55e('0x13')],_0x5b69cc[_0xa55e('0x2d')]);})[_0xa55e('0x12')](function(_0xd6b91f){logger['info'](util['format'](_0xa55e('0x3a'),_0x1c1ca3['id']));return _0x1c1ca3['update']({'sentiment':_0xd6b91f[_0xa55e('0x2e')],'sPositive':_0xd6b91f['SentimentScore']['Positive'],'sNegative':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0xd6b91f['SentimentScore']['Mixed'],'sNeutral':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x32')],'transcribeStatus':_0xa55e('0x16')});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c1ca3['id']));_0x153f71();});}})['catch'](function(_0x2282f9){if(_0x2282f9){if(!_0x2282f9[_0xa55e('0x3b')]||_0x2282f9[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1c1ca3['id']),util[_0xa55e('0x3e')](_0x2282f9,{'showHidden':![],'depth':null}));}}_0x153f71();});});}function checkTranscribe(){var _0x1f81af;var _0x1405cb;var _0x1de3a8;return db[_0xa55e('0x3f')][_0xa55e('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x395e73){if(!_0x395e73||!_0x395e73['length']){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x41'));}_0x1f81af=_0x395e73;return db[_0xa55e('0x42')][_0xa55e('0x29')]({'where':{'id':0x1}});})[_0xa55e('0x12')](function(_0x2c35a8){if(!_0x2c35a8){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x43'));}_0x1405cb=_0x2c35a8;if(!_0x1405cb['transcribe']||!_0x1405cb[_0xa55e('0x44')]||!_0x1405cb[_0xa55e('0x11')]||!_0x1405cb[_0xa55e('0x2d')]||!_0x1405cb[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_0x1405cb[_0xa55e('0x44')]}});})[_0xa55e('0x12')](function(_0x4559c8){if(!_0x4559c8){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x2a'));}if(!_0x4559c8['data1']||!_0x4559c8[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1de3a8=_0x4559c8;var _0xa01634=[];_0x1f81af[_0xa55e('0x45')](function(_0x570474){_0xa01634[_0xa55e('0x46')](checkTranscribeJob(_0x570474,_0x1405cb,_0x1de3a8));});return BPromise['all'](_0xa01634);})[_0xa55e('0x47')](function(_0x5be88c){if(_0x5be88c){if(!_0x5be88c['name']||_0x5be88c[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0x3e')](_0x5be88c,{'showHidden':![],'depth':null}));}}});}exports[_0xa55e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8a5c=['VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','format','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','FAILED','FailureReason','resolve','sentiment','Positive','Mixed','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect'];(function(_0xf9167,_0x47c146){var _0x304f80=function(_0x537bc5){while(--_0x537bc5){_0xf9167['push'](_0xf9167['shift']());}};_0x304f80(++_0x47c146);}(_0x8a5c,0x136));var _0xc8a5=function(_0x1df192,_0x28324a){_0x1df192=_0x1df192-0x0;var _0x4f8109=_0x8a5c[_0x1df192];return _0x4f8109;};var _=require(_0xc8a5('0x0'));var AWS=require(_0xc8a5('0x1'));var rp=require(_0xc8a5('0x2'));var util=require(_0xc8a5('0x3'));var BPromise=require(_0xc8a5('0x4'));var db=require(_0xc8a5('0x5'))['db'];var logger=require(_0xc8a5('0x6'))(_0xc8a5('0x7'));function getTranscriptionJob(_0x84a3f4,_0x4dd6e0,_0x2b253c,_0x66b54){return new Promise(function(_0x5b6cc2,_0x1b4ed4){var _0xcee97e=new AWS[(_0xc8a5('0x8'))]({'accessKeyId':_0x4dd6e0,'secretAccessKey':_0x84a3f4,'region':_0x2b253c});_0xcee97e[_0xc8a5('0x9')]({'TranscriptionJobName':_0x66b54},function(_0x4d25e4,_0x3ecf08){if(_0x4d25e4){return _0x1b4ed4(_0x4d25e4);}else{return _0x5b6cc2(_0x3ecf08);}});});}function sentiment(_0x28529d,_0xbdcd79,_0x2c1fe9,_0x814714,_0x3b2ba3){return new Promise(function(_0x136146,_0x16fd9a){var _0xea6d98=new AWS['Comprehend']({'accessKeyId':_0xbdcd79,'secretAccessKey':_0x28529d,'region':_0x2c1fe9});_0xea6d98['detectSentiment']({'Text':_0x814714,'LanguageCode':_0x3b2ba3[_0xc8a5('0xa')](0x0,0x2)},function(_0x4a772e,_0xaa6fa2){if(_0x4a772e){return _0x16fd9a(_0x4a772e);}else{return _0x136146(_0xaa6fa2);}});});}function checkTranscribeJob(_0x38a605,_0x1295a9,_0x2c6402){var _0x3e1b4f;return new BPromise(function(_0x5c9d13,_0x16cffa){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0xc'),_0x38a605['id'],_0x38a605[_0xc8a5('0xd')]));return getTranscriptionJob(_0x2c6402[_0xc8a5('0xe')],_0x2c6402[_0xc8a5('0xf')],_0x1295a9[_0xc8a5('0x10')],_0x38a605[_0xc8a5('0xd')])['then'](function(_0xbc4806){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0x11'),_0x38a605['id'],_0x38a605[_0xc8a5('0xd')],_0xbc4806['TranscriptionJob'][_0xc8a5('0x12')]));if(!_0x38a605[_0xc8a5('0x13')]){switch(_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x12')]){case _0xc8a5('0x15'):var _0x4b0aa0={'transcribeStatus':_0xbc4806[_0xc8a5('0x14')]['TranscriptionJobStatus'],'fileUri':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x16')]['TranscriptFileUri']};logger['info'](util[_0xc8a5('0x17')](_0xc8a5('0x18'),_0x38a605['id']));return rp({'uri':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x16')][_0xc8a5('0x19')],'json':!![]})['then'](function(_0x4fec79){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x1a'),_0x38a605['id']));if(_0x4fec79&&_0x4fec79[_0xc8a5('0x1b')]&&_0x4fec79[_0xc8a5('0x1b')][_0xc8a5('0x1c')]&&_0x4fec79['results'][_0xc8a5('0x1c')][_0xc8a5('0x1d')]){_0x4b0aa0[_0xc8a5('0x13')]='';for(var _0x1e522c=0x0;_0x1e522c<_0x4fec79[_0xc8a5('0x1b')][_0xc8a5('0x1c')][_0xc8a5('0x1d')];_0x1e522c++){_0x4b0aa0[_0xc8a5('0x13')]+=_0x4fec79[_0xc8a5('0x1b')]['transcripts'][_0x1e522c][_0xc8a5('0x1e')]+'';}}return _0x38a605[_0xc8a5('0x1f')](_0x4b0aa0);})[_0xc8a5('0x20')](function(){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x21'),_0x38a605['id']));if(!_0x38a605[_0xc8a5('0x22')]){throw new db['Sequelize']['ValidationError'](_0xc8a5('0x23'));}if(!_0x1295a9['sentiment']||!_0x1295a9['sentimentAccountId']||!_0x1295a9[_0xc8a5('0x24')]||!_0x1295a9[_0xc8a5('0x25')]||!_0x1295a9[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x29'));}if(!_0x4b0aa0['fileText']){throw new Error(_0xc8a5('0x2a'));}if(_0x1295a9[_0xc8a5('0x2b')]===_0x2c6402['id']){return _0x2c6402;}else{return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_settings[_0xc8a5('0x2b')]}});}})[_0xc8a5('0x20')](function(_0x4b47dc){if(!_0x4b47dc){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2e'));}if(!_0x4b47dc[_0xc8a5('0xe')]||!_0x4b47dc['data2']){throw new db['Sequelize'][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x3e1b4f=_0x4b47dc;logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x30'),_0x38a605['id']));return sentiment(_0x3e1b4f['data1'],_0x3e1b4f[_0xc8a5('0xf')],_0x1295a9['sentimentRegion'],_0x4b0aa0[_0xc8a5('0x13')],_0x1295a9[_0xc8a5('0x25')]);})[_0xc8a5('0x20')](function(_0x5a2941){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x31'),_0x38a605['id']));return _0x38a605['update']({'sentiment':_0x5a2941[_0xc8a5('0x32')],'sPositive':_0x5a2941[_0xc8a5('0x33')]['Positive'],'sNegative':_0x5a2941[_0xc8a5('0x33')]['Negative'],'sMixed':_0x5a2941['SentimentScore']['Mixed'],'sNeutral':_0x5a2941['SentimentScore']['Neutral']});})[_0xc8a5('0x20')](function(){logger['info'](util[_0xc8a5('0x17')](_0xc8a5('0x21'),_0x38a605['id']));_0x5c9d13();});case _0xc8a5('0x34'):return _0x38a605[_0xc8a5('0x1f')]({'transcribeStatus':_0xc8a5('0x34'),'failureReason':_0xbc4806[_0xc8a5('0x14')][_0xc8a5('0x35')]})['then'](function(){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x38a605['id']));_0x5c9d13();});default:logger[_0xc8a5('0xb')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x38a605['id']));break;}}else{return BPromise[_0xc8a5('0x36')]()[_0xc8a5('0x20')](function(){if(!_0x38a605[_0xc8a5('0x22')]){throw new db['Sequelize']['ValidationError'](_0xc8a5('0x23'));}if(!_0x1295a9[_0xc8a5('0x37')]||!_0x1295a9[_0xc8a5('0x2b')]||!_0x1295a9[_0xc8a5('0x24')]||!_0x1295a9['language']||!_0x1295a9[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x38a605['fileText']){throw new Error(_0xc8a5('0x2a'));}if(_0x1295a9[_0xc8a5('0x2b')]===_0x2c6402['id']){return _0x2c6402;}else{return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_settings[_0xc8a5('0x2b')]}});}})['then'](function(_0x2f512f){if(!_0x2f512f){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2f512f[_0xc8a5('0xe')]||!_0x2f512f[_0xc8a5('0xf')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x3e1b4f=_0x2f512f;logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x30'),_0x38a605['id']));return sentiment(_0x3e1b4f[_0xc8a5('0xe')],_0x3e1b4f[_0xc8a5('0xf')],_0x1295a9[_0xc8a5('0x24')],_0x38a605[_0xc8a5('0x13')],_0x1295a9[_0xc8a5('0x25')]);})[_0xc8a5('0x20')](function(_0x5bc633){logger[_0xc8a5('0xb')](util[_0xc8a5('0x17')](_0xc8a5('0x31'),_0x38a605['id']));return _0x38a605[_0xc8a5('0x1f')]({'sentiment':_0x5bc633[_0xc8a5('0x32')],'sPositive':_0x5bc633[_0xc8a5('0x33')][_0xc8a5('0x38')],'sNegative':_0x5bc633[_0xc8a5('0x33')]['Negative'],'sMixed':_0x5bc633['SentimentScore'][_0xc8a5('0x39')],'sNeutral':_0x5bc633[_0xc8a5('0x33')][_0xc8a5('0x3a')],'transcribeStatus':'COMPLETED'});})[_0xc8a5('0x20')](function(){logger[_0xc8a5('0xb')](util['format'](_0xc8a5('0x21'),_0x38a605['id']));_0x5c9d13();});}})[_0xc8a5('0x3b')](function(_0x3e112f){if(_0x3e112f){if(!_0x3e112f[_0xc8a5('0x3c')]||_0x3e112f['name']!==_0xc8a5('0x3d')){logger[_0xc8a5('0x3e')](util[_0xc8a5('0x17')](_0xc8a5('0x3f'),_0x38a605['id']),util[_0xc8a5('0x40')](_0x3e112f,{'showHidden':![],'depth':null}));}}_0x5c9d13();});});}function checkTranscribe(){var _0x45dddf;var _0x5d2435;var _0x1b44df;return db[_0xc8a5('0x41')][_0xc8a5('0x42')]({'where':{'transcribeStatus':_0xc8a5('0x43')}})[_0xc8a5('0x20')](function(_0x1de54a){if(!_0x1de54a||!_0x1de54a[_0xc8a5('0x1d')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x44'));}_0x45dddf=_0x1de54a;return db[_0xc8a5('0x45')][_0xc8a5('0x2d')]({'where':{'id':0x1}});})[_0xc8a5('0x20')](function(_0x568ce2){if(!_0x568ce2){throw new db[(_0xc8a5('0x27'))]['ValidationError']('Settings\x20not\x20available');}_0x5d2435=_0x568ce2;if(!_0x5d2435['transcribe']||!_0x5d2435[_0xc8a5('0x46')]||!_0x5d2435['transcribeRegion']||!_0x5d2435[_0xc8a5('0x25')]||!_0x5d2435[_0xc8a5('0x26')]){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x47'));}return db[_0xc8a5('0x2c')][_0xc8a5('0x2d')]({'where':{'id':_0x5d2435[_0xc8a5('0x46')]}});})[_0xc8a5('0x20')](function(_0x4f9b24){if(!_0x4f9b24){throw new db[(_0xc8a5('0x27'))][(_0xc8a5('0x28'))](_0xc8a5('0x2e'));}if(!_0x4f9b24[_0xc8a5('0xe')]||!_0x4f9b24[_0xc8a5('0xf')]){throw new db['Sequelize'][(_0xc8a5('0x28'))](_0xc8a5('0x2f'));}_0x1b44df=_0x4f9b24;var _0x21f299=[];_0x45dddf[_0xc8a5('0x48')](function(_0x50218c){_0x21f299['push'](checkTranscribeJob(_0x50218c,_0x5d2435,_0x1b44df));});return BPromise[_0xc8a5('0x49')](_0x21f299);})['catch'](function(_0x43e530){if(_0x43e530){if(!_0x43e530[_0xc8a5('0x3c')]||_0x43e530['name']!==_0xc8a5('0x3d')){logger['error'](util[_0xc8a5('0x40')](_0x43e530,{'showHidden':![],'depth':null}));}}});}exports[_0xc8a5('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index e3fca99..e492fb8 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b11=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../logger','defaults','redis','findAll','lastMsgAt','then','length','map','info','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x23a12d,_0x4171f2){var _0x136b63=function(_0x5292f6){while(--_0x5292f6){_0x23a12d['push'](_0x23a12d['shift']());}};_0x136b63(++_0x4171f2);}(_0x5b11,0x133));var _0x15b1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5b11[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x15b1('0x0'));var moment=require(_0x15b1('0x1'));var Redis=require(_0x15b1('0x2'));var util=require(_0x15b1('0x3'));var config=require(_0x15b1('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x15b1('0x5'))('schedule');config['redis']=_[_0x15b1('0x6')](config[_0x15b1('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x15b1('0x7')]));function closeInteractions(){var _0x2012ee=[];return db['WhatsappInteraction'][_0x15b1('0x8')]({'raw':!![],'attributes':['id',_0x15b1('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})[_0x15b1('0xa')](function(_0x12e093){if(_0x12e093&&_0x12e093[_0x15b1('0xb')]){_0x2012ee=_[_0x15b1('0xc')](_0x12e093||[],'id');logger[_0x15b1('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2012ee['join']());return db['WhatsappInteraction'][_0x15b1('0xe')]({'closeReason':_0x15b1('0xf'),'disposition':_0x15b1('0x10'),'closed':!![],'closedAt':moment()['format'](_0x15b1('0x11'))},{'where':{'id':_0x2012ee}});}})[_0x15b1('0xa')](function(){if(_0x2012ee&&_0x2012ee[_0x15b1('0xb')]){logger['info'](_0x15b1('0x12'),_0x2012ee[_0x15b1('0x13')]());for(var _0x25e1c5=0x0;_0x25e1c5<_0x2012ee[_0x15b1('0xb')];_0x25e1c5++){io[_0x15b1('0x14')]('whatsappInteraction:update',{'id':_0x2012ee[_0x25e1c5],'closed':!![]});}}})[_0x15b1('0x15')](function(_0x5d5002){logger[_0x15b1('0x16')](_0x15b1('0x17'),_0x5d5002?util[_0x15b1('0x18')](_0x5d5002,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5580=['format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout'];(function(_0x1590cf,_0x243a3b){var _0x27531a=function(_0x421f0c){while(--_0x421f0c){_0x1590cf['push'](_0x1590cf['shift']());}};_0x27531a(++_0x243a3b);}(_0x5580,0xbd));var _0x0558=function(_0x8d5637,_0x573812){_0x8d5637=_0x8d5637-0x0;var _0x88a823=_0x5580[_0x8d5637];return _0x88a823;};'use strict';var _=require(_0x0558('0x0'));var moment=require('moment');var Redis=require(_0x0558('0x1'));var util=require(_0x0558('0x2'));var config=require(_0x0558('0x3'));var db=require(_0x0558('0x4'))['db'];var logger=require(_0x0558('0x5'))(_0x0558('0x6'));config['redis']=_['defaults'](config[_0x0558('0x7')],{'host':_0x0558('0x8'),'port':0x18eb});var io=require(_0x0558('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x258891=[];return db['WhatsappInteraction'][_0x0558('0xa')]({'raw':!![],'attributes':['id',_0x0558('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0558('0xc')](0x18,_0x0558('0xd'))}}})['then'](function(_0x2a73b5){if(_0x2a73b5&&_0x2a73b5[_0x0558('0xe')]){_0x258891=_[_0x0558('0xf')](_0x2a73b5||[],'id');logger['info'](_0x0558('0x10'),_0x258891['join']());return db[_0x0558('0x11')][_0x0558('0x12')]({'closeReason':_0x0558('0x13'),'disposition':_0x0558('0x14'),'closed':!![],'closedAt':moment()[_0x0558('0x15')](_0x0558('0x16'))},{'where':{'id':_0x258891}});}})[_0x0558('0x17')](function(){if(_0x258891&&_0x258891[_0x0558('0xe')]){logger['info'](_0x0558('0x18'),_0x258891[_0x0558('0x19')]());for(var _0x229f27=0x0;_0x229f27<_0x258891[_0x0558('0xe')];_0x229f27++){io[_0x0558('0x1a')](_0x0558('0x1b'),{'id':_0x258891[_0x229f27],'closed':!![]});}}})[_0x0558('0x1c')](function(_0x37e9ca){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x37e9ca?util['inspect'](_0x37e9ca,{'showHidden':![],'depth':null}):'');});}exports[_0x0558('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index a0371f1..b475df9 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d21=['then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','destroy'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x8d21,0x101));var _0x18d2=function(_0x384456,_0x22ffb7){_0x384456=_0x384456-0x0;var _0x3bc7ad=_0x8d21[_0x384456];return _0x3bc7ad;};'use strict';var util=require(_0x18d2('0x0'));var db=require(_0x18d2('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x18d2('0x2')]({'id':i,'firstName':_0x18d2('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x18d2('0x4')+i+_0x18d2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x18d2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x18d2('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x18d2('0x2')]({'id':i,'firstName':_0x18d2('0x3')+i,'lastName':_0x18d2('0x7')+i,'phone':0xf879fb460+i,'email':_0x18d2('0x4')+i+_0x18d2('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x18d2('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x18d2('0x6')](),'updatedAt':Date[_0x18d2('0x6')]()});}db['CmContact'][_0x18d2('0x8')]({'where':{}})[_0x18d2('0x9')](function(){return db['CmContact'][_0x18d2('0xa')](contacts);})[_0x18d2('0x9')](function(){console[_0x18d2('0xb')]('finished\x20populating',_0x18d2('0xc'));return db[_0x18d2('0xd')][_0x18d2('0x8')]({'where':{}});})['then'](function(){return db[_0x18d2('0xd')]['bulkCreate'](hopper);})['then'](function(){console[_0x18d2('0xb')](_0x18d2('0xe'),_0x18d2('0xf'));return db['CmContact'][_0x18d2('0xa')](contacts2);})[_0x18d2('0x9')](function(){console[_0x18d2('0xb')](_0x18d2('0xe'),_0x18d2('0x10'));return db[_0x18d2('0xd')][_0x18d2('0xa')](hopper2);})[_0x18d2('0x9')](function(){console[_0x18d2('0xb')](_0x18d2('0xe'),_0x18d2('0x11'));})[_0x18d2('0x12')](function(_0x5d6ddd){console[_0x18d2('0xb')](_0x5d6ddd);}); \ No newline at end of file +var _0x4c3e=['now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper','hopper1','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com'];(function(_0x4974e2,_0x30267f){var _0x3f8cfb=function(_0x2b03e6){while(--_0x2b03e6){_0x4974e2['push'](_0x4974e2['shift']());}};_0x3f8cfb(++_0x30267f);}(_0x4c3e,0x191));var _0xe4c3=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4c3e[_0x46aff0];return _0x9d78cf;};'use strict';var util=require(_0xe4c3('0x0'));var db=require(_0xe4c3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe4c3('0x2')]({'id':i,'firstName':_0xe4c3('0x3')+i,'lastName':_0xe4c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xe4c3('0x5')+i+_0xe4c3('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe4c3('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xe4c3('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xe4c3('0x3')+i,'lastName':_0xe4c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xe4c3('0x5')+i+_0xe4c3('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe4c3('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe4c3('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe4c3('0x7')](),'updatedAt':Date[_0xe4c3('0x7')]()});}db[_0xe4c3('0x8')][_0xe4c3('0x9')]({'where':{}})[_0xe4c3('0xa')](function(){return db[_0xe4c3('0x8')][_0xe4c3('0xb')](contacts);})['then'](function(){console[_0xe4c3('0xc')](_0xe4c3('0xd'),'contacts1');return db[_0xe4c3('0xe')][_0xe4c3('0x9')]({'where':{}});})[_0xe4c3('0xa')](function(){return db['CmHopper'][_0xe4c3('0xb')](hopper);})[_0xe4c3('0xa')](function(){console['log']('finished\x20populating',_0xe4c3('0xf'));return db[_0xe4c3('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0xe4c3('0xc')](_0xe4c3('0xd'),'contacts2');return db[_0xe4c3('0xe')][_0xe4c3('0xb')](hopper2);})[_0xe4c3('0xa')](function(){console[_0xe4c3('0xc')](_0xe4c3('0xd'),'hopper2');})[_0xe4c3('0x10')](function(_0x210e80){console[_0xe4c3('0xc')](_0x210e80);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index a046059..11ae35b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcdba=['password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent'];(function(_0x2eea78,_0x32c47b){var _0x583e23=function(_0x4502c4){while(--_0x4502c4){_0x2eea78['push'](_0x2eea78['shift']());}};_0x583e23(++_0x32c47b);}(_0xcdba,0x177));var _0xacdb=function(_0x144e61,_0x358b4b){_0x144e61=_0x144e61-0x0;var _0x28e331=_0xcdba[_0x144e61];return _0x28e331;};'use strict';var util=require(_0xacdb('0x0'));var db=require(_0xacdb('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xacdb('0x2')](_0xacdb('0x3'),'agent',i),'fullname':util[_0xacdb('0x2')](_0xacdb('0x3'),_0xacdb('0x4'),i),'email':util[_0xacdb('0x2')]('%s%s@xcally.com','agent',i),'role':_0xacdb('0x4'),'password':_0xacdb('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xacdb('0x6'),'ws',_0xacdb('0x7')],'disallow':[_0xacdb('0x8')],'allow':[_0xacdb('0x9')],'defaultuser':util[_0xacdb('0x2')]('%s%s',_0xacdb('0x4'),i),'encryption':'yes','avpf':_0xacdb('0xa'),'force_avp':_0xacdb('0xa'),'icesupport':'yes','dtlsenable':_0xacdb('0xa'),'dtlsverify':'no','dtlscertfile':_0xacdb('0xb'),'dtlsprivatekey':_0xacdb('0xc'),'dtlssetup':'actpass','callerid':util[_0xacdb('0x2')](_0xacdb('0xd'),util[_0xacdb('0x2')](_0xacdb('0x3'),_0xacdb('0x4'),i),0xfa0+i)});}db[_0xacdb('0xe')][_0xacdb('0xf')](users)['then'](function(){console[_0xacdb('0x10')](_0xacdb('0x11'));})[_0xacdb('0x12')](function(_0x34bac5){console[_0xacdb('0x10')](_0x34bac5);}); \ No newline at end of file +var _0xa3d3=['udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','bulkCreate','log','add\x20user','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x251628,_0x1a75e1){var _0x2ed8a0=function(_0x43247b){while(--_0x43247b){_0x251628['push'](_0x251628['shift']());}};_0x2ed8a0(++_0x1a75e1);}(_0xa3d3,0x190));var _0x3a3d=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xa3d3[_0xc8a931];return _0x28bd27;};'use strict';var util=require('util');var db=require(_0x3a3d('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3a3d('0x1')]({'name':util[_0x3a3d('0x2')]('%s%s','agent',i),'fullname':util['format'](_0x3a3d('0x3'),_0x3a3d('0x4'),i),'email':util[_0x3a3d('0x2')](_0x3a3d('0x5'),_0x3a3d('0x4'),i),'role':'agent','password':_0x3a3d('0x6'),'internal':0xfa0+i,'type':_0x3a3d('0x7'),'transport':[_0x3a3d('0x8'),'ws','wss'],'disallow':[_0x3a3d('0x9')],'allow':[_0x3a3d('0xa')],'defaultuser':util[_0x3a3d('0x2')](_0x3a3d('0x3'),'agent',i),'encryption':_0x3a3d('0xb'),'avpf':'yes','force_avp':_0x3a3d('0xb'),'icesupport':_0x3a3d('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3a3d('0xc'),'dtlssetup':_0x3a3d('0xd'),'callerid':util[_0x3a3d('0x2')]('\x22%s\x22\x20<%s>',util[_0x3a3d('0x2')]('%s%s',_0x3a3d('0x4'),i),0xfa0+i)});}db['User'][_0x3a3d('0xe')](users)['then'](function(){console[_0x3a3d('0xf')](_0x3a3d('0x10'));})['catch'](function(_0xf8a633){console[_0x3a3d('0xf')](_0xf8a633);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ebda0f0..e3f7c12 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba6f=['where','Campaign','ivr','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','address','disconnect','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','map'];(function(_0x27bd9b,_0x206238){var _0xbd6219=function(_0x3c1577){while(--_0x3c1577){_0x27bd9b['push'](_0x27bd9b['shift']());}};_0xbd6219(++_0x206238);}(_0xba6f,0x1d0));var _0xfba6=function(_0xd6c010,_0x5355e6){_0xd6c010=_0xd6c010-0x0;var _0x15893b=_0xba6f[_0xd6c010];return _0x15893b;};'use strict';var _=require(_0xfba6('0x0'));var util=require('util');var BPromise=require(_0xfba6('0x1'));var db=require(_0xfba6('0x2'))['db'];var config=require(_0xfba6('0x3'));var queryQueues={'attributes':['id',_0xfba6('0x4')],'include':[{'as':_0xfba6('0x5'),'model':db[_0xfba6('0x6')],'attributes':['id',_0xfba6('0x4'),_0xfba6('0x7')],'raw':!![],'where':{'role':_0xfba6('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfba6('0x4')],'where':{'role':_0xfba6('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xfba6('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xfba6('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfba6('0x4'),_0xfba6('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4b4789,_0x5b4f54,_0x3effea){return db[_0xfba6('0xb')][_0xfba6('0xc')]({'where':{'name':_0x4b4789,'userProfileId':_0x5b4f54},'raw':!![]})[_0xfba6('0xd')](function(_0x1ef8fd){if(_0x1ef8fd){if(_0x1ef8fd[_0xfba6('0xe')]){switch(_0x4b4789){case _0xfba6('0xf'):case _0xfba6('0x10'):case _0xfba6('0x11'):case _0xfba6('0x12'):case _0xfba6('0x13'):case'OpenchannelQueues':case _0xfba6('0x14'):return db[_0x3effea][_0xfba6('0x15')](queryQueues);case _0xfba6('0x16'):return db[_0x3effea][_0xfba6('0x15')](queryTelephones);case'Trunks':return db[_0x3effea][_0xfba6('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x3effea]['findAll'](queryCampaigns);}}else{return db[_0xfba6('0x17')][_0xfba6('0x15')]({'attributes':[_0xfba6('0x18')],'where':{'sectionId':_0x1ef8fd['id']},'raw':!![]})[_0xfba6('0xd')](function(_0x38055e){if(_0x38055e){var _0x2c4692={'where':{'id':_[_0xfba6('0x19')](_0x38055e,_0xfba6('0x18'))},'raw':!![]};switch(_0x3effea){case _0xfba6('0x6'):_0x2c4692[_0xfba6('0x1a')][_0xfba6('0x7')]=_0xfba6('0x9');break;case _0xfba6('0x1b'):_0x2c4692['where'][_0xfba6('0xa')]=_0xfba6('0x1c');break;}return db[_0x3effea]['findAll'](_0x2c4692);}else{return[];}});}}else{return[];}})['then'](function(_0x1fc324){return _0x1fc324;});}function joinOrLeaveQueues(_0x204784,_0x5b382f,_0x14990f,_0x400aa4){_0x204784[_0x5b382f](util[_0xfba6('0x1d')]('%s:queue:%s',_0x14990f,_0x400aa4[_0xfba6('0x4')]));if(_0x400aa4[_0xfba6('0x5')]){for(var _0xa16868=0x0;_0xa16868<_0x400aa4['Agents'][_0xfba6('0x1e')];_0xa16868+=0x1){_0x204784[_0x5b382f](util[_0xfba6('0x1d')](_0xfba6('0x1f'),_0x400aa4[_0xfba6('0x5')][_0xa16868][_0xfba6('0x4')]));}}}function joinOrLeave(_0x444856,_0x203a4e,_0x56b427){var _0x5e09ff;if(_0x444856[_0xfba6('0x20')][_0xfba6('0x21')]['id']){db[_0xfba6('0x6')][_0xfba6('0x22')]({'attributes':['id',_0xfba6('0x4'),'role',_0xfba6('0x23')],'where':{'id':_0x444856[_0xfba6('0x20')][_0xfba6('0x21')]['id']},'include':[{'model':db[_0xfba6('0x24')],'as':_0xfba6('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xfba6('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfba6('0x27')],'as':_0xfba6('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xfba6('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xfba6('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfba6('0x2b')],'as':_0xfba6('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x47973f){if(_0x47973f){_0x5e09ff=_0x47973f;_0x444856[_0x203a4e](util['format'](_0xfba6('0x1f'),_0x47973f[_0xfba6('0x4')]));var _0x24e860=[];switch(_0x47973f['role']){case _0xfba6('0x2d'):_0x444856[_0x203a4e](_0xfba6('0x2e'));_0x444856[_0x203a4e](_0xfba6('0x2f'));if(queryQueues[_0xfba6('0x30')]('include')){delete queryQueues[_0xfba6('0x31')];}_0x24e860['push'](db[_0xfba6('0x32')][_0xfba6('0x15')](queryQueues));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x34')][_0xfba6('0x15')](queryQueues));_0x24e860['push'](db[_0xfba6('0x35')][_0xfba6('0x15')](queryQueues));_0x24e860['push'](db[_0xfba6('0x36')][_0xfba6('0x15')](queryQueues));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x37')][_0xfba6('0x15')](queryQueues));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x38')][_0xfba6('0x15')](queryQueues));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x39')][_0xfba6('0x15')](queryQueues));_0x24e860[_0xfba6('0x33')](db['User'][_0xfba6('0x15')](queryTelephones));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x3a')][_0xfba6('0x15')](queryTrunks));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x1b')][_0xfba6('0x15')](queryCampaigns));_0x24e860[_0xfba6('0x33')](db[_0xfba6('0x6')][_0xfba6('0x15')](queryAgents));break;case _0xfba6('0x3b'):_0x444856[_0x203a4e]('voice:inbound');_0x444856[_0x203a4e](_0xfba6('0x2f'));_0x24e860['push'](getAssociatedResources(_0xfba6('0xf'),_0x47973f[_0xfba6('0x23')],_0xfba6('0x32')));_0x24e860[_0xfba6('0x33')](getAssociatedResources(_0xfba6('0x10'),_0x47973f[_0xfba6('0x23')],_0xfba6('0x34')));_0x24e860[_0xfba6('0x33')](getAssociatedResources('FaxQueues',_0x47973f[_0xfba6('0x23')],_0xfba6('0x35')));_0x24e860['push'](getAssociatedResources(_0xfba6('0x12'),_0x47973f['userProfileId'],_0xfba6('0x36')));_0x24e860[_0xfba6('0x33')](getAssociatedResources('MailQueues',_0x47973f[_0xfba6('0x23')],_0xfba6('0x37')));_0x24e860[_0xfba6('0x33')](getAssociatedResources('OpenchannelQueues',_0x47973f[_0xfba6('0x23')],_0xfba6('0x38')));_0x24e860[_0xfba6('0x33')](getAssociatedResources(_0xfba6('0x14'),_0x47973f[_0xfba6('0x23')],_0xfba6('0x39')));_0x24e860['push'](getAssociatedResources(_0xfba6('0x16'),_0x47973f[_0xfba6('0x23')],_0xfba6('0x6')));_0x24e860[_0xfba6('0x33')](getAssociatedResources(_0xfba6('0x3c'),_0x47973f[_0xfba6('0x23')],_0xfba6('0x3a')));_0x24e860[_0xfba6('0x33')](getAssociatedResources('IvrCampaigns',_0x47973f['userProfileId'],_0xfba6('0x1b')));_0x24e860['push'](db[_0xfba6('0x6')][_0xfba6('0x15')](queryAgents));break;case _0xfba6('0x8'):_0x444856[_0x203a4e](_0xfba6('0x2e'));_0x444856[_0x203a4e]('voice:outbound');_0x24e860[_0xfba6('0x33')](_0x47973f['getVoiceQueues']({'attributes':['id',_0xfba6('0x4')]}));_0x24e860['push'](_0x47973f[_0xfba6('0x3d')]({'attributes':['id',_0xfba6('0x4')]}));_0x24e860[_0xfba6('0x33')](_0x47973f[_0xfba6('0x3e')]({'attributes':['id',_0xfba6('0x4')]}));_0x24e860[_0xfba6('0x33')](_0x47973f[_0xfba6('0x3f')]({'attributes':['id',_0xfba6('0x4')]}));_0x24e860[_0xfba6('0x33')](_0x47973f['getMailQueues']({'attributes':['id',_0xfba6('0x4')]}));_0x24e860[_0xfba6('0x33')](_0x47973f[_0xfba6('0x40')]({'attributes':['id',_0xfba6('0x4')]}));_0x24e860[_0xfba6('0x33')](_0x47973f[_0xfba6('0x41')]({'attributes':['id',_0xfba6('0x4')]}));break;}return BPromise[_0xfba6('0x42')](_0x24e860);}})[_0xfba6('0xd')](function(_0x251bbc){if(_0x251bbc&&_0x251bbc[_0xfba6('0x1e')]){for(var _0x31c30c=0x0;_0x31c30c<_0x251bbc[_0xfba6('0x1e')];_0x31c30c+=0x1){for(var _0x319637=0x0;_0x319637<_0x251bbc[_0x31c30c][_0xfba6('0x1e')];_0x319637+=0x1){switch(_0x31c30c){case 0x0:joinOrLeaveQueues(_0x444856,_0x203a4e,'voice',_0x251bbc[_0x31c30c][_0x319637]);break;case 0x1:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x43'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x2:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x44'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x3:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x45'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x4:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x46'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x5:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x47'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x6:joinOrLeaveQueues(_0x444856,_0x203a4e,_0xfba6('0x48'),_0x251bbc[_0x31c30c][_0x319637]);break;case 0x7:if(_0x5e09ff[_0xfba6('0x7')]!==_0xfba6('0x8'))_0x444856[_0x203a4e](util['format']('telephone:%s',_0x251bbc[_0x31c30c][_0x319637][_0xfba6('0x4')]));break;case 0x8:if(_0x5e09ff[_0xfba6('0x7')]!==_0xfba6('0x8'))_0x444856[_0x203a4e](util[_0xfba6('0x1d')](_0xfba6('0x49'),_0x251bbc[_0x31c30c][_0x319637]['name']));break;case 0x9:if(_0x5e09ff['role']!==_0xfba6('0x8'))_0x444856[_0x203a4e](util[_0xfba6('0x1d')]('campaign:%s:%s',_0x251bbc[_0x31c30c][_0x319637][_0xfba6('0xa')],_0x251bbc[_0x31c30c][_0x319637][_0xfba6('0x4')]));break;case 0xa:_0x444856[_0x203a4e](util[_0xfba6('0x1d')]('user:%s',_0x251bbc[_0x31c30c][_0x319637][_0xfba6('0x4')]));break;}}}}})['then'](function(){if(_0x203a4e===_0xfba6('0x4a')){var _0x1a68b3=_[_0xfba6('0x19')](_0x5e09ff[_0xfba6('0x25')],'id');return _0x5e09ff[_0xfba6('0x4b')](_0x1a68b3)[_0xfba6('0xd')](function(){for(var _0x37b571=0x0;_0x37b571<_0x1a68b3[_0xfba6('0x1e')];_0x37b571+=0x1){_0x56b427[_0xfba6('0x4c')](_0xfba6('0x4d'),{'ChatInteractionId':Number(_0x1a68b3[_0x37b571]),'UserId':Number(_0x5e09ff['id'])});}});}})[_0xfba6('0xd')](function(){if(_0x203a4e===_0xfba6('0x4a')){var _0x1173d8=_['map'](_0x5e09ff[_0xfba6('0x4e')],'id');return _0x5e09ff['removeMailInteractions'](_0x1173d8)[_0xfba6('0xd')](function(){for(var _0x327833=0x0;_0x327833<_0x1173d8['length'];_0x327833+=0x1){_0x56b427[_0xfba6('0x4c')](_0xfba6('0x4f'),{'MailInteractionId':Number(_0x1173d8[_0x327833]),'UserId':Number(_0x5e09ff['id'])});}});}})[_0xfba6('0xd')](function(){if(_0x203a4e===_0xfba6('0x4a')){var _0x7a6bf1=_[_0xfba6('0x19')](_0x5e09ff[_0xfba6('0x28')],'id');return _0x5e09ff[_0xfba6('0x50')](_0x7a6bf1)[_0xfba6('0xd')](function(){for(var _0x50ee4c=0x0;_0x50ee4c<_0x7a6bf1[_0xfba6('0x1e')];_0x50ee4c+=0x1){_0x56b427[_0xfba6('0x4c')](_0xfba6('0x51'),{'FaxInteractionId':Number(_0x7a6bf1[_0x50ee4c]),'UserId':Number(_0x5e09ff['id'])});}});}})[_0xfba6('0xd')](function(){if(_0x203a4e===_0xfba6('0x4a')){var _0xea7c3b=_[_0xfba6('0x19')](_0x5e09ff[_0xfba6('0x29')],'id');return _0x5e09ff[_0xfba6('0x52')](_0xea7c3b)[_0xfba6('0xd')](function(){for(var _0xfa4398=0x0;_0xfa4398<_0xea7c3b[_0xfba6('0x1e')];_0xfa4398+=0x1){_0x56b427[_0xfba6('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xea7c3b[_0xfa4398]),'UserId':Number(_0x5e09ff['id'])});}});}})[_0xfba6('0xd')](function(){if(_0x203a4e===_0xfba6('0x4a')){var _0x48b937=_[_0xfba6('0x19')](_0x5e09ff[_0xfba6('0x53')],'id');return _0x5e09ff[_0xfba6('0x54')](_0x48b937)[_0xfba6('0xd')](function(){for(var _0x2eb0e7=0x0;_0x2eb0e7<_0x48b937[_0xfba6('0x1e')];_0x2eb0e7+=0x1){_0x56b427[_0xfba6('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x48b937[_0x2eb0e7]),'UserId':Number(_0x5e09ff['id'])});}});}})['then'](function(){if(_0x203a4e==='leave'){var _0x5832fb=_[_0xfba6('0x19')](_0x5e09ff[_0xfba6('0x2c')],'id');return _0x5e09ff[_0xfba6('0x55')](_0x5832fb)[_0xfba6('0xd')](function(){for(var _0x2a20ab=0x0;_0x2a20ab<_0x5832fb[_0xfba6('0x1e')];_0x2a20ab+=0x1){_0x56b427['emit'](_0xfba6('0x56'),{'WhatsappInteractionId':Number(_0x5832fb[_0x2a20ab]),'UserId':Number(_0x5e09ff['id'])});}});}})[_0xfba6('0x57')](function(_0x2ffbc2){_0x444856[_0xfba6('0x58')](_0x2ffbc2);});}}function onDisconnect(_0x107953,_0x56de3a){joinOrLeave(_0x107953,_0xfba6('0x4a'),_0x56de3a);}function onConnect(_0x50897a){joinOrLeave(_0x50897a,_0xfba6('0x59'));}exports['default']=function(_0x1452f7){_0x1452f7['on'](_0xfba6('0x5a'),function(_0x3c43c5){_0x3c43c5[_0xfba6('0x5b')](0x0);_0x3c43c5['address']=_0x3c43c5[_0xfba6('0x5c')][_0xfba6('0x5a')][_0xfba6('0x5d')]+':'+_0x3c43c5[_0xfba6('0x5c')][_0xfba6('0x5a')][_0xfba6('0x5e')];_0x3c43c5['connectedAt']=new Date();_0x3c43c5['log']=function(_0x1b11f2){console['log'](_0xfba6('0x5f')+_0x3c43c5['nsp'][_0xfba6('0x4')]+'['+_0x3c43c5[_0xfba6('0x60')]+']',_0x1b11f2);};_0x3c43c5['on'](_0xfba6('0x61'),function(){onDisconnect(_0x3c43c5,_0x1452f7);_0x3c43c5[_0xfba6('0x58')]('DISCONNECTED');});onConnect(_0x3c43c5);_0x3c43c5[_0xfba6('0x58')]('CONNECTED');});}; \ No newline at end of file +var _0xeb3b=['DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','User','role','name','telephone','agent','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','map','Campaign','where','type','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','format','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','ChatQueues','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','emit','user_has_sms_interactions:remove','OpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','disconnect'];(function(_0x574b24,_0x2551e6){var _0x58e1fe=function(_0x32ea8d){while(--_0x32ea8d){_0x574b24['push'](_0x574b24['shift']());}};_0x58e1fe(++_0x2551e6);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0xeb3b[_0x86337d];return _0x22b2c6;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var BPromise=require(_0xbeb3('0x2'));var db=require(_0xbeb3('0x3'))['db'];var config=require(_0xbeb3('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xbeb3('0x5')],'attributes':['id','name',_0xbeb3('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xbeb3('0x7')],'where':{'role':_0xbeb3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbeb3('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0xbeb3('0x7')],'where':{'role':_0xbeb3('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbeb3('0x7'),'type'],'where':{'type':_0xbeb3('0xa')}};function getAssociatedResources(_0x26e0f3,_0x2a029e,_0x3b61ac){return db[_0xbeb3('0xb')][_0xbeb3('0xc')]({'where':{'name':_0x26e0f3,'userProfileId':_0x2a029e},'raw':!![]})[_0xbeb3('0xd')](function(_0x567333){if(_0x567333){if(_0x567333[_0xbeb3('0xe')]){switch(_0x26e0f3){case _0xbeb3('0xf'):case'ChatQueues':case _0xbeb3('0x10'):case _0xbeb3('0x11'):case _0xbeb3('0x12'):case _0xbeb3('0x13'):case _0xbeb3('0x14'):return db[_0x3b61ac][_0xbeb3('0x15')](queryQueues);case'Telephones':return db[_0x3b61ac]['findAll'](queryTelephones);case _0xbeb3('0x16'):return db[_0x3b61ac][_0xbeb3('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x3b61ac]['findAll'](queryCampaigns);}}else{return db[_0xbeb3('0x17')][_0xbeb3('0x15')]({'attributes':[_0xbeb3('0x18')],'where':{'sectionId':_0x567333['id']},'raw':!![]})[_0xbeb3('0xd')](function(_0x26daf2){if(_0x26daf2){var _0x535836={'where':{'id':_[_0xbeb3('0x19')](_0x26daf2,'resourceId')},'raw':!![]};switch(_0x3b61ac){case _0xbeb3('0x5'):_0x535836['where']['role']='telephone';break;case _0xbeb3('0x1a'):_0x535836[_0xbeb3('0x1b')][_0xbeb3('0x1c')]=_0xbeb3('0xa');break;}return db[_0x3b61ac]['findAll'](_0x535836);}else{return[];}});}}else{return[];}})[_0xbeb3('0xd')](function(_0x821d92){return _0x821d92;});}function joinOrLeaveQueues(_0xe2cc47,_0x495c0a,_0x4af96f,_0x31c1bf){_0xe2cc47[_0x495c0a](util['format'](_0xbeb3('0x1d'),_0x4af96f,_0x31c1bf['name']));if(_0x31c1bf['Agents']){for(var _0xfa2736=0x0;_0xfa2736<_0x31c1bf[_0xbeb3('0x1e')][_0xbeb3('0x1f')];_0xfa2736+=0x1){_0xe2cc47[_0x495c0a](util['format'](_0xbeb3('0x20'),_0x31c1bf[_0xbeb3('0x1e')][_0xfa2736]['name']));}}}function joinOrLeave(_0x1703a0,_0x366bdb,_0x55a59d){var _0xfc384a;if(_0x1703a0[_0xbeb3('0x21')][_0xbeb3('0x22')]['id']){db[_0xbeb3('0x5')][_0xbeb3('0x23')]({'attributes':['id',_0xbeb3('0x7'),_0xbeb3('0x6'),_0xbeb3('0x24')],'where':{'id':_0x1703a0[_0xbeb3('0x21')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xbeb3('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xbeb3('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xbeb3('0x27')],'as':_0xbeb3('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xbeb3('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbeb3('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbeb3('0x2b')],'as':_0xbeb3('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x483198){if(_0x483198){_0xfc384a=_0x483198;_0x1703a0[_0x366bdb](util[_0xbeb3('0x2d')]('user:%s',_0x483198['name']));var _0x520b8e=[];switch(_0x483198['role']){case _0xbeb3('0x2e'):_0x1703a0[_0x366bdb]('voice:inbound');_0x1703a0[_0x366bdb](_0xbeb3('0x2f'));if(queryQueues[_0xbeb3('0x30')](_0xbeb3('0x31'))){delete queryQueues[_0xbeb3('0x31')];}_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x33')][_0xbeb3('0x15')](queryQueues));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x34')][_0xbeb3('0x15')](queryQueues));_0x520b8e['push'](db[_0xbeb3('0x35')][_0xbeb3('0x15')](queryQueues));_0x520b8e['push'](db[_0xbeb3('0x36')][_0xbeb3('0x15')](queryQueues));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x37')]['findAll'](queryQueues));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x38')][_0xbeb3('0x15')](queryQueues));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x39')][_0xbeb3('0x15')](queryQueues));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x5')][_0xbeb3('0x15')](queryTelephones));_0x520b8e['push'](db[_0xbeb3('0x3a')]['findAll'](queryTrunks));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x1a')][_0xbeb3('0x15')](queryCampaigns));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x5')][_0xbeb3('0x15')](queryAgents));break;case _0xbeb3('0x3b'):_0x1703a0[_0x366bdb](_0xbeb3('0x3c'));_0x1703a0[_0x366bdb]('voice:outbound');_0x520b8e[_0xbeb3('0x32')](getAssociatedResources('VoiceQueues',_0x483198['userProfileId'],'VoiceQueue'));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources(_0xbeb3('0x3d'),_0x483198[_0xbeb3('0x24')],_0xbeb3('0x34')));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources(_0xbeb3('0x10'),_0x483198['userProfileId'],_0xbeb3('0x35')));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources(_0xbeb3('0x11'),_0x483198['userProfileId'],'SmsQueue'));_0x520b8e['push'](getAssociatedResources(_0xbeb3('0x12'),_0x483198[_0xbeb3('0x24')],_0xbeb3('0x37')));_0x520b8e['push'](getAssociatedResources(_0xbeb3('0x13'),_0x483198['userProfileId'],_0xbeb3('0x38')));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources(_0xbeb3('0x14'),_0x483198[_0xbeb3('0x24')],'WhatsappQueue'));_0x520b8e['push'](getAssociatedResources(_0xbeb3('0x3e'),_0x483198[_0xbeb3('0x24')],_0xbeb3('0x5')));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources(_0xbeb3('0x16'),_0x483198[_0xbeb3('0x24')],_0xbeb3('0x3a')));_0x520b8e[_0xbeb3('0x32')](getAssociatedResources('IvrCampaigns',_0x483198[_0xbeb3('0x24')],_0xbeb3('0x1a')));_0x520b8e[_0xbeb3('0x32')](db[_0xbeb3('0x5')][_0xbeb3('0x15')](queryAgents));break;case _0xbeb3('0x9'):_0x1703a0[_0x366bdb](_0xbeb3('0x3c'));_0x1703a0[_0x366bdb]('voice:outbound');_0x520b8e[_0xbeb3('0x32')](_0x483198[_0xbeb3('0x3f')]({'attributes':['id',_0xbeb3('0x7')]}));_0x520b8e[_0xbeb3('0x32')](_0x483198[_0xbeb3('0x40')]({'attributes':['id',_0xbeb3('0x7')]}));_0x520b8e[_0xbeb3('0x32')](_0x483198[_0xbeb3('0x41')]({'attributes':['id',_0xbeb3('0x7')]}));_0x520b8e[_0xbeb3('0x32')](_0x483198[_0xbeb3('0x42')]({'attributes':['id',_0xbeb3('0x7')]}));_0x520b8e[_0xbeb3('0x32')](_0x483198['getMailQueues']({'attributes':['id',_0xbeb3('0x7')]}));_0x520b8e[_0xbeb3('0x32')](_0x483198[_0xbeb3('0x43')]({'attributes':['id','name']}));_0x520b8e['push'](_0x483198[_0xbeb3('0x44')]({'attributes':['id',_0xbeb3('0x7')]}));break;}return BPromise[_0xbeb3('0x45')](_0x520b8e);}})[_0xbeb3('0xd')](function(_0x5294ac){if(_0x5294ac&&_0x5294ac[_0xbeb3('0x1f')]){for(var _0x517ee9=0x0;_0x517ee9<_0x5294ac['length'];_0x517ee9+=0x1){for(var _0x39b545=0x0;_0x39b545<_0x5294ac[_0x517ee9][_0xbeb3('0x1f')];_0x39b545+=0x1){switch(_0x517ee9){case 0x0:joinOrLeaveQueues(_0x1703a0,_0x366bdb,_0xbeb3('0x46'),_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x1:joinOrLeaveQueues(_0x1703a0,_0x366bdb,_0xbeb3('0x47'),_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x2:joinOrLeaveQueues(_0x1703a0,_0x366bdb,'fax',_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x3:joinOrLeaveQueues(_0x1703a0,_0x366bdb,_0xbeb3('0x48'),_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x4:joinOrLeaveQueues(_0x1703a0,_0x366bdb,_0xbeb3('0x49'),_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x5:joinOrLeaveQueues(_0x1703a0,_0x366bdb,_0xbeb3('0x4a'),_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x6:joinOrLeaveQueues(_0x1703a0,_0x366bdb,'whatsapp',_0x5294ac[_0x517ee9][_0x39b545]);break;case 0x7:if(_0xfc384a[_0xbeb3('0x6')]!=='agent')_0x1703a0[_0x366bdb](util['format'](_0xbeb3('0x4b'),_0x5294ac[_0x517ee9][_0x39b545][_0xbeb3('0x7')]));break;case 0x8:if(_0xfc384a[_0xbeb3('0x6')]!=='agent')_0x1703a0[_0x366bdb](util[_0xbeb3('0x2d')](_0xbeb3('0x4c'),_0x5294ac[_0x517ee9][_0x39b545][_0xbeb3('0x7')]));break;case 0x9:if(_0xfc384a['role']!==_0xbeb3('0x9'))_0x1703a0[_0x366bdb](util['format'](_0xbeb3('0x4d'),_0x5294ac[_0x517ee9][_0x39b545]['type'],_0x5294ac[_0x517ee9][_0x39b545][_0xbeb3('0x7')]));break;case 0xa:_0x1703a0[_0x366bdb](util[_0xbeb3('0x2d')](_0xbeb3('0x20'),_0x5294ac[_0x517ee9][_0x39b545][_0xbeb3('0x7')]));break;}}}}})[_0xbeb3('0xd')](function(){if(_0x366bdb===_0xbeb3('0x4e')){var _0x135ca0=_[_0xbeb3('0x19')](_0xfc384a['ChatInteractions'],'id');return _0xfc384a[_0xbeb3('0x4f')](_0x135ca0)[_0xbeb3('0xd')](function(){for(var _0xa852bb=0x0;_0xa852bb<_0x135ca0[_0xbeb3('0x1f')];_0xa852bb+=0x1){_0x55a59d['emit'](_0xbeb3('0x50'),{'ChatInteractionId':Number(_0x135ca0[_0xa852bb]),'UserId':Number(_0xfc384a['id'])});}});}})[_0xbeb3('0xd')](function(){if(_0x366bdb===_0xbeb3('0x4e')){var _0x2c677d=_['map'](_0xfc384a[_0xbeb3('0x26')],'id');return _0xfc384a['removeMailInteractions'](_0x2c677d)[_0xbeb3('0xd')](function(){for(var _0x434300=0x0;_0x434300<_0x2c677d[_0xbeb3('0x1f')];_0x434300+=0x1){_0x55a59d['emit'](_0xbeb3('0x51'),{'MailInteractionId':Number(_0x2c677d[_0x434300]),'UserId':Number(_0xfc384a['id'])});}});}})[_0xbeb3('0xd')](function(){if(_0x366bdb===_0xbeb3('0x4e')){var _0x2c5325=_[_0xbeb3('0x19')](_0xfc384a[_0xbeb3('0x28')],'id');return _0xfc384a[_0xbeb3('0x52')](_0x2c5325)[_0xbeb3('0xd')](function(){for(var _0x27024e=0x0;_0x27024e<_0x2c5325[_0xbeb3('0x1f')];_0x27024e+=0x1){_0x55a59d['emit'](_0xbeb3('0x53'),{'FaxInteractionId':Number(_0x2c5325[_0x27024e]),'UserId':Number(_0xfc384a['id'])});}});}})[_0xbeb3('0xd')](function(){if(_0x366bdb===_0xbeb3('0x4e')){var _0x8660b4=_[_0xbeb3('0x19')](_0xfc384a['SmsInteractions'],'id');return _0xfc384a['removeSmsInteractions'](_0x8660b4)[_0xbeb3('0xd')](function(){for(var _0x3ddf1e=0x0;_0x3ddf1e<_0x8660b4['length'];_0x3ddf1e+=0x1){_0x55a59d[_0xbeb3('0x54')](_0xbeb3('0x55'),{'SmsInteractionId':Number(_0x8660b4[_0x3ddf1e]),'UserId':Number(_0xfc384a['id'])});}});}})[_0xbeb3('0xd')](function(){if(_0x366bdb===_0xbeb3('0x4e')){var _0x30024e=_[_0xbeb3('0x19')](_0xfc384a[_0xbeb3('0x56')],'id');return _0xfc384a['removeOpenchannelInteractions'](_0x30024e)[_0xbeb3('0xd')](function(){for(var _0x40b0c0=0x0;_0x40b0c0<_0x30024e[_0xbeb3('0x1f')];_0x40b0c0+=0x1){_0x55a59d['emit'](_0xbeb3('0x57'),{'OpenchannelInteractionId':Number(_0x30024e[_0x40b0c0]),'UserId':Number(_0xfc384a['id'])});}});}})[_0xbeb3('0xd')](function(){if(_0x366bdb==='leave'){var _0xf73e97=_[_0xbeb3('0x19')](_0xfc384a[_0xbeb3('0x2c')],'id');return _0xfc384a[_0xbeb3('0x58')](_0xf73e97)['then'](function(){for(var _0x553e8c=0x0;_0x553e8c<_0xf73e97[_0xbeb3('0x1f')];_0x553e8c+=0x1){_0x55a59d['emit'](_0xbeb3('0x59'),{'WhatsappInteractionId':Number(_0xf73e97[_0x553e8c]),'UserId':Number(_0xfc384a['id'])});}});}})['catch'](function(_0x2d36cb){_0x1703a0[_0xbeb3('0x5a')](_0x2d36cb);});}}function onDisconnect(_0x2ce380,_0x1d9f1a){joinOrLeave(_0x2ce380,_0xbeb3('0x4e'),_0x1d9f1a);}function onConnect(_0x1a53bd){joinOrLeave(_0x1a53bd,_0xbeb3('0x5b'));}exports[_0xbeb3('0x5c')]=function(_0xc78a7a){_0xc78a7a['on'](_0xbeb3('0x5d'),function(_0x32f8c8){_0x32f8c8[_0xbeb3('0x5e')](0x0);_0x32f8c8[_0xbeb3('0x5f')]=_0x32f8c8[_0xbeb3('0x60')][_0xbeb3('0x5d')][_0xbeb3('0x61')]+':'+_0x32f8c8[_0xbeb3('0x60')][_0xbeb3('0x5d')]['remotePort'];_0x32f8c8[_0xbeb3('0x62')]=new Date();_0x32f8c8[_0xbeb3('0x5a')]=function(_0x2fe5d6){console[_0xbeb3('0x5a')](_0xbeb3('0x63')+_0x32f8c8['nsp'][_0xbeb3('0x7')]+'['+_0x32f8c8['address']+']',_0x2fe5d6);};_0x32f8c8['on'](_0xbeb3('0x64'),function(){onDisconnect(_0x32f8c8,_0xc78a7a);_0x32f8c8[_0xbeb3('0x5a')](_0xbeb3('0x65'));});onConnect(_0x32f8c8);_0x32f8c8[_0xbeb3('0x5a')](_0xbeb3('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 302488e..28c9ca0 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 _0xbfbb=['ChatMessage','afterCreate','newmessage','SmsInteraction','closedinteraction','Sms','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','error','code','get','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','User','name','fullname','email','internal','interface','SIP/%s','channel','agent','incomingmessage','catch','outgoingmessage','ContactId','changed','closed','find','format','default','hasOwnProperty','model','hook','callback','toLowerCase','util','../../mysqldb','triggers','lodash','client','http','ChatInteraction','newinteraction','afterUpdate','Chat'];(function(_0x20f100,_0x2a15d5){var _0x3e6d84=function(_0x232aeb){while(--_0x232aeb){_0x20f100['push'](_0x20f100['shift']());}};_0x3e6d84(++_0x2a15d5);}(_0xbfbb,0xfe));var _0xbbfb=function(_0x41a3a8,_0x335d5d){_0x41a3a8=_0x41a3a8-0x0;var _0x2cf70a=_0xbfbb[_0x41a3a8];return _0x2cf70a;};'use strict';var util=require(_0xbbfb('0x0'));var db=require(_0xbbfb('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0xbbfb('0x2'));var _=require(_0xbbfb('0x3'));var client=jayson[_0xbbfb('0x4')][_0xbbfb('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xbbfb('0x6'),'event':'afterCreate','condition':_0xbbfb('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0xbbfb('0x6'),'event':_0xbbfb('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbbfb('0x9'),'model':_0xbbfb('0xa'),'event':_0xbbfb('0xb'),'condition':_0xbbfb('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xbbfb('0xd'),'event':_0xbbfb('0xb'),'condition':_0xbbfb('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0xbbfb('0xd'),'event':_0xbbfb('0x8'),'condition':_0xbbfb('0xe'),'callback':afterUpdate},{'channel':_0xbbfb('0xf'),'model':'SmsMessage','event':_0xbbfb('0xb'),'condition':_0xbbfb('0xc'),'callback':afterCreateMessage},{'channel':_0xbbfb('0x10'),'model':_0xbbfb('0x11'),'event':'afterCreate','condition':_0xbbfb('0x7'),'callback':afterCreate},{'channel':_0xbbfb('0x10'),'model':_0xbbfb('0x11'),'event':'afterUpdate','condition':_0xbbfb('0xe'),'callback':afterUpdate},{'channel':_0xbbfb('0x10'),'model':_0xbbfb('0x12'),'event':'afterCreate','condition':_0xbbfb('0xc'),'callback':afterCreateMessage},{'channel':_0xbbfb('0x13'),'model':'FaxInteraction','event':_0xbbfb('0xb'),'condition':_0xbbfb('0x7'),'callback':afterCreate},{'channel':_0xbbfb('0x13'),'model':_0xbbfb('0x14'),'event':'afterUpdate','condition':_0xbbfb('0xe'),'callback':afterUpdate},{'channel':_0xbbfb('0x13'),'model':_0xbbfb('0x15'),'event':_0xbbfb('0xb'),'condition':_0xbbfb('0xc'),'callback':afterCreateMessage},{'channel':_0xbbfb('0x16'),'model':'MailInteraction','event':_0xbbfb('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0xbbfb('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbbfb('0x16'),'model':'MailMessage','event':'afterCreate','condition':_0xbbfb('0xc'),'callback':afterCreateMessage},{'channel':_0xbbfb('0x17'),'model':_0xbbfb('0x18'),'event':_0xbbfb('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xbbfb('0x17'),'model':_0xbbfb('0x18'),'event':_0xbbfb('0x8'),'condition':_0xbbfb('0xe'),'callback':afterUpdate},{'channel':_0xbbfb('0x17'),'model':_0xbbfb('0x19'),'event':_0xbbfb('0xb'),'condition':_0xbbfb('0xc'),'callback':afterCreateMessage}];function request(_0x3513ac){return client[_0xbbfb('0x1a')]('EventManager',_0x3513ac)[_0xbbfb('0x1b')](function(_0x4da3e7){logger[_0xbbfb('0x1c')](_0xbbfb('0x1d'),_0xbbfb('0x1e'),_0x4da3e7);if(_0x4da3e7[_0xbbfb('0x1f')]){if(_0x4da3e7[_0xbbfb('0x1f')][_0xbbfb('0x20')]===0x1f4){logger[_0xbbfb('0x1f')](_0xbbfb('0x1d'),_0xbbfb('0x1e'),_0x4da3e7[_0xbbfb('0x1f')]);}}})['catch'](function(_0x351fe4){logger[_0xbbfb('0x1f')]('Trigger,\x20%s','EventManager',_0x351fe4);});}function afterCreateMessage(_0x1a62ab,_0x3413af){return function(_0x5b370e,_0x31490a){_0x5b370e=_0x5b370e[_0xbbfb('0x21')]({'plain':!![]});_0x5b370e['channel']=_0x1a62ab;_0x5b370e[_0xbbfb('0x22')]=_0x5b370e['direction'];var _0x44a1c2=_0xbbfb('0x23')+_0x5b370e['ContactId'];return db[_0xbbfb('0x24')][_0xbbfb('0x25')](_0x44a1c2,{'type':db[_0xbbfb('0x26')][_0xbbfb('0x27')][_0xbbfb('0x28')],'raw':!![]})[_0xbbfb('0x1b')](function(_0x2db0a3){return _0x2db0a3;})[_0xbbfb('0x1b')](function(_0x1f1c11){if(_0x1f1c11){_0x5b370e[_0xbbfb('0x29')]=_0x1f1c11[0x0];}if(_0x5b370e[_0xbbfb('0x2a')]){return db[_0xbbfb('0x2b')]['find']({'where':{'id':_0x5b370e[_0xbbfb('0x2a')]},'attributes':['id',_0xbbfb('0x2c'),_0xbbfb('0x2d'),_0xbbfb('0x2e'),_0xbbfb('0x2f')],'raw':!![]})[_0xbbfb('0x1b')](function(_0x46a75b){_0x5b370e[_0xbbfb('0x30')]=util['format'](_0xbbfb('0x31'),_0x46a75b[_0xbbfb('0x2c')]);_0x5b370e[_0xbbfb('0x32')]=_0x1a62ab;_0x5b370e[_0xbbfb('0x33')]=_0x46a75b;return request({'event':_0xbbfb('0x34'),'message':_0x5b370e});})[_0xbbfb('0x35')](function(_0x55b45a){console['error'](_0x55b45a);});}else{return request({'event':_0xbbfb('0x36'),'message':_0x5b370e});}});};}function afterCreate(_0x55c44c,_0x472f54){return function(_0x139c4c,_0xaba3c0){_0x139c4c=_0x139c4c[_0xbbfb('0x21')]({'plain':!![]});_0x139c4c[_0xbbfb('0x32')]=_0x55c44c;_0x139c4c['event']='opened';var _0x5b9dec=_0xbbfb('0x23')+_0x139c4c[_0xbbfb('0x37')];return db[_0xbbfb('0x24')][_0xbbfb('0x25')](_0x5b9dec,{'type':db[_0xbbfb('0x26')][_0xbbfb('0x27')][_0xbbfb('0x28')],'raw':!![]})[_0xbbfb('0x1b')](function(_0x550947){return _0x550947;})['then'](function(_0x2efe64){if(_0x2efe64){_0x139c4c[_0xbbfb('0x29')]=_0x2efe64[0x0];}return request({'event':_0x472f54,'message':_0x139c4c});});};}function afterUpdate(_0x309f7d,_0x82c397){return function(_0x11d574,_0xcf76fb){if(_0x11d574[_0xbbfb('0x38')](_0xbbfb('0x39'))&&_0x11d574[_0xbbfb('0x39')]){_0x11d574=_0x11d574[_0xbbfb('0x21')]({'plain':!![]});_0x11d574[_0xbbfb('0x32')]=_0x309f7d;_0x11d574[_0xbbfb('0x22')]=_0xbbfb('0x39');var _0x3a4f2f=_0xbbfb('0x23')+_0x11d574[_0xbbfb('0x37')];return db[_0xbbfb('0x24')]['query'](_0x3a4f2f,{'type':db[_0xbbfb('0x26')][_0xbbfb('0x27')]['SELECT'],'raw':!![]})[_0xbbfb('0x1b')](function(_0x2dbb20){return _0x2dbb20;})[_0xbbfb('0x1b')](function(_0x526eed){if(_0x526eed){_0x11d574[_0xbbfb('0x29')]=_0x526eed[0x0];}if(_0x11d574[_0xbbfb('0x2a')]){return db[_0xbbfb('0x2b')][_0xbbfb('0x3a')]({'where':{'id':_0x11d574[_0xbbfb('0x2a')]},'attributes':['id',_0xbbfb('0x2c'),_0xbbfb('0x2d'),_0xbbfb('0x2e'),_0xbbfb('0x2f')],'raw':!![]})[_0xbbfb('0x1b')](function(_0xf2467f){_0x11d574['interface']=util[_0xbbfb('0x3b')](_0xbbfb('0x31'),_0xf2467f[_0xbbfb('0x2c')]);_0x11d574['agent']=_0xf2467f;return request({'event':_0x82c397,'message':_0x11d574});})[_0xbbfb('0x35')](function(_0x5a4055){console['error'](_0x5a4055);});}else{return request({'event':_0x82c397,'message':_0x11d574});}});}};}exports[_0xbbfb('0x3c')]=function(){for(var _0x1ed618=0x0;_0x1ed618=_0xcfd95e[_0xcac5('0x12')]){throw Error(_0xcac5('0x13'));}_0x1b90df(_0x413195);})[_0xcac5('0x14')](function(_0x62ceca){_0x487200(_0x62ceca);});});}; \ No newline at end of file +var _0xa3b0=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','count','getLicense','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','voice','mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase'];(function(_0x252609,_0x24a2ba){var _0x33dca3=function(_0x12aeb6){while(--_0x12aeb6){_0x252609['push'](_0x252609['shift']());}};_0x33dca3(++_0x24a2ba);}(_0xa3b0,0x199));var _0x0a3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a3b('0x0'));var BPromise=require('bluebird');var db=require(_0x0a3b('0x1'))['db'];var util=require('./license/util');var channels=[_0x0a3b('0x2'),_0x0a3b('0x3'),_0x0a3b('0x4'),'fax',_0x0a3b('0x5'),_0x0a3b('0x6'),_0x0a3b('0x7')];exports[_0x0a3b('0x8')]=function(){return channels;};exports[_0x0a3b('0x9')]=function(_0x51262a){_0x51262a=_0x51262a[_0x0a3b('0xa')]();return _[_0x0a3b('0xb')](channels,_0x51262a);};exports[_0x0a3b('0xc')]=function(_0x51eefe,_0x55c784,_0x148f54,_0x318eb0){var _0x2f5ba2={'loginAttempts':_0x55c784,'blocked':_0x148f54};if(!_[_0x0a3b('0xd')](_0x318eb0)){_0x2f5ba2[_0x0a3b('0xe')]=_0x318eb0;}return _0x51eefe[_0x0a3b('0xf')](_0x2f5ba2);};exports['getLicense']=function(_0x557740){return new BPromise(function(_0x4ae3a9,_0x4aa0f9){var _0x589b45=0x0;if(_0x557740['role']!==_0x0a3b('0x10')){_0x4ae3a9(_0x557740);}db['User'][_0x0a3b('0x11')]({'where':{'role':_0x0a3b('0x10'),'online':!![],'id':{'$ne':_0x557740['id']}}})['then'](function(_0xcab2ad){_0x589b45=_0xcab2ad;return util[_0x0a3b('0x12')]();})['then'](function(_0x2d62f7){if(_0x2d62f7&&_0x2d62f7['agents']&&_0x589b45>=_0x2d62f7['agents']){throw Error(_0x0a3b('0x13'));}_0x4ae3a9(_0x557740);})[_0x0a3b('0x14')](function(_0x428742){_0x4aa0f9(_0x428742);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b5aa5e8..98d71a6 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75d0=['exports','status','render','json','send'];(function(_0x199519,_0x207278){var _0x58cc09=function(_0x55d1cc){while(--_0x55d1cc){_0x199519['push'](_0x199519['shift']());}};_0x58cc09(++_0x207278);}(_0x75d0,0x1bd));var _0x075d=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0x75d0[_0x4ec7f2];return _0x118004;};'use strict';module[_0x075d('0x0')][0x194]=function pageNotFound(_0x2c1510,_0x429c7e){var _0x12316b='404';var _0x3bd392=0x194;var _0x4cc059={'status':_0x3bd392};_0x429c7e[_0x075d('0x1')](_0x4cc059[_0x075d('0x1')]);_0x429c7e[_0x075d('0x2')](_0x12316b,{},function(_0x1e1fda,_0x8429fe){if(_0x1e1fda){return _0x429c7e[_0x075d('0x1')](_0x4cc059[_0x075d('0x1')])[_0x075d('0x3')](_0x4cc059);}_0x429c7e[_0x075d('0x4')](_0x8429fe);});}; \ No newline at end of file +var _0x2ba6=['404','status','json','send','exports'];(function(_0x583513,_0x34e323){var _0x15e3ec=function(_0x309a74){while(--_0x309a74){_0x583513['push'](_0x583513['shift']());}};_0x15e3ec(++_0x34e323);}(_0x2ba6,0x135));var _0x62ba=function(_0x1bc07f,_0x4c0cc5){_0x1bc07f=_0x1bc07f-0x0;var _0x1daf62=_0x2ba6[_0x1bc07f];return _0x1daf62;};'use strict';module[_0x62ba('0x0')][0x194]=function pageNotFound(_0x2d2b3b,_0x2c5d06){var _0x31dd52=_0x62ba('0x1');var _0x1d381d=0x194;var _0x3c79ec={'status':_0x1d381d};_0x2c5d06[_0x62ba('0x2')](_0x3c79ec[_0x62ba('0x2')]);_0x2c5d06['render'](_0x31dd52,{},function(_0x383c39,_0x5c3c4a){if(_0x383c39){return _0x2c5d06['status'](_0x3c79ec['status'])[_0x62ba('0x3')](_0x3c79ec);}_0x2c5d06[_0x62ba('0x4')](_0x5c3c4a);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8705753..20e83bd 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55b6=['OpenchannelQueueReport','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Hoppers','HopperHistories','SmsInteractions','cm_user_has_contacts','cm_contact_has_tags','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','SalesforceAccount','Subject','Field','VariableId','Configurations','SugarcrmField','Description','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowAccount','ServicenowField','Dynamics365Field','FreshsalesAccount','FromId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','team_has_fax_queues','FaxQueues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','lodash','determine','sequelize','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','xcall','utf8mb4','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../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/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','SalesforceConfiguration','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','../api/integration/integration.model','Network','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','hasMany','Recordings','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','SenderId','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteraction','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','UserMailQueue','ChatQueue','ChatQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperBlacks','JscriptySessions','TrunkBackup','belongsTo','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','MailServerIn','Smtp','Dispositions','Answers','Messages','Interactions','Template','TemplateId','Agents','MailInteractionId','mail_interaction_has_tags','Tags','Users','Interaction','Account','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Exntensions','List','ListId','Owner','fax_interaction_has_tags','ThroughTags','FaxInteractionId','Attachment','AttachmentId','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions'];(function(_0x20440d,_0x34aaf7){var _0x486ab9=function(_0x5c3edf){while(--_0x5c3edf){_0x20440d['push'](_0x20440d['shift']());}};_0x486ab9(++_0x34aaf7);}(_0x55b6,0x71));var _0x655b=function(_0x4f5767,_0x369320){_0x4f5767=_0x4f5767-0x0;var _0x5d6c1e=_0x55b6[_0x4f5767];return _0x5d6c1e;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x655b('0x0'));var jstz=require('jstz');var timezone=jstz[_0x655b('0x1')]();config[_0x655b('0x2')]=_['defaultsDeep'](config['sequelize'],{'database':_0x655b('0x3'),'username':'xcall','password':_0x655b('0x4'),'options':{'host':_0x655b('0x5'),'port':0xcea,'dialect':_0x655b('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x655b('0x7')](),'define':{'charset':_0x655b('0x8'),'collate':_0x655b('0x9')}}});config[_0x655b('0xa')]=_[_0x655b('0xb')](config['sequelizeHistory'],{'database':_0x655b('0x3'),'username':_0x655b('0xc'),'password':_0x655b('0x4'),'options':{'host':_0x655b('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x655b('0xd')},'logging':![],'timezone':timezone[_0x655b('0x7')](),'define':{'charset':_0x655b('0x8'),'collate':_0x655b('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x655b('0xe')],config[_0x655b('0x2')][_0x655b('0xf')],config[_0x655b('0x2')][_0x655b('0x10')],config[_0x655b('0x2')][_0x655b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x655b('0xa')][_0x655b('0xe')],config['sequelizeHistory'][_0x655b('0xf')],config[_0x655b('0xa')]['password'],config['sequelizeHistory'][_0x655b('0x11')])};db[_0x655b('0x12')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x14'));db['VoiceChanSpy']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x15'));db[_0x655b('0x16')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x17'));db[_0x655b('0x18')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x19'));db[_0x655b('0x1a')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x1b'));db['VoiceQueue']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x1c'));db[_0x655b('0x1d')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x1e'));db[_0x655b('0x1f')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/screenRecording/screenRecording.model');db[_0x655b('0x20')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x21'));db[_0x655b('0x22')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x23'));db['VoiceCallReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x24'));db['VoiceDialReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x25'));db[_0x655b('0x26')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x27'));db[_0x655b('0x28')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x29'));db[_0x655b('0x2a')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x2b'));db['VoiceTransferReport']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x655b('0x2c')]=db['sequelize'][_0x655b('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x655b('0x2d')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x2e'));db[_0x655b('0x2f')]=db[_0x655b('0x2')]['import'](_0x655b('0x30'));db['UserMailQueue']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x31'));db['UserFaxQueue']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x32'));db[_0x655b('0x33')]=db[_0x655b('0x2')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x655b('0x34')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x35'));db[_0x655b('0x36')]=db[_0x655b('0x2')]['import'](_0x655b('0x37'));db['MailServerIn']=db['sequelize'][_0x655b('0x13')](_0x655b('0x38'));db[_0x655b('0x39')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x655b('0x3a')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x3b'));db[_0x655b('0x3c')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x3d'));db[_0x655b('0x3e')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x3f'));db[_0x655b('0x40')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x41'));db[_0x655b('0x42')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/mailMessage/mailMessage.model');db[_0x655b('0x43')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x44'));db[_0x655b('0x45')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x655b('0x46')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x47'));db[_0x655b('0x48')]=db['sequelize'][_0x655b('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0x655b('0x49')]=db['sequelize'][_0x655b('0x13')]('../api/faxAccount/faxAccount.model');db[_0x655b('0x4a')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x4b'));db[_0x655b('0x4c')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x4d'));db[_0x655b('0x4e')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x4f'));db[_0x655b('0x50')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/faxQueue/faxQueue.model');db[_0x655b('0x51')]=db[_0x655b('0x2')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x655b('0x52')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x53'));db[_0x655b('0x54')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x55'));db[_0x655b('0x56')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x655b('0x2')]['import'](_0x655b('0x57'));db[_0x655b('0x58')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x655b('0x59')]=db[_0x655b('0x2')]['import'](_0x655b('0x5a'));db[_0x655b('0x5b')]=db['sequelize'][_0x655b('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x655b('0x5c')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x5d'));db[_0x655b('0x5e')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x5f'));db['ChatWebsite']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x60'));db['OpenchannelQueueReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x61'));db[_0x655b('0x62')]=db['sequelize']['import'](_0x655b('0x63'));db['ChatInteraction']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x64'));db[_0x655b('0x65')]=db['sequelize']['import'](_0x655b('0x66'));db[_0x655b('0x67')]=db[_0x655b('0x2')]['import'](_0x655b('0x68'));db['ChatQueue']=db['sequelize'][_0x655b('0x13')](_0x655b('0x69'));db['ChatGroup']=db[_0x655b('0x2')]['import'](_0x655b('0x6a'));db['ChatProactiveAction']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x655b('0x6b')]=db[_0x655b('0x2')]['import'](_0x655b('0x6c'));db[_0x655b('0x6d')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x6e'));db[_0x655b('0x6f')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x70'));db[_0x655b('0x71')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x655b('0x72')]=db['sequelize']['import'](_0x655b('0x73'));db[_0x655b('0x74')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x75'));db[_0x655b('0x76')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x77'));db['CmCustomField']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x655b('0x78')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x79'));db[_0x655b('0x7a')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/automation/automation.model');db[_0x655b('0x7b')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x7c'));db[_0x655b('0x7d')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x7e'));db[_0x655b('0x7f')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/condition/condition.model');db['Interval']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x80'));db[_0x655b('0x81')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x82'));db[_0x655b('0x83')]=db['sequelize']['import'](_0x655b('0x84'));db[_0x655b('0x85')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x86'));db[_0x655b('0x87')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x88'));db[_0x655b('0x89')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x8a'));db[_0x655b('0x8b')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/tag/tag.model');db['Template']=db['sequelize'][_0x655b('0x13')](_0x655b('0x8c'));db[_0x655b('0x8d')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x8e'));db[_0x655b('0x8f')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x90'));db['Integration']=db[_0x655b('0x2')]['import']('../api/integration/integration.model');db[_0x655b('0x91')]=db[_0x655b('0x2')]['import'](_0x655b('0x92'));db[_0x655b('0x93')]=db['sequelize'][_0x655b('0x13')](_0x655b('0x94'));db['AnalyticDefaultReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x95'));db['AnalyticExtractedReport']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x655b('0x96')]=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0x655b('0x97')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x655b('0x98')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x655b('0x99')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x655b('0x9a')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x655b('0x9b')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x655b('0x9c')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0x9d'));db['SugarcrmField']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x655b('0x9e')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x655b('0x9f')]=db[_0x655b('0x2')]['import'](_0x655b('0xa0'));db[_0x655b('0xa1')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xa2'));db[_0x655b('0xa3')]=db['sequelize'][_0x655b('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x655b('0xa4')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x655b('0xa5')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intZohoField/intZohoField.model');db[_0x655b('0xa6')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x655b('0xa7')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xa8'));db[_0x655b('0xa9')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xaa'));db[_0x655b('0xab')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xac'));db[_0x655b('0xad')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xae'));db[_0x655b('0xaf')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xb0'));db['VtigerAccount']=db['sequelize'][_0x655b('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x655b('0xb1')]=db['sequelize'][_0x655b('0x13')](_0x655b('0xb2'));db['VtigerField']=db['sequelize'][_0x655b('0x13')](_0x655b('0xb3'));db['ServicenowAccount']=db['sequelize'][_0x655b('0x13')](_0x655b('0xb4'));db[_0x655b('0xb5')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xb6'));db['ServicenowField']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xb7'));db[_0x655b('0xb8')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xb9'));db[_0x655b('0xba')]=db['sequelize']['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xbb'));db['FreshsalesAccount']=db[_0x655b('0x2')]['import'](_0x655b('0xbc'));db[_0x655b('0xbd')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xbe'));db[_0x655b('0xbf')]=db[_0x655b('0x2')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0x655b('0xc0')]=db['sequelize'][_0x655b('0x13')](_0x655b('0xc1'));db[_0x655b('0xc2')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/network/network.model');db[_0x655b('0xc3')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db['sequelize'][_0x655b('0x13')](_0x655b('0xc4'));db['JscriptyAnswerReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xc5'));db['JscriptyQuestionReport']=db['sequelize'][_0x655b('0x13')](_0x655b('0xc6'));db[_0x655b('0xc7')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xc8'));db['SmsQueueReport']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x655b('0xc9')]=db['sequelize'][_0x655b('0x13')]('../api/squareReport/squareReport.model');db[_0x655b('0xca')]=db[_0x655b('0x2')]['import'](_0x655b('0xcb'));db[_0x655b('0xcc')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xcd'));db[_0x655b('0xce')]=db['sequelize'][_0x655b('0x13')](_0x655b('0xcf'));db[_0x655b('0xd0')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xd1'));db[_0x655b('0xd2')]=db[_0x655b('0x2')]['import'](_0x655b('0xd3'));db[_0x655b('0xd4')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/squareMessage/squareMessage.model');db[_0x655b('0xd5')]=db[_0x655b('0x2')]['import'](_0x655b('0xd6'));db['License']=db['sequelize'][_0x655b('0x13')](_0x655b('0xd7'));db['Campaign']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xd8'));db[_0x655b('0xd9')]=db['sequelize']['import'](_0x655b('0xda'));db['Attachment']=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x655b('0xdb')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xdc'));db[_0x655b('0xdd')]=db['sequelize']['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x655b('0xde')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xdf'));db['FaxTransferReport']=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xe0'));db[_0x655b('0xe1')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xe2'));db['SmsTransferReport']=db['sequelize']['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x655b('0x2')][_0x655b('0x13')]('../api/cmList/cmList.model');db[_0x655b('0xe3')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xe4'));db[_0x655b('0xe5')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xe6'));db[_0x655b('0xe7')]=db['sequelize']['import'](_0x655b('0xe8'));db[_0x655b('0xe9')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xea'));db[_0x655b('0xeb')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xec'));db['WhatsappAccount']=db['sequelize'][_0x655b('0x13')](_0x655b('0xed'));db[_0x655b('0xee')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db['sequelize']['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x655b('0xef')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xf0'));db[_0x655b('0xf1')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x655b('0xf2')]=db['sequelize'][_0x655b('0x13')](_0x655b('0xf3'));db[_0x655b('0xf4')]=db[_0x655b('0x2')][_0x655b('0x13')](_0x655b('0xf5'));db[_0x655b('0xf6')]=db[_0x655b('0x2')][_0x655b('0x13')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x655b('0x2')]['import'](_0x655b('0xf7'));db[_0x655b('0x12')][_0x655b('0xf8')](db[_0x655b('0x20')],{'as':_0x655b('0x20'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db[_0x655b('0x1d')],{'as':_0x655b('0xfc'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')]['hasMany'](db[_0x655b('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0x655b('0xfa')});db['User'][_0x655b('0xfb')](db[_0x655b('0x18')],{'as':'Extensions','onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x12')]['hasMany'](db[_0x655b('0x72')],{'as':'HopperFinals','foreignKey':_0x655b('0xfa')});db['User'][_0x655b('0xfb')](db[_0x655b('0x74')],{'as':_0x655b('0xfd'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db['ReportAgentPreview'],{'as':_0x655b('0x76'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0x655b('0x5b')],{'as':_0x655b('0xfe'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')]['hasMany'](db['ChatInteraction'],{'as':_0x655b('0xff'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db[_0x655b('0x56')],{'as':'SmsInteractions','foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db[_0x655b('0x4c')],{'as':_0x655b('0x100'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db[_0x655b('0x40')],{'as':_0x655b('0x101'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x12')][_0x655b('0xfb')](db[_0x655b('0x102')],{'as':'WhatsappInteractions','foreignKey':_0x655b('0xfa')});db['User']['hasMany'](db[_0x655b('0xeb')],{'as':_0x655b('0x103'),'foreignKey':_0x655b('0x104')});db[_0x655b('0x12')]['belongsTo'](db[_0x655b('0xe5')],{'as':_0x655b('0xe5'),'foreignKey':_0x655b('0x105')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x107')],{'as':'Groups','through':_0x655b('0x108')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x6d')],{'as':_0x655b('0x109'),'through':'cm_user_has_contacts'});db['User'][_0x655b('0x106')](db[_0x655b('0x10a')],{'as':_0x655b('0x10b'),'through':_0x655b('0x10c')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':_0x655b('0x10d')});db['User'][_0x655b('0x106')](db['MailInteraction'],{'as':'MailInteractions','through':_0x655b('0x10e')});db['User'][_0x655b('0x106')](db[_0x655b('0x10f')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x655b('0x12')]['belongsToMany'](db[_0x655b('0x4c')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x56')],{'as':'SmsInteractions','through':_0x655b('0x110')});db[_0x655b('0x12')][_0x655b('0x106')](db['OpenchannelInteraction'],{'as':_0x655b('0xfe'),'through':_0x655b('0x111')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x102')],{'as':'WhatsappInteractions','through':_0x655b('0x112')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x113')],{'as':_0x655b('0x114'),'through':_0x655b('0x2d'),'required':![]});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x3c')],{'as':_0x655b('0x115'),'through':_0x655b('0x116'),'required':![]});db['User']['belongsToMany'](db[_0x655b('0x117')],{'as':_0x655b('0x118'),'through':_0x655b('0x2f'),'required':![],'hooks':!![]});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x50')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x58')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x655b('0x12')]['belongsToMany'](db[_0x655b('0x5e')],{'as':_0x655b('0x119'),'through':'UserOpenchannelQueue','required':![]});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0xf4')],{'as':'WhatsappQueues','through':_0x655b('0x36'),'required':![]});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x10a')],{'through':_0x655b('0x10c')});db[_0x655b('0x12')][_0x655b('0x106')](db['VoicePrefix'],{'as':_0x655b('0x11a'),'through':_0x655b('0x11b'),'required':![]});db[_0x655b('0x12')]['belongsToMany'](db[_0x655b('0x11c')],{'as':_0x655b('0x11d'),'through':_0x655b('0x11e')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x49')],{'as':_0x655b('0x11f'),'through':_0x655b('0x120')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x3a')],{'as':'MailAccounts','through':_0x655b('0x121')});db[_0x655b('0x12')][_0x655b('0x106')](db['OpenchannelAccount'],{'as':_0x655b('0x122'),'through':_0x655b('0x123')});db[_0x655b('0x12')][_0x655b('0x106')](db[_0x655b('0x52')],{'as':_0x655b('0x124'),'through':_0x655b('0x125')});db[_0x655b('0x12')]['belongsToMany'](db[_0x655b('0x126')],{'as':'WhatsappAccounts','through':_0x655b('0x127')});db[_0x655b('0x12')][_0x655b('0x106')](db['SquareProject'],{'as':_0x655b('0x128'),'through':_0x655b('0x129')});db['VoiceChanSpy'][_0x655b('0xfb')](db['VoiceExtension'],{'as':_0x655b('0x12a'),'onDelete':_0x655b('0xf9'),'foreignKey':'ChanSpyId'});db[_0x655b('0x16')][_0x655b('0xfb')](db[_0x655b('0x18')],{'onDelete':_0x655b('0xf9')});db[_0x655b('0x18')][_0x655b('0xfb')](db[_0x655b('0x18')],{'as':_0x655b('0x12b'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x1a')]['belongsToMany'](db[_0x655b('0x89')],{'as':'Sounds','through':_0x655b('0x12c')});db['VoiceQueue']['hasMany'](db[_0x655b('0x2c')],{'as':_0x655b('0x12d'),'foreignKey':_0x655b('0x12e')});db[_0x655b('0x113')][_0x655b('0xfb')](db[_0x655b('0x6f')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x655b('0xfb')](db['CmHopperFinal'],{'as':_0x655b('0x12f'),'foreignKey':_0x655b('0x12e')});db[_0x655b('0x113')][_0x655b('0xfb')](db[_0x655b('0x74')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x655b('0xfb')](db[_0x655b('0x76')],{'as':_0x655b('0x76'),'foreignKey':_0x655b('0x12e')});db[_0x655b('0x113')][_0x655b('0xfb')](db['CmHopperBlack'],{'as':_0x655b('0x130'),'foreignKey':_0x655b('0x12e')});db[_0x655b('0x113')][_0x655b('0xfb')](db[_0x655b('0xc7')],{'as':_0x655b('0x131'),'foreignKey':_0x655b('0x12e')});db[_0x655b('0x113')]['belongsTo'](db['Trunk'],{'as':_0x655b('0x2a'),'foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db[_0x655b('0x2a')],{'as':_0x655b('0x132'),'foreignKey':'TrunkBackupId'});db[_0x655b('0x113')][_0x655b('0x133')](db[_0x655b('0x134')],{'as':'Interval','foreignKey':_0x655b('0x135')});db[_0x655b('0x113')][_0x655b('0x133')](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':_0x655b('0x137')});db[_0x655b('0x113')]['belongsToMany'](db[_0x655b('0x10a')],{'as':_0x655b('0x10b'),'through':_0x655b('0x138')});db[_0x655b('0x113')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x655b('0x2d')});db[_0x655b('0x113')][_0x655b('0x106')](db[_0x655b('0xd5')],{'as':_0x655b('0x139'),'through':_0x655b('0x13a')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x655b('0x13b'),'through':_0x655b('0x13c')});db[_0x655b('0x1d')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':'User','foreignKey':_0x655b('0xfa')});db['ScreenRecording'][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x12'),'foreignKey':'UserId'});db[_0x655b('0x20')][_0x655b('0xfb')](db[_0x655b('0x22')],{'as':'Messages','onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x13d'),'sourceKey':_0x655b('0x13e')});db[_0x655b('0x22')][_0x655b('0x133')](db[_0x655b('0x20')],{'foreignKey':_0x655b('0x13d'),'targetKey':_0x655b('0x13e')});db[_0x655b('0x13f')]['hasMany'](db[_0x655b('0x28')],{'as':_0x655b('0x140'),'foreignKey':_0x655b('0x141'),'constraints':![]});db[_0x655b('0x13f')][_0x655b('0xfb')](db[_0x655b('0x26')],{'as':_0x655b('0x142'),'foreignKey':_0x655b('0x141'),'constraints':![]});db[_0x655b('0x13f')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x12'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x13f')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db['MailServerIn'][_0x655b('0x133')](db[_0x655b('0x3a')],{'as':_0x655b('0x3a'),'foreignKey':_0x655b('0x145')});db['MailServerOut'][_0x655b('0x133')](db[_0x655b('0x3a')],{'as':'MailAccount','foreignKey':_0x655b('0x145')});db['MailAccount']['hasOne'](db[_0x655b('0x146')],{'as':'Imap','onDelete':_0x655b('0xf9')});db[_0x655b('0x3a')][_0x655b('0xf8')](db[_0x655b('0x39')],{'as':_0x655b('0x147'),'onDelete':'cascade'});db[_0x655b('0x3a')][_0x655b('0xfb')](db[_0x655b('0x7d')],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x145'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x3a')][_0x655b('0xfb')](db['CannedAnswer'],{'as':_0x655b('0x149'),'foreignKey':_0x655b('0x145')});db['MailAccount'][_0x655b('0xfb')](db[_0x655b('0x42')],{'as':_0x655b('0x14a'),'foreignKey':_0x655b('0x145')});db[_0x655b('0x3a')][_0x655b('0xfb')](db[_0x655b('0x40')],{'as':_0x655b('0x14b')});db['MailAccount'][_0x655b('0xfb')](db[_0x655b('0x43')],{'as':_0x655b('0x12b')});db['MailAccount'][_0x655b('0x133')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x655b('0x3a')][_0x655b('0x133')](db[_0x655b('0x14c')],{'as':'Template','foreignKey':_0x655b('0x14d')});db[_0x655b('0x3a')]['belongsTo'](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':_0x655b('0x137')});db['MailAccount'][_0x655b('0x106')](db['User'],{'as':_0x655b('0x14e'),'through':_0x655b('0x121')});db['MailQueue'][_0x655b('0x106')](db[_0x655b('0x12')],{'as':'Agents','through':_0x655b('0x116')});db[_0x655b('0x3c')][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':'team_has_mail_queues','as':_0x655b('0x139')});db[_0x655b('0x40')][_0x655b('0xfb')](db[_0x655b('0x42')],{'as':_0x655b('0x14a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x14f')});db['MailInteraction'][_0x655b('0x133')](db[_0x655b('0x3a')],{'as':'Account','foreignKey':_0x655b('0x145')});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':_0x655b('0x143'),'foreignKey':'ContactId'});db['MailInteraction'][_0x655b('0x133')](db[_0x655b('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x655b('0x40')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x150'),'as':_0x655b('0x151')});db[_0x655b('0x40')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x150'),'as':'ThroughTags'});db[_0x655b('0x40')]['belongsToMany'](db['User'],{'as':_0x655b('0x152'),'through':_0x655b('0x10e'),'foreignKey':_0x655b('0x14f')});db[_0x655b('0x42')]['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x655b('0xf9')});db[_0x655b('0x42')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x12')});db[_0x655b('0x42')][_0x655b('0x133')](db[_0x655b('0x6d')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x143')});db['MailMessage'][_0x655b('0x133')](db[_0x655b('0x40')],{'as':_0x655b('0x153'),'foreignKey':_0x655b('0x14f')});db[_0x655b('0x42')][_0x655b('0x133')](db[_0x655b('0x3a')],{'as':_0x655b('0x154'),'foreignKey':'MailAccountId'});db[_0x655b('0x42')][_0x655b('0x133')](db[_0x655b('0x11c')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x655b('0x42')][_0x655b('0x133')](db[_0x655b('0x67')],{'as':_0x655b('0x67'),'foreignKey':_0x655b('0x155')});db['MailApplication'][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x43')][_0x655b('0x133')](db[_0x655b('0x3c')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x43')][_0x655b('0x133')](db[_0x655b('0x3a')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x43')][_0x655b('0x133')](db[_0x655b('0x134')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x655b('0x43')]['belongsTo'](db[_0x655b('0x8b')],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x157')});db[_0x655b('0x45')]['belongsTo'](db[_0x655b('0x3a')],{});db[_0x655b('0x45')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':'List','foreignKey':'ListId'});db[_0x655b('0x45')]['belongsTo'](db['CmContact'],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x45')]['belongsTo'](db[_0x655b('0x40')],{});db[_0x655b('0x45')][_0x655b('0x133')](db['MailMessage'],{});db[_0x655b('0x45')][_0x655b('0x133')](db['User'],{});db[_0x655b('0x45')][_0x655b('0x133')](db[_0x655b('0x3c')],{});db[_0x655b('0x46')][_0x655b('0xfb')](db[_0x655b('0x48')],{'as':_0x655b('0x158'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x49')]['hasMany'](db[_0x655b('0x7d')],{'as':'Dispositions','foreignKey':_0x655b('0x159'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x49')][_0x655b('0xfb')](db[_0x655b('0x7b')],{'as':_0x655b('0x149'),'foreignKey':'FaxAccountId'});db[_0x655b('0x49')][_0x655b('0xfb')](db[_0x655b('0x4c')],{'as':_0x655b('0x14b')});db[_0x655b('0x49')]['hasMany'](db[_0x655b('0x4a')],{'as':_0x655b('0x12b')});db[_0x655b('0x49')][_0x655b('0xfb')](db[_0x655b('0x18')],{'as':_0x655b('0x15a'),'onDelete':'cascade'});db['FaxAccount'][_0x655b('0xfb')](db[_0x655b('0x4e')],{'as':_0x655b('0x14a')});db[_0x655b('0x49')]['belongsTo'](db[_0x655b('0x2a')],{'as':_0x655b('0x2a')});db[_0x655b('0x49')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x49')][_0x655b('0x133')](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x655b('0x49')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':_0x655b('0x120')});db[_0x655b('0x4a')]['belongsTo'](db['User'],{'onDelete':_0x655b('0x156')});db[_0x655b('0x4a')][_0x655b('0x133')](db[_0x655b('0x50')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x4a')][_0x655b('0x133')](db[_0x655b('0x49')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x4a')][_0x655b('0x133')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x655b('0x157')});db[_0x655b('0x4c')]['hasMany'](db[_0x655b('0x4e')],{'as':_0x655b('0x14a'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x655b('0x133')](db[_0x655b('0x49')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x159')});db['FaxInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x655b('0x4c')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':_0x655b('0xfa')});db['FaxInteraction']['belongsToMany'](db[_0x655b('0x8b')],{'through':_0x655b('0x15e'),'as':_0x655b('0x151')});db['FaxInteraction'][_0x655b('0x106')](db['Tag'],{'through':_0x655b('0x15e'),'as':_0x655b('0x15f')});db[_0x655b('0x4c')][_0x655b('0x106')](db['User'],{'as':_0x655b('0x152'),'through':'user_has_fax_interactions','foreignKey':_0x655b('0x160')});db[_0x655b('0x4e')][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x12')});db[_0x655b('0x4e')][_0x655b('0x133')](db[_0x655b('0x4c')],{'as':_0x655b('0x153'),'foreignKey':_0x655b('0x160')});db[_0x655b('0x4e')][_0x655b('0x133')](db[_0x655b('0x6d')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x143')});db['FaxMessage'][_0x655b('0x133')](db[_0x655b('0x161')],{'as':_0x655b('0x161'),'foreignKey':_0x655b('0x162')});db['FaxMessage']['belongsTo'](db[_0x655b('0x49')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x159')});db[_0x655b('0x50')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':'UserFaxQueue'});db['FaxQueue'][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x49')],{});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x4c')],{});db[_0x655b('0x51')]['belongsTo'](db['FaxMessage'],{});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x12')],{});db[_0x655b('0x51')][_0x655b('0x133')](db[_0x655b('0x50')],{});db['SmsAccount'][_0x655b('0xfb')](db[_0x655b('0x7d')],{'as':'Dispositions','foreignKey':_0x655b('0x163'),'onDelete':_0x655b('0xf9')});db['SmsAccount']['hasMany'](db[_0x655b('0x7b')],{'as':'Answers','foreignKey':_0x655b('0x163')});db['SmsAccount']['hasMany'](db[_0x655b('0x164')],{'as':_0x655b('0x14a'),'foreignKey':_0x655b('0x163')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x655b('0x14b')});db[_0x655b('0x52')][_0x655b('0xfb')](db[_0x655b('0x54')],{'as':_0x655b('0x12b')});db[_0x655b('0x52')][_0x655b('0x133')](db['CmList'],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x52')][_0x655b('0x133')](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x655b('0x106')](db[_0x655b('0x12')],{'as':'Agents','through':_0x655b('0x125')});db[_0x655b('0x54')][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x54')]['belongsTo'](db[_0x655b('0x58')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x54')][_0x655b('0x133')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x655b('0x54')][_0x655b('0x133')](db['Interval'],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x135')});db[_0x655b('0x54')][_0x655b('0x133')](db[_0x655b('0x8b')],{'onDelete':'restrict','foreignKey':_0x655b('0x157')});db[_0x655b('0x56')][_0x655b('0xfb')](db[_0x655b('0x164')],{'as':_0x655b('0x14a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x165')});db['SmsInteraction'][_0x655b('0x133')](db[_0x655b('0x52')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x163')});db[_0x655b('0x56')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':'Contact','foreignKey':_0x655b('0x144')});db['SmsInteraction'][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x56')][_0x655b('0x106')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x655b('0x151')});db[_0x655b('0x56')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x166'),'as':_0x655b('0x15f')});db[_0x655b('0x56')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x152'),'through':_0x655b('0x110'),'foreignKey':_0x655b('0x165')});db[_0x655b('0x164')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x12')});db[_0x655b('0x164')][_0x655b('0x133')](db['CmContact'],{'onDelete':_0x655b('0xf9'),'as':'Contact'});db[_0x655b('0x164')][_0x655b('0x133')](db[_0x655b('0x56')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x655b('0x165')});db[_0x655b('0x164')][_0x655b('0x133')](db['SmsAccount'],{'as':'Account','foreignKey':_0x655b('0x163')});db[_0x655b('0x58')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':_0x655b('0x33'),'foreignKey':_0x655b('0x167')});db[_0x655b('0x58')][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':'team_has_sms_queues','as':_0x655b('0x139')});db[_0x655b('0x168')][_0x655b('0xfb')](db['Disposition'],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x169'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x655b('0xfb')](db[_0x655b('0x7b')],{'as':_0x655b('0x149'),'foreignKey':'OpenchannelAccountId'});db[_0x655b('0x168')][_0x655b('0xfb')](db[_0x655b('0x5b')],{'as':_0x655b('0x14b'),'foreignKey':_0x655b('0x169')});db[_0x655b('0x168')][_0x655b('0xfb')](db[_0x655b('0x5c')],{'as':_0x655b('0x14a'),'foreignKey':_0x655b('0x169')});db[_0x655b('0x168')][_0x655b('0xfb')](db[_0x655b('0x59')],{'as':_0x655b('0x12b'),'foreignKey':'OpenchannelAccountId'});db[_0x655b('0x168')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x168')][_0x655b('0x133')](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':_0x655b('0x137')});db[_0x655b('0x168')]['belongsToMany'](db['User'],{'as':_0x655b('0x14e'),'through':_0x655b('0x123')});db['OpenchannelApplication'][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':_0x655b('0x156')});db[_0x655b('0x59')][_0x655b('0x133')](db[_0x655b('0x5e')],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x16a')});db[_0x655b('0x59')]['belongsTo'](db[_0x655b('0x168')],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x169')});db[_0x655b('0x59')][_0x655b('0x133')](db[_0x655b('0x134')],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x135')});db[_0x655b('0x59')]['belongsTo'](db[_0x655b('0x8b')],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x157')});db['OpenchannelInteraction']['hasMany'](db[_0x655b('0x5c')],{'as':_0x655b('0x14a'),'onDelete':_0x655b('0xf9'),'foreignKey':'OpenchannelInteractionId'});db[_0x655b('0x5b')][_0x655b('0x133')](db[_0x655b('0x168')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x169')});db['OpenchannelInteraction'][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x5b')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x5b')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x16b'),'as':_0x655b('0x151')});db[_0x655b('0x5b')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x16b'),'as':_0x655b('0x15f')});db[_0x655b('0x5b')]['belongsToMany'](db[_0x655b('0x12')],{'as':_0x655b('0x152'),'through':_0x655b('0x111'),'foreignKey':_0x655b('0x16c')});db[_0x655b('0x5c')][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':'cascade','as':_0x655b('0x12')});db[_0x655b('0x5c')]['belongsTo'](db[_0x655b('0x6d')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x143')});db[_0x655b('0x5c')][_0x655b('0x133')](db['OpenchannelInteraction'],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x153'),'foreignKey':_0x655b('0x16c')});db[_0x655b('0x5c')][_0x655b('0x133')](db[_0x655b('0x161')],{'as':'Attachment','foreignKey':_0x655b('0x162')});db[_0x655b('0x5c')]['belongsTo'](db[_0x655b('0x168')],{'as':'Account','foreignKey':_0x655b('0x169')});db['OpenchannelQueue'][_0x655b('0x106')](db[_0x655b('0x12')],{'as':'Agents','through':_0x655b('0x34'),'foreignKey':_0x655b('0x16a')});db[_0x655b('0x5e')][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':_0x655b('0x16d'),'as':_0x655b('0x139')});db[_0x655b('0x11c')]['hasMany'](db[_0x655b('0x7d')],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x16e'),'onDelete':'cascade'});db[_0x655b('0x11c')][_0x655b('0xfb')](db[_0x655b('0x7b')],{'as':_0x655b('0x149'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0x655b('0x16f')],{'as':_0x655b('0x170')});db[_0x655b('0x11c')][_0x655b('0xfb')](db['ChatInteraction'],{'as':'Interactions'});db[_0x655b('0x11c')]['hasMany'](db['ChatApplication'],{'as':_0x655b('0x12b')});db[_0x655b('0x11c')][_0x655b('0xfb')](db['ChatMessage'],{'as':_0x655b('0x14a')});db[_0x655b('0x11c')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':'ListId'});db[_0x655b('0x11c')][_0x655b('0x133')](db[_0x655b('0x134')],{'as':'Interval','foreignKey':_0x655b('0x135')});db['ChatWebsite'][_0x655b('0x133')](db[_0x655b('0x3a')],{'as':_0x655b('0x3a'),'foreignKey':'MailAccountId'});db[_0x655b('0x11c')]['belongsTo'](db[_0x655b('0x81')],{'as':_0x655b('0x136'),'foreignKey':_0x655b('0x137')});db['ChatWebsite']['belongsToMany'](db['User'],{'as':_0x655b('0x14e'),'through':_0x655b('0x11e')});db[_0x655b('0x171')][_0x655b('0x133')](db[_0x655b('0x168')],{});db[_0x655b('0x171')][_0x655b('0x133')](db['CmList'],{'as':_0x655b('0x15b'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0x655b('0x133')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x655b('0x171')]['belongsTo'](db[_0x655b('0x5b')],{});db[_0x655b('0x171')][_0x655b('0x133')](db[_0x655b('0x5c')],{});db[_0x655b('0x171')][_0x655b('0x133')](db['User'],{});db[_0x655b('0x171')][_0x655b('0x133')](db[_0x655b('0x5e')],{});db[_0x655b('0x62')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x172'),'foreignKey':_0x655b('0xfa'),'onDelete':_0x655b('0x156')});db['ChatApplication']['belongsTo'](db[_0x655b('0x117')],{'as':_0x655b('0x173'),'foreignKey':'ChatQueueId','onDelete':_0x655b('0x156')});db[_0x655b('0x62')][_0x655b('0x133')](db[_0x655b('0x11c')],{'as':'Website','foreignKey':_0x655b('0x16e'),'onDelete':_0x655b('0x156')});db['ChatApplication'][_0x655b('0x133')](db['Tag'],{'onDelete':_0x655b('0x156'),'foreignKey':_0x655b('0x157')});db[_0x655b('0x10f')]['hasMany'](db[_0x655b('0x65')],{'as':_0x655b('0x14a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x174')});db[_0x655b('0x10f')][_0x655b('0x133')](db[_0x655b('0x11c')],{'as':'Account','foreignKey':_0x655b('0x16e')});db[_0x655b('0x10f')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x10f')]['belongsTo'](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':'UserId'});db[_0x655b('0x10f')]['belongsToMany'](db['Tag'],{'through':_0x655b('0x175'),'as':_0x655b('0x151')});db['ChatInteraction'][_0x655b('0x106')](db['Tag'],{'through':_0x655b('0x175'),'as':_0x655b('0x15f')});db[_0x655b('0x10f')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x152'),'through':_0x655b('0x176'),'foreignKey':_0x655b('0x174')});db['ChatMessage'][_0x655b('0x133')](db[_0x655b('0x12')],{'onDelete':'cascade','as':_0x655b('0x12')});db[_0x655b('0x65')]['belongsTo'](db[_0x655b('0x6d')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x65')][_0x655b('0x133')](db['ChatInteraction'],{'onDelete':_0x655b('0xf9'),'as':'Interaction','foreignKey':_0x655b('0x174')});db['ChatMessage']['belongsTo'](db[_0x655b('0x161')],{'as':_0x655b('0x161'),'foreignKey':_0x655b('0x162')});db[_0x655b('0x65')][_0x655b('0x133')](db[_0x655b('0x11c')],{'as':'Account','foreignKey':_0x655b('0x16e')});db[_0x655b('0x67')][_0x655b('0xfb')](db[_0x655b('0x161')],{'as':_0x655b('0x177'),'foreignKey':_0x655b('0x155'),'onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x67')][_0x655b('0x133')](db[_0x655b('0x6d')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x143'),'foreignKey':'ContactId'});db[_0x655b('0x67')][_0x655b('0x133')](db[_0x655b('0x11c')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x16e')});db[_0x655b('0x117')][_0x655b('0x106')](db['User'],{'as':_0x655b('0x14e'),'through':'UserChatQueue','hooks':!![]});db[_0x655b('0x117')][_0x655b('0x106')](db[_0x655b('0xd5')],{'through':_0x655b('0x178'),'as':_0x655b('0x139')});db[_0x655b('0x107')][_0x655b('0xfb')](db[_0x655b('0x179')],{'as':_0x655b('0x14a'),'foreignKey':_0x655b('0x17a'),'onDelete':'cascade'});db[_0x655b('0x107')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x12d'),'through':_0x655b('0x108')});db['ChatProactiveAction']['belongsTo'](db[_0x655b('0x11c')],{'as':_0x655b('0x17b'),'foreignKey':'ChatWebsiteId'});db[_0x655b('0x6b')][_0x655b('0xfb')](db['CmContact'],{'as':'Contacts','foreignKey':_0x655b('0x17c')});db[_0x655b('0x6d')][_0x655b('0xfb')](db['CmHopper'],{'as':_0x655b('0x17d'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x6d')][_0x655b('0xfb')](db['CmHopperFinal'],{'as':_0x655b('0x12f'),'foreignKey':_0x655b('0x144')});db['CmContact'][_0x655b('0xfb')](db[_0x655b('0x74')],{'as':_0x655b('0x17e'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x6d')][_0x655b('0xfb')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x655b('0x144')});db['CmContact']['hasMany'](db[_0x655b('0xc7')],{'as':_0x655b('0x131'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x6d')][_0x655b('0xfb')](db[_0x655b('0x5b')],{'as':_0x655b('0xfe'),'foreignKey':'ContactId','onDelete':_0x655b('0x156')});db['CmContact'][_0x655b('0xfb')](db['ChatInteraction'],{'as':_0x655b('0xff'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x655b('0x6d')][_0x655b('0xfb')](db[_0x655b('0x56')],{'as':_0x655b('0x17f'),'foreignKey':_0x655b('0x144'),'onDelete':_0x655b('0x156')});db[_0x655b('0x6d')]['hasMany'](db['FaxInteraction'],{'as':_0x655b('0x100'),'foreignKey':_0x655b('0x144'),'onDelete':_0x655b('0x156')});db['CmContact'][_0x655b('0xfb')](db['MailInteraction'],{'as':_0x655b('0x101'),'foreignKey':'ContactId','onDelete':_0x655b('0x156')});db[_0x655b('0x6d')][_0x655b('0x133')](db[_0x655b('0x6b')],{'as':'Company','foreignKey':_0x655b('0x17c')});db[_0x655b('0x6d')][_0x655b('0x133')](db['CmList'],{'as':_0x655b('0x15b'),'foreignKey':'ListId','onDelete':_0x655b('0xf9')});db['CmContact'][_0x655b('0x106')](db[_0x655b('0x12')],{'as':'Users','through':_0x655b('0x180')});db[_0x655b('0x6d')]['belongsToMany'](db['Tag'],{'as':_0x655b('0x151'),'through':_0x655b('0x181')});db[_0x655b('0x6d')]['belongsToMany'](db[_0x655b('0x8b')],{'through':'cm_contact_has_tags','as':_0x655b('0x15f')});db['CmHopper'][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x6f')][_0x655b('0x133')](db['CmList'],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c'),'onDelete':_0x655b('0xf9')});db['CmHopper'][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x172'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x6f')][_0x655b('0x133')](db[_0x655b('0x113')],{'as':_0x655b('0x173'),'foreignKey':_0x655b('0x12e'),'onDelete':'cascade'});db[_0x655b('0x6f')][_0x655b('0x133')](db[_0x655b('0x182')],{'as':'Campaign','foreignKey':_0x655b('0x183'),'onDelete':_0x655b('0xf9')});db['CmHopper'][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':_0x655b('0x184')});db[_0x655b('0x71')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144'),'onDelete':'cascade'});db[_0x655b('0x71')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x71')]['belongsTo'](db[_0x655b('0x113')],{'as':'Queue','foreignKey':_0x655b('0x12e'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x71')][_0x655b('0x133')](db[_0x655b('0x182')],{'as':_0x655b('0x182'),'foreignKey':_0x655b('0x183'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x7a')][_0x655b('0xfb')](db['Condition'],{'as':{'plural':_0x655b('0x185'),'singular':_0x655b('0x186')},'foreignKey':_0x655b('0x187'),'onDelete':_0x655b('0xf9'),'hooks':!![]});db['Automation'][_0x655b('0xfb')](db[_0x655b('0x7f')],{'as':{'plural':_0x655b('0x188'),'singular':_0x655b('0x189')},'foreignKey':_0x655b('0x18a'),'onDelete':_0x655b('0xf9'),'hooks':!![]});db['Automation'][_0x655b('0xfb')](db[_0x655b('0x78')],{'as':_0x655b('0x18b'),'foreignKey':'AutomationId','onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x7d')][_0x655b('0xfb')](db[_0x655b('0x7d')],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x18c'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x134')][_0x655b('0xfb')](db[_0x655b('0x134')],{'as':_0x655b('0x18d'),'foreignKey':'IntervalId','onDelete':_0x655b('0xf9'),'hooks':!![],'required':![]});db[_0x655b('0x134')][_0x655b('0xfb')](db['VoiceExtension'],{'as':_0x655b('0x18e'),'foreignKey':_0x655b('0x135'),'onDelete':'restrict'});db[_0x655b('0x134')][_0x655b('0xfb')](db['MailApplication'],{'as':_0x655b('0x18f'),'foreignKey':'IntervalId'});db[_0x655b('0x134')][_0x655b('0xfb')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x655b('0x135')});db[_0x655b('0x134')][_0x655b('0xfb')](db['FaxApplication'],{'as':_0x655b('0x190'),'foreignKey':_0x655b('0x135')});db['Interval'][_0x655b('0xfb')](db['SmsApplication'],{'as':_0x655b('0x191'),'foreignKey':_0x655b('0x135')});db[_0x655b('0x87')][_0x655b('0x133')](db[_0x655b('0x3a')],{});db[_0x655b('0x87')]['belongsTo'](db[_0x655b('0x192')],{'foreignKey':_0x655b('0x193')});db[_0x655b('0x87')][_0x655b('0x133')](db[_0x655b('0x93')],{'foreignKey':_0x655b('0x194')});db[_0x655b('0x89')][_0x655b('0x106')](db[_0x655b('0x1a')],{'as':_0x655b('0x195'),'through':_0x655b('0x12c'),'onDelete':_0x655b('0x156')});db[_0x655b('0x8b')][_0x655b('0x106')](db[_0x655b('0x6d')],{'through':_0x655b('0x181')});db[_0x655b('0x8b')][_0x655b('0x106')](db[_0x655b('0x10f')],{'through':_0x655b('0x175')});db['Tag'][_0x655b('0x106')](db[_0x655b('0x40')],{'through':_0x655b('0x150')});db['Tag']['belongsToMany'](db[_0x655b('0x56')],{'through':_0x655b('0x166')});db['Tag'][_0x655b('0x106')](db[_0x655b('0x4c')],{'through':_0x655b('0x15e')});db['Tag'][_0x655b('0x106')](db[_0x655b('0x5b')],{'through':'openchannel_interaction_has_tags'});db[_0x655b('0x8b')][_0x655b('0x106')](db['WhatsappInteraction'],{'through':_0x655b('0x196')});db[_0x655b('0x8d')][_0x655b('0xfb')](db[_0x655b('0x7f')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x8d')]['hasMany'](db[_0x655b('0x7f')],{'as':{'plural':_0x655b('0x197'),'singular':'AnyCondition'},'foreignKey':_0x655b('0x198'),'onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x8d')][_0x655b('0xfb')](db[_0x655b('0x78')],{'as':'Actions','foreignKey':_0x655b('0x199'),'onDelete':_0x655b('0xf9'),'hooks':!![]});db[_0x655b('0x93')][_0x655b('0xfb')](db[_0x655b('0x97')],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x194'),'hooks':!![]});db['AnalyticDefaultReport'][_0x655b('0xfb')](db['AnalyticFieldReport'],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x655b('0xfb')](db[_0x655b('0x97')],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19b')});db[_0x655b('0x97')]['belongsTo'](db[_0x655b('0x96')],{'foreignKey':_0x655b('0x19b')});db['SalesforceAccount'][_0x655b('0xfb')](db[_0x655b('0x99')],{'as':'Configurations','onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19c')});db['SalesforceConfiguration']['hasMany'](db[_0x655b('0x9a')],{'as':_0x655b('0x19d'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19e')});db['SalesforceConfiguration'][_0x655b('0xfb')](db[_0x655b('0x9a')],{'as':_0x655b('0x19f'),'onDelete':'cascade','foreignKey':_0x655b('0x1a0')});db[_0x655b('0x99')][_0x655b('0xfb')](db[_0x655b('0x9a')],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a1')});db[_0x655b('0x99')][_0x655b('0x133')](db[_0x655b('0x1a2')],{'as':_0x655b('0x154'),'foreignKey':'AccountId'});db[_0x655b('0x9a')][_0x655b('0xfb')](db[_0x655b('0x9a')],{'as':_0x655b('0x1a3'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0x9a')][_0x655b('0xfb')](db[_0x655b('0x9a')],{'as':'Description','foreignKey':_0x655b('0x1a0')});db[_0x655b('0x9a')]['hasMany'](db[_0x655b('0x9a')],{'as':_0x655b('0x1a4'),'foreignKey':'FieldId'});db['SalesforceField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x655b('0x1a5')});db['SugarcrmAccount'][_0x655b('0xfb')](db[_0x655b('0x9c')],{'as':_0x655b('0x1a6'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0x9c')]['hasMany'](db[_0x655b('0x1a7')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x655b('0x19e')});db[_0x655b('0x9c')][_0x655b('0xfb')](db[_0x655b('0x1a7')],{'as':_0x655b('0x19f'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0x9c')]['hasMany'](db[_0x655b('0x1a7')],{'as':_0x655b('0x19a'),'onDelete':'cascade','foreignKey':_0x655b('0x1a1')});db[_0x655b('0x9c')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x655b('0x154'),'foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x655b('0x1a3'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0x1a7')][_0x655b('0xfb')](db[_0x655b('0x1a7')],{'as':'Description','foreignKey':_0x655b('0x1a0')});db[_0x655b('0x1a7')][_0x655b('0xfb')](db[_0x655b('0x1a7')],{'as':_0x655b('0x1a4'),'foreignKey':_0x655b('0x1a1')});db['SugarcrmField'][_0x655b('0x133')](db[_0x655b('0x8f')],{'as':_0x655b('0x8f'),'foreignKey':_0x655b('0x1a5')});db[_0x655b('0x9e')][_0x655b('0xfb')](db[_0x655b('0x9f')],{'as':_0x655b('0x1a6'),'onDelete':'cascade','foreignKey':_0x655b('0x19c')});db[_0x655b('0x9f')][_0x655b('0xfb')](db[_0x655b('0xa1')],{'as':_0x655b('0x19d'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0x9f')][_0x655b('0xfb')](db[_0x655b('0xa1')],{'as':_0x655b('0x19f'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0x9f')][_0x655b('0xfb')](db['DeskField'],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':'FieldId'});db[_0x655b('0x9f')][_0x655b('0x133')](db[_0x655b('0x9e')],{'as':'Account','foreignKey':'AccountId'});db[_0x655b('0x9f')][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':'int_desk_configuration_has_tags'});db[_0x655b('0xa1')]['hasMany'](db[_0x655b('0xa1')],{'as':'Subject','foreignKey':_0x655b('0x19e')});db[_0x655b('0xa1')]['hasMany'](db[_0x655b('0xa1')],{'as':_0x655b('0x1a8'),'foreignKey':_0x655b('0x1a0')});db['DeskField']['hasMany'](db[_0x655b('0xa1')],{'as':_0x655b('0x1a4'),'foreignKey':_0x655b('0x1a1')});db[_0x655b('0xa1')][_0x655b('0x133')](db[_0x655b('0x8f')],{'as':'Variable','foreignKey':'VariableId'});db[_0x655b('0xa3')][_0x655b('0xfb')](db[_0x655b('0xa4')],{'as':'Configurations','onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19c')});db['ZohoConfiguration'][_0x655b('0xfb')](db[_0x655b('0xa5')],{'as':_0x655b('0x19d'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0xa4')][_0x655b('0xfb')](db[_0x655b('0xa5')],{'as':_0x655b('0x19f'),'onDelete':_0x655b('0xf9'),'foreignKey':'DescriptionId'});db[_0x655b('0xa4')]['hasMany'](db[_0x655b('0xa5')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x655b('0x1a1')});db['ZohoConfiguration'][_0x655b('0x133')](db[_0x655b('0xa3')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0xa5')][_0x655b('0xfb')](db[_0x655b('0xa5')],{'as':'Subject','foreignKey':_0x655b('0x19e')});db[_0x655b('0xa5')][_0x655b('0xfb')](db[_0x655b('0xa5')],{'as':_0x655b('0x1a8'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xa5')][_0x655b('0xfb')](db['ZohoField'],{'as':_0x655b('0x1a4'),'foreignKey':'FieldId'});db[_0x655b('0xa5')]['belongsTo'](db['Variable'],{'as':_0x655b('0x8f'),'foreignKey':_0x655b('0x1a5')});db['ZendeskAccount'][_0x655b('0xfb')](db[_0x655b('0xa7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x655b('0x19c')});db['ZendeskConfiguration'][_0x655b('0xfb')](db[_0x655b('0xa9')],{'as':_0x655b('0x19d'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0xa7')][_0x655b('0xfb')](db[_0x655b('0xa9')],{'as':_0x655b('0x19f'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration']['hasMany'](db[_0x655b('0xa9')],{'as':_0x655b('0x19a'),'foreignKey':_0x655b('0x1a1')});db[_0x655b('0xa7')][_0x655b('0x133')](db['ZendeskAccount'],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db['ZendeskConfiguration'][_0x655b('0x106')](db[_0x655b('0x8b')],{'through':_0x655b('0x1a9')});db[_0x655b('0xa9')][_0x655b('0xfb')](db[_0x655b('0xa9')],{'as':_0x655b('0x1a3'),'foreignKey':_0x655b('0x19e')});db['ZendeskField'][_0x655b('0xfb')](db['ZendeskField'],{'as':_0x655b('0x1a8'),'foreignKey':_0x655b('0x1a0')});db['ZendeskField'][_0x655b('0xfb')](db['ZendeskField'],{'as':'Field','foreignKey':_0x655b('0x1a1')});db[_0x655b('0xa9')]['belongsTo'](db[_0x655b('0x8f')],{'as':_0x655b('0x8f'),'foreignKey':'VariableId'});db[_0x655b('0xab')][_0x655b('0xfb')](db[_0x655b('0xad')],{'as':'Configurations','onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0xad')][_0x655b('0xfb')](db[_0x655b('0xaf')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x655b('0x19e')});db['FreshdeskConfiguration'][_0x655b('0xfb')](db[_0x655b('0xaf')],{'as':_0x655b('0x19f'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xad')][_0x655b('0xfb')](db['FreshdeskField'],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':'FieldId'});db[_0x655b('0xad')][_0x655b('0x133')](db['FreshdeskAccount'],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0xad')]['belongsToMany'](db[_0x655b('0x8b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x655b('0xaf')]['hasMany'](db[_0x655b('0xaf')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x655b('0xaf')][_0x655b('0xfb')](db[_0x655b('0xaf')],{'as':_0x655b('0x1a8'),'foreignKey':_0x655b('0x1a0')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x655b('0x1a4'),'foreignKey':'FieldId'});db[_0x655b('0xaf')][_0x655b('0x133')](db['Variable'],{'as':_0x655b('0x8f'),'foreignKey':_0x655b('0x1a5')});db[_0x655b('0x1aa')]['hasMany'](db[_0x655b('0xb1')],{'as':'Configurations','onDelete':_0x655b('0xf9'),'foreignKey':'AccountId'});db[_0x655b('0xb1')][_0x655b('0xfb')](db['VtigerField'],{'as':_0x655b('0x19d'),'foreignKey':'SubjectId'});db[_0x655b('0xb1')][_0x655b('0xfb')](db['VtigerField'],{'as':_0x655b('0x19f'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xb1')]['hasMany'](db[_0x655b('0x1ab')],{'as':'Fields','foreignKey':_0x655b('0x1a1')});db[_0x655b('0xb1')][_0x655b('0x133')](db[_0x655b('0x1aa')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db['VtigerField'][_0x655b('0xfb')](db[_0x655b('0x1ab')],{'as':_0x655b('0x1a3'),'foreignKey':'SubjectId'});db['VtigerField'][_0x655b('0xfb')](db[_0x655b('0x1ab')],{'as':'Description','foreignKey':_0x655b('0x1a0')});db[_0x655b('0x1ab')][_0x655b('0xfb')](db['VtigerField'],{'as':_0x655b('0x1a4'),'foreignKey':_0x655b('0x1a1')});db[_0x655b('0x1ab')][_0x655b('0x133')](db[_0x655b('0x8f')],{'as':_0x655b('0x8f'),'foreignKey':_0x655b('0x1a5')});db[_0x655b('0x1ac')][_0x655b('0xfb')](db[_0x655b('0xb5')],{'as':_0x655b('0x1a6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x655b('0xb5')][_0x655b('0xfb')](db[_0x655b('0x1ad')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x655b('0xb5')][_0x655b('0xfb')](db['ServicenowField'],{'as':_0x655b('0x19f'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xb5')][_0x655b('0xfb')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x655b('0x1a1')});db[_0x655b('0xb5')][_0x655b('0x133')](db[_0x655b('0x1ac')],{'as':'Account','foreignKey':_0x655b('0x19c')});db[_0x655b('0x1ad')][_0x655b('0xfb')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x655b('0x19e')});db[_0x655b('0x1ad')]['hasMany'](db[_0x655b('0x1ad')],{'as':_0x655b('0x1a8'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0x1ad')][_0x655b('0xfb')](db[_0x655b('0x1ad')],{'as':'Field','foreignKey':_0x655b('0x1a1')});db[_0x655b('0x1ad')][_0x655b('0x133')](db[_0x655b('0x8f')],{'as':'Variable','foreignKey':_0x655b('0x1a5')});db[_0x655b('0xb8')][_0x655b('0xfb')](db['Dynamics365Configuration'],{'as':_0x655b('0x1a6'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0xba')][_0x655b('0xfb')](db[_0x655b('0x1ae')],{'as':_0x655b('0x19d'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0xba')][_0x655b('0xfb')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xba')][_0x655b('0xfb')](db[_0x655b('0x1ae')],{'as':_0x655b('0x19a'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1a1')});db[_0x655b('0xba')][_0x655b('0x133')](db[_0x655b('0xb8')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db['Dynamics365Field']['hasMany'](db[_0x655b('0x1ae')],{'as':_0x655b('0x1a3'),'foreignKey':_0x655b('0x19e')});db[_0x655b('0x1ae')][_0x655b('0xfb')](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x655b('0x1a0')});db[_0x655b('0x1ae')][_0x655b('0xfb')](db[_0x655b('0x1ae')],{'as':_0x655b('0x1a4'),'foreignKey':_0x655b('0x1a1')});db['Dynamics365Field'][_0x655b('0x133')](db[_0x655b('0x8f')],{'as':_0x655b('0x8f'),'foreignKey':_0x655b('0x1a5')});db[_0x655b('0x1af')][_0x655b('0xfb')](db['FreshsalesConfiguration'],{'as':_0x655b('0x1a6'),'onDelete':'cascade','foreignKey':_0x655b('0x19c')});db[_0x655b('0xbd')][_0x655b('0xfb')](db[_0x655b('0xbf')],{'as':_0x655b('0x19d'),'foreignKey':_0x655b('0x19e')});db['FreshsalesConfiguration'][_0x655b('0xfb')](db[_0x655b('0xbf')],{'as':_0x655b('0x19f'),'foreignKey':_0x655b('0x1a0')});db[_0x655b('0xbd')][_0x655b('0xfb')](db[_0x655b('0xbf')],{'as':_0x655b('0x19a'),'foreignKey':'FieldId'});db[_0x655b('0xbd')][_0x655b('0x133')](db['FreshsalesAccount'],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x19c')});db[_0x655b('0xbf')]['hasMany'](db[_0x655b('0xbf')],{'as':_0x655b('0x1a3'),'foreignKey':_0x655b('0x19e')});db['FreshsalesField'][_0x655b('0xfb')](db[_0x655b('0xbf')],{'as':_0x655b('0x1a8'),'foreignKey':'DescriptionId'});db[_0x655b('0xbf')][_0x655b('0xfb')](db[_0x655b('0xbf')],{'as':_0x655b('0x1a4'),'foreignKey':_0x655b('0x1a1')});db['FreshsalesField']['belongsTo'](db[_0x655b('0x8f')],{'as':_0x655b('0x8f'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x655b('0x133')](db[_0x655b('0x11c')],{});db[_0x655b('0xc3')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':'ListId'});db[_0x655b('0xc3')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db['ChatQueueReport'][_0x655b('0x133')](db[_0x655b('0x10f')],{});db[_0x655b('0xc3')]['belongsTo'](db[_0x655b('0x65')],{});db['ChatQueueReport'][_0x655b('0x133')](db[_0x655b('0x12')],{});db['ChatQueueReport'][_0x655b('0x133')](db[_0x655b('0x117')],{});db[_0x655b('0x179')]['belongsTo'](db['User'],{'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x1b0')});db[_0x655b('0x179')][_0x655b('0x133')](db['User'],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x655b('0xc7')]['hasMany'](db[_0x655b('0x1b1')],{'foreignKey':_0x655b('0x1b2'),'onDelete':_0x655b('0xf9')});db[_0x655b('0xc7')][_0x655b('0xfb')](db[_0x655b('0x1b3')],{'foreignKey':_0x655b('0x1b2'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x1b4')][_0x655b('0x133')](db[_0x655b('0x52')],{});db[_0x655b('0x1b4')][_0x655b('0x133')](db[_0x655b('0x10a')],{'as':'List','foreignKey':_0x655b('0x15c')});db[_0x655b('0x1b4')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':'Contact','foreignKey':_0x655b('0x144')});db['SmsQueueReport'][_0x655b('0x133')](db[_0x655b('0x56')],{});db['SmsQueueReport'][_0x655b('0x133')](db[_0x655b('0x164')],{});db['SmsQueueReport']['belongsTo'](db['User'],{});db['SmsQueueReport']['belongsTo'](db[_0x655b('0x58')],{});db[_0x655b('0xcc')][_0x655b('0xfb')](db[_0x655b('0xc7')],{'foreignKey':'ProjectId'});db[_0x655b('0xcc')][_0x655b('0xfb')](db[_0x655b('0x1b1')],{'foreignKey':'ProjectId'});db[_0x655b('0xcc')][_0x655b('0xfb')](db[_0x655b('0x1b3')],{'foreignKey':_0x655b('0x1b5')});db[_0x655b('0xd0')][_0x655b('0x106')](db['User'],{'as':'Users','through':'user_has_square_projects'});db[_0x655b('0xd5')]['belongsToMany'](db['User'],{'as':_0x655b('0x14e'),'through':_0x655b('0x10d')});db['Team'][_0x655b('0x106')](db[_0x655b('0x113')],{'through':_0x655b('0x13a'),'as':'VoiceQueues'});db[_0x655b('0xd5')][_0x655b('0x106')](db[_0x655b('0x3c')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x655b('0xd5')][_0x655b('0x106')](db[_0x655b('0x117')],{'through':_0x655b('0x178'),'as':_0x655b('0x118')});db[_0x655b('0xd5')][_0x655b('0x106')](db[_0x655b('0x50')],{'through':_0x655b('0x1b6'),'as':_0x655b('0x1b7')});db[_0x655b('0xd5')][_0x655b('0x106')](db[_0x655b('0x58')],{'through':_0x655b('0x1b8'),'as':_0x655b('0x1b9')});db[_0x655b('0xd5')][_0x655b('0x106')](db[_0x655b('0x5e')],{'through':_0x655b('0x16d'),'as':_0x655b('0x119')});db['Team'][_0x655b('0x106')](db[_0x655b('0xf4')],{'through':_0x655b('0x1ba'),'as':_0x655b('0x1bb')});db[_0x655b('0x182')][_0x655b('0xfb')](db[_0x655b('0x6f')],{'as':_0x655b('0x17d'),'foreignKey':_0x655b('0x183')});db[_0x655b('0x182')]['hasMany'](db['CmHopperFinal'],{'as':_0x655b('0x12f'),'foreignKey':'CampaignId'});db[_0x655b('0x182')][_0x655b('0xfb')](db[_0x655b('0x74')],{'as':_0x655b('0x17e'),'foreignKey':_0x655b('0x183')});db[_0x655b('0x182')][_0x655b('0xfb')](db[_0x655b('0x71')],{'as':_0x655b('0x130'),'foreignKey':_0x655b('0x183')});db['Campaign'][_0x655b('0x133')](db[_0x655b('0x2a')],{'as':'Trunk','foreignKey':_0x655b('0x1bc')});db[_0x655b('0x182')][_0x655b('0x133')](db[_0x655b('0x2a')],{'as':'TrunkBackup','foreignKey':_0x655b('0x1bd')});db[_0x655b('0x182')][_0x655b('0x133')](db['Interval'],{'as':_0x655b('0x134'),'foreignKey':'IntervalId'});db[_0x655b('0x182')][_0x655b('0x133')](db[_0x655b('0xd0')],{'as':_0x655b('0xd0'),'foreignKey':_0x655b('0x1be')});db[_0x655b('0x182')]['belongsToMany'](db[_0x655b('0x10a')],{'as':_0x655b('0x10b'),'through':_0x655b('0x1bf')});db[_0x655b('0x182')][_0x655b('0x106')](db[_0x655b('0x10a')],{'as':_0x655b('0x13b'),'through':'campaigns_has_cm_blacklists'});db[_0x655b('0x161')][_0x655b('0x133')](db['ChatOfflineMessage'],{'as':_0x655b('0x67'),'foreignKey':_0x655b('0x155')});db['MailTransferReport']['belongsTo'](db[_0x655b('0x42')],{});db['MailTransferReport'][_0x655b('0x133')](db[_0x655b('0x40')],{});db[_0x655b('0xdd')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x655b('0x1c0'),'as':'FromAccount'});db[_0x655b('0xdd')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db[_0x655b('0xdd')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':'ToUserId','as':_0x655b('0x1c3')});db[_0x655b('0xdd')][_0x655b('0x133')](db[_0x655b('0x3c')],{'foreignKey':_0x655b('0x1c4'),'as':'ToQueue'});db['MailTransferReport'][_0x655b('0x133')](db[_0x655b('0x3a')],{'foreignKey':_0x655b('0x1c5'),'as':_0x655b('0x1c6')});db[_0x655b('0xde')][_0x655b('0x133')](db[_0x655b('0x65')],{});db['ChatTransferReport']['belongsTo'](db[_0x655b('0x10f')],{});db['ChatTransferReport'][_0x655b('0x133')](db[_0x655b('0x11c')],{'foreignKey':_0x655b('0x1c7'),'as':_0x655b('0x1c8')});db[_0x655b('0xde')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db[_0x655b('0xde')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c9'),'as':_0x655b('0x1c3')});db['ChatTransferReport'][_0x655b('0x133')](db[_0x655b('0x117')],{'foreignKey':_0x655b('0x1ca'),'as':_0x655b('0x1cb')});db['ChatTransferReport']['belongsTo'](db[_0x655b('0x11c')],{'foreignKey':_0x655b('0x1cc'),'as':'ToAccount'});db[_0x655b('0x1cd')][_0x655b('0x133')](db[_0x655b('0x4e')],{});db['FaxTransferReport'][_0x655b('0x133')](db[_0x655b('0x4c')],{});db[_0x655b('0x1cd')][_0x655b('0x133')](db[_0x655b('0x49')],{'foreignKey':'FromFaxAccountId','as':_0x655b('0x1c8')});db[_0x655b('0x1cd')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db['FaxTransferReport'][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c9'),'as':'ToAgent'});db[_0x655b('0x1cd')][_0x655b('0x133')](db[_0x655b('0x50')],{'foreignKey':_0x655b('0x1ce'),'as':_0x655b('0x1cb')});db['FaxTransferReport'][_0x655b('0x133')](db[_0x655b('0x49')],{'foreignKey':'ToFaxAccountId','as':_0x655b('0x1c6')});db[_0x655b('0xe1')][_0x655b('0x133')](db['OpenchannelMessage'],{});db[_0x655b('0xe1')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x655b('0xe1')][_0x655b('0x133')](db[_0x655b('0x168')],{'foreignKey':_0x655b('0x1cf'),'as':_0x655b('0x1c8')});db[_0x655b('0xe1')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db['OpenchannelTransferReport'][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c9'),'as':_0x655b('0x1c3')});db[_0x655b('0xe1')][_0x655b('0x133')](db[_0x655b('0x5e')],{'foreignKey':_0x655b('0x1d0'),'as':'ToQueue'});db[_0x655b('0xe1')][_0x655b('0x133')](db['OpenchannelAccount'],{'foreignKey':_0x655b('0x1d1'),'as':_0x655b('0x1c6')});db['SmsTransferReport'][_0x655b('0x133')](db[_0x655b('0x164')],{});db[_0x655b('0x1d2')][_0x655b('0x133')](db['SmsInteraction'],{});db[_0x655b('0x1d2')][_0x655b('0x133')](db[_0x655b('0x52')],{'foreignKey':_0x655b('0x1d3'),'as':_0x655b('0x1c8')});db[_0x655b('0x1d2')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db[_0x655b('0x1d2')]['belongsTo'](db[_0x655b('0x12')],{'foreignKey':'ToUserId','as':_0x655b('0x1c3')});db[_0x655b('0x1d2')][_0x655b('0x133')](db[_0x655b('0x58')],{'foreignKey':_0x655b('0x1d4'),'as':'ToQueue'});db['SmsTransferReport'][_0x655b('0x133')](db['SmsAccount'],{'foreignKey':_0x655b('0x1d5'),'as':_0x655b('0x1c6')});db[_0x655b('0x10a')]['hasMany'](db[_0x655b('0x7d')],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x15c'),'onDelete':_0x655b('0xf9')});db['CmList'][_0x655b('0xfb')](db[_0x655b('0x1d6')],{'as':_0x655b('0x1d7'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x10a')][_0x655b('0xfb')](db[_0x655b('0x6d')],{'as':_0x655b('0x109'),'onDelete':_0x655b('0xf9'),'foreignKey':_0x655b('0x15c')});db['CmList']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x655b('0x15c')});db[_0x655b('0x10a')]['hasMany'](db['CmHopperHistory'],{'as':_0x655b('0xfd'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x10a')][_0x655b('0xfb')](db[_0x655b('0x76')],{'as':_0x655b('0x76'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0x10a')][_0x655b('0x106')](db[_0x655b('0x113')],{'as':_0x655b('0x1d8'),'through':_0x655b('0x138')});db['CmList']['belongsToMany'](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':_0x655b('0x10c')});db[_0x655b('0xe3')][_0x655b('0xfb')](db[_0x655b('0x18')],{'as':_0x655b('0x18e'),'onDelete':_0x655b('0xf9')});db['VoicePrefix'][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':'user_has_voice_prefixes'});db[_0x655b('0xe5')][_0x655b('0xfb')](db[_0x655b('0x12')],{'as':_0x655b('0x152'),'foreignKey':'userProfileId'});db['UserProfile'][_0x655b('0xfb')](db[_0x655b('0xe7')],{'as':_0x655b('0x1d9'),'foreignKey':_0x655b('0x105'),'onDelete':_0x655b('0xf9')});db[_0x655b('0xe7')][_0x655b('0xfb')](db['UserProfileResource'],{'as':_0x655b('0x1da'),'foreignKey':_0x655b('0x1db'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x126')][_0x655b('0xfb')](db[_0x655b('0x7d')],{'as':_0x655b('0x148'),'foreignKey':_0x655b('0x1dc'),'onDelete':_0x655b('0xf9')});db[_0x655b('0x126')][_0x655b('0xfb')](db[_0x655b('0x7b')],{'as':'Answers','foreignKey':_0x655b('0x1dc')});db[_0x655b('0x126')]['hasMany'](db[_0x655b('0xef')],{'as':_0x655b('0x14a'),'foreignKey':_0x655b('0x1dc')});db['WhatsappAccount'][_0x655b('0xfb')](db[_0x655b('0x102')],{'as':_0x655b('0x14b')});db[_0x655b('0x126')][_0x655b('0xfb')](db['WhatsappApplication'],{'as':'Applications'});db[_0x655b('0x126')][_0x655b('0x133')](db['CmList'],{'as':'List','foreignKey':_0x655b('0x15c')});db[_0x655b('0x126')][_0x655b('0x133')](db['Pause'],{'as':_0x655b('0x136'),'foreignKey':_0x655b('0x137')});db[_0x655b('0x126')]['belongsToMany'](db['User'],{'as':_0x655b('0x14e'),'through':_0x655b('0x127')});db[_0x655b('0xee')][_0x655b('0x133')](db['User'],{'onDelete':'restrict'});db[_0x655b('0xee')][_0x655b('0x133')](db[_0x655b('0xf4')],{'onDelete':'restrict'});db[_0x655b('0xee')][_0x655b('0x133')](db[_0x655b('0x126')],{'onDelete':'restrict'});db[_0x655b('0xee')][_0x655b('0x133')](db['Interval'],{'onDelete':_0x655b('0x156'),'foreignKey':'IntervalId'});db[_0x655b('0xee')][_0x655b('0x133')](db[_0x655b('0x8b')],{'onDelete':'restrict','foreignKey':_0x655b('0x157')});db['WhatsappInteraction'][_0x655b('0xfb')](db[_0x655b('0xef')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x655b('0x1dd')});db[_0x655b('0x102')][_0x655b('0x133')](db[_0x655b('0x126')],{'as':_0x655b('0x154'),'foreignKey':_0x655b('0x1dc')});db[_0x655b('0x102')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0x102')][_0x655b('0x133')](db[_0x655b('0x12')],{'as':_0x655b('0x15d'),'foreignKey':_0x655b('0xfa')});db[_0x655b('0x102')]['belongsToMany'](db[_0x655b('0x8b')],{'through':_0x655b('0x196'),'as':_0x655b('0x151')});db[_0x655b('0x102')]['belongsToMany'](db[_0x655b('0x8b')],{'through':_0x655b('0x196'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db[_0x655b('0x12')],{'as':_0x655b('0x152'),'through':_0x655b('0x112'),'foreignKey':_0x655b('0x1dd')});db[_0x655b('0xef')]['belongsTo'](db[_0x655b('0x12')],{'as':_0x655b('0x12')});db[_0x655b('0xef')][_0x655b('0x133')](db[_0x655b('0x6d')],{'onDelete':'cascade','as':_0x655b('0x143')});db[_0x655b('0xef')][_0x655b('0x133')](db[_0x655b('0x102')],{'onDelete':_0x655b('0xf9'),'as':_0x655b('0x153'),'foreignKey':'WhatsappInteractionId'});db[_0x655b('0xef')][_0x655b('0x133')](db[_0x655b('0x126')],{'as':'Account','foreignKey':_0x655b('0x1dc')});db[_0x655b('0xf1')]['belongsTo'](db[_0x655b('0x126')],{});db[_0x655b('0xf1')]['belongsTo'](db[_0x655b('0x10a')],{'as':_0x655b('0x15b'),'foreignKey':_0x655b('0x15c')});db[_0x655b('0xf1')][_0x655b('0x133')](db[_0x655b('0x6d')],{'as':_0x655b('0x143'),'foreignKey':_0x655b('0x144')});db[_0x655b('0xf1')]['belongsTo'](db[_0x655b('0x102')],{});db[_0x655b('0xf1')][_0x655b('0x133')](db[_0x655b('0xf4')],{});db[_0x655b('0xf1')][_0x655b('0x133')](db[_0x655b('0xef')],{});db[_0x655b('0xf1')][_0x655b('0x133')](db[_0x655b('0x12')],{});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0xef')],{});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0x102')],{});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0x126')],{'foreignKey':_0x655b('0x1de'),'as':_0x655b('0x1c8')});db[_0x655b('0xf2')][_0x655b('0x133')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x655b('0x1c6')});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0xf4')],{'foreignKey':_0x655b('0x1df'),'as':_0x655b('0x1cb')});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c1'),'as':_0x655b('0x1c2')});db[_0x655b('0xf2')][_0x655b('0x133')](db[_0x655b('0x12')],{'foreignKey':_0x655b('0x1c9'),'as':'ToAgent'});db[_0x655b('0xf4')][_0x655b('0x106')](db[_0x655b('0x12')],{'as':_0x655b('0x14e'),'through':_0x655b('0x36'),'foreignKey':_0x655b('0x1e0')});db['WhatsappQueue']['belongsToMany'](db[_0x655b('0xd5')],{'through':_0x655b('0x1ba'),'as':'Teams'});module[_0x655b('0x1e1')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7734=['ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','HopperHistory','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','JscriptySessionReport','JscriptySessions','belongsTo','Trunk','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','hasOne','Smtp','Dispositions','Answers','MailMessage','Messages','Interactions','ListId','TemplateId','team_has_mail_queues','Account','Owner','Tags','ThroughTags','MailInteractionId','Attachments','Interaction','ChatWebsite','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Items','FaxAccountId','FaxApplication','Exntensions','List','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','Teams','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','CompanyId','HopperHistories','Company','cm_contact_has_tags','OwnerId','CampaignId','Automation','All','OneAll','AutomationAllId','Any','OneAny','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','mail_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Description','FieldId','VariableId','SugarcrmConfiguration','Field','DeskConfiguration','DeskAccount','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowAccount','ChatQueueReport','FromId','ToId','ProjectId','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','WhatsappQueues','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','userProfileId','Resources','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','username','password','options','database','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','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','../api/mailMessage/mailMessage.model','MailApplication','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../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','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7734,0x13b));var _0x4773=function(_0x420aea,_0x3c70c9){_0x420aea=_0x420aea-0x0;var _0xc7b7d6=_0x7734[_0x420aea];return _0xc7b7d6;};'use strict';var config=require(_0x4773('0x0'));var Sequelize=require(_0x4773('0x1'));var _=require(_0x4773('0x2'));var jstz=require(_0x4773('0x3'));var timezone=jstz[_0x4773('0x4')]();config[_0x4773('0x1')]=_['defaultsDeep'](config[_0x4773('0x1')],{'database':_0x4773('0x5'),'username':_0x4773('0x6'),'password':_0x4773('0x7'),'options':{'host':_0x4773('0x8'),'port':0xcea,'dialect':_0x4773('0x9'),'dialectOptions':{'charset':_0x4773('0xa')},'logging':![],'timezone':timezone[_0x4773('0xb')](),'define':{'charset':_0x4773('0xc'),'collate':_0x4773('0xd')}}});config[_0x4773('0xe')]=_[_0x4773('0xf')](config[_0x4773('0xe')],{'database':_0x4773('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x4773('0x8'),'port':0xcea,'dialect':_0x4773('0x9'),'dialectOptions':{'charset':_0x4773('0xa')},'logging':![],'timezone':timezone[_0x4773('0xb')](),'define':{'charset':_0x4773('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4773('0x1')]['database'],config[_0x4773('0x1')][_0x4773('0x10')],config[_0x4773('0x1')][_0x4773('0x11')],config[_0x4773('0x1')][_0x4773('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4773('0xe')][_0x4773('0x13')],config[_0x4773('0xe')]['username'],config['sequelizeHistory'][_0x4773('0x11')],config['sequelizeHistory'][_0x4773('0x12')])};db[_0x4773('0x14')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x16'));db['VoiceChanSpy']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x17'));db['VoiceContext']=db[_0x4773('0x1')][_0x4773('0x15')]('../api/voiceContext/voiceContext.model');db[_0x4773('0x18')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0x4773('0x19')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x1a'));db[_0x4773('0x1b')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize'][_0x4773('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x4773('0x1c')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x1d'));db[_0x4773('0x1e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x1f'));db[_0x4773('0x20')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x21'));db[_0x4773('0x22')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0x4773('0x23')]=db['sequelize']['import'](_0x4773('0x24'));db[_0x4773('0x25')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x4773('0x1')]['import'](_0x4773('0x26'));db[_0x4773('0x27')]=db[_0x4773('0x1')]['import'](_0x4773('0x28'));db['Trunk']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x29'));db['VoiceTransferReport']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x2a'));db[_0x4773('0x2b')]=db[_0x4773('0x1')]['import'](_0x4773('0x2c'));db[_0x4773('0x2d')]=db[_0x4773('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x2e'));db['UserMailQueue']=db[_0x4773('0x1')]['import'](_0x4773('0x2f'));db[_0x4773('0x30')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0x4773('0x31')]=db[_0x4773('0x1')]['import'](_0x4773('0x32'));db['UserOpenchannelQueue']=db[_0x4773('0x1')]['import'](_0x4773('0x33'));db[_0x4773('0x34')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x35'));db[_0x4773('0x36')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x37'));db[_0x4773('0x38')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x39'));db[_0x4773('0x3a')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x3b'));db[_0x4773('0x3c')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x3d'));db[_0x4773('0x3e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x3f'));db[_0x4773('0x40')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x41'));db['MailMessage']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x42'));db[_0x4773('0x43')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x4773('0x1')][_0x4773('0x15')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4773('0x44')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x45'));db[_0x4773('0x46')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x47'));db[_0x4773('0x48')]=db[_0x4773('0x1')]['import']('../api/faxAccount/faxAccount.model');db['FaxApplication']=db['sequelize'][_0x4773('0x15')](_0x4773('0x49'));db[_0x4773('0x4a')]=db[_0x4773('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x4773('0x4b')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x4c'));db[_0x4773('0x4d')]=db[_0x4773('0x1')]['import'](_0x4773('0x4e'));db[_0x4773('0x4f')]=db[_0x4773('0x1')]['import'](_0x4773('0x50'));db[_0x4773('0x51')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x52'));db['SmsApplication']=db[_0x4773('0x1')]['import']('../api/smsApplication/smsApplication.model');db[_0x4773('0x53')]=db['sequelize']['import'](_0x4773('0x54'));db[_0x4773('0x55')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x56'));db[_0x4773('0x57')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x58'));db[_0x4773('0x59')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x5a'));db[_0x4773('0x5b')]=db[_0x4773('0x1')]['import'](_0x4773('0x5c'));db[_0x4773('0x5d')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x5e'));db[_0x4773('0x5f')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0x4773('0x60')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x61'));db['ChatWebsite']=db[_0x4773('0x1')]['import'](_0x4773('0x62'));db[_0x4773('0x63')]=db['sequelize']['import'](_0x4773('0x64'));db[_0x4773('0x65')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x66'));db[_0x4773('0x67')]=db[_0x4773('0x1')]['import'](_0x4773('0x68'));db['ChatMessage']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x69'));db[_0x4773('0x6a')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x6b'));db[_0x4773('0x6c')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/chatQueue/chatQueue.model');db[_0x4773('0x6d')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x6e'));db[_0x4773('0x6f')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x70'));db[_0x4773('0x71')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x72'));db[_0x4773('0x73')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x74'));db[_0x4773('0x75')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x76'));db[_0x4773('0x77')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x78'));db[_0x4773('0x79')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x7a'));db[_0x4773('0x7b')]=db[_0x4773('0x1')]['import'](_0x4773('0x7c'));db[_0x4773('0x7d')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x4773('0x7e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x7f'));db[_0x4773('0x80')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x81'));db['Automation']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x82'));db[_0x4773('0x83')]=db[_0x4773('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x4773('0x84')]=db['sequelize']['import'](_0x4773('0x85'));db[_0x4773('0x86')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x87'));db[_0x4773('0x88')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x89'));db[_0x4773('0x8a')]=db['sequelize']['import'](_0x4773('0x8b'));db[_0x4773('0x8c')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x8d'));db[_0x4773('0x8e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x8f'));db[_0x4773('0x90')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x91'));db[_0x4773('0x92')]=db[_0x4773('0x1')]['import']('../api/sound/sound.model');db[_0x4773('0x93')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x94'));db[_0x4773('0x95')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/template/template.model');db['Trigger']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x96'));db[_0x4773('0x97')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x98'));db['Integration']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x99'));db[_0x4773('0x9a')]=db[_0x4773('0x1')]['import'](_0x4773('0x9b'));db[_0x4773('0x9c')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x9d'));db[_0x4773('0x9e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x9f'));db[_0x4773('0xa0')]=db[_0x4773('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x4773('0xa1')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xa2'));db[_0x4773('0xa3')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xa4'));db[_0x4773('0xa5')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4773('0xa6')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xa7'));db[_0x4773('0xa8')]=db[_0x4773('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xa9'));db[_0x4773('0xaa')]=db[_0x4773('0x1')]['import'](_0x4773('0xab'));db['SugarcrmConfiguration']=db['sequelize'][_0x4773('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x4773('0xac')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db['sequelize']['import'](_0x4773('0xad'));db['DeskConfiguration']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xae'));db[_0x4773('0xaf')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xb0'));db[_0x4773('0xb1')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xb2'));db[_0x4773('0xb3')]=db['sequelize'][_0x4773('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xb4'));db[_0x4773('0xb5')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4773('0xb6')]=db['sequelize'][_0x4773('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4773('0xb7')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xb8'));db[_0x4773('0xb9')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xba'));db[_0x4773('0xbb')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4773('0xbc')]=db['sequelize'][_0x4773('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x4773('0xbd')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x4773('0xbe')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xbf'));db[_0x4773('0xc0')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xc1'));db['ServicenowAccount']=db[_0x4773('0x1')]['import'](_0x4773('0xc2'));db[_0x4773('0xc3')]=db[_0x4773('0x1')]['import'](_0x4773('0xc4'));db[_0x4773('0xc5')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xc6'));db[_0x4773('0xc7')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xc8'));db[_0x4773('0xc9')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xca'));db[_0x4773('0xcb')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xcc'));db[_0x4773('0xcd')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xce'));db[_0x4773('0xcf')]=db['sequelize']['import'](_0x4773('0xd0'));db[_0x4773('0xd1')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xd2'));db[_0x4773('0xd3')]=db['sequelize']['import']('../api/integration/integration.model');db[_0x4773('0xd4')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xd5'));db['ChatQueueReport']=db[_0x4773('0x1')]['import'](_0x4773('0xd6'));db['ChatInternalMessage']=db[_0x4773('0x1')]['import'](_0x4773('0xd7'));db[_0x4773('0xd8')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xd9'));db[_0x4773('0xda')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xdb'));db['JscriptySessionReport']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xdc'));db[_0x4773('0xdd')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xde'));db[_0x4773('0xdf')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xe0'));db[_0x4773('0xe1')]=db['sequelize'][_0x4773('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0x4773('0xe2')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xe3'));db[_0x4773('0xe4')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xe5'));db['SquareOdbc']=db[_0x4773('0x1')][_0x4773('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0x4773('0xe6')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xe7'));db[_0x4773('0xe8')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/squareRecording/squareRecording.model');db[_0x4773('0xe9')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xea'));db[_0x4773('0xeb')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xec'));db[_0x4773('0xed')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xee'));db[_0x4773('0xef')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xf0'));db['Migration']=db['sequelize'][_0x4773('0x15')]('../api/migration/migration.model');db[_0x4773('0xf1')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xf2'));db[_0x4773('0xf3')]=db[_0x4773('0x1')]['import'](_0x4773('0xf4'));db[_0x4773('0xf5')]=db[_0x4773('0x1')][_0x4773('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4773('0xf6')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xf7'));db['FaxTransferReport']=db[_0x4773('0x1')][_0x4773('0x15')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0x4773('0x1')][_0x4773('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x4773('0x1')]['import'](_0x4773('0xf8'));db[_0x4773('0xf9')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0xfa'));db[_0x4773('0xfb')]=db['sequelize']['import'](_0x4773('0xfc'));db[_0x4773('0xfd')]=db['sequelize'][_0x4773('0x15')](_0x4773('0xfe'));db[_0x4773('0xff')]=db[_0x4773('0x1')]['import'](_0x4773('0x100'));db[_0x4773('0x101')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x102'));db['UserNotification']=db['sequelize'][_0x4773('0x15')]('../api/userNotification/userNotification.model');db[_0x4773('0x103')]=db['sequelize'][_0x4773('0x15')](_0x4773('0x104'));db[_0x4773('0x105')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x106'));db[_0x4773('0x107')]=db['sequelize'][_0x4773('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db['sequelize'][_0x4773('0x15')](_0x4773('0x108'));db['WhatsappQueueReport']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x109'));db['WhatsappTransferReport']=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x10a'));db['WhatsappQueue']=db['sequelize'][_0x4773('0x15')](_0x4773('0x10b'));db[_0x4773('0x10c')]=db[_0x4773('0x1')]['import'](_0x4773('0x10d'));db[_0x4773('0x10e')]=db[_0x4773('0x1')][_0x4773('0x15')](_0x4773('0x10f'));db['User']['hasOne'](db['VoiceMail'],{'as':_0x4773('0x1e'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x113')],{'as':'Recordings','foreignKey':_0x4773('0x111')});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x2b')],{'as':_0x4773('0x114'),'foreignKey':'UserId'});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x18')],{'as':'Extensions','onDelete':_0x4773('0x110'),'hooks':!![]});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x79')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4773('0x14')][_0x4773('0x112')](db['CmHopperHistory'],{'as':_0x4773('0x115'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x14')]['hasMany'](db[_0x4773('0x7d')],{'as':_0x4773('0x7d'),'foreignKey':'UserId'});db['User'][_0x4773('0x112')](db[_0x4773('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x67')],{'as':'ChatInteractions','foreignKey':_0x4773('0x111')});db['User'][_0x4773('0x112')](db[_0x4773('0x53')],{'as':_0x4773('0x116'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x4a')],{'as':_0x4773('0x117'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x14')][_0x4773('0x112')](db[_0x4773('0x40')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0x4773('0x112')](db[_0x4773('0x107')],{'as':_0x4773('0x118'),'foreignKey':_0x4773('0x111')});db['User']['hasMany'](db[_0x4773('0x119')],{'as':_0x4773('0x11a'),'foreignKey':_0x4773('0x11b')});db['User']['belongsTo'](db[_0x4773('0xfd')],{'as':_0x4773('0xfd'),'foreignKey':'userProfileId'});db[_0x4773('0x14')][_0x4773('0x11c')](db['ChatGroup'],{'as':_0x4773('0x11d'),'through':_0x4773('0x11e')});db['User'][_0x4773('0x11c')](db[_0x4773('0x73')],{'as':_0x4773('0x11f'),'through':_0x4773('0x120')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0xf9')],{'as':_0x4773('0x121'),'through':'cm_user_has_lists'});db['User'][_0x4773('0x11c')](db['Team'],{'through':_0x4773('0x122')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x40')],{'as':_0x4773('0x123'),'through':_0x4773('0x124')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x67')],{'as':_0x4773('0x125'),'through':'user_has_chat_interactions'});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x4a')],{'as':'FaxInteractions','through':_0x4773('0x126')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x53')],{'as':_0x4773('0x116'),'through':_0x4773('0x127')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x5d')],{'as':_0x4773('0x128'),'through':'user_has_openchannel_interactions'});db['User'][_0x4773('0x11c')](db[_0x4773('0x107')],{'as':_0x4773('0x118'),'through':_0x4773('0x129')});db['User']['belongsToMany'](db[_0x4773('0x1b')],{'as':_0x4773('0x12a'),'through':_0x4773('0x2d'),'required':![]});db[_0x4773('0x14')][_0x4773('0x11c')](db['MailQueue'],{'as':_0x4773('0x12b'),'through':_0x4773('0x12c'),'required':![]});db['User'][_0x4773('0x11c')](db[_0x4773('0x6c')],{'as':_0x4773('0x12d'),'through':_0x4773('0x12e'),'required':![],'hooks':!![]});db[_0x4773('0x14')]['belongsToMany'](db[_0x4773('0x4d')],{'as':'FaxQueues','through':_0x4773('0x30'),'required':![]});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x57')],{'as':_0x4773('0x12f'),'through':_0x4773('0x31'),'required':![]});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0x60')],{'as':_0x4773('0x130'),'through':_0x4773('0x131'),'required':![]});db[_0x4773('0x14')]['belongsToMany'](db[_0x4773('0x132')],{'as':'WhatsappQueues','through':_0x4773('0x34'),'required':![]});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0xf9')],{'through':_0x4773('0x133')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0xfb')],{'as':_0x4773('0x134'),'through':_0x4773('0x135'),'required':![]});db[_0x4773('0x14')][_0x4773('0x11c')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x4773('0x136')});db['User']['belongsToMany'](db[_0x4773('0x48')],{'as':_0x4773('0x137'),'through':_0x4773('0x138')});db[_0x4773('0x14')]['belongsToMany'](db[_0x4773('0x3a')],{'as':_0x4773('0x139'),'through':_0x4773('0x13a')});db[_0x4773('0x14')][_0x4773('0x11c')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x4773('0x13b')});db['User'][_0x4773('0x11c')](db[_0x4773('0x51')],{'as':_0x4773('0x13c'),'through':_0x4773('0x13d')});db[_0x4773('0x14')]['belongsToMany'](db[_0x4773('0x103')],{'as':_0x4773('0x13e'),'through':_0x4773('0x13f')});db[_0x4773('0x14')][_0x4773('0x11c')](db[_0x4773('0xe6')],{'as':_0x4773('0x140'),'through':_0x4773('0x141')});db[_0x4773('0x142')][_0x4773('0x112')](db[_0x4773('0x18')],{'as':_0x4773('0x143'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x144')});db[_0x4773('0x145')][_0x4773('0x112')](db[_0x4773('0x18')],{'onDelete':_0x4773('0x110')});db[_0x4773('0x18')]['hasMany'](db['VoiceExtension'],{'as':_0x4773('0x146'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x4773('0x11c')](db[_0x4773('0x92')],{'as':_0x4773('0x147'),'through':_0x4773('0x148')});db[_0x4773('0x1b')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x4773('0x149'),'foreignKey':_0x4773('0x14a')});db['VoiceQueue'][_0x4773('0x112')](db['CmHopper'],{'as':_0x4773('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x4773('0x1b')][_0x4773('0x112')](db[_0x4773('0x79')],{'as':_0x4773('0x14c'),'foreignKey':_0x4773('0x14a')});db[_0x4773('0x1b')][_0x4773('0x112')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x4773('0x14a')});db['VoiceQueue'][_0x4773('0x112')](db[_0x4773('0x7d')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x4773('0x1b')][_0x4773('0x112')](db[_0x4773('0x77')],{'as':_0x4773('0x14d'),'foreignKey':_0x4773('0x14a')});db[_0x4773('0x1b')][_0x4773('0x112')](db[_0x4773('0x14e')],{'as':_0x4773('0x14f'),'foreignKey':_0x4773('0x14a')});db[_0x4773('0x1b')][_0x4773('0x150')](db[_0x4773('0x151')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x4773('0x1b')][_0x4773('0x150')](db[_0x4773('0x151')],{'as':'TrunkBackup','foreignKey':_0x4773('0x152')});db['VoiceQueue'][_0x4773('0x150')](db[_0x4773('0x88')],{'as':_0x4773('0x88'),'foreignKey':_0x4773('0x153')});db[_0x4773('0x1b')][_0x4773('0x150')](db['Pause'],{'as':_0x4773('0x154'),'foreignKey':_0x4773('0x155')});db[_0x4773('0x1b')][_0x4773('0x11c')](db[_0x4773('0xf9')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x4773('0x1b')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x2d')});db['VoiceQueue'][_0x4773('0x11c')](db['Team'],{'as':'Teams','through':_0x4773('0x10e')});db[_0x4773('0x1b')][_0x4773('0x11c')](db[_0x4773('0xf9')],{'as':_0x4773('0x157'),'through':_0x4773('0x158')});db[_0x4773('0x113')]['belongsTo'](db[_0x4773('0x14')],{'as':_0x4773('0x14'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x1c')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x14'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x1e')][_0x4773('0x112')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x159'),'sourceKey':'mailbox'});db[_0x4773('0x20')]['belongsTo'](db[_0x4773('0x1e')],{'foreignKey':_0x4773('0x159'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x4773('0x112')](db[_0x4773('0x15a')],{'as':_0x4773('0x15b'),'foreignKey':_0x4773('0x15c'),'constraints':![]});db[_0x4773('0x22')][_0x4773('0x112')](db[_0x4773('0x25')],{'as':_0x4773('0x15d'),'foreignKey':_0x4773('0x15c'),'constraints':![]});db['VoiceCallReport'][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x14'),'foreignKey':_0x4773('0x111')});db['VoiceCallReport'][_0x4773('0x150')](db['CmContact'],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db['MailServerIn'][_0x4773('0x150')](db['MailAccount'],{'as':_0x4773('0x3a'),'foreignKey':_0x4773('0x160')});db[_0x4773('0x38')][_0x4773('0x150')](db[_0x4773('0x3a')],{'as':_0x4773('0x3a'),'foreignKey':_0x4773('0x160')});db[_0x4773('0x3a')]['hasOne'](db[_0x4773('0x36')],{'as':_0x4773('0x161'),'onDelete':_0x4773('0x110')});db[_0x4773('0x3a')][_0x4773('0x162')](db[_0x4773('0x38')],{'as':_0x4773('0x163'),'onDelete':_0x4773('0x110')});db[_0x4773('0x3a')][_0x4773('0x112')](db[_0x4773('0x84')],{'as':_0x4773('0x164'),'foreignKey':_0x4773('0x160'),'onDelete':'cascade'});db[_0x4773('0x3a')][_0x4773('0x112')](db['CannedAnswer'],{'as':_0x4773('0x165'),'foreignKey':'MailAccountId'});db[_0x4773('0x3a')][_0x4773('0x112')](db[_0x4773('0x166')],{'as':_0x4773('0x167'),'foreignKey':_0x4773('0x160')});db['MailAccount'][_0x4773('0x112')](db[_0x4773('0x40')],{'as':_0x4773('0x168')});db[_0x4773('0x3a')]['hasMany'](db[_0x4773('0x43')],{'as':_0x4773('0x146')});db[_0x4773('0x3a')]['belongsTo'](db[_0x4773('0xf9')],{'as':'List','foreignKey':_0x4773('0x169')});db[_0x4773('0x3a')][_0x4773('0x150')](db[_0x4773('0x95')],{'as':_0x4773('0x95'),'foreignKey':_0x4773('0x16a')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0x4773('0x154'),'foreignKey':_0x4773('0x155')});db[_0x4773('0x3a')]['belongsToMany'](db['User'],{'as':_0x4773('0x156'),'through':_0x4773('0x13a')});db[_0x4773('0x3c')]['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':'UserMailQueue'});db[_0x4773('0x3c')][_0x4773('0x11c')](db[_0x4773('0xeb')],{'through':_0x4773('0x16b'),'as':'Teams'});db[_0x4773('0x40')][_0x4773('0x112')](db[_0x4773('0x166')],{'as':_0x4773('0x167'),'onDelete':_0x4773('0x110'),'foreignKey':'MailInteractionId'});db[_0x4773('0x40')][_0x4773('0x150')](db[_0x4773('0x3a')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x160')});db['MailInteraction']['belongsTo'](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':'ContactId'});db[_0x4773('0x40')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db['MailInteraction'][_0x4773('0x11c')](db[_0x4773('0x93')],{'through':'mail_interaction_has_tags','as':_0x4773('0x16e')});db[_0x4773('0x40')][_0x4773('0x11c')](db[_0x4773('0x93')],{'through':'mail_interaction_has_tags','as':_0x4773('0x16f')});db[_0x4773('0x40')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':'Users','through':_0x4773('0x124'),'foreignKey':_0x4773('0x170')});db['MailMessage']['hasMany'](db[_0x4773('0xf1')],{'as':_0x4773('0x171'),'onDelete':_0x4773('0x110')});db[_0x4773('0x166')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x14')});db['MailMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x15e')});db[_0x4773('0x166')]['belongsTo'](db[_0x4773('0x40')],{'as':_0x4773('0x172'),'foreignKey':_0x4773('0x170')});db['MailMessage'][_0x4773('0x150')](db['MailAccount'],{'as':'Account','foreignKey':_0x4773('0x160')});db[_0x4773('0x166')]['belongsTo'](db[_0x4773('0x173')],{'as':_0x4773('0x173'),'foreignKey':_0x4773('0x174')});db[_0x4773('0x166')][_0x4773('0x150')](db[_0x4773('0x6a')],{'as':_0x4773('0x6a'),'foreignKey':_0x4773('0x175')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':_0x4773('0x176')});db[_0x4773('0x43')][_0x4773('0x150')](db[_0x4773('0x3c')],{'onDelete':'restrict'});db['MailApplication'][_0x4773('0x150')](db[_0x4773('0x3a')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x43')][_0x4773('0x150')](db[_0x4773('0x88')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x153')});db[_0x4773('0x43')]['belongsTo'](db[_0x4773('0x93')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x177')});db['MailQueueReport']['belongsTo'](db[_0x4773('0x3a')],{});db[_0x4773('0x178')]['belongsTo'](db[_0x4773('0xf9')],{'as':'List','foreignKey':_0x4773('0x169')});db['MailQueueReport'][_0x4773('0x150')](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db['MailQueueReport'][_0x4773('0x150')](db['MailInteraction'],{});db[_0x4773('0x178')][_0x4773('0x150')](db[_0x4773('0x166')],{});db[_0x4773('0x178')]['belongsTo'](db[_0x4773('0x14')],{});db[_0x4773('0x178')][_0x4773('0x150')](db[_0x4773('0x3c')],{});db[_0x4773('0x44')][_0x4773('0x112')](db[_0x4773('0x46')],{'as':_0x4773('0x179'),'onDelete':_0x4773('0x110')});db[_0x4773('0x48')][_0x4773('0x112')](db[_0x4773('0x84')],{'as':_0x4773('0x164'),'foreignKey':_0x4773('0x17a'),'onDelete':_0x4773('0x110')});db['FaxAccount'][_0x4773('0x112')](db['CannedAnswer'],{'as':_0x4773('0x165'),'foreignKey':'FaxAccountId'});db[_0x4773('0x48')][_0x4773('0x112')](db[_0x4773('0x4a')],{'as':_0x4773('0x168')});db['FaxAccount'][_0x4773('0x112')](db[_0x4773('0x17b')],{'as':'Applications'});db[_0x4773('0x48')][_0x4773('0x112')](db[_0x4773('0x18')],{'as':_0x4773('0x17c'),'onDelete':_0x4773('0x110')});db[_0x4773('0x48')]['hasMany'](db[_0x4773('0x4b')],{'as':_0x4773('0x167')});db[_0x4773('0x48')][_0x4773('0x150')](db[_0x4773('0x151')],{'as':_0x4773('0x151')});db[_0x4773('0x48')]['belongsTo'](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':_0x4773('0x169')});db[_0x4773('0x48')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x4773('0x48')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x17b')][_0x4773('0x150')](db[_0x4773('0x4d')],{'onDelete':'restrict'});db[_0x4773('0x17b')][_0x4773('0x150')](db[_0x4773('0x48')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x17b')][_0x4773('0x150')](db[_0x4773('0x93')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x177')});db[_0x4773('0x4a')]['hasMany'](db[_0x4773('0x4b')],{'as':'Messages','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x17e')});db[_0x4773('0x4a')][_0x4773('0x150')](db[_0x4773('0x48')],{'as':_0x4773('0x16c'),'foreignKey':'FaxAccountId'});db[_0x4773('0x4a')][_0x4773('0x150')](db[_0x4773('0x73')],{'as':'Contact','foreignKey':'ContactId'});db['FaxInteraction'][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x4a')]['belongsToMany'](db[_0x4773('0x93')],{'through':'fax_interaction_has_tags','as':_0x4773('0x16e')});db[_0x4773('0x4a')]['belongsToMany'](db['Tag'],{'through':_0x4773('0x17f'),'as':_0x4773('0x16f')});db['FaxInteraction'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x180'),'through':_0x4773('0x126'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x14')});db[_0x4773('0x4b')][_0x4773('0x150')](db[_0x4773('0x4a')],{'as':'Interaction','foreignKey':_0x4773('0x17e')});db[_0x4773('0x4b')]['belongsTo'](db[_0x4773('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0x4773('0x4b')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0x4773('0x181')});db[_0x4773('0x4b')]['belongsTo'](db[_0x4773('0x48')],{'as':_0x4773('0x16c'),'foreignKey':'FaxAccountId'});db[_0x4773('0x4d')]['belongsToMany'](db['User'],{'as':_0x4773('0x156'),'through':_0x4773('0x30')});db[_0x4773('0x4d')][_0x4773('0x11c')](db[_0x4773('0xeb')],{'through':_0x4773('0x182'),'as':_0x4773('0x183')});db[_0x4773('0x4f')][_0x4773('0x150')](db[_0x4773('0x48')],{});db[_0x4773('0x4f')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0x4773('0x4f')]['belongsTo'](db['CmContact'],{'as':_0x4773('0x15e'),'foreignKey':'ContactId'});db[_0x4773('0x4f')][_0x4773('0x150')](db[_0x4773('0x4a')],{});db[_0x4773('0x4f')]['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0x4773('0x150')](db[_0x4773('0x14')],{});db['FaxQueueReport'][_0x4773('0x150')](db[_0x4773('0x4d')],{});db[_0x4773('0x51')][_0x4773('0x112')](db[_0x4773('0x84')],{'as':'Dispositions','foreignKey':_0x4773('0x184'),'onDelete':_0x4773('0x110')});db['SmsAccount'][_0x4773('0x112')](db[_0x4773('0x83')],{'as':_0x4773('0x165'),'foreignKey':_0x4773('0x184')});db[_0x4773('0x51')]['hasMany'](db[_0x4773('0x55')],{'as':_0x4773('0x167'),'foreignKey':'SmsAccountId'});db[_0x4773('0x51')][_0x4773('0x112')](db[_0x4773('0x53')],{'as':_0x4773('0x168')});db[_0x4773('0x51')][_0x4773('0x112')](db[_0x4773('0x185')],{'as':_0x4773('0x146')});db[_0x4773('0x51')]['belongsTo'](db['CmList'],{'as':_0x4773('0x17d'),'foreignKey':_0x4773('0x169')});db[_0x4773('0x51')]['belongsTo'](db[_0x4773('0x8a')],{'as':_0x4773('0x154'),'foreignKey':_0x4773('0x155')});db['SmsAccount'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x13d')});db['SmsApplication'][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':_0x4773('0x176')});db['SmsApplication']['belongsTo'](db[_0x4773('0x57')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x185')][_0x4773('0x150')](db['SmsAccount'],{'onDelete':_0x4773('0x176')});db[_0x4773('0x185')][_0x4773('0x150')](db['Interval'],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x153')});db[_0x4773('0x185')][_0x4773('0x150')](db[_0x4773('0x93')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x177')});db[_0x4773('0x53')]['hasMany'](db[_0x4773('0x55')],{'as':_0x4773('0x167'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x186')});db[_0x4773('0x53')]['belongsTo'](db[_0x4773('0x51')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x184')});db['SmsInteraction']['belongsTo'](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x53')]['belongsTo'](db[_0x4773('0x14')],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db['SmsInteraction']['belongsToMany'](db[_0x4773('0x93')],{'through':_0x4773('0x187'),'as':_0x4773('0x16e')});db[_0x4773('0x53')][_0x4773('0x11c')](db[_0x4773('0x93')],{'through':'sms_interaction_has_tags','as':_0x4773('0x16f')});db['SmsInteraction'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x180'),'through':_0x4773('0x127'),'foreignKey':_0x4773('0x186')});db['SmsMessage']['belongsTo'](db[_0x4773('0x14')],{'as':_0x4773('0x14')});db[_0x4773('0x55')]['belongsTo'](db[_0x4773('0x73')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x15e')});db[_0x4773('0x55')]['belongsTo'](db['SmsInteraction'],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x172'),'foreignKey':_0x4773('0x186')});db['SmsMessage'][_0x4773('0x150')](db[_0x4773('0x51')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x184')});db[_0x4773('0x57')]['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':'UserSmsQueue','foreignKey':_0x4773('0x188')});db[_0x4773('0x57')][_0x4773('0x11c')](db[_0x4773('0xeb')],{'through':_0x4773('0x189'),'as':_0x4773('0x183')});db[_0x4773('0x59')]['hasMany'](db[_0x4773('0x84')],{'as':_0x4773('0x164'),'foreignKey':_0x4773('0x18a'),'onDelete':_0x4773('0x110')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0x4773('0x165'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x4773('0x112')](db[_0x4773('0x5d')],{'as':'Interactions','foreignKey':_0x4773('0x18a')});db[_0x4773('0x59')][_0x4773('0x112')](db['OpenchannelMessage'],{'as':_0x4773('0x167'),'foreignKey':_0x4773('0x18a')});db[_0x4773('0x59')]['hasMany'](db[_0x4773('0x5b')],{'as':'Applications','foreignKey':_0x4773('0x18a')});db[_0x4773('0x59')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':'ListId'});db[_0x4773('0x59')][_0x4773('0x150')](db[_0x4773('0x8a')],{'as':_0x4773('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4773('0x59')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x13b')});db[_0x4773('0x5b')]['belongsTo'](db[_0x4773('0x14')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x5b')]['belongsTo'](db[_0x4773('0x60')],{'onDelete':'restrict','foreignKey':_0x4773('0x18b')});db[_0x4773('0x5b')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x18a')});db['OpenchannelApplication'][_0x4773('0x150')](db[_0x4773('0x88')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x153')});db['OpenchannelApplication'][_0x4773('0x150')](db['Tag'],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x177')});db['OpenchannelInteraction'][_0x4773('0x112')](db[_0x4773('0x5f')],{'as':'Messages','onDelete':_0x4773('0x110'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x18a')});db[_0x4773('0x5d')]['belongsTo'](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x5d')][_0x4773('0x150')](db['User'],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db['OpenchannelInteraction'][_0x4773('0x11c')](db[_0x4773('0x93')],{'through':_0x4773('0x18c'),'as':_0x4773('0x16e')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':_0x4773('0x18c'),'as':'ThroughTags'});db[_0x4773('0x5d')][_0x4773('0x11c')](db['User'],{'as':_0x4773('0x180'),'through':_0x4773('0x18d'),'foreignKey':_0x4773('0x18e')});db[_0x4773('0x5f')][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x14')});db['OpenchannelMessage'][_0x4773('0x150')](db[_0x4773('0x73')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x15e')});db[_0x4773('0x5f')]['belongsTo'](db[_0x4773('0x5d')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x172'),'foreignKey':_0x4773('0x18e')});db[_0x4773('0x5f')][_0x4773('0x150')](db[_0x4773('0xf1')],{'as':_0x4773('0xf1'),'foreignKey':_0x4773('0x181')});db['OpenchannelMessage'][_0x4773('0x150')](db['OpenchannelAccount'],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x18a')});db[_0x4773('0x60')]['belongsToMany'](db[_0x4773('0x14')],{'as':'Agents','through':_0x4773('0x131'),'foreignKey':_0x4773('0x18b')});db['OpenchannelQueue'][_0x4773('0x11c')](db[_0x4773('0xeb')],{'through':'team_has_openchannel_queues','as':_0x4773('0x183')});db[_0x4773('0x173')][_0x4773('0x112')](db[_0x4773('0x84')],{'as':_0x4773('0x164'),'foreignKey':_0x4773('0x174'),'onDelete':'cascade'});db[_0x4773('0x173')]['hasMany'](db['CannedAnswer'],{'as':_0x4773('0x165'),'foreignKey':_0x4773('0x174')});db[_0x4773('0x173')][_0x4773('0x112')](db[_0x4773('0x6f')],{'as':_0x4773('0x18f')});db[_0x4773('0x173')][_0x4773('0x112')](db[_0x4773('0x67')],{'as':'Interactions'});db[_0x4773('0x173')][_0x4773('0x112')](db[_0x4773('0x65')],{'as':'Applications'});db[_0x4773('0x173')][_0x4773('0x112')](db[_0x4773('0x190')],{'as':_0x4773('0x167')});db[_0x4773('0x173')]['belongsTo'](db[_0x4773('0xf9')],{'as':'List','foreignKey':'ListId'});db['ChatWebsite'][_0x4773('0x150')](db[_0x4773('0x88')],{'as':_0x4773('0x88'),'foreignKey':_0x4773('0x153')});db[_0x4773('0x173')][_0x4773('0x150')](db[_0x4773('0x3a')],{'as':_0x4773('0x3a'),'foreignKey':'MailAccountId'});db[_0x4773('0x173')][_0x4773('0x150')](db['Pause'],{'as':_0x4773('0x154'),'foreignKey':_0x4773('0x155')});db[_0x4773('0x173')]['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x136')});db[_0x4773('0x63')][_0x4773('0x150')](db[_0x4773('0x59')],{});db[_0x4773('0x63')][_0x4773('0x150')](db['CmList'],{'as':'List','foreignKey':_0x4773('0x169')});db[_0x4773('0x63')]['belongsTo'](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x63')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x4773('0x63')][_0x4773('0x150')](db[_0x4773('0x5f')],{});db[_0x4773('0x63')]['belongsTo'](db[_0x4773('0x14')],{});db[_0x4773('0x63')]['belongsTo'](db[_0x4773('0x60')],{});db[_0x4773('0x65')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x191'),'foreignKey':_0x4773('0x111'),'onDelete':_0x4773('0x176')});db['ChatApplication']['belongsTo'](db['ChatQueue'],{'as':_0x4773('0x192'),'foreignKey':_0x4773('0x193'),'onDelete':_0x4773('0x176')});db[_0x4773('0x65')]['belongsTo'](db[_0x4773('0x173')],{'as':_0x4773('0x194'),'foreignKey':_0x4773('0x174'),'onDelete':'restrict'});db['ChatApplication'][_0x4773('0x150')](db[_0x4773('0x93')],{'onDelete':'restrict','foreignKey':_0x4773('0x177')});db[_0x4773('0x67')][_0x4773('0x112')](db[_0x4773('0x190')],{'as':_0x4773('0x167'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x195')});db['ChatInteraction'][_0x4773('0x150')](db[_0x4773('0x173')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x174')});db[_0x4773('0x67')][_0x4773('0x150')](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x67')][_0x4773('0x150')](db['User'],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x67')][_0x4773('0x11c')](db[_0x4773('0x93')],{'through':_0x4773('0x196'),'as':_0x4773('0x16e')});db[_0x4773('0x67')]['belongsToMany'](db['Tag'],{'through':_0x4773('0x196'),'as':_0x4773('0x16f')});db[_0x4773('0x67')]['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x180'),'through':_0x4773('0x197'),'foreignKey':'ChatInteractionId'});db[_0x4773('0x190')]['belongsTo'](db['User'],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x14')});db[_0x4773('0x190')][_0x4773('0x150')](db['CmContact'],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db['ChatMessage']['belongsTo'](db[_0x4773('0x67')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x172'),'foreignKey':'ChatInteractionId'});db[_0x4773('0x190')][_0x4773('0x150')](db['Attachment'],{'as':_0x4773('0xf1'),'foreignKey':_0x4773('0x181')});db['ChatMessage'][_0x4773('0x150')](db[_0x4773('0x173')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x4773('0x6a')][_0x4773('0x112')](db['Attachment'],{'as':_0x4773('0x171'),'foreignKey':_0x4773('0x175'),'onDelete':'cascade','hooks':!![]});db[_0x4773('0x6a')][_0x4773('0x150')](db[_0x4773('0x73')],{'onDelete':_0x4773('0x110'),'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x6a')][_0x4773('0x150')](db[_0x4773('0x173')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x174')});db['ChatQueue'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':'UserChatQueue','hooks':!![]});db[_0x4773('0x6c')]['belongsToMany'](db[_0x4773('0xeb')],{'through':_0x4773('0x198'),'as':_0x4773('0x183')});db['ChatGroup']['hasMany'](db[_0x4773('0x199')],{'as':_0x4773('0x167'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x4773('0x6d')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':'Members','through':_0x4773('0x11e')});db[_0x4773('0x6f')]['belongsTo'](db[_0x4773('0x173')],{'as':'Website','foreignKey':_0x4773('0x174')});db['CmCompany'][_0x4773('0x112')](db[_0x4773('0x73')],{'as':_0x4773('0x11f'),'foreignKey':_0x4773('0x19a')});db[_0x4773('0x73')][_0x4773('0x112')](db['CmHopper'],{'as':_0x4773('0x14b'),'foreignKey':'ContactId'});db[_0x4773('0x73')][_0x4773('0x112')](db[_0x4773('0x79')],{'as':_0x4773('0x14c'),'foreignKey':'ContactId'});db[_0x4773('0x73')]['hasMany'](db[_0x4773('0x7b')],{'as':_0x4773('0x19b'),'foreignKey':'ContactId'});db['CmContact'][_0x4773('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x4773('0x15f')});db['CmContact'][_0x4773('0x112')](db[_0x4773('0x14e')],{'as':_0x4773('0x14f'),'foreignKey':_0x4773('0x15f')});db[_0x4773('0x73')][_0x4773('0x112')](db[_0x4773('0x5d')],{'as':_0x4773('0x128'),'foreignKey':_0x4773('0x15f'),'onDelete':_0x4773('0x176')});db[_0x4773('0x73')][_0x4773('0x112')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x4773('0x176')});db[_0x4773('0x73')][_0x4773('0x112')](db[_0x4773('0x53')],{'as':_0x4773('0x116'),'foreignKey':_0x4773('0x15f'),'onDelete':_0x4773('0x176')});db['CmContact'][_0x4773('0x112')](db[_0x4773('0x4a')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x4773('0x112')](db[_0x4773('0x40')],{'as':_0x4773('0x123'),'foreignKey':_0x4773('0x15f'),'onDelete':_0x4773('0x176')});db['CmContact'][_0x4773('0x150')](db[_0x4773('0x71')],{'as':_0x4773('0x19c'),'foreignKey':_0x4773('0x19a')});db['CmContact'][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':'List','foreignKey':_0x4773('0x169'),'onDelete':'cascade'});db[_0x4773('0x73')][_0x4773('0x11c')](db['User'],{'as':_0x4773('0x180'),'through':_0x4773('0x120')});db[_0x4773('0x73')][_0x4773('0x11c')](db['Tag'],{'as':'Tags','through':_0x4773('0x19d')});db[_0x4773('0x73')][_0x4773('0x11c')](db['Tag'],{'through':_0x4773('0x19d'),'as':_0x4773('0x16f')});db['CmHopper']['belongsTo'](db[_0x4773('0x73')],{'as':'Contact','foreignKey':_0x4773('0x15f'),'onDelete':_0x4773('0x110')});db[_0x4773('0x75')]['belongsTo'](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':'ListId','onDelete':_0x4773('0x110')});db['CmHopper']['belongsTo'](db[_0x4773('0x14')],{'as':_0x4773('0x191'),'foreignKey':_0x4773('0x111')});db[_0x4773('0x75')][_0x4773('0x150')](db[_0x4773('0x1b')],{'as':_0x4773('0x192'),'foreignKey':_0x4773('0x14a'),'onDelete':_0x4773('0x110')});db['CmHopper'][_0x4773('0x150')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x4773('0x75')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':'Owner','foreignKey':_0x4773('0x19e')});db[_0x4773('0x77')][_0x4773('0x150')](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':_0x4773('0x15f'),'onDelete':'cascade'});db[_0x4773('0x77')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':_0x4773('0x169'),'onDelete':'cascade'});db[_0x4773('0x77')][_0x4773('0x150')](db[_0x4773('0x1b')],{'as':_0x4773('0x192'),'foreignKey':_0x4773('0x14a'),'onDelete':'cascade'});db[_0x4773('0x77')][_0x4773('0x150')](db[_0x4773('0xef')],{'as':_0x4773('0xef'),'foreignKey':_0x4773('0x19f'),'onDelete':_0x4773('0x110')});db[_0x4773('0x1a0')][_0x4773('0x112')](db['Condition'],{'as':{'plural':_0x4773('0x1a1'),'singular':_0x4773('0x1a2')},'foreignKey':_0x4773('0x1a3'),'onDelete':_0x4773('0x110'),'hooks':!![]});db[_0x4773('0x1a0')][_0x4773('0x112')](db[_0x4773('0x86')],{'as':{'plural':_0x4773('0x1a4'),'singular':_0x4773('0x1a5')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation'][_0x4773('0x112')](db['Action'],{'as':_0x4773('0x1a6'),'foreignKey':'AutomationId','onDelete':_0x4773('0x110'),'hooks':!![]});db[_0x4773('0x84')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4773('0x1a7'),'onDelete':_0x4773('0x110')});db[_0x4773('0x88')][_0x4773('0x112')](db[_0x4773('0x88')],{'as':_0x4773('0x1a8'),'foreignKey':'IntervalId','onDelete':_0x4773('0x110'),'hooks':!![],'required':![]});db[_0x4773('0x88')][_0x4773('0x112')](db[_0x4773('0x18')],{'as':_0x4773('0x1a9'),'foreignKey':_0x4773('0x153'),'onDelete':_0x4773('0x176')});db[_0x4773('0x88')][_0x4773('0x112')](db[_0x4773('0x43')],{'as':_0x4773('0x1aa'),'foreignKey':_0x4773('0x153')});db['Interval'][_0x4773('0x112')](db[_0x4773('0x65')],{'as':_0x4773('0x1ab'),'foreignKey':'IntervalId'});db[_0x4773('0x88')][_0x4773('0x112')](db[_0x4773('0x17b')],{'as':_0x4773('0x1ac'),'foreignKey':'IntervalId'});db['Interval'][_0x4773('0x112')](db[_0x4773('0x185')],{'as':_0x4773('0x1ad'),'foreignKey':_0x4773('0x153')});db[_0x4773('0x90')][_0x4773('0x150')](db[_0x4773('0x3a')],{});db['Schedule'][_0x4773('0x150')](db[_0x4773('0x9e')],{'foreignKey':_0x4773('0x1ae')});db[_0x4773('0x90')][_0x4773('0x150')](db[_0x4773('0x9c')],{'foreignKey':_0x4773('0x1af')});db[_0x4773('0x92')][_0x4773('0x11c')](db[_0x4773('0x19')],{'as':_0x4773('0x1b0'),'through':_0x4773('0x148'),'onDelete':_0x4773('0x176')});db[_0x4773('0x93')]['belongsToMany'](db[_0x4773('0x73')],{'through':'cm_contact_has_tags'});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x67')],{'through':'chat_interaction_has_tags'});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x40')],{'through':_0x4773('0x1b1')});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x53')],{'through':'sms_interaction_has_tags'});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x4a')],{'through':'fax_interaction_has_tags'});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x5d')],{'through':_0x4773('0x18c')});db[_0x4773('0x93')][_0x4773('0x11c')](db[_0x4773('0x107')],{'through':_0x4773('0x1b2')});db[_0x4773('0x1b3')][_0x4773('0x112')](db[_0x4773('0x86')],{'as':{'plural':_0x4773('0x1b4'),'singular':'AllCondition'},'foreignKey':_0x4773('0x1b5'),'onDelete':_0x4773('0x110'),'hooks':!![]});db[_0x4773('0x1b3')]['hasMany'](db[_0x4773('0x86')],{'as':{'plural':'AnyConditions','singular':_0x4773('0x1b6')},'foreignKey':_0x4773('0x1b7'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db[_0x4773('0x80')],{'as':_0x4773('0x1a6'),'foreignKey':_0x4773('0x1b8'),'onDelete':_0x4773('0x110'),'hooks':!![]});db[_0x4773('0x9c')][_0x4773('0x112')](db['AnalyticFieldReport'],{'as':_0x4773('0x1b9'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1af'),'hooks':!![]});db[_0x4773('0x9e')][_0x4773('0x112')](db[_0x4773('0xa3')],{'as':'Fields','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1ae')});db[_0x4773('0xa1')][_0x4773('0x112')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4773('0x1ba')});db['AnalyticFieldReport'][_0x4773('0x150')](db[_0x4773('0xa1')],{'foreignKey':_0x4773('0x1ba')});db[_0x4773('0xa6')][_0x4773('0x112')](db['SalesforceConfiguration'],{'as':_0x4773('0x1bb'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xa8')][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':_0x4773('0x1be'),'onDelete':'cascade','foreignKey':_0x4773('0x1bf')});db[_0x4773('0xa8')][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':_0x4773('0x1c0'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xa8')][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':'Fields','onDelete':_0x4773('0x110'),'foreignKey':'FieldId'});db[_0x4773('0xa8')][_0x4773('0x150')](db[_0x4773('0xa6')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x1bc')});db['SalesforceField'][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0x1bd')][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0x1bd')][_0x4773('0x112')](db[_0x4773('0x1bd')],{'as':'Field','foreignKey':_0x4773('0x1c4')});db[_0x4773('0x1bd')][_0x4773('0x150')](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':_0x4773('0x1c5')});db[_0x4773('0xaa')][_0x4773('0x112')](db[_0x4773('0x1c6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4773('0x1bc')});db[_0x4773('0x1c6')]['hasMany'](db[_0x4773('0xac')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4773('0x1c6')]['hasMany'](db[_0x4773('0xac')],{'as':_0x4773('0x1c0'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0x1c6')][_0x4773('0x112')](db[_0x4773('0xac')],{'as':_0x4773('0x1b9'),'onDelete':'cascade','foreignKey':_0x4773('0x1c4')});db[_0x4773('0x1c6')][_0x4773('0x150')](db['SugarcrmAccount'],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xac')][_0x4773('0x112')](db[_0x4773('0xac')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db['SugarcrmField'][_0x4773('0x112')](db[_0x4773('0xac')],{'as':'Description','foreignKey':_0x4773('0x1c1')});db['SugarcrmField']['hasMany'](db[_0x4773('0xac')],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xac')][_0x4773('0x150')](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':_0x4773('0x1c5')});db['DeskAccount'][_0x4773('0x112')](db[_0x4773('0x1c8')],{'as':_0x4773('0x1bb'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0x1c8')][_0x4773('0x112')](db[_0x4773('0xaf')],{'as':_0x4773('0x1be'),'onDelete':_0x4773('0x110'),'foreignKey':'SubjectId'});db[_0x4773('0x1c8')][_0x4773('0x112')](db[_0x4773('0xaf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x4773('0x1c1')});db[_0x4773('0x1c8')][_0x4773('0x112')](db['DeskField'],{'as':_0x4773('0x1b9'),'onDelete':_0x4773('0x110'),'foreignKey':'FieldId'});db['DeskConfiguration']['belongsTo'](db[_0x4773('0x1c9')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0x1c8')]['belongsToMany'](db[_0x4773('0x93')],{'through':_0x4773('0x1ca')});db[_0x4773('0xaf')][_0x4773('0x112')](db[_0x4773('0xaf')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xaf')]['hasMany'](db[_0x4773('0xaf')],{'as':_0x4773('0x1c3'),'foreignKey':'DescriptionId'});db[_0x4773('0xaf')][_0x4773('0x112')](db['DeskField'],{'as':_0x4773('0x1c7'),'foreignKey':'FieldId'});db[_0x4773('0xaf')][_0x4773('0x150')](db['Variable'],{'as':_0x4773('0x97'),'foreignKey':'VariableId'});db[_0x4773('0xb1')][_0x4773('0x112')](db[_0x4773('0xb3')],{'as':_0x4773('0x1bb'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xb3')]['hasMany'](db['ZohoField'],{'as':_0x4773('0x1be'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bf')});db['ZohoConfiguration'][_0x4773('0x112')](db['ZohoField'],{'as':_0x4773('0x1c0'),'onDelete':'cascade','foreignKey':_0x4773('0x1c1')});db[_0x4773('0xb3')][_0x4773('0x112')](db[_0x4773('0x1cb')],{'as':_0x4773('0x1b9'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xb3')]['belongsTo'](db[_0x4773('0xb1')],{'as':'Account','foreignKey':_0x4773('0x1bc')});db[_0x4773('0x1cb')]['hasMany'](db[_0x4773('0x1cb')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0x1cb')][_0x4773('0x112')](db[_0x4773('0x1cb')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0x1cb')][_0x4773('0x112')](db[_0x4773('0x1cb')],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0x1cb')][_0x4773('0x150')](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':_0x4773('0x1c5')});db['ZendeskAccount'][_0x4773('0x112')](db[_0x4773('0xb6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x4773('0x112')](db['ZendeskField'],{'as':_0x4773('0x1be'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xb6')][_0x4773('0x112')](db[_0x4773('0xb7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x4773('0x112')](db['ZendeskField'],{'as':_0x4773('0x1b9'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xb6')][_0x4773('0x150')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x4773('0x1bc')});db[_0x4773('0xb6')]['belongsToMany'](db[_0x4773('0x93')],{'through':_0x4773('0x1cc')});db[_0x4773('0xb7')][_0x4773('0x112')](db[_0x4773('0xb7')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xb7')][_0x4773('0x112')](db[_0x4773('0xb7')],{'as':_0x4773('0x1c3'),'foreignKey':'DescriptionId'});db[_0x4773('0xb7')][_0x4773('0x112')](db[_0x4773('0xb7')],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xb7')]['belongsTo'](db[_0x4773('0x97')],{'as':'Variable','foreignKey':_0x4773('0x1c5')});db['FreshdeskAccount'][_0x4773('0x112')](db[_0x4773('0xbb')],{'as':_0x4773('0x1bb'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xbb')]['hasMany'](db[_0x4773('0xbc')],{'as':_0x4773('0x1be'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xbb')]['hasMany'](db[_0x4773('0xbc')],{'as':'Descriptions','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xbb')][_0x4773('0x112')](db[_0x4773('0xbc')],{'as':_0x4773('0x1b9'),'onDelete':_0x4773('0x110'),'foreignKey':'FieldId'});db[_0x4773('0xbb')][_0x4773('0x150')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x4773('0x1bc')});db[_0x4773('0xbb')]['belongsToMany'](db[_0x4773('0x93')],{'through':_0x4773('0x1cd')});db['FreshdeskField'][_0x4773('0x112')](db[_0x4773('0xbc')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db['FreshdeskField'][_0x4773('0x112')](db[_0x4773('0xbc')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xbc')]['hasMany'](db[_0x4773('0xbc')],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xbc')][_0x4773('0x150')](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':'VariableId'});db[_0x4773('0xbd')]['hasMany'](db[_0x4773('0xbe')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4773('0x1bc')});db[_0x4773('0xbe')][_0x4773('0x112')](db[_0x4773('0xc0')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x4773('0xbe')][_0x4773('0x112')](db[_0x4773('0xc0')],{'as':'Descriptions','foreignKey':_0x4773('0x1c1')});db['VtigerConfiguration'][_0x4773('0x112')](db['VtigerField'],{'as':'Fields','foreignKey':_0x4773('0x1c4')});db[_0x4773('0xbe')][_0x4773('0x150')](db[_0x4773('0xbd')],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xc0')][_0x4773('0x112')](db[_0x4773('0xc0')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xc0')][_0x4773('0x112')](db[_0x4773('0xc0')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xc0')][_0x4773('0x112')](db[_0x4773('0xc0')],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xc0')]['belongsTo'](db[_0x4773('0x97')],{'as':'Variable','foreignKey':_0x4773('0x1c5')});db['ServicenowAccount']['hasMany'](db[_0x4773('0xc3')],{'as':_0x4773('0x1bb'),'onDelete':'cascade','foreignKey':_0x4773('0x1bc')});db['ServicenowConfiguration']['hasMany'](db['ServicenowField'],{'as':_0x4773('0x1be'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xc3')][_0x4773('0x112')](db[_0x4773('0xc5')],{'as':_0x4773('0x1c0'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x4773('0xc5')],{'as':_0x4773('0x1b9'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0x4773('0x1ce')],{'as':_0x4773('0x16c'),'foreignKey':'AccountId'});db[_0x4773('0xc5')]['hasMany'](db[_0x4773('0xc5')],{'as':_0x4773('0x1c2'),'foreignKey':'SubjectId'});db[_0x4773('0xc5')][_0x4773('0x112')](db[_0x4773('0xc5')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xc5')][_0x4773('0x112')](db[_0x4773('0xc5')],{'as':_0x4773('0x1c7'),'foreignKey':'FieldId'});db[_0x4773('0xc5')]['belongsTo'](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':_0x4773('0x1c5')});db[_0x4773('0xc7')][_0x4773('0x112')](db[_0x4773('0xc9')],{'as':_0x4773('0x1bb'),'onDelete':'cascade','foreignKey':_0x4773('0x1bc')});db[_0x4773('0xc9')][_0x4773('0x112')](db[_0x4773('0xcb')],{'as':'Subjects','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xc9')][_0x4773('0x112')](db[_0x4773('0xcb')],{'as':'Descriptions','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xc9')][_0x4773('0x112')](db['Dynamics365Field'],{'as':_0x4773('0x1b9'),'onDelete':'cascade','foreignKey':_0x4773('0x1c4')});db[_0x4773('0xc9')][_0x4773('0x150')](db[_0x4773('0xc7')],{'as':'Account','foreignKey':_0x4773('0x1bc')});db['Dynamics365Field'][_0x4773('0x112')](db[_0x4773('0xcb')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xcb')][_0x4773('0x112')](db[_0x4773('0xcb')],{'as':'Description','foreignKey':_0x4773('0x1c1')});db[_0x4773('0xcb')][_0x4773('0x112')](db['Dynamics365Field'],{'as':_0x4773('0x1c7'),'foreignKey':_0x4773('0x1c4')});db[_0x4773('0xcb')][_0x4773('0x150')](db[_0x4773('0x97')],{'as':_0x4773('0x97'),'foreignKey':'VariableId'});db[_0x4773('0xcd')][_0x4773('0x112')](db[_0x4773('0xcf')],{'as':_0x4773('0x1bb'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1bc')});db[_0x4773('0xcf')][_0x4773('0x112')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x4773('0x1bf')});db[_0x4773('0xcf')][_0x4773('0x112')](db[_0x4773('0xd1')],{'as':_0x4773('0x1c0'),'foreignKey':_0x4773('0x1c1')});db[_0x4773('0xcf')][_0x4773('0x112')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x4773('0x1c4')});db[_0x4773('0xcf')][_0x4773('0x150')](db[_0x4773('0xcd')],{'as':'Account','foreignKey':_0x4773('0x1bc')});db[_0x4773('0xd1')][_0x4773('0x112')](db[_0x4773('0xd1')],{'as':_0x4773('0x1c2'),'foreignKey':_0x4773('0x1bf')});db[_0x4773('0xd1')]['hasMany'](db[_0x4773('0xd1')],{'as':_0x4773('0x1c3'),'foreignKey':_0x4773('0x1c1')});db['FreshsalesField'][_0x4773('0x112')](db[_0x4773('0xd1')],{'as':_0x4773('0x1c7'),'foreignKey':'FieldId'});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0x4773('0x97'),'foreignKey':_0x4773('0x1c5')});db[_0x4773('0x1cf')][_0x4773('0x150')](db['ChatWebsite'],{});db[_0x4773('0x1cf')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':_0x4773('0x169')});db[_0x4773('0x1cf')]['belongsTo'](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':'ContactId'});db[_0x4773('0x1cf')]['belongsTo'](db[_0x4773('0x67')],{});db[_0x4773('0x1cf')][_0x4773('0x150')](db[_0x4773('0x190')],{});db[_0x4773('0x1cf')][_0x4773('0x150')](db['User'],{});db[_0x4773('0x1cf')][_0x4773('0x150')](db[_0x4773('0x6c')],{});db['ChatInternalMessage']['belongsTo'](db[_0x4773('0x14')],{'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1d0')});db[_0x4773('0x199')][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':'cascade','foreignKey':_0x4773('0x1d1')});db['JscriptySessionReport'][_0x4773('0x112')](db[_0x4773('0xda')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x4773('0x14e')][_0x4773('0x112')](db[_0x4773('0xd8')],{'foreignKey':'SessionId','onDelete':_0x4773('0x110')});db[_0x4773('0xdd')]['belongsTo'](db['SmsAccount'],{});db[_0x4773('0xdd')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':'List','foreignKey':_0x4773('0x169')});db['SmsQueueReport'][_0x4773('0x150')](db[_0x4773('0x73')],{'as':_0x4773('0x15e'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0x4773('0x150')](db['SmsInteraction'],{});db[_0x4773('0xdd')]['belongsTo'](db[_0x4773('0x55')],{});db[_0x4773('0xdd')][_0x4773('0x150')](db['User'],{});db[_0x4773('0xdd')][_0x4773('0x150')](db[_0x4773('0x57')],{});db[_0x4773('0xe2')][_0x4773('0x112')](db[_0x4773('0x14e')],{'foreignKey':'ProjectId'});db[_0x4773('0xe2')]['hasMany'](db[_0x4773('0xda')],{'foreignKey':_0x4773('0x1d2')});db[_0x4773('0xe2')]['hasMany'](db[_0x4773('0xd8')],{'foreignKey':_0x4773('0x1d2')});db['SquareProject']['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x180'),'through':'user_has_square_projects'});db[_0x4773('0xeb')][_0x4773('0x11c')](db['User'],{'as':_0x4773('0x156'),'through':_0x4773('0x122')});db['Team'][_0x4773('0x11c')](db[_0x4773('0x1b')],{'through':_0x4773('0x10e'),'as':'VoiceQueues'});db[_0x4773('0xeb')]['belongsToMany'](db[_0x4773('0x3c')],{'through':_0x4773('0x16b'),'as':'MailQueues'});db[_0x4773('0xeb')][_0x4773('0x11c')](db[_0x4773('0x6c')],{'through':_0x4773('0x198'),'as':_0x4773('0x12d')});db['Team'][_0x4773('0x11c')](db[_0x4773('0x4d')],{'through':_0x4773('0x182'),'as':_0x4773('0x1d3')});db['Team']['belongsToMany'](db[_0x4773('0x57')],{'through':_0x4773('0x189'),'as':_0x4773('0x12f')});db[_0x4773('0xeb')][_0x4773('0x11c')](db[_0x4773('0x60')],{'through':_0x4773('0x1d4'),'as':_0x4773('0x130')});db['Team'][_0x4773('0x11c')](db['WhatsappQueue'],{'through':_0x4773('0x1d5'),'as':_0x4773('0x1d6')});db[_0x4773('0xef')][_0x4773('0x112')](db[_0x4773('0x75')],{'as':_0x4773('0x14b'),'foreignKey':_0x4773('0x19f')});db[_0x4773('0xef')][_0x4773('0x112')](db[_0x4773('0x79')],{'as':_0x4773('0x14c'),'foreignKey':_0x4773('0x19f')});db[_0x4773('0xef')][_0x4773('0x112')](db[_0x4773('0x7b')],{'as':_0x4773('0x19b'),'foreignKey':_0x4773('0x19f')});db[_0x4773('0xef')]['hasMany'](db[_0x4773('0x77')],{'as':'HopperBlacks','foreignKey':_0x4773('0x19f')});db[_0x4773('0xef')][_0x4773('0x150')](db[_0x4773('0x151')],{'as':_0x4773('0x151'),'foreignKey':_0x4773('0x1d7')});db[_0x4773('0xef')]['belongsTo'](db[_0x4773('0x151')],{'as':_0x4773('0x1d8'),'foreignKey':_0x4773('0x152')});db[_0x4773('0xef')][_0x4773('0x150')](db[_0x4773('0x88')],{'as':_0x4773('0x88'),'foreignKey':'IntervalId'});db[_0x4773('0xef')][_0x4773('0x150')](db[_0x4773('0xe6')],{'as':_0x4773('0xe6'),'foreignKey':_0x4773('0x1d9')});db[_0x4773('0xef')][_0x4773('0x11c')](db[_0x4773('0xf9')],{'as':_0x4773('0x121'),'through':_0x4773('0x1da')});db[_0x4773('0xef')][_0x4773('0x11c')](db['CmList'],{'as':_0x4773('0x157'),'through':_0x4773('0x1db')});db['Attachment'][_0x4773('0x150')](db[_0x4773('0x6a')],{'as':_0x4773('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0x4773('0xf5')][_0x4773('0x150')](db[_0x4773('0x166')],{});db[_0x4773('0xf5')][_0x4773('0x150')](db[_0x4773('0x40')],{});db[_0x4773('0xf5')][_0x4773('0x150')](db['MailAccount'],{'foreignKey':_0x4773('0x1dc'),'as':_0x4773('0x1dd')});db['MailTransferReport'][_0x4773('0x150')](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1de'),'as':_0x4773('0x1df')});db[_0x4773('0xf5')][_0x4773('0x150')](db['User'],{'foreignKey':_0x4773('0x1e0'),'as':'ToAgent'});db[_0x4773('0xf5')][_0x4773('0x150')](db[_0x4773('0x3c')],{'foreignKey':_0x4773('0x1e1'),'as':_0x4773('0x1e2')});db['MailTransferReport'][_0x4773('0x150')](db[_0x4773('0x3a')],{'foreignKey':_0x4773('0x1e3'),'as':_0x4773('0x1e4')});db[_0x4773('0xf6')]['belongsTo'](db[_0x4773('0x190')],{});db[_0x4773('0xf6')]['belongsTo'](db[_0x4773('0x67')],{});db[_0x4773('0xf6')]['belongsTo'](db[_0x4773('0x173')],{'foreignKey':'FromChatWebsiteId','as':_0x4773('0x1dd')});db['ChatTransferReport'][_0x4773('0x150')](db['User'],{'foreignKey':_0x4773('0x1de'),'as':_0x4773('0x1df')});db['ChatTransferReport'][_0x4773('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x4773('0x1e5')});db[_0x4773('0xf6')]['belongsTo'](db[_0x4773('0x6c')],{'foreignKey':_0x4773('0x1e6'),'as':_0x4773('0x1e2')});db[_0x4773('0xf6')][_0x4773('0x150')](db['ChatWebsite'],{'foreignKey':_0x4773('0x1e7'),'as':_0x4773('0x1e4')});db[_0x4773('0x1e8')][_0x4773('0x150')](db[_0x4773('0x4b')],{});db[_0x4773('0x1e8')][_0x4773('0x150')](db[_0x4773('0x4a')],{});db[_0x4773('0x1e8')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x4773('0x1e9'),'as':_0x4773('0x1dd')});db[_0x4773('0x1e8')][_0x4773('0x150')](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1de'),'as':_0x4773('0x1df')});db[_0x4773('0x1e8')][_0x4773('0x150')](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1e0'),'as':_0x4773('0x1e5')});db[_0x4773('0x1e8')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x4773('0x1e2')});db['FaxTransferReport'][_0x4773('0x150')](db[_0x4773('0x48')],{'foreignKey':'ToFaxAccountId','as':_0x4773('0x1e4')});db[_0x4773('0x1ea')]['belongsTo'](db[_0x4773('0x5f')],{});db[_0x4773('0x1ea')]['belongsTo'](db[_0x4773('0x5d')],{});db[_0x4773('0x1ea')]['belongsTo'](db[_0x4773('0x59')],{'foreignKey':_0x4773('0x1eb'),'as':_0x4773('0x1dd')});db[_0x4773('0x1ea')][_0x4773('0x150')](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1de'),'as':_0x4773('0x1df')});db['OpenchannelTransferReport']['belongsTo'](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1e0'),'as':_0x4773('0x1e5')});db[_0x4773('0x1ea')][_0x4773('0x150')](db[_0x4773('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':_0x4773('0x1e2')});db[_0x4773('0x1ea')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x4773('0x1ec'),'as':'ToAccount'});db[_0x4773('0x1ed')][_0x4773('0x150')](db[_0x4773('0x55')],{});db[_0x4773('0x1ed')][_0x4773('0x150')](db[_0x4773('0x53')],{});db[_0x4773('0x1ed')][_0x4773('0x150')](db[_0x4773('0x51')],{'foreignKey':_0x4773('0x1ee'),'as':_0x4773('0x1dd')});db[_0x4773('0x1ed')][_0x4773('0x150')](db[_0x4773('0x14')],{'foreignKey':'FromUserId','as':_0x4773('0x1df')});db[_0x4773('0x1ed')]['belongsTo'](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1e0'),'as':_0x4773('0x1e5')});db[_0x4773('0x1ed')][_0x4773('0x150')](db[_0x4773('0x57')],{'foreignKey':_0x4773('0x1ef'),'as':_0x4773('0x1e2')});db[_0x4773('0x1ed')]['belongsTo'](db[_0x4773('0x51')],{'foreignKey':_0x4773('0x1f0'),'as':_0x4773('0x1e4')});db['CmList'][_0x4773('0x112')](db[_0x4773('0x84')],{'as':_0x4773('0x164'),'foreignKey':'ListId','onDelete':_0x4773('0x110')});db[_0x4773('0xf9')]['hasMany'](db[_0x4773('0x7e')],{'as':_0x4773('0x1f1'),'foreignKey':_0x4773('0x169')});db['CmList'][_0x4773('0x112')](db[_0x4773('0x73')],{'as':_0x4773('0x11f'),'onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x169')});db[_0x4773('0xf9')]['hasMany'](db[_0x4773('0x79')],{'as':'HopperFinals','foreignKey':_0x4773('0x169')});db[_0x4773('0xf9')][_0x4773('0x112')](db[_0x4773('0x7b')],{'as':_0x4773('0x115'),'foreignKey':_0x4773('0x169')});db[_0x4773('0xf9')][_0x4773('0x112')](db[_0x4773('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x4773('0x169')});db[_0x4773('0xf9')]['belongsToMany'](db[_0x4773('0x1b')],{'as':_0x4773('0x1f2'),'through':_0x4773('0x1f3')});db['CmList']['belongsToMany'](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x133')});db[_0x4773('0xfb')][_0x4773('0x112')](db[_0x4773('0x18')],{'as':_0x4773('0x1a9'),'onDelete':_0x4773('0x110')});db['VoicePrefix'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':_0x4773('0x156'),'through':_0x4773('0x135')});db[_0x4773('0xfd')][_0x4773('0x112')](db['User'],{'as':_0x4773('0x180'),'foreignKey':'userProfileId'});db['UserProfile'][_0x4773('0x112')](db['UserProfileSection'],{'as':_0x4773('0x1f4'),'foreignKey':_0x4773('0x1f5'),'onDelete':_0x4773('0x110')});db[_0x4773('0xff')][_0x4773('0x112')](db[_0x4773('0x101')],{'as':_0x4773('0x1f6'),'foreignKey':'sectionId','onDelete':_0x4773('0x110')});db[_0x4773('0x103')][_0x4773('0x112')](db['Disposition'],{'as':_0x4773('0x164'),'foreignKey':'WhatsappAccountId','onDelete':_0x4773('0x110')});db[_0x4773('0x103')]['hasMany'](db['CannedAnswer'],{'as':_0x4773('0x165'),'foreignKey':_0x4773('0x1f7')});db[_0x4773('0x103')]['hasMany'](db[_0x4773('0x1f8')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0x4773('0x103')]['hasMany'](db[_0x4773('0x107')],{'as':_0x4773('0x168')});db[_0x4773('0x103')][_0x4773('0x112')](db[_0x4773('0x105')],{'as':_0x4773('0x146')});db[_0x4773('0x103')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':_0x4773('0x169')});db['WhatsappAccount'][_0x4773('0x150')](db[_0x4773('0x8a')],{'as':_0x4773('0x154'),'foreignKey':_0x4773('0x155')});db[_0x4773('0x103')][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x4773('0x150')](db[_0x4773('0x14')],{'onDelete':_0x4773('0x176')});db[_0x4773('0x105')]['belongsTo'](db[_0x4773('0x132')],{'onDelete':'restrict'});db[_0x4773('0x105')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x4773('0x176')});db['WhatsappApplication'][_0x4773('0x150')](db[_0x4773('0x88')],{'onDelete':_0x4773('0x176'),'foreignKey':_0x4773('0x153')});db['WhatsappApplication'][_0x4773('0x150')](db[_0x4773('0x93')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4773('0x107')][_0x4773('0x112')](db[_0x4773('0x1f8')],{'as':'Messages','onDelete':_0x4773('0x110'),'foreignKey':_0x4773('0x1f9')});db['WhatsappInteraction'][_0x4773('0x150')](db['WhatsappAccount'],{'as':_0x4773('0x16c'),'foreignKey':_0x4773('0x1f7')});db[_0x4773('0x107')][_0x4773('0x150')](db[_0x4773('0x73')],{'as':'Contact','foreignKey':_0x4773('0x15f')});db[_0x4773('0x107')][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x16d'),'foreignKey':_0x4773('0x111')});db['WhatsappInteraction'][_0x4773('0x11c')](db['Tag'],{'through':_0x4773('0x1b2'),'as':'Tags'});db[_0x4773('0x107')][_0x4773('0x11c')](db['Tag'],{'through':_0x4773('0x1b2'),'as':_0x4773('0x16f')});db[_0x4773('0x107')][_0x4773('0x11c')](db['User'],{'as':_0x4773('0x180'),'through':_0x4773('0x129'),'foreignKey':_0x4773('0x1f9')});db['WhatsappMessage'][_0x4773('0x150')](db[_0x4773('0x14')],{'as':_0x4773('0x14')});db[_0x4773('0x1f8')][_0x4773('0x150')](db[_0x4773('0x73')],{'onDelete':_0x4773('0x110'),'as':'Contact'});db[_0x4773('0x1f8')][_0x4773('0x150')](db[_0x4773('0x107')],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x4773('0x1f8')][_0x4773('0x150')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0x4773('0x1fa')][_0x4773('0x150')](db[_0x4773('0xf9')],{'as':_0x4773('0x17d'),'foreignKey':'ListId'});db[_0x4773('0x1fa')][_0x4773('0x150')](db[_0x4773('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4773('0x1fa')][_0x4773('0x150')](db[_0x4773('0x107')],{});db[_0x4773('0x1fa')][_0x4773('0x150')](db[_0x4773('0x132')],{});db[_0x4773('0x1fa')]['belongsTo'](db[_0x4773('0x1f8')],{});db[_0x4773('0x1fa')][_0x4773('0x150')](db[_0x4773('0x14')],{});db[_0x4773('0x1fb')]['belongsTo'](db[_0x4773('0x1f8')],{});db[_0x4773('0x1fb')][_0x4773('0x150')](db['WhatsappInteraction'],{});db[_0x4773('0x1fb')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x4773('0x1fc'),'as':_0x4773('0x1dd')});db[_0x4773('0x1fb')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x4773('0x1fd'),'as':_0x4773('0x1e4')});db[_0x4773('0x1fb')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x4773('0x1e2')});db[_0x4773('0x1fb')]['belongsTo'](db[_0x4773('0x14')],{'foreignKey':_0x4773('0x1de'),'as':'FromAgent'});db[_0x4773('0x1fb')][_0x4773('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x4773('0x1e5')});db['WhatsappQueue'][_0x4773('0x11c')](db[_0x4773('0x14')],{'as':'Agents','through':_0x4773('0x34'),'foreignKey':_0x4773('0x1fe')});db[_0x4773('0x132')]['belongsToMany'](db[_0x4773('0xeb')],{'through':_0x4773('0x1d5'),'as':'Teams'});module[_0x4773('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 19590bd..85fe6e0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf899=['./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/fields','./api/intFreshsalesField','/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/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','3.0.0','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','password','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','path','express-winston','./errors','./config/environment','./config/logger','api','default','use','logger','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','remoteAddress','url','statusCode','user','role','device','agent_id','responseTime','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf899,0x1e6));var _0x9f89=function(_0x28cfea,_0x1e8ac4){_0x28cfea=_0x28cfea-0x0;var _0xb8bd1=_0xf899[_0x28cfea];return _0xb8bd1;};'use strict';var _=require('lodash');var path=require(_0x9f89('0x0'));var express=require('express');var ewinston=require(_0x9f89('0x1'));var util=require('util');var errors=require(_0x9f89('0x2'));var config=require(_0x9f89('0x3'));var logger=require(_0x9f89('0x4'))(_0x9f89('0x5'));var authLogger=require(_0x9f89('0x4'))('auth');exports[_0x9f89('0x6')]=function(_0x3df839){_0x3df839[_0x9f89('0x7')](ewinston[_0x9f89('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1f28cb,_0x4b4762){var _0x10af05='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9f89('0x9')](_0x1f28cb[_0x9f89('0xa')])){_0x10af05+=_0x9f89('0xb');var _0x2f0d61=_0x1f28cb[_0x9f89('0xa')];maskSensitiveData(_0x2f0d61);}return util[_0x9f89('0xc')](_0x10af05,_0x1f28cb['method'],_0x1f28cb[_0x9f89('0xd')][_0x9f89('0xe')]?_0x1f28cb['headers'][_0x9f89('0xe')]:_0x1f28cb['connection'][_0x9f89('0xf')]||_0x1f28cb['ip'],_0x1f28cb[_0x9f89('0x10')],_0x4b4762[_0x9f89('0x11')],_0x4b4762['responseTime'],_0x1f28cb[_0x9f89('0x12')]?_0x1f28cb[_0x9f89('0x12')]['id']:null,_0x1f28cb[_0x9f89('0x12')]?_0x1f28cb[_0x9f89('0x12')]['name']:null,_0x1f28cb['user']?_0x1f28cb[_0x9f89('0x12')][_0x9f89('0x13')]:null,_0x2f0d61?util['inspect'](_0x2f0d61,![],null):'');}}));_0x3df839[_0x9f89('0x7')](ewinston[_0x9f89('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x143a8f,_0x35931b){var _0x3a65f7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x143a8f[_0x9f89('0xa')]&&_0x143a8f[_0x9f89('0xa')][_0x9f89('0x14')]&&_0x143a8f[_0x9f89('0xa')][_0x9f89('0x15')]){_0x3a65f7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x9f89('0xc')](_0x3a65f7,_0x143a8f['method'],_0x143a8f[_0x9f89('0xd')][_0x9f89('0xe')]?_0x143a8f[_0x9f89('0xd')][_0x9f89('0xe')]:_0x143a8f['connection'][_0x9f89('0xf')]||_0x143a8f['ip'],_0x143a8f[_0x9f89('0x10')],_0x35931b[_0x9f89('0x11')],_0x35931b[_0x9f89('0x16')],_0x143a8f[_0x9f89('0x12')]?_0x143a8f[_0x9f89('0x12')]['id']:null,_0x143a8f[_0x9f89('0x12')]?_0x143a8f[_0x9f89('0x12')]['name']:null,_0x143a8f['user']?_0x143a8f['user'][_0x9f89('0x13')]:null,_0x143a8f[_0x9f89('0xa')]&&_0x143a8f[_0x9f89('0xa')]['device']?_0x143a8f['body'][_0x9f89('0x14')]:_0x9f89('0x17'),_0x143a8f['body']&&_0x143a8f[_0x9f89('0xa')][_0x9f89('0x15')]?_0x143a8f[_0x9f89('0xa')][_0x9f89('0x15')]:'',_0x143a8f['body']&&_0x143a8f['body']['agent_name']?_0x143a8f[_0x9f89('0xa')][_0x9f89('0x18')]:'');},'ignoreRoute':function(_0x19a673){var _0x29c63e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x29c63e[_0x9f89('0x19')](_0x19a673[_0x9f89('0x10')]);}}));_0x3df839[_0x9f89('0x7')](_0x9f89('0x1a'),require(_0x9f89('0x1b')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x1c'),require('./api/voiceChanSpy'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x1d'),require(_0x9f89('0x1e')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x1f'),require(_0x9f89('0x20')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x21'),require(_0x9f89('0x22')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x23'),require('./api/voiceQueue'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x24'),require(_0x9f89('0x25')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x26'),require('./api/screenRecording'));_0x3df839[_0x9f89('0x7')]('/api/voice/mails',require(_0x9f89('0x27')));_0x3df839['use'](_0x9f89('0x28'),require(_0x9f89('0x29')));_0x3df839[_0x9f89('0x7')]('/api/voice/calls/reports',require(_0x9f89('0x2a')));_0x3df839['use'](_0x9f89('0x2b'),require(_0x9f89('0x2c')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x2d'),require(_0x9f89('0x2e')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x2f'),require('./api/voiceQueueReport'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x30'),require(_0x9f89('0x31')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x32'),require(_0x9f89('0x33')));_0x3df839['use'](_0x9f89('0x34'),require(_0x9f89('0x35')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x36'),require(_0x9f89('0x37')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x38'),require(_0x9f89('0x39')));_0x3df839[_0x9f89('0x7')]('/api/mail/queues',require(_0x9f89('0x3a')));_0x3df839['use'](_0x9f89('0x3b'),require(_0x9f89('0x3c')));_0x3df839['use'](_0x9f89('0x3d'),require('./api/mailInteraction'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x3e'),require(_0x9f89('0x3f')));_0x3df839[_0x9f89('0x7')]('/api/mail/applications',require(_0x9f89('0x40')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x41'),require('./api/mailQueueReport'));_0x3df839['use'](_0x9f89('0x42'),require('./api/dashboard'));_0x3df839[_0x9f89('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x3df839['use']('/api/fax/accounts',require(_0x9f89('0x43')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x44'),require('./api/faxApplication'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x45'),require(_0x9f89('0x46')));_0x3df839['use'](_0x9f89('0x47'),require(_0x9f89('0x48')));_0x3df839[_0x9f89('0x7')]('/api/fax/queues',require('./api/faxQueue'));_0x3df839['use'](_0x9f89('0x49'),require(_0x9f89('0x4a')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x4b'),require(_0x9f89('0x4c')));_0x3df839['use'](_0x9f89('0x4d'),require(_0x9f89('0x4e')));_0x3df839['use'](_0x9f89('0x4f'),require(_0x9f89('0x50')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x51'),require(_0x9f89('0x52')));_0x3df839['use'](_0x9f89('0x53'),require(_0x9f89('0x54')));_0x3df839[_0x9f89('0x7')]('/api/openchannel/accounts',require(_0x9f89('0x55')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x56'),require(_0x9f89('0x57')));_0x3df839[_0x9f89('0x7')]('/api/openchannel/interactions',require(_0x9f89('0x58')));_0x3df839['use']('/api/openchannel/messages',require('./api/openchannelMessage'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x59'),require(_0x9f89('0x5a')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x5b'),require(_0x9f89('0x5c')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x5d'),require(_0x9f89('0x5e')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x5f'),require(_0x9f89('0x60')));_0x3df839['use']('/api/chat/interactions',require(_0x9f89('0x61')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x62'),require(_0x9f89('0x63')));_0x3df839['use']('/api/chat/offline_messages',require(_0x9f89('0x64')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x65'),require('./api/chatQueue'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x66'),require('./api/chatGroup'));_0x3df839[_0x9f89('0x7')]('/api/chat/proactive_actions',require(_0x9f89('0x67')));_0x3df839[_0x9f89('0x7')]('/api/cm/companies',require(_0x9f89('0x68')));_0x3df839['use'](_0x9f89('0x69'),require(_0x9f89('0x6a')));_0x3df839[_0x9f89('0x7')]('/api/cm/hopper',require(_0x9f89('0x6b')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x6c'),require(_0x9f89('0x6d')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x6e'),require(_0x9f89('0x6f')));_0x3df839['use']('/api/cm/hopper_history',require(_0x9f89('0x70')));_0x3df839[_0x9f89('0x7')]('/api/cm/custom_fields',require(_0x9f89('0x71')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x72'),require(_0x9f89('0x73')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x74'),require('./api/automation'));_0x3df839[_0x9f89('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x3df839[_0x9f89('0x7')]('/api/dispositions',require('./api/disposition'));_0x3df839['use'](_0x9f89('0x75'),require(_0x9f89('0x76')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x77'),require(_0x9f89('0x78')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x79'),require(_0x9f89('0x7a')));_0x3df839[_0x9f89('0x7')]('/api/cdr',require('./api/cdr'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x7b'),require('./api/voiceQueuesLog'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x7c'),require(_0x9f89('0x7d')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x7e'),require(_0x9f89('0x7f')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x80'),require(_0x9f89('0x81')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x82'),require(_0x9f89('0x83')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x84'),require(_0x9f89('0x85')));_0x3df839[_0x9f89('0x7')]('/api/variables',require(_0x9f89('0x86')));_0x3df839['use'](_0x9f89('0x87'),require('./api/integration'));_0x3df839['use'](_0x9f89('0x88'),require(_0x9f89('0x89')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x8a'),require(_0x9f89('0x8b')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x8c'),require(_0x9f89('0x8d')));_0x3df839[_0x9f89('0x7')]('/api/analytics/extracted_reports',require(_0x9f89('0x8e')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x8f'),require(_0x9f89('0x90')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x91'),require(_0x9f89('0x92')));_0x3df839['use'](_0x9f89('0x93'),require(_0x9f89('0x94')));_0x3df839[_0x9f89('0x7')]('/api/integrations/salesforce/accounts',require(_0x9f89('0x95')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x96'),require('./api/intSalesforceConfiguration'));_0x3df839[_0x9f89('0x7')]('/api/integrations/salesforce/fields',require(_0x9f89('0x97')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x98'),require(_0x9f89('0x99')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x9a'),require(_0x9f89('0x9b')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x9c'),require(_0x9f89('0x9d')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x9e'),require('./api/intDeskAccount'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x9f'),require('./api/intDeskConfiguration'));_0x3df839['use'](_0x9f89('0xa0'),require(_0x9f89('0xa1')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xa2'),require(_0x9f89('0xa3')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xa4'),require(_0x9f89('0xa5')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xa6'),require(_0x9f89('0xa7')));_0x3df839['use'](_0x9f89('0xa8'),require('./api/intZendeskAccount'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xa9'),require(_0x9f89('0xaa')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xab'),require('./api/intZendeskField'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xac'),require('./api/intFreshdeskAccount'));_0x3df839['use'](_0x9f89('0xad'),require(_0x9f89('0xae')));_0x3df839[_0x9f89('0x7')]('/api/integrations/freshdesk/fields',require(_0x9f89('0xaf')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xb0'),require(_0x9f89('0xb1')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xb2'),require(_0x9f89('0xb3')));_0x3df839[_0x9f89('0x7')]('/api/integrations/vtiger/fields',require(_0x9f89('0xb4')));_0x3df839[_0x9f89('0x7')]('/api/integrations/servicenow/accounts',require(_0x9f89('0xb5')));_0x3df839[_0x9f89('0x7')]('/api/integrations/servicenow/configurations',require(_0x9f89('0xb6')));_0x3df839[_0x9f89('0x7')]('/api/integrations/servicenow/fields',require(_0x9f89('0xb7')));_0x3df839[_0x9f89('0x7')]('/api/integrations/dynamics365/accounts',require(_0x9f89('0xb8')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xb9'),require(_0x9f89('0xba')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xbb'),require(_0x9f89('0xbc')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xbd'),require('./api/intFreshsalesAccount'));_0x3df839[_0x9f89('0x7')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xbe'),require(_0x9f89('0xbf')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xc0'),require(_0x9f89('0xc1')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xc2'),require(_0x9f89('0xc3')));_0x3df839['use'](_0x9f89('0xc4'),require(_0x9f89('0xc5')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xc6'),require(_0x9f89('0xc7')));_0x3df839['use'](_0x9f89('0xc8'),require('./api/jscriptyQuestionReport'));_0x3df839['use'](_0x9f89('0xc9'),require(_0x9f89('0xca')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xcb'),require(_0x9f89('0xcc')));_0x3df839[_0x9f89('0x7')]('/api/square/reports',require('./api/squareReport'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xcd'),require('./api/squareReportDetail'));_0x3df839['use']('/api/jscripty/projects',require(_0x9f89('0xce')));_0x3df839['use']('/api/settings',require(_0x9f89('0xcf')));_0x3df839[_0x9f89('0x7')]('/api/square/odbc',require(_0x9f89('0xd0')));_0x3df839['use'](_0x9f89('0xd1'),require(_0x9f89('0xd2')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xd3'),require(_0x9f89('0xd4')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xd5'),require(_0x9f89('0xd6')));_0x3df839[_0x9f89('0x7')]('/api/teams',require(_0x9f89('0xd7')));_0x3df839[_0x9f89('0x7')]('/api/license',require(_0x9f89('0xd8')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xd9'),require(_0x9f89('0xda')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xdb'),require(_0x9f89('0xdc')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xdd'),require(_0x9f89('0xde')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xdf'),require(_0x9f89('0xe0')));_0x3df839[_0x9f89('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xe1'),require('./api/chatTransferReport'));_0x3df839[_0x9f89('0x7')]('/api/fax/reports/transfer',require(_0x9f89('0xe2')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xe3'),require(_0x9f89('0xe4')));_0x3df839['use']('/api/sms/reports/transfer',require(_0x9f89('0xe5')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xe6'),require(_0x9f89('0xe7')));_0x3df839['use'](_0x9f89('0xe8'),require(_0x9f89('0xe9')));_0x3df839[_0x9f89('0x7')]('/api/userProfiles',require(_0x9f89('0xea')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xeb'),require(_0x9f89('0xec')));_0x3df839['use'](_0x9f89('0xed'),require('./api/userProfileResource'));_0x3df839[_0x9f89('0x7')]('/api/userNotifications',require('./api/userNotification'));_0x3df839['use'](_0x9f89('0xee'),require(_0x9f89('0xef')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xf0'),require(_0x9f89('0xf1')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xf2'),require('./api/whatsappInteraction'));_0x3df839[_0x9f89('0x7')](_0x9f89('0xf3'),require(_0x9f89('0xf4')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xf5'),require(_0x9f89('0xf6')));_0x3df839[_0x9f89('0x7')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x3df839['use'](_0x9f89('0xf7'),require(_0x9f89('0xf8')));_0x3df839[_0x9f89('0x7')]('/api/cloudProviders',require(_0x9f89('0xf9')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xfa'),require(_0x9f89('0xfb')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xfc'),require(_0x9f89('0xfd')));_0x3df839[_0x9f89('0x7')](_0x9f89('0xfe'),require(_0x9f89('0xff')));_0x3df839['use'](_0x9f89('0x100'),require(_0x9f89('0x101')));_0x3df839[_0x9f89('0x7')]('/api/rpc',require(_0x9f89('0x102')));_0x3df839[_0x9f89('0x7')]('/api/version',require(_0x9f89('0x103')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x104'),require('./api/system'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x105'),require(_0x9f89('0x106')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x107'),require('./api/webbar'));_0x3df839[_0x9f89('0x7')](_0x9f89('0x108'),express[_0x9f89('0x109')](path[_0x9f89('0x10a')](config[_0x9f89('0x10b')],'/apidoc')));_0x3df839[_0x9f89('0x7')](_0x9f89('0x10c'),express[_0x9f89('0x109')](path['join'](config[_0x9f89('0x10b')],_0x9f89('0x10c'))));_0x3df839['use'](_0x9f89('0x10d'),express[_0x9f89('0x109')](path['join'](config[_0x9f89('0x10b')],_0x9f89('0x10d'))));_0x3df839[_0x9f89('0x7')]('/snippet',express[_0x9f89('0x109')](path[_0x9f89('0x10a')](config[_0x9f89('0x10b')],'snippet',_0x9f89('0x10e'))));_0x3df839['use']('/plugins',express[_0x9f89('0x109')](path['join'](config[_0x9f89('0x10b')],_0x9f89('0x10f'))));_0x3df839[_0x9f89('0x110')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x3df839['route']('/*')[_0x9f89('0x111')](function(_0x5ceacc,_0x1e2c55){_0x1e2c55[_0x9f89('0x112')](path[_0x9f89('0x113')](_0x3df839[_0x9f89('0x111')](_0x9f89('0x114'))+_0x9f89('0x115')));});};var sensitiveFields=['username',_0x9f89('0x116'),'newPassword','apiKey','firstName',_0x9f89('0x117'),_0x9f89('0x118'),_0x9f89('0x119'),'mobile',_0x9f89('0x11a'),_0x9f89('0x11b'),_0x9f89('0x11c'),_0x9f89('0x11d'),_0x9f89('0x11e'),_0x9f89('0x11f'),_0x9f89('0x120'),_0x9f89('0x121'),_0x9f89('0x122'),_0x9f89('0x123'),_0x9f89('0x124'),_0x9f89('0x125'),_0x9f89('0x126'),_0x9f89('0x127'),'consumerSecret',_0x9f89('0x128'),'calleridname',_0x9f89('0x129'),'exten',_0x9f89('0x12a'),_0x9f89('0x12b'),_0x9f89('0x12c'),_0x9f89('0x12d'),_0x9f89('0x12e'),_0x9f89('0x12f'),_0x9f89('0x12'),_0x9f89('0x130'),'accountSid',_0x9f89('0x131'),_0x9f89('0x132'),_0x9f89('0x133'),_0x9f89('0x134'),_0x9f89('0x135')];function maskSensitiveData(_0x31b1f8){var _0x1366ba=/(?!^)[\s\S](?!$)/g;if(!_[_0x9f89('0x136')](_0x31b1f8))return;for(var _0x3d466c in _0x31b1f8){if(_['isArray'](_0x31b1f8[_0x3d466c])){for(var _0xf3c09c=0x0;_0xf3c09c<_0x31b1f8[_0x3d466c][_0x9f89('0x137')];_0xf3c09c++){maskSensitiveData(_0x31b1f8[_0x3d466c][_0xf3c09c]);}}else if(_[_0x9f89('0x136')](_0x31b1f8[_0x3d466c])){maskSensitiveData(_0x31b1f8[_0x3d466c]);}else if(_[_0x9f89('0x138')](_0x31b1f8[_0x3d466c])){_0x31b1f8[_0x3d466c]=_0x31b1f8[_0x3d466c][_0x9f89('0x139')](/{{{/g,_0x9f89('0x13a'))[_0x9f89('0x139')](/}}}/g,_0x9f89('0x13b'))[_0x9f89('0x139')](/{{/g,'@{')[_0x9f89('0x139')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x3d466c)){_0x31b1f8[_0x3d466c]=_0x31b1f8[_0x3d466c][_0x9f89('0x139')](_0x1366ba,'*');}}}} \ No newline at end of file +var _0x5cd0=['./api/intFreshsalesField','/api/networks','./api/network','./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/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','/apidoc','static','join','root','/demo','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','password','newPassword','apiKey','lastName','phone','mobile','fax','email','clientId','securityToken','code','accessKey','token','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','lodash','express','express-winston','./errors','api','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','url','other','agent_name','test','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmCustomField','/api/actions','/api/automations','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x5cd0,0x1dd));var _0x05cd=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5cd0[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x05cd('0x0'));var path=require('path');var express=require(_0x05cd('0x1'));var ewinston=require(_0x05cd('0x2'));var util=require('util');var errors=require(_0x05cd('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0x05cd('0x4'));var authLogger=require(_0x05cd('0x5'))(_0x05cd('0x6'));exports[_0x05cd('0x7')]=function(_0x32d436){_0x32d436['use'](ewinston[_0x05cd('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2ded10,_0x3497d7){var _0x2eb8f9=_0x05cd('0x9');if(!_[_0x05cd('0xa')](_0x2ded10[_0x05cd('0xb')])){_0x2eb8f9+=_0x05cd('0xc');var _0x58fc7a=_0x2ded10[_0x05cd('0xb')];maskSensitiveData(_0x58fc7a);}return util[_0x05cd('0xd')](_0x2eb8f9,_0x2ded10['method'],_0x2ded10[_0x05cd('0xe')][_0x05cd('0xf')]?_0x2ded10[_0x05cd('0xe')][_0x05cd('0xf')]:_0x2ded10[_0x05cd('0x10')]['remoteAddress']||_0x2ded10['ip'],_0x2ded10['url'],_0x3497d7[_0x05cd('0x11')],_0x3497d7[_0x05cd('0x12')],_0x2ded10['user']?_0x2ded10['user']['id']:null,_0x2ded10[_0x05cd('0x13')]?_0x2ded10['user'][_0x05cd('0x14')]:null,_0x2ded10[_0x05cd('0x13')]?_0x2ded10[_0x05cd('0x13')][_0x05cd('0x15')]:null,_0x58fc7a?util[_0x05cd('0x16')](_0x58fc7a,![],null):'');}}));_0x32d436[_0x05cd('0x17')](ewinston[_0x05cd('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5cb6f3,_0x4ef0ee){var _0x3820d1=_0x05cd('0x18');if(_0x5cb6f3[_0x05cd('0xb')]&&_0x5cb6f3[_0x05cd('0xb')][_0x05cd('0x19')]&&_0x5cb6f3['body'][_0x05cd('0x1a')]){_0x3820d1=_0x05cd('0x1b');}return util[_0x05cd('0xd')](_0x3820d1,_0x5cb6f3[_0x05cd('0x1c')],_0x5cb6f3[_0x05cd('0xe')][_0x05cd('0xf')]?_0x5cb6f3[_0x05cd('0xe')][_0x05cd('0xf')]:_0x5cb6f3['connection']['remoteAddress']||_0x5cb6f3['ip'],_0x5cb6f3[_0x05cd('0x1d')],_0x4ef0ee['statusCode'],_0x4ef0ee['responseTime'],_0x5cb6f3['user']?_0x5cb6f3[_0x05cd('0x13')]['id']:null,_0x5cb6f3['user']?_0x5cb6f3[_0x05cd('0x13')][_0x05cd('0x14')]:null,_0x5cb6f3['user']?_0x5cb6f3[_0x05cd('0x13')][_0x05cd('0x15')]:null,_0x5cb6f3[_0x05cd('0xb')]&&_0x5cb6f3[_0x05cd('0xb')][_0x05cd('0x19')]?_0x5cb6f3[_0x05cd('0xb')][_0x05cd('0x19')]:_0x05cd('0x1e'),_0x5cb6f3[_0x05cd('0xb')]&&_0x5cb6f3['body'][_0x05cd('0x1a')]?_0x5cb6f3[_0x05cd('0xb')]['agent_id']:'',_0x5cb6f3[_0x05cd('0xb')]&&_0x5cb6f3[_0x05cd('0xb')][_0x05cd('0x1f')]?_0x5cb6f3[_0x05cd('0xb')][_0x05cd('0x1f')]:'');},'ignoreRoute':function(_0x24fe97){var _0x5c437a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5c437a[_0x05cd('0x20')](_0x24fe97[_0x05cd('0x1d')]);}}));_0x32d436[_0x05cd('0x17')]('/api/users',require('./api/user'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x21'),require('./api/voiceChanSpy'));_0x32d436[_0x05cd('0x17')]('/api/voice/contexts',require(_0x05cd('0x22')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x23'),require('./api/voiceExtension'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x24'),require(_0x05cd('0x25')));_0x32d436['use'](_0x05cd('0x26'),require(_0x05cd('0x27')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x28'),require(_0x05cd('0x29')));_0x32d436[_0x05cd('0x17')]('/api/screen/recordings',require(_0x05cd('0x2a')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x2b'),require(_0x05cd('0x2c')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x2d'),require('./api/voiceMailMessage'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x2e'),require(_0x05cd('0x2f')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x30'),require(_0x05cd('0x31')));_0x32d436[_0x05cd('0x17')]('/api/voice/agents/reports',require(_0x05cd('0x32')));_0x32d436[_0x05cd('0x17')]('/api/voice/queues/reports',require(_0x05cd('0x33')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x34'),require(_0x05cd('0x35')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x36'),require(_0x05cd('0x37')));_0x32d436[_0x05cd('0x17')]('/api/voice/transfers/reports',require(_0x05cd('0x38')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x39'),require(_0x05cd('0x3a')));_0x32d436['use'](_0x05cd('0x3b'),require(_0x05cd('0x3c')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x3d'),require(_0x05cd('0x3e')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x3f'),require(_0x05cd('0x40')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x41'),require(_0x05cd('0x42')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x43'),require(_0x05cd('0x44')));_0x32d436[_0x05cd('0x17')]('/api/mail/applications',require(_0x05cd('0x45')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x46'),require(_0x05cd('0x47')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x48'),require(_0x05cd('0x49')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x4a'),require(_0x05cd('0x4b')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x4c'),require(_0x05cd('0x4d')));_0x32d436[_0x05cd('0x17')]('/api/fax/applications',require(_0x05cd('0x4e')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x4f'),require(_0x05cd('0x50')));_0x32d436['use']('/api/fax/messages',require('./api/faxMessage'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x51'),require(_0x05cd('0x52')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x53'),require(_0x05cd('0x54')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x55'),require(_0x05cd('0x56')));_0x32d436[_0x05cd('0x17')]('/api/sms/applications',require('./api/smsApplication'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x57'),require(_0x05cd('0x58')));_0x32d436['use'](_0x05cd('0x59'),require(_0x05cd('0x5a')));_0x32d436[_0x05cd('0x17')]('/api/sms/queues',require(_0x05cd('0x5b')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x5c'),require('./api/openchannelAccount'));_0x32d436[_0x05cd('0x17')]('/api/openchannel/applications',require(_0x05cd('0x5d')));_0x32d436['use'](_0x05cd('0x5e'),require(_0x05cd('0x5f')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x60'),require(_0x05cd('0x61')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x62'),require(_0x05cd('0x63')));_0x32d436[_0x05cd('0x17')]('/api/chat/websites',require('./api/chatWebsite'));_0x32d436['use'](_0x05cd('0x64'),require('./api/openchannelQueueReport'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x65'),require(_0x05cd('0x66')));_0x32d436[_0x05cd('0x17')]('/api/chat/interactions',require(_0x05cd('0x67')));_0x32d436['use']('/api/chat/messages',require(_0x05cd('0x68')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x69'),require(_0x05cd('0x6a')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x6b'),require('./api/chatQueue'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x6c'),require(_0x05cd('0x6d')));_0x32d436[_0x05cd('0x17')]('/api/chat/proactive_actions',require(_0x05cd('0x6e')));_0x32d436['use'](_0x05cd('0x6f'),require(_0x05cd('0x70')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x71'),require('./api/cmContact'));_0x32d436['use'](_0x05cd('0x72'),require('./api/cmHopper'));_0x32d436['use'](_0x05cd('0x73'),require(_0x05cd('0x74')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x75'),require(_0x05cd('0x76')));_0x32d436[_0x05cd('0x17')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x32d436[_0x05cd('0x17')]('/api/cm/custom_fields',require(_0x05cd('0x77')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x78'),require('./api/action'));_0x32d436['use'](_0x05cd('0x79'),require('./api/automation'));_0x32d436[_0x05cd('0x17')]('/api/canned_answers',require(_0x05cd('0x7a')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x7b'),require('./api/disposition'));_0x32d436['use'](_0x05cd('0x7c'),require(_0x05cd('0x7d')));_0x32d436['use'](_0x05cd('0x7e'),require(_0x05cd('0x7f')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x80'),require('./api/pause'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x81'),require(_0x05cd('0x82')));_0x32d436[_0x05cd('0x17')]('/api/voiceQueuesLog',require(_0x05cd('0x83')));_0x32d436['use'](_0x05cd('0x84'),require(_0x05cd('0x85')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x86'),require('./api/sound'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x87'),require(_0x05cd('0x88')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x89'),require(_0x05cd('0x8a')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x8b'),require(_0x05cd('0x8c')));_0x32d436['use'](_0x05cd('0x8d'),require(_0x05cd('0x8e')));_0x32d436['use'](_0x05cd('0x8f'),require(_0x05cd('0x90')));_0x32d436[_0x05cd('0x17')]('/api/integrations/reports',require(_0x05cd('0x91')));_0x32d436['use'](_0x05cd('0x92'),require(_0x05cd('0x93')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x94'),require(_0x05cd('0x95')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x96'),require(_0x05cd('0x97')));_0x32d436['use'](_0x05cd('0x98'),require(_0x05cd('0x99')));_0x32d436[_0x05cd('0x17')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x9a'),require('./api/analyticTreeReport'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x9b'),require(_0x05cd('0x9c')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x9d'),require(_0x05cd('0x9e')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x9f'),require('./api/intSalesforceField'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xa0'),require('./api/intSugarcrmAccount'));_0x32d436['use'](_0x05cd('0xa1'),require('./api/intSugarcrmConfiguration'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xa2'),require(_0x05cd('0xa3')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xa4'),require(_0x05cd('0xa5')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xa6'),require(_0x05cd('0xa7')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xa8'),require(_0x05cd('0xa9')));_0x32d436['use'](_0x05cd('0xaa'),require(_0x05cd('0xab')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xac'),require(_0x05cd('0xad')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xae'),require(_0x05cd('0xaf')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xb0'),require(_0x05cd('0xb1')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xb2'),require('./api/intZendeskConfiguration'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xb3'),require(_0x05cd('0xb4')));_0x32d436[_0x05cd('0x17')]('/api/integrations/freshdesk/accounts',require(_0x05cd('0xb5')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xb6'),require(_0x05cd('0xb7')));_0x32d436[_0x05cd('0x17')]('/api/integrations/freshdesk/fields',require(_0x05cd('0xb8')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xb9'),require(_0x05cd('0xba')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xbb'),require(_0x05cd('0xbc')));_0x32d436['use'](_0x05cd('0xbd'),require(_0x05cd('0xbe')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xbf'),require(_0x05cd('0xc0')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xc1'),require(_0x05cd('0xc2')));_0x32d436['use'](_0x05cd('0xc3'),require(_0x05cd('0xc4')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xc5'),require('./api/intDynamics365Account'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xc6'),require('./api/intDynamics365Configuration'));_0x32d436[_0x05cd('0x17')]('/api/integrations/dynamics365/fields',require(_0x05cd('0xc7')));_0x32d436['use'](_0x05cd('0xc8'),require('./api/intFreshsalesAccount'));_0x32d436[_0x05cd('0x17')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x32d436['use']('/api/integrations/freshsales/fields',require(_0x05cd('0xc9')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xca'),require(_0x05cd('0xcb')));_0x32d436[_0x05cd('0x17')]('/api/chat/reports/queue',require(_0x05cd('0xcc')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xcd'),require(_0x05cd('0xce')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xcf'),require(_0x05cd('0xd0')));_0x32d436['use'](_0x05cd('0xd1'),require(_0x05cd('0xd2')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xd3'),require(_0x05cd('0xd4')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xd5'),require('./api/smsQueueReport'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xd6'),require(_0x05cd('0xd7')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xd8'),require(_0x05cd('0xd9')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xda'),require(_0x05cd('0xdb')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xdc'),require('./api/setting'));_0x32d436[_0x05cd('0x17')]('/api/square/odbc',require(_0x05cd('0xdd')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xde'),require(_0x05cd('0xdf')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xe0'),require(_0x05cd('0xe1')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xe2'),require(_0x05cd('0xe3')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xe4'),require(_0x05cd('0xe5')));_0x32d436['use'](_0x05cd('0xe6'),require('./api/license'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xe7'),require(_0x05cd('0xe8')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xe9'),require(_0x05cd('0xea')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xeb'),require(_0x05cd('0xec')));_0x32d436['use'](_0x05cd('0xed'),require('./api/plugin'));_0x32d436[_0x05cd('0x17')](_0x05cd('0xee'),require(_0x05cd('0xef')));_0x32d436['use'](_0x05cd('0xf0'),require(_0x05cd('0xf1')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xf2'),require(_0x05cd('0xf3')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xf4'),require(_0x05cd('0xf5')));_0x32d436['use']('/api/sms/reports/transfer',require(_0x05cd('0xf6')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xf7'),require(_0x05cd('0xf8')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xf9'),require(_0x05cd('0xfa')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xfb'),require(_0x05cd('0xfc')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xfd'),require(_0x05cd('0xfe')));_0x32d436[_0x05cd('0x17')](_0x05cd('0xff'),require(_0x05cd('0x100')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x101'),require(_0x05cd('0x102')));_0x32d436['use'](_0x05cd('0x103'),require(_0x05cd('0x104')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x105'),require(_0x05cd('0x106')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x107'),require('./api/whatsappInteraction'));_0x32d436['use'](_0x05cd('0x108'),require(_0x05cd('0x109')));_0x32d436['use'](_0x05cd('0x10a'),require(_0x05cd('0x10b')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x10c'),require(_0x05cd('0x10d')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x10e'),require(_0x05cd('0x10f')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x110'),require(_0x05cd('0x111')));_0x32d436[_0x05cd('0x17')]('/api/realtime',require(_0x05cd('0x112')));_0x32d436[_0x05cd('0x17')]('/api/auth/local',require(_0x05cd('0x113')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x114'),require('./api/authGoogle'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x115'),require(_0x05cd('0x116')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x117'),require(_0x05cd('0x118')));_0x32d436['use'](_0x05cd('0x119'),require(_0x05cd('0x11a')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x11b'),require(_0x05cd('0x11c')));_0x32d436['use']('/api/pm2',require(_0x05cd('0x11d')));_0x32d436[_0x05cd('0x17')](_0x05cd('0x11e'),require('./api/webbar'));_0x32d436[_0x05cd('0x17')](_0x05cd('0x11f'),express[_0x05cd('0x120')](path[_0x05cd('0x121')](config[_0x05cd('0x122')],_0x05cd('0x11f'))));_0x32d436[_0x05cd('0x17')]('/www',express[_0x05cd('0x120')](path[_0x05cd('0x121')](config['root'],'/www')));_0x32d436[_0x05cd('0x17')]('/demo',express[_0x05cd('0x120')](path[_0x05cd('0x121')](config[_0x05cd('0x122')],_0x05cd('0x123'))));_0x32d436[_0x05cd('0x17')]('/snippet',express['static'](path[_0x05cd('0x121')](config[_0x05cd('0x122')],_0x05cd('0x124'),'3.0.0')));_0x32d436[_0x05cd('0x17')]('/plugins',express[_0x05cd('0x120')](path[_0x05cd('0x121')](config[_0x05cd('0x122')],_0x05cd('0x125'))));_0x32d436[_0x05cd('0x126')](_0x05cd('0x127'))[_0x05cd('0x128')](errors[0x194]);_0x32d436[_0x05cd('0x126')]('/*')[_0x05cd('0x128')](function(_0x41f4cb,_0x4e2d04){_0x4e2d04[_0x05cd('0x129')](path[_0x05cd('0x12a')](_0x32d436[_0x05cd('0x128')](_0x05cd('0x12b'))+_0x05cd('0x12c')));});};var sensitiveFields=['username',_0x05cd('0x12d'),_0x05cd('0x12e'),_0x05cd('0x12f'),'firstName',_0x05cd('0x130'),'street',_0x05cd('0x131'),_0x05cd('0x132'),_0x05cd('0x133'),_0x05cd('0x134'),_0x05cd('0x135'),'clientSecret',_0x05cd('0x136'),_0x05cd('0x137'),_0x05cd('0x138'),'tenantId',_0x05cd('0x139'),_0x05cd('0x13a'),'accessToken',_0x05cd('0x13b'),_0x05cd('0x13c'),_0x05cd('0x13d'),_0x05cd('0x13e'),_0x05cd('0x13f'),_0x05cd('0x140'),'calleridnum','exten','vidaooApiKey',_0x05cd('0x141'),_0x05cd('0x142'),_0x05cd('0x143'),_0x05cd('0x144'),'key',_0x05cd('0x13'),_0x05cd('0x145'),_0x05cd('0x146'),_0x05cd('0x147'),_0x05cd('0x148'),_0x05cd('0x149'),_0x05cd('0x14a'),_0x05cd('0x14b')];function maskSensitiveData(_0x61fc16){var _0x58d684=/(?!^)[\s\S](?!$)/g;if(!_[_0x05cd('0x14c')](_0x61fc16))return;for(var _0x50e9d4 in _0x61fc16){if(_[_0x05cd('0x14d')](_0x61fc16[_0x50e9d4])){for(var _0x3e29a6=0x0;_0x3e29a6<_0x61fc16[_0x50e9d4][_0x05cd('0x14e')];_0x3e29a6++){maskSensitiveData(_0x61fc16[_0x50e9d4][_0x3e29a6]);}}else if(_[_0x05cd('0x14c')](_0x61fc16[_0x50e9d4])){maskSensitiveData(_0x61fc16[_0x50e9d4]);}else if(_[_0x05cd('0x14f')](_0x61fc16[_0x50e9d4])){_0x61fc16[_0x50e9d4]=_0x61fc16[_0x50e9d4][_0x05cd('0x150')](/{{{/g,'@@{')[_0x05cd('0x150')](/}}}/g,_0x05cd('0x151'))['replace'](/{{/g,'@{')[_0x05cd('0x150')](/}}/g,'}@');if(_[_0x05cd('0x152')](sensitiveFields,_0x50e9d4)){_0x61fc16[_0x50e9d4]=_0x61fc16[_0x50e9d4]['replace'](_0x58d684,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0da8b75..28325f0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe10f=['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/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.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/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','log','../config/triggers','default','jayson/promise','bluebird'];(function(_0x1bb126,_0x44182e){var _0x125a02=function(_0xf2d549){while(--_0xf2d549){_0x1bb126['push'](_0x1bb126['shift']());}};_0x125a02(++_0x44182e);}(_0xe10f,0xca));var _0xfe10=function(_0x3233c1,_0x294aeb){_0x3233c1=_0x3233c1-0x0;var _0xe65e44=_0xe10f[_0x3233c1];return _0xe65e44;};'use strict';var jayson=require(_0xfe10('0x0'));var BPromise=require(_0xfe10('0x1'));var _=require(_0xfe10('0x2'));var config=require(_0xfe10('0x3'));exports[_0xfe10('0x4')]=function(){return new BPromise(function(_0x2b013c,_0x1a52ad){var _0x406a46={};_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/user/user.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x6')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x7')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x8')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x9')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0xa')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0xb')));_0x406a46=_['merge'](_0x406a46,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0xc')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0xd')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0xe')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0xf')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x10')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/mailAccount/mailAccount.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x11')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x12')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x13')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x14')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x15')));_0x406a46=_['merge'](_0x406a46,require('../api/faxApplication/faxApplication.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/faxInteraction/faxInteraction.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x16')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x17')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x18')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x19')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x1a')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x1b')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x1c')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x1d')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x1e')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x1f')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x20')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x21')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/chatMessage/chatMessage.rpc'));_0x406a46=_['merge'](_0x406a46,require('../api/chatQueue/chatQueue.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x22')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x23')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x24')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x25')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x26')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x27')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x28')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x29')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x2a')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x2b')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x2c')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x2d')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x2e')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x2f')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x30')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x31')));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x32')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x33')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x34')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x35')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x406a46=_['merge'](_0x406a46,require('../api/setting/setting.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x36')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x37')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x38')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/squareMessage/squareMessage.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x39')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/attachment/attachment.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x3a')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x3b')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require(_0xfe10('0x3c')));_0x406a46=_[_0xfe10('0x5')](_0x406a46,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x406a46=_['merge'](_0x406a46,require(_0xfe10('0x3d')));var _0x3d4461=jayson['server'](_0x406a46)[_0xfe10('0x3e')]();var _0x45ea24=config[_0xfe10('0x3f')][_0xfe10('0x40')]||config[_0xfe10('0x40')]+0x1;var _0x5900ce=config['rpc']['ip']||'localhost';_0x3d4461['on']('error',function(_0x2ef942){return _0x1a52ad(_0x2ef942);});_0x3d4461[_0xfe10('0x4')](_0x45ea24,_0x5900ce,function(){console[_0xfe10('0x41')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5900ce,_0x45ea24);require(_0xfe10('0x42'))[_0xfe10('0x43')]();return _0x2b013c('RPC\x20listening\x20on\x20'+_0x5900ce+':'+_0x45ea24);});});}; \ No newline at end of file +var _0x2a8e=['default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../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/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!'];(function(_0x175cbb,_0x81c678){var _0x5cddbf=function(_0x2ab9cf){while(--_0x2ab9cf){_0x175cbb['push'](_0x175cbb['shift']());}};_0x5cddbf(++_0x81c678);}(_0x2a8e,0x156));var _0xe2a8=function(_0x169379,_0x2616c8){_0x169379=_0x169379-0x0;var _0x483e3a=_0x2a8e[_0x169379];return _0x483e3a;};'use strict';var jayson=require(_0xe2a8('0x0'));var BPromise=require(_0xe2a8('0x1'));var _=require(_0xe2a8('0x2'));var config=require(_0xe2a8('0x3'));exports['listen']=function(){return new BPromise(function(_0x2ed92c,_0x2672ce){var _0x54b1e0={};_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x5')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x6')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x7')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x8')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x9')));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xa')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xb')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xc')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xd')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xe')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0xf')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x10')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x11')));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x12')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/mailInteraction/mailInteraction.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x13')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x14')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x15')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/faxAccount/faxAccount.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x16')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x17')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x18')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x19')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1a')));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/smsAccount/smsAccount.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/smsInteraction/smsInteraction.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/smsMessage/smsMessage.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1b')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1c')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1d')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1e')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x1f')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x20')));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/chatInteraction/chatInteraction.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x21')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x22')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x23')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/cmHopper/cmHopper.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x24')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x25')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x26')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x27')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x28')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/pause/pause.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/sound/sound.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/template/template.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x29')));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x2a')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x2b')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x2c')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x2d')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x2e')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x2f')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x30')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x31')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/squareReport/squareReport.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x32')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/setting/setting.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x33')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x34')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x35')));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/squareMessage/squareMessage.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x36')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x37')));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x38')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x39')));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x54b1e0=_[_0xe2a8('0x4')](_0x54b1e0,require(_0xe2a8('0x3a')));_0x54b1e0=_['merge'](_0x54b1e0,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x54b1e0=_['merge'](_0x54b1e0,require(_0xe2a8('0x3b')));var _0x5a7d0b=jayson[_0xe2a8('0x3c')](_0x54b1e0)['http']();var _0x391354=config[_0xe2a8('0x3d')]['port']||config[_0xe2a8('0x3e')]+0x1;var _0x987efe=config[_0xe2a8('0x3d')]['ip']||'localhost';_0x5a7d0b['on'](_0xe2a8('0x3f'),function(_0x23c3b0){return _0x2672ce(_0x23c3b0);});_0x5a7d0b[_0xe2a8('0x40')](_0x391354,_0x987efe,function(){console['log'](_0xe2a8('0x41'),_0x987efe,_0x391354);require('../config/triggers')[_0xe2a8('0x42')]();return _0x2ed92c(_0xe2a8('0x43')+_0x987efe+':'+_0x391354);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 908f291..f7c0ca3 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 _0xf722=['recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','noop','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x278090,_0x56f670){var _0x34c3d9=function(_0x2028ab){while(--_0x2028ab){_0x278090['push'](_0x278090['shift']());}};_0x34c3d9(++_0x56f670);}(_0xf722,0x18f));var _0x2f72=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf722[_0x618414];return _0x21c19a;};'use strict';var util=require(_0x2f72('0x0'));var _=require(_0x2f72('0x1'));var EventEmitter=require(_0x2f72('0x2'))[_0x2f72('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x2f72('0x4'));function AGIChannel(_0x297070){var _0x1b3952=this,_0x418aed=new AGIReply(),_0x47d759=![],_0x3235a5={};EventEmitter[_0x2f72('0x5')](_0x1b3952);_0x297070[_0x2f72('0x6')]('utf8');_0x297070['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x418aed[_0x2f72('0x6')](_0x2f72('0x7'));_0x418aed['on'](_0x2f72('0x8'),function(_0x3adb7e){for(var _0x1cb244 in _0x3adb7e){_0x1b3952[_0x1cb244]=_0x3adb7e[_0x1cb244];}_0x1b3952[_0x2f72('0x9')](_0x2f72('0xa'));});_0x418aed['on'](_0x2f72('0xb'),function(_0x227a77){if(_0x227a77[_0x2f72('0xc')]()==_0x2f72('0xd')){_0x1b3952[_0x2f72('0x9')](_0x2f72('0xd'));return;}if(_0x227a77[_0x2f72('0xe')](0x0,0xb)=='520-Invalid'){_0x47d759=!![];}if(_0x47d759){_0x3235a5['rx']+=_0x227a77+'\x0a';if(_0x227a77[_0x2f72('0xf')](_0x2f72('0x10'))!=-0x1){_0x47d759=![];}}else{_0x3235a5['rx']=_0x227a77;}if(_0x47d759){return;}if(typeof _0x3235a5['cb']==_0x2f72('0x11')){var _0x3e5d60=_0x3235a5['rx'][_0x2f72('0xe')](0x0,0x3),_0x1220cd=null,_0x1ef4cd=null;_0x3e5d60=parseInt(_0x3e5d60);if(isNaN(_0x3e5d60)){_0x3235a5['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3e5d60!=0xc8){_0x3235a5['cb'](null,{'code':_0x3e5d60,'result':-0x1,'extra':'KO'});return;}_0x1220cd=_0x3235a5['rx']['substring'](0x4)[_0x2f72('0x12')](_0x2f72('0x13'),'');if(_0x1220cd['indexOf']('\x20')!=-0x1){_0x1220cd=_0x1220cd[_0x2f72('0x14')](0x0,_0x1220cd[_0x2f72('0x15')]('\x20'));}if(_[_0x2f72('0x16')](_0x1220cd,'-1')){_0x1220cd=parseInt(_0x1220cd);}_0x1ef4cd=_0x3235a5['rx']['split']('\x20');if(_0x1ef4cd[_0x2f72('0x17')]==0x3){_0x1ef4cd=_0x1ef4cd[0x2][_0x2f72('0xe')](0x1,_0x1ef4cd[0x2][_0x2f72('0x17')]-0x1);}else if(_0x1ef4cd[_0x2f72('0x17')]>0x3){var _0x2efdd9=/\((.+)\)/;var _0x4239f7=_0x3235a5['rx'][_0x2f72('0x18')](_0x2efdd9);if(_0x4239f7){_0x1ef4cd=_0x4239f7[0x1];}else{_0x1ef4cd=null;}}else{_0x1ef4cd=null;}_0x3235a5['cb'](null,{'code':_0x3e5d60,'result':_0x1220cd,'extra':_0x1ef4cd});}});_0x297070['on'](_0x2f72('0x19'),function(_0x5ab0d2){_0x1b3952['emit'](_0x2f72('0x19'),new AGIError(_0x2f72('0x1a'),_0x5ab0d2[_0x2f72('0x1b')]));});_0x297070['on'](_0x2f72('0x1c'),function(){_0x1b3952['emit']('close',new AGIError(_0x2f72('0x1d')));});_0x297070['on'](_0x2f72('0x1e'),function(){_0x1b3952['emit'](_0x2f72('0x1e'),new AGIError(_0x2f72('0x1f')));_0x297070['destroy']();});_0x297070[_0x2f72('0x20')](_0x418aed);this[_0x2f72('0x21')]=function(_0x3c036c,_0x1af16b){var _0x3c036c=_0x3c036c||'',_0x1af16b=typeof _0x1af16b==_0x2f72('0x11')?_0x1af16b:new Function();_0x3235a5={'tx':_0x3c036c,'rx':'','cb':_0x1af16b};_0x297070['write'](_0x3c036c+'\x0a');},this[_0x2f72('0x1c')]=function(){_0x297070[_0x2f72('0x22')]();};}util[_0x2f72('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x2f72('0x24')][_0x2f72('0x25')]=function(_0x4e6f39){return this[_0x2f72('0x21')][_0x2f72('0x26')](this,_0x4e6f39);};AGIChannel[_0x2f72('0x24')][_0x2f72('0x27')]=function(){return this['sendRequest'](_0x2f72('0x28'));};AGIChannel['prototype'][_0x2f72('0x29')]=function(_0x5763a6,_0x284d71,_0x2fc5d6){_0x5763a6=_0x5763a6===undefined?'beep':_0x5763a6;_0x284d71=_0x284d71===undefined?'5':_0x284d71;_0x2fc5d6=_0x2fc5d6===undefined?'1':_0x2fc5d6;return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x2b'),_0x5763a6,_0x284d71*0x3e8,_0x2fc5d6));};AGIChannel[_0x2f72('0x24')]['noop']=function(_0x30f3a3){_0x30f3a3=_0x30f3a3||'NO\x20MESSAGE';return this[_0x2f72('0x25')](util['format'](_0x2f72('0x2c'),_0x30f3a3));};AGIChannel[_0x2f72('0x24')]['exec']=function(_0x454333,_0x2b2158){if(_[_0x2f72('0x2d')](_0x2b2158)){return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x2e'),_0x454333,_0x2b2158[_0x2f72('0x2f')](',')));}return this[_0x2f72('0x25')](util['format'](_0x2f72('0x2e'),_0x454333,_0x2b2158));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x30')]=function(_0x275ce9){return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x31'),_0x275ce9));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x32')]=function(_0x2e534b){return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x33'),_0x2e534b));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x34')]=function(_0x45ef07){return this[_0x2f72('0x25')](util[_0x2f72('0x2a')]('SET\x20PRIORITY\x20%s',_0x45ef07));};AGIChannel[_0x2f72('0x24')]['hangup']=function(){return this[_0x2f72('0x25')](_0x2f72('0x35'));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x36')]=function(_0x310d5d,_0x44706a){var _0x4e9db0=_[_0x2f72('0x37')](_0x44706a)||_[_0x2f72('0x38')](_0x44706a)?_0x44706a[_0x2f72('0x39')]():_0x44706a;return this['sendRequest'](util[_0x2f72('0x2a')](_0x2f72('0x3a'),_0x310d5d,_0x4e9db0?_0x4e9db0[_0x2f72('0x39')]()[_0x2f72('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x3b')]=function(_0x5e653a,_0x5dd2be){return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x3c'),_0x5e653a,_0x5dd2be));};AGIChannel[_0x2f72('0x24')]['sayDigits']=function(_0x5af4e5,_0x490809){return this[_0x2f72('0x25')](util['format'](_0x2f72('0x3d'),_0x5af4e5,_0x490809));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x3e')]=function(_0x195adc,_0x22a90e){return this[_0x2f72('0x25')](util['format'](_0x2f72('0x3f'),_0x195adc,_0x22a90e));};AGIChannel['prototype'][_0x2f72('0x40')]=function(_0x5407d9,_0x4319d2,_0x377fa9){_0x4319d2=_0x4319d2||this[_0x2f72('0x41')];_0x377fa9=_0x377fa9||0x1;this[_0x2f72('0x30')](_0x5407d9);this[_0x2f72('0x32')](_0x4319d2);this[_0x2f72('0x34')](_0x377fa9);return this['noop'](util[_0x2f72('0x2a')](_0x2f72('0x42'),_0x5407d9,_0x4319d2,_0x377fa9));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x43')]=function(_0xd18837){return this[_0x2f72('0x25')](util['format'](_0x2f72('0x44'),_0xd18837));};AGIChannel[_0x2f72('0x24')][_0x2f72('0x45')]=function(_0x5d9b42,_0x47b704,_0x9cadc7,_0x3a84c3,_0x20f572,_0x101acf){_0x47b704=_0x47b704||'wav';_0x9cadc7=_0x9cadc7||'';_0x3a84c3=_0x3a84c3===undefined?-0x1:_0x3a84c3==='-1'?-0x1:_0x3a84c3*0x3e8;_0x20f572=_0x20f572===undefined?'':'s='+_0x20f572;_0x101acf=_0x101acf?'BEEP':'';return this[_0x2f72('0x25')](util[_0x2f72('0x2a')](_0x2f72('0x46'),_0x5d9b42,_0x47b704,_0x9cadc7,_0x3a84c3,_0x101acf,_0x20f572));};AGIChannel['prototype'][_0x2f72('0x47')]=function(_0x497ea5,_0x5d9bed){_0x5d9bed=_0x5d9bed||'';return this['sendRequest'](util[_0x2f72('0x2a')](_0x2f72('0x48'),_0x497ea5,_0x5d9bed));};AGIChannel['prototype'][_0x2f72('0x49')]=function(_0x45d9bd){return this['exec']('AGI',_0x45d9bd);};AGIChannel[_0x2f72('0x24')][_0x2f72('0x4a')]=function(_0x4596a5){return this['exec']('WAIT',_0x4596a5);};AGIChannel[_0x2f72('0x24')][_0x2f72('0x19')]=function(_0xab713a,_0xa23924){this[_0x2f72('0x4b')](util[_0x2f72('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0xab713a['id'],_0xab713a[_0x2f72('0x4c')],_0xa23924));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2f72('0x4d')]=AGIChannel; \ No newline at end of file +var _0x9a3d=['SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','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','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','startsWith','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits'];(function(_0x313ea2,_0x4ce55e){var _0x1187cc=function(_0x32e5c3){while(--_0x32e5c3){_0x313ea2['push'](_0x313ea2['shift']());}};_0x1187cc(++_0x4ce55e);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x211ea1,_0x24b8af){_0x211ea1=_0x211ea1-0x0;var _0x3499e8=_0x9a3d[_0x211ea1];return _0x3499e8;};'use strict';var util=require('util');var _=require(_0xd9a3('0x0'));var EventEmitter=require(_0xd9a3('0x1'))[_0xd9a3('0x2')];var AGIReply=require(_0xd9a3('0x3'));var AGIError=require(_0xd9a3('0x4'));function AGIChannel(_0x1dc2c5){var _0x57aa8b=this,_0x1b8e05=new AGIReply(),_0xa3e167=![],_0x437f58={};EventEmitter[_0xd9a3('0x5')](_0x57aa8b);_0x1dc2c5['setEncoding'](_0xd9a3('0x6'));_0x1dc2c5[_0xd9a3('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1b8e05[_0xd9a3('0x8')](_0xd9a3('0x6'));_0x1b8e05['on'](_0xd9a3('0x9'),function(_0x1199b1){for(var _0x40d332 in _0x1199b1){_0x57aa8b[_0x40d332]=_0x1199b1[_0x40d332];}_0x57aa8b[_0xd9a3('0xa')]('ready');});_0x1b8e05['on'](_0xd9a3('0xb'),function(_0xa8d3ac){if(_0xa8d3ac[_0xd9a3('0xc')]()=='hangup'){_0x57aa8b[_0xd9a3('0xa')](_0xd9a3('0xd'));return;}if(_0xa8d3ac['substring'](0x0,0xb)==_0xd9a3('0xe')){_0xa3e167=!![];}if(_0xa3e167){_0x437f58['rx']+=_0xa8d3ac+'\x0a';if(_0xa8d3ac[_0xd9a3('0xf')](_0xd9a3('0x10'))!=-0x1){_0xa3e167=![];}}else{_0x437f58['rx']=_0xa8d3ac;}if(_0xa3e167){return;}if(typeof _0x437f58['cb']==_0xd9a3('0x11')){var _0x3af3d2=_0x437f58['rx'][_0xd9a3('0x12')](0x0,0x3),_0x2b8230=null,_0x334a67=null;_0x3af3d2=parseInt(_0x3af3d2);if(isNaN(_0x3af3d2)){_0x437f58['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3af3d2!=0xc8){_0x437f58['cb'](null,{'code':_0x3af3d2,'result':-0x1,'extra':'KO'});return;}_0x2b8230=_0x437f58['rx'][_0xd9a3('0x12')](0x4)[_0xd9a3('0x13')](_0xd9a3('0x14'),'');if(_0x2b8230[_0xd9a3('0x15')]('\x20')!=-0x1){_0x2b8230=_0x2b8230[_0xd9a3('0x16')](0x0,_0x2b8230[_0xd9a3('0x15')]('\x20'));}if(_[_0xd9a3('0x17')](_0x2b8230,'-1')){_0x2b8230=parseInt(_0x2b8230);}_0x334a67=_0x437f58['rx']['split']('\x20');if(_0x334a67[_0xd9a3('0x18')]==0x3){_0x334a67=_0x334a67[0x2]['substring'](0x1,_0x334a67[0x2]['length']-0x1);}else if(_0x334a67[_0xd9a3('0x18')]>0x3){var _0x4a1a5a=/\((.+)\)/;var _0x544e09=_0x437f58['rx'][_0xd9a3('0x19')](_0x4a1a5a);if(_0x544e09){_0x334a67=_0x544e09[0x1];}else{_0x334a67=null;}}else{_0x334a67=null;}_0x437f58['cb'](null,{'code':_0x3af3d2,'result':_0x2b8230,'extra':_0x334a67});}});_0x1dc2c5['on'](_0xd9a3('0x1a'),function(_0x545dd2){_0x57aa8b['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x545dd2['code']));});_0x1dc2c5['on'](_0xd9a3('0x1b'),function(){_0x57aa8b['emit'](_0xd9a3('0x1b'),new AGIError(_0xd9a3('0x1c')));});_0x1dc2c5['on']('timeout',function(){_0x57aa8b[_0xd9a3('0xa')](_0xd9a3('0x1d'),new AGIError(_0xd9a3('0x1e')));_0x1dc2c5[_0xd9a3('0x1f')]();});_0x1dc2c5[_0xd9a3('0x20')](_0x1b8e05);this[_0xd9a3('0x21')]=function(_0x14bafc,_0x59fee8){var _0x14bafc=_0x14bafc||'',_0x59fee8=typeof _0x59fee8==_0xd9a3('0x11')?_0x59fee8:new Function();_0x437f58={'tx':_0x14bafc,'rx':'','cb':_0x59fee8};_0x1dc2c5[_0xd9a3('0x22')](_0x14bafc+'\x0a');},this[_0xd9a3('0x1b')]=function(){_0x1dc2c5[_0xd9a3('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x24')]=function(_0x23d1fc){return this[_0xd9a3('0x21')][_0xd9a3('0x25')](this,_0x23d1fc);};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x26')]=function(){return this[_0xd9a3('0x24')]('ANSWER');};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x27')]=function(_0x1eb769,_0x58ea92,_0x2e0c3e){_0x1eb769=_0x1eb769===undefined?'beep':_0x1eb769;_0x58ea92=_0x58ea92===undefined?'5':_0x58ea92;_0x2e0c3e=_0x2e0c3e===undefined?'1':_0x2e0c3e;return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x29'),_0x1eb769,_0x58ea92*0x3e8,_0x2e0c3e));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x2a')]=function(_0x374222){_0x374222=_0x374222||_0xd9a3('0x2b');return this[_0xd9a3('0x24')](util['format'](_0xd9a3('0x2c'),_0x374222));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x2d')]=function(_0x5e8555,_0x1f564d){if(_[_0xd9a3('0x2e')](_0x1f564d)){return this['sendRequest'](util['format'](_0xd9a3('0x2f'),_0x5e8555,_0x1f564d[_0xd9a3('0x30')](',')));}return this[_0xd9a3('0x24')](util['format'](_0xd9a3('0x2f'),_0x5e8555,_0x1f564d));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x31')]=function(_0x35ffaf){return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')]('SET\x20CONTEXT\x20%s',_0x35ffaf));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x32')]=function(_0x10a2dd){return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x33'),_0x10a2dd));};AGIChannel['prototype'][_0xd9a3('0x34')]=function(_0x31bc82){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x31bc82));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0xd')]=function(){return this['sendRequest']('HANGUP');};AGIChannel['prototype'][_0xd9a3('0x35')]=function(_0x219fc2,_0x5e62d0){var _0x15ae5b=_[_0xd9a3('0x36')](_0x5e62d0)||_[_0xd9a3('0x37')](_0x5e62d0)?_0x5e62d0[_0xd9a3('0x38')]():_0x5e62d0;return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x39'),_0x219fc2,_0x15ae5b?_0x15ae5b[_0xd9a3('0x38')]()[_0xd9a3('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xd9a3('0x3a')]=function(_0x24ddfc,_0x7c4ba0){return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x3b'),_0x24ddfc,_0x7c4ba0));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x3c')]=function(_0x73ca52,_0xe0a174){return this['sendRequest'](util['format'](_0xd9a3('0x3d'),_0x73ca52,_0xe0a174));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x3e')]=function(_0x4cab7f,_0x4acc84){return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x3f'),_0x4cab7f,_0x4acc84));};AGIChannel[_0xd9a3('0x23')]['continueAt']=function(_0x53caf5,_0x449391,_0x2faa10){_0x449391=_0x449391||this[_0xd9a3('0x40')];_0x2faa10=_0x2faa10||0x1;this[_0xd9a3('0x31')](_0x53caf5);this[_0xd9a3('0x32')](_0x449391);this[_0xd9a3('0x34')](_0x2faa10);return this[_0xd9a3('0x2a')](util[_0xd9a3('0x28')]('GOTO\x20%s\x20%s\x20%s',_0x53caf5,_0x449391,_0x2faa10));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x41')]=function(_0x459421){return this[_0xd9a3('0x24')](util['format'](_0xd9a3('0x42'),_0x459421));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x43')]=function(_0x1acc96,_0x18a762,_0xe87d79,_0xda34c6,_0x15269a,_0x3553dd){_0x18a762=_0x18a762||_0xd9a3('0x44');_0xe87d79=_0xe87d79||'';_0xda34c6=_0xda34c6===undefined?-0x1:_0xda34c6==='-1'?-0x1:_0xda34c6*0x3e8;_0x15269a=_0x15269a===undefined?'':'s='+_0x15269a;_0x3553dd=_0x3553dd?_0xd9a3('0x45'):'';return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')](_0xd9a3('0x46'),_0x1acc96,_0x18a762,_0xe87d79,_0xda34c6,_0x3553dd,_0x15269a));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x47')]=function(_0x47f723,_0x22117a){_0x22117a=_0x22117a||'';return this[_0xd9a3('0x24')](util[_0xd9a3('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x47f723,_0x22117a));};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x48')]=function(_0x13304b){return this[_0xd9a3('0x2d')](_0xd9a3('0x49'),_0x13304b);};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x4a')]=function(_0x4b5b00){return this['exec'](_0xd9a3('0x4b'),_0x4b5b00);};AGIChannel[_0xd9a3('0x23')][_0xd9a3('0x1a')]=function(_0x1fb550,_0x292aeb){this[_0xd9a3('0x2a')](util[_0xd9a3('0x28')](_0xd9a3('0x4c'),_0x1fb550['id'],_0x1fb550[_0xd9a3('0x4d')],_0x292aeb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd9a3('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 3fb3502..f965b34 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 _0x70c4=['push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x538acc,_0x47e62){var _0x3b985a=function(_0x52b459){while(--_0x52b459){_0x538acc['push'](_0x538acc['shift']());}};_0x3b985a(++_0x47e62);}(_0x70c4,0x192));var _0x470c=function(_0x29e437,_0x1e5c5f){_0x29e437=_0x29e437-0x0;var _0x407104=_0x70c4[_0x29e437];return _0x407104;};'use strict';var util=require(_0x470c('0x0'));var error={'E_AGI_UNDEFINED':_0x470c('0x1'),'E_AGI_ARGUMENT_PORT':_0x470c('0x2'),'E_AGI_SERVER_ERROR':_0x470c('0x3'),'E_AGI_SERVER_CLOSE':_0x470c('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x470c('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x470c('0x6'),'E_AGI_SOCKET_ERROR':_0x470c('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x470c('0x8'),'E_AGI_COMMAND_EMPTY':_0x470c('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x470c('0xa')};function AGIError(_0x56c96a){var _0x56c96a=_0x56c96a||null,_0x49deaf=_0x49deaf||[],_0x1ea330=0x1,_0x7def2='';if(!error[_0x56c96a]){_0x56c96a=_0x470c('0xb');}_0x49deaf[_0x470c('0xc')](error[_0x56c96a]);while(arguments[_0x1ea330]){_0x49deaf['push'](arguments[_0x1ea330]);_0x1ea330++;}_0x7def2=util[_0x470c('0xd')][_0x470c('0xe')](util,_0x49deaf);this[_0x470c('0xf')]=_0x7def2;this[_0x470c('0x10')]=_0x56c96a;}module[_0x470c('0x11')]=AGIError; \ No newline at end of file +var _0xeeec=['util','Undefined\x20error.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports'];(function(_0x32b3c2,_0xe56fd){var _0x40a313=function(_0x51ba92){while(--_0x51ba92){_0x32b3c2['push'](_0x32b3c2['shift']());}};_0x40a313(++_0xe56fd);}(_0xeeec,0xd0));var _0xceee=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xeeec[_0x42bdad];return _0x122626;};'use strict';var util=require(_0xceee('0x0'));var error={'E_AGI_UNDEFINED':_0xceee('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xceee('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xceee('0x3'),'E_AGI_SOCKET_ERROR':_0xceee('0x4'),'E_AGI_SOCKET_CLOSE':_0xceee('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xceee('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xceee('0x7'),'E_AGI_IVR_ENTRY':_0xceee('0x8')};function AGIError(_0x5a8ca5){var _0x5a8ca5=_0x5a8ca5||null,_0x30c853=_0x30c853||[],_0xba34db=0x1,_0x1e0382='';if(!error[_0x5a8ca5]){_0x5a8ca5=_0xceee('0x9');}_0x30c853[_0xceee('0xa')](error[_0x5a8ca5]);while(arguments[_0xba34db]){_0x30c853[_0xceee('0xa')](arguments[_0xba34db]);_0xba34db++;}_0x1e0382=util[_0xceee('0xb')][_0xceee('0xc')](util,_0x30c853);this[_0xceee('0xd')]=_0x1e0382;this[_0xceee('0xe')]=_0x5a8ca5;}module[_0xceee('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index daa1c5f..8dfeb60 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 _0xe3ed=['length','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','no\x20edge/s\x20available','split'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xe3ed,0x1d5));var _0xde3e=function(_0xda863f,_0x4d7a85){_0xda863f=_0xda863f-0x0;var _0x2384d7=_0xe3ed[_0xda863f];return _0x2384d7;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xde3e('0x0'));var verticesWithRetry=[_0xde3e('0x1'),_0xde3e('0x2'),'getsecretdigits'];var Graph=function(){this[_0xde3e('0x3')]={};this[_0xde3e('0x4')]={};this[_0xde3e('0x5')]=0x0;};Graph[_0xde3e('0x6')][_0xde3e('0x7')]=function(_0x576bd1){this[_0xde3e('0x3')][_0x576bd1['id']]=_0x576bd1;this[_0xde3e('0x4')][_0x576bd1['id']]=[];};Graph[_0xde3e('0x6')]['addEdge']=function(_0x2d956c,_0x4f906b,_0x279509){this[_0xde3e('0x4')][_0x2d956c][_0xde3e('0x8')]({'target':_0x4f906b,'condition':_0x279509});this[_0xde3e('0x5')]+=0x1;};Graph[_0xde3e('0x6')][_0xde3e('0x9')]=function(){return _[_0xde3e('0x9')](this[_0xde3e('0x3')]);};Graph[_0xde3e('0x6')][_0xde3e('0xa')]=function(){return this[_0xde3e('0x5')];};Graph['prototype'][_0xde3e('0xb')]=function(_0xf9b8cc){return this['vertices'][_0xf9b8cc];};Graph['prototype'][_0xde3e('0xc')]=function(_0x4a805f,_0x25e86a){if(!this[_0xde3e('0x3')][_0x4a805f]){return logger[_0xde3e('0xd')]('no\x20vertex\x20found');}var _0x1cf411=_0x25e86a(this['vertices'][_0x4a805f]);if(!_0x1cf411){return logger[_0xde3e('0xd')](_0xde3e('0xe'));}if(this[_0xde3e('0x4')][_0x4a805f]['length']===0x0){return logger[_0xde3e('0xd')](_0xde3e('0xf'));}for(var _0x6a6d17=0x0,_0x355b3c=[],_0x348661=![];_0x6a6d17\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','lodash','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','value','catch','createSquareReport','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','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','start','clear','vertex','gotoc','context','extension','priority','response','code','result'];(function(_0x52fc68,_0x179325){var _0x391c16=function(_0x1e8ee){while(--_0x1e8ee){_0x52fc68['push'](_0x52fc68['shift']());}};_0x391c16(++_0x179325);}(_0xe94a,0x6b));var _0xae94=function(_0x43b487,_0x21893a){_0x43b487=_0x43b487-0x0;var _0x2f707a=_0xe94a[_0x43b487];return _0x2f707a;};'use strict';var parser=require('xml2json');var _=require(_0xae94('0x0'));var syncho=require('syncho');var util=require(_0xae94('0x1'));var moment=require(_0xae94('0x2'));var config=require(_0xae94('0x3'));var logger=require(_0xae94('0x4'))(_0xae94('0x5'));var utilLicense=require(_0xae94('0x6'));var rpc=require(_0xae94('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0xae94('0x8'));var Vertices=require(_0xae94('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xae94('0x5')]=_[_0xae94('0xa')](config[_0xae94('0x5')],{'ip':_0xae94('0xb'),'port':0x11dd});function connectionHandler(_0x209734){process[_0xae94('0xc')](function(){syncho(function(){try{setChannelVariables(_0x209734);agiHandler(_0x209734);}catch(_0xaa5d80){logger[_0xae94('0xd')](_0xaa5d80['stack']);}});});}function listeningHandler(){console[_0xae94('0xe')](_0xae94('0xf'),config[_0xae94('0x5')]['port']);logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x12'),config['agi']['ip'],config[_0xae94('0x5')][_0xae94('0x13')]));}function errorHandler(_0x1aeba8){if(_0x1aeba8&&_0x1aeba8[_0xae94('0x14')]&&_0x1aeba8[_0xae94('0x15')]){logger[_0xae94('0xd')](util[_0xae94('0x11')](_0xae94('0x16'),_0x1aeba8[_0xae94('0x14')],_0x1aeba8['message']));}else{logger[_0xae94('0xd')](util['format'](_0xae94('0x17'),_0x1aeba8[_0xae94('0x18')]));}}function closeHandler(){logger['info'](util[_0xae94('0x11')](_0xae94('0x19'),this[_0xae94('0x1a')],this[_0xae94('0x1b')],this[_0xae94('0x1c')],this[_0xae94('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x588563){logger[_0xae94('0xd')](_0x588563[_0xae94('0x18')]);}}function timeoutHandler(){logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x1e'),this['arg_1'],this[_0xae94('0x1b')],this['callerid'],this['dnid'],this[_0xae94('0x1f')]));}function hangupHandler(){logger[_0xae94('0x10')](util['format'](_0xae94('0x20'),this['arg_1'],this[_0xae94('0x1b')],this[_0xae94('0x1c')],this[_0xae94('0x1d')],this[_0xae94('0x1f')]));this['evtHangup']=!![];}function getRoot(_0xe396fa){return parser[_0xae94('0x21')](_0xe396fa,{'object':!![]})[_0xae94('0x22')][_0xae94('0x23')];}function addVertex(_0x25d1ff,_0x5b447d,_0x2d638e){_0x5b447d[_0xae94('0x24')]=_0x2d638e;if(_0x5b447d[_0xae94('0x25')]('retry')){_0x5b447d[_0xae94('0x26')]=parseInt(_0x5b447d[_0xae94('0x27')],0xa);}_0x25d1ff[_0xae94('0x28')](_[_0xae94('0x29')](_0x5b447d,_0xae94('0x2a')));}function initGraph(_0x7bdf4e,_0x491947){var _0x2192b9=new Graph();for(var _0x3a7d69 in _0x7bdf4e){if(_0x7bdf4e[_0xae94('0x25')](_0x3a7d69)){if(_[_0xae94('0x2b')](_0x7bdf4e[_0x3a7d69])){for(var _0xa389b5=0x0;_0xa389b5<_0x7bdf4e[_0x3a7d69][_0xae94('0x2c')];_0xa389b5+=0x1){addVertex(_0x2192b9,_0x7bdf4e[_0x3a7d69][_0xa389b5],_0x3a7d69);}}else{addVertex(_0x2192b9,_0x7bdf4e[_0x3a7d69],_0x3a7d69);}}}for(var _0x34a292=0x0;_0x34a292<_0x491947[_0xae94('0x2c')];_0x34a292+=0x1){if(_0x491947[_0x34a292][_0xae94('0x2d')]&&_0x491947[_0x34a292][_0xae94('0x2e')]){_0x2192b9['addEdge'](_0x491947[_0x34a292][_0xae94('0x2d')],_0x491947[_0x34a292][_0xae94('0x2e')],_0x491947[_0x34a292][_0xae94('0x2f')]);}}return _0x2192b9;}function getSquareProject(_0x42ac7d,_0x817d71){rpc['getSquareProject'](_0x42ac7d)['then'](function(_0x50f594){_0x817d71(null,_0x50f594);})[_0xae94('0x30')](function(_0x3eb0ee){_0x817d71(null,_0x3eb0ee);});}function createSquareReport(_0x126c34,_0x5c2b44){rpc[_0xae94('0x31')](_0x126c34)['then'](function(_0x504623){if(_0x5c2b44){_0x5c2b44(null,_0x504623);}})[_0xae94('0x30')](function(_0x22f11f){if(_0x5c2b44){_0x5c2b44(null,_0x22f11f);}});}function setChannelVariables(_0x3d791d){for(var _0x1a2937 in _0x3d791d){if(_0x3d791d[_0xae94('0x25')](_0x1a2937)){if(_0x1a2937['indexOf'](_0xae94('0x32'))===0x0){_0x3d791d[_0x1a2937['substring'](0x4)]=_0x3d791d[_0x1a2937];delete _0x3d791d[_0x1a2937];}}}}function getLogFromObject(_0x3d4671){return util[_0xae94('0x33')](_0x3d4671,{'showHidden':![],'depth':null});}function agiHandler(_0x3026e7){var _0x582c1e,_0x2878a6,_0x295b17,_0x100af7,_0x32c272;logger[_0xae94('0x34')](_0xae94('0x35'),JSON[_0xae94('0x36')](_0x3026e7,null,0x2));logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x37'),_0x3026e7[_0xae94('0x1a')],_0x3026e7[_0xae94('0x1b')],_0x3026e7[_0xae94('0x1c')],_0x3026e7[_0xae94('0x1d')],_0x3026e7[_0xae94('0x1f')]));_0x3026e7['on'](_0xae94('0xd'),errorHandler);_0x3026e7['on'](_0xae94('0x38'),closeHandler);_0x3026e7['on'](_0xae94('0x39'),timeoutHandler);_0x3026e7[_0xae94('0x3a')]=![];_0x3026e7['on']('hangup',hangupHandler);var _0x312933=getSquareProject[_0xae94('0x3b')](null,_0x3026e7[_0xae94('0x1a')]);if(_0x312933){if(_0x312933['production']){_0x582c1e=getRoot(_0x312933[_0xae94('0x3c')]);if(_0x582c1e&&_0x582c1e['start']){logger['debug'](_0xae94('0x23'),JSON['stringify'](_0x582c1e,null,0x2));_0x3026e7[_0xae94('0x3d')]=moment()['format'](_0xae94('0x3e'));_0x2878a6=initGraph(_[_0xae94('0x29')](_0x582c1e,_0xae94('0x2a')),_0x582c1e[_0xae94('0x2a')]);_0x295b17=new Vertices(_0x3026e7,rpc,mailRpc);logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x3f'),_0x3026e7[_0xae94('0x1a')],_0x3026e7[_0xae94('0x1b')],_0x3026e7[_0xae94('0x1c')],_0x3026e7[_0xae94('0x1d')],_0x3026e7['uniqueid']));_0x2878a6[_0xae94('0x40')](_0x582c1e[_0xae94('0x41')]['id'],function(_0xf5e7df){try{_0xf5e7df=_0x295b17[_0xae94('0x42')](_0xf5e7df);logger[_0xae94('0x34')](_0xae94('0x43'),JSON[_0xae94('0x36')](_0xf5e7df,null,0x2));if(_0xf5e7df[_0xae94('0x24')]===_0xae94('0x44')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3026e7[_0xae94('0x45')]=_0xf5e7df[_0xae94('0x45')]||_0x3026e7[_0xae94('0x45')];_0x3026e7['extension']=_0xf5e7df[_0xae94('0x46')];_0x3026e7[_0xae94('0x47')]=_0xf5e7df[_0xae94('0x47')]?_0xf5e7df[_0xae94('0x47')]-0x1:0x1;return null;}else if(_0xf5e7df&&_0x295b17[_0xf5e7df[_0xae94('0x24')]]){_0x32c272=_0x295b17[_0xf5e7df[_0xae94('0x24')]](_0xf5e7df);logger['info'](_0xae94('0x48'),JSON[_0xae94('0x36')](_0x32c272,null,0x2));if(_0x32c272&&_0x32c272[_0xae94('0x49')]===AGI_CODE_SUCCESS&&_0x32c272[_0xae94('0x4a')]!==AGI_RESULT_ERROR&&!_0x3026e7[_0xae94('0x3a')]){logger[_0xae94('0x34')]('response',getLogFromObject(_0x32c272));return _[_0xae94('0x4b')](_0x32c272[_0xae94('0x4a')])?null:_0x32c272['result'][_0xae94('0x4c')]();}else{logger[_0xae94('0xd')](_0xae94('0x48'),getLogFromObject(_0x32c272));return null;}}else{logger[_0xae94('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x36a42b){logger[_0xae94('0xd')](_0x36a42b[_0xae94('0x18')]);return null;}});if(_0x582c1e[_0xae94('0x4d')]){logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x4e'),_0x3026e7[_0xae94('0x1a')],_0x3026e7[_0xae94('0x1b')],_0x3026e7[_0xae94('0x1c')],_0x3026e7[_0xae94('0x1d')],_0x3026e7[_0xae94('0x1f')]));_0x2878a6['traverseBFS'](_0x582c1e[_0xae94('0x4d')]['id'],function(_0x5e6d03){try{_0x5e6d03=_0x295b17[_0xae94('0x42')](_0x5e6d03);logger[_0xae94('0x34')](_0xae94('0x43'),JSON['stringify'](_0x5e6d03,null,0x2));if(_0x5e6d03&&_0x295b17[_0x5e6d03[_0xae94('0x24')]]){_0x32c272=_0x295b17[_0x5e6d03[_0xae94('0x24')]](_0x5e6d03);if(_0x32c272){logger[_0xae94('0x34')](_0xae94('0x48'),getLogFromObject(_0x32c272));return _[_0xae94('0x4b')](_0x32c272['result'])?null:_0x32c272[_0xae94('0x4a')][_0xae94('0x4c')]();}else{logger[_0xae94('0xd')](_0xae94('0x48'),getLogFromObject(_0x32c272));return null;}}else{logger[_0xae94('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x451a15){logger[_0xae94('0xd')](_0x451a15[_0xae94('0x18')]);return null;}});}logger[_0xae94('0x10')](util[_0xae94('0x11')](_0xae94('0x4f'),_0x3026e7[_0xae94('0x1a')],_0x3026e7[_0xae94('0x1b')],_0x3026e7[_0xae94('0x1c')],_0x3026e7['dnid'],_0x3026e7['uniqueid']));logger['info'](util[_0xae94('0x11')](_0xae94('0x50'),_0x3026e7[_0xae94('0x45')],_0x3026e7['extension'],parseInt(_0x3026e7[_0xae94('0x47')],0xa)+0x1));_0x3026e7[_0xae94('0x51')](_0x3026e7[_0xae94('0x45')],_0x3026e7['extension'],parseInt(_0x3026e7[_0xae94('0x47')],0xa)+0x1);_0x3026e7['close']();}}else{logger[_0xae94('0xd')](util[_0xae94('0x11')]('Project\x20%s\x20not\x20published',_0x3026e7[_0xae94('0x1a')]));_0x3026e7[_0xae94('0x51')](_0x3026e7[_0xae94('0x45')],_0x3026e7['extension'],parseInt(_0x3026e7[_0xae94('0x47')],0xa)+0x1);_0x3026e7['close']();}}else{logger[_0xae94('0xd')](util[_0xae94('0x11')](_0xae94('0x52'),_0x3026e7['arg_1']));_0x3026e7[_0xae94('0x51')](_0x3026e7[_0xae94('0x45')],_0x3026e7[_0xae94('0x46')],parseInt(_0x3026e7[_0xae94('0x47')],0xa)+0x1);_0x3026e7[_0xae94('0x38')]();}}function main(){var _0x50b8f1;return utilLicense[_0xae94('0x53')]()[_0xae94('0x54')](function(_0x3b5469){if(_0x3b5469){if(_0x3b5469[_0xae94('0x55')]){if(_0x3b5469['callysquare']&&_0x3b5469['callysquare']>0x0){logger[_0xae94('0x10')](util[_0xae94('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3b5469[_0xae94('0x56')]));_0x50b8f1=_0x3b5469[_0xae94('0x56')];}else{logger[_0xae94('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0xae94('0x57'));_0x50b8f1=-0x1;}}})[_0xae94('0x30')](function(_0x2c9ae6){logger[_0xae94('0xd')](_0xae94('0x58'),_0x2c9ae6[_0xae94('0x18')]);})[_0xae94('0x4d')](function(){var _0x16aa12=require(_0xae94('0x59'))(config[_0xae94('0x5')][_0xae94('0x13')],config[_0xae94('0x5')]['ip'],_0x50b8f1);_0x16aa12['on'](_0xae94('0xd'),errorHandler);_0x16aa12['on'](_0xae94('0x5a'),listeningHandler);_0x16aa12['on']('connection',connectionHandler);_0x16aa12['on'](_0xae94('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0x2b3d=['then','createSquareReport','catch','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','timeout','hangup','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','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','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','error','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[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','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','getSquareProject'];(function(_0x3d8cbb,_0x240fb6){var _0x4d10de=function(_0x58bd12){while(--_0x58bd12){_0x3d8cbb['push'](_0x3d8cbb['shift']());}};_0x4d10de(++_0x240fb6);}(_0x2b3d,0x1f3));var _0xd2b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2b3d[_0x4a9fb1];return _0x348672;};'use strict';var parser=require(_0xd2b3('0x0'));var _=require(_0xd2b3('0x1'));var syncho=require(_0xd2b3('0x2'));var util=require(_0xd2b3('0x3'));var moment=require(_0xd2b3('0x4'));var config=require(_0xd2b3('0x5'));var logger=require(_0xd2b3('0x6'))(_0xd2b3('0x7'));var utilLicense=require(_0xd2b3('0x8'));var rpc=require(_0xd2b3('0x9'));var mailRpc=require(_0xd2b3('0xa'));var Graph=require(_0xd2b3('0xb'));var Vertices=require(_0xd2b3('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd2b3('0x7')]=_['defaults'](config['agi'],{'ip':_0xd2b3('0xd'),'port':0x11dd});function connectionHandler(_0x46579d){process[_0xd2b3('0xe')](function(){syncho(function(){try{setChannelVariables(_0x46579d);agiHandler(_0x46579d);}catch(_0x168022){logger['error'](_0x168022[_0xd2b3('0xf')]);}});});}function listeningHandler(){console[_0xd2b3('0x10')](_0xd2b3('0x11'),config[_0xd2b3('0x7')][_0xd2b3('0x12')]);logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xd2b3('0x7')]['ip'],config[_0xd2b3('0x7')]['port']));}function errorHandler(_0x3e7874){if(_0x3e7874&&_0x3e7874['name']&&_0x3e7874[_0xd2b3('0x15')]){logger[_0xd2b3('0x16')](util[_0xd2b3('0x14')]('[%s]\x20%s',_0x3e7874['name'],_0x3e7874['message']));}else{logger[_0xd2b3('0x16')](util['format'](_0xd2b3('0x17'),_0x3e7874['stack']));}}function closeHandler(){logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')](_0xd2b3('0x18'),this['arg_1'],this['calleridname'],this[_0xd2b3('0x19')],this[_0xd2b3('0x1a')],this[_0xd2b3('0x1b')]));try{createSquareReport(this);}catch(_0xb04ab4){logger['error'](_0xb04ab4[_0xd2b3('0xf')]);}}function timeoutHandler(){logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')](_0xd2b3('0x1c'),this['arg_1'],this[_0xd2b3('0x1d')],this[_0xd2b3('0x19')],this[_0xd2b3('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')](_0xd2b3('0x1e'),this['arg_1'],this[_0xd2b3('0x1d')],this[_0xd2b3('0x19')],this['dnid'],this[_0xd2b3('0x1b')]));this[_0xd2b3('0x1f')]=!![];}function getRoot(_0x223fed){return parser[_0xd2b3('0x20')](_0x223fed,{'object':!![]})[_0xd2b3('0x21')][_0xd2b3('0x22')];}function addVertex(_0x187502,_0x23a27e,_0x17f1bb){_0x23a27e[_0xd2b3('0x23')]=_0x17f1bb;if(_0x23a27e[_0xd2b3('0x24')]('retry')){_0x23a27e[_0xd2b3('0x25')]=parseInt(_0x23a27e['retry'],0xa);}_0x187502[_0xd2b3('0x26')](_[_0xd2b3('0x27')](_0x23a27e,_0xd2b3('0x28')));}function initGraph(_0x2080df,_0x1b1f0b){var _0x21d4df=new Graph();for(var _0x4be7a in _0x2080df){if(_0x2080df[_0xd2b3('0x24')](_0x4be7a)){if(_[_0xd2b3('0x29')](_0x2080df[_0x4be7a])){for(var _0x3d8c42=0x0;_0x3d8c42<_0x2080df[_0x4be7a]['length'];_0x3d8c42+=0x1){addVertex(_0x21d4df,_0x2080df[_0x4be7a][_0x3d8c42],_0x4be7a);}}else{addVertex(_0x21d4df,_0x2080df[_0x4be7a],_0x4be7a);}}}for(var _0x4ded56=0x0;_0x4ded56<_0x1b1f0b[_0xd2b3('0x2a')];_0x4ded56+=0x1){if(_0x1b1f0b[_0x4ded56]['source']&&_0x1b1f0b[_0x4ded56][_0xd2b3('0x2b')]){_0x21d4df[_0xd2b3('0x2c')](_0x1b1f0b[_0x4ded56][_0xd2b3('0x2d')],_0x1b1f0b[_0x4ded56][_0xd2b3('0x2b')],_0x1b1f0b[_0x4ded56]['value']);}}return _0x21d4df;}function getSquareProject(_0x165937,_0x13d10d){rpc[_0xd2b3('0x2e')](_0x165937)[_0xd2b3('0x2f')](function(_0x55f95c){_0x13d10d(null,_0x55f95c);})['catch'](function(_0x4fedc7){_0x13d10d(null,_0x4fedc7);});}function createSquareReport(_0x535f26,_0x178acf){rpc[_0xd2b3('0x30')](_0x535f26)[_0xd2b3('0x2f')](function(_0x26955d){if(_0x178acf){_0x178acf(null,_0x26955d);}})[_0xd2b3('0x31')](function(_0x3b2e03){if(_0x178acf){_0x178acf(null,_0x3b2e03);}});}function setChannelVariables(_0x1ea972){for(var _0x5b6a8d in _0x1ea972){if(_0x1ea972[_0xd2b3('0x24')](_0x5b6a8d)){if(_0x5b6a8d[_0xd2b3('0x32')](_0xd2b3('0x33'))===0x0){_0x1ea972[_0x5b6a8d[_0xd2b3('0x34')](0x4)]=_0x1ea972[_0x5b6a8d];delete _0x1ea972[_0x5b6a8d];}}}}function getLogFromObject(_0x3e0aaf){return util['inspect'](_0x3e0aaf,{'showHidden':![],'depth':null});}function agiHandler(_0x1e157c){var _0x14dd86,_0x528c60,_0x4cadb8,_0x1733ee,_0x106544;logger['debug'](_0xd2b3('0x35'),JSON[_0xd2b3('0x36')](_0x1e157c,null,0x2));logger[_0xd2b3('0x13')](util['format'](_0xd2b3('0x37'),_0x1e157c[_0xd2b3('0x38')],_0x1e157c[_0xd2b3('0x1d')],_0x1e157c[_0xd2b3('0x19')],_0x1e157c[_0xd2b3('0x1a')],_0x1e157c[_0xd2b3('0x1b')]));_0x1e157c['on'](_0xd2b3('0x16'),errorHandler);_0x1e157c['on'](_0xd2b3('0x39'),closeHandler);_0x1e157c['on'](_0xd2b3('0x3a'),timeoutHandler);_0x1e157c[_0xd2b3('0x1f')]=![];_0x1e157c['on'](_0xd2b3('0x3b'),hangupHandler);var _0x5779bd=getSquareProject['sync'](null,_0x1e157c[_0xd2b3('0x38')]);if(_0x5779bd){if(_0x5779bd['production']){_0x14dd86=getRoot(_0x5779bd[_0xd2b3('0x3c')]);if(_0x14dd86&&_0x14dd86[_0xd2b3('0x3d')]){logger[_0xd2b3('0x3e')](_0xd2b3('0x22'),JSON[_0xd2b3('0x36')](_0x14dd86,null,0x2));_0x1e157c['joinAt']=moment()[_0xd2b3('0x14')](_0xd2b3('0x3f'));_0x528c60=initGraph(_[_0xd2b3('0x27')](_0x14dd86,_0xd2b3('0x28')),_0x14dd86[_0xd2b3('0x28')]);_0x4cadb8=new Vertices(_0x1e157c,rpc,mailRpc);logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1e157c[_0xd2b3('0x38')],_0x1e157c[_0xd2b3('0x1d')],_0x1e157c[_0xd2b3('0x19')],_0x1e157c[_0xd2b3('0x1a')],_0x1e157c['uniqueid']));_0x528c60[_0xd2b3('0x40')](_0x14dd86[_0xd2b3('0x3d')]['id'],function(_0x4c01ff){try{_0x4c01ff=_0x4cadb8[_0xd2b3('0x41')](_0x4c01ff);logger['debug'](_0xd2b3('0x42'),JSON[_0xd2b3('0x36')](_0x4c01ff,null,0x2));if(_0x4c01ff[_0xd2b3('0x23')]===_0xd2b3('0x43')){logger[_0xd2b3('0x13')](_0xd2b3('0x44'));_0x1e157c[_0xd2b3('0x45')]=_0x4c01ff[_0xd2b3('0x45')]||_0x1e157c[_0xd2b3('0x45')];_0x1e157c['extension']=_0x4c01ff[_0xd2b3('0x46')];_0x1e157c[_0xd2b3('0x47')]=_0x4c01ff[_0xd2b3('0x47')]?_0x4c01ff[_0xd2b3('0x47')]-0x1:0x1;return null;}else if(_0x4c01ff&&_0x4cadb8[_0x4c01ff[_0xd2b3('0x23')]]){_0x106544=_0x4cadb8[_0x4c01ff[_0xd2b3('0x23')]](_0x4c01ff);logger[_0xd2b3('0x13')](_0xd2b3('0x48'),JSON[_0xd2b3('0x36')](_0x106544,null,0x2));if(_0x106544&&_0x106544[_0xd2b3('0x49')]===AGI_CODE_SUCCESS&&_0x106544['result']!==AGI_RESULT_ERROR&&!_0x1e157c[_0xd2b3('0x1f')]){logger['debug'](_0xd2b3('0x48'),getLogFromObject(_0x106544));return _['isUndefined'](_0x106544[_0xd2b3('0x4a')])?null:_0x106544['result'][_0xd2b3('0x4b')]();}else{logger[_0xd2b3('0x16')]('response',getLogFromObject(_0x106544));return null;}}else{logger['error'](_0xd2b3('0x4c'));return null;}}catch(_0x531199){logger[_0xd2b3('0x16')](_0x531199['stack']);return null;}});if(_0x14dd86[_0xd2b3('0x4d')]){logger['info'](util[_0xd2b3('0x14')](_0xd2b3('0x4e'),_0x1e157c[_0xd2b3('0x38')],_0x1e157c[_0xd2b3('0x1d')],_0x1e157c[_0xd2b3('0x19')],_0x1e157c[_0xd2b3('0x1a')],_0x1e157c[_0xd2b3('0x1b')]));_0x528c60[_0xd2b3('0x40')](_0x14dd86[_0xd2b3('0x4d')]['id'],function(_0xcaac54){try{_0xcaac54=_0x4cadb8[_0xd2b3('0x41')](_0xcaac54);logger[_0xd2b3('0x3e')]('vertex',JSON['stringify'](_0xcaac54,null,0x2));if(_0xcaac54&&_0x4cadb8[_0xcaac54[_0xd2b3('0x23')]]){_0x106544=_0x4cadb8[_0xcaac54[_0xd2b3('0x23')]](_0xcaac54);if(_0x106544){logger[_0xd2b3('0x3e')](_0xd2b3('0x48'),getLogFromObject(_0x106544));return _[_0xd2b3('0x4f')](_0x106544[_0xd2b3('0x4a')])?null:_0x106544['result'][_0xd2b3('0x4b')]();}else{logger[_0xd2b3('0x16')](_0xd2b3('0x48'),getLogFromObject(_0x106544));return null;}}else{logger[_0xd2b3('0x16')](_0xd2b3('0x4c'));return null;}}catch(_0x2701f8){logger[_0xd2b3('0x16')](_0x2701f8[_0xd2b3('0xf')]);return null;}});}logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1e157c[_0xd2b3('0x38')],_0x1e157c[_0xd2b3('0x1d')],_0x1e157c[_0xd2b3('0x19')],_0x1e157c[_0xd2b3('0x1a')],_0x1e157c[_0xd2b3('0x1b')]));logger[_0xd2b3('0x13')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1e157c[_0xd2b3('0x45')],_0x1e157c[_0xd2b3('0x46')],parseInt(_0x1e157c['priority'],0xa)+0x1));_0x1e157c[_0xd2b3('0x50')](_0x1e157c[_0xd2b3('0x45')],_0x1e157c[_0xd2b3('0x46')],parseInt(_0x1e157c[_0xd2b3('0x47')],0xa)+0x1);_0x1e157c['close']();}}else{logger[_0xd2b3('0x16')](util[_0xd2b3('0x14')](_0xd2b3('0x51'),_0x1e157c[_0xd2b3('0x38')]));_0x1e157c['continueAt'](_0x1e157c[_0xd2b3('0x45')],_0x1e157c[_0xd2b3('0x46')],parseInt(_0x1e157c[_0xd2b3('0x47')],0xa)+0x1);_0x1e157c['close']();}}else{logger[_0xd2b3('0x16')](util['format']('Project\x20%s\x20not\x20found',_0x1e157c['arg_1']));_0x1e157c[_0xd2b3('0x50')](_0x1e157c[_0xd2b3('0x45')],_0x1e157c[_0xd2b3('0x46')],parseInt(_0x1e157c[_0xd2b3('0x47')],0xa)+0x1);_0x1e157c['close']();}}function main(){var _0x5b5dff;return utilLicense[_0xd2b3('0x52')]()[_0xd2b3('0x2f')](function(_0xddfe4){if(_0xddfe4){if(_0xddfe4[_0xd2b3('0x53')]){if(_0xddfe4[_0xd2b3('0x54')]&&_0xddfe4['callysquare']>0x0){logger[_0xd2b3('0x13')](util[_0xd2b3('0x14')](_0xd2b3('0x55'),_0xddfe4[_0xd2b3('0x54')]));_0x5b5dff=_0xddfe4['callysquare'];}else{logger[_0xd2b3('0x13')](_0xd2b3('0x56'));}}else{logger[_0xd2b3('0x13')](_0xd2b3('0x57'));_0x5b5dff=-0x1;}}})[_0xd2b3('0x31')](function(_0x37d56e){logger['error'](_0xd2b3('0x58'),_0x37d56e[_0xd2b3('0xf')]);})['finally'](function(){var _0xa96bb5=require(_0xd2b3('0x59'))(config[_0xd2b3('0x7')]['port'],config[_0xd2b3('0x7')]['ip'],_0x5b5dff);_0xa96bb5['on'](_0xd2b3('0x16'),errorHandler);_0xa96bb5['on']('listening',listeningHandler);_0xa96bb5['on'](_0xd2b3('0x5a'),connectionHandler);_0xa96bb5['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 c76f239..ad94fa5 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 _0x5f49=['bluebird','jayson/promise','client','http','request','then','error','catch','sendMailMessage','SendMail'];(function(_0x29e2ad,_0x588e0a){var _0x5b3db0=function(_0x47e607){while(--_0x47e607){_0x29e2ad['push'](_0x29e2ad['shift']());}};_0x5b3db0(++_0x588e0a);}(_0x5f49,0x17c));var _0x95f4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5f49[_0x24061a];return _0x82054e;};'use strict';var BPromise=require(_0x95f4('0x0'));var jayson=require(_0x95f4('0x1'));var client=jayson[_0x95f4('0x2')][_0x95f4('0x3')]({'port':0x232b});function request(_0x58b804,_0x4fefdf){return new BPromise(function(_0x28863c,_0x3b4c40){return client[_0x95f4('0x4')](_0x58b804,_0x4fefdf)[_0x95f4('0x5')](function(_0x23fc5a){if(_0x23fc5a[_0x95f4('0x6')]){return _0x3b4c40(_0x23fc5a[_0x95f4('0x6')]['message']);}else{return _0x28863c(_0x23fc5a['result']);}})[_0x95f4('0x7')](function(_0xde661c){return _0x3b4c40(_0xde661c);});});}exports[_0x95f4('0x8')]=function(_0x5a3e24,_0x2aef6b){return request(_0x95f4('0x9'),{'account':_0x5a3e24,'message':_0x2aef6b});}; \ No newline at end of file +var _0x73f0=['http','error','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x5f558c,_0x9e6aac){var _0x1bd8f1=function(_0x3fa18f){while(--_0x3fa18f){_0x5f558c['push'](_0x5f558c['shift']());}};_0x1bd8f1(++_0x9e6aac);}(_0x73f0,0x65));var _0x073f=function(_0x531e8e,_0x28df57){_0x531e8e=_0x531e8e-0x0;var _0x42b46f=_0x73f0[_0x531e8e];return _0x42b46f;};'use strict';var BPromise=require(_0x073f('0x0'));var jayson=require(_0x073f('0x1'));var client=jayson[_0x073f('0x2')][_0x073f('0x3')]({'port':0x232b});function request(_0x5a0baf,_0x32c9f3){return new BPromise(function(_0x2a754e,_0x1cf32d){return client['request'](_0x5a0baf,_0x32c9f3)['then'](function(_0x3ce6ab){if(_0x3ce6ab[_0x073f('0x4')]){return _0x1cf32d(_0x3ce6ab[_0x073f('0x4')]['message']);}else{return _0x2a754e(_0x3ce6ab[_0x073f('0x5')]);}})['catch'](function(_0x49dc83){return _0x1cf32d(_0x49dc83);});});}exports[_0x073f('0x6')]=function(_0x158073,_0x5e0b67){return request(_0x073f('0x7'),{'account':_0x158073,'message':_0x5e0b67});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 55c2b4d..15c4cce 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 _0xb941=['stream','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','substring','split','indexOf','slice','trim','emit','line','length','exports','util'];(function(_0x2bca4,_0x1cab34){var _0x3363fd=function(_0x58ab86){while(--_0x58ab86){_0x2bca4['push'](_0x2bca4['shift']());}};_0x3363fd(++_0x1cab34);}(_0xb941,0x1ec));var _0x1b94=function(_0x3ef7de,_0x518ef8){_0x3ef7de=_0x3ef7de-0x0;var _0x37929b=_0xb941[_0x3ef7de];return _0x37929b;};'use strict';var util=require(_0x1b94('0x0'));var Transform=require(_0x1b94('0x1'))['Transform'];function AGIReply(_0x25f590){Transform[_0x1b94('0x2')](this,_0x25f590);this['_localBuffer']='';this[_0x1b94('0x3')]=![];}util[_0x1b94('0x4')](AGIReply,Transform);AGIReply[_0x1b94('0x5')]['_transform']=function(_0x5d29a8,_0x4f419d,_0x442dbe){var _0x4638ac='\x0a',_0x152ac8=['\x0a\x0a',_0x1b94('0x6')],_0x11e377=-0x1,_0x47de06=-0x1,_0x33b924='',_0x458bb7=0x0,_0x98afd='',_0xace67b='';this[_0x1b94('0x7')]+=_0x5d29a8['toString']();_0x98afd=this[_0x1b94('0x7')];if(!this['_inBody']){_0x458bb7=0x0;while(_0x152ac8[_0x458bb7]){while((_0x47de06=_0x98afd['indexOf'](_0x152ac8[_0x458bb7]))!=-0x1){_0x33b924=_0x152ac8[_0x458bb7];_0xace67b=_0x98afd[_0x1b94('0x8')](0x0,_0x47de06);_0x98afd=_0x98afd[_0x1b94('0x8')](_0x47de06+_0x33b924['length']);var _0x478d85=_0xace67b[_0x1b94('0x9')](_0x4638ac),_0x13121e=0x0,_0x2c6614={},_0x42bd8f='',_0x3a0cce='',_0x22f44d=-0x1;while(_0x478d85[_0x13121e]){_0x22f44d=_0x478d85[_0x13121e][_0x1b94('0xa')](':');if(_0x22f44d!=-0x1){_0x42bd8f=_0x478d85[_0x13121e][_0x1b94('0xb')](0x0,_0x22f44d)['trim']();_0x3a0cce=_0x478d85[_0x13121e]['slice'](_0x22f44d+0x1)[_0x1b94('0xc')]();if(_0x42bd8f['length']>0x0){_0x2c6614[_0x42bd8f]=_0x3a0cce;}}else{}_0x13121e++;}this[_0x1b94('0xd')]('headers',_0x2c6614);this[_0x1b94('0x3')]=!![];}_0x458bb7++;}this[_0x1b94('0x7')]=_0x98afd;}else{while((_0x11e377=_0x98afd['indexOf'](_0x4638ac))!=-0x1){_0xace67b=_0x98afd[_0x1b94('0x8')](0x0,_0x11e377);this[_0x1b94('0xd')](_0x1b94('0xe'),_0xace67b);_0x98afd=_0x98afd[_0x1b94('0x8')](_0x11e377+_0x4638ac[_0x1b94('0xf')]);}this[_0x1b94('0x7')]=_0x98afd;}_0x442dbe();};module[_0x1b94('0x10')]=AGIReply; \ No newline at end of file +var _0x6cfc=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','slice','trim','length','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','prototype'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x6cfc,0x14a));var _0xc6cf=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x6cfc[_0x276468];return _0x36dc3a;};'use strict';var util=require('util');var Transform=require(_0xc6cf('0x0'))[_0xc6cf('0x1')];function AGIReply(_0x30c69e){Transform[_0xc6cf('0x2')](this,_0x30c69e);this[_0xc6cf('0x3')]='';this[_0xc6cf('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xc6cf('0x5')]['_transform']=function(_0x240f7b,_0x454148,_0x3a9c42){var _0xdba158='\x0a',_0x5c7476=['\x0a\x0a',_0xc6cf('0x6')],_0x436edf=-0x1,_0x473d48=-0x1,_0x31ac4e='',_0x3ef1f6=0x0,_0x2a124f='',_0x1ed130='';this['_localBuffer']+=_0x240f7b[_0xc6cf('0x7')]();_0x2a124f=this[_0xc6cf('0x3')];if(!this[_0xc6cf('0x4')]){_0x3ef1f6=0x0;while(_0x5c7476[_0x3ef1f6]){while((_0x473d48=_0x2a124f[_0xc6cf('0x8')](_0x5c7476[_0x3ef1f6]))!=-0x1){_0x31ac4e=_0x5c7476[_0x3ef1f6];_0x1ed130=_0x2a124f[_0xc6cf('0x9')](0x0,_0x473d48);_0x2a124f=_0x2a124f['substring'](_0x473d48+_0x31ac4e['length']);var _0x1d1344=_0x1ed130['split'](_0xdba158),_0x13a441=0x0,_0x5c188c={},_0x464561='',_0x53e0eb='',_0x4d2993=-0x1;while(_0x1d1344[_0x13a441]){_0x4d2993=_0x1d1344[_0x13a441][_0xc6cf('0x8')](':');if(_0x4d2993!=-0x1){_0x464561=_0x1d1344[_0x13a441][_0xc6cf('0xa')](0x0,_0x4d2993)[_0xc6cf('0xb')]();_0x53e0eb=_0x1d1344[_0x13a441][_0xc6cf('0xa')](_0x4d2993+0x1)[_0xc6cf('0xb')]();if(_0x464561[_0xc6cf('0xc')]>0x0){_0x5c188c[_0x464561]=_0x53e0eb;}}else{}_0x13a441++;}this['emit'](_0xc6cf('0xd'),_0x5c188c);this[_0xc6cf('0x4')]=!![];}_0x3ef1f6++;}this[_0xc6cf('0x3')]=_0x2a124f;}else{while((_0x436edf=_0x2a124f[_0xc6cf('0x8')](_0xdba158))!=-0x1){_0x1ed130=_0x2a124f['substring'](0x0,_0x436edf);this['emit'](_0xc6cf('0xe'),_0x1ed130);_0x2a124f=_0x2a124f[_0xc6cf('0x9')](_0x436edf+_0xdba158[_0xc6cf('0xc')]);}this['_localBuffer']=_0x2a124f;}_0x3a9c42();};module[_0xc6cf('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f1316df..db22dad 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 _0xae0e=['lodash','util','client','http','then','error','catch','ShowSquareProject','production','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xae0e,0xa1));var _0xeae0=function(_0x436aff,_0x269e16){_0x436aff=_0x436aff-0x0;var _0x31e560=_0xae0e[_0x436aff];return _0x31e560;};'use strict';var BPromise=require('bluebird');var moment=require(_0xeae0('0x0'));var _=require(_0xeae0('0x1'));var util=require(_0xeae0('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xeae0('0x3')][_0xeae0('0x4')]({'port':0x2329});function request(_0x5dab02,_0x3a8e95){return new BPromise(function(_0x43c3f6,_0x4c9d3b){return client['request'](_0x5dab02,_0x3a8e95)[_0xeae0('0x5')](function(_0x475432){if(_0x475432[_0xeae0('0x6')]){return _0x4c9d3b(_0x475432[_0xeae0('0x6')]['message']);}else{return _0x43c3f6(_0x475432['result']);}})[_0xeae0('0x7')](function(_0x3ad0c7){return _0x4c9d3b(_0x3ad0c7);});});}exports['getSquareProject']=function(_0x5f59da){return request(_0xeae0('0x8'),{'options':{'raw':![],'where':{'name':_0x5f59da},'attributes':[_0xeae0('0x9')]}});};exports['getMailAccountById']=function(_0x528a6f){return request(_0xeae0('0xa'),{'options':{'raw':![],'where':{'id':_0x528a6f},'include':[{'model':'MailServerOut','as':_0xeae0('0xb')}],'attributes':['id',_0xeae0('0xc'),_0xeae0('0xd')]}});};exports[_0xeae0('0xe')]=function(_0x11bc44){return request(_0xeae0('0x8'),{'options':{'where':{'id':_0x11bc44},'attributes':[_0xeae0('0xc')]}});};exports[_0xeae0('0xf')]=function(_0x41c7ff){return request(_0xeae0('0x10'),{'options':{'where':{'id':_0x41c7ff},'attributes':[_0xeae0('0xc')]}});};exports['getVariableById']=function(_0x2276ec){return request(_0xeae0('0x11'),{'options':{'where':{'id':_0x2276ec},'attributes':[_0xeae0('0xc')]}});};exports['getSquareOdbcById']=function(_0x4279fd){return request(_0xeae0('0x12'),{'options':{'where':{'id':_0x4279fd},'attributes':[_0xeae0('0x13')]}});};exports[_0xeae0('0x14')]=function(_0x3520be){return request('ShowUser',{'options':{'where':{'id':_0x3520be},'attributes':['name']}});};exports['getTrunkById']=function(_0x522c49){return request(_0xeae0('0x15'),{'options':{'where':{'id':_0x522c49},'attributes':[_0xeae0('0xc')]}});};exports[_0xeae0('0x16')]=function(_0x47b023){return request(_0xeae0('0x17'),{'options':{'where':{'id':_0x47b023},'attributes':['save_name']}});};exports[_0xeae0('0x18')]=function(_0x2e43e4){return request(_0xeae0('0x19'),{'options':{'raw':![],'where':{'id':_0x2e43e4},'include':[{'model':_0xeae0('0x1a'),'as':_0xeae0('0x1b')}]}});};exports['getSmsAccountById']=function(_0x25b4bf){return request(_0xeae0('0x1c'),{'options':{'where':{'id':_0x25b4bf},'attributes':['id',_0xeae0('0xc')]}});};exports[_0xeae0('0x1d')]=function(_0x20a7fe){return request(_0xeae0('0x1e'),{'body':_0x20a7fe});};exports[_0xeae0('0x1f')]=function(_0x319eb7){return request('CreateSquareDetailsReport',{'body':_0x319eb7});};exports['createSquareReport']=function(_0x5f4235){return request(_0xeae0('0x20'),{'body':_['merge'](_0x5f4235,{'project_name':_0x5f4235['arg_1'],'prev_project_name':_0x5f4235[_0xeae0('0x21')]||'','is_subproject':_0x5f4235[_0xeae0('0x21')]?!![]:![],'leaveAt':moment()[_0xeae0('0x22')](_0xeae0('0x23'))})});};exports[_0xeae0('0x24')]=function(_0x383e35){return request(_0xeae0('0x25'),{'body':_0x383e35});};exports[_0xeae0('0x26')]=function(_0xb4f808){return request(_0xeae0('0x27'),{'body':_0xb4f808});};exports['createCmContact']=function(_0x5b3653){return request(_0xeae0('0x28'),{'options':{'raw':![],'where':{'phone':_0x5b3653[_0xeae0('0x29')],'ListId':_0x5b3653[_0xeae0('0x2a')]}}})['then'](function(_0x3a49a9){if(_0x3a49a9){return _0x3a49a9;}return request(_0xeae0('0x2b'),{'body':_0x5b3653});});};exports[_0xeae0('0x2c')]=function(_0x4fc6bf){return request(_0xeae0('0x2d'),{'options':{'where':{'id':_0x4fc6bf},'attributes':[_0xeae0('0xc')]}});};exports[_0xeae0('0x2e')]=function(_0x3f3b4a,_0x4ac99b){return request(_0xeae0('0x2f'),{'body':{'interface':_0x4ac99b},'options':{'where':_0x3f3b4a}});};exports[_0xeae0('0x30')]=function(_0x54652d,_0x2e8ed1,_0x2d5ee9){return request(_0xeae0('0x31'),{'body':{'type':_0x2e8ed1,'uniqueid':_0x2d5ee9},'options':{'where':_0x54652d}});};exports[_0xeae0('0x32')]=function(_0x40156e){return request(_0xeae0('0x33'),{'body':{},'options':{'where':_0x40156e}});};exports[_0xeae0('0x34')]=function(_0x4d0e16){return request(_0xeae0('0x35'),{'body':{},'options':{'where':_0x4d0e16}});}; \ No newline at end of file +var _0x1264=['CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','production','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSquareReport','merge','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording'];(function(_0x59e93a,_0x55b733){var _0x49c50d=function(_0x6ea73){while(--_0x6ea73){_0x59e93a['push'](_0x59e93a['shift']());}};_0x49c50d(++_0x55b733);}(_0x1264,0xde));var _0x4126=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x1264[_0x220afa];return _0x1b79d1;};'use strict';var BPromise=require(_0x4126('0x0'));var moment=require(_0x4126('0x1'));var _=require(_0x4126('0x2'));var util=require(_0x4126('0x3'));var jayson=require(_0x4126('0x4'));var client=jayson[_0x4126('0x5')][_0x4126('0x6')]({'port':0x2329});function request(_0x5c089f,_0x16a737){return new BPromise(function(_0x48854e,_0x455e00){return client[_0x4126('0x7')](_0x5c089f,_0x16a737)[_0x4126('0x8')](function(_0x1012f5){if(_0x1012f5[_0x4126('0x9')]){return _0x455e00(_0x1012f5['error']['message']);}else{return _0x48854e(_0x1012f5[_0x4126('0xa')]);}})[_0x4126('0xb')](function(_0xf460f0){return _0x455e00(_0xf460f0);});});}exports[_0x4126('0xc')]=function(_0x31f61c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x31f61c},'attributes':[_0x4126('0xd')]}});};exports['getMailAccountById']=function(_0x1f6663){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1f6663},'include':[{'model':_0x4126('0xe'),'as':_0x4126('0xf')}],'attributes':['id',_0x4126('0x10'),_0x4126('0x11')]}});};exports[_0x4126('0x12')]=function(_0x3c242){return request('ShowSquareProject',{'options':{'where':{'id':_0x3c242},'attributes':['name']}});};exports[_0x4126('0x13')]=function(_0x4635a9){return request(_0x4126('0x14'),{'options':{'where':{'id':_0x4635a9},'attributes':[_0x4126('0x10')]}});};exports[_0x4126('0x15')]=function(_0x2d1602){return request('ShowVariable',{'options':{'where':{'id':_0x2d1602},'attributes':[_0x4126('0x10')]}});};exports[_0x4126('0x16')]=function(_0x147f3d){return request(_0x4126('0x17'),{'options':{'where':{'id':_0x147f3d},'attributes':['dsn']}});};exports[_0x4126('0x18')]=function(_0x31a0cf){return request('ShowUser',{'options':{'where':{'id':_0x31a0cf},'attributes':[_0x4126('0x10')]}});};exports['getTrunkById']=function(_0x578820){return request('ShowTrunk',{'options':{'where':{'id':_0x578820},'attributes':[_0x4126('0x10')]}});};exports[_0x4126('0x19')]=function(_0x49a0de){return request(_0x4126('0x1a'),{'options':{'where':{'id':_0x49a0de},'attributes':['save_name']}});};exports[_0x4126('0x1b')]=function(_0x1e7e87){return request(_0x4126('0x1c'),{'options':{'raw':![],'where':{'id':_0x1e7e87},'include':[{'model':_0x4126('0x1d'),'as':_0x4126('0x1e')}]}});};exports['getSmsAccountById']=function(_0x1b8987){return request(_0x4126('0x1f'),{'options':{'where':{'id':_0x1b8987},'attributes':['id',_0x4126('0x10')]}});};exports[_0x4126('0x20')]=function(_0x5bf27d){return request('CreateSmsMessage',{'body':_0x5bf27d});};exports['createSquareDetailsReport']=function(_0x10db53){return request('CreateSquareDetailsReport',{'body':_0x10db53});};exports['createSquareReport']=function(_0x2cf540){return request(_0x4126('0x21'),{'body':_[_0x4126('0x22')](_0x2cf540,{'project_name':_0x2cf540['arg_1'],'prev_project_name':_0x2cf540['arg_2']||'','is_subproject':_0x2cf540['arg_2']?!![]:![],'leaveAt':moment()[_0x4126('0x23')](_0x4126('0x24'))})});};exports[_0x4126('0x25')]=function(_0x6db5f4){return request(_0x4126('0x26'),{'body':_0x6db5f4});};exports[_0x4126('0x27')]=function(_0x13674e){return request(_0x4126('0x28'),{'body':_0x13674e});};exports[_0x4126('0x29')]=function(_0x1834a3){return request(_0x4126('0x2a'),{'options':{'raw':![],'where':{'phone':_0x1834a3[_0x4126('0x2b')],'ListId':_0x1834a3[_0x4126('0x2c')]}}})[_0x4126('0x8')](function(_0x1d533a){if(_0x1d533a){return _0x1d533a;}return request(_0x4126('0x2d'),{'body':_0x1834a3});});};exports[_0x4126('0x2e')]=function(_0x36633e){return request('ShowPause',{'options':{'where':{'id':_0x36633e},'attributes':['name']}});};exports[_0x4126('0x2f')]=function(_0x19e481,_0x6bacec){return request(_0x4126('0x30'),{'body':{'interface':_0x6bacec},'options':{'where':_0x19e481}});};exports[_0x4126('0x31')]=function(_0x350df3,_0x201691,_0x16bfba){return request(_0x4126('0x32'),{'body':{'type':_0x201691,'uniqueid':_0x16bfba},'options':{'where':_0x350df3}});};exports[_0x4126('0x33')]=function(_0x17146b){return request('UnpauseUser',{'body':{},'options':{'where':_0x17146b}});};exports['agentLogout']=function(_0x148212){return request('LogoutUser',{'body':{},'options':{'where':_0x148212}});}; \ 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 86ab1c3..d1c6ab0 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 _0xf417=['exports','./lex'];(function(_0x3a220a,_0x4a3266){var _0x2528bd=function(_0x1254b9){while(--_0x1254b9){_0x3a220a['push'](_0x3a220a['shift']());}};_0x2528bd(++_0x4a3266);}(_0xf417,0x8f));var _0x7f41=function(_0x455afa,_0x235bfc){_0x455afa=_0x455afa-0x0;var _0x46ee43=_0xf417[_0x455afa];return _0x46ee43;};var polly=require('./polly');var lex=require(_0x7f41('0x0'));module[_0x7f41('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xafc4=['exports','./polly'];(function(_0x4ff1a8,_0xbb3134){var _0x5b5582=function(_0x5a760f){while(--_0x5a760f){_0x4ff1a8['push'](_0x4ff1a8['shift']());}};_0x5b5582(++_0xbb3134);}(_0xafc4,0x69));var _0x4afc=function(_0x1d8934,_0x835f1f){_0x1d8934=_0x1d8934-0x0;var _0x19e0ee=_0xafc4[_0x1d8934];return _0x19e0ee;};var polly=require(_0x4afc('0x0'));var lex=require('./lex');module[_0x4afc('0x1')]={'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 22515b4..12b6154 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ No newline at end of file +var _0x9348=['exports','./lib/api'];(function(_0x4883ba,_0x1c6a38){var _0x136a32=function(_0x379be1){while(--_0x379be1){_0x4883ba['push'](_0x4883ba['shift']());}};_0x136a32(++_0x1c6a38);}(_0x9348,0x10d));var _0x8934=function(_0x5b6480,_0x585f34){_0x5b6480=_0x5b6480-0x0;var _0x33e4fd=_0x9348[_0x5b6480];return _0x33e4fd;};'use strict';var lex=require(_0x8934('0x0'));module[_0x8934('0x1')]=function(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b){return lex(_0x472223,_0x135b2c,_0x46a231,_0x4a2577,_0x34d032,_0x35da0b);}; \ 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 ee55952..5669c1f 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5bcd8a,_0x4b6f74){var _0x319dd4=function(_0x4e3178){while(--_0x4e3178){_0x5bcd8a['push'](_0x5bcd8a['shift']());}};_0x319dd4(++_0x4b6f74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x3b7fda,_0x36ff46){var _0x3fe8d0=function(_0x9d5d44){while(--_0x9d5d44){_0x3b7fda['push'](_0x3b7fda['shift']());}};_0x3fe8d0(++_0x36ff46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 6306aec..1c18344 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 _0xdd78=['./lib/api'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xdd78,0xdc));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0x8dd7('0x0'));module['exports']=function(_0x38d2e6,_0x35fcbe,_0x4dc449,_0xd34168,_0x15a7c3,_0x2b01ec,_0x417139){return polly(_0x38d2e6,_0x35fcbe,_0x4dc449,_0xd34168,_0x15a7c3,_0x2b01ec,_0x417139);}; \ No newline at end of file +var _0x3316=['./lib/api','exports'];(function(_0x1206c1,_0x1f171a){var _0x29610c=function(_0x1d688a){while(--_0x1d688a){_0x1206c1['push'](_0x1206c1['shift']());}};_0x29610c(++_0x1f171a);}(_0x3316,0x140));var _0x6331=function(_0x44f630,_0xcdd7f8){_0x44f630=_0x44f630-0x0;var _0x3633ef=_0x3316[_0x44f630];return _0x3633ef;};'use strict';var polly=require(_0x6331('0x0'));module[_0x6331('0x1')]=function(_0x1c094d,_0x222609,_0x42d664,_0x2f46aa,_0x3b24f7,_0x377b08,_0x5096ce){return polly(_0x1c094d,_0x222609,_0x42d664,_0x2f46aa,_0x3b24f7,_0x377b08,_0x5096ce);}; \ 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 f09f188..757da76 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 _0x80ca=['exports','Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x80ca,0xcf));var _0xa80c=function(_0xa8d161,_0x49078e){_0xa8d161=_0xa8d161-0x0;var _0x2d1b6c=_0x80ca[_0xa8d161];return _0x2d1b6c;};'use strict';var fs=require('fs');var path=require(_0xa80c('0x0'));var BPromise=require(_0xa80c('0x1'));var rs=require(_0xa80c('0x2'));var AWS=require(_0xa80c('0x3'));function pollyResult(_0x46e13b,_0x2911fd,_0x2bd2f5){return new BPromise(function(_0x2649f1,_0x1dc85b){_0x46e13b[_0xa80c('0x4')](_0x2911fd,function(_0x20e94d,_0x42c8b0){if(_0x20e94d){_0x1dc85b(_0x20e94d);}else if(_0x42c8b0){if(_0x42c8b0['AudioStream']instanceof Buffer){fs[_0xa80c('0x5')](_0x2bd2f5,_0x42c8b0[_0xa80c('0x6')],function(_0x52fb1b){if(_0x52fb1b){_0x1dc85b(_0x52fb1b);}else{_0x2649f1();}});}else{_0x1dc85b(new Error(_0xa80c('0x7')));}}else{_0x1dc85b(new Error(_0xa80c('0x8')));}});});}module[_0xa80c('0x9')]=function(_0x34498f,_0x5aa2f3,_0x31dea9,_0x22ee3b,_0x5d839c,_0x34b4a0,_0x2d82c1){var _0x358c0f=new AWS[(_0xa80c('0xa'))]({'accessKeyId':_0x34498f,'secretAccessKey':_0x5aa2f3,'region':_0x31dea9});var _0x3d813c={'Text':_0x5d839c,'TextType':_0x34b4a0||_0xa80c('0xb'),'OutputFormat':'mp3','VoiceId':_0x22ee3b};return pollyResult(_0x358c0f,_0x3d813c,_0x2d82c1);}; \ No newline at end of file +var _0xce1b=['Polly','mp3','path','bluebird','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x32e94b,_0x38c7a7){var _0x3b1567=function(_0x282670){while(--_0x282670){_0x32e94b['push'](_0x32e94b['shift']());}};_0x3b1567(++_0x38c7a7);}(_0xce1b,0x161));var _0xbce1=function(_0x2d36c5,_0x4279a9){_0x2d36c5=_0x2d36c5-0x0;var _0x241415=_0xce1b[_0x2d36c5];return _0x241415;};'use strict';var fs=require('fs');var path=require(_0xbce1('0x0'));var BPromise=require(_0xbce1('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x29984c,_0x411271,_0x243e7a){return new BPromise(function(_0x454cdd,_0x5b6b4a){_0x29984c[_0xbce1('0x2')](_0x411271,function(_0x44a95b,_0x15c2c6){if(_0x44a95b){_0x5b6b4a(_0x44a95b);}else if(_0x15c2c6){if(_0x15c2c6['AudioStream']instanceof Buffer){fs[_0xbce1('0x3')](_0x243e7a,_0x15c2c6[_0xbce1('0x4')],function(_0x3637ee){if(_0x3637ee){_0x5b6b4a(_0x3637ee);}else{_0x454cdd();}});}else{_0x5b6b4a(new Error(_0xbce1('0x5')));}}else{_0x5b6b4a(new Error(_0xbce1('0x6')));}});});}module['exports']=function(_0x6d1f0,_0x3c0b0b,_0x2f25b9,_0x2db424,_0x259923,_0x5b3529,_0x106db5){var _0x100623=new AWS[(_0xbce1('0x7'))]({'accessKeyId':_0x6d1f0,'secretAccessKey':_0x3c0b0b,'region':_0x2f25b9});var _0x1d982e={'Text':_0x259923,'TextType':_0x5b3529||'text','OutputFormat':_0xbce1('0x8'),'VoiceId':_0x2db424};return pollyResult(_0x100623,_0x1d982e,_0x106db5);}; \ 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 9a00a63..eabe57d 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 _0x5811=['exports','./lib/api'];(function(_0x1644b2,_0x50076b){var _0x36cd88=function(_0x4e1bfc){while(--_0x4e1bfc){_0x1644b2['push'](_0x1644b2['shift']());}};_0x36cd88(++_0x50076b);}(_0x5811,0x143));var _0x1581=function(_0x3e7455,_0x578151){_0x3e7455=_0x3e7455-0x0;var _0x41c2ce=_0x5811[_0x3e7455];return _0x41c2ce;};'use strict';var asr=require(_0x1581('0x0'));module[_0x1581('0x1')]=function(_0x156830,_0x5249e3,_0xe65fc,_0x366353){return asr(_0x156830,_0x5249e3,_0xe65fc);}; \ No newline at end of file +var _0x3696=['exports','./lib/api'];(function(_0x1ce692,_0x1ca564){var _0x191ed4=function(_0x7d0837){while(--_0x7d0837){_0x1ce692['push'](_0x1ce692['shift']());}};_0x191ed4(++_0x1ca564);}(_0x3696,0x137));var _0x6369=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x3696[_0x45d3f0];return _0x314b79;};'use strict';var asr=require(_0x6369('0x0'));module[_0x6369('0x1')]=function(_0x5c3036,_0x497380,_0x2c2746,_0x765955){return asr(_0x5c3036,_0x497380,_0x2c2746);}; \ 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 1547da9..c6e82e3 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 _0x8388=['key\x20should\x20be\x20a\x20string','undefined','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x50b28b,_0x2ad826){var _0x19db2a=function(_0x59775c){while(--_0x59775c){_0x50b28b['push'](_0x50b28b['shift']());}};_0x19db2a(++_0x2ad826);}(_0x8388,0x18d));var _0x8838=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x8388[_0x3474ac];return _0x5345ec;};'use strict';var url=require(_0x8838('0x0'));var BPromise=require(_0x8838('0x1'));var fs=require('fs');var host=_0x8838('0x2');module[_0x8838('0x3')]=function(_0x5307bd,_0x140ee6,_0x3dbcd4){return new BPromise(function(_0x316297,_0x20a813){var _0xd474f2;if(typeof _0x5307bd!=='string'||_0x5307bd[_0x8838('0x4')]===0x0){return _0x20a813(_0x8838('0x5'));}if(typeof _0x140ee6!=='string'||_0x140ee6[_0x8838('0x4')]===0x0){return _0x20a813(_0x8838('0x6'));}if(typeof _0x3dbcd4!==_0x8838('0x7')&&(typeof _0x3dbcd4!=='string'||_0x3dbcd4[_0x8838('0x4')]===0x0)){return _0x20a813('lang\x20should\x20be\x20a\x20string');}try{_0xd474f2=fs['readFileSync'](_0x5307bd)[_0x8838('0x8')]('base64');}catch(_0x4aedc9){return _0x20a813(_0x4aedc9);}return _0x316297({'method':_0x8838('0x9'),'uri':host+_0x8838('0xa')+_0x140ee6,'body':{'config':{'encoding':_0x8838('0xb'),'sampleRateHertz':_0x8838('0xc'),'languageCode':_0x3dbcd4},'audio':{'content':_0xd474f2}},'json':!![]});});}; \ No newline at end of file +var _0x1152=['LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key='];(function(_0x184050,_0x29151f){var _0x335efe=function(_0x1b0b46){while(--_0x1b0b46){_0x184050['push'](_0x184050['shift']());}};_0x335efe(++_0x29151f);}(_0x1152,0x182));var _0x2115=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x1152[_0x3889ae];return _0x6533dd;};'use strict';var url=require(_0x2115('0x0'));var BPromise=require(_0x2115('0x1'));var fs=require('fs');var host=_0x2115('0x2');module[_0x2115('0x3')]=function(_0x20049f,_0x31ab3c,_0x31783d){return new BPromise(function(_0x3b8dfa,_0x4d0f31){var _0x1e8a26;if(typeof _0x20049f!=='string'||_0x20049f[_0x2115('0x4')]===0x0){return _0x4d0f31(_0x2115('0x5'));}if(typeof _0x31ab3c!=='string'||_0x31ab3c['length']===0x0){return _0x4d0f31('key\x20should\x20be\x20a\x20string');}if(typeof _0x31783d!=='undefined'&&(typeof _0x31783d!=='string'||_0x31783d[_0x2115('0x4')]===0x0)){return _0x4d0f31(_0x2115('0x6'));}try{_0x1e8a26=fs[_0x2115('0x7')](_0x20049f)['toString'](_0x2115('0x8'));}catch(_0x534958){return _0x4d0f31(_0x534958);}return _0x3b8dfa({'method':'POST','uri':host+_0x2115('0x9')+_0x31ab3c,'body':{'config':{'encoding':_0x2115('0xa'),'sampleRateHertz':_0x2115('0xb'),'languageCode':_0x31783d},'audio':{'content':_0x1e8a26}},'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 93c95c1..75101ef 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 _0x2925=['./asr'];(function(_0x51630f,_0x54b703){var _0x2de9ef=function(_0x2a1348){while(--_0x2a1348){_0x51630f['push'](_0x51630f['shift']());}};_0x2de9ef(++_0x54b703);}(_0x2925,0xf4));var _0x5292=function(_0x459349,_0x2e6797){_0x459349=_0x459349-0x0;var _0x35de00=_0x2925[_0x459349];return _0x35de00;};var asr=require(_0x5292('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xddb1=['exports','./asr'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xddb1,0x6b));var _0x1ddb=function(_0x130201,_0x28a880){_0x130201=_0x130201-0x0;var _0x4e50e7=_0xddb1[_0x130201];return _0x4e50e7;};var asr=require(_0x1ddb('0x0'));module[_0x1ddb('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 ad4def1..09155cf 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 _0x170a=['host','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','protocol','WHAT_EVER','get','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','POST','generate','from','audioContent','.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','join','map','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','source','resolvedQuery','action','actionIncomplete','fulfillment','result','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','.mp3','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','text','channelData','CustomAction','AudioFromTts','Data','dialogflow','https','path','querystring','request-promise','sox','google-tts-api','url','util','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x170a,0x178));var _0xa170=function(_0x455643,_0x1e46c4){_0x455643=_0x455643-0x0;var _0x5e5257=_0x170a[_0x455643];return _0x5e5257;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xa170('0x0'));var fs=require('fs');var http=require('http');var https=require(_0xa170('0x1'));var md5=require('md5');var path=require(_0xa170('0x2'));var querystring=require(_0xa170('0x3'));var rp=require(_0xa170('0x4'));var rs=require('randomstring');var sox=require(_0xa170('0x5'));var tts=require(_0xa170('0x6'));var urlParse=require(_0xa170('0x7'))['parse'];var util=require(_0xa170('0x8'));var aws=require('./aws');var google=require(_0xa170('0x9'));var sestek=require('./sestek');var tilde=require(_0xa170('0xa'));var logger=require(_0xa170('0xb'))('agi');var ISPEECH_API=_0xa170('0xc');function downloadFile(_0x441c2d,_0x549afd){return new BPromise(function(_0xa86d55,_0x148af1){var _0x14be44=urlParse(_0x441c2d);var _0x4fcb92=_0x14be44['protocol']===_0xa170('0xd')?https:http;var _0x19d2d4={'host':_0x14be44[_0xa170('0xe')],'path':_0x14be44[_0xa170('0x2')],'headers':{'user-agent':'WHAT_EVER'}};_0x4fcb92['get'](_0x19d2d4,function(_0x3224cc){if(_0x3224cc[_0xa170('0xf')]!==0xc8){logger[_0xa170('0x10')]('request\x20to\x20'+_0x441c2d+'\x20failed,\x20status\x20code\x20=\x20'+_0x3224cc[_0xa170('0xf')]+'\x20('+_0x3224cc['statusMessage']+')');_0x148af1(new Error(_0xa170('0x11')+_0x441c2d+_0xa170('0x12')+_0x3224cc[_0xa170('0xf')]+'\x20('+_0x3224cc['statusMessage']+')'));return;}var _0x143c1c=fs['createWriteStream'](_0x549afd);_0x143c1c['on'](_0xa170('0x13'),function(){logger[_0xa170('0x14')](_0xa170('0x15'));_0x143c1c[_0xa170('0x16')](_0xa86d55);});_0x143c1c['on'](_0xa170('0x10'),function(_0x14c010){fs[_0xa170('0x17')](_0x549afd);logger['error'](_0xa170('0x18'),_0x14c010);_0x148af1(_0x14c010);});_0x3224cc[_0xa170('0x19')](_0x143c1c);})['on'](_0xa170('0x10'),function(_0x4df664){logger[_0xa170('0x10')](_0x4df664);_0x148af1(_0x4df664);})['end']();});}function uploadFile(_0x3fa6af){return new BPromise(function(_0x40f873,_0x27f76b){var _0x58077f=urlParse(_0x3fa6af);var _0x43e9ea=_0x58077f[_0xa170('0x1a')]===_0xa170('0xd')?https:http;var _0x382ec7={'host':_0x58077f[_0xa170('0xe')],'path':_0x58077f[_0xa170('0x2')],'headers':{'user-agent':_0xa170('0x1b')}};_0x43e9ea[_0xa170('0x1c')](_0x382ec7,function(_0x2d5180){if(_0x2d5180[_0xa170('0xf')]!==0xc8){_0x27f76b(new Error('request\x20to\x20'+_0x3fa6af+_0xa170('0x12')+_0x2d5180[_0xa170('0xf')]+'\x20('+_0x2d5180['statusMessage']+')'));return;}var _0x135a37='';_0x2d5180['on'](_0xa170('0x1d'),function(_0x2d298a){_0x135a37+=_0x2d298a;});_0x2d5180['on'](_0xa170('0x1e'),function(){_0x40f873(_0x135a37);});})['on'](_0xa170('0x10'),function(_0x452600){_0x27f76b(_0x452600);})[_0xa170('0x1e')]();});}function convertFile(_0x53dae6,_0x3efeeb){return new BPromise(function(_0x4f70c6,_0x221c9e){var _0xd609ca=sox[_0xa170('0x1f')](_0x53dae6,_0x3efeeb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xd609ca['on'](_0xa170('0x10'),function(_0x5ef1b9){logger[_0xa170('0x10')](_0xa170('0x20'),_0x5ef1b9);_0x221c9e(_0x5ef1b9);});_0xd609ca['on'](_0xa170('0x1e'),function(){logger[_0xa170('0x14')](_0xa170('0x21'));_0x4f70c6();});_0xd609ca[_0xa170('0x22')]();});}function base64Decode(_0xc90776,_0x49159f){var _0x43b62a=path[_0xa170('0x23')](__dirname,_0xa170('0x24'),rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x43b62a,_0xc90776,'base64');return convertFile(_0x43b62a,_0x49159f)[_0xa170('0x25')](function(){try{fs[_0xa170('0x17')](_0x43b62a);fs[_0xa170('0x26')](_0x49159f,_0xa170('0x27'));}catch(_0x28a6df){logger[_0xa170('0x10')](_0x28a6df);}return _0x49159f[_0xa170('0x28')]('.')[0x0];});}function base64Encode(_0x2dfde1){var _0x287876=fs[_0xa170('0x29')](_0x2dfde1);return new Buffer(_0x287876)[_0xa170('0x2a')](_0xa170('0x2b'));}exports[_0xa170('0x2c')]=function(_0x4cb725,_0x21aa7a,_0x3209bb,_0x56f91e,_0x213f21,_0x40dcd4){var _0x35ab84,_0x20910a;var _0x5d4316='https://texttospeech.googleapis.com/v1/';var _0xd395c0=_0xa170('0x2d')+_0x4cb725;var _0x30a483={};if(_0x21aa7a===_0xa170('0x2e')){_0x30a483[_0xa170('0x2f')]={'ssml':_0x3209bb};}else{_0x30a483[_0xa170('0x2f')]={'text':_0x3209bb};};_0x30a483[_0xa170('0x30')]={'languageCode':_0x56f91e,'ssmlGender':_0x213f21};_0x30a483['audioConfig']={'audioEncoding':_0xa170('0x31'),'sampleRateHertz':0x1f40};var _0x39758f={'url':_0x5d4316+_0xa170('0x32')+_0xd395c0,'method':_0xa170('0x33'),'json':!![],'body':_0x30a483};return rp(_0x39758f)[_0xa170('0x25')](function(_0x33e3cb){return new BPromise(function(_0x545a36,_0x43c60a){_0x35ab84=path[_0xa170('0x23')](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+'.mp3');var _0x51041f=Buffer[_0xa170('0x35')](_0x33e3cb[_0xa170('0x36')],_0xa170('0x2b'));return fs['writeFile'](_0x35ab84,_0x51041f,function(_0x1061a5){_0x43c60a(_0x1061a5);},function(_0x1464e3){fs[_0xa170('0x26')](_0x35ab84,_0xa170('0x27'));_0x545a36(_0x1464e3);});});})[_0xa170('0x25')](function(_0x419e02){_0x20910a=path['resolve'](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+_0xa170('0x37'));return convertFile(_0x35ab84,_0x20910a);})[_0xa170('0x25')](function(){try{fs[_0xa170('0x17')](_0x35ab84);fs[_0xa170('0x26')](_0x20910a,_0xa170('0x27'));}catch(_0x4c7151){logger[_0xa170('0x10')](_0x4c7151);}logger[_0xa170('0x14')](_0xa170('0x38'),_0x20910a['split']('.')[0x0]);return _0x20910a[_0xa170('0x28')]('.')[0x0];});};exports['googleTTS']=function(_0x116255,_0xa6bcf6){var _0x54e8bd=_0xa170('0x39');var _0x52527d,_0x12ead3;var _0x1e100a;var _0x3974e5={'encoding':_0xa170('0x3a'),'method':'POST','timeout':0x2710,'url':_0x54e8bd,'headers':{'Content-Type':_0xa170('0x3b')},'body':_0xa170('0x3c')+encodeURIComponent(JSON[_0xa170('0x3d')]([[[_0xa170('0x3e'),JSON[_0xa170('0x3d')]([_0x116255,_0xa6bcf6||'en',![],_0xa170('0x3f')]),null,_0xa170('0x40')]]]))};return rp(_0x3974e5)[_0xa170('0x25')](function(_0x2c6b7a){try{_0x1e100a=eval(_0x2c6b7a[_0xa170('0x41')](0x5))[0x0][0x2];}catch(_0x5ad6c7){throw new Error(_0xa170('0x42')+_0x2c6b7a[_0xa170('0x1d')]);}if(!_0x1e100a){if(_0x116255[_0xa170('0x43')]>0xc8){throw new Error(_0xa170('0x44'));}else{throw new Error('lang\x20\x22'+_0xa6bcf6+_0xa170('0x45'));}}try{_0x1e100a=eval(_0x1e100a)[0x0];}catch(_0x154633){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xa170('0x1d')]);}const _0x255733=_0x1e100a;_0x52527d=path['resolve'](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+'.mp3');fs['writeFileSync'](_0x52527d,_0x1e100a,{'encoding':_0xa170('0x2b')});_0x12ead3=path[_0xa170('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0xa170('0x37'));return convertFile(_0x52527d,_0x12ead3);})['then'](function(){try{fs['unlink'](_0x52527d);fs['chmodSync'](_0x12ead3,'777');}catch(_0x1be4ef){logger['error'](_0x1be4ef);}logger[_0xa170('0x14')](_0xa170('0x46'),_0x12ead3[_0xa170('0x28')]('.')[0x0]);return _0x12ead3[_0xa170('0x28')]('.')[0x0];});};exports[_0xa170('0x47')]=function(_0x25bf2b,_0x4ea40d,_0x5d4a49){return google[_0xa170('0x48')](_0x25bf2b,_0x4ea40d,_0x5d4a49)['then'](function(_0x3a561d){logger[_0xa170('0x14')](_0x3a561d[_0xa170('0x49')]);return rp(_0x3a561d);})[_0xa170('0x25')](function(_0x11f08b){var _0xf4bdd='';var _0x428c69=0x0;try{fs[_0xa170('0x17')](_0x25bf2b);}catch(_0x2905d3){logger['error'](_0x2905d3);}if(_0x11f08b&&_0x11f08b[_0xa170('0x4a')]){_0xf4bdd=_0x11f08b[_0xa170('0x4a')]['map'](function(_0x6de049){return _0x6de049&&_0x6de049['alternatives'][0x0]&&_0x6de049[_0xa170('0x4b')][0x0]['transcript']?_0x6de049[_0xa170('0x4b')][0x0]['transcript']:'';})[_0xa170('0x4c')]('\x0a');_0x428c69=_0x11f08b[_0xa170('0x4a')][_0xa170('0x4d')](function(_0x553c93){return _0x553c93&&_0x553c93['alternatives'][0x0]&&_0x553c93[_0xa170('0x4b')][0x0][_0xa170('0x4e')]?_0x553c93[_0xa170('0x4b')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0xf4bdd);logger[_0xa170('0x14')](_0xa170('0x4f'),_0x428c69);return{'transcript':_0xf4bdd,'confidence':_0x428c69};})[_0xa170('0x50')](function(_0x39d39a){logger[_0xa170('0x10')](_0xa170('0x51'),_0x39d39a[_0xa170('0xf')],_0x39d39a[_0xa170('0x52')],_0x39d39a['message']);});};exports[_0xa170('0x53')]=function(_0x4fa019,_0x37a401,_0x77eb3b,_0x49d04f){var _0x3b1bfe=apiai(_0x37a401,{'language':_0x49d04f||'en'});return _0x3b1bfe[_0xa170('0x54')](_0x77eb3b,{'sessionId':md5(_0x4fa019)})[_0xa170('0x25')](function(_0x52e965){logger[_0xa170('0x14')](JSON[_0xa170('0x3d')](_0x52e965));return{'source':_0x52e965['result'][_0xa170('0x55')],'resolvedQuery':_0x52e965['result'][_0xa170('0x56')],'action':_0x52e965['result'][_0xa170('0x57')],'actionIncomplete':_0x52e965['result'][_0xa170('0x58')],'speech':_0x52e965['result'][_0xa170('0x59')]['speech'],'score':_0x52e965[_0xa170('0x5a')]['score'],'statusCode':_0x52e965['status'][_0xa170('0x5b')],'endConversation':_0x52e965['result'][_0xa170('0x5c')][_0xa170('0x5d')]||![],'isFallbackIntent':_0x52e965[_0xa170('0x5a')][_0xa170('0x5c')][_0xa170('0x5e')]};});};exports[_0xa170('0x5f')]=function(_0x4debb0,_0x52c846,_0xcce13b,_0x49083a,_0x45e081,_0x34c630){var _0x29b189=_0x49083a[_0xa170('0x60')](/\\n/g,'\x0a');var _0x2e0cae={'credentials':{'private_key':_0x29b189,'client_email':_0xcce13b}};var _0x35ccdf=new dialogflow[(_0xa170('0x61'))](_0x2e0cae);var _0x3e0fae=_0x35ccdf[_0xa170('0x62')](_0x52c846,md5(_0x4debb0));var _0x123380={'session':_0x3e0fae,'queryInput':{'text':{'text':_0x45e081,'languageCode':_0x34c630}}};return _0x35ccdf['detectIntent'](_0x123380)[_0xa170('0x25')](function(_0x57650d){if(_0x57650d&&_0x57650d[_0xa170('0x43')]){logger[_0xa170('0x14')](_0xa170('0x63'),JSON[_0xa170('0x3d')](_0x57650d));var _0x158368=_0x57650d[0x0];if(_0x158368){var _0x59a0fc={'action':_0x158368['queryResult'][_0xa170('0x57')],'allRequiredParamsPresent':_0x158368[_0xa170('0x64')][_0xa170('0x65')],'endConversation':_0x158368[_0xa170('0x64')][_0xa170('0x66')]&&_0x158368[_0xa170('0x64')][_0xa170('0x66')][_0xa170('0x67')]?_0x158368[_0xa170('0x64')][_0xa170('0x66')]['fields'][_0xa170('0x68')][_0xa170('0x69')]:![],'fulfillmentText':_0x158368[_0xa170('0x64')][_0xa170('0x6a')],'intentName':_0x158368[_0xa170('0x64')]['intent'][_0xa170('0x52')],'intentDisplayName':_0x158368[_0xa170('0x64')][_0xa170('0x6b')][_0xa170('0x6c')],'isFallbackIntent':_0x158368['queryResult'][_0xa170('0x6b')][_0xa170('0x6d')],'languageCode':_0x158368[_0xa170('0x64')][_0xa170('0x6e')],'queryText':_0x158368[_0xa170('0x64')][_0xa170('0x6f')],'responseId':_0x158368[_0xa170('0x70')],'score':_0x158368[_0xa170('0x64')][_0xa170('0x71')],'speech':_0x158368[_0xa170('0x64')][_0xa170('0x6a')],'providerResponse':JSON[_0xa170('0x3d')](_0x57650d)};return _0x59a0fc;}}});};exports[_0xa170('0x72')]=function(_0x5d3349,_0x37a8d6,_0x252446,_0x5b940c){return tilde[_0xa170('0x48')](_0x5d3349,_0x37a8d6,_0x252446,_0x5b940c)[_0xa170('0x25')](function(_0xad7414){try{fs['unlink'](_0x5d3349);}catch(_0x472393){logger[_0xa170('0x10')](_0x472393);}logger[_0xa170('0x14')](_0xa170('0x73'),_0xad7414[_0xa170('0x74')]);logger[_0xa170('0x14')](_0xa170('0x75'),_0xad7414[_0xa170('0x4e')]);return _0xad7414;});};exports['awsPolly']=function(_0x2ac6d3,_0x2b2eed,_0x227706,_0xf9c221,_0x3f31b0,_0x9d930f){var _0x58224c=path['resolve'](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+_0xa170('0x76'));var _0xc439ef;return aws[_0xa170('0x77')](_0x2ac6d3,_0x2b2eed,_0x227706,_0xf9c221,_0x3f31b0,_0x9d930f,_0x58224c)['then'](function(){_0xc439ef=path[_0xa170('0x23')](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+_0xa170('0x37'));return convertFile(_0x58224c,_0xc439ef);})[_0xa170('0x25')](function(){try{fs['unlink'](_0x58224c);fs[_0xa170('0x26')](_0xc439ef,'777');}catch(_0x56d512){logger[_0xa170('0x10')](_0x56d512);}return _0xc439ef[_0xa170('0x28')]('.')[0x0];});};exports[_0xa170('0x78')]=function(_0x3a68b6,_0x2e021f,_0x38ef1c,_0x3cf407,_0x26a49e,_0x169277){return aws[_0xa170('0x79')](_0x3a68b6,_0x2e021f,_0x38ef1c,_0x3cf407,_0x26a49e,_0x169277)[_0xa170('0x25')](function(_0x58bdd7){logger[_0xa170('0x14')](JSON[_0xa170('0x3d')](_0x58bdd7));return _0x58bdd7;});};exports['ispeechTTS']=function(_0x1b71e5,_0x5a4349,_0x233c70,_0x4e94ab){var _0xa92662=util['format'](_0xa170('0x7a'),ISPEECH_API,_0x1b71e5,encodeURIComponent(_0x5a4349),_0x233c70,_0x4e94ab);var _0x114af6=path[_0xa170('0x23')](__dirname,_0xa170('0x24'),rs['generate'](0x4)+'.mp3');var _0x599063;return downloadFile(_0xa92662,_0x114af6)['then'](function(){_0x599063=path[_0xa170('0x23')](__dirname,_0xa170('0x24'),rs[_0xa170('0x34')](0x4)+_0xa170('0x37'));return convertFile(_0x114af6,_0x599063);})['then'](function(){try{fs[_0xa170('0x17')](_0x114af6);fs[_0xa170('0x26')](_0x599063,'777');}catch(_0x48874c){logger[_0xa170('0x10')](_0x48874c);}return _0x599063['split']('.')[0x0];});};exports['ispeechASR']=function(_0x29f8f6,_0x3e9ce0,_0x54ee7c,_0x458933){var _0x1ea7ba=util['format'](_0xa170('0x7b'),ISPEECH_API,_0x3e9ce0,_0x54ee7c,base64Encode(_0x29f8f6),_0x458933?util['format'](_0xa170('0x7c'),encodeURIComponent(_0x458933)):'freeform=3');return uploadFile(_0x1ea7ba)[_0xa170('0x25')](function(_0x7020f9){return querystring['parse'](_0x7020f9);});};exports['sestekNDA']=function(_0xfed863,_0x591819){return sestek['nda'](_0xfed863,_0x591819)['then'](function(_0x25a34c){logger[_0xa170('0x14')](JSON['stringify'](_0x25a34c));var _0x273086={'speech':_0x25a34c[_0xa170('0x7d')],'action':_0x25a34c['channelData']?_0x25a34c[_0xa170('0x7e')][_0xa170('0x7f')]:undefined,'actiondata':_0x25a34c['channelData']?_0x25a34c[_0xa170('0x7e')]['CustomActionData']:undefined};if(_0x25a34c[_0xa170('0x7e')]&&_0x25a34c[_0xa170('0x7e')]['AudioFromTts']){return base64Decode(_0x25a34c[_0xa170('0x7e')][_0xa170('0x80')][_0xa170('0x81')],path[_0xa170('0x23')](__dirname,'tmp',rs[_0xa170('0x34')](0x4)+_0xa170('0x37')))[_0xa170('0x25')](function(_0x55722d){_0x273086['audiofile']=_0x55722d;return _0x273086;});}return _0x273086;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x6dde=['displayName','responseId','intentDetectionConfidence','fulfillmentText','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','statusMessage','end','transcode','error\x20convert','info','finish\x20to\x20convert','resolve','tmp','generate','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','text:synthesize','POST','then','from','audioContent','writeFile','chmodSync','.wav','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','base64','goggleTTS\x20path','googleASR','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','result','resolvedQuery','actionIncomplete','fulfillment','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent'];(function(_0x4cc050,_0x56735d){var _0x2836e2=function(_0xb48356){while(--_0xb48356){_0x4cc050['push'](_0x4cc050['shift']());}};_0x2836e2(++_0x56735d);}(_0x6dde,0x197));var _0xe6dd=function(_0x543348,_0xf225d){_0x543348=_0x543348-0x0;var _0x549f26=_0x6dde[_0x543348];return _0x549f26;};'use strict';var apiai=require(_0xe6dd('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xe6dd('0x1'));var fs=require('fs');var http=require(_0xe6dd('0x2'));var https=require(_0xe6dd('0x3'));var md5=require(_0xe6dd('0x4'));var path=require(_0xe6dd('0x5'));var querystring=require(_0xe6dd('0x6'));var rp=require(_0xe6dd('0x7'));var rs=require(_0xe6dd('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0xe6dd('0x9'))['parse'];var util=require('util');var aws=require(_0xe6dd('0xa'));var google=require(_0xe6dd('0xb'));var sestek=require(_0xe6dd('0xc'));var tilde=require(_0xe6dd('0xd'));var logger=require(_0xe6dd('0xe'))('agi');var ISPEECH_API=_0xe6dd('0xf');function downloadFile(_0x15789f,_0x531c57){return new BPromise(function(_0x1bfe95,_0x27009e){var _0x18c8e7=urlParse(_0x15789f);var _0x33653d=_0x18c8e7['protocol']===_0xe6dd('0x10')?https:http;var _0x4ce1aa={'host':_0x18c8e7[_0xe6dd('0x11')],'path':_0x18c8e7[_0xe6dd('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x33653d[_0xe6dd('0x12')](_0x4ce1aa,function(_0x5b68e7){if(_0x5b68e7[_0xe6dd('0x13')]!==0xc8){logger[_0xe6dd('0x14')]('request\x20to\x20'+_0x15789f+_0xe6dd('0x15')+_0x5b68e7['statusCode']+'\x20('+_0x5b68e7['statusMessage']+')');_0x27009e(new Error('request\x20to\x20'+_0x15789f+_0xe6dd('0x15')+_0x5b68e7['statusCode']+'\x20('+_0x5b68e7['statusMessage']+')'));return;}var _0x1860c1=fs[_0xe6dd('0x16')](_0x531c57);_0x1860c1['on'](_0xe6dd('0x17'),function(){logger['info'](_0xe6dd('0x18'));_0x1860c1[_0xe6dd('0x19')](_0x1bfe95);});_0x1860c1['on'](_0xe6dd('0x14'),function(_0x313023){fs[_0xe6dd('0x1a')](_0x531c57);logger[_0xe6dd('0x14')](_0xe6dd('0x1b'),_0x313023);_0x27009e(_0x313023);});_0x5b68e7[_0xe6dd('0x1c')](_0x1860c1);})['on'](_0xe6dd('0x14'),function(_0x274ebb){logger[_0xe6dd('0x14')](_0x274ebb);_0x27009e(_0x274ebb);})['end']();});}function uploadFile(_0xc02fb5){return new BPromise(function(_0x194760,_0xe98573){var _0x2946ae=urlParse(_0xc02fb5);var _0x2e3678=_0x2946ae['protocol']===_0xe6dd('0x10')?https:http;var _0x9cb073={'host':_0x2946ae['host'],'path':_0x2946ae['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x2e3678[_0xe6dd('0x12')](_0x9cb073,function(_0x556b79){if(_0x556b79[_0xe6dd('0x13')]!==0xc8){_0xe98573(new Error('request\x20to\x20'+_0xc02fb5+'\x20failed,\x20status\x20code\x20=\x20'+_0x556b79[_0xe6dd('0x13')]+'\x20('+_0x556b79[_0xe6dd('0x1d')]+')'));return;}var _0x717ee4='';_0x556b79['on']('data',function(_0x184a3b){_0x717ee4+=_0x184a3b;});_0x556b79['on'](_0xe6dd('0x1e'),function(){_0x194760(_0x717ee4);});})['on']('error',function(_0x247630){_0xe98573(_0x247630);})[_0xe6dd('0x1e')]();});}function convertFile(_0x10d35f,_0x548a3c){return new BPromise(function(_0x49e0ad,_0x215073){var _0x3a301f=sox[_0xe6dd('0x1f')](_0x10d35f,_0x548a3c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a301f['on'](_0xe6dd('0x14'),function(_0x557df6){logger[_0xe6dd('0x14')](_0xe6dd('0x20'),_0x557df6);_0x215073(_0x557df6);});_0x3a301f['on'](_0xe6dd('0x1e'),function(){logger[_0xe6dd('0x21')](_0xe6dd('0x22'));_0x49e0ad();});_0x3a301f['start']();});}function base64Decode(_0x4439b3,_0x53ed9f){var _0x133e2c=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+'.wav');fs['writeFileSync'](_0x133e2c,_0x4439b3,'base64');return convertFile(_0x133e2c,_0x53ed9f)['then'](function(){try{fs[_0xe6dd('0x1a')](_0x133e2c);fs['chmodSync'](_0x53ed9f,_0xe6dd('0x26'));}catch(_0x1bae5f){logger['error'](_0x1bae5f);}return _0x53ed9f['split']('.')[0x0];});}function base64Encode(_0x2c79d6){var _0x592d21=fs[_0xe6dd('0x27')](_0x2c79d6);return new Buffer(_0x592d21)[_0xe6dd('0x28')]('base64');}exports[_0xe6dd('0x29')]=function(_0x58049d,_0x8f7f14,_0x192dae,_0x4fd118,_0x657d5e,_0x183ad9){var _0x4dd684,_0x5a8e05;var _0x51a75c=_0xe6dd('0x2a');var _0x2c3d92='?key='+_0x58049d;var _0x17710e={};if(_0x8f7f14===_0xe6dd('0x2b')){_0x17710e[_0xe6dd('0x2c')]={'ssml':_0x192dae};}else{_0x17710e[_0xe6dd('0x2c')]={'text':_0x192dae};};_0x17710e['voice']={'languageCode':_0x4fd118,'ssmlGender':_0x657d5e};_0x17710e['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2dd98c={'url':_0x51a75c+_0xe6dd('0x2d')+_0x2c3d92,'method':_0xe6dd('0x2e'),'json':!![],'body':_0x17710e};return rp(_0x2dd98c)[_0xe6dd('0x2f')](function(_0x3c794c){return new BPromise(function(_0x2ddad9,_0xb37e8f){_0x4dd684=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+'.mp3');var _0x169b77=Buffer[_0xe6dd('0x30')](_0x3c794c[_0xe6dd('0x31')],'base64');return fs[_0xe6dd('0x32')](_0x4dd684,_0x169b77,function(_0x39f5d6){_0xb37e8f(_0x39f5d6);},function(_0x123117){fs[_0xe6dd('0x33')](_0x4dd684,_0xe6dd('0x26'));_0x2ddad9(_0x123117);});});})[_0xe6dd('0x2f')](function(_0xe76e77){_0x5a8e05=path['resolve'](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+_0xe6dd('0x34'));return convertFile(_0x4dd684,_0x5a8e05);})[_0xe6dd('0x2f')](function(){try{fs[_0xe6dd('0x1a')](_0x4dd684);fs['chmodSync'](_0x5a8e05,_0xe6dd('0x26'));}catch(_0x3b08be){logger[_0xe6dd('0x14')](_0x3b08be);}logger[_0xe6dd('0x21')](_0xe6dd('0x35'),_0x5a8e05[_0xe6dd('0x36')]('.')[0x0]);return _0x5a8e05[_0xe6dd('0x36')]('.')[0x0];});};exports['googleTTS']=function(_0x1d47f4,_0x1abdc0){var _0x36f68d=_0xe6dd('0x37');var _0x3d33b8,_0x12fdf8;var _0x4c47cc;var _0x3edf9d={'encoding':_0xe6dd('0x38'),'method':_0xe6dd('0x2e'),'timeout':0x2710,'url':_0x36f68d,'headers':{'Content-Type':_0xe6dd('0x39')},'body':_0xe6dd('0x3a')+encodeURIComponent(JSON[_0xe6dd('0x3b')]([[[_0xe6dd('0x3c'),JSON[_0xe6dd('0x3b')]([_0x1d47f4,_0x1abdc0||'en',![],'null']),null,_0xe6dd('0x3d')]]]))};return rp(_0x3edf9d)[_0xe6dd('0x2f')](function(_0x437b62){try{_0x4c47cc=eval(_0x437b62[_0xe6dd('0x3e')](0x5))[0x0][0x2];}catch(_0x39c57b){throw new Error('parse\x20response\x20failed:\x0a'+_0x437b62[_0xe6dd('0x3f')]);}if(!_0x4c47cc){if(_0x1d47f4[_0xe6dd('0x40')]>0xc8){throw new Error(_0xe6dd('0x41'));}else{throw new Error(_0xe6dd('0x42')+_0x1abdc0+_0xe6dd('0x43'));}}try{_0x4c47cc=eval(_0x4c47cc)[0x0];}catch(_0x2e77cf){throw new Error(_0xe6dd('0x44')+res['data']);}const _0x325980=_0x4c47cc;_0x3d33b8=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+_0xe6dd('0x45'));fs['writeFileSync'](_0x3d33b8,_0x4c47cc,{'encoding':_0xe6dd('0x46')});_0x12fdf8=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs['generate'](0x4)+_0xe6dd('0x34'));return convertFile(_0x3d33b8,_0x12fdf8);})[_0xe6dd('0x2f')](function(){try{fs[_0xe6dd('0x1a')](_0x3d33b8);fs[_0xe6dd('0x33')](_0x12fdf8,_0xe6dd('0x26'));}catch(_0x209392){logger['error'](_0x209392);}logger['info'](_0xe6dd('0x47'),_0x12fdf8['split']('.')[0x0]);return _0x12fdf8['split']('.')[0x0];});};exports[_0xe6dd('0x48')]=function(_0x2325bf,_0x2791dc,_0xc61f16){return google['asr'](_0x2325bf,_0x2791dc,_0xc61f16)['then'](function(_0x5d55e4){logger[_0xe6dd('0x21')](_0x5d55e4['uri']);return rp(_0x5d55e4);})['then'](function(_0x56e2cc){var _0x2dd46d='';var _0x1019c4=0x0;try{fs[_0xe6dd('0x1a')](_0x2325bf);}catch(_0x1b25a3){logger['error'](_0x1b25a3);}if(_0x56e2cc&&_0x56e2cc[_0xe6dd('0x49')]){_0x2dd46d=_0x56e2cc[_0xe6dd('0x49')]['map'](function(_0x3fbad1){return _0x3fbad1&&_0x3fbad1[_0xe6dd('0x4a')][0x0]&&_0x3fbad1[_0xe6dd('0x4a')][0x0][_0xe6dd('0x4b')]?_0x3fbad1['alternatives'][0x0][_0xe6dd('0x4b')]:'';})[_0xe6dd('0x4c')]('\x0a');_0x1019c4=_0x56e2cc[_0xe6dd('0x49')][_0xe6dd('0x4d')](function(_0x2f08f5){return _0x2f08f5&&_0x2f08f5[_0xe6dd('0x4a')][0x0]&&_0x2f08f5['alternatives'][0x0][_0xe6dd('0x4e')]?_0x2f08f5[_0xe6dd('0x4a')][0x0][_0xe6dd('0x4e')]:0x0;})[_0xe6dd('0x4c')]('\x0a');}logger[_0xe6dd('0x21')](_0xe6dd('0x4f'),_0x2dd46d);logger[_0xe6dd('0x21')]('googleASR\x20confidence',_0x1019c4);return{'transcript':_0x2dd46d,'confidence':_0x1019c4};})[_0xe6dd('0x50')](function(_0x5a7d7f){logger[_0xe6dd('0x14')](_0xe6dd('0x51'),_0x5a7d7f[_0xe6dd('0x13')],_0x5a7d7f[_0xe6dd('0x52')],_0x5a7d7f[_0xe6dd('0x53')]);});};exports['googleDialogflow']=function(_0x5651a2,_0x30b3e3,_0x31e456,_0x39ef79){var _0x2dd9ca=apiai(_0x30b3e3,{'language':_0x39ef79||'en'});return _0x2dd9ca['textRequest'](_0x31e456,{'sessionId':md5(_0x5651a2)})[_0xe6dd('0x2f')](function(_0x52daa3){logger['info'](JSON[_0xe6dd('0x3b')](_0x52daa3));return{'source':_0x52daa3[_0xe6dd('0x54')]['source'],'resolvedQuery':_0x52daa3[_0xe6dd('0x54')][_0xe6dd('0x55')],'action':_0x52daa3['result']['action'],'actionIncomplete':_0x52daa3[_0xe6dd('0x54')][_0xe6dd('0x56')],'speech':_0x52daa3['result'][_0xe6dd('0x57')]['speech'],'score':_0x52daa3[_0xe6dd('0x54')]['score'],'statusCode':_0x52daa3[_0xe6dd('0x58')][_0xe6dd('0x59')],'endConversation':_0x52daa3[_0xe6dd('0x54')][_0xe6dd('0x5a')][_0xe6dd('0x5b')]||![],'isFallbackIntent':_0x52daa3[_0xe6dd('0x54')][_0xe6dd('0x5a')][_0xe6dd('0x5c')]};});};exports[_0xe6dd('0x5d')]=function(_0x5c2db0,_0x4ba73c,_0x4becd4,_0x1c3afd,_0x25afac,_0x1b52ec){var _0xe1a963=_0x1c3afd[_0xe6dd('0x5e')](/\\n/g,'\x0a');var _0x4e82fc={'credentials':{'private_key':_0xe1a963,'client_email':_0x4becd4}};var _0x4575ad=new dialogflow[(_0xe6dd('0x5f'))](_0x4e82fc);var _0x282c7c=_0x4575ad[_0xe6dd('0x60')](_0x4ba73c,md5(_0x5c2db0));var _0x91ddb4={'session':_0x282c7c,'queryInput':{'text':{'text':_0x25afac,'languageCode':_0x1b52ec}}};return _0x4575ad['detectIntent'](_0x91ddb4)[_0xe6dd('0x2f')](function(_0x14fa91){if(_0x14fa91&&_0x14fa91[_0xe6dd('0x40')]){logger[_0xe6dd('0x21')](_0xe6dd('0x61'),JSON[_0xe6dd('0x3b')](_0x14fa91));var _0x549a9e=_0x14fa91[0x0];if(_0x549a9e){var _0x6caf37={'action':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x63')],'allRequiredParamsPresent':_0x549a9e['queryResult'][_0xe6dd('0x64')],'endConversation':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x65')]&&_0x549a9e['queryResult']['diagnosticInfo']['fields']?_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x65')][_0xe6dd('0x66')][_0xe6dd('0x67')]['boolValue']:![],'fulfillmentText':_0x549a9e[_0xe6dd('0x62')]['fulfillmentText'],'intentName':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x68')]['name'],'intentDisplayName':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x68')][_0xe6dd('0x69')],'isFallbackIntent':_0x549a9e['queryResult'][_0xe6dd('0x68')]['isFallback'],'languageCode':_0x549a9e['queryResult']['languageCode'],'queryText':_0x549a9e[_0xe6dd('0x62')]['queryText'],'responseId':_0x549a9e[_0xe6dd('0x6a')],'score':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x6b')],'speech':_0x549a9e[_0xe6dd('0x62')][_0xe6dd('0x6c')],'providerResponse':JSON[_0xe6dd('0x3b')](_0x14fa91)};return _0x6caf37;}}});};exports['tildeASR']=function(_0x4eb109,_0x3540b8,_0x400d57,_0x34de53){return tilde[_0xe6dd('0x6d')](_0x4eb109,_0x3540b8,_0x400d57,_0x34de53)[_0xe6dd('0x2f')](function(_0x1d3628){try{fs[_0xe6dd('0x1a')](_0x4eb109);}catch(_0x1d1a38){logger[_0xe6dd('0x14')](_0x1d1a38);}logger[_0xe6dd('0x21')](_0xe6dd('0x6e'),_0x1d3628[_0xe6dd('0x4b')]);logger['info'](_0xe6dd('0x6f'),_0x1d3628['confidence']);return _0x1d3628;});};exports[_0xe6dd('0x70')]=function(_0xdd75f,_0x200696,_0x12064c,_0x100963,_0x1b9781,_0x11654b){var _0x12e0ad=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs['generate'](0x4)+_0xe6dd('0x45'));var _0x4c20b6;return aws['polly'](_0xdd75f,_0x200696,_0x12064c,_0x100963,_0x1b9781,_0x11654b,_0x12e0ad)['then'](function(){_0x4c20b6=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+_0xe6dd('0x34'));return convertFile(_0x12e0ad,_0x4c20b6);})['then'](function(){try{fs[_0xe6dd('0x1a')](_0x12e0ad);fs[_0xe6dd('0x33')](_0x4c20b6,'777');}catch(_0x5d6b44){logger[_0xe6dd('0x14')](_0x5d6b44);}return _0x4c20b6[_0xe6dd('0x36')]('.')[0x0];});};exports['awsLex']=function(_0x1c3118,_0x284b95,_0x23585f,_0x2554cf,_0x3b69b5,_0x1995ae){return aws[_0xe6dd('0x71')](_0x1c3118,_0x284b95,_0x23585f,_0x2554cf,_0x3b69b5,_0x1995ae)[_0xe6dd('0x2f')](function(_0x37d549){logger[_0xe6dd('0x21')](JSON['stringify'](_0x37d549));return _0x37d549;});};exports[_0xe6dd('0x72')]=function(_0x38be22,_0x39a5d4,_0x1fba9b,_0x358268){var _0x3a0967=util['format'](_0xe6dd('0x73'),ISPEECH_API,_0x38be22,encodeURIComponent(_0x39a5d4),_0x1fba9b,_0x358268);var _0x103d1e=path[_0xe6dd('0x23')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x3b7b95;return downloadFile(_0x3a0967,_0x103d1e)[_0xe6dd('0x2f')](function(){_0x3b7b95=path[_0xe6dd('0x23')](__dirname,_0xe6dd('0x24'),rs[_0xe6dd('0x25')](0x4)+_0xe6dd('0x34'));return convertFile(_0x103d1e,_0x3b7b95);})[_0xe6dd('0x2f')](function(){try{fs[_0xe6dd('0x1a')](_0x103d1e);fs['chmodSync'](_0x3b7b95,_0xe6dd('0x26'));}catch(_0x4d96b1){logger[_0xe6dd('0x14')](_0x4d96b1);}return _0x3b7b95[_0xe6dd('0x36')]('.')[0x0];});};exports['ispeechASR']=function(_0x16c5f8,_0x27073f,_0x29567d,_0x33ceae){var _0x23655e=util[_0xe6dd('0x74')](_0xe6dd('0x75'),ISPEECH_API,_0x27073f,_0x29567d,base64Encode(_0x16c5f8),_0x33ceae?util[_0xe6dd('0x74')](_0xe6dd('0x76'),encodeURIComponent(_0x33ceae)):_0xe6dd('0x77'));return uploadFile(_0x23655e)[_0xe6dd('0x2f')](function(_0x21722c){return querystring[_0xe6dd('0x78')](_0x21722c);});};exports['sestekNDA']=function(_0x16d62a,_0x4e531e){return sestek['nda'](_0x16d62a,_0x4e531e)[_0xe6dd('0x2f')](function(_0x1adecc){logger[_0xe6dd('0x21')](JSON[_0xe6dd('0x3b')](_0x1adecc));var _0xe517fb={'speech':_0x1adecc['text'],'action':_0x1adecc[_0xe6dd('0x79')]?_0x1adecc[_0xe6dd('0x79')][_0xe6dd('0x7a')]:undefined,'actiondata':_0x1adecc[_0xe6dd('0x79')]?_0x1adecc[_0xe6dd('0x79')][_0xe6dd('0x7b')]:undefined};if(_0x1adecc['channelData']&&_0x1adecc[_0xe6dd('0x79')][_0xe6dd('0x7c')]){return base64Decode(_0x1adecc[_0xe6dd('0x79')][_0xe6dd('0x7c')][_0xe6dd('0x7d')],path[_0xe6dd('0x23')](__dirname,'tmp',rs[_0xe6dd('0x25')](0x4)+_0xe6dd('0x34')))['then'](function(_0x5f121d){_0xe517fb[_0xe6dd('0x7e')]=_0x5f121d;return _0xe517fb;});}return _0xe517fb;});};exports[_0xe6dd('0x7f')]=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 8f34e03..63e5a3c 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x9222=['exports','./nda'];(function(_0x3f7784,_0x5bfa25){var _0x462b06=function(_0xb365e9){while(--_0xb365e9){_0x3f7784['push'](_0x3f7784['shift']());}};_0x462b06(++_0x5bfa25);}(_0x9222,0x1c1));var _0x2922=function(_0x596222,_0x29a665){_0x596222=_0x596222-0x0;var _0x2795bd=_0x9222[_0x596222];return _0x2795bd;};var nda=require(_0x2922('0x0'));module[_0x2922('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 4856c15..3c59166 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 _0x4b6c=['ndaactivity_type','message','Nda','callerid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xc4b6('0x0'));var url=require(_0xc4b6('0x1'));var logger=require('../../../../../config/logger')(_0xc4b6('0x2'));module[_0xc4b6('0x3')]=function(_0x116336,_0x5aef7d){var _0x1e80b2={'method':_0xc4b6('0x4'),'uri':url[_0xc4b6('0x5')](_0x5aef7d['ndauth_url'],_0xc4b6('0x6')),'form':{'grant_type':_0xc4b6('0x7'),'username':_0x5aef7d[_0xc4b6('0x8')],'password':_0x5aef7d[_0xc4b6('0x7')]},'json':!![]};return rp(_0x1e80b2)['then'](function(_0x443998){var _0x4b935f={'method':'POST','uri':url[_0xc4b6('0x5')](_0x5aef7d[_0xc4b6('0x9')],_0xc4b6('0xa')),'body':{'type':_0x5aef7d[_0xc4b6('0xb')]||_0xc4b6('0xc'),'channelId':_0xc4b6('0xd'),'conversation':{'id':_0x116336['uniqueid']},'from':{'id':_0x116336[_0xc4b6('0xe')],'name':_0x116336[_0xc4b6('0xf')]},'recipient':{'id':_0x116336['dnid'],'name':_0x116336[_0xc4b6('0x10')]},'text':_0x5aef7d[_0xc4b6('0x11')],'channelData':{}},'headers':{'Authorization':_0xc4b6('0x12')+_0x443998[_0xc4b6('0x13')]},'json':!![]};if(_0x5aef7d[_0xc4b6('0x14')]){_0x4b935f[_0xc4b6('0x15')][_0xc4b6('0x16')][_0xc4b6('0x17')]=_0x5aef7d[_0xc4b6('0x14')];}if(_0x5aef7d['ndagenerate_audio']=='1'){_0x4b935f[_0xc4b6('0x15')][_0xc4b6('0x16')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc4b6('0x18')};}if(_0x5aef7d['custom_action']){_0x4b935f[_0xc4b6('0x15')][_0xc4b6('0x16')][_0xc4b6('0x19')]=_0x5aef7d[_0xc4b6('0x1a')];if(_0x5aef7d['custom_action_data']){_0x4b935f['body'][_0xc4b6('0x16')][_0xc4b6('0x1b')]=_0x5aef7d[_0xc4b6('0x1c')];}}logger[_0xc4b6('0x1d')](JSON[_0xc4b6('0x1e')](_0x4b935f));return rp(_0x4b935f);});}; \ No newline at end of file +var _0xd820=['custom_action_data','info','stringify','request-promise','url','agi','exports','POST','resolve','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','extension','text','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData'];(function(_0x588a76,_0x4340a1){var _0x242b46=function(_0x1cb808){while(--_0x1cb808){_0x588a76['push'](_0x588a76['shift']());}};_0x242b46(++_0x4340a1);}(_0xd820,0x16f));var _0x0d82=function(_0x37a666,_0x5ce1cd){_0x37a666=_0x37a666-0x0;var _0x3c1ce5=_0xd820[_0x37a666];return _0x3c1ce5;};'use strict';var rp=require(_0x0d82('0x0'));var url=require(_0x0d82('0x1'));var logger=require('../../../../../config/logger')(_0x0d82('0x2'));module[_0x0d82('0x3')]=function(_0x58cb7a,_0x55f08a){var _0x1dfc8b={'method':_0x0d82('0x4'),'uri':url[_0x0d82('0x5')](_0x55f08a['ndauth_url'],'/token'),'form':{'grant_type':_0x0d82('0x6'),'username':_0x55f08a[_0x0d82('0x7')],'password':_0x55f08a[_0x0d82('0x6')]},'json':!![]};return rp(_0x1dfc8b)[_0x0d82('0x8')](function(_0x498585){var _0x36e7b4={'method':_0x0d82('0x4'),'uri':url['resolve'](_0x55f08a['ndassistant_url'],_0x0d82('0x9')),'body':{'type':_0x55f08a[_0x0d82('0xa')]||_0x0d82('0xb'),'channelId':'Nda','conversation':{'id':_0x58cb7a['uniqueid']},'from':{'id':_0x58cb7a[_0x0d82('0xc')],'name':_0x58cb7a[_0x0d82('0xd')]},'recipient':{'id':_0x58cb7a[_0x0d82('0xe')],'name':_0x58cb7a[_0x0d82('0xf')]},'text':_0x55f08a[_0x0d82('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x498585['access_token']},'json':!![]};if(_0x55f08a[_0x0d82('0x11')]){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')]['ProjectName']=_0x55f08a[_0x0d82('0x11')];}if(_0x55f08a[_0x0d82('0x14')]=='1'){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')][_0x0d82('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0d82('0x16')};}if(_0x55f08a[_0x0d82('0x17')]){_0x36e7b4[_0x0d82('0x12')][_0x0d82('0x13')]['CustomAction']=_0x55f08a[_0x0d82('0x17')];if(_0x55f08a['custom_action_data']){_0x36e7b4[_0x0d82('0x12')]['channelData'][_0x0d82('0x18')]=_0x55f08a[_0x0d82('0x19')];}}logger[_0x0d82('0x1a')](JSON[_0x0d82('0x1b')](_0x36e7b4));return rp(_0x36e7b4);});}; \ 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 0e3e046..69ae974 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x1a7511,_0x4941d3,_0x418ff8,_0x5ee64c){return asr(_0x1a7511,_0x4941d3,_0x418ff8,_0x5ee64c);}; \ No newline at end of file +var _0x2313=['exports','./lib/api'];(function(_0x52b844,_0x434e67){var _0x14432f=function(_0x6b692a){while(--_0x6b692a){_0x52b844['push'](_0x52b844['shift']());}};_0x14432f(++_0x434e67);}(_0x2313,0x145));var _0x3231=function(_0x6e27ef,_0x3473f8){_0x6e27ef=_0x6e27ef-0x0;var _0x195059=_0x2313[_0x6e27ef];return _0x195059;};'use strict';var asr=require(_0x3231('0x0'));module[_0x3231('0x1')]=function(_0x48002a,_0x4c5ffa,_0x40ad58,_0x57697f){return asr(_0x48002a,_0x4c5ffa,_0x40ad58,_0x57697f);}; \ 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 e4cbf46..4262724 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 _0x7833=['exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','digest','hex','info','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','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.','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','close','bluebird','lodash','moment','../../../../../../config/logger'];(function(_0x293734,_0x2d25ab){var _0x4f2a1a=function(_0x50d4e7){while(--_0x50d4e7){_0x293734['push'](_0x293734['shift']());}};_0x4f2a1a(++_0x2d25ab);}(_0x7833,0x114));var _0x3783=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x7833[_0xbf8ebe];return _0x1e25e8;};'use strict';var BPromise=require(_0x3783('0x0'));var _=require(_0x3783('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3783('0x2'));var crypto=require('crypto');var logger=require(_0x3783('0x3'))('agi');module[_0x3783('0x4')]=function(_0x253a24,_0x28be04,_0x1807ad,_0x509f36){return new BPromise(function(_0xc6da48,_0x364623){logger['info']('Tilde\x20URI',_0x509f36||_0x3783('0x5'));var _0x2ead66=new WebSocket(_0x509f36||_0x3783('0x5'),{'perMessageDeflate':![]});var _0x2807de='';var _0x38e4eb='0';var _0x4414a0='1';var _0x4a80e3=_0x3783('0x6');function _0x2d6dd7(_0x2ca3f6){var _0x17a6ec=crypto[_0x3783('0x7')]('sha1');_0x17a6ec['update'](_0x2ca3f6);return _0x17a6ec[_0x3783('0x8')](_0x3783('0x9'));}function _0x525b0a(){try{logger[_0x3783('0xa')]('Open\x20Tilde\x20ASR\x20socket');var _0x2beae8=moment()[_0x3783('0xb')]();var _0x42708a=_0x2d6dd7(_0x2beae8+_0x28be04+_0x1807ad);_0x2ead66[_0x3783('0xc')](JSON[_0x3783('0xd')]({'appID':_0x28be04,'timestamp':_0x2beae8,'appKey':_0x42708a}));var _0x7fe866=fs['createReadStream'](_0x253a24);_0x7fe866['on'](_0x3783('0xe'),function(_0x55a5af){_0x2ead66[_0x3783('0xc')](_0x55a5af);});_0x7fe866['on']('close',function(){_0x2ead66[_0x3783('0xc')](_0x3783('0xf'));});}catch(_0x57c9ab){logger[_0x3783('0x10')](_0x3783('0x11'),JSON[_0x3783('0xd')](_0x57c9ab));_0x2ead66[_0x3783('0x12')]();}}function _0x2b6b17(_0xdbc089){try{if(_0xdbc089){var _0x1aced2=JSON[_0x3783('0x13')](_0xdbc089);switch(_0x1aced2[_0x3783('0x14')]){case 0x0:if(_0x1aced2[_0x3783('0x15')]){if(_0x1aced2[_0x3783('0x15')][_0x3783('0x16')]){logger['info'](_0x3783('0x17'),JSON[_0x3783('0xd')](_0x1aced2[_0x3783('0x15')][_0x3783('0x18')]));_0x2807de=_0x1aced2[_0x3783('0x15')][_0x3783('0x18')][0x0][_0x3783('0x19')];_0x38e4eb=_0x1aced2['result'][_0x3783('0x18')][0x0]['likelihood'];_0x4414a0='0';_0x4a80e3='Success.';_0x2ead66['terminate']();}}break;case 0x1:logger[_0x3783('0xa')](_0x3783('0x6'));_0x4414a0='1';_0x4a80e3=_0x3783('0x6');break;case 0x2:logger['info'](_0x3783('0x1a'));_0x4414a0='2';_0x4a80e3=_0x3783('0x1a');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4414a0='9';_0x4a80e3=_0x3783('0x1b');break;case 0xa:logger[_0x3783('0xa')](_0x3783('0x1c'));_0x4414a0='10';_0x4a80e3=_0x3783('0x1c');break;case 0xb:logger['info'](_0x3783('0x1d'));_0x4414a0='11';_0x4a80e3='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5ee726){logger[_0x3783('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x5ee726));_0x2ead66['terminate']();}}function _0x250c03(){logger[_0x3783('0xa')]('Close\x20Tilde\x20ASR\x20socket');_0xc6da48({'transcript':_0x2807de,'confidence':_0x38e4eb,'status':_0x4414a0,'status_message':_0x4a80e3});}function _0x2d37af(_0xac410f){logger[_0x3783('0x10')](_0x3783('0x1e'));if(!_[_0x3783('0x1f')](_0xac410f)){logger[_0x3783('0x10')](_['isObject'](_0xac410f)?JSON[_0x3783('0xd')](_0xac410f):_0xac410f);}}_0x2ead66['on'](_0x3783('0x20'),_0x525b0a);_0x2ead66['on'](_0x3783('0x21'),_0x2b6b17);_0x2ead66['on'](_0x3783('0x22'),_0x250c03);_0x2ead66['on'](_0x3783('0x10'),_0x2d37af);});}; \ No newline at end of file +var _0x4f9c=['Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','close','send','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4f9c,0x1e8));var _0xc4f9=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x4f9c[_0x4d9bb2];return _0x3179fe;};'use strict';var BPromise=require(_0xc4f9('0x0'));var _=require(_0xc4f9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc4f9('0x2'));var crypto=require(_0xc4f9('0x3'));var logger=require(_0xc4f9('0x4'))(_0xc4f9('0x5'));module[_0xc4f9('0x6')]=function(_0x26f138,_0x3d8d93,_0x4fde7c,_0x3ee9f8){return new BPromise(function(_0x240e4b,_0x3bead4){logger[_0xc4f9('0x7')](_0xc4f9('0x8'),_0x3ee9f8||_0xc4f9('0x9'));var _0x212241=new WebSocket(_0x3ee9f8||_0xc4f9('0x9'),{'perMessageDeflate':![]});var _0x49246c='';var _0x1cc0a1='0';var _0x477494='1';var _0x35016b=_0xc4f9('0xa');function _0xb53c61(_0x309a07){var _0x48b86c=crypto[_0xc4f9('0xb')](_0xc4f9('0xc'));_0x48b86c['update'](_0x309a07);return _0x48b86c[_0xc4f9('0xd')](_0xc4f9('0xe'));}function _0x40410d(){try{logger['info'](_0xc4f9('0xf'));var _0x3e6b51=moment()[_0xc4f9('0x10')]();var _0x197019=_0xb53c61(_0x3e6b51+_0x3d8d93+_0x4fde7c);_0x212241['send'](JSON[_0xc4f9('0x11')]({'appID':_0x3d8d93,'timestamp':_0x3e6b51,'appKey':_0x197019}));var _0x437c1e=fs[_0xc4f9('0x12')](_0x26f138);_0x437c1e['on'](_0xc4f9('0x13'),function(_0x4361f3){_0x212241['send'](_0x4361f3);});_0x437c1e['on'](_0xc4f9('0x14'),function(){_0x212241[_0xc4f9('0x15')](_0xc4f9('0x16'));});}catch(_0xd5b735){logger['error'](_0xc4f9('0x17'),JSON[_0xc4f9('0x11')](_0xd5b735));_0x212241[_0xc4f9('0x18')]();}}function _0x1f5844(_0x17de22){try{if(_0x17de22){var _0x343121=JSON[_0xc4f9('0x19')](_0x17de22);switch(_0x343121[_0xc4f9('0x1a')]){case 0x0:if(_0x343121[_0xc4f9('0x1b')]){if(_0x343121[_0xc4f9('0x1b')]['final']){logger[_0xc4f9('0x7')](_0xc4f9('0x1c'),JSON[_0xc4f9('0x11')](_0x343121[_0xc4f9('0x1b')][_0xc4f9('0x1d')]));_0x49246c=_0x343121['result'][_0xc4f9('0x1d')][0x0]['transcript'];_0x1cc0a1=_0x343121[_0xc4f9('0x1b')][_0xc4f9('0x1d')][0x0][_0xc4f9('0x1e')];_0x477494='0';_0x35016b=_0xc4f9('0x1f');_0x212241[_0xc4f9('0x18')]();}}break;case 0x1:logger[_0xc4f9('0x7')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x477494='1';_0x35016b=_0xc4f9('0xa');break;case 0x2:logger[_0xc4f9('0x7')](_0xc4f9('0x20'));_0x477494='2';_0x35016b='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x477494='9';_0x35016b=_0xc4f9('0x21');break;case 0xa:logger[_0xc4f9('0x7')](_0xc4f9('0x22'));_0x477494='10';_0x35016b='Authentication\x20failed.';break;case 0xb:logger[_0xc4f9('0x7')](_0xc4f9('0x23'));_0x477494='11';_0x35016b='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x32481a){logger[_0xc4f9('0x24')](_0xc4f9('0x25'),JSON[_0xc4f9('0x11')](_0x32481a));_0x212241['terminate']();}}function _0x58b685(){logger[_0xc4f9('0x7')](_0xc4f9('0x26'));_0x240e4b({'transcript':_0x49246c,'confidence':_0x1cc0a1,'status':_0x477494,'status_message':_0x35016b});}function _0x51423c(_0xf65d74){logger[_0xc4f9('0x24')](_0xc4f9('0x27'));if(!_[_0xc4f9('0x28')](_0xf65d74)){logger[_0xc4f9('0x24')](_[_0xc4f9('0x29')](_0xf65d74)?JSON['stringify'](_0xf65d74):_0xf65d74);}}_0x212241['on'](_0xc4f9('0x2a'),_0x40410d);_0x212241['on']('message',_0x1f5844);_0x212241['on'](_0xc4f9('0x14'),_0x58b685);_0x212241['on'](_0xc4f9('0x24'),_0x51423c);});}; \ 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 3d2235f..f1e738e 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 _0x4b15=['./asr','exports'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x4b15,0x116));var _0x54b1=function(_0x410fe5,_0x215889){_0x410fe5=_0x410fe5-0x0;var _0x21c73b=_0x4b15[_0x410fe5];return _0x21c73b;};var asr=require(_0x54b1('0x0'));module[_0x54b1('0x1')]={'asr':asr}; \ No newline at end of file +var _0xba5e=['exports'];(function(_0x4afb60,_0x845b07){var _0x29186d=function(_0x74d5ea){while(--_0x74d5ea){_0x4afb60['push'](_0x4afb60['shift']());}};_0x29186d(++_0x845b07);}(_0xba5e,0x1e6));var _0xeba5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xba5e[_0x122ef9];return _0x42fba0;};var asr=require('./asr');module[_0xeba5('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7629cac..0b78278 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 _0xdf01=['ready','code','close','inherits','exports','EventEmitter','./error','./channel','127.0.0.1','error','E_AGI_ARGUMENT_PORT','createServer','listen','emit','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xdf01,0x159));var _0x1df0=function(_0x521171,_0x48b13a){_0x521171=_0x521171-0x0;var _0x56d1f4=_0xdf01[_0x521171];return _0x56d1f4;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require('events')[_0x1df0('0x0')];var AGIError=require(_0x1df0('0x1'));var AGIChannel=require(_0x1df0('0x2'));var AGIServer=function(_0x370cbc,_0x366d2d,_0x474158){var _0x463254=this,_0x370cbc=_0x370cbc||0x11dd,_0x366d2d=_0x366d2d||_0x1df0('0x3'),_0xdfca37=null,_0x3f3c5e=0x0;EventEmitter['call'](_0x463254);function _0x33c7c2(){if(!_0x370cbc){_0x463254['emit'](_0x1df0('0x4'),new AGIError(_0x1df0('0x5')));return![];}_0xdfca37=net[_0x1df0('0x6')]();_0xdfca37[_0x1df0('0x7')](_0x370cbc,_0x366d2d);_0xdfca37['on']('listening',function(){_0x463254[_0x1df0('0x8')](_0x1df0('0x9'));});_0xdfca37['on'](_0x1df0('0xa'),function(_0x11cb08){_0xdfca37['getConnections'](function(_0x2eebfc,_0x40779f){if(_0x2eebfc){_0x463254[_0x1df0('0x8')](_0x1df0('0x4'),new AGIError(_0x1df0('0xb'),_0x2eebfc));}else if(_0x474158&&_0x474158<0x0){_0x463254['emit'](_0x1df0('0x4'),new AGIError(_0x1df0('0xc')));_0x11cb08[_0x1df0('0xd')]();}else if(_0x474158&&_0x474158>0x0&&_0x474158<_0x40779f){_0x3f3c5e+=0x1;_0x463254[_0x1df0('0x8')](_0x1df0('0x4'),new AGIError(_0x1df0('0xe'),_0x3f3c5e));_0x11cb08[_0x1df0('0xd')]();}else{var _0x40887e=new AGIChannel(_0x11cb08);_0x40887e['on'](_0x1df0('0xf'),function(){_0x463254['emit'](_0x1df0('0xa'),_0x40887e);});}});});_0xdfca37['on'](_0x1df0('0x4'),function(_0x3a8681){_0x463254[_0x1df0('0x8')](_0x1df0('0x4'),new AGIError('E_AGI_SERVER_ERROR',_0x3a8681[_0x1df0('0x10')]));});_0xdfca37['on'](_0x1df0('0x11'),function(){_0x463254[_0x1df0('0x8')](_0x1df0('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x33c7c2();});};util[_0x1df0('0x12')](AGIServer,EventEmitter);module[_0x1df0('0x13')]=function(_0x292489,_0xd99313,_0x4a9a85){return new AGIServer(_0x292489,_0xd99313,_0x4a9a85);}; \ No newline at end of file +var _0x7577=['listening','emit','connection','E_AGI_SERVER_ERROR','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','./error','./channel','127.0.0.1','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x7577,0x1b0));var _0x7757=function(_0x5e46a2,_0x1df66e){_0x5e46a2=_0x5e46a2-0x0;var _0x51959d=_0x7577[_0x5e46a2];return _0x51959d;};'use strict';var util=require(_0x7757('0x0'));var net=require('net');var EventEmitter=require(_0x7757('0x1'))['EventEmitter'];var AGIError=require(_0x7757('0x2'));var AGIChannel=require(_0x7757('0x3'));var AGIServer=function(_0x4ab473,_0x40cfe1,_0x37d56a){var _0x2cd7c0=this,_0x4ab473=_0x4ab473||0x11dd,_0x40cfe1=_0x40cfe1||_0x7757('0x4'),_0x36b479=null,_0x12df87=0x0;EventEmitter['call'](_0x2cd7c0);function _0x4f835e(){if(!_0x4ab473){_0x2cd7c0['emit']('error',new AGIError(_0x7757('0x5')));return![];}_0x36b479=net[_0x7757('0x6')]();_0x36b479[_0x7757('0x7')](_0x4ab473,_0x40cfe1);_0x36b479['on'](_0x7757('0x8'),function(){_0x2cd7c0[_0x7757('0x9')](_0x7757('0x8'));});_0x36b479['on'](_0x7757('0xa'),function(_0x9ca2a1){_0x36b479['getConnections'](function(_0x20be95,_0x1ce109){if(_0x20be95){_0x2cd7c0[_0x7757('0x9')]('error',new AGIError(_0x7757('0xb'),_0x20be95));}else if(_0x37d56a&&_0x37d56a<0x0){_0x2cd7c0[_0x7757('0x9')](_0x7757('0xc'),new AGIError(_0x7757('0xd')));_0x9ca2a1[_0x7757('0xe')]();}else if(_0x37d56a&&_0x37d56a>0x0&&_0x37d56a<_0x1ce109){_0x12df87+=0x1;_0x2cd7c0[_0x7757('0x9')](_0x7757('0xc'),new AGIError(_0x7757('0xf'),_0x12df87));_0x9ca2a1[_0x7757('0xe')]();}else{var _0x30d28e=new AGIChannel(_0x9ca2a1);_0x30d28e['on'](_0x7757('0x10'),function(){_0x2cd7c0[_0x7757('0x9')](_0x7757('0xa'),_0x30d28e);});}});});_0x36b479['on']('error',function(_0x53eecd){_0x2cd7c0['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x53eecd['code']));});_0x36b479['on'](_0x7757('0x11'),function(){_0x2cd7c0[_0x7757('0x9')](_0x7757('0x11'),new AGIError(_0x7757('0x12')));});}process[_0x7757('0x13')](function(){_0x4f835e();});};util[_0x7757('0x14')](AGIServer,EventEmitter);module[_0x7757('0x15')]=function(_0x5034af,_0x8757e4,_0x5b5c73){return new AGIServer(_0x5034af,_0x8757e4,_0x5b5c73);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e378b95..8abbff6 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 _0x6946=['name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','context','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','url','method','number','timeout','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','includes','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','isString','saveRestApiResult','format','%s.%s','setVariable','stringify','split','replaceAll','extra','getAndSetVariable','result','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','callback_priority','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','RECOG_INPUT()','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','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','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','subject','Smtp','service','host','port','secure','user','pass','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then'];(function(_0x369387,_0x219e9d){var _0x5507ba=function(_0x22cdee){while(--_0x22cdee){_0x369387['push'](_0x369387['shift']());}};_0x5507ba(++_0x219e9d);}(_0x6946,0x1b3));var _0x6694=function(_0x1f64f0,_0x189746){_0x1f64f0=_0x1f64f0-0x0;var _0x4e2707=_0x6946[_0x1f64f0];return _0x4e2707;};'use strict';var fs=require('fs');var path=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var _=require(_0x6694('0x2'));var sh=require(_0x6694('0x3'));var odbc=require(_0x6694('0x4'))();var rs=require(_0x6694('0x5'));var moment=require(_0x6694('0x6'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x6694('0x7'))(_0x6694('0x8'));var config=require(_0x6694('0x9'));var scripts=require(_0x6694('0xa'));var FILES_PATH=_0x6694('0xb');var recursiveMapAttributes=[_0x6694('0xc'),_0x6694('0xd')];var verticesWithRetry=[_0x6694('0xe'),_0x6694('0xf'),'getsecretdigits'];var AGIVertices=function(_0x534d59,_0x4187a2,_0x348390){this[_0x6694('0x10')]=_0x534d59;this[_0x6694('0x11')]=_0x4187a2;this[_0x6694('0x12')]=_0x348390;};AGIVertices[_0x6694('0x13')][_0x6694('0x14')]=function(_0x480be9,_0x3762ab){this[_0x6694('0x11')][_0x6694('0x15')](_0x480be9)[_0x6694('0x16')](function(_0x51a6e9){_0x3762ab(null,_0x51a6e9?_0x51a6e9[_0x6694('0x17')]:![]);})[_0x6694('0x18')](function(_0x23b640){_0x3762ab(_0x23b640);});};AGIVertices[_0x6694('0x13')][_0x6694('0x19')]=function(_0x379b37,_0x2b22a4){this['rpc'][_0x6694('0x1a')](_0x379b37)[_0x6694('0x16')](function(_0x3a6359){_0x2b22a4(null,_0x3a6359?_0x3a6359[_0x6694('0x17')]:![]);})[_0x6694('0x18')](function(_0xbc0b6){_0x2b22a4(_0xbc0b6);});};AGIVertices[_0x6694('0x13')]['getSquareProject']=function(_0x19ab96,_0x485cd9){this[_0x6694('0x11')][_0x6694('0x1b')](_0x19ab96)[_0x6694('0x16')](function(_0x4286ad){_0x485cd9(null,_0x4286ad?_0x4286ad[_0x6694('0x17')]:![]);})[_0x6694('0x18')](function(_0x3b2be6){_0x485cd9(_0x3b2be6);});};AGIVertices[_0x6694('0x13')][_0x6694('0x1c')]=function(_0x53185a,_0x5d5bc2){this[_0x6694('0x11')]['getSquareOdbcById'](_0x53185a)[_0x6694('0x16')](function(_0xab1d7e){_0x5d5bc2(null,_0xab1d7e?_0xab1d7e['dsn']:![]);})['catch'](function(_0x336883){_0x5d5bc2(_0x336883);});};AGIVertices[_0x6694('0x13')][_0x6694('0x1d')]=function(_0x411009,_0x436a7e){this['rpc'][_0x6694('0x1e')](_0x411009)[_0x6694('0x16')](function(_0xd65993){_0x436a7e(null,_0xd65993?_0xd65993[_0x6694('0x17')]:![]);})[_0x6694('0x18')](function(_0x2cb470){_0x436a7e(_0x2cb470);});};AGIVertices[_0x6694('0x13')][_0x6694('0x1f')]=function(_0x278723,_0x9cf925){this['rpc'][_0x6694('0x20')](_0x278723)['then'](function(_0x3554d7){_0x9cf925(null,_0x3554d7?_0x3554d7[_0x6694('0x17')]:![]);})['catch'](function(_0x462ef1){_0x9cf925(_0x462ef1);});};AGIVertices[_0x6694('0x13')][_0x6694('0x21')]=function(_0x15bc19,_0x59c02a){var _0x172a86=this;this[_0x6694('0x11')][_0x6694('0x22')](_0x15bc19)['then'](function(_0x305ab6){_0x59c02a(null,_0x305ab6?_0x172a86[_0x6694('0x23')](_0x305ab6[_0x6694('0x24')]):![]);})[_0x6694('0x18')](function(_0x4e2536){_0x59c02a(_0x4e2536);});};AGIVertices['prototype']['getMailAccount']=function(_0x5e521b,_0x4f8f0b){this[_0x6694('0x11')][_0x6694('0x25')](_0x5e521b)[_0x6694('0x16')](function(_0x136735){_0x4f8f0b(null,_0x136735?_0x136735:![]);})['catch'](function(_0x467774){_0x4f8f0b(_0x467774);});};AGIVertices[_0x6694('0x13')][_0x6694('0x26')]=function(_0x5a8fa0,_0x4a3dc6,_0x40f3b7){this['mailRpc']['sendMailMessage'](_0x5a8fa0,_0x4a3dc6)[_0x6694('0x16')](function(){_0x40f3b7(null);})[_0x6694('0x18')](function(_0x5469a6){_0x40f3b7(_0x5469a6);});};AGIVertices['prototype'][_0x6694('0x27')]=function(_0x2108b9,_0x3d7c7e){this[_0x6694('0x11')][_0x6694('0x28')](_0x2108b9)['then'](function(_0x1c0641){if(_0x1c0641){if(_0x1c0641[_0x6694('0x29')]){_0x3d7c7e(null,[_0x1c0641[_0x6694('0x2a')]]);}else{_0x3d7c7e(null,_[_0x6694('0x2b')](_0x1c0641[_0x6694('0x2c')],_0x6694('0x2a')));}}else{_0x3d7c7e(null,![]);}})['catch'](function(_0x2b80ce){_0x3d7c7e(_0x2b80ce);});};AGIVertices[_0x6694('0x13')][_0x6694('0x23')]=function(_0x6797){return util['format'](_0x6694('0x2d'),FILES_PATH,_0x6797);};AGIVertices[_0x6694('0x13')][_0x6694('0x2e')]=function(_0x4b9200,_0x177983,_0x273f2f){odbc[_0x6694('0x2f')](_0x4b9200,function(_0x68b9a3){if(_0x68b9a3){logger[_0x6694('0x30')](_0x6694('0x31'),_0x68b9a3);_0x273f2f(_0x68b9a3);}else{logger['info'](_0x6694('0x32'));odbc[_0x6694('0x33')](_0x177983,function(_0x3fd3d4,_0x561d98){if(_0x3fd3d4){logger[_0x6694('0x34')](_0x6694('0x35'),_0x177983);_0x273f2f(_0x3fd3d4);}else{logger[_0x6694('0x34')](_0x6694('0x36'),_0x177983);odbc[_0x6694('0x37')](function(_0x44680e){if(_0x44680e){logger['error'](_0x6694('0x38'),_0x44680e);}_0x273f2f(null,_0x561d98);});}});}});};AGIVertices['prototype'][_0x6694('0x39')]=function(_0x5ef877,_0x38aa7d){this[_0x6694('0x11')][_0x6694('0x3a')](_0x5ef877)['then'](function(_0x372cb6){_0x38aa7d(null,_0x372cb6?_0x372cb6:![]);})[_0x6694('0x18')](function(_0x14d730){_0x38aa7d(_0x14d730);});};AGIVertices['prototype'][_0x6694('0x3b')]=function(_0x190643,_0x202c7a){this[_0x6694('0x11')]['createSmsMessage'](_0x190643)['then'](function(_0xc332cd){_0x202c7a(null,_0xc332cd);})[_0x6694('0x18')](function(_0x2abeb6){_0x202c7a(_0x2abeb6);});};AGIVertices[_0x6694('0x13')][_0x6694('0x3c')]=function(_0x41728f,_0x5bd73a,_0x518dfa){this[_0x6694('0x11')][_0x6694('0x3c')]({'uniqueid':this[_0x6694('0x10')]['uniqueid'],'node':_0x41728f[_0x6694('0x3d')],'application':_0x41728f[_0x6694('0x3e')],'data':_0x5bd73a||null,'project_name':this[_0x6694('0x10')]['arg_1'],'callerid':this[_0x6694('0x10')][_0x6694('0x3f')]})['then'](function(_0xa74ec3){if(_0x518dfa){_0x518dfa(null,_0xa74ec3);}})[_0x6694('0x18')](function(_0x100ad9){if(_0x518dfa){_0x518dfa(_0x100ad9);}});};AGIVertices[_0x6694('0x13')][_0x6694('0x40')]=function(_0x18a6ed,_0x233347,_0x3c9248,_0x31c8ea){this[_0x6694('0x11')][_0x6694('0x40')]({'uniqueid':this[_0x6694('0x10')][_0x6694('0x41')],'callerid':this[_0x6694('0x10')][_0x6694('0x3f')],'calleridname':this[_0x6694('0x10')]['calleridname'],'context':this[_0x6694('0x10')][_0x6694('0x42')],'extension':this[_0x6694('0x10')]['extension'],'priority':this[_0x6694('0x10')]['priority'],'accountcode':this[_0x6694('0x10')][_0x6694('0x43')],'dnid':this['channel']['dnid'],'projectName':this[_0x6694('0x10')][_0x6694('0x44')],'saveName':_0x233347,'filename':_0x18a6ed[_0x6694('0x45')]||_0x233347,'savePath':_0x3c9248})[_0x6694('0x16')](function(_0x338570){_0x31c8ea(null,_0x338570);})['catch'](function(_0x358d5e){_0x31c8ea(_0x358d5e);});};AGIVertices[_0x6694('0x13')][_0x6694('0x46')]=function(_0x49be6e,_0x1b83cb,_0x4882bb,_0x45b553,_0x55d774){this['rpc'][_0x6694('0x46')]({'uniqueid':this[_0x6694('0x10')][_0x6694('0x41')],'body':_0x49be6e,'direction':_0x1b83cb,'providerName':_0x4882bb,'providerResponse':_0x45b553})[_0x6694('0x16')](function(_0x564492){if(_0x55d774){_0x55d774(null,_0x564492);}})[_0x6694('0x18')](function(_0x4889d4){if(_0x55d774){_0x55d774(_0x4889d4);}});};AGIVertices[_0x6694('0x13')][_0x6694('0x47')]=function(_0x1b4231,_0x48de24){this[_0x6694('0x11')][_0x6694('0x47')]({'firstName':_[_0x6694('0x48')](_0x1b4231[_0x6694('0x17')])||_[_0x6694('0x49')](_0x1b4231[_0x6694('0x17')])?'callback_'+Math[_0x6694('0x4a')]():_0x1b4231[_0x6694('0x17')],'lastName':_['isEmpty'](_0x1b4231[_0x6694('0x4b')])||_[_0x6694('0x49')](_0x1b4231[_0x6694('0x4b')])?null:_0x1b4231[_0x6694('0x4b')],'phone':_0x1b4231[_0x6694('0x4c')],'ListId':_0x1b4231[_0x6694('0x4d')],'scheduledat':_0x1b4231[_0x6694('0x4e')],'callbackUniqueid':this[_0x6694('0x10')][_0x6694('0x41')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x1b4231[_0x6694('0x4e')][_0x6694('0x4f')](),'priority':_0x1b4231['callback_priority']})[_0x6694('0x16')](function(_0xfd96f5){_0x48de24(null,_0xfd96f5);})[_0x6694('0x18')](function(_0x1324b8){_0x48de24(_0x1324b8);});};AGIVertices[_0x6694('0x13')][_0x6694('0x50')]=function(_0x343a4f,_0x34d71d){this['rpc'][_0x6694('0x51')](_0x343a4f)[_0x6694('0x16')](function(_0x2941ba){_0x34d71d(null,_0x2941ba?_0x2941ba[_0x6694('0x17')]:![]);})['catch'](function(_0x4a5897){_0x34d71d(_0x4a5897);});};AGIVertices['prototype'][_0x6694('0x52')]=function(_0x4a2873,_0x3a0798,_0x6ef3d9){var _0x35d55b={'role':_0x6694('0x53')};_0x35d55b[_0x4a2873]=this[_0x6694('0x10')]['callerid'];this[_0x6694('0x11')]['agentPause'](_0x35d55b,_0x3a0798,this['channel'][_0x6694('0x41')])[_0x6694('0x16')](function(_0x703c38){_0x6ef3d9(null,_[_0x6694('0x49')](_0x703c38)?![]:!![]);})[_0x6694('0x18')](function(_0x1254b9){logger[_0x6694('0x30')](_0x1254b9);_0x6ef3d9(null,![]);});};AGIVertices[_0x6694('0x13')][_0x6694('0x54')]=function(_0x2b26c9,_0x26cb70){var _0x41af04={'role':'agent'};_0x41af04[_0x2b26c9]=this[_0x6694('0x10')][_0x6694('0x3f')];this['rpc'][_0x6694('0x54')](_0x41af04)['then'](function(_0x200827){_0x26cb70(null,_[_0x6694('0x49')](_0x200827)?![]:!![]);})[_0x6694('0x18')](function(_0x43caa7){logger['error'](_0x43caa7);_0x26cb70(null,![]);});};AGIVertices['prototype'][_0x6694('0x55')]=function(_0x131a1f,_0x5c9d96){var _0x3c589c={'role':_0x6694('0x53')};_0x3c589c[_0x131a1f]=this['channel'][_0x6694('0x3f')];this[_0x6694('0x11')][_0x6694('0x55')](_0x3c589c)[_0x6694('0x16')](function(_0x57d1f9){_0x5c9d96(null,_[_0x6694('0x49')](_0x57d1f9)?![]:!![]);})[_0x6694('0x18')](function(_0x4b7a71){logger[_0x6694('0x30')](_0x4b7a71);_0x5c9d96(null,![]);});};AGIVertices[_0x6694('0x13')][_0x6694('0x56')]=function(_0x40edd6,_0x410d2d){var _0x5ab909={'role':_0x6694('0x53')};_0x5ab909[_0x40edd6]=this[_0x6694('0x10')][_0x6694('0x3f')];var _0x4f8ddc=_0x40edd6!=_0x6694('0x57')?util['format'](_0x6694('0x58'),_0x6694('0x59'),this['channel']['callerid']):undefined;this[_0x6694('0x11')][_0x6694('0x56')](_0x5ab909,_0x4f8ddc)['then'](function(_0x209518){_0x410d2d(null,_[_0x6694('0x49')](_0x209518)?![]:!![]);})[_0x6694('0x18')](function(_0x24174f){logger[_0x6694('0x30')](_0x24174f);_0x410d2d(null,![]);});};AGIVertices[_0x6694('0x13')][_0x6694('0x5a')]=function(_0x461181,_0xafa5f5){sh[_0x6694('0x5b')](_['trim'](_0x461181),function(_0x63a86b,_0x15645d){var _0x1fb5b3=_0x15645d[_0x6694('0x5c')](/(\r\n|\n|\r)/gm,'');_0xafa5f5(null,_0x1fb5b3);});};AGIVertices[_0x6694('0x13')][_0x6694('0x5d')]=function(_0x1d938a,_0x1cb99b){scripts[_0x6694('0x5d')](_0x1d938a[_0x6694('0x5e')],_0x1d938a[_0x6694('0x5f')]||_0x6694('0x60'),_0x1d938a[_0x6694('0x60')],_0x1d938a[_0x6694('0x61')]||_0x6694('0x62'),_0x1d938a[_0x6694('0x63')]||'MALE',_0x1d938a[_0x6694('0x64')]||_0x6694('0x65'))[_0x6694('0x16')](function(_0x1fbcbd){_0x1cb99b(null,_0x1fbcbd);})[_0x6694('0x18')](function(_0x56baaf){_0x1cb99b(_0x56baaf);});};AGIVertices[_0x6694('0x13')][_0x6694('0x66')]=function(_0xc7b26f,_0x51e5bd){scripts[_0x6694('0x66')](_0xc7b26f[_0x6694('0x60')],_0xc7b26f[_0x6694('0x67')]||'en',0x1)[_0x6694('0x16')](function(_0x1da790){_0x51e5bd(null,_0x1da790);})[_0x6694('0x18')](function(_0x2cd114){_0x51e5bd(_0x2cd114);});};AGIVertices['prototype']['restAPI']=function(_0x1ec9a9,_0x3b0f86){var _0x45ff70={'uri':_0x1ec9a9[_0x6694('0x68')],'method':_0x1ec9a9[_0x6694('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1ec9a9['timeout'])===_0x6694('0x6a')&&parseInt(_0x1ec9a9['timeout'])>=0x1?parseInt(_0x1ec9a9[_0x6694('0x6b')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x6694('0x6c'),_0x6694('0x6d')],_0x45ff70[_0x6694('0x69')][_0x6694('0x6e')]())){try{_0x45ff70[_0x6694('0x6f')]=_0x1ec9a9[_0x6694('0xd')]?JSON[_0x6694('0x70')](_0x1ec9a9[_0x6694('0xd')]):{};}catch(_0x1464db){logger[_0x6694('0x30')](_0x6694('0x71'),_0x1464db);}}try{_0x45ff70[_0x6694('0x72')]=_0x1ec9a9[_0x6694('0xc')]?JSON['parse'](_0x1ec9a9[_0x6694('0xc')]):{};}catch(_0x5e3944){logger[_0x6694('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5e3944);}if(_0x1ec9a9[_0x6694('0x73')]){try{var _0x28fe55=require(_0x1ec9a9[_0x6694('0x73')])[_0x6694('0x74')](this,_0x45ff70);_0x45ff70[_0x6694('0x75')]=Mustache[_0x6694('0x76')](_0x1ec9a9[_0x6694('0x68')],_0x28fe55,{},['$$','$$']);if(_0x45ff70[_0x6694('0x72')]){_0x45ff70[_0x6694('0x72')]=JSON[_0x6694('0x70')](Mustache[_0x6694('0x76')](JSON['stringify'](_0x45ff70[_0x6694('0x72')]),_0x28fe55,{},['$$','$$']));}if(_0x45ff70[_0x6694('0x6f')]){_0x45ff70['body']=JSON[_0x6694('0x70')](Mustache[_0x6694('0x76')](JSON['stringify'](_0x45ff70[_0x6694('0x6f')]),_0x28fe55,{},['$$','$$']));}}catch(_0xcba071){logger[_0x6694('0x30')](_0x6694('0x77'),_0xcba071);}}rp(_0x45ff70)[_0x6694('0x16')](function(_0x43709d){var _0x4fa8e5={'statusCode':_0x43709d[_0x6694('0x78')]||0xc8,'statusMessage':_0x43709d[_0x6694('0x79')]||'OK','headers':_0x43709d[_0x6694('0x72')]||{},'body':_0x43709d[_0x6694('0x6f')]||{}};_0x3b0f86(null,_0x4fa8e5);})[_0x6694('0x18')](function(_0x3450e7){var _0x124248={'statusCode':_0x3450e7[_0x6694('0x78')]||0x1f4,'statusMessage':_0x3450e7[_0x6694('0x7a')]||_0x6694('0x7b'),'headers':_0x3450e7[_0x6694('0x7c')][_0x6694('0x72')]||{},'body':_0x3450e7['options'][_0x6694('0x6f')]||{}};_0x3b0f86(null,_0x124248);});};AGIVertices[_0x6694('0x13')][_0x6694('0x7d')]=function(_0x4868c1,_0x4f1fa9){scripts[_0x6694('0x7d')](this['channel']['uniqueid'],_0x4868c1[_0x6694('0x7e')],_0x4868c1['text'],_0x4868c1[_0x6694('0x7f')]||'en')[_0x6694('0x16')](function(_0x3ee074){_0x4f1fa9(null,_0x3ee074);})[_0x6694('0x18')](function(_0x2adaa4){_0x4f1fa9(_0x2adaa4);});};AGIVertices[_0x6694('0x13')]['googleDialogflowV2']=function(_0x6ef97a,_0x39c6da){scripts[_0x6694('0x80')](this[_0x6694('0x10')]['uniqueid'],_0x6ef97a['dialogflowV2_project_id'],_0x6ef97a[_0x6694('0x81')],_0x6ef97a[_0x6694('0x82')],_0x6ef97a['text'],_0x6ef97a[_0x6694('0x83')]||'en')['then'](function(_0x497230){_0x39c6da(null,_0x497230);})['catch'](function(_0x52cba8){_0x39c6da(_0x52cba8);});};AGIVertices[_0x6694('0x13')][_0x6694('0x84')]=function(_0x3ea561,_0x412059){scripts[_0x6694('0x84')](this[_0x6694('0x10')],_0x3ea561)['then'](function(_0x3b4015){_0x412059(null,_0x3b4015);})[_0x6694('0x18')](function(_0x135915){_0x412059(_0x135915);});};AGIVertices[_0x6694('0x13')]['ispeechTTS']=function(_0x99b073,_0x1a2d18){scripts[_0x6694('0x85')](_0x99b073['key'],_0x99b073['text'],_0x99b073[_0x6694('0x86')]||'en-US',_0x99b073['speed'])[_0x6694('0x16')](function(_0x8a9e57){_0x1a2d18(null,_0x8a9e57);})['catch'](function(_0x1de07a){_0x1a2d18(_0x1de07a);});};AGIVertices[_0x6694('0x13')]['ispeechASR']=function(_0x2d4289,_0x1a1091,_0x4a744f){scripts[_0x6694('0x87')](_0x1a1091,_0x2d4289['key'],_0x2d4289[_0x6694('0x88')]||'en-US',this['isConfigured'](_0x2d4289[_0x6694('0x89')])?_0x2d4289[_0x6694('0x89')]:undefined)[_0x6694('0x16')](function(_0x198f74){_0x4a744f(null,_0x198f74);})[_0x6694('0x18')](function(_0x4b4403){_0x4a744f(_0x4b4403);});};AGIVertices[_0x6694('0x13')][_0x6694('0x8a')]=function(_0x173814,_0x8f260d){scripts[_0x6694('0x8a')](_0x173814[_0x6694('0x8b')],_0x173814[_0x6694('0x8c')],_0x173814[_0x6694('0x8d')],_0x173814[_0x6694('0x8e')]||_0x6694('0x8f'),_0x173814[_0x6694('0x60')],_0x173814[_0x6694('0x90')]||'text')['then'](function(_0x453de2){_0x8f260d(null,_0x453de2);})[_0x6694('0x18')](function(_0x57699b){_0x8f260d(_0x57699b);});};AGIVertices[_0x6694('0x13')][_0x6694('0x91')]=function(_0x36b05e,_0xf82c0d){scripts[_0x6694('0x91')](this['channel'][_0x6694('0x41')],_0x36b05e[_0x6694('0x8b')],_0x36b05e[_0x6694('0x8c')],_0x36b05e[_0x6694('0x92')],_0x36b05e[_0x6694('0x60')],_0x36b05e[_0x6694('0x93')])[_0x6694('0x16')](function(_0x564f97){_0xf82c0d(null,_0x564f97);})['catch'](function(_0x3fec4c){_0xf82c0d(_0x3fec4c);});};AGIVertices[_0x6694('0x13')][_0x6694('0x94')]=function(_0x2f69c2,_0x15ff50,_0x15721d){scripts[_0x6694('0x94')](_0x15ff50,_0x2f69c2[_0x6694('0x7e')],_0x2f69c2[_0x6694('0x95')]||_0x6694('0x62'))[_0x6694('0x16')](function(_0x44bd85){_0x15721d(null,_0x44bd85);})[_0x6694('0x18')](function(_0x5c9b98){_0x15721d(_0x5c9b98);});};AGIVertices[_0x6694('0x13')][_0x6694('0x96')]=function(_0x187b2d,_0x3251f0,_0x2e3722){scripts['tildeASR'](_0x3251f0,_0x187b2d['appid'],_0x187b2d[_0x6694('0x97')],_0x187b2d[_0x6694('0x75')])[_0x6694('0x16')](function(_0x3169e5){_0x2e3722(null,_0x3169e5);})[_0x6694('0x18')](function(_0x295a29){_0x2e3722(_0x295a29);});};AGIVertices[_0x6694('0x13')]['clear']=function(_0xf6c730){var _0x2aa6c5=_[_0x6694('0x98')](verticesWithRetry,_0xf6c730[_0x6694('0x3e')])?_0xf6c730:_[_0x6694('0x99')](_0xf6c730);for(var _0x4cbf8d in _0x2aa6c5){if(_0x2aa6c5['hasOwnProperty'](_0x4cbf8d)){if(_0x2aa6c5[_0x4cbf8d]&&_['isString'](_0x2aa6c5[_0x4cbf8d])){if(_[_0x6694('0x98')](recursiveMapAttributes,_0x4cbf8d)){_0x2aa6c5[_0x4cbf8d]=this[_0x6694('0x9a')](_0x2aa6c5[_0x4cbf8d]);}else{_0x2aa6c5[_0x4cbf8d]=this[_0x6694('0x9b')](_0x2aa6c5[_0x4cbf8d]);}}}}return _0x2aa6c5;};AGIVertices[_0x6694('0x13')][_0x6694('0x9c')]=function(_0x464d6a){for(var _0x53db33 in _0x464d6a){if(_0x464d6a[_0x6694('0x9d')](_0x53db33)){if(_[_0x6694('0x9e')](_0x464d6a[_0x53db33])){this[_0x6694('0x9c')](_0x464d6a[_0x53db33]);}else if(_[_0x6694('0x9f')](_0x464d6a[_0x53db33])){for(var _0x5e0c0b=0x0;_0x5e0c0b<_0x464d6a[_0x53db33][_0x6694('0xa0')];_0x5e0c0b++){this[_0x6694('0x9c')](_0x464d6a[_0x53db33][_0x5e0c0b]);}}else if(_[_0x6694('0xa1')](_0x464d6a[_0x53db33])){_0x464d6a[_0x53db33]=this[_0x6694('0x9b')](_0x464d6a[_0x53db33]);}}}};AGIVertices[_0x6694('0x13')][_0x6694('0xa2')]=function(_0x3ac3c2,_0x333673){for(var _0x2b9363 in _0x3ac3c2){if(_0x3ac3c2[_0x6694('0x9d')](_0x2b9363)){if(_[_0x6694('0x9e')](_0x3ac3c2[_0x2b9363])){if(!_['isEmpty'](_0x3ac3c2[_0x2b9363])){this['saveRestApiResult'](_0x3ac3c2[_0x2b9363],util[_0x6694('0xa3')](_0x6694('0xa4'),_0x333673,_0x2b9363));}}else if(_[_0x6694('0x9f')](_0x3ac3c2[_0x2b9363])){for(var _0xafb8a9=0x0;_0xafb8a9<_0x3ac3c2[_0x2b9363][_0x6694('0xa0')];_0xafb8a9++){this[_0x6694('0xa2')](_0x3ac3c2[_0x2b9363][_0xafb8a9],util['format'](_0x6694('0xa4'),_0x333673,_0x2b9363+'['+_0xafb8a9+']'));}}else{if(!_[_0x6694('0x49')](_0x3ac3c2[_0x2b9363])){this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')](_0x6694('0xa4'),_0x333673,_0x2b9363),_0x3ac3c2[_0x2b9363]);}}}}};AGIVertices['prototype'][_0x6694('0x9a')]=function(_0x4149d2){try{var _0x426af3=JSON[_0x6694('0x70')](_0x4149d2);this[_0x6694('0x9c')](_0x426af3);return JSON[_0x6694('0xa6')](_0x426af3);}catch(_0x460cb4){return this['replaceAllVariables'](_0x4149d2);}};AGIVertices[_0x6694('0x13')][_0x6694('0x9b')]=function(_0x5ef01f){var _0x638d6c=_0x5ef01f[_0x6694('0xa7')]('{');for(var _0x352cbf=0x1;_0x352cbf<_0x638d6c['length'];_0x352cbf+=0x1){var _0x21384f=_0x638d6c[_0x352cbf][_0x6694('0xa7')]('}');if(_0x21384f[_0x6694('0xa0')]>0x1){_0x5ef01f=_0x5ef01f[_0x6694('0xa8')]('{'+_0x21384f[0x0]+'}',this[_0x6694('0x10')]['getVariable'](_0x21384f[0x0])[_0x6694('0xa9')]||_0x21384f[0x0]);}}if(_0x638d6c['length']===0x1){return _0x5ef01f[_0x6694('0x4f')]();}return this[_0x6694('0x9b')](_0x5ef01f);};AGIVertices[_0x6694('0x13')][_0x6694('0xaa')]=function(_0x2c4711,_0x2cf985){var _0x159022=this[_0x6694('0x10')][_0x6694('0x14')](_0x2c4711);if(_0x159022[_0x6694('0xab')]===-0x1){return _0x159022;}logger[_0x6694('0x34')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2cf985,_0x159022[_0x6694('0xa9')]));return this[_0x6694('0x10')]['setVariable'](_0x2cf985,_0x159022[_0x6694('0xa9')]);};AGIVertices[_0x6694('0x13')][_0x6694('0xac')]=function(_0x3ded49){return _0x3ded49&&_0x3ded49!=='0'&&_0x3ded49!=='-1'&&_0x3ded49!=='';};AGIVertices[_0x6694('0x13')][_0x6694('0xad')]=function(_0x36d3ed){this['createSquareDetailsReport']['sync'](this,_0x36d3ed,'-');_0x36d3ed[_0x6694('0xae')]=_0x36d3ed['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6694('0x13')][_0x6694('0xaf')]=function(_0x55c7e9){logger['info'](util['format'](_0x6694('0xb0'),_0x55c7e9[_0x6694('0x3d')]));if(!this['isConfigured'](_0x55c7e9[_0x6694('0x60')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}var _0x3da383='\x22'+_0x55c7e9[_0x6694('0x60')]+'\x22';if(this[_0x6694('0xac')](_0x55c7e9[_0x6694('0x7c')])){_0x3da383+=','+_0x55c7e9[_0x6694('0x7c')];}var _0x3bb7ef=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xb3'),_0x3da383);if(_0x3bb7ef[_0x6694('0xab')]===-0x1){return _0x3bb7ef;}return this['channel'][_0x6694('0xb1')](util['format'](_0x6694('0xb4'),_0x3da383));};AGIVertices[_0x6694('0x13')][_0x6694('0xb5')]=function(_0x60b0a7){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0xb6'),_0x60b0a7['label']));if(!this[_0x6694('0xac')](_0x60b0a7[_0x6694('0xb7')])){return this[_0x6694('0x10')]['noop'](_0x6694('0xb8'));}var _0x8ff3e8=_0x60b0a7[_0x6694('0xb7')];if(this[_0x6694('0xac')](_0x60b0a7['options'])){_0x8ff3e8+=','+_0x60b0a7[_0x6694('0x7c')];}var _0x3b620c=this[_0x6694('0x10')]['exec'](_0x6694('0xb9'),_0x8ff3e8);if(_0x3b620c['result']===-0x1){return _0x3b620c;}var _0x5e12ad=this[_0x6694('0xaa')](_0x6694('0xba'),_0x6694('0xbb'));if(_0x5e12ad[_0x6694('0xab')]===-0x1){return _0x5e12ad;}var _0x34fba1=this[_0x6694('0xaa')]('RECOG_INPUT()',_0x6694('0xbc'));if(_0x34fba1[_0x6694('0xab')]===-0x1){return _0x34fba1;}var _0x271ec6=this['getAndSetVariable'](_0x6694('0xbd'),_0x6694('0xbe'));if(_0x271ec6[_0x6694('0xab')]===-0x1){return _0x271ec6;}return this['channel'][_0x6694('0xb1')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x8ff3e8));};AGIVertices[_0x6694('0x13')][_0x6694('0x8')]=function(_0x3fdf5f){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3fdf5f[_0x6694('0x3d')]));return this[_0x6694('0x10')]['agi']([_0x3fdf5f[_0x6694('0xbf')],_0x3fdf5f['args']]);};AGIVertices[_0x6694('0x13')]['answer']=function(_0x312709){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0xc0'),_0x312709[_0x6694('0x3d')]));if(this[_0x6694('0xac')](_0x312709['timeout'])){logger['info'](util[_0x6694('0xa3')](_0x6694('0xc1'),_0x312709[_0x6694('0x6b')]));var _0x8a3907=this[_0x6694('0x10')]['wait'](_0x312709[_0x6694('0x6b')]);if(_0x8a3907['result']===-0x1){return _0x8a3907;}}return this[_0x6694('0x10')][_0x6694('0xc2')]();};AGIVertices[_0x6694('0x13')]['callback']=function(_0x5e47d2){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0xc3'),_0x5e47d2[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x5e47d2[_0x6694('0x4d')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x5e47d2,_0x6694('0xc4'));}_0x5e47d2[_0x6694('0x4e')]=moment();if(this['isConfigured'](_0x5e47d2['delay'])){_0x5e47d2[_0x6694('0x4e')]=moment()[_0x6694('0xc5')](_0x5e47d2[_0x6694('0xc6')],_0x6694('0xc7'));}if(!this['isConfigured'](_0x5e47d2['callback_priority'])){_0x5e47d2[_0x6694('0xc8')]=0x2;}this[_0x6694('0x47')]['sync'](this,_0x5e47d2);return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5e47d2[_0x6694('0x4c')],_0x5e47d2['list_id'],_0x5e47d2[_0x6694('0x4e')]));};AGIVertices[_0x6694('0x13')][_0x6694('0xc9')]=function(_0x2b42df){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0xca'),_0x2b42df[_0x6694('0x3d')]));var _0x5ab011=this[_0x6694('0x10')][_0x6694('0x5b')](_0x2b42df['application'],_0x2b42df['options']);if(_0x5ab011[_0x6694('0xab')]===-0x1){return _0x5ab011;}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('Executed\x20command\x20%s\x20%s',_0x2b42df[_0x6694('0xcb')],_0x2b42df[_0x6694('0x7c')]));};AGIVertices['prototype'][_0x6694('0xcc')]=function(_0x224f84){logger[_0x6694('0x34')](util['format'](_0x6694('0xcd'),_0x224f84[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x224f84['text'])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}var _0x2f4951='\x22'+_0x224f84['text']+'\x22';if(this[_0x6694('0xac')](_0x224f84[_0x6694('0x7c')])){_0x2f4951+=','+_0x224f84['options'];}var _0x1d04d6=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xb3'),_0x2f4951);if(_0x1d04d6[_0x6694('0xab')]===-0x1){return _0x1d04d6;}return this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xb4'),_0x2f4951));};AGIVertices['prototype']['sestektts']=function(_0x348275){logger[_0x6694('0x34')](util['format'](_0x6694('0xce'),_0x348275[_0x6694('0x3d')]));if(!this['isConfigured'](_0x348275[_0x6694('0x60')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}var _0x3cb74b='\x22'+_0x348275[_0x6694('0x60')]+'\x22';if(this[_0x6694('0xac')](_0x348275['options'])){_0x3cb74b+=','+_0x348275[_0x6694('0x7c')];}var _0x5c2e7a=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xb3'),_0x3cb74b);if(_0x5c2e7a[_0x6694('0xab')]===-0x1){return _0x5c2e7a;}return this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')](_0x6694('0xb4'),_0x3cb74b));};AGIVertices[_0x6694('0x13')][_0x6694('0xcf')]=function(_0x516cd0){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0xd0'),_0x516cd0['label']));if(!this['isConfigured'](_0x516cd0[_0x6694('0xb7')])){return this[_0x6694('0x10')]['noop'](_0x6694('0xb8'));}var _0x59d3f2=_0x516cd0[_0x6694('0xb7')];if(this[_0x6694('0xac')](_0x516cd0[_0x6694('0x7c')])){_0x59d3f2+=','+_0x516cd0['options'];}var _0x26a7c4=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xb9'),_0x59d3f2);if(_0x26a7c4[_0x6694('0xab')]===-0x1){return _0x26a7c4;}var _0x1f0fc8=this[_0x6694('0xaa')](_0x6694('0xba'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1f0fc8[_0x6694('0xab')]===-0x1){return _0x1f0fc8;}var _0x9c93f9=this[_0x6694('0xaa')]('RECOG_INPUT()',_0x6694('0xd1'));if(_0x9c93f9[_0x6694('0xab')]===-0x1){return _0x9c93f9;}var _0x537ede=this[_0x6694('0xaa')](_0x6694('0xbd'),_0x6694('0xd2'));if(_0x537ede['result']===-0x1){return _0x537ede;}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xd3'),_0x59d3f2));};AGIVertices[_0x6694('0x13')]['sestekasr']=function(_0x2dc73f){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2dc73f['label']));if(!this['isConfigured'](_0x2dc73f[_0x6694('0xb7')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb8'));}var _0x8c2fe3=_0x2dc73f[_0x6694('0xb7')];if(this[_0x6694('0xac')](_0x2dc73f[_0x6694('0x7c')])){_0x8c2fe3+=','+_0x2dc73f[_0x6694('0x7c')];}var _0x65993b=this['channel'][_0x6694('0x5b')](_0x6694('0xb9'),_0x8c2fe3);if(_0x65993b['result']===-0x1){return _0x65993b;}var _0xe796eb=this[_0x6694('0xaa')](_0x6694('0xba'),'SESTEK_ASR_CONFIDENCE');if(_0xe796eb[_0x6694('0xab')]===-0x1){return _0xe796eb;}var _0x53e360=this[_0x6694('0xaa')](_0x6694('0xd4'),'SESTEK_ASR_TRANSCRIPT');if(_0x53e360[_0x6694('0xab')]===-0x1){return _0x53e360;}var _0x95054d=this[_0x6694('0xaa')](_0x6694('0xbd'),_0x6694('0xd5'));if(_0x95054d[_0x6694('0xab')]===-0x1){return _0x95054d;}return this[_0x6694('0x10')]['noop'](util['format'](_0x6694('0xd3'),_0x8c2fe3));};AGIVertices[_0x6694('0x13')]['database']=function(_0x35eb05){logger[_0x6694('0x34')](util['format'](_0x6694('0xd6'),_0x35eb05[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x35eb05['odbc_id'])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x35eb05,_0x6694('0xd7'));}var _0x77e56e=this[_0x6694('0x1c')][_0x6694('0x74')](this,_0x35eb05[_0x6694('0xd8')]);if(!_0x77e56e){return this[_0x6694('0x10')][_0x6694('0x30')](_0x35eb05,'no\x20odbc\x20database\x20found');}if(!this[_0x6694('0xac')](_0x35eb05['query'])){return this[_0x6694('0x10')]['error'](_0x35eb05,_0x6694('0xd9'));}var _0x11ca35=_0x35eb05['query'][_0x6694('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xda'),_0x11ca35));var _0x3977bf=this[_0x6694('0x2e')][_0x6694('0x74')](this,_0x77e56e,_0x11ca35);this[_0x6694('0x3c')][_0x6694('0x74')](this,_0x35eb05,_0x11ca35);if(!this[_0x6694('0xac')](_0x35eb05[_0x6694('0xdb')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xdc'));}var _0x484869=this[_0x6694('0x14')]['sync'](this,_0x35eb05[_0x6694('0xdb')]);if(!_0x484869){return this['channel'][_0x6694('0x30')](_0x35eb05,'no\x20variable\x20found');}var _0x490604=this;_0x3977bf[_0x6694('0xdd')](function(_0x52b472,_0xc029c3){Object[_0x6694('0xde')](_0x52b472)[_0x6694('0xdd')](function(_0x3e6e4a){_0x490604['channel'][_0x6694('0xa5')](util['format']('%s[%s][%s]',_0x484869,_0xc029c3,_0x3e6e4a),_0x52b472[_0x3e6e4a]);});});this[_0x6694('0x10')]['setVariable'](util[_0x6694('0xa3')]('%s_ROWS_COUNT',_0x484869),_0x3977bf['length']);return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xdf'),_0x484869));};AGIVertices[_0x6694('0x13')]['dial']=function(_0x511dc2){logger['debug'](util['format'](_0x6694('0xe0'),_0x511dc2[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x511dc2[_0x6694('0xe1')])){return this['channel'][_0x6694('0x30')](_0x511dc2,_0x6694('0xe2'));}var _0x28a005=this[_0x6694('0x1d')]['sync'](this,_0x511dc2[_0x6694('0xe1')]);if(!_0x28a005){return this[_0x6694('0x10')][_0x6694('0x30')](_0x511dc2,'no\x20user\x20found');}var _0x5f54cb=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xe3'),[util[_0x6694('0xa3')]('SIP/%s',_0x28a005),_0x511dc2['timeout'],_0x511dc2['opts'],_0x511dc2[_0x6694('0x68')]]);if(_0x5f54cb[_0x6694('0xab')]===-0x1){return _0x5f54cb;}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xe4'),_0x6694('0xe3')));};AGIVertices['prototype'][_0x6694('0xe5')]=function(_0x8ab06f){logger['info'](util[_0x6694('0xa3')](_0x6694('0xe6'),_0x8ab06f[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x8ab06f[_0x6694('0x7e')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xe7'));}if(!this[_0x6694('0xac')](_0x8ab06f[_0x6694('0x60')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')][_0x6694('0xe8')]=!![];this[_0x6694('0x3c')](_0x8ab06f);this[_0x6694('0x46')](_0x8ab06f[_0x6694('0x60')],'in','','');this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xe9'),_0x8ab06f['text']));var _0x3a9827=this[_0x6694('0x7d')][_0x6694('0x74')](this,_0x8ab06f);if(_0x3a9827){for(var _0x1763ee in _0x3a9827){if(_0x3a9827[_0x6694('0x9d')](_0x1763ee)){this['channel']['setVariable'](util[_0x6694('0xa3')](_0x6694('0xea'),_0x1763ee['toUpperCase']()),_0x3a9827[_0x1763ee]);}}this[_0x6694('0x46')](_0x3a9827[_0x6694('0xeb')],'out',_0x6694('0xe5'),'');return this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xec'),_0x3a9827[_0x6694('0xeb')]));}return this['channel'][_0x6694('0x30')](_0x8ab06f,_0x6694('0xed'));};AGIVertices[_0x6694('0x13')][_0x6694('0xee')]=function(_0x3d0cdb){logger[_0x6694('0x34')](util['format'](_0x6694('0xef'),_0x3d0cdb[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x3d0cdb[_0x6694('0xf0')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xf1'));}if(!this[_0x6694('0xac')](_0x3d0cdb[_0x6694('0x81')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xf2'));}if(!this[_0x6694('0xac')](_0x3d0cdb[_0x6694('0x82')])){return this[_0x6694('0x10')][_0x6694('0xb1')]('no\x20private_key\x20configured');}if(!this[_0x6694('0xac')](_0x3d0cdb[_0x6694('0x83')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xf3'));}if(!this[_0x6694('0xac')](_0x3d0cdb[_0x6694('0x60')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')][_0x6694('0xe8')]=!![];this[_0x6694('0x3c')](_0x3d0cdb);this[_0x6694('0x46')](_0x3d0cdb[_0x6694('0x60')],'in','','');this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('Trying\x20DialogflowV2:\x20%s',_0x3d0cdb[_0x6694('0x60')]));var _0x147685=this[_0x6694('0x80')][_0x6694('0x74')](this,_0x3d0cdb);if(_0x147685){for(var _0x3f1814 in _0x147685){if(_0x147685[_0x6694('0x9d')](_0x3f1814)){if(_0x3f1814!==_0x6694('0xf4')){this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')]('DIALOGFLOW_%s',_0x3f1814[_0x6694('0x6e')]()),_0x147685[_0x3f1814]);}}}this[_0x6694('0x46')](_0x147685['speech'],_0x6694('0xf5'),'dialogflowV2',_0x147685[_0x6694('0xf4')]);return this[_0x6694('0x10')][_0x6694('0xb1')](util['format'](_0x6694('0xf6'),_0x147685[_0x6694('0xeb')]));}return this[_0x6694('0x10')][_0x6694('0x30')](_0x3d0cdb,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x6694('0x13')][_0x6694('0xf7')]=function(_0x5d290b){logger['info'](util[_0x6694('0xa3')](_0x6694('0xf8'),_0x5d290b[_0x6694('0x3d')]));if(!this['isConfigured'](_0x5d290b['ndauth_url'])){return this[_0x6694('0x10')]['noop'](_0x6694('0xf9'));}if(!this['isConfigured'](_0x5d290b[_0x6694('0xfa')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xfb'));}if(!this[_0x6694('0xac')](_0x5d290b[_0x6694('0xfc')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xfd'));}if(!this[_0x6694('0xac')](_0x5d290b[_0x6694('0xfe')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')][_0x6694('0xe8')]=!![];this[_0x6694('0x3c')](_0x5d290b);this[_0x6694('0x46')](_0x5d290b['text'],'in','','');this[_0x6694('0x10')]['noop'](util['format'](_0x6694('0xff'),_0x5d290b['text']));var _0x228211=this[_0x6694('0x84')][_0x6694('0x74')](this,_0x5d290b);if(_0x228211){for(var _0x1e6b5a in _0x228211){if(_0x228211['hasOwnProperty'](_0x1e6b5a)){this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')](_0x6694('0x100'),_0x1e6b5a['toUpperCase']()),_0x228211[_0x1e6b5a]);}}this[_0x6694('0x46')](_0x228211[_0x6694('0xeb')],'out',_0x6694('0xf7'),'');if(_0x228211[_0x6694('0x101')]){this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x102'),_0x228211['audiofile']));var _0x1b3af5=this[_0x6694('0x10')][_0x6694('0x103')](_0x228211[_0x6694('0x101')]);try{fs[_0x6694('0x104')](_0x228211['audiofile']+_0x6694('0x105'));}catch(_0xe48d28){logger[_0x6694('0x30')](_0xe48d28);}return _0x1b3af5;}else{return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x106'),_0x228211['speech']));}}return this[_0x6694('0x10')][_0x6694('0x30')](_0x5d290b,_0x6694('0x107'));};AGIVertices['prototype'][_0x6694('0x108')]=function(_0x38af70){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x109'),_0x38af70[_0x6694('0x3d')]));return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x108'));};AGIVertices[_0x6694('0x13')][_0x6694('0x10a')]=function(_0x49744d){logger[_0x6694('0x34')](util['format'](_0x6694('0x10b'),_0x49744d[_0x6694('0x3d')]));var _0x23c4ff='';if(_0x49744d[_0x6694('0x10c')]){if(!this[_0x6694('0xac')](_0x49744d[_0x6694('0x10c')])){return this['channel'][_0x6694('0x30')](_0x49744d,_0x6694('0x10d'));}else{var _0x5f4e6a=parseInt(_0x49744d['trunk_id'],0xa);if(isNaN(_0x5f4e6a)){_0x23c4ff=_0x49744d['trunk_id'];}else{_0x23c4ff=this[_0x6694('0x1f')][_0x6694('0x74')](this,_0x49744d[_0x6694('0x10c')]);if(!_0x23c4ff){return this[_0x6694('0x10')][_0x6694('0x30')](_0x49744d,'no\x20trunk\x20found');}}}}else if(_0x49744d[_0x6694('0x10e')]){_0x23c4ff=_0x49744d[_0x6694('0x10e')];}else{return this[_0x6694('0x10')][_0x6694('0x30')](_0x49744d,_0x6694('0x10d'));}var _0x405abf=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0xe3'),[util[_0x6694('0xa3')](_0x6694('0x10f'),_0x23c4ff,_0x49744d['phone']),_0x49744d[_0x6694('0x6b')],_0x49744d['opts'],_0x49744d[_0x6694('0x68')]]);if(_0x405abf['result']===-0x1){return _0x405abf;}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0xe4'),_0x6694('0xe3')));};AGIVertices[_0x6694('0x13')][_0x6694('0x110')]=function(_0x524be2){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x524be2[_0x6694('0x3d')]));return this['channel'][_0x6694('0xb1')]('finally');};AGIVertices[_0x6694('0x13')]['getdigits']=function(_0x3b9e36){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x111'),_0x3b9e36[_0x6694('0x3d')]));if(_0x3b9e36[_0x6694('0xae')]===0x0){return this[_0x6694('0xad')](_0x3b9e36);}_0x3b9e36['retry']-=0x1;if(!this[_0x6694('0xac')](_0x3b9e36['file_id'])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x3b9e36,_0x6694('0x112'));}var _0x1309b6=this[_0x6694('0x21')][_0x6694('0x74')](this,_0x3b9e36[_0x6694('0x113')]);if(!_0x1309b6){return this[_0x6694('0x10')][_0x6694('0x30')](_0x3b9e36,_0x6694('0x114'));}if(!this[_0x6694('0xac')](_0x3b9e36[_0x6694('0xdb')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x6694('0xdc'));}var _0x232ba5=this[_0x6694('0x10')][_0x6694('0x115')](_0x1309b6,_0x3b9e36[_0x6694('0x116')],_0x3b9e36['maxdigit']);var _0x1d8cf8=_0x232ba5[_0x6694('0xab')]?_0x232ba5[_0x6694('0xab')][_0x6694('0x4f')]():'';logger[_0x6694('0x34')]('test',JSON[_0x6694('0xa6')](_0x232ba5));if(_0x232ba5[_0x6694('0xab')]===-0x1){this['createSquareDetailsReport'][_0x6694('0x74')](this,_0x3b9e36,_0x1d8cf8);return _0x232ba5;}else if(_0x232ba5['extra']===_0x6694('0x6b')){_0x232ba5[_0x6694('0xab')]=_0x1d8cf8[_0x6694('0xa0')]>=parseInt(_0x3b9e36[_0x6694('0x117')])?'x':'i';}else{_0x232ba5[_0x6694('0xab')]=_0x1d8cf8['length']>=parseInt(_0x3b9e36[_0x6694('0x117')])&&_0x1d8cf8[_0x6694('0xa0')]<=parseInt(_0x3b9e36[_0x6694('0x118')])?'x':'i';}var _0x193514=this[_0x6694('0x14')][_0x6694('0x74')](this,_0x3b9e36[_0x6694('0xdb')]);if(!_0x193514){return this['channel']['error'](_0x3b9e36,_0x6694('0x119'));}this['channel'][_0x6694('0xa5')](_0x193514,_0x1d8cf8);if(this[_0x6694('0xac')](_0x3b9e36[_0x6694('0x11a')])){var _0x29d1b0=parseInt(_0x3b9e36['hiddendigitsnum'],0xa);var _0x1554bd=rs[_0x6694('0x11b')]({'charset':'*','length':_0x29d1b0});var _0x5373dc=_0x1d8cf8[_0x6694('0xa0')];if(_0x5373dc>0x0){if(_0x5373dc>_0x29d1b0){this[_0x6694('0x3c')]['sync'](this,_0x3b9e36,_0x3b9e36[_0x6694('0x11c')]===_0x6694('0x11d')?_0x1554bd+_0x1d8cf8['substr'](_0x29d1b0):_0x1d8cf8[_0x6694('0x11e')](0x0,_0x5373dc-_0x29d1b0)+_0x1554bd);}else{this['createSquareDetailsReport'][_0x6694('0x74')](this,_0x3b9e36,rs[_0x6694('0x11b')]({'charset':'*','length':_0x5373dc}));}}else{this['createSquareDetailsReport'][_0x6694('0x74')](this,_0x3b9e36,'');}}else{this[_0x6694('0x3c')]['sync'](this,_0x3b9e36,_0x1d8cf8);}return _0x232ba5;};AGIVertices[_0x6694('0x13')]['getsecretdigits']=function(_0x24149a){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x11f'),_0x24149a[_0x6694('0x3d')]));return this['getdigits'](_0x24149a);};AGIVertices[_0x6694('0x13')][_0x6694('0x120')]=function(_0x448fb6){logger['info'](util[_0x6694('0xa3')](_0x6694('0x121'),_0x448fb6[_0x6694('0x3d')]));this[_0x6694('0x3c')][_0x6694('0x74')](this,_0x448fb6,_0x448fb6[_0x6694('0x122')]);return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('GOAL\x20%s',_0x448fb6[_0x6694('0x122')]));};AGIVertices[_0x6694('0x13')]['awspolly']=function(_0x4864f6){logger[_0x6694('0x34')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4864f6[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x4864f6[_0x6694('0x8b')])||!this['isConfigured'](_0x4864f6[_0x6694('0x8c')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x123'));}if(!this[_0x6694('0xac')](_0x4864f6[_0x6694('0x60')])){return this['channel'][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x124'),_0x4864f6[_0x6694('0x60')]));var _0x459219=this[_0x6694('0x8a')][_0x6694('0x74')](this,_0x4864f6);if(_0x459219){this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')]('aws\x20Polly\x20%s\x20file\x20created',_0x459219));var _0x1d9aaf=this[_0x6694('0x10')][_0x6694('0x103')](_0x459219);try{fs[_0x6694('0x104')](_0x459219+_0x6694('0x105'));}catch(_0x4f3800){logger[_0x6694('0x30')](_0x4f3800);}return _0x1d9aaf;}return this[_0x6694('0x10')][_0x6694('0x30')](_0x4864f6,_0x6694('0x125'));};AGIVertices[_0x6694('0x13')]['awslex']=function(_0x422b9e){logger[_0x6694('0x34')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x422b9e[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x422b9e['aws_access_key_id'])||!this[_0x6694('0xac')](_0x422b9e[_0x6694('0x8c')])){return this[_0x6694('0x10')][_0x6694('0xb1')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x6694('0xac')](_0x422b9e['aws_bot_name'])){return this[_0x6694('0x10')]['noop'](_0x6694('0x126'));}if(!this[_0x6694('0xac')](_0x422b9e['text'])){return this[_0x6694('0x10')][_0x6694('0xb1')]('no\x20text\x20configured');}this['channel'][_0x6694('0xe8')]=!![];this[_0x6694('0x3c')](_0x422b9e);this[_0x6694('0x46')](_0x422b9e[_0x6694('0x60')],'in','','');this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x127'),_0x422b9e[_0x6694('0x60')]));var _0x5167fd=this[_0x6694('0x91')][_0x6694('0x74')](this,_0x422b9e);if(_0x5167fd){for(var _0x2e97b0 in _0x5167fd){if(_0x5167fd['hasOwnProperty'](_0x2e97b0)&&_['isString'](_0x5167fd[_0x2e97b0])){this[_0x6694('0x10')]['setVariable'](util[_0x6694('0xa3')](_0x6694('0x128'),_0x2e97b0['toUpperCase']()),_0x5167fd[_0x2e97b0]);}}if(_['isNil'](_0x5167fd['message'])){return this[_0x6694('0x10')][_0x6694('0xb1')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x6694('0x46')](_0x5167fd[_0x6694('0x7a')],_0x6694('0xf5'),_0x6694('0x129'),'');return this[_0x6694('0x10')][_0x6694('0xb1')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x5167fd[_0x6694('0x7a')]));}}return this['channel'][_0x6694('0x30')](_0x422b9e,_0x6694('0x12a'));};AGIVertices['prototype']['googleasr']=function(_0x180be1){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x12b'),_0x180be1[_0x6694('0x3d')],_0x180be1[_0x6694('0x6b')]));if(!this[_0x6694('0xac')](_0x180be1[_0x6694('0x7e')])){return this['channel'][_0x6694('0xb1')]('no\x20key\x20configured');}var _0x53f7d4=_0x6694('0x12c');var _0x270877=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x6694('0x11b')](0x4));var _0x5b529e=util['format']('%s.%s',_0x270877,_0x53f7d4);var _0x43d25d=!![];if(_0x180be1[_0x6694('0x12d')]===_0x6694('0x12e')){_0x43d25d=![];}var _0x3059d0=this['channel'][_0x6694('0x12f')](_0x270877,_0x53f7d4,_0x180be1[_0x6694('0x130')],_0x180be1['timeout'],undefined,_0x43d25d);if(_0x3059d0[_0x6694('0xab')]!==-0x1){this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('google\x20%s\x20file\x20created',_0x5b529e));var _0x20076c=this[_0x6694('0x94')][_0x6694('0x74')](this,_0x180be1,_0x5b529e);if(_0x20076c){for(var _0x57e4b2 in _0x20076c){if(_0x20076c[_0x6694('0x9d')](_0x57e4b2)){this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')](_0x6694('0x131'),_0x57e4b2['toUpperCase']()),_0x20076c[_0x57e4b2]);}}return this['channel'][_0x6694('0xb1')](util['format'](_0x6694('0x132'),JSON[_0x6694('0xa6')](_0x20076c)));}}return _0x3059d0;};AGIVertices[_0x6694('0x13')][_0x6694('0x133')]=function(_0x4c851e){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4c851e['label']));if(!this['isConfigured'](_0x4c851e[_0x6694('0x134')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x135'));}if(!this[_0x6694('0xac')](_0x4c851e[_0x6694('0x97')])){return this['channel']['noop'](_0x6694('0x136'));}var _0x1cc43d='wav';var _0x1e013e=util[_0x6694('0xa3')](_0x6694('0x137'),FILES_PATH,rs[_0x6694('0x11b')](0x4));var _0x11a31b=util[_0x6694('0xa3')](_0x6694('0xa4'),_0x1e013e,_0x1cc43d);var _0x5ad61e=!![];if(_0x4c851e[_0x6694('0x12d')]==='NOBEEP'){_0x5ad61e=![];}var _0x1ccfb1=this[_0x6694('0x10')][_0x6694('0x12f')](_0x1e013e,_0x1cc43d,_0x4c851e['intKey'],_0x4c851e[_0x6694('0x6b')],undefined,_0x5ad61e);if(_0x1ccfb1['result']!==-0x1){this[_0x6694('0x10')][_0x6694('0xb1')](util['format'](_0x6694('0x138'),_0x11a31b));var _0x3e7170=this['tildeASR'][_0x6694('0x74')](this,_0x4c851e,_0x11a31b);if(_0x3e7170){for(var _0x2998d0 in _0x3e7170){if(_0x3e7170[_0x6694('0x9d')](_0x2998d0)){this[_0x6694('0x10')]['setVariable'](util[_0x6694('0xa3')](_0x6694('0x139'),_0x2998d0[_0x6694('0x6e')]()),_0x3e7170[_0x2998d0]);}}return this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x13a'),JSON['stringify'](_0x3e7170)));}}return _0x1ccfb1;};AGIVertices[_0x6694('0x13')][_0x6694('0x13b')]=function(_0x3629dd){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x13c'),_0x3629dd[_0x6694('0x3d')]));return this[_0x6694('0x10')]['continueAt'](_0x3629dd[_0x6694('0x42')],_0x3629dd[_0x6694('0x13d')],_0x3629dd['priority']);};AGIVertices[_0x6694('0x13')][_0x6694('0x13e')]=function(_0x2f7246){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x13f'),_0x2f7246['label']));if(!this[_0x6694('0xac')](_0x2f7246['condition'])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x2f7246,_0x6694('0x140'));}try{var _0x55db8e=eval(_0x2f7246[_0x6694('0x141')])?_0x6694('0x142'):_0x6694('0x143');this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2f7246[_0x6694('0x141')],_0x55db8e));return{'code':0xc8,'result':_0x55db8e};}catch(_0x427944){return{'code':0xc8,'result':_0x6694('0x143')};}};AGIVertices[_0x6694('0x13')][_0x6694('0x144')]=function(_0x838168){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x838168[_0x6694('0x3d')]));if(!this['isConfigured'](_0x838168[_0x6694('0x145')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x838168,_0x6694('0x146'));}var _0xc9cd0c=this['getIntervals'][_0x6694('0x74')](this,_0x838168[_0x6694('0x145')]);if(!_0xc9cd0c){return this[_0x6694('0x10')][_0x6694('0x30')](_0x838168,_0x6694('0x147'));}for(var _0x502947=0x0;_0x502947<_0xc9cd0c[_0x6694('0xa0')];_0x502947+=0x1){var _0x2dd2dc=this['channel'][_0x6694('0x14')](util['format'](_0x6694('0x148'),_0xc9cd0c[_0x502947]));if(_0x2dd2dc[_0x6694('0xab')]===-0x1){return _0x2dd2dc;}logger[_0x6694('0x34')](util[_0x6694('0xa3')]('IFTIME\x20%s\x20%s',_0xc9cd0c[_0x502947],_0x2dd2dc[_0x6694('0xa9')]));if(_0x2dd2dc['extra']===_0x6694('0x142')){logger[_0x6694('0x34')](util['format']('IFTIME\x20%s\x20%s',_0xc9cd0c[_0x502947],_0x6694('0x142')));this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')]('IFTIME\x20%s\x20%s',_0xc9cd0c[_0x502947],_0x6694('0x142')));return{'code':0xc8,'result':_0x6694('0x142')};}else{logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x149'),_0xc9cd0c[_0x502947],'false'));this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x149'),_0xc9cd0c[_0x502947],_0x6694('0x143')));}}return{'code':0xc8,'result':_0x6694('0x143')};};AGIVertices[_0x6694('0x13')][_0x6694('0x14a')]=function(_0x3b9c9a){logger['info'](util[_0x6694('0xa3')](_0x6694('0x14b'),_0x3b9c9a[_0x6694('0x3d')]));return this[_0x6694('0x10')][_0x6694('0x14a')]();};AGIVertices[_0x6694('0x13')][_0x6694('0x14c')]=function(_0x35c5be){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x14d'),_0x35c5be[_0x6694('0x3d')]));if(!this['isConfigured'](_0x35c5be[_0x6694('0x7e')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xe7'));}var _0x155448=_0x6694('0x12c');var _0x3991da=util[_0x6694('0xa3')]('%s/recordings/%s',FILES_PATH,rs[_0x6694('0x11b')](0x4));var _0x3eaff9=util[_0x6694('0xa3')](_0x6694('0xa4'),_0x3991da,_0x155448);var _0x89a2fb=!![];if(_0x35c5be[_0x6694('0x12d')]===_0x6694('0x12e')){_0x89a2fb=![];}var _0x4c4100=this['channel'][_0x6694('0x12f')](_0x3991da,_0x155448,_0x35c5be[_0x6694('0x130')],_0x35c5be[_0x6694('0x6b')],undefined,_0x89a2fb);if(_0x4c4100[_0x6694('0xab')]!==-0x1){this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')]('ispeech\x20%s\x20file\x20created',_0x3eaff9));var _0xf331be=this[_0x6694('0x87')][_0x6694('0x74')](this,_0x35c5be,_0x3eaff9);if(_0xf331be){for(var _0x171b72 in _0xf331be){if(_0xf331be['hasOwnProperty'](_0x171b72)){this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')](_0x6694('0x14e'),_0x171b72[_0x6694('0x6e')]()),_0xf331be[_0x171b72]);}}return this[_0x6694('0x10')][_0x6694('0xb1')](util['format'](_0x6694('0x14f'),JSON[_0x6694('0xa6')](_0xf331be)));}}return _0x4c4100;};AGIVertices[_0x6694('0x13')][_0x6694('0x150')]=function(_0x4f5f6b){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4f5f6b[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x4f5f6b[_0x6694('0x7e')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xe7'));}if(!this[_0x6694('0xac')](_0x4f5f6b['text'])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')]['noop'](util['format'](_0x6694('0x151'),_0x4f5f6b[_0x6694('0x60')]));var _0xd34d50=this[_0x6694('0x85')][_0x6694('0x74')](this,_0x4f5f6b);if(_0xd34d50){this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x152'),_0xd34d50));var _0x30a923=this['channel'][_0x6694('0x103')](_0xd34d50,_0x4f5f6b[_0x6694('0x130')]);try{fs[_0x6694('0x104')](_0xd34d50+'.wav');}catch(_0x84bc44){logger['error'](_0x84bc44);}return _0x30a923;}return this['channel'][_0x6694('0x30')](_0x4f5f6b,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x6694('0x153')]=function(_0x4f494c){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x154'),_0x4f494c[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x4f494c[_0x6694('0x155')])){return this[_0x6694('0x10')]['error'](_0x4f494c,'no\x20find\x20by\x20configured');}logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x156'),this['channel'][_0x6694('0x3f')],_0x4f494c[_0x6694('0x155')]));var _0x3119f7=this[_0x6694('0x56')][_0x6694('0x74')](this,_0x4f494c['findBy']);if(_0x3119f7){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x157'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x4f494c[_0x6694('0x155')]));this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6694('0x10')]['callerid'],_0x4f494c[_0x6694('0x155')]));return{'code':0xc8,'result':_0x6694('0x158')};}else{logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x159'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x4f494c[_0x6694('0x155')]));this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x159'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x4f494c[_0x6694('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x6694('0x15a')]=function(_0x4d2e82){logger[_0x6694('0x34')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4d2e82[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x4d2e82[_0x6694('0x155')])){return this['channel'][_0x6694('0x30')](_0x4d2e82,'no\x20find\x20by\x20configured');}logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x156'),this[_0x6694('0x10')]['callerid'],_0x4d2e82['findBy']));var _0x148ab7=this[_0x6694('0x55')][_0x6694('0x74')](this,_0x4d2e82['findBy']);if(_0x148ab7){logger[_0x6694('0x34')](util['format'](_0x6694('0x157'),this['channel'][_0x6694('0x3f')],_0x4d2e82['findBy']));this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6694('0x10')]['callerid'],_0x4d2e82['findBy']));return{'code':0xc8,'result':_0x6694('0x158')};}else{logger['info'](util[_0x6694('0xa3')](_0x6694('0x159'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x4d2e82[_0x6694('0x155')]));this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x159'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x4d2e82[_0x6694('0x155')]));return{'code':0xc8,'result':_0x6694('0x15b')};}};AGIVertices[_0x6694('0x13')][_0x6694('0x15c')]=function(_0x3fda2a){logger[_0x6694('0x34')](util['format'](_0x6694('0x15d'),_0x3fda2a['label']));if(!this[_0x6694('0xac')](_0x3fda2a['operation'])){return this[_0x6694('0x10')]['error'](_0x3fda2a,_0x6694('0x15e'));}this['channel'][_0x6694('0xb1')](util['format'](_0x6694('0x15f'),_0x3fda2a[_0x6694('0x160')]));var _0x382c90=eval(_0x3fda2a['operation']);if(!this[_0x6694('0xac')](_0x3fda2a[_0x6694('0xdb')])){return this['channel'][_0x6694('0xb1')](_0x6694('0xdc'));}var _0x5e08fa=this[_0x6694('0x14')][_0x6694('0x74')](this,_0x3fda2a[_0x6694('0xdb')]);if(!_0x5e08fa){return this[_0x6694('0x10')][_0x6694('0x30')](_0x3fda2a,_0x6694('0x119'));}if(_[_0x6694('0x9f')](_0x382c90)){var _0x55297d=this;_0x382c90[_0x6694('0xdd')](function(_0x3dca6e,_0x28d372){_0x55297d[_0x6694('0x10')][_0x6694('0xa5')](util['format'](_0x6694('0x161'),_0x5e08fa,_0x28d372),_0x3dca6e);});return this[_0x6694('0x10')]['noop'](util['format']('variable\x20%s[key]\x20set',_0x5e08fa));}else{return this[_0x6694('0x10')][_0x6694('0xa5')](_0x5e08fa,_0x382c90);}};AGIVertices['prototype'][_0x6694('0xe')]=function(_0x319b1a){logger['info'](util['format'](_0x6694('0x162'),_0x319b1a[_0x6694('0x3d')]));if(_0x319b1a['retry']===0x0){return this[_0x6694('0xad')](_0x319b1a);}_0x319b1a[_0x6694('0xae')]-=0x1;if(!this[_0x6694('0xac')](_0x319b1a[_0x6694('0x113')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x319b1a,_0x6694('0x112'));}var _0x4764f8=this[_0x6694('0x21')][_0x6694('0x74')](this,_0x319b1a[_0x6694('0x113')]);if(!_0x4764f8){return this[_0x6694('0x10')][_0x6694('0x30')](_0x319b1a,_0x6694('0x114'));}var _0x108ac1=this['channel'][_0x6694('0x115')](_0x4764f8,_0x319b1a[_0x6694('0x116')],_0x319b1a[_0x6694('0x163')]);var _0x263b15=_0x108ac1[_0x6694('0xab')];if(_0x108ac1[_0x6694('0xab')]===-0x1){this[_0x6694('0x3c')]['sync'](this,_0x319b1a,'-1');return _0x108ac1;}else if(_0x108ac1[_0x6694('0xa9')]==='timeout'){_0x108ac1[_0x6694('0xab')]=_0x108ac1[_0x6694('0xab')]['length']>0x0?_0x108ac1[_0x6694('0xab')]:'t';}else if(_[_0x6694('0x48')](_0x108ac1['result'])){_0x108ac1[_0x6694('0xab')]='#';_0x263b15='#';}if(!this[_0x6694('0xac')](_0x319b1a[_0x6694('0xdb')])){this[_0x6694('0x10')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x33a215=this[_0x6694('0x14')][_0x6694('0x74')](this,_0x319b1a[_0x6694('0xdb')]);if(!_0x33a215){return this[_0x6694('0x10')][_0x6694('0x30')](_0x319b1a,_0x6694('0x119'));}this['channel'][_0x6694('0xa5')](_0x33a215,_0x263b15);}this[_0x6694('0x3c')][_0x6694('0x74')](this,_0x319b1a,_0x263b15);return _0x108ac1;};AGIVertices[_0x6694('0x13')][_0x6694('0xb1')]=function(_0x426c91){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x164'),_0x426c91[_0x6694('0x3d')]));return this[_0x6694('0x10')][_0x6694('0xb1')](_0x426c91[_0x6694('0x165')]||_0x426c91[_0x6694('0x3d')]);};AGIVertices['prototype'][_0x6694('0x166')]=function(_0x124cc1){logger['info'](util[_0x6694('0xa3')](_0x6694('0x167'),_0x124cc1[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x124cc1[_0x6694('0x155')])){return this['channel'][_0x6694('0x30')](_0x124cc1,_0x6694('0x168'));}logger['info'](util[_0x6694('0xa3')](_0x6694('0x156'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x124cc1[_0x6694('0x155')]));var _0x3c2e22=this[_0x6694('0x50')]['sync'](this,_0x124cc1['pause_id']);var _0x459a6b=this['agentPause'][_0x6694('0x74')](this,_0x124cc1[_0x6694('0x155')],_0x3c2e22);if(_0x459a6b){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6694('0x10')][_0x6694('0x3f')],_0x124cc1[_0x6694('0x155')]));this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')](_0x6694('0x157'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x124cc1[_0x6694('0x155')]));return{'code':0xc8,'result':_0x6694('0x158')};}else{logger[_0x6694('0x34')](util[_0x6694('0xa3')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6694('0x10')][_0x6694('0x3f')],_0x124cc1[_0x6694('0x155')]));this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x157'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x124cc1[_0x6694('0x155')]));return{'code':0xc8,'result':_0x6694('0x15b')};}};AGIVertices['prototype']['playback']=function(_0xa6e232){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x169'),_0xa6e232[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0xa6e232[_0x6694('0x113')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0xa6e232,_0x6694('0x112'));}var _0xacff02=this[_0x6694('0x21')]['sync'](this,_0xa6e232[_0x6694('0x113')]);if(!_0xacff02){return this[_0x6694('0x10')]['error'](_0xa6e232,_0x6694('0x114'));}var _0x2230fd=this[_0x6694('0x10')][_0x6694('0x5b')](_0x6694('0x16a'),[_0xacff02,_0xa6e232[_0x6694('0x16b')]]);if(_0x2230fd[_0x6694('0xab')]===-0x1){return _0x2230fd;}return this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x16c'),_0x6694('0x16a'),_0xacff02));};AGIVertices['prototype'][_0x6694('0x16d')]=function(_0x520df8){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x16e'),_0x520df8['label']));if(!this[_0x6694('0xac')](_0x520df8['queue_id'])){return this[_0x6694('0x10')]['error'](_0x520df8,_0x6694('0x16f'));}var _0x483467='';var _0x13f74f=parseInt(_0x520df8[_0x6694('0x170')],0xa);if(isNaN(_0x13f74f)){_0x483467=_0x520df8[_0x6694('0x170')];}else{_0x483467=this[_0x6694('0x19')]['sync'](this,_0x520df8[_0x6694('0x170')]);if(!_0x483467){return this[_0x6694('0x10')][_0x6694('0x30')](_0x520df8,_0x6694('0x171'));}}var _0x31a619='';if(this[_0x6694('0xac')](_0x520df8['file_id'])){var _0x500bed=this['getSound'][_0x6694('0x74')](this,_0x520df8['file_id']);if(_0x500bed){_0x31a619=_0x500bed;}}this[_0x6694('0x3c')][_0x6694('0x74')](this,_0x520df8,_0x483467);if(_0x520df8[_0x6694('0x16b')][_0x6694('0x172')]('x')<0x0){_0x520df8[_0x6694('0x16b')]+='x';}if(_0x520df8['opts'][_0x6694('0x172')]('X')<0x0){_0x520df8[_0x6694('0x16b')]+='X';}this[_0x6694('0x10')][_0x6694('0xa5')](_0x6694('0x173'),_0x483467?_0x483467[_0x6694('0x174')]():'');var _0x588853=this[_0x6694('0x10')]['exec'](_0x6694('0x175'),[_0x483467,_0x520df8[_0x6694('0x16b')],_0x520df8[_0x6694('0x68')],_0x31a619,_0x520df8[_0x6694('0x6b')],_0x520df8[_0x6694('0x8')],_0x520df8['macro'],_0x520df8['gosub'],'',_0x520df8[_0x6694('0x176')]]);if(_0x588853[_0x6694('0xab')]===-0x1){return _0x588853;}return this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')](_0x6694('0x16c'),_0x6694('0x175'),_0x483467));};AGIVertices[_0x6694('0x13')][_0x6694('0x177')]=function(_0x1b4bef){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x178'),_0x1b4bef[_0x6694('0x3d')]));var _0x5014b4=_0x1b4bef[_0x6694('0x179')]||_0x6694('0x12c');var _0x16bdbd=util['format'](_0x6694('0x17a'),this[_0x6694('0x10')][_0x6694('0x41')],rs[_0x6694('0x11b')](0x5));var _0x3cb4a8=util['format'](_0x6694('0x17b'),FILES_PATH,_0x16bdbd,_0x5014b4);var _0x234bf8=util[_0x6694('0xa3')]('%s/recordings/%s',FILES_PATH,_0x16bdbd);this[_0x6694('0x40')][_0x6694('0x74')](this,_0x1b4bef,_0x16bdbd,_0x3cb4a8);this[_0x6694('0x10')][_0x6694('0xa5')](_0x6694('0x17c'),_0x16bdbd);logger[_0x6694('0x34')](_0x6694('0x17d'),_0x234bf8,_0x5014b4,_0x1b4bef['escape_digits'],_0x1b4bef[_0x6694('0x6b')]);return this[_0x6694('0x10')][_0x6694('0x12f')](_0x234bf8,_0x5014b4,_0x1b4bef[_0x6694('0x17e')],_0x1b4bef[_0x6694('0x6b')],undefined,!![]);};AGIVertices[_0x6694('0x13')][_0x6694('0x17f')]=function(_0x1cdc0e){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x180'),_0x1cdc0e[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x1cdc0e['url'])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x181'));}var _0x4444c3=this['restAPI'][_0x6694('0x74')](this,_0x1cdc0e);logger[_0x6694('0x34')](util['format'](_0x6694('0x182'),util[_0x6694('0x183')](_0x4444c3,{'showHidden':![],'depth':null})));if(!this[_0x6694('0xac')](_0x1cdc0e['variable_id'])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x184'));}var _0x3953a7=this[_0x6694('0x14')][_0x6694('0x74')](this,_0x1cdc0e['variable_id']);if(!_0x3953a7){return this[_0x6694('0x10')]['error'](_0x1cdc0e,_0x6694('0x119'));}this['channel'][_0x6694('0xa5')](util[_0x6694('0xa3')]('%s_STATUS_CODE',_0x3953a7),_0x4444c3[_0x6694('0x78')]?_0x4444c3[_0x6694('0x78')]:_0x6694('0x185'));this[_0x6694('0x10')][_0x6694('0xa5')](util[_0x6694('0xa3')](_0x6694('0x186'),_0x3953a7),_0x4444c3[_0x6694('0x79')]?_0x4444c3['statusMessage']:'OK');if(_0x4444c3[_0x6694('0x6f')]){try{this['saveRestApiResult'](_0x4444c3[_0x6694('0x6f')],_0x3953a7);}catch(_0x42bc88){logger['error'](util['format'](_0x6694('0x187'),_0x3953a7));}}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')]('variable\x20%s\x20set',_0x3953a7));};AGIVertices[_0x6694('0x13')][_0x6694('0x188')]=function(_0x1a1689){logger['info'](util[_0x6694('0xa3')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1a1689[_0x6694('0x3d')]));return this[_0x6694('0x10')][_0x6694('0x189')](_0x1a1689[_0x6694('0x18a')][_0x6694('0x5c')](/\s+/g,''),_0x1a1689['escape_digits']);};AGIVertices[_0x6694('0x13')][_0x6694('0x18b')]=function(_0x25b160){logger[_0x6694('0x34')](util['format'](_0x6694('0x18c'),_0x25b160['label']));return this[_0x6694('0x10')][_0x6694('0x18d')](_0x25b160[_0x6694('0x6a')]['replace'](/\s+/g,''),_0x25b160['escape_digits']);};AGIVertices[_0x6694('0x13')][_0x6694('0x18e')]=function(_0x21f71b){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x18f'),_0x21f71b[_0x6694('0x3d')]));return this[_0x6694('0x10')][_0x6694('0x190')](_0x21f71b[_0x6694('0x60')],_0x21f71b[_0x6694('0x17e')]);};AGIVertices[_0x6694('0x13')][_0x6694('0x191')]=function(_0xcbc6a2){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x192'),_0xcbc6a2[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0xcbc6a2[_0x6694('0x193')])){return this[_0x6694('0x10')]['noop']('no\x20mail\x20account\x20configured');}var _0x11e654=this[_0x6694('0x194')][_0x6694('0x74')](this,_0xcbc6a2[_0x6694('0x193')]);if(!_0x11e654||!_0x11e654['Smtp']){return this[_0x6694('0x10')][_0x6694('0x30')](_0xcbc6a2,_0x6694('0x195'));}var _0x55ae96={'from':util[_0x6694('0xa3')](_0x6694('0x196'),_0x11e654[_0x6694('0x17')],_0x11e654['email']||_0x11e654['Smtp']['user']),'to':_0xcbc6a2['to']||'','cc':_0xcbc6a2['cc']||'','bcc':_0xcbc6a2['bcc']||'','subject':_0xcbc6a2[_0x6694('0x197')],'html':_0xcbc6a2[_0x6694('0x60')],'text':_0xcbc6a2['text']};var _0x54eff2={'tls':{'rejectUnauthorized':![]}};if(_0x11e654[_0x6694('0x198')][_0x6694('0x199')]){_0x54eff2['service']=_0x11e654[_0x6694('0x198')][_0x6694('0x199')];}else{_0x54eff2[_0x6694('0x19a')]=_0x11e654[_0x6694('0x198')]['host'];_0x54eff2['port']=_0x11e654['Smtp'][_0x6694('0x19b')];_0x54eff2['secure']=_0x11e654['Smtp'][_0x6694('0x19c')];}if(_0x11e654['Smtp']['authentication']){_0x54eff2['auth']={'user':_0x11e654[_0x6694('0x198')][_0x6694('0x19d')],'pass':_0x11e654[_0x6694('0x198')][_0x6694('0x19e')]};}if(this[_0x6694('0xac')](_0xcbc6a2[_0x6694('0x19f')])){}logger[_0x6694('0x1a0')]('sendMail\x20message',JSON[_0x6694('0xa6')](_0x55ae96));this[_0x6694('0x3c')][_0x6694('0x74')](this,_0xcbc6a2,_0xcbc6a2[_0x6694('0x193')]);this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x1a1'),_0x11e654[_0x6694('0x17')]));this[_0x6694('0x26')][_0x6694('0x74')](this,_0x54eff2,_0x55ae96);return this[_0x6694('0x10')][_0x6694('0xb1')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6694('0x13')][_0x6694('0x1a2')]=function(_0x1d6ace){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x1d6ace[_0x6694('0x3d')]));return this['channel'][_0x6694('0xb1')](_0x6694('0x1a3'));};AGIVertices[_0x6694('0x13')][_0x6694('0x1a4')]=function(_0x244add){logger['info'](util[_0x6694('0xa3')](_0x6694('0x1a5'),_0x244add['label']));if(!this[_0x6694('0xac')](_0x244add[_0x6694('0x1a6')])){return this['channel'][_0x6694('0xb1')](_0x6694('0x1a7'));}var _0x441679=this[_0x6694('0x39')][_0x6694('0x74')](this,_0x244add['sms_account_id']);if(!_0x441679){return this[_0x6694('0x10')][_0x6694('0x30')](_0x244add,_0x6694('0x1a8'));}var _0x293093={'body':_0x244add['sms_text'],'phone':_0x244add['to']||'','SmsAccountId':_0x441679['id']};logger[_0x6694('0x1a0')](_0x6694('0x1a9'),JSON[_0x6694('0xa6')](_0x293093));this[_0x6694('0x3c')]['sync'](this,_0x244add,_0x244add['sms_account_id']);this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x1aa'),_0x441679[_0x6694('0x17')]));this[_0x6694('0x3b')][_0x6694('0x74')](this,_0x293093);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6694('0x13')][_0x6694('0x1ab')]=function(_0x4b5805){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4b5805[_0x6694('0x3d')]));if(!this['isConfigured'](_0x4b5805[_0x6694('0xdb')])){return this[_0x6694('0x10')][_0x6694('0x30')](_0x4b5805,'no\x20variable\x20selected');}var _0x18c53d=this[_0x6694('0x14')]['sync'](this,_0x4b5805[_0x6694('0xdb')]);if(!_0x18c53d){return this['channel'][_0x6694('0x30')](_0x4b5805,'no\x20variable\x20found');}return this[_0x6694('0x10')][_0x6694('0xa5')](_0x18c53d,_0x4b5805[_0x6694('0x1ac')]);};AGIVertices[_0x6694('0x13')][_0x6694('0x1ad')]=function(_0x47a6a1){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x1ae'),_0x47a6a1[_0x6694('0x3d')]));this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x1af'));if(_0x47a6a1[_0x6694('0xc2')]==='yes'){this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x1b0'));return this[_0x6694('0x10')]['answer']();}return this[_0x6694('0x10')][_0x6694('0xb1')]('Skipped\x20Answer');};AGIVertices[_0x6694('0x13')][_0x6694('0x1b1')]=function(_0x561f92){logger[_0x6694('0x34')](util[_0x6694('0xa3')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x561f92['label']));if(!this['isConfigured'](_0x561f92[_0x6694('0x1b2')])){return this['channel'][_0x6694('0x30')](_0x561f92,'no\x20subproject\x20selected');}var _0x157b6a=this['getSquareProject'][_0x6694('0x74')](this,_0x561f92['project_id']);if(!this[_0x6694('0xac')](_0x157b6a)){return this[_0x6694('0x10')][_0x6694('0x30')](_0x561f92,util[_0x6694('0xa3')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x561f92[_0x6694('0x1b2')]));}if(_0x157b6a===this[_0x6694('0x10')][_0x6694('0x44')]){return this[_0x6694('0x10')]['error'](_0x561f92,_0x6694('0x1b3'));}this[_0x6694('0x3c')]['sync'](this,_0x561f92,_0x157b6a);var _0x464f6c=this[_0x6694('0x10')][_0x6694('0x5b')]('AGI',util[_0x6694('0xa3')](_0x6694('0x1b4'),config['agi'][_0x6694('0x19a')]||_0x6694('0x1b5'),_0x157b6a,this[_0x6694('0x10')]['arg_1']));if(_0x464f6c[_0x6694('0xab')]===-0x1){return _0x464f6c;}return this['channel']['noop'](util['format'](_0x6694('0x16c'),'AGI',_0x157b6a));};AGIVertices[_0x6694('0x13')]['system']=function(_0x30dfec){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x1b6'),_0x30dfec[_0x6694('0x3d')]));var _0x5dcadf=this[_0x6694('0x5a')][_0x6694('0x74')](this,_0x30dfec[_0x6694('0xbf')]);this['createSquareDetailsReport']['sync'](this,_0x30dfec,_0x30dfec[_0x6694('0xbf')]);if(this['isConfigured'](_0x30dfec['variable_id'])){var _0x2687e6=this['getVariable'][_0x6694('0x74')](this,_0x30dfec[_0x6694('0xdb')]);if(_0x2687e6){this[_0x6694('0x10')][_0x6694('0xa5')](_0x2687e6,_0x5dcadf);return this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x30dfec[_0x6694('0xbf')],_0x2687e6));}}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x1b7'),_0x30dfec[_0x6694('0xbf')]));};AGIVertices[_0x6694('0x13')]['google_cloud_tts']=function(_0x2fcda2){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x1b8'),_0x2fcda2['label']));_0x2fcda2['text']=_0x2fcda2[_0x6694('0x60')][_0x6694('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6694('0xac')](_0x2fcda2[_0x6694('0x5e')])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0x1b9'));}if(!this[_0x6694('0xac')](_0x2fcda2['text'])){return this[_0x6694('0x10')][_0x6694('0xb1')](_0x6694('0xb2'));}this[_0x6694('0x10')]['noop'](util[_0x6694('0xa3')](_0x6694('0x1ba'),_0x2fcda2[_0x6694('0x60')]));var _0x29ee6e=this[_0x6694('0x5d')][_0x6694('0x74')](this,_0x2fcda2);if(_0x29ee6e){this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x29ee6e));var _0x2ba32c=this['channel'][_0x6694('0x103')](_0x29ee6e);try{fs[_0x6694('0x104')](_0x29ee6e+'.wav');}catch(_0x42ed41){logger['error'](_0x42ed41);}return _0x2ba32c;}return this[_0x6694('0x10')][_0x6694('0x30')](_0x2fcda2,_0x6694('0x1bb'));};AGIVertices[_0x6694('0x13')]['tts']=function(_0x548e47){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x1bc'),_0x548e47[_0x6694('0x3d')]));_0x548e47[_0x6694('0x60')]=_0x548e47['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6694('0xac')](_0x548e47[_0x6694('0x60')])){return this['channel'][_0x6694('0xb1')](_0x6694('0xb2'));}this['channel'][_0x6694('0xb1')](util['format'](_0x6694('0x1bd'),_0x548e47['text']));var _0x1452c1=this[_0x6694('0x66')]['sync'](this,_0x548e47);if(_0x1452c1){this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x1be'),_0x1452c1));var _0x5a809d=this[_0x6694('0x10')][_0x6694('0x103')](_0x1452c1);try{fs[_0x6694('0x104')](_0x1452c1+'.wav');}catch(_0x3afcca){logger['error'](_0x3afcca);}return _0x5a809d;}return this[_0x6694('0x10')]['error'](_0x548e47,_0x6694('0x1bf'));};AGIVertices[_0x6694('0x13')][_0x6694('0x1c0')]=function(_0x836661){logger[_0x6694('0x34')](util['format'](_0x6694('0x1c1'),_0x836661[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x836661[_0x6694('0x155')])){return this['channel'][_0x6694('0x30')](_0x836661,_0x6694('0x168'));}logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x156'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x836661[_0x6694('0x155')]));var _0xc4ec03=this[_0x6694('0x54')][_0x6694('0x74')](this,_0x836661[_0x6694('0x155')]);if(_0xc4ec03){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x157'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x836661[_0x6694('0x155')]));this['channel']['noop'](util[_0x6694('0xa3')](_0x6694('0x157'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x836661[_0x6694('0x155')]));return{'code':0xc8,'result':_0x6694('0x158')};}else{logger['info'](util['format'](_0x6694('0x159'),this[_0x6694('0x10')][_0x6694('0x3f')],_0x836661['findBy']));this['channel'][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x159'),this[_0x6694('0x10')]['callerid'],_0x836661[_0x6694('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6694('0x13')][_0x6694('0x1c2')]=function(_0x329985){logger['info'](util[_0x6694('0xa3')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x329985[_0x6694('0x3d')]));var _0x214657=this['channel']['exec'](_0x6694('0x1c3'),[_0x329985[_0x6694('0x1c4')],_0x329985['options']]);if(_0x214657[_0x6694('0xab')]===-0x1){return _0x214657;}return this[_0x6694('0x10')][_0x6694('0xb1')](util[_0x6694('0xa3')](_0x6694('0x16c'),_0x6694('0x1c3'),_0x329985[_0x6694('0x1c4')]));};AGIVertices[_0x6694('0x13')][_0x6694('0x1c5')]=function(_0x3b96c8){logger[_0x6694('0x34')](util[_0x6694('0xa3')](_0x6694('0x1c6'),_0x3b96c8[_0x6694('0x3d')]));if(!this[_0x6694('0xac')](_0x3b96c8[_0x6694('0xdb')])){return this['channel'][_0x6694('0x30')](_0x3b96c8,_0x6694('0x1c7'));}var _0x5bb6fb=this[_0x6694('0x14')][_0x6694('0x74')](this,_0x3b96c8[_0x6694('0xdb')]);if(!_0x5bb6fb){return this[_0x6694('0x10')][_0x6694('0x30')](_0x3b96c8,_0x6694('0x119'));}var _0x1d9aaa=this[_0x6694('0x10')][_0x6694('0x14')](_0x5bb6fb);return{'code':0xc8,'result':_0x1d9aaa[_0x6694('0xa9')]?_0x1d9aaa[_0x6694('0xa9')]:'-'};};String['prototype'][_0x6694('0xa8')]=function(_0x5754ad,_0x5968ec){return this['split'](_0x5754ad)[_0x6694('0x1c8')](_0x5968ec);};module[_0x6694('0x1c9')]=AGIVertices; \ No newline at end of file +var _0x7677=['channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','method','timeout','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','file_id','no\x20file\x20audio\x20selected','response','test','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','Smtp','service','host','port','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','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','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','path','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport'];(function(_0xe6202d,_0x31b9d6){var _0x5e83b8=function(_0x70cc55){while(--_0x70cc55){_0xe6202d['push'](_0xe6202d['shift']());}};_0x5e83b8(++_0x31b9d6);}(_0x7677,0x18f));var _0x7767=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7677[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0x7767('0x0'));var util=require('util');var _=require(_0x7767('0x1'));var sh=require(_0x7767('0x2'));var odbc=require(_0x7767('0x3'))();var rs=require('randomstring');var moment=require(_0x7767('0x4'));var Mustache=require(_0x7767('0x5'));var rp=require(_0x7767('0x6'));var logger=require(_0x7767('0x7'))(_0x7767('0x8'));var config=require(_0x7767('0x9'));var scripts=require(_0x7767('0xa'));var FILES_PATH=_0x7767('0xb');var recursiveMapAttributes=['rawHeaders',_0x7767('0xc')];var verticesWithRetry=[_0x7767('0xd'),'getdigits',_0x7767('0xe')];var AGIVertices=function(_0x198b1f,_0x14638b,_0xd5b1b9){this['channel']=_0x198b1f;this[_0x7767('0xf')]=_0x14638b;this[_0x7767('0x10')]=_0xd5b1b9;};AGIVertices[_0x7767('0x11')][_0x7767('0x12')]=function(_0x5edd08,_0x2d8d33){this[_0x7767('0xf')][_0x7767('0x13')](_0x5edd08)[_0x7767('0x14')](function(_0x42a3ef){_0x2d8d33(null,_0x42a3ef?_0x42a3ef['name']:![]);})[_0x7767('0x15')](function(_0x4d39c8){_0x2d8d33(_0x4d39c8);});};AGIVertices[_0x7767('0x11')]['getVoiceQueue']=function(_0xe7039e,_0x52e5a7){this[_0x7767('0xf')][_0x7767('0x16')](_0xe7039e)['then'](function(_0x3f1662){_0x52e5a7(null,_0x3f1662?_0x3f1662[_0x7767('0x17')]:![]);})[_0x7767('0x15')](function(_0x1d53ac){_0x52e5a7(_0x1d53ac);});};AGIVertices[_0x7767('0x11')][_0x7767('0x18')]=function(_0x2581fb,_0x44e6ec){this[_0x7767('0xf')][_0x7767('0x19')](_0x2581fb)[_0x7767('0x14')](function(_0x59d9f6){_0x44e6ec(null,_0x59d9f6?_0x59d9f6[_0x7767('0x17')]:![]);})[_0x7767('0x15')](function(_0x59d8bd){_0x44e6ec(_0x59d8bd);});};AGIVertices[_0x7767('0x11')][_0x7767('0x1a')]=function(_0x2fc806,_0x134b27){this[_0x7767('0xf')][_0x7767('0x1b')](_0x2fc806)['then'](function(_0x25cf6f){_0x134b27(null,_0x25cf6f?_0x25cf6f[_0x7767('0x1c')]:![]);})['catch'](function(_0x3fae2f){_0x134b27(_0x3fae2f);});};AGIVertices[_0x7767('0x11')][_0x7767('0x1d')]=function(_0x4e729e,_0x34bb6c){this[_0x7767('0xf')][_0x7767('0x1e')](_0x4e729e)['then'](function(_0x56cfa5){_0x34bb6c(null,_0x56cfa5?_0x56cfa5[_0x7767('0x17')]:![]);})[_0x7767('0x15')](function(_0x27bc09){_0x34bb6c(_0x27bc09);});};AGIVertices[_0x7767('0x11')][_0x7767('0x1f')]=function(_0x58a556,_0x542aab){this[_0x7767('0xf')]['getTrunkById'](_0x58a556)[_0x7767('0x14')](function(_0x1f239e){_0x542aab(null,_0x1f239e?_0x1f239e[_0x7767('0x17')]:![]);})[_0x7767('0x15')](function(_0x546c98){_0x542aab(_0x546c98);});};AGIVertices[_0x7767('0x11')][_0x7767('0x20')]=function(_0x1de122,_0x488d69){var _0x18bf0d=this;this[_0x7767('0xf')][_0x7767('0x21')](_0x1de122)[_0x7767('0x14')](function(_0x5a7987){_0x488d69(null,_0x5a7987?_0x18bf0d[_0x7767('0x22')](_0x5a7987['save_name']):![]);})['catch'](function(_0x111f19){_0x488d69(_0x111f19);});};AGIVertices[_0x7767('0x11')][_0x7767('0x23')]=function(_0x12116b,_0x461d39){this['rpc']['getMailAccountById'](_0x12116b)['then'](function(_0x3c38fa){_0x461d39(null,_0x3c38fa?_0x3c38fa:![]);})['catch'](function(_0x1d76d3){_0x461d39(_0x1d76d3);});};AGIVertices[_0x7767('0x11')][_0x7767('0x24')]=function(_0x174067,_0x1f2b67,_0x417615){this[_0x7767('0x10')][_0x7767('0x24')](_0x174067,_0x1f2b67)[_0x7767('0x14')](function(){_0x417615(null);})[_0x7767('0x15')](function(_0x1b100b){_0x417615(_0x1b100b);});};AGIVertices[_0x7767('0x11')][_0x7767('0x25')]=function(_0x31ada7,_0x4fc3e8){this[_0x7767('0xf')][_0x7767('0x26')](_0x31ada7)[_0x7767('0x14')](function(_0x1055c8){if(_0x1055c8){if(_0x1055c8[_0x7767('0x27')]){_0x4fc3e8(null,[_0x1055c8[_0x7767('0x28')]]);}else{_0x4fc3e8(null,_[_0x7767('0x29')](_0x1055c8['Intervals'],_0x7767('0x28')));}}else{_0x4fc3e8(null,![]);}})[_0x7767('0x15')](function(_0x35121d){_0x4fc3e8(_0x35121d);});};AGIVertices[_0x7767('0x11')][_0x7767('0x22')]=function(_0x5be30e){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x5be30e);};AGIVertices[_0x7767('0x11')]['getQueryOdbc']=function(_0x200bde,_0x19f424,_0x24f168){odbc[_0x7767('0x2a')](_0x200bde,function(_0x548bc2){if(_0x548bc2){logger[_0x7767('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x548bc2);_0x24f168(_0x548bc2);}else{logger[_0x7767('0x2c')](_0x7767('0x2d'));odbc[_0x7767('0x2e')](_0x19f424,function(_0x4ff9ca,_0x2c9561){if(_0x4ff9ca){logger['info'](_0x7767('0x2f'),_0x19f424);_0x24f168(_0x4ff9ca);}else{logger['info'](_0x7767('0x30'),_0x19f424);odbc[_0x7767('0x31')](function(_0x341eb1){if(_0x341eb1){logger[_0x7767('0x2b')](_0x7767('0x32'),_0x341eb1);}_0x24f168(null,_0x2c9561);});}});}});};AGIVertices[_0x7767('0x11')]['getSmsAccount']=function(_0x212050,_0x1edb51){this['rpc'][_0x7767('0x33')](_0x212050)[_0x7767('0x14')](function(_0xe382ff){_0x1edb51(null,_0xe382ff?_0xe382ff:![]);})[_0x7767('0x15')](function(_0x528902){_0x1edb51(_0x528902);});};AGIVertices['prototype'][_0x7767('0x34')]=function(_0x43c242,_0x2e0282){this[_0x7767('0xf')][_0x7767('0x34')](_0x43c242)[_0x7767('0x14')](function(_0x32934d){_0x2e0282(null,_0x32934d);})['catch'](function(_0x5b0502){_0x2e0282(_0x5b0502);});};AGIVertices['prototype'][_0x7767('0x35')]=function(_0x4c2158,_0x595da8,_0x4c602b){this[_0x7767('0xf')][_0x7767('0x35')]({'uniqueid':this[_0x7767('0x36')][_0x7767('0x37')],'node':_0x4c2158[_0x7767('0x38')],'application':_0x4c2158[_0x7767('0x39')],'data':_0x595da8||null,'project_name':this[_0x7767('0x36')][_0x7767('0x3a')],'callerid':this[_0x7767('0x36')][_0x7767('0x3b')]})['then'](function(_0x12c480){if(_0x4c602b){_0x4c602b(null,_0x12c480);}})[_0x7767('0x15')](function(_0x54a361){if(_0x4c602b){_0x4c602b(_0x54a361);}});};AGIVertices['prototype'][_0x7767('0x3c')]=function(_0x48e46e,_0x39548c,_0x2076ea,_0x5e2b6a){this['rpc'][_0x7767('0x3c')]({'uniqueid':this['channel'][_0x7767('0x37')],'callerid':this[_0x7767('0x36')]['callerid'],'calleridname':this[_0x7767('0x36')][_0x7767('0x3d')],'context':this[_0x7767('0x36')][_0x7767('0x3e')],'extension':this[_0x7767('0x36')][_0x7767('0x3f')],'priority':this['channel'][_0x7767('0x40')],'accountcode':this[_0x7767('0x36')][_0x7767('0x41')],'dnid':this['channel'][_0x7767('0x42')],'projectName':this['channel'][_0x7767('0x3a')],'saveName':_0x39548c,'filename':_0x48e46e[_0x7767('0x43')]||_0x39548c,'savePath':_0x2076ea})[_0x7767('0x14')](function(_0x19885f){_0x5e2b6a(null,_0x19885f);})['catch'](function(_0x3ca918){_0x5e2b6a(_0x3ca918);});};AGIVertices[_0x7767('0x11')][_0x7767('0x44')]=function(_0x4a5bf5,_0x151e69,_0x4a501f,_0x3f9cb9,_0xc2da65){this[_0x7767('0xf')][_0x7767('0x44')]({'uniqueid':this['channel']['uniqueid'],'body':_0x4a5bf5,'direction':_0x151e69,'providerName':_0x4a501f,'providerResponse':_0x3f9cb9})[_0x7767('0x14')](function(_0x5a99e6){if(_0xc2da65){_0xc2da65(null,_0x5a99e6);}})['catch'](function(_0x47c312){if(_0xc2da65){_0xc2da65(_0x47c312);}});};AGIVertices[_0x7767('0x11')]['createCmContact']=function(_0x2f4977,_0x2d7138){this['rpc'][_0x7767('0x45')]({'firstName':_[_0x7767('0x46')](_0x2f4977['name'])||_[_0x7767('0x47')](_0x2f4977[_0x7767('0x17')])?_0x7767('0x48')+Math[_0x7767('0x49')]():_0x2f4977[_0x7767('0x17')],'lastName':_[_0x7767('0x46')](_0x2f4977[_0x7767('0x4a')])||_[_0x7767('0x47')](_0x2f4977[_0x7767('0x4a')])?null:_0x2f4977[_0x7767('0x4a')],'phone':_0x2f4977['phone'],'ListId':_0x2f4977['list_id'],'scheduledat':_0x2f4977[_0x7767('0x4b')],'callbackUniqueid':this['channel'][_0x7767('0x37')],'tags':_0x7767('0x4c'),'description':_0x7767('0x4d')+_0x2f4977[_0x7767('0x4b')][_0x7767('0x4e')](),'priority':_0x2f4977[_0x7767('0x4f')]})[_0x7767('0x14')](function(_0xaa0d4){_0x2d7138(null,_0xaa0d4);})[_0x7767('0x15')](function(_0x49ac44){_0x2d7138(_0x49ac44);});};AGIVertices[_0x7767('0x11')]['getPause']=function(_0x1e37ec,_0x5b7699){this[_0x7767('0xf')]['getPauseById'](_0x1e37ec)[_0x7767('0x14')](function(_0x56b643){_0x5b7699(null,_0x56b643?_0x56b643[_0x7767('0x17')]:![]);})['catch'](function(_0x4691cd){_0x5b7699(_0x4691cd);});};AGIVertices[_0x7767('0x11')][_0x7767('0x50')]=function(_0x490e80,_0x9cfb5d,_0x31b34b){var _0x76aa0d={'role':_0x7767('0x51')};_0x76aa0d[_0x490e80]=this[_0x7767('0x36')][_0x7767('0x3b')];this[_0x7767('0xf')][_0x7767('0x50')](_0x76aa0d,_0x9cfb5d,this[_0x7767('0x36')][_0x7767('0x37')])[_0x7767('0x14')](function(_0x56aea5){_0x31b34b(null,_[_0x7767('0x47')](_0x56aea5)?![]:!![]);})[_0x7767('0x15')](function(_0x172f91){logger['error'](_0x172f91);_0x31b34b(null,![]);});};AGIVertices[_0x7767('0x11')][_0x7767('0x52')]=function(_0x2bbf84,_0x1283d9){var _0x4e27a5={'role':_0x7767('0x51')};_0x4e27a5[_0x2bbf84]=this['channel']['callerid'];this[_0x7767('0xf')][_0x7767('0x52')](_0x4e27a5)[_0x7767('0x14')](function(_0x538f75){_0x1283d9(null,_[_0x7767('0x47')](_0x538f75)?![]:!![]);})[_0x7767('0x15')](function(_0x11de1a){logger[_0x7767('0x2b')](_0x11de1a);_0x1283d9(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x35a5bd,_0xf9ca21){var _0x2b0f06={'role':_0x7767('0x51')};_0x2b0f06[_0x35a5bd]=this[_0x7767('0x36')]['callerid'];this[_0x7767('0xf')][_0x7767('0x53')](_0x2b0f06)[_0x7767('0x14')](function(_0x432a73){_0xf9ca21(null,_[_0x7767('0x47')](_0x432a73)?![]:!![]);})[_0x7767('0x15')](function(_0x4185f6){logger[_0x7767('0x2b')](_0x4185f6);_0xf9ca21(null,![]);});};AGIVertices[_0x7767('0x11')][_0x7767('0x54')]=function(_0x10dbc6,_0x827e57){var _0x42547b={'role':_0x7767('0x51')};_0x42547b[_0x10dbc6]=this[_0x7767('0x36')][_0x7767('0x3b')];var _0x1f8f8d=_0x10dbc6!=_0x7767('0x55')?util[_0x7767('0x56')](_0x7767('0x57'),_0x7767('0x58'),this['channel']['callerid']):undefined;this[_0x7767('0xf')][_0x7767('0x54')](_0x42547b,_0x1f8f8d)['then'](function(_0x2561cb){_0x827e57(null,_['isNil'](_0x2561cb)?![]:!![]);})[_0x7767('0x15')](function(_0x523b39){logger[_0x7767('0x2b')](_0x523b39);_0x827e57(null,![]);});};AGIVertices['prototype'][_0x7767('0x59')]=function(_0x2475fc,_0x564c95){sh[_0x7767('0x5a')](_[_0x7767('0x5b')](_0x2475fc),function(_0x4f22e0,_0x5989a8){var _0x46e9d5=_0x5989a8[_0x7767('0x5c')](/(\r\n|\n|\r)/gm,'');_0x564c95(null,_0x46e9d5);});};AGIVertices['prototype'][_0x7767('0x5d')]=function(_0x2db035,_0x1a1ba5){scripts[_0x7767('0x5d')](_0x2db035['apiKey'],_0x2db035[_0x7767('0x5e')]||_0x7767('0x5f'),_0x2db035[_0x7767('0x5f')],_0x2db035[_0x7767('0x60')]||'en-US',_0x2db035[_0x7767('0x61')]||'MALE',_0x2db035[_0x7767('0x62')]||_0x7767('0x63'))[_0x7767('0x14')](function(_0x5f23de){_0x1a1ba5(null,_0x5f23de);})[_0x7767('0x15')](function(_0x14bad2){_0x1a1ba5(_0x14bad2);});};AGIVertices[_0x7767('0x11')][_0x7767('0x64')]=function(_0x2550a2,_0x2eabbc){scripts[_0x7767('0x64')](_0x2550a2[_0x7767('0x5f')],_0x2550a2[_0x7767('0x65')]||'en',0x1)[_0x7767('0x14')](function(_0x31eda4){_0x2eabbc(null,_0x31eda4);})[_0x7767('0x15')](function(_0x5149bf){_0x2eabbc(_0x5149bf);});};AGIVertices['prototype']['restAPI']=function(_0x250148,_0x3d3ef6){var _0x528964={'uri':_0x250148['url'],'method':_0x250148[_0x7767('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x250148[_0x7767('0x67')])==='number'&&parseInt(_0x250148[_0x7767('0x67')])>=0x1?parseInt(_0x250148[_0x7767('0x67')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x7767('0x68')],_0x528964['method'][_0x7767('0x69')]())){try{_0x528964[_0x7767('0x6a')]=_0x250148[_0x7767('0xc')]?JSON[_0x7767('0x6b')](_0x250148[_0x7767('0xc')]):{};}catch(_0x49b847){logger[_0x7767('0x2b')](_0x7767('0x6c'),_0x49b847);}}try{_0x528964[_0x7767('0x6d')]=_0x250148['rawHeaders']?JSON[_0x7767('0x6b')](_0x250148[_0x7767('0x6e')]):{};}catch(_0x1c8826){logger[_0x7767('0x2b')](_0x7767('0x6f'),_0x1c8826);}if(_0x250148[_0x7767('0x70')]){try{var _0x57b93a=require(_0x250148[_0x7767('0x70')])[_0x7767('0x71')](this,_0x528964);_0x528964[_0x7767('0x72')]=Mustache[_0x7767('0x73')](_0x250148[_0x7767('0x74')],_0x57b93a,{},['$$','$$']);if(_0x528964[_0x7767('0x6d')]){_0x528964[_0x7767('0x6d')]=JSON[_0x7767('0x6b')](Mustache[_0x7767('0x73')](JSON[_0x7767('0x75')](_0x528964['headers']),_0x57b93a,{},['$$','$$']));}if(_0x528964[_0x7767('0x6a')]){_0x528964[_0x7767('0x6a')]=JSON['parse'](Mustache[_0x7767('0x73')](JSON[_0x7767('0x75')](_0x528964[_0x7767('0x6a')]),_0x57b93a,{},['$$','$$']));}}catch(_0x5a49ef){logger[_0x7767('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5a49ef);}}rp(_0x528964)['then'](function(_0x4b6adc){var _0x80051d={'statusCode':_0x4b6adc[_0x7767('0x76')]||0xc8,'statusMessage':_0x4b6adc[_0x7767('0x77')]||'OK','headers':_0x4b6adc['headers']||{},'body':_0x4b6adc['body']||{}};_0x3d3ef6(null,_0x80051d);})[_0x7767('0x15')](function(_0x48cd25){var _0x40d0c1={'statusCode':_0x48cd25[_0x7767('0x76')]||0x1f4,'statusMessage':_0x48cd25[_0x7767('0x78')]||_0x7767('0x79'),'headers':_0x48cd25[_0x7767('0x7a')]['headers']||{},'body':_0x48cd25[_0x7767('0x7a')][_0x7767('0x6a')]||{}};_0x3d3ef6(null,_0x40d0c1);});};AGIVertices[_0x7767('0x11')]['googleDialogflow']=function(_0x479113,_0x55a987){scripts[_0x7767('0x7b')](this[_0x7767('0x36')][_0x7767('0x37')],_0x479113[_0x7767('0x7c')],_0x479113[_0x7767('0x5f')],_0x479113[_0x7767('0x7d')]||'en')[_0x7767('0x14')](function(_0x5c28b4){_0x55a987(null,_0x5c28b4);})['catch'](function(_0xcbf343){_0x55a987(_0xcbf343);});};AGIVertices[_0x7767('0x11')][_0x7767('0x7e')]=function(_0x171877,_0x4d6bb1){scripts['googleDialogflowV2'](this[_0x7767('0x36')][_0x7767('0x37')],_0x171877[_0x7767('0x7f')],_0x171877[_0x7767('0x80')],_0x171877['private_key'],_0x171877[_0x7767('0x5f')],_0x171877['dialogflowV2_language']||'en')[_0x7767('0x14')](function(_0x3cae3c){_0x4d6bb1(null,_0x3cae3c);})[_0x7767('0x15')](function(_0x52fe36){_0x4d6bb1(_0x52fe36);});};AGIVertices[_0x7767('0x11')]['sestekNDA']=function(_0x12d2bb,_0x4020c0){scripts[_0x7767('0x81')](this['channel'],_0x12d2bb)['then'](function(_0x1d6efc){_0x4020c0(null,_0x1d6efc);})[_0x7767('0x15')](function(_0x20c9b2){_0x4020c0(_0x20c9b2);});};AGIVertices['prototype'][_0x7767('0x82')]=function(_0x27986e,_0x2bb06e){scripts[_0x7767('0x82')](_0x27986e[_0x7767('0x7c')],_0x27986e[_0x7767('0x5f')],_0x27986e[_0x7767('0x83')]||_0x7767('0x84'),_0x27986e[_0x7767('0x85')])['then'](function(_0x5e3611){_0x2bb06e(null,_0x5e3611);})[_0x7767('0x15')](function(_0xfe1185){_0x2bb06e(_0xfe1185);});};AGIVertices[_0x7767('0x11')]['ispeechASR']=function(_0x45943f,_0x50fcab,_0x16b927){scripts[_0x7767('0x86')](_0x50fcab,_0x45943f[_0x7767('0x7c')],_0x45943f['ispeech_asr_language']||_0x7767('0x84'),this[_0x7767('0x87')](_0x45943f['model'])?_0x45943f[_0x7767('0x88')]:undefined)[_0x7767('0x14')](function(_0x159199){_0x16b927(null,_0x159199);})[_0x7767('0x15')](function(_0x4a728c){_0x16b927(_0x4a728c);});};AGIVertices[_0x7767('0x11')][_0x7767('0x89')]=function(_0x19c56b,_0x2a1d08){scripts[_0x7767('0x89')](_0x19c56b[_0x7767('0x8a')],_0x19c56b[_0x7767('0x8b')],_0x19c56b[_0x7767('0x8c')],_0x19c56b[_0x7767('0x8d')]||'Amy',_0x19c56b[_0x7767('0x5f')],_0x19c56b[_0x7767('0x8e')]||_0x7767('0x5f'))[_0x7767('0x14')](function(_0x1a3521){_0x2a1d08(null,_0x1a3521);})[_0x7767('0x15')](function(_0x32c47b){_0x2a1d08(_0x32c47b);});};AGIVertices[_0x7767('0x11')]['awsLex']=function(_0xb5d94b,_0x27b3a1){scripts[_0x7767('0x8f')](this[_0x7767('0x36')][_0x7767('0x37')],_0xb5d94b['aws_access_key_id'],_0xb5d94b[_0x7767('0x8b')],_0xb5d94b['aws_lex_region'],_0xb5d94b[_0x7767('0x5f')],_0xb5d94b['aws_bot_name'])[_0x7767('0x14')](function(_0x241702){_0x27b3a1(null,_0x241702);})[_0x7767('0x15')](function(_0x590ff5){_0x27b3a1(_0x590ff5);});};AGIVertices[_0x7767('0x11')][_0x7767('0x90')]=function(_0x3cae2a,_0x24b9d7,_0x561270){scripts[_0x7767('0x90')](_0x24b9d7,_0x3cae2a[_0x7767('0x7c')],_0x3cae2a[_0x7767('0x91')]||_0x7767('0x84'))['then'](function(_0x236099){_0x561270(null,_0x236099);})[_0x7767('0x15')](function(_0x19ac3d){_0x561270(_0x19ac3d);});};AGIVertices[_0x7767('0x11')][_0x7767('0x92')]=function(_0xc0f512,_0x44ab01,_0x1a62e3){scripts[_0x7767('0x92')](_0x44ab01,_0xc0f512[_0x7767('0x93')],_0xc0f512['appsecret'],_0xc0f512[_0x7767('0x72')])[_0x7767('0x14')](function(_0x5b911c){_0x1a62e3(null,_0x5b911c);})['catch'](function(_0x1bc953){_0x1a62e3(_0x1bc953);});};AGIVertices[_0x7767('0x11')][_0x7767('0x94')]=function(_0x40a33b){var _0x1a6684=_[_0x7767('0x95')](verticesWithRetry,_0x40a33b[_0x7767('0x39')])?_0x40a33b:_[_0x7767('0x96')](_0x40a33b);for(var _0x1cff2d in _0x1a6684){if(_0x1a6684[_0x7767('0x97')](_0x1cff2d)){if(_0x1a6684[_0x1cff2d]&&_[_0x7767('0x98')](_0x1a6684[_0x1cff2d])){if(_[_0x7767('0x95')](recursiveMapAttributes,_0x1cff2d)){_0x1a6684[_0x1cff2d]=this[_0x7767('0x99')](_0x1a6684[_0x1cff2d]);}else{_0x1a6684[_0x1cff2d]=this[_0x7767('0x9a')](_0x1a6684[_0x1cff2d]);}}}}return _0x1a6684;};AGIVertices[_0x7767('0x11')][_0x7767('0x9b')]=function(_0x5cb4c2){for(var _0x1e2968 in _0x5cb4c2){if(_0x5cb4c2[_0x7767('0x97')](_0x1e2968)){if(_[_0x7767('0x9c')](_0x5cb4c2[_0x1e2968])){this[_0x7767('0x9b')](_0x5cb4c2[_0x1e2968]);}else if(_[_0x7767('0x9d')](_0x5cb4c2[_0x1e2968])){for(var _0x2d6a91=0x0;_0x2d6a91<_0x5cb4c2[_0x1e2968][_0x7767('0x9e')];_0x2d6a91++){this[_0x7767('0x9b')](_0x5cb4c2[_0x1e2968][_0x2d6a91]);}}else if(_['isString'](_0x5cb4c2[_0x1e2968])){_0x5cb4c2[_0x1e2968]=this[_0x7767('0x9a')](_0x5cb4c2[_0x1e2968]);}}}};AGIVertices[_0x7767('0x11')]['saveRestApiResult']=function(_0x353ad7,_0x27ab94){for(var _0x4ca0b0 in _0x353ad7){if(_0x353ad7['hasOwnProperty'](_0x4ca0b0)){if(_[_0x7767('0x9c')](_0x353ad7[_0x4ca0b0])){if(!_['isEmpty'](_0x353ad7[_0x4ca0b0])){this['saveRestApiResult'](_0x353ad7[_0x4ca0b0],util['format'](_0x7767('0x9f'),_0x27ab94,_0x4ca0b0));}}else if(_[_0x7767('0x9d')](_0x353ad7[_0x4ca0b0])){for(var _0x10f2a1=0x0;_0x10f2a1<_0x353ad7[_0x4ca0b0][_0x7767('0x9e')];_0x10f2a1++){this[_0x7767('0xa0')](_0x353ad7[_0x4ca0b0][_0x10f2a1],util[_0x7767('0x56')](_0x7767('0x9f'),_0x27ab94,_0x4ca0b0+'['+_0x10f2a1+']'));}}else{if(!_[_0x7767('0x47')](_0x353ad7[_0x4ca0b0])){this['channel'][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x9f'),_0x27ab94,_0x4ca0b0),_0x353ad7[_0x4ca0b0]);}}}}};AGIVertices['prototype'][_0x7767('0x99')]=function(_0x3d0fa5){try{var _0x2055db=JSON[_0x7767('0x6b')](_0x3d0fa5);this[_0x7767('0x9b')](_0x2055db);return JSON[_0x7767('0x75')](_0x2055db);}catch(_0x50afa6){return this[_0x7767('0x9a')](_0x3d0fa5);}};AGIVertices['prototype'][_0x7767('0x9a')]=function(_0x5ec1f1){var _0x5e2e4f=_0x5ec1f1['split']('{');for(var _0x390211=0x1;_0x390211<_0x5e2e4f[_0x7767('0x9e')];_0x390211+=0x1){var _0x481a51=_0x5e2e4f[_0x390211][_0x7767('0xa2')]('}');if(_0x481a51[_0x7767('0x9e')]>0x1){_0x5ec1f1=_0x5ec1f1['replaceAll']('{'+_0x481a51[0x0]+'}',this[_0x7767('0x36')][_0x7767('0x12')](_0x481a51[0x0])[_0x7767('0xa3')]||_0x481a51[0x0]);}}if(_0x5e2e4f[_0x7767('0x9e')]===0x1){return _0x5ec1f1[_0x7767('0x4e')]();}return this[_0x7767('0x9a')](_0x5ec1f1);};AGIVertices[_0x7767('0x11')][_0x7767('0xa4')]=function(_0x40babd,_0xb7eda7){var _0x3d4ed2=this['channel'][_0x7767('0x12')](_0x40babd);if(_0x3d4ed2['result']===-0x1){return _0x3d4ed2;}logger[_0x7767('0x2c')](util['format'](_0x7767('0xa5'),_0xb7eda7,_0x3d4ed2[_0x7767('0xa3')]));return this[_0x7767('0x36')][_0x7767('0xa1')](_0xb7eda7,_0x3d4ed2['extra']);};AGIVertices[_0x7767('0x11')][_0x7767('0x87')]=function(_0x1c43b8){return _0x1c43b8&&_0x1c43b8!=='0'&&_0x1c43b8!=='-1'&&_0x1c43b8!=='';};AGIVertices[_0x7767('0x11')]['maxRetry']=function(_0x4a8329){this[_0x7767('0x35')][_0x7767('0x71')](this,_0x4a8329,'-');_0x4a8329[_0x7767('0xa6')]=_0x4a8329[_0x7767('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7767('0x11')][_0x7767('0xa8')]=function(_0x465410){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0xa9'),_0x465410['label']));if(!this[_0x7767('0x87')](_0x465410[_0x7767('0x5f')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xab'));}var _0x1ee720='\x22'+_0x465410[_0x7767('0x5f')]+'\x22';if(this[_0x7767('0x87')](_0x465410[_0x7767('0x7a')])){_0x1ee720+=','+_0x465410['options'];}var _0x311aeb=this[_0x7767('0x36')]['exec'](_0x7767('0xac'),_0x1ee720);if(_0x311aeb[_0x7767('0xad')]===-0x1){return _0x311aeb;}return this[_0x7767('0x36')][_0x7767('0xaa')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x1ee720));};AGIVertices['prototype'][_0x7767('0xae')]=function(_0x29235f){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x29235f['label']));if(!this[_0x7767('0x87')](_0x29235f[_0x7767('0xaf')])){return this['channel'][_0x7767('0xaa')](_0x7767('0xb0'));}var _0x3a9bc8=_0x29235f[_0x7767('0xaf')];if(this[_0x7767('0x87')](_0x29235f['options'])){_0x3a9bc8+=','+_0x29235f[_0x7767('0x7a')];}var _0x39a418=this[_0x7767('0x36')][_0x7767('0x5a')](_0x7767('0xb1'),_0x3a9bc8);if(_0x39a418['result']===-0x1){return _0x39a418;}var _0x3929f1=this[_0x7767('0xa4')](_0x7767('0xb2'),_0x7767('0xb3'));if(_0x3929f1[_0x7767('0xad')]===-0x1){return _0x3929f1;}var _0x3c489a=this[_0x7767('0xa4')](_0x7767('0xb4'),_0x7767('0xb5'));if(_0x3c489a[_0x7767('0xad')]===-0x1){return _0x3c489a;}var _0x1be11d=this[_0x7767('0xa4')](_0x7767('0xb6'),_0x7767('0xb7'));if(_0x1be11d[_0x7767('0xad')]===-0x1){return _0x1be11d;}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xb8'),_0x3a9bc8));};AGIVertices['prototype']['agi']=function(_0x56f82c){logger[_0x7767('0x2c')](util['format'](_0x7767('0xb9'),_0x56f82c[_0x7767('0x38')]));return this[_0x7767('0x36')][_0x7767('0x8')]([_0x56f82c[_0x7767('0xba')],_0x56f82c[_0x7767('0xbb')]]);};AGIVertices['prototype'][_0x7767('0xbc')]=function(_0x58e196){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x58e196['label']));if(this['isConfigured'](_0x58e196[_0x7767('0x67')])){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x58e196[_0x7767('0x67')]));var _0x2c1f19=this[_0x7767('0x36')][_0x7767('0xbd')](_0x58e196[_0x7767('0x67')]);if(_0x2c1f19[_0x7767('0xad')]===-0x1){return _0x2c1f19;}}return this[_0x7767('0x36')][_0x7767('0xbc')]();};AGIVertices['prototype'][_0x7767('0x4c')]=function(_0x5dc799){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0xbe'),_0x5dc799['label']));if(!this['isConfigured'](_0x5dc799[_0x7767('0xbf')])){return this['channel'][_0x7767('0x2b')](_0x5dc799,'no\x20list\x20selected');}_0x5dc799[_0x7767('0x4b')]=moment();if(this[_0x7767('0x87')](_0x5dc799[_0x7767('0xc0')])){_0x5dc799[_0x7767('0x4b')]=moment()['add'](_0x5dc799[_0x7767('0xc0')],_0x7767('0xc1'));}if(!this[_0x7767('0x87')](_0x5dc799[_0x7767('0x4f')])){_0x5dc799[_0x7767('0x4f')]=0x2;}this[_0x7767('0x45')][_0x7767('0x71')](this,_0x5dc799);return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xc2'),_0x5dc799['phone'],_0x5dc799[_0x7767('0xbf')],_0x5dc799[_0x7767('0x4b')]));};AGIVertices[_0x7767('0x11')][_0x7767('0xc3')]=function(_0x4e0bcd){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4e0bcd[_0x7767('0x38')]));var _0x17296a=this[_0x7767('0x36')][_0x7767('0x5a')](_0x4e0bcd[_0x7767('0xc4')],_0x4e0bcd[_0x7767('0x7a')]);if(_0x17296a[_0x7767('0xad')]===-0x1){return _0x17296a;}return this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xc5'),_0x4e0bcd['application'],_0x4e0bcd['options']));};AGIVertices[_0x7767('0x11')][_0x7767('0xc6')]=function(_0x55d452){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x55d452[_0x7767('0x38')]));if(!this['isConfigured'](_0x55d452['text'])){return this['channel'][_0x7767('0xaa')](_0x7767('0xab'));}var _0x4c4e40='\x22'+_0x55d452[_0x7767('0x5f')]+'\x22';if(this[_0x7767('0x87')](_0x55d452[_0x7767('0x7a')])){_0x4c4e40+=','+_0x55d452[_0x7767('0x7a')];}var _0x2f66eb=this[_0x7767('0x36')][_0x7767('0x5a')](_0x7767('0xac'),_0x4c4e40);if(_0x2f66eb[_0x7767('0xad')]===-0x1){return _0x2f66eb;}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xc7'),_0x4c4e40));};AGIVertices[_0x7767('0x11')][_0x7767('0xc8')]=function(_0x23a297){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x23a297[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x23a297[_0x7767('0x5f')])){return this['channel']['noop'](_0x7767('0xab'));}var _0x163418='\x22'+_0x23a297[_0x7767('0x5f')]+'\x22';if(this[_0x7767('0x87')](_0x23a297[_0x7767('0x7a')])){_0x163418+=','+_0x23a297[_0x7767('0x7a')];}var _0x51a9d2=this[_0x7767('0x36')][_0x7767('0x5a')](_0x7767('0xac'),_0x163418);if(_0x51a9d2[_0x7767('0xad')]===-0x1){return _0x51a9d2;}return this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0xc7'),_0x163418));};AGIVertices['prototype']['lumenvoxasr']=function(_0x326678){logger[_0x7767('0x2c')](util['format'](_0x7767('0xc9'),_0x326678[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x326678[_0x7767('0xaf')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20grammar\x20configured');}var _0x885009=_0x326678[_0x7767('0xaf')];if(this[_0x7767('0x87')](_0x326678['options'])){_0x885009+=','+_0x326678[_0x7767('0x7a')];}var _0x321ea8=this['channel'][_0x7767('0x5a')](_0x7767('0xb1'),_0x885009);if(_0x321ea8[_0x7767('0xad')]===-0x1){return _0x321ea8;}var _0x50454a=this[_0x7767('0xa4')]('RECOG_CONFIDENCE()',_0x7767('0xca'));if(_0x50454a[_0x7767('0xad')]===-0x1){return _0x50454a;}var _0x2c5994=this[_0x7767('0xa4')](_0x7767('0xb4'),_0x7767('0xcb'));if(_0x2c5994[_0x7767('0xad')]===-0x1){return _0x2c5994;}var _0x3a2e8a=this[_0x7767('0xa4')](_0x7767('0xb6'),_0x7767('0xcc'));if(_0x3a2e8a['result']===-0x1){return _0x3a2e8a;}return this[_0x7767('0x36')][_0x7767('0xaa')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x885009));};AGIVertices[_0x7767('0x11')][_0x7767('0xcd')]=function(_0x5635bd){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0xce'),_0x5635bd[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x5635bd[_0x7767('0xaf')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xb0'));}var _0x56c6cd=_0x5635bd[_0x7767('0xaf')];if(this[_0x7767('0x87')](_0x5635bd[_0x7767('0x7a')])){_0x56c6cd+=','+_0x5635bd['options'];}var _0x4c9e20=this['channel']['exec']('MRCPRecog',_0x56c6cd);if(_0x4c9e20[_0x7767('0xad')]===-0x1){return _0x4c9e20;}var _0xbf5a5f=this[_0x7767('0xa4')]('RECOG_CONFIDENCE()',_0x7767('0xcf'));if(_0xbf5a5f[_0x7767('0xad')]===-0x1){return _0xbf5a5f;}var _0x3c1962=this[_0x7767('0xa4')](_0x7767('0xb4'),_0x7767('0xd0'));if(_0x3c1962['result']===-0x1){return _0x3c1962;}var _0x1b18db=this['getAndSetVariable']('RECOG_INSTANCE()',_0x7767('0xd1'));if(_0x1b18db[_0x7767('0xad')]===-0x1){return _0x1b18db;}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xb8'),_0x56c6cd));};AGIVertices['prototype'][_0x7767('0xd2')]=function(_0x36df0f){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0xd3'),_0x36df0f[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x36df0f[_0x7767('0xd4')])){return this['channel'][_0x7767('0x2b')](_0x36df0f,_0x7767('0xd5'));}var _0x3c67c1=this[_0x7767('0x1a')][_0x7767('0x71')](this,_0x36df0f['odbc_id']);if(!_0x3c67c1){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x36df0f,'no\x20odbc\x20database\x20found');}if(!this[_0x7767('0x87')](_0x36df0f[_0x7767('0x2e')])){return this[_0x7767('0x36')]['error'](_0x36df0f,'no\x20query\x20configured');}var _0x7652c4=_0x36df0f[_0x7767('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x7767('0xd6'),_0x7652c4));var _0x4039ab=this[_0x7767('0xd7')][_0x7767('0x71')](this,_0x3c67c1,_0x7652c4);this[_0x7767('0x35')]['sync'](this,_0x36df0f,_0x7652c4);if(!this['isConfigured'](_0x36df0f[_0x7767('0xd8')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xd9'));}var _0x51bfc2=this[_0x7767('0x12')]['sync'](this,_0x36df0f[_0x7767('0xd8')]);if(!_0x51bfc2){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x36df0f,_0x7767('0xda'));}var _0x4dc6a1=this;_0x4039ab[_0x7767('0xdb')](function(_0x528b7d,_0x18cc9a){Object[_0x7767('0xdc')](_0x528b7d)['forEach'](function(_0x18b0c8){_0x4dc6a1[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0xdd'),_0x51bfc2,_0x18cc9a,_0x18b0c8),_0x528b7d[_0x18b0c8]);});});this[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0xde'),_0x51bfc2),_0x4039ab[_0x7767('0x9e')]);return this[_0x7767('0x36')]['noop'](util['format'](_0x7767('0xdf'),_0x51bfc2));};AGIVertices[_0x7767('0x11')]['dial']=function(_0x5856a5){logger[_0x7767('0xe0')](util['format'](_0x7767('0xe1'),_0x5856a5['label']));if(!this[_0x7767('0x87')](_0x5856a5[_0x7767('0xe2')])){return this['channel'][_0x7767('0x2b')](_0x5856a5,_0x7767('0xe3'));}var _0x2b21d1=this[_0x7767('0x1d')]['sync'](this,_0x5856a5[_0x7767('0xe2')]);if(!_0x2b21d1){return this[_0x7767('0x36')]['error'](_0x5856a5,_0x7767('0xe4'));}var _0xbac3d=this[_0x7767('0x36')]['exec']('DIAL',[util[_0x7767('0x56')]('SIP/%s',_0x2b21d1),_0x5856a5[_0x7767('0x67')],_0x5856a5[_0x7767('0xe5')],_0x5856a5[_0x7767('0x74')]]);if(_0xbac3d[_0x7767('0xad')]===-0x1){return _0xbac3d;}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xe6'),_0x7767('0xe7')));};AGIVertices[_0x7767('0x11')]['dialogflow']=function(_0x460d4a){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x460d4a[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x460d4a[_0x7767('0x7c')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xe8'));}if(!this['isConfigured'](_0x460d4a['text'])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xab'));}this[_0x7767('0x36')][_0x7767('0xe9')]=!![];this[_0x7767('0x35')](_0x460d4a);this[_0x7767('0x44')](_0x460d4a[_0x7767('0x5f')],'in','','');this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xea'),_0x460d4a[_0x7767('0x5f')]));var _0x109326=this[_0x7767('0x7b')][_0x7767('0x71')](this,_0x460d4a);if(_0x109326){for(var _0x54aac2 in _0x109326){if(_0x109326[_0x7767('0x97')](_0x54aac2)){this[_0x7767('0x36')][_0x7767('0xa1')](util['format'](_0x7767('0xeb'),_0x54aac2[_0x7767('0x69')]()),_0x109326[_0x54aac2]);}}this[_0x7767('0x44')](_0x109326[_0x7767('0xec')],'out','dialogflow','');return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xed'),_0x109326[_0x7767('0xec')]));}return this['channel'][_0x7767('0x2b')](_0x460d4a,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x7767('0x11')][_0x7767('0xee')]=function(_0x12c5a6){logger['info'](util['format'](_0x7767('0xef'),_0x12c5a6[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x12c5a6[_0x7767('0x7f')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xf0'));}if(!this[_0x7767('0x87')](_0x12c5a6[_0x7767('0x80')])){return this['channel'][_0x7767('0xaa')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x12c5a6[_0x7767('0xf1')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xf2'));}if(!this[_0x7767('0x87')](_0x12c5a6[_0x7767('0xf3')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20anguage\x20configured');}if(!this[_0x7767('0x87')](_0x12c5a6[_0x7767('0x5f')])){return this['channel'][_0x7767('0xaa')](_0x7767('0xab'));}this['channel'][_0x7767('0xe9')]=!![];this['createSquareDetailsReport'](_0x12c5a6);this['createSquareMessage'](_0x12c5a6[_0x7767('0x5f')],'in','','');this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xf4'),_0x12c5a6['text']));var _0x33102e=this[_0x7767('0x7e')][_0x7767('0x71')](this,_0x12c5a6);if(_0x33102e){for(var _0xca1363 in _0x33102e){if(_0x33102e[_0x7767('0x97')](_0xca1363)){if(_0xca1363!==_0x7767('0xf5')){this[_0x7767('0x36')][_0x7767('0xa1')](util['format']('DIALOGFLOW_%s',_0xca1363[_0x7767('0x69')]()),_0x33102e[_0xca1363]);}}}this[_0x7767('0x44')](_0x33102e[_0x7767('0xec')],_0x7767('0xf6'),_0x7767('0xee'),_0x33102e[_0x7767('0xf5')]);return this[_0x7767('0x36')][_0x7767('0xaa')](util['format'](_0x7767('0xf7'),_0x33102e[_0x7767('0xec')]));}return this[_0x7767('0x36')][_0x7767('0x2b')](_0x12c5a6,_0x7767('0xf8'));};AGIVertices[_0x7767('0x11')][_0x7767('0xf9')]=function(_0x33d8ec){logger['info'](util[_0x7767('0x56')](_0x7767('0xfa'),_0x33d8ec[_0x7767('0x38')]));if(!this['isConfigured'](_0x33d8ec[_0x7767('0xfb')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xfc'));}if(!this[_0x7767('0x87')](_0x33d8ec[_0x7767('0xfd')])){return this[_0x7767('0x36')]['noop']('no\x20username\x20configured');}if(!this[_0x7767('0x87')](_0x33d8ec['password'])){return this[_0x7767('0x36')]['noop'](_0x7767('0xfe'));}if(!this[_0x7767('0x87')](_0x33d8ec[_0x7767('0xff')])){return this[_0x7767('0x36')]['noop'](_0x7767('0xab'));}this[_0x7767('0x36')][_0x7767('0xe9')]=!![];this[_0x7767('0x35')](_0x33d8ec);this[_0x7767('0x44')](_0x33d8ec[_0x7767('0x5f')],'in','','');this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x100'),_0x33d8ec['text']));var _0x276d8b=this['sestekNDA']['sync'](this,_0x33d8ec);if(_0x276d8b){for(var _0x30f0ae in _0x276d8b){if(_0x276d8b[_0x7767('0x97')](_0x30f0ae)){this[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x101'),_0x30f0ae['toUpperCase']()),_0x276d8b[_0x30f0ae]);}}this[_0x7767('0x44')](_0x276d8b[_0x7767('0xec')],'out',_0x7767('0xf9'),'');if(_0x276d8b[_0x7767('0x102')]){this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0x103'),_0x276d8b[_0x7767('0x102')]));var _0x13e9af=this['channel'][_0x7767('0x104')](_0x276d8b['audiofile']);try{fs[_0x7767('0x105')](_0x276d8b[_0x7767('0x102')]+_0x7767('0x106'));}catch(_0xaa5cbf){logger[_0x7767('0x2b')](_0xaa5cbf);}return _0x13e9af;}else{return this['channel']['noop'](util[_0x7767('0x56')]('SestekNDA\x20Result\x20%s',_0x276d8b[_0x7767('0xec')]));}}return this[_0x7767('0x36')][_0x7767('0x2b')](_0x33d8ec,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x7767('0x107')]=function(_0xf7ef51){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20END\x20(%s)\x20block',_0xf7ef51[_0x7767('0x38')]));return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x107'));};AGIVertices[_0x7767('0x11')]['ext_dial']=function(_0x40bbea){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x40bbea['label']));var _0x287860='';if(_0x40bbea[_0x7767('0x108')]){if(!this[_0x7767('0x87')](_0x40bbea[_0x7767('0x108')])){return this['channel'][_0x7767('0x2b')](_0x40bbea,_0x7767('0x109'));}else{var _0x24aaac=parseInt(_0x40bbea[_0x7767('0x108')],0xa);if(isNaN(_0x24aaac)){_0x287860=_0x40bbea['trunk_id'];}else{_0x287860=this['getTrunk'][_0x7767('0x71')](this,_0x40bbea[_0x7767('0x108')]);if(!_0x287860){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x40bbea,_0x7767('0x10a'));}}}}else if(_0x40bbea[_0x7767('0x10b')]){_0x287860=_0x40bbea[_0x7767('0x10b')];}else{return this[_0x7767('0x36')][_0x7767('0x2b')](_0x40bbea,_0x7767('0x109'));}var _0x41e62c=this['channel'][_0x7767('0x5a')](_0x7767('0xe7'),[util[_0x7767('0x56')](_0x7767('0x10c'),_0x287860,_0x40bbea[_0x7767('0x10d')]),_0x40bbea['timeout'],_0x40bbea[_0x7767('0xe5')],_0x40bbea[_0x7767('0x74')]]);if(_0x41e62c[_0x7767('0xad')]===-0x1){return _0x41e62c;}return this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xe6'),'DIAL'));};AGIVertices[_0x7767('0x11')]['finally']=function(_0x4d1db1){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x10e'),_0x4d1db1[_0x7767('0x38')]));return this['channel'][_0x7767('0xaa')]('finally');};AGIVertices[_0x7767('0x11')][_0x7767('0x10f')]=function(_0x426ce6){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x426ce6['label']));if(_0x426ce6[_0x7767('0xa6')]===0x0){return this['maxRetry'](_0x426ce6);}_0x426ce6['retry']-=0x1;if(!this[_0x7767('0x87')](_0x426ce6[_0x7767('0x110')])){return this[_0x7767('0x36')]['error'](_0x426ce6,_0x7767('0x111'));}var _0x50f954=this['getSound'][_0x7767('0x71')](this,_0x426ce6[_0x7767('0x110')]);if(!_0x50f954){return this['channel']['error'](_0x426ce6,'no\x20file\x20audio\x20found');}if(!this[_0x7767('0x87')](_0x426ce6[_0x7767('0xd8')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x7767('0xd9'));}var _0x163d8e=this['channel']['getData'](_0x50f954,_0x426ce6[_0x7767('0x112')],_0x426ce6['maxdigit']);var _0x5a8dd6=_0x163d8e[_0x7767('0xad')]?_0x163d8e['result'][_0x7767('0x4e')]():'';logger['info'](_0x7767('0x113'),JSON[_0x7767('0x75')](_0x163d8e));if(_0x163d8e['result']===-0x1){this['createSquareDetailsReport'][_0x7767('0x71')](this,_0x426ce6,_0x5a8dd6);return _0x163d8e;}else if(_0x163d8e[_0x7767('0xa3')]===_0x7767('0x67')){_0x163d8e[_0x7767('0xad')]=_0x5a8dd6['length']>=parseInt(_0x426ce6[_0x7767('0x114')])?'x':'i';}else{_0x163d8e[_0x7767('0xad')]=_0x5a8dd6[_0x7767('0x9e')]>=parseInt(_0x426ce6[_0x7767('0x114')])&&_0x5a8dd6[_0x7767('0x9e')]<=parseInt(_0x426ce6[_0x7767('0x115')])?'x':'i';}var _0x4c7ce1=this[_0x7767('0x12')][_0x7767('0x71')](this,_0x426ce6['variable_id']);if(!_0x4c7ce1){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x426ce6,_0x7767('0xda'));}this['channel'][_0x7767('0xa1')](_0x4c7ce1,_0x5a8dd6);if(this['isConfigured'](_0x426ce6[_0x7767('0x116')])){var _0x58d8fb=parseInt(_0x426ce6[_0x7767('0x116')],0xa);var _0x35ff4d=rs['generate']({'charset':'*','length':_0x58d8fb});var _0x5913fa=_0x5a8dd6[_0x7767('0x9e')];if(_0x5913fa>0x0){if(_0x5913fa>_0x58d8fb){this[_0x7767('0x35')][_0x7767('0x71')](this,_0x426ce6,_0x426ce6[_0x7767('0x117')]===_0x7767('0x118')?_0x35ff4d+_0x5a8dd6['substr'](_0x58d8fb):_0x5a8dd6[_0x7767('0x119')](0x0,_0x5913fa-_0x58d8fb)+_0x35ff4d);}else{this[_0x7767('0x35')][_0x7767('0x71')](this,_0x426ce6,rs[_0x7767('0x11a')]({'charset':'*','length':_0x5913fa}));}}else{this[_0x7767('0x35')][_0x7767('0x71')](this,_0x426ce6,'');}}else{this[_0x7767('0x35')][_0x7767('0x71')](this,_0x426ce6,_0x5a8dd6);}return _0x163d8e;};AGIVertices[_0x7767('0x11')][_0x7767('0xe')]=function(_0x1e8312){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x11b'),_0x1e8312[_0x7767('0x38')]));return this[_0x7767('0x10f')](_0x1e8312);};AGIVertices['prototype'][_0x7767('0x11c')]=function(_0x4e0b23){logger[_0x7767('0x2c')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4e0b23[_0x7767('0x38')]));this[_0x7767('0x35')]['sync'](this,_0x4e0b23,_0x4e0b23[_0x7767('0x11d')]);return this[_0x7767('0x36')][_0x7767('0xaa')](util['format'](_0x7767('0x11e'),_0x4e0b23['goalname']));};AGIVertices[_0x7767('0x11')]['awspolly']=function(_0xca2bf9){logger['info'](util['format'](_0x7767('0x11f'),_0xca2bf9['label']));if(!this[_0x7767('0x87')](_0xca2bf9[_0x7767('0x8a')])||!this[_0x7767('0x87')](_0xca2bf9[_0x7767('0x8b')])){return this[_0x7767('0x36')]['noop'](_0x7767('0x120'));}if(!this[_0x7767('0x87')](_0xca2bf9[_0x7767('0x5f')])){return this[_0x7767('0x36')]['noop'](_0x7767('0xab'));}this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x121'),_0xca2bf9[_0x7767('0x5f')]));var _0x104d68=this[_0x7767('0x89')][_0x7767('0x71')](this,_0xca2bf9);if(_0x104d68){this['channel']['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x104d68));var _0x3ea44b=this[_0x7767('0x36')][_0x7767('0x104')](_0x104d68);try{fs[_0x7767('0x105')](_0x104d68+'.wav');}catch(_0x553225){logger[_0x7767('0x2b')](_0x553225);}return _0x3ea44b;}return this[_0x7767('0x36')][_0x7767('0x2b')](_0xca2bf9,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x7767('0x11')][_0x7767('0x122')]=function(_0x5888eb){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x123'),_0x5888eb[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x5888eb['aws_access_key_id'])||!this[_0x7767('0x87')](_0x5888eb['aws_secret_access_key'])){return this['channel'][_0x7767('0xaa')](_0x7767('0x120'));}if(!this[_0x7767('0x87')](_0x5888eb['aws_bot_name'])){return this['channel'][_0x7767('0xaa')](_0x7767('0x124'));}if(!this[_0x7767('0x87')](_0x5888eb['text'])){return this[_0x7767('0x36')]['noop'](_0x7767('0xab'));}this['channel'][_0x7767('0xe9')]=!![];this[_0x7767('0x35')](_0x5888eb);this[_0x7767('0x44')](_0x5888eb[_0x7767('0x5f')],'in','','');this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5888eb['text']));var _0x5ac6d1=this['awsLex'][_0x7767('0x71')](this,_0x5888eb);if(_0x5ac6d1){for(var _0x5e0728 in _0x5ac6d1){if(_0x5ac6d1['hasOwnProperty'](_0x5e0728)&&_[_0x7767('0x98')](_0x5ac6d1[_0x5e0728])){this[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x125'),_0x5e0728[_0x7767('0x69')]()),_0x5ac6d1[_0x5e0728]);}}if(_['isNil'](_0x5ac6d1[_0x7767('0x78')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x126'));}else{this[_0x7767('0x44')](_0x5ac6d1[_0x7767('0x78')],_0x7767('0xf6'),_0x7767('0x127'),'');return this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')]('Amazon\x20Lex\x20Result\x20%s',_0x5ac6d1[_0x7767('0x78')]));}}return this['channel'][_0x7767('0x2b')](_0x5888eb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x7767('0x11')][_0x7767('0x128')]=function(_0x48afe8){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x129'),_0x48afe8['label'],_0x48afe8[_0x7767('0x67')]));if(!this[_0x7767('0x87')](_0x48afe8['key'])){return this['channel'][_0x7767('0xaa')](_0x7767('0xe8'));}var _0x2bbef8=_0x7767('0x12a');var _0x5cfcdd=util[_0x7767('0x56')](_0x7767('0x12b'),FILES_PATH,rs[_0x7767('0x11a')](0x4));var _0x324a6a=util[_0x7767('0x56')](_0x7767('0x9f'),_0x5cfcdd,_0x2bbef8);var _0x1ac148=!![];if(_0x48afe8['beep']===_0x7767('0x12c')){_0x1ac148=![];}var _0x546214=this[_0x7767('0x36')][_0x7767('0x12d')](_0x5cfcdd,_0x2bbef8,_0x48afe8[_0x7767('0x12e')],_0x48afe8['timeout'],undefined,_0x1ac148);if(_0x546214['result']!==-0x1){this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x12f'),_0x324a6a));var _0x2f6b43=this[_0x7767('0x90')]['sync'](this,_0x48afe8,_0x324a6a);if(_0x2f6b43){for(var _0x170bf6 in _0x2f6b43){if(_0x2f6b43[_0x7767('0x97')](_0x170bf6)){this[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x130'),_0x170bf6[_0x7767('0x69')]()),_0x2f6b43[_0x170bf6]);}}return this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0x131'),JSON[_0x7767('0x75')](_0x2f6b43)));}}return _0x546214;};AGIVertices[_0x7767('0x11')]['tildeasr']=function(_0x31ca2d){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x31ca2d[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x31ca2d[_0x7767('0x93')])){return this[_0x7767('0x36')]['noop']('no\x20appid\x20configured');}if(!this[_0x7767('0x87')](_0x31ca2d['appsecret'])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x132'));}var _0x4c5c7=_0x7767('0x12a');var _0x1f8e14=util[_0x7767('0x56')](_0x7767('0x12b'),FILES_PATH,rs[_0x7767('0x11a')](0x4));var _0x5b7f8b=util['format'](_0x7767('0x9f'),_0x1f8e14,_0x4c5c7);var _0x81a1d6=!![];if(_0x31ca2d[_0x7767('0x133')]===_0x7767('0x12c')){_0x81a1d6=![];}var _0x30b136=this['channel'][_0x7767('0x12d')](_0x1f8e14,_0x4c5c7,_0x31ca2d[_0x7767('0x12e')],_0x31ca2d['timeout'],undefined,_0x81a1d6);if(_0x30b136[_0x7767('0xad')]!==-0x1){this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x134'),_0x5b7f8b));var _0x44271c=this[_0x7767('0x92')][_0x7767('0x71')](this,_0x31ca2d,_0x5b7f8b);if(_0x44271c){for(var _0x56c520 in _0x44271c){if(_0x44271c[_0x7767('0x97')](_0x56c520)){this[_0x7767('0x36')][_0x7767('0xa1')](util['format']('TILDE_ASR_%s',_0x56c520[_0x7767('0x69')]()),_0x44271c[_0x56c520]);}}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x44271c)));}}return _0x30b136;};AGIVertices[_0x7767('0x11')]['gotoc']=function(_0x587fd4){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x135'),_0x587fd4[_0x7767('0x38')]));return this[_0x7767('0x36')]['continueAt'](_0x587fd4[_0x7767('0x3e')],_0x587fd4[_0x7767('0x3f')],_0x587fd4[_0x7767('0x40')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x136')]=function(_0x431a73){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x137'),_0x431a73[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x431a73[_0x7767('0x138')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x431a73,'no\x20condition\x20configured');}try{var _0x32572b=eval(_0x431a73[_0x7767('0x138')])?'true':_0x7767('0x139');this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x13a'),_0x431a73[_0x7767('0x138')],_0x32572b));return{'code':0xc8,'result':_0x32572b};}catch(_0x663062){return{'code':0xc8,'result':_0x7767('0x139')};}};AGIVertices[_0x7767('0x11')]['gotoiftime']=function(_0x15d058){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x15d058[_0x7767('0x38')]));if(!this['isConfigured'](_0x15d058[_0x7767('0x13b')])){return this[_0x7767('0x36')]['error'](_0x15d058,_0x7767('0x13c'));}var _0x50595b=this[_0x7767('0x25')][_0x7767('0x71')](this,_0x15d058[_0x7767('0x13b')]);if(!_0x50595b){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x15d058,_0x7767('0x13d'));}for(var _0x3e341e=0x0;_0x3e341e<_0x50595b[_0x7767('0x9e')];_0x3e341e+=0x1){var _0x279d6e=this[_0x7767('0x36')]['getVariable'](util[_0x7767('0x56')](_0x7767('0x13e'),_0x50595b[_0x3e341e]));if(_0x279d6e[_0x7767('0xad')]===-0x1){return _0x279d6e;}logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x13f'),_0x50595b[_0x3e341e],_0x279d6e[_0x7767('0xa3')]));if(_0x279d6e[_0x7767('0xa3')]===_0x7767('0x140')){logger[_0x7767('0x2c')](util['format'](_0x7767('0x13f'),_0x50595b[_0x3e341e],_0x7767('0x140')));this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x13f'),_0x50595b[_0x3e341e],_0x7767('0x140')));return{'code':0xc8,'result':_0x7767('0x140')};}else{logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x13f'),_0x50595b[_0x3e341e],'false'));this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x13f'),_0x50595b[_0x3e341e],_0x7767('0x139')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x7767('0x11')][_0x7767('0x141')]=function(_0x599913){logger['info'](util['format'](_0x7767('0x142'),_0x599913[_0x7767('0x38')]));return this[_0x7767('0x36')][_0x7767('0x141')]();};AGIVertices[_0x7767('0x11')][_0x7767('0x143')]=function(_0x2e43c5){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2e43c5[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x2e43c5[_0x7767('0x7c')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xe8'));}var _0x15bb12='wav';var _0x2b5af9=util[_0x7767('0x56')]('%s/recordings/%s',FILES_PATH,rs[_0x7767('0x11a')](0x4));var _0x437b52=util[_0x7767('0x56')](_0x7767('0x9f'),_0x2b5af9,_0x15bb12);var _0x10f4cc=!![];if(_0x2e43c5[_0x7767('0x133')]===_0x7767('0x12c')){_0x10f4cc=![];}var _0x162929=this[_0x7767('0x36')][_0x7767('0x12d')](_0x2b5af9,_0x15bb12,_0x2e43c5[_0x7767('0x12e')],_0x2e43c5['timeout'],undefined,_0x10f4cc);if(_0x162929[_0x7767('0xad')]!==-0x1){this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x144'),_0x437b52));var _0x5d53f7=this['ispeechASR']['sync'](this,_0x2e43c5,_0x437b52);if(_0x5d53f7){for(var _0x7f8103 in _0x5d53f7){if(_0x5d53f7[_0x7767('0x97')](_0x7f8103)){this[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x145'),_0x7f8103[_0x7767('0x69')]()),_0x5d53f7[_0x7f8103]);}}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x146'),JSON[_0x7767('0x75')](_0x5d53f7)));}}return _0x162929;};AGIVertices[_0x7767('0x11')]['ispeechtts']=function(_0x5ae7f1){logger[_0x7767('0x2c')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5ae7f1[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x5ae7f1[_0x7767('0x7c')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x5ae7f1['text'])){return this['channel'][_0x7767('0xaa')](_0x7767('0xab'));}this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')]('Trying\x20ispeech\x20TTS\x20%s',_0x5ae7f1[_0x7767('0x5f')]));var _0x38c68d=this['ispeechTTS'][_0x7767('0x71')](this,_0x5ae7f1);if(_0x38c68d){this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x144'),_0x38c68d));var _0x2c3f7c=this[_0x7767('0x36')][_0x7767('0x104')](_0x38c68d,_0x5ae7f1[_0x7767('0x12e')]);try{fs[_0x7767('0x105')](_0x38c68d+_0x7767('0x106'));}catch(_0x4273ef){logger[_0x7767('0x2b')](_0x4273ef);}return _0x2c3f7c;}return this[_0x7767('0x36')][_0x7767('0x2b')](_0x5ae7f1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x7767('0x11')][_0x7767('0x147')]=function(_0x1d8833){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x148'),_0x1d8833[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x1d8833[_0x7767('0x149')])){return this['channel'][_0x7767('0x2b')](_0x1d8833,'no\x20find\x20by\x20configured');}logger['info'](util[_0x7767('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7767('0x36')][_0x7767('0x3b')],_0x1d8833['findBy']));var _0x5ed2cf=this['agentLogin'][_0x7767('0x71')](this,_0x1d8833[_0x7767('0x149')]);if(_0x5ed2cf){logger[_0x7767('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7767('0x36')][_0x7767('0x3b')],_0x1d8833[_0x7767('0x149')]));this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x14a'),this['channel'][_0x7767('0x3b')],_0x1d8833['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x7767('0x2c')](util[_0x7767('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x7767('0x3b')],_0x1d8833[_0x7767('0x149')]));this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0x14b'),this[_0x7767('0x36')]['callerid'],_0x1d8833[_0x7767('0x149')]));return{'code':0xc8,'result':_0x7767('0x14c')};}};AGIVertices[_0x7767('0x11')][_0x7767('0x14d')]=function(_0xe1826){logger['info'](util[_0x7767('0x56')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0xe1826[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0xe1826[_0x7767('0x149')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0xe1826,_0x7767('0x14e'));}logger[_0x7767('0x2c')](util['format'](_0x7767('0x14f'),this[_0x7767('0x36')][_0x7767('0x3b')],_0xe1826[_0x7767('0x149')]));var _0x2d1f3d=this[_0x7767('0x53')][_0x7767('0x71')](this,_0xe1826[_0x7767('0x149')]);if(_0x2d1f3d){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7767('0x36')][_0x7767('0x3b')],_0xe1826[_0x7767('0x149')]));this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x14a'),this[_0x7767('0x36')][_0x7767('0x3b')],_0xe1826[_0x7767('0x149')]));return{'code':0xc8,'result':_0x7767('0x150')};}else{logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x14b'),this[_0x7767('0x36')]['callerid'],_0xe1826[_0x7767('0x149')]));this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0x14b'),this[_0x7767('0x36')]['callerid'],_0xe1826[_0x7767('0x149')]));return{'code':0xc8,'result':_0x7767('0x14c')};}};AGIVertices[_0x7767('0x11')][_0x7767('0x151')]=function(_0x538a22){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x152'),_0x538a22[_0x7767('0x38')]));if(!this['isConfigured'](_0x538a22[_0x7767('0x153')])){return this[_0x7767('0x36')]['error'](_0x538a22,'no\x20operation\x20configured');}this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x154'),_0x538a22[_0x7767('0x153')]));var _0x364304=eval(_0x538a22[_0x7767('0x153')]);if(!this[_0x7767('0x87')](_0x538a22[_0x7767('0xd8')])){return this['channel']['noop'](_0x7767('0xd9'));}var _0x141f2f=this[_0x7767('0x12')][_0x7767('0x71')](this,_0x538a22[_0x7767('0xd8')]);if(!_0x141f2f){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x538a22,_0x7767('0xda'));}if(_[_0x7767('0x9d')](_0x364304)){var _0x390a2c=this;_0x364304['forEach'](function(_0x4ff8e9,_0x325a27){_0x390a2c[_0x7767('0x36')][_0x7767('0xa1')](util[_0x7767('0x56')](_0x7767('0x155'),_0x141f2f,_0x325a27),_0x4ff8e9);});return this[_0x7767('0x36')][_0x7767('0xaa')](util['format'](_0x7767('0x156'),_0x141f2f));}else{return this[_0x7767('0x36')][_0x7767('0xa1')](_0x141f2f,_0x364304);}};AGIVertices['prototype'][_0x7767('0xd')]=function(_0x2104b1){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x157'),_0x2104b1[_0x7767('0x38')]));if(_0x2104b1[_0x7767('0xa6')]===0x0){return this[_0x7767('0xa7')](_0x2104b1);}_0x2104b1[_0x7767('0xa6')]-=0x1;if(!this[_0x7767('0x87')](_0x2104b1[_0x7767('0x110')])){return this['channel'][_0x7767('0x2b')](_0x2104b1,_0x7767('0x111'));}var _0x3cc787=this['getSound'][_0x7767('0x71')](this,_0x2104b1[_0x7767('0x110')]);if(!_0x3cc787){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x2104b1,_0x7767('0x158'));}var _0x201a8f=this[_0x7767('0x36')]['getData'](_0x3cc787,_0x2104b1[_0x7767('0x112')],_0x2104b1[_0x7767('0x159')]);var _0x50b737=_0x201a8f[_0x7767('0xad')];if(_0x201a8f[_0x7767('0xad')]===-0x1){this[_0x7767('0x35')]['sync'](this,_0x2104b1,'-1');return _0x201a8f;}else if(_0x201a8f[_0x7767('0xa3')]==='timeout'){_0x201a8f['result']=_0x201a8f['result']['length']>0x0?_0x201a8f[_0x7767('0xad')]:'t';}else if(_[_0x7767('0x46')](_0x201a8f[_0x7767('0xad')])){_0x201a8f['result']='#';_0x50b737='#';}if(!this[_0x7767('0x87')](_0x2104b1[_0x7767('0xd8')])){this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0xd9'));}else{var _0x15c621=this['getVariable']['sync'](this,_0x2104b1[_0x7767('0xd8')]);if(!_0x15c621){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x2104b1,_0x7767('0xda'));}this[_0x7767('0x36')][_0x7767('0xa1')](_0x15c621,_0x50b737);}this[_0x7767('0x35')][_0x7767('0x71')](this,_0x2104b1,_0x50b737);return _0x201a8f;};AGIVertices[_0x7767('0x11')][_0x7767('0xaa')]=function(_0xfd2f2){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x15a'),_0xfd2f2[_0x7767('0x38')]));return this[_0x7767('0x36')][_0x7767('0xaa')](_0xfd2f2[_0x7767('0x15b')]||_0xfd2f2[_0x7767('0x38')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x15c')]=function(_0x371c45){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x15d'),_0x371c45['label']));if(!this[_0x7767('0x87')](_0x371c45['findBy'])){return this['channel'][_0x7767('0x2b')](_0x371c45,_0x7767('0x14e'));}logger[_0x7767('0x2c')](util['format'](_0x7767('0x14f'),this[_0x7767('0x36')][_0x7767('0x3b')],_0x371c45[_0x7767('0x149')]));var _0x5809ba=this[_0x7767('0x15e')][_0x7767('0x71')](this,_0x371c45[_0x7767('0x15f')]);var _0x4891f6=this['agentPause']['sync'](this,_0x371c45['findBy'],_0x5809ba);if(_0x4891f6){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x14a'),this[_0x7767('0x36')][_0x7767('0x3b')],_0x371c45[_0x7767('0x149')]));this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x14a'),this[_0x7767('0x36')][_0x7767('0x3b')],_0x371c45['findBy']));return{'code':0xc8,'result':_0x7767('0x150')};}else{logger[_0x7767('0x2c')](util[_0x7767('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7767('0x36')][_0x7767('0x3b')],_0x371c45[_0x7767('0x149')]));this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x371c45[_0x7767('0x149')]));return{'code':0xc8,'result':_0x7767('0x14c')};}};AGIVertices[_0x7767('0x11')][_0x7767('0x160')]=function(_0x1a9f0f){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x161'),_0x1a9f0f[_0x7767('0x38')]));if(!this['isConfigured'](_0x1a9f0f[_0x7767('0x110')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x1a9f0f,_0x7767('0x111'));}var _0x39f137=this[_0x7767('0x20')][_0x7767('0x71')](this,_0x1a9f0f[_0x7767('0x110')]);if(!_0x39f137){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x1a9f0f,_0x7767('0x158'));}var _0x3865ad=this[_0x7767('0x36')]['exec'](_0x7767('0x162'),[_0x39f137,_0x1a9f0f[_0x7767('0xe5')]]);if(_0x3865ad[_0x7767('0xad')]===-0x1){return _0x3865ad;}return this[_0x7767('0x36')][_0x7767('0xaa')](util['format'](_0x7767('0xc5'),'PLAYBACK',_0x39f137));};AGIVertices[_0x7767('0x11')]['queue']=function(_0x2259c3){logger[_0x7767('0x2c')](util['format'](_0x7767('0x163'),_0x2259c3['label']));if(!this[_0x7767('0x87')](_0x2259c3['queue_id'])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x2259c3,_0x7767('0x164'));}var _0xc76c6a='';var _0xf8befc=parseInt(_0x2259c3[_0x7767('0x165')],0xa);if(isNaN(_0xf8befc)){_0xc76c6a=_0x2259c3['queue_id'];}else{_0xc76c6a=this[_0x7767('0x166')]['sync'](this,_0x2259c3[_0x7767('0x165')]);if(!_0xc76c6a){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x2259c3,_0x7767('0x167'));}}var _0x4d4457='';if(this[_0x7767('0x87')](_0x2259c3['file_id'])){var _0x3de03c=this['getSound'][_0x7767('0x71')](this,_0x2259c3[_0x7767('0x110')]);if(_0x3de03c){_0x4d4457=_0x3de03c;}}this[_0x7767('0x35')][_0x7767('0x71')](this,_0x2259c3,_0xc76c6a);if(_0x2259c3[_0x7767('0xe5')][_0x7767('0x168')]('x')<0x0){_0x2259c3[_0x7767('0xe5')]+='x';}if(_0x2259c3[_0x7767('0xe5')][_0x7767('0x168')]('X')<0x0){_0x2259c3[_0x7767('0xe5')]+='X';}this[_0x7767('0x36')][_0x7767('0xa1')](_0x7767('0x169'),_0xc76c6a?_0xc76c6a[_0x7767('0x16a')]():'');var _0x34d099=this[_0x7767('0x36')]['exec'](_0x7767('0x16b'),[_0xc76c6a,_0x2259c3['opts'],_0x2259c3[_0x7767('0x74')],_0x4d4457,_0x2259c3[_0x7767('0x67')],_0x2259c3[_0x7767('0x8')],_0x2259c3[_0x7767('0x16c')],_0x2259c3[_0x7767('0x16d')],'',_0x2259c3[_0x7767('0x16e')]]);if(_0x34d099['result']===-0x1){return _0x34d099;}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xc5'),_0x7767('0x16b'),_0xc76c6a));};AGIVertices[_0x7767('0x11')][_0x7767('0x16f')]=function(_0x2c902b){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x170'),_0x2c902b[_0x7767('0x38')]));var _0x2a6da0=_0x2c902b['recordingFormat']||'wav';var _0x3623fb=util['format']('%s_%s',this[_0x7767('0x36')]['uniqueid'],rs[_0x7767('0x11a')](0x5));var _0x496da3=util[_0x7767('0x56')]('%s/recordings/%s.%s',FILES_PATH,_0x3623fb,_0x2a6da0);var _0x42bdc3=util[_0x7767('0x56')](_0x7767('0x12b'),FILES_PATH,_0x3623fb);this['createSquareRecording'][_0x7767('0x71')](this,_0x2c902b,_0x3623fb,_0x496da3);this[_0x7767('0x36')]['setVariable'](_0x7767('0x171'),_0x3623fb);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x42bdc3,_0x2a6da0,_0x2c902b['escape_digits'],_0x2c902b[_0x7767('0x67')]);return this[_0x7767('0x36')][_0x7767('0x12d')](_0x42bdc3,_0x2a6da0,_0x2c902b[_0x7767('0x172')],_0x2c902b[_0x7767('0x67')],undefined,!![]);};AGIVertices[_0x7767('0x11')][_0x7767('0x173')]=function(_0x5dfac3){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x174'),_0x5dfac3['label']));if(!this['isConfigured'](_0x5dfac3[_0x7767('0x74')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x175'));}var _0x2cb8f7=this[_0x7767('0x176')][_0x7767('0x71')](this,_0x5dfac3);logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x177'),util['inspect'](_0x2cb8f7,{'showHidden':![],'depth':null})));if(!this[_0x7767('0x87')](_0x5dfac3[_0x7767('0xd8')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x6f3e15=this[_0x7767('0x12')]['sync'](this,_0x5dfac3[_0x7767('0xd8')]);if(!_0x6f3e15){return this[_0x7767('0x36')]['error'](_0x5dfac3,_0x7767('0xda'));}this['channel'][_0x7767('0xa1')](util['format'](_0x7767('0x178'),_0x6f3e15),_0x2cb8f7['statusCode']?_0x2cb8f7[_0x7767('0x76')]:'200');this[_0x7767('0x36')][_0x7767('0xa1')](util['format'](_0x7767('0x179'),_0x6f3e15),_0x2cb8f7[_0x7767('0x77')]?_0x2cb8f7[_0x7767('0x77')]:'OK');if(_0x2cb8f7[_0x7767('0x6a')]){try{this[_0x7767('0xa0')](_0x2cb8f7[_0x7767('0x6a')],_0x6f3e15);}catch(_0x2d1369){logger[_0x7767('0x2b')](util[_0x7767('0x56')](_0x7767('0x17a'),_0x6f3e15));}}return this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0xdf'),_0x6f3e15));};AGIVertices[_0x7767('0x11')][_0x7767('0x17b')]=function(_0xdee164){logger[_0x7767('0x2c')](util['format'](_0x7767('0x17c'),_0xdee164[_0x7767('0x38')]));return this['channel']['sayDigits'](_0xdee164['digits'][_0x7767('0x5c')](/\s+/g,''),_0xdee164[_0x7767('0x172')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x17d')]=function(_0x24271a){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x17e'),_0x24271a['label']));return this[_0x7767('0x36')][_0x7767('0x17f')](_0x24271a[_0x7767('0x180')]['replace'](/\s+/g,''),_0x24271a[_0x7767('0x172')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x181')]=function(_0xdc9ef8){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0xdc9ef8[_0x7767('0x38')]));return this[_0x7767('0x36')][_0x7767('0x182')](_0xdc9ef8[_0x7767('0x5f')],_0xdc9ef8[_0x7767('0x172')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x183')]=function(_0x4e32e4){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x184'),_0x4e32e4['label']));if(!this[_0x7767('0x87')](_0x4e32e4[_0x7767('0x185')])){return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x186'));}var _0x255c29=this[_0x7767('0x23')][_0x7767('0x71')](this,_0x4e32e4[_0x7767('0x185')]);if(!_0x255c29||!_0x255c29['Smtp']){return this[_0x7767('0x36')]['error'](_0x4e32e4,_0x7767('0x187'));}var _0x331e0f={'from':util[_0x7767('0x56')](_0x7767('0x188'),_0x255c29[_0x7767('0x17')],_0x255c29['email']||_0x255c29['Smtp'][_0x7767('0x189')]),'to':_0x4e32e4['to']||'','cc':_0x4e32e4['cc']||'','bcc':_0x4e32e4[_0x7767('0x18a')]||'','subject':_0x4e32e4[_0x7767('0x18b')],'html':_0x4e32e4['text'],'text':_0x4e32e4[_0x7767('0x5f')]};var _0x117ecc={'tls':{'rejectUnauthorized':![]}};if(_0x255c29[_0x7767('0x18c')][_0x7767('0x18d')]){_0x117ecc['service']=_0x255c29[_0x7767('0x18c')]['service'];}else{_0x117ecc['host']=_0x255c29[_0x7767('0x18c')][_0x7767('0x18e')];_0x117ecc[_0x7767('0x18f')]=_0x255c29[_0x7767('0x18c')][_0x7767('0x18f')];_0x117ecc['secure']=_0x255c29[_0x7767('0x18c')]['secure'];}if(_0x255c29[_0x7767('0x18c')][_0x7767('0x190')]){_0x117ecc[_0x7767('0x191')]={'user':_0x255c29[_0x7767('0x18c')][_0x7767('0x189')],'pass':_0x255c29[_0x7767('0x18c')][_0x7767('0x192')]};}if(this[_0x7767('0x87')](_0x4e32e4[_0x7767('0x193')])){}logger[_0x7767('0xe0')](_0x7767('0x194'),JSON[_0x7767('0x75')](_0x331e0f));this['createSquareDetailsReport'][_0x7767('0x71')](this,_0x4e32e4,_0x4e32e4[_0x7767('0x185')]);this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x195'),_0x255c29[_0x7767('0x17')]));this[_0x7767('0x24')][_0x7767('0x71')](this,_0x117ecc,_0x331e0f);return this['channel']['noop'](_0x7767('0x196'));};AGIVertices['prototype'][_0x7767('0x197')]=function(_0x30389d){logger[_0x7767('0x2c')](util['format'](_0x7767('0x198'),_0x30389d[_0x7767('0x38')]));return this[_0x7767('0x36')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7767('0x11')][_0x7767('0x199')]=function(_0x138bb8){logger['info'](util[_0x7767('0x56')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x138bb8[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x138bb8[_0x7767('0x19a')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20sms\x20account\x20configured');}var _0x330914=this[_0x7767('0x19b')][_0x7767('0x71')](this,_0x138bb8[_0x7767('0x19a')]);if(!_0x330914){return this['channel'][_0x7767('0x2b')](_0x138bb8,_0x7767('0x19c'));}var _0x27a5ca={'body':_0x138bb8[_0x7767('0x19d')],'phone':_0x138bb8['to']||'','SmsAccountId':_0x330914['id']};logger[_0x7767('0xe0')](_0x7767('0x19e'),JSON[_0x7767('0x75')](_0x27a5ca));this['createSquareDetailsReport']['sync'](this,_0x138bb8,_0x138bb8[_0x7767('0x19a')]);this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x19f'),_0x330914['name']));this[_0x7767('0x34')]['sync'](this,_0x27a5ca);return this[_0x7767('0x36')]['noop'](_0x7767('0x1a0'));};AGIVertices[_0x7767('0x11')][_0x7767('0x1a1')]=function(_0x394e3f){logger[_0x7767('0x2c')](util[_0x7767('0x56')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x394e3f[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x394e3f[_0x7767('0xd8')])){return this['channel'][_0x7767('0x2b')](_0x394e3f,_0x7767('0x1a2'));}var _0x558c01=this[_0x7767('0x12')][_0x7767('0x71')](this,_0x394e3f[_0x7767('0xd8')]);if(!_0x558c01){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x394e3f,_0x7767('0xda'));}return this[_0x7767('0x36')][_0x7767('0xa1')](_0x558c01,_0x394e3f[_0x7767('0x1a3')]);};AGIVertices[_0x7767('0x11')][_0x7767('0x1a4')]=function(_0x201aee){logger['info'](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x201aee[_0x7767('0x38')]));this[_0x7767('0x36')]['noop'](_0x7767('0x1a5'));if(_0x201aee['answer']==='yes'){this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x1a6'));return this[_0x7767('0x36')]['answer']();}return this[_0x7767('0x36')][_0x7767('0xaa')](_0x7767('0x1a7'));};AGIVertices['prototype'][_0x7767('0x1a8')]=function(_0x29d438){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x1a9'),_0x29d438[_0x7767('0x38')]));if(!this[_0x7767('0x87')](_0x29d438[_0x7767('0x1aa')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x29d438,_0x7767('0x1ab'));}var _0x2625e2=this[_0x7767('0x18')][_0x7767('0x71')](this,_0x29d438[_0x7767('0x1aa')]);if(!this[_0x7767('0x87')](_0x2625e2)){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x29d438,util[_0x7767('0x56')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x29d438[_0x7767('0x1aa')]));}if(_0x2625e2===this[_0x7767('0x36')][_0x7767('0x3a')]){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x29d438,_0x7767('0x1ac'));}this[_0x7767('0x35')][_0x7767('0x71')](this,_0x29d438,_0x2625e2);var _0x47661d=this['channel'][_0x7767('0x5a')](_0x7767('0x1ad'),util[_0x7767('0x56')](_0x7767('0x1ae'),config[_0x7767('0x8')][_0x7767('0x18e')]||_0x7767('0x1af'),_0x2625e2,this['channel']['arg_1']));if(_0x47661d[_0x7767('0xad')]===-0x1){return _0x47661d;}return this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0xc5'),'AGI',_0x2625e2));};AGIVertices[_0x7767('0x11')][_0x7767('0x1b0')]=function(_0x5d0234){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x1b1'),_0x5d0234[_0x7767('0x38')]));var _0x1145ec=this[_0x7767('0x59')]['sync'](this,_0x5d0234['command']);this['createSquareDetailsReport'][_0x7767('0x71')](this,_0x5d0234,_0x5d0234[_0x7767('0xba')]);if(this[_0x7767('0x87')](_0x5d0234['variable_id'])){var _0x28d3d6=this[_0x7767('0x12')]['sync'](this,_0x5d0234['variable_id']);if(_0x28d3d6){this['channel'][_0x7767('0xa1')](_0x28d3d6,_0x1145ec);return this['channel']['noop'](util[_0x7767('0x56')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5d0234[_0x7767('0xba')],_0x28d3d6));}}return this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x1b2'),_0x5d0234[_0x7767('0xba')]));};AGIVertices[_0x7767('0x11')][_0x7767('0x1b3')]=function(_0x907ec5){logger['info'](util[_0x7767('0x56')](_0x7767('0x1b4'),_0x907ec5[_0x7767('0x38')]));_0x907ec5['text']=_0x907ec5['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x907ec5[_0x7767('0x1b5')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20apiKey\x20configured');}if(!this[_0x7767('0x87')](_0x907ec5['text'])){return this[_0x7767('0x36')]['noop']('no\x20text\x20configured');}this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x1b6'),_0x907ec5[_0x7767('0x5f')]));var _0x468bc9=this[_0x7767('0x5d')][_0x7767('0x71')](this,_0x907ec5);if(_0x468bc9){this['channel'][_0x7767('0xaa')](util['format'](_0x7767('0x1b7'),_0x468bc9));var _0x264f6c=this[_0x7767('0x36')]['streamFile'](_0x468bc9);try{fs[_0x7767('0x105')](_0x468bc9+_0x7767('0x106'));}catch(_0x163bc1){logger[_0x7767('0x2b')](_0x163bc1);}return _0x264f6c;}return this[_0x7767('0x36')][_0x7767('0x2b')](_0x907ec5,_0x7767('0x1b8'));};AGIVertices['prototype'][_0x7767('0x1b9')]=function(_0x5d515a){logger[_0x7767('0x2c')](util['format'](_0x7767('0x1ba'),_0x5d515a[_0x7767('0x38')]));_0x5d515a['text']=_0x5d515a[_0x7767('0x5f')][_0x7767('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5d515a[_0x7767('0x5f')])){return this[_0x7767('0x36')][_0x7767('0xaa')]('no\x20text\x20configured');}this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')]('Trying\x20Google\x20TTS\x20%s',_0x5d515a[_0x7767('0x5f')]));var _0x4f1813=this[_0x7767('0x64')][_0x7767('0x71')](this,_0x5d515a);if(_0x4f1813){this[_0x7767('0x36')][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x1bb'),_0x4f1813));var _0x3b5f24=this[_0x7767('0x36')][_0x7767('0x104')](_0x4f1813);try{fs['unlink'](_0x4f1813+_0x7767('0x106'));}catch(_0x2ab735){logger[_0x7767('0x2b')](_0x2ab735);}return _0x3b5f24;}return this[_0x7767('0x36')][_0x7767('0x2b')](_0x5d515a,_0x7767('0x1bc'));};AGIVertices[_0x7767('0x11')][_0x7767('0x1bd')]=function(_0x1302d3){logger[_0x7767('0x2c')](util['format'](_0x7767('0x1be'),_0x1302d3[_0x7767('0x38')]));if(!this['isConfigured'](_0x1302d3[_0x7767('0x149')])){return this['channel'][_0x7767('0x2b')](_0x1302d3,_0x7767('0x14e'));}logger['info'](util[_0x7767('0x56')](_0x7767('0x14f'),this['channel'][_0x7767('0x3b')],_0x1302d3[_0x7767('0x149')]));var _0x3ad501=this[_0x7767('0x52')][_0x7767('0x71')](this,_0x1302d3[_0x7767('0x149')]);if(_0x3ad501){logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x14a'),this[_0x7767('0x36')][_0x7767('0x3b')],_0x1302d3['findBy']));this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')](_0x7767('0x14a'),this[_0x7767('0x36')]['callerid'],_0x1302d3['findBy']));return{'code':0xc8,'result':_0x7767('0x150')};}else{logger[_0x7767('0x2c')](util[_0x7767('0x56')](_0x7767('0x14b'),this[_0x7767('0x36')]['callerid'],_0x1302d3['findBy']));this[_0x7767('0x36')]['noop'](util[_0x7767('0x56')](_0x7767('0x14b'),this[_0x7767('0x36')][_0x7767('0x3b')],_0x1302d3[_0x7767('0x149')]));return{'code':0xc8,'result':_0x7767('0x14c')};}};AGIVertices[_0x7767('0x11')]['voicemail']=function(_0x299dc5){logger[_0x7767('0x2c')](util['format'](_0x7767('0x1bf'),_0x299dc5['label']));var _0x1a916f=this[_0x7767('0x36')][_0x7767('0x5a')](_0x7767('0x1c0'),[_0x299dc5[_0x7767('0x1c1')],_0x299dc5[_0x7767('0x7a')]]);if(_0x1a916f[_0x7767('0xad')]===-0x1){return _0x1a916f;}return this['channel'][_0x7767('0xaa')](util[_0x7767('0x56')]('Executed\x20command\x20%s\x20%s',_0x7767('0x1c0'),_0x299dc5[_0x7767('0x1c1')]));};AGIVertices['prototype'][_0x7767('0x1c2')]=function(_0x248264){logger['info'](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x248264['label']));if(!this[_0x7767('0x87')](_0x248264[_0x7767('0xd8')])){return this[_0x7767('0x36')][_0x7767('0x2b')](_0x248264,_0x7767('0x1a2'));}var _0x2121b4=this['getVariable']['sync'](this,_0x248264[_0x7767('0xd8')]);if(!_0x2121b4){return this['channel'][_0x7767('0x2b')](_0x248264,_0x7767('0xda'));}var _0x4470c3=this[_0x7767('0x36')][_0x7767('0x12')](_0x2121b4);return{'code':0xc8,'result':_0x4470c3[_0x7767('0xa3')]?_0x4470c3[_0x7767('0xa3')]:'-'};};String[_0x7767('0x11')][_0x7767('0x1c3')]=function(_0x5e6dd5,_0x130578){return this['split'](_0x5e6dd5)[_0x7767('0x1c4')](_0x130578);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 63cef52..5849b8e 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 _0x15e1=['isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','channels','queue','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid'];(function(_0x5a8611,_0x348a8d){var _0x3ef5d8=function(_0x366618){while(--_0x366618){_0x5a8611['push'](_0x5a8611['shift']());}};_0x3ef5d8(++_0x348a8d);}(_0x15e1,0xc3));var _0x115e=function(_0x513980,_0xdb33f1){_0x513980=_0x513980-0x0;var _0x5cbcfe=_0x15e1[_0x513980];return _0x5cbcfe;};'use strict';var util=require(_0x115e('0x0'));var _=require(_0x115e('0x1'));var moment=require(_0x115e('0x2'));var ami=require(_0x115e('0x3'));var logger=require(_0x115e('0x4'))('acw');var RpcUser=require(_0x115e('0x5'));var RpcVoiceAgentReport=require(_0x115e('0x6'));function Acw(_0x2409e9){this[_0x115e('0x7')]=_0x2409e9['voiceQueues'];this['agents']=_0x2409e9[_0x115e('0x8')];this['timers']=_0x2409e9[_0x115e('0x9')];this['channels']={};ami['on'](_0x115e('0xa'),this[_0x115e('0xb')][_0x115e('0xc')](this));ami['on'](_0x115e('0xd'),this['syncHangupRequest'][_0x115e('0xc')](this));ami['on']('hangup',this[_0x115e('0xe')][_0x115e('0xc')](this));ami['on'](_0x115e('0xf'),this[_0x115e('0x10')]['bind'](this));ami['on'](_0x115e('0x11'),this[_0x115e('0x12')]['bind'](this));ami['on'](_0x115e('0x13'),this[_0x115e('0x14')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x115e('0x15')][_0x115e('0xc')](this));}function getDiff(_0x31697d){var _0x5bdd30=moment()['milliseconds'](0x0);var _0x4c6a0f=moment(_0x31697d)[_0x115e('0x16')](0x0);return _0x5bdd30[_0x115e('0x17')](_0x4c6a0f,_0x115e('0x18'));}Acw['prototype'][_0x115e('0x19')]=function(_0x297686){try{var _0x220f7d=this;var _0x347540=this[_0x115e('0x1a')][_0x297686]['interface'];var _0xfbe25=this[_0x115e('0x1a')][_0x297686][_0x115e('0x1b')];var _0x4adc40=this[_0x115e('0x7')][_0xfbe25];var _0x406a67=![];var _0x4fa1b8='ACW';if(_0x4adc40[_0x115e('0x1c')]){if(_0x4adc40[_0x115e('0x1d')]['name']){_0x406a67=!![];_0x4fa1b8=_0x4adc40[_0x115e('0x1d')]['name'];}}ami[_0x115e('0x1e')]({'action':_0x115e('0x1f'),'interface':_0x347540,'paused':!![],'reason':_0x4fa1b8})['then'](function(_0x5c16f9){if(_0x220f7d[_0x115e('0x8')][_0x347540]){return RpcUser[_0x115e('0x20')](_0x220f7d[_0x115e('0x8')][_0x347540]['id'])['then'](function(_0x17801c){if(_0x17801c&&!_0x17801c[_0x115e('0x21')]){logger[_0x115e('0x22')](_0x115e('0x23'),_0x297686,_0x347540,_0xfbe25);var _0x5bb8ea=_0x220f7d['channels'][_0x297686][_0x115e('0x24')]&&_0x220f7d[_0x115e('0x1a')][_0x297686][_0x115e('0x25')]?_0x220f7d['channels'][_0x297686]['destlinkedid']:_0x297686;return RpcUser['savePause'](_0x220f7d[_0x115e('0x8')][_0x347540],_0x4fa1b8,_0x5bb8ea)[_0x115e('0x26')](function(_0x253904){if(!_0x406a67){_0x220f7d['timers'][_0x347540]={};logger['info'](_0x115e('0x27'),_0x297686,_0x220f7d[_0x115e('0x7')][_0xfbe25][_0x115e('0x28')],_0x347540,_0xfbe25);_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x29')]=setTimeout(_0x220f7d[_0x115e('0x2a')][_0x115e('0xc')](_0x220f7d,_0x347540),_0x220f7d[_0x115e('0x7')][_0xfbe25]['acwTimeout']*0x3e8);_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x2b')]=moment()[_0x115e('0x2c')](_0x115e('0x2d'));_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x2e')]=_0x297686;_0x220f7d[_0x115e('0x9')][_0x347540]['queue']=_0xfbe25;_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x2f')]=function(){var _0x439ddc=getDiff(_0x220f7d[_0x115e('0x9')][_0x347540]['lastPauseAt']);clearTimeout(_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x29')]);_0x220f7d['timers'][_0x347540][_0x115e('0x29')]=![];RpcVoiceAgentReport[_0x115e('0x30')]({'acwtime':_0x439ddc},_0x220f7d[_0x115e('0x9')][_0x347540][_0x115e('0x2e')],_0x347540)[_0x115e('0x26')](function(_0x3587a2){logger[_0x115e('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x297686,_0x439ddc,_0x3587a2);})['catch'](function(_0x3186f7){logger[_0x115e('0x31')](_0x115e('0x32'),_0x297686,_0x3186f7);});delete _0x220f7d['timers'][_0x347540];};}});}else{logger[_0x115e('0x22')](_0x115e('0x33'),_0x297686,_0x347540,_0xfbe25);}});}})[_0x115e('0x34')](function(_0x4a95df){logger[_0x115e('0x31')](_0x115e('0x27'),_0x297686,_0x220f7d[_0x115e('0x7')][_0xfbe25][_0x115e('0x28')],_0x347540,_0xfbe25);})[_0x115e('0x35')](function(){delete _0x220f7d[_0x115e('0x1a')][_0x297686];});}catch(_0x499401){logger['error']('[ACW][START]\x20%s',_0x499401[_0x115e('0x36')]);}};Acw[_0x115e('0x37')][_0x115e('0x2a')]=function(_0x46b534){try{var _0x16c927=this;if(_0x16c927[_0x115e('0x9')][_0x46b534]){_0x16c927[_0x115e('0x9')][_0x46b534]['timer']=![];var _0x193f66=_0x16c927[_0x115e('0x9')][_0x46b534][_0x115e('0x2e')];var _0xcebaf4=_0x16c927[_0x115e('0x9')][_0x46b534][_0x115e('0x1b')];var _0x1b1d42=_0x16c927['voiceQueues'][_0xcebaf4][_0x115e('0x28')];logger[_0x115e('0x22')](_0x115e('0x38'),_0x193f66,_0x46b534);RpcUser[_0x115e('0x39')](this[_0x115e('0x8')][_0x46b534]);RpcVoiceAgentReport[_0x115e('0x30')]({'acwtime':_0x1b1d42,'agentacw':!![]},_0x193f66,_0x46b534)['then'](function(_0x7c6494){logger[_0x115e('0x22')](_0x115e('0x3a'),_0x193f66,_0x1b1d42,_0x7c6494);})['catch'](function(_0xd7fe44){logger[_0x115e('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x193f66,_0xd7fe44);});}else{logger[_0x115e('0x31')](_0x115e('0x3b'),_0x46b534);if(_0x16c927[_0x115e('0x9')]){logger[_0x115e('0x22')](_0x115e('0x3c'),JSON[_0x115e('0x3d')](_0x16c927[_0x115e('0x9')]));}}}catch(_0x286042){logger[_0x115e('0x31')](_0x115e('0x3e'),_0x286042[_0x115e('0x36')]);}};Acw[_0x115e('0x37')]['syncAgentConnect']=function(_0x5d4fba){try{if(this[_0x115e('0x7')][_0x5d4fba[_0x115e('0x1b')]]&&(this[_0x115e('0x7')][_0x5d4fba[_0x115e('0x1b')]][_0x115e('0x3f')]||this[_0x115e('0x7')][_0x5d4fba[_0x115e('0x1b')]][_0x115e('0x1c')])){if(this['agents'][_0x5d4fba['interface']]){this[_0x115e('0x1a')][_0x5d4fba['uniqueid']]={'queue':_0x5d4fba['queue'],'interface':_0x5d4fba[_0x115e('0x40')],'destlinkedid':_0x5d4fba[_0x115e('0x25')]};}}}catch(_0x41565f){logger[_0x115e('0x31')](_0x115e('0x41'),_0x41565f['message']);}};Acw[_0x115e('0x37')][_0x115e('0x15')]=function(_0x3189b3){try{if(this[_0x115e('0x7')][_0x3189b3[_0x115e('0x1b')]]&&(this[_0x115e('0x7')][_0x3189b3[_0x115e('0x1b')]][_0x115e('0x3f')]||this[_0x115e('0x7')][_0x3189b3['queue']][_0x115e('0x1c')])){if(this['agents'][_0x3189b3['interface']]){this[_0x115e('0x1a')][_0x3189b3[_0x115e('0x2e')]]={'queue':_0x3189b3[_0x115e('0x1b')],'interface':_0x3189b3[_0x115e('0x40')]};}}}catch(_0x4b8eb1){logger[_0x115e('0x31')](_0x115e('0x42'),_0x4b8eb1[_0x115e('0x36')]);}};Acw[_0x115e('0x37')]['syncHangupRequest']=function(_0x5ead67){try{if(this[_0x115e('0x1a')][_0x5ead67[_0x115e('0x2e')]]&&_['isUndefined'](this['channels'][_0x5ead67['uniqueid']][_0x115e('0x24')])){logger[_0x115e('0x22')](_0x115e('0x43'),_0x5ead67[_0x115e('0x2e')]);this[_0x115e('0x19')](_0x5ead67[_0x115e('0x2e')]);}else if(this[_0x115e('0x1a')][_0x5ead67[_0x115e('0x44')]]&&_[_0x115e('0x45')](this[_0x115e('0x1a')][_0x5ead67['linkedid']]['attended'])){logger['info'](_0x115e('0x46'),_0x5ead67['linkedid']);this[_0x115e('0x19')](_0x5ead67[_0x115e('0x44')]);}}catch(_0x19989f){logger[_0x115e('0x31')](_0x115e('0x47'),_0x19989f[_0x115e('0x36')]);}};Acw[_0x115e('0x37')][_0x115e('0xe')]=function(_0x2b24d4){try{if(this[_0x115e('0x1a')][_0x2b24d4[_0x115e('0x2e')]]&&this['channels'][_0x2b24d4[_0x115e('0x2e')]][_0x115e('0x24')]){logger[_0x115e('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2b24d4[_0x115e('0x2e')]);this['startAcw'](_0x2b24d4[_0x115e('0x2e')]);}else if(this[_0x115e('0x1a')][_0x2b24d4[_0x115e('0x44')]]&&this[_0x115e('0x1a')][_0x2b24d4['linkedid']][_0x115e('0x24')]){logger[_0x115e('0x22')](_0x115e('0x48'),_0x2b24d4[_0x115e('0x44')]);this['startAcw'](_0x2b24d4[_0x115e('0x44')]);}}catch(_0x2b1afd){logger['error'](_0x115e('0x49'),_0x2b1afd[_0x115e('0x36')]);}};Acw[_0x115e('0x37')][_0x115e('0x12')]=function(_0x21ec23){try{if(!_[_0x115e('0x4a')](this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4b')]])){this[_0x115e('0x19')](_0x21ec23[_0x115e('0x4b')]);if(this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4c')]]){this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4c')]][_0x115e('0x24')]=!![];this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4d')]]=this['channels'][_0x21ec23[_0x115e('0x4c')]];delete this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4c')]];}}else if(!_[_0x115e('0x4a')](this['channels'][_0x21ec23[_0x115e('0x4d')]])){this['startAcw'](_0x21ec23['transfertargetuniqueid']);if(this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4e')]]){this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4e')]][_0x115e('0x24')]=!![];this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4b')]]=this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4e')]];delete this[_0x115e('0x1a')][_0x21ec23[_0x115e('0x4e')]];}}}catch(_0xcd6de6){logger[_0x115e('0x31')](_0x115e('0x4f'),_0xcd6de6[_0x115e('0x36')]);}};Acw[_0x115e('0x37')]['syncBlindTransfer']=function(_0x110381){try{if(this[_0x115e('0x1a')][_0x110381[_0x115e('0x50')]]){logger[_0x115e('0x22')](_0x115e('0x51'),JSON[_0x115e('0x3d')](_0x110381[_0x115e('0x50')]));this['startAcw'](_0x110381[_0x115e('0x50')]);}else if(this['channels'][_0x110381[_0x115e('0x52')]]){logger[_0x115e('0x22')](_0x115e('0x53'),JSON['stringify'](_0x110381[_0x115e('0x52')]));this[_0x115e('0x19')](_0x110381[_0x115e('0x52')]);}}catch(_0x2aa4de){logger[_0x115e('0x31')]('[ACW][syncBlindTransfer]\x20%s',_0x2aa4de[_0x115e('0x36')]);}};Acw['prototype'][_0x115e('0x10')]=function(_0x106633){try{if(this[_0x115e('0x7')][_0x106633[_0x115e('0x1b')]]&&this[_0x115e('0x7')][_0x106633[_0x115e('0x1b')]]['autopause']===_0x115e('0x54')){if(this[_0x115e('0x8')][_0x106633[_0x115e('0x40')]]){logger[_0x115e('0x22')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x106633[_0x115e('0x2e')],_0x106633['interface'],_0x106633[_0x115e('0x1b')]);return RpcUser['savePause'](this['agents'][_0x106633['interface']],_0x115e('0x55'),_0x106633[_0x115e('0x2e')]);}}}catch(_0x568ab8){logger[_0x115e('0x31')](_0x115e('0x56'),_0x568ab8[_0x115e('0x36')]);}};module[_0x115e('0x57')]=Acw; \ No newline at end of file +var _0xfd8e=['updateAcw','timer','update','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','acw','../rpc/user','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','startAcw','interface','queue','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x528c72,_0x8c6579){var _0x593fd6=function(_0x54ad3f){while(--_0x54ad3f){_0x528c72['push'](_0x528c72['shift']());}};_0x593fd6(++_0x8c6579);}(_0xfd8e,0x7f));var _0xefd8=function(_0x21518e,_0x2fbe8e){_0x21518e=_0x21518e-0x0;var _0x5e2947=_0xfd8e[_0x21518e];return _0x5e2947;};'use strict';var util=require(_0xefd8('0x0'));var _=require(_0xefd8('0x1'));var moment=require('moment');var ami=require(_0xefd8('0x2'));var logger=require('../../../config/logger')(_0xefd8('0x3'));var RpcUser=require(_0xefd8('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x23e8cf){this['voiceQueues']=_0x23e8cf[_0xefd8('0x5')];this[_0xefd8('0x6')]=_0x23e8cf[_0xefd8('0x6')];this['timers']=_0x23e8cf['timers'];this[_0xefd8('0x7')]={};ami['on'](_0xefd8('0x8'),this[_0xefd8('0x9')][_0xefd8('0xa')](this));ami['on'](_0xefd8('0xb'),this[_0xefd8('0xc')][_0xefd8('0xa')](this));ami['on'](_0xefd8('0xd'),this[_0xefd8('0xe')]['bind'](this));ami['on'](_0xefd8('0xf'),this[_0xefd8('0x10')]['bind'](this));ami['on'](_0xefd8('0x11'),this[_0xefd8('0x12')][_0xefd8('0xa')](this));ami['on']('blindtransfer',this[_0xefd8('0x13')][_0xefd8('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0xefd8('0x14')][_0xefd8('0xa')](this));}function getDiff(_0x532678){var _0x2b79ac=moment()[_0xefd8('0x15')](0x0);var _0x608d97=moment(_0x532678)['milliseconds'](0x0);return _0x2b79ac['diff'](_0x608d97,'seconds');}Acw['prototype'][_0xefd8('0x16')]=function(_0x5c87df){try{var _0x352a12=this;var _0x5a1054=this[_0xefd8('0x7')][_0x5c87df][_0xefd8('0x17')];var _0xf65c35=this[_0xefd8('0x7')][_0x5c87df][_0xefd8('0x18')];var _0x3b7bbb=this[_0xefd8('0x5')][_0xf65c35];var _0x46449f=![];var _0x7bb5d2='ACW';if(_0x3b7bbb[_0xefd8('0x19')]){if(_0x3b7bbb['mandatoryDispositionPause'][_0xefd8('0x1a')]){_0x46449f=!![];_0x7bb5d2=_0x3b7bbb[_0xefd8('0x1b')][_0xefd8('0x1a')];}}ami[_0xefd8('0x1c')]({'action':_0xefd8('0x1d'),'interface':_0x5a1054,'paused':!![],'reason':_0x7bb5d2})['then'](function(_0x42dd2a){if(_0x352a12[_0xefd8('0x6')][_0x5a1054]){return RpcUser[_0xefd8('0x1e')](_0x352a12[_0xefd8('0x6')][_0x5a1054]['id'])[_0xefd8('0x1f')](function(_0x2ab2fe){if(_0x2ab2fe&&!_0x2ab2fe[_0xefd8('0x20')]){logger['info'](_0xefd8('0x21'),_0x5c87df,_0x5a1054,_0xf65c35);var _0x3313db=_0x352a12[_0xefd8('0x7')][_0x5c87df][_0xefd8('0x22')]&&_0x352a12[_0xefd8('0x7')][_0x5c87df][_0xefd8('0x23')]?_0x352a12['channels'][_0x5c87df][_0xefd8('0x23')]:_0x5c87df;return RpcUser[_0xefd8('0x24')](_0x352a12[_0xefd8('0x6')][_0x5a1054],_0x7bb5d2,_0x3313db)['then'](function(_0x13ad7a){if(!_0x46449f){_0x352a12[_0xefd8('0x25')][_0x5a1054]={};logger[_0xefd8('0x26')](_0xefd8('0x27'),_0x5c87df,_0x352a12[_0xefd8('0x5')][_0xf65c35][_0xefd8('0x28')],_0x5a1054,_0xf65c35);_0x352a12[_0xefd8('0x25')][_0x5a1054]['timer']=setTimeout(_0x352a12[_0xefd8('0x29')][_0xefd8('0xa')](_0x352a12,_0x5a1054),_0x352a12['voiceQueues'][_0xf65c35]['acwTimeout']*0x3e8);_0x352a12[_0xefd8('0x25')][_0x5a1054][_0xefd8('0x2a')]=moment()[_0xefd8('0x2b')](_0xefd8('0x2c'));_0x352a12[_0xefd8('0x25')][_0x5a1054]['uniqueid']=_0x5c87df;_0x352a12[_0xefd8('0x25')][_0x5a1054]['queue']=_0xf65c35;_0x352a12[_0xefd8('0x25')][_0x5a1054][_0xefd8('0x2d')]=function(){var _0x233803=getDiff(_0x352a12['timers'][_0x5a1054][_0xefd8('0x2a')]);clearTimeout(_0x352a12[_0xefd8('0x25')][_0x5a1054][_0xefd8('0x2e')]);_0x352a12[_0xefd8('0x25')][_0x5a1054][_0xefd8('0x2e')]=![];RpcVoiceAgentReport[_0xefd8('0x2f')]({'acwtime':_0x233803},_0x352a12[_0xefd8('0x25')][_0x5a1054][_0xefd8('0x30')],_0x5a1054)[_0xefd8('0x1f')](function(_0x1f519a){logger[_0xefd8('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x5c87df,_0x233803,_0x1f519a);})[_0xefd8('0x31')](function(_0x19726f){logger[_0xefd8('0x32')](_0xefd8('0x33'),_0x5c87df,_0x19726f);});delete _0x352a12['timers'][_0x5a1054];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5c87df,_0x5a1054,_0xf65c35);}});}})[_0xefd8('0x31')](function(_0x3cbcd8){logger[_0xefd8('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5c87df,_0x352a12['voiceQueues'][_0xf65c35][_0xefd8('0x28')],_0x5a1054,_0xf65c35);})[_0xefd8('0x34')](function(){delete _0x352a12[_0xefd8('0x7')][_0x5c87df];});}catch(_0x2c23f4){logger[_0xefd8('0x32')](_0xefd8('0x35'),_0x2c23f4[_0xefd8('0x36')]);}};Acw[_0xefd8('0x37')][_0xefd8('0x29')]=function(_0x48270f){try{var _0x30d871=this;if(_0x30d871[_0xefd8('0x25')][_0x48270f]){_0x30d871[_0xefd8('0x25')][_0x48270f][_0xefd8('0x2e')]=![];var _0x1eba0a=_0x30d871[_0xefd8('0x25')][_0x48270f][_0xefd8('0x30')];var _0x41c28e=_0x30d871[_0xefd8('0x25')][_0x48270f][_0xefd8('0x18')];var _0x40f6f8=_0x30d871[_0xefd8('0x5')][_0x41c28e][_0xefd8('0x28')];logger['info'](_0xefd8('0x38'),_0x1eba0a,_0x48270f);RpcUser['saveUnpause'](this[_0xefd8('0x6')][_0x48270f]);RpcVoiceAgentReport[_0xefd8('0x2f')]({'acwtime':_0x40f6f8,'agentacw':!![]},_0x1eba0a,_0x48270f)['then'](function(_0x2b9978){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x1eba0a,_0x40f6f8,_0x2b9978);})[_0xefd8('0x31')](function(_0x1c4994){logger[_0xefd8('0x32')](_0xefd8('0x33'),_0x1eba0a,_0x1c4994);});}else{logger[_0xefd8('0x32')](_0xefd8('0x39'),_0x48270f);if(_0x30d871[_0xefd8('0x25')]){logger[_0xefd8('0x26')]('[ACW][TIMERS]',JSON[_0xefd8('0x3a')](_0x30d871[_0xefd8('0x25')]));}}}catch(_0x30b720){logger['error'](_0xefd8('0x3b'),_0x30b720[_0xefd8('0x36')]);}};Acw['prototype'][_0xefd8('0x9')]=function(_0xcbb1cc){try{if(this['voiceQueues'][_0xcbb1cc['queue']]&&(this[_0xefd8('0x5')][_0xcbb1cc[_0xefd8('0x18')]]['acw']||this[_0xefd8('0x5')][_0xcbb1cc[_0xefd8('0x18')]][_0xefd8('0x19')])){if(this[_0xefd8('0x6')][_0xcbb1cc['interface']]){this[_0xefd8('0x7')][_0xcbb1cc[_0xefd8('0x30')]]={'queue':_0xcbb1cc['queue'],'interface':_0xcbb1cc[_0xefd8('0x17')],'destlinkedid':_0xcbb1cc['destlinkedid']};}}}catch(_0x190d2c){logger[_0xefd8('0x32')]('[ACW][syncAgentConnect]\x20%s',_0x190d2c[_0xefd8('0x36')]);}};Acw[_0xefd8('0x37')]['syncAgentConnectPreview']=function(_0x3cff0d){try{if(this[_0xefd8('0x5')][_0x3cff0d['queue']]&&(this[_0xefd8('0x5')][_0x3cff0d[_0xefd8('0x18')]][_0xefd8('0x3')]||this[_0xefd8('0x5')][_0x3cff0d[_0xefd8('0x18')]][_0xefd8('0x19')])){if(this[_0xefd8('0x6')][_0x3cff0d[_0xefd8('0x17')]]){this[_0xefd8('0x7')][_0x3cff0d[_0xefd8('0x30')]]={'queue':_0x3cff0d[_0xefd8('0x18')],'interface':_0x3cff0d['interface']};}}}catch(_0x1a311e){logger[_0xefd8('0x32')](_0xefd8('0x3c'),_0x1a311e[_0xefd8('0x36')]);}};Acw[_0xefd8('0x37')][_0xefd8('0xc')]=function(_0x2b5cc5){try{if(this[_0xefd8('0x7')][_0x2b5cc5[_0xefd8('0x30')]]&&_[_0xefd8('0x3d')](this[_0xefd8('0x7')][_0x2b5cc5[_0xefd8('0x30')]]['attended'])){logger[_0xefd8('0x26')](_0xefd8('0x3e'),_0x2b5cc5[_0xefd8('0x30')]);this['startAcw'](_0x2b5cc5[_0xefd8('0x30')]);}else if(this[_0xefd8('0x7')][_0x2b5cc5['linkedid']]&&_[_0xefd8('0x3d')](this['channels'][_0x2b5cc5[_0xefd8('0x3f')]]['attended'])){logger[_0xefd8('0x26')](_0xefd8('0x40'),_0x2b5cc5['linkedid']);this['startAcw'](_0x2b5cc5['linkedid']);}}catch(_0x34c531){logger[_0xefd8('0x32')](_0xefd8('0x41'),_0x34c531[_0xefd8('0x36')]);}};Acw['prototype']['syncHangup']=function(_0x530dd6){try{if(this['channels'][_0x530dd6[_0xefd8('0x30')]]&&this[_0xefd8('0x7')][_0x530dd6[_0xefd8('0x30')]]['attended']){logger[_0xefd8('0x26')](_0xefd8('0x42'),_0x530dd6[_0xefd8('0x30')]);this['startAcw'](_0x530dd6[_0xefd8('0x30')]);}else if(this[_0xefd8('0x7')][_0x530dd6[_0xefd8('0x3f')]]&&this[_0xefd8('0x7')][_0x530dd6[_0xefd8('0x3f')]]['attended']){logger['info'](_0xefd8('0x43'),_0x530dd6[_0xefd8('0x3f')]);this[_0xefd8('0x16')](_0x530dd6[_0xefd8('0x3f')]);}}catch(_0x10671c){logger[_0xefd8('0x32')](_0xefd8('0x44'),_0x10671c['message']);}};Acw[_0xefd8('0x37')]['syncAttendedTransfer']=function(_0x438da3){try{if(!_[_0xefd8('0x45')](this['channels'][_0x438da3[_0xefd8('0x46')]])){this[_0xefd8('0x16')](_0x438da3[_0xefd8('0x46')]);if(this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x47')]]){this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x47')]][_0xefd8('0x22')]=!![];this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x48')]]=this[_0xefd8('0x7')][_0x438da3['secondtransfereruniqueid']];delete this[_0xefd8('0x7')][_0x438da3['secondtransfereruniqueid']];}}else if(!_[_0xefd8('0x45')](this[_0xefd8('0x7')][_0x438da3['transfertargetuniqueid']])){this[_0xefd8('0x16')](_0x438da3[_0xefd8('0x48')]);if(this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x49')]]){this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x49')]][_0xefd8('0x22')]=!![];this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x46')]]=this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x49')]];delete this[_0xefd8('0x7')][_0x438da3[_0xefd8('0x49')]];}}}catch(_0x15e17a){logger[_0xefd8('0x32')](_0xefd8('0x4a'),_0x15e17a[_0xefd8('0x36')]);}};Acw[_0xefd8('0x37')][_0xefd8('0x13')]=function(_0x39509c){try{if(this[_0xefd8('0x7')][_0x39509c[_0xefd8('0x4b')]]){logger['info'](_0xefd8('0x4c'),JSON[_0xefd8('0x3a')](_0x39509c[_0xefd8('0x4b')]));this[_0xefd8('0x16')](_0x39509c[_0xefd8('0x4b')]);}else if(this['channels'][_0x39509c['transfererlinkedid']]){logger[_0xefd8('0x26')](_0xefd8('0x4d'),JSON[_0xefd8('0x3a')](_0x39509c[_0xefd8('0x4e')]));this[_0xefd8('0x16')](_0x39509c[_0xefd8('0x4e')]);}}catch(_0x371997){logger[_0xefd8('0x32')](_0xefd8('0x4f'),_0x371997['message']);}};Acw[_0xefd8('0x37')][_0xefd8('0x10')]=function(_0x1abaaa){try{if(this[_0xefd8('0x5')][_0x1abaaa[_0xefd8('0x18')]]&&this['voiceQueues'][_0x1abaaa[_0xefd8('0x18')]][_0xefd8('0x50')]===_0xefd8('0x51')){if(this['agents'][_0x1abaaa[_0xefd8('0x17')]]){logger[_0xefd8('0x26')](_0xefd8('0x52'),_0x1abaaa[_0xefd8('0x30')],_0x1abaaa[_0xefd8('0x17')],_0x1abaaa[_0xefd8('0x18')]);return RpcUser['savePause'](this[_0xefd8('0x6')][_0x1abaaa[_0xefd8('0x17')]],_0xefd8('0x53'),_0x1abaaa[_0xefd8('0x30')]);}}}catch(_0x50ed92){logger[_0xefd8('0x32')](_0xefd8('0x54'),_0x50ed92[_0xefd8('0x36')]);}};module[_0xefd8('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7d7181e..2111a1a 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 _0x6f8e=['exports','asterisk-manager','bluebird','ami','../../config/environment','asterisk','port','username','password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionCoreShowChannels','catch','log'];(function(_0x35d470,_0x7dbc06){var _0x10a6b7=function(_0x55dd35){while(--_0x55dd35){_0x35d470['push'](_0x35d470['shift']());}};_0x10a6b7(++_0x7dbc06);}(_0x6f8e,0x15f));var _0xe6f8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6f8e[_0x1facfa];return _0x9ec701;};'use strict';var Manager=require(_0xe6f8('0x0'));var BPromise=require(_0xe6f8('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xe6f8('0x2'));var config=require(_0xe6f8('0x3'));var ami=new Manager(config[_0xe6f8('0x4')][_0xe6f8('0x5')],config[_0xe6f8('0x4')]['ip'],config[_0xe6f8('0x4')][_0xe6f8('0x6')],config[_0xe6f8('0x4')][_0xe6f8('0x7')],!![]);ami[_0xe6f8('0x8')]();ami['Action']=BPromise['promisify'](ami[_0xe6f8('0x9')]);function error(_0x3ce392){logger[_0xe6f8('0xa')](util[_0xe6f8('0xb')](_0xe6f8('0xc'),config['asterisk'][_0xe6f8('0x6')],config[_0xe6f8('0x4')]['ip'],config[_0xe6f8('0x4')][_0xe6f8('0x5')],util[_0xe6f8('0xd')](_0x3ce392,![],null)));}function close(){logger[_0xe6f8('0xa')](util['format'](_0xe6f8('0xe'),config['asterisk']['username'],config[_0xe6f8('0x4')]['ip'],config[_0xe6f8('0x4')]['port']));}ami[_0xe6f8('0xf')]=function(){return function(){return ami[_0xe6f8('0x10')]({'action':_0xe6f8('0x11')});};};ami[_0xe6f8('0x12')]=function(){return function(){return ami[_0xe6f8('0x10')]({'action':_0xe6f8('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe6f8('0x10')]({'action':_0xe6f8('0x14')});};};ami[_0xe6f8('0x15')]=function(){return function(){return ami[_0xe6f8('0x10')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xe6f8('0x10')]({'action':_0xe6f8('0x16')});};};function connect(_0x151e62){logger[_0xe6f8('0x17')](util[_0xe6f8('0xb')](_0xe6f8('0x18'),config[_0xe6f8('0x4')][_0xe6f8('0x6')],config[_0xe6f8('0x4')]['ip'],config['asterisk']['port']));ami[_0xe6f8('0x19')]('error',error);ami['once'](_0xe6f8('0x1a'),close);}ami['on'](_0xe6f8('0x1b'),connect);ami['on']('shutdown',function(_0x381e33){logger[_0xe6f8('0x17')](util['format'](_0xe6f8('0x1c'),config[_0xe6f8('0x4')]['username'],config[_0xe6f8('0x4')]['ip'],config[_0xe6f8('0x4')]['port'],util['inspect'](_0x381e33,![],null)));});ami['on']('fullybooted',function(_0x1f0877){logger['info'](util[_0xe6f8('0xb')](_0xe6f8('0x1d'),config[_0xe6f8('0x4')][_0xe6f8('0x6')],config[_0xe6f8('0x4')]['ip'],config[_0xe6f8('0x4')]['port']));return BPromise['resolve']()['then'](ami[_0xe6f8('0xf')]())[_0xe6f8('0x1e')](ami[_0xe6f8('0x12')]())['then'](ami['actionSipPeerStatus']())[_0xe6f8('0x1e')](ami['actionQueueSummary']())[_0xe6f8('0x1e')](ami[_0xe6f8('0x1f')]())[_0xe6f8('0x20')](function(_0x225e60){console[_0xe6f8('0x21')](_0x225e60);});});ami['once'](_0xe6f8('0xa'),error);ami[_0xe6f8('0x19')]('close',close);module[_0xe6f8('0x22')]=ami; \ No newline at end of file +var _0x5e3e=['Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','exports','asterisk-manager','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','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','fullybooted'];(function(_0x106ce0,_0x3af244){var _0x30a965=function(_0x22333f){while(--_0x22333f){_0x106ce0['push'](_0x106ce0['shift']());}};_0x30a965(++_0x3af244);}(_0x5e3e,0x109));var _0xe5e3=function(_0x4c825d,_0x10ec2b){_0x4c825d=_0x4c825d-0x0;var _0x43de87=_0x5e3e[_0x4c825d];return _0x43de87;};'use strict';var Manager=require(_0xe5e3('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require('util');var _=require(_0xe5e3('0x1'));var logger=require(_0xe5e3('0x2'))(_0xe5e3('0x3'));var config=require(_0xe5e3('0x4'));var ami=new Manager(config[_0xe5e3('0x5')]['port'],config[_0xe5e3('0x5')]['ip'],config[_0xe5e3('0x5')][_0xe5e3('0x6')],config[_0xe5e3('0x5')][_0xe5e3('0x7')],!![]);ami['keepConnected']();ami[_0xe5e3('0x8')]=BPromise[_0xe5e3('0x9')](ami[_0xe5e3('0xa')]);function error(_0x9207c9){logger[_0xe5e3('0xb')](util['format'](_0xe5e3('0xc'),config[_0xe5e3('0x5')][_0xe5e3('0x6')],config['asterisk']['ip'],config[_0xe5e3('0x5')][_0xe5e3('0xd')],util[_0xe5e3('0xe')](_0x9207c9,![],null)));}function close(){logger['error'](util[_0xe5e3('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe5e3('0x5')][_0xe5e3('0x6')],config[_0xe5e3('0x5')]['ip'],config[_0xe5e3('0x5')]['port']));}ami[_0xe5e3('0x10')]=function(){return function(){return ami[_0xe5e3('0x8')]({'action':_0xe5e3('0x11')});};};ami[_0xe5e3('0x12')]=function(){return function(){return ami[_0xe5e3('0x8')]({'action':_0xe5e3('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe5e3('0x8')]({'action':_0xe5e3('0x14')});};};ami[_0xe5e3('0x15')]=function(){return function(){return ami[_0xe5e3('0x8')]({'action':'queuesummary'});};};ami[_0xe5e3('0x16')]=function(){return function(){return ami[_0xe5e3('0x8')]({'action':'coreshowchannels'});};};function connect(_0x486b8a){logger[_0xe5e3('0x17')](util['format'](_0xe5e3('0x18'),config['asterisk'][_0xe5e3('0x6')],config[_0xe5e3('0x5')]['ip'],config['asterisk']['port']));ami[_0xe5e3('0x19')](_0xe5e3('0xb'),error);ami[_0xe5e3('0x19')](_0xe5e3('0x1a'),close);}ami['on'](_0xe5e3('0x1b'),connect);ami['on'](_0xe5e3('0x1c'),function(_0x3c0eec){logger[_0xe5e3('0x17')](util[_0xe5e3('0xf')](_0xe5e3('0x1d'),config['asterisk'][_0xe5e3('0x6')],config[_0xe5e3('0x5')]['ip'],config[_0xe5e3('0x5')][_0xe5e3('0xd')],util[_0xe5e3('0xe')](_0x3c0eec,![],null)));});ami['on'](_0xe5e3('0x1e'),function(_0x29d746){logger[_0xe5e3('0x17')](util['format'](_0xe5e3('0x1f'),config[_0xe5e3('0x5')][_0xe5e3('0x6')],config[_0xe5e3('0x5')]['ip'],config[_0xe5e3('0x5')][_0xe5e3('0xd')]));return BPromise[_0xe5e3('0x20')]()['then'](ami[_0xe5e3('0x10')]())['then'](ami[_0xe5e3('0x12')]())[_0xe5e3('0x21')](ami[_0xe5e3('0x22')]())[_0xe5e3('0x21')](ami[_0xe5e3('0x15')]())[_0xe5e3('0x21')](ami[_0xe5e3('0x16')]())[_0xe5e3('0x23')](function(_0x41b5a1){console['log'](_0x41b5a1);});});ami[_0xe5e3('0x19')]('error',error);ami[_0xe5e3('0x19')](_0xe5e3('0x1a'),close);module[_0xe5e3('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d6bb809..777201d 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 _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xda3f,0xec));var _0xfda3=function(_0x2300de,_0x28fae5){_0x2300de=_0x2300de-0x0;var _0x42a368=_0xda3f[_0x2300de];return _0x42a368;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file +var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x4436f7,_0x5784fc){var _0x268052=function(_0x2cb364){while(--_0x2cb364){_0x4436f7['push'](_0x4436f7['shift']());}};_0x268052(++_0x5784fc);}(_0xf4eb,0xec));var _0xbf4e=function(_0xae558c,_0x4283d2){_0xae558c=_0xae558c-0x0;var _0x8cb76c=_0xf4eb[_0xae558c];return _0x8cb76c;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index c4bc786..cb5ac77 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 _0x5ca0=['originatecalleridnum','originatecalleridname','dialCutDigit','substring','voiceQueue','prototype','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5e1892,_0x5005fc){var _0x2a36e7=function(_0x437743){while(--_0x437743){_0x5e1892['push'](_0x5e1892['shift']());}};_0x2a36e7(++_0x5005fc);}(_0x5ca0,0x151));var _0x05ca=function(_0x95d95e,_0x1a4c44){_0x95d95e=_0x95d95e-0x0;var _0x6f30a3=_0x5ca0[_0x95d95e];return _0x6f30a3;};'use strict';var util=require(_0x05ca('0x0'));var _=require(_0x05ca('0x1'));var moment=require(_0x05ca('0x2'));function checkNameSurname(_0x431f1c,_0x4f919f,_0x5558a8){var _0x531980='';if(!_[_0x05ca('0x3')](_0x4f919f)&&_0x05ca('0x4')===typeof _0x4f919f){_0x531980+=_0x4f919f;}if(!_[_0x05ca('0x3')](_0x5558a8)&&_0x05ca('0x4')===typeof _0x5558a8){_0x531980+='\x20'+_0x5558a8;}if(_0x531980!==''){return _0x531980;}return _0x431f1c;}function Action(_0x150961,_0x239d88,_0x24ef49){this['voiceQueue']=_0x150961;this[_0x05ca('0x5')]=_0x24ef49||undefined;this[_0x05ca('0x6')]=checkNameSurname(_0x239d88[_0x05ca('0x7')][_0x05ca('0x8')],_0x239d88[_0x05ca('0x7')][_0x05ca('0x9')],_0x239d88[_0x05ca('0x7')][_0x05ca('0xa')]);this[_0x05ca('0xb')]=_0x239d88['Contact'][_0x05ca('0x8')];this[_0x05ca('0xc')]=_0x150961['name'];this[_0x05ca('0xd')]=_0x239d88['active']||![];this['type']=_0x150961[_0x05ca('0xe')];this['dialQueueTimeout']=_0x150961[_0x05ca('0xf')]||0x3;this[_0x05ca('0x10')]=_0x239d88[_0x05ca('0x10')];this[_0x05ca('0x11')]=_0x239d88[_0x05ca('0x11')];this[_0x05ca('0x12')]=_0x239d88[_0x05ca('0x12')];this[_0x05ca('0x13')]=_0x239d88[_0x05ca('0x13')];this[_0x05ca('0x14')]=_0x239d88['countnosuchnumberretry'];this[_0x05ca('0x15')]=_0x239d88[_0x05ca('0x15')];this[_0x05ca('0x16')]=_0x239d88[_0x05ca('0x16')];this[_0x05ca('0x17')]=_0x239d88[_0x05ca('0x17')];this[_0x05ca('0x18')]=_0x239d88['countagentrejectretry'];this['ContactId']=_0x239d88[_0x05ca('0x19')];this[_0x05ca('0x1a')]=_0x239d88[_0x05ca('0x1a')];this[_0x05ca('0x1b')]=_0x239d88[_0x05ca('0x1b')];this['VoiceQueueId']=_0x239d88[_0x05ca('0x1c')];this[_0x05ca('0x1d')]=_0x239d88[_0x05ca('0x1d')];this[_0x05ca('0x1e')]=_0x239d88['id'];this[_0x05ca('0x1f')]=_0x239d88[_0x05ca('0x7')][_0x05ca('0x9')]||'';this[_0x05ca('0x20')]=moment()[_0x05ca('0x21')](_0x05ca('0x22'));this[_0x05ca('0x23')]=_0x239d88[_0x05ca('0x23')];this[_0x05ca('0x24')]=_0x239d88[_0x05ca('0x24')];this['callbackat']=_0x239d88[_0x05ca('0x25')];this[_0x05ca('0x26')]=_0x239d88['recallme'];this[_0x05ca('0x27')]='';this[_0x05ca('0x28')]='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x05ca('0x6')],this['voiceQueue'][_0x05ca('0x29')]>0x0?this[_0x05ca('0xb')][_0x05ca('0x2a')](this[_0x05ca('0x2b')]['dialCutDigit']):this[_0x05ca('0xb')]);};Action[_0x05ca('0x2c')][_0x05ca('0x2d')]=function(){return this['queue'];};module[_0x05ca('0x2e')]=Action; \ No newline at end of file +var _0xf8d8=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xf8d8,0xdb));var _0x8f8d=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0xf8d8[_0x1ebe2f];return _0xdeb06f;};'use strict';var util=require(_0x8f8d('0x0'));var _=require(_0x8f8d('0x1'));var moment=require(_0x8f8d('0x2'));function checkNameSurname(_0x238434,_0x246061,_0xa873c7){var _0x1d9d6b='';if(!_['isNil'](_0x246061)&&_0x8f8d('0x3')===typeof _0x246061){_0x1d9d6b+=_0x246061;}if(!_[_0x8f8d('0x4')](_0xa873c7)&&_0x8f8d('0x3')===typeof _0xa873c7){_0x1d9d6b+='\x20'+_0xa873c7;}if(_0x1d9d6b!==''){return _0x1d9d6b;}return _0x238434;}function Action(_0x3863a4,_0x9b7a87,_0x107003){this[_0x8f8d('0x5')]=_0x3863a4;this[_0x8f8d('0x6')]=_0x107003||undefined;this[_0x8f8d('0x7')]=checkNameSurname(_0x9b7a87['Contact'][_0x8f8d('0x8')],_0x9b7a87[_0x8f8d('0x9')][_0x8f8d('0xa')],_0x9b7a87[_0x8f8d('0x9')][_0x8f8d('0xb')]);this[_0x8f8d('0xc')]=_0x9b7a87[_0x8f8d('0x9')][_0x8f8d('0x8')];this[_0x8f8d('0xd')]=_0x3863a4[_0x8f8d('0x7')];this['active']=_0x9b7a87[_0x8f8d('0xe')]||![];this['type']=_0x3863a4[_0x8f8d('0xf')];this[_0x8f8d('0x10')]=_0x3863a4[_0x8f8d('0x10')]||0x3;this['scheduledat']=_0x9b7a87['scheduledat'];this[_0x8f8d('0x11')]=_0x9b7a87[_0x8f8d('0x11')];this[_0x8f8d('0x12')]=_0x9b7a87['countcongestionretry'];this[_0x8f8d('0x13')]=_0x9b7a87['countnoanswerretry'];this[_0x8f8d('0x14')]=_0x9b7a87['countnosuchnumberretry'];this[_0x8f8d('0x15')]=_0x9b7a87[_0x8f8d('0x15')];this[_0x8f8d('0x16')]=_0x9b7a87[_0x8f8d('0x16')];this[_0x8f8d('0x17')]=_0x9b7a87[_0x8f8d('0x17')];this[_0x8f8d('0x18')]=_0x9b7a87['countagentrejectretry'];this['ContactId']=_0x9b7a87[_0x8f8d('0x19')];this[_0x8f8d('0x1a')]=_0x9b7a87[_0x8f8d('0x1a')];this['UserId']=_0x9b7a87[_0x8f8d('0x1b')];this[_0x8f8d('0x1c')]=_0x9b7a87[_0x8f8d('0x1c')];this[_0x8f8d('0x1d')]=_0x9b7a87[_0x8f8d('0x1d')];this[_0x8f8d('0x1e')]=_0x9b7a87['id'];this[_0x8f8d('0x1f')]=_0x9b7a87[_0x8f8d('0x9')][_0x8f8d('0xa')]||'';this[_0x8f8d('0x20')]=moment()[_0x8f8d('0x21')](_0x8f8d('0x22'));this[_0x8f8d('0x23')]=_0x9b7a87[_0x8f8d('0x23')];this[_0x8f8d('0x24')]=_0x9b7a87[_0x8f8d('0x24')];this[_0x8f8d('0x25')]=_0x9b7a87['callbackat'];this[_0x8f8d('0x26')]=_0x9b7a87[_0x8f8d('0x26')];this[_0x8f8d('0x27')]='';this[_0x8f8d('0x28')]='';}Action[_0x8f8d('0x29')][_0x8f8d('0x2a')]=function(){return util['format'](_0x8f8d('0x2b'),this[_0x8f8d('0x7')],this[_0x8f8d('0x5')][_0x8f8d('0x2c')]>0x0?this[_0x8f8d('0xc')][_0x8f8d('0x2d')](this[_0x8f8d('0x5')][_0x8f8d('0x2c')]):this['number']);};Action['prototype'][_0x8f8d('0x2e')]=function(){return this[_0x8f8d('0xd')];};module[_0x8f8d('0x2f')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 79d1bd4..2326f46 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 _0x490e=['Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','answertime','endtime','format','holdtime','talktime','reason','callback','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state'];(function(_0x228d0d,_0x4e0770){var _0x3753ed=function(_0x366634){while(--_0x366634){_0x228d0d['push'](_0x228d0d['shift']());}};_0x3753ed(++_0x4e0770);}(_0x490e,0x1ce));var _0xe490=function(_0x1ef2c6,_0x9da356){_0x1ef2c6=_0x1ef2c6-0x0;var _0x37d0fe=_0x490e[_0x1ef2c6];return _0x37d0fe;};'use strict';var util=require(_0xe490('0x0'));var _=require(_0xe490('0x1'));var moment=require(_0xe490('0x2'));function getSeconds(_0x3b299a,_0x1ac1da){var _0xf3ef36=moment(_0x3b299a)[_0xe490('0x3')](0x0);var _0x4d7f37=moment(_0x1ac1da)[_0xe490('0x3')](0x0);return _0xf3ef36['diff'](_0x4d7f37,_0xe490('0x4'));}function AgentComplete(_0x392e7a,_0x3b59ea){this[_0xe490('0x5')]=0x4;this['statedesc']=_0xe490('0x6');this[_0xe490('0x7')]=_0x392e7a['scheduledat'];this[_0xe490('0x8')]=_0x392e7a['type'];this[_0xe490('0x9')]=_0x392e7a[_0xe490('0x8')]==='outbound'?_0xe490('0xa'):_0x392e7a[_0xe490('0x8')];this[_0xe490('0xb')]=_0x392e7a['countbusyretry'];this[_0xe490('0xc')]=_0x392e7a[_0xe490('0xc')];this[_0xe490('0xd')]=_0x392e7a[_0xe490('0xd')];this['countglobal']=_0x392e7a[_0xe490('0xb')]+_0x392e7a[_0xe490('0xc')]+_0x392e7a[_0xe490('0xd')]+_0x392e7a[_0xe490('0xe')]+_0x392e7a[_0xe490('0xf')]+_0x392e7a[_0xe490('0x10')]+_0x392e7a[_0xe490('0x11')]+_0x392e7a[_0xe490('0x12')];this['countnosuchnumberretry']=_0x392e7a[_0xe490('0xe')];this[_0xe490('0xf')]=_0x392e7a[_0xe490('0xf')];this[_0xe490('0x10')]=_0x392e7a['countabandonedretry'];this[_0xe490('0x11')]=_0x392e7a[_0xe490('0x11')];this[_0xe490('0x12')]=_0x392e7a[_0xe490('0x12')];this[_0xe490('0x13')]=_0x3b59ea[_0xe490('0x13')];this['calleridname']=_0x392e7a['name'];this[_0xe490('0x14')]=_0x392e7a['number'];this['starttime']=_0x392e7a[_0xe490('0x15')];this[_0xe490('0x16')]=_0x392e7a['responsetime'];this[_0xe490('0x17')]=_0x392e7a[_0xe490('0x17')];this[_0xe490('0x18')]=moment()[_0xe490('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x392e7a[_0xe490('0x16')],_0x392e7a['starttime']);this[_0xe490('0x1a')]=getSeconds(_0x392e7a[_0xe490('0x17')],_0x392e7a[_0xe490('0x16')]);this[_0xe490('0x1b')]=getSeconds(this[_0xe490('0x18')],_0x392e7a[_0xe490('0x17')]);this[_0xe490('0xa')]=_0x3b59ea[_0xe490('0xa')];this['membername']=_0x3b59ea['membername'];this[_0xe490('0x1c')]=_0x3b59ea[_0xe490('0x1c')];this['callback']=_0x392e7a[_0xe490('0x1d')];this['callbackuniqueid']=_0x392e7a['callbackuniqueid'];this[_0xe490('0x1e')]=_0x392e7a['callbackat'];this[_0xe490('0x1f')]=_0x392e7a[_0xe490('0x1f')];this['ContactId']=_0x392e7a['ContactId'];this['ListId']=_0x392e7a[_0xe490('0x20')];this[_0xe490('0x21')]=_0x392e7a[_0xe490('0x21')];this[_0xe490('0x22')]=_0x392e7a['VoiceQueueId'];this['CampaignId']=_0x392e7a[_0xe490('0x23')];this[_0xe490('0x24')]=_0x392e7a['originatecalleridnum']||'';this['originatecalleridname']=_0x392e7a[_0xe490('0x25')]||'';}module[_0xe490('0x26')]=AgentComplete; \ No newline at end of file +var _0xfb6a=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','answertime','format','ringtime','responsetime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb6a,0x1d6));var _0xafb6=function(_0xc753c8,_0x5627ff){_0xc753c8=_0xc753c8-0x0;var _0xd02f5c=_0xfb6a[_0xc753c8];return _0xd02f5c;};'use strict';var util=require(_0xafb6('0x0'));var _=require(_0xafb6('0x1'));var moment=require(_0xafb6('0x2'));function getSeconds(_0x924c9f,_0x4157d9){var _0x2c69f0=moment(_0x924c9f)[_0xafb6('0x3')](0x0);var _0xda2967=moment(_0x4157d9)[_0xafb6('0x3')](0x0);return _0x2c69f0[_0xafb6('0x4')](_0xda2967,'seconds');}function AgentComplete(_0x104c34,_0x56db48){this[_0xafb6('0x5')]=0x4;this['statedesc']='Answer';this[_0xafb6('0x6')]=_0x104c34[_0xafb6('0x6')];this[_0xafb6('0x7')]=_0x104c34[_0xafb6('0x7')];this['campaigntype']=_0x104c34[_0xafb6('0x7')]==='outbound'?_0xafb6('0x8'):_0x104c34['type'];this['countbusyretry']=_0x104c34[_0xafb6('0x9')];this[_0xafb6('0xa')]=_0x104c34[_0xafb6('0xa')];this[_0xafb6('0xb')]=_0x104c34[_0xafb6('0xb')];this['countglobal']=_0x104c34[_0xafb6('0x9')]+_0x104c34[_0xafb6('0xa')]+_0x104c34[_0xafb6('0xb')]+_0x104c34[_0xafb6('0xc')]+_0x104c34['countdropretry']+_0x104c34['countabandonedretry']+_0x104c34[_0xafb6('0xd')]+_0x104c34[_0xafb6('0xe')];this[_0xafb6('0xc')]=_0x104c34[_0xafb6('0xc')];this[_0xafb6('0xf')]=_0x104c34['countdropretry'];this[_0xafb6('0x10')]=_0x104c34[_0xafb6('0x10')];this[_0xafb6('0xd')]=_0x104c34[_0xafb6('0xd')];this['countagentrejectretry']=_0x104c34[_0xafb6('0xe')];this[_0xafb6('0x11')]=_0x56db48[_0xafb6('0x11')];this[_0xafb6('0x12')]=_0x104c34[_0xafb6('0x13')];this[_0xafb6('0x14')]=_0x104c34[_0xafb6('0x15')];this[_0xafb6('0x16')]=_0x104c34[_0xafb6('0x16')];this['responsetime']=_0x104c34['responsetime'];this['answertime']=_0x104c34[_0xafb6('0x17')];this['endtime']=moment()[_0xafb6('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xafb6('0x19')]=getSeconds(_0x104c34[_0xafb6('0x1a')],_0x104c34[_0xafb6('0x16')]);this['holdtime']=getSeconds(_0x104c34[_0xafb6('0x17')],_0x104c34['responsetime']);this[_0xafb6('0x1b')]=getSeconds(this['endtime'],_0x104c34['answertime']);this[_0xafb6('0x8')]=_0x56db48[_0xafb6('0x8')];this[_0xafb6('0x1c')]=_0x56db48[_0xafb6('0x1c')];this['reason']=_0x56db48[_0xafb6('0x1d')];this[_0xafb6('0x1e')]=_0x104c34[_0xafb6('0x1e')];this['callbackuniqueid']=_0x104c34[_0xafb6('0x1f')];this[_0xafb6('0x20')]=_0x104c34[_0xafb6('0x20')];this[_0xafb6('0x21')]=_0x104c34[_0xafb6('0x21')];this[_0xafb6('0x22')]=_0x104c34[_0xafb6('0x22')];this[_0xafb6('0x23')]=_0x104c34[_0xafb6('0x23')];this[_0xafb6('0x24')]=_0x104c34['UserId'];this[_0xafb6('0x25')]=_0x104c34[_0xafb6('0x25')];this[_0xafb6('0x26')]=_0x104c34['CampaignId'];this[_0xafb6('0x27')]=_0x104c34[_0xafb6('0x27')]||'';this['originatecalleridname']=_0x104c34[_0xafb6('0x28')]||'';}module[_0xafb6('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 f838cb5..bec85e5 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 _0x4074=['util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x4074,0xf0));var _0x4407=function(_0x797424,_0x47d74e){_0x797424=_0x797424-0x0;var _0x57270d=_0x4074[_0x797424];return _0x57270d;};'use strict';var util=require(_0x4407('0x0'));var _=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));function getSeconds(_0x52977e,_0x1021e6){var _0x2a756=moment(_0x52977e)[_0x4407('0x3')](0x0);var _0x35ad38=moment(_0x1021e6)[_0x4407('0x3')](0x0);return _0x2a756[_0x4407('0x4')](_0x35ad38,_0x4407('0x5'));}function Final(_0x2495d2){this[_0x4407('0x6')]=_0x2495d2[_0x4407('0x6')];this['scheduledat']=_0x2495d2[_0x4407('0x7')];this['type']=_0x2495d2[_0x4407('0x8')];this[_0x4407('0x9')]=_0x2495d2[_0x4407('0x8')]==='outbound'?'queue':_0x2495d2['type'];this[_0x4407('0xa')]=_0x2495d2[_0x4407('0xa')];this[_0x4407('0xb')]=_0x2495d2[_0x4407('0xb')];this[_0x4407('0xc')]=_0x2495d2[_0x4407('0xc')];this[_0x4407('0xd')]=_0x2495d2[_0x4407('0xa')]+_0x2495d2[_0x4407('0xb')]+_0x2495d2[_0x4407('0xc')]+_0x2495d2[_0x4407('0xe')]+_0x2495d2['countdropretry']+_0x2495d2[_0x4407('0xf')]+_0x2495d2[_0x4407('0x10')]+_0x2495d2['countagentrejectretry'];this[_0x4407('0xe')]=_0x2495d2['countnosuchnumberretry'];this[_0x4407('0x11')]=_0x2495d2[_0x4407('0x11')];this[_0x4407('0xf')]=_0x2495d2[_0x4407('0xf')];this[_0x4407('0x10')]=_0x2495d2[_0x4407('0x10')];this[_0x4407('0x12')]=_0x2495d2[_0x4407('0x12')];this['queue']=_0x2495d2[_0x4407('0x13')];this[_0x4407('0x14')]=_0x2495d2[_0x4407('0x14')];this[_0x4407('0x15')]=_0x2495d2[_0x4407('0x15')];this['starttime']=_0x2495d2[_0x4407('0x16')];this['responsetime']=_0x2495d2[_0x4407('0x17')];this[_0x4407('0x18')]=_0x2495d2[_0x4407('0x17')];this[_0x4407('0x19')]=_0x2495d2[_0x4407('0x19')]||0x0;this['holdtime']=_0x2495d2[_0x4407('0x1a')]||0x0;this['talktime']=_0x2495d2[_0x4407('0x1b')]||0x0;this[_0x4407('0x1c')]=_0x2495d2[_0x4407('0x1c')];this[_0x4407('0x1d')]=_0x2495d2['callbackuniqueid'];this[_0x4407('0x1e')]=_0x2495d2[_0x4407('0x1e')];this[_0x4407('0x1f')]=_0x2495d2[_0x4407('0x1f')];this[_0x4407('0x20')]=_0x2495d2['ContactId'];this[_0x4407('0x21')]=_0x2495d2[_0x4407('0x21')];this[_0x4407('0x22')]=_0x2495d2[_0x4407('0x22')];this[_0x4407('0x23')]=_0x2495d2['VoiceQueueId'];this[_0x4407('0x24')]=_0x2495d2['CampaignId'];this[_0x4407('0x25')]=_0x2495d2['originatecalleridnum']||'';this[_0x4407('0x26')]=_0x2495d2['originatecalleridname']||'';}module[_0x4407('0x27')]=Final; \ No newline at end of file +var _0x1db9=['util','lodash','moment','milliseconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db9,0x176));var _0x91db=function(_0x3d20d2,_0xa1ec5c){_0x3d20d2=_0x3d20d2-0x0;var _0x3fff95=_0x1db9[_0x3d20d2];return _0x3fff95;};'use strict';var util=require(_0x91db('0x0'));var _=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));function getSeconds(_0x340fb6,_0xcdfaed){var _0xb6de0b=moment(_0x340fb6)['milliseconds'](0x0);var _0x95a17d=moment(_0xcdfaed)[_0x91db('0x3')](0x0);return _0xb6de0b['diff'](_0x95a17d,'seconds');}function Final(_0x379fa9){this['uniqueid']=_0x379fa9['uniqueid'];this[_0x91db('0x4')]=_0x379fa9[_0x91db('0x4')];this[_0x91db('0x5')]=_0x379fa9[_0x91db('0x5')];this[_0x91db('0x6')]=_0x379fa9['type']===_0x91db('0x7')?'queue':_0x379fa9[_0x91db('0x5')];this[_0x91db('0x8')]=_0x379fa9[_0x91db('0x8')];this['countcongestionretry']=_0x379fa9[_0x91db('0x9')];this['countnoanswerretry']=_0x379fa9['countnoanswerretry'];this['countglobal']=_0x379fa9[_0x91db('0x8')]+_0x379fa9[_0x91db('0x9')]+_0x379fa9['countnoanswerretry']+_0x379fa9['countnosuchnumberretry']+_0x379fa9[_0x91db('0xa')]+_0x379fa9[_0x91db('0xb')]+_0x379fa9[_0x91db('0xc')]+_0x379fa9[_0x91db('0xd')];this[_0x91db('0xe')]=_0x379fa9['countnosuchnumberretry'];this[_0x91db('0xa')]=_0x379fa9[_0x91db('0xa')];this[_0x91db('0xb')]=_0x379fa9[_0x91db('0xb')];this[_0x91db('0xc')]=_0x379fa9[_0x91db('0xc')];this[_0x91db('0xd')]=_0x379fa9[_0x91db('0xd')];this[_0x91db('0xf')]=_0x379fa9[_0x91db('0xf')];this[_0x91db('0x10')]=_0x379fa9[_0x91db('0x10')];this['calleridnum']=_0x379fa9[_0x91db('0x11')];this[_0x91db('0x12')]=_0x379fa9[_0x91db('0x12')];this[_0x91db('0x13')]=_0x379fa9[_0x91db('0x13')];this[_0x91db('0x14')]=_0x379fa9['responsetime'];this['ringtime']=_0x379fa9[_0x91db('0x15')]||0x0;this[_0x91db('0x16')]=_0x379fa9[_0x91db('0x16')]||0x0;this[_0x91db('0x17')]=_0x379fa9['talktime']||0x0;this[_0x91db('0x18')]=_0x379fa9[_0x91db('0x18')];this[_0x91db('0x19')]=_0x379fa9[_0x91db('0x19')];this[_0x91db('0x1a')]=_0x379fa9[_0x91db('0x1a')];this[_0x91db('0x1b')]=_0x379fa9[_0x91db('0x1b')];this[_0x91db('0x1c')]=_0x379fa9[_0x91db('0x1c')];this['ListId']=_0x379fa9['ListId'];this[_0x91db('0x1d')]=_0x379fa9[_0x91db('0x1d')];this['VoiceQueueId']=_0x379fa9[_0x91db('0x1e')];this[_0x91db('0x1f')]=_0x379fa9[_0x91db('0x1f')];this[_0x91db('0x20')]=_0x379fa9[_0x91db('0x20')]||'';this['originatecalleridname']=_0x379fa9['originatecalleridname']||'';}module[_0x91db('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 9d165ac..61269f8 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 _0xc7a1=['countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','milliseconds','diff','seconds','state','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7a1,0x180));var _0x1c7a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc7a1[_0xfae23b];return _0x200640;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1c7a('0x0'));function getSeconds(_0x4e6215,_0x3c7315){var _0x228c25=moment(_0x4e6215)[_0x1c7a('0x1')](0x0);var _0xf2baa9=moment(_0x3c7315)[_0x1c7a('0x1')](0x0);return _0x228c25[_0x1c7a('0x2')](_0xf2baa9,_0x1c7a('0x3'));}function Hangup(_0x1406e2,_0x1e16c9){this[_0x1c7a('0x4')]=0x4;this['statedesc']='Answer';this['scheduledat']=_0x1406e2['scheduledat'];this[_0x1c7a('0x5')]=_0x1406e2[_0x1c7a('0x5')];this[_0x1c7a('0x6')]=_0x1406e2[_0x1c7a('0x5')]===_0x1c7a('0x7')?_0x1c7a('0x8'):_0x1406e2[_0x1c7a('0x5')];this[_0x1c7a('0x9')]=_0x1406e2['countbusyretry'];this[_0x1c7a('0xa')]=_0x1406e2[_0x1c7a('0xa')];this[_0x1c7a('0xb')]=_0x1406e2[_0x1c7a('0xb')];this[_0x1c7a('0xc')]=_0x1406e2[_0x1c7a('0x9')]+_0x1406e2[_0x1c7a('0xa')]+_0x1406e2[_0x1c7a('0xb')]+_0x1406e2[_0x1c7a('0xd')]+_0x1406e2[_0x1c7a('0xe')]+_0x1406e2[_0x1c7a('0xf')]+_0x1406e2[_0x1c7a('0x10')]+_0x1406e2[_0x1c7a('0x11')];this[_0x1c7a('0xd')]=_0x1406e2['countnosuchnumberretry'];this[_0x1c7a('0xe')]=_0x1406e2[_0x1c7a('0xe')];this[_0x1c7a('0xf')]=_0x1406e2['countabandonedretry'];this['countmachineretry']=_0x1406e2['countmachineretry'];this[_0x1c7a('0x11')]=_0x1406e2[_0x1c7a('0x11')];this['uniqueid']=_0x1e16c9[_0x1c7a('0x12')];this['calleridname']=_0x1406e2['name'];this[_0x1c7a('0x13')]=_0x1406e2[_0x1c7a('0x14')];this[_0x1c7a('0x15')]=_0x1406e2[_0x1c7a('0x15')];this['responsetime']=_0x1406e2['responsetime'];this[_0x1c7a('0x16')]=moment()[_0x1c7a('0x17')](_0x1c7a('0x18'));this[_0x1c7a('0x19')]=getSeconds(_0x1406e2[_0x1c7a('0x1a')],_0x1406e2[_0x1c7a('0x15')]);this[_0x1c7a('0x1b')]=0x0;this[_0x1c7a('0x1c')]=getSeconds(this[_0x1c7a('0x16')],_0x1406e2['responsetime']);this['queue']=_0x1406e2['queue'];this[_0x1c7a('0x1d')]=_0x1c7a('0x1e');this[_0x1c7a('0x1f')]=_0x1e16c9['cause-txt'];this[_0x1c7a('0x20')]=_0x1406e2[_0x1c7a('0x20')];this['callbackuniqueid']=_0x1406e2[_0x1c7a('0x21')];this['callbackat']=_0x1406e2['callbackat'];this[_0x1c7a('0x22')]=_0x1406e2[_0x1c7a('0x22')];this[_0x1c7a('0x23')]=_0x1406e2['ContactId'];this[_0x1c7a('0x24')]=_0x1406e2[_0x1c7a('0x24')];this[_0x1c7a('0x25')]=_0x1406e2[_0x1c7a('0x25')];this[_0x1c7a('0x26')]=_0x1406e2['VoiceQueueId'];this[_0x1c7a('0x27')]=_0x1406e2[_0x1c7a('0x27')];}module['exports']=Hangup; \ No newline at end of file +var _0x2f6a=['ringtime','membername','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x306d08,_0x39357e){var _0xeaa1a=function(_0x57397f){while(--_0x57397f){_0x306d08['push'](_0x306d08['shift']());}};_0xeaa1a(++_0x39357e);}(_0x2f6a,0x8a));var _0xa2f6=function(_0x1ed29a,_0x15704a){_0x1ed29a=_0x1ed29a-0x0;var _0xb7206d=_0x2f6a[_0x1ed29a];return _0xb7206d;};'use strict';var util=require(_0xa2f6('0x0'));var _=require(_0xa2f6('0x1'));var moment=require(_0xa2f6('0x2'));function getSeconds(_0x4d4f76,_0x4fb159){var _0x25e2ad=moment(_0x4d4f76)[_0xa2f6('0x3')](0x0);var _0x43efb5=moment(_0x4fb159)[_0xa2f6('0x3')](0x0);return _0x25e2ad[_0xa2f6('0x4')](_0x43efb5,_0xa2f6('0x5'));}function Hangup(_0x32992e,_0x56c791){this[_0xa2f6('0x6')]=0x4;this[_0xa2f6('0x7')]=_0xa2f6('0x8');this[_0xa2f6('0x9')]=_0x32992e['scheduledat'];this[_0xa2f6('0xa')]=_0x32992e['type'];this['campaigntype']=_0x32992e[_0xa2f6('0xa')]===_0xa2f6('0xb')?_0xa2f6('0xc'):_0x32992e[_0xa2f6('0xa')];this[_0xa2f6('0xd')]=_0x32992e[_0xa2f6('0xd')];this[_0xa2f6('0xe')]=_0x32992e[_0xa2f6('0xe')];this[_0xa2f6('0xf')]=_0x32992e[_0xa2f6('0xf')];this['countglobal']=_0x32992e[_0xa2f6('0xd')]+_0x32992e['countcongestionretry']+_0x32992e[_0xa2f6('0xf')]+_0x32992e[_0xa2f6('0x10')]+_0x32992e['countdropretry']+_0x32992e[_0xa2f6('0x11')]+_0x32992e['countmachineretry']+_0x32992e['countagentrejectretry'];this['countnosuchnumberretry']=_0x32992e['countnosuchnumberretry'];this[_0xa2f6('0x12')]=_0x32992e['countdropretry'];this['countabandonedretry']=_0x32992e['countabandonedretry'];this[_0xa2f6('0x13')]=_0x32992e[_0xa2f6('0x13')];this[_0xa2f6('0x14')]=_0x32992e[_0xa2f6('0x14')];this[_0xa2f6('0x15')]=_0x56c791['uniqueid'];this[_0xa2f6('0x16')]=_0x32992e[_0xa2f6('0x17')];this['calleridnum']=_0x32992e[_0xa2f6('0x18')];this[_0xa2f6('0x19')]=_0x32992e[_0xa2f6('0x19')];this[_0xa2f6('0x1a')]=_0x32992e[_0xa2f6('0x1a')];this[_0xa2f6('0x1b')]=moment()[_0xa2f6('0x1c')](_0xa2f6('0x1d'));this[_0xa2f6('0x1e')]=getSeconds(_0x32992e[_0xa2f6('0x1a')],_0x32992e['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0xa2f6('0x1b')],_0x32992e[_0xa2f6('0x1a')]);this[_0xa2f6('0xc')]=_0x32992e['queue'];this[_0xa2f6('0x1f')]='IVR';this['reason']=_0x56c791[_0xa2f6('0x20')];this['callback']=_0x32992e[_0xa2f6('0x21')];this[_0xa2f6('0x22')]=_0x32992e[_0xa2f6('0x22')];this[_0xa2f6('0x23')]=_0x32992e['callbackat'];this['recallme']=_0x32992e['recallme'];this[_0xa2f6('0x24')]=_0x32992e['ContactId'];this[_0xa2f6('0x25')]=_0x32992e['ListId'];this[_0xa2f6('0x26')]=_0x32992e[_0xa2f6('0x26')];this[_0xa2f6('0x27')]=_0x32992e[_0xa2f6('0x27')];this[_0xa2f6('0x28')]=_0x32992e[_0xa2f6('0x28')];}module[_0xa2f6('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 725595c..f2112ab 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 _0xbfca=['type','campaigntype','outbound','queue','countcongestionretry','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xbfca,0xc7));var _0xabfc=function(_0x454df7,_0xc77ad9){_0x454df7=_0x454df7-0x0;var _0x2eba19=_0xbfca[_0x454df7];return _0x2eba19;};'use strict';var util=require(_0xabfc('0x0'));var _=require(_0xabfc('0x1'));var moment=require('moment');function getSeconds(_0x25fd85,_0x476f3b){var _0x16507c=moment(_0x25fd85)[_0xabfc('0x2')](0x0);var _0xffa988=moment(_0x476f3b)[_0xabfc('0x2')](0x0);return _0x16507c['diff'](_0xffa988,_0xabfc('0x3'));}function History(_0x342d93){this[_0xabfc('0x4')]=_0x342d93[_0xabfc('0x4')];this[_0xabfc('0x5')]=_0x342d93[_0xabfc('0x5')]||undefined;this['type']=_0x342d93[_0xabfc('0x6')];this[_0xabfc('0x7')]=_0x342d93['type']===_0xabfc('0x8')?_0xabfc('0x9'):_0x342d93['type'];this['countbusyretry']=_0x342d93['countbusyretry'];this['countcongestionretry']=_0x342d93[_0xabfc('0xa')];this['countnoanswerretry']=_0x342d93['countnoanswerretry'];this[_0xabfc('0xb')]=_0x342d93[_0xabfc('0xc')]+_0x342d93[_0xabfc('0xa')]+_0x342d93[_0xabfc('0xd')]+_0x342d93[_0xabfc('0xe')]+_0x342d93[_0xabfc('0xf')]+_0x342d93[_0xabfc('0x10')]+_0x342d93[_0xabfc('0x11')]+_0x342d93[_0xabfc('0x12')];this['countnosuchnumberretry']=_0x342d93['countnosuchnumberretry'];this[_0xabfc('0xf')]=_0x342d93[_0xabfc('0xf')];this[_0xabfc('0x10')]=_0x342d93[_0xabfc('0x10')];this[_0xabfc('0x11')]=_0x342d93[_0xabfc('0x11')];this[_0xabfc('0x12')]=_0x342d93['countagentrejectretry'];this[_0xabfc('0x9')]=_0x342d93[_0xabfc('0x9')];this[_0xabfc('0x13')]=_0x342d93[_0xabfc('0x14')];this[_0xabfc('0x15')]=_0x342d93[_0xabfc('0x16')];this[_0xabfc('0x17')]=_0x342d93[_0xabfc('0x17')];this[_0xabfc('0x18')]=_0x342d93['responsetime'];this[_0xabfc('0x19')]=_0x342d93['responsetime'];this[_0xabfc('0x1a')]=getSeconds(_0x342d93[_0xabfc('0x18')],_0x342d93[_0xabfc('0x17')]);this[_0xabfc('0x1b')]=0x0;this[_0xabfc('0x1c')]=0x0;this[_0xabfc('0x1d')]=_0x342d93[_0xabfc('0x1d')];this[_0xabfc('0x1e')]=_0x342d93['callbackuniqueid'];this['callbackat']=_0x342d93[_0xabfc('0x1f')];this[_0xabfc('0x20')]=_0x342d93[_0xabfc('0x20')];this[_0xabfc('0x21')]=_0x342d93[_0xabfc('0x21')];this[_0xabfc('0x22')]=_0x342d93[_0xabfc('0x22')];this[_0xabfc('0x23')]=_0x342d93[_0xabfc('0x23')];this[_0xabfc('0x24')]=_0x342d93[_0xabfc('0x24')];this[_0xabfc('0x25')]=_0x342d93[_0xabfc('0x25')];this['originatecalleridnum']=_0x342d93[_0xabfc('0x26')]||'';this[_0xabfc('0x27')]=_0x342d93[_0xabfc('0x27')]||'';}module[_0xabfc('0x28')]=History; \ No newline at end of file +var _0xae39=['endtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','responsetime'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0xae39,0x165));var _0x9ae3=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xae39[_0x550d12];return _0x12103d;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9ae3('0x0'));function getSeconds(_0x2337f8,_0xa85b48){var _0x4d7dbe=moment(_0x2337f8)[_0x9ae3('0x1')](0x0);var _0x2b5b5e=moment(_0xa85b48)[_0x9ae3('0x1')](0x0);return _0x4d7dbe[_0x9ae3('0x2')](_0x2b5b5e,_0x9ae3('0x3'));}function History(_0x6bdfd9){this[_0x9ae3('0x4')]=_0x6bdfd9['uniqueid'];this[_0x9ae3('0x5')]=_0x6bdfd9[_0x9ae3('0x5')]||undefined;this['type']=_0x6bdfd9[_0x9ae3('0x6')];this[_0x9ae3('0x7')]=_0x6bdfd9[_0x9ae3('0x6')]===_0x9ae3('0x8')?'queue':_0x6bdfd9[_0x9ae3('0x6')];this[_0x9ae3('0x9')]=_0x6bdfd9[_0x9ae3('0x9')];this[_0x9ae3('0xa')]=_0x6bdfd9[_0x9ae3('0xa')];this[_0x9ae3('0xb')]=_0x6bdfd9[_0x9ae3('0xb')];this[_0x9ae3('0xc')]=_0x6bdfd9[_0x9ae3('0x9')]+_0x6bdfd9['countcongestionretry']+_0x6bdfd9[_0x9ae3('0xb')]+_0x6bdfd9[_0x9ae3('0xd')]+_0x6bdfd9[_0x9ae3('0xe')]+_0x6bdfd9[_0x9ae3('0xf')]+_0x6bdfd9[_0x9ae3('0x10')]+_0x6bdfd9[_0x9ae3('0x11')];this[_0x9ae3('0xd')]=_0x6bdfd9['countnosuchnumberretry'];this[_0x9ae3('0xe')]=_0x6bdfd9[_0x9ae3('0xe')];this[_0x9ae3('0xf')]=_0x6bdfd9[_0x9ae3('0xf')];this['countmachineretry']=_0x6bdfd9[_0x9ae3('0x10')];this['countagentrejectretry']=_0x6bdfd9[_0x9ae3('0x11')];this[_0x9ae3('0x12')]=_0x6bdfd9[_0x9ae3('0x12')];this[_0x9ae3('0x13')]=_0x6bdfd9[_0x9ae3('0x14')];this[_0x9ae3('0x15')]=_0x6bdfd9['number'];this['starttime']=_0x6bdfd9['starttime'];this['responsetime']=_0x6bdfd9[_0x9ae3('0x16')];this[_0x9ae3('0x17')]=_0x6bdfd9[_0x9ae3('0x16')];this['ringtime']=getSeconds(_0x6bdfd9[_0x9ae3('0x16')],_0x6bdfd9[_0x9ae3('0x18')]);this[_0x9ae3('0x19')]=0x0;this[_0x9ae3('0x1a')]=0x0;this[_0x9ae3('0x1b')]=_0x6bdfd9['callback'];this[_0x9ae3('0x1c')]=_0x6bdfd9[_0x9ae3('0x1c')];this[_0x9ae3('0x1d')]=_0x6bdfd9[_0x9ae3('0x1d')];this[_0x9ae3('0x1e')]=_0x6bdfd9[_0x9ae3('0x1e')];this[_0x9ae3('0x1f')]=_0x6bdfd9[_0x9ae3('0x1f')];this[_0x9ae3('0x20')]=_0x6bdfd9[_0x9ae3('0x20')];this[_0x9ae3('0x21')]=_0x6bdfd9[_0x9ae3('0x21')];this[_0x9ae3('0x22')]=_0x6bdfd9[_0x9ae3('0x22')];this['CampaignId']=_0x6bdfd9[_0x9ae3('0x23')];this[_0x9ae3('0x24')]=_0x6bdfd9[_0x9ae3('0x24')]||'';this['originatecalleridname']=_0x6bdfd9['originatecalleridname']||'';}module[_0x9ae3('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9b0aefa..0d436a1 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 _0x38d0=['dialGlobalMaxRetry','stateGlobal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','AMD','custom:amd','[syncHangupInAMDIvr][createHistory]','MACHINE','reason19\x20machine....','dialMachineMaxRetry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','strategy','roundrobin','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','isTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','dialGlobalInterval','checkIfTimeIntervals','[syncQueueSummary]','syncCampaigns','checkIsTrunkReachable','dialTimezone','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','Contact','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','finally','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','checkRetriveMax','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','floor','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','RUNNING','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','reachable','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','bluebird','uuid','md5','ioredis','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','Error','stringify','milliseconds','diff','type','outbound','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','starttime','prototype','clearZombieChannels','actions','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','[Dialer][checkChannel]','queue','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','then','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','membername','emit','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0x38d0,0x123));var _0x038d=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x38d0[_0x26462c];return _0x509a42;};'use strict';var util=require('util');var _=require(_0x038d('0x0'));var BPromise=require(_0x038d('0x1'));var uuid=require(_0x038d('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x038d('0x3'));var Redis=require(_0x038d('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x038d('0x5'))('dialer');var loggerBooked=require(_0x038d('0x5'))(_0x038d('0x6'));var loggerPredictive=require('../../../config/logger')(_0x038d('0x7'));var loggerPredictiveCalls=require(_0x038d('0x5'))(_0x038d('0x8'));var loggerSyncQueueSummary=require(_0x038d('0x5'))(_0x038d('0x9'));var ami=require(_0x038d('0xa'));config[_0x038d('0xb')]=_[_0x038d('0xc')](config[_0x038d('0xb')],{'host':_0x038d('0xd'),'port':0x18eb});var io=require(_0x038d('0xe'))(new Redis(config[_0x038d('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x038d('0xf'));var cmHopperBlack=require(_0x038d('0x10'));var voiceQueueRt=require(_0x038d('0x11'));var Action=require('./action');var History=require(_0x038d('0x12'));var Final=require(_0x038d('0x13'));var AgentComplete=require(_0x038d('0x14'));var QueueCallerAbandon=require(_0x038d('0x15'));var Hangup=require(_0x038d('0x16'));var ipAgi=process[_0x038d('0x17')][_0x038d('0x18')]||_0x038d('0x19');var strategy={'rrmemory':_0x038d('0x1a'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0xd27ef8){this[_0x038d('0x1b')]=this['tail']?this['tail']['finally'](_0xd27ef8):_0xd27ef8();};function Dialer(_0x483822,_0x1be3f6){this[_0x038d('0x1c')]=new Sequence();this[_0x038d('0x1d')]=_0x1be3f6;this[_0x038d('0x1e')]=_0x483822[_0x038d('0x1e')];this[_0x038d('0x1f')]=_0x483822[_0x038d('0x1f')];this[_0x038d('0x20')]=_0x483822[_0x038d('0x20')];this[_0x038d('0x21')]=_0x483822[_0x038d('0x21')];this[_0x038d('0x22')]=config[_0x038d('0x22')]||0x2;this[_0x038d('0x23')]={};this['actions']={};this['contactsId']={};this[_0x038d('0x24')]={};this[_0x038d('0x25')]={};this[_0x038d('0x26')]={};this[_0x038d('0x27')]={};this[_0x038d('0x28')]={};this[_0x038d('0x29')]={};this[_0x038d('0x2a')]={};ami['on']('agentconnect',this[_0x038d('0x2b')]['bind'](this));ami['on'](_0x038d('0x2c'),this[_0x038d('0x2d')]['bind'](this));ami['on'](_0x038d('0x2e'),this[_0x038d('0x2f')][_0x038d('0x30')](this));ami['on'](_0x038d('0x31'),this[_0x038d('0x32')]['bind'](this));ami['on'](_0x038d('0x33'),this[_0x038d('0x9')][_0x038d('0x30')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x038d('0x34'),this[_0x038d('0x35')][_0x038d('0x30')](this));ami['on'](_0x038d('0x36'),this[_0x038d('0x37')][_0x038d('0x30')](this));ami['on'](_0x038d('0x38'),this['syncQueueMember']['bind'](this));ami['on'](_0x038d('0x39'),this[_0x038d('0x3a')][_0x038d('0x30')](this));this['loopCampaigns']();this[_0x038d('0x3b')]();}function isNotNull(_0x215b2e){return _0x215b2e!==null&&!_['isUndefined'](_0x215b2e);}function checkIsLoggedIn(_0x5a5c4e,_0x31cf2b){return function(){if(_0x31cf2b<=0x0){_0x5a5c4e[_0x038d('0x3c')]=_0x038d('0x3d');throw _0x5a5c4e[_0x038d('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4f8c29){return _0x4f8c29;}function checkIsActive(_0x4c6c91,_0x1ea796){return function(){if(!isActive(_0x1ea796)){_0x4c6c91[_0x038d('0x3c')]='NOT_ACTIVE';throw _0x4c6c91[_0x038d('0x3e')]+_0x038d('0x3f');}};}function checkInterval(_0x22911b){return function(){if(!isNotNull(_0x22911b['Interval'])){_0x22911b[_0x038d('0x3c')]=_0x038d('0x40');throw _0x22911b['name']+_0x038d('0x41');}if(!isNotNull(_0x22911b[_0x038d('0x42')][_0x038d('0x43')])){_0x22911b['message']=_0x038d('0x40');throw _0x22911b[_0x038d('0x3e')]+_0x038d('0x41');}if(!isNotNull(_[_0x038d('0x44')](_0x22911b['Interval'][_0x038d('0x43')]))){_0x22911b[_0x038d('0x3c')]=_0x038d('0x40');throw _0x22911b[_0x038d('0x3e')]+_0x038d('0x41');}};}function msgResponse(_0x4cc882,_0x1b0526,_0xde345f){return{'action':_0x4cc882,'response':_0x1b0526,'message':_0xde345f,'stack':_0xde345f};}function myreject(_0x2f7fbe){return function(_0x3d393d){return _0x2f7fbe(msgResponse('[ifTime][Action]',_0x038d('0x45'),JSON[_0x038d('0x46')](_0x3d393d)));};}function getSeconds(_0x3acc46,_0x33aadb){var _0x529ec7=moment(_0x3acc46)[_0x038d('0x47')](0x0);var _0x37f749=moment(_0x33aadb)['milliseconds'](0x0);return _0x529ec7[_0x038d('0x48')](_0x37f749,'seconds');}function emit(_0x1a5d5d,_0x36d721,_0x54df01){io['to'](_0x1a5d5d)['emit'](_0x36d721,_0x54df01);}function emitVoiceQueueSummary(_0x4f78c5){if(_0x4f78c5[_0x038d('0x49')]===_0x038d('0x4a')){var _0x263a58={'id':_0x4f78c5['id'],'name':_0x4f78c5['name'],'strategy':_0x4f78c5['strategy'],'answered':_0x4f78c5['answered'],'available':_0x4f78c5[_0x038d('0x4b')],'loggedIn':_0x4f78c5[_0x038d('0x4c')],'pTalking':_0x4f78c5[_0x038d('0x4d')],'sumBillable':_0x4f78c5[_0x038d('0x4e')],'sumDuration':_0x4f78c5['sumDuration'],'sumHoldTime':_0x4f78c5[_0x038d('0x4f')]||0x0,'talking':_0x4f78c5[_0x038d('0x50')],'total':_0x4f78c5[_0x038d('0x51')],'type':_0x4f78c5[_0x038d('0x49')],'unmanaged':_0x4f78c5[_0x038d('0x52')],'abandoned':_0x4f78c5[_0x038d('0x53')],'waiting':_0x4f78c5[_0x038d('0x54')],'loggedInDb':_0x4f78c5[_0x038d('0x55')],'dialActive':_0x4f78c5[_0x038d('0x56')],'dialMethod':_0x4f78c5[_0x038d('0x57')],'dialOriginateCallerIdName':_0x4f78c5[_0x038d('0x58')],'dialOriginateCallerIdNumber':_0x4f78c5[_0x038d('0x59')],'dialOriginateTimeout':_0x4f78c5[_0x038d('0x5a')],'dialPrefix':_0x4f78c5[_0x038d('0x5b')],'outboundAnswerAgiCallsDay':_0x4f78c5[_0x038d('0x5c')],'outboundAnswerCallsDay':_0x4f78c5[_0x038d('0x5d')],'outboundBlacklistCallsDay':_0x4f78c5[_0x038d('0x5e')],'outboundBusyCallsDay':_0x4f78c5[_0x038d('0x5f')],'outboundCongestionCallsDay':_0x4f78c5[_0x038d('0x60')],'outboundDropCallsDayACS':_0x4f78c5[_0x038d('0x61')],'outboundDropCallsDayCallersExit':_0x4f78c5[_0x038d('0x62')],'outboundDropCallsDayTimeout':_0x4f78c5[_0x038d('0x63')],'outboundNoAnswerCallsDay':_0x4f78c5[_0x038d('0x64')],'outboundNoSuchCallsDay':_0x4f78c5['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4f78c5[_0x038d('0x65')],'outboundReCallsDay':_0x4f78c5['outboundReCallsDay'],'outboundRejectCallsDay':_0x4f78c5['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4f78c5[_0x038d('0x66')],'predictiveIntervalAnsweredCalls':_0x4f78c5[_0x038d('0x67')],'predictiveIntervalAvgHoldtime':_0x4f78c5[_0x038d('0x68')],'predictiveIntervalAvgTalktime':_0x4f78c5[_0x038d('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x4f78c5[_0x038d('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x4f78c5[_0x038d('0x6b')],'predictiveIntervalErlangCalls':_0x4f78c5[_0x038d('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x4f78c5[_0x038d('0x6d')],'predictiveIntervalHitRate':_0x4f78c5[_0x038d('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x4f78c5[_0x038d('0x6f')],'predictiveIntervalPauses':_0x4f78c5[_0x038d('0x70')],'predictiveIntervalAvailable':_0x4f78c5[_0x038d('0x71')],'predictiveIntervalTotalCalls':_0x4f78c5[_0x038d('0x72')],'message':_0x4f78c5['message'],'originated':_0x4f78c5[_0x038d('0x73')],'erlangCalls':_0x4f78c5[_0x038d('0x74')],'erlangCallToSecond':_0x4f78c5[_0x038d('0x75')],'erlangAbandonmentRate':_0x4f78c5[_0x038d('0x76')],'erlangBusyFactor':_0x4f78c5[_0x038d('0x77')],'startPredictive':_0x4f78c5[_0x038d('0x26')],'startProgressive':_0x4f78c5[_0x038d('0x27')]};if(_0x4f78c5[_0x038d('0x78')]){_0x263a58['Trunk']={'id':_0x4f78c5[_0x038d('0x78')]['id'],'name':_0x4f78c5[_0x038d('0x78')][_0x038d('0x3e')],'active':_0x4f78c5[_0x038d('0x78')][_0x038d('0x79')],'callerid':_0x4f78c5[_0x038d('0x78')][_0x038d('0x7a')]};}if(_0x4f78c5[_0x038d('0x42')]){_0x263a58[_0x038d('0x42')]={'id':_0x4f78c5[_0x038d('0x42')]['id'],'name':_0x4f78c5['Interval'][_0x038d('0x3e')]};}var _0x27d81e=md5(JSON['stringify'](_0x263a58));if(_0x4f78c5[_0x038d('0x3')]!==_0x27d81e){_0x4f78c5[_0x038d('0x3')]=_0x27d81e;emit(util[_0x038d('0x7b')](_0x038d('0x7c'),_0x263a58[_0x038d('0x3e')]),_0x038d('0x7d'),_0x263a58);}}}function emitCampaignSummary(_0x4e35dd){if(_0x4e35dd['type']==='ivr'){emit(util[_0x038d('0x7b')](_0x038d('0x7e'),_0x4e35dd['name']),_0x038d('0x7f'),_0x4e35dd);}}function checkGetDataPredictive(_0x3d57dc){if(isNotNull(_0x3d57dc)&&!_['isEmpty'](_0x3d57dc)){loggerPredictive[_0x038d('0x80')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x038d('0x80')](_0x038d('0x81'),_0x3d57dc['predictiveIntervalTotalCalls']);loggerPredictive[_0x038d('0x80')](_0x038d('0x82'),_0x3d57dc[_0x038d('0x67')]);loggerPredictive[_0x038d('0x80')](_0x038d('0x83'),_0x3d57dc[_0x038d('0x6b')]);loggerPredictive['info'](_0x038d('0x84'),_0x3d57dc[_0x038d('0x6a')]);loggerPredictive['info'](_0x038d('0x85'),_0x3d57dc[_0x038d('0x68')]);loggerPredictive[_0x038d('0x80')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d57dc[_0x038d('0x69')]);loggerPredictive[_0x038d('0x80')](_0x038d('0x86'));if(_0x3d57dc[_0x038d('0x72')]>0x0){if(!_[_0x038d('0x87')](_0x3d57dc[_0x038d('0x69')])&&_0x3d57dc[_0x038d('0x69')]>0x0){return!![];}loggerPredictive['info'](_0x038d('0x88'));if(!_[_0x038d('0x87')](_0x3d57dc[_0x038d('0x68')])&&_0x3d57dc[_0x038d('0x68')]>0x0){return!![];}loggerPredictive[_0x038d('0x80')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x038d('0x80')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x038d('0x80')](_0x038d('0x89'));}return![];}function mergeDataErlangB(_0x1ee86d){return function(_0x2ef626){loggerPredictive[_0x038d('0x80')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x038d('0x80')](_0x038d('0x8a'),_0x2ef626[_0x038d('0x74')]);loggerPredictive[_0x038d('0x80')](_0x038d('0x8b'),_0x2ef626[_0x038d('0x75')]);loggerPredictive[_0x038d('0x80')](_0x038d('0x8c'),_0x2ef626['erlangAbandonmentRate']);loggerPredictive[_0x038d('0x80')](_0x038d('0x8d'),_0x2ef626[_0x038d('0x77')]);loggerPredictive[_0x038d('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ef626[_0x038d('0x76')]);loggerPredictive[_0x038d('0x80')](_0x038d('0x86'));_[_0x038d('0x8e')](_0x1ee86d,_0x2ef626);};}function getDiff(_0x27bad1){var _0x191438=moment()[_0x038d('0x47')](0x0);var _0x51cce1=moment(_0x27bad1)[_0x038d('0x47')](0x0);return _0x191438[_0x038d('0x48')](_0x51cce1,_0x038d('0x8f'));}function ifInterval(_0x59b2f6,_0x2bb18d){if(_[_0x038d('0x87')](_0x2bb18d)){return![];}return getDiff(_0x2bb18d)<_0x59b2f6*0x3c;}function freeVariablesPredictive(_0x51849b){if(isNotNull(_0x51849b)){if(!_['isUndefined'](_0x51849b[_0x038d('0x27')])){_0x51849b[_0x038d('0x27')]=undefined;loggerPredictive[_0x038d('0x80')](_0x51849b['name'],_0x038d('0x90'));}if(!_['isUndefined'](_0x51849b[_0x038d('0x26')])){_0x51849b['startPredictive']=undefined;loggerPredictive[_0x038d('0x80')](_0x51849b[_0x038d('0x3e')],_0x038d('0x91'));}if(!_[_0x038d('0x87')](_0x51849b['handlePredictive'])){clearInterval(_0x51849b['handlePredictive']);_0x51849b[_0x038d('0x92')]=undefined;loggerPredictive[_0x038d('0x80')](_0x51849b[_0x038d('0x3e')],_0x038d('0x93'));}}}function erlangb(_0x43515a,_0x2a61d8){if(_0x2a61d8===0x0){return 0x0;}var _0x2f2c9d=0x1;for(var _0x2738c8=0x1;_0x2738c8<=_0x2a61d8;_0x2738c8+=0x1){_0x2f2c9d=0x1+_0x2f2c9d*_0x2738c8/_0x43515a;}return 0x1/_0x2f2c9d;}function isVoiceQueueOutbound(_0x1f0fce){return _0x1f0fce==='outbound';}function isNotPreview(_0x215bdf){return _0x215bdf!==_0x038d('0x1d');}function isCampaignIvr(_0x2a86f8){return _0x2a86f8==='ivr';}function getCallerId(_0x2b18e6,_0x31e7e5,_0x768191){if(!_[_0x038d('0x87')](_0x768191)&&typeof _0x768191==='string'&&!_[_0x038d('0x44')](_0x768191)){if(!_['isUndefined'](_0x31e7e5)&&typeof _0x31e7e5==='string'&&!_['isEmpty'](_0x31e7e5)){return util[_0x038d('0x7b')](_0x038d('0x94'),_0x31e7e5,_0x768191);}return util['format'](_0x038d('0x94'),_0x768191,_0x768191);}if(!_['isUndefined'](_0x2b18e6)&&typeof _0x2b18e6==='string'&&!_['isEmpty'](_0x2b18e6)){return _0x2b18e6;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x20c5e3,_0x159364){return function(_0x1c0a04){freeVariablesPredictive(_0x159364);emitVoiceQueueSummary(_0x159364);emitCampaignSummary(_0x159364);loggerSyncQueueSummary[_0x038d('0x95')](_0x20c5e3,util[_0x038d('0x96')](_0x1c0a04,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x155b4f,_0x230d52){return function(_0xf2445){loggerPredictive[_0x038d('0x95')](_0x230d52[_0x038d('0x3e')],_0x155b4f);loggerPredictive['error'](_0xf2445[_0x038d('0x97')]);freeVariablesPredictive(_0x230d52);};}function loggerCatch(_0x1109f4){return function(_0x4fa498){logger[_0x038d('0x95')](_0x1109f4,util[_0x038d('0x96')](_0x4fa498,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2b7e79){return _0x2b7e79&&!_[_0x038d('0x87')](_0x2b7e79)&&_0x2b7e79[_0x038d('0x98')]>0x0;}function decremetOriginate(_0x81be8e){if(!_[_0x038d('0x87')](_0x81be8e)&&_0x81be8e!==null){if(typeof _0x81be8e['originated']!==_0x038d('0x99')){if(_0x81be8e['originated']>0x0){_0x81be8e[_0x038d('0x73')]-=0x1;}else{logger[_0x038d('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x038d('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2d7552,_0xadf9cd,_0x5a341a){if(_0xadf9cd>_0x5a341a){for(var _0x50a0cd=0x0;_0x50a0cd<_0xadf9cd-_0x5a341a;_0x50a0cd+=0x1){decremetOriginate(_0x2d7552);}}}function loggerGetContactDialer(_0x503248,_0x1a9bd3,_0x3602a3){return function(_0x598f08){checkContactLowerLimitOriginate(_0x1a9bd3,_0x3602a3,0x0);logger[_0x038d('0x95')](_0x503248,util[_0x038d('0x96')](_0x598f08,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xea137c){return function(_0x15f1ff){if(isNotNull(_0x15f1ff)&&isNotNull(_0x15f1ff[0x0])){if(_0x15f1ff[0x0][_0x038d('0x9a')]>0x0){_0xea137c[_0x038d('0x3c')]=_0x038d('0x9b');logger['info'](_0x038d('0x9c')+_0xea137c[_0x038d('0x3e')],_0x15f1ff[0x0][_0x038d('0x9a')],_0x038d('0x9d'));}else{_0xea137c['message']=_0x038d('0x9e');logger[_0x038d('0x80')](_0x038d('0x9f')+_0xea137c[_0x038d('0x3e')]);}}};}function notSendMessagesQueue(_0x34eb24){if(_0x34eb24[_0x038d('0xa0')]){freeVariablesPredictive(_0x34eb24);if(_0x34eb24[_0x038d('0x73')]===0x0&&_0x34eb24[_0x038d('0x50')]===0x0&&_0x34eb24[_0x038d('0x54')]===0x0&&(_0x34eb24[_0x038d('0x4d')]||0x0)===0x0){_0x34eb24[_0x038d('0xa0')]=![];_0x34eb24[_0x038d('0x4b')]=0x0;_0x34eb24[_0x038d('0x3c')]=_0x038d('0xa1');loggerSyncQueueSummary[_0x038d('0x95')](_0x038d('0xa2'),_0x34eb24['name'],'is\x20not\x20active');}else{_0x34eb24['message']=_0x038d('0xa3');loggerSyncQueueSummary['error'](_0x038d('0xa2'),_0x34eb24[_0x038d('0x3e')],_0x038d('0xa4'));}emitVoiceQueueSummary(_0x34eb24);}}function notSendMessagesCampaign(_0x136bf9){if(_0x136bf9[_0x038d('0xa0')]){if(_0x136bf9[_0x038d('0x73')]===0x0){_0x136bf9['sendMessageOneNotActive']=![];_0x136bf9[_0x038d('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x038d('0xa5'),_0x136bf9[_0x038d('0x3e')],_0x038d('0xa6'));}else{_0x136bf9[_0x038d('0x3c')]=_0x038d('0xa3');loggerSyncQueueSummary[_0x038d('0x95')](_0x038d('0xa5'),_0x136bf9[_0x038d('0x3e')],_0x038d('0xa4'));}emitCampaignSummary(_0x136bf9);}}function createObjHistory(_0x220d27,_0x3506dd,_0xef6209,_0x5ea0a2,_0x92e8f1){_0x220d27[_0x038d('0x3c')]=_0xef6209;var _0xfbda6d=new Action(_0x220d27,_0x3506dd);var _0x440db5=new History(_0xfbda6d);_0x440db5[_0x038d('0xa7')]=_0x5ea0a2;_0x440db5[_0x038d('0xa8')]=_0x92e8f1;_0x440db5['endtime']=_0xfbda6d[_0x038d('0xa9')];return _0x440db5;}Dialer[_0x038d('0xaa')][_0x038d('0x3b')]=function(){var _0x5b863f=this;setInterval(function(){_0x5b863f[_0x038d('0xab')](_0x5b863f[_0x038d('0x24')],'[uniqueid]');_0x5b863f[_0x038d('0xab')](_0x5b863f[_0x038d('0xac')],'[actions]');},0x32c8);};Dialer[_0x038d('0xaa')]['clearZombieChannels']=function(_0x4aa2e9,_0x3d7fa7){var _0x357707=this;for(var _0x24b7b2 in _0x4aa2e9){if(typeof _0x4aa2e9[_0x24b7b2]!==_0x038d('0x99')){this[_0x038d('0x1c')][_0x038d('0xad')](function(){if(!_[_0x038d('0xae')](_0x4aa2e9[_0x24b7b2])){return ami[_0x038d('0xaf')]({'action':_0x038d('0xb0'),'channel':_0x4aa2e9[_0x24b7b2][_0x038d('0xb1')]})[_0x038d('0xb2')](function(_0x4a5ff1){if(_0x4a5ff1['message']===_0x038d('0xb3')){setTimeout(function(){if(_0x4aa2e9[_0x24b7b2]&&_0x4aa2e9[_0x24b7b2]['type']!==_0x038d('0xb4')){_0x357707[_0x038d('0xb5')](_0x357707[_0x038d('0x1e')][_0x4aa2e9[_0x24b7b2]['queue']]);logger[_0x038d('0x95')](_0x038d('0xb6'),_0x3d7fa7,_0x24b7b2,_0x4aa2e9[_0x24b7b2][_0x038d('0xb7')]);delete _0x4aa2e9[_0x24b7b2];}if(_0x4aa2e9[_0x24b7b2]&&_0x4aa2e9[_0x24b7b2][_0x038d('0x49')]==='ivr'){_0x357707['updateOriginated'](_0x357707[_0x038d('0x1f')][_0x4aa2e9[_0x24b7b2][_0x038d('0xb7')]]);logger[_0x038d('0x95')]('[Dialer][checkChannel][ivr]',_0x3d7fa7,_0x24b7b2,_0x4aa2e9[_0x24b7b2][_0x038d('0xb7')]);delete _0x4aa2e9[_0x24b7b2];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x2e4663){return BPromise[_0x038d('0xb8')]()['then'](cmHopper[_0x038d('0xb9')](_0x2e4663))[_0x038d('0xb2')](loggerCatch(_0x038d('0xba')));};Dialer[_0x038d('0xaa')][_0x038d('0xbb')]=function(_0x4daa1d){return BPromise['resolve']()['then'](cmHopperBlack[_0x038d('0xbb')](_0x4daa1d))['catch'](loggerCatch(_0x038d('0xbc')));};Dialer[_0x038d('0xaa')]['checkIsBlackListIvr']=function(_0xad0cbc){return BPromise[_0x038d('0xb8')]()['then'](cmHopperBlack[_0x038d('0xbd')](_0xad0cbc))[_0x038d('0xb2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x038d('0xaa')][_0x038d('0xbe')]=function(_0x5d439b){return BPromise['resolve']()[_0x038d('0xbf')](cmHopperHistory[_0x038d('0xc0')](_0x5d439b))[_0x038d('0xb2')](loggerCatch(_0x038d('0xc1')));};Dialer[_0x038d('0xaa')][_0x038d('0xc2')]=function(_0x11917a){return BPromise[_0x038d('0xb8')]()[_0x038d('0xbf')](cmHopper['rescheduleContact'](_0x11917a))[_0x038d('0xb2')](loggerCatch(_0x038d('0xc3')));};Dialer['prototype'][_0x038d('0xc4')]=function(_0xb65277,_0x324bd3,_0x3df312){return BPromise[_0x038d('0xb8')]()['then'](cmHopper[_0x038d('0xc4')](_0xb65277,_0x324bd3,_0x3df312))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x038d('0xaa')][_0x038d('0xc5')]=function(_0x358475,_0x46ca4e,_0x1c1910,_0xab4bb9,_0x8b1431){return BPromise[_0x038d('0xb8')]()['then'](cmHopper[_0x038d('0xc5')](_0x358475,_0x46ca4e,_0x1c1910,_0xab4bb9))[_0x038d('0xb2')](function(_0x55fa8d){_0x8b1431[_0x038d('0xc6')]-=_0x1c1910;_0x8b1431[_0x038d('0xc6')]=_0x8b1431[_0x038d('0xc6')]>0x0?_0x8b1431[_0x038d('0xc6')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x55fa8d);});};Dialer[_0x038d('0xaa')]['getContactDialerIvr']=function(_0x27ebc5,_0x50d824,_0x328a95,_0x1d14ca){return BPromise[_0x038d('0xb8')]()[_0x038d('0xbf')](cmHopper['getContactDialerIvr'](_0x27ebc5,_0x50d824,_0x328a95))[_0x038d('0xb2')](function(_0x13179a){_0x1d14ca[_0x038d('0xc6')]-=_0x50d824;_0x1d14ca[_0x038d('0xc6')]=_0x1d14ca[_0x038d('0xc6')]>0x0?_0x1d14ca[_0x038d('0xc6')]:0x0;loggerCatch(_0x038d('0xc7'))(_0x13179a);});};Dialer[_0x038d('0xaa')][_0x038d('0xc8')]=function(_0x1583ac){return BPromise[_0x038d('0xb8')]()[_0x038d('0xbf')](voiceQueueRt[_0x038d('0xc8')](_0x1583ac))[_0x038d('0xb2')](loggerCatch(_0x038d('0xc9')));};Dialer[_0x038d('0xaa')][_0x038d('0xca')]=function(_0x3c64e5){return BPromise[_0x038d('0xb8')]()[_0x038d('0xbf')](cmHopper[_0x038d('0xca')](_0x3c64e5))['catch'](loggerCatch(_0x038d('0xcb')));};Dialer[_0x038d('0xaa')][_0x038d('0xcc')]=function(_0x4ded3d){return BPromise['resolve']()[_0x038d('0xbf')](cmHopperHistory[_0x038d('0xcc')](_0x4ded3d))['catch'](loggerCatch(_0x038d('0xcd')));};Dialer[_0x038d('0xaa')][_0x038d('0xb5')]=function(_0x8be82e){if(!_[_0x038d('0x87')](_0x8be82e)&&_0x8be82e!==null){if(typeof _0x8be82e[_0x038d('0x73')]!==_0x038d('0x99')){if(_0x8be82e['originated']>0x0){_0x8be82e['originated']-=0x1;}else{logger[_0x038d('0x95')](_0x038d('0xce'));}}}else{logger[_0x038d('0x95')](_0x038d('0xcf'));}};Dialer['prototype'][_0x038d('0xd0')]=function(_0x1f04c9,_0x530ed5){var _0x5ad2bb=this;return function(_0x7935cf){_0x5ad2bb[_0x038d('0xb5')](_0x530ed5);logger[_0x038d('0x95')](_0x1f04c9,util[_0x038d('0x96')](_0x7935cf,{'showHidden':![],'depth':null}));};};Dialer[_0x038d('0xaa')][_0x038d('0xd1')]=function(_0x182005,_0x4ee07e,_0x3b2f8f){var _0x4b61a3={'state':0x19,'statedesc':_0x038d('0xd2')};this[_0x038d('0xb5')](_0x4ee07e);this[_0x038d('0xd3')](_[_0x038d('0x8e')](_0x4b61a3,_[_0x038d('0xd4')](_0x3b2f8f,[_0x038d('0xd5'),_0x038d('0xd6'),_0x038d('0xd7'),'VoiceQueueId',_0x038d('0xd8')])),_0x038d('0xd9'),'[emptyContact]');logger['error'](_0x182005);};Dialer[_0x038d('0xaa')]['isSuccess']=function(_0x2f2635){return _0x2f2635===_0x038d('0xda');};Dialer[_0x038d('0xaa')]['isTrunkReachable']=function(_0x20632c){return!_['isUndefined'](_0x20632c)&&_0x20632c&&!_[_0x038d('0x87')](_0x20632c[_0x038d('0x3e')])&&!_[_0x038d('0x87')](_0x20632c[_0x038d('0x79')])&&_0x20632c[_0x038d('0x79')]&&(this['trunks'][util[_0x038d('0x7b')](_0x038d('0xdb'),_0x20632c['name'])][_0x038d('0xb0')]==='reachable'||this[_0x038d('0x21')][util['format'](_0x038d('0xdb'),_0x20632c['name'])][_0x038d('0xb0')]===_0x038d('0xdc'));};Dialer[_0x038d('0xaa')][_0x038d('0xd3')]=function(_0x40f4f6,_0x1d106d,_0x4eb689){this[_0x038d('0xcc')](_0x40f4f6)[_0x038d('0xb2')](loggerCatch(_0x1d106d));this[_0x038d('0xca')](_0x40f4f6)['catch'](loggerCatch(_0x4eb689));};Dialer[_0x038d('0xaa')][_0x038d('0x37')]=function(_0x3b3479){var _0x33f331=this[_0x038d('0x24')][_0x3b3479[_0x038d('0xdd')]];var _0x51bc8e;if(!_[_0x038d('0xae')](_0x3b3479)&&!_['isNil'](_0x3b3479[_0x038d('0xde')])&&!_['isNil'](_0x3b3479[_0x038d('0xde')][_0x038d('0xdf')])&&_0x3b3479[_0x038d('0xe0')]===_0x038d('0xe1')&&_0x33f331){if(_0x33f331[_0x038d('0x49')]!==_0x038d('0xb4')&&this[_0x038d('0x1e')][_0x33f331[_0x038d('0xb7')]][_0x038d('0xe2')]&&_0x3b3479[_0x038d('0xe3')]==='HANGUP'){delete this[_0x038d('0x24')][_0x3b3479[_0x038d('0xdd')]];this[_0x038d('0xb5')](this['voiceQueues'][_0x33f331['queue']]);this['voiceQueues'][_0x33f331[_0x038d('0xb7')]]['outboundAnswerCallsDay']+=0x1;this[_0x038d('0x1e')][_0x33f331[_0x038d('0xb7')]][_0x038d('0x5c')]+=0x1;_0x51bc8e=new Hangup(_0x33f331,_0x3b3479);_0x51bc8e[_0x038d('0xa7')]=0x12;_0x51bc8e[_0x038d('0xa8')]=_0x038d('0xe4');_0x51bc8e[_0x038d('0xe5')]='AMD';ami[_0x038d('0xe6')]('custom:amd',ut['buildObj'](_0x51bc8e,_0x038d('0xe7')));this[_0x038d('0xd3')](_0x51bc8e,_0x038d('0xe8'),_0x038d('0xe9'));}if(_0x33f331[_0x038d('0x49')]!=='ivr'&&this[_0x038d('0x1e')][_0x33f331[_0x038d('0xb7')]][_0x038d('0xe2')]&&_0x3b3479[_0x038d('0xe3')]==='MACHINE'){var _0xca55ed=this;return new BPromise(function(_0xb602b6,_0x27ae4e){delete _0xca55ed[_0x038d('0x24')][_0x3b3479['uniqueid']];_0xca55ed[_0x038d('0xb5')](_0xca55ed['voiceQueues'][_0x33f331[_0x038d('0xb7')]]);_0xca55ed[_0x038d('0x1e')][_0x33f331[_0x038d('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0xca55ed[_0x038d('0x1e')][_0x33f331[_0x038d('0xb7')]][_0x038d('0x5c')]+=0x1;var _0x202657=_0xca55ed['voiceQueues'][_0x33f331['queue']];var _0x22686f=new Hangup(_0x33f331,_0x3b3479);_0x22686f['state']=0x13;_0x22686f['statedesc']=_0x038d('0xea');_0x22686f['membername']='AMD';_0x22686f[_0x038d('0xeb')]+=0x1;_0x22686f[_0x038d('0xec')]+=0x1;_0x22686f[_0x038d('0xe7')]=!![];ami['emit']('custom:amd',ut[_0x038d('0xed')](_0x22686f,_0x038d('0xe7')));_0xca55ed[_0x038d('0xcc')](_0x22686f)[_0x038d('0xb2')](loggerCatch(_0x038d('0xee')));if(_0x22686f[_0x038d('0xef')]+_0x22686f[_0x038d('0xf0')]+_0x22686f[_0x038d('0xf1')]+_0x22686f[_0x038d('0xf2')]+_0x22686f[_0x038d('0xf3')]+_0x22686f[_0x038d('0xf4')]+_0x22686f[_0x038d('0xeb')]+_0x22686f[_0x038d('0xf5')]>=_0x202657[_0x038d('0xf6')]){_0xca55ed[_0x038d('0xf7')](_0x22686f,_0xb602b6,_0x27ae4e,'reason19\x20machine....');}else{if(_0x22686f[_0x038d('0xeb')]>=_0x202657['dialMachineMaxRetry']){_0xca55ed['createStateFinal'](_0x22686f,_0xb602b6,_0x27ae4e,_0x038d('0xf8'));}else{_0xca55ed[_0x038d('0xc2')]({'active':![],'countmachineretry':_0x22686f[_0x038d('0xeb')],'scheduledat':moment()[_0x038d('0xf9')](_0x202657[_0x038d('0xfa')],_0x038d('0xfb'))[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x22686f['ContactId'],'ListId':_0x22686f[_0x038d('0xd6')],'VoiceQueueId':_0x22686f[_0x038d('0xfd')]||undefined,'CampaignId':_0x22686f['CampaignId']||undefined})['catch'](loggerCatch(_0x038d('0xfe')));_0xb602b6({'reschedule':0x1});}}});}if(_0x33f331['type']==='ivr'&&this['campaigns'][_0x33f331[_0x038d('0xb7')]]['dialAMDActive']&&_0x3b3479[_0x038d('0xe3')]===_0x038d('0xff')){delete this[_0x038d('0x24')][_0x3b3479[_0x038d('0xdd')]];this[_0x038d('0xb5')](this['campaigns'][_0x33f331['queue']]);_0x51bc8e=new Hangup(_0x33f331,_0x3b3479);_0x51bc8e['state']=0x12;_0x51bc8e[_0x038d('0xa8')]='HangupInAMD';_0x51bc8e['membername']=_0x038d('0x100');ami[_0x038d('0xe6')](_0x038d('0x101'),ut['buildObj'](_0x51bc8e,_0x038d('0xe7')));this[_0x038d('0xd3')](_0x51bc8e,_0x038d('0x102'),'[syncHangupInAMDIvr]');}if(_0x33f331[_0x038d('0x49')]===_0x038d('0xb4')&&this[_0x038d('0x1f')][_0x33f331[_0x038d('0xb7')]]['dialAMDActive']&&_0x3b3479[_0x038d('0xe3')]===_0x038d('0x103')){var _0xca55ed=this;return new BPromise(function(_0x456d41,_0x4598e5){delete _0xca55ed[_0x038d('0x24')][_0x3b3479[_0x038d('0xdd')]];_0xca55ed[_0x038d('0xb5')](_0xca55ed[_0x038d('0x1f')][_0x33f331[_0x038d('0xb7')]]);_0xca55ed[_0x038d('0x1f')][_0x33f331[_0x038d('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0xca55ed[_0x038d('0x1f')][_0x33f331[_0x038d('0xb7')]][_0x038d('0x5c')]+=0x1;var _0x2a5157=_0xca55ed[_0x038d('0x1f')][_0x33f331[_0x038d('0xb7')]];var _0x1cfaa4=new Hangup(_0x33f331,_0x3b3479);_0x1cfaa4[_0x038d('0xa7')]=0x13;_0x1cfaa4[_0x038d('0xa8')]=_0x038d('0xea');_0x1cfaa4[_0x038d('0xe5')]=_0x038d('0x100');_0x1cfaa4[_0x038d('0xeb')]+=0x1;_0x1cfaa4[_0x038d('0xec')]+=0x1;_0x1cfaa4['amd']=!![];ami[_0x038d('0xe6')](_0x038d('0x101'),ut['buildObj'](_0x1cfaa4,'amd'));_0xca55ed[_0x038d('0xcc')](_0x1cfaa4)[_0x038d('0xb2')](loggerCatch(_0x038d('0xee')));if(_0x1cfaa4[_0x038d('0xef')]+_0x1cfaa4[_0x038d('0xf0')]+_0x1cfaa4[_0x038d('0xf1')]+_0x1cfaa4[_0x038d('0xf2')]+_0x1cfaa4[_0x038d('0xf3')]+_0x1cfaa4['countabandonedretry']+_0x1cfaa4[_0x038d('0xeb')]+_0x1cfaa4['countagentrejectretry']>=_0x2a5157[_0x038d('0xf6')]){_0xca55ed[_0x038d('0xf7')](_0x1cfaa4,_0x456d41,_0x4598e5,_0x038d('0x104'));}else{if(_0x1cfaa4[_0x038d('0xeb')]>=_0x2a5157[_0x038d('0x105')]){_0xca55ed['createStateFinal'](_0x1cfaa4,_0x456d41,_0x4598e5,'reason\x2019\x20machine....');}else{_0xca55ed['rescheduleContact']({'active':![],'countmachineretry':_0x1cfaa4[_0x038d('0xeb')],'scheduledat':moment()[_0x038d('0xf9')](_0x2a5157['dialMachineRetryFrequency'],_0x038d('0xfb'))['format'](_0x038d('0xfc')),'ContactId':_0x1cfaa4[_0x038d('0xd5')],'ListId':_0x1cfaa4[_0x038d('0xd6')],'VoiceQueueId':_0x1cfaa4[_0x038d('0xfd')]||undefined,'CampaignId':_0x1cfaa4[_0x038d('0xd8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x456d41({'reschedule':0x1});}}});}}};Dialer[_0x038d('0xaa')][_0x038d('0x106')]=function(_0x16fb5d){var _0x585818=this[_0x038d('0x24')][_0x16fb5d[_0x038d('0xdd')]];var _0x1576ba=this;var _0x36162f;if(_0x585818&&_0x585818[_0x038d('0x49')]===_0x038d('0xb4')){delete this['uniqueId'][_0x16fb5d[_0x038d('0xdd')]];this[_0x038d('0xb5')](this[_0x038d('0x1f')][_0x585818[_0x038d('0xb7')]]);this[_0x038d('0x1f')][_0x585818[_0x038d('0xb7')]][_0x038d('0x107')]+=0x1;_0x36162f=new Hangup(_0x585818,_0x16fb5d);this[_0x038d('0xcc')](_0x36162f)[_0x038d('0xb2')](loggerCatch(_0x038d('0x108')));this[_0x038d('0xca')](_0x36162f)['catch'](loggerCatch(_0x038d('0x109')));}if(_0x585818&&_0x585818[_0x038d('0x49')]!==_0x038d('0xb4')&&isNotNull(this[_0x038d('0x1e')][_0x585818['queue']][_0x038d('0x10a')])){delete this['uniqueId'][_0x16fb5d[_0x038d('0xdd')]];this[_0x038d('0xb5')](this[_0x038d('0x1e')][_0x585818['queue']]);this[_0x038d('0x1e')][_0x585818[_0x038d('0xb7')]][_0x038d('0x5d')]+=0x1;this[_0x038d('0x1e')][_0x585818[_0x038d('0xb7')]][_0x038d('0x5c')]+=0x1;_0x36162f=new Hangup(_0x585818,_0x16fb5d);_0x36162f[_0x038d('0xa7')]=0x10;_0x36162f['statedesc']=_0x038d('0x10b');_0x36162f['membername']=_0x038d('0x10c');this[_0x038d('0xcc')](_0x36162f)[_0x038d('0xb2')](loggerCatch(_0x038d('0x108')));this[_0x038d('0xca')](_0x36162f)[_0x038d('0xb2')](loggerCatch(_0x038d('0x109')));}if(_0x585818&&_0x585818[_0x038d('0x49')]!==_0x038d('0xb4')&&!isNotNull(this[_0x038d('0x1e')][_0x585818['queue']]['dialQueueProject'])){delete this[_0x038d('0x24')][_0x16fb5d['uniqueid']];this['updateOriginated'](this[_0x038d('0x1e')][_0x585818['queue']]);this[_0x038d('0x1e')][_0x585818[_0x038d('0xb7')]][_0x038d('0x66')]+=0x1;_0x36162f=new Hangup(_0x585818,_0x16fb5d);_0x36162f[_0x038d('0xa7')]=0xc;_0x36162f[_0x038d('0xa8')]=_0x16fb5d['cause-txt'];_0x36162f['membername']=_0x038d('0x10d');this['createHistory'](_0x36162f)[_0x038d('0xb2')](loggerCatch(_0x038d('0x108')));this['moveContactManagedDialer'](_0x36162f)[_0x038d('0xb2')](loggerCatch(_0x038d('0x109')));}};Dialer[_0x038d('0xaa')][_0x038d('0x32')]=function(_0x24ce9e){var _0x17107b=this[_0x038d('0x24')][_0x24ce9e[_0x038d('0xdd')]];var _0x50a46d=this;if(this[_0x038d('0x1e')][_0x24ce9e[_0x038d('0xb7')]]){if(_0x17107b&&_0x17107b[_0x038d('0x49')]!==_0x038d('0xb4')){delete this[_0x038d('0x24')][_0x24ce9e[_0x038d('0xdd')]];this['voiceQueues'][_0x24ce9e[_0x038d('0xb7')]][_0x038d('0x5d')]+=0x1;var _0x2af363=new AgentComplete(_0x17107b,_0x24ce9e);if(_0x24ce9e[_0x038d('0x10e')]===_0x038d('0x10f')){_0x2af363[_0x038d('0x110')]=this[_0x038d('0x1e')][_0x24ce9e[_0x038d('0xb7')]][_0x038d('0x111')]&&this[_0x038d('0x1e')][_0x24ce9e[_0x038d('0xb7')]][_0x038d('0x112')]?moment()[_0x038d('0x7b')](_0x038d('0xfc')):undefined;}this[_0x038d('0xcc')](_0x2af363)[_0x038d('0xb2')](loggerCatch(_0x038d('0x113')));this['moveContactManagedDialer'](_0x2af363)[_0x038d('0xb2')](loggerCatch(_0x038d('0x114')));}}};Dialer[_0x038d('0xaa')][_0x038d('0x2b')]=function(_0xd93609){if(this[_0x038d('0x1e')][_0xd93609[_0x038d('0xb7')]]){if(this['uniqueId'][_0xd93609['uniqueid']]&&this['uniqueId'][_0xd93609[_0x038d('0xdd')]][_0x038d('0x49')]!==_0x038d('0xb4')){this[_0x038d('0xb5')](this[_0x038d('0x1e')][_0xd93609[_0x038d('0xb7')]]);this[_0x038d('0x24')][_0xd93609['uniqueid']][_0x038d('0x115')]=moment()[_0x038d('0x7b')](_0x038d('0xfc'));}}};Dialer[_0x038d('0xaa')][_0x038d('0x116')]=function(_0x39fd2a){this[_0x038d('0xcc')](_0x39fd2a)[_0x038d('0xb2')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x038d('0xca')](_0x39fd2a)[_0x038d('0xb2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x038d('0xaa')][_0x038d('0x2d')]=function(_0x1d14ba){var _0x4f8062=this[_0x038d('0x24')][_0x1d14ba['uniqueid']];var _0x229947=this;if(this[_0x038d('0x1e')][_0x1d14ba['queue']]){if(_0x4f8062&&_0x4f8062['type']!==_0x038d('0xb4')){delete this[_0x038d('0x24')][_0x1d14ba[_0x038d('0xdd')]];this[_0x038d('0xb5')](this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]]);_0x4f8062[_0x038d('0x117')]=moment()[_0x038d('0x7b')](_0x038d('0xfc'));var _0x1d8c00=new QueueCallerAbandon(_0x4f8062,_0x1d14ba);if(getSeconds(_0x4f8062['droptime'],_0x4f8062[_0x038d('0x118')])>=_0x4f8062[_0x038d('0x119')]){this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x6b')]+=0x1;this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1d8c00['state']=0xa;_0x1d8c00[_0x038d('0xa8')]=_0x038d('0x11a');_0x1d8c00[_0x038d('0x11b')]='TIMEOUT';_0x1d8c00[_0x038d('0x110')]=this['voiceQueues'][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x111')]?moment()['format'](_0x038d('0xfc')):undefined;_0x1d8c00[_0x038d('0xf3')]+=0x1;_0x1d8c00['countglobal']+=0x1;if(_0x1d8c00['countdropretry']>=this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x11c')]){this[_0x038d('0x116')](_0x1d8c00);}else{this[_0x038d('0xc2')]({'active':![],'countdropretry':_0x1d8c00[_0x038d('0xf3')],'scheduledat':moment()[_0x038d('0xf9')](this['voiceQueues'][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x11d')],'minutes')['format'](_0x038d('0xfc')),'ContactId':_0x4f8062[_0x038d('0xd5')],'ListId':_0x4f8062['ListId'],'VoiceQueueId':_0x4f8062['VoiceQueueId']||undefined,'CampaignId':_0x4f8062[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x11e')));var _0x422213=new History(_0x1d8c00);_0x422213[_0x038d('0xa7')]=0xa;_0x422213[_0x038d('0xa8')]=_0x038d('0x11a');_0x422213[_0x038d('0xa9')]=moment()[_0x038d('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x422213[_0x038d('0x11f')]=_0x422213['starttime'];_0x422213[_0x038d('0x120')]=_0x1d8c00[_0x038d('0x120')];_0x422213[_0x038d('0x121')]=_0x1d8c00[_0x038d('0x121')];this[_0x038d('0xcc')](_0x422213)[_0x038d('0xb2')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x6a')]+=0x1;this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x62')]+=0x1;_0x1d8c00[_0x038d('0xa7')]=0xb;_0x1d8c00[_0x038d('0xa8')]=_0x038d('0x122');_0x1d8c00['dropreason']=_0x038d('0x123');_0x1d8c00['countabandonedretry']+=0x1;_0x1d8c00[_0x038d('0xec')]+=0x1;if(_0x1d8c00[_0x038d('0xf4')]>=this[_0x038d('0x1e')][_0x1d14ba[_0x038d('0xb7')]][_0x038d('0x124')]){this['queueCallerAbandonCreateState'](_0x1d8c00);}else{this[_0x038d('0xc2')]({'active':![],'countabandonedretry':_0x1d8c00[_0x038d('0xf4')],'scheduledat':moment()[_0x038d('0xf9')](this['voiceQueues'][_0x1d14ba['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x4f8062[_0x038d('0xd5')],'ListId':_0x4f8062[_0x038d('0xd6')],'VoiceQueueId':_0x4f8062[_0x038d('0xfd')]||undefined,'CampaignId':_0x4f8062[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x125')));var _0x422213=new History(_0x1d8c00);_0x422213[_0x038d('0xa7')]=0xb;_0x422213[_0x038d('0xa8')]=_0x038d('0x122');_0x422213['starttime']=moment()[_0x038d('0x7b')](_0x038d('0xfc'));_0x422213[_0x038d('0x11f')]=_0x422213[_0x038d('0xa9')];_0x422213['calleridname']=_0x1d8c00[_0x038d('0x120')];_0x422213['calleridnum']=_0x1d8c00['calleridnum'];this[_0x038d('0xcc')](_0x422213)[_0x038d('0xb2')](loggerCatch(_0x038d('0x126')));}}}}};Dialer[_0x038d('0xaa')][_0x038d('0x35')]=function(_0x17b4f3){if(this[_0x038d('0xac')][_0x17b4f3[_0x038d('0xdd')]]){this[_0x038d('0xac')][_0x17b4f3[_0x038d('0xdd')]][_0x038d('0xb1')]=_0x17b4f3[_0x038d('0xb1')];}if(this['uniqueId'][_0x17b4f3[_0x038d('0xdd')]]){this[_0x038d('0x24')][_0x17b4f3[_0x038d('0xdd')]][_0x038d('0xb1')]=_0x17b4f3['channel'];}};Dialer['prototype'][_0x038d('0x127')]=function(_0x1f62f7){if(strategy[this[_0x038d('0x1e')][this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]][_0x038d('0xb7')]][_0x038d('0x129')]]===_0x038d('0x12a')){if(this['actions'][_0x1f62f7[_0x038d('0x128')]]&&_[_0x038d('0xae')](this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]][_0x038d('0x12b')])&&_0x1f62f7[_0x038d('0xb0')]==='1'&&_0x1f62f7[_0x038d('0x12c')]==='0'){if(this[_0x038d('0x20')][_0x1f62f7[_0x038d('0x12d')]]){if(!this[_0x038d('0x20')][_0x1f62f7[_0x038d('0x12d')]][_0x038d('0x12b')]){this[_0x038d('0x20')][_0x1f62f7[_0x038d('0x12d')]][_0x038d('0x12b')]=!![];this['actions'][_0x1f62f7['actionid']][_0x038d('0x12b')]=!![];this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]]['stateinterface']=_0x1f62f7['stateinterface'];}}}}else if((strategy[this[_0x038d('0x1e')][this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]][_0x038d('0xb7')]][_0x038d('0x129')]]||_0x038d('0x1a'))===_0x038d('0x1a')){if(this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]]){if(this[_0x038d('0x20')][_0x1f62f7[_0x038d('0x12d')]]){this['actions'][_0x1f62f7[_0x038d('0x128')]][_0x038d('0x12d')]=_0x1f62f7['stateinterface'];if(_[_0x038d('0xae')](this['queueBooked'][this[_0x038d('0xac')][_0x1f62f7['actionid']][_0x038d('0xb7')]])){this[_0x038d('0x29')][this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]][_0x038d('0xb7')]]=[];}this[_0x038d('0x29')][this[_0x038d('0xac')][_0x1f62f7[_0x038d('0x128')]]['queue']][_0x038d('0x12e')](_[_0x038d('0x8e')](_[_0x038d('0xd4')](this[_0x038d('0xac')][_0x1f62f7['actionid']],['idHopper',_0x038d('0x12d')]),{'status':_0x1f62f7[_0x038d('0xb0')],'paused':_0x1f62f7['paused']}));}}}};function unlockQueueStatus(_0x32cb38,_0x43fd0a){setTimeout(function(){if(_[_0x038d('0x87')](_0x32cb38[_0x038d('0x12f')])){loggerBooked[_0x038d('0x95')](_0x038d('0x130'),_0x43fd0a);}_0x32cb38['queueStatusComplete']=!![];loggerBooked[_0x038d('0x80')](_0x038d('0x131'),_0x43fd0a,JSON['stringify'](_['pick'](_0x32cb38,[_0x038d('0x3e'),_0x038d('0x12f')])));},0x1f3);}Dialer[_0x038d('0xaa')][_0x038d('0x3a')]=function(_0x32527d){var _0x52d172=this;var _0xfd7ff=_0x52d172['voiceQueues'][_0x52d172[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]];if(strategy[this[_0x038d('0x1e')][this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]]['queue']][_0x038d('0x129')]]===_0x038d('0x12a')){if(this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]]&&this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0x12d')]){this[_0x038d('0x1d')][_0x038d('0x132')](this[_0x038d('0xac')][_0x32527d['actionid']]['idHopper'],this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0x12d')])[_0x038d('0xb2')](function(_0x1ea553){logger[_0x038d('0x95')](_0x038d('0x133'),util[_0x038d('0x96')](_0x1ea553,{'showHidden':![],'depth':null}));})['finally'](function(){_0x52d172[_0x038d('0xb5')](_0x52d172[_0x038d('0x1e')][_0x52d172[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]]);_0x52d172[_0x038d('0x20')][_0x52d172[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0x12d')]][_0x038d('0x12b')]=![];delete _0x52d172['actions'][_0x32527d[_0x038d('0x128')]];unlockQueueStatus(_0xfd7ff);});}else{this[_0x038d('0xb5')](this['voiceQueues'][this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xb7')]]);this[_0x038d('0xc2')]({'active':![],'ContactId':this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xd5')],'ListId':this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xd6')],'VoiceQueueId':this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xfd')]||undefined,'CampaignId':this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]]['CampaignId']||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x134')));delete this[_0x038d('0xac')][_0x32527d['actionid']];unlockQueueStatus(_0xfd7ff);}}else if((strategy[this[_0x038d('0x1e')][this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]][_0x038d('0x129')]]||_0x038d('0x1a'))===_0x038d('0x1a')){var _0x3619b2;if(this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]]&&!_['isEmpty'](this['queueBooked'][this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xb7')]])){if(this[_0x038d('0x2a')][_0x52d172[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]]){this[_0x038d('0x2a')][_0x52d172[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]]=this[_0x038d('0x2a')][this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]][_0x038d('0xb7')]]?this[_0x038d('0x2a')][this[_0x038d('0xac')][_0x32527d['actionid']]['queue']]:this[_0x038d('0x29')][this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xb7')]]?this[_0x038d('0x29')][this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xb7')]][_0x038d('0x135')]||0x0:0x0;}this['queueBooked'][this[_0x038d('0xac')][_0x32527d['actionid']][_0x038d('0xb7')]][_0x038d('0x135')]=this['queueBookedRR'][this[_0x038d('0xac')][_0x32527d[_0x038d('0x128')]]['queue']];for(var _0x4b4e57=0x0;_0x4b4e57=0x0;})[_0x038d('0xb2')](myreject(_0x322971)));}}else{_0x47eed9[_0x038d('0x12e')](ami[_0x038d('0xaf')]({'action':_0x038d('0x14b'),'command':util['format']('iftime\x20%s,%s',_0x67b5c8,!_[_0x038d('0x87')](config[_0x038d('0x149')][_0x3ec799])?_0x3ec799:'')})[_0x038d('0xbf')](function(_0x948a9e){return _0x948a9e[_0x038d('0x14e')]['indexOf'](_0x038d('0x150'))>=0x0;})[_0x038d('0xb2')](myreject(_0x322971)));}BPromise[_0x038d('0x151')](_0x47eed9)[_0x038d('0xbf')](function(_0x1f3b1f){var _0x4aba38=_[_0x038d('0x152')](_0x1f3b1f);if(_0x4aba38){return _0x4fb40a(_0x4aba38);}else{_0x34b61d[_0x038d('0x3c')]=_0x3524e0?_0x038d('0x153'):_0x038d('0x154');return _0x322971(msgResponse(_0x038d('0x155'),'Failure',_0x038d('0x156')+_0x3524e0+'\x20'+_0x47fa72+_0x038d('0x157')+util[_0x038d('0x96')](_0x67b5c8,{'showHidden':![],'depth':null})+_0x038d('0x158')+_0x3ec799));}})[_0x038d('0xb2')](function(_0x1c3a1b){return _0x322971(msgResponse(_0x038d('0x144'),_0x038d('0x145'),JSON['stringify'](_0x1c3a1b)));});});};Dialer['prototype'][_0x038d('0x159')]=function(_0x3778b1){var _0x1120ec=this;return function(){switch(_0x3778b1[_0x038d('0x57')]){case _0x038d('0x15a'):freeVariablesPredictive(_0x3778b1);_0x1120ec[_0x038d('0x15b')](_0x3778b1,0x1);break;case _0x038d('0x15c'):freeVariablesPredictive(_0x3778b1);_0x1120ec['handlePower'](_0x3778b1,_0x3778b1[_0x038d('0x15d')]);break;case'predictive':_0x1120ec[_0x038d('0x7')](_0x3778b1);break;case _0x038d('0x6'):freeVariablesPredictive(_0x3778b1);_0x1120ec[_0x038d('0x15b')](_0x3778b1,0x1);break;default:freeVariablesPredictive(_0x3778b1);logger[_0x038d('0x95')]('Queue',_0x3778b1['name'],_0x038d('0x15e'));}};};Dialer[_0x038d('0xaa')]['launchHandleIvr']=function(_0x4fa086){var _0x32367a=this;return function(){_0x32367a['handleIvr'](_0x4fa086);};};Dialer['prototype'][_0x038d('0x9')]=function(_0x501294){var _0x42755a=this;if(isNotPreview(_0x501294[_0x038d('0x57')])){if(isVoiceQueueOutbound(_0x501294[_0x038d('0x49')])&&isActive(_0x501294[_0x038d('0x56')])){_0x501294['sendMessageOneNotActive']=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x501294,_0x501294['loggedIn']))[_0x038d('0xbf')](checkIsActive(_0x501294,_0x501294[_0x038d('0x56')]))['then'](checkInterval(_0x501294))[_0x038d('0xbf')](_0x42755a['checkIsTrunkReachable'](_0x501294))[_0x038d('0xbf')](_0x42755a[_0x038d('0x143')](_0x501294[_0x038d('0x15f')],_0x501294['dialTimezone'],_0x501294[_0x038d('0x3e')],_0x501294))['then'](_0x42755a[_0x038d('0x160')](_0x501294[_0x038d('0x42')],_0x501294['dialTimezone'],_0x501294[_0x038d('0x3e')],_0x501294))[_0x038d('0xbf')](_0x42755a[_0x038d('0x159')](_0x501294))[_0x038d('0xb2')](loggerCatchQueueSummary(_0x038d('0x161'),_0x501294));}else{notSendMessagesQueue(_0x501294);}}else{freeVariablesPredictive(_0x501294);}};Dialer[_0x038d('0xaa')][_0x038d('0x162')]=function(){var _0x5c6db0=this;var _0x2443cd;for(var _0x3c6861 in this[_0x038d('0x1f')]){if(typeof this['campaigns'][_0x3c6861]!=='undefined'){_0x2443cd=this[_0x038d('0x1f')][_0x3c6861];if(isCampaignIvr(_0x2443cd[_0x038d('0x49')])&&isActive(_0x2443cd['active'])){_0x2443cd[_0x038d('0xa0')]=!![];BPromise[_0x038d('0xb8')]()[_0x038d('0xbf')](checkIsActive(_0x2443cd,_0x2443cd[_0x038d('0x79')]))['then'](checkInterval(_0x2443cd))[_0x038d('0xbf')](_0x5c6db0[_0x038d('0x163')](_0x2443cd))[_0x038d('0xbf')](_0x5c6db0[_0x038d('0x143')](_0x2443cd['dialGlobalInterval'],_0x2443cd[_0x038d('0x164')],_0x2443cd['name'],_0x2443cd))['then'](_0x5c6db0[_0x038d('0x160')](_0x2443cd[_0x038d('0x42')],_0x2443cd[_0x038d('0x164')],_0x2443cd[_0x038d('0x3e')],_0x2443cd))[_0x038d('0xbf')](_0x5c6db0[_0x038d('0x165')](_0x2443cd))[_0x038d('0xb2')](loggerCatchQueueSummary(_0x038d('0x166'),_0x2443cd));}else{notSendMessagesCampaign(_0x2443cd);}}}};function getCallerIdRandom(_0x347761,_0x54adba){var _0x460270;var _0x2b8b10;var _0x2a06d3;if(_0x54adba<=0x0){_0x54adba=0x1;}_0x460270=new RegExp(_0x038d('0x167')+_0x54adba+'}$');_0x2b8b10=Math['pow'](0xa,_0x54adba-0x1);_0x2a06d3=Math[_0x038d('0x168')](0xa,_0x54adba)-0x1;return util[_0x038d('0x7b')]('%s',_[_0x038d('0x169')](_0x347761,_0x460270,_[_0x038d('0x16a')](_0x2b8b10,_0x2a06d3)));}function extractCalleridName(_0x520fde){var _0x440479=_0x520fde[_0x038d('0x16b')](/"(.*?)"/);return _0x440479?_0x440479[0x1]:_0x520fde;}function extractCalleridNumber(_0x2f2875){var _0xbd2e07=_0x2f2875[_0x038d('0x16b')](/<(.*?)>/);return _0xbd2e07?_0xbd2e07[0x1]:_0x2f2875;}Dialer[_0x038d('0xaa')][_0x038d('0x16c')]=function(_0x1a24a5,_0x52de81){var _0x557242=this;var _0x3bed35=uuid['v4']();this[_0x038d('0xac')][_0x3bed35]=new Action(_0x1a24a5,_0x52de81,_0x3bed35);return new BPromise(function(_0x1d5867,_0x91ddfa){if(_[_0x038d('0x87')](_0x1a24a5)&&typeof _0x1a24a5!=='object'){return _0x91ddfa(msgResponse('originate','Failure',_0x038d('0x16d')));}if(_['isUndefined'](_0x52de81['Contact'][_0x038d('0x16e')])||_0x52de81['Contact'][_0x038d('0x16e')]===null){return _0x91ddfa(msgResponse(_0x038d('0x16f'),_0x038d('0x145'),_0x038d('0x170')));}var _0xe1a5bc={'XMD-CALLERID':_0x557242['actions'][_0x3bed35][_0x038d('0x171')](),'XMD-AGI':_0x1a24a5['dialQueueProject']?util[_0x038d('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1a24a5[_0x038d('0x10a')]):_0x038d('0x172'),'XMD-AGIAFTER':_0x1a24a5['dialQueueProject2']?util['format'](_0x038d('0x173'),ipAgi,_0x1a24a5[_0x038d('0x111')]):_0x038d('0x172'),'XMD-QUEUE':_0x1a24a5[_0x038d('0x49')]===_0x038d('0x4a')?util[_0x038d('0x7b')](_0x038d('0x174'),_0x1a24a5['name'],_0x1a24a5[_0x038d('0x175')]||'',_0x1a24a5[_0x038d('0x112')]?'c':'',_0x1a24a5[_0x038d('0x119')]||0x3):_0x038d('0x172'),'XMD-CONTACTID':_0x52de81[_0x038d('0xd5')],'XMD-CDRTYPE':_0x038d('0x176'),'CALLERID(all)':_0x557242[_0x038d('0xac')][_0x3bed35]['getCaller'](),'XMD-AMD':_0x1a24a5[_0x038d('0xe2')]?_0x038d('0x177'):_0x038d('0x172'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1a24a5[_0x038d('0xe2')]){_0xe1a5bc[_0x038d('0x178')]=_0x1a24a5[_0x038d('0x179')]||0x9c4;_0xe1a5bc[_0x038d('0x17a')]=_0x1a24a5[_0x038d('0x17b')]||0x5dc;_0xe1a5bc[_0x038d('0x17c')]=_0x1a24a5['dialAMDAfterGreetingSilence']||0x320;_0xe1a5bc[_0x038d('0x17d')]=_0x1a24a5['dialAMDTotalAnalysisTime']||0x1388;_0xe1a5bc[_0x038d('0x17e')]=_0x1a24a5['dialAMDMinWordLength']||0x64;_0xe1a5bc[_0x038d('0x17f')]=_0x1a24a5['dialAMDBetweenWordsSilence']||0x32;_0xe1a5bc['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1a24a5[_0x038d('0x180')]||0x3;_0xe1a5bc['XMD-AMDSILENCETHRESHOLD']=_0x1a24a5[_0x038d('0x181')]||0x100;_0xe1a5bc[_0x038d('0x182')]=_0x1a24a5['dialAMDMaximumWordLength']||0x1388;}if(_0x1a24a5[_0x038d('0x49')]===_0x038d('0x4a')){_0xe1a5bc['XMD-VOICEQUEUEID']=_0x52de81['VoiceQueueId'];}else{_0xe1a5bc['XMD-CAMPAIGNID']=_0x52de81[_0x038d('0xd8')];}for(var _0x39ff4c in _0x52de81[_0x038d('0x183')]){if(typeof _0x52de81[_0x038d('0x183')][_0x39ff4c]!==_0x038d('0x99')){if(isNotNull(_0x52de81['Contact'][_0x39ff4c])&&_0x39ff4c!=='id'&&_0x39ff4c!==_0x038d('0x184')&&_0x39ff4c!==_0x038d('0x185')&&_0x39ff4c!==_0x038d('0x186')){_0xe1a5bc[util['format']('%s%s',_0x038d('0x187'),_[_0x038d('0x188')](_0x39ff4c))]=_0x52de81['Contact'][_0x39ff4c];}}}var _0x385b0a=_0x557242[_0x038d('0x141')](_0x1a24a5[_0x038d('0x78')])?getCallerId(_0x1a24a5[_0x038d('0x78')]['callerid'],_0x1a24a5[_0x038d('0x58')],_0x1a24a5[_0x038d('0x189')]>0x0?getCallerIdRandom(_0x1a24a5[_0x038d('0x59')],_0x1a24a5[_0x038d('0x189')]):_0x1a24a5[_0x038d('0x59')]):getCallerId(_[_0x038d('0xae')](_0x1a24a5[_0x038d('0x142')])?_0x1a24a5[_0x038d('0x78')]['callerid']:_0x1a24a5[_0x038d('0x142')][_0x038d('0x7a')],_0x1a24a5[_0x038d('0x58')],_0x1a24a5['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1a24a5[_0x038d('0x59')],_0x1a24a5[_0x038d('0x189')]):_0x1a24a5[_0x038d('0x59')]);if(_0x385b0a){_0xe1a5bc[_0x038d('0x18a')]=_0x557242[_0x038d('0xac')][_0x3bed35][_0x038d('0x18b')]=extractCalleridName(_0x385b0a);_0xe1a5bc[_0x038d('0x18c')]=_0x557242['actions'][_0x3bed35][_0x038d('0x18d')]=extractCalleridNumber(_0x385b0a);}return ami['Action']({'actionid':_0x3bed35,'action':'originate','channel':_0x557242[_0x038d('0x141')](_0x1a24a5[_0x038d('0x78')])?util['format'](_0x038d('0x18e'),_0x1a24a5[_0x038d('0x78')][_0x038d('0x3e')],isNotNull(_0x1a24a5[_0x038d('0x5b')])?_0x1a24a5['dialPrefix'][_0x038d('0x18f')]()||'':'',_0x1a24a5[_0x038d('0x190')]>0x0?_0x52de81[_0x038d('0x183')][_0x038d('0x16e')][_0x038d('0x191')](_0x1a24a5[_0x038d('0x190')]):_0x52de81[_0x038d('0x183')][_0x038d('0x16e')]):util[_0x038d('0x7b')](_0x038d('0x18e'),_[_0x038d('0xae')](_0x1a24a5[_0x038d('0x142')])?_0x1a24a5['Trunk'][_0x038d('0x3e')]:_0x1a24a5[_0x038d('0x142')][_0x038d('0x3e')],isNotNull(_0x1a24a5['dialPrefix'])?_0x1a24a5['dialPrefix'][_0x038d('0x18f')]()||'':'',_0x1a24a5['dialCutDigit']>0x0?_0x52de81[_0x038d('0x183')][_0x038d('0x16e')][_0x038d('0x191')](_0x1a24a5['dialCutDigit']):_0x52de81['Contact'][_0x038d('0x16e')]),'callerid':_0x385b0a,'Exten':'xcally-motion-dialer','Context':_0x038d('0x192'),'Priority':'1','variable':_0xe1a5bc,'timeout':(_0x1a24a5[_0x038d('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3bed35})[_0x038d('0xbf')](function(_0xa38583){return _0x1d5867(_0xa38583);})[_0x038d('0xb2')](function(_0x32ffb5){_0x1a24a5['outboundOriginateFailureCallsDay']+=0x1;var _0x2958fc=new History(_0x557242[_0x038d('0xac')][_0x3bed35]);logger[_0x038d('0x95')](util['format'](_0x038d('0x193'),JSON[_0x038d('0x46')](_0x32ffb5)));_0x2958fc['state']=0xe;_0x2958fc[_0x038d('0xa8')]=_0x038d('0x194');_0x2958fc['starttime']=moment()['format'](_0x038d('0xfc'));_0x2958fc['endtime']=_0x2958fc[_0x038d('0xa9')];_0x557242['createHistory'](_0x2958fc)[_0x038d('0xb2')](loggerCatch(_0x038d('0x195')));_0x557242[_0x038d('0xca')](_0x2958fc)[_0x038d('0xb2')](loggerCatch(_0x038d('0x195')))[_0x038d('0x196')](function(){delete _0x557242[_0x038d('0xac')][_0x3bed35];return _0x91ddfa(msgResponse(_0x038d('0x16f'),'Error',_0x038d('0x197')));});});});};Dialer[_0x038d('0xaa')][_0x038d('0x2f')]=function(_0x197df7){var _0x581530=this[_0x038d('0xac')][_0x197df7[_0x038d('0x128')]];if(_0x581530){delete this[_0x038d('0xac')][_0x197df7[_0x038d('0x128')]];_0x581530[_0x038d('0x118')]=moment()[_0x038d('0x7b')](_0x038d('0xfc'));var _0x432bb8=_0x581530[_0x038d('0x49')]===_0x038d('0xb4')?this[_0x038d('0x1f')][_0x581530['queue']]:this[_0x038d('0x1e')][_0x581530[_0x038d('0x198')]()];if(!this['isSuccess'](_0x197df7[_0x038d('0x199')])){this[_0x038d('0xb5')](_0x432bb8);return this['callProgressDetecting'](_0x581530,_0x432bb8,_0x197df7)[_0x038d('0xb2')](loggerCatch(_0x038d('0x19a')));}this['uniqueId'][_0x197df7[_0x038d('0xdd')]]=_0x581530;}};Dialer[_0x038d('0xaa')]['checkRetriveMax']=function(_0xd12aaa,_0x2e8058,_0x22eacc){var _0x131985=new History(_0x2e8058);if(_0x131985[_0x038d('0xef')]+_0x131985['countcongestionretry']+_0x131985[_0x038d('0xf1')]+_0x131985[_0x038d('0xf2')]+_0x131985[_0x038d('0xf3')]+_0x131985[_0x038d('0xf4')]+_0x131985['countmachineretry']+_0x131985['countagentrejectretry']>=_0x22eacc['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xd12aaa){case 0x3:if(_0x131985[_0x038d('0xf1')]>=_0x22eacc[_0x038d('0x19b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x131985[_0x038d('0xf1')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x19c')],_0x038d('0xfb'))[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x131985[_0x038d('0xef')]>=_0x22eacc[_0x038d('0x19d')]-0x1){return!![];}this[_0x038d('0xc2')]({'active':![],'countbusyretry':_0x131985['countbusyretry']+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x19e')],_0x038d('0xfb'))[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x19f')));break;case 0x8:if(_0x131985[_0x038d('0xf0')]>=_0x22eacc[_0x038d('0x1a0')]-0x1){return!![];}this[_0x038d('0xc2')]({'active':![],'countcongestionretry':_0x131985[_0x038d('0xf0')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x1a1')],_0x038d('0xfb'))[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985['VoiceQueueId']||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x1a2')));break;case 0x0:if(_0x131985['countnosuchnumberretry']>=_0x22eacc[_0x038d('0x1a3')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x131985[_0x038d('0xf2')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x1a4')],_0x038d('0xfb'))['format'](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x1a5')));}break;case 0xa:if(_0x131985['countdropretry']>=_0x22eacc[_0x038d('0x11c')]-0x1){return!![];}this[_0x038d('0xc2')]({'active':![],'countdropretry':_0x131985[_0x038d('0xf3')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x11d')],_0x038d('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985['CampaignId']||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x11e')));break;case 0xb:if(_0x131985[_0x038d('0xf4')]>=_0x22eacc[_0x038d('0x124')]-0x1){return!![];}this[_0x038d('0xc2')]({'active':![],'countabandonedretry':_0x131985[_0x038d('0xf4')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x1a6')],_0x038d('0xfb'))[_0x038d('0x7b')](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985['ListId'],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})['catch'](loggerCatch(_0x038d('0x125')));break;case 0x13:if(_0x131985[_0x038d('0xeb')]>=_0x22eacc[_0x038d('0x105')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x131985[_0x038d('0xeb')]+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0xfa')],'minutes')['format'](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985['VoiceQueueId']||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x131985[_0x038d('0xf5')]>=_0x22eacc[_0x038d('0x1a7')]-0x1){return!![];}this[_0x038d('0xc2')]({'active':![],'countagentrejectretry':_0x131985['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x038d('0xf9')](_0x22eacc[_0x038d('0x1a8')],_0x038d('0xfb'))['format'](_0x038d('0xfc')),'ContactId':_0x131985[_0x038d('0xd5')],'ListId':_0x131985[_0x038d('0xd6')],'VoiceQueueId':_0x131985[_0x038d('0xfd')]||undefined,'CampaignId':_0x131985[_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x038d('0x1a9')]=function(_0x434d45,_0x5479c2,_0x4faca2){var _0x359dc7=this;var _0x189386=new History(_0x434d45);return new BPromise(function(_0x48de94,_0x13e2cc){if(_[_0x038d('0x87')](_0x5479c2)&&typeof _0x5479c2!==_0x038d('0x1aa')){return _0x13e2cc(msgResponse(_0x038d('0x1ab'),'Failure',_0x038d('0x1ac')));}if(_[_0x038d('0x87')](_0x4faca2)&&typeof _0x4faca2!==_0x038d('0x1aa')){return _0x13e2cc(msgResponse(_0x038d('0x1ab'),_0x038d('0x145'),'evt\x20is\x20undefine'));}switch(_0x4faca2[_0x038d('0x10e')]){case'0':_0x5479c2[_0x038d('0x1ad')]+=0x1;_0x189386[_0x038d('0xa7')]=0x0;_0x189386[_0x038d('0xa8')]=_0x038d('0x1ae');_0x189386[_0x038d('0xf2')]+=0x1;_0x189386['countglobal']+=0x1;ami[_0x038d('0xe6')]('custom:agentnosuchnumber',ut[_0x038d('0xed')](_0x434d45,_0x038d('0x1af')));_0x359dc7[_0x038d('0xcc')](_0x189386)['catch'](loggerCatch(_0x038d('0xee')));if(_0x359dc7[_0x038d('0x1b0')](0x0,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xf2')]>=_0x5479c2[_0x038d('0x1a3')]){_0x359dc7[_0x038d('0x1b1')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1b2'));}else{_0x359dc7['stateGlobal'](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1b2'));}}break;case'3':_0x5479c2[_0x038d('0x64')]+=0x1;_0x189386[_0x038d('0xa7')]=0x3;_0x189386[_0x038d('0xa8')]=_0x038d('0x1b3');_0x189386[_0x038d('0xf1')]+=0x1;_0x189386[_0x038d('0xec')]+=0x1;ami['emit'](_0x038d('0x1b4'),ut['buildObj'](_0x434d45,_0x038d('0x1b5')));_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x359dc7[_0x038d('0x1b0')](0x3,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xf1')]>=_0x5479c2[_0x038d('0x19b')]){_0x359dc7['createStateFinal'](_0x189386,_0x48de94,_0x13e2cc,'reason\x203\x20ringing\x20no\x20answer');}else{_0x359dc7[_0x038d('0xf7')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1b6'));}}break;case'5':_0x5479c2['outboundBusyCallsDay']+=0x1;_0x189386['state']=0x5;_0x189386['statedesc']=_0x038d('0x1b7');_0x189386[_0x038d('0xef')]+=0x1;_0x189386[_0x038d('0xec')]+=0x1;ami[_0x038d('0xe6')](_0x038d('0x1b8'),ut['buildObj'](_0x434d45,_0x038d('0x1b9')));_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x359dc7[_0x038d('0x1b0')](0x5,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xef')]>=_0x5479c2[_0x038d('0x19d')]){_0x359dc7[_0x038d('0x1b1')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1ba'));}else{_0x359dc7[_0x038d('0xf7')](_0x189386,_0x48de94,_0x13e2cc,'reason\x205\x20busy');}}break;case'8':_0x5479c2['outboundCongestionCallsDay']+=0x1;_0x189386[_0x038d('0xa7')]=0x8;_0x189386[_0x038d('0xa8')]='Congestion';_0x189386['countcongestionretry']+=0x1;_0x189386[_0x038d('0xec')]+=0x1;ami['emit'](_0x038d('0x1bb'),ut[_0x038d('0xed')](_0x434d45,'congestion'));_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch(_0x038d('0x1bc')));if(_0x359dc7[_0x038d('0x1b0')](0x8,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xf0')]>=_0x5479c2[_0x038d('0x1a0')]){_0x359dc7[_0x038d('0x1b1')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1bd'));}else{_0x359dc7['stateGlobal'](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1bd'));}}break;case'11':_0x5479c2[_0x038d('0x1be')]+=0x1;_0x189386['state']=0xb;_0x189386['statedesc']=_0x038d('0x122');_0x189386['countabandonedretry']+=0x1;_0x189386['countglobal']+=0x1;_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x359dc7[_0x038d('0x1b0')](0xb,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xf4')]>=_0x5479c2[_0x038d('0x124')]){_0x359dc7[_0x038d('0x1b1')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1bf'));}else{_0x359dc7['stateGlobal'](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1bf'));}}break;case'20':_0x5479c2[_0x038d('0x1c0')]+=0x1;_0x189386['state']=0x14;_0x189386['statedesc']=_0x038d('0x1c1');_0x189386[_0x038d('0xf5')]+=0x1;_0x189386['countglobal']+=0x1;ami['emit'](_0x038d('0x1c2'),ut[_0x038d('0xed')](_0x434d45,_0x038d('0x1c3')));_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch(_0x038d('0x1c4')));if(_0x359dc7[_0x038d('0x1b0')](0x14,_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xf5')]>=_0x5479c2[_0x038d('0x1a7')]){_0x359dc7[_0x038d('0x1b1')](_0x189386,_0x48de94,_0x13e2cc,'reason\x2020\x20agentreject');}else{_0x359dc7[_0x038d('0xf7')](_0x189386,_0x48de94,_0x13e2cc,_0x038d('0x1c5'));}}break;default:_0x5479c2[_0x038d('0x66')]+=0x1;_0x189386[_0x038d('0xa7')]=0xc;_0x189386[_0x038d('0xa8')]=_0x4faca2['reason'];_0x359dc7[_0x038d('0xcc')](_0x189386)[_0x038d('0xb2')](loggerCatch(_0x038d('0x1c6')));if(_0x359dc7[_0x038d('0x1b0')](_0x4faca2['reason'],_0x434d45,_0x5479c2)){if(_0x189386[_0x038d('0xef')]+_0x189386['countcongestionretry']+_0x189386[_0x038d('0xf1')]+_0x189386[_0x038d('0xf2')]+_0x189386[_0x038d('0xf3')]+_0x189386[_0x038d('0xf4')]+_0x189386['countmachineretry']+_0x189386[_0x038d('0xf5')]>=_0x5479c2['dialGlobalMaxRetry']){_0x359dc7['stateGlobal'](_0x189386,_0x48de94,_0x13e2cc,_0x4faca2['reason']);}else{_0x359dc7['createStateFinal'](_0x189386,_0x48de94,_0x13e2cc,_0x4faca2[_0x038d('0x10e')]);}}}});};Dialer[_0x038d('0xaa')][_0x038d('0xf7')]=function(_0xb34003,_0x587d39,_0x2b068d,_0xb7fd14){var _0x4ae5df=new Final(_0xb34003);_0x4ae5df['state']=0xf;_0x4ae5df[_0x038d('0xa8')]=_0x038d('0x1c7');this[_0x038d('0x1b1')](_0x4ae5df,_0x587d39,_0x2b068d,_0xb7fd14);};Dialer[_0x038d('0xaa')][_0x038d('0x1b1')]=function(_0xed7dfb,_0x4fd47e,_0x875f3d,_0x402a91){this[_0x038d('0xca')](_0xed7dfb)[_0x038d('0xbf')](function(){return _0x4fd47e(msgResponse(_0x038d('0x1ab'),_0x038d('0xda'),_0x402a91));})[_0x038d('0xb2')](function(){return _0x875f3d(msgResponse(_0x038d('0x1c8'),_0x038d('0x145'),'contact\x20not\x20moved'));});};Dialer[_0x038d('0xaa')][_0x038d('0x7')]=function(_0x17f34d){var _0x14316e=_0x17f34d[_0x038d('0x1c9')]/0x64;var _0x5bf76f=_0x17f34d[_0x038d('0x63')]/(_0x17f34d['outboundDropCallsDayTimeout']+_0x17f34d[_0x038d('0x5d')]);var _0x3068ac=Math[_0x038d('0x1ca')](_0x17f34d[_0x038d('0x71')]*(_0x17f34d[_0x038d('0x1cb')]/0x64));var _0x7c3103=Math[_0x038d('0x1ca')](_0x17f34d[_0x038d('0x71')]*(_0x17f34d['predictiveIntervalMinThreshold']/0x64));var _0x59cb53=_0x17f34d['available']+_0x17f34d[_0x038d('0x50')];var _0x2880ca=Math['floor'](_0x17f34d[_0x038d('0x74')]*_0x17f34d[_0x038d('0x76')]*_0x17f34d['predictiveIntervalHitRate']*_0x17f34d['predictiveIntervalMultiplicativeFactor']);if(_[_0x038d('0x87')](_0x17f34d[_0x038d('0x27')])){if(!_[_0x038d('0x87')](_0x17f34d[_0x038d('0x26')])){_0x17f34d[_0x038d('0x26')]=undefined;loggerPredictive[_0x038d('0x95')](_0x038d('0x1cc'),_0x038d('0x1cd'));}if(!_[_0x038d('0x87')](_0x17f34d['handlePredictive'])){loggerPredictive[_0x038d('0x95')](_0x038d('0x1cc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x17f34d[_0x038d('0x92')]);_0x17f34d[_0x038d('0x92')]=undefined;}_0x17f34d[_0x038d('0x27')]=moment()['format'](_0x038d('0xfc'));loggerPredictive[_0x038d('0x80')](_0x17f34d['name'],_0x038d('0x1ce'),_0x17f34d[_0x038d('0x27')]);this[_0x038d('0x15b')](_0x17f34d,0x1);}else if(ifInterval(_0x17f34d[_0x038d('0x1cf')],_0x17f34d[_0x038d('0x27')])){this[_0x038d('0x15b')](_0x17f34d,0x1);loggerPredictiveCalls[_0x038d('0x80')](_0x038d('0x1d0'),_0x17f34d[_0x038d('0x27')],_0x17f34d['name']);_0x17f34d[_0x038d('0x74')]=0x0;_0x17f34d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x14316e<_0x5bf76f&&_0x17f34d[_0x038d('0x1d1')]===_0x038d('0x1d2')){freeVariablesPredictive(_0x17f34d);loggerPredictive[_0x038d('0x80')](_0x038d('0x1d3'),_0x038d('0x1d4'),_0x5bf76f,_0x038d('0x27'),_0x17f34d[_0x038d('0x3e')]);}else if(_0x2880ca<_0x17f34d[_0x038d('0x6d')]&&_0x17f34d[_0x038d('0x1d1')]===_0x038d('0x1d2')){freeVariablesPredictive(_0x17f34d);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x038d('0x1d5'),_0x2880ca,'Drop\x20in\x20this\x20interval',_0x17f34d['predictiveIntervalErlangCallsDroppedCalls'],_0x038d('0x27'),_0x17f34d[_0x038d('0x3e')]);}else if(!ifInterval(_0x17f34d[_0x038d('0x1cf')],_0x17f34d[_0x038d('0x27')])&&_[_0x038d('0x87')](_0x17f34d['startPredictive'])&&!_[_0x038d('0x87')](_0x17f34d[_0x038d('0x27')])){_0x17f34d[_0x038d('0x26')]=moment()[_0x038d('0x7b')](_0x038d('0xfc'));loggerPredictive[_0x038d('0x80')](_0x17f34d['name'],_0x038d('0x1d6'),_0x17f34d[_0x038d('0x26')]);this[_0x038d('0xbe')](_0x17f34d[_0x038d('0x1cf')])[_0x038d('0xbf')](this[_0x038d('0x1d7')](_0x17f34d))[_0x038d('0xbf')](mergeDataErlangB(_0x17f34d))[_0x038d('0xbf')](this[_0x038d('0x1d8')](_0x17f34d))[_0x038d('0xb2')](loggerCatchPredictive(_0x038d('0x1d9'),_0x17f34d));}else if(!ifInterval(_0x17f34d[_0x038d('0x1cf')],_0x17f34d[_0x038d('0x26')])){_0x17f34d[_0x038d('0x6d')]=0x0;_0x17f34d[_0x038d('0x26')]=moment()[_0x038d('0x7b')](_0x038d('0xfc'));loggerPredictive[_0x038d('0x80')](_0x17f34d[_0x038d('0x3e')],_0x038d('0x1da'),_0x17f34d[_0x038d('0x26')]);clearInterval(_0x17f34d[_0x038d('0x92')]);_0x17f34d[_0x038d('0x92')]=undefined;this[_0x038d('0xbe')](_0x17f34d[_0x038d('0x1cf')])[_0x038d('0xbf')](this[_0x038d('0x1d7')](_0x17f34d))[_0x038d('0xbf')](mergeDataErlangB(_0x17f34d))[_0x038d('0xbf')](this[_0x038d('0x1d8')](_0x17f34d))['catch'](loggerCatchPredictive(_0x038d('0x1db'),_0x17f34d));}else if(_0x17f34d[_0x038d('0x71')]&&_0x59cb53<_0x17f34d['predictiveIntervalAvailable']-_0x7c3103){freeVariablesPredictive(_0x17f34d);loggerPredictive[_0x038d('0x80')](_0x17f34d[_0x038d('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x59cb53,')\x20are\x20less\x20than\x20threshold\x20(',_0x17f34d[_0x038d('0x71')],'-',_0x7c3103,'=',_0x17f34d[_0x038d('0x71')]-_0x7c3103,')');}else if(_0x17f34d['predictiveIntervalAvailable']&&_0x59cb53>_0x17f34d[_0x038d('0x71')]+_0x3068ac){freeVariablesPredictive(_0x17f34d);loggerPredictive[_0x038d('0x80')](_0x17f34d['name'],_0x038d('0x1dc'),_0x59cb53,_0x038d('0x1dd'),_0x17f34d[_0x038d('0x71')],'+',_0x3068ac,'=',_0x17f34d['predictiveIntervalAvailable']+_0x3068ac,')');}};Dialer['prototype'][_0x038d('0x1d7')]=function(_0x494041){var _0x4e032b=this;return function(_0x2873aa){return new BPromise(function(_0x3390f7,_0x3d1136){_[_0x038d('0x8e')](_0x494041,_0x2873aa[0x0]);if(checkGetDataPredictive(_0x2873aa[0x0])){var _0x33b678=_0x494041[_0x038d('0x71')]=_0x494041[_0x038d('0x50')]+_0x494041['available'];var _0x42060e=_0x494041[_0x038d('0x1cf')]*0x3c;var _0x3df66e=_0x2873aa[0x0][_0x038d('0x69')]+_0x2873aa[0x0]['predictiveIntervalAvgHoldtime'];var _0x3aecae=(_0x2873aa[0x0][_0x038d('0x67')]+_0x2873aa[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2873aa[0x0][_0x038d('0x6a')])/_0x2873aa[0x0][_0x038d('0x72')];_0x494041[_0x038d('0x6e')]=_0x3aecae>0x0?_0x3aecae:0x1;switch(_0x494041[_0x038d('0x1d1')]){case _0x038d('0x1d2'):var _0x22086c=_0x494041[_0x038d('0x1c9')]/0x64;return _0x4e032b[_0x038d('0x1de')](_0x33b678,_0x42060e,_0x3df66e,_0x3aecae,_0x22086c)[_0x038d('0xbf')](function(_0x1e0d72){return _0x3390f7(_0x1e0d72);});case _0x038d('0x1df'):var _0x5d9dba=_0x494041[_0x038d('0x1c9')]/0x64;return _0x4e032b['busyFactor'](_0x33b678,_0x42060e,_0x3df66e,_0x3aecae,_0x5d9dba)['then'](function(_0x54e02b){return _0x3390f7(_0x54e02b);});default:return _0x3d1136(msgResponse(_0x038d('0x1e0'),_0x038d('0x145'),'Unknown\x20Predictive'));}}else{return _0x3d1136(msgResponse(_0x038d('0x1e0'),_0x038d('0x145'),_0x038d('0x1e1')));}});};};Dialer[_0x038d('0xaa')][_0x038d('0x1e2')]=function(_0x470546){var _0x3c5c49=this;return function(_0x591223){return new BPromise(function(_0x3f3915,_0x432b65){_['merge'](_0x470546,_0x591223[0x0]);if(checkGetDataPredictive(_0x591223[0x0])){loggerPredictive[_0x038d('0x80')](JSON['stringify'](_0x591223[0x0]));if(_0x470546[_0x038d('0x1d1')]===_0x038d('0x1d2')){return _0x3c5c49[_0x038d('0xc8')](_0x470546['id'])['then'](function(_0x24eb08){var _0x4f6a3e=_0x470546[_0x038d('0x4c')]-_0x24eb08[0x0][_0x038d('0x1e3')];var _0x37bb33=_0x470546['dialPredictiveInterval']*0x3c;var _0x3a7c98=_0x591223[0x0][_0x038d('0x69')]+_0x591223[0x0][_0x038d('0x68')];var _0x599885=(_0x591223[0x0][_0x038d('0x67')]+_0x591223[0x0][_0x038d('0x6b')]+_0x591223[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x591223[0x0][_0x038d('0x72')];var _0x4e3c5a=_0x470546[_0x038d('0x1c9')]/0x64;_0x470546[_0x038d('0x70')]=_0x24eb08[0x0][_0x038d('0x1e3')]||0x0;_0x470546[_0x038d('0x6e')]=_0x599885>0x0?_0x599885:0x1;return _0x3c5c49[_0x038d('0x1de')](_0x4f6a3e,_0x37bb33,_0x3a7c98,_0x599885,_0x4e3c5a);})[_0x038d('0xbf')](function(_0x4b4c48){return _0x3f3915(_0x4b4c48);})['catch'](function(_0x2c5590){return _0x432b65(msgResponse(_0x038d('0x1e4'),'Failure',JSON['stringify'](_0x2c5590)));});}if(_0x470546['dialPredictiveOptimization']===_0x038d('0x1df')){return _0x3c5c49[_0x038d('0xc8')](_0x470546['id'])[_0x038d('0xbf')](function(_0xeb2266){var _0x990f50=_0x470546['loggedIn']-_0xeb2266[0x0][_0x038d('0x1e3')];var _0x7fec26=_0x470546['dialPredictiveInterval']*0x3c;var _0x10e21d=_0x591223[0x0][_0x038d('0x69')]+_0x591223[0x0][_0x038d('0x68')];var _0x3e3f59=(_0x591223[0x0]['predictiveIntervalAnsweredCalls']+_0x591223[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x591223[0x0][_0x038d('0x6a')])/_0x591223[0x0][_0x038d('0x72')];var _0x204d5e=_0x470546[_0x038d('0x1c9')]/0x64;_0x470546['predictiveIntervalPauses']=_0xeb2266[0x0][_0x038d('0x1e3')]||0x0;_0x470546[_0x038d('0x6e')]=_0x3e3f59>0x0?_0x3e3f59:0x1;return _0x3c5c49['busyFactor'](_0x990f50,_0x7fec26,_0x10e21d,_0x3e3f59,_0x204d5e);})[_0x038d('0xbf')](function(_0x372ec0){return _0x3f3915(_0x372ec0);})['catch'](function(_0x65c959){return _0x432b65(msgResponse(_0x038d('0x1e4'),'Failure',JSON[_0x038d('0x46')](_0x65c959)));});}}else{return _0x432b65(msgResponse(_0x038d('0x1e0'),_0x038d('0x145'),_0x038d('0x1e1')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x632765){var _0x23c1aa=this;return function(){var _0x4c8a29=0x0;var _0x3eb2a1=Math[_0x038d('0x1e5')](_0x632765[_0x038d('0x75')]*0x3e8);if(_0x3eb2a1>0x0){_0x3eb2a1=_0x3eb2a1<0x64?0x64:_0x3eb2a1;loggerPredictive[_0x038d('0x80')](_0x632765['name'],'one\x20call\x20every:',_0x3eb2a1,_0x038d('0x47'));_0x632765[_0x038d('0x92')]=setInterval(function(){_0x23c1aa['handlePredictive'](_0x632765);loggerPredictiveCalls['info']('[handlePredictive]',_0x4c8a29+=0x1);},_0x3eb2a1);}else{loggerPredictive[_0x038d('0x80')](_0x632765[_0x038d('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x038d('0xaa')]['checkContactBlack']=function(_0x531cf8,_0x536463){var _0x2360ae=this;return function(_0x295bc2){if(_['isEmpty'](_0x295bc2)){if(_[_0x038d('0xae')](_0x536463[_0x038d('0xd7')])||!_0x536463[_0x038d('0x1e6')]){if(_0x531cf8[_0x038d('0x57')]===_0x038d('0x6')){_0x531cf8['queueStatusComplete']=_[_0x038d('0x87')](_0x531cf8[_0x038d('0x12f')])?!![]:_0x531cf8[_0x038d('0x12f')];var _0x31e723=uuid['v4']();_0x2360ae[_0x038d('0xac')][_0x31e723]=new Action(_0x531cf8,_0x536463,_0x31e723);loggerBooked[_0x038d('0x80')](_0x038d('0x1e7'),_0x31e723,'queueStatusComplete:\x20',JSON[_0x038d('0x46')](_0x531cf8[_0x038d('0x12f')]),_0x038d('0x1e8'),_0x531cf8['name']);if(_0x531cf8[_0x038d('0x12f')]){_0x531cf8[_0x038d('0x12f')]=![];_0x2360ae[_0x038d('0x29')][_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xb7')]]=[];ami[_0x038d('0xaf')]({'actionid':_0x31e723,'action':_0x038d('0x1e9'),'queue':_0x531cf8[_0x038d('0x3e')]})['catch'](function(){_0x2360ae['updateOriginated'](_0x531cf8);_0x2360ae['rescheduleContact']({'active':![],'ContactId':_0x2360ae['actions'][_0x31e723][_0x038d('0xd5')],'ListId':_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xd6')],'VoiceQueueId':_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xfd')]||undefined,'CampaignId':_0x2360ae['actions'][_0x31e723][_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2360ae['actions'][_0x31e723];});}else{loggerBooked[_0x038d('0x80')](_0x038d('0x1ea'),JSON[_0x038d('0x46')](_0x531cf8['queueStatusComplete']),_0x038d('0x1e8'),_0x531cf8[_0x038d('0x3e')]);_0x2360ae[_0x038d('0xb5')](_0x531cf8);_0x2360ae[_0x038d('0xc2')]({'active':![],'ContactId':_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xd5')],'ListId':_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xd6')],'VoiceQueueId':_0x2360ae[_0x038d('0xac')][_0x31e723][_0x038d('0xfd')]||undefined,'CampaignId':_0x2360ae['actions'][_0x31e723][_0x038d('0xd8')]||undefined})[_0x038d('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2360ae['actions'][_0x31e723];}}else{return _0x2360ae[_0x038d('0x16c')](_0x531cf8,_0x536463);}}else{if(getDiff(_0x536463[_0x038d('0x1eb')])<_0x531cf8[_0x038d('0x1ec')]*0x3c){if(_0x536463['Agent']&&!_0x536463[_0x038d('0x1ed')][_0x038d('0x1ee')]){_0x2360ae['preview'][_0x038d('0x132')](_0x536463['id'])['finally'](function(){_0x2360ae[_0x038d('0xb5')](_0x531cf8);});}else{_0x2360ae[_0x038d('0xc4')]({'active':![]},_0x536463['id'],0x1)[_0x038d('0x196')](function(){_0x2360ae['updateOriginated'](_0x531cf8);});}}else{_0x531cf8['outboundReCallsDay']+=0x1;_0x2360ae[_0x038d('0xb5')](_0x531cf8);if(_0x531cf8[_0x038d('0x1ef')]){_0x2360ae[_0x038d('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x536463['ContactId'],'ListId':_0x536463[_0x038d('0xd6')],'VoiceQueueId':_0x536463[_0x038d('0xfd')]||undefined,'CampaignId':_0x536463['CampaignId']||undefined})[_0x038d('0xb2')](loggerCatch(_0x038d('0x1f0')));_0x2360ae[_0x038d('0xcc')](createObjHistory(_0x531cf8,_0x536463,'RECALLINQUEUE',0x17,_0x038d('0x1f1')))[_0x038d('0xb2')](loggerCatch(_0x038d('0x1f2')));}else{_0x2360ae['saveInDb'](createObjHistory(_0x531cf8,_0x536463,'RECALLFAILEDTIMEOUT',0x16,_0x038d('0x1f3')),_0x038d('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x531cf8['outboundBlacklistCallsDay']+=0x1;_0x2360ae[_0x038d('0xd3')](createObjHistory(_0x531cf8,_0x536463,_0x038d('0x1f5'),0xd,_0x038d('0x1f6')),_0x038d('0x1f7'),_0x038d('0x1f8'));throw'inBlackList';}};};Dialer[_0x038d('0xaa')][_0x038d('0x1f9')]=function(_0x22c71f){var _0x182bb6=this;var _0x305aad=_0x22c71f[_0x038d('0x1fa')]-_0x22c71f[_0x038d('0x73')]-_0x22c71f[_0x038d('0xc6')];emitCampaignSummary(_0x22c71f);if(_0x305aad>0x0){if(_0x305aad>this[_0x038d('0x22')]){_0x305aad=this[_0x038d('0x22')];}_0x22c71f[_0x038d('0xc6')]+=_0x305aad;this['getContactDialerIvr'](_0x22c71f['id'],_0x305aad,_0x22c71f['dialOrderByScheduledAt'],_0x22c71f)['then'](function(_0x503875){_0x22c71f['temp']-=_0x305aad;_0x22c71f[_0x038d('0xc6')]=_0x22c71f[_0x038d('0xc6')]>0x0?_0x22c71f[_0x038d('0xc6')]:0x0;if(!checkContactEmpty(_0x503875)){_0x22c71f[_0x038d('0x3c')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x038d('0x80')]('[getContactCampaign2][Empty]'+_0x22c71f[_0x038d('0x3e')]);}else{_0x22c71f[_0x038d('0x73')]+=_0x503875[_0x038d('0x98')];_0x22c71f[_0x038d('0x3c')]='RUNNING';for(var _0x1a4067=0x0;_0x1a4067<_0x503875['length'];_0x1a4067+=0x1){_0x22c71f[_0x038d('0x1fb')]+=0x1;if(_[_0x038d('0xae')](_0x503875[_0x1a4067])||_['isNil'](_0x503875[_0x1a4067][_0x038d('0x183')])||_[_0x038d('0xae')](_0x503875[_0x1a4067][_0x038d('0x183')]['phone'])){_0x182bb6[_0x038d('0xd1')](_0x038d('0x1fc'),_0x22c71f,_0x503875[_0x1a4067]);}else{_0x182bb6[_0x038d('0xbd')](_[_0x038d('0xd4')](_0x503875[_0x1a4067],[_0x038d('0xd8'),'Contact.phone']))[_0x038d('0xbf')](_0x182bb6[_0x038d('0x1fd')](_0x22c71f,_0x503875[_0x1a4067]))[_0x038d('0xb2')](_0x182bb6[_0x038d('0xd0')]('[actionOriginateIvr]\x20',_0x22c71f));}}}})['catch'](loggerGetContactDialer(_0x038d('0x1fe'),_0x22c71f,_0x305aad));}};Dialer[_0x038d('0xaa')][_0x038d('0x15b')]=function(_0x1e643d,_0x447f90){var _0x108262=this;var _0x3de405=[];var _0x28eb02=_0x447f90>=0x1?_0x447f90:0x1;if(_0x1e643d['dialMethod']===_0x038d('0x6')){_0x28eb02=0x1;}var _0x2e9193=Math[_0x038d('0x1e5')](_0x1e643d['available']*_0x28eb02)-_0x1e643d['originated']-_0x1e643d[_0x038d('0xc6')];emitVoiceQueueSummary(_0x1e643d);if(_0x1e643d[_0x038d('0x1ff')]>0x0){var _0x404d5b=_0x1e643d['dialLimitQueue']-_0x1e643d[_0x038d('0x73')]-_0x1e643d['talking']-_0x1e643d[_0x038d('0xc6')]-_0x1e643d[_0x038d('0x4d')];if(_0x2e9193>_0x404d5b){_0x2e9193=_0x404d5b;}}if(_0x2e9193>0x0){if(_0x1e643d[_0x038d('0x57')]==='booked'){_0x2e9193=0x1;}if(_0x2e9193>this[_0x038d('0x22')]){_0x2e9193=this[_0x038d('0x22')];}_0x1e643d[_0x038d('0xc6')]+=_0x2e9193;for(var _0x1851f5 in this['agents']){if(typeof this['agents'][_0x1851f5]!=='undefined'){if(this[_0x038d('0x20')][_0x1851f5]['state']==='not_inuse'&&this[_0x038d('0x20')][_0x1851f5][_0x038d('0xb0')]==='reachable'){_0x3de405[_0x038d('0x12e')](this['agents'][_0x1851f5]['id']);}}}this[_0x038d('0xc5')](_0x1e643d['id'],_0x3de405,_0x2e9193,_0x1e643d[_0x038d('0x200')],_0x1e643d)[_0x038d('0xbf')](function(_0x5c1902){_0x1e643d[_0x038d('0xc6')]-=_0x2e9193;_0x1e643d[_0x038d('0xc6')]=_0x1e643d[_0x038d('0xc6')]>0x0?_0x1e643d[_0x038d('0xc6')]:0x0;if(!checkContactEmpty(_0x5c1902)){_0x108262[_0x038d('0xb9')](_0x1e643d)['then'](sendMessageReschedule(_0x1e643d))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x1e643d[_0x038d('0x73')]+=_0x5c1902['length'];_0x1e643d['message']=_0x1e643d['dialMethod']==='booked'?_0x038d('0x177'):_0x038d('0x201');for(var _0x575d50=0x0;_0x575d50<_0x5c1902['length'];_0x575d50+=0x1){if(_[_0x038d('0xae')](_0x5c1902[_0x575d50])||_[_0x038d('0xae')](_0x5c1902[_0x575d50][_0x038d('0x183')])||_[_0x038d('0xae')](_0x5c1902[_0x575d50][_0x038d('0x183')][_0x038d('0x16e')])){_0x108262[_0x038d('0xd1')](_0x038d('0x1fc'),_0x1e643d,_0x5c1902[_0x575d50]);}else{_0x108262[_0x038d('0xbb')](_[_0x038d('0xd4')](_0x5c1902[_0x575d50],[_0x038d('0xfd'),_0x038d('0x202')]))[_0x038d('0xbf')](_0x108262[_0x038d('0x1fd')](_0x1e643d,_0x5c1902[_0x575d50]))[_0x038d('0xb2')](_0x108262[_0x038d('0xd0')](_0x038d('0x1fc'),_0x1e643d));}}}})[_0x038d('0xb2')](loggerGetContactDialer(_0x038d('0x203'),_0x1e643d,_0x2e9193));}};Dialer[_0x038d('0xaa')]['handlePredictive']=function(_0x40d8bb){if(_0x40d8bb['dialLimitQueue']>0x0){var _0x36a625=_0x40d8bb[_0x038d('0x1ff')]-_0x40d8bb['originated']-_0x40d8bb['talking'];if(_0x36a625>0x0){this[_0x038d('0x204')](_0x40d8bb);}else{loggerPredictiveCalls[_0x038d('0x80')](_0x038d('0x205'));}}else{this[_0x038d('0x204')](_0x40d8bb);}};Dialer['prototype'][_0x038d('0x204')]=function(_0x11e64f){var _0x195613=this;var _0x467573=[];_0x11e64f[_0x038d('0x73')]+=0x1;for(var _0x39b579 in this[_0x038d('0x20')]){if(typeof this[_0x038d('0x20')][_0x39b579]!==_0x038d('0x99')){if(this[_0x038d('0x20')][_0x39b579][_0x038d('0xa7')]===_0x038d('0x206')&&this['agents'][_0x39b579][_0x038d('0xb0')]===_0x038d('0x207')){_0x467573[_0x038d('0x12e')](this[_0x038d('0x20')][_0x39b579]['id']);}}}this[_0x038d('0xc5')](_0x11e64f['id'],_0x467573,0x1,_0x11e64f['dialOrderByScheduledAt'],_0x11e64f)['then'](function(_0x92307f){if(!checkContactEmpty(_0x92307f)){checkContactLowerLimitOriginate(_0x11e64f,0x1,0x0);_0x195613[_0x038d('0xb9')](_0x11e64f)['then'](sendMessageReschedule(_0x11e64f))[_0x038d('0xb2')](loggerCatch(_0x038d('0xba')));}else{_0x11e64f['message']=_0x038d('0x201');if(_[_0x038d('0xae')](_0x92307f[0x0])||_['isNil'](_0x92307f[0x0][_0x038d('0x183')])||_[_0x038d('0xae')](_0x92307f[0x0][_0x038d('0x183')][_0x038d('0x16e')])){_0x195613['emptyContact'](_0x038d('0x1fc'),_0x11e64f,_0x92307f[0x0]);}else{_0x195613['checkIsBlackList'](_[_0x038d('0xd4')](_0x92307f[0x0],[_0x038d('0xfd'),_0x038d('0x202')]))[_0x038d('0xbf')](_0x195613['checkContactBlack'](_0x11e64f,_0x92307f[0x0]))['catch'](_0x195613[_0x038d('0xd0')](_0x038d('0x208'),_0x11e64f));}}})[_0x038d('0xb2')](loggerGetContactDialer(_0x038d('0x209'),_0x11e64f,0x1));emitVoiceQueueSummary(_0x11e64f);};Dialer[_0x038d('0xaa')]['abandonmentRate']=function(_0x36e124,_0x56309d,_0x1ccd37,_0x6ed8eb,_0x321127,_0x160108){loggerPredictive[_0x038d('0x80')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x038d('0x80')](_0x038d('0x20a'),_0x36e124);loggerPredictive[_0x038d('0x80')](_0x038d('0x20b'),_0x56309d);loggerPredictive['info'](_0x038d('0x20c'),_0x1ccd37);loggerPredictive[_0x038d('0x80')](_0x038d('0x20d'),_0x6ed8eb);loggerPredictive[_0x038d('0x80')](_0x038d('0x20e'),_0x321127);loggerPredictive[_0x038d('0x80')](_0x038d('0x86'));return new BPromise(function(_0x331628,_0x4b553e){if(_0x36e124<=0x0||isNaN(_0x36e124)){return _0x4b553e(msgResponse(_0x038d('0x20f'),_0x038d('0x45'),_0x038d('0x210')+_0x36e124));}if(_0x1ccd37<=0x0||isNaN(_0x1ccd37)){return _0x4b553e(msgResponse(_0x038d('0x20f'),_0x038d('0x45'),_0x038d('0x211')+_0x1ccd37));}if(_0x6ed8eb<=0x0||isNaN(_0x6ed8eb)){return _0x4b553e(msgResponse('[abandonmentRate]',_0x038d('0x45'),_0x038d('0x212')+_0x6ed8eb));}if(_0x56309d<=0x0||isNaN(_0x56309d)){return _0x4b553e(msgResponse(_0x038d('0x20f'),_0x038d('0x45'),_0x038d('0x213')+_0x56309d));}if(_0x321127<=0x0||isNaN(_0x321127)){return _0x4b553e(msgResponse('[abandonmentRate]','Error',_0x038d('0x214')+_0x321127));}_0x160108=_0x160108||0x0;var _0x491bef=0x1/_0x1ccd37;var _0xc2cc58=0x0;var _0x2ef47a=0x0;var _0x1ed807=0x0;var _0x48cd92=0x0;for(var _0x29090d=0x0;_0x1ed807<_0x321127;_0x29090d+=0x1){_0x2ef47a=_0x29090d/_0x56309d;_0xc2cc58=(_0x6ed8eb*_0x2ef47a+_0x160108)/_0x491bef;_0x1ed807=erlangb(_0xc2cc58,_0x36e124);_0x48cd92=_0xc2cc58/_0x36e124*(0x1-erlangb(_0xc2cc58,_0x36e124));}return _0x331628({'erlangCalls':_0x29090d,'erlangCallToSecond':_0x56309d/_0x29090d,'erlangAbandonmentRate':_0x1ed807,'erlangBusyFactor':_0x48cd92});});};Dialer[_0x038d('0xaa')]['busyFactor']=function(_0x3a3177,_0xd89d0d,_0x4cf68f,_0x4f8e6c,_0x24eaa2,_0x50952d){loggerPredictive[_0x038d('0x80')](_0x038d('0x215'));loggerPredictive[_0x038d('0x80')]('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',_0x3a3177);loggerPredictive[_0x038d('0x80')](_0x038d('0x20b'),_0xd89d0d);loggerPredictive['info'](_0x038d('0x20c'),_0x4cf68f);loggerPredictive[_0x038d('0x80')](_0x038d('0x20d'),_0x4f8e6c);loggerPredictive[_0x038d('0x80')](_0x038d('0x216'),_0x24eaa2);loggerPredictive[_0x038d('0x80')](_0x038d('0x86'));return new BPromise(function(_0x50bb5b,_0x422978){if(_0x3a3177<=0x0||isNaN(_0x3a3177)){return _0x422978(msgResponse(_0x038d('0x217'),_0x038d('0x45'),_0x038d('0x210')+_0x3a3177));}if(_0x4cf68f<=0x0||isNaN(_0x4cf68f)){return _0x422978(msgResponse(_0x038d('0x217'),'Error',_0x038d('0x211')+_0x4cf68f));}if(_0x4f8e6c<=0x0||isNaN(_0x4f8e6c)){return _0x422978(msgResponse('[busyFactor]',_0x038d('0x45'),_0x038d('0x212')+_0x4f8e6c));}if(_0xd89d0d<=0x0||isNaN(_0xd89d0d)){return _0x422978(msgResponse(_0x038d('0x217'),_0x038d('0x45'),_0x038d('0x213')+_0xd89d0d));}if(_0x24eaa2<=0x0||isNaN(_0x24eaa2)){return _0x422978(msgResponse(_0x038d('0x217'),_0x038d('0x45'),'Umin\x20=\x20'+_0x24eaa2));}_0x50952d=_0x50952d||0x0;var _0x4ed410=0x1/_0x4cf68f;var _0x756f82=0x0;var _0x1e12f5=0x0;var _0x544136=0x0;var _0x2b3c76=0x0;for(var _0x4e3d81=0x0;_0x2b3c76<_0x24eaa2;_0x4e3d81+=0x1){_0x1e12f5=_0x4e3d81/_0xd89d0d;_0x756f82=(_0x4f8e6c*_0x1e12f5+_0x50952d)/_0x4ed410;_0x544136=erlangb(_0x756f82,_0x3a3177);_0x2b3c76=_0x756f82/_0x3a3177*(0x1-erlangb(_0x756f82,_0x3a3177));}return _0x50bb5b({'erlangCalls':_0x4e3d81,'erlangCallToSecond':_0xd89d0d/_0x4e3d81,'erlangAbandonmentRate':_0x544136,'erlangBusyFactor':_0x2b3c76});});};module[_0x038d('0x218')]=Dialer; \ No newline at end of file +var _0x225c=['calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','syncNewExten','actions','actionid','roundrobin','locked','paused','stateinterface','rrmemory','queueBooked','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Failure','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','content','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','power','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','checkIfTime','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[countReScheduled]\x20','RUNNING','checkContactBlack','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\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]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','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','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\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','seconds','startProgressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','ContactId','UserId','VoiceQueueId','isSuccess','isTrunkReachable','SIP/%s','unmonitored','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','uniqueid','HangupInAMD','membername','AMD','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countcongestionretry','countnoanswerretry','add','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x5777e3,_0x39d9dd){var _0x5c245c=function(_0x4b5812){while(--_0x4b5812){_0x5777e3['push'](_0x5777e3['shift']());}};_0x5c245c(++_0x39d9dd);}(_0x225c,0x106));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xc225('0x0'));var _=require(_0xc225('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xc225('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xc225('0x3'));var ut=require(_0xc225('0x4'));var config=require(_0xc225('0x5'));var logger=require(_0xc225('0x6'))(_0xc225('0x7'));var loggerBooked=require(_0xc225('0x6'))(_0xc225('0x8'));var loggerPredictive=require('../../../config/logger')(_0xc225('0x9'));var loggerPredictiveCalls=require(_0xc225('0x6'))(_0xc225('0xa'));var loggerSyncQueueSummary=require(_0xc225('0x6'))(_0xc225('0xb'));var ami=require('../ami');config[_0xc225('0xc')]=_['defaults'](config[_0xc225('0xc')],{'host':_0xc225('0xd'),'port':0x18eb});var io=require(_0xc225('0xe'))(new Redis(config['redis']));var cmHopper=require(_0xc225('0xf'));var cmHopperHistory=require(_0xc225('0x10'));var cmHopperBlack=require(_0xc225('0x11'));var voiceQueueRt=require(_0xc225('0x12'));var Action=require(_0xc225('0x13'));var History=require('./history');var Final=require(_0xc225('0x14'));var AgentComplete=require(_0xc225('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xc225('0x16')][_0xc225('0x17')]||_0xc225('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x56727b){this[_0xc225('0x19')]=this[_0xc225('0x19')]?this[_0xc225('0x19')]['finally'](_0x56727b):_0x56727b();};function Dialer(_0x1bc1ef,_0x51751d){this['sequence']=new Sequence();this[_0xc225('0x1a')]=_0x51751d;this['voiceQueues']=_0x1bc1ef[_0xc225('0x1b')];this[_0xc225('0x1c')]=_0x1bc1ef['campaigns'];this[_0xc225('0x1d')]=_0x1bc1ef[_0xc225('0x1d')];this[_0xc225('0x1e')]=_0x1bc1ef[_0xc225('0x1e')];this[_0xc225('0x1f')]=config[_0xc225('0x1f')]||0x2;this[_0xc225('0x20')]={};this['actions']={};this[_0xc225('0x21')]={};this[_0xc225('0x22')]={};this[_0xc225('0x23')]={};this[_0xc225('0x24')]={};this['startProgressive']={};this[_0xc225('0x25')]={};this['queueBooked']={};this[_0xc225('0x26')]={};ami['on']('agentconnect',this[_0xc225('0x27')][_0xc225('0x28')](this));ami['on'](_0xc225('0x29'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xc225('0x28')](this));ami['on']('agentcomplete',this[_0xc225('0x2a')][_0xc225('0x28')](this));ami['on'](_0xc225('0x2b'),this[_0xc225('0xb')][_0xc225('0x28')](this));ami['on'](_0xc225('0x2c'),this[_0xc225('0x2d')][_0xc225('0x28')](this));ami['on'](_0xc225('0x2e'),this['syncNewExten'][_0xc225('0x28')](this));ami['on']('varset',this[_0xc225('0x2f')][_0xc225('0x28')](this));ami['on'](_0xc225('0x30'),this[_0xc225('0x31')][_0xc225('0x28')](this));ami['on'](_0xc225('0x32'),this[_0xc225('0x33')][_0xc225('0x28')](this));this['loopCampaigns']();this[_0xc225('0x34')]();}function isNotNull(_0x20e0b3){return _0x20e0b3!==null&&!_['isUndefined'](_0x20e0b3);}function checkIsLoggedIn(_0x46c7f5,_0x2f95cb){return function(){if(_0x2f95cb<=0x0){_0x46c7f5['message']=_0xc225('0x35');throw _0x46c7f5[_0xc225('0x36')]+_0xc225('0x37');}};}function isActive(_0x53c7fd){return _0x53c7fd;}function checkIsActive(_0x54f10a,_0x154f86){return function(){if(!isActive(_0x154f86)){_0x54f10a[_0xc225('0x38')]=_0xc225('0x39');throw _0x54f10a[_0xc225('0x36')]+_0xc225('0x3a');}};}function checkInterval(_0x44aa2f){return function(){if(!isNotNull(_0x44aa2f[_0xc225('0x3b')])){_0x44aa2f[_0xc225('0x38')]=_0xc225('0x3c');throw _0x44aa2f[_0xc225('0x36')]+_0xc225('0x3d');}if(!isNotNull(_0x44aa2f[_0xc225('0x3b')][_0xc225('0x3e')])){_0x44aa2f[_0xc225('0x38')]=_0xc225('0x3c');throw _0x44aa2f[_0xc225('0x36')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xc225('0x3f')](_0x44aa2f[_0xc225('0x3b')][_0xc225('0x3e')]))){_0x44aa2f[_0xc225('0x38')]='INTERVAL_IS_NULL';throw _0x44aa2f[_0xc225('0x36')]+_0xc225('0x3d');}};}function msgResponse(_0x5a2b30,_0x42a494,_0x293455){return{'action':_0x5a2b30,'response':_0x42a494,'message':_0x293455,'stack':_0x293455};}function myreject(_0x57d894){return function(_0x3f7670){return _0x57d894(msgResponse('[ifTime][Action]',_0xc225('0x40'),JSON[_0xc225('0x41')](_0x3f7670)));};}function getSeconds(_0x418471,_0x372705){var _0x15c206=moment(_0x418471)[_0xc225('0x42')](0x0);var _0xe60220=moment(_0x372705)[_0xc225('0x42')](0x0);return _0x15c206[_0xc225('0x43')](_0xe60220,'seconds');}function emit(_0x1c2ca0,_0x43823f,_0x586e95){io['to'](_0x1c2ca0)[_0xc225('0x44')](_0x43823f,_0x586e95);}function emitVoiceQueueSummary(_0x13a8bb){if(_0x13a8bb[_0xc225('0x45')]===_0xc225('0x46')){var _0x35ca50={'id':_0x13a8bb['id'],'name':_0x13a8bb[_0xc225('0x36')],'strategy':_0x13a8bb[_0xc225('0x47')],'answered':_0x13a8bb[_0xc225('0x48')],'available':_0x13a8bb[_0xc225('0x49')],'loggedIn':_0x13a8bb[_0xc225('0x4a')],'pTalking':_0x13a8bb[_0xc225('0x4b')],'sumBillable':_0x13a8bb['sumBillable'],'sumDuration':_0x13a8bb[_0xc225('0x4c')],'sumHoldTime':_0x13a8bb[_0xc225('0x4d')]||0x0,'talking':_0x13a8bb[_0xc225('0x4e')],'total':_0x13a8bb[_0xc225('0x4f')],'type':_0x13a8bb[_0xc225('0x45')],'unmanaged':_0x13a8bb['unmanaged'],'abandoned':_0x13a8bb['abandoned'],'waiting':_0x13a8bb[_0xc225('0x50')],'loggedInDb':_0x13a8bb['loggedInDb'],'dialActive':_0x13a8bb[_0xc225('0x51')],'dialMethod':_0x13a8bb[_0xc225('0x52')],'dialOriginateCallerIdName':_0x13a8bb[_0xc225('0x53')],'dialOriginateCallerIdNumber':_0x13a8bb[_0xc225('0x54')],'dialOriginateTimeout':_0x13a8bb[_0xc225('0x55')],'dialPrefix':_0x13a8bb['dialPrefix'],'outboundAnswerAgiCallsDay':_0x13a8bb[_0xc225('0x56')],'outboundAnswerCallsDay':_0x13a8bb[_0xc225('0x57')],'outboundBlacklistCallsDay':_0x13a8bb[_0xc225('0x58')],'outboundBusyCallsDay':_0x13a8bb[_0xc225('0x59')],'outboundCongestionCallsDay':_0x13a8bb[_0xc225('0x5a')],'outboundDropCallsDayACS':_0x13a8bb[_0xc225('0x5b')],'outboundDropCallsDayCallersExit':_0x13a8bb[_0xc225('0x5c')],'outboundDropCallsDayTimeout':_0x13a8bb[_0xc225('0x5d')],'outboundNoAnswerCallsDay':_0x13a8bb[_0xc225('0x5e')],'outboundNoSuchCallsDay':_0x13a8bb['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x13a8bb['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x13a8bb['outboundReCallsDay'],'outboundRejectCallsDay':_0x13a8bb[_0xc225('0x5f')],'outboundUnknownCallsDay':_0x13a8bb[_0xc225('0x60')],'predictiveIntervalAnsweredCalls':_0x13a8bb[_0xc225('0x61')],'predictiveIntervalAvgHoldtime':_0x13a8bb['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x13a8bb[_0xc225('0x62')],'predictiveIntervalDroppedCallsCallersExit':_0x13a8bb[_0xc225('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x13a8bb['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x13a8bb[_0xc225('0x64')],'predictiveIntervalErlangCallsDroppedCalls':_0x13a8bb[_0xc225('0x65')],'predictiveIntervalHitRate':_0x13a8bb[_0xc225('0x66')],'predictiveIntervalMultiplicativeFactor':_0x13a8bb[_0xc225('0x67')],'predictiveIntervalPauses':_0x13a8bb['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x13a8bb['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x13a8bb[_0xc225('0x68')],'message':_0x13a8bb[_0xc225('0x38')],'originated':_0x13a8bb[_0xc225('0x69')],'erlangCalls':_0x13a8bb[_0xc225('0x6a')],'erlangCallToSecond':_0x13a8bb['erlangCallToSecond'],'erlangAbandonmentRate':_0x13a8bb[_0xc225('0x6b')],'erlangBusyFactor':_0x13a8bb[_0xc225('0x6c')],'startPredictive':_0x13a8bb[_0xc225('0x24')],'startProgressive':_0x13a8bb['startProgressive']};if(_0x13a8bb['Trunk']){_0x35ca50['Trunk']={'id':_0x13a8bb[_0xc225('0x6d')]['id'],'name':_0x13a8bb[_0xc225('0x6d')][_0xc225('0x36')],'active':_0x13a8bb[_0xc225('0x6d')][_0xc225('0x6e')],'callerid':_0x13a8bb[_0xc225('0x6d')]['callerid']};}if(_0x13a8bb[_0xc225('0x3b')]){_0x35ca50['Interval']={'id':_0x13a8bb[_0xc225('0x3b')]['id'],'name':_0x13a8bb[_0xc225('0x3b')]['name']};}var _0x3ffca3=md5(JSON['stringify'](_0x35ca50));if(_0x13a8bb[_0xc225('0x6f')]!==_0x3ffca3){_0x13a8bb[_0xc225('0x6f')]=_0x3ffca3;emit(util[_0xc225('0x70')](_0xc225('0x71'),_0x35ca50[_0xc225('0x36')]),'voice_queue:save',_0x35ca50);}}}function emitCampaignSummary(_0x5bc039){if(_0x5bc039[_0xc225('0x45')]===_0xc225('0x72')){emit(util[_0xc225('0x70')](_0xc225('0x73'),_0x5bc039['name']),_0xc225('0x74'),_0x5bc039);}}function checkGetDataPredictive(_0x216428){if(isNotNull(_0x216428)&&!_[_0xc225('0x3f')](_0x216428)){loggerPredictive[_0xc225('0x75')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xc225('0x75')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x216428['predictiveIntervalTotalCalls']);loggerPredictive[_0xc225('0x75')](_0xc225('0x76'),_0x216428[_0xc225('0x61')]);loggerPredictive[_0xc225('0x75')](_0xc225('0x77'),_0x216428[_0xc225('0x78')]);loggerPredictive[_0xc225('0x75')](_0xc225('0x79'),_0x216428[_0xc225('0x63')]);loggerPredictive[_0xc225('0x75')](_0xc225('0x7a'),_0x216428[_0xc225('0x7b')]);loggerPredictive[_0xc225('0x75')](_0xc225('0x7c'),_0x216428[_0xc225('0x62')]);loggerPredictive['info'](_0xc225('0x7d'));if(_0x216428['predictiveIntervalTotalCalls']>0x0){if(!_[_0xc225('0x7e')](_0x216428[_0xc225('0x62')])&&_0x216428['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xc225('0x75')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xc225('0x7e')](_0x216428[_0xc225('0x7b')])&&_0x216428[_0xc225('0x7b')]>0x0){return!![];}loggerPredictive[_0xc225('0x75')](_0xc225('0x7f'));}else{loggerPredictive[_0xc225('0x75')](_0xc225('0x80'));}}else{loggerPredictive[_0xc225('0x75')](_0xc225('0x81'));}return![];}function mergeDataErlangB(_0x10dbdf){return function(_0x3f6da7){loggerPredictive[_0xc225('0x75')](_0xc225('0x82'));loggerPredictive[_0xc225('0x75')](_0xc225('0x83'),_0x3f6da7[_0xc225('0x6a')]);loggerPredictive['info'](_0xc225('0x84'),_0x3f6da7['erlangCallToSecond']);loggerPredictive[_0xc225('0x75')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f6da7[_0xc225('0x6b')]);loggerPredictive['info'](_0xc225('0x85'),_0x3f6da7[_0xc225('0x6c')]);loggerPredictive[_0xc225('0x75')](_0xc225('0x86'),_0x3f6da7[_0xc225('0x6b')]);loggerPredictive['info'](_0xc225('0x7d'));_[_0xc225('0x87')](_0x10dbdf,_0x3f6da7);};}function getDiff(_0x406cce){var _0x3d75fe=moment()['milliseconds'](0x0);var _0x2f7bc9=moment(_0x406cce)[_0xc225('0x42')](0x0);return _0x3d75fe['diff'](_0x2f7bc9,_0xc225('0x88'));}function ifInterval(_0x5ac2bc,_0x44e7fb){if(_['isUndefined'](_0x44e7fb)){return![];}return getDiff(_0x44e7fb)<_0x5ac2bc*0x3c;}function freeVariablesPredictive(_0x1e0d7f){if(isNotNull(_0x1e0d7f)){if(!_[_0xc225('0x7e')](_0x1e0d7f[_0xc225('0x89')])){_0x1e0d7f['startProgressive']=undefined;loggerPredictive[_0xc225('0x75')](_0x1e0d7f['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xc225('0x7e')](_0x1e0d7f[_0xc225('0x24')])){_0x1e0d7f[_0xc225('0x24')]=undefined;loggerPredictive[_0xc225('0x75')](_0x1e0d7f[_0xc225('0x36')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xc225('0x7e')](_0x1e0d7f[_0xc225('0x8a')])){clearInterval(_0x1e0d7f[_0xc225('0x8a')]);_0x1e0d7f['handlePredictive']=undefined;loggerPredictive[_0xc225('0x75')](_0x1e0d7f[_0xc225('0x36')],_0xc225('0x8b'));}}}function erlangb(_0x403fa7,_0x57d1d1){if(_0x57d1d1===0x0){return 0x0;}var _0x32fabd=0x1;for(var _0x490984=0x1;_0x490984<=_0x57d1d1;_0x490984+=0x1){_0x32fabd=0x1+_0x32fabd*_0x490984/_0x403fa7;}return 0x1/_0x32fabd;}function isVoiceQueueOutbound(_0x4a928c){return _0x4a928c==='outbound';}function isNotPreview(_0x13792e){return _0x13792e!==_0xc225('0x1a');}function isCampaignIvr(_0x29db1b){return _0x29db1b===_0xc225('0x72');}function getCallerId(_0x5a5629,_0x3eaccc,_0x122307){if(!_['isUndefined'](_0x122307)&&typeof _0x122307==='string'&&!_['isEmpty'](_0x122307)){if(!_[_0xc225('0x7e')](_0x3eaccc)&&typeof _0x3eaccc==='string'&&!_['isEmpty'](_0x3eaccc)){return util[_0xc225('0x70')]('\x22%s\x22\x20<%s>',_0x3eaccc,_0x122307);}return util[_0xc225('0x70')](_0xc225('0x8c'),_0x122307,_0x122307);}if(!_['isUndefined'](_0x5a5629)&&typeof _0x5a5629==='string'&&!_['isEmpty'](_0x5a5629)){return _0x5a5629;}return _0xc225('0x8d');}function loggerCatchQueueSummary(_0x258113,_0x4f73e7){return function(_0x355aa4){freeVariablesPredictive(_0x4f73e7);emitVoiceQueueSummary(_0x4f73e7);emitCampaignSummary(_0x4f73e7);loggerSyncQueueSummary[_0xc225('0x8e')](_0x258113,util[_0xc225('0x8f')](_0x355aa4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x563524,_0x43e2c6){return function(_0x34f7b5){loggerPredictive[_0xc225('0x8e')](_0x43e2c6[_0xc225('0x36')],_0x563524);loggerPredictive[_0xc225('0x8e')](_0x34f7b5[_0xc225('0x90')]);freeVariablesPredictive(_0x43e2c6);};}function loggerCatch(_0x37c20c){return function(_0x59054a){logger[_0xc225('0x8e')](_0x37c20c,util['inspect'](_0x59054a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x135408){return _0x135408&&!_[_0xc225('0x7e')](_0x135408)&&_0x135408['length']>0x0;}function decremetOriginate(_0x52e1f0){if(!_[_0xc225('0x7e')](_0x52e1f0)&&_0x52e1f0!==null){if(typeof _0x52e1f0[_0xc225('0x69')]!==_0xc225('0x91')){if(_0x52e1f0[_0xc225('0x69')]>0x0){_0x52e1f0[_0xc225('0x69')]-=0x1;}else{logger[_0xc225('0x8e')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xc225('0x8e')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x22e559,_0x497c19,_0x2382f2){if(_0x497c19>_0x2382f2){for(var _0x58a8d2=0x0;_0x58a8d2<_0x497c19-_0x2382f2;_0x58a8d2+=0x1){decremetOriginate(_0x22e559);}}}function loggerGetContactDialer(_0x2c92b0,_0x325541,_0x15e74a){return function(_0x41cbcb){checkContactLowerLimitOriginate(_0x325541,_0x15e74a,0x0);logger[_0xc225('0x8e')](_0x2c92b0,util[_0xc225('0x8f')](_0x41cbcb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x301ff6){return function(_0x2dfc05){if(isNotNull(_0x2dfc05)&&isNotNull(_0x2dfc05[0x0])){if(_0x2dfc05[0x0][_0xc225('0x92')]>0x0){_0x301ff6[_0xc225('0x38')]=_0xc225('0x93');logger[_0xc225('0x75')](_0xc225('0x94')+_0x301ff6[_0xc225('0x36')],_0x2dfc05[0x0][_0xc225('0x92')],_0xc225('0x95'));}else{_0x301ff6[_0xc225('0x38')]=_0xc225('0x96');logger[_0xc225('0x75')](_0xc225('0x97')+_0x301ff6['name']);}}};}function notSendMessagesQueue(_0x3b50e0){if(_0x3b50e0[_0xc225('0x98')]){freeVariablesPredictive(_0x3b50e0);if(_0x3b50e0['originated']===0x0&&_0x3b50e0[_0xc225('0x4e')]===0x0&&_0x3b50e0['waiting']===0x0&&(_0x3b50e0[_0xc225('0x4b')]||0x0)===0x0){_0x3b50e0[_0xc225('0x98')]=![];_0x3b50e0[_0xc225('0x49')]=0x0;_0x3b50e0[_0xc225('0x38')]=_0xc225('0x39');loggerSyncQueueSummary['error'](_0xc225('0x99'),_0x3b50e0['name'],_0xc225('0x9a'));}else{_0x3b50e0[_0xc225('0x38')]=_0xc225('0x9b');loggerSyncQueueSummary[_0xc225('0x8e')](_0xc225('0x99'),_0x3b50e0[_0xc225('0x36')],'is\x20disactive');}emitVoiceQueueSummary(_0x3b50e0);}}function notSendMessagesCampaign(_0x3db76a){if(_0x3db76a['sendMessageOneNotActive']){if(_0x3db76a[_0xc225('0x69')]===0x0){_0x3db76a[_0xc225('0x98')]=![];_0x3db76a[_0xc225('0x38')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xc225('0x8e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3db76a['name'],_0xc225('0x9a'));}else{_0x3db76a[_0xc225('0x38')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc225('0x8e')](_0xc225('0x9c'),_0x3db76a['name'],_0xc225('0x9d'));}emitCampaignSummary(_0x3db76a);}}function createObjHistory(_0x5e62c1,_0x12d792,_0x4162cd,_0x17e146,_0x4b81b5){_0x5e62c1[_0xc225('0x38')]=_0x4162cd;var _0x5e589d=new Action(_0x5e62c1,_0x12d792);var _0x226f9b=new History(_0x5e589d);_0x226f9b[_0xc225('0x9e')]=_0x17e146;_0x226f9b[_0xc225('0x9f')]=_0x4b81b5;_0x226f9b[_0xc225('0xa0')]=_0x5e589d[_0xc225('0xa1')];return _0x226f9b;}Dialer[_0xc225('0xa2')][_0xc225('0x34')]=function(){var _0x28cf17=this;setInterval(function(){_0x28cf17[_0xc225('0xa3')](_0x28cf17[_0xc225('0x22')],_0xc225('0xa4'));_0x28cf17['clearZombieChannels'](_0x28cf17['actions'],_0xc225('0xa5'));},0x32c8);};Dialer[_0xc225('0xa2')][_0xc225('0xa3')]=function(_0xb85837,_0x399cb9){var _0x252681=this;for(var _0x2590cb in _0xb85837){if(typeof _0xb85837[_0x2590cb]!==_0xc225('0x91')){this[_0xc225('0xa6')][_0xc225('0xa7')](function(){if(!_[_0xc225('0xa8')](_0xb85837[_0x2590cb])){return ami[_0xc225('0xa9')]({'action':_0xc225('0xaa'),'channel':_0xb85837[_0x2590cb][_0xc225('0xab')]})[_0xc225('0xac')](function(_0x2be258){if(_0x2be258[_0xc225('0x38')]===_0xc225('0xad')){setTimeout(function(){if(_0xb85837[_0x2590cb]&&_0xb85837[_0x2590cb]['type']!==_0xc225('0x72')){_0x252681['updateOriginated'](_0x252681[_0xc225('0x1b')][_0xb85837[_0x2590cb]['queue']]);logger[_0xc225('0x8e')](_0xc225('0xae'),_0x399cb9,_0x2590cb,_0xb85837[_0x2590cb][_0xc225('0xaf')]);delete _0xb85837[_0x2590cb];}if(_0xb85837[_0x2590cb]&&_0xb85837[_0x2590cb][_0xc225('0x45')]===_0xc225('0x72')){_0x252681[_0xc225('0xb0')](_0x252681[_0xc225('0x1c')][_0xb85837[_0x2590cb][_0xc225('0xaf')]]);logger[_0xc225('0x8e')]('[Dialer][checkChannel][ivr]',_0x399cb9,_0x2590cb,_0xb85837[_0x2590cb][_0xc225('0xaf')]);delete _0xb85837[_0x2590cb];}},0x2328);}});}});}}};Dialer[_0xc225('0xa2')]['countReScheduled']=function(_0x47ec25){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopper['countReScheduled'](_0x47ec25))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xc225('0xa2')][_0xc225('0xb3')]=function(_0x48248a){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopperBlack[_0xc225('0xb3')](_0x48248a))[_0xc225('0xac')](loggerCatch(_0xc225('0xb4')));};Dialer[_0xc225('0xa2')][_0xc225('0xb5')]=function(_0x4c97c7){return BPromise['resolve']()[_0xc225('0xb2')](cmHopperBlack[_0xc225('0xb5')](_0x4c97c7))[_0xc225('0xac')](loggerCatch(_0xc225('0xb6')));};Dialer[_0xc225('0xa2')][_0xc225('0xb7')]=function(_0x5b31c8){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopperHistory[_0xc225('0xb8')](_0x5b31c8))['catch'](loggerCatch(_0xc225('0xb9')));};Dialer['prototype'][_0xc225('0xba')]=function(_0x1e8c7b){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopper[_0xc225('0xba')](_0x1e8c7b))[_0xc225('0xac')](loggerCatch(_0xc225('0xbb')));};Dialer['prototype'][_0xc225('0xbc')]=function(_0x2581e9,_0x4a97ae,_0x59c692){return BPromise['resolve']()[_0xc225('0xb2')](cmHopper[_0xc225('0xbc')](_0x2581e9,_0x4a97ae,_0x59c692))[_0xc225('0xac')](loggerCatch(_0xc225('0xbd')));};Dialer[_0xc225('0xa2')][_0xc225('0xbe')]=function(_0x27e790,_0x2e7ca5,_0x4420e3,_0x82ab7c,_0x275231){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopper[_0xc225('0xbe')](_0x27e790,_0x2e7ca5,_0x4420e3,_0x82ab7c))[_0xc225('0xac')](function(_0x3a243b){_0x275231[_0xc225('0xbf')]-=_0x4420e3;_0x275231[_0xc225('0xbf')]=_0x275231[_0xc225('0xbf')]>0x0?_0x275231[_0xc225('0xbf')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x3a243b);});};Dialer[_0xc225('0xa2')][_0xc225('0xc0')]=function(_0x58399d,_0x4f4142,_0x39b4e5,_0x7bebab){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopper[_0xc225('0xc0')](_0x58399d,_0x4f4142,_0x39b4e5))[_0xc225('0xac')](function(_0x44b613){_0x7bebab[_0xc225('0xbf')]-=_0x4f4142;_0x7bebab[_0xc225('0xbf')]=_0x7bebab[_0xc225('0xbf')]>0x0?_0x7bebab[_0xc225('0xbf')]:0x0;loggerCatch(_0xc225('0xc1'))(_0x44b613);});};Dialer[_0xc225('0xa2')]['getVoiceQueueRtPauses']=function(_0x521e86){return BPromise['resolve']()[_0xc225('0xb2')](voiceQueueRt[_0xc225('0xc2')](_0x521e86))[_0xc225('0xac')](loggerCatch(_0xc225('0xc3')));};Dialer[_0xc225('0xa2')][_0xc225('0xc4')]=function(_0x9e128b){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopper[_0xc225('0xc4')](_0x9e128b))[_0xc225('0xac')](loggerCatch(_0xc225('0xc5')));};Dialer[_0xc225('0xa2')][_0xc225('0xc6')]=function(_0x4dbb0e){return BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](cmHopperHistory[_0xc225('0xc6')](_0x4dbb0e))[_0xc225('0xac')](loggerCatch(_0xc225('0xc7')));};Dialer[_0xc225('0xa2')]['updateOriginated']=function(_0x32c610){if(!_[_0xc225('0x7e')](_0x32c610)&&_0x32c610!==null){if(typeof _0x32c610[_0xc225('0x69')]!==_0xc225('0x91')){if(_0x32c610['originated']>0x0){_0x32c610[_0xc225('0x69')]-=0x1;}else{logger[_0xc225('0x8e')](_0xc225('0xc8'));}}}else{logger[_0xc225('0x8e')](_0xc225('0xc9'));}};Dialer[_0xc225('0xa2')][_0xc225('0xca')]=function(_0x46ae9a,_0xcfaa54){var _0xa4019e=this;return function(_0x245877){_0xa4019e[_0xc225('0xb0')](_0xcfaa54);logger[_0xc225('0x8e')](_0x46ae9a,util['inspect'](_0x245877,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xc225('0xcb')]=function(_0xe00371,_0x2d9c95,_0x5c30fe){var _0x40b52f={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x2d9c95);this[_0xc225('0xcc')](_[_0xc225('0x87')](_0x40b52f,_['pick'](_0x5c30fe,[_0xc225('0xcd'),'ListId',_0xc225('0xce'),_0xc225('0xcf'),'CampaignId'])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xc225('0x8e')](_0xe00371);};Dialer[_0xc225('0xa2')][_0xc225('0xd0')]=function(_0x3ac4e6){return _0x3ac4e6==='Success';};Dialer[_0xc225('0xa2')][_0xc225('0xd1')]=function(_0x4222d4){return!_[_0xc225('0x7e')](_0x4222d4)&&_0x4222d4&&!_[_0xc225('0x7e')](_0x4222d4['name'])&&!_[_0xc225('0x7e')](_0x4222d4['active'])&&_0x4222d4[_0xc225('0x6e')]&&(this['trunks'][util['format'](_0xc225('0xd2'),_0x4222d4[_0xc225('0x36')])][_0xc225('0xaa')]==='reachable'||this[_0xc225('0x1e')][util['format'](_0xc225('0xd2'),_0x4222d4[_0xc225('0x36')])][_0xc225('0xaa')]===_0xc225('0xd3'));};Dialer[_0xc225('0xa2')]['saveInDb']=function(_0x8440b7,_0x305cc2,_0x4f1402){this[_0xc225('0xc6')](_0x8440b7)['catch'](loggerCatch(_0x305cc2));this['moveContactManagedDialer'](_0x8440b7)['catch'](loggerCatch(_0x4f1402));};Dialer[_0xc225('0xa2')][_0xc225('0x2f')]=function(_0x28dec2){var _0x5c0b9f=this[_0xc225('0x22')][_0x28dec2['uniqueid']];var _0x4d70ac;if(!_[_0xc225('0xa8')](_0x28dec2)&&!_[_0xc225('0xa8')](_0x28dec2['variable'])&&!_[_0xc225('0xa8')](_0x28dec2[_0xc225('0xd4')][_0xc225('0xd5')])&&_0x28dec2['exten']===_0xc225('0xd6')&&_0x5c0b9f){if(_0x5c0b9f['type']!==_0xc225('0x72')&&this[_0xc225('0x1b')][_0x5c0b9f['queue']][_0xc225('0xd7')]&&_0x28dec2['value']===_0xc225('0xd8')){delete this[_0xc225('0x22')][_0x28dec2[_0xc225('0xd9')]];this[_0xc225('0xb0')](this[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]]);this[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0x57')]+=0x1;this['voiceQueues'][_0x5c0b9f['queue']][_0xc225('0x56')]+=0x1;_0x4d70ac=new Hangup(_0x5c0b9f,_0x28dec2);_0x4d70ac[_0xc225('0x9e')]=0x12;_0x4d70ac[_0xc225('0x9f')]=_0xc225('0xda');_0x4d70ac[_0xc225('0xdb')]=_0xc225('0xdc');ami[_0xc225('0x44')]('custom:amd',ut['buildObj'](_0x4d70ac,_0xc225('0xdd')));this[_0xc225('0xcc')](_0x4d70ac,_0xc225('0xde'),_0xc225('0xdf'));}if(_0x5c0b9f[_0xc225('0x45')]!==_0xc225('0x72')&&this[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0xd7')]&&_0x28dec2[_0xc225('0xe0')]===_0xc225('0xe1')){var _0x3fc369=this;return new BPromise(function(_0x3b1a5b,_0x287a42){delete _0x3fc369[_0xc225('0x22')][_0x28dec2[_0xc225('0xd9')]];_0x3fc369[_0xc225('0xb0')](_0x3fc369[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]]);_0x3fc369[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0x57')]+=0x1;_0x3fc369[_0xc225('0x1b')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0x56')]+=0x1;var _0x1285fa=_0x3fc369['voiceQueues'][_0x5c0b9f['queue']];var _0x532f2e=new Hangup(_0x5c0b9f,_0x28dec2);_0x532f2e[_0xc225('0x9e')]=0x13;_0x532f2e[_0xc225('0x9f')]=_0xc225('0xe2');_0x532f2e[_0xc225('0xdb')]=_0xc225('0xdc');_0x532f2e[_0xc225('0xe3')]+=0x1;_0x532f2e['countglobal']+=0x1;_0x532f2e[_0xc225('0xdd')]=!![];ami[_0xc225('0x44')]('custom:amd',ut[_0xc225('0xe4')](_0x532f2e,_0xc225('0xdd')));_0x3fc369[_0xc225('0xc6')](_0x532f2e)[_0xc225('0xac')](loggerCatch(_0xc225('0xe5')));if(_0x532f2e[_0xc225('0xe6')]+_0x532f2e['countcongestionretry']+_0x532f2e['countnoanswerretry']+_0x532f2e[_0xc225('0xe7')]+_0x532f2e[_0xc225('0xe8')]+_0x532f2e[_0xc225('0xe9')]+_0x532f2e[_0xc225('0xe3')]+_0x532f2e[_0xc225('0xea')]>=_0x1285fa[_0xc225('0xeb')]){_0x3fc369[_0xc225('0xec')](_0x532f2e,_0x3b1a5b,_0x287a42,_0xc225('0xed'));}else{if(_0x532f2e[_0xc225('0xe3')]>=_0x1285fa[_0xc225('0xee')]){_0x3fc369[_0xc225('0xef')](_0x532f2e,_0x3b1a5b,_0x287a42,_0xc225('0xf0'));}else{_0x3fc369['rescheduleContact']({'active':![],'countmachineretry':_0x532f2e[_0xc225('0xe3')],'scheduledat':moment()['add'](_0x1285fa[_0xc225('0xf1')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x532f2e[_0xc225('0xcd')],'ListId':_0x532f2e[_0xc225('0xf4')],'VoiceQueueId':_0x532f2e[_0xc225('0xcf')]||undefined,'CampaignId':_0x532f2e[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x3b1a5b({'reschedule':0x1});}}});}if(_0x5c0b9f[_0xc225('0x45')]===_0xc225('0x72')&&this[_0xc225('0x1c')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0xd7')]&&_0x28dec2[_0xc225('0xe0')]===_0xc225('0xd8')){delete this['uniqueId'][_0x28dec2['uniqueid']];this[_0xc225('0xb0')](this['campaigns'][_0x5c0b9f[_0xc225('0xaf')]]);_0x4d70ac=new Hangup(_0x5c0b9f,_0x28dec2);_0x4d70ac[_0xc225('0x9e')]=0x12;_0x4d70ac['statedesc']=_0xc225('0xda');_0x4d70ac[_0xc225('0xdb')]=_0xc225('0xdc');ami[_0xc225('0x44')](_0xc225('0xf6'),ut[_0xc225('0xe4')](_0x4d70ac,_0xc225('0xdd')));this[_0xc225('0xcc')](_0x4d70ac,_0xc225('0xf7'),_0xc225('0xf8'));}if(_0x5c0b9f[_0xc225('0x45')]===_0xc225('0x72')&&this[_0xc225('0x1c')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0xd7')]&&_0x28dec2[_0xc225('0xe0')]==='MACHINE'){var _0x3fc369=this;return new BPromise(function(_0x33012d,_0x383226){delete _0x3fc369[_0xc225('0x22')][_0x28dec2[_0xc225('0xd9')]];_0x3fc369['updateOriginated'](_0x3fc369['campaigns'][_0x5c0b9f['queue']]);_0x3fc369[_0xc225('0x1c')][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0x57')]+=0x1;_0x3fc369['campaigns'][_0x5c0b9f[_0xc225('0xaf')]][_0xc225('0x56')]+=0x1;var _0x25784f=_0x3fc369[_0xc225('0x1c')][_0x5c0b9f[_0xc225('0xaf')]];var _0x517bbc=new Hangup(_0x5c0b9f,_0x28dec2);_0x517bbc[_0xc225('0x9e')]=0x13;_0x517bbc[_0xc225('0x9f')]=_0xc225('0xe2');_0x517bbc[_0xc225('0xdb')]=_0xc225('0xdc');_0x517bbc[_0xc225('0xe3')]+=0x1;_0x517bbc[_0xc225('0xf9')]+=0x1;_0x517bbc['amd']=!![];ami[_0xc225('0x44')](_0xc225('0xf6'),ut['buildObj'](_0x517bbc,_0xc225('0xdd')));_0x3fc369[_0xc225('0xc6')](_0x517bbc)['catch'](loggerCatch(_0xc225('0xe5')));if(_0x517bbc['countbusyretry']+_0x517bbc[_0xc225('0xfa')]+_0x517bbc[_0xc225('0xfb')]+_0x517bbc[_0xc225('0xe7')]+_0x517bbc['countdropretry']+_0x517bbc['countabandonedretry']+_0x517bbc[_0xc225('0xe3')]+_0x517bbc['countagentrejectretry']>=_0x25784f[_0xc225('0xeb')]){_0x3fc369[_0xc225('0xec')](_0x517bbc,_0x33012d,_0x383226,_0xc225('0xed'));}else{if(_0x517bbc['countmachineretry']>=_0x25784f[_0xc225('0xee')]){_0x3fc369[_0xc225('0xef')](_0x517bbc,_0x33012d,_0x383226,_0xc225('0xf0'));}else{_0x3fc369[_0xc225('0xba')]({'active':![],'countmachineretry':_0x517bbc[_0xc225('0xe3')],'scheduledat':moment()[_0xc225('0xfc')](_0x25784f[_0xc225('0xf1')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x517bbc[_0xc225('0xcd')],'ListId':_0x517bbc[_0xc225('0xf4')],'VoiceQueueId':_0x517bbc[_0xc225('0xcf')]||undefined,'CampaignId':_0x517bbc[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0xfd')));_0x33012d({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xc225('0x2d')]=function(_0x2d5130){var _0x5d2572=this['uniqueId'][_0x2d5130[_0xc225('0xd9')]];var _0x51c638=this;var _0x4c975d;if(_0x5d2572&&_0x5d2572['type']===_0xc225('0x72')){delete this[_0xc225('0x22')][_0x2d5130['uniqueid']];this[_0xc225('0xb0')](this[_0xc225('0x1c')][_0x5d2572[_0xc225('0xaf')]]);this[_0xc225('0x1c')][_0x5d2572[_0xc225('0xaf')]]['ivrAnswerCallsDay']+=0x1;_0x4c975d=new Hangup(_0x5d2572,_0x2d5130);this['createHistory'](_0x4c975d)[_0xc225('0xac')](loggerCatch(_0xc225('0xfe')));this['moveContactManagedDialer'](_0x4c975d)[_0xc225('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x5d2572&&_0x5d2572[_0xc225('0x45')]!==_0xc225('0x72')&&isNotNull(this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]][_0xc225('0xff')])){delete this['uniqueId'][_0x2d5130[_0xc225('0xd9')]];this[_0xc225('0xb0')](this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]]);this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]][_0xc225('0x57')]+=0x1;this[_0xc225('0x1b')][_0x5d2572['queue']][_0xc225('0x56')]+=0x1;_0x4c975d=new Hangup(_0x5d2572,_0x2d5130);_0x4c975d[_0xc225('0x9e')]=0x10;_0x4c975d['statedesc']=_0xc225('0x100');_0x4c975d['membername']='AGI';this[_0xc225('0xc6')](_0x4c975d)[_0xc225('0xac')](loggerCatch(_0xc225('0xfe')));this['moveContactManagedDialer'](_0x4c975d)[_0xc225('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x5d2572&&_0x5d2572[_0xc225('0x45')]!==_0xc225('0x72')&&!isNotNull(this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]][_0xc225('0xff')])){delete this[_0xc225('0x22')][_0x2d5130[_0xc225('0xd9')]];this[_0xc225('0xb0')](this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]]);this[_0xc225('0x1b')][_0x5d2572[_0xc225('0xaf')]][_0xc225('0x60')]+=0x1;_0x4c975d=new Hangup(_0x5d2572,_0x2d5130);_0x4c975d['state']=0xc;_0x4c975d['statedesc']=_0x2d5130['cause-txt'];_0x4c975d['membername']=_0xc225('0x101');this['createHistory'](_0x4c975d)[_0xc225('0xac')](loggerCatch(_0xc225('0xfe')));this[_0xc225('0xc4')](_0x4c975d)[_0xc225('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc225('0xa2')][_0xc225('0x2a')]=function(_0x4d3424){var _0x2b0076=this[_0xc225('0x22')][_0x4d3424[_0xc225('0xd9')]];var _0x584c9=this;if(this[_0xc225('0x1b')][_0x4d3424['queue']]){if(_0x2b0076&&_0x2b0076['type']!==_0xc225('0x72')){delete this[_0xc225('0x22')][_0x4d3424[_0xc225('0xd9')]];this[_0xc225('0x1b')][_0x4d3424[_0xc225('0xaf')]][_0xc225('0x57')]+=0x1;var _0x11ce6e=new AgentComplete(_0x2b0076,_0x4d3424);if(_0x4d3424[_0xc225('0x102')]===_0xc225('0x103')){_0x11ce6e[_0xc225('0x104')]=this['voiceQueues'][_0x4d3424[_0xc225('0xaf')]]['dialQueueProject2']&&this['voiceQueues'][_0x4d3424[_0xc225('0xaf')]][_0xc225('0x105')]?moment()['format'](_0xc225('0xf3')):undefined;}this[_0xc225('0xc6')](_0x11ce6e)[_0xc225('0xac')](loggerCatch(_0xc225('0x106')));this[_0xc225('0xc4')](_0x11ce6e)[_0xc225('0xac')](loggerCatch(_0xc225('0x107')));}}};Dialer[_0xc225('0xa2')][_0xc225('0x27')]=function(_0x14d82c){if(this[_0xc225('0x1b')][_0x14d82c[_0xc225('0xaf')]]){if(this[_0xc225('0x22')][_0x14d82c[_0xc225('0xd9')]]&&this[_0xc225('0x22')][_0x14d82c[_0xc225('0xd9')]][_0xc225('0x45')]!==_0xc225('0x72')){this[_0xc225('0xb0')](this['voiceQueues'][_0x14d82c[_0xc225('0xaf')]]);this['uniqueId'][_0x14d82c[_0xc225('0xd9')]][_0xc225('0x108')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xc225('0x109')]=function(_0x441593){this['createHistory'](_0x441593)['catch'](loggerCatch(_0xc225('0x106')));this['moveContactManagedDialer'](_0x441593)[_0xc225('0xac')](loggerCatch(_0xc225('0x10a')));};Dialer[_0xc225('0xa2')][_0xc225('0x10b')]=function(_0x16e822){var _0x2fb59b=this[_0xc225('0x22')][_0x16e822[_0xc225('0xd9')]];var _0x2c04be=this;if(this[_0xc225('0x1b')][_0x16e822['queue']]){if(_0x2fb59b&&_0x2fb59b['type']!==_0xc225('0x72')){delete this['uniqueId'][_0x16e822[_0xc225('0xd9')]];this[_0xc225('0xb0')](this[_0xc225('0x1b')][_0x16e822[_0xc225('0xaf')]]);_0x2fb59b[_0xc225('0x10c')]=moment()[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x105ddd=new QueueCallerAbandon(_0x2fb59b,_0x16e822);if(getSeconds(_0x2fb59b['droptime'],_0x2fb59b[_0xc225('0x10d')])>=_0x2fb59b[_0xc225('0x10e')]){this['voiceQueues'][_0x16e822[_0xc225('0xaf')]][_0xc225('0x78')]+=0x1;this[_0xc225('0x1b')][_0x16e822['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x16e822['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x105ddd[_0xc225('0x9e')]=0xa;_0x105ddd[_0xc225('0x9f')]=_0xc225('0x10f');_0x105ddd[_0xc225('0x110')]=_0xc225('0x111');_0x105ddd[_0xc225('0x104')]=this[_0xc225('0x1b')][_0x16e822['queue']]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x105ddd[_0xc225('0xe8')]+=0x1;_0x105ddd[_0xc225('0xf9')]+=0x1;if(_0x105ddd[_0xc225('0xe8')]>=this[_0xc225('0x1b')][_0x16e822[_0xc225('0xaf')]][_0xc225('0x112')]){this[_0xc225('0x109')](_0x105ddd);}else{this[_0xc225('0xba')]({'active':![],'countdropretry':_0x105ddd[_0xc225('0xe8')],'scheduledat':moment()[_0xc225('0xfc')](this[_0xc225('0x1b')][_0x16e822[_0xc225('0xaf')]][_0xc225('0x113')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x2fb59b[_0xc225('0xcd')],'ListId':_0x2fb59b['ListId'],'VoiceQueueId':_0x2fb59b[_0xc225('0xcf')]||undefined,'CampaignId':_0x2fb59b['CampaignId']||undefined})[_0xc225('0xac')](loggerCatch('[rescheduleContact][Drop]'));var _0x1e5ee0=new History(_0x105ddd);_0x1e5ee0['state']=0xa;_0x1e5ee0['statedesc']=_0xc225('0x10f');_0x1e5ee0[_0xc225('0xa1')]=moment()[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e5ee0[_0xc225('0xa0')]=_0x1e5ee0[_0xc225('0xa1')];_0x1e5ee0['calleridname']=_0x105ddd[_0xc225('0x114')];_0x1e5ee0[_0xc225('0x115')]=_0x105ddd[_0xc225('0x115')];this[_0xc225('0xc6')](_0x1e5ee0)[_0xc225('0xac')](loggerCatch(_0xc225('0x116')));}}else{this[_0xc225('0x1b')][_0x16e822[_0xc225('0xaf')]][_0xc225('0x63')]+=0x1;this[_0xc225('0x1b')][_0x16e822[_0xc225('0xaf')]][_0xc225('0x5c')]+=0x1;_0x105ddd[_0xc225('0x9e')]=0xb;_0x105ddd['statedesc']=_0xc225('0x117');_0x105ddd['dropreason']=_0xc225('0x118');_0x105ddd['countabandonedretry']+=0x1;_0x105ddd[_0xc225('0xf9')]+=0x1;if(_0x105ddd['countabandonedretry']>=this['voiceQueues'][_0x16e822[_0xc225('0xaf')]][_0xc225('0x119')]){this[_0xc225('0x109')](_0x105ddd);}else{this[_0xc225('0xba')]({'active':![],'countabandonedretry':_0x105ddd['countabandonedretry'],'scheduledat':moment()[_0xc225('0xfc')](this[_0xc225('0x1b')][_0x16e822['queue']][_0xc225('0x11a')],'minutes')[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x2fb59b[_0xc225('0xcd')],'ListId':_0x2fb59b[_0xc225('0xf4')],'VoiceQueueId':_0x2fb59b['VoiceQueueId']||undefined,'CampaignId':_0x2fb59b[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1e5ee0=new History(_0x105ddd);_0x1e5ee0[_0xc225('0x9e')]=0xb;_0x1e5ee0[_0xc225('0x9f')]=_0xc225('0x117');_0x1e5ee0['starttime']=moment()[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e5ee0['endtime']=_0x1e5ee0['starttime'];_0x1e5ee0[_0xc225('0x114')]=_0x105ddd[_0xc225('0x114')];_0x1e5ee0['calleridnum']=_0x105ddd[_0xc225('0x115')];this[_0xc225('0xc6')](_0x1e5ee0)[_0xc225('0xac')](loggerCatch(_0xc225('0x11b')));}}}}};Dialer[_0xc225('0xa2')][_0xc225('0x11c')]=function(_0x29b75e){if(this[_0xc225('0x11d')][_0x29b75e[_0xc225('0xd9')]]){this['actions'][_0x29b75e['uniqueid']][_0xc225('0xab')]=_0x29b75e[_0xc225('0xab')];}if(this['uniqueId'][_0x29b75e[_0xc225('0xd9')]]){this['uniqueId'][_0x29b75e[_0xc225('0xd9')]][_0xc225('0xab')]=_0x29b75e[_0xc225('0xab')];}};Dialer[_0xc225('0xa2')][_0xc225('0x31')]=function(_0x382dc1){if(strategy[this[_0xc225('0x1b')][this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]][_0xc225('0xaf')]][_0xc225('0x47')]]===_0xc225('0x11f')){if(this['actions'][_0x382dc1[_0xc225('0x11e')]]&&_[_0xc225('0xa8')](this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]][_0xc225('0x120')])&&_0x382dc1[_0xc225('0xaa')]==='1'&&_0x382dc1[_0xc225('0x121')]==='0'){if(this['agents'][_0x382dc1[_0xc225('0x122')]]){if(!this[_0xc225('0x1d')][_0x382dc1[_0xc225('0x122')]][_0xc225('0x120')]){this['agents'][_0x382dc1[_0xc225('0x122')]][_0xc225('0x120')]=!![];this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]]['locked']=!![];this[_0xc225('0x11d')][_0x382dc1['actionid']][_0xc225('0x122')]=_0x382dc1['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]][_0xc225('0xaf')]]['strategy']]||_0xc225('0x123'))===_0xc225('0x123')){if(this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]]){if(this[_0xc225('0x1d')][_0x382dc1[_0xc225('0x122')]]){this[_0xc225('0x11d')][_0x382dc1['actionid']][_0xc225('0x122')]=_0x382dc1[_0xc225('0x122')];if(_['isNil'](this['queueBooked'][this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]][_0xc225('0xaf')]])){this[_0xc225('0x124')][this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]][_0xc225('0xaf')]]=[];}this[_0xc225('0x124')][this['actions'][_0x382dc1[_0xc225('0x11e')]][_0xc225('0xaf')]][_0xc225('0x125')](_['merge'](_[_0xc225('0x126')](this[_0xc225('0x11d')][_0x382dc1[_0xc225('0x11e')]],[_0xc225('0x127'),_0xc225('0x122')]),{'status':_0x382dc1[_0xc225('0xaa')],'paused':_0x382dc1[_0xc225('0x121')]}));}}}};function unlockQueueStatus(_0x2c0e94,_0x155db0){setTimeout(function(){if(_[_0xc225('0x7e')](_0x2c0e94[_0xc225('0x128')])){loggerBooked[_0xc225('0x8e')](_0xc225('0x129'),_0x155db0);}_0x2c0e94[_0xc225('0x128')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x155db0,JSON[_0xc225('0x41')](_[_0xc225('0x126')](_0x2c0e94,[_0xc225('0x36'),_0xc225('0x128')])));},0x1f3);}Dialer[_0xc225('0xa2')]['syncQueueStatusComplete']=function(_0x4b8efb){var _0x48e8ba=this;var _0x3d04e3=_0x48e8ba[_0xc225('0x1b')][_0x48e8ba['actions'][_0x4b8efb['actionid']]['queue']];if(strategy[this[_0xc225('0x1b')][this['actions'][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]['strategy']]===_0xc225('0x11f')){if(this[_0xc225('0x11d')][_0x4b8efb['actionid']]&&this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0x122')]){this[_0xc225('0x1a')][_0xc225('0x12a')](this[_0xc225('0x11d')][_0x4b8efb['actionid']][_0xc225('0x127')],this['actions'][_0x4b8efb[_0xc225('0x11e')]]['stateinterface'])['catch'](function(_0xc71d3c){logger['error'](_0xc225('0x12b'),util[_0xc225('0x8f')](_0xc71d3c,{'showHidden':![],'depth':null}));})[_0xc225('0x12c')](function(){_0x48e8ba[_0xc225('0xb0')](_0x48e8ba[_0xc225('0x1b')][_0x48e8ba[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]);_0x48e8ba['agents'][_0x48e8ba[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0x122')]]['locked']=![];delete _0x48e8ba['actions'][_0x4b8efb[_0xc225('0x11e')]];unlockQueueStatus(_0x3d04e3);});}else{this[_0xc225('0xb0')](this[_0xc225('0x1b')][this['actions'][_0x4b8efb['actionid']][_0xc225('0xaf')]]);this[_0xc225('0xba')]({'active':![],'ContactId':this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xcd')],'ListId':this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]]['ListId'],'VoiceQueueId':this['actions'][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xcf')]||undefined,'CampaignId':this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]];unlockQueueStatus(_0x3d04e3);}}else if((strategy[this[_0xc225('0x1b')][this['actions'][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]][_0xc225('0x47')]]||_0xc225('0x123'))===_0xc225('0x123')){var _0x3262a2;if(this['actions'][_0x4b8efb['actionid']]&&!_[_0xc225('0x3f')](this['queueBooked'][this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]])){if(this[_0xc225('0x26')][_0x48e8ba['actions'][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]){this[_0xc225('0x26')][_0x48e8ba[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]=this[_0xc225('0x26')][this[_0xc225('0x11d')][_0x4b8efb['actionid']][_0xc225('0xaf')]]?this[_0xc225('0x26')][this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]:this['queueBooked'][this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]]?this['queueBooked'][this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]][_0xc225('0x12d')]||0x0:0x0;}this[_0xc225('0x124')][this[_0xc225('0x11d')][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]][_0xc225('0x12d')]=this[_0xc225('0x26')][this['actions'][_0x4b8efb[_0xc225('0x11e')]][_0xc225('0xaf')]];for(var _0x51ac07=0x0;_0x51ac07=0x0;})[_0xc225('0xac')](myreject(_0x32ecd2)));}}else{_0xa34f2d[_0xc225('0x125')](ami[_0xc225('0xa9')]({'action':_0xc225('0x148'),'command':util[_0xc225('0x70')](_0xc225('0x149'),_0xd1b356,!_[_0xc225('0x7e')](config[_0xc225('0x143')][_0x2c47f3])?_0x2c47f3:'')})['then'](function(_0x578ad6){return _0x578ad6[_0xc225('0x14c')][_0xc225('0x14b')]('true')>=0x0;})[_0xc225('0xac')](myreject(_0x32ecd2)));}BPromise[_0xc225('0x14d')](_0xa34f2d)[_0xc225('0xb2')](function(_0x4479c3){var _0x521ff9=_[_0xc225('0x14e')](_0x4479c3);if(_0x521ff9){return _0x6f4aa7(_0x521ff9);}else{_0x5e6daa[_0xc225('0x38')]=_0x53906d?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc225('0x14f');return _0x32ecd2(msgResponse(_0xc225('0x150'),_0xc225('0x145'),_0xc225('0x151')+_0x53906d+'\x20'+_0x568063+_0xc225('0x152')+util[_0xc225('0x8f')](_0xd1b356,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2c47f3));}})[_0xc225('0xac')](function(_0x21fe9d){return _0x32ecd2(msgResponse(_0xc225('0x13e'),_0xc225('0x145'),JSON[_0xc225('0x41')](_0x21fe9d)));});});};Dialer[_0xc225('0xa2')][_0xc225('0x153')]=function(_0x1c7c34){var _0x25e1fa=this;return function(){switch(_0x1c7c34[_0xc225('0x52')]){case'progressive':freeVariablesPredictive(_0x1c7c34);_0x25e1fa['handlePower'](_0x1c7c34,0x1);break;case _0xc225('0x154'):freeVariablesPredictive(_0x1c7c34);_0x25e1fa[_0xc225('0x155')](_0x1c7c34,_0x1c7c34[_0xc225('0x156')]);break;case _0xc225('0x9'):_0x25e1fa[_0xc225('0x9')](_0x1c7c34);break;case'booked':freeVariablesPredictive(_0x1c7c34);_0x25e1fa[_0xc225('0x155')](_0x1c7c34,0x1);break;default:freeVariablesPredictive(_0x1c7c34);logger[_0xc225('0x8e')](_0xc225('0x157'),_0x1c7c34['name'],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xc225('0x158')]=function(_0x58324f){var _0x2df0d2=this;return function(){_0x2df0d2[_0xc225('0x159')](_0x58324f);};};Dialer[_0xc225('0xa2')][_0xc225('0xb')]=function(_0x58bfe1){var _0x3239ae=this;if(isNotPreview(_0x58bfe1[_0xc225('0x52')])){if(isVoiceQueueOutbound(_0x58bfe1['type'])&&isActive(_0x58bfe1['dialActive'])){_0x58bfe1['sendMessageOneNotActive']=!![];BPromise[_0xc225('0xb1')]()[_0xc225('0xb2')](checkIsLoggedIn(_0x58bfe1,_0x58bfe1['loggedIn']))[_0xc225('0xb2')](checkIsActive(_0x58bfe1,_0x58bfe1[_0xc225('0x51')]))[_0xc225('0xb2')](checkInterval(_0x58bfe1))['then'](_0x3239ae[_0xc225('0x13a')](_0x58bfe1))[_0xc225('0xb2')](_0x3239ae[_0xc225('0x15a')](_0x58bfe1['dialGlobalInterval'],_0x58bfe1[_0xc225('0x15b')],_0x58bfe1[_0xc225('0x36')],_0x58bfe1))[_0xc225('0xb2')](_0x3239ae[_0xc225('0x13f')](_0x58bfe1[_0xc225('0x3b')],_0x58bfe1['dialTimezone'],_0x58bfe1['name'],_0x58bfe1))[_0xc225('0xb2')](_0x3239ae[_0xc225('0x153')](_0x58bfe1))[_0xc225('0xac')](loggerCatchQueueSummary(_0xc225('0x15c'),_0x58bfe1));}else{notSendMessagesQueue(_0x58bfe1);}}else{freeVariablesPredictive(_0x58bfe1);}};Dialer[_0xc225('0xa2')][_0xc225('0x139')]=function(){var _0x999ff=this;var _0x27297e;for(var _0x24eb8d in this['campaigns']){if(typeof this[_0xc225('0x1c')][_0x24eb8d]!=='undefined'){_0x27297e=this['campaigns'][_0x24eb8d];if(isCampaignIvr(_0x27297e['type'])&&isActive(_0x27297e[_0xc225('0x6e')])){_0x27297e[_0xc225('0x98')]=!![];BPromise['resolve']()[_0xc225('0xb2')](checkIsActive(_0x27297e,_0x27297e[_0xc225('0x6e')]))['then'](checkInterval(_0x27297e))['then'](_0x999ff[_0xc225('0x13a')](_0x27297e))[_0xc225('0xb2')](_0x999ff[_0xc225('0x15a')](_0x27297e[_0xc225('0x15d')],_0x27297e['dialTimezone'],_0x27297e['name'],_0x27297e))[_0xc225('0xb2')](_0x999ff['checkIfTimeIntervals'](_0x27297e[_0xc225('0x3b')],_0x27297e[_0xc225('0x15b')],_0x27297e[_0xc225('0x36')],_0x27297e))[_0xc225('0xb2')](_0x999ff[_0xc225('0x158')](_0x27297e))[_0xc225('0xac')](loggerCatchQueueSummary(_0xc225('0x15e'),_0x27297e));}else{notSendMessagesCampaign(_0x27297e);}}}};function getCallerIdRandom(_0xf27d57,_0x39df80){var _0x5a874f;var _0x468da9;var _0x2fecf8;if(_0x39df80<=0x0){_0x39df80=0x1;}_0x5a874f=new RegExp(_0xc225('0x15f')+_0x39df80+'}$');_0x468da9=Math[_0xc225('0x160')](0xa,_0x39df80-0x1);_0x2fecf8=Math['pow'](0xa,_0x39df80)-0x1;return util['format']('%s',_[_0xc225('0x161')](_0xf27d57,_0x5a874f,_[_0xc225('0x162')](_0x468da9,_0x2fecf8)));}function extractCalleridName(_0x581801){var _0x17fdf0=_0x581801[_0xc225('0x163')](/"(.*?)"/);return _0x17fdf0?_0x17fdf0[0x1]:_0x581801;}function extractCalleridNumber(_0x4e2f02){var _0x3302a2=_0x4e2f02['match'](/<(.*?)>/);return _0x3302a2?_0x3302a2[0x1]:_0x4e2f02;}Dialer[_0xc225('0xa2')][_0xc225('0x164')]=function(_0x1e7485,_0x23763a){var _0x6f6867=this;var _0x2dc9d9=uuid['v4']();this[_0xc225('0x11d')][_0x2dc9d9]=new Action(_0x1e7485,_0x23763a,_0x2dc9d9);return new BPromise(function(_0x17bc5a,_0x251bee){if(_[_0xc225('0x7e')](_0x1e7485)&&typeof _0x1e7485!==_0xc225('0x165')){return _0x251bee(msgResponse(_0xc225('0x166'),_0xc225('0x145'),_0xc225('0x167')));}if(_[_0xc225('0x7e')](_0x23763a[_0xc225('0x168')][_0xc225('0x169')])||_0x23763a[_0xc225('0x168')]['phone']===null){return _0x251bee(msgResponse(_0xc225('0x166'),_0xc225('0x145'),_0xc225('0x16a')));}var _0x303dd9={'XMD-CALLERID':_0x6f6867['actions'][_0x2dc9d9][_0xc225('0x16b')](),'XMD-AGI':_0x1e7485[_0xc225('0xff')]?util[_0xc225('0x70')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1e7485[_0xc225('0xff')]):_0xc225('0x16c'),'XMD-AGIAFTER':_0x1e7485['dialQueueProject2']?util[_0xc225('0x70')](_0xc225('0x16d'),ipAgi,_0x1e7485[_0xc225('0x16e')]):_0xc225('0x16c'),'XMD-QUEUE':_0x1e7485[_0xc225('0x45')]==='outbound'?util['format'](_0xc225('0x16f'),_0x1e7485['name'],_0x1e7485[_0xc225('0x170')]||'',_0x1e7485[_0xc225('0x105')]?'c':'',_0x1e7485[_0xc225('0x10e')]||0x3):_0xc225('0x16c'),'XMD-CONTACTID':_0x23763a[_0xc225('0xcd')],'XMD-CDRTYPE':_0xc225('0x7'),'CALLERID(all)':_0x6f6867[_0xc225('0x11d')][_0x2dc9d9]['getCaller'](),'XMD-AMD':_0x1e7485[_0xc225('0xd7')]?_0xc225('0x171'):_0xc225('0x16c'),'XMD-DESTINATION':_0xc225('0xd6')};if(_0x1e7485['dialAMDActive']){_0x303dd9[_0xc225('0x172')]=_0x1e7485[_0xc225('0x173')]||0x9c4;_0x303dd9[_0xc225('0x174')]=_0x1e7485[_0xc225('0x175')]||0x5dc;_0x303dd9[_0xc225('0x176')]=_0x1e7485['dialAMDAfterGreetingSilence']||0x320;_0x303dd9[_0xc225('0x177')]=_0x1e7485[_0xc225('0x178')]||0x1388;_0x303dd9[_0xc225('0x179')]=_0x1e7485[_0xc225('0x17a')]||0x64;_0x303dd9['XMD-AMDBETWEENWORDSSILENCE']=_0x1e7485[_0xc225('0x17b')]||0x32;_0x303dd9[_0xc225('0x17c')]=_0x1e7485[_0xc225('0x17d')]||0x3;_0x303dd9['XMD-AMDSILENCETHRESHOLD']=_0x1e7485[_0xc225('0x17e')]||0x100;_0x303dd9['XMD-AMDMAXIMUMWORDLENGTH']=_0x1e7485['dialAMDMaximumWordLength']||0x1388;}if(_0x1e7485[_0xc225('0x45')]===_0xc225('0x46')){_0x303dd9['XMD-VOICEQUEUEID']=_0x23763a[_0xc225('0xcf')];}else{_0x303dd9[_0xc225('0x17f')]=_0x23763a[_0xc225('0xf5')];}for(var _0x21d4c4 in _0x23763a['Contact']){if(typeof _0x23763a[_0xc225('0x168')][_0x21d4c4]!=='undefined'){if(isNotNull(_0x23763a[_0xc225('0x168')][_0x21d4c4])&&_0x21d4c4!=='id'&&_0x21d4c4!=='tags'&&_0x21d4c4!==_0xc225('0x180')&&_0x21d4c4!==_0xc225('0x181')){_0x303dd9[util[_0xc225('0x70')](_0xc225('0x182'),_0xc225('0x183'),_['toUpper'](_0x21d4c4))]=_0x23763a[_0xc225('0x168')][_0x21d4c4];}}}var _0x4ab33e=_0x6f6867['isTrunkReachable'](_0x1e7485['Trunk'])?getCallerId(_0x1e7485[_0xc225('0x6d')][_0xc225('0x184')],_0x1e7485['dialOriginateCallerIdName'],_0x1e7485[_0xc225('0x185')]>0x0?getCallerIdRandom(_0x1e7485[_0xc225('0x54')],_0x1e7485[_0xc225('0x185')]):_0x1e7485['dialOriginateCallerIdNumber']):getCallerId(_[_0xc225('0xa8')](_0x1e7485[_0xc225('0x13b')])?_0x1e7485[_0xc225('0x6d')]['callerid']:_0x1e7485['TrunkBackup'][_0xc225('0x184')],_0x1e7485[_0xc225('0x53')],_0x1e7485[_0xc225('0x185')]>0x0?getCallerIdRandom(_0x1e7485[_0xc225('0x54')],_0x1e7485[_0xc225('0x185')]):_0x1e7485[_0xc225('0x54')]);if(_0x4ab33e){_0x303dd9[_0xc225('0x186')]=_0x6f6867['actions'][_0x2dc9d9][_0xc225('0x187')]=extractCalleridName(_0x4ab33e);_0x303dd9[_0xc225('0x188')]=_0x6f6867[_0xc225('0x11d')][_0x2dc9d9]['originatecalleridnum']=extractCalleridNumber(_0x4ab33e);}return ami[_0xc225('0xa9')]({'actionid':_0x2dc9d9,'action':_0xc225('0x166'),'channel':_0x6f6867[_0xc225('0xd1')](_0x1e7485[_0xc225('0x6d')])?util[_0xc225('0x70')](_0xc225('0x189'),_0x1e7485[_0xc225('0x6d')][_0xc225('0x36')],isNotNull(_0x1e7485['dialPrefix'])?_0x1e7485[_0xc225('0x18a')][_0xc225('0x18b')]()||'':'',_0x1e7485[_0xc225('0x18c')]>0x0?_0x23763a[_0xc225('0x168')][_0xc225('0x169')][_0xc225('0x18d')](_0x1e7485[_0xc225('0x18c')]):_0x23763a['Contact'][_0xc225('0x169')]):util[_0xc225('0x70')](_0xc225('0x189'),_['isNil'](_0x1e7485[_0xc225('0x13b')])?_0x1e7485[_0xc225('0x6d')][_0xc225('0x36')]:_0x1e7485[_0xc225('0x13b')][_0xc225('0x36')],isNotNull(_0x1e7485[_0xc225('0x18a')])?_0x1e7485[_0xc225('0x18a')]['trim']()||'':'',_0x1e7485[_0xc225('0x18c')]>0x0?_0x23763a[_0xc225('0x168')]['phone'][_0xc225('0x18d')](_0x1e7485[_0xc225('0x18c')]):_0x23763a['Contact'][_0xc225('0x169')]),'callerid':_0x4ab33e,'Exten':_0xc225('0xd6'),'Context':_0xc225('0x18e'),'Priority':'1','variable':_0x303dd9,'timeout':(_0x1e7485[_0xc225('0x55')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2dc9d9})['then'](function(_0x3ade5a){return _0x17bc5a(_0x3ade5a);})['catch'](function(_0x130a09){_0x1e7485[_0xc225('0x18f')]+=0x1;var _0x2ddef8=new History(_0x6f6867[_0xc225('0x11d')][_0x2dc9d9]);logger[_0xc225('0x8e')](util['format'](_0xc225('0x190'),JSON[_0xc225('0x41')](_0x130a09)));_0x2ddef8[_0xc225('0x9e')]=0xe;_0x2ddef8['statedesc']=_0xc225('0x191');_0x2ddef8[_0xc225('0xa1')]=moment()[_0xc225('0x70')](_0xc225('0xf3'));_0x2ddef8[_0xc225('0xa0')]=_0x2ddef8[_0xc225('0xa1')];_0x6f6867['createHistory'](_0x2ddef8)['catch'](loggerCatch(_0xc225('0x192')));_0x6f6867[_0xc225('0xc4')](_0x2ddef8)[_0xc225('0xac')](loggerCatch(_0xc225('0x192')))['finally'](function(){delete _0x6f6867[_0xc225('0x11d')][_0x2dc9d9];return _0x251bee(msgResponse(_0xc225('0x166'),_0xc225('0x40'),_0xc225('0x193')));});});});};Dialer[_0xc225('0xa2')][_0xc225('0x194')]=function(_0x159837){var _0x3e1211=this[_0xc225('0x11d')][_0x159837[_0xc225('0x11e')]];if(_0x3e1211){delete this[_0xc225('0x11d')][_0x159837[_0xc225('0x11e')]];_0x3e1211[_0xc225('0x10d')]=moment()[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x222d78=_0x3e1211['type']==='ivr'?this[_0xc225('0x1c')][_0x3e1211[_0xc225('0xaf')]]:this[_0xc225('0x1b')][_0x3e1211[_0xc225('0x195')]()];if(!this[_0xc225('0xd0')](_0x159837['response'])){this['updateOriginated'](_0x222d78);return this[_0xc225('0x196')](_0x3e1211,_0x222d78,_0x159837)[_0xc225('0xac')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x159837[_0xc225('0xd9')]]=_0x3e1211;}};Dialer[_0xc225('0xa2')][_0xc225('0x197')]=function(_0x2d5342,_0x5ac389,_0x136904){var _0x3ba585=new History(_0x5ac389);if(_0x3ba585[_0xc225('0xe6')]+_0x3ba585[_0xc225('0xfa')]+_0x3ba585[_0xc225('0xfb')]+_0x3ba585['countnosuchnumberretry']+_0x3ba585[_0xc225('0xe8')]+_0x3ba585[_0xc225('0xe9')]+_0x3ba585[_0xc225('0xe3')]+_0x3ba585['countagentrejectretry']>=_0x136904[_0xc225('0xeb')]-0x1){return!![];}switch(_0x2d5342){case 0x3:if(_0x3ba585[_0xc225('0xfb')]>=_0x136904[_0xc225('0x198')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3ba585[_0xc225('0xfb')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x199')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x19a')));break;case 0x5:if(_0x3ba585[_0xc225('0xe6')]>=_0x136904['dialBusyMaxRetry']-0x1){return!![];}this[_0xc225('0xba')]({'active':![],'countbusyretry':_0x3ba585[_0xc225('0xe6')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x19b')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585[_0xc225('0xf5')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3ba585[_0xc225('0xfa')]>=_0x136904[_0xc225('0x19c')]-0x1){return!![];}this[_0xc225('0xba')]({'active':![],'countcongestionretry':_0x3ba585['countcongestionretry']+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x19d')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585['ContactId'],'ListId':_0x3ba585['ListId'],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x19e')));break;case 0x0:if(_0x3ba585['countnosuchnumberretry']>=_0x136904[_0xc225('0x19f')]-0x1){return!![];}else{this[_0xc225('0xba')]({'active':![],'countnosuchnumberretry':_0x3ba585[_0xc225('0xe7')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x1a0')],'minutes')[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x1a1')));}break;case 0xa:if(_0x3ba585[_0xc225('0xe8')]>=_0x136904[_0xc225('0x112')]-0x1){return!![];}this[_0xc225('0xba')]({'active':![],'countdropretry':_0x3ba585[_0xc225('0xe8')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x113')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x1a2')));break;case 0xb:if(_0x3ba585[_0xc225('0xe9')]>=_0x136904['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3ba585[_0xc225('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x136904[_0xc225('0x11a')],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585['ContactId'],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585['CampaignId']||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x1a3')));break;case 0x13:if(_0x3ba585[_0xc225('0xe3')]>=_0x136904[_0xc225('0xee')]-0x1){return!![];}this[_0xc225('0xba')]({'active':![],'countmachineretry':_0x3ba585[_0xc225('0xe3')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904['dialMachineRetryFrequency'],_0xc225('0xf2'))[_0xc225('0x70')](_0xc225('0xf3')),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585['VoiceQueueId']||undefined,'CampaignId':_0x3ba585['CampaignId']||undefined})[_0xc225('0xac')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3ba585[_0xc225('0xea')]>=_0x136904[_0xc225('0x1a4')]-0x1){return!![];}this[_0xc225('0xba')]({'active':![],'countagentrejectretry':_0x3ba585[_0xc225('0xea')]+=0x1,'scheduledat':moment()[_0xc225('0xfc')](_0x136904[_0xc225('0x1a5')],'minutes')[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ba585[_0xc225('0xcd')],'ListId':_0x3ba585[_0xc225('0xf4')],'VoiceQueueId':_0x3ba585[_0xc225('0xcf')]||undefined,'CampaignId':_0x3ba585['CampaignId']||undefined})[_0xc225('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xc225('0xa2')][_0xc225('0x196')]=function(_0x15a5fa,_0x49c8d9,_0x431b6f){var _0x57b200=this;var _0x3f9026=new History(_0x15a5fa);return new BPromise(function(_0x47c09a,_0x13799a){if(_[_0xc225('0x7e')](_0x49c8d9)&&typeof _0x49c8d9!==_0xc225('0x165')){return _0x13799a(msgResponse(_0xc225('0x1a6'),_0xc225('0x145'),_0xc225('0x1a7')));}if(_[_0xc225('0x7e')](_0x431b6f)&&typeof _0x431b6f!=='object'){return _0x13799a(msgResponse(_0xc225('0x1a6'),_0xc225('0x145'),_0xc225('0x1a8')));}switch(_0x431b6f['reason']){case'0':_0x49c8d9[_0xc225('0x1a9')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0x0;_0x3f9026[_0xc225('0x9f')]=_0xc225('0x1aa');_0x3f9026[_0xc225('0xe7')]+=0x1;_0x3f9026[_0xc225('0xf9')]+=0x1;ami[_0xc225('0x44')](_0xc225('0x1ab'),ut[_0xc225('0xe4')](_0x15a5fa,_0xc225('0x1ac')));_0x57b200[_0xc225('0xc6')](_0x3f9026)[_0xc225('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x57b200[_0xc225('0x197')](0x0,_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xe7')]>=_0x49c8d9[_0xc225('0x19f')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1ad'));}else{_0x57b200[_0xc225('0xec')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1ad'));}}break;case'3':_0x49c8d9[_0xc225('0x5e')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0x3;_0x3f9026[_0xc225('0x9f')]=_0xc225('0x1ae');_0x3f9026[_0xc225('0xfb')]+=0x1;_0x3f9026[_0xc225('0xf9')]+=0x1;ami[_0xc225('0x44')](_0xc225('0x1af'),ut[_0xc225('0xe4')](_0x15a5fa,_0xc225('0x1b0')));_0x57b200[_0xc225('0xc6')](_0x3f9026)[_0xc225('0xac')](loggerCatch(_0xc225('0x1b1')));if(_0x57b200[_0xc225('0x197')](0x3,_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xfb')]>=_0x49c8d9[_0xc225('0x198')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1b2'));}else{_0x57b200['stateGlobal'](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1b2'));}}break;case'5':_0x49c8d9[_0xc225('0x59')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0x5;_0x3f9026[_0xc225('0x9f')]=_0xc225('0x1b3');_0x3f9026['countbusyretry']+=0x1;_0x3f9026[_0xc225('0xf9')]+=0x1;ami[_0xc225('0x44')](_0xc225('0x1b4'),ut[_0xc225('0xe4')](_0x15a5fa,_0xc225('0x1b5')));_0x57b200[_0xc225('0xc6')](_0x3f9026)[_0xc225('0xac')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x57b200['checkRetriveMax'](0x5,_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xe6')]>=_0x49c8d9[_0xc225('0x1b6')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1b7'));}else{_0x57b200[_0xc225('0xec')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1b7'));}}break;case'8':_0x49c8d9[_0xc225('0x5a')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0x8;_0x3f9026[_0xc225('0x9f')]=_0xc225('0x1b8');_0x3f9026[_0xc225('0xfa')]+=0x1;_0x3f9026['countglobal']+=0x1;ami['emit'](_0xc225('0x1b9'),ut[_0xc225('0xe4')](_0x15a5fa,'congestion'));_0x57b200[_0xc225('0xc6')](_0x3f9026)[_0xc225('0xac')](loggerCatch(_0xc225('0x1ba')));if(_0x57b200[_0xc225('0x197')](0x8,_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xfa')]>=_0x49c8d9[_0xc225('0x19c')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1bb'));}else{_0x57b200['stateGlobal'](_0x3f9026,_0x47c09a,_0x13799a,'reason\x208\x20congestion');}}break;case'11':_0x49c8d9['outboundAbandonedCallsDay']+=0x1;_0x3f9026[_0xc225('0x9e')]=0xb;_0x3f9026[_0xc225('0x9f')]=_0xc225('0x117');_0x3f9026['countabandonedretry']+=0x1;_0x3f9026[_0xc225('0xf9')]+=0x1;_0x57b200['createHistory'](_0x3f9026)[_0xc225('0xac')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x57b200[_0xc225('0x197')](0xb,_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xe9')]>=_0x49c8d9[_0xc225('0x119')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1bc'));}else{_0x57b200[_0xc225('0xec')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1bc'));}}break;case'20':_0x49c8d9[_0xc225('0x5f')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0x14;_0x3f9026[_0xc225('0x9f')]='AgentReject';_0x3f9026[_0xc225('0xea')]+=0x1;_0x3f9026[_0xc225('0xf9')]+=0x1;ami[_0xc225('0x44')]('custom:agentreject',ut[_0xc225('0xe4')](_0x15a5fa,'agentreject'));_0x57b200['createHistory'](_0x3f9026)[_0xc225('0xac')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x57b200['checkRetriveMax'](0x14,_0x15a5fa,_0x49c8d9)){if(_0x3f9026['countagentrejectretry']>=_0x49c8d9[_0xc225('0x1a4')]){_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1bd'));}else{_0x57b200[_0xc225('0xec')](_0x3f9026,_0x47c09a,_0x13799a,_0xc225('0x1bd'));}}break;default:_0x49c8d9[_0xc225('0x60')]+=0x1;_0x3f9026[_0xc225('0x9e')]=0xc;_0x3f9026[_0xc225('0x9f')]=_0x431b6f[_0xc225('0x102')];_0x57b200[_0xc225('0xc6')](_0x3f9026)['catch'](loggerCatch(_0xc225('0x1be')));if(_0x57b200['checkRetriveMax'](_0x431b6f[_0xc225('0x102')],_0x15a5fa,_0x49c8d9)){if(_0x3f9026[_0xc225('0xe6')]+_0x3f9026[_0xc225('0xfa')]+_0x3f9026[_0xc225('0xfb')]+_0x3f9026[_0xc225('0xe7')]+_0x3f9026[_0xc225('0xe8')]+_0x3f9026[_0xc225('0xe9')]+_0x3f9026[_0xc225('0xe3')]+_0x3f9026['countagentrejectretry']>=_0x49c8d9[_0xc225('0xeb')]){_0x57b200[_0xc225('0xec')](_0x3f9026,_0x47c09a,_0x13799a,_0x431b6f[_0xc225('0x102')]);}else{_0x57b200[_0xc225('0xef')](_0x3f9026,_0x47c09a,_0x13799a,_0x431b6f[_0xc225('0x102')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x5d66b0,_0x224dce,_0x5617fa,_0xfbe961){var _0xbf0d9=new Final(_0x5d66b0);_0xbf0d9['state']=0xf;_0xbf0d9[_0xc225('0x9f')]=_0xc225('0x1bf');this[_0xc225('0xef')](_0xbf0d9,_0x224dce,_0x5617fa,_0xfbe961);};Dialer[_0xc225('0xa2')][_0xc225('0xef')]=function(_0x557080,_0x389524,_0xac84c8,_0x1124e8){this[_0xc225('0xc4')](_0x557080)[_0xc225('0xb2')](function(){return _0x389524(msgResponse(_0xc225('0x1a6'),'Success',_0x1124e8));})[_0xc225('0xac')](function(){return _0xac84c8(msgResponse(_0xc225('0x1c0'),_0xc225('0x145'),_0xc225('0x1c1')));});};Dialer[_0xc225('0xa2')]['predictive']=function(_0x580797){var _0x28bd1f=_0x580797[_0xc225('0x1c2')]/0x64;var _0x1f925a=_0x580797[_0xc225('0x5d')]/(_0x580797[_0xc225('0x5d')]+_0x580797['outboundAnswerCallsDay']);var _0x527438=Math[_0xc225('0x1c3')](_0x580797[_0xc225('0x1c4')]*(_0x580797[_0xc225('0x1c5')]/0x64));var _0x45486e=Math[_0xc225('0x1c3')](_0x580797[_0xc225('0x1c4')]*(_0x580797[_0xc225('0x1c6')]/0x64));var _0x1efac4=_0x580797[_0xc225('0x49')]+_0x580797[_0xc225('0x4e')];var _0x5d70b3=Math[_0xc225('0x1c7')](_0x580797['erlangCalls']*_0x580797[_0xc225('0x6b')]*_0x580797['predictiveIntervalHitRate']*_0x580797[_0xc225('0x67')]);if(_[_0xc225('0x7e')](_0x580797[_0xc225('0x89')])){if(!_['isUndefined'](_0x580797[_0xc225('0x24')])){_0x580797[_0xc225('0x24')]=undefined;loggerPredictive[_0xc225('0x8e')](_0xc225('0x1c8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc225('0x7e')](_0x580797[_0xc225('0x8a')])){loggerPredictive[_0xc225('0x8e')](_0xc225('0x1c8'),_0xc225('0x1c9'));clearInterval(_0x580797[_0xc225('0x8a')]);_0x580797['handlePredictive']=undefined;}_0x580797[_0xc225('0x89')]=moment()[_0xc225('0x70')](_0xc225('0xf3'));loggerPredictive['info'](_0x580797['name'],_0xc225('0x1ca'),_0x580797[_0xc225('0x89')]);this[_0xc225('0x155')](_0x580797,0x1);}else if(ifInterval(_0x580797[_0xc225('0x1cb')],_0x580797[_0xc225('0x89')])){this['handlePower'](_0x580797,0x1);loggerPredictiveCalls[_0xc225('0x75')](_0xc225('0x1cc'),_0x580797[_0xc225('0x89')],_0x580797[_0xc225('0x36')]);_0x580797['erlangCalls']=0x0;_0x580797[_0xc225('0x65')]=0x0;}else if(_0x28bd1f<_0x1f925a&&_0x580797[_0xc225('0x1cd')]===_0xc225('0x1ce')){freeVariablesPredictive(_0x580797);loggerPredictive[_0xc225('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc225('0x1cf'),_0x1f925a,_0xc225('0x89'),_0x580797['name']);}else if(_0x5d70b3<_0x580797[_0xc225('0x65')]&&_0x580797[_0xc225('0x1cd')]===_0xc225('0x1ce')){freeVariablesPredictive(_0x580797);loggerPredictive[_0xc225('0x75')](_0xc225('0x1d0'),_0xc225('0x1d1'),_0x5d70b3,'Drop\x20in\x20this\x20interval',_0x580797[_0xc225('0x65')],'startProgressive',_0x580797['name']);}else if(!ifInterval(_0x580797[_0xc225('0x1cb')],_0x580797[_0xc225('0x89')])&&_[_0xc225('0x7e')](_0x580797[_0xc225('0x24')])&&!_[_0xc225('0x7e')](_0x580797[_0xc225('0x89')])){_0x580797['startPredictive']=moment()[_0xc225('0x70')](_0xc225('0xf3'));loggerPredictive['info'](_0x580797[_0xc225('0x36')],_0xc225('0x1d2'),_0x580797['startPredictive']);this[_0xc225('0xb7')](_0x580797['dialPredictiveInterval'])[_0xc225('0xb2')](this[_0xc225('0x1d3')](_0x580797))[_0xc225('0xb2')](mergeDataErlangB(_0x580797))[_0xc225('0xb2')](this[_0xc225('0x1d4')](_0x580797))[_0xc225('0xac')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x580797));}else if(!ifInterval(_0x580797['dialPredictiveInterval'],_0x580797[_0xc225('0x24')])){_0x580797[_0xc225('0x65')]=0x0;_0x580797[_0xc225('0x24')]=moment()[_0xc225('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x580797[_0xc225('0x36')],_0xc225('0x1d5'),_0x580797[_0xc225('0x24')]);clearInterval(_0x580797[_0xc225('0x8a')]);_0x580797[_0xc225('0x8a')]=undefined;this['averageHandleTime'](_0x580797[_0xc225('0x1cb')])['then'](this[_0xc225('0x1d3')](_0x580797))[_0xc225('0xb2')](mergeDataErlangB(_0x580797))[_0xc225('0xb2')](this['startMethodPredictive'](_0x580797))[_0xc225('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x580797));}else if(_0x580797[_0xc225('0x1c4')]&&_0x1efac4<_0x580797[_0xc225('0x1c4')]-_0x45486e){freeVariablesPredictive(_0x580797);loggerPredictive[_0xc225('0x75')](_0x580797[_0xc225('0x36')],_0xc225('0x1d6'),_0x1efac4,_0xc225('0x1d7'),_0x580797[_0xc225('0x1c4')],'-',_0x45486e,'=',_0x580797[_0xc225('0x1c4')]-_0x45486e,')');}else if(_0x580797['predictiveIntervalAvailable']&&_0x1efac4>_0x580797[_0xc225('0x1c4')]+_0x527438){freeVariablesPredictive(_0x580797);loggerPredictive[_0xc225('0x75')](_0x580797[_0xc225('0x36')],_0xc225('0x1d6'),_0x1efac4,_0xc225('0x1d8'),_0x580797[_0xc225('0x1c4')],'+',_0x527438,'=',_0x580797[_0xc225('0x1c4')]+_0x527438,')');}};Dialer[_0xc225('0xa2')][_0xc225('0x1d3')]=function(_0x1a5028){var _0x7cfbf0=this;return function(_0x4125a3){return new BPromise(function(_0x5a0742,_0x55b334){_['merge'](_0x1a5028,_0x4125a3[0x0]);if(checkGetDataPredictive(_0x4125a3[0x0])){var _0x5ba465=_0x1a5028[_0xc225('0x1c4')]=_0x1a5028['talking']+_0x1a5028[_0xc225('0x49')];var _0x529d25=_0x1a5028[_0xc225('0x1cb')]*0x3c;var _0x229c8b=_0x4125a3[0x0][_0xc225('0x62')]+_0x4125a3[0x0][_0xc225('0x7b')];var _0x152204=(_0x4125a3[0x0][_0xc225('0x61')]+_0x4125a3[0x0][_0xc225('0x78')]+_0x4125a3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4125a3[0x0][_0xc225('0x68')];_0x1a5028['predictiveIntervalHitRate']=_0x152204>0x0?_0x152204:0x1;switch(_0x1a5028[_0xc225('0x1cd')]){case'dropRate':var _0x3594cf=_0x1a5028[_0xc225('0x1c2')]/0x64;return _0x7cfbf0[_0xc225('0x1d9')](_0x5ba465,_0x529d25,_0x229c8b,_0x152204,_0x3594cf)[_0xc225('0xb2')](function(_0x405906){return _0x5a0742(_0x405906);});case _0xc225('0x1da'):var _0x225877=_0x1a5028[_0xc225('0x1c2')]/0x64;return _0x7cfbf0[_0xc225('0x1db')](_0x5ba465,_0x529d25,_0x229c8b,_0x152204,_0x225877)[_0xc225('0xb2')](function(_0x2d81ca){return _0x5a0742(_0x2d81ca);});default:return _0x55b334(msgResponse(_0xc225('0x1dc'),_0xc225('0x145'),'Unknown\x20Predictive'));}}else{return _0x55b334(msgResponse('[getDataPredictive]',_0xc225('0x145'),_0xc225('0x1dd')));}});};};Dialer[_0xc225('0xa2')]['getDataPredictiveOld']=function(_0x2fd030){var _0x95165a=this;return function(_0x487afc){return new BPromise(function(_0x15e9c7,_0x3c42bf){_[_0xc225('0x87')](_0x2fd030,_0x487afc[0x0]);if(checkGetDataPredictive(_0x487afc[0x0])){loggerPredictive[_0xc225('0x75')](JSON[_0xc225('0x41')](_0x487afc[0x0]));if(_0x2fd030[_0xc225('0x1cd')]===_0xc225('0x1ce')){return _0x95165a['getVoiceQueueRtPauses'](_0x2fd030['id'])[_0xc225('0xb2')](function(_0x3cc0a4){var _0x217c0b=_0x2fd030[_0xc225('0x4a')]-_0x3cc0a4[0x0][_0xc225('0x1de')];var _0x4ab4dd=_0x2fd030['dialPredictiveInterval']*0x3c;var _0x4d217f=_0x487afc[0x0][_0xc225('0x62')]+_0x487afc[0x0][_0xc225('0x7b')];var _0x2afddd=(_0x487afc[0x0][_0xc225('0x61')]+_0x487afc[0x0][_0xc225('0x78')]+_0x487afc[0x0][_0xc225('0x63')])/_0x487afc[0x0]['predictiveIntervalTotalCalls'];var _0x164e79=_0x2fd030[_0xc225('0x1c2')]/0x64;_0x2fd030[_0xc225('0x1df')]=_0x3cc0a4[0x0]['outboundQueuePauses']||0x0;_0x2fd030[_0xc225('0x66')]=_0x2afddd>0x0?_0x2afddd:0x1;return _0x95165a[_0xc225('0x1d9')](_0x217c0b,_0x4ab4dd,_0x4d217f,_0x2afddd,_0x164e79);})['then'](function(_0x5849a0){return _0x15e9c7(_0x5849a0);})[_0xc225('0xac')](function(_0x4216ef){return _0x3c42bf(msgResponse(_0xc225('0x1e0'),_0xc225('0x145'),JSON['stringify'](_0x4216ef)));});}if(_0x2fd030[_0xc225('0x1cd')]===_0xc225('0x1da')){return _0x95165a[_0xc225('0xc2')](_0x2fd030['id'])[_0xc225('0xb2')](function(_0x15b3e3){var _0x62b849=_0x2fd030[_0xc225('0x4a')]-_0x15b3e3[0x0][_0xc225('0x1de')];var _0x402a31=_0x2fd030[_0xc225('0x1cb')]*0x3c;var _0x5e1685=_0x487afc[0x0][_0xc225('0x62')]+_0x487afc[0x0]['predictiveIntervalAvgHoldtime'];var _0x1b9f8a=(_0x487afc[0x0][_0xc225('0x61')]+_0x487afc[0x0][_0xc225('0x78')]+_0x487afc[0x0][_0xc225('0x63')])/_0x487afc[0x0][_0xc225('0x68')];var _0x133510=_0x2fd030['dialPredictiveOptimizationPercentage']/0x64;_0x2fd030[_0xc225('0x1df')]=_0x15b3e3[0x0][_0xc225('0x1de')]||0x0;_0x2fd030['predictiveIntervalHitRate']=_0x1b9f8a>0x0?_0x1b9f8a:0x1;return _0x95165a['busyFactor'](_0x62b849,_0x402a31,_0x5e1685,_0x1b9f8a,_0x133510);})['then'](function(_0x518676){return _0x15e9c7(_0x518676);})[_0xc225('0xac')](function(_0x40a443){return _0x3c42bf(msgResponse(_0xc225('0x1e0'),'Failure',JSON[_0xc225('0x41')](_0x40a443)));});}}else{return _0x3c42bf(msgResponse('[getDataPredictive]',_0xc225('0x145'),_0xc225('0x1dd')));}});};};Dialer['prototype'][_0xc225('0x1d4')]=function(_0x2b9dd8){var _0x2e15e0=this;return function(){var _0x5aaa77=0x0;var _0x456038=Math[_0xc225('0x1c7')](_0x2b9dd8[_0xc225('0x1e1')]*0x3e8);if(_0x456038>0x0){_0x456038=_0x456038<0x64?0x64:_0x456038;loggerPredictive['info'](_0x2b9dd8[_0xc225('0x36')],'one\x20call\x20every:',_0x456038,_0xc225('0x42'));_0x2b9dd8[_0xc225('0x8a')]=setInterval(function(){_0x2e15e0[_0xc225('0x8a')](_0x2b9dd8);loggerPredictiveCalls[_0xc225('0x75')](_0xc225('0x1e2'),_0x5aaa77+=0x1);},_0x456038);}else{loggerPredictive[_0xc225('0x75')](_0x2b9dd8[_0xc225('0x36')],_0xc225('0x1e3'));}};};Dialer[_0xc225('0xa2')]['checkContactBlack']=function(_0x2b1e45,_0x5426d2){var _0x223e7b=this;return function(_0x386f48){if(_['isEmpty'](_0x386f48)){if(_[_0xc225('0xa8')](_0x5426d2['UserId'])||!_0x5426d2[_0xc225('0x1e4')]){if(_0x2b1e45[_0xc225('0x52')]===_0xc225('0x8')){_0x2b1e45[_0xc225('0x128')]=_[_0xc225('0x7e')](_0x2b1e45[_0xc225('0x128')])?!![]:_0x2b1e45[_0xc225('0x128')];var _0x5df7c5=uuid['v4']();_0x223e7b['actions'][_0x5df7c5]=new Action(_0x2b1e45,_0x5426d2,_0x5df7c5);loggerBooked['info'](_0xc225('0x1e5'),_0x5df7c5,_0xc225('0x1e6'),JSON['stringify'](_0x2b1e45['queueStatusComplete']),_0xc225('0x1e7'),_0x2b1e45[_0xc225('0x36')]);if(_0x2b1e45['queueStatusComplete']){_0x2b1e45[_0xc225('0x128')]=![];_0x223e7b[_0xc225('0x124')][_0x223e7b['actions'][_0x5df7c5][_0xc225('0xaf')]]=[];ami['Action']({'actionid':_0x5df7c5,'action':'queuestatus','queue':_0x2b1e45['name']})[_0xc225('0xac')](function(){_0x223e7b[_0xc225('0xb0')](_0x2b1e45);_0x223e7b['rescheduleContact']({'active':![],'ContactId':_0x223e7b['actions'][_0x5df7c5]['ContactId'],'ListId':_0x223e7b['actions'][_0x5df7c5][_0xc225('0xf4')],'VoiceQueueId':_0x223e7b[_0xc225('0x11d')][_0x5df7c5]['VoiceQueueId']||undefined,'CampaignId':_0x223e7b[_0xc225('0x11d')][_0x5df7c5][_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x1e8')));delete _0x223e7b[_0xc225('0x11d')][_0x5df7c5];});}else{loggerBooked[_0xc225('0x75')]('[booked][checkContactBlack][else]',JSON[_0xc225('0x41')](_0x2b1e45[_0xc225('0x128')]),'Queue:\x20',_0x2b1e45[_0xc225('0x36')]);_0x223e7b[_0xc225('0xb0')](_0x2b1e45);_0x223e7b[_0xc225('0xba')]({'active':![],'ContactId':_0x223e7b['actions'][_0x5df7c5][_0xc225('0xcd')],'ListId':_0x223e7b['actions'][_0x5df7c5][_0xc225('0xf4')],'VoiceQueueId':_0x223e7b[_0xc225('0x11d')][_0x5df7c5][_0xc225('0xcf')]||undefined,'CampaignId':_0x223e7b[_0xc225('0x11d')][_0x5df7c5]['CampaignId']||undefined})['catch'](loggerCatch(_0xc225('0x1e8')));delete _0x223e7b[_0xc225('0x11d')][_0x5df7c5];}}else{return _0x223e7b['actionOriginate'](_0x2b1e45,_0x5426d2);}}else{if(getDiff(_0x5426d2[_0xc225('0x1e9')])<_0x2b1e45[_0xc225('0x1ea')]*0x3c){if(_0x5426d2[_0xc225('0x1eb')]&&!_0x5426d2[_0xc225('0x1eb')][_0xc225('0x1ec')]){_0x223e7b[_0xc225('0x1a')][_0xc225('0x12a')](_0x5426d2['id'])[_0xc225('0x12c')](function(){_0x223e7b[_0xc225('0xb0')](_0x2b1e45);});}else{_0x223e7b['unlockContact']({'active':![]},_0x5426d2['id'],0x1)['finally'](function(){_0x223e7b['updateOriginated'](_0x2b1e45);});}}else{_0x2b1e45[_0xc225('0x1ed')]+=0x1;_0x223e7b[_0xc225('0xb0')](_0x2b1e45);if(_0x2b1e45[_0xc225('0x1ee')]){_0x223e7b[_0xc225('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5426d2[_0xc225('0xcd')],'ListId':_0x5426d2[_0xc225('0xf4')],'VoiceQueueId':_0x5426d2[_0xc225('0xcf')]||undefined,'CampaignId':_0x5426d2[_0xc225('0xf5')]||undefined})[_0xc225('0xac')](loggerCatch(_0xc225('0x1ef')));_0x223e7b['createHistory'](createObjHistory(_0x2b1e45,_0x5426d2,_0xc225('0x1f0'),0x17,'RecallInQueue'))[_0xc225('0xac')](loggerCatch(_0xc225('0x1f1')));}else{_0x223e7b['saveInDb'](createObjHistory(_0x2b1e45,_0x5426d2,_0xc225('0x1f2'),0x16,'RecallFailedTimeout'),_0xc225('0x1f3'),_0xc225('0x1f4'));}}}}else{_0x2b1e45[_0xc225('0x58')]+=0x1;_0x223e7b[_0xc225('0xcc')](createObjHistory(_0x2b1e45,_0x5426d2,_0xc225('0x1f5'),0xd,_0xc225('0x1f6')),_0xc225('0x1f7'),_0xc225('0x1f8'));throw _0xc225('0x1f9');}};};Dialer[_0xc225('0xa2')][_0xc225('0x159')]=function(_0xf2d509){var _0x5eba5a=this;var _0x29b9dd=_0xf2d509[_0xc225('0x1fa')]-_0xf2d509[_0xc225('0x69')]-_0xf2d509[_0xc225('0xbf')];emitCampaignSummary(_0xf2d509);if(_0x29b9dd>0x0){if(_0x29b9dd>this[_0xc225('0x1f')]){_0x29b9dd=this['maxNumberOriginate'];}_0xf2d509[_0xc225('0xbf')]+=_0x29b9dd;this['getContactDialerIvr'](_0xf2d509['id'],_0x29b9dd,_0xf2d509[_0xc225('0x1fb')],_0xf2d509)[_0xc225('0xb2')](function(_0x5bda52){_0xf2d509['temp']-=_0x29b9dd;_0xf2d509[_0xc225('0xbf')]=_0xf2d509[_0xc225('0xbf')]>0x0?_0xf2d509['temp']:0x0;if(!checkContactEmpty(_0x5bda52)){_0xf2d509[_0xc225('0x38')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xc225('0x1fc')+_0xf2d509['name']);}else{_0xf2d509[_0xc225('0x69')]+=_0x5bda52[_0xc225('0x12e')];_0xf2d509['message']='RUNNING';for(var _0x2cd938=0x0;_0x2cd938<_0x5bda52['length'];_0x2cd938+=0x1){_0xf2d509[_0xc225('0x1fd')]+=0x1;if(_[_0xc225('0xa8')](_0x5bda52[_0x2cd938])||_[_0xc225('0xa8')](_0x5bda52[_0x2cd938][_0xc225('0x168')])||_[_0xc225('0xa8')](_0x5bda52[_0x2cd938][_0xc225('0x168')][_0xc225('0x169')])){_0x5eba5a[_0xc225('0xcb')](_0xc225('0x1fe'),_0xf2d509,_0x5bda52[_0x2cd938]);}else{_0x5eba5a[_0xc225('0xb5')](_[_0xc225('0x126')](_0x5bda52[_0x2cd938],[_0xc225('0xf5'),_0xc225('0x1ff')]))[_0xc225('0xb2')](_0x5eba5a['checkContactBlack'](_0xf2d509,_0x5bda52[_0x2cd938]))[_0xc225('0xac')](_0x5eba5a[_0xc225('0xca')](_0xc225('0x200'),_0xf2d509));}}}})['catch'](loggerGetContactDialer(_0xc225('0x201'),_0xf2d509,_0x29b9dd));}};Dialer[_0xc225('0xa2')]['handlePower']=function(_0x3d1c88,_0x1a27f0){var _0x1e9561=this;var _0x3d5653=[];var _0x27f77d=_0x1a27f0>=0x1?_0x1a27f0:0x1;if(_0x3d1c88[_0xc225('0x52')]==='booked'){_0x27f77d=0x1;}var _0xf4c14f=Math[_0xc225('0x1c7')](_0x3d1c88[_0xc225('0x49')]*_0x27f77d)-_0x3d1c88[_0xc225('0x69')]-_0x3d1c88['temp'];emitVoiceQueueSummary(_0x3d1c88);if(_0x3d1c88['dialLimitQueue']>0x0){var _0x3368a7=_0x3d1c88[_0xc225('0x202')]-_0x3d1c88[_0xc225('0x69')]-_0x3d1c88['talking']-_0x3d1c88[_0xc225('0xbf')]-_0x3d1c88[_0xc225('0x4b')];if(_0xf4c14f>_0x3368a7){_0xf4c14f=_0x3368a7;}}if(_0xf4c14f>0x0){if(_0x3d1c88[_0xc225('0x52')]===_0xc225('0x8')){_0xf4c14f=0x1;}if(_0xf4c14f>this[_0xc225('0x1f')]){_0xf4c14f=this[_0xc225('0x1f')];}_0x3d1c88['temp']+=_0xf4c14f;for(var _0x4d96ec in this[_0xc225('0x1d')]){if(typeof this[_0xc225('0x1d')][_0x4d96ec]!==_0xc225('0x91')){if(this[_0xc225('0x1d')][_0x4d96ec][_0xc225('0x9e')]===_0xc225('0x203')&&this[_0xc225('0x1d')][_0x4d96ec][_0xc225('0xaa')]===_0xc225('0x204')){_0x3d5653[_0xc225('0x125')](this['agents'][_0x4d96ec]['id']);}}}this[_0xc225('0xbe')](_0x3d1c88['id'],_0x3d5653,_0xf4c14f,_0x3d1c88[_0xc225('0x1fb')],_0x3d1c88)[_0xc225('0xb2')](function(_0x5f5033){_0x3d1c88[_0xc225('0xbf')]-=_0xf4c14f;_0x3d1c88[_0xc225('0xbf')]=_0x3d1c88[_0xc225('0xbf')]>0x0?_0x3d1c88[_0xc225('0xbf')]:0x0;if(!checkContactEmpty(_0x5f5033)){_0x1e9561['countReScheduled'](_0x3d1c88)[_0xc225('0xb2')](sendMessageReschedule(_0x3d1c88))[_0xc225('0xac')](loggerCatch(_0xc225('0x205')));}else{_0x3d1c88['originated']+=_0x5f5033[_0xc225('0x12e')];_0x3d1c88[_0xc225('0x38')]=_0x3d1c88[_0xc225('0x52')]===_0xc225('0x8')?_0xc225('0x171'):_0xc225('0x206');for(var _0x2a4827=0x0;_0x2a4827<_0x5f5033[_0xc225('0x12e')];_0x2a4827+=0x1){if(_[_0xc225('0xa8')](_0x5f5033[_0x2a4827])||_['isNil'](_0x5f5033[_0x2a4827][_0xc225('0x168')])||_[_0xc225('0xa8')](_0x5f5033[_0x2a4827][_0xc225('0x168')][_0xc225('0x169')])){_0x1e9561[_0xc225('0xcb')](_0xc225('0x1fe'),_0x3d1c88,_0x5f5033[_0x2a4827]);}else{_0x1e9561['checkIsBlackList'](_['pick'](_0x5f5033[_0x2a4827],[_0xc225('0xcf'),_0xc225('0x1ff')]))[_0xc225('0xb2')](_0x1e9561[_0xc225('0x207')](_0x3d1c88,_0x5f5033[_0x2a4827]))[_0xc225('0xac')](_0x1e9561[_0xc225('0xca')](_0xc225('0x1fe'),_0x3d1c88));}}}})[_0xc225('0xac')](loggerGetContactDialer('[getContactDialer2]',_0x3d1c88,_0xf4c14f));}};Dialer[_0xc225('0xa2')]['handlePredictive']=function(_0x59e769){if(_0x59e769[_0xc225('0x202')]>0x0){var _0x5cb8ce=_0x59e769[_0xc225('0x202')]-_0x59e769['originated']-_0x59e769[_0xc225('0x4e')];if(_0x5cb8ce>0x0){this[_0xc225('0x208')](_0x59e769);}else{loggerPredictiveCalls['info'](_0xc225('0x209'));}}else{this[_0xc225('0x208')](_0x59e769);}};Dialer['prototype'][_0xc225('0x208')]=function(_0x1a347c){var _0x1c60b2=this;var _0x3a9cd8=[];_0x1a347c[_0xc225('0x69')]+=0x1;for(var _0x292c12 in this[_0xc225('0x1d')]){if(typeof this['agents'][_0x292c12]!==_0xc225('0x91')){if(this[_0xc225('0x1d')][_0x292c12][_0xc225('0x9e')]==='not_inuse'&&this[_0xc225('0x1d')][_0x292c12][_0xc225('0xaa')]===_0xc225('0x204')){_0x3a9cd8[_0xc225('0x125')](this[_0xc225('0x1d')][_0x292c12]['id']);}}}this[_0xc225('0xbe')](_0x1a347c['id'],_0x3a9cd8,0x1,_0x1a347c[_0xc225('0x1fb')],_0x1a347c)[_0xc225('0xb2')](function(_0x42a92d){if(!checkContactEmpty(_0x42a92d)){checkContactLowerLimitOriginate(_0x1a347c,0x1,0x0);_0x1c60b2['countReScheduled'](_0x1a347c)[_0xc225('0xb2')](sendMessageReschedule(_0x1a347c))[_0xc225('0xac')](loggerCatch(_0xc225('0x205')));}else{_0x1a347c[_0xc225('0x38')]='RUNNING';if(_[_0xc225('0xa8')](_0x42a92d[0x0])||_[_0xc225('0xa8')](_0x42a92d[0x0][_0xc225('0x168')])||_[_0xc225('0xa8')](_0x42a92d[0x0][_0xc225('0x168')][_0xc225('0x169')])){_0x1c60b2[_0xc225('0xcb')]('[actionOriginate]\x20',_0x1a347c,_0x42a92d[0x0]);}else{_0x1c60b2[_0xc225('0xb3')](_[_0xc225('0x126')](_0x42a92d[0x0],['VoiceQueueId',_0xc225('0x1ff')]))[_0xc225('0xb2')](_0x1c60b2[_0xc225('0x207')](_0x1a347c,_0x42a92d[0x0]))[_0xc225('0xac')](_0x1c60b2[_0xc225('0xca')]('[actionOriginatePredictive]\x20',_0x1a347c));}}})[_0xc225('0xac')](loggerGetContactDialer(_0xc225('0x20a'),_0x1a347c,0x1));emitVoiceQueueSummary(_0x1a347c);};Dialer[_0xc225('0xa2')][_0xc225('0x1d9')]=function(_0x1cc93f,_0x2e2a9f,_0x28e57e,_0x5dc935,_0xd3106c,_0x23cdef){loggerPredictive[_0xc225('0x75')](_0xc225('0x20b'));loggerPredictive[_0xc225('0x75')](_0xc225('0x20c'),_0x1cc93f);loggerPredictive[_0xc225('0x75')](_0xc225('0x20d'),_0x2e2a9f);loggerPredictive[_0xc225('0x75')](_0xc225('0x20e'),_0x28e57e);loggerPredictive[_0xc225('0x75')](_0xc225('0x20f'),_0x5dc935);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd3106c);loggerPredictive['info'](_0xc225('0x7d'));return new BPromise(function(_0x3078f1,_0x2de271){if(_0x1cc93f<=0x0||isNaN(_0x1cc93f)){return _0x2de271(msgResponse(_0xc225('0x210'),_0xc225('0x40'),_0xc225('0x211')+_0x1cc93f));}if(_0x28e57e<=0x0||isNaN(_0x28e57e)){return _0x2de271(msgResponse(_0xc225('0x210'),_0xc225('0x40'),'Ts\x20=\x20'+_0x28e57e));}if(_0x5dc935<=0x0||isNaN(_0x5dc935)){return _0x2de271(msgResponse(_0xc225('0x210'),_0xc225('0x40'),_0xc225('0x212')+_0x5dc935));}if(_0x2e2a9f<=0x0||isNaN(_0x2e2a9f)){return _0x2de271(msgResponse(_0xc225('0x210'),_0xc225('0x40'),_0xc225('0x213')+_0x2e2a9f));}if(_0xd3106c<=0x0||isNaN(_0xd3106c)){return _0x2de271(msgResponse(_0xc225('0x210'),_0xc225('0x40'),_0xc225('0x214')+_0xd3106c));}_0x23cdef=_0x23cdef||0x0;var _0x16e639=0x1/_0x28e57e;var _0x5d66c1=0x0;var _0x41ddf1=0x0;var _0x460679=0x0;var _0xa87237=0x0;for(var _0x4266b3=0x0;_0x460679<_0xd3106c;_0x4266b3+=0x1){_0x41ddf1=_0x4266b3/_0x2e2a9f;_0x5d66c1=(_0x5dc935*_0x41ddf1+_0x23cdef)/_0x16e639;_0x460679=erlangb(_0x5d66c1,_0x1cc93f);_0xa87237=_0x5d66c1/_0x1cc93f*(0x1-erlangb(_0x5d66c1,_0x1cc93f));}return _0x3078f1({'erlangCalls':_0x4266b3,'erlangCallToSecond':_0x2e2a9f/_0x4266b3,'erlangAbandonmentRate':_0x460679,'erlangBusyFactor':_0xa87237});});};Dialer[_0xc225('0xa2')][_0xc225('0x1db')]=function(_0x3b0ba2,_0x46bc61,_0x5f4bf0,_0x4a3655,_0x9aa15c,_0x2f1ab2){loggerPredictive[_0xc225('0x75')](_0xc225('0x215'));loggerPredictive[_0xc225('0x75')](_0xc225('0x20c'),_0x3b0ba2);loggerPredictive[_0xc225('0x75')](_0xc225('0x20d'),_0x46bc61);loggerPredictive[_0xc225('0x75')](_0xc225('0x20e'),_0x5f4bf0);loggerPredictive[_0xc225('0x75')]('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',_0x4a3655);loggerPredictive[_0xc225('0x75')](_0xc225('0x216'),_0x9aa15c);loggerPredictive[_0xc225('0x75')](_0xc225('0x7d'));return new BPromise(function(_0x1404d2,_0x5195f5){if(_0x3b0ba2<=0x0||isNaN(_0x3b0ba2)){return _0x5195f5(msgResponse(_0xc225('0x217'),_0xc225('0x40'),_0xc225('0x211')+_0x3b0ba2));}if(_0x5f4bf0<=0x0||isNaN(_0x5f4bf0)){return _0x5195f5(msgResponse(_0xc225('0x217'),'Error',_0xc225('0x218')+_0x5f4bf0));}if(_0x4a3655<=0x0||isNaN(_0x4a3655)){return _0x5195f5(msgResponse('[busyFactor]',_0xc225('0x40'),_0xc225('0x212')+_0x4a3655));}if(_0x46bc61<=0x0||isNaN(_0x46bc61)){return _0x5195f5(msgResponse('[busyFactor]',_0xc225('0x40'),_0xc225('0x213')+_0x46bc61));}if(_0x9aa15c<=0x0||isNaN(_0x9aa15c)){return _0x5195f5(msgResponse(_0xc225('0x217'),_0xc225('0x40'),_0xc225('0x219')+_0x9aa15c));}_0x2f1ab2=_0x2f1ab2||0x0;var _0x280494=0x1/_0x5f4bf0;var _0x33ee9a=0x0;var _0x2c2a15=0x0;var _0x3d14fa=0x0;var _0x3d3104=0x0;for(var _0x58b417=0x0;_0x3d3104<_0x9aa15c;_0x58b417+=0x1){_0x2c2a15=_0x58b417/_0x46bc61;_0x33ee9a=(_0x4a3655*_0x2c2a15+_0x2f1ab2)/_0x280494;_0x3d14fa=erlangb(_0x33ee9a,_0x3b0ba2);_0x3d3104=_0x33ee9a/_0x3b0ba2*(0x1-erlangb(_0x33ee9a,_0x3b0ba2));}return _0x1404d2({'erlangCalls':_0x58b417,'erlangCallToSecond':_0x46bc61/_0x58b417,'erlangAbandonmentRate':_0x3d14fa,'erlangBusyFactor':_0x3d3104});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bf6464e..a072321 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 _0xfe86=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0xfe86,0xd3));var _0x6fe8=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0xfe86[_0x59616b];return _0x5c4523;};'use strict';var util=require(_0x6fe8('0x0'));var _=require(_0x6fe8('0x1'));var moment=require(_0x6fe8('0x2'));function getSeconds(_0x20209b,_0x407e2e){var _0x361e6e=moment(_0x20209b)[_0x6fe8('0x3')](0x0);var _0x502ea1=moment(_0x407e2e)['milliseconds'](0x0);return _0x361e6e[_0x6fe8('0x4')](_0x502ea1,_0x6fe8('0x5'));}function QueueCallerAbandon(_0x4dd928,_0x1ef41c){this[_0x6fe8('0x6')]=_0x4dd928['scheduledat'];this['type']=_0x4dd928['type'];this[_0x6fe8('0x7')]=_0x4dd928[_0x6fe8('0x8')]===_0x6fe8('0x9')?_0x6fe8('0xa'):_0x4dd928[_0x6fe8('0x8')];this[_0x6fe8('0xb')]=_0x4dd928[_0x6fe8('0xb')];this[_0x6fe8('0xc')]=_0x4dd928['countcongestionretry'];this[_0x6fe8('0xd')]=_0x4dd928[_0x6fe8('0xd')];this[_0x6fe8('0xe')]=_0x4dd928[_0x6fe8('0xb')]+_0x4dd928['countcongestionretry']+_0x4dd928[_0x6fe8('0xd')]+_0x4dd928[_0x6fe8('0xf')]+_0x4dd928['countdropretry']+_0x4dd928[_0x6fe8('0x10')]+_0x4dd928['countmachineretry']+_0x4dd928[_0x6fe8('0x11')];this['countnosuchnumberretry']=_0x4dd928[_0x6fe8('0xf')];this[_0x6fe8('0x12')]=_0x4dd928[_0x6fe8('0x12')];this[_0x6fe8('0x10')]=_0x4dd928[_0x6fe8('0x10')];this[_0x6fe8('0x13')]=_0x4dd928[_0x6fe8('0x13')];this[_0x6fe8('0x11')]=_0x4dd928['countagentrejectretry'];this[_0x6fe8('0x14')]=_0x1ef41c['uniqueid'];this[_0x6fe8('0x15')]=_0x4dd928[_0x6fe8('0x16')];this['calleridnum']=_0x4dd928[_0x6fe8('0x17')];this[_0x6fe8('0x18')]=_0x4dd928[_0x6fe8('0x18')];this[_0x6fe8('0x19')]=_0x4dd928[_0x6fe8('0x19')];this[_0x6fe8('0x1a')]=_0x4dd928[_0x6fe8('0x1a')];this[_0x6fe8('0x1b')]=this[_0x6fe8('0x1a')];this[_0x6fe8('0x1c')]=getSeconds(_0x4dd928['responsetime'],_0x4dd928[_0x6fe8('0x18')]);this[_0x6fe8('0x1d')]=getSeconds(this[_0x6fe8('0x1a')],_0x4dd928[_0x6fe8('0x19')]);this[_0x6fe8('0x1e')]=0x0;this['queue']=_0x1ef41c[_0x6fe8('0xa')];this[_0x6fe8('0x1f')]=_0x1ef41c['connectedlinename'];this[_0x6fe8('0x20')]=_0x1ef41c[_0x6fe8('0x20')];this[_0x6fe8('0x21')]=_0x4dd928['callback'];this[_0x6fe8('0x22')]=_0x4dd928[_0x6fe8('0x22')];this['callbackat']=_0x4dd928[_0x6fe8('0x23')];this['recallme']=_0x4dd928[_0x6fe8('0x24')];this['ContactId']=_0x4dd928['ContactId'];this[_0x6fe8('0x25')]=_0x4dd928[_0x6fe8('0x25')];this[_0x6fe8('0x26')]=_0x4dd928[_0x6fe8('0x26')];this[_0x6fe8('0x27')]=_0x4dd928[_0x6fe8('0x27')];this[_0x6fe8('0x28')]=_0x4dd928[_0x6fe8('0x28')];this[_0x6fe8('0x29')]=_0x4dd928[_0x6fe8('0x29')]||'';this['originatecalleridname']=_0x4dd928[_0x6fe8('0x2a')]||'';}module[_0x6fe8('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x3783=['diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds'];(function(_0x10f50d,_0x1b200c){var _0x24128c=function(_0x18819a){while(--_0x18819a){_0x10f50d['push'](_0x10f50d['shift']());}};_0x24128c(++_0x1b200c);}(_0x3783,0x1dd));var _0x3378=function(_0x3ec338,_0x180ce4){_0x3ec338=_0x3ec338-0x0;var _0x17429a=_0x3783[_0x3ec338];return _0x17429a;};'use strict';var util=require('util');var _=require(_0x3378('0x0'));var moment=require(_0x3378('0x1'));function getSeconds(_0x2b1b03,_0x354c24){var _0x384a24=moment(_0x2b1b03)[_0x3378('0x2')](0x0);var _0x5d1ad0=moment(_0x354c24)[_0x3378('0x2')](0x0);return _0x384a24[_0x3378('0x3')](_0x5d1ad0,'seconds');}function QueueCallerAbandon(_0x3f5f5c,_0x23958d){this[_0x3378('0x4')]=_0x3f5f5c[_0x3378('0x4')];this[_0x3378('0x5')]=_0x3f5f5c[_0x3378('0x5')];this['campaigntype']=_0x3f5f5c[_0x3378('0x5')]===_0x3378('0x6')?_0x3378('0x7'):_0x3f5f5c[_0x3378('0x5')];this['countbusyretry']=_0x3f5f5c[_0x3378('0x8')];this[_0x3378('0x9')]=_0x3f5f5c[_0x3378('0x9')];this['countnoanswerretry']=_0x3f5f5c['countnoanswerretry'];this['countglobal']=_0x3f5f5c[_0x3378('0x8')]+_0x3f5f5c['countcongestionretry']+_0x3f5f5c['countnoanswerretry']+_0x3f5f5c[_0x3378('0xa')]+_0x3f5f5c['countdropretry']+_0x3f5f5c[_0x3378('0xb')]+_0x3f5f5c[_0x3378('0xc')]+_0x3f5f5c[_0x3378('0xd')];this[_0x3378('0xa')]=_0x3f5f5c['countnosuchnumberretry'];this[_0x3378('0xe')]=_0x3f5f5c[_0x3378('0xe')];this['countabandonedretry']=_0x3f5f5c[_0x3378('0xb')];this['countmachineretry']=_0x3f5f5c[_0x3378('0xc')];this[_0x3378('0xd')]=_0x3f5f5c[_0x3378('0xd')];this[_0x3378('0xf')]=_0x23958d[_0x3378('0xf')];this[_0x3378('0x10')]=_0x3f5f5c[_0x3378('0x11')];this[_0x3378('0x12')]=_0x3f5f5c[_0x3378('0x13')];this[_0x3378('0x14')]=_0x3f5f5c[_0x3378('0x14')];this[_0x3378('0x15')]=_0x3f5f5c[_0x3378('0x15')];this[_0x3378('0x16')]=_0x3f5f5c[_0x3378('0x16')];this['endtime']=this[_0x3378('0x16')];this[_0x3378('0x17')]=getSeconds(_0x3f5f5c[_0x3378('0x15')],_0x3f5f5c[_0x3378('0x14')]);this['holdtime']=getSeconds(this['droptime'],_0x3f5f5c['responsetime']);this[_0x3378('0x18')]=0x0;this[_0x3378('0x7')]=_0x23958d[_0x3378('0x7')];this[_0x3378('0x19')]=_0x23958d[_0x3378('0x1a')];this[_0x3378('0x1b')]=_0x23958d[_0x3378('0x1b')];this[_0x3378('0x1c')]=_0x3f5f5c[_0x3378('0x1c')];this['callbackuniqueid']=_0x3f5f5c[_0x3378('0x1d')];this['callbackat']=_0x3f5f5c[_0x3378('0x1e')];this['recallme']=_0x3f5f5c[_0x3378('0x1f')];this[_0x3378('0x20')]=_0x3f5f5c[_0x3378('0x20')];this[_0x3378('0x21')]=_0x3f5f5c[_0x3378('0x21')];this[_0x3378('0x22')]=_0x3f5f5c[_0x3378('0x22')];this[_0x3378('0x23')]=_0x3f5f5c[_0x3378('0x23')];this[_0x3378('0x24')]=_0x3f5f5c['CampaignId'];this[_0x3378('0x25')]=_0x3f5f5c[_0x3378('0x25')]||'';this[_0x3378('0x26')]=_0x3f5f5c['originatecalleridname']||'';}module[_0x3378('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 735cbab..7b6527b 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x1bff46,_0x19b763){var _0xf14fe4=function(_0xf3af70){while(--_0xf3af70){_0x1bff46['push'](_0x1bff46['shift']());}};_0xf14fe4(++_0x19b763);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x4800ce,_0xf5b53e){var _0x2b3c51=function(_0x468b10){while(--_0x468b10){_0x4800ce['push'](_0x4800ce['shift']());}};_0x2b3c51(++_0xf5b53e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index f371915..742a34e 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 _0xebbc=['pick','update','AttachmentId','SENDING\x20FAILED\x20','catch','[Fax][Message][Error][NoUpdate1]','logger','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','bind','varset','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','then','notify','calleridnum','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge'];(function(_0x1579bf,_0x539006){var _0x10cfd0=function(_0x17efa0){while(--_0x17efa0){_0x1579bf['push'](_0x1579bf['shift']());}};_0x10cfd0(++_0x539006);}(_0xebbc,0x1eb));var _0xcebb=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xebbc[_0x1fafa5];return _0xcf08c9;};'use strict';var util=require(_0xcebb('0x0'));var _=require(_0xcebb('0x1'));var BPromise=require(_0xcebb('0x2'));var uuid=require(_0xcebb('0x3'));var moment=require('moment');var path=require(_0xcebb('0x4'));var tiff2pdf=require(_0xcebb('0x5'));var gs=require(_0xcebb('0x6'));var logger=require('../../../config/logger')(_0xcebb('0x7'));var ami=require('../ami');var rpcDb=require(_0xcebb('0x8'));var Channel=require(_0xcebb('0x9'));var ut=require(_0xcebb('0xa'));var Action=require(_0xcebb('0xb'));var faxAccount=require(_0xcebb('0xc'));var attachment=require(_0xcebb('0xd'));var faxMessage=require(_0xcebb('0xe'));function Fax(_0x1b08f4){this[_0xcebb('0xf')]={};this[_0xcebb('0x10')]=_0x1b08f4[_0xcebb('0x10')];this[_0xcebb('0x11')]=_0x1b08f4[_0xcebb('0x11')];this[_0xcebb('0x12')]={};ami['on']('newchannel',this['syncNewchannel'][_0xcebb('0x13')](this));ami['on'](_0xcebb('0x14'),this[_0xcebb('0x15')][_0xcebb('0x13')](this));ami['on'](_0xcebb('0x16'),this['syncNewState'][_0xcebb('0x13')](this));ami['on'](_0xcebb('0x17'),this[_0xcebb('0x18')][_0xcebb('0x13')](this));ami['on'](_0xcebb('0x19'),this[_0xcebb('0x1a')]['bind'](this));ami['on']('receivefax',this['syncReceiveFax'][_0xcebb('0x13')](this));ami['on']('hangup',this[_0xcebb('0x1b')][_0xcebb('0x13')](this));ami['on'](_0xcebb('0x1c'),this['syncOriginateResponse'][_0xcebb('0x13')](this));}Fax[_0xcebb('0x1d')]['syncNewchannel']=function(_0x5a6fa7){if(_0x5a6fa7[_0xcebb('0x1e')]===_0xcebb('0x1f')){for(var _0x37d59e in this['faxAccounts']){if(this[_0xcebb('0x10')][_0xcebb('0x20')](_0x37d59e)){if(_0x5a6fa7['exten']===this[_0xcebb('0x10')][_0x37d59e][_0xcebb('0x21')]){this[_0xcebb('0xf')][_0x5a6fa7[_0xcebb('0x22')]]={};this[_0xcebb('0xf')][_0x5a6fa7[_0xcebb('0x22')]][_0xcebb('0x23')]=_0x5a6fa7[_0xcebb('0x23')];this['channels'][_0x5a6fa7['uniqueid']]['id']=this[_0xcebb('0x10')][_0x37d59e]['id'];this[_0xcebb('0xf')][_0x5a6fa7[_0xcebb('0x22')]][_0xcebb('0x24')]=this[_0xcebb('0x10')][_0x37d59e][_0xcebb('0x24')];logger[_0xcebb('0x25')](_0x5a6fa7[_0xcebb('0x22')],_0xcebb('0x26'));}}}}if(this[_0xcebb('0x12')][_0x5a6fa7[_0xcebb('0x22')]]){this[_0xcebb('0xf')][_0x5a6fa7['uniqueid']]={};this[_0xcebb('0xf')][_0x5a6fa7['uniqueid']][_0xcebb('0x23')]=_0x5a6fa7[_0xcebb('0x23')];logger['info'](_0x5a6fa7[_0xcebb('0x22')],_0xcebb('0x26'));}};Fax[_0xcebb('0x1d')][_0xcebb('0x15')]=function(_0x4ed9ca){if(this[_0xcebb('0xf')][_0x4ed9ca[_0xcebb('0x22')]]){for(var _0x9a95c0 in _0x4ed9ca[_0xcebb('0x27')]){if(_0x4ed9ca[_0xcebb('0x27')][_0xcebb('0x20')](_0x9a95c0)){this[_0xcebb('0xf')][_0x4ed9ca[_0xcebb('0x22')]][_0x9a95c0]=_0x4ed9ca[_0xcebb('0x28')];}}}};Fax[_0xcebb('0x1d')][_0xcebb('0x29')]=function(_0x18bc0b){if(this[_0xcebb('0xf')][_0x18bc0b[_0xcebb('0x22')]]){this[_0xcebb('0xf')][_0x18bc0b[_0xcebb('0x22')]][_0xcebb('0x2a')]=_0x18bc0b[_0xcebb('0x2a')];this['channels'][_0x18bc0b[_0xcebb('0x22')]][_0xcebb('0x2b')]=_0x18bc0b['channelstatedesc'];}};Fax['prototype'][_0xcebb('0x18')]=function(_0x3a2eb0){if(this[_0xcebb('0xf')][_0x3a2eb0[_0xcebb('0x22')]]){for(var _0x304620 in _0x3a2eb0[_0xcebb('0x27')]){if(_0x3a2eb0[_0xcebb('0x27')][_0xcebb('0x20')](_0x304620)){this[_0xcebb('0xf')][_0x3a2eb0[_0xcebb('0x22')]][_0x304620]=_0x3a2eb0[_0xcebb('0x28')];}}}};Fax[_0xcebb('0x1d')][_0xcebb('0x1a')]=function(_0x215c98){if(this['channels'][_0x215c98[_0xcebb('0x22')]]){this[_0xcebb('0xf')][_0x215c98[_0xcebb('0x22')]][_0xcebb('0x2c')]=_0x215c98[_0xcebb('0x2c')];this[_0xcebb('0xf')][_0x215c98[_0xcebb('0x22')]][_0xcebb('0x2d')]=_0x215c98['status'];this[_0xcebb('0xf')][_0x215c98['uniqueid']][_0xcebb('0x21')]=_0x215c98[_0xcebb('0x21')];this[_0xcebb('0xf')][_0x215c98[_0xcebb('0x22')]][_0xcebb('0x2e')]=_0x215c98[_0xcebb('0x2e')];logger[_0xcebb('0x25')](_0x215c98['uniqueid'],_0xcebb('0x2f'));}};Fax['prototype']['syncReceiveFax']=function(_0x224be5){var _0x4ed7c7=this;if(this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]]){var _0x539f5b=this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]]['id'];this['channels'][_0x224be5['uniqueid']]['remotestationid']=_0x224be5['remotestationid'];this['channels'][_0x224be5[_0xcebb('0x22')]][_0xcebb('0x30')]=_0x224be5[_0xcebb('0x30')];this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]][_0xcebb('0x21')]=_0x224be5[_0xcebb('0x21')];this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]]['resolution']=_0x224be5['resolution'];this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]][_0xcebb('0x31')]=_0x224be5[_0xcebb('0x31')];this['channels'][_0x224be5['uniqueid']]['filename']=_0x224be5[_0xcebb('0x2e')];this[_0xcebb('0xf')][_0x224be5[_0xcebb('0x22')]]['calleridnum']=_0x224be5['calleridnum'];if(this['channels'][_0x224be5[_0xcebb('0x22')]][_0xcebb('0x30')]>0x0){tiff2pdf(_0x224be5['filename'],_0xcebb('0x32'),function(_0x2dc61b){logger[_0xcebb('0x25')](_0x224be5['uniqueid'],_0xcebb('0x33'),_0x2dc61b['message']);attachment[_0xcebb('0x34')]({'name':path[_0xcebb('0x35')](_0x224be5[_0xcebb('0x2e')])[_0xcebb('0x24')],'basename':path[_0xcebb('0x35')](_0x224be5['filename'])[_0xcebb('0x24')]+_0xcebb('0x36'),'type':'application/pdf'})[_0xcebb('0x37')](function(_0x332201){faxAccount[_0xcebb('0x38')](_0x539f5b,{'from':_0x224be5[_0xcebb('0x39')],'mapKey':_0xcebb('0x7'),'body':path[_0xcebb('0x35')](_0x224be5[_0xcebb('0x2e')])[_0xcebb('0x24')]+_0xcebb('0x36'),'AttachmentId':_0x332201['id']})['catch'](function(_0x490f0d){logger[_0xcebb('0x3a')](_0x224be5[_0xcebb('0x22')],_0xcebb('0x3b'),JSON[_0xcebb('0x3c')](_0x490f0d));});})['catch'](function(_0x369474){logger[_0xcebb('0x3a')](_0x224be5[_0xcebb('0x22')],_0xcebb('0x3d'),JSON[_0xcebb('0x3c')](_0x369474));});});}logger[_0xcebb('0x25')](_0x224be5[_0xcebb('0x22')],'\x20receiveFax\x20');}};Fax[_0xcebb('0x1d')][_0xcebb('0x3e')]=function(_0x338091){if(this['actions'][_0x338091['uniqueid']]){_[_0xcebb('0x3f')](this['channels'][_0x338091[_0xcebb('0x22')]],_[_0xcebb('0x40')](_0x338091,['response','reason']));}};function updateStatus(_0x6b8fba){if(_0x6b8fba['AttachmentId']){faxMessage[_0xcebb('0x41')](_0x6b8fba[_0xcebb('0x42')],{'failMessage':_0xcebb('0x43')})[_0xcebb('0x37')](function(_0x3252dd){ut['logger']('[Fax][Message][Error][Updated]',_0x3252dd);})[_0xcebb('0x44')](function(_0x1a6b82){ut['logger'](_0xcebb('0x45'),_0x1a6b82);});}else{ut[_0xcebb('0x46')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xcebb('0x47')]=function(_0x3ba524,_0x3ac4da,_0x11c692){var _0x1608a0=this;var _0x5dee9c={};if(_0x3ac4da){_0x5dee9c={'read':_0x3ac4da};}else{_0x5dee9c={'failMessage':_0x11c692};}if(this['actions'][_0x3ba524][_0xcebb('0x42')]){faxMessage[_0xcebb('0x41')](this['actions'][_0x3ba524]['AttachmentId'],_0x5dee9c)[_0xcebb('0x37')](function(_0x4f3a72){ut[_0xcebb('0x46')](_0xcebb('0x48'),_0x4f3a72);})[_0xcebb('0x44')](function(_0x2cf058){ut[_0xcebb('0x46')](_0xcebb('0x49'),_0x2cf058);})[_0xcebb('0x4a')](function(){delete _0x1608a0[_0xcebb('0xf')][_0x3ba524];delete _0x1608a0['actions'][_0x3ba524];});}else{ut['logger'](_0xcebb('0x4b'));delete this[_0xcebb('0xf')][_0x3ba524];delete this[_0xcebb('0x12')][_0x3ba524];}};Fax[_0xcebb('0x1d')][_0xcebb('0x1b')]=function(_0x1a5d38){var _0xee56cf=this;if(this[_0xcebb('0xf')][_0x1a5d38[_0xcebb('0x22')]]){if(this[_0xcebb('0x12')][_0x1a5d38['uniqueid']]){this[_0xcebb('0xf')][_0x1a5d38[_0xcebb('0x22')]]['id']=this[_0xcebb('0x12')][_0x1a5d38[_0xcebb('0x22')]]['id'];this['channels'][_0x1a5d38['uniqueid']][_0xcebb('0x24')]=this[_0xcebb('0x12')][_0x1a5d38[_0xcebb('0x22')]][_0xcebb('0x24')];}logger[_0xcebb('0x25')](_0x1a5d38[_0xcebb('0x22')],this['actions'][_0x1a5d38['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0xcebb('0x3c')](this['channels'][_0x1a5d38['uniqueid']]));if(this['actions'][_0x1a5d38[_0xcebb('0x22')]]){if(this[_0xcebb('0xf')][_0x1a5d38['uniqueid']][_0xcebb('0x4c')]>0x0&&this[_0xcebb('0xf')][_0x1a5d38[_0xcebb('0x22')]][_0xcebb('0x19')]==='SUCCESS'){this[_0xcebb('0x47')](_0x1a5d38['uniqueid'],!![]);}else{this['updateStatus'](_0x1a5d38['uniqueid'],![],this[_0xcebb('0xf')][_0x1a5d38[_0xcebb('0x22')]]['faxstatusstring']?_0xcebb('0x4d')+this[_0xcebb('0xf')][_0x1a5d38[_0xcebb('0x22')]][_0xcebb('0x4e')]:'SENDING\x20FAILED');}}}};Fax[_0xcebb('0x1d')][_0xcebb('0x4f')]=function(_0x1bf2d3){var _0x59a13b=this;return new BPromise(function(_0x3774ee,_0x5e2f46){_0x59a13b[_0xcebb('0x50')](_0x1bf2d3,_0x59a13b[_0xcebb('0x10')][_0x1bf2d3[_0xcebb('0x51')]])[_0xcebb('0x37')](function(_0x2d41b0){ut[_0xcebb('0x46')](_0xcebb('0x52'),_0x2d41b0);_0x3774ee(ut[_0xcebb('0x53')](_0xcebb('0x54')));})[_0xcebb('0x44')](function(_0x396b51){ut[_0xcebb('0x46')](_0xcebb('0x55'),_0x396b51);updateStatus(_0x1bf2d3);_0x5e2f46(ut[_0xcebb('0x53')](_0xcebb('0x56')));});});};Fax[_0xcebb('0x1d')][_0xcebb('0x57')]=function(_0x248cb8){var _0x2d89cc=this;return new BPromise(function(_0x413f85,_0x2f9c97){var _0x42a9ca=_0x2d89cc['checkTrunk'](_0x2d89cc['faxAccounts'][_0x248cb8['FaxAccountId']][_0xcebb('0x58')],_0x248cb8);if(_0x42a9ca[_0xcebb('0x59')]){_0x413f85(ut[_0xcebb('0x53')]('Trunk\x20Reachable'));}else{_0x2f9c97(ut[_0xcebb('0x53')](_0x42a9ca[_0xcebb('0x53')]));}});};function originate(_0x4cb335,_0x3fcb7b,_0x424208){return new BPromise(function(_0x3861a5,_0x4dec76){if(_0x424208){var _0x24dd03=util[_0xcebb('0x5a')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xcebb('0x35')](_0x4cb335[_0xcebb('0x4')])['name'],_0x4cb335[_0xcebb('0x4')]);gs[_0xcebb('0x5b')](_0x24dd03)[_0xcebb('0x37')](function(){_0x4cb335[_0xcebb('0x4')]=util[_0xcebb('0x5a')]('%s/%s.tif',path['parse'](_0x4cb335['path'])[_0xcebb('0x5c')],path['parse'](_0x4cb335['path'])['name']);_0x3fcb7b[_0xcebb('0x5d')]=_0x4cb335[_0xcebb('0x4')];ut['logger'](_0xcebb('0x5e'),'');ami[_0xcebb('0x5f')](ut[_0xcebb('0x60')](_0x4cb335,_0x3fcb7b))[_0xcebb('0x37')](function(_0x289656){_0x3861a5(_0x289656);})['catch'](function(_0x2a776f){_0x4dec76(_0x2a776f);});})[_0xcebb('0x44')](function(_0x4e9be0){_0x4dec76(_0x4e9be0);});}else{ami[_0xcebb('0x5f')](ut[_0xcebb('0x60')](_0x4cb335,_0x3fcb7b))['then'](function(_0x1c7ae6){_0x3861a5(_0x1c7ae6);})[_0xcebb('0x44')](function(_0x3f7ac5){_0x4dec76(_0x3f7ac5);});}});}Fax[_0xcebb('0x1d')][_0xcebb('0x50')]=function(_0x2e6958,_0x5e7e24){var _0x351779=this;return new BPromise(function(_0x51554f,_0x2624c6){var _0x54b265=uuid['v4']();var _0x4b18bb=ut['addVariables'](_0x2e6958,_0x5e7e24);_0x351779[_0xcebb('0x12')][_0x54b265]=new Action(_0x54b265,_0x5e7e24,_0x2e6958);var _0x372142=_0x351779[_0xcebb('0x12')][_0x54b265];if(path[_0xcebb('0x35')](_0x2e6958[_0xcebb('0x4')])[_0xcebb('0x61')]===_0xcebb('0x36')){originate(_0x372142,_0x4b18bb,!![])[_0xcebb('0x37')](function(_0x49eeb4){_0x51554f(_0x49eeb4);})[_0xcebb('0x44')](function(_0x38be2a){_0x2624c6(_0x38be2a);});}else{originate(_0x372142,_0x4b18bb,![])['then'](function(_0x457c68){_0x51554f(_0x457c68);})[_0xcebb('0x44')](function(_0x3e8d55){_0x2624c6(_0x3e8d55);});}});};Fax[_0xcebb('0x1d')][_0xcebb('0x62')]=function(_0x2dea33){return!_[_0xcebb('0x63')](_0x2dea33)&&!_['isNil'](_0x2dea33[_0xcebb('0x24')])&&!_[_0xcebb('0x63')](_0x2dea33[_0xcebb('0x64')])&&_0x2dea33[_0xcebb('0x64')]&&!_['isNil'](this[_0xcebb('0x11')][util[_0xcebb('0x5a')](_0xcebb('0x65'),_0x2dea33[_0xcebb('0x24')])])&&!_[_0xcebb('0x63')](this['trunks'][util[_0xcebb('0x5a')]('SIP/%s',_0x2dea33[_0xcebb('0x24')])]['status'])&&(this[_0xcebb('0x11')][util[_0xcebb('0x5a')]('SIP/%s',_0x2dea33[_0xcebb('0x24')])]['status']===_0xcebb('0x66')||this[_0xcebb('0x11')][util[_0xcebb('0x5a')](_0xcebb('0x65'),_0x2dea33[_0xcebb('0x24')])]['status']==='unmonitored');};Fax[_0xcebb('0x1d')][_0xcebb('0x67')]=function(_0x391f1b,_0x429f44){if(!this[_0xcebb('0x62')](_0x391f1b)){ut['logger'](_0xcebb('0x68'),_[_0xcebb('0x63')](_0x391f1b)?'':_0x391f1b['name']+_0xcebb('0x69'));return{'isValid':![],'message':_0xcebb('0x6a')};}if(_[_0xcebb('0x63')](_0x429f44[_0xcebb('0x7')])){ut['logger'](_0xcebb('0x6b'),JSON[_0xcebb('0x3c')](_0x429f44));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xcebb('0x63')](_0x429f44[_0xcebb('0x4')])){ut[_0xcebb('0x46')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xcebb('0x3c')](_0x429f44));return{'isValid':![],'message':_0xcebb('0x6c')};}return{'isValid':!![],'message':_0xcebb('0x6d')};};module[_0xcebb('0x6e')]=Fax; \ No newline at end of file +var _0x421a=['syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[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','dir','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','trunks','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','syncNewchannel','bind','varset','syncVarSet'];(function(_0x642897,_0x1a5d0c){var _0x5dd2fe=function(_0x3a8f62){while(--_0x3a8f62){_0x642897['push'](_0x642897['shift']());}};_0x5dd2fe(++_0x1a5d0c);}(_0x421a,0x1c5));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xa421('0x0'));var _=require(_0xa421('0x1'));var BPromise=require(_0xa421('0x2'));var uuid=require(_0xa421('0x3'));var moment=require(_0xa421('0x4'));var path=require(_0xa421('0x5'));var tiff2pdf=require(_0xa421('0x6'));var gs=require(_0xa421('0x7'));var logger=require(_0xa421('0x8'))('fax');var ami=require(_0xa421('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xa421('0xa'));var ut=require(_0xa421('0xb'));var Action=require(_0xa421('0xc'));var faxAccount=require(_0xa421('0xd'));var attachment=require(_0xa421('0xe'));var faxMessage=require(_0xa421('0xf'));function Fax(_0x3bceb7){this[_0xa421('0x10')]={};this[_0xa421('0x11')]=_0x3bceb7['faxAccounts'];this['trunks']=_0x3bceb7['trunks'];this[_0xa421('0x12')]={};ami['on']('newchannel',this[_0xa421('0x13')][_0xa421('0x14')](this));ami['on'](_0xa421('0x15'),this[_0xa421('0x16')][_0xa421('0x14')](this));ami['on']('newstate',this[_0xa421('0x17')][_0xa421('0x14')](this));ami['on'](_0xa421('0x18'),this['syncNewExten'][_0xa421('0x14')](this));ami['on'](_0xa421('0x19'),this[_0xa421('0x1a')][_0xa421('0x14')](this));ami['on'](_0xa421('0x1b'),this[_0xa421('0x1c')][_0xa421('0x14')](this));ami['on'](_0xa421('0x1d'),this[_0xa421('0x1e')][_0xa421('0x14')](this));ami['on'](_0xa421('0x1f'),this[_0xa421('0x20')][_0xa421('0x14')](this));}Fax[_0xa421('0x21')][_0xa421('0x13')]=function(_0x15a1ae){if(_0x15a1ae[_0xa421('0x22')]===_0xa421('0x23')){for(var _0x3df9d7 in this['faxAccounts']){if(this[_0xa421('0x11')][_0xa421('0x24')](_0x3df9d7)){if(_0x15a1ae['exten']===this['faxAccounts'][_0x3df9d7][_0xa421('0x25')]){this['channels'][_0x15a1ae[_0xa421('0x26')]]={};this[_0xa421('0x10')][_0x15a1ae[_0xa421('0x26')]]['channel']=_0x15a1ae[_0xa421('0x27')];this[_0xa421('0x10')][_0x15a1ae['uniqueid']]['id']=this['faxAccounts'][_0x3df9d7]['id'];this[_0xa421('0x10')][_0x15a1ae[_0xa421('0x26')]][_0xa421('0x28')]=this[_0xa421('0x11')][_0x3df9d7][_0xa421('0x28')];logger[_0xa421('0x29')](_0x15a1ae['uniqueid'],_0xa421('0x2a'));}}}}if(this[_0xa421('0x12')][_0x15a1ae[_0xa421('0x26')]]){this['channels'][_0x15a1ae[_0xa421('0x26')]]={};this[_0xa421('0x10')][_0x15a1ae[_0xa421('0x26')]]['channel']=_0x15a1ae[_0xa421('0x27')];logger[_0xa421('0x29')](_0x15a1ae['uniqueid'],_0xa421('0x2a'));}};Fax[_0xa421('0x21')][_0xa421('0x16')]=function(_0x137dae){if(this[_0xa421('0x10')][_0x137dae[_0xa421('0x26')]]){for(var _0x46075f in _0x137dae[_0xa421('0x2b')]){if(_0x137dae['variable']['hasOwnProperty'](_0x46075f)){this['channels'][_0x137dae[_0xa421('0x26')]][_0x46075f]=_0x137dae[_0xa421('0x2c')];}}}};Fax[_0xa421('0x21')][_0xa421('0x17')]=function(_0x233222){if(this[_0xa421('0x10')][_0x233222[_0xa421('0x26')]]){this[_0xa421('0x10')][_0x233222[_0xa421('0x26')]][_0xa421('0x2d')]=_0x233222[_0xa421('0x2d')];this[_0xa421('0x10')][_0x233222[_0xa421('0x26')]][_0xa421('0x2e')]=_0x233222[_0xa421('0x2e')];}};Fax[_0xa421('0x21')]['syncNewExten']=function(_0x15609d){if(this['channels'][_0x15609d['uniqueid']]){for(var _0x16db2a in _0x15609d['variable']){if(_0x15609d['variable'][_0xa421('0x24')](_0x16db2a)){this[_0xa421('0x10')][_0x15609d[_0xa421('0x26')]][_0x16db2a]=_0x15609d[_0xa421('0x2c')];}}}};Fax['prototype'][_0xa421('0x1a')]=function(_0x118afa){if(this[_0xa421('0x10')][_0x118afa[_0xa421('0x26')]]){this[_0xa421('0x10')][_0x118afa[_0xa421('0x26')]][_0xa421('0x2f')]=_0x118afa['operation'];this[_0xa421('0x10')][_0x118afa['uniqueid']]['status']=_0x118afa[_0xa421('0x30')];this[_0xa421('0x10')][_0x118afa[_0xa421('0x26')]]['localstationid']=_0x118afa[_0xa421('0x25')];this['channels'][_0x118afa[_0xa421('0x26')]][_0xa421('0x31')]=_0x118afa[_0xa421('0x31')];logger[_0xa421('0x29')](_0x118afa[_0xa421('0x26')],_0xa421('0x32'));}};Fax[_0xa421('0x21')]['syncReceiveFax']=function(_0x2910a4){var _0x38824d=this;if(this['channels'][_0x2910a4[_0xa421('0x26')]]){var _0x18eeb9=this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]]['id'];this['channels'][_0x2910a4[_0xa421('0x26')]]['remotestationid']=_0x2910a4[_0xa421('0x33')];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x34')]=_0x2910a4[_0xa421('0x34')];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x25')]=_0x2910a4['localstationid'];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x35')]=_0x2910a4[_0xa421('0x35')];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x36')]=_0x2910a4[_0xa421('0x36')];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x31')]=_0x2910a4[_0xa421('0x31')];this[_0xa421('0x10')][_0x2910a4[_0xa421('0x26')]][_0xa421('0x37')]=_0x2910a4[_0xa421('0x37')];if(this['channels'][_0x2910a4['uniqueid']][_0xa421('0x34')]>0x0){tiff2pdf(_0x2910a4[_0xa421('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x94b2dd){logger[_0xa421('0x29')](_0x2910a4[_0xa421('0x26')],_0xa421('0x38'),_0x94b2dd[_0xa421('0x39')]);attachment[_0xa421('0x3a')]({'name':path[_0xa421('0x3b')](_0x2910a4[_0xa421('0x31')])[_0xa421('0x28')],'basename':path['parse'](_0x2910a4['filename'])['name']+_0xa421('0x3c'),'type':'application/pdf'})[_0xa421('0x3d')](function(_0x213c6c){faxAccount['notify'](_0x18eeb9,{'from':_0x2910a4[_0xa421('0x37')],'mapKey':_0xa421('0x3e'),'body':path[_0xa421('0x3b')](_0x2910a4['filename'])[_0xa421('0x28')]+_0xa421('0x3c'),'AttachmentId':_0x213c6c['id']})[_0xa421('0x3f')](function(_0x52a2c8){logger[_0xa421('0x40')](_0x2910a4[_0xa421('0x26')],_0xa421('0x41'),JSON[_0xa421('0x42')](_0x52a2c8));});})['catch'](function(_0x1490df){logger[_0xa421('0x40')](_0x2910a4[_0xa421('0x26')],_0xa421('0x43'),JSON['stringify'](_0x1490df));});});}logger[_0xa421('0x29')](_0x2910a4[_0xa421('0x26')],_0xa421('0x43'));}};Fax[_0xa421('0x21')][_0xa421('0x20')]=function(_0x5a19d1){if(this[_0xa421('0x12')][_0x5a19d1[_0xa421('0x26')]]){_[_0xa421('0x44')](this['channels'][_0x5a19d1[_0xa421('0x26')]],_[_0xa421('0x45')](_0x5a19d1,[_0xa421('0x46'),_0xa421('0x47')]));}};function updateStatus(_0x1c26ee){if(_0x1c26ee['AttachmentId']){faxMessage[_0xa421('0x48')](_0x1c26ee['AttachmentId'],{'failMessage':_0xa421('0x49')})[_0xa421('0x3d')](function(_0x5321e2){ut[_0xa421('0x4a')](_0xa421('0x4b'),_0x5321e2);})[_0xa421('0x3f')](function(_0x532091){ut['logger'](_0xa421('0x4c'),_0x532091);});}else{ut[_0xa421('0x4a')](_0xa421('0x4d'));}}Fax[_0xa421('0x21')]['updateStatus']=function(_0x294586,_0x5d1751,_0x3f8370){var _0x299bdc=this;var _0x2effb8={};if(_0x5d1751){_0x2effb8={'read':_0x5d1751};}else{_0x2effb8={'failMessage':_0x3f8370};}if(this[_0xa421('0x12')][_0x294586]['AttachmentId']){faxMessage[_0xa421('0x48')](this[_0xa421('0x12')][_0x294586][_0xa421('0x4e')],_0x2effb8)['then'](function(_0x2a8185){ut['logger'](_0xa421('0x4f'),_0x2a8185);})['catch'](function(_0x5d3a8c){ut['logger'](_0xa421('0x50'),_0x5d3a8c);})['finally'](function(){delete _0x299bdc[_0xa421('0x10')][_0x294586];delete _0x299bdc['actions'][_0x294586];});}else{ut[_0xa421('0x4a')]('[Fax][Message][NoUpdate2]');delete this[_0xa421('0x10')][_0x294586];delete this[_0xa421('0x12')][_0x294586];}};Fax[_0xa421('0x21')]['syncHangup']=function(_0x1d8cf7){var _0x4d72f5=this;if(this[_0xa421('0x10')][_0x1d8cf7[_0xa421('0x26')]]){if(this['actions'][_0x1d8cf7[_0xa421('0x26')]]){this[_0xa421('0x10')][_0x1d8cf7[_0xa421('0x26')]]['id']=this[_0xa421('0x12')][_0x1d8cf7[_0xa421('0x26')]]['id'];this['channels'][_0x1d8cf7[_0xa421('0x26')]]['name']=this['actions'][_0x1d8cf7[_0xa421('0x26')]][_0xa421('0x28')];}logger[_0xa421('0x29')](_0x1d8cf7[_0xa421('0x26')],this['actions'][_0x1d8cf7[_0xa421('0x26')]]?_0xa421('0x51'):_0xa421('0x52'),JSON['stringify'](this['channels'][_0x1d8cf7['uniqueid']]));if(this[_0xa421('0x12')][_0x1d8cf7[_0xa421('0x26')]]){if(this[_0xa421('0x10')][_0x1d8cf7['uniqueid']][_0xa421('0x53')]>0x0&&this[_0xa421('0x10')][_0x1d8cf7[_0xa421('0x26')]]['faxstatus']===_0xa421('0x54')){this[_0xa421('0x55')](_0x1d8cf7[_0xa421('0x26')],!![]);}else{this['updateStatus'](_0x1d8cf7['uniqueid'],![],this['channels'][_0x1d8cf7[_0xa421('0x26')]]['faxstatusstring']?_0xa421('0x56')+this[_0xa421('0x10')][_0x1d8cf7['uniqueid']][_0xa421('0x57')]:_0xa421('0x58'));}}}};Fax['prototype'][_0xa421('0x59')]=function(_0x3dde8a){var _0x167962=this;return new BPromise(function(_0x595b79,_0x1f77c5){_0x167962[_0xa421('0x5a')](_0x3dde8a,_0x167962[_0xa421('0x11')][_0x3dde8a[_0xa421('0x5b')]])[_0xa421('0x3d')](function(_0x233041){ut[_0xa421('0x4a')](_0xa421('0x5c'),_0x233041);_0x595b79(ut['message'](_0xa421('0x5d')));})['catch'](function(_0xf60de7){ut[_0xa421('0x4a')](_0xa421('0x5e'),_0xf60de7);updateStatus(_0x3dde8a);_0x1f77c5(ut[_0xa421('0x39')](_0xa421('0x5f')));});});};Fax[_0xa421('0x21')][_0xa421('0x60')]=function(_0x18cef7){var _0x175293=this;return new BPromise(function(_0x87e027,_0x4fd54e){var _0x5bea4c=_0x175293[_0xa421('0x61')](_0x175293[_0xa421('0x11')][_0x18cef7['FaxAccountId']][_0xa421('0x62')],_0x18cef7);if(_0x5bea4c[_0xa421('0x63')]){_0x87e027(ut[_0xa421('0x39')]('Trunk\x20Reachable'));}else{_0x4fd54e(ut[_0xa421('0x39')](_0x5bea4c['message']));}});};function originate(_0x289962,_0x55e262,_0x483878){return new BPromise(function(_0x27cc9f,_0x596345){if(_0x483878){var _0x14f7b0=util[_0xa421('0x64')](_0xa421('0x65'),path[_0xa421('0x3b')](_0x289962[_0xa421('0x5')])[_0xa421('0x28')],_0x289962[_0xa421('0x5')]);gs[_0xa421('0x66')](_0x14f7b0)['then'](function(){_0x289962[_0xa421('0x5')]=util[_0xa421('0x64')]('%s/%s.tif',path[_0xa421('0x3b')](_0x289962[_0xa421('0x5')])[_0xa421('0x67')],path[_0xa421('0x3b')](_0x289962[_0xa421('0x5')])[_0xa421('0x28')]);_0x55e262[_0xa421('0x68')]=_0x289962['path'];ut[_0xa421('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0xa421('0x69')](ut['variablesAction'](_0x289962,_0x55e262))[_0xa421('0x3d')](function(_0x3255c8){_0x27cc9f(_0x3255c8);})[_0xa421('0x3f')](function(_0x5204a7){_0x596345(_0x5204a7);});})[_0xa421('0x3f')](function(_0xaf4020){_0x596345(_0xaf4020);});}else{ami[_0xa421('0x69')](ut[_0xa421('0x6a')](_0x289962,_0x55e262))['then'](function(_0x36d9b7){_0x27cc9f(_0x36d9b7);})[_0xa421('0x3f')](function(_0x58f718){_0x596345(_0x58f718);});}});}Fax[_0xa421('0x21')]['execOriginate']=function(_0x342a76,_0x208c19){var _0x520fda=this;return new BPromise(function(_0x287555,_0x3f46b4){var _0x436741=uuid['v4']();var _0x20c520=ut[_0xa421('0x6b')](_0x342a76,_0x208c19);_0x520fda[_0xa421('0x12')][_0x436741]=new Action(_0x436741,_0x208c19,_0x342a76);var _0x1a4904=_0x520fda[_0xa421('0x12')][_0x436741];if(path['parse'](_0x342a76[_0xa421('0x5')])['ext']===_0xa421('0x3c')){originate(_0x1a4904,_0x20c520,!![])[_0xa421('0x3d')](function(_0x55007e){_0x287555(_0x55007e);})[_0xa421('0x3f')](function(_0x2db353){_0x3f46b4(_0x2db353);});}else{originate(_0x1a4904,_0x20c520,![])[_0xa421('0x3d')](function(_0x4ee394){_0x287555(_0x4ee394);})['catch'](function(_0x4f6c40){_0x3f46b4(_0x4f6c40);});}});};Fax['prototype'][_0xa421('0x6c')]=function(_0x402ef){return!_[_0xa421('0x6d')](_0x402ef)&&!_['isNil'](_0x402ef['name'])&&!_[_0xa421('0x6d')](_0x402ef[_0xa421('0x6e')])&&_0x402ef[_0xa421('0x6e')]&&!_[_0xa421('0x6d')](this[_0xa421('0x6f')][util[_0xa421('0x64')](_0xa421('0x70'),_0x402ef[_0xa421('0x28')])])&&!_[_0xa421('0x6d')](this[_0xa421('0x6f')][util['format'](_0xa421('0x70'),_0x402ef[_0xa421('0x28')])][_0xa421('0x30')])&&(this[_0xa421('0x6f')][util[_0xa421('0x64')](_0xa421('0x70'),_0x402ef[_0xa421('0x28')])][_0xa421('0x30')]==='reachable'||this[_0xa421('0x6f')][util[_0xa421('0x64')](_0xa421('0x70'),_0x402ef[_0xa421('0x28')])][_0xa421('0x30')]===_0xa421('0x71'));};Fax[_0xa421('0x21')]['checkTrunk']=function(_0x261621,_0x14af96){if(!this['isTrunkReachable'](_0x261621)){ut[_0xa421('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xa421('0x6d')](_0x261621)?'':_0x261621[_0xa421('0x28')]+_0xa421('0x72'));return{'isValid':![],'message':_0xa421('0x73')};}if(_[_0xa421('0x6d')](_0x14af96[_0xa421('0x3e')])){ut[_0xa421('0x4a')](_0xa421('0x74'),JSON['stringify'](_0x14af96));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xa421('0x6d')](_0x14af96[_0xa421('0x5')])){ut[_0xa421('0x4a')](_0xa421('0x75'),JSON[_0xa421('0x42')](_0x14af96));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xa421('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5e4d730..8f6bd0c 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 _0xc09b=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch','[Notify]\x20','util','bluebird'];(function(_0x41d8ae,_0x3d2ee7){var _0xd11452=function(_0x4a7343){while(--_0x4a7343){_0x41d8ae['push'](_0x41d8ae['shift']());}};_0xd11452(++_0x3d2ee7);}(_0xc09b,0x82));var _0xbc09=function(_0x1b621d,_0x3cc338){_0x1b621d=_0x1b621d-0x0;var _0x217228=_0xc09b[_0x1b621d];return _0x217228;};'use strict';var util=require(_0xbc09('0x0'));var BPromise=require(_0xbc09('0x1'));var logger=require(_0xbc09('0x2'))(_0xbc09('0x3'));var _=require(_0xbc09('0x4'));var faxAccount=require(_0xbc09('0x5'));function loggerCatch(_0x45e196){return function(_0x418993){logger[_0xbc09('0x6')](_0x45e196,util[_0xbc09('0x7')](_0x418993,{'showHidden':![],'depth':null}));};}exports[_0xbc09('0x8')]=function(_0x44772b,_0x111fc0){return BPromise['resolve']()[_0xbc09('0x9')](faxAccount[_0xbc09('0x8')](_0x44772b,_0x111fc0))[_0xbc09('0xa')](loggerCatch(_0xbc09('0xb')));}; \ No newline at end of file +var _0xc18b=['notify','resolve','then','[Notify]\x20','util','bluebird','lodash','../rpc/faxAccount'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xc18b,0xcc));var _0xbc18=function(_0x3fb9dd,_0x174fff){_0x3fb9dd=_0x3fb9dd-0x0;var _0x20136a=_0xc18b[_0x3fb9dd];return _0x20136a;};'use strict';var util=require(_0xbc18('0x0'));var BPromise=require(_0xbc18('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0xbc18('0x2'));var faxAccount=require(_0xbc18('0x3'));function loggerCatch(_0x1dca0b){return function(_0x456d0a){logger['error'](_0x1dca0b,util['inspect'](_0x456d0a,{'showHidden':![],'depth':null}));};}exports[_0xbc18('0x4')]=function(_0xa9e5e4,_0x337b8a){return BPromise[_0xbc18('0x5')]()[_0xbc18('0x6')](faxAccount['notify'](_0xa9e5e4,_0x337b8a))['catch'](loggerCatch(_0xbc18('0x7')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index fa08530..7360ab9 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 _0x40e9=['execute','info','Exec\x20gs','\x20Error\x20:','fax','exec'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x40e9,0x1b4));var _0x940e=function(_0x3adf4e,_0x3b1265){_0x3adf4e=_0x3adf4e-0x0;var _0x272cb6=_0x40e9[_0x3adf4e];return _0x272cb6;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x940e('0x0'));var BPromise=require('bluebird');var exec=require('child_process')[_0x940e('0x1')];exports[_0x940e('0x2')]=function(_0x530f06){return new BPromise(function(_0x171c1d,_0x583ba8){exec(_0x530f06,function(_0xf110cf,_0x5a985a,_0x42789c){logger[_0x940e('0x3')](_0x940e('0x4'),_0x5a985a);if(_0xf110cf){logger[_0x940e('0x3')](_0x940e('0x4'),_0x940e('0x5'),util['inspect'](_0xf110cf,{'showHidden':![],'depth':null}),_0x5a985a,_0x42789c);_0x583ba8(_0xf110cf);}_0x171c1d(_0x5a985a);});});}; \ No newline at end of file +var _0xad21=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','util','../../../../config/logger'];(function(_0x5009bb,_0x40380c){var _0x48ec0d=function(_0x1ebd8b){while(--_0x1ebd8b){_0x5009bb['push'](_0x5009bb['shift']());}};_0x48ec0d(++_0x40380c);}(_0xad21,0xf1));var _0x1ad2=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xad21[_0x2962d5];return _0x273406;};'use strict';var util=require(_0x1ad2('0x0'));var logger=require(_0x1ad2('0x1'))(_0x1ad2('0x2'));var BPromise=require(_0x1ad2('0x3'));var exec=require(_0x1ad2('0x4'))[_0x1ad2('0x5')];exports[_0x1ad2('0x6')]=function(_0x249815){return new BPromise(function(_0x1c28c5,_0x30b4d9){exec(_0x249815,function(_0x521a0d,_0x35b118,_0x27f856){logger[_0x1ad2('0x7')](_0x1ad2('0x8'),_0x35b118);if(_0x521a0d){logger[_0x1ad2('0x7')](_0x1ad2('0x8'),'\x20Error\x20:',util['inspect'](_0x521a0d,{'showHidden':![],'depth':null}),_0x35b118,_0x27f856);_0x30b4d9(_0x521a0d);}_0x1c28c5(_0x35b118);});});}; \ 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 a0bc5c0..30bcc9b 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 _0x6ad6=['format','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','../../../../config/logger','fax','message','inspect','addVariables','ecm','headerinfo'];(function(_0xf94701,_0x2b537f){var _0x548e0f=function(_0x51582c){while(--_0x51582c){_0xf94701['push'](_0xf94701['shift']());}};_0x548e0f(++_0x2b537f);}(_0x6ad6,0xdf));var _0x66ad=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x6ad6[_0x3b9149];return _0x2067f4;};'use strict';var util=require(_0x66ad('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x66ad('0x1'))(_0x66ad('0x2'));exports[_0x66ad('0x3')]=function(_0x304b3a){return{'message':_0x304b3a};};exports['logger']=function(_0x52b17d,_0x15307f){logger['info'](_0x52b17d,util[_0x66ad('0x4')](_0x15307f,{'showHidden':![],'depth':null}));};exports[_0x66ad('0x5')]=function(_0x55dc95,_0xc5d587){var _0x3d00a5={'XMF-ECM':_0xc5d587[_0x66ad('0x6')],'XMF-HEADERINFO':_0xc5d587[_0x66ad('0x7')],'XMF-MINRATE':_0xc5d587['minrate'],'XMF-MAXRATE':_0xc5d587['maxrate'],'XMF-MODEM':util[_0x66ad('0x8')]('\x22%s\x22',_0xc5d587[_0x66ad('0x9')]),'XMF-GATEWAY':_0xc5d587[_0x66ad('0xa')],'XMF-FAXDETECT':_0xc5d587[_0x66ad('0xb')],'XMF-T38TIMEOUT':_0xc5d587[_0x66ad('0xc')],'XMF-LOCALSTATIONID':_0xc5d587[_0x66ad('0xd')],'XMF-PATH':_0x55dc95[_0x66ad('0xe')]};return _0x3d00a5;};exports['variablesAction']=function(_0x44439a,_0x1f4352){return{'actionid':_0x44439a[_0x66ad('0xf')],'action':_0x66ad('0x10'),'channel':_0x44439a[_0x66ad('0x11')],'Exten':_0x66ad('0x12'),'Context':_0x66ad('0x13'),'Priority':'1','callerid':util['format'](_0x66ad('0x14'),_0x44439a[_0x66ad('0x7')]?_0x44439a[_0x66ad('0x7')]:'',_0x44439a[_0x66ad('0xd')]),'variable':_0x1f4352,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x44439a[_0x66ad('0xf')]};}; \ No newline at end of file +var _0x9cbe=['from-sip','\x22%s\x22\x20<%s>','util','moment','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel'];(function(_0xdce68d,_0x54d6d4){var _0x1ff194=function(_0x4204a1){while(--_0x4204a1){_0xdce68d['push'](_0xdce68d['shift']());}};_0x1ff194(++_0x54d6d4);}(_0x9cbe,0xa3));var _0xe9cb=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x9cbe[_0x476bf4];return _0x788ffe;};'use strict';var util=require(_0xe9cb('0x0'));var _=require('lodash');var moment=require(_0xe9cb('0x1'));var logger=require('../../../../config/logger')(_0xe9cb('0x2'));exports[_0xe9cb('0x3')]=function(_0x55c438){return{'message':_0x55c438};};exports[_0xe9cb('0x4')]=function(_0x44a0ab,_0xc778e2){logger[_0xe9cb('0x5')](_0x44a0ab,util['inspect'](_0xc778e2,{'showHidden':![],'depth':null}));};exports[_0xe9cb('0x6')]=function(_0x5b042a,_0x573fed){var _0x5e5766={'XMF-ECM':_0x573fed[_0xe9cb('0x7')],'XMF-HEADERINFO':_0x573fed[_0xe9cb('0x8')],'XMF-MINRATE':_0x573fed[_0xe9cb('0x9')],'XMF-MAXRATE':_0x573fed[_0xe9cb('0xa')],'XMF-MODEM':util[_0xe9cb('0xb')]('\x22%s\x22',_0x573fed[_0xe9cb('0xc')]),'XMF-GATEWAY':_0x573fed[_0xe9cb('0xd')],'XMF-FAXDETECT':_0x573fed[_0xe9cb('0xe')],'XMF-T38TIMEOUT':_0x573fed[_0xe9cb('0xf')],'XMF-LOCALSTATIONID':_0x573fed[_0xe9cb('0x10')],'XMF-PATH':_0x5b042a[_0xe9cb('0x11')]};return _0x5e5766;};exports[_0xe9cb('0x12')]=function(_0x5438fb,_0x44dc48){return{'actionid':_0x5438fb[_0xe9cb('0x13')],'action':'originate','channel':_0x5438fb[_0xe9cb('0x14')],'Exten':'xcally-motion-fax','Context':_0xe9cb('0x15'),'Priority':'1','callerid':util['format'](_0xe9cb('0x16'),_0x5438fb[_0xe9cb('0x8')]?_0x5438fb['headerinfo']:'',_0x5438fb['localstationid']),'variable':_0x44dc48,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5438fb[_0xe9cb('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 3044765..b262ba8 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 _0x0388=['./server','./realtime','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','getTelephones','initTelephones','getTrunks','then','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment'];(function(_0x21a81e,_0x27c77f){var _0x6af794=function(_0x493d30){while(--_0x493d30){_0x21a81e['push'](_0x21a81e['shift']());}};_0x6af794(++_0x27c77f);}(_0x0388,0x10d));var _0x8038=function(_0x5640b1,_0xe138d3){_0x5640b1=_0x5640b1-0x0;var _0x12a514=_0x0388[_0x5640b1];return _0x12a514;};'use strict';var BPromise=require(_0x8038('0x0'));var util=require(_0x8038('0x1'));var moment=require(_0x8038('0x2'));var server=require(_0x8038('0x3'));var Realtime=require(_0x8038('0x4'));var Report=require(_0x8038('0x5'));var Acw=require(_0x8038('0x6'));var Trigger=require('./trigger');var Dialer=require(_0x8038('0x7'));var Preview=require(_0x8038('0x8'));var Fax=require('./fax');var user=require(_0x8038('0x9'));var voiceQueue=require(_0x8038('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x8038('0xb'));var trunk=require(_0x8038('0xc'));var trigger=require(_0x8038('0xd'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8038('0xe'));var faxAccount=require(_0x8038('0xf'));var zendesk=require(_0x8038('0x10'));var salesforce=require(_0x8038('0x11'));var sugarcrm=require(_0x8038('0x12'));var freshdesk=require(_0x8038('0x13'));var desk=require(_0x8038('0x14'));var zoho=require(_0x8038('0x15'));var vtiger=require(_0x8038('0x16'));var freshsales=require(_0x8038('0x17'));var servicenow=require(_0x8038('0x18'));var dynamics365=require(_0x8038('0x19'));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()[_0x8038('0x1a')](_0x8038('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8038('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8038('0x1c')]()['then'](user[_0x8038('0x1d')]())['then'](realtime['initAgents']())['then'](user[_0x8038('0x1e')]())['then'](realtime[_0x8038('0x1f')]())['then'](trunk[_0x8038('0x20')]())[_0x8038('0x21')](realtime[_0x8038('0x22')]())[_0x8038('0x21')](voiceQueue['getVoiceQueues']())[_0x8038('0x21')](realtime[_0x8038('0x23')]())[_0x8038('0x21')](trigger[_0x8038('0x24')]())[_0x8038('0x21')](realtime[_0x8038('0x25')]())[_0x8038('0x21')](template[_0x8038('0x26')]())[_0x8038('0x21')](realtime[_0x8038('0x27')]())[_0x8038('0x21')](zendesk[_0x8038('0x28')]())[_0x8038('0x21')](realtime[_0x8038('0x29')]())[_0x8038('0x21')](salesforce[_0x8038('0x2a')]())['then'](realtime['initSalesforceAccounts']())[_0x8038('0x21')](sugarcrm[_0x8038('0x2b')]())[_0x8038('0x21')](realtime[_0x8038('0x2c')]())[_0x8038('0x21')](freshdesk[_0x8038('0x2d')]())[_0x8038('0x21')](realtime[_0x8038('0x2e')]())[_0x8038('0x21')](desk['getDeskAccounts']())[_0x8038('0x21')](realtime['initDeskAccounts']())[_0x8038('0x21')](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0x8038('0x21')](vtiger['getVtigerAccounts']())[_0x8038('0x21')](realtime[_0x8038('0x2f')]())[_0x8038('0x21')](freshsales[_0x8038('0x30')]())[_0x8038('0x21')](realtime['initFreshsalesAccounts']())[_0x8038('0x21')](servicenow[_0x8038('0x31')]())[_0x8038('0x21')](realtime[_0x8038('0x32')]())['then'](dynamics365[_0x8038('0x33')]())[_0x8038('0x21')](realtime['initDynamics365Accounts']())[_0x8038('0x21')](campaign[_0x8038('0x34')]())[_0x8038('0x21')](realtime['initCampaigns']())[_0x8038('0x21')](voiceExtension[_0x8038('0x35')]())[_0x8038('0x21')](realtime[_0x8038('0x36')]())[_0x8038('0x21')](faxAccount['getFaxAccounts']())[_0x8038('0x21')](realtime[_0x8038('0x37')]())[_0x8038('0x21')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8038('0x21')](voiceQueueReport[_0x8038('0x38')]())[_0x8038('0x21')](realtime[_0x8038('0x39')]())[_0x8038('0x21')](cmHopperHistory[_0x8038('0x3a')]())[_0x8038('0x21')](realtime[_0x8038('0x3b')]())[_0x8038('0x21')](cmHopperHistory[_0x8038('0x3c')]())[_0x8038('0x21')](realtime[_0x8038('0x3d')]())[_0x8038('0x21')](voiceCallReport[_0x8038('0x3e')]())['then'](realtime[_0x8038('0x3f')]())[_0x8038('0x21')](function(_0x43e488){})[_0x8038('0x40')](function(_0x49a84e){console[_0x8038('0x41')](_0x49a84e);});}function main(){return server[_0x8038('0x42')](realtime,preview,fax)['then'](function(_0x2ea700){return initRealtime();})[_0x8038('0x21')](function(){return initParams();})[_0x8038('0x21')](function(){report[_0x8038('0x43')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x38764e){console[_0x8038('0x41')](_0x38764e);});}main(); \ No newline at end of file +var _0xbecb=['initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','util','moment','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports'];(function(_0xc99e1,_0xa37a42){var _0x15605b=function(_0x273018){while(--_0x273018){_0xc99e1['push'](_0xc99e1['shift']());}};_0x15605b(++_0xa37a42);}(_0xbecb,0x1d6));var _0xbbec=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbecb[_0x1d1779];return _0x2377e9;};'use strict';var BPromise=require('bluebird');var util=require(_0xbbec('0x0'));var moment=require(_0xbbec('0x1'));var server=require('./server');var Realtime=require(_0xbbec('0x2'));var Report=require(_0xbbec('0x3'));var Acw=require(_0xbbec('0x4'));var Trigger=require(_0xbbec('0x5'));var Dialer=require(_0xbbec('0x6'));var Preview=require('./preview');var Fax=require(_0xbbec('0x7'));var user=require(_0xbbec('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xbbec('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xbbec('0xa'));var trigger=require(_0xbbec('0xb'));var template=require(_0xbbec('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xbbec('0xd'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbbec('0xe'));var sugarcrm=require(_0xbbec('0xf'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xbbec('0x10'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xbbec('0x11'));var freshsales=require(_0xbbec('0x12'));var servicenow=require(_0xbbec('0x13'));var dynamics365=require(_0xbbec('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbbec('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbbec('0x15')](_0xbbec('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbbec('0x17')]()[_0xbbec('0x18')](user[_0xbbec('0x19')]())[_0xbbec('0x18')](realtime[_0xbbec('0x1a')]())[_0xbbec('0x18')](user[_0xbbec('0x1b')]())[_0xbbec('0x18')](realtime[_0xbbec('0x1c')]())[_0xbbec('0x18')](trunk['getTrunks']())[_0xbbec('0x18')](realtime[_0xbbec('0x1d')]())['then'](voiceQueue[_0xbbec('0x1e')]())[_0xbbec('0x18')](realtime[_0xbbec('0x1f')]())['then'](trigger[_0xbbec('0x20')]())[_0xbbec('0x18')](realtime[_0xbbec('0x21')]())[_0xbbec('0x18')](template[_0xbbec('0x22')]())[_0xbbec('0x18')](realtime[_0xbbec('0x23')]())[_0xbbec('0x18')](zendesk['getZendeskAccounts']())[_0xbbec('0x18')](realtime[_0xbbec('0x24')]())[_0xbbec('0x18')](salesforce['getSalesforceAccounts']())[_0xbbec('0x18')](realtime[_0xbbec('0x25')]())['then'](sugarcrm[_0xbbec('0x26')]())['then'](realtime[_0xbbec('0x27')]())['then'](freshdesk[_0xbbec('0x28')]())[_0xbbec('0x18')](realtime[_0xbbec('0x29')]())[_0xbbec('0x18')](desk[_0xbbec('0x2a')]())['then'](realtime[_0xbbec('0x2b')]())[_0xbbec('0x18')](zoho[_0xbbec('0x2c')]())[_0xbbec('0x18')](realtime[_0xbbec('0x2d')]())[_0xbbec('0x18')](vtiger[_0xbbec('0x2e')]())[_0xbbec('0x18')](realtime[_0xbbec('0x2f')]())['then'](freshsales[_0xbbec('0x30')]())['then'](realtime['initFreshsalesAccounts']())[_0xbbec('0x18')](servicenow[_0xbbec('0x31')]())['then'](realtime[_0xbbec('0x32')]())['then'](dynamics365['getDynamics365Accounts']())[_0xbbec('0x18')](realtime[_0xbbec('0x33')]())['then'](campaign[_0xbbec('0x34')]())[_0xbbec('0x18')](realtime[_0xbbec('0x35')]())[_0xbbec('0x18')](voiceExtension[_0xbbec('0x36')]())['then'](realtime[_0xbbec('0x37')]())[_0xbbec('0x18')](faxAccount[_0xbbec('0x38')]())[_0xbbec('0x18')](realtime['initFaxAccounts']())[_0xbbec('0x18')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0xbbec('0x39')]())[_0xbbec('0x18')](realtime[_0xbbec('0x3a')]())[_0xbbec('0x18')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xbbec('0x18')](realtime[_0xbbec('0x3b')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xbbec('0x18')](realtime[_0xbbec('0x3c')]())[_0xbbec('0x18')](voiceCallReport['getVoiceCallReports']())[_0xbbec('0x18')](realtime[_0xbbec('0x3d')]())[_0xbbec('0x18')](function(_0x35ff09){})[_0xbbec('0x3e')](function(_0x45407b){console[_0xbbec('0x3f')](_0x45407b);});}function main(){return server[_0xbbec('0x40')](realtime,preview,fax)[_0xbbec('0x18')](function(_0x10bbba){return initRealtime();})[_0xbbec('0x18')](function(){return initParams();})[_0xbbec('0x18')](function(){report[_0xbbec('0x41')]();setInterval(initRealtime,0x1388);})[_0xbbec('0x3e')](function(_0x2707dc){console[_0xbbec('0x3f')](_0x2707dc);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3b5777f..18d969c 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x21a6e9,_0xb65a1d){var _0x5c0a73=function(_0x33af8a){while(--_0x33af8a){_0x21a6e9['push'](_0x21a6e9['shift']());}};_0x5c0a73(++_0xb65a1d);}(_0x70e0,0x17b));var _0x070e=function(_0x45b7dc,_0x31d2a1){_0x45b7dc=_0x45b7dc-0x0;var _0x62766=_0x70e0[_0x45b7dc];return _0x62766;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x1602c3,_0x250007){var _0x4808ef=function(_0x361463){while(--_0x361463){_0x1602c3['push'](_0x1602c3['shift']());}};_0x4808ef(++_0x250007);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0xcb91[_0x246115];return _0x385878;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 8d66574..dd6233e 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 _0xfc52=['Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc52,0x10d));var _0x2fc5=function(_0x2c087f,_0x22ef50){_0x2c087f=_0x2c087f-0x0;var _0xcacad0=_0xfc52[_0x2c087f];return _0xcacad0;};'use strict';function Campaign(_0x4c711f){this['id']=_0x4c711f['id']||0x0;this['name']=_0x4c711f[_0x2fc5('0x0')]||'';this[_0x2fc5('0x1')]=_0x4c711f[_0x2fc5('0x1')]||_0x2fc5('0x2');this[_0x2fc5('0x3')]=0x0;this[_0x2fc5('0x4')]=0x0;this[_0x2fc5('0x5')]=0x0;this[_0x2fc5('0x6')]=0x0;this[_0x2fc5('0x7')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x4c711f[_0x2fc5('0x8')];this[_0x2fc5('0x9')]=_0x4c711f[_0x2fc5('0x9')];this[_0x2fc5('0xa')]=_0x4c711f[_0x2fc5('0xa')]||null;this[_0x2fc5('0xb')]=_0x4c711f[_0x2fc5('0xb')]?_0x4c711f[_0x2fc5('0xb')]:null;this[_0x2fc5('0xc')]=_0x4c711f[_0x2fc5('0xc')];this[_0x2fc5('0xd')]=_0x4c711f[_0x2fc5('0xd')];this[_0x2fc5('0xe')]=_0x4c711f[_0x2fc5('0xe')]||0x1e;this[_0x2fc5('0xf')]=_0x4c711f[_0x2fc5('0xf')];this[_0x2fc5('0x10')]=_0x4c711f['dialCongestionRetryFrequency'];this[_0x2fc5('0x11')]=_0x4c711f[_0x2fc5('0x11')];this['dialBusyRetryFrequency']=_0x4c711f['dialBusyRetryFrequency'];this[_0x2fc5('0x12')]=_0x4c711f['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4c711f[_0x2fc5('0x13')];this['dialGlobalMaxRetry']=_0x4c711f[_0x2fc5('0x14')];this['dialNoSuchNumberMaxRetry']=_0x4c711f['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4c711f[_0x2fc5('0x15')]||0x96;this[_0x2fc5('0x16')]=_0x4c711f['dialDropMaxRetry']||0x3;this[_0x2fc5('0x17')]=_0x4c711f[_0x2fc5('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x4c711f[_0x2fc5('0x18')]||0x3;this[_0x2fc5('0x19')]=_0x4c711f['dialAbandonedRetryFrequency']||0x96;this[_0x2fc5('0x1a')]=_0x4c711f[_0x2fc5('0x1a')]||0x3;this[_0x2fc5('0x1b')]=_0x4c711f[_0x2fc5('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x4c711f[_0x2fc5('0x1c')]||0x3;this[_0x2fc5('0x1d')]=_0x4c711f['dialAgentRejectRetryFrequency']||0x96;this[_0x2fc5('0x1e')]=_0x4c711f['dialOrderByScheduledAt']||_0x2fc5('0x1f');this[_0x2fc5('0x20')]=_0x4c711f['dialPrefix']||undefined;this[_0x2fc5('0x21')]=_0x4c711f[_0x2fc5('0x21')]||undefined;this[_0x2fc5('0x22')]=_0x4c711f[_0x2fc5('0x22')]||undefined;this[_0x2fc5('0x23')]=_0x4c711f['TrunkBackup']?_0x4c711f[_0x2fc5('0x23')]:undefined;this[_0x2fc5('0x24')]=_0x4c711f[_0x2fc5('0x24')]?_0x4c711f[_0x2fc5('0x24')]:undefined;this[_0x2fc5('0x25')]=_0x4c711f['Interval']?_0x4c711f['Interval']:undefined;this[_0x2fc5('0x26')]=_0x4c711f['SquareProject']?_0x4c711f[_0x2fc5('0x26')]:undefined;this[_0x2fc5('0x27')]=_0x4c711f[_0x2fc5('0x26')]?_0x4c711f[_0x2fc5('0x26')]['name']:undefined;this[_0x2fc5('0x28')]=_0x4c711f[_0x2fc5('0x28')]||![];this[_0x2fc5('0x29')]=_0x4c711f[_0x2fc5('0x29')];this[_0x2fc5('0x2a')]=_0x4c711f[_0x2fc5('0x2a')];this[_0x2fc5('0x2b')]=_0x4c711f[_0x2fc5('0x2b')];this[_0x2fc5('0x2c')]=_0x4c711f['dialAMDTotalAnalysisTime'];this[_0x2fc5('0x2d')]=_0x4c711f['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x4c711f[_0x2fc5('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x4c711f[_0x2fc5('0x2f')];this['dialAMDSilenceThreshold']=_0x4c711f[_0x2fc5('0x30')];this[_0x2fc5('0x31')]=_0x4c711f[_0x2fc5('0x31')];}module[_0x2fc5('0x32')]=Campaign; \ No newline at end of file +var _0x8f71=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x46b44d,_0x45a8b0){var _0x1447aa=function(_0x33832e){while(--_0x33832e){_0x46b44d['push'](_0x46b44d['shift']());}};_0x1447aa(++_0x45a8b0);}(_0x8f71,0xc1));var _0x18f7=function(_0x1bf8be,_0x58de6c){_0x1bf8be=_0x1bf8be-0x0;var _0x5e7c15=_0x8f71[_0x1bf8be];return _0x5e7c15;};'use strict';function Campaign(_0x74b45b){this['id']=_0x74b45b['id']||0x0;this[_0x18f7('0x0')]=_0x74b45b[_0x18f7('0x0')]||'';this['type']=_0x74b45b['type']||_0x18f7('0x1');this[_0x18f7('0x2')]=0x0;this[_0x18f7('0x3')]=0x0;this[_0x18f7('0x4')]=0x0;this[_0x18f7('0x5')]=0x0;this[_0x18f7('0x6')]='';this[_0x18f7('0x7')]=!![];this[_0x18f7('0x8')]=_0x74b45b[_0x18f7('0x8')];this['limitCalls']=_0x74b45b[_0x18f7('0x9')];this[_0x18f7('0xa')]=_0x74b45b[_0x18f7('0xa')]||null;this[_0x18f7('0xb')]=_0x74b45b[_0x18f7('0xb')]?_0x74b45b['dialGlobalInterval']:null;this[_0x18f7('0xc')]=_0x74b45b[_0x18f7('0xc')];this[_0x18f7('0xd')]=_0x74b45b[_0x18f7('0xd')];this[_0x18f7('0xe')]=_0x74b45b[_0x18f7('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x74b45b[_0x18f7('0xf')];this[_0x18f7('0x10')]=_0x74b45b[_0x18f7('0x10')];this[_0x18f7('0x11')]=_0x74b45b[_0x18f7('0x11')];this[_0x18f7('0x12')]=_0x74b45b['dialBusyRetryFrequency'];this[_0x18f7('0x13')]=_0x74b45b[_0x18f7('0x13')];this[_0x18f7('0x14')]=_0x74b45b['dialNoAnswerRetryFrequency'];this[_0x18f7('0x15')]=_0x74b45b[_0x18f7('0x15')];this[_0x18f7('0x16')]=_0x74b45b[_0x18f7('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x74b45b['dialNoSuchNumberRetryFrequency']||0x96;this[_0x18f7('0x17')]=_0x74b45b['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x74b45b[_0x18f7('0x18')]||0x96;this[_0x18f7('0x19')]=_0x74b45b[_0x18f7('0x19')]||0x3;this[_0x18f7('0x1a')]=_0x74b45b[_0x18f7('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x74b45b[_0x18f7('0x1b')]||0x3;this[_0x18f7('0x1c')]=_0x74b45b[_0x18f7('0x1c')]||0x96;this[_0x18f7('0x1d')]=_0x74b45b[_0x18f7('0x1d')]||0x3;this[_0x18f7('0x1e')]=_0x74b45b[_0x18f7('0x1e')]||0x96;this[_0x18f7('0x1f')]=_0x74b45b[_0x18f7('0x1f')]||'DESC';this['dialPrefix']=_0x74b45b[_0x18f7('0x20')]||undefined;this[_0x18f7('0x21')]=_0x74b45b[_0x18f7('0x21')]||undefined;this[_0x18f7('0x22')]=_0x74b45b['dialCutDigit']||undefined;this['TrunkBackup']=_0x74b45b[_0x18f7('0x23')]?_0x74b45b['TrunkBackup']:undefined;this['Trunk']=_0x74b45b[_0x18f7('0x24')]?_0x74b45b[_0x18f7('0x24')]:undefined;this[_0x18f7('0x25')]=_0x74b45b[_0x18f7('0x25')]?_0x74b45b['Interval']:undefined;this[_0x18f7('0x26')]=_0x74b45b['SquareProject']?_0x74b45b['SquareProject']:undefined;this[_0x18f7('0x27')]=_0x74b45b['SquareProject']?_0x74b45b[_0x18f7('0x26')][_0x18f7('0x0')]:undefined;this[_0x18f7('0x28')]=_0x74b45b[_0x18f7('0x28')]||![];this[_0x18f7('0x29')]=_0x74b45b[_0x18f7('0x29')];this[_0x18f7('0x2a')]=_0x74b45b[_0x18f7('0x2a')];this[_0x18f7('0x2b')]=_0x74b45b[_0x18f7('0x2b')];this[_0x18f7('0x2c')]=_0x74b45b['dialAMDTotalAnalysisTime'];this[_0x18f7('0x2d')]=_0x74b45b[_0x18f7('0x2d')];this['dialAMDBetweenWordsSilence']=_0x74b45b[_0x18f7('0x2e')];this[_0x18f7('0x2f')]=_0x74b45b[_0x18f7('0x2f')];this[_0x18f7('0x30')]=_0x74b45b[_0x18f7('0x30')];this[_0x18f7('0x31')]=_0x74b45b[_0x18f7('0x31')];}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 d1aaaad..610bf17 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 _0xa19c=['destinationchannel','connectedlinenum','accountcode','context','uniqueid','linkedid','answered','endtime','abandoned','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0x2a5779,_0x1a59b5){var _0x12a9c3=function(_0x3ec70d){while(--_0x3ec70d){_0x2a5779['push'](_0x2a5779['shift']());}};_0x12a9c3(++_0x1a59b5);}(_0xa19c,0xce));var _0xca19=function(_0x267c40,_0x22d70b){_0x267c40=_0x267c40-0x0;var _0x2a7247=_0xa19c[_0x267c40];return _0x2a7247;};'use strict';function Channel(){this[_0xca19('0x0')]=null;this[_0xca19('0x1')]='';this[_0xca19('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xca19('0x3')]=undefined;this['connectedlinename']=undefined;this[_0xca19('0x4')]=0x0;this[_0xca19('0x5')]='';this[_0xca19('0x6')]=0x0;this[_0xca19('0x7')]=0x0;this['exten']=0x0;this[_0xca19('0x8')]=![];this['answertime']=null;this[_0xca19('0x9')]=null;this['unmanaged']=![];this[_0xca19('0xa')]=![];this['lastapplication']='';this[_0xca19('0xb')]='';this[_0xca19('0xc')]=0x0;this[_0xca19('0xd')]=0x0;this[_0xca19('0xe')]=0x0;this[_0xca19('0xf')]=null;this['tag']=null;this[_0xca19('0x10')]=null;this[_0xca19('0x11')]=![];this[_0xca19('0x12')]=null;this[_0xca19('0x13')]=null;this[_0xca19('0x14')]=[];this[_0xca19('0x15')]=undefined;this[_0xca19('0x16')]=undefined;this[_0xca19('0x17')]=undefined;this[_0xca19('0x18')]=0x0;}module[_0xca19('0x19')]=Channel; \ No newline at end of file +var _0x3c85=['destinationchannel','calleridnum','connectedlinename','accountcode','context','linkedid','exten','answered','lastapplication','billableseconds','holdtime','monitor','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel'];(function(_0x5478a5,_0x1a620a){var _0x391842=function(_0x3bdb96){while(--_0x3bdb96){_0x5478a5['push'](_0x5478a5['shift']());}};_0x391842(++_0x1a620a);}(_0x3c85,0x1a0));var _0x53c8=function(_0x310db3,_0x47ecb8){_0x310db3=_0x310db3-0x0;var _0x43f8e0=_0x3c85[_0x310db3];return _0x43f8e0;};'use strict';function Channel(){this[_0x53c8('0x0')]=null;this[_0x53c8('0x1')]='';this[_0x53c8('0x2')]='';this[_0x53c8('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x53c8('0x4')]=undefined;this[_0x53c8('0x5')]=0x0;this[_0x53c8('0x6')]='';this['uniqueid']=0x0;this[_0x53c8('0x7')]=0x0;this[_0x53c8('0x8')]=0x0;this[_0x53c8('0x9')]=![];this['answertime']=null;this['endtime']=null;this['unmanaged']=![];this['abandoned']=![];this[_0x53c8('0xa')]='';this['lastdata']='';this['duration']=0x0;this[_0x53c8('0xb')]=0x0;this[_0x53c8('0xc')]=0x0;this['type']=null;this['tag']=null;this['disposition']=null;this[_0x53c8('0xd')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x53c8('0xe')]=[];this[_0x53c8('0xf')]=undefined;this[_0x53c8('0x10')]=undefined;this[_0x53c8('0x11')]=undefined;this[_0x53c8('0x12')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7b0f97c..42fd1f3 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 _0xd0dc=['authType','password','consumerKey','consumerSecret','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd0dc,0x81));var _0xcd0d=function(_0x121737,_0x37e36b){_0x121737=_0x121737-0x0;var _0x5f4d4b=_0xd0dc[_0x121737];return _0x5f4d4b;};'use strict';function DeskAccount(_0x1f9507){this['id']=_0x1f9507['id']||0x0;this['name']=_0x1f9507[_0xcd0d('0x0')]||'';this[_0xcd0d('0x1')]=_0x1f9507[_0xcd0d('0x1')]||'';this['remoteUri']=_0x1f9507[_0xcd0d('0x2')]||'';this[_0xcd0d('0x3')]=_0x1f9507[_0xcd0d('0x3')]||'';this[_0xcd0d('0x4')]=_0x1f9507[_0xcd0d('0x4')]||'';this[_0xcd0d('0x5')]=_0x1f9507[_0xcd0d('0x5')]||'';this[_0xcd0d('0x6')]=_0x1f9507[_0xcd0d('0x6')]||'';this['token']=_0x1f9507['token']||'';this['tokenSecret']=_0x1f9507[_0xcd0d('0x7')]||'';this[_0xcd0d('0x8')]=_0x1f9507[_0xcd0d('0x8')]||'';this['serverUrl']=_0x1f9507[_0xcd0d('0x9')]||'';this['Configurations']=_0x1f9507[_0xcd0d('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x7103=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x1abddd,_0x1b9672){var _0x165e33=function(_0xca577c){while(--_0xca577c){_0x1abddd['push'](_0x1abddd['shift']());}};_0x165e33(++_0x1b9672);}(_0x7103,0xbc));var _0x3710=function(_0x38b744,_0x218c46){_0x38b744=_0x38b744-0x0;var _0x3028d4=_0x7103[_0x38b744];return _0x3028d4;};'use strict';function DeskAccount(_0x4a5cb0){this['id']=_0x4a5cb0['id']||0x0;this[_0x3710('0x0')]=_0x4a5cb0['name']||'';this[_0x3710('0x1')]=_0x4a5cb0['username']||'';this[_0x3710('0x2')]=_0x4a5cb0['remoteUri']||'';this[_0x3710('0x3')]=_0x4a5cb0['authType']||'';this[_0x3710('0x4')]=_0x4a5cb0[_0x3710('0x4')]||'';this['consumerKey']=_0x4a5cb0[_0x3710('0x5')]||'';this['consumerSecret']=_0x4a5cb0[_0x3710('0x6')]||'';this[_0x3710('0x7')]=_0x4a5cb0[_0x3710('0x7')]||'';this[_0x3710('0x8')]=_0x4a5cb0[_0x3710('0x8')]||'';this[_0x3710('0x9')]=_0x4a5cb0['type']||'';this[_0x3710('0xa')]=_0x4a5cb0[_0x3710('0xa')]||'';this[_0x3710('0xb')]=_0x4a5cb0[_0x3710('0xb')]||{};}module[_0x3710('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c5dae8f..f861417 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 _0x5c00=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x506866,_0x13df5e){var _0x5a0e44=function(_0x169747){while(--_0x169747){_0x506866['push'](_0x506866['shift']());}};_0x5a0e44(++_0x13df5e);}(_0x5c00,0x17e));var _0x05c0=function(_0x8036e9,_0xb2a199){_0x8036e9=_0x8036e9-0x0;var _0x34a8eb=_0x5c00[_0x8036e9];return _0x34a8eb;};'use strict';function Dynamics365Account(_0x29fe0e){this['id']=_0x29fe0e['id']||0x0;this[_0x05c0('0x0')]=_0x29fe0e[_0x05c0('0x0')]||'';this['username']=_0x29fe0e[_0x05c0('0x1')]||'';this['password']=_0x29fe0e[_0x05c0('0x2')]||'';this[_0x05c0('0x3')]=_0x29fe0e[_0x05c0('0x3')]||'';this[_0x05c0('0x4')]=_0x29fe0e['tenantId']||'';this[_0x05c0('0x5')]=_0x29fe0e[_0x05c0('0x5')]||'';this[_0x05c0('0x6')]=_0x29fe0e[_0x05c0('0x6')]||{};this['serverUrl']=_0x29fe0e[_0x05c0('0x7')]||'';this[_0x05c0('0x8')]=_0x29fe0e[_0x05c0('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb58b=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x244b6e,_0x5ce423){var _0x35cf06=function(_0x337365){while(--_0x337365){_0x244b6e['push'](_0x244b6e['shift']());}};_0x35cf06(++_0x5ce423);}(_0xb58b,0x1f1));var _0xbb58=function(_0x7d61b3,_0x4f90aa){_0x7d61b3=_0x7d61b3-0x0;var _0x41fff7=_0xb58b[_0x7d61b3];return _0x41fff7;};'use strict';function Dynamics365Account(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['username']||'';this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')]||'';this['remoteUri']=_0x250573[_0xbb58('0x3')]||'';this['tenantId']=_0x250573[_0xbb58('0x4')]||'';this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||'';this['clientSecret']=_0x250573[_0xbb58('0x6')]||{};this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||'';this[_0xbb58('0x8')]=_0x250573[_0xbb58('0x8')]||{};}module[_0xbb58('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 7849250..c7b124b 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 _0x5b24=['exports','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key'];(function(_0x2f1b38,_0x5a831f){var _0xdfc2c4=function(_0x40cf56){while(--_0x40cf56){_0x2f1b38['push'](_0x2f1b38['shift']());}};_0xdfc2c4(++_0x5a831f);}(_0x5b24,0x1a5));var _0x45b2=function(_0x2b11c8,_0x20be4f){_0x2b11c8=_0x2b11c8-0x0;var _0x4c0768=_0x5b24[_0x2b11c8];return _0x4c0768;};'use strict';function FaxAccount(_0x27a214){this['id']=_0x27a214['id']||0x0;this['name']=_0x27a214['name']||'';this[_0x45b2('0x0')]=_0x27a214[_0x45b2('0x0')];this[_0x45b2('0x1')]=_0x27a214[_0x45b2('0x1')];this[_0x45b2('0x2')]=_0x27a214['headerinfo'];this['localstationid']=_0x27a214[_0x45b2('0x3')];this['minrate']=_0x27a214[_0x45b2('0x4')]||0x960;this[_0x45b2('0x5')]=_0x27a214[_0x45b2('0x5')]||0x3840;this[_0x45b2('0x6')]=_0x27a214[_0x45b2('0x6')]||'v17,v27,v29';this[_0x45b2('0x7')]=_0x27a214[_0x45b2('0x7')]||'no';this['faxdetect']=_0x27a214[_0x45b2('0x8')]||'no';this[_0x45b2('0x9')]=_0x27a214[_0x45b2('0x9')]||0x1388;this['tech']=_0x27a214['tech']||_0x45b2('0xa');this[_0x45b2('0xb')]=_0x27a214['Trunk']?_0x27a214[_0x45b2('0xb')]:undefined;this['ListId']=_0x27a214[_0x45b2('0xc')];this[_0x45b2('0xd')]=_0x27a214[_0x45b2('0xd')];}module[_0x45b2('0xe')]=FaxAccount; \ No newline at end of file +var _0xb82f=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x26bafe,_0x13e506){var _0x307879=function(_0x5a1548){while(--_0x5a1548){_0x26bafe['push'](_0x26bafe['shift']());}};_0x307879(++_0x13e506);}(_0xb82f,0x1b0));var _0xfb82=function(_0x3463f4,_0x210bd2){_0x3463f4=_0x3463f4-0x0;var _0x2175c2=_0xb82f[_0x3463f4];return _0x2175c2;};'use strict';function FaxAccount(_0x36cefa){this['id']=_0x36cefa['id']||0x0;this['name']=_0x36cefa[_0xfb82('0x0')]||'';this[_0xfb82('0x1')]=_0x36cefa[_0xfb82('0x1')];this[_0xfb82('0x2')]=_0x36cefa[_0xfb82('0x2')];this['headerinfo']=_0x36cefa[_0xfb82('0x3')];this[_0xfb82('0x4')]=_0x36cefa['localstationid'];this[_0xfb82('0x5')]=_0x36cefa[_0xfb82('0x5')]||0x960;this[_0xfb82('0x6')]=_0x36cefa[_0xfb82('0x6')]||0x3840;this['modem']=_0x36cefa[_0xfb82('0x7')]||_0xfb82('0x8');this['gateway']=_0x36cefa[_0xfb82('0x9')]||'no';this[_0xfb82('0xa')]=_0x36cefa[_0xfb82('0xa')]||'no';this[_0xfb82('0xb')]=_0x36cefa[_0xfb82('0xb')]||0x1388;this[_0xfb82('0xc')]=_0x36cefa[_0xfb82('0xc')]||_0xfb82('0xd');this[_0xfb82('0xe')]=_0x36cefa['Trunk']?_0x36cefa[_0xfb82('0xe')]:undefined;this['ListId']=_0x36cefa[_0xfb82('0xf')];this[_0xfb82('0x10')]=_0x36cefa[_0xfb82('0x10')];}module[_0xfb82('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 4b3e1e1..74040b8 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 _0xb777=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x249979,_0x393549){var _0x512d29=function(_0x5a27a0){while(--_0x5a27a0){_0x249979['push'](_0x249979['shift']());}};_0x512d29(++_0x393549);}(_0xb777,0x1b8));var _0x7b77=function(_0x5cb7a8,_0x269783){_0x5cb7a8=_0x5cb7a8-0x0;var _0x2a26df=_0xb777[_0x5cb7a8];return _0x2a26df;};'use strict';function FreshdeskAccount(_0x1cc96e){this['id']=_0x1cc96e['id']||0x0;this['name']=_0x1cc96e[_0x7b77('0x0')]||'';this['username']=_0x1cc96e['username']||'';this[_0x7b77('0x1')]=_0x1cc96e[_0x7b77('0x2')]||'';this[_0x7b77('0x3')]=_0x1cc96e[_0x7b77('0x3')]||'';this[_0x7b77('0x4')]=_0x1cc96e[_0x7b77('0x4')]||'';this[_0x7b77('0x5')]=_0x1cc96e[_0x7b77('0x5')]||{};}module[_0x7b77('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x6361=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x6361,0xa1));var _0x1636=function(_0x353fd7,_0x104f3f){_0x353fd7=_0x353fd7-0x0;var _0x3b357a=_0x6361[_0x353fd7];return _0x3b357a;};'use strict';function FreshdeskAccount(_0x1a3d51){this['id']=_0x1a3d51['id']||0x0;this[_0x1636('0x0')]=_0x1a3d51[_0x1636('0x0')]||'';this['username']=_0x1a3d51[_0x1636('0x1')]||'';this['apiKey']=_0x1a3d51['token']||'';this[_0x1636('0x2')]=_0x1a3d51[_0x1636('0x2')]||'';this[_0x1636('0x3')]=_0x1a3d51[_0x1636('0x3')]||'';this['Configurations']=_0x1a3d51[_0x1636('0x4')]||{};}module[_0x1636('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index e5b565c..5a6858c 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcca7=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x345962,_0xfd6477){var _0x3f0bcf=function(_0x4fe2d3){while(--_0x4fe2d3){_0x345962['push'](_0x345962['shift']());}};_0x3f0bcf(++_0xfd6477);}(_0xcca7,0x1aa));var _0x7cca=function(_0x42051f,_0x268705){_0x42051f=_0x42051f-0x0;var _0x2163e6=_0xcca7[_0x42051f];return _0x2163e6;};'use strict';function FreshsalesAccount(_0x58285f){this['id']=_0x58285f['id']||0x0;this[_0x7cca('0x0')]=_0x58285f[_0x7cca('0x0')]||'';this[_0x7cca('0x1')]=_0x58285f['username']||'';this['apiKey']=_0x58285f[_0x7cca('0x2')]||'';this['remoteUri']=_0x58285f[_0x7cca('0x3')]||'';this[_0x7cca('0x4')]=_0x58285f[_0x7cca('0x4')]||'';this[_0x7cca('0x5')]=_0x58285f[_0x7cca('0x5')]||{};}module[_0x7cca('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xf698=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0xcc26d2,_0x20c921){var _0x3841e2=function(_0x1ba4ea){while(--_0x1ba4ea){_0xcc26d2['push'](_0xcc26d2['shift']());}};_0x3841e2(++_0x20c921);}(_0xf698,0x1de));var _0x8f69=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0xf698[_0x36fbef];return _0x45e270;};'use strict';function FreshsalesAccount(_0x4838bb){this['id']=_0x4838bb['id']||0x0;this[_0x8f69('0x0')]=_0x4838bb['name']||'';this[_0x8f69('0x1')]=_0x4838bb[_0x8f69('0x1')]||'';this['apiKey']=_0x4838bb[_0x8f69('0x2')]||'';this[_0x8f69('0x3')]=_0x4838bb[_0x8f69('0x3')]||'';this[_0x8f69('0x4')]=_0x4838bb['serverUrl']||'';this[_0x8f69('0x5')]=_0x4838bb['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 58c1b0a..cbaf920 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 _0xfd13=['assigned','lastAssignedTo','mohtime','variables','type','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','holdtime'];(function(_0x39877a,_0x36ee8b){var _0x41189b=function(_0xd80aff){while(--_0xd80aff){_0x39877a['push'](_0x39877a['shift']());}};_0x41189b(++_0x36ee8b);}(_0xfd13,0xa5));var _0x3fd1=function(_0x164b41,_0x27a831){_0x164b41=_0x164b41-0x0;var _0x5bb942=_0xfd13[_0x164b41];return _0x5bb942;};'use strict';function QueueReport(){this[_0x3fd1('0x0')]=_0x3fd1('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x3fd1('0x2')]='';this[_0x3fd1('0x3')]='';this[_0x3fd1('0x4')]=null;this[_0x3fd1('0x5')]=null;this[_0x3fd1('0x6')]=0x1;this['count']=0x1;this[_0x3fd1('0x7')]=![];this[_0x3fd1('0x8')]=null;this[_0x3fd1('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x3fd1('0xa')]=![];this[_0x3fd1('0xb')]=null;this[_0x3fd1('0xc')]=0x1;this[_0x3fd1('0xd')]='';this[_0x3fd1('0xe')]='';this['connectedlinename']='';this[_0x3fd1('0xf')]='';this[_0x3fd1('0x10')]='';this[_0x3fd1('0x11')]='';this['priority']='';this[_0x3fd1('0x12')]=0x0;this[_0x3fd1('0x13')]=![];this[_0x3fd1('0x14')]='';this[_0x3fd1('0x15')]=0x0;this[_0x3fd1('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xb1b2=['queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','holdtime','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x16e50a,_0x3429fc){var _0x18ed54=function(_0x32fe65){while(--_0x32fe65){_0x16e50a['push'](_0x16e50a['shift']());}};_0x18ed54(++_0x3429fc);}(_0xb1b2,0xd7));var _0x2b1b=function(_0x16998a,_0x4b6ac9){_0x16998a=_0x16998a-0x0;var _0x5cb28b=_0xb1b2[_0x16998a];return _0x5cb28b;};'use strict';function QueueReport(){this[_0x2b1b('0x0')]=_0x2b1b('0x1');this[_0x2b1b('0x2')]='';this[_0x2b1b('0x3')]='';this[_0x2b1b('0x4')]='';this[_0x2b1b('0x5')]='';this[_0x2b1b('0x6')]=null;this[_0x2b1b('0x7')]=null;this[_0x2b1b('0x8')]=0x1;this[_0x2b1b('0x9')]=0x1;this['queuecallerabandon']=![];this[_0x2b1b('0xa')]=null;this['queuecallercomplete']=![];this[_0x2b1b('0xb')]=null;this[_0x2b1b('0xc')]=![];this[_0x2b1b('0xd')]=null;this[_0x2b1b('0xe')]=0x1;this[_0x2b1b('0xf')]='';this['connectedlinenum']='';this[_0x2b1b('0x10')]='';this[_0x2b1b('0x11')]='';this[_0x2b1b('0x12')]='';this[_0x2b1b('0x13')]='';this[_0x2b1b('0x14')]='';this[_0x2b1b('0x15')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x2b1b('0x16')]=0x0;this[_0x2b1b('0x17')]={};}module[_0x2b1b('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 3fe7379..229b19c 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 _0x1a15=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name'];(function(_0x4235b3,_0x4295b9){var _0x5a6cc9=function(_0x3cd80d){while(--_0x3cd80d){_0x4235b3['push'](_0x4235b3['shift']());}};_0x5a6cc9(++_0x4295b9);}(_0x1a15,0x103));var _0x51a1=function(_0x341cb4,_0x5e19c9){_0x341cb4=_0x341cb4-0x0;var _0x1774b3=_0x1a15[_0x341cb4];return _0x1774b3;};'use strict';function SalesforceAccount(_0x4809d3){this['id']=_0x4809d3['id']||0x0;this[_0x51a1('0x0')]=_0x4809d3[_0x51a1('0x0')]||'';this['username']=_0x4809d3[_0x51a1('0x1')]||'';this[_0x51a1('0x2')]=_0x4809d3[_0x51a1('0x2')]||'';this[_0x51a1('0x3')]=_0x4809d3[_0x51a1('0x3')]||'';this['clientId']=_0x4809d3[_0x51a1('0x4')]||'';this[_0x51a1('0x5')]=_0x4809d3[_0x51a1('0x5')]||'';this['securityToken']=_0x4809d3[_0x51a1('0x6')]||'';this[_0x51a1('0x7')]=_0x4809d3['type']||'integrationTab';this[_0x51a1('0x8')]=_0x4809d3[_0x51a1('0x8')]||'';this[_0x51a1('0x9')]=_0x4809d3[_0x51a1('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x7df7=['exports','name','username','password','clientId','clientSecret','securityToken','type','integrationTab','Configurations'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x7df7,0x1b9));var _0x77df=function(_0xbf1cd7,_0x468baf){_0xbf1cd7=_0xbf1cd7-0x0;var _0x1993e2=_0x7df7[_0xbf1cd7];return _0x1993e2;};'use strict';function SalesforceAccount(_0x4683cd){this['id']=_0x4683cd['id']||0x0;this[_0x77df('0x0')]=_0x4683cd['name']||'';this['username']=_0x4683cd[_0x77df('0x1')]||'';this['remoteUri']=_0x4683cd['remoteUri']||'';this[_0x77df('0x2')]=_0x4683cd['password']||'';this[_0x77df('0x3')]=_0x4683cd[_0x77df('0x3')]||'';this[_0x77df('0x4')]=_0x4683cd[_0x77df('0x4')]||'';this[_0x77df('0x5')]=_0x4683cd[_0x77df('0x5')]||'';this[_0x77df('0x6')]=_0x4683cd[_0x77df('0x6')]||_0x77df('0x7');this['serverUrl']=_0x4683cd['serverUrl']||'';this[_0x77df('0x8')]=_0x4683cd[_0x77df('0x8')]||{};}module[_0x77df('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 70b832d..88be8d5 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 _0x9476=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x23eb8b,_0x34050a){var _0x1ba5fd=function(_0xae0b9b){while(--_0xae0b9b){_0x23eb8b['push'](_0x23eb8b['shift']());}};_0x1ba5fd(++_0x34050a);}(_0x9476,0x17d));var _0x6947=function(_0x3bfa87,_0x49b745){_0x3bfa87=_0x3bfa87-0x0;var _0x102d5a=_0x9476[_0x3bfa87];return _0x102d5a;};'use strict';function ServicenowAccount(_0x2e52cf){this['id']=_0x2e52cf['id']||0x0;this[_0x6947('0x0')]=_0x2e52cf[_0x6947('0x0')]||'';this[_0x6947('0x1')]=_0x2e52cf[_0x6947('0x1')]||'';this[_0x6947('0x2')]=_0x2e52cf['password']||'';this[_0x6947('0x3')]=_0x2e52cf[_0x6947('0x3')]||'';this['serverUrl']=_0x2e52cf[_0x6947('0x4')]||'';this[_0x6947('0x5')]=_0x2e52cf['Configurations']||{};}module[_0x6947('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x61ae=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3060ee,_0x2b0a31){var _0x2cf69f=function(_0xe043df){while(--_0xe043df){_0x3060ee['push'](_0x3060ee['shift']());}};_0x2cf69f(++_0x2b0a31);}(_0x61ae,0x17d));var _0xe61a=function(_0x592cea,_0x4e72f1){_0x592cea=_0x592cea-0x0;var _0x1e9cc6=_0x61ae[_0x592cea];return _0x1e9cc6;};'use strict';function ServicenowAccount(_0x4343b9){this['id']=_0x4343b9['id']||0x0;this['name']=_0x4343b9[_0xe61a('0x0')]||'';this[_0xe61a('0x1')]=_0x4343b9[_0xe61a('0x1')]||'';this['password']=_0x4343b9['password']||'';this[_0xe61a('0x2')]=_0x4343b9[_0xe61a('0x2')]||'';this[_0xe61a('0x3')]=_0x4343b9['serverUrl']||'';this[_0xe61a('0x4')]=_0x4343b9['Configurations']||{};}module[_0xe61a('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 6543995..5067d56 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 _0x5b92=['exports','name','username','password','remoteUri','Configurations'];(function(_0x101152,_0x397ab0){var _0xe1c465=function(_0x25de02){while(--_0x25de02){_0x101152['push'](_0x101152['shift']());}};_0xe1c465(++_0x397ab0);}(_0x5b92,0xdf));var _0x25b9=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5b92[_0xc6be3a];return _0x56a310;};'use strict';function SugarcrmAccount(_0x24716c){this['id']=_0x24716c['id']||0x0;this[_0x25b9('0x0')]=_0x24716c['name']||'';this[_0x25b9('0x1')]=_0x24716c[_0x25b9('0x1')]||'';this[_0x25b9('0x2')]=_0x24716c['password']||'';this[_0x25b9('0x3')]=_0x24716c[_0x25b9('0x3')]||'';this['serverUrl']=_0x24716c['serverUrl']||'';this[_0x25b9('0x4')]=_0x24716c[_0x25b9('0x4')]||{};}module[_0x25b9('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x6c4e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xe3c731,_0x347775){var _0x5693ee=function(_0x5c9bb7){while(--_0x5c9bb7){_0xe3c731['push'](_0xe3c731['shift']());}};_0x5693ee(++_0x347775);}(_0x6c4e,0x13a));var _0xe6c4=function(_0x3277a3,_0x581a59){_0x3277a3=_0x3277a3-0x0;var _0x28805a=_0x6c4e[_0x3277a3];return _0x28805a;};'use strict';function SugarcrmAccount(_0x2809d8){this['id']=_0x2809d8['id']||0x0;this[_0xe6c4('0x0')]=_0x2809d8[_0xe6c4('0x0')]||'';this[_0xe6c4('0x1')]=_0x2809d8[_0xe6c4('0x1')]||'';this[_0xe6c4('0x2')]=_0x2809d8[_0xe6c4('0x2')]||'';this[_0xe6c4('0x3')]=_0x2809d8[_0xe6c4('0x3')]||'';this[_0xe6c4('0x4')]=_0x2809d8[_0xe6c4('0x4')]||'';this[_0xe6c4('0x5')]=_0x2809d8[_0xe6c4('0x5')]||{};}module[_0xe6c4('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9e7051c..1b8751c 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 _0x13be=['status','exports','name','accountcode','state','unknown','stateTime'];(function(_0x4baf44,_0x315edb){var _0x2ce7a4=function(_0x52077c){while(--_0x52077c){_0x4baf44['push'](_0x4baf44['shift']());}};_0x2ce7a4(++_0x315edb);}(_0x13be,0x175));var _0xe13b=function(_0x511e03,_0x122f3b){_0x511e03=_0x511e03-0x0;var _0x55aacb=_0x13be[_0x511e03];return _0x55aacb;};'use strict';function Telephone(_0x5192e4){this['id']=_0x5192e4['id']||0x0;this[_0xe13b('0x0')]=_0x5192e4['name']||'';this['accountcode']=_0x5192e4[_0xe13b('0x1')]||'';this[_0xe13b('0x2')]=_0xe13b('0x3');this[_0xe13b('0x4')]=0x0;this[_0xe13b('0x5')]=_0xe13b('0x3');this['address']='';}module[_0xe13b('0x6')]=Telephone; \ No newline at end of file +var _0x579a=['stateTime','exports','name','accountcode','unknown'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x579a,0x9d));var _0xa579=function(_0x5ed4c6,_0x975eb5){_0x5ed4c6=_0x5ed4c6-0x0;var _0x1cdbf1=_0x579a[_0x5ed4c6];return _0x1cdbf1;};'use strict';function Telephone(_0x53ae98){this['id']=_0x53ae98['id']||0x0;this[_0xa579('0x0')]=_0x53ae98[_0xa579('0x0')]||'';this[_0xa579('0x1')]=_0x53ae98['accountcode']||'';this['state']=_0xa579('0x2');this[_0xa579('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0xa579('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index f713be9..1dea1c8 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 _0xb10b=['name','html'];(function(_0x21682b,_0x2ac0c9){var _0x5b0fbe=function(_0x6fb2a7){while(--_0x6fb2a7){_0x21682b['push'](_0x21682b['shift']());}};_0x5b0fbe(++_0x2ac0c9);}(_0xb10b,0x12a));var _0xbb10=function(_0x7de33e,_0x46a873){_0x7de33e=_0x7de33e-0x0;var _0x9b0f8=_0xb10b[_0x7de33e];return _0x9b0f8;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x30bb6b,_0x5d87f1){var _0x50a36d=function(_0x1ade86){while(--_0x1ade86){_0x30bb6b['push'](_0x30bb6b['shift']());}};_0x50a36d(++_0x5d87f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 1b4f366..c6555b5 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1a85,0x178));var _0x51a8=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0x1a85[_0xa522f];return _0x2083b0;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1a85,0x178));var _0x51a8=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x1a85[_0x3de873];return _0x380b8c;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('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 d70f10b..74b0222 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 _0xd73e=['active','name','state','unknown','stateTime','status','registry','indexOf','split','host','stateRegistry','address','defaultuser','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd73e,0xb6));var _0xed73=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd73e[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x52825d){this['id']=_0x52825d['id']||0x0;this[_0xed73('0x0')]=_0x52825d[_0xed73('0x0')]||![];this[_0xed73('0x1')]=_0x52825d[_0xed73('0x1')]||'';this[_0xed73('0x2')]=_0xed73('0x3');this[_0xed73('0x4')]=0x0;this[_0xed73('0x5')]='unknown';this[_0xed73('0x6')]=_0x52825d[_0xed73('0x6')]&&_0x52825d[_0xed73('0x6')][_0xed73('0x7')](':')?_0x52825d[_0xed73('0x6')][_0xed73('0x8')](':')[0x0]:'';this[_0xed73('0x9')]='';this['port']='';this['domain']='';this['domainport']='';this['refresh']='';this[_0xed73('0xa')]=_0xed73('0x3');this['registrationtime']='';this[_0xed73('0xb')]='';this[_0xed73('0xc')]=_0x52825d[_0xed73('0xc')]||'';}module[_0xed73('0xd')]=Trunk; \ No newline at end of file +var _0x80f8=['name','state','stateTime','status','unknown','registry','indexOf','split','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active'];(function(_0x5c16c5,_0x1fca20){var _0x11e7d4=function(_0x1ea95b){while(--_0x1ea95b){_0x5c16c5['push'](_0x5c16c5['shift']());}};_0x11e7d4(++_0x1fca20);}(_0x80f8,0xaf));var _0x880f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x80f8[_0x501510];return _0x1e6ee5;};'use strict';function Trunk(_0x2912d4){this['id']=_0x2912d4['id']||0x0;this['active']=_0x2912d4[_0x880f('0x0')]||![];this[_0x880f('0x1')]=_0x2912d4['name']||'';this[_0x880f('0x2')]='unknown';this[_0x880f('0x3')]=0x0;this[_0x880f('0x4')]=_0x880f('0x5');this[_0x880f('0x6')]=_0x2912d4[_0x880f('0x6')]&&_0x2912d4[_0x880f('0x6')][_0x880f('0x7')](':')?_0x2912d4[_0x880f('0x6')][_0x880f('0x8')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0x880f('0x9')]='';this[_0x880f('0xa')]='';this[_0x880f('0xb')]='unknown';this[_0x880f('0xc')]='';this[_0x880f('0xd')]='';this[_0x880f('0xe')]=_0x2912d4[_0x880f('0xe')]||'';}module[_0x880f('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 174ad64..60aa46f 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 _0x486f=['none','mandatoryDisposition','exten'];(function(_0x4aa30d,_0x25564d){var _0x3c0c51=function(_0xf892cd){while(--_0xf892cd){_0x4aa30d['push'](_0x4aa30d['shift']());}};_0x3c0c51(++_0x25564d);}(_0x486f,0x1a0));var _0xf486=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x486f[_0x1b2ff7];return _0x31656a;};'use strict';function voiceExtension(_0x153564){this['id']=_0x153564['id']||0x0;this['exten']=_0x153564[_0xf486('0x0')]||'';this['recordingFormat']=_0x153564['recordingFormat']||_0xf486('0x1');this[_0xf486('0x2')]=_0x153564[_0xf486('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x79d2=['exten','recordingFormat','none'];(function(_0x27ea07,_0x2868c3){var _0x5f330c=function(_0xb0fec6){while(--_0xb0fec6){_0x27ea07['push'](_0x27ea07['shift']());}};_0x5f330c(++_0x2868c3);}(_0x79d2,0x1dd));var _0x279d=function(_0x41ddf3,_0x4c5db7){_0x41ddf3=_0x41ddf3-0x0;var _0x2adac3=_0x79d2[_0x41ddf3];return _0x2adac3;};'use strict';function voiceExtension(_0xa43664){this['id']=_0xa43664['id']||0x0;this[_0x279d('0x0')]=_0xa43664[_0x279d('0x0')]||'';this[_0x279d('0x1')]=_0xa43664['recordingFormat']||_0x279d('0x2');this['mandatoryDisposition']=_0xa43664['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 142723a..4ffcaff 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 _0xee2c=['sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','autopause'];(function(_0x47933e,_0x454d00){var _0x3f5e20=function(_0x2202dc){while(--_0x2202dc){_0x47933e['push'](_0x47933e['shift']());}};_0x3f5e20(++_0x454d00);}(_0xee2c,0x1c7));var _0xcee2=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xee2c[_0x500419];return _0x241c1a;};'use strict';var statusDesc=[_0xcee2('0x0'),'not_inuse',_0xcee2('0x1'),_0xcee2('0x2'),_0xcee2('0x3'),_0xcee2('0x4'),'ringing','ringinuse',_0xcee2('0x5')];var monitorFormat={'wav':_0xcee2('0x6'),'wav49':'wav49','gsm':_0xcee2('0x7')};var strategy={'rrmemory':_0xcee2('0x8'),'roundrobin':_0xcee2('0x9')};function VoiceQueue(_0x3d7611){this['id']=_0x3d7611['id']||0x0;this[_0xcee2('0xa')]=_0x3d7611['name']||'';this['monitor_format']=_0x3d7611[_0xcee2('0xb')]||'';this[_0xcee2('0xc')]=_0x3d7611[_0xcee2('0xc')]||_0xcee2('0xd');this[_0xcee2('0xe')]=0x0;this[_0xcee2('0xf')]=0x0;this[_0xcee2('0x10')]=0x0;this[_0xcee2('0x11')]=0x0;this['sumDuration']=0x0;this[_0xcee2('0x12')]=0x0;this[_0xcee2('0x13')]=0x0;this[_0xcee2('0x14')]=0x0;this[_0xcee2('0x15')]=0x0;this[_0xcee2('0x16')]=0x0;this['available']=0x0;this[_0xcee2('0x17')]=_0x3d7611['acw']||![];this['acwTimeout']=_0x3d7611['acwTimeout']||0xa;this[_0xcee2('0x18')]=_0x3d7611[_0xcee2('0x18')]||'no';this[_0xcee2('0x19')]=!![];this[_0xcee2('0x1a')]='';this['originated']=0x0;this[_0xcee2('0x1b')]=0x0;this[_0xcee2('0x1c')]=_0x3d7611[_0xcee2('0x1c')]||null;this[_0xcee2('0x1d')]=_0x3d7611[_0xcee2('0x1d')]?_0x3d7611[_0xcee2('0x1d')]:null;this[_0xcee2('0x1e')]=_0x3d7611[_0xcee2('0x1e')];this[_0xcee2('0x1f')]=_0x3d7611['dialMethod']||_0xcee2('0x20');this['dialLimitChannel']=_0x3d7611[_0xcee2('0x21')]||0x0;this[_0xcee2('0x22')]=_0x3d7611[_0xcee2('0x22')]||0x0;this[_0xcee2('0x23')]=_0x3d7611['dialPowerLevel']||0x1;this[_0xcee2('0x24')]=_0x3d7611[_0xcee2('0x24')]||_0xcee2('0x25');this[_0xcee2('0x26')]=_0x3d7611[_0xcee2('0x26')]||0.03;this[_0xcee2('0x27')]=_0x3d7611[_0xcee2('0x27')]||0x258;this[_0xcee2('0x28')]=_0x3d7611[_0xcee2('0x28')]||_0xcee2('0x29');this[_0xcee2('0x2a')]=_0x3d7611['dialOriginateCallerIdNumber']||_0xcee2('0x29');this[_0xcee2('0x2b')]=_0x3d7611['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x3d7611[_0xcee2('0x2c')]||'tTxX';this[_0xcee2('0x2d')]=_0x3d7611[_0xcee2('0x2d')]||0x3;this[_0xcee2('0x2e')]=_0x3d7611['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x3d7611[_0xcee2('0x2f')]||0x3;this[_0xcee2('0x30')]=_0x3d7611[_0xcee2('0x30')]||0x96;this['dialBusyMaxRetry']=_0x3d7611[_0xcee2('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x3d7611[_0xcee2('0x32')]||0x96;this[_0xcee2('0x33')]=_0x3d7611[_0xcee2('0x33')]||0x3;this[_0xcee2('0x34')]=_0x3d7611[_0xcee2('0x34')]||0x96;this[_0xcee2('0x35')]=_0x3d7611[_0xcee2('0x35')]||0x3;this[_0xcee2('0x36')]=_0x3d7611[_0xcee2('0x36')]||0x96;this[_0xcee2('0x37')]=_0x3d7611[_0xcee2('0x37')]||0x3;this['dialDropRetryFrequency']=_0x3d7611[_0xcee2('0x38')]||0x96;this[_0xcee2('0x39')]=_0x3d7611[_0xcee2('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x3d7611[_0xcee2('0x3a')]||0x96;this[_0xcee2('0x3b')]=_0x3d7611['dialMachineMaxRetry']||0x3;this[_0xcee2('0x3c')]=_0x3d7611[_0xcee2('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x3d7611['dialAgentRejectMaxRetry']||0x3;this[_0xcee2('0x3d')]=_0x3d7611['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x3d7611[_0xcee2('0x3e')]||0x4;this[_0xcee2('0x3f')]=_0x3d7611['Trunk']?_0x3d7611[_0xcee2('0x3f')]:undefined;this[_0xcee2('0x40')]=_0x3d7611[_0xcee2('0x40')]?_0x3d7611[_0xcee2('0x40')]:undefined;this[_0xcee2('0x41')]=_0x3d7611[_0xcee2('0x41')]||undefined;this[_0xcee2('0x42')]=_0x3d7611[_0xcee2('0x42')]?_0x3d7611[_0xcee2('0x42')]:undefined;this[_0xcee2('0x43')]=_0x3d7611[_0xcee2('0x43')]||_0xcee2('0x44');this['dialRandomLastDigitCallerIdNumber']=_0x3d7611[_0xcee2('0x45')]||undefined;this[_0xcee2('0x46')]=_0x3d7611['dialCutDigit']||undefined;this[_0xcee2('0x47')]=strategy[_0x3d7611[_0xcee2('0x47')]]||'rrmemory';this[_0xcee2('0x48')]=!![];this[_0xcee2('0x49')]=_0x3d7611[_0xcee2('0x49')]||![];this['dialAMDInitialSilence']=_0x3d7611[_0xcee2('0x4a')];this[_0xcee2('0x4b')]=_0x3d7611[_0xcee2('0x4b')];this[_0xcee2('0x4c')]=_0x3d7611[_0xcee2('0x4c')];this[_0xcee2('0x4d')]=_0x3d7611['dialAMDTotalAnalysisTime'];this[_0xcee2('0x4e')]=_0x3d7611[_0xcee2('0x4e')];this[_0xcee2('0x4f')]=_0x3d7611['dialAMDBetweenWordsSilence'];this[_0xcee2('0x50')]=_0x3d7611['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x3d7611[_0xcee2('0x51')];this[_0xcee2('0x52')]=_0x3d7611[_0xcee2('0x52')];this[_0xcee2('0x53')]=0x0;this[_0xcee2('0x54')]=0x0;this[_0xcee2('0x55')]=_0x3d7611['timeout'];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xcee2('0x56')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xcee2('0x57')]=0x0;this[_0xcee2('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xcee2('0x59')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xcee2('0x5a')]=0x0;this[_0xcee2('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xcee2('0x5c')]=undefined;this[_0xcee2('0x5d')]=undefined;this[_0xcee2('0x5e')]=undefined;this[_0xcee2('0x5f')]=1.05;this[_0xcee2('0x60')]=0x0;this[_0xcee2('0x61')]=0x0;this[_0xcee2('0x62')]=0x0;this[_0xcee2('0x63')]=0x0;this[_0xcee2('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xcee2('0x65')]=0x0;this[_0xcee2('0x66')]=0x0;this[_0xcee2('0x67')]=_0x3d7611[_0xcee2('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x3d7611[_0xcee2('0x68')]||0xa;this[_0xcee2('0x69')]=0x0;this[_0xcee2('0x6a')]=0x0;this[_0xcee2('0x6b')]=0x1;this[_0xcee2('0x6c')]=0x0;this[_0xcee2('0x6d')]=0x0;this[_0xcee2('0x6e')]=0x0;this[_0xcee2('0x6f')]=0x0;this[_0xcee2('0x70')]=_0x3d7611['dialRecallMeTimeout']||0x1e;this[_0xcee2('0x71')]=_0x3d7611[_0xcee2('0x71')]||![];this[_0xcee2('0x72')]=_0x3d7611['dialQueueProject2']||undefined;this[_0xcee2('0x73')]=_0x3d7611[_0xcee2('0x73')]||![];this[_0xcee2('0x74')]=_0x3d7611[_0xcee2('0x74')]||![];this[_0xcee2('0xb')]=monitorFormat[_0x3d7611[_0xcee2('0xb')]]?monitorFormat[_0x3d7611[_0xcee2('0xb')]]:undefined;this[_0xcee2('0x75')]=_0x3d7611[_0xcee2('0x75')]||![];this[_0xcee2('0x76')]=_0x3d7611[_0xcee2('0x76')]?_0x3d7611[_0xcee2('0x76')]:undefined;}module[_0xcee2('0x77')]=VoiceQueue; \ No newline at end of file +var _0x4d07=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','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','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4d07,0x18e));var _0x74d0=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x4d07[_0x54a9e3];return _0x247cce;};'use strict';var statusDesc=[_0x74d0('0x0'),'not_inuse',_0x74d0('0x1'),'busy','invalid','unavailable','ringing',_0x74d0('0x2'),_0x74d0('0x3')];var monitorFormat={'wav':_0x74d0('0x4'),'wav49':_0x74d0('0x5'),'gsm':_0x74d0('0x6')};var strategy={'rrmemory':_0x74d0('0x7'),'roundrobin':_0x74d0('0x8')};function VoiceQueue(_0x2dd3a4){this['id']=_0x2dd3a4['id']||0x0;this[_0x74d0('0x9')]=_0x2dd3a4[_0x74d0('0x9')]||'';this[_0x74d0('0xa')]=_0x2dd3a4[_0x74d0('0xa')]||'';this[_0x74d0('0xb')]=_0x2dd3a4['type']||_0x74d0('0xc');this[_0x74d0('0xd')]=0x0;this[_0x74d0('0xe')]=0x0;this[_0x74d0('0xf')]=0x0;this['answered']=0x0;this[_0x74d0('0x10')]=0x0;this[_0x74d0('0x11')]=0x0;this[_0x74d0('0x12')]=0x0;this[_0x74d0('0x13')]=0x0;this[_0x74d0('0x14')]=0x0;this[_0x74d0('0x15')]=0x0;this['available']=0x0;this[_0x74d0('0x16')]=_0x2dd3a4['acw']||![];this[_0x74d0('0x17')]=_0x2dd3a4[_0x74d0('0x17')]||0xa;this[_0x74d0('0x18')]=_0x2dd3a4[_0x74d0('0x18')]||'no';this[_0x74d0('0x19')]=!![];this[_0x74d0('0x1a')]='';this['originated']=0x0;this[_0x74d0('0x1b')]=0x0;this[_0x74d0('0x1c')]=_0x2dd3a4[_0x74d0('0x1c')]||null;this['dialGlobalInterval']=_0x2dd3a4[_0x74d0('0x1d')]?_0x2dd3a4[_0x74d0('0x1d')]:null;this[_0x74d0('0x1e')]=_0x2dd3a4['dialActive'];this[_0x74d0('0x1f')]=_0x2dd3a4[_0x74d0('0x1f')]||_0x74d0('0x20');this[_0x74d0('0x21')]=_0x2dd3a4[_0x74d0('0x21')]||0x0;this['dialLimitQueue']=_0x2dd3a4[_0x74d0('0x22')]||0x0;this['dialPowerLevel']=_0x2dd3a4[_0x74d0('0x23')]||0x1;this[_0x74d0('0x24')]=_0x2dd3a4[_0x74d0('0x24')]||_0x74d0('0x25');this[_0x74d0('0x26')]=_0x2dd3a4[_0x74d0('0x26')]||0.03;this[_0x74d0('0x27')]=_0x2dd3a4[_0x74d0('0x27')]||0x258;this[_0x74d0('0x28')]=_0x2dd3a4['dialOriginateCallerIdName']||_0x74d0('0x29');this['dialOriginateCallerIdNumber']=_0x2dd3a4[_0x74d0('0x2a')]||_0x74d0('0x29');this[_0x74d0('0x2b')]=_0x2dd3a4[_0x74d0('0x2b')]||0x1e;this[_0x74d0('0x2c')]=_0x2dd3a4[_0x74d0('0x2c')]||_0x74d0('0x2d');this[_0x74d0('0x2e')]=_0x2dd3a4[_0x74d0('0x2e')]||0x3;this[_0x74d0('0x2f')]=_0x2dd3a4[_0x74d0('0x2f')]||undefined;this[_0x74d0('0x30')]=_0x2dd3a4[_0x74d0('0x30')]||0x3;this[_0x74d0('0x31')]=_0x2dd3a4['dialCongestionRetryFrequency']||0x96;this[_0x74d0('0x32')]=_0x2dd3a4[_0x74d0('0x32')]||0x3;this[_0x74d0('0x33')]=_0x2dd3a4[_0x74d0('0x33')]||0x96;this[_0x74d0('0x34')]=_0x2dd3a4[_0x74d0('0x34')]||0x3;this[_0x74d0('0x35')]=_0x2dd3a4[_0x74d0('0x35')]||0x96;this[_0x74d0('0x36')]=_0x2dd3a4['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2dd3a4[_0x74d0('0x37')]||0x96;this['dialDropMaxRetry']=_0x2dd3a4[_0x74d0('0x38')]||0x3;this[_0x74d0('0x39')]=_0x2dd3a4[_0x74d0('0x39')]||0x96;this['dialAbandonedMaxRetry']=_0x2dd3a4['dialAbandonedMaxRetry']||0x3;this[_0x74d0('0x3a')]=_0x2dd3a4[_0x74d0('0x3a')]||0x96;this[_0x74d0('0x3b')]=_0x2dd3a4['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x2dd3a4[_0x74d0('0x3c')]||0x96;this[_0x74d0('0x3d')]=_0x2dd3a4[_0x74d0('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2dd3a4[_0x74d0('0x3e')]||0x96;this[_0x74d0('0x3f')]=_0x2dd3a4[_0x74d0('0x3f')]||0x4;this[_0x74d0('0x40')]=_0x2dd3a4[_0x74d0('0x40')]?_0x2dd3a4['Trunk']:undefined;this['TrunkBackup']=_0x2dd3a4[_0x74d0('0x41')]?_0x2dd3a4[_0x74d0('0x41')]:undefined;this[_0x74d0('0x42')]=_0x2dd3a4[_0x74d0('0x42')]||undefined;this['Interval']=_0x2dd3a4[_0x74d0('0x43')]?_0x2dd3a4[_0x74d0('0x43')]:undefined;this[_0x74d0('0x44')]=_0x2dd3a4[_0x74d0('0x44')]||_0x74d0('0x45');this[_0x74d0('0x46')]=_0x2dd3a4[_0x74d0('0x46')]||undefined;this[_0x74d0('0x47')]=_0x2dd3a4[_0x74d0('0x47')]||undefined;this[_0x74d0('0x48')]=strategy[_0x2dd3a4[_0x74d0('0x48')]]||_0x74d0('0x7');this[_0x74d0('0x49')]=!![];this['dialAMDActive']=_0x2dd3a4[_0x74d0('0x4a')]||![];this[_0x74d0('0x4b')]=_0x2dd3a4[_0x74d0('0x4b')];this[_0x74d0('0x4c')]=_0x2dd3a4[_0x74d0('0x4c')];this[_0x74d0('0x4d')]=_0x2dd3a4[_0x74d0('0x4d')];this[_0x74d0('0x4e')]=_0x2dd3a4[_0x74d0('0x4e')];this[_0x74d0('0x4f')]=_0x2dd3a4['dialAMDMinWordLength'];this[_0x74d0('0x50')]=_0x2dd3a4[_0x74d0('0x50')];this[_0x74d0('0x51')]=_0x2dd3a4['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x2dd3a4[_0x74d0('0x52')];this[_0x74d0('0x53')]=_0x2dd3a4['dialAMDMaximumWordLength'];this[_0x74d0('0x54')]=0x0;this['pTalking']=0x0;this[_0x74d0('0x55')]=_0x2dd3a4[_0x74d0('0x55')];this[_0x74d0('0x56')]=0x0;this[_0x74d0('0x57')]=0x0;this[_0x74d0('0x58')]=0x0;this[_0x74d0('0x59')]=0x0;this[_0x74d0('0x5a')]=0x0;this[_0x74d0('0x5b')]=0x0;this[_0x74d0('0x5c')]=0x0;this[_0x74d0('0x5d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x74d0('0x5e')]=0x0;this[_0x74d0('0x5f')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x74d0('0x60')]=undefined;this['startPredictive']=undefined;this[_0x74d0('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x74d0('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x74d0('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x74d0('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x74d0('0x65')]=0x0;this[_0x74d0('0x66')]=0x0;this[_0x74d0('0x67')]=_0x2dd3a4[_0x74d0('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x2dd3a4['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x74d0('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x74d0('0x6a')]=0x1;this[_0x74d0('0x6b')]=0x0;this[_0x74d0('0x6c')]=0x0;this[_0x74d0('0x6d')]=0x0;this[_0x74d0('0x6e')]=0x0;this['dialRecallMeTimeout']=_0x2dd3a4[_0x74d0('0x6f')]||0x1e;this[_0x74d0('0x70')]=_0x2dd3a4['dialRecallInQueue']||![];this[_0x74d0('0x71')]=_0x2dd3a4[_0x74d0('0x71')]||undefined;this[_0x74d0('0x72')]=_0x2dd3a4[_0x74d0('0x72')]||![];this[_0x74d0('0x73')]=_0x2dd3a4['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x2dd3a4['monitor_format']]?monitorFormat[_0x2dd3a4[_0x74d0('0xa')]]:undefined;this[_0x74d0('0x74')]=_0x2dd3a4[_0x74d0('0x74')]||![];this[_0x74d0('0x75')]=_0x2dd3a4['mandatoryDispositionPause']?_0x2dd3a4['mandatoryDispositionPause']:undefined;}module[_0x74d0('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7add1a1..1bb151a 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 _0x150a=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x150a,0x166));var _0xa150=function(_0x1e8053,_0x3c64e4){_0x1e8053=_0x1e8053-0x0;var _0x399f8d=_0x150a[_0x1e8053];return _0x399f8d;};'use strict';function VtigerAccount(_0x5bfb54){this['id']=_0x5bfb54['id']||0x0;this[_0xa150('0x0')]=_0x5bfb54[_0xa150('0x0')]||'';this[_0xa150('0x1')]=_0x5bfb54[_0xa150('0x1')]||'';this[_0xa150('0x2')]=_0x5bfb54['accessKey']||'';this[_0xa150('0x3')]=_0x5bfb54[_0xa150('0x3')]||'';this[_0xa150('0x4')]=_0x5bfb54[_0xa150('0x4')]||'';this[_0xa150('0x5')]=_0x5bfb54[_0xa150('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x2906=['accessKey','remoteUri','serverUrl','exports','name','username'];(function(_0x146da8,_0x1aae5a){var _0x155be4=function(_0x4310c1){while(--_0x4310c1){_0x146da8['push'](_0x146da8['shift']());}};_0x155be4(++_0x1aae5a);}(_0x2906,0xac));var _0x6290=function(_0x2f2036,_0x11175){_0x2f2036=_0x2f2036-0x0;var _0x3aaf7e=_0x2906[_0x2f2036];return _0x3aaf7e;};'use strict';function VtigerAccount(_0x523272){this['id']=_0x523272['id']||0x0;this[_0x6290('0x0')]=_0x523272['name']||'';this[_0x6290('0x1')]=_0x523272[_0x6290('0x1')]||'';this[_0x6290('0x2')]=_0x523272[_0x6290('0x2')]||'';this[_0x6290('0x3')]=_0x523272[_0x6290('0x3')]||'';this['serverUrl']=_0x523272[_0x6290('0x4')]||'';this['Configurations']=_0x523272['Configurations']||{};}module[_0x6290('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 216ce67..29d0a3c 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 _0x4ec2=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x40bf27,_0x334d04){var _0x34e8f8=function(_0x4d8e4b){while(--_0x4d8e4b){_0x40bf27['push'](_0x40bf27['shift']());}};_0x34e8f8(++_0x334d04);}(_0x4ec2,0x72));var _0x24ec=function(_0x490d6b,_0x3eebd4){_0x490d6b=_0x490d6b-0x0;var _0xf760d0=_0x4ec2[_0x490d6b];return _0xf760d0;};'use strict';function ZendeskAccount(_0x1ab6db){this['id']=_0x1ab6db['id']||0x0;this[_0x24ec('0x0')]=_0x1ab6db[_0x24ec('0x0')]||'';this['username']=_0x1ab6db[_0x24ec('0x1')]||'';this[_0x24ec('0x2')]=_0x1ab6db[_0x24ec('0x2')]||'';this['token']=_0x1ab6db[_0x24ec('0x3')]||'';this[_0x24ec('0x4')]=_0x1ab6db[_0x24ec('0x4')]||'';this[_0x24ec('0x5')]=_0x1ab6db[_0x24ec('0x5')]||'';this['type']=_0x1ab6db[_0x24ec('0x6')]||_0x24ec('0x7');this['serverUrl']=_0x1ab6db[_0x24ec('0x8')]||'';this[_0x24ec('0x9')]=_0x1ab6db['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x6e2e=['authType','type','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e2e,0x1a2));var _0xe6e2=function(_0x4ee3df,_0x1939e5){_0x4ee3df=_0x4ee3df-0x0;var _0x10a525=_0x6e2e[_0x4ee3df];return _0x10a525;};'use strict';function ZendeskAccount(_0x736127){this['id']=_0x736127['id']||0x0;this[_0xe6e2('0x0')]=_0x736127[_0xe6e2('0x0')]||'';this[_0xe6e2('0x1')]=_0x736127[_0xe6e2('0x1')]||'';this[_0xe6e2('0x2')]=_0x736127[_0xe6e2('0x2')]||'';this[_0xe6e2('0x3')]=_0x736127[_0xe6e2('0x3')]||'';this['remoteUri']=_0x736127[_0xe6e2('0x4')]||'';this[_0xe6e2('0x5')]=_0x736127[_0xe6e2('0x5')]||'';this['type']=_0x736127[_0xe6e2('0x6')]||'integrationTab';this[_0xe6e2('0x7')]=_0x736127[_0xe6e2('0x7')]||'';this[_0xe6e2('0x8')]=_0x736127[_0xe6e2('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 50e5ca0..629175e 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 _0xeaff=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','clientId'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0xeaff,0x1a0));var _0xfeaf=function(_0xe19851,_0x126517){_0xe19851=_0xe19851-0x0;var _0x25d567=_0xeaff[_0xe19851];return _0x25d567;};'use strict';function ZohoAccount(_0x1f458f){this['id']=_0x1f458f['id']||0x0;this[_0xfeaf('0x0')]=_0x1f458f[_0xfeaf('0x0')]||'';this[_0xfeaf('0x1')]=_0x1f458f[_0xfeaf('0x1')]||'';this[_0xfeaf('0x2')]=_0x1f458f['host']||'';this['zone']=_0x1f458f['zone']||'';this[_0xfeaf('0x3')]=_0x1f458f['clientId']||'';this[_0xfeaf('0x4')]=_0x1f458f[_0xfeaf('0x4')]||'';this[_0xfeaf('0x5')]=_0x1f458f[_0xfeaf('0x5')]||'';this[_0xfeaf('0x6')]=_0x1f458f[_0xfeaf('0x6')]||'';this[_0xfeaf('0x7')]=_0x1f458f[_0xfeaf('0x7')]||'';this[_0xfeaf('0x8')]=_0x1f458f[_0xfeaf('0x8')]||{};}module[_0xfeaf('0x9')]=ZohoAccount; \ No newline at end of file +var _0xe21d=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','description','host'];(function(_0x14489c,_0x4ae817){var _0xfcfad9=function(_0x351311){while(--_0x351311){_0x14489c['push'](_0x14489c['shift']());}};_0xfcfad9(++_0x4ae817);}(_0xe21d,0x152));var _0xde21=function(_0x35e2e7,_0xe65e67){_0x35e2e7=_0x35e2e7-0x0;var _0x213d75=_0xe21d[_0x35e2e7];return _0x213d75;};'use strict';function ZohoAccount(_0xf114f8){this['id']=_0xf114f8['id']||0x0;this['name']=_0xf114f8['name']||'';this[_0xde21('0x0')]=_0xf114f8[_0xde21('0x0')]||'';this[_0xde21('0x1')]=_0xf114f8[_0xde21('0x1')]||'';this[_0xde21('0x2')]=_0xf114f8[_0xde21('0x2')]||'';this[_0xde21('0x3')]=_0xf114f8[_0xde21('0x3')]||'';this[_0xde21('0x4')]=_0xf114f8['clientSecret']||'';this[_0xde21('0x5')]=_0xf114f8['serverUrl']||'';this[_0xde21('0x6')]=_0xf114f8['code']||'';this[_0xde21('0x7')]=_0xf114f8[_0xde21('0x7')]||'';this[_0xde21('0x8')]=_0xf114f8['Configurations']||{};}module[_0xde21('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 26eac34..2a982b5 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 _0x53a8=['calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','format','\x22%s\x22\x20<%s>','util','lodash','isNil','string','uniqueid','queue','name','type','dialAnswer','membername','Agent','channelAgent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x53a8,0x1d4));var _0x853a=function(_0x1843ef,_0x296664){_0x1843ef=_0x1843ef-0x0;var _0xa8216f=_0x53a8[_0x1843ef];return _0xa8216f;};'use strict';var util=require(_0x853a('0x0'));var _=require(_0x853a('0x1'));var moment=require('moment');function checkNameSurname(_0x1367cd,_0x130fae,_0x2f4579){var _0x225d18='';if(!_[_0x853a('0x2')](_0x130fae)&&_0x853a('0x3')===typeof _0x130fae){_0x225d18+=_0x130fae;}if(!_[_0x853a('0x2')](_0x2f4579)&&_0x853a('0x3')===typeof _0x2f4579){_0x225d18+='\x20'+_0x2f4579;}if(_0x225d18!==''){return _0x225d18;}return _0x1367cd;}function Action(_0x306c41,_0x40334c,_0x5ef072,_0x170391,_0x59e90a){this[_0x853a('0x4')]=_0x5ef072||undefined;this['idContact']=_0x306c41['id'];this[_0x853a('0x5')]=_0x40334c[_0x853a('0x6')];this[_0x853a('0x7')]=_0x40334c[_0x853a('0x7')];this['campaigntype']='queue';this[_0x853a('0x8')]=![];this[_0x853a('0x9')]=_[_0x853a('0x2')](_0x306c41['Agent'])?undefined:_0x306c41[_0x853a('0xa')]['name'];this[_0x853a('0xb')]=this['membername']?util['format']('SIP/%s',this[_0x853a('0x9')]):_0x170391||undefined;this[_0x853a('0xc')]=checkNameSurname(_0x306c41[_0x853a('0xd')][_0x853a('0xe')],_0x306c41['Contact'][_0x853a('0xf')],_0x306c41[_0x853a('0xd')][_0x853a('0x10')]);this['active']=_0x306c41[_0x853a('0x11')]||![];this[_0x853a('0x12')]=_0x306c41['Contact'][_0x853a('0xe')];this[_0x853a('0x13')]=_0x306c41['scheduledat'];this[_0x853a('0x14')]=_0x306c41[_0x853a('0x14')]||0x0;this[_0x853a('0x15')]=_0x306c41[_0x853a('0x15')]||0x0;this['countnoanswerretry']=_0x306c41[_0x853a('0x16')]||0x0;this['countglobal']=(_0x306c41[_0x853a('0x14')]||0x0)+(_0x306c41[_0x853a('0x15')]||0x0)+(_0x306c41[_0x853a('0x16')]||0x0)+(_0x306c41[_0x853a('0x17')]||0x0)+(_0x306c41[_0x853a('0x18')]||0x0)+(_0x306c41[_0x853a('0x19')]||0x0)+(_0x306c41[_0x853a('0x1a')]||0x0)+(_0x306c41['countagentrejectretry']||0x0);this[_0x853a('0x17')]=_0x306c41[_0x853a('0x17')]||0x0;this[_0x853a('0x18')]=_0x306c41[_0x853a('0x18')]||0x0;this[_0x853a('0x19')]=_0x306c41['countabandonedretry']||0x0;this[_0x853a('0x1a')]=_0x306c41['countmachineretry']||0x0;this[_0x853a('0x1b')]=_0x306c41['countagentrejectretry']||0x0;this[_0x853a('0x1c')]=_0x306c41[_0x853a('0x1c')];this[_0x853a('0x1d')]=_0x306c41[_0x853a('0x1d')];this[_0x853a('0x1e')]=_0x306c41[_0x853a('0x1e')];this[_0x853a('0x1f')]=_0x306c41[_0x853a('0x1f')];this[_0x853a('0x20')]=_0x306c41[_0x853a('0x20')];this[_0x853a('0x21')]=_0x306c41[_0x853a('0x21')];this['UserId']=_['isNil'](_0x306c41[_0x853a('0xa')])?_0x306c41[_0x853a('0x22')]:_0x306c41['Agent']['id'];this['VoiceQueueId']=_0x306c41[_0x853a('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x853a('0x24')][_0x853a('0x25')]=function(){return util[_0x853a('0x26')](_0x853a('0x27'),this[_0x853a('0xc')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x057f=['type','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','idContact','queue','name'];(function(_0x3c0670,_0x143f56){var _0x4feedb=function(_0x380ce4){while(--_0x380ce4){_0x3c0670['push'](_0x3c0670['shift']());}};_0x4feedb(++_0x143f56);}(_0x057f,0x160));var _0xf057=function(_0x1706ed,_0x170a80){_0x1706ed=_0x1706ed-0x0;var _0x25344d=_0x057f[_0x1706ed];return _0x25344d;};'use strict';var util=require(_0xf057('0x0'));var _=require(_0xf057('0x1'));var moment=require(_0xf057('0x2'));function checkNameSurname(_0x24e03f,_0xe0736f,_0x876064){var _0x374ec1='';if(!_[_0xf057('0x3')](_0xe0736f)&&_0xf057('0x4')===typeof _0xe0736f){_0x374ec1+=_0xe0736f;}if(!_[_0xf057('0x3')](_0x876064)&&_0xf057('0x4')===typeof _0x876064){_0x374ec1+='\x20'+_0x876064;}if(_0x374ec1!==''){return _0x374ec1;}return _0x24e03f;}function Action(_0x4b9b3c,_0x569aa5,_0x5366b0,_0x39a9a9,_0x288ba3){this['uniqueid']=_0x5366b0||undefined;this[_0xf057('0x5')]=_0x4b9b3c['id'];this[_0xf057('0x6')]=_0x569aa5[_0xf057('0x7')];this[_0xf057('0x8')]=_0x569aa5[_0xf057('0x8')];this['campaigntype']=_0xf057('0x6');this['dialAnswer']=![];this['membername']=_[_0xf057('0x3')](_0x4b9b3c['Agent'])?undefined:_0x4b9b3c[_0xf057('0x9')][_0xf057('0x7')];this[_0xf057('0xa')]=this[_0xf057('0xb')]?util[_0xf057('0xc')](_0xf057('0xd'),this['membername']):_0x39a9a9||undefined;this[_0xf057('0xe')]=checkNameSurname(_0x4b9b3c[_0xf057('0xf')][_0xf057('0x10')],_0x4b9b3c[_0xf057('0xf')][_0xf057('0x11')],_0x4b9b3c[_0xf057('0xf')][_0xf057('0x12')]);this[_0xf057('0x13')]=_0x4b9b3c[_0xf057('0x13')]||![];this[_0xf057('0x14')]=_0x4b9b3c['Contact']['phone'];this[_0xf057('0x15')]=_0x4b9b3c[_0xf057('0x15')];this[_0xf057('0x16')]=_0x4b9b3c['countbusyretry']||0x0;this[_0xf057('0x17')]=_0x4b9b3c[_0xf057('0x17')]||0x0;this[_0xf057('0x18')]=_0x4b9b3c['countnoanswerretry']||0x0;this[_0xf057('0x19')]=(_0x4b9b3c[_0xf057('0x16')]||0x0)+(_0x4b9b3c['countcongestionretry']||0x0)+(_0x4b9b3c[_0xf057('0x18')]||0x0)+(_0x4b9b3c[_0xf057('0x1a')]||0x0)+(_0x4b9b3c[_0xf057('0x1b')]||0x0)+(_0x4b9b3c[_0xf057('0x1c')]||0x0)+(_0x4b9b3c['countmachineretry']||0x0)+(_0x4b9b3c['countagentrejectretry']||0x0);this[_0xf057('0x1a')]=_0x4b9b3c['countnosuchnumberretry']||0x0;this[_0xf057('0x1b')]=_0x4b9b3c[_0xf057('0x1b')]||0x0;this[_0xf057('0x1c')]=_0x4b9b3c[_0xf057('0x1c')]||0x0;this[_0xf057('0x1d')]=_0x4b9b3c[_0xf057('0x1d')]||0x0;this[_0xf057('0x1e')]=_0x4b9b3c[_0xf057('0x1e')]||0x0;this[_0xf057('0x1f')]=_0x4b9b3c[_0xf057('0x1f')];this['callbackuniqueid']=_0x4b9b3c[_0xf057('0x20')];this[_0xf057('0x21')]=_0x4b9b3c[_0xf057('0x21')];this[_0xf057('0x22')]=_0x4b9b3c[_0xf057('0x22')];this[_0xf057('0x23')]=_0x4b9b3c[_0xf057('0x23')];this['ListId']=_0x4b9b3c[_0xf057('0x24')];this['UserId']=_[_0xf057('0x3')](_0x4b9b3c['Agent'])?_0x4b9b3c[_0xf057('0x25')]:_0x4b9b3c[_0xf057('0x9')]['id'];this[_0xf057('0x26')]=_0x4b9b3c['VoiceQueueId'];this[_0xf057('0x27')]='';this[_0xf057('0x28')]='';}Action[_0xf057('0x29')][_0xf057('0x2a')]=function(){return util['format'](_0xf057('0x2b'),this['calleridname'],this[_0xf057('0x2c')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index df28b5e..9f952f2 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 _0x8418=['unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[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','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','responsetime','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','variables','syncVarSet','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','syncBlindTransfer','transfererlinkedid','util','lodash','md5','ioredis','preview','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','attendedtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','talking','total','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','available','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','clearZombieChannel','recallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable'];(function(_0x32e8f2,_0x33cff3){var _0xefd2e6=function(_0x524abd){while(--_0x524abd){_0x32e8f2['push'](_0x32e8f2['shift']());}};_0xefd2e6(++_0x33cff3);}(_0x8418,0x1a4));var _0x8841=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x8418[_0x4a209a];return _0x4b3c20;};'use strict';var util=require(_0x8841('0x0'));var _=require(_0x8841('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require(_0x8841('0x2'));var Redis=require(_0x8841('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x8841('0x4'));var loggerAction=require(_0x8841('0x5'))(_0x8841('0x6'));var ami=require(_0x8841('0x7'));var rpcDb=require('./rpcDb');var Action=require(_0x8841('0x8'));var ut=require(_0x8841('0x9'));config[_0x8841('0xa')]=_['defaults'](config[_0x8841('0xa')],{'host':_0x8841('0xb'),'port':0x18eb});var io=require(_0x8841('0xc'))(new Redis(config[_0x8841('0xa')]));var Sequence=function(){};Sequence[_0x8841('0xd')][_0x8841('0xe')]=function(_0x27684e){this[_0x8841('0xf')]=this[_0x8841('0xf')]?this[_0x8841('0xf')]['finally'](_0x27684e):_0x27684e();};function Preview(_0x5deaac){this[_0x8841('0x10')]=new Sequence();this[_0x8841('0x11')]=_0x5deaac[_0x8841('0x12')];this[_0x8841('0x13')]=_0x5deaac[_0x8841('0x13')];this[_0x8841('0x14')]={};this[_0x8841('0x15')]=_0x5deaac['agents'];this[_0x8841('0x16')]=0x0;ami['on'](_0x8841('0x17'),this['syncOriginateResponse'][_0x8841('0x18')](this));ami['on'](_0x8841('0x19'),this['syncHangup']['bind'](this));ami['on'](_0x8841('0x1a'),this[_0x8841('0x1b')]['bind'](this));ami['on'](_0x8841('0x1c'),this['syncDialEnd'][_0x8841('0x18')](this));ami['on'](_0x8841('0x1d'),this[_0x8841('0x1e')][_0x8841('0x18')](this));ami['on'](_0x8841('0x1f'),this['syncVarSet'][_0x8841('0x18')](this));ami['on'](_0x8841('0x20'),this['syncAttendedTransfer'][_0x8841('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x8841('0x18')](this));this[_0x8841('0x21')](this[_0x8841('0x11')]);}function emit(_0x7c72a0,_0x294911,_0x9df22e){io['to'](_0x7c72a0)[_0x8841('0x22')](_0x294911,_0x9df22e);}function emitCampaignPreview(_0x5a1590){if(_0x5a1590[_0x8841('0x23')]===_0x8841('0x24')){var _0x1b9063={'id':_0x5a1590['id'],'name':_0x5a1590[_0x8841('0x25')],'strategy':_0x5a1590[_0x8841('0x26')],'answered':_0x5a1590[_0x8841('0x27')],'available':_0x5a1590['available'],'loggedIn':_0x5a1590[_0x8841('0x28')],'pTalking':_0x5a1590[_0x8841('0x29')],'sumBillable':_0x5a1590[_0x8841('0x2a')],'sumDuration':_0x5a1590['sumDuration'],'sumHoldTime':_0x5a1590['sumHoldTime']||0x0,'talking':_0x5a1590[_0x8841('0x2b')],'total':_0x5a1590[_0x8841('0x2c')],'type':_0x5a1590['type'],'unmanaged':_0x5a1590['unmanaged'],'abandoned':_0x5a1590[_0x8841('0x2d')],'waiting':_0x5a1590[_0x8841('0x2e')],'loggedInDb':_0x5a1590['loggedInDb'],'dialActive':_0x5a1590[_0x8841('0x2f')],'dialMethod':_0x5a1590[_0x8841('0x30')],'dialOriginateCallerIdName':_0x5a1590[_0x8841('0x31')],'dialOriginateCallerIdNumber':_0x5a1590[_0x8841('0x32')],'dialOriginateTimeout':_0x5a1590[_0x8841('0x33')],'dialPrefix':_0x5a1590[_0x8841('0x34')],'outboundAnswerAgiCallsDay':_0x5a1590['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5a1590[_0x8841('0x35')],'outboundBlacklistCallsDay':_0x5a1590[_0x8841('0x36')],'outboundBusyCallsDay':_0x5a1590['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5a1590['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5a1590[_0x8841('0x37')],'outboundDropCallsDayCallersExit':_0x5a1590['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5a1590['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5a1590[_0x8841('0x38')],'outboundNoSuchCallsDay':_0x5a1590[_0x8841('0x39')],'outboundOriginateFailureCallsDay':_0x5a1590['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5a1590['outboundReCallsDay'],'outboundRejectCallsDay':_0x5a1590[_0x8841('0x3a')],'outboundUnknownCallsDay':_0x5a1590[_0x8841('0x3b')],'outboundAbandonedCallsDay':_0x5a1590[_0x8841('0x3c')],'predictiveIntervalAnsweredCalls':_0x5a1590[_0x8841('0x3d')],'predictiveIntervalAvgHoldtime':_0x5a1590['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5a1590['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5a1590['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5a1590[_0x8841('0x3e')],'predictiveIntervalErlangCalls':_0x5a1590[_0x8841('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a1590['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5a1590[_0x8841('0x40')],'predictiveIntervalMultiplicativeFactor':_0x5a1590['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5a1590[_0x8841('0x41')],'predictiveIntervalAvailable':_0x5a1590[_0x8841('0x42')],'predictiveIntervalTotalCalls':_0x5a1590[_0x8841('0x43')],'message':_0x5a1590['message'],'originated':_0x5a1590['originated'],'erlangCalls':_0x5a1590[_0x8841('0x44')],'erlangCallToSecond':_0x5a1590[_0x8841('0x45')],'erlangAbandonmentRate':_0x5a1590[_0x8841('0x46')],'erlangBusyFactor':_0x5a1590[_0x8841('0x47')],'startPredictive':_0x5a1590[_0x8841('0x48')],'startProgressive':_0x5a1590[_0x8841('0x49')]};if(_0x5a1590[_0x8841('0x4a')]){_0x1b9063['Trunk']={'id':_0x5a1590[_0x8841('0x4a')]['id'],'name':_0x5a1590['Trunk'][_0x8841('0x25')],'active':_0x5a1590[_0x8841('0x4a')][_0x8841('0x4b')],'callerid':_0x5a1590[_0x8841('0x4a')][_0x8841('0x4c')]};}if(_0x5a1590[_0x8841('0x4d')]){_0x1b9063[_0x8841('0x4d')]={'id':_0x5a1590[_0x8841('0x4d')]['id'],'name':_0x5a1590[_0x8841('0x4d')][_0x8841('0x25')]};}var _0x56cfbf=md5(JSON[_0x8841('0x4e')](_0x1b9063));if(_0x5a1590['md5']!==_0x56cfbf){_0x5a1590[_0x8841('0x2')]=_0x56cfbf;emit(util[_0x8841('0x4f')]('voice:queue:%s',_0x1b9063['name']),_0x8841('0x50'),_0x1b9063);}}}function emitVoiceQueueChannelRemove(_0xafe143){logger[_0x8841('0x51')](_0x8841('0x52'),JSON['stringify'](_0xafe143));emit(util['format'](_0x8841('0x53'),_0xafe143[_0x8841('0x25')]),'voice_queue_channel:remove',_0xafe143);io[_0x8841('0x22')](_0x8841('0x54'),_0xafe143);}function notSendMessagesQueue(_0x1dbb4d){if(_0x1dbb4d[_0x8841('0x55')]){if(_0x1dbb4d['originated']===0x0&&_0x1dbb4d[_0x8841('0x29')]===0x0){_0x1dbb4d[_0x8841('0x55')]=![];_0x1dbb4d[_0x8841('0x56')]=0x0;_0x1dbb4d['paused']=0x0;_0x1dbb4d[_0x8841('0x57')]=_0x8841('0x58');ut[_0x8841('0x59')](_0x8841('0x5a'),_0x1dbb4d[_0x8841('0x25')]+_0x8841('0x5b'));}else{_0x1dbb4d['message']=_0x8841('0x5c');ut['logger'](_0x8841('0x5a'),_0x1dbb4d[_0x8841('0x25')]+_0x8841('0x5d'));}emitCampaignPreview(_0x1dbb4d);}}Preview['prototype'][_0x8841('0x21')]=function(){var _0x26478d=this;setInterval(function(){_0x26478d[_0x8841('0x5e')]();},0x7cf);};Preview['prototype'][_0x8841('0x5e')]=function(){var _0x192304=this[_0x8841('0x11')];this[_0x8841('0x16')]+=0x1;for(var _0x5507c9 in _0x192304){if(_0x192304[_0x8841('0x5f')](_0x5507c9)&&(_0x192304[_0x5507c9][_0x8841('0x30')]===_0x8841('0x4')||_0x192304[_0x5507c9]['dialMethod']===_0x8841('0x60'))&&_0x192304[_0x5507c9]['type']===_0x8841('0x24')){if(this[_0x8841('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x192304['hasOwnProperty'](_0x5507c9)&&_0x192304[_0x5507c9][_0x8841('0x30')]==='preview'&&_0x192304[_0x5507c9]['type']===_0x8841('0x24')){if(_0x192304[_0x5507c9][_0x8841('0x2f')]){this['setMessage'](_0x192304[_0x5507c9]);this['recallMe'](_0x192304[_0x5507c9]);}else{notSendMessagesQueue(_0x192304[_0x5507c9]);}}}};Preview[_0x8841('0xd')]['clearZombieChannel']=function(_0x11e562){var _0x27b9b6=this;this['sequence'][_0x8841('0xe')](function(){if(!_[_0x8841('0x61')](_0x27b9b6[_0x8841('0x14')][_0x11e562])){loggerAction[_0x8841('0x51')](_0x8841('0x62'),_0x11e562,_0x8841('0x63'),_0x27b9b6['actions'][_0x11e562][_0x8841('0x64')],_0x8841('0x65'),JSON[_0x8841('0x4e')](_0x27b9b6[_0x8841('0x11')][_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x64')]][_0x8841('0x66')]),_0x8841('0x67'),JSON[_0x8841('0x4e')](_0x27b9b6[_0x8841('0x11')][_0x27b9b6[_0x8841('0x14')][_0x11e562]['queue']][_0x8841('0x29')]),JSON[_0x8841('0x4e')](_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x68')]),JSON[_0x8841('0x4e')](_[_0x8841('0x69')](_0x27b9b6['actions'][_0x11e562],[_0x8841('0x6a'),_0x8841('0x6b'),_0x8841('0x6c'),_0x8841('0x6d')])));return ami['Action']({'action':'status','channel':_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x6e')]})[_0x8841('0x6f')](function(_0x25358f){if(_0x25358f['message']===_0x8841('0x70')){setTimeout(function(){if(_0x27b9b6[_0x8841('0x14')][_0x11e562]){ut[_0x8841('0x71')](_0x27b9b6[_0x8841('0x11')][_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x64')]],_0x8841('0x72'));if(_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x68')]===!![]){ut[_0x8841('0x73')](_0x27b9b6['campaignsPreview'][_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x64')]],_0x8841('0x72'));ut[_0x8841('0x74')](_0x8841('0x75')+_0x11e562,_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x64')]);}ut[_0x8841('0x74')]('[Dialer][checkChannel][Preview]'+_0x11e562,_0x27b9b6[_0x8841('0x14')][_0x11e562][_0x8841('0x64')]);delete _0x27b9b6[_0x8841('0x14')][_0x11e562];}},0x2328);}});}});};Preview[_0x8841('0xd')][_0x8841('0x76')]=function(){var _0x259153=this;loggerAction[_0x8841('0x51')]('[action]',_['size'](this['actions']));for(var _0x400f6a in this['actions']){if(_0x259153['actions'][_0x8841('0x5f')](_0x400f6a)){_0x259153[_0x8841('0x77')](_0x400f6a);}}};Preview[_0x8841('0xd')][_0x8841('0x78')]=function(_0x304ca3){var _0x53853d=this;rpcDb['getContactRecallMe'](_0x304ca3['id'],ut[_0x8841('0x79')](this['agents']))[_0x8841('0x7a')](function(_0x28791e){if(!_[_0x8841('0x61')](_0x28791e)){for(var _0x5d164d=0x0;_0x5d164d<_0x28791e[_0x8841('0x7b')];_0x5d164d+=0x1){if(ut[_0x8841('0x7c')](_0x28791e[_0x5d164d][_0x8841('0x7d')])<_0x304ca3[_0x8841('0x7e')]*0x3c){if(_0x28791e[_0x5d164d]['Agent']&&!_0x28791e[_0x5d164d]['Agent']['voicePause']){_0x53853d['run'](_0x28791e[_0x5d164d]['id'])[_0x8841('0x7a')](ut[_0x8841('0x7f')](_0x8841('0x80')))['catch'](ut[_0x8841('0x7f')]('[RecallMe]'));}else{rpcDb[_0x8841('0x81')](_0x28791e[_0x5d164d]['id']);}}else{var _0xe91eae=new Action(_0x28791e[_0x5d164d],_0x304ca3);_0xe91eae[_0x8841('0x82')]=moment()[_0x8841('0x4f')](_0x8841('0x83'));_0x304ca3['outboundReCallsDay']+=0x1;ut[_0x8841('0x84')](_0xe91eae,0x17,_0x8841('0x85'));if(_0x304ca3['dialRecallInQueue']){rpcDb[_0x8841('0x86')](ut[_0x8841('0x87')](_0x28791e[_0x5d164d]));rpcDb['createCustomerHistory'](_0xe91eae,_0x8841('0x88'));}else{ut[_0x8841('0x84')](_0xe91eae,0x16,_0x8841('0x89'));rpcDb[_0x8841('0x8a')](_0xe91eae,_0x8841('0x8b'));rpcDb[_0x8841('0x8c')](_0xe91eae,'[HistoryRecallClose]');}}}}})[_0x8841('0x6f')](ut[_0x8841('0x7f')](_0x8841('0x8d')));};Preview[_0x8841('0xd')][_0x8841('0x8e')]=function(_0x32892a){_0x32892a[_0x8841('0x55')]=!![];if(ut[_0x8841('0x8f')](_0x32892a['loggedIn'])){_0x32892a[_0x8841('0x57')]=_0x8841('0x90');}else if(!ut['isActive'](_0x32892a['dialActive'])){_0x32892a[_0x8841('0x57')]=_0x8841('0x58');}else if(!this[_0x8841('0x91')](_0x32892a[_0x8841('0x4a')])){if(!this['isTrunkReachable'](_0x32892a[_0x8841('0x92')])){_0x32892a[_0x8841('0x57')]='TRUNK_IS_NOT_REACHABLE';}else{_0x32892a[_0x8841('0x57')]=_0x8841('0x93');}}else{_0x32892a[_0x8841('0x57')]='ACTIVE';}emitCampaignPreview(_0x32892a);};Preview[_0x8841('0xd')]['callProgressDetectingCustomer']=function(_0x4c49f5,_0x386c39,_0x4ff965){var _0x43cbd6=this;var _0xf747bf=this[_0x8841('0x14')][_0x386c39];var _0x11d94c=this[_0x8841('0x11')][_0xf747bf[_0x8841('0x64')]];var _0x2ae56e;if(_0x11d94c){switch(_0x4ff965){case'1':_0x11d94c['outboundNoSuchCallsDay']+=0x1;_0xf747bf[_0x8841('0x94')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut[_0x8841('0x84')](_0xf747bf,0x0,_0x8841('0x97'));ami['emit'](_0x8841('0x98'),ut[_0x8841('0x99')](_0xf747bf,'nosuchnumber'));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0x9a'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c[_0x8841('0x9b')]){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0x9e'));}else{if(_0xf747bf[_0x8841('0x94')]>=_0x11d94c[_0x8841('0x9f')]){rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0x9e'));}else{rpcDb[_0x8841('0xa0')](ut[_0x8841('0xa1')](_0xf747bf,'countnosuchnumberretry',_0x11d94c[_0x8841('0xa2')]),_0xf747bf[_0x8841('0xa3')],_0xf747bf[_0x8841('0xa4')]);}}delete this[_0x8841('0x14')][_0x4c49f5[_0x8841('0xa5')]];break;case _0x8841('0xa6'):var _0x7e0aa3=moment()[_0x8841('0x4f')](_0x8841('0x83'));_0xf747bf['responsetime']=_0x7e0aa3;_0xf747bf[_0x8841('0xa7')]=_0x7e0aa3;_0xf747bf[_0x8841('0x68')]=!![];_0x11d94c['pTalking']+=0x1;logger[_0x8841('0x51')](_0x8841('0xa8'),_0xf747bf[_0x8841('0xa9')],_0x8841('0xaa'),_0x11d94c[_0x8841('0x25')],_0x8841('0x67'),_0x11d94c[_0x8841('0x29')]);ami[_0x8841('0x22')]('custom:agentconnect',ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xab'),this[_0x8841('0x11')][_0xf747bf[_0x8841('0x64')]]));if(_0x11d94c[_0x8841('0xac')]){ami[_0x8841('0x22')](_0x8841('0xad'),ut[_0x8841('0xae')](_0xf747bf));}break;case'16':ami[_0x8841('0x22')](_0x8841('0xaf'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xb0'),this['campaignsPreview'][_0xf747bf[_0x8841('0x64')]]));emitVoiceQueueChannelRemove(ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xb0')));_0x11d94c[_0x8841('0x35')]+=0x1;_0x11d94c[_0x8841('0x2c')]+=0x1;_0x11d94c[_0x8841('0x27')]+=0x1;ut[_0x8841('0x73')](_0x11d94c,_0x8841('0xb1'));_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut['logCustomer'](_0xf747bf,0x4,_0x8841('0xb2'));rpcDb[_0x8841('0x8a')](_0xf747bf,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0xf747bf,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8841('0xb3')](_0xf747bf);_0x11d94c[_0x8841('0xb4')]+=_0xf747bf[_0x8841('0xb5')];_0x11d94c[_0x8841('0x2a')]+=_0xf747bf[_0x8841('0xb5')];logger[_0x8841('0x51')](_0x8841('0xb6'),_0xf747bf[_0x8841('0xa9')],_0x8841('0xaa'),_0x11d94c[_0x8841('0x25')],'pTalking:\x20',_0x11d94c[_0x8841('0x29')]);delete this['actions'][_0x4c49f5[_0x8841('0xa5')]];break;case _0x8841('0xb7'):_0x11d94c[_0x8841('0xb8')]+=0x1;_0xf747bf['countbusyretry']+=0x1;_0xf747bf[_0x8841('0x95')]=ut['totalGlobal'](_0xf747bf);ut[_0x8841('0x84')](_0xf747bf,0x5,_0x8841('0xb9'));ami[_0x8841('0x22')](_0x8841('0xba'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xbb')));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0xbc'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c['dialGlobalMaxRetry']){_0x2ae56e=ut['cloneAction'](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0xbd'));}else{if(_0xf747bf[_0x8841('0xbe')]>=_0x11d94c[_0x8841('0xbf')]){rpcDb[_0x8841('0x8c')](_0xf747bf,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8841('0xa0')](ut[_0x8841('0xa1')](_0xf747bf,'countbusyretry',_0x11d94c[_0x8841('0xc0')]),_0xf747bf[_0x8841('0xa3')],_0xf747bf[_0x8841('0xa4')]);}}break;case _0x8841('0xc1'):_0x11d94c[_0x8841('0x38')]+=0x1;_0xf747bf[_0x8841('0xc2')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut['logCustomer'](_0xf747bf,0x3,_0x8841('0xc3'));ami['emit'](_0x8841('0xc4'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xc5')));rpcDb['createCustomerHistory'](_0xf747bf,_0x8841('0xc6'));if(ut['totalGlobal'](_0xf747bf)>=_0x11d94c['dialGlobalMaxRetry']){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb['createCustomerFinal'](_0x2ae56e,_0x8841('0xc7'));}else{if(_0xf747bf[_0x8841('0xc2')]>=_0x11d94c['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0xf747bf,_0x8841('0xc6'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0xf747bf,_0x8841('0xc2'),_0x11d94c[_0x8841('0xc8')]),_0xf747bf['unlockAgent'],_0xf747bf[_0x8841('0xa4')]);}}break;case _0x8841('0xc9'):_0x11d94c['outboundCongestionCallsDay']+=0x1;_0xf747bf[_0x8841('0xca')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut['logCustomer'](_0xf747bf,0x8,_0x8841('0xcb'));ami[_0x8841('0x22')](_0x8841('0xcc'),ut[_0x8841('0x99')](_0xf747bf,'congestion'));rpcDb[_0x8841('0x8a')](_0xf747bf,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0xf747bf)>=_0x11d94c[_0x8841('0x9b')]){_0x2ae56e=ut['cloneAction'](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0xcd'));}else{if(_0xf747bf[_0x8841('0xca')]>=_0x11d94c[_0x8841('0xce')]){rpcDb[_0x8841('0x8c')](_0xf747bf,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x8841('0xa0')](ut[_0x8841('0xa1')](_0xf747bf,_0x8841('0xca'),_0x11d94c[_0x8841('0xc0')]),_0xf747bf[_0x8841('0xa3')],_0xf747bf['activeContact']);}}break;case'CANCEL':_0x11d94c[_0x8841('0x3a')]+=0x1;_0xf747bf[_0x8841('0xcf')]+=0x1;_0xf747bf['countglobal']=ut[_0x8841('0x96')](_0xf747bf);ut[_0x8841('0x84')](_0xf747bf,0x14,_0x8841('0xd0'));ami[_0x8841('0x22')](_0x8841('0xd1'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xd2')));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0xd3'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c['dialGlobalMaxRetry']){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0x14,_0x8841('0xd0'));rpcDb['createCustomerFinal'](_0x2ae56e,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0xf747bf[_0x8841('0xcf')]>=_0x11d94c[_0x8841('0xd4')]){rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0xd5'));}else{rpcDb[_0x8841('0xa0')](ut[_0x8841('0xa1')](_0xf747bf,'countagentrejectretry',_0x11d94c[_0x8841('0xd6')]),_0xf747bf[_0x8841('0xa3')],_0xf747bf['activeContact']);}}break;case _0x8841('0xd7'):_0x11d94c[_0x8841('0x3c')]+=0x1;_0xf747bf[_0x8841('0xd8')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut['totalGlobal'](_0xf747bf);ut['logCustomer'](_0xf747bf,0xb,_0x8841('0xd9'));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0xda'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c[_0x8841('0x9b')]){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0xda'));}else{if(_0xf747bf[_0x8841('0xdb')]>=_0x11d94c['dialAbandonedMaxRety']){rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0xda'));}else{rpcDb[_0x8841('0xa0')](ut[_0x8841('0xa1')](_0xf747bf,_0x8841('0xd8'),_0x11d94c[_0x8841('0xdc')]),_0xf747bf[_0x8841('0xa3')],_0xf747bf['activeContact']);}}break;case'18':_0x11d94c[_0x8841('0x3b')]+=0x1;_0xf747bf[_0x8841('0xdd')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut['logCustomer'](_0xf747bf,0x12,_0x4c49f5[_0x8841('0xde')]||_0x4c49f5[_0x8841('0xdf')]);ami[_0x8841('0x22')](_0x8841('0xe0'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xe1')));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0xe2'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c['dialGlobalMaxRetry']){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb['createCustomerFinal'](_0x2ae56e,_0x8841('0xe2'));}else{rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0xe2'));}delete this['actions'][_0x4c49f5[_0x8841('0xa5')]];break;case'19':_0x11d94c[_0x8841('0x3b')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut[_0x8841('0x84')](_0xf747bf,0x13,_0x4c49f5['cause-txt']||_0x4c49f5[_0x8841('0xdf')]);ami[_0x8841('0x22')](_0x8841('0xe0'),ut[_0x8841('0x99')](_0xf747bf,_0x8841('0xe1')));rpcDb[_0x8841('0x8a')](_0xf747bf,_0x8841('0xe3'));if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c['dialGlobalMaxRetry']){_0x2ae56e=ut[_0x8841('0x9c')](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0xe3'));}else{rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0xe3'));}delete this[_0x8841('0x14')][_0x4c49f5[_0x8841('0xa5')]];break;default:if(_0xf747bf['dialAnswer']){ut[_0x8841('0x73')](_0x11d94c,_0x8841('0xe4'));ut['loggerError'](_0x8841('0xe5')+_0x11d94c['name'],_0x4c49f5);}_0x11d94c[_0x8841('0x3b')]+=0x1;_0xf747bf[_0x8841('0x95')]=ut[_0x8841('0x96')](_0xf747bf);ut['logCustomer'](_0xf747bf,0xc,_0x4c49f5[_0x8841('0xde')]||_0x4c49f5['dialstatus']);rpcDb[_0x8841('0x8a')](_0xf747bf,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x8841('0x96')](_0xf747bf)>=_0x11d94c[_0x8841('0x9b')]){_0x2ae56e=ut['cloneAction'](_0xf747bf,0xf,_0x8841('0x9d'));rpcDb[_0x8841('0x8c')](_0x2ae56e,_0x8841('0xe6'));}else{rpcDb[_0x8841('0x8c')](_0xf747bf,_0x8841('0xe6'));}delete this[_0x8841('0x14')][_0x4c49f5[_0x8841('0xa5')]];}if(!(_0xf747bf[_0x8841('0x68')]&&_0x4ff965==='16')){ut[_0x8841('0x71')](_0x11d94c,'[callProgressDetectingCustomer]');logger['info'](_0x8841('0xe7'),_0xf747bf[_0x8841('0xa9')],'\x20Queue',_0x11d94c[_0x8841('0x25')],'originated:\x20',_0x11d94c[_0x8841('0x66')]);}if(_0x4ff965!==_0x8841('0xa6')){delete this[_0x8841('0x14')][_0x4c49f5[_0x8841('0xa5')]];delete this[_0x8841('0x14')][_0x4c49f5[_0x8841('0xe8')]];}}};Preview[_0x8841('0xd')][_0x8841('0xe9')]=function(_0xbfe861,_0x203456,_0x1c9ec8){if(_['isUndefined'](_0x203456)&&_0x8841('0xea')!==typeof _0x203456){return;}if(_[_0x8841('0xeb')](_0x1c9ec8)&&_0x8841('0xea')!==typeof _0x1c9ec8){return;}switch(_0x1c9ec8[_0x8841('0xec')]){case'0':ut[_0x8841('0xed')](_0xbfe861,0x0,_0x8841('0x97'));rpcDb['createAgentHistory'](_0xbfe861,_0x8841('0xee'));break;case'3':ut[_0x8841('0xed')](_0xbfe861,0x3,_0x8841('0xc3'));rpcDb[_0x8841('0xef')](_0xbfe861,_0x8841('0xf0'));break;case'5':ut['logAgent'](_0xbfe861,0x5,'Busy');rpcDb[_0x8841('0xef')](_0xbfe861,_0x8841('0xf1'));break;case'8':ut[_0x8841('0xed')](_0xbfe861,0x8,_0x8841('0xcb'));rpcDb['createAgentHistory'](_0xbfe861,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8841('0xed')](_0xbfe861,0x16,_0x8841('0xf2'));rpcDb[_0x8841('0xef')](_0xbfe861,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0xbfe861,0xc,_0x1c9ec8[_0x8841('0xec')]);rpcDb['createAgentHistory'](_0xbfe861,_0x8841('0xf3'));}ut[_0x8841('0x71')](_0x203456,_0x8841('0xf4'));logger['info'](_0x8841('0xf5'),_0xbfe861['uniqueid'],_0x8841('0xaa'),_0x203456[_0x8841('0x25')],_0x8841('0x65'),_0x203456[_0x8841('0x66')]);delete this[_0x8841('0x14')][_0xbfe861['uniqueid']];};Preview['prototype'][_0x8841('0xf6')]=function(_0x58a8f4,_0x4d232e,_0x1f0f5c,_0x5e832a,_0x25bba5){var _0x29b029=this;return new BPromise(function(_0x4507fa,_0x329444){if(_[_0x8841('0x61')](_0x4d232e)||_[_0x8841('0x61')](_0x4d232e[_0x8841('0xf7')])||_[_0x8841('0x61')](_0x4d232e[_0x8841('0xf7')][_0x8841('0xf8')])||_[_0x8841('0x61')](_0x4d232e[_0x8841('0x6c')])){_0x329444(ut[_0x8841('0x57')](_0x8841('0xf9'),_0x5e832a,_0x25bba5));return;}var _0x384aa0=uuid['v4']();var _0x558135=_0x29b029[_0x8841('0x11')][_0x4d232e[_0x8841('0x63')][_0x8841('0x25')]];var _0x4b2b4a=_0x1f0f5c?_0x29b029[_0x8841('0x15')][_0x1f0f5c]['id']:undefined;_0x29b029['actions'][_0x384aa0]=new Action(_0x4d232e,_0x558135,_0x384aa0,_0x1f0f5c,_0x4b2b4a);var _0x3a53f2=_0x29b029[_0x8841('0x14')][_0x384aa0];_0x3a53f2[_0x8841('0xa3')]=_0x5e832a;_0x3a53f2[_0x8841('0xa4')]=_0x25bba5;_0x3a53f2['lookAgent']=_0x1f0f5c;if(_['isEmpty'](_0x58a8f4)){_0x29b029[_0x8841('0xfa')](_0x3a53f2,_0x558135,_0x4d232e,_0x1f0f5c)[_0x8841('0x7a')](function(_0x41b19d){logger['info']('[Preview][execCall][success]',_0x8841('0xfb')+_0x3a53f2[_0x8841('0x64')]+_0x8841('0xfc')+_0x3a53f2[_0x8841('0xfd')],JSON[_0x8841('0x4e')](_0x41b19d));ami['emit'](_0x8841('0xfe'),ut[_0x8841('0x99')](_0x3a53f2,_0x8841('0xff'),_0x29b029[_0x8841('0x11')][_0x3a53f2[_0x8841('0x64')]]));_0x4507fa(ut[_0x8841('0x57')](_0x8841('0x100')));})[_0x8841('0x6f')](function(_0x2c4577){ut[_0x8841('0x59')](_0x8841('0x101'),_0x2c4577);_0x329444(ut[_0x8841('0x57')]('Call\x20failed',_0x5e832a,_0x25bba5));});}else{_0x558135[_0x8841('0x36')]+=0x1;ut[_0x8841('0x102')](_0x3a53f2);rpcDb[_0x8841('0x103')](_0x3a53f2,'[Blacklist][error]');delete _0x29b029[_0x8841('0x14')][_0x384aa0];_0x329444(ut[_0x8841('0x57')](_0x8841('0x104'),_0x5e832a,_0x25bba5));}});};Preview[_0x8841('0xd')][_0x8841('0x91')]=function(_0x227c1e){return!_[_0x8841('0x61')](_0x227c1e)&&!_[_0x8841('0x61')](_0x227c1e['name'])&&!_['isNil'](_0x227c1e[_0x8841('0x4b')])&&_0x227c1e[_0x8841('0x4b')]&&!_[_0x8841('0x61')](this[_0x8841('0x13')][util[_0x8841('0x4f')](_0x8841('0x105'),_0x227c1e['name'])])&&!_['isNil'](this[_0x8841('0x13')][util['format'](_0x8841('0x105'),_0x227c1e[_0x8841('0x25')])]['status'])&&(this[_0x8841('0x13')][util['format']('SIP/%s',_0x227c1e['name'])][_0x8841('0x106')]===_0x8841('0x107')||this['trunks'][util[_0x8841('0x4f')]('SIP/%s',_0x227c1e[_0x8841('0x25')])][_0x8841('0x106')]===_0x8841('0x108'));};Preview['prototype']['run']=function(_0x1efd27,_0x10402c){var _0x2e579e=this;return new BPromise(function(_0x4744d4,_0x190c60){_0x2e579e[_0x8841('0x109')](_0x1efd27,_0x10402c)[_0x8841('0x7a')](function(_0xbb486a){_0x4744d4(_[_0x8841('0x69')](_0xbb486a,[_0x8841('0x57')]));})[_0x8841('0x6f')](function(_0x522d3f){if(_0x522d3f[_0x8841('0x10a')]){rpcDb[_0x8841('0x10b')](_0x1efd27);}if(_0x522d3f[_0x8841('0x4b')]){rpcDb[_0x8841('0x81')](_0x1efd27);}_0x190c60(_[_0x8841('0x69')](_0x522d3f,[_0x8841('0x57')]));});});};Preview[_0x8841('0xd')]['execRun']=function(_0x4f5031,_0x1dc888){var _0x475eba=this;return new BPromise(function(_0x1441ac,_0x406ebe){var _0x389e7c,_0x136f50;rpcDb[_0x8841('0x10c')](_0x4f5031)[_0x8841('0x7a')](function(_0x3e89d8){if(!_[_0x8841('0x61')](_0x3e89d8[0x0])){_0x136f50=_0x3e89d8[0x0][_0x8841('0x10d')]?![]:!![];_0x389e7c=_0x3e89d8[0x0][_0x8841('0x10d')]?!![]:![];_0x389e7c=_0x1dc888?!![]:_0x389e7c;}var _0x8c0f22=_0x475eba[_0x8841('0x10e')](_0x3e89d8);if(_0x8c0f22[_0x8841('0x10f')]){rpcDb[_0x8841('0x110')](_[_0x8841('0x69')](_0x3e89d8[0x0],[_0x8841('0x6c'),_0x8841('0x111')]))[_0x8841('0x7a')](function(_0x3731b1){_0x475eba[_0x8841('0xf6')](_0x3731b1,_0x3e89d8[0x0],_0x1dc888,_0x136f50,_0x389e7c)[_0x8841('0x7a')](function(_0x5e56bf){_0x1441ac(_0x5e56bf);})[_0x8841('0x6f')](function(_0x441701){_0x406ebe(_0x441701);});})[_0x8841('0x6f')](function(_0x3cc379){ut[_0x8841('0x59')](_0x8841('0x112'),_0x3cc379);_0x406ebe(ut[_0x8841('0x57')](_0x8841('0x113'),_0x136f50,_0x389e7c));});}else{_0x406ebe(ut[_0x8841('0x57')](_0x8c0f22[_0x8841('0x57')],_0x136f50,_0x389e7c));}})[_0x8841('0x6f')](function(_0x4efc3f){ut[_0x8841('0x59')](_0x8841('0x114'),_0x4efc3f);_0x406ebe(ut[_0x8841('0x57')](_0x8841('0x113'),![],!![]));});});};Preview[_0x8841('0xd')][_0x8841('0x10e')]=function(_0xa4d22f){if(_[_0x8841('0x61')](_0xa4d22f)||_[_0x8841('0x115')](_0xa4d22f)||!_[_0x8841('0x61')](_0xa4d22f[0x0][_0x8841('0x116')])&&_[_0x8841('0x61')](_0xa4d22f[0x0][_0x8841('0x116')][_0x8841('0x25')])){ut[_0x8841('0x59')](_0x8841('0x117'),_0xa4d22f);return{'isValid':![],'message':_0x8841('0x118')};}var _0xb938de=this['campaignsPreview'][_0xa4d22f[0x0][_0x8841('0x63')][_0x8841('0x25')]];_0xb938de[_0x8841('0x57')]=_0x8841('0x93');if(_[_0x8841('0x61')](_0xb938de)){ut[_0x8841('0x59')](_0x8841('0x119'),_0xb938de);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0xb938de[_0x8841('0x4a')])){ut[_0x8841('0x59')](_0x8841('0x11a'),_0x8841('0x11b')+_0xb938de[_0x8841('0x25')]+_0x8841('0x11c'));if(!this[_0x8841('0x91')](_0xb938de[_0x8841('0x92')])){ut[_0x8841('0x59')](_0x8841('0x11a'),_0xb938de[_0x8841('0x25')]+_0x8841('0x11d'));return{'isValid':![],'message':_0x8841('0x11e')};}}if(!ut[_0x8841('0x11f')](_0xb938de[_0x8841('0x2f')])){ut[_0x8841('0x59')](_0x8841('0x120'),_0xb938de[_0x8841('0x25')]+_0x8841('0x121'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xb938de[_0x8841('0x25')]+_0x8841('0x121')};}return{'isValid':!![],'message':_0x8841('0x122')};};Preview['prototype'][_0x8841('0xfa')]=function(_0x344b67,_0x5cca7a,_0x54dbcd,_0x4c1d66){var _0x28fa6a=this;return new BPromise(function(_0x5b5c34,_0x5dae7e){var _0x339f03=_0x344b67[_0x8841('0xa9')];var _0x2a43cc=_0x28fa6a[_0x8841('0x91')](_0x5cca7a['Trunk'])?util[_0x8841('0x4f')](_0x8841('0x123'),_0x5cca7a['Trunk'][_0x8841('0x25')],_['isNil'](_0x5cca7a[_0x8841('0x34')])?'':_0x5cca7a[_0x8841('0x34')][_0x8841('0x124')]()||'',_0x5cca7a[_0x8841('0x125')]>0x0?_0x54dbcd['Contact'][_0x8841('0xf8')]['substring'](_0x5cca7a[_0x8841('0x125')]):_0x54dbcd[_0x8841('0xf7')][_0x8841('0xf8')]):util[_0x8841('0x4f')](_0x8841('0x123'),_[_0x8841('0x61')](_0x5cca7a[_0x8841('0x92')])?_0x5cca7a['Trunk'][_0x8841('0x25')]:_0x5cca7a['TrunkBackup'][_0x8841('0x25')],_[_0x8841('0x61')](_0x5cca7a[_0x8841('0x34')])?'':_0x5cca7a['dialPrefix'][_0x8841('0x124')]()||'',_0x5cca7a['dialCutDigit']>0x0?_0x54dbcd[_0x8841('0xf7')]['phone'][_0x8841('0x126')](_0x5cca7a['dialCutDigit']):_0x54dbcd[_0x8841('0xf7')][_0x8841('0xf8')]);var _0x50ea3f=_0x28fa6a[_0x8841('0x91')](_0x5cca7a[_0x8841('0x4a')])?ut[_0x8841('0x127')](_0x5cca7a[_0x8841('0x4a')][_0x8841('0x4c')],_0x5cca7a[_0x8841('0x31')],_0x5cca7a[_0x8841('0x128')]>0x0?ut[_0x8841('0x129')](_0x5cca7a[_0x8841('0x32')],_0x5cca7a['dialRandomLastDigitCallerIdNumber']):_0x5cca7a[_0x8841('0x32')]):ut['getCallerId'](_[_0x8841('0x61')](_0x5cca7a['TrunkBackup'])?_0x5cca7a[_0x8841('0x4a')][_0x8841('0x4c')]:_0x5cca7a[_0x8841('0x92')][_0x8841('0x4c')],_0x5cca7a[_0x8841('0x31')],_0x5cca7a[_0x8841('0x128')]>0x0?ut[_0x8841('0x129')](_0x5cca7a[_0x8841('0x32')],_0x5cca7a[_0x8841('0x128')]):_0x5cca7a[_0x8841('0x32')]);if(_0x50ea3f){_0x344b67[_0x8841('0x12a')]=ut['extractCalleridName'](_0x50ea3f);_0x344b67[_0x8841('0x12b')]=ut['extractCalleridNumber'](_0x50ea3f);}var _0x304672=ut[_0x8841('0x12c')](_0x5cca7a,_0x54dbcd,_0x2a43cc,_0x50ea3f,_0x339f03,_0x344b67);_[_0x8841('0x12d')](_0x344b67,ut[_0x8841('0x12e')](_0x304672));_0x344b67[_0x8841('0x82')]=moment()[_0x8841('0x4f')](_0x8841('0x83'));ami['Action'](ut[_0x8841('0x12f')](_0x344b67,_0x5cca7a,_0x304672,_0x344b67['activeContact'],_0x4c1d66))['then'](function(_0x1796ae){var _0x1719ed=_0x344b67[_0x8841('0x130')];if(!_[_0x8841('0x61')](_0x1719ed)){if(!_[_0x8841('0x61')](_0x28fa6a[_0x8841('0x15')][_0x1719ed])){_0x28fa6a['agents'][_0x1719ed][_0x8841('0x131')]=_0x344b67[_0x8841('0x132')];emit(util['format'](_0x8841('0x133'),_0x28fa6a[_0x8841('0x15')][_0x1719ed][_0x8841('0x25')]),'user:agentconnect',{'destaccountcode':_0x28fa6a[_0x8841('0x15')][_0x1719ed][_0x8841('0x134')],'destconnectedlinenum':_0x344b67[_0x8841('0x132')]});}}_0x5cca7a[_0x8841('0x66')]+=0x1;logger[_0x8841('0x51')](_0x8841('0x135'),_0x339f03,_0x8841('0xaa'),_0x5cca7a[_0x8841('0x25')],_0x8841('0x65'),_0x5cca7a[_0x8841('0x66')]);_0x5b5c34(_0x1796ae);})[_0x8841('0x6f')](function(_0x532dee){ut['logAgent'](_0x344b67,0xe,_0x8841('0x136'));rpcDb['createAgentHistory'](_0x344b67,_0x8841('0x137'));_0x5dae7e(_0x532dee);});});};Preview[_0x8841('0xd')][_0x8841('0x1e')]=function(_0x5c1281){if(this[_0x8841('0x14')][_0x5c1281[_0x8841('0xa5')]]){this['actions'][_0x5c1281[_0x8841('0xa5')]]['channel']=_0x5c1281['channel'];}};Preview[_0x8841('0xd')]['syncOriginateResponse']=function(_0x35f2e4){var _0x47f67c=this;var _0x4a067b=this[_0x8841('0x14')][_0x35f2e4[_0x8841('0x138')]];if(_0x4a067b){if(_0x4a067b['lookAgent']&&this['agents'][_0x4a067b[_0x8841('0x139')]]){ut[_0x8841('0x13a')](_0x4a067b,this['agents'][_0x4a067b['lookAgent']][_0x8841('0x25')],this[_0x8841('0x15')][_0x4a067b[_0x8841('0x139')]]['id']);}var _0x2d5f77=_['clone'](_0x4a067b);_0x2d5f77[_0x8841('0x13b')]=moment()['format'](_0x8841('0x83'));var _0x48543f=_0x47f67c[_0x8841('0x11')][_0x4a067b['queue']];if(ut['isFailure'](_0x35f2e4['response'])){if(_0x4a067b[_0x8841('0xa3')]){rpcDb[_0x8841('0x10b')](_0x4a067b[_0x8841('0xfd')]);}if(_0x4a067b['activeContact']){rpcDb[_0x8841('0x81')](_0x4a067b[_0x8841('0xfd')]);}ami['emit'](_0x8841('0x13c'),ut[_0x8841('0x99')](_0x4a067b,_0x8841('0x13d'),this[_0x8841('0x11')][_0x4a067b[_0x8841('0x64')]]));this[_0x8841('0xe9')](_0x2d5f77,_0x48543f,_0x35f2e4);}else{_0x4a067b[_0x8841('0x82')]=moment()[_0x8841('0x4f')](_0x8841('0x83'));ut[_0x8841('0xed')](_0x2d5f77,0x4,_0x8841('0xb2'));rpcDb['createAgentHistory'](_0x2d5f77,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x8841('0xd')][_0x8841('0x13e')]=function(_0xe41bcd){var _0x53658e=this;var _0x1cf243=this[_0x8841('0x14')][_0xe41bcd['linkedid']];var _0x22c62a;if(_0x1cf243){_0x22c62a=this[_0x8841('0x11')][_0x1cf243[_0x8841('0x64')]];logger[_0x8841('0x51')](_0x8841('0x13f'),_0xe41bcd[_0x8841('0xa5')],_0x8841('0xaa'),_0x22c62a['name'],'pTalking:\x20',_0x22c62a[_0x8841('0x29')]);}if(this[_0x8841('0x14')][_0xe41bcd[_0x8841('0xa5')]]&&_0xe41bcd[_0x8841('0xa5')]!==_0xe41bcd['uniqueid']){if(_0xe41bcd[_0x8841('0x140')]==='16'&&this[_0x8841('0x14')][_0xe41bcd[_0x8841('0xa5')]][_0x8841('0x68')]){this[_0x8841('0x141')](_0xe41bcd,_0xe41bcd[_0x8841('0xa5')],_0xe41bcd[_0x8841('0x140')]);}else if(this['actions'][_0xe41bcd[_0x8841('0xa5')]][_0x8841('0x68')]){logger[_0x8841('0x51')](_0x8841('0x142'),_0xe41bcd[_0x8841('0xa5')],_0xe41bcd[_0x8841('0x140')],_0x8841('0xaa'),_0x22c62a['name'],'pTalking:\x20',_0x22c62a['pTalking']);this[_0x8841('0x141')](_0xe41bcd,_0xe41bcd[_0x8841('0xa5')],_0xe41bcd[_0x8841('0x140')]);}}else if(_0x1cf243&&_[_0x8841('0x61')](_0x1cf243[_0x8841('0x143')])&&_0x22c62a[_0x8841('0x144')]&&_0xe41bcd['linkedid']===_0xe41bcd[_0x8841('0xa9')]&&_[_0x8841('0x61')](_0xe41bcd[_0x8841('0xec')])&&_0xe41bcd['cause']==='16'&&_0xe41bcd[_0x8841('0x145')]==='6'&&_[_0x8841('0xeb')](_0x1cf243[_0x8841('0x146')])){if(_0x1cf243[_0x8841('0xa3')]){rpcDb[_0x8841('0x10b')](_0x1cf243['idContact']);}if(_0x1cf243[_0x8841('0xa4')]){rpcDb['disableContact'](_0x1cf243[_0x8841('0xfd')]);}_0xe41bcd[_0x8841('0xec')]='22';this['callProgressDetectingAgent'](_0x1cf243,_0x22c62a,_0xe41bcd);}else if(_0x1cf243&&_0x1cf243[_0x8841('0x146')]){if(_0xe41bcd['cause']==='16'&&this[_0x8841('0x14')][_0xe41bcd[_0x8841('0xa5')]]['dialAnswer']){logger['info'](_0x8841('0x147'),_0xe41bcd[_0x8841('0xa5')],_0xe41bcd[_0x8841('0x140')],_0x8841('0xaa'),_0x22c62a[_0x8841('0x25')],_0x8841('0x67'),_0x22c62a[_0x8841('0x29')]);this['callProgressDetectingCustomer'](_0xe41bcd,_0xe41bcd[_0x8841('0xa5')],_0xe41bcd[_0x8841('0x140')]);}else if(this['actions'][_0xe41bcd[_0x8841('0xa5')]][_0x8841('0x68')]){logger[_0x8841('0x51')]('[syncHangup][talking][cause]',_0xe41bcd['linkedid'],_0xe41bcd[_0x8841('0x140')],'\x20Queue',_0x22c62a[_0x8841('0x25')],_0x8841('0x67'),_0x22c62a['pTalking']);this[_0x8841('0x141')](_0xe41bcd,_0xe41bcd[_0x8841('0xa5')],_0xe41bcd['cause']);}}};Preview[_0x8841('0xd')][_0x8841('0x148')]=function(_0x388ad9){if(this[_0x8841('0x14')][_0x388ad9[_0x8841('0xe8')]]&&_0x388ad9[_0x8841('0xe8')]!==_0x388ad9[_0x8841('0x149')]){this[_0x8841('0x141')](_0x388ad9,_0x388ad9[_0x8841('0xe8')],_0x388ad9[_0x8841('0xdf')]);}};Preview[_0x8841('0xd')]['syncHangupRequest']=function(_0x4cb6c8){if(this[_0x8841('0x14')][_0x4cb6c8[_0x8841('0xa5')]]&&_0x4cb6c8['linkedid']!==_0x4cb6c8['uniqueid']&&!this[_0x8841('0x14')][_0x4cb6c8[_0x8841('0xa5')]][_0x8841('0x68')]){if(_0x4cb6c8[_0x8841('0x140')]==='1'){this['callProgressDetectingCustomer'](_0x4cb6c8,_0x4cb6c8['linkedid'],_0x4cb6c8['cause']);}}};Preview['prototype']['addVariable']=function(_0x49bbad,_0xf12c9f,_0xd4c76){if(this[_0x8841('0x14')][_0x49bbad]){if(_[_0x8841('0x61')](this[_0x8841('0x14')][_0x49bbad][_0x8841('0x14a')])){this['actions'][_0x49bbad]['variables']={};}this[_0x8841('0x14')][_0x49bbad][_0x8841('0x14a')][_0xf12c9f]=_0xd4c76;}};Preview[_0x8841('0xd')][_0x8841('0x14b')]=function(_0x40d101){try{if(!_[_0x8841('0x61')](_0x40d101)){if(ut['filterKey'](_[_0x8841('0x14c')](_0x40d101[_0x8841('0x14d')])[0x0])){this[_0x8841('0x14e')](_0x40d101[_0x8841('0xa9')],_['keys'](_0x40d101['variable'])[0x0],_0x40d101[_0x8841('0x14f')]);}}}catch(_0x14ff11){logger[_0x8841('0x150')](_0x8841('0x151'),util[_0x8841('0x152')](_0x14ff11,{'showHidden':![],'depth':null}));}};Preview[_0x8841('0xd')][_0x8841('0x153')]=function(_0x20e3e2){if(_0x20e3e2){if(this[_0x8841('0x14')][_0x20e3e2['transfertargetlinkedid']]){this[_0x8841('0x14')][_0x20e3e2['transfertargetlinkedid']][_0x8841('0x146')]=!![];}}};Preview['prototype'][_0x8841('0x154')]=function(_0x421706){if(_0x421706){if(this[_0x8841('0x14')][_0x421706[_0x8841('0x155')]]){this[_0x8841('0x14')][_0x421706[_0x8841('0x155')]][_0x8841('0x146')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x9663=['status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','[RecallMe]','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','setMessage','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','buildAcw','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','countbusyretry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','congestion','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','linkedid','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','Contact\x20in\x20black\x20List','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','then','recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','channelAgent','destconnectedlinenum','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','disableContact','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','keys','variable','value','error','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','type','outbound','name','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','hasOwnProperty','booked','clockClearZombieChannels','recallMe','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action'];(function(_0x27c3ae,_0x47951a){var _0x4e4655=function(_0x458cf0){while(--_0x458cf0){_0x27c3ae['push'](_0x27c3ae['shift']());}};_0x4e4655(++_0x47951a);}(_0x9663,0xe3));var _0x3966=function(_0x124c52,_0x428710){_0x124c52=_0x124c52-0x0;var _0x227840=_0x9663[_0x124c52];return _0x227840;};'use strict';var util=require(_0x3966('0x0'));var _=require(_0x3966('0x1'));var BPromise=require(_0x3966('0x2'));var uuid=require(_0x3966('0x3'));var moment=require(_0x3966('0x4'));var md5=require(_0x3966('0x5'));var Redis=require(_0x3966('0x6'));var config=require(_0x3966('0x7'));var logger=require(_0x3966('0x8'))(_0x3966('0x9'));var loggerAction=require('../../../config/logger')(_0x3966('0xa'));var ami=require(_0x3966('0xb'));var rpcDb=require(_0x3966('0xc'));var Action=require(_0x3966('0xd'));var ut=require(_0x3966('0xe'));config[_0x3966('0xf')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3966('0x10'))(new Redis(config[_0x3966('0xf')]));var Sequence=function(){};Sequence[_0x3966('0x11')][_0x3966('0x12')]=function(_0x463abd){this['tail']=this[_0x3966('0x13')]?this[_0x3966('0x13')]['finally'](_0x463abd):_0x463abd();};function Preview(_0x121bf6){this[_0x3966('0x14')]=new Sequence();this[_0x3966('0x15')]=_0x121bf6[_0x3966('0x16')];this['trunks']=_0x121bf6['trunks'];this[_0x3966('0x17')]={};this[_0x3966('0x18')]=_0x121bf6['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x3966('0x19'),this[_0x3966('0x1a')][_0x3966('0x1b')](this));ami['on'](_0x3966('0x1c'),this[_0x3966('0x1d')][_0x3966('0x1b')](this));ami['on'](_0x3966('0x1e'),this['syncHangupRequest'][_0x3966('0x1b')](this));ami['on'](_0x3966('0x1f'),this[_0x3966('0x20')][_0x3966('0x1b')](this));ami['on'](_0x3966('0x21'),this['syncNewExten']['bind'](this));ami['on'](_0x3966('0x22'),this[_0x3966('0x23')][_0x3966('0x1b')](this));ami['on'](_0x3966('0x24'),this[_0x3966('0x25')]['bind'](this));ami['on'](_0x3966('0x26'),this[_0x3966('0x27')][_0x3966('0x1b')](this));this['loopCampaigns'](this[_0x3966('0x15')]);}function emit(_0x49b876,_0x6eae5f,_0x6a71bb){io['to'](_0x49b876)['emit'](_0x6eae5f,_0x6a71bb);}function emitCampaignPreview(_0xe80b6b){if(_0xe80b6b[_0x3966('0x28')]===_0x3966('0x29')){var _0x40bce9={'id':_0xe80b6b['id'],'name':_0xe80b6b[_0x3966('0x2a')],'strategy':_0xe80b6b[_0x3966('0x2b')],'answered':_0xe80b6b[_0x3966('0x2c')],'available':_0xe80b6b['available'],'loggedIn':_0xe80b6b['loggedIn'],'pTalking':_0xe80b6b[_0x3966('0x2d')],'sumBillable':_0xe80b6b[_0x3966('0x2e')],'sumDuration':_0xe80b6b['sumDuration'],'sumHoldTime':_0xe80b6b[_0x3966('0x2f')]||0x0,'talking':_0xe80b6b[_0x3966('0x30')],'total':_0xe80b6b['total'],'type':_0xe80b6b[_0x3966('0x28')],'unmanaged':_0xe80b6b['unmanaged'],'abandoned':_0xe80b6b[_0x3966('0x31')],'waiting':_0xe80b6b['waiting'],'loggedInDb':_0xe80b6b[_0x3966('0x32')],'dialActive':_0xe80b6b[_0x3966('0x33')],'dialMethod':_0xe80b6b[_0x3966('0x34')],'dialOriginateCallerIdName':_0xe80b6b[_0x3966('0x35')],'dialOriginateCallerIdNumber':_0xe80b6b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xe80b6b[_0x3966('0x36')],'dialPrefix':_0xe80b6b[_0x3966('0x37')],'outboundAnswerAgiCallsDay':_0xe80b6b[_0x3966('0x38')],'outboundAnswerCallsDay':_0xe80b6b[_0x3966('0x39')],'outboundBlacklistCallsDay':_0xe80b6b[_0x3966('0x3a')],'outboundBusyCallsDay':_0xe80b6b[_0x3966('0x3b')],'outboundCongestionCallsDay':_0xe80b6b[_0x3966('0x3c')],'outboundDropCallsDayACS':_0xe80b6b[_0x3966('0x3d')],'outboundDropCallsDayCallersExit':_0xe80b6b[_0x3966('0x3e')],'outboundDropCallsDayTimeout':_0xe80b6b[_0x3966('0x3f')],'outboundNoAnswerCallsDay':_0xe80b6b['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xe80b6b[_0x3966('0x40')],'outboundOriginateFailureCallsDay':_0xe80b6b[_0x3966('0x41')],'outboundReCallsDay':_0xe80b6b['outboundReCallsDay'],'outboundRejectCallsDay':_0xe80b6b[_0x3966('0x42')],'outboundUnknownCallsDay':_0xe80b6b[_0x3966('0x43')],'outboundAbandonedCallsDay':_0xe80b6b[_0x3966('0x44')],'predictiveIntervalAnsweredCalls':_0xe80b6b['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xe80b6b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xe80b6b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xe80b6b['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xe80b6b[_0x3966('0x45')],'predictiveIntervalErlangCalls':_0xe80b6b[_0x3966('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0xe80b6b[_0x3966('0x47')],'predictiveIntervalHitRate':_0xe80b6b[_0x3966('0x48')],'predictiveIntervalMultiplicativeFactor':_0xe80b6b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xe80b6b[_0x3966('0x49')],'predictiveIntervalAvailable':_0xe80b6b[_0x3966('0x4a')],'predictiveIntervalTotalCalls':_0xe80b6b[_0x3966('0x4b')],'message':_0xe80b6b[_0x3966('0x4c')],'originated':_0xe80b6b[_0x3966('0x4d')],'erlangCalls':_0xe80b6b[_0x3966('0x4e')],'erlangCallToSecond':_0xe80b6b[_0x3966('0x4f')],'erlangAbandonmentRate':_0xe80b6b[_0x3966('0x50')],'erlangBusyFactor':_0xe80b6b[_0x3966('0x51')],'startPredictive':_0xe80b6b[_0x3966('0x52')],'startProgressive':_0xe80b6b[_0x3966('0x53')]};if(_0xe80b6b['Trunk']){_0x40bce9['Trunk']={'id':_0xe80b6b[_0x3966('0x54')]['id'],'name':_0xe80b6b[_0x3966('0x54')][_0x3966('0x2a')],'active':_0xe80b6b[_0x3966('0x54')][_0x3966('0x55')],'callerid':_0xe80b6b[_0x3966('0x54')]['callerid']};}if(_0xe80b6b['Interval']){_0x40bce9[_0x3966('0x56')]={'id':_0xe80b6b[_0x3966('0x56')]['id'],'name':_0xe80b6b[_0x3966('0x56')]['name']};}var _0x14bf8a=md5(JSON[_0x3966('0x57')](_0x40bce9));if(_0xe80b6b[_0x3966('0x5')]!==_0x14bf8a){_0xe80b6b['md5']=_0x14bf8a;emit(util[_0x3966('0x58')](_0x3966('0x59'),_0x40bce9[_0x3966('0x2a')]),_0x3966('0x5a'),_0x40bce9);}}}function emitVoiceQueueChannelRemove(_0x229642){logger[_0x3966('0x5b')](_0x3966('0x5c'),JSON['stringify'](_0x229642));emit(util[_0x3966('0x58')](_0x3966('0x59'),_0x229642[_0x3966('0x2a')]),_0x3966('0x5d'),_0x229642);io[_0x3966('0x5e')](_0x3966('0x5f'),_0x229642);}function notSendMessagesQueue(_0xd34c3a){if(_0xd34c3a['sendMessageOneNotActive']){if(_0xd34c3a[_0x3966('0x4d')]===0x0&&_0xd34c3a['pTalking']===0x0){_0xd34c3a[_0x3966('0x60')]=![];_0xd34c3a[_0x3966('0x61')]=0x0;_0xd34c3a[_0x3966('0x62')]=0x0;_0xd34c3a[_0x3966('0x4c')]=_0x3966('0x63');ut[_0x3966('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xd34c3a[_0x3966('0x2a')]+_0x3966('0x65'));}else{_0xd34c3a['message']=_0x3966('0x66');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xd34c3a[_0x3966('0x2a')]+_0x3966('0x67'));}emitCampaignPreview(_0xd34c3a);}}Preview[_0x3966('0x11')][_0x3966('0x68')]=function(){var _0x2ef8e2=this;setInterval(function(){_0x2ef8e2['syncCampaigns']();},0x7cf);};Preview[_0x3966('0x11')]['syncCampaigns']=function(){var _0x4e68fe=this[_0x3966('0x15')];this['clockClearZombieChannels']+=0x1;for(var _0x4a1010 in _0x4e68fe){if(_0x4e68fe[_0x3966('0x69')](_0x4a1010)&&(_0x4e68fe[_0x4a1010][_0x3966('0x34')]==='preview'||_0x4e68fe[_0x4a1010][_0x3966('0x34')]===_0x3966('0x6a'))&&_0x4e68fe[_0x4a1010][_0x3966('0x28')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x3966('0x6b')]=0x0;this['clearZombieChannels']();}}if(_0x4e68fe[_0x3966('0x69')](_0x4a1010)&&_0x4e68fe[_0x4a1010][_0x3966('0x34')]===_0x3966('0x9')&&_0x4e68fe[_0x4a1010][_0x3966('0x28')]===_0x3966('0x29')){if(_0x4e68fe[_0x4a1010][_0x3966('0x33')]){this['setMessage'](_0x4e68fe[_0x4a1010]);this[_0x3966('0x6c')](_0x4e68fe[_0x4a1010]);}else{notSendMessagesQueue(_0x4e68fe[_0x4a1010]);}}}};Preview[_0x3966('0x11')]['clearZombieChannel']=function(_0x4de10a){var _0x4d4028=this;this[_0x3966('0x14')][_0x3966('0x12')](function(){if(!_[_0x3966('0x6d')](_0x4d4028[_0x3966('0x17')][_0x4de10a])){loggerAction[_0x3966('0x5b')]('[clearZombieChannels][talking]',_0x4de10a,_0x3966('0x6e'),_0x4d4028['actions'][_0x4de10a][_0x3966('0x6f')],_0x3966('0x70'),JSON[_0x3966('0x57')](_0x4d4028['campaignsPreview'][_0x4d4028[_0x3966('0x17')][_0x4de10a][_0x3966('0x6f')]]['originated']),_0x3966('0x71'),JSON[_0x3966('0x57')](_0x4d4028[_0x3966('0x15')][_0x4d4028[_0x3966('0x17')][_0x4de10a][_0x3966('0x6f')]][_0x3966('0x2d')]),JSON[_0x3966('0x57')](_0x4d4028['actions'][_0x4de10a][_0x3966('0x72')]),JSON[_0x3966('0x57')](_[_0x3966('0x73')](_0x4d4028['actions'][_0x4de10a],[_0x3966('0x74'),'UserId',_0x3966('0x75'),_0x3966('0x76')])));return ami[_0x3966('0x77')]({'action':_0x3966('0x78'),'channel':_0x4d4028[_0x3966('0x17')][_0x4de10a][_0x3966('0x79')]})[_0x3966('0x7a')](function(_0x2ccaeb){if(_0x2ccaeb[_0x3966('0x4c')]===_0x3966('0x7b')){setTimeout(function(){if(_0x4d4028[_0x3966('0x17')][_0x4de10a]){ut[_0x3966('0x7c')](_0x4d4028[_0x3966('0x15')][_0x4d4028[_0x3966('0x17')][_0x4de10a][_0x3966('0x6f')]],'[clearZombieChannel]');if(_0x4d4028['actions'][_0x4de10a][_0x3966('0x72')]===!![]){ut['decrementTalkink'](_0x4d4028[_0x3966('0x15')][_0x4d4028[_0x3966('0x17')][_0x4de10a]['queue']],_0x3966('0x7d'));ut[_0x3966('0x7e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4de10a,_0x4d4028['actions'][_0x4de10a][_0x3966('0x6f')]);}ut[_0x3966('0x7e')](_0x3966('0x7f')+_0x4de10a,_0x4d4028[_0x3966('0x17')][_0x4de10a][_0x3966('0x6f')]);delete _0x4d4028[_0x3966('0x17')][_0x4de10a];}},0x2328);}});}});};Preview[_0x3966('0x11')][_0x3966('0x80')]=function(){var _0x2f6e3a=this;loggerAction['info'](_0x3966('0x81'),_[_0x3966('0x82')](this[_0x3966('0x17')]));for(var _0x591cd3 in this[_0x3966('0x17')]){if(_0x2f6e3a[_0x3966('0x17')][_0x3966('0x69')](_0x591cd3)){_0x2f6e3a[_0x3966('0x83')](_0x591cd3);}}};Preview[_0x3966('0x11')][_0x3966('0x6c')]=function(_0x2c2260){var _0x247cd1=this;rpcDb[_0x3966('0x84')](_0x2c2260['id'],ut[_0x3966('0x85')](this[_0x3966('0x18')]))['then'](function(_0x4fcff2){if(!_[_0x3966('0x6d')](_0x4fcff2)){for(var _0x1a898c=0x0;_0x1a898c<_0x4fcff2[_0x3966('0x86')];_0x1a898c+=0x1){if(ut[_0x3966('0x87')](_0x4fcff2[_0x1a898c][_0x3966('0x88')])<_0x2c2260[_0x3966('0x89')]*0x3c){if(_0x4fcff2[_0x1a898c][_0x3966('0x8a')]&&!_0x4fcff2[_0x1a898c][_0x3966('0x8a')]['voicePause']){_0x247cd1[_0x3966('0x8b')](_0x4fcff2[_0x1a898c]['id'])['then'](ut['logger2'](_0x3966('0x8c')))[_0x3966('0x7a')](ut[_0x3966('0x8d')](_0x3966('0x8c')));}else{rpcDb['disableContact'](_0x4fcff2[_0x1a898c]['id']);}}else{var _0x139268=new Action(_0x4fcff2[_0x1a898c],_0x2c2260);_0x139268[_0x3966('0x8e')]=moment()['format'](_0x3966('0x8f'));_0x2c2260[_0x3966('0x90')]+=0x1;ut[_0x3966('0x91')](_0x139268,0x17,_0x3966('0x92'));if(_0x2c2260[_0x3966('0x93')]){rpcDb[_0x3966('0x94')](ut[_0x3966('0x95')](_0x4fcff2[_0x1a898c]));rpcDb[_0x3966('0x96')](_0x139268,_0x3966('0x97'));}else{ut[_0x3966('0x91')](_0x139268,0x16,_0x3966('0x98'));rpcDb[_0x3966('0x96')](_0x139268,_0x3966('0x99'));rpcDb[_0x3966('0x9a')](_0x139268,_0x3966('0x99'));}}}}})[_0x3966('0x7a')](ut[_0x3966('0x8d')]('[getContactRecallMe]'));};Preview[_0x3966('0x11')][_0x3966('0x9b')]=function(_0x261662){_0x261662[_0x3966('0x60')]=!![];if(ut['IsNotLoggedIn'](_0x261662['loggedIn'])){_0x261662['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x3966('0x9c')](_0x261662['dialActive'])){_0x261662[_0x3966('0x4c')]=_0x3966('0x63');}else if(!this[_0x3966('0x9d')](_0x261662['Trunk'])){if(!this[_0x3966('0x9d')](_0x261662[_0x3966('0x9e')])){_0x261662[_0x3966('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x261662[_0x3966('0x4c')]=_0x3966('0x9f');}}else{_0x261662['message']='ACTIVE';}emitCampaignPreview(_0x261662);};Preview[_0x3966('0x11')][_0x3966('0xa0')]=function(_0x437961,_0xd70d4a,_0x20bc5f){var _0x4017df=this;var _0x239304=this[_0x3966('0x17')][_0xd70d4a];var _0x4f7f74=this[_0x3966('0x15')][_0x239304[_0x3966('0x6f')]];var _0x4c98b0;if(_0x4f7f74){switch(_0x20bc5f){case'1':_0x4f7f74['outboundNoSuchCallsDay']+=0x1;_0x239304[_0x3966('0xa1')]+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut['logCustomer'](_0x239304,0x0,_0x3966('0xa4'));ami[_0x3966('0x5e')]('custom:agentnosuchnumber',ut[_0x3966('0xa5')](_0x239304,_0x3966('0xa6')));rpcDb['createCustomerHistory'](_0x239304,_0x3966('0xa7'));if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74['dialGlobalMaxRetry']){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb[_0x3966('0x9a')](_0x4c98b0,_0x3966('0xaa'));}else{if(_0x239304['countnosuchnumberretry']>=_0x4f7f74[_0x3966('0xab')]){rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xaa'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x239304,'countnosuchnumberretry',_0x4f7f74[_0x3966('0xac')]),_0x239304[_0x3966('0xad')],_0x239304[_0x3966('0xae')]);}}delete this[_0x3966('0x17')][_0x437961['linkedid']];break;case _0x3966('0xaf'):var _0x1da729=moment()[_0x3966('0x58')](_0x3966('0x8f'));_0x239304[_0x3966('0xb0')]=_0x1da729;_0x239304[_0x3966('0xb1')]=_0x1da729;_0x239304['dialAnswer']=!![];_0x4f7f74[_0x3966('0x2d')]+=0x1;logger['info'](_0x3966('0xb2'),_0x239304[_0x3966('0xb3')],_0x3966('0xb4'),_0x4f7f74[_0x3966('0x2a')],_0x3966('0x71'),_0x4f7f74[_0x3966('0x2d')]);ami['emit'](_0x3966('0xb5'),ut['buildObj'](_0x239304,_0x3966('0xb6'),this[_0x3966('0x15')][_0x239304[_0x3966('0x6f')]]));if(_0x4f7f74[_0x3966('0xb7')]){ami['emit']('custom:agentConnectPreview',ut[_0x3966('0xb8')](_0x239304));}break;case'16':ami[_0x3966('0x5e')]('custom:agentcomplete',ut[_0x3966('0xa5')](_0x239304,_0x3966('0xb9'),this[_0x3966('0x15')][_0x239304[_0x3966('0x6f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x239304,_0x3966('0xb9')));_0x4f7f74['outboundAnswerCallsDay']+=0x1;_0x4f7f74[_0x3966('0xba')]+=0x1;_0x4f7f74[_0x3966('0x2c')]+=0x1;ut['decrementTalkink'](_0x4f7f74,_0x3966('0xbb'));_0x239304['countglobal']=ut[_0x3966('0xa3')](_0x239304);ut[_0x3966('0x91')](_0x239304,0x4,_0x3966('0xbc'));rpcDb[_0x3966('0x96')](_0x239304,_0x3966('0xbd'));rpcDb['createCustomerFinal'](_0x239304,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x239304);_0x4f7f74[_0x3966('0xbe')]+=_0x239304[_0x3966('0xbf')];_0x4f7f74['sumBillable']+=_0x239304[_0x3966('0xbf')];logger[_0x3966('0x5b')](_0x3966('0xc0'),_0x239304['uniqueid'],_0x3966('0xb4'),_0x4f7f74['name'],_0x3966('0x71'),_0x4f7f74[_0x3966('0x2d')]);delete this[_0x3966('0x17')][_0x437961['linkedid']];break;case _0x3966('0xc1'):_0x4f7f74[_0x3966('0x3b')]+=0x1;_0x239304['countbusyretry']+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut[_0x3966('0x91')](_0x239304,0x5,'Busy');ami[_0x3966('0x5e')](_0x3966('0xc2'),ut[_0x3966('0xa5')](_0x239304,_0x3966('0xc3')));rpcDb[_0x3966('0x96')](_0x239304,_0x3966('0xc4'));if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74['dialGlobalMaxRetry']){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb['createCustomerFinal'](_0x4c98b0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x239304[_0x3966('0xc5')]>=_0x4f7f74['dialBusyMaxRetry']){rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xc4'));}else{rpcDb[_0x3966('0xc6')](ut[_0x3966('0xc7')](_0x239304,_0x3966('0xc5'),_0x4f7f74[_0x3966('0xc8')]),_0x239304[_0x3966('0xad')],_0x239304[_0x3966('0xae')]);}}break;case _0x3966('0xc9'):_0x4f7f74[_0x3966('0xca')]+=0x1;_0x239304[_0x3966('0xcb')]+=0x1;_0x239304['countglobal']=ut[_0x3966('0xa3')](_0x239304);ut['logCustomer'](_0x239304,0x3,_0x3966('0xcc'));ami['emit'](_0x3966('0xcd'),ut[_0x3966('0xa5')](_0x239304,_0x3966('0xce')));rpcDb['createCustomerHistory'](_0x239304,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74[_0x3966('0xcf')]){_0x4c98b0=ut['cloneAction'](_0x239304,0xf,_0x3966('0xa9'));rpcDb['createCustomerFinal'](_0x4c98b0,_0x3966('0xd0'));}else{if(_0x239304[_0x3966('0xcb')]>=_0x4f7f74[_0x3966('0xd1')]){rpcDb['createCustomerFinal'](_0x239304,_0x3966('0xd2'));}else{rpcDb[_0x3966('0xc6')](ut[_0x3966('0xc7')](_0x239304,'countnoanswerretry',_0x4f7f74[_0x3966('0xd3')]),_0x239304[_0x3966('0xad')],_0x239304[_0x3966('0xae')]);}}break;case _0x3966('0xd4'):_0x4f7f74[_0x3966('0x3c')]+=0x1;_0x239304['countcongestionretry']+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut[_0x3966('0x91')](_0x239304,0x8,_0x3966('0xd5'));ami[_0x3966('0x5e')](_0x3966('0xd6'),ut[_0x3966('0xa5')](_0x239304,_0x3966('0xd7')));rpcDb[_0x3966('0x96')](_0x239304,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74[_0x3966('0xcf')]){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb[_0x3966('0x9a')](_0x4c98b0,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x239304[_0x3966('0xd8')]>=_0x4f7f74[_0x3966('0xd9')]){rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xda'));}else{rpcDb[_0x3966('0xc6')](ut[_0x3966('0xc7')](_0x239304,_0x3966('0xd8'),_0x4f7f74['dialBusyRetryFrequency']),_0x239304[_0x3966('0xad')],_0x239304['activeContact']);}}break;case _0x3966('0xdb'):_0x4f7f74[_0x3966('0x42')]+=0x1;_0x239304[_0x3966('0xdc')]+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut['logCustomer'](_0x239304,0x14,_0x3966('0xdd'));ami['emit']('custom:agentreject',ut['buildObj'](_0x239304,_0x3966('0xde')));rpcDb[_0x3966('0x96')](_0x239304,_0x3966('0xdf'));if(ut['totalGlobal'](_0x239304)>=_0x4f7f74['dialGlobalMaxRetry']){_0x4c98b0=ut['cloneAction'](_0x239304,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4c98b0,_0x3966('0xe0'));}else{if(_0x239304[_0x3966('0xdc')]>=_0x4f7f74[_0x3966('0xe1')]){rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xe0'));}else{rpcDb[_0x3966('0xc6')](ut[_0x3966('0xc7')](_0x239304,_0x3966('0xdc'),_0x4f7f74[_0x3966('0xe2')]),_0x239304[_0x3966('0xad')],_0x239304['activeContact']);}}break;case _0x3966('0xe3'):_0x4f7f74['outboundAbandonedCallsDay']+=0x1;_0x239304[_0x3966('0xe4')]+=0x1;_0x239304['countglobal']=ut['totalGlobal'](_0x239304);ut[_0x3966('0x91')](_0x239304,0xb,_0x3966('0xe5'));rpcDb[_0x3966('0x96')](_0x239304,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74[_0x3966('0xcf')]){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb['createCustomerFinal'](_0x4c98b0,_0x3966('0xe6'));}else{if(_0x239304[_0x3966('0xe7')]>=_0x4f7f74[_0x3966('0xe8')]){rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xe6'));}else{rpcDb[_0x3966('0xc6')](ut['scheduledAt'](_0x239304,_0x3966('0xe4'),_0x4f7f74[_0x3966('0xe9')]),_0x239304[_0x3966('0xad')],_0x239304['activeContact']);}}break;case'18':_0x4f7f74['outboundUnknownCallsDay']+=0x1;_0x239304['countmachineretry']+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut['logCustomer'](_0x239304,0x12,_0x437961[_0x3966('0xea')]||_0x437961[_0x3966('0xeb')]);ami[_0x3966('0x5e')](_0x3966('0xec'),ut['buildObj'](_0x239304,_0x3966('0xed')));rpcDb['createCustomerHistory'](_0x239304,_0x3966('0xee'));if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74[_0x3966('0xcf')]){_0x4c98b0=ut['cloneAction'](_0x239304,0xf,_0x3966('0xa9'));rpcDb[_0x3966('0x9a')](_0x4c98b0,_0x3966('0xee'));}else{rpcDb['createCustomerFinal'](_0x239304,_0x3966('0xee'));}delete this['actions'][_0x437961['linkedid']];break;case'19':_0x4f7f74[_0x3966('0x43')]+=0x1;_0x239304[_0x3966('0xa2')]=ut[_0x3966('0xa3')](_0x239304);ut[_0x3966('0x91')](_0x239304,0x13,_0x437961[_0x3966('0xea')]||_0x437961[_0x3966('0xeb')]);ami[_0x3966('0x5e')](_0x3966('0xec'),ut[_0x3966('0xa5')](_0x239304,'amd'));rpcDb[_0x3966('0x96')](_0x239304,_0x3966('0xef'));if(ut[_0x3966('0xa3')](_0x239304)>=_0x4f7f74[_0x3966('0xcf')]){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb[_0x3966('0x9a')](_0x4c98b0,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xef'));}delete this['actions'][_0x437961[_0x3966('0xf0')]];break;default:if(_0x239304[_0x3966('0x72')]){ut[_0x3966('0xf1')](_0x4f7f74,_0x3966('0xf2'));ut['loggerError'](_0x3966('0xf3')+_0x4f7f74[_0x3966('0x2a')],_0x437961);}_0x4f7f74[_0x3966('0x43')]+=0x1;_0x239304['countglobal']=ut[_0x3966('0xa3')](_0x239304);ut[_0x3966('0x91')](_0x239304,0xc,_0x437961[_0x3966('0xea')]||_0x437961['dialstatus']);rpcDb[_0x3966('0x96')](_0x239304,_0x3966('0xf4'));if(ut['totalGlobal'](_0x239304)>=_0x4f7f74['dialGlobalMaxRetry']){_0x4c98b0=ut[_0x3966('0xa8')](_0x239304,0xf,_0x3966('0xa9'));rpcDb[_0x3966('0x9a')](_0x4c98b0,_0x3966('0xf5'));}else{rpcDb[_0x3966('0x9a')](_0x239304,_0x3966('0xf5'));}delete this[_0x3966('0x17')][_0x437961[_0x3966('0xf0')]];}if(!(_0x239304[_0x3966('0x72')]&&_0x20bc5f==='16')){ut['updateOriginated'](_0x4f7f74,_0x3966('0xf6'));logger[_0x3966('0x5b')](_0x3966('0xf7'),_0x239304[_0x3966('0xb3')],_0x3966('0xb4'),_0x4f7f74[_0x3966('0x2a')],_0x3966('0x70'),_0x4f7f74[_0x3966('0x4d')]);}if(_0x20bc5f!==_0x3966('0xaf')){delete this[_0x3966('0x17')][_0x437961['linkedid']];delete this['actions'][_0x437961[_0x3966('0xf8')]];}}};Preview[_0x3966('0x11')][_0x3966('0xf9')]=function(_0xd4259f,_0x3340ca,_0x59de1f){if(_[_0x3966('0xfa')](_0x3340ca)&&'object'!==typeof _0x3340ca){return;}if(_['isUndefined'](_0x59de1f)&&'object'!==typeof _0x59de1f){return;}switch(_0x59de1f[_0x3966('0xfb')]){case'0':ut[_0x3966('0xfc')](_0xd4259f,0x0,_0x3966('0xa4'));rpcDb[_0x3966('0xfd')](_0xd4259f,_0x3966('0xfe'));break;case'3':ut[_0x3966('0xfc')](_0xd4259f,0x3,_0x3966('0xcc'));rpcDb[_0x3966('0xfd')](_0xd4259f,_0x3966('0xff'));break;case'5':ut['logAgent'](_0xd4259f,0x5,_0x3966('0x100'));rpcDb['createAgentHistory'](_0xd4259f,_0x3966('0x101'));break;case'8':ut[_0x3966('0xfc')](_0xd4259f,0x8,_0x3966('0xd5'));rpcDb['createAgentHistory'](_0xd4259f,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x3966('0xfc')](_0xd4259f,0x16,_0x3966('0x102'));rpcDb['createAgentHistory'](_0xd4259f,_0x3966('0x103'));break;default:ut[_0x3966('0xfc')](_0xd4259f,0xc,_0x59de1f[_0x3966('0xfb')]);rpcDb['createAgentHistory'](_0xd4259f,_0x3966('0x104'));}ut['updateOriginated'](_0x3340ca,_0x3966('0x105'));logger['info'](_0x3966('0x106'),_0xd4259f[_0x3966('0xb3')],_0x3966('0xb4'),_0x3340ca['name'],_0x3966('0x70'),_0x3340ca[_0x3966('0x4d')]);delete this[_0x3966('0x17')][_0xd4259f[_0x3966('0xb3')]];};Preview[_0x3966('0x11')][_0x3966('0x107')]=function(_0x28db03,_0x17ffc9,_0x2b362c,_0x2832d1,_0x46f532){var _0x46054f=this;return new BPromise(function(_0x5de694,_0x11c004){if(_[_0x3966('0x6d')](_0x17ffc9)||_[_0x3966('0x6d')](_0x17ffc9['Contact'])||_[_0x3966('0x6d')](_0x17ffc9[_0x3966('0x108')][_0x3966('0x109')])||_[_0x3966('0x6d')](_0x17ffc9[_0x3966('0x75')])){_0x11c004(ut['message'](_0x3966('0x10a'),_0x2832d1,_0x46f532));return;}var _0xa5fc94=uuid['v4']();var _0x4817b4=_0x46054f[_0x3966('0x15')][_0x17ffc9[_0x3966('0x6e')][_0x3966('0x2a')]];var _0x4d645c=_0x2b362c?_0x46054f[_0x3966('0x18')][_0x2b362c]['id']:undefined;_0x46054f[_0x3966('0x17')][_0xa5fc94]=new Action(_0x17ffc9,_0x4817b4,_0xa5fc94,_0x2b362c,_0x4d645c);var _0x661e73=_0x46054f[_0x3966('0x17')][_0xa5fc94];_0x661e73[_0x3966('0xad')]=_0x2832d1;_0x661e73['activeContact']=_0x46f532;_0x661e73[_0x3966('0x10b')]=_0x2b362c;if(_[_0x3966('0x10c')](_0x28db03)){_0x46054f[_0x3966('0x10d')](_0x661e73,_0x4817b4,_0x17ffc9,_0x2b362c)['then'](function(_0x45ab0e){logger[_0x3966('0x5b')](_0x3966('0x10e'),_0x3966('0x10f')+_0x661e73[_0x3966('0x6f')]+_0x3966('0x110')+_0x661e73[_0x3966('0x111')],JSON[_0x3966('0x57')](_0x45ab0e));ami[_0x3966('0x5e')](_0x3966('0x112'),ut[_0x3966('0xa5')](_0x661e73,_0x3966('0x113'),_0x46054f[_0x3966('0x15')][_0x661e73[_0x3966('0x6f')]]));_0x5de694(ut[_0x3966('0x4c')]('Calling'));})[_0x3966('0x7a')](function(_0x3e20a0){ut[_0x3966('0x64')](_0x3966('0x114'),_0x3e20a0);_0x11c004(ut[_0x3966('0x4c')](_0x3966('0x115'),_0x2832d1,_0x46f532));});}else{_0x4817b4['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x661e73);rpcDb['createHistory'](_0x661e73,'[Blacklist][error]');delete _0x46054f[_0x3966('0x17')][_0xa5fc94];_0x11c004(ut['message'](_0x3966('0x116'),_0x2832d1,_0x46f532));}});};Preview['prototype'][_0x3966('0x9d')]=function(_0x4b02e1){return!_[_0x3966('0x6d')](_0x4b02e1)&&!_[_0x3966('0x6d')](_0x4b02e1['name'])&&!_[_0x3966('0x6d')](_0x4b02e1[_0x3966('0x55')])&&_0x4b02e1['active']&&!_['isNil'](this[_0x3966('0x117')][util['format']('SIP/%s',_0x4b02e1[_0x3966('0x2a')])])&&!_[_0x3966('0x6d')](this[_0x3966('0x117')][util['format'](_0x3966('0x118'),_0x4b02e1[_0x3966('0x2a')])][_0x3966('0x78')])&&(this[_0x3966('0x117')][util[_0x3966('0x58')](_0x3966('0x118'),_0x4b02e1[_0x3966('0x2a')])][_0x3966('0x78')]===_0x3966('0x119')||this['trunks'][util[_0x3966('0x58')](_0x3966('0x118'),_0x4b02e1[_0x3966('0x2a')])]['status']===_0x3966('0x11a'));};Preview[_0x3966('0x11')][_0x3966('0x8b')]=function(_0x5aa8c6,_0x56eb36){var _0x2c060a=this;return new BPromise(function(_0x2d4946,_0x1828b5){_0x2c060a[_0x3966('0x11b')](_0x5aa8c6,_0x56eb36)['then'](function(_0x54e900){_0x2d4946(_[_0x3966('0x73')](_0x54e900,[_0x3966('0x4c')]));})['catch'](function(_0x3ef1c0){if(_0x3ef1c0[_0x3966('0x11c')]){rpcDb[_0x3966('0x11d')](_0x5aa8c6);}if(_0x3ef1c0['active']){rpcDb['disableContact'](_0x5aa8c6);}_0x1828b5(_[_0x3966('0x73')](_0x3ef1c0,[_0x3966('0x4c')]));});});};Preview[_0x3966('0x11')][_0x3966('0x11b')]=function(_0x388323,_0x4ce7e1){var _0x2b262c=this;return new BPromise(function(_0x1a370d,_0x3110a2){var _0x5e593b,_0x559387;rpcDb[_0x3966('0x11e')](_0x388323)[_0x3966('0x11f')](function(_0x3663aa){if(!_[_0x3966('0x6d')](_0x3663aa[0x0])){_0x559387=_0x3663aa[0x0][_0x3966('0x120')]?![]:!![];_0x5e593b=_0x3663aa[0x0]['recallme']?!![]:![];_0x5e593b=_0x4ce7e1?!![]:_0x5e593b;}var _0x41dd8b=_0x2b262c[_0x3966('0x121')](_0x3663aa);if(_0x41dd8b['isValid']){rpcDb['checkIsBlackList'](_[_0x3966('0x73')](_0x3663aa[0x0],[_0x3966('0x75'),_0x3966('0x122')]))[_0x3966('0x11f')](function(_0x1ef180){_0x2b262c[_0x3966('0x107')](_0x1ef180,_0x3663aa[0x0],_0x4ce7e1,_0x559387,_0x5e593b)['then'](function(_0xa9cc05){_0x1a370d(_0xa9cc05);})['catch'](function(_0x1dd6a7){_0x3110a2(_0x1dd6a7);});})[_0x3966('0x7a')](function(_0x4ecb6a){ut[_0x3966('0x64')](_0x3966('0x123'),_0x4ecb6a);_0x3110a2(ut[_0x3966('0x4c')]('Call\x20unsuccessful',_0x559387,_0x5e593b));});}else{_0x3110a2(ut[_0x3966('0x4c')](_0x41dd8b[_0x3966('0x4c')],_0x559387,_0x5e593b));}})[_0x3966('0x7a')](function(_0x404f7c){ut['logger']('[Preview][getContactPreview]',_0x404f7c);_0x3110a2(ut[_0x3966('0x4c')](_0x3966('0x124'),![],!![]));});});};Preview[_0x3966('0x11')][_0x3966('0x121')]=function(_0x101fdc){if(_[_0x3966('0x6d')](_0x101fdc)||_[_0x3966('0x10c')](_0x101fdc)||!_[_0x3966('0x6d')](_0x101fdc[0x0][_0x3966('0x8a')])&&_[_0x3966('0x6d')](_0x101fdc[0x0]['Agent']['name'])){ut[_0x3966('0x64')](_0x3966('0x125'),_0x101fdc);return{'isValid':![],'message':_0x3966('0x126')};}var _0x1bec27=this[_0x3966('0x15')][_0x101fdc[0x0]['Queue']['name']];_0x1bec27[_0x3966('0x4c')]=_0x3966('0x9f');if(_[_0x3966('0x6d')](_0x1bec27)){ut[_0x3966('0x64')]('[Preview][validateContact][Empty\x20Campaign]',_0x1bec27);return{'isValid':![],'message':_0x3966('0x127')};}if(!this[_0x3966('0x9d')](_0x1bec27[_0x3966('0x54')])){ut[_0x3966('0x64')](_0x3966('0x128'),_0x3966('0x129')+_0x1bec27[_0x3966('0x2a')]+_0x3966('0x12a'));if(!this[_0x3966('0x9d')](_0x1bec27[_0x3966('0x9e')])){ut['logger'](_0x3966('0x128'),_0x1bec27[_0x3966('0x2a')]+_0x3966('0x12b'));return{'isValid':![],'message':_0x3966('0x12c')};}}if(!ut[_0x3966('0x9c')](_0x1bec27[_0x3966('0x33')])){ut[_0x3966('0x64')](_0x3966('0x12d'),_0x1bec27['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1bec27[_0x3966('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x3966('0x12e')};};Preview[_0x3966('0x11')][_0x3966('0x10d')]=function(_0x31d993,_0x519af9,_0x50aeec,_0x1c2b80){var _0x3514e4=this;return new BPromise(function(_0x130dd1,_0x67a09b){var _0xe5a60e=_0x31d993[_0x3966('0xb3')];var _0x454a21=_0x3514e4[_0x3966('0x9d')](_0x519af9[_0x3966('0x54')])?util['format']('SIP/%s/%s%s',_0x519af9[_0x3966('0x54')][_0x3966('0x2a')],_['isNil'](_0x519af9[_0x3966('0x37')])?'':_0x519af9[_0x3966('0x37')][_0x3966('0x12f')]()||'',_0x519af9[_0x3966('0x130')]>0x0?_0x50aeec[_0x3966('0x108')][_0x3966('0x109')][_0x3966('0x131')](_0x519af9[_0x3966('0x130')]):_0x50aeec[_0x3966('0x108')][_0x3966('0x109')]):util[_0x3966('0x58')](_0x3966('0x132'),_[_0x3966('0x6d')](_0x519af9['TrunkBackup'])?_0x519af9[_0x3966('0x54')]['name']:_0x519af9[_0x3966('0x9e')][_0x3966('0x2a')],_['isNil'](_0x519af9[_0x3966('0x37')])?'':_0x519af9[_0x3966('0x37')][_0x3966('0x12f')]()||'',_0x519af9[_0x3966('0x130')]>0x0?_0x50aeec[_0x3966('0x108')]['phone'][_0x3966('0x131')](_0x519af9[_0x3966('0x130')]):_0x50aeec[_0x3966('0x108')][_0x3966('0x109')]);var _0xe8225c=_0x3514e4[_0x3966('0x9d')](_0x519af9['Trunk'])?ut[_0x3966('0x133')](_0x519af9['Trunk'][_0x3966('0x134')],_0x519af9['dialOriginateCallerIdName'],_0x519af9[_0x3966('0x135')]>0x0?ut['getCallerIdRandom'](_0x519af9[_0x3966('0x136')],_0x519af9['dialRandomLastDigitCallerIdNumber']):_0x519af9[_0x3966('0x136')]):ut[_0x3966('0x133')](_['isNil'](_0x519af9[_0x3966('0x9e')])?_0x519af9[_0x3966('0x54')][_0x3966('0x134')]:_0x519af9['TrunkBackup'][_0x3966('0x134')],_0x519af9[_0x3966('0x35')],_0x519af9[_0x3966('0x135')]>0x0?ut['getCallerIdRandom'](_0x519af9[_0x3966('0x136')],_0x519af9['dialRandomLastDigitCallerIdNumber']):_0x519af9[_0x3966('0x136')]);if(_0xe8225c){_0x31d993[_0x3966('0x137')]=ut[_0x3966('0x138')](_0xe8225c);_0x31d993[_0x3966('0x139')]=ut['extractCalleridNumber'](_0xe8225c);}var _0x3969c4=ut[_0x3966('0x13a')](_0x519af9,_0x50aeec,_0x454a21,_0xe8225c,_0xe5a60e,_0x31d993);_[_0x3966('0x13b')](_0x31d993,ut['toLowerVariables'](_0x3969c4));_0x31d993[_0x3966('0x8e')]=moment()[_0x3966('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x3966('0x77')](ut['variablesAction'](_0x31d993,_0x519af9,_0x3969c4,_0x31d993[_0x3966('0xae')],_0x1c2b80))[_0x3966('0x11f')](function(_0x28fd4d){var _0x31f795=_0x31d993[_0x3966('0x13c')];if(!_[_0x3966('0x6d')](_0x31f795)){if(!_[_0x3966('0x6d')](_0x3514e4[_0x3966('0x18')][_0x31f795])){_0x3514e4[_0x3966('0x18')][_0x31f795][_0x3966('0x13d')]=_0x31d993['calleridnum'];emit(util['format']('user:%s',_0x3514e4[_0x3966('0x18')][_0x31f795][_0x3966('0x2a')]),_0x3966('0x13e'),{'destaccountcode':_0x3514e4['agents'][_0x31f795][_0x3966('0x13f')],'destconnectedlinenum':_0x31d993['calleridnum']});}}_0x519af9[_0x3966('0x4d')]+=0x1;logger[_0x3966('0x5b')](_0x3966('0x140'),_0xe5a60e,_0x3966('0xb4'),_0x519af9[_0x3966('0x2a')],_0x3966('0x70'),_0x519af9[_0x3966('0x4d')]);_0x130dd1(_0x28fd4d);})['catch'](function(_0x2b3cd9){ut['logAgent'](_0x31d993,0xe,_0x3966('0x141'));rpcDb[_0x3966('0xfd')](_0x31d993,_0x3966('0x142'));_0x67a09b(_0x2b3cd9);});});};Preview['prototype'][_0x3966('0x143')]=function(_0x416bc5){if(this['actions'][_0x416bc5[_0x3966('0xf0')]]){this['actions'][_0x416bc5[_0x3966('0xf0')]][_0x3966('0x79')]=_0x416bc5['channel'];}};Preview[_0x3966('0x11')][_0x3966('0x1a')]=function(_0x16d2b7){var _0x806b6=this;var _0x59040c=this[_0x3966('0x17')][_0x16d2b7[_0x3966('0x144')]];if(_0x59040c){if(_0x59040c[_0x3966('0x10b')]&&this[_0x3966('0x18')][_0x59040c[_0x3966('0x10b')]]){ut[_0x3966('0x145')](_0x59040c,this[_0x3966('0x18')][_0x59040c['lookAgent']][_0x3966('0x2a')],this['agents'][_0x59040c[_0x3966('0x10b')]]['id']);}var _0x3b5c68=_[_0x3966('0x146')](_0x59040c);_0x3b5c68[_0x3966('0xb0')]=moment()['format'](_0x3966('0x8f'));var _0x3b1094=_0x806b6[_0x3966('0x15')][_0x59040c[_0x3966('0x6f')]];if(ut[_0x3966('0x147')](_0x16d2b7[_0x3966('0x148')])){if(_0x59040c[_0x3966('0xad')]){rpcDb[_0x3966('0x11d')](_0x59040c[_0x3966('0x111')]);}if(_0x59040c[_0x3966('0xae')]){rpcDb[_0x3966('0x149')](_0x59040c[_0x3966('0x111')]);}ami[_0x3966('0x5e')]('custom:agentringnoanswer',ut[_0x3966('0xa5')](_0x59040c,'rejected',this[_0x3966('0x15')][_0x59040c['queue']]));this[_0x3966('0xf9')](_0x3b5c68,_0x3b1094,_0x16d2b7);}else{_0x59040c[_0x3966('0x8e')]=moment()[_0x3966('0x58')](_0x3966('0x8f'));ut[_0x3966('0xfc')](_0x3b5c68,0x4,'Answer');rpcDb[_0x3966('0xfd')](_0x3b5c68,_0x3966('0x14a'));}}};Preview[_0x3966('0x11')]['syncHangup']=function(_0x7c10f8){var _0x7f079a=this;var _0x563706=this[_0x3966('0x17')][_0x7c10f8[_0x3966('0xf0')]];var _0x53ff37;if(_0x563706){_0x53ff37=this[_0x3966('0x15')][_0x563706[_0x3966('0x6f')]];logger['info'](_0x3966('0x14b'),_0x7c10f8[_0x3966('0xf0')],'\x20Queue',_0x53ff37['name'],'pTalking:\x20',_0x53ff37[_0x3966('0x2d')]);}if(this[_0x3966('0x17')][_0x7c10f8[_0x3966('0xf0')]]&&_0x7c10f8['linkedid']!==_0x7c10f8[_0x3966('0xb3')]){if(_0x7c10f8[_0x3966('0x14c')]==='16'&&this[_0x3966('0x17')][_0x7c10f8['linkedid']][_0x3966('0x72')]){this[_0x3966('0xa0')](_0x7c10f8,_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')]);}else if(this[_0x3966('0x17')][_0x7c10f8[_0x3966('0xf0')]][_0x3966('0x72')]){logger[_0x3966('0x5b')](_0x3966('0x14d'),_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')],_0x3966('0xb4'),_0x53ff37[_0x3966('0x2a')],'pTalking:\x20',_0x53ff37[_0x3966('0x2d')]);this[_0x3966('0xa0')](_0x7c10f8,_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')]);}}else if(_0x563706&&_[_0x3966('0x6d')](_0x563706[_0x3966('0x14e')])&&_0x53ff37[_0x3966('0x14f')]&&_0x7c10f8[_0x3966('0xf0')]===_0x7c10f8[_0x3966('0xb3')]&&_[_0x3966('0x6d')](_0x7c10f8['reason'])&&_0x7c10f8['cause']==='16'&&_0x7c10f8['channelstate']==='6'&&_[_0x3966('0xfa')](_0x563706['transfer'])){if(_0x563706[_0x3966('0xad')]){rpcDb[_0x3966('0x11d')](_0x563706[_0x3966('0x111')]);}if(_0x563706[_0x3966('0xae')]){rpcDb[_0x3966('0x149')](_0x563706['idContact']);}_0x7c10f8[_0x3966('0xfb')]='22';this[_0x3966('0xf9')](_0x563706,_0x53ff37,_0x7c10f8);}else if(_0x563706&&_0x563706['transfer']){if(_0x7c10f8[_0x3966('0x14c')]==='16'&&this[_0x3966('0x17')][_0x7c10f8[_0x3966('0xf0')]][_0x3966('0x72')]){logger[_0x3966('0x5b')](_0x3966('0x150'),_0x7c10f8[_0x3966('0xf0')],_0x7c10f8['cause'],_0x3966('0xb4'),_0x53ff37[_0x3966('0x2a')],_0x3966('0x71'),_0x53ff37[_0x3966('0x2d')]);this[_0x3966('0xa0')](_0x7c10f8,_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')]);}else if(this[_0x3966('0x17')][_0x7c10f8[_0x3966('0xf0')]][_0x3966('0x72')]){logger[_0x3966('0x5b')](_0x3966('0x14d'),_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')],_0x3966('0xb4'),_0x53ff37[_0x3966('0x2a')],'pTalking:\x20',_0x53ff37['pTalking']);this[_0x3966('0xa0')](_0x7c10f8,_0x7c10f8[_0x3966('0xf0')],_0x7c10f8[_0x3966('0x14c')]);}}};Preview['prototype']['syncDialEnd']=function(_0x48c8c9){if(this['actions'][_0x48c8c9[_0x3966('0xf8')]]&&_0x48c8c9[_0x3966('0xf8')]!==_0x48c8c9[_0x3966('0x151')]){this[_0x3966('0xa0')](_0x48c8c9,_0x48c8c9[_0x3966('0xf8')],_0x48c8c9[_0x3966('0xeb')]);}};Preview[_0x3966('0x11')][_0x3966('0x152')]=function(_0x42e381){if(this[_0x3966('0x17')][_0x42e381[_0x3966('0xf0')]]&&_0x42e381[_0x3966('0xf0')]!==_0x42e381[_0x3966('0xb3')]&&!this['actions'][_0x42e381['linkedid']]['dialAnswer']){if(_0x42e381[_0x3966('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x42e381,_0x42e381[_0x3966('0xf0')],_0x42e381[_0x3966('0x14c')]);}}};Preview[_0x3966('0x11')][_0x3966('0x153')]=function(_0x4cddd1,_0x3cb892,_0x28092f){if(this[_0x3966('0x17')][_0x4cddd1]){if(_[_0x3966('0x6d')](this['actions'][_0x4cddd1]['variables'])){this[_0x3966('0x17')][_0x4cddd1][_0x3966('0x154')]={};}this[_0x3966('0x17')][_0x4cddd1][_0x3966('0x154')][_0x3cb892]=_0x28092f;}};Preview[_0x3966('0x11')]['syncVarSet']=function(_0x3192b7){try{if(!_[_0x3966('0x6d')](_0x3192b7)){if(ut['filterKey'](_[_0x3966('0x155')](_0x3192b7[_0x3966('0x156')])[0x0])){this[_0x3966('0x153')](_0x3192b7[_0x3966('0xb3')],_[_0x3966('0x155')](_0x3192b7[_0x3966('0x156')])[0x0],_0x3192b7[_0x3966('0x157')]);}}}catch(_0x50d610){logger[_0x3966('0x158')]('[syncVarSet][Preview]',util['inspect'](_0x50d610,{'showHidden':![],'depth':null}));}};Preview[_0x3966('0x11')][_0x3966('0x25')]=function(_0x1dcfaf){if(_0x1dcfaf){if(this[_0x3966('0x17')][_0x1dcfaf['transfertargetlinkedid']]){this[_0x3966('0x17')][_0x1dcfaf['transfertargetlinkedid']]['transfer']=!![];}}};Preview['prototype'][_0x3966('0x27')]=function(_0x1fc4fa){if(_0x1fc4fa){if(this[_0x3966('0x17')][_0x1fc4fa[_0x3966('0x159')]]){this[_0x3966('0x17')][_0x1fc4fa[_0x3966('0x159')]]['transfer']=!![];}}};module[_0x3966('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 34c0516..76ed984 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 _0x5473=['[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','membername','context','exten','holdtime','assigned','lastAssignedTo','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList'];(function(_0x5b7f48,_0x4d8a1d){var _0x2424b0=function(_0x21b28b){while(--_0x21b28b){_0x5b7f48['push'](_0x5b7f48['shift']());}};_0x2424b0(++_0x4d8a1d);}(_0x5473,0x1dd));var _0x3547=function(_0x51ad5e,_0x4b001f){_0x51ad5e=_0x51ad5e-0x0;var _0x174f80=_0x5473[_0x51ad5e];return _0x174f80;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x3547('0x0'))('preview');var _=require('lodash');var cmHopper=require(_0x3547('0x1'));var cmHopperFinal=require(_0x3547('0x2'));var cmHopperHistory=require(_0x3547('0x3'));var cmHopperBlack=require(_0x3547('0x4'));var voiceQueueRt=require(_0x3547('0x5'));var agentReportPreview=require(_0x3547('0x6'));var voiceQueueReport=require(_0x3547('0x7'));function loggerCatch(_0x718609){return function(_0x31892e){logger[_0x3547('0x8')](_0x718609,util[_0x3547('0x9')](_0x31892e,{'showHidden':![],'depth':null}));};}function create(_0x261b07){return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopperHistory[_0x3547('0xc')](_0x261b07))['catch'](loggerCatch(_0x3547('0xd')));}function createAgent(_0x5eb8fa){return BPromise['resolve']()['then'](agentReportPreview[_0x3547('0xc')](_0x5eb8fa))[_0x3547('0xe')](loggerCatch(_0x3547('0xd')));}function moveContact(_0x395a1b){return BPromise[_0x3547('0xa')]()['then'](cmHopper[_0x3547('0xf')](_0x395a1b,!![]))['catch'](loggerCatch(_0x3547('0x10')));}exports[_0x3547('0x11')]=function(_0x33717b){return BPromise[_0x3547('0xa')]()['then'](cmHopperBlack[_0x3547('0x11')](_0x33717b))[_0x3547('0xe')](loggerCatch(_0x3547('0x12')));};exports[_0x3547('0x13')]=function(_0x5a4866){return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopper[_0x3547('0x13')](_0x5a4866))[_0x3547('0xe')](loggerCatch(_0x3547('0x14')));};exports[_0x3547('0xc')]=function(_0x3321cb,_0x4ebc06){create(_0x3321cb)['catch'](loggerCatch(_0x4ebc06));moveContact(_0x3321cb)[_0x3547('0xe')](loggerCatch(_0x4ebc06));};exports[_0x3547('0x15')]=function(_0x59bb85,_0x1d58c2){createAgent(_0x59bb85)[_0x3547('0xe')](loggerCatch(_0x1d58c2));};exports[_0x3547('0x16')]=function(_0x33d619,_0x29342c){create(_0x33d619)[_0x3547('0xe')](loggerCatch(_0x29342c));};exports[_0x3547('0x17')]=function(_0xd76432,_0x5bf17c){moveContact(_0xd76432)[_0x3547('0xe')](loggerCatch(_0x5bf17c));};exports['rescheduleContact']=function(_0x51596c,_0x31ec90,_0xf4b481){if(_0x31ec90){_0x51596c[_0x3547('0x18')]=null;}if(_0xf4b481){_0x51596c['active']=![];}return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopper[_0x3547('0x19')](_0x51596c))['catch'](loggerCatch(_0x3547('0x1a')));};exports['countReScheduled']=function(_0x152b51){return BPromise['resolve']()['then'](cmHopper[_0x3547('0x1b')](_0x152b51))['catch'](loggerCatch(_0x3547('0x1c')));};exports[_0x3547('0x1d')]=function(_0x25c2cd){return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopper[_0x3547('0x1d')]({'UserId':null},_0x25c2cd,0x1))[_0x3547('0xe')](loggerCatch(_0x3547('0x1e')));};exports[_0x3547('0x1f')]=function(_0x4493a1){return BPromise['resolve']()['then'](cmHopper[_0x3547('0x1d')]({'active':![]},_0x4493a1,0x1))[_0x3547('0xe')](loggerCatch(_0x3547('0x20')));};exports[_0x3547('0x21')]=function(_0x4ba417){var _0x239385={};_0x239385[_0x3547('0x22')]=_0x4ba417[_0x3547('0x22')];_0x239385[_0x3547('0x23')]=_0x4ba417['uniqueid'];_0x239385[_0x3547('0x24')]=_0x4ba417['calleridnum'];_0x239385[_0x3547('0x25')]=_0x4ba417[_0x3547('0x25')];_0x239385['queue']=_0x4ba417[_0x3547('0x26')];_0x239385[_0x3547('0x27')]=_0x4ba417[_0x3547('0x28')];_0x239385[_0x3547('0x29')]=_0x4ba417[_0x3547('0x28')];_0x239385[_0x3547('0x2a')]=0x1;_0x239385['queuecallercompleteAt']=_0x4ba417['endtime'];_0x239385[_0x3547('0x2b')]=_0x4ba417[_0x3547('0x2c')];_0x239385[_0x3547('0x2d')]='from-sip';_0x239385[_0x3547('0x2e')]='xcally-motion-preview';_0x239385[_0x3547('0x2f')]=0x0;_0x239385[_0x3547('0x30')]=0x1;_0x239385[_0x3547('0x31')]=_0x4ba417['membername'];_0x239385['queuecallerexitreason']=_0x3547('0x32');return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](voiceQueueReport['create'](_0x239385))[_0x3547('0xe')](loggerCatch(_0x3547('0x33')));};exports[_0x3547('0x34')]=function(_0x4118eb,_0x3266ef){return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopper[_0x3547('0x34')](_0x4118eb,_0x3266ef))[_0x3547('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3547('0x35')]=function(_0x171ca2){return BPromise[_0x3547('0xa')]()[_0x3547('0xb')](cmHopper[_0x3547('0x19')](_0x171ca2,!![],!![]))[_0x3547('0xe')](loggerCatch(_0x3547('0x36')));}; \ No newline at end of file +var _0x91e9=['COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned'];(function(_0x3a92db,_0x5192bf){var _0x339c8f=function(_0x172b2f){while(--_0x172b2f){_0x3a92db['push'](_0x3a92db['shift']());}};_0x339c8f(++_0x5192bf);}(_0x91e9,0x1ea));var _0x991e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x91e9[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x991e('0x0'));var BPromise=require(_0x991e('0x1'));var logger=require(_0x991e('0x2'))(_0x991e('0x3'));var _=require(_0x991e('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x991e('0x5'));var cmHopperBlack=require(_0x991e('0x6'));var voiceQueueRt=require(_0x991e('0x7'));var agentReportPreview=require(_0x991e('0x8'));var voiceQueueReport=require(_0x991e('0x9'));function loggerCatch(_0xfeabdf){return function(_0x53c611){logger[_0x991e('0xa')](_0xfeabdf,util[_0x991e('0xb')](_0x53c611,{'showHidden':![],'depth':null}));};}function create(_0x389fd1){return BPromise[_0x991e('0xc')]()['then'](cmHopperHistory[_0x991e('0xd')](_0x389fd1))[_0x991e('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x541128){return BPromise['resolve']()[_0x991e('0xf')](agentReportPreview[_0x991e('0xd')](_0x541128))[_0x991e('0xe')](loggerCatch(_0x991e('0x10')));}function moveContact(_0x44e4a3){return BPromise['resolve']()['then'](cmHopper[_0x991e('0x11')](_0x44e4a3,!![]))[_0x991e('0xe')](loggerCatch(_0x991e('0x12')));}exports[_0x991e('0x13')]=function(_0x311011){return BPromise['resolve']()[_0x991e('0xf')](cmHopperBlack[_0x991e('0x13')](_0x311011))[_0x991e('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x991e('0x14')]=function(_0x49bf8e){return BPromise['resolve']()[_0x991e('0xf')](cmHopper['getContactPreview'](_0x49bf8e))[_0x991e('0xe')](loggerCatch(_0x991e('0x15')));};exports['createHistory']=function(_0x2bc7d3,_0x4f6671){create(_0x2bc7d3)['catch'](loggerCatch(_0x4f6671));moveContact(_0x2bc7d3)[_0x991e('0xe')](loggerCatch(_0x4f6671));};exports[_0x991e('0x16')]=function(_0x22a286,_0x222b75){createAgent(_0x22a286)[_0x991e('0xe')](loggerCatch(_0x222b75));};exports['createCustomerHistory']=function(_0x239a80,_0x2f95a7){create(_0x239a80)['catch'](loggerCatch(_0x2f95a7));};exports['createCustomerFinal']=function(_0x42c6ae,_0x47496a){moveContact(_0x42c6ae)['catch'](loggerCatch(_0x47496a));};exports[_0x991e('0x17')]=function(_0x11b073,_0x234b83,_0xec0c98){if(_0x234b83){_0x11b073[_0x991e('0x18')]=null;}if(_0xec0c98){_0x11b073['active']=![];}return BPromise[_0x991e('0xc')]()[_0x991e('0xf')](cmHopper[_0x991e('0x17')](_0x11b073))['catch'](loggerCatch(_0x991e('0x19')));};exports[_0x991e('0x1a')]=function(_0x34fa77){return BPromise[_0x991e('0xc')]()[_0x991e('0xf')](cmHopper[_0x991e('0x1a')](_0x34fa77))['catch'](loggerCatch(_0x991e('0x1b')));};exports[_0x991e('0x1c')]=function(_0x26edce){return BPromise[_0x991e('0xc')]()['then'](cmHopper[_0x991e('0x1c')]({'UserId':null},_0x26edce,0x1))[_0x991e('0xe')](loggerCatch(_0x991e('0x1d')));};exports[_0x991e('0x1e')]=function(_0x5e0805){return BPromise[_0x991e('0xc')]()['then'](cmHopper[_0x991e('0x1c')]({'active':![]},_0x5e0805,0x1))['catch'](loggerCatch(_0x991e('0x1f')));};exports[_0x991e('0x20')]=function(_0x3d52ec){var _0x2c08b5={};_0x2c08b5['type']=_0x3d52ec['type'];_0x2c08b5['uniqueid']=_0x3d52ec[_0x991e('0x21')];_0x2c08b5[_0x991e('0x22')]=_0x3d52ec['calleridnum'];_0x2c08b5[_0x991e('0x23')]=_0x3d52ec[_0x991e('0x23')];_0x2c08b5[_0x991e('0x24')]=_0x3d52ec[_0x991e('0x24')];_0x2c08b5[_0x991e('0x25')]=_0x3d52ec['answertime'];_0x2c08b5[_0x991e('0x26')]=_0x3d52ec[_0x991e('0x27')];_0x2c08b5[_0x991e('0x28')]=0x1;_0x2c08b5[_0x991e('0x29')]=_0x3d52ec[_0x991e('0x2a')];_0x2c08b5[_0x991e('0x2b')]=_0x3d52ec[_0x991e('0x2c')];_0x2c08b5['context']=_0x991e('0x2d');_0x2c08b5[_0x991e('0x2e')]=_0x991e('0x2f');_0x2c08b5[_0x991e('0x30')]=0x0;_0x2c08b5[_0x991e('0x31')]=0x1;_0x2c08b5['lastAssignedTo']=_0x3d52ec[_0x991e('0x2c')];_0x2c08b5['queuecallerexitreason']=_0x991e('0x32');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x2c08b5))[_0x991e('0xe')](loggerCatch(_0x991e('0x33')));};exports[_0x991e('0x34')]=function(_0x1e4081,_0x4eb9c6){return BPromise[_0x991e('0xc')]()[_0x991e('0xf')](cmHopper['getContactRecallMe'](_0x1e4081,_0x4eb9c6))[_0x991e('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x991e('0x35')]=function(_0x19562e){return BPromise[_0x991e('0xc')]()[_0x991e('0xf')](cmHopper[_0x991e('0x17')](_0x19562e,!![],!![]))[_0x991e('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 81ee8ce..8dd5704 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 _0xeb1c=['uniqueid','originate','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','channelAgent','mandatoryDisposition','buildAcw','queue','interface','agentReadyId','hasOwnProperty','not_inuse','status','reachable','push','getDiff','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','moment','../../../../config/logger','env','127.0.0.1','milliseconds','seconds','error','inspect','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','answertime','isFailure','Failure','RECALL','calleridname','BOOKED'];(function(_0x4f3001,_0x651650){var _0x464e18=function(_0x3428ab){while(--_0x3428ab){_0x4f3001['push'](_0x4f3001['shift']());}};_0x464e18(++_0x651650);}(_0xeb1c,0x160));var _0xceb1=function(_0x321d9e,_0x349f45){_0x321d9e=_0x321d9e-0x0;var _0x453561=_0xeb1c[_0x321d9e];return _0x453561;};'use strict';var util=require(_0xceb1('0x0'));var _=require('lodash');var moment=require(_0xceb1('0x1'));var logger=require(_0xceb1('0x2'))('preview');var ipAgi=process[_0xceb1('0x3')]['XCALLY_IP_AGI']||_0xceb1('0x4');function getSeconds(_0x41322d,_0x275915){var _0x25d410=moment(_0x41322d)['milliseconds'](0x0);var _0x358f60=moment(_0x275915)[_0xceb1('0x5')](0x0);return _0x25d410['diff'](_0x358f60,_0xceb1('0x6'));}exports['loggerCatch']=function(_0x13ecec){return function(_0x37a1db){logger[_0xceb1('0x7')](_0x13ecec,util['inspect'](_0x37a1db,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x244632,_0xd20114){logger['info'](_0x244632,util[_0xceb1('0x8')](_0xd20114,{'showHidden':![],'depth':null}));};exports[_0xceb1('0x9')]=function(_0x2088b3,_0x31f732){logger[_0xceb1('0x7')](_0x2088b3,util[_0xceb1('0x8')](_0x31f732,{'showHidden':![],'depth':null}));};exports[_0xceb1('0xa')]=function(_0x477758){return function(_0x34d121){logger['info'](_0x477758,util[_0xceb1('0x8')](_0x34d121,{'showHidden':![],'depth':null}));};};exports[_0xceb1('0xb')]=function(_0x422b05,_0x5d7450,_0x281b29){return{'message':_0x422b05,'unlock':_0x5d7450,'active':_0x281b29};};exports[_0xceb1('0xc')]=function(_0x7b8bc6,_0x85fcae,_0x42b1a2){if(!_[_0xceb1('0xd')](_0x42b1a2)&&'string'===typeof _0x42b1a2&&!_[_0xceb1('0xe')](_0x42b1a2)){if(!_[_0xceb1('0xd')](_0x85fcae)&&_0xceb1('0xf')===typeof _0x85fcae&&!_['isEmpty'](_0x85fcae)){return util['format']('\x22%s\x22\x20<%s>',_0x85fcae,_0x42b1a2);}return util[_0xceb1('0x10')](_0xceb1('0x11'),_0x42b1a2,_0x42b1a2);}if(!_['isUndefined'](_0x7b8bc6)&&_0xceb1('0xf')===typeof _0x7b8bc6&&!_[_0xceb1('0xe')](_0x7b8bc6)){return _0x7b8bc6;}return _0xceb1('0x12');};exports[_0xceb1('0x13')]=function(_0x1dd549){if(_[_0xceb1('0x14')](_0x1dd549)){return![];}return _0x1dd549;};exports[_0xceb1('0x15')]=function(_0x866a94,_0x37a821,_0x383c31,_0x4e23f4,_0x4d7d87,_0x5e0a29){var _0x44a591={'XMD-QUEUE':_0x37a821[_0xceb1('0x16')]?_0x37a821[_0xceb1('0x16')][_0xceb1('0x17')]:'','XMD-CALLERID':_0x4e23f4,'XMD-CALLERID-PREVIEW':_0x5e0a29?util[_0xceb1('0x10')](_0xceb1('0x11'),_0x5e0a29['calleridname'],_0x5e0a29[_0xceb1('0x18')]):_0x4e23f4,'XMD-DIALID':_0x4d7d87,'XMD-CONTACTID':_0x37a821[_0xceb1('0x19')],'XMD-CDRTYPE':_0xceb1('0x1a'),'CALLERID(all)':_0x4e23f4,'XMD-VOICEQUEUEID':_0x37a821[_0xceb1('0x1b')],'XMD-DIALCHANNEL':_0x383c31,'XMD-DIALTIMEOUT':_0x866a94[_0xceb1('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xceb1('0x10')](_0xceb1('0x1d'),_0x866a94[_0xceb1('0x1e')]?'g':'',_[_0xceb1('0xe')](_0x866a94[_0xceb1('0x1f')])?'':_0xceb1('0x20')),'XMD-DIALURL':_0x866a94['dialPreviewUrl']||'','XMD-AGI':_0x866a94[_0xceb1('0x21')]?util[_0xceb1('0x10')](_0xceb1('0x22'),ipAgi,_0x866a94['dialQueueProject']):_0xceb1('0x23'),'XMD-AGIAFTER':_0x866a94[_0xceb1('0x1e')]?util[_0xceb1('0x10')](_0xceb1('0x22'),ipAgi,_0x866a94[_0xceb1('0x1e')]):_0xceb1('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x5e0a29?_0x5e0a29[_0xceb1('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e0a29?_0x5e0a29[_0xceb1('0x25')]:'','XMD-DESTINATION':_0xceb1('0x26')};if(!_[_0xceb1('0xe')](_0x866a94['monitor_format'])){_0x44a591[util[_0xceb1('0x10')]('%s',_0xceb1('0x27'))]=_0x866a94[_0xceb1('0x1f')];_0x44a591[util[_0xceb1('0x10')]('%s',_0xceb1('0x28'))]=_0x4d7d87;}if(_0x37a821&&_0x37a821[_0xceb1('0x29')]){for(var _0x16b806 in _0x37a821[_0xceb1('0x29')]){if(_0x37a821[_0xceb1('0x29')]['hasOwnProperty'](_0x16b806)){if(!_['isNil'](_0x37a821[_0xceb1('0x29')][_0x16b806])&&_0x16b806!=='id'&&_0x16b806!=='tags'&&_0x16b806!==_0xceb1('0x2a')&&_0x16b806!==_0xceb1('0x2b')){_0x44a591[util[_0xceb1('0x10')]('%s%s','XMD-',_[_0xceb1('0x2c')](_0x16b806))]=_0x37a821[_0xceb1('0x29')][_0x16b806];}}}}return _0x44a591;};exports[_0xceb1('0x2d')]=function(_0xa652df){var _0x39d2ef={};for(var _0x25fa8e in _0xa652df){if(_0xa652df['hasOwnProperty'](_0x25fa8e)){_0x39d2ef[util[_0xceb1('0x10')]('%s',_[_0xceb1('0x2e')](_0x25fa8e))]=_0xa652df[_0x25fa8e];}}return{'variables':_0x39d2ef};};exports[_0xceb1('0x2f')]=function(_0x3f8a6a,_0x155586){if(!_[_0xceb1('0x14')](_0x3f8a6a)){if(_0x3f8a6a['hasOwnProperty']('originated')){if(_0x3f8a6a['originated']>0x0){_0x3f8a6a[_0xceb1('0x30')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x155586);}}}else{logger['error'](_0xceb1('0x31'),_0x155586);}};exports[_0xceb1('0x32')]=function(_0x4f1e73){var _0x2ca459=moment()[_0xceb1('0x10')](_0xceb1('0x33'));_0x4f1e73[_0xceb1('0x34')]=0xd;_0x4f1e73[_0xceb1('0x35')]=_0xceb1('0x36');_0x4f1e73[_0xceb1('0x37')]=_0x2ca459;_0x4f1e73[_0xceb1('0x38')]=_0x2ca459;_0x4f1e73[_0xceb1('0x39')]=_0x2ca459;};exports[_0xceb1('0x3a')]=function(_0x39f6d8,_0xd15f71,_0x227c6f){var _0x54323a=moment()[_0xceb1('0x10')](_0xceb1('0x33'));_0x39f6d8[_0xceb1('0x34')]=_0xd15f71;_0x39f6d8[_0xceb1('0x35')]=_0x227c6f;_0x39f6d8['responsetime']=_0x54323a;_0x39f6d8[_0xceb1('0x3b')]=getSeconds(_0x39f6d8['responsetime'],_0x39f6d8['starttime']);};exports['logLookAgent']=function(_0x184635,_0x3347c5,_0x21d1be){_0x184635[_0xceb1('0x3c')]=_0x3347c5;_0x184635[_0xceb1('0x3d')]=_0x21d1be;};exports['logCustomer']=function(_0x5e8b2b,_0x2c533c,_0x2bd0d4){var _0x554e3f=moment()['format'](_0xceb1('0x33'));_0x5e8b2b['state']=_0x2c533c;_0x5e8b2b['statedesc']=_0x2bd0d4;_0x5e8b2b[_0xceb1('0x38')]=_0x5e8b2b[_0xceb1('0x38')]?_0x5e8b2b[_0xceb1('0x38')]:_0x554e3f;_0x5e8b2b[_0xceb1('0x39')]=_0x5e8b2b[_0xceb1('0x39')]?_0x5e8b2b[_0xceb1('0x39')]:_0x554e3f;_0x5e8b2b[_0xceb1('0x3b')]=getSeconds(_0x5e8b2b[_0xceb1('0x38')]||0x0,_0x5e8b2b['starttime']||0x0);_0x5e8b2b['talktime']=_0x5e8b2b[_0xceb1('0x3e')]?getSeconds(_0x5e8b2b[_0xceb1('0x39')],_0x5e8b2b['answertime']):0x0;};exports[_0xceb1('0x3f')]=function(_0x1e4d31){return _0x1e4d31===_0xceb1('0x40');};exports['variablesAction']=function(_0x5b999a,_0x19c266,_0x2ca98f,_0x102863,_0x2c1b39){var _0x1b4181=_0x102863?_0xceb1('0x41'):_0x5b999a[_0xceb1('0x42')];_0x1b4181=_0x2c1b39?_0xceb1('0x43'):_0x1b4181;return{'actionid':_0x5b999a[_0xceb1('0x44')],'action':_0xceb1('0x45'),'channel':_0x5b999a['channelAgent'],'callerid':util[_0xceb1('0x10')](_0xceb1('0x11'),_0x1b4181,_0x5b999a['calleridnum']),'Exten':_0xceb1('0x26'),'Context':_0xceb1('0x46'),'Priority':'1','variable':_0x2ca98f,'timeout':(_0x19c266[_0xceb1('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b999a[_0xceb1('0x44')]};};exports[_0xceb1('0x48')]=function(_0x4ce803){return _0x4ce803['countbusyretry']+_0x4ce803[_0xceb1('0x49')]+_0x4ce803[_0xceb1('0x4a')]+_0x4ce803[_0xceb1('0x4b')]+_0x4ce803[_0xceb1('0x4c')];};exports[_0xceb1('0x4d')]=function(_0x1bf219){var _0x18d2b1=_[_0xceb1('0x4e')](_0x1bf219);_0x18d2b1[_0xceb1('0x34')]=0xf;_0x18d2b1[_0xceb1('0x35')]=_0xceb1('0x4f');return _0x18d2b1;};exports[_0xceb1('0x50')]=function(_0x3a2f76,_0x5c3b6c,_0x3e91b6){var _0x35091c={};_0x35091c[_0x5c3b6c]=_0x3a2f76[_0x5c3b6c];_0x35091c[_0xceb1('0x51')]=![];_0x35091c[_0xceb1('0x52')]=moment()[_0xceb1('0x53')](_0x3e91b6,'minutes')[_0xceb1('0x10')](_0xceb1('0x33'));_0x35091c['ContactId']=_0x3a2f76[_0xceb1('0x19')];_0x35091c[_0xceb1('0x54')]=_0x3a2f76[_0xceb1('0x54')];_0x35091c[_0xceb1('0x1b')]=_0x3a2f76[_0xceb1('0x1b')]||undefined;return _0x35091c;};exports[_0xceb1('0x55')]=function(_0x5ee096,_0x4e0a64){if(!_[_0xceb1('0x14')](_0x5ee096)){if(_0x5ee096['pTalking']>0x0){_0x5ee096[_0xceb1('0x56')]-=0x1;}else{logger[_0xceb1('0x7')](_0x4e0a64,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x4e0a64,_0xceb1('0x57'));}};exports[_0xceb1('0x58')]=function(_0x5a7657){if(_0x5a7657<=0x0){return!![];}return![];};exports[_0xceb1('0x59')]=function(_0x5bef59,_0x349d0c,_0x40cd1e){_0x5bef59[_0xceb1('0x5a')]=_0x349d0c;_0x5bef59[_0xceb1('0x17')]=_0x5bef59['queue'];_0x5bef59['interface']=_0x5bef59[_0xceb1('0x5b')];if(_0x40cd1e){_0x5bef59[_0xceb1('0x5c')]=_0x40cd1e[_0xceb1('0x5c')];}return _0x5bef59;};exports[_0xceb1('0x5d')]=function(_0xae4662){var _0x4e5c46={};_0x4e5c46[_0xceb1('0x5e')]=_0xae4662[_0xceb1('0x5e')];_0x4e5c46[_0xceb1('0x5f')]=_0xae4662[_0xceb1('0x5b')];_0x4e5c46[_0xceb1('0x44')]=_0xae4662[_0xceb1('0x44')];return _0x4e5c46;};exports[_0xceb1('0x60')]=function(_0x4d9da1){var _0x58bdaf=[];for(var _0x224728 in _0x4d9da1){if(_0x4d9da1[_0xceb1('0x61')](_0x224728)){if(!_['isNil'](_0x4d9da1[_0x224728])&&_0x4d9da1[_0x224728][_0xceb1('0x34')]===_0xceb1('0x62')&&_0x4d9da1[_0x224728][_0xceb1('0x63')]===_0xceb1('0x64')){_0x58bdaf[_0xceb1('0x65')](_0x4d9da1[_0x224728]['id']);}}}return _0x58bdaf;};exports[_0xceb1('0x66')]=function(_0x426d97){var _0x12feab=moment()[_0xceb1('0x5')](0x0);var _0x243d4d=moment(_0x426d97)[_0xceb1('0x5')](0x0);return _0x12feab[_0xceb1('0x67')](_0x243d4d,_0xceb1('0x6'));};exports[_0xceb1('0x68')]=function(_0x1a70e2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a70e2[_0xceb1('0x19')],'ListId':_0x1a70e2[_0xceb1('0x54')],'VoiceQueueId':_0x1a70e2[_0xceb1('0x1b')]||undefined,'CampaignId':_0x1a70e2[_0xceb1('0x69')]||undefined};};exports[_0xceb1('0x6a')]=function(_0x491bec){if(_0x491bec===_0xceb1('0x44')||_0x491bec===_0xceb1('0x6b')||_0x491bec===_0xceb1('0x5e')||_0x491bec===_0xceb1('0x6c')||_0x491bec===_0xceb1('0x6d')||_0x491bec===_0xceb1('0x6e')||_0x491bec===_0xceb1('0x3c')||_0x491bec===_0xceb1('0x5b')||_0x491bec==='calleridname'||_0x491bec==='active'||_0x491bec===_0xceb1('0x18')||_0x491bec===_0xceb1('0x52')||_0x491bec===_0xceb1('0x6f')||_0x491bec===_0xceb1('0x49')||_0x491bec===_0xceb1('0x4a')||_0x491bec==='countglobal'||_0x491bec==='callback'||_0x491bec===_0xceb1('0x70')||_0x491bec===_0xceb1('0x71')||_0x491bec===_0xceb1('0x72')||_0x491bec===_0xceb1('0x19')||_0x491bec===_0xceb1('0x54')||_0x491bec===_0xceb1('0x3d')||_0x491bec===_0xceb1('0x1b')||_0x491bec===_0xceb1('0x73')||_0x491bec==='xmd-voicequeueid'||_0x491bec==='xmd-queue'||_0x491bec===_0xceb1('0x74')||_0x491bec==='xmd-listid'||_0x491bec===_0xceb1('0x75')||_0x491bec==='xmd-dialtimeout'||_0x491bec===_0xceb1('0x76')||_0x491bec==='xmd-dialid'||_0x491bec===_0xceb1('0x77')||_0x491bec===_0xceb1('0x78')||_0x491bec===_0xceb1('0x79')||_0x491bec===_0xceb1('0x7a')||_0x491bec===_0xceb1('0x7b')||_0x491bec===_0xceb1('0x7c')||_0x491bec===_0xceb1('0x7d')||_0x491bec===_0xceb1('0x7e')||_0x491bec===_0xceb1('0x7f')||_0x491bec===_0xceb1('0x80')||_0x491bec==='rtpaudioqosloss'||_0x491bec==='rtpaudioqoslossbridged'||_0x491bec===_0xceb1('0x81')||_0x491bec==='rtpaudioqosrttbridged'||_0x491bec===_0xceb1('0x7d')||_0x491bec===_0xceb1('0x7e')||_0x491bec==='rtpaudioqosjitter'||_0x491bec==='rtpaudioqosjitterbridged'||_0x491bec==='rtpaudioqosloss'||_0x491bec==='rtpaudioqoslossbridged'||_0x491bec===_0xceb1('0x81')||_0x491bec===_0xceb1('0x82')||_0x491bec===_0xceb1('0x83')||_0x491bec===_0xceb1('0x84')||_0x491bec==='state'||_0x491bec===_0xceb1('0x35')){return![];}return!![];};exports[_0xceb1('0x85')]=function(_0x176a88,_0x3e7ca4){var _0x2822e0,_0x289312,_0x2679d5;if(_0x3e7ca4<=0x0){_0x3e7ca4=0x1;}_0x2822e0=new RegExp(_0xceb1('0x86')+_0x3e7ca4+'}$');_0x289312=Math[_0xceb1('0x87')](0xa,_0x3e7ca4-0x1);_0x2679d5=Math['pow'](0xa,_0x3e7ca4)-0x1;return util[_0xceb1('0x10')]('%s',_[_0xceb1('0x88')](_0x176a88,_0x2822e0,_[_0xceb1('0x89')](_0x289312,_0x2679d5)));};exports[_0xceb1('0x8a')]=function(_0x2da5d6){var _0x48d9f0=_0x2da5d6[_0xceb1('0x8b')](/"(.*?)"/);return _0x48d9f0?_0x48d9f0[0x1]:_0x2da5d6;};exports['extractCalleridNumber']=function(_0x1ce1b3){var _0x48409b=_0x1ce1b3['match'](/<(.*?)>/);return _0x48409b?_0x48409b[0x1]:_0x1ce1b3;}; \ No newline at end of file +var _0x9418=['lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','status','getDiff','diff','seconds','ListId','CampaignId','idContact','type','campaigntype','membername','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLower','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','endtime','logAgent','state','statedesc','responsetime','ringtime','logLookAgent','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj'];(function(_0xe9dabe,_0x3ea0ea){var _0x2695f3=function(_0x1d0bc9){while(--_0x1d0bc9){_0xe9dabe['push'](_0xe9dabe['shift']());}};_0x2695f3(++_0x3ea0ea);}(_0x9418,0x1c5));var _0x8941=function(_0x3480f2,_0x4947fa){_0x3480f2=_0x3480f2-0x0;var _0x1e4899=_0x9418[_0x3480f2];return _0x1e4899;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var logger=require(_0x8941('0x0'))(_0x8941('0x1'));var ipAgi=process[_0x8941('0x2')][_0x8941('0x3')]||_0x8941('0x4');function getSeconds(_0x237126,_0x276267){var _0x3bf0af=moment(_0x237126)['milliseconds'](0x0);var _0xb0e82e=moment(_0x276267)[_0x8941('0x5')](0x0);return _0x3bf0af['diff'](_0xb0e82e,'seconds');}exports[_0x8941('0x6')]=function(_0x5426a4){return function(_0x155eb3){logger[_0x8941('0x7')](_0x5426a4,util[_0x8941('0x8')](_0x155eb3,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2eb9af,_0x4cc062){logger[_0x8941('0x9')](_0x2eb9af,util['inspect'](_0x4cc062,{'showHidden':![],'depth':null}));};exports[_0x8941('0xa')]=function(_0x3d5d79,_0x14da3d){logger[_0x8941('0x7')](_0x3d5d79,util['inspect'](_0x14da3d,{'showHidden':![],'depth':null}));};exports[_0x8941('0xb')]=function(_0x4e8b0b){return function(_0x2ea465){logger['info'](_0x4e8b0b,util['inspect'](_0x2ea465,{'showHidden':![],'depth':null}));};};exports[_0x8941('0xc')]=function(_0x44cdf5,_0x3f6438,_0x2e085c){return{'message':_0x44cdf5,'unlock':_0x3f6438,'active':_0x2e085c};};exports[_0x8941('0xd')]=function(_0x87363c,_0x2f7909,_0x36d4b4){if(!_[_0x8941('0xe')](_0x36d4b4)&&_0x8941('0xf')===typeof _0x36d4b4&&!_[_0x8941('0x10')](_0x36d4b4)){if(!_[_0x8941('0xe')](_0x2f7909)&&_0x8941('0xf')===typeof _0x2f7909&&!_[_0x8941('0x10')](_0x2f7909)){return util[_0x8941('0x11')](_0x8941('0x12'),_0x2f7909,_0x36d4b4);}return util[_0x8941('0x11')](_0x8941('0x12'),_0x36d4b4,_0x36d4b4);}if(!_[_0x8941('0xe')](_0x87363c)&&'string'===typeof _0x87363c&&!_[_0x8941('0x10')](_0x87363c)){return _0x87363c;}return _0x8941('0x13');};exports[_0x8941('0x14')]=function(_0x7b9416){if(_[_0x8941('0x15')](_0x7b9416)){return![];}return _0x7b9416;};exports['addVariables']=function(_0x55c488,_0x58479c,_0x34b0b7,_0x25b462,_0x318d84,_0x30fc9b){var _0x3275e8={'XMD-QUEUE':_0x58479c[_0x8941('0x16')]?_0x58479c[_0x8941('0x16')][_0x8941('0x17')]:'','XMD-CALLERID':_0x25b462,'XMD-CALLERID-PREVIEW':_0x30fc9b?util[_0x8941('0x11')]('\x22%s\x22\x20<%s>',_0x30fc9b[_0x8941('0x18')],_0x30fc9b[_0x8941('0x19')]):_0x25b462,'XMD-DIALID':_0x318d84,'XMD-CONTACTID':_0x58479c[_0x8941('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x25b462,'XMD-VOICEQUEUEID':_0x58479c[_0x8941('0x1b')],'XMD-DIALCHANNEL':_0x34b0b7,'XMD-DIALTIMEOUT':_0x55c488['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x8941('0x1c'),_0x55c488[_0x8941('0x1d')]?'g':'',_[_0x8941('0x10')](_0x55c488[_0x8941('0x1e')])?'':_0x8941('0x1f')),'XMD-DIALURL':_0x55c488[_0x8941('0x20')]||'','XMD-AGI':_0x55c488[_0x8941('0x21')]?util[_0x8941('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x55c488[_0x8941('0x21')]):'NONE','XMD-AGIAFTER':_0x55c488[_0x8941('0x1d')]?util[_0x8941('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x55c488['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x30fc9b?_0x30fc9b[_0x8941('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x30fc9b?_0x30fc9b[_0x8941('0x23')]:'','XMD-DESTINATION':_0x8941('0x24')};if(!_[_0x8941('0x10')](_0x55c488['monitor_format'])){_0x3275e8[util['format']('%s',_0x8941('0x25'))]=_0x55c488['monitor_format'];_0x3275e8[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x318d84;}if(_0x58479c&&_0x58479c[_0x8941('0x26')]){for(var _0x12c1fb in _0x58479c[_0x8941('0x26')]){if(_0x58479c[_0x8941('0x26')][_0x8941('0x27')](_0x12c1fb)){if(!_[_0x8941('0x15')](_0x58479c[_0x8941('0x26')][_0x12c1fb])&&_0x12c1fb!=='id'&&_0x12c1fb!==_0x8941('0x28')&&_0x12c1fb!==_0x8941('0x29')&&_0x12c1fb!==_0x8941('0x2a')){_0x3275e8[util[_0x8941('0x11')](_0x8941('0x2b'),'XMD-',_[_0x8941('0x2c')](_0x12c1fb))]=_0x58479c[_0x8941('0x26')][_0x12c1fb];}}}}return _0x3275e8;};exports['toLowerVariables']=function(_0x79f056){var _0x4f5fd2={};for(var _0x4a0df0 in _0x79f056){if(_0x79f056['hasOwnProperty'](_0x4a0df0)){_0x4f5fd2[util[_0x8941('0x11')]('%s',_[_0x8941('0x2d')](_0x4a0df0))]=_0x79f056[_0x4a0df0];}}return{'variables':_0x4f5fd2};};exports['updateOriginated']=function(_0xb5f1e9,_0x5f3a0b){if(!_[_0x8941('0x15')](_0xb5f1e9)){if(_0xb5f1e9[_0x8941('0x27')]('originated')){if(_0xb5f1e9[_0x8941('0x2e')]>0x0){_0xb5f1e9[_0x8941('0x2e')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5f3a0b);}}}else{logger[_0x8941('0x7')](_0x8941('0x2f'),_0x5f3a0b);}};exports[_0x8941('0x30')]=function(_0x4bf3ed){var _0x22fc3f=moment()[_0x8941('0x11')](_0x8941('0x31'));_0x4bf3ed['state']=0xd;_0x4bf3ed['statedesc']=_0x8941('0x32');_0x4bf3ed[_0x8941('0x33')]=_0x22fc3f;_0x4bf3ed['responsetime']=_0x22fc3f;_0x4bf3ed[_0x8941('0x34')]=_0x22fc3f;};exports[_0x8941('0x35')]=function(_0x3b3407,_0x4b9e3c,_0x278e9a){var _0x4698d6=moment()['format'](_0x8941('0x31'));_0x3b3407[_0x8941('0x36')]=_0x4b9e3c;_0x3b3407[_0x8941('0x37')]=_0x278e9a;_0x3b3407[_0x8941('0x38')]=_0x4698d6;_0x3b3407[_0x8941('0x39')]=getSeconds(_0x3b3407[_0x8941('0x38')],_0x3b3407[_0x8941('0x33')]);};exports[_0x8941('0x3a')]=function(_0x284143,_0x30400a,_0xc365d4){_0x284143['membername']=_0x30400a;_0x284143['UserId']=_0xc365d4;};exports['logCustomer']=function(_0x518ef9,_0x19b7af,_0x10107a){var _0x5a9a47=moment()['format'](_0x8941('0x31'));_0x518ef9[_0x8941('0x36')]=_0x19b7af;_0x518ef9['statedesc']=_0x10107a;_0x518ef9[_0x8941('0x38')]=_0x518ef9[_0x8941('0x38')]?_0x518ef9['responsetime']:_0x5a9a47;_0x518ef9[_0x8941('0x34')]=_0x518ef9[_0x8941('0x34')]?_0x518ef9['endtime']:_0x5a9a47;_0x518ef9[_0x8941('0x39')]=getSeconds(_0x518ef9['responsetime']||0x0,_0x518ef9[_0x8941('0x33')]||0x0);_0x518ef9[_0x8941('0x3b')]=_0x518ef9[_0x8941('0x3c')]?getSeconds(_0x518ef9[_0x8941('0x34')],_0x518ef9[_0x8941('0x3c')]):0x0;};exports[_0x8941('0x3d')]=function(_0x18374c){return _0x18374c===_0x8941('0x3e');};exports[_0x8941('0x3f')]=function(_0x21dcb4,_0x59a6c0,_0x387ab8,_0x5088d2,_0x39af69){var _0x1cf4a2=_0x5088d2?'RECALL':_0x21dcb4[_0x8941('0x18')];_0x1cf4a2=_0x39af69?_0x8941('0x40'):_0x1cf4a2;return{'actionid':_0x21dcb4['uniqueid'],'action':_0x8941('0x41'),'channel':_0x21dcb4[_0x8941('0x42')],'callerid':util[_0x8941('0x11')]('\x22%s\x22\x20<%s>',_0x1cf4a2,_0x21dcb4[_0x8941('0x19')]),'Exten':_0x8941('0x24'),'Context':_0x8941('0x43'),'Priority':'1','variable':_0x387ab8,'timeout':(_0x59a6c0[_0x8941('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x21dcb4[_0x8941('0x45')]};};exports[_0x8941('0x46')]=function(_0x1fd427){return _0x1fd427[_0x8941('0x47')]+_0x1fd427[_0x8941('0x48')]+_0x1fd427['countnoanswerretry']+_0x1fd427[_0x8941('0x49')]+_0x1fd427[_0x8941('0x4a')];};exports[_0x8941('0x4b')]=function(_0x451cdd){var _0x5f3fcd=_[_0x8941('0x4c')](_0x451cdd);_0x5f3fcd[_0x8941('0x36')]=0xf;_0x5f3fcd[_0x8941('0x37')]='Global';return _0x5f3fcd;};exports['scheduledAt']=function(_0x476be8,_0x22847b,_0x1f4f58){var _0x484022={};_0x484022[_0x22847b]=_0x476be8[_0x22847b];_0x484022[_0x8941('0x4d')]=![];_0x484022[_0x8941('0x4e')]=moment()[_0x8941('0x4f')](_0x1f4f58,_0x8941('0x50'))[_0x8941('0x11')](_0x8941('0x31'));_0x484022[_0x8941('0x1a')]=_0x476be8[_0x8941('0x1a')];_0x484022['ListId']=_0x476be8['ListId'];_0x484022[_0x8941('0x1b')]=_0x476be8[_0x8941('0x1b')]||undefined;return _0x484022;};exports[_0x8941('0x51')]=function(_0x10b421,_0x2de54b){if(!_['isNil'](_0x10b421)){if(_0x10b421[_0x8941('0x52')]>0x0){_0x10b421[_0x8941('0x52')]-=0x1;}else{logger[_0x8941('0x7')](_0x2de54b,_0x8941('0x53'));}}else{logger[_0x8941('0x7')](_0x2de54b,_0x8941('0x54'));}};exports[_0x8941('0x55')]=function(_0x4a4dbd){if(_0x4a4dbd<=0x0){return!![];}return![];};exports[_0x8941('0x56')]=function(_0x1414fd,_0x535a2d,_0x486309){_0x1414fd[_0x8941('0x57')]=_0x535a2d;_0x1414fd[_0x8941('0x17')]=_0x1414fd[_0x8941('0x58')];_0x1414fd[_0x8941('0x59')]=_0x1414fd[_0x8941('0x42')];if(_0x486309){_0x1414fd[_0x8941('0x5a')]=_0x486309[_0x8941('0x5a')];}return _0x1414fd;};exports[_0x8941('0x5b')]=function(_0x5d4dfb){var _0x3474bb={};_0x3474bb[_0x8941('0x58')]=_0x5d4dfb[_0x8941('0x58')];_0x3474bb[_0x8941('0x59')]=_0x5d4dfb[_0x8941('0x42')];_0x3474bb[_0x8941('0x45')]=_0x5d4dfb[_0x8941('0x45')];return _0x3474bb;};exports[_0x8941('0x5c')]=function(_0xec8fe9){var _0x2312df=[];for(var _0x32c64e in _0xec8fe9){if(_0xec8fe9[_0x8941('0x27')](_0x32c64e)){if(!_[_0x8941('0x15')](_0xec8fe9[_0x32c64e])&&_0xec8fe9[_0x32c64e]['state']==='not_inuse'&&_0xec8fe9[_0x32c64e][_0x8941('0x5d')]==='reachable'){_0x2312df['push'](_0xec8fe9[_0x32c64e]['id']);}}}return _0x2312df;};exports[_0x8941('0x5e')]=function(_0x3f0b5a){var _0x3e47c0=moment()[_0x8941('0x5')](0x0);var _0xb06174=moment(_0x3f0b5a)[_0x8941('0x5')](0x0);return _0x3e47c0[_0x8941('0x5f')](_0xb06174,_0x8941('0x60'));};exports['createBody']=function(_0x113f44){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x113f44[_0x8941('0x1a')],'ListId':_0x113f44[_0x8941('0x61')],'VoiceQueueId':_0x113f44[_0x8941('0x1b')]||undefined,'CampaignId':_0x113f44[_0x8941('0x62')]||undefined};};exports['filterKey']=function(_0x3d5a0c){if(_0x3d5a0c===_0x8941('0x45')||_0x3d5a0c===_0x8941('0x63')||_0x3d5a0c===_0x8941('0x58')||_0x3d5a0c===_0x8941('0x64')||_0x3d5a0c===_0x8941('0x65')||_0x3d5a0c==='dialAnswer'||_0x3d5a0c===_0x8941('0x66')||_0x3d5a0c===_0x8941('0x42')||_0x3d5a0c===_0x8941('0x18')||_0x3d5a0c===_0x8941('0x4d')||_0x3d5a0c===_0x8941('0x19')||_0x3d5a0c===_0x8941('0x4e')||_0x3d5a0c==='countbusyretry'||_0x3d5a0c==='countcongestionretry'||_0x3d5a0c===_0x8941('0x67')||_0x3d5a0c===_0x8941('0x68')||_0x3d5a0c==='callback'||_0x3d5a0c===_0x8941('0x69')||_0x3d5a0c===_0x8941('0x6a')||_0x3d5a0c===_0x8941('0x6b')||_0x3d5a0c==='ContactId'||_0x3d5a0c==='ListId'||_0x3d5a0c==='UserId'||_0x3d5a0c===_0x8941('0x1b')||_0x3d5a0c===_0x8941('0x6c')||_0x3d5a0c==='xmd-voicequeueid'||_0x3d5a0c===_0x8941('0x6d')||_0x3d5a0c==='xmd-phone'||_0x3d5a0c===_0x8941('0x6e')||_0x3d5a0c==='xmd-dialurl'||_0x3d5a0c===_0x8941('0x6f')||_0x3d5a0c===_0x8941('0x70')||_0x3d5a0c==='xmd-dialid'||_0x3d5a0c===_0x8941('0x71')||_0x3d5a0c===_0x8941('0x72')||_0x3d5a0c===_0x8941('0x73')||_0x3d5a0c===_0x8941('0x74')||_0x3d5a0c===_0x8941('0x75')||_0x3d5a0c===_0x8941('0x76')||_0x3d5a0c===_0x8941('0x77')||_0x3d5a0c===_0x8941('0x78')||_0x3d5a0c===_0x8941('0x79')||_0x3d5a0c===_0x8941('0x7a')||_0x3d5a0c===_0x8941('0x7b')||_0x3d5a0c==='rtpaudioqoslossbridged'||_0x3d5a0c===_0x8941('0x7c')||_0x3d5a0c==='rtpaudioqosrttbridged'||_0x3d5a0c==='rtpaudioqos'||_0x3d5a0c==='rtpaudioqosbridged'||_0x3d5a0c==='rtpaudioqosjitter'||_0x3d5a0c===_0x8941('0x7a')||_0x3d5a0c==='rtpaudioqosloss'||_0x3d5a0c===_0x8941('0x7d')||_0x3d5a0c==='rtpaudioqosrtt'||_0x3d5a0c===_0x8941('0x7e')||_0x3d5a0c===_0x8941('0x7f')||_0x3d5a0c==='bridgepvtcallid'||_0x3d5a0c===_0x8941('0x36')||_0x3d5a0c===_0x8941('0x37')){return![];}return!![];};exports[_0x8941('0x80')]=function(_0x2b2cc7,_0x1d31e6){var _0x10bb1e,_0x316824,_0x104785;if(_0x1d31e6<=0x0){_0x1d31e6=0x1;}_0x10bb1e=new RegExp(_0x8941('0x81')+_0x1d31e6+'}$');_0x316824=Math['pow'](0xa,_0x1d31e6-0x1);_0x104785=Math[_0x8941('0x82')](0xa,_0x1d31e6)-0x1;return util['format']('%s',_[_0x8941('0x83')](_0x2b2cc7,_0x10bb1e,_[_0x8941('0x84')](_0x316824,_0x104785)));};exports['extractCalleridName']=function(_0x2732b6){var _0x36e148=_0x2732b6[_0x8941('0x85')](/"(.*?)"/);return _0x36e148?_0x36e148[0x1]:_0x2732b6;};exports[_0x8941('0x86')]=function(_0x5ec1cb){var _0xf77609=_0x5ec1cb[_0x8941('0x85')](/<(.*?)>/);return _0xf77609?_0xf77609[0x1]:_0x5ec1cb;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 44e9acc..d732619 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 _0x82f1=['reload','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean'];(function(_0x22362d,_0x175424){var _0x3c2a26=function(_0x5183d5){while(--_0x5183d5){_0x22362d['push'](_0x22362d['shift']());}};_0x3c2a26(++_0x175424);}(_0x82f1,0xd5));var _0x182f=function(_0x1c861d,_0x5922fa){_0x1c861d=_0x1c861d-0x0;var _0x5ea782=_0x82f1[_0x1c861d];return _0x5ea782;};'use strict';exports[_0x182f('0x0')]={'queue':{'type':_0x182f('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x182f('0x1'),'required':!![]},'interface':{'type':_0x182f('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x182f('0x1'),'required':!![]},'paused':{'type':_0x182f('0x2')},'reason':{'type':_0x182f('0x1'),'required':![]}};exports[_0x182f('0x3')]={'module':{'type':_0x182f('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x182f('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x182f('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x182f('0x1')},'mixmonitorid':{'type':_0x182f('0x1')}};exports[_0x182f('0x4')]={'uniqueid':{'type':_0x182f('0x1'),'required':!![]}};exports[_0x182f('0x5')]={'uniqueid':{'type':_0x182f('0x1'),'required':!![]},'exten':{'type':_0x182f('0x1'),'required':!![]},'context':{'type':_0x182f('0x1')}}; \ No newline at end of file +var _0x2b97=['voicechannel','voicequeuechannelhangup','queueadd','string','boolean','queueremove','reload'];(function(_0x131af6,_0x503b31){var _0x4b679b=function(_0x427391){while(--_0x427391){_0x131af6['push'](_0x131af6['shift']());}};_0x4b679b(++_0x503b31);}(_0x2b97,0x13d));var _0x72b9=function(_0x41e798,_0x2448ba){_0x41e798=_0x41e798-0x0;var _0x35d3d8=_0x2b97[_0x41e798];return _0x35d3d8;};'use strict';exports[_0x72b9('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x72b9('0x1'),'required':!![]},'membername':{'type':_0x72b9('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x72b9('0x2'),'required':![]}};exports[_0x72b9('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x72b9('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x72b9('0x1'),'required':!![]},'paused':{'type':_0x72b9('0x2')},'reason':{'type':_0x72b9('0x1'),'required':![]}};exports[_0x72b9('0x4')]={'module':{'type':_0x72b9('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x72b9('0x1'),'required':!![]}};exports[_0x72b9('0x5')]={'uniqueid':{'type':_0x72b9('0x1'),'required':!![]},'filename':{'type':_0x72b9('0x1')},'format':{'type':_0x72b9('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x72b9('0x6')]={'uniqueid':{'type':_0x72b9('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x72b9('0x1'),'required':!![]},'exten':{'type':_0x72b9('0x1'),'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 425731b..bc43c69 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 _0x84dd=['queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','sumHoldTime','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','name','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','voiceQueues','initTriggers','triggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds'];(function(_0x8e3507,_0x7c734c){var _0x48c52b=function(_0x51225f){while(--_0x51225f){_0x8e3507['push'](_0x8e3507['shift']());}};_0x48c52b(++_0x7c734c);}(_0x84dd,0xe8));var _0xd84d=function(_0x240da9,_0x5daa78){_0x240da9=_0x240da9-0x0;var _0x4b21ab=_0x84dd[_0x240da9];return _0x4b21ab;};'use strict';var BPromise=require(_0xd84d('0x0'));var util=require(_0xd84d('0x1'));var _=require(_0xd84d('0x2'));var moment=require(_0xd84d('0x3'));var Agent=require(_0xd84d('0x4'));var Telephone=require(_0xd84d('0x5'));var Trunk=require(_0xd84d('0x6'));var VoiceQueue=require(_0xd84d('0x7'));var Trigger=require(_0xd84d('0x8'));var Template=require(_0xd84d('0x9'));var Campaign=require(_0xd84d('0xa'));var VoiceExtension=require(_0xd84d('0xb'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xd84d('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xd84d('0xd'));var Dynamics365Account=require(_0xd84d('0xe'));var FreshsalesAccount=require(_0xd84d('0xf'));var FaxAccount=require(_0xd84d('0x10'));var Realtime=function(){this[_0xd84d('0x11')]={};this[_0xd84d('0x12')]={};this[_0xd84d('0x13')]={};this['voiceQueues']={};this['triggers']={};this[_0xd84d('0x14')]={};this[_0xd84d('0x15')]={};this[_0xd84d('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd84d('0x17')]={};this[_0xd84d('0x18')]={};this[_0xd84d('0x19')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this[_0xd84d('0x1a')]={};this[_0xd84d('0x1b')]={};this[_0xd84d('0x1c')]={};this[_0xd84d('0x1d')]={};this[_0xd84d('0x1e')]={};this['deskAccounts']={};this[_0xd84d('0x1f')]={};this['servicenowAccounts']={};this[_0xd84d('0x20')]={};this[_0xd84d('0x21')]={};this[_0xd84d('0x22')]={};};function freeIsNotKey(_0x26b842,_0x14ef75,_0x2a9752){var _0x5bd8db=_[_0xd84d('0x23')](_0x26b842,function(_0x4a8ad4,_0x42cd10){return _0x4a8ad4[_0x2a9752];});for(var _0x4af199 in _0x14ef75){if(_0x14ef75['hasOwnProperty'](_0x4af199)){if(!_0x5bd8db[_0x4af199]){delete _0x14ef75[_0x4af199];}}}}function freeIsNotKeySip(_0x11eed5,_0x13483b){var _0x431bf3=_[_0xd84d('0x23')](_0x11eed5,function(_0x449e52,_0x328502){return util[_0xd84d('0x24')](_0xd84d('0x25'),_0x449e52['name']);});for(var _0x560aba in _0x13483b){if(_0x13483b[_0xd84d('0x26')](_0x560aba)){if(!_0x431bf3[_0x560aba]){delete _0x13483b[_0x560aba];}}}}function freeIsNotKeyAgent(_0x235506,_0x2d941a){var _0x5294f1=_[_0xd84d('0x23')](_0x235506,function(_0x3638d2,_0x381a4d){var _0x248846=_[_0xd84d('0x27')](_0x3638d2[_0xd84d('0x28')])?util[_0xd84d('0x24')]('SIP/%s',_0x3638d2[_0xd84d('0x29')]):_0x3638d2['interface'];return _0x248846;});for(var _0x11fb4f in _0x2d941a){if(_0x2d941a[_0xd84d('0x26')](_0x11fb4f)){if(!_0x5294f1[_0x11fb4f]){delete _0x2d941a[_0x11fb4f];}}}}function clearVoiceCallReports(_0x3af8de){_0x3af8de[_0xd84d('0x2a')]=0x0;_0x3af8de[_0xd84d('0x2b')]=0x0;_0x3af8de['sumHoldTime']=0x0;_0x3af8de[_0xd84d('0x2c')]=0x0;_0x3af8de[_0xd84d('0x2d')]=0x0;}function clearCampaigns(_0x2c7bf6){if(!_[_0xd84d('0x2e')](_0x2c7bf6)){for(var _0x13658a in _0x2c7bf6){if(_0x2c7bf6[_0xd84d('0x26')](_0x13658a)){_0x2c7bf6[_0x13658a][_0xd84d('0x2f')]=0x0;_0x2c7bf6[_0x13658a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1375da){if(!_['isEmpty'](_0x1375da)){for(var _0x31e60c in _0x1375da){if(_0x1375da['hasOwnProperty'](_0x31e60c)){_0x1375da[_0x31e60c]['total']=0x0;_0x1375da[_0x31e60c][_0xd84d('0x2b')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x30')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x31')]=0x0;_0x1375da[_0x31e60c]['sumHoldTime']=0x0;_0x1375da[_0x31e60c][_0xd84d('0x2c')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x2d')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x32')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x33')]=0x0;_0x1375da[_0x31e60c]['outboundBusyCallsDay']=0x0;_0x1375da[_0x31e60c]['outboundCongestionCallsDay']=0x0;_0x1375da[_0x31e60c][_0xd84d('0x34')]=0x0;_0x1375da[_0x31e60c]['outboundUnknownCallsDay']=0x0;_0x1375da[_0x31e60c][_0xd84d('0x35')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x36')]=0x0;_0x1375da[_0x31e60c]['outboundBlacklistCallsDay']=0x0;_0x1375da[_0x31e60c]['outboundOriginateFailureCallsDay']=0x0;_0x1375da[_0x31e60c][_0xd84d('0x37')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x38')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x32')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x39')]=0x0;_0x1375da[_0x31e60c][_0xd84d('0x3a')]=!![];}}}}Realtime[_0xd84d('0x3b')][_0xd84d('0x3c')]=function(_0x28d225,_0x5e89e5){for(var _0x21a2ea in _0x5e89e5){if(_0x28d225[_0xd84d('0x26')](_0x21a2ea)){_0x28d225[_0x21a2ea]=_0x5e89e5[_0x21a2ea];}}};Realtime[_0xd84d('0x3b')][_0xd84d('0x3d')]=function(){var _0x2afebd=this;return function(_0x347c04){if(_0x347c04){freeIsNotKeyAgent(_0x347c04,_0x2afebd[_0xd84d('0x11')]);for(var _0x25295a=0x0,_0x450b5d={},_0x167fd2={};_0x25295a<_0x347c04[_0xd84d('0x3e')];_0x25295a+=0x1){_0x450b5d=_0x347c04[_0x25295a];var _0x13c2da=_[_0xd84d('0x27')](_0x450b5d[_0xd84d('0x28')])?util[_0xd84d('0x24')]('SIP/%s',_0x450b5d['name']):_0x450b5d['interface'];if(_[_0xd84d('0x3f')](_0x2afebd[_0xd84d('0x11')][_0x13c2da])){_0x2afebd[_0xd84d('0x11')][_0x13c2da]=new Agent(_0x450b5d);}else{_0x2afebd[_0xd84d('0x3c')](_0x2afebd[_0xd84d('0x11')][_0x13c2da],_0x450b5d);}}}return _0x2afebd['agents'];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x40')]=function(){var _0x8c99ad=this;return function(_0x3e5245){if(_0x3e5245){freeIsNotKeySip(_0x3e5245,_0x8c99ad['telephones']);for(var _0x3a8647=0x0,_0x3511d3={},_0x52ff62={};_0x3a8647<_0x3e5245[_0xd84d('0x3e')];_0x3a8647+=0x1){_0x3511d3=_0x3e5245[_0x3a8647];if(_[_0xd84d('0x3f')](_0x8c99ad['telephones'][util['format'](_0xd84d('0x25'),_0x3511d3[_0xd84d('0x29')])])){_0x8c99ad[_0xd84d('0x12')][util[_0xd84d('0x24')](_0xd84d('0x25'),_0x3511d3[_0xd84d('0x29')])]=new Telephone(_0x3511d3);}else{_0x8c99ad[_0xd84d('0x3c')](_0x8c99ad['telephones'][util[_0xd84d('0x24')]('SIP/%s',_0x3511d3[_0xd84d('0x29')])],_0x3511d3);}}}return _0x8c99ad[_0xd84d('0x12')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x41')]=function(){var _0x119ea7=this;return function(_0x2ba65c){if(_0x2ba65c){freeIsNotKeySip(_0x2ba65c,_0x119ea7[_0xd84d('0x13')]);for(var _0x53eee0=0x0,_0x578eb1={},_0x1655ee={};_0x53eee0<_0x2ba65c[_0xd84d('0x3e')];_0x53eee0+=0x1){_0x578eb1=_0x2ba65c[_0x53eee0];if(_['isUndefined'](_0x119ea7['trunks'][util[_0xd84d('0x24')](_0xd84d('0x25'),_0x578eb1['name'])])){_0x119ea7[_0xd84d('0x13')][util[_0xd84d('0x24')]('SIP/%s',_0x578eb1[_0xd84d('0x29')])]=new Trunk(_0x578eb1);}else{_0x119ea7['mergeFromDatabase'](_0x119ea7[_0xd84d('0x13')][util[_0xd84d('0x24')](_0xd84d('0x25'),_0x578eb1[_0xd84d('0x29')])],_0x578eb1);}}}return _0x119ea7[_0xd84d('0x13')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x14c41c=this;return function(_0x356eb5){if(_0x356eb5){freeIsNotKey(_0x356eb5,_0x14c41c[_0xd84d('0x42')],_0xd84d('0x29'));for(var _0x24b74c=0x0,_0x2281e4={},_0x42dec4={};_0x24b74c<_0x356eb5[_0xd84d('0x3e')];_0x24b74c+=0x1){_0x2281e4=_0x356eb5[_0x24b74c];if(_[_0xd84d('0x3f')](_0x14c41c[_0xd84d('0x42')][_0x2281e4['name']])){_0x14c41c[_0xd84d('0x42')][_0x2281e4[_0xd84d('0x29')]]=new VoiceQueue(_0x2281e4);}else{_0x14c41c['mergeFromDatabase'](_0x14c41c[_0xd84d('0x42')][_0x2281e4[_0xd84d('0x29')]],_0x2281e4);}}}return _0x14c41c[_0xd84d('0x42')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x43')]=function(){var _0xcb7ec4=this;return function(_0x6ef633){if(_0x6ef633){freeIsNotKey(_0x6ef633,_0xcb7ec4[_0xd84d('0x44')],'id');for(var _0x17665b=0x0,_0x3aed20={},_0x259748={};_0x17665b<_0x6ef633[_0xd84d('0x3e')];_0x17665b+=0x1){_0x3aed20=_0x6ef633[_0x17665b];if(_[_0xd84d('0x3f')](_0xcb7ec4['triggers'][_0x3aed20['id']])){_0xcb7ec4['triggers'][_0x3aed20['id']]=new Trigger(_0x3aed20);}else{_0xcb7ec4['mergeFromDatabase'](_0xcb7ec4[_0xd84d('0x44')][_0x3aed20['id']],_0x3aed20);}}}return _0xcb7ec4['triggers'];};};Realtime['prototype']['initTemplates']=function(){var _0x41b425=this;return function(_0x2b702c){if(_0x2b702c){freeIsNotKey(_0x2b702c,_0x41b425['templates'],'id');for(var _0x46f0f9=0x0,_0x141509={},_0x7a1da6={};_0x46f0f9<_0x2b702c['length'];_0x46f0f9+=0x1){_0x141509=_0x2b702c[_0x46f0f9];if(_['isUndefined'](_0x41b425[_0xd84d('0x15')][_0x141509['id']])){_0x41b425[_0xd84d('0x15')][_0x141509['id']]=new Template(_0x141509);}else{_0x41b425[_0xd84d('0x3c')](_0x41b425['templates'][_0x141509['id']],_0x141509);}}}return _0x41b425[_0xd84d('0x15')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x45')]=function(){var _0x604a74=this;return function(_0x40bd3c){if(_0x40bd3c){freeIsNotKey(_0x40bd3c,_0x604a74[_0xd84d('0x1a')],'id');for(var _0x1ac887=0x0,_0x46ec98={},_0x3fc080={};_0x1ac887<_0x40bd3c[_0xd84d('0x3e')];_0x1ac887+=0x1){_0x46ec98=_0x40bd3c[_0x1ac887];if(_[_0xd84d('0x3f')](_0x604a74[_0xd84d('0x1a')][_0x46ec98['id']])){_0x604a74[_0xd84d('0x1a')][_0x46ec98['id']]=new ZendeskAccount(_0x46ec98);}else{_0x604a74[_0xd84d('0x3c')](_0x604a74[_0xd84d('0x1a')][_0x46ec98['id']],_0x46ec98);}}}return _0x604a74['zendeskAccounts'];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x46')]=function(){var _0x5bce0a=this;return function(_0x101e79){if(_0x101e79){freeIsNotKey(_0x101e79,_0x5bce0a[_0xd84d('0x1b')],'id');for(var _0x3d41d1=0x0,_0x3d2e99={},_0x3aea72={};_0x3d41d1<_0x101e79[_0xd84d('0x3e')];_0x3d41d1+=0x1){_0x3d2e99=_0x101e79[_0x3d41d1];if(_[_0xd84d('0x3f')](_0x5bce0a[_0xd84d('0x1b')][_0x3d2e99['id']])){_0x5bce0a['salesforceAccounts'][_0x3d2e99['id']]=new SalesforceAccount(_0x3d2e99);}else{_0x5bce0a[_0xd84d('0x3c')](_0x5bce0a[_0xd84d('0x1b')][_0x3d2e99['id']],_0x3d2e99);}}}return _0x5bce0a['salesforceAccounts'];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x47')]=function(){var _0x1c052a=this;return function(_0x3cbc6c){if(_0x3cbc6c){freeIsNotKey(_0x3cbc6c,_0x1c052a[_0xd84d('0x1d')],'id');for(var _0x598e5e=0x0,_0x1ea682={},_0x583069={};_0x598e5e<_0x3cbc6c[_0xd84d('0x3e')];_0x598e5e+=0x1){_0x1ea682=_0x3cbc6c[_0x598e5e];if(_['isUndefined'](_0x1c052a[_0xd84d('0x1d')][_0x1ea682['id']])){_0x1c052a[_0xd84d('0x1d')][_0x1ea682['id']]=new FreshdeskAccount(_0x1ea682);}else{_0x1c052a[_0xd84d('0x3c')](_0x1c052a[_0xd84d('0x1d')][_0x1ea682['id']],_0x1ea682);}}}return _0x1c052a[_0xd84d('0x1d')];};};Realtime['prototype'][_0xd84d('0x48')]=function(){var _0x26fd25=this;return function(_0x2a1f0d){if(_0x2a1f0d){freeIsNotKey(_0x2a1f0d,_0x26fd25[_0xd84d('0x1e')],'id');for(var _0x2a81b6=0x0,_0x32b065={},_0x47f592={};_0x2a81b6<_0x2a1f0d[_0xd84d('0x3e')];_0x2a81b6+=0x1){_0x32b065=_0x2a1f0d[_0x2a81b6];if(_[_0xd84d('0x3f')](_0x26fd25[_0xd84d('0x1e')][_0x32b065['id']])){_0x26fd25['zohoAccounts'][_0x32b065['id']]=new ZohoAccount(_0x32b065);}else{_0x26fd25[_0xd84d('0x3c')](_0x26fd25[_0xd84d('0x1e')][_0x32b065['id']],_0x32b065);}}}return _0x26fd25[_0xd84d('0x1e')];};};Realtime[_0xd84d('0x3b')]['initDeskAccounts']=function(){var _0x1a776c=this;return function(_0xa2024e){if(_0xa2024e){freeIsNotKey(_0xa2024e,_0x1a776c[_0xd84d('0x49')],'id');for(var _0x17a05f=0x0,_0x207329={},_0x36709d={};_0x17a05f<_0xa2024e[_0xd84d('0x3e')];_0x17a05f+=0x1){_0x207329=_0xa2024e[_0x17a05f];if(_['isUndefined'](_0x1a776c['deskAccounts'][_0x207329['id']])){_0x1a776c[_0xd84d('0x49')][_0x207329['id']]=new DeskAccount(_0x207329);}else{_0x1a776c['mergeFromDatabase'](_0x1a776c[_0xd84d('0x49')][_0x207329['id']],_0x207329);}}}return _0x1a776c[_0xd84d('0x49')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x4a')]=function(){var _0x394bcb=this;return function(_0x1054b5){if(_0x1054b5){freeIsNotKey(_0x1054b5,_0x394bcb[_0xd84d('0x1c')],'id');for(var _0x296f93=0x0,_0x19210b={},_0xeab8e3={};_0x296f93<_0x1054b5[_0xd84d('0x3e')];_0x296f93+=0x1){_0x19210b=_0x1054b5[_0x296f93];if(_[_0xd84d('0x3f')](_0x394bcb[_0xd84d('0x1c')][_0x19210b['id']])){_0x394bcb['sugarcrmAccounts'][_0x19210b['id']]=new SugarcrmAccount(_0x19210b);}else{_0x394bcb[_0xd84d('0x3c')](_0x394bcb[_0xd84d('0x1c')][_0x19210b['id']],_0x19210b);}}}return _0x394bcb['sugarcrmAccounts'];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x4b')]=function(){var _0x476c90=this;return function(_0x57e62a){if(_0x57e62a){freeIsNotKey(_0x57e62a,_0x476c90[_0xd84d('0x1f')],'id');for(var _0x262501=0x0,_0x513392={},_0x57e5c1={};_0x262501<_0x57e62a['length'];_0x262501+=0x1){_0x513392=_0x57e62a[_0x262501];if(_[_0xd84d('0x3f')](_0x476c90[_0xd84d('0x1f')][_0x513392['id']])){_0x476c90[_0xd84d('0x1f')][_0x513392['id']]=new VtigerAccount(_0x513392);}else{_0x476c90[_0xd84d('0x3c')](_0x476c90[_0xd84d('0x1f')][_0x513392['id']],_0x513392);}}}return _0x476c90[_0xd84d('0x1f')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x4c')]=function(){var _0x56715a=this;return function(_0x54434a){if(_0x54434a){freeIsNotKey(_0x54434a,_0x56715a['servicenowAccounts'],'id');for(var _0x55f7e9=0x0,_0x3a6c4c={},_0x14f0bf={};_0x55f7e9<_0x54434a[_0xd84d('0x3e')];_0x55f7e9+=0x1){_0x3a6c4c=_0x54434a[_0x55f7e9];if(_[_0xd84d('0x3f')](_0x56715a[_0xd84d('0x4d')][_0x3a6c4c['id']])){_0x56715a[_0xd84d('0x4d')][_0x3a6c4c['id']]=new ServicenowAccount(_0x3a6c4c);}else{_0x56715a[_0xd84d('0x3c')](_0x56715a[_0xd84d('0x4d')][_0x3a6c4c['id']],_0x3a6c4c);}}}return _0x56715a[_0xd84d('0x4d')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x4e')]=function(){var _0x399903=this;return function(_0x85ede8){if(_0x85ede8){freeIsNotKey(_0x85ede8,_0x399903[_0xd84d('0x20')],'id');for(var _0x4955f7=0x0,_0x26aa89={},_0x2887e3={};_0x4955f7<_0x85ede8['length'];_0x4955f7+=0x1){_0x26aa89=_0x85ede8[_0x4955f7];if(_[_0xd84d('0x3f')](_0x399903['dynamics365Accounts'][_0x26aa89['id']])){_0x399903['dynamics365Accounts'][_0x26aa89['id']]=new Dynamics365Account(_0x26aa89);}else{_0x399903[_0xd84d('0x3c')](_0x399903[_0xd84d('0x20')][_0x26aa89['id']],_0x26aa89);}}}return _0x399903[_0xd84d('0x20')];};};Realtime['prototype'][_0xd84d('0x4f')]=function(){var _0x265f3e=this;return function(_0x1bd74e){if(_0x1bd74e){freeIsNotKey(_0x1bd74e,_0x265f3e['freshsalesAccounts'],'id');for(var _0x47074f=0x0,_0x261cd8={},_0x5db527={};_0x47074f<_0x1bd74e[_0xd84d('0x3e')];_0x47074f+=0x1){_0x261cd8=_0x1bd74e[_0x47074f];if(_[_0xd84d('0x3f')](_0x265f3e[_0xd84d('0x21')][_0x261cd8['id']])){_0x265f3e[_0xd84d('0x21')][_0x261cd8['id']]=new FreshsalesAccount(_0x261cd8);}else{_0x265f3e[_0xd84d('0x3c')](_0x265f3e[_0xd84d('0x21')][_0x261cd8['id']],_0x261cd8);}}}return _0x265f3e[_0xd84d('0x21')];};};Realtime['prototype'][_0xd84d('0x50')]=function(){var _0x2015b9=this;return function(_0x9d4722){for(var _0x238034=0x0;_0x238034<_0x9d4722[_0xd84d('0x3e')];_0x238034+=0x1){_[_0xd84d('0x51')](_0x2015b9['voiceQueues'][_0x9d4722[_0x238034]['name']],_0x9d4722[_0x238034]);}return _0x2015b9[_0xd84d('0x42')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xdc52cb=this;return function(_0x16fc16){clearVoiceQueues(_0xdc52cb[_0xd84d('0x42')]);if(_0x16fc16){_0x16fc16=_['groupBy'](_0x16fc16,_0xd84d('0x52'));for(var _0x58b5ae in _0x16fc16){if(_0x16fc16['hasOwnProperty'](_0x58b5ae)){var _0x2683f7={};for(var _0x46c511=0x0;_0x46c511<_0x16fc16[_0x58b5ae][_0xd84d('0x3e')];_0x46c511+=0x1){var _0x47d8cf=_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x53')];if(_0xdc52cb['voiceQueues'][_0x47d8cf]){if(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x54')]){_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x30')]+=0x1;}if(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x55')]){_0xdc52cb['voiceQueues'][_0x47d8cf][_0xd84d('0x31')]+=0x1;}_0xdc52cb[_0xd84d('0x42')][_0x47d8cf]['sumHoldTime']+=moment(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x56')])[_0xd84d('0x57')](moment(_0x16fc16[_0x58b5ae][_0x46c511]['queuecallerjoinAt']),_0xd84d('0x58'))||0x0;if(_0x46c511===_0x16fc16[_0x58b5ae][_0xd84d('0x3e')]-0x1){_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x2c')]+=moment(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x59')]||_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x5a')]||_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x5b')])[_0xd84d('0x57')](moment(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x5c')]),_0xd84d('0x58'))||0x0;_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x2a')]+=0x1;if(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x5d')]){_0xdc52cb[_0xd84d('0x42')][_0x47d8cf]['answered']+=0x1;_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x2d')]+=moment(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x59')])['diff'](moment(_0x16fc16[_0x58b5ae][_0x46c511][_0xd84d('0x56')]),_0xd84d('0x58'))||0x0;}}else{_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x2c')]+=_0xdc52cb[_0xd84d('0x42')][_0x47d8cf][_0xd84d('0x5e')]||0x0;}}}}}}return _0xdc52cb[_0xd84d('0x42')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x5f')]=function(){var _0x5b425c=this;return function(_0x25e787){clearVoiceCallReports(_0x5b425c[_0xd84d('0x16')]);if(_0x25e787){for(var _0x1f822d=0x0;_0x1f822d<_0x25e787[_0xd84d('0x3e')];_0x1f822d+=0x1){_0x5b425c[_0xd84d('0x16')][_0xd84d('0x2a')]+=0x1;_0x5b425c['outbound'][_0xd84d('0x2c')]+=_0x25e787[_0x1f822d][_0xd84d('0x60')];if(_0x25e787[_0x1f822d][_0xd84d('0x61')]===_0xd84d('0x62')){_0x5b425c[_0xd84d('0x16')][_0xd84d('0x2b')]+=0x1;_0x5b425c[_0xd84d('0x16')][_0xd84d('0x5e')]+=_0x25e787[_0x1f822d][_0xd84d('0x60')]-_0x25e787[_0x1f822d][_0xd84d('0x63')]||0x0;_0x5b425c['outbound'][_0xd84d('0x2d')]+=_0x25e787[_0x1f822d][_0xd84d('0x63')];}}}return _0x5b425c[_0xd84d('0x16')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x64')]=function(){var _0x347431=this;return function(_0x5a3d8a){if(_0x5a3d8a){freeIsNotKey(_0x5a3d8a,_0x347431['campaigns'],_0xd84d('0x29'));for(var _0x2009ab=0x0,_0x289f32={};_0x2009ab<_0x5a3d8a[_0xd84d('0x3e')];_0x2009ab+=0x1){_0x289f32=_0x5a3d8a[_0x2009ab];if(_[_0xd84d('0x3f')](_0x347431[_0xd84d('0x14')][_0x289f32['name']])){_0x347431[_0xd84d('0x14')][_0x289f32['name']]=new Campaign(_0x289f32);}else{_0x347431['mergeFromDatabase'](_0x347431[_0xd84d('0x14')][_0x289f32['name']],_0x289f32);_0x347431['campaigns'][_0x289f32['name']][_0xd84d('0x65')]=_0x289f32[_0xd84d('0x66')]?_0x289f32[_0xd84d('0x66')][_0xd84d('0x29')]:undefined;}}}return _0x347431[_0xd84d('0x14')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x67')]=function(){var _0x16e228=this;return function(_0x39530c){if(_0x39530c){freeIsNotKey(_0x39530c,_0x16e228[_0xd84d('0x17')],'id');for(var _0x290a3e=0x0,_0x312d02={};_0x290a3e<_0x39530c[_0xd84d('0x3e')];_0x290a3e+=0x1){_0x312d02=_0x39530c[_0x290a3e];if(_[_0xd84d('0x3f')](_0x16e228[_0xd84d('0x17')][_0x312d02['id']])){_0x16e228[_0xd84d('0x17')][_0x312d02['id']]=new VoiceExtension(_0x312d02);}else{_0x16e228[_0xd84d('0x3c')](_0x16e228[_0xd84d('0x17')][_0x312d02['id']],_0x312d02);}}}return _0x16e228[_0xd84d('0x17')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x68')]=function(){var _0x2dbe97=this;return function(_0x54c908){clearCampaigns(_0x2dbe97[_0xd84d('0x14')]);for(var _0x17256a=0x0;_0x17256a<_0x54c908[_0xd84d('0x3e')];_0x17256a+=0x1){_[_0xd84d('0x51')](_0x2dbe97[_0xd84d('0x14')][_0x54c908[_0x17256a]['name']],_0x54c908[_0x17256a]);}return _0x2dbe97[_0xd84d('0x14')];};};Realtime[_0xd84d('0x3b')][_0xd84d('0x69')]=function(){var _0x2b67df=this;return function(_0x56fa8e){if(_0x56fa8e){freeIsNotKey(_0x56fa8e,_0x2b67df[_0xd84d('0x22')],'id');for(var _0x57f7b8=0x0,_0x266ad8={},_0x5ee5ee={};_0x57f7b8<_0x56fa8e[_0xd84d('0x3e')];_0x57f7b8+=0x1){_0x266ad8=_0x56fa8e[_0x57f7b8];if(_['isUndefined'](_0x2b67df[_0xd84d('0x22')][_0x266ad8['id']])){_0x2b67df['faxAccounts'][_0x266ad8['id']]=new FaxAccount(_0x266ad8);}else{_0x2b67df[_0xd84d('0x3c')](_0x2b67df[_0xd84d('0x22')][_0x266ad8['id']],_0x266ad8);}}}return _0x2b67df[_0xd84d('0x22')];};};module[_0xd84d('0x6a')]=Realtime; \ No newline at end of file +var _0x412f=['../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','answered','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','isUndefined','mergeFromDatabase','initTelephones','length','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','merge','initVoiceQueueReports','groupBy','queuecallerabandon','queuecallerleaveAt','seconds','queuecallerabandonAt','queuecallerexitAt','diff','total','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/voiceQueue','../model/trigger'];(function(_0x281975,_0x2470ed){var _0x299e81=function(_0x4f8b35){while(--_0x4f8b35){_0x281975['push'](_0x281975['shift']());}};_0x299e81(++_0x2470ed);}(_0x412f,0xd0));var _0xf412=function(_0x5160f9,_0xf48d71){_0x5160f9=_0x5160f9-0x0;var _0x51b7e8=_0x412f[_0x5160f9];return _0x51b7e8;};'use strict';var BPromise=require(_0xf412('0x0'));var util=require('util');var _=require(_0xf412('0x1'));var moment=require(_0xf412('0x2'));var Agent=require(_0xf412('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xf412('0x4'));var Trigger=require(_0xf412('0x5'));var Template=require(_0xf412('0x6'));var Campaign=require(_0xf412('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xf412('0x8'));var SalesforceAccount=require(_0xf412('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xf412('0xa'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xf412('0xb'));var Dynamics365Account=require(_0xf412('0xc'));var FreshsalesAccount=require(_0xf412('0xd'));var FaxAccount=require(_0xf412('0xe'));var Realtime=function(){this[_0xf412('0xf')]={};this[_0xf412('0x10')]={};this[_0xf412('0x11')]={};this[_0xf412('0x12')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0xf412('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf412('0x14')]={};this[_0xf412('0x15')]={};this[_0xf412('0x16')]={};this[_0xf412('0x17')]={};this[_0xf412('0x18')]={};this[_0xf412('0x19')]={};this[_0xf412('0x1a')]={};this['salesforceAccounts']={};this[_0xf412('0x1b')]={};this['freshdeskAccounts']={};this[_0xf412('0x1c')]={};this['deskAccounts']={};this[_0xf412('0x1d')]={};this[_0xf412('0x1e')]={};this['dynamics365Accounts']={};this[_0xf412('0x1f')]={};this[_0xf412('0x20')]={};};function freeIsNotKey(_0x11de4f,_0xeb0251,_0x5723c1){var _0x1d0149=_['mapKeys'](_0x11de4f,function(_0x1c9e84,_0x344b1d){return _0x1c9e84[_0x5723c1];});for(var _0x223512 in _0xeb0251){if(_0xeb0251['hasOwnProperty'](_0x223512)){if(!_0x1d0149[_0x223512]){delete _0xeb0251[_0x223512];}}}}function freeIsNotKeySip(_0x48534d,_0x469136){var _0x2c9f2c=_[_0xf412('0x21')](_0x48534d,function(_0x5acd0a,_0x4d5c0d){return util[_0xf412('0x22')](_0xf412('0x23'),_0x5acd0a[_0xf412('0x24')]);});for(var _0x1ba7a2 in _0x469136){if(_0x469136[_0xf412('0x25')](_0x1ba7a2)){if(!_0x2c9f2c[_0x1ba7a2]){delete _0x469136[_0x1ba7a2];}}}}function freeIsNotKeyAgent(_0x278b16,_0x1571af){var _0x252477=_['mapKeys'](_0x278b16,function(_0x369912,_0x174576){var _0x3dc2b7=_[_0xf412('0x26')](_0x369912['interface'])?util[_0xf412('0x22')](_0xf412('0x23'),_0x369912[_0xf412('0x24')]):_0x369912[_0xf412('0x27')];return _0x3dc2b7;});for(var _0x568b4e in _0x1571af){if(_0x1571af[_0xf412('0x25')](_0x568b4e)){if(!_0x252477[_0x568b4e]){delete _0x1571af[_0x568b4e];}}}}function clearVoiceCallReports(_0xac95eb){_0xac95eb['total']=0x0;_0xac95eb['answered']=0x0;_0xac95eb[_0xf412('0x28')]=0x0;_0xac95eb[_0xf412('0x29')]=0x0;_0xac95eb[_0xf412('0x2a')]=0x0;}function clearCampaigns(_0x8596c6){if(!_['isEmpty'](_0x8596c6)){for(var _0x38d9bd in _0x8596c6){if(_0x8596c6[_0xf412('0x25')](_0x38d9bd)){_0x8596c6[_0x38d9bd][_0xf412('0x2b')]=0x0;_0x8596c6[_0x38d9bd]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x3ba870){if(!_[_0xf412('0x2c')](_0x3ba870)){for(var _0x37f54b in _0x3ba870){if(_0x3ba870[_0xf412('0x25')](_0x37f54b)){_0x3ba870[_0x37f54b]['total']=0x0;_0x3ba870[_0x37f54b][_0xf412('0x2d')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x2e')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x2f')]=0x0;_0x3ba870[_0x37f54b]['sumHoldTime']=0x0;_0x3ba870[_0x37f54b][_0xf412('0x29')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x2a')]=0x0;_0x3ba870[_0x37f54b]['outboundAnswerAgiCallsDay']=0x0;_0x3ba870[_0x37f54b][_0xf412('0x30')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x31')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x32')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x33')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x34')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x35')]=0x0;_0x3ba870[_0x37f54b]['outboundDropCallsDayCallersExit']=0x0;_0x3ba870[_0x37f54b][_0xf412('0x36')]=0x0;_0x3ba870[_0x37f54b]['outboundOriginateFailureCallsDay']=0x0;_0x3ba870[_0x37f54b][_0xf412('0x37')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x38')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x39')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x3a')]=0x0;_0x3ba870[_0x37f54b][_0xf412('0x3b')]=!![];}}}}Realtime[_0xf412('0x3c')]['mergeFromDatabase']=function(_0x488c8a,_0x6903c0){for(var _0x1dc1c3 in _0x6903c0){if(_0x488c8a[_0xf412('0x25')](_0x1dc1c3)){_0x488c8a[_0x1dc1c3]=_0x6903c0[_0x1dc1c3];}}};Realtime[_0xf412('0x3c')][_0xf412('0x3d')]=function(){var _0x2dddb1=this;return function(_0x112d09){if(_0x112d09){freeIsNotKeyAgent(_0x112d09,_0x2dddb1[_0xf412('0xf')]);for(var _0x25fee8=0x0,_0x5734f8={},_0x403168={};_0x25fee8<_0x112d09['length'];_0x25fee8+=0x1){_0x5734f8=_0x112d09[_0x25fee8];var _0x4e3379=_[_0xf412('0x26')](_0x5734f8[_0xf412('0x27')])?util[_0xf412('0x22')](_0xf412('0x23'),_0x5734f8[_0xf412('0x24')]):_0x5734f8['interface'];if(_[_0xf412('0x3e')](_0x2dddb1[_0xf412('0xf')][_0x4e3379])){_0x2dddb1[_0xf412('0xf')][_0x4e3379]=new Agent(_0x5734f8);}else{_0x2dddb1[_0xf412('0x3f')](_0x2dddb1[_0xf412('0xf')][_0x4e3379],_0x5734f8);}}}return _0x2dddb1[_0xf412('0xf')];};};Realtime['prototype'][_0xf412('0x40')]=function(){var _0x3627c8=this;return function(_0x37ee03){if(_0x37ee03){freeIsNotKeySip(_0x37ee03,_0x3627c8[_0xf412('0x10')]);for(var _0x3b1de1=0x0,_0x16fe25={},_0x3d2576={};_0x3b1de1<_0x37ee03[_0xf412('0x41')];_0x3b1de1+=0x1){_0x16fe25=_0x37ee03[_0x3b1de1];if(_['isUndefined'](_0x3627c8[_0xf412('0x10')][util[_0xf412('0x22')](_0xf412('0x23'),_0x16fe25[_0xf412('0x24')])])){_0x3627c8[_0xf412('0x10')][util['format'](_0xf412('0x23'),_0x16fe25[_0xf412('0x24')])]=new Telephone(_0x16fe25);}else{_0x3627c8[_0xf412('0x3f')](_0x3627c8['telephones'][util[_0xf412('0x22')](_0xf412('0x23'),_0x16fe25[_0xf412('0x24')])],_0x16fe25);}}}return _0x3627c8['telephones'];};};Realtime[_0xf412('0x3c')][_0xf412('0x42')]=function(){var _0x329bc4=this;return function(_0x4c8f90){if(_0x4c8f90){freeIsNotKeySip(_0x4c8f90,_0x329bc4[_0xf412('0x11')]);for(var _0x158318=0x0,_0x5a0fd6={},_0xabe61c={};_0x158318<_0x4c8f90['length'];_0x158318+=0x1){_0x5a0fd6=_0x4c8f90[_0x158318];if(_[_0xf412('0x3e')](_0x329bc4[_0xf412('0x11')][util[_0xf412('0x22')](_0xf412('0x23'),_0x5a0fd6[_0xf412('0x24')])])){_0x329bc4[_0xf412('0x11')][util[_0xf412('0x22')](_0xf412('0x23'),_0x5a0fd6[_0xf412('0x24')])]=new Trunk(_0x5a0fd6);}else{_0x329bc4[_0xf412('0x3f')](_0x329bc4[_0xf412('0x11')][util[_0xf412('0x22')](_0xf412('0x23'),_0x5a0fd6[_0xf412('0x24')])],_0x5a0fd6);}}}return _0x329bc4[_0xf412('0x11')];};};Realtime[_0xf412('0x3c')][_0xf412('0x43')]=function(){var _0x2c37c0=this;return function(_0x5a3525){if(_0x5a3525){freeIsNotKey(_0x5a3525,_0x2c37c0['voiceQueues'],_0xf412('0x24'));for(var _0x30b599=0x0,_0x546562={},_0x2b30a2={};_0x30b599<_0x5a3525[_0xf412('0x41')];_0x30b599+=0x1){_0x546562=_0x5a3525[_0x30b599];if(_[_0xf412('0x3e')](_0x2c37c0[_0xf412('0x12')][_0x546562[_0xf412('0x24')]])){_0x2c37c0['voiceQueues'][_0x546562['name']]=new VoiceQueue(_0x546562);}else{_0x2c37c0['mergeFromDatabase'](_0x2c37c0[_0xf412('0x12')][_0x546562[_0xf412('0x24')]],_0x546562);}}}return _0x2c37c0[_0xf412('0x12')];};};Realtime['prototype'][_0xf412('0x44')]=function(){var _0x403632=this;return function(_0x1cd97c){if(_0x1cd97c){freeIsNotKey(_0x1cd97c,_0x403632['triggers'],'id');for(var _0x50442f=0x0,_0x27f86c={},_0x31a35e={};_0x50442f<_0x1cd97c[_0xf412('0x41')];_0x50442f+=0x1){_0x27f86c=_0x1cd97c[_0x50442f];if(_[_0xf412('0x3e')](_0x403632[_0xf412('0x45')][_0x27f86c['id']])){_0x403632[_0xf412('0x45')][_0x27f86c['id']]=new Trigger(_0x27f86c);}else{_0x403632[_0xf412('0x3f')](_0x403632[_0xf412('0x45')][_0x27f86c['id']],_0x27f86c);}}}return _0x403632[_0xf412('0x45')];};};Realtime[_0xf412('0x3c')][_0xf412('0x46')]=function(){var _0x1b1d5d=this;return function(_0x4b28d5){if(_0x4b28d5){freeIsNotKey(_0x4b28d5,_0x1b1d5d[_0xf412('0x47')],'id');for(var _0x105076=0x0,_0x4ec243={},_0x51dea7={};_0x105076<_0x4b28d5['length'];_0x105076+=0x1){_0x4ec243=_0x4b28d5[_0x105076];if(_[_0xf412('0x3e')](_0x1b1d5d['templates'][_0x4ec243['id']])){_0x1b1d5d[_0xf412('0x47')][_0x4ec243['id']]=new Template(_0x4ec243);}else{_0x1b1d5d[_0xf412('0x3f')](_0x1b1d5d[_0xf412('0x47')][_0x4ec243['id']],_0x4ec243);}}}return _0x1b1d5d[_0xf412('0x47')];};};Realtime[_0xf412('0x3c')][_0xf412('0x48')]=function(){var _0x2b6f2f=this;return function(_0x52e573){if(_0x52e573){freeIsNotKey(_0x52e573,_0x2b6f2f[_0xf412('0x1a')],'id');for(var _0x3b932c=0x0,_0x387bf7={},_0x48af3f={};_0x3b932c<_0x52e573[_0xf412('0x41')];_0x3b932c+=0x1){_0x387bf7=_0x52e573[_0x3b932c];if(_[_0xf412('0x3e')](_0x2b6f2f['zendeskAccounts'][_0x387bf7['id']])){_0x2b6f2f['zendeskAccounts'][_0x387bf7['id']]=new ZendeskAccount(_0x387bf7);}else{_0x2b6f2f[_0xf412('0x3f')](_0x2b6f2f[_0xf412('0x1a')][_0x387bf7['id']],_0x387bf7);}}}return _0x2b6f2f[_0xf412('0x1a')];};};Realtime[_0xf412('0x3c')][_0xf412('0x49')]=function(){var _0x2c3059=this;return function(_0x5e2bb3){if(_0x5e2bb3){freeIsNotKey(_0x5e2bb3,_0x2c3059['salesforceAccounts'],'id');for(var _0x200679=0x0,_0x1eff62={},_0x442857={};_0x200679<_0x5e2bb3['length'];_0x200679+=0x1){_0x1eff62=_0x5e2bb3[_0x200679];if(_[_0xf412('0x3e')](_0x2c3059[_0xf412('0x4a')][_0x1eff62['id']])){_0x2c3059[_0xf412('0x4a')][_0x1eff62['id']]=new SalesforceAccount(_0x1eff62);}else{_0x2c3059[_0xf412('0x3f')](_0x2c3059[_0xf412('0x4a')][_0x1eff62['id']],_0x1eff62);}}}return _0x2c3059['salesforceAccounts'];};};Realtime[_0xf412('0x3c')][_0xf412('0x4b')]=function(){var _0xde72ea=this;return function(_0xd6db58){if(_0xd6db58){freeIsNotKey(_0xd6db58,_0xde72ea[_0xf412('0x4c')],'id');for(var _0x3859e1=0x0,_0x149a06={},_0x5e6f73={};_0x3859e1<_0xd6db58['length'];_0x3859e1+=0x1){_0x149a06=_0xd6db58[_0x3859e1];if(_[_0xf412('0x3e')](_0xde72ea['freshdeskAccounts'][_0x149a06['id']])){_0xde72ea[_0xf412('0x4c')][_0x149a06['id']]=new FreshdeskAccount(_0x149a06);}else{_0xde72ea['mergeFromDatabase'](_0xde72ea[_0xf412('0x4c')][_0x149a06['id']],_0x149a06);}}}return _0xde72ea['freshdeskAccounts'];};};Realtime[_0xf412('0x3c')]['initZohoAccounts']=function(){var _0x5c7f50=this;return function(_0x4fc593){if(_0x4fc593){freeIsNotKey(_0x4fc593,_0x5c7f50[_0xf412('0x1c')],'id');for(var _0x5df9de=0x0,_0x232dc1={},_0x220ef0={};_0x5df9de<_0x4fc593[_0xf412('0x41')];_0x5df9de+=0x1){_0x232dc1=_0x4fc593[_0x5df9de];if(_[_0xf412('0x3e')](_0x5c7f50['zohoAccounts'][_0x232dc1['id']])){_0x5c7f50[_0xf412('0x1c')][_0x232dc1['id']]=new ZohoAccount(_0x232dc1);}else{_0x5c7f50['mergeFromDatabase'](_0x5c7f50[_0xf412('0x1c')][_0x232dc1['id']],_0x232dc1);}}}return _0x5c7f50['zohoAccounts'];};};Realtime[_0xf412('0x3c')][_0xf412('0x4d')]=function(){var _0x12e749=this;return function(_0x20c2d0){if(_0x20c2d0){freeIsNotKey(_0x20c2d0,_0x12e749[_0xf412('0x4e')],'id');for(var _0x23fe4d=0x0,_0x5af300={},_0x5a750a={};_0x23fe4d<_0x20c2d0['length'];_0x23fe4d+=0x1){_0x5af300=_0x20c2d0[_0x23fe4d];if(_[_0xf412('0x3e')](_0x12e749[_0xf412('0x4e')][_0x5af300['id']])){_0x12e749[_0xf412('0x4e')][_0x5af300['id']]=new DeskAccount(_0x5af300);}else{_0x12e749['mergeFromDatabase'](_0x12e749['deskAccounts'][_0x5af300['id']],_0x5af300);}}}return _0x12e749[_0xf412('0x4e')];};};Realtime[_0xf412('0x3c')][_0xf412('0x4f')]=function(){var _0x42d874=this;return function(_0x56ddb0){if(_0x56ddb0){freeIsNotKey(_0x56ddb0,_0x42d874[_0xf412('0x1b')],'id');for(var _0x40483e=0x0,_0x1a87f5={},_0x201337={};_0x40483e<_0x56ddb0[_0xf412('0x41')];_0x40483e+=0x1){_0x1a87f5=_0x56ddb0[_0x40483e];if(_['isUndefined'](_0x42d874['sugarcrmAccounts'][_0x1a87f5['id']])){_0x42d874[_0xf412('0x1b')][_0x1a87f5['id']]=new SugarcrmAccount(_0x1a87f5);}else{_0x42d874[_0xf412('0x3f')](_0x42d874[_0xf412('0x1b')][_0x1a87f5['id']],_0x1a87f5);}}}return _0x42d874['sugarcrmAccounts'];};};Realtime[_0xf412('0x3c')][_0xf412('0x50')]=function(){var _0x525fb6=this;return function(_0x3337dd){if(_0x3337dd){freeIsNotKey(_0x3337dd,_0x525fb6[_0xf412('0x1d')],'id');for(var _0x480aa3=0x0,_0x3ce66a={},_0x5628e8={};_0x480aa3<_0x3337dd[_0xf412('0x41')];_0x480aa3+=0x1){_0x3ce66a=_0x3337dd[_0x480aa3];if(_[_0xf412('0x3e')](_0x525fb6[_0xf412('0x1d')][_0x3ce66a['id']])){_0x525fb6[_0xf412('0x1d')][_0x3ce66a['id']]=new VtigerAccount(_0x3ce66a);}else{_0x525fb6[_0xf412('0x3f')](_0x525fb6[_0xf412('0x1d')][_0x3ce66a['id']],_0x3ce66a);}}}return _0x525fb6[_0xf412('0x1d')];};};Realtime[_0xf412('0x3c')][_0xf412('0x51')]=function(){var _0x2801f7=this;return function(_0x2401df){if(_0x2401df){freeIsNotKey(_0x2401df,_0x2801f7[_0xf412('0x1e')],'id');for(var _0x3f730a=0x0,_0x546c03={},_0x4213f0={};_0x3f730a<_0x2401df['length'];_0x3f730a+=0x1){_0x546c03=_0x2401df[_0x3f730a];if(_[_0xf412('0x3e')](_0x2801f7['servicenowAccounts'][_0x546c03['id']])){_0x2801f7[_0xf412('0x1e')][_0x546c03['id']]=new ServicenowAccount(_0x546c03);}else{_0x2801f7[_0xf412('0x3f')](_0x2801f7[_0xf412('0x1e')][_0x546c03['id']],_0x546c03);}}}return _0x2801f7[_0xf412('0x1e')];};};Realtime[_0xf412('0x3c')][_0xf412('0x52')]=function(){var _0x50e63f=this;return function(_0x1a68c1){if(_0x1a68c1){freeIsNotKey(_0x1a68c1,_0x50e63f['dynamics365Accounts'],'id');for(var _0x58890c=0x0,_0x49ff65={},_0x57bfa1={};_0x58890c<_0x1a68c1['length'];_0x58890c+=0x1){_0x49ff65=_0x1a68c1[_0x58890c];if(_[_0xf412('0x3e')](_0x50e63f[_0xf412('0x53')][_0x49ff65['id']])){_0x50e63f['dynamics365Accounts'][_0x49ff65['id']]=new Dynamics365Account(_0x49ff65);}else{_0x50e63f[_0xf412('0x3f')](_0x50e63f[_0xf412('0x53')][_0x49ff65['id']],_0x49ff65);}}}return _0x50e63f[_0xf412('0x53')];};};Realtime[_0xf412('0x3c')]['initFreshsalesAccounts']=function(){var _0x47cc28=this;return function(_0x46ef41){if(_0x46ef41){freeIsNotKey(_0x46ef41,_0x47cc28[_0xf412('0x1f')],'id');for(var _0x9fc808=0x0,_0x1e1660={},_0x2cb748={};_0x9fc808<_0x46ef41[_0xf412('0x41')];_0x9fc808+=0x1){_0x1e1660=_0x46ef41[_0x9fc808];if(_[_0xf412('0x3e')](_0x47cc28[_0xf412('0x1f')][_0x1e1660['id']])){_0x47cc28[_0xf412('0x1f')][_0x1e1660['id']]=new FreshsalesAccount(_0x1e1660);}else{_0x47cc28[_0xf412('0x3f')](_0x47cc28[_0xf412('0x1f')][_0x1e1660['id']],_0x1e1660);}}}return _0x47cc28[_0xf412('0x1f')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x43945e=this;return function(_0x2e8792){for(var _0x3a03e3=0x0;_0x3a03e3<_0x2e8792[_0xf412('0x41')];_0x3a03e3+=0x1){_[_0xf412('0x54')](_0x43945e['voiceQueues'][_0x2e8792[_0x3a03e3][_0xf412('0x24')]],_0x2e8792[_0x3a03e3]);}return _0x43945e[_0xf412('0x12')];};};Realtime[_0xf412('0x3c')][_0xf412('0x55')]=function(){var _0x4803ef=this;return function(_0xca773b){clearVoiceQueues(_0x4803ef['voiceQueues']);if(_0xca773b){_0xca773b=_[_0xf412('0x56')](_0xca773b,'uniqueid');for(var _0xb7d10a in _0xca773b){if(_0xca773b[_0xf412('0x25')](_0xb7d10a)){var _0xbb83fb={};for(var _0x5325f0=0x0;_0x5325f0<_0xca773b[_0xb7d10a]['length'];_0x5325f0+=0x1){var _0x1ba9f5=_0xca773b[_0xb7d10a][_0x5325f0]['queue'];if(_0x4803ef['voiceQueues'][_0x1ba9f5]){if(_0xca773b[_0xb7d10a][_0x5325f0]['queuecallerexit']){_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x2e')]+=0x1;}if(_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x57')]){_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x2f')]+=0x1;}_0x4803ef[_0xf412('0x12')][_0x1ba9f5]['sumHoldTime']+=moment(_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x58')])['diff'](moment(_0xca773b[_0xb7d10a][_0x5325f0]['queuecallerjoinAt']),_0xf412('0x59'))||0x0;if(_0x5325f0===_0xca773b[_0xb7d10a]['length']-0x1){_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x29')]+=moment(_0xca773b[_0xb7d10a][_0x5325f0]['queuecallercompleteAt']||_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x5a')]||_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x5b')])[_0xf412('0x5c')](moment(_0xca773b[_0xb7d10a][_0x5325f0]['queuecallerjoinAt']),_0xf412('0x59'))||0x0;_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x5d')]+=0x1;if(_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x5e')]){_0x4803ef['voiceQueues'][_0x1ba9f5]['answered']+=0x1;_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x2a')]+=moment(_0xca773b[_0xb7d10a][_0x5325f0]['queuecallercompleteAt'])[_0xf412('0x5c')](moment(_0xca773b[_0xb7d10a][_0x5325f0][_0xf412('0x58')]),_0xf412('0x59'))||0x0;}}else{_0x4803ef['voiceQueues'][_0x1ba9f5][_0xf412('0x29')]+=_0x4803ef[_0xf412('0x12')][_0x1ba9f5][_0xf412('0x28')]||0x0;}}}}}}return _0x4803ef['voiceQueues'];};};Realtime[_0xf412('0x3c')][_0xf412('0x5f')]=function(){var _0x190e15=this;return function(_0x5d3637){clearVoiceCallReports(_0x190e15[_0xf412('0x13')]);if(_0x5d3637){for(var _0x1bb9af=0x0;_0x1bb9af<_0x5d3637[_0xf412('0x41')];_0x1bb9af+=0x1){_0x190e15[_0xf412('0x13')][_0xf412('0x5d')]+=0x1;_0x190e15[_0xf412('0x13')][_0xf412('0x29')]+=_0x5d3637[_0x1bb9af]['duration'];if(_0x5d3637[_0x1bb9af][_0xf412('0x60')]===_0xf412('0x61')){_0x190e15[_0xf412('0x13')][_0xf412('0x2d')]+=0x1;_0x190e15[_0xf412('0x13')][_0xf412('0x28')]+=_0x5d3637[_0x1bb9af][_0xf412('0x62')]-_0x5d3637[_0x1bb9af][_0xf412('0x63')]||0x0;_0x190e15[_0xf412('0x13')][_0xf412('0x2a')]+=_0x5d3637[_0x1bb9af][_0xf412('0x63')];}}}return _0x190e15['outbound'];};};Realtime['prototype'][_0xf412('0x64')]=function(){var _0x3bf464=this;return function(_0x519c6d){if(_0x519c6d){freeIsNotKey(_0x519c6d,_0x3bf464['campaigns'],_0xf412('0x24'));for(var _0x1f423d=0x0,_0x31a2b4={};_0x1f423d<_0x519c6d[_0xf412('0x41')];_0x1f423d+=0x1){_0x31a2b4=_0x519c6d[_0x1f423d];if(_[_0xf412('0x3e')](_0x3bf464[_0xf412('0x65')][_0x31a2b4['name']])){_0x3bf464['campaigns'][_0x31a2b4[_0xf412('0x24')]]=new Campaign(_0x31a2b4);}else{_0x3bf464[_0xf412('0x3f')](_0x3bf464[_0xf412('0x65')][_0x31a2b4['name']],_0x31a2b4);_0x3bf464[_0xf412('0x65')][_0x31a2b4[_0xf412('0x24')]][_0xf412('0x66')]=_0x31a2b4[_0xf412('0x67')]?_0x31a2b4[_0xf412('0x67')]['name']:undefined;}}}return _0x3bf464[_0xf412('0x65')];};};Realtime[_0xf412('0x3c')][_0xf412('0x68')]=function(){var _0x11791d=this;return function(_0x5a0800){if(_0x5a0800){freeIsNotKey(_0x5a0800,_0x11791d['voiceExtensions'],'id');for(var _0x2bb00c=0x0,_0x223426={};_0x2bb00c<_0x5a0800[_0xf412('0x41')];_0x2bb00c+=0x1){_0x223426=_0x5a0800[_0x2bb00c];if(_['isUndefined'](_0x11791d[_0xf412('0x14')][_0x223426['id']])){_0x11791d['voiceExtensions'][_0x223426['id']]=new VoiceExtension(_0x223426);}else{_0x11791d[_0xf412('0x3f')](_0x11791d[_0xf412('0x14')][_0x223426['id']],_0x223426);}}}return _0x11791d['voiceExtensions'];};};Realtime[_0xf412('0x3c')]['initCampaignHopperHistory']=function(){var _0x5ea1cd=this;return function(_0x9c22b6){clearCampaigns(_0x5ea1cd[_0xf412('0x65')]);for(var _0x3435b0=0x0;_0x3435b0<_0x9c22b6[_0xf412('0x41')];_0x3435b0+=0x1){_[_0xf412('0x54')](_0x5ea1cd[_0xf412('0x65')][_0x9c22b6[_0x3435b0]['name']],_0x9c22b6[_0x3435b0]);}return _0x5ea1cd[_0xf412('0x65')];};};Realtime[_0xf412('0x3c')][_0xf412('0x69')]=function(){var _0x1fd23a=this;return function(_0x1c1cb4){if(_0x1c1cb4){freeIsNotKey(_0x1c1cb4,_0x1fd23a[_0xf412('0x20')],'id');for(var _0x171a92=0x0,_0x46b79e={},_0x2de98c={};_0x171a92<_0x1c1cb4[_0xf412('0x41')];_0x171a92+=0x1){_0x46b79e=_0x1c1cb4[_0x171a92];if(_[_0xf412('0x3e')](_0x1fd23a['faxAccounts'][_0x46b79e['id']])){_0x1fd23a['faxAccounts'][_0x46b79e['id']]=new FaxAccount(_0x46b79e);}else{_0x1fd23a[_0xf412('0x3f')](_0x1fd23a[_0xf412('0x20')][_0x46b79e['id']],_0x46b79e);}}}return _0x1fd23a['faxAccounts'];};};module[_0xf412('0x6a')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d3284c8..8a04b4b 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 _0x4e12=['startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','create','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','monitors','length','filename','createdAt','connectedlinename','membername','isArray','forEach'];(function(_0x41b6f5,_0x1ad42f){var _0x5d6142=function(_0xb46850){while(--_0xb46850){_0x41b6f5['push'](_0x41b6f5['shift']());}};_0x5d6142(++_0x1ad42f);}(_0x4e12,0x15f));var _0x24e1=function(_0x1a45ec,_0x1add99){_0x1a45ec=_0x1a45ec-0x0;var _0x377a8a=_0x4e12[_0x1a45ec];return _0x377a8a;};'use strict';var _=require(_0x24e1('0x0'));var moment=require(_0x24e1('0x1'));var util=require('util');var config=require(_0x24e1('0x2'));var ami=require(_0x24e1('0x3'));var RpcVoiceAgentReport=require(_0x24e1('0x4'));var RpcVoiceCallReport=require(_0x24e1('0x5'));var RpcVoiceDialReport=require(_0x24e1('0x6'));var RpcMemberReport=require(_0x24e1('0x7'));var RpcVoiceQueueReport=require(_0x24e1('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x24e1('0x9'));var VoiceQueueReport=require(_0x24e1('0xa'));var VoiceCallReport=require(_0x24e1('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x24e1('0xc'));var UserReport=require(_0x24e1('0xd'));function Report(_0x27e192){this[_0x24e1('0xe')]=_0x27e192;this[_0x24e1('0xf')]=_0x27e192['agents'];this[_0x24e1('0x10')]=_0x27e192['telephones'];}Report[_0x24e1('0x11')][_0x24e1('0x12')]=function(_0x12f050){var _0x2cb602=new VoiceQueueReport(this[_0x24e1('0xe')]);var _0x326e7a=new VoiceAgentReport(this['realtime']);var _0x464425=new VoiceDialReport(this['realtime']);var _0x26aa63=new VoiceCallReport(this[_0x24e1('0xe')]);var _0x376000=new UserReport(this[_0x24e1('0xe')]);if(config[_0x24e1('0x13')]&&config['xdr']['disabled']){ami['on'](_0x24e1('0x14'),this[_0x24e1('0x15')]['bind'](this));ami['on'](_0x24e1('0x16'),this[_0x24e1('0x17')][_0x24e1('0x18')](this));ami['on'](_0x24e1('0x19'),this[_0x24e1('0x1a')][_0x24e1('0x18')](this));ami['on'](_0x24e1('0x1b'),this[_0x24e1('0x1c')]['bind'](this));ami['on']('blindtransfer',this[_0x24e1('0x1d')][_0x24e1('0x18')](this));ami['on'](_0x24e1('0x1e'),this[_0x24e1('0x1f')][_0x24e1('0x18')](this));}};Report[_0x24e1('0x11')][_0x24e1('0x20')]=function(_0x4d40d5){var _0x43b41b;_0x43b41b=_[_0x24e1('0x21')](this[_0x24e1('0xf')],function(_0x9fcbfd){return _0x9fcbfd[_0x24e1('0x22')]==_0x4d40d5||_0x9fcbfd['name']==_0x4d40d5;});if(_[_0x24e1('0x23')](_0x43b41b)){var _0x43ab5c=_['find'](this[_0x24e1('0x10')],function(_0x1f49f6){return _0x1f49f6[_0x24e1('0x22')]==_0x4d40d5||_0x1f49f6[_0x24e1('0x24')]==_0x4d40d5;});if(_0x43ab5c){_0x43b41b=_[_0x24e1('0x21')](this['agents'],function(_0x43fcfe){return _0x43fcfe[_0x24e1('0x25')]==util[_0x24e1('0x26')]('SIP/%s',_0x43ab5c[_0x24e1('0x24')]);});}}return _0x43b41b;};Report[_0x24e1('0x11')][_0x24e1('0x15')]=function(_0x7a68e4){for(var _0x383f34=0x0;_0x383f34<_0x7a68e4['length'];_0x383f34+=0x1){var _0x4eba29=this[_0x24e1('0x20')](_0x7a68e4[_0x383f34][_0x24e1('0x27')]);if(_0x4eba29){_0x7a68e4[_0x383f34][_0x24e1('0x22')]=_0x4eba29[_0x24e1('0x22')];_0x7a68e4[_0x383f34][_0x24e1('0x28')]=!![];_0x7a68e4[_0x383f34][_0x24e1('0x29')]=_0x4eba29[_0x24e1('0x24')];_0x7a68e4[_0x383f34][_0x24e1('0x25')]=_[_0x24e1('0x23')](_0x4eba29['interface'])?util[_0x24e1('0x26')](_0x24e1('0x2a'),_0x4eba29['name']):_0x4eba29[_0x24e1('0x25')];if(_0x7a68e4[_0x383f34][_0x24e1('0x2b')]){_0x7a68e4[_0x383f34][_0x24e1('0x2c')]=moment()[_0x24e1('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7a68e4[_0x383f34][_0x24e1('0x2d')]){_0x7a68e4[_0x383f34]['queuecallerexitAt']=moment()['format'](_0x24e1('0x2e'));}RpcMemberReport[_0x24e1('0x15')](_0x7a68e4[_0x383f34]);}RpcVoiceQueueReport[_0x24e1('0x2f')](_0x7a68e4[_0x383f34]);}};function extractCalleridNumber(_0x467346){var _0x5026c5=_0x467346['match'](/<(.*?)>/);return _0x5026c5?_0x5026c5[0x1]:_0x467346;}Report['prototype']['voiceCallReport']=function(_0x156a69){_0x156a69['destination']=_0x156a69[_0x24e1('0x30')]||_0x156a69[_0x24e1('0x31')];if(_0x156a69[_0x24e1('0x32')]==_0x24e1('0x33')){_0x156a69[_0x24e1('0x34')]=_0x24e1('0x35');_0x156a69[_0x24e1('0x36')]=_0x156a69[_0x24e1('0x35')];if(_0x156a69[_0x24e1('0x37')]==_0x24e1('0x38')){_0x156a69[_0x24e1('0x22')]='';_0x156a69[_0x24e1('0x30')]=extractCalleridNumber(_0x156a69[_0x24e1('0x39')]);}else if(_0x156a69[_0x24e1('0x37')]=='from-sip'){if(_0x156a69['destination']==_0x24e1('0x3a')){_0x156a69[_0x24e1('0x30')]=extractCalleridNumber(_0x156a69[_0x24e1('0x3b')]);_0x156a69[_0x24e1('0x3c')]=_0x156a69['originatecalleridnum'];_0x156a69[_0x24e1('0x3d')]=[_0x156a69[_0x24e1('0x3e')],_0x156a69[_0x24e1('0x3e')]=_0x156a69[_0x24e1('0x3d')]][0x0];_0x156a69[_0x24e1('0x39')]=_0x156a69[_0x24e1('0x3b')];}else{_0x156a69[_0x24e1('0x30')]=_0x156a69[_0x24e1('0x3c')];_0x156a69['calleridnum']=_0x156a69[_0x24e1('0x3f')];if(_0x156a69[_0x24e1('0x40')]==_0x24e1('0x41')){_0x156a69[_0x24e1('0x22')]=_0x156a69[_0x24e1('0x27')];}else{_0x156a69[_0x24e1('0x22')]='';}}}}else{_0x156a69[_0x24e1('0x39')]=util['format'](_0x24e1('0x42'),_0x156a69[_0x24e1('0x43')],_0x156a69[_0x24e1('0x3c')]);}if(RpcVoiceTransferReport[_0x24e1('0x44')][_0x156a69[_0x24e1('0x45')]]){var _0x18b3e0=RpcVoiceTransferReport[_0x24e1('0x44')][_0x156a69[_0x24e1('0x45')]];_0x18b3e0[_0x24e1('0x46')]=_0x156a69['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x18b3e0);delete RpcVoiceTransferReport[_0x24e1('0x44')][_0x156a69[_0x24e1('0x45')]];}RpcVoiceCallReport[_0x24e1('0x2f')](_0x156a69);if(_0x156a69['monitor']){for(var _0x3fdc98=0x0;_0x3fdc98<_0x156a69[_0x24e1('0x47')][_0x24e1('0x48')];_0x3fdc98+=0x1){_0x156a69['monitorFilename']=_0x156a69['monitors'][_0x3fdc98][_0x24e1('0x49')];_0x156a69[_0x24e1('0x4a')]=_0x156a69[_0x24e1('0x47')][_0x3fdc98]['createdAt'];if(_0x156a69[_0x24e1('0x31')]==_0x24e1('0x3a')){_0x156a69['calleridnum']=_0x156a69['connectedlinenum'];_0x156a69[_0x24e1('0x43')]=_0x156a69[_0x24e1('0x4b')];_0x156a69[_0x24e1('0x27')]=_0x156a69[_0x24e1('0x22')];_0x156a69[_0x24e1('0x4b')]=_0x156a69[_0x24e1('0x4c')];_0x156a69[_0x24e1('0x31')]=_0x156a69[_0x24e1('0x3f')];}else if(_0x156a69[_0x24e1('0x31')]=='xcally-motion-dialer'){_0x156a69[_0x24e1('0x3c')]=_0x156a69[_0x24e1('0x30')];_0x156a69['exten']=_0x156a69[_0x24e1('0x3f')];}RpcVoiceRecording['create'](_0x156a69);}}};Report['prototype']['voiceAgentReport']=function(_0xe82a38){if(_[_0x24e1('0x4d')](_0xe82a38)){_0xe82a38[_0x24e1('0x4e')](function(_0x20a70f){RpcVoiceAgentReport[_0x24e1('0x2f')](_0x20a70f);});}else{RpcVoiceAgentReport[_0x24e1('0x2f')](_0xe82a38);}};Report['prototype'][_0x24e1('0x1c')]=function(_0x5827c7){RpcVoiceDialReport[_0x24e1('0x2f')](_0x5827c7);var _0x3633d1;var _0x249cba;var _0x4c8607=_0x5827c7[_0x24e1('0x3e')];if(_[_0x24e1('0x4f')](_0x4c8607,_0x24e1('0x50'))){_0x249cba=_0x4c8607[_0x24e1('0x51')](_0x4c8607['indexOf']('/')+0x1,_0x4c8607[_0x24e1('0x52')]('@'));_0x3633d1=_['find'](this[_0x24e1('0xf')],function(_0x3eb7db){return _0x3eb7db[_0x24e1('0x53')]==_0x249cba||_0x3eb7db['phone']==_0x249cba||_0x3eb7db['accountcode']==_0x249cba;});}else{_0x249cba=_0x4c8607['substring'](_0x4c8607[_0x24e1('0x52')]('/')+0x1,_0x4c8607[_0x24e1('0x54')]('-'));_0x3633d1=this['findAgent'](_0x249cba);}if(_0x3633d1){_0x5827c7[_0x24e1('0x25')]=_[_0x24e1('0x23')](_0x3633d1[_0x24e1('0x25')])?util[_0x24e1('0x26')](_0x24e1('0x2a'),_0x3633d1[_0x24e1('0x24')]):_0x3633d1[_0x24e1('0x25')];_0x5827c7['membername']=_0x3633d1['name'];_0x5827c7[_0x24e1('0x22')]=_0x3633d1['accountcode'];RpcMemberReport[_0x24e1('0x1c')](_0x5827c7);}};Report['prototype'][_0x24e1('0x1d')]=function(_0x121113){RpcVoiceTransferReport[_0x24e1('0x44')][_0x121113[_0x24e1('0x55')]]=_0x121113;};Report[_0x24e1('0x11')][_0x24e1('0x1f')]=function(_0x2812ec){RpcVoiceTransferReport[_0x24e1('0x1f')](_0x2812ec);};module['exports']=Report; \ No newline at end of file +var _0x9916=['../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','isNil','name','find','interface','SIP/%s','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','dialer','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','connectedlinenum','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','create','length','monitorFilename','filename','createdAt','monitors','exten','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x9916,0x1be));var _0x6991=function(_0x4d6148,_0x414497){_0x4d6148=_0x4d6148-0x0;var _0x337be5=_0x9916[_0x4d6148];return _0x337be5;};'use strict';var _=require(_0x6991('0x0'));var moment=require(_0x6991('0x1'));var util=require(_0x6991('0x2'));var config=require(_0x6991('0x3'));var ami=require(_0x6991('0x4'));var RpcVoiceAgentReport=require(_0x6991('0x5'));var RpcVoiceCallReport=require(_0x6991('0x6'));var RpcVoiceDialReport=require(_0x6991('0x7'));var RpcMemberReport=require(_0x6991('0x8'));var RpcVoiceQueueReport=require(_0x6991('0x9'));var RpcVoiceRecording=require(_0x6991('0xa'));var RpcVoiceTransferReport=require(_0x6991('0xb'));var VoiceQueueReport=require(_0x6991('0xc'));var VoiceCallReport=require(_0x6991('0xd'));var VoiceAgentReport=require(_0x6991('0xe'));var VoiceDialReport=require(_0x6991('0xf'));var UserReport=require('./userReport');function Report(_0x12a7dc){this[_0x6991('0x10')]=_0x12a7dc;this[_0x6991('0x11')]=_0x12a7dc[_0x6991('0x11')];this[_0x6991('0x12')]=_0x12a7dc['telephones'];}Report[_0x6991('0x13')][_0x6991('0x14')]=function(_0x1d8d75){var _0x352982=new VoiceQueueReport(this[_0x6991('0x10')]);var _0x2e2199=new VoiceAgentReport(this[_0x6991('0x10')]);var _0x57dddc=new VoiceDialReport(this['realtime']);var _0x4b5eaa=new VoiceCallReport(this[_0x6991('0x10')]);var _0x561f5c=new UserReport(this['realtime']);if(config[_0x6991('0x15')]&&config[_0x6991('0x15')][_0x6991('0x16')]){ami['on'](_0x6991('0x17'),this[_0x6991('0x18')]['bind'](this));ami['on'](_0x6991('0x19'),this[_0x6991('0x1a')][_0x6991('0x1b')](this));ami['on'](_0x6991('0x1c'),this[_0x6991('0x1d')][_0x6991('0x1b')](this));ami['on']('custom:voiceDialReport',this[_0x6991('0x1e')]['bind'](this));ami['on'](_0x6991('0x1f'),this[_0x6991('0x20')][_0x6991('0x1b')](this));ami['on']('attendedtransfer',this[_0x6991('0x21')]['bind'](this));}};Report[_0x6991('0x13')][_0x6991('0x22')]=function(_0x654afb){var _0x26133f;_0x26133f=_['find'](this[_0x6991('0x11')],function(_0x326422){return _0x326422[_0x6991('0x23')]==_0x654afb||_0x326422['name']==_0x654afb;});if(_[_0x6991('0x24')](_0x26133f)){var _0x55b301=_['find'](this[_0x6991('0x12')],function(_0x2d2891){return _0x2d2891[_0x6991('0x23')]==_0x654afb||_0x2d2891[_0x6991('0x25')]==_0x654afb;});if(_0x55b301){_0x26133f=_[_0x6991('0x26')](this[_0x6991('0x11')],function(_0x2f79bf){return _0x2f79bf[_0x6991('0x27')]==util['format'](_0x6991('0x28'),_0x55b301[_0x6991('0x25')]);});}}return _0x26133f;};Report[_0x6991('0x13')]['voiceQueueReport']=function(_0x211ceb){for(var _0x4ef058=0x0;_0x4ef058<_0x211ceb['length'];_0x4ef058+=0x1){var _0x4d6d45=this[_0x6991('0x22')](_0x211ceb[_0x4ef058]['connectedlinenum']);if(_0x4d6d45){_0x211ceb[_0x4ef058][_0x6991('0x23')]=_0x4d6d45[_0x6991('0x23')];_0x211ceb[_0x4ef058][_0x6991('0x29')]=!![];_0x211ceb[_0x4ef058][_0x6991('0x2a')]=_0x4d6d45[_0x6991('0x25')];_0x211ceb[_0x4ef058][_0x6991('0x27')]=_[_0x6991('0x24')](_0x4d6d45[_0x6991('0x27')])?util[_0x6991('0x2b')](_0x6991('0x28'),_0x4d6d45['name']):_0x4d6d45[_0x6991('0x27')];if(_0x211ceb[_0x4ef058][_0x6991('0x2c')]){_0x211ceb[_0x4ef058][_0x6991('0x2d')]=moment()[_0x6991('0x2b')](_0x6991('0x2e'));}if(_0x211ceb[_0x4ef058][_0x6991('0x2f')]){_0x211ceb[_0x4ef058][_0x6991('0x30')]=moment()[_0x6991('0x2b')](_0x6991('0x2e'));}RpcMemberReport[_0x6991('0x18')](_0x211ceb[_0x4ef058]);}RpcVoiceQueueReport['create'](_0x211ceb[_0x4ef058]);}};function extractCalleridNumber(_0x2a355c){var _0x27bd3f=_0x2a355c[_0x6991('0x31')](/<(.*?)>/);return _0x27bd3f?_0x27bd3f[0x1]:_0x2a355c;}Report[_0x6991('0x13')]['voiceCallReport']=function(_0x2e0f62){_0x2e0f62[_0x6991('0x32')]=_0x2e0f62[_0x6991('0x32')]||_0x2e0f62['exten'];if(_0x2e0f62['type']==_0x6991('0x33')){_0x2e0f62['lastapplication']=_0x6991('0x34');_0x2e0f62[_0x6991('0x35')]=_0x2e0f62['queue'];if(_0x2e0f62[_0x6991('0x36')]=='from-voip-provider'){_0x2e0f62[_0x6991('0x23')]='';_0x2e0f62[_0x6991('0x32')]=extractCalleridNumber(_0x2e0f62['callerid']);}else if(_0x2e0f62[_0x6991('0x36')]==_0x6991('0x37')){if(_0x2e0f62[_0x6991('0x32')]==_0x6991('0x38')){_0x2e0f62['destination']=extractCalleridNumber(_0x2e0f62[_0x6991('0x39')]);_0x2e0f62[_0x6991('0x3a')]=_0x2e0f62[_0x6991('0x3b')];_0x2e0f62[_0x6991('0x3c')]=[_0x2e0f62[_0x6991('0x3d')],_0x2e0f62[_0x6991('0x3d')]=_0x2e0f62[_0x6991('0x3c')]][0x0];_0x2e0f62[_0x6991('0x3e')]=_0x2e0f62[_0x6991('0x39')];}else{_0x2e0f62[_0x6991('0x32')]=_0x2e0f62[_0x6991('0x3a')];_0x2e0f62['calleridnum']=_0x2e0f62['originatecalleridnum'];if(_0x2e0f62[_0x6991('0x3f')]==_0x6991('0x40')){_0x2e0f62[_0x6991('0x23')]=_0x2e0f62[_0x6991('0x41')];}else{_0x2e0f62[_0x6991('0x23')]='';}}}}else{_0x2e0f62[_0x6991('0x3e')]=util['format']('\x22%s\x22\x20<%s>',_0x2e0f62[_0x6991('0x42')],_0x2e0f62[_0x6991('0x3a')]);}if(RpcVoiceTransferReport['transfers'][_0x2e0f62['linkedid']]){var _0x46299d=RpcVoiceTransferReport[_0x6991('0x43')][_0x2e0f62['linkedid']];_0x46299d[_0x6991('0x44')]=_0x2e0f62[_0x6991('0x45')];RpcVoiceTransferReport[_0x6991('0x20')](_0x46299d);delete RpcVoiceTransferReport[_0x6991('0x43')][_0x2e0f62[_0x6991('0x46')]];}RpcVoiceCallReport[_0x6991('0x47')](_0x2e0f62);if(_0x2e0f62['monitor']){for(var _0x2ec884=0x0;_0x2ec884<_0x2e0f62['monitors'][_0x6991('0x48')];_0x2ec884+=0x1){_0x2e0f62[_0x6991('0x49')]=_0x2e0f62['monitors'][_0x2ec884][_0x6991('0x4a')];_0x2e0f62[_0x6991('0x4b')]=_0x2e0f62[_0x6991('0x4c')][_0x2ec884][_0x6991('0x4b')];if(_0x2e0f62[_0x6991('0x4d')]==_0x6991('0x38')){_0x2e0f62[_0x6991('0x3a')]=_0x2e0f62[_0x6991('0x41')];_0x2e0f62[_0x6991('0x42')]=_0x2e0f62['connectedlinename'];_0x2e0f62[_0x6991('0x41')]=_0x2e0f62[_0x6991('0x23')];_0x2e0f62['connectedlinename']=_0x2e0f62[_0x6991('0x4e')];_0x2e0f62[_0x6991('0x4d')]=_0x2e0f62[_0x6991('0x3b')];}else if(_0x2e0f62[_0x6991('0x4d')]==_0x6991('0x4f')){_0x2e0f62[_0x6991('0x3a')]=_0x2e0f62['destination'];_0x2e0f62[_0x6991('0x4d')]=_0x2e0f62['originatecalleridnum'];}RpcVoiceRecording[_0x6991('0x47')](_0x2e0f62);}}};Report[_0x6991('0x13')][_0x6991('0x1d')]=function(_0x477934){if(_[_0x6991('0x50')](_0x477934)){_0x477934[_0x6991('0x51')](function(_0x26c4d5){RpcVoiceAgentReport[_0x6991('0x47')](_0x26c4d5);});}else{RpcVoiceAgentReport['create'](_0x477934);}};Report[_0x6991('0x13')][_0x6991('0x1e')]=function(_0x505704){RpcVoiceDialReport[_0x6991('0x47')](_0x505704);var _0x500367;var _0x4a6f74;var _0x29617b=_0x505704['channel'];if(_[_0x6991('0x52')](_0x29617b,_0x6991('0x53'))){_0x4a6f74=_0x29617b[_0x6991('0x54')](_0x29617b[_0x6991('0x55')]('/')+0x1,_0x29617b[_0x6991('0x55')]('@'));_0x500367=_['find'](this[_0x6991('0x11')],function(_0x4cb3e8){return _0x4cb3e8[_0x6991('0x56')]==_0x4a6f74||_0x4cb3e8[_0x6991('0x57')]==_0x4a6f74||_0x4cb3e8['accountcode']==_0x4a6f74;});}else{_0x4a6f74=_0x29617b['substring'](_0x29617b[_0x6991('0x55')]('/')+0x1,_0x29617b[_0x6991('0x58')]('-'));_0x500367=this[_0x6991('0x22')](_0x4a6f74);}if(_0x500367){_0x505704[_0x6991('0x27')]=_['isNil'](_0x500367[_0x6991('0x27')])?util[_0x6991('0x2b')](_0x6991('0x28'),_0x500367[_0x6991('0x25')]):_0x500367['interface'];_0x505704[_0x6991('0x4e')]=_0x500367[_0x6991('0x25')];_0x505704[_0x6991('0x23')]=_0x500367[_0x6991('0x23')];RpcMemberReport[_0x6991('0x1e')](_0x505704);}};Report[_0x6991('0x13')][_0x6991('0x20')]=function(_0x2c84d6){RpcVoiceTransferReport[_0x6991('0x43')][_0x2c84d6[_0x6991('0x59')]]=_0x2c84d6;};Report['prototype'][_0x6991('0x21')]=function(_0x37b0bf){RpcVoiceTransferReport[_0x6991('0x21')](_0x37b0bf);};module[_0x6991('0x5a')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 395a2f1..c77d62b 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 _0x06ae=['merge','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','syncDeviceState','isNotNull','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','format','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','localhost','trunks','agents','telephones','registryentry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','inspect','resolve','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isUndefined','emit','syncRegistry','username','state','debug','[userReport][registry]','find'];(function(_0x3ddd84,_0x2cbf16){var _0xfac0a2=function(_0x1dad7b){while(--_0x1dad7b){_0x3ddd84['push'](_0x3ddd84['shift']());}};_0xfac0a2(++_0x2cbf16);}(_0x06ae,0x191));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe06a('0x0'));var moment=require(_0xe06a('0x1'));var util=require(_0xe06a('0x2'));var Redis=require(_0xe06a('0x3'));var BPromise=require(_0xe06a('0x4'));var config=require(_0xe06a('0x5'));var logger=require(_0xe06a('0x6'))('ami');var ami=require(_0xe06a('0x7'));config[_0xe06a('0x8')]=_['defaults'](config[_0xe06a('0x8')],{'host':_0xe06a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe06a('0x8')]));function UserReport(_0x60220f){this[_0xe06a('0xa')]=_0x60220f[_0xe06a('0xa')];this[_0xe06a('0xb')]=_0x60220f[_0xe06a('0xb')];this[_0xe06a('0xc')]=_0x60220f[_0xe06a('0xc')];ami['on'](_0xe06a('0xd'),this['syncRegistry'][_0xe06a('0xe')](this));ami['on'](_0xe06a('0xf'),this['syncRegistry'][_0xe06a('0xe')](this));ami['on'](_0xe06a('0x10'),this['syncDeviceState'][_0xe06a('0xe')](this));ami['on'](_0xe06a('0x11'),this[_0xe06a('0x12')][_0xe06a('0xe')](this));return this[_0xe06a('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0xe06a('0x14')](ami[_0xe06a('0x15')]())[_0xe06a('0x16')](function(_0x956294){logger[_0xe06a('0x17')]('[userReport][sipshowregistry]',util[_0xe06a('0x18')](_0x956294,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xe06a('0x19')]()[_0xe06a('0x14')](ami[_0xe06a('0x1a')]())[_0xe06a('0x16')](function(_0x89c654){logger[_0xe06a('0x17')]('[userReport][devicestatelist]',util[_0xe06a('0x18')](_0x89c654,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xe06a('0x19')]()[_0xe06a('0x14')](ami['actionSipPeerStatus']())['catch'](function(_0x1f67cd){logger[_0xe06a('0x17')](_0xe06a('0x1b'),util[_0xe06a('0x18')](_0x1f67cd,{'showHidden':![],'depth':null}));});}UserReport[_0xe06a('0x1c')][_0xe06a('0x13')]=function(){setInterval(function(){BPromise[_0xe06a('0x19')]()['then'](showSipRegistrations())[_0xe06a('0x14')](listDeviceStates())[_0xe06a('0x14')](showPeersStatus());},0x32c8);};UserReport[_0xe06a('0x1c')]['isNotNull']=function(_0x402bcd){return _0x402bcd!==null&&!_[_0xe06a('0x1d')](_0x402bcd);};UserReport['prototype'][_0xe06a('0x1e')]=function(_0x1cd821,_0x488e4a,_0xf10fe2){io['to'](_0x1cd821)['emit'](_0x488e4a,_0xf10fe2);};UserReport[_0xe06a('0x1c')][_0xe06a('0x1f')]=function(_0x4cb5b4){try{if(this['isNotNull'](_0x4cb5b4)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x4cb5b4[_0xe06a('0x20')],_0x4cb5b4[_0xe06a('0x21')]);logger[_0xe06a('0x22')](_0xe06a('0x23'),util['inspect'](_0x4cb5b4,{'showHidden':![],'depth':null}));var _0x51cc2f=_[_0xe06a('0x24')](this[_0xe06a('0xa')],{'defaultuser':_0x4cb5b4[_0xe06a('0x20')]});if(_0x51cc2f){_0x4cb5b4['stateRegistry']=_0x4cb5b4['state'];_[_0xe06a('0x25')](_0x51cc2f,_['omit'](_0x4cb5b4,['event',_0xe06a('0x26'),_0xe06a('0x20'),_0xe06a('0x21')]));logger['debug'](_0xe06a('0x27'),util[_0xe06a('0x18')](_0x51cc2f,{'showHidden':![],'depth':null}));this[_0xe06a('0x1e')](util['format'](_0xe06a('0x28'),_0x51cc2f[_0xe06a('0x29')]),_0xe06a('0x2a'),_0x51cc2f);}}}catch(_0x29b47d){logger['error'](_0xe06a('0x23'),util['inspect'](_0x29b47d,{'showHidden':![],'depth':null}));}};UserReport[_0xe06a('0x1c')][_0xe06a('0x2b')]=function(_0xe97cbb){try{if(this[_0xe06a('0x2c')](_0xe97cbb)){logger[_0xe06a('0x2d')](_0xe06a('0x2e'),_0xe97cbb[_0xe06a('0x2f')],_0xe97cbb[_0xe06a('0x21')]);logger[_0xe06a('0x22')](_0xe06a('0x30'),util[_0xe06a('0x18')](_0xe97cbb,{'showHidden':![],'depth':null}));if(this[_0xe06a('0xb')][_0xe97cbb[_0xe06a('0x2f')]]){if(!this[_0xe06a('0xb')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x31')]||_0xe97cbb[_0xe06a('0x21')]['toLowerCase']()=='inuse'){this[_0xe06a('0xb')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x31')]=![];if(this['agents'][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x21')]!==_0xe97cbb['state'][_0xe06a('0x32')]()){this[_0xe06a('0xb')][_0xe97cbb['device']][_0xe06a('0x33')]=_['toNumber'](moment()[_0xe06a('0x34')]('x'));}this[_0xe06a('0xb')][_0xe97cbb[_0xe06a('0x2f')]]['state']=_0xe97cbb[_0xe06a('0x21')]['toLowerCase']();this[_0xe06a('0xb')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x35')](_0xe97cbb);}}else if(this[_0xe06a('0xc')][_0xe97cbb[_0xe06a('0x2f')]]){if(this['telephones'][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x21')]!==_0xe97cbb[_0xe06a('0x21')][_0xe06a('0x32')]()){this[_0xe06a('0xc')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x33')]=_[_0xe06a('0x36')](moment()[_0xe06a('0x34')]('x'));}this[_0xe06a('0xc')][_0xe97cbb[_0xe06a('0x2f')]]['state']=_0xe97cbb['state']['toLowerCase']();logger[_0xe06a('0x22')](_0xe06a('0x37'),util[_0xe06a('0x18')](this[_0xe06a('0xc')][_0xe97cbb['device']],{'showHidden':![],'depth':null}));this[_0xe06a('0x1e')](util[_0xe06a('0x34')](_0xe06a('0x38'),this[_0xe06a('0xc')][_0xe97cbb[_0xe06a('0x2f')]]['name']),_0xe06a('0x39'),this['telephones'][_0xe97cbb[_0xe06a('0x2f')]]);}else if(this['trunks'][_0xe97cbb[_0xe06a('0x2f')]]){if(this['trunks'][_0xe97cbb['device']][_0xe06a('0x21')]!==_0xe97cbb['state'][_0xe06a('0x32')]()){this[_0xe06a('0xa')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x33')]=_[_0xe06a('0x36')](moment()['format']('x'));}this[_0xe06a('0xa')][_0xe97cbb['device']][_0xe06a('0x21')]=_0xe97cbb['state'][_0xe06a('0x32')]();logger[_0xe06a('0x22')](_0xe06a('0x3a'),util[_0xe06a('0x18')](this[_0xe06a('0xa')][_0xe97cbb['device']],{'showHidden':![],'depth':null}));this[_0xe06a('0x1e')](util['format'](_0xe06a('0x28'),this[_0xe06a('0xa')][_0xe97cbb[_0xe06a('0x2f')]][_0xe06a('0x29')]),_0xe06a('0x2a'),this[_0xe06a('0xa')][_0xe97cbb[_0xe06a('0x2f')]]);}else if(_[_0xe06a('0x3b')](_0xe97cbb[_0xe06a('0x2f')],'Local')){var _0x4b99f2=_0xe97cbb[_0xe06a('0x2f')];var _0x372a5a=_0x4b99f2[_0xe06a('0x3c')](_0x4b99f2[_0xe06a('0x3d')]('/')+0x1,_0x4b99f2[_0xe06a('0x3d')]('@'));var _0x33f625=_[_0xe06a('0x24')](this[_0xe06a('0xb')],function(_0x29378c){return _0x29378c[_0xe06a('0x3e')]==_0x372a5a||_0x29378c[_0xe06a('0x3f')]==_0x372a5a||_0x29378c[_0xe06a('0x40')]==_0x372a5a;});if(_0x33f625){if(_0x33f625[_0xe06a('0x21')]!==_0xe97cbb[_0xe06a('0x21')][_0xe06a('0x32')]()){_0x33f625['stateTime']=_[_0xe06a('0x36')](moment()[_0xe06a('0x34')]('x'));}_0x33f625['state']=_0xe97cbb[_0xe06a('0x21')]['toLowerCase']();_0x33f625[_0xe06a('0x31')]=!![];_0x33f625[_0xe06a('0x35')](_0xe97cbb);}}}}catch(_0x59b8a4){logger[_0xe06a('0x17')]('[userReport][devicestatechange]',util[_0xe06a('0x18')](_0x59b8a4,{'showHidden':![],'depth':null}));}};UserReport[_0xe06a('0x1c')][_0xe06a('0x12')]=function(_0x4728d4){try{if(this['isNotNull'](_0x4728d4)&&this[_0xe06a('0x2c')](_0x4728d4['peerstatus'])){logger[_0xe06a('0x2d')](_0xe06a('0x41'),_0x4728d4[_0xe06a('0x42')],_0x4728d4['address'],_0x4728d4[_0xe06a('0x11')]);logger['debug'](_0xe06a('0x43'),util[_0xe06a('0x18')](_0x4728d4,{'showHidden':![],'depth':null}));if(this[_0xe06a('0xb')][_0x4728d4[_0xe06a('0x42')]]){if(!this[_0xe06a('0xb')][_0x4728d4[_0xe06a('0x42')]][_0xe06a('0x31')]||_0x4728d4[_0xe06a('0x11')]['toLowerCase']()==_0xe06a('0x44')){this[_0xe06a('0xb')][_0x4728d4[_0xe06a('0x42')]][_0xe06a('0x31')]=![];this[_0xe06a('0xb')][_0x4728d4['peer']][_0xe06a('0x45')]=_0x4728d4[_0xe06a('0x11')][_0xe06a('0x32')]();this[_0xe06a('0xb')][_0x4728d4[_0xe06a('0x42')]]['address']=_0x4728d4['address'];this[_0xe06a('0xb')][_0x4728d4[_0xe06a('0x42')]][_0xe06a('0x35')](_0x4728d4);}}else if(this[_0xe06a('0xc')][_0x4728d4[_0xe06a('0x42')]]){this[_0xe06a('0xc')][_0x4728d4[_0xe06a('0x42')]]['status']=_0x4728d4[_0xe06a('0x11')][_0xe06a('0x32')]();this['telephones'][_0x4728d4['peer']][_0xe06a('0x46')]=_0x4728d4['address'];logger['debug'](_0xe06a('0x47'),util[_0xe06a('0x18')](this[_0xe06a('0xc')][_0x4728d4[_0xe06a('0x42')]],{'showHidden':![],'depth':null}));this[_0xe06a('0x1e')](util[_0xe06a('0x34')]('telephone:%s',this[_0xe06a('0xc')][_0x4728d4['peer']][_0xe06a('0x29')]),_0xe06a('0x39'),this[_0xe06a('0xc')][_0x4728d4['peer']]);}else if(this[_0xe06a('0xa')][_0x4728d4[_0xe06a('0x42')]]){this[_0xe06a('0xa')][_0x4728d4[_0xe06a('0x42')]]['status']=_0x4728d4[_0xe06a('0x11')][_0xe06a('0x32')]();this[_0xe06a('0xa')][_0x4728d4[_0xe06a('0x42')]][_0xe06a('0x46')]=_0x4728d4['address'];logger[_0xe06a('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xe06a('0x18')](this[_0xe06a('0xa')][_0x4728d4['peer']],{'showHidden':![],'depth':null}));this[_0xe06a('0x1e')](util['format']('trunk:%s',this[_0xe06a('0xa')][_0x4728d4['peer']]['name']),_0xe06a('0x2a'),this[_0xe06a('0xa')][_0x4728d4[_0xe06a('0x42')]]);}}}catch(_0x5964e8){logger[_0xe06a('0x17')](_0xe06a('0x43'),util['inspect'](_0x5964e8,{'showHidden':![],'depth':null}));}};module[_0xe06a('0x48')]=UserReport; \ No newline at end of file +var _0xf51d=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','bluebird','ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','then','catch','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','emit','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','indexOf','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address'];(function(_0x768f01,_0x13816b){var _0x567041=function(_0x31a5b1){while(--_0x31a5b1){_0x768f01['push'](_0x768f01['shift']());}};_0x567041(++_0x13816b);}(_0xf51d,0x94));var _0xdf51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf51('0x0'));var moment=require(_0xdf51('0x1'));var util=require(_0xdf51('0x2'));var Redis=require('ioredis');var BPromise=require(_0xdf51('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xdf51('0x4'));var ami=require('../ami');config[_0xdf51('0x5')]=_[_0xdf51('0x6')](config[_0xdf51('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xdf51('0x7'))(new Redis(config['redis']));function UserReport(_0x1a4210){this[_0xdf51('0x8')]=_0x1a4210[_0xdf51('0x8')];this['agents']=_0x1a4210[_0xdf51('0x9')];this[_0xdf51('0xa')]=_0x1a4210['telephones'];ami['on'](_0xdf51('0xb'),this['syncRegistry'][_0xdf51('0xc')](this));ami['on'](_0xdf51('0xd'),this[_0xdf51('0xe')][_0xdf51('0xc')](this));ami['on']('devicestatechange',this[_0xdf51('0xf')]['bind'](this));ami['on'](_0xdf51('0x10'),this[_0xdf51('0x11')][_0xdf51('0xc')](this));return this[_0xdf51('0x12')]();}function showSipRegistrations(){Promise[_0xdf51('0x13')]()['then'](ami[_0xdf51('0x14')]())['catch'](function(_0x1eb247){logger[_0xdf51('0x15')](_0xdf51('0x16'),util[_0xdf51('0x17')](_0x1eb247,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xdf51('0x13')]()[_0xdf51('0x18')](ami['actionDeviceStateList']())[_0xdf51('0x19')](function(_0x36f358){logger[_0xdf51('0x15')]('[userReport][devicestatelist]',util[_0xdf51('0x17')](_0x36f358,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xdf51('0x13')]()[_0xdf51('0x18')](ami['actionSipPeerStatus']())[_0xdf51('0x19')](function(_0x2b9a04){logger[_0xdf51('0x15')](_0xdf51('0x1a'),util[_0xdf51('0x17')](_0x2b9a04,{'showHidden':![],'depth':null}));});}UserReport[_0xdf51('0x1b')][_0xdf51('0x12')]=function(){setInterval(function(){BPromise[_0xdf51('0x13')]()[_0xdf51('0x18')](showSipRegistrations())[_0xdf51('0x18')](listDeviceStates())[_0xdf51('0x18')](showPeersStatus());},0x32c8);};UserReport[_0xdf51('0x1b')][_0xdf51('0x1c')]=function(_0x4d83d0){return _0x4d83d0!==null&&!_[_0xdf51('0x1d')](_0x4d83d0);};UserReport[_0xdf51('0x1b')]['emit']=function(_0x178d62,_0x569cdf,_0x55d421){io['to'](_0x178d62)['emit'](_0x569cdf,_0x55d421);};UserReport[_0xdf51('0x1b')][_0xdf51('0xe')]=function(_0x2310c9){try{if(this[_0xdf51('0x1c')](_0x2310c9)){logger[_0xdf51('0x1e')](_0xdf51('0x1f'),_0x2310c9[_0xdf51('0x20')],_0x2310c9[_0xdf51('0x21')]);logger['debug'](_0xdf51('0x22'),util[_0xdf51('0x17')](_0x2310c9,{'showHidden':![],'depth':null}));var _0x134344=_[_0xdf51('0x23')](this['trunks'],{'defaultuser':_0x2310c9[_0xdf51('0x20')]});if(_0x134344){_0x2310c9[_0xdf51('0x24')]=_0x2310c9[_0xdf51('0x21')];_[_0xdf51('0x25')](_0x134344,_[_0xdf51('0x26')](_0x2310c9,[_0xdf51('0x27'),'actionid',_0xdf51('0x20'),'state']));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x134344,{'showHidden':![],'depth':null}));this[_0xdf51('0x28')](util['format'](_0xdf51('0x29'),_0x134344[_0xdf51('0x2a')]),_0xdf51('0x2b'),_0x134344);}}}catch(_0x340b08){logger[_0xdf51('0x15')](_0xdf51('0x22'),util[_0xdf51('0x17')](_0x340b08,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xdf51('0xf')]=function(_0x133a55){try{if(this['isNotNull'](_0x133a55)){logger[_0xdf51('0x1e')](_0xdf51('0x2c'),_0x133a55[_0xdf51('0x2d')],_0x133a55[_0xdf51('0x21')]);logger[_0xdf51('0x2e')](_0xdf51('0x2f'),util[_0xdf51('0x17')](_0x133a55,{'showHidden':![],'depth':null}));if(this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]]){if(!this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x30')]||_0x133a55[_0xdf51('0x21')][_0xdf51('0x31')]()==_0xdf51('0x32')){this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]]['local']=![];if(this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]!==_0x133a55[_0xdf51('0x21')][_0xdf51('0x31')]()){this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x33')]=_[_0xdf51('0x34')](moment()[_0xdf51('0x35')]('x'));}this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]=_0x133a55[_0xdf51('0x21')][_0xdf51('0x31')]();this[_0xdf51('0x9')][_0x133a55[_0xdf51('0x2d')]]['updateStatusRealtime'](_0x133a55);}}else if(this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]]){if(this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]!==_0x133a55[_0xdf51('0x21')][_0xdf51('0x31')]()){this['telephones'][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x33')]=_[_0xdf51('0x34')](moment()[_0xdf51('0x35')]('x'));}this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]=_0x133a55[_0xdf51('0x21')]['toLowerCase']();logger[_0xdf51('0x2e')](_0xdf51('0x36'),util[_0xdf51('0x17')](this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]],{'showHidden':![],'depth':null}));this[_0xdf51('0x28')](util[_0xdf51('0x35')](_0xdf51('0x37'),this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]]['name']),_0xdf51('0x38'),this[_0xdf51('0xa')][_0x133a55[_0xdf51('0x2d')]]);}else if(this['trunks'][_0x133a55[_0xdf51('0x2d')]]){if(this[_0xdf51('0x8')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]!==_0x133a55['state'][_0xdf51('0x31')]()){this[_0xdf51('0x8')][_0x133a55[_0xdf51('0x2d')]]['stateTime']=_[_0xdf51('0x34')](moment()[_0xdf51('0x35')]('x'));}this[_0xdf51('0x8')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x21')]=_0x133a55[_0xdf51('0x21')][_0xdf51('0x31')]();logger[_0xdf51('0x2e')](_0xdf51('0x39'),util[_0xdf51('0x17')](this['trunks'][_0x133a55['device']],{'showHidden':![],'depth':null}));this[_0xdf51('0x28')](util['format'](_0xdf51('0x29'),this[_0xdf51('0x8')][_0x133a55[_0xdf51('0x2d')]][_0xdf51('0x2a')]),_0xdf51('0x2b'),this[_0xdf51('0x8')][_0x133a55['device']]);}else if(_[_0xdf51('0x3a')](_0x133a55['device'],'Local')){var _0x27bb07=_0x133a55[_0xdf51('0x2d')];var _0x2740c9=_0x27bb07['substring'](_0x27bb07[_0xdf51('0x3b')]('/')+0x1,_0x27bb07['indexOf']('@'));var _0x3e887e=_[_0xdf51('0x23')](this[_0xdf51('0x9')],function(_0x73d185){return _0x73d185['mobile']==_0x2740c9||_0x73d185[_0xdf51('0x3c')]==_0x2740c9||_0x73d185[_0xdf51('0x3d')]==_0x2740c9;});if(_0x3e887e){if(_0x3e887e[_0xdf51('0x21')]!==_0x133a55['state']['toLowerCase']()){_0x3e887e[_0xdf51('0x33')]=_[_0xdf51('0x34')](moment()[_0xdf51('0x35')]('x'));}_0x3e887e['state']=_0x133a55['state'][_0xdf51('0x31')]();_0x3e887e['local']=!![];_0x3e887e[_0xdf51('0x3e')](_0x133a55);}}}}catch(_0x51d3e5){logger['error'](_0xdf51('0x2f'),util[_0xdf51('0x17')](_0x51d3e5,{'showHidden':![],'depth':null}));}};UserReport[_0xdf51('0x1b')][_0xdf51('0x11')]=function(_0x48f3c9){try{if(this[_0xdf51('0x1c')](_0x48f3c9)&&this[_0xdf51('0x1c')](_0x48f3c9[_0xdf51('0x10')])){logger[_0xdf51('0x1e')](_0xdf51('0x3f'),_0x48f3c9[_0xdf51('0x40')],_0x48f3c9['address'],_0x48f3c9[_0xdf51('0x10')]);logger[_0xdf51('0x2e')]('[userReport][peerstatus]',util[_0xdf51('0x17')](_0x48f3c9,{'showHidden':![],'depth':null}));if(this['agents'][_0x48f3c9[_0xdf51('0x40')]]){if(!this[_0xdf51('0x9')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x30')]||_0x48f3c9[_0xdf51('0x10')][_0xdf51('0x31')]()==_0xdf51('0x41')){this[_0xdf51('0x9')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x30')]=![];this['agents'][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x42')]=_0x48f3c9[_0xdf51('0x10')][_0xdf51('0x31')]();this[_0xdf51('0x9')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x43')]=_0x48f3c9[_0xdf51('0x43')];this[_0xdf51('0x9')][_0x48f3c9[_0xdf51('0x40')]]['updateStatusRealtime'](_0x48f3c9);}}else if(this[_0xdf51('0xa')][_0x48f3c9['peer']]){this[_0xdf51('0xa')][_0x48f3c9['peer']][_0xdf51('0x42')]=_0x48f3c9[_0xdf51('0x10')]['toLowerCase']();this[_0xdf51('0xa')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x43')]=_0x48f3c9[_0xdf51('0x43')];logger['debug'](_0xdf51('0x44'),util[_0xdf51('0x17')](this[_0xdf51('0xa')][_0x48f3c9[_0xdf51('0x40')]],{'showHidden':![],'depth':null}));this[_0xdf51('0x28')](util[_0xdf51('0x35')](_0xdf51('0x37'),this['telephones'][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x2a')]),_0xdf51('0x38'),this['telephones'][_0x48f3c9[_0xdf51('0x40')]]);}else if(this['trunks'][_0x48f3c9[_0xdf51('0x40')]]){this[_0xdf51('0x8')][_0x48f3c9['peer']][_0xdf51('0x42')]=_0x48f3c9['peerstatus'][_0xdf51('0x31')]();this[_0xdf51('0x8')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x43')]=_0x48f3c9[_0xdf51('0x43')];logger[_0xdf51('0x2e')](_0xdf51('0x45'),util[_0xdf51('0x17')](this[_0xdf51('0x8')][_0x48f3c9[_0xdf51('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xdf51('0x35')](_0xdf51('0x29'),this[_0xdf51('0x8')][_0x48f3c9[_0xdf51('0x40')]][_0xdf51('0x2a')]),'trunk:save',this[_0xdf51('0x8')][_0x48f3c9[_0xdf51('0x40')]]);}}}catch(_0x3d3ced){logger['error'](_0xdf51('0x46'),util[_0xdf51('0x17')](_0x3d3ced,{'showHidden':![],'depth':null}));}};module[_0xdf51('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 5575849..c28c200 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 _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x372845,_0x2aa8e3){var _0x9a7afb=function(_0x3aeb9e){while(--_0x3aeb9e){_0x372845['push'](_0x372845['shift']());}};_0x9a7afb(++_0x2aa8e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x40f1af,_0xb87ab9){var _0x4925b9=function(_0x187864){while(--_0x187864){_0x40f1af['push'](_0x40f1af['shift']());}};_0x4925b9(++_0xb87ab9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 0931419..8e3976a 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 _0xe657=['[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','toNumber','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','transferType','undefined','isEmpty','getSettings','then','StopMixMonitor','catch','Action','webbar:stopmonitors','event','BlindTransfer','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','bind','syncNewExten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','isUndefined','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','pick','includes','lastapplication','lastdata','applicationdata','cdr(','match'];(function(_0x3c5a79,_0x565097){var _0x52835f=function(_0x139063){while(--_0x139063){_0x3c5a79['push'](_0x3c5a79['shift']());}};_0x52835f(++_0x565097);}(_0xe657,0x139));var _0x7e65=function(_0x1e08e4,_0x4d1bc7){_0x1e08e4=_0x1e08e4-0x0;var _0x2dcd25=_0xe657[_0x1e08e4];return _0x2dcd25;};'use strict';var BPromise=require(_0x7e65('0x0'));var _=require(_0x7e65('0x1'));var moment=require(_0x7e65('0x2'));var util=require('util');var path=require('path');var Redis=require('ioredis');var config=require(_0x7e65('0x3'));var logger=require(_0x7e65('0x4'))('ami');var ami=require('../ami');var Channel=require(_0x7e65('0x5'));var RpcSetting=require(_0x7e65('0x6'));var statusDesc=[_0x7e65('0x7'),_0x7e65('0x8'),_0x7e65('0x9'),_0x7e65('0xa'),'invalid',_0x7e65('0xb'),_0x7e65('0xc'),'ringinuse',_0x7e65('0xd')];var applications=[_0x7e65('0xe'),_0x7e65('0xf'),_0x7e65('0x10'),_0x7e65('0x11'),_0x7e65('0x12'),_0x7e65('0x13')];var dispositions=[_0x7e65('0x14'),'FAILED',_0x7e65('0x15'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0x7e65('0x16'),'BUSY',_0x7e65('0x15'),_0x7e65('0x15'),'FAILED'];var actions={};config[_0x7e65('0x17')]=_[_0x7e65('0x18')](config['redis'],{'host':_0x7e65('0x19'),'port':0x18eb});var io=require(_0x7e65('0x1a'))(new Redis(config[_0x7e65('0x17')]));function VoiceCallReport(_0x23148b){this[_0x7e65('0x1b')]=_0x23148b[_0x7e65('0x1b')];this[_0x7e65('0x1c')]=_0x23148b[_0x7e65('0x1c')];this['blindTransfers']={};ami['on']('coreshowchannel',this['syncNewExten'][_0x7e65('0x1d')](this));ami['on']('newexten',this[_0x7e65('0x1e')]['bind'](this));ami['on'](_0x7e65('0x1f'),this[_0x7e65('0x20')][_0x7e65('0x1d')](this));ami['on']('newstate',this[_0x7e65('0x21')]['bind'](this));ami['on'](_0x7e65('0x22'),this[_0x7e65('0x23')][_0x7e65('0x1d')](this));ami['on'](_0x7e65('0x24'),this[_0x7e65('0x25')][_0x7e65('0x1d')](this));ami['on'](_0x7e65('0x26'),this[_0x7e65('0x27')][_0x7e65('0x1d')](this));ami['on'](_0x7e65('0x28'),this[_0x7e65('0x29')][_0x7e65('0x1d')](this));ami['on'](_0x7e65('0x2a'),this[_0x7e65('0x2b')][_0x7e65('0x1d')](this));ami['on'](_0x7e65('0x2c'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x7e65('0x2d'),this[_0x7e65('0x2e')]['bind'](this));try{logger[_0x7e65('0x2f')](_0x7e65('0x30'));ami['actionCoreShowChannels']();}catch(_0x5d756b){logger[_0x7e65('0x31')](_0x7e65('0x32'),util[_0x7e65('0x33')](_0x5d756b,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x7e65('0x34')]=function(_0x39f7dc){return _0x39f7dc!==null&&!_['isUndefined'](_0x39f7dc);};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x36')]=function(_0x4e5008,_0x103d68,_0x500ad4){io['to'](_0x4e5008)['emit'](_0x103d68,_0x500ad4);};VoiceCallReport['prototype'][_0x7e65('0x27')]=function(_0x5ced6d){try{if(this[_0x7e65('0x34')](_0x5ced6d)){logger['info'](_0x7e65('0x37'),_0x5ced6d[_0x7e65('0x38')],_0x5ced6d[_0x7e65('0x39')],_0x5ced6d[_0x7e65('0x3a')]);logger[_0x7e65('0x3b')](_0x7e65('0x3c'),_0x5ced6d[_0x7e65('0x38')],util['inspect'](_0x5ced6d,{'showHidden':![],'depth':null}));if(_0x5ced6d[_0x7e65('0x38')]===_0x5ced6d[_0x7e65('0x3d')]){if(!_['isUndefined'](this[_0x7e65('0x1b')][_0x5ced6d[_0x7e65('0x38')]])){_[_0x7e65('0x3e')](this['channels'][_0x5ced6d[_0x7e65('0x38')]],_['pick'](_0x5ced6d,_[_0x7e65('0x3f')](this[_0x7e65('0x1b')][_0x5ced6d[_0x7e65('0x38')]])));}}if(_0x5ced6d[_0x7e65('0x40')]===_0x7e65('0x41')){if(this[_0x7e65('0x1c')][_0x5ced6d[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]){if(_0x5ced6d[_0x7e65('0x44')]==_0x7e65('0x45')){this[_0x7e65('0x1c')][_0x5ced6d[_0x7e65('0x42')]['split']('-')[0x0]][_0x7e65('0x46')]=_0x5ced6d['connectedlinenum'];this[_0x7e65('0x36')](util[_0x7e65('0x47')](_0x7e65('0x48'),this[_0x7e65('0x1c')][_0x5ced6d[_0x7e65('0x42')]['split']('-')[0x0]][_0x7e65('0x49')]),_0x7e65('0x4a'),{'destaccountcode':this['agents'][_0x5ced6d['channel'][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')],'destconnectedlinenum':_0x5ced6d[_0x7e65('0x4c')]});}}}}}catch(_0x5b4dc2){logger[_0x7e65('0x31')](_0x7e65('0x4d'),_0x5ced6d[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x5b4dc2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7e65('0x20')]=function(_0x3b999e){try{if(this[_0x7e65('0x34')](_0x3b999e)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x3b999e[_0x7e65('0x38')],util['inspect'](_0x3b999e,{'showHidden':![],'depth':null}));if(_0x3b999e['uniqueid']===_0x3b999e[_0x7e65('0x3d')]&&_0x3b999e[_0x7e65('0x42')]!='OutgoingSpoolFailed'){if(_[_0x7e65('0x4e')](this['channels'][_0x3b999e[_0x7e65('0x38')]])){logger[_0x7e65('0x2f')](_0x7e65('0x4f'),_0x3b999e[_0x7e65('0x38')],_0x3b999e[_0x7e65('0x40')],_0x3b999e[_0x7e65('0x44')]);this[_0x7e65('0x1b')][_0x3b999e[_0x7e65('0x38')]]=new Channel();this[_0x7e65('0x1b')][_0x3b999e[_0x7e65('0x38')]][_0x7e65('0x50')]=moment()[_0x7e65('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7e65('0x1b')][_0x3b999e['uniqueid']][_0x7e65('0x51')]=dispositions[_['toNumber'](_0x3b999e[_0x7e65('0x52')])];_[_0x7e65('0x3e')](this['channels'][_0x3b999e[_0x7e65('0x38')]],_['pick'](_0x3b999e,_[_0x7e65('0x3f')](this[_0x7e65('0x1b')][_0x3b999e[_0x7e65('0x38')]])));if(_0x3b999e['context']===_0x7e65('0x41')){if(this[_0x7e65('0x1c')][_0x3b999e['channel'][_0x7e65('0x43')]('-')[0x0]]){if(_['isUndefined'](this[_0x7e65('0x1c')][_0x3b999e[_0x7e65('0x42')]['split']('-')[0x0]][_0x7e65('0x46')])){this['agents'][_0x3b999e[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x46')]=_0x3b999e['exten'];logger[_0x7e65('0x3b')](_0x7e65('0x53'),_0x3b999e[_0x7e65('0x38')],util['inspect']({'destaccountcode':this[_0x7e65('0x1c')][_0x3b999e[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')],'destconnectedlinenum':_0x3b999e['exten']},{'showHidden':![],'depth':null}));this[_0x7e65('0x36')](util[_0x7e65('0x47')]('user:%s',this[_0x7e65('0x1c')][_0x3b999e[_0x7e65('0x42')]['split']('-')[0x0]][_0x7e65('0x49')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x3b999e[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')],'destconnectedlinenum':_0x3b999e[_0x7e65('0x44')]});}}}}}}}catch(_0x61576c){logger['error'](_0x7e65('0x54'),_0x3b999e['uniqueid'],util['inspect'](_0x61576c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7e65('0x1e')]=function(_0x147014){try{if(this[_0x7e65('0x34')](_0x147014)){logger['debug'](_0x7e65('0x55'),_0x147014[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x147014,{'showHidden':![],'depth':null}));if(_0x147014[_0x7e65('0x38')]===_0x147014[_0x7e65('0x3d')]&&_0x147014[_0x7e65('0x44')]!='h'&&_0x147014['channel']!='OutgoingSpoolFailed'){_0x147014[_0x7e65('0x56')]=_0x147014[_0x7e65('0x56')][_0x7e65('0x57')]();_0x147014['applicationdata']=_0x147014[_0x7e65('0x58')]&&_0x147014[_0x7e65('0x58')][_0x7e65('0x59')](_0x7e65('0x5a'))?_0x147014[_0x7e65('0x58')]:(_0x147014[_0x7e65('0x58')]||_0x147014['applicationdata'])['toLowerCase']();logger[_0x7e65('0x2f')](_0x7e65('0x5b'),_0x147014[_0x7e65('0x38')],_0x147014[_0x7e65('0x56')],_0x147014['applicationdata']);if(_[_0x7e65('0x4e')](this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]])){this['channels'][_0x147014['uniqueid']]=new Channel();this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]][_0x7e65('0x50')]=_0x147014[_0x7e65('0x5c')]?moment()[_0x7e65('0x5d')](moment[_0x7e65('0x5c')](_0x147014[_0x7e65('0x5c')])[_0x7e65('0x5e')](),_0x7e65('0x5e'))[_0x7e65('0x47')](_0x7e65('0x5f')):moment()[_0x7e65('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]]['disposition']=_0x7e65('0x14');}_[_0x7e65('0x3e')](this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]],_[_0x7e65('0x60')](_0x147014,_[_0x7e65('0x3f')](this['channels'][_0x147014[_0x7e65('0x38')]])));if(_[_0x7e65('0x61')](applications,_0x147014[_0x7e65('0x56')])){this['channels'][_0x147014[_0x7e65('0x38')]][_0x7e65('0x62')]=_0x147014[_0x7e65('0x56')];this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]][_0x7e65('0x63')]=_0x147014[_0x7e65('0x64')];if(_0x147014[_0x7e65('0x56')]==='set'&&_[_0x7e65('0x59')](_0x147014['applicationdata'][_0x7e65('0x57')](),_0x7e65('0x65'))){var _0x4e1e5b=_0x147014[_0x7e65('0x64')][_0x7e65('0x43')]('=');var _0x1fb763=_0x4e1e5b[0x0][_0x7e65('0x57')]()[_0x7e65('0x66')](/cdr\((.*)\)/);if(_0x1fb763){this['channels'][_0x147014['uniqueid']][_0x1fb763[0x1]]=_0x4e1e5b[0x1];}}else if(_0x147014[_0x7e65('0x56')]===_0x7e65('0xf')){this[_0x7e65('0x1b')][_0x147014[_0x7e65('0x38')]]['queue']=_0x147014[_0x7e65('0x64')][_0x7e65('0x43')](',')[0x0];}}}}}catch(_0x22db54){logger['error'](_0x7e65('0x67'),_0x147014[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x22db54,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x21')]=function(_0x2d900b){try{if(this['isNotNull'](_0x2d900b)){logger['info'](_0x7e65('0x68'),_0x2d900b[_0x7e65('0x38')],_0x2d900b['linkedid'],_0x2d900b['calleridname'],_0x2d900b['calleridnum']);logger[_0x7e65('0x3b')](_0x7e65('0x69'),_0x2d900b[_0x7e65('0x38')],util['inspect'](_0x2d900b,{'showHidden':![],'depth':null}));if(_0x2d900b['uniqueid']!==_0x2d900b[_0x7e65('0x3d')]){if(this['channels'][_0x2d900b['linkedid']]){if(_0x2d900b[_0x7e65('0x52')]==='6'){if(!this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x6a')]){var _0x5226b3=moment();this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]]['answered']=!![];this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x6b')]=_0x5226b3[_0x7e65('0x47')](_0x7e65('0x5f'));if(this['channels'][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x50')]){this['channels'][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x6c')]=_0x5226b3[_0x7e65('0x6d')](this['channels'][_0x2d900b['linkedid']][_0x7e65('0x50')],_0x7e65('0x5e'));}}this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]]['linkedid']=_0x2d900b[_0x7e65('0x38')];if(_0x2d900b[_0x7e65('0x3a')]!==_0x7e65('0x45')){this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]]['connectedlinenum']=_0x2d900b[_0x7e65('0x3a')];}this[_0x7e65('0x1b')][_0x2d900b['linkedid']][_0x7e65('0x6e')]=_0x2d900b[_0x7e65('0x39')];this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x6f')]=_0x2d900b[_0x7e65('0x42')];this[_0x7e65('0x1b')][_0x2d900b['linkedid']]['disposition']=dispositions[_[_0x7e65('0x70')](_0x2d900b[_0x7e65('0x52')])];if(this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')]['split']('-')[0x0]]){this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]]['UserId']=this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')]['split']('-')[0x0]]['id'];this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x71')]=this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x2d900b[_0x7e65('0x38')]]){if(_0x2d900b[_0x7e65('0x52')]==='6'){if(this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')]['split']('-')[0x0]]){this['channels'][_0x2d900b[_0x7e65('0x38')]][_0x7e65('0x72')]=this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]['id'];this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x38')]][_0x7e65('0x71')]=this['agents'][_0x2d900b['channel']['split']('-')[0x0]][_0x7e65('0x49')];}}}}if(_0x2d900b[_0x7e65('0x52')]==='6'&&_0x2d900b[_0x7e65('0x40')]===_0x7e65('0x41')){if(this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]){this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x46')]=_0x2d900b[_0x7e65('0x44')];var _0x55598f;if(this['channels'][_0x2d900b[_0x7e65('0x38')]])_0x55598f=this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x38')]][_0x7e65('0x73')];else if(this[_0x7e65('0x1b')][_0x2d900b[_0x7e65('0x3d')]])_0x55598f=this['channels'][_0x2d900b[_0x7e65('0x3d')]][_0x7e65('0x73')];logger['debug'](_0x7e65('0x74'),_0x2d900b['uniqueid'],util[_0x7e65('0x33')]({'destaccountcode':this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')],'destconnectedlinenum':_0x2d900b[_0x7e65('0x44')],'routealias':_0x55598f},{'showHidden':![],'depth':null}));this[_0x7e65('0x36')](util[_0x7e65('0x47')](_0x7e65('0x48'),this[_0x7e65('0x1c')][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x49')]),_0x7e65('0x4a'),{'destaccountcode':this['agents'][_0x2d900b[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')],'destconnectedlinenum':_0x2d900b['exten'],'routealias':_0x55598f});}}}}catch(_0x2897f3){logger['error'](_0x7e65('0x75'),_0x2d900b[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x2897f3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')]['syncMixMonitorFilename']=function(_0x130c04,_0x57b59c){try{if(this[_0x7e65('0x1b')][_0x130c04]){logger[_0x7e65('0x2f')](_0x7e65('0x76'),_0x130c04,_0x57b59c);this[_0x7e65('0x1b')][_0x130c04]['monitor']=!![];if(_[_0x7e65('0x77')](_0x57b59c,_0x7e65('0x78'))){_0x57b59c=_0x57b59c[_0x7e65('0x79')]('.wav49',_0x7e65('0x7a'));}this[_0x7e65('0x1b')][_0x130c04][_0x7e65('0x7b')]=_0x57b59c;var _0x419d30=_[_0x7e65('0x7c')](this[_0x7e65('0x1b')][_0x130c04][_0x7e65('0x7d')],{'filename':_0x57b59c});if(_[_0x7e65('0x7e')](_0x419d30)){this[_0x7e65('0x1b')][_0x130c04][_0x7e65('0x7d')][_0x7e65('0x7f')]({'filename':_0x57b59c,'createdAt':moment()[_0x7e65('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x7e65('0x80')});}}}catch(_0x268d06){logger['error'](_0x7e65('0x81'),_0x130c04,util[_0x7e65('0x33')](_0x268d06,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x23')]=function(_0xda93c6){try{if(this['isNotNull'](_0xda93c6)){logger['debug'](_0x7e65('0x82'),_0xda93c6[_0x7e65('0x38')],util[_0x7e65('0x33')](_0xda93c6,{'showHidden':![],'depth':null}));if(this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x38')]]&&_0xda93c6['channel']!=_0x7e65('0x83')){if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')])){if(this['isNotNull'](_0xda93c6[_0x7e65('0x84')]['mixmonitor_filename'])){logger[_0x7e65('0x2f')](_0x7e65('0x85'),_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')]);this[_0x7e65('0x87')](_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')]);}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')]['xmd-phone'])){logger[_0x7e65('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0xda93c6[_0x7e65('0x38')],_0xda93c6['value']);this['channels'][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x3a')]=_0xda93c6[_0x7e65('0x86')];}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')]['xmd-callerid'])){logger[_0x7e65('0x2f')](_0x7e65('0x88'),_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')]);this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x89')]=_0xda93c6[_0x7e65('0x86')];}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x8a')])){logger['info'](_0x7e65('0x8b'),_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')]);this['channels'][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x8c')]=_0xda93c6[_0x7e65('0x86')];}else if(this['isNotNull'](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x8d')])){logger['info'](_0x7e65('0x8e'),_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')][_0x7e65('0x43')](',')[0x0]);this['channels'][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0xf')]=_0xda93c6[_0x7e65('0x86')][_0x7e65('0x43')](',')[0x0];}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')]['xmd-originatecalleridnum'])){logger[_0x7e65('0x2f')](_0x7e65('0x8f'),_0xda93c6['uniqueid'],_0xda93c6[_0x7e65('0x86')]);this['channels'][_0xda93c6['uniqueid']][_0x7e65('0x90')]=_0xda93c6[_0x7e65('0x86')];}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x91')])){logger[_0x7e65('0x2f')](_0x7e65('0x92'),_0xda93c6[_0x7e65('0x38')],_0xda93c6['value']);this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x93')]=_0xda93c6[_0x7e65('0x86')];}else if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x94')])){logger[_0x7e65('0x2f')](_0x7e65('0x95'),_0xda93c6[_0x7e65('0x38')],_0xda93c6[_0x7e65('0x86')]);this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x96')]=_0xda93c6[_0x7e65('0x86')];}else if(this['isNotNull'](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x97')])){logger[_0x7e65('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0xda93c6[_0x7e65('0x38')],_0xda93c6['value']);this['channels'][_0xda93c6['uniqueid']][_0x7e65('0xf')]=_0xda93c6[_0x7e65('0x86')];}else if(this[_0x7e65('0x34')](_0xda93c6['variable'][_0x7e65('0x98')])){logger[_0x7e65('0x2f')](_0x7e65('0x99'),_0xda93c6[_0x7e65('0x38')],_0xda93c6['value']);this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x38')]][_0x7e65('0x9a')]=_0xda93c6[_0x7e65('0x86')];}}}else if(this['isNotNull'](_0xda93c6['variable'][_0x7e65('0x9b')])){if(_0xda93c6[_0x7e65('0x86')]){var _0x4c7105=path['parse'](_0xda93c6[_0x7e65('0x86')])['name'];logger['info'](_0x7e65('0x85'),_0x4c7105,_0xda93c6[_0x7e65('0x86')]);this[_0x7e65('0x87')](_0x4c7105,_0xda93c6[_0x7e65('0x86')]);}}else if(this['channels'][_0xda93c6[_0x7e65('0x3d')]]){if(this[_0x7e65('0x34')](_0xda93c6['variable'])){if(this[_0x7e65('0x34')](_0xda93c6[_0x7e65('0x84')][_0x7e65('0x98')])){logger['info'](_0x7e65('0x99'),_0xda93c6['linkedid'],_0xda93c6[_0x7e65('0x86')]);this[_0x7e65('0x1b')][_0xda93c6[_0x7e65('0x3d')]][_0x7e65('0x9c')]=_0xda93c6[_0x7e65('0x86')];}}}}}catch(_0x8cba4a){logger[_0x7e65('0x31')](_0x7e65('0x9d'),_0xda93c6[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x8cba4a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7e65('0x25')]=function(_0x66793f){try{if(this[_0x7e65('0x34')](_0x66793f)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x66793f[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x66793f,{'showHidden':![],'depth':null}));if(this['channels'][_0x66793f['uniqueid']]){logger[_0x7e65('0x2f')](_0x7e65('0x9e'),_0x66793f[_0x7e65('0x38')],_0x66793f['cause-txt']);var _0x5eae8c=moment();this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x9f')]=_0x5eae8c['format'](_0x7e65('0x5f'));this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]]['duration']=_0x5eae8c[_0x7e65('0x6d')](this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x50')],'seconds');if(this[_0x7e65('0x1b')][_0x66793f['uniqueid']][_0x7e65('0x6a')]){this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0xa0')]=_0x5eae8c[_0x7e65('0x6d')](this[_0x7e65('0x1b')][_0x66793f['uniqueid']]['answertime'],_0x7e65('0x5e'));this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x6c')]=this['channels'][_0x66793f[_0x7e65('0x38')]]['duration']-this[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0xa0')];}if(_0x66793f[_0x7e65('0x40')]===_0x7e65('0x41')){if(this[_0x7e65('0x1c')][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]){this['agents'][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]=_['omit'](this[_0x7e65('0x1c')][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]],[_0x7e65('0x46')]);logger['debug'](_0x7e65('0xa1'),_0x66793f['uniqueid'],util['inspect']({'id':this['agents'][_0x66793f['channel'][_0x7e65('0x43')]('-')[0x0]]['id'],'destaccountcode':this[_0x7e65('0x1c')][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')]},{'showHidden':![],'depth':null}));this[_0x7e65('0x36')](util[_0x7e65('0x47')](_0x7e65('0x48'),this['agents'][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x49')]),_0x7e65('0xa2'),{'id':this[_0x7e65('0x1c')][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]]['id'],'destaccountcode':this[_0x7e65('0x1c')][_0x66793f[_0x7e65('0x42')][_0x7e65('0x43')]('-')[0x0]][_0x7e65('0x4b')]});}}var _0x3aa161=this;Promise[_0x7e65('0xa3')]()['then'](function(){var _0x5c5727=_0x3aa161['channels'][_0x66793f['uniqueid']];if(typeof _0x5c5727[_0x7e65('0xa4')]===_0x7e65('0xa5'))return;if(_[_0x7e65('0xa6')](_0x5c5727['monitors']))return;return RpcSetting[_0x7e65('0xa7')]()[_0x7e65('0xa8')](function(_0x19a9e6){if(!_0x19a9e6['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x7e65('0xa8')](function(){return ami['Action']({'action':_0x7e65('0xa9'),'channel':_0x5c5727['channel']})[_0x7e65('0xaa')](function(){});})['then'](function(){return ami[_0x7e65('0xab')]({'action':_0x7e65('0xa9'),'channel':_0x5c5727[_0x7e65('0x6f')]})[_0x7e65('0xaa')](function(){})['finally'](function(){var _0x4d60ae=_0x3aa161[_0x7e65('0x1c')][_0x5c5727[_0x7e65('0x6f')][_0x7e65('0x43')]('-')[0x0]];if(!_0x4d60ae)return;io['emit'](_0x7e65('0xac'),{'agentId':_0x4d60ae['id'],'uniqueid':_0x5c5727[_0x7e65('0x38')]});});});});})['then'](function(){if(_0x66793f[_0x7e65('0xad')]===_0x7e65('0xae')){_0x3aa161[_0x7e65('0xaf')][_0x66793f[_0x7e65('0x38')]]=_0x3aa161['channels'][_0x66793f['uniqueid']];}else{if(_0x3aa161[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x8c')]==='outbound'&&_0x3aa161['blindTransfers'][_0x66793f['uniqueid']]){_0x3aa161[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x38')]=[_0x3aa161[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x3d')],_0x3aa161[_0x7e65('0x1b')][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x3d')]=_0x3aa161['channels'][_0x66793f[_0x7e65('0x38')]][_0x7e65('0x38')]][0x0];delete _0x3aa161[_0x7e65('0xaf')][_0x66793f[_0x7e65('0x38')]];}}logger['debug'](_0x7e65('0xb0'),_0x66793f[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x3aa161['channels'][_0x66793f['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7e65('0x36')]('custom:voiceCallReport',_0x3aa161['channels'][_0x66793f['uniqueid']]);delete _0x3aa161['channels'][_0x66793f[_0x7e65('0x38')]];});}}}catch(_0x4d7aab){logger[_0x7e65('0x31')](_0x7e65('0xb1'),_0x66793f[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x4d7aab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x29')]=function(_0x1d3f9d){try{if(this[_0x7e65('0x34')](_0x1d3f9d)){logger[_0x7e65('0x2f')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1d3f9d['uniqueid'],_0x1d3f9d[_0x7e65('0xb2')],_0x1d3f9d[_0x7e65('0xb3')]);logger[_0x7e65('0x3b')](_0x7e65('0xb4'),_0x1d3f9d[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x1d3f9d,{'showHidden':![],'depth':null}));if(this['channels'][_0x1d3f9d['transfereeuniqueid']]){this['channels'][_0x1d3f9d[_0x7e65('0xb5')]][_0x7e65('0xb6')]=_0x1d3f9d[_0x7e65('0xb2')];this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb5')]]['transferconnectedlinenum']=_0x1d3f9d[_0x7e65('0xb3')];if(this['channels'][_0x1d3f9d[_0x7e65('0xb7')]]){var _0x65f45c=this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb7')]];this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb7')]]=this['channels'][_0x1d3f9d[_0x7e65('0xb5')]];this[_0x7e65('0x1b')][_0x1d3f9d['transfereeuniqueid']]=_0x65f45c;}}else if(this[_0x7e65('0x1b')][_0x1d3f9d['transfertargetuniqueid']]){this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb8')]][_0x7e65('0xb6')]=_0x1d3f9d[_0x7e65('0xb2')];this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb8')]][_0x7e65('0xb9')]=_0x1d3f9d[_0x7e65('0xb3')];if(this['channels'][_0x1d3f9d[_0x7e65('0xba')]]){var _0x65f45c=this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]];this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]]=this[_0x7e65('0x1b')][_0x1d3f9d['transfertargetuniqueid']];this['channels'][_0x1d3f9d[_0x7e65('0xb8')]]=_0x65f45c;}}if((this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]]||this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xbb')]])&&this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xb7')]]){var _0x18d784=_[_0x7e65('0xbc')]([this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]],this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xbb')]],this[_0x7e65('0x1b')][_0x1d3f9d['secondtransfereruniqueid']]],function(_0x26df81){return _0x26df81&&_0x26df81['type']===_0x7e65('0xbd')&&_0x26df81[_0x7e65('0xbe')];});if(_0x18d784){if(this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]])this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xba')]][_0x7e65('0xa4')]=_0x7e65('0xbf');if(this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xbb')]])this[_0x7e65('0x1b')][_0x1d3f9d[_0x7e65('0xbb')]][_0x7e65('0xa4')]=_0x7e65('0xbf');this['channels'][_0x1d3f9d[_0x7e65('0xb7')]][_0x7e65('0xa4')]=_0x7e65('0xbf');}}}}catch(_0x191b81){logger[_0x7e65('0x31')](_0x7e65('0xc0'),_0x1d3f9d[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x191b81,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x2b')]=function(_0xc5e4d9){try{if(this['isNotNull'](_0xc5e4d9)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0xc5e4d9[_0x7e65('0x38')],_0xc5e4d9[_0x7e65('0xc1')],_0xc5e4d9['extension']);logger[_0x7e65('0x3b')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0xc5e4d9['uniqueid'],util[_0x7e65('0x33')](_0xc5e4d9,{'showHidden':![],'depth':null}));if(this[_0x7e65('0x1b')][_0xc5e4d9[_0x7e65('0xb5')]]){this[_0x7e65('0x1b')][_0xc5e4d9['transfereeuniqueid']][_0x7e65('0xb6')]=_0xc5e4d9[_0x7e65('0xc1')];this[_0x7e65('0x1b')][_0xc5e4d9[_0x7e65('0xb5')]][_0x7e65('0xb9')]=_0xc5e4d9[_0x7e65('0xc2')];this['channels'][_0xc5e4d9[_0x7e65('0xb5')]]['transferType']=_0x7e65('0xc3');this[_0x7e65('0x25')]({'event':_0x7e65('0xae'),'uniqueid':_0xc5e4d9['transfereeuniqueid'],'context':_0xc5e4d9['context'],'channel':_0xc5e4d9[_0x7e65('0xc4')]});}else{this[_0x7e65('0x1b')][_0xc5e4d9[_0x7e65('0xc5')]][_0x7e65('0xa4')]='BLIND';}}}catch(_0x394aa4){logger['error'](_0x7e65('0xc6'),_0xc5e4d9[_0x7e65('0x38')],util['inspect'](_0x394aa4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0xc7')]=function(_0x147621){try{if(this[_0x7e65('0x34')](_0x147621)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x147621[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x147621,{'showHidden':![],'depth':null}));if(this[_0x7e65('0x1b')][_0x147621[_0x7e65('0x38')]]){if(!_[_0x7e65('0x7e')](this[_0x7e65('0x1b')][_0x147621[_0x7e65('0x38')]][_0x7e65('0x6b')])){this[_0x7e65('0x1b')][_0x147621['uniqueid']][_0x7e65('0xc8')]=moment()[_0x7e65('0x47')](_0x7e65('0x5f'));logger[_0x7e65('0x2f')](_0x7e65('0xc9'),_0x147621[_0x7e65('0x38')],this[_0x7e65('0x1b')][_0x147621[_0x7e65('0x38')]][_0x7e65('0xc8')]);}}}}catch(_0x29e514){logger['error'](_0x7e65('0xca'),_0x147621['uniqueid'],util[_0x7e65('0x33')](_0x29e514,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7e65('0x35')][_0x7e65('0x2e')]=function(_0x33b1f8){try{if(this[_0x7e65('0x34')](_0x33b1f8)){logger[_0x7e65('0x3b')](_0x7e65('0xcb'),_0x33b1f8[_0x7e65('0x38')],util[_0x7e65('0x33')](_0x33b1f8,{'showHidden':![],'depth':null}));if(this[_0x7e65('0x1b')][_0x33b1f8[_0x7e65('0x38')]]){if(!_[_0x7e65('0x7e')](this[_0x7e65('0x1b')][_0x33b1f8[_0x7e65('0x38')]][_0x7e65('0xc8')])){this[_0x7e65('0x1b')][_0x33b1f8[_0x7e65('0x38')]]['mohtime']+=moment()[_0x7e65('0xcc')](0x0)[_0x7e65('0x6d')](this['channels'][_0x33b1f8[_0x7e65('0x38')]][_0x7e65('0xc8')],_0x7e65('0x5e'));logger['info'](_0x7e65('0xcd'),_0x33b1f8[_0x7e65('0x38')],this[_0x7e65('0x1b')][_0x33b1f8['uniqueid']][_0x7e65('0xce')]);delete this['channels'][_0x33b1f8[_0x7e65('0x38')]]['mohstarttime'];}}}}catch(_0x2d9214){logger[_0x7e65('0x31')]('[%s][voiceCallReport][musiconholdstop]',_0x33b1f8[_0x7e65('0x38')],util['inspect'](_0x2d9214,{'showHidden':![],'depth':null}));}};module[_0x7e65('0xcf')]=VoiceCallReport; \ No newline at end of file +var _0x24a8=['linkedid','isUndefined','keys','context','from-sip','channel','split','xcally-motion-preview','connectedlinenum','format','user:%s','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','inspect','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','merge','pick','destconnectedlinenum','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','set','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','disposition','channelstate','UserId','membername','name','routealias','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','OutgoingSpoolFailed','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','then','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','finally','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','bluebird','lodash','util','path','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','ringing','ringinuse','onhold','queue','agi','dial','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','isNotNull','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:'];(function(_0x171307,_0x368716){var _0x3e859b=function(_0x80501b){while(--_0x80501b){_0x171307['push'](_0x171307['shift']());}};_0x3e859b(++_0x368716);}(_0x24a8,0x8f));var _0x824a=function(_0xe31670,_0x4c489b){_0xe31670=_0xe31670-0x0;var _0x560092=_0x24a8[_0xe31670];return _0x560092;};'use strict';var BPromise=require(_0x824a('0x0'));var _=require(_0x824a('0x1'));var moment=require('moment');var util=require(_0x824a('0x2'));var path=require(_0x824a('0x3'));var Redis=require('ioredis');var config=require(_0x824a('0x4'));var logger=require('../../../config/logger')(_0x824a('0x5'));var ami=require(_0x824a('0x6'));var Channel=require(_0x824a('0x7'));var RpcSetting=require(_0x824a('0x8'));var statusDesc=[_0x824a('0x9'),'not_inuse',_0x824a('0xa'),_0x824a('0xb'),'invalid','unavailable',_0x824a('0xc'),_0x824a('0xd'),_0x824a('0xe')];var applications=['set',_0x824a('0xf'),_0x824a('0x10'),_0x824a('0x11'),'playback',_0x824a('0x12')];var dispositions=['NO\x20ANSWER',_0x824a('0x13'),_0x824a('0x13'),'NO\x20ANSWER',_0x824a('0x14'),_0x824a('0x14'),_0x824a('0x15'),_0x824a('0x16'),_0x824a('0x13'),'FAILED',_0x824a('0x13')];var actions={};config[_0x824a('0x17')]=_[_0x824a('0x18')](config[_0x824a('0x17')],{'host':_0x824a('0x19'),'port':0x18eb});var io=require(_0x824a('0x1a'))(new Redis(config['redis']));function VoiceCallReport(_0x5ea009){this[_0x824a('0x1b')]=_0x5ea009['channels'];this[_0x824a('0x1c')]=_0x5ea009[_0x824a('0x1c')];this[_0x824a('0x1d')]={};ami['on']('coreshowchannel',this[_0x824a('0x1e')][_0x824a('0x1f')](this));ami['on'](_0x824a('0x20'),this[_0x824a('0x1e')][_0x824a('0x1f')](this));ami['on'](_0x824a('0x21'),this[_0x824a('0x22')]['bind'](this));ami['on'](_0x824a('0x23'),this[_0x824a('0x24')][_0x824a('0x1f')](this));ami['on']('varset',this['syncVarSet'][_0x824a('0x1f')](this));ami['on'](_0x824a('0x25'),this[_0x824a('0x26')][_0x824a('0x1f')](this));ami['on'](_0x824a('0x27'),this[_0x824a('0x28')][_0x824a('0x1f')](this));ami['on'](_0x824a('0x29'),this['syncAttendedTransfer'][_0x824a('0x1f')](this));ami['on'](_0x824a('0x2a'),this[_0x824a('0x2b')]['bind'](this));ami['on'](_0x824a('0x2c'),this[_0x824a('0x2d')][_0x824a('0x1f')](this));ami['on'](_0x824a('0x2e'),this['syncMusicOnHoldStop'][_0x824a('0x1f')](this));try{logger[_0x824a('0x2f')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x824a('0x30')]();}catch(_0x220d93){logger['error'](_0x824a('0x31'),util['inspect'](_0x220d93,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x824a('0x32')]=function(_0x2919c7){return _0x2919c7!==null&&!_['isUndefined'](_0x2919c7);};VoiceCallReport[_0x824a('0x33')][_0x824a('0x34')]=function(_0x5dbaa1,_0x1133c0,_0x52edde){io['to'](_0x5dbaa1)[_0x824a('0x34')](_0x1133c0,_0x52edde);};VoiceCallReport[_0x824a('0x33')][_0x824a('0x28')]=function(_0x7131cb){try{if(this['isNotNull'](_0x7131cb)){logger[_0x824a('0x2f')](_0x824a('0x35'),_0x7131cb[_0x824a('0x36')],_0x7131cb[_0x824a('0x37')],_0x7131cb[_0x824a('0x38')]);logger[_0x824a('0x39')](_0x824a('0x3a'),_0x7131cb[_0x824a('0x36')],util['inspect'](_0x7131cb,{'showHidden':![],'depth':null}));if(_0x7131cb[_0x824a('0x36')]===_0x7131cb[_0x824a('0x3b')]){if(!_[_0x824a('0x3c')](this[_0x824a('0x1b')][_0x7131cb[_0x824a('0x36')]])){_['merge'](this[_0x824a('0x1b')][_0x7131cb['uniqueid']],_['pick'](_0x7131cb,_[_0x824a('0x3d')](this[_0x824a('0x1b')][_0x7131cb[_0x824a('0x36')]])));}}if(_0x7131cb[_0x824a('0x3e')]===_0x824a('0x3f')){if(this[_0x824a('0x1c')][_0x7131cb[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]){if(_0x7131cb['exten']==_0x824a('0x42')){this[_0x824a('0x1c')][_0x7131cb[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]['destconnectedlinenum']=_0x7131cb[_0x824a('0x43')];this['emit'](util[_0x824a('0x44')](_0x824a('0x45'),this['agents'][_0x7131cb['channel'][_0x824a('0x41')]('-')[0x0]]['name']),_0x824a('0x46'),{'destaccountcode':this['agents'][_0x7131cb[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x47')],'destconnectedlinenum':_0x7131cb[_0x824a('0x43')]});}}}}}catch(_0x1d1bec){logger[_0x824a('0x48')](_0x824a('0x49'),_0x7131cb[_0x824a('0x36')],util[_0x824a('0x4a')](_0x1d1bec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x22')]=function(_0x56f73e){try{if(this[_0x824a('0x32')](_0x56f73e)){logger[_0x824a('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0x56f73e[_0x824a('0x36')],util[_0x824a('0x4a')](_0x56f73e,{'showHidden':![],'depth':null}));if(_0x56f73e[_0x824a('0x36')]===_0x56f73e[_0x824a('0x3b')]&&_0x56f73e[_0x824a('0x40')]!='OutgoingSpoolFailed'){if(_[_0x824a('0x3c')](this[_0x824a('0x1b')][_0x56f73e[_0x824a('0x36')]])){logger[_0x824a('0x2f')](_0x824a('0x4b'),_0x56f73e['uniqueid'],_0x56f73e[_0x824a('0x3e')],_0x56f73e[_0x824a('0x4c')]);this[_0x824a('0x1b')][_0x56f73e[_0x824a('0x36')]]=new Channel();this['channels'][_0x56f73e[_0x824a('0x36')]][_0x824a('0x4d')]=moment()[_0x824a('0x44')](_0x824a('0x4e'));this[_0x824a('0x1b')][_0x56f73e[_0x824a('0x36')]]['disposition']=dispositions[_[_0x824a('0x4f')](_0x56f73e['channelstate'])];_[_0x824a('0x50')](this[_0x824a('0x1b')][_0x56f73e[_0x824a('0x36')]],_[_0x824a('0x51')](_0x56f73e,_[_0x824a('0x3d')](this[_0x824a('0x1b')][_0x56f73e[_0x824a('0x36')]])));if(_0x56f73e['context']===_0x824a('0x3f')){if(this[_0x824a('0x1c')][_0x56f73e[_0x824a('0x40')]['split']('-')[0x0]]){if(_[_0x824a('0x3c')](this[_0x824a('0x1c')][_0x56f73e[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x52')])){this[_0x824a('0x1c')][_0x56f73e['channel'][_0x824a('0x41')]('-')[0x0]][_0x824a('0x52')]=_0x56f73e[_0x824a('0x4c')];logger[_0x824a('0x39')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x56f73e[_0x824a('0x36')],util[_0x824a('0x4a')]({'destaccountcode':this[_0x824a('0x1c')][_0x56f73e[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x47')],'destconnectedlinenum':_0x56f73e[_0x824a('0x4c')]},{'showHidden':![],'depth':null}));this[_0x824a('0x34')](util[_0x824a('0x44')](_0x824a('0x45'),this['agents'][_0x56f73e['channel'][_0x824a('0x41')]('-')[0x0]]['name']),_0x824a('0x46'),{'destaccountcode':this[_0x824a('0x1c')][_0x56f73e[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x56f73e[_0x824a('0x4c')]});}}}}}}}catch(_0x51eaf3){logger[_0x824a('0x48')](_0x824a('0x53'),_0x56f73e['uniqueid'],util['inspect'](_0x51eaf3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x1e')]=function(_0x577698){try{if(this['isNotNull'](_0x577698)){logger[_0x824a('0x39')](_0x824a('0x54'),_0x577698[_0x824a('0x36')],util[_0x824a('0x4a')](_0x577698,{'showHidden':![],'depth':null}));if(_0x577698[_0x824a('0x36')]===_0x577698[_0x824a('0x3b')]&&_0x577698[_0x824a('0x4c')]!='h'&&_0x577698[_0x824a('0x40')]!='OutgoingSpoolFailed'){_0x577698[_0x824a('0x55')]=_0x577698[_0x824a('0x55')]['toLowerCase']();_0x577698[_0x824a('0x56')]=_0x577698['appdata']&&_0x577698[_0x824a('0x57')]['startsWith']('CDR(routeAlias)')?_0x577698[_0x824a('0x57')]:(_0x577698[_0x824a('0x57')]||_0x577698[_0x824a('0x56')])[_0x824a('0x58')]();logger[_0x824a('0x2f')](_0x824a('0x59'),_0x577698[_0x824a('0x36')],_0x577698[_0x824a('0x55')],_0x577698[_0x824a('0x56')]);if(_[_0x824a('0x3c')](this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]])){this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]]=new Channel();this['channels'][_0x577698[_0x824a('0x36')]][_0x824a('0x4d')]=_0x577698[_0x824a('0x5a')]?moment()[_0x824a('0x5b')](moment['duration'](_0x577698[_0x824a('0x5a')])[_0x824a('0x5c')](),_0x824a('0x5c'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x824a('0x44')](_0x824a('0x4e'));this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]]['disposition']='NO\x20ANSWER';}_['merge'](this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]],_[_0x824a('0x51')](_0x577698,_[_0x824a('0x3d')](this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]])));if(_[_0x824a('0x5d')](applications,_0x577698[_0x824a('0x55')])){this[_0x824a('0x1b')][_0x577698[_0x824a('0x36')]][_0x824a('0x5e')]=_0x577698[_0x824a('0x55')];this[_0x824a('0x1b')][_0x577698['uniqueid']]['lastdata']=_0x577698[_0x824a('0x56')];if(_0x577698[_0x824a('0x55')]===_0x824a('0x5f')&&_[_0x824a('0x60')](_0x577698[_0x824a('0x56')][_0x824a('0x58')](),_0x824a('0x61'))){var _0x5922fb=_0x577698[_0x824a('0x56')][_0x824a('0x41')]('=');var _0x1db9d7=_0x5922fb[0x0][_0x824a('0x58')]()[_0x824a('0x62')](/cdr\((.*)\)/);if(_0x1db9d7){this[_0x824a('0x1b')][_0x577698['uniqueid']][_0x1db9d7[0x1]]=_0x5922fb[0x1];}}else if(_0x577698[_0x824a('0x55')]===_0x824a('0xf')){this[_0x824a('0x1b')][_0x577698['uniqueid']][_0x824a('0xf')]=_0x577698['applicationdata'][_0x824a('0x41')](',')[0x0];}}}}}catch(_0x7f3fc9){logger['error'](_0x824a('0x63'),_0x577698[_0x824a('0x36')],util[_0x824a('0x4a')](_0x7f3fc9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x24')]=function(_0x29e342){try{if(this[_0x824a('0x32')](_0x29e342)){logger[_0x824a('0x2f')](_0x824a('0x64'),_0x29e342[_0x824a('0x36')],_0x29e342[_0x824a('0x3b')],_0x29e342['calleridname'],_0x29e342[_0x824a('0x38')]);logger['debug'](_0x824a('0x65'),_0x29e342[_0x824a('0x36')],util['inspect'](_0x29e342,{'showHidden':![],'depth':null}));if(_0x29e342[_0x824a('0x36')]!==_0x29e342[_0x824a('0x3b')]){if(this[_0x824a('0x1b')][_0x29e342['linkedid']]){if(_0x29e342['channelstate']==='6'){if(!this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x66')]){var _0x632e3b=moment();this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x66')]=!![];this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x67')]=_0x632e3b[_0x824a('0x44')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x4d')]){this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x68')]=_0x632e3b[_0x824a('0x69')](this['channels'][_0x29e342[_0x824a('0x3b')]][_0x824a('0x4d')],_0x824a('0x5c'));}}this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x3b')]=_0x29e342[_0x824a('0x36')];if(_0x29e342[_0x824a('0x38')]!==_0x824a('0x42')){this['channels'][_0x29e342[_0x824a('0x3b')]]['connectedlinenum']=_0x29e342[_0x824a('0x38')];}this['channels'][_0x29e342[_0x824a('0x3b')]][_0x824a('0x6a')]=_0x29e342[_0x824a('0x37')];this['channels'][_0x29e342[_0x824a('0x3b')]][_0x824a('0x6b')]=_0x29e342[_0x824a('0x40')];this['channels'][_0x29e342[_0x824a('0x3b')]][_0x824a('0x6c')]=dispositions[_['toNumber'](_0x29e342[_0x824a('0x6d')])];if(this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')]['split']('-')[0x0]]){this['channels'][_0x29e342[_0x824a('0x3b')]][_0x824a('0x6e')]=this['agents'][_0x29e342[_0x824a('0x40')]['split']('-')[0x0]]['id'];this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]][_0x824a('0x6f')]=this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')]['split']('-')[0x0]][_0x824a('0x70')];}}}}else{if(this['channels'][_0x29e342[_0x824a('0x36')]]){if(_0x29e342['channelstate']==='6'){if(this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]){this['channels'][_0x29e342[_0x824a('0x36')]][_0x824a('0x6e')]=this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]['id'];this[_0x824a('0x1b')][_0x29e342[_0x824a('0x36')]][_0x824a('0x6f')]=this['agents'][_0x29e342[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x70')];}}}}if(_0x29e342['channelstate']==='6'&&_0x29e342[_0x824a('0x3e')]==='from-sip'){if(this[_0x824a('0x1c')][_0x29e342['channel'][_0x824a('0x41')]('-')[0x0]]){this[_0x824a('0x1c')][_0x29e342['channel'][_0x824a('0x41')]('-')[0x0]][_0x824a('0x52')]=_0x29e342[_0x824a('0x4c')];var _0x2dc00c;if(this[_0x824a('0x1b')][_0x29e342[_0x824a('0x36')]])_0x2dc00c=this['channels'][_0x29e342[_0x824a('0x36')]][_0x824a('0x71')];else if(this[_0x824a('0x1b')][_0x29e342[_0x824a('0x3b')]])_0x2dc00c=this[_0x824a('0x1b')][_0x29e342['linkedid']][_0x824a('0x71')];logger[_0x824a('0x39')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x29e342[_0x824a('0x36')],util['inspect']({'destaccountcode':this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x47')],'destconnectedlinenum':_0x29e342[_0x824a('0x4c')],'routealias':_0x2dc00c},{'showHidden':![],'depth':null}));this['emit'](util[_0x824a('0x44')](_0x824a('0x45'),this[_0x824a('0x1c')][_0x29e342['channel'][_0x824a('0x41')]('-')[0x0]][_0x824a('0x70')]),_0x824a('0x46'),{'destaccountcode':this[_0x824a('0x1c')][_0x29e342[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x29e342[_0x824a('0x4c')],'routealias':_0x2dc00c});}}}}catch(_0x2cbea9){logger[_0x824a('0x48')](_0x824a('0x72'),_0x29e342['uniqueid'],util[_0x824a('0x4a')](_0x2cbea9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')]['syncMixMonitorFilename']=function(_0x4f8aff,_0x1ced03){try{if(this[_0x824a('0x1b')][_0x4f8aff]){logger[_0x824a('0x2f')](_0x824a('0x73'),_0x4f8aff,_0x1ced03);this[_0x824a('0x1b')][_0x4f8aff]['monitor']=!![];if(_[_0x824a('0x74')](_0x1ced03,_0x824a('0x75'))){_0x1ced03=_0x1ced03[_0x824a('0x76')](_0x824a('0x75'),_0x824a('0x77'));}this[_0x824a('0x1b')][_0x4f8aff][_0x824a('0x78')]=_0x1ced03;var _0x192347=_['find'](this['channels'][_0x4f8aff][_0x824a('0x79')],{'filename':_0x1ced03});if(_[_0x824a('0x7a')](_0x192347)){this['channels'][_0x4f8aff][_0x824a('0x79')]['push']({'filename':_0x1ced03,'createdAt':moment()[_0x824a('0x44')](_0x824a('0x4e')),'mixmonitorid':'','status':_0x824a('0x7b')});}}}catch(_0x11a7dc){logger['error'](_0x824a('0x7c'),_0x4f8aff,util[_0x824a('0x4a')](_0x11a7dc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x7d')]=function(_0x3c8ce3){try{if(this[_0x824a('0x32')](_0x3c8ce3)){logger['debug'](_0x824a('0x7e'),_0x3c8ce3[_0x824a('0x36')],util[_0x824a('0x4a')](_0x3c8ce3,{'showHidden':![],'depth':null}));if(this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]]&&_0x3c8ce3[_0x824a('0x40')]!=_0x824a('0x7f')){if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')])){if(this[_0x824a('0x32')](_0x3c8ce3['variable'][_0x824a('0x81')])){logger[_0x824a('0x2f')](_0x824a('0x82'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3['value']);this[_0x824a('0x83')](_0x3c8ce3['uniqueid'],_0x3c8ce3[_0x824a('0x84')]);}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x85')])){logger[_0x824a('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this['channels'][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0x38')]=_0x3c8ce3['value'];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x86')])){logger[_0x824a('0x2f')](_0x824a('0x87'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]]['callerid']=_0x3c8ce3[_0x824a('0x84')];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x88')])){logger[_0x824a('0x2f')](_0x824a('0x89'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this['channels'][_0x3c8ce3['uniqueid']][_0x824a('0x8a')]=_0x3c8ce3[_0x824a('0x84')];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x8b')])){logger[_0x824a('0x2f')](_0x824a('0x8c'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]['split'](',')[0x0]);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0xf')]=_0x3c8ce3[_0x824a('0x84')][_0x824a('0x41')](',')[0x0];}else if(this[_0x824a('0x32')](_0x3c8ce3['variable'][_0x824a('0x8d')])){logger[_0x824a('0x2f')](_0x824a('0x8e'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this['channels'][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0x8f')]=_0x3c8ce3['value'];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')]['xmd-destination'])){logger[_0x824a('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0x90')]=_0x3c8ce3[_0x824a('0x84')];}else if(this['isNotNull'](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x91')])){logger[_0x824a('0x2f')](_0x824a('0x92'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3[_0x824a('0x84')]);this[_0x824a('0x1b')][_0x3c8ce3['uniqueid']]['calleridpreview']=_0x3c8ce3['value'];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x93')])){logger[_0x824a('0x2f')](_0x824a('0x94'),_0x3c8ce3[_0x824a('0x36')],_0x3c8ce3['value']);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0xf')]=_0x3c8ce3[_0x824a('0x84')];}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')][_0x824a('0x95')])){logger[_0x824a('0x2f')](_0x824a('0x96'),_0x3c8ce3['uniqueid'],_0x3c8ce3['value']);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x36')]][_0x824a('0x97')]=_0x3c8ce3[_0x824a('0x84')];}}}else if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')]['mixmonitor_filename'])){if(_0x3c8ce3[_0x824a('0x84')]){var _0x3e0aab=path[_0x824a('0x98')](_0x3c8ce3[_0x824a('0x84')])[_0x824a('0x70')];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x3e0aab,_0x3c8ce3[_0x824a('0x84')]);this[_0x824a('0x83')](_0x3e0aab,_0x3c8ce3[_0x824a('0x84')]);}}else if(this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x3b')]]){if(this[_0x824a('0x32')](_0x3c8ce3[_0x824a('0x80')])){if(this['isNotNull'](_0x3c8ce3['variable'][_0x824a('0x95')])){logger[_0x824a('0x2f')](_0x824a('0x96'),_0x3c8ce3[_0x824a('0x3b')],_0x3c8ce3[_0x824a('0x84')]);this[_0x824a('0x1b')][_0x3c8ce3[_0x824a('0x3b')]][_0x824a('0x99')]=_0x3c8ce3[_0x824a('0x84')];}}}}}catch(_0x14a780){logger[_0x824a('0x48')](_0x824a('0x9a'),_0x3c8ce3[_0x824a('0x36')],util['inspect'](_0x14a780,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x26')]=function(_0x5c9552){try{if(this[_0x824a('0x32')](_0x5c9552)){logger[_0x824a('0x39')](_0x824a('0x9b'),_0x5c9552[_0x824a('0x36')],util[_0x824a('0x4a')](_0x5c9552,{'showHidden':![],'depth':null}));if(this[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]){logger[_0x824a('0x2f')](_0x824a('0x9c'),_0x5c9552[_0x824a('0x36')],_0x5c9552[_0x824a('0x9d')]);var _0x298566=moment();this['channels'][_0x5c9552[_0x824a('0x36')]][_0x824a('0x9e')]=_0x298566[_0x824a('0x44')](_0x824a('0x4e'));this[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]][_0x824a('0x5a')]=_0x298566[_0x824a('0x69')](this[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]['starttime'],_0x824a('0x5c'));if(this['channels'][_0x5c9552[_0x824a('0x36')]]['answered']){this['channels'][_0x5c9552[_0x824a('0x36')]]['billableseconds']=_0x298566[_0x824a('0x69')](this['channels'][_0x5c9552[_0x824a('0x36')]][_0x824a('0x67')],_0x824a('0x5c'));this[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]['holdtime']=this[_0x824a('0x1b')][_0x5c9552['uniqueid']][_0x824a('0x5a')]-this[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]][_0x824a('0x9f')];}if(_0x5c9552['context']==='from-sip'){if(this[_0x824a('0x1c')][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]){this['agents'][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]=_[_0x824a('0xa0')](this[_0x824a('0x1c')][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]],[_0x824a('0x52')]);logger[_0x824a('0x39')](_0x824a('0xa1'),_0x5c9552[_0x824a('0x36')],util[_0x824a('0x4a')]({'id':this['agents'][_0x5c9552['channel'][_0x824a('0x41')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x47')]},{'showHidden':![],'depth':null}));this[_0x824a('0x34')](util['format'](_0x824a('0x45'),this[_0x824a('0x1c')][_0x5c9552['channel'][_0x824a('0x41')]('-')[0x0]]['name']),'user:agentcomplete',{'id':this[_0x824a('0x1c')][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0x824a('0x1c')][_0x5c9552[_0x824a('0x40')][_0x824a('0x41')]('-')[0x0]][_0x824a('0x47')]});}}var _0x13d20e=this;Promise['resolve']()[_0x824a('0xa2')](function(){var _0x5c48fb=_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]];if(typeof _0x5c48fb['transferType']==='undefined')return;if(_[_0x824a('0xa3')](_0x5c48fb[_0x824a('0x79')]))return;return RpcSetting[_0x824a('0xa4')]()['then'](function(_0x1f719f){if(!_0x1f719f[_0x824a('0xa5')])return;return Promise[_0x824a('0xa6')]()[_0x824a('0xa2')](function(){return ami[_0x824a('0xa7')]({'action':_0x824a('0xa8'),'channel':_0x5c48fb[_0x824a('0x40')]})['catch'](function(){});})['then'](function(){return ami[_0x824a('0xa7')]({'action':_0x824a('0xa8'),'channel':_0x5c48fb[_0x824a('0x6b')]})['catch'](function(){})[_0x824a('0xa9')](function(){var _0x2caeac=_0x13d20e[_0x824a('0x1c')][_0x5c48fb[_0x824a('0x6b')]['split']('-')[0x0]];if(!_0x2caeac)return;io['emit']('webbar:stopmonitors',{'agentId':_0x2caeac['id'],'uniqueid':_0x5c48fb[_0x824a('0x36')]});});});});})['then'](function(){if(_0x5c9552['event']===_0x824a('0xaa')){_0x13d20e['blindTransfers'][_0x5c9552[_0x824a('0x36')]]=_0x13d20e['channels'][_0x5c9552[_0x824a('0x36')]];}else{if(_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]['type']===_0x824a('0xab')&&_0x13d20e[_0x824a('0x1d')][_0x5c9552[_0x824a('0x36')]]){_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]][_0x824a('0x36')]=[_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]][_0x824a('0x3b')],_0x13d20e['channels'][_0x5c9552[_0x824a('0x36')]][_0x824a('0x3b')]=_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]['uniqueid']][0x0];delete _0x13d20e[_0x824a('0x1d')][_0x5c9552[_0x824a('0x36')]];}}logger['debug'](_0x824a('0xac'),_0x5c9552[_0x824a('0x36')],util['inspect'](_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x13d20e[_0x824a('0x1b')][_0x5c9552[_0x824a('0x36')]]);delete _0x13d20e['channels'][_0x5c9552['uniqueid']];});}}}catch(_0x4834af){logger['error']('[%s][voiceCallReport][hangup]',_0x5c9552[_0x824a('0x36')],util[_0x824a('0x4a')](_0x4834af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0xad')]=function(_0x12ef8b){try{if(this['isNotNull'](_0x12ef8b)){logger[_0x824a('0x2f')](_0x824a('0xae'),_0x12ef8b[_0x824a('0x36')],_0x12ef8b[_0x824a('0xaf')],_0x12ef8b[_0x824a('0xb0')]);logger[_0x824a('0x39')](_0x824a('0xb1'),_0x12ef8b['uniqueid'],util[_0x824a('0x4a')](_0x12ef8b,{'showHidden':![],'depth':null}));if(this['channels'][_0x12ef8b[_0x824a('0xb2')]]){this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb2')]][_0x824a('0xb3')]=_0x12ef8b[_0x824a('0xaf')];this[_0x824a('0x1b')][_0x12ef8b['transfereeuniqueid']][_0x824a('0xb4')]=_0x12ef8b['transfertargetcalleridnum'];if(this['channels'][_0x12ef8b['secondtransfereruniqueid']]){var _0x2666d3=this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb5')]];this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb5')]]=this[_0x824a('0x1b')][_0x12ef8b['transfereeuniqueid']];this[_0x824a('0x1b')][_0x12ef8b['transfereeuniqueid']]=_0x2666d3;}}else if(this['channels'][_0x12ef8b['transfertargetuniqueid']]){this[_0x824a('0x1b')][_0x12ef8b['transfertargetuniqueid']][_0x824a('0xb3')]=_0x12ef8b[_0x824a('0xaf')];this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb6')]]['transferconnectedlinenum']=_0x12ef8b[_0x824a('0xb0')];if(this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb7')]]){var _0x2666d3=this[_0x824a('0x1b')][_0x12ef8b['origtransfereruniqueid']];this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb7')]]=this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb6')]];this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb6')]]=_0x2666d3;}}if((this[_0x824a('0x1b')][_0x12ef8b['origtransfereruniqueid']]||this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb8')]])&&this['channels'][_0x12ef8b['secondtransfereruniqueid']]){var _0x28af10=_['some']([this[_0x824a('0x1b')][_0x12ef8b['origtransfereruniqueid']],this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb8')]],this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb5')]]],function(_0x3b26ec){return _0x3b26ec&&_0x3b26ec['type']===_0x824a('0xab')&&_0x3b26ec['routeid'];});if(_0x28af10){if(this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb7')]])this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb7')]][_0x824a('0xb9')]='ATTENDED';if(this[_0x824a('0x1b')][_0x12ef8b[_0x824a('0xb8')]])this['channels'][_0x12ef8b[_0x824a('0xb8')]][_0x824a('0xb9')]='ATTENDED';this['channels'][_0x12ef8b['secondtransfereruniqueid']]['transferType']=_0x824a('0xba');}}}}catch(_0x1f08a5){logger['error'](_0x824a('0xbb'),_0x12ef8b[_0x824a('0x36')],util[_0x824a('0x4a')](_0x1f08a5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')]['syncBlindTransfer']=function(_0x425452){try{if(this[_0x824a('0x32')](_0x425452)){logger['info'](_0x824a('0xbc'),_0x425452['uniqueid'],_0x425452[_0x824a('0xbd')],_0x425452[_0x824a('0xbe')]);logger[_0x824a('0x39')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x425452[_0x824a('0x36')],util[_0x824a('0x4a')](_0x425452,{'showHidden':![],'depth':null}));if(this[_0x824a('0x1b')][_0x425452[_0x824a('0xb2')]]){this[_0x824a('0x1b')][_0x425452[_0x824a('0xb2')]][_0x824a('0xb3')]=_0x425452[_0x824a('0xbd')];this[_0x824a('0x1b')][_0x425452[_0x824a('0xb2')]][_0x824a('0xb4')]=_0x425452[_0x824a('0xbe')];this['channels'][_0x425452[_0x824a('0xb2')]]['transferType']='BLIND';this[_0x824a('0x26')]({'event':_0x824a('0xaa'),'uniqueid':_0x425452[_0x824a('0xb2')],'context':_0x425452[_0x824a('0x3e')],'channel':_0x425452['transfererchannel']});}else{this[_0x824a('0x1b')][_0x425452['transfereruniqueid']][_0x824a('0xb9')]=_0x824a('0xbf');}}}catch(_0xcbbf4b){logger[_0x824a('0x48')](_0x824a('0xc0'),_0x425452[_0x824a('0x36')],util['inspect'](_0xcbbf4b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')][_0x824a('0x2d')]=function(_0x13abe8){try{if(this[_0x824a('0x32')](_0x13abe8)){logger['debug'](_0x824a('0xc1'),_0x13abe8[_0x824a('0x36')],util[_0x824a('0x4a')](_0x13abe8,{'showHidden':![],'depth':null}));if(this[_0x824a('0x1b')][_0x13abe8['uniqueid']]){if(!_[_0x824a('0x7a')](this['channels'][_0x13abe8[_0x824a('0x36')]][_0x824a('0x67')])){this[_0x824a('0x1b')][_0x13abe8[_0x824a('0x36')]][_0x824a('0xc2')]=moment()[_0x824a('0x44')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x824a('0x2f')](_0x824a('0xc3'),_0x13abe8['uniqueid'],this[_0x824a('0x1b')][_0x13abe8[_0x824a('0x36')]][_0x824a('0xc2')]);}}}}catch(_0x14b8b7){logger[_0x824a('0x48')](_0x824a('0xc4'),_0x13abe8[_0x824a('0x36')],util['inspect'](_0x14b8b7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x824a('0x33')]['syncMusicOnHoldStop']=function(_0x3d4790){try{if(this[_0x824a('0x32')](_0x3d4790)){logger[_0x824a('0x39')](_0x824a('0xc5'),_0x3d4790[_0x824a('0x36')],util[_0x824a('0x4a')](_0x3d4790,{'showHidden':![],'depth':null}));if(this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]]){if(!_[_0x824a('0x7a')](this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]]['mohstarttime'])){this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]][_0x824a('0xc6')]+=moment()[_0x824a('0xc7')](0x0)[_0x824a('0x69')](this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]][_0x824a('0xc2')],'seconds');logger[_0x824a('0x2f')](_0x824a('0xc8'),_0x3d4790[_0x824a('0x36')],this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]][_0x824a('0xc6')]);delete this[_0x824a('0x1b')][_0x3d4790[_0x824a('0x36')]][_0x824a('0xc2')];}}}}catch(_0xf962ac){logger['error']('[%s][voiceCallReport][musiconholdstop]',_0x3d4790[_0x824a('0x36')],util[_0x824a('0x4a')](_0xf962ac,{'showHidden':![],'depth':null}));}};module[_0x824a('0xc9')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 28fa581..d4b13a0 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 _0xdc15=['isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','format','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','YYYY-MM-DD\x20HH:mm:ss','duration','diff','starttime','seconds','lastevent','complete','total','answered','billableseconds','sumHoldTime','holdtime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','util','ioredis','ami','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','varset','syncVarSet','newexten','hangup','syncHangup','prototype','isNotNull'];(function(_0x2bf7cc,_0x1031cb){var _0x111c94=function(_0x282747){while(--_0x282747){_0x2bf7cc['push'](_0x2bf7cc['shift']());}};_0x111c94(++_0x1031cb);}(_0xdc15,0xd7));var _0x5dc1=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0xdc15[_0x146484];return _0x4c7aa3;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x5dc1('0x0'));var Redis=require(_0x5dc1('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5dc1('0x2'));var ami=require(_0x5dc1('0x3'));config[_0x5dc1('0x4')]=_[_0x5dc1('0x5')](config[_0x5dc1('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x5dc1('0x6'))(new Redis(config[_0x5dc1('0x4')]));function VoiceDialReport(_0x472dc1){this[_0x5dc1('0x7')]=_0x472dc1[_0x5dc1('0x8')];this[_0x5dc1('0x9')]=_0x472dc1[_0x5dc1('0x9')];this[_0x5dc1('0xa')]={};this[_0x5dc1('0xb')]={};ami['on']('dialbegin',this[_0x5dc1('0xc')][_0x5dc1('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0x5dc1('0xd')](this));ami['on'](_0x5dc1('0xe'),this[_0x5dc1('0xf')][_0x5dc1('0xd')](this));ami['on'](_0x5dc1('0x10'),this['syncNewExten']['bind'](this));ami['on'](_0x5dc1('0x11'),this[_0x5dc1('0x12')][_0x5dc1('0xd')](this));}VoiceDialReport[_0x5dc1('0x13')][_0x5dc1('0x14')]=function(_0x5fa45b){return _0x5fa45b!==null&&!_[_0x5dc1('0x15')](_0x5fa45b);};VoiceDialReport[_0x5dc1('0x13')][_0x5dc1('0x16')]=function(_0x5e6608,_0x128831,_0x164ea0){io['to'](_0x5e6608)[_0x5dc1('0x16')](_0x128831,_0x164ea0);};VoiceDialReport[_0x5dc1('0x13')]['syncDialBegin']=function(_0x5af526){try{if(this[_0x5dc1('0x14')](_0x5af526)){logger[_0x5dc1('0x17')](_0x5dc1('0x18'),_0x5af526['uniqueid'],util[_0x5dc1('0x19')](_0x5af526,{'showHidden':![],'depth':null}));if(this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]]){_['merge'](this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]],{'starttime':moment()[_0x5dc1('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x5af526[_0x5dc1('0x1c')][_0x5dc1('0x1d')](0x0,_0x5af526[_0x5dc1('0x1c')][_0x5dc1('0x1e')]('-')),'membername':_0x5af526[_0x5dc1('0x1c')][_0x5dc1('0x1d')](_0x5af526[_0x5dc1('0x1c')][_0x5dc1('0x1e')]('/')+0x1,_0x5af526[_0x5dc1('0x1c')][_0x5dc1('0x1e')]('-'))},_[_0x5dc1('0x1f')](_0x5af526,[_0x5dc1('0x20'),_0x5dc1('0x21')]));logger[_0x5dc1('0x22')](_0x5dc1('0x23'),_0x5af526[_0x5dc1('0x1a')],this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]][_0x5dc1('0x24')],this['channels'][_0x5af526[_0x5dc1('0x1a')]][_0x5dc1('0x25')]);logger[_0x5dc1('0x17')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x5af526['uniqueid'],util['inspect'](this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0x5dc1('0xa')][_0x5af526[_0x5dc1('0x1a')]])_[_0x5dc1('0x26')](this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]],this[_0x5dc1('0xa')][_0x5af526[_0x5dc1('0x1a')]]);this['emit'](_0x5dc1('0x27'),_0x5dc1('0x28'),this[_0x5dc1('0x7')][_0x5af526['uniqueid']]);logger[_0x5dc1('0x17')](_0x5dc1('0x29'),_0x5af526[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x5dc1('0x2a'),this[_0x5dc1('0x7')][_0x5af526[_0x5dc1('0x1a')]]);}}}catch(_0x11fa5c){logger['error'](_0x5dc1('0x2b'),_0x5af526[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](_0x11fa5c,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x5dc1('0x2c')]=function(_0x1e416c){try{if(this['isNotNull'](_0x1e416c)){logger[_0x5dc1('0x17')](_0x5dc1('0x2d'),_0x1e416c[_0x5dc1('0x1a')],util['inspect'](_0x1e416c,{'showHidden':![],'depth':null}));if(this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]]){this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]]['dialstatus']=_0x1e416c[_0x5dc1('0x2e')];if(_0x1e416c[_0x5dc1('0x2e')]==='ANSWER'){this[_0x5dc1('0x7')][_0x1e416c['uniqueid']][_0x5dc1('0x2f')]=_0x1e416c['connectedlinenum'];this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]][_0x5dc1('0x30')]=_0x1e416c['connectedlinename'];this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]][_0x5dc1('0x31')]=moment()[_0x5dc1('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]]['lastevent']=_0x5dc1('0x32');logger[_0x5dc1('0x22')](_0x5dc1('0x33'),_0x1e416c[_0x5dc1('0x1a')],_0x1e416c[_0x5dc1('0x1c')][_0x5dc1('0x1d')](_0x1e416c[_0x5dc1('0x1c')][_0x5dc1('0x1e')]('/')+0x1,_0x1e416c['channel'][_0x5dc1('0x1e')]('-')));logger[_0x5dc1('0x17')](_0x5dc1('0x34'),_0x1e416c[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this[_0x5dc1('0x7')][_0x1e416c[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x5dc1('0x16')](_0x5dc1('0x35'),this[_0x5dc1('0x7')][_0x1e416c['uniqueid']]);}logger[_0x5dc1('0x17')](_0x5dc1('0x36'),_0x1e416c[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this['channels'][_0x1e416c[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));this[_0x5dc1('0x16')]('voice:outbound',_0x5dc1('0x28'),this['channels'][_0x1e416c['uniqueid']]);}}}catch(_0x484fa0){logger[_0x5dc1('0x37')](_0x5dc1('0x38'),_0x1e416c['uniqueid'],util[_0x5dc1('0x19')](_0x484fa0,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x100f85){try{if(this[_0x5dc1('0x14')](_0x100f85)){logger[_0x5dc1('0x17')](_0x5dc1('0x39'),_0x100f85[_0x5dc1('0x1a')],util['inspect'](_0x100f85,{'showHidden':![],'depth':null}));this[_0x5dc1('0x3a')](_0x100f85[_0x5dc1('0x1a')],_['keys'](_0x100f85[_0x5dc1('0x3b')])[0x0],_0x100f85[_0x5dc1('0x3c')]);if(this[_0x5dc1('0x14')](_0x100f85[_0x5dc1('0x3b')])&&this[_0x5dc1('0x14')](_0x100f85[_0x5dc1('0x3b')][_0x5dc1('0x3d')])){if(_[_0x5dc1('0x15')](this[_0x5dc1('0x7')][_0x100f85[_0x5dc1('0x1a')]])){this[_0x5dc1('0x7')][_0x100f85[_0x5dc1('0x1a')]]={'routeId':_0x100f85[_0x5dc1('0x3c')],'variables':this[_0x5dc1('0xb')][_0x100f85[_0x5dc1('0x1a')]]};logger['info'](_0x5dc1('0x3e'),_0x100f85[_0x5dc1('0x1a')],_0x100f85[_0x5dc1('0x3b')]['outboundrouteid'],_[_0x5dc1('0x3f')](_0x100f85[_0x5dc1('0x3b')])[0x0],_0x100f85['value']);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x100f85[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this[_0x5dc1('0x7')][_0x100f85[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));this[_0x5dc1('0x16')]('voice:outbound',_0x5dc1('0x28'),this[_0x5dc1('0x7')][_0x100f85[_0x5dc1('0x1a')]]);}}}}catch(_0x5530c3){logger[_0x5dc1('0x37')](_0x5dc1('0x40'),_0x100f85['uniqueid'],util[_0x5dc1('0x19')](_0x5530c3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5dc1('0x13')][_0x5dc1('0x3a')]=function(_0x3d40d3,_0x343016,_0x31e891){var _0x5c76dd=['rtpaudioqos',_0x5dc1('0x41'),_0x5dc1('0x42'),_0x5dc1('0x43'),_0x5dc1('0x44'),_0x5dc1('0x45'),'rtpaudioqosrtt',_0x5dc1('0x46'),'sipcallid',_0x5dc1('0x47'),'bridgepeer',_0x5dc1('0x48'),'membercalls',_0x5dc1('0x49'),_0x5dc1('0x4a'),_0x5dc1('0x4b'),_0x5dc1('0x24'),_0x5dc1('0x4c'),_0x5dc1('0x4d')];if(!_['isNil'](_0x343016)&&!_[_0x5dc1('0x4e')](_0x5c76dd,_0x343016)){if(_[_0x5dc1('0x15')](this[_0x5dc1('0xb')][_0x3d40d3])){this[_0x5dc1('0xb')][_0x3d40d3]={};}this['variables'][_0x3d40d3][_0x343016]=_0x31e891;}};VoiceDialReport['prototype'][_0x5dc1('0x12')]=function(_0x148d99){try{if(this['isNotNull'](_0x148d99)){logger[_0x5dc1('0x17')](_0x5dc1('0x4f'),_0x148d99[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](_0x148d99,{'showHidden':![],'depth':null}));if(this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]]){logger[_0x5dc1('0x22')](_0x5dc1('0x50'),_0x148d99[_0x5dc1('0x1a')],_0x148d99['cause-txt']);this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x51')]=moment()['format'](_0x5dc1('0x52'));this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x53')]=moment(this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x51')])[_0x5dc1('0x54')](this['channels'][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x55')],_0x5dc1('0x56'));this['channels'][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x57')]=_0x5dc1('0x58');this['outbound'][_0x5dc1('0x59')]+=0x1;if(this['channels'][_0x148d99['uniqueid']][_0x5dc1('0x31')]){this['outbound'][_0x5dc1('0x5a')]+=0x1;this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]]['holdtime']=moment(this['channels'][_0x148d99['uniqueid']][_0x5dc1('0x31')])[_0x5dc1('0x54')](this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x55')],_0x5dc1('0x56'));this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x5b')]=moment(this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x51')])[_0x5dc1('0x54')](this[_0x5dc1('0x7')][_0x148d99['uniqueid']]['answertime'],_0x5dc1('0x56'));this[_0x5dc1('0x9')][_0x5dc1('0x5c')]+=this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]][_0x5dc1('0x5d')]||0x0;this[_0x5dc1('0x9')][_0x5dc1('0x5e')]+=this['channels'][_0x148d99[_0x5dc1('0x1a')]]['billableseconds'];}this[_0x5dc1('0x9')]['sumDuration']+=this['channels'][_0x148d99['uniqueid']]['duration'];logger['debug'](_0x5dc1('0x5f'),_0x148d99[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this['channels'][_0x148d99[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x5dc1('0x16')](_0x5dc1('0x60'),this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]]);logger['debug'](_0x5dc1('0x61'),_0x148d99['uniqueid'],util[_0x5dc1('0x19')](this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x5dc1('0x16')](_0x5dc1('0x62'),this['channels'][_0x148d99['uniqueid']]);logger[_0x5dc1('0x17')](_0x5dc1('0x63'),_0x148d99['uniqueid'],util['inspect'](this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));this[_0x5dc1('0x16')]('voice:outbound','voice_outbound:save',this['outbound']);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x5dc1('0x64')](this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]]));logger[_0x5dc1('0x17')](_0x5dc1('0x65'),_0x148d99[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x5dc1('0x27'),_0x5dc1('0x66'),this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x1a')]]);delete this[_0x5dc1('0x7')][_0x148d99['uniqueid']];}else if(this[_0x5dc1('0x7')][_0x148d99['linkedid']]){this['channels'][_0x148d99[_0x5dc1('0x67')]][_0x5dc1('0x1a')]=this[_0x5dc1('0x7')][_0x148d99[_0x5dc1('0x67')]][_0x5dc1('0x68')];}if(this[_0x5dc1('0xb')][_0x148d99[_0x5dc1('0x1a')]]){delete this[_0x5dc1('0xb')][_0x148d99[_0x5dc1('0x1a')]];}}}catch(_0xc5f888){logger[_0x5dc1('0x37')](_0x5dc1('0x69'),_0x148d99[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](_0xc5f888,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5dc1('0x13')][_0x5dc1('0x6a')]=function(_0x40cd6a){try{if(this[_0x5dc1('0x14')](_0x40cd6a)){logger['debug'](_0x5dc1('0x6b'),_0x40cd6a[_0x5dc1('0x1a')],util[_0x5dc1('0x19')](_0x40cd6a,{'showHidden':![],'depth':null}));if(_0x40cd6a[_0x5dc1('0x6c')][_0x5dc1('0x6d')]()===_0x5dc1('0x6e')){_0x40cd6a[_0x5dc1('0x6f')]=(_0x40cd6a['appdata']||_0x40cd6a[_0x5dc1('0x6f')])['toLowerCase']();if(_[_0x5dc1('0x70')](_0x40cd6a[_0x5dc1('0x6f')],_0x5dc1('0x71'))){if(_[_0x5dc1('0x15')](this[_0x5dc1('0xa')][_0x40cd6a[_0x5dc1('0x1a')]]))this['applications'][_0x40cd6a[_0x5dc1('0x1a')]]={};logger['info'](_0x5dc1('0x72'),_0x40cd6a[_0x5dc1('0x1a')],_0x40cd6a[_0x5dc1('0x6c')],_0x40cd6a[_0x5dc1('0x6f')]);var _0x29d0bc=_0x40cd6a[_0x5dc1('0x6f')][_0x5dc1('0x73')]('=');var _0x1ceace=_0x29d0bc[0x0]['match'](/cdr\((.*)\)/);if(_0x1ceace)this[_0x5dc1('0xa')][_0x40cd6a[_0x5dc1('0x1a')]][_0x1ceace[0x1]]=_0x29d0bc[0x1];}}}}catch(_0x36d808){logger[_0x5dc1('0x37')](_0x5dc1('0x74'),_0x40cd6a[_0x5dc1('0x1a')],util['inspect'](_0x36d808,{'showHidden':![],'depth':null}));}};module[_0x5dc1('0x75')]=VoiceDialReport; \ No newline at end of file +var _0x4877=['custom:dialend','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','startsWith','cdr(','application','split','match','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','newexten','syncNewExten','hangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','called','substring','lastIndexOf','channel','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','applications','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','value','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','cause-txt','endtime','diff','total','holdtime','billableseconds','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:'];(function(_0x19f73c,_0xb1a6ee){var _0x10912d=function(_0xcefb33){while(--_0xcefb33){_0x19f73c['push'](_0x19f73c['shift']());}};_0x10912d(++_0xb1a6ee);}(_0x4877,0x1d5));var _0x7487=function(_0x176f69,_0x2b2ab4){_0x176f69=_0x176f69-0x0;var _0x3b2213=_0x4877[_0x176f69];return _0x3b2213;};'use strict';var _=require('lodash');var moment=require(_0x7487('0x0'));var util=require('util');var Redis=require(_0x7487('0x1'));var config=require(_0x7487('0x2'));var logger=require(_0x7487('0x3'))(_0x7487('0x4'));var ami=require(_0x7487('0x5'));config['redis']=_[_0x7487('0x6')](config[_0x7487('0x7')],{'host':_0x7487('0x8'),'port':0x18eb});var io=require(_0x7487('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x233d7b){this[_0x7487('0xa')]=_0x233d7b['outboundChannels'];this['outbound']=_0x233d7b[_0x7487('0xb')];this['applications']={};this['variables']={};ami['on'](_0x7487('0xc'),this[_0x7487('0xd')][_0x7487('0xe')](this));ami['on'](_0x7487('0xf'),this['syncDialEnd']['bind'](this));ami['on'](_0x7487('0x10'),this[_0x7487('0x11')][_0x7487('0xe')](this));ami['on'](_0x7487('0x12'),this[_0x7487('0x13')][_0x7487('0xe')](this));ami['on'](_0x7487('0x14'),this['syncHangup'][_0x7487('0xe')](this));}VoiceDialReport[_0x7487('0x15')][_0x7487('0x16')]=function(_0x4efada){return _0x4efada!==null&&!_[_0x7487('0x17')](_0x4efada);};VoiceDialReport[_0x7487('0x15')][_0x7487('0x18')]=function(_0x132431,_0x69ed77,_0x3b881f){io['to'](_0x132431)[_0x7487('0x18')](_0x69ed77,_0x3b881f);};VoiceDialReport[_0x7487('0x15')][_0x7487('0xd')]=function(_0x323ee8){try{if(this[_0x7487('0x16')](_0x323ee8)){logger[_0x7487('0x19')](_0x7487('0x1a'),_0x323ee8['uniqueid'],util['inspect'](_0x323ee8,{'showHidden':![],'depth':null}));if(this['channels'][_0x323ee8[_0x7487('0x1b')]]){_[_0x7487('0x1c')](this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x7487('0x1d'),'interface':_0x323ee8['channel'][_0x7487('0x1e')](0x0,_0x323ee8['channel'][_0x7487('0x1f')]('-')),'membername':_0x323ee8[_0x7487('0x20')][_0x7487('0x1e')](_0x323ee8[_0x7487('0x20')][_0x7487('0x1f')]('/')+0x1,_0x323ee8[_0x7487('0x20')]['lastIndexOf']('-'))},_['omit'](_0x323ee8,[_0x7487('0x21'),'privilege']));logger[_0x7487('0x22')](_0x7487('0x23'),_0x323ee8[_0x7487('0x1b')],this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]][_0x7487('0x24')],this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]][_0x7487('0x25')]);logger[_0x7487('0x19')](_0x7487('0x26'),_0x323ee8['uniqueid'],util[_0x7487('0x27')](this['channels'][_0x323ee8['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x7487('0x28')][_0x323ee8['uniqueid']])_[_0x7487('0x1c')](this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]],this['applications'][_0x323ee8[_0x7487('0x1b')]]);this[_0x7487('0x18')](_0x7487('0x29'),_0x7487('0x2a'),this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]]);logger['debug'](_0x7487('0x2b'),_0x323ee8[_0x7487('0x1b')],util['inspect'](this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7487('0x2c'),this[_0x7487('0xa')][_0x323ee8[_0x7487('0x1b')]]);}}}catch(_0x5f0c95){logger[_0x7487('0x2d')](_0x7487('0x2e'),_0x323ee8['uniqueid'],util[_0x7487('0x27')](_0x5f0c95,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x499c7d){try{if(this['isNotNull'](_0x499c7d)){logger[_0x7487('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x499c7d[_0x7487('0x1b')],util[_0x7487('0x27')](_0x499c7d,{'showHidden':![],'depth':null}));if(this['channels'][_0x499c7d['uniqueid']]){this[_0x7487('0xa')][_0x499c7d['uniqueid']][_0x7487('0x2f')]=_0x499c7d['dialstatus'];if(_0x499c7d[_0x7487('0x2f')]===_0x7487('0x30')){this[_0x7487('0xa')][_0x499c7d[_0x7487('0x1b')]]['connectedlinenum']=_0x499c7d[_0x7487('0x31')];this[_0x7487('0xa')][_0x499c7d[_0x7487('0x1b')]][_0x7487('0x32')]=_0x499c7d[_0x7487('0x32')];this[_0x7487('0xa')][_0x499c7d[_0x7487('0x1b')]][_0x7487('0x33')]=moment()[_0x7487('0x34')](_0x7487('0x35'));this['channels'][_0x499c7d[_0x7487('0x1b')]][_0x7487('0x36')]=_0x7487('0x37');logger[_0x7487('0x22')](_0x7487('0x38'),_0x499c7d['uniqueid'],_0x499c7d[_0x7487('0x20')][_0x7487('0x1e')](_0x499c7d['channel'][_0x7487('0x1f')]('/')+0x1,_0x499c7d[_0x7487('0x20')][_0x7487('0x1f')]('-')));logger[_0x7487('0x19')](_0x7487('0x39'),_0x499c7d[_0x7487('0x1b')],util[_0x7487('0x27')](this[_0x7487('0xa')][_0x499c7d['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7487('0x18')](_0x7487('0x3a'),this['channels'][_0x499c7d[_0x7487('0x1b')]]);}logger[_0x7487('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x499c7d[_0x7487('0x1b')],util[_0x7487('0x27')](this[_0x7487('0xa')][_0x499c7d[_0x7487('0x1b')]],{'showHidden':![],'depth':null}));this[_0x7487('0x18')]('voice:outbound',_0x7487('0x2a'),this['channels'][_0x499c7d['uniqueid']]);}}}catch(_0x22045c){logger[_0x7487('0x2d')]('[%s][voiceDialReport][dialend]',_0x499c7d[_0x7487('0x1b')],util[_0x7487('0x27')](_0x22045c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7487('0x15')][_0x7487('0x11')]=function(_0x52cfb8){try{if(this[_0x7487('0x16')](_0x52cfb8)){logger[_0x7487('0x19')](_0x7487('0x3b'),_0x52cfb8[_0x7487('0x1b')],util[_0x7487('0x27')](_0x52cfb8,{'showHidden':![],'depth':null}));this['addVariable'](_0x52cfb8['uniqueid'],_[_0x7487('0x3c')](_0x52cfb8['variable'])[0x0],_0x52cfb8['value']);if(this['isNotNull'](_0x52cfb8[_0x7487('0x3d')])&&this[_0x7487('0x16')](_0x52cfb8[_0x7487('0x3d')][_0x7487('0x3e')])){if(_[_0x7487('0x17')](this[_0x7487('0xa')][_0x52cfb8[_0x7487('0x1b')]])){this[_0x7487('0xa')][_0x52cfb8[_0x7487('0x1b')]]={'routeId':_0x52cfb8[_0x7487('0x3f')],'variables':this[_0x7487('0x40')][_0x52cfb8[_0x7487('0x1b')]]};logger[_0x7487('0x22')](_0x7487('0x41'),_0x52cfb8[_0x7487('0x1b')],_0x52cfb8['variable']['outboundrouteid'],_[_0x7487('0x3c')](_0x52cfb8['variable'])[0x0],_0x52cfb8['value']);logger[_0x7487('0x19')](_0x7487('0x42'),_0x52cfb8[_0x7487('0x1b')],util['inspect'](this[_0x7487('0xa')][_0x52cfb8['uniqueid']],{'showHidden':![],'depth':null}));this[_0x7487('0x18')](_0x7487('0x29'),_0x7487('0x2a'),this['channels'][_0x52cfb8['uniqueid']]);}}}}catch(_0x513988){logger[_0x7487('0x2d')](_0x7487('0x43'),_0x52cfb8['uniqueid'],util[_0x7487('0x27')](_0x513988,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7487('0x15')][_0x7487('0x44')]=function(_0x4c0299,_0x5cb1f0,_0x24b965){var _0x5294d5=[_0x7487('0x45'),_0x7487('0x46'),_0x7487('0x47'),_0x7487('0x48'),_0x7487('0x49'),'rtpaudioqoslossbridged',_0x7487('0x4a'),_0x7487('0x4b'),_0x7487('0x4c'),_0x7487('0x4d'),'bridgepeer',_0x7487('0x4e'),'membercalls',_0x7487('0x4f'),_0x7487('0x50'),_0x7487('0x51'),_0x7487('0x24'),_0x7487('0x52'),'memberrealtime'];if(!_['isNil'](_0x5cb1f0)&&!_[_0x7487('0x53')](_0x5294d5,_0x5cb1f0)){if(_[_0x7487('0x17')](this[_0x7487('0x40')][_0x4c0299])){this['variables'][_0x4c0299]={};}this[_0x7487('0x40')][_0x4c0299][_0x5cb1f0]=_0x24b965;}};VoiceDialReport['prototype']['syncHangup']=function(_0x64a818){try{if(this['isNotNull'](_0x64a818)){logger[_0x7487('0x19')]('[%s][voiceDialReport][hangup]\x20event:',_0x64a818[_0x7487('0x1b')],util[_0x7487('0x27')](_0x64a818,{'showHidden':![],'depth':null}));if(this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]]){logger[_0x7487('0x22')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x64a818[_0x7487('0x1b')],_0x64a818[_0x7487('0x54')]);this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]]['endtime']=moment()[_0x7487('0x34')](_0x7487('0x35'));this['channels'][_0x64a818['uniqueid']]['duration']=moment(this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x55')])[_0x7487('0x56')](this[_0x7487('0xa')][_0x64a818['uniqueid']]['starttime'],'seconds');this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x36')]='complete';this[_0x7487('0xb')][_0x7487('0x57')]+=0x1;if(this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x33')]){this[_0x7487('0xb')]['answered']+=0x1;this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x58')]=moment(this['channels'][_0x64a818[_0x7487('0x1b')]][_0x7487('0x33')])['diff'](this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]]['starttime'],'seconds');this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x59')]=moment(this[_0x7487('0xa')][_0x64a818['uniqueid']][_0x7487('0x55')])['diff'](this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x33')],'seconds');this[_0x7487('0xb')][_0x7487('0x5a')]+=this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x58')]||0x0;this[_0x7487('0xb')][_0x7487('0x5b')]+=this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]]['billableseconds'];}this[_0x7487('0xb')]['sumDuration']+=this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]][_0x7487('0x5c')];logger['debug'](_0x7487('0x5d'),_0x64a818[_0x7487('0x1b')],util[_0x7487('0x27')](this['channels'][_0x64a818['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x7487('0x5e'),this['channels'][_0x64a818[_0x7487('0x1b')]]);logger[_0x7487('0x19')](_0x7487('0x5f'),_0x64a818['uniqueid'],util['inspect'](this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7487('0x60'),this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]]);logger[_0x7487('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x64a818[_0x7487('0x1b')],util[_0x7487('0x27')](this['channels'][_0x64a818[_0x7487('0x1b')]],{'showHidden':![],'depth':null}));this[_0x7487('0x18')](_0x7487('0x29'),'voice_outbound:save',this[_0x7487('0xb')]);logger[_0x7487('0x22')](_0x7487('0x61'),JSON[_0x7487('0x62')](this['channels'][_0x64a818[_0x7487('0x1b')]]));logger[_0x7487('0x19')](_0x7487('0x63'),_0x64a818[_0x7487('0x1b')],util['inspect'](this[_0x7487('0xa')][_0x64a818['uniqueid']],{'showHidden':![],'depth':null}));this[_0x7487('0x18')](_0x7487('0x29'),_0x7487('0x64'),this[_0x7487('0xa')][_0x64a818['uniqueid']]);delete this[_0x7487('0xa')][_0x64a818[_0x7487('0x1b')]];}else if(this[_0x7487('0xa')][_0x64a818[_0x7487('0x65')]]){this[_0x7487('0xa')][_0x64a818['linkedid']][_0x7487('0x1b')]=this[_0x7487('0xa')][_0x64a818['linkedid']][_0x7487('0x66')];}if(this['variables'][_0x64a818['uniqueid']]){delete this[_0x7487('0x40')][_0x64a818['uniqueid']];}}}catch(_0x4d523){logger[_0x7487('0x2d')](_0x7487('0x67'),_0x64a818[_0x7487('0x1b')],util[_0x7487('0x27')](_0x4d523,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0x4c303e){try{if(this[_0x7487('0x16')](_0x4c303e)){logger[_0x7487('0x19')](_0x7487('0x68'),_0x4c303e['uniqueid'],util['inspect'](_0x4c303e,{'showHidden':![],'depth':null}));if(_0x4c303e['application'][_0x7487('0x69')]()===_0x7487('0x6a')){_0x4c303e[_0x7487('0x6b')]=(_0x4c303e['appdata']||_0x4c303e[_0x7487('0x6b')])[_0x7487('0x69')]();if(_[_0x7487('0x6c')](_0x4c303e[_0x7487('0x6b')],_0x7487('0x6d'))){if(_['isUndefined'](this['applications'][_0x4c303e['uniqueid']]))this['applications'][_0x4c303e[_0x7487('0x1b')]]={};logger[_0x7487('0x22')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x4c303e[_0x7487('0x1b')],_0x4c303e[_0x7487('0x6e')],_0x4c303e[_0x7487('0x6b')]);var _0x27e121=_0x4c303e[_0x7487('0x6b')][_0x7487('0x6f')]('=');var _0x36868b=_0x27e121[0x0][_0x7487('0x70')](/cdr\((.*)\)/);if(_0x36868b)this['applications'][_0x4c303e['uniqueid']][_0x36868b[0x1]]=_0x27e121[0x1];}}}}catch(_0x44f164){logger[_0x7487('0x2d')]('[%s][voiceDialReport][newexten]',_0x4c303e[_0x7487('0x1b')],util['inspect'](_0x44f164,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index ad6b573..4a9022e 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 _0xf194=['sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[voiceQueueReport][queuesummary]','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','lastAssignedTo','queuecallercomplete','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','linkedid','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','application','set','applicationdata','startsWith','appdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','../../../config/environment','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','bind','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','prototype','channels','isNil','Action','status','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_presence:remove','type','inbound','strategy','answered','available','loggedIn','pTalking'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xf194,0x91));var _0x4f19=function(_0xd7495f,_0x5addbc){_0xd7495f=_0xd7495f-0x0;var _0x15d68a=_0xf194[_0xd7495f];return _0x15d68a;};'use strict';var _=require(_0x4f19('0x0'));var moment=require(_0x4f19('0x1'));var util=require(_0x4f19('0x2'));var md5=require(_0x4f19('0x3'));var Redis=require('ioredis');var config=require(_0x4f19('0x4'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require(_0x4f19('0x5'));config[_0x4f19('0x6')]=_[_0x4f19('0x7')](config['redis'],{'host':_0x4f19('0x8'),'port':0x18eb});var io=require(_0x4f19('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x4f19('0xa')]=function(_0x116780){this[_0x4f19('0xb')]=this[_0x4f19('0xb')]?this['tail'][_0x4f19('0xc')](_0x116780):_0x116780();};function VoiceQueueReport(_0x9cb3e7){this[_0x4f19('0xd')]=new Sequence();this[_0x4f19('0xe')]={};this[_0x4f19('0xf')]=_0x9cb3e7[_0x4f19('0xf')];this['channels']=_0x9cb3e7['queueChannels'];this['voiceQueues']=_0x9cb3e7[_0x4f19('0x10')];this[_0x4f19('0x11')]=!![];this['campaigns']=_0x9cb3e7[_0x4f19('0x12')];this[_0x4f19('0x13')]={};ami['on'](_0x4f19('0x14'),this[_0x4f19('0x15')]['bind'](this));ami['on'](_0x4f19('0x16'),this[_0x4f19('0x17')]['bind'](this));ami['on'](_0x4f19('0x18'),this[_0x4f19('0x19')]['bind'](this));ami['on'](_0x4f19('0x1a'),this['syncQueueCallerAbandon'][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x1c'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x4f19('0x1d'),this[_0x4f19('0x1e')][_0x4f19('0x1b')](this));ami['on']('agentconnect',this[_0x4f19('0x1f')][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x20'),this[_0x4f19('0x21')][_0x4f19('0x1b')](this));ami['on']('hangup',this[_0x4f19('0x22')][_0x4f19('0x1b')](this));ami['on']('fullybooted',this[_0x4f19('0x23')][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x24'),this[_0x4f19('0x25')]['bind'](this));ami['on'](_0x4f19('0x26'),this[_0x4f19('0x27')][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x28'),this[_0x4f19('0x29')][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x2a'),this[_0x4f19('0x2b')][_0x4f19('0x1b')](this));ami['on'](_0x4f19('0x2c'),this[_0x4f19('0x2d')][_0x4f19('0x1b')](this));this[_0x4f19('0x2e')]();this[_0x4f19('0x2f')]();}function clearChannels(_0x202965){if(!_[_0x4f19('0x30')](_0x202965)){for(var _0x2fc1a4 in _0x202965){if(_0x202965[_0x4f19('0x31')](_0x2fc1a4)){delete _0x202965[_0x2fc1a4];}}}}function clearCampaigns(_0x2f6c41){if(!_['isEmpty'](_0x2f6c41)){for(var _0xabade8 in _0x2f6c41){if(_0x2f6c41['hasOwnProperty'](_0xabade8)){_0x2f6c41[_0xabade8][_0x4f19('0x32')]=0x0;}}}}function clearVoiceQueues(_0x515956){if(!_[_0x4f19('0x30')](_0x515956)){for(var _0x5321a8 in _0x515956){if(_0x515956[_0x4f19('0x31')](_0x5321a8)){_0x515956[_0x5321a8][_0x4f19('0x32')]=0x0;_0x515956[_0x5321a8][_0x4f19('0x33')]=0x0;_0x515956[_0x5321a8]['pTalking']=0x0;_0x515956[_0x5321a8][_0x4f19('0x34')]=0x0;_0x515956[_0x5321a8][_0x4f19('0x35')]=!![];}}}}function clearAgentBooked(_0x2175ff){if(!_[_0x4f19('0x30')](_0x2175ff)){for(var _0x13f820 in _0x2175ff){if(_0x2175ff['hasOwnProperty'](_0x13f820)){_0x2175ff[_0x13f820][_0x4f19('0x36')]=!![];}}}}VoiceQueueReport[_0x4f19('0x37')]['clearZombieChannels']=function(){var _0x3531d9=this;for(var _0x3c7e22 in this[_0x4f19('0x38')]){if(this[_0x4f19('0x38')][_0x4f19('0x31')](_0x3c7e22)&&!this[_0x4f19('0x38')][_0x3c7e22]['switch']){this[_0x4f19('0xd')][_0x4f19('0xa')](function(){if(!_[_0x4f19('0x39')](_0x3531d9['channels'][_0x3c7e22])){return ami[_0x4f19('0x3a')]({'action':_0x4f19('0x3b'),'channel':_0x3531d9[_0x4f19('0x38')][_0x3c7e22][_0x4f19('0x3c')]})[_0x4f19('0x3d')](function(_0x75ddb1){if(_0x75ddb1['message']===_0x4f19('0x3e')){setTimeout(function(){if(_0x3531d9[_0x4f19('0x38')][_0x3c7e22]){delete _0x3531d9['channels'][_0x3c7e22];logger[_0x4f19('0x3f')](_0x4f19('0x40'),_0x3c7e22,util[_0x4f19('0x41')](_0x75ddb1,{'showHidden':![],'depth':null}));}if(_0x3531d9[_0x4f19('0xe')][_0x3c7e22]){delete _0x3531d9[_0x4f19('0xe')][_0x3c7e22];logger[_0x4f19('0x3f')](_0x4f19('0x42'),_0x3c7e22,util['inspect'](_0x75ddb1,{'showHidden':![],'depth':null}));}if(_0x3531d9[_0x4f19('0x13')][_0x3c7e22]){delete _0x3531d9[_0x4f19('0x13')][_0x3c7e22];logger[_0x4f19('0x3f')](_0x4f19('0x43'),_0x3c7e22,util[_0x4f19('0x41')](_0x75ddb1,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x23')]=function(){logger[_0x4f19('0x3f')](_0x4f19('0x44'));clearChannels(this['channels']);this[_0x4f19('0x45')](this[_0x4f19('0xe')]);clearAgentBooked(this[_0x4f19('0xf')]);clearVoiceQueues(this[_0x4f19('0x10')]);clearCampaigns(this[_0x4f19('0x12')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0x8e81d){var _0x216973=this;if(!_['isEmpty'](_0x8e81d)){for(var _0x48cd27 in _0x8e81d){if(_0x8e81d[_0x4f19('0x31')](_0x48cd27)){_0x216973[_0x4f19('0x46')](_0x8e81d[_0x48cd27],'clearqueuereport');delete _0x8e81d[_0x48cd27];}}}};VoiceQueueReport['prototype'][_0x4f19('0x47')]=function(_0x5bd58c,_0x38e0c3,_0x17b35c){io['to'](_0x5bd58c)[_0x4f19('0x47')](_0x38e0c3,_0x17b35c);};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x48')]=function(_0x3a0648,_0x3d2878){logger[_0x4f19('0x49')](_0x4f19('0x4a')+_0x3d2878+']\x20sending\x20voice_queue_channel:save\x20event:',_0x3a0648[_0x4f19('0x4b')],util['inspect'](_0x3a0648,{'showHidden':![],'depth':null}));this[_0x4f19('0x47')](util[_0x4f19('0x4c')](_0x4f19('0x4d'),_0x3a0648[_0x4f19('0x4e')]),_0x4f19('0x4f'),_0x3a0648);io[_0x4f19('0x47')]('voice_queue_presence:save',_0x3a0648);};VoiceQueueReport['prototype'][_0x4f19('0x46')]=function(_0x2d5e9c,_0x16a7ee){logger['debug'](_0x4f19('0x4a')+_0x16a7ee+_0x4f19('0x50'),_0x2d5e9c[_0x4f19('0x4b')],util['inspect'](_0x2d5e9c,{'showHidden':![],'depth':null}));this[_0x4f19('0x47')](util[_0x4f19('0x4c')](_0x4f19('0x4d'),_0x2d5e9c['name']),'voice_queue_channel:remove',_0x2d5e9c);io[_0x4f19('0x47')](_0x4f19('0x51'),_0x2d5e9c);};VoiceQueueReport[_0x4f19('0x37')]['emitVoiceQueueSummary']=function(_0x4cd66f,_0x3f965a){if(_0x4cd66f[_0x4f19('0x52')]===_0x4f19('0x53')){var _0x26abdc={'id':_0x4cd66f['id'],'name':_0x4cd66f[_0x4f19('0x4e')],'strategy':_0x4cd66f[_0x4f19('0x54')],'answered':_0x4cd66f[_0x4f19('0x55')],'available':_0x4cd66f[_0x4f19('0x56')],'loggedIn':_0x4cd66f[_0x4f19('0x57')],'pTalking':_0x4cd66f[_0x4f19('0x58')],'sumBillable':_0x4cd66f['sumBillable'],'sumDuration':_0x4cd66f[_0x4f19('0x59')],'sumHoldTime':_0x4cd66f[_0x4f19('0x5a')]||0x0,'talking':_0x4cd66f[_0x4f19('0x33')],'total':_0x4cd66f[_0x4f19('0x5b')],'type':_0x4cd66f[_0x4f19('0x52')],'unmanaged':_0x4cd66f[_0x4f19('0x5c')],'abandoned':_0x4cd66f[_0x4f19('0x5d')],'waiting':_0x4cd66f[_0x4f19('0x34')]};if(_0x4cd66f[_0x4f19('0x5e')]){_0x26abdc[_0x4f19('0x5e')]={'id':_0x4cd66f[_0x4f19('0x5e')]['id'],'name':_0x4cd66f['Trunk'][_0x4f19('0x4e')],'active':_0x4cd66f['Trunk']['active'],'callerid':_0x4cd66f[_0x4f19('0x5e')][_0x4f19('0x5f')]};}if(_0x4cd66f[_0x4f19('0x60')]){_0x26abdc[_0x4f19('0x60')]={'id':_0x4cd66f['Interval']['id'],'name':_0x4cd66f['Interval']['name']};}var _0x5e4926=md5(JSON['stringify'](_0x26abdc));if(_0x4cd66f['md5']!==_0x5e4926){_0x4cd66f['md5']=_0x5e4926;logger[_0x4f19('0x49')](_0x4f19('0x61')+_0x3f965a+_0x4f19('0x62'),util[_0x4f19('0x41')](_0x26abdc,{'showHidden':![],'depth':null}));this[_0x4f19('0x47')](util[_0x4f19('0x4c')]('voice:queue:%s',_0x26abdc[_0x4f19('0x4e')]),_0x4f19('0x63'),_0x26abdc);}}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x64')]=function(_0x5ade30){return _0x5ade30!==null&&!_['isUndefined'](_0x5ade30);};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x2f')]=function(){var _0x371a17=this;setInterval(function(){_0x371a17['clearZombieChannels']();ami[_0x4f19('0x3a')]({'action':_0x4f19('0x65')})[_0x4f19('0x3d')](function(_0x9f57e7){logger[_0x4f19('0x3f')](_0x4f19('0x66'),util[_0x4f19('0x41')](_0x9f57e7,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4f19('0x37')]['loopQueueSummary']=function(){var _0x21c425=this;setInterval(function(){if(_0x21c425[_0x4f19('0x11')]){return ami[_0x4f19('0x3a')]({'action':_0x4f19('0x14')})[_0x4f19('0x67')](function(_0x4545c5){_0x21c425[_0x4f19('0x11')]=![];})[_0x4f19('0x3d')](function(_0x5d0dfa){logger[_0x4f19('0x3f')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x5d0dfa,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x15')]=function(_0x45694e){try{if(this[_0x4f19('0x64')](_0x45694e)&&this[_0x4f19('0x64')](_0x45694e[_0x4f19('0x68')])){logger[_0x4f19('0x49')](_0x4f19('0x69'),util['inspect'](_0x45694e,{'showHidden':![],'depth':null}));if(this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]]){logger[_0x4f19('0x6a')](_0x4f19('0x6b'),_0x45694e['queue']);var _0x15d3b0=_[_0x4f19('0x6c')](this[_0x4f19('0x38')],_0x4f19('0x68'))[_0x45694e[_0x4f19('0x68')]]||0x0;var _0x318dc0=_0x15d3b0-_0x45694e[_0x4f19('0x6d')];if(this[_0x4f19('0x10')][_0x45694e['queue']][_0x4f19('0x34')]!==_[_0x4f19('0x6e')](_0x45694e[_0x4f19('0x6d')])||this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x57')]!==_[_0x4f19('0x6e')](_0x45694e[_0x4f19('0x6f')])||this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x56')]!==_[_0x4f19('0x6e')](_0x45694e['available'])||this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x33')]!==_0x318dc0){this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x34')]=_[_0x4f19('0x6e')](_0x45694e[_0x4f19('0x6d')]);this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x57')]=_[_0x4f19('0x6e')](_0x45694e[_0x4f19('0x6f')]);this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x56')]=_[_0x4f19('0x6e')](_0x45694e['available']);this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x33')]=_0x318dc0>0x0?_0x318dc0:0x0;this['voiceQueues'][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x33')]=this[_0x4f19('0x10')][_0x45694e['queue']][_0x4f19('0x33')]>_[_0x4f19('0x6e')](_0x45694e[_0x4f19('0x6f')])?_['toNumber'](_0x45694e[_0x4f19('0x6f')]):this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]][_0x4f19('0x33')];this[_0x4f19('0x70')](this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]],_0x4f19('0x14'));}logger[_0x4f19('0x49')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0x4f19('0x10')][_0x45694e[_0x4f19('0x68')]],{'showHidden':![],'depth':null}));ami['emit'](_0x4f19('0x71'),this[_0x4f19('0x10')][_0x45694e['queue']]);}}}catch(_0x442188){logger[_0x4f19('0x3f')](_0x4f19('0x72'),util['inspect'](_0x442188,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f19('0x37')]['syncQueueSummaryComplete']=function(_0x51bf63){logger[_0x4f19('0x49')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x4f19('0x41')](_0x51bf63,{'showHidden':![],'depth':null}));this[_0x4f19('0x11')]=!![];};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x19')]=function(_0x57613d){try{if(this['isNotNull'](_0x57613d)){logger[_0x4f19('0x49')](_0x4f19('0x73'),_0x57613d['uniqueid'],util[_0x4f19('0x41')](_0x57613d,{'showHidden':![],'depth':null}));if(_[_0x4f19('0x74')](this[_0x4f19('0xe')][_0x57613d[_0x4f19('0x4b')]]))this[_0x4f19('0xe')][_0x57613d[_0x4f19('0x4b')]]=[];if(_[_0x4f19('0x74')](this[_0x4f19('0x38')][_0x57613d[_0x4f19('0x4b')]]))this['channels'][_0x57613d[_0x4f19('0x4b')]]={};var _0x37942b=new QueueReport();_0x37942b[_0x4f19('0x4e')]=_0x57613d['queue'];_0x37942b['type']=this[_0x4f19('0x10')][_0x37942b[_0x4f19('0x4e')]]&&this[_0x4f19('0x10')][_0x37942b[_0x4f19('0x4e')]][_0x4f19('0x52')]?this[_0x4f19('0x10')][_0x37942b[_0x4f19('0x4e')]][_0x4f19('0x52')]||_0x4f19('0x53'):_0x4f19('0x53');_0x37942b[_0x4f19('0x68')]=_0x57613d[_0x4f19('0x68')];_0x37942b[_0x4f19('0x75')]=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));_0x37942b[_0x4f19('0x77')]=_0x57613d[_0x4f19('0x77')];_0x37942b[_0x4f19('0x78')]=_0x57613d['count'];_0x37942b[_0x4f19('0x4b')]=_0x57613d['uniqueid'];_0x37942b[_0x4f19('0x79')]=this[_0x4f19('0x38')][_0x57613d[_0x4f19('0x4b')]]['routealias'];logger[_0x4f19('0x6a')](_0x4f19('0x7a'),_0x37942b[_0x4f19('0x4e')],_0x37942b[_0x4f19('0x52')]);_['merge'](_0x37942b,_['pick'](_0x57613d,_['keys'](_0x37942b)));this[_0x4f19('0xe')][_0x57613d[_0x4f19('0x4b')]][_0x4f19('0x7b')](_0x37942b);this[_0x4f19('0x38')][_0x57613d[_0x4f19('0x4b')]]=_0x37942b;this[_0x4f19('0x48')](_0x37942b,_0x4f19('0x18'));}}catch(_0x5aa0af){logger[_0x4f19('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x57613d['uniqueid'],util[_0x4f19('0x41')](_0x5aa0af,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4f19('0x7c')]=function(_0x9f101e){try{if(this['isNotNull'](_0x9f101e)){logger[_0x4f19('0x49')](_0x4f19('0x7d'),_0x9f101e[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x9f101e,{'showHidden':![],'depth':null}));if(this[_0x4f19('0xe')][_0x9f101e[_0x4f19('0x4b')]]){var _0x22879a=_[_0x4f19('0x7e')](this[_0x4f19('0xe')][_0x9f101e[_0x4f19('0x4b')]]);_0x22879a['queuecallercomplete']=![];_0x22879a[_0x4f19('0x7f')]=null;_0x22879a['holdtime']=_0x9f101e[_0x4f19('0x80')];_0x22879a[_0x4f19('0x81')]=_0x9f101e[_0x4f19('0x81')];_0x22879a[_0x4f19('0x1a')]=!![];_0x22879a['queuecallerabandonAt']=moment()['format'](_0x4f19('0x76'));_0x22879a[_0x4f19('0x82')]=_0x4f19('0x83');_0x22879a['lastAssignedTo']=null;logger[_0x4f19('0x6a')](_0x4f19('0x84'),_0x22879a['name'],_0x22879a[_0x4f19('0x52')]);this[_0x4f19('0x38')][_0x9f101e[_0x4f19('0x4b')]]=_0x22879a;this[_0x4f19('0x46')](_0x22879a,_0x4f19('0x1a'));}}}catch(_0x17d5df){logger['error'](_0x4f19('0x7d'),_0x9f101e[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x17d5df,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x85')]=function(_0x3c731d){try{if(this[_0x4f19('0x64')](_0x3c731d)){logger[_0x4f19('0x49')]('[%s][voiceQueueReport][queuecallerleave]',_0x3c731d[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x3c731d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3c731d[_0x4f19('0x4b')]]){var _0x4a41e5=_[_0x4f19('0x7e')](this[_0x4f19('0xe')][_0x3c731d[_0x4f19('0x4b')]]);_0x4a41e5[_0x4f19('0x86')]=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));_0x4a41e5[_0x4f19('0x87')]=_0x3c731d[_0x4f19('0x87')];_0x4a41e5[_0x4f19('0x88')]=_0x3c731d[_0x4f19('0x88')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4a41e5['name'],_0x4a41e5[_0x4f19('0x52')],_0x3c731d['connectedlinenum'],_0x3c731d[_0x4f19('0x88')]);this['channels'][_0x3c731d['uniqueid']]=_0x4a41e5;this[_0x4f19('0x48')](_0x4a41e5,_0x4f19('0x1c'));}}}catch(_0x404b2a){logger[_0x4f19('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x3c731d[_0x4f19('0x4b')],util['inspect'](_0x404b2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x1f')]=function(_0x2bbf47){try{if(this[_0x4f19('0x64')](_0x2bbf47)){logger['debug'](_0x4f19('0x89'),_0x2bbf47['uniqueid'],util[_0x4f19('0x41')](_0x2bbf47,{'showHidden':![],'depth':null}));if(this[_0x4f19('0xe')][_0x2bbf47[_0x4f19('0x4b')]]){var _0x25ebab=_[_0x4f19('0x7e')](this[_0x4f19('0xe')][_0x2bbf47[_0x4f19('0x4b')]]);_0x25ebab['queuecallercomplete']=!![];_0x25ebab[_0x4f19('0x82')]='COMPLETEDBYAGENT';logger[_0x4f19('0x6a')](_0x4f19('0x8a'),_0x25ebab[_0x4f19('0x4e')],_0x25ebab[_0x4f19('0x52')]);}}}catch(_0x415903){logger[_0x4f19('0x3f')](_0x4f19('0x89'),_0x2bbf47[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x415903,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f19('0x37')]['syncAgentComplete']=function(_0xe33881){try{if(this['isNotNull'](_0xe33881)){logger['debug'](_0x4f19('0x8b'),_0xe33881['uniqueid'],util[_0x4f19('0x41')](_0xe33881,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe33881[_0x4f19('0x4b')]]){var _0x3f466f=_[_0x4f19('0x7e')](this[_0x4f19('0xe')][_0xe33881[_0x4f19('0x4b')]]);_0x3f466f['queuecallerabandon']=![];_0x3f466f[_0x4f19('0x8c')]=null;_0x3f466f[_0x4f19('0x8d')]=!![];_0x3f466f[_0x4f19('0x8e')]=_0xe33881['membername'];_0x3f466f[_0x4f19('0x80')]=_0xe33881[_0x4f19('0x80')];_0x3f466f[_0x4f19('0x8f')]=!![];_0x3f466f[_0x4f19('0x90')]=![];_0x3f466f[_0x4f19('0x91')]=null;if(!_0x3f466f[_0x4f19('0x92')]){if(_0xe33881[_0x4f19('0x93')]==_0x4f19('0x92')){_0x3f466f[_0x4f19('0x82')]=_0x4f19('0x94');logger[_0x4f19('0x6a')](_0x4f19('0x95'),_0x3f466f['name'],_0x3f466f[_0x4f19('0x52')]);}else{if(_['startsWith'](_0xe33881[_0x4f19('0x3c')][_0x4f19('0x96')](),_0x4f19('0x97'))){if(this['queueReports'][_0xe33881['linkedid']]){var _0x7def77=_[_0x4f19('0x7e')](this['queueReports'][_0xe33881['linkedid']]);_0x7def77[_0x4f19('0x8f')]=![];_0x7def77[_0x4f19('0x90')]=!![];_0x7def77[_0x4f19('0x91')]=moment(_0x3f466f[_0x4f19('0x75')])[_0x4f19('0x98')](_0xe33881['holdtime'],_0x4f19('0x99'))[_0x4f19('0x4c')](_0x4f19('0x76'));_0x7def77[_0x4f19('0x82')]=_0x4f19('0x9a');_0x7def77['transfer']=!![];_0x7def77[_0x4f19('0x9b')]='FORWARD';_0x7def77[_0x4f19('0x9c')]=_0xe33881[_0x4f19('0x9d')];_0x7def77[_0x4f19('0x9e')]=_0xe33881[_0x4f19('0x4b')];logger[_0x4f19('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x7def77[_0x4f19('0x4e')],_0x7def77[_0x4f19('0x52')]);var _0x101838=this[_0x4f19('0xe')][_0xe33881[_0x4f19('0x9f')]];this[_0x4f19('0xe')][_0xe33881[_0x4f19('0x9f')]]=this[_0x4f19('0xe')][_0xe33881[_0x4f19('0x4b')]];this[_0x4f19('0xe')][_0xe33881[_0x4f19('0x4b')]]=_0x101838;}}else{_0x3f466f[_0x4f19('0x82')]=_0x4f19('0xa0')+_0xe33881[_0x4f19('0x93')]['toUpperCase']();logger[_0x4f19('0x6a')](_0x4f19('0xa1'),_0x3f466f['name'],_0x3f466f['type'],_0x3f466f['queuecallerexitreason']);}}}this[_0x4f19('0x38')][_0xe33881[_0x4f19('0x4b')]]=_0x3f466f;this[_0x4f19('0x46')](_0x3f466f,'agentcomplete');}}}catch(_0x43dbf4){logger[_0x4f19('0x3f')](_0x4f19('0x8b'),_0xe33881[_0x4f19('0x4b')],util['inspect'](_0x43dbf4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x21')]=function(_0x5a681c){try{if(this[_0x4f19('0x64')](_0x5a681c)){logger[_0x4f19('0x49')](_0x4f19('0xa2'),_0x5a681c[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x5a681c,{'showHidden':![],'depth':null}));this[_0x4f19('0xa3')](_0x5a681c[_0x4f19('0x4b')],_[_0x4f19('0xa4')](_0x5a681c[_0x4f19('0xa5')])[0x0],_0x5a681c[_0x4f19('0xa6')]);if(this[_0x4f19('0xe')][_0x5a681c[_0x4f19('0x4b')]]){var _0x35e0e6=_[_0x4f19('0x7e')](this[_0x4f19('0xe')][_0x5a681c[_0x4f19('0x4b')]]);if(_0x35e0e6){if(this[_0x4f19('0x64')](_0x5a681c[_0x4f19('0xa5')])&&this['isNotNull'](_0x5a681c['variable'][_0x4f19('0xa7')])){switch(_0x5a681c[_0x4f19('0xa6')]){case _0x4f19('0xa8'):_0x35e0e6[_0x4f19('0x90')]=![];_0x35e0e6['queuecallerexitAt']=null;break;case _0x4f19('0xa9'):_0x35e0e6[_0x4f19('0xaa')]=_0x4f19('0xab');_0x35e0e6[_0x4f19('0x90')]=!![];_0x35e0e6[_0x4f19('0x91')]=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));_0x35e0e6[_0x4f19('0x86')]=moment()['format'](_0x4f19('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x5a681c[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x35e0e6,{'showHidden':![],'depth':null}));ami['emit'](_0x4f19('0xac'),_0x35e0e6);break;default:_0x35e0e6[_0x4f19('0x90')]=!![];_0x35e0e6[_0x4f19('0x91')]=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));_0x35e0e6['queuecallerleaveAt']=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));}_0x35e0e6[_0x4f19('0x1a')]=![];_0x35e0e6[_0x4f19('0x8c')]=null;_0x35e0e6['queuecallerexitreason']=_0x5a681c[_0x4f19('0xa6')];this[_0x4f19('0x38')][_0x5a681c[_0x4f19('0x4b')]]=_0x35e0e6;this[_0x4f19('0x46')](_0x35e0e6,'varset');}else if(this[_0x4f19('0x64')](_0x5a681c[_0x4f19('0xa5')])&&this[_0x4f19('0x64')](_0x5a681c[_0x4f19('0xa5')][_0x4f19('0xad')])){if(!_0x35e0e6[_0x4f19('0x1a')]){_0x35e0e6['queuecallerexit']=!![];_0x35e0e6[_0x4f19('0x91')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35e0e6[_0x4f19('0x82')]='EXITWITHKEY';_0x35e0e6[_0x4f19('0x86')]=moment()[_0x4f19('0x4c')](_0x4f19('0x76'));this[_0x4f19('0x38')][_0x5a681c[_0x4f19('0x4b')]]=_0x35e0e6;}}logger[_0x4f19('0x6a')](_0x4f19('0xae'),_0x5a681c['uniqueid'],_0x35e0e6[_0x4f19('0x4e')],_0x35e0e6[_0x4f19('0x52')],_[_0x4f19('0xa4')](_0x5a681c[_0x4f19('0xa5')])[0x0],_0x5a681c['value']);_0x35e0e6[_0x4f19('0x13')]=this['variables'][_0x5a681c[_0x4f19('0x4b')]];}}}}catch(_0x112021){logger[_0x4f19('0x3f')](_0x4f19('0xa2'),_0x5a681c[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x112021,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4f19('0xa3')]=function(_0x318977,_0x2d9c99,_0x5f0cf8){var _0x496b9b=['rtpaudioqos',_0x4f19('0xaf'),_0x4f19('0xb0'),_0x4f19('0xb1'),_0x4f19('0xb2'),_0x4f19('0xb3'),_0x4f19('0xb4'),_0x4f19('0xb5'),_0x4f19('0xb6'),_0x4f19('0xb7'),_0x4f19('0xb8'),_0x4f19('0xb9'),_0x4f19('0xba'),_0x4f19('0xbb'),_0x4f19('0xbc'),_0x4f19('0xbd'),'membername','memberpenalty','memberrealtime'];if(!_[_0x4f19('0x39')](_0x2d9c99)&&!_['includes'](_0x496b9b,_0x2d9c99)){if(_[_0x4f19('0x74')](this[_0x4f19('0x13')][_0x318977])){this[_0x4f19('0x13')][_0x318977]={};}this['variables'][_0x318977][_0x2d9c99]=_0x5f0cf8;}};VoiceQueueReport[_0x4f19('0x37')][_0x4f19('0x22')]=function(_0x4493c1){try{if(this[_0x4f19('0x64')](_0x4493c1)){logger[_0x4f19('0x49')](_0x4f19('0xbe'),_0x4493c1[_0x4f19('0x4b')],util[_0x4f19('0x41')](_0x4493c1,{'showHidden':![],'depth':null}));if(this[_0x4f19('0xe')][_0x4493c1['uniqueid']]){for(var _0x3ddfdd=0x0,_0x941385={};_0x3ddfdd0x0?_0x4a78c2:0x0;this[_0x4109('0x13')][_0x43954d[_0x4109('0x66')]][_0x4109('0x6d')]=this[_0x4109('0x13')][_0x43954d[_0x4109('0x66')]][_0x4109('0x6d')]>_[_0x4109('0x6a')](_0x43954d['loggedin'])?_['toNumber'](_0x43954d['loggedin']):this[_0x4109('0x13')][_0x43954d['queue']]['talking'];this[_0x4109('0x53')](this[_0x4109('0x13')][_0x43954d['queue']],'queuesummary');}logger[_0x4109('0x49')](_0x4109('0x6f'),util[_0x4109('0x42')](this[_0x4109('0x13')][_0x43954d['queue']],{'showHidden':![],'depth':null}));ami[_0x4109('0x47')](_0x4109('0x70'),this[_0x4109('0x13')][_0x43954d[_0x4109('0x66')]]);}}}catch(_0x4d8a8d){logger[_0x4109('0x43')](_0x4109('0x71'),util[_0x4109('0x42')](_0x4d8a8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4109('0xc')][_0x4109('0x1a')]=function(_0x32f6dd){logger['debug'](_0x4109('0x72'),util[_0x4109('0x42')](_0x32f6dd,{'showHidden':![],'depth':null}));this[_0x4109('0x14')]=!![];};VoiceQueueReport['prototype'][_0x4109('0x1b')]=function(_0x4c49bd){try{if(this[_0x4109('0x60')](_0x4c49bd)){logger[_0x4109('0x49')](_0x4109('0x73'),_0x4c49bd[_0x4109('0x4c')],util[_0x4109('0x42')](_0x4c49bd,{'showHidden':![],'depth':null}));if(_[_0x4109('0x61')](this[_0x4109('0xf')][_0x4c49bd[_0x4109('0x4c')]]))this[_0x4109('0xf')][_0x4c49bd['uniqueid']]=[];if(_[_0x4109('0x61')](this[_0x4109('0x11')][_0x4c49bd[_0x4109('0x4c')]]))this['channels'][_0x4c49bd[_0x4109('0x4c')]]={};var _0x531c12=new QueueReport();_0x531c12['name']=_0x4c49bd[_0x4109('0x66')];_0x531c12['type']=this[_0x4109('0x13')][_0x531c12[_0x4109('0x4f')]]&&this[_0x4109('0x13')][_0x531c12['name']][_0x4109('0x54')]?this[_0x4109('0x13')][_0x531c12[_0x4109('0x4f')]][_0x4109('0x54')]||_0x4109('0x55'):_0x4109('0x55');_0x531c12[_0x4109('0x66')]=_0x4c49bd[_0x4109('0x66')];_0x531c12[_0x4109('0x74')]=moment()['format'](_0x4109('0x75'));_0x531c12['position']=_0x4c49bd[_0x4109('0x76')];_0x531c12['count']=_0x4c49bd[_0x4109('0x77')];_0x531c12[_0x4109('0x4c')]=_0x4c49bd['uniqueid'];_0x531c12[_0x4109('0x78')]=this[_0x4109('0x11')][_0x4c49bd['uniqueid']][_0x4109('0x78')];logger['info'](_0x4109('0x79'),_0x531c12[_0x4109('0x4f')],_0x531c12[_0x4109('0x54')]);_[_0x4109('0x7a')](_0x531c12,_[_0x4109('0x7b')](_0x4c49bd,_['keys'](_0x531c12)));this[_0x4109('0xf')][_0x4c49bd[_0x4109('0x4c')]]['push'](_0x531c12);this[_0x4109('0x11')][_0x4c49bd[_0x4109('0x4c')]]=_0x531c12;this[_0x4109('0x48')](_0x531c12,_0x4109('0x7c'));}}catch(_0x1b09ea){logger['error'](_0x4109('0x73'),_0x4c49bd[_0x4109('0x4c')],util[_0x4109('0x42')](_0x1b09ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4109('0x1d')]=function(_0x257f8e){try{if(this[_0x4109('0x60')](_0x257f8e)){logger[_0x4109('0x49')](_0x4109('0x7d'),_0x257f8e['uniqueid'],util[_0x4109('0x42')](_0x257f8e,{'showHidden':![],'depth':null}));if(this[_0x4109('0xf')][_0x257f8e[_0x4109('0x4c')]]){var _0x1c51bd=_['last'](this['queueReports'][_0x257f8e[_0x4109('0x4c')]]);_0x1c51bd[_0x4109('0x7e')]=![];_0x1c51bd['queuecallercompleteAt']=null;_0x1c51bd['holdtime']=_0x257f8e[_0x4109('0x7f')];_0x1c51bd['originalposition']=_0x257f8e[_0x4109('0x80')];_0x1c51bd[_0x4109('0x1c')]=!![];_0x1c51bd['queuecallerabandonAt']=moment()[_0x4109('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c51bd[_0x4109('0x81')]='ABANDONED';_0x1c51bd[_0x4109('0x82')]=null;logger[_0x4109('0x68')](_0x4109('0x83'),_0x1c51bd[_0x4109('0x4f')],_0x1c51bd[_0x4109('0x54')]);this[_0x4109('0x11')][_0x257f8e[_0x4109('0x4c')]]=_0x1c51bd;this[_0x4109('0x46')](_0x1c51bd,_0x4109('0x1c'));}}}catch(_0x5a9932){logger[_0x4109('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x257f8e['uniqueid'],util[_0x4109('0x42')](_0x5a9932,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4109('0xc')][_0x4109('0x1f')]=function(_0x36b002){try{if(this[_0x4109('0x60')](_0x36b002)){logger[_0x4109('0x49')]('[%s][voiceQueueReport][queuecallerleave]',_0x36b002['uniqueid'],util['inspect'](_0x36b002,{'showHidden':![],'depth':null}));if(this[_0x4109('0xf')][_0x36b002[_0x4109('0x4c')]]){var _0x32e3ce=_[_0x4109('0x84')](this[_0x4109('0xf')][_0x36b002[_0x4109('0x4c')]]);_0x32e3ce[_0x4109('0x85')]=moment()[_0x4109('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x32e3ce[_0x4109('0x86')]=_0x36b002[_0x4109('0x86')];_0x32e3ce[_0x4109('0x87')]=_0x36b002[_0x4109('0x87')];logger[_0x4109('0x68')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x32e3ce['name'],_0x32e3ce[_0x4109('0x54')],_0x36b002[_0x4109('0x86')],_0x36b002['connectedlinename']);this[_0x4109('0x11')][_0x36b002[_0x4109('0x4c')]]=_0x32e3ce;this[_0x4109('0x48')](_0x32e3ce,_0x4109('0x1e'));}}}catch(_0x59de55){logger[_0x4109('0x43')](_0x4109('0x88'),_0x36b002[_0x4109('0x4c')],util[_0x4109('0x42')](_0x59de55,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x58f76c){try{if(this[_0x4109('0x60')](_0x58f76c)){logger[_0x4109('0x49')](_0x4109('0x89'),_0x58f76c[_0x4109('0x4c')],util[_0x4109('0x42')](_0x58f76c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x58f76c['uniqueid']]){var _0x51adf8=_['last'](this['queueReports'][_0x58f76c[_0x4109('0x4c')]]);_0x51adf8['queuecallercomplete']=!![];_0x51adf8[_0x4109('0x81')]=_0x4109('0x8a');logger[_0x4109('0x68')](_0x4109('0x8b'),_0x51adf8[_0x4109('0x4f')],_0x51adf8[_0x4109('0x54')]);}}}catch(_0x1f0b1c){logger[_0x4109('0x43')]('[%s][voiceQueueReport][agentconnect]',_0x58f76c[_0x4109('0x4c')],util['inspect'](_0x1f0b1c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x50734d){try{if(this['isNotNull'](_0x50734d)){logger[_0x4109('0x49')](_0x4109('0x8c'),_0x50734d['uniqueid'],util[_0x4109('0x42')](_0x50734d,{'showHidden':![],'depth':null}));if(this[_0x4109('0xf')][_0x50734d['uniqueid']]){var _0xc00c5e=_[_0x4109('0x84')](this[_0x4109('0xf')][_0x50734d[_0x4109('0x4c')]]);_0xc00c5e[_0x4109('0x1c')]=![];_0xc00c5e[_0x4109('0x8d')]=null;_0xc00c5e[_0x4109('0x8e')]=!![];_0xc00c5e[_0x4109('0x82')]=_0x50734d[_0x4109('0x8f')];_0xc00c5e[_0x4109('0x7f')]=_0x50734d[_0x4109('0x7f')];_0xc00c5e[_0x4109('0x7e')]=!![];_0xc00c5e[_0x4109('0x90')]=![];_0xc00c5e[_0x4109('0x91')]=null;if(!_0xc00c5e[_0x4109('0x92')]){if(_0x50734d['reason']==_0x4109('0x92')){_0xc00c5e[_0x4109('0x81')]=_0x4109('0x93');logger[_0x4109('0x68')](_0x4109('0x94'),_0xc00c5e[_0x4109('0x4f')],_0xc00c5e[_0x4109('0x54')]);}else{if(_['startsWith'](_0x50734d[_0x4109('0x95')][_0x4109('0x96')](),'local/')){if(this[_0x4109('0xf')][_0x50734d[_0x4109('0x97')]]){var _0x5c73c4=_['last'](this['queueReports'][_0x50734d[_0x4109('0x97')]]);_0x5c73c4[_0x4109('0x7e')]=![];_0x5c73c4[_0x4109('0x90')]=!![];_0x5c73c4['queuecallerexitAt']=moment(_0xc00c5e[_0x4109('0x74')])['add'](_0x50734d[_0x4109('0x7f')],'seconds')[_0x4109('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c73c4[_0x4109('0x81')]=_0x4109('0x98');_0x5c73c4[_0x4109('0x92')]=!![];_0x5c73c4[_0x4109('0x99')]=_0x4109('0x9a');_0x5c73c4['transferexten']=_0x50734d[_0x4109('0x9b')];_0x5c73c4['transferuniqueid']=_0x50734d[_0x4109('0x4c')];logger[_0x4109('0x68')](_0x4109('0x9c'),_0x5c73c4['name'],_0x5c73c4[_0x4109('0x54')]);var _0xf888e6=this[_0x4109('0xf')][_0x50734d[_0x4109('0x97')]];this[_0x4109('0xf')][_0x50734d[_0x4109('0x97')]]=this[_0x4109('0xf')][_0x50734d[_0x4109('0x4c')]];this[_0x4109('0xf')][_0x50734d[_0x4109('0x4c')]]=_0xf888e6;}}else{_0xc00c5e[_0x4109('0x81')]='COMPLETEDBY'+_0x50734d[_0x4109('0x9d')][_0x4109('0x9e')]();logger[_0x4109('0x68')](_0x4109('0x9f'),_0xc00c5e[_0x4109('0x4f')],_0xc00c5e[_0x4109('0x54')],_0xc00c5e[_0x4109('0x81')]);}}}this[_0x4109('0x11')][_0x50734d['uniqueid']]=_0xc00c5e;this[_0x4109('0x46')](_0xc00c5e,'agentcomplete');}}}catch(_0x4d4a89){logger[_0x4109('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x50734d['uniqueid'],util[_0x4109('0x42')](_0x4d4a89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4109('0xc')][_0x4109('0x23')]=function(_0x181d2e){try{if(this[_0x4109('0x60')](_0x181d2e)){logger[_0x4109('0x49')](_0x4109('0xa0'),_0x181d2e['uniqueid'],util[_0x4109('0x42')](_0x181d2e,{'showHidden':![],'depth':null}));this[_0x4109('0xa1')](_0x181d2e['uniqueid'],_['keys'](_0x181d2e[_0x4109('0xa2')])[0x0],_0x181d2e['value']);if(this[_0x4109('0xf')][_0x181d2e[_0x4109('0x4c')]]){var _0xa905c3=_[_0x4109('0x84')](this[_0x4109('0xf')][_0x181d2e['uniqueid']]);if(_0xa905c3){if(this['isNotNull'](_0x181d2e[_0x4109('0xa2')])&&this['isNotNull'](_0x181d2e[_0x4109('0xa2')][_0x4109('0xa3')])){switch(_0x181d2e['value']){case _0x4109('0xa4'):_0xa905c3[_0x4109('0x90')]=![];_0xa905c3[_0x4109('0x91')]=null;break;case _0x4109('0xa5'):_0xa905c3['lastevent']=_0x4109('0xa6');_0xa905c3[_0x4109('0x90')]=!![];_0xa905c3['queuecallerexitAt']=moment()[_0x4109('0x4d')](_0x4109('0x75'));_0xa905c3[_0x4109('0x85')]=moment()[_0x4109('0x4d')](_0x4109('0x75'));logger['debug'](_0x4109('0xa7'),_0x181d2e[_0x4109('0x4c')],util[_0x4109('0x42')](_0xa905c3,{'showHidden':![],'depth':null}));ami[_0x4109('0x47')]('custom:timeout',_0xa905c3);break;default:_0xa905c3[_0x4109('0x90')]=!![];_0xa905c3[_0x4109('0x91')]=moment()[_0x4109('0x4d')](_0x4109('0x75'));_0xa905c3[_0x4109('0x85')]=moment()[_0x4109('0x4d')](_0x4109('0x75'));}_0xa905c3[_0x4109('0x1c')]=![];_0xa905c3[_0x4109('0x8d')]=null;_0xa905c3[_0x4109('0x81')]=_0x181d2e[_0x4109('0xa8')];this[_0x4109('0x11')][_0x181d2e[_0x4109('0x4c')]]=_0xa905c3;this['emitVoiceQueueChannelRemove'](_0xa905c3,'varset');}else if(this[_0x4109('0x60')](_0x181d2e[_0x4109('0xa2')])&&this[_0x4109('0x60')](_0x181d2e[_0x4109('0xa2')]['queueposition'])){if(!_0xa905c3[_0x4109('0x1c')]){_0xa905c3[_0x4109('0x90')]=!![];_0xa905c3[_0x4109('0x91')]=moment()[_0x4109('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0xa905c3['queuecallerexitreason']=_0x4109('0xa9');_0xa905c3['queuecallerleaveAt']=moment()[_0x4109('0x4d')](_0x4109('0x75'));this[_0x4109('0x11')][_0x181d2e['uniqueid']]=_0xa905c3;}}logger['info'](_0x4109('0xaa'),_0x181d2e['uniqueid'],_0xa905c3[_0x4109('0x4f')],_0xa905c3[_0x4109('0x54')],_[_0x4109('0xab')](_0x181d2e[_0x4109('0xa2')])[0x0],_0x181d2e[_0x4109('0xa8')]);_0xa905c3[_0x4109('0x16')]=this['variables'][_0x181d2e['uniqueid']];}}}}catch(_0x3e8017){logger[_0x4109('0x43')]('[%s][voiceQueueReport][varset]',_0x181d2e[_0x4109('0x4c')],util['inspect'](_0x3e8017,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4109('0xc')][_0x4109('0xa1')]=function(_0x14e9f9,_0x2d75d7,_0x308ccd){var _0x1e9384=['rtpaudioqos',_0x4109('0xac'),_0x4109('0xad'),_0x4109('0xae'),_0x4109('0xaf'),'rtpaudioqoslossbridged',_0x4109('0xb0'),'rtpaudioqosrttbridged',_0x4109('0xb1'),_0x4109('0xb2'),_0x4109('0xb3'),_0x4109('0xb4'),_0x4109('0xb5'),_0x4109('0xb6'),_0x4109('0xb7'),_0x4109('0xb8'),_0x4109('0x8f'),_0x4109('0xb9'),_0x4109('0xba')];if(!_[_0x4109('0x3c')](_0x2d75d7)&&!_[_0x4109('0xbb')](_0x1e9384,_0x2d75d7)){if(_[_0x4109('0x61')](this['variables'][_0x14e9f9])){this[_0x4109('0x16')][_0x14e9f9]={};}this[_0x4109('0x16')][_0x14e9f9][_0x2d75d7]=_0x308ccd;}};VoiceQueueReport['prototype'][_0x4109('0x25')]=function(_0x1187ed){try{if(this[_0x4109('0x60')](_0x1187ed)){logger[_0x4109('0x49')]('[%s][voiceQueueReport][hangup]',_0x1187ed[_0x4109('0x4c')],util['inspect'](_0x1187ed,{'showHidden':![],'depth':null}));if(this[_0x4109('0xf')][_0x1187ed[_0x4109('0x4c')]]){for(var _0x47b257=0x0,_0xfa9be1={};_0x47b257=0x0?moment(_0x130ebe['endtime'])['diff'](_0x130ebe['starttime'],_0x9019('0x1a')):null,'data1':_0x9019('0x1b'),'data2':_0x130ebe[_0x9019('0x13')],'data3':_0x130ebe['exten'],'data4':_0x130ebe[_0x9019('0x1c')]||null,'role':_0x9019('0x12'),'internal':_0x130ebe['accountcode']?_[_0x9019('0x1d')](_0x130ebe[_0x9019('0x13')]):undefined,'uniqueid':_0x130ebe[_0x9019('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xafad=['calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','Request','membername','starttime','endtime','outbound','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','SIP/%s','interface','TALKING','queuecallerleaveAt','diff'];(function(_0x196f40,_0x417e6e){var _0x544d7b=function(_0x46c19c){while(--_0x46c19c){_0x196f40['push'](_0x196f40['shift']());}};_0x544d7b(++_0x417e6e);}(_0xafad,0x109));var _0xdafa=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xafad[_0x11a220];return _0x20d8fe;};'use strict';var moment=require('moment');var _=require(_0xdafa('0x0'));var util=require(_0xdafa('0x1'));var client=require(_0xdafa('0x2'));exports[_0xdafa('0x3')]=function(_0x492db3){var _0x471fad=_0x492db3[_0xdafa('0x4')]||_0x492db3[_0xdafa('0x5')];return client['Request'](_0xdafa('0x6'),{'body':{'channel':_0xdafa('0x7'),'membername':_0x492db3[_0xdafa('0x8')],'interface':_[_0xdafa('0x9')](_0x492db3['interface'])?util['format'](_0xdafa('0xa'),_0x492db3[_0xdafa('0x8')]):_0x492db3[_0xdafa('0xb')],'type':_0xdafa('0xc'),'enterAt':_0x492db3[_0xdafa('0xd')],'exitAt':_0x471fad,'duration':moment(_0x471fad)[_0xdafa('0xe')](_0x492db3[_0xdafa('0xd')],'seconds'),'data1':'inbound','data2':_0x492db3[_0xdafa('0xf')],'data3':_0x492db3[_0xdafa('0x10')],'data4':null,'data5':_0x492db3[_0xdafa('0x11')],'role':_0xdafa('0x12'),'internal':_0x492db3[_0xdafa('0x13')]?_[_0xdafa('0x14')](_0x492db3[_0xdafa('0x13')]):undefined,'uniqueid':_0x492db3[_0xdafa('0x15')]},'log':_0xdafa('0x6')});};exports['voiceDialReport']=function(_0x59009f){return client[_0xdafa('0x16')]('CreateMemberReport',{'body':{'channel':_0xdafa('0x7'),'membername':_0x59009f[_0xdafa('0x17')],'interface':_0x59009f['interface'],'type':_0xdafa('0xc'),'enterAt':_0x59009f[_0xdafa('0x18')],'exitAt':_0x59009f[_0xdafa('0x19')],'duration':moment(_0x59009f[_0xdafa('0x19')])['diff'](_0x59009f[_0xdafa('0x18')],'seconds')>=0x0?moment(_0x59009f[_0xdafa('0x19')])[_0xdafa('0xe')](_0x59009f[_0xdafa('0x18')],'seconds'):null,'data1':_0xdafa('0x1a'),'data2':_0x59009f[_0xdafa('0x13')],'data3':_0x59009f[_0xdafa('0x10')],'data4':_0x59009f[_0xdafa('0x1b')]||null,'role':_0xdafa('0x12'),'internal':_0x59009f['accountcode']?_[_0xdafa('0x14')](_0x59009f[_0xdafa('0x13')]):undefined,'uniqueid':_0x59009f[_0xdafa('0x15')]},'log':_0xdafa('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f732f8d..945cb33 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90ae=['../client','getSettings','Request','stopRecordingOnTransfer','GetSettings'];(function(_0x54ece6,_0x11a6c6){var _0x2cfd35=function(_0x8163c6){while(--_0x8163c6){_0x54ece6['push'](_0x54ece6['shift']());}};_0x2cfd35(++_0x11a6c6);}(_0x90ae,0x195));var _0xe90a=function(_0x3ee6d7,_0x1e109f){_0x3ee6d7=_0x3ee6d7-0x0;var _0x52f734=_0x90ae[_0x3ee6d7];return _0x52f734;};'use strict';var client=require(_0xe90a('0x0'));exports[_0xe90a('0x1')]=function(){return client[_0xe90a('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe90a('0x3')]},'log':_0xe90a('0x4')});}; \ No newline at end of file +var _0x573e=['getSettings','Request'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x573e,0x134));var _0xe573=function(_0x1eb6ad,_0x179dc1){_0x1eb6ad=_0x1eb6ad-0x0;var _0x5e7864=_0x573e[_0x1eb6ad];return _0x5e7864;};'use strict';var client=require('../client');exports[_0xe573('0x0')]=function(){return client[_0xe573('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index cc6f94e..8fc12be 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 _0x97a0=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x97a0,0x171));var _0x097a=function(_0x17ab92,_0x2247c9){_0x17ab92=_0x17ab92-0x0;var _0x59c75f=_0x97a0[_0x17ab92];return _0x59c75f;};'use strict';var client=require(_0x097a('0x0'));exports[_0x097a('0x1')]=function(_0x3001fe){return function(_0x2de2c2){return client[_0x097a('0x2')](_0x097a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x097a('0x4'),_0x097a('0x5')]},'log':_0x097a('0x3')});};}; \ No newline at end of file +var _0xea5b=['GetTemplate','name','html','../client','getTemplates'];(function(_0x44e880,_0x4ebdb7){var _0x16affb=function(_0x161e76){while(--_0x161e76){_0x44e880['push'](_0x44e880['shift']());}};_0x16affb(++_0x4ebdb7);}(_0xea5b,0x152));var _0xbea5=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xea5b[_0x2112d4];return _0x434972;};'use strict';var client=require(_0xbea5('0x0'));exports[_0xbea5('0x1')]=function(_0x109666){return function(_0x54049b){return client['Request'](_0xbea5('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbea5('0x3'),_0xbea5('0x4')]},'log':_0xbea5('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index fea83ca..6788830 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 _0x2b8b=['Condition','AllConditions','operator','field','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','Request','GetTrigger','name','channel','status'];(function(_0x26866f,_0x500ad9){var _0x12f509=function(_0x49a352){while(--_0x49a352){_0x26866f['push'](_0x26866f['shift']());}};_0x12f509(++_0x500ad9);}(_0x2b8b,0x87));var _0xb2b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b8b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x3dbfc4){return function(_0x39a9b6){return client[_0xb2b8('0x0')](_0xb2b8('0x1'),{'options':{'raw':![],'attributes':['id',_0xb2b8('0x2'),_0xb2b8('0x3'),_0xb2b8('0x4')],'include':[{'model':_0xb2b8('0x5'),'as':_0xb2b8('0x6'),'attributes':['id','field',_0xb2b8('0x7'),'value']},{'model':_0xb2b8('0x5'),'as':'AnyConditions','attributes':['id',_0xb2b8('0x8'),'operator',_0xb2b8('0x9')]},{'model':_0xb2b8('0xa'),'as':_0xb2b8('0xb'),'attributes':['id',_0xb2b8('0xc'),_0xb2b8('0xd'),_0xb2b8('0xe'),_0xb2b8('0xf'),_0xb2b8('0x10'),_0xb2b8('0x11'),_0xb2b8('0x12'),_0xb2b8('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x6b11=['data4','data5','data7','GetTrigger','../client','getTriggers','Request','status','Condition','field','value','AnyConditions','operator','Action','data1','data2','data3'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6b11,0x19c));var _0x16b1=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0x6b11[_0x5302fb];return _0x43e6a4;};'use strict';var client=require(_0x16b1('0x0'));exports[_0x16b1('0x1')]=function(_0x181104){return function(_0x3cad99){return client[_0x16b1('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel',_0x16b1('0x3')],'include':[{'model':_0x16b1('0x4'),'as':'AllConditions','attributes':['id',_0x16b1('0x5'),'operator',_0x16b1('0x6')]},{'model':'Condition','as':_0x16b1('0x7'),'attributes':['id','field',_0x16b1('0x8'),_0x16b1('0x6')]},{'model':_0x16b1('0x9'),'as':'Actions','attributes':['id','action',_0x16b1('0xa'),_0x16b1('0xb'),_0x16b1('0xc'),_0x16b1('0xd'),_0x16b1('0xe'),'data6',_0x16b1('0xf')]}]},'log':_0x16b1('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 223e0cb..71da953 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 _0x2caf=['registry','defaultuser','GetTrunk','name'];(function(_0x53a185,_0x19be68){var _0x14c282=function(_0x218b47){while(--_0x218b47){_0x53a185['push'](_0x53a185['shift']());}};_0x14c282(++_0x19be68);}(_0x2caf,0x6a));var _0xf2ca=function(_0x398a7b,_0x8406d){_0x398a7b=_0x398a7b-0x0;var _0x13fcbe=_0x2caf[_0x398a7b];return _0x13fcbe;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x4a5a44){return function(_0x22932c){return client['Request'](_0xf2ca('0x0'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf2ca('0x1'),_0xf2ca('0x2'),_0xf2ca('0x3')]},'log':_0xf2ca('0x0')});};}; \ No newline at end of file +var _0x6dfa=['Request','name','defaultuser','../client','getTrunks'];(function(_0x4ebf77,_0x27aa53){var _0xa066f6=function(_0x1ffe12){while(--_0x1ffe12){_0x4ebf77['push'](_0x4ebf77['shift']());}};_0xa066f6(++_0x27aa53);}(_0x6dfa,0x7b));var _0xa6df=function(_0x1a542d,_0x2989ef){_0x1a542d=_0x1a542d-0x0;var _0x465ac5=_0x6dfa[_0x1a542d];return _0x465ac5;};'use strict';var client=require(_0xa6df('0x0'));exports[_0xa6df('0x1')]=function(_0x3a2dbb){return function(_0x17a8b4){return client[_0xa6df('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa6df('0x3'),'registry',_0xa6df('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index cd5f41b..fb016be 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x45d06e,_0x3e8515){var _0x30b96a=function(_0x212f08){while(--_0x212f08){_0x45d06e['push'](_0x45d06e['shift']());}};_0x30b96a(++_0x3e8515);}(_0x34e8,0x12c));var _0x834e=function(_0x4b9316,_0x445bcc){_0x4b9316=_0x4b9316-0x0;var _0x54460c=_0x34e8[_0x4b9316];return _0x54460c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3bd0763..b632121 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 _0x5367=['Request','update','UpdateVoiceAgentReport','../client'];(function(_0x4cbebb,_0x1cf93f){var _0x3a655a=function(_0x498c49){while(--_0x498c49){_0x4cbebb['push'](_0x4cbebb['shift']());}};_0x3a655a(++_0x1cf93f);}(_0x5367,0xaf));var _0x7536=function(_0x3ef272,_0x5ee30e){_0x3ef272=_0x3ef272-0x0;var _0x3df1b1=_0x5367[_0x3ef272];return _0x3df1b1;};'use strict';var client=require(_0x7536('0x0'));exports['create']=function(_0x160387){return client[_0x7536('0x1')]('CreateVoiceAgentReport',{'body':_0x160387,'log':'CreateVoiceAgentReport'});};exports[_0x7536('0x2')]=function(_0x14ae57,_0x4f3865,_0x60d51c){return client['Request'](_0x7536('0x3'),{'body':_0x14ae57,'options':{'where':{'uniqueid':_0x4f3865,'interface':_0x60d51c,'agentcomplete':!![]}},'log':_0x7536('0x3')});}; \ No newline at end of file +var _0x90a7=['../client','update','Request','UpdateVoiceAgentReport'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x90a7,0xfc));var _0x790a=function(_0xa20d3d,_0x26685c){_0xa20d3d=_0xa20d3d-0x0;var _0x292aed=_0x90a7[_0xa20d3d];return _0x292aed;};'use strict';var client=require(_0x790a('0x0'));exports['create']=function(_0x3c5d4c){return client['Request']('CreateVoiceAgentReport',{'body':_0x3c5d4c,'log':'CreateVoiceAgentReport'});};exports[_0x790a('0x1')]=function(_0xa4409b,_0x1839c9,_0x391f75){return client[_0x790a('0x2')](_0x790a('0x3'),{'body':_0xa4409b,'options':{'where':{'uniqueid':_0x1839c9,'interface':_0x391f75,'agentcomplete':!![]}},'log':_0x790a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a5f49e5..da8b15f 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 _0x3aac=['endOf','day','format','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b9793,_0x2238a8){var _0x3ba0da=function(_0x468af7){while(--_0x468af7){_0x5b9793['push'](_0x5b9793['shift']());}};_0x3ba0da(++_0x2238a8);}(_0x3aac,0x10f));var _0xc3aa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3aac[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xc3aa('0x0'));var util=require(_0xc3aa('0x1'));var _=require(_0xc3aa('0x2'));var client=require(_0xc3aa('0x3'));exports['create']=function(_0x4a4cf6){return client[_0xc3aa('0x4')](_0xc3aa('0x5'),{'body':_[_0xc3aa('0x6')](_0x4a4cf6,{'source':_0x4a4cf6[_0xc3aa('0x7')],'destinationcontext':_0x4a4cf6['context'],'callerid':_0x4a4cf6[_0xc3aa('0x8')],'amaflags':_0xc3aa('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xc3aa('0xa')]=function(){return function(){return client[_0xc3aa('0x4')](_0xc3aa('0xb'),{'options':{'where':{'type':[_0xc3aa('0xc')],'createdAt':{'$between':[moment()[_0xc3aa('0xd')]('day')['format'](_0xc3aa('0xe')),moment()[_0xc3aa('0xf')](_0xc3aa('0x10'))[_0xc3aa('0x11')](_0xc3aa('0xe'))]}},'attributes':[_0xc3aa('0x12'),'disposition',_0xc3aa('0x13'),_0xc3aa('0x14')]},'log':_0xc3aa('0x15')});};}; \ No newline at end of file +var _0x3c17=['startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','getVoiceCallReports','Request','GetVoiceCallReport','outbound'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3c17,0x16f));var _0x73c1=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x3c17[_0x4bb66f];return _0xf2772f;};'use strict';var moment=require('moment');var util=require(_0x73c1('0x0'));var _=require(_0x73c1('0x1'));var client=require(_0x73c1('0x2'));exports['create']=function(_0x2021e8){return client['Request'](_0x73c1('0x3'),{'body':_[_0x73c1('0x4')](_0x2021e8,{'source':_0x2021e8[_0x73c1('0x5')],'destinationcontext':_0x2021e8[_0x73c1('0x6')],'callerid':_0x2021e8['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x73c1('0x3')});};exports[_0x73c1('0x7')]=function(){return function(){return client[_0x73c1('0x8')](_0x73c1('0x9'),{'options':{'where':{'type':[_0x73c1('0xa')],'createdAt':{'$between':[moment()[_0x73c1('0xb')](_0x73c1('0xc'))['format'](_0x73c1('0xd')),moment()[_0x73c1('0xe')](_0x73c1('0xc'))['format'](_0x73c1('0xd'))]}},'attributes':['type',_0x73c1('0xf'),_0x73c1('0x10'),_0x73c1('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 06425ae..dcd20f2 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 _0x94a0=['Request','CreateVoiceDialReport','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94a0,0x1c1));var _0x094a=function(_0x111c17,_0x275184){_0x111c17=_0x111c17-0x0;var _0x5ff50a=_0x94a0[_0x111c17];return _0x5ff50a;};'use strict';var client=require('../client');exports[_0x094a('0x0')]=function(_0x6af803){return client[_0x094a('0x1')](_0x094a('0x2'),{'body':_0x6af803,'log':_0x094a('0x2')});}; \ No newline at end of file +var _0xdfdb=['CreateVoiceDialReport','../client','create','Request'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0xdfdb,0x189));var _0xbdfd=function(_0x241b92,_0x1526dd){_0x241b92=_0x241b92-0x0;var _0x575bb4=_0xdfdb[_0x241b92];return _0x575bb4;};'use strict';var client=require(_0xbdfd('0x0'));exports[_0xbdfd('0x1')]=function(_0x17c484){return client[_0xbdfd('0x2')](_0xbdfd('0x3'),{'body':_0x17c484,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c83be11..70e8165 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 _0xae2b=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae2b,0xb3));var _0xbae2=function(_0x4c6f91,_0x9519a4){_0x4c6f91=_0x4c6f91-0x0;var _0x2ff3d5=_0xae2b[_0x4c6f91];return _0x2ff3d5;};'use strict';var client=require(_0xbae2('0x0'));exports[_0xbae2('0x1')]=function(){return function(){return client['Request'](_0xbae2('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbae2('0x3'),_0xbae2('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xbae2('0x1')});};}; \ No newline at end of file +var _0xc874=['../client','Request','GetVoiceExtension','getVoiceExtensions'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xc874,0x154));var _0x4c87=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xc874[_0x4dcc2d];return _0x1bbd79;};'use strict';var client=require(_0x4c87('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x4c87('0x1')](_0x4c87('0x2'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4c87('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 2b2d024..478f5ad 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 _0xd495=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','TrunkBackup','name','Interval','Intervals','interval','../client','GetVoiceQueue','acw','acwTimeout','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x3004d3,_0x4b0e8b){var _0x31da4f=function(_0x5e7e5){while(--_0x5e7e5){_0x3004d3['push'](_0x3004d3['shift']());}};_0x31da4f(++_0x4b0e8b);}(_0xd495,0x14a));var _0x5d49=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0xd495[_0x347471];return _0x422b6a;};'use strict';var client=require(_0x5d49('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x5d49('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x5d49('0x2'),_0x5d49('0x3'),'autopause','monitor_format',_0x5d49('0x4'),'dialActive',_0x5d49('0x5'),_0x5d49('0x6'),_0x5d49('0x7'),_0x5d49('0x8'),_0x5d49('0x9'),_0x5d49('0xa'),_0x5d49('0xb'),_0x5d49('0xc'),'dialOriginateCallerIdNumber',_0x5d49('0xd'),_0x5d49('0xe'),_0x5d49('0xf'),_0x5d49('0x10'),_0x5d49('0x11'),_0x5d49('0x12'),_0x5d49('0x13'),_0x5d49('0x14'),_0x5d49('0x15'),_0x5d49('0x16'),_0x5d49('0x17'),_0x5d49('0x18'),'dialGlobalInterval',_0x5d49('0x19'),_0x5d49('0x1a'),_0x5d49('0x1b'),_0x5d49('0x1c'),_0x5d49('0x1d'),'dialAMDAfterGreetingSilence',_0x5d49('0x1e'),_0x5d49('0x1f'),_0x5d49('0x20'),_0x5d49('0x21'),_0x5d49('0x22'),_0x5d49('0x23'),_0x5d49('0x24'),_0x5d49('0x25'),_0x5d49('0x26'),_0x5d49('0x27'),_0x5d49('0x28'),_0x5d49('0x29'),_0x5d49('0x2a'),_0x5d49('0x2b'),_0x5d49('0x2c'),_0x5d49('0x2d'),'dialCutDigit',_0x5d49('0x2e'),_0x5d49('0x2f'),_0x5d49('0x30'),_0x5d49('0x31'),_0x5d49('0x32'),_0x5d49('0x33'),_0x5d49('0x34'),_0x5d49('0x35'),_0x5d49('0x36'),_0x5d49('0x37'),_0x5d49('0x38'),_0x5d49('0x39'),_0x5d49('0x3a')],'include':[{'model':_0x5d49('0x3b'),'as':_0x5d49('0x3b'),'attributes':['id','name',_0x5d49('0x3c'),_0x5d49('0x3d')]},{'model':_0x5d49('0x3e'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x5d49('0x3b'),'as':_0x5d49('0x3f'),'attributes':['id',_0x5d49('0x40'),_0x5d49('0x3c'),'active']},{'model':_0x5d49('0x41'),'as':_0x5d49('0x41'),'attributes':['id','name'],'include':[{'model':_0x5d49('0x41'),'as':_0x5d49('0x42'),'attributes':['id',_0x5d49('0x40'),_0x5d49('0x43')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xbc61=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x32c779,_0x452bb8){var _0x2d6d6e=function(_0xe9cd99){while(--_0xe9cd99){_0x32c779['push'](_0x32c779['shift']());}};_0x2d6d6e(++_0x452bb8);}(_0xbc61,0x146));var _0x1bc6=function(_0x1a70b1,_0x323afd){_0x1a70b1=_0x1a70b1-0x0;var _0x1f7973=_0xbc61[_0x1a70b1];return _0x1f7973;};'use strict';var client=require(_0x1bc6('0x0'));exports[_0x1bc6('0x1')]=function(){return function(){return client[_0x1bc6('0x2')](_0x1bc6('0x3'),{'options':{'raw':![],'attributes':['id',_0x1bc6('0x4'),'acw',_0x1bc6('0x5'),_0x1bc6('0x6'),_0x1bc6('0x7'),'type',_0x1bc6('0x8'),_0x1bc6('0x9'),_0x1bc6('0xa'),_0x1bc6('0xb'),_0x1bc6('0xc'),_0x1bc6('0xd'),_0x1bc6('0xe'),_0x1bc6('0xf'),_0x1bc6('0x10'),_0x1bc6('0x11'),_0x1bc6('0x12'),_0x1bc6('0x13'),'dialQueueTimeout','dialQueueProject',_0x1bc6('0x14'),'dialCongestionRetryFrequency',_0x1bc6('0x15'),_0x1bc6('0x16'),_0x1bc6('0x17'),_0x1bc6('0x18'),_0x1bc6('0x19'),'dialTimezone',_0x1bc6('0x1a'),_0x1bc6('0x1b'),_0x1bc6('0x1c'),_0x1bc6('0x1d'),_0x1bc6('0x1e'),'dialAMDGreeting',_0x1bc6('0x1f'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x1bc6('0x20'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x1bc6('0x21'),_0x1bc6('0x22'),_0x1bc6('0x23'),_0x1bc6('0x24'),_0x1bc6('0x25'),_0x1bc6('0x26'),'dialAgiAfterHangupClient',_0x1bc6('0x27'),_0x1bc6('0x7'),'strategy',_0x1bc6('0x28'),_0x1bc6('0x29'),_0x1bc6('0x2a'),_0x1bc6('0x2b'),_0x1bc6('0x2c'),'dialDropRetryFrequency',_0x1bc6('0x2d'),_0x1bc6('0x2e'),_0x1bc6('0x2f'),_0x1bc6('0x30'),'dialAgentRejectMaxRetry',_0x1bc6('0x31'),'mandatoryDisposition',_0x1bc6('0x32'),_0x1bc6('0x33')],'include':[{'model':_0x1bc6('0x34'),'as':_0x1bc6('0x34'),'attributes':['id',_0x1bc6('0x4'),'callerid',_0x1bc6('0x35')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x1bc6('0x4')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x1bc6('0x4'),'callerid','active']},{'model':_0x1bc6('0x36'),'as':_0x1bc6('0x36'),'attributes':['id',_0x1bc6('0x4')],'include':[{'model':_0x1bc6('0x36'),'as':_0x1bc6('0x37'),'attributes':['id',_0x1bc6('0x4'),_0x1bc6('0x38')]}]}]},'log':_0x1bc6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f43011c..f26a402 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x311ff2,_0x4cea19){var _0x343d16=function(_0x165a31){while(--_0x165a31){_0x311ff2['push'](_0x311ff2['shift']());}};_0x343d16(++_0x4cea19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x551124,_0x3cbf7a){var _0xc5889b=function(_0x1509a7){while(--_0x1509a7){_0x551124['push'](_0x551124['shift']());}};_0xc5889b(++_0x3cbf7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index eed8647..e265ae4 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 _0x0924=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3adfce,_0x346df4){var _0x557153=function(_0x5cd1fc){while(--_0x5cd1fc){_0x3adfce['push'](_0x3adfce['shift']());}};_0x557153(++_0x346df4);}(_0x0924,0xf6));var _0x4092=function(_0x100dcb,_0x2cfcdf){_0x100dcb=_0x100dcb-0x0;var _0x690bf=_0x0924[_0x100dcb];return _0x690bf;};'use strict';var client=require(_0x4092('0x0'));exports[_0x4092('0x1')]=function(_0x235a08){return function(){return client[_0x4092('0x2')](_0x4092('0x3'),{'options':{'where':{'VoiceQueueId':_0x235a08,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x8eae=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client','Request'];(function(_0x2e88c8,_0x58f49d){var _0x5dcf78=function(_0x5d5292){while(--_0x5d5292){_0x2e88c8['push'](_0x2e88c8['shift']());}};_0x5dcf78(++_0x58f49d);}(_0x8eae,0x126));var _0xe8ea=function(_0xfa73ac,_0x2a7395){_0xfa73ac=_0xfa73ac-0x0;var _0x4e8e14=_0x8eae[_0xfa73ac];return _0x4e8e14;};'use strict';var client=require(_0xe8ea('0x0'));exports['getVoiceQueueRtPauses']=function(_0x3cf0db){return function(){return client[_0xe8ea('0x1')](_0xe8ea('0x2'),{'options':{'where':{'VoiceQueueId':_0x3cf0db,'paused':!![]},'raw':!![]},'log':_0xe8ea('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ba021e4..d146cb4 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4ab740,_0x560001){var _0x14dd9d=function(_0x263845){while(--_0x263845){_0x4ab740['push'](_0x4ab740['shift']());}};_0x14dd9d(++_0x560001);}(_0x7a54,0x106));var _0x47a5=function(_0x293d10,_0x3d4983){_0x293d10=_0x293d10-0x0;var _0x1a7937=_0x7a54[_0x293d10];return _0x1a7937;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x11e011,_0x54f0da){var _0x30ef81=function(_0x505816){while(--_0x505816){_0x11e011['push'](_0x11e011['shift']());}};_0x30ef81(++_0x54f0da);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8755,_0x88f691){_0x5a8755=_0x5a8755-0x0;var _0x37004c=_0x7a54[_0x5a8755];return _0x37004c;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index e87c033..1c8ace1 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 _0xec09=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','origtransferercontext','attended','transfers','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x59680b,_0x60f01){var _0x22e31f=function(_0x32757a){while(--_0x32757a){_0x59680b['push'](_0x59680b['shift']());}};_0x22e31f(++_0x60f01);}(_0xec09,0x19e));var _0x9ec0=function(_0x35f8dd,_0x3797ac){_0x35f8dd=_0x35f8dd-0x0;var _0x1be4f2=_0xec09[_0x35f8dd];return _0x1be4f2;};'use strict';var client=require('../client');exports[_0x9ec0('0x0')]={};exports[_0x9ec0('0x1')]=function(_0x5f379a){return client['Request'](_0x9ec0('0x2'),{'body':{'result':_0x5f379a[_0x9ec0('0x3')],'transfererchannel':_0x5f379a['transfererchannel'],'transferercalleridnum':_0x5f379a[_0x9ec0('0x4')],'transferercalleridname':_0x5f379a[_0x9ec0('0x5')],'transfererconnectedlinenum':_0x5f379a['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5f379a[_0x9ec0('0x6')],'transfereraccountcode':_0x5f379a[_0x9ec0('0x7')],'transferercontext':_0x5f379a[_0x9ec0('0x8')],'transfererexten':_0x5f379a[_0x9ec0('0x9')],'transfererlinkedid':_0x5f379a[_0x9ec0('0xa')],'transfereechannel':_0x5f379a[_0x9ec0('0xb')],'transfereecalleridnum':_0x5f379a[_0x9ec0('0xc')],'transfereecalleridname':_0x5f379a[_0x9ec0('0xd')],'transfereeconnectedlinenum':_0x5f379a[_0x9ec0('0xe')],'transfereeconnectedlinename':_0x5f379a['transfereeconnectedlinename'],'transfereeaccountcode':_0x5f379a[_0x9ec0('0xf')],'transfereecontext':_0x5f379a[_0x9ec0('0x10')],'transfereeexten':_0x5f379a[_0x9ec0('0x11')],'transfereelinkedid':_0x5f379a['transfereelinkedid'],'isexternal':_0x5f379a[_0x9ec0('0x12')],'context':_0x5f379a['context'],'extension':_0x5f379a[_0x9ec0('0x13')],'type':_0x9ec0('0x14')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3ffc76){return client[_0x9ec0('0x15')](_0x9ec0('0x2'),{'body':{'result':_0x3ffc76['result'],'transfererchannel':_0x3ffc76[_0x9ec0('0x16')],'transferercalleridnum':_0x3ffc76['origtransferercalleridnum'],'transferercalleridname':_0x3ffc76[_0x9ec0('0x17')],'transfererconnectedlinenum':_0x3ffc76[_0x9ec0('0x18')],'transfererconnectedlinename':_0x3ffc76[_0x9ec0('0x19')],'transfereraccountcode':_0x3ffc76[_0x9ec0('0x1a')],'transferercontext':_0x3ffc76[_0x9ec0('0x1b')],'transfererexten':_0x3ffc76[_0x9ec0('0x1c')],'transfererlinkedid':_0x3ffc76[_0x9ec0('0x1d')],'transfereechannel':_0x3ffc76[_0x9ec0('0x1e')],'transfereecalleridnum':_0x3ffc76[_0x9ec0('0x1f')],'transfereecalleridname':_0x3ffc76[_0x9ec0('0x20')],'transfereeconnectedlinenum':_0x3ffc76[_0x9ec0('0x21')],'transfereeconnectedlinename':_0x3ffc76[_0x9ec0('0x22')],'transfereeaccountcode':_0x3ffc76['transfertargetaccountcode'],'transfereecontext':_0x3ffc76['transfertargetcontext'],'transfereeexten':_0x3ffc76['transfertargetexten'],'transfereelinkedid':_0x3ffc76['transfertargetlinkedid'],'isexternal':_0x3ffc76[_0x9ec0('0x12')],'context':_0x3ffc76[_0x9ec0('0x23')],'extension':_0x3ffc76['origtransfererexten'],'type':_0x9ec0('0x24')},'log':_0x9ec0('0x2')});}; \ No newline at end of file +var _0x428c=['transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x1e4e5b,_0x488ce8){var _0x192474=function(_0x39cb8f){while(--_0x39cb8f){_0x1e4e5b['push'](_0x1e4e5b['shift']());}};_0x192474(++_0x488ce8);}(_0x428c,0x13e));var _0xc428=function(_0x63cded,_0x2499fa){_0x63cded=_0x63cded-0x0;var _0x238d8a=_0x428c[_0x63cded];return _0x238d8a;};'use strict';var client=require(_0xc428('0x0'));exports[_0xc428('0x1')]={};exports[_0xc428('0x2')]=function(_0x58310f){return client[_0xc428('0x3')](_0xc428('0x4'),{'body':{'result':_0x58310f['result'],'transfererchannel':_0x58310f[_0xc428('0x5')],'transferercalleridnum':_0x58310f[_0xc428('0x6')],'transferercalleridname':_0x58310f[_0xc428('0x7')],'transfererconnectedlinenum':_0x58310f[_0xc428('0x8')],'transfererconnectedlinename':_0x58310f[_0xc428('0x9')],'transfereraccountcode':_0x58310f[_0xc428('0xa')],'transferercontext':_0x58310f[_0xc428('0xb')],'transfererexten':_0x58310f['transfererexten'],'transfererlinkedid':_0x58310f[_0xc428('0xc')],'transfereechannel':_0x58310f['transfereechannel'],'transfereecalleridnum':_0x58310f[_0xc428('0xd')],'transfereecalleridname':_0x58310f[_0xc428('0xe')],'transfereeconnectedlinenum':_0x58310f[_0xc428('0xf')],'transfereeconnectedlinename':_0x58310f[_0xc428('0x10')],'transfereeaccountcode':_0x58310f[_0xc428('0x11')],'transfereecontext':_0x58310f['transfereecontext'],'transfereeexten':_0x58310f['transfereeexten'],'transfereelinkedid':_0x58310f['transfereelinkedid'],'isexternal':_0x58310f['isexternal'],'context':_0x58310f[_0xc428('0x12')],'extension':_0x58310f[_0xc428('0x13')],'type':_0xc428('0x14')},'log':_0xc428('0x4')});};exports[_0xc428('0x15')]=function(_0x4fe071){return client[_0xc428('0x3')](_0xc428('0x4'),{'body':{'result':_0x4fe071[_0xc428('0x16')],'transfererchannel':_0x4fe071[_0xc428('0x17')],'transferercalleridnum':_0x4fe071[_0xc428('0x18')],'transferercalleridname':_0x4fe071[_0xc428('0x19')],'transfererconnectedlinenum':_0x4fe071[_0xc428('0x1a')],'transfererconnectedlinename':_0x4fe071[_0xc428('0x1b')],'transfereraccountcode':_0x4fe071[_0xc428('0x1c')],'transferercontext':_0x4fe071['secondtransferercontext'],'transfererexten':_0x4fe071[_0xc428('0x1d')],'transfererlinkedid':_0x4fe071[_0xc428('0x1e')],'transfereechannel':_0x4fe071[_0xc428('0x1f')],'transfereecalleridnum':_0x4fe071[_0xc428('0x20')],'transfereecalleridname':_0x4fe071['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4fe071[_0xc428('0x21')],'transfereeconnectedlinename':_0x4fe071[_0xc428('0x22')],'transfereeaccountcode':_0x4fe071[_0xc428('0x23')],'transfereecontext':_0x4fe071[_0xc428('0x24')],'transfereeexten':_0x4fe071['transfertargetexten'],'transfereelinkedid':_0x4fe071[_0xc428('0x25')],'isexternal':_0x4fe071[_0xc428('0x26')],'context':_0x4fe071[_0xc428('0x27')],'extension':_0x4fe071['origtransfererexten'],'type':_0xc428('0x28')},'log':_0xc428('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6195eff..802af0f 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 _0xd9fb=['sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','omit','values','channels','length','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','%s/%s','SIP','name','timers','timer','updateStatusRealtime','QueuePause','error','asterisk','username','join','pick','keys','module','action','Reload','Action','message','isConnected','ami\x20disconnected','command','Command','then','content','catch','voiceQueues','strategy','loggedIn','pTalking','sumBillable'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd9fb,0x189));var _0xbd9f=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xd9fb[_0x34bf97];return _0x292719;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var jayson=require(_0xbd9f('0x2'));var schema=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var config=require(_0xbd9f('0x6'));var properties=require('../properties');var ami=require(_0xbd9f('0x7'));exports[_0xbd9f('0x8')]=function(_0x4ce2e2,_0x469446,_0x5b6052){return new BPromise(function(_0x2e7eea,_0x43a5a2){var _0x5e2143={'QueuePause':function(_0x30f0ae){return new Promise(function(_0x16f086,_0x3dbc8e){var _0x2196a6=util['format'](_0xbd9f('0x9'),_0xbd9f('0xa'),_0x30f0ae[_0xbd9f('0xb')]);if(_0x4ce2e2[_0xbd9f('0xc')]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6][_0xbd9f('0xd')]){_0x4ce2e2['timers'][_0x2196a6]['updateAcw']();}if(_0x4ce2e2['agents'][_0x2196a6]){_0x4ce2e2['agents'][_0x2196a6][_0xbd9f('0xe')]({'statePause':_0x30f0ae['pause']?!![]:![]});}_0x16f086({'code':0xc8,'message':_0xbd9f('0xf')});});},'Reload':function(_0x44672c){var _0x3030f5=this;return new Promise(function(_0x530513,_0x1430fc){if(ami['isConnected']()==![]){return _0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],'ami\x20disconnected'][_0xbd9f('0x13')]('\x20')));}_0x44672c=_[_0xbd9f('0x14')](_0x44672c,_[_0xbd9f('0x15')](properties[_0xbd9f('0x16')]));_0x44672c[_0xbd9f('0x17')]=_0xbd9f('0x18');return ami[_0xbd9f('0x19')](_0x44672c)['then'](function(_0x49a818){_0x530513({'code':0xc8,'message':_0x49a818[_0xbd9f('0x1a')]});})['catch'](function(_0x2f52dd){_0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f5,_0x2f52dd[_0xbd9f('0x1a')]));});});},'Command':function(_0x1a42a0){var _0x2c276b=this;return new Promise(function(_0x381f68,_0x3f6c17){if(ami[_0xbd9f('0x1b')]()==![]){return _0x3f6c17(_0x2c276b['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}_0x1a42a0=_[_0xbd9f('0x14')](_0x1a42a0,_0xbd9f('0x1d'));_0x1a42a0[_0xbd9f('0x17')]=_0xbd9f('0x1e');return ami[_0xbd9f('0x19')](_0x1a42a0)[_0xbd9f('0x1f')](function(_0x4e929d){_0x381f68({'code':0xc8,'message':_0x4e929d[_0xbd9f('0x20')]});})[_0xbd9f('0x21')](function(_0x256aec){_0x3f6c17(_0x2c276b[_0xbd9f('0x10')](0x1f5,_0x256aec['message']));});});},'VoiceQueues':function(_0x3e0ba5){return new Promise(function(_0x2eca22,_0x278a10){var _0x36f503=[];for(var _0x46fcc0 in _0x4ce2e2[_0xbd9f('0x22')]){if(_0x4ce2e2[_0xbd9f('0x22')]['hasOwnProperty'](_0x46fcc0)){var _0xd89fc2=_0x4ce2e2[_0xbd9f('0x22')][_0x46fcc0];var _0xa46ce3={'id':_0xd89fc2['id'],'name':_0xd89fc2[_0xbd9f('0xb')],'strategy':_0xd89fc2[_0xbd9f('0x23')],'answered':_0xd89fc2['answered'],'available':_0xd89fc2['available'],'loggedIn':_0xd89fc2[_0xbd9f('0x24')],'pTalking':_0xd89fc2[_0xbd9f('0x25')],'sumBillable':_0xd89fc2[_0xbd9f('0x26')],'sumDuration':_0xd89fc2['sumDuration'],'sumHoldTime':_0xd89fc2[_0xbd9f('0x27')]||0x0,'talking':_0xd89fc2[_0xbd9f('0x28')],'total':_0xd89fc2[_0xbd9f('0x29')],'type':_0xd89fc2['type'],'unmanaged':_0xd89fc2[_0xbd9f('0x2a')],'abandoned':_0xd89fc2[_0xbd9f('0x2b')],'waiting':_0xd89fc2[_0xbd9f('0x2c')],'loggedInDb':_0xd89fc2[_0xbd9f('0x2d')]};if(_0xd89fc2[_0xbd9f('0x2e')]===_0xbd9f('0x2f')){_0xa46ce3[_0xbd9f('0x30')]=_0xd89fc2['dialActive'];_0xa46ce3['dialMethod']=_0xd89fc2[_0xbd9f('0x31')];_0xa46ce3[_0xbd9f('0x32')]=_0xd89fc2[_0xbd9f('0x32')];_0xa46ce3[_0xbd9f('0x33')]=_0xd89fc2[_0xbd9f('0x33')];_0xa46ce3[_0xbd9f('0x34')]=_0xd89fc2[_0xbd9f('0x34')];_0xa46ce3[_0xbd9f('0x35')]=_0xd89fc2[_0xbd9f('0x35')];_0xa46ce3['temp']=_0xd89fc2['temp'];_0xa46ce3[_0xbd9f('0x36')]=_0xd89fc2['outboundAnswerAgiCallsDay'];_0xa46ce3['outboundAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x37')];_0xa46ce3[_0xbd9f('0x38')]=_0xd89fc2[_0xbd9f('0x38')];_0xa46ce3[_0xbd9f('0x39')]=_0xd89fc2[_0xbd9f('0x39')];_0xa46ce3[_0xbd9f('0x3a')]=_0xd89fc2[_0xbd9f('0x3a')];_0xa46ce3[_0xbd9f('0x3b')]=_0xd89fc2['outboundDropCallsDayACS'];_0xa46ce3[_0xbd9f('0x3c')]=_0xd89fc2[_0xbd9f('0x3c')];_0xa46ce3[_0xbd9f('0x3d')]=_0xd89fc2['outboundDropCallsDayTimeout'];_0xa46ce3['outboundNoAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x3e')];_0xa46ce3[_0xbd9f('0x3f')]=_0xd89fc2['outboundNoSuchCallsDay'];_0xa46ce3[_0xbd9f('0x40')]=_0xd89fc2['outboundOriginateFailureCallsDay'];_0xa46ce3[_0xbd9f('0x41')]=_0xd89fc2[_0xbd9f('0x41')];_0xa46ce3[_0xbd9f('0x42')]=_0xd89fc2[_0xbd9f('0x42')];_0xa46ce3[_0xbd9f('0x43')]=_0xd89fc2['outboundUnknownCallsDay'];_0xa46ce3[_0xbd9f('0x44')]=_0xd89fc2[_0xbd9f('0x44')];_0xa46ce3['predictiveIntervalAvgHoldtime']=_0xd89fc2[_0xbd9f('0x45')];_0xa46ce3[_0xbd9f('0x46')]=_0xd89fc2[_0xbd9f('0x46')];_0xa46ce3[_0xbd9f('0x47')]=_0xd89fc2['predictiveIntervalDroppedCallsCallersExit'];_0xa46ce3[_0xbd9f('0x48')]=_0xd89fc2[_0xbd9f('0x48')];_0xa46ce3[_0xbd9f('0x49')]=_0xd89fc2[_0xbd9f('0x49')];_0xa46ce3['predictiveIntervalErlangCallsDroppedCalls']=_0xd89fc2[_0xbd9f('0x4a')];_0xa46ce3[_0xbd9f('0x4b')]=_0xd89fc2[_0xbd9f('0x4b')];_0xa46ce3[_0xbd9f('0x4c')]=_0xd89fc2['predictiveIntervalMultiplicativeFactor'];_0xa46ce3['predictiveIntervalPauses']=_0xd89fc2[_0xbd9f('0x4d')];_0xa46ce3[_0xbd9f('0x4e')]=_0xd89fc2['predictiveIntervalAvailable'];_0xa46ce3[_0xbd9f('0x4f')]=_0xd89fc2['predictiveIntervalTotalCalls'];_0xa46ce3[_0xbd9f('0x1a')]=_0xd89fc2['message'];_0xa46ce3[_0xbd9f('0x50')]=_0xd89fc2[_0xbd9f('0x50')];_0xa46ce3['erlangCalls']=_0xd89fc2['erlangCalls'];_0xa46ce3['erlangCallToSecond']=_0xd89fc2[_0xbd9f('0x51')];_0xa46ce3[_0xbd9f('0x52')]=_0xd89fc2['erlangAbandonmentRate'];_0xa46ce3['erlangBusyFactor']=_0xd89fc2[_0xbd9f('0x53')];_0xa46ce3[_0xbd9f('0x54')]=_0xd89fc2[_0xbd9f('0x54')];_0xa46ce3[_0xbd9f('0x55')]=_0xd89fc2['startProgressive'];}if(_0xd89fc2[_0xbd9f('0x56')]){_0xa46ce3[_0xbd9f('0x56')]={'id':_0xd89fc2[_0xbd9f('0x56')]['id'],'name':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0xb')],'active':_0xd89fc2['Trunk'][_0xbd9f('0x57')],'callerid':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0x58')]};}if(_0xd89fc2[_0xbd9f('0x59')]){_0xa46ce3['Interval']={'id':_0xd89fc2[_0xbd9f('0x59')]['id'],'name':_0xd89fc2[_0xbd9f('0x59')][_0xbd9f('0xb')]};}_0x36f503['push'](_0xa46ce3);}}_0x2eca22({'count':_0x36f503['length'],'rows':_0x36f503});});},'UpdateVoiceQueue':function(_0xba219a){return new Promise(function(_0x387a7c,_0xd5d97b){var _0x175601=_['find'](_0x4ce2e2[_0xbd9f('0x22')],{'id':parseInt(_0xba219a['id'])});var _0x174125=_[_0xbd9f('0x5a')](_0xba219a,['id']);if(_0x175601){for(var _0x254075 in _0x174125){if(typeof _0x174125[_0x254075]!=='undefined'&&typeof _0x175601[_0x254075]!=='undefined'){_0x175601[_0x254075]=_0x174125[_0x254075];}}_0x387a7c(_0x175601);}else{_0xd5d97b();}});},'VoiceChannels':function(_0x525ca3){return new Promise(function(_0x23f7b2,_0x11e5d3){var _0x585065=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x5c')]);_0x23f7b2({'count':_0x585065[_0xbd9f('0x5d')],'rows':_0x585065});});},'VoiceChannelMixMonitor':function(_0x45bf27){var _0x141eaf=this;return new Promise(function(_0xbeca49,_0x157177){if(ami[_0xbd9f('0x1b')]()==![]){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x31d6dc=schema(properties['voicechannel'])[_0xbd9f('0x3')](_0x45bf27);if(_0x31d6dc['length']>0x0){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x31d6dc,'message')['join'](',\x20')));}var _0x3334c6=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x45bf27[_0xbd9f('0x60')]});if(_0x3334c6&&_0x3334c6[_0xbd9f('0x61')]){var _0x786cdf=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x45bf27[_0xbd9f('0x64')]||_0x45bf27[_0xbd9f('0x60')],_0x45bf27['format']||_0xbd9f('0x65'));return ami['Action']({'action':_0xbd9f('0x66'),'channel':_0x3334c6[_0xbd9f('0x61')],'file':_0x786cdf,'options':_0xbd9f('0x67')})[_0xbd9f('0x1f')](function(_0x1b9ca7){var _0x58fe5f=_[_0xbd9f('0x5f')](_0x3334c6[_0xbd9f('0x68')],{'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')]()});if(_[_0xbd9f('0x6b')](_0x58fe5f)){_0x3334c6[_0xbd9f('0x68')][_0xbd9f('0x6c')]({'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')](),'createdAt':moment()[_0xbd9f('0x62')](_0xbd9f('0x6d')),'mixmonitorid':_0x1b9ca7[_0xbd9f('0x6e')],'status':_0xbd9f('0x6f')});}else{_0x58fe5f[_0xbd9f('0x6e')]=_0x1b9ca7[_0xbd9f('0x6e')];_0x58fe5f[_0xbd9f('0x70')]=_0xbd9f('0x6f');}_0xbeca49({'code':0xc8,'message':[_0x45bf27[_0xbd9f('0x60')],_0xbd9f('0x71'),_0x1b9ca7[_0xbd9f('0x6e')]]['join']('\x20'),'mixmonitorid':_0x1b9ca7['mixmonitorid']});})[_0xbd9f('0x21')](function(_0x7d17f3){_0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,[_0x45bf27['uniqueid'],_0x7d17f3['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x36806a){var _0x23c56c=this;return new Promise(function(_0x55341e,_0xecee10){if(ami['isConnected']()==![]){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x29e082=schema(properties[_0xbd9f('0x72')])[_0xbd9f('0x3')](_0x36806a);if(_0x29e082[_0xbd9f('0x5d')]>0x0){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x29e082,'message')['join'](',\x20')));}var _0x59423b=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x36806a[_0xbd9f('0x60')]});if(_0x59423b){return BPromise[_0xbd9f('0x73')]()[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x74'),'channel':_0x59423b['channel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x552ada){});}})[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x75')]){return ami[_0xbd9f('0x19')]({'action':'StopMixMonitor','channel':_0x59423b['destinationchannel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x2cb9d9){});}})[_0xbd9f('0x1f')](function(_0x2db02a){var _0x1725f1=_[_0xbd9f('0x5f')](_0x59423b[_0xbd9f('0x68')],{'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]});if(_0x1725f1){_0x1725f1['status']=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){var _0x27f25d=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x36806a[_0xbd9f('0x64')]||_0x36806a[_0xbd9f('0x60')],_0x36806a[_0xbd9f('0x62')]||_0xbd9f('0x65'));var _0x42b6af=_[_0xbd9f('0x5f')](_0x59423b['monitors'],{'filename':_0xbd9f('0x69')+_0x27f25d[_0xbd9f('0x6a')]()});if(_0x42b6af){_0x42b6af[_0xbd9f('0x70')]=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){_0x55341e({'code':0xc8,'message':[_0x36806a[_0xbd9f('0x60')],_0xbd9f('0x77')][_0xbd9f('0x13')]('\x20')});})[_0xbd9f('0x21')](function(_0x5add9c){_0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,[_0x36806a[_0xbd9f('0x60')],_0x5add9c['message'][_0xbd9f('0x6a')]()]['join']('\x20')));});}else{return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannels':function(_0x197b9d){return new Promise(function(_0x5162bf,_0x599a3a){var _0x48f037=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x79')]);_0x5162bf({'count':_0x48f037[_0xbd9f('0x5d')],'rows':_0x48f037});});},'VoiceQueuesChannel':function(_0x1600f9){var _0x35d96f=this;return new Promise(function(_0x5e1db0,_0x236a33){var _0x3f14e3=schema(properties['voicequeuechannel'])[_0xbd9f('0x3')](_0x1600f9);if(_0x3f14e3[_0xbd9f('0x5d')]>0x0){return _0x236a33(_0x35d96f[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x3f14e3,'message')[_0xbd9f('0x13')](',\x20')));}var _0x2f55c6=_['find'](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x1600f9['uniqueid']});if(_0x2f55c6){_0x5e1db0(_0x2f55c6);}else{return _0x236a33(_0x35d96f['error'](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x444792){var _0x164569=this;return new Promise(function(_0x54cec3,_0x2914ce){if(ami[_0xbd9f('0x1b')]()==![]){return _0x2914ce(_0x164569['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}var _0x39062c=schema(properties[_0xbd9f('0x7a')])['validate'](_0x444792);if(_0x39062c[_0xbd9f('0x5d')]>0x0){return _0x2914ce(_0x164569['error'](0x1f4,_['map'](_0x39062c,'message')[_0xbd9f('0x13')](',\x20')));}var _0x3a3586=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x444792[_0xbd9f('0x60')]});if(_0x3a3586&&_0x3a3586[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7b'),'channel':_0x3a3586[_0xbd9f('0x61')]})[_0xbd9f('0x1f')](function(_0x45755a){_0x54cec3({'code':0xc8,'message':[_0x444792[_0xbd9f('0x60')],_0x45755a['message'][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x34f158){_0x2914ce(_0x164569[_0xbd9f('0x10')](0x1f5,[_0x444792[_0xbd9f('0x60')],_0x34f158['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x2914ce(_0x164569['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x25ecb1){var _0x10a6bc=this;return new Promise(function(_0x1b5f8c,_0x25d8a8){if(ami[_0xbd9f('0x1b')]()==![]){return _0x25d8a8(_0x10a6bc[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')]['username'],_0xbd9f('0x1c')]['join']('\x20')));}var _0x4edcd4=schema(properties[_0xbd9f('0x7c')])[_0xbd9f('0x3')](_0x25ecb1);if(_0x4edcd4['length']>0x0){return _0x25d8a8(_0x10a6bc['error'](0x1f4,_['map'](_0x4edcd4,_0xbd9f('0x1a'))[_0xbd9f('0x13')](',\x20')));}var _0x4b7920=_[_0xbd9f('0x5f')](_0x4ce2e2['queueChannels'],{'uniqueid':_0x25ecb1[_0xbd9f('0x60')]});if(_0x4b7920&&_0x4b7920[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7d'),'channel':_0x4b7920['channel'],'exten':_0x25ecb1[_0xbd9f('0x7e')],'context':_0x25ecb1['context']||_0x4b7920[_0xbd9f('0x7f')],'priority':0x1})[_0xbd9f('0x1f')](function(_0x1cb0b1){_0x1b5f8c({'code':0xc8,'message':[_0x25ecb1[_0xbd9f('0x60')],_0x1cb0b1[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x3fb0d6){_0x25d8a8(_0x10a6bc['error'](0x1f5,[_0x25ecb1[_0xbd9f('0x60')],_0x3fb0d6[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x25d8a8(_0x10a6bc['error'](0x1f5,_0xbd9f('0x78')));}});},'Agents':function(_0x21db4e){return new Promise(function(_0x527595,_0x3626ce){var _0x4a130d=_[_0xbd9f('0x5b')](_0x4ce2e2['agents']);_0x527595({'count':_0x4a130d[_0xbd9f('0x5d')],'rows':_0x4a130d});});},'Telephones':function(_0x423a2d){return new Promise(function(_0xcfb788,_0x4f3679){var _0x2808cd=_['values'](_0x4ce2e2[_0xbd9f('0x80')]);_0xcfb788({'count':_0x2808cd[_0xbd9f('0x5d')],'rows':_0x2808cd});});},'Trunks':function(_0x115639){return new Promise(function(_0x1b8f4f,_0x4b3e44){var _0x3063a0=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x81')]);_0x1b8f4f({'count':_0x3063a0[_0xbd9f('0x5d')],'rows':_0x3063a0});});},'OutboundChannels':function(_0x1c8b01){return new Promise(function(_0x210873,_0x20faf6){var _0x58b49c=_['values'](_0x4ce2e2[_0xbd9f('0x82')]);_0x210873({'count':_0x58b49c[_0xbd9f('0x5d')],'rows':_0x58b49c});});},'Outbound':function(_0x551b08){return new Promise(function(_0x156740,_0x4e4bd9){_0x156740(_0x4ce2e2[_0xbd9f('0x2f')]);});},'Campaigns':function(_0x274221){return new Promise(function(_0x3fb6fe,_0x3e8881){var _0x376314=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x83')]);_0x3fb6fe({'count':_0x376314[_0xbd9f('0x5d')],'rows':_0x376314});});},'VoiceQueuesPreview':function(_0x1aa387){var _0x5447b1=this;return new Promise(function(_0x56976c,_0x23eff7){_0x469446[_0xbd9f('0x84')](_0x1aa387['id'])['then'](function(_0x5dc5a2){_0x56976c({'code':0xc8,'message':_0x5dc5a2[_0xbd9f('0x1a')]});})[_0xbd9f('0x21')](function(_0x346b86){_0x23eff7(_0x5447b1[_0xbd9f('0x10')](0x1f4,_0x346b86[_0xbd9f('0x1a')]));});});},'EventManager':function(_0x3a564b){var _0x14f9f0=this;return new Promise(function(_0x571c68,_0x3d9322){if(!_0x3a564b[_0xbd9f('0x85')]){return _0x3d9322(_0x14f9f0['error'](0x1f4,_0xbd9f('0x86')));}ami[_0xbd9f('0x87')](_0xbd9f('0x88')+_0x3a564b[_0xbd9f('0x85')],_0x3a564b[_0xbd9f('0x1a')]);_0x571c68({'code':0xc8,'message':_0x3a564b});});},'FaxAccounts':function(_0x43d375){return new Promise(function(_0x538984,_0x4a3db3){var _0x22f7ad=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x89')]);_0x538984({'count':_0x22f7ad['length'],'rows':_0x22f7ad});});},'SendFax':function(_0x35c2a1){var _0x55b4e5=this;return new Promise(function(_0x5bc569,_0x5a3bce){_0x5b6052[_0xbd9f('0x8a')](_0x35c2a1)[_0xbd9f('0x1f')](function(_0x3826f3){_0x5bc569({'code':0xc8,'message':_0x3826f3[_0xbd9f('0x1a')]});})['catch'](function(_0x49dc1e){_0x5a3bce(_0x55b4e5[_0xbd9f('0x10')](0x1f4,_0x49dc1e[_0xbd9f('0x1a')]));});});},'CheckAfterSend':function(_0x3061d1){var _0x24c576=this;return new Promise(function(_0x6bd70f,_0x5d7e50){_0x5b6052[_0xbd9f('0x8b')](_0x3061d1)[_0xbd9f('0x1f')](function(_0x3fa6cc){_0x6bd70f({'code':0xc8,'message':_0x3fa6cc['message']});})[_0xbd9f('0x21')](function(_0x1dafa4){_0x5d7e50(_0x24c576[_0xbd9f('0x10')](0x1f4,_0x1dafa4[_0xbd9f('0x1a')]));});});}};var _0x5aa1f4=jayson['server'](_0x5e2143)[_0xbd9f('0x8c')]();_0x5aa1f4['on'](_0xbd9f('0x10'),function(_0x3f7729){return _0x43a5a2(_0x3f7729);});_0x5aa1f4[_0xbd9f('0x8')](0x232a,'127.0.0.1',function(){console[_0xbd9f('0x8d')](_0xbd9f('0x8e'),0x232a);return _0x2e7eea(_0xbd9f('0x8f')+0x232a);});});}; \ No newline at end of file +var _0x1261=['predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','omit','undefined','channels','voicechannel','find','channel','filename','uniqueid','wav','MixMonitor','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','catch','map','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','module','action','Reload','then','error','join','command','Action','content','message','voiceQueues','answered','available','pTalking','sumBillable','sumHoldTime','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1261,0x144));var _0x1126=function(_0xa64531,_0x48c65f){_0xa64531=_0xa64531-0x0;var _0x1b1f42=_0x1261[_0xa64531];return _0x1b1f42;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var jayson=require(_0x1126('0x1'));var schema=require(_0x1126('0x2'));var BPromise=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var config=require(_0x1126('0x5'));var properties=require(_0x1126('0x6'));var ami=require(_0x1126('0x7'));exports[_0x1126('0x8')]=function(_0x75a851,_0x5a2189,_0x5c68c8){return new BPromise(function(_0x40ba58,_0x907180){var _0x4f239c={'QueuePause':function(_0x17e5f0){return new Promise(function(_0x28772d,_0x245be9){var _0x3abb0b=util[_0x1126('0x9')]('%s/%s',_0x1126('0xa'),_0x17e5f0[_0x1126('0xb')]);if(_0x75a851[_0x1126('0xc')]&&_0x75a851['timers'][_0x3abb0b]&&_0x75a851[_0x1126('0xc')][_0x3abb0b]['timer']){_0x75a851['timers'][_0x3abb0b][_0x1126('0xd')]();}if(_0x75a851['agents'][_0x3abb0b]){_0x75a851[_0x1126('0xe')][_0x3abb0b][_0x1126('0xf')]({'statePause':_0x17e5f0[_0x1126('0x10')]?!![]:![]});}_0x28772d({'code':0xc8,'message':_0x1126('0x11')});});},'Reload':function(_0xca0355){var _0x3f10e9=this;return new Promise(function(_0xd8ca42,_0x2048ad){if(ami[_0x1126('0x12')]()==![]){return _0x2048ad(_0x3f10e9['error'](0x1f4,[config['asterisk']['ip'],config[_0x1126('0x13')][_0x1126('0x14')],_0x1126('0x15')]['join']('\x20')));}_0xca0355=_[_0x1126('0x16')](_0xca0355,_['keys'](properties[_0x1126('0x17')]));_0xca0355[_0x1126('0x18')]=_0x1126('0x19');return ami['Action'](_0xca0355)[_0x1126('0x1a')](function(_0x1695f6){_0xd8ca42({'code':0xc8,'message':_0x1695f6['message']});})['catch'](function(_0x22ae0b){_0x2048ad(_0x3f10e9[_0x1126('0x1b')](0x1f5,_0x22ae0b['message']));});});},'Command':function(_0x548359){var _0x4564c0=this;return new Promise(function(_0x58b109,_0x22ed37){if(ami[_0x1126('0x12')]()==![]){return _0x22ed37(_0x4564c0[_0x1126('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x1126('0x13')]['username'],'ami\x20disconnected'][_0x1126('0x1c')]('\x20')));}_0x548359=_[_0x1126('0x16')](_0x548359,_0x1126('0x1d'));_0x548359[_0x1126('0x18')]='Command';return ami[_0x1126('0x1e')](_0x548359)[_0x1126('0x1a')](function(_0x48a08d){_0x58b109({'code':0xc8,'message':_0x48a08d[_0x1126('0x1f')]});})['catch'](function(_0x529dd9){_0x22ed37(_0x4564c0['error'](0x1f5,_0x529dd9[_0x1126('0x20')]));});});},'VoiceQueues':function(_0x15bcc3){return new Promise(function(_0x329914,_0x34bcf1){var _0x566c09=[];for(var _0x1b07a7 in _0x75a851[_0x1126('0x21')]){if(_0x75a851[_0x1126('0x21')]['hasOwnProperty'](_0x1b07a7)){var _0x35eec3=_0x75a851[_0x1126('0x21')][_0x1b07a7];var _0xa293f4={'id':_0x35eec3['id'],'name':_0x35eec3['name'],'strategy':_0x35eec3['strategy'],'answered':_0x35eec3[_0x1126('0x22')],'available':_0x35eec3[_0x1126('0x23')],'loggedIn':_0x35eec3['loggedIn'],'pTalking':_0x35eec3[_0x1126('0x24')],'sumBillable':_0x35eec3[_0x1126('0x25')],'sumDuration':_0x35eec3['sumDuration'],'sumHoldTime':_0x35eec3[_0x1126('0x26')]||0x0,'talking':_0x35eec3['talking'],'total':_0x35eec3[_0x1126('0x27')],'type':_0x35eec3['type'],'unmanaged':_0x35eec3[_0x1126('0x28')],'abandoned':_0x35eec3['abandoned'],'waiting':_0x35eec3[_0x1126('0x29')],'loggedInDb':_0x35eec3['loggedInDb']};if(_0x35eec3['type']==='outbound'){_0xa293f4[_0x1126('0x2a')]=_0x35eec3[_0x1126('0x2a')];_0xa293f4[_0x1126('0x2b')]=_0x35eec3['dialMethod'];_0xa293f4[_0x1126('0x2c')]=_0x35eec3[_0x1126('0x2c')];_0xa293f4['dialOriginateCallerIdNumber']=_0x35eec3[_0x1126('0x2d')];_0xa293f4[_0x1126('0x2e')]=_0x35eec3[_0x1126('0x2e')];_0xa293f4[_0x1126('0x2f')]=_0x35eec3['dialPrefix'];_0xa293f4['temp']=_0x35eec3[_0x1126('0x30')];_0xa293f4[_0x1126('0x31')]=_0x35eec3[_0x1126('0x31')];_0xa293f4[_0x1126('0x32')]=_0x35eec3['outboundAnswerCallsDay'];_0xa293f4[_0x1126('0x33')]=_0x35eec3[_0x1126('0x33')];_0xa293f4[_0x1126('0x34')]=_0x35eec3[_0x1126('0x34')];_0xa293f4[_0x1126('0x35')]=_0x35eec3['outboundCongestionCallsDay'];_0xa293f4[_0x1126('0x36')]=_0x35eec3[_0x1126('0x36')];_0xa293f4[_0x1126('0x37')]=_0x35eec3[_0x1126('0x37')];_0xa293f4['outboundDropCallsDayTimeout']=_0x35eec3['outboundDropCallsDayTimeout'];_0xa293f4[_0x1126('0x38')]=_0x35eec3[_0x1126('0x38')];_0xa293f4['outboundNoSuchCallsDay']=_0x35eec3[_0x1126('0x39')];_0xa293f4[_0x1126('0x3a')]=_0x35eec3[_0x1126('0x3a')];_0xa293f4['outboundReCallsDay']=_0x35eec3['outboundReCallsDay'];_0xa293f4[_0x1126('0x3b')]=_0x35eec3[_0x1126('0x3b')];_0xa293f4[_0x1126('0x3c')]=_0x35eec3[_0x1126('0x3c')];_0xa293f4['predictiveIntervalAnsweredCalls']=_0x35eec3[_0x1126('0x3d')];_0xa293f4['predictiveIntervalAvgHoldtime']=_0x35eec3[_0x1126('0x3e')];_0xa293f4[_0x1126('0x3f')]=_0x35eec3[_0x1126('0x3f')];_0xa293f4[_0x1126('0x40')]=_0x35eec3[_0x1126('0x40')];_0xa293f4['predictiveIntervalDroppedCallsTimeout']=_0x35eec3[_0x1126('0x41')];_0xa293f4[_0x1126('0x42')]=_0x35eec3[_0x1126('0x42')];_0xa293f4[_0x1126('0x43')]=_0x35eec3[_0x1126('0x43')];_0xa293f4[_0x1126('0x44')]=_0x35eec3[_0x1126('0x44')];_0xa293f4['predictiveIntervalMultiplicativeFactor']=_0x35eec3[_0x1126('0x45')];_0xa293f4[_0x1126('0x46')]=_0x35eec3[_0x1126('0x46')];_0xa293f4[_0x1126('0x47')]=_0x35eec3[_0x1126('0x47')];_0xa293f4['predictiveIntervalTotalCalls']=_0x35eec3['predictiveIntervalTotalCalls'];_0xa293f4[_0x1126('0x20')]=_0x35eec3[_0x1126('0x20')];_0xa293f4[_0x1126('0x48')]=_0x35eec3[_0x1126('0x48')];_0xa293f4[_0x1126('0x49')]=_0x35eec3[_0x1126('0x49')];_0xa293f4['erlangCallToSecond']=_0x35eec3['erlangCallToSecond'];_0xa293f4['erlangAbandonmentRate']=_0x35eec3[_0x1126('0x4a')];_0xa293f4['erlangBusyFactor']=_0x35eec3[_0x1126('0x4b')];_0xa293f4[_0x1126('0x4c')]=_0x35eec3[_0x1126('0x4c')];_0xa293f4[_0x1126('0x4d')]=_0x35eec3['startProgressive'];}if(_0x35eec3['Trunk']){_0xa293f4[_0x1126('0x4e')]={'id':_0x35eec3[_0x1126('0x4e')]['id'],'name':_0x35eec3[_0x1126('0x4e')]['name'],'active':_0x35eec3[_0x1126('0x4e')]['active'],'callerid':_0x35eec3[_0x1126('0x4e')]['callerid']};}if(_0x35eec3[_0x1126('0x4f')]){_0xa293f4[_0x1126('0x4f')]={'id':_0x35eec3[_0x1126('0x4f')]['id'],'name':_0x35eec3['Interval'][_0x1126('0xb')]};}_0x566c09[_0x1126('0x50')](_0xa293f4);}}_0x329914({'count':_0x566c09[_0x1126('0x51')],'rows':_0x566c09});});},'UpdateVoiceQueue':function(_0x48c694){return new Promise(function(_0x58ff3a,_0x4dd7f5){var _0x6e78cf=_['find'](_0x75a851[_0x1126('0x21')],{'id':parseInt(_0x48c694['id'])});var _0x507568=_[_0x1126('0x52')](_0x48c694,['id']);if(_0x6e78cf){for(var _0x323499 in _0x507568){if(typeof _0x507568[_0x323499]!==_0x1126('0x53')&&typeof _0x6e78cf[_0x323499]!==_0x1126('0x53')){_0x6e78cf[_0x323499]=_0x507568[_0x323499];}}_0x58ff3a(_0x6e78cf);}else{_0x4dd7f5();}});},'VoiceChannels':function(_0xede3d8){return new Promise(function(_0x56732f,_0x198173){var _0x512f60=_['values'](_0x75a851[_0x1126('0x54')]);_0x56732f({'count':_0x512f60[_0x1126('0x51')],'rows':_0x512f60});});},'VoiceChannelMixMonitor':function(_0x575f79){var _0x5f6d73=this;return new Promise(function(_0x1ffa2b,_0x518e0a){if(ami[_0x1126('0x12')]()==![]){return _0x518e0a(_0x5f6d73[_0x1126('0x1b')](0x1f4,[config[_0x1126('0x13')]['ip'],config['asterisk'][_0x1126('0x14')],_0x1126('0x15')][_0x1126('0x1c')]('\x20')));}var _0x5878bb=schema(properties[_0x1126('0x55')])[_0x1126('0x2')](_0x575f79);if(_0x5878bb[_0x1126('0x51')]>0x0){return _0x518e0a(_0x5f6d73[_0x1126('0x1b')](0x1f4,_['map'](_0x5878bb,_0x1126('0x20'))['join'](',\x20')));}var _0x40168e=_[_0x1126('0x56')](_0x75a851['channels'],{'uniqueid':_0x575f79['uniqueid']});if(_0x40168e&&_0x40168e[_0x1126('0x57')]){var _0x3c1d16=util[_0x1126('0x9')]('%s.%s',_0x575f79[_0x1126('0x58')]||_0x575f79[_0x1126('0x59')],_0x575f79[_0x1126('0x9')]||_0x1126('0x5a'));return ami['Action']({'action':_0x1126('0x5b'),'channel':_0x40168e[_0x1126('0x57')],'file':_0x3c1d16,'options':'ai(mixmonitorid)'})['then'](function(_0x4abb4d){var _0x526b07=_[_0x1126('0x56')](_0x40168e[_0x1126('0x5c')],{'filename':'/var/spool/asterisk/monitor/'+_0x3c1d16[_0x1126('0x5d')]()});if(_[_0x1126('0x5e')](_0x526b07)){_0x40168e[_0x1126('0x5c')][_0x1126('0x50')]({'filename':_0x1126('0x5f')+_0x3c1d16['toLowerCase'](),'createdAt':moment()[_0x1126('0x9')](_0x1126('0x60')),'mixmonitorid':_0x4abb4d['mixmonitorid'],'status':_0x1126('0x61')});}else{_0x526b07[_0x1126('0x62')]=_0x4abb4d[_0x1126('0x62')];_0x526b07[_0x1126('0x63')]=_0x1126('0x61');}_0x1ffa2b({'code':0xc8,'message':[_0x575f79['uniqueid'],_0x1126('0x64'),_0x4abb4d['mixmonitorid']][_0x1126('0x1c')]('\x20'),'mixmonitorid':_0x4abb4d[_0x1126('0x62')]});})[_0x1126('0x65')](function(_0x590bc2){_0x518e0a(_0x5f6d73[_0x1126('0x1b')](0x1f5,[_0x575f79[_0x1126('0x59')],_0x590bc2['message'][_0x1126('0x5d')]()][_0x1126('0x1c')]('\x20')));});}else{return _0x518e0a(_0x5f6d73[_0x1126('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2fe6dc){var _0x3377db=this;return new Promise(function(_0x22ab18,_0x308ee4){if(ami[_0x1126('0x12')]()==![]){return _0x308ee4(_0x3377db[_0x1126('0x1b')](0x1f4,[config[_0x1126('0x13')]['ip'],config[_0x1126('0x13')]['username'],_0x1126('0x15')][_0x1126('0x1c')]('\x20')));}var _0xe8f195=schema(properties[_0x1126('0x55')])[_0x1126('0x2')](_0x2fe6dc);if(_0xe8f195['length']>0x0){return _0x308ee4(_0x3377db[_0x1126('0x1b')](0x1f4,_[_0x1126('0x66')](_0xe8f195,'message')[_0x1126('0x1c')](',\x20')));}var _0x5246aa=_[_0x1126('0x56')](_0x75a851[_0x1126('0x54')],{'uniqueid':_0x2fe6dc['uniqueid']});if(_0x5246aa){return BPromise[_0x1126('0x67')]()[_0x1126('0x1a')](function(){if(_0x5246aa[_0x1126('0x57')]){return ami['Action']({'action':_0x1126('0x68'),'channel':_0x5246aa['channel'],'mixmonitorid':_0x2fe6dc['mixmonitorid']})[_0x1126('0x65')](function(_0x40185f){});}})[_0x1126('0x1a')](function(){if(_0x5246aa[_0x1126('0x69')]){return ami[_0x1126('0x1e')]({'action':_0x1126('0x68'),'channel':_0x5246aa[_0x1126('0x69')],'mixmonitorid':_0x2fe6dc['mixmonitorid']})[_0x1126('0x65')](function(_0x43ec00){});}})[_0x1126('0x1a')](function(_0xc39c36){var _0x3f87aa=_[_0x1126('0x56')](_0x5246aa['monitors'],{'mixmonitorid':_0x2fe6dc['mixmonitorid']});if(_0x3f87aa){_0x3f87aa[_0x1126('0x63')]=_0x1126('0x6a');}})['then'](function(){var _0x5ee130=util['format']('%s.%s',_0x2fe6dc[_0x1126('0x58')]||_0x2fe6dc[_0x1126('0x59')],_0x2fe6dc[_0x1126('0x9')]||'wav');var _0x30e32f=_[_0x1126('0x56')](_0x5246aa[_0x1126('0x5c')],{'filename':_0x1126('0x5f')+_0x5ee130[_0x1126('0x5d')]()});if(_0x30e32f){_0x30e32f[_0x1126('0x63')]=_0x1126('0x6a');}})['then'](function(){_0x22ab18({'code':0xc8,'message':[_0x2fe6dc[_0x1126('0x59')],_0x1126('0x6b')][_0x1126('0x1c')]('\x20')});})[_0x1126('0x65')](function(_0x288b9b){_0x308ee4(_0x3377db['error'](0x1f5,[_0x2fe6dc['uniqueid'],_0x288b9b[_0x1126('0x20')][_0x1126('0x5d')]()]['join']('\x20')));});}else{return _0x308ee4(_0x3377db[_0x1126('0x1b')](0x1f5,_0x1126('0x6c')));}});},'VoiceQueuesChannels':function(_0x366675){return new Promise(function(_0x6a41c0,_0x2828d4){var _0x30d240=_[_0x1126('0x6d')](_0x75a851[_0x1126('0x6e')]);_0x6a41c0({'count':_0x30d240[_0x1126('0x51')],'rows':_0x30d240});});},'VoiceQueuesChannel':function(_0x3d5e15){var _0x16e48a=this;return new Promise(function(_0x1228cf,_0x3dad39){var _0x592005=schema(properties[_0x1126('0x6f')])[_0x1126('0x2')](_0x3d5e15);if(_0x592005[_0x1126('0x51')]>0x0){return _0x3dad39(_0x16e48a['error'](0x1f4,_['map'](_0x592005,_0x1126('0x20'))[_0x1126('0x1c')](',\x20')));}var _0x1998f2=_[_0x1126('0x56')](_0x75a851['queueChannels'],{'uniqueid':_0x3d5e15['uniqueid']});if(_0x1998f2){_0x1228cf(_0x1998f2);}else{return _0x3dad39(_0x16e48a['error'](0x1f5,_0x1126('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x1b355f){var _0x3693b9=this;return new Promise(function(_0xdedb8f,_0x54a72e){if(ami[_0x1126('0x12')]()==![]){return _0x54a72e(_0x3693b9['error'](0x1f4,[config[_0x1126('0x13')]['ip'],config[_0x1126('0x13')][_0x1126('0x14')],_0x1126('0x15')][_0x1126('0x1c')]('\x20')));}var _0x1e7c9a=schema(properties[_0x1126('0x70')])['validate'](_0x1b355f);if(_0x1e7c9a[_0x1126('0x51')]>0x0){return _0x54a72e(_0x3693b9['error'](0x1f4,_[_0x1126('0x66')](_0x1e7c9a,_0x1126('0x20'))['join'](',\x20')));}var _0x376175=_[_0x1126('0x56')](_0x75a851['queueChannels'],{'uniqueid':_0x1b355f[_0x1126('0x59')]});if(_0x376175&&_0x376175[_0x1126('0x57')]){return ami['Action']({'action':'Hangup','channel':_0x376175[_0x1126('0x57')]})[_0x1126('0x1a')](function(_0x21ea6e){_0xdedb8f({'code':0xc8,'message':[_0x1b355f['uniqueid'],_0x21ea6e['message']['toLowerCase']()][_0x1126('0x1c')]('\x20')});})['catch'](function(_0x4cfbed){_0x54a72e(_0x3693b9[_0x1126('0x1b')](0x1f5,[_0x1b355f['uniqueid'],_0x4cfbed[_0x1126('0x20')][_0x1126('0x5d')]()]['join']('\x20')));});}else{return _0x54a72e(_0x3693b9[_0x1126('0x1b')](0x1f5,_0x1126('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x161b88){var _0xc3bb7f=this;return new Promise(function(_0x1644fc,_0x5e9872){if(ami[_0x1126('0x12')]()==![]){return _0x5e9872(_0xc3bb7f[_0x1126('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x1126('0x13')][_0x1126('0x14')],_0x1126('0x15')][_0x1126('0x1c')]('\x20')));}var _0x2598a7=schema(properties[_0x1126('0x71')])[_0x1126('0x2')](_0x161b88);if(_0x2598a7[_0x1126('0x51')]>0x0){return _0x5e9872(_0xc3bb7f[_0x1126('0x1b')](0x1f4,_[_0x1126('0x66')](_0x2598a7,_0x1126('0x20'))[_0x1126('0x1c')](',\x20')));}var _0x2010a9=_[_0x1126('0x56')](_0x75a851[_0x1126('0x6e')],{'uniqueid':_0x161b88[_0x1126('0x59')]});if(_0x2010a9&&_0x2010a9['channel']){return ami[_0x1126('0x1e')]({'action':_0x1126('0x72'),'channel':_0x2010a9[_0x1126('0x57')],'exten':_0x161b88[_0x1126('0x73')],'context':_0x161b88[_0x1126('0x74')]||_0x2010a9['context'],'priority':0x1})[_0x1126('0x1a')](function(_0x4bf54b){_0x1644fc({'code':0xc8,'message':[_0x161b88['uniqueid'],_0x4bf54b[_0x1126('0x20')][_0x1126('0x5d')]()]['join']('\x20')});})['catch'](function(_0xaada05){_0x5e9872(_0xc3bb7f[_0x1126('0x1b')](0x1f5,[_0x161b88[_0x1126('0x59')],_0xaada05[_0x1126('0x20')][_0x1126('0x5d')]()][_0x1126('0x1c')]('\x20')));});}else{return _0x5e9872(_0xc3bb7f[_0x1126('0x1b')](0x1f5,_0x1126('0x6c')));}});},'Agents':function(_0x4a29e1){return new Promise(function(_0x5644ea,_0x13bfe4){var _0x402e9a=_[_0x1126('0x6d')](_0x75a851[_0x1126('0xe')]);_0x5644ea({'count':_0x402e9a[_0x1126('0x51')],'rows':_0x402e9a});});},'Telephones':function(_0x336b4b){return new Promise(function(_0x482199,_0xadea7b){var _0x2cc4c8=_[_0x1126('0x6d')](_0x75a851[_0x1126('0x75')]);_0x482199({'count':_0x2cc4c8[_0x1126('0x51')],'rows':_0x2cc4c8});});},'Trunks':function(_0x1796eb){return new Promise(function(_0x2418ca,_0x2d2dfc){var _0x38eac6=_[_0x1126('0x6d')](_0x75a851['trunks']);_0x2418ca({'count':_0x38eac6['length'],'rows':_0x38eac6});});},'OutboundChannels':function(_0x271d7c){return new Promise(function(_0x55496f,_0x3c5ea3){var _0x4bd50a=_[_0x1126('0x6d')](_0x75a851['outboundChannels']);_0x55496f({'count':_0x4bd50a[_0x1126('0x51')],'rows':_0x4bd50a});});},'Outbound':function(_0x4fbd44){return new Promise(function(_0x5c5044,_0x48c461){_0x5c5044(_0x75a851[_0x1126('0x76')]);});},'Campaigns':function(_0x31769a){return new Promise(function(_0x53f58b,_0x4ce12f){var _0x44325d=_[_0x1126('0x6d')](_0x75a851[_0x1126('0x77')]);_0x53f58b({'count':_0x44325d['length'],'rows':_0x44325d});});},'VoiceQueuesPreview':function(_0x48f914){var _0x25f2e3=this;return new Promise(function(_0x546d32,_0x41679a){_0x5a2189[_0x1126('0x78')](_0x48f914['id'])[_0x1126('0x1a')](function(_0x29922a){_0x546d32({'code':0xc8,'message':_0x29922a[_0x1126('0x20')]});})['catch'](function(_0x591c75){_0x41679a(_0x25f2e3[_0x1126('0x1b')](0x1f4,_0x591c75[_0x1126('0x20')]));});});},'EventManager':function(_0xfc9fb4){var _0x3758fa=this;return new Promise(function(_0x1b8218,_0x23bd79){if(!_0xfc9fb4[_0x1126('0x79')]){return _0x23bd79(_0x3758fa[_0x1126('0x1b')](0x1f4,_0x1126('0x7a')));}ami[_0x1126('0x7b')](_0x1126('0x7c')+_0xfc9fb4['event'],_0xfc9fb4[_0x1126('0x20')]);_0x1b8218({'code':0xc8,'message':_0xfc9fb4});});},'FaxAccounts':function(_0x4e4a05){return new Promise(function(_0x99eb4e,_0x4ec8b9){var _0x4256e6=_[_0x1126('0x6d')](_0x75a851[_0x1126('0x7d')]);_0x99eb4e({'count':_0x4256e6[_0x1126('0x51')],'rows':_0x4256e6});});},'SendFax':function(_0x59c04b){var _0x429183=this;return new Promise(function(_0x834360,_0x4b5d46){_0x5c68c8['send'](_0x59c04b)[_0x1126('0x1a')](function(_0x71b813){_0x834360({'code':0xc8,'message':_0x71b813[_0x1126('0x20')]});})['catch'](function(_0x8e044c){_0x4b5d46(_0x429183['error'](0x1f4,_0x8e044c[_0x1126('0x20')]));});});},'CheckAfterSend':function(_0x3a40c6){var _0x4d6bb2=this;return new Promise(function(_0x58607d,_0x315192){_0x5c68c8[_0x1126('0x7e')](_0x3a40c6)[_0x1126('0x1a')](function(_0x323d0a){_0x58607d({'code':0xc8,'message':_0x323d0a['message']});})[_0x1126('0x65')](function(_0x454a67){_0x315192(_0x4d6bb2[_0x1126('0x1b')](0x1f4,_0x454a67['message']));});});}};var _0x53fd91=jayson['server'](_0x4f239c)[_0x1126('0x7f')]();_0x53fd91['on'](_0x1126('0x1b'),function(_0x1a7c9b){return _0x907180(_0x1a7c9b);});_0x53fd91[_0x1126('0x8')](0x232a,'127.0.0.1',function(){console[_0x1126('0x80')](_0x1126('0x81'),0x232a);return _0x40ba58(_0x1126('0x82')+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 3dfbf89..79bf36b 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 _0x7bfe=['util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','phone','mobile','fax','union','resolve','getContacts','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','ioredis'];(function(_0x3bb9e3,_0x1fb1c4){var _0x381aa0=function(_0xb56b49){while(--_0xb56b49){_0x3bb9e3['push'](_0x3bb9e3['shift']());}};_0x381aa0(++_0x1fb1c4);}(_0x7bfe,0x9e));var _0xe7bf=function(_0x4ac1e2,_0x392be2){_0x4ac1e2=_0x4ac1e2-0x0;var _0x118849=_0x7bfe[_0x4ac1e2];return _0x118849;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe7bf('0x0'));var util=require(_0xe7bf('0x1'));var config=require('../../../../config/environment');var logger=require(_0xe7bf('0x2'))(_0xe7bf('0x3'));var cmContactRpc=require(_0xe7bf('0x4'));config[_0xe7bf('0x5')]=_[_0xe7bf('0x6')](config[_0xe7bf('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe7bf('0x7'))(new Redis(config[_0xe7bf('0x5')]));function emit(_0x21d126,_0x2b56e3,_0x58d2ba,_0x379b8c,_0x237f26){logger[_0xe7bf('0x8')](_0xe7bf('0x9'),_0x21d126,_0x2b56e3['id'],_0x58d2ba,_0x379b8c,JSON[_0xe7bf('0xa')](_0x237f26));io['to'](_0x58d2ba)[_0xe7bf('0xb')](_0x379b8c,_0x237f26);}exports[_0xe7bf('0xc')]=function(_0x258304,_0x4d8838,_0x6f5e6e,_0x175f8e){var _0xe06675,_0x4e65b6;var _0x353be5={};var _0x1e7f41=Number(_0x6f5e6e[_0xe7bf('0xd')]);var _0x992ed5=_0x6f5e6e[_0xe7bf('0xe')]?Boolean(Number(_0x6f5e6e['data2'])):![];var _0x33bf44;if(_0x175f8e[_0xe7bf('0xf')]){_0x353be5['id']=_0x175f8e['xmd-contactid'];}if(!_0x353be5['id']){_0x353be5[_0xe7bf('0x10')]=_0x1e7f41;_0x33bf44=_0x6f5e6e[_0xe7bf('0x11')]&&_0x6f5e6e[_0xe7bf('0x11')]!=='0'?_0x6f5e6e[_0xe7bf('0x11')][_0xe7bf('0x12')](','):['phone'];_0x353be5[_0xe7bf('0x13')]=_[_0xe7bf('0x14')](_0x33bf44,function(_0x434882){var _0x4df7cf={};_0x4df7cf[_0x434882]=_0x175f8e[_0xe7bf('0x15')]?_0x175f8e[_0xe7bf('0x16')]:_0x175f8e[_0xe7bf('0x17')];return _0x4df7cf;});}var _0x459992=['id',_0xe7bf('0x18'),'lastName',_0xe7bf('0x19'),_0xe7bf('0x1a'),_0xe7bf('0x1b'),_0xe7bf('0x10'),'createdAt','scheduledAt','updatedAt'];var _0xc379ff=_[_0xe7bf('0x1c')](_0x459992,_0x33bf44);BPromise[_0xe7bf('0x1d')]()['then'](cmContactRpc[_0xe7bf('0x1e')]({'attributes':_0xc379ff,'where':_0x353be5}))[_0xe7bf('0x1f')](function(_0x1dcf76){_0x4e65b6=_0x1dcf76;if(!_['isEmpty'](_0x4e65b6)){if(_0x4e65b6[_0xe7bf('0x20')]===0x1){_0xe06675=_0x4e65b6[0x0];logger[_0xe7bf('0x8')](_0xe7bf('0x21'),_0x175f8e[_0xe7bf('0x22')],_0x4d8838['id'],_0xe06675['id']);}else{logger[_0xe7bf('0x8')](_0xe7bf('0x23'),_0x175f8e['uniqueid'],_0x4d8838['id'],_[_0xe7bf('0x14')](_0x4e65b6,'id')[_0xe7bf('0x24')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x175f8e[_0xe7bf('0x22')],_0x4d8838['id']);var _0x3b915b={'ListId':_0x1e7f41};var _0x8ed66f=_0x6f5e6e[_0xe7bf('0x25')]&&_0x6f5e6e[_0xe7bf('0x25')]!=='0'?_0x6f5e6e[_0xe7bf('0x25')]:_0xe7bf('0x19');if(_0x992ed5){logger[_0xe7bf('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x175f8e[_0xe7bf('0x22')],_0x4d8838['id']);_0x3b915b[_0x8ed66f]=_[_0xe7bf('0x26')](_0x175f8e[_0xe7bf('0x15')])?_0x175f8e[_0xe7bf('0x17')]:_0x175f8e['destcalleridnum'];if(_[_0xe7bf('0x26')](_0x175f8e[_0xe7bf('0x15')])){_0x3b915b[_0xe7bf('0x18')]=_0x175f8e['calleridname']&&_0x175f8e[_0xe7bf('0x27')]!==_0xe7bf('0x28')?_0x175f8e['calleridname']:_0xe7bf('0x29');}else{_0x3b915b['firstName']=_0x175f8e[_0xe7bf('0x2a')]&&_0x175f8e[_0xe7bf('0x2a')]!==_0xe7bf('0x28')?_0x175f8e['destcalleridname']:_0xe7bf('0x29');}return BPromise[_0xe7bf('0x1d')]()[_0xe7bf('0x1f')](cmContactRpc[_0xe7bf('0x2b')](_0x3b915b))['then'](function(_0x424f21){_0xe06675=_0x424f21;_0x4e65b6[_0xe7bf('0x2c')](_0x424f21);if(_0xe06675){logger[_0xe7bf('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x175f8e['uniqueid'],_0x4d8838['id'],_0xe06675['id']);}return;});}else{logger[_0xe7bf('0x8')](_0xe7bf('0x2d'),_0x175f8e[_0xe7bf('0x22')],_0x4d8838['id']);_0x3b915b[_0x8ed66f]=_[_0xe7bf('0x26')](_0x175f8e[_0xe7bf('0x15')])?_0x175f8e[_0xe7bf('0x17')]:_0x175f8e[_0xe7bf('0x16')];if(_[_0xe7bf('0x26')](_0x175f8e['routeId'])){_0x3b915b[_0xe7bf('0x18')]=_0x175f8e[_0xe7bf('0x27')]&&_0x175f8e[_0xe7bf('0x27')]!==''?_0x175f8e[_0xe7bf('0x27')]:_0xe7bf('0x29');}else{_0x3b915b['firstName']=_0x175f8e[_0xe7bf('0x2a')]&&_0x175f8e[_0xe7bf('0x2a')]!==''?_0x175f8e[_0xe7bf('0x2a')]:_0xe7bf('0x29');}_0xe06675=_0x3b915b;_0x4e65b6[_0xe7bf('0x2c')](_0x3b915b);return;}}})[_0xe7bf('0x1f')](function(){if(_0x258304){emit(_0x175f8e[_0xe7bf('0x22')],_0x4d8838,util[_0xe7bf('0x2e')](_0xe7bf('0x2f'),_0x258304[_0xe7bf('0x30')]),util[_0xe7bf('0x2e')](_0xe7bf('0x31'),_0x6f5e6e[_0xe7bf('0x32')][_0xe7bf('0x33')]()),{'evt':_[_0xe7bf('0x34')](_0x175f8e,{'autoCreate':_0x992ed5}),'contact':_0xe06675===undefined?{}:_0xe06675,'contacts':_0x4e65b6['length']===0x0?undefined:_0x4e65b6});}});}; \ No newline at end of file +var _0xc6d5=['[CM][%s][%s]\x20Autocreate\x20disabled','','user:%s','name','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','firstName','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc6d5,0x1e8));var _0x5c6d=function(_0x10978a,_0x5c58ae){_0x10978a=_0x10978a-0x0;var _0x107318=_0xc6d5[_0x10978a];return _0x107318;};'use strict';var _=require(_0x5c6d('0x0'));var BPromise=require(_0x5c6d('0x1'));var Redis=require(_0x5c6d('0x2'));var util=require(_0x5c6d('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5c6d('0x4'))('trigger');var cmContactRpc=require(_0x5c6d('0x5'));config[_0x5c6d('0x6')]=_[_0x5c6d('0x7')](config[_0x5c6d('0x6')],{'host':_0x5c6d('0x8'),'port':0x18eb});var io=require(_0x5c6d('0x9'))(new Redis(config['redis']));function emit(_0x197444,_0x2409c6,_0x46d5da,_0xe9a1d2,_0x34f01f){logger[_0x5c6d('0xa')](_0x5c6d('0xb'),_0x197444,_0x2409c6['id'],_0x46d5da,_0xe9a1d2,JSON[_0x5c6d('0xc')](_0x34f01f));io['to'](_0x46d5da)[_0x5c6d('0xd')](_0xe9a1d2,_0x34f01f);}exports[_0x5c6d('0xe')]=function(_0x260418,_0x55c83d,_0x5d954d,_0x161a3a){var _0x4bb65e,_0x4f0705;var _0x2763d5={};var _0x1e7c15=Number(_0x5d954d[_0x5c6d('0xf')]);var _0x2745b9=_0x5d954d[_0x5c6d('0x10')]?Boolean(Number(_0x5d954d[_0x5c6d('0x10')])):![];var _0x4f7018;if(_0x161a3a['xmd-contactid']){_0x2763d5['id']=_0x161a3a[_0x5c6d('0x11')];}if(!_0x2763d5['id']){_0x2763d5[_0x5c6d('0x12')]=_0x1e7c15;_0x4f7018=_0x5d954d[_0x5c6d('0x13')]&&_0x5d954d[_0x5c6d('0x13')]!=='0'?_0x5d954d[_0x5c6d('0x13')][_0x5c6d('0x14')](','):[_0x5c6d('0x15')];_0x2763d5[_0x5c6d('0x16')]=_[_0x5c6d('0x17')](_0x4f7018,function(_0x2a8f92){var _0x2e7da6={};_0x2e7da6[_0x2a8f92]=_0x161a3a['routeId']?_0x161a3a[_0x5c6d('0x18')]:_0x161a3a['calleridnum'];return _0x2e7da6;});}var _0x15fdb3=['id',_0x5c6d('0x19'),'lastName',_0x5c6d('0x15'),'mobile',_0x5c6d('0x1a'),'ListId',_0x5c6d('0x1b'),_0x5c6d('0x1c'),_0x5c6d('0x1d')];var _0x1c119b=_[_0x5c6d('0x1e')](_0x15fdb3,_0x4f7018);BPromise[_0x5c6d('0x1f')]()['then'](cmContactRpc[_0x5c6d('0x20')]({'attributes':_0x1c119b,'where':_0x2763d5}))[_0x5c6d('0x21')](function(_0x9700db){_0x4f0705=_0x9700db;if(!_[_0x5c6d('0x22')](_0x4f0705)){if(_0x4f0705[_0x5c6d('0x23')]===0x1){_0x4bb65e=_0x4f0705[0x0];logger[_0x5c6d('0xa')](_0x5c6d('0x24'),_0x161a3a[_0x5c6d('0x25')],_0x55c83d['id'],_0x4bb65e['id']);}else{logger[_0x5c6d('0xa')](_0x5c6d('0x26'),_0x161a3a['uniqueid'],_0x55c83d['id'],_[_0x5c6d('0x17')](_0x4f0705,'id')[_0x5c6d('0x27')](','));}return;}else{logger['info'](_0x5c6d('0x28'),_0x161a3a[_0x5c6d('0x25')],_0x55c83d['id']);var _0x392c2b={'ListId':_0x1e7c15};var _0x466454=_0x5d954d[_0x5c6d('0x29')]&&_0x5d954d[_0x5c6d('0x29')]!=='0'?_0x5d954d[_0x5c6d('0x29')]:'phone';if(_0x2745b9){logger[_0x5c6d('0xa')](_0x5c6d('0x2a'),_0x161a3a['uniqueid'],_0x55c83d['id']);_0x392c2b[_0x466454]=_[_0x5c6d('0x2b')](_0x161a3a[_0x5c6d('0x2c')])?_0x161a3a[_0x5c6d('0x2d')]:_0x161a3a['destcalleridnum'];if(_[_0x5c6d('0x2b')](_0x161a3a[_0x5c6d('0x2c')])){_0x392c2b[_0x5c6d('0x19')]=_0x161a3a['calleridname']&&_0x161a3a[_0x5c6d('0x2e')]!==''?_0x161a3a[_0x5c6d('0x2e')]:_0x5c6d('0x2f');}else{_0x392c2b['firstName']=_0x161a3a[_0x5c6d('0x30')]&&_0x161a3a[_0x5c6d('0x30')]!==''?_0x161a3a[_0x5c6d('0x30')]:'Unknown';}return BPromise[_0x5c6d('0x1f')]()[_0x5c6d('0x21')](cmContactRpc[_0x5c6d('0x31')](_0x392c2b))[_0x5c6d('0x21')](function(_0x55c296){_0x4bb65e=_0x55c296;_0x4f0705[_0x5c6d('0x32')](_0x55c296);if(_0x4bb65e){logger[_0x5c6d('0xa')](_0x5c6d('0x33'),_0x161a3a[_0x5c6d('0x25')],_0x55c83d['id'],_0x4bb65e['id']);}return;});}else{logger[_0x5c6d('0xa')](_0x5c6d('0x34'),_0x161a3a['uniqueid'],_0x55c83d['id']);_0x392c2b[_0x466454]=_[_0x5c6d('0x2b')](_0x161a3a['routeId'])?_0x161a3a['calleridnum']:_0x161a3a[_0x5c6d('0x18')];if(_[_0x5c6d('0x2b')](_0x161a3a[_0x5c6d('0x2c')])){_0x392c2b[_0x5c6d('0x19')]=_0x161a3a[_0x5c6d('0x2e')]&&_0x161a3a[_0x5c6d('0x2e')]!==''?_0x161a3a['calleridname']:_0x5c6d('0x2f');}else{_0x392c2b[_0x5c6d('0x19')]=_0x161a3a[_0x5c6d('0x30')]&&_0x161a3a['destcalleridname']!==_0x5c6d('0x35')?_0x161a3a['destcalleridname']:_0x5c6d('0x2f');}_0x4bb65e=_0x392c2b;_0x4f0705['push'](_0x392c2b);return;}}})['then'](function(){if(_0x260418){emit(_0x161a3a[_0x5c6d('0x25')],_0x55c83d,util['format'](_0x5c6d('0x36'),_0x260418[_0x5c6d('0x37')]),util[_0x5c6d('0x38')]('trigger:%s',_0x5d954d[_0x5c6d('0x39')][_0x5c6d('0x3a')]()),{'evt':_[_0x5c6d('0x3b')](_0x161a3a,{'autoCreate':_0x2745b9}),'contact':_0x4bb65e===undefined?{}:_0x4bb65e,'contacts':_0x4f0705['length']===0x0?undefined:_0x4f0705});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 33ff9f3..07a1180 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 _0xb37e=['contactmanager','integration','exec','voiceExtensions','routeId','urlforward','buildUri','parse','query','replace','AllConditions','every','checkConditions','AnyConditions','some','channel','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','event','queue','membername','lastevent','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','length','interface','action','toLowerCase','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','winArguments','name','merge','jscripty','format','user:%s','trigger:%s'];(function(_0x2d248c,_0x42a3df){var _0xf3820=function(_0x229f26){while(--_0x229f26){_0x2d248c['push'](_0x2d248c['shift']());}};_0xf3820(++_0x42a3df);}(_0xb37e,0x94));var _0xeb37=function(_0x5c58ca,_0x121191){_0x5c58ca=_0x5c58ca-0x0;var _0x44b856=_0xb37e[_0x5c58ca];return _0x44b856;};'use strict';var util=require(_0xeb37('0x0'));var _=require(_0xeb37('0x1'));var url=require(_0xeb37('0x2'));var Mustache=require('mustache');var Redis=require(_0xeb37('0x3'));var urlforward=require(_0xeb37('0x4'));var integration=require(_0xeb37('0x5'));var cmContact=require(_0xeb37('0x6'));var script=require(_0xeb37('0x7'));var config=require(_0xeb37('0x8'));var logger=require(_0xeb37('0x9'))(_0xeb37('0xa'));var ami=require(_0xeb37('0xb'));config[_0xeb37('0xc')]=_[_0xeb37('0xd')](config[_0xeb37('0xc')],{'host':_0xeb37('0xe'),'port':0x18eb});var io=require(_0xeb37('0xf'))(new Redis(config[_0xeb37('0xc')]));var operators={'equals':function(_0x3a9cca,_0x3e80e7){return _0x3a9cca==_0x3e80e7;},'not_equals':function(_0x36d9e1,_0x6e3d17){return _0x36d9e1!=_0x6e3d17;}};var barAndWebActions=[_0xeb37('0x10'),_0xeb37('0x2'),_0xeb37('0x11')];function Trigger(_0x2b63ed){this['triggers']=_0x2b63ed[_0xeb37('0x12')];this['agents']=_0x2b63ed[_0xeb37('0x13')];this['voiceQueues']=_0x2b63ed[_0xeb37('0x14')];this['templates']=_0x2b63ed[_0xeb37('0x15')];this['voiceExtensions']=_0x2b63ed['voiceExtensions'];this['zendeskAccounts']=_0x2b63ed['zendeskAccounts'];this[_0xeb37('0x16')]=_0x2b63ed[_0xeb37('0x16')];this['salesforceAccounts']=_0x2b63ed['salesforceAccounts'];this['sugarcrmAccounts']=_0x2b63ed['sugarcrmAccounts'];this[_0xeb37('0x17')]=_0x2b63ed[_0xeb37('0x17')];this[_0xeb37('0x18')]=_0x2b63ed[_0xeb37('0x18')];this['vtigerAccounts']=_0x2b63ed[_0xeb37('0x19')];this[_0xeb37('0x1a')]=_0x2b63ed['servicenowAccounts'];this[_0xeb37('0x1b')]=_0x2b63ed['dynamics365Accounts'];this[_0xeb37('0x1c')]=_0x2b63ed[_0xeb37('0x1c')];this[_0xeb37('0x1d')]={'zendesk':this[_0xeb37('0x1e')],'salesforce':this[_0xeb37('0x1f')],'freshdesk':this[_0xeb37('0x16')],'sugarcrm':this[_0xeb37('0x20')],'zoho':this[_0xeb37('0x17')],'desk':this[_0xeb37('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xeb37('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xeb37('0x1a')]};ami['on'](_0xeb37('0x21'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x24'),this['syncCustomEvent'][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x25'),this['syncCustomEvent'][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x26'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x27'),this[_0xeb37('0x22')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on']('custom:agentbusy',this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x28'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x29'),this['syncCustomEvent'][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x2a'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x2b'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x2c'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x2d'),this['syncAgentDial'][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x2e'),this[_0xeb37('0x2f')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x30'),this[_0xeb37('0x2f')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x31'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on']('custom:closedinteraction',this[_0xeb37('0x22')]['bind'](this));ami['on'](_0xeb37('0x32'),this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on']('custom:outgoingmessage',this[_0xeb37('0x22')][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x33'),this['syncCustomEvent'][_0xeb37('0x23')](this));ami['on'](_0xeb37('0x34'),this['syncCustomEvent'][_0xeb37('0x23')](this));}Trigger[_0xeb37('0x35')][_0xeb37('0x36')]=function(_0xfee9d5,_0x212473,_0x25dc85){logger[_0xeb37('0x37')](_0xfee9d5,_0x212473,JSON['stringify'](_0x25dc85));io['to'](_0xfee9d5)[_0xeb37('0x36')](_0x212473,_0x25dc85);};Trigger[_0xeb37('0x35')][_0xeb37('0x22')]=function(_0x3f90b8){var _0x35535a=_['clone'](_0x3f90b8);this[_0xeb37('0x38')](_0x35535a);};Trigger[_0xeb37('0x35')][_0xeb37('0x2f')]=function(_0x150e74){if(this['agents'][_0x150e74['interface']]){this[_0xeb37('0x22')](_0x150e74);}};Trigger['prototype'][_0xeb37('0x38')]=function(_0x1268d6){var _0x1d9447;for(var _0x863720 in this['triggers']){if(this[_0xeb37('0x12')][_0xeb37('0x39')](_0x863720)){if(this[_0xeb37('0x12')][_0x863720][_0xeb37('0x3a')]){_0x1d9447=this[_0xeb37('0x3b')](this[_0xeb37('0x12')][_0x863720],_0x1268d6);if(_0x1d9447){_['merge'](_0x1268d6,_0x1268d6[_0xeb37('0x3c')]);for(var _0x776918=0x0,_0x5b595d,_0x102ec7,_0x4070b3;_0x7769180x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x2363c7,_0xa76b23){var _0x2c3dd6=function(_0x36add4){while(--_0x36add4){_0x2363c7['push'](_0x2363c7['shift']());}};_0x2c3dd6(++_0xa76b23);}(_0x55ca,0x126));var _0xa55c=function(_0x3ad737,_0x300131){_0x3ad737=_0x3ad737-0x0;var _0x16c1e2=_0x55ca[_0x3ad737];return _0x16c1e2;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 0b91394..7d5a0d5 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 _0x1060=['remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase','message','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','callDirection','queue','/contacts(','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','format','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','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',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','POST','clientId'];(function(_0x26a1dc,_0x380fb3){var _0x529678=function(_0x2c8c14){while(--_0x2c8c14){_0x26a1dc['push'](_0x26a1dc['shift']());}};_0x529678(++_0x380fb3);}(_0x1060,0xc1));var _0x0106=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1060[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x0106('0x0'));var BPromise=require('bluebird');var rp=require(_0x0106('0x1'));var util=require('util');var intUtil=require(_0x0106('0x2'));var md5=require('md5');var Redis=require(_0x0106('0x3'));var logger=require(_0x0106('0x4'))(_0x0106('0x5'));var config=require(_0x0106('0x6'));config[_0x0106('0x7')]=_['defaults'](config[_0x0106('0x7')],{'host':_0x0106('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0106('0x7')]));function getAuthToken(_0x520b7a,_0x5b4ae4,_0x225a9d){var _0x174f89={'method':_0x0106('0x9'),'uri':_0x5b4ae4,'form':{'client_id':_0x520b7a[_0x0106('0xa')],'resource':_0x520b7a[_0x0106('0xb')],'username':_0x520b7a['username'],'password':_0x520b7a['password'],'grant_type':_0x0106('0xc'),'client_secret':_0x520b7a[_0x0106('0xd')]},'json':!![]};return rp(_0x174f89)[_0x0106('0xe')](function(_0x2eab23){return _0x2eab23[_0x0106('0xf')];})[_0x0106('0x10')](function(_0x55d7ea){logger[_0x0106('0x11')]('['+[_0x225a9d[_0x0106('0x12')]()]+']\x20Wrong\x20credentials!');return _0x55d7ea[_0x0106('0x13')];});}function getUser(_0x1e0900,_0x5879a5,_0x4f1d5c,_0xfe9235,_0x519fe1,_0x5af373){return new BPromise(function(_0x5f2fea,_0x56fe75){return getAuthToken(_0x5879a5,_0xfe9235,_0x5af373)['then'](function(_0x4ae86e){var _0x472e79={'method':'GET','uri':_0x519fe1+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x0106('0x14')+_0x4ae86e,'OData-Version':_0x0106('0x15')},'json':!![]};return rp(_0x472e79);})[_0x0106('0xe')](function(_0x362826){var _0x38dd7e=_0x362826[_0x0106('0x16')];var _0xec8593=![];var _0x30fddd=null;if(!_[_0x0106('0x17')](_0x4f1d5c)){if(intUtil[_0x0106('0x18')](_0x4f1d5c[_0x0106('0x19')])){_0x1e0900['userEmail']=_0x4f1d5c['email'];for(_0x30fddd=0x0;_0x30fddd<_0x38dd7e[_0x0106('0x1a')];_0x30fddd++){if(_0x38dd7e[_0x30fddd][_0x0106('0x1b')]===_0x4f1d5c['email']&&!_0x38dd7e[_0x30fddd][_0x0106('0x1c')]){_0xec8593=!![];logger[_0x0106('0x1d')]('['+[_0x5af373[_0x0106('0x12')]()]+_0x0106('0x1e')+_0x38dd7e[_0x30fddd][_0x0106('0x1f')]+'!');_0x1e0900[_0x0106('0x20')]=_0x38dd7e[_0x30fddd][_0x0106('0x1f')];}}}}if(!_0xec8593){logger[_0x0106('0x1d')]('['+[_0x5af373[_0x0106('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1e0900[_0x0106('0x21')]=_0x5879a5[_0x0106('0x22')];for(_0x30fddd=0x0;_0x30fddd<_0x38dd7e['length'];_0x30fddd++){if(_0x38dd7e[_0x30fddd][_0x0106('0x1b')]===_0x5879a5[_0x0106('0x22')]){_0x1e0900[_0x0106('0x20')]=_0x38dd7e[_0x30fddd][_0x0106('0x1f')];}}}_0x5f2fea(_0x1e0900);})[_0x0106('0x10')](function(_0x554051){_0x56fe75(_0x554051[_0x0106('0x13')]);});});}function createEndUser(_0xea66a6,_0x4927be,_0x50832a,_0x5cace3,_0x51c21b,_0x3442d8){return new BPromise(function(_0x12b41a,_0x368192){return getAuthToken(_0x4927be,_0x50832a,_0x3442d8)[_0x0106('0xe')](function(_0x5d712e){var _0x19d732=_0x3442d8[_0x0106('0x23')]()===_0x0106('0x24')?_0x51c21b[_0x0106('0x25')]:_0x51c21b[_0x0106('0x26')];var _0x2b24db={'method':_0x0106('0x9'),'uri':_0x5cace3+_0x0106('0x27'),'body':{'telephone1':_0x19d732,'fullname':_0x19d732,'firstname':_0x19d732,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0106('0x28')+_0xea66a6['userId']+')'},'headers':{'Authorization':_0x0106('0x14')+_0x5d712e,'OData-Version':_0x0106('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2b24db);})[_0x0106('0xe')](function(_0x897294){var _0x5b93ed=_0x897294[_0x0106('0x29')][_0x0106('0x2a')];var _0x58eafc=_0x5b93ed[_0x0106('0x2b')](_0x5b93ed[_0x0106('0x2c')]('(')+0x1,_0x5b93ed['lastIndexOf'](')'));_0xea66a6[_0x0106('0x2d')]=_0x58eafc;_0x12b41a(_0xea66a6);})[_0x0106('0x10')](function(_0x2e7c92){_0x368192(_0x2e7c92[_0x0106('0x13')]);});});}function getEndUser(_0x576580,_0x275d16,_0x5bdfa2,_0x2af511,_0x552882,_0x508e49){return new BPromise(function(_0x11429e,_0x212036){var _0x456b69=_0x508e49[_0x0106('0x23')]()===_0x0106('0x24')?_0x552882['destcalleridnum']:_0x552882['calleridnum'];return getAuthToken(_0x275d16,_0x5bdfa2,_0x508e49)[_0x0106('0xe')](function(_0x4a974d){var _0x4cda09={'method':_0x0106('0x2e'),'uri':_0x2af511+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x456b69[_0x0106('0x2f')]('+',_0x0106('0x30'))+'\x27','headers':{'Authorization':_0x0106('0x14')+_0x4a974d,'If-None-Match':null,'OData-Version':_0x0106('0x15')},'json':!![]};return rp(_0x4cda09);})[_0x0106('0xe')](function(_0x132c9e){var _0xa842f0=null;if(_0x132c9e){var _0xdeb4d4=_0x132c9e[_0x0106('0x16')];var _0x342ad9=![];for(_0xa842f0=0x0;_0xa842f0<_0xdeb4d4['length'];_0xa842f0++){if(_0xdeb4d4[_0xa842f0][_0x0106('0x31')]===_0x456b69){_0x342ad9=!![];_0x576580[_0x0106('0x2d')]=_0xdeb4d4[_0xa842f0][_0x0106('0x32')];}}if(_0x342ad9){_0x11429e(_0x576580);}else{return createEndUser(_0x576580,_0x275d16,_0x5bdfa2,_0x2af511,_0x552882,_0x508e49)[_0x0106('0xe')](function(_0xf1cdd7){logger[_0x0106('0x1d')]('['+[_0x508e49['toUpperCase']()]+_0x0106('0x33'),_0xf1cdd7[_0x0106('0x2d')]);_0x11429e(_0xf1cdd7);});}}else{return createEndUser(_0x576580,_0x275d16,_0x5bdfa2,_0x2af511,_0x552882,_0x508e49)[_0x0106('0xe')](function(_0x8d5189){logger[_0x0106('0x1d')]('['+[_0x508e49['toUpperCase']()]+_0x0106('0x34'),_0x8d5189[_0x0106('0x2d')]);_0x11429e(_0x8d5189);});}});});}function getCustomFields(_0x53453a,_0x338642,_0x33cdae){var _0x863593={};if(_0x53453a[_0x0106('0x1a')]>0x0){_[_0x0106('0x35')](_0x53453a,function(_0x161067){if(_[_0x0106('0x36')]([_0x0106('0x37'),_0x0106('0x38')],_0x161067[_0x0106('0x39')])&&_0x161067[_0x0106('0x3a')]&&!_0x161067[_0x0106('0x3b')]){var _0x496b43=_0x161067[_0x0106('0x3c')][_0x0106('0x23')]();var _0x41c215=_0x496b43[_0x0106('0x2b')](0x0,_0x496b43[_0x0106('0x3d')]('_'));var _0x4eea4f=_0x496b43[_0x0106('0x2b')](_0x496b43[_0x0106('0x3d')]('_')+0x1);if(_0x41c215===_0x33cdae){_0x863593[_0x4eea4f]=_0x161067[_0x0106('0x3e')];}}});}return _0x863593;}function getTicket(_0x5ca71d,_0x16e5c5,_0x4761d4,_0x25b6fd,_0x58487a,_0x282c70,_0x328d82){return new BPromise(function(_0x10b9c1,_0x117170){var _0xb4c2af;return getAuthToken(_0x16e5c5,_0x4761d4,_0x328d82)['then'](function(_0xb78cb9){if(_0x282c70[_0x0106('0x3f')]==='incident'){_0xb4c2af={'method':_0x0106('0x9'),'uri':_0x25b6fd+_0x0106('0x40'),'body':Object[_0x0106('0x41')]({},{'title':intUtil[_0x0106('0x42')](_0x282c70[_0x0106('0x43')],_0x58487a,'\x20'),'description':intUtil[_0x0106('0x42')](_0x282c70[_0x0106('0x44')],_0x58487a,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x5ca71d['enduserId']+')','ownerid@odata.bind':_0x0106('0x28')+_0x5ca71d[_0x0106('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x282c70[_0x0106('0x45')],_0x58487a,_0x282c70['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0xb78cb9,'OData-Version':_0x0106('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x282c70[_0x0106('0x3f')]===_0x0106('0x46')){_0xb4c2af={'method':_0x0106('0x9'),'uri':_0x25b6fd+_0x0106('0x47'),'body':Object['assign']({},{'subject':intUtil[_0x0106('0x42')](_0x282c70[_0x0106('0x43')],_0x58487a,'\x20'),'phonenumber':String(_0x58487a[_0x0106('0x26')]),'description':intUtil['getString'](_0x282c70[_0x0106('0x44')],_0x58487a,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x5ca71d['enduserId']+')','ownerid@odata.bind':_0x0106('0x28')+_0x5ca71d[_0x0106('0x20')]+')','directioncode':_0x5ca71d[_0x0106('0x48')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5ca71d[_0x0106('0x20')]+')','participationtypemask':_0x5ca71d[_0x0106('0x48')]===_0x0106('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x0106('0x4a')+_0x5ca71d[_0x0106('0x2d')]+')','participationtypemask':_0x5ca71d[_0x0106('0x48')]===_0x0106('0x49')?0x1:0x2}]},getCustomFields(_0x282c70[_0x0106('0x45')],_0x58487a,_0x282c70[_0x0106('0x3f')])),'headers':{'Authorization':_0x0106('0x14')+_0xb78cb9,'OData-Version':_0x0106('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xb4c2af);})[_0x0106('0xe')](function(_0x298329){var _0x573c6d=_0x298329[_0x0106('0x29')][_0x0106('0x2a')];var _0xe60306=_0x573c6d['substring'](_0x573c6d['lastIndexOf']('(')+0x1,_0x573c6d[_0x0106('0x2c')](')'));_0x5ca71d[_0x0106('0x4b')]=_0xe60306;_0x10b9c1(_0x5ca71d);})[_0x0106('0x10')](function(_0x5c4fd6){_0x117170(_0x5c4fd6['message']);});});}function emit(_0x3e2942,_0x6c39f5,_0x5039ed,_0x354bbf){var _0x55a359={'uri':util['format'](_0x0106('0x4c'),_0x3e2942,_0x5039ed,_0x354bbf)};io['to'](util['format'](_0x0106('0x4d'),_0x6c39f5))[_0x0106('0x4e')](_0x0106('0x4f'),_0x55a359);}exports['cs']=function(_0x377056,_0x380353,_0x26f231,_0x4bf91e,_0x2a497a,_0x4423d7,_0x2ca647,_0x53bacf){var _0x3677ea={};_0x4423d7['remoteUri']=intUtil['stripTrailingSlash'](_0x4423d7[_0x0106('0xb')]);_0x4423d7[_0x0106('0x50')]=intUtil[_0x0106('0x51')](_0x4423d7[_0x0106('0x50')]);_0x3677ea[_0x0106('0x48')]=_0x53bacf===_0x0106('0x49')||_0x53bacf===_0x0106('0x52')?_0x0106('0x49'):_0x0106('0x24');var _0x5d7523=util[_0x0106('0x53')]('%s/api/data/v9.0/',_0x4423d7[_0x0106('0xb')]);var _0x1a1e76=util['format'](_0x0106('0x54'),_0x4423d7[_0x0106('0x55')]);var _0x15c1f8=util[_0x0106('0x53')](_0x0106('0x56'),_0x4423d7[_0x0106('0x50')],_0x380353[_0x0106('0x57')],md5(_0x380353[_0x0106('0x57')]));if(_0x2a497a&&_0x2a497a[_0x0106('0x58')]){logger[_0x0106('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x380353[_0x0106('0x59')]=_0x15c1f8;}else if(_0x2ca647&&_0x2ca647[_0x0106('0x5a')]&&_0x2ca647[_0x0106('0x5a')]!==_0x0106('0x5b')){logger[_0x0106('0x1d')](_0x0106('0x5c'),'Recording\x20is\x20enabled!');_0x380353[_0x0106('0x59')]=_0x15c1f8;}else{_0x380353[_0x0106('0x59')]='';}return getUser(_0x3677ea,_0x4423d7,_0x4bf91e,_0x1a1e76,_0x5d7523,_0x53bacf)[_0x0106('0xe')](function(_0x3bbb45){logger[_0x0106('0x1d')]('['+_0x53bacf['toUpperCase']()+_0x0106('0x5d'),_0x3bbb45['userId']);logger[_0x0106('0x1d')]('['+_0x53bacf[_0x0106('0x12')]()+']\x20The\x20User\x20email\x20is:',_0x3bbb45[_0x0106('0x21')]);return getEndUser(_0x3bbb45,_0x4423d7,_0x1a1e76,_0x5d7523,_0x380353,_0x53bacf);})[_0x0106('0xe')](function(_0x29cbad){logger[_0x0106('0x1d')]('['+_0x53bacf[_0x0106('0x12')]()+_0x0106('0x5e'),_0x29cbad[_0x0106('0x2d')]);logger[_0x0106('0x1d')]('['+_0x53bacf[_0x0106('0x12')]()+_0x0106('0x5f'),_0x380353[_0x0106('0x26')]);return getTicket(_0x29cbad,_0x4423d7,_0x1a1e76,_0x5d7523,_0x380353,_0x26f231,_0x53bacf);})['then'](function(_0x31c2c6){logger[_0x0106('0x1d')](util[_0x0106('0x53')]('['+_0x53bacf[_0x0106('0x12')]()+_0x0106('0x60'),_0x26f231[_0x0106('0x3f')],_0x31c2c6[_0x0106('0x4b')]));logger[_0x0106('0x1d')](util['format']('['+_0x53bacf[_0x0106('0x12')]()+_0x0106('0x61'),_0x53bacf));if(_0x53bacf!==_0x0106('0x52')){logger['info']('['+_0x53bacf[_0x0106('0x12')]()+']',_0x0106('0x62'));emit(_0x4423d7[_0x0106('0xb')],_0x4bf91e[_0x0106('0x63')],_0x26f231[_0x0106('0x3f')],_0x31c2c6[_0x0106('0x4b')]);}})[_0x0106('0x10')](function(_0xced84e){logger[_0x0106('0x11')]('['+_0x53bacf[_0x0106('0x12')]()+_0x0106('0x64'),util[_0x0106('0x65')](_0xced84e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc260=['isNil','validateEmail','userEmail','email','length','isdisabled','info','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','replace','value','telephone1','contactid',']\x20Enduser\x20Created!','forEach','includes','string','nameField','customField','indexOf','incident','getString','Subjects','/contacts(','ticketType','phonecall','phonecalls','assign','callDirection','queue','Fields','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','name','request-promise','util','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid'];(function(_0x4c9c61,_0x28ab34){var _0x3064d8=function(_0x5e4fa9){while(--_0x5e4fa9){_0x4c9c61['push'](_0x4c9c61['shift']());}};_0x3064d8(++_0x28ab34);}(_0xc260,0x1a8));var _0x0c26=function(_0xcedf7f,_0x2fb7c1){_0xcedf7f=_0xcedf7f-0x0;var _0x1c2110=_0xc260[_0xcedf7f];return _0x1c2110;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x0c26('0x0'));var util=require(_0x0c26('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x0c26('0x2'))(_0x0c26('0x3'));var config=require('../../../../config/environment');config[_0x0c26('0x4')]=_['defaults'](config[_0x0c26('0x4')],{'host':_0x0c26('0x5'),'port':0x18eb});var io=require(_0x0c26('0x6'))(new Redis(config[_0x0c26('0x4')]));function getAuthToken(_0x558312,_0x32e9f9,_0x35c3be){var _0x2deaaa={'method':_0x0c26('0x7'),'uri':_0x32e9f9,'form':{'client_id':_0x558312[_0x0c26('0x8')],'resource':_0x558312[_0x0c26('0x9')],'username':_0x558312[_0x0c26('0xa')],'password':_0x558312[_0x0c26('0xb')],'grant_type':_0x0c26('0xb'),'client_secret':_0x558312[_0x0c26('0xc')]},'json':!![]};return rp(_0x2deaaa)[_0x0c26('0xd')](function(_0x5ccb29){return _0x5ccb29['access_token'];})[_0x0c26('0xe')](function(_0x266b72){logger[_0x0c26('0xf')]('['+[_0x35c3be[_0x0c26('0x10')]()]+_0x0c26('0x11'));return _0x266b72[_0x0c26('0x12')];});}function getUser(_0x16c0a6,_0x17d18c,_0x7552a5,_0x2a7c76,_0x40d97e,_0x4c7b0e){return new BPromise(function(_0x232825,_0x53862b){return getAuthToken(_0x17d18c,_0x2a7c76,_0x4c7b0e)[_0x0c26('0xd')](function(_0x11f440){var _0x48d05e={'method':_0x0c26('0x13'),'uri':_0x40d97e+_0x0c26('0x14'),'headers':{'Authorization':'Bearer\x20'+_0x11f440,'OData-Version':'4.0'},'json':!![]};return rp(_0x48d05e);})['then'](function(_0x5947a0){var _0x249c0f=_0x5947a0['value'];var _0x24b715=![];var _0x1c5eab=null;if(!_[_0x0c26('0x15')](_0x7552a5)){if(intUtil[_0x0c26('0x16')](_0x7552a5['email'])){_0x16c0a6[_0x0c26('0x17')]=_0x7552a5[_0x0c26('0x18')];for(_0x1c5eab=0x0;_0x1c5eab<_0x249c0f[_0x0c26('0x19')];_0x1c5eab++){if(_0x249c0f[_0x1c5eab]['internalemailaddress']===_0x7552a5[_0x0c26('0x18')]&&!_0x249c0f[_0x1c5eab][_0x0c26('0x1a')]){_0x24b715=!![];logger[_0x0c26('0x1b')]('['+[_0x4c7b0e[_0x0c26('0x10')]()]+']\x20Agent\x20found\x20'+_0x249c0f[_0x1c5eab]['systemuserid']+'!');_0x16c0a6[_0x0c26('0x1c')]=_0x249c0f[_0x1c5eab]['systemuserid'];}}}}if(!_0x24b715){logger['info']('['+[_0x4c7b0e[_0x0c26('0x10')]()]+_0x0c26('0x1d'));_0x16c0a6[_0x0c26('0x17')]=_0x17d18c[_0x0c26('0xa')];for(_0x1c5eab=0x0;_0x1c5eab<_0x249c0f['length'];_0x1c5eab++){if(_0x249c0f[_0x1c5eab]['internalemailaddress']===_0x17d18c[_0x0c26('0xa')]){_0x16c0a6[_0x0c26('0x1c')]=_0x249c0f[_0x1c5eab][_0x0c26('0x1e')];}}}_0x232825(_0x16c0a6);})[_0x0c26('0xe')](function(_0x4df3de){_0x53862b(_0x4df3de[_0x0c26('0x12')]);});});}function createEndUser(_0x4df88a,_0x92224a,_0x90b174,_0x3fbd27,_0x34ce8e,_0x583790){return new BPromise(function(_0x5c6f6b,_0x7c7cd8){return getAuthToken(_0x92224a,_0x90b174,_0x583790)['then'](function(_0x469b69){var _0x2efc29=_0x583790[_0x0c26('0x1f')]()===_0x0c26('0x20')?_0x34ce8e[_0x0c26('0x21')]:_0x34ce8e[_0x0c26('0x22')];var _0xf9c9ec={'method':_0x0c26('0x7'),'uri':_0x3fbd27+_0x0c26('0x23'),'body':{'telephone1':_0x2efc29,'fullname':_0x2efc29,'firstname':_0x2efc29,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0c26('0x24')+_0x4df88a['userId']+')'},'headers':{'Authorization':_0x0c26('0x25')+_0x469b69,'OData-Version':_0x0c26('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf9c9ec);})[_0x0c26('0xd')](function(_0x39b2dd){var _0x5943d8=_0x39b2dd[_0x0c26('0x27')][_0x0c26('0x28')];var _0x38ed15=_0x5943d8[_0x0c26('0x29')](_0x5943d8[_0x0c26('0x2a')]('(')+0x1,_0x5943d8[_0x0c26('0x2a')](')'));_0x4df88a[_0x0c26('0x2b')]=_0x38ed15;_0x5c6f6b(_0x4df88a);})[_0x0c26('0xe')](function(_0x4d09f9){_0x7c7cd8(_0x4d09f9[_0x0c26('0x12')]);});});}function getEndUser(_0x9e78da,_0x5b3da3,_0x418d8c,_0x3e9e1b,_0x47b780,_0x2c1ce5){return new BPromise(function(_0x458529,_0xd7527a){var _0x324195=_0x2c1ce5['toLowerCase']()===_0x0c26('0x20')?_0x47b780['destcalleridnum']:_0x47b780[_0x0c26('0x22')];return getAuthToken(_0x5b3da3,_0x418d8c,_0x2c1ce5)['then'](function(_0x4ed292){var _0x278899={'method':_0x0c26('0x13'),'uri':_0x3e9e1b+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x324195[_0x0c26('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':_0x0c26('0x25')+_0x4ed292,'If-None-Match':null,'OData-Version':_0x0c26('0x26')},'json':!![]};return rp(_0x278899);})[_0x0c26('0xd')](function(_0x25ad81){var _0x2503ce=null;if(_0x25ad81){var _0x4a40fa=_0x25ad81[_0x0c26('0x2d')];var _0x473aae=![];for(_0x2503ce=0x0;_0x2503ce<_0x4a40fa[_0x0c26('0x19')];_0x2503ce++){if(_0x4a40fa[_0x2503ce][_0x0c26('0x2e')]===_0x324195){_0x473aae=!![];_0x9e78da['enduserId']=_0x4a40fa[_0x2503ce][_0x0c26('0x2f')];}}if(_0x473aae){_0x458529(_0x9e78da);}else{return createEndUser(_0x9e78da,_0x5b3da3,_0x418d8c,_0x3e9e1b,_0x47b780,_0x2c1ce5)[_0x0c26('0xd')](function(_0x2fecf9){logger[_0x0c26('0x1b')]('['+[_0x2c1ce5[_0x0c26('0x10')]()]+']\x20Enduser\x20created!',_0x2fecf9[_0x0c26('0x2b')]);_0x458529(_0x2fecf9);});}}else{return createEndUser(_0x9e78da,_0x5b3da3,_0x418d8c,_0x3e9e1b,_0x47b780,_0x2c1ce5)['then'](function(_0x1a8a5b){logger[_0x0c26('0x1b')]('['+[_0x2c1ce5[_0x0c26('0x10')]()]+_0x0c26('0x30'),_0x1a8a5b[_0x0c26('0x2b')]);_0x458529(_0x1a8a5b);});}});});}function getCustomFields(_0x5806e7,_0x4bacf0,_0xdd2a30){var _0x437183={};if(_0x5806e7[_0x0c26('0x19')]>0x0){_[_0x0c26('0x31')](_0x5806e7,function(_0x2fedc4){if(_[_0x0c26('0x32')]([_0x0c26('0x33'),'picklist'],_0x2fedc4['type'])&&_0x2fedc4[_0x0c26('0x34')]&&!_0x2fedc4[_0x0c26('0x35')]){var _0x40ef1b=_0x2fedc4['idField']['toLowerCase']();var _0x13be66=_0x40ef1b[_0x0c26('0x29')](0x0,_0x40ef1b[_0x0c26('0x36')]('_'));var _0x2ca35f=_0x40ef1b[_0x0c26('0x29')](_0x40ef1b['indexOf']('_')+0x1);if(_0x13be66===_0xdd2a30){_0x437183[_0x2ca35f]=_0x2fedc4['content'];}}});}return _0x437183;}function getTicket(_0x32b425,_0x24cdec,_0x516b6b,_0x210c77,_0x58198a,_0x48e2ec,_0x5900c6){return new BPromise(function(_0x30e647,_0x3fce24){var _0x5137c2;return getAuthToken(_0x24cdec,_0x516b6b,_0x5900c6)[_0x0c26('0xd')](function(_0xb86189){if(_0x48e2ec['ticketType']===_0x0c26('0x37')){_0x5137c2={'method':_0x0c26('0x7'),'uri':_0x210c77+'incidents','body':Object['assign']({},{'title':intUtil[_0x0c26('0x38')](_0x48e2ec[_0x0c26('0x39')],_0x58198a,'\x20'),'description':intUtil[_0x0c26('0x38')](_0x48e2ec['Descriptions'],_0x58198a,'\x0a'),'customerid_contact@odata.bind':_0x0c26('0x3a')+_0x32b425['enduserId']+')','ownerid@odata.bind':_0x0c26('0x24')+_0x32b425['userId']+')','caseorigincode':'1'},getCustomFields(_0x48e2ec['Fields'],_0x58198a,_0x48e2ec[_0x0c26('0x3b')])),'headers':{'Authorization':_0x0c26('0x25')+_0xb86189,'OData-Version':_0x0c26('0x26')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x48e2ec[_0x0c26('0x3b')]===_0x0c26('0x3c')){_0x5137c2={'method':_0x0c26('0x7'),'uri':_0x210c77+_0x0c26('0x3d'),'body':Object[_0x0c26('0x3e')]({},{'subject':intUtil[_0x0c26('0x38')](_0x48e2ec[_0x0c26('0x39')],_0x58198a,'\x20'),'phonenumber':String(_0x58198a[_0x0c26('0x22')]),'description':intUtil['getString'](_0x48e2ec['Descriptions'],_0x58198a,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x32b425[_0x0c26('0x2b')]+')','ownerid@odata.bind':_0x0c26('0x24')+_0x32b425['userId']+')','directioncode':_0x32b425[_0x0c26('0x3f')]===_0x0c26('0x40')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0c26('0x24')+_0x32b425[_0x0c26('0x1c')]+')','participationtypemask':_0x32b425[_0x0c26('0x3f')]===_0x0c26('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0x0c26('0x3a')+_0x32b425[_0x0c26('0x2b')]+')','participationtypemask':_0x32b425['callDirection']===_0x0c26('0x40')?0x1:0x2}]},getCustomFields(_0x48e2ec[_0x0c26('0x41')],_0x58198a,_0x48e2ec[_0x0c26('0x3b')])),'headers':{'Authorization':_0x0c26('0x25')+_0xb86189,'OData-Version':_0x0c26('0x26')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5137c2);})[_0x0c26('0xd')](function(_0x14af2b){var _0x3c8312=_0x14af2b[_0x0c26('0x27')][_0x0c26('0x28')];var _0x5c7045=_0x3c8312[_0x0c26('0x29')](_0x3c8312[_0x0c26('0x2a')]('(')+0x1,_0x3c8312[_0x0c26('0x2a')](')'));_0x32b425['ticketId']=_0x5c7045;_0x30e647(_0x32b425);})[_0x0c26('0xe')](function(_0x466bde){_0x3fce24(_0x466bde[_0x0c26('0x12')]);});});}function emit(_0x26949c,_0x292258,_0x1c98c7,_0x2c7c61){var _0x3dbf41={'uri':util[_0x0c26('0x42')](_0x0c26('0x43'),_0x26949c,_0x1c98c7,_0x2c7c61)};io['to'](util[_0x0c26('0x42')](_0x0c26('0x44'),_0x292258))['emit'](_0x0c26('0x45'),_0x3dbf41);}exports['cs']=function(_0x4c6c80,_0x176221,_0x401dd8,_0x35ff50,_0x3895d8,_0x1f9063,_0x1e2dfe,_0x392d86){var _0x14b5ee={};_0x1f9063[_0x0c26('0x9')]=intUtil[_0x0c26('0x46')](_0x1f9063['remoteUri']);_0x1f9063[_0x0c26('0x47')]=intUtil[_0x0c26('0x46')](_0x1f9063[_0x0c26('0x47')]);_0x14b5ee[_0x0c26('0x3f')]=_0x392d86==='queue'||_0x392d86===_0x0c26('0x48')?_0x0c26('0x40'):'outbound';var _0x3ff56c=util['format'](_0x0c26('0x49'),_0x1f9063[_0x0c26('0x9')]);var _0x86af74=util['format'](_0x0c26('0x4a'),_0x1f9063[_0x0c26('0x4b')]);var _0x5a3e0a=util['format'](_0x0c26('0x4c'),_0x1f9063['serverUrl'],_0x176221[_0x0c26('0x4d')],md5(_0x176221[_0x0c26('0x4d')]));if(_0x3895d8&&_0x3895d8[_0x0c26('0x4e')]){logger[_0x0c26('0x1b')]('[QUEUE]','Recording\x20is\x20enabled!');_0x176221['recordingURL']=_0x5a3e0a;}else if(_0x1e2dfe&&_0x1e2dfe[_0x0c26('0x4f')]&&_0x1e2dfe['recordingFormat']!==_0x0c26('0x50')){logger[_0x0c26('0x1b')](_0x0c26('0x51'),_0x0c26('0x52'));_0x176221[_0x0c26('0x53')]=_0x5a3e0a;}else{_0x176221[_0x0c26('0x53')]='';}return getUser(_0x14b5ee,_0x1f9063,_0x35ff50,_0x86af74,_0x3ff56c,_0x392d86)['then'](function(_0x485f44){logger[_0x0c26('0x1b')]('['+_0x392d86[_0x0c26('0x10')]()+_0x0c26('0x54'),_0x485f44[_0x0c26('0x1c')]);logger[_0x0c26('0x1b')]('['+_0x392d86[_0x0c26('0x10')]()+_0x0c26('0x55'),_0x485f44[_0x0c26('0x17')]);return getEndUser(_0x485f44,_0x1f9063,_0x86af74,_0x3ff56c,_0x176221,_0x392d86);})[_0x0c26('0xd')](function(_0x4e80e2){logger[_0x0c26('0x1b')]('['+_0x392d86[_0x0c26('0x10')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x4e80e2[_0x0c26('0x2b')]);logger['info']('['+_0x392d86[_0x0c26('0x10')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x176221[_0x0c26('0x22')]);return getTicket(_0x4e80e2,_0x1f9063,_0x86af74,_0x3ff56c,_0x176221,_0x401dd8,_0x392d86);})['then'](function(_0x3cceb9){logger[_0x0c26('0x1b')](util[_0x0c26('0x42')]('['+_0x392d86[_0x0c26('0x10')]()+_0x0c26('0x56'),_0x401dd8[_0x0c26('0x3b')],_0x3cceb9[_0x0c26('0x57')]));logger['info'](util[_0x0c26('0x42')]('['+_0x392d86[_0x0c26('0x10')]()+']\x20Call\x20direction:\x20%s',_0x392d86));if(_0x392d86!==_0x0c26('0x48')){logger[_0x0c26('0x1b')]('['+_0x392d86['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1f9063[_0x0c26('0x9')],_0x35ff50[_0x0c26('0x58')],_0x401dd8['ticketType'],_0x3cceb9['ticketId']);}})[_0x0c26('0xe')](function(_0x34192f){logger[_0x0c26('0xf')]('['+_0x392d86[_0x0c26('0x10')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x34192f,{'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 ba75afa..bab6f32 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 _0xa039=['calleridname','calleridnum','Subjects','getString','Descriptions','
','Fields','custom_fields','mapValues','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','includes','string','nameField','customField','toLowerCase','content','picklist','idField','push','type','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Ticket\x20ID\x20is:','catch','unmanaged','toUpperCase','lastevent','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','application/json','emit','info','merge','format'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0xa039,0x15c));var _0x9a03=function(_0x36090a,_0x285e8f){_0x36090a=_0x36090a-0x0;var _0x1fd0ef=_0xa039[_0x36090a];return _0x1fd0ef;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9a03('0x0'));var util=require(_0x9a03('0x1'));var Redis=require(_0x9a03('0x2'));var intUtil=require(_0x9a03('0x3'));var config=require(_0x9a03('0x4'));var logger=require('../../../../config/logger')(_0x9a03('0x5'));config[_0x9a03('0x6')]=_['defaults'](config[_0x9a03('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x9a03('0x7'),'Accept':_0x9a03('0x7')};function emit(_0x5d353c,_0x5a620b,_0x35bc7f){io['to'](_0x5d353c)[_0x9a03('0x8')](_0x5a620b,_0x35bc7f);}function getTicket(_0x141a7c,_0x90f26e,_0x347dba,_0x576ff8,_0x14af7c){logger[_0x9a03('0x9')]('Creating\x20new\x20ticket...');var _0x2f1784=_[_0x9a03('0xa')]({'responder_id':_0x90f26e['id'],'requester_id':_0x347dba['id'],'name':util[_0x9a03('0xb')]('Caller\x20-\x20%s',_0x14af7c[_0x9a03('0xc')]),'phone':_0x14af7c[_0x9a03('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x576ff8[_0x9a03('0xe')],_0x14af7c,'\x20'),'description':intUtil[_0x9a03('0xf')](_0x576ff8[_0x9a03('0x10')],_0x14af7c,_0x9a03('0x11')),'tags':getTags(_0x576ff8['Tags'],'name')},getCustomFields(_0x576ff8[_0x9a03('0x12')],_0x14af7c));_0x2f1784[_0x9a03('0x13')]=_[_0x9a03('0x14')](_['keyBy'](_0x2f1784['custom_fields'],'id'),'value');return request({'uri':util[_0x9a03('0xb')](_0x9a03('0x15'),_0x141a7c[_0x9a03('0x16')]),'method':_0x9a03('0x17'),'body':_0x2f1784})[_0x9a03('0x18')](function(_0x157f82){logger[_0x9a03('0x9')](_0x9a03('0x19'));return _0x157f82;});}function getUser(_0x56888e,_0x52d4f2){if(intUtil[_0x9a03('0x1a')](_0x52d4f2)){return request({'uri':util['format'](_0x9a03('0x1b'),_0x56888e[_0x9a03('0x16')]),'qs':{'email':_0x52d4f2}})[_0x9a03('0x18')](function(_0x315894){if(_0x315894['length']){logger[_0x9a03('0x9')](_0x9a03('0x1c'));return _['find'](_0x315894,function(_0x9c2d18){return _0x9c2d18['contact'][_0x9a03('0x1d')]===_0x52d4f2;});}else{logger[_0x9a03('0x9')](_0x9a03('0x1e'));return request({'uri':util[_0x9a03('0xb')](_0x9a03('0x1f'),_0x56888e[_0x9a03('0x16')])})[_0x9a03('0x18')](function(_0xa0fc64){logger[_0x9a03('0x9')](_0x9a03('0x20'));return _0xa0fc64;});}});}else{logger[_0x9a03('0x9')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9a03('0xb')](_0x9a03('0x1f'),_0x56888e[_0x9a03('0x16')])})[_0x9a03('0x18')](function(_0x3ff6bc){logger[_0x9a03('0x9')](_0x9a03('0x20'));return _0x3ff6bc;});}}function getEndUser(_0x3d9aa4,_0x3ca88f,_0x9a6952){logger[_0x9a03('0x9')](_0x9a03('0x21'),_0x9a6952);return request({'uri':util[_0x9a03('0xb')](_0x9a03('0x22'),_0x3d9aa4['remoteUri']),'qs':{'phone':_0x9a6952}})[_0x9a03('0x18')](function(_0x1a4e0a){if(_0x1a4e0a[_0x9a03('0x23')]){logger[_0x9a03('0x9')](_0x9a03('0x24'));return _[_0x9a03('0x25')](_0x1a4e0a,{'phone':_0x9a6952});}else{logger[_0x9a03('0x9')](_0x9a03('0x26'));return request({'uri':util[_0x9a03('0xb')](_0x9a03('0x22'),_0x3d9aa4[_0x9a03('0x16')]),'method':'POST','body':{'name':_0x3ca88f,'phone':_0x9a6952}})[_0x9a03('0x18')](function(_0x57ef85){logger['info']('Enduser\x20created.');return _0x57ef85;});}});}function getAuth(_0x44acb5){return util['format'](_0x9a03('0x27'),new Buffer(_0x44acb5[_0x9a03('0x28')]+':X')[_0x9a03('0x29')](_0x9a03('0x2a')));}function request(_0x5f1c31){logger[_0x9a03('0x2b')](_0x9a03('0x2c'),JSON[_0x9a03('0x2d')](_0x5f1c31));return rp(_[_0x9a03('0x2e')](_0x5f1c31,{'method':_0x9a03('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x3d555d,_0x1790a6){var _0x115b5e=[];if(_0x3d555d&&_0x3d555d['length']>0x0){_0x115b5e=_[_0x9a03('0x30')](_0x3d555d,_0x1790a6);}return _0x115b5e;}function getCustomFields(_0x5e6d4f,_0x5f8a9a){var _0x2faa7f=[];var _0x5e6f74={'custom_fields':[]};if(_0x5e6d4f[_0x9a03('0x23')]>0x0){_['forEach'](_0x5e6d4f,function(_0x5afa72){if(_[_0x9a03('0x31')]([_0x9a03('0x32'),'picklist'],_0x5afa72['type'])&&_0x5afa72[_0x9a03('0x33')]&&!_0x5afa72[_0x9a03('0x34')]){_0x5e6f74[_0x5afa72[_0x9a03('0x33')][_0x9a03('0x35')]()]=_0x5afa72[_0x9a03('0x36')]['toString']();}else if(_['includes']([_0x9a03('0x32'),_0x9a03('0x37')],_0x5afa72['type'])&&_0x5afa72[_0x9a03('0x38')]&&_0x5afa72[_0x9a03('0x34')]){_0x5e6f74[_0x9a03('0x13')][_0x9a03('0x39')]({'id':_0x5afa72[_0x9a03('0x38')],'value':_0x5afa72[_0x9a03('0x36')][_0x9a03('0x29')]()});}else if(_0x5afa72[_0x9a03('0x3a')]===_0x9a03('0x3b')&&_0x5afa72[_0x9a03('0x3c')]&&_0x5afa72['idField']&&_0x5afa72[_0x9a03('0x34')]){_0x5f8a9a[_0x5afa72[_0x9a03('0x3c')]]&&_0x5e6f74[_0x9a03('0x13')]['push']({'id':_0x5afa72[_0x9a03('0x38')],'value':_0x5f8a9a[_0x5afa72['variableName']][_0x9a03('0x29')]()});}else if(_0x5afa72[_0x9a03('0x3a')]===_0x9a03('0x3d')&&_0x5afa72[_0x9a03('0x3e')]&&_0x5afa72[_0x9a03('0x3e')][_0x9a03('0x3f')]&&_0x5afa72['idField']&&_0x5afa72[_0x9a03('0x34')]){_0x5f8a9a[_0x5afa72[_0x9a03('0x3e')][_0x9a03('0x3f')][_0x9a03('0x35')]()]&&_0x5e6f74['custom_fields']['push']({'id':_0x5afa72[_0x9a03('0x38')],'value':_0x5f8a9a[_0x5afa72[_0x9a03('0x3e')]['name']['toLowerCase']()][_0x9a03('0x29')]()});}});}return _0x5e6f74;}exports[_0x9a03('0x40')]=function(_0x249140,_0x4b742a,_0x59be62,_0x3ae740,_0x2188cb,_0x39d920){var _0x5dcf42,_0x258831;_0x39d920[_0x9a03('0x16')]=intUtil[_0x9a03('0x41')](_0x39d920[_0x9a03('0x16')]);_0x39d920['serverUrl']=intUtil[_0x9a03('0x41')](_0x39d920[_0x9a03('0x42')]);if(_0x2188cb&&_0x2188cb[_0x9a03('0x43')]){logger[_0x9a03('0x9')](_0x9a03('0x44'),'Recording\x20is\x20enabled!');_0x4b742a[_0x9a03('0x45')]=util['format'](_0x9a03('0x46'),_0x39d920[_0x9a03('0x42')],_0x4b742a[_0x9a03('0x47')],md5(_0x4b742a[_0x9a03('0x47')]));}else{_0x4b742a[_0x9a03('0x45')]='';}headers[_0x9a03('0x48')]=getAuth(_0x39d920);return getUser(_0x39d920,_0x3ae740['email'])[_0x9a03('0x18')](function(_0xeea835){_0x5dcf42=_0xeea835;logger[_0x9a03('0x9')](_0x9a03('0x49'),_0x5dcf42['id']);return getEndUser(_0x39d920,_0x4b742a[_0x9a03('0xc')],_0x4b742a[_0x9a03('0xd')]);})[_0x9a03('0x18')](function(_0x119a1d){_0x258831=_0x119a1d;logger['info'](_0x9a03('0x4a'),_0x258831['id']);return getTicket(_0x39d920,_0x5dcf42,_0x258831,_0x59be62,_0x4b742a);})[_0x9a03('0x18')](function(_0x3503cd){if(_0x3503cd&&_0x3503cd['id']){logger[_0x9a03('0x9')]('Ticket\x20created!');logger[_0x9a03('0x9')]('The\x20Ticket\x20ID\x20is:',_0x3503cd['id']);logger[_0x9a03('0x9')](_0x9a03('0x44'),_0x9a03('0x4b'));emit(util[_0x9a03('0xb')](_0x9a03('0x4c'),_0x3ae740[_0x9a03('0x3f')]),_0x9a03('0x4d'),{'uri':util[_0x9a03('0xb')](_0x9a03('0x4e'),_0x39d920[_0x9a03('0x16')],_0x3503cd['id'])});}})['catch'](function(_0x5f0d64){logger[_0x9a03('0x4f')]('[QUEUE]',JSON[_0x9a03('0x2d')](_0x5f0d64));});};exports[_0x9a03('0x50')]=function(_0x37df1a,_0x698ed0,_0x2df4e4,_0x501d76,_0x37b7ac,_0x4709d1,_0x18c074){var _0x302fb1,_0xa862e8;_0x4709d1['remoteUri']=intUtil[_0x9a03('0x41')](_0x4709d1[_0x9a03('0x16')]);_0x4709d1['serverUrl']=intUtil['stripTrailingSlash'](_0x4709d1[_0x9a03('0x42')]);if(_0x18c074&&_0x18c074[_0x9a03('0x51')]&&_0x18c074['recordingFormat']!=='none'){logger[_0x9a03('0x9')](_0x9a03('0x52'),_0x9a03('0x53'));_0x698ed0[_0x9a03('0x45')]=util[_0x9a03('0xb')](_0x9a03('0x46'),_0x4709d1[_0x9a03('0x42')],_0x698ed0[_0x9a03('0x47')],md5(_0x698ed0[_0x9a03('0x47')]));}headers[_0x9a03('0x48')]=getAuth(_0x4709d1);return getUser(_0x4709d1,_0x501d76[_0x9a03('0x1d')])[_0x9a03('0x18')](function(_0x18f868){_0x302fb1=_0x18f868;logger[_0x9a03('0x9')](_0x9a03('0x49'),_0x302fb1['id']);return getEndUser(_0x4709d1,_0x698ed0['destcalleridname'],_0x698ed0[_0x9a03('0x54')]);})[_0x9a03('0x18')](function(_0x5e69de){_0xa862e8=_0x5e69de;logger['info'](_0x9a03('0x4a'),_0xa862e8['id']);return getTicket(_0x4709d1,_0x302fb1,_0xa862e8,_0x2df4e4,_0x698ed0);})[_0x9a03('0x18')](function(_0x5ef7c6){if(_0x5ef7c6&&_0x5ef7c6['id']){logger[_0x9a03('0x9')]('Ticket\x20created!');logger[_0x9a03('0x9')](_0x9a03('0x55'),_0x5ef7c6['id']);logger[_0x9a03('0x9')](_0x9a03('0x52'),_0x9a03('0x4b'));emit(util[_0x9a03('0xb')]('user:%s',_0x501d76[_0x9a03('0x3f')]),_0x9a03('0x4d'),{'uri':util[_0x9a03('0xb')](_0x9a03('0x4e'),_0x4709d1[_0x9a03('0x16')],_0x5ef7c6['id'])});}})[_0x9a03('0x56')](function(_0x456498){logger[_0x9a03('0x4f')](_0x9a03('0x52'),JSON[_0x9a03('0x2d')](_0x456498));});};exports[_0x9a03('0x57')]=function(_0x4a8788,_0x39eea7,_0x39f262,_0x204bfa,_0x164952,_0x5956e4){var _0x583498,_0x2c0a5e;_0x5956e4[_0x9a03('0x16')]=intUtil[_0x9a03('0x41')](_0x5956e4[_0x9a03('0x16')]);_0x5956e4['serverUrl']=intUtil[_0x9a03('0x41')](_0x5956e4[_0x9a03('0x42')]);if(_0x164952&&_0x164952[_0x9a03('0x43')]){logger[_0x9a03('0x9')]('['+_0x39eea7['lastevent'][_0x9a03('0x58')]()+']',_0x9a03('0x53'));_0x39eea7['recordingURL']=util[_0x9a03('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5956e4['serverUrl'],_0x39eea7[_0x9a03('0x47')],md5(_0x39eea7[_0x9a03('0x47')]));}else{_0x39eea7[_0x9a03('0x45')]='';}headers[_0x9a03('0x48')]=getAuth(_0x5956e4);return getUser(_0x5956e4,'')[_0x9a03('0x18')](function(_0x16839f){_0x583498=_0x16839f;logger['info'](_0x9a03('0x49'),_0x583498['id']);return getEndUser(_0x5956e4,_0x39eea7[_0x9a03('0xc')],_0x39eea7[_0x9a03('0xd')]);})[_0x9a03('0x18')](function(_0x2fbda4){_0x2c0a5e=_0x2fbda4;logger['info'](_0x9a03('0x4a'),_0x2c0a5e['id']);return getTicket(_0x5956e4,_0x583498,_0x2c0a5e,_0x39f262,_0x39eea7);})[_0x9a03('0x18')](function(_0x69e804){if(_0x69e804){logger[_0x9a03('0x9')](_0x9a03('0x19'));logger[_0x9a03('0x9')]('The\x20Ticket\x20ID\x20is:',_0x69e804['id']);}})[_0x9a03('0x56')](function(_0x30d530){logger[_0x9a03('0x4f')]('['+_0x39eea7[_0x9a03('0x59')][_0x9a03('0x58')]()+']',JSON[_0x9a03('0x2d')](_0x30d530));});}; \ No newline at end of file +var _0x4626=['merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','value','%s/api/v2/tickets','POST','then','validateEmail','%s/api/v2/agents','remoteUri','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','includes','string','type','nameField','customField','toLowerCase','picklist','push','content','variable','variableName','idField','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Ticket\x20created!','user:%s','trigger:browser:url','lastevent','toUpperCase','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','info'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4626,0xaa));var _0x6462=function(_0x3f0d63,_0xf7c6df){_0x3f0d63=_0x3f0d63-0x0;var _0x4c6d00=_0x4626[_0x3f0d63];return _0x4c6d00;};'use strict';var _=require(_0x6462('0x0'));var rp=require('request-promise');var md5=require(_0x6462('0x1'));var util=require(_0x6462('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6462('0x3'));var config=require(_0x6462('0x4'));var logger=require(_0x6462('0x5'))(_0x6462('0x6'));config[_0x6462('0x7')]=_[_0x6462('0x8')](config[_0x6462('0x7')],{'host':_0x6462('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6462('0x7')]));var headers={'Content-Type':_0x6462('0xa'),'Accept':_0x6462('0xa')};function emit(_0x126135,_0x491fe0,_0x3fefe0){io['to'](_0x126135)['emit'](_0x491fe0,_0x3fefe0);}function getTicket(_0x1f8c4b,_0x4bee27,_0x20bf69,_0x14e373,_0x10a500){logger[_0x6462('0xb')]('Creating\x20new\x20ticket...');var _0xb5f849=_[_0x6462('0xc')]({'responder_id':_0x4bee27['id'],'requester_id':_0x20bf69['id'],'name':util[_0x6462('0xd')](_0x6462('0xe'),_0x10a500[_0x6462('0xf')]),'phone':_0x10a500[_0x6462('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6462('0x11')](_0x14e373[_0x6462('0x12')],_0x10a500,'\x20'),'description':intUtil[_0x6462('0x11')](_0x14e373[_0x6462('0x13')],_0x10a500,_0x6462('0x14')),'tags':getTags(_0x14e373[_0x6462('0x15')],_0x6462('0x16'))},getCustomFields(_0x14e373['Fields'],_0x10a500));_0xb5f849[_0x6462('0x17')]=_[_0x6462('0x18')](_['keyBy'](_0xb5f849[_0x6462('0x17')],'id'),_0x6462('0x19'));return request({'uri':util[_0x6462('0xd')](_0x6462('0x1a'),_0x1f8c4b['remoteUri']),'method':_0x6462('0x1b'),'body':_0xb5f849})[_0x6462('0x1c')](function(_0x4f832b){logger[_0x6462('0xb')]('Ticket\x20created!');return _0x4f832b;});}function getUser(_0x2b6483,_0x5e6fbc){if(intUtil[_0x6462('0x1d')](_0x5e6fbc)){return request({'uri':util[_0x6462('0xd')](_0x6462('0x1e'),_0x2b6483[_0x6462('0x1f')]),'qs':{'email':_0x5e6fbc}})[_0x6462('0x1c')](function(_0x13940f){if(_0x13940f['length']){logger[_0x6462('0xb')](_0x6462('0x20'));return _[_0x6462('0x21')](_0x13940f,function(_0x4f43a1){return _0x4f43a1['contact'][_0x6462('0x22')]===_0x5e6fbc;});}else{logger[_0x6462('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6462('0xd')](_0x6462('0x23'),_0x2b6483[_0x6462('0x1f')])})[_0x6462('0x1c')](function(_0xfdf7da){logger[_0x6462('0xb')](_0x6462('0x24'));return _0xfdf7da;});}});}else{logger[_0x6462('0xb')](_0x6462('0x25'));return request({'uri':util[_0x6462('0xd')](_0x6462('0x23'),_0x2b6483[_0x6462('0x1f')])})[_0x6462('0x1c')](function(_0x4459b3){logger[_0x6462('0xb')]('Admin\x20account\x20selected.');return _0x4459b3;});}}function getEndUser(_0x5bbc51,_0x45cedc,_0x4d7a28){logger[_0x6462('0xb')](_0x6462('0x26'),_0x4d7a28);return request({'uri':util[_0x6462('0xd')](_0x6462('0x27'),_0x5bbc51[_0x6462('0x1f')]),'qs':{'phone':_0x4d7a28}})[_0x6462('0x1c')](function(_0x4c820c){if(_0x4c820c[_0x6462('0x28')]){logger[_0x6462('0xb')](_0x6462('0x29'));return _[_0x6462('0x21')](_0x4c820c,{'phone':_0x4d7a28});}else{logger[_0x6462('0xb')](_0x6462('0x2a'));return request({'uri':util[_0x6462('0xd')](_0x6462('0x27'),_0x5bbc51[_0x6462('0x1f')]),'method':_0x6462('0x1b'),'body':{'name':_0x45cedc,'phone':_0x4d7a28}})[_0x6462('0x1c')](function(_0x4c63c3){logger[_0x6462('0xb')]('Enduser\x20created.');return _0x4c63c3;});}});}function getAuth(_0xe5a11f){return util[_0x6462('0xd')](_0x6462('0x2b'),new Buffer(_0xe5a11f[_0x6462('0x2c')]+':X')[_0x6462('0x2d')](_0x6462('0x2e')));}function request(_0x1c3939){logger[_0x6462('0x2f')](_0x6462('0x30'),JSON['stringify'](_0x1c3939));return rp(_[_0x6462('0x8')](_0x1c3939,{'method':_0x6462('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2222d5,_0x25aa0d){var _0x1d1f10=[];if(_0x2222d5&&_0x2222d5[_0x6462('0x28')]>0x0){_0x1d1f10=_[_0x6462('0x32')](_0x2222d5,_0x25aa0d);}return _0x1d1f10;}function getCustomFields(_0x4a0fd4,_0x50e6cd){var _0x46154d=[];var _0x5bc1c6={'custom_fields':[]};if(_0x4a0fd4[_0x6462('0x28')]>0x0){_['forEach'](_0x4a0fd4,function(_0x144b81){if(_[_0x6462('0x33')]([_0x6462('0x34'),'picklist'],_0x144b81[_0x6462('0x35')])&&_0x144b81[_0x6462('0x36')]&&!_0x144b81[_0x6462('0x37')]){_0x5bc1c6[_0x144b81['nameField'][_0x6462('0x38')]()]=_0x144b81['content'][_0x6462('0x2d')]();}else if(_[_0x6462('0x33')](['string',_0x6462('0x39')],_0x144b81[_0x6462('0x35')])&&_0x144b81['idField']&&_0x144b81['customField']){_0x5bc1c6['custom_fields'][_0x6462('0x3a')]({'id':_0x144b81['idField'],'value':_0x144b81[_0x6462('0x3b')][_0x6462('0x2d')]()});}else if(_0x144b81['type']===_0x6462('0x3c')&&_0x144b81[_0x6462('0x3d')]&&_0x144b81[_0x6462('0x3e')]&&_0x144b81[_0x6462('0x37')]){_0x50e6cd[_0x144b81[_0x6462('0x3d')]]&&_0x5bc1c6[_0x6462('0x17')]['push']({'id':_0x144b81[_0x6462('0x3e')],'value':_0x50e6cd[_0x144b81[_0x6462('0x3d')]]['toString']()});}else if(_0x144b81[_0x6462('0x35')]===_0x6462('0x3f')&&_0x144b81['Variable']&&_0x144b81[_0x6462('0x40')][_0x6462('0x16')]&&_0x144b81[_0x6462('0x3e')]&&_0x144b81['customField']){_0x50e6cd[_0x144b81['Variable'][_0x6462('0x16')][_0x6462('0x38')]()]&&_0x5bc1c6[_0x6462('0x17')][_0x6462('0x3a')]({'id':_0x144b81[_0x6462('0x3e')],'value':_0x50e6cd[_0x144b81[_0x6462('0x40')][_0x6462('0x16')]['toLowerCase']()]['toString']()});}});}return _0x5bc1c6;}exports['queue']=function(_0x48ccd3,_0x4d2420,_0x3a85eb,_0xe0d397,_0x562622,_0x51b108){var _0x16a15a,_0x549f1d;_0x51b108['remoteUri']=intUtil[_0x6462('0x41')](_0x51b108[_0x6462('0x1f')]);_0x51b108['serverUrl']=intUtil[_0x6462('0x41')](_0x51b108[_0x6462('0x42')]);if(_0x562622&&_0x562622[_0x6462('0x43')]){logger['info'](_0x6462('0x44'),_0x6462('0x45'));_0x4d2420['recordingURL']=util[_0x6462('0xd')](_0x6462('0x46'),_0x51b108['serverUrl'],_0x4d2420[_0x6462('0x47')],md5(_0x4d2420[_0x6462('0x47')]));}else{_0x4d2420[_0x6462('0x48')]='';}headers[_0x6462('0x49')]=getAuth(_0x51b108);return getUser(_0x51b108,_0xe0d397[_0x6462('0x22')])[_0x6462('0x1c')](function(_0x208bdf){_0x16a15a=_0x208bdf;logger[_0x6462('0xb')](_0x6462('0x4a'),_0x16a15a['id']);return getEndUser(_0x51b108,_0x4d2420['calleridname'],_0x4d2420[_0x6462('0x10')]);})[_0x6462('0x1c')](function(_0x5eb342){_0x549f1d=_0x5eb342;logger[_0x6462('0xb')](_0x6462('0x4b'),_0x549f1d['id']);return getTicket(_0x51b108,_0x16a15a,_0x549f1d,_0x3a85eb,_0x4d2420);})['then'](function(_0x92e89c){if(_0x92e89c&&_0x92e89c['id']){logger[_0x6462('0xb')]('Ticket\x20created!');logger['info'](_0x6462('0x4c'),_0x92e89c['id']);logger['info'](_0x6462('0x44'),_0x6462('0x4d'));emit(util[_0x6462('0xd')]('user:%s',_0xe0d397[_0x6462('0x16')]),'trigger:browser:url',{'uri':util['format'](_0x6462('0x4e'),_0x51b108['remoteUri'],_0x92e89c['id'])});}})[_0x6462('0x4f')](function(_0x4f5c88){logger[_0x6462('0x50')]('[QUEUE]',JSON[_0x6462('0x51')](_0x4f5c88));});};exports['outbound']=function(_0x3d5ab4,_0x503a64,_0x1e2ddd,_0x304d1e,_0x46c7fb,_0x2637a8,_0x53366f){var _0x1b7286,_0x2eb563;_0x2637a8['remoteUri']=intUtil['stripTrailingSlash'](_0x2637a8[_0x6462('0x1f')]);_0x2637a8['serverUrl']=intUtil[_0x6462('0x41')](_0x2637a8[_0x6462('0x42')]);if(_0x53366f&&_0x53366f[_0x6462('0x52')]&&_0x53366f['recordingFormat']!==_0x6462('0x53')){logger['info'](_0x6462('0x54'),_0x6462('0x45'));_0x503a64[_0x6462('0x48')]=util[_0x6462('0xd')](_0x6462('0x46'),_0x2637a8['serverUrl'],_0x503a64[_0x6462('0x47')],md5(_0x503a64['uniqueid']));}headers[_0x6462('0x49')]=getAuth(_0x2637a8);return getUser(_0x2637a8,_0x304d1e[_0x6462('0x22')])[_0x6462('0x1c')](function(_0x779749){_0x1b7286=_0x779749;logger['info']('The\x20User\x20ID\x20is:',_0x1b7286['id']);return getEndUser(_0x2637a8,_0x503a64['destcalleridname'],_0x503a64[_0x6462('0x55')]);})[_0x6462('0x1c')](function(_0x5ef26e){_0x2eb563=_0x5ef26e;logger[_0x6462('0xb')](_0x6462('0x4b'),_0x2eb563['id']);return getTicket(_0x2637a8,_0x1b7286,_0x2eb563,_0x1e2ddd,_0x503a64);})[_0x6462('0x1c')](function(_0x3f23fd){if(_0x3f23fd&&_0x3f23fd['id']){logger[_0x6462('0xb')](_0x6462('0x56'));logger['info'](_0x6462('0x4c'),_0x3f23fd['id']);logger[_0x6462('0xb')](_0x6462('0x54'),_0x6462('0x4d'));emit(util['format'](_0x6462('0x57'),_0x304d1e[_0x6462('0x16')]),_0x6462('0x58'),{'uri':util['format'](_0x6462('0x4e'),_0x2637a8['remoteUri'],_0x3f23fd['id'])});}})[_0x6462('0x4f')](function(_0x40ca1f){logger[_0x6462('0x50')]('[OUTBOUND]',JSON['stringify'](_0x40ca1f));});};exports['unmanaged']=function(_0xe7853e,_0x4f8319,_0x3a908a,_0x58740d,_0x51495f,_0x222c6c){var _0x4a5715,_0x242f0a;_0x222c6c[_0x6462('0x1f')]=intUtil[_0x6462('0x41')](_0x222c6c[_0x6462('0x1f')]);_0x222c6c['serverUrl']=intUtil[_0x6462('0x41')](_0x222c6c[_0x6462('0x42')]);if(_0x51495f&&_0x51495f['monitor_format']){logger[_0x6462('0xb')]('['+_0x4f8319[_0x6462('0x59')][_0x6462('0x5a')]()+']',_0x6462('0x45'));_0x4f8319[_0x6462('0x48')]=util['format'](_0x6462('0x46'),_0x222c6c['serverUrl'],_0x4f8319[_0x6462('0x47')],md5(_0x4f8319[_0x6462('0x47')]));}else{_0x4f8319[_0x6462('0x48')]='';}headers[_0x6462('0x49')]=getAuth(_0x222c6c);return getUser(_0x222c6c,'')[_0x6462('0x1c')](function(_0x25b0c9){_0x4a5715=_0x25b0c9;logger[_0x6462('0xb')](_0x6462('0x4a'),_0x4a5715['id']);return getEndUser(_0x222c6c,_0x4f8319[_0x6462('0xf')],_0x4f8319['calleridnum']);})[_0x6462('0x1c')](function(_0x42a7c5){_0x242f0a=_0x42a7c5;logger[_0x6462('0xb')](_0x6462('0x4b'),_0x242f0a['id']);return getTicket(_0x222c6c,_0x4a5715,_0x242f0a,_0x3a908a,_0x4f8319);})['then'](function(_0x8f7c2f){if(_0x8f7c2f){logger[_0x6462('0xb')](_0x6462('0x56'));logger[_0x6462('0xb')]('The\x20Ticket\x20ID\x20is:',_0x8f7c2f['id']);}})[_0x6462('0x4f')](function(_0x22a6cd){logger[_0x6462('0x50')]('['+_0x4f8319['lastevent'][_0x6462('0x5a')]()+']',JSON[_0x6462('0x51')](_0x22a6cd));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 1575d9b..ed1bb28 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb232=['defaults','redis','GET','/api/selector/owners','headers','info','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','then','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','unmanaged','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales'];(function(_0x2a8af3,_0x274b6d){var _0xf50332=function(_0x4d37f1){while(--_0x4d37f1){_0x2a8af3['push'](_0x2a8af3['shift']());}};_0xf50332(++_0x274b6d);}(_0xb232,0x19b));var _0x2b23=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xb232[_0x3a60b8];return _0x4eb583;};'use strict';var _=require(_0x2b23('0x0'));var rp=require(_0x2b23('0x1'));var md5=require('md5');var util=require(_0x2b23('0x2'));var moment=require(_0x2b23('0x3'));var Promise=require(_0x2b23('0x4'));var Redis=require(_0x2b23('0x5'));var intUtil=require(_0x2b23('0x6'));var config=require(_0x2b23('0x7'));var logger=require('../../../../config/logger')(_0x2b23('0x8'));config['redis']=_[_0x2b23('0x9')](config[_0x2b23('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2b23('0xa')]));function getAdminId(_0x502269,_0x2988e6,_0x1099be,_0x90f121){return new Promise(function(_0x52d6ef,_0x116a16){var _0x4eff3d=![];var _0x337a87={'method':_0x2b23('0xb'),'uri':_0x90f121+_0x2b23('0xc'),'json':!![]};_0x337a87[_0x2b23('0xd')]=_0x1099be;logger[_0x2b23('0xe')]('Getting\x20admin\x20information');return rp(_0x337a87)['then'](function(_0x6d31fe){if(_0x6d31fe){var _0x5daeec=_0x6d31fe['users'];var _0x37ef0c=null;for(_0x37ef0c=0x0;_0x37ef0c<_0x5daeec[_0x2b23('0xf')];_0x37ef0c++){if(_0x5daeec[_0x37ef0c][_0x2b23('0x10')]===_0x502269[_0x2b23('0x11')]){_0x502269['adminId']=_0x5daeec[_0x37ef0c]['id'];_0x4eff3d=!![];}}if(_0x4eff3d){logger[_0x2b23('0xe')](_0x2b23('0x12'),_0x502269[_0x2b23('0x13')]);_0x52d6ef(_0x502269);}else{_0x116a16({'statusCode':0x194,'message':_0x2b23('0x14')});}}else{_0x116a16({'statusCode':0x194,'message':_0x2b23('0x14')});}})['catch'](function(_0x1c7c1f){logger[_0x2b23('0x15')]('['+[_0x2988e6[_0x2b23('0x16')]()]+']',_0x1c7c1f[_0x2b23('0x17')]);_0x116a16(_0x1c7c1f);});});}function getUser(_0x521fba,_0x5623f6,_0x33d987){return function(_0xcb8c73){return new Promise(function(_0x4787d3,_0x364e04){var _0x335299={'method':'GET','uri':_0x33d987+'/api/selector/owners','json':!![]};_0x335299[_0x2b23('0xd')]=_0x5623f6;logger[_0x2b23('0xe')](_0x2b23('0x18'));return rp(_0x335299)['then'](function(_0x5c34c0){if(_0x5c34c0){var _0x2c6ff6=_0x5c34c0['users'];var _0x811967=![];var _0x2f461a=null;if(_0xcb8c73[_0x2b23('0x19')]!==null){logger[_0x2b23('0xe')](_0x2b23('0x1a'),_0xcb8c73['agentEmail']);_0xcb8c73[_0x2b23('0x1b')]=_0xcb8c73['agentEmail'];for(_0x2f461a=0x0;_0x2f461a<_0x2c6ff6[_0x2b23('0xf')];_0x2f461a++){if(_0x2c6ff6[_0x2f461a][_0x2b23('0x10')]===_0xcb8c73['agentEmail']){_0x811967=!![];_0xcb8c73[_0x2b23('0x1c')]=_0x2c6ff6[_0x2f461a]['id'];logger[_0x2b23('0xe')](_0x2b23('0x1d'),_0xcb8c73['userId']);}}}if(!_0x811967){logger[_0x2b23('0xe')](_0x2b23('0x1e'));_0xcb8c73[_0x2b23('0x1b')]=_0xcb8c73[_0x2b23('0x11')];_0xcb8c73[_0x2b23('0x1c')]=_0xcb8c73['adminId'];_0x811967=!![];}if(_0x811967){_0x4787d3(_0xcb8c73);}else{_0x364e04({'statusCode':0x194,'message':_0x2b23('0x14')});}}else{_0x364e04({'statusCode':0x194,'message':_0x2b23('0x14')});}})[_0x2b23('0x1f')](function(_0x406ed9){logger['error']('['+[_0x521fba['toUpperCase']()]+']',_0x406ed9[_0x2b23('0x17')]);_0x364e04(_0x406ed9);});});};}function searchContact(_0x5b91d8,_0x1a890e,_0x4cfb2e,_0x48aa1e){return new Promise(function(_0x40c29c,_0x2638dc){var _0x10793f={'method':_0x2b23('0xb'),'headers':_0x1a890e,'uri':_0x5b91d8+_0x2b23('0x20')+_0x48aa1e+_0x2b23('0x21')+_0x4cfb2e+_0x2b23('0x22'),'json':!![]};rp(_0x10793f)['then'](function(_0x38ec00){var _0xc42dd1=_[_0x2b23('0x23')](_0x38ec00[_0x2b23('0x24')]['contacts'],[_0x4cfb2e,_0x48aa1e]);_0x40c29c(_0xc42dd1);})[_0x2b23('0x1f')](function(_0x5a8562){_0x2638dc(_0x5a8562);});});}function getEndUser(_0x3cc4b0,_0x4c91aa,_0x3f591a){return function(_0x33ffd3){return new Promise(function(_0x5ab555,_0x5a237b){logger[_0x2b23('0xe')](util[_0x2b23('0x25')](_0x2b23('0x26'),_0x33ffd3['contactNumber']));searchContact(_0x3f591a,_0x4c91aa,_0x2b23('0x27'),_0x33ffd3[_0x2b23('0x28')])[_0x2b23('0x29')](function(_0x6e2289){if(_0x6e2289){_0x33ffd3[_0x2b23('0x2a')]=_0x6e2289['id'];logger[_0x2b23('0xe')](_0x2b23('0x2b'),_0x33ffd3[_0x2b23('0x2a')]);return _0x5ab555(_0x33ffd3);}searchContact(_0x3f591a,_0x4c91aa,_0x2b23('0x2c'),_0x33ffd3[_0x2b23('0x28')])[_0x2b23('0x29')](function(_0x4a3a0d){if(_0x4a3a0d){_0x33ffd3['endUserId']=_0x4a3a0d['id'];logger[_0x2b23('0xe')]('Contact\x20found\x20work_number:',_0x33ffd3[_0x2b23('0x2a')]);return _0x5ab555(_0x33ffd3);}createEndUser(_0x33ffd3,_0x3cc4b0,_0x4c91aa,_0x3f591a)[_0x2b23('0x29')](function(_0x99a9c9){logger[_0x2b23('0xe')](_0x2b23('0x2d'),_0x99a9c9[_0x2b23('0x2a')]);return _0x5ab555(_0x99a9c9);});});})['catch'](function(_0x2ecfaa){_0x5a237b(_0x2ecfaa);});});};}function createEndUser(_0x974555,_0x43a3b9,_0x569157,_0x506906){return new Promise(function(_0x37220a,_0x544074){var _0xa47530=moment();var _0xecdf11={'method':_0x2b23('0x2e'),'uri':_0x506906+_0x2b23('0x2f'),'body':{'contact':{'last_name':_0x974555['contactNumber'],'work_number':_0x974555[_0x2b23('0x28')],'mobile_number':_0x974555[_0x2b23('0x28')],'owner_id':_0x974555[_0x2b23('0x1c')],'created_at':_0xa47530[_0x2b23('0x25')](_0x2b23('0x30'))}},'json':!![]};_0xecdf11[_0x2b23('0xd')]=_0x569157;logger['info'](_0x2b23('0x31'));return rp(_0xecdf11)[_0x2b23('0x29')](function(_0x503054){_0x974555[_0x2b23('0x2a')]=_0x503054[_0x2b23('0x32')]['id'];_0x37220a(_0x974555);})[_0x2b23('0x1f')](function(_0x3c9460){logger['error']('['+[_0x43a3b9[_0x2b23('0x16')]()]+']',_0x3c9460[_0x2b23('0x17')]);_0x544074(_0x3c9460['message']);});});}function getTicket(_0x4f0111,_0x6de1d3,_0x13b4e3,_0x4c5016,_0x21b96d){return function(_0xa1d79c){logger[_0x2b23('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x52e1ac,_0x434a02){var _0x2ae5bb=moment();var _0x14f7db={'method':_0x2b23('0x2e'),'uri':_0x13b4e3+_0x2b23('0x33'),'body':{'title':intUtil[_0x2b23('0x34')](_0x4c5016[_0x2b23('0x35')],_0x21b96d,'\x20'),'description':intUtil[_0x2b23('0x34')](_0x4c5016['Descriptions'],_0x21b96d,'\x0a'),'owner_id':_0xa1d79c[_0x2b23('0x1c')],'creater_id':_0xa1d79c['adminId'],'targetable_id':_0xa1d79c[_0x2b23('0x2a')],'targetable_type':_0x2b23('0x36'),'created_at':_0x2ae5bb[_0x2b23('0x25')](_0x2b23('0x30')),'due_date':_0x2ae5bb[_0x2b23('0x37')](0x1e,'m')['format'](_0x2b23('0x30'))},'json':!![]};_0x14f7db[_0x2b23('0xd')]=_0x6de1d3;return rp(_0x14f7db)[_0x2b23('0x29')](function(_0x4d26fa){_0xa1d79c[_0x2b23('0x38')]=_0x4d26fa[_0x2b23('0x39')]['id'];logger[_0x2b23('0xe')](_0x2b23('0x3a'),_0xa1d79c['ticketId']);_0x52e1ac(_0xa1d79c);})['catch'](function(_0x541794){logger['error']('['+[_0x4f0111['toUpperCase']()]+']',_0x541794[_0x2b23('0x17')]);_0x434a02(_0x541794[_0x2b23('0x17')]);});});};}function emit(_0x24bb96,_0x1ba4ae,_0xf756a0){var _0x4895c7={'uri':_0x24bb96+_0x2b23('0x3b')+_0xf756a0};io['to'](util[_0x2b23('0x25')](_0x2b23('0x3c'),_0x1ba4ae))[_0x2b23('0x3d')](_0x2b23('0x3e'),_0x4895c7);}exports['cs']=function(_0x4c9e7a,_0x320bb0,_0x3f5c72,_0xab7cd,_0x51e385,_0x39cdfb,_0x38f38c,_0x3c74d1){var _0x286d43={};var _0x301ac4={'Authorization':_0x2b23('0x3f')+_0x39cdfb[_0x2b23('0x40')]};_0x39cdfb[_0x2b23('0x41')]=intUtil['stripTrailingSlash'](_0x39cdfb[_0x2b23('0x41')]);_0x39cdfb[_0x2b23('0x42')]=intUtil[_0x2b23('0x43')](_0x39cdfb[_0x2b23('0x42')]);var _0x43a976=_0x39cdfb[_0x2b23('0x41')];_0x286d43[_0x2b23('0x11')]=_0x39cdfb[_0x2b23('0x44')];_0x286d43[_0x2b23('0x28')]=_0x3c74d1[_0x2b23('0x45')]()===_0x2b23('0x46')?_0x320bb0[_0x2b23('0x47')]:_0x320bb0['calleridnum'];_0x286d43[_0x2b23('0x48')]=_0x3c74d1===_0x2b23('0x49')||_0x3c74d1==='unmanaged'?'queue':_0x2b23('0x46');if(_0xab7cd){_0x286d43[_0x2b23('0x19')]=_0xab7cd[_0x2b23('0x10')];}var _0x404122=util[_0x2b23('0x25')](_0x2b23('0x4a'),_0x39cdfb[_0x2b23('0x42')],_0x320bb0[_0x2b23('0x4b')],md5(_0x320bb0[_0x2b23('0x4b')]));if(_0x51e385&&_0x51e385['monitor_format']){logger['info']('[QUEUE]',_0x2b23('0x4c'));_0x320bb0[_0x2b23('0x4d')]=_0x404122;}else if(_0x38f38c&&_0x38f38c[_0x2b23('0x4e')]&&_0x38f38c[_0x2b23('0x4e')]!=='none'){logger[_0x2b23('0xe')](_0x2b23('0x4f'),_0x2b23('0x4c'));_0x320bb0[_0x2b23('0x4d')]=_0x404122;}else{_0x320bb0[_0x2b23('0x4d')]='';}return getAdminId(_0x286d43,_0x3c74d1,_0x301ac4,_0x43a976)[_0x2b23('0x29')](getUser(_0x3c74d1,_0x301ac4,_0x43a976))[_0x2b23('0x29')](getEndUser(_0x3c74d1,_0x301ac4,_0x43a976))[_0x2b23('0x29')](getTicket(_0x3c74d1,_0x301ac4,_0x43a976,_0x3f5c72,_0x320bb0))[_0x2b23('0x29')](function(_0x4e5869){logger[_0x2b23('0xe')](util[_0x2b23('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4e5869['ticketId']));if(_0x3c74d1!==_0x2b23('0x50')){logger[_0x2b23('0xe')]('['+[_0x3c74d1[_0x2b23('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x43a976,_0xab7cd[_0x2b23('0x51')],_0x4e5869[_0x2b23('0x2a')]);}})[_0x2b23('0x1f')](function(_0x23d6f0){logger[_0x2b23('0x15')]('['+[_0x3c74d1[_0x2b23('0x16')]()]+_0x2b23('0x52'),util[_0x2b23('0x53')](_0x23d6f0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe936=['headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','add','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','user:%s','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners'];(function(_0x2956a8,_0x5d3b18){var _0x6a54c4=function(_0x156f9e){while(--_0x156f9e){_0x2956a8['push'](_0x2956a8['shift']());}};_0x6a54c4(++_0x5d3b18);}(_0xe936,0xf6));var _0x6e93=function(_0x15781b,_0x4db9bb){_0x15781b=_0x15781b-0x0;var _0x20f955=_0xe936[_0x15781b];return _0x20f955;};'use strict';var _=require('lodash');var rp=require(_0x6e93('0x0'));var md5=require(_0x6e93('0x1'));var util=require(_0x6e93('0x2'));var moment=require(_0x6e93('0x3'));var Promise=require(_0x6e93('0x4'));var Redis=require(_0x6e93('0x5'));var intUtil=require(_0x6e93('0x6'));var config=require('../../../../config/environment');var logger=require(_0x6e93('0x7'))(_0x6e93('0x8'));config[_0x6e93('0x9')]=_[_0x6e93('0xa')](config[_0x6e93('0x9')],{'host':_0x6e93('0xb'),'port':0x18eb});var io=require(_0x6e93('0xc'))(new Redis(config[_0x6e93('0x9')]));function getAdminId(_0x260966,_0x532f6a,_0x18a414,_0x462c16){return new Promise(function(_0x3a8d86,_0x238347){var _0x3b7b58=![];var _0x321aec={'method':_0x6e93('0xd'),'uri':_0x462c16+_0x6e93('0xe'),'json':!![]};_0x321aec[_0x6e93('0xf')]=_0x18a414;logger[_0x6e93('0x10')](_0x6e93('0x11'));return rp(_0x321aec)[_0x6e93('0x12')](function(_0x5e8299){if(_0x5e8299){var _0x3c89de=_0x5e8299[_0x6e93('0x13')];var _0x51cd1b=null;for(_0x51cd1b=0x0;_0x51cd1b<_0x3c89de['length'];_0x51cd1b++){if(_0x3c89de[_0x51cd1b][_0x6e93('0x14')]===_0x260966[_0x6e93('0x15')]){_0x260966['adminId']=_0x3c89de[_0x51cd1b]['id'];_0x3b7b58=!![];}}if(_0x3b7b58){logger['info'](_0x6e93('0x16'),_0x260966[_0x6e93('0x17')]);_0x3a8d86(_0x260966);}else{_0x238347({'statusCode':0x194,'message':_0x6e93('0x18')});}}else{_0x238347({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x6e93('0x19')](function(_0x498623){logger[_0x6e93('0x1a')]('['+[_0x532f6a['toUpperCase']()]+']',_0x498623[_0x6e93('0x1b')]);_0x238347(_0x498623);});});}function getUser(_0x54aab1,_0x3b81d7,_0x24a111){return function(_0x290fa7){return new Promise(function(_0x1f565b,_0x1fde89){var _0x399398={'method':'GET','uri':_0x24a111+_0x6e93('0xe'),'json':!![]};_0x399398['headers']=_0x3b81d7;logger['info'](_0x6e93('0x1c'));return rp(_0x399398)[_0x6e93('0x12')](function(_0x4fb97e){if(_0x4fb97e){var _0x3d65f3=_0x4fb97e['users'];var _0x20e451=![];var _0x408952=null;if(_0x290fa7[_0x6e93('0x1d')]!==null){logger['info'](_0x6e93('0x1e'),_0x290fa7['agentEmail']);_0x290fa7[_0x6e93('0x1f')]=_0x290fa7['agentEmail'];for(_0x408952=0x0;_0x408952<_0x3d65f3[_0x6e93('0x20')];_0x408952++){if(_0x3d65f3[_0x408952]['email']===_0x290fa7[_0x6e93('0x1d')]){_0x20e451=!![];_0x290fa7[_0x6e93('0x21')]=_0x3d65f3[_0x408952]['id'];logger['info'](_0x6e93('0x22'),_0x290fa7['userId']);}}}if(!_0x20e451){logger['info'](_0x6e93('0x23'));_0x290fa7[_0x6e93('0x1f')]=_0x290fa7[_0x6e93('0x15')];_0x290fa7['userId']=_0x290fa7[_0x6e93('0x17')];_0x20e451=!![];}if(_0x20e451){_0x1f565b(_0x290fa7);}else{_0x1fde89({'statusCode':0x194,'message':_0x6e93('0x18')});}}else{_0x1fde89({'statusCode':0x194,'message':_0x6e93('0x18')});}})[_0x6e93('0x19')](function(_0x5c9383){logger[_0x6e93('0x1a')]('['+[_0x54aab1['toUpperCase']()]+']',_0x5c9383['message']);_0x1fde89(_0x5c9383);});});};}function searchContact(_0x37d154,_0x58f897,_0x9320,_0x551111){return new Promise(function(_0xb7ef0f,_0x3fa6d4){var _0x1f8dbe={'method':_0x6e93('0xd'),'headers':_0x58f897,'uri':_0x37d154+_0x6e93('0x24')+_0x551111+_0x6e93('0x25')+_0x9320+_0x6e93('0x26'),'json':!![]};rp(_0x1f8dbe)['then'](function(_0x34ca6e){var _0x543375=_[_0x6e93('0x27')](_0x34ca6e[_0x6e93('0x28')][_0x6e93('0x28')],[_0x9320,_0x551111]);_0xb7ef0f(_0x543375);})[_0x6e93('0x19')](function(_0x474a79){_0x3fa6d4(_0x474a79);});});}function getEndUser(_0x438d39,_0x44456f,_0x1130a4){return function(_0x4fe97e){return new Promise(function(_0x3bc41a,_0x5580d0){logger['info'](util[_0x6e93('0x29')](_0x6e93('0x2a'),_0x4fe97e[_0x6e93('0x2b')]));searchContact(_0x1130a4,_0x44456f,_0x6e93('0x2c'),_0x4fe97e[_0x6e93('0x2b')])[_0x6e93('0x12')](function(_0x3ed34e){if(_0x3ed34e){_0x4fe97e[_0x6e93('0x2d')]=_0x3ed34e['id'];logger[_0x6e93('0x10')](_0x6e93('0x2e'),_0x4fe97e[_0x6e93('0x2d')]);return _0x3bc41a(_0x4fe97e);}searchContact(_0x1130a4,_0x44456f,_0x6e93('0x2f'),_0x4fe97e[_0x6e93('0x2b')])['then'](function(_0x59fada){if(_0x59fada){_0x4fe97e[_0x6e93('0x2d')]=_0x59fada['id'];logger['info'](_0x6e93('0x30'),_0x4fe97e[_0x6e93('0x2d')]);return _0x3bc41a(_0x4fe97e);}createEndUser(_0x4fe97e,_0x438d39,_0x44456f,_0x1130a4)['then'](function(_0x22040a){logger[_0x6e93('0x10')]('Contact\x20created:',_0x22040a['endUserId']);return _0x3bc41a(_0x22040a);});});})[_0x6e93('0x19')](function(_0x1d898c){_0x5580d0(_0x1d898c);});});};}function createEndUser(_0x3a2df4,_0x2cc3bc,_0x2087c3,_0x55ef6e){return new Promise(function(_0x2bf254,_0x43f2f7){var _0x2677dc=moment();var _0x532acb={'method':'POST','uri':_0x55ef6e+_0x6e93('0x31'),'body':{'contact':{'last_name':_0x3a2df4[_0x6e93('0x2b')],'work_number':_0x3a2df4[_0x6e93('0x2b')],'mobile_number':_0x3a2df4['contactNumber'],'owner_id':_0x3a2df4[_0x6e93('0x21')],'created_at':_0x2677dc[_0x6e93('0x29')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x532acb[_0x6e93('0xf')]=_0x2087c3;logger[_0x6e93('0x10')](_0x6e93('0x32'));return rp(_0x532acb)[_0x6e93('0x12')](function(_0x2e763e){_0x3a2df4[_0x6e93('0x2d')]=_0x2e763e[_0x6e93('0x33')]['id'];_0x2bf254(_0x3a2df4);})[_0x6e93('0x19')](function(_0x183222){logger[_0x6e93('0x1a')]('['+[_0x2cc3bc[_0x6e93('0x34')]()]+']',_0x183222[_0x6e93('0x1b')]);_0x43f2f7(_0x183222[_0x6e93('0x1b')]);});});}function getTicket(_0x10324e,_0xe994d4,_0x42af38,_0x4a5c3c,_0x4ae2ac){return function(_0x191ead){logger['info'](_0x6e93('0x35'));return new Promise(function(_0x1f72e4,_0x4e6062){var _0x1a1909=moment();var _0x36b2f3={'method':_0x6e93('0x36'),'uri':_0x42af38+_0x6e93('0x37'),'body':{'title':intUtil[_0x6e93('0x38')](_0x4a5c3c[_0x6e93('0x39')],_0x4ae2ac,'\x20'),'description':intUtil[_0x6e93('0x38')](_0x4a5c3c[_0x6e93('0x3a')],_0x4ae2ac,'\x0a'),'owner_id':_0x191ead[_0x6e93('0x21')],'creater_id':_0x191ead[_0x6e93('0x17')],'targetable_id':_0x191ead['endUserId'],'targetable_type':'Contact','created_at':_0x1a1909[_0x6e93('0x29')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1a1909[_0x6e93('0x3b')](0x1e,'m')[_0x6e93('0x29')](_0x6e93('0x3c'))},'json':!![]};_0x36b2f3[_0x6e93('0xf')]=_0xe994d4;return rp(_0x36b2f3)[_0x6e93('0x12')](function(_0x425655){_0x191ead['ticketId']=_0x425655[_0x6e93('0x3d')]['id'];logger[_0x6e93('0x10')](_0x6e93('0x3e'),_0x191ead[_0x6e93('0x3f')]);_0x1f72e4(_0x191ead);})['catch'](function(_0x33bd6a){logger[_0x6e93('0x1a')]('['+[_0x10324e[_0x6e93('0x34')]()]+']',_0x33bd6a[_0x6e93('0x1b')]);_0x4e6062(_0x33bd6a[_0x6e93('0x1b')]);});});};}function emit(_0x502481,_0x330dd2,_0x28e5ff){var _0x2d4fbb={'uri':_0x502481+'/contacts/'+_0x28e5ff};io['to'](util[_0x6e93('0x29')](_0x6e93('0x40'),_0x330dd2))['emit']('trigger:browser:url',_0x2d4fbb);}exports['cs']=function(_0x6a64e9,_0x44a8d4,_0x393e69,_0x248b7b,_0x42c6b4,_0xdadae3,_0x178eb1,_0x4803cb){var _0x32950a={};var _0x1f9f04={'Authorization':_0x6e93('0x41')+_0xdadae3[_0x6e93('0x42')]};_0xdadae3[_0x6e93('0x43')]=intUtil[_0x6e93('0x44')](_0xdadae3[_0x6e93('0x43')]);_0xdadae3['serverUrl']=intUtil[_0x6e93('0x44')](_0xdadae3[_0x6e93('0x45')]);var _0x432e0b=_0xdadae3[_0x6e93('0x43')];_0x32950a['adminEmail']=_0xdadae3[_0x6e93('0x46')];_0x32950a[_0x6e93('0x2b')]=_0x4803cb[_0x6e93('0x47')]()==='outbound'?_0x44a8d4['destcalleridnum']:_0x44a8d4[_0x6e93('0x48')];_0x32950a['callDirection']=_0x4803cb===_0x6e93('0x49')||_0x4803cb===_0x6e93('0x4a')?_0x6e93('0x49'):'outbound';if(_0x248b7b){_0x32950a[_0x6e93('0x1d')]=_0x248b7b[_0x6e93('0x14')];}var _0x561b24=util[_0x6e93('0x29')](_0x6e93('0x4b'),_0xdadae3['serverUrl'],_0x44a8d4[_0x6e93('0x4c')],md5(_0x44a8d4['uniqueid']));if(_0x42c6b4&&_0x42c6b4[_0x6e93('0x4d')]){logger[_0x6e93('0x10')](_0x6e93('0x4e'),_0x6e93('0x4f'));_0x44a8d4[_0x6e93('0x50')]=_0x561b24;}else if(_0x178eb1&&_0x178eb1['recordingFormat']&&_0x178eb1['recordingFormat']!==_0x6e93('0x51')){logger[_0x6e93('0x10')]('[OUTBOUND]',_0x6e93('0x4f'));_0x44a8d4[_0x6e93('0x50')]=_0x561b24;}else{_0x44a8d4[_0x6e93('0x50')]='';}return getAdminId(_0x32950a,_0x4803cb,_0x1f9f04,_0x432e0b)[_0x6e93('0x12')](getUser(_0x4803cb,_0x1f9f04,_0x432e0b))[_0x6e93('0x12')](getEndUser(_0x4803cb,_0x1f9f04,_0x432e0b))['then'](getTicket(_0x4803cb,_0x1f9f04,_0x432e0b,_0x393e69,_0x44a8d4))['then'](function(_0x451e71){logger[_0x6e93('0x10')](util['format'](_0x6e93('0x52'),_0x451e71['ticketId']));if(_0x4803cb!==_0x6e93('0x4a')){logger[_0x6e93('0x10')]('['+[_0x4803cb[_0x6e93('0x34')]()]+']',_0x6e93('0x53'));emit(_0x432e0b,_0x248b7b[_0x6e93('0x54')],_0x451e71[_0x6e93('0x2d')]);}})[_0x6e93('0x19')](function(_0x21472f){logger[_0x6e93('0x1a')]('['+[_0x4803cb[_0x6e93('0x34')]()]+_0x6e93('0x55'),util[_0x6e93('0x56')](_0x21472f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index e1ec2ae..1334665 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 _0x9bd9=['zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','zendesk','sugarcrm','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk'];(function(_0x172125,_0x32beca){var _0x23da35=function(_0x184432){while(--_0x184432){_0x172125['push'](_0x172125['shift']());}};_0x23da35(++_0x32beca);}(_0x9bd9,0x8e));var _0x99bd=function(_0x35c4e8,_0x18ff04){_0x35c4e8=_0x35c4e8-0x0;var _0x4a958a=_0x9bd9[_0x35c4e8];return _0x4a958a;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var zendesk=require(_0x99bd('0x2'));var salesforce=require(_0x99bd('0x3'));var sugarcrm=require(_0x99bd('0x4'));var freshdesk=require(_0x99bd('0x5'));var zoho=require(_0x99bd('0x6'));var desk=require(_0x99bd('0x7'));var vtiger=require(_0x99bd('0x8'));var servicenow=require(_0x99bd('0x9'));var dynamics365=require(_0x99bd('0xa'));var freshsales=require(_0x99bd('0xb'));var integrations=['zendesk',_0x99bd('0xc'),'sugarcrm',_0x99bd('0xd'),_0x99bd('0xe'),'desk',_0x99bd('0xf'),_0x99bd('0x10'),_0x99bd('0x11'),_0x99bd('0x12')];exports[_0x99bd('0x13')]=function(_0x1bb0c4,_0x46fb1e,_0x12e372,_0x30b4ed,_0x9f1c54,_0x1d1526){if(_0x12e372){if(_[_0x99bd('0x14')](integrations,_0x1bb0c4[_0x99bd('0x15')][_0x99bd('0x16')]())){try{var _0xc4f52e=null;var _0x261e25='';var _0x51a594=_0x12e372[_0x1bb0c4['data1'][_0x99bd('0x16')]()];if(_0x51a594){var _0x1e4ed1=_0x51a594[_0x1bb0c4['data2']];if(_0x1e4ed1){var _0x4a1c07=_['find'](_0x1e4ed1[_0x99bd('0x17')],{'id':parseInt(_0x1bb0c4[_0x99bd('0x18')],0xa)});if(_0x4a1c07){if(_0x30b4ed){if(_0x9f1c54&&_0x46fb1e[_0x99bd('0x19')]){_0x261e25=_0x99bd('0x19');}else if(_0x46fb1e[_0x99bd('0x1a')]){_0x261e25='outbound';}else{console['log'](_0x99bd('0x1b'),_0x46fb1e);}}else{_0x261e25=_0x99bd('0x1c');}switch(_0x1bb0c4[_0x99bd('0x15')][_0x99bd('0x16')]()){case _0x99bd('0x1d'):zendesk[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case _0x99bd('0xc'):salesforce[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case _0x99bd('0x1e'):sugarcrm[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case _0x99bd('0xd'):freshdesk[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case'zoho':zoho[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case'desk':desk[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case'vtiger':vtiger[_0x261e25](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526);break;case _0x99bd('0x11'):freshsales['cs'](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526,_0x261e25);break;case _0x99bd('0x12'):servicenow['cs'](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526,_0x261e25);break;case _0x99bd('0x10'):dynamics365['cs'](_0x1bb0c4,_0x46fb1e,_0x4a1c07,_0x30b4ed,_0x9f1c54,_0x1e4ed1,_0x1d1526,_0x261e25);break;default:console[_0x99bd('0x1f')](_0x99bd('0x20'));}}else{_0xc4f52e=require(_0x99bd('0x21'))(_0x1bb0c4[_0x99bd('0x15')][_0x99bd('0x16')]());_0xc4f52e[_0x99bd('0x22')](_0x99bd('0x23'),util[_0x99bd('0x24')](_0x99bd('0x25'),_0x1bb0c4[_0x99bd('0x15')][_0x99bd('0x16')](),_0x1bb0c4[_0x99bd('0x18')]));}}else{_0xc4f52e=require(_0x99bd('0x21'))(_0x1bb0c4[_0x99bd('0x15')][_0x99bd('0x16')]());_0xc4f52e['error'](_0x99bd('0x23'),util[_0x99bd('0x24')](_0x99bd('0x26'),_0x1bb0c4['data1'][_0x99bd('0x16')](),_0x1bb0c4['data2']));}}else{}}catch(_0x1dbbe5){console['error'](_0x1dbbe5);}}}}; \ No newline at end of file +var _0x867d=['../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','freshdesk','servicenow','unknown\x20integration'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x867d,0x13d));var _0xd867=function(_0x3f1879,_0x1b74d1){_0x3f1879=_0x3f1879-0x0;var _0x3b8674=_0x867d[_0x3f1879];return _0x3b8674;};'use strict';var _=require(_0xd867('0x0'));var util=require(_0xd867('0x1'));var zendesk=require(_0xd867('0x2'));var salesforce=require(_0xd867('0x3'));var sugarcrm=require(_0xd867('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xd867('0x5'));var desk=require(_0xd867('0x6'));var vtiger=require(_0xd867('0x7'));var servicenow=require(_0xd867('0x8'));var dynamics365=require(_0xd867('0x9'));var freshsales=require(_0xd867('0xa'));var integrations=[_0xd867('0xb'),'salesforce',_0xd867('0xc'),'freshdesk',_0xd867('0xd'),_0xd867('0xe'),_0xd867('0xf'),_0xd867('0x10'),_0xd867('0x11'),'servicenow'];exports[_0xd867('0x12')]=function(_0x38dff2,_0x405fb0,_0x5207fc,_0x50f1ae,_0x3cb499,_0x5e11d6){if(_0x5207fc){if(_[_0xd867('0x13')](integrations,_0x38dff2[_0xd867('0x14')]['toLowerCase']())){try{var _0x25f237=null;var _0x360d11='';var _0x54f1a5=_0x5207fc[_0x38dff2[_0xd867('0x14')][_0xd867('0x15')]()];if(_0x54f1a5){var _0x274e05=_0x54f1a5[_0x38dff2[_0xd867('0x16')]];if(_0x274e05){var _0x1d4dae=_[_0xd867('0x17')](_0x274e05['Configurations'],{'id':parseInt(_0x38dff2[_0xd867('0x18')],0xa)});if(_0x1d4dae){if(_0x50f1ae){if(_0x3cb499&&_0x405fb0['queue']){_0x360d11=_0xd867('0x19');}else if(_0x405fb0[_0xd867('0x1a')]){_0x360d11=_0xd867('0x1b');}else{console[_0xd867('0x1c')](_0xd867('0x1d'),_0x405fb0);}}else{_0x360d11='unmanaged';}switch(_0x38dff2[_0xd867('0x14')][_0xd867('0x15')]()){case _0xd867('0xb'):zendesk[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case _0xd867('0x1e'):salesforce[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case'sugarcrm':sugarcrm[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case _0xd867('0x1f'):freshdesk[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case _0xd867('0xd'):zoho[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case'desk':desk[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case'vtiger':vtiger[_0x360d11](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6);break;case'freshsales':freshsales['cs'](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6,_0x360d11);break;case _0xd867('0x20'):servicenow['cs'](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6,_0x360d11);break;case'dynamics365':dynamics365['cs'](_0x38dff2,_0x405fb0,_0x1d4dae,_0x50f1ae,_0x3cb499,_0x274e05,_0x5e11d6,_0x360d11);break;default:console['log'](_0xd867('0x21'));}}else{_0x25f237=require(_0xd867('0x22'))(_0x38dff2[_0xd867('0x14')]['toLowerCase']());_0x25f237['error'](_0xd867('0x23'),util[_0xd867('0x24')](_0xd867('0x25'),_0x38dff2[_0xd867('0x14')][_0xd867('0x15')](),_0x38dff2[_0xd867('0x18')]));}}else{_0x25f237=require('../../../../config/logger')(_0x38dff2[_0xd867('0x14')][_0xd867('0x15')]());_0x25f237['error']('[EXEC]',util[_0xd867('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x38dff2[_0xd867('0x14')][_0xd867('0x15')](),_0x38dff2[_0xd867('0x16')]));}}else{}}catch(_0x285e82){console[_0xd867('0x26')](_0x285e82);}}}}; \ 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 1810c88..e45e226 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 _0xb076=['../../../../config/logger','salesforce','defaults','redis','localhost','emit','assign','getString','Subjects','ticketType','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','create','forEach','includes','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','concat','Connection','remoteUri','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','util','./util','../../../../config/environment'];(function(_0x377756,_0x344caf){var _0x475663=function(_0x29f310){while(--_0x29f310){_0x377756['push'](_0x377756['shift']());}};_0x475663(++_0x344caf);}(_0xb076,0x16d));var _0x6b07=function(_0x1f4202,_0x5350da){_0x1f4202=_0x1f4202-0x0;var _0x47bb0d=_0xb076[_0x1f4202];return _0x47bb0d;};'use strict';var _=require(_0x6b07('0x0'));var rp=require('request-promise');var moment=require(_0x6b07('0x1'));var BPromise=require(_0x6b07('0x2'));var md5=require(_0x6b07('0x3'));var jsforce=require('jsforce');var util=require(_0x6b07('0x4'));var Redis=require('ioredis');var intUtil=require(_0x6b07('0x5'));var config=require(_0x6b07('0x6'));var logger=require(_0x6b07('0x7'))(_0x6b07('0x8'));config['redis']=_[_0x6b07('0x9')](config[_0x6b07('0xa')],{'host':_0x6b07('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6b07('0xa')]));function emit(_0x452072,_0x4a97e5,_0x350f85){io['to'](_0x452072)[_0x6b07('0xc')](_0x4a97e5,_0x350f85);}function getTicket(_0x5a2338,_0xcd15d2,_0x5f5b54,_0x177166,_0x2bef0a,_0x3790f3,_0x2ec9e5,_0x78cc47){var _0x3e69fc=Object[_0x6b07('0xd')]({},{'OwnerId':_0xcd15d2['id'],'Subject':intUtil[_0x6b07('0xe')](_0x177166[_0x6b07('0xf')],_0x2bef0a,'\x20'),'Description':intUtil[_0x6b07('0xe')](_0x177166['Descriptions'],_0x2bef0a,'\x0a')},getCustomFields(_0x3790f3,_0x2bef0a));if(_0x5f5b54){if(_0x177166[_0x6b07('0x10')]==='Task'){_0x3e69fc[_0x6b07('0x11')]=moment[_0x6b07('0x12')]();_0x3e69fc['IsReminderSet']=![];_0x3e69fc[_0x6b07('0x13')]=![];if(_0x5f5b54[_0x6b07('0x14')]===_0x6b07('0x15')||_0x5f5b54[_0x6b07('0x14')]===_0x6b07('0x16')){_0x3e69fc[_0x6b07('0x17')]=_0x5f5b54['id'];}else if(_0x5f5b54[_0x6b07('0x14')]===_0x6b07('0x18')){_0x3e69fc[_0x6b07('0x19')]=_0x5f5b54['id'];}}else if(_0x177166[_0x6b07('0x10')]===_0x6b07('0x1a')){if(_0x5f5b54['endUserType']==='contact'){_0x3e69fc['ContactId']=_0x5f5b54['id'];}else if(_0x5f5b54[_0x6b07('0x14')]===_0x6b07('0x18')){_0x3e69fc[_0x6b07('0x1b')]=_0x5f5b54['id'];}else if(_0x5f5b54[_0x6b07('0x14')]===_0x6b07('0x16')&&_0x177166[_0x6b07('0x1c')]){_0x3e69fc[_0x177166[_0x6b07('0x1c')]]=_0x5f5b54['id'];}else{logger[_0x6b07('0x1d')](_0x6b07('0x1e'));}}}return _0x2ec9e5[_0x6b07('0x1f')](_0x177166[_0x6b07('0x10')])['create'](_0x3e69fc);}function getUser(_0x458d88,_0x6eb5d1,_0x1fac0b){if(!_['isNil'](_0x6eb5d1)&&intUtil[_0x6b07('0x20')](_0x6eb5d1)){var _0x453ed9={'Email':_0x6eb5d1};var _0x2452e0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1fac0b[_0x6b07('0x1f')]('User')[_0x6b07('0x21')](_0x453ed9,_0x2452e0)[_0x6b07('0x22')]()[_0x6b07('0x23')](function(_0x849f4e){if(_0x849f4e[_0x6b07('0x24')]){var _0xe05e6e=_[_0x6b07('0x21')](_0x849f4e,function(_0x78369e){return _0x78369e[_0x6b07('0x25')]===_0x6eb5d1;});if(_0xe05e6e){logger[_0x6b07('0x1d')](_0x6b07('0x26'),_0x6eb5d1);return BPromise[_0x6b07('0x27')]({'id':_0xe05e6e['Id'],'name':_0xe05e6e[_0x6b07('0x28')]});}}else{logger['info'](_0x6b07('0x29'),_0x6eb5d1);return _0x1fac0b[_0x6b07('0x2a')]()[_0x6b07('0x23')](function(_0x2f7397){return BPromise[_0x6b07('0x27')]({'id':_0x2f7397[_0x6b07('0x2b')],'name':_0x2f7397[_0x6b07('0x2c')]});});}});}else{logger[_0x6b07('0x1d')](_0x6b07('0x29'),_0x6eb5d1);return _0x1fac0b[_0x6b07('0x2a')]()[_0x6b07('0x23')](function(_0x12f3a9){return BPromise[_0x6b07('0x27')]({'id':_0x12f3a9[_0x6b07('0x2b')],'name':_0x12f3a9['display_name']});});}}function getEndUser(_0x595d82,_0x30318f,_0x52c17b,_0x5a7814,_0x5aec22){var _0x59f6d9={'$or':{'Phone':_0x5a7814}};var _0x8e5a4b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6b07('0x27')]()[_0x6b07('0x23')](function(){logger[_0x6b07('0x1d')](_0x6b07('0x2d'),_0x5a7814,_0x30318f['moduleSearch']);switch(_0x30318f[_0x6b07('0x2e')]){case _0x6b07('0x2f'):var _0x332174=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x31')]){var _0x33345d={};_0x33345d[_0x30318f['additionalSearchContact']]=_0x5a7814;_[_0x6b07('0x32')](_0x332174[_0x6b07('0x33')],_0x33345d);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x34'))[_0x6b07('0x21')](_0x332174,_0x8e5a4b)[_0x6b07('0x22')]()['then'](function(_0x12a4fb){if(_0x12a4fb&&_0x12a4fb[_0x6b07('0x24')]){return _0x12a4fb;}else{var _0x327db2=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x35')]){var _0x2f878a={};_0x2f878a[_0x30318f[_0x6b07('0x35')]]=_0x5a7814;_[_0x6b07('0x32')](_0x327db2[_0x6b07('0x33')],_0x2f878a);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x36'))['find'](_0x327db2,_0x8e5a4b);}});case'account_contact_lead':var _0x1defb9=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f['additionalSearchAccount']){var _0x33345d={};_0x33345d[_0x30318f[_0x6b07('0x37')]]=_0x5a7814;_[_0x6b07('0x32')](_0x1defb9['$or'],_0x33345d);}return _0x5aec22[_0x6b07('0x1f')]('Account')[_0x6b07('0x21')](_0x1defb9,_0x8e5a4b)[_0x6b07('0x22')]()['then'](function(_0x291c11){if(_0x291c11&&_0x291c11[_0x6b07('0x24')]){return _0x291c11;}else{var _0x375bc3=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x31')]){var _0x916d85={};_0x916d85[_0x30318f[_0x6b07('0x31')]]=_0x5a7814;_[_0x6b07('0x32')](_0x375bc3[_0x6b07('0x33')],_0x916d85);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x34'))[_0x6b07('0x21')](_0x375bc3,_0x8e5a4b)[_0x6b07('0x23')](function(_0x542a18){if(_0x542a18&&_0x542a18[_0x6b07('0x24')]){return _0x542a18;}else{var _0x58708a=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x35')]){var _0x32ee82={};_0x32ee82[_0x30318f[_0x6b07('0x35')]]=_0x5a7814;_[_0x6b07('0x32')](_0x58708a[_0x6b07('0x33')],_0x32ee82);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x36'))[_0x6b07('0x21')](_0x58708a,_0x8e5a4b);}});}});case _0x6b07('0x15'):var _0x332174=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x31')]){var _0x33345d={};_0x33345d[_0x30318f[_0x6b07('0x31')]]=_0x5a7814;_[_0x6b07('0x32')](_0x332174[_0x6b07('0x33')],_0x33345d);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x34'))[_0x6b07('0x21')](_0x332174,_0x8e5a4b)['execute']();case _0x6b07('0x16'):var _0x40652b=_[_0x6b07('0x30')](_0x59f6d9);if(_0x30318f[_0x6b07('0x35')]){var _0x33345d={};_0x33345d[_0x30318f[_0x6b07('0x35')]]=_0x5a7814;_[_0x6b07('0x32')](_0x40652b['$or'],_0x33345d);}return _0x5aec22[_0x6b07('0x1f')]('Lead')[_0x6b07('0x21')](_0x40652b,_0x8e5a4b);case'account':var _0x1defb9=_['cloneDeep'](_0x59f6d9);if(_0x30318f[_0x6b07('0x37')]){var _0x33345d={};_0x33345d[_0x30318f['additionalSearchAccount']]=_0x5a7814;_[_0x6b07('0x32')](_0x1defb9[_0x6b07('0x33')],_0x33345d);}return _0x5aec22[_0x6b07('0x1f')](_0x6b07('0x38'))['find'](_0x1defb9,_0x8e5a4b);default:return null;}})[_0x6b07('0x23')](function(_0x5cf2b9){if(_0x5cf2b9&&_0x5cf2b9[_0x6b07('0x24')]){var _0x153615=_[_0x6b07('0x39')](_0x5cf2b9);if(_0x153615){return BPromise[_0x6b07('0x27')]({'id':_0x153615['Id'],'name':_0x153615[_0x6b07('0x28')],'phone':_0x153615[_0x6b07('0x3a')],'endUserType':_0x153615[_0x6b07('0x3b')][_0x6b07('0x3c')]['toLowerCase']()});}}})['then'](function(_0x1db885){if(_0x1db885){logger['info'](_0x6b07('0x3d'),_0x1db885[_0x6b07('0x14')],_0x5a7814);return BPromise[_0x6b07('0x27')](_0x1db885);}else{logger[_0x6b07('0x1d')](_0x6b07('0x3e'),_0x5a7814);var _0x6f29fc={'Phone':_0x5a7814};if(_0x30318f[_0x6b07('0x3f')]){if(_0x30318f['moduleCreate']==='contact'){logger[_0x6b07('0x1d')](_0x6b07('0x40'),_0x5a7814,_0x30318f[_0x6b07('0x3f')]);_0x6f29fc[_0x6b07('0x41')]=_0x52c17b!==_0x6b07('0x42')?_0x52c17b:util[_0x6b07('0x43')]('Caller\x20-\x20%s',_0x5a7814);}else if(_0x30318f[_0x6b07('0x3f')]===_0x6b07('0x16')){logger[_0x6b07('0x1d')](_0x6b07('0x40'),_0x5a7814,_0x30318f['moduleCreate']);_0x6f29fc[_0x6b07('0x41')]=_0x52c17b!==_0x6b07('0x42')?_0x52c17b:util[_0x6b07('0x43')](_0x6b07('0x44'),_0x5a7814);_0x6f29fc['Company']=_0x6b07('0x45');}else if(_0x30318f[_0x6b07('0x3f')]===_0x6b07('0x18')){logger[_0x6b07('0x1d')](_0x6b07('0x40'),_0x5a7814,_0x30318f[_0x6b07('0x3f')]);_0x6f29fc[_0x6b07('0x28')]=_0x52c17b!==''?_0x52c17b:util[_0x6b07('0x43')](_0x6b07('0x44'),_0x5a7814);}else{return null;}}return _0x5aec22[_0x6b07('0x1f')](_[_0x6b07('0x46')](_0x30318f[_0x6b07('0x3f')]))[_0x6b07('0x47')](_0x6f29fc)[_0x6b07('0x23')](function(_0x3d413f){return BPromise[_0x6b07('0x27')]({'id':_0x3d413f['id'],'endUserType':_0x30318f[_0x6b07('0x3f')]});});}});}function getCustomFields(_0x31b78c,_0x13d080){var _0x361255={};if(_0x31b78c[_0x6b07('0x24')]>0x0){_[_0x6b07('0x48')](_0x31b78c,function(_0x38db34){if(_[_0x6b07('0x49')](['string',_0x6b07('0x4a')],_0x38db34['type'])&&_0x38db34['idField']){_0x361255[_0x38db34[_0x6b07('0x4b')]]=_0x38db34[_0x6b07('0x4c')][_0x6b07('0x4d')]();}else if(_0x38db34[_0x6b07('0x3c')]===_0x6b07('0x4e')&&_0x38db34[_0x6b07('0x4f')]&&_0x38db34[_0x6b07('0x4b')]){_0x13d080[_0x38db34[_0x6b07('0x4f')]]&&(_0x361255[_0x38db34['idField']]=_0x13d080[_0x38db34[_0x6b07('0x4f')]][_0x6b07('0x4d')]());}else if(_0x38db34['type']==='customVariable'&&_0x38db34[_0x6b07('0x50')]&&_0x38db34['Variable'][_0x6b07('0x51')]&&_0x38db34['idField']){_0x13d080[_0x38db34['Variable']['name'][_0x6b07('0x52')]()]&&(_0x361255[_0x38db34[_0x6b07('0x4b')]]=_0x13d080[_0x38db34[_0x6b07('0x50')][_0x6b07('0x51')][_0x6b07('0x52')]()][_0x6b07('0x4d')]());}});}return _0x361255;}function getConnection(_0x10bcf0){var _0x33fcad=_0x10bcf0['password'][_0x6b07('0x53')](_0x10bcf0['securityToken']);var _0xbe4e38=new jsforce[(_0x6b07('0x54'))]({'oauth2':{'loginUrl':_0x10bcf0[_0x6b07('0x55')]||'https://login.salesforce.com','clientId':_0x10bcf0['clientId'],'clientSecret':_0x10bcf0[_0x6b07('0x56')]}});return _0xbe4e38[_0x6b07('0x57')](_0x10bcf0[_0x6b07('0x58')],_0x33fcad)['then'](function(){logger[_0x6b07('0x1d')](_0x6b07('0x59'));return _0xbe4e38;});}exports[_0x6b07('0x5a')]=function(_0x1e26ba,_0x3a940e,_0x59f42b,_0x2a2ea9,_0x843f72,_0x47a76d){var _0x1463de,_0x232d62,_0x4735b5,_0x5cdff7;_0x47a76d[_0x6b07('0x5b')]=intUtil[_0x6b07('0x5c')](_0x47a76d[_0x6b07('0x5b')]);_0x47a76d[_0x6b07('0x55')]=intUtil[_0x6b07('0x5c')](_0x47a76d[_0x6b07('0x55')]);if(_0x843f72&&_0x843f72[_0x6b07('0x5d')]){logger[_0x6b07('0x1d')](_0x6b07('0x5e'),'Recording\x20is\x20enabled!');_0x3a940e[_0x6b07('0x5f')]=util[_0x6b07('0x43')](_0x6b07('0x60'),_0x47a76d[_0x6b07('0x5b')],_0x3a940e[_0x6b07('0x61')],md5(_0x3a940e[_0x6b07('0x61')]));}else{_0x3a940e[_0x6b07('0x5f')]='';}return getConnection(_0x47a76d)[_0x6b07('0x23')](function(_0xbc6a9e){_0x5cdff7=_0xbc6a9e;return getUser(_0x47a76d,_0x2a2ea9['email'],_0x5cdff7);})[_0x6b07('0x23')](function(_0x5f178e){_0x1463de=_0x5f178e;return getEndUser(_0x47a76d,_0x59f42b,_0x3a940e['calleridname'],_0x3a940e[_0x6b07('0x62')],_0x5cdff7);})[_0x6b07('0x23')](function(_0x1fefb2){_0x232d62=_0x1fefb2;return getTicket(_0x47a76d,_0x1463de,_0x232d62,_0x59f42b,_0x3a940e,_0x59f42b[_0x6b07('0x63')],_0x5cdff7,'queue');})['then'](function(_0x1c2f66){_0x4735b5=_0x1c2f66;logger[_0x6b07('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4735b5['id']);logger[_0x6b07('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4735b5['id'],_0x2a2ea9[_0x6b07('0x51')],_0x47a76d[_0x6b07('0x3c')]);switch(_0x47a76d[_0x6b07('0x3c')]){case _0x6b07('0x64'):emit(util['format'](_0x6b07('0x65'),_0x2a2ea9[_0x6b07('0x51')]),_0x6b07('0x66'),{'recordId':_0x4735b5['id']});break;case _0x6b07('0x67'):emit(util[_0x6b07('0x43')]('user:%s',_0x2a2ea9[_0x6b07('0x51')]),_0x6b07('0x68'),{'uri':util[_0x6b07('0x43')](_0x6b07('0x69'),_0x5cdff7[_0x6b07('0x6a')],_0x4735b5['id'])});break;default:logger[_0x6b07('0x6b')](_0x6b07('0x6c'));}})['catch'](function(_0x187212){logger['error'](_0x6b07('0x5e'),_0x187212);});};exports[_0x6b07('0x6d')]=function(_0x530f67,_0x568ba6,_0x4ed338,_0x12d2bc,_0x5c8942,_0x72262b,_0x38a1c7){var _0x13c0ac,_0x76f752,_0x57e852,_0x3163df;_0x72262b['serverUrl']=intUtil[_0x6b07('0x5c')](_0x72262b[_0x6b07('0x5b')]);_0x72262b[_0x6b07('0x55')]=intUtil['stripTrailingSlash'](_0x72262b[_0x6b07('0x55')]);if(_0x38a1c7&&_0x38a1c7['recordingFormat']&&_0x38a1c7[_0x6b07('0x6e')]!=='none'){logger[_0x6b07('0x1d')](_0x6b07('0x6f'),_0x6b07('0x70'));_0x568ba6[_0x6b07('0x5f')]=util[_0x6b07('0x43')](_0x6b07('0x60'),_0x72262b[_0x6b07('0x5b')],_0x568ba6[_0x6b07('0x61')],md5(_0x568ba6[_0x6b07('0x61')]));}return getConnection(_0x72262b)[_0x6b07('0x23')](function(_0x5af618){_0x3163df=_0x5af618;return getUser(_0x72262b,_0x12d2bc[_0x6b07('0x71')],_0x3163df);})['then'](function(_0x297258){_0x13c0ac=_0x297258;return getEndUser(_0x72262b,_0x4ed338,_0x568ba6[_0x6b07('0x72')],_0x568ba6[_0x6b07('0x73')],_0x3163df);})[_0x6b07('0x23')](function(_0x55f807){_0x76f752=_0x55f807;return getTicket(_0x72262b,_0x13c0ac,_0x76f752,_0x4ed338,_0x568ba6,_0x4ed338[_0x6b07('0x63')],_0x3163df,_0x6b07('0x6d'));})[_0x6b07('0x23')](function(_0x3fc3e3){_0x57e852=_0x3fc3e3;logger['info'](_0x6b07('0x74'),_0x57e852['id']);logger[_0x6b07('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x57e852['id'],_0x12d2bc[_0x6b07('0x51')],_0x72262b[_0x6b07('0x3c')]);switch(_0x72262b[_0x6b07('0x3c')]){case _0x6b07('0x64'):emit(util[_0x6b07('0x43')](_0x6b07('0x65'),_0x12d2bc[_0x6b07('0x51')]),'trigger:salesforce:display',{'recordId':_0x57e852['id']});break;case'newTab':emit(util[_0x6b07('0x43')](_0x6b07('0x65'),_0x12d2bc[_0x6b07('0x51')]),'trigger:browser:url',{'uri':util[_0x6b07('0x43')](_0x6b07('0x69'),_0x3163df[_0x6b07('0x6a')],_0x57e852['id'])});break;default:logger[_0x6b07('0x6b')](_0x6b07('0x6f'),_0x6b07('0x75'));}})[_0x6b07('0x76')](function(_0x41c182){logger[_0x6b07('0x6b')]('[OUTBOUND]',_0x41c182);});};exports[_0x6b07('0x77')]=function(_0x42ccd8,_0x15c691,_0x3eb818,_0xa51e78,_0x30d9bc,_0x29ef6c){var _0x39648a,_0x82db5,_0x8f44b8,_0x903476;_0x29ef6c['serverUrl']=intUtil[_0x6b07('0x5c')](_0x29ef6c['serverUrl']);_0x29ef6c[_0x6b07('0x55')]=intUtil['stripTrailingSlash'](_0x29ef6c[_0x6b07('0x55')]);if(_0x30d9bc&&_0x30d9bc['monitor_format']){logger[_0x6b07('0x1d')]('['+_0x15c691[_0x6b07('0x78')][_0x6b07('0x79')]()+']','Recording\x20is\x20enabled!');_0x15c691[_0x6b07('0x5f')]=util[_0x6b07('0x43')](_0x6b07('0x60'),_0x29ef6c[_0x6b07('0x5b')],_0x15c691['uniqueid'],md5(_0x15c691[_0x6b07('0x61')]));}else{_0x15c691[_0x6b07('0x5f')]='';}return getConnection(_0x29ef6c)[_0x6b07('0x23')](function(_0x3b198d){_0x903476=_0x3b198d;if(!_['isNil'](_0xa51e78)){return getUser(_0x29ef6c,_0xa51e78[_0x6b07('0x51')],_0x903476);}else{return getUser(_0x29ef6c,null,_0x903476);}})['then'](function(_0x4f175e){_0x39648a=_0x4f175e;return getEndUser(_0x29ef6c,_0x3eb818,_0x15c691['calleridname'],_0x15c691[_0x6b07('0x62')],_0x903476);})[_0x6b07('0x23')](function(_0x508038){_0x82db5=_0x508038;return getTicket(_0x29ef6c,_0x39648a,_0x82db5,_0x3eb818,_0x15c691,_0x3eb818[_0x6b07('0x63')],_0x903476);})[_0x6b07('0x23')](function(_0x477ff8){_0x8f44b8=_0x477ff8;logger['info']('['+_0x15c691[_0x6b07('0x78')][_0x6b07('0x79')]()+_0x6b07('0x7a'),_0x8f44b8['id']);logger[_0x6b07('0x1d')]('['+_0x15c691[_0x6b07('0x78')][_0x6b07('0x79')]()+_0x6b07('0x7b'),_0x29ef6c[_0x6b07('0x3c')]);})[_0x6b07('0x76')](function(_0x175a38){logger[_0x6b07('0x6b')]('['+_0x15c691['lastevent'][_0x6b07('0x79')]()+']',_0x175a38);});}; \ No newline at end of file +var _0x8e8a=['integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','ioredis','./util','../../../../config/logger','redis','localhost','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','AccountId','leadId','sobject','isNil','User','find','then','length','Email','info','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Name','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','No\x20Company','','forEach','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.'];(function(_0x569fb7,_0x3a4801){var _0x3544f9=function(_0x1851e2){while(--_0x1851e2){_0x569fb7['push'](_0x569fb7['shift']());}};_0x3544f9(++_0x3a4801);}(_0x8e8a,0x180));var _0xa8e8=function(_0x81fb50,_0x27df29){_0x81fb50=_0x81fb50-0x0;var _0x57c307=_0x8e8a[_0x81fb50];return _0x57c307;};'use strict';var _=require('lodash');var rp=require(_0xa8e8('0x0'));var moment=require(_0xa8e8('0x1'));var BPromise=require(_0xa8e8('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xa8e8('0x3'));var intUtil=require(_0xa8e8('0x4'));var config=require('../../../../config/environment');var logger=require(_0xa8e8('0x5'))('salesforce');config[_0xa8e8('0x6')]=_['defaults'](config[_0xa8e8('0x6')],{'host':_0xa8e8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8e8('0x6')]));function emit(_0x5c0f8f,_0x341437,_0x3efee2){io['to'](_0x5c0f8f)[_0xa8e8('0x8')](_0x341437,_0x3efee2);}function getTicket(_0x5a5d83,_0x3a2ee1,_0x14b71c,_0x5678c4,_0x5e708b,_0x16170a,_0x20df01,_0x3103c1){var _0x599d1a=Object[_0xa8e8('0x9')]({},{'OwnerId':_0x3a2ee1['id'],'Subject':intUtil['getString'](_0x5678c4[_0xa8e8('0xa')],_0x5e708b,'\x20'),'Description':intUtil[_0xa8e8('0xb')](_0x5678c4['Descriptions'],_0x5e708b,'\x0a')},getCustomFields(_0x16170a,_0x5e708b));if(_0x14b71c){if(_0x5678c4[_0xa8e8('0xc')]===_0xa8e8('0xd')){_0x599d1a[_0xa8e8('0xe')]=moment['utc']();_0x599d1a[_0xa8e8('0xf')]=![];_0x599d1a[_0xa8e8('0x10')]=![];if(_0x14b71c[_0xa8e8('0x11')]===_0xa8e8('0x12')||_0x14b71c[_0xa8e8('0x11')]===_0xa8e8('0x13')){_0x599d1a['WhoId']=_0x14b71c['id'];}else if(_0x14b71c[_0xa8e8('0x11')]===_0xa8e8('0x14')){_0x599d1a[_0xa8e8('0x15')]=_0x14b71c['id'];}}else if(_0x5678c4['ticketType']===_0xa8e8('0x16')){if(_0x14b71c[_0xa8e8('0x11')]==='contact'){_0x599d1a[_0xa8e8('0x17')]=_0x14b71c['id'];}else if(_0x14b71c[_0xa8e8('0x11')]==='account'){_0x599d1a[_0xa8e8('0x18')]=_0x14b71c['id'];}else if(_0x14b71c[_0xa8e8('0x11')]===_0xa8e8('0x13')&&_0x5678c4[_0xa8e8('0x19')]){_0x599d1a[_0x5678c4[_0xa8e8('0x19')]]=_0x14b71c['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x20df01[_0xa8e8('0x1a')](_0x5678c4[_0xa8e8('0xc')])['create'](_0x599d1a);}function getUser(_0x426216,_0x5d47fe,_0x14538d){if(!_[_0xa8e8('0x1b')](_0x5d47fe)&&intUtil['validateEmail'](_0x5d47fe)){var _0x279943={'Email':_0x5d47fe};var _0x30e878={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x14538d[_0xa8e8('0x1a')](_0xa8e8('0x1c'))[_0xa8e8('0x1d')](_0x279943,_0x30e878)['execute']()[_0xa8e8('0x1e')](function(_0x3b06a9){if(_0x3b06a9[_0xa8e8('0x1f')]){var _0x93bef8=_['find'](_0x3b06a9,function(_0x5b8039){return _0x5b8039[_0xa8e8('0x20')]===_0x5d47fe;});if(_0x93bef8){logger[_0xa8e8('0x21')]('Agent\x20%s\x20found.',_0x5d47fe);return BPromise['resolve']({'id':_0x93bef8['Id'],'name':_0x93bef8['Name']});}}else{logger[_0xa8e8('0x21')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5d47fe);return _0x14538d['identity']()[_0xa8e8('0x1e')](function(_0x2cba0e){return BPromise[_0xa8e8('0x22')]({'id':_0x2cba0e[_0xa8e8('0x23')],'name':_0x2cba0e[_0xa8e8('0x24')]});});}});}else{logger[_0xa8e8('0x21')](_0xa8e8('0x25'),_0x5d47fe);return _0x14538d['identity']()['then'](function(_0x4efe77){return BPromise[_0xa8e8('0x22')]({'id':_0x4efe77[_0xa8e8('0x23')],'name':_0x4efe77[_0xa8e8('0x24')]});});}}function getEndUser(_0x1029c8,_0x1454ca,_0x15458c,_0x4b8454,_0x1c9a3d){var _0x4feb4c={'$or':{'Phone':_0x4b8454}};var _0x29cbaa={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa8e8('0x22')]()[_0xa8e8('0x1e')](function(){logger[_0xa8e8('0x21')](_0xa8e8('0x26'),_0x4b8454,_0x1454ca[_0xa8e8('0x27')]);switch(_0x1454ca[_0xa8e8('0x27')]){case _0xa8e8('0x28'):var _0x3ff0a0=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca['additionalSearchContact']){var _0x3ae09e={};_0x3ae09e[_0x1454ca[_0xa8e8('0x2a')]]=_0x4b8454;_[_0xa8e8('0x2b')](_0x3ff0a0['$or'],_0x3ae09e);}return _0x1c9a3d[_0xa8e8('0x1a')]('Contact')[_0xa8e8('0x1d')](_0x3ff0a0,_0x29cbaa)[_0xa8e8('0x2c')]()[_0xa8e8('0x1e')](function(_0x5ebab2){if(_0x5ebab2&&_0x5ebab2['length']){return _0x5ebab2;}else{var _0x10cb72=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca[_0xa8e8('0x2d')]){var _0x4b342f={};_0x4b342f[_0x1454ca[_0xa8e8('0x2d')]]=_0x4b8454;_[_0xa8e8('0x2b')](_0x10cb72[_0xa8e8('0x2e')],_0x4b342f);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x2f'))[_0xa8e8('0x1d')](_0x10cb72,_0x29cbaa);}});case _0xa8e8('0x30'):var _0xce7f74=_['cloneDeep'](_0x4feb4c);if(_0x1454ca['additionalSearchAccount']){var _0x3ae09e={};_0x3ae09e[_0x1454ca[_0xa8e8('0x31')]]=_0x4b8454;_[_0xa8e8('0x2b')](_0xce7f74[_0xa8e8('0x2e')],_0x3ae09e);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x32'))[_0xa8e8('0x1d')](_0xce7f74,_0x29cbaa)[_0xa8e8('0x2c')]()['then'](function(_0x53b1cf){if(_0x53b1cf&&_0x53b1cf[_0xa8e8('0x1f')]){return _0x53b1cf;}else{var _0x2f90bb=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca['additionalSearchContact']){var _0x5e668a={};_0x5e668a[_0x1454ca['additionalSearchContact']]=_0x4b8454;_['merge'](_0x2f90bb['$or'],_0x5e668a);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x33'))['find'](_0x2f90bb,_0x29cbaa)[_0xa8e8('0x1e')](function(_0x24e777){if(_0x24e777&&_0x24e777[_0xa8e8('0x1f')]){return _0x24e777;}else{var _0x5f2aa9=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca[_0xa8e8('0x2d')]){var _0x3ddbce={};_0x3ddbce[_0x1454ca[_0xa8e8('0x2d')]]=_0x4b8454;_[_0xa8e8('0x2b')](_0x5f2aa9[_0xa8e8('0x2e')],_0x3ddbce);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x2f'))[_0xa8e8('0x1d')](_0x5f2aa9,_0x29cbaa);}});}});case _0xa8e8('0x12'):var _0x3ff0a0=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca['additionalSearchContact']){var _0x3ae09e={};_0x3ae09e[_0x1454ca['additionalSearchContact']]=_0x4b8454;_[_0xa8e8('0x2b')](_0x3ff0a0[_0xa8e8('0x2e')],_0x3ae09e);}return _0x1c9a3d['sobject'](_0xa8e8('0x33'))[_0xa8e8('0x1d')](_0x3ff0a0,_0x29cbaa)[_0xa8e8('0x2c')]();case'lead':var _0x50b65c=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca[_0xa8e8('0x2d')]){var _0x3ae09e={};_0x3ae09e[_0x1454ca[_0xa8e8('0x2d')]]=_0x4b8454;_['merge'](_0x50b65c[_0xa8e8('0x2e')],_0x3ae09e);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x2f'))[_0xa8e8('0x1d')](_0x50b65c,_0x29cbaa);case'account':var _0xce7f74=_[_0xa8e8('0x29')](_0x4feb4c);if(_0x1454ca[_0xa8e8('0x31')]){var _0x3ae09e={};_0x3ae09e[_0x1454ca[_0xa8e8('0x31')]]=_0x4b8454;_[_0xa8e8('0x2b')](_0xce7f74[_0xa8e8('0x2e')],_0x3ae09e);}return _0x1c9a3d[_0xa8e8('0x1a')](_0xa8e8('0x32'))[_0xa8e8('0x1d')](_0xce7f74,_0x29cbaa);default:return null;}})[_0xa8e8('0x1e')](function(_0x927d57){if(_0x927d57&&_0x927d57['length']){var _0xe32a4b=_[_0xa8e8('0x34')](_0x927d57);if(_0xe32a4b){return BPromise[_0xa8e8('0x22')]({'id':_0xe32a4b['Id'],'name':_0xe32a4b[_0xa8e8('0x35')],'phone':_0xe32a4b[_0xa8e8('0x36')],'endUserType':_0xe32a4b['attributes'][_0xa8e8('0x37')][_0xa8e8('0x38')]()});}}})[_0xa8e8('0x1e')](function(_0x1b390a){if(_0x1b390a){logger[_0xa8e8('0x21')](_0xa8e8('0x39'),_0x1b390a[_0xa8e8('0x11')],_0x4b8454);return BPromise[_0xa8e8('0x22')](_0x1b390a);}else{logger[_0xa8e8('0x21')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4b8454);var _0x23f7a9={'Phone':_0x4b8454};if(_0x1454ca['moduleCreate']){if(_0x1454ca[_0xa8e8('0x3a')]===_0xa8e8('0x12')){logger[_0xa8e8('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b8454,_0x1454ca[_0xa8e8('0x3a')]);_0x23f7a9[_0xa8e8('0x3b')]=_0x15458c!==''?_0x15458c:util['format'](_0xa8e8('0x3c'),_0x4b8454);}else if(_0x1454ca[_0xa8e8('0x3a')]===_0xa8e8('0x13')){logger[_0xa8e8('0x21')](_0xa8e8('0x3d'),_0x4b8454,_0x1454ca[_0xa8e8('0x3a')]);_0x23f7a9[_0xa8e8('0x3b')]=_0x15458c!==''?_0x15458c:util[_0xa8e8('0x3e')](_0xa8e8('0x3c'),_0x4b8454);_0x23f7a9['Company']=_0xa8e8('0x3f');}else if(_0x1454ca[_0xa8e8('0x3a')]===_0xa8e8('0x14')){logger[_0xa8e8('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b8454,_0x1454ca['moduleCreate']);_0x23f7a9[_0xa8e8('0x35')]=_0x15458c!==_0xa8e8('0x40')?_0x15458c:util[_0xa8e8('0x3e')](_0xa8e8('0x3c'),_0x4b8454);}else{return null;}}return _0x1c9a3d['sobject'](_['upperFirst'](_0x1454ca[_0xa8e8('0x3a')]))['create'](_0x23f7a9)[_0xa8e8('0x1e')](function(_0x10e65a){return BPromise[_0xa8e8('0x22')]({'id':_0x10e65a['id'],'endUserType':_0x1454ca['moduleCreate']});});}});}function getCustomFields(_0x1f3773,_0x52965e){var _0x4b5e8b={};if(_0x1f3773[_0xa8e8('0x1f')]>0x0){_[_0xa8e8('0x41')](_0x1f3773,function(_0x54b4ae){if(_[_0xa8e8('0x42')]([_0xa8e8('0x43'),'picklist'],_0x54b4ae[_0xa8e8('0x37')])&&_0x54b4ae[_0xa8e8('0x44')]){_0x4b5e8b[_0x54b4ae[_0xa8e8('0x44')]]=_0x54b4ae[_0xa8e8('0x45')][_0xa8e8('0x46')]();}else if(_0x54b4ae[_0xa8e8('0x37')]===_0xa8e8('0x47')&&_0x54b4ae[_0xa8e8('0x48')]&&_0x54b4ae[_0xa8e8('0x44')]){_0x52965e[_0x54b4ae[_0xa8e8('0x48')]]&&(_0x4b5e8b[_0x54b4ae[_0xa8e8('0x44')]]=_0x52965e[_0x54b4ae[_0xa8e8('0x48')]]['toString']());}else if(_0x54b4ae[_0xa8e8('0x37')]===_0xa8e8('0x49')&&_0x54b4ae[_0xa8e8('0x4a')]&&_0x54b4ae[_0xa8e8('0x4a')][_0xa8e8('0x4b')]&&_0x54b4ae[_0xa8e8('0x44')]){_0x52965e[_0x54b4ae[_0xa8e8('0x4a')][_0xa8e8('0x4b')][_0xa8e8('0x38')]()]&&(_0x4b5e8b[_0x54b4ae[_0xa8e8('0x44')]]=_0x52965e[_0x54b4ae[_0xa8e8('0x4a')][_0xa8e8('0x4b')]['toLowerCase']()]['toString']());}});}return _0x4b5e8b;}function getConnection(_0x319d41){var _0x15d42e=_0x319d41[_0xa8e8('0x4c')]['concat'](_0x319d41[_0xa8e8('0x4d')]);var _0x5cddcc=new jsforce['Connection']({'oauth2':{'loginUrl':_0x319d41[_0xa8e8('0x4e')]||'https://login.salesforce.com','clientId':_0x319d41[_0xa8e8('0x4f')],'clientSecret':_0x319d41[_0xa8e8('0x50')]}});return _0x5cddcc[_0xa8e8('0x51')](_0x319d41[_0xa8e8('0x52')],_0x15d42e)['then'](function(){logger[_0xa8e8('0x21')](_0xa8e8('0x53'));return _0x5cddcc;});}exports[_0xa8e8('0x54')]=function(_0x55f4c6,_0x48a6c5,_0x42fcfb,_0x1318c8,_0x1a9746,_0x56bd6d){var _0x17774b,_0x2299cc,_0xb95638,_0x151d19;_0x56bd6d['serverUrl']=intUtil[_0xa8e8('0x55')](_0x56bd6d[_0xa8e8('0x56')]);_0x56bd6d[_0xa8e8('0x4e')]=intUtil[_0xa8e8('0x55')](_0x56bd6d['remoteUri']);if(_0x1a9746&&_0x1a9746[_0xa8e8('0x57')]){logger[_0xa8e8('0x21')](_0xa8e8('0x58'),'Recording\x20is\x20enabled!');_0x48a6c5[_0xa8e8('0x59')]=util[_0xa8e8('0x3e')](_0xa8e8('0x5a'),_0x56bd6d[_0xa8e8('0x56')],_0x48a6c5['uniqueid'],md5(_0x48a6c5[_0xa8e8('0x5b')]));}else{_0x48a6c5[_0xa8e8('0x59')]='';}return getConnection(_0x56bd6d)[_0xa8e8('0x1e')](function(_0x13d49a){_0x151d19=_0x13d49a;return getUser(_0x56bd6d,_0x1318c8['email'],_0x151d19);})[_0xa8e8('0x1e')](function(_0x272f5b){_0x17774b=_0x272f5b;return getEndUser(_0x56bd6d,_0x42fcfb,_0x48a6c5[_0xa8e8('0x5c')],_0x48a6c5[_0xa8e8('0x5d')],_0x151d19);})['then'](function(_0x2ce725){_0x2299cc=_0x2ce725;return getTicket(_0x56bd6d,_0x17774b,_0x2299cc,_0x42fcfb,_0x48a6c5,_0x42fcfb['Fields'],_0x151d19,_0xa8e8('0x54'));})['then'](function(_0x2b69e3){_0xb95638=_0x2b69e3;logger[_0xa8e8('0x21')](_0xa8e8('0x5e'),_0xb95638['id']);logger[_0xa8e8('0x21')](_0xa8e8('0x5f'),_0xb95638['id'],_0x1318c8['name'],_0x56bd6d[_0xa8e8('0x37')]);switch(_0x56bd6d[_0xa8e8('0x37')]){case _0xa8e8('0x60'):emit(util[_0xa8e8('0x3e')](_0xa8e8('0x61'),_0x1318c8['name']),_0xa8e8('0x62'),{'recordId':_0xb95638['id']});break;case _0xa8e8('0x63'):emit(util[_0xa8e8('0x3e')]('user:%s',_0x1318c8[_0xa8e8('0x4b')]),_0xa8e8('0x64'),{'uri':util[_0xa8e8('0x3e')](_0xa8e8('0x65'),_0x151d19[_0xa8e8('0x66')],_0xb95638['id'])});break;default:logger[_0xa8e8('0x67')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xa8e8('0x68')](function(_0x2a5248){logger[_0xa8e8('0x67')](_0xa8e8('0x58'),_0x2a5248);});};exports[_0xa8e8('0x69')]=function(_0x4704ae,_0x5084b1,_0x5a6a0c,_0x4bb3e3,_0x904a0b,_0x5d4696,_0x35e926){var _0x294275,_0x14339a,_0x1581ab,_0x907e02;_0x5d4696[_0xa8e8('0x56')]=intUtil[_0xa8e8('0x55')](_0x5d4696['serverUrl']);_0x5d4696[_0xa8e8('0x4e')]=intUtil[_0xa8e8('0x55')](_0x5d4696[_0xa8e8('0x4e')]);if(_0x35e926&&_0x35e926[_0xa8e8('0x6a')]&&_0x35e926[_0xa8e8('0x6a')]!==_0xa8e8('0x6b')){logger[_0xa8e8('0x21')](_0xa8e8('0x6c'),_0xa8e8('0x6d'));_0x5084b1[_0xa8e8('0x59')]=util[_0xa8e8('0x3e')](_0xa8e8('0x5a'),_0x5d4696[_0xa8e8('0x56')],_0x5084b1[_0xa8e8('0x5b')],md5(_0x5084b1[_0xa8e8('0x5b')]));}return getConnection(_0x5d4696)[_0xa8e8('0x1e')](function(_0x34cbeb){_0x907e02=_0x34cbeb;return getUser(_0x5d4696,_0x4bb3e3[_0xa8e8('0x6e')],_0x907e02);})['then'](function(_0xeb83fc){_0x294275=_0xeb83fc;return getEndUser(_0x5d4696,_0x5a6a0c,_0x5084b1[_0xa8e8('0x6f')],_0x5084b1['destcalleridnum'],_0x907e02);})[_0xa8e8('0x1e')](function(_0x15a944){_0x14339a=_0x15a944;return getTicket(_0x5d4696,_0x294275,_0x14339a,_0x5a6a0c,_0x5084b1,_0x5a6a0c[_0xa8e8('0x70')],_0x907e02,_0xa8e8('0x69'));})[_0xa8e8('0x1e')](function(_0x54e9c2){_0x1581ab=_0x54e9c2;logger[_0xa8e8('0x21')](_0xa8e8('0x71'),_0x1581ab['id']);logger['info'](_0xa8e8('0x72'),_0x1581ab['id'],_0x4bb3e3[_0xa8e8('0x4b')],_0x5d4696[_0xa8e8('0x37')]);switch(_0x5d4696[_0xa8e8('0x37')]){case _0xa8e8('0x60'):emit(util[_0xa8e8('0x3e')]('user:%s',_0x4bb3e3['name']),_0xa8e8('0x62'),{'recordId':_0x1581ab['id']});break;case _0xa8e8('0x63'):emit(util[_0xa8e8('0x3e')](_0xa8e8('0x61'),_0x4bb3e3['name']),_0xa8e8('0x64'),{'uri':util['format']('%s/%s/e',_0x907e02[_0xa8e8('0x66')],_0x1581ab['id'])});break;default:logger['error'](_0xa8e8('0x6c'),_0xa8e8('0x73'));}})[_0xa8e8('0x68')](function(_0x2f79f4){logger[_0xa8e8('0x67')](_0xa8e8('0x6c'),_0x2f79f4);});};exports[_0xa8e8('0x74')]=function(_0x2a322f,_0x2e1cd7,_0x1fc8cd,_0x589c22,_0x138426,_0x161c19){var _0x1f661b,_0x2ed004,_0x482aca,_0x407ba3;_0x161c19[_0xa8e8('0x56')]=intUtil[_0xa8e8('0x55')](_0x161c19[_0xa8e8('0x56')]);_0x161c19[_0xa8e8('0x4e')]=intUtil[_0xa8e8('0x55')](_0x161c19['remoteUri']);if(_0x138426&&_0x138426[_0xa8e8('0x57')]){logger[_0xa8e8('0x21')]('['+_0x2e1cd7[_0xa8e8('0x75')][_0xa8e8('0x76')]()+']',_0xa8e8('0x6d'));_0x2e1cd7[_0xa8e8('0x59')]=util[_0xa8e8('0x3e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x161c19['serverUrl'],_0x2e1cd7[_0xa8e8('0x5b')],md5(_0x2e1cd7[_0xa8e8('0x5b')]));}else{_0x2e1cd7[_0xa8e8('0x59')]='';}return getConnection(_0x161c19)[_0xa8e8('0x1e')](function(_0x2e5b5b){_0x407ba3=_0x2e5b5b;if(!_[_0xa8e8('0x1b')](_0x589c22)){return getUser(_0x161c19,_0x589c22[_0xa8e8('0x4b')],_0x407ba3);}else{return getUser(_0x161c19,null,_0x407ba3);}})[_0xa8e8('0x1e')](function(_0x16db65){_0x1f661b=_0x16db65;return getEndUser(_0x161c19,_0x1fc8cd,_0x2e1cd7[_0xa8e8('0x5c')],_0x2e1cd7[_0xa8e8('0x5d')],_0x407ba3);})[_0xa8e8('0x1e')](function(_0x390197){_0x2ed004=_0x390197;return getTicket(_0x161c19,_0x1f661b,_0x2ed004,_0x1fc8cd,_0x2e1cd7,_0x1fc8cd[_0xa8e8('0x70')],_0x407ba3);})[_0xa8e8('0x1e')](function(_0x3039ec){_0x482aca=_0x3039ec;logger[_0xa8e8('0x21')]('['+_0x2e1cd7['lastevent'][_0xa8e8('0x76')]()+']\x20Ticket\x20%s\x20created.',_0x482aca['id']);logger[_0xa8e8('0x21')]('['+_0x2e1cd7[_0xa8e8('0x75')][_0xa8e8('0x76')]()+_0xa8e8('0x77'),_0x161c19[_0xa8e8('0x37')]);})[_0xa8e8('0x68')](function(_0x20d61d){logger[_0xa8e8('0x67')]('['+_0x2e1cd7[_0xa8e8('0x75')][_0xa8e8('0x76')]()+']',_0x20d61d);});}; \ 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 6faaf09..f41e605 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 _0xa6bf=['outbound','uniqueid','monitor_format','recordingURL','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','socket.io-emitter','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','then','true','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','string','picklist','nameField','customField','toLowerCase','idField','toString','variable','variableName','type','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','forEach','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','unmanaged'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa6bf,0x1aa));var _0xfa6b=function(_0x160938,_0x37247e){_0x160938=_0x160938-0x0;var _0x314550=_0xa6bf[_0x160938];return _0x314550;};'use strict';var _=require(_0xfa6b('0x0'));var Promise=require(_0xfa6b('0x1'));var rp=require(_0xfa6b('0x2'));var util=require(_0xfa6b('0x3'));var md5=require(_0xfa6b('0x4'));var Redis=require(_0xfa6b('0x5'));var intUtil=require('./util');var config=require(_0xfa6b('0x6'));var logger=require(_0xfa6b('0x7'))(_0xfa6b('0x8'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfa6b('0x9'))(new Redis(config[_0xfa6b('0xa')]));function getAdminUser(_0x503817,_0x4edec8,_0x2f3edc,_0x128ca1,_0x59fdd3,_0x132e7a){return new Promise(function(_0x334a81,_0x2fbb0c){var _0x9dba2c={'method':_0xfa6b('0xb'),'uri':_0x128ca1+_0xfa6b('0xc')+'&'+_0x59fdd3+'&'+_0x132e7a,'auth':_0x4edec8,'json':!![]};return rp(_0x9dba2c)['then'](function(_0x3cc1c8){if(_0x3cc1c8[_0xfa6b('0xd')][_0xfa6b('0xe')]>0x0){_0x2f3edc['adminId']=_0x3cc1c8[_0xfa6b('0xd')][0x0][_0xfa6b('0xf')];}logger[_0xfa6b('0x10')]('['+[_0x503817[_0xfa6b('0x11')]()]+_0xfa6b('0x12'),_0x2f3edc);_0x334a81(_0x2f3edc);})[_0xfa6b('0x13')](function(_0x4f2222){logger[_0xfa6b('0x14')]('['+[_0x503817[_0xfa6b('0x11')]()]+']',_0x4f2222[_0xfa6b('0x15')]);_0x2fbb0c(_0x4f2222[_0xfa6b('0x15')]);});});}function getUser(_0x345151,_0x366c60,_0x48d6e8,_0x2342e1,_0x2427f2){return function(_0x269e65){logger[_0xfa6b('0x10')]('['+[_0x345151[_0xfa6b('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x269e65);return new Promise(function(_0x2150d5,_0x1bdfff){if(intUtil[_0xfa6b('0x16')](_0x269e65['userEmail'])){var _0x29270a={'method':_0xfa6b('0xb'),'uri':_0x48d6e8+_0xfa6b('0x17')+_0x269e65[_0xfa6b('0x18')]+'&'+_0x2342e1+'&'+_0x2427f2,'auth':_0x366c60,'json':!![]};logger[_0xfa6b('0x10')]('['+[_0x345151['toUpperCase']()]+_0xfa6b('0x19'),_0x29270a);return rp(_0x29270a)[_0xfa6b('0x1a')](function(_0xe5190c){logger[_0xfa6b('0x10')]('['+[_0x345151[_0xfa6b('0x11')]()]+'],\x20getUser\x20entity',_0xe5190c);if(_0xe5190c['result'][_0xfa6b('0xe')]>0x0&&String(_0xe5190c[_0xfa6b('0xd')][0x0]['active'])===_0xfa6b('0x1b')){_0x269e65[_0xfa6b('0x1c')]=_0xe5190c[_0xfa6b('0xd')][0x0][_0xfa6b('0xf')];}else{_0x269e65[_0xfa6b('0x1c')]=_0x269e65[_0xfa6b('0x1d')];_0x269e65[_0xfa6b('0x18')]=_0x269e65[_0xfa6b('0x1e')];}logger['info']('['+[_0x345151[_0xfa6b('0x11')]()]+'],\x20getUser\x20crm',_0x269e65);_0x2150d5(_0x269e65);})[_0xfa6b('0x13')](function(_0x53796b){logger[_0xfa6b('0x14')]('['+[_0x345151[_0xfa6b('0x11')]()]+']',_0x53796b['message']);_0x1bdfff(_0x53796b[_0xfa6b('0x15')]);});}else{logger['info']('['+[_0x345151[_0xfa6b('0x11')]()]+']\x20using\x20admin\x20profile');_0x269e65[_0xfa6b('0x1c')]=_0x269e65[_0xfa6b('0x1d')];_0x269e65[_0xfa6b('0x18')]=_0x269e65[_0xfa6b('0x1e')];_0x2150d5(_0x269e65);}});};}function createEndUser(_0x480ee1,_0x57fce4,_0x586ef4,_0x1bf21f,_0x1556d1){logger[_0xfa6b('0x10')]('['+[_0x480ee1[_0xfa6b('0x11')]()]+_0xfa6b('0x1f'),_0x586ef4);return new Promise(function(_0x12b99b,_0x1845e9){var _0x2e1c9d={'method':_0xfa6b('0x20'),'uri':_0x1bf21f+_0xfa6b('0x21')+_0x1556d1,'body':{'user_name':_0x586ef4['endUserNumber'],'roles':_0xfa6b('0x22'),'first_name':_0x586ef4[_0xfa6b('0x23')],'active':_0xfa6b('0x1b'),'date_format':_0xfa6b('0x24'),'phone':_0x586ef4[_0xfa6b('0x23')]},'auth':_0x57fce4,'json':!![]};return rp(_0x2e1c9d)[_0xfa6b('0x1a')](function(_0x2491b2){logger[_0xfa6b('0x10')]('['+[_0x480ee1['toUpperCase']()]+_0xfa6b('0x25'),_0x2491b2[_0xfa6b('0xd')]);_0x586ef4[_0xfa6b('0x26')]=_0x2491b2[_0xfa6b('0xd')][_0xfa6b('0xf')];_0x12b99b(_0x586ef4);})[_0xfa6b('0x13')](function(_0x3cde8a){logger[_0xfa6b('0x14')]('['+[_0x480ee1[_0xfa6b('0x11')]()]+']',_0x3cde8a[_0xfa6b('0x15')]);_0x1845e9(_0x3cde8a[_0xfa6b('0x15')]);});});}function getEndUser(_0x35afa7,_0x3d15e0,_0x4e1dd0,_0x404d10,_0x49306d){return function(_0x5099f4){logger[_0xfa6b('0x10')]('['+[_0x35afa7[_0xfa6b('0x11')]()]+_0xfa6b('0x27'),_0x5099f4);return new Promise(function(_0xcfd232,_0x34e0c6){var _0x3fb2cb={'method':_0xfa6b('0xb'),'uri':_0x4e1dd0+_0xfa6b('0x28')+_0x5099f4[_0xfa6b('0x23')]+'&'+_0x404d10+'&'+_0x49306d,'auth':_0x3d15e0,'json':!![]};return rp(_0x3fb2cb)[_0xfa6b('0x1a')](function(_0x226508){if(_0x226508[_0xfa6b('0xd')][_0xfa6b('0xe')]>0x0){_0x5099f4[_0xfa6b('0x26')]=_0x226508[_0xfa6b('0xd')][0x0][_0xfa6b('0xf')];logger[_0xfa6b('0x10')]('['+[_0x35afa7[_0xfa6b('0x11')]()]+'],\x20getEndUser\x20crm',_0x5099f4);_0xcfd232(_0x5099f4);}else{return createEndUser(_0x35afa7,_0x3d15e0,_0x5099f4,_0x4e1dd0,_0x404d10)[_0xfa6b('0x1a')](function(_0x407db7){logger[_0xfa6b('0x10')]('['+[_0x35afa7[_0xfa6b('0x11')]()]+_0xfa6b('0x29'),_0x407db7);_0xcfd232(_0x407db7);});}})[_0xfa6b('0x13')](function(_0x211f48){logger[_0xfa6b('0x14')]('['+[_0x35afa7[_0xfa6b('0x11')]()]+']',_0x211f48['message']);_0x34e0c6(_0x211f48['message']);});});};}function getCustomFields(_0x5aa5cd,_0xcd8771){var _0x168405={};if(_0x5aa5cd[_0xfa6b('0xe')]>0x0){_['forEach'](_0x5aa5cd,function(_0x577e0e){if(_['includes']([_0xfa6b('0x2a'),_0xfa6b('0x2b')],_0x577e0e['type'])&&_0x577e0e[_0xfa6b('0x2c')]&&!_0x577e0e[_0xfa6b('0x2d')]){_0x168405[_0x577e0e[_0xfa6b('0x2c')][_0xfa6b('0x2e')]()]=_0x577e0e['content']['toString']();}else if(_['includes']([_0xfa6b('0x2a'),_0xfa6b('0x2b')],_0x577e0e['type'])&&_0x577e0e[_0xfa6b('0x2f')]&&_0x577e0e[_0xfa6b('0x2d')]){_0x168405[_0x577e0e[_0xfa6b('0x2f')][_0xfa6b('0x2e')]()]=_0x577e0e['content'][_0xfa6b('0x30')]();}else if(_0x577e0e['type']===_0xfa6b('0x31')&&_0x577e0e[_0xfa6b('0x32')]&&_0x577e0e['idField']&&_0x577e0e[_0xfa6b('0x2d')]){_0x168405[_0x577e0e[_0xfa6b('0x2f')][_0xfa6b('0x2e')]()]=_0xcd8771[_0x577e0e['variableName']][_0xfa6b('0x30')]();}else if(_0x577e0e[_0xfa6b('0x33')]===_0xfa6b('0x34')&&_0x577e0e[_0xfa6b('0x35')]&&_0x577e0e[_0xfa6b('0x35')][_0xfa6b('0x36')]&&_0x577e0e[_0xfa6b('0x2f')]&&_0x577e0e['customField']){_0x168405[_0x577e0e[_0xfa6b('0x2f')]['toLowerCase']()]=_0xcd8771[_0x577e0e[_0xfa6b('0x35')][_0xfa6b('0x36')][_0xfa6b('0x2e')]()]['toString']();}});}return _0x168405;}function getTicket(_0x209867,_0x29b43d,_0x180105,_0x2a1549,_0x36e65c,_0x5e1775){return function(_0xf53285){logger['info']('['+[_0x209867[_0xfa6b('0x11')]()]+_0xfa6b('0x37'),_0xf53285);return new Promise(function(_0x10dd7f,_0x5e695e){var _0x3222ef=_0x209867[_0xfa6b('0x2e')]()==='outbound'?_0xf53285[_0xfa6b('0x1c')]:_0xf53285[_0xfa6b('0x26')];var _0x3d54d2={'method':_0xfa6b('0x20'),'uri':_0x180105+_0xfa6b('0x38')+'?'+_0x5e1775,'body':Object[_0xfa6b('0x39')]({},{'active':_0xfa6b('0x1b'),'caller_id':_0x3222ef,'assigned_to':_0xf53285[_0xfa6b('0x1c')],'short_description':intUtil['getString'](_0x2a1549[_0xfa6b('0x3a')],_0x36e65c,'\x20'),'description':intUtil['getString'](_0x2a1549[_0xfa6b('0x3b')],_0x36e65c,'\x0a')},getCustomFields(_0x2a1549[_0xfa6b('0x3c')],_0x36e65c)),'auth':_0x29b43d,'json':!![]};return rp(_0x3d54d2)[_0xfa6b('0x1a')](function(_0x571b18){logger['info']('['+[_0x209867[_0xfa6b('0x11')]()]+_0xfa6b('0x3d'),_0x571b18[_0xfa6b('0xd')]);_0xf53285['ticketId']=_0x571b18['result']['sys_id'];_0xf53285[_0xfa6b('0x3e')]=_0x571b18['result'][_0xfa6b('0x3f')];logger[_0xfa6b('0x10')]('['+[_0x209867[_0xfa6b('0x11')]()]+_0xfa6b('0x40'),_0xf53285);_0x10dd7f(_0xf53285);})[_0xfa6b('0x13')](function(_0x43fad2){logger['error']('['+[_0x209867[_0xfa6b('0x11')]()]+']',_0x43fad2['message']);_0x5e695e(_0x43fad2[_0xfa6b('0x15')]);});});};}function createRemoteTag(_0x40b479,_0x32e966,_0x501c52,_0x1f7423){return new Promise(function(_0x43dcc7,_0x182b65){var _0x3f9c1f={'method':_0xfa6b('0x20'),'uri':_0x501c52+_0xfa6b('0x41')+'?'+_0x1f7423,'body':{'short_description':_0x40b479,'global':!![],'active':!![],'name':_0x40b479},'auth':_0x32e966,'json':!![]};return rp(_0x3f9c1f)[_0xfa6b('0x1a')](function(_0x4d0270){var _0x52ba03=_0x4d0270[_0xfa6b('0xd')][_0xfa6b('0xf')];_0x43dcc7(_0x52ba03);});});}function getRemoteTag(_0x55edba,_0xc4a67c,_0x3632c5,_0x17004f,_0x6f530){return new Promise(function(_0x5d3fed,_0x47713d){var _0x46ecaa={'method':_0xfa6b('0xb'),'uri':_0x3632c5+_0xfa6b('0x41')+_0xfa6b('0x42')+_0x55edba+'&'+_0x17004f,'auth':_0xc4a67c,'json':!![]};return rp(_0x46ecaa)['then'](function(_0x31d13f){if(_0x31d13f['result'][_0xfa6b('0xe')]>0x0){var _0x6339f2=_0x31d13f[_0xfa6b('0xd')][0x0]['sys_id'];_0x5d3fed(_0x6339f2);}else{return createRemoteTag(_0x55edba,_0xc4a67c,_0x3632c5,_0x17004f)[_0xfa6b('0x1a')](function(_0x2a3de1){_0x5d3fed(_0x2a3de1);});}});});}function assignTagToIncident(_0x27ff90,_0x59b43f,_0x1a4d9d,_0x17ceed,_0x3ca7c6){return new Promise(function(_0x3b6450,_0x245879){var _0x5739d9={'method':'POST','uri':_0x1a4d9d+_0xfa6b('0x43')+'?'+_0x3ca7c6,'body':{'label':_0x27ff90,'table':_0xfa6b('0x38'),'id_type':_0xfa6b('0x44'),'table_key':_0x17ceed[_0xfa6b('0x45')],'title':_0xfa6b('0x46')+_0x17ceed[_0xfa6b('0x3e')],'id_display':_0x17ceed[_0xfa6b('0x3e')]},'auth':_0x59b43f,'json':!![]};return rp(_0x5739d9)['then'](function(_0x207f4c){_0x3b6450();})[_0xfa6b('0x13')](function(){_0x3b6450();});});}function manageTags(_0x418e41,_0x45c50d,_0x36da9f,_0x60e08c,_0x8d1463,_0x2c4fdd,_0x421d3b){return new Promise(function(_0x2521ab,_0x30ae8b){var _0x199281=[];_0x45c50d[_0xfa6b('0x47')](function(_0x1111e5){_0x199281[_0xfa6b('0x48')](getRemoteTag(_0x1111e5,_0x36da9f,_0x60e08c,_0x2c4fdd,_0x421d3b));});return Promise[_0xfa6b('0x49')](_0x199281)['then'](function(_0x1343b6){if(_0x1343b6['length']){logger[_0xfa6b('0x10')]('['+[_0x418e41[_0xfa6b('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1343b6);var _0x26f8e3=[];_0x1343b6['forEach'](function(_0x442d3e){_0x26f8e3[_0xfa6b('0x48')](assignTagToIncident(_0x442d3e,_0x36da9f,_0x60e08c,_0x8d1463,_0x2c4fdd));});return Promise[_0xfa6b('0x49')](_0x26f8e3)[_0xfa6b('0x1a')](function(){_0x2521ab();})[_0xfa6b('0x13')](function(){_0x2521ab();});}else{_0x2521ab();}});});}function getTags(_0x36faf1,_0x4f9bbf,_0x74eacb,_0x52f6c3,_0x58e4c2,_0x436a35){return function(_0x25d96c){return new Promise(function(_0x21a354,_0x4445e0){var _0x373f69=[];var _0x33c9a9=_0x52f6c3[_0xfa6b('0x4a')];if(_0x33c9a9&&_0x33c9a9[_0xfa6b('0xe')]>0x0){_0x373f69=_['map'](_0x33c9a9,_0xfa6b('0x36'));}if(_0x373f69[_0xfa6b('0xe')]>0x0){return manageTags(_0x36faf1,_0x373f69,_0x4f9bbf,_0x74eacb,_0x25d96c,_0x58e4c2,_0x436a35)[_0xfa6b('0x1a')](function(){_0x21a354(_0x25d96c);});}else{_0x21a354(_0x25d96c);}});};}function emit(_0x7b48ab,_0x1f2361,_0x17e629){var _0x40c73e=_0xfa6b('0x4b')+_0xfa6b('0x4c')+_0xfa6b('0x4d')+_0xfa6b('0x4e');var _0x24fdd2={'uri':_0x7b48ab+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x17e629+_0x40c73e};io['to'](util[_0xfa6b('0x4f')](_0xfa6b('0x50'),_0x1f2361))[_0xfa6b('0x51')](_0xfa6b('0x52'),_0x24fdd2);}exports['cs']=function(_0xc1b033,_0x503508,_0x3ec13e,_0x1a7a87,_0x652991,_0x45f4b1,_0x55223e,_0x4e038c){var _0x416274={};var _0x1563b5={'user':_0x45f4b1[_0xfa6b('0x53')],'pass':_0x45f4b1['password']};var _0x43f231=_0xfa6b('0x54');var _0xa24ac=_0xfa6b('0x55');_0x45f4b1[_0xfa6b('0x56')]=intUtil[_0xfa6b('0x57')](_0x45f4b1[_0xfa6b('0x56')]);_0x45f4b1[_0xfa6b('0x58')]=intUtil[_0xfa6b('0x57')](_0x45f4b1[_0xfa6b('0x58')]);var _0x12c7f0=util[_0xfa6b('0x4f')](_0xfa6b('0x59'),_0x45f4b1[_0xfa6b('0x56')]);_0x416274['userEmail']=!_[_0xfa6b('0x5a')](_0x1a7a87)?_0x1a7a87[_0xfa6b('0x5b')]:null;_0x416274[_0xfa6b('0x1e')]=_0x45f4b1['email'];_0x416274['endUserNumber']=_0x4e038c[_0xfa6b('0x2e')]()==='outbound'?_0x503508['destcalleridnum']:_0x503508[_0xfa6b('0x5c')];_0x416274['callDirection']=_0x4e038c==='queue'||_0x4e038c===_0xfa6b('0x5d')?'queue':_0xfa6b('0x5e');var _0x550c3e=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45f4b1['serverUrl'],_0x503508['uniqueid'],md5(_0x503508[_0xfa6b('0x5f')]));if(_0x652991&&_0x652991[_0xfa6b('0x60')]){logger[_0xfa6b('0x10')]('[QUEUE]','Recording\x20is\x20enabled!');_0x503508[_0xfa6b('0x61')]=_0x550c3e;}else if(_0x55223e&&_0x55223e['recordingFormat']&&_0x55223e['recordingFormat']!==_0xfa6b('0x62')){logger['info'](_0xfa6b('0x63'),_0xfa6b('0x64'));_0x503508[_0xfa6b('0x61')]=_0x550c3e;}else{_0x503508[_0xfa6b('0x61')]='';}return getAdminUser(_0x4e038c,_0x1563b5,_0x416274,_0x12c7f0,_0xa24ac,_0x43f231)[_0xfa6b('0x1a')](getUser(_0x4e038c,_0x1563b5,_0x12c7f0,_0xa24ac,_0x43f231))[_0xfa6b('0x1a')](getEndUser(_0x4e038c,_0x1563b5,_0x12c7f0,_0xa24ac,_0x43f231))[_0xfa6b('0x1a')](getTicket(_0x4e038c,_0x1563b5,_0x12c7f0,_0x3ec13e,_0x503508,_0xa24ac))[_0xfa6b('0x1a')](function(_0x2fb39a){logger['info'](util[_0xfa6b('0x4f')](_0xfa6b('0x65'),_0x2fb39a[_0xfa6b('0x45')]));logger['info'](util['format'](_0xfa6b('0x66'),_0x4e038c));if(_0x4e038c!==_0xfa6b('0x5d')){logger[_0xfa6b('0x10')]('['+[_0x4e038c[_0xfa6b('0x11')]()]+']',_0xfa6b('0x67'));emit(_0x45f4b1[_0xfa6b('0x56')],_0x1a7a87[_0xfa6b('0x36')],_0x2fb39a[_0xfa6b('0x45')]);}})[_0xfa6b('0x13')](function(_0xd6422f){logger[_0xfa6b('0x14')]('['+[_0x4e038c[_0xfa6b('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0xd6422f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x72c7=['queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','toUpperCase','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','sys_id','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','customField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x72c7,0x1ba));var _0x772c=function(_0x324255,_0x373fa1){_0x324255=_0x324255-0x0;var _0xe885e1=_0x72c7[_0x324255];return _0xe885e1;};'use strict';var _=require(_0x772c('0x0'));var Promise=require(_0x772c('0x1'));var rp=require(_0x772c('0x2'));var util=require(_0x772c('0x3'));var md5=require(_0x772c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x772c('0x5'));var config=require(_0x772c('0x6'));var logger=require(_0x772c('0x7'))(_0x772c('0x8'));config[_0x772c('0x9')]=_['defaults'](config[_0x772c('0x9')],{'host':_0x772c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x772c('0x9')]));function getAdminUser(_0x49ace3,_0x3962cf,_0x3f49ec,_0x35aea9,_0x4ea344,_0x358063){return new Promise(function(_0x1a8249,_0x5a0fd5){var _0x4430e2={'method':_0x772c('0xb'),'uri':_0x35aea9+_0x772c('0xc')+'&'+_0x4ea344+'&'+_0x358063,'auth':_0x3962cf,'json':!![]};return rp(_0x4430e2)[_0x772c('0xd')](function(_0x5d2d75){if(_0x5d2d75[_0x772c('0xe')]['length']>0x0){_0x3f49ec[_0x772c('0xf')]=_0x5d2d75[_0x772c('0xe')][0x0]['sys_id'];}logger['info']('['+[_0x49ace3[_0x772c('0x10')]()]+'],\x20getAdminUser\x20crm',_0x3f49ec);_0x1a8249(_0x3f49ec);})[_0x772c('0x11')](function(_0x4a729d){logger[_0x772c('0x12')]('['+[_0x49ace3['toUpperCase']()]+']',_0x4a729d[_0x772c('0x13')]);_0x5a0fd5(_0x4a729d['message']);});});}function getUser(_0xf2fdf2,_0x1b0235,_0x3b962e,_0x3e5032,_0x1af4f1){return function(_0x2a6fa0){logger[_0x772c('0x14')]('['+[_0xf2fdf2['toUpperCase']()]+_0x772c('0x15'),_0x2a6fa0);return new Promise(function(_0x42c8b8,_0xc2430a){if(intUtil[_0x772c('0x16')](_0x2a6fa0[_0x772c('0x17')])){var _0x275899={'method':_0x772c('0xb'),'uri':_0x3b962e+'sys_user?sysparm_query=email%3D'+_0x2a6fa0[_0x772c('0x17')]+'&'+_0x3e5032+'&'+_0x1af4f1,'auth':_0x1b0235,'json':!![]};logger[_0x772c('0x14')]('['+[_0xf2fdf2[_0x772c('0x10')]()]+_0x772c('0x18'),_0x275899);return rp(_0x275899)[_0x772c('0xd')](function(_0x1964f3){logger['info']('['+[_0xf2fdf2['toUpperCase']()]+_0x772c('0x19'),_0x1964f3);if(_0x1964f3[_0x772c('0xe')][_0x772c('0x1a')]>0x0&&String(_0x1964f3[_0x772c('0xe')][0x0][_0x772c('0x1b')])===_0x772c('0x1c')){_0x2a6fa0[_0x772c('0x1d')]=_0x1964f3[_0x772c('0xe')][0x0]['sys_id'];}else{_0x2a6fa0['userId']=_0x2a6fa0['adminId'];_0x2a6fa0[_0x772c('0x17')]=_0x2a6fa0['adminEmail'];}logger[_0x772c('0x14')]('['+[_0xf2fdf2[_0x772c('0x10')]()]+'],\x20getUser\x20crm',_0x2a6fa0);_0x42c8b8(_0x2a6fa0);})[_0x772c('0x11')](function(_0x140aaf){logger[_0x772c('0x12')]('['+[_0xf2fdf2[_0x772c('0x10')]()]+']',_0x140aaf[_0x772c('0x13')]);_0xc2430a(_0x140aaf[_0x772c('0x13')]);});}else{logger[_0x772c('0x14')]('['+[_0xf2fdf2['toUpperCase']()]+_0x772c('0x1e'));_0x2a6fa0[_0x772c('0x1d')]=_0x2a6fa0[_0x772c('0xf')];_0x2a6fa0[_0x772c('0x17')]=_0x2a6fa0[_0x772c('0x1f')];_0x42c8b8(_0x2a6fa0);}});};}function createEndUser(_0x32bda1,_0x305922,_0x35e8a4,_0x3be41d,_0x47ac41){logger[_0x772c('0x14')]('['+[_0x32bda1[_0x772c('0x10')]()]+_0x772c('0x20'),_0x35e8a4);return new Promise(function(_0x4c06fd,_0x581a75){var _0x4c4825={'method':'POST','uri':_0x3be41d+_0x772c('0x21')+_0x47ac41,'body':{'user_name':_0x35e8a4[_0x772c('0x22')],'roles':_0x772c('0x23'),'first_name':_0x35e8a4[_0x772c('0x22')],'active':_0x772c('0x1c'),'date_format':_0x772c('0x24'),'phone':_0x35e8a4[_0x772c('0x22')]},'auth':_0x305922,'json':!![]};return rp(_0x4c4825)[_0x772c('0xd')](function(_0x7ee46b){logger[_0x772c('0x14')]('['+[_0x32bda1[_0x772c('0x10')]()]+'],\x20EndUser\x20schema',_0x7ee46b[_0x772c('0xe')]);_0x35e8a4['endUserId']=_0x7ee46b[_0x772c('0xe')][_0x772c('0x25')];_0x4c06fd(_0x35e8a4);})[_0x772c('0x11')](function(_0x441808){logger[_0x772c('0x12')]('['+[_0x32bda1[_0x772c('0x10')]()]+']',_0x441808[_0x772c('0x13')]);_0x581a75(_0x441808['message']);});});}function getEndUser(_0x37e2e6,_0xb6738b,_0x444a4a,_0x629e50,_0x3a4a20){return function(_0x18db08){logger[_0x772c('0x14')]('['+[_0x37e2e6['toUpperCase']()]+_0x772c('0x26'),_0x18db08);return new Promise(function(_0x3a1fca,_0x4a83e1){var _0x247798={'method':_0x772c('0xb'),'uri':_0x444a4a+'sys_user?sysparm_query=phone%3D'+_0x18db08[_0x772c('0x22')]+'&'+_0x629e50+'&'+_0x3a4a20,'auth':_0xb6738b,'json':!![]};return rp(_0x247798)['then'](function(_0x42d728){if(_0x42d728['result'][_0x772c('0x1a')]>0x0){_0x18db08[_0x772c('0x27')]=_0x42d728[_0x772c('0xe')][0x0][_0x772c('0x25')];logger['info']('['+[_0x37e2e6[_0x772c('0x10')]()]+_0x772c('0x28'),_0x18db08);_0x3a1fca(_0x18db08);}else{return createEndUser(_0x37e2e6,_0xb6738b,_0x18db08,_0x444a4a,_0x629e50)['then'](function(_0x4e77bd){logger['info']('['+[_0x37e2e6[_0x772c('0x10')]()]+_0x772c('0x29'),_0x4e77bd);_0x3a1fca(_0x4e77bd);});}})['catch'](function(_0x1a5dfc){logger[_0x772c('0x12')]('['+[_0x37e2e6[_0x772c('0x10')]()]+']',_0x1a5dfc['message']);_0x4a83e1(_0x1a5dfc['message']);});});};}function getCustomFields(_0x63819,_0x14cd82){var _0x4dcfc6={};if(_0x63819[_0x772c('0x1a')]>0x0){_[_0x772c('0x2a')](_0x63819,function(_0x655c0c){if(_['includes']([_0x772c('0x2b'),_0x772c('0x2c')],_0x655c0c[_0x772c('0x2d')])&&_0x655c0c['nameField']&&!_0x655c0c[_0x772c('0x2e')]){_0x4dcfc6[_0x655c0c['nameField'][_0x772c('0x2f')]()]=_0x655c0c[_0x772c('0x30')][_0x772c('0x31')]();}else if(_['includes'](['string',_0x772c('0x2c')],_0x655c0c[_0x772c('0x2d')])&&_0x655c0c[_0x772c('0x32')]&&_0x655c0c[_0x772c('0x2e')]){_0x4dcfc6[_0x655c0c['idField'][_0x772c('0x2f')]()]=_0x655c0c[_0x772c('0x30')]['toString']();}else if(_0x655c0c[_0x772c('0x2d')]===_0x772c('0x33')&&_0x655c0c[_0x772c('0x34')]&&_0x655c0c[_0x772c('0x32')]&&_0x655c0c[_0x772c('0x2e')]){_0x4dcfc6[_0x655c0c[_0x772c('0x32')][_0x772c('0x2f')]()]=_0x14cd82[_0x655c0c['variableName']]['toString']();}else if(_0x655c0c[_0x772c('0x2d')]==='customVariable'&&_0x655c0c[_0x772c('0x35')]&&_0x655c0c[_0x772c('0x35')][_0x772c('0x36')]&&_0x655c0c[_0x772c('0x32')]&&_0x655c0c[_0x772c('0x2e')]){_0x4dcfc6[_0x655c0c[_0x772c('0x32')][_0x772c('0x2f')]()]=_0x14cd82[_0x655c0c['Variable']['name']['toLowerCase']()][_0x772c('0x31')]();}});}return _0x4dcfc6;}function getTicket(_0x45cac4,_0x58d22f,_0x1b9ab8,_0x56c310,_0x4b014b,_0x46165a){return function(_0x22eaf1){logger[_0x772c('0x14')]('['+[_0x45cac4[_0x772c('0x10')]()]+_0x772c('0x37'),_0x22eaf1);return new Promise(function(_0x54b7af,_0x4ea286){var _0x5492fe=_0x45cac4[_0x772c('0x2f')]()===_0x772c('0x38')?_0x22eaf1[_0x772c('0x1d')]:_0x22eaf1[_0x772c('0x27')];var _0x26d228={'method':'POST','uri':_0x1b9ab8+_0x772c('0x39')+'?'+_0x46165a,'body':Object[_0x772c('0x3a')]({},{'active':_0x772c('0x1c'),'caller_id':_0x5492fe,'assigned_to':_0x22eaf1[_0x772c('0x1d')],'short_description':intUtil['getString'](_0x56c310[_0x772c('0x3b')],_0x4b014b,'\x20'),'description':intUtil['getString'](_0x56c310[_0x772c('0x3c')],_0x4b014b,'\x0a')},getCustomFields(_0x56c310[_0x772c('0x3d')],_0x4b014b)),'auth':_0x58d22f,'json':!![]};return rp(_0x26d228)[_0x772c('0xd')](function(_0x51ab96){logger[_0x772c('0x14')]('['+[_0x45cac4[_0x772c('0x10')]()]+_0x772c('0x3e'),_0x51ab96[_0x772c('0xe')]);_0x22eaf1[_0x772c('0x3f')]=_0x51ab96['result'][_0x772c('0x25')];_0x22eaf1[_0x772c('0x40')]=_0x51ab96[_0x772c('0xe')][_0x772c('0x41')];logger['info']('['+[_0x45cac4[_0x772c('0x10')]()]+']\x20getTicket\x20crm',_0x22eaf1);_0x54b7af(_0x22eaf1);})['catch'](function(_0x5c5b5f){logger[_0x772c('0x12')]('['+[_0x45cac4[_0x772c('0x10')]()]+']',_0x5c5b5f[_0x772c('0x13')]);_0x4ea286(_0x5c5b5f['message']);});});};}function createRemoteTag(_0x3bcde8,_0xf3f50a,_0x54e24b,_0x497c80){return new Promise(function(_0xf2ba29,_0x36d270){var _0x3ceba2={'method':'POST','uri':_0x54e24b+_0x772c('0x42')+'?'+_0x497c80,'body':{'short_description':_0x3bcde8,'global':!![],'active':!![],'name':_0x3bcde8},'auth':_0xf3f50a,'json':!![]};return rp(_0x3ceba2)['then'](function(_0x574254){var _0x2ddb10=_0x574254[_0x772c('0xe')]['sys_id'];_0xf2ba29(_0x2ddb10);});});}function getRemoteTag(_0x27bc52,_0x3d3e2a,_0x29fa99,_0x1af20b,_0x25c13e){return new Promise(function(_0x3733ac,_0x5e6f40){var _0x57a261={'method':_0x772c('0xb'),'uri':_0x29fa99+_0x772c('0x42')+_0x772c('0x43')+_0x27bc52+'&'+_0x1af20b,'auth':_0x3d3e2a,'json':!![]};return rp(_0x57a261)[_0x772c('0xd')](function(_0x43a20c){if(_0x43a20c[_0x772c('0xe')][_0x772c('0x1a')]>0x0){var _0x125c90=_0x43a20c[_0x772c('0xe')][0x0][_0x772c('0x25')];_0x3733ac(_0x125c90);}else{return createRemoteTag(_0x27bc52,_0x3d3e2a,_0x29fa99,_0x1af20b)[_0x772c('0xd')](function(_0xd89512){_0x3733ac(_0xd89512);});}});});}function assignTagToIncident(_0x326e2f,_0x31126f,_0x37e885,_0x3085d7,_0x364d4a){return new Promise(function(_0x6cf1ff,_0x1f47c0){var _0x35ff2f={'method':'POST','uri':_0x37e885+_0x772c('0x44')+'?'+_0x364d4a,'body':{'label':_0x326e2f,'table':_0x772c('0x39'),'id_type':_0x772c('0x45'),'table_key':_0x3085d7[_0x772c('0x3f')],'title':'Incident\x20-\x20'+_0x3085d7[_0x772c('0x40')],'id_display':_0x3085d7[_0x772c('0x40')]},'auth':_0x31126f,'json':!![]};return rp(_0x35ff2f)['then'](function(_0x226ec4){_0x6cf1ff();})[_0x772c('0x11')](function(){_0x6cf1ff();});});}function manageTags(_0x2720a8,_0x2581c8,_0x43f289,_0x4f5fc8,_0x162678,_0x568425,_0x5d71e4){return new Promise(function(_0x41fa58,_0x5001a4){var _0x4d7f43=[];_0x2581c8[_0x772c('0x2a')](function(_0x4d108e){_0x4d7f43[_0x772c('0x46')](getRemoteTag(_0x4d108e,_0x43f289,_0x4f5fc8,_0x568425,_0x5d71e4));});return Promise[_0x772c('0x47')](_0x4d7f43)[_0x772c('0xd')](function(_0x5d24ae){if(_0x5d24ae['length']){logger['info']('['+[_0x2720a8[_0x772c('0x10')]()]+_0x772c('0x48'),_0x5d24ae);var _0x3bcf2b=[];_0x5d24ae['forEach'](function(_0x42577b){_0x3bcf2b['push'](assignTagToIncident(_0x42577b,_0x43f289,_0x4f5fc8,_0x162678,_0x568425));});return Promise[_0x772c('0x47')](_0x3bcf2b)[_0x772c('0xd')](function(){_0x41fa58();})[_0x772c('0x11')](function(){_0x41fa58();});}else{_0x41fa58();}});});}function getTags(_0x20a727,_0x4a002e,_0x243aec,_0x29ed14,_0x1c78f6,_0x500c4b){return function(_0x2c314b){return new Promise(function(_0xea8b5f,_0x125bef){var _0x15e184=[];var _0x3c7a3d=_0x29ed14[_0x772c('0x49')];if(_0x3c7a3d&&_0x3c7a3d[_0x772c('0x1a')]>0x0){_0x15e184=_['map'](_0x3c7a3d,_0x772c('0x36'));}if(_0x15e184[_0x772c('0x1a')]>0x0){return manageTags(_0x20a727,_0x15e184,_0x4a002e,_0x243aec,_0x2c314b,_0x1c78f6,_0x500c4b)['then'](function(){_0xea8b5f(_0x2c314b);});}else{_0xea8b5f(_0x2c314b);}});};}function emit(_0x2a07a9,_0x1eba72,_0x2a6868){var _0x239464=_0x772c('0x4a')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x772c('0x4b')+'%255EORDERBYDESCnumber';var _0x5f152a={'uri':_0x2a07a9+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2a6868+_0x239464};io['to'](util[_0x772c('0x4c')](_0x772c('0x4d'),_0x1eba72))[_0x772c('0x4e')](_0x772c('0x4f'),_0x5f152a);}exports['cs']=function(_0x59aa6c,_0x12c6ff,_0x5e3cea,_0xcf2b65,_0x570ba5,_0x3c0c82,_0x56955f,_0x36aaff){var _0x390a99={};var _0x4a06ed={'user':_0x3c0c82[_0x772c('0x50')],'pass':_0x3c0c82[_0x772c('0x51')]};var _0x1e160a=_0x772c('0x52');var _0x4211ec=_0x772c('0x53');_0x3c0c82['remoteUri']=intUtil[_0x772c('0x54')](_0x3c0c82[_0x772c('0x55')]);_0x3c0c82['serverUrl']=intUtil['stripTrailingSlash'](_0x3c0c82[_0x772c('0x56')]);var _0xf1627d=util[_0x772c('0x4c')](_0x772c('0x57'),_0x3c0c82[_0x772c('0x55')]);_0x390a99[_0x772c('0x17')]=!_[_0x772c('0x58')](_0xcf2b65)?_0xcf2b65[_0x772c('0x59')]:null;_0x390a99['adminEmail']=_0x3c0c82[_0x772c('0x59')];_0x390a99[_0x772c('0x22')]=_0x36aaff[_0x772c('0x2f')]()===_0x772c('0x38')?_0x12c6ff[_0x772c('0x5a')]:_0x12c6ff[_0x772c('0x5b')];_0x390a99[_0x772c('0x5c')]=_0x36aaff===_0x772c('0x5d')||_0x36aaff==='unmanaged'?_0x772c('0x5d'):'outbound';var _0x29c316=util[_0x772c('0x4c')](_0x772c('0x5e'),_0x3c0c82[_0x772c('0x56')],_0x12c6ff[_0x772c('0x5f')],md5(_0x12c6ff[_0x772c('0x5f')]));if(_0x570ba5&&_0x570ba5[_0x772c('0x60')]){logger[_0x772c('0x14')]('[QUEUE]',_0x772c('0x61'));_0x12c6ff[_0x772c('0x62')]=_0x29c316;}else if(_0x56955f&&_0x56955f[_0x772c('0x63')]&&_0x56955f[_0x772c('0x63')]!==_0x772c('0x64')){logger[_0x772c('0x14')](_0x772c('0x65'),'Recording\x20is\x20enabled!');_0x12c6ff[_0x772c('0x62')]=_0x29c316;}else{_0x12c6ff['recordingURL']='';}return getAdminUser(_0x36aaff,_0x4a06ed,_0x390a99,_0xf1627d,_0x4211ec,_0x1e160a)[_0x772c('0xd')](getUser(_0x36aaff,_0x4a06ed,_0xf1627d,_0x4211ec,_0x1e160a))[_0x772c('0xd')](getEndUser(_0x36aaff,_0x4a06ed,_0xf1627d,_0x4211ec,_0x1e160a))[_0x772c('0xd')](getTicket(_0x36aaff,_0x4a06ed,_0xf1627d,_0x5e3cea,_0x12c6ff,_0x4211ec))['then'](function(_0x2b0f08){logger[_0x772c('0x14')](util[_0x772c('0x4c')](_0x772c('0x66'),_0x2b0f08[_0x772c('0x3f')]));logger['info'](util[_0x772c('0x4c')](_0x772c('0x67'),_0x36aaff));if(_0x36aaff!==_0x772c('0x68')){logger[_0x772c('0x14')]('['+[_0x36aaff['toUpperCase']()]+']',_0x772c('0x69'));emit(_0x3c0c82[_0x772c('0x55')],_0xcf2b65[_0x772c('0x36')],_0x2b0f08[_0x772c('0x3f')]);}})[_0x772c('0x11')](function(_0x52d98c){logger[_0x772c('0x12')]('['+[_0x36aaff[_0x772c('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x772c('0x6a')](_0x52d98c,{'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 2dc62e3..40ae0ee 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 _0x390e=['isNil','Fields','Inbound','lodash','bluebird','md5','util','./util','../../../../config/environment','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase'];(function(_0x15aac2,_0x35a160){var _0x1adcaf=function(_0x5d0185){while(--_0x5d0185){_0x15aac2['push'](_0x15aac2['shift']());}};_0x1adcaf(++_0x35a160);}(_0x390e,0xf3));var _0xe390=function(_0xa2d062,_0x5e9209){_0xa2d062=_0xa2d062-0x0;var _0x1bd5ce=_0x390e[_0xa2d062];return _0x1bd5ce;};'use strict';var _=require(_0xe390('0x0'));var rp=require('request-promise');var BPromise=require(_0xe390('0x1'));var md5=require(_0xe390('0x2'));var util=require(_0xe390('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe390('0x4'));var config=require(_0xe390('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config[_0xe390('0x6')]=_[_0xe390('0x7')](config[_0xe390('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe390('0x8'))(new Redis(config[_0xe390('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x425e2c,_0x4a6e4f,_0x2e3864){io['to'](_0x425e2c)[_0xe390('0x9')](_0x4a6e4f,_0x2e3864);}function getTicket(_0x1e61a7,_0x386d84,_0x39114a,_0x10fb79,_0x45eb4f,_0x38925e,_0x6e292c,_0x4f2d5f){logger[_0xe390('0xa')](_0xe390('0xb'));var _0x1b315c=new Date();var _0x10cb35=[{'name':_0xe390('0xc'),'value':intUtil['getString'](_0x10fb79[_0xe390('0xd')],_0x45eb4f,'\x20')},{'name':_0xe390('0xe'),'value':_0x386d84['id']},{'name':'created_by','value':_0x386d84['id']},{'name':_0xe390('0xf'),'value':intUtil[_0xe390('0x10')](_0x10fb79[_0xe390('0x11')],_0x45eb4f,'\x0a')},{'name':_0xe390('0x12'),'value':_0x1b315c[_0xe390('0x13')]()[_0xe390('0x14')](0x0,0x13)[_0xe390('0x15')]('T','\x20')},{'name':_0xe390('0x16'),'value':'0'},{'name':_0xe390('0x17'),'value':'15'},{'name':_0xe390('0x18'),'value':_0x39114a['id']},{'name':'parent_type','value':_0xe390('0x19')},{'name':'parent_name','value':_0x39114a[_0xe390('0xc')]},{'name':_0xe390('0x1a'),'value':_0x4f2d5f}];if(_0x38925e[_0xe390('0x1b')]){_[_0xe390('0x1c')](_0x38925e,function(_0x2039a6){if(_0x45eb4f[_0x2039a6[_0xe390('0x1d')]]){_0x10cb35[_0xe390('0x1e')]({'name':_0x2039a6[_0xe390('0x1f')],'value':_0x45eb4f[_0x2039a6[_0xe390('0x1d')]]});}});}return request({'form':{'method':_0xe390('0x20'),'input_type':_0xe390('0x21'),'response_type':_0xe390('0x21'),'rest_data':JSON[_0xe390('0x22')]({'session':_0x6e292c['id'],'module_name':_0xe390('0x23'),'name_value_list':_0x10cb35})}});}function getAuth(_0x5f0dd6){return util[_0xe390('0x24')](_0xe390('0x25'),new Buffer(_0x5f0dd6[_0xe390('0x26')]+':X')[_0xe390('0x27')]('base64'));}function getServerInfo(_0x3a6a0e){return request({'form':{'method':_0xe390('0x28'),'input_type':_0xe390('0x21'),'response_type':'JSON','rest_data':JSON[_0xe390('0x22')]({'session':_0x3a6a0e['id']})}});}function getUser(_0x40ce72,_0x2f0cac,_0x4d8d91){if(!_['isNil'](_0x2f0cac)){logger[_0xe390('0xa')]('Getting\x20agent\x20with\x20name',_0x2f0cac);return request({'form':{'method':'get_entry_list','input_type':_0xe390('0x21'),'response_type':_0xe390('0x21'),'rest_data':JSON[_0xe390('0x22')]({'session':_0x4d8d91['id'],'module_name':_0xe390('0x29'),'query':util[_0xe390('0x24')](_0xe390('0x2a'),_0x2f0cac),'order_by':'','offset':'0','select_fields':['id',_0xe390('0xc'),_0xe390('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe390('0x2c')](function(_0x1b7094){if(_0x1b7094[_0xe390('0x2d')][_0xe390('0x1b')]){var _0x3e93f0=_[_0xe390('0x2e')](_0x1b7094[_0xe390('0x2d')],function(_0x2492cc){return _0x2492cc[_0xe390('0x2f')][_0xe390('0x2b')][_0xe390('0x30')]===_0x2f0cac;});if(_0x3e93f0){logger['info'](_0xe390('0x31'));return BPromise[_0xe390('0x32')]({'id':_0x3e93f0[_0xe390('0x2f')]['id']['value'],'name':_0x3e93f0[_0xe390('0x2f')][_0xe390('0xc')][_0xe390('0x30')]});}}logger[_0xe390('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe390('0x32')]({'id':_0x4d8d91[_0xe390('0x2f')]['user_id'][_0xe390('0x30')],'name':_0x4d8d91['name_value_list'][_0xe390('0x2b')][_0xe390('0x30')]});});}else{logger['info'](_0xe390('0x33'));return BPromise[_0xe390('0x32')]({'id':_0x4d8d91[_0xe390('0x2f')][_0xe390('0x34')]['value'],'name':_0x4d8d91[_0xe390('0x2f')][_0xe390('0x2b')][_0xe390('0x30')]});}}function getEndUser(_0x386684,_0x5a165e,_0x54f247,_0x3c5316){logger[_0xe390('0xa')](_0xe390('0x35'),_0x54f247);return request({'form':{'method':_0xe390('0x36'),'input_type':'JSON','response_type':_0xe390('0x21'),'rest_data':JSON[_0xe390('0x22')]({'session':_0x3c5316['id'],'module_name':_0xe390('0x19'),'query':util[_0xe390('0x24')](_0xe390('0x37'),_0x54f247),'order_by':'','offset':'0','select_fields':['id',_0xe390('0xc'),_0xe390('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe390('0x2c')](function(_0x34c6ca){if(_0x34c6ca[_0xe390('0x2d')][_0xe390('0x1b')]){var _0x4d5405=_['find'](_0x34c6ca[_0xe390('0x2d')],function(_0x2e509b){return _0x2e509b['name_value_list'][_0xe390('0x38')]['value']===_0x54f247;});if(_0x4d5405){logger[_0xe390('0xa')](_0xe390('0x39'));return BPromise[_0xe390('0x32')]({'id':_0x4d5405[_0xe390('0x2f')]['id']['value'],'name':_0x4d5405[_0xe390('0x2f')][_0xe390('0xc')][_0xe390('0x30')],'phone':_0x4d5405[_0xe390('0x2f')][_0xe390('0x38')]['value']});}}else{logger[_0xe390('0xa')](_0xe390('0x3a'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe390('0x22')]({'session':_0x3c5316['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x5a165e!==_0xe390('0x3b')?_0x5a165e:util[_0xe390('0x24')]('Caller\x20-\x20%s',_0x54f247)},{'name':_0xe390('0x38'),'value':_0x54f247}]})}})[_0xe390('0x2c')](function(_0x5cbd50){logger['info'](_0xe390('0x3c'));return BPromise[_0xe390('0x32')]({'id':_0x5cbd50['id'],'name':_0x5cbd50['entry_list'][_0xe390('0x3d')][_0xe390('0x30')],'phone':_0x5cbd50[_0xe390('0x2d')]['phone_home'][_0xe390('0x30')]});});}});}function request(_0x1fb255){logger[_0xe390('0x3e')](_0xe390('0x3f'),JSON[_0xe390('0x22')](_0x1fb255));return rp(_[_0xe390('0x40')](def,_0x1fb255));}function getTags(_0xa31b98,_0x293465){var _0x1d7eaa=[];if(_0xa31b98&&_0xa31b98[_0xe390('0x1b')]>0x0){_0x1d7eaa=_[_0xe390('0x41')](_0xa31b98,_0x293465);}return _0x1d7eaa;}function getCustomFields(_0x178827,_0x4ecb73){var _0x494ba7=[];var _0xc7e9b3={'custom_fields':[]};if(_0x178827[_0xe390('0x1b')]>0x0){_['forEach'](_0x178827,function(_0x10dfd0){if(_0x10dfd0[_0xe390('0x42')]===_0xe390('0x43')&&_0x10dfd0['nameField']&&!_0x10dfd0[_0xe390('0x44')]){_0xc7e9b3[_0x10dfd0[_0xe390('0x45')][_0xe390('0x46')]()]=_0x10dfd0[_0xe390('0x47')][_0xe390('0x27')]();}else if(_0x10dfd0[_0xe390('0x42')]===_0xe390('0x43')&&_0x10dfd0[_0xe390('0x1f')]&&_0x10dfd0[_0xe390('0x44')]){_0xc7e9b3[_0xe390('0x48')]['push']({'id':_0x10dfd0[_0xe390('0x1f')],'value':_0x10dfd0['content'][_0xe390('0x27')]()});}else if(_0x10dfd0[_0xe390('0x42')]===_0xe390('0x49')&&_0x10dfd0[_0xe390('0x1d')]&&_0x10dfd0[_0xe390('0x1f')]&&_0x10dfd0[_0xe390('0x44')]){_0x4ecb73[_0x10dfd0[_0xe390('0x1d')]]&&_0xc7e9b3[_0xe390('0x48')][_0xe390('0x1e')]({'id':_0x10dfd0[_0xe390('0x1f')],'value':_0x4ecb73[_0x10dfd0[_0xe390('0x1d')]][_0xe390('0x27')]()});}else if(_0x10dfd0[_0xe390('0x42')]==='customVariable'&&_0x10dfd0[_0xe390('0x4a')]&&_0x10dfd0[_0xe390('0x4a')]['name']&&_0x10dfd0[_0xe390('0x1f')]&&_0x10dfd0[_0xe390('0x44')]){_0x4ecb73[_0x10dfd0['Variable'][_0xe390('0xc')]['toLowerCase']()]&&_0xc7e9b3[_0xe390('0x48')]['push']({'id':_0x10dfd0['idField'],'value':_0x4ecb73[_0x10dfd0['Variable'][_0xe390('0xc')][_0xe390('0x46')]()][_0xe390('0x27')]()});}});}return _0xc7e9b3;}function getConnection(_0x5d391c){return request({'method':'POST','form':{'method':_0xe390('0x4b'),'input_type':'JSON','response_type':_0xe390('0x21'),'rest_data':JSON[_0xe390('0x22')]({'user_auth':{'user_name':_0x5d391c['username'],'password':_0x5d391c[_0xe390('0x4c')],'encryption':_0xe390('0x4d')},'application':_0xe390('0x4e')})}})[_0xe390('0x2c')](function(_0x69fedd){var _0x2a50f9=_0x69fedd;if(_0x2a50f9['id']){def[_0xe390('0x4f')]=_0x2a50f9['id'];return BPromise['resolve'](_0x2a50f9);}else{throw new Error(util['format'](_0xe390('0x50'),_0x5d391c['id']));}});}function setRelationship(_0x4b45c6,_0x37c243,_0x4e137f,_0x503b74){return request({'form':{'method':_0xe390('0x51'),'input_type':_0xe390('0x21'),'response_type':_0xe390('0x21'),'rest_data':JSON[_0xe390('0x22')]({'session':_0x4b45c6['id'],'module_name':'Calls','module_id':_0x4e137f['id'],'link_field_name':_0x503b74,'related_ids':[_0x37c243['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe390('0x52')]=function(_0x20b5f2,_0x5b938b,_0x47d14d,_0x401534,_0x3ca2e2,_0x26d157){var _0x3a5676,_0x24508f,_0x5499a1,_0x51001f;_0x26d157[_0xe390('0x53')]=intUtil[_0xe390('0x54')](_0x26d157[_0xe390('0x53')]);_0x26d157[_0xe390('0x55')]=intUtil[_0xe390('0x54')](_0x26d157['serverUrl']);def[_0xe390('0x56')]=util[_0xe390('0x24')](_0xe390('0x57'),_0x26d157[_0xe390('0x53')]);if(_0x3ca2e2&&_0x3ca2e2['monitor_format']){logger[_0xe390('0xa')](_0xe390('0x58'),'Recording\x20is\x20enabled!');_0x5b938b['recordingURL']=util['format'](_0xe390('0x59'),_0x26d157[_0xe390('0x55')],_0x5b938b[_0xe390('0x5a')],md5(_0x5b938b[_0xe390('0x5a')]));}else{_0x5b938b[_0xe390('0x5b')]='';}return getConnection(_0x26d157)[_0xe390('0x2c')](function(_0x42608e){_0x51001f=_0x42608e;return getUser(_0x26d157,_0x401534[_0xe390('0xc')],_0x51001f);})[_0xe390('0x2c')](function(_0x5ae8ea){_0x3a5676=_0x5ae8ea;logger[_0xe390('0xa')]('The\x20User\x20ID\x20is:',_0x3a5676['id']);return getEndUser(_0x26d157,_0x5b938b['calleridname'],_0x5b938b[_0xe390('0x5c')],_0x51001f);})[_0xe390('0x2c')](function(_0x4f6bf1){_0x24508f=_0x4f6bf1;logger[_0xe390('0xa')](_0xe390('0x5d'),_0x24508f['id']);return getTicket(_0x26d157,_0x3a5676,_0x24508f,_0x47d14d,_0x5b938b,_0x47d14d['Fields'],_0x51001f,'Inbound');})[_0xe390('0x2c')](function(_0x1b90b9){_0x5499a1=_0x1b90b9;logger[_0xe390('0xa')]('Ticket\x20created!');logger[_0xe390('0xa')](_0xe390('0x5e'),_0x5499a1['id']);return setRelationship(_0x51001f,_0x3a5676,_0x5499a1,_0xe390('0x5f'));})[_0xe390('0x2c')](function(){return setRelationship(_0x51001f,_0x24508f,_0x5499a1,_0xe390('0x60'));})[_0xe390('0x2c')](function(){return getServerInfo(_0x51001f);})[_0xe390('0x2c')](function(_0x47529d){var _0x5f3089=parseInt(_0x47529d[_0xe390('0x61')][_0xe390('0x62')](0x0));var _0x39d5c7=util[_0xe390('0x24')](_0xe390('0x63'),_0x26d157[_0xe390('0x53')],_0x5499a1['id']);if(_0x5f3089>0x6){_0x39d5c7=util[_0xe390('0x24')](_0xe390('0x64'),_0x26d157[_0xe390('0x53')],_0x5499a1['id']);}logger[_0xe390('0xa')]('[QUEUE]',_0xe390('0x65'));emit(util[_0xe390('0x24')]('user:%s',_0x401534[_0xe390('0xc')]),_0xe390('0x66'),{'uri':_0x39d5c7});})[_0xe390('0x67')](function(_0x30c539){logger[_0xe390('0x68')]('[QUEUE]',JSON['stringify'](_0x30c539));});};exports['outbound']=function(_0x5a6920,_0x5c183a,_0x3c3e67,_0x5bfd59,_0x528e06,_0x5c3303,_0x59da15){var _0x13905a,_0x312ff9,_0x203af6,_0x5f557f;_0x5c3303[_0xe390('0x53')]=intUtil[_0xe390('0x54')](_0x5c3303['remoteUri']);_0x5c3303[_0xe390('0x55')]=intUtil[_0xe390('0x54')](_0x5c3303[_0xe390('0x55')]);def[_0xe390('0x56')]=util[_0xe390('0x24')](_0xe390('0x57'),_0x5c3303[_0xe390('0x53')]);if(_0x59da15&&_0x59da15[_0xe390('0x69')]&&_0x59da15[_0xe390('0x69')]!==_0xe390('0x6a')){logger[_0xe390('0xa')]('[OUTBOUND]',_0xe390('0x6b'));_0x5c183a[_0xe390('0x5b')]=util['format'](_0xe390('0x59'),_0x5c3303[_0xe390('0x55')],_0x5c183a[_0xe390('0x5a')],md5(_0x5c183a[_0xe390('0x5a')]));}return getConnection(_0x5c3303)[_0xe390('0x2c')](function(_0x4a9e8e){_0x5f557f=_0x4a9e8e;return getUser(_0x5c3303,_0x5bfd59[_0xe390('0xc')],_0x5f557f);})[_0xe390('0x2c')](function(_0x6ffd0e){_0x13905a=_0x6ffd0e;logger[_0xe390('0xa')]('The\x20User\x20ID\x20is:',_0x13905a['id']);return getEndUser(_0x5c3303,_0x5c183a[_0xe390('0x6c')],_0x5c183a[_0xe390('0x6d')],_0x5f557f);})['then'](function(_0x45a44d){_0x312ff9=_0x45a44d;logger[_0xe390('0xa')](_0xe390('0x5d'),_0x312ff9['id']);return getTicket(_0x5c3303,_0x13905a,_0x312ff9,_0x3c3e67,_0x5c183a,_0x3c3e67['Fields'],_0x5f557f,_0xe390('0x6e'));})[_0xe390('0x2c')](function(_0x58fb7b){_0x203af6=_0x58fb7b;logger[_0xe390('0xa')](_0xe390('0x6f'));logger[_0xe390('0xa')]('The\x20Ticket\x20ID\x20is:',_0x203af6['id']);return setRelationship(_0x5f557f,_0x13905a,_0x203af6,_0xe390('0x5f'));})[_0xe390('0x2c')](function(){return setRelationship(_0x5f557f,_0x312ff9,_0x203af6,_0xe390('0x60'));})[_0xe390('0x2c')](function(){return getServerInfo(_0x5f557f);})[_0xe390('0x2c')](function(_0x3dd7d2){var _0x4a8b30=parseInt(_0x3dd7d2['version'][_0xe390('0x62')](0x0));var _0x4812a4=util[_0xe390('0x24')](_0xe390('0x63'),_0x5c3303[_0xe390('0x53')],_0x203af6['id']);if(_0x4a8b30>0x6){_0x4812a4=util[_0xe390('0x24')](_0xe390('0x64'),_0x5c3303[_0xe390('0x53')],_0x203af6['id']);}logger['info'](_0xe390('0x70'),_0xe390('0x65'));emit(util[_0xe390('0x24')]('user:%s',_0x5bfd59[_0xe390('0xc')]),_0xe390('0x66'),{'uri':_0x4812a4});})[_0xe390('0x67')](function(_0x2d83df){logger[_0xe390('0x68')](_0xe390('0x70'),JSON['stringify'](_0x2d83df));});};exports[_0xe390('0x71')]=function(_0x2fe9e0,_0x521f4f,_0x349b8a,_0x475086,_0x23aa22,_0x574b51){var _0x3af67a,_0x1f2d36,_0x448c16,_0x34ffb4;_0x574b51[_0xe390('0x53')]=intUtil[_0xe390('0x54')](_0x574b51[_0xe390('0x53')]);_0x574b51[_0xe390('0x55')]=intUtil['stripTrailingSlash'](_0x574b51['serverUrl']);def[_0xe390('0x56')]=util[_0xe390('0x24')](_0xe390('0x57'),_0x574b51[_0xe390('0x53')]);if(_0x23aa22&&_0x23aa22[_0xe390('0x72')]){logger[_0xe390('0xa')]('['+_0x521f4f[_0xe390('0x73')][_0xe390('0x74')]()+']','Recording\x20is\x20enabled!');_0x521f4f['recordingURL']=util[_0xe390('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x574b51[_0xe390('0x55')],_0x521f4f[_0xe390('0x5a')],md5(_0x521f4f['uniqueid']));}else{_0x521f4f[_0xe390('0x5b')]='';}return getConnection(_0x574b51)[_0xe390('0x2c')](function(_0x177e52){_0x34ffb4=_0x177e52;if(!_[_0xe390('0x75')](_0x475086)){return getUser(_0x574b51,_0x475086[_0xe390('0xc')],_0x34ffb4);}else{return getUser(_0x574b51,null,_0x34ffb4);}})[_0xe390('0x2c')](function(_0x28b133){_0x3af67a=_0x28b133;logger[_0xe390('0xa')]('The\x20User\x20ID\x20is:',_0x3af67a['id']);return getEndUser(_0x574b51,_0x521f4f['calleridname'],_0x521f4f[_0xe390('0x5c')],_0x34ffb4);})[_0xe390('0x2c')](function(_0x4fc267){_0x1f2d36=_0x4fc267;logger[_0xe390('0xa')](_0xe390('0x5d'),_0x1f2d36['id']);return getTicket(_0x574b51,_0x3af67a,_0x1f2d36,_0x349b8a,_0x521f4f,_0x349b8a[_0xe390('0x76')],_0x34ffb4,_0xe390('0x77'));})[_0xe390('0x2c')](function(_0x1930d9){_0x448c16=_0x1930d9;logger[_0xe390('0xa')]('Ticket\x20created!');logger[_0xe390('0xa')](_0xe390('0x5e'),_0x448c16['id']);return setRelationship(_0x34ffb4,_0x3af67a,_0x448c16,_0xe390('0x5f'));})[_0xe390('0x2c')](function(){return setRelationship(_0x34ffb4,_0x1f2d36,_0x448c16,'contacts');})[_0xe390('0x2c')](function(){return getServerInfo(_0x34ffb4);})[_0xe390('0x67')](function(_0x43686d){logger[_0xe390('0x68')]('['+_0x521f4f[_0xe390('0x73')]['toUpperCase']()+']',JSON[_0xe390('0x22')](_0x43686d));});}; \ No newline at end of file +var _0xfa54=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','charAt','trigger:browser:url','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','Descriptions','date_start','toISOString','slice','parent_id','name','direction','length','forEach','variableName','idField','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','customField','toLowerCase','custom_fields','push','customVariable','Variable','POST','login','username','PLAIN','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!'];(function(_0x183f90,_0x568f8b){var _0x3d9d18=function(_0x4dd648){while(--_0x4dd648){_0x183f90['push'](_0x183f90['shift']());}};_0x3d9d18(++_0x568f8b);}(_0xfa54,0xf1));var _0x4fa5=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfa54[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x4fa5('0x0'));var rp=require(_0x4fa5('0x1'));var BPromise=require(_0x4fa5('0x2'));var md5=require(_0x4fa5('0x3'));var util=require('util');var Redis=require(_0x4fa5('0x4'));var intUtil=require(_0x4fa5('0x5'));var config=require(_0x4fa5('0x6'));var logger=require(_0x4fa5('0x7'))(_0x4fa5('0x8'));config[_0x4fa5('0x9')]=_['defaults'](config[_0x4fa5('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4fa5('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x5bef87,_0x35be5f,_0x20cb0b){io['to'](_0x5bef87)[_0x4fa5('0xb')](_0x35be5f,_0x20cb0b);}function getTicket(_0x3db9f8,_0x4f74e7,_0x279585,_0x4d8d8e,_0x2517e3,_0x58527c,_0x3d206a,_0x4187b0){logger[_0x4fa5('0xc')](_0x4fa5('0xd'));var _0x330398=new Date();var _0x11dcf9=[{'name':'name','value':intUtil[_0x4fa5('0xe')](_0x4d8d8e[_0x4fa5('0xf')],_0x2517e3,'\x20')},{'name':'assigned_user_id','value':_0x4f74e7['id']},{'name':_0x4fa5('0x10'),'value':_0x4f74e7['id']},{'name':'description','value':intUtil['getString'](_0x4d8d8e[_0x4fa5('0x11')],_0x2517e3,'\x0a')},{'name':_0x4fa5('0x12'),'value':_0x330398[_0x4fa5('0x13')]()[_0x4fa5('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x4fa5('0x15'),'value':_0x279585['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x279585[_0x4fa5('0x16')]},{'name':_0x4fa5('0x17'),'value':_0x4187b0}];if(_0x58527c[_0x4fa5('0x18')]){_[_0x4fa5('0x19')](_0x58527c,function(_0x31aecd){if(_0x2517e3[_0x31aecd[_0x4fa5('0x1a')]]){_0x11dcf9['push']({'name':_0x31aecd[_0x4fa5('0x1b')],'value':_0x2517e3[_0x31aecd[_0x4fa5('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3d206a['id'],'module_name':_0x4fa5('0x1c'),'name_value_list':_0x11dcf9})}});}function getAuth(_0x10df12){return util[_0x4fa5('0x1d')](_0x4fa5('0x1e'),new Buffer(_0x10df12[_0x4fa5('0x1f')]+':X')[_0x4fa5('0x20')](_0x4fa5('0x21')));}function getServerInfo(_0xa34e46){return request({'form':{'method':_0x4fa5('0x22'),'input_type':'JSON','response_type':_0x4fa5('0x23'),'rest_data':JSON[_0x4fa5('0x24')]({'session':_0xa34e46['id']})}});}function getUser(_0x332fac,_0x23362f,_0x2cc89a){if(!_[_0x4fa5('0x25')](_0x23362f)){logger['info'](_0x4fa5('0x26'),_0x23362f);return request({'form':{'method':_0x4fa5('0x27'),'input_type':_0x4fa5('0x23'),'response_type':_0x4fa5('0x23'),'rest_data':JSON[_0x4fa5('0x24')]({'session':_0x2cc89a['id'],'module_name':_0x4fa5('0x28'),'query':util[_0x4fa5('0x1d')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x23362f),'order_by':'','offset':'0','select_fields':['id',_0x4fa5('0x16'),_0x4fa5('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4fa5('0x2a')](function(_0x2e1518){if(_0x2e1518[_0x4fa5('0x2b')][_0x4fa5('0x18')]){var _0x60dce3=_[_0x4fa5('0x2c')](_0x2e1518[_0x4fa5('0x2b')],function(_0x903a1e){return _0x903a1e[_0x4fa5('0x2d')][_0x4fa5('0x29')][_0x4fa5('0x2e')]===_0x23362f;});if(_0x60dce3){logger[_0x4fa5('0xc')](_0x4fa5('0x2f'));return BPromise[_0x4fa5('0x30')]({'id':_0x60dce3[_0x4fa5('0x2d')]['id'][_0x4fa5('0x2e')],'name':_0x60dce3[_0x4fa5('0x2d')][_0x4fa5('0x16')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2cc89a['name_value_list'][_0x4fa5('0x31')][_0x4fa5('0x2e')],'name':_0x2cc89a[_0x4fa5('0x2d')][_0x4fa5('0x29')]['value']});});}else{logger[_0x4fa5('0xc')](_0x4fa5('0x32'));return BPromise[_0x4fa5('0x30')]({'id':_0x2cc89a[_0x4fa5('0x2d')][_0x4fa5('0x31')][_0x4fa5('0x2e')],'name':_0x2cc89a[_0x4fa5('0x2d')][_0x4fa5('0x29')][_0x4fa5('0x2e')]});}}function getEndUser(_0x34e2c6,_0x56a326,_0x81033e,_0x47b613){logger[_0x4fa5('0xc')](_0x4fa5('0x33'),_0x81033e);return request({'form':{'method':_0x4fa5('0x27'),'input_type':'JSON','response_type':_0x4fa5('0x23'),'rest_data':JSON[_0x4fa5('0x24')]({'session':_0x47b613['id'],'module_name':_0x4fa5('0x34'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x81033e),'order_by':'','offset':'0','select_fields':['id',_0x4fa5('0x16'),_0x4fa5('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4fa5('0x2a')](function(_0x4c1f4c){if(_0x4c1f4c['entry_list'][_0x4fa5('0x18')]){var _0x240068=_[_0x4fa5('0x2c')](_0x4c1f4c['entry_list'],function(_0x529245){return _0x529245['name_value_list']['phone_home']['value']===_0x81033e;});if(_0x240068){logger[_0x4fa5('0xc')](_0x4fa5('0x36'));return BPromise['resolve']({'id':_0x240068[_0x4fa5('0x2d')]['id']['value'],'name':_0x240068['name_value_list'][_0x4fa5('0x16')]['value'],'phone':_0x240068[_0x4fa5('0x2d')][_0x4fa5('0x35')][_0x4fa5('0x2e')]});}}else{logger[_0x4fa5('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x4fa5('0x37'),'input_type':_0x4fa5('0x23'),'response_type':_0x4fa5('0x23'),'rest_data':JSON[_0x4fa5('0x24')]({'session':_0x47b613['id'],'module_name':'Contacts','name_value_list':[{'name':_0x4fa5('0x38'),'value':_0x56a326!==_0x4fa5('0x39')?_0x56a326:util[_0x4fa5('0x1d')](_0x4fa5('0x3a'),_0x81033e)},{'name':_0x4fa5('0x35'),'value':_0x81033e}]})}})[_0x4fa5('0x2a')](function(_0x5aa2de){logger['info'](_0x4fa5('0x3b'));return BPromise['resolve']({'id':_0x5aa2de['id'],'name':_0x5aa2de[_0x4fa5('0x2b')][_0x4fa5('0x38')][_0x4fa5('0x2e')],'phone':_0x5aa2de[_0x4fa5('0x2b')][_0x4fa5('0x35')]['value']});});}});}function request(_0x3b6077){logger[_0x4fa5('0x3c')](_0x4fa5('0x3d'),JSON[_0x4fa5('0x24')](_0x3b6077));return rp(_['merge'](def,_0x3b6077));}function getTags(_0x1332b1,_0x24a381){var _0x1c3eeb=[];if(_0x1332b1&&_0x1332b1[_0x4fa5('0x18')]>0x0){_0x1c3eeb=_[_0x4fa5('0x3e')](_0x1332b1,_0x24a381);}return _0x1c3eeb;}function getCustomFields(_0x2fe510,_0x33097b){var _0x2ffe33=[];var _0x2d49f6={'custom_fields':[]};if(_0x2fe510[_0x4fa5('0x18')]>0x0){_[_0x4fa5('0x19')](_0x2fe510,function(_0x1c0f8f){if(_0x1c0f8f[_0x4fa5('0x3f')]===_0x4fa5('0x40')&&_0x1c0f8f[_0x4fa5('0x41')]&&!_0x1c0f8f[_0x4fa5('0x42')]){_0x2d49f6[_0x1c0f8f['nameField'][_0x4fa5('0x43')]()]=_0x1c0f8f['content'][_0x4fa5('0x20')]();}else if(_0x1c0f8f[_0x4fa5('0x3f')]==='string'&&_0x1c0f8f[_0x4fa5('0x1b')]&&_0x1c0f8f[_0x4fa5('0x42')]){_0x2d49f6[_0x4fa5('0x44')][_0x4fa5('0x45')]({'id':_0x1c0f8f['idField'],'value':_0x1c0f8f['content'][_0x4fa5('0x20')]()});}else if(_0x1c0f8f[_0x4fa5('0x3f')]==='variable'&&_0x1c0f8f[_0x4fa5('0x1a')]&&_0x1c0f8f[_0x4fa5('0x1b')]&&_0x1c0f8f['customField']){_0x33097b[_0x1c0f8f['variableName']]&&_0x2d49f6[_0x4fa5('0x44')][_0x4fa5('0x45')]({'id':_0x1c0f8f['idField'],'value':_0x33097b[_0x1c0f8f[_0x4fa5('0x1a')]][_0x4fa5('0x20')]()});}else if(_0x1c0f8f['type']===_0x4fa5('0x46')&&_0x1c0f8f[_0x4fa5('0x47')]&&_0x1c0f8f['Variable'][_0x4fa5('0x16')]&&_0x1c0f8f[_0x4fa5('0x1b')]&&_0x1c0f8f['customField']){_0x33097b[_0x1c0f8f['Variable'][_0x4fa5('0x16')][_0x4fa5('0x43')]()]&&_0x2d49f6[_0x4fa5('0x44')]['push']({'id':_0x1c0f8f['idField'],'value':_0x33097b[_0x1c0f8f[_0x4fa5('0x47')]['name'][_0x4fa5('0x43')]()][_0x4fa5('0x20')]()});}});}return _0x2d49f6;}function getConnection(_0x1844a6){return request({'method':_0x4fa5('0x48'),'form':{'method':_0x4fa5('0x49'),'input_type':_0x4fa5('0x23'),'response_type':_0x4fa5('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1844a6[_0x4fa5('0x4a')],'password':_0x1844a6['password'],'encryption':_0x4fa5('0x4b')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x596784){var _0xb21bed=_0x596784;if(_0xb21bed['id']){def['sessionID']=_0xb21bed['id'];return BPromise[_0x4fa5('0x30')](_0xb21bed);}else{throw new Error(util[_0x4fa5('0x1d')](_0x4fa5('0x4c'),_0x1844a6['id']));}});}function setRelationship(_0x1bbcd6,_0x4470f9,_0x2f71c9,_0x19d696){return request({'form':{'method':'set_relationship','input_type':_0x4fa5('0x23'),'response_type':_0x4fa5('0x23'),'rest_data':JSON['stringify']({'session':_0x1bbcd6['id'],'module_name':_0x4fa5('0x1c'),'module_id':_0x2f71c9['id'],'link_field_name':_0x19d696,'related_ids':[_0x4470f9['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4fa5('0x4d')]=function(_0x33f766,_0x317010,_0x3647c0,_0x3f6b74,_0x52dc8b,_0x5a93dc){var _0x6f5a5a,_0x161e61,_0x2b2404,_0x33561b;_0x5a93dc[_0x4fa5('0x4e')]=intUtil[_0x4fa5('0x4f')](_0x5a93dc[_0x4fa5('0x4e')]);_0x5a93dc[_0x4fa5('0x50')]=intUtil[_0x4fa5('0x4f')](_0x5a93dc[_0x4fa5('0x50')]);def[_0x4fa5('0x51')]=util[_0x4fa5('0x1d')](_0x4fa5('0x52'),_0x5a93dc[_0x4fa5('0x4e')]);if(_0x52dc8b&&_0x52dc8b[_0x4fa5('0x53')]){logger[_0x4fa5('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x317010['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a93dc[_0x4fa5('0x50')],_0x317010[_0x4fa5('0x54')],md5(_0x317010[_0x4fa5('0x54')]));}else{_0x317010[_0x4fa5('0x55')]='';}return getConnection(_0x5a93dc)[_0x4fa5('0x2a')](function(_0x49df8c){_0x33561b=_0x49df8c;return getUser(_0x5a93dc,_0x3f6b74[_0x4fa5('0x16')],_0x33561b);})['then'](function(_0x5169f3){_0x6f5a5a=_0x5169f3;logger[_0x4fa5('0xc')](_0x4fa5('0x56'),_0x6f5a5a['id']);return getEndUser(_0x5a93dc,_0x317010[_0x4fa5('0x57')],_0x317010['calleridnum'],_0x33561b);})['then'](function(_0xf5bf15){_0x161e61=_0xf5bf15;logger[_0x4fa5('0xc')]('The\x20Enduser\x20ID\x20is:',_0x161e61['id']);return getTicket(_0x5a93dc,_0x6f5a5a,_0x161e61,_0x3647c0,_0x317010,_0x3647c0[_0x4fa5('0x58')],_0x33561b,_0x4fa5('0x59'));})[_0x4fa5('0x2a')](function(_0x25e6d7){_0x2b2404=_0x25e6d7;logger[_0x4fa5('0xc')](_0x4fa5('0x5a'));logger[_0x4fa5('0xc')](_0x4fa5('0x5b'),_0x2b2404['id']);return setRelationship(_0x33561b,_0x6f5a5a,_0x2b2404,_0x4fa5('0x5c'));})[_0x4fa5('0x2a')](function(){return setRelationship(_0x33561b,_0x161e61,_0x2b2404,_0x4fa5('0x5d'));})['then'](function(){return getServerInfo(_0x33561b);})[_0x4fa5('0x2a')](function(_0x1eccbc){var _0x34fdb4=parseInt(_0x1eccbc[_0x4fa5('0x5e')]['charAt'](0x0));var _0x237fbc=util[_0x4fa5('0x1d')](_0x4fa5('0x5f'),_0x5a93dc[_0x4fa5('0x4e')],_0x2b2404['id']);if(_0x34fdb4>0x6){_0x237fbc=util[_0x4fa5('0x1d')](_0x4fa5('0x60'),_0x5a93dc[_0x4fa5('0x4e')],_0x2b2404['id']);}logger[_0x4fa5('0xc')](_0x4fa5('0x61'),_0x4fa5('0x62'));emit(util[_0x4fa5('0x1d')](_0x4fa5('0x63'),_0x3f6b74[_0x4fa5('0x16')]),'trigger:browser:url',{'uri':_0x237fbc});})[_0x4fa5('0x64')](function(_0x3c8898){logger[_0x4fa5('0x65')](_0x4fa5('0x61'),JSON['stringify'](_0x3c8898));});};exports[_0x4fa5('0x66')]=function(_0x3ce2f6,_0x5903cd,_0x4b472a,_0x546648,_0x37eafe,_0x2acc9c,_0x2865fd){var _0x11eddf,_0x35af54,_0x39bf79,_0x3e8ae7;_0x2acc9c['remoteUri']=intUtil[_0x4fa5('0x4f')](_0x2acc9c['remoteUri']);_0x2acc9c['serverUrl']=intUtil['stripTrailingSlash'](_0x2acc9c[_0x4fa5('0x50')]);def[_0x4fa5('0x51')]=util['format'](_0x4fa5('0x52'),_0x2acc9c[_0x4fa5('0x4e')]);if(_0x2865fd&&_0x2865fd[_0x4fa5('0x67')]&&_0x2865fd['recordingFormat']!==_0x4fa5('0x68')){logger['info'](_0x4fa5('0x69'),_0x4fa5('0x6a'));_0x5903cd[_0x4fa5('0x55')]=util[_0x4fa5('0x1d')](_0x4fa5('0x6b'),_0x2acc9c[_0x4fa5('0x50')],_0x5903cd[_0x4fa5('0x54')],md5(_0x5903cd[_0x4fa5('0x54')]));}return getConnection(_0x2acc9c)[_0x4fa5('0x2a')](function(_0x11427e){_0x3e8ae7=_0x11427e;return getUser(_0x2acc9c,_0x546648[_0x4fa5('0x16')],_0x3e8ae7);})[_0x4fa5('0x2a')](function(_0x16417f){_0x11eddf=_0x16417f;logger[_0x4fa5('0xc')](_0x4fa5('0x56'),_0x11eddf['id']);return getEndUser(_0x2acc9c,_0x5903cd[_0x4fa5('0x6c')],_0x5903cd[_0x4fa5('0x6d')],_0x3e8ae7);})[_0x4fa5('0x2a')](function(_0x17b4d6){_0x35af54=_0x17b4d6;logger[_0x4fa5('0xc')](_0x4fa5('0x6e'),_0x35af54['id']);return getTicket(_0x2acc9c,_0x11eddf,_0x35af54,_0x4b472a,_0x5903cd,_0x4b472a[_0x4fa5('0x58')],_0x3e8ae7,_0x4fa5('0x6f'));})[_0x4fa5('0x2a')](function(_0x5143a5){_0x39bf79=_0x5143a5;logger[_0x4fa5('0xc')](_0x4fa5('0x5a'));logger[_0x4fa5('0xc')](_0x4fa5('0x5b'),_0x39bf79['id']);return setRelationship(_0x3e8ae7,_0x11eddf,_0x39bf79,_0x4fa5('0x5c'));})[_0x4fa5('0x2a')](function(){return setRelationship(_0x3e8ae7,_0x35af54,_0x39bf79,'contacts');})[_0x4fa5('0x2a')](function(){return getServerInfo(_0x3e8ae7);})[_0x4fa5('0x2a')](function(_0x2d473e){var _0x23e7ab=parseInt(_0x2d473e[_0x4fa5('0x5e')][_0x4fa5('0x70')](0x0));var _0x42601c=util[_0x4fa5('0x1d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2acc9c[_0x4fa5('0x4e')],_0x39bf79['id']);if(_0x23e7ab>0x6){_0x42601c=util[_0x4fa5('0x1d')](_0x4fa5('0x60'),_0x2acc9c['remoteUri'],_0x39bf79['id']);}logger[_0x4fa5('0xc')](_0x4fa5('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4fa5('0x1d')](_0x4fa5('0x63'),_0x546648[_0x4fa5('0x16')]),_0x4fa5('0x71'),{'uri':_0x42601c});})['catch'](function(_0x559b0c){logger[_0x4fa5('0x65')](_0x4fa5('0x69'),JSON['stringify'](_0x559b0c));});};exports['unmanaged']=function(_0x533706,_0x54f647,_0xed5bb,_0x1c7e02,_0x2e55bb,_0x4a3dc4){var _0x517a5f,_0x510490,_0x189931,_0x51dd54;_0x4a3dc4['remoteUri']=intUtil[_0x4fa5('0x4f')](_0x4a3dc4['remoteUri']);_0x4a3dc4[_0x4fa5('0x50')]=intUtil['stripTrailingSlash'](_0x4a3dc4['serverUrl']);def[_0x4fa5('0x51')]=util['format'](_0x4fa5('0x52'),_0x4a3dc4[_0x4fa5('0x4e')]);if(_0x2e55bb&&_0x2e55bb['monitor_format']){logger[_0x4fa5('0xc')]('['+_0x54f647[_0x4fa5('0x72')]['toUpperCase']()+']',_0x4fa5('0x6a'));_0x54f647[_0x4fa5('0x55')]=util['format'](_0x4fa5('0x6b'),_0x4a3dc4[_0x4fa5('0x50')],_0x54f647['uniqueid'],md5(_0x54f647[_0x4fa5('0x54')]));}else{_0x54f647[_0x4fa5('0x55')]='';}return getConnection(_0x4a3dc4)[_0x4fa5('0x2a')](function(_0x11ea73){_0x51dd54=_0x11ea73;if(!_[_0x4fa5('0x25')](_0x1c7e02)){return getUser(_0x4a3dc4,_0x1c7e02[_0x4fa5('0x16')],_0x51dd54);}else{return getUser(_0x4a3dc4,null,_0x51dd54);}})['then'](function(_0x40274b){_0x517a5f=_0x40274b;logger[_0x4fa5('0xc')](_0x4fa5('0x56'),_0x517a5f['id']);return getEndUser(_0x4a3dc4,_0x54f647['calleridname'],_0x54f647['calleridnum'],_0x51dd54);})['then'](function(_0x60d4e8){_0x510490=_0x60d4e8;logger['info'](_0x4fa5('0x6e'),_0x510490['id']);return getTicket(_0x4a3dc4,_0x517a5f,_0x510490,_0xed5bb,_0x54f647,_0xed5bb[_0x4fa5('0x58')],_0x51dd54,'Inbound');})[_0x4fa5('0x2a')](function(_0x5d710f){_0x189931=_0x5d710f;logger[_0x4fa5('0xc')]('Ticket\x20created!');logger[_0x4fa5('0xc')]('The\x20Ticket\x20ID\x20is:',_0x189931['id']);return setRelationship(_0x51dd54,_0x517a5f,_0x189931,_0x4fa5('0x5c'));})[_0x4fa5('0x2a')](function(){return setRelationship(_0x51dd54,_0x510490,_0x189931,'contacts');})[_0x4fa5('0x2a')](function(){return getServerInfo(_0x51dd54);})['catch'](function(_0x56e27b){logger[_0x4fa5('0x65')]('['+_0x54f647['lastevent'][_0x4fa5('0x73')]()+']',JSON[_0x4fa5('0x24')](_0x56e27b));});}; \ 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 527a8d6..ecb0883 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 _0xbcbe=['toString','customVariable','Variable','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','name','join','substring','lastIndexOf','isNil','test','lodash','util','length','sortBy','string','push','content','type','variable','variableName'];(function(_0x2f7188,_0x39a568){var _0x4c7f02=function(_0xde7d86){while(--_0xde7d86){_0x2f7188['push'](_0x2f7188['shift']());}};_0x4c7f02(++_0x39a568);}(_0xbcbe,0x196));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));exports['getString']=function(_0x186792,_0x2f486a,_0x16a220){var _0x7c5b69=[];if(_0x186792[_0xebcb('0x2')]>0x0){var _0x21208f=_[_0xebcb('0x3')](_0x186792,['id']);for(var _0x1728ec=0x0;_0x1728ec<_0x21208f[_0xebcb('0x2')];_0x1728ec++){var _0x4dc0a6=_0x21208f[_0x1728ec];if(_0x4dc0a6['type']===_0xebcb('0x4')){_0x7c5b69[_0xebcb('0x5')](_0x4dc0a6[_0xebcb('0x6')]);}else if(_0x4dc0a6[_0xebcb('0x7')]===_0xebcb('0x8')&&_0x4dc0a6['variableName']){_0x2f486a[_0x4dc0a6[_0xebcb('0x9')]]&&_0x7c5b69[_0xebcb('0x5')](_0x2f486a[_0x4dc0a6['variableName']][_0xebcb('0xa')]());}else if(_0x4dc0a6[_0xebcb('0x7')]===_0xebcb('0xb')&&_0x4dc0a6['Variable']&&_0x4dc0a6[_0xebcb('0xc')]['name']){_0x2f486a[_0x4dc0a6[_0xebcb('0xc')]['name']['toLowerCase']()]&&_0x7c5b69[_0xebcb('0x5')](_0x2f486a[_0x4dc0a6[_0xebcb('0xc')]['name'][_0xebcb('0xd')]()]['toString']());}else if(_0x4dc0a6[_0xebcb('0x7')]===_0xebcb('0xe')){if(_0x4dc0a6[_0xebcb('0xf')]===_0xebcb('0x4')&&_0x4dc0a6[_0xebcb('0x10')]){_0x7c5b69[_0xebcb('0x5')](util[_0xebcb('0x11')](_0xebcb('0x12'),_0x4dc0a6[_0xebcb('0x10')],_0x4dc0a6[_0xebcb('0x13')]));}else if(_0x4dc0a6[_0xebcb('0xf')]===_0xebcb('0x8')&&_0x4dc0a6['variableName']&&_0x4dc0a6[_0xebcb('0x10')]){_0x2f486a[_0x4dc0a6['variableName']]&&_0x7c5b69[_0xebcb('0x5')](util[_0xebcb('0x11')](_0xebcb('0x12'),_0x4dc0a6['key'],_0x2f486a[_0x4dc0a6[_0xebcb('0x9')]]));}else if(_0x4dc0a6[_0xebcb('0xf')]===_0xebcb('0xb')&&_0x4dc0a6['Variable']&&_0x4dc0a6[_0xebcb('0xc')]['name']&&_0x4dc0a6[_0xebcb('0x10')]){_0x2f486a[_0x4dc0a6[_0xebcb('0xc')][_0xebcb('0x14')][_0xebcb('0xd')]()]&&_0x7c5b69[_0xebcb('0x5')](util[_0xebcb('0x11')]('%s:\x20%s',_0x4dc0a6[_0xebcb('0x10')],_0x2f486a[_0x4dc0a6[_0xebcb('0xc')]['name'][_0xebcb('0xd')]()]));}}}}return _0x7c5b69[_0xebcb('0x15')](_0x16a220);};exports['stripTrailingSlash']=function(_0x4f4dff){var _0x3c6c02=_0x4f4dff['slice'](-0x1);if(_0x3c6c02==='/'){_0x4f4dff=_0x4f4dff[_0xebcb('0x16')](0x0,_0x4f4dff[_0xebcb('0x17')](_0x3c6c02));}return _0x4f4dff;};exports['validateEmail']=function(_0x111c9f){if(!_[_0xebcb('0x18')](_0x111c9f)&&_0x111c9f!==''){var _0x4b10c8=/^(([^<>()\[\]\\.,;:\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 _0x4b10c8[_0xebcb('0x19')](String(_0x111c9f)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x5456=['stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','push','content','variableName','customVariable','name','Variable','toLowerCase','toString','keyValue','keyType','format','%s:\x20%s','key','variable','join'];(function(_0x4a310d,_0x33322d){var _0x5eaf36=function(_0x233014){while(--_0x233014){_0x4a310d['push'](_0x4a310d['shift']());}};_0x5eaf36(++_0x33322d);}(_0x5456,0x114));var _0x6545=function(_0x2adf0a,_0x430a08){_0x2adf0a=_0x2adf0a-0x0;var _0x5b3560=_0x5456[_0x2adf0a];return _0x5b3560;};'use strict';var _=require(_0x6545('0x0'));var util=require('util');exports[_0x6545('0x1')]=function(_0x34163b,_0x50852e,_0x154516){var _0x1de033=[];if(_0x34163b[_0x6545('0x2')]>0x0){var _0x1f7e61=_[_0x6545('0x3')](_0x34163b,['id']);for(var _0x48608b=0x0;_0x48608b<_0x1f7e61[_0x6545('0x2')];_0x48608b++){var _0x5680e4=_0x1f7e61[_0x48608b];if(_0x5680e4[_0x6545('0x4')]===_0x6545('0x5')){_0x1de033[_0x6545('0x6')](_0x5680e4[_0x6545('0x7')]);}else if(_0x5680e4['type']==='variable'&&_0x5680e4[_0x6545('0x8')]){_0x50852e[_0x5680e4[_0x6545('0x8')]]&&_0x1de033[_0x6545('0x6')](_0x50852e[_0x5680e4[_0x6545('0x8')]]['toString']());}else if(_0x5680e4['type']===_0x6545('0x9')&&_0x5680e4['Variable']&&_0x5680e4['Variable'][_0x6545('0xa')]){_0x50852e[_0x5680e4[_0x6545('0xb')][_0x6545('0xa')]['toLowerCase']()]&&_0x1de033['push'](_0x50852e[_0x5680e4[_0x6545('0xb')]['name'][_0x6545('0xc')]()][_0x6545('0xd')]());}else if(_0x5680e4['type']===_0x6545('0xe')){if(_0x5680e4[_0x6545('0xf')]===_0x6545('0x5')&&_0x5680e4['key']){_0x1de033['push'](util[_0x6545('0x10')](_0x6545('0x11'),_0x5680e4[_0x6545('0x12')],_0x5680e4['keyContent']));}else if(_0x5680e4[_0x6545('0xf')]===_0x6545('0x13')&&_0x5680e4['variableName']&&_0x5680e4[_0x6545('0x12')]){_0x50852e[_0x5680e4['variableName']]&&_0x1de033['push'](util[_0x6545('0x10')](_0x6545('0x11'),_0x5680e4['key'],_0x50852e[_0x5680e4[_0x6545('0x8')]]));}else if(_0x5680e4[_0x6545('0xf')]===_0x6545('0x9')&&_0x5680e4['Variable']&&_0x5680e4[_0x6545('0xb')]['name']&&_0x5680e4[_0x6545('0x12')]){_0x50852e[_0x5680e4[_0x6545('0xb')][_0x6545('0xa')][_0x6545('0xc')]()]&&_0x1de033[_0x6545('0x6')](util['format']('%s:\x20%s',_0x5680e4[_0x6545('0x12')],_0x50852e[_0x5680e4[_0x6545('0xb')][_0x6545('0xa')][_0x6545('0xc')]()]));}}}}return _0x1de033[_0x6545('0x14')](_0x154516);};exports[_0x6545('0x15')]=function(_0x4c07db){var _0xea26cd=_0x4c07db[_0x6545('0x16')](-0x1);if(_0xea26cd==='/'){_0x4c07db=_0x4c07db[_0x6545('0x17')](0x0,_0x4c07db['lastIndexOf'](_0xea26cd));}return _0x4c07db;};exports[_0x6545('0x18')]=function(_0x188089){if(!_[_0x6545('0x19')](_0x188089)&&_0x188089!==''){var _0x239f44=/^(([^<>()\[\]\\.,;:\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 _0x239f44[_0x6545('0x1a')](String(_0x188089)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 10167ca..cab8198 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x259b3b,_0x26b01a){var _0x1ff701=function(_0x1dfb2e){while(--_0x1dfb2e){_0x259b3b['push'](_0x259b3b['shift']());}};_0x1ff701(++_0x26b01a);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1c3a1a,_0xfa88ee){var _0x37eb4e=function(_0x48c7c0){while(--_0x48c7c0){_0x1c3a1a['push'](_0x1c3a1a['shift']());}};_0x37eb4e(++_0xfa88ee);}(_0xe706,0xa3));var _0x6e70=function(_0x49036e,_0x1eed49){_0x49036e=_0x49036e-0x0;var _0xb21daf=_0xe706[_0x49036e];return _0xb21daf;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ 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 8f1a6cc..c57cfce 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 _0x86e3=['unmanaged','monitor_format','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','customField','nameField','toLowerCase','type','idField','custom_fields','push','content','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration'];(function(_0x1cdeba,_0x146502){var _0x404f59=function(_0x4c99b1){while(--_0x4c99b1){_0x1cdeba['push'](_0x1cdeba['shift']());}};_0x404f59(++_0x146502);}(_0x86e3,0x152));var _0x386e=function(_0x5b6bab,_0x3aecd4){_0x5b6bab=_0x5b6bab-0x0;var _0x26cbee=_0x86e3[_0x5b6bab];return _0x26cbee;};'use strict';var _=require('lodash');var rp=require(_0x386e('0x0'));var md5=require(_0x386e('0x1'));var util=require(_0x386e('0x2'));var Redis=require(_0x386e('0x3'));var intUtil=require(_0x386e('0x4'));var config=require(_0x386e('0x5'));var logger=require(_0x386e('0x6'))(_0x386e('0x7'));config['redis']=_[_0x386e('0x8')](config[_0x386e('0x9')],{'host':_0x386e('0xa'),'port':0x18eb});var io=require(_0x386e('0xb'))(new Redis(config[_0x386e('0x9')]));function emit(_0x5da0ad,_0x5e02ce,_0x5bd296){io['to'](_0x5da0ad)[_0x386e('0xc')](_0x5e02ce,_0x5bd296);}var headers={'Content-Type':_0x386e('0xd'),'Accept':_0x386e('0xd')};function getTicket(_0x263a02,_0x4aa0a7,_0x2dea0c,_0x196b14,_0x42de4){logger['info'](_0x386e('0xe'));return request({'uri':util['format']('%s/tickets.json',_0x263a02[_0x386e('0xf')]),'method':_0x386e('0x10'),'body':{'ticket':_[_0x386e('0x11')]({'requester_id':_0x2dea0c['id'],'submitter_id':_0x4aa0a7?_0x4aa0a7['id']:undefined,'assignee_id':_0x4aa0a7?_0x4aa0a7['id']:undefined,'tags':getTags(_0x196b14[_0x386e('0x12')],_0x386e('0x13')),'subject':intUtil[_0x386e('0x14')](_0x196b14[_0x386e('0x15')],_0x42de4,'\x20'),'description':intUtil['getString'](_0x196b14[_0x386e('0x16')],_0x42de4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x386e('0x14')](_0x196b14[_0x386e('0x16')],_0x42de4,'\x0a')}},getCustomFields(_0x196b14[_0x386e('0x17')],_0x42de4))}})[_0x386e('0x18')](function(_0x3a06b5){logger['info'](_0x386e('0x19'));return _0x3a06b5[_0x386e('0x1a')];});}function getUser(_0x2068d8,_0x1f4bbe){if(intUtil[_0x386e('0x1b')](_0x1f4bbe)){logger[_0x386e('0x1c')]('Getting\x20agent\x20with\x20email',_0x1f4bbe);return request({'uri':util['format'](_0x386e('0x1d'),_0x2068d8[_0x386e('0xf')]),'qs':{'query':util[_0x386e('0x1e')](_0x386e('0x1f'),_0x1f4bbe)}})['then'](function(_0xe66af9){if(_0xe66af9[_0x386e('0x20')]){logger[_0x386e('0x1c')](_0x386e('0x21'));return _[_0x386e('0x22')](_0xe66af9['results'],{'email':_0x1f4bbe,'role':_0x386e('0x23')});}else{logger[_0x386e('0x1c')](_0x386e('0x24'));return request({'uri':util[_0x386e('0x1e')](_0x386e('0x25'),_0x2068d8[_0x386e('0xf')])})[_0x386e('0x18')](function(_0x23e4e3){logger[_0x386e('0x1c')](_0x386e('0x26'));return _0x23e4e3['user'];});}});}else{logger['info'](_0x386e('0x24'));return request({'uri':util['format']('%s/users/me.json',_0x2068d8['remoteUri'])})[_0x386e('0x18')](function(_0x537a9b){logger[_0x386e('0x1c')]('Admin\x20account\x20selected.');return _0x537a9b[_0x386e('0x27')];});}}function getEndUser(_0x5c7edf,_0x461bff,_0x4314b0){logger['info'](_0x386e('0x28'),_0x4314b0);return request({'uri':util[_0x386e('0x1e')]('%s/search.json',_0x5c7edf[_0x386e('0xf')]),'qs':{'query':util[_0x386e('0x1e')]('type:user\x20role:end-user\x20phone:%s',_0x4314b0)}})['then'](function(_0x4493a8){var _0x13548a;if(_0x4493a8[_0x386e('0x29')][_0x386e('0x2a')]){_0x4493a8[_0x386e('0x29')]=_[_0x386e('0x2b')](_0x4493a8[_0x386e('0x29')],{'suspended':![],'role':_0x386e('0x2c')});if(_0x4493a8['results'][_0x386e('0x2a')]){_0x13548a=_[_0x386e('0x2d')](_0x4493a8[_0x386e('0x29')]);}}if(_0x13548a){logger['info'](_0x386e('0x2e'));return _0x13548a;}else{logger[_0x386e('0x1c')](_0x386e('0x2f'));return request({'uri':util[_0x386e('0x1e')]('%s/users.json',_0x5c7edf[_0x386e('0xf')]),'method':_0x386e('0x10'),'body':{'user':{'role':_0x386e('0x2c'),'name':util[_0x386e('0x1e')]('Caller\x20-\x20%s',_0x461bff||_0x4314b0),'phone':_0x4314b0}}})[_0x386e('0x18')](function(_0x353a82){logger[_0x386e('0x1c')]('Enduser\x20created.');return _0x353a82[_0x386e('0x27')];});}});}function getAuth(_0x10f6e9){var _0x151615;if(_0x10f6e9[_0x386e('0x30')]===_0x386e('0x31')){_0x151615=util[_0x386e('0x1e')](_0x386e('0x32'),_0x10f6e9[_0x386e('0x33')],_0x10f6e9[_0x386e('0x31')]);}else if(_0x10f6e9['authType']===_0x386e('0x34')){_0x151615=util['format']('%s/token:%s',_0x10f6e9[_0x386e('0x33')],_0x10f6e9[_0x386e('0x34')]);}return util[_0x386e('0x1e')](_0x386e('0x35'),new Buffer(_0x151615)[_0x386e('0x36')](_0x386e('0x37')));}function request(_0x32252d){logger[_0x386e('0x38')](_0x386e('0x39'),JSON[_0x386e('0x3a')](_0x32252d));return rp(_[_0x386e('0x8')](_0x32252d,{'method':_0x386e('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0xac9fea,_0x1e3ba5){var _0x3d41e6=[];if(_0xac9fea&&_0xac9fea[_0x386e('0x2a')]>0x0){_0x3d41e6=_[_0x386e('0x3c')](_0xac9fea,_0x1e3ba5);}return _0x3d41e6;}function getCustomFields(_0x283fda,_0xd27410){var _0x89ff09=[];var _0x2585ea={'custom_fields':[]};if(_0x283fda[_0x386e('0x2a')]>0x0){_[_0x386e('0x3d')](_0x283fda,function(_0x5dc2ff){if(_[_0x386e('0x3e')]([_0x386e('0x3f'),_0x386e('0x40')],_0x5dc2ff['type'])&&_0x5dc2ff['nameField']&&!_0x5dc2ff[_0x386e('0x41')]){_0x2585ea[_0x5dc2ff[_0x386e('0x42')][_0x386e('0x43')]()]=_0x5dc2ff['content'][_0x386e('0x36')]();}else if(_[_0x386e('0x3e')](['string','picklist'],_0x5dc2ff[_0x386e('0x44')])&&_0x5dc2ff[_0x386e('0x45')]&&_0x5dc2ff['customField']){_0x2585ea[_0x386e('0x46')][_0x386e('0x47')]({'id':_0x5dc2ff[_0x386e('0x45')],'value':_0x5dc2ff[_0x386e('0x48')][_0x386e('0x36')]()});}else if(_0x5dc2ff['type']==='variable'&&_0x5dc2ff['variableName']&&_0x5dc2ff[_0x386e('0x45')]&&_0x5dc2ff[_0x386e('0x41')]){_0xd27410[_0x5dc2ff[_0x386e('0x49')]]&&_0x2585ea[_0x386e('0x46')]['push']({'id':_0x5dc2ff[_0x386e('0x45')],'value':_0xd27410[_0x5dc2ff[_0x386e('0x49')]][_0x386e('0x36')]()});}else if(_0x5dc2ff[_0x386e('0x44')]==='customVariable'&&_0x5dc2ff['Variable']&&_0x5dc2ff[_0x386e('0x4a')][_0x386e('0x13')]&&_0x5dc2ff[_0x386e('0x45')]&&_0x5dc2ff[_0x386e('0x41')]){_0xd27410[_0x5dc2ff[_0x386e('0x4a')]['name'][_0x386e('0x43')]()]&&_0x2585ea['custom_fields']['push']({'id':_0x5dc2ff[_0x386e('0x45')],'value':_0xd27410[_0x5dc2ff['Variable'][_0x386e('0x13')][_0x386e('0x43')]()][_0x386e('0x36')]()});}});}return _0x2585ea;}exports['queue']=function(_0xa1422d,_0x38eefd,_0x18b180,_0x4c5099,_0x1fa4a1,_0x15c91e){var _0x588be8,_0x57ad95;_0x15c91e[_0x386e('0xf')]=intUtil[_0x386e('0x4b')](_0x15c91e[_0x386e('0xf')]);_0x15c91e[_0x386e('0x4c')]=intUtil[_0x386e('0x4b')](_0x15c91e[_0x386e('0x4c')]);if(_0x1fa4a1&&_0x1fa4a1['monitor_format']){logger[_0x386e('0x1c')](_0x386e('0x4d'),_0x386e('0x4e'));_0x38eefd[_0x386e('0x4f')]=util[_0x386e('0x1e')](_0x386e('0x50'),_0x15c91e[_0x386e('0x4c')],_0x38eefd['uniqueid'],md5(_0x38eefd[_0x386e('0x51')]));}else{_0x38eefd[_0x386e('0x4f')]='';}headers[_0x386e('0x52')]=getAuth(_0x15c91e);return getUser(_0x15c91e,_0x4c5099[_0x386e('0x53')])[_0x386e('0x18')](function(_0x1a9346){_0x588be8=_0x1a9346;logger[_0x386e('0x1c')](_0x386e('0x54'),_0x588be8['id']);return getEndUser(_0x15c91e,_0x38eefd[_0x386e('0x55')],_0x38eefd[_0x386e('0x56')]);})[_0x386e('0x18')](function(_0x21810a){_0x57ad95=_0x21810a;logger[_0x386e('0x1c')](_0x386e('0x57'),_0x57ad95['id']);return getTicket(_0x15c91e,_0x588be8,_0x57ad95,_0x18b180,_0x38eefd);})[_0x386e('0x18')](function(_0x512efc){if(_0x512efc){logger['info'](_0x386e('0x58'),_0x512efc['id']);switch(_0x15c91e['type']){case'integrationTab':logger['info'](_0x386e('0x4d'),_0x386e('0x59'));return request({'uri':util[_0x386e('0x1e')](_0x386e('0x5a'),_0x15c91e[_0x386e('0xf')],_0x588be8['id'],_0x512efc['id']),'method':_0x386e('0x10')});case'newTab':logger['info']('[QUEUE]',_0x386e('0x5b'));emit(util[_0x386e('0x1e')]('user:%s',_0x4c5099[_0x386e('0x13')]),'trigger:browser:url',{'uri':util['format'](_0x386e('0x5c'),_0x15c91e[_0x386e('0xf')][_0x386e('0x5d')](_0x386e('0x5e'),''),_0x512efc['id'])});break;default:logger[_0x386e('0x5f')]('[QUEUE]',_0x386e('0x60'));}}})[_0x386e('0x61')](function(_0x3db211){logger[_0x386e('0x5f')](_0x386e('0x62'),util[_0x386e('0x63')](_0x3db211,{'showHidden':!![],'depth':null}));});};exports[_0x386e('0x64')]=function(_0x49c07e,_0x143ef9,_0x38dff5,_0x17950b,_0x1be04b,_0x1812f4,_0x57aa52){var _0x526167,_0x3a031e;_0x1812f4[_0x386e('0xf')]=intUtil[_0x386e('0x4b')](_0x1812f4[_0x386e('0xf')]);_0x1812f4[_0x386e('0x4c')]=intUtil[_0x386e('0x4b')](_0x1812f4[_0x386e('0x4c')]);if(_0x57aa52&&_0x57aa52[_0x386e('0x65')]&&_0x57aa52[_0x386e('0x65')]!=='none'){logger[_0x386e('0x1c')](_0x386e('0x66'),_0x386e('0x4e'));_0x143ef9[_0x386e('0x4f')]=util[_0x386e('0x1e')](_0x386e('0x50'),_0x1812f4[_0x386e('0x4c')],_0x143ef9['uniqueid'],md5(_0x143ef9[_0x386e('0x51')]));}headers[_0x386e('0x52')]=getAuth(_0x1812f4);return getUser(_0x1812f4,_0x17950b[_0x386e('0x53')])[_0x386e('0x18')](function(_0x52e555){_0x526167=_0x52e555;logger[_0x386e('0x1c')](_0x386e('0x54'),_0x526167['id']);return getEndUser(_0x1812f4,_0x143ef9[_0x386e('0x67')],_0x143ef9[_0x386e('0x68')]);})['then'](function(_0x7599ab){_0x3a031e=_0x7599ab;logger['info'](_0x386e('0x57'),_0x3a031e['id']);return getTicket(_0x1812f4,_0x526167,_0x3a031e,_0x38dff5,_0x143ef9);})[_0x386e('0x18')](function(_0x3d43f9){if(_0x3d43f9){logger['info'](_0x386e('0x58'),_0x3d43f9['id']);switch(_0x1812f4['type']){case'integrationTab':logger[_0x386e('0x1c')](_0x386e('0x66'),_0x386e('0x59'));return request({'uri':util[_0x386e('0x1e')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1812f4[_0x386e('0xf')],_0x526167['id'],_0x3d43f9['id']),'method':_0x386e('0x10')});case'newTab':logger['info'](_0x386e('0x66'),_0x386e('0x5b'));emit(util[_0x386e('0x1e')]('user:%s',_0x17950b[_0x386e('0x13')]),'trigger:browser:url',{'uri':util[_0x386e('0x1e')](_0x386e('0x5c'),_0x1812f4[_0x386e('0xf')][_0x386e('0x5d')](_0x386e('0x5e'),''),_0x3d43f9['id'])});break;default:logger[_0x386e('0x5f')](_0x386e('0x66'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x386e('0x61')](function(_0x1d651a){logger[_0x386e('0x5f')](_0x386e('0x69'),util['inspect'](_0x1d651a,{'showHidden':!![],'depth':null}));});};exports[_0x386e('0x6a')]=function(_0x109c9e,_0x56df18,_0x1c98d4,_0x34b0a4,_0x24509f,_0x2dd608){var _0x15edd7,_0xd34960;_0x2dd608[_0x386e('0xf')]=intUtil[_0x386e('0x4b')](_0x2dd608[_0x386e('0xf')]);_0x2dd608['serverUrl']=intUtil[_0x386e('0x4b')](_0x2dd608[_0x386e('0x4c')]);if(_0x24509f&&_0x24509f[_0x386e('0x6b')]){logger[_0x386e('0x1c')]('['+_0x56df18['lastevent'][_0x386e('0x6c')]()+']',_0x386e('0x4e'));_0x56df18['recordingURL']=util[_0x386e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2dd608[_0x386e('0x4c')],_0x56df18[_0x386e('0x51')],md5(_0x56df18['uniqueid']));}else{_0x56df18['recordingURL']='';}headers[_0x386e('0x52')]=getAuth(_0x2dd608);return getUser(_0x2dd608)['then'](function(_0x25c161){_0x15edd7=_0x25c161;logger[_0x386e('0x1c')](_0x386e('0x54'),_0x15edd7['id']);return getEndUser(_0x2dd608,_0x56df18[_0x386e('0x55')],_0x56df18['calleridnum']);})['then'](function(_0x1898a0){_0xd34960=_0x1898a0;logger[_0x386e('0x1c')]('The\x20Enduser\x20ID\x20is:',_0xd34960['id']);return getTicket(_0x2dd608,_0x15edd7,_0xd34960,_0x1c98d4,_0x56df18);})[_0x386e('0x18')](function(_0x375cb9){if(_0x375cb9){logger[_0x386e('0x1c')](_0x386e('0x58'),_0x375cb9['id']);}})[_0x386e('0x61')](function(_0x43fc82){logger[_0x386e('0x5f')]('['+_0x56df18[_0x386e('0x6d')][_0x386e('0x6c')]()+']'+_0x386e('0x6e'),util[_0x386e('0x63')](_0x43fc82,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x62af=['email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','../../../../config/environment','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x62af,0xf9));var _0xf62a=function(_0x285f08,_0x5e225b){_0x285f08=_0x285f08-0x0;var _0x5e77c4=_0x62af[_0x285f08];return _0x5e77c4;};'use strict';var _=require(_0xf62a('0x0'));var rp=require(_0xf62a('0x1'));var md5=require(_0xf62a('0x2'));var util=require(_0xf62a('0x3'));var Redis=require(_0xf62a('0x4'));var intUtil=require('./util');var config=require(_0xf62a('0x5'));var logger=require('../../../../config/logger')('zendesk');config[_0xf62a('0x6')]=_[_0xf62a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf62a('0x8'))(new Redis(config[_0xf62a('0x6')]));function emit(_0x3285db,_0x6c52cd,_0x30d3fe){io['to'](_0x3285db)[_0xf62a('0x9')](_0x6c52cd,_0x30d3fe);}var headers={'Content-Type':_0xf62a('0xa'),'Accept':_0xf62a('0xa')};function getTicket(_0x5113ac,_0x329c7b,_0x232ee8,_0x5a2ea6,_0x211cef){logger[_0xf62a('0xb')](_0xf62a('0xc'));return request({'uri':util[_0xf62a('0xd')](_0xf62a('0xe'),_0x5113ac[_0xf62a('0xf')]),'method':_0xf62a('0x10'),'body':{'ticket':_[_0xf62a('0x11')]({'requester_id':_0x232ee8['id'],'submitter_id':_0x329c7b?_0x329c7b['id']:undefined,'assignee_id':_0x329c7b?_0x329c7b['id']:undefined,'tags':getTags(_0x5a2ea6[_0xf62a('0x12')],_0xf62a('0x13')),'subject':intUtil[_0xf62a('0x14')](_0x5a2ea6[_0xf62a('0x15')],_0x211cef,'\x20'),'description':intUtil['getString'](_0x5a2ea6[_0xf62a('0x16')],_0x211cef,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf62a('0x14')](_0x5a2ea6[_0xf62a('0x16')],_0x211cef,'\x0a')}},getCustomFields(_0x5a2ea6['Fields'],_0x211cef))}})[_0xf62a('0x17')](function(_0x1e89b7){logger['info'](_0xf62a('0x18'));return _0x1e89b7[_0xf62a('0x19')];});}function getUser(_0x5888b2,_0xbf166a){if(intUtil['validateEmail'](_0xbf166a)){logger[_0xf62a('0xb')](_0xf62a('0x1a'),_0xbf166a);return request({'uri':util[_0xf62a('0xd')](_0xf62a('0x1b'),_0x5888b2['remoteUri']),'qs':{'query':util['format'](_0xf62a('0x1c'),_0xbf166a)}})[_0xf62a('0x17')](function(_0x201d27){if(_0x201d27[_0xf62a('0x1d')]){logger[_0xf62a('0xb')](_0xf62a('0x1e'));return _['find'](_0x201d27[_0xf62a('0x1f')],{'email':_0xbf166a,'role':_0xf62a('0x20')});}else{logger[_0xf62a('0xb')](_0xf62a('0x21'));return request({'uri':util['format'](_0xf62a('0x22'),_0x5888b2['remoteUri'])})['then'](function(_0x21d087){logger[_0xf62a('0xb')]('Admin\x20account\x20selected.');return _0x21d087['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf62a('0xd')]('%s/users/me.json',_0x5888b2['remoteUri'])})['then'](function(_0x3f442f){logger[_0xf62a('0xb')]('Admin\x20account\x20selected.');return _0x3f442f[_0xf62a('0x23')];});}}function getEndUser(_0x2dbe81,_0x180046,_0x3fa679){logger[_0xf62a('0xb')]('Searching\x20enduser\x20with\x20phone',_0x3fa679);return request({'uri':util['format'](_0xf62a('0x1b'),_0x2dbe81['remoteUri']),'qs':{'query':util['format'](_0xf62a('0x24'),_0x3fa679)}})[_0xf62a('0x17')](function(_0x9537da){var _0x5ed14d;if(_0x9537da[_0xf62a('0x1f')]['length']){_0x9537da[_0xf62a('0x1f')]=_[_0xf62a('0x25')](_0x9537da['results'],{'suspended':![],'role':_0xf62a('0x26')});if(_0x9537da[_0xf62a('0x1f')][_0xf62a('0x27')]){_0x5ed14d=_[_0xf62a('0x28')](_0x9537da[_0xf62a('0x1f')]);}}if(_0x5ed14d){logger[_0xf62a('0xb')]('Enduser\x20found!');return _0x5ed14d;}else{logger[_0xf62a('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xf62a('0x29'),_0x2dbe81[_0xf62a('0xf')]),'method':_0xf62a('0x10'),'body':{'user':{'role':'end-user','name':util[_0xf62a('0xd')](_0xf62a('0x2a'),_0x180046||_0x3fa679),'phone':_0x3fa679}}})[_0xf62a('0x17')](function(_0x2b42d6){logger['info'](_0xf62a('0x2b'));return _0x2b42d6[_0xf62a('0x23')];});}});}function getAuth(_0x1550b6){var _0xab673;if(_0x1550b6[_0xf62a('0x2c')]===_0xf62a('0x2d')){_0xab673=util['format'](_0xf62a('0x2e'),_0x1550b6[_0xf62a('0x2f')],_0x1550b6[_0xf62a('0x2d')]);}else if(_0x1550b6['authType']==='token'){_0xab673=util[_0xf62a('0xd')](_0xf62a('0x30'),_0x1550b6[_0xf62a('0x2f')],_0x1550b6[_0xf62a('0x31')]);}return util[_0xf62a('0xd')](_0xf62a('0x32'),new Buffer(_0xab673)[_0xf62a('0x33')]('base64'));}function request(_0x371714){logger['debug'](_0xf62a('0x34'),JSON[_0xf62a('0x35')](_0x371714));return rp(_['defaults'](_0x371714,{'method':_0xf62a('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x374a75,_0x1fa96c){var _0xc48b9e=[];if(_0x374a75&&_0x374a75[_0xf62a('0x27')]>0x0){_0xc48b9e=_['map'](_0x374a75,_0x1fa96c);}return _0xc48b9e;}function getCustomFields(_0x357471,_0x5758c7){var _0x4c8e78=[];var _0x154860={'custom_fields':[]};if(_0x357471[_0xf62a('0x27')]>0x0){_[_0xf62a('0x37')](_0x357471,function(_0x227450){if(_[_0xf62a('0x38')]([_0xf62a('0x39'),_0xf62a('0x3a')],_0x227450[_0xf62a('0x3b')])&&_0x227450[_0xf62a('0x3c')]&&!_0x227450[_0xf62a('0x3d')]){_0x154860[_0x227450[_0xf62a('0x3c')][_0xf62a('0x3e')]()]=_0x227450[_0xf62a('0x3f')][_0xf62a('0x33')]();}else if(_['includes']([_0xf62a('0x39'),_0xf62a('0x3a')],_0x227450[_0xf62a('0x3b')])&&_0x227450[_0xf62a('0x40')]&&_0x227450['customField']){_0x154860['custom_fields'][_0xf62a('0x41')]({'id':_0x227450[_0xf62a('0x40')],'value':_0x227450[_0xf62a('0x3f')][_0xf62a('0x33')]()});}else if(_0x227450[_0xf62a('0x3b')]===_0xf62a('0x42')&&_0x227450['variableName']&&_0x227450['idField']&&_0x227450[_0xf62a('0x3d')]){_0x5758c7[_0x227450[_0xf62a('0x43')]]&&_0x154860['custom_fields'][_0xf62a('0x41')]({'id':_0x227450['idField'],'value':_0x5758c7[_0x227450[_0xf62a('0x43')]][_0xf62a('0x33')]()});}else if(_0x227450['type']==='customVariable'&&_0x227450['Variable']&&_0x227450[_0xf62a('0x44')]['name']&&_0x227450['idField']&&_0x227450['customField']){_0x5758c7[_0x227450[_0xf62a('0x44')][_0xf62a('0x13')][_0xf62a('0x3e')]()]&&_0x154860['custom_fields'][_0xf62a('0x41')]({'id':_0x227450[_0xf62a('0x40')],'value':_0x5758c7[_0x227450[_0xf62a('0x44')][_0xf62a('0x13')][_0xf62a('0x3e')]()]['toString']()});}});}return _0x154860;}exports[_0xf62a('0x45')]=function(_0x435ea8,_0x7aad20,_0x4b1d21,_0x3f8de2,_0x34339c,_0x335985){var _0x25af81,_0x48fafb;_0x335985[_0xf62a('0xf')]=intUtil[_0xf62a('0x46')](_0x335985[_0xf62a('0xf')]);_0x335985[_0xf62a('0x47')]=intUtil[_0xf62a('0x46')](_0x335985[_0xf62a('0x47')]);if(_0x34339c&&_0x34339c[_0xf62a('0x48')]){logger[_0xf62a('0xb')](_0xf62a('0x49'),_0xf62a('0x4a'));_0x7aad20['recordingURL']=util['format'](_0xf62a('0x4b'),_0x335985['serverUrl'],_0x7aad20[_0xf62a('0x4c')],md5(_0x7aad20[_0xf62a('0x4c')]));}else{_0x7aad20['recordingURL']='';}headers[_0xf62a('0x4d')]=getAuth(_0x335985);return getUser(_0x335985,_0x3f8de2[_0xf62a('0x4e')])[_0xf62a('0x17')](function(_0x2006ed){_0x25af81=_0x2006ed;logger[_0xf62a('0xb')](_0xf62a('0x4f'),_0x25af81['id']);return getEndUser(_0x335985,_0x7aad20[_0xf62a('0x50')],_0x7aad20['calleridnum']);})[_0xf62a('0x17')](function(_0xe2b950){_0x48fafb=_0xe2b950;logger[_0xf62a('0xb')](_0xf62a('0x51'),_0x48fafb['id']);return getTicket(_0x335985,_0x25af81,_0x48fafb,_0x4b1d21,_0x7aad20);})['then'](function(_0x20687b){if(_0x20687b){logger['info']('The\x20Ticket\x20ID\x20is:',_0x20687b['id']);switch(_0x335985[_0xf62a('0x3b')]){case _0xf62a('0x52'):logger[_0xf62a('0xb')](_0xf62a('0x49'),_0xf62a('0x53'));return request({'uri':util[_0xf62a('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x335985[_0xf62a('0xf')],_0x25af81['id'],_0x20687b['id']),'method':'POST'});case _0xf62a('0x54'):logger[_0xf62a('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf62a('0xd')]('user:%s',_0x3f8de2[_0xf62a('0x13')]),'trigger:browser:url',{'uri':util[_0xf62a('0xd')](_0xf62a('0x55'),_0x335985['remoteUri'][_0xf62a('0x56')](_0xf62a('0x57'),''),_0x20687b['id'])});break;default:logger[_0xf62a('0x58')](_0xf62a('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x11764f){logger[_0xf62a('0x58')](_0xf62a('0x59'),util[_0xf62a('0x5a')](_0x11764f,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x144a39,_0x80fb94,_0x2306e2,_0x4d56ba,_0x37e728,_0x4cb624,_0x2a91ab){var _0x3e4276,_0x243ed0;_0x4cb624[_0xf62a('0xf')]=intUtil[_0xf62a('0x46')](_0x4cb624['remoteUri']);_0x4cb624['serverUrl']=intUtil['stripTrailingSlash'](_0x4cb624['serverUrl']);if(_0x2a91ab&&_0x2a91ab['recordingFormat']&&_0x2a91ab[_0xf62a('0x5b')]!==_0xf62a('0x5c')){logger[_0xf62a('0xb')](_0xf62a('0x5d'),_0xf62a('0x4a'));_0x80fb94[_0xf62a('0x5e')]=util[_0xf62a('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4cb624[_0xf62a('0x47')],_0x80fb94[_0xf62a('0x4c')],md5(_0x80fb94['uniqueid']));}headers[_0xf62a('0x4d')]=getAuth(_0x4cb624);return getUser(_0x4cb624,_0x4d56ba[_0xf62a('0x4e')])[_0xf62a('0x17')](function(_0x138217){_0x3e4276=_0x138217;logger['info']('The\x20User\x20ID\x20is:',_0x3e4276['id']);return getEndUser(_0x4cb624,_0x80fb94[_0xf62a('0x5f')],_0x80fb94[_0xf62a('0x60')]);})[_0xf62a('0x17')](function(_0x4d8917){_0x243ed0=_0x4d8917;logger[_0xf62a('0xb')](_0xf62a('0x51'),_0x243ed0['id']);return getTicket(_0x4cb624,_0x3e4276,_0x243ed0,_0x2306e2,_0x80fb94);})[_0xf62a('0x17')](function(_0x7d59b1){if(_0x7d59b1){logger['info'](_0xf62a('0x61'),_0x7d59b1['id']);switch(_0x4cb624['type']){case _0xf62a('0x52'):logger[_0xf62a('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xf62a('0x62'),_0x4cb624[_0xf62a('0xf')],_0x3e4276['id'],_0x7d59b1['id']),'method':_0xf62a('0x10')});case _0xf62a('0x54'):logger[_0xf62a('0xb')](_0xf62a('0x5d'),_0xf62a('0x63'));emit(util[_0xf62a('0xd')](_0xf62a('0x64'),_0x4d56ba[_0xf62a('0x13')]),_0xf62a('0x65'),{'uri':util[_0xf62a('0xd')](_0xf62a('0x55'),_0x4cb624[_0xf62a('0xf')]['replace'](_0xf62a('0x57'),''),_0x7d59b1['id'])});break;default:logger[_0xf62a('0x58')](_0xf62a('0x5d'),_0xf62a('0x66'));}}})[_0xf62a('0x67')](function(_0x115547){logger['error'](_0xf62a('0x68'),util[_0xf62a('0x5a')](_0x115547,{'showHidden':!![],'depth':null}));});};exports[_0xf62a('0x69')]=function(_0x2c6c17,_0x1f8bee,_0x47ed77,_0x29057e,_0x33fd44,_0x7fb31a){var _0x444ccb,_0x20dc49;_0x7fb31a[_0xf62a('0xf')]=intUtil['stripTrailingSlash'](_0x7fb31a[_0xf62a('0xf')]);_0x7fb31a[_0xf62a('0x47')]=intUtil[_0xf62a('0x46')](_0x7fb31a[_0xf62a('0x47')]);if(_0x33fd44&&_0x33fd44[_0xf62a('0x48')]){logger[_0xf62a('0xb')]('['+_0x1f8bee[_0xf62a('0x6a')][_0xf62a('0x6b')]()+']',_0xf62a('0x4a'));_0x1f8bee['recordingURL']=util[_0xf62a('0xd')](_0xf62a('0x4b'),_0x7fb31a[_0xf62a('0x47')],_0x1f8bee['uniqueid'],md5(_0x1f8bee[_0xf62a('0x4c')]));}else{_0x1f8bee[_0xf62a('0x5e')]='';}headers[_0xf62a('0x4d')]=getAuth(_0x7fb31a);return getUser(_0x7fb31a)[_0xf62a('0x17')](function(_0xe87bab){_0x444ccb=_0xe87bab;logger['info']('The\x20User\x20ID\x20is:',_0x444ccb['id']);return getEndUser(_0x7fb31a,_0x1f8bee[_0xf62a('0x50')],_0x1f8bee[_0xf62a('0x6c')]);})[_0xf62a('0x17')](function(_0x56d3a7){_0x20dc49=_0x56d3a7;logger[_0xf62a('0xb')](_0xf62a('0x51'),_0x20dc49['id']);return getTicket(_0x7fb31a,_0x444ccb,_0x20dc49,_0x47ed77,_0x1f8bee);})[_0xf62a('0x17')](function(_0x580b30){if(_0x580b30){logger[_0xf62a('0xb')](_0xf62a('0x61'),_0x580b30['id']);}})[_0xf62a('0x67')](function(_0x2c6202){logger['error']('['+_0x1f8bee['lastevent'][_0xf62a('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xf62a('0x5a')](_0x2c6202,{'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 e05d9e3..db88af2 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 _0x41a7=['Called','complete','connect','rejected','Rejected','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','SUCCESS','Call\x20created!','stack','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','unmanaged','toUpperCase','lodash','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','debug','[HTTP]','stringify','length','forEach','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refresh_token','then','access_token','add','catch','error','Failing\x20creating\x20the\x20access_token','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','findIndex','Using\x20the\x20admin\x20account!','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','log','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','Subject','getString','Descriptions','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result'];(function(_0x3916c0,_0x196ddf){var _0x13b615=function(_0xc3405e){while(--_0xc3405e){_0x3916c0['push'](_0x3916c0['shift']());}};_0x13b615(++_0x196ddf);}(_0x41a7,0x15d));var _0x741a=function(_0x428553,_0x20785f){_0x428553=_0x428553-0x0;var _0x63792c=_0x41a7[_0x428553];return _0x63792c;};'use strict';var _=require(_0x741a('0x0'));var rp=require('request-promise');var md5=require(_0x741a('0x1'));var util=require(_0x741a('0x2'));var intUtil=require(_0x741a('0x3'));var moment=require('moment');var Redis=require(_0x741a('0x4'));var BPromise=require(_0x741a('0x5'));var config=require(_0x741a('0x6'));var logger=require(_0x741a('0x7'))(_0x741a('0x8'));config[_0x741a('0x9')]=_[_0x741a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x741a('0x9')]));function emit(_0x1a98e0,_0x1846f1,_0x1c23e7){io['to'](_0x1a98e0)[_0x741a('0xb')](_0x1846f1,_0x1c23e7);}function request(_0x217955){logger[_0x741a('0xc')](_0x741a('0xd'),JSON[_0x741a('0xe')](_0x217955));return rp(_0x217955);}function getCustomFields(_0x273f38,_0xa6360){var _0x7f8d36={};if(_0x273f38[_0x741a('0xf')]>0x0){_[_0x741a('0x10')](_0x273f38,function(_0x11066b){if(_['includes']([_0x741a('0x11'),'picklist'],_0x11066b[_0x741a('0x12')])&&_0x11066b[_0x741a('0x13')]){_0x7f8d36[_0x11066b[_0x741a('0x13')]]=_0x11066b[_0x741a('0x14')][_0x741a('0x15')]();}else if(_0x11066b['type']===_0x741a('0x16')&&_0x11066b[_0x741a('0x17')]&&_0x11066b[_0x741a('0x13')]&&_0xa6360[_0x11066b[_0x741a('0x17')]]){_0x7f8d36[_0x11066b['idField']]=_0xa6360[_0x11066b[_0x741a('0x17')]][_0x741a('0x15')]();}else if(_0x11066b[_0x741a('0x12')]===_0x741a('0x18')&&_0x11066b[_0x741a('0x19')]&&_0x11066b[_0x741a('0x19')][_0x741a('0x1a')]&&_0x11066b[_0x741a('0x13')]&&_0xa6360[_0x11066b[_0x741a('0x19')][_0x741a('0x1a')][_0x741a('0x1b')]()]){_0x7f8d36[_0x11066b[_0x741a('0x13')]]=_0xa6360[_0x11066b[_0x741a('0x19')][_0x741a('0x1a')][_0x741a('0x1b')]()][_0x741a('0x15')]();}});}return _0x7f8d36;}function getName(_0x16616c){if(_0x16616c['indexOf']('\x20')>0x0){var _0x4f400f=_0x16616c[_0x741a('0x1c')](/ (.+)/);if(_0x4f400f[0x1]){return _0x4f400f;}}return[_0x16616c,_0x16616c];}var accountsTokens={};function getAccessToken(_0x2b899b){return new Promise(function(_0x163e6c,_0x598ed4){if(!_[_0x741a('0x1d')](accountsTokens[_0x2b899b['id']])&&!_[_0x741a('0x1d')](accountsTokens[_0x2b899b['id']]['access_token'])){if(moment()[_0x741a('0x1e')](accountsTokens[_0x2b899b['id']][_0x741a('0x1f')])){_0x163e6c(accountsTokens[_0x2b899b['id']]['access_token']);}}var _0x684edc;switch(_0x2b899b[_0x741a('0x20')]){case'US':_0x684edc=_0x741a('0x21');break;case'AU':_0x684edc=_0x741a('0x22');break;case'EU':_0x684edc=_0x741a('0x23');break;case'IN':_0x684edc=_0x741a('0x24');break;case'CN':_0x684edc='https://accounts.zoho.com.cn';break;default:_0x684edc=_0x741a('0x23');break;}var _0x3fa718={'method':_0x741a('0x25'),'uri':_0x684edc+_0x741a('0x26'),'qs':{'refresh_token':_0x2b899b['refreshToken'],'client_id':_0x2b899b['clientId'],'client_secret':_0x2b899b['clientSecret'],'grant_type':_0x741a('0x27')},'json':!![]};return rp(_0x3fa718)[_0x741a('0x28')](function(_0x1f8121){accountsTokens[_0x2b899b['id']]={'access_token':_0x1f8121[_0x741a('0x29')],'expires_in':moment()[_0x741a('0x2a')](_0x1f8121[_0x741a('0x1f')],'seconds')};_0x163e6c(_0x1f8121[_0x741a('0x29')]);})[_0x741a('0x2b')](function(_0x1840ab){logger[_0x741a('0x2c')](_0x741a('0x2d'),_0x1840ab['stack']);_0x598ed4(_0x1840ab);});});}function getUser(_0x575a53,_0x478b3f,_0x18d286,_0x5fdf5a){logger[_0x741a('0x2e')]('Search\x20user');return request({'method':_0x741a('0x2f'),'uri':util[_0x741a('0x30')](_0x741a('0x31'),_0x478b3f),'qs':{'type':_0x741a('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x575a53},'json':!![]})['then'](function(_0x1f10cd){if(_0x1f10cd['users']){var _0x9e3cfa=-0x1;if(_[_0x741a('0x33')](_0x1f10cd[_0x741a('0x34')])){if(!_['isNil'](_0x5fdf5a)){_0x9e3cfa=_[_0x741a('0x35')](_0x1f10cd[_0x741a('0x34')],function(_0x53bc81){return _0x53bc81['email']===_0x5fdf5a;});}if(_0x9e3cfa>=0x0){logger[_0x741a('0x2e')]('Agent\x20found!');}else{logger[_0x741a('0x2e')](_0x741a('0x36'));_0x9e3cfa=_['findIndex'](_0x1f10cd[_0x741a('0x34')],function(_0xf99f71){return _0xf99f71['profile'][_0x741a('0x1a')]==='Administrator';});}return _0x1f10cd[_0x741a('0x34')][_0x9e3cfa];}else{if(_0x1f10cd[_0x741a('0x37')][_0x741a('0x38')][_0x741a('0x1a')]===_0x741a('0x39')){logger[_0x741a('0x2e')](_0x741a('0x36'));user=_0x1f10cd[_0x741a('0x37')];return user;}else{logger[_0x741a('0x2c')](_0x741a('0x3a'),JSON[_0x741a('0xe')](_0x1f10cd));throw new Error(_0x741a('0x3b')+JSON[_0x741a('0xe')](_0x1f10cd));}}}else{logger[_0x741a('0x2c')](_0x741a('0x3a'),JSON[_0x741a('0xe')](_0x1f10cd));throw new Error(_0x741a('0x3b')+JSON[_0x741a('0xe')](_0x1f10cd));}})[_0x741a('0x2b')](function(_0x1346d6){console['error'](_0x1346d6);});}function getZohoUser(_0x5c838e,_0x10586a){return new BPromise(function(_0x2b8664,_0x5c644c){request(_0x5c838e)[_0x741a('0x28')](function(_0x3606f2){var _0x47d4ba=null;if(_0x3606f2){_0x47d4ba=_0x3606f2[_0x741a('0x3c')][0x0];_0x47d4ba[_0x741a('0x3d')]=_0x10586a;}_0x2b8664(_0x47d4ba);})[_0x741a('0x2b')](function(_0xf7e3e1){_0x5c644c(_0xf7e3e1);});});}function createEndUser(_0x1234b6,_0x4b792d,_0x330b4d,_0xc39a0e,_0x4d45bc,_0x170543){var _0x330b4d=getName(_0x330b4d);return request({'method':_0x741a('0x25'),'uri':'https://www.zohoapis.'+_0x4b792d+_0x741a('0x3e')+_[_0x741a('0x3f')](_0x170543[_0x741a('0x40')])+'s','body':{'data':[{'Last_Name':_0x330b4d[0x1],'First_Name':_0x330b4d[0x0],'Phone':_0xc39a0e,'Owner':{'name':!_['isNil'](_0x4d45bc[_0x741a('0x41')][_0x741a('0x1a')])?_0x4d45bc['role'][_0x741a('0x1a')]:!_['isNil'](_0x4d45bc[_0x741a('0x42')])?_0x4d45bc[_0x741a('0x42')]+'\x20'+_0x4d45bc[_0x741a('0x43')]:_0x4d45bc[_0x741a('0x43')],'id':_0x4d45bc['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1234b6},'json':!![]})[_0x741a('0x28')](function(_0x257480){if(_0x257480&&_0x257480[_0x741a('0x3c')][0x0][_0x741a('0x44')]==='SUCCESS'){var _0x3a9923=_0x257480['data'][0x0][_0x741a('0x45')];_0x3a9923['enduserType']=_[_0x741a('0x3f')](_0x170543[_0x741a('0x40')])+'s';return _0x3a9923;}logger[_0x741a('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x741a('0xe')](data));throw new Error('Error:\x20'+JSON[_0x741a('0xe')](data));})[_0x741a('0x2b')](function(_0x27d585){console[_0x741a('0x46')]('CREATE\x20ERROR',_0x27d585);});}function getEndUser(_0x4ff754,_0x4e9d03,_0x5484d0,_0x41c7fc,_0x416017,_0x168c0d,_0x2ee3f6){var _0x589141={'method':'GET','uri':'','headers':{'Authorization':_0x741a('0x47')+_0x4ff754},'json':!![]};switch(_0x2ee3f6[_0x741a('0x48')]){case _0x741a('0x49'):_0x589141[_0x741a('0x4a')]=_0x741a('0x4b')+_0x4e9d03+_0x741a('0x4c')+_0x416017+'))';return getZohoUser(_0x589141,_0x741a('0x4d'))[_0x741a('0x28')](function(_0x47b400){if(_0x47b400)return _0x47b400;_0x589141[_0x741a('0x4a')]=_0x741a('0x4b')+_0x4e9d03+_0x741a('0x4e')+_0x416017+'))';return getZohoUser(_0x589141,_0x741a('0x4f'))[_0x741a('0x28')](function(_0x3adfa4){if(_0x3adfa4)return _0x3adfa4;if(_0x2ee3f6[_0x741a('0x40')]!=_0x741a('0x50')){return createEndUser(_0x4ff754,_0x4e9d03,_0x41c7fc,_0x416017,_0x168c0d,_0x2ee3f6);}else{return{};}});});break;case'contact':_0x589141[_0x741a('0x4a')]=_0x741a('0x4b')+_0x4e9d03+_0x741a('0x4c')+_0x416017+'))';return getZohoUser(_0x589141,_0x741a('0x4d'))[_0x741a('0x28')](function(_0x3a5214){if(_0x3a5214)return _0x3a5214;if(_0x2ee3f6[_0x741a('0x40')]!='nothing'){return createEndUser(_0x4ff754,_0x4e9d03,_0x41c7fc,_0x416017,_0x168c0d,_0x2ee3f6);}else{return{};}});break;case _0x741a('0x51'):_0x589141['uri']=_0x741a('0x4b')+_0x4e9d03+_0x741a('0x4e')+_0x416017+'))';return getZohoUser(_0x589141,_0x741a('0x4f'))[_0x741a('0x28')](function(_0x469d50){if(_0x469d50)return _0x469d50;if(_0x2ee3f6[_0x741a('0x40')]!=_0x741a('0x50')){return createEndUser(_0x4ff754,_0x4e9d03,_0x41c7fc,_0x416017,_0x168c0d,_0x2ee3f6);}else{return{};}});break;}}function getCall(_0x57447d,_0x426134,_0xd13873,_0x305dae,_0x1896a7,_0x1488cf,_0x59dbe7,_0x14c283){logger[_0x741a('0x2e')](_0x741a('0x52'));var _0x23803d={};_0x23803d[_0x741a('0x53')]={'name':!_[_0x741a('0x1d')](_0x305dae[_0x741a('0x41')][_0x741a('0x1a')])&&!_[_0x741a('0x1d')](_0x305dae['profile']['name'])&&_0x305dae[_0x741a('0x38')]['name']==='administrator'?_0x305dae['role']['name']:!_['isNil'](_0x305dae['first_name'])?_0x305dae[_0x741a('0x42')]+'\x20'+_0x305dae[_0x741a('0x43')]:_0x305dae[_0x741a('0x43')],'id':_0x305dae['id']};_0x23803d[_0x741a('0x54')]=intUtil[_0x741a('0x55')](_0x1488cf['Subjects'],_0x59dbe7,'\x20');_0x23803d['Description']=intUtil[_0x741a('0x55')](_0x1488cf[_0x741a('0x56')],_0x59dbe7,'\x0a');if(_0x1896a7[_0x741a('0x3d')]===_0x741a('0x4d')){_0x23803d['Who_Id']={'name':!_[_0x741a('0x1d')](_0x1896a7[_0x741a('0x57')])?_0x1896a7[_0x741a('0x57')]:!_[_0x741a('0x1d')](_0x1896a7['First_Name'])?_0x1896a7['First_Name']+'\x20'+_0x1896a7[_0x741a('0x58')]:_0x1896a7['Last_Name'],'id':_0x1896a7['id']};}if(_0x1896a7['enduserType']===_0x741a('0x4f')){_0x23803d[_0x741a('0x59')]={'name':!_[_0x741a('0x1d')](_0x1896a7[_0x741a('0x57')])?_0x1896a7[_0x741a('0x57')]:!_[_0x741a('0x1d')](_0x1896a7[_0x741a('0x5a')])?_0x1896a7['First_Name']+'\x20'+_0x1896a7[_0x741a('0x58')]:_0x1896a7[_0x741a('0x58')],'id':_0x1896a7['id']};_0x23803d['$se_module']=_[_0x741a('0x3f')](_0x1896a7['enduserType']);}if(_0x59dbe7[_0x741a('0x5b')]){_0x23803d[_0x741a('0x5c')]=moment[_0x741a('0x5d')](parseInt(_0x59dbe7[_0x741a('0x5b')])*0x3e8)['format'](_0x741a('0x5e'));}else if(_0x59dbe7['answertime']&&_0x59dbe7[_0x741a('0x5f')]){_0x23803d['Call_Duration']=moment[_0x741a('0x5d')](moment(_0x59dbe7[_0x741a('0x5f')],_0x741a('0x60'))[_0x741a('0x61')](moment(_0x59dbe7['starttime'],_0x741a('0x60'))))[_0x741a('0x30')](_0x741a('0x5e'));}switch(_0x59dbe7[_0x741a('0x62')]){case _0x741a('0x63'):_0x23803d[_0x741a('0x64')]=_0x741a('0x65');break;case _0x741a('0x66'):case _0x741a('0x67'):_0x23803d[_0x741a('0x64')]='Answered';break;case _0x741a('0x68'):_0x23803d['Call_Result']=_0x741a('0x69');break;case'abandoned':_0x23803d[_0x741a('0x64')]='Abandoned';break;case _0x741a('0x6a'):_0x23803d[_0x741a('0x64')]=_0x741a('0x6b');default:}_0x23803d[_0x741a('0x6c')]=(_0x14c283===_0x741a('0x6d')?moment(_0x59dbe7[_0x741a('0x6e')])[_0x741a('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x59dbe7[_0x741a('0x6f')])[_0x741a('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x741a('0x30')](_0x741a('0x60'));_0x23803d[_0x741a('0x70')]=_0x14c283||_0x741a('0x71');_0x23803d=_[_0x741a('0x72')](_0x23803d,getCustomFields(_0x1488cf[_0x741a('0x73')],_0x59dbe7));return request({'method':_0x741a('0x25'),'uri':'https://www.zohoapis.'+_0x426134+'/crm/v2/Calls','headers':{'Authorization':_0x741a('0x47')+_0x57447d},'body':{'data':[_0x23803d]},'json':!![]})['then'](function(_0x2226d3){if(_0x2226d3&&_0x2226d3[_0x741a('0x3c')][0x0]['code']===_0x741a('0x74')){logger['info'](_0x741a('0x75'));return{'id':_0x2226d3[_0x741a('0x3c')][0x0]['details']['id']};}})[_0x741a('0x2b')](function(_0x439c42){logger[_0x741a('0x2e')]('err',_0x439c42[_0x741a('0x76')]);console[_0x741a('0x46')](_0x741a('0x77'),_0x439c42);});}exports[_0x741a('0x78')]=function(_0x5c43a5,_0x11eb5d,_0x36f6e0,_0x71fbe2,_0x4112ea,_0x2593a5){var _0x3ec394,_0x5d0f84,_0x24e3ba;_0x2593a5[_0x741a('0x79')]=intUtil[_0x741a('0x7a')](_0x2593a5[_0x741a('0x79')]);_0x2593a5[_0x741a('0x7b')]=intUtil[_0x741a('0x7a')](_0x2593a5[_0x741a('0x7b')]);if(_0x4112ea&&_0x4112ea[_0x741a('0x7c')]){logger[_0x741a('0x2e')](_0x741a('0x7d'),_0x741a('0x7e'));_0x11eb5d['recordingURL']=_0x2593a5[_0x741a('0x7b')]+_0x741a('0x7f')+_0x11eb5d['uniqueid']+_0x741a('0x80')+md5(_0x11eb5d['uniqueid']);}else{_0x11eb5d[_0x741a('0x81')]='';}var _0x4bc698=_0x2593a5[_0x741a('0x79')]===_0x741a('0x82')?'eu':_0x741a('0x83');return getAccessToken(_0x2593a5)[_0x741a('0x28')](function(_0x21f328){_0x24e3ba=_0x21f328;return getUser(_0x24e3ba,_0x4bc698,_0x2593a5,_0x71fbe2[_0x741a('0x84')]);})[_0x741a('0x28')](function(_0x507cd4){_0x3ec394=_0x507cd4;logger[_0x741a('0x2e')](_0x741a('0x85'),_0x3ec394['id']);return getEndUser(_0x24e3ba,_0x4bc698,_0x2593a5,_0x11eb5d[_0x741a('0x86')],_0x11eb5d[_0x741a('0x87')],_0x3ec394,_0x36f6e0);})[_0x741a('0x28')](function(_0x5d05fe){_0x5d0f84=_0x5d05fe;return getCall(_0x24e3ba,_0x4bc698,_0x2593a5,_0x3ec394,_0x5d0f84,_0x36f6e0,_0x11eb5d,_0x741a('0x71'));})[_0x741a('0x28')](function(_0x3e74f8){if(_0x3e74f8){logger[_0x741a('0x2e')](_0x741a('0x88'),_0x3e74f8['id']);logger['info'](_0x741a('0x7d'),_0x741a('0x89'));emit(util[_0x741a('0x30')](_0x741a('0x8a'),_0x71fbe2[_0x741a('0x1a')]),_0x741a('0x8b'),{'uri':_0x741a('0x8c')+_0x2593a5[_0x741a('0x79')]+_0x741a('0x8d')+_0x3e74f8['id']});}})[_0x741a('0x2b')](function(_0x47bba2){logger['error'](_0x741a('0x7d'),JSON[_0x741a('0xe')](_0x47bba2));});};exports[_0x741a('0x6d')]=function(_0x11e6aa,_0x55dd6c,_0x5bfc87,_0x5bb3d6,_0x399b6a,_0x23d394,_0x128425){var _0x55c602,_0x4306c9,_0x29d56d;_0x23d394[_0x741a('0x79')]=intUtil['stripTrailingSlash'](_0x23d394[_0x741a('0x79')]);_0x23d394['serverUrl']=intUtil['stripTrailingSlash'](_0x23d394[_0x741a('0x7b')]);if(_0x128425&&_0x128425[_0x741a('0x8e')]&&_0x128425[_0x741a('0x8e')]!==_0x741a('0x8f')){logger[_0x741a('0x2e')](_0x741a('0x90'),_0x741a('0x7e'));_0x55dd6c['recordingURL']=_0x23d394[_0x741a('0x7b')]+_0x741a('0x7f')+_0x55dd6c[_0x741a('0x91')]+'/downloads?type=uniqueid&token='+md5(_0x55dd6c[_0x741a('0x91')]);}var _0x3b0603=_0x23d394[_0x741a('0x79')]===_0x741a('0x82')?'eu':_0x741a('0x83');return getAccessToken(_0x23d394)[_0x741a('0x28')](function(_0x3f20b6){_0x29d56d=_0x3f20b6;return getUser(_0x29d56d,_0x3b0603,_0x23d394,_0x5bb3d6['email']);})['then'](function(_0x416206){_0x55c602=_0x416206;logger[_0x741a('0x2e')](_0x741a('0x85'),_0x55c602['id']);return getEndUser(_0x29d56d,_0x3b0603,_0x23d394,_0x55dd6c[_0x741a('0x92')],_0x55dd6c[_0x741a('0x93')],_0x55c602,_0x5bfc87);})[_0x741a('0x28')](function(_0x2f3261){_0x4306c9=_0x2f3261;return getCall(_0x29d56d,_0x3b0603,_0x23d394,_0x55c602,_0x4306c9,_0x5bfc87,_0x55dd6c,'Outbound');})[_0x741a('0x28')](function(_0x372930){if(_0x372930){logger[_0x741a('0x2e')](_0x741a('0x88'),_0x372930['id']);logger['info']('[OUTBOUND]',_0x741a('0x89'));emit(util['format'](_0x741a('0x8a'),_0x5bb3d6[_0x741a('0x1a')]),_0x741a('0x8b'),{'uri':_0x741a('0x8c')+_0x23d394[_0x741a('0x79')]+_0x741a('0x8d')+_0x372930['id']});}})[_0x741a('0x2b')](function(_0x1a6101){logger[_0x741a('0x2c')](_0x741a('0x90'),JSON[_0x741a('0xe')](_0x1a6101));});};exports[_0x741a('0x94')]=function(_0x4d31f2,_0x1798be,_0x1d4e90,_0x18e618,_0x344839,_0x3c97b0){var _0x1045da,_0x199ae0,_0x146374;_0x3c97b0[_0x741a('0x79')]=intUtil['stripTrailingSlash'](_0x3c97b0[_0x741a('0x79')]);_0x3c97b0[_0x741a('0x7b')]=intUtil[_0x741a('0x7a')](_0x3c97b0[_0x741a('0x7b')]);if(_0x344839&&_0x344839[_0x741a('0x7c')]){logger[_0x741a('0x2e')]('['+_0x1798be[_0x741a('0x62')][_0x741a('0x95')]()+']','Recording\x20is\x20enabled!');_0x1798be[_0x741a('0x81')]=_0x3c97b0['serverUrl']+'/api/voice/recordings/'+_0x1798be['uniqueid']+_0x741a('0x80')+md5(_0x1798be['uniqueid']);}else{_0x1798be['recordingURL']='';}var _0x46e62=_0x3c97b0[_0x741a('0x79')]===_0x741a('0x82')?'eu':_0x741a('0x83');return getAccessToken(_0x3c97b0)[_0x741a('0x28')](function(_0x3667ba){_0x146374=_0x3667ba;return getUser(_0x146374,_0x46e62,_0x3c97b0);})[_0x741a('0x28')](function(_0x3f2cd5){_0x1045da=_0x3f2cd5;logger[_0x741a('0x2e')](_0x741a('0x85'),_0x1045da['id']);return getEndUser(_0x146374,_0x46e62,_0x3c97b0,_0x1798be[_0x741a('0x86')],_0x1798be[_0x741a('0x87')],_0x1045da,_0x1d4e90);})[_0x741a('0x28')](function(_0x1c322c){_0x199ae0=_0x1c322c;return getCall(_0x146374,_0x46e62,_0x3c97b0,_0x1045da,_0x199ae0,_0x1d4e90,_0x1798be,_0x741a('0x71'));})[_0x741a('0x28')](function(_0x264aaa){if(_0x264aaa){logger[_0x741a('0x2e')](_0x741a('0x88'),_0x264aaa['id']);}})['catch'](function(_0x56a24a){logger[_0x741a('0x2c')]('['+_0x1798be[_0x741a('0x62')][_0x741a('0x95')]()+']',JSON[_0x741a('0xe')](_0x56a24a));});}; \ No newline at end of file +var _0xc8d8=['role','first_name','code','SUCCESS','details','startCase','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','administrator','last_name','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','err','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','email','destcalleridname','Outbound','user:%s','trigger:browser:url','toUpperCase','Recording\x20is\x20enabled!','request-promise','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0xc8d8,0xe5));var _0x8c8d=function(_0x469eba,_0x39471c){_0x469eba=_0x469eba-0x0;var _0x355f69=_0xc8d8[_0x469eba];return _0x355f69;};'use strict';var _=require('lodash');var rp=require(_0x8c8d('0x0'));var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x8c8d('0x1'));var BPromise=require(_0x8c8d('0x2'));var config=require(_0x8c8d('0x3'));var logger=require(_0x8c8d('0x4'))('zoho');config[_0x8c8d('0x5')]=_[_0x8c8d('0x6')](config[_0x8c8d('0x5')],{'host':_0x8c8d('0x7'),'port':0x18eb});var io=require(_0x8c8d('0x8'))(new Redis(config[_0x8c8d('0x5')]));function emit(_0x36931d,_0x279063,_0x3bbec8){io['to'](_0x36931d)[_0x8c8d('0x9')](_0x279063,_0x3bbec8);}function request(_0x2b62d1){logger[_0x8c8d('0xa')](_0x8c8d('0xb'),JSON[_0x8c8d('0xc')](_0x2b62d1));return rp(_0x2b62d1);}function getCustomFields(_0x1c8cac,_0x11ffc2){var _0x361ce0={};if(_0x1c8cac[_0x8c8d('0xd')]>0x0){_[_0x8c8d('0xe')](_0x1c8cac,function(_0x5436f3){if(_[_0x8c8d('0xf')]([_0x8c8d('0x10'),_0x8c8d('0x11')],_0x5436f3[_0x8c8d('0x12')])&&_0x5436f3[_0x8c8d('0x13')]){_0x361ce0[_0x5436f3['idField']]=_0x5436f3['content'][_0x8c8d('0x14')]();}else if(_0x5436f3[_0x8c8d('0x12')]==='variable'&&_0x5436f3['variableName']&&_0x5436f3['idField']&&_0x11ffc2[_0x5436f3['variableName']]){_0x361ce0[_0x5436f3[_0x8c8d('0x13')]]=_0x11ffc2[_0x5436f3[_0x8c8d('0x15')]][_0x8c8d('0x14')]();}else if(_0x5436f3[_0x8c8d('0x12')]===_0x8c8d('0x16')&&_0x5436f3[_0x8c8d('0x17')]&&_0x5436f3[_0x8c8d('0x17')][_0x8c8d('0x18')]&&_0x5436f3[_0x8c8d('0x13')]&&_0x11ffc2[_0x5436f3[_0x8c8d('0x17')][_0x8c8d('0x18')][_0x8c8d('0x19')]()]){_0x361ce0[_0x5436f3[_0x8c8d('0x13')]]=_0x11ffc2[_0x5436f3[_0x8c8d('0x17')][_0x8c8d('0x18')]['toLowerCase']()][_0x8c8d('0x14')]();}});}return _0x361ce0;}function getName(_0xdabc86){if(_0xdabc86[_0x8c8d('0x1a')]('\x20')>0x0){var _0x139115=_0xdabc86['split'](/ (.+)/);if(_0x139115[0x1]){return _0x139115;}}return[_0xdabc86,_0xdabc86];}var accountsTokens={};function getAccessToken(_0x4c5b62){return new Promise(function(_0x59eb2a,_0x3184e9){if(!_[_0x8c8d('0x1b')](accountsTokens[_0x4c5b62['id']])&&!_[_0x8c8d('0x1b')](accountsTokens[_0x4c5b62['id']][_0x8c8d('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x4c5b62['id']][_0x8c8d('0x1d')])){_0x59eb2a(accountsTokens[_0x4c5b62['id']]['access_token']);}}var _0x895f98;switch(_0x4c5b62[_0x8c8d('0x1e')]){case'US':_0x895f98='https://accounts.zoho.com';break;case'AU':_0x895f98=_0x8c8d('0x1f');break;case'EU':_0x895f98=_0x8c8d('0x20');break;case'IN':_0x895f98=_0x8c8d('0x21');break;case'CN':_0x895f98='https://accounts.zoho.com.cn';break;default:_0x895f98=_0x8c8d('0x20');break;}var _0x5f2855={'method':_0x8c8d('0x22'),'uri':_0x895f98+_0x8c8d('0x23'),'qs':{'refresh_token':_0x4c5b62[_0x8c8d('0x24')],'client_id':_0x4c5b62['clientId'],'client_secret':_0x4c5b62['clientSecret'],'grant_type':_0x8c8d('0x25')},'json':!![]};return rp(_0x5f2855)[_0x8c8d('0x26')](function(_0x252f07){accountsTokens[_0x4c5b62['id']]={'access_token':_0x252f07[_0x8c8d('0x1c')],'expires_in':moment()[_0x8c8d('0x27')](_0x252f07[_0x8c8d('0x1d')],'seconds')};_0x59eb2a(_0x252f07[_0x8c8d('0x1c')]);})[_0x8c8d('0x28')](function(_0x403f3c){logger[_0x8c8d('0x29')]('Failing\x20creating\x20the\x20access_token',_0x403f3c[_0x8c8d('0x2a')]);_0x3184e9(_0x403f3c);});});}function getUser(_0x470ebc,_0x4897a2,_0x4434be,_0x331421){logger[_0x8c8d('0x2b')](_0x8c8d('0x2c'));return request({'method':_0x8c8d('0x2d'),'uri':util[_0x8c8d('0x2e')](_0x8c8d('0x2f'),_0x4897a2),'qs':{'type':_0x8c8d('0x30')},'headers':{'Authorization':_0x8c8d('0x31')+_0x470ebc},'json':!![]})['then'](function(_0x1c678a){if(_0x1c678a['users']){var _0x183f08=-0x1;if(_[_0x8c8d('0x32')](_0x1c678a[_0x8c8d('0x33')])){if(!_['isNil'](_0x331421)){_0x183f08=_[_0x8c8d('0x34')](_0x1c678a['users'],function(_0x3bd19b){return _0x3bd19b['email']===_0x331421;});}if(_0x183f08>=0x0){logger[_0x8c8d('0x2b')](_0x8c8d('0x35'));}else{logger[_0x8c8d('0x2b')](_0x8c8d('0x36'));_0x183f08=_['findIndex'](_0x1c678a[_0x8c8d('0x33')],function(_0x212c63){return _0x212c63['profile'][_0x8c8d('0x18')]===_0x8c8d('0x37');});}return _0x1c678a[_0x8c8d('0x33')][_0x183f08];}else{if(_0x1c678a[_0x8c8d('0x38')][_0x8c8d('0x39')][_0x8c8d('0x18')]===_0x8c8d('0x37')){logger[_0x8c8d('0x2b')](_0x8c8d('0x36'));user=_0x1c678a['user'];return user;}else{logger[_0x8c8d('0x29')](_0x8c8d('0x3a'),JSON['stringify'](_0x1c678a));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8c8d('0xc')](_0x1c678a));}}}else{logger['error'](_0x8c8d('0x3a'),JSON['stringify'](_0x1c678a));throw new Error(_0x8c8d('0x3b')+JSON[_0x8c8d('0xc')](_0x1c678a));}})['catch'](function(_0x4ca0b0){console[_0x8c8d('0x29')](_0x4ca0b0);});}function getZohoUser(_0x19d951,_0x4a8dec){return new BPromise(function(_0x21466a,_0x1d16e6){request(_0x19d951)[_0x8c8d('0x26')](function(_0x3dc963){var _0x271bb6=null;if(_0x3dc963){_0x271bb6=_0x3dc963[_0x8c8d('0x3c')][0x0];_0x271bb6[_0x8c8d('0x3d')]=_0x4a8dec;}_0x21466a(_0x271bb6);})[_0x8c8d('0x28')](function(_0x39fcef){_0x1d16e6(_0x39fcef);});});}function createEndUser(_0x436005,_0x7782c2,_0x2e1fe6,_0x2542ce,_0x65fc68,_0x38f95e){var _0x2e1fe6=getName(_0x2e1fe6);return request({'method':_0x8c8d('0x22'),'uri':_0x8c8d('0x3e')+_0x7782c2+_0x8c8d('0x3f')+_['startCase'](_0x38f95e[_0x8c8d('0x40')])+'s','body':{'data':[{'Last_Name':_0x2e1fe6[0x1],'First_Name':_0x2e1fe6[0x0],'Phone':_0x2542ce,'Owner':{'name':!_['isNil'](_0x65fc68[_0x8c8d('0x41')][_0x8c8d('0x18')])?_0x65fc68[_0x8c8d('0x41')][_0x8c8d('0x18')]:!_['isNil'](_0x65fc68[_0x8c8d('0x42')])?_0x65fc68[_0x8c8d('0x42')]+'\x20'+_0x65fc68['last_name']:_0x65fc68['last_name'],'id':_0x65fc68['id']}}]},'headers':{'Authorization':_0x8c8d('0x31')+_0x436005},'json':!![]})[_0x8c8d('0x26')](function(_0x3ca5aa){if(_0x3ca5aa&&_0x3ca5aa['data'][0x0][_0x8c8d('0x43')]===_0x8c8d('0x44')){var _0x1e3eb7=_0x3ca5aa['data'][0x0][_0x8c8d('0x45')];_0x1e3eb7['enduserType']=_[_0x8c8d('0x46')](_0x38f95e[_0x8c8d('0x40')])+'s';return _0x1e3eb7;}logger[_0x8c8d('0x29')](_0x8c8d('0x3a'),JSON[_0x8c8d('0xc')](data));throw new Error('Error:\x20'+JSON[_0x8c8d('0xc')](data));})['catch'](function(_0x2e03ae){console['log'](_0x8c8d('0x47'),_0x2e03ae);});}function getEndUser(_0x2c0eba,_0x352afd,_0x11e676,_0x4f1d2b,_0x88661f,_0x3428fc,_0x109fb2){var _0xf4c958={'method':_0x8c8d('0x2d'),'uri':'','headers':{'Authorization':_0x8c8d('0x31')+_0x2c0eba},'json':!![]};switch(_0x109fb2['moduleSearch']){case _0x8c8d('0x48'):_0xf4c958[_0x8c8d('0x49')]=_0x8c8d('0x3e')+_0x352afd+_0x8c8d('0x4a')+_0x88661f+'))';return getZohoUser(_0xf4c958,_0x8c8d('0x4b'))['then'](function(_0x4f6662){if(_0x4f6662)return _0x4f6662;_0xf4c958[_0x8c8d('0x49')]=_0x8c8d('0x3e')+_0x352afd+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x88661f+'))';return getZohoUser(_0xf4c958,_0x8c8d('0x4c'))['then'](function(_0x3a68f1){if(_0x3a68f1)return _0x3a68f1;if(_0x109fb2['moduleCreate']!='nothing'){return createEndUser(_0x2c0eba,_0x352afd,_0x4f1d2b,_0x88661f,_0x3428fc,_0x109fb2);}else{return{};}});});break;case _0x8c8d('0x4d'):_0xf4c958[_0x8c8d('0x49')]=_0x8c8d('0x3e')+_0x352afd+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x88661f+'))';return getZohoUser(_0xf4c958,_0x8c8d('0x4b'))[_0x8c8d('0x26')](function(_0x5422b9){if(_0x5422b9)return _0x5422b9;if(_0x109fb2[_0x8c8d('0x40')]!=_0x8c8d('0x4e')){return createEndUser(_0x2c0eba,_0x352afd,_0x4f1d2b,_0x88661f,_0x3428fc,_0x109fb2);}else{return{};}});break;case _0x8c8d('0x4f'):_0xf4c958[_0x8c8d('0x49')]=_0x8c8d('0x3e')+_0x352afd+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x88661f+'))';return getZohoUser(_0xf4c958,'Leads')['then'](function(_0x4f269c){if(_0x4f269c)return _0x4f269c;if(_0x109fb2[_0x8c8d('0x40')]!='nothing'){return createEndUser(_0x2c0eba,_0x352afd,_0x4f1d2b,_0x88661f,_0x3428fc,_0x109fb2);}else{return{};}});break;}}function getCall(_0x1e3a22,_0x579947,_0x5430b3,_0x52d4fa,_0x5f1620,_0x30ee1b,_0x1d6de5,_0x35f377){logger['info'](_0x8c8d('0x50'));var _0x36fdc7={};_0x36fdc7[_0x8c8d('0x51')]={'name':!_[_0x8c8d('0x1b')](_0x52d4fa[_0x8c8d('0x41')]['name'])&&!_[_0x8c8d('0x1b')](_0x52d4fa[_0x8c8d('0x39')][_0x8c8d('0x18')])&&_0x52d4fa['profile'][_0x8c8d('0x18')]===_0x8c8d('0x52')?_0x52d4fa['role']['name']:!_[_0x8c8d('0x1b')](_0x52d4fa[_0x8c8d('0x42')])?_0x52d4fa[_0x8c8d('0x42')]+'\x20'+_0x52d4fa['last_name']:_0x52d4fa[_0x8c8d('0x53')],'id':_0x52d4fa['id']};_0x36fdc7['Subject']=intUtil['getString'](_0x30ee1b['Subjects'],_0x1d6de5,'\x20');_0x36fdc7[_0x8c8d('0x54')]=intUtil[_0x8c8d('0x55')](_0x30ee1b[_0x8c8d('0x56')],_0x1d6de5,'\x0a');if(_0x5f1620['enduserType']===_0x8c8d('0x4b')){_0x36fdc7[_0x8c8d('0x57')]={'name':!_[_0x8c8d('0x1b')](_0x5f1620[_0x8c8d('0x58')])?_0x5f1620[_0x8c8d('0x58')]:!_[_0x8c8d('0x1b')](_0x5f1620[_0x8c8d('0x59')])?_0x5f1620['First_Name']+'\x20'+_0x5f1620[_0x8c8d('0x5a')]:_0x5f1620['Last_Name'],'id':_0x5f1620['id']};}if(_0x5f1620[_0x8c8d('0x3d')]==='Leads'){_0x36fdc7[_0x8c8d('0x5b')]={'name':!_[_0x8c8d('0x1b')](_0x5f1620[_0x8c8d('0x58')])?_0x5f1620[_0x8c8d('0x58')]:!_['isNil'](_0x5f1620[_0x8c8d('0x59')])?_0x5f1620[_0x8c8d('0x59')]+'\x20'+_0x5f1620[_0x8c8d('0x5a')]:_0x5f1620['Last_Name'],'id':_0x5f1620['id']};_0x36fdc7[_0x8c8d('0x5c')]=_[_0x8c8d('0x46')](_0x5f1620[_0x8c8d('0x3d')]);}if(_0x1d6de5[_0x8c8d('0x5d')]){_0x36fdc7[_0x8c8d('0x5e')]=moment[_0x8c8d('0x5f')](parseInt(_0x1d6de5[_0x8c8d('0x5d')])*0x3e8)['format']('mm:ss');}else if(_0x1d6de5['answertime']&&_0x1d6de5[_0x8c8d('0x60')]){_0x36fdc7['Call_Duration']=moment['utc'](moment(_0x1d6de5[_0x8c8d('0x60')],_0x8c8d('0x61'))['diff'](moment(_0x1d6de5[_0x8c8d('0x62')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x8c8d('0x63'));}switch(_0x1d6de5[_0x8c8d('0x64')]){case _0x8c8d('0x65'):_0x36fdc7['Call_Result']='Called';break;case _0x8c8d('0x66'):case'connect':_0x36fdc7[_0x8c8d('0x67')]=_0x8c8d('0x68');break;case _0x8c8d('0x69'):_0x36fdc7['Call_Result']=_0x8c8d('0x6a');break;case _0x8c8d('0x6b'):_0x36fdc7['Call_Result']=_0x8c8d('0x6c');break;case'timeout':_0x36fdc7[_0x8c8d('0x67')]=_0x8c8d('0x6d');default:}_0x36fdc7[_0x8c8d('0x6e')]=(_0x35f377==='outbound'?moment(_0x1d6de5[_0x8c8d('0x62')])[_0x8c8d('0x2e')](_0x8c8d('0x61')):moment(_0x1d6de5[_0x8c8d('0x6f')])[_0x8c8d('0x2e')](_0x8c8d('0x61')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x36fdc7[_0x8c8d('0x70')]=_0x35f377||_0x8c8d('0x71');_0x36fdc7=_[_0x8c8d('0x72')](_0x36fdc7,getCustomFields(_0x30ee1b[_0x8c8d('0x73')],_0x1d6de5));return request({'method':_0x8c8d('0x22'),'uri':_0x8c8d('0x3e')+_0x579947+'/crm/v2/Calls','headers':{'Authorization':_0x8c8d('0x31')+_0x1e3a22},'body':{'data':[_0x36fdc7]},'json':!![]})[_0x8c8d('0x26')](function(_0x15bdd2){if(_0x15bdd2&&_0x15bdd2['data'][0x0][_0x8c8d('0x43')]===_0x8c8d('0x44')){logger[_0x8c8d('0x2b')]('Call\x20created!');return{'id':_0x15bdd2[_0x8c8d('0x3c')][0x0][_0x8c8d('0x45')]['id']};}})['catch'](function(_0x433b61){logger[_0x8c8d('0x2b')](_0x8c8d('0x74'),_0x433b61[_0x8c8d('0x2a')]);console[_0x8c8d('0x75')](_0x8c8d('0x74'),_0x433b61);});}exports[_0x8c8d('0x76')]=function(_0x5e98c8,_0x59fe90,_0x36718c,_0x5bd1e8,_0x434061,_0x532f23){var _0x1ba51e,_0x220437,_0x1accb1;_0x532f23[_0x8c8d('0x77')]=intUtil['stripTrailingSlash'](_0x532f23[_0x8c8d('0x77')]);_0x532f23[_0x8c8d('0x78')]=intUtil[_0x8c8d('0x79')](_0x532f23[_0x8c8d('0x78')]);if(_0x434061&&_0x434061[_0x8c8d('0x7a')]){logger[_0x8c8d('0x2b')](_0x8c8d('0x7b'),'Recording\x20is\x20enabled!');_0x59fe90[_0x8c8d('0x7c')]=_0x532f23[_0x8c8d('0x78')]+_0x8c8d('0x7d')+_0x59fe90['uniqueid']+_0x8c8d('0x7e')+md5(_0x59fe90[_0x8c8d('0x7f')]);}else{_0x59fe90[_0x8c8d('0x7c')]='';}var _0xd39d3a=_0x532f23[_0x8c8d('0x77')]===_0x8c8d('0x80')?'eu':_0x8c8d('0x81');return getAccessToken(_0x532f23)[_0x8c8d('0x26')](function(_0x28284b){_0x1accb1=_0x28284b;return getUser(_0x1accb1,_0xd39d3a,_0x532f23,_0x5bd1e8['email']);})[_0x8c8d('0x26')](function(_0x39a9a5){_0x1ba51e=_0x39a9a5;logger[_0x8c8d('0x2b')](_0x8c8d('0x82'),_0x1ba51e['id']);return getEndUser(_0x1accb1,_0xd39d3a,_0x532f23,_0x59fe90[_0x8c8d('0x83')],_0x59fe90[_0x8c8d('0x84')],_0x1ba51e,_0x36718c);})['then'](function(_0x105ee6){_0x220437=_0x105ee6;return getCall(_0x1accb1,_0xd39d3a,_0x532f23,_0x1ba51e,_0x220437,_0x36718c,_0x59fe90,'Inbound');})[_0x8c8d('0x26')](function(_0x2321ad){if(_0x2321ad){logger[_0x8c8d('0x2b')](_0x8c8d('0x85'),_0x2321ad['id']);logger[_0x8c8d('0x2b')](_0x8c8d('0x7b'),_0x8c8d('0x86'));emit(util['format']('user:%s',_0x5bd1e8[_0x8c8d('0x18')]),'trigger:browser:url',{'uri':_0x8c8d('0x87')+_0x532f23[_0x8c8d('0x77')]+_0x8c8d('0x88')+_0x2321ad['id']});}})[_0x8c8d('0x28')](function(_0x3f3506){logger[_0x8c8d('0x29')](_0x8c8d('0x7b'),JSON['stringify'](_0x3f3506));});};exports['outbound']=function(_0x2ecfd0,_0x252e9e,_0x300b18,_0x7ee65d,_0x3e69c0,_0x1d1285,_0x55de50){var _0x5e1587,_0x4bb5f5,_0x5e00a2;_0x1d1285[_0x8c8d('0x77')]=intUtil['stripTrailingSlash'](_0x1d1285[_0x8c8d('0x77')]);_0x1d1285['serverUrl']=intUtil[_0x8c8d('0x79')](_0x1d1285[_0x8c8d('0x78')]);if(_0x55de50&&_0x55de50[_0x8c8d('0x89')]&&_0x55de50[_0x8c8d('0x89')]!==_0x8c8d('0x8a')){logger[_0x8c8d('0x2b')](_0x8c8d('0x8b'),'Recording\x20is\x20enabled!');_0x252e9e[_0x8c8d('0x7c')]=_0x1d1285[_0x8c8d('0x78')]+_0x8c8d('0x7d')+_0x252e9e['uniqueid']+_0x8c8d('0x7e')+md5(_0x252e9e[_0x8c8d('0x7f')]);}var _0x1f17a8=_0x1d1285[_0x8c8d('0x77')]==='zoho.eu'?'eu':_0x8c8d('0x81');return getAccessToken(_0x1d1285)[_0x8c8d('0x26')](function(_0x328b01){_0x5e00a2=_0x328b01;return getUser(_0x5e00a2,_0x1f17a8,_0x1d1285,_0x7ee65d[_0x8c8d('0x8c')]);})['then'](function(_0x37c3d6){_0x5e1587=_0x37c3d6;logger[_0x8c8d('0x2b')]('The\x20User\x20ID\x20is:',_0x5e1587['id']);return getEndUser(_0x5e00a2,_0x1f17a8,_0x1d1285,_0x252e9e[_0x8c8d('0x8d')],_0x252e9e['destcalleridnum'],_0x5e1587,_0x300b18);})[_0x8c8d('0x26')](function(_0x3404d3){_0x4bb5f5=_0x3404d3;return getCall(_0x5e00a2,_0x1f17a8,_0x1d1285,_0x5e1587,_0x4bb5f5,_0x300b18,_0x252e9e,_0x8c8d('0x8e'));})[_0x8c8d('0x26')](function(_0x12127b){if(_0x12127b){logger[_0x8c8d('0x2b')](_0x8c8d('0x85'),_0x12127b['id']);logger[_0x8c8d('0x2b')](_0x8c8d('0x8b'),_0x8c8d('0x86'));emit(util[_0x8c8d('0x2e')](_0x8c8d('0x8f'),_0x7ee65d[_0x8c8d('0x18')]),_0x8c8d('0x90'),{'uri':'https://crm.'+_0x1d1285[_0x8c8d('0x77')]+'/crm/EntityInfo.do?module=Calls&id='+_0x12127b['id']});}})[_0x8c8d('0x28')](function(_0x112be9){logger['error'](_0x8c8d('0x8b'),JSON['stringify'](_0x112be9));});};exports['unmanaged']=function(_0x3f2389,_0x5d9e02,_0x4fd1ee,_0x2ace0b,_0xb14762,_0x583908){var _0x2c705a,_0x14c1d0,_0x4e3d5e;_0x583908[_0x8c8d('0x77')]=intUtil[_0x8c8d('0x79')](_0x583908['host']);_0x583908[_0x8c8d('0x78')]=intUtil[_0x8c8d('0x79')](_0x583908[_0x8c8d('0x78')]);if(_0xb14762&&_0xb14762[_0x8c8d('0x7a')]){logger[_0x8c8d('0x2b')]('['+_0x5d9e02[_0x8c8d('0x64')][_0x8c8d('0x91')]()+']',_0x8c8d('0x92'));_0x5d9e02['recordingURL']=_0x583908['serverUrl']+_0x8c8d('0x7d')+_0x5d9e02[_0x8c8d('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x5d9e02[_0x8c8d('0x7f')]);}else{_0x5d9e02[_0x8c8d('0x7c')]='';}var _0x50b24f=_0x583908[_0x8c8d('0x77')]===_0x8c8d('0x80')?'eu':_0x8c8d('0x81');return getAccessToken(_0x583908)[_0x8c8d('0x26')](function(_0x4576cf){_0x4e3d5e=_0x4576cf;return getUser(_0x4e3d5e,_0x50b24f,_0x583908);})[_0x8c8d('0x26')](function(_0x45379e){_0x2c705a=_0x45379e;logger[_0x8c8d('0x2b')]('The\x20User\x20ID\x20is:',_0x2c705a['id']);return getEndUser(_0x4e3d5e,_0x50b24f,_0x583908,_0x5d9e02[_0x8c8d('0x83')],_0x5d9e02[_0x8c8d('0x84')],_0x2c705a,_0x4fd1ee);})[_0x8c8d('0x26')](function(_0x3f73ba){_0x14c1d0=_0x3f73ba;return getCall(_0x4e3d5e,_0x50b24f,_0x583908,_0x2c705a,_0x14c1d0,_0x4fd1ee,_0x5d9e02,'Inbound');})[_0x8c8d('0x26')](function(_0x4bbeba){if(_0x4bbeba){logger[_0x8c8d('0x2b')](_0x8c8d('0x85'),_0x4bbeba['id']);}})[_0x8c8d('0x28')](function(_0x4bb78f){logger['error']('['+_0x5d9e02[_0x8c8d('0x64')][_0x8c8d('0x91')]()+']',JSON['stringify'](_0x4bb78f));});}; \ 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 be5e23a..8d17b11 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 _0x3549=['data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','render'];(function(_0x5aa181,_0x563c75){var _0x184a84=function(_0x59a029){while(--_0x59a029){_0x5aa181['push'](_0x5aa181['shift']());}};_0x184a84(++_0x563c75);}(_0x3549,0x18c));var _0x9354=function(_0x2d8788,_0x5a7c50){_0x2d8788=_0x2d8788-0x0;var _0x4efd45=_0x3549[_0x2d8788];return _0x4efd45;};'use strict';var util=require(_0x9354('0x0'));var sh=require(_0x9354('0x1'));var Mustache=require(_0x9354('0x2'));var logger=require(_0x9354('0x3'))(_0x9354('0x4'));exports[_0x9354('0x5')]=function(_0x2a4030,_0x3425fe){var _0x1c7b1d=_0x2a4030[_0x9354('0x6')]?_0x2a4030[_0x9354('0x6')]:_0x9354('0x7');var _0xb6686f=_0x2a4030['data3']?Mustache[_0x9354('0x8')](_0x2a4030[_0x9354('0x9')],_0x3425fe):_0x3425fe;sh['exec'](_0xb6686f,function(_0x5b636f,_0x13fc06,_0x26bd73){if(_0x5b636f!==0x0){logger[_0x9354('0xa')](util['format'](_0x9354('0xb'),_0x1c7b1d,_0xb6686f,_0x5b636f,_0x26bd73));}else{logger[_0x9354('0xc')](util[_0x9354('0xd')](_0x9354('0xe'),_0x1c7b1d,_0xb6686f,_0x13fc06));}});}; \ No newline at end of file +var _0x198c=['data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x531a04,_0x416549){var _0x210985=function(_0x4c6946){while(--_0x4c6946){_0x531a04['push'](_0x531a04['shift']());}};_0x210985(++_0x416549);}(_0x198c,0x123));var _0xc198=function(_0xb76701,_0x46f71c){_0xb76701=_0xb76701-0x0;var _0x22276c=_0x198c[_0xb76701];return _0x22276c;};'use strict';var util=require(_0xc198('0x0'));var sh=require(_0xc198('0x1'));var Mustache=require(_0xc198('0x2'));var logger=require(_0xc198('0x3'))(_0xc198('0x4'));exports[_0xc198('0x5')]=function(_0x5a2e0c,_0x5310a0){var _0x51685e=_0x5a2e0c[_0xc198('0x6')]?_0x5a2e0c[_0xc198('0x6')]:_0xc198('0x7');var _0x3bfaa9=_0x5a2e0c[_0xc198('0x8')]?Mustache['render'](_0x5a2e0c[_0xc198('0x8')],_0x5310a0):_0x5310a0;sh[_0xc198('0x5')](_0x3bfaa9,function(_0x3596c1,_0x5eba4f,_0x214b7e){if(_0x3596c1!==0x0){logger[_0xc198('0x9')](util['format'](_0xc198('0xa'),_0x51685e,_0x3bfaa9,_0x3596c1,_0x214b7e));}else{logger[_0xc198('0xb')](util[_0xc198('0xc')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x51685e,_0x3bfaa9,_0x5eba4f));}});}; \ 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 553e23e..3797aed 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 _0x5d04=['toUpperCase','render','data2','data5','headers','data6','parse','stack','data1','GET','DELETE','POST','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','trigger','exec'];(function(_0x1d9986,_0x5c4b78){var _0x31d27d=function(_0x2f9b1c){while(--_0x2f9b1c){_0x1d9986['push'](_0x1d9986['shift']());}};_0x31d27d(++_0x5c4b78);}(_0x5d04,0x103));var _0x45d0=function(_0x58a115,_0x2672f2){_0x58a115=_0x58a115-0x0;var _0x2d1221=_0x5d04[_0x58a115];return _0x2d1221;};'use strict';var rp=require(_0x45d0('0x0'));var util=require(_0x45d0('0x1'));var _=require(_0x45d0('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x45d0('0x3'));exports[_0x45d0('0x4')]=function(_0x23a2d1,_0x48c624){var _0x3c8a38,_0x77a1fc;var _0xd721e6={'method':_0x23a2d1['data1'][_0x45d0('0x5')](),'uri':Mustache[_0x45d0('0x6')](_0x23a2d1[_0x45d0('0x7')],_0x48c624),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x23a2d1[_0x45d0('0x8')])==='number'&&parseInt(_0x23a2d1['data5'])>=0x1&&parseInt(_0x23a2d1['data5'])<=0xa?parseInt(_0x23a2d1[_0x45d0('0x8')])*0x3e8:0x5*0x3e8};try{_0xd721e6[_0x45d0('0x9')]=_0x23a2d1[_0x45d0('0xa')]?JSON[_0x45d0('0xb')](Mustache[_0x45d0('0x6')](_0x23a2d1[_0x45d0('0xa')],_0x48c624)):{};}catch(_0x57177e){logger['error'](_0x57177e[_0x45d0('0xc')]);}switch(_0x23a2d1[_0x45d0('0xd')][_0x45d0('0x5')]()){case _0x45d0('0xe'):case _0x45d0('0xf'):_0x3c8a38=null;_0xd721e6['qs']=_0x48c624;break;case _0x45d0('0x10'):case'PUT':if(_0x23a2d1[_0x45d0('0x11')]){try{_0x3c8a38=JSON[_0x45d0('0xb')](Mustache['render'](_0x23a2d1[_0x45d0('0x11')],_0x48c624));_0xd721e6[_0x45d0('0x12')]=_0x3c8a38;}catch(_0xb11c10){logger[_0x45d0('0x13')](_0xb11c10['stack']);logger['error'](_0x45d0('0x14'));}}else{_0x3c8a38=_0x48c624;_0xd721e6[_0x45d0('0x12')]=_0x3c8a38;}break;}logger[_0x45d0('0x15')](util[_0x45d0('0x16')](_0x45d0('0x17'),_0x23a2d1[_0x45d0('0xd')],_0x23a2d1[_0x45d0('0x7')],JSON[_0x45d0('0x18')](_0xd721e6)));rp(_0xd721e6)[_0x45d0('0x19')](function(_0x5675d2){_0x3c8a38=!_[_0x45d0('0x1a')](_0x3c8a38)?_0x45d0('0x1b')+_0x3c8a38:'';_0x77a1fc=typeof _0x5675d2[_0x45d0('0x12')]===_0x45d0('0x1c')?JSON[_0x45d0('0x18')](_0x5675d2[_0x45d0('0x12')]):_0x5675d2['body'];logger[_0x45d0('0x15')](util[_0x45d0('0x16')](_0x45d0('0x1d'),_0x23a2d1[_0x45d0('0xd')],_0x23a2d1[_0x45d0('0x7')],_0x5675d2[_0x45d0('0x1e')],_0x77a1fc));})['catch'](function(_0x39434a){logger[_0x45d0('0x13')](util[_0x45d0('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x23a2d1['data1'],_0x23a2d1[_0x45d0('0x7')],_0x39434a[_0x45d0('0x1e')],_0x39434a[_0x45d0('0x1f')],_0x39434a[_0x45d0('0x20')]));});}; \ No newline at end of file +var _0x8641=['data1','render','data2','data5','number','headers','data6','parse','error','stack','toUpperCase','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec'];(function(_0x5365ad,_0x41ec9b){var _0x365519=function(_0x5f0cd2){while(--_0x5f0cd2){_0x5365ad['push'](_0x5365ad['shift']());}};_0x365519(++_0x41ec9b);}(_0x8641,0x1c0));var _0x1864=function(_0x2cc374,_0x21c582){_0x2cc374=_0x2cc374-0x0;var _0x306658=_0x8641[_0x2cc374];return _0x306658;};'use strict';var rp=require(_0x1864('0x0'));var util=require(_0x1864('0x1'));var _=require(_0x1864('0x2'));var Mustache=require(_0x1864('0x3'));var logger=require(_0x1864('0x4'))(_0x1864('0x5'));exports[_0x1864('0x6')]=function(_0xa38fae,_0x4f1721){var _0x25593a,_0x2b9788;var _0x352d71={'method':_0xa38fae[_0x1864('0x7')]['toUpperCase'](),'uri':Mustache[_0x1864('0x8')](_0xa38fae[_0x1864('0x9')],_0x4f1721),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa38fae[_0x1864('0xa')])===_0x1864('0xb')&&parseInt(_0xa38fae[_0x1864('0xa')])>=0x1&&parseInt(_0xa38fae[_0x1864('0xa')])<=0xa?parseInt(_0xa38fae[_0x1864('0xa')])*0x3e8:0x5*0x3e8};try{_0x352d71[_0x1864('0xc')]=_0xa38fae[_0x1864('0xd')]?JSON[_0x1864('0xe')](Mustache[_0x1864('0x8')](_0xa38fae[_0x1864('0xd')],_0x4f1721)):{};}catch(_0xc8cad8){logger[_0x1864('0xf')](_0xc8cad8[_0x1864('0x10')]);}switch(_0xa38fae['data1'][_0x1864('0x11')]()){case _0x1864('0x12'):case _0x1864('0x13'):_0x25593a=null;_0x352d71['qs']=_0x4f1721;break;case _0x1864('0x14'):case'PUT':if(_0xa38fae['data7']){try{_0x25593a=JSON[_0x1864('0xe')](Mustache[_0x1864('0x8')](_0xa38fae[_0x1864('0x15')],_0x4f1721));_0x352d71[_0x1864('0x16')]=_0x25593a;}catch(_0x3bd8be){logger['error'](_0x3bd8be[_0x1864('0x10')]);logger[_0x1864('0xf')](_0x1864('0x17'));}}else{_0x25593a=_0x4f1721;_0x352d71[_0x1864('0x16')]=_0x25593a;}break;}logger['info'](util['format'](_0x1864('0x18'),_0xa38fae[_0x1864('0x7')],_0xa38fae[_0x1864('0x9')],JSON[_0x1864('0x19')](_0x352d71)));rp(_0x352d71)[_0x1864('0x1a')](function(_0x29b7a9){_0x25593a=!_[_0x1864('0x1b')](_0x25593a)?_0x1864('0x1c')+_0x25593a:'';_0x2b9788=typeof _0x29b7a9[_0x1864('0x16')]===_0x1864('0x1d')?JSON[_0x1864('0x19')](_0x29b7a9[_0x1864('0x16')]):_0x29b7a9[_0x1864('0x16')];logger[_0x1864('0x1e')](util[_0x1864('0x1f')](_0x1864('0x20'),_0xa38fae[_0x1864('0x7')],_0xa38fae[_0x1864('0x9')],_0x29b7a9[_0x1864('0x21')],_0x2b9788));})['catch'](function(_0x56da52){logger[_0x1864('0xf')](util[_0x1864('0x1f')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xa38fae[_0x1864('0x7')],_0xa38fae[_0x1864('0x9')],_0x56da52[_0x1864('0x21')],_0x56da52[_0x1864('0x22')],_0x56da52['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index c67c727..e6b64c3 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 _0xef79=['routing','client','http','Request','request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x272577,_0x10bb9e){var _0x43ac0a=function(_0x9b00fa){while(--_0x9b00fa){_0x272577['push'](_0x272577['shift']());}};_0x43ac0a(++_0x10bb9e);}(_0xef79,0xc2));var _0x9ef7=function(_0x2a2000,_0x33e0b6){_0x2a2000=_0x2a2000-0x0;var _0x2529ca=_0xef79[_0x2a2000];return _0x2529ca;};'use strict';var jayson=require(_0x9ef7('0x0'));var BPromise=require(_0x9ef7('0x1'));var logger=require('../../config/logger')(_0x9ef7('0x2'));var client=jayson[_0x9ef7('0x3')][_0x9ef7('0x4')]({'port':0x2329});client[_0x9ef7('0x5')]=function(_0x4efc3d,_0x3578d9){return new BPromise(function(_0x4e0c38,_0x3ff3e5){return client[_0x9ef7('0x6')](_0x4efc3d,_0x3578d9)[_0x9ef7('0x7')](function(_0x16890b){logger['debug'](_0x9ef7('0x8'),_0x9ef7('0x2'),_0x4efc3d,_0x3578d9,_0x16890b);if(_0x16890b[_0x9ef7('0x9')]){logger[_0x9ef7('0x9')](_0x9ef7('0x8'),_0x9ef7('0x2'),_0x4efc3d,_0x16890b[_0x9ef7('0x9')][_0x9ef7('0xa')],_0x3578d9);return _0x3ff3e5(_0x16890b['error'][_0x9ef7('0xa')]);}else{return _0x4e0c38(_0x16890b[_0x9ef7('0xb')]);}})[_0x9ef7('0xc')](function(_0x293ecf){logger[_0x9ef7('0x9')]('rpc',_0x9ef7('0x2'),_0x4efc3d,_0x293ecf,_0x3578d9);return _0x3ff3e5(_0x293ecf);});});};module[_0x9ef7('0xd')]=client; \ No newline at end of file +var _0xe81f=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','error','rpc','message','result','catch','exports'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xe81f,0x11d));var _0xfe81=function(_0x36c20f,_0x22ff16){_0x36c20f=_0x36c20f-0x0;var _0x5bf69a=_0xe81f[_0x36c20f];return _0x5bf69a;};'use strict';var jayson=require(_0xfe81('0x0'));var BPromise=require(_0xfe81('0x1'));var logger=require(_0xfe81('0x2'))(_0xfe81('0x3'));var client=jayson[_0xfe81('0x4')][_0xfe81('0x5')]({'port':0x2329});client[_0xfe81('0x6')]=function(_0x435557,_0xcd4001){return new BPromise(function(_0x2962fd,_0x2e2e2d){return client['request'](_0x435557,_0xcd4001)[_0xfe81('0x7')](function(_0x363379){logger[_0xfe81('0x8')]('rpc',_0xfe81('0x3'),_0x435557,_0xcd4001,_0x363379);if(_0x363379[_0xfe81('0x9')]){logger['error'](_0xfe81('0xa'),_0xfe81('0x3'),_0x435557,_0x363379[_0xfe81('0x9')]['message'],_0xcd4001);return _0x2e2e2d(_0x363379[_0xfe81('0x9')][_0xfe81('0xb')]);}else{return _0x2962fd(_0x363379[_0xfe81('0xc')]);}})[_0xfe81('0xd')](function(_0x2420ff){logger['error'](_0xfe81('0xa'),'routing',_0x435557,_0x2420ff,_0xcd4001);return _0x2e2e2d(_0x2420ff);});});};module[_0xfe81('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 2c255af..21cfab6 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 _0x0aa0=['getSettings','loginMailFrequency','log','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','mailAccounts','listen'];(function(_0x1cfdcd,_0x1e2fbd){var _0x1ee13a=function(_0x5d94c7){while(--_0x5d94c7){_0x1cfdcd['push'](_0x1cfdcd['shift']());}};_0x1ee13a(++_0x1e2fbd);}(_0x0aa0,0xf5));var _0x00aa=function(_0x300bdb,_0x59a158){_0x300bdb=_0x300bdb-0x0;var _0x8569d5=_0x0aa0[_0x300bdb];return _0x8569d5;};'use strict';var BPromise=require('bluebird');var server=require(_0x00aa('0x0'));var Realtime=require(_0x00aa('0x1'));var EmailChannel=require(_0x00aa('0x2'));var mailAccount=require(_0x00aa('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x00aa('0x4')]()[_0x00aa('0x5')](mailAccount['getMailAccounts']())[_0x00aa('0x5')](realtime['initMailAccounts']())[_0x00aa('0x5')](function(){email['refresh'](realtime[_0x00aa('0x6')]);return realtime;});}function main(){return server[_0x00aa('0x7')](realtime,email)[_0x00aa('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0x00aa('0x8')]();})['then'](function(_0x52ac32){return setInterval(initRealtime,_0x52ac32[_0x00aa('0x9')]*0x3e8);})['catch'](function(_0x52b192){console[_0x00aa('0xa')](_0x52b192);});}main(); \ No newline at end of file +var _0x7505=['resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','./rpc/setting'];(function(_0x584789,_0x1f4b10){var _0x57c028=function(_0xea3f33){while(--_0xea3f33){_0x584789['push'](_0x584789['shift']());}};_0x57c028(++_0x1f4b10);}(_0x7505,0x1cc));var _0x5750=function(_0x2ad2f7,_0x14d8df){_0x2ad2f7=_0x2ad2f7-0x0;var _0x15e303=_0x7505[_0x2ad2f7];return _0x15e303;};'use strict';var BPromise=require(_0x5750('0x0'));var server=require(_0x5750('0x1'));var Realtime=require(_0x5750('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x5750('0x3'));var setting=require(_0x5750('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5750('0x5')]()[_0x5750('0x6')](mailAccount[_0x5750('0x7')]())['then'](realtime[_0x5750('0x8')]())['then'](function(){email[_0x5750('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x5750('0xa')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x5750('0xb')]();})[_0x5750('0x6')](function(_0x574ad2){return setInterval(initRealtime,_0x574ad2[_0x5750('0xc')]*0x3e8);})[_0x5750('0xd')](function(_0x37aca0){console[_0x5750('0xe')](_0x37aca0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index bc835d0..2ed1553 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 _0xcc6f=['redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','total','isNil','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','messageStatus','connected','name','messages','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','error','send','Smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email'];(function(_0x5e0914,_0x481afe){var _0x5eebff=function(_0x34c6f3){while(--_0x34c6f3){_0x5e0914['push'](_0x5e0914['shift']());}};_0x5eebff(++_0x481afe);}(_0xcc6f,0x1b0));var _0xfcc6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcc6f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xfcc6('0x0'));var moment=require(_0xfcc6('0x1'));var BPromise=require(_0xfcc6('0x2'));var md5=require(_0xfcc6('0x3'));var Redis=require(_0xfcc6('0x4'));var config=require(_0xfcc6('0x5'));var logger=require(_0xfcc6('0x6'))(_0xfcc6('0x7'));config[_0xfcc6('0x8')]=_[_0xfcc6('0x9')](config['redis'],{'host':_0xfcc6('0xa'),'port':0x18eb});var io=require(_0xfcc6('0xb'))(new Redis(config[_0xfcc6('0x8')]));var EmailImap=require(_0xfcc6('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xfcc6('0xd'));var md5Accounts={};function EmailChannel(_0x4c7818){logger[_0xfcc6('0xe')](_0xfcc6('0xf'));this[_0xfcc6('0x10')]=_0x4c7818[_0xfcc6('0x10')];this[_0xfcc6('0x11')]={};this[_0xfcc6('0x12')]=new EmailSmtp();}EmailChannel[_0xfcc6('0x13')][_0xfcc6('0x14')]=function(_0x57f213){var _0x55ffe0=this[_0xfcc6('0x10')][_0x57f213];var _0x5069e7={'id':_0x55ffe0['id'],'name':_0x55ffe0['name'],'key':_0x55ffe0[_0xfcc6('0x15')],'active':_0x55ffe0[_0xfcc6('0x16')],'Imap':{'status':_0x55ffe0[_0xfcc6('0x17')][_0xfcc6('0x18')],'messageStatus':_0x55ffe0[_0xfcc6('0x17')]['messageStatus'],'total':_0x55ffe0[_0xfcc6('0x17')][_0xfcc6('0x19')]}};if(_[_0xfcc6('0x1a')](md5Accounts[_0x57f213])){md5Accounts[_0x57f213]={};}var _0x1981ea=md5(JSON['stringify'](_0x5069e7));if(md5Accounts[_0x57f213]['md5']!==_0x1981ea){md5Accounts[_0x57f213][_0xfcc6('0x3')]=_0x1981ea;io[_0xfcc6('0x14')](_0xfcc6('0x1b'),_0x5069e7);}};EmailChannel[_0xfcc6('0x13')]['refresh']=function(_0x1d9a9f){for(var _0x1185ed in _0x1d9a9f){if(_0x1d9a9f['hasOwnProperty'](_0x1185ed)){if(_0x1d9a9f[_0x1185ed][_0xfcc6('0x17')]&&_0x1d9a9f[_0x1185ed][_0xfcc6('0x16')]){var _0x2d6536=_0x1d9a9f[_0x1185ed][_0xfcc6('0x17')];if(!this['imapAccounts'][_0xfcc6('0x1c')](_0x2d6536['id'])){this[_0xfcc6('0x11')][_0x2d6536['id']]=new EmailImap(_0x2d6536,_0x1d9a9f[_0x1185ed][_0xfcc6('0x7')]);this[_0xfcc6('0x11')][_0x2d6536['id']]['on'](_0xfcc6('0x1d'),this[_0xfcc6('0x1e')][_0xfcc6('0x1f')](this,_0x1185ed));this[_0xfcc6('0x11')][_0x2d6536['id']]['on'](_0xfcc6('0x7'),this[_0xfcc6('0x20')][_0xfcc6('0x1f')](this,_0x1185ed));this[_0xfcc6('0x11')][_0x2d6536['id']]['on'](_0xfcc6('0x21'),this[_0xfcc6('0x22')][_0xfcc6('0x1f')](this,_0x1185ed));this['imapAccounts'][_0x2d6536['id']]['on']('error',this[_0xfcc6('0x23')]['bind'](this,_0x1185ed));}}else{if(_[_0xfcc6('0x1a')](this[_0xfcc6('0x10')][_0x1185ed][_0xfcc6('0x17')])){this['mailAccounts'][_0x1185ed][_0xfcc6('0x17')]={};}this[_0xfcc6('0x10')][_0x1185ed][_0xfcc6('0x17')][_0xfcc6('0x18')]=_0xfcc6('0x24');this['mailAccounts'][_0x1185ed][_0xfcc6('0x17')][_0xfcc6('0x25')]='';this[_0xfcc6('0x14')](_0x1185ed);}}}};EmailChannel[_0xfcc6('0x13')]['handleImapBox']=function(_0xf7ddd9,_0x45310f){if(this[_0xfcc6('0x10')][_0xf7ddd9]){this[_0xfcc6('0x10')][_0xf7ddd9][_0xfcc6('0x17')][_0xfcc6('0x18')]=_0xfcc6('0x26');this[_0xfcc6('0x10')][_0xf7ddd9][_0xfcc6('0x17')][_0xfcc6('0x25')]=_0x45310f[_0xfcc6('0x27')];if(_0x45310f[_0xfcc6('0x28')]){this['mailAccounts'][_0xf7ddd9][_0xfcc6('0x17')][_0xfcc6('0x19')]=_0x45310f[_0xfcc6('0x28')][_0xfcc6('0x19')];}return this[_0xfcc6('0x14')](_0xf7ddd9);}};EmailChannel['prototype'][_0xfcc6('0x20')]=function(_0x2d4691,_0x409672){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x409672[_0xfcc6('0x29')],_0x409672[_0xfcc6('0x2a')],_0x409672[_0xfcc6('0x2b')],_0x2d4691);if(this[_0xfcc6('0x10')][_0x2d4691]){return mailAccount[_0xfcc6('0x2c')](_0x2d4691,_0x409672)[_0xfcc6('0x2d')](function(_0x2c9e95){if(_0x2c9e95){logger['info'](_0xfcc6('0x2e'));}})[_0xfcc6('0x2f')](function(_0x377731){logger['error'](_0xfcc6('0x30'),JSON[_0xfcc6('0x31')](_0x377731));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x4d3f32){if(this[_0xfcc6('0x10')][_0x4d3f32]&&this[_0xfcc6('0x10')][_0x4d3f32][_0xfcc6('0x17')]){if(this[_0xfcc6('0x11')][this[_0xfcc6('0x10')][_0x4d3f32][_0xfcc6('0x17')]['id']]){delete this[_0xfcc6('0x11')][this[_0xfcc6('0x10')][_0x4d3f32][_0xfcc6('0x17')]['id']];}this[_0xfcc6('0x10')][_0x4d3f32][_0xfcc6('0x17')]['lastSync']=moment();this[_0xfcc6('0x14')](_0x4d3f32);}};EmailChannel[_0xfcc6('0x13')]['handleImapError']=function(_0x2bc73c,_0x1f2e41){if(this[_0xfcc6('0x10')][_0x2bc73c]){this[_0xfcc6('0x10')][_0x2bc73c]['Imap'][_0xfcc6('0x18')]=_0xfcc6('0x32');this[_0xfcc6('0x10')][_0x2bc73c][_0xfcc6('0x17')]['messageStatus']=_0x1f2e41;return this[_0xfcc6('0x14')](_0x2bc73c);}};EmailChannel[_0xfcc6('0x13')]['sendMail']=function(_0x23fdc7,_0x5457ce){return this[_0xfcc6('0x12')][_0xfcc6('0x33')](_0x23fdc7,_0x5457ce);};EmailChannel['prototype']['verifySmtp']=function(_0x14270b){var _0x170ca6=this;if(this[_0xfcc6('0x10')][_0x14270b['id']]){if(_['isNil'](this[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')])){this[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')]={};}this[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')]['lastSync']=moment();return new BPromise(function(_0x1c5607,_0x1e1c7){return _0x170ca6[_0xfcc6('0x12')][_0xfcc6('0x35')](_0x14270b)[_0xfcc6('0x2d')](function(_0x59066e){_0x170ca6[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')][_0xfcc6('0x18')]=_0xfcc6('0x36');_0x170ca6[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')]['messageStatus']='';_0x170ca6['emit'](_0x14270b['id']);_0x1c5607(_0x59066e);})['catch'](function(_0x51ec4a){_0x170ca6[_0xfcc6('0x10')][_0x14270b['id']][_0xfcc6('0x34')][_0xfcc6('0x18')]='error';_0x170ca6['mailAccounts'][_0x14270b['id']][_0xfcc6('0x34')]['messageStatus']=_0x51ec4a;_0x170ca6[_0xfcc6('0x14')](_0x14270b['id']);_0x1e1c7(_0x51ec4a);});});}return this[_0xfcc6('0x12')][_0xfcc6('0x35')](_0x14270b);};module['exports']=EmailChannel; \ No newline at end of file +var _0xf688=['./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','emit','name','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xf688,0x168));var _0x8f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf688[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8f68('0x0'));var moment=require(_0x8f68('0x1'));var BPromise=require(_0x8f68('0x2'));var md5=require(_0x8f68('0x3'));var Redis=require(_0x8f68('0x4'));var config=require('../../../config/environment');var logger=require(_0x8f68('0x5'))(_0x8f68('0x6'));config[_0x8f68('0x7')]=_[_0x8f68('0x8')](config[_0x8f68('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8f68('0x9'))(new Redis(config['redis']));var EmailImap=require(_0x8f68('0xa'));var EmailSmtp=require(_0x8f68('0xb'));var mailAccount=require(_0x8f68('0xc'));var md5Accounts={};function EmailChannel(_0x3ab09a){logger['info'](_0x8f68('0xd'));this['mailAccounts']=_0x3ab09a[_0x8f68('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x8f68('0xf')]=function(_0x5c42d5){var _0x168b9d=this['mailAccounts'][_0x5c42d5];var _0x385d1a={'id':_0x168b9d['id'],'name':_0x168b9d[_0x8f68('0x10')],'key':_0x168b9d['key'],'active':_0x168b9d[_0x8f68('0x11')],'Imap':{'status':_0x168b9d[_0x8f68('0x12')][_0x8f68('0x13')],'messageStatus':_0x168b9d[_0x8f68('0x12')][_0x8f68('0x14')],'total':_0x168b9d['Imap'][_0x8f68('0x15')]}};if(_[_0x8f68('0x16')](md5Accounts[_0x5c42d5])){md5Accounts[_0x5c42d5]={};}var _0x43964f=md5(JSON[_0x8f68('0x17')](_0x385d1a));if(md5Accounts[_0x5c42d5]['md5']!==_0x43964f){md5Accounts[_0x5c42d5][_0x8f68('0x3')]=_0x43964f;io[_0x8f68('0xf')](_0x8f68('0x18'),_0x385d1a);}};EmailChannel[_0x8f68('0x19')][_0x8f68('0x1a')]=function(_0x5ecf3d){for(var _0x11b103 in _0x5ecf3d){if(_0x5ecf3d[_0x8f68('0x1b')](_0x11b103)){if(_0x5ecf3d[_0x11b103][_0x8f68('0x12')]&&_0x5ecf3d[_0x11b103][_0x8f68('0x11')]){var _0x5f2c54=_0x5ecf3d[_0x11b103][_0x8f68('0x12')];if(!this[_0x8f68('0x1c')][_0x8f68('0x1b')](_0x5f2c54['id'])){this[_0x8f68('0x1c')][_0x5f2c54['id']]=new EmailImap(_0x5f2c54,_0x5ecf3d[_0x11b103][_0x8f68('0x6')]);this[_0x8f68('0x1c')][_0x5f2c54['id']]['on'](_0x8f68('0x1d'),this[_0x8f68('0x1e')][_0x8f68('0x1f')](this,_0x11b103));this[_0x8f68('0x1c')][_0x5f2c54['id']]['on']('email',this[_0x8f68('0x20')]['bind'](this,_0x11b103));this[_0x8f68('0x1c')][_0x5f2c54['id']]['on'](_0x8f68('0x21'),this['handleImapEnd']['bind'](this,_0x11b103));this[_0x8f68('0x1c')][_0x5f2c54['id']]['on'](_0x8f68('0x22'),this[_0x8f68('0x23')][_0x8f68('0x1f')](this,_0x11b103));}}else{if(_[_0x8f68('0x16')](this[_0x8f68('0xe')][_0x11b103][_0x8f68('0x12')])){this[_0x8f68('0xe')][_0x11b103]['Imap']={};}this[_0x8f68('0xe')][_0x11b103][_0x8f68('0x12')][_0x8f68('0x13')]=_0x8f68('0x24');this[_0x8f68('0xe')][_0x11b103][_0x8f68('0x12')]['messageStatus']='';this['emit'](_0x11b103);}}}};EmailChannel[_0x8f68('0x19')][_0x8f68('0x1e')]=function(_0x2cf789,_0x5d7040){if(this[_0x8f68('0xe')][_0x2cf789]){this[_0x8f68('0xe')][_0x2cf789][_0x8f68('0x12')][_0x8f68('0x13')]=_0x8f68('0x25');this['mailAccounts'][_0x2cf789][_0x8f68('0x12')][_0x8f68('0x14')]=_0x5d7040['name'];if(_0x5d7040[_0x8f68('0x26')]){this[_0x8f68('0xe')][_0x2cf789][_0x8f68('0x12')]['total']=_0x5d7040[_0x8f68('0x26')][_0x8f68('0x15')];}return this[_0x8f68('0xf')](_0x2cf789);}};EmailChannel[_0x8f68('0x19')][_0x8f68('0x20')]=function(_0x34cabb,_0xe497aa){logger[_0x8f68('0x27')](_0x8f68('0x28'),_0xe497aa[_0x8f68('0x29')],_0xe497aa['lastName'],_0xe497aa[_0x8f68('0x2a')],_0x34cabb);if(this[_0x8f68('0xe')][_0x34cabb]){return mailAccount[_0x8f68('0x2b')](_0x34cabb,_0xe497aa)[_0x8f68('0x2c')](function(_0x5e2a70){if(_0x5e2a70){logger['info'](_0x8f68('0x2d'));}})['catch'](function(_0x198537){logger['error'](_0x8f68('0x2e'),JSON[_0x8f68('0x17')](_0x198537));});}};EmailChannel[_0x8f68('0x19')]['handleImapEnd']=function(_0x13620b){if(this[_0x8f68('0xe')][_0x13620b]&&this[_0x8f68('0xe')][_0x13620b]['Imap']){if(this[_0x8f68('0x1c')][this[_0x8f68('0xe')][_0x13620b][_0x8f68('0x12')]['id']]){delete this[_0x8f68('0x1c')][this['mailAccounts'][_0x13620b][_0x8f68('0x12')]['id']];}this[_0x8f68('0xe')][_0x13620b][_0x8f68('0x12')][_0x8f68('0x2f')]=moment();this[_0x8f68('0xf')](_0x13620b);}};EmailChannel[_0x8f68('0x19')]['handleImapError']=function(_0x45db8d,_0x13d034){if(this[_0x8f68('0xe')][_0x45db8d]){this[_0x8f68('0xe')][_0x45db8d][_0x8f68('0x12')][_0x8f68('0x13')]='error';this['mailAccounts'][_0x45db8d][_0x8f68('0x12')][_0x8f68('0x14')]=_0x13d034;return this['emit'](_0x45db8d);}};EmailChannel[_0x8f68('0x19')]['sendMail']=function(_0x13f294,_0x992082){return this[_0x8f68('0x30')]['send'](_0x13f294,_0x992082);};EmailChannel[_0x8f68('0x19')][_0x8f68('0x31')]=function(_0x394880){var _0x2db912=this;if(this['mailAccounts'][_0x394880['id']]){if(_[_0x8f68('0x16')](this[_0x8f68('0xe')][_0x394880['id']][_0x8f68('0x32')])){this['mailAccounts'][_0x394880['id']][_0x8f68('0x32')]={};}this[_0x8f68('0xe')][_0x394880['id']]['Smtp'][_0x8f68('0x2f')]=moment();return new BPromise(function(_0x36e71b,_0x2f135d){return _0x2db912[_0x8f68('0x30')][_0x8f68('0x33')](_0x394880)['then'](function(_0x152506){_0x2db912['mailAccounts'][_0x394880['id']]['Smtp'][_0x8f68('0x13')]=_0x8f68('0x34');_0x2db912[_0x8f68('0xe')][_0x394880['id']]['Smtp']['messageStatus']='';_0x2db912[_0x8f68('0xf')](_0x394880['id']);_0x36e71b(_0x152506);})['catch'](function(_0xa8db18){_0x2db912[_0x8f68('0xe')][_0x394880['id']][_0x8f68('0x32')][_0x8f68('0x13')]=_0x8f68('0x22');_0x2db912[_0x8f68('0xe')][_0x394880['id']]['Smtp']['messageStatus']=_0xa8db18;_0x2db912[_0x8f68('0xf')](_0x394880['id']);_0x2f135d(_0xa8db18);});});}return this[_0x8f68('0x30')][_0x8f68('0x33')](_0x394880);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 40421c4..66bfc3d 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 _0x34e8=['getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','account'];(function(_0x149016,_0x374450){var _0x326a70=function(_0x5ed00a){while(--_0x5ed00a){_0x149016['push'](_0x149016['shift']());}};_0x326a70(++_0x374450);}(_0x34e8,0x12c));var _0x834e=function(_0x1a2740,_0x1d9cd9){_0x1a2740=_0x1a2740-0x0;var _0x5c3c9f=_0x34e8[_0x1a2740];return _0x5c3c9f;};'use strict';var fs=require('fs');var path=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var Imap=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));var rs=require('randomstring');var simpleParser=require(_0x834e('0x4'))[_0x834e('0x5')];var Iconv=require(_0x834e('0x6'))[_0x834e('0x7')];var EventEmitter=require(_0x834e('0x8'))[_0x834e('0x9')];var utils=require(_0x834e('0xa'));var logger=require('../../../config/logger')(_0x834e('0xb'));function EmailImap(_0x52056d,_0x3e16d2){this[_0x834e('0xc')]=_0x834e('0xd');this[_0x834e('0xe')]=this[_0x834e('0xf')](_0x52056d,_0x3e16d2);this[_0x834e('0x2')]=new Imap(this[_0x834e('0xe')]);this[_0x834e('0x2')][_0x834e('0x10')](_0x834e('0x11'),this[_0x834e('0x12')][_0x834e('0x13')](this));this[_0x834e('0x2')][_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x15')][_0x834e('0x13')](this));this['imap']['on'](_0x834e('0x16'),this[_0x834e('0x17')]['bind'](this));this[_0x834e('0x2')][_0x834e('0x18')]();}util[_0x834e('0x19')](EmailImap,EventEmitter);EmailImap[_0x834e('0x1a')]['getAccount']=function(_0x43156c,_0x302cbd){var _0x57274a={'connTimeout':_0x43156c[_0x834e('0x1b')]?_0x43156c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x43156c[_0x834e('0x1c')]?_0x43156c[_0x834e('0x1c')]*0x3e8:0x1388};if(_['isNil'](_0x43156c[_0x834e('0x1d')])){if(_0x43156c[_0x834e('0x1e')]){_0x57274a[_0x834e('0x1f')]=_0x43156c['user'];_0x57274a[_0x834e('0x20')]=_0x43156c[_0x834e('0x20')];}_0x57274a[_0x834e('0x21')]=_0x43156c[_0x834e('0x21')];_0x57274a[_0x834e('0x22')]=_0x43156c[_0x834e('0x22')]||0x3e1;if(_0x43156c[_0x834e('0x23')]){_0x57274a['tls']=!![];}else{_0x57274a[_0x834e('0x23')]=![];_0x57274a[_0x834e('0x24')]=_0x834e('0x25');}}else{_0x57274a[_0x834e('0x1f')]=_0x43156c['user'];_0x57274a[_0x834e('0x20')]=_0x43156c[_0x834e('0x20')];_0x57274a['host']=utils[_0x834e('0x26')](_0x43156c[_0x834e('0x1d')]);_0x57274a[_0x834e('0x22')]=0x3e1;_0x57274a['tls']=!![];}_0x57274a['email']=_0x302cbd||_0x43156c[_0x834e('0x1f')]||_0x834e('0x27');return _0x57274a;};EmailImap['prototype'][_0x834e('0x12')]=function(){this[_0x834e('0x2')]['openBox'](this[_0x834e('0xc')],![],this[_0x834e('0x28')][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x28')]=function(_0x3e310f,_0x5e1cc5){if(_0x3e310f){this['handleError'](_0x3e310f,!![]);}else{this[_0x834e('0x29')]('box',_0x5e1cc5);this[_0x834e('0x2a')]();}};EmailImap[_0x834e('0x1a')][_0x834e('0x2b')]=function(_0x2cc2eb){if(_0x2cc2eb){this[_0x834e('0x17')](_0x2cc2eb,!![]);}else{this[_0x834e('0x2')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x834e('0x2c')]([_0x834e('0x2d')],this[_0x834e('0x2e')]['bind'](this));};EmailImap[_0x834e('0x1a')][_0x834e('0x2e')]=function(_0x1f3671,_0x1e026a){if(_0x1f3671){this[_0x834e('0x17')](_0x1f3671,!![]);}else{if(_0x1e026a[_0x834e('0x2f')]){try{var _0x3d149d=this[_0x834e('0x2')][_0x834e('0x30')](_0x1e026a,{'bodies':'','markSeen':!![]});_0x3d149d['on']('message',this[_0x834e('0x31')]['bind'](this));_0x3d149d[_0x834e('0x10')](_0x834e('0x16'),this[_0x834e('0x32')][_0x834e('0x13')](this));_0x3d149d[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x33')][_0x834e('0x13')](this));}catch(_0x358c31){logger[_0x834e('0x16')](_0x358c31);}}else{this['imap'][_0x834e('0x34')](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));}}};EmailImap[_0x834e('0x1a')]['handleFetchMessage']=function(_0x3f88ad,_0x379d60){_0x3f88ad['on']('body',this['handleMessageBody']['bind'](this));_0x3f88ad[_0x834e('0x10')](_0x834e('0x35'),this[_0x834e('0x36')][_0x834e('0x13')](this));_0x3f88ad[_0x834e('0x10')](_0x834e('0x14'),this['handleMessageEnd'][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x37')]=function(_0x6a3ac,_0x47abed){simpleParser(_0x6a3ac,{'Iconv':Iconv},this[_0x834e('0x38')][_0x834e('0x13')](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x388711){};EmailImap[_0x834e('0x1a')][_0x834e('0x39')]=function(){};EmailImap[_0x834e('0x1a')][_0x834e('0x38')]=function(_0x4ca43c,_0x1c5ed6){if(_0x4ca43c){logger['error'](_0x4ca43c);}else{var _0x50c243=this;utils[_0x834e('0x3a')](this['account'],_0x1c5ed6,function(_0x2e5239){_0x50c243[_0x834e('0x29')](_0x834e('0xb'),_0x2e5239);});}};EmailImap[_0x834e('0x1a')][_0x834e('0x33')]=function(){this['imap'][_0x834e('0x34')](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));};EmailImap['prototype'][_0x834e('0x32')]=function(_0x16ac45){this['handleError'](_0x16ac45);this[_0x834e('0x2')]['closeBox'](!![],this[_0x834e('0x2b')][_0x834e('0x13')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x834e('0x29')](_0x834e('0x14'));};EmailImap[_0x834e('0x1a')][_0x834e('0x17')]=function(_0x8ad264,_0x23feea){logger[_0x834e('0x16')]('handleError',this[_0x834e('0xe')]['email'],JSON[_0x834e('0x3b')](_0x8ad264));var _0x540685='';if(_0x8ad264){if(_0x8ad264[_0x834e('0x3c')]){_0x540685=_0x8ad264['textCode'];}else{for(var _0x361f60 in _0x8ad264){if(_0x8ad264[_0x834e('0x3d')](_0x361f60)){_0x540685+=_['upperFirst'](_0x361f60)+':\x20'+_0x8ad264[_0x361f60]+'\x0a';}}}}if(_0x23feea){this[_0x834e('0x2')][_0x834e('0x14')]();}else{this[_0x834e('0x29')](_0x834e('0x16'),_0x540685);this[_0x834e('0x29')](_0x834e('0x14'));}};module[_0x834e('0x3e')]=EmailImap; \ No newline at end of file +var _0x9b9b=['handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','end','exports','util','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','bind','handleEnd','error','handleError','inherits','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','prototype','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x9b9b,0x114));var _0xb9b9=function(_0x364450,_0xd81db8){_0x364450=_0x364450-0x0;var _0x3d9c5e=_0x9b9b[_0x364450];return _0x3d9c5e;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xb9b9('0x0'));var Imap=require('imap');var _=require('lodash');var rs=require(_0xb9b9('0x1'));var simpleParser=require(_0xb9b9('0x2'))[_0xb9b9('0x3')];var Iconv=require(_0xb9b9('0x4'))[_0xb9b9('0x5')];var EventEmitter=require(_0xb9b9('0x6'))[_0xb9b9('0x7')];var utils=require(_0xb9b9('0x8'));var logger=require(_0xb9b9('0x9'))(_0xb9b9('0xa'));function EmailImap(_0x85eec,_0x3ef9c1){this[_0xb9b9('0xb')]=_0xb9b9('0xc');this[_0xb9b9('0xd')]=this[_0xb9b9('0xe')](_0x85eec,_0x3ef9c1);this['imap']=new Imap(this['account']);this[_0xb9b9('0xf')][_0xb9b9('0x10')](_0xb9b9('0x11'),this['handleReady'][_0xb9b9('0x12')](this));this[_0xb9b9('0xf')][_0xb9b9('0x10')]('end',this[_0xb9b9('0x13')][_0xb9b9('0x12')](this));this[_0xb9b9('0xf')]['on'](_0xb9b9('0x14'),this[_0xb9b9('0x15')][_0xb9b9('0x12')](this));this['imap']['connect']();}util[_0xb9b9('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xb9b9('0xe')]=function(_0x50e5d6,_0x2ba838){var _0x23bac9={'connTimeout':_0x50e5d6[_0xb9b9('0x17')]?_0x50e5d6[_0xb9b9('0x17')]*0x3e8:0x2710,'authTimeout':_0x50e5d6[_0xb9b9('0x18')]?_0x50e5d6[_0xb9b9('0x18')]*0x3e8:0x1388};if(_[_0xb9b9('0x19')](_0x50e5d6[_0xb9b9('0x1a')])){if(_0x50e5d6['authentication']){_0x23bac9[_0xb9b9('0x1b')]=_0x50e5d6['user'];_0x23bac9[_0xb9b9('0x1c')]=_0x50e5d6[_0xb9b9('0x1c')];}_0x23bac9[_0xb9b9('0x1d')]=_0x50e5d6[_0xb9b9('0x1d')];_0x23bac9['port']=_0x50e5d6[_0xb9b9('0x1e')]||0x3e1;if(_0x50e5d6[_0xb9b9('0x1f')]){_0x23bac9[_0xb9b9('0x1f')]=!![];}else{_0x23bac9[_0xb9b9('0x1f')]=![];_0x23bac9[_0xb9b9('0x20')]=_0xb9b9('0x21');}}else{_0x23bac9[_0xb9b9('0x1b')]=_0x50e5d6[_0xb9b9('0x1b')];_0x23bac9[_0xb9b9('0x1c')]=_0x50e5d6[_0xb9b9('0x1c')];_0x23bac9[_0xb9b9('0x1d')]=utils[_0xb9b9('0x22')](_0x50e5d6[_0xb9b9('0x1a')]);_0x23bac9['port']=0x3e1;_0x23bac9[_0xb9b9('0x1f')]=!![];}_0x23bac9[_0xb9b9('0xa')]=_0x2ba838||_0x50e5d6[_0xb9b9('0x1b')]||'anonymous@xcally.com';return _0x23bac9;};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x24')]=function(){this['imap'][_0xb9b9('0x25')](this[_0xb9b9('0xb')],![],this[_0xb9b9('0x26')][_0xb9b9('0x12')](this));};EmailImap[_0xb9b9('0x23')]['handleOpenBox']=function(_0x4dfa3f,_0x33ab82){if(_0x4dfa3f){this[_0xb9b9('0x15')](_0x4dfa3f,!![]);}else{this['emit'](_0xb9b9('0x27'),_0x33ab82);this[_0xb9b9('0x28')]();}};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x29')]=function(_0x125f6c){if(_0x125f6c){this['handleError'](_0x125f6c,!![]);}else{this[_0xb9b9('0xf')]['end']();}};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x28')]=function(){this['imap'][_0xb9b9('0x2a')]([_0xb9b9('0x2b')],this[_0xb9b9('0x2c')]['bind'](this));};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x2c')]=function(_0x2e1d12,_0x300453){if(_0x2e1d12){this['handleError'](_0x2e1d12,!![]);}else{if(_0x300453[_0xb9b9('0x2d')]){try{var _0xdbc1f1=this['imap'][_0xb9b9('0x2e')](_0x300453,{'bodies':'','markSeen':!![]});_0xdbc1f1['on'](_0xb9b9('0x2f'),this[_0xb9b9('0x30')][_0xb9b9('0x12')](this));_0xdbc1f1['once'](_0xb9b9('0x14'),this[_0xb9b9('0x31')][_0xb9b9('0x12')](this));_0xdbc1f1[_0xb9b9('0x10')]('end',this[_0xb9b9('0x32')][_0xb9b9('0x12')](this));}catch(_0x532fa4){logger[_0xb9b9('0x14')](_0x532fa4);}}else{this[_0xb9b9('0xf')][_0xb9b9('0x33')](!![],this[_0xb9b9('0x29')][_0xb9b9('0x12')](this));}}};EmailImap[_0xb9b9('0x23')]['handleFetchMessage']=function(_0x2c5d2d,_0x237c44){_0x2c5d2d['on']('body',this[_0xb9b9('0x34')][_0xb9b9('0x12')](this));_0x2c5d2d[_0xb9b9('0x10')]('attributes',this[_0xb9b9('0x35')]['bind'](this));_0x2c5d2d[_0xb9b9('0x10')]('end',this[_0xb9b9('0x36')][_0xb9b9('0x12')](this));};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x34')]=function(_0x3dd3fe,_0x76f4d4){simpleParser(_0x3dd3fe,{'Iconv':Iconv},this[_0xb9b9('0x37')]['bind'](this));};EmailImap['prototype'][_0xb9b9('0x35')]=function(_0x134d6c){};EmailImap[_0xb9b9('0x23')]['handleMessageEnd']=function(){};EmailImap[_0xb9b9('0x23')]['handleSimpleParser']=function(_0x2778f9,_0x4147df){if(_0x2778f9){logger[_0xb9b9('0x14')](_0x2778f9);}else{var _0x21c1e4=this;utils[_0xb9b9('0x38')](this[_0xb9b9('0xd')],_0x4147df,function(_0x15baa2){_0x21c1e4[_0xb9b9('0x39')](_0xb9b9('0xa'),_0x15baa2);});}};EmailImap[_0xb9b9('0x23')]['handleFetchEnd']=function(){this[_0xb9b9('0xf')][_0xb9b9('0x33')](!![],this[_0xb9b9('0x29')][_0xb9b9('0x12')](this));};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x31')]=function(_0x36717c){this[_0xb9b9('0x15')](_0x36717c);this[_0xb9b9('0xf')][_0xb9b9('0x33')](!![],this['handleCloseBox'][_0xb9b9('0x12')](this));};EmailImap[_0xb9b9('0x23')][_0xb9b9('0x13')]=function(){this[_0xb9b9('0x39')]('end');};EmailImap[_0xb9b9('0x23')]['handleError']=function(_0x5b439e,_0x3e374e){logger[_0xb9b9('0x14')]('handleError',this['account'][_0xb9b9('0xa')],JSON[_0xb9b9('0x3a')](_0x5b439e));var _0x375543='';if(_0x5b439e){if(_0x5b439e[_0xb9b9('0x3b')]){_0x375543=_0x5b439e['textCode'];}else{for(var _0x114782 in _0x5b439e){if(_0x5b439e[_0xb9b9('0x3c')](_0x114782)){_0x375543+=_[_0xb9b9('0x3d')](_0x114782)+':\x20'+_0x5b439e[_0x114782]+'\x0a';}}}}if(_0x3e374e){this['imap']['end']();}else{this[_0xb9b9('0x39')]('error',_0x375543);this[_0xb9b9('0x39')](_0xb9b9('0x3e'));}};module[_0xb9b9('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 7224276..6938b6f 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 _0x0c56=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','createTransport','use','compile'];(function(_0x1df6ee,_0xdc463a){var _0x5e7971=function(_0x325f97){while(--_0x325f97){_0x1df6ee['push'](_0x1df6ee['shift']());}};_0x5e7971(++_0xdc463a);}(_0x0c56,0x71));var _0x60c5=function(_0x521292,_0x2f5fa0){_0x521292=_0x521292-0x0;var _0x1fec26=_0x0c56[_0x521292];return _0x1fec26;};'use strict';var nodemailer=require(_0x60c5('0x0'));var BPromise=require(_0x60c5('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x60c5('0x2')][_0x60c5('0x3')]=function(_0x3b9296,_0x35acc4){return new BPromise(function(_0x4d519e,_0x2a908f){var _0x197f78=nodemailer[_0x60c5('0x4')](_0x3b9296);_0x197f78[_0x60c5('0x5')](_0x60c5('0x6'),inlineBase64());_0x197f78[_0x60c5('0x7')](_0x35acc4,function(_0x4f1109,_0x584fc5){if(_0x4f1109){_0x2a908f(_0x4f1109[_0x60c5('0x8')]());}else{_0x4d519e(_0x584fc5);}});});};EmailSmtp[_0x60c5('0x2')][_0x60c5('0x9')]=function(_0x332e8f){return new BPromise(function(_0x543157,_0x25aa05){var _0x431aa9=nodemailer[_0x60c5('0x4')](_0x332e8f);_0x431aa9[_0x60c5('0x9')](function(_0x2f1e1a,_0x2c7656){if(_0x2f1e1a){_0x25aa05(_0x2f1e1a[_0x60c5('0x8')]());}else{if(_0x2c7656){_0x543157(_0x2c7656);}else{_0x25aa05(_0x60c5('0xa'));}}});});};module[_0x60c5('0xb')]=EmailSmtp; \ No newline at end of file +var _0x003a=['nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x4af472,_0x6ccb41){var _0x3b8445=function(_0x42ab52){while(--_0x42ab52){_0x4af472['push'](_0x4af472['shift']());}};_0x3b8445(++_0x6ccb41);}(_0x003a,0x9a));var _0xa003=function(_0x420142,_0x4043a1){_0x420142=_0x420142-0x0;var _0x3de644=_0x003a[_0x420142];return _0x3de644;};'use strict';var nodemailer=require(_0xa003('0x0'));var BPromise=require(_0xa003('0x1'));var inlineBase64=require(_0xa003('0x2'));function EmailSmtp(){}EmailSmtp[_0xa003('0x3')][_0xa003('0x4')]=function(_0x5bb9e6,_0x53a317){return new BPromise(function(_0x418d8c,_0x837d05){var _0x4f2352=nodemailer[_0xa003('0x5')](_0x5bb9e6);_0x4f2352['use'](_0xa003('0x6'),inlineBase64());_0x4f2352[_0xa003('0x7')](_0x53a317,function(_0x190f90,_0x45e119){if(_0x190f90){_0x837d05(_0x190f90[_0xa003('0x8')]());}else{_0x418d8c(_0x45e119);}});});};EmailSmtp[_0xa003('0x3')][_0xa003('0x9')]=function(_0x187d17){return new BPromise(function(_0x2c4571,_0xc1b9fa){var _0x2ab8b7=nodemailer[_0xa003('0x5')](_0x187d17);_0x2ab8b7[_0xa003('0x9')](function(_0x3adbdd,_0x442a80){if(_0x3adbdd){_0xc1b9fa(_0x3adbdd['toString']());}else{if(_0x442a80){_0x2c4571(_0x442a80);}else{_0xc1b9fa(_0xa003('0xa'));}}});});};module[_0xa003('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index edd81bd..feeb98d 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 _0x4991=['pop','html','test','replace','includes','\x20[Attachment:\x20','body','textAsHtml','message','originTo','isEmpty','originCc','bcc','type','attachment','attachment-','%s-%s','root','server/files/attachments/','writeFileSync','content','contentType','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','Attachments','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','split','length','join','value'];(function(_0x57534b,_0x537480){var _0x5ad732=function(_0x26bf53){while(--_0x26bf53){_0x57534b['push'](_0x57534b['shift']());}};_0x5ad732(++_0x537480);}(_0x4991,0xf7));var _0x1499=function(_0x4d8280,_0x14eb47){_0x4d8280=_0x4d8280-0x0;var _0x5c4e21=_0x4991[_0x4d8280];return _0x5c4e21;};'use strict';var _=require(_0x1499('0x0'));var moment=require('moment');var random=require(_0x1499('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x1499('0x2'));var tnef=require(_0x1499('0x3'));var logger=require(_0x1499('0x4'))(_0x1499('0x5'));var config=require(_0x1499('0x6'));function getAddress(_0x158134){var _0x19adff=_[_0x1499('0x7')](_0x158134['value']);return _0x19adff&&_0x19adff[_0x1499('0x8')]?_0x19adff[_0x1499('0x8')]:_0x1499('0x9')+random[_0x1499('0xa')](0x6)+_0x1499('0xb');}function getFirstName(_0x380e48){var _0x3277b3=_[_0x1499('0x7')](_0x380e48['value']);if(_0x3277b3&&_0x3277b3[_0x1499('0xc')]){var _0x36a053=_0x3277b3['name'][_0x1499('0xd')](/\s+/);return _0x36a053[_0x1499('0xe')]?_0x36a053['slice'](0x0,-0x1)[_0x1499('0xf')]('\x20'):_0x3277b3[_0x1499('0xc')];}return'Anonymous';}function getLastName(_0x4ab173){var _0x4dd594=_[_0x1499('0x7')](_0x4ab173[_0x1499('0x10')]);if(_0x4dd594&&_0x4dd594[_0x1499('0xc')]){var _0x334d7e=_0x4dd594[_0x1499('0xc')]['split'](/\s+/);return _0x334d7e['length']>0x1?_0x334d7e[_0x1499('0x11')]():'';}return'';}function getMails(_0x4e5195,_0x37d99e){var _0x12cde0='';for(var _0x308318=0x0;_0x308318<_0x37d99e[_0x1499('0x10')]['length'];_0x308318+=0x1){if(_0x37d99e[_0x1499('0x10')][_0x308318][_0x1499('0x8')]!==_0x4e5195){if(!_['isEmpty'](_0x12cde0)){_0x12cde0+=',';}_0x12cde0+=_0x37d99e[_0x1499('0x10')][_0x308318][_0x1499('0xc')]||_0x37d99e[_0x1499('0x10')][_0x308318][_0x1499('0x8')]||'';_0x12cde0+='\x20<';_0x12cde0+=_0x37d99e[_0x1499('0x10')][_0x308318][_0x1499('0x8')]?_0x37d99e['value'][_0x308318]['address']:'anonymous'+random[_0x1499('0xa')](0x6)+_0x1499('0xb');_0x12cde0+='>';}}return _0x12cde0;}function parseEmail(_0x4a4e28,_0x351da9,_0x3c13a1){if(_0x351da9[_0x1499('0x12')]){var _0x18e4a6=/)<[^<]*)*<\/script>/gi;while(_0x18e4a6[_0x1499('0x13')](_0x351da9[_0x1499('0x12')])){_0x351da9[_0x1499('0x12')]=_0x351da9[_0x1499('0x12')][_0x1499('0x14')](_0x18e4a6,'');}if(_0x351da9[_0x1499('0x12')][_0x1499('0x15')](_0x1499('0x16'))){var _0x223f4c=[];_0x351da9[_0x1499('0x17')][_0x1499('0x18')](_0x1e2c51=>{_0x223f4c[_0x1499('0x19')](_0x1e2c51['filename']);});var _0x258e9c=/]+>/g;var _0xc79f69=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x30f014=_0x351da9[_0x1499('0x12')][_0x1499('0x14')](_0xc79f69,_0x1499('0x1a'));var _0x54f3c2=_0x30f014['replace'](_0x258e9c,_0x1499('0x1b'));for(let _0x3c9aca=0x0;_0x3c9aca<_0x223f4c[_0x1499('0xe')];_0x3c9aca++){var _0x50f0cc=_0x54f3c2[_0x1499('0x14')]('_IMG',_0x1499('0x1c')+_0x223f4c[_0x3c9aca]+'\x20]');_0x54f3c2=_0x50f0cc;}_0x351da9['html']=_0x54f3c2;}_0x3c13a1['body']=_0x351da9[_0x1499('0x12')];}else{_0x3c13a1[_0x1499('0x1d')]=_0x351da9[_0x1499('0x1e')];}if(_0x3c13a1[_0x1499('0x1d')]){_0x3c13a1[_0x1499('0x1d')]=_0x3c13a1[_0x1499('0x1d')][_0x1499('0x14')](/Empty\x20message

';if(_0x4abd22['Attachments']){for(var _0x3814aa=0x0;_0x3814aa<_0x4abd22[_0x1499('0x38')][_0x1499('0xe')];_0x3814aa++){var _0x491707=_0x4abd22[_0x1499('0x38')][_0x3814aa];_0x3b67a7[_0x1499('0x1f')][_0x1499('0x17')][_0x1499('0x19')]({'filename':_0x491707['Title'],'content':new Buffer(_0x491707[_0x1499('0x39')])});}}}_0x1a589a(parseEmail(_0x61f5ce,_0x815a99,_0x3b67a7));});}else{_0x815a99[_0x1499('0x12')]=_0x1499('0x3a');_0x1a589a(parseEmail(_0x61f5ce,_0x815a99,_0x3b67a7));}}else{_0x1a589a(parseEmail(_0x61f5ce,_0x815a99,_0x3b67a7));}};exports[_0x1499('0x3b')]=function(_0x49cce1){switch(_0x49cce1){case _0x1499('0x3c'):return _0x1499('0x3d');case _0x1499('0x3e'):return'imap.mail.yahoo.com';case'hotmail':return _0x1499('0x3f');case'outlook365':return _0x1499('0x40');}return _0x1499('0x41');}; \ No newline at end of file +var _0xe820=['root','server/files/attachments/','writeFileSync','content','contentType','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','parseBuffer','first','BodyHTML','Attachments','Data','

Empty\x20message

','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','node-tnef','../../../config/logger','email','head','value','address','anonymous','@xcally.com','name','split','length','slice','join','generate','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x1f44d2['pop']():'';}return'';}function getMails(_0x1e4ddb,_0x4b748a){var _0x5b4ffd='';for(var _0x5a2d28=0x0;_0x5a2d28<_0x4b748a[_0x0e82('0x6')]['length'];_0x5a2d28+=0x1){if(_0x4b748a['value'][_0x5a2d28][_0x0e82('0x7')]!==_0x1e4ddb){if(!_['isEmpty'](_0x5b4ffd)){_0x5b4ffd+=',';}_0x5b4ffd+=_0x4b748a[_0x0e82('0x6')][_0x5a2d28][_0x0e82('0xa')]||_0x4b748a[_0x0e82('0x6')][_0x5a2d28][_0x0e82('0x7')]||'';_0x5b4ffd+='\x20<';_0x5b4ffd+=_0x4b748a['value'][_0x5a2d28][_0x0e82('0x7')]?_0x4b748a[_0x0e82('0x6')][_0x5a2d28][_0x0e82('0x7')]:_0x0e82('0x8')+random[_0x0e82('0xf')](0x6)+_0x0e82('0x9');_0x5b4ffd+='>';}}return _0x5b4ffd;}function parseEmail(_0x278bcd,_0x3735c0,_0xc9f7ac){if(_0x3735c0[_0x0e82('0x10')]){var _0x5903c=/)<[^<]*)*<\/script>/gi;while(_0x5903c['test'](_0x3735c0['html'])){_0x3735c0[_0x0e82('0x10')]=_0x3735c0[_0x0e82('0x10')][_0x0e82('0x11')](_0x5903c,'');}if(_0x3735c0[_0x0e82('0x10')][_0x0e82('0x12')](_0x0e82('0x13'))){var _0x39fcbe=[];_0x3735c0[_0x0e82('0x14')]['forEach'](_0x1b71b4=>{_0x39fcbe[_0x0e82('0x15')](_0x1b71b4[_0x0e82('0x16')]);});var _0x24f883=/]+>/g;var _0x507f08=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0xee85dd=_0x3735c0[_0x0e82('0x10')][_0x0e82('0x11')](_0x507f08,_0x0e82('0x17'));var _0x4900d3=_0xee85dd[_0x0e82('0x11')](_0x24f883,'_IMG');for(let _0x595319=0x0;_0x595319<_0x39fcbe[_0x0e82('0xc')];_0x595319++){var _0x168dbe=_0x4900d3['replace'](_0x0e82('0x18'),_0x0e82('0x19')+_0x39fcbe[_0x595319]+_0x0e82('0x1a'));_0x4900d3=_0x168dbe;}_0x3735c0['html']=_0x4900d3;}_0xc9f7ac[_0x0e82('0x1b')]=_0x3735c0[_0x0e82('0x10')];}else{_0xc9f7ac['body']=_0x3735c0[_0x0e82('0x1c')];}if(_0xc9f7ac['body']){_0xc9f7ac[_0x0e82('0x1b')]=_0xc9f7ac[_0x0e82('0x1b')]['replace'](/Empty\x20message

';if(_0x45d5da['Attachments']){for(var _0x2ae914=0x0;_0x2ae914<_0x45d5da[_0x0e82('0x35')][_0x0e82('0xc')];_0x2ae914++){var _0xffce81=_0x45d5da[_0x0e82('0x35')][_0x2ae914];_0x2abed6[_0x0e82('0x1e')][_0x0e82('0x14')][_0x0e82('0x15')]({'filename':_0xffce81['Title'],'content':new Buffer(_0xffce81[_0x0e82('0x36')])});}}}_0x1fbb17(parseEmail(_0x135c1b,_0x265872,_0x2abed6));});}else{_0x265872['html']=_0x0e82('0x37');_0x1fbb17(parseEmail(_0x135c1b,_0x265872,_0x2abed6));}}else{_0x1fbb17(parseEmail(_0x135c1b,_0x265872,_0x2abed6));}};exports['getHost']=function(_0x411574){switch(_0x411574){case'gmail':return _0x0e82('0x38');case _0x0e82('0x39'):return _0x0e82('0x3a');case'hotmail':return'imap-mail.outlook.com';case _0x0e82('0x3b'):return _0x0e82('0x3c');}return _0x0e82('0x3d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 946d1a4..928464e 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa515=['Imap','Smtp','lodash','name','key','SERV','active'];(function(_0xbc4ff0,_0x188361){var _0x2ad756=function(_0x44bdbd){while(--_0x44bdbd){_0xbc4ff0['push'](_0xbc4ff0['shift']());}};_0x2ad756(++_0x188361);}(_0xa515,0x11a));var _0x5a51=function(_0x4c4e39,_0x4560c4){_0x4c4e39=_0x4c4e39-0x0;var _0x2c9f44=_0xa515[_0x4c4e39];return _0x2c9f44;};'use strict';var _=require(_0x5a51('0x0'));function MailAccount(_0x412d36){this['id']=_0x412d36['id']||0x0;this['name']=_0x412d36[_0x5a51('0x1')]||'Service';this[_0x5a51('0x2')]=_0x412d36[_0x5a51('0x2')]||_0x5a51('0x3');this['active']=_0x412d36[_0x5a51('0x4')]||![];this[_0x5a51('0x5')]=_0x412d36['Imap']||[];this[_0x5a51('0x6')]=_0x412d36[_0x5a51('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x341f=['lodash','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x249945,_0x117111){var _0x3f5e5d=function(_0x45fc03){while(--_0x45fc03){_0x249945['push'](_0x249945['shift']());}};_0x3f5e5d(++_0x117111);}(_0x341f,0xb0));var _0xf341=function(_0x564397,_0x458c88){_0x564397=_0x564397-0x0;var _0x36a1d4=_0x341f[_0x564397];return _0x36a1d4;};'use strict';var _=require(_0xf341('0x0'));function MailAccount(_0x359865){this['id']=_0x359865['id']||0x0;this['name']=_0x359865['name']||_0xf341('0x1');this['key']=_0x359865[_0xf341('0x2')]||_0xf341('0x3');this[_0xf341('0x4')]=_0x359865[_0xf341('0x4')]||![];this[_0xf341('0x5')]=_0x359865[_0xf341('0x5')]||[];this['Smtp']=_0x359865[_0xf341('0x6')]||[];}module[_0xf341('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2ddab4f..19d1008 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a5b=['prototype','initMailAccounts','mailAccounts','isUndefined','merge','exports','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x105ace,_0x3bb3c1){var _0x3131b7=function(_0x472e2d){while(--_0x472e2d){_0x105ace['push'](_0x105ace['shift']());}};_0x3131b7(++_0x3bb3c1);}(_0x8a5b,0x1ec));var _0xb8a5=function(_0x2444be,_0x2c8b1a){_0x2444be=_0x2444be-0x0;var _0x23d85a=_0x8a5b[_0x2444be];return _0x23d85a;};'use strict';var _=require('lodash');var MailAccount=require(_0xb8a5('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x23ff22,_0x2967f2,_0x457699){var _0x53fb0e=_[_0xb8a5('0x1')](_0x23ff22,function(_0x3b217d,_0x5e5ef0){return _0x3b217d[_0x457699];});for(var _0xcc46b7 in _0x2967f2){if(_0x2967f2[_0xb8a5('0x2')](_0xcc46b7)){if(!_0x53fb0e[_0xcc46b7]){delete _0x2967f2[_0xcc46b7];}}}}Realtime[_0xb8a5('0x3')]['mergeFromDatabase']=function(_0x3f5093,_0x43fe18){for(var _0x398201 in _0x43fe18){if(_0x3f5093[_0xb8a5('0x2')](_0x398201)){_0x3f5093[_0x398201]=_0x43fe18[_0x398201];}}};Realtime[_0xb8a5('0x3')][_0xb8a5('0x4')]=function(){var _0x466a69=this;return function(_0x41c584){if(_0x41c584){freeIsNotKey(_0x41c584,_0x466a69[_0xb8a5('0x5')],'id');for(var _0x5b2049=0x0,_0x19a2b7={},_0x1b16ad={};_0x5b2049<_0x41c584['length'];_0x5b2049+=0x1){_0x19a2b7=_0x41c584[_0x5b2049];if(_[_0xb8a5('0x6')](_0x466a69[_0xb8a5('0x5')][_0x19a2b7['id']])){_0x466a69[_0xb8a5('0x5')][_0x19a2b7['id']]=new MailAccount(_0x19a2b7);}else{_[_0xb8a5('0x7')](_0x466a69[_0xb8a5('0x5')][_0x19a2b7['id']],_0x19a2b7);}}}return _0x466a69[_0xb8a5('0x5')];};};module[_0xb8a5('0x8')]=Realtime; \ No newline at end of file +var _0x87d6=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','merge','exports','lodash'];(function(_0x315ef8,_0x5380b6){var _0x403801=function(_0x23405d){while(--_0x23405d){_0x315ef8['push'](_0x315ef8['shift']());}};_0x403801(++_0x5380b6);}(_0x87d6,0x1a3));var _0x687d=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x87d6[_0x648163];return _0x199d4d;};'use strict';var _=require(_0x687d('0x0'));var MailAccount=require(_0x687d('0x1'));var Realtime=function(){this[_0x687d('0x2')]={};};function freeIsNotKey(_0xc7f65f,_0x782d4b,_0x293c35){var _0x45867f=_[_0x687d('0x3')](_0xc7f65f,function(_0x9a3a6b,_0x33d40a){return _0x9a3a6b[_0x293c35];});for(var _0x20c3c5 in _0x782d4b){if(_0x782d4b[_0x687d('0x4')](_0x20c3c5)){if(!_0x45867f[_0x20c3c5]){delete _0x782d4b[_0x20c3c5];}}}}Realtime[_0x687d('0x5')][_0x687d('0x6')]=function(_0x2d000e,_0x13b1bd){for(var _0x906dac in _0x13b1bd){if(_0x2d000e['hasOwnProperty'](_0x906dac)){_0x2d000e[_0x906dac]=_0x13b1bd[_0x906dac];}}};Realtime[_0x687d('0x5')]['initMailAccounts']=function(){var _0x48c3e3=this;return function(_0x5aff11){if(_0x5aff11){freeIsNotKey(_0x5aff11,_0x48c3e3[_0x687d('0x2')],'id');for(var _0x246562=0x0,_0xfca088={},_0x221362={};_0x246562<_0x5aff11[_0x687d('0x7')];_0x246562+=0x1){_0xfca088=_0x5aff11[_0x246562];if(_['isUndefined'](_0x48c3e3['mailAccounts'][_0xfca088['id']])){_0x48c3e3['mailAccounts'][_0xfca088['id']]=new MailAccount(_0xfca088);}else{_[_0x687d('0x8')](_0x48c3e3['mailAccounts'][_0xfca088['id']],_0xfca088);}}}return _0x48c3e3[_0x687d('0x2')];};};module[_0x687d('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 3a959e1..61d82ac 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfece=['getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','service','key','Imap','Smtp'];(function(_0x1f452a,_0x43b6df){var _0x3eebba=function(_0x5e6298){while(--_0x5e6298){_0x1f452a['push'](_0x1f452a['shift']());}};_0x3eebba(++_0x43b6df);}(_0xfece,0x19e));var _0xefec=function(_0x1db089,_0x3fb514){_0x1db089=_0x1db089-0x0;var _0x36056e=_0xfece[_0x1db089];return _0x36056e;};'use strict';var client=require(_0xefec('0x0'));exports[_0xefec('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0xefec('0x2'),'email','active',_0xefec('0x3'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xefec('0x4')},{'model':'MailServerOut','as':_0xefec('0x5')}]},'log':_0xefec('0x6')});};};exports[_0xefec('0x7')]=function(_0x3d6496,_0x212838){return client[_0xefec('0x8')]('NotifyMailAccount',{'account':{'id':_0x3d6496},'body':_0x212838,'log':_0xefec('0x9')});}; \ No newline at end of file +var _0xfa75=['MailServerIn','Imap','MailServerOut','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','name','service','email','active','ListId','TemplateId'];(function(_0x3b9a13,_0x189c2c){var _0x4ab54c=function(_0x30eea8){while(--_0x30eea8){_0x3b9a13['push'](_0x3b9a13['shift']());}};_0x4ab54c(++_0x189c2c);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x5fa7('0x0'));exports[_0x5fa7('0x1')]=function(){return function(){return client[_0x5fa7('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x5fa7('0x3'),_0x5fa7('0x4'),_0x5fa7('0x5'),_0x5fa7('0x6'),'key',_0x5fa7('0x7'),_0x5fa7('0x8')],'raw':![],'include':[{'model':_0x5fa7('0x9'),'as':_0x5fa7('0xa')},{'model':_0x5fa7('0xb'),'as':'Smtp'}]},'log':_0x5fa7('0xc')});};};exports['notify']=function(_0x9543ee,_0x2df4b8){return client[_0x5fa7('0x2')](_0x5fa7('0xd'),{'account':{'id':_0x9543ee},'body':_0x2df4b8,'log':_0x5fa7('0xd')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 28aae2e..603511a 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fa9=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6fa9,0x184));var _0x96fa=function(_0x3b72a3,_0x99baa8){_0x3b72a3=_0x3b72a3-0x0;var _0xc0fb0b=_0x6fa9[_0x3b72a3];return _0xc0fb0b;};'use strict';var client=require(_0x96fa('0x0'));exports[_0x96fa('0x1')]=function(){return client[_0x96fa('0x2')](_0x96fa('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x96fa('0x4')]},'log':_0x96fa('0x5')});}; \ No newline at end of file +var _0xb43c=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x5d1630,_0x17e648){var _0x57b997=function(_0x55074c){while(--_0x55074c){_0x5d1630['push'](_0x5d1630['shift']());}};_0x57b997(++_0x17e648);}(_0xb43c,0x1c7));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xcb43('0x0'));exports[_0xcb43('0x1')]=function(){return client[_0xcb43('0x2')](_0xcb43('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xcb43('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 0ed9310..36b277b 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index a56d81a..addc465 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09a0=['default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','timeout','port','polling','redis','defaults','../../config/triggers'];(function(_0x1cddb0,_0x473309){var _0x5a0b0d=function(_0x2ad5ae){while(--_0x2ad5ae){_0x1cddb0['push'](_0x1cddb0['shift']());}};_0x5a0b0d(++_0x473309);}(_0x09a0,0x1c7));var _0x009a=function(_0x30a25b,_0x4d8f48){_0x30a25b=_0x30a25b-0x0;var _0x45482c=_0x09a0[_0x30a25b];return _0x45482c;};'use strict';var _=require(_0x009a('0x0'));var http=require('http');var express=require(_0x009a('0x1'));var sticky=require('sticky-session');var Redis=require(_0x009a('0x2'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x009a('0x3')]=0xdbba0;if(sticky['listen'](server,config[_0x009a('0x4')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x009a('0x5')]});config[_0x009a('0x6')]=_[_0x009a('0x7')](config[_0x009a('0x6')],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x009a('0x6')])}));require(_0x009a('0x8'))[_0x009a('0x9')]();require(_0x009a('0xa'))[_0x009a('0x9')](socketio);require(_0x009a('0xb'))[_0x009a('0x9')](app);require(_0x009a('0xc'))[_0x009a('0x9')](app);}else{server['once']('listening',function(){console[_0x009a('0xd')](_0x009a('0xe'),config[_0x009a('0x4')]);});}exports=module[_0x009a('0xf')]=app; \ No newline at end of file +var _0x7fc3=['../../config/socketio','default','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','ioredis','createServer','listen','port','socket.io','websocket','redis','localhost','adapter'];(function(_0x44ec6c,_0x374bb6){var _0x4d18d6=function(_0xda2b0a){while(--_0xda2b0a){_0x44ec6c['push'](_0x44ec6c['shift']());}};_0x4d18d6(++_0x374bb6);}(_0x7fc3,0x1a6));var _0x37fc=function(_0x2739e8,_0x52fd45){_0x2739e8=_0x2739e8-0x0;var _0x3dc8dc=_0x7fc3[_0x2739e8];return _0x3dc8dc;};'use strict';var _=require('lodash');var http=require(_0x37fc('0x0'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x37fc('0x1'));var config=require('../../config/environment');var app=express();var server=http[_0x37fc('0x2')](app);server['timeout']=0xdbba0;if(sticky[_0x37fc('0x3')](server,config[_0x37fc('0x4')])){var socketio=require(_0x37fc('0x5'))(server,{'transports':[_0x37fc('0x6'),'polling']});config[_0x37fc('0x7')]=_['defaults'](config[_0x37fc('0x7')],{'host':_0x37fc('0x8'),'port':0x18eb});socketio[_0x37fc('0x9')](require('socket.io-redis')({'pubClient':new Redis(config[_0x37fc('0x7')]),'subClient':new Redis(config[_0x37fc('0x7')])}));require('../../config/triggers')['default']();require(_0x37fc('0xa'))[_0x37fc('0xb')](socketio);require(_0x37fc('0xc'))[_0x37fc('0xb')](app);require('../../routes')[_0x37fc('0xb')](app);}else{server[_0x37fc('0xd')](_0x37fc('0xe'),function(){console[_0x37fc('0xf')](_0x37fc('0x10'),config['port']);});}exports=module[_0x37fc('0x11')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index bfd9736..57153cf 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x435b=['../../config/logger','routing','client','Request','request','then','error','rpc','message','catch','jayson/promise','bluebird'];(function(_0x1fb6e2,_0x3a22ce){var _0x354690=function(_0x51f968){while(--_0x51f968){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x354690(++_0x3a22ce);}(_0x435b,0x172));var _0xb435=function(_0x55907b,_0xfd6ded){_0x55907b=_0x55907b-0x0;var _0x4403a8=_0x435b[_0x55907b];return _0x4403a8;};'use strict';var jayson=require(_0xb435('0x0'));var BPromise=require(_0xb435('0x1'));var logger=require(_0xb435('0x2'))(_0xb435('0x3'));var client=jayson[_0xb435('0x4')]['http']({'port':0x2329});client[_0xb435('0x5')]=function(_0x459188,_0x1f62c3){return new BPromise(function(_0x429371,_0x48fbe0){return client[_0xb435('0x6')](_0x459188,_0x1f62c3)[_0xb435('0x7')](function(_0x23d904){logger['debug']('rpc',_0xb435('0x3'),_0x459188,_0x1f62c3,_0x23d904);if(_0x23d904['error']){logger[_0xb435('0x8')](_0xb435('0x9'),_0xb435('0x3'),_0x459188,_0x23d904['error'][_0xb435('0xa')],_0x1f62c3);return _0x48fbe0(_0x23d904[_0xb435('0x8')][_0xb435('0xa')]);}else{return _0x429371(_0x23d904['result']);}})[_0xb435('0xb')](function(_0x3e2093){logger['error']('rpc',_0xb435('0x3'),_0x459188,_0x3e2093,_0x1f62c3);return _0x48fbe0(_0x3e2093);});});};module['exports']=client; \ No newline at end of file +var _0x4d3c=['catch','../../config/logger','routing','client','Request','request','debug','rpc','error','message'];(function(_0x42e978,_0x1f278b){var _0x56b8da=function(_0x5ee84c){while(--_0x5ee84c){_0x42e978['push'](_0x42e978['shift']());}};_0x56b8da(++_0x1f278b);}(_0x4d3c,0x173));var _0xc4d3=function(_0x16aad4,_0x18bad9){_0x16aad4=_0x16aad4-0x0;var _0x3a8f82=_0x4d3c[_0x16aad4];return _0x3a8f82;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc4d3('0x0'))(_0xc4d3('0x1'));var client=jayson[_0xc4d3('0x2')]['http']({'port':0x2329});client[_0xc4d3('0x3')]=function(_0x2e7b18,_0x5a9f65){return new BPromise(function(_0x5c15fe,_0x993d57){return client[_0xc4d3('0x4')](_0x2e7b18,_0x5a9f65)['then'](function(_0x534873){logger[_0xc4d3('0x5')](_0xc4d3('0x6'),_0xc4d3('0x1'),_0x2e7b18,_0x5a9f65,_0x534873);if(_0x534873[_0xc4d3('0x7')]){logger[_0xc4d3('0x7')]('rpc','routing',_0x2e7b18,_0x534873['error']['message'],_0x5a9f65);return _0x993d57(_0x534873[_0xc4d3('0x7')][_0xc4d3('0x8')]);}else{return _0x5c15fe(_0x534873['result']);}})[_0xc4d3('0x9')](function(_0x48e00c){logger['error']('rpc',_0xc4d3('0x1'),_0x2e7b18,_0x48e00c,_0x5a9f65);return _0x993d57(_0x48e00c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 3d49759..fe0d3ef 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2538=['listen','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x2538,0x1cd));var _0x8253=function(_0x57c2f6,_0x1ee1bf){_0x57c2f6=_0x57c2f6-0x0;var _0x1cbd95=_0x2538[_0x57c2f6];return _0x1cbd95;};'use strict';var BPromise=require('bluebird');var server=require(_0x8253('0x0'));var Realtime=require(_0x8253('0x1'));var user=require(_0x8253('0x2'));var interval=require(_0x8253('0x3'));var openchannelQueue=require(_0x8253('0x4'));var chatQueue=require(_0x8253('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x8253('0x6'));var faxQueue=require(_0x8253('0x7'));var whatsappQueue=require(_0x8253('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8253('0x9')]()[_0x8253('0xa')](user['getAgents']())[_0x8253('0xa')](realtime['initAgents']())[_0x8253('0xa')](interval[_0x8253('0xb')]())[_0x8253('0xa')](realtime['initIntervals']())['then'](openchannelQueue[_0x8253('0xc')]())[_0x8253('0xa')](realtime[_0x8253('0xd')]())['then'](chatQueue['getChatQueues']())[_0x8253('0xa')](realtime[_0x8253('0xe')]())['then'](smsQueue[_0x8253('0xf')]())[_0x8253('0xa')](realtime[_0x8253('0x10')]())[_0x8253('0xa')](mailQueue[_0x8253('0x11')]())[_0x8253('0xa')](realtime[_0x8253('0x12')]())[_0x8253('0xa')](faxQueue['getFaxQueues']())[_0x8253('0xa')](realtime[_0x8253('0x13')]())[_0x8253('0xa')](whatsappQueue[_0x8253('0x14')]())[_0x8253('0xa')](realtime[_0x8253('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0x8253('0x16')](realtime)[_0x8253('0xa')](function(_0x49c287){return initRealtime();})[_0x8253('0xa')](function(_0x27486f){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1579ec){console['log'](_0x1579ec);});}main(); \ No newline at end of file +var _0x43e3=['catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen'];(function(_0x355de0,_0x3e1d21){var _0xad0de2=function(_0x5ac42d){while(--_0x5ac42d){_0x355de0['push'](_0x355de0['shift']());}};_0xad0de2(++_0x3e1d21);}(_0x43e3,0x1d6));var _0x343e=function(_0x22eb5d,_0x2e519d){_0x22eb5d=_0x22eb5d-0x0;var _0x4a39ad=_0x43e3[_0x22eb5d];return _0x4a39ad;};'use strict';var BPromise=require(_0x343e('0x0'));var server=require(_0x343e('0x1'));var Realtime=require(_0x343e('0x2'));var user=require(_0x343e('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x343e('0x4'));var chatQueue=require(_0x343e('0x5'));var smsQueue=require(_0x343e('0x6'));var mailQueue=require(_0x343e('0x7'));var faxQueue=require(_0x343e('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x343e('0x9')]()['then'](user[_0x343e('0xa')]())[_0x343e('0xb')](realtime[_0x343e('0xc')]())[_0x343e('0xb')](interval[_0x343e('0xd')]())[_0x343e('0xb')](realtime[_0x343e('0xe')]())[_0x343e('0xb')](openchannelQueue[_0x343e('0xf')]())['then'](realtime[_0x343e('0x10')]())[_0x343e('0xb')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())[_0x343e('0xb')](smsQueue[_0x343e('0x11')]())['then'](realtime['initSmsQueues']())[_0x343e('0xb')](mailQueue[_0x343e('0x12')]())[_0x343e('0xb')](realtime['initMailQueues']())['then'](faxQueue[_0x343e('0x13')]())['then'](realtime[_0x343e('0x14')]())[_0x343e('0xb')](whatsappQueue[_0x343e('0x15')]())[_0x343e('0xb')](realtime[_0x343e('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x343e('0x17')](realtime)[_0x343e('0xb')](function(_0x48550d){return initRealtime();})['then'](function(_0x4aaa0f){return setInterval(initRealtime,0x1388);})[_0x343e('0x18')](function(_0x4aacaa){console[_0x343e('0x19')](_0x4aacaa);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 3e6e045..8ec1427 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x1c6d44,_0x1b7780){var _0x49d1a7=function(_0x1e6b18){while(--_0x1e6b18){_0x1c6d44['push'](_0x1c6d44['shift']());}};_0x49d1a7(++_0x1b7780);}(_0x814b,0x1a2));var _0xb814=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x814b[_0x553150];return _0x18193d;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x1b99aa,_0x46bb9a){var _0x541d7c=function(_0x2ebd10){while(--_0x2ebd10){_0x1b99aa['push'](_0x1b99aa['shift']());}};_0x541d7c(++_0x46bb9a);}(_0x814b,0x1a2));var _0xb814=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0x814b[_0x30780e];return _0x5b9129;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index e0ffd5c..78e6d45 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x331f=['http','request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x178d95,_0x5880c1){var _0x55688c=function(_0x481551){while(--_0x481551){_0x178d95['push'](_0x178d95['shift']());}};_0x55688c(++_0x5880c1);}(_0x331f,0x76));var _0xf331=function(_0x1027e3,_0x52676e){_0x1027e3=_0x1027e3-0x0;var _0x3b879e=_0x331f[_0x1027e3];return _0x3b879e;};'use strict';var BPromise=require(_0xf331('0x0'));var jayson=require(_0xf331('0x1'));var client=jayson[_0xf331('0x2')][_0xf331('0x3')]({'port':0x232b});function request(_0x1aaaf4,_0x50f88e){return new BPromise(function(_0x5a0024,_0x1656bb){return client[_0xf331('0x4')](_0x1aaaf4,_0x50f88e)[_0xf331('0x5')](function(_0x1c2a00){if(_0x1c2a00[_0xf331('0x6')]){return _0x1656bb(_0x1c2a00[_0xf331('0x6')][_0xf331('0x7')]);}else{return _0x5a0024(_0x1c2a00['result']);}})[_0xf331('0x8')](function(_0x5b78e1){return _0x1656bb(_0x5b78e1);});});}exports[_0xf331('0x9')]=function(_0x589c7f,_0x27b29e){return request(_0xf331('0xa'),{'account':_0x589c7f,'message':_0x27b29e});}; \ No newline at end of file +var _0xbf95=['then','error','message','result','catch','sendMailMessage','bluebird','jayson/promise','http','request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xbf95,0x114));var _0x5bf9=function(_0x4f59e5,_0x1871a0){_0x4f59e5=_0x4f59e5-0x0;var _0x249e30=_0xbf95[_0x4f59e5];return _0x249e30;};'use strict';var BPromise=require(_0x5bf9('0x0'));var jayson=require(_0x5bf9('0x1'));var client=jayson['client'][_0x5bf9('0x2')]({'port':0x232b});function request(_0xdfd670,_0xaee66a){return new BPromise(function(_0x2a00bf,_0x264855){return client[_0x5bf9('0x3')](_0xdfd670,_0xaee66a)[_0x5bf9('0x4')](function(_0x47d28a){if(_0x47d28a['error']){return _0x264855(_0x47d28a[_0x5bf9('0x5')][_0x5bf9('0x6')]);}else{return _0x2a00bf(_0x47d28a[_0x5bf9('0x7')]);}})[_0x5bf9('0x8')](function(_0x55831f){return _0x264855(_0x55831f);});});}exports[_0x5bf9('0x9')]=function(_0x477865,_0x1f140b){return request('SendMail',{'account':_0x477865,'message':_0x1f140b});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index b4bd62f..431b9fc 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f74=['lodash','moment','md5','ioredis','../../../config/environment','redis','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','name','chatStatusTime','faxCapacity','smsStatus','whatsappStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports'];(function(_0x5cb872,_0xa9137){var _0xb13c0c=function(_0x5e2769){while(--_0x5e2769){_0x5cb872['push'](_0x5cb872['shift']());}};_0xb13c0c(++_0xa9137);}(_0x2f74,0xf0));var _0x42f7=function(_0x27f9be,_0x268da6){_0x27f9be=_0x27f9be-0x0;var _0x3783a6=_0x2f74[_0x27f9be];return _0x3783a6;};'use strict';var _=require(_0x42f7('0x0'));var moment=require(_0x42f7('0x1'));var md5=require(_0x42f7('0x2'));var Redis=require(_0x42f7('0x3'));var config=require(_0x42f7('0x4'));config[_0x42f7('0x5')]=_['defaults'](config[_0x42f7('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x42f7('0x6'))(new Redis(config[_0x42f7('0x5')]));function Agent(_0x5bc0c5){this['id']=_0x5bc0c5['id']||0x0;this['name']=_0x5bc0c5['name']||'';this[_0x42f7('0x7')]=_0x5bc0c5[_0x42f7('0x7')]||!![];this[_0x42f7('0x8')]=_0x5bc0c5[_0x42f7('0x8')]||![];this[_0x42f7('0x9')]=_0x5bc0c5['chatPause']||![];this[_0x42f7('0xa')]=_0x5bc0c5['mailPause']||![];this[_0x42f7('0xb')]=_0x5bc0c5[_0x42f7('0xb')]||![];this[_0x42f7('0xc')]=_0x5bc0c5[_0x42f7('0xc')]||![];this[_0x42f7('0xd')]=_0x5bc0c5[_0x42f7('0xd')]||![];this[_0x42f7('0xe')]=_0x42f7('0xf');this['chatStatusTime']=0x0;this[_0x42f7('0x10')]=_0x5bc0c5[_0x42f7('0x10')]||0x0;this[_0x42f7('0x11')]=0x0;this[_0x42f7('0x12')]=_0x42f7('0xf');this[_0x42f7('0x13')]=0x0;this[_0x42f7('0x14')]=_0x5bc0c5[_0x42f7('0x14')]||0x0;this[_0x42f7('0x15')]=0x0;this[_0x42f7('0x16')]='unknown';this[_0x42f7('0x17')]=0x0;this['faxCapacity']=_0x5bc0c5['faxCapacity']||0x0;this[_0x42f7('0x18')]=0x0;this['smsStatus']=_0x42f7('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x5bc0c5['smsCapacity']||0x0;this[_0x42f7('0x19')]=0x0;this['whatsappStatus']='unknown';this[_0x42f7('0x1a')]=0x0;this['whatsappCapacity']=_0x5bc0c5['whatsappCapacity']||0x0;this[_0x42f7('0x1b')]=0x0;this[_0x42f7('0x1c')]=_0x42f7('0xf');this[_0x42f7('0x1d')]=0x0;this[_0x42f7('0x1e')]=_0x5bc0c5['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x42f7('0x1f')]=![];this[_0x42f7('0x20')]=undefined;this['md5']='';this[_0x42f7('0x21')]();}Agent[_0x42f7('0x22')][_0x42f7('0x23')]=function(_0x14505c){if(this[_0x14505c+_0x42f7('0x24')]>0x0){if(this[_0x14505c+_0x42f7('0x25')]>0x0&&this[_0x14505c+_0x42f7('0x24')]>=this[_0x14505c+_0x42f7('0x25')]){return _0x42f7('0x26');}else{return _0x42f7('0x27');}}else{return _0x42f7('0x28');}};Agent['prototype'][_0x42f7('0x21')]=function(){var _0x53bf8f=[_0x42f7('0x29'),'chat',_0x42f7('0x2a'),_0x42f7('0x2b'),_0x42f7('0x2c'),_0x42f7('0x2d')];for(var _0x17da5c=0x0;_0x17da5c<_0x53bf8f[_0x42f7('0x2e')];_0x17da5c+=0x1){var _0x4d4c80=this[_0x42f7('0x23')](_0x53bf8f[_0x17da5c]);if(this[_0x53bf8f[_0x17da5c]+_0x42f7('0x2f')]!==_0x4d4c80){this[_0x53bf8f[_0x17da5c]+_0x42f7('0x30')]=_['toNumber'](moment()[_0x42f7('0x31')]('x'));}this[_0x53bf8f[_0x17da5c]+_0x42f7('0x2f')]=_0x4d4c80;}var _0x581af0={'id':this['id'],'name':this[_0x42f7('0x32')],'online':this['online'],'voicePause':this[_0x42f7('0x8')],'chatPause':this[_0x42f7('0x9')],'mailPause':this[_0x42f7('0xa')],'smsPause':this[_0x42f7('0xc')],'faxPause':this[_0x42f7('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x42f7('0xe')],'chatStatusTime':this[_0x42f7('0x33')],'chatCapacity':this[_0x42f7('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x42f7('0x13')],'mailCapacity':this[_0x42f7('0x14')],'mailCurrentCapacity':this[_0x42f7('0x15')],'faxStatus':this[_0x42f7('0x16')],'faxStatusTime':this[_0x42f7('0x17')],'faxCapacity':this[_0x42f7('0x34')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x42f7('0x35')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x42f7('0x19')],'whatsappStatus':this[_0x42f7('0x36')],'whatsappStatusTime':this[_0x42f7('0x1a')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x42f7('0x1b')],'openchannelStatus':this[_0x42f7('0x1c')],'openchannelStatusTime':this[_0x42f7('0x1d')],'openchannelCapacity':this[_0x42f7('0x1e')],'openchannelCurrentCapacity':this[_0x42f7('0x37')],'busy':this[_0x42f7('0x1f')],'busyQueue':this[_0x42f7('0x20')]};var _0x25c23d=md5(JSON[_0x42f7('0x38')](_0x581af0));if(this['md5']!==_0x25c23d){this[_0x42f7('0x2')]=_0x25c23d;io[_0x42f7('0x39')](_0x42f7('0x3a'),_0x581af0);}};module[_0x42f7('0x3b')]=Agent; \ No newline at end of file +var _0x0c71=['sms','whatsapp','length','Status','mailStatusTime','whatsappCurrentCapacity','openchannelStatus','busyQueue','stringify','emit','exports','moment','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','md5','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','fax'];(function(_0x52c27d,_0xda4996){var _0x3e712a=function(_0x4bc790){while(--_0x4bc790){_0x52c27d['push'](_0x52c27d['shift']());}};_0x3e712a(++_0xda4996);}(_0x0c71,0xfb));var _0x10c7=function(_0x1a2786,_0x46e334){_0x1a2786=_0x1a2786-0x0;var _0x4bb7a3=_0x0c71[_0x1a2786];return _0x4bb7a3;};'use strict';var _=require('lodash');var moment=require(_0x10c7('0x0'));var md5=require('md5');var Redis=require(_0x10c7('0x1'));var config=require(_0x10c7('0x2'));config[_0x10c7('0x3')]=_['defaults'](config['redis'],{'host':_0x10c7('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x10c7('0x3')]));function Agent(_0x46a7fc){this['id']=_0x46a7fc['id']||0x0;this[_0x10c7('0x5')]=_0x46a7fc[_0x10c7('0x5')]||'';this[_0x10c7('0x6')]=_0x46a7fc[_0x10c7('0x6')]||!![];this['voicePause']=_0x46a7fc[_0x10c7('0x7')]||![];this[_0x10c7('0x8')]=_0x46a7fc['chatPause']||![];this[_0x10c7('0x9')]=_0x46a7fc['mailPause']||![];this['faxPause']=_0x46a7fc[_0x10c7('0xa')]||![];this[_0x10c7('0xb')]=_0x46a7fc['smsPause']||![];this[_0x10c7('0xc')]=_0x46a7fc[_0x10c7('0xc')]||![];this[_0x10c7('0xd')]=_0x10c7('0xe');this[_0x10c7('0xf')]=0x0;this[_0x10c7('0x10')]=_0x46a7fc[_0x10c7('0x10')]||0x0;this[_0x10c7('0x11')]=0x0;this[_0x10c7('0x12')]=_0x10c7('0xe');this['mailStatusTime']=0x0;this[_0x10c7('0x13')]=_0x46a7fc[_0x10c7('0x13')]||0x0;this[_0x10c7('0x14')]=0x0;this[_0x10c7('0x15')]=_0x10c7('0xe');this[_0x10c7('0x16')]=0x0;this[_0x10c7('0x17')]=_0x46a7fc['faxCapacity']||0x0;this[_0x10c7('0x18')]=0x0;this[_0x10c7('0x19')]='unknown';this[_0x10c7('0x1a')]=0x0;this[_0x10c7('0x1b')]=_0x46a7fc[_0x10c7('0x1b')]||0x0;this[_0x10c7('0x1c')]=0x0;this[_0x10c7('0x1d')]=_0x10c7('0xe');this[_0x10c7('0x1e')]=0x0;this[_0x10c7('0x1f')]=_0x46a7fc[_0x10c7('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x10c7('0xe');this[_0x10c7('0x20')]=0x0;this['openchannelCapacity']=_0x46a7fc[_0x10c7('0x21')]||0x0;this[_0x10c7('0x22')]=0x0;this[_0x10c7('0x23')]=![];this['busyQueue']=undefined;this[_0x10c7('0x24')]='';this['updateRealtime']();}Agent[_0x10c7('0x25')][_0x10c7('0x26')]=function(_0x326f31){if(this[_0x326f31+'CurrentCapacity']>0x0){if(this[_0x326f31+_0x10c7('0x27')]>0x0&&this[_0x326f31+_0x10c7('0x28')]>=this[_0x326f31+_0x10c7('0x27')]){return _0x10c7('0x29');}else{return _0x10c7('0x2a');}}else{return _0x10c7('0x2b');}};Agent[_0x10c7('0x25')][_0x10c7('0x2c')]=function(){var _0x33b697=[_0x10c7('0x2d'),_0x10c7('0x2e'),_0x10c7('0x2f'),_0x10c7('0x30'),_0x10c7('0x31'),_0x10c7('0x32')];for(var _0x3c9665=0x0;_0x3c9665<_0x33b697[_0x10c7('0x33')];_0x3c9665+=0x1){var _0x2cc3d0=this[_0x10c7('0x26')](_0x33b697[_0x3c9665]);if(this[_0x33b697[_0x3c9665]+_0x10c7('0x34')]!==_0x2cc3d0){this[_0x33b697[_0x3c9665]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x33b697[_0x3c9665]+_0x10c7('0x34')]=_0x2cc3d0;}var _0x460e28={'id':this['id'],'name':this[_0x10c7('0x5')],'online':this[_0x10c7('0x6')],'voicePause':this[_0x10c7('0x7')],'chatPause':this[_0x10c7('0x8')],'mailPause':this['mailPause'],'smsPause':this[_0x10c7('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0x10c7('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x10c7('0xf')],'chatCapacity':this[_0x10c7('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x10c7('0x12')],'mailStatusTime':this[_0x10c7('0x35')],'mailCapacity':this[_0x10c7('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x10c7('0x15')],'faxStatusTime':this[_0x10c7('0x16')],'faxCapacity':this[_0x10c7('0x17')],'faxCurrentCapacity':this[_0x10c7('0x18')],'smsStatus':this[_0x10c7('0x19')],'smsStatusTime':this[_0x10c7('0x1a')],'smsCapacity':this[_0x10c7('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x10c7('0x1e')],'whatsappCapacity':this[_0x10c7('0x1f')],'whatsappCurrentCapacity':this[_0x10c7('0x36')],'openchannelStatus':this[_0x10c7('0x37')],'openchannelStatusTime':this[_0x10c7('0x20')],'openchannelCapacity':this[_0x10c7('0x21')],'openchannelCurrentCapacity':this[_0x10c7('0x22')],'busy':this[_0x10c7('0x23')],'busyQueue':this[_0x10c7('0x38')]};var _0x3ff7a9=md5(JSON[_0x10c7('0x39')](_0x460e28));if(this[_0x10c7('0x24')]!==_0x3ff7a9){this[_0x10c7('0x24')]=_0x3ff7a9;io[_0x10c7('0x3a')]('user:save',_0x460e28);}};module[_0x10c7('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 0f38fea..a0e4516 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 _0xd199=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online','chatPause','available','loggedIn','stringify','format','chat_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x41ec1b,_0x1bbb53){var _0x57ce9c=function(_0x2d3c0e){while(--_0x2d3c0e){_0x41ec1b['push'](_0x41ec1b['shift']());}};_0x57ce9c(++_0x1bbb53);}(_0xd199,0x66));var _0x9d19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd199[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9d19('0x0'));var md5=require(_0x9d19('0x1'));var util=require(_0x9d19('0x2'));var Redis=require(_0x9d19('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x9d19('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9d19('0x5'))(new Redis(config[_0x9d19('0x4')]));function ChatQueue(_0x5241e0){this['id']=_0x5241e0['id']||0x0;this[_0x9d19('0x6')]=_0x5241e0['name']||'';this[_0x9d19('0x7')]=_0x5241e0[_0x9d19('0x7')]||0xa;this[_0x9d19('0x8')]=_0x5241e0['strategy']||_0x9d19('0x9');this['Agents']=_0x5241e0[_0x9d19('0xa')];this[_0x9d19('0xb')]={};this[_0x9d19('0xc')]=0x0;this[_0x9d19('0x1')]='';this[_0x9d19('0xd')]();this[_0x9d19('0xe')]();}ChatQueue['prototype'][_0x9d19('0xd')]=function(){var _0x153a3a=this[_0x9d19('0xb')][_0x9d19('0xf')];this[_0x9d19('0xb')]=_[_0x9d19('0x10')](this[_0x9d19('0xa')],'id');this['mapAgentsId'][_0x9d19('0xf')]=_0x153a3a;};ChatQueue[_0x9d19('0x11')][_0x9d19('0xe')]=function(){this['loggedIn']=0x0;this[_0x9d19('0x12')]=0x0;for(var _0x2551a6=0x0;_0x2551a6=0x0?this[_0x9d19('0x16')]:0x0;var _0x3c6727={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9d19('0x17')],'name':this[_0x9d19('0x6')],'paused':this[_0x9d19('0x12')],'waiting':this[_0x9d19('0xc')]};var _0x23ded9=md5(JSON[_0x9d19('0x18')](_0x3c6727));if(this[_0x9d19('0x1')]!==_0x23ded9){this['md5']=_0x23ded9;io['to'](util[_0x9d19('0x19')]('chat:queue:%s',_0x3c6727['name']))['emit'](_0x9d19('0x1a'),_0x3c6727);}};module[_0x9d19('0x1b')]=ChatQueue; \ No newline at end of file +var _0x239a=['updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x3d06ec,_0x54ca45){var _0x17700e=function(_0x2fcaeb){while(--_0x2fcaeb){_0x3d06ec['push'](_0x3d06ec['shift']());}};_0x17700e(++_0x54ca45);}(_0x239a,0xee));var _0xa239=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x239a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xa239('0x0'));var md5=require(_0xa239('0x1'));var util=require('util');var Redis=require(_0xa239('0x2'));var config=require(_0xa239('0x3'));config['redis']=_[_0xa239('0x4')](config[_0xa239('0x5')],{'host':_0xa239('0x6'),'port':0x18eb});var io=require(_0xa239('0x7'))(new Redis(config[_0xa239('0x5')]));function ChatQueue(_0x113c16){this['id']=_0x113c16['id']||0x0;this[_0xa239('0x8')]=_0x113c16[_0xa239('0x8')]||'';this[_0xa239('0x9')]=_0x113c16[_0xa239('0x9')]||0xa;this['strategy']=_0x113c16[_0xa239('0xa')]||'beepall';this[_0xa239('0xb')]=_0x113c16[_0xa239('0xb')];this[_0xa239('0xc')]={};this[_0xa239('0xd')]=0x0;this['md5']='';this[_0xa239('0xe')]();this[_0xa239('0xf')]();}ChatQueue[_0xa239('0x10')][_0xa239('0xe')]=function(){var _0x5c3476=this[_0xa239('0xc')][_0xa239('0x11')];this[_0xa239('0xc')]=_['map'](this[_0xa239('0xb')],'id');this[_0xa239('0xc')][_0xa239('0x11')]=_0x5c3476;};ChatQueue[_0xa239('0x10')][_0xa239('0xf')]=function(){this[_0xa239('0x12')]=0x0;this[_0xa239('0x13')]=0x0;for(var _0x3d6cc8=0x0;_0x3d6cc8=0x0?this[_0xa239('0x16')]:0x0;var _0x3c4062={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa239('0x12')],'name':this[_0xa239('0x8')],'paused':this[_0xa239('0x13')],'waiting':this[_0xa239('0xd')]};var _0x333143=md5(JSON[_0xa239('0x17')](_0x3c4062));if(this[_0xa239('0x1')]!==_0x333143){this[_0xa239('0x1')]=_0x333143;io['to'](util[_0xa239('0x18')](_0xa239('0x19'),_0x3c4062[_0xa239('0x8')]))[_0xa239('0x1a')](_0xa239('0x1b'),_0x3c4062);}};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 b93cf0f..1a1d06b 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 _0xc61e=['lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','updateRouting','map','prototype','updateRealtime','loggedIn','paused','length','online','faxPause','available','waiting','format','fax:queue:%s','emit','fax_queue:save','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc61e,0x134));var _0xec61=function(_0x445ba9,_0x3f51ff){_0x445ba9=_0x445ba9-0x0;var _0x5ce34b=_0xc61e[_0x445ba9];return _0x5ce34b;};'use strict';var _=require(_0xec61('0x0'));var md5=require(_0xec61('0x1'));var util=require('util');var Redis=require(_0xec61('0x2'));var config=require(_0xec61('0x3'));config[_0xec61('0x4')]=_[_0xec61('0x5')](config[_0xec61('0x4')],{'host':_0xec61('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x1a583c){this['id']=_0x1a583c['id']||0x0;this[_0xec61('0x7')]=_0x1a583c[_0xec61('0x7')]||'';this[_0xec61('0x8')]=_0x1a583c['timeout']||0xa;this['strategy']=_0x1a583c['strategy']||_0xec61('0x9');this[_0xec61('0xa')]=_0x1a583c[_0xec61('0xa')];this[_0xec61('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xec61('0xc')]=function(){var _0x21d6fe=this['mapAgentsId']['_rr'];this[_0xec61('0xb')]=_[_0xec61('0xd')](this[_0xec61('0xa')],'id');this[_0xec61('0xb')]['_rr']=_0x21d6fe;};FaxQueue[_0xec61('0xe')][_0xec61('0xf')]=function(){this[_0xec61('0x10')]=0x0;this[_0xec61('0x11')]=0x0;for(var _0x246a92=0x0;_0x246a92=0x0?this[_0xec61('0x15')]:0x0;var _0x1277d0={'id':this['id'],'available':this[_0xec61('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xec61('0x7')],'paused':this['paused'],'waiting':this[_0xec61('0x16')]};var _0x14b755=md5(JSON['stringify'](_0x1277d0));if(this['md5']!==_0x14b755){this['md5']=_0x14b755;io['to'](util[_0xec61('0x17')](_0xec61('0x18'),_0x1277d0[_0xec61('0x7')]))[_0xec61('0x19')](_0xec61('0x1a'),_0x1277d0);}};module[_0xec61('0x1b')]=FaxQueue; \ No newline at end of file +var _0x691c=['fax:queue:%s','fax_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','paused','online','faxPause','available'];(function(_0x5ade58,_0xb0fca3){var _0x4a015b=function(_0x2ebfdc){while(--_0x2ebfdc){_0x5ade58['push'](_0x5ade58['shift']());}};_0x4a015b(++_0xb0fca3);}(_0x691c,0x8a));var _0xc691=function(_0x242df1,_0x401c8d){_0x242df1=_0x242df1-0x0;var _0xbe8463=_0x691c[_0x242df1];return _0xbe8463;};'use strict';var _=require(_0xc691('0x0'));var md5=require('md5');var util=require(_0xc691('0x1'));var Redis=require('ioredis');var config=require(_0xc691('0x2'));config['redis']=_[_0xc691('0x3')](config[_0xc691('0x4')],{'host':_0xc691('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc691('0x4')]));function FaxQueue(_0x5075f8){this['id']=_0x5075f8['id']||0x0;this[_0xc691('0x6')]=_0x5075f8[_0xc691('0x6')]||'';this[_0xc691('0x7')]=_0x5075f8['timeout']||0xa;this[_0xc691('0x8')]=_0x5075f8[_0xc691('0x8')]||_0xc691('0x9');this['Agents']=_0x5075f8['Agents'];this[_0xc691('0xa')]={};this[_0xc691('0xb')]=0x0;this[_0xc691('0xc')]='';this[_0xc691('0xd')]();this[_0xc691('0xe')]();}FaxQueue[_0xc691('0xf')][_0xc691('0xd')]=function(){var _0x32c3e1=this[_0xc691('0xa')][_0xc691('0x10')];this['mapAgentsId']=_[_0xc691('0x11')](this[_0xc691('0x12')],'id');this[_0xc691('0xa')][_0xc691('0x10')]=_0x32c3e1;};FaxQueue[_0xc691('0xf')][_0xc691('0xe')]=function(){this[_0xc691('0x13')]=0x0;this[_0xc691('0x14')]=0x0;for(var _0x7caf49=0x0;_0x7caf49=0x0?this['available']:0x0;var _0x18e735={'id':this['id'],'available':this[_0xc691('0x17')],'loggedIn':this[_0xc691('0x13')],'name':this[_0xc691('0x6')],'paused':this[_0xc691('0x14')],'waiting':this[_0xc691('0xb')]};var _0x51c3b0=md5(JSON['stringify'](_0x18e735));if(this[_0xc691('0xc')]!==_0x51c3b0){this[_0xc691('0xc')]=_0x51c3b0;io['to'](util['format'](_0xc691('0x18'),_0x18e735[_0xc691('0x6')]))['emit'](_0xc691('0x19'),_0x18e735);}};module[_0xc691('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c06a99e..b613173 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 _0x56c0=['Intervals','exports','name'];(function(_0x2e9db0,_0x182ebd){var _0x237798=function(_0x17d692){while(--_0x17d692){_0x2e9db0['push'](_0x2e9db0['shift']());}};_0x237798(++_0x182ebd);}(_0x56c0,0x8c));var _0x056c=function(_0x419a97,_0x19fe2f){_0x419a97=_0x419a97-0x0;var _0x421d39=_0x56c0[_0x419a97];return _0x421d39;};'use strict';function Interval(_0x4c3945){this['id']=_0x4c3945['id']||0x0;this['name']=_0x4c3945[_0x056c('0x0')]||'';this[_0x056c('0x1')]=_0x4c3945[_0x056c('0x1')]||{};}module[_0x056c('0x2')]=Interval; \ No newline at end of file +var _0x72de=['Intervals','name'];(function(_0x557a2f,_0x49d41e){var _0x4ee553=function(_0x501369){while(--_0x501369){_0x557a2f['push'](_0x557a2f['shift']());}};_0x4ee553(++_0x49d41e);}(_0x72de,0x1c7));var _0xe72d=function(_0x2a15e6,_0xdb19ce){_0x2a15e6=_0x2a15e6-0x0;var _0x20e058=_0x72de[_0x2a15e6];return _0x20e058;};'use strict';function Interval(_0xa31f16){this['id']=_0xa31f16['id']||0x0;this[_0xe72d('0x0')]=_0xa31f16[_0xe72d('0x0')]||'';this[_0xe72d('0x1')]=_0xa31f16[_0xe72d('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 5a561bf..28db301 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 _0x8aac=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','length','online','paused','available','stringify','mail:queue:%s','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8aac,0x1e7));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8aa('0x0'));var md5=require(_0xc8aa('0x1'));var util=require(_0xc8aa('0x2'));var Redis=require(_0xc8aa('0x3'));var config=require(_0xc8aa('0x4'));config[_0xc8aa('0x5')]=_['defaults'](config[_0xc8aa('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc8aa('0x6'))(new Redis(config['redis']));function MailQueue(_0xcc22d0){this['id']=_0xcc22d0['id']||0x0;this[_0xc8aa('0x7')]=_0xcc22d0[_0xc8aa('0x7')]||'';this['timeout']=_0xcc22d0[_0xc8aa('0x8')]||0xa;this[_0xc8aa('0x9')]=_0xcc22d0['strategy']||_0xc8aa('0xa');this[_0xc8aa('0xb')]=_0xcc22d0['Agents'];this[_0xc8aa('0xc')]={};this[_0xc8aa('0xd')]=0x0;this[_0xc8aa('0x1')]='';this[_0xc8aa('0xe')]();this['updateRealtime']();}MailQueue[_0xc8aa('0xf')][_0xc8aa('0xe')]=function(){var _0x29d7a7=this['mapAgentsId'][_0xc8aa('0x10')];this[_0xc8aa('0xc')]=_['map'](this[_0xc8aa('0xb')],'id');this[_0xc8aa('0xc')]['_rr']=_0x29d7a7;};MailQueue['prototype'][_0xc8aa('0x11')]=function(){this[_0xc8aa('0x12')]=0x0;this['paused']=0x0;for(var _0x514cd5=0x0;_0x514cd5=0x0?this['available']:0x0;var _0x1170d3={'id':this['id'],'available':this[_0xc8aa('0x16')],'loggedIn':this[_0xc8aa('0x12')],'name':this['name'],'paused':this[_0xc8aa('0x15')],'waiting':this[_0xc8aa('0xd')]};var _0x3af97e=md5(JSON[_0xc8aa('0x17')](_0x1170d3));if(this['md5']!==_0x3af97e){this['md5']=_0x3af97e;io['to'](util['format'](_0xc8aa('0x18'),_0x1170d3[_0xc8aa('0x7')]))[_0xc8aa('0x19')]('mail_queue:save',_0x1170d3);}};module[_0xc8aa('0x1a')]=MailQueue; \ No newline at end of file +var _0x64f5=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','online','mailPause','paused','available','waiting','stringify','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x4c21ee,_0x217ce3){var _0x34e9dc=function(_0x282e39){while(--_0x282e39){_0x4c21ee['push'](_0x4c21ee['shift']());}};_0x34e9dc(++_0x217ce3);}(_0x64f5,0x9b));var _0x564f=function(_0x1579be,_0x4f5834){_0x1579be=_0x1579be-0x0;var _0x4f4837=_0x64f5[_0x1579be];return _0x4f4837;};'use strict';var _=require(_0x564f('0x0'));var md5=require(_0x564f('0x1'));var util=require(_0x564f('0x2'));var Redis=require(_0x564f('0x3'));var config=require(_0x564f('0x4'));config['redis']=_[_0x564f('0x5')](config[_0x564f('0x6')],{'host':_0x564f('0x7'),'port':0x18eb});var io=require(_0x564f('0x8'))(new Redis(config[_0x564f('0x6')]));function MailQueue(_0x4c9486){this['id']=_0x4c9486['id']||0x0;this[_0x564f('0x9')]=_0x4c9486[_0x564f('0x9')]||'';this[_0x564f('0xa')]=_0x4c9486[_0x564f('0xa')]||0xa;this[_0x564f('0xb')]=_0x4c9486[_0x564f('0xb')]||_0x564f('0xc');this[_0x564f('0xd')]=_0x4c9486['Agents'];this[_0x564f('0xe')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x564f('0xf')]();}MailQueue[_0x564f('0x10')][_0x564f('0x11')]=function(){var _0x5f3281=this[_0x564f('0xe')][_0x564f('0x12')];this[_0x564f('0xe')]=_[_0x564f('0x13')](this[_0x564f('0xd')],'id');this['mapAgentsId'][_0x564f('0x12')]=_0x5f3281;};MailQueue[_0x564f('0x10')][_0x564f('0xf')]=function(){this[_0x564f('0x14')]=0x0;this['paused']=0x0;for(var _0x53142a=0x0;_0x53142a=0x0?this[_0x564f('0x18')]:0x0;var _0x5b6e3b={'id':this['id'],'available':this[_0x564f('0x18')],'loggedIn':this[_0x564f('0x14')],'name':this[_0x564f('0x9')],'paused':this[_0x564f('0x17')],'waiting':this[_0x564f('0x19')]};var _0x4dbad9=md5(JSON[_0x564f('0x1a')](_0x5b6e3b));if(this[_0x564f('0x1')]!==_0x4dbad9){this[_0x564f('0x1')]=_0x4dbad9;io['to'](util['format'](_0x564f('0x1b'),_0x5b6e3b[_0x564f('0x9')]))[_0x564f('0x1c')](_0x564f('0x1d'),_0x5b6e3b);}};module[_0x564f('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b12cfec..9c30795 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x4911ed,_0x476941){var _0x230288=function(_0xcaa9c0){while(--_0xcaa9c0){_0x4911ed['push'](_0x4911ed['shift']());}};_0x230288(++_0x476941);}(_0xadb5,0xad));var _0x5adb=function(_0x100688,_0x923d4f){_0x100688=_0x100688-0x0;var _0x277202=_0xadb5[_0x100688];return _0x277202;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x1261,0x144));var _0x1126=function(_0x25e934,_0x4757dd){_0x25e934=_0x25e934-0x0;var _0x162c25=_0x1261[_0x25e934];return _0x162c25;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 8871a24..f499917 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 _0xd246=['redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','loggedIn','paused','online','available','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x51fe72,_0x52f007){var _0x7a332f=function(_0x2a14c0){while(--_0x2a14c0){_0x51fe72['push'](_0x51fe72['shift']());}};_0x7a332f(++_0x52f007);}(_0xd246,0xf5));var _0x6d24=function(_0x48347d,_0x31ee2a){_0x48347d=_0x48347d-0x0;var _0x110f3d=_0xd246[_0x48347d];return _0x110f3d;};'use strict';var _=require(_0x6d24('0x0'));var md5=require(_0x6d24('0x1'));var util=require(_0x6d24('0x2'));var Redis=require(_0x6d24('0x3'));var config=require(_0x6d24('0x4'));config[_0x6d24('0x5')]=_[_0x6d24('0x6')](config[_0x6d24('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x6d24('0x7'))(new Redis(config['redis']));function SmsQueue(_0x121e89){this['id']=_0x121e89['id']||0x0;this['name']=_0x121e89[_0x6d24('0x8')]||'';this[_0x6d24('0x9')]=_0x121e89[_0x6d24('0x9')]||0xa;this[_0x6d24('0xa')]=_0x121e89[_0x6d24('0xa')]||_0x6d24('0xb');this[_0x6d24('0xc')]=_0x121e89['Agents'];this['mapAgentsId']={};this[_0x6d24('0xd')]=0x0;this['md5']='';this[_0x6d24('0xe')]();this['updateRealtime']();}SmsQueue[_0x6d24('0xf')]['updateRouting']=function(){var _0x40811a=this[_0x6d24('0x10')]['_rr'];this[_0x6d24('0x10')]=_['map'](this[_0x6d24('0xc')],'id');this[_0x6d24('0x10')]['_rr']=_0x40811a;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x6d24('0x11')]=0x0;this[_0x6d24('0x12')]=0x0;for(var _0x2eb6a6=0x0;_0x2eb6a6=0x0?this[_0x6d24('0x14')]:0x0;var _0x49a269={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6d24('0x11')],'name':this[_0x6d24('0x8')],'paused':this[_0x6d24('0x12')],'waiting':this['waiting']};var _0x3c505e=md5(JSON[_0x6d24('0x15')](_0x49a269));if(this[_0x6d24('0x1')]!==_0x3c505e){this[_0x6d24('0x1')]=_0x3c505e;io['to'](util[_0x6d24('0x16')]('sms:queue:%s',_0x49a269[_0x6d24('0x8')]))[_0x6d24('0x17')]('sms_queue:save',_0x49a269);}};module[_0x6d24('0x18')]=SmsQueue; \ No newline at end of file +var _0xc577=['loggedIn','available','stringify','format','sms:queue:%s','emit','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','paused','length','online'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc577,0x172));var _0x7c57=function(_0x3727ae,_0x165f88){_0x3727ae=_0x3727ae-0x0;var _0x1c3f01=_0xc577[_0x3727ae];return _0x1c3f01;};'use strict';var _=require(_0x7c57('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x7c57('0x1'));var config=require(_0x7c57('0x2'));config[_0x7c57('0x3')]=_[_0x7c57('0x4')](config[_0x7c57('0x3')],{'host':_0x7c57('0x5'),'port':0x18eb});var io=require(_0x7c57('0x6'))(new Redis(config['redis']));function SmsQueue(_0x447d52){this['id']=_0x447d52['id']||0x0;this[_0x7c57('0x7')]=_0x447d52[_0x7c57('0x7')]||'';this[_0x7c57('0x8')]=_0x447d52[_0x7c57('0x8')]||0xa;this['strategy']=_0x447d52['strategy']||'beepall';this[_0x7c57('0x9')]=_0x447d52['Agents'];this[_0x7c57('0xa')]={};this[_0x7c57('0xb')]=0x0;this[_0x7c57('0xc')]='';this[_0x7c57('0xd')]();this['updateRealtime']();}SmsQueue[_0x7c57('0xe')][_0x7c57('0xd')]=function(){var _0x4b5b56=this[_0x7c57('0xa')][_0x7c57('0xf')];this[_0x7c57('0xa')]=_[_0x7c57('0x10')](this[_0x7c57('0x9')],'id');this[_0x7c57('0xa')][_0x7c57('0xf')]=_0x4b5b56;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x7c57('0x11')]=0x0;for(var _0x373a4b=0x0;_0x373a4b=0x0?this['available']:0x0;var _0x20dd80={'id':this['id'],'available':this[_0x7c57('0x15')],'loggedIn':this[_0x7c57('0x14')],'name':this[_0x7c57('0x7')],'paused':this[_0x7c57('0x11')],'waiting':this[_0x7c57('0xb')]};var _0x2931c4=md5(JSON[_0x7c57('0x16')](_0x20dd80));if(this[_0x7c57('0xc')]!==_0x2931c4){this['md5']=_0x2931c4;io['to'](util[_0x7c57('0x17')](_0x7c57('0x18'),_0x20dd80[_0x7c57('0x7')]))[_0x7c57('0x19')]('sms_queue:save',_0x20dd80);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 74a8fc3..edbed7f 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52bb=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','whatsappPause','available','md5','format','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x52bb,0x151));var _0xb52b=function(_0x2494d2,_0x5742b7){_0x2494d2=_0x2494d2-0x0;var _0x55408c=_0x52bb[_0x2494d2];return _0x55408c;};'use strict';var _=require(_0xb52b('0x0'));var md5=require('md5');var util=require(_0xb52b('0x1'));var Redis=require(_0xb52b('0x2'));var config=require(_0xb52b('0x3'));config[_0xb52b('0x4')]=_[_0xb52b('0x5')](config[_0xb52b('0x4')],{'host':_0xb52b('0x6'),'port':0x18eb});var io=require(_0xb52b('0x7'))(new Redis(config[_0xb52b('0x4')]));function WhatsappQueue(_0x3ff25b){this['id']=_0x3ff25b['id']||0x0;this['name']=_0x3ff25b[_0xb52b('0x8')]||'';this[_0xb52b('0x9')]=_0x3ff25b[_0xb52b('0x9')]||0xa;this[_0xb52b('0xa')]=_0x3ff25b[_0xb52b('0xa')]||_0xb52b('0xb');this[_0xb52b('0xc')]=_0x3ff25b[_0xb52b('0xc')];this[_0xb52b('0xd')]={};this[_0xb52b('0xe')]=0x0;this['md5']='';this[_0xb52b('0xf')]();this[_0xb52b('0x10')]();}WhatsappQueue['prototype'][_0xb52b('0xf')]=function(){var _0x32a763=this['mapAgentsId'][_0xb52b('0x11')];this['mapAgentsId']=_[_0xb52b('0x12')](this[_0xb52b('0xc')],'id');this[_0xb52b('0xd')]['_rr']=_0x32a763;};WhatsappQueue[_0xb52b('0x13')][_0xb52b('0x10')]=function(){this[_0xb52b('0x14')]=0x0;this[_0xb52b('0x15')]=0x0;for(var _0x4c320b=0x0;_0x4c320b=0x0?this[_0xb52b('0x18')]:0x0;var _0x362478={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb52b('0x14')],'name':this['name'],'paused':this[_0xb52b('0x15')],'waiting':this[_0xb52b('0xe')]};var _0x1977b0=md5(JSON['stringify'](_0x362478));if(this[_0xb52b('0x19')]!==_0x1977b0){this[_0xb52b('0x19')]=_0x1977b0;io['to'](util[_0xb52b('0x1a')]('whatsapp:queue:%s',_0x362478[_0xb52b('0x8')]))[_0xb52b('0x1b')]('whatsapp_queue:save',_0x362478);}};module[_0xb52b('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x5ff5=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ff5,0xfc));var _0x55ff=function(_0x14670c,_0x2b0a48){_0x14670c=_0x14670c-0x0;var _0x249c24=_0x5ff5[_0x14670c];return _0x249c24;};'use strict';var _=require('lodash');var md5=require(_0x55ff('0x0'));var util=require(_0x55ff('0x1'));var Redis=require(_0x55ff('0x2'));var config=require(_0x55ff('0x3'));config[_0x55ff('0x4')]=_[_0x55ff('0x5')](config[_0x55ff('0x4')],{'host':_0x55ff('0x6'),'port':0x18eb});var io=require(_0x55ff('0x7'))(new Redis(config[_0x55ff('0x4')]));function WhatsappQueue(_0x47091c){this['id']=_0x47091c['id']||0x0;this[_0x55ff('0x8')]=_0x47091c[_0x55ff('0x8')]||'';this[_0x55ff('0x9')]=_0x47091c[_0x55ff('0x9')]||0xa;this[_0x55ff('0xa')]=_0x47091c[_0x55ff('0xa')]||_0x55ff('0xb');this[_0x55ff('0xc')]=_0x47091c[_0x55ff('0xc')];this['mapAgentsId']={};this[_0x55ff('0xd')]=0x0;this[_0x55ff('0x0')]='';this[_0x55ff('0xe')]();this[_0x55ff('0xf')]();}WhatsappQueue[_0x55ff('0x10')][_0x55ff('0xe')]=function(){var _0x4fd83c=this[_0x55ff('0x11')][_0x55ff('0x12')];this[_0x55ff('0x11')]=_[_0x55ff('0x13')](this['Agents'],'id');this[_0x55ff('0x11')]['_rr']=_0x4fd83c;};WhatsappQueue[_0x55ff('0x10')][_0x55ff('0xf')]=function(){this[_0x55ff('0x14')]=0x0;this['paused']=0x0;for(var _0x1b1b39=0x0;_0x1b1b39=0x0?this[_0x55ff('0x19')]:0x0;var _0x426a17={'id':this['id'],'available':this[_0x55ff('0x19')],'loggedIn':this[_0x55ff('0x14')],'name':this[_0x55ff('0x8')],'paused':this[_0x55ff('0x18')],'waiting':this[_0x55ff('0xd')]};var _0x54580d=md5(JSON[_0x55ff('0x1a')](_0x426a17));if(this['md5']!==_0x54580d){this[_0x55ff('0x0')]=_0x54580d;io['to'](util[_0x55ff('0x1b')](_0x55ff('0x1c'),_0x426a17[_0x55ff('0x8')]))[_0x55ff('0x1d')](_0x55ff('0x1e'),_0x426a17);}};module[_0x55ff('0x1f')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 203acde..271a896 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2b9f64,_0x1dee7e){var _0x4b2efc=function(_0x4e5c77){while(--_0x4e5c77){_0x2b9f64['push'](_0x2b9f64['shift']());}};_0x4b2efc(++_0x1dee7e);}(_0xb10b,0x12a));var _0xbb10=function(_0x54f56c,_0x5ca2a6){_0x54f56c=_0x54f56c-0x0;var _0x3efaec=_0xb10b[_0x54f56c];return _0x3efaec;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x52d15b,_0x2a45e6){var _0xd90f09=function(_0x4aebd9){while(--_0x4aebd9){_0x52d15b['push'](_0x52d15b['shift']());}};_0xd90f09(++_0x2a45e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d6f29,_0x2f6366){_0x2d6f29=_0x2d6f29-0x0;var _0x291f5a=_0xb10b[_0x2d6f29];return _0x291f5a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 9ac2971..2d5175c 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 _0x12b8=['UpdateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x38a5f1,_0x178f70){var _0xcb1fbb=function(_0x314db2){while(--_0x314db2){_0x38a5f1['push'](_0x38a5f1['shift']());}};_0xcb1fbb(++_0x178f70);}(_0x12b8,0x14a));var _0x812b=function(_0x2de4e8,_0x3de149){_0x2de4e8=_0x2de4e8-0x0;var _0x261241=_0x12b8[_0x2de4e8];return _0x261241;};'use strict';var client=require('../client');exports['update']=function(_0x3fb8dd,_0x3940fa){return client['Request'](_0x812b('0x0'),{'body':_0x3940fa,'options':{'where':{'id':_0x3fb8dd}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x45c388,_0x54499d){return client[_0x812b('0x1')](_0x812b('0x2'),{'body':_0x54499d,'options':{'where':{'id':_0x45c388}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9233=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0x9233,0xec));var _0x3923=function(_0x243507,_0x466b9d){_0x243507=_0x243507-0x0;var _0x30d84f=_0x9233[_0x243507];return _0x30d84f;};'use strict';var client=require(_0x3923('0x0'));exports[_0x3923('0x1')]=function(_0x2048ec,_0x1de665){return client[_0x3923('0x2')](_0x3923('0x3'),{'body':_0x1de665,'options':{'where':{'id':_0x2048ec}},'log':_0x3923('0x4')});};exports[_0x3923('0x5')]=function(_0x5c2330,_0xc26b02){return client[_0x3923('0x2')](_0x3923('0x6'),{'body':_0xc26b02,'options':{'where':{'id':_0x5c2330}},'log':_0x3923('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d8365c6..b3d563a 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 _0xbfb9=['create','Request','CreateChatMessage'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0xbfb9,0xf6));var _0x9bfb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbfb9[_0x17d9e3];return _0x14192d;};'use strict';var client=require('../client');exports[_0x9bfb('0x0')]=function(_0x298263){return client[_0x9bfb('0x1')](_0x9bfb('0x2'),{'body':_0x298263,'log':'createChatMessage'});}; \ No newline at end of file +var _0x7072=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x7072,0xdb));var _0x2707=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x7072[_0x556bb1];return _0x45455f;};'use strict';var client=require(_0x2707('0x0'));exports[_0x2707('0x1')]=function(_0x3cbd36){return client['Request'](_0x2707('0x2'),{'body':_0x3cbd36,'log':_0x2707('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index a6f09c9..ef96d9d 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 _0xbd50=['Request','name','timeout','strategy','User','Agents','../client','getChatQueues'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0xbd50,0x196));var _0x0bd5=function(_0x575841,_0x333c2b){_0x575841=_0x575841-0x0;var _0x5d71a4=_0xbd50[_0x575841];return _0x5d71a4;};'use strict';var client=require(_0x0bd5('0x0'));exports[_0x0bd5('0x1')]=function(){return function(){return client[_0x0bd5('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0bd5('0x3'),_0x0bd5('0x4'),_0x0bd5('0x5')],'include':[{'model':_0x0bd5('0x6'),'as':_0x0bd5('0x7'),'attributes':['id','name','online','chatPause']}]},'log':_0x0bd5('0x1')});};}; \ No newline at end of file +var _0x1629=['timeout','Agents','name','../client','getChatQueues','Request','GetChatQueue'];(function(_0x901ce4,_0x225e6e){var _0x33c41d=function(_0xa94edb){while(--_0xa94edb){_0x901ce4['push'](_0x901ce4['shift']());}};_0x33c41d(++_0x225e6e);}(_0x1629,0x1d8));var _0x9162=function(_0x403a8a,_0x4b092d){_0x403a8a=_0x403a8a-0x0;var _0x2fa80a=_0x1629[_0x403a8a];return _0x2fa80a;};'use strict';var client=require(_0x9162('0x0'));exports[_0x9162('0x1')]=function(){return function(){return client[_0x9162('0x2')](_0x9162('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9162('0x4'),'strategy'],'include':[{'model':'User','as':_0x9162('0x5'),'attributes':['id',_0x9162('0x6'),'online','chatPause']}]},'log':_0x9162('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 629ed6f..9376e25 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 _0x9181=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0x9181,0x182));var _0x1918=function(_0x286aae,_0x2f7ac7){_0x286aae=_0x286aae-0x0;var _0x2386b7=_0x9181[_0x286aae];return _0x2386b7;};'use strict';var client=require(_0x1918('0x0'));exports[_0x1918('0x1')]=function(_0x13ad9b){return client[_0x1918('0x2')](_0x1918('0x3'),{'body':_0x13ad9b,'log':'CreateChatQueueReport'});};exports[_0x1918('0x4')]=function(_0x5c38a7,_0x32e178){return client[_0x1918('0x2')](_0x1918('0x5'),{'body':_0x32e178,'options':{'where':{'uniqueid':_0x5c38a7},'order':[['id',_0x1918('0x6')]],'limit':0x1},'log':_0x1918('0x5')});}; \ No newline at end of file +var _0x8135=['CreateChatQueueReport','update','UpdateChatQueueReport','create','Request'];(function(_0x36dee8,_0xc53ad){var _0x106c63=function(_0x28fbbb){while(--_0x28fbbb){_0x36dee8['push'](_0x36dee8['shift']());}};_0x106c63(++_0xc53ad);}(_0x8135,0x99));var _0x5813=function(_0x3cfaa3,_0x3e3c97){_0x3cfaa3=_0x3cfaa3-0x0;var _0x2cf66c=_0x8135[_0x3cfaa3];return _0x2cf66c;};'use strict';var client=require('../client');exports[_0x5813('0x0')]=function(_0x19e006){return client[_0x5813('0x1')](_0x5813('0x2'),{'body':_0x19e006,'log':'CreateChatQueueReport'});};exports[_0x5813('0x3')]=function(_0x196ea8,_0xf23c29){return client[_0x5813('0x1')](_0x5813('0x4'),{'body':_0xf23c29,'options':{'where':{'uniqueid':_0x196ea8},'order':[['id','DESC']],'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 4302caa..edd109e 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3ddf26,_0x15c898){var _0x32a6c3=function(_0x32e45f){while(--_0x32e45f){_0x3ddf26['push'](_0x3ddf26['shift']());}};_0x32a6c3(++_0x15c898);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x400322,_0x4353a8){var _0xfdd597=function(_0xd914b6){while(--_0xd914b6){_0x400322['push'](_0x400322['shift']());}};_0xfdd597(++_0x4353a8);}(_0x7a54,0x106));var _0x47a5=function(_0x61cbbf,_0x3819bb){_0x61cbbf=_0x61cbbf-0x0;var _0x1cd27f=_0x7a54[_0x61cbbf];return _0x1cd27f;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 14ffabf..4a21476 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 _0x1c7d=['CreateFaxMessage','../client','create','Request'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x1c7d,0x1f1));var _0xd1c7=function(_0xba96b0,_0x36e8f8){_0xba96b0=_0xba96b0-0x0;var _0xdad969=_0x1c7d[_0xba96b0];return _0xdad969;};'use strict';var client=require(_0xd1c7('0x0'));exports[_0xd1c7('0x1')]=function(_0x1f9fe6){return client[_0xd1c7('0x2')](_0xd1c7('0x3'),{'body':_0x1f9fe6,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x7b66=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x7b66,0x9e));var _0x67b6=function(_0x607526,_0x2ca073){_0x607526=_0x607526-0x0;var _0x383898=_0x7b66[_0x607526];return _0x383898;};'use strict';var client=require(_0x67b6('0x0'));exports[_0x67b6('0x1')]=function(_0x30ae59){return client[_0x67b6('0x2')](_0x67b6('0x3'),{'body':_0x30ae59,'log':_0x67b6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index cb358a3..9bc38af 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 _0x84b4=['timeout','strategy','User','online','faxPause','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x1443d5,_0x21f839){var _0x3f8e34=function(_0x5e1263){while(--_0x5e1263){_0x1443d5['push'](_0x1443d5['shift']());}};_0x3f8e34(++_0x21f839);}(_0x84b4,0xa7));var _0x484b=function(_0x21ad60,_0x181dd2){_0x21ad60=_0x21ad60-0x0;var _0x531c8e=_0x84b4[_0x21ad60];return _0x531c8e;};'use strict';var client=require(_0x484b('0x0'));exports[_0x484b('0x1')]=function(){return function(){return client['Request'](_0x484b('0x2'),{'options':{'raw':![],'attributes':['id',_0x484b('0x3'),_0x484b('0x4'),_0x484b('0x5')],'include':[{'model':_0x484b('0x6'),'as':'Agents','attributes':['id',_0x484b('0x3'),_0x484b('0x7'),_0x484b('0x8')]}]},'log':_0x484b('0x1')});};}; \ No newline at end of file +var _0x4503=['Request','GetFaxQueue','name','timeout','strategy','Agents','online','faxPause','../client','getFaxQueues'];(function(_0x3f1076,_0x23b6c1){var _0x21d34f=function(_0x3af4f4){while(--_0x3af4f4){_0x3f1076['push'](_0x3f1076['shift']());}};_0x21d34f(++_0x23b6c1);}(_0x4503,0x18e));var _0x3450=function(_0x58f827,_0x334ebc){_0x58f827=_0x58f827-0x0;var _0x21d5bc=_0x4503[_0x58f827];return _0x21d5bc;};'use strict';var client=require(_0x3450('0x0'));exports[_0x3450('0x1')]=function(){return function(){return client[_0x3450('0x2')](_0x3450('0x3'),{'options':{'raw':![],'attributes':['id',_0x3450('0x4'),_0x3450('0x5'),_0x3450('0x6')],'include':[{'model':'User','as':_0x3450('0x7'),'attributes':['id',_0x3450('0x4'),_0x3450('0x8'),_0x3450('0x9')]}]},'log':_0x3450('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9900d4d..27b1a5d 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 _0x0a38=['DESC','../client','Request','update','UpdateFaxQueueReport'];(function(_0x17c62e,_0x496df1){var _0x6d9780=function(_0x44653d){while(--_0x44653d){_0x17c62e['push'](_0x17c62e['shift']());}};_0x6d9780(++_0x496df1);}(_0x0a38,0x83));var _0x80a3=function(_0x10a827,_0x381036){_0x10a827=_0x10a827-0x0;var _0x28803a=_0x0a38[_0x10a827];return _0x28803a;};'use strict';var client=require(_0x80a3('0x0'));exports['create']=function(_0x19eaa1){return client[_0x80a3('0x1')]('CreateFaxQueueReport',{'body':_0x19eaa1,'log':'CreateFaxQueueReport'});};exports[_0x80a3('0x2')]=function(_0x19a959,_0x93dbf0){return client[_0x80a3('0x1')](_0x80a3('0x3'),{'body':_0x93dbf0,'options':{'where':{'uniqueid':_0x19a959},'order':[['id',_0x80a3('0x4')]],'limit':0x1},'log':_0x80a3('0x3')});}; \ No newline at end of file +var _0x5590=['../client','create','Request','CreateFaxQueueReport','DESC','UpdateFaxQueueReport'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x5590,0x11a));var _0x0559=function(_0x336356,_0x3bb360){_0x336356=_0x336356-0x0;var _0x4476bd=_0x5590[_0x336356];return _0x4476bd;};'use strict';var client=require(_0x0559('0x0'));exports[_0x0559('0x1')]=function(_0x7e2006){return client[_0x0559('0x2')](_0x0559('0x3'),{'body':_0x7e2006,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x340b32,_0x421168){return client['Request']('UpdateFaxQueueReport',{'body':_0x421168,'options':{'where':{'uniqueid':_0x340b32},'order':[['id',_0x0559('0x4')]],'limit':0x1},'log':_0x0559('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 5172ad1..ee7e42c 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 _0x0021=['name','Intervals','getIntervals','Request','GetInterval'];(function(_0x4c6bca,_0x3de390){var _0x29d58e=function(_0x1ac871){while(--_0x1ac871){_0x4c6bca['push'](_0x4c6bca['shift']());}};_0x29d58e(++_0x3de390);}(_0x0021,0x13e));var _0x1002=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0x0021[_0x5cabfd];return _0x4bc06c;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x1002('0x0')](_0x1002('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1002('0x2')],'include':[{'model':'Interval','as':_0x1002('0x3'),'attributes':['id','name','interval']}]},'log':_0x1002('0x4')});};}; \ No newline at end of file +var _0xe582=['Request','GetInterval','Interval','name','interval','../client','getIntervals'];(function(_0x15482e,_0x25b23c){var _0x4a0651=function(_0x5afab4){while(--_0x5afab4){_0x15482e['push'](_0x15482e['shift']());}};_0x4a0651(++_0x25b23c);}(_0xe582,0x9f));var _0x2e58=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0xe582[_0x12309b];return _0x482e4d;};'use strict';var client=require(_0x2e58('0x0'));exports[_0x2e58('0x1')]=function(){return function(){return client[_0x2e58('0x2')](_0x2e58('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x2e58('0x4'),'as':'Intervals','attributes':['id',_0x2e58('0x5'),_0x2e58('0x6')]}]},'log':_0x2e58('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 0e64975..773f0a8 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 _0xc2c7=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x172eb5,_0x2a5111){var _0x1ea8b2=function(_0x272943){while(--_0x272943){_0x172eb5['push'](_0x172eb5['shift']());}};_0x1ea8b2(++_0x2a5111);}(_0xc2c7,0x134));var _0x7c2c=function(_0x261497,_0xae4c75){_0x261497=_0x261497-0x0;var _0x366788=_0xc2c7[_0x261497];return _0x366788;};'use strict';var client=require('../client');exports[_0x7c2c('0x0')]=function(_0x30ed31,_0xdb8a29){return client[_0x7c2c('0x1')](_0x7c2c('0x2'),{'body':_0xdb8a29,'options':{'where':{'id':_0x30ed31}},'log':_0x7c2c('0x3')});};exports[_0x7c2c('0x4')]=function(_0x116f8a,_0x4bbc14){return client['Request'](_0x7c2c('0x5'),{'body':_0x4bbc14,'options':{'where':{'id':_0x116f8a}},'log':_0x7c2c('0x6')});}; \ No newline at end of file +var _0x6d38=['updateMailInteraction','Request','addTagsToChatInteraction','update'];(function(_0x190dbd,_0x24a507){var _0x868d27=function(_0x253c6f){while(--_0x253c6f){_0x190dbd['push'](_0x190dbd['shift']());}};_0x868d27(++_0x24a507);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'use strict';var client=require('../client');exports[_0x86d3('0x0')]=function(_0x4c9c06,_0x3db243){return client['Request']('UpdateMailInteraction',{'body':_0x3db243,'options':{'where':{'id':_0x4c9c06}},'log':_0x86d3('0x1')});};exports['addTags']=function(_0xe9198a,_0x455b9d){return client[_0x86d3('0x2')]('AddTagsToMailInteraction',{'body':_0x455b9d,'options':{'where':{'id':_0xe9198a}},'log':_0x86d3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index bb5f64e..0ec5870 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 _0x324e=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x500b9a,_0x7f4070){var _0x23193f=function(_0x787ef9){while(--_0x787ef9){_0x500b9a['push'](_0x500b9a['shift']());}};_0x23193f(++_0x7f4070);}(_0x324e,0xf6));var _0xe324=function(_0x5a54f7,_0x465450){_0x5a54f7=_0x5a54f7-0x0;var _0x26236a=_0x324e[_0x5a54f7];return _0x26236a;};'use strict';var client=require(_0xe324('0x0'));exports[_0xe324('0x1')]=function(_0x43c4c1){return client[_0xe324('0x2')](_0xe324('0x3'),{'body':_0x43c4c1,'log':_0xe324('0x4')});}; \ No newline at end of file +var _0x2e75=['Request'];(function(_0x56ccd2,_0x1fbef1){var _0x341819=function(_0x5b0bc1){while(--_0x5b0bc1){_0x56ccd2['push'](_0x56ccd2['shift']());}};_0x341819(++_0x1fbef1);}(_0x2e75,0xb5));var _0x52e7=function(_0x292c27,_0x1037b1){_0x292c27=_0x292c27-0x0;var _0x161623=_0x2e75[_0x292c27];return _0x161623;};'use strict';var client=require('../client');exports['create']=function(_0x1a6013){return client[_0x52e7('0x0')]('CreateMailMessage',{'body':_0x1a6013,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 76b0bf7..ef88cad 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 _0x4c9d=['User','Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy'];(function(_0x108d95,_0x3e8e58){var _0x3963e3=function(_0x15edc6){while(--_0x15edc6){_0x108d95['push'](_0x108d95['shift']());}};_0x3963e3(++_0x3e8e58);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c9d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd4c9('0x0'));exports[_0xd4c9('0x1')]=function(){return function(){return client[_0xd4c9('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd4c9('0x3'),_0xd4c9('0x4'),_0xd4c9('0x5')],'include':[{'model':_0xd4c9('0x6'),'as':_0xd4c9('0x7'),'attributes':['id',_0xd4c9('0x3'),_0xd4c9('0x8'),_0xd4c9('0x9')]}]},'log':_0xd4c9('0x1')});};}; \ No newline at end of file +var _0x5ceb=['GetMailQueue','name','timeout','User','Agents','online','mailPause','getMailQueues','../client'];(function(_0xb245b6,_0x115394){var _0x5938dc=function(_0x5cba76){while(--_0x5cba76){_0xb245b6['push'](_0xb245b6['shift']());}};_0x5938dc(++_0x115394);}(_0x5ceb,0x1d3));var _0xb5ce=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x5ceb[_0x1762b4];return _0x29beda;};'use strict';var client=require(_0xb5ce('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0xb5ce('0x1'),{'options':{'raw':![],'attributes':['id',_0xb5ce('0x2'),_0xb5ce('0x3'),'strategy'],'include':[{'model':_0xb5ce('0x4'),'as':_0xb5ce('0x5'),'attributes':['id',_0xb5ce('0x2'),_0xb5ce('0x6'),_0xb5ce('0x7')]}]},'log':_0xb5ce('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e9f3b23..7c86f58 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 _0x3576=['CreateMailQueueReport','update','Request','DESC','UpdateMailQueueReport','../client','create'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x3576,0x1c5));var _0x6357=function(_0x2d456f,_0x1cf7f0){_0x2d456f=_0x2d456f-0x0;var _0xa91ecd=_0x3576[_0x2d456f];return _0xa91ecd;};'use strict';var client=require(_0x6357('0x0'));exports[_0x6357('0x1')]=function(_0x4dcbb8){return client['Request']('CreateMailQueueReport',{'body':_0x4dcbb8,'log':_0x6357('0x2')});};exports[_0x6357('0x3')]=function(_0x40f402,_0x2b95e4){return client[_0x6357('0x4')]('UpdateMailQueueReport',{'body':_0x2b95e4,'options':{'where':{'uniqueid':_0x40f402},'order':[['id',_0x6357('0x5')]],'limit':0x1},'log':_0x6357('0x6')});}; \ No newline at end of file +var _0xf56e=['DESC','../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x5a671f,_0x4b1d7c){var _0x3454ac=function(_0x195478){while(--_0x195478){_0x5a671f['push'](_0x5a671f['shift']());}};_0x3454ac(++_0x4b1d7c);}(_0xf56e,0x175));var _0xef56=function(_0x40542f,_0x9c86f7){_0x40542f=_0x40542f-0x0;var _0x3b961f=_0xf56e[_0x40542f];return _0x3b961f;};'use strict';var client=require(_0xef56('0x0'));exports[_0xef56('0x1')]=function(_0x228032){return client[_0xef56('0x2')]('CreateMailQueueReport',{'body':_0x228032,'log':_0xef56('0x3')});};exports['update']=function(_0x315772,_0x15e76b){return client[_0xef56('0x2')](_0xef56('0x4'),{'body':_0x15e76b,'options':{'where':{'uniqueid':_0x315772},'order':[['id',_0xef56('0x5')]],'limit':0x1},'log':_0xef56('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 80ba4b0..c74d8a6 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 _0xaa31=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x1ea632,_0x1ce3db){var _0x30ad29=function(_0x4d9390){while(--_0x4d9390){_0x1ea632['push'](_0x1ea632['shift']());}};_0x30ad29(++_0x1ce3db);}(_0xaa31,0x1d5));var _0x1aa3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xaa31[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0x1aa3('0x0'));exports[_0x1aa3('0x1')]=function(_0x2e534d,_0x720150){return client[_0x1aa3('0x2')](_0x1aa3('0x3'),{'body':_0x720150,'options':{'where':{'id':_0x2e534d}},'log':_0x1aa3('0x4')});};exports[_0x1aa3('0x5')]=function(_0x584f86,_0xf4c08e){return client[_0x1aa3('0x2')](_0x1aa3('0x6'),{'body':_0xf4c08e,'options':{'where':{'id':_0x584f86}},'log':_0x1aa3('0x7')});}; \ No newline at end of file +var _0x1fca=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x36b7e7,_0xe5ed94){var _0x2cca0d=function(_0x1ba4ec){while(--_0x1ba4ec){_0x36b7e7['push'](_0x36b7e7['shift']());}};_0x2cca0d(++_0xe5ed94);}(_0x1fca,0x1ba));var _0xa1fc=function(_0x1999d0,_0x4990ae){_0x1999d0=_0x1999d0-0x0;var _0x32dfaf=_0x1fca[_0x1999d0];return _0x32dfaf;};'use strict';var client=require(_0xa1fc('0x0'));exports[_0xa1fc('0x1')]=function(_0x56baaa,_0x3cd6ba){return client[_0xa1fc('0x2')](_0xa1fc('0x3'),{'body':_0x3cd6ba,'options':{'where':{'id':_0x56baaa}},'log':_0xa1fc('0x4')});};exports[_0xa1fc('0x5')]=function(_0x2dff3c,_0x13cd15){return client[_0xa1fc('0x2')](_0xa1fc('0x6'),{'body':_0x13cd15,'options':{'where':{'id':_0x2dff3c}},'log':_0xa1fc('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a628dc5..45702e4 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 _0xabda=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5d59c0,_0x39fa5e){var _0x130443=function(_0x10d928){while(--_0x10d928){_0x5d59c0['push'](_0x5d59c0['shift']());}};_0x130443(++_0x39fa5e);}(_0xabda,0x1bb));var _0xaabd=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xabda[_0x5416db];return _0x243e35;};'use strict';var client=require(_0xaabd('0x0'));exports[_0xaabd('0x1')]=function(_0x40ff78){return client['Request'](_0xaabd('0x2'),{'body':_0x40ff78,'log':_0xaabd('0x3')});}; \ No newline at end of file +var _0xae3f=['../client','CreateOpenchannelMessage'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xae3f,0x180));var _0xfae3=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xae3f[_0x19b3f9];return _0x18c3f6;};'use strict';var client=require(_0xfae3('0x0'));exports['create']=function(_0x54451a){return client['Request'](_0xfae3('0x1'),{'body':_0x54451a,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 348801a..d1c4adc 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 _0xb54a=['online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','Agents','name'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xb54a,0x1af));var _0xab54=function(_0x367149,_0x3c1f29){_0x367149=_0x367149-0x0;var _0x258117=_0xb54a[_0x367149];return _0x258117;};'use strict';var client=require(_0xab54('0x0'));exports[_0xab54('0x1')]=function(){return function(){return client[_0xab54('0x2')](_0xab54('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xab54('0x4'),_0xab54('0x5')],'include':[{'model':_0xab54('0x6'),'as':_0xab54('0x7'),'attributes':['id',_0xab54('0x8'),_0xab54('0x9'),_0xab54('0xa')]}]},'log':_0xab54('0x1')});};}; \ No newline at end of file +var _0x7980=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','Agents','online'];(function(_0x281166,_0x4358e0){var _0x185a94=function(_0x59fae5){while(--_0x59fae5){_0x281166['push'](_0x281166['shift']());}};_0x185a94(++_0x4358e0);}(_0x7980,0xab));var _0x0798=function(_0x102f8c,_0x217317){_0x102f8c=_0x102f8c-0x0;var _0x2bc55f=_0x7980[_0x102f8c];return _0x2bc55f;};'use strict';var client=require(_0x0798('0x0'));exports[_0x0798('0x1')]=function(){return function(){return client[_0x0798('0x2')](_0x0798('0x3'),{'options':{'raw':![],'attributes':['id',_0x0798('0x4'),'timeout',_0x0798('0x5')],'include':[{'model':_0x0798('0x6'),'as':_0x0798('0x7'),'attributes':['id',_0x0798('0x4'),_0x0798('0x8'),'openchannelPause']}]},'log':_0x0798('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4dc7cf6..d8dc7d6 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 _0x85de=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','create'];(function(_0x10e1d9,_0x973af7){var _0x2c0c87=function(_0x502d8b){while(--_0x502d8b){_0x10e1d9['push'](_0x10e1d9['shift']());}};_0x2c0c87(++_0x973af7);}(_0x85de,0x1f0));var _0xe85d=function(_0xcd5ff6,_0xafb336){_0xcd5ff6=_0xcd5ff6-0x0;var _0x55f6b1=_0x85de[_0xcd5ff6];return _0x55f6b1;};'use strict';var client=require(_0xe85d('0x0'));exports[_0xe85d('0x1')]=function(_0x4280d5){return client[_0xe85d('0x2')](_0xe85d('0x3'),{'body':_0x4280d5,'log':'CreateOpenchannelQueueReport'});};exports[_0xe85d('0x4')]=function(_0x559802,_0x4d2fcf){return client[_0xe85d('0x2')](_0xe85d('0x5'),{'body':_0x4d2fcf,'options':{'where':{'uniqueid':_0x559802},'order':[['id','DESC']],'limit':0x1},'log':_0xe85d('0x5')});}; \ No newline at end of file +var _0x05b1=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x2e33be,_0x104a6c){var _0x1cd3c7=function(_0x72efbf){while(--_0x72efbf){_0x2e33be['push'](_0x2e33be['shift']());}};_0x1cd3c7(++_0x104a6c);}(_0x05b1,0x188));var _0x105b=function(_0xf9cdf9,_0x1b8ef){_0xf9cdf9=_0xf9cdf9-0x0;var _0x19e392=_0x05b1[_0xf9cdf9];return _0x19e392;};'use strict';var client=require('../client');exports['create']=function(_0x1dac9f){return client[_0x105b('0x0')]('CreateOpenchannelQueueReport',{'body':_0x1dac9f,'log':_0x105b('0x1')});};exports['update']=function(_0x3c93d2,_0xc42a09){return client[_0x105b('0x0')](_0x105b('0x2'),{'body':_0xc42a09,'options':{'where':{'uniqueid':_0x3c93d2},'order':[['id',_0x105b('0x3')]],'limit':0x1},'log':_0x105b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 3911913..a2fc5e6 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 _0xd246=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xd246,0xf5));var _0x6d24=function(_0x249d7c,_0x17163a){_0x249d7c=_0x249d7c-0x0;var _0x20f24b=_0xd246[_0x249d7c];return _0x20f24b;};'use strict';var client=require(_0x6d24('0x0'));exports[_0x6d24('0x1')]=function(_0x5d81c8,_0x30e20a){return client[_0x6d24('0x2')](_0x6d24('0x3'),{'body':_0x30e20a,'options':{'where':{'id':_0x5d81c8}},'log':_0x6d24('0x4')});};exports[_0x6d24('0x5')]=function(_0x4e76e1,_0xfa68f3){return client['Request'](_0x6d24('0x6'),{'body':_0xfa68f3,'options':{'where':{'id':_0x4e76e1}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x92bc=['UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0x92bc,0x106));var _0xc92b=function(_0x5d7c79,_0x2fada3){_0x5d7c79=_0x5d7c79-0x0;var _0x4055fe=_0x92bc[_0x5d7c79];return _0x4055fe;};'use strict';var client=require(_0xc92b('0x0'));exports[_0xc92b('0x1')]=function(_0x461b83,_0x585f71){return client['Request'](_0xc92b('0x2'),{'body':_0x585f71,'options':{'where':{'id':_0x461b83}},'log':_0xc92b('0x3')});};exports[_0xc92b('0x4')]=function(_0x1d7812,_0x56c979){return client[_0xc92b('0x5')](_0xc92b('0x6'),{'body':_0x56c979,'options':{'where':{'id':_0x1d7812}},'log':_0xc92b('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 190c371..2336856 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 _0x3d6f=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x263a93,_0x446811){var _0x47024=function(_0x3558d9){while(--_0x3558d9){_0x263a93['push'](_0x263a93['shift']());}};_0x47024(++_0x446811);}(_0x3d6f,0x189));var _0xf3d6=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0x3d6f[_0x257495];return _0x3849aa;};'use strict';var client=require('../client');exports[_0xf3d6('0x0')]=function(_0x27cfb3){return client[_0xf3d6('0x1')](_0xf3d6('0x2'),{'body':_0x27cfb3,'log':_0xf3d6('0x3')});}; \ No newline at end of file +var _0x0823=['../client','create','Request','CreateSmsMessage'];(function(_0x5df780,_0x3460c8){var _0x535f5b=function(_0x505237){while(--_0x505237){_0x5df780['push'](_0x5df780['shift']());}};_0x535f5b(++_0x3460c8);}(_0x0823,0x120));var _0x3082=function(_0x657e65,_0x307cb8){_0x657e65=_0x657e65-0x0;var _0x24c8ea=_0x0823[_0x657e65];return _0x24c8ea;};'use strict';var client=require(_0x3082('0x0'));exports[_0x3082('0x1')]=function(_0x3d61e4){return client[_0x3082('0x2')](_0x3082('0x3'),{'body':_0x3d61e4,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 329cc8b..8870425 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x1b4e19,_0xeddaa4){var _0x532d75=function(_0xf8c6ac){while(--_0xf8c6ac){_0x1b4e19['push'](_0x1b4e19['shift']());}};_0x532d75(++_0xeddaa4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x33eff6,_0xe0d121){var _0xea0af6=function(_0x14a30b){while(--_0x14a30b){_0x33eff6['push'](_0x33eff6['shift']());}};_0xea0af6(++_0xe0d121);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xb7e7[_0x9cd4c3];return _0x4c9025;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'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 df7b48a..653c573 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x4d8de6,_0x4a37a4){var _0x488378=function(_0x5630f4){while(--_0x5630f4){_0x4d8de6['push'](_0x4d8de6['shift']());}};_0x488378(++_0x4a37a4);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x3638d3,_0x445d09){var _0x50802a=function(_0x5bfac7){while(--_0x5bfac7){_0x3638d3['push'](_0x3638d3['shift']());}};_0x50802a(++_0x445d09);}(_0x70e0,0x17b));var _0x070e=function(_0x1c2859,_0x465686){_0x1c2859=_0x1c2859-0x0;var _0x7c6a50=_0x70e0[_0x1c2859];return _0x7c6a50;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index f1a5b82..72eff2b 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0xd775f2,_0x5d570c){var _0x47757a=function(_0x51d563){while(--_0x51d563){_0xd775f2['push'](_0xd775f2['shift']());}};_0x47757a(++_0x5d570c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x367b8c,_0x97ccd3){var _0x51f8fd=function(_0x3a3bf5){while(--_0x3a3bf5){_0x367b8c['push'](_0x367b8c['shift']());}};_0x51f8fd(++_0x97ccd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index bd27430..976f1ab 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b47=['addTags','Request','AddTagsToWhatsappInteraction','../client','update'];(function(_0x41d5d5,_0x9867db){var _0x2142d3=function(_0x13bc9a){while(--_0x13bc9a){_0x41d5d5['push'](_0x41d5d5['shift']());}};_0x2142d3(++_0x9867db);}(_0x5b47,0x120));var _0x75b4=function(_0x2363d7,_0x11a9dd){_0x2363d7=_0x2363d7-0x0;var _0x5affe2=_0x5b47[_0x2363d7];return _0x5affe2;};'use strict';var client=require(_0x75b4('0x0'));exports[_0x75b4('0x1')]=function(_0x5ee71e,_0x5c0b0c){return client['Request']('UpdateWhatsappInteraction',{'body':_0x5c0b0c,'options':{'where':{'id':_0x5ee71e}},'log':'updateWhatsappInteraction'});};exports[_0x75b4('0x2')]=function(_0x42359f,_0x37497c){return client[_0x75b4('0x3')](_0x75b4('0x4'),{'body':_0x37497c,'options':{'where':{'id':_0x42359f}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x46ed=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x46ed,0x168));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0xd46e('0x0'));exports[_0xd46e('0x1')]=function(_0x493012,_0x392bc1){return client[_0xd46e('0x2')](_0xd46e('0x3'),{'body':_0x392bc1,'options':{'where':{'id':_0x493012}},'log':'updateWhatsappInteraction'});};exports[_0xd46e('0x4')]=function(_0x4518b8,_0x54ef98){return client[_0xd46e('0x2')](_0xd46e('0x5'),{'body':_0x54ef98,'options':{'where':{'id':_0x4518b8}},'log':_0xd46e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 09a3eb4..64eb961 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c4=['CreateWhatsappMessage','../client','create','Request'];(function(_0x59cd25,_0x55b586){var _0x1efadf=function(_0x4b66dc){while(--_0x4b66dc){_0x59cd25['push'](_0x59cd25['shift']());}};_0x1efadf(++_0x55b586);}(_0x34c4,0xf9));var _0x434c=function(_0x33356f,_0x1f9f3e){_0x33356f=_0x33356f-0x0;var _0x4177fa=_0x34c4[_0x33356f];return _0x4177fa;};'use strict';var client=require(_0x434c('0x0'));exports[_0x434c('0x1')]=function(_0x4aacce){return client[_0x434c('0x2')](_0x434c('0x3'),{'body':_0x4aacce,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xb891=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x37790c,_0x5bcf91){var _0x2408e2=function(_0x2903b1){while(--_0x2903b1){_0x37790c['push'](_0x37790c['shift']());}};_0x2408e2(++_0x5bcf91);}(_0xb891,0x93));var _0x1b89=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0xb891[_0x2c753c];return _0x23ba20;};'use strict';var client=require(_0x1b89('0x0'));exports[_0x1b89('0x1')]=function(_0x1eba62){return client[_0x1b89('0x2')](_0x1b89('0x3'),{'body':_0x1eba62,'log':_0x1b89('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index c999753..8c27f7b 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa037=['timeout','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','name'];(function(_0xee122e,_0x58ef2e){var _0x34f98a=function(_0x18163e){while(--_0x18163e){_0xee122e['push'](_0xee122e['shift']());}};_0x34f98a(++_0x58ef2e);}(_0xa037,0x8c));var _0x7a03=function(_0x36c040,_0x4dfcc8){_0x36c040=_0x36c040-0x0;var _0xde81b1=_0xa037[_0x36c040];return _0xde81b1;};'use strict';var client=require(_0x7a03('0x0'));exports[_0x7a03('0x1')]=function(){return function(){return client[_0x7a03('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x7a03('0x3'),_0x7a03('0x4'),'strategy'],'include':[{'model':'User','as':_0x7a03('0x5'),'attributes':['id',_0x7a03('0x3'),_0x7a03('0x6'),_0x7a03('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xa4d8=['name','online','whatsappPause','Request','GetWhatsappQueue','timeout','User','Agents'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa4d8,0x1bb));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x8a4d('0x0')](_0x8a4d('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8a4d('0x2'),'strategy'],'include':[{'model':_0x8a4d('0x3'),'as':_0x8a4d('0x4'),'attributes':['id',_0x8a4d('0x5'),_0x8a4d('0x6'),_0x8a4d('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 820b95a..06ca7a7 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd323=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd323,0x1ad));var _0x3d32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd323[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x3d32('0x0'));exports[_0x3d32('0x1')]=function(_0x477562){return client[_0x3d32('0x2')](_0x3d32('0x3'),{'body':_0x477562,'log':_0x3d32('0x3')});};exports[_0x3d32('0x4')]=function(_0x59c2a3,_0x33f204){return client[_0x3d32('0x2')](_0x3d32('0x5'),{'body':_0x33f204,'options':{'where':{'uniqueid':_0x59c2a3},'order':[['id',_0x3d32('0x6')]],'limit':0x1},'log':_0x3d32('0x5')});}; \ No newline at end of file +var _0x7d99=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x1c10e2,_0x39a875){var _0x2c1d29=function(_0x4b596a){while(--_0x4b596a){_0x1c10e2['push'](_0x1c10e2['shift']());}};_0x2c1d29(++_0x39a875);}(_0x7d99,0x7f));var _0x97d9=function(_0x1faa2c,_0xe8257b){_0x1faa2c=_0x1faa2c-0x0;var _0x1d55db=_0x7d99[_0x1faa2c];return _0x1d55db;};'use strict';var client=require(_0x97d9('0x0'));exports[_0x97d9('0x1')]=function(_0xadbb4b){return client[_0x97d9('0x2')]('CreateWhatsappQueueReport',{'body':_0xadbb4b,'log':_0x97d9('0x3')});};exports[_0x97d9('0x4')]=function(_0x1edeea,_0x501e2b){return client[_0x97d9('0x2')](_0x97d9('0x5'),{'body':_0x501e2b,'options':{'where':{'uniqueid':_0x1edeea},'order':[['id',_0x97d9('0x6')]],'limit':0x1},'log':_0x97d9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index fbb6aba..1a9a266 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 _0x585a=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','close','next','agent','[%s][QUEUE]\x20%s','stack','validate','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info'];(function(_0x2f8137,_0x3690e0){var _0x3fb982=function(_0xcf17c6){while(--_0xcf17c6){_0x2f8137['push'](_0x2f8137['shift']());}};_0x3fb982(++_0x3690e0);}(_0x585a,0xf2));var _0xa585=function(_0x1f3890,_0x2f9aad){_0x1f3890=_0x1f3890-0x0;var _0x4af351=_0x585a[_0x1f3890];return _0x4af351;};'use strict';var schema=require(_0xa585('0x0'));var _=require('lodash');var util=require(_0xa585('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xa585('0x2'))(_0xa585('0x3'));var strategy=require(_0xa585('0x4'));var queue=schema({'name':{'type':_0xa585('0x5'),'required':!![],'message':_0xa585('0x6')},'timeout':{'type':_0xa585('0x7'),'message':_0xa585('0x8')}});function writeLog(_0x4c7923,_0x36cad1,_0x3ad396){return logger[_0xa585('0x9')](util[_0xa585('0xa')](_0xa585('0xb'),_0x4c7923,_0x36cad1[_0xa585('0xc')],_0x3ad396));}function handleFindAgent(_0xc98be4){return function(_0x4de4a4){return _0x4de4a4['name'][_0xa585('0xd')]()===_0xc98be4[_0xa585('0xd')]();};}exports[_0xa585('0xe')]=function(_0x35140c,_0x49e237,_0x39f854,_0x1c4bc7){return function(_0x4cb32a){try{var _0x3ec72e={'name':_0x49e237[0x0],'timeout':_0x49e237[0x1]};var _0x13c054=queue[_0xa585('0x0')](_0x3ec72e,{'typecast':!![]});if(_0x13c054['length']){logger[_0xa585('0xf')](_0xa585('0x10'),_0x35140c,_[_0xa585('0x11')](_0x13c054,_0xa585('0x12'))[_0xa585('0x13')](',\x20'));_0x4cb32a['stop']();}else{var _0x5b45e5=_[_0xa585('0x14')](_0x39f854[_0xa585('0x15')],handleFindAgent(_0x3ec72e[_0xa585('0xc')]));if(_0x5b45e5){var _0x563228=(_0x3ec72e[_0xa585('0x16')]||0xa)*0x3e8;var _0x3720b0,_0x117e7a;var _0x3839c8=seqqueue[_0xa585('0x17')](_0x563228);_0x3839c8['id']=_0x35140c;_0x3839c8[_0xa585('0x18')]=_0x563228;_0x3839c8['channel']=_0x1c4bc7['channel'];writeLog(_0x35140c,_0x5b45e5,util['format'](_0xa585('0x19'),_0x563228));_0x39f854[_0xa585('0x1a')][_0x35140c]['on'](_0xa585('0x1b'),function(){logger[_0xa585('0x9')](_0xa585('0x1c'),_0x35140c);clearTimeout(_0x117e7a);_0x117e7a=undefined;_0x3839c8['close']();if(_0x39f854[_0xa585('0x1a')][_0x35140c]){delete _0x39f854[_0xa585('0x1a')][_0x35140c];}_0x4cb32a[_0xa585('0x1d')]();});_0x39f854[_0xa585('0x1a')][_0x35140c]['on'](_0xa585('0x1e'),function(){if(_0x39f854[_0xa585('0x1a')][_0x35140c]){delete _0x39f854[_0xa585('0x1a')][_0x35140c];}});_0x117e7a=setTimeout(function(){logger[_0xa585('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x35140c);clearTimeout(_0x117e7a);_0x3839c8[_0xa585('0x1f')]();_0x4cb32a[_0xa585('0x20')]();},_0x563228);strategy[_0xa585('0x21')](_0x3839c8,_0x5b45e5,_0x39f854,_0x1c4bc7);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x35140c,_0x3ec72e[_0xa585('0xc')]);_0x4cb32a[_0xa585('0x1d')]();}}}catch(_0xcbd482){console['log'](_0xcbd482);logger[_0xa585('0xf')](_0xa585('0x22'),_0x35140c,_0xcbd482[_0xa585('0x23')]);_0x4cb32a[_0xa585('0x1d')]();}};}; \ No newline at end of file +var _0x1ced=['routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','stop','find','agents','timeout','atimeout','channel','rules','end','info','close','complete','[%s][AGENT]\x20ROUTING\x20END','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue'];(function(_0x2478df,_0x4f96ed){var _0x396975=function(_0x1497bb){while(--_0x1497bb){_0x2478df['push'](_0x2478df['shift']());}};_0x396975(++_0x4f96ed);}(_0x1ced,0x10c));var _0xd1ce=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x1ced[_0x1be3b3];return _0x4f8b2d;};'use strict';var schema=require(_0xd1ce('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xd1ce('0x1'));var logger=require('../../../../config/logger')(_0xd1ce('0x2'));var strategy=require(_0xd1ce('0x3'));var queue=schema({'name':{'type':_0xd1ce('0x4'),'required':!![],'message':_0xd1ce('0x5')},'timeout':{'type':_0xd1ce('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3c3b9f,_0x1920ee,_0x5173b8){return logger['info'](util[_0xd1ce('0x7')](_0xd1ce('0x8'),_0x3c3b9f,_0x1920ee[_0xd1ce('0x9')],_0x5173b8));}function handleFindAgent(_0x1eee09){return function(_0xad4c36){return _0xad4c36[_0xd1ce('0x9')][_0xd1ce('0xa')]()===_0x1eee09[_0xd1ce('0xa')]();};}exports['consequence']=function(_0x1655d8,_0x492458,_0x218223,_0xa3c8c8){return function(_0x17d4a8){try{var _0x1cfd7d={'name':_0x492458[0x0],'timeout':_0x492458[0x1]};var _0x21d51d=queue[_0xd1ce('0x0')](_0x1cfd7d,{'typecast':!![]});if(_0x21d51d[_0xd1ce('0xb')]){logger[_0xd1ce('0xc')](_0xd1ce('0xd'),_0x1655d8,_[_0xd1ce('0xe')](_0x21d51d,'message')['join'](',\x20'));_0x17d4a8[_0xd1ce('0xf')]();}else{var _0x3e2ea1=_[_0xd1ce('0x10')](_0x218223[_0xd1ce('0x11')],handleFindAgent(_0x1cfd7d['name']));if(_0x3e2ea1){var _0x544bd7=(_0x1cfd7d[_0xd1ce('0x12')]||0xa)*0x3e8;var _0x4ae4e2,_0x105500;var _0x4fd2cf=seqqueue['createQueue'](_0x544bd7);_0x4fd2cf['id']=_0x1655d8;_0x4fd2cf[_0xd1ce('0x13')]=_0x544bd7;_0x4fd2cf[_0xd1ce('0x14')]=_0xa3c8c8[_0xd1ce('0x14')];writeLog(_0x1655d8,_0x3e2ea1,util[_0xd1ce('0x7')]('START:%s',_0x544bd7));_0x218223[_0xd1ce('0x15')][_0x1655d8]['on'](_0xd1ce('0x16'),function(){logger[_0xd1ce('0x17')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x1655d8);clearTimeout(_0x105500);_0x105500=undefined;_0x4fd2cf[_0xd1ce('0x18')]();if(_0x218223[_0xd1ce('0x15')][_0x1655d8]){delete _0x218223[_0xd1ce('0x15')][_0x1655d8];}_0x17d4a8[_0xd1ce('0xf')]();});_0x218223['rules'][_0x1655d8]['on'](_0xd1ce('0x19'),function(){if(_0x218223[_0xd1ce('0x15')][_0x1655d8]){delete _0x218223['rules'][_0x1655d8];}});_0x105500=setTimeout(function(){logger[_0xd1ce('0x17')](_0xd1ce('0x1a'),_0x1655d8);clearTimeout(_0x105500);_0x4fd2cf[_0xd1ce('0x18')]();_0x17d4a8['next']();},_0x544bd7);strategy['agent'](_0x4fd2cf,_0x3e2ea1,_0x218223,_0xa3c8c8);}else{logger[_0xd1ce('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1655d8,_0x1cfd7d[_0xd1ce('0x9')]);_0x17d4a8[_0xd1ce('0xf')]();}}}catch(_0x324fba){console[_0xd1ce('0x1b')](_0x324fba);logger[_0xd1ce('0xc')](_0xd1ce('0x1c'),_0x1655d8,_0x324fba[_0xd1ce('0x1d')]);_0x17d4a8[_0xd1ce('0xf')]();}};}; \ 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 fbdb2e5..75d4b36 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 _0x5c43=['ChatWebsiteId','account','AccountId','created','isEmpty','body','getMustacheRender','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','toString','postText','message','providerName','amazonlex','Message','create','then','dialogState','Failed','error','moment','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','interaction','chat'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0x5c43,0xd1));var _0x35c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c43[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x35c4('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x35c4('0x1'));var rpc={'chatMessage':require(_0x35c4('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x35c4('0x3')),'smsMessage':require(_0x35c4('0x4')),'faxMessage':require(_0x35c4('0x5')),'whatsappMessage':require(_0x35c4('0x6'))};exports['consequence']=function(_0x3260d9,_0x36445a){return function(_0x5bfbeb){try{if(!_['isNil'](this['interaction'][_0x35c4('0x7')])){logger[_0x35c4('0x8')](_0x35c4('0x9'),_0x3260d9,_0x35c4('0xa'));return _0x5bfbeb[_0x35c4('0xb')]();}var _0x5e88d9={'ContactId':this[_0x35c4('0xc')]['id'],'sentAt':moment()[_0x35c4('0xd')](_0x35c4('0xe')),'direction':'out'};if(this['channel']===_0x35c4('0xf')||this[_0x35c4('0x10')]===_0x35c4('0x11')){_0x5e88d9[_0x35c4('0x12')]=this[_0x35c4('0x13')]['phone'];}var _0x27a434=this[_0x35c4('0x10')];if(_0x27a434===_0x35c4('0x14')){_0x5e88d9[_0x35c4('0x15')]=this[_0x35c4('0x16')]['id'];}else{_0x5e88d9[_['upperFirst'](_0x27a434)+_0x35c4('0x17')]=this[_0x35c4('0x16')]['id'];}_0x5e88d9[_['upperFirst'](_0x27a434)+'InteractionId']=this[_0x35c4('0x13')]['id'];if(this['interaction'][_0x35c4('0x18')]){var _0x1202a7=_0x36445a[0x4];if(!_[_0x35c4('0x19')](_0x1202a7)){_0x5e88d9[_0x35c4('0x1a')]=utils[_0x35c4('0x1b')](_0x1202a7,this);return rpc[_0x27a434+'Message']['create'](_0x5e88d9)['then'](function(_0x39eb79){logger[_0x35c4('0x8')](_0x35c4('0x9'),_0x3260d9,_0x5e88d9[_0x35c4('0x1a')]);})[_0x35c4('0x1c')](function(_0x1f3296){logger['error'](_0x35c4('0x9'),_0x3260d9,JSON[_0x35c4('0x1d')](_0x1f3296));})[_0x35c4('0x1e')](function(){logger[_0x35c4('0x8')](_0x35c4('0x1f'),_0x3260d9);_0x5bfbeb[_0x35c4('0x20')]();});}else{logger[_0x35c4('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3260d9);_0x5bfbeb[_0x35c4('0x20')]();}}else{var _0x2d7b21=this;var _0x20bbf0=new AWS[(_0x35c4('0x21'))]({'accessKeyId':_0x36445a[0x0],'secretAccessKey':_0x36445a[0x1],'region':_0x36445a[0x2]});var _0x5baf21={'botAlias':_0x35c4('0x22'),'botName':_0x36445a[0x3],'inputText':this['message'][_0x35c4('0x1a')],'userId':this[_0x35c4('0x10')]+':'+this[_0x35c4('0x13')]['id'][_0x35c4('0x23')]()};_0x20bbf0[_0x35c4('0x24')](_0x5baf21,function(_0x43d894,_0x39560e){if(_0x43d894){logger['error'](_0x35c4('0x9'),_0x3260d9,_0x43d894[_0x35c4('0x25')]);_0x5bfbeb[_0x35c4('0xb')]();}else if(_0x39560e&&_0x39560e[_0x35c4('0x25')]){_0x2d7b21[_0x35c4('0x1a')]['amazonlex']=_0x39560e;_0x5e88d9['body']=_0x39560e['message'];_0x5e88d9[_0x35c4('0x26')]=_0x35c4('0x27');_0x5e88d9['providerResponse']=JSON[_0x35c4('0x1d')](_0x39560e);return rpc[_0x27a434+_0x35c4('0x28')][_0x35c4('0x29')](_0x5e88d9)[_0x35c4('0x2a')](function(_0x1ad166){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3260d9,_0x5e88d9[_0x35c4('0x1a')]);if(_0x39560e[_0x35c4('0x2b')]==_0x35c4('0x2c')){_0x5bfbeb[_0x35c4('0xb')]();}else{_0x5bfbeb[_0x35c4('0x20')]();}})[_0x35c4('0x1c')](function(_0x16a707){logger[_0x35c4('0x2d')](_0x35c4('0x9'),_0x3260d9,JSON[_0x35c4('0x1d')](_0x16a707));_0x5bfbeb[_0x35c4('0xb')]();});}else{_0x5bfbeb[_0x35c4('0xb')]();}});}}catch(_0x19a944){logger[_0x35c4('0x2d')]('[%s][AMAZONLEX]\x20%s',_0x3260d9,JSON[_0x35c4('0x1d')](_0x19a944));_0x5bfbeb[_0x35c4('0x20')]();}};}; \ No newline at end of file +var _0x233a=['dialogState','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','postText','message','amazonlex','providerName','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x233a,0xe8));var _0xa233=function(_0x466917,_0x24ec9a){_0x466917=_0x466917-0x0;var _0x58c17a=_0x233a[_0x466917];return _0x58c17a;};'use strict';var _=require(_0xa233('0x0'));var moment=require(_0xa233('0x1'));var AWS=require('aws-sdk');var utils=require(_0xa233('0x2'));var logger=require(_0xa233('0x3'))(_0xa233('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa233('0x5')),'smsMessage':require(_0xa233('0x6')),'faxMessage':require(_0xa233('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa233('0x8')]=function(_0xa8b288,_0x3c0cdc){return function(_0x24f264){try{if(!_['isNil'](this[_0xa233('0x9')][_0xa233('0xa')])){logger['info'](_0xa233('0xb'),_0xa8b288,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x24f264[_0xa233('0xc')]();}var _0x700d20={'ContactId':this[_0xa233('0xd')]['id'],'sentAt':moment()['format'](_0xa233('0xe')),'direction':_0xa233('0xf')};if(this[_0xa233('0x10')]==='sms'||this['channel']===_0xa233('0x11')){_0x700d20['phone']=this[_0xa233('0x9')][_0xa233('0x12')];}var _0x1347a6=this[_0xa233('0x10')];if(_0x1347a6===_0xa233('0x13')){_0x700d20[_0xa233('0x14')]=this[_0xa233('0x15')]['id'];}else{_0x700d20[_[_0xa233('0x16')](_0x1347a6)+_0xa233('0x17')]=this['account']['id'];}_0x700d20[_[_0xa233('0x16')](_0x1347a6)+_0xa233('0x18')]=this[_0xa233('0x9')]['id'];if(this['interaction'][_0xa233('0x19')]){var _0x4d55f5=_0x3c0cdc[0x4];if(!_['isEmpty'](_0x4d55f5)){_0x700d20[_0xa233('0x1a')]=utils[_0xa233('0x1b')](_0x4d55f5,this);return rpc[_0x1347a6+_0xa233('0x1c')][_0xa233('0x1d')](_0x700d20)['then'](function(_0x2611c2){logger[_0xa233('0x1e')]('[%s][AMAZONLEX]\x20%s',_0xa8b288,_0x700d20[_0xa233('0x1a')]);})[_0xa233('0x1f')](function(_0x320617){logger[_0xa233('0x20')]('[%s][AMAZONLEX]\x20%s',_0xa8b288,JSON[_0xa233('0x21')](_0x320617));})[_0xa233('0x22')](function(){logger[_0xa233('0x1e')](_0xa233('0x23'),_0xa8b288);_0x24f264[_0xa233('0x24')]();});}else{logger[_0xa233('0x1e')](_0xa233('0x25'),_0xa8b288);_0x24f264[_0xa233('0x24')]();}}else{var _0x365fce=this;var _0x7ae0c4=new AWS['LexRuntime']({'accessKeyId':_0x3c0cdc[0x0],'secretAccessKey':_0x3c0cdc[0x1],'region':_0x3c0cdc[0x2]});var _0x43fef0={'botAlias':_0xa233('0x26'),'botName':_0x3c0cdc[0x3],'inputText':this['message'][_0xa233('0x1a')],'userId':this['channel']+':'+this[_0xa233('0x9')]['id']['toString']()};_0x7ae0c4[_0xa233('0x27')](_0x43fef0,function(_0x402009,_0x33ca32){if(_0x402009){logger[_0xa233('0x20')](_0xa233('0xb'),_0xa8b288,_0x402009[_0xa233('0x28')]);_0x24f264[_0xa233('0xc')]();}else if(_0x33ca32&&_0x33ca32['message']){_0x365fce[_0xa233('0x1a')][_0xa233('0x29')]=_0x33ca32;_0x700d20[_0xa233('0x1a')]=_0x33ca32[_0xa233('0x28')];_0x700d20[_0xa233('0x2a')]=_0xa233('0x29');_0x700d20['providerResponse']=JSON[_0xa233('0x21')](_0x33ca32);return rpc[_0x1347a6+'Message'][_0xa233('0x1d')](_0x700d20)[_0xa233('0x2b')](function(_0x4f9c17){logger['info'](_0xa233('0xb'),_0xa8b288,_0x700d20[_0xa233('0x1a')]);if(_0x33ca32[_0xa233('0x2c')]==_0xa233('0x2d')){_0x24f264['next']();}else{_0x24f264[_0xa233('0x24')]();}})[_0xa233('0x1f')](function(_0x57558f){logger[_0xa233('0x20')](_0xa233('0xb'),_0xa8b288,JSON['stringify'](_0x57558f));_0x24f264['next']();});}else{_0x24f264[_0xa233('0xc')]();}});}}catch(_0x454183){logger['error'](_0xa233('0xb'),_0xa8b288,JSON[_0xa233('0x21')](_0x454183));_0x24f264['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index dc02865..0e9fecb 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 _0x1e21=['port','secure','auth','user','pass','inReplyTo','messageId','replace','','auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','InteractionId','Message','Smtp','service','host'];(function(_0x454912,_0x59ea1f){var _0x1b11dc=function(_0x434c52){while(--_0x434c52){_0x454912['push'](_0x454912['shift']());}};_0x1b11dc(++_0x59ea1f);}(_0x1e21,0x170));var _0x11e2=function(_0x11025c,_0x3430ee){_0x11025c=_0x11025c-0x0;var _0x57124a=_0x1e21[_0x11025c];return _0x57124a;};'use strict';var _=require(_0x11e2('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x11e2('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x11e2('0x2')),'mailMessage':require(_0x11e2('0x3')),'smsMessage':require(_0x11e2('0x4')),'faxMessage':require(_0x11e2('0x5')),'whatsappMessage':require(_0x11e2('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x11e2('0x7')),'faxInteraction':require(_0x11e2('0x8')),'whatsappInteraction':require(_0x11e2('0x9'))};var mailRpc=require(_0x11e2('0xa'));exports[_0x11e2('0xb')]=function(_0x45b7c5,_0x3219be){return function(_0xb75f51){try{if(_0x3219be[0x0]==='1'&&(_[_0x11e2('0xc')](this[_0x11e2('0xd')]['created'])||!this[_0x11e2('0xd')][_0x11e2('0xe')])){logger[_0x11e2('0xf')](_0x11e2('0x10'),_0x45b7c5,_0x11e2('0x11'));return _0xb75f51[_0x11e2('0x12')]();}if(_0x3219be[0x0]==='2'&&this[_0x11e2('0xd')][_0x11e2('0x13')]){logger[_0x11e2('0xf')](_0x11e2('0x14'),_0x45b7c5,_0x11e2('0x15'));return _0xb75f51[_0x11e2('0x12')]();}var _0x3dcc8c=this[_0x11e2('0x16')];var _0x1264e6={'ContactId':this[_0x11e2('0x17')]['id'],'sentAt':moment()[_0x11e2('0x18')](_0x11e2('0x19')),'direction':_0x11e2('0x1a')};if(this[_0x11e2('0x16')]==='mail'){_0x1264e6[_0x11e2('0x1b')]=utils['getMustacheRender'](_0x3219be[0x2],this);}else{_0x1264e6[_0x11e2('0x1b')]=utils[_0x11e2('0x1c')](_0x3219be[0x1],this);}if(this[_0x11e2('0x1d')]){_0x1264e6['to']=this[_0x11e2('0x1d')][_0x11e2('0x1e')]||'';if(this[_0x11e2('0x16')]==='mail'&&_0x3219be[0x1]==='1'){_0x1264e6['cc']=this[_0x11e2('0x1d')]['cc']||'';}_0x1264e6['from']=this[_0x11e2('0x1d')]['to']||'';_0x1264e6[_0x11e2('0x1f')]=this['message'][_0x11e2('0x1f')]||'';_0x1264e6[_0x11e2('0x20')]=!![];if(this['message'][_0x11e2('0x21')]){_0x1264e6['subject']='';_0x1264e6['subject']+=_[_0x11e2('0x22')](this['message']['subject'],_0x11e2('0x23'))?'':_0x11e2('0x24');_0x1264e6[_0x11e2('0x21')]+=this['message'][_0x11e2('0x21')];}}if(this['channel']===_0x11e2('0x25')){_0x1264e6[_0x11e2('0x26')]=this[_0x11e2('0x27')]['id'];}else{_0x1264e6[_['upperFirst'](this[_0x11e2('0x16')])+_0x11e2('0x28')]=this[_0x11e2('0x27')]['id'];}_0x1264e6[_['upperFirst'](this[_0x11e2('0x16')])+_0x11e2('0x29')]=this[_0x11e2('0xd')]['id'];var _0x630e70=this[_0x11e2('0xd')];if(rpc[this[_0x11e2('0x16')]+_0x11e2('0x2a')]){if(this[_0x11e2('0x16')]==='mail'){var _0xb6a25c={'tls':{'rejectUnauthorized':![]}};if(this[_0x11e2('0x27')][_0x11e2('0x2b')]['service']){_0xb6a25c[_0x11e2('0x2c')]=this['account']['Smtp'][_0x11e2('0x2c')];}else{_0xb6a25c[_0x11e2('0x2d')]=this[_0x11e2('0x27')][_0x11e2('0x2b')][_0x11e2('0x2d')];_0xb6a25c[_0x11e2('0x2e')]=this['account'][_0x11e2('0x2b')][_0x11e2('0x2e')];_0xb6a25c['secure']=this[_0x11e2('0x27')][_0x11e2('0x2b')][_0x11e2('0x2f')];}if(this[_0x11e2('0x27')]['Smtp']['authentication']){_0xb6a25c[_0x11e2('0x30')]={'user':this[_0x11e2('0x27')][_0x11e2('0x2b')][_0x11e2('0x31')],'pass':this[_0x11e2('0x27')][_0x11e2('0x2b')][_0x11e2('0x32')]};}_0x1264e6[_0x11e2('0x33')]=this[_0x11e2('0x1d')][_0x11e2('0x34')];_0x1264e6['html']=''+_[_0x11e2('0x35')](_0x1264e6[_0x11e2('0x1b')],'','replace','';_0x84b210[_0x71ed('0x38')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x71ed('0x39')};return mailRpc[_0x71ed('0x3a')](_0x3a5aaa,_0x84b210)[_0x71ed('0x3b')](function(_0x1daa5b){logger[_0x71ed('0xd')](_0x71ed('0x3c'),_0x2ce3ab);_0x84b210['messageId']=_0x1daa5b[_0x71ed('0x1c')][_0x71ed('0x32')];return rpc[_0x4a1824+_0x71ed('0x3d')]['create'](_0x84b210);})['then'](function(_0x40a3b8){logger[_0x71ed('0xd')](_0x71ed('0xe'),_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x40a3b8));})[_0x71ed('0x3f')](function(_0x18e370){logger['error'](_0x71ed('0x40'),_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x18e370));})['finally'](function(){Promise[_0x71ed('0x41')]()['then'](function(){if(_0x2917bb[0x0]!=='2'||_0x2a2a6e[_0x71ed('0x11')])return;return rpc[_0x4a1824+_0x71ed('0x42')][_0x71ed('0x43')](_0x2a2a6e['id'],{'autoreplyExecuted':!![]})[_0x71ed('0x3b')](function(_0x404163){logger[_0x71ed('0xd')](_0x71ed('0x12'),_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x404163));})[_0x71ed('0x3f')](function(_0x1fa733){logger[_0x71ed('0x44')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x1fa733));});})[_0x71ed('0x3b')](function(){_0x144687[_0x71ed('0x10')]();});});}else{return rpc[this[_0x71ed('0x18')]+_0x71ed('0x3d')][_0x71ed('0x45')](_0x84b210)[_0x71ed('0x3b')](function(_0x635dd4){logger[_0x71ed('0xd')](_0x71ed('0xe'),_0x2ce3ab,_0x84b210[_0x71ed('0x1a')]);})[_0x71ed('0x3f')](function(_0x47e08a){logger[_0x71ed('0x44')](_0x71ed('0xe'),_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x47e08a));})['finally'](function(){Promise[_0x71ed('0x41')]()['then'](function(){if(_0x2917bb[0x0]!=='2'||_0x2a2a6e[_0x71ed('0x11')])return;return rpc[_0x4a1824+_0x71ed('0x42')]['update'](_0x2a2a6e['id'],{'autoreplyExecuted':!![]})['then'](function(_0xf1380a){logger['info'](_0x71ed('0x12'),_0x2ce3ab,JSON['stringify'](_0xf1380a));})['catch'](function(_0x2e6766){logger[_0x71ed('0x44')](_0x71ed('0x46'),_0x2ce3ab,JSON['stringify'](_0x2e6766));});})['then'](function(){_0x144687[_0x71ed('0x10')]();});});}}}catch(_0x47f2a9){logger['error'](_0x71ed('0xe'),_0x2ce3ab,JSON[_0x71ed('0x3e')](_0x47f2a9));_0x144687[_0x71ed('0x47')]();}};}; \ 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 0764639..6c76077 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 _0xb160=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb160,0x18e));var _0x0b16=function(_0x2660e0,_0x29cfbb){_0x2660e0=_0x2660e0-0x0;var _0x2471d0=_0xb160[_0x2660e0];return _0x2471d0;};'use strict';var moment=require(_0x0b16('0x0'));var logger=require('../../../../config/logger')(_0x0b16('0x1'));var rpc={'chatInteraction':require(_0x0b16('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x0b16('0x3')),'mailInteraction':require(_0x0b16('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0b16('0x5'))};exports[_0x0b16('0x6')]=function(_0x1d2b82,_0x5c9c85,_0xd36f26,_0x5df1b4){return function(_0x1165a6){try{logger[_0x0b16('0x7')](_0x0b16('0x8'),_0x1d2b82,_0x5c9c85[0x0]);var _0x32af08={'closed':0x1,'closedAt':moment()['format'](_0x0b16('0x9')),'closeReason':_0x0b16('0xa'),'disposition':_0x5c9c85[0x0]};if(rpc[_0x5df1b4[_0x0b16('0xb')]+_0x0b16('0xc')]){rpc[_0x5df1b4[_0x0b16('0xb')]+_0x0b16('0xc')][_0x0b16('0xd')](_0x5df1b4[_0x0b16('0xe')]['id'],_0x32af08)[_0x0b16('0xf')](function(_0x35de8f){logger['info'](_0x0b16('0x10'),_0x1d2b82,_0x5df1b4[_0x0b16('0xe')]['id']);})[_0x0b16('0x11')](function(_0xc52bc7){logger[_0x0b16('0x12')](_0x0b16('0x13'),_0x1d2b82,JSON['stringify'](_0xc52bc7));})[_0x0b16('0x14')](function(){_0x1165a6[_0x0b16('0x15')]();});}}catch(_0xf9b3e4){logger[_0x0b16('0x12')](_0x0b16('0x13'),_0x1d2b82,JSON[_0x0b16('0x16')](_0xf9b3e4));_0x1165a6[_0x0b16('0x15')]();}};}; \ No newline at end of file +var _0xab4e=['consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x494376,_0x1c77a2){var _0x9fd443=function(_0xea6c32){while(--_0xea6c32){_0x494376['push'](_0x494376['shift']());}};_0x9fd443(++_0x1c77a2);}(_0xab4e,0x1dc));var _0xeab4=function(_0x61df51,_0x27ab36){_0x61df51=_0x61df51-0x0;var _0x462c65=_0xab4e[_0x61df51];return _0x462c65;};'use strict';var moment=require(_0xeab4('0x0'));var logger=require(_0xeab4('0x1'))(_0xeab4('0x2'));var rpc={'chatInteraction':require(_0xeab4('0x3')),'openchannelInteraction':require(_0xeab4('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xeab4('0x5')),'whatsappInteraction':require(_0xeab4('0x6'))};exports[_0xeab4('0x7')]=function(_0x5bc5a5,_0x38d4d6,_0x2cdcc9,_0xc3cd23){return function(_0x280b6f){try{logger['info'](_0xeab4('0x8'),_0x5bc5a5,_0x38d4d6[0x0]);var _0x48e852={'closed':0x1,'closedAt':moment()[_0xeab4('0x9')](_0xeab4('0xa')),'closeReason':_0xeab4('0xb'),'disposition':_0x38d4d6[0x0]};if(rpc[_0xc3cd23['channel']+_0xeab4('0xc')]){rpc[_0xc3cd23[_0xeab4('0xd')]+'Interaction']['update'](_0xc3cd23[_0xeab4('0xe')]['id'],_0x48e852)['then'](function(_0x29a288){logger[_0xeab4('0xf')](_0xeab4('0x10'),_0x5bc5a5,_0xc3cd23['interaction']['id']);})[_0xeab4('0x11')](function(_0x213f0f){logger[_0xeab4('0x12')](_0xeab4('0x13'),_0x5bc5a5,JSON[_0xeab4('0x14')](_0x213f0f));})[_0xeab4('0x15')](function(){_0x280b6f[_0xeab4('0x16')]();});}}catch(_0x427ccb){logger['error'](_0xeab4('0x13'),_0x5bc5a5,JSON['stringify'](_0x427ccb));_0x280b6f[_0xeab4('0x16')]();}};}; \ 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 8f829a6..578c6aa 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 _0x9b97=['InteractionId','created','isEmpty','body','getMustacheRender','Message','create','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','then','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','next','catch','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','upperFirst','AccountId','account'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b97,0x11e));var _0x79b9=function(_0x10d09,_0x586dd0){_0x10d09=_0x10d09-0x0;var _0x36d9ab=_0x9b97[_0x10d09];return _0x36d9ab;};'use strict';var _=require(_0x79b9('0x0'));var moment=require('moment');var apiai=require(_0x79b9('0x1'));var md5=require(_0x79b9('0x2'));var utils=require(_0x79b9('0x3'));var logger=require(_0x79b9('0x4'))(_0x79b9('0x5'));var rpc={'chatMessage':require(_0x79b9('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x79b9('0x7')),'faxMessage':require(_0x79b9('0x8')),'whatsappMessage':require(_0x79b9('0x9'))};exports['consequence']=function(_0x2312c8,_0x234e33){return function(_0x581e1d){try{if(!_[_0x79b9('0xa')](this[_0x79b9('0xb')][_0x79b9('0xc')])){logger[_0x79b9('0xd')](_0x79b9('0xe'),_0x2312c8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x581e1d['next']();}var _0x56679c={'ContactId':this[_0x79b9('0xf')]['id'],'sentAt':moment()[_0x79b9('0x10')](_0x79b9('0x11')),'direction':_0x79b9('0x12')};if(this[_0x79b9('0x13')]===_0x79b9('0x14')||this[_0x79b9('0x13')]===_0x79b9('0x15')){_0x56679c[_0x79b9('0x16')]=this[_0x79b9('0xb')]['phone'];}var _0x458174=this[_0x79b9('0x13')];if(_0x458174==='chat'){_0x56679c['ChatWebsiteId']=this['account']['id'];}else{_0x56679c[_[_0x79b9('0x17')](_0x458174)+_0x79b9('0x18')]=this[_0x79b9('0x19')]['id'];}_0x56679c[_[_0x79b9('0x17')](_0x458174)+_0x79b9('0x1a')]=this['interaction']['id'];if(this[_0x79b9('0xb')][_0x79b9('0x1b')]){var _0x340937=_0x234e33[0x2];if(!_[_0x79b9('0x1c')](_0x340937)){_0x56679c[_0x79b9('0x1d')]=utils[_0x79b9('0x1e')](_0x340937,this);return rpc[_0x458174+_0x79b9('0x1f')][_0x79b9('0x20')](_0x56679c)['then'](function(_0x54dc9d){logger[_0x79b9('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x2312c8,_0x56679c['body']);})['catch'](function(_0x116aa5){logger[_0x79b9('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x2312c8,JSON[_0x79b9('0x22')](_0x116aa5));})[_0x79b9('0x23')](function(){logger[_0x79b9('0xd')](_0x79b9('0x24'),_0x2312c8);_0x581e1d['stop']();});}else{logger[_0x79b9('0xd')](_0x79b9('0x25'),_0x2312c8);_0x581e1d[_0x79b9('0x26')]();}}else{var _0x25006f=this;var _0x2dcf13=apiai(_0x234e33[0x0],{'language':_0x234e33[0x1]||'en'});return _0x2dcf13[_0x79b9('0x27')](this[_0x79b9('0x28')]['body'],{'sessionId':md5(this[_0x79b9('0xb')]['id'])})[_0x79b9('0x29')](function(_0x495971){_0x25006f['body'][_0x79b9('0x2a')]=_0x495971;_0x56679c[_0x79b9('0x1d')]=_0x495971[_0x79b9('0x2b')][_0x79b9('0x2c')][_0x79b9('0x2d')];_0x56679c[_0x79b9('0x2e')]=_0x79b9('0x2a');_0x56679c[_0x79b9('0x2f')]=JSON[_0x79b9('0x22')](_0x495971);return rpc[_0x458174+_0x79b9('0x1f')][_0x79b9('0x20')](_0x56679c)[_0x79b9('0x29')](function(_0x1b6e53){logger[_0x79b9('0xd')](_0x79b9('0xe'),_0x2312c8,_0x56679c[_0x79b9('0x1d')]);if(_0x495971[_0x79b9('0x2b')][_0x79b9('0x30')][_0x79b9('0x31')]){_0x581e1d[_0x79b9('0x32')]();}else{_0x581e1d[_0x79b9('0x26')]();}})[_0x79b9('0x33')](function(_0x531e7f){logger[_0x79b9('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x2312c8,JSON['stringify'](_0x531e7f));_0x581e1d['next']();});})[_0x79b9('0x33')](function(_0x53fc11){logger[_0x79b9('0x21')](_0x79b9('0xe'),_0x2312c8,_0x53fc11['message']);_0x581e1d['next']();});}}catch(_0x30fdb7){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2312c8,JSON[_0x79b9('0x22')](_0x30fdb7));_0x581e1d['stop']();}};}; \ No newline at end of file +var _0xdb7e=['interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','then','dialogflow','fulfillment','speech','providerName','providerResponse','stringify','create','result','catch','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x38843a,_0x169688){var _0x5c1db6=function(_0x558759){while(--_0x558759){_0x38843a['push'](_0x38843a['shift']());}};_0x5c1db6(++_0x169688);}(_0xdb7e,0x11a));var _0xedb7=function(_0x216187,_0x29e2d2){_0x216187=_0x216187-0x0;var _0x3371b8=_0xdb7e[_0x216187];return _0x3371b8;};'use strict';var _=require(_0xedb7('0x0'));var moment=require(_0xedb7('0x1'));var apiai=require(_0xedb7('0x2'));var md5=require('md5');var utils=require(_0xedb7('0x3'));var logger=require(_0xedb7('0x4'))(_0xedb7('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xedb7('0x6')),'mailMessage':require(_0xedb7('0x7')),'smsMessage':require(_0xedb7('0x8')),'faxMessage':require(_0xedb7('0x9')),'whatsappMessage':require(_0xedb7('0xa'))};exports[_0xedb7('0xb')]=function(_0x87bf4b,_0x20a7c7){return function(_0x26774f){try{if(!_[_0xedb7('0xc')](this['interaction'][_0xedb7('0xd')])){logger[_0xedb7('0xe')](_0xedb7('0xf'),_0x87bf4b,_0xedb7('0x10'));return _0x26774f[_0xedb7('0x11')]();}var _0x1d71d9={'ContactId':this[_0xedb7('0x12')]['id'],'sentAt':moment()[_0xedb7('0x13')](_0xedb7('0x14')),'direction':_0xedb7('0x15')};if(this[_0xedb7('0x16')]===_0xedb7('0x17')||this[_0xedb7('0x16')]==='whatsapp'){_0x1d71d9['phone']=this[_0xedb7('0x18')][_0xedb7('0x19')];}var _0x37b169=this[_0xedb7('0x16')];if(_0x37b169===_0xedb7('0x1a')){_0x1d71d9[_0xedb7('0x1b')]=this[_0xedb7('0x1c')]['id'];}else{_0x1d71d9[_[_0xedb7('0x1d')](_0x37b169)+_0xedb7('0x1e')]=this['account']['id'];}_0x1d71d9[_['upperFirst'](_0x37b169)+_0xedb7('0x1f')]=this[_0xedb7('0x18')]['id'];if(this[_0xedb7('0x18')]['created']){var _0x23b06b=_0x20a7c7[0x2];if(!_[_0xedb7('0x20')](_0x23b06b)){_0x1d71d9[_0xedb7('0x21')]=utils[_0xedb7('0x22')](_0x23b06b,this);return rpc[_0x37b169+_0xedb7('0x23')]['create'](_0x1d71d9)['then'](function(_0x3d8f2a){logger[_0xedb7('0xe')](_0xedb7('0xf'),_0x87bf4b,_0x1d71d9[_0xedb7('0x21')]);})['catch'](function(_0x3b8d7f){logger[_0xedb7('0x24')](_0xedb7('0xf'),_0x87bf4b,JSON['stringify'](_0x3b8d7f));})[_0xedb7('0x25')](function(){logger['info'](_0xedb7('0x26'),_0x87bf4b);_0x26774f[_0xedb7('0x27')]();});}else{logger[_0xedb7('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x87bf4b);_0x26774f['stop']();}}else{var _0x45d7e7=this;var _0x267e55=apiai(_0x20a7c7[0x0],{'language':_0x20a7c7[0x1]||'en'});return _0x267e55['textRequest'](this[_0xedb7('0x28')][_0xedb7('0x21')],{'sessionId':md5(this['interaction']['id'])})[_0xedb7('0x29')](function(_0x581ecb){_0x45d7e7['body'][_0xedb7('0x2a')]=_0x581ecb;_0x1d71d9[_0xedb7('0x21')]=_0x581ecb['result'][_0xedb7('0x2b')][_0xedb7('0x2c')];_0x1d71d9[_0xedb7('0x2d')]=_0xedb7('0x2a');_0x1d71d9[_0xedb7('0x2e')]=JSON[_0xedb7('0x2f')](_0x581ecb);return rpc[_0x37b169+_0xedb7('0x23')][_0xedb7('0x30')](_0x1d71d9)['then'](function(_0x2070b8){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x87bf4b,_0x1d71d9[_0xedb7('0x21')]);if(_0x581ecb[_0xedb7('0x31')]['metadata']['endConversation']){_0x26774f[_0xedb7('0x11')]();}else{_0x26774f['stop']();}})[_0xedb7('0x32')](function(_0x2c5cfe){logger[_0xedb7('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x87bf4b,JSON[_0xedb7('0x2f')](_0x2c5cfe));_0x26774f[_0xedb7('0x11')]();});})[_0xedb7('0x32')](function(_0x2202bd){logger[_0xedb7('0x24')](_0xedb7('0xf'),_0x87bf4b,_0x2202bd['message']);_0x26774f[_0xedb7('0x11')]();});}}catch(_0x5e3da4){logger[_0xedb7('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x87bf4b,JSON[_0xedb7('0x2f')](_0x5e3da4));_0x26774f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index a956288..60dcbb0 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4250=['queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','error','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','getMustacheRender','info','[%s][DIALOGFLOWV2]\x20%s','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','message','detectIntent','length','dialogflowV2'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4250,0x146));var _0x0425=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x4250[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0425('0x0'));var dialogflow=require(_0x0425('0x1'));var md5=require(_0x0425('0x2'));var moment=require(_0x0425('0x3'));var Promise=require('bluebird');var logger=require(_0x0425('0x4'))(_0x0425('0x5'));var utils=require(_0x0425('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0425('0x7')),'mailMessage':require(_0x0425('0x8')),'smsMessage':require(_0x0425('0x9')),'faxMessage':require(_0x0425('0xa')),'whatsappMessage':require(_0x0425('0xb'))};function createMessage(_0xb08e11,_0x12f19a,_0xbd5251,_0x27ceaf){return new Promise(function(_0x1a70f5,_0xbc284f){var _0x765182=_[_0x0425('0xc')](_0xbd5251);_0x765182[_0x0425('0xd')]=_0x27ceaf;return rpc[_0x12f19a+_0x0425('0xe')][_0x0425('0xf')](_0x765182)[_0x0425('0x10')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0xb08e11,_0x765182[_0x0425('0xd')]);_0x1a70f5();})['catch'](function(_0x3e9a54){logger[_0x0425('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xb08e11,JSON[_0x0425('0x12')](_0x3e9a54));_0xbc284f(_0x3e9a54);});});}exports[_0x0425('0x13')]=function(_0x1c67ec,_0x682247){return function(_0x4c9666){try{if(!_[_0x0425('0x14')](this[_0x0425('0x15')]['UserId'])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1c67ec,_0x0425('0x16'));return _0x4c9666[_0x0425('0x17')]();}var _0x1cd255={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0425('0x18')),'direction':_0x0425('0x19')};if(this[_0x0425('0x1a')]===_0x0425('0x1b')||this[_0x0425('0x1a')]===_0x0425('0x1c')){_0x1cd255[_0x0425('0x1d')]=this[_0x0425('0x15')][_0x0425('0x1d')];}var _0x3fe230=this['channel'];if(_0x3fe230===_0x0425('0x1e')){_0x1cd255[_0x0425('0x1f')]=this[_0x0425('0x20')]['id'];}else{_0x1cd255[_[_0x0425('0x21')](_0x3fe230)+_0x0425('0x22')]=this[_0x0425('0x20')]['id'];}_0x1cd255[_[_0x0425('0x21')](_0x3fe230)+_0x0425('0x23')]=this[_0x0425('0x15')]['id'];if(this[_0x0425('0x15')]['created']){var _0x225906=_0x682247[0x4];if(!_['isEmpty'](_0x225906)){_0x1cd255[_0x0425('0xd')]=utils[_0x0425('0x24')](_0x225906,this);return rpc[_0x3fe230+_0x0425('0xe')][_0x0425('0xf')](_0x1cd255)[_0x0425('0x10')](function(_0x3f8728){logger[_0x0425('0x25')](_0x0425('0x26'),_0x1c67ec,_0x1cd255['body']);})[_0x0425('0x27')](function(_0x4d3f93){logger[_0x0425('0x11')](_0x0425('0x26'),_0x1c67ec,JSON[_0x0425('0x12')](_0x4d3f93));})['finally'](function(){logger[_0x0425('0x25')](_0x0425('0x28'),_0x1c67ec);_0x4c9666[_0x0425('0x29')]();});}else{logger[_0x0425('0x25')](_0x0425('0x2a'),_0x1c67ec);_0x4c9666[_0x0425('0x29')]();}}else{var _0x36146d=this;var _0x43db4f=_0x682247[0x2][_0x0425('0x2b')](/\\n/g,'\x0a');var _0x154aa5={'credentials':{'private_key':_0x43db4f,'client_email':_0x682247[0x1]}};var _0x120a5b=new dialogflow[(_0x0425('0x2c'))](_0x154aa5);var _0x40a577=_0x120a5b['sessionPath'](_0x682247[0x0],md5(_0x36146d[_0x0425('0x15')]['id']));var _0x9ce829={'session':_0x40a577,'queryInput':{'text':{'text':_0x36146d[_0x0425('0x2d')][_0x0425('0xd')],'languageCode':_0x682247[0x3]||'en'}}};return _0x120a5b[_0x0425('0x2e')](_0x9ce829)[_0x0425('0x10')](function(_0x327b45){if(_0x327b45&&_0x327b45[_0x0425('0x2f')]){_0x36146d[_0x0425('0xd')][_0x0425('0x30')]=_0x327b45;var _0x38c50f=_0x327b45[0x0];var _0x3505ef=_0x38c50f[_0x0425('0x31')][_0x0425('0x32')]&&_0x38c50f[_0x0425('0x31')][_0x0425('0x32')][_0x0425('0x33')]?_0x38c50f[_0x0425('0x31')][_0x0425('0x32')][_0x0425('0x33')][_0x0425('0x34')][_0x0425('0x35')]:![];_0x36146d[_0x0425('0xd')][_0x0425('0x36')]=_0x38c50f['queryResult'][_0x0425('0x37')];_0x36146d['body'][_0x0425('0x38')]=_0x38c50f[_0x0425('0x31')][_0x0425('0x39')];_0x36146d[_0x0425('0xd')][_0x0425('0x3a')]=_0x38c50f['queryResult'][_0x0425('0x32')]&&_0x38c50f['queryResult'][_0x0425('0x32')][_0x0425('0x33')]?_0x38c50f['queryResult'][_0x0425('0x32')][_0x0425('0x33')][_0x0425('0x34')]['boolValue']:![];_0x36146d[_0x0425('0xd')][_0x0425('0x3b')]=_0x38c50f[_0x0425('0x31')][_0x0425('0x3c')][_0x0425('0x3d')];_0x36146d[_0x0425('0xd')][_0x0425('0x3e')]=_0x38c50f['queryResult']['intent']['displayName'];_0x36146d[_0x0425('0xd')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x38c50f[_0x0425('0x31')][_0x0425('0x3c')][_0x0425('0x3f')];_0x36146d[_0x0425('0xd')][_0x0425('0x40')]=_0x38c50f['queryResult'][_0x0425('0x41')];_0x36146d[_0x0425('0xd')][_0x0425('0x42')]=_0x38c50f[_0x0425('0x31')][_0x0425('0x43')];_0x36146d[_0x0425('0xd')][_0x0425('0x44')]=_0x38c50f['queryResult'][_0x0425('0x45')];_0x1cd255[_0x0425('0x46')]=_0x0425('0x30');_0x1cd255[_0x0425('0x47')]=JSON['stringify'](_0x327b45);var _0x3dab51=[];for(var _0x230df7=0x0;_0x230df7<_0x327b45['length'];_0x230df7++){var _0x23000b=_0x327b45[_0x230df7];if(_0x23000b&&_0x23000b[_0x0425('0x31')]&&_0x23000b[_0x0425('0x31')]['fulfillmentText']){_0x3dab51[_0x0425('0x48')](createMessage(_0x1c67ec,_0x3fe230,_0x1cd255,_0x23000b[_0x0425('0x31')][_0x0425('0x49')]));}}return Promise[_0x0425('0x4a')](_0x3dab51)[_0x0425('0x10')](function(){if(_0x3505ef){_0x4c9666[_0x0425('0x17')]();}else{_0x4c9666[_0x0425('0x29')]();}})[_0x0425('0x27')](function(_0x50bdfc){logger[_0x0425('0x11')](_0x0425('0x26'),_0x1c67ec,JSON[_0x0425('0x12')](_0x50bdfc));_0x4c9666['next']();});}})[_0x0425('0x27')](function(_0x197bbc){logger[_0x0425('0x11')](_0x0425('0x26'),_0x1c67ec,_0x197bbc['message']);_0x4c9666[_0x0425('0x17')]();});}}catch(_0x240cf4){logger[_0x0425('0x11')](_0x0425('0x26'),_0x1c67ec,JSON[_0x0425('0x12')](_0x240cf4));_0x4c9666[_0x0425('0x29')]();}};}; \ No newline at end of file +var _0xdc97=['InteractionId','isEmpty','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','stringify','length','push','fulfillmentText','stop','lodash','dialogflow','md5','bluebird','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x251149,_0x369a45){var _0x3cf8ff=function(_0x4896e6){while(--_0x4896e6){_0x251149['push'](_0x251149['shift']());}};_0x3cf8ff(++_0x369a45);}(_0xdc97,0x13b));var _0x7dc9=function(_0x467b5d,_0x5e5de2){_0x467b5d=_0x467b5d-0x0;var _0x668100=_0xdc97[_0x467b5d];return _0x668100;};'use strict';var _=require(_0x7dc9('0x0'));var dialogflow=require(_0x7dc9('0x1'));var md5=require(_0x7dc9('0x2'));var moment=require('moment');var Promise=require(_0x7dc9('0x3'));var logger=require('../../../../config/logger')(_0x7dc9('0x4'));var utils=require(_0x7dc9('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7dc9('0x6')),'mailMessage':require(_0x7dc9('0x7')),'smsMessage':require(_0x7dc9('0x8')),'faxMessage':require(_0x7dc9('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x2636ef,_0x4f91c7,_0x4b3229,_0x2ff923){return new Promise(function(_0x23737d,_0x3318ea){var _0x42ec7c=_[_0x7dc9('0xa')](_0x4b3229);_0x42ec7c['body']=_0x2ff923;return rpc[_0x4f91c7+_0x7dc9('0xb')][_0x7dc9('0xc')](_0x42ec7c)[_0x7dc9('0xd')](function(){logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x2636ef,_0x42ec7c[_0x7dc9('0x10')]);_0x23737d();})[_0x7dc9('0x11')](function(_0x4e8e65){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2636ef,JSON['stringify'](_0x4e8e65));_0x3318ea(_0x4e8e65);});});}exports[_0x7dc9('0x12')]=function(_0x14e5db,_0x5c6ca5){return function(_0xbd06be){try{if(!_[_0x7dc9('0x13')](this[_0x7dc9('0x14')][_0x7dc9('0x15')])){logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x14e5db,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xbd06be[_0x7dc9('0x16')]();}var _0x278191={'ContactId':this[_0x7dc9('0x17')]['id'],'sentAt':moment()[_0x7dc9('0x18')](_0x7dc9('0x19')),'direction':_0x7dc9('0x1a')};if(this[_0x7dc9('0x1b')]===_0x7dc9('0x1c')||this[_0x7dc9('0x1b')]==='whatsapp'){_0x278191[_0x7dc9('0x1d')]=this['interaction'][_0x7dc9('0x1d')];}var _0x1cc237=this['channel'];if(_0x1cc237===_0x7dc9('0x1e')){_0x278191[_0x7dc9('0x1f')]=this[_0x7dc9('0x20')]['id'];}else{_0x278191[_[_0x7dc9('0x21')](_0x1cc237)+_0x7dc9('0x22')]=this[_0x7dc9('0x20')]['id'];}_0x278191[_[_0x7dc9('0x21')](_0x1cc237)+_0x7dc9('0x23')]=this[_0x7dc9('0x14')]['id'];if(this[_0x7dc9('0x14')]['created']){var _0x593e60=_0x5c6ca5[0x4];if(!_[_0x7dc9('0x24')](_0x593e60)){_0x278191[_0x7dc9('0x10')]=utils['getMustacheRender'](_0x593e60,this);return rpc[_0x1cc237+_0x7dc9('0xb')][_0x7dc9('0xc')](_0x278191)['then'](function(_0xffc080){logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x14e5db,_0x278191['body']);})[_0x7dc9('0x11')](function(_0x1e3a8d){logger[_0x7dc9('0x25')]('[%s][DIALOGFLOWV2]\x20%s',_0x14e5db,JSON['stringify'](_0x1e3a8d));})['finally'](function(){logger[_0x7dc9('0xe')](_0x7dc9('0x26'),_0x14e5db);_0xbd06be['stop']();});}else{logger['info'](_0x7dc9('0x27'),_0x14e5db);_0xbd06be['stop']();}}else{var _0x2d22eb=this;var _0x1c690b=_0x5c6ca5[0x2][_0x7dc9('0x28')](/\\n/g,'\x0a');var _0x3e4102={'credentials':{'private_key':_0x1c690b,'client_email':_0x5c6ca5[0x1]}};var _0xa2aaa9=new dialogflow[(_0x7dc9('0x29'))](_0x3e4102);var _0x236d42=_0xa2aaa9[_0x7dc9('0x2a')](_0x5c6ca5[0x0],md5(_0x2d22eb[_0x7dc9('0x14')]['id']));var _0x3c4379={'session':_0x236d42,'queryInput':{'text':{'text':_0x2d22eb[_0x7dc9('0x2b')][_0x7dc9('0x10')],'languageCode':_0x5c6ca5[0x3]||'en'}}};return _0xa2aaa9['detectIntent'](_0x3c4379)['then'](function(_0x513dd6){if(_0x513dd6&&_0x513dd6['length']){_0x2d22eb['body']['dialogflowV2']=_0x513dd6;var _0x58c4e8=_0x513dd6[0x0];var _0x59f5d8=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x2d')]&&_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x58c4e8[_0x7dc9('0x2c')]['diagnosticInfo']['fields']['end_conversation'][_0x7dc9('0x2f')]:![];_0x2d22eb['body'][_0x7dc9('0x30')]=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x31')];_0x2d22eb[_0x7dc9('0x10')][_0x7dc9('0x32')]=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x33')];_0x2d22eb[_0x7dc9('0x10')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x58c4e8[_0x7dc9('0x2c')]['diagnosticInfo']&&_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x58c4e8[_0x7dc9('0x2c')]['diagnosticInfo'][_0x7dc9('0x2e')]['end_conversation'][_0x7dc9('0x2f')]:![];_0x2d22eb['body']['DIALOGFLOWV2_INTENTNAME']=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x34')][_0x7dc9('0x35')];_0x2d22eb[_0x7dc9('0x10')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x34')][_0x7dc9('0x36')];_0x2d22eb[_0x7dc9('0x10')][_0x7dc9('0x37')]=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x34')][_0x7dc9('0x38')];_0x2d22eb[_0x7dc9('0x10')][_0x7dc9('0x39')]=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x3a')];_0x2d22eb['body'][_0x7dc9('0x3b')]=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x3c')];_0x2d22eb[_0x7dc9('0x10')]['DIALOGFLOWV2_SCORE']=_0x58c4e8[_0x7dc9('0x2c')][_0x7dc9('0x3d')];_0x278191[_0x7dc9('0x3e')]=_0x7dc9('0x3f');_0x278191[_0x7dc9('0x40')]=JSON[_0x7dc9('0x41')](_0x513dd6);var _0x5a1201=[];for(var _0x553230=0x0;_0x553230<_0x513dd6[_0x7dc9('0x42')];_0x553230++){var _0x36a965=_0x513dd6[_0x553230];if(_0x36a965&&_0x36a965['queryResult']&&_0x36a965[_0x7dc9('0x2c')]['fulfillmentText']){_0x5a1201[_0x7dc9('0x43')](createMessage(_0x14e5db,_0x1cc237,_0x278191,_0x36a965[_0x7dc9('0x2c')][_0x7dc9('0x44')]));}}return Promise['all'](_0x5a1201)[_0x7dc9('0xd')](function(){if(_0x59f5d8){_0xbd06be[_0x7dc9('0x16')]();}else{_0xbd06be[_0x7dc9('0x45')]();}})[_0x7dc9('0x11')](function(_0x28ffc0){logger[_0x7dc9('0x25')](_0x7dc9('0xf'),_0x14e5db,JSON['stringify'](_0x28ffc0));_0xbd06be[_0x7dc9('0x16')]();});}})['catch'](function(_0x52d883){logger[_0x7dc9('0x25')](_0x7dc9('0xf'),_0x14e5db,_0x52d883[_0x7dc9('0x2b')]);_0xbd06be[_0x7dc9('0x16')]();});}}catch(_0xa39a03){logger[_0x7dc9('0x25')](_0x7dc9('0xf'),_0x14e5db,JSON[_0x7dc9('0x41')](_0xa39a03));_0xbd06be[_0x7dc9('0x45')]();}};}; \ 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 42e9d0e..9f11d0f 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 _0xb2ea=['fromString','replace','validate','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x43e5e0,_0x215765){var _0x2bf17b=function(_0x135e8d){while(--_0x135e8d){_0x43e5e0['push'](_0x43e5e0['shift']());}};_0x2bf17b(++_0x215765);}(_0xb2ea,0x18d));var _0xab2e=function(_0x117994,_0x46bbbb){_0x117994=_0x117994-0x0;var _0x40814a=_0xb2ea[_0x117994];return _0x40814a;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xab2e('0x0'));var utils=require(_0xab2e('0x1'));var logger=require(_0xab2e('0x2'))(_0xab2e('0x3'));var gotoif=schema({'condition':{'type':_0xab2e('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xab2e('0x5'),'message':_0xab2e('0x6')},'priorityFalse':{'type':_0xab2e('0x5'),'message':_0xab2e('0x7')}});exports[_0xab2e('0x8')]=function(_0x47e57b,_0x1783a7){return function(_0x169432){try{var _0x57059e={'condition':htmlToText[_0xab2e('0x9')](utils['getMustacheRender'](_0x1783a7[0x0],this),{'wordwrap':![]})[_0xab2e('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1783a7[0x1],'priorityFalse':_0x1783a7[0x2]};var _0x27e077=gotoif[_0xab2e('0xb')](_0x57059e,{'typecast':!![]});if(_0x27e077['length']){logger[_0xab2e('0xc')](_0xab2e('0xd'),_0x47e57b,_[_0xab2e('0xe')](_0x27e077,'message')[_0xab2e('0xf')](',\x20'));_0x169432[_0xab2e('0x10')]();}else{try{var _0x3dd850=eval('('+_0x57059e[_0xab2e('0x11')]+')');var _0x5db4e3=_0x3dd850?_0x57059e[_0xab2e('0x12')]:_0x57059e[_0xab2e('0x13')];logger[_0xab2e('0x14')](_0xab2e('0x15'),_0x47e57b,_0x57059e[_0xab2e('0x11')],_0x3dd850,_0x5db4e3||'next');if(_0x5db4e3){var _0x5e9ff4=_['findIndex'](_0x169432[_0xab2e('0x16')](),{'p':_0x5db4e3});if(_0x5e9ff4>=0x0){logger['info'](_0xab2e('0x17'),_0x47e57b,_0x5db4e3||_0xab2e('0x18'),_0x5e9ff4);_0x169432['next'](_0x5e9ff4);}else{logger[_0xab2e('0x14')](_0xab2e('0x19'),_0x47e57b,_0x5db4e3||_0xab2e('0x18'));_0x169432['stop']();}}else{_0x169432[_0xab2e('0x18')]();}}catch(_0x40f810){logger[_0xab2e('0xc')](_0xab2e('0x1a'),_0x47e57b,_0x40f810[_0xab2e('0x1b')]);_0x169432[_0xab2e('0x10')]();}}}catch(_0x178b6e){logger['error'](_0xab2e('0xd'),_0x47e57b,JSON[_0xab2e('0x1c')](_0x178b6e));_0x169432[_0xab2e('0x10')]();}};}; \ No newline at end of file +var _0xe649=['consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','html-to-text','../../../../config/logger','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0xe649,0x70));var _0x9e64=function(_0x4d5ec2,_0x1f3cc2){_0x4d5ec2=_0x4d5ec2-0x0;var _0x26b7b4=_0xe649[_0x4d5ec2];return _0x26b7b4;};'use strict';var schema=require(_0x9e64('0x0'));var _=require('lodash');var htmlToText=require(_0x9e64('0x1'));var utils=require('./utils');var logger=require(_0x9e64('0x2'))(_0x9e64('0x3'));var gotoif=schema({'condition':{'type':_0x9e64('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x9e64('0x5')},'priorityFalse':{'type':_0x9e64('0x6'),'message':_0x9e64('0x7')}});exports[_0x9e64('0x8')]=function(_0x5dcc73,_0x3aa564){return function(_0x5d133c){try{var _0x4988ee={'condition':htmlToText[_0x9e64('0x9')](utils[_0x9e64('0xa')](_0x3aa564[0x0],this),{'wordwrap':![]})[_0x9e64('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3aa564[0x1],'priorityFalse':_0x3aa564[0x2]};var _0x124f74=gotoif['validate'](_0x4988ee,{'typecast':!![]});if(_0x124f74[_0x9e64('0xc')]){logger[_0x9e64('0xd')](_0x9e64('0xe'),_0x5dcc73,_['map'](_0x124f74,'message')[_0x9e64('0xf')](',\x20'));_0x5d133c[_0x9e64('0x10')]();}else{try{var _0x12f6a4=eval('('+_0x4988ee[_0x9e64('0x11')]+')');var _0x4bafd0=_0x12f6a4?_0x4988ee['priorityTrue']:_0x4988ee[_0x9e64('0x12')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5dcc73,_0x4988ee[_0x9e64('0x11')],_0x12f6a4,_0x4bafd0||'next');if(_0x4bafd0){var _0x36155e=_['findIndex'](_0x5d133c['rules'](),{'p':_0x4bafd0});if(_0x36155e>=0x0){logger[_0x9e64('0x13')](_0x9e64('0x14'),_0x5dcc73,_0x4bafd0||_0x9e64('0x15'),_0x36155e);_0x5d133c[_0x9e64('0x15')](_0x36155e);}else{logger[_0x9e64('0x13')](_0x9e64('0x16'),_0x5dcc73,_0x4bafd0||_0x9e64('0x15'));_0x5d133c[_0x9e64('0x10')]();}}else{_0x5d133c[_0x9e64('0x15')]();}}catch(_0x106fd8){logger[_0x9e64('0xd')](_0x9e64('0x17'),_0x5dcc73,_0x106fd8['message']);_0x5d133c[_0x9e64('0x10')]();}}}catch(_0x431f0e){logger[_0x9e64('0xd')](_0x9e64('0xe'),_0x5dcc73,JSON['stringify'](_0x431f0e));_0x5d133c[_0x9e64('0x10')]();}};}; \ 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 205876f..5471c77 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 _0x1bf8=['map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','lodash','../../../../config/logger','routing','number','consequence','validate','length','error'];(function(_0x4dbd41,_0x1511d8){var _0x4bcff4=function(_0x2ce604){while(--_0x2ce604){_0x4dbd41['push'](_0x4dbd41['shift']());}};_0x4bcff4(++_0x1511d8);}(_0x1bf8,0x115));var _0x81bf=function(_0x93605,_0xcab16c){_0x93605=_0x93605-0x0;var _0x1516bb=_0x1bf8[_0x93605];return _0x1516bb;};'use strict';var schema=require('validate');var _=require(_0x81bf('0x0'));var logger=require(_0x81bf('0x1'))(_0x81bf('0x2'));var gotop=schema({'priority':{'type':_0x81bf('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x81bf('0x4')]=function(_0x3a664e,_0x1ef4de){return function(_0x3a904f){try{var _0x39243c={'priority':_0x1ef4de[0x0]};var _0x9c85d5=gotop[_0x81bf('0x5')](_0x39243c,{'typecast':!![]});if(_0x9c85d5[_0x81bf('0x6')]){logger[_0x81bf('0x7')]('[%s][GOTOP]\x20%s',_0x3a664e,_[_0x81bf('0x8')](_0x9c85d5,_0x81bf('0x9'))[_0x81bf('0xa')](',\x20'));_0x3a904f['stop']();}else{logger[_0x81bf('0xb')](_0x81bf('0xc'),_0x3a664e,_0x39243c[_0x81bf('0xd')]);if(_0x39243c[_0x81bf('0xd')]){var _0x4fd293=_['findIndex'](_0x3a904f[_0x81bf('0xe')](),{'p':_0x39243c[_0x81bf('0xd')]});if(_0x4fd293>=0x0){logger[_0x81bf('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a664e,_0x39243c[_0x81bf('0xd')]||_0x81bf('0xf'),_0x4fd293);_0x3a904f[_0x81bf('0xf')](_0x4fd293);}else{logger[_0x81bf('0xb')](_0x81bf('0x10'),_0x3a664e,_0x39243c[_0x81bf('0xd')]||_0x81bf('0xf'));_0x3a904f[_0x81bf('0x11')]();}}else{_0x3a904f[_0x81bf('0xf')]();}}}catch(_0x4261f1){logger[_0x81bf('0x7')]('[%s][GOTOP]\x20%s',_0x3a664e,JSON[_0x81bf('0x12')](_0x4261f1));_0x3a904f[_0x81bf('0x11')]();}};}; \ No newline at end of file +var _0xd13c=['validate','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOP]\x20%s','lodash','../../../../config/logger','routing','consequence'];(function(_0x2860bd,_0x120f84){var _0x5d7215=function(_0x270512){while(--_0x270512){_0x2860bd['push'](_0x2860bd['shift']());}};_0x5d7215(++_0x120f84);}(_0xd13c,0x194));var _0xcd13=function(_0x4d0553,_0x5f6fe0){_0x4d0553=_0x4d0553-0x0;var _0x167888=_0xd13c[_0x4d0553];return _0x167888;};'use strict';var schema=require('validate');var _=require(_0xcd13('0x0'));var logger=require(_0xcd13('0x1'))(_0xcd13('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xcd13('0x3')]=function(_0x2f4843,_0x4b10a6){return function(_0x3bd90a){try{var _0x1743e4={'priority':_0x4b10a6[0x0]};var _0x527d02=gotop[_0xcd13('0x4')](_0x1743e4,{'typecast':!![]});if(_0x527d02['length']){logger[_0xcd13('0x5')]('[%s][GOTOP]\x20%s',_0x2f4843,_[_0xcd13('0x6')](_0x527d02,_0xcd13('0x7'))['join'](',\x20'));_0x3bd90a[_0xcd13('0x8')]();}else{logger[_0xcd13('0x9')](_0xcd13('0xa'),_0x2f4843,_0x1743e4[_0xcd13('0xb')]);if(_0x1743e4['priority']){var _0x3f1e6e=_['findIndex'](_0x3bd90a[_0xcd13('0xc')](),{'p':_0x1743e4[_0xcd13('0xb')]});if(_0x3f1e6e>=0x0){logger[_0xcd13('0x9')](_0xcd13('0xd'),_0x2f4843,_0x1743e4[_0xcd13('0xb')]||'next',_0x3f1e6e);_0x3bd90a['next'](_0x3f1e6e);}else{logger[_0xcd13('0x9')](_0xcd13('0xe'),_0x2f4843,_0x1743e4['priority']||_0xcd13('0xf'));_0x3bd90a[_0xcd13('0x8')]();}}else{_0x3bd90a[_0xcd13('0xf')]();}}}catch(_0x3587a7){logger[_0xcd13('0x5')](_0xcd13('0x10'),_0x2f4843,JSON['stringify'](_0x3587a7));_0x3bd90a[_0xcd13('0x8')]();}};}; \ 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 5912d52..c324bd5 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 _0xe33c=['catch','error','stringify','stop','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','then','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x2be71f,_0x39108e){var _0x1719eb=function(_0x48b1ef){while(--_0x48b1ef){_0x2be71f['push'](_0x2be71f['shift']());}};_0x1719eb(++_0x39108e);}(_0xe33c,0x1a4));var _0xce33=function(_0x5c3e63,_0x5001f3){_0x5c3e63=_0x5c3e63-0x0;var _0x40e548=_0xe33c[_0x5c3e63];return _0x40e548;};'use strict';var _=require('lodash');var utils=require(_0xce33('0x0'));var logger=require('../../../../config/logger')(_0xce33('0x1'));var rpc={'chatMessage':require(_0xce33('0x2')),'openchannelMessage':require(_0xce33('0x3')),'mailMessage':require(_0xce33('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xce33('0x5')),'whatsappMessage':require(_0xce33('0x6'))};exports[_0xce33('0x7')]=function(_0x311fad,_0x1d0ed7){return function(_0xfef98f){try{var _0x32c0de={'body':utils[_0xce33('0x8')](_0x1d0ed7[0x0],this),'ContactId':this[_0xce33('0x9')]['id']};if(this[_0xce33('0xa')]===_0xce33('0xb')){_0x32c0de[_0xce33('0xc')]=this[_0xce33('0xd')]['id'];}else{_0x32c0de[_[_0xce33('0xe')](this['channel'])+_0xce33('0xf')]=this[_0xce33('0xd')]['id'];}_0x32c0de[_[_0xce33('0xe')](this[_0xce33('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xce33('0xa')]+_0xce33('0x10')]){return rpc[this[_0xce33('0xa')]+_0xce33('0x10')]['create'](_0x32c0de)[_0xce33('0x11')](function(_0x3934fe){logger[_0xce33('0x12')](_0xce33('0x13'),_0x311fad,_0x32c0de[_0xce33('0x14')]);_0xfef98f[_0xce33('0x15')]();})[_0xce33('0x16')](function(_0xb61a4e){logger[_0xce33('0x17')]('[%s][MESSAGE]\x20%s',_0x311fad,JSON[_0xce33('0x18')](_0xb61a4e));_0xfef98f[_0xce33('0x19')]();});}}catch(_0x58db72){logger[_0xce33('0x17')](_0xce33('0x13'),_0x311fad,JSON[_0xce33('0x18')](_0x58db72));_0xfef98f[_0xce33('0x19')]();}};}; \ No newline at end of file +var _0x608a=['contact','channel','ChatWebsiteId','upperFirst','account','InteractionId','Message','create','info','next','catch','error','stringify','stop','[%s][MESSAGE]\x20%s','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0xaeaac3,_0x4d540f){var _0x4863f5=function(_0x225b94){while(--_0x225b94){_0xaeaac3['push'](_0xaeaac3['shift']());}};_0x4863f5(++_0x4d540f);}(_0x608a,0xff));var _0xa608=function(_0x55e0f7,_0x2d49c7){_0x55e0f7=_0x55e0f7-0x0;var _0x2f0aed=_0x608a[_0x55e0f7];return _0x2f0aed;};'use strict';var _=require('lodash');var utils=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('routing');var rpc={'chatMessage':require(_0xa608('0x2')),'openchannelMessage':require(_0xa608('0x3')),'mailMessage':require(_0xa608('0x4')),'smsMessage':require(_0xa608('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa608('0x6'))};exports[_0xa608('0x7')]=function(_0x5de09b,_0x4e24d6){return function(_0x3b0f4e){try{var _0x50395e={'body':utils[_0xa608('0x8')](_0x4e24d6[0x0],this),'ContactId':this[_0xa608('0x9')]['id']};if(this[_0xa608('0xa')]==='chat'){_0x50395e[_0xa608('0xb')]=this['account']['id'];}else{_0x50395e[_[_0xa608('0xc')](this[_0xa608('0xa')])+'AccountId']=this[_0xa608('0xd')]['id'];}_0x50395e[_[_0xa608('0xc')](this[_0xa608('0xa')])+_0xa608('0xe')]=this['interaction']['id'];if(rpc[this[_0xa608('0xa')]+_0xa608('0xf')]){return rpc[this[_0xa608('0xa')]+_0xa608('0xf')][_0xa608('0x10')](_0x50395e)['then'](function(_0x2030c4){logger[_0xa608('0x11')]('[%s][MESSAGE]\x20%s',_0x5de09b,_0x50395e['body']);_0x3b0f4e[_0xa608('0x12')]();})[_0xa608('0x13')](function(_0x1eb156){logger[_0xa608('0x14')]('[%s][MESSAGE]\x20%s',_0x5de09b,JSON[_0xa608('0x15')](_0x1eb156));_0x3b0f4e[_0xa608('0x16')]();});}}catch(_0x49d154){logger[_0xa608('0x14')](_0xa608('0x17'),_0x5de09b,JSON['stringify'](_0x49d154));_0x3b0f4e['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 92a82e0..1170b49 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 _0x7dc0=['stringify','stop','./utils','routing','consequence','getMustacheRender','error','[%s][NOOP]\x20%s'];(function(_0x5d05f6,_0x1b5242){var _0x5305d3=function(_0x1a6a26){while(--_0x1a6a26){_0x5d05f6['push'](_0x5d05f6['shift']());}};_0x5305d3(++_0x1b5242);}(_0x7dc0,0x18a));var _0x07dc=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x7dc0[_0x1ebce2];return _0x4a330c;};'use strict';var utils=require(_0x07dc('0x0'));var logger=require('../../../../config/logger')(_0x07dc('0x1'));exports[_0x07dc('0x2')]=function(_0x289724,_0x34e9da){return function(_0x3d1bf3){try{logger['info']('[%s][NOOP]\x20%s',_0x289724,utils[_0x07dc('0x3')](_0x34e9da[0x0],this));_0x3d1bf3['next']();}catch(_0x3a2342){logger[_0x07dc('0x4')](_0x07dc('0x5'),_0x289724,JSON[_0x07dc('0x6')](_0x3a2342));_0x3d1bf3[_0x07dc('0x7')]();}};}; \ No newline at end of file +var _0x7298=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','routing','info'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x7298,0x12f));var _0x8729=function(_0x1bbc5d,_0x265827){_0x1bbc5d=_0x1bbc5d-0x0;var _0x2f02b1=_0x7298[_0x1bbc5d];return _0x2f02b1;};'use strict';var utils=require(_0x8729('0x0'));var logger=require('../../../../config/logger')(_0x8729('0x1'));exports['consequence']=function(_0xc9c70f,_0x38bf18){return function(_0x48f2ce){try{logger[_0x8729('0x2')]('[%s][NOOP]\x20%s',_0xc9c70f,utils[_0x8729('0x3')](_0x38bf18[0x0],this));_0x48f2ce[_0x8729('0x4')]();}catch(_0x12e2d){logger[_0x8729('0x5')](_0x8729('0x6'),_0xc9c70f,JSON[_0x8729('0x7')](_0x12e2d));_0x48f2ce[_0x8729('0x8')]();}};}; \ 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 cf2220c..979667f 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 _0x8a8a=['message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','rules','end','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId'];(function(_0x54bee3,_0xbde47e){var _0x43c571=function(_0x16280a){while(--_0x16280a){_0x54bee3['push'](_0x54bee3['shift']());}};_0x43c571(++_0xbde47e);}(_0x8a8a,0x1f2));var _0xa8a8=function(_0xf2ac8a,_0x384715){_0xf2ac8a=_0xf2ac8a-0x0;var _0x1b0cfe=_0x8a8a[_0xf2ac8a];return _0x1b0cfe;};'use strict';var schema=require(_0xa8a8('0x0'));var _=require(_0xa8a8('0x1'));var util=require(_0xa8a8('0x2'));var seqqueue=require(_0xa8a8('0x3'));var moment=require(_0xa8a8('0x4'));var Redis=require('ioredis');var config=require(_0xa8a8('0x5'));var logger=require(_0xa8a8('0x6'))('routing');var strategy=require(_0xa8a8('0x7'));config[_0xa8a8('0x8')]=_[_0xa8a8('0x9')](config[_0xa8a8('0x8')],{'host':_0xa8a8('0xa'),'port':0x18eb});var io=require(_0xa8a8('0xb'))(new Redis(config[_0xa8a8('0x8')]));var attributes=['id',_0xa8a8('0xc'),_0xa8a8('0xd'),'queue',_0xa8a8('0xe'),_0xa8a8('0xf')];function emit(_0x17a06a,_0x22595c,_0x1e12f9){io['to'](_0x17a06a)[_0xa8a8('0x10')](_0x22595c,_0x1e12f9);}function emitChannelQueueInteraction(_0x3ecc68,_0x3d19fa,_0x31b069,_0x43faab,_0x59807c,_0x524a89,_0x3bcd8b,_0x4ca454){var _0x523362=_[_0xa8a8('0x11')](_0x31b069);_0x523362['queue_id']=_0x4ca454;_0x523362['queue']=_0x3d19fa;_0x523362[_0xa8a8('0xd')]=_0x43faab;_0x523362['id']=_0x59807c;if(_0x524a89){_0x3bcd8b[util[_0xa8a8('0x12')]('%sQueuesWaitingInteractions',_0x3ecc68)][_0x59807c]=_[_0xa8a8('0x13')](_0x523362,attributes);}else{delete _0x3bcd8b[util['format'](_0xa8a8('0x14'),_0x3ecc68)][_0x59807c];}emit(util['format']('%s:queue:%s',_0x3ecc68,_0x3d19fa),util['format']('%s_queue_waiting_interaction:%s',_0x3ecc68,_0x524a89?_0xa8a8('0x15'):_0xa8a8('0x16')),_[_0xa8a8('0x13')](_0x523362,attributes));}var rpc={'openchannelQueueReport':require(_0xa8a8('0x17')),'mailQueueReport':require(_0xa8a8('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa8a8('0x19')),'faxQueueReport':require(_0xa8a8('0x1a')),'whatsappQueueReport':require(_0xa8a8('0x1b'))};var queue=schema({'name':{'type':_0xa8a8('0x1c'),'required':!![],'message':_0xa8a8('0x1d')},'timeout':{'type':_0xa8a8('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x5075a1,_0x39e7d6,_0x5adb02,_0x5ca1bf){if(_0x5075a1&&_0x39e7d6&&_0x5adb02){_0x39e7d6[_0xa8a8('0x1f')]+=0x1;var _0x142cb9={'uniqueid':_0x5075a1,'from':_0x5adb02['body']?_0x5adb02[_0xa8a8('0x20')]['from']:'','joinAt':moment()[_0xa8a8('0x12')](_0xa8a8('0x21')),'ContactId':_0x5adb02[_0xa8a8('0x22')]?_0x5adb02[_0xa8a8('0x22')]['id']:null,'ListId':_0x5adb02[_0xa8a8('0x23')]?_0x5adb02[_0xa8a8('0x23')]['id']:null};_0x142cb9[_[_0xa8a8('0x24')](_0x5adb02[_0xa8a8('0x25')])+'QueueId']=_0x39e7d6['id']||null;_0x142cb9[_['upperFirst'](_0x5adb02[_0xa8a8('0x25')])+_0xa8a8('0x26')]=_0x5adb02[_0xa8a8('0x27')]?_0x5adb02[_0xa8a8('0x27')]['id']:null;_0x142cb9[_[_0xa8a8('0x24')](_0x5adb02[_0xa8a8('0x25')])+_0xa8a8('0x28')]=_0x5adb02['message']?_0x5adb02[_0xa8a8('0x29')]['id']:null;_0x142cb9[_[_0xa8a8('0x24')](_0x5adb02[_0xa8a8('0x25')])+(_0x5adb02[_0xa8a8('0x25')]!==_0xa8a8('0x2a')?_0xa8a8('0x2b'):_0xa8a8('0x2c'))]=_0x5adb02['account']?_0x5adb02[_0xa8a8('0xd')]['id']:null;logger[_0xa8a8('0x2d')](util[_0xa8a8('0x12')](_0xa8a8('0x2e'),_0x5075a1,_0x39e7d6['name']));emitChannelQueueInteraction(_0x5adb02[_0xa8a8('0x25')],_0x39e7d6['name'],_0x142cb9,_0x5adb02['account'][_0xa8a8('0x2f')],_0x5adb02[_0xa8a8('0x29')]['id'],!![],_0x5ca1bf,_0x39e7d6['id']);if(rpc[_0x5adb02[_0xa8a8('0x25')]+_0xa8a8('0x30')]){return rpc[_0x5adb02['channel']+_0xa8a8('0x30')][_0xa8a8('0x31')](_0x142cb9)[_0xa8a8('0x32')](function(_0x301a41){logger['error'](_0xa8a8('0x33'));});}}}function stopRouting(_0x48723a,_0x46285d,_0x124d3d,_0x2a3f71){if(_0x48723a&&_0x46285d){_0x46285d[_0xa8a8('0x1f')]-=0x1;var _0x377d4b={'leaveAt':moment()[_0xa8a8('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa8a8('0x12')](_0xa8a8('0x21')),'reason':'accepted'};logger[_0xa8a8('0x2d')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x48723a,_0x46285d[_0xa8a8('0x2f')]));emitChannelQueueInteraction(_0x124d3d['channel'],_0x46285d[_0xa8a8('0x2f')],_0x124d3d['body'],_0x124d3d[_0xa8a8('0xd')]['name'],_0x124d3d[_0xa8a8('0x29')]['id'],![],_0x2a3f71,_0x46285d['id']);if(rpc[_0x124d3d[_0xa8a8('0x25')]+_0xa8a8('0x30')]){return rpc[_0x124d3d[_0xa8a8('0x25')]+_0xa8a8('0x30')]['update'](_0x48723a,_0x377d4b)[_0xa8a8('0x32')](function(_0x4f12f1){logger[_0xa8a8('0x34')](_0xa8a8('0x35'));});}}}function endRouting(_0x246026,_0x1346d0,_0x32ae17,_0x2bb95d){if(_0x246026&&_0x1346d0){_0x1346d0[_0xa8a8('0x1f')]-=0x1;var _0x3c79d7={'leaveAt':moment()[_0xa8a8('0x12')](_0xa8a8('0x21')),'exitAt':moment()[_0xa8a8('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0xa8a8('0x2d')](util[_0xa8a8('0x12')](_0xa8a8('0x36'),_0x246026,_0x1346d0['name']));emitChannelQueueInteraction(_0x32ae17[_0xa8a8('0x25')],_0x1346d0[_0xa8a8('0x2f')],_0x32ae17[_0xa8a8('0x20')],_0x32ae17[_0xa8a8('0xd')][_0xa8a8('0x2f')],_0x32ae17[_0xa8a8('0x29')]['id'],![],_0x2bb95d);if(rpc[_0x32ae17[_0xa8a8('0x25')]+'QueueReport']){return rpc[_0x32ae17[_0xa8a8('0x25')]+'QueueReport'][_0xa8a8('0x37')](_0x246026,_0x3c79d7)[_0xa8a8('0x32')](function(_0x5084a2){logger[_0xa8a8('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x54eae0){return function(_0x3d69cc){return _0x3d69cc[_0xa8a8('0x2f')][_0xa8a8('0x38')]()===_0x54eae0[_0xa8a8('0x38')]();};}exports[_0xa8a8('0x39')]=function(_0x2fc489,_0x225ccf,_0x4c8369,_0x5a9bf1){return function(_0x30cb19){try{var _0x438037={'name':_0x225ccf[0x0],'timeout':_0x225ccf[0x1]};var _0x4c84a4=queue['validate'](_0x438037,{'typecast':!![]});if(_0x4c84a4[_0xa8a8('0x3a')]){logger[_0xa8a8('0x34')](_0xa8a8('0x3b'),_0x2fc489,_[_0xa8a8('0x3c')](_0x4c84a4,_0xa8a8('0x29'))[_0xa8a8('0x3d')](',\x20'));_0x30cb19['stop']();}else{var _0x2b742f=_[_0xa8a8('0x3e')](_0x4c8369[_0x5a9bf1['channel']+_0xa8a8('0x3f')],handleFindQueue(_0x438037['name']));if(_0x2b742f){startRouting(_0x2fc489,_0x2b742f,_0x5a9bf1,_0x4c8369);var _0xb57a1e=(_0x2b742f['timeout']||0xa)*0x3e8;var _0x4894b2=(_0x438037['timeout']||0x14)*0x3e8;var _0x13eb60,_0x1fc310;if(_0xb57a1e>_0x4894b2){_0x4894b2=_0xb57a1e;}var _0x33ecac=seqqueue[_0xa8a8('0x40')](_0xb57a1e);_0x33ecac['id']=_0x2fc489;_0x33ecac[_0xa8a8('0x41')]=_0xb57a1e;_0x33ecac['qtimeout']=_0x4894b2;_0x33ecac['channel']=_0x5a9bf1['channel'];_0x4c8369[_0xa8a8('0x42')][_0x2fc489]['on'](_0xa8a8('0x43'),function(){logger[_0xa8a8('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2fc489);stopRouting(_0x2fc489,_0x2b742f,_0x5a9bf1,_0x4c8369);clearTimeout(_0x13eb60);_0x13eb60=undefined;_0x33ecac['close'](!![]);if(_0x4c8369['rules'][_0x2fc489]){delete _0x4c8369[_0xa8a8('0x42')][_0x2fc489];}_0x30cb19[_0xa8a8('0x44')]();});_0x4c8369[_0xa8a8('0x42')][_0x2fc489]['on'](_0xa8a8('0x45'),function(){if(_0x4c8369[_0xa8a8('0x42')][_0x2fc489]){delete _0x4c8369[_0xa8a8('0x42')][_0x2fc489];}});_0x13eb60=setTimeout(function(){logger[_0xa8a8('0x2d')](_0xa8a8('0x46'),_0x2fc489);endRouting(_0x2fc489,_0x2b742f,_0x5a9bf1,_0x4c8369);clearTimeout(_0x13eb60);_0x33ecac[_0xa8a8('0x47')](!![]);_0x30cb19[_0xa8a8('0x48')]();},_0x4894b2);switch(_0x2b742f[_0xa8a8('0x49')]){case _0xa8a8('0x4a'):strategy[_0xa8a8('0x4a')](_0x33ecac,_0x2b742f,_0x4c8369,_0x5a9bf1);break;default:strategy[_0xa8a8('0x4b')](_0x33ecac,_0x2b742f,_0x4c8369,_0x5a9bf1);}}else{logger[_0xa8a8('0x34')](_0xa8a8('0x4c'),_0x2fc489,_0x438037[_0xa8a8('0x2f')]);_0x30cb19['stop']();}}}catch(_0x1f07ec){console['log'](_0x1f07ec);logger['error'](_0xa8a8('0x3b'),_0x2fc489,_0x1f07ec['stack']);_0x30cb19[_0xa8a8('0x44')]();}};}; \ No newline at end of file +var _0x110d=['format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id'];(function(_0x432c4e,_0x50be8f){var _0x9a437e=function(_0x4c1545){while(--_0x4c1545){_0x432c4e['push'](_0x432c4e['shift']());}};_0x9a437e(++_0x50be8f);}(_0x110d,0x17d));var _0xd110=function(_0xeaba4b,_0x1eab4b){_0xeaba4b=_0xeaba4b-0x0;var _0x32f4fd=_0x110d[_0xeaba4b];return _0x32f4fd;};'use strict';var schema=require(_0xd110('0x0'));var _=require(_0xd110('0x1'));var util=require(_0xd110('0x2'));var seqqueue=require(_0xd110('0x3'));var moment=require(_0xd110('0x4'));var Redis=require('ioredis');var config=require(_0xd110('0x5'));var logger=require('../../../../config/logger')(_0xd110('0x6'));var strategy=require(_0xd110('0x7'));config[_0xd110('0x8')]=_[_0xd110('0x9')](config[_0xd110('0x8')],{'host':_0xd110('0xa'),'port':0x18eb});var io=require(_0xd110('0xb'))(new Redis(config[_0xd110('0x8')]));var attributes=['id','queue_id',_0xd110('0xc'),_0xd110('0xd'),_0xd110('0xe'),_0xd110('0xf')];function emit(_0x393add,_0x2069e9,_0x14b4df){io['to'](_0x393add)[_0xd110('0x10')](_0x2069e9,_0x14b4df);}function emitChannelQueueInteraction(_0xb2e2f8,_0x347ed3,_0x449b26,_0x5e89be,_0xfa9ecf,_0x1b2911,_0x2a5a07,_0x140f78){var _0x56c820=_[_0xd110('0x11')](_0x449b26);_0x56c820[_0xd110('0x12')]=_0x140f78;_0x56c820[_0xd110('0xd')]=_0x347ed3;_0x56c820[_0xd110('0xc')]=_0x5e89be;_0x56c820['id']=_0xfa9ecf;if(_0x1b2911){_0x2a5a07[util[_0xd110('0x13')]('%sQueuesWaitingInteractions',_0xb2e2f8)][_0xfa9ecf]=_[_0xd110('0x14')](_0x56c820,attributes);}else{delete _0x2a5a07[util['format'](_0xd110('0x15'),_0xb2e2f8)][_0xfa9ecf];}emit(util[_0xd110('0x13')](_0xd110('0x16'),_0xb2e2f8,_0x347ed3),util[_0xd110('0x13')](_0xd110('0x17'),_0xb2e2f8,_0x1b2911?_0xd110('0x18'):_0xd110('0x19')),_[_0xd110('0x14')](_0x56c820,attributes));}var rpc={'openchannelQueueReport':require(_0xd110('0x1a')),'mailQueueReport':require(_0xd110('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xd110('0x1c'),'required':!![],'message':_0xd110('0x1d')},'timeout':{'type':_0xd110('0x1e'),'message':_0xd110('0x1f')}});function startRouting(_0x4731d3,_0x23c4ea,_0x1244c1,_0xad6318){if(_0x4731d3&&_0x23c4ea&&_0x1244c1){_0x23c4ea[_0xd110('0x20')]+=0x1;var _0x5ac53f={'uniqueid':_0x4731d3,'from':_0x1244c1[_0xd110('0x21')]?_0x1244c1[_0xd110('0x21')][_0xd110('0xe')]:'','joinAt':moment()['format'](_0xd110('0x22')),'ContactId':_0x1244c1[_0xd110('0x23')]?_0x1244c1['contact']['id']:null,'ListId':_0x1244c1['list']?_0x1244c1[_0xd110('0x24')]['id']:null};_0x5ac53f[_[_0xd110('0x25')](_0x1244c1[_0xd110('0x26')])+_0xd110('0x27')]=_0x23c4ea['id']||null;_0x5ac53f[_[_0xd110('0x25')](_0x1244c1[_0xd110('0x26')])+_0xd110('0x28')]=_0x1244c1[_0xd110('0x29')]?_0x1244c1['interaction']['id']:null;_0x5ac53f[_[_0xd110('0x25')](_0x1244c1[_0xd110('0x26')])+_0xd110('0x2a')]=_0x1244c1[_0xd110('0x2b')]?_0x1244c1[_0xd110('0x2b')]['id']:null;_0x5ac53f[_[_0xd110('0x25')](_0x1244c1['channel'])+(_0x1244c1['channel']!==_0xd110('0x2c')?_0xd110('0x2d'):'WebsiteId')]=_0x1244c1['account']?_0x1244c1[_0xd110('0xc')]['id']:null;logger[_0xd110('0x2e')](util['format'](_0xd110('0x2f'),_0x4731d3,_0x23c4ea[_0xd110('0x30')]));emitChannelQueueInteraction(_0x1244c1[_0xd110('0x26')],_0x23c4ea[_0xd110('0x30')],_0x5ac53f,_0x1244c1['account'][_0xd110('0x30')],_0x1244c1[_0xd110('0x2b')]['id'],!![],_0xad6318,_0x23c4ea['id']);if(rpc[_0x1244c1['channel']+_0xd110('0x31')]){return rpc[_0x1244c1[_0xd110('0x26')]+'QueueReport'][_0xd110('0x32')](_0x5ac53f)[_0xd110('0x33')](function(_0x8a4424){logger[_0xd110('0x34')](_0xd110('0x35'));});}}}function stopRouting(_0x112086,_0x2fdeda,_0xf76a9c,_0x391c09){if(_0x112086&&_0x2fdeda){_0x2fdeda[_0xd110('0x20')]-=0x1;var _0x303966={'leaveAt':moment()[_0xd110('0x13')](_0xd110('0x22')),'acceptAt':moment()[_0xd110('0x13')](_0xd110('0x22')),'reason':_0xd110('0x36')};logger[_0xd110('0x2e')](util[_0xd110('0x13')](_0xd110('0x37'),_0x112086,_0x2fdeda['name']));emitChannelQueueInteraction(_0xf76a9c[_0xd110('0x26')],_0x2fdeda[_0xd110('0x30')],_0xf76a9c['body'],_0xf76a9c[_0xd110('0xc')][_0xd110('0x30')],_0xf76a9c[_0xd110('0x2b')]['id'],![],_0x391c09,_0x2fdeda['id']);if(rpc[_0xf76a9c[_0xd110('0x26')]+_0xd110('0x31')]){return rpc[_0xf76a9c['channel']+'QueueReport'][_0xd110('0x38')](_0x112086,_0x303966)[_0xd110('0x33')](function(_0x2c673a){logger[_0xd110('0x34')](_0xd110('0x39'));});}}}function endRouting(_0x35795f,_0x1d7842,_0x14e6ca,_0xc9814){if(_0x35795f&&_0x1d7842){_0x1d7842['waiting']-=0x1;var _0x3a9942={'leaveAt':moment()[_0xd110('0x13')](_0xd110('0x22')),'exitAt':moment()[_0xd110('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd110('0x3a')};logger[_0xd110('0x2e')](util[_0xd110('0x13')](_0xd110('0x3b'),_0x35795f,_0x1d7842[_0xd110('0x30')]));emitChannelQueueInteraction(_0x14e6ca[_0xd110('0x26')],_0x1d7842['name'],_0x14e6ca[_0xd110('0x21')],_0x14e6ca[_0xd110('0xc')][_0xd110('0x30')],_0x14e6ca[_0xd110('0x2b')]['id'],![],_0xc9814);if(rpc[_0x14e6ca[_0xd110('0x26')]+_0xd110('0x31')]){return rpc[_0x14e6ca[_0xd110('0x26')]+_0xd110('0x31')][_0xd110('0x38')](_0x35795f,_0x3a9942)[_0xd110('0x33')](function(_0x501d37){logger[_0xd110('0x34')](_0xd110('0x39'));});}}}function handleFindQueue(_0x1f4d56){return function(_0x1c9e4e){return _0x1c9e4e[_0xd110('0x30')][_0xd110('0x3c')]()===_0x1f4d56[_0xd110('0x3c')]();};}exports[_0xd110('0x3d')]=function(_0x116d35,_0x71142b,_0x325a88,_0x214a60){return function(_0x5d739e){try{var _0x299858={'name':_0x71142b[0x0],'timeout':_0x71142b[0x1]};var _0x5a3a0b=queue[_0xd110('0x0')](_0x299858,{'typecast':!![]});if(_0x5a3a0b[_0xd110('0x3e')]){logger[_0xd110('0x34')](_0xd110('0x3f'),_0x116d35,_[_0xd110('0x40')](_0x5a3a0b,'message')['join'](',\x20'));_0x5d739e[_0xd110('0x41')]();}else{var _0x5c7ed3=_[_0xd110('0x42')](_0x325a88[_0x214a60[_0xd110('0x26')]+'Queues'],handleFindQueue(_0x299858[_0xd110('0x30')]));if(_0x5c7ed3){startRouting(_0x116d35,_0x5c7ed3,_0x214a60,_0x325a88);var _0x45a53d=(_0x5c7ed3[_0xd110('0x3a')]||0xa)*0x3e8;var _0x1e4b61=(_0x299858[_0xd110('0x3a')]||0x14)*0x3e8;var _0x8b4ecf,_0xd31b51;if(_0x45a53d>_0x1e4b61){_0x1e4b61=_0x45a53d;}var _0x5fd166=seqqueue['createQueue'](_0x45a53d);_0x5fd166['id']=_0x116d35;_0x5fd166[_0xd110('0x43')]=_0x45a53d;_0x5fd166[_0xd110('0x44')]=_0x1e4b61;_0x5fd166['channel']=_0x214a60[_0xd110('0x26')];_0x325a88[_0xd110('0x45')][_0x116d35]['on']('end',function(){logger['info'](_0xd110('0x46'),_0x116d35);stopRouting(_0x116d35,_0x5c7ed3,_0x214a60,_0x325a88);clearTimeout(_0x8b4ecf);_0x8b4ecf=undefined;_0x5fd166[_0xd110('0x47')](!![]);if(_0x325a88[_0xd110('0x45')][_0x116d35]){delete _0x325a88[_0xd110('0x45')][_0x116d35];}_0x5d739e['stop']();});_0x325a88['rules'][_0x116d35]['on'](_0xd110('0x48'),function(){if(_0x325a88[_0xd110('0x45')][_0x116d35]){delete _0x325a88['rules'][_0x116d35];}});_0x8b4ecf=setTimeout(function(){logger[_0xd110('0x2e')](_0xd110('0x49'),_0x116d35);endRouting(_0x116d35,_0x5c7ed3,_0x214a60,_0x325a88);clearTimeout(_0x8b4ecf);_0x5fd166[_0xd110('0x47')](!![]);_0x5d739e['next']();},_0x1e4b61);switch(_0x5c7ed3[_0xd110('0x4a')]){case _0xd110('0x4b'):strategy[_0xd110('0x4b')](_0x5fd166,_0x5c7ed3,_0x325a88,_0x214a60);break;default:strategy[_0xd110('0x4c')](_0x5fd166,_0x5c7ed3,_0x325a88,_0x214a60);}}else{logger[_0xd110('0x34')](_0xd110('0x4d'),_0x116d35,_0x299858['name']);_0x5d739e[_0xd110('0x41')]();}}}catch(_0x46c91b){console[_0xd110('0x4e')](_0x46c91b);logger[_0xd110('0x34')](_0xd110('0x3f'),_0x116d35,_0x46c91b[_0xd110('0x4f')]);_0x5d739e[_0xd110('0x41')]();}};}; \ 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 87ba6a4..159b0e2 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 _0xe023=['push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime'];(function(_0x46a7ab,_0x39f289){var _0x1b8196=function(_0x27e6fa){while(--_0x27e6fa){_0x46a7ab['push'](_0x46a7ab['shift']());}};_0x1b8196(++_0x39f289);}(_0xe023,0x18b));var _0x3e02=function(_0x3d8a9b,_0xcb414f){_0x3d8a9b=_0x3d8a9b-0x0;var _0x494986=_0xe023[_0x3d8a9b];return _0x494986;};'use strict';var _=require('lodash');var uuid=require(_0x3e02('0x0'));var util=require(_0x3e02('0x1'));var logger=require(_0x3e02('0x2'))(_0x3e02('0x3'));var Agent=function(_0x57ebe9,_0x2920bd,_0x2d39bc,_0x13dfb1){this[_0x3e02('0x4')]=uuid['v4']();this[_0x3e02('0x5')]=_0x57ebe9;this[_0x3e02('0x6')]=_0x2920bd;this[_0x3e02('0x7')]=_0x2d39bc;this[_0x3e02('0x3')]=_0x13dfb1;this[_0x3e02('0x5')][_0x3e02('0x8')](this[_0x3e02('0x9')][_0x3e02('0xa')](this),this['handleTimeout']['bind'](this));this[_0x3e02('0x5')]['on'](_0x3e02('0xb'),this[_0x3e02('0xc')][_0x3e02('0xa')](this));this[_0x3e02('0x5')]['on'](_0x3e02('0xd'),this[_0x3e02('0xe')][_0x3e02('0xa')](this));};Agent[_0x3e02('0xf')][_0x3e02('0x8')]=function(){this[_0x3e02('0x5')]['push'](this[_0x3e02('0x9')][_0x3e02('0xa')](this),this[_0x3e02('0xc')][_0x3e02('0xa')](this));};Agent[_0x3e02('0xf')][_0x3e02('0xe')]=function(){this[_0x3e02('0xc')](!![]);};Agent[_0x3e02('0xf')]['handleRun']=function(_0x397293){logger[_0x3e02('0x10')](_0x3e02('0x11'),this['squeue']['id'],this['agent']['id']);if(_[_0x3e02('0x12')](this[_0x3e02('0x7')][_0x3e02('0x13')][this[_0x3e02('0x6')]['id']])){logger[_0x3e02('0x10')](_0x3e02('0x14'),this['squeue']['id'],this[_0x3e02('0x6')]['id']);setTimeout(this['push'][_0x3e02('0xa')](this),0x3e8);}else{if(this[_0x3e02('0x3')][_0x3e02('0x15')]||util[_0x3e02('0x16')](this[_0x3e02('0x5')]['id'],this[_0x3e02('0x7')]['agents'][this['agent']['id']],this[_0x3e02('0x5')][_0x3e02('0x17')],![])){this[_0x3e02('0x7')][_0x3e02('0x13')][this['agent']['id']]['busy']=!![];this[_0x3e02('0x7')]['agents'][this[_0x3e02('0x6')]['id']][_0x3e02('0x18')]=undefined;util['showNotification'](this[_0x3e02('0x4')],this[_0x3e02('0x5')]['id'],this['realtime'][_0x3e02('0x13')][this[_0x3e02('0x6')]['id']],null,this[_0x3e02('0x3')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0x3e02('0x13')][this[_0x3e02('0x6')]['id']],'RINGING'+(this['routing'][_0x3e02('0x15')]?_0x3e02('0x19'):''));}else{logger[_0x3e02('0x10')](_0x3e02('0x1a'),this['squeue']['id'],this[_0x3e02('0x6')]['id']);setTimeout(this[_0x3e02('0x8')][_0x3e02('0xa')](this),0x3e8);}}};Agent[_0x3e02('0xf')]['handleTimeout']=function(_0x4e5726){if(_['isNil'](this[_0x3e02('0x7')][_0x3e02('0x13')][this['agent']['id']])){return logger[_0x3e02('0x10')](_0x3e02('0x14'),this[_0x3e02('0x5')]['id'],this[_0x3e02('0x6')]['id']);}else{logger[_0x3e02('0x10')](_0x3e02('0x1b'),this[_0x3e02('0x5')]['id'],this['agent']['id']);util[_0x3e02('0x1c')](this['notificationId'],this[_0x3e02('0x5')]['id'],this[_0x3e02('0x7')][_0x3e02('0x13')][this[_0x3e02('0x6')]['id']],null,this[_0x3e02('0x3')]);this['realtime'][_0x3e02('0x13')][this['agent']['id']][_0x3e02('0x1d')]=![];this['realtime']['agents'][this[_0x3e02('0x6')]['id']][_0x3e02('0x18')]=undefined;util['writeLog'](this[_0x3e02('0x5')]['id'],this[_0x3e02('0x7')][_0x3e02('0x13')][this[_0x3e02('0x6')]['id']],_0x4e5726?_0x3e02('0x1e'):'TIMEOUT');}if(!_0x4e5726){setTimeout(this[_0x3e02('0x8')][_0x3e02('0xa')](this),0x3e8);}};function agent(_0xdcf4b1,_0x1ccb18,_0x51daa4,_0x1df8bb){return new Agent(_0xdcf4b1,_0x1ccb18,_0x51daa4,_0x1df8bb);}module['exports']=agent; \ No newline at end of file +var _0x970d=['uuid','../../../../../config/logger','notificationId','realtime','handleRun','bind','handleTimeout','squeue','timeout','drained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','lodash'];(function(_0x2c3f70,_0x2793f9){var _0x43d975=function(_0x598b00){while(--_0x598b00){_0x2c3f70['push'](_0x2c3f70['shift']());}};_0x43d975(++_0x2793f9);}(_0x970d,0xe6));var _0xd970=function(_0x4074d5,_0xa57194){_0x4074d5=_0x4074d5-0x0;var _0x502cfe=_0x970d[_0x4074d5];return _0x502cfe;};'use strict';var _=require(_0xd970('0x0'));var uuid=require(_0xd970('0x1'));var util=require('./util');var logger=require(_0xd970('0x2'))('routing');var Agent=function(_0x3af16c,_0x3951b9,_0x1ebd92,_0x3429cc){this[_0xd970('0x3')]=uuid['v4']();this['squeue']=_0x3af16c;this['agent']=_0x3951b9;this[_0xd970('0x4')]=_0x1ebd92;this['routing']=_0x3429cc;this['squeue']['push'](this[_0xd970('0x5')][_0xd970('0x6')](this),this[_0xd970('0x7')][_0xd970('0x6')](this));this[_0xd970('0x8')]['on'](_0xd970('0x9'),this[_0xd970('0x7')][_0xd970('0x6')](this));this[_0xd970('0x8')]['on'](_0xd970('0xa'),this['handleDrained'][_0xd970('0x6')](this));};Agent[_0xd970('0xb')][_0xd970('0xc')]=function(){this[_0xd970('0x8')][_0xd970('0xc')](this['handleRun'][_0xd970('0x6')](this),this['handleTimeout']['bind'](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype']['handleRun']=function(_0x1cf6e8){logger[_0xd970('0xd')](_0xd970('0xe'),this['squeue']['id'],this[_0xd970('0xf')]['id']);if(_[_0xd970('0x10')](this[_0xd970('0x4')][_0xd970('0x11')][this['agent']['id']])){logger[_0xd970('0xd')](_0xd970('0x12'),this[_0xd970('0x8')]['id'],this[_0xd970('0xf')]['id']);setTimeout(this[_0xd970('0xc')][_0xd970('0x6')](this),0x3e8);}else{if(this[_0xd970('0x13')]['forcedOwnership']||util[_0xd970('0x14')](this['squeue']['id'],this[_0xd970('0x4')]['agents'][this[_0xd970('0xf')]['id']],this[_0xd970('0x8')][_0xd970('0x15')],![])){this[_0xd970('0x4')][_0xd970('0x11')][this['agent']['id']][_0xd970('0x16')]=!![];this[_0xd970('0x4')][_0xd970('0x11')][this[_0xd970('0xf')]['id']][_0xd970('0x17')]=undefined;util[_0xd970('0x18')](this[_0xd970('0x3')],this['squeue']['id'],this[_0xd970('0x4')][_0xd970('0x11')][this['agent']['id']],null,this[_0xd970('0x13')]);util['writeLog'](this[_0xd970('0x8')]['id'],this[_0xd970('0x4')][_0xd970('0x11')][this[_0xd970('0xf')]['id']],_0xd970('0x19')+(this[_0xd970('0x13')][_0xd970('0x1a')]?':FORCED':''));}else{logger['info'](_0xd970('0x1b'),this[_0xd970('0x8')]['id'],this['agent']['id']);setTimeout(this[_0xd970('0xc')][_0xd970('0x6')](this),0x3e8);}}};Agent[_0xd970('0xb')][_0xd970('0x7')]=function(_0x1ba9a0){if(_[_0xd970('0x10')](this[_0xd970('0x4')][_0xd970('0x11')][this[_0xd970('0xf')]['id']])){return logger['info'](_0xd970('0x12'),this[_0xd970('0x8')]['id'],this[_0xd970('0xf')]['id']);}else{logger['info'](_0xd970('0x1c'),this[_0xd970('0x8')]['id'],this[_0xd970('0xf')]['id']);util['hideNotification'](this[_0xd970('0x3')],this[_0xd970('0x8')]['id'],this['realtime'][_0xd970('0x11')][this[_0xd970('0xf')]['id']],null,this[_0xd970('0x13')]);this[_0xd970('0x4')][_0xd970('0x11')][this[_0xd970('0xf')]['id']][_0xd970('0x16')]=![];this['realtime'][_0xd970('0x11')][this[_0xd970('0xf')]['id']][_0xd970('0x17')]=undefined;util[_0xd970('0x1d')](this[_0xd970('0x8')]['id'],this[_0xd970('0x4')]['agents'][this[_0xd970('0xf')]['id']],_0x1ba9a0?_0xd970('0x1e'):_0xd970('0x1f'));}if(!_0x1ba9a0){setTimeout(this['push'][_0xd970('0x6')](this),0x3e8);}};function agent(_0x351f18,_0x10e0a6,_0x5570f1,_0x101963){return new Agent(_0x351f18,_0x10e0a6,_0x5570f1,_0x101963);}module[_0xd970('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index fa9dc02..78a534f 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 _0x3d6d=['push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','queue','Agents','length','realtime','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','writeLog','RINGING','busyQueue','showNotification','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','busy','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x3d6d[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0xd3d6('0x0'));var uuid=require(_0xd3d6('0x1'));var util=require(_0xd3d6('0x2'));var logger=require(_0xd3d6('0x3'))(_0xd3d6('0x4'));var Beepall=function(_0x1e1915,_0x366f41,_0x15e35a,_0x297bd6){this[_0xd3d6('0x5')]=uuid['v4']();this[_0xd3d6('0x6')]=_0x1e1915;this['queue']=_0x366f41;this['realtime']=_0x15e35a;this[_0xd3d6('0x4')]=_0x297bd6;this[_0xd3d6('0x6')][_0xd3d6('0x7')](this[_0xd3d6('0x8')][_0xd3d6('0x9')](this),this['handleTimeout'][_0xd3d6('0x9')](this));this[_0xd3d6('0x6')]['on'](_0xd3d6('0xa'),this[_0xd3d6('0xb')]['bind'](this));this['squeue']['on'](_0xd3d6('0xc'),this[_0xd3d6('0xd')][_0xd3d6('0x9')](this));};Beepall[_0xd3d6('0xe')][_0xd3d6('0x7')]=function(){this[_0xd3d6('0x6')][_0xd3d6('0x7')](this[_0xd3d6('0x8')][_0xd3d6('0x9')](this),this['handleTimeout'][_0xd3d6('0x9')](this));};Beepall[_0xd3d6('0xe')][_0xd3d6('0xd')]=function(_0x4e5d79){this[_0xd3d6('0xb')](!![]);};Beepall[_0xd3d6('0xe')][_0xd3d6('0x8')]=function(_0x5e21e7){var _0x1fcaee=!![];if(!_[_0xd3d6('0xf')](this[_0xd3d6('0x10')])&&!_[_0xd3d6('0xf')](this[_0xd3d6('0x10')][_0xd3d6('0x11')])&&this[_0xd3d6('0x10')][_0xd3d6('0x11')][_0xd3d6('0x12')]>0x0){for(var _0x5a35d7=0x0,_0xaee293;_0x5a35d70x0){for(var _0x1ec445=0x0,_0x1d3e4a;_0x1ec4450x0&&_0x47f71a[_0x32a85c+_0xb5fa('0x24')]>=_0x47f71a[_0x32a85c+'Capacity']){writeLog(_0x283a56,_0x47f71a,_0x32a85c['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x28a350,_0x460b54,_0x12c0d4,_0x2bdf50,_0x534884){return sendNotification(!![],_0x28a350,_0x460b54,_0x12c0d4,_0x2bdf50,_0x534884);};exports[_0xb5fa('0x25')]=function(_0x358549,_0x353314,_0x409af9,_0x2a5690,_0x142bfa){return sendNotification(![],_0x358549,_0x353314,_0x409af9,_0x2a5690,_0x142bfa);};exports[_0xb5fa('0x26')]=writeLog; \ No newline at end of file +var _0x0adf=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','notificationSound','account','body','queue','msg','notificationTemplate','[%s][QUEUE]\x20%s','save','remove'];(function(_0x371efd,_0x42ecc9){var _0x138c51=function(_0x27c776){while(--_0x27c776){_0x371efd['push'](_0x371efd['shift']());}};_0x138c51(++_0x42ecc9);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x16c192,_0xe74929){_0x16c192=_0x16c192-0x0;var _0x51b52c=_0x0adf[_0x16c192];return _0x51b52c;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var utils=require(_0xf0ad('0x2'));var Mustache=require('mustache');var Redis=require(_0xf0ad('0x3'));var config=require(_0xf0ad('0x4'));var logger=require(_0xf0ad('0x5'))(_0xf0ad('0x6'));config[_0xf0ad('0x7')]=_[_0xf0ad('0x8')](config[_0xf0ad('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf0ad('0x9'))(new Redis(config['redis']));function emit(_0x2eca0e,_0x44cf37,_0x170574){io['to'](_0x2eca0e)[_0xf0ad('0xa')](_0x44cf37,_0x170574);}function sendNotification(_0xa9a315,_0x3bc706,_0xe65b20,_0x5bdf69,_0x2ab4eb,_0x53c81a){io['to'](util[_0xf0ad('0xb')](_0xf0ad('0xc'),_0x5bdf69[_0xf0ad('0xd')]))[_0xf0ad('0xa')](_0xf0ad('0xe'),_0x5bdf69);var _0x4f2b79=_0x53c81a||{};var _0x59b1a5=_0xe65b20[_0xf0ad('0xf')]('.');var _0x19892c={'uniqueid':_0x3bc706,'channel':_0x59b1a5[0x0],'id':_0x59b1a5[0x1],'title':_0x59b1a5[0x0]+_0xf0ad('0x10'),'interactionId':_0x59b1a5[0x2],'queue':_0x2ab4eb?_0x2ab4eb[_0xf0ad('0xd')]:null,'sound':_0x4f2b79['account'][_0xf0ad('0x11')],'shake':_0x4f2b79[_0xf0ad('0x12')]['notificationShake']};try{if(!_0x4f2b79['body']){_0x4f2b79['body']={};}if(_0x2ab4eb){_0x4f2b79[_0xf0ad('0x13')]['queue']=_0x2ab4eb;}else if(_0x4f2b79[_0xf0ad('0x13')][_0xf0ad('0x14')]){delete _0x4f2b79[_0xf0ad('0x13')][_0xf0ad('0x14')];}_0x19892c[_0xf0ad('0x15')]=utils['getMustacheRender'](_0x4f2b79[_0xf0ad('0x12')][_0xf0ad('0x16')],_0x4f2b79);}catch(_0x1b00f1){_0x19892c[_0xf0ad('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xf0ad('0xb')](_0xf0ad('0x17'),_0x3bc706,_0x1b00f1['message']));}io['to'](util[_0xf0ad('0xb')](_0xf0ad('0xc'),_0x5bdf69[_0xf0ad('0xd')]))[_0xf0ad('0xa')](util['format']('notification:%s',_0xa9a315?_0xf0ad('0x18'):_0xf0ad('0x19')),_0x19892c);}function writeLog(_0x37b968,_0x20c5f3,_0x2ac8ba){return logger[_0xf0ad('0x1a')](util['format'](_0xf0ad('0x1b'),_0x37b968,_0x20c5f3[_0xf0ad('0xd')],_0x2ac8ba));}exports[_0xf0ad('0x1c')]=function(_0x3ece1e,_0x29d647,_0x88b47b,_0xb91769){if(_0x29d647[_0xf0ad('0x1d')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x1e'));return![];}if(!_0x29d647[_0xf0ad('0x1f')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x20'));return![];}if(_0x29d647[_0x88b47b+_0xf0ad('0x21')]){writeLog(_0x3ece1e,_0x29d647,_0xf0ad('0x22'));return![];}if(_0xb91769&&_0x29d647[_0xf0ad('0x23')](_0x88b47b+_0xf0ad('0x24'))&&_0x29d647['hasOwnProperty'](_0x88b47b+_0xf0ad('0x25'))){if(_0x29d647[_0x88b47b+_0xf0ad('0x24')]>0x0&&_0x29d647[_0x88b47b+_0xf0ad('0x25')]>=_0x29d647[_0x88b47b+_0xf0ad('0x24')]){writeLog(_0x3ece1e,_0x29d647,_0x88b47b[_0xf0ad('0x26')]()+_0xf0ad('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x2cbe00,_0x19a32a,_0x2b62,_0x1e60b1,_0x1b6880){return sendNotification(!![],_0x2cbe00,_0x19a32a,_0x2b62,_0x1e60b1,_0x1b6880);};exports[_0xf0ad('0x28')]=function(_0x267b7a,_0x1bee71,_0x2386e8,_0x39c46c,_0x2d1b2f){return sendNotification(![],_0x267b7a,_0x1bee71,_0x2386e8,_0x39c46c,_0x2d1b2f);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 2135f88..aa68b5d 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 _0x0ae0=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ae0,0x194));var _0x00ae=function(_0xe91e14,_0x34f258){_0xe91e14=_0xe91e14-0x0;var _0x43e482=_0x0ae0[_0xe91e14];return _0x43e482;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x00ae('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x00ae('0x1'));var system=schema({'command':{'type':_0x00ae('0x2'),'required':!![],'message':_0x00ae('0x3')}});exports[_0x00ae('0x4')]=function(_0x2a4250,_0x489d98){return function(_0x5aa5bc){try{var _0x41bd86={'command':_0x489d98[0x0]};var _0xdb6a60=system[_0x00ae('0x5')](_0x41bd86,{'typecast':!![]});if(_0xdb6a60['length']){logger[_0x00ae('0x6')](_0x00ae('0x7'),_0x2a4250,_[_0x00ae('0x8')](_0xdb6a60,_0x00ae('0x9'))[_0x00ae('0xa')](',\x20'));logger[_0x00ae('0xb')](_0x00ae('0xc'),_0x2a4250);_0x5aa5bc[_0x00ae('0xd')]();}else{var _0x1d40d3=this;var _0x47b0f4=utils[_0x00ae('0xe')](_0x489d98[0x0],this);logger['info'](_0x00ae('0xf'),_0x2a4250,_0x47b0f4);sh[_0x00ae('0x10')](_['trim'](_0x47b0f4),function(_0x3af9d1,_0x159599){logger['info'](_0x00ae('0x11'),_0x2a4250,_0x3af9d1);if(_0x3af9d1==0x0){var _0x55760e=_0x159599[_0x00ae('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x00ae('0x13')](_0x489d98[0x1])||_[_0x00ae('0x14')](_0x489d98[0x1])){logger[_0x00ae('0xb')](_0x00ae('0x15'),_0x2a4250);_0x1d40d3[_0x00ae('0x16')][_0x489d98[0x1]]=_0x55760e;}else{logger[_0x00ae('0xb')](_0x00ae('0x17'),_0x2a4250,_0x489d98[0x1],_0x55760e);_0x1d40d3[_0x00ae('0x16')][_0x489d98[0x1]]=_0x55760e;}}_0x5aa5bc[_0x00ae('0xd')]();});}}catch(_0x168ba3){logger[_0x00ae('0x6')](_0x00ae('0x7'),_0x2a4250,_[_0x00ae('0x18')](_0x168ba3)?JSON['stringify'](_0x168ba3):_0x168ba3);logger[_0x00ae('0xb')](_0x00ae('0xc'),_0x2a4250);_0x5aa5bc[_0x00ae('0xd')]();}};}; \ No newline at end of file +var _0x48fb=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0x48fb,0xad));var _0xb48f=function(_0x272dea,_0x5d3830){_0x272dea=_0x272dea-0x0;var _0xc40c46=_0x48fb[_0x272dea];return _0xc40c46;};'use strict';var schema=require(_0xb48f('0x0'));var sh=require(_0xb48f('0x1'));var _=require(_0xb48f('0x2'));var utils=require(_0xb48f('0x3'));var logger=require(_0xb48f('0x4'))(_0xb48f('0x5'));var system=schema({'command':{'type':_0xb48f('0x6'),'required':!![],'message':_0xb48f('0x7')}});exports['consequence']=function(_0x4f9ab9,_0x19282c){return function(_0x442695){try{var _0x540c82={'command':_0x19282c[0x0]};var _0x1a1c22=system['validate'](_0x540c82,{'typecast':!![]});if(_0x1a1c22[_0xb48f('0x8')]){logger[_0xb48f('0x9')]('[%s][SYSTEM]\x20%s',_0x4f9ab9,_[_0xb48f('0xa')](_0x1a1c22,'message')[_0xb48f('0xb')](',\x20'));logger['info'](_0xb48f('0xc'),_0x4f9ab9);_0x442695[_0xb48f('0xd')]();}else{var _0x4c3995=this;var _0x290115=utils[_0xb48f('0xe')](_0x19282c[0x0],this);logger[_0xb48f('0xf')](_0xb48f('0x10'),_0x4f9ab9,_0x290115);sh[_0xb48f('0x11')](_[_0xb48f('0x12')](_0x290115),function(_0x327f11,_0x4c992c){logger['info'](_0xb48f('0x13'),_0x4f9ab9,_0x327f11);if(_0x327f11==0x0){var _0x33f29a=_0x4c992c[_0xb48f('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xb48f('0x15')](_0x19282c[0x1])||_[_0xb48f('0x16')](_0x19282c[0x1])){logger[_0xb48f('0xf')](_0xb48f('0x17'),_0x4f9ab9);_0x4c3995[_0xb48f('0x18')][_0x19282c[0x1]]=_0x33f29a;}else{logger['info'](_0xb48f('0x19'),_0x4f9ab9,_0x19282c[0x1],_0x33f29a);_0x4c3995['body'][_0x19282c[0x1]]=_0x33f29a;}}_0x442695[_0xb48f('0xd')]();});}}catch(_0x221411){logger[_0xb48f('0x9')]('[%s][SYSTEM]\x20%s',_0x4f9ab9,_[_0xb48f('0x1a')](_0x221411)?JSON[_0xb48f('0x1b')](_0x221411):_0x221411);logger[_0xb48f('0xf')](_0xb48f('0xc'),_0x4f9ab9);_0x442695[_0xb48f('0xd')]();}};}; \ 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 700832e..f811eba 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 _0xcbee=['catch','error','[%s][TAG]\x20%s','isObject','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x4ff4e8,_0x355601){var _0xb3b8dc=function(_0x5955e0){while(--_0x5955e0){_0x4ff4e8['push'](_0x4ff4e8['shift']());}};_0xb3b8dc(++_0x355601);}(_0xcbee,0x124));var _0xecbe=function(_0x399f20,_0x2febac){_0x399f20=_0x399f20-0x0;var _0x356848=_0xcbee[_0x399f20];return _0x356848;};'use strict';var schema=require(_0xecbe('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xecbe('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xecbe('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xecbe('0x3')),'whatsappInteraction':require(_0xecbe('0x4'))};var logger=require(_0xecbe('0x5'))('routing');var tag=schema({'tag':{'type':_0xecbe('0x6'),'required':!![],'message':_0xecbe('0x7')}});exports[_0xecbe('0x8')]=function(_0x516adb,_0x5136a5,_0x3f1b12,_0x407939){return function(_0x58b99a){try{var _0x2fd666={'tag':_0x5136a5[0x0]};var _0x2a6803=tag[_0xecbe('0x0')](_0x2fd666,{'typecast':!![]});if(_0x2a6803[_0xecbe('0x9')]){logger['error']('[%s][TAG]\x20%s',_0x516adb,_[_0xecbe('0xa')](_0x2a6803,_0xecbe('0xb'))[_0xecbe('0xc')](',\x20'));logger[_0xecbe('0xd')](_0xecbe('0xe'),_0x516adb);_0x58b99a[_0xecbe('0xf')]();}else{var _0xa226ef={'ids':[_0x5136a5[0x0]]};if(rpc[_0x407939[_0xecbe('0x10')]+'Interaction']){rpc[_0x407939['channel']+'Interaction'][_0xecbe('0x11')](_0x407939[_0xecbe('0x12')]['id'],_0xa226ef)['then'](function(_0x1c525){logger[_0xecbe('0xd')](_0xecbe('0x13'),_0x516adb,_0x5136a5[0x1],_0x407939[_0xecbe('0x10')],_0x407939['interaction']['id']);})[_0xecbe('0x14')](function(_0x27f56f){logger[_0xecbe('0x15')](_0xecbe('0x16'),_0x516adb,JSON['stringify'](_0x27f56f));logger[_0xecbe('0xd')](_0xecbe('0xe'),_0x516adb);})['finally'](function(){_0x58b99a[_0xecbe('0xf')]();});}}}catch(_0x3802f0){logger[_0xecbe('0x15')]('[%s][TAG]\x20%s',_0x516adb,_[_0xecbe('0x17')](_0x3802f0)?JSON['stringify'](_0x3802f0):_0x3802f0);logger[_0xecbe('0xd')](_0xecbe('0xe'),_0x516adb);_0x58b99a['next']();}};}; \ No newline at end of file +var _0x98a3=['interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','info','channel','Interaction'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x98a3,0xce));var _0x398a=function(_0x469f93,_0x2a2c71){_0x469f93=_0x469f93-0x0;var _0x465f36=_0x98a3[_0x469f93];return _0x465f36;};'use strict';var schema=require(_0x398a('0x0'));var _=require(_0x398a('0x1'));var rpc={'chatInteraction':require(_0x398a('0x2')),'openchannelInteraction':require(_0x398a('0x3')),'smsInteraction':require(_0x398a('0x4')),'mailInteraction':require(_0x398a('0x5')),'faxInteraction':require(_0x398a('0x6')),'whatsappInteraction':require(_0x398a('0x7'))};var logger=require(_0x398a('0x8'))(_0x398a('0x9'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x398a('0xa')}});exports[_0x398a('0xb')]=function(_0x461e7f,_0x39b1ce,_0x3e9be0,_0x372abc){return function(_0x2da778){try{var _0x2a5981={'tag':_0x39b1ce[0x0]};var _0x50ccad=tag[_0x398a('0x0')](_0x2a5981,{'typecast':!![]});if(_0x50ccad[_0x398a('0xc')]){logger['error'](_0x398a('0xd'),_0x461e7f,_[_0x398a('0xe')](_0x50ccad,'message')['join'](',\x20'));logger[_0x398a('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x461e7f);_0x2da778['next']();}else{var _0x43cc25={'ids':[_0x39b1ce[0x0]]};if(rpc[_0x372abc[_0x398a('0x10')]+_0x398a('0x11')]){rpc[_0x372abc[_0x398a('0x10')]+_0x398a('0x11')]['addTags'](_0x372abc[_0x398a('0x12')]['id'],_0x43cc25)[_0x398a('0x13')](function(_0xda826d){logger[_0x398a('0xf')](_0x398a('0x14'),_0x461e7f,_0x39b1ce[0x1],_0x372abc['channel'],_0x372abc[_0x398a('0x12')]['id']);})[_0x398a('0x15')](function(_0x31da0e){logger[_0x398a('0x16')]('[%s][TAG]\x20%s',_0x461e7f,JSON[_0x398a('0x17')](_0x31da0e));logger[_0x398a('0xf')](_0x398a('0x18'),_0x461e7f);})[_0x398a('0x19')](function(){_0x2da778[_0x398a('0x1a')]();});}}}catch(_0x275d2f){logger[_0x398a('0x16')](_0x398a('0xd'),_0x461e7f,_[_0x398a('0x1b')](_0x275d2f)?JSON['stringify'](_0x275d2f):_0x275d2f);logger[_0x398a('0xf')](_0x398a('0x18'),_0x461e7f);_0x2da778[_0x398a('0x1a')]();}};}; \ 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 4a300f3..812fd4c 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xab7a70,_0x19dd8a){var _0x1530ac=function(_0x61b1d2){while(--_0x61b1d2){_0xab7a70['push'](_0xab7a70['shift']());}};_0x1530ac(++_0x19dd8a);}(_0xe706,0xa3));var _0x6e70=function(_0x58ecb4,_0x2c03c4){_0x58ecb4=_0x58ecb4-0x0;var _0x4b2adc=_0xe706[_0x58ecb4];return _0x4b2adc;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x2b8724,_0xcc363f){var _0xfda2ca=function(_0x3893bb){while(--_0x3893bb){_0x2b8724['push'](_0x2b8724['shift']());}};_0xfda2ca(++_0xcc363f);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 444129a..0ecc974 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 _0x2c6d=['Applications\x20executed','stringify','matchPath','rules','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','UserId','catch','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x2c6d,0x153));var _0xd2c6=function(_0x16e2ca,_0x46cd79){_0x16e2ca=_0x16e2ca-0x0;var _0x5388b7=_0x2c6d[_0x16e2ca];return _0x5388b7;};'use strict';var _=require('lodash');var util=require(_0xd2c6('0x0'));var path=require(_0xd2c6('0x1'));var fs=require('fs');var jayson=require(_0xd2c6('0x2'));var BPromise=require(_0xd2c6('0x3'));var uuid=require(_0xd2c6('0x4'));var config=require(_0xd2c6('0x5'));var logger=require('../../../config/logger')(_0xd2c6('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xd2c6('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd2c6('0x8')),'faxQueueReport':require(_0xd2c6('0x9')),'whatsappQueueReport':require(_0xd2c6('0xa'))};var RuleEngine=require(_0xd2c6('0xb'));function getId(_0x572f38,_0x27accd,_0x519267){return util[_0xd2c6('0xc')](_0xd2c6('0xd'),_0x572f38,_0x27accd||0x0,_0x519267||0x0);}function getIntervals(_0x3e95ea,_0x2a3bbc){var _0x8e6b72=[];if(!_[_0xd2c6('0xe')](_0x2a3bbc[_0xd2c6('0xf')])&&!_[_0xd2c6('0xe')](_0x3e95ea[_0x2a3bbc[_0xd2c6('0xf')]])&&!_[_0xd2c6('0xe')](_0x3e95ea[_0x2a3bbc[_0xd2c6('0xf')]][_0xd2c6('0x10')])){_0x8e6b72=_[_0xd2c6('0x11')](_0x3e95ea[_0x2a3bbc[_0xd2c6('0xf')]][_0xd2c6('0x10')],_0xd2c6('0x12'));}else if(!_[_0xd2c6('0xe')](_0x2a3bbc[_0xd2c6('0x12')])){_0x8e6b72=[_0x2a3bbc[_0xd2c6('0x12')]];}return _0x8e6b72;}exports[_0xd2c6('0x13')]=function(_0x50779d){_0x50779d['rules']={};return new BPromise(function(_0x203afa,_0x537c24){var _0x1bd57a={'Start':function(_0x1be7b4){var _0x35da27=this;return new Promise(function(_0x546a65,_0x45c761){if(_0x1be7b4){try{var _0x2dab64=[];var _0x14675f=getId(_0x1be7b4[_0xd2c6('0x14')],_0x1be7b4[_0xd2c6('0x15')]?_0x1be7b4['message']['id']:0x0,_0x1be7b4[_0xd2c6('0x16')]?_0x1be7b4[_0xd2c6('0x16')]['id']:0x0);if(_0x1be7b4[_0xd2c6('0x17')]&&_[_0xd2c6('0x18')](_0x1be7b4[_0xd2c6('0x17')])&&_0x1be7b4[_0xd2c6('0x17')][_0xd2c6('0x19')]){for(var _0x3c317a=0x0;_0x3c317a<_0x1be7b4['applications']['length'];_0x3c317a+=0x1){var _0x5a1261=_0x1be7b4['applications'][_0x3c317a];if(fs[_0xd2c6('0x1a')](path['join'](__dirname,'applications',_0x5a1261[_0xd2c6('0x1b')]+'.js'))){var _0xe87b2c=[];switch(_0x5a1261[_0xd2c6('0x1b')][_0xd2c6('0x1c')]()){case _0xd2c6('0x1d'):var _0x1e9349=_0x5a1261[_0xd2c6('0x1e')][_0xd2c6('0x1f')](',');if(_0x1be7b4[_0xd2c6('0x14')]===_0xd2c6('0x20')){_0xe87b2c[_0xd2c6('0x21')](_0x1e9349[0x0]);_0xe87b2c['push'](_0x1e9349[0x1]);_0xe87b2c[_0xd2c6('0x21')](_0x1e9349[_0xd2c6('0x22')](0x2,_0x1e9349[_0xd2c6('0x19')])['join'](','));}else{_0xe87b2c[_0xd2c6('0x21')](_0x1e9349[0x0]);_0xe87b2c[_0xd2c6('0x21')](_0x1e9349['slice'](0x1,_0x1e9349[_0xd2c6('0x19')])[_0xd2c6('0x23')](','));}break;case _0xd2c6('0x24'):var _0x12884a=_0x5a1261[_0xd2c6('0x1e')][_0xd2c6('0x1f')](',');_0xe87b2c[_0xd2c6('0x21')](_0x12884a[0x0]);_0xe87b2c[_0xd2c6('0x21')](_0x12884a[0x1]);_0xe87b2c[_0xd2c6('0x21')](_0x12884a[_0xd2c6('0x22')](0x2,_0x12884a['length'])['join'](','));break;case _0xd2c6('0x25'):var _0x109ffe=_0x5a1261[_0xd2c6('0x1e')][_0xd2c6('0x1f')](',');_0xe87b2c[_0xd2c6('0x21')](_0x109ffe[0x0]);_0xe87b2c[_0xd2c6('0x21')](_0x109ffe[0x1]);_0xe87b2c['push'](_0x109ffe[0x2]);_0xe87b2c['push'](_0x109ffe[0x3]);_0xe87b2c[_0xd2c6('0x21')](_0x109ffe[_0xd2c6('0x22')](0x4,_0x109ffe[_0xd2c6('0x19')])[_0xd2c6('0x23')](','));break;case _0xd2c6('0x26'):var _0x110b0c=_0x5a1261[_0xd2c6('0x1e')][_0xd2c6('0x1f')](',');_0xe87b2c['push'](_0x110b0c[0x0]);_0xe87b2c['push'](_0x110b0c[0x1]);_0xe87b2c[_0xd2c6('0x21')](_0x110b0c[0x2]);_0xe87b2c[_0xd2c6('0x21')](_0x110b0c[0x3]);_0xe87b2c['push'](_0x110b0c[_0xd2c6('0x22')](0x4,_0x110b0c[_0xd2c6('0x19')])['join'](','));break;case _0xd2c6('0x15'):_0xe87b2c[_0xd2c6('0x21')](_0x5a1261['appdata']);break;case'tag':_0xe87b2c['push'](_0x5a1261[_0xd2c6('0x27')]);_0xe87b2c[_0xd2c6('0x21')](_0x5a1261[_0xd2c6('0x1e')]);break;default:_0xe87b2c=_[_0xd2c6('0xe')](_0x5a1261[_0xd2c6('0x1e')])?[]:_0x5a1261['appdata']['split'](',');}var _0x25b456={'id':util[_0xd2c6('0xc')](_0xd2c6('0x28'),_0x14675f,_0x5a1261['id'],_0x5a1261[_0xd2c6('0x1b')]),'condition':require(_0xd2c6('0x29'))[_0xd2c6('0x2a')](_0x14675f,getIntervals(_0x50779d[_0xd2c6('0x2b')],_0x5a1261),_0x50779d),'consequence':require(_0xd2c6('0x2c')+_0x5a1261[_0xd2c6('0x1b')])[_0xd2c6('0x2d')](_0x14675f,_0xe87b2c,_0x50779d,_0x1be7b4),'p':_0x5a1261[_0xd2c6('0x2e')]||0x0};logger[_0xd2c6('0x2f')](_0xd2c6('0x30'),_0x25b456['id'],_0xd2c6('0x31'),getIntervals(_0x50779d['intervals'],_0x5a1261)[_0xd2c6('0x23')]('\x20|\x20'));_0x2dab64['push'](_0x25b456);}else{logger[_0xd2c6('0x32')](_0xd2c6('0x33'),path[_0xd2c6('0x23')](__dirname,'applications',_0x5a1261[_0xd2c6('0x1b')]+_0xd2c6('0x34')));}}_0x50779d['rules'][_0x14675f]=new RuleEngine(_0x2dab64);_0x50779d['rules'][_0x14675f]['execute'](_0x1be7b4,function(_0x37a8f3){logger[_0xd2c6('0x2f')](_0xd2c6('0x35'),JSON[_0xd2c6('0x36')](_0x37a8f3[_0xd2c6('0x37')]));if(_0x50779d[_0xd2c6('0x38')][_0x14675f]){_0x50779d[_0xd2c6('0x38')][_0x14675f]['emit'](_0xd2c6('0x39'));}});return _0x546a65({'code':0xc8,'message':_0x1be7b4});}else{logger[_0xd2c6('0x2f')](_0xd2c6('0x3a'));return _0x546a65({'code':0xc8,'message':_0x1be7b4});}}catch(_0x4498b6){logger[_0xd2c6('0x32')](_0x4498b6['stack']);return _0x45c761(_0x35da27[_0xd2c6('0x32')](0x1f4,_0x4498b6));}}return _0x45c761(_0xd2c6('0x3b'));});},'AcceptMessage':function(_0x394280){var _0x5f5710=this;return new Promise(function(_0x4d9253,_0x523aca){if(_0x394280[_0xd2c6('0x3c')]&&_0x394280[_0xd2c6('0x3c')]['id']){if(_0x50779d[_0xd2c6('0x3d')][_0x394280[_0xd2c6('0x3c')]['id']]){_0x50779d['agents'][_0x394280[_0xd2c6('0x3c')]['id']][_0xd2c6('0x3e')]=![];_0x50779d[_0xd2c6('0x3d')][_0x394280[_0xd2c6('0x3c')]['id']][_0xd2c6('0x3f')]=undefined;}}if(_0x394280['message']&&_0x394280[_0xd2c6('0x15')]['id']){try{var _0x4b4359=getId(_0x394280['channel'],_0x394280[_0xd2c6('0x15')]?_0x394280[_0xd2c6('0x15')]['id']:0x0,_0x394280[_0xd2c6('0x16')]?_0x394280[_0xd2c6('0x16')]['id']:0x0);if(_0x50779d[_0xd2c6('0x38')][_0x4b4359]){_0x50779d[_0xd2c6('0x38')][_0x4b4359][_0xd2c6('0x40')](_0xd2c6('0x41'));if(rpc[_0x394280[_0xd2c6('0x14')]+_0xd2c6('0x42')]){rpc[_0x394280[_0xd2c6('0x14')]+'QueueReport']['update'](_0x4b4359,{'UserId':_0x394280[_0xd2c6('0x15')][_0xd2c6('0x43')]})[_0xd2c6('0x44')](function(_0x125fa9){logger[_0xd2c6('0x32')]('error\x20update\x20queue\x20report');});}}return _0x4d9253({'code':0xc8,'message':_0x394280});}catch(_0x4b9f33){logger[_0xd2c6('0x32')](_0x4b9f33[_0xd2c6('0x45')]);return _0x523aca(_0x5f5710['error'](0x1f4,_0x4b9f33));}}logger[_0xd2c6('0x32')](_0xd2c6('0x46'));return _0x523aca(_0x5f5710['error'](0x1f4,_0xd2c6('0x46')));});},'RejectMessage':function(_0x5c5660){var _0x409cb2=this;return new Promise(function(_0x28e880,_0x2ad5ba){if(_0x5c5660[_0xd2c6('0x3c')]&&_0x5c5660[_0xd2c6('0x3c')]['id']){try{if(_0x50779d[_0xd2c6('0x3d')][_0x5c5660[_0xd2c6('0x3c')]['id']]){_0x50779d[_0xd2c6('0x3d')][_0x5c5660[_0xd2c6('0x3c')]['id']]['busy']=![];_0x50779d['agents'][_0x5c5660[_0xd2c6('0x3c')]['id']][_0xd2c6('0x3f')]=undefined;}return _0x28e880({'code':0xc8,'message':_0x5c5660});}catch(_0x1b0d6b){logger[_0xd2c6('0x32')](_0x1b0d6b[_0xd2c6('0x45')]);return _0x2ad5ba(_0x409cb2['error'](0x1f4,_0x1b0d6b));}}logger['error'](_0xd2c6('0x46'));return _0x2ad5ba(_0x409cb2[_0xd2c6('0x32')](0x1f4,_0xd2c6('0x46')));});},'AbandonInteraction':function(_0x316416){var _0x1929b8=this;return new Promise(function(_0x449814,_0x2a76d2){if(_0x316416[_0xd2c6('0x14')]&&_0x316416[_0xd2c6('0x16')]&&_0x316416[_0xd2c6('0x16')]['id']){try{var _0x5018d4=getId(_0x316416[_0xd2c6('0x14')],_0x316416['message']?_0x316416[_0xd2c6('0x15')]['id']:0x0,_0x316416['interaction']?_0x316416['interaction']['id']:0x0);if(_0x50779d[_0xd2c6('0x38')][_0x5018d4]){_0x50779d['rules'][_0x5018d4][_0xd2c6('0x40')](_0xd2c6('0x41'));}return _0x449814({'code':0xc8,'message':_0x316416});}catch(_0xe1ef85){logger['error'](_0xe1ef85['stack']);return _0x2a76d2(_0x1929b8[_0xd2c6('0x32')](0x1f4,_0xe1ef85));}}logger[_0xd2c6('0x32')](_0xd2c6('0x46'));return _0x2a76d2(_0x1929b8['error'](0x1f4,_0xd2c6('0x46')));});},'AgentCapacity':function(_0x2633a6){var _0x47a5a8=this;return new Promise(function(_0x11579e,_0x2c440e){if(_0x50779d[_0xd2c6('0x3d')]['hasOwnProperty'](_0x2633a6['id'])){for(var _0x1c267b in _0x2633a6[_0xd2c6('0x47')]){if(_0x2633a6[_0xd2c6('0x47')]['hasOwnProperty'](_0x1c267b)){if(_0x50779d[_0xd2c6('0x3d')][_0x2633a6['id']][_0xd2c6('0x48')](_0x1c267b+_0xd2c6('0x49'))){_0x50779d['agents'][_0x2633a6['id']][_0x1c267b+'CurrentCapacity']=parseInt(_0x2633a6[_0xd2c6('0x47')][_0x1c267b],0xa);}}}_0x50779d[_0xd2c6('0x3d')][_0x2633a6['id']][_0xd2c6('0x4a')]();return _0x11579e({'code':0xc8,'message':_0x50779d[_0xd2c6('0x3d')][_0x2633a6['id']]});}else{return _0x2c440e(_0x47a5a8[_0xd2c6('0x32')](0x1f4,_0xd2c6('0x4b')));}});},'Agents':function(_0x28302e){return new Promise(function(_0x59e342,_0x3fa5b5){var _0x20b217=_['values'](_0x50779d[_0xd2c6('0x3d')]);_0x59e342({'count':_0x20b217[_0xd2c6('0x19')],'rows':_0x20b217});});},'ChatQueues':function(_0x377144){return new Promise(function(_0x29b930,_0x2b713b){var _0x46b921=[];for(var _0x25e955 in _0x50779d['chatQueues']){if(_0x50779d[_0xd2c6('0x4c')][_0xd2c6('0x48')](_0x25e955)){var _0x1050a4=_0x50779d['chatQueues'][_0x25e955];var _0x19f51e={'id':_0x1050a4['id'],'available':_0x1050a4[_0xd2c6('0x4d')],'loggedIn':_0x1050a4[_0xd2c6('0x4e')],'name':_0x1050a4['name'],'paused':_0x1050a4[_0xd2c6('0x4f')],'waiting':_0x1050a4[_0xd2c6('0x50')]};_0x46b921['push'](_0x19f51e);}}_0x29b930({'count':_0x46b921[_0xd2c6('0x19')],'rows':_0x46b921});});},'MailQueues':function(_0x198c46){return new Promise(function(_0x43c6f7,_0x17450b){var _0xccfe7c=[];for(var _0x41dfd7 in _0x50779d[_0xd2c6('0x51')]){if(_0x50779d[_0xd2c6('0x51')][_0xd2c6('0x48')](_0x41dfd7)){var _0x2d1eae=_0x50779d[_0xd2c6('0x51')][_0x41dfd7];var _0x5b356d={'id':_0x2d1eae['id'],'available':_0x2d1eae[_0xd2c6('0x4d')],'loggedIn':_0x2d1eae['loggedIn'],'name':_0x2d1eae[_0xd2c6('0x52')],'paused':_0x2d1eae[_0xd2c6('0x4f')],'waiting':_0x2d1eae[_0xd2c6('0x50')]};_0xccfe7c[_0xd2c6('0x21')](_0x5b356d);}}_0x43c6f7({'count':_0xccfe7c[_0xd2c6('0x19')],'rows':_0xccfe7c});});},'OpenchannelQueues':function(_0x50cebf){return new Promise(function(_0x1b6154,_0x5a67fd){var _0x2f52c7=[];for(var _0x10ea29 in _0x50779d[_0xd2c6('0x53')]){if(_0x50779d[_0xd2c6('0x53')][_0xd2c6('0x48')](_0x10ea29)){var _0xf330a3=_0x50779d[_0xd2c6('0x53')][_0x10ea29];var _0x1dfd87={'id':_0xf330a3['id'],'available':_0xf330a3[_0xd2c6('0x4d')],'loggedIn':_0xf330a3['loggedIn'],'name':_0xf330a3[_0xd2c6('0x52')],'paused':_0xf330a3[_0xd2c6('0x4f')],'waiting':_0xf330a3[_0xd2c6('0x50')]};_0x2f52c7[_0xd2c6('0x21')](_0x1dfd87);}}_0x1b6154({'count':_0x2f52c7[_0xd2c6('0x19')],'rows':_0x2f52c7});});},'SmsQueues':function(_0x22c85a){return new Promise(function(_0x3d7dd3,_0x8d55b9){var _0x35a0e2=[];for(var _0x2d481e in _0x50779d[_0xd2c6('0x54')]){if(_0x50779d[_0xd2c6('0x54')]['hasOwnProperty'](_0x2d481e)){var _0x263a8a=_0x50779d[_0xd2c6('0x54')][_0x2d481e];var _0x5e6a57={'id':_0x263a8a['id'],'available':_0x263a8a[_0xd2c6('0x4d')],'loggedIn':_0x263a8a[_0xd2c6('0x4e')],'name':_0x263a8a['name'],'paused':_0x263a8a['paused'],'waiting':_0x263a8a[_0xd2c6('0x50')]};_0x35a0e2[_0xd2c6('0x21')](_0x5e6a57);}}_0x3d7dd3({'count':_0x35a0e2['length'],'rows':_0x35a0e2});});},'FaxQueues':function(_0x40095e){return new Promise(function(_0x12d256,_0x144549){var _0x1fef2b=[];for(var _0x4e0b87 in _0x50779d['faxQueues']){if(_0x50779d[_0xd2c6('0x55')][_0xd2c6('0x48')](_0x4e0b87)){var _0x3149bd=_0x50779d[_0xd2c6('0x55')][_0x4e0b87];var _0x3f7a2a={'id':_0x3149bd['id'],'available':_0x3149bd[_0xd2c6('0x4d')],'loggedIn':_0x3149bd[_0xd2c6('0x4e')],'name':_0x3149bd['name'],'paused':_0x3149bd[_0xd2c6('0x4f')],'waiting':_0x3149bd[_0xd2c6('0x50')]};_0x1fef2b[_0xd2c6('0x21')](_0x3f7a2a);}}_0x12d256({'count':_0x1fef2b[_0xd2c6('0x19')],'rows':_0x1fef2b});});},'WhatsappQueues':function(_0x4e3499){return new Promise(function(_0x3f2ac0,_0x14bf64){var _0x2f2093=[];for(var _0x2899ea in _0x50779d[_0xd2c6('0x56')]){if(_0x50779d[_0xd2c6('0x56')][_0xd2c6('0x48')](_0x2899ea)){var _0x247602=_0x50779d[_0xd2c6('0x56')][_0x2899ea];var _0x14b8b2={'id':_0x247602['id'],'available':_0x247602['available'],'loggedIn':_0x247602[_0xd2c6('0x4e')],'name':_0x247602['name'],'paused':_0x247602[_0xd2c6('0x4f')],'waiting':_0x247602['waiting']};_0x2f2093['push'](_0x14b8b2);}}_0x3f2ac0({'count':_0x2f2093[_0xd2c6('0x19')],'rows':_0x2f2093});});},'ChatQueuesWaitingInteractions':function(_0x333bdb){return new Promise(function(_0x3f2343,_0x2e8859){var _0x20f8d0=_['values'](_0x50779d[_0xd2c6('0x57')]);_0x3f2343({'count':_0x20f8d0[_0xd2c6('0x19')],'rows':_0x20f8d0});});},'MailQueuesWaitingInteractions':function(_0x405bd5){return new Promise(function(_0xb3382f,_0x292eee){var _0x56bbf1=_[_0xd2c6('0x58')](_0x50779d[_0xd2c6('0x59')]);_0xb3382f({'count':_0x56bbf1['length'],'rows':_0x56bbf1});});},'OpenchannelQueuesWaitingInteractions':function(_0xb26206){return new Promise(function(_0x18e20f,_0x232d4d){var _0x4ea257=_[_0xd2c6('0x58')](_0x50779d[_0xd2c6('0x5a')]);_0x18e20f({'count':_0x4ea257[_0xd2c6('0x19')],'rows':_0x4ea257});});},'SmsQueuesWaitingInteractions':function(_0x5ba46f){return new Promise(function(_0x1f53cb,_0x10859a){var _0xb116d3=_['values'](_0x50779d['smsQueuesWaitingInteractions']);_0x1f53cb({'count':_0xb116d3[_0xd2c6('0x19')],'rows':_0xb116d3});});},'FaxQueuesWaitingInteractions':function(_0x58568f){return new Promise(function(_0x3e8ef4,_0x4d541d){var _0x49ae28=_[_0xd2c6('0x58')](_0x50779d[_0xd2c6('0x5b')]);_0x3e8ef4({'count':_0x49ae28['length'],'rows':_0x49ae28});});},'WhatsappQueuesWaitingInteractions':function(_0x125174){return new Promise(function(_0x36a2a6,_0x39b3a0){var _0x5c3274=_[_0xd2c6('0x58')](_0x50779d['whatsappQueuesWaitingInteractions']);_0x36a2a6({'count':_0x5c3274['length'],'rows':_0x5c3274});});}};var _0x2e2a62=jayson[_0xd2c6('0x5c')](_0x1bd57a)[_0xd2c6('0x5d')]();_0x2e2a62['on'](_0xd2c6('0x32'),function(_0x5a1fda){logger[_0xd2c6('0x32')](JSON[_0xd2c6('0x36')](_0x5a1fda));return _0x537c24(_0x5a1fda);});_0x2e2a62[_0xd2c6('0x13')](0x232c,_0xd2c6('0x5e'),function(){console[_0xd2c6('0x5f')](_0xd2c6('0x60'),0x232c);return _0x203afa(_0xd2c6('0x61')+0x232c);});});}; \ No newline at end of file +var _0x6a6d=['busyQueue','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','emit','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','mailQueues','paused','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','agent','busy','agents'];(function(_0x50c4d1,_0x161fa5){var _0x4b89d8=function(_0x3585cd){while(--_0x3585cd){_0x50c4d1['push'](_0x50c4d1['shift']());}};_0x4b89d8(++_0x161fa5);}(_0x6a6d,0x19d));var _0xd6a6=function(_0xfa3235,_0x261489){_0xfa3235=_0xfa3235-0x0;var _0x4d1966=_0x6a6d[_0xfa3235];return _0x4d1966;};'use strict';var _=require('lodash');var util=require(_0xd6a6('0x0'));var path=require(_0xd6a6('0x1'));var fs=require('fs');var jayson=require(_0xd6a6('0x2'));var BPromise=require(_0xd6a6('0x3'));var uuid=require(_0xd6a6('0x4'));var config=require(_0xd6a6('0x5'));var logger=require(_0xd6a6('0x6'))(_0xd6a6('0x7'));var rpc={'openchannelQueueReport':require(_0xd6a6('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd6a6('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd6a6('0xa')),'whatsappQueueReport':require(_0xd6a6('0xb'))};var RuleEngine=require(_0xd6a6('0xc'));function getId(_0x464988,_0x31d597,_0x38935a){return util[_0xd6a6('0xd')](_0xd6a6('0xe'),_0x464988,_0x31d597||0x0,_0x38935a||0x0);}function getIntervals(_0x237639,_0x182444){var _0x33cba6=[];if(!_[_0xd6a6('0xf')](_0x182444[_0xd6a6('0x10')])&&!_['isNil'](_0x237639[_0x182444['IntervalId']])&&!_[_0xd6a6('0xf')](_0x237639[_0x182444[_0xd6a6('0x10')]][_0xd6a6('0x11')])){_0x33cba6=_[_0xd6a6('0x12')](_0x237639[_0x182444[_0xd6a6('0x10')]]['Intervals'],_0xd6a6('0x13'));}else if(!_[_0xd6a6('0xf')](_0x182444['interval'])){_0x33cba6=[_0x182444['interval']];}return _0x33cba6;}exports[_0xd6a6('0x14')]=function(_0x4df51b){_0x4df51b[_0xd6a6('0x15')]={};return new BPromise(function(_0x4fc0ae,_0x51365d){var _0x51d78e={'Start':function(_0x8f58f7){var _0x4e599e=this;return new Promise(function(_0x349b6c,_0x57c5b1){if(_0x8f58f7){try{var _0x5a44d1=[];var _0x24d247=getId(_0x8f58f7[_0xd6a6('0x16')],_0x8f58f7[_0xd6a6('0x17')]?_0x8f58f7[_0xd6a6('0x17')]['id']:0x0,_0x8f58f7[_0xd6a6('0x18')]?_0x8f58f7['interaction']['id']:0x0);if(_0x8f58f7[_0xd6a6('0x19')]&&_['isArray'](_0x8f58f7[_0xd6a6('0x19')])&&_0x8f58f7[_0xd6a6('0x19')][_0xd6a6('0x1a')]){for(var _0x45563c=0x0;_0x45563c<_0x8f58f7[_0xd6a6('0x19')]['length'];_0x45563c+=0x1){var _0x17a924=_0x8f58f7[_0xd6a6('0x19')][_0x45563c];if(fs[_0xd6a6('0x1b')](path[_0xd6a6('0x1c')](__dirname,_0xd6a6('0x19'),_0x17a924['app']+_0xd6a6('0x1d')))){var _0x42016f=[];switch(_0x17a924[_0xd6a6('0x1e')][_0xd6a6('0x1f')]()){case _0xd6a6('0x20'):var _0x4f0fe8=_0x17a924[_0xd6a6('0x21')][_0xd6a6('0x22')](',');if(_0x8f58f7['channel']===_0xd6a6('0x23')){_0x42016f[_0xd6a6('0x24')](_0x4f0fe8[0x0]);_0x42016f[_0xd6a6('0x24')](_0x4f0fe8[0x1]);_0x42016f['push'](_0x4f0fe8[_0xd6a6('0x25')](0x2,_0x4f0fe8[_0xd6a6('0x1a')])[_0xd6a6('0x1c')](','));}else{_0x42016f[_0xd6a6('0x24')](_0x4f0fe8[0x0]);_0x42016f[_0xd6a6('0x24')](_0x4f0fe8['slice'](0x1,_0x4f0fe8[_0xd6a6('0x1a')])[_0xd6a6('0x1c')](','));}break;case'dialogflow':var _0x2d0cfd=_0x17a924[_0xd6a6('0x21')][_0xd6a6('0x22')](',');_0x42016f[_0xd6a6('0x24')](_0x2d0cfd[0x0]);_0x42016f['push'](_0x2d0cfd[0x1]);_0x42016f[_0xd6a6('0x24')](_0x2d0cfd[_0xd6a6('0x25')](0x2,_0x2d0cfd[_0xd6a6('0x1a')])[_0xd6a6('0x1c')](','));break;case _0xd6a6('0x26'):var _0x276d21=_0x17a924[_0xd6a6('0x21')][_0xd6a6('0x22')](',');_0x42016f[_0xd6a6('0x24')](_0x276d21[0x0]);_0x42016f[_0xd6a6('0x24')](_0x276d21[0x1]);_0x42016f['push'](_0x276d21[0x2]);_0x42016f[_0xd6a6('0x24')](_0x276d21[0x3]);_0x42016f[_0xd6a6('0x24')](_0x276d21[_0xd6a6('0x25')](0x4,_0x276d21['length'])[_0xd6a6('0x1c')](','));break;case _0xd6a6('0x27'):var _0xe613ea=_0x17a924[_0xd6a6('0x21')][_0xd6a6('0x22')](',');_0x42016f[_0xd6a6('0x24')](_0xe613ea[0x0]);_0x42016f[_0xd6a6('0x24')](_0xe613ea[0x1]);_0x42016f[_0xd6a6('0x24')](_0xe613ea[0x2]);_0x42016f['push'](_0xe613ea[0x3]);_0x42016f[_0xd6a6('0x24')](_0xe613ea[_0xd6a6('0x25')](0x4,_0xe613ea[_0xd6a6('0x1a')])[_0xd6a6('0x1c')](','));break;case'message':_0x42016f[_0xd6a6('0x24')](_0x17a924[_0xd6a6('0x21')]);break;case _0xd6a6('0x28'):_0x42016f['push'](_0x17a924['TagId']);_0x42016f[_0xd6a6('0x24')](_0x17a924[_0xd6a6('0x21')]);break;default:_0x42016f=_[_0xd6a6('0xf')](_0x17a924['appdata'])?[]:_0x17a924[_0xd6a6('0x21')][_0xd6a6('0x22')](',');}var _0x21ebbb={'id':util[_0xd6a6('0xd')](_0xd6a6('0x29'),_0x24d247,_0x17a924['id'],_0x17a924['app']),'condition':require(_0xd6a6('0x2a'))['condition'](_0x24d247,getIntervals(_0x4df51b[_0xd6a6('0x2b')],_0x17a924),_0x4df51b),'consequence':require(_0xd6a6('0x2c')+_0x17a924[_0xd6a6('0x1e')])[_0xd6a6('0x2d')](_0x24d247,_0x42016f,_0x4df51b,_0x8f58f7),'p':_0x17a924[_0xd6a6('0x2e')]||0x0};logger[_0xd6a6('0x2f')](_0xd6a6('0x30'),_0x21ebbb['id'],_0xd6a6('0x31'),getIntervals(_0x4df51b['intervals'],_0x17a924)['join'](_0xd6a6('0x32')));_0x5a44d1[_0xd6a6('0x24')](_0x21ebbb);}else{logger[_0xd6a6('0x33')](_0xd6a6('0x34'),path[_0xd6a6('0x1c')](__dirname,_0xd6a6('0x19'),_0x17a924[_0xd6a6('0x1e')]+_0xd6a6('0x1d')));}}_0x4df51b[_0xd6a6('0x15')][_0x24d247]=new RuleEngine(_0x5a44d1);_0x4df51b[_0xd6a6('0x15')][_0x24d247][_0xd6a6('0x35')](_0x8f58f7,function(_0xd44bb7){logger[_0xd6a6('0x2f')](_0xd6a6('0x36'),JSON[_0xd6a6('0x37')](_0xd44bb7[_0xd6a6('0x38')]));if(_0x4df51b[_0xd6a6('0x15')][_0x24d247]){_0x4df51b[_0xd6a6('0x15')][_0x24d247]['emit'](_0xd6a6('0x39'));}});return _0x349b6c({'code':0xc8,'message':_0x8f58f7});}else{logger['info'](_0xd6a6('0x3a'));return _0x349b6c({'code':0xc8,'message':_0x8f58f7});}}catch(_0x4ba4be){logger[_0xd6a6('0x33')](_0x4ba4be['stack']);return _0x57c5b1(_0x4e599e[_0xd6a6('0x33')](0x1f4,_0x4ba4be));}}return _0x57c5b1('routing\x20is\x20empty');});},'AcceptMessage':function(_0x53b878){var _0x35f4f3=this;return new Promise(function(_0x57b482,_0x4ee328){if(_0x53b878['agent']&&_0x53b878[_0xd6a6('0x3b')]['id']){if(_0x4df51b['agents'][_0x53b878[_0xd6a6('0x3b')]['id']]){_0x4df51b['agents'][_0x53b878[_0xd6a6('0x3b')]['id']][_0xd6a6('0x3c')]=![];_0x4df51b[_0xd6a6('0x3d')][_0x53b878[_0xd6a6('0x3b')]['id']][_0xd6a6('0x3e')]=undefined;}}if(_0x53b878[_0xd6a6('0x17')]&&_0x53b878['message']['id']){try{var _0xe68f13=getId(_0x53b878[_0xd6a6('0x16')],_0x53b878[_0xd6a6('0x17')]?_0x53b878[_0xd6a6('0x17')]['id']:0x0,_0x53b878[_0xd6a6('0x18')]?_0x53b878[_0xd6a6('0x18')]['id']:0x0);if(_0x4df51b[_0xd6a6('0x15')][_0xe68f13]){_0x4df51b[_0xd6a6('0x15')][_0xe68f13]['emit'](_0xd6a6('0x3f'));if(rpc[_0x53b878[_0xd6a6('0x16')]+_0xd6a6('0x40')]){rpc[_0x53b878['channel']+'QueueReport']['update'](_0xe68f13,{'UserId':_0x53b878[_0xd6a6('0x17')][_0xd6a6('0x41')]})[_0xd6a6('0x42')](function(_0x15e458){logger['error'](_0xd6a6('0x43'));});}}return _0x57b482({'code':0xc8,'message':_0x53b878});}catch(_0x2cea2a){logger[_0xd6a6('0x33')](_0x2cea2a[_0xd6a6('0x44')]);return _0x4ee328(_0x35f4f3[_0xd6a6('0x33')](0x1f4,_0x2cea2a));}}logger[_0xd6a6('0x33')](_0xd6a6('0x45'));return _0x4ee328(_0x35f4f3[_0xd6a6('0x33')](0x1f4,_0xd6a6('0x45')));});},'RejectMessage':function(_0x21c82e){var _0x48dd37=this;return new Promise(function(_0x2df16a,_0x7da6ac){if(_0x21c82e[_0xd6a6('0x3b')]&&_0x21c82e['agent']['id']){try{if(_0x4df51b[_0xd6a6('0x3d')][_0x21c82e[_0xd6a6('0x3b')]['id']]){_0x4df51b['agents'][_0x21c82e[_0xd6a6('0x3b')]['id']][_0xd6a6('0x3c')]=![];_0x4df51b[_0xd6a6('0x3d')][_0x21c82e['agent']['id']][_0xd6a6('0x3e')]=undefined;}return _0x2df16a({'code':0xc8,'message':_0x21c82e});}catch(_0x47b510){logger['error'](_0x47b510[_0xd6a6('0x44')]);return _0x7da6ac(_0x48dd37[_0xd6a6('0x33')](0x1f4,_0x47b510));}}logger[_0xd6a6('0x33')]('message\x20is\x20empty');return _0x7da6ac(_0x48dd37[_0xd6a6('0x33')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x25543d){var _0x5a4c6e=this;return new Promise(function(_0x223495,_0x52fc21){if(_0x25543d['channel']&&_0x25543d[_0xd6a6('0x18')]&&_0x25543d[_0xd6a6('0x18')]['id']){try{var _0x568891=getId(_0x25543d[_0xd6a6('0x16')],_0x25543d[_0xd6a6('0x17')]?_0x25543d[_0xd6a6('0x17')]['id']:0x0,_0x25543d[_0xd6a6('0x18')]?_0x25543d['interaction']['id']:0x0);if(_0x4df51b[_0xd6a6('0x15')][_0x568891]){_0x4df51b[_0xd6a6('0x15')][_0x568891][_0xd6a6('0x46')](_0xd6a6('0x3f'));}return _0x223495({'code':0xc8,'message':_0x25543d});}catch(_0x4063f1){logger['error'](_0x4063f1[_0xd6a6('0x44')]);return _0x52fc21(_0x5a4c6e[_0xd6a6('0x33')](0x1f4,_0x4063f1));}}logger[_0xd6a6('0x33')](_0xd6a6('0x45'));return _0x52fc21(_0x5a4c6e['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x37ad8e){var _0x220876=this;return new Promise(function(_0xcb2278,_0x56b42c){if(_0x4df51b[_0xd6a6('0x3d')][_0xd6a6('0x47')](_0x37ad8e['id'])){for(var _0x160651 in _0x37ad8e['capacity']){if(_0x37ad8e['capacity'][_0xd6a6('0x47')](_0x160651)){if(_0x4df51b[_0xd6a6('0x3d')][_0x37ad8e['id']][_0xd6a6('0x47')](_0x160651+_0xd6a6('0x48'))){_0x4df51b['agents'][_0x37ad8e['id']][_0x160651+_0xd6a6('0x48')]=parseInt(_0x37ad8e['capacity'][_0x160651],0xa);}}}_0x4df51b[_0xd6a6('0x3d')][_0x37ad8e['id']][_0xd6a6('0x49')]();return _0xcb2278({'code':0xc8,'message':_0x4df51b[_0xd6a6('0x3d')][_0x37ad8e['id']]});}else{return _0x56b42c(_0x220876[_0xd6a6('0x33')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x54ec21){return new Promise(function(_0x4907e2,_0x1b63e9){var _0x48452b=_[_0xd6a6('0x4a')](_0x4df51b[_0xd6a6('0x3d')]);_0x4907e2({'count':_0x48452b[_0xd6a6('0x1a')],'rows':_0x48452b});});},'ChatQueues':function(_0x3f6067){return new Promise(function(_0x4e514a,_0x3ed9e3){var _0x53733c=[];for(var _0x513b43 in _0x4df51b[_0xd6a6('0x4b')]){if(_0x4df51b[_0xd6a6('0x4b')][_0xd6a6('0x47')](_0x513b43)){var _0x3a2aee=_0x4df51b[_0xd6a6('0x4b')][_0x513b43];var _0x3ebf7a={'id':_0x3a2aee['id'],'available':_0x3a2aee[_0xd6a6('0x4c')],'loggedIn':_0x3a2aee[_0xd6a6('0x4d')],'name':_0x3a2aee[_0xd6a6('0x4e')],'paused':_0x3a2aee['paused'],'waiting':_0x3a2aee['waiting']};_0x53733c[_0xd6a6('0x24')](_0x3ebf7a);}}_0x4e514a({'count':_0x53733c[_0xd6a6('0x1a')],'rows':_0x53733c});});},'MailQueues':function(_0x3fb529){return new Promise(function(_0x37dca8,_0x2ba125){var _0x39e21f=[];for(var _0xd67844 in _0x4df51b['mailQueues']){if(_0x4df51b[_0xd6a6('0x4f')]['hasOwnProperty'](_0xd67844)){var _0x29b22e=_0x4df51b['mailQueues'][_0xd67844];var _0x1566ef={'id':_0x29b22e['id'],'available':_0x29b22e[_0xd6a6('0x4c')],'loggedIn':_0x29b22e[_0xd6a6('0x4d')],'name':_0x29b22e[_0xd6a6('0x4e')],'paused':_0x29b22e[_0xd6a6('0x50')],'waiting':_0x29b22e['waiting']};_0x39e21f['push'](_0x1566ef);}}_0x37dca8({'count':_0x39e21f['length'],'rows':_0x39e21f});});},'OpenchannelQueues':function(_0x305432){return new Promise(function(_0x1c8f70,_0x1b4ac6){var _0x354778=[];for(var _0x11e986 in _0x4df51b[_0xd6a6('0x51')]){if(_0x4df51b[_0xd6a6('0x51')][_0xd6a6('0x47')](_0x11e986)){var _0x3bab7d=_0x4df51b[_0xd6a6('0x51')][_0x11e986];var _0xef2bea={'id':_0x3bab7d['id'],'available':_0x3bab7d[_0xd6a6('0x4c')],'loggedIn':_0x3bab7d[_0xd6a6('0x4d')],'name':_0x3bab7d[_0xd6a6('0x4e')],'paused':_0x3bab7d[_0xd6a6('0x50')],'waiting':_0x3bab7d[_0xd6a6('0x52')]};_0x354778['push'](_0xef2bea);}}_0x1c8f70({'count':_0x354778[_0xd6a6('0x1a')],'rows':_0x354778});});},'SmsQueues':function(_0x264bfb){return new Promise(function(_0x17e9f5,_0x36d67f){var _0x37c7a8=[];for(var _0x4df39d in _0x4df51b[_0xd6a6('0x53')]){if(_0x4df51b['smsQueues'][_0xd6a6('0x47')](_0x4df39d)){var _0x2e7946=_0x4df51b[_0xd6a6('0x53')][_0x4df39d];var _0x354030={'id':_0x2e7946['id'],'available':_0x2e7946[_0xd6a6('0x4c')],'loggedIn':_0x2e7946[_0xd6a6('0x4d')],'name':_0x2e7946[_0xd6a6('0x4e')],'paused':_0x2e7946[_0xd6a6('0x50')],'waiting':_0x2e7946[_0xd6a6('0x52')]};_0x37c7a8[_0xd6a6('0x24')](_0x354030);}}_0x17e9f5({'count':_0x37c7a8[_0xd6a6('0x1a')],'rows':_0x37c7a8});});},'FaxQueues':function(_0x3ccc6b){return new Promise(function(_0x2c0f93,_0x493f70){var _0x4c4b1f=[];for(var _0x5eef9b in _0x4df51b['faxQueues']){if(_0x4df51b[_0xd6a6('0x54')][_0xd6a6('0x47')](_0x5eef9b)){var _0x8f9684=_0x4df51b[_0xd6a6('0x54')][_0x5eef9b];var _0x3064c9={'id':_0x8f9684['id'],'available':_0x8f9684[_0xd6a6('0x4c')],'loggedIn':_0x8f9684[_0xd6a6('0x4d')],'name':_0x8f9684['name'],'paused':_0x8f9684[_0xd6a6('0x50')],'waiting':_0x8f9684[_0xd6a6('0x52')]};_0x4c4b1f[_0xd6a6('0x24')](_0x3064c9);}}_0x2c0f93({'count':_0x4c4b1f[_0xd6a6('0x1a')],'rows':_0x4c4b1f});});},'WhatsappQueues':function(_0x1a0c0c){return new Promise(function(_0x13057a,_0x239aae){var _0x277333=[];for(var _0x41744d in _0x4df51b[_0xd6a6('0x55')]){if(_0x4df51b[_0xd6a6('0x55')]['hasOwnProperty'](_0x41744d)){var _0x42aff3=_0x4df51b[_0xd6a6('0x55')][_0x41744d];var _0x2ac691={'id':_0x42aff3['id'],'available':_0x42aff3[_0xd6a6('0x4c')],'loggedIn':_0x42aff3['loggedIn'],'name':_0x42aff3['name'],'paused':_0x42aff3[_0xd6a6('0x50')],'waiting':_0x42aff3[_0xd6a6('0x52')]};_0x277333['push'](_0x2ac691);}}_0x13057a({'count':_0x277333['length'],'rows':_0x277333});});},'ChatQueuesWaitingInteractions':function(_0x2c0228){return new Promise(function(_0x1241c7,_0x300bca){var _0xb80c8d=_['values'](_0x4df51b[_0xd6a6('0x56')]);_0x1241c7({'count':_0xb80c8d[_0xd6a6('0x1a')],'rows':_0xb80c8d});});},'MailQueuesWaitingInteractions':function(_0x6e26c2){return new Promise(function(_0x105c09,_0x2b93f5){var _0x7feee2=_[_0xd6a6('0x4a')](_0x4df51b[_0xd6a6('0x57')]);_0x105c09({'count':_0x7feee2[_0xd6a6('0x1a')],'rows':_0x7feee2});});},'OpenchannelQueuesWaitingInteractions':function(_0x1607a1){return new Promise(function(_0x3d7980,_0x24ed72){var _0xb312bb=_[_0xd6a6('0x4a')](_0x4df51b[_0xd6a6('0x58')]);_0x3d7980({'count':_0xb312bb[_0xd6a6('0x1a')],'rows':_0xb312bb});});},'SmsQueuesWaitingInteractions':function(_0x2938b1){return new Promise(function(_0x2d7982,_0x18fa94){var _0x507708=_[_0xd6a6('0x4a')](_0x4df51b[_0xd6a6('0x59')]);_0x2d7982({'count':_0x507708[_0xd6a6('0x1a')],'rows':_0x507708});});},'FaxQueuesWaitingInteractions':function(_0x50953c){return new Promise(function(_0x44af16,_0x2130b9){var _0x47fbea=_[_0xd6a6('0x4a')](_0x4df51b[_0xd6a6('0x5a')]);_0x44af16({'count':_0x47fbea[_0xd6a6('0x1a')],'rows':_0x47fbea});});},'WhatsappQueuesWaitingInteractions':function(_0x36b51a){return new Promise(function(_0x8b0bcb,_0x572998){var _0x10dd76=_[_0xd6a6('0x4a')](_0x4df51b['whatsappQueuesWaitingInteractions']);_0x8b0bcb({'count':_0x10dd76[_0xd6a6('0x1a')],'rows':_0x10dd76});});}};var _0x5d89d3=jayson[_0xd6a6('0x5b')](_0x51d78e)[_0xd6a6('0x5c')]();_0x5d89d3['on'](_0xd6a6('0x33'),function(_0x5ec22d){logger[_0xd6a6('0x33')](JSON[_0xd6a6('0x37')](_0x5ec22d));return _0x51365d(_0x5ec22d);});_0x5d89d3[_0xd6a6('0x14')](0x232c,_0xd6a6('0x5d'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4fc0ae(_0xd6a6('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 33e2fe9..5eb7270 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 _0x534b=['result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','Command','format','iftime\x20%s','then','indexOf','true','all','some','info','join','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','error','message'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x534b,0x1d2));var _0xb534=function(_0x45c625,_0x27bcfb){_0x45c625=_0x45c625-0x0;var _0x440b41=_0x534b[_0x45c625];return _0x440b41;};'use strict';var util=require(_0xb534('0x0'));var BPromise=require(_0xb534('0x1'));var jayson=require(_0xb534('0x2'));var _=require('lodash');var logger=require(_0xb534('0x3'))(_0xb534('0x4'));var client=jayson[_0xb534('0x5')][_0xb534('0x6')]({'port':0x232a});function request(_0x1a36d2,_0x58b44d){return new BPromise(function(_0xbbdf31,_0x73e360){return client[_0xb534('0x7')](_0x1a36d2,_0x58b44d)['then'](function(_0xee791f){if(_0xee791f[_0xb534('0x8')]){return _0x73e360(_0xee791f['error'][_0xb534('0x9')]);}else{return _0xbbdf31(_0xee791f[_0xb534('0xa')]);}})[_0xb534('0xb')](function(_0x3f5509){return _0x73e360(_0x3f5509);});});}exports['condition']=function(_0x375b2a,_0x326232,_0x57d0e2){return function(_0x455a74){if(_0x57d0e2[_0xb534('0xc')]&&!_0x57d0e2[_0xb534('0xc')][_0x375b2a]){logger['info'](_0xb534('0xd'),_0x375b2a);return _0x455a74[_0xb534('0xe')]();}var _0x3e3785=[];for(var _0x475e52=0x0;_0x475e52<_0x326232['length'];_0x475e52+=0x1){_0x3e3785['push'](request(_0xb534('0xf'),{'command':util[_0xb534('0x10')](_0xb534('0x11'),_0x326232[_0x475e52])})[_0xb534('0x12')](function(_0x1f09aa){return _0x1f09aa&&_0x1f09aa[_0xb534('0x9')]&&_0x1f09aa[_0xb534('0x9')][_0xb534('0x13')](_0xb534('0x14'))>=0x0?!![]:![];})[_0xb534('0xb')](function(_0x23145b){logger[_0xb534('0x8')]('[%s][INTERVAL]\x20%s',_0x375b2a,_0x326232[_0x475e52]);}));}BPromise[_0xb534('0x15')](_0x3e3785)[_0xb534('0x12')](function(_0x45023f){var _0x40cb98=_[_0xb534('0x16')](_0x45023f);logger[_0xb534('0x17')]('[%s][INTERVAL]\x20%s\x20%s',_0x375b2a,_0x326232[_0xb534('0x18')]('\x20|\x20'),_0x40cb98);_0x455a74['when'](_0x40cb98);})[_0xb534('0xb')](function(_0x348c62){console[_0xb534('0x19')](_0x348c62);logger[_0xb534('0x8')](_0xb534('0x1a'),_0x375b2a,_0x326232[_0xb534('0x18')]('\x20|\x20'),_0x348c62[_0xb534('0x1b')]);_0x455a74['stop']();});};}; \ No newline at end of file +var _0x1a7f=['\x20|\x20','when','log','join','util','bluebird','lodash','routing','client','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1a7f,0x11c));var _0xf1a7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1a7f[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0xf1a7('0x0'));var BPromise=require(_0xf1a7('0x1'));var jayson=require('jayson/promise');var _=require(_0xf1a7('0x2'));var logger=require('../../../config/logger')(_0xf1a7('0x3'));var client=jayson[_0xf1a7('0x4')]['http']({'port':0x232a});function request(_0x184447,_0x18aa6f){return new BPromise(function(_0x38d84b,_0x40dd78){return client[_0xf1a7('0x5')](_0x184447,_0x18aa6f)[_0xf1a7('0x6')](function(_0x1193c0){if(_0x1193c0['error']){return _0x40dd78(_0x1193c0[_0xf1a7('0x7')][_0xf1a7('0x8')]);}else{return _0x38d84b(_0x1193c0[_0xf1a7('0x9')]);}})[_0xf1a7('0xa')](function(_0x127c7a){return _0x40dd78(_0x127c7a);});});}exports['condition']=function(_0x556358,_0x57d8d3,_0x247fc9){return function(_0x149fb5){if(_0x247fc9[_0xf1a7('0xb')]&&!_0x247fc9['rules'][_0x556358]){logger[_0xf1a7('0xc')](_0xf1a7('0xd'),_0x556358);return _0x149fb5[_0xf1a7('0xe')]();}var _0x3eeb25=[];for(var _0x82e7dc=0x0;_0x82e7dc<_0x57d8d3[_0xf1a7('0xf')];_0x82e7dc+=0x1){_0x3eeb25[_0xf1a7('0x10')](request(_0xf1a7('0x11'),{'command':util[_0xf1a7('0x12')](_0xf1a7('0x13'),_0x57d8d3[_0x82e7dc])})[_0xf1a7('0x6')](function(_0x3e81d7){return _0x3e81d7&&_0x3e81d7['message']&&_0x3e81d7[_0xf1a7('0x8')]['indexOf']('true')>=0x0?!![]:![];})[_0xf1a7('0xa')](function(_0x455478){logger[_0xf1a7('0x7')](_0xf1a7('0x14'),_0x556358,_0x57d8d3[_0x82e7dc]);}));}BPromise[_0xf1a7('0x15')](_0x3eeb25)['then'](function(_0x4743d3){var _0x26e4dc=_[_0xf1a7('0x16')](_0x4743d3);logger[_0xf1a7('0xc')](_0xf1a7('0x17'),_0x556358,_0x57d8d3['join'](_0xf1a7('0x18')),_0x26e4dc);_0x149fb5[_0xf1a7('0x19')](_0x26e4dc);})[_0xf1a7('0xa')](function(_0x43e121){console[_0xf1a7('0x1a')](_0x43e121);logger[_0xf1a7('0x7')](_0xf1a7('0x17'),_0x556358,_0x57d8d3[_0xf1a7('0x1b')]('\x20|\x20'),_0x43e121['stack']);_0x149fb5[_0xf1a7('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 9c0808e..1ab8c17 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 _0x6b20=['includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','error','queuecallerabandon','forIn'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6b20,0xd1));var _0x06b2=function(_0x4e6a06,_0x170b46){_0x4e6a06=_0x4e6a06-0x0;var _0x491655=_0x6b20[_0x4e6a06];return _0x491655;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x2d5e24,_0x54947c){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x4'),_0x2d5e24['uniqueid'],_0x2d5e24[_0x06b2('0x5')],_0x2d5e24[_0x06b2('0x6')],_0x2d5e24[_0x06b2('0x7')],_0x2d5e24[_0x06b2('0x8')],_0x2d5e24[_0x06b2('0x9')],_0x2d5e24[_0x06b2('0xa')],_0x2d5e24[_0x06b2('0xb')]));if(_0x2d5e24['queue']){utils[_0x06b2('0xc')](_0x2d5e24[_0x06b2('0x6')])[_0x06b2('0xd')](function(_0x58538a){if(_0x58538a){_0x2d5e24[_0x06b2('0xe')]=_0x58538a['type'];_0x2d5e24[_0x06b2('0xf')]=_0x2d5e24['agentcomplete']?_0x58538a['acw']:![];_0x2d5e24[_0x06b2('0x10')]=_0x2d5e24[_0x06b2('0xf')]?_0x58538a['acwTimeout']:0x0;}utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);});}else{utils[_0x06b2('0x11')](_0x06b2('0x12'),_0x2d5e24);}if(_0x54947c){delete transfers[_0x2d5e24[_0x06b2('0x13')]];}else{delete agents[_0x2d5e24[_0x06b2('0x14')]];}}exports[_0x06b2('0x15')]=function(_0x926bf6){try{utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x926bf6);agents[_0x926bf6[_0x06b2('0x14')]]=_0x926bf6;agents[_0x926bf6['destuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x1a');agents[_0x926bf6[_0x06b2('0x14')]]['connectedlinenum']=null;agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x1b')]=null;utils['info'](util[_0x06b2('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x926bf6['uniqueid'],agents[_0x926bf6[_0x06b2('0x14')]][_0x06b2('0x7')],_0x926bf6[_0x06b2('0x14')]));}catch(_0x2182f3){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x17'),_0x926bf6[_0x06b2('0x13')]),_0x2182f3);}};exports[_0x06b2('0x1c')]=function(_0xe28985){try{if(!_[_0x06b2('0x1d')](agents[_0xe28985[_0x06b2('0x14')]])){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0xe28985);utils[_0x06b2('0x2')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0xe28985[_0x06b2('0x13')],agents[_0xe28985[_0x06b2('0x14')]]['membername'],_0xe28985[_0x06b2('0x14')]));agents[_0xe28985['destuniqueid']][_0x06b2('0x1c')]=!![];agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x1f')]=utils['now']();agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x20');agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x21')]='timeout';agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x22')]=_0xe28985[_0x06b2('0x23')]?parseInt(_0xe28985[_0x06b2('0x23')])/0x3e8:0x0;agents[_0xe28985[_0x06b2('0x14')]][_0x06b2('0x24')]=0x0;unanswered['push'](_0xe28985[_0x06b2('0x14')]);}}catch(_0x2a3228){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x1e'),_0xe28985[_0x06b2('0x13')]),_0x2a3228);}};exports[_0x06b2('0x26')]=function(_0x51698b){try{_[_0x06b2('0x27')](agents,function(_0x32eeea,_0x1637c2){if(_0x32eeea[_0x06b2('0x13')]==_0x51698b[_0x06b2('0x13')]&&!_[_0x06b2('0x28')](unanswered,_0x32eeea[_0x06b2('0x14')])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x51698b);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2a'),_0x51698b[_0x06b2('0x13')],_0x32eeea[_0x06b2('0x7')],_0x32eeea['destuniqueid']));_0x32eeea['agentringnoanswer']=!![];_0x32eeea[_0x06b2('0x1f')]=utils[_0x06b2('0x19')]();_0x32eeea[_0x06b2('0xb')]='abandoned';_0x32eeea[_0x06b2('0x21')]=_0x06b2('0x2b');_0x32eeea[_0x06b2('0x22')]=_0x51698b[_0x06b2('0x22')];_0x32eeea[_0x06b2('0x24')]=0x0;writeDB(_0x32eeea);}});}catch(_0x27f172){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x29'),_0x51698b[_0x06b2('0x13')]),_0x27f172);}};exports['agentconnect']=function(_0x268780){try{if(agents[_0x268780[_0x06b2('0x14')]]){utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x268780);utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x2d'),_0x268780[_0x06b2('0x13')],agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x7')],_0x268780[_0x06b2('0x14')]));agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0x2e')]=utils['now']();agents[_0x268780[_0x06b2('0x14')]]['connectedlinenum']=_0x268780['connectedlinenum'];agents[_0x268780[_0x06b2('0x14')]]['connectedlinename']=_0x268780[_0x06b2('0x1b')];agents[_0x268780['destuniqueid']][_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];agents[_0x268780[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x2f');_['forIn'](agents,function(_0x404eab,_0xee3ec6){if(_0x404eab[_0x06b2('0x14')]!=_0x268780[_0x06b2('0x14')]&&_0x404eab[_0x06b2('0x13')]==_0x268780[_0x06b2('0x13')]){_0x404eab['talktime']=0x0;_0x404eab[_0x06b2('0x22')]=_0x268780[_0x06b2('0x23')];_0x404eab['agentringnoanswer']=!![];_0x404eab['agentringnoanswerAt']=utils[_0x06b2('0x19')]();_0x404eab[_0x06b2('0xb')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x21')]=_0x06b2('0x30');_0x404eab[_0x06b2('0x31')]=_0x268780[_0x06b2('0x14')];_0x404eab[_0x06b2('0x32')]=_0x268780[_0x06b2('0x7')];writeDB(_0x404eab);}});}}catch(_0x117bf4){utils[_0x06b2('0x25')](util[_0x06b2('0x3')](_0x06b2('0x2c'),_0x268780[_0x06b2('0x13')]),_0x117bf4);}};exports[_0x06b2('0x33')]=function(_0x190781){try{if(!_[_0x06b2('0x1d')](agents[_0x190781[_0x06b2('0x14')]])){utils[_0x06b2('0x16')](util['format'](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0x190781);utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x190781[_0x06b2('0x13')],agents[_0x190781[_0x06b2('0x14')]]['membername'],_0x190781[_0x06b2('0x14')]));agents[_0x190781[_0x06b2('0x14')]]['agentcomplete']=!![];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')]=utils['now']();agents[_0x190781['destuniqueid']]['talktime']=utils[_0x06b2('0x36')](agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x35')],agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0x2e')]);agents[_0x190781['destuniqueid']]['reason']=_0x190781[_0x06b2('0x21')];agents[_0x190781[_0x06b2('0x14')]][_0x06b2('0xb')]=_0x06b2('0x37');writeDB(agents[_0x190781[_0x06b2('0x14')]]);}}catch(_0xc18216){utils['error'](util[_0x06b2('0x3')](_0x06b2('0x34'),_0x190781[_0x06b2('0x13')]),_0xc18216);}};exports[_0x06b2('0x38')]=function(_0x146c5c){try{if(!_[_0x06b2('0x1d')](agents[_0x146c5c['transfereruniqueid']])){utils[_0x06b2('0x16')](util[_0x06b2('0x3')](_0x06b2('0x39'),_0x146c5c[_0x06b2('0x13')]),_0x146c5c);utils['info'](util[_0x06b2('0x3')](_0x06b2('0x3a'),_0x146c5c[_0x06b2('0x13')],agents[_0x146c5c[_0x06b2('0x3b')]]['membername'],agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')]));agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3c')]=!![];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x3d')]=_0x06b2('0x3e');agents[_0x146c5c[_0x06b2('0x3b')]]['transferexten']=_0x146c5c[_0x06b2('0x3f')];agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x40')]=agents[_0x146c5c[_0x06b2('0x3b')]][_0x06b2('0x13')];}}catch(_0x2f75a0){utils['error'](util['format'](_0x06b2('0x39'),_0x146c5c['uniqueid']),_0x2f75a0);}};exports['attendedtransfer']=function(_0x2daf62){try{utils['debug'](util[_0x06b2('0x3')](_0x06b2('0x41'),_0x2daf62[_0x06b2('0x42')]),_0x2daf62);if(_0x2daf62[_0x06b2('0x42')]==_0x2daf62[_0x06b2('0x43')]){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x44')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x45'),_0x2daf62['origtransfereruniqueid'],agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x7')]));agents[_0x2daf62[_0x06b2('0x44')]]['transfer']=!![];agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x44')]]['transferexten']=_0x2daf62['origtransfererexten'];agents[_0x2daf62['secondtransfereruniqueid']][_0x06b2('0x40')]=_0x2daf62['origtransfereruniqueid'];}if(_0x2daf62['transfereeuniqueid']&&agents[_0x2daf62[_0x06b2('0x47')]]){agents[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x48')]=0x1;transfers[_0x2daf62[_0x06b2('0x47')]]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x47')]]);transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x44')]]['calleridnum'];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x4a')]=agents[_0x2daf62[_0x06b2('0x44')]][_0x06b2('0x4a')];transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x47')]][_0x06b2('0x22')]=0x0;transfers[_0x2daf62['transfereeuniqueid']][_0x06b2('0x48')]=0x2;}}else if(_0x2daf62[_0x06b2('0x44')]==_0x2daf62['secondtransfererlinkedid']){if(!_[_0x06b2('0x1d')](agents[_0x2daf62[_0x06b2('0x42')]])){utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2daf62[_0x06b2('0x42')],agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x7')]));agents[_0x2daf62['origtransfereruniqueid']][_0x06b2('0x3c')]=!![];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x3d')]=_0x06b2('0x46');agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4b')]=_0x2daf62[_0x06b2('0x4c')];agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x40')]=_0x2daf62['secondtransfereruniqueid'];}if(_0x2daf62['transfertargetuniqueid']&&agents[_0x2daf62['transfertargetuniqueid']]){agents[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x48')]=0x1;transfers[_0x2daf62['transfertargetuniqueid']]=_[_0x06b2('0x49')](agents[_0x2daf62[_0x06b2('0x4d')]]);transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x9')]=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x9')];transfers[_0x2daf62['transfertargetuniqueid']]['calleridname']=agents[_0x2daf62[_0x06b2('0x42')]][_0x06b2('0x4a')];transfers[_0x2daf62['transfertargetuniqueid']][_0x06b2('0x18')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]][_0x06b2('0x2e')]=utils[_0x06b2('0x19')]();transfers[_0x2daf62[_0x06b2('0x4d')]]['holdtime']=0x0;transfers[_0x2daf62[_0x06b2('0x4d')]]['agententerreason']=0x2;}}}catch(_0x4023b0){utils[_0x06b2('0x25')](util[_0x06b2('0x3')]('[%s][agents][attendedtransfer]',_0x2daf62[_0x06b2('0x42')]),_0x4023b0);}};exports[_0x06b2('0x4e')]=function(_0x461c4d){try{utils['debug'](util[_0x06b2('0x3')]('[%s][agents][hangup]',_0x461c4d[_0x06b2('0x13')]),_0x461c4d);if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]===_0x06b2('0x20')){if(_0x461c4d[_0x06b2('0x4f')]==='21'){agents[_0x461c4d['uniqueid']][_0x06b2('0x21')]=_0x06b2('0x50');agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]='rejected';}utils[_0x06b2('0x2')](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],agents[_0x461c4d['uniqueid']][_0x06b2('0x7')],agents[_0x461c4d['uniqueid']][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);var _0x38647d=unanswered['indexOf'](_0x461c4d[_0x06b2('0x13')]);if(_0x38647d>-0x1){unanswered[_0x06b2('0x52')](_0x38647d,0x1);}}if(transfers[_0x461c4d[_0x06b2('0x13')]]){transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](transfers[_0x461c4d['uniqueid']][_0x06b2('0x35')],transfers[_0x461c4d['uniqueid']]['agentconnectAt']);transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]='agent';transfers[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils['info'](util[_0x06b2('0x3')](_0x06b2('0x51'),_0x461c4d['uniqueid'],transfers[_0x461c4d['uniqueid']]['membername'],transfers[_0x461c4d['uniqueid']][_0x06b2('0x21')],transfers[_0x461c4d['uniqueid']][_0x06b2('0xb')]));writeDB(transfers[_0x461c4d[_0x06b2('0x13')]],!![]);}if(agents[_0x461c4d[_0x06b2('0x13')]]&&agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]){agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x33')]=!![];agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x35')]=utils[_0x06b2('0x19')]();agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x24')]=utils[_0x06b2('0x36')](agents[_0x461c4d['uniqueid']]['agentcompleteAt'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x2e')]);agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')]=agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x3c')]?'transfer':'agent';agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0xb')]=_0x06b2('0x37');utils[_0x06b2('0x2')](util[_0x06b2('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x461c4d[_0x06b2('0x13')],agents[_0x461c4d['uniqueid']]['membername'],agents[_0x461c4d[_0x06b2('0x13')]][_0x06b2('0x21')],agents[_0x461c4d['uniqueid']]['lastevent']));writeDB(agents[_0x461c4d[_0x06b2('0x13')]]);}}catch(_0x3fa469){utils['error'](util['format']('[%s][agents][hangup]',_0x461c4d['uniqueid']),_0x3fa469);}}; \ No newline at end of file +var _0xa9e0=['complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5dd881,_0x550fbc){utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x4'),_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['interface'],_0x5dd881[_0x0a9e('0x9')],_0x5dd881[_0x0a9e('0xa')],_0x5dd881[_0x0a9e('0xb')]));if(_0x5dd881['queue']){utils['getVoiceQueueByName'](_0x5dd881[_0x0a9e('0x7')])['then'](function(_0x52cace){if(_0x52cace){_0x5dd881[_0x0a9e('0xc')]=_0x52cace[_0x0a9e('0xc')];_0x5dd881[_0x0a9e('0xd')]=_0x5dd881[_0x0a9e('0xe')]?_0x52cace[_0x0a9e('0xf')]:![];_0x5dd881[_0x0a9e('0x10')]=_0x5dd881['agentacw']?_0x52cace['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x5dd881);});}else{utils[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x5dd881);}if(_0x550fbc){delete transfers[_0x5dd881[_0x0a9e('0x5')]];}else{delete agents[_0x5dd881[_0x0a9e('0x13')]];}}exports[_0x0a9e('0x14')]=function(_0x69aeb7){try{utils['debug'](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x69aeb7);agents[_0x69aeb7[_0x0a9e('0x13')]]=_0x69aeb7;agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x17')]=utils['now']();agents[_0x69aeb7[_0x0a9e('0x13')]]['lastevent']=_0x0a9e('0x18');agents[_0x69aeb7['destuniqueid']][_0x0a9e('0xa')]=null;agents[_0x69aeb7[_0x0a9e('0x13')]]['connectedlinename']=null;utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x19'),_0x69aeb7[_0x0a9e('0x5')],agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x69aeb7[_0x0a9e('0x13')]));}catch(_0x2eb11f){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x2eb11f);}};exports[_0x0a9e('0x1b')]=function(_0x105080){try{if(!_['isNil'](agents[_0x105080[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format'](_0x0a9e('0x1d'),_0x105080['uniqueid']),_0x105080);utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x1e'),_0x105080[_0x0a9e('0x5')],agents[_0x105080[_0x0a9e('0x13')]]['membername'],_0x105080[_0x0a9e('0x13')]));agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1b')]=!![];agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();agents[_0x105080[_0x0a9e('0x13')]]['lastevent']='timeout';agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x21')]=_0x0a9e('0x22');agents[_0x105080[_0x0a9e('0x13')]]['holdtime']=_0x105080[_0x0a9e('0x23')]?parseInt(_0x105080['ringtime'])/0x3e8:0x0;agents[_0x105080[_0x0a9e('0x13')]]['talktime']=0x0;unanswered[_0x0a9e('0x24')](_0x105080[_0x0a9e('0x13')]);}}catch(_0x25fba9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x1d'),_0x105080[_0x0a9e('0x5')]),_0x25fba9);}};exports[_0x0a9e('0x25')]=function(_0x5a101a){try{_[_0x0a9e('0x26')](agents,function(_0x468813,_0x2b1f27){if(_0x468813[_0x0a9e('0x5')]==_0x5a101a['uniqueid']&&!_[_0x0a9e('0x27')](unanswered,_0x468813[_0x0a9e('0x13')])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a[_0x0a9e('0x5')]),_0x5a101a);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x29'),_0x5a101a['uniqueid'],_0x468813[_0x0a9e('0x8')],_0x468813['destuniqueid']));_0x468813[_0x0a9e('0x1b')]=!![];_0x468813[_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();_0x468813[_0x0a9e('0xb')]=_0x0a9e('0x2a');_0x468813['reason']=_0x0a9e('0x2a');_0x468813[_0x0a9e('0x2b')]=_0x5a101a[_0x0a9e('0x2b')];_0x468813[_0x0a9e('0x2c')]=0x0;writeDB(_0x468813);}});}catch(_0x2b45ea){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a['uniqueid']),_0x2b45ea);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(agents[_0x5e7238[_0x0a9e('0x13')]]){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238['uniqueid']),_0x5e7238);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x2f'),_0x5e7238[_0x0a9e('0x5')],agents[_0x5e7238['destuniqueid']]['membername'],_0x5e7238[_0x0a9e('0x13')]));agents[_0x5e7238['destuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0xa')]=_0x5e7238['connectedlinenum'];agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0x31')]=_0x5e7238[_0x0a9e('0x31')];agents[_0x5e7238['destuniqueid']][_0x0a9e('0x2b')]=_0x5e7238[_0x0a9e('0x23')];agents[_0x5e7238[_0x0a9e('0x13')]]['lastevent']='connect';_[_0x0a9e('0x26')](agents,function(_0x40d766,_0x5adda1){if(_0x40d766[_0x0a9e('0x13')]!=_0x5e7238[_0x0a9e('0x13')]&&_0x40d766[_0x0a9e('0x5')]==_0x5e7238[_0x0a9e('0x5')]){_0x40d766['talktime']=0x0;_0x40d766['holdtime']=_0x5e7238[_0x0a9e('0x23')];_0x40d766[_0x0a9e('0x1b')]=!![];_0x40d766['agentringnoanswerAt']=utils[_0x0a9e('0x20')]();_0x40d766[_0x0a9e('0xb')]=_0x0a9e('0x32');_0x40d766['reason']=_0x0a9e('0x32');_0x40d766[_0x0a9e('0x33')]=_0x5e7238[_0x0a9e('0x13')];_0x40d766[_0x0a9e('0x34')]=_0x5e7238[_0x0a9e('0x8')];writeDB(_0x40d766);}});}}catch(_0xeaa5e5){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238[_0x0a9e('0x5')]),_0xeaa5e5);}};exports[_0x0a9e('0xe')]=function(_0x148007){try{if(!_[_0x0a9e('0x35')](agents[_0x148007[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x148007[_0x0a9e('0x5')]),_0x148007);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x36'),_0x148007[_0x0a9e('0x5')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x148007[_0x0a9e('0x13')]));agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0xe')]=!![];agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')]=utils['now']();agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x30')]);agents[_0x148007[_0x0a9e('0x13')]]['reason']=_0x148007[_0x0a9e('0x21')];agents[_0x148007['destuniqueid']][_0x0a9e('0xb')]=_0x0a9e('0x39');writeDB(agents[_0x148007[_0x0a9e('0x13')]]);}}catch(_0x562fb4){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x3a'),_0x148007[_0x0a9e('0x5')]),_0x562fb4);}};exports[_0x0a9e('0x3b')]=function(_0x37be73){try{if(!_[_0x0a9e('0x35')](agents[_0x37be73['transfereruniqueid']])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x37be73);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x3d'),_0x37be73[_0x0a9e('0x5')],agents[_0x37be73[_0x0a9e('0x3e')]]['membername'],agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x5')]));agents[_0x37be73['transfereruniqueid']]['transfer']=!![];agents[_0x37be73['transfereruniqueid']][_0x0a9e('0x3f')]=_0x0a9e('0x40');agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x41')]=_0x37be73[_0x0a9e('0x42')];agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x43')]=agents[_0x37be73[_0x0a9e('0x3e')]]['uniqueid'];}}catch(_0x4b1b9f){utils['error'](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x4b1b9f);}};exports['attendedtransfer']=function(_0x2b69d9){try{utils[_0x0a9e('0x1c')](util['format']('[%s][agents][attendedtransfer]',_0x2b69d9[_0x0a9e('0x44')]),_0x2b69d9);if(_0x2b69d9['origtransfereruniqueid']==_0x2b69d9[_0x0a9e('0x45')]){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x46')]])){utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x46')]]['membername']));agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x47')]=!![];agents[_0x2b69d9[_0x0a9e('0x46')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x41')]=_0x2b69d9['origtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x46')]]['transferuniqueid']=_0x2b69d9['origtransfereruniqueid'];}if(_0x2b69d9['transfereeuniqueid']&&agents[_0x2b69d9[_0x0a9e('0x49')]]){agents[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9[_0x0a9e('0x49')]]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x49')]]);transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x9')];transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x4c')];transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x17')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x2;}}else if(_0x2b69d9['secondtransfereruniqueid']==_0x2b69d9['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x44')]])){utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x4d'),_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x8')]));agents[_0x2b69d9[_0x0a9e('0x44')]]['transfer']=!![];agents[_0x2b69d9[_0x0a9e('0x44')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x41')]=_0x2b69d9['secondtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x43')]=_0x2b69d9[_0x0a9e('0x46')];}if(_0x2b69d9[_0x0a9e('0x4e')]&&agents[_0x2b69d9['transfertargetuniqueid']]){agents[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9['transfertargetuniqueid']]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x4e')]]);transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridnum'];transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridname'];transfers[_0x2b69d9[_0x0a9e('0x4e')]]['agentcalledAt']=utils['now']();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x2;}}}catch(_0x54a37d){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x4f'),_0x2b69d9[_0x0a9e('0x44')]),_0x54a37d);}};exports[_0x0a9e('0x50')]=function(_0x2b8192){try{utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x51'),_0x2b8192[_0x0a9e('0x5')]),_0x2b8192);if(agents[_0x2b8192['uniqueid']]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]===_0x0a9e('0x22')){if(_0x2b8192['cause']==='21'){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]='rejected';agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]=_0x0a9e('0x52');}utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b8192['uniqueid'],agents[_0x2b8192['uniqueid']][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);var _0xeef20=unanswered[_0x0a9e('0x53')](_0x2b8192['uniqueid']);if(_0xeef20>-0x1){unanswered[_0x0a9e('0x54')](_0xeef20,0x1);}}if(transfers[_0x2b8192[_0x0a9e('0x5')]]){transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcomplete']=!![];transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcompleteAt']=utils[_0x0a9e('0x20')]();transfers[_0x2b8192[_0x0a9e('0x5')]]['talktime']=utils[_0x0a9e('0x38')](transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')],transfers[_0x2b8192[_0x0a9e('0x5')]]['agentconnectAt']);transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]=_0x0a9e('0x55');transfers[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x56'),_0x2b8192['uniqueid'],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(transfers[_0x2b8192[_0x0a9e('0x5')]],!![]);}if(agents[_0x2b8192[_0x0a9e('0x5')]]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xe')]=!![];agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')]=utils['now']();agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x2b8192['uniqueid']][_0x0a9e('0x37')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]);agents[_0x2b8192[_0x0a9e('0x5')]]['reason']=agents[_0x2b8192['uniqueid']][_0x0a9e('0x47')]?_0x0a9e('0x47'):'agent';agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x56'),_0x2b8192[_0x0a9e('0x5')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);}}catch(_0x3ca9b9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')]('[%s][agents][hangup]',_0x2b8192[_0x0a9e('0x5')]),_0x3ca9b9);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index fb0a7cb..efe618a 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 _0x13e3=['newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','isNil','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','endtime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','noop','execif','gotoif','lastapplication','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error'];(function(_0x2f5fea,_0x3ba2c0){var _0x36fe14=function(_0x3bbfc0){while(--_0x3bbfc0){_0x2f5fea['push'](_0x2f5fea['shift']());}};_0x36fe14(++_0x3ba2c0);}(_0x13e3,0x196));var _0x313e=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x13e3[_0x47cfa0];return _0x386b1d;};'use strict';var _=require('lodash');var util=require(_0x313e('0x0'));var utils=require(_0x313e('0x1'));var transfers=require(_0x313e('0x2'));var dispositions=[_0x313e('0x3'),_0x313e('0x4'),'FAILED',_0x313e('0x3'),_0x313e('0x3'),_0x313e('0x3'),_0x313e('0x5'),_0x313e('0x6'),_0x313e('0x4'),_0x313e('0x4'),_0x313e('0x4')];var channels={};function writeDB(_0x2abffb){var _0x317672;if(transfers[_0x313e('0x7')][_0x2abffb[_0x313e('0x8')]]){_0x317672=_0x2abffb[_0x313e('0x8')];_0x2abffb[_0x313e('0x8')]=transfers[_0x313e('0x7')][_0x2abffb[_0x313e('0x8')]]['transfereeuniqueid'];}utils[_0x313e('0x9')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2abffb[_0x313e('0x8')],_0x2abffb[_0x313e('0xa')],_0x2abffb['queue'],_0x2abffb[_0x313e('0xb')],_0x2abffb[_0x313e('0xc')],_0x2abffb[_0x313e('0xd')],_0x2abffb['connectedlinenum'],_0x2abffb[_0x313e('0xe')]));if(_0x2abffb[_0x313e('0xf')]){utils[_0x313e('0x10')](_0x2abffb[_0x313e('0xf')])['then'](function(_0x49e224){if(_0x49e224){_0x2abffb[_0x313e('0x11')]=_0x49e224['id'];}utils[_0x313e('0x12')](_0x313e('0x13'),_0x2abffb);});}else{utils['request'](_0x313e('0x13'),_0x2abffb);}if(channels[_0x2abffb[_0x313e('0x8')]]){delete channels[_0x2abffb[_0x313e('0x8')]];}else if(_0x317672&&channels[_0x317672]){delete transfers[_0x313e('0x7')][_0x317672];delete channels[_0x317672];}}exports[_0x313e('0x14')]=function(_0x8cdf86){try{utils[_0x313e('0x15')](util[_0x313e('0x16')](_0x313e('0x17'),_0x8cdf86[_0x313e('0x8')]),_0x8cdf86);if(_0x8cdf86[_0x313e('0x8')]==_0x8cdf86[_0x313e('0x18')]&&_0x8cdf86[_0x313e('0xa')]!='OutgoingSpoolFailed'){utils['info'](util['format'](_0x313e('0x19'),_0x8cdf86['uniqueid'],_0x8cdf86[_0x313e('0x1a')],_0x8cdf86[_0x313e('0x1b')]));channels[_0x8cdf86['uniqueid']]={'uniqueid':_0x8cdf86['uniqueid'],'accountcode':_0x8cdf86[_0x313e('0xf')],'source':_0x8cdf86[_0x313e('0xd')],'destination':_0x8cdf86[_0x313e('0x1b')],'destinationcontext':_0x8cdf86[_0x313e('0x1a')],'channel':_0x8cdf86[_0x313e('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x313e('0x3'),'amaflags':_0x313e('0x1c')};}}catch(_0x454339){utils[_0x313e('0x1d')](util[_0x313e('0x16')]('[%s][calls][newchannel]',_0x8cdf86['uniqueid']),_0x454339);}};exports[_0x313e('0x1e')]=function(_0x5a98f7){try{utils[_0x313e('0x15')](util['format'](_0x313e('0x1f'),_0x5a98f7[_0x313e('0x8')]),_0x5a98f7);if(!_['isNil'](channels[_0x5a98f7[_0x313e('0x8')]])&&_0x5a98f7[_0x313e('0x20')]==0x6){utils['info'](util['format'](_0x313e('0x21'),_0x5a98f7[_0x313e('0x8')],_0x5a98f7['context'],_0x5a98f7[_0x313e('0xa')]));if(_['isNil'](channels[_0x5a98f7[_0x313e('0x8')]][_0x313e('0x22')])){channels[_0x5a98f7[_0x313e('0x8')]][_0x313e('0x22')]=utils[_0x313e('0x23')]();}}else if(!_[_0x313e('0x24')](channels[_0x5a98f7[_0x313e('0x18')]])&&_0x5a98f7[_0x313e('0x20')]==0x6&&_0x5a98f7[_0x313e('0x1a')]!=_0x313e('0x25')){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x26'),_0x5a98f7[_0x313e('0x8')],_0x5a98f7[_0x313e('0x18')],_0x5a98f7[_0x313e('0x1a')],_0x5a98f7['channel']));channels[_0x5a98f7[_0x313e('0x18')]][_0x313e('0xf')]=_0x5a98f7[_0x313e('0xf')];channels[_0x5a98f7[_0x313e('0x18')]][_0x313e('0x27')]=_0x5a98f7['channel'];if(_[_0x313e('0x24')](channels[_0x5a98f7[_0x313e('0x18')]]['answertime'])){channels[_0x5a98f7[_0x313e('0x18')]][_0x313e('0x28')]=utils[_0x313e('0x23')]();}channels[_0x5a98f7['linkedid']][_0x313e('0x29')]=dispositions[_[_0x313e('0x2a')](_0x5a98f7[_0x313e('0x20')])]||_0x313e('0x5');}}catch(_0x420b6a){utils['error'](util[_0x313e('0x16')](_0x313e('0x1f'),_0x5a98f7[_0x313e('0x8')]),_0x420b6a);}};exports[_0x313e('0x2b')]=function(_0x4ef533){try{if(!_['isNil'](channels[_0x4ef533['uniqueid']])){utils[_0x313e('0x15')](util[_0x313e('0x16')]('[%s][calls][hangup]',_0x4ef533['uniqueid']),_0x4ef533);if(_[_0x313e('0x24')](channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x2c')])){channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x2c')]=_0x4ef533[_0x313e('0x2d')]+'\x20<'+_0x4ef533[_0x313e('0xd')]+'>';}utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x2e'),_0x4ef533[_0x313e('0x8')],channels[_0x4ef533[_0x313e('0x8')]]['callerid'],_0x4ef533[_0x313e('0x2f')]));channels[_0x4ef533[_0x313e('0x8')]]['endtime']=utils[_0x313e('0x23')]();channels[_0x4ef533[_0x313e('0x8')]]['duration']=utils[_0x313e('0x30')](channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x31')],channels[_0x4ef533[_0x313e('0x8')]]['starttime']);channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x32')]=channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x28')]?utils[_0x313e('0x30')](channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x31')],channels[_0x4ef533[_0x313e('0x8')]][_0x313e('0x28')]):0x0;writeDB(channels[_0x4ef533[_0x313e('0x8')]]);}}catch(_0x5d90ac){utils[_0x313e('0x1d')](util['format'](_0x313e('0x33'),_0x4ef533[_0x313e('0x8')]),_0x5d90ac);}};exports[_0x313e('0x34')]=function(_0x59795a){try{if(!_['isNil'](channels[_0x59795a[_0x313e('0x35')]])){utils[_0x313e('0x15')](util['format'](_0x313e('0x36'),_0x59795a[_0x313e('0x37')]),_0x59795a);if(channels[_0x59795a[_0x313e('0x35')]][_0x313e('0xa')]==_0x59795a[_0x313e('0x38')]){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x39'),_0x59795a[_0x313e('0x37')],_0x59795a[_0x313e('0x35')],_0x59795a[_0x313e('0x3a')]));channels[_0x59795a[_0x313e('0x35')]][_0x313e('0x27')]=_0x59795a['secondtransfererchannel'];channels[_0x59795a[_0x313e('0x35')]][_0x313e('0x3b')]=_0x313e('0x3c');}else if(channels[_0x59795a[_0x313e('0x35')]][_0x313e('0xa')]=_0x59795a['transfertargetchannel']){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x39'),_0x59795a['origtransfereruniqueid'],_0x59795a['localtwolinkedid'],_0x59795a[_0x313e('0x3d')]));channels[_0x59795a['localtwolinkedid']][_0x313e('0x27')]=_0x59795a['origtransfererchannel'];channels[_0x59795a['localtwolinkedid']][_0x313e('0x3b')]=_0x313e('0x3c');}}}catch(_0x5d7951){utils[_0x313e('0x1d')](util['format'](_0x313e('0x36'),_0x59795a[_0x313e('0x37')]),_0x5d7951);}};exports['musiconholdstart']=function(_0x5e5686){try{if(!_[_0x313e('0x24')](channels[_0x5e5686[_0x313e('0x8')]])){utils[_0x313e('0x15')](util['format'](_0x313e('0x3e'),_0x5e5686[_0x313e('0x8')]),_0x5e5686);channels[_0x5e5686['uniqueid']][_0x313e('0x3f')]=utils[_0x313e('0x23')]();utils['info'](util[_0x313e('0x16')](_0x313e('0x40'),_0x5e5686[_0x313e('0x8')],channels[_0x5e5686[_0x313e('0x8')]][_0x313e('0x3f')]));}}catch(_0x5d38ca){utils[_0x313e('0x1d')](util[_0x313e('0x16')](_0x313e('0x3e'),_0x5e5686[_0x313e('0x8')]),_0x5d38ca);}};exports[_0x313e('0x41')]=function(_0x5348b4){try{if(!_['isNil'](channels[_0x5348b4[_0x313e('0x8')]])){utils['debug'](util['format'](_0x313e('0x42'),_0x5348b4[_0x313e('0x8')]),_0x5348b4);if(!_['isNil'](channels[_0x5348b4[_0x313e('0x8')]][_0x313e('0x3f')])){channels[_0x5348b4[_0x313e('0x8')]][_0x313e('0x43')]+=utils[_0x313e('0x30')](utils[_0x313e('0x23')](),channels[_0x5348b4[_0x313e('0x8')]]['musiconholdstartAt']);utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x44'),_0x5348b4[_0x313e('0x8')],channels[_0x5348b4['uniqueid']][_0x313e('0x43')]));delete channels[_0x5348b4[_0x313e('0x8')]][_0x313e('0x3f')];}}}catch(_0x4357bd){utils[_0x313e('0x1d')](util[_0x313e('0x16')](_0x313e('0x42'),_0x5348b4['uniqueid']),_0x4357bd);}};exports[_0x313e('0x45')]=function(_0x383652){try{if(!_[_0x313e('0x24')](channels[_0x383652['uniqueid']])){utils[_0x313e('0x15')](util['format'](_0x313e('0x46'),_0x383652[_0x313e('0x8')]),_0x383652);if(!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x48')])){utils[_0x313e('0x9')](util['format'](_0x313e('0x49'),_0x383652[_0x313e('0x8')],_0x383652['value']));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x4a')]=_0x383652[_0x313e('0x4b')];}if(!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x4c')])){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x4d'),_0x383652[_0x313e('0x8')],_0x383652[_0x313e('0x4b')]));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x4e')]=_0x383652[_0x313e('0x4b')];channels[_0x383652[_0x313e('0x8')]][_0x313e('0x2c')]='\x22'+_0x383652[_0x313e('0x4b')]+_0x313e('0x4f')+_0x383652[_0x313e('0x4b')]+'>';}if(!_[_0x313e('0x24')](_0x383652['variable'][_0x313e('0x50')])||!_['isNil'](_0x383652[_0x313e('0x47')][_0x313e('0x51')])){utils['info'](util[_0x313e('0x16')](_0x313e('0x52'),_0x383652[_0x313e('0x8')],!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x50')])?_0x313e('0x50'):_0x313e('0x51'),_0x383652[_0x313e('0x4b')]));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x2c')]=_0x383652[_0x313e('0x4b')];}if(!_[_0x313e('0x24')](_0x383652['variable'][_0x313e('0x53')])||!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x54')])){utils[_0x313e('0x9')](util[_0x313e('0x16')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x383652[_0x313e('0x8')],!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x53')])?'xmd-queue':_0x313e('0x54'),_0x383652[_0x313e('0x4b')]));channels[_0x383652[_0x313e('0x8')]]['lastapplication']='Queue';channels[_0x383652['uniqueid']][_0x313e('0x55')]=_0x383652[_0x313e('0x4b')];channels[_0x383652[_0x313e('0x8')]][_0x313e('0x56')]=!![];}if(!_[_0x313e('0x24')](_0x383652['variable']['xmd-contactid'])){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x57'),_0x383652['uniqueid'],_0x383652[_0x313e('0x4b')]));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x58')]=_0x383652[_0x313e('0x4b')];}if(!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')][_0x313e('0x59')])){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x5a'),_0x383652[_0x313e('0x8')],_0x383652[_0x313e('0x4b')]));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x5b')]=_0x383652[_0x313e('0x4b')];}if(!_[_0x313e('0x24')](_0x383652[_0x313e('0x47')]['outboundrouteid'])){utils[_0x313e('0x9')](util[_0x313e('0x16')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x383652['uniqueid'],_0x383652['value']));channels[_0x383652[_0x313e('0x8')]]['routeid']=_0x383652[_0x313e('0x4b')];}if(!_[_0x313e('0x24')](_0x383652['variable'][_0x313e('0x5c')])){utils[_0x313e('0x9')](util[_0x313e('0x16')](_0x313e('0x5d'),_0x383652['uniqueid'],_0x383652['value']));channels[_0x383652[_0x313e('0x8')]][_0x313e('0x5c')]=_0x383652[_0x313e('0x4b')];}}}catch(_0xf67779){utils[_0x313e('0x1d')](util[_0x313e('0x16')]('[%s][calls][varset]',_0x383652[_0x313e('0x8')]),_0xf67779);}};exports[_0x313e('0x5e')]=function(_0x5363cb){try{if(!_[_0x313e('0x24')](channels[_0x5363cb['uniqueid']])){utils[_0x313e('0x15')](util[_0x313e('0x16')](_0x313e('0x5f'),_0x5363cb[_0x313e('0x8')]),_0x5363cb);utils[_0x313e('0x9')](util['format'](_0x313e('0x60'),_0x5363cb[_0x313e('0x8')],_0x5363cb[_0x313e('0x61')],_0x5363cb[_0x313e('0x62')]));if(_0x5363cb[_0x313e('0x61')][_0x313e('0x63')]()==_0x313e('0x64')&&_[_0x313e('0x65')](_0x5363cb[_0x313e('0x62')]['toLowerCase'](),_0x313e('0x66'))){var _0xffced9=_0x5363cb[_0x313e('0x62')]['split']('=');var _0x355f4e=_0xffced9[0x0][_0x313e('0x67')](_0xffced9[0x0]['lastIndexOf']('(')+0x1,_0xffced9[0x0][_0x313e('0x68')](')'));var _0xf238d2=_0xffced9[0x1];channels[_0x5363cb[_0x313e('0x8')]][_0x355f4e]=_0xf238d2;}if(!_['includes'](['hangup',_0x313e('0x69'),_0x313e('0x6a'),_0x313e('0x64'),_0x313e('0x6b')],_0x5363cb[_0x313e('0x61')][_0x313e('0x63')]())){channels[_0x5363cb[_0x313e('0x8')]][_0x313e('0x6c')]=_0x5363cb[_0x313e('0x61')];channels[_0x5363cb[_0x313e('0x8')]][_0x313e('0x55')]=_0x5363cb['appdata'];}}}catch(_0x52270d){utils[_0x313e('0x1d')](util[_0x313e('0x16')]('[%s][calls][newexten]',_0x5363cb['uniqueid']),_0x52270d);}}; \ No newline at end of file +var _0xd080=['accountcode','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','calleridnum','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','lastIndexOf','includes','noop','execif','set','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','blinds','uniqueid','info','format','channel','queue','membername','interface','connectedlinenum','lastevent'];(function(_0x4f12f4,_0x607e84){var _0x566382=function(_0x13802b){while(--_0x13802b){_0x4f12f4['push'](_0x4f12f4['shift']());}};_0x566382(++_0x607e84);}(_0xd080,0xc5));var _0x0d08=function(_0x46de39,_0x85bfef){_0x46de39=_0x46de39-0x0;var _0x21ae8a=_0xd080[_0x46de39];return _0x21ae8a;};'use strict';var _=require(_0x0d08('0x0'));var util=require(_0x0d08('0x1'));var utils=require(_0x0d08('0x2'));var transfers=require(_0x0d08('0x3'));var dispositions=['NO\x20ANSWER',_0x0d08('0x4'),'FAILED',_0x0d08('0x5'),_0x0d08('0x5'),'NO\x20ANSWER',_0x0d08('0x6'),'BUSY',_0x0d08('0x4'),_0x0d08('0x4'),_0x0d08('0x4')];var channels={};function writeDB(_0x353af6){var _0x284526;if(transfers[_0x0d08('0x7')][_0x353af6[_0x0d08('0x8')]]){_0x284526=_0x353af6['uniqueid'];_0x353af6[_0x0d08('0x8')]=transfers[_0x0d08('0x7')][_0x353af6['uniqueid']]['transfereeuniqueid'];}utils[_0x0d08('0x9')](util[_0x0d08('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x353af6[_0x0d08('0x8')],_0x353af6[_0x0d08('0xb')],_0x353af6[_0x0d08('0xc')],_0x353af6[_0x0d08('0xd')],_0x353af6[_0x0d08('0xe')],_0x353af6['calleridnum'],_0x353af6[_0x0d08('0xf')],_0x353af6[_0x0d08('0x10')]));if(_0x353af6[_0x0d08('0x11')]){utils['getUserByInternal'](_0x353af6['accountcode'])[_0x0d08('0x12')](function(_0x1a9e82){if(_0x1a9e82){_0x353af6['UserId']=_0x1a9e82['id'];}utils[_0x0d08('0x13')]('CreateVoiceCallReport',_0x353af6);});}else{utils[_0x0d08('0x13')](_0x0d08('0x14'),_0x353af6);}if(channels[_0x353af6[_0x0d08('0x8')]]){delete channels[_0x353af6[_0x0d08('0x8')]];}else if(_0x284526&&channels[_0x284526]){delete transfers[_0x0d08('0x7')][_0x284526];delete channels[_0x284526];}}exports[_0x0d08('0x15')]=function(_0x577166){try{utils[_0x0d08('0x16')](util['format'](_0x0d08('0x17'),_0x577166[_0x0d08('0x8')]),_0x577166);if(_0x577166['uniqueid']==_0x577166[_0x0d08('0x18')]&&_0x577166['channel']!=_0x0d08('0x19')){utils[_0x0d08('0x9')](util[_0x0d08('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x577166[_0x0d08('0x8')],_0x577166['context'],_0x577166[_0x0d08('0x1a')]));channels[_0x577166['uniqueid']]={'uniqueid':_0x577166[_0x0d08('0x8')],'accountcode':_0x577166[_0x0d08('0x11')],'source':_0x577166[_0x0d08('0x1b')],'destination':_0x577166[_0x0d08('0x1a')],'destinationcontext':_0x577166[_0x0d08('0x1c')],'channel':_0x577166[_0x0d08('0xb')],'starttime':utils[_0x0d08('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x0d08('0x1e')};}}catch(_0x534b40){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')](_0x0d08('0x17'),_0x577166[_0x0d08('0x8')]),_0x534b40);}};exports[_0x0d08('0x20')]=function(_0x298728){try{utils[_0x0d08('0x16')](util[_0x0d08('0xa')](_0x0d08('0x21'),_0x298728[_0x0d08('0x8')]),_0x298728);if(!_['isNil'](channels[_0x298728['uniqueid']])&&_0x298728[_0x0d08('0x22')]==0x6){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x23'),_0x298728[_0x0d08('0x8')],_0x298728['context'],_0x298728[_0x0d08('0xb')]));if(_[_0x0d08('0x24')](channels[_0x298728['uniqueid']][_0x0d08('0x25')])){channels[_0x298728[_0x0d08('0x8')]]['systemanswertime']=utils[_0x0d08('0x1d')]();}}else if(!_['isNil'](channels[_0x298728['linkedid']])&&_0x298728[_0x0d08('0x22')]==0x6&&_0x298728['context']!=_0x0d08('0x26')){utils[_0x0d08('0x9')](util['format'](_0x0d08('0x27'),_0x298728[_0x0d08('0x8')],_0x298728[_0x0d08('0x18')],_0x298728[_0x0d08('0x1c')],_0x298728[_0x0d08('0xb')]));channels[_0x298728[_0x0d08('0x18')]][_0x0d08('0x11')]=_0x298728['accountcode'];channels[_0x298728[_0x0d08('0x18')]]['destinationchannel']=_0x298728['channel'];if(_[_0x0d08('0x24')](channels[_0x298728[_0x0d08('0x18')]][_0x0d08('0x28')])){channels[_0x298728[_0x0d08('0x18')]]['answertime']=utils['now']();}channels[_0x298728['linkedid']][_0x0d08('0x29')]=dispositions[_[_0x0d08('0x2a')](_0x298728[_0x0d08('0x22')])]||_0x0d08('0x6');}}catch(_0x20c394){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')]('[%s][calls][newstate]',_0x298728[_0x0d08('0x8')]),_0x20c394);}};exports['hangup']=function(_0x2ffbfe){try{if(!_[_0x0d08('0x24')](channels[_0x2ffbfe[_0x0d08('0x8')]])){utils['debug'](util[_0x0d08('0xa')](_0x0d08('0x2b'),_0x2ffbfe[_0x0d08('0x8')]),_0x2ffbfe);if(_[_0x0d08('0x24')](channels[_0x2ffbfe[_0x0d08('0x8')]]['callerid'])){channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x2c')]=_0x2ffbfe[_0x0d08('0x2d')]+'\x20<'+_0x2ffbfe[_0x0d08('0x1b')]+'>';}utils[_0x0d08('0x9')](util[_0x0d08('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x2ffbfe[_0x0d08('0x8')],channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x2c')],_0x2ffbfe[_0x0d08('0x2e')]));channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x2f')]=utils[_0x0d08('0x1d')]();channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x30')]=utils[_0x0d08('0x31')](channels[_0x2ffbfe[_0x0d08('0x8')]]['endtime'],channels[_0x2ffbfe['uniqueid']][_0x0d08('0x32')]);channels[_0x2ffbfe['uniqueid']][_0x0d08('0x33')]=channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x28')]?utils[_0x0d08('0x31')](channels[_0x2ffbfe[_0x0d08('0x8')]][_0x0d08('0x2f')],channels[_0x2ffbfe['uniqueid']][_0x0d08('0x28')]):0x0;writeDB(channels[_0x2ffbfe['uniqueid']]);}}catch(_0x5f16f2){utils['error'](util[_0x0d08('0xa')]('[%s][calls][hangup]',_0x2ffbfe[_0x0d08('0x8')]),_0x5f16f2);}};exports['attendedtransfer']=function(_0x90b905){try{if(!_[_0x0d08('0x24')](channels[_0x90b905['localtwolinkedid']])){utils[_0x0d08('0x16')](util[_0x0d08('0xa')](_0x0d08('0x34'),_0x90b905[_0x0d08('0x35')]),_0x90b905);if(channels[_0x90b905['localtwolinkedid']][_0x0d08('0xb')]==_0x90b905[_0x0d08('0x36')]){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x37'),_0x90b905[_0x0d08('0x35')],_0x90b905[_0x0d08('0x38')],_0x90b905[_0x0d08('0x39')]));channels[_0x90b905[_0x0d08('0x38')]][_0x0d08('0x3a')]=_0x90b905[_0x0d08('0x39')];channels[_0x90b905[_0x0d08('0x38')]][_0x0d08('0x3b')]=_0x0d08('0x3c');}else if(channels[_0x90b905[_0x0d08('0x38')]]['channel']=_0x90b905[_0x0d08('0x3d')]){utils['info'](util[_0x0d08('0xa')](_0x0d08('0x37'),_0x90b905['origtransfereruniqueid'],_0x90b905[_0x0d08('0x38')],_0x90b905[_0x0d08('0x3e')]));channels[_0x90b905[_0x0d08('0x38')]][_0x0d08('0x3a')]=_0x90b905[_0x0d08('0x3e')];channels[_0x90b905[_0x0d08('0x38')]]['userfield']=_0x0d08('0x3c');}}}catch(_0x25b248){utils[_0x0d08('0x1f')](util['format'](_0x0d08('0x34'),_0x90b905['origtransfereruniqueid']),_0x25b248);}};exports[_0x0d08('0x3f')]=function(_0x82a795){try{if(!_[_0x0d08('0x24')](channels[_0x82a795[_0x0d08('0x8')]])){utils[_0x0d08('0x16')](util[_0x0d08('0xa')](_0x0d08('0x40'),_0x82a795['uniqueid']),_0x82a795);channels[_0x82a795['uniqueid']][_0x0d08('0x41')]=utils[_0x0d08('0x1d')]();utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x42'),_0x82a795[_0x0d08('0x8')],channels[_0x82a795[_0x0d08('0x8')]][_0x0d08('0x41')]));}}catch(_0xa58f16){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')](_0x0d08('0x40'),_0x82a795['uniqueid']),_0xa58f16);}};exports[_0x0d08('0x43')]=function(_0x9188e2){try{if(!_[_0x0d08('0x24')](channels[_0x9188e2[_0x0d08('0x8')]])){utils[_0x0d08('0x16')](util[_0x0d08('0xa')](_0x0d08('0x44'),_0x9188e2[_0x0d08('0x8')]),_0x9188e2);if(!_[_0x0d08('0x24')](channels[_0x9188e2[_0x0d08('0x8')]][_0x0d08('0x41')])){channels[_0x9188e2[_0x0d08('0x8')]][_0x0d08('0x45')]+=utils[_0x0d08('0x31')](utils['now'](),channels[_0x9188e2[_0x0d08('0x8')]][_0x0d08('0x41')]);utils[_0x0d08('0x9')](util['format'](_0x0d08('0x46'),_0x9188e2['uniqueid'],channels[_0x9188e2['uniqueid']][_0x0d08('0x45')]));delete channels[_0x9188e2[_0x0d08('0x8')]]['musiconholdstartAt'];}}}catch(_0x22e08c){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')](_0x0d08('0x44'),_0x9188e2['uniqueid']),_0x22e08c);}};exports[_0x0d08('0x47')]=function(_0x20f519){try{if(!_[_0x0d08('0x24')](channels[_0x20f519[_0x0d08('0x8')]])){utils[_0x0d08('0x16')](util[_0x0d08('0xa')]('[%s][calls][varset]',_0x20f519[_0x0d08('0x8')]),_0x20f519);if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x49')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x20f519[_0x0d08('0x8')],_0x20f519['value']));channels[_0x20f519['uniqueid']]['source']=_0x20f519[_0x0d08('0x4a')];}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')]['xmd-phone'])){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x4b'),_0x20f519[_0x0d08('0x8')],_0x20f519[_0x0d08('0x4a')]));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x4c')]=_0x20f519['value'];channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x2c')]='\x22'+_0x20f519['value']+_0x0d08('0x4d')+_0x20f519[_0x0d08('0x4a')]+'>';}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x4e')])||!_[_0x0d08('0x24')](_0x20f519['variable']['xmd-callerid'])){utils['info'](util[_0x0d08('0xa')](_0x0d08('0x4f'),_0x20f519[_0x0d08('0x8')],!_[_0x0d08('0x24')](_0x20f519['variable'][_0x0d08('0x4e')])?_0x0d08('0x4e'):_0x0d08('0x50'),_0x20f519['value']));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x2c')]=_0x20f519[_0x0d08('0x4a')];}if(!_[_0x0d08('0x24')](_0x20f519['variable'][_0x0d08('0x51')])||!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x52')])){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x4f'),_0x20f519[_0x0d08('0x8')],!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x51')])?'xmd-queue':_0x0d08('0x52'),_0x20f519['value']));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x53')]='Queue';channels[_0x20f519['uniqueid']][_0x0d08('0x54')]=_0x20f519[_0x0d08('0x4a')];channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0xc')]=!![];}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x55')])){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x56'),_0x20f519[_0x0d08('0x8')],_0x20f519[_0x0d08('0x4a')]));channels[_0x20f519['uniqueid']][_0x0d08('0x57')]=_0x20f519[_0x0d08('0x4a')];}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x58')])){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x59'),_0x20f519[_0x0d08('0x8')],_0x20f519[_0x0d08('0x4a')]));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x5a')]=_0x20f519[_0x0d08('0x4a')];}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')][_0x0d08('0x5b')])){utils['info'](util[_0x0d08('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x20f519[_0x0d08('0x8')],_0x20f519[_0x0d08('0x4a')]));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x5c')]=_0x20f519[_0x0d08('0x4a')];}if(!_[_0x0d08('0x24')](_0x20f519[_0x0d08('0x48')]['sipcallid'])){utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x5d'),_0x20f519['uniqueid'],_0x20f519[_0x0d08('0x4a')]));channels[_0x20f519[_0x0d08('0x8')]][_0x0d08('0x5e')]=_0x20f519[_0x0d08('0x4a')];}}}catch(_0x553ed2){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')](_0x0d08('0x5f'),_0x20f519['uniqueid']),_0x553ed2);}};exports[_0x0d08('0x60')]=function(_0x155cdc){try{if(!_[_0x0d08('0x24')](channels[_0x155cdc[_0x0d08('0x8')]])){utils['debug'](util[_0x0d08('0xa')]('[%s][calls][newexten]',_0x155cdc['uniqueid']),_0x155cdc);utils[_0x0d08('0x9')](util[_0x0d08('0xa')](_0x0d08('0x61'),_0x155cdc['uniqueid'],_0x155cdc[_0x0d08('0x62')],_0x155cdc[_0x0d08('0x63')]));if(_0x155cdc['application'][_0x0d08('0x64')]()=='set'&&_['startsWith'](_0x155cdc[_0x0d08('0x63')]['toLowerCase'](),_0x0d08('0x65'))){var _0x2c7692=_0x155cdc['appdata']['split']('=');var _0x37a6d8=_0x2c7692[0x0]['substring'](_0x2c7692[0x0][_0x0d08('0x66')]('(')+0x1,_0x2c7692[0x0]['lastIndexOf'](')'));var _0x5ae2ee=_0x2c7692[0x1];channels[_0x155cdc[_0x0d08('0x8')]][_0x37a6d8]=_0x5ae2ee;}if(!_[_0x0d08('0x67')](['hangup',_0x0d08('0x68'),_0x0d08('0x69'),_0x0d08('0x6a'),'gotoif'],_0x155cdc[_0x0d08('0x62')][_0x0d08('0x64')]())){channels[_0x155cdc[_0x0d08('0x8')]][_0x0d08('0x53')]=_0x155cdc['application'];channels[_0x155cdc['uniqueid']][_0x0d08('0x54')]=_0x155cdc[_0x0d08('0x63')];}}}catch(_0x371c06){utils[_0x0d08('0x1f')](util[_0x0d08('0xa')]('[%s][calls][newexten]',_0x155cdc['uniqueid']),_0x371c06);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 5316e5c..eb46f61 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 _0x087b=['info','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','managerevent','./utils','shutdown'];(function(_0x591d41,_0x359161){var _0x4231f3=function(_0x3b08c9){while(--_0x3b08c9){_0x591d41['push'](_0x591d41['shift']());}};_0x4231f3(++_0x359161);}(_0x087b,0xa0));var _0xb087=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x087b[_0x56916d];return _0x2b7f1f;};'use strict';var utils=require(_0xb087('0x0'));exports['connect']=function(){utils['info']('[core]\x20connected');};exports[_0xb087('0x1')]=function(){utils[_0xb087('0x2')](_0xb087('0x3'));};exports[_0xb087('0x4')]=function(){utils[_0xb087('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x20399a){utils[_0xb087('0x5')](_0xb087('0x6'),_0x20399a);};exports[_0xb087('0x7')]=function(){utils[_0xb087('0x2')]('[core]\x20close');};exports[_0xb087('0x8')]=function(_0x37efc2){}; \ No newline at end of file +var _0x68cb=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x68cb,0xc2));var _0xb68c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68cb[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xb68c('0x0'));exports[_0xb68c('0x1')]=function(){utils[_0xb68c('0x2')](_0xb68c('0x3'));};exports['shutdown']=function(){utils[_0xb68c('0x2')](_0xb68c('0x4'));};exports[_0xb68c('0x5')]=function(){utils['info'](_0xb68c('0x6'));};exports[_0xb68c('0x7')]=function(_0x525f1b){utils[_0xb68c('0x7')]('[core]\x20error',_0x525f1b);};exports[_0xb68c('0x8')]=function(){utils[_0xb68c('0x2')](_0xb68c('0x9'));};exports[_0xb68c('0xa')]=function(_0x56d6c3){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 53c9fd7..fd0bf51 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 _0xc85c=['toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','value','debug','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','holdtime','diffTime','endtime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstatus','request','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x2f7c40,_0xb36203){var _0x57a4a5=function(_0x47db35){while(--_0x47db35){_0x2f7c40['push'](_0x2f7c40['shift']());}};_0x57a4a5(++_0xb36203);}(_0xc85c,0x1d3));var _0xcc85=function(_0xca6909,_0x31d421){_0xca6909=_0xca6909-0x0;var _0x44d08e=_0xc85c[_0xca6909];return _0x44d08e;};'use strict';var _=require(_0xcc85('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xa9b742){utils[_0xcc85('0x1')](util[_0xcc85('0x2')](_0xcc85('0x3'),_0xa9b742[_0xcc85('0x4')],_0xa9b742[_0xcc85('0x5')],_0xa9b742['dialstring'],_0xa9b742['calleridnum'],_0xa9b742['connectedlinenum'],_0xa9b742[_0xcc85('0x6')]));utils[_0xcc85('0x7')]('CreateVoiceDialReport',_0xa9b742);delete dials[_0xa9b742[_0xcc85('0x4')]];}exports[_0xcc85('0x8')]=function(_0x427973){try{utils['debug'](util[_0xcc85('0x2')](_0xcc85('0x9'),_0x427973[_0xcc85('0x4')]),_0x427973);utils['info'](util[_0xcc85('0x2')](_0xcc85('0xa'),_0x427973['uniqueid'],_0x427973[_0xcc85('0xb')],_0x427973[_0xcc85('0xc')]));if(_0x427973[_0xcc85('0xb')][_0xcc85('0xd')]()==_0xcc85('0xe')&&_[_0xcc85('0xf')](_0x427973[_0xcc85('0xc')][_0xcc85('0xd')](),_0xcc85('0x10'))){var _0xdaa61=_0x427973[_0xcc85('0xc')][_0xcc85('0x11')]('=');dials[_0x427973['uniqueid']]={'routeId':_0xdaa61[0x1]};}}catch(_0xbebf69){utils[_0xcc85('0x12')](util['format'](_0xcc85('0x9'),_0x427973[_0xcc85('0x4')]),_0xbebf69);}};exports[_0xcc85('0x13')]=function(_0x5d5ebd){try{utils['debug'](util[_0xcc85('0x2')](_0xcc85('0x14'),_0x5d5ebd[_0xcc85('0x4')]),_0x5d5ebd);if(!_[_0xcc85('0x15')](_0x5d5ebd[_0xcc85('0x16')]['outboundrouteid'])){utils[_0xcc85('0x1')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x5d5ebd[_0xcc85('0x4')],_0x5d5ebd['value']));dials[_0x5d5ebd[_0xcc85('0x4')]]={'routeId':_0x5d5ebd[_0xcc85('0x17')]};}}catch(_0x2f820a){utils[_0xcc85('0x12')](util['format'](_0xcc85('0x14'),_0x5d5ebd[_0xcc85('0x4')]),_0x2f820a);}};exports['dialbegin']=function(_0x41ba26){try{if(!_['isNil'](dials[_0x41ba26[_0xcc85('0x4')]])){utils[_0xcc85('0x18')](util[_0xcc85('0x2')]('[%s][dials][dialbegin]',_0x41ba26[_0xcc85('0x4')]),_0x41ba26);dials[_0x41ba26[_0xcc85('0x4')]]=_[_0xcc85('0x19')](dials[_0x41ba26[_0xcc85('0x4')]],_0x41ba26);dials[_0x41ba26[_0xcc85('0x4')]][_0xcc85('0x1a')]=utils[_0xcc85('0x1b')]();dials[_0x41ba26[_0xcc85('0x4')]][_0xcc85('0x1c')]=_0xcc85('0x1d');utils[_0xcc85('0x1')](util[_0xcc85('0x2')](_0xcc85('0x1e'),_0x41ba26['uniqueid'],dials[_0x41ba26[_0xcc85('0x4')]][_0xcc85('0x1a')]));}}catch(_0x151d73){utils['error'](util[_0xcc85('0x2')](_0xcc85('0x1f'),_0x41ba26[_0xcc85('0x4')]),_0x151d73);}};exports[_0xcc85('0x20')]=function(_0x422688){try{if(!_[_0xcc85('0x15')](dials[_0x422688[_0xcc85('0x4')]])){utils[_0xcc85('0x18')](util['format'](_0xcc85('0x21'),_0x422688[_0xcc85('0x4')]),_0x422688);dials[_0x422688[_0xcc85('0x4')]]['dialstatus']=_0x422688[_0xcc85('0x6')];if(_0x422688['dialstatus']=='ANSWER'){dials[_0x422688['uniqueid']]=_['assign'](dials[_0x422688[_0xcc85('0x4')]],_0x422688);dials[_0x422688[_0xcc85('0x4')]][_0xcc85('0x22')]=utils[_0xcc85('0x1b')]();dials[_0x422688[_0xcc85('0x4')]]['lastevent']=_0xcc85('0x23');utils['info'](util[_0xcc85('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x422688[_0xcc85('0x4')],_0x422688[_0xcc85('0x6')],dials[_0x422688[_0xcc85('0x4')]][_0xcc85('0x22')]));}else{utils['info'](util[_0xcc85('0x2')](_0xcc85('0x24'),_0x422688[_0xcc85('0x4')],_0x422688['dialstatus']));}}}catch(_0x164f71){utils[_0xcc85('0x12')](util[_0xcc85('0x2')](_0xcc85('0x21'),_0x422688[_0xcc85('0x4')]),_0x164f71);}};exports[_0xcc85('0x25')]=function(_0x510626){try{if(!_['isNil'](dials[_0x510626[_0xcc85('0x4')]])){utils[_0xcc85('0x18')](util[_0xcc85('0x2')](_0xcc85('0x26'),_0x510626[_0xcc85('0x4')]),_0x510626);utils[_0xcc85('0x1')](util['format'](_0xcc85('0x27'),_0x510626['uniqueid'],_0x510626['calleridnum'],_0x510626[_0xcc85('0x28')],_0x510626[_0xcc85('0x29')]));dials[_0x510626[_0xcc85('0x4')]]=_[_0xcc85('0x19')](dials[_0x510626[_0xcc85('0x4')]],{'endtime':utils[_0xcc85('0x1b')](),'lastevent':_0xcc85('0x2a')});dials[_0x510626[_0xcc85('0x4')]][_0xcc85('0x2b')]=utils['diffTime'](dials[_0x510626[_0xcc85('0x4')]]['endtime'],dials[_0x510626['uniqueid']][_0xcc85('0x1a')]);dials[_0x510626[_0xcc85('0x4')]][_0xcc85('0x2c')]=utils[_0xcc85('0x2d')](dials[_0x510626[_0xcc85('0x4')]][_0xcc85('0x22')]||dials[_0x510626['uniqueid']][_0xcc85('0x2e')],dials[_0x510626['uniqueid']][_0xcc85('0x1a')]);dials[_0x510626[_0xcc85('0x4')]][_0xcc85('0x2f')]=dials[_0x510626['uniqueid']][_0xcc85('0x22')]?utils[_0xcc85('0x2d')](dials[_0x510626[_0xcc85('0x4')]]['endtime'],dials[_0x510626['uniqueid']][_0xcc85('0x22')]):0x0;writeDB(dials[_0x510626[_0xcc85('0x4')]]);}}catch(_0x542351){utils[_0xcc85('0x12')](util[_0xcc85('0x2')]('[%s][dials][hangup]',_0x510626['uniqueid']),_0x542351);}}; \ No newline at end of file +var _0x0197=['[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]','dialend','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','error','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','holdtime','answertime','endtime','billableseconds','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','application','appdata','toLowerCase','startsWith','cdr(routeid)'];(function(_0x38e56a,_0x492044){var _0x21358f=function(_0x3a3d00){while(--_0x3a3d00){_0x38e56a['push'](_0x38e56a['shift']());}};_0x21358f(++_0x492044);}(_0x0197,0x1ec));var _0x7019=function(_0x2f44fb,_0x568ef4){_0x2f44fb=_0x2f44fb-0x0;var _0x1a0f2f=_0x0197[_0x2f44fb];return _0x1a0f2f;};'use strict';var _=require('lodash');var util=require(_0x7019('0x0'));var utils=require(_0x7019('0x1'));var dials={};function writeDB(_0x1d89ab){utils[_0x7019('0x2')](util['format'](_0x7019('0x3'),_0x1d89ab[_0x7019('0x4')],_0x1d89ab['channel'],_0x1d89ab[_0x7019('0x5')],_0x1d89ab[_0x7019('0x6')],_0x1d89ab['connectedlinenum'],_0x1d89ab[_0x7019('0x7')]));utils[_0x7019('0x8')](_0x7019('0x9'),_0x1d89ab);delete dials[_0x1d89ab[_0x7019('0x4')]];}exports[_0x7019('0xa')]=function(_0x3de037){try{utils[_0x7019('0xb')](util[_0x7019('0xc')]('[%s][dials][newexten]',_0x3de037[_0x7019('0x4')]),_0x3de037);utils['info'](util[_0x7019('0xc')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3de037['uniqueid'],_0x3de037[_0x7019('0xd')],_0x3de037[_0x7019('0xe')]));if(_0x3de037[_0x7019('0xd')][_0x7019('0xf')]()=='set'&&_[_0x7019('0x10')](_0x3de037[_0x7019('0xe')][_0x7019('0xf')](),_0x7019('0x11'))){var _0x573214=_0x3de037['appdata']['split']('=');dials[_0x3de037[_0x7019('0x4')]]={'routeId':_0x573214[0x1]};}}catch(_0x314205){utils['error'](util[_0x7019('0xc')](_0x7019('0x12'),_0x3de037[_0x7019('0x4')]),_0x314205);}};exports['varset']=function(_0x4ceaa4){try{utils[_0x7019('0xb')](util[_0x7019('0xc')](_0x7019('0x13'),_0x4ceaa4[_0x7019('0x4')]),_0x4ceaa4);if(!_[_0x7019('0x14')](_0x4ceaa4[_0x7019('0x15')]['outboundrouteid'])){utils[_0x7019('0x2')](util['format'](_0x7019('0x16'),_0x4ceaa4['uniqueid'],_0x4ceaa4[_0x7019('0x17')]));dials[_0x4ceaa4[_0x7019('0x4')]]={'routeId':_0x4ceaa4[_0x7019('0x17')]};}}catch(_0x1e01e5){utils['error'](util[_0x7019('0xc')](_0x7019('0x13'),_0x4ceaa4[_0x7019('0x4')]),_0x1e01e5);}};exports[_0x7019('0x18')]=function(_0xc23e4a){try{if(!_['isNil'](dials[_0xc23e4a[_0x7019('0x4')]])){utils[_0x7019('0xb')](util[_0x7019('0xc')]('[%s][dials][dialbegin]',_0xc23e4a[_0x7019('0x4')]),_0xc23e4a);dials[_0xc23e4a[_0x7019('0x4')]]=_['assign'](dials[_0xc23e4a[_0x7019('0x4')]],_0xc23e4a);dials[_0xc23e4a[_0x7019('0x4')]]['starttime']=utils[_0x7019('0x19')]();dials[_0xc23e4a[_0x7019('0x4')]][_0x7019('0x1a')]=_0x7019('0x1b');utils[_0x7019('0x2')](util[_0x7019('0xc')](_0x7019('0x1c'),_0xc23e4a['uniqueid'],dials[_0xc23e4a[_0x7019('0x4')]][_0x7019('0x1d')]));}}catch(_0xb6cc23){utils['error'](util[_0x7019('0xc')](_0x7019('0x1e'),_0xc23e4a['uniqueid']),_0xb6cc23);}};exports[_0x7019('0x1f')]=function(_0x1a397f){try{if(!_['isNil'](dials[_0x1a397f[_0x7019('0x4')]])){utils[_0x7019('0xb')](util[_0x7019('0xc')]('[%s][dials][dialend]',_0x1a397f['uniqueid']),_0x1a397f);dials[_0x1a397f[_0x7019('0x4')]]['dialstatus']=_0x1a397f['dialstatus'];if(_0x1a397f['dialstatus']==_0x7019('0x20')){dials[_0x1a397f[_0x7019('0x4')]]=_[_0x7019('0x21')](dials[_0x1a397f['uniqueid']],_0x1a397f);dials[_0x1a397f['uniqueid']]['answertime']=utils['now']();dials[_0x1a397f[_0x7019('0x4')]][_0x7019('0x1a')]=_0x7019('0x22');utils[_0x7019('0x2')](util['format'](_0x7019('0x23'),_0x1a397f['uniqueid'],_0x1a397f[_0x7019('0x7')],dials[_0x1a397f['uniqueid']]['answertime']));}else{utils[_0x7019('0x2')](util['format'](_0x7019('0x24'),_0x1a397f[_0x7019('0x4')],_0x1a397f[_0x7019('0x7')]));}}}catch(_0x2a0af4){utils[_0x7019('0x25')](util[_0x7019('0xc')](_0x7019('0x26'),_0x1a397f[_0x7019('0x4')]),_0x2a0af4);}};exports[_0x7019('0x27')]=function(_0x108bb8){try{if(!_[_0x7019('0x14')](dials[_0x108bb8[_0x7019('0x4')]])){utils['debug'](util[_0x7019('0xc')](_0x7019('0x28'),_0x108bb8[_0x7019('0x4')]),_0x108bb8);utils[_0x7019('0x2')](util[_0x7019('0xc')](_0x7019('0x29'),_0x108bb8[_0x7019('0x4')],_0x108bb8[_0x7019('0x6')],_0x108bb8[_0x7019('0x2a')],_0x108bb8[_0x7019('0x2b')]));dials[_0x108bb8[_0x7019('0x4')]]=_[_0x7019('0x21')](dials[_0x108bb8['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x7019('0x2c')});dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x2d')]=utils[_0x7019('0x2e')](dials[_0x108bb8[_0x7019('0x4')]]['endtime'],dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x1d')]);dials[_0x108bb8['uniqueid']][_0x7019('0x2f')]=utils[_0x7019('0x2e')](dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x30')]||dials[_0x108bb8['uniqueid']][_0x7019('0x31')],dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x1d')]);dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x32')]=dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x30')]?utils[_0x7019('0x2e')](dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x31')],dials[_0x108bb8[_0x7019('0x4')]][_0x7019('0x30')]):0x0;writeDB(dials[_0x108bb8[_0x7019('0x4')]]);}}catch(_0x2311bb){utils[_0x7019('0x25')](util[_0x7019('0xc')](_0x7019('0x28'),_0x108bb8['uniqueid']),_0x2311bb);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 99bc2c6..faeaf01 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 _0x1fb8=['username','password','keepConnected','xdr','disabled','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','../../config/environment','asterisk'];(function(_0x430645,_0x3b8362){var _0x2f3c90=function(_0x585c29){while(--_0x585c29){_0x430645['push'](_0x430645['shift']());}};_0x2f3c90(++_0x3b8362);}(_0x1fb8,0xf6));var _0x81fb=function(_0xd158dc,_0x128608){_0xd158dc=_0xd158dc-0x0;var _0x12d25f=_0x1fb8[_0xd158dc];return _0x12d25f;};var AsteriskManager=require('asterisk-manager');var config=require(_0x81fb('0x0'));var utils=require('./utils');var util=require('util');var ami=new AsteriskManager(config[_0x81fb('0x1')]['port'],config[_0x81fb('0x1')]['ip'],config[_0x81fb('0x1')][_0x81fb('0x2')],config[_0x81fb('0x1')][_0x81fb('0x3')],!![]);ami[_0x81fb('0x4')]();if(config[_0x81fb('0x5')]&&config[_0x81fb('0x5')][_0x81fb('0x6')]){utils[_0x81fb('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0x81fb('0x8'));var calls=require('./calls.controller');var queues=require(_0x81fb('0x9'));var recordings=require(_0x81fb('0xa'));var members=require(_0x81fb('0xb'));var dials=require(_0x81fb('0xc'));var transfers=require(_0x81fb('0xd'));var core=require(_0x81fb('0xe'));ami['on'](_0x81fb('0xf'),core[_0x81fb('0xf')]);ami['on'](_0x81fb('0x10'),core[_0x81fb('0x10')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x81fb('0x11'),core[_0x81fb('0x11')]);ami['on'](_0x81fb('0x12'),core[_0x81fb('0x12')]);ami['on']('managerevent',core[_0x81fb('0x13')]);ami['on'](_0x81fb('0x14'),function(_0x3ad295){try{utils[_0x81fb('0x15')](util['format'](_0x81fb('0x16'),_0x3ad295[_0x81fb('0x17')]),_0x3ad295);members[_0x81fb('0x14')](_0x3ad295);}catch(_0x64ac7){utils['error'](util[_0x81fb('0x18')](_0x81fb('0x16'),_0x3ad295[_0x81fb('0x17')]),_0x64ac7);}});ami['on']('agentcalled',function(_0x1c36ff){try{utils['debug'](util[_0x81fb('0x18')](_0x81fb('0x19'),_0x1c36ff[_0x81fb('0x1a')]),_0x1c36ff);agents[_0x81fb('0x1b')](_0x1c36ff);}catch(_0x29de10){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x19'),_0x1c36ff[_0x81fb('0x1a')]),_0x29de10);}});ami['on']('agentringnoanswer',function(_0x2690fd){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x1c'),_0x2690fd[_0x81fb('0x1a')]),_0x2690fd);agents[_0x81fb('0x1d')](_0x2690fd);}catch(_0x1c39cb){utils[_0x81fb('0x11')](util[_0x81fb('0x18')]('[%s][index][agentringnoanswer]',_0x2690fd[_0x81fb('0x1a')]),_0x1c39cb);}});ami['on'](_0x81fb('0x1e'),function(_0x3020ea){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x1f'),_0x3020ea[_0x81fb('0x1a')]),_0x3020ea);agents[_0x81fb('0x1e')](_0x3020ea);queues[_0x81fb('0x1e')](_0x3020ea);}catch(_0x11f708){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x1f'),_0x3020ea[_0x81fb('0x1a')]),_0x11f708);}});ami['on'](_0x81fb('0x20'),function(_0x3be7c9){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')]('[%s][index][agentcomplete]',_0x3be7c9['uniqueid']),_0x3be7c9);agents[_0x81fb('0x20')](_0x3be7c9);queues['agentcomplete'](_0x3be7c9);members[_0x81fb('0x20')](_0x3be7c9);}catch(_0xea5be6){utils['error'](util['format'](_0x81fb('0x21'),_0x3be7c9[_0x81fb('0x1a')]),_0xea5be6);}});ami['on']('queuecallerabandon',function(_0x58fcee){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x22'),_0x58fcee[_0x81fb('0x1a')]),_0x58fcee);agents[_0x81fb('0x23')](_0x58fcee);queues['queuecallerabandon'](_0x58fcee);}catch(_0x310e6e){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x22'),_0x58fcee[_0x81fb('0x1a')]),_0x310e6e);}});ami['on'](_0x81fb('0x24'),function(_0x2b753e){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x25'),_0x2b753e[_0x81fb('0x1a')]),_0x2b753e);queues[_0x81fb('0x24')](_0x2b753e);recordings[_0x81fb('0x24')](_0x2b753e);}catch(_0x35c068){utils[_0x81fb('0x11')](util['format'](_0x81fb('0x25'),_0x2b753e[_0x81fb('0x1a')]),_0x35c068);}});ami['on'](_0x81fb('0x26'),function(_0x4091fc){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')]('[%s][index][queuecallerleave]',_0x4091fc[_0x81fb('0x1a')]),_0x4091fc);queues[_0x81fb('0x26')](_0x4091fc);}catch(_0x212311){utils['error'](util[_0x81fb('0x18')](_0x81fb('0x27'),_0x4091fc[_0x81fb('0x1a')]),_0x212311);}});ami['on'](_0x81fb('0x28'),function(_0x1d1172){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')]('[%s][index][musiconholdstart]',_0x1d1172[_0x81fb('0x1a')]),_0x1d1172);queues['musiconholdstart'](_0x1d1172);calls[_0x81fb('0x28')](_0x1d1172);}catch(_0x382641){utils['error'](util[_0x81fb('0x18')](_0x81fb('0x29'),_0x1d1172[_0x81fb('0x1a')]),_0x382641);}});ami['on'](_0x81fb('0x2a'),function(_0x16f337){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')]('[%s][index][musiconholdstop]',_0x16f337[_0x81fb('0x1a')]),_0x16f337);queues[_0x81fb('0x2a')](_0x16f337);calls[_0x81fb('0x2a')](_0x16f337);}catch(_0x1c12ed){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x2b'),_0x16f337[_0x81fb('0x1a')]),_0x1c12ed);}});ami['on'](_0x81fb('0x2c'),function(_0x355bb5){try{utils['debug'](util['format']('[%s][index][newstate]',_0x355bb5[_0x81fb('0x1a')]),_0x355bb5);calls[_0x81fb('0x2c')](_0x355bb5);recordings[_0x81fb('0x2c')](_0x355bb5);}catch(_0x1dad40){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x2d'),_0x355bb5['uniqueid']),_0x1dad40);}});ami['on']('hangup',function(_0x1311cf){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x2e'),_0x1311cf[_0x81fb('0x1a')]),_0x1311cf);calls[_0x81fb('0x2f')](_0x1311cf);recordings['hangup'](_0x1311cf);dials[_0x81fb('0x2f')](_0x1311cf);agents['hangup'](_0x1311cf);queues[_0x81fb('0x2f')](_0x1311cf);}catch(_0x32893c){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x2e'),_0x1311cf[_0x81fb('0x1a')]),_0x32893c);}});ami['on'](_0x81fb('0x30'),function(_0x1a1920){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x31'),_0x1a1920[_0x81fb('0x1a')]),_0x1a1920);members[_0x81fb('0x30')](_0x1a1920);}catch(_0x440655){utils['error'](util[_0x81fb('0x18')](_0x81fb('0x31'),_0x1a1920[_0x81fb('0x1a')]),_0x440655);}});ami['on'](_0x81fb('0x32'),function(_0x58ac39){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x33'),_0x58ac39[_0x81fb('0x1a')]),_0x58ac39);queues[_0x81fb('0x32')](_0x58ac39);agents['blindtransfer'](_0x58ac39);transfers[_0x81fb('0x32')](_0x58ac39);}catch(_0xa51550){utils[_0x81fb('0x11')](util[_0x81fb('0x18')]('[%s][index][blindtransfer]',_0x58ac39[_0x81fb('0x1a')]),_0xa51550);}});ami['on']('attendedtransfer',function(_0x21d624){try{utils['debug'](util['format'](_0x81fb('0x34'),_0x21d624['origtransfereruniqueid']),_0x21d624);queues[_0x81fb('0x35')](_0x21d624);transfers[_0x81fb('0x35')](_0x21d624);agents[_0x81fb('0x35')](_0x21d624);calls[_0x81fb('0x35')](_0x21d624);}catch(_0x14233c){utils[_0x81fb('0x11')](util['format'](_0x81fb('0x34'),_0x21d624['origtransfereruniqueid']),_0x14233c);}});ami['on'](_0x81fb('0x36'),function(_0x4410de){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x37'),_0x4410de[_0x81fb('0x1a')]),_0x4410de);queues[_0x81fb('0x36')](_0x4410de);recordings['varset'](_0x4410de);calls[_0x81fb('0x36')](_0x4410de);dials[_0x81fb('0x36')](_0x4410de);}catch(_0x50d207){utils[_0x81fb('0x11')](util[_0x81fb('0x18')](_0x81fb('0x37'),_0x4410de[_0x81fb('0x1a')]),_0x50d207);}});ami['on'](_0x81fb('0x38'),function(_0x43ad5a){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')]('[%s][index][newexten]',_0x43ad5a[_0x81fb('0x1a')]),_0x43ad5a);calls[_0x81fb('0x38')](_0x43ad5a);recordings[_0x81fb('0x38')](_0x43ad5a);dials[_0x81fb('0x38')](_0x43ad5a);}catch(_0xfbeae5){utils[_0x81fb('0x11')](util[_0x81fb('0x18')]('[%s][index][newexten]',_0x43ad5a[_0x81fb('0x1a')]),_0xfbeae5);}});ami['on'](_0x81fb('0x39'),function(_0xd1a956){try{utils[_0x81fb('0x15')](util[_0x81fb('0x18')](_0x81fb('0x3a'),_0xd1a956[_0x81fb('0x1a')]),_0xd1a956);calls[_0x81fb('0x39')](_0xd1a956);recordings['newchannel'](_0xd1a956);}catch(_0x1a0aff){utils[_0x81fb('0x11')](util['format'](_0x81fb('0x3a'),_0xd1a956[_0x81fb('0x1a')]),_0x1a0aff);}});ami['on']('dialbegin',function(_0x1b490c){try{utils[_0x81fb('0x15')](util['format'](_0x81fb('0x3b'),_0x1b490c['uniqueid']),_0x1b490c);dials[_0x81fb('0x3c')](_0x1b490c);}catch(_0x68cbf0){utils['error'](util[_0x81fb('0x18')](_0x81fb('0x3d'),_0x1b490c[_0x81fb('0x1a')]),_0x68cbf0);}});ami['on']('dialend',function(_0x421f52){try{utils[_0x81fb('0x15')](util['format']('[%s][index][dialend]',_0x421f52['uniqueid']),_0x421f52);dials['dialend'](_0x421f52);}catch(_0x40d297){utils[_0x81fb('0x11')](util[_0x81fb('0x18')]('[%s][index][dialend]',_0x421f52['uniqueid']),_0x40d297);}});} \ No newline at end of file +var _0xe6c9=['[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','shutdown','fullybooted','close','managerevent','devicestatechange','device','error','format','[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid'];(function(_0x5db4e8,_0xf842b9){var _0x454684=function(_0x51a62f){while(--_0x51a62f){_0x5db4e8['push'](_0x5db4e8['shift']());}};_0x454684(++_0xf842b9);}(_0xe6c9,0x15f));var _0x9e6c=function(_0x359aeb,_0xff51b0){_0x359aeb=_0x359aeb-0x0;var _0x3428e2=_0xe6c9[_0x359aeb];return _0x3428e2;};var AsteriskManager=require(_0x9e6c('0x0'));var config=require(_0x9e6c('0x1'));var utils=require(_0x9e6c('0x2'));var util=require(_0x9e6c('0x3'));var ami=new AsteriskManager(config[_0x9e6c('0x4')][_0x9e6c('0x5')],config['asterisk']['ip'],config[_0x9e6c('0x4')][_0x9e6c('0x6')],config[_0x9e6c('0x4')][_0x9e6c('0x7')],!![]);ami[_0x9e6c('0x8')]();if(config['xdr']&&config[_0x9e6c('0x9')][_0x9e6c('0xa')]){utils[_0x9e6c('0xb')](_0x9e6c('0xc'));}else{var agents=require(_0x9e6c('0xd'));var calls=require(_0x9e6c('0xe'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x9e6c('0xf'));var dials=require(_0x9e6c('0x10'));var transfers=require(_0x9e6c('0x11'));var core=require(_0x9e6c('0x12'));ami['on']('connect',core['connect']);ami['on'](_0x9e6c('0x13'),core['shutdown']);ami['on'](_0x9e6c('0x14'),core[_0x9e6c('0x14')]);ami['on']('error',core['error']);ami['on'](_0x9e6c('0x15'),core[_0x9e6c('0x15')]);ami['on'](_0x9e6c('0x16'),core[_0x9e6c('0x16')]);ami['on'](_0x9e6c('0x17'),function(_0x301092){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0x301092[_0x9e6c('0x18')]),_0x301092);members[_0x9e6c('0x17')](_0x301092);}catch(_0x35d633){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x1b'),_0x301092[_0x9e6c('0x18')]),_0x35d633);}});ami['on'](_0x9e6c('0x1c'),function(_0x13ab04){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x1e'),_0x13ab04['uniqueid']),_0x13ab04);agents[_0x9e6c('0x1c')](_0x13ab04);}catch(_0x202823){utils[_0x9e6c('0x19')](util['format'](_0x9e6c('0x1e'),_0x13ab04[_0x9e6c('0x1f')]),_0x202823);}});ami['on']('agentringnoanswer',function(_0x207ff7){try{utils[_0x9e6c('0x1d')](util['format']('[%s][index][agentringnoanswer]',_0x207ff7['uniqueid']),_0x207ff7);agents[_0x9e6c('0x20')](_0x207ff7);}catch(_0x4c5192){utils['error'](util[_0x9e6c('0x1a')]('[%s][index][agentringnoanswer]',_0x207ff7[_0x9e6c('0x1f')]),_0x4c5192);}});ami['on'](_0x9e6c('0x21'),function(_0x323d16){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x22'),_0x323d16[_0x9e6c('0x1f')]),_0x323d16);agents[_0x9e6c('0x21')](_0x323d16);queues[_0x9e6c('0x21')](_0x323d16);}catch(_0x58cadd){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x22'),_0x323d16[_0x9e6c('0x1f')]),_0x58cadd);}});ami['on']('agentcomplete',function(_0x20bf7f){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x23'),_0x20bf7f['uniqueid']),_0x20bf7f);agents[_0x9e6c('0x24')](_0x20bf7f);queues['agentcomplete'](_0x20bf7f);members[_0x9e6c('0x24')](_0x20bf7f);}catch(_0x48818d){utils['error'](util[_0x9e6c('0x1a')](_0x9e6c('0x23'),_0x20bf7f['uniqueid']),_0x48818d);}});ami['on'](_0x9e6c('0x25'),function(_0x48570c){try{utils[_0x9e6c('0x1d')](util['format'](_0x9e6c('0x26'),_0x48570c[_0x9e6c('0x1f')]),_0x48570c);agents[_0x9e6c('0x25')](_0x48570c);queues[_0x9e6c('0x25')](_0x48570c);}catch(_0x169052){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x26'),_0x48570c[_0x9e6c('0x1f')]),_0x169052);}});ami['on'](_0x9e6c('0x27'),function(_0x3c8814){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x28'),_0x3c8814['uniqueid']),_0x3c8814);queues[_0x9e6c('0x27')](_0x3c8814);recordings['queuecallerjoin'](_0x3c8814);}catch(_0x110acc){utils['error'](util['format'](_0x9e6c('0x28'),_0x3c8814['uniqueid']),_0x110acc);}});ami['on'](_0x9e6c('0x29'),function(_0x4323f9){try{utils[_0x9e6c('0x1d')](util['format'](_0x9e6c('0x2a'),_0x4323f9[_0x9e6c('0x1f')]),_0x4323f9);queues[_0x9e6c('0x29')](_0x4323f9);}catch(_0x2ca0da){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x2a'),_0x4323f9[_0x9e6c('0x1f')]),_0x2ca0da);}});ami['on']('musiconholdstart',function(_0x1206c7){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x2b'),_0x1206c7['uniqueid']),_0x1206c7);queues[_0x9e6c('0x2c')](_0x1206c7);calls[_0x9e6c('0x2c')](_0x1206c7);}catch(_0x64d0b){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x2b'),_0x1206c7['uniqueid']),_0x64d0b);}});ami['on'](_0x9e6c('0x2d'),function(_0x550fa6){try{utils['debug'](util[_0x9e6c('0x1a')](_0x9e6c('0x2e'),_0x550fa6[_0x9e6c('0x1f')]),_0x550fa6);queues[_0x9e6c('0x2d')](_0x550fa6);calls[_0x9e6c('0x2d')](_0x550fa6);}catch(_0x56da49){utils['error'](util[_0x9e6c('0x1a')](_0x9e6c('0x2e'),_0x550fa6[_0x9e6c('0x1f')]),_0x56da49);}});ami['on'](_0x9e6c('0x2f'),function(_0x520c47){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')]('[%s][index][newstate]',_0x520c47[_0x9e6c('0x1f')]),_0x520c47);calls[_0x9e6c('0x2f')](_0x520c47);recordings['newstate'](_0x520c47);}catch(_0x5809ee){utils['error'](util[_0x9e6c('0x1a')](_0x9e6c('0x30'),_0x520c47[_0x9e6c('0x1f')]),_0x5809ee);}});ami['on']('hangup',function(_0x2ed562){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x31'),_0x2ed562[_0x9e6c('0x1f')]),_0x2ed562);calls['hangup'](_0x2ed562);recordings[_0x9e6c('0x32')](_0x2ed562);dials[_0x9e6c('0x32')](_0x2ed562);agents['hangup'](_0x2ed562);queues[_0x9e6c('0x32')](_0x2ed562);}catch(_0x46a665){utils[_0x9e6c('0x19')](util['format'](_0x9e6c('0x31'),_0x2ed562[_0x9e6c('0x1f')]),_0x46a665);}});ami['on'](_0x9e6c('0x33'),function(_0x1b91c3){try{utils['debug'](util[_0x9e6c('0x1a')](_0x9e6c('0x34'),_0x1b91c3[_0x9e6c('0x1f')]),_0x1b91c3);members['cdr'](_0x1b91c3);}catch(_0x3bcea4){utils['error'](util[_0x9e6c('0x1a')](_0x9e6c('0x34'),_0x1b91c3[_0x9e6c('0x1f')]),_0x3bcea4);}});ami['on'](_0x9e6c('0x35'),function(_0x12c3e0){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x36'),_0x12c3e0[_0x9e6c('0x1f')]),_0x12c3e0);queues[_0x9e6c('0x35')](_0x12c3e0);agents['blindtransfer'](_0x12c3e0);transfers['blindtransfer'](_0x12c3e0);}catch(_0x14a9af){utils[_0x9e6c('0x19')](util['format'](_0x9e6c('0x36'),_0x12c3e0[_0x9e6c('0x1f')]),_0x14a9af);}});ami['on'](_0x9e6c('0x37'),function(_0x4c2ff4){try{utils[_0x9e6c('0x1d')](util['format']('[%s][index][attendedtransfer]',_0x4c2ff4['origtransfereruniqueid']),_0x4c2ff4);queues['attendedtransfer'](_0x4c2ff4);transfers[_0x9e6c('0x37')](_0x4c2ff4);agents[_0x9e6c('0x37')](_0x4c2ff4);calls[_0x9e6c('0x37')](_0x4c2ff4);}catch(_0x1027f3){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x4c2ff4[_0x9e6c('0x38')]),_0x1027f3);}});ami['on']('varset',function(_0x5af14e){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x39'),_0x5af14e[_0x9e6c('0x1f')]),_0x5af14e);queues[_0x9e6c('0x3a')](_0x5af14e);recordings[_0x9e6c('0x3a')](_0x5af14e);calls[_0x9e6c('0x3a')](_0x5af14e);dials[_0x9e6c('0x3a')](_0x5af14e);}catch(_0x5d124e){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x39'),_0x5af14e['uniqueid']),_0x5d124e);}});ami['on'](_0x9e6c('0x3b'),function(_0x570af0){try{utils['debug'](util[_0x9e6c('0x1a')](_0x9e6c('0x3c'),_0x570af0[_0x9e6c('0x1f')]),_0x570af0);calls[_0x9e6c('0x3b')](_0x570af0);recordings[_0x9e6c('0x3b')](_0x570af0);dials['newexten'](_0x570af0);}catch(_0x458753){utils[_0x9e6c('0x19')](util['format'](_0x9e6c('0x3c'),_0x570af0[_0x9e6c('0x1f')]),_0x458753);}});ami['on'](_0x9e6c('0x3d'),function(_0xcb1ece){try{utils['debug'](util[_0x9e6c('0x1a')]('[%s][index][newchannel]',_0xcb1ece[_0x9e6c('0x1f')]),_0xcb1ece);calls[_0x9e6c('0x3d')](_0xcb1ece);recordings[_0x9e6c('0x3d')](_0xcb1ece);}catch(_0x3eb772){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x3e'),_0xcb1ece[_0x9e6c('0x1f')]),_0x3eb772);}});ami['on'](_0x9e6c('0x3f'),function(_0x2aa85d){try{utils[_0x9e6c('0x1d')](util[_0x9e6c('0x1a')](_0x9e6c('0x40'),_0x2aa85d[_0x9e6c('0x1f')]),_0x2aa85d);dials['dialbegin'](_0x2aa85d);}catch(_0x516590){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x41'),_0x2aa85d['uniqueid']),_0x516590);}});ami['on'](_0x9e6c('0x42'),function(_0x238a3c){try{utils[_0x9e6c('0x1d')](util['format'](_0x9e6c('0x43'),_0x238a3c['uniqueid']),_0x238a3c);dials[_0x9e6c('0x42')](_0x238a3c);}catch(_0x28aecd){utils[_0x9e6c('0x19')](util[_0x9e6c('0x1a')](_0x9e6c('0x43'),_0x238a3c['uniqueid']),_0x28aecd);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 32a86e0..fd97f12 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 _0x5db8=['error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','assign','queue','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','type','lodash','util','./utils','Queue:','info','uniqueid','interface','channel','data2','getUserByInterface','then','membername','internal','request','CreateMemberReport','name','catch'];(function(_0x302771,_0x4b93a0){var _0x5d55fb=function(_0x569a54){while(--_0x569a54){_0x302771['push'](_0x302771['shift']());}};_0x5d55fb(++_0x4b93a0);}(_0x5db8,0xbb));var _0x85db=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x5db8[_0x4bd67a];return _0x2be5fb;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var utils=require(_0x85db('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x85db('0x3')];function writeDB(_0x16c069){utils[_0x85db('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x16c069[_0x85db('0x5')],_0x16c069[_0x85db('0x6')],_0x16c069[_0x85db('0x7')],_0x16c069[_0x85db('0x8')],_0x16c069['membername'],_0x16c069['type']));if(_0x16c069[_0x85db('0x6')]){utils[_0x85db('0x9')](_0x16c069[_0x85db('0x6')])[_0x85db('0xa')](function(_0x59a522){if(_0x59a522){_0x16c069[_0x85db('0xb')]=_0x59a522['name'];_0x16c069[_0x85db('0xc')]=_0x59a522[_0x85db('0xc')];utils[_0x85db('0xd')](_0x85db('0xe'),_0x16c069);}else{utils['getUserByName'](_0x16c069['interface']['split']('/')[0x1])[_0x85db('0xa')](function(_0x458b2b){if(_0x458b2b){_0x16c069['membername']=_0x458b2b[_0x85db('0xf')];_0x16c069['internal']=_0x458b2b[_0x85db('0xc')];utils[_0x85db('0xd')](_0x85db('0xe'),_0x16c069);}});}})[_0x85db('0x10')](function(_0x3d0dbf){utils[_0x85db('0x11')](util[_0x85db('0x12')](_0x85db('0x13'),_0x16c069[_0x85db('0x5')]),_0x3d0dbf);});}delete members[_0x16c069[_0x85db('0x6')]];}function startsWith(_0x1e9dec,_0x270fd7){return _[_0x85db('0x14')](_0x1e9dec,function(_0x5ccfef){return _[_0x85db('0x15')](_0x270fd7,_0x5ccfef);});}exports[_0x85db('0x16')]=function(_0x11e7da){try{utils[_0x85db('0x17')](util[_0x85db('0x12')](_0x85db('0x18'),members[_0x11e7da[_0x85db('0x19')]]?members[_0x11e7da['device']][_0x85db('0x5')]:_0x11e7da[_0x85db('0x19')]),_0x11e7da);utils[_0x85db('0x4')](util[_0x85db('0x12')](_0x85db('0x1a'),members[_0x11e7da[_0x85db('0x19')]]?members[_0x11e7da[_0x85db('0x19')]][_0x85db('0x5')]:_0x11e7da[_0x85db('0x19')],_0x11e7da[_0x85db('0x1b')],_0x11e7da['device']));switch(_0x11e7da[_0x85db('0x1b')]){case _0x85db('0x1c'):case _0x85db('0x1d'):if(!startsWith(exclude,_0x11e7da[_0x85db('0x19')])){members[_0x11e7da[_0x85db('0x19')]]={'channel':_0x85db('0x1e'),'interface':_0x11e7da[_0x85db('0x19')],'type':_0x85db('0x1f'),'enterAt':utils['now'](),'role':_0x85db('0x20')};}break;case _0x85db('0x21'):if(!_[_0x85db('0x22')](members[_0x11e7da[_0x85db('0x19')]])){members[_0x11e7da[_0x85db('0x19')]][_0x85db('0x23')]=utils['now']();members[_0x11e7da[_0x85db('0x19')]][_0x85db('0x24')]=utils[_0x85db('0x25')](members[_0x11e7da['device']]['exitAt'],members[_0x11e7da['device']][_0x85db('0x26')]);if(members[_0x11e7da[_0x85db('0x19')]][_0x85db('0x5')]){writeDB(members[_0x11e7da['device']]);}}break;default:break;}}catch(_0x71c6f4){utils[_0x85db('0x11')](util[_0x85db('0x12')]('[%s][members][devicestatechange]',members[_0x11e7da['device']]?members[_0x11e7da[_0x85db('0x19')]][_0x85db('0x5')]:_0x11e7da[_0x85db('0x19')]),_0x71c6f4);}};exports[_0x85db('0x27')]=function(_0x397afc){try{if(!_[_0x85db('0x22')](members[_0x397afc[_0x85db('0x6')]])){utils[_0x85db('0x17')](util[_0x85db('0x12')](_0x85db('0x28'),_0x397afc['uniqueid']),_0x397afc);utils['info'](util[_0x85db('0x12')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x397afc[_0x85db('0x5')],_0x397afc[_0x85db('0x6')],_0x397afc['queue']));members[_0x397afc[_0x85db('0x6')]]=_[_0x85db('0x29')](members[_0x397afc[_0x85db('0x6')]],{'data4':_0x397afc[_0x85db('0x2a')],'uniqueid':_0x397afc['uniqueid']});}}catch(_0x3079fc){utils[_0x85db('0x11')](util[_0x85db('0x12')](_0x85db('0x28'),_0x397afc[_0x85db('0x5')]),_0x3079fc);}};exports['cdr']=function(_0x3279f5){try{utils[_0x85db('0x17')](util[_0x85db('0x12')](_0x85db('0x2b'),_0x3279f5['uniqueid']),_0x3279f5);if(_0x3279f5[_0x85db('0x7')]){var _0x27fdef=_0x3279f5[_0x85db('0x7')]['split']('-')[0x0];if(!_['isNil'](members[_0x27fdef])){members[_0x27fdef]=_[_0x85db('0x29')](members[_0x27fdef],{'data1':members[_0x27fdef][_0x85db('0x2c')]||_0x3279f5['type'],'data2':members[_0x27fdef][_0x85db('0x8')]||_0x3279f5[_0x85db('0x2d')],'data3':members[_0x27fdef][_0x85db('0x2e')]||_0x3279f5[_0x85db('0x2f')],'uniqueid':members[_0x27fdef][_0x85db('0x5')]||_0x3279f5[_0x85db('0x5')]});utils[_0x85db('0x4')](util[_0x85db('0x12')](_0x85db('0x30'),_0x3279f5[_0x85db('0x5')],members[_0x27fdef][_0x85db('0x2c')],members[_0x27fdef][_0x85db('0x8')],members[_0x27fdef]['data3']));if(members[_0x27fdef][_0x85db('0x23')]){writeDB(members[_0x27fdef]);}}}if(_0x3279f5[_0x85db('0x31')]){var _0x254167=_0x3279f5[_0x85db('0x31')]['split']('-')[0x0];if(!_[_0x85db('0x22')](members[_0x254167])){members[_0x254167]=_[_0x85db('0x29')](members[_0x254167],{'data1':members[_0x254167][_0x85db('0x2c')]||_0x3279f5[_0x85db('0x32')],'data2':members[_0x254167]['data2']||_0x3279f5['source'],'data3':members[_0x254167]['data3']||_0x3279f5['destination'],'uniqueid':members[_0x254167]['uniqueid']||_0x3279f5[_0x85db('0x5')]});utils[_0x85db('0x4')](util[_0x85db('0x12')](_0x85db('0x30'),_0x3279f5[_0x85db('0x5')],members[_0x254167]['data1'],members[_0x254167]['data2'],members[_0x254167][_0x85db('0x2e')]));if(members[_0x254167]['exitAt']){writeDB(members[_0x254167]);}}}}catch(_0x9f2d7f){utils[_0x85db('0x11')](util['format']('[%s][members][cdr]',_0x3279f5[_0x85db('0x5')]),_0x9f2d7f);}}; \ No newline at end of file +var _0xfd28=['request','catch','error','[%s][members][writeDB]','uniqueid','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','split','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','then','name','internal','CreateMemberReport'];(function(_0x136c12,_0x4f54dd){var _0x5d36cd=function(_0x36ad9e){while(--_0x36ad9e){_0x136c12['push'](_0x136c12['shift']());}};_0x5d36cd(++_0x4f54dd);}(_0xfd28,0x148));var _0x8fd2=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xfd28[_0x4c440b];return _0x2d48cf;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var utils=require(_0x8fd2('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x8fd2('0x2')];function writeDB(_0x4e5c5e){utils[_0x8fd2('0x3')](util[_0x8fd2('0x4')](_0x8fd2('0x5'),_0x4e5c5e['uniqueid'],_0x4e5c5e[_0x8fd2('0x6')],_0x4e5c5e[_0x8fd2('0x7')],_0x4e5c5e[_0x8fd2('0x8')],_0x4e5c5e[_0x8fd2('0x9')],_0x4e5c5e[_0x8fd2('0xa')]));if(_0x4e5c5e['interface']){utils['getUserByInterface'](_0x4e5c5e[_0x8fd2('0x6')])[_0x8fd2('0xb')](function(_0x5c7e16){if(_0x5c7e16){_0x4e5c5e['membername']=_0x5c7e16[_0x8fd2('0xc')];_0x4e5c5e['internal']=_0x5c7e16[_0x8fd2('0xd')];utils['request'](_0x8fd2('0xe'),_0x4e5c5e);}else{utils['getUserByName'](_0x4e5c5e[_0x8fd2('0x6')]['split']('/')[0x1])[_0x8fd2('0xb')](function(_0x5caf78){if(_0x5caf78){_0x4e5c5e[_0x8fd2('0x9')]=_0x5caf78[_0x8fd2('0xc')];_0x4e5c5e[_0x8fd2('0xd')]=_0x5caf78[_0x8fd2('0xd')];utils[_0x8fd2('0xf')](_0x8fd2('0xe'),_0x4e5c5e);}});}})[_0x8fd2('0x10')](function(_0xf22ae){utils[_0x8fd2('0x11')](util[_0x8fd2('0x4')](_0x8fd2('0x12'),_0x4e5c5e[_0x8fd2('0x13')]),_0xf22ae);});}delete members[_0x4e5c5e[_0x8fd2('0x6')]];}function startsWith(_0x40712c,_0xa65b4){return _['some'](_0x40712c,function(_0x20daca){return _['startsWith'](_0xa65b4,_0x20daca);});}exports['devicestatechange']=function(_0x56f75d){try{utils[_0x8fd2('0x14')](util[_0x8fd2('0x4')](_0x8fd2('0x15'),members[_0x56f75d[_0x8fd2('0x16')]]?members[_0x56f75d['device']][_0x8fd2('0x13')]:_0x56f75d[_0x8fd2('0x16')]),_0x56f75d);utils[_0x8fd2('0x3')](util[_0x8fd2('0x4')](_0x8fd2('0x17'),members[_0x56f75d['device']]?members[_0x56f75d['device']][_0x8fd2('0x13')]:_0x56f75d['device'],_0x56f75d[_0x8fd2('0x18')],_0x56f75d['device']));switch(_0x56f75d[_0x8fd2('0x18')]){case _0x8fd2('0x19'):case'BUSY':if(!startsWith(exclude,_0x56f75d[_0x8fd2('0x16')])){members[_0x56f75d['device']]={'channel':_0x8fd2('0x1a'),'interface':_0x56f75d[_0x8fd2('0x16')],'type':'TALKING','enterAt':utils[_0x8fd2('0x1b')](),'role':_0x8fd2('0x1c')};}break;case _0x8fd2('0x1d'):if(!_['isNil'](members[_0x56f75d[_0x8fd2('0x16')]])){members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x1e')]=utils[_0x8fd2('0x1b')]();members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x1f')]=utils[_0x8fd2('0x20')](members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x1e')],members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x21')]);if(members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x13')]){writeDB(members[_0x56f75d['device']]);}}break;default:break;}}catch(_0x4c6af7){utils[_0x8fd2('0x11')](util[_0x8fd2('0x4')](_0x8fd2('0x15'),members[_0x56f75d['device']]?members[_0x56f75d[_0x8fd2('0x16')]][_0x8fd2('0x13')]:_0x56f75d[_0x8fd2('0x16')]),_0x4c6af7);}};exports[_0x8fd2('0x22')]=function(_0x119439){try{if(!_[_0x8fd2('0x23')](members[_0x119439[_0x8fd2('0x6')]])){utils['debug'](util[_0x8fd2('0x4')](_0x8fd2('0x24'),_0x119439[_0x8fd2('0x13')]),_0x119439);utils[_0x8fd2('0x3')](util[_0x8fd2('0x4')](_0x8fd2('0x25'),_0x119439[_0x8fd2('0x13')],_0x119439['interface'],_0x119439['queue']));members[_0x119439['interface']]=_[_0x8fd2('0x26')](members[_0x119439[_0x8fd2('0x6')]],{'data4':_0x119439[_0x8fd2('0x27')],'uniqueid':_0x119439[_0x8fd2('0x13')]});}}catch(_0x5a0b3b){utils['error'](util[_0x8fd2('0x4')](_0x8fd2('0x24'),_0x119439[_0x8fd2('0x13')]),_0x5a0b3b);}};exports[_0x8fd2('0x28')]=function(_0x121fd4){try{utils['debug'](util[_0x8fd2('0x4')]('[%s][members][cdr]',_0x121fd4[_0x8fd2('0x13')]),_0x121fd4);if(_0x121fd4['channel']){var _0x445b67=_0x121fd4['channel'][_0x8fd2('0x29')]('-')[0x0];if(!_[_0x8fd2('0x23')](members[_0x445b67])){members[_0x445b67]=_[_0x8fd2('0x26')](members[_0x445b67],{'data1':members[_0x445b67]['data1']||_0x121fd4[_0x8fd2('0xa')],'data2':members[_0x445b67]['data2']||_0x121fd4[_0x8fd2('0x2a')],'data3':members[_0x445b67][_0x8fd2('0x2b')]||_0x121fd4[_0x8fd2('0x2c')],'uniqueid':members[_0x445b67]['uniqueid']||_0x121fd4[_0x8fd2('0x13')]});utils[_0x8fd2('0x3')](util[_0x8fd2('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x121fd4[_0x8fd2('0x13')],members[_0x445b67][_0x8fd2('0x2d')],members[_0x445b67][_0x8fd2('0x8')],members[_0x445b67]['data3']));if(members[_0x445b67][_0x8fd2('0x1e')]){writeDB(members[_0x445b67]);}}}if(_0x121fd4[_0x8fd2('0x2e')]){var _0x589d97=_0x121fd4[_0x8fd2('0x2e')][_0x8fd2('0x29')]('-')[0x0];if(!_[_0x8fd2('0x23')](members[_0x589d97])){members[_0x589d97]=_[_0x8fd2('0x26')](members[_0x589d97],{'data1':members[_0x589d97][_0x8fd2('0x2d')]||_0x121fd4[_0x8fd2('0xa')],'data2':members[_0x589d97][_0x8fd2('0x8')]||_0x121fd4['source'],'data3':members[_0x589d97][_0x8fd2('0x2b')]||_0x121fd4['destination'],'uniqueid':members[_0x589d97]['uniqueid']||_0x121fd4[_0x8fd2('0x13')]});utils[_0x8fd2('0x3')](util[_0x8fd2('0x4')](_0x8fd2('0x2f'),_0x121fd4[_0x8fd2('0x13')],members[_0x589d97][_0x8fd2('0x2d')],members[_0x589d97]['data2'],members[_0x589d97]['data3']));if(members[_0x589d97][_0x8fd2('0x1e')]){writeDB(members[_0x589d97]);}}}}catch(_0x4aff57){utils['error'](util[_0x8fd2('0x4')](_0x8fd2('0x30'),_0x121fd4[_0x8fd2('0x13')]),_0x4aff57);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4e8d8ca..6c44730 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 _0x2547=['error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','toUpperCase','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinename','holdtime','count','connectedlinenum','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','transferexten','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0x2547,0x17f));var _0x7254=function(_0x51d934,_0x1f60b3){_0x51d934=_0x51d934-0x0;var _0x29deb3=_0x2547[_0x51d934];return _0x29deb3;};'use strict';var _=require(_0x7254('0x0'));var util=require(_0x7254('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x51c5c8){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x51c5c8[_0x7254('0x5')],_0x51c5c8[_0x7254('0x6')],_0x51c5c8[_0x7254('0x7')],_0x51c5c8[_0x7254('0x8')],_0x51c5c8['calleridnum'],_0x51c5c8[_0x7254('0x9')],_0x51c5c8[_0x7254('0xa')]));if(_0x51c5c8[_0x7254('0x7')]){utils[_0x7254('0xb')](_0x51c5c8[_0x7254('0x7')])['then'](function(_0x5411ef){if(_0x5411ef){_0x51c5c8[_0x7254('0xc')]=_0x5411ef[_0x7254('0xc')];}utils[_0x7254('0xd')](_0x7254('0xe'),_0x51c5c8);});}else{utils[_0x7254('0xd')]('CreateVoiceQueueReport',_0x51c5c8);}if(_0x51c5c8['transfereduniqueid']){delete queues[_0x51c5c8[_0x7254('0xf')]];}else{delete queues[_0x51c5c8[_0x7254('0x5')]];}}exports[_0x7254('0x10')]=function(_0x367118){try{utils[_0x7254('0x11')](util[_0x7254('0x3')](_0x7254('0x12'),_0x367118['uniqueid']),_0x367118);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x13'),_0x367118[_0x7254('0x5')],_0x367118[_0x7254('0x7')],_0x367118[_0x7254('0x14')]));queues[_0x367118[_0x7254('0x5')]]=_['assign'](_0x367118,{'originalposition':_0x367118[_0x7254('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x519bbe){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x12'),_0x367118[_0x7254('0x5')]),_0x519bbe);}};exports['hangup']=function(_0x51f6ec){try{if(!_[_0x7254('0x16')](queues[_0x51f6ec['uniqueid']])){utils['debug'](util['format'](_0x7254('0x17'),_0x51f6ec['uniqueid']),_0x51f6ec);if(queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0x18')]){if(!queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0x19')]&&!queues[_0x51f6ec[_0x7254('0x5')]]['queuecallerexit']){queues[_0x51f6ec['uniqueid']][_0x7254('0x1a')]=!![];queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0x1b')]=utils[_0x7254('0x1c')]();queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x1d');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1e'),_0x51f6ec[_0x7254('0x5')],queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0x1f')],queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(queues[_0x51f6ec[_0x7254('0x5')]]);}else if(queues[_0x51f6ec['uniqueid']][_0x7254('0xf')]){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x51f6ec['uniqueid'],queues[_0x51f6ec[_0x7254('0x5')]]['name'],queues[_0x51f6ec[_0x7254('0x5')]]['transfereduniqueid']));queues[queues[_0x51f6ec[_0x7254('0x5')]][_0x7254('0xf')]]=queues[_0x51f6ec[_0x7254('0x5')]];queues[queues[_0x51f6ec[_0x7254('0x5')]]['transfereduniqueid']][_0x7254('0x21')]=0x2;delete queues[_0x51f6ec[_0x7254('0x5')]];}}}catch(_0x3ee0b3){utils['error'](util[_0x7254('0x3')]('[%s][queues][hangup]',_0x51f6ec[_0x7254('0x5')]),_0x3ee0b3);}};exports[_0x7254('0x22')]=function(_0x154ced){try{utils[_0x7254('0x11')](util['format']('[%s][queues][varset]',_0x154ced[_0x7254('0x5')]),_0x154ced);if(!_[_0x7254('0x16')](_0x154ced[_0x7254('0x23')]['queuestatus'])&&_0x154ced['value'][_0x7254('0x24')]()!=='CONTINUE'){if(!_[_0x7254('0x16')](queues[_0x154ced['uniqueid']])){queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x19')]=![];queues[_0x154ced[_0x7254('0x5')]]['queuecallerabandonAt']=null;queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x25')]=!![];queues[_0x154ced['uniqueid']][_0x7254('0x26')]=utils[_0x7254('0x1c')]();queues[_0x154ced[_0x7254('0x5')]][_0x7254('0xa')]=_0x154ced['value'][_0x7254('0x24')]();utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x27'),_0x154ced[_0x7254('0x5')],queues[_0x154ced['uniqueid']][_0x7254('0x1f')],_0x154ced['value'],queues[_0x154ced[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(queues[_0x154ced[_0x7254('0x5')]]);}}else if(!_[_0x7254('0x16')](_0x154ced[_0x7254('0x23')][_0x7254('0x28')])){if(!_[_0x7254('0x16')](queues[_0x154ced[_0x7254('0x5')]])&&!queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x19')]){queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x19')]=![];queues[_0x154ced['uniqueid']][_0x7254('0x29')]=null;queues[_0x154ced[_0x7254('0x5')]]['queuecallerexit']=!![];queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x26')]=utils['now']();queues[_0x154ced[_0x7254('0x5')]][_0x7254('0xa')]='EXITWITHKEY';utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0x154ced['uniqueid'],queues[_0x154ced[_0x7254('0x5')]][_0x7254('0x1f')],_0x154ced['value'],queues[_0x154ced['uniqueid']][_0x7254('0xa')]));}}}catch(_0x186bcb){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2b'),_0x154ced['uniqueid']),_0x186bcb);}};exports['queuecallerabandon']=function(_0x452ed1){try{if(!_[_0x7254('0x16')](queues[_0x452ed1[_0x7254('0x5')]])){utils[_0x7254('0x11')](util['format'](_0x7254('0x2c'),_0x452ed1[_0x7254('0x5')]),_0x452ed1);queues[_0x452ed1[_0x7254('0x5')]]['queuecallerexit']=![];queues[_0x452ed1[_0x7254('0x5')]]['queuecallerexitAt']=null;queues[_0x452ed1[_0x7254('0x5')]][_0x7254('0x19')]=!![];queues[_0x452ed1[_0x7254('0x5')]][_0x7254('0x29')]=utils[_0x7254('0x1c')]();queues[_0x452ed1[_0x7254('0x5')]]['queuecallerexitreason']=_0x7254('0x2d');utils['info'](util[_0x7254('0x3')](_0x7254('0x2e'),_0x452ed1[_0x7254('0x5')],queues[_0x452ed1[_0x7254('0x5')]][_0x7254('0x1f')],queues[_0x452ed1['uniqueid']][_0x7254('0xa')]));}}catch(_0x423a44){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2c'),_0x452ed1['uniqueid']),_0x423a44);}};exports[_0x7254('0x2f')]=function(_0x3b2a9b){try{if(!_[_0x7254('0x16')](queues[_0x3b2a9b[_0x7254('0x5')]])){utils[_0x7254('0x11')](util[_0x7254('0x3')](_0x7254('0x30'),_0x3b2a9b[_0x7254('0x5')]),_0x3b2a9b);utils[_0x7254('0x2')](util[_0x7254('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3b2a9b[_0x7254('0x5')],queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x1f')],_0x3b2a9b['connectedlinenum'],_0x3b2a9b[_0x7254('0x31')]));queues[_0x3b2a9b['uniqueid']]['queuecallerleave']=!![];queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x18')]=utils[_0x7254('0x1c')]();queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x32')]=utils['diffTime'](queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x18')],queues[_0x3b2a9b[_0x7254('0x5')]]['queuecallerjoinAt']);queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x14')]=_0x3b2a9b['position'];queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x33')]=_0x3b2a9b[_0x7254('0x33')];queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x34')]=_0x3b2a9b[_0x7254('0x34')];queues[_0x3b2a9b[_0x7254('0x5')]][_0x7254('0x31')]=_0x3b2a9b[_0x7254('0x31')];}}catch(_0x383b20){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x30'),_0x3b2a9b[_0x7254('0x5')]),_0x383b20);}};exports['agentconnect']=function(_0x4f1c3f){try{if(!_['isNil'](queues[_0x4f1c3f[_0x7254('0x5')]])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x35'),_0x4f1c3f[_0x7254('0x5')]),_0x4f1c3f);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x36'),_0x4f1c3f[_0x7254('0x5')],queues[_0x4f1c3f['uniqueid']][_0x7254('0x1f')],_0x4f1c3f['membername'],_0x4f1c3f['destaccountcode']));queues[_0x4f1c3f[_0x7254('0x5')]]['queuecallerabandon']=![];queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x19')]=![];queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x29')]=null;queues[_0x4f1c3f['uniqueid']][_0x7254('0x25')]=![];queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0xa')]=null;queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x26')]=null;queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x37')]=!![];queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x9')]=_0x4f1c3f['destaccountcode'];queues[_0x4f1c3f[_0x7254('0x5')]][_0x7254('0x8')]=_0x4f1c3f[_0x7254('0x38')];}}catch(_0xe18420){utils[_0x7254('0x15')](util['format']('[%s][queues][agentconnect]',_0x4f1c3f[_0x7254('0x5')]),_0xe18420);}};exports[_0x7254('0x39')]=function(_0x5a4466){try{if(!_[_0x7254('0x16')](queues[_0x5a4466[_0x7254('0x5')]])){if(queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x18')]){utils[_0x7254('0x11')](util[_0x7254('0x3')]('[%s][queues][agentcomplete]',_0x5a4466['uniqueid']),_0x5a4466);queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x19')]=![];queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x19')]=![];queues[_0x5a4466['uniqueid']][_0x7254('0x29')]=null;queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x25')]=![];queues[_0x5a4466['uniqueid']][_0x7254('0x26')]=null;queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x37')]=!![];queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x8')]=_0x5a4466[_0x7254('0x38')];queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x1a')]=!![];queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0x1b')]=utils['now']();if(_0x5a4466[_0x7254('0x3a')]==_0x7254('0x3b')){if(!queues[_0x5a4466[_0x7254('0x5')]]['transfer']){queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x3c');}}else{queues[_0x5a4466[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x3d')+_0x5a4466['reason'][_0x7254('0x24')]();}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3e'),_0x5a4466['uniqueid'],queues[_0x5a4466['uniqueid']][_0x7254('0x1f')],_0x5a4466[_0x7254('0x38')],queues[_0x5a4466['uniqueid']][_0x7254('0xa')]));writeDB(queues[_0x5a4466[_0x7254('0x5')]]);}}}catch(_0x2612df){utils[_0x7254('0x15')](util['format'](_0x7254('0x3f'),_0x5a4466[_0x7254('0x5')]),_0x2612df);}};exports[_0x7254('0x40')]=function(_0x5e17fe){try{if(!_['isNil'](queues[_0x5e17fe[_0x7254('0x41')]])){utils[_0x7254('0x11')](util[_0x7254('0x3')](_0x7254('0x42'),_0x5e17fe[_0x7254('0x5')]),_0x5e17fe);queues[_0x5e17fe['transfereeuniqueid']][_0x7254('0x3b')]=!![];queues[_0x5e17fe['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x5e17fe[_0x7254('0x41')]]['transferexten']=_0x5e17fe[_0x7254('0x43')];queues[_0x5e17fe[_0x7254('0x41')]][_0x7254('0x44')]=_0x5e17fe[_0x7254('0x41')];queues[_0x5e17fe['transfereeuniqueid']][_0x7254('0xa')]=_0x7254('0x45');utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5e17fe[_0x7254('0x5')],queues[_0x5e17fe[_0x7254('0x41')]]['name'],_0x5e17fe[_0x7254('0x41')],_0x5e17fe[_0x7254('0x43')]));}}catch(_0x22dd5c){utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][queues][blindtransfer]',_0x5e17fe[_0x7254('0x5')]),_0x22dd5c);}};exports[_0x7254('0x47')]=function(_0xb5963d){try{utils[_0x7254('0x11')](util[_0x7254('0x3')](_0x7254('0x48'),_0xb5963d[_0x7254('0x49')]),_0xb5963d);if(_0xb5963d[_0x7254('0x49')]==_0xb5963d[_0x7254('0x4a')]){if(!_[_0x7254('0x16')](queues[_0xb5963d['secondtransfererlinkedid']])){utils[_0x7254('0x2')](util[_0x7254('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xb5963d[_0x7254('0x49')],queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0x1f')],_0xb5963d[_0x7254('0x4c')]));queues[_0xb5963d[_0x7254('0x4b')]]['transfer']=!![];queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0x4d')]=_0x7254('0x4e');queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0x4f')]=_0xb5963d[_0x7254('0x4c')];queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0x44')]=_0xb5963d[_0x7254('0x49')];queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0xa')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0xb5963d['origtransfererlinkedid']])){if(_0xb5963d[_0x7254('0x50')]&&queues[_0xb5963d[_0x7254('0x50')]]){queues[_0xb5963d['transfereelinkedid']][_0x7254('0x21')]=0x1;queues[_0xb5963d[_0x7254('0x41')]]=_['clone'](queues[_0xb5963d[_0x7254('0x50')]]);queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0xf')]=_0xb5963d[_0x7254('0x51')];queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x21')]=0x2;queues[_0xb5963d['transfereeuniqueid']][_0x7254('0x52')]=queues[_0xb5963d['secondtransfererlinkedid']][_0x7254('0x52')];queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x53')]=queues[_0xb5963d[_0x7254('0x4b')]]['calleridname'];queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x54')]=utils['now']();queues[_0xb5963d[_0x7254('0x41')]]['queuecallerleaveAt']=utils['now']();queues[_0xb5963d['transfereeuniqueid']][_0x7254('0x32')]=0x0;queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x55')]=0x0;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x56'),_0xb5963d['origtransfereruniqueid'],queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x1f')],queues[_0xb5963d[_0x7254('0x41')]][_0x7254('0x52')],queues[_0xb5963d['transfereeuniqueid']][_0x7254('0x53')]));}else{utils['info'](util[_0x7254('0x3')](_0x7254('0x57'),_0xb5963d['origtransfereruniqueid'],queues[_0xb5963d[_0x7254('0x4a')]][_0x7254('0x1f')],_0xb5963d['secondtransfererlinkedid']));queues[_0xb5963d['origtransfererlinkedid']][_0x7254('0xf')]=_0xb5963d[_0x7254('0x4b')];}}}else if(_0xb5963d['secondtransfereruniqueid']==_0xb5963d['secondtransfererlinkedid']){if(!_[_0x7254('0x16')](queues[_0xb5963d[_0x7254('0x4a')]])){utils[_0x7254('0x2')](util['format'](_0x7254('0x58'),_0xb5963d[_0x7254('0x49')],queues[_0xb5963d['origtransfererlinkedid']][_0x7254('0x1f')],_0xb5963d['secondtransfereruniqueid'],_0xb5963d[_0x7254('0x59')]));queues[_0xb5963d[_0x7254('0x4a')]]['transfer']=!![];queues[_0xb5963d[_0x7254('0x4a')]][_0x7254('0x4d')]=_0x7254('0x4e');queues[_0xb5963d['origtransfererlinkedid']][_0x7254('0x4f')]=_0xb5963d[_0x7254('0x59')];queues[_0xb5963d[_0x7254('0x4a')]]['transferuniqueid']=_0xb5963d[_0x7254('0x5a')];queues[_0xb5963d['origtransfererlinkedid']][_0x7254('0xa')]=_0x7254('0x5b');}if(!_[_0x7254('0x16')](queues[_0xb5963d[_0x7254('0x4b')]])){if(_0xb5963d['transfertargetlinkedid']&&queues[_0xb5963d[_0x7254('0x5c')]]){queues[_0xb5963d['transfertargetlinkedid']][_0x7254('0x21')]=0x1;queues[_0xb5963d[_0x7254('0x51')]]=_['clone'](queues[_0xb5963d[_0x7254('0x5c')]]);queues[_0xb5963d[_0x7254('0x51')]]['transfereduniqueid']=_0xb5963d[_0x7254('0x51')];queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x21')]=0x2;queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x52')]=queues[_0xb5963d[_0x7254('0x4a')]][_0x7254('0x52')];queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x53')]=queues[_0xb5963d['origtransfererlinkedid']][_0x7254('0x53')];queues[_0xb5963d[_0x7254('0x51')]]['queuecallerjoinAt']=utils[_0x7254('0x1c')]();queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x18')]=utils['now']();queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x32')]=0x0;queues[_0xb5963d['transfertargetuniqueid']][_0x7254('0x55')]=0x0;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x5d'),_0xb5963d[_0x7254('0x49')],queues[_0xb5963d[_0x7254('0x51')]]['name'],queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0xf')],queues[_0xb5963d[_0x7254('0x51')]][_0x7254('0x52')],queues[_0xb5963d['transfertargetuniqueid']][_0x7254('0x53')]));}else{utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x57'),_0xb5963d[_0x7254('0x49')],queues[_0xb5963d[_0x7254('0x4b')]][_0x7254('0x1f')],_0xb5963d[_0x7254('0x4a')]));queues[_0xb5963d[_0x7254('0x4b')]]['transfereduniqueid']=_0xb5963d['origtransfererlinkedid'];}}}}catch(_0x554c7f){utils['error'](util['format']('[%s][queues][attendedtransfer]',_0xb5963d[_0x7254('0x49')]),_0x554c7f);}};exports[_0x7254('0x5e')]=function(_0x27569e){try{if(!_['isNil'](queues[_0x27569e[_0x7254('0x5')]])){utils['debug'](util['format'](_0x7254('0x5f'),_0x27569e[_0x7254('0x5')]),_0x27569e);queues[_0x27569e['uniqueid']][_0x7254('0x60')]=utils['now']();utils['info'](util[_0x7254('0x3')](_0x7254('0x61'),_0x27569e[_0x7254('0x5')],queues[_0x27569e['uniqueid']][_0x7254('0x1f')],queues[_0x27569e['uniqueid']][_0x7254('0x60')]));}}catch(_0x32a7e1){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x5f'),_0x27569e['uniqueid']),_0x32a7e1);}};exports[_0x7254('0x62')]=function(_0x473cd9){try{if(!_[_0x7254('0x16')](queues[_0x473cd9[_0x7254('0x5')]])){if(!_[_0x7254('0x16')](queues[_0x473cd9[_0x7254('0x5')]][_0x7254('0x60')])){utils[_0x7254('0x11')](util[_0x7254('0x3')](_0x7254('0x63'),_0x473cd9['uniqueid']),_0x473cd9);queues[_0x473cd9[_0x7254('0x5')]][_0x7254('0x55')]+=utils[_0x7254('0x64')](utils['now'](),queues[_0x473cd9[_0x7254('0x5')]][_0x7254('0x60')]);utils['info'](util[_0x7254('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x473cd9[_0x7254('0x5')],queues[_0x473cd9[_0x7254('0x5')]][_0x7254('0x1f')],queues[_0x473cd9[_0x7254('0x5')]][_0x7254('0x55')]));delete queues[_0x473cd9['uniqueid']][_0x7254('0x60')];}}}catch(_0x117382){utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][queues][musiconholdstop]',_0x473cd9[_0x7254('0x5')]),_0x117382);}}; \ No newline at end of file +var _0x4a78=['queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','isNil','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','./utils','info','uniqueid','channel','queue','accountcode','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4a78,0xa4));var _0x84a7=function(_0x2e57d2,_0x45fc59){_0x2e57d2=_0x2e57d2-0x0;var _0x5da23e=_0x4a78[_0x2e57d2];return _0x5da23e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x84a7('0x0'));var queues={};function writeDB(_0x3a853e){utils[_0x84a7('0x1')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3a853e[_0x84a7('0x2')],_0x3a853e[_0x84a7('0x3')],_0x3a853e[_0x84a7('0x4')],_0x3a853e['lastAssignedTo'],_0x3a853e['calleridnum'],_0x3a853e[_0x84a7('0x5')],_0x3a853e['queuecallerexitreason']));if(_0x3a853e['queue']){utils['getVoiceQueueByName'](_0x3a853e['queue'])[_0x84a7('0x6')](function(_0x3b16d3){if(_0x3b16d3){_0x3a853e[_0x84a7('0x7')]=_0x3b16d3[_0x84a7('0x7')];}utils[_0x84a7('0x8')](_0x84a7('0x9'),_0x3a853e);});}else{utils[_0x84a7('0x8')]('CreateVoiceQueueReport',_0x3a853e);}if(_0x3a853e[_0x84a7('0xa')]){delete queues[_0x3a853e[_0x84a7('0xa')]];}else{delete queues[_0x3a853e[_0x84a7('0x2')]];}}exports[_0x84a7('0xb')]=function(_0x3aa97b){try{utils['debug'](util['format'](_0x84a7('0xc'),_0x3aa97b[_0x84a7('0x2')]),_0x3aa97b);utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0xe'),_0x3aa97b[_0x84a7('0x2')],_0x3aa97b[_0x84a7('0x4')],_0x3aa97b['position']));queues[_0x3aa97b['uniqueid']]=_[_0x84a7('0xf')](_0x3aa97b,{'originalposition':_0x3aa97b[_0x84a7('0x10')],'queuecallerjoinAt':utils[_0x84a7('0x11')](),'mohtime':0x0});}catch(_0x29b825){utils[_0x84a7('0x12')](util[_0x84a7('0xd')](_0x84a7('0xc'),_0x3aa97b[_0x84a7('0x2')]),_0x29b825);}};exports[_0x84a7('0x13')]=function(_0x348f11){try{if(!_['isNil'](queues[_0x348f11['uniqueid']])){utils[_0x84a7('0x14')](util['format'](_0x84a7('0x15'),_0x348f11[_0x84a7('0x2')]),_0x348f11);if(queues[_0x348f11['uniqueid']][_0x84a7('0x16')]){if(!queues[_0x348f11[_0x84a7('0x2')]]['queuecallerabandon']&&!queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0x17')]){queues[_0x348f11['uniqueid']][_0x84a7('0x18')]=!![];queues[_0x348f11[_0x84a7('0x2')]]['queuecallercompleteAt']=utils[_0x84a7('0x11')]();queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0x19')]=_0x84a7('0x1a');}utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x348f11['uniqueid'],queues[_0x348f11[_0x84a7('0x2')]]['name'],queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0x19')]));writeDB(queues[_0x348f11[_0x84a7('0x2')]]);}else if(queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0xa')]){utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x1b'),_0x348f11['uniqueid'],queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0x1c')],queues[_0x348f11[_0x84a7('0x2')]]['transfereduniqueid']));queues[queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0xa')]]=queues[_0x348f11[_0x84a7('0x2')]];queues[queues[_0x348f11[_0x84a7('0x2')]][_0x84a7('0xa')]][_0x84a7('0x1d')]=0x2;delete queues[_0x348f11['uniqueid']];}}}catch(_0x22fb12){utils[_0x84a7('0x12')](util[_0x84a7('0xd')](_0x84a7('0x15'),_0x348f11[_0x84a7('0x2')]),_0x22fb12);}};exports['varset']=function(_0x3587cb){try{utils[_0x84a7('0x14')](util[_0x84a7('0xd')](_0x84a7('0x1e'),_0x3587cb[_0x84a7('0x2')]),_0x3587cb);if(!_['isNil'](_0x3587cb[_0x84a7('0x1f')]['queuestatus'])&&_0x3587cb[_0x84a7('0x20')][_0x84a7('0x21')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x3587cb[_0x84a7('0x2')]])){queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x22')]=![];queues[_0x3587cb['uniqueid']][_0x84a7('0x23')]=null;queues[_0x3587cb[_0x84a7('0x2')]]['queuecallerexit']=!![];queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x24')]=utils[_0x84a7('0x11')]();queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x19')]=_0x3587cb[_0x84a7('0x20')][_0x84a7('0x21')]();utils['info'](util[_0x84a7('0xd')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3587cb['uniqueid'],queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x1c')],_0x3587cb[_0x84a7('0x20')],queues[_0x3587cb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x3587cb['uniqueid']]);}}else if(!_[_0x84a7('0x25')](_0x3587cb[_0x84a7('0x1f')]['queueposition'])){if(!_[_0x84a7('0x25')](queues[_0x3587cb['uniqueid']])&&!queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x22')]){queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x22')]=![];queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x23')]=null;queues[_0x3587cb[_0x84a7('0x2')]]['queuecallerexit']=!![];queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x24')]=utils[_0x84a7('0x11')]();queues[_0x3587cb[_0x84a7('0x2')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x26'),_0x3587cb[_0x84a7('0x2')],queues[_0x3587cb[_0x84a7('0x2')]][_0x84a7('0x1c')],_0x3587cb['value'],queues[_0x3587cb['uniqueid']][_0x84a7('0x19')]));}}}catch(_0x190d60){utils[_0x84a7('0x12')](util['format']('[%s][queues][varset]',_0x3587cb[_0x84a7('0x2')]),_0x190d60);}};exports[_0x84a7('0x22')]=function(_0x409846){try{if(!_['isNil'](queues[_0x409846[_0x84a7('0x2')]])){utils['debug'](util['format'](_0x84a7('0x27'),_0x409846[_0x84a7('0x2')]),_0x409846);queues[_0x409846[_0x84a7('0x2')]][_0x84a7('0x17')]=![];queues[_0x409846[_0x84a7('0x2')]]['queuecallerexitAt']=null;queues[_0x409846[_0x84a7('0x2')]]['queuecallerabandon']=!![];queues[_0x409846[_0x84a7('0x2')]]['queuecallerabandonAt']=utils[_0x84a7('0x11')]();queues[_0x409846[_0x84a7('0x2')]]['queuecallerexitreason']=_0x84a7('0x28');utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x409846[_0x84a7('0x2')],queues[_0x409846['uniqueid']]['name'],queues[_0x409846[_0x84a7('0x2')]][_0x84a7('0x19')]));}}catch(_0x17688f){utils['error'](util['format']('[%s][queues][queuecallerabandon]',_0x409846[_0x84a7('0x2')]),_0x17688f);}};exports[_0x84a7('0x29')]=function(_0x4a3bee){try{if(!_[_0x84a7('0x25')](queues[_0x4a3bee[_0x84a7('0x2')]])){utils[_0x84a7('0x14')](util[_0x84a7('0xd')](_0x84a7('0x2a'),_0x4a3bee['uniqueid']),_0x4a3bee);utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4a3bee[_0x84a7('0x2')],queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x1c')],_0x4a3bee[_0x84a7('0x2b')],_0x4a3bee['connectedlinename']));queues[_0x4a3bee['uniqueid']]['queuecallerleave']=!![];queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x16')]=utils['now']();queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x2c')]=utils[_0x84a7('0x2d')](queues[_0x4a3bee[_0x84a7('0x2')]]['queuecallerleaveAt'],queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x2e')]);queues[_0x4a3bee[_0x84a7('0x2')]]['position']=_0x4a3bee['position'];queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x2f')]=_0x4a3bee[_0x84a7('0x2f')];queues[_0x4a3bee[_0x84a7('0x2')]][_0x84a7('0x2b')]=_0x4a3bee[_0x84a7('0x2b')];queues[_0x4a3bee['uniqueid']]['connectedlinename']=_0x4a3bee[_0x84a7('0x30')];}}catch(_0x215319){utils['error'](util[_0x84a7('0xd')](_0x84a7('0x2a'),_0x4a3bee[_0x84a7('0x2')]),_0x215319);}};exports[_0x84a7('0x31')]=function(_0x38bb50){try{if(!_[_0x84a7('0x25')](queues[_0x38bb50['uniqueid']])){utils['debug'](util['format'](_0x84a7('0x32'),_0x38bb50[_0x84a7('0x2')]),_0x38bb50);utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x33'),_0x38bb50['uniqueid'],queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x1c')],_0x38bb50[_0x84a7('0x34')],_0x38bb50[_0x84a7('0x35')]));queues[_0x38bb50[_0x84a7('0x2')]]['queuecallerabandon']=![];queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x22')]=![];queues[_0x38bb50['uniqueid']][_0x84a7('0x23')]=null;queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x17')]=![];queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x19')]=null;queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x24')]=null;queues[_0x38bb50['uniqueid']][_0x84a7('0x36')]=!![];queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x5')]=_0x38bb50[_0x84a7('0x35')];queues[_0x38bb50[_0x84a7('0x2')]][_0x84a7('0x37')]=_0x38bb50[_0x84a7('0x34')];}}catch(_0x27ada6){utils[_0x84a7('0x12')](util[_0x84a7('0xd')](_0x84a7('0x32'),_0x38bb50[_0x84a7('0x2')]),_0x27ada6);}};exports[_0x84a7('0x38')]=function(_0x91d3e){try{if(!_[_0x84a7('0x25')](queues[_0x91d3e[_0x84a7('0x2')]])){if(queues[_0x91d3e[_0x84a7('0x2')]]['queuecallerleaveAt']){utils[_0x84a7('0x14')](util[_0x84a7('0xd')](_0x84a7('0x39'),_0x91d3e[_0x84a7('0x2')]),_0x91d3e);queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x22')]=![];queues[_0x91d3e[_0x84a7('0x2')]]['queuecallerabandon']=![];queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x23')]=null;queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x17')]=![];queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x24')]=null;queues[_0x91d3e[_0x84a7('0x2')]]['assigned']=!![];queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x37')]=_0x91d3e[_0x84a7('0x34')];queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x18')]=!![];queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x3a')]=utils[_0x84a7('0x11')]();if(_0x91d3e['reason']=='transfer'){if(!queues[_0x91d3e['uniqueid']][_0x84a7('0x3b')]){queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x19')]=_0x84a7('0x3c');}}else{queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x19')]='COMPLETEDBY'+_0x91d3e[_0x84a7('0x3d')][_0x84a7('0x21')]();}utils[_0x84a7('0x1')](util['format'](_0x84a7('0x3e'),_0x91d3e['uniqueid'],queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x1c')],_0x91d3e[_0x84a7('0x34')],queues[_0x91d3e[_0x84a7('0x2')]][_0x84a7('0x19')]));writeDB(queues[_0x91d3e[_0x84a7('0x2')]]);}}}catch(_0x256bc4){utils[_0x84a7('0x12')](util[_0x84a7('0xd')](_0x84a7('0x39'),_0x91d3e[_0x84a7('0x2')]),_0x256bc4);}};exports[_0x84a7('0x3f')]=function(_0x20ab51){try{if(!_[_0x84a7('0x25')](queues[_0x20ab51[_0x84a7('0x40')]])){utils[_0x84a7('0x14')](util[_0x84a7('0xd')]('[%s][queues][blindtransfer]',_0x20ab51['uniqueid']),_0x20ab51);queues[_0x20ab51[_0x84a7('0x40')]][_0x84a7('0x3b')]=!![];queues[_0x20ab51[_0x84a7('0x40')]][_0x84a7('0x41')]='BLIND';queues[_0x20ab51[_0x84a7('0x40')]][_0x84a7('0x42')]=_0x20ab51[_0x84a7('0x43')];queues[_0x20ab51[_0x84a7('0x40')]][_0x84a7('0x44')]=_0x20ab51[_0x84a7('0x40')];queues[_0x20ab51[_0x84a7('0x40')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x20ab51[_0x84a7('0x2')],queues[_0x20ab51[_0x84a7('0x40')]][_0x84a7('0x1c')],_0x20ab51[_0x84a7('0x40')],_0x20ab51['extension']));}}catch(_0x47abf0){utils['error'](util[_0x84a7('0xd')]('[%s][queues][blindtransfer]',_0x20ab51[_0x84a7('0x2')]),_0x47abf0);}};exports['attendedtransfer']=function(_0x12aae9){try{utils[_0x84a7('0x14')](util[_0x84a7('0xd')](_0x84a7('0x45'),_0x12aae9[_0x84a7('0x46')]),_0x12aae9);if(_0x12aae9['origtransfereruniqueid']==_0x12aae9['origtransfererlinkedid']){if(!_[_0x84a7('0x25')](queues[_0x12aae9['secondtransfererlinkedid']])){utils['info'](util[_0x84a7('0xd')](_0x84a7('0x47'),_0x12aae9[_0x84a7('0x46')],queues[_0x12aae9['secondtransfererlinkedid']][_0x84a7('0x1c')],_0x12aae9[_0x84a7('0x48')]));queues[_0x12aae9['secondtransfererlinkedid']][_0x84a7('0x3b')]=!![];queues[_0x12aae9[_0x84a7('0x49')]]['transfertype']=_0x84a7('0x4a');queues[_0x12aae9['secondtransfererlinkedid']]['transferexten']=_0x12aae9['origtransfererexten'];queues[_0x12aae9[_0x84a7('0x49')]][_0x84a7('0x44')]=_0x12aae9[_0x84a7('0x46')];queues[_0x12aae9[_0x84a7('0x49')]][_0x84a7('0x19')]=_0x84a7('0x4b');}if(!_[_0x84a7('0x25')](queues[_0x12aae9[_0x84a7('0x4c')]])){if(_0x12aae9[_0x84a7('0x4d')]&&queues[_0x12aae9[_0x84a7('0x4d')]]){queues[_0x12aae9[_0x84a7('0x4d')]][_0x84a7('0x1d')]=0x1;queues[_0x12aae9[_0x84a7('0x40')]]=_[_0x84a7('0x4e')](queues[_0x12aae9[_0x84a7('0x4d')]]);queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0xa')]=_0x12aae9['transfertargetuniqueid'];queues[_0x12aae9['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0x4f')]=queues[_0x12aae9[_0x84a7('0x49')]][_0x84a7('0x4f')];queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0x50')]=queues[_0x12aae9[_0x84a7('0x49')]][_0x84a7('0x50')];queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0x2e')]=utils[_0x84a7('0x11')]();queues[_0x12aae9[_0x84a7('0x40')]]['queuecallerleaveAt']=utils[_0x84a7('0x11')]();queues[_0x12aae9['transfereeuniqueid']][_0x84a7('0x2c')]=0x0;queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0x51')]=0x0;utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x52'),_0x12aae9['origtransfereruniqueid'],queues[_0x12aae9['transfereeuniqueid']][_0x84a7('0x1c')],queues[_0x12aae9[_0x84a7('0x40')]]['calleridnum'],queues[_0x12aae9[_0x84a7('0x40')]][_0x84a7('0x50')]));}else{utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x53'),_0x12aae9[_0x84a7('0x46')],queues[_0x12aae9['origtransfererlinkedid']]['name'],_0x12aae9[_0x84a7('0x49')]));queues[_0x12aae9[_0x84a7('0x4c')]][_0x84a7('0xa')]=_0x12aae9['secondtransfererlinkedid'];}}}else if(_0x12aae9[_0x84a7('0x54')]==_0x12aae9[_0x84a7('0x49')]){if(!_['isNil'](queues[_0x12aae9[_0x84a7('0x4c')]])){utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x55'),_0x12aae9[_0x84a7('0x46')],queues[_0x12aae9[_0x84a7('0x4c')]]['name'],_0x12aae9[_0x84a7('0x54')],_0x12aae9[_0x84a7('0x56')]));queues[_0x12aae9[_0x84a7('0x4c')]][_0x84a7('0x3b')]=!![];queues[_0x12aae9[_0x84a7('0x4c')]][_0x84a7('0x41')]=_0x84a7('0x4a');queues[_0x12aae9[_0x84a7('0x4c')]]['transferexten']=_0x12aae9['secondtransfererexten'];queues[_0x12aae9[_0x84a7('0x4c')]][_0x84a7('0x44')]=_0x12aae9[_0x84a7('0x54')];queues[_0x12aae9['origtransfererlinkedid']]['queuecallerexitreason']=_0x84a7('0x4b');}if(!_['isNil'](queues[_0x12aae9[_0x84a7('0x49')]])){if(_0x12aae9[_0x84a7('0x57')]&&queues[_0x12aae9[_0x84a7('0x57')]]){queues[_0x12aae9[_0x84a7('0x57')]][_0x84a7('0x1d')]=0x1;queues[_0x12aae9[_0x84a7('0x58')]]=_['clone'](queues[_0x12aae9[_0x84a7('0x57')]]);queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0xa')]=_0x12aae9['transfertargetuniqueid'];queues[_0x12aae9[_0x84a7('0x58')]]['queuecallerenterreason']=0x2;queues[_0x12aae9['transfertargetuniqueid']][_0x84a7('0x4f')]=queues[_0x12aae9[_0x84a7('0x4c')]]['calleridnum'];queues[_0x12aae9['transfertargetuniqueid']]['calleridname']=queues[_0x12aae9['origtransfererlinkedid']][_0x84a7('0x50')];queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0x2e')]=utils['now']();queues[_0x12aae9['transfertargetuniqueid']][_0x84a7('0x16')]=utils[_0x84a7('0x11')]();queues[_0x12aae9['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0x51')]=0x0;utils[_0x84a7('0x1')](util[_0x84a7('0xd')](_0x84a7('0x59'),_0x12aae9['origtransfereruniqueid'],queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0x1c')],queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0xa')],queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0x4f')],queues[_0x12aae9[_0x84a7('0x58')]][_0x84a7('0x50')]));}else{utils[_0x84a7('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x12aae9[_0x84a7('0x46')],queues[_0x12aae9['secondtransfererlinkedid']][_0x84a7('0x1c')],_0x12aae9[_0x84a7('0x4c')]));queues[_0x12aae9['secondtransfererlinkedid']][_0x84a7('0xa')]=_0x12aae9['origtransfererlinkedid'];}}}}catch(_0x506b8d){utils[_0x84a7('0x12')](util[_0x84a7('0xd')]('[%s][queues][attendedtransfer]',_0x12aae9[_0x84a7('0x46')]),_0x506b8d);}};exports[_0x84a7('0x5a')]=function(_0x1ee844){try{if(!_[_0x84a7('0x25')](queues[_0x1ee844[_0x84a7('0x2')]])){utils[_0x84a7('0x14')](util[_0x84a7('0xd')](_0x84a7('0x5b'),_0x1ee844['uniqueid']),_0x1ee844);queues[_0x1ee844[_0x84a7('0x2')]][_0x84a7('0x5c')]=utils['now']();utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1ee844[_0x84a7('0x2')],queues[_0x1ee844[_0x84a7('0x2')]][_0x84a7('0x1c')],queues[_0x1ee844[_0x84a7('0x2')]][_0x84a7('0x5c')]));}}catch(_0x45dc92){utils[_0x84a7('0x12')](util['format']('[%s][queues][musiconholdstart]',_0x1ee844[_0x84a7('0x2')]),_0x45dc92);}};exports['musiconholdstop']=function(_0x58ef75){try{if(!_['isNil'](queues[_0x58ef75['uniqueid']])){if(!_['isNil'](queues[_0x58ef75[_0x84a7('0x2')]][_0x84a7('0x5c')])){utils[_0x84a7('0x14')](util['format'](_0x84a7('0x5d'),_0x58ef75[_0x84a7('0x2')]),_0x58ef75);queues[_0x58ef75[_0x84a7('0x2')]][_0x84a7('0x51')]+=utils[_0x84a7('0x2d')](utils['now'](),queues[_0x58ef75[_0x84a7('0x2')]]['musiconholdstartAt']);utils[_0x84a7('0x1')](util[_0x84a7('0xd')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x58ef75['uniqueid'],queues[_0x58ef75[_0x84a7('0x2')]][_0x84a7('0x1c')],queues[_0x58ef75[_0x84a7('0x2')]][_0x84a7('0x51')]));delete queues[_0x58ef75[_0x84a7('0x2')]][_0x84a7('0x5c')];}}}catch(_0x531e88){utils[_0x84a7('0x12')](util['format'](_0x84a7('0x5d'),_0x58ef75[_0x84a7('0x2')]),_0x531e88);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index db689db..30c9edd 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 _0x6993=['calleridnum','calleridname','connectedlinenum','type','outbound','monitors','forEach','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','cdr','appdata','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','context','exten','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s'];(function(_0x3607b7,_0x4687ea){var _0x522083=function(_0x1d03b5){while(--_0x1d03b5){_0x3607b7['push'](_0x3607b7['shift']());}};_0x522083(++_0x4687ea);}(_0x6993,0x8f));var _0x3699=function(_0x1f9773,_0x4365fb){_0x1f9773=_0x1f9773-0x0;var _0x3fc947=_0x6993[_0x1f9773];return _0x3fc947;};'use strict';var _=require(_0x3699('0x0'));var util=require('util');var utils=require(_0x3699('0x1'));var recordings={};function writeDB(_0x17b1d6){utils[_0x3699('0x2')](util[_0x3699('0x3')](_0x3699('0x4'),_0x17b1d6[_0x3699('0x5')]));if(_0x17b1d6['accountcode']){utils['getUserByInternal'](_0x17b1d6[_0x3699('0x6')])[_0x3699('0x7')](function(_0x398fce){if(_0x398fce){_0x17b1d6[_0x3699('0x8')]=_0x398fce[_0x3699('0x9')];_0x17b1d6[_0x3699('0xa')]=_0x398fce['id'];}utils[_0x3699('0xb')](_0x3699('0xc'),_0x17b1d6);});}else{utils[_0x3699('0xb')](_0x3699('0xc'),_0x17b1d6);}}exports['newchannel']=function(_0x5db459){try{utils[_0x3699('0xd')](util[_0x3699('0x3')](_0x3699('0xe'),_0x5db459[_0x3699('0x5')]),_0x5db459);if(_0x5db459[_0x3699('0x5')]==_0x5db459[_0x3699('0xf')]){utils[_0x3699('0x2')](util[_0x3699('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5db459['uniqueid'],_0x5db459[_0x3699('0x10')],_0x5db459[_0x3699('0x11')]));recordings[_0x5db459['uniqueid']]={'uniqueid':_0x5db459[_0x3699('0x5')],'accountcode':_0x5db459[_0x3699('0x6')],'exten':_0x5db459[_0x3699('0x11')],'context':_0x5db459[_0x3699('0x10')],'channel':_0x5db459['channel'],'monitors':[]};}}catch(_0x3d6812){utils[_0x3699('0x12')](util['format'](_0x3699('0xe'),_0x5db459['uniqueid']),_0x3d6812);}};exports[_0x3699('0x13')]=function(_0x276f3a){try{utils['debug'](util[_0x3699('0x3')]('[%s][recordings][newstate]',_0x276f3a[_0x3699('0x5')]),_0x276f3a);if(!_[_0x3699('0x14')](recordings[_0x276f3a[_0x3699('0x5')]])&&_0x276f3a[_0x3699('0x15')]==0x6){utils[_0x3699('0x2')](util[_0x3699('0x3')](_0x3699('0x16'),_0x276f3a[_0x3699('0x5')],_0x276f3a['context'],_0x276f3a[_0x3699('0x17')]));}else if(!_[_0x3699('0x14')](recordings[_0x276f3a['linkedid']])&&_0x276f3a[_0x3699('0x15')]==0x6&&_0x276f3a['context']!=_0x3699('0x18')){utils[_0x3699('0x2')](util[_0x3699('0x3')](_0x3699('0x19'),_0x276f3a[_0x3699('0x5')],_0x276f3a[_0x3699('0xf')],_0x276f3a[_0x3699('0x10')],_0x276f3a['channel']));recordings[_0x276f3a['linkedid']][_0x3699('0x6')]=_0x276f3a['accountcode'];}}catch(_0x4637f5){utils['error'](util[_0x3699('0x3')]('[%s][recordings][newstate]',_0x276f3a[_0x3699('0x5')]),_0x4637f5);}};exports[_0x3699('0x1a')]=function(_0x2c3d35){try{if(!_[_0x3699('0x14')](_0x2c3d35[_0x3699('0x1b')])&&!_[_0x3699('0x14')](_0x2c3d35[_0x3699('0x1b')][_0x3699('0x1c')])){utils['debug'](util[_0x3699('0x3')](_0x3699('0x1d'),_0x2c3d35[_0x3699('0x5')]),_0x2c3d35);utils['info'](util[_0x3699('0x3')](_0x3699('0x1e'),_0x2c3d35[_0x3699('0x5')],_0x2c3d35[_0x3699('0x1b')],_0x2c3d35[_0x3699('0x1f')]));if(_[_0x3699('0x20')](_0x2c3d35[_0x3699('0x1f')],'.wav49')){_0x2c3d35['value']=_0x2c3d35[_0x3699('0x1f')]['replace'](_0x3699('0x21'),_0x3699('0x22'));}if(recordings[_0x2c3d35['linkedid']]){var _0x1aac67=_[_0x3699('0x23')](recordings[_0x2c3d35['linkedid']]['monitors'],{'value':_0x2c3d35[_0x3699('0x1f')]});if(_['isNil'](_0x1aac67)){recordings[_0x2c3d35[_0x3699('0xf')]]['monitors'][_0x3699('0x24')]({'value':_0x2c3d35[_0x3699('0x1f')]});}}}}catch(_0x316cda){utils['error'](util[_0x3699('0x3')]('[%s][recordings][varset]',_0x2c3d35[_0x3699('0x5')]),_0x316cda);}};exports[_0x3699('0x25')]=function(_0x3ecd64){try{if(!_[_0x3699('0x14')](recordings[_0x3ecd64[_0x3699('0x5')]])){utils['debug'](util[_0x3699('0x3')](_0x3699('0x26'),_0x3ecd64[_0x3699('0x5')]),_0x3ecd64);utils[_0x3699('0x2')](util[_0x3699('0x3')](_0x3699('0x27'),_0x3ecd64['uniqueid'],_0x3ecd64[_0x3699('0x28')],_0x3ecd64[_0x3699('0x29')],_0x3ecd64['cause-txt']));recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x28')]=_0x3ecd64['calleridnum'];recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x29')]=_0x3ecd64[_0x3699('0x29')];recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x2a')]=_0x3ecd64['connectedlinenum'];recordings[_0x3ecd64[_0x3699('0x5')]]['connectedlinename']=_0x3ecd64['connectedlinename'];if(recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x2b')]==_0x3699('0x2c')&&recordings[_0x3ecd64['uniqueid']][_0x3699('0x6')]){recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x2a')]=recordings[_0x3ecd64['uniqueid']][_0x3699('0x6')];recordings[_0x3ecd64[_0x3699('0x5')]]['connectedlinename']='';}recordings[_0x3ecd64[_0x3699('0x5')]][_0x3699('0x2d')][_0x3699('0x2e')](function(_0x562abe){var _0x45477c=_['clone'](recordings[_0x3ecd64['uniqueid']]);_0x45477c[_0x3699('0x1f')]=_0x562abe[_0x3699('0x1f')];writeDB(_0x45477c);});delete recordings[_0x3ecd64[_0x3699('0x5')]];}}catch(_0x114a58){utils[_0x3699('0x12')](util[_0x3699('0x3')](_0x3699('0x26'),_0x3ecd64[_0x3699('0x5')]),_0x114a58);}};exports['newexten']=function(_0x5b68c1){try{if(!_[_0x3699('0x14')](recordings[_0x5b68c1[_0x3699('0x5')]])){utils[_0x3699('0xd')](util[_0x3699('0x3')]('[%s][recordings][newexten]',_0x5b68c1[_0x3699('0x5')]),_0x5b68c1);utils[_0x3699('0x2')](util['format'](_0x3699('0x2f'),_0x5b68c1[_0x3699('0x5')],_0x5b68c1[_0x3699('0x30')],_0x5b68c1['appdata']));if(_0x5b68c1[_0x3699('0x30')]['toLowerCase']()==_0x3699('0x31')&&_[_0x3699('0x32')](_0x5b68c1['appdata']['toLowerCase'](),_0x3699('0x33'))){var _0x4d1d7d=_0x5b68c1[_0x3699('0x34')][_0x3699('0x35')]('=');var _0x578d3f=_0x4d1d7d[0x0][_0x3699('0x36')](_0x4d1d7d[0x0][_0x3699('0x37')]('(')+0x1,_0x4d1d7d[0x0]['lastIndexOf'](')'));var _0x54842a=_0x4d1d7d[0x1];recordings[_0x5b68c1[_0x3699('0x5')]][_0x578d3f]=_0x54842a;}}}catch(_0x52a400){utils[_0x3699('0x12')](util[_0x3699('0x3')](_0x3699('0x38'),_0x5b68c1[_0x3699('0x5')]),_0x52a400);}};exports[_0x3699('0x39')]=function(_0x497306){try{if(!_[_0x3699('0x14')](recordings[_0x497306[_0x3699('0x5')]])){utils[_0x3699('0xd')](util[_0x3699('0x3')](_0x3699('0x3a'),_0x497306[_0x3699('0x5')]),_0x497306);utils['info'](util['format'](_0x3699('0x3b'),_0x497306[_0x3699('0x5')],_0x497306['queue']));recordings[_0x497306[_0x3699('0x5')]][_0x3699('0x3c')]=_0x497306[_0x3699('0x3c')];}}catch(_0xe37fec){utils[_0x3699('0x12')](util[_0x3699('0x3')](_0x3699('0x3a'),_0x497306[_0x3699('0x5')]),_0xe37fec);}}; \ No newline at end of file +var _0xe42d=['request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','.wav49','replace','find','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','format','uniqueid','accountcode','then','UserId'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe42d,0xa4));var _0xde42=function(_0x26aafa,_0x100c92){_0x26aafa=_0x26aafa-0x0;var _0x13b20e=_0xe42d[_0x26aafa];return _0x13b20e;};'use strict';var _=require(_0xde42('0x0'));var util=require('util');var utils=require(_0xde42('0x1'));var recordings={};function writeDB(_0x2d9951){utils['info'](util[_0xde42('0x2')]('[%s][recordings][writeDB]',_0x2d9951[_0xde42('0x3')]));if(_0x2d9951['accountcode']){utils['getUserByInternal'](_0x2d9951[_0xde42('0x4')])[_0xde42('0x5')](function(_0x3dd2e7){if(_0x3dd2e7){_0x2d9951['membername']=_0x3dd2e7['name'];_0x2d9951[_0xde42('0x6')]=_0x3dd2e7['id'];}utils[_0xde42('0x7')](_0xde42('0x8'),_0x2d9951);});}else{utils[_0xde42('0x7')](_0xde42('0x8'),_0x2d9951);}}exports[_0xde42('0x9')]=function(_0x347630){try{utils[_0xde42('0xa')](util['format'](_0xde42('0xb'),_0x347630[_0xde42('0x3')]),_0x347630);if(_0x347630[_0xde42('0x3')]==_0x347630[_0xde42('0xc')]){utils[_0xde42('0xd')](util[_0xde42('0x2')](_0xde42('0xe'),_0x347630[_0xde42('0x3')],_0x347630[_0xde42('0xf')],_0x347630[_0xde42('0x10')]));recordings[_0x347630['uniqueid']]={'uniqueid':_0x347630[_0xde42('0x3')],'accountcode':_0x347630[_0xde42('0x4')],'exten':_0x347630[_0xde42('0x10')],'context':_0x347630[_0xde42('0xf')],'channel':_0x347630[_0xde42('0x11')],'monitors':[]};}}catch(_0x461435){utils[_0xde42('0x12')](util[_0xde42('0x2')](_0xde42('0xb'),_0x347630['uniqueid']),_0x461435);}};exports[_0xde42('0x13')]=function(_0x5c6dd0){try{utils[_0xde42('0xa')](util[_0xde42('0x2')]('[%s][recordings][newstate]',_0x5c6dd0[_0xde42('0x3')]),_0x5c6dd0);if(!_[_0xde42('0x14')](recordings[_0x5c6dd0['uniqueid']])&&_0x5c6dd0[_0xde42('0x15')]==0x6){utils[_0xde42('0xd')](util[_0xde42('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5c6dd0[_0xde42('0x3')],_0x5c6dd0[_0xde42('0xf')],_0x5c6dd0['channel']));}else if(!_[_0xde42('0x14')](recordings[_0x5c6dd0['linkedid']])&&_0x5c6dd0[_0xde42('0x15')]==0x6&&_0x5c6dd0['context']!='transfer'){utils[_0xde42('0xd')](util[_0xde42('0x2')](_0xde42('0x16'),_0x5c6dd0[_0xde42('0x3')],_0x5c6dd0[_0xde42('0xc')],_0x5c6dd0['context'],_0x5c6dd0[_0xde42('0x11')]));recordings[_0x5c6dd0[_0xde42('0xc')]]['accountcode']=_0x5c6dd0[_0xde42('0x4')];}}catch(_0x2f52bc){utils['error'](util['format']('[%s][recordings][newstate]',_0x5c6dd0[_0xde42('0x3')]),_0x2f52bc);}};exports[_0xde42('0x17')]=function(_0xe8386a){try{if(!_[_0xde42('0x14')](_0xe8386a[_0xde42('0x18')])&&!_[_0xde42('0x14')](_0xe8386a['variable'][_0xde42('0x19')])){utils['debug'](util[_0xde42('0x2')](_0xde42('0x1a'),_0xe8386a['uniqueid']),_0xe8386a);utils['info'](util[_0xde42('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0xe8386a[_0xde42('0x3')],_0xe8386a[_0xde42('0x18')],_0xe8386a['value']));if(_[_0xde42('0x1b')](_0xe8386a[_0xde42('0x1c')],_0xde42('0x1d'))){_0xe8386a[_0xde42('0x1c')]=_0xe8386a[_0xde42('0x1c')][_0xde42('0x1e')](_0xde42('0x1d'),'.WAV');}if(recordings[_0xe8386a[_0xde42('0xc')]]){var _0x1d23a4=_[_0xde42('0x1f')](recordings[_0xe8386a['linkedid']][_0xde42('0x20')],{'value':_0xe8386a['value']});if(_[_0xde42('0x14')](_0x1d23a4)){recordings[_0xe8386a[_0xde42('0xc')]][_0xde42('0x20')][_0xde42('0x21')]({'value':_0xe8386a[_0xde42('0x1c')]});}}}}catch(_0x378633){utils[_0xde42('0x12')](util[_0xde42('0x2')]('[%s][recordings][varset]',_0xe8386a['uniqueid']),_0x378633);}};exports['hangup']=function(_0x5db1f7){try{if(!_[_0xde42('0x14')](recordings[_0x5db1f7['uniqueid']])){utils[_0xde42('0xa')](util['format']('[%s][recordings][hangup]',_0x5db1f7[_0xde42('0x3')]),_0x5db1f7);utils[_0xde42('0xd')](util[_0xde42('0x2')](_0xde42('0x22'),_0x5db1f7[_0xde42('0x3')],_0x5db1f7[_0xde42('0x23')],_0x5db1f7['calleridname'],_0x5db1f7[_0xde42('0x24')]));recordings[_0x5db1f7['uniqueid']][_0xde42('0x23')]=_0x5db1f7[_0xde42('0x23')];recordings[_0x5db1f7[_0xde42('0x3')]][_0xde42('0x25')]=_0x5db1f7[_0xde42('0x25')];recordings[_0x5db1f7[_0xde42('0x3')]]['connectedlinenum']=_0x5db1f7[_0xde42('0x26')];recordings[_0x5db1f7['uniqueid']][_0xde42('0x27')]=_0x5db1f7[_0xde42('0x27')];if(recordings[_0x5db1f7[_0xde42('0x3')]][_0xde42('0x28')]==_0xde42('0x29')&&recordings[_0x5db1f7[_0xde42('0x3')]][_0xde42('0x4')]){recordings[_0x5db1f7[_0xde42('0x3')]]['connectedlinenum']=recordings[_0x5db1f7[_0xde42('0x3')]]['accountcode'];recordings[_0x5db1f7[_0xde42('0x3')]]['connectedlinename']='';}recordings[_0x5db1f7[_0xde42('0x3')]][_0xde42('0x20')][_0xde42('0x2a')](function(_0x1c4889){var _0xa7fd87=_[_0xde42('0x2b')](recordings[_0x5db1f7[_0xde42('0x3')]]);_0xa7fd87[_0xde42('0x1c')]=_0x1c4889[_0xde42('0x1c')];writeDB(_0xa7fd87);});delete recordings[_0x5db1f7[_0xde42('0x3')]];}}catch(_0x606d7b){utils['error'](util[_0xde42('0x2')]('[%s][recordings][hangup]',_0x5db1f7['uniqueid']),_0x606d7b);}};exports['newexten']=function(_0x356dce){try{if(!_[_0xde42('0x14')](recordings[_0x356dce[_0xde42('0x3')]])){utils[_0xde42('0xa')](util[_0xde42('0x2')](_0xde42('0x2c'),_0x356dce[_0xde42('0x3')]),_0x356dce);utils[_0xde42('0xd')](util[_0xde42('0x2')](_0xde42('0x2d'),_0x356dce[_0xde42('0x3')],_0x356dce[_0xde42('0x2e')],_0x356dce['appdata']));if(_0x356dce[_0xde42('0x2e')][_0xde42('0x2f')]()==_0xde42('0x30')&&_[_0xde42('0x31')](_0x356dce['appdata']['toLowerCase'](),_0xde42('0x32'))){var _0x2d4f53=_0x356dce['appdata'][_0xde42('0x33')]('=');var _0xe0c306=_0x2d4f53[0x0][_0xde42('0x34')](_0x2d4f53[0x0]['lastIndexOf']('(')+0x1,_0x2d4f53[0x0][_0xde42('0x35')](')'));var _0x396db4=_0x2d4f53[0x1];recordings[_0x356dce[_0xde42('0x3')]][_0xe0c306]=_0x396db4;}}}catch(_0x2e173c){utils[_0xde42('0x12')](util[_0xde42('0x2')](_0xde42('0x2c'),_0x356dce['uniqueid']),_0x2e173c);}};exports[_0xde42('0x36')]=function(_0x3e4194){try{if(!_['isNil'](recordings[_0x3e4194[_0xde42('0x3')]])){utils['debug'](util[_0xde42('0x2')](_0xde42('0x37'),_0x3e4194['uniqueid']),_0x3e4194);utils[_0xde42('0xd')](util[_0xde42('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3e4194[_0xde42('0x3')],_0x3e4194[_0xde42('0x38')]));recordings[_0x3e4194['uniqueid']][_0xde42('0x38')]=_0x3e4194['queue'];}}catch(_0x41aa77){utils[_0xde42('0x12')](util[_0xde42('0x2')]('[%s][recordings][queuecallerjoin]',_0x3e4194['uniqueid']),_0x41aa77);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 126e44c..e3fb792 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 _0x68dd=['blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','type','attended','uniqueid','CreateVoiceTransferReport','blinds','debug','format','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname'];(function(_0x27b0a9,_0x225e93){var _0x822b01=function(_0x5977d3){while(--_0x5977d3){_0x27b0a9['push'](_0x27b0a9['shift']());}};_0x822b01(++_0x225e93);}(_0x68dd,0xb0));var _0xd68d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x68dd[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xd68d('0x0'));var util=require('util');var utils=require(_0xd68d('0x1'));function writeDB(_0x483afe){utils[_0xd68d('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x483afe[_0xd68d('0x3')]===_0xd68d('0x4')?_0x483afe['origtransfereruniqueid']:_0x483afe[_0xd68d('0x5')],_0x483afe[_0xd68d('0x3')]));utils['request'](_0xd68d('0x6'),_0x483afe);}exports[_0xd68d('0x7')]={};exports['blindtransfer']=function(_0x1880e2){try{utils[_0xd68d('0x8')](util[_0xd68d('0x9')](_0xd68d('0xa'),_0x1880e2[_0xd68d('0x5')]),_0x1880e2);utils[_0xd68d('0x2')](util[_0xd68d('0x9')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1880e2[_0xd68d('0x5')],_0x1880e2[_0xd68d('0xb')],_0x1880e2['transferercalleridname'],_0x1880e2[_0xd68d('0xc')],_0x1880e2[_0xd68d('0xd')]));_0x1880e2[_0xd68d('0x3')]=_0xd68d('0xe');exports[_0xd68d('0x7')][_0x1880e2[_0xd68d('0xf')]]=_0x1880e2;writeDB(_0x1880e2);}catch(_0x15e59d){utils[_0xd68d('0x10')](util['format'](_0xd68d('0xa'),_0x1880e2[_0xd68d('0x5')]),_0x15e59d);}};exports['attendedtransfer']=function(_0x446330){try{utils[_0xd68d('0x8')](util[_0xd68d('0x9')](_0xd68d('0x11'),_0x446330[_0xd68d('0x12')]),_0x446330);utils['info'](util[_0xd68d('0x9')](_0xd68d('0x13'),_0x446330[_0xd68d('0x12')],_0x446330[_0xd68d('0x14')],_0x446330[_0xd68d('0x15')],_0x446330['transfertargetcalleridnum'],_0x446330[_0xd68d('0x16')]));_0x446330=_['assign'](_0x446330,{'transfererchannel':_0x446330[_0xd68d('0x17')],'transferercalleridnum':_0x446330[_0xd68d('0x14')],'transferercalleridname':_0x446330['origtransferercalleridname'],'transfererconnectedlinenum':_0x446330[_0xd68d('0x18')],'transfererconnectedlinename':_0x446330[_0xd68d('0x19')],'transfereraccountcode':_0x446330[_0xd68d('0x1a')],'transferercontext':_0x446330[_0xd68d('0x1b')],'transfererexten':_0x446330['secondtransfererexten'],'transfererlinkedid':_0x446330['origtransfererlinkedid'],'context':_0x446330[_0xd68d('0x1c')],'extension':_0x446330['origtransfererexten'],'type':_0xd68d('0x4')});if(_[_0xd68d('0x1d')](_0x446330[_0xd68d('0x1e')])){_0x446330=_[_0xd68d('0x1f')](_0x446330,{'transfereechannel':_0x446330[_0xd68d('0x20')],'transfereecalleridnum':_0x446330[_0xd68d('0x21')],'transfereecalleridname':_0x446330[_0xd68d('0x16')],'transfereeconnectedlinenum':_0x446330[_0xd68d('0x22')],'transfereeconnectedlinename':_0x446330['transfertargetconnectedlinename'],'transfereeaccountcode':_0x446330['transfertargetaccountcode'],'transfereecontext':_0x446330[_0xd68d('0x23')],'transfereeexten':_0x446330[_0xd68d('0x24')],'transfereelinkedid':_0x446330[_0xd68d('0x25')]});}writeDB(_0x446330);}catch(_0x2d0cf8){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0x446330[_0xd68d('0x12')]),_0x2d0cf8);}}; \ No newline at end of file +var _0x8a8a=['transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x2d15b3,_0x251574){var _0x13f517=function(_0x265bcb){while(--_0x265bcb){_0x2d15b3['push'](_0x2d15b3['shift']());}};_0x13f517(++_0x251574);}(_0x8a8a,0x1b3));var _0xa8a8=function(_0x41f820,_0x175a98){_0x41f820=_0x41f820-0x0;var _0x163bc8=_0x8a8a[_0x41f820];return _0x163bc8;};'use strict';var _=require(_0xa8a8('0x0'));var util=require(_0xa8a8('0x1'));var utils=require(_0xa8a8('0x2'));function writeDB(_0x41484b){utils[_0xa8a8('0x3')](util[_0xa8a8('0x4')](_0xa8a8('0x5'),_0x41484b[_0xa8a8('0x6')]===_0xa8a8('0x7')?_0x41484b[_0xa8a8('0x8')]:_0x41484b['uniqueid'],_0x41484b[_0xa8a8('0x6')]));utils[_0xa8a8('0x9')](_0xa8a8('0xa'),_0x41484b);}exports[_0xa8a8('0xb')]={};exports[_0xa8a8('0xc')]=function(_0x35d15e){try{utils['debug'](util['format'](_0xa8a8('0xd'),_0x35d15e[_0xa8a8('0xe')]),_0x35d15e);utils['info'](util[_0xa8a8('0x4')](_0xa8a8('0xf'),_0x35d15e[_0xa8a8('0xe')],_0x35d15e[_0xa8a8('0x10')],_0x35d15e[_0xa8a8('0x11')],_0x35d15e[_0xa8a8('0x12')],_0x35d15e['transfereecalleridname']));_0x35d15e[_0xa8a8('0x6')]=_0xa8a8('0x13');exports[_0xa8a8('0xb')][_0x35d15e['transfereruniqueid']]=_0x35d15e;writeDB(_0x35d15e);}catch(_0x39f5db){utils[_0xa8a8('0x14')](util[_0xa8a8('0x4')](_0xa8a8('0xd'),_0x35d15e[_0xa8a8('0xe')]),_0x39f5db);}};exports['attendedtransfer']=function(_0x3978e0){try{utils['debug'](util[_0xa8a8('0x4')](_0xa8a8('0x15'),_0x3978e0[_0xa8a8('0x8')]),_0x3978e0);utils[_0xa8a8('0x3')](util[_0xa8a8('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3978e0['origtransfereruniqueid'],_0x3978e0['origtransferercalleridnum'],_0x3978e0[_0xa8a8('0x16')],_0x3978e0[_0xa8a8('0x17')],_0x3978e0[_0xa8a8('0x18')]));_0x3978e0=_[_0xa8a8('0x19')](_0x3978e0,{'transfererchannel':_0x3978e0[_0xa8a8('0x1a')],'transferercalleridnum':_0x3978e0[_0xa8a8('0x1b')],'transferercalleridname':_0x3978e0[_0xa8a8('0x16')],'transfererconnectedlinenum':_0x3978e0[_0xa8a8('0x1c')],'transfererconnectedlinename':_0x3978e0[_0xa8a8('0x1d')],'transfereraccountcode':_0x3978e0[_0xa8a8('0x1e')],'transferercontext':_0x3978e0[_0xa8a8('0x1f')],'transfererexten':_0x3978e0['secondtransfererexten'],'transfererlinkedid':_0x3978e0['origtransfererlinkedid'],'context':_0x3978e0[_0xa8a8('0x20')],'extension':_0x3978e0[_0xa8a8('0x21')],'type':'attended'});if(_['isNil'](_0x3978e0[_0xa8a8('0x22')])){_0x3978e0=_['assign'](_0x3978e0,{'transfereechannel':_0x3978e0[_0xa8a8('0x23')],'transfereecalleridnum':_0x3978e0['transfertargetcalleridnum'],'transfereecalleridname':_0x3978e0['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3978e0[_0xa8a8('0x24')],'transfereeconnectedlinename':_0x3978e0[_0xa8a8('0x25')],'transfereeaccountcode':_0x3978e0['transfertargetaccountcode'],'transfereecontext':_0x3978e0[_0xa8a8('0x26')],'transfereeexten':_0x3978e0[_0xa8a8('0x27')],'transfereelinkedid':_0x3978e0[_0xa8a8('0x28')]});}writeDB(_0x3978e0);}catch(_0xc64e7c){utils[_0xa8a8('0x14')](util['format'](_0xa8a8('0x15'),_0x3978e0['origtransfereruniqueid']),_0xc64e7c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8a26bfd..8493463 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 _0xc93e=['[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','now','isAfter','http','../../config/logger','xdr','info','debug','request','then','[utils][request]\x20name:%s','inspect','catch','error','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','getUserByName'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xc93e,0x11b));var _0xec93=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0xc93e[_0x3337b6];return _0x568270;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require('util');var client=jayson['client'][_0xec93('0x0')]({'port':0x2329});var logger=require(_0xec93('0x1'))(_0xec93('0x2'));exports[_0xec93('0x3')]=function(_0x13b536,_0x4858d6){logger['info'](_0x13b536,_0x4858d6?util['inspect'](_0x4858d6,{'showHidden':![],'depth':null}):'');};exports[_0xec93('0x4')]=function(_0x57e542,_0x26ceff){logger[_0xec93('0x4')](_0x57e542,_0x26ceff?util['inspect'](_0x26ceff,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1a1f03,_0x89c5d6){logger['error'](_0x1a1f03,_0x89c5d6?util['inspect'](_0x89c5d6,{'showHidden':![],'depth':null}):'');};exports[_0xec93('0x5')]=function(_0x38f4c6,_0x1e4497){return client[_0xec93('0x5')](_0x38f4c6,{'body':_0x1e4497})[_0xec93('0x6')](function(_0xad3455){logger[_0xec93('0x4')](_0xec93('0x7'),_0x38f4c6,_0xad3455?util[_0xec93('0x8')](_0xad3455,{'showHidden':![],'depth':null}):'');})[_0xec93('0x9')](function(_0x3a45e2){logger[_0xec93('0xa')](_0xec93('0x7'),_0x38f4c6,_0x3a45e2?util[_0xec93('0x8')](_0x3a45e2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x45f358){return client[_0xec93('0x5')](_0xec93('0xb'),{'options':{'raw':!![],'attributes':['id',_0xec93('0xc'),_0xec93('0xd'),_0xec93('0xe')],'where':_0x45f358,'limit':0x1}})[_0xec93('0x6')](function(_0x4e9d10){logger['debug'](_0xec93('0xf'),JSON[_0xec93('0x10')](_0x45f358),_0x4e9d10?util[_0xec93('0x8')](_0x4e9d10,{'showHidden':![],'depth':null}):'');return _0x4e9d10[_0xec93('0x11')][_0xec93('0x12')]?_0x4e9d10[_0xec93('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x20b472){return new BPromise(function(_0x49f420,_0x4d2f7b){if(_0x20b472){return getUser({'internal':_0x20b472})['then'](function(_0x20546a){logger[_0xec93('0x3')](_0xec93('0x13'),_0x20b472,_0x20546a?_0xec93('0x14'):_0xec93('0x15'));return _0x49f420(_0x20546a);})[_0xec93('0x9')](function(_0x1a61f8){logger[_0xec93('0xa')](_0xec93('0x16'),_0x1a61f8?util['inspect'](_0x1a61f8,{'showHidden':![],'depth':null}):'');return _0x49f420(null);});}return _0x49f420(null);});};exports[_0xec93('0x17')]=function(_0x3785cd){return new BPromise(function(_0x4cc20b,_0x1582bc){if(_0x3785cd){return getUser({'interface':_0x3785cd})[_0xec93('0x6')](function(_0x5cb7f2){logger[_0xec93('0x3')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3785cd,_0x5cb7f2?'found':'notfound');return _0x4cc20b(_0x5cb7f2);})[_0xec93('0x9')](function(_0x27637d){logger[_0xec93('0xa')]('[utils][getUserByInterface]',_0x27637d?util[_0xec93('0x8')](_0x27637d,{'showHidden':![],'depth':null}):'');return _0x4cc20b(null);});}return _0x4cc20b(null);});};exports[_0xec93('0x18')]=function(_0x451ce4){return new BPromise(function(_0x33aba7,_0x29262a){if(_0x451ce4){return getUser({'name':_0x451ce4})[_0xec93('0x6')](function(_0x1c3598){logger[_0xec93('0x3')](_0xec93('0x19'),_0x451ce4,_0x1c3598?_0xec93('0x14'):_0xec93('0x15'));return _0x33aba7(_0x1c3598);})[_0xec93('0x9')](function(_0x2b9e83){logger[_0xec93('0xa')](_0xec93('0x1a'),_0x2b9e83?util[_0xec93('0x8')](_0x2b9e83,{'showHidden':![],'depth':null}):'');return _0x33aba7(null);});}return _0x33aba7(null);});};exports[_0xec93('0x1b')]=function(_0xa665ef){return new BPromise(function(_0x58fe7e,_0x57e661){if(_0xa665ef){return client[_0xec93('0x5')](_0xec93('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xec93('0xd'),_0xec93('0x1d'),_0xec93('0x1e'),'acwTimeout'],'where':{'name':_0xa665ef},'limit':0x1}})[_0xec93('0x6')](function(_0x2ab4e7){logger[_0xec93('0x4')](_0xec93('0x1f'),_0xa665ef,_0x2ab4e7?util[_0xec93('0x8')](_0x2ab4e7,{'showHidden':![],'depth':null}):'');logger['info'](_0xec93('0x20'),_0xa665ef,_0x2ab4e7?_0xec93('0x14'):'notfound');return _0x58fe7e(_0x2ab4e7[_0xec93('0x11')][_0xec93('0x12')]?_0x2ab4e7['result'][0x0]:null);})['catch'](function(_0x1971b0){logger[_0xec93('0xa')](_0xec93('0x21'),_0x1971b0?util[_0xec93('0x8')](_0x1971b0,{'showHidden':![],'depth':null}):'');return _0x58fe7e(null);});}return _0x58fe7e(null);});};exports[_0xec93('0x22')]=function(_0x4c1dbc,_0x342333){return moment(_0x4c1dbc)[_0xec93('0x23')](_0x342333,_0xec93('0x24'))[_0xec93('0x25')](_0xec93('0x26'));};exports[_0xec93('0x27')]=function(_0xfe42fd,_0x120445){return moment(_0xfe42fd)[_0xec93('0x28')](_0x120445,_0xec93('0x24'))[_0xec93('0x25')](_0xec93('0x26'));};exports['diffTime']=function(_0x151490,_0x6b2b18){return moment(_0x151490)['diff'](moment(_0x6b2b18),_0xec93('0x24'));};exports[_0xec93('0x29')]=function(_0x172ead,_0x5e9618){return parseInt(_0x172ead,0xa)+parseInt(_0x5e9618,0xa);};exports[_0xec93('0x2a')]=function(){return moment()[_0xec93('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xec93('0x2b')]=function(_0x47820f,_0x45c5a5){if(_0x45c5a5){return moment(_0x47820f)[_0xec93('0x2b')](_0x45c5a5);}return!![];};exports['isBefore']=function(_0x506612,_0x3da87c){if(_0x3da87c){return moment(_0x506612)['isBefore'](_0x3da87c);}else if(_0x506612){return!![];}return![];}; \ No newline at end of file +var _0xc1c6=['acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','type'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0xc1c6,0xd0));var _0x6c1c=function(_0x1f18dc,_0x4839e7){_0x1f18dc=_0x1f18dc-0x0;var _0x5a73b2=_0xc1c6[_0x1f18dc];return _0x5a73b2;};'use strict';var BPromise=require(_0x6c1c('0x0'));var jayson=require('jayson/promise');var moment=require(_0x6c1c('0x1'));var util=require(_0x6c1c('0x2'));var client=jayson['client'][_0x6c1c('0x3')]({'port':0x2329});var logger=require(_0x6c1c('0x4'))(_0x6c1c('0x5'));exports[_0x6c1c('0x6')]=function(_0x30a527,_0xa12822){logger['info'](_0x30a527,_0xa12822?util[_0x6c1c('0x7')](_0xa12822,{'showHidden':![],'depth':null}):'');};exports[_0x6c1c('0x8')]=function(_0x34b382,_0x2df10e){logger['debug'](_0x34b382,_0x2df10e?util[_0x6c1c('0x7')](_0x2df10e,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x49a6b1,_0x39c48c){logger[_0x6c1c('0x9')](_0x49a6b1,_0x39c48c?util[_0x6c1c('0x7')](_0x39c48c,{'showHidden':![],'depth':null}):'');};exports[_0x6c1c('0xa')]=function(_0x1e94b6,_0x2d7f4d){return client[_0x6c1c('0xa')](_0x1e94b6,{'body':_0x2d7f4d})[_0x6c1c('0xb')](function(_0x56d47c){logger[_0x6c1c('0x8')](_0x6c1c('0xc'),_0x1e94b6,_0x56d47c?util[_0x6c1c('0x7')](_0x56d47c,{'showHidden':![],'depth':null}):'');})[_0x6c1c('0xd')](function(_0xa7be84){logger[_0x6c1c('0x9')](_0x6c1c('0xc'),_0x1e94b6,_0xa7be84?util[_0x6c1c('0x7')](_0xa7be84,{'showHidden':![],'depth':null}):'');});};function getUser(_0x39d1cf){return client[_0x6c1c('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x6c1c('0xe'),_0x6c1c('0xf'),'interface'],'where':_0x39d1cf,'limit':0x1}})[_0x6c1c('0xb')](function(_0x4e0d24){logger[_0x6c1c('0x8')](_0x6c1c('0x10'),JSON['stringify'](_0x39d1cf),_0x4e0d24?util['inspect'](_0x4e0d24,{'showHidden':![],'depth':null}):'');return _0x4e0d24[_0x6c1c('0x11')][_0x6c1c('0x12')]?_0x4e0d24[_0x6c1c('0x11')][0x0]:null;});}exports[_0x6c1c('0x13')]=function(_0x8b281){return new BPromise(function(_0xda41bc,_0x44fadc){if(_0x8b281){return getUser({'internal':_0x8b281})['then'](function(_0x4e508f){logger[_0x6c1c('0x6')](_0x6c1c('0x14'),_0x8b281,_0x4e508f?_0x6c1c('0x15'):'notfound');return _0xda41bc(_0x4e508f);})['catch'](function(_0x407bdd){logger['error'](_0x6c1c('0x16'),_0x407bdd?util[_0x6c1c('0x7')](_0x407bdd,{'showHidden':![],'depth':null}):'');return _0xda41bc(null);});}return _0xda41bc(null);});};exports[_0x6c1c('0x17')]=function(_0x557511){return new BPromise(function(_0x18ac5f,_0x133f2f){if(_0x557511){return getUser({'interface':_0x557511})[_0x6c1c('0xb')](function(_0x580384){logger[_0x6c1c('0x6')](_0x6c1c('0x18'),_0x557511,_0x580384?_0x6c1c('0x15'):'notfound');return _0x18ac5f(_0x580384);})[_0x6c1c('0xd')](function(_0xdba07d){logger['error'](_0x6c1c('0x19'),_0xdba07d?util[_0x6c1c('0x7')](_0xdba07d,{'showHidden':![],'depth':null}):'');return _0x18ac5f(null);});}return _0x18ac5f(null);});};exports[_0x6c1c('0x1a')]=function(_0x313676){return new BPromise(function(_0x31af49,_0x25af89){if(_0x313676){return getUser({'name':_0x313676})[_0x6c1c('0xb')](function(_0x49495a){logger[_0x6c1c('0x6')](_0x6c1c('0x1b'),_0x313676,_0x49495a?_0x6c1c('0x15'):_0x6c1c('0x1c'));return _0x31af49(_0x49495a);})[_0x6c1c('0xd')](function(_0x218b21){logger[_0x6c1c('0x9')](_0x6c1c('0x1d'),_0x218b21?util[_0x6c1c('0x7')](_0x218b21,{'showHidden':![],'depth':null}):'');return _0x31af49(null);});}return _0x31af49(null);});};exports['getVoiceQueueByName']=function(_0x25f3e6){return new BPromise(function(_0x1ac936,_0x205714){if(_0x25f3e6){return client[_0x6c1c('0xa')](_0x6c1c('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6c1c('0xf'),_0x6c1c('0x1f'),_0x6c1c('0x20'),'acwTimeout'],'where':{'name':_0x25f3e6},'limit':0x1}})[_0x6c1c('0xb')](function(_0x3f5000){logger[_0x6c1c('0x8')](_0x6c1c('0x21'),_0x25f3e6,_0x3f5000?util['inspect'](_0x3f5000,{'showHidden':![],'depth':null}):'');logger[_0x6c1c('0x6')](_0x6c1c('0x22'),_0x25f3e6,_0x3f5000?_0x6c1c('0x15'):_0x6c1c('0x1c'));return _0x1ac936(_0x3f5000[_0x6c1c('0x11')]['length']?_0x3f5000[_0x6c1c('0x11')][0x0]:null);})[_0x6c1c('0xd')](function(_0x5f3be5){logger[_0x6c1c('0x9')](_0x6c1c('0x23'),_0x5f3be5?util[_0x6c1c('0x7')](_0x5f3be5,{'showHidden':![],'depth':null}):'');return _0x1ac936(null);});}return _0x1ac936(null);});};exports[_0x6c1c('0x24')]=function(_0x2982a2,_0x3d4628){return moment(_0x2982a2)[_0x6c1c('0x25')](_0x3d4628,_0x6c1c('0x26'))[_0x6c1c('0x27')](_0x6c1c('0x28'));};exports[_0x6c1c('0x29')]=function(_0x48c5b1,_0x56e311){return moment(_0x48c5b1)[_0x6c1c('0x2a')](_0x56e311,_0x6c1c('0x26'))['format'](_0x6c1c('0x28'));};exports['diffTime']=function(_0x2493d5,_0x161b85){return moment(_0x2493d5)[_0x6c1c('0x2b')](moment(_0x161b85),_0x6c1c('0x26'));};exports[_0x6c1c('0x2c')]=function(_0x39b199,_0x4dbf7b){return parseInt(_0x39b199,0xa)+parseInt(_0x4dbf7b,0xa);};exports[_0x6c1c('0x2d')]=function(){return moment()[_0x6c1c('0x27')](_0x6c1c('0x28'));};exports[_0x6c1c('0x2e')]=function(_0x274196,_0x8f71a0){if(_0x8f71a0){return moment(_0x274196)['isAfter'](_0x8f71a0);}return!![];};exports[_0x6c1c('0x2f')]=function(_0x176d07,_0x203527){if(_0x203527){return moment(_0x176d07)[_0x6c1c('0x2f')](_0x203527);}else if(_0x176d07){return!![];}return![];}; \ No newline at end of file